From: support Date: Tue, 5 Apr 2022 07:23:15 +0000 (+0000) Subject: Built motion from commit 54cdaf16.|2.6.6 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22card-image.png//%22?a=commitdiff_plain;h=15ceaf62c6a3e6d3191c466d82848d57f5289b0a;p=motion2.git Built motion from commit 54cdaf16.|2.6.6 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index a7709f9..1787d93 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-04-04T07:35:44.153Z", + "time": "2022-04-05T07:13:16.004Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index d3ebfc4..fd00633 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-04-04T07:35:44.153Z", + "time": "2022-04-05T07:13:16.004Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/package.json b/package.json index 4868cbe..faf35dd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "motion", - "version": "2.6.7", + "version": "2.6.6", "description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.", "main": "server/app.js", "engines": { diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index b9ecbfe..5e6d606 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 _0x6a4f=['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]','urlForward[headers],\x20browser[wsindowHeight]','exports','VIRTUAL','getDataValue','contactManager','integration','jscripty','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING'];(function(_0x2678d6,_0x4e2001){var _0x475503=function(_0x34b23d){while(--_0x34b23d){_0x2678d6['push'](_0x2678d6['shift']());}};_0x475503(++_0x4e2001);}(_0x6a4f,0x17d));var _0xf6a4=function(_0xaaf083,_0x4b75cf){_0xaaf083=_0xaaf083-0x0;var _0x203df4=_0x6a4f[_0xaaf083];return _0x203df4;};'use strict';var Sequelize=require('sequelize');module[_0xf6a4('0x0')]={'name':{'type':Sequelize[_0xf6a4('0x1')],'get':function(_0x5c91aa){return this[_0xf6a4('0x2')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xf6a4('0x3'),_0xf6a4('0x4'),'motionbar',_0xf6a4('0x5'),_0xf6a4('0x6'),'browser',_0xf6a4('0x7'),_0xf6a4('0x8')]],'msg':_0xf6a4('0x9')}},'comment':_0xf6a4('0x9')},'data1':{'type':Sequelize[_0xf6a4('0xa')](0x1000),'comment':_0xf6a4('0xb')},'data2':{'type':Sequelize[_0xf6a4('0xa')](0x1000),'comment':_0xf6a4('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xf6a4('0xa')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xf6a4('0xa')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xf6a4('0xa')],'comments':_0xf6a4('0xd')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0x4f94=['script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','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]','TEXT','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','bot'];(function(_0x1eb4e0,_0x4ebc2d){var _0x18ec21=function(_0x28c9a9){while(--_0x28c9a9){_0x1eb4e0['push'](_0x1eb4e0['shift']());}};_0x18ec21(++_0x4ebc2d);}(_0x4f94,0x1a9));var _0x44f9=function(_0x23a8e3,_0x3a26ac){_0x23a8e3=_0x23a8e3-0x0;var _0x5d3e58=_0x4f94[_0x23a8e3];return _0x5d3e58;};'use strict';var Sequelize=require(_0x44f9('0x0'));module[_0x44f9('0x1')]={'name':{'type':Sequelize[_0x44f9('0x2')],'get':function(_0x477bca){return this[_0x44f9('0x3')](_0x44f9('0x4'));}},'action':{'type':Sequelize[_0x44f9('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x44f9('0x6'),_0x44f9('0x7'),_0x44f9('0x8'),'jscripty','urlForward','browser',_0x44f9('0x9'),_0x44f9('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x44f9('0xb')},'data1':{'type':Sequelize[_0x44f9('0x5')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x44f9('0x5')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x44f9('0x5')](0x1000),'comment':_0x44f9('0xc')},'data4':{'type':Sequelize[_0x44f9('0x5')](0x1000),'comments':_0x44f9('0xd')},'data5':{'type':Sequelize[_0x44f9('0x5')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x44f9('0x5')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x44f9('0xe')],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 975ea89..cbc8ef9 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 _0x3d4f=['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','limit','undefined','count','set','Content-Range','json','reject','update','then','destroy','end','error','name','send','body','Action','find','params','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x29915f,_0x47cf5f){var _0x418b5c=function(_0x40c350){while(--_0x40c350){_0x29915f['push'](_0x29915f['shift']());}};_0x418b5c(++_0x47cf5f);}(_0x3d4f,0x17f));var _0xf3d4=function(_0x3fdae4,_0x16182d){_0x3fdae4=_0x3fdae4-0x0;var _0x5c4538=_0x3d4f[_0x3fdae4];return _0x5c4538;};'use strict';var emlformat=require(_0xf3d4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf3d4('0x1'));var jsonpatch=require(_0xf3d4('0x2'));var rp=require(_0xf3d4('0x3'));var moment=require(_0xf3d4('0x4'));var BPromise=require(_0xf3d4('0x5'));var Mustache=require(_0xf3d4('0x6'));var util=require(_0xf3d4('0x7'));var path=require('path');var sox=require(_0xf3d4('0x8'));var csv=require(_0xf3d4('0x9'));var ejs=require(_0xf3d4('0xa'));var fs=require('fs');var fs_extra=require(_0xf3d4('0xb'));var _=require(_0xf3d4('0xc'));var squel=require('squel');var crypto=require(_0xf3d4('0xd'));var jsforce=require(_0xf3d4('0xe'));var deskjs=require(_0xf3d4('0xf'));var toCsv=require(_0xf3d4('0x9'));var querystring=require(_0xf3d4('0x10'));var Papa=require(_0xf3d4('0x11'));var Redis=require(_0xf3d4('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf3d4('0x13'));var as=require(_0xf3d4('0x14'));var hardwareService=require(_0xf3d4('0x15'));var logger=require(_0xf3d4('0x16'))(_0xf3d4('0x17'));var utils=require(_0xf3d4('0x18'));var config=require(_0xf3d4('0x19'));var licenseUtil=require(_0xf3d4('0x1a'));var db=require(_0xf3d4('0x1b'))['db'];function respondWithStatusCode(_0x432d0f,_0x5ac29e){_0x5ac29e=_0x5ac29e||0xcc;return function(_0x3a640b){if(_0x3a640b){return _0x432d0f[_0xf3d4('0x1c')](_0x5ac29e);}return _0x432d0f[_0xf3d4('0x1d')](_0x5ac29e)['end']();};}function respondWithResult(_0x5d0e73,_0x75909a){_0x75909a=_0x75909a||0xc8;return function(_0x2e901b){if(_0x2e901b){return _0x5d0e73[_0xf3d4('0x1d')](_0x75909a)['json'](_0x2e901b);}};}function respondWithFilteredResult(_0x4c0d84,_0x45dbf1){return function(_0x259dac){if(_0x259dac){var _0x1102c8=typeof _0x45dbf1[_0xf3d4('0x1e')]==='undefined'&&typeof _0x45dbf1[_0xf3d4('0x1f')]===_0xf3d4('0x20');var _0x40eb5f=_0x259dac[_0xf3d4('0x21')];var _0x57d763=_0x1102c8?0x0:_0x45dbf1['offset'];var _0xc3009c=_0x1102c8?_0x259dac[_0xf3d4('0x21')]:_0x45dbf1[_0xf3d4('0x1e')]+_0x45dbf1[_0xf3d4('0x1f')];var _0x598b91;if(_0xc3009c>=_0x40eb5f){_0xc3009c=_0x40eb5f;_0x598b91=0xc8;}else{_0x598b91=0xce;}_0x4c0d84[_0xf3d4('0x1d')](_0x598b91);return _0x4c0d84[_0xf3d4('0x22')](_0xf3d4('0x23'),_0x57d763+'-'+_0xc3009c+'/'+_0x40eb5f)[_0xf3d4('0x24')](_0x259dac);}return null;};}function patchUpdates(_0x382cf6){return function(_0x250f80){try{jsonpatch['apply'](_0x250f80,_0x382cf6,!![]);}catch(_0x5b7812){return BPromise[_0xf3d4('0x25')](_0x5b7812);}return _0x250f80['save']();};}function saveUpdates(_0x351bde,_0x3b2a57){return function(_0x55a0d6){if(_0x55a0d6){return _0x55a0d6[_0xf3d4('0x26')](_0x351bde)[_0xf3d4('0x27')](function(_0x417912){return _0x417912;});}return null;};}function removeEntity(_0x2895ff,_0x5a408b){return function(_0x143551){if(_0x143551){return _0x143551[_0xf3d4('0x28')]()['then'](function(){_0x2895ff[_0xf3d4('0x1d')](0xcc)[_0xf3d4('0x29')]();});}};}function handleEntityNotFound(_0x5ee4ce,_0x4a29a9){return function(_0xd28e8a){if(!_0xd28e8a){_0x5ee4ce[_0xf3d4('0x1c')](0x194);}return _0xd28e8a;};}function handleError(_0x19b679,_0x5b9c61){_0x5b9c61=_0x5b9c61||0x1f4;return function(_0x437454){logger[_0xf3d4('0x2a')](_0x437454['stack']);if(_0x437454[_0xf3d4('0x2b')]){delete _0x437454[_0xf3d4('0x2b')];}_0x19b679['status'](_0x5b9c61)[_0xf3d4('0x2c')](_0x437454);};}exports[_0xf3d4('0x26')]=function(_0x3531f0,_0x7f288f){if(_0x3531f0[_0xf3d4('0x2d')]['id']){delete _0x3531f0[_0xf3d4('0x2d')]['id'];}return db[_0xf3d4('0x2e')][_0xf3d4('0x2f')]({'where':{'id':_0x3531f0[_0xf3d4('0x30')]['id']}})['then'](handleEntityNotFound(_0x7f288f,null))['then'](saveUpdates(_0x3531f0[_0xf3d4('0x2d')],null))[_0xf3d4('0x27')](respondWithResult(_0x7f288f,null))[_0xf3d4('0x31')](handleError(_0x7f288f,null));};exports[_0xf3d4('0x28')]=function(_0x2a0ba9,_0x34c5a6){return db[_0xf3d4('0x2e')][_0xf3d4('0x2f')]({'where':{'id':_0x2a0ba9['params']['id']}})['then'](handleEntityNotFound(_0x34c5a6,null))[_0xf3d4('0x27')](removeEntity(_0x34c5a6,null))[_0xf3d4('0x31')](handleError(_0x34c5a6,null));}; \ No newline at end of file +var _0x2714=['sendStatus','error','name','body','Action','find','params','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy'];(function(_0xcb016b,_0x54f052){var _0x187501=function(_0x59d61f){while(--_0x59d61f){_0xcb016b['push'](_0xcb016b['shift']());}};_0x187501(++_0x54f052);}(_0x2714,0x178));var _0x4271=function(_0x3673ee,_0x37b638){_0x3673ee=_0x3673ee-0x0;var _0x7a5b8d=_0x2714[_0x3673ee];return _0x7a5b8d;};'use strict';var emlformat=require(_0x4271('0x0'));var rimraf=require(_0x4271('0x1'));var zipdir=require(_0x4271('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4271('0x3'));var moment=require(_0x4271('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4271('0x5'));var util=require(_0x4271('0x6'));var path=require('path');var sox=require(_0x4271('0x7'));var csv=require('to-csv');var ejs=require(_0x4271('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4271('0x9'));var squel=require(_0x4271('0xa'));var crypto=require('crypto');var jsforce=require(_0x4271('0xb'));var deskjs=require(_0x4271('0xc'));var toCsv=require(_0x4271('0xd'));var querystring=require(_0x4271('0xe'));var Papa=require(_0x4271('0xf'));var Redis=require(_0x4271('0x10'));var authService=require(_0x4271('0x11'));var qs=require(_0x4271('0x12'));var as=require(_0x4271('0x13'));var hardwareService=require(_0x4271('0x14'));var logger=require(_0x4271('0x15'))(_0x4271('0x16'));var utils=require(_0x4271('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4271('0x18'))['db'];function respondWithStatusCode(_0x1ce90c,_0x535c57){_0x535c57=_0x535c57||0xcc;return function(_0x4bee4b){if(_0x4bee4b){return _0x1ce90c['sendStatus'](_0x535c57);}return _0x1ce90c['status'](_0x535c57)[_0x4271('0x19')]();};}function respondWithResult(_0x493d40,_0xb24ae8){_0xb24ae8=_0xb24ae8||0xc8;return function(_0x126e0a){if(_0x126e0a){return _0x493d40[_0x4271('0x1a')](_0xb24ae8)[_0x4271('0x1b')](_0x126e0a);}};}function respondWithFilteredResult(_0x4a64b4,_0x25b99a){return function(_0x3fe4a2){if(_0x3fe4a2){var _0x1e09ae=typeof _0x25b99a['offset']===_0x4271('0x1c')&&typeof _0x25b99a[_0x4271('0x1d')]===_0x4271('0x1c');var _0x87d981=_0x3fe4a2[_0x4271('0x1e')];var _0x538645=_0x1e09ae?0x0:_0x25b99a[_0x4271('0x1f')];var _0x3081de=_0x1e09ae?_0x3fe4a2['count']:_0x25b99a['offset']+_0x25b99a['limit'];var _0x22b9f3;if(_0x3081de>=_0x87d981){_0x3081de=_0x87d981;_0x22b9f3=0xc8;}else{_0x22b9f3=0xce;}_0x4a64b4[_0x4271('0x1a')](_0x22b9f3);return _0x4a64b4[_0x4271('0x20')](_0x4271('0x21'),_0x538645+'-'+_0x3081de+'/'+_0x87d981)[_0x4271('0x1b')](_0x3fe4a2);}return null;};}function patchUpdates(_0x3377e6){return function(_0x1594e7){try{jsonpatch[_0x4271('0x22')](_0x1594e7,_0x3377e6,!![]);}catch(_0x266d10){return BPromise['reject'](_0x266d10);}return _0x1594e7[_0x4271('0x23')]();};}function saveUpdates(_0x1ae4e5,_0x3a2a55){return function(_0x5314b9){if(_0x5314b9){return _0x5314b9['update'](_0x1ae4e5)[_0x4271('0x24')](function(_0x3f6cdb){return _0x3f6cdb;});}return null;};}function removeEntity(_0x2bc87b,_0x11d904){return function(_0xfaec14){if(_0xfaec14){return _0xfaec14[_0x4271('0x25')]()[_0x4271('0x24')](function(){_0x2bc87b['status'](0xcc)[_0x4271('0x19')]();});}};}function handleEntityNotFound(_0x5b7e15,_0x49e1ac){return function(_0x41ebb5){if(!_0x41ebb5){_0x5b7e15[_0x4271('0x26')](0x194);}return _0x41ebb5;};}function handleError(_0x4f3375,_0x4c80f6){_0x4c80f6=_0x4c80f6||0x1f4;return function(_0x249c9c){logger[_0x4271('0x27')](_0x249c9c['stack']);if(_0x249c9c[_0x4271('0x28')]){delete _0x249c9c['name'];}_0x4f3375['status'](_0x4c80f6)['send'](_0x249c9c);};}exports['update']=function(_0x9bb196,_0x4e3caa){if(_0x9bb196[_0x4271('0x29')]['id']){delete _0x9bb196[_0x4271('0x29')]['id'];}return db[_0x4271('0x2a')][_0x4271('0x2b')]({'where':{'id':_0x9bb196[_0x4271('0x2c')]['id']}})[_0x4271('0x24')](handleEntityNotFound(_0x4e3caa,null))['then'](saveUpdates(_0x9bb196[_0x4271('0x29')],null))[_0x4271('0x24')](respondWithResult(_0x4e3caa,null))[_0x4271('0x2d')](handleError(_0x4e3caa,null));};exports['destroy']=function(_0x118dbe,_0x2cf896){return db[_0x4271('0x2a')][_0x4271('0x2b')]({'where':{'id':_0x118dbe['params']['id']}})[_0x4271('0x24')](handleEntityNotFound(_0x2cf896,null))['then'](removeEntity(_0x2cf896,null))[_0x4271('0x2d')](handleError(_0x2cf896,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index f83836c..390e53b 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 _0x8bb2=['exports','Action','tools_actions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x8bb2,0x13b));var _0x28bb=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0x8bb2[_0x38eb23];return _0x48506a;};'use strict';var _=require(_0x28bb('0x0'));var util=require('util');var logger=require(_0x28bb('0x1'))(_0x28bb('0x2'));var moment=require(_0x28bb('0x3'));var BPromise=require(_0x28bb('0x4'));var rp=require(_0x28bb('0x5'));var fs=require('fs');var path=require(_0x28bb('0x6'));var rimraf=require(_0x28bb('0x7'));var config=require(_0x28bb('0x8'));var attributes=require(_0x28bb('0x9'));module[_0x28bb('0xa')]=function(_0x13bf70,_0x233eb9){return _0x13bf70['define'](_0x28bb('0xb'),attributes,{'tableName':_0x28bb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x25e1=['bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','lodash','../../config/logger','api','moment'];(function(_0x4135f3,_0x23e172){var _0xbb97c=function(_0xfe1eee){while(--_0xfe1eee){_0x4135f3['push'](_0x4135f3['shift']());}};_0xbb97c(++_0x23e172);}(_0x25e1,0x1d0));var _0x125e=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0x25e1[_0x504df1];return _0x1063b5;};'use strict';var _=require(_0x125e('0x0'));var util=require('util');var logger=require(_0x125e('0x1'))(_0x125e('0x2'));var moment=require(_0x125e('0x3'));var BPromise=require(_0x125e('0x4'));var rp=require(_0x125e('0x5'));var fs=require('fs');var path=require(_0x125e('0x6'));var rimraf=require(_0x125e('0x7'));var config=require(_0x125e('0x8'));var attributes=require(_0x125e('0x9'));module[_0x125e('0xa')]=function(_0x2b16c4,_0x158400){return _0x2b16c4[_0x125e('0xb')](_0x125e('0xc'),attributes,{'tableName':'tools_actions','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 978b596..67792be 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x53ec,0x192));var _0xc53e=function(_0x541095,_0x582b30){_0x541095=_0x541095-0x0;var _0x5a2c40=_0x53ec[_0x541095];return _0x5a2c40;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file +var _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5d0c41,_0x4802ae){var _0x468d86=function(_0x25638e){while(--_0x25638e){_0x5d0c41['push'](_0x5d0c41['shift']());}};_0x468d86(++_0x4802ae);}(_0x326f,0xd1));var _0xf326=function(_0x4fde0f,_0x7acd1c){_0x4fde0f=_0x4fde0f-0x0;var _0x1de7a4=_0x326f[_0x4fde0f];return _0x1de7a4;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 3b021a2..1d3216d 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 _0x8be1=['multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./action.controller','isAuthenticated','delete','/:id','destroy','exports'];(function(_0x11f249,_0x4ca4a8){var _0x5c3656=function(_0x27c9f8){while(--_0x27c9f8){_0x11f249['push'](_0x11f249['shift']());}};_0x5c3656(++_0x4ca4a8);}(_0x8be1,0x193));var _0x18be=function(_0x3752ed,_0xbebd9){_0x3752ed=_0x3752ed-0x0;var _0x3cb417=_0x8be1[_0x3752ed];return _0x3cb417;};'use strict';var multer=require(_0x18be('0x0'));var util=require(_0x18be('0x1'));var path=require('path');var timeout=require(_0x18be('0x2'));var express=require(_0x18be('0x3'));var router=express['Router']();var fs_extra=require(_0x18be('0x4'));var auth=require(_0x18be('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x18be('0x6'));var controller=require(_0x18be('0x7'));router['put']('/:id',auth[_0x18be('0x8')](),controller['update']);router[_0x18be('0x9')](_0x18be('0xa'),auth[_0x18be('0x8')](),controller[_0x18be('0xb')]);module[_0x18be('0xc')]=router; \ No newline at end of file +var _0x2c04=['delete','isAuthenticated','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','update'];(function(_0x57868e,_0x868060){var _0x4b7c99=function(_0x481f03){while(--_0x481f03){_0x57868e['push'](_0x57868e['shift']());}};_0x4b7c99(++_0x868060);}(_0x2c04,0x144));var _0x42c0=function(_0x158002,_0xe44f8d){_0x158002=_0x158002-0x0;var _0xb6f745=_0x2c04[_0x158002];return _0xb6f745;};'use strict';var multer=require(_0x42c0('0x0'));var util=require('util');var path=require(_0x42c0('0x1'));var timeout=require(_0x42c0('0x2'));var express=require(_0x42c0('0x3'));var router=express['Router']();var fs_extra=require(_0x42c0('0x4'));var auth=require(_0x42c0('0x5'));var interaction=require(_0x42c0('0x6'));var config=require(_0x42c0('0x7'));var controller=require(_0x42c0('0x8'));router[_0x42c0('0x9')](_0x42c0('0xa'),auth['isAuthenticated'](),controller[_0x42c0('0xb')]);router[_0x42c0('0xc')](_0x42c0('0xa'),auth[_0x42c0('0xd')](),controller[_0x42c0('0xe')]);module[_0x42c0('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index aa83096..dabb623 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 _0x2eb2=['TEXT','exports','STRING'];(function(_0x5c9865,_0x1a299a){var _0x54c22b=function(_0x538537){while(--_0x538537){_0x5c9865['push'](_0x5c9865['shift']());}};_0x54c22b(++_0x1a299a);}(_0x2eb2,0x19f));var _0x22eb=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2eb2[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x22eb('0x1')]},'parent':{'type':Sequelize[_0x22eb('0x1')]},'table':{'type':Sequelize[_0x22eb('0x1')]},'conditions':{'type':Sequelize[_0x22eb('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xabce=['exports','STRING','TEXT','sequelize'];(function(_0x4123f5,_0x398add){var _0x1af894=function(_0x568329){while(--_0x568329){_0x4123f5['push'](_0x4123f5['shift']());}};_0x1af894(++_0x398add);}(_0xabce,0x103));var _0xeabc=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xabce[_0x1ddedd];return _0xa3e1ac;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'name':{'type':Sequelize[_0xeabc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xeabc('0x2')]},'parent':{'type':Sequelize[_0xeabc('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xeabc('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 2ee4424..7d2d7db 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 _0x56e9=['map','rawAttributes','fieldName','key','name','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','AnalyticCustomReport','includeAll','rows','catch','show','include','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','params','preview','join','left_join','right_join','SUM(%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','keyBy','output','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','../../files/reports','savename','COUNT(*)','run','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NULL','operator','value','ValidationErrorItem','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','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','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack'];(function(_0x129534,_0x560a44){var _0x430eb4=function(_0x3454ab){while(--_0x3454ab){_0x129534['push'](_0x129534['shift']());}};_0x430eb4(++_0x560a44);}(_0x56e9,0x11c));var _0x956e=function(_0x5f44c3,_0x460f76){_0x5f44c3=_0x5f44c3-0x0;var _0x577bf7=_0x56e9[_0x5f44c3];return _0x577bf7;};'use strict';var emlformat=require(_0x956e('0x0'));var rimraf=require(_0x956e('0x1'));var zipdir=require(_0x956e('0x2'));var jsonpatch=require(_0x956e('0x3'));var rp=require(_0x956e('0x4'));var moment=require(_0x956e('0x5'));var BPromise=require(_0x956e('0x6'));var Mustache=require(_0x956e('0x7'));var util=require(_0x956e('0x8'));var path=require(_0x956e('0x9'));var sox=require(_0x956e('0xa'));var csv=require('to-csv');var ejs=require(_0x956e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x956e('0xc'));var squel=require(_0x956e('0xd'));var crypto=require('crypto');var jsforce=require(_0x956e('0xe'));var deskjs=require(_0x956e('0xf'));var toCsv=require('to-csv');var querystring=require(_0x956e('0x10'));var Papa=require(_0x956e('0x11'));var Redis=require(_0x956e('0x12'));var authService=require(_0x956e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x956e('0x14'));var hardwareService=require(_0x956e('0x15'));var logger=require(_0x956e('0x16'))(_0x956e('0x17'));var utils=require(_0x956e('0x18'));var config=require(_0x956e('0x19'));var licenseUtil=require(_0x956e('0x1a'));var db=require(_0x956e('0x1b'))['db'];var dbH=require(_0x956e('0x1b'))['dbH'];function respondWithStatusCode(_0x3c3436,_0x4d2527){_0x4d2527=_0x4d2527||0xcc;return function(_0x487000){if(_0x487000){return _0x3c3436[_0x956e('0x1c')](_0x4d2527);}return _0x3c3436[_0x956e('0x1d')](_0x4d2527)[_0x956e('0x1e')]();};}function respondWithResult(_0x46bf35,_0x3b3ced){_0x3b3ced=_0x3b3ced||0xc8;return function(_0x584d22){if(_0x584d22){return _0x46bf35[_0x956e('0x1d')](_0x3b3ced)[_0x956e('0x1f')](_0x584d22);}};}function respondWithFilteredResult(_0x250b6d,_0x152736){return function(_0x3c6857){if(_0x3c6857){var _0x5e7d30=typeof _0x152736['offset']==='undefined'&&typeof _0x152736[_0x956e('0x20')]==='undefined';var _0x36ab1e=_0x3c6857[_0x956e('0x21')];var _0x51c11b=_0x5e7d30?0x0:_0x152736[_0x956e('0x22')];var _0x118fe5=_0x5e7d30?_0x3c6857['count']:_0x152736['offset']+_0x152736[_0x956e('0x20')];var _0x366825;if(_0x118fe5>=_0x36ab1e){_0x118fe5=_0x36ab1e;_0x366825=0xc8;}else{_0x366825=0xce;}_0x250b6d[_0x956e('0x1d')](_0x366825);return _0x250b6d['set'](_0x956e('0x23'),_0x51c11b+'-'+_0x118fe5+'/'+_0x36ab1e)[_0x956e('0x1f')](_0x3c6857);}return null;};}function patchUpdates(_0x3e87ca){return function(_0x27324b){try{jsonpatch[_0x956e('0x24')](_0x27324b,_0x3e87ca,!![]);}catch(_0x95cac6){return BPromise['reject'](_0x95cac6);}return _0x27324b[_0x956e('0x25')]();};}function saveUpdates(_0x3bfebf,_0x33d859){return function(_0xeab724){if(_0xeab724){return _0xeab724[_0x956e('0x26')](_0x3bfebf)[_0x956e('0x27')](function(_0x4415a3){return _0x4415a3;});}return null;};}function removeEntity(_0x4d83b0,_0x2c4742){return function(_0x20471e){if(_0x20471e){return _0x20471e[_0x956e('0x28')]()[_0x956e('0x27')](function(){var _0x3b34ab=_0x20471e[_0x956e('0x29')]({'plain':!![]});var _0x3c8f8a=_0x956e('0x2a');return db[_0x956e('0x2b')][_0x956e('0x28')]({'where':{'type':_0x3c8f8a,'resourceId':_0x3b34ab['id']}})['then'](function(){return _0x20471e;});})[_0x956e('0x27')](function(){_0x4d83b0[_0x956e('0x1d')](0xcc)[_0x956e('0x1e')]();});}};}function handleEntityNotFound(_0x57b0b1,_0x5aad98){return function(_0x38f96c){if(!_0x38f96c){_0x57b0b1[_0x956e('0x1c')](0x194);}return _0x38f96c;};}function handleError(_0x1eb857,_0x4265b5){_0x4265b5=_0x4265b5||0x1f4;return function(_0x4af671){logger[_0x956e('0x2c')](_0x4af671[_0x956e('0x2d')]);if(_0x4af671['name']){delete _0x4af671['name'];}_0x1eb857[_0x956e('0x1d')](_0x4265b5)['send'](_0x4af671);};}exports['index']=function(_0x26cb24,_0x71dbca){var _0x7336ea={},_0x2db4a0={},_0x33c932={'count':0x0,'rows':[]};var _0x55d39c=_[_0x956e('0x2e')](db['AnalyticCustomReport'][_0x956e('0x2f')],function(_0x3cc043){return{'name':_0x3cc043[_0x956e('0x30')],'type':_0x3cc043['type'][_0x956e('0x31')]};});_0x2db4a0['model']=_['map'](_0x55d39c,_0x956e('0x32'));_0x2db4a0[_0x956e('0x33')]=_[_0x956e('0x34')](_0x26cb24[_0x956e('0x33')]);_0x2db4a0[_0x956e('0x35')]=_['intersection'](_0x2db4a0[_0x956e('0x36')],_0x2db4a0['query']);_0x7336ea[_0x956e('0x37')]=_[_0x956e('0x38')](_0x2db4a0[_0x956e('0x36')],qs[_0x956e('0x39')](_0x26cb24[_0x956e('0x33')][_0x956e('0x39')]));_0x7336ea[_0x956e('0x37')]=_0x7336ea[_0x956e('0x37')][_0x956e('0x3a')]?_0x7336ea[_0x956e('0x37')]:_0x2db4a0[_0x956e('0x36')];if(!_0x26cb24[_0x956e('0x33')][_0x956e('0x3b')](_0x956e('0x3c'))){_0x7336ea[_0x956e('0x20')]=qs[_0x956e('0x20')](_0x26cb24['query'][_0x956e('0x20')]);_0x7336ea[_0x956e('0x22')]=qs[_0x956e('0x22')](_0x26cb24[_0x956e('0x33')][_0x956e('0x22')]);}_0x7336ea[_0x956e('0x3d')]=qs[_0x956e('0x3e')](_0x26cb24[_0x956e('0x33')][_0x956e('0x3e')]);_0x7336ea['where']=qs['filters'](_[_0x956e('0x3f')](_0x26cb24[_0x956e('0x33')],_0x2db4a0[_0x956e('0x35')]),_0x55d39c);if(_0x26cb24[_0x956e('0x33')][_0x956e('0x40')]){_0x7336ea[_0x956e('0x41')]=_[_0x956e('0x42')](_0x7336ea[_0x956e('0x41')],{'$or':_[_0x956e('0x2e')](_0x55d39c,function(_0x3d83f3){if(_0x3d83f3[_0x956e('0x43')]!==_0x956e('0x44')){var _0x19e943={};_0x19e943[_0x3d83f3['name']]={'$like':'%'+_0x26cb24[_0x956e('0x33')]['filter']+'%'};return _0x19e943;}})});}_0x7336ea=_['merge']({},_0x7336ea,_0x26cb24['options']);var _0x57cef7={'where':_0x7336ea[_0x956e('0x41')]};return db[_0x956e('0x45')][_0x956e('0x21')](_0x57cef7)[_0x956e('0x27')](function(_0x4440b1){_0x33c932[_0x956e('0x21')]=_0x4440b1;if(_0x26cb24['query'][_0x956e('0x46')]){_0x7336ea['include']=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x7336ea);})[_0x956e('0x27')](function(_0x1989fa){_0x33c932[_0x956e('0x47')]=_0x1989fa;return _0x33c932;})[_0x956e('0x27')](respondWithFilteredResult(_0x71dbca,_0x7336ea))[_0x956e('0x48')](handleError(_0x71dbca,null));};exports[_0x956e('0x49')]=function(_0x3d77e8,_0x3bb9cd){var _0x4e9cc3={'raw':![],'where':{'id':_0x3d77e8['params']['id']}},_0x3c4fc1={};_0x3c4fc1[_0x956e('0x36')]=_[_0x956e('0x34')](db['AnalyticCustomReport']['rawAttributes']);_0x3c4fc1[_0x956e('0x33')]=_[_0x956e('0x34')](_0x3d77e8['query']);_0x3c4fc1[_0x956e('0x35')]=_[_0x956e('0x38')](_0x3c4fc1[_0x956e('0x36')],_0x3c4fc1['query']);_0x4e9cc3[_0x956e('0x37')]=_[_0x956e('0x38')](_0x3c4fc1[_0x956e('0x36')],qs[_0x956e('0x39')](_0x3d77e8[_0x956e('0x33')][_0x956e('0x39')]));_0x4e9cc3['attributes']=_0x4e9cc3[_0x956e('0x37')][_0x956e('0x3a')]?_0x4e9cc3[_0x956e('0x37')]:_0x3c4fc1[_0x956e('0x36')];if(_0x3d77e8[_0x956e('0x33')]['includeAll']){_0x4e9cc3[_0x956e('0x4a')]=[{'all':!![]}];}_0x4e9cc3=_[_0x956e('0x42')]({},_0x4e9cc3,_0x3d77e8[_0x956e('0x4b')]);return db[_0x956e('0x45')][_0x956e('0x4c')](_0x4e9cc3)[_0x956e('0x27')](handleEntityNotFound(_0x3bb9cd,null))['then'](respondWithResult(_0x3bb9cd,null))['catch'](handleError(_0x3bb9cd,null));};exports[_0x956e('0x4d')]=function(_0x482c55,_0x3c5bb1){return db[_0x956e('0x45')][_0x956e('0x4d')](_0x482c55[_0x956e('0x4e')],{})[_0x956e('0x27')](function(_0x3f7145){var _0x37b1dc=_0x482c55[_0x956e('0x4f')]['get']({'plain':!![]});if(!_0x37b1dc)throw new Error(_0x956e('0x50'));if(_0x37b1dc['role']===_0x956e('0x4f')){var _0x595b32=_0x3f7145[_0x956e('0x29')]({'plain':!![]});var _0x45f0a1='Reports';return db[_0x956e('0x51')]['find']({'where':{'name':_0x45f0a1,'userProfileId':_0x37b1dc[_0x956e('0x52')]},'raw':!![]})['then'](function(_0x25e797){if(_0x25e797&&_0x25e797[_0x956e('0x53')]===0x0){return db['UserProfileResource'][_0x956e('0x4d')]({'name':_0x595b32[_0x956e('0x32')],'resourceId':_0x595b32['id'],'type':_0x956e('0x2a'),'sectionId':_0x25e797['id']},{})[_0x956e('0x27')](function(){return _0x3f7145;});}else{return _0x3f7145;}})[_0x956e('0x48')](function(_0xc35934){logger[_0x956e('0x2c')](_0x956e('0x54'),_0xc35934);throw _0xc35934;});}return _0x3f7145;})['then'](respondWithResult(_0x3c5bb1,0xc9))[_0x956e('0x48')](handleError(_0x3c5bb1,null));};exports['update']=function(_0x576723,_0x2790fe){if(_0x576723[_0x956e('0x4e')]['id']){delete _0x576723['body']['id'];}return db[_0x956e('0x45')]['find']({'where':{'id':_0x576723[_0x956e('0x55')]['id']}})['then'](handleEntityNotFound(_0x2790fe,null))[_0x956e('0x27')](saveUpdates(_0x576723[_0x956e('0x4e')],null))['then'](respondWithResult(_0x2790fe,null))[_0x956e('0x48')](handleError(_0x2790fe,null));};exports[_0x956e('0x28')]=function(_0x515a61,_0xf0ce6f){return db['AnalyticCustomReport'][_0x956e('0x4c')]({'where':{'id':_0x515a61[_0x956e('0x55')]['id']}})[_0x956e('0x27')](handleEntityNotFound(_0xf0ce6f,null))[_0x956e('0x27')](removeEntity(_0xf0ce6f,null))['catch'](handleError(_0xf0ce6f,null));};exports[_0x956e('0x56')]=function(_0x3a9d46,_0x510226){var _0x43f7b5=0xa;var _0x53b29a=[_0x956e('0x57'),_0x956e('0x58'),_0x956e('0x59'),'cross_join'];var _0xfe0bc4={'SUM':_0x956e('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x956e('0x5b'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x956e('0x5c'),'GROUP_CONCAT ASC':_0x956e('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x330035={'SEC_TO_TIME':_0x956e('0x5e'),'DATE':_0x956e('0x5f'),'HOUR':_0x956e('0x60'),'ROUND':_0x956e('0x61'),'UNIX_TIMESTAMP':_0x956e('0x62')};var _0xb317ba=function(_0xf139b4){return!_[_0x956e('0x63')](['IS\x20NULL',_0x956e('0x64'),_0x956e('0x65'),_0x956e('0x66')],_0xf139b4);};var _0x186aa9=function(_0x233eff){if(!_0x233eff||!_0x233eff[_0x956e('0x67')][_0x956e('0x3a')]){return'';}for(var _0x368b74='(',_0x5c2acd=0x0;_0x5c2acd<_0x233eff['rules'][_0x956e('0x3a')];_0x5c2acd+=0x1){_0x5c2acd>0x0&&(_0x368b74+='\x20'+_0x233eff['operator']+'\x20');_0x368b74+=_0x233eff['rules'][_0x5c2acd][_0x956e('0x68')]?_0x186aa9(_0x233eff[_0x956e('0x67')][_0x5c2acd][_0x956e('0x68')]):_0x233eff[_0x956e('0x67')][_0x5c2acd][_0x956e('0x69')]+'\x20'+_0x233eff['rules'][_0x5c2acd]['condition']+(_0xb317ba(_0x233eff['rules'][_0x5c2acd][_0x956e('0x6a')])?'\x20'+_0x233eff[_0x956e('0x67')][_0x5c2acd]['value']:'');}return _0x368b74+')';};var _0x4dd183={'where':{'id':_0x3a9d46[_0x956e('0x55')]['id']}},_0x2d9ee1,_0x43cbf7,_0x15f635,_0x8b7e79,_0x5f0e62;_0x4dd183=_[_0x956e('0x42')]({},_0x4dd183,_0x3a9d46[_0x956e('0x4b')]);return db[_0x956e('0x45')][_0x956e('0x4c')](_0x4dd183)['then'](function(_0xd60d6d){if(_0xd60d6d){_0x2d9ee1=_0xd60d6d;return _0xd60d6d[_0x956e('0x6b')]();}return null;})['then'](function(_0x59da0e){if(_0x59da0e){if(!_0x59da0e[_0x956e('0x3a')]){throw new db[(_0x956e('0x6c'))]['ValidationErrorItem'](_0x956e('0x6d'),0x193);}_0x43cbf7=_0x59da0e;return db[_0x956e('0x6e')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x557ccc){if(_0x557ccc){_0x15f635=_['keyBy'](_0x557ccc,'id');var _0x114248;var _0x13440e=squel[_0x956e('0x6f')]();_0x13440e[_0x956e('0x70')](_0x2d9ee1[_0x956e('0x71')]);for(var _0x26b94a=0x0;_0x26b94a<_0x43cbf7[_0x956e('0x3a')];_0x26b94a+=0x1){_0x114248=_0x43cbf7[_0x26b94a][_0x956e('0x72')]?_0x15f635[_0x43cbf7[_0x26b94a]['MetricId']][_0x956e('0x73')]:_0x43cbf7[_0x26b94a][_0x956e('0x69')];_0x114248=_0x43cbf7[_0x26b94a][_0x956e('0x74')]?_[_0x956e('0x75')](_0xfe0bc4[_0x43cbf7[_0x26b94a][_0x956e('0x74')]],'%s',_0x114248):_0x114248;_0x114248=_0x43cbf7[_0x26b94a][_0x956e('0x76')]?_[_0x956e('0x75')](_0x330035[_0x43cbf7[_0x26b94a]['format']],'%s',_0x114248):_0x114248;if(_0x43cbf7[_0x26b94a][_0x956e('0x77')]){_0x13440e[_0x956e('0x68')](_0x114248);}_0x43cbf7[_0x26b94a]['orderBy']&&_0x13440e[_0x956e('0x3d')](_0x114248,_0x43cbf7[_0x26b94a][_0x956e('0x78')]===_0x956e('0x79')?![]:!![]);_0x13440e['field'](_0x114248,_0x43cbf7[_0x26b94a][_0x956e('0x7a')]||_0x114248);}if(_0x2d9ee1[_0x956e('0x7b')]){_0x2d9ee1[_0x956e('0x7b')]=JSON[_0x956e('0x7c')](_0x2d9ee1[_0x956e('0x7b')]);for(var _0x5ae077=0x0;_0x5ae077<_0x2d9ee1['joins']['length'];_0x5ae077+=0x1){if(_0x2d9ee1[_0x956e('0x7b')][_0x5ae077][_0x956e('0x43')]&&_['includes'](_0x53b29a,_0x2d9ee1[_0x956e('0x7b')][_0x5ae077][_0x956e('0x43')])&&_0x2d9ee1[_0x956e('0x7b')][_0x5ae077][_0x956e('0x7d')]&&_0x2d9ee1[_0x956e('0x7b')][_0x5ae077][_0x956e('0x7e')]&&_0x2d9ee1['joins'][_0x5ae077][_0x956e('0x7f')]){_0x13440e[_0x2d9ee1[_0x956e('0x7b')][_0x5ae077]['type']](_0x2d9ee1['joins'][_0x5ae077][_0x956e('0x7e')],null,util[_0x956e('0x76')](_0x956e('0x80'),_0x2d9ee1[_0x956e('0x71')],_0x2d9ee1[_0x956e('0x7b')][_0x5ae077][_0x956e('0x7d')],_0x2d9ee1[_0x956e('0x7b')][_0x5ae077][_0x956e('0x7e')],_0x2d9ee1['joins'][_0x5ae077][_0x956e('0x7f')]));}}}if(_0x2d9ee1[_0x956e('0x81')]){_0x2d9ee1[_0x956e('0x81')]=JSON[_0x956e('0x7c')](_0x2d9ee1[_0x956e('0x81')]);_0x13440e[_0x956e('0x41')](_0x186aa9(_0x2d9ee1['conditions']['group']));}_0x5f0e62=_0x13440e[_0x956e('0x82')]();_0x13440e[_0x956e('0x20')](_0x43f7b5);_0x13440e['offset'](0x0);logger[_0x956e('0x83')](_0x956e('0x84'),_0x13440e[_0x956e('0x85')]());return dbH['sequelize'][_0x956e('0x33')](_0x13440e[_0x956e('0x85')](),{'type':dbH[_0x956e('0x86')][_0x956e('0x87')][_0x956e('0x88')]});}})['then'](respondWithResult(_0x510226,null))[_0x956e('0x48')](handleError(_0x510226,null));};function runReport(_0x252a23,_0x2b2942,_0x460398){var _0x218e13=_0x2b2942['name'];var _0x525ed7=0xa;var _0x3675b3=[_0x956e('0x57'),_0x956e('0x58'),_0x956e('0x59'),_0x956e('0x89')];var _0x560716={'SUM':'SUM(%s)','COUNT':_0x956e('0x8a'),'COUNT DISTINCT':_0x956e('0x8b'),'MAX':_0x956e('0x5b'),'MIN':_0x956e('0x8c'),'AVG':_0x956e('0x8d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x956e('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4112a2={'SEC_TO_TIME':_0x956e('0x5e'),'DATE':_0x956e('0x5f'),'HOUR':_0x956e('0x60'),'ROUND':_0x956e('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x47c682=function(_0x5eab44){return!_[_0x956e('0x63')](['IS\x20NULL',_0x956e('0x64'),_0x956e('0x65'),_0x956e('0x66')],_0x5eab44);};var _0x25ada9=function(_0x1fabe5){if(!_0x1fabe5||!_0x1fabe5[_0x956e('0x67')]['length']){return'';}for(var _0x3e9306='(',_0x2929ac=0x0;_0x2929ac<_0x1fabe5[_0x956e('0x67')]['length'];_0x2929ac+=0x1){_0x2929ac>0x0&&(_0x3e9306+='\x20'+_0x1fabe5['operator']+'\x20');_0x3e9306+=_0x1fabe5[_0x956e('0x67')][_0x2929ac][_0x956e('0x68')]?_0x25ada9(_0x1fabe5[_0x956e('0x67')][_0x2929ac]['group']):_0x1fabe5[_0x956e('0x67')][_0x2929ac]['field']+'\x20'+_0x1fabe5[_0x956e('0x67')][_0x2929ac][_0x956e('0x6a')]+(_0x47c682(_0x1fabe5[_0x956e('0x67')][_0x2929ac][_0x956e('0x6a')])?'\x20'+_0x1fabe5[_0x956e('0x67')][_0x2929ac]['value']:'');}return _0x3e9306+')';};var _0x392a48={'where':{'id':_0x252a23['id']}},_0x59640a,_0x222ce7,_0x3967df,_0x41e714,_0x24fa7a;_0x392a48=_[_0x956e('0x42')]({},_0x392a48,_0x460398);return db[_0x956e('0x45')][_0x956e('0x4c')](_0x392a48)[_0x956e('0x27')](function(_0x5bda9c){if(_0x5bda9c){_0x59640a=_0x5bda9c;return _0x5bda9c['getFields']();}return null;})[_0x956e('0x27')](function(_0x2127c9){if(_0x2127c9){if(!_0x2127c9[_0x956e('0x3a')]){throw new db[(_0x956e('0x6c'))]['ValidationErrorItem'](_0x956e('0x6d'),0x193);}_0x222ce7=_0x2127c9;return db[_0x956e('0x6e')]['findAll']({'raw':!![]});}return null;})['then'](function(_0xa1866e){if(_0xa1866e){_0x3967df=_[_0x956e('0x8e')](_0xa1866e,'id');var _0x43c68d;var _0x2a2f3c=squel[_0x956e('0x6f')]();_0x2a2f3c['from'](_0x59640a[_0x956e('0x71')]);for(var _0x1e10c3=0x0;_0x1e10c3<_0x222ce7[_0x956e('0x3a')];_0x1e10c3+=0x1){_0x43c68d=_0x222ce7[_0x1e10c3][_0x956e('0x72')]?_0x3967df[_0x222ce7[_0x1e10c3]['MetricId']][_0x956e('0x73')]:_0x222ce7[_0x1e10c3][_0x956e('0x69')];_0x43c68d=_0x222ce7[_0x1e10c3][_0x956e('0x74')]?_[_0x956e('0x75')](_0x560716[_0x222ce7[_0x1e10c3][_0x956e('0x74')]],'%s',_0x43c68d):_0x43c68d;_0x43c68d=_0x222ce7[_0x1e10c3]['format']?_[_0x956e('0x75')](_0x4112a2[_0x222ce7[_0x1e10c3][_0x956e('0x76')]],'%s',_0x43c68d):_0x43c68d;if(_0x222ce7[_0x1e10c3][_0x956e('0x77')]){_0x2a2f3c['group'](_0x43c68d);}_0x222ce7[_0x1e10c3][_0x956e('0x78')]&&_0x2a2f3c[_0x956e('0x3d')](_0x43c68d,_0x222ce7[_0x1e10c3][_0x956e('0x78')]===_0x956e('0x79')?![]:!![]);_0x2a2f3c[_0x956e('0x69')](_0x43c68d,_0x222ce7[_0x1e10c3][_0x956e('0x7a')]||_0x43c68d);}if(_0x59640a[_0x956e('0x7b')]){_0x59640a[_0x956e('0x7b')]=JSON[_0x956e('0x7c')](_0x59640a[_0x956e('0x7b')]);for(var _0x398e80=0x0;_0x398e80<_0x59640a[_0x956e('0x7b')][_0x956e('0x3a')];_0x398e80+=0x1){if(_0x59640a['joins'][_0x398e80][_0x956e('0x43')]&&_[_0x956e('0x63')](_0x3675b3,_0x59640a['joins'][_0x398e80][_0x956e('0x43')])&&_0x59640a[_0x956e('0x7b')][_0x398e80]['parentKey']&&_0x59640a[_0x956e('0x7b')][_0x398e80][_0x956e('0x7e')]&&_0x59640a['joins'][_0x398e80][_0x956e('0x7f')]){_0x2a2f3c[_0x59640a[_0x956e('0x7b')][_0x398e80][_0x956e('0x43')]](_0x59640a[_0x956e('0x7b')][_0x398e80][_0x956e('0x7e')],null,util[_0x956e('0x76')](_0x956e('0x80'),_0x59640a['table'],_0x59640a[_0x956e('0x7b')][_0x398e80][_0x956e('0x7d')],_0x59640a[_0x956e('0x7b')][_0x398e80][_0x956e('0x7e')],_0x59640a['joins'][_0x398e80][_0x956e('0x7f')]));}}}if(_0x59640a[_0x956e('0x81')]){_0x59640a[_0x956e('0x81')]=JSON['parse'](_0x59640a['conditions']);_0x2a2f3c[_0x956e('0x41')](_0x25ada9(_0x59640a[_0x956e('0x81')]['group']));}_0x24fa7a=_0x2a2f3c[_0x956e('0x82')]();_0x2a2f3c['limit'](_0x525ed7);_0x2a2f3c[_0x956e('0x22')](0x0);return;}})[_0x956e('0x27')](function(){if(_0x2b2942[_0x956e('0x8f')]==='web'){return null;}var _0x4c56a3=_[_0x956e('0x42')](_0x2b2942,{'name':_0x2b2942['fullPath']||_0x2b2942[_0x956e('0x32')]||_0x59640a[_0x956e('0x32')],'basename':_0x218e13,'savename':util['format'](_0x956e('0x90'),_0x2b2942[_0x956e('0x32')]||_0x59640a[_0x956e('0x32')],require(_0x956e('0x91'))[_0x956e('0x92')](0x4),_0x2b2942[_0x956e('0x8f')]||'csv'),'reportId':_0x59640a['id'],'reportType':_0x956e('0x93')});return db[_0x956e('0x94')][_0x956e('0x4d')](_0x4c56a3,{'raw':!![]});})['then'](function(_0x18c6ff){if(_0x59640a[_0x956e('0x71')]===_0x956e('0x95')){_0x24fa7a['where'](_0x59640a[_0x956e('0x71')]+_0x956e('0x96'),_0x2b2942[_0x956e('0x97')],_0x2b2942[_0x956e('0x98')]);}else{_0x24fa7a[_0x956e('0x41')](_0x59640a[_0x956e('0x71')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2b2942[_0x956e('0x97')],_0x2b2942['endDate']);}if(_0x18c6ff){logger[_0x956e('0x99')](_0x956e('0x9a'),_0x24fa7a[_0x956e('0x85')]());require('child_process')['fork'](path[_0x956e('0x57')](__dirname,'../../components/export/',_0x18c6ff[_0x956e('0x8f')]),[_0x18c6ff['id'],_0x24fa7a['toString'](),path[_0x956e('0x57')](__dirname,_0x956e('0x9b'),_0x18c6ff[_0x956e('0x9c')]),_0x218e13]);return _0x18c6ff;}else{var _0xc9d0ae=squel[_0x956e('0x6f')]();_0xc9d0ae[_0x956e('0x70')]('('+_0x24fa7a['toString']()+')','countTable');_0xc9d0ae['field'](_0x956e('0x9d'),'count');_0x24fa7a[_0x956e('0x20')](_0x2b2942[_0x956e('0x20')]||_0x525ed7);_0x24fa7a[_0x956e('0x22')](_0x2b2942['offset']||0x0);return dbH['sequelize'][_0x956e('0x33')](_0xc9d0ae['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x956e('0x88')]})['then'](function(_0x1b55b9){if(!_0x1b55b9[_0x956e('0x3a')]){_0x41e714=0x0;}else{_0x41e714=_0x1b55b9[0x0][_0x956e('0x21')]||0x0;}return dbH[_0x956e('0x86')][_0x956e('0x33')](_0x24fa7a[_0x956e('0x85')](),{'type':dbH[_0x956e('0x86')][_0x956e('0x87')][_0x956e('0x88')]});})[_0x956e('0x27')](function(_0x47e36a){return{'rows':_0x47e36a||[],'count':_0x41e714};});}});}exports[_0x956e('0x9e')]=function(_0xb6ba8e,_0x57cc25){return runReport(_0xb6ba8e['params'],_0xb6ba8e[_0x956e('0x33')],_0xb6ba8e['options'])[_0x956e('0x27')](respondWithResult(_0x57cc25,null))['catch'](handleError(_0x57cc25,null));};exports['runReport']=runReport;exports['query']=function(_0x405a0f,_0x313dbf){var _0x5894b1=0xa;var _0x38995f=['join','left_join',_0x956e('0x59'),_0x956e('0x89')];var _0x4a1c6b={'SUM':_0x956e('0x5a'),'COUNT':_0x956e('0x8a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x956e('0x5b'),'MIN':_0x956e('0x8c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x956e('0x5c'),'GROUP_CONCAT ASC':_0x956e('0x5d'),'GROUP_CONCAT DESC':_0x956e('0x9f')};var _0x5b5eba={'SEC_TO_TIME':_0x956e('0x5e'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x956e('0x61'),'UNIX_TIMESTAMP':_0x956e('0x62')};var _0x480987=function(_0x5b7430){return!_[_0x956e('0x63')]([_0x956e('0xa0'),_0x956e('0x64'),_0x956e('0x65'),_0x956e('0x66')],_0x5b7430);};var _0x414fdd=function(_0x29fbe0){if(!_0x29fbe0||!_0x29fbe0[_0x956e('0x67')][_0x956e('0x3a')]){return'';}for(var _0x24c07b='(',_0x340158=0x0;_0x340158<_0x29fbe0['rules'][_0x956e('0x3a')];_0x340158+=0x1){_0x340158>0x0&&(_0x24c07b+='\x20'+_0x29fbe0[_0x956e('0xa1')]+'\x20');_0x24c07b+=_0x29fbe0[_0x956e('0x67')][_0x340158][_0x956e('0x68')]?_0x414fdd(_0x29fbe0[_0x956e('0x67')][_0x340158][_0x956e('0x68')]):_0x29fbe0[_0x956e('0x67')][_0x340158]['field']+'\x20'+_0x29fbe0[_0x956e('0x67')][_0x340158][_0x956e('0x6a')]+(_0x480987(_0x29fbe0[_0x956e('0x67')][_0x340158][_0x956e('0x6a')])?'\x20'+_0x29fbe0[_0x956e('0x67')][_0x340158][_0x956e('0xa2')]:'');}return _0x24c07b+')';};var _0x29f5d5={'where':{'id':_0x405a0f['params']['id']}},_0x3696c5,_0x4bd965,_0x282d6c,_0x112319,_0xcd54ad;_0x29f5d5=_[_0x956e('0x42')]({},_0x29f5d5,_0x405a0f[_0x956e('0x4b')]);return db[_0x956e('0x45')][_0x956e('0x4c')](_0x29f5d5)[_0x956e('0x27')](function(_0x56cdc6){if(_0x56cdc6){_0x3696c5=_0x56cdc6;return _0x56cdc6[_0x956e('0x6b')]();}return null;})[_0x956e('0x27')](function(_0x5bd31c){if(_0x5bd31c){if(!_0x5bd31c['length']){throw new db[(_0x956e('0x6c'))][(_0x956e('0xa3'))](_0x956e('0x6d'),0x193);}_0x4bd965=_0x5bd31c;return db[_0x956e('0x6e')][_0x956e('0xa4')]({'raw':!![]});}return null;})[_0x956e('0x27')](function(_0x36eff1){if(_0x36eff1){_0x282d6c=_[_0x956e('0x8e')](_0x36eff1,'id');var _0x3d128e;var _0x312e45=squel[_0x956e('0x6f')]();_0x312e45[_0x956e('0x70')](_0x3696c5[_0x956e('0x71')]);for(var _0x84594f=0x0;_0x84594f<_0x4bd965[_0x956e('0x3a')];_0x84594f+=0x1){_0x3d128e=_0x4bd965[_0x84594f][_0x956e('0x72')]?_0x282d6c[_0x4bd965[_0x84594f]['MetricId']][_0x956e('0x73')]:_0x4bd965[_0x84594f]['field'];_0x3d128e=_0x4bd965[_0x84594f][_0x956e('0x74')]?_[_0x956e('0x75')](_0x4a1c6b[_0x4bd965[_0x84594f][_0x956e('0x74')]],'%s',_0x3d128e):_0x3d128e;_0x3d128e=_0x4bd965[_0x84594f][_0x956e('0x76')]?_['replace'](_0x5b5eba[_0x4bd965[_0x84594f]['format']],'%s',_0x3d128e):_0x3d128e;if(_0x4bd965[_0x84594f][_0x956e('0x77')]){_0x312e45[_0x956e('0x68')](_0x3d128e);}_0x4bd965[_0x84594f][_0x956e('0x78')]&&_0x312e45[_0x956e('0x3d')](_0x3d128e,_0x4bd965[_0x84594f]['orderBy']===_0x956e('0x79')?![]:!![]);_0x312e45[_0x956e('0x69')](_0x3d128e,_0x4bd965[_0x84594f][_0x956e('0x7a')]||_0x3d128e);}if(_0x3696c5[_0x956e('0x7b')]){_0x3696c5[_0x956e('0x7b')]=JSON[_0x956e('0x7c')](_0x3696c5[_0x956e('0x7b')]);for(var _0x4a1541=0x0;_0x4a1541<_0x3696c5['joins'][_0x956e('0x3a')];_0x4a1541+=0x1){if(_0x3696c5['joins'][_0x4a1541][_0x956e('0x43')]&&_[_0x956e('0x63')](_0x38995f,_0x3696c5['joins'][_0x4a1541][_0x956e('0x43')])&&_0x3696c5['joins'][_0x4a1541][_0x956e('0x7d')]&&_0x3696c5[_0x956e('0x7b')][_0x4a1541][_0x956e('0x7e')]&&_0x3696c5[_0x956e('0x7b')][_0x4a1541][_0x956e('0x7f')]){_0x312e45[_0x3696c5[_0x956e('0x7b')][_0x4a1541]['type']](_0x3696c5['joins'][_0x4a1541]['foreignTable'],null,util[_0x956e('0x76')](_0x956e('0x80'),_0x3696c5[_0x956e('0x71')],_0x3696c5['joins'][_0x4a1541][_0x956e('0x7d')],_0x3696c5[_0x956e('0x7b')][_0x4a1541][_0x956e('0x7e')],_0x3696c5[_0x956e('0x7b')][_0x4a1541][_0x956e('0x7f')]));}}}if(_0x3696c5[_0x956e('0x81')]){_0x3696c5[_0x956e('0x81')]=JSON[_0x956e('0x7c')](_0x3696c5[_0x956e('0x81')]);_0x312e45[_0x956e('0x41')](_0x414fdd(_0x3696c5['conditions'][_0x956e('0x68')]));}_0xcd54ad=_0x312e45['clone']();_0x312e45[_0x956e('0x20')](_0x5894b1);_0x312e45[_0x956e('0x22')](0x0);logger['debug'](_0x956e('0x84'),_0x312e45[_0x956e('0x85')]());return dbH[_0x956e('0x86')][_0x956e('0x33')](_0x312e45[_0x956e('0x85')](),{'type':dbH[_0x956e('0x86')][_0x956e('0x87')][_0x956e('0x88')]});}})[_0x956e('0x27')](function(){return{'sql':_0xcd54ad[_0x956e('0x85')]()};})[_0x956e('0x27')](respondWithResult(_0x313dbf,null))[_0x956e('0x48')](handleError(_0x313dbf,null));}; \ No newline at end of file +var _0xb714=['Run\x20Query:','../../files/reports','savename','countTable','runReport','value','MetricId','%s.%s\x20=\x20%s.%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','apply','save','update','destroy','then','CustomReports','UserProfileResource','error','stack','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','keys','include','catch','create','body','user','get','Reports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','condition','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','from','table','metric','replace','function','format','order','field','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','SEC_TO_TIME(%s)','IS\x20EMPTY','IS\x20NOT\x20EMPTY','getFields','keyBy','groupBy','orderBy','DESC','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info'];(function(_0x322ff3,_0x4c91bc){var _0x3e6830=function(_0x2786ac){while(--_0x2786ac){_0x322ff3['push'](_0x322ff3['shift']());}};_0x3e6830(++_0x4c91bc);}(_0xb714,0xa9));var _0x4b71=function(_0x46c9a5,_0x1cb9e7){_0x46c9a5=_0x46c9a5-0x0;var _0x5e3eec=_0xb714[_0x46c9a5];return _0x5e3eec;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4b71('0x0'));var zipdir=require(_0x4b71('0x1'));var jsonpatch=require(_0x4b71('0x2'));var rp=require(_0x4b71('0x3'));var moment=require('moment');var BPromise=require(_0x4b71('0x4'));var Mustache=require(_0x4b71('0x5'));var util=require(_0x4b71('0x6'));var path=require(_0x4b71('0x7'));var sox=require(_0x4b71('0x8'));var csv=require(_0x4b71('0x9'));var ejs=require(_0x4b71('0xa'));var fs=require('fs');var fs_extra=require(_0x4b71('0xb'));var _=require(_0x4b71('0xc'));var squel=require(_0x4b71('0xd'));var crypto=require(_0x4b71('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4b71('0xf'));var toCsv=require(_0x4b71('0x9'));var querystring=require('querystring');var Papa=require(_0x4b71('0x10'));var Redis=require(_0x4b71('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4b71('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b71('0x13'))(_0x4b71('0x14'));var utils=require('../../config/utils');var config=require(_0x4b71('0x15'));var licenseUtil=require(_0x4b71('0x16'));var db=require(_0x4b71('0x17'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x194f7a,_0x30c114){_0x30c114=_0x30c114||0xcc;return function(_0xae1e44){if(_0xae1e44){return _0x194f7a[_0x4b71('0x18')](_0x30c114);}return _0x194f7a[_0x4b71('0x19')](_0x30c114)[_0x4b71('0x1a')]();};}function respondWithResult(_0x331d2f,_0x460784){_0x460784=_0x460784||0xc8;return function(_0x395e68){if(_0x395e68){return _0x331d2f[_0x4b71('0x19')](_0x460784)['json'](_0x395e68);}};}function respondWithFilteredResult(_0x5aa097,_0x131019){return function(_0x59bd9d){if(_0x59bd9d){var _0x2918b1=typeof _0x131019['offset']===_0x4b71('0x1b')&&typeof _0x131019[_0x4b71('0x1c')]==='undefined';var _0x41b8e0=_0x59bd9d[_0x4b71('0x1d')];var _0x374477=_0x2918b1?0x0:_0x131019[_0x4b71('0x1e')];var _0x3121cf=_0x2918b1?_0x59bd9d['count']:_0x131019[_0x4b71('0x1e')]+_0x131019[_0x4b71('0x1c')];var _0x19e716;if(_0x3121cf>=_0x41b8e0){_0x3121cf=_0x41b8e0;_0x19e716=0xc8;}else{_0x19e716=0xce;}_0x5aa097[_0x4b71('0x19')](_0x19e716);return _0x5aa097[_0x4b71('0x1f')]('Content-Range',_0x374477+'-'+_0x3121cf+'/'+_0x41b8e0)['json'](_0x59bd9d);}return null;};}function patchUpdates(_0x277a29){return function(_0x271751){try{jsonpatch[_0x4b71('0x20')](_0x271751,_0x277a29,!![]);}catch(_0x40fdb0){return BPromise['reject'](_0x40fdb0);}return _0x271751[_0x4b71('0x21')]();};}function saveUpdates(_0xb0888d,_0x5e2c3b){return function(_0x12d591){if(_0x12d591){return _0x12d591[_0x4b71('0x22')](_0xb0888d)['then'](function(_0x1a2d1f){return _0x1a2d1f;});}return null;};}function removeEntity(_0xc5f76d,_0x232dfe){return function(_0x4f05b1){if(_0x4f05b1){return _0x4f05b1[_0x4b71('0x23')]()[_0x4b71('0x24')](function(){var _0x2e8402=_0x4f05b1['get']({'plain':!![]});var _0x3d632f=_0x4b71('0x25');return db[_0x4b71('0x26')][_0x4b71('0x23')]({'where':{'type':_0x3d632f,'resourceId':_0x2e8402['id']}})[_0x4b71('0x24')](function(){return _0x4f05b1;});})[_0x4b71('0x24')](function(){_0xc5f76d[_0x4b71('0x19')](0xcc)[_0x4b71('0x1a')]();});}};}function handleEntityNotFound(_0x1eeab4,_0x5d6908){return function(_0x50af00){if(!_0x50af00){_0x1eeab4[_0x4b71('0x18')](0x194);}return _0x50af00;};}function handleError(_0x23add9,_0x31deff){_0x31deff=_0x31deff||0x1f4;return function(_0x394ae0){logger[_0x4b71('0x27')](_0x394ae0[_0x4b71('0x28')]);if(_0x394ae0[_0x4b71('0x29')]){delete _0x394ae0[_0x4b71('0x29')];}_0x23add9['status'](_0x31deff)[_0x4b71('0x2a')](_0x394ae0);};}exports['index']=function(_0x502488,_0x3aaf60){var _0xaaf767={},_0x33c175={},_0x99f279={'count':0x0,'rows':[]};var _0x2d68cb=_[_0x4b71('0x2b')](db[_0x4b71('0x2c')][_0x4b71('0x2d')],function(_0x18ff25){return{'name':_0x18ff25[_0x4b71('0x2e')],'type':_0x18ff25[_0x4b71('0x2f')][_0x4b71('0x30')]};});_0x33c175['model']=_['map'](_0x2d68cb,_0x4b71('0x29'));_0x33c175[_0x4b71('0x31')]=_['keys'](_0x502488['query']);_0x33c175[_0x4b71('0x32')]=_[_0x4b71('0x33')](_0x33c175[_0x4b71('0x34')],_0x33c175[_0x4b71('0x31')]);_0xaaf767[_0x4b71('0x35')]=_[_0x4b71('0x33')](_0x33c175[_0x4b71('0x34')],qs[_0x4b71('0x36')](_0x502488[_0x4b71('0x31')][_0x4b71('0x36')]));_0xaaf767['attributes']=_0xaaf767[_0x4b71('0x35')][_0x4b71('0x37')]?_0xaaf767[_0x4b71('0x35')]:_0x33c175['model'];if(!_0x502488['query'][_0x4b71('0x38')]('nolimit')){_0xaaf767[_0x4b71('0x1c')]=qs[_0x4b71('0x1c')](_0x502488['query'][_0x4b71('0x1c')]);_0xaaf767[_0x4b71('0x1e')]=qs[_0x4b71('0x1e')](_0x502488[_0x4b71('0x31')][_0x4b71('0x1e')]);}_0xaaf767['order']=qs[_0x4b71('0x39')](_0x502488[_0x4b71('0x31')][_0x4b71('0x39')]);_0xaaf767[_0x4b71('0x3a')]=qs[_0x4b71('0x32')](_[_0x4b71('0x3b')](_0x502488[_0x4b71('0x31')],_0x33c175['filters']),_0x2d68cb);if(_0x502488[_0x4b71('0x31')][_0x4b71('0x3c')]){_0xaaf767[_0x4b71('0x3a')]=_[_0x4b71('0x3d')](_0xaaf767[_0x4b71('0x3a')],{'$or':_['map'](_0x2d68cb,function(_0x3e01fd){if(_0x3e01fd['type']!==_0x4b71('0x3e')){var _0x5bcc17={};_0x5bcc17[_0x3e01fd[_0x4b71('0x29')]]={'$like':'%'+_0x502488[_0x4b71('0x31')][_0x4b71('0x3c')]+'%'};return _0x5bcc17;}})});}_0xaaf767=_[_0x4b71('0x3d')]({},_0xaaf767,_0x502488[_0x4b71('0x3f')]);var _0x499a86={'where':_0xaaf767[_0x4b71('0x3a')]};return db[_0x4b71('0x2c')][_0x4b71('0x1d')](_0x499a86)[_0x4b71('0x24')](function(_0xc177eb){_0x99f279[_0x4b71('0x1d')]=_0xc177eb;if(_0x502488[_0x4b71('0x31')][_0x4b71('0x40')]){_0xaaf767['include']=[{'all':!![]}];}return db[_0x4b71('0x2c')]['findAll'](_0xaaf767);})[_0x4b71('0x24')](function(_0x580b59){_0x99f279[_0x4b71('0x41')]=_0x580b59;return _0x99f279;})[_0x4b71('0x24')](respondWithFilteredResult(_0x3aaf60,_0xaaf767))['catch'](handleError(_0x3aaf60,null));};exports[_0x4b71('0x42')]=function(_0x4daa18,_0xc362e1){var _0xb3616f={'raw':![],'where':{'id':_0x4daa18[_0x4b71('0x43')]['id']}},_0x26f9f9={};_0x26f9f9[_0x4b71('0x34')]=_[_0x4b71('0x44')](db[_0x4b71('0x2c')][_0x4b71('0x2d')]);_0x26f9f9[_0x4b71('0x31')]=_[_0x4b71('0x44')](_0x4daa18[_0x4b71('0x31')]);_0x26f9f9['filters']=_[_0x4b71('0x33')](_0x26f9f9[_0x4b71('0x34')],_0x26f9f9[_0x4b71('0x31')]);_0xb3616f[_0x4b71('0x35')]=_['intersection'](_0x26f9f9[_0x4b71('0x34')],qs[_0x4b71('0x36')](_0x4daa18[_0x4b71('0x31')][_0x4b71('0x36')]));_0xb3616f[_0x4b71('0x35')]=_0xb3616f[_0x4b71('0x35')][_0x4b71('0x37')]?_0xb3616f[_0x4b71('0x35')]:_0x26f9f9[_0x4b71('0x34')];if(_0x4daa18[_0x4b71('0x31')][_0x4b71('0x40')]){_0xb3616f[_0x4b71('0x45')]=[{'all':!![]}];}_0xb3616f=_[_0x4b71('0x3d')]({},_0xb3616f,_0x4daa18['options']);return db['AnalyticCustomReport']['find'](_0xb3616f)[_0x4b71('0x24')](handleEntityNotFound(_0xc362e1,null))[_0x4b71('0x24')](respondWithResult(_0xc362e1,null))[_0x4b71('0x46')](handleError(_0xc362e1,null));};exports[_0x4b71('0x47')]=function(_0x30b62f,_0x42d5a1){return db[_0x4b71('0x2c')]['create'](_0x30b62f[_0x4b71('0x48')],{})[_0x4b71('0x24')](function(_0x3483bf){var _0x3acb9b=_0x30b62f[_0x4b71('0x49')][_0x4b71('0x4a')]({'plain':!![]});if(!_0x3acb9b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3acb9b['role']===_0x4b71('0x49')){var _0x46d423=_0x3483bf[_0x4b71('0x4a')]({'plain':!![]});var _0x40ca69=_0x4b71('0x4b');return db[_0x4b71('0x4c')]['find']({'where':{'name':_0x40ca69,'userProfileId':_0x3acb9b['userProfileId']},'raw':!![]})[_0x4b71('0x24')](function(_0x43a205){if(_0x43a205&&_0x43a205[_0x4b71('0x4d')]===0x0){return db[_0x4b71('0x26')][_0x4b71('0x47')]({'name':_0x46d423['name'],'resourceId':_0x46d423['id'],'type':'CustomReports','sectionId':_0x43a205['id']},{})[_0x4b71('0x24')](function(){return _0x3483bf;});}else{return _0x3483bf;}})[_0x4b71('0x46')](function(_0x320759){logger[_0x4b71('0x27')](_0x4b71('0x4e'),_0x320759);throw _0x320759;});}return _0x3483bf;})[_0x4b71('0x24')](respondWithResult(_0x42d5a1,0xc9))[_0x4b71('0x46')](handleError(_0x42d5a1,null));};exports[_0x4b71('0x22')]=function(_0x351cec,_0x53cd0d){if(_0x351cec['body']['id']){delete _0x351cec[_0x4b71('0x48')]['id'];}return db[_0x4b71('0x2c')][_0x4b71('0x4f')]({'where':{'id':_0x351cec[_0x4b71('0x43')]['id']}})[_0x4b71('0x24')](handleEntityNotFound(_0x53cd0d,null))['then'](saveUpdates(_0x351cec[_0x4b71('0x48')],null))[_0x4b71('0x24')](respondWithResult(_0x53cd0d,null))[_0x4b71('0x46')](handleError(_0x53cd0d,null));};exports['destroy']=function(_0x54574c,_0x53c024){return db[_0x4b71('0x2c')][_0x4b71('0x4f')]({'where':{'id':_0x54574c[_0x4b71('0x43')]['id']}})[_0x4b71('0x24')](handleEntityNotFound(_0x53c024,null))['then'](removeEntity(_0x53c024,null))[_0x4b71('0x46')](handleError(_0x53c024,null));};exports[_0x4b71('0x50')]=function(_0x4e6a2b,_0x5756ab){var _0x54c4f5=0xa;var _0x3653f9=[_0x4b71('0x51'),_0x4b71('0x52'),_0x4b71('0x53'),_0x4b71('0x54')];var _0x1e7857={'SUM':_0x4b71('0x55'),'COUNT':_0x4b71('0x56'),'COUNT DISTINCT':_0x4b71('0x57'),'MAX':_0x4b71('0x58'),'MIN':_0x4b71('0x59'),'AVG':_0x4b71('0x5a'),'GROUP_CONCAT':_0x4b71('0x5b'),'GROUP_CONCAT ASC':_0x4b71('0x5c'),'GROUP_CONCAT DESC':_0x4b71('0x5d')};var _0x3cfedf={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4b71('0x5e'),'HOUR':_0x4b71('0x5f'),'ROUND':_0x4b71('0x60'),'UNIX_TIMESTAMP':_0x4b71('0x61')};var _0x2bde99=function(_0x342847){return!_[_0x4b71('0x62')]([_0x4b71('0x63'),_0x4b71('0x64'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x342847);};var _0x5dd822=function(_0x3c705f){if(!_0x3c705f||!_0x3c705f[_0x4b71('0x65')][_0x4b71('0x37')]){return'';}for(var _0x2f00c1='(',_0x5e0923=0x0;_0x5e0923<_0x3c705f[_0x4b71('0x65')][_0x4b71('0x37')];_0x5e0923+=0x1){_0x5e0923>0x0&&(_0x2f00c1+='\x20'+_0x3c705f[_0x4b71('0x66')]+'\x20');_0x2f00c1+=_0x3c705f[_0x4b71('0x65')][_0x5e0923][_0x4b71('0x67')]?_0x5dd822(_0x3c705f['rules'][_0x5e0923][_0x4b71('0x67')]):_0x3c705f['rules'][_0x5e0923]['field']+'\x20'+_0x3c705f[_0x4b71('0x65')][_0x5e0923][_0x4b71('0x68')]+(_0x2bde99(_0x3c705f[_0x4b71('0x65')][_0x5e0923][_0x4b71('0x68')])?'\x20'+_0x3c705f[_0x4b71('0x65')][_0x5e0923]['value']:'');}return _0x2f00c1+')';};var _0x20a060={'where':{'id':_0x4e6a2b[_0x4b71('0x43')]['id']}},_0x35fed2,_0xcb9ce6,_0x1303aa,_0x575855,_0x3d1ab7;_0x20a060=_[_0x4b71('0x3d')]({},_0x20a060,_0x4e6a2b['options']);return db[_0x4b71('0x2c')][_0x4b71('0x4f')](_0x20a060)[_0x4b71('0x24')](function(_0x44cf20){if(_0x44cf20){_0x35fed2=_0x44cf20;return _0x44cf20['getFields']();}return null;})[_0x4b71('0x24')](function(_0x3a812e){if(_0x3a812e){if(!_0x3a812e[_0x4b71('0x37')]){throw new db[(_0x4b71('0x69'))][(_0x4b71('0x6a'))](_0x4b71('0x6b'),0x193);}_0xcb9ce6=_0x3a812e;return db[_0x4b71('0x6c')][_0x4b71('0x6d')]({'raw':!![]});}return null;})[_0x4b71('0x24')](function(_0x2a53f3){if(_0x2a53f3){_0x1303aa=_['keyBy'](_0x2a53f3,'id');var _0x3fb333;var _0x266145=squel[_0x4b71('0x6e')]();_0x266145[_0x4b71('0x6f')](_0x35fed2[_0x4b71('0x70')]);for(var _0x576a51=0x0;_0x576a51<_0xcb9ce6[_0x4b71('0x37')];_0x576a51+=0x1){_0x3fb333=_0xcb9ce6[_0x576a51]['MetricId']?_0x1303aa[_0xcb9ce6[_0x576a51]['MetricId']][_0x4b71('0x71')]:_0xcb9ce6[_0x576a51]['field'];_0x3fb333=_0xcb9ce6[_0x576a51]['function']?_[_0x4b71('0x72')](_0x1e7857[_0xcb9ce6[_0x576a51][_0x4b71('0x73')]],'%s',_0x3fb333):_0x3fb333;_0x3fb333=_0xcb9ce6[_0x576a51][_0x4b71('0x74')]?_[_0x4b71('0x72')](_0x3cfedf[_0xcb9ce6[_0x576a51][_0x4b71('0x74')]],'%s',_0x3fb333):_0x3fb333;if(_0xcb9ce6[_0x576a51]['groupBy']){_0x266145[_0x4b71('0x67')](_0x3fb333);}_0xcb9ce6[_0x576a51]['orderBy']&&_0x266145[_0x4b71('0x75')](_0x3fb333,_0xcb9ce6[_0x576a51]['orderBy']==='DESC'?![]:!![]);_0x266145[_0x4b71('0x76')](_0x3fb333,_0xcb9ce6[_0x576a51][_0x4b71('0x77')]||_0x3fb333);}if(_0x35fed2[_0x4b71('0x78')]){_0x35fed2['joins']=JSON[_0x4b71('0x79')](_0x35fed2[_0x4b71('0x78')]);for(var _0x593afd=0x0;_0x593afd<_0x35fed2[_0x4b71('0x78')]['length'];_0x593afd+=0x1){if(_0x35fed2[_0x4b71('0x78')][_0x593afd][_0x4b71('0x2f')]&&_[_0x4b71('0x62')](_0x3653f9,_0x35fed2[_0x4b71('0x78')][_0x593afd][_0x4b71('0x2f')])&&_0x35fed2[_0x4b71('0x78')][_0x593afd][_0x4b71('0x7a')]&&_0x35fed2[_0x4b71('0x78')][_0x593afd][_0x4b71('0x7b')]&&_0x35fed2[_0x4b71('0x78')][_0x593afd][_0x4b71('0x7c')]){_0x266145[_0x35fed2['joins'][_0x593afd]['type']](_0x35fed2[_0x4b71('0x78')][_0x593afd][_0x4b71('0x7b')],null,util[_0x4b71('0x74')]('%s.%s\x20=\x20%s.%s',_0x35fed2[_0x4b71('0x70')],_0x35fed2[_0x4b71('0x78')][_0x593afd][_0x4b71('0x7a')],_0x35fed2[_0x4b71('0x78')][_0x593afd][_0x4b71('0x7b')],_0x35fed2[_0x4b71('0x78')][_0x593afd][_0x4b71('0x7c')]));}}}if(_0x35fed2['conditions']){_0x35fed2[_0x4b71('0x7d')]=JSON['parse'](_0x35fed2[_0x4b71('0x7d')]);_0x266145['where'](_0x5dd822(_0x35fed2['conditions'][_0x4b71('0x67')]));}_0x3d1ab7=_0x266145[_0x4b71('0x7e')]();_0x266145[_0x4b71('0x1c')](_0x54c4f5);_0x266145[_0x4b71('0x1e')](0x0);logger[_0x4b71('0x7f')]('Limited\x20Query:',_0x266145[_0x4b71('0x80')]());return dbH['sequelize'][_0x4b71('0x31')](_0x266145[_0x4b71('0x80')](),{'type':dbH[_0x4b71('0x81')][_0x4b71('0x82')][_0x4b71('0x83')]});}})[_0x4b71('0x24')](respondWithResult(_0x5756ab,null))[_0x4b71('0x46')](handleError(_0x5756ab,null));};function runReport(_0x4b1063,_0x37edce,_0x385587){var _0xb146fc=_0x37edce['name'];var _0x573b4d=0xa;var _0x54b3a7=['join',_0x4b71('0x52'),_0x4b71('0x53'),'cross_join'];var _0x1db998={'SUM':'SUM(%s)','COUNT':_0x4b71('0x56'),'COUNT DISTINCT':_0x4b71('0x57'),'MAX':_0x4b71('0x58'),'MIN':'MIN(%s)','AVG':_0x4b71('0x5a'),'GROUP_CONCAT':_0x4b71('0x5b'),'GROUP_CONCAT ASC':_0x4b71('0x5c'),'GROUP_CONCAT DESC':_0x4b71('0x5d')};var _0x48b06a={'SEC_TO_TIME':_0x4b71('0x84'),'DATE':_0x4b71('0x5e'),'HOUR':_0x4b71('0x5f'),'ROUND':_0x4b71('0x60'),'UNIX_TIMESTAMP':_0x4b71('0x61')};var _0x94aa54=function(_0x137ec9){return!_['includes']([_0x4b71('0x63'),_0x4b71('0x64'),_0x4b71('0x85'),_0x4b71('0x86')],_0x137ec9);};var _0x5e2eac=function(_0x5b67d1){if(!_0x5b67d1||!_0x5b67d1[_0x4b71('0x65')][_0x4b71('0x37')]){return'';}for(var _0x52696c='(',_0x28ff05=0x0;_0x28ff05<_0x5b67d1[_0x4b71('0x65')]['length'];_0x28ff05+=0x1){_0x28ff05>0x0&&(_0x52696c+='\x20'+_0x5b67d1[_0x4b71('0x66')]+'\x20');_0x52696c+=_0x5b67d1[_0x4b71('0x65')][_0x28ff05][_0x4b71('0x67')]?_0x5e2eac(_0x5b67d1['rules'][_0x28ff05][_0x4b71('0x67')]):_0x5b67d1['rules'][_0x28ff05]['field']+'\x20'+_0x5b67d1[_0x4b71('0x65')][_0x28ff05][_0x4b71('0x68')]+(_0x94aa54(_0x5b67d1['rules'][_0x28ff05]['condition'])?'\x20'+_0x5b67d1[_0x4b71('0x65')][_0x28ff05]['value']:'');}return _0x52696c+')';};var _0x4ddb65={'where':{'id':_0x4b1063['id']}},_0x1abe2b,_0x3843f7,_0x33acf6,_0x344a97,_0x353a80;_0x4ddb65=_[_0x4b71('0x3d')]({},_0x4ddb65,_0x385587);return db['AnalyticCustomReport'][_0x4b71('0x4f')](_0x4ddb65)['then'](function(_0x1a962b){if(_0x1a962b){_0x1abe2b=_0x1a962b;return _0x1a962b[_0x4b71('0x87')]();}return null;})['then'](function(_0xcc826e){if(_0xcc826e){if(!_0xcc826e[_0x4b71('0x37')]){throw new db[(_0x4b71('0x69'))][(_0x4b71('0x6a'))](_0x4b71('0x6b'),0x193);}_0x3843f7=_0xcc826e;return db[_0x4b71('0x6c')][_0x4b71('0x6d')]({'raw':!![]});}return null;})[_0x4b71('0x24')](function(_0x4b6439){if(_0x4b6439){_0x33acf6=_[_0x4b71('0x88')](_0x4b6439,'id');var _0xefed23;var _0x43c4dc=squel[_0x4b71('0x6e')]();_0x43c4dc[_0x4b71('0x6f')](_0x1abe2b[_0x4b71('0x70')]);for(var _0x2b0769=0x0;_0x2b0769<_0x3843f7[_0x4b71('0x37')];_0x2b0769+=0x1){_0xefed23=_0x3843f7[_0x2b0769]['MetricId']?_0x33acf6[_0x3843f7[_0x2b0769]['MetricId']][_0x4b71('0x71')]:_0x3843f7[_0x2b0769][_0x4b71('0x76')];_0xefed23=_0x3843f7[_0x2b0769][_0x4b71('0x73')]?_['replace'](_0x1db998[_0x3843f7[_0x2b0769][_0x4b71('0x73')]],'%s',_0xefed23):_0xefed23;_0xefed23=_0x3843f7[_0x2b0769][_0x4b71('0x74')]?_[_0x4b71('0x72')](_0x48b06a[_0x3843f7[_0x2b0769][_0x4b71('0x74')]],'%s',_0xefed23):_0xefed23;if(_0x3843f7[_0x2b0769][_0x4b71('0x89')]){_0x43c4dc[_0x4b71('0x67')](_0xefed23);}_0x3843f7[_0x2b0769][_0x4b71('0x8a')]&&_0x43c4dc[_0x4b71('0x75')](_0xefed23,_0x3843f7[_0x2b0769][_0x4b71('0x8a')]===_0x4b71('0x8b')?![]:!![]);_0x43c4dc[_0x4b71('0x76')](_0xefed23,_0x3843f7[_0x2b0769]['alias']||_0xefed23);}if(_0x1abe2b[_0x4b71('0x78')]){_0x1abe2b['joins']=JSON['parse'](_0x1abe2b[_0x4b71('0x78')]);for(var _0x40b2bf=0x0;_0x40b2bf<_0x1abe2b[_0x4b71('0x78')][_0x4b71('0x37')];_0x40b2bf+=0x1){if(_0x1abe2b[_0x4b71('0x78')][_0x40b2bf]['type']&&_['includes'](_0x54b3a7,_0x1abe2b[_0x4b71('0x78')][_0x40b2bf][_0x4b71('0x2f')])&&_0x1abe2b[_0x4b71('0x78')][_0x40b2bf]['parentKey']&&_0x1abe2b[_0x4b71('0x78')][_0x40b2bf][_0x4b71('0x7b')]&&_0x1abe2b[_0x4b71('0x78')][_0x40b2bf][_0x4b71('0x7c')]){_0x43c4dc[_0x1abe2b['joins'][_0x40b2bf][_0x4b71('0x2f')]](_0x1abe2b[_0x4b71('0x78')][_0x40b2bf][_0x4b71('0x7b')],null,util[_0x4b71('0x74')]('%s.%s\x20=\x20%s.%s',_0x1abe2b[_0x4b71('0x70')],_0x1abe2b[_0x4b71('0x78')][_0x40b2bf][_0x4b71('0x7a')],_0x1abe2b['joins'][_0x40b2bf]['foreignTable'],_0x1abe2b[_0x4b71('0x78')][_0x40b2bf]['foreignKey']));}}}if(_0x1abe2b[_0x4b71('0x7d')]){_0x1abe2b['conditions']=JSON[_0x4b71('0x79')](_0x1abe2b[_0x4b71('0x7d')]);_0x43c4dc[_0x4b71('0x3a')](_0x5e2eac(_0x1abe2b[_0x4b71('0x7d')]['group']));}_0x353a80=_0x43c4dc[_0x4b71('0x7e')]();_0x43c4dc[_0x4b71('0x1c')](_0x573b4d);_0x43c4dc[_0x4b71('0x1e')](0x0);return;}})['then'](function(){if(_0x37edce[_0x4b71('0x8c')]==='web'){return null;}var _0x27158e=_[_0x4b71('0x3d')](_0x37edce,{'name':_0x37edce[_0x4b71('0x8d')]||_0x37edce[_0x4b71('0x29')]||_0x1abe2b[_0x4b71('0x29')],'basename':_0xb146fc,'savename':util[_0x4b71('0x74')](_0x4b71('0x8e'),_0x37edce[_0x4b71('0x29')]||_0x1abe2b['name'],require(_0x4b71('0x8f'))[_0x4b71('0x90')](0x4),_0x37edce['output']||_0x4b71('0x91')),'reportId':_0x1abe2b['id'],'reportType':_0x4b71('0x92')});return db[_0x4b71('0x93')][_0x4b71('0x47')](_0x27158e,{'raw':!![]});})[_0x4b71('0x24')](function(_0x44afca){if(_0x1abe2b[_0x4b71('0x70')]===_0x4b71('0x94')){_0x353a80[_0x4b71('0x3a')](_0x1abe2b[_0x4b71('0x70')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x37edce['startDate'],_0x37edce[_0x4b71('0x95')]);}else{_0x353a80[_0x4b71('0x3a')](_0x1abe2b['table']+_0x4b71('0x96'),_0x37edce[_0x4b71('0x97')],_0x37edce[_0x4b71('0x95')]);}if(_0x44afca){logger[_0x4b71('0x98')](_0x4b71('0x99'),_0x353a80[_0x4b71('0x80')]());require('child_process')['fork'](path[_0x4b71('0x51')](__dirname,'../../components/export/',_0x44afca['output']),[_0x44afca['id'],_0x353a80[_0x4b71('0x80')](),path['join'](__dirname,_0x4b71('0x9a'),_0x44afca[_0x4b71('0x9b')]),_0xb146fc]);return _0x44afca;}else{var _0x5de31e=squel['select']();_0x5de31e['from']('('+_0x353a80[_0x4b71('0x80')]()+')',_0x4b71('0x9c'));_0x5de31e['field']('COUNT(*)',_0x4b71('0x1d'));_0x353a80[_0x4b71('0x1c')](_0x37edce[_0x4b71('0x1c')]||_0x573b4d);_0x353a80[_0x4b71('0x1e')](_0x37edce['offset']||0x0);return dbH[_0x4b71('0x81')]['query'](_0x5de31e[_0x4b71('0x80')](),{'type':dbH['sequelize'][_0x4b71('0x82')][_0x4b71('0x83')]})['then'](function(_0x2d95f4){if(!_0x2d95f4[_0x4b71('0x37')]){_0x344a97=0x0;}else{_0x344a97=_0x2d95f4[0x0]['count']||0x0;}return dbH[_0x4b71('0x81')][_0x4b71('0x31')](_0x353a80[_0x4b71('0x80')](),{'type':dbH['sequelize'][_0x4b71('0x82')][_0x4b71('0x83')]});})[_0x4b71('0x24')](function(_0x554338){return{'rows':_0x554338||[],'count':_0x344a97};});}});}exports['run']=function(_0x1f6bdb,_0x37a0ce){return runReport(_0x1f6bdb[_0x4b71('0x43')],_0x1f6bdb[_0x4b71('0x31')],_0x1f6bdb[_0x4b71('0x3f')])[_0x4b71('0x24')](respondWithResult(_0x37a0ce,null))['catch'](handleError(_0x37a0ce,null));};exports[_0x4b71('0x9d')]=runReport;exports['query']=function(_0x462f4b,_0x3dfb39){var _0x5f5613=0xa;var _0x1b5d62=[_0x4b71('0x51'),_0x4b71('0x52'),_0x4b71('0x53'),_0x4b71('0x54')];var _0x26a454={'SUM':_0x4b71('0x55'),'COUNT':_0x4b71('0x56'),'COUNT DISTINCT':_0x4b71('0x57'),'MAX':_0x4b71('0x58'),'MIN':_0x4b71('0x59'),'AVG':_0x4b71('0x5a'),'GROUP_CONCAT':_0x4b71('0x5b'),'GROUP_CONCAT ASC':_0x4b71('0x5c'),'GROUP_CONCAT DESC':_0x4b71('0x5d')};var _0x3bf11e={'SEC_TO_TIME':_0x4b71('0x84'),'DATE':_0x4b71('0x5e'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4b71('0x61')};var _0xbe10dc=function(_0x26337b){return!_[_0x4b71('0x62')](['IS\x20NULL',_0x4b71('0x64'),_0x4b71('0x85'),'IS\x20NOT\x20EMPTY'],_0x26337b);};var _0x3c49a5=function(_0x54b2b8){if(!_0x54b2b8||!_0x54b2b8[_0x4b71('0x65')]['length']){return'';}for(var _0x48490b='(',_0x331421=0x0;_0x331421<_0x54b2b8[_0x4b71('0x65')][_0x4b71('0x37')];_0x331421+=0x1){_0x331421>0x0&&(_0x48490b+='\x20'+_0x54b2b8[_0x4b71('0x66')]+'\x20');_0x48490b+=_0x54b2b8['rules'][_0x331421][_0x4b71('0x67')]?_0x3c49a5(_0x54b2b8['rules'][_0x331421][_0x4b71('0x67')]):_0x54b2b8[_0x4b71('0x65')][_0x331421]['field']+'\x20'+_0x54b2b8[_0x4b71('0x65')][_0x331421][_0x4b71('0x68')]+(_0xbe10dc(_0x54b2b8[_0x4b71('0x65')][_0x331421][_0x4b71('0x68')])?'\x20'+_0x54b2b8[_0x4b71('0x65')][_0x331421][_0x4b71('0x9e')]:'');}return _0x48490b+')';};var _0x118f1e={'where':{'id':_0x462f4b[_0x4b71('0x43')]['id']}},_0x30cf30,_0xef3c53,_0x3eefb6,_0x61fc54,_0x58d07b;_0x118f1e=_['merge']({},_0x118f1e,_0x462f4b[_0x4b71('0x3f')]);return db['AnalyticCustomReport'][_0x4b71('0x4f')](_0x118f1e)['then'](function(_0x1a206d){if(_0x1a206d){_0x30cf30=_0x1a206d;return _0x1a206d['getFields']();}return null;})[_0x4b71('0x24')](function(_0x14f65c){if(_0x14f65c){if(!_0x14f65c[_0x4b71('0x37')]){throw new db[(_0x4b71('0x69'))][(_0x4b71('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xef3c53=_0x14f65c;return db[_0x4b71('0x6c')][_0x4b71('0x6d')]({'raw':!![]});}return null;})['then'](function(_0x2cf171){if(_0x2cf171){_0x3eefb6=_[_0x4b71('0x88')](_0x2cf171,'id');var _0x1a2be9;var _0x4151f7=squel[_0x4b71('0x6e')]();_0x4151f7['from'](_0x30cf30[_0x4b71('0x70')]);for(var _0xc8907e=0x0;_0xc8907e<_0xef3c53[_0x4b71('0x37')];_0xc8907e+=0x1){_0x1a2be9=_0xef3c53[_0xc8907e][_0x4b71('0x9f')]?_0x3eefb6[_0xef3c53[_0xc8907e][_0x4b71('0x9f')]][_0x4b71('0x71')]:_0xef3c53[_0xc8907e][_0x4b71('0x76')];_0x1a2be9=_0xef3c53[_0xc8907e]['function']?_[_0x4b71('0x72')](_0x26a454[_0xef3c53[_0xc8907e][_0x4b71('0x73')]],'%s',_0x1a2be9):_0x1a2be9;_0x1a2be9=_0xef3c53[_0xc8907e][_0x4b71('0x74')]?_[_0x4b71('0x72')](_0x3bf11e[_0xef3c53[_0xc8907e][_0x4b71('0x74')]],'%s',_0x1a2be9):_0x1a2be9;if(_0xef3c53[_0xc8907e][_0x4b71('0x89')]){_0x4151f7['group'](_0x1a2be9);}_0xef3c53[_0xc8907e][_0x4b71('0x8a')]&&_0x4151f7[_0x4b71('0x75')](_0x1a2be9,_0xef3c53[_0xc8907e][_0x4b71('0x8a')]===_0x4b71('0x8b')?![]:!![]);_0x4151f7[_0x4b71('0x76')](_0x1a2be9,_0xef3c53[_0xc8907e][_0x4b71('0x77')]||_0x1a2be9);}if(_0x30cf30[_0x4b71('0x78')]){_0x30cf30[_0x4b71('0x78')]=JSON[_0x4b71('0x79')](_0x30cf30[_0x4b71('0x78')]);for(var _0x1f0e35=0x0;_0x1f0e35<_0x30cf30[_0x4b71('0x78')][_0x4b71('0x37')];_0x1f0e35+=0x1){if(_0x30cf30['joins'][_0x1f0e35][_0x4b71('0x2f')]&&_[_0x4b71('0x62')](_0x1b5d62,_0x30cf30[_0x4b71('0x78')][_0x1f0e35]['type'])&&_0x30cf30[_0x4b71('0x78')][_0x1f0e35]['parentKey']&&_0x30cf30['joins'][_0x1f0e35]['foreignTable']&&_0x30cf30['joins'][_0x1f0e35][_0x4b71('0x7c')]){_0x4151f7[_0x30cf30['joins'][_0x1f0e35][_0x4b71('0x2f')]](_0x30cf30['joins'][_0x1f0e35]['foreignTable'],null,util['format'](_0x4b71('0xa0'),_0x30cf30['table'],_0x30cf30[_0x4b71('0x78')][_0x1f0e35][_0x4b71('0x7a')],_0x30cf30[_0x4b71('0x78')][_0x1f0e35][_0x4b71('0x7b')],_0x30cf30['joins'][_0x1f0e35]['foreignKey']));}}}if(_0x30cf30[_0x4b71('0x7d')]){_0x30cf30[_0x4b71('0x7d')]=JSON[_0x4b71('0x79')](_0x30cf30[_0x4b71('0x7d')]);_0x4151f7[_0x4b71('0x3a')](_0x3c49a5(_0x30cf30[_0x4b71('0x7d')][_0x4b71('0x67')]));}_0x58d07b=_0x4151f7[_0x4b71('0x7e')]();_0x4151f7['limit'](_0x5f5613);_0x4151f7['offset'](0x0);logger['debug']('Limited\x20Query:',_0x4151f7[_0x4b71('0x80')]());return dbH[_0x4b71('0x81')]['query'](_0x4151f7[_0x4b71('0x80')](),{'type':dbH[_0x4b71('0x81')][_0x4b71('0x82')][_0x4b71('0x83')]});}})['then'](function(){return{'sql':_0x58d07b[_0x4b71('0x80')]()};})[_0x4b71('0x24')](respondWithResult(_0x3dfb39,null))[_0x4b71('0x46')](handleError(_0x3dfb39,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index e60e570..14eb8e8 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 _0xcdf7=['../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x3f11cb,_0x39f8fd){var _0x818b35=function(_0x38d95b){while(--_0x38d95b){_0x3f11cb['push'](_0x3f11cb['shift']());}};_0x818b35(++_0x39f8fd);}(_0xcdf7,0x17a));var _0x7cdf=function(_0x264c3b,_0x474ae2){_0x264c3b=_0x264c3b-0x0;var _0x1977ef=_0xcdf7[_0x264c3b];return _0x1977ef;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7cdf('0x0'))(_0x7cdf('0x1'));var moment=require(_0x7cdf('0x2'));var BPromise=require(_0x7cdf('0x3'));var rp=require(_0x7cdf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7cdf('0x5'));var config=require(_0x7cdf('0x6'));var attributes=require(_0x7cdf('0x7'));module[_0x7cdf('0x8')]=function(_0x29877c,_0x54906d){return _0x29877c[_0x7cdf('0x9')](_0x7cdf('0xa'),attributes,{'tableName':_0x7cdf('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf611=['rimraf','../../config/environment','exports','define','AnalyticCustomReport','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x519c88,_0xb84103){var _0x4668d7=function(_0x596c2c){while(--_0x596c2c){_0x519c88['push'](_0x519c88['shift']());}};_0x4668d7(++_0xb84103);}(_0xf611,0x65));var _0x1f61=function(_0x1e62b8,_0x5eed4c){_0x1e62b8=_0x1e62b8-0x0;var _0x2ab271=_0xf611[_0x1e62b8];return _0x2ab271;};'use strict';var _=require(_0x1f61('0x0'));var util=require(_0x1f61('0x1'));var logger=require('../../config/logger')(_0x1f61('0x2'));var moment=require(_0x1f61('0x3'));var BPromise=require(_0x1f61('0x4'));var rp=require(_0x1f61('0x5'));var fs=require('fs');var path=require(_0x1f61('0x6'));var rimraf=require(_0x1f61('0x7'));var config=require(_0x1f61('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0x1f61('0x9')]=function(_0x111773,_0x2553e7){return _0x111773[_0x1f61('0xa')](_0x1f61('0xb'),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 a3c14cd..99dbf38 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 _0x0a25=['error','code','AnalyticCustomReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x238830,_0x545f75){var _0x5917f0=function(_0x12f821){while(--_0x12f821){_0x238830['push'](_0x238830['shift']());}};_0x5917f0(++_0x545f75);}(_0x0a25,0x1a9));var _0x50a2=function(_0x425a95,_0x2743b6){_0x425a95=_0x425a95-0x0;var _0x270c10=_0x0a25[_0x425a95];return _0x270c10;};'use strict';var _=require(_0x50a2('0x0'));var util=require(_0x50a2('0x1'));var moment=require(_0x50a2('0x2'));var BPromise=require(_0x50a2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x50a2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x50a2('0x5'));var logger=require(_0x50a2('0x6'))(_0x50a2('0x7'));var config=require('../../config/environment');var jayson=require(_0x50a2('0x8'));var client=jayson[_0x50a2('0x9')][_0x50a2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x548ab2,_0x11dde6,_0x1caac0){return new BPromise(function(_0x694333,_0x33c1c1){return client['request'](_0x548ab2,_0x1caac0)[_0x50a2('0xb')](function(_0x103a7f){logger[_0x50a2('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x11dde6,'request\x20sent');logger['debug'](_0x50a2('0xd'),_0x11dde6,_0x50a2('0xe'),JSON[_0x50a2('0xf')](_0x103a7f));if(_0x103a7f['error']){if(_0x103a7f[_0x50a2('0x10')][_0x50a2('0x11')]===0x1f4){logger[_0x50a2('0x10')](_0x50a2('0x12'),_0x11dde6,_0x103a7f[_0x50a2('0x10')]['message']);return _0x33c1c1(_0x103a7f[_0x50a2('0x10')][_0x50a2('0x13')]);}logger['error'](_0x50a2('0x12'),_0x11dde6,_0x103a7f[_0x50a2('0x10')][_0x50a2('0x13')]);return _0x694333(_0x103a7f[_0x50a2('0x10')][_0x50a2('0x13')]);}else{logger[_0x50a2('0xc')](_0x50a2('0x12'),_0x11dde6,_0x50a2('0xe'));_0x694333(_0x103a7f['result']['message']);}})[_0x50a2('0x14')](function(_0x5b1de4){logger[_0x50a2('0x10')](_0x50a2('0x12'),_0x11dde6,_0x5b1de4);_0x33c1c1(_0x5b1de4);});});} \ No newline at end of file +var _0x09e8=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','bluebird','randomstring','ioredis'];(function(_0x5534fe,_0x43c22e){var _0x3d1dc2=function(_0x9df12){while(--_0x9df12){_0x5534fe['push'](_0x5534fe['shift']());}};_0x3d1dc2(++_0x43c22e);}(_0x09e8,0x70));var _0x809e=function(_0x374db6,_0x43919b){_0x374db6=_0x374db6-0x0;var _0x179262=_0x09e8[_0x374db6];return _0x179262;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x809e('0x0'));var rs=require(_0x809e('0x1'));var fs=require('fs');var Redis=require(_0x809e('0x2'));var db=require(_0x809e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x809e('0x4'))(_0x809e('0x5'));var config=require(_0x809e('0x6'));var jayson=require(_0x809e('0x7'));var client=jayson[_0x809e('0x8')][_0x809e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55bf91,_0x4a61fa,_0x219dfc){return new BPromise(function(_0x28545f,_0x122dbe){return client[_0x809e('0xa')](_0x55bf91,_0x219dfc)[_0x809e('0xb')](function(_0x25c64c){logger[_0x809e('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4a61fa,_0x809e('0xd'));logger[_0x809e('0xe')](_0x809e('0xf'),_0x4a61fa,'request\x20sent',JSON[_0x809e('0x10')](_0x25c64c));if(_0x25c64c[_0x809e('0x11')]){if(_0x25c64c[_0x809e('0x11')][_0x809e('0x12')]===0x1f4){logger[_0x809e('0x11')](_0x809e('0x13'),_0x4a61fa,_0x25c64c[_0x809e('0x11')][_0x809e('0x14')]);return _0x122dbe(_0x25c64c[_0x809e('0x11')][_0x809e('0x14')]);}logger[_0x809e('0x11')](_0x809e('0x13'),_0x4a61fa,_0x25c64c[_0x809e('0x11')][_0x809e('0x14')]);return _0x28545f(_0x25c64c['error'][_0x809e('0x14')]);}else{logger[_0x809e('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4a61fa,_0x809e('0xd'));_0x28545f(_0x25c64c[_0x809e('0x15')]['message']);}})[_0x809e('0x16')](function(_0x2af89c){logger['error'](_0x809e('0x13'),_0x4a61fa,_0x2af89c);_0x122dbe(_0x2af89c);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 7b9a12c..65bdb4e 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 _0x9412=['get','/:id','show','/:id/preview','run','query','post','create','put','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index'];(function(_0x489618,_0x233987){var _0x3d34b8=function(_0xe4ffd0){while(--_0xe4ffd0){_0x489618['push'](_0x489618['shift']());}};_0x3d34b8(++_0x233987);}(_0x9412,0x197));var _0x2941=function(_0x360206,_0x7c26ef){_0x360206=_0x360206-0x0;var _0x48eaad=_0x9412[_0x360206];return _0x48eaad;};'use strict';var multer=require(_0x2941('0x0'));var util=require('util');var path=require(_0x2941('0x1'));var timeout=require(_0x2941('0x2'));var express=require(_0x2941('0x3'));var router=express[_0x2941('0x4')]();var fs_extra=require(_0x2941('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2941('0x6'));var config=require(_0x2941('0x7'));var controller=require(_0x2941('0x8'));router['get']('/',auth[_0x2941('0x9')](),controller[_0x2941('0xa')]);router[_0x2941('0xb')](_0x2941('0xc'),auth[_0x2941('0x9')](),controller[_0x2941('0xd')]);router[_0x2941('0xb')](_0x2941('0xe'),auth[_0x2941('0x9')](),controller['preview']);router[_0x2941('0xb')]('/:id/run',auth[_0x2941('0x9')](),controller[_0x2941('0xf')]);router[_0x2941('0xb')]('/:id/query',auth[_0x2941('0x9')](),controller[_0x2941('0x10')]);router[_0x2941('0x11')]('/',auth[_0x2941('0x9')](),controller[_0x2941('0x12')]);router[_0x2941('0x13')](_0x2941('0xc'),auth[_0x2941('0x9')](),controller['update']);router['delete'](_0x2941('0xc'),auth['isAuthenticated'](),controller[_0x2941('0x14')]);module[_0x2941('0x15')]=router; \ No newline at end of file +var _0x2c6f=['/:id','isAuthenticated','show','/:id/preview','/:id/run','run','/:id/query','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x2c6f,0x1c6));var _0xf2c6=function(_0x5413a5,_0x3e3c8b){_0x5413a5=_0x5413a5-0x0;var _0xed3967=_0x2c6f[_0x5413a5];return _0xed3967;};'use strict';var multer=require('multer');var util=require(_0xf2c6('0x0'));var path=require('path');var timeout=require(_0xf2c6('0x1'));var express=require(_0xf2c6('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf2c6('0x3'));var interaction=require(_0xf2c6('0x4'));var config=require(_0xf2c6('0x5'));var controller=require(_0xf2c6('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xf2c6('0x7')](_0xf2c6('0x8'),auth[_0xf2c6('0x9')](),controller[_0xf2c6('0xa')]);router[_0xf2c6('0x7')](_0xf2c6('0xb'),auth['isAuthenticated'](),controller['preview']);router[_0xf2c6('0x7')](_0xf2c6('0xc'),auth[_0xf2c6('0x9')](),controller[_0xf2c6('0xd')]);router[_0xf2c6('0x7')](_0xf2c6('0xe'),auth[_0xf2c6('0x9')](),controller['query']);router[_0xf2c6('0xf')]('/',auth['isAuthenticated'](),controller[_0xf2c6('0x10')]);router[_0xf2c6('0x11')](_0xf2c6('0x8'),auth[_0xf2c6('0x9')](),controller[_0xf2c6('0x12')]);router[_0xf2c6('0x13')](_0xf2c6('0x8'),auth[_0xf2c6('0x9')](),controller[_0xf2c6('0x14')]);module[_0xf2c6('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 3cc4ad6..6bee773 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 _0x8958=['TEXT','exports'];(function(_0x7b544a,_0x33c45a){var _0x33dcb4=function(_0x5ebc7f){while(--_0x5ebc7f){_0x7b544a['push'](_0x7b544a['shift']());}};_0x33dcb4(++_0x33c45a);}(_0x8958,0x93));var _0x8895=function(_0x436e22,_0x2f6821){_0x436e22=_0x436e22-0x0;var _0x524f42=_0x8958[_0x436e22];return _0x524f42;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x8895('0x1')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x5d58=['TEXT','STRING'];(function(_0x4747ce,_0x31e43c){var _0x307ed5=function(_0x28ed8){while(--_0x28ed8){_0x4747ce['push'](_0x4747ce['shift']());}};_0x307ed5(++_0x31e43c);}(_0x5d58,0x187));var _0x85d5=function(_0x235d34,_0x3a8ab5){_0x235d34=_0x235d34-0x0;var _0x113859=_0x5d58[_0x235d34];return _0x113859;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x85d5('0x0')]},'conditions':{'type':Sequelize[_0x85d5('0x1')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 24dc81b..7218c52 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 _0xabce=['where','findAll','show','includeAll','options','find','catch','create','body','user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','field','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ValidationErrorItem','AnalyticMetric','keyBy','select','metric','DESC','foreignKey','output','web','%s-%s.%s','default','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','Sequelize','alias','clone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','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','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xabce[_0x110c3d];return _0x226d67;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];var dbH=require(_0xeabc('0x19'))[_0xeabc('0x1a')];function respondWithStatusCode(_0xcfbf06,_0x53df9c){_0x53df9c=_0x53df9c||0xcc;return function(_0x235c2d){if(_0x235c2d){return _0xcfbf06[_0xeabc('0x1b')](_0x53df9c);}return _0xcfbf06[_0xeabc('0x1c')](_0x53df9c)['end']();};}function respondWithResult(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xc8;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1c')](_0x3170ea)['json'](_0x3ae954);}};}function respondWithFilteredResult(_0xf913d7,_0x638976){return function(_0x49f2d8){if(_0x49f2d8){var _0x53fe28=typeof _0x638976[_0xeabc('0x1d')]==='undefined'&&typeof _0x638976[_0xeabc('0x1e')]===_0xeabc('0x1f');var _0x58a3c0=_0x49f2d8[_0xeabc('0x20')];var _0x31dd53=_0x53fe28?0x0:_0x638976[_0xeabc('0x1d')];var _0x384be5=_0x53fe28?_0x49f2d8[_0xeabc('0x20')]:_0x638976['offset']+_0x638976[_0xeabc('0x1e')];var _0x4d68ea;if(_0x384be5>=_0x58a3c0){_0x384be5=_0x58a3c0;_0x4d68ea=0xc8;}else{_0x4d68ea=0xce;}_0xf913d7[_0xeabc('0x1c')](_0x4d68ea);return _0xf913d7[_0xeabc('0x21')]('Content-Range',_0x31dd53+'-'+_0x384be5+'/'+_0x58a3c0)[_0xeabc('0x22')](_0x49f2d8);}return null;};}function patchUpdates(_0x41d67a){return function(_0x254590){try{jsonpatch[_0xeabc('0x23')](_0x254590,_0x41d67a,!![]);}catch(_0x3c9611){return BPromise['reject'](_0x3c9611);}return _0x254590[_0xeabc('0x24')]();};}function saveUpdates(_0x10c675,_0x91ab00){return function(_0x5bdd57){if(_0x5bdd57){return _0x5bdd57[_0xeabc('0x25')](_0x10c675)[_0xeabc('0x26')](function(_0x214953){return _0x214953;});}return null;};}function removeEntity(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['destroy']()[_0xeabc('0x26')](function(){var _0x4d4e29=_0x109e1d[_0xeabc('0x27')]({'plain':!![]});var _0x12acbd=_0xeabc('0x28');return db[_0xeabc('0x29')][_0xeabc('0x2a')]({'where':{'type':_0x12acbd,'resourceId':_0x4d4e29['id']}})[_0xeabc('0x26')](function(){return _0x109e1d;});})[_0xeabc('0x26')](function(){_0x319119['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459c8a,_0x5bf8f2){return function(_0x3c1b5b){if(!_0x3c1b5b){_0x459c8a[_0xeabc('0x1b')](0x194);}return _0x3c1b5b;};}function handleError(_0x48fb52,_0x2163e6){_0x2163e6=_0x2163e6||0x1f4;return function(_0x38572d){logger[_0xeabc('0x2b')](_0x38572d[_0xeabc('0x2c')]);if(_0x38572d[_0xeabc('0x2d')]){delete _0x38572d[_0xeabc('0x2d')];}_0x48fb52[_0xeabc('0x1c')](_0x2163e6)[_0xeabc('0x2e')](_0x38572d);};}exports[_0xeabc('0x2f')]=function(_0x5ebb86,_0x5b34dd){var _0x5bb1f1={},_0x2f03e8={},_0x2d027e={'count':0x0,'rows':[]};var _0x98b445=_[_0xeabc('0x30')](db[_0xeabc('0x31')][_0xeabc('0x32')],function(_0x61c0af){return{'name':_0x61c0af['fieldName'],'type':_0x61c0af[_0xeabc('0x33')][_0xeabc('0x34')]};});_0x2f03e8[_0xeabc('0x35')]=_['map'](_0x98b445,_0xeabc('0x2d'));_0x2f03e8[_0xeabc('0x36')]=_[_0xeabc('0x37')](_0x5ebb86['query']);_0x2f03e8[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0x2f03e8[_0xeabc('0x35')],_0x2f03e8['query']);_0x5bb1f1[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0x2f03e8['model'],qs['fields'](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x5bb1f1['attributes']=_0x5bb1f1[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x5bb1f1[_0xeabc('0x3a')]:_0x2f03e8[_0xeabc('0x35')];if(!_0x5ebb86[_0xeabc('0x36')]['hasOwnProperty'](_0xeabc('0x3d'))){_0x5bb1f1['limit']=qs[_0xeabc('0x1e')](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x1e')]);_0x5bb1f1['offset']=qs['offset'](_0x5ebb86[_0xeabc('0x36')]['offset']);}_0x5bb1f1[_0xeabc('0x3e')]=qs['sort'](_0x5ebb86['query']['sort']);_0x5bb1f1['where']=qs[_0xeabc('0x38')](_['pick'](_0x5ebb86[_0xeabc('0x36')],_0x2f03e8[_0xeabc('0x38')]),_0x98b445);if(_0x5ebb86['query'][_0xeabc('0x3f')]){_0x5bb1f1['where']=_[_0xeabc('0x40')](_0x5bb1f1['where'],{'$or':_[_0xeabc('0x30')](_0x98b445,function(_0xf1b7ef){if(_0xf1b7ef[_0xeabc('0x33')]!=='VIRTUAL'){var _0x5a00d0={};_0x5a00d0[_0xf1b7ef['name']]={'$like':'%'+_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3f')]+'%'};return _0x5a00d0;}})});}_0x5bb1f1=_[_0xeabc('0x40')]({},_0x5bb1f1,_0x5ebb86['options']);var _0x4f1897={'where':_0x5bb1f1[_0xeabc('0x41')]};return db[_0xeabc('0x31')]['count'](_0x4f1897)[_0xeabc('0x26')](function(_0x5e0b78){_0x2d027e[_0xeabc('0x20')]=_0x5e0b78;if(_0x5ebb86['query']['includeAll']){_0x5bb1f1['include']=[{'all':!![]}];}return db[_0xeabc('0x31')][_0xeabc('0x42')](_0x5bb1f1);})[_0xeabc('0x26')](function(_0x3eeeb5){_0x2d027e['rows']=_0x3eeeb5;return _0x2d027e;})[_0xeabc('0x26')](respondWithFilteredResult(_0x5b34dd,_0x5bb1f1))['catch'](handleError(_0x5b34dd,null));};exports[_0xeabc('0x43')]=function(_0x1a4bbe,_0x3a7807){var _0x17a0df={'raw':!![],'where':{'id':_0x1a4bbe['params']['id']}},_0xc849c9={};_0xc849c9['model']=_[_0xeabc('0x37')](db['AnalyticDefaultReport'][_0xeabc('0x32')]);_0xc849c9[_0xeabc('0x36')]=_['keys'](_0x1a4bbe[_0xeabc('0x36')]);_0xc849c9[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0xc849c9[_0xeabc('0x35')],_0xc849c9[_0xeabc('0x36')]);_0x17a0df[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0xc849c9['model'],qs[_0xeabc('0x3b')](_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x17a0df[_0xeabc('0x3a')]=_0x17a0df[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x17a0df[_0xeabc('0x3a')]:_0xc849c9[_0xeabc('0x35')];if(_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x44')]){_0x17a0df['include']=[{'all':!![]}];}_0x17a0df=_[_0xeabc('0x40')]({},_0x17a0df,_0x1a4bbe[_0xeabc('0x45')]);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x17a0df)[_0xeabc('0x26')](handleEntityNotFound(_0x3a7807,null))[_0xeabc('0x26')](respondWithResult(_0x3a7807,null))[_0xeabc('0x47')](handleError(_0x3a7807,null));};exports['create']=function(_0x766743,_0x32e09b){return db[_0xeabc('0x31')][_0xeabc('0x48')](_0x766743[_0xeabc('0x49')],{})['then'](function(_0x305946){var _0x2b2b9c=_0x766743[_0xeabc('0x4a')][_0xeabc('0x27')]({'plain':!![]});if(!_0x2b2b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2b9c[_0xeabc('0x4b')]===_0xeabc('0x4a')){var _0x568847=_0x305946[_0xeabc('0x27')]({'plain':!![]});var _0x5a0d4d=_0xeabc('0x4c');return db['UserProfileSection'][_0xeabc('0x46')]({'where':{'name':_0x5a0d4d,'userProfileId':_0x2b2b9c[_0xeabc('0x4d')]},'raw':!![]})[_0xeabc('0x26')](function(_0x1524c3){if(_0x1524c3&&_0x1524c3[_0xeabc('0x4e')]===0x0){return db[_0xeabc('0x29')][_0xeabc('0x48')]({'name':_0x568847[_0xeabc('0x2d')],'resourceId':_0x568847['id'],'type':_0xeabc('0x28'),'sectionId':_0x1524c3['id']},{})[_0xeabc('0x26')](function(){return _0x305946;});}else{return _0x305946;}})['catch'](function(_0x180a14){logger[_0xeabc('0x2b')](_0xeabc('0x4f'),_0x180a14);throw _0x180a14;});}return _0x305946;})[_0xeabc('0x26')](respondWithResult(_0x32e09b,0xc9))['catch'](handleError(_0x32e09b,null));};exports[_0xeabc('0x25')]=function(_0x392913,_0x10d56f){if(_0x392913[_0xeabc('0x49')]['id']){delete _0x392913['body']['id'];}return db[_0xeabc('0x31')][_0xeabc('0x46')]({'where':{'id':_0x392913[_0xeabc('0x50')]['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x10d56f,null))[_0xeabc('0x26')](saveUpdates(_0x392913[_0xeabc('0x49')],null))[_0xeabc('0x26')](respondWithResult(_0x10d56f,null))[_0xeabc('0x47')](handleError(_0x10d56f,null));};exports[_0xeabc('0x2a')]=function(_0x58ab08,_0x4546c4){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x58ab08['params']['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x4546c4,null))[_0xeabc('0x26')](removeEntity(_0x4546c4,null))[_0xeabc('0x47')](handleError(_0x4546c4,null));};exports[_0xeabc('0x51')]=function(_0xe89728,_0x2f78f3){var _0x4a2ad6=0xa;var _0x4358d7=[_0xeabc('0x52'),_0xeabc('0x53'),_0xeabc('0x54'),_0xeabc('0x55')];var _0x2c7b4e={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x536f42={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x26c784=function(_0xc2ef0c){return!_['includes']([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0xc2ef0c);};var _0x11cc1f=function(_0x514787){if(!_0x514787||!_0x514787['rules'][_0xeabc('0x3c')]){return'';}for(var _0x7b659f='(',_0x1b6675=0x0;_0x1b6675<_0x514787[_0xeabc('0x64')][_0xeabc('0x3c')];_0x1b6675+=0x1){_0x1b6675>0x0&&(_0x7b659f+='\x20'+_0x514787[_0xeabc('0x65')]+'\x20');_0x7b659f+=_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x66')]?_0x11cc1f(_0x514787[_0xeabc('0x64')][_0x1b6675]['group']):_0x514787[_0xeabc('0x64')][_0x1b6675]['field']+'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')]+(_0x26c784(_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')])?'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x68')]:'');}return _0x7b659f+')';};var _0xf48062={'where':{'id':_0xe89728[_0xeabc('0x50')]['id']}},_0xb59a2a,_0x5d4bc2,_0x24d0e5,_0x5702cb,_0x3fa31b;_0xf48062=_[_0xeabc('0x40')]({},_0xf48062,_0xe89728[_0xeabc('0x45')]);return db['AnalyticDefaultReport'][_0xeabc('0x46')](_0xf48062)['then'](function(_0x54e7d6){if(_0x54e7d6){_0xb59a2a=_0x54e7d6;return _0x54e7d6[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x23270a){if(_0x23270a){if(!_0x23270a[_0xeabc('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xeabc('0x6a'),0x193);}_0x5d4bc2=_0x23270a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xeabc('0x26')](function(_0x4f1a4f){if(_0x4f1a4f){_0x24d0e5=_['keyBy'](_0x4f1a4f,'id');var _0xa44f2d;var _0x1c84b5=squel['select']();_0x1c84b5['from'](_0xb59a2a[_0xeabc('0x6b')]);for(var _0x5d183a=0x0;_0x5d183a<_0x5d4bc2[_0xeabc('0x3c')];_0x5d183a+=0x1){_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6c')]?_0x24d0e5[_0x5d4bc2[_0x5d183a]['MetricId']]['metric']:_0x5d4bc2[_0x5d183a][_0xeabc('0x6d')];_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x2c7b4e[_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]],'%s',_0xa44f2d):_0xa44f2d;_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x70')]?_['replace'](_0x536f42[_0x5d4bc2[_0x5d183a]['format']],'%s',_0xa44f2d):_0xa44f2d;if(_0x5d4bc2[_0x5d183a][_0xeabc('0x71')]){_0x1c84b5['group'](_0xa44f2d);}_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]&&_0x1c84b5['order'](_0xa44f2d,_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]==='DESC'?![]:!![]);_0x1c84b5[_0xeabc('0x6d')](_0xa44f2d,_0x5d4bc2[_0x5d183a]['alias']||_0xa44f2d);}if(_0xb59a2a[_0xeabc('0x73')]){_0xb59a2a[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x73')]);for(var _0x5e121c=0x0;_0x5e121c<_0xb59a2a[_0xeabc('0x73')]['length'];_0x5e121c+=0x1){if(_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x4358d7,_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')])&&_0xb59a2a['joins'][_0x5e121c][_0xeabc('0x76')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']){_0x1c84b5[_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]](_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')],null,util['format'](_0xeabc('0x78'),_0xb59a2a[_0xeabc('0x6b')],_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x76')],_0xb59a2a['joins'][_0x5e121c]['foreignTable'],_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']));}}}if(_0xb59a2a['conditions']){_0xb59a2a[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x79')]);_0x1c84b5['where'](_0x11cc1f(_0xb59a2a[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3fa31b=_0x1c84b5['clone']();_0x1c84b5[_0xeabc('0x1e')](_0x4a2ad6);_0x1c84b5[_0xeabc('0x1d')](0x0);logger[_0xeabc('0x7a')](_0xeabc('0x7b'),_0x1c84b5[_0xeabc('0x7c')]());return dbH['sequelize'][_0xeabc('0x36')](_0x1c84b5['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](respondWithResult(_0x2f78f3,null))[_0xeabc('0x47')](handleError(_0x2f78f3,null));};function runReport(_0x4424ce,_0x33fa74,_0x51368f){var _0x39f961=_0x33fa74['name'];var _0x1795fe=0xa;var _0x2f95c7=['join',_0xeabc('0x53'),'right_join','cross_join'];var _0x952dc7={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':'MIN(%s)','AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x348064={'SEC_TO_TIME':_0xeabc('0x81'),'DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x522c6e=function(_0x436f8e){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeabc('0x63')],_0x436f8e);};var _0x273ca5=function(_0xe90200){if(!_0xe90200||!_0xe90200[_0xeabc('0x64')][_0xeabc('0x3c')]){return'';}for(var _0x5f5a47='(',_0x289f98=0x0;_0x289f98<_0xe90200['rules']['length'];_0x289f98+=0x1){_0x289f98>0x0&&(_0x5f5a47+='\x20'+_0xe90200[_0xeabc('0x65')]+'\x20');_0x5f5a47+=_0xe90200[_0xeabc('0x64')][_0x289f98]['group']?_0x273ca5(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x66')]):_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x6d')]+'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')]+(_0x522c6e(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')])?'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x68')]:'');}return _0x5f5a47+')';};var _0x1f8197={'where':{'id':_0x4424ce['id']}},_0x485c13,_0xb54c35,_0x5c9d6f,_0x1caaa7,_0x3e764a;_0x1f8197=_[_0xeabc('0x40')]({},_0x1f8197,_0x51368f);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x1f8197)[_0xeabc('0x26')](function(_0x40f51e){if(_0x40f51e){_0x485c13=_0x40f51e;return _0x40f51e[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x156e20){if(_0x156e20){if(!_0x156e20[_0xeabc('0x3c')]){throw new db['Sequelize'][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0xb54c35=_0x156e20;return db[_0xeabc('0x83')][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x26c595){if(_0x26c595){_0x5c9d6f=_[_0xeabc('0x84')](_0x26c595,'id');var _0x580661;var _0x3de927=squel[_0xeabc('0x85')]();_0x3de927['from'](_0x485c13['table']);for(var _0x489b1d=0x0;_0x489b1d<_0xb54c35['length'];_0x489b1d+=0x1){_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6c')]?_0x5c9d6f[_0xb54c35[_0x489b1d][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0xb54c35[_0x489b1d][_0xeabc('0x6d')];_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x952dc7[_0xb54c35[_0x489b1d][_0xeabc('0x6e')]],'%s',_0x580661):_0x580661;_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x348064[_0xb54c35[_0x489b1d][_0xeabc('0x70')]],'%s',_0x580661):_0x580661;if(_0xb54c35[_0x489b1d]['groupBy']){_0x3de927[_0xeabc('0x66')](_0x580661);}_0xb54c35[_0x489b1d][_0xeabc('0x72')]&&_0x3de927['order'](_0x580661,_0xb54c35[_0x489b1d][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x3de927[_0xeabc('0x6d')](_0x580661,_0xb54c35[_0x489b1d]['alias']||_0x580661);}if(_0x485c13[_0xeabc('0x73')]){_0x485c13['joins']=JSON[_0xeabc('0x74')](_0x485c13[_0xeabc('0x73')]);for(var _0x1841f0=0x0;_0x1841f0<_0x485c13[_0xeabc('0x73')][_0xeabc('0x3c')];_0x1841f0+=0x1){if(_0x485c13['joins'][_0x1841f0]['type']&&_['includes'](_0x2f95c7,_0x485c13['joins'][_0x1841f0][_0xeabc('0x33')])&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')]&&_0x485c13['joins'][_0x1841f0][_0xeabc('0x77')]&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x88')]){_0x3de927[_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x33')]](_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x77')],null,util[_0xeabc('0x70')](_0xeabc('0x78'),_0x485c13[_0xeabc('0x6b')],_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')],_0x485c13['joins'][_0x1841f0]['foreignTable'],_0x485c13[_0xeabc('0x73')][_0x1841f0]['foreignKey']));}}}if(_0x485c13[_0xeabc('0x79')]){_0x485c13[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x485c13['conditions']);_0x3de927[_0xeabc('0x41')](_0x273ca5(_0x485c13[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3e764a=_0x3de927['clone']();_0x3de927['limit'](_0x1795fe);_0x3de927[_0xeabc('0x1d')](0x0);return;}})[_0xeabc('0x26')](function(){if(_0x33fa74[_0xeabc('0x89')]===_0xeabc('0x8a')){return null;}var _0x2cc9b3=_[_0xeabc('0x40')](_0x33fa74,{'name':_0x33fa74['fullPath']||_0x33fa74['name']||_0x485c13[_0xeabc('0x2d')],'basename':_0x39f961,'savename':util[_0xeabc('0x70')](_0xeabc('0x8b'),_0x33fa74[_0xeabc('0x2d')]||_0x485c13['name'],require('randomstring')['generate'](0x4),_0x33fa74[_0xeabc('0x89')]||'csv'),'reportId':_0x485c13['id'],'reportType':_0xeabc('0x8c')});return db['AnalyticExtractedReport'][_0xeabc('0x48')](_0x2cc9b3,{'raw':!![]});})['then'](function(_0x6e6ab2){if(_0x485c13[_0xeabc('0x6b')]===_0xeabc('0x8d')){_0x3e764a[_0xeabc('0x41')](_0x485c13[_0xeabc('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}else{_0x3e764a[_0xeabc('0x41')](_0x485c13['table']+_0xeabc('0x90'),_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}if(_0x6e6ab2){logger[_0xeabc('0x91')](_0xeabc('0x92'),_0x3e764a['toString']());require(_0xeabc('0x93'))[_0xeabc('0x94')](path['join'](__dirname,_0xeabc('0x95'),_0x6e6ab2[_0xeabc('0x89')]),[_0x6e6ab2['id'],_0x3e764a['toString'](),path[_0xeabc('0x52')](__dirname,_0xeabc('0x96'),_0x6e6ab2[_0xeabc('0x97')]),_0x39f961]);return _0x6e6ab2;}else{var _0x307d26=squel[_0xeabc('0x85')]();_0x307d26[_0xeabc('0x98')]('('+_0x3e764a[_0xeabc('0x7c')]()+')',_0xeabc('0x99'));_0x307d26[_0xeabc('0x6d')](_0xeabc('0x9a'),_0xeabc('0x20'));_0x3e764a[_0xeabc('0x1e')](_0x33fa74[_0xeabc('0x1e')]||_0x1795fe);_0x3e764a['offset'](_0x33fa74['offset']||0x0);return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x307d26[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')]['QueryTypes'][_0xeabc('0x7d')]})['then'](function(_0x49fba2){if(!_0x49fba2['length']){_0x1caaa7=0x0;}else{_0x1caaa7=_0x49fba2[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3e764a[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});})[_0xeabc('0x26')](function(_0xe27492){return{'rows':_0xe27492||[],'count':_0x1caaa7};});}});}exports[_0xeabc('0x9d')]=function(_0x3eaedf,_0x44dc85){return runReport(_0x3eaedf['params'],_0x3eaedf[_0xeabc('0x36')],_0x3eaedf[_0xeabc('0x45')])[_0xeabc('0x26')](respondWithResult(_0x44dc85,null))[_0xeabc('0x47')](handleError(_0x44dc85,null));};exports[_0xeabc('0x9e')]=runReport;exports[_0xeabc('0x36')]=function(_0x2a29d7,_0x5bb5d6){var _0x3513ce=0xa;var _0x58cb5d=[_0xeabc('0x52'),_0xeabc('0x53'),'right_join',_0xeabc('0x55')];var _0x4c8bf3={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x484c75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x580f72=function(_0x37907a){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0x37907a);};var _0x57db6d=function(_0x13cc55){if(!_0x13cc55||!_0x13cc55['rules'][_0xeabc('0x3c')]){return'';}for(var _0x43b88e='(',_0x1fa464=0x0;_0x1fa464<_0x13cc55[_0xeabc('0x64')]['length'];_0x1fa464+=0x1){_0x1fa464>0x0&&(_0x43b88e+='\x20'+_0x13cc55[_0xeabc('0x65')]+'\x20');_0x43b88e+=_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x66')]?_0x57db6d(_0x13cc55['rules'][_0x1fa464][_0xeabc('0x66')]):_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x6d')]+'\x20'+_0x13cc55['rules'][_0x1fa464]['condition']+(_0x580f72(_0x13cc55['rules'][_0x1fa464]['condition'])?'\x20'+_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x68')]:'');}return _0x43b88e+')';};var _0x52e84f={'where':{'id':_0x2a29d7[_0xeabc('0x50')]['id']}},_0x12f024,_0x1d35da,_0x2695a4,_0x199251,_0x1899d6;_0x52e84f=_[_0xeabc('0x40')]({},_0x52e84f,_0x2a29d7[_0xeabc('0x45')]);return db[_0xeabc('0x31')]['find'](_0x52e84f)[_0xeabc('0x26')](function(_0x5bb015){if(_0x5bb015){_0x12f024=_0x5bb015;return _0x5bb015[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x438ce3){if(_0x438ce3){if(!_0x438ce3[_0xeabc('0x3c')]){throw new db[(_0xeabc('0x9f'))][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0x1d35da=_0x438ce3;return db['AnalyticMetric'][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x475160){if(_0x475160){_0x2695a4=_['keyBy'](_0x475160,'id');var _0x10d66b;var _0x12a042=squel[_0xeabc('0x85')]();_0x12a042[_0xeabc('0x98')](_0x12f024[_0xeabc('0x6b')]);for(var _0x49bf0f=0x0;_0x49bf0f<_0x1d35da[_0xeabc('0x3c')];_0x49bf0f+=0x1){_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]?_0x2695a4[_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0x1d35da[_0x49bf0f][_0xeabc('0x6d')];_0x10d66b=_0x1d35da[_0x49bf0f]['function']?_[_0xeabc('0x6f')](_0x4c8bf3[_0x1d35da[_0x49bf0f][_0xeabc('0x6e')]],'%s',_0x10d66b):_0x10d66b;_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x484c75[_0x1d35da[_0x49bf0f][_0xeabc('0x70')]],'%s',_0x10d66b):_0x10d66b;if(_0x1d35da[_0x49bf0f]['groupBy']){_0x12a042[_0xeabc('0x66')](_0x10d66b);}_0x1d35da[_0x49bf0f]['orderBy']&&_0x12a042[_0xeabc('0x3e')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x12a042[_0xeabc('0x6d')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0xa0')]||_0x10d66b);}if(_0x12f024[_0xeabc('0x73')]){_0x12f024[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x73')]);for(var _0x223a3=0x0;_0x223a3<_0x12f024['joins'][_0xeabc('0x3c')];_0x223a3+=0x1){if(_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x58cb5d,_0x12f024['joins'][_0x223a3][_0xeabc('0x33')])&&_0x12f024['joins'][_0x223a3]['parentKey']&&_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')]&&_0x12f024[_0xeabc('0x73')][_0x223a3]['foreignKey']){_0x12a042[_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]](_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')],null,util[_0xeabc('0x70')]('%s.%s\x20=\x20%s.%s',_0x12f024[_0xeabc('0x6b')],_0x12f024[_0xeabc('0x73')][_0x223a3]['parentKey'],_0x12f024['joins'][_0x223a3][_0xeabc('0x77')],_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x88')]));}}}if(_0x12f024[_0xeabc('0x79')]){_0x12f024[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x79')]);_0x12a042[_0xeabc('0x41')](_0x57db6d(_0x12f024[_0xeabc('0x79')]['group']));}_0x1899d6=_0x12a042[_0xeabc('0xa1')]();_0x12a042['limit'](_0x3513ce);_0x12a042[_0xeabc('0x1d')](0x0);logger['debug'](_0xeabc('0x7b'),_0x12a042[_0xeabc('0x7c')]());return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x12a042[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](function(){return{'sql':_0x1899d6[_0xeabc('0x7c')]()};})['then'](respondWithResult(_0x5bb5d6,null))['catch'](handleError(_0x5bb5d6,null));}; \ No newline at end of file +var _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x4acdd0,_0x4d1f59){var _0x392ba5=function(_0x30cab7){while(--_0x30cab7){_0x4acdd0['push'](_0x4acdd0['shift']());}};_0x392ba5(++_0x4d1f59);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xc4aa[_0x565ed7];return _0x183ad7;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index fec1947..9cb50a7 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 _0x1c00=['define','analytics_default_reports','lodash','util','api','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0x35fa7a,_0x25f079){var _0x1d0cb0=function(_0x5c7047){while(--_0x5c7047){_0x35fa7a['push'](_0x35fa7a['shift']());}};_0x1d0cb0(++_0x25f079);}(_0x1c00,0x1a6));var _0x01c0=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x1c00[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x01c0('0x0'));var util=require(_0x01c0('0x1'));var logger=require('../../config/logger')(_0x01c0('0x2'));var moment=require(_0x01c0('0x3'));var BPromise=require(_0x01c0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x01c0('0x5'));var config=require(_0x01c0('0x6'));var attributes=require('./analyticDefaultReport.attributes');module[_0x01c0('0x7')]=function(_0x5353e3,_0xe98ddb){return _0x5353e3[_0x01c0('0x8')]('AnalyticDefaultReport',attributes,{'tableName':_0x01c0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa03=['api','moment','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','analytics_default_reports','lodash','util','../../config/logger'];(function(_0x113c32,_0x555a00){var _0x1e50c0=function(_0x440a25){while(--_0x440a25){_0x113c32['push'](_0x113c32['shift']());}};_0x1e50c0(++_0x555a00);}(_0xfa03,0x111));var _0x3fa0=function(_0x15162b,_0x341587){_0x15162b=_0x15162b-0x0;var _0x147c6b=_0xfa03[_0x15162b];return _0x147c6b;};'use strict';var _=require(_0x3fa0('0x0'));var util=require(_0x3fa0('0x1'));var logger=require(_0x3fa0('0x2'))(_0x3fa0('0x3'));var moment=require(_0x3fa0('0x4'));var BPromise=require('bluebird');var rp=require(_0x3fa0('0x5'));var fs=require('fs');var path=require(_0x3fa0('0x6'));var rimraf=require(_0x3fa0('0x7'));var config=require(_0x3fa0('0x8'));var attributes=require(_0x3fa0('0x9'));module[_0x3fa0('0xa')]=function(_0x593006,_0x4d3ee9){return _0x593006['define']('AnalyticDefaultReport',attributes,{'tableName':_0x3fa0('0xb'),'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 600c265..2bf8d6d 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 _0xaa4b=['error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0x4efd61,_0x592cc1){var _0x572f78=function(_0x344d56){while(--_0x344d56){_0x4efd61['push'](_0x4efd61['shift']());}};_0x572f78(++_0x592cc1);}(_0xaa4b,0x1df));var _0xbaa4=function(_0x314312,_0x31a84e){_0x314312=_0x314312-0x0;var _0x8bb27e=_0xaa4b[_0x314312];return _0x8bb27e;};'use strict';var _=require(_0xbaa4('0x0'));var util=require(_0xbaa4('0x1'));var moment=require(_0xbaa4('0x2'));var BPromise=require('bluebird');var rs=require(_0xbaa4('0x3'));var fs=require('fs');var Redis=require(_0xbaa4('0x4'));var db=require(_0xbaa4('0x5'))['db'];var utils=require(_0xbaa4('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbaa4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcf41e6,_0x1aa625,_0x414f7c){return new BPromise(function(_0x1404af,_0x48fbc7){return client[_0xbaa4('0x8')](_0xcf41e6,_0x414f7c)[_0xbaa4('0x9')](function(_0x2f7dc8){logger[_0xbaa4('0xa')](_0xbaa4('0xb'),_0x1aa625,_0xbaa4('0xc'));logger[_0xbaa4('0xd')](_0xbaa4('0xe'),_0x1aa625,_0xbaa4('0xc'),JSON['stringify'](_0x2f7dc8));if(_0x2f7dc8[_0xbaa4('0xf')]){if(_0x2f7dc8[_0xbaa4('0xf')]['code']===0x1f4){logger[_0xbaa4('0xf')](_0xbaa4('0xb'),_0x1aa625,_0x2f7dc8[_0xbaa4('0xf')][_0xbaa4('0x10')]);return _0x48fbc7(_0x2f7dc8['error'][_0xbaa4('0x10')]);}logger['error'](_0xbaa4('0xb'),_0x1aa625,_0x2f7dc8[_0xbaa4('0xf')]['message']);return _0x1404af(_0x2f7dc8[_0xbaa4('0xf')][_0xbaa4('0x10')]);}else{logger[_0xbaa4('0xa')](_0xbaa4('0xb'),_0x1aa625,_0xbaa4('0xc'));_0x1404af(_0x2f7dc8[_0xbaa4('0x11')][_0xbaa4('0x10')]);}})[_0xbaa4('0x12')](function(_0x25d0b6){logger[_0xbaa4('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1aa625,_0x25d0b6);_0x48fbc7(_0x25d0b6);});});} \ No newline at end of file +var _0x73f9=['message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','then','info','request\x20sent','debug','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x29a20c,_0x37a6c3){var _0x1fe64e=function(_0x2da12e){while(--_0x2da12e){_0x29a20c['push'](_0x29a20c['shift']());}};_0x1fe64e(++_0x37a6c3);}(_0x73f9,0x1f1));var _0x973f=function(_0x249ab1,_0xb48e57){_0x249ab1=_0x249ab1-0x0;var _0x5a9ed2=_0x73f9[_0x249ab1];return _0x5a9ed2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x973f('0x0'));var BPromise=require('bluebird');var rs=require(_0x973f('0x1'));var fs=require('fs');var Redis=require(_0x973f('0x2'));var db=require(_0x973f('0x3'))['db'];var utils=require(_0x973f('0x4'));var logger=require('../../config/logger')(_0x973f('0x5'));var config=require(_0x973f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x973f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe757ec,_0x301ef8,_0x33515b){return new BPromise(function(_0x25696b,_0x3dd9fe){return client['request'](_0xe757ec,_0x33515b)[_0x973f('0x8')](function(_0x807288){logger[_0x973f('0x9')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x301ef8,_0x973f('0xa'));logger[_0x973f('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x301ef8,'request\x20sent',JSON[_0x973f('0xc')](_0x807288));if(_0x807288[_0x973f('0xd')]){if(_0x807288['error'][_0x973f('0xe')]===0x1f4){logger[_0x973f('0xd')](_0x973f('0xf'),_0x301ef8,_0x807288[_0x973f('0xd')][_0x973f('0x10')]);return _0x3dd9fe(_0x807288[_0x973f('0xd')][_0x973f('0x10')]);}logger[_0x973f('0xd')](_0x973f('0xf'),_0x301ef8,_0x807288[_0x973f('0xd')][_0x973f('0x10')]);return _0x25696b(_0x807288[_0x973f('0xd')][_0x973f('0x10')]);}else{logger['info'](_0x973f('0xf'),_0x301ef8,'request\x20sent');_0x25696b(_0x807288[_0x973f('0x11')][_0x973f('0x10')]);}})[_0x973f('0x12')](function(_0x4a084a){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x301ef8,_0x4a084a);_0x3dd9fe(_0x4a084a);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 099a1a7..0bd4c5d 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 _0x8d5d=['post','create','put','/:id','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','get','query'];(function(_0x57290a,_0x352aa7){var _0x39654b=function(_0x2e7b6b){while(--_0x2e7b6b){_0x57290a['push'](_0x57290a['shift']());}};_0x39654b(++_0x352aa7);}(_0x8d5d,0x10e));var _0xd8d5=function(_0x59ea00,_0x3c6b18){_0x59ea00=_0x59ea00-0x0;var _0x32bc55=_0x8d5d[_0x59ea00];return _0x32bc55;};'use strict';var multer=require(_0xd8d5('0x0'));var util=require(_0xd8d5('0x1'));var path=require(_0xd8d5('0x2'));var timeout=require(_0xd8d5('0x3'));var express=require('express');var router=express[_0xd8d5('0x4')]();var fs_extra=require(_0xd8d5('0x5'));var auth=require(_0xd8d5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd8d5('0x7'));var controller=require(_0xd8d5('0x8'));router['get']('/',auth[_0xd8d5('0x9')](),controller[_0xd8d5('0xa')]);router['get']('/:id',auth[_0xd8d5('0x9')](),controller[_0xd8d5('0xb')]);router['get'](_0xd8d5('0xc'),auth[_0xd8d5('0x9')](),controller[_0xd8d5('0xd')]);router['get'](_0xd8d5('0xe'),auth['isAuthenticated'](),controller[_0xd8d5('0xf')]);router[_0xd8d5('0x10')]('/:id/query',auth[_0xd8d5('0x9')](),controller[_0xd8d5('0x11')]);router[_0xd8d5('0x12')]('/',auth[_0xd8d5('0x9')](),controller[_0xd8d5('0x13')]);router[_0xd8d5('0x14')](_0xd8d5('0x15'),auth[_0xd8d5('0x9')](),controller[_0xd8d5('0x16')]);router[_0xd8d5('0x17')](_0xd8d5('0x15'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8b33=['index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated'];(function(_0x278bbb,_0x546e2f){var _0x444877=function(_0x399547){while(--_0x399547){_0x278bbb['push'](_0x278bbb['shift']());}};_0x444877(++_0x546e2f);}(_0x8b33,0x12e));var _0x38b3=function(_0x293e4c,_0x138c21){_0x293e4c=_0x293e4c-0x0;var _0x51099d=_0x8b33[_0x293e4c];return _0x51099d;};'use strict';var multer=require(_0x38b3('0x0'));var util=require(_0x38b3('0x1'));var path=require(_0x38b3('0x2'));var timeout=require('connect-timeout');var express=require(_0x38b3('0x3'));var router=express['Router']();var fs_extra=require(_0x38b3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x38b3('0x5'));var config=require(_0x38b3('0x6'));var controller=require(_0x38b3('0x7'));router[_0x38b3('0x8')]('/',auth[_0x38b3('0x9')](),controller[_0x38b3('0xa')]);router['get'](_0x38b3('0xb'),auth[_0x38b3('0x9')](),controller[_0x38b3('0xc')]);router['get'](_0x38b3('0xd'),auth[_0x38b3('0x9')](),controller[_0x38b3('0xe')]);router[_0x38b3('0x8')](_0x38b3('0xf'),auth[_0x38b3('0x9')](),controller[_0x38b3('0x10')]);router[_0x38b3('0x8')](_0x38b3('0x11'),auth[_0x38b3('0x9')](),controller[_0x38b3('0x12')]);router[_0x38b3('0x13')]('/',auth[_0x38b3('0x9')](),controller[_0x38b3('0x14')]);router[_0x38b3('0x15')]('/:id',auth[_0x38b3('0x9')](),controller[_0x38b3('0x16')]);router[_0x38b3('0x17')](_0x38b3('0xb'),auth[_0x38b3('0x9')](),controller[_0x38b3('0x18')]);module[_0x38b3('0x19')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 38f1169..8c5afc8 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 _0x9738=['UNSIGNED','sequelize','exports','STRING','ENUM','pdf','xlsx','csv','DATE','manual','scheduled'];(function(_0x2b5736,_0x31be75){var _0x3ef270=function(_0x519e8a){while(--_0x519e8a){_0x2b5736['push'](_0x2b5736['shift']());}};_0x3ef270(++_0x31be75);}(_0x9738,0x11f));var _0x8973=function(_0x4272e6,_0x2010bb){_0x4272e6=_0x4272e6-0x0;var _0x4b518b=_0x9738[_0x4272e6];return _0x4b518b;};'use strict';var Sequelize=require(_0x8973('0x0'));var moment=require('moment');module[_0x8973('0x1')]={'name':{'type':Sequelize[_0x8973('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x8973('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x8973('0x3')]('csv',_0x8973('0x4'),_0x8973('0x5')),'allowNull':![],'defaultValue':_0x8973('0x6')},'savename':{'type':Sequelize[_0x8973('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8973('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x8973('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x8973('0x3')](_0x8973('0x8'),_0x8973('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x8973('0xa')]},'reportType':{'type':Sequelize[_0x8973('0x2')]}}; \ No newline at end of file +var _0xed65=['xlsx','DATE','Loading','manual','scheduled','INTEGER','exports','STRING','ENUM','csv','pdf'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xed65,0x1ea));var _0x5ed6=function(_0x2e50a2,_0x27f31e){_0x2e50a2=_0x2e50a2-0x0;var _0x47e5de=_0xed65[_0x2e50a2];return _0x47e5de;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x5ed6('0x0')]={'name':{'type':Sequelize[_0x5ed6('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x5ed6('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x5ed6('0x2')](_0x5ed6('0x3'),_0x5ed6('0x4'),_0x5ed6('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x5ed6('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x5ed6('0x6')]},'endDate':{'type':Sequelize[_0x5ed6('0x6')]},'status':{'type':Sequelize[_0x5ed6('0x1')],'defaultValue':_0x5ed6('0x7')},'type':{'type':Sequelize['ENUM'](_0x5ed6('0x8'),_0x5ed6('0x9')),'allowNull':![],'defaultValue':_0x5ed6('0x8')},'reportId':{'type':Sequelize[_0x5ed6('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x5ed6('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 5b3a053..f60d0de 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 _0xc35b=['end','json','undefined','count','offset','Content-Range','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','stack','send','map','rawAttributes','type','key','name','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filters','filter','where','merge','VIRTUAL','options','AnalyticExtractedReport','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x2d1c7c,_0x2c6379){var _0x53fcae=function(_0x97594c){while(--_0x97594c){_0x2d1c7c['push'](_0x2d1c7c['shift']());}};_0x53fcae(++_0x2c6379);}(_0xc35b,0x1b0));var _0xbc35=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0xc35b[_0x59c301];return _0x3866b9;};'use strict';var emlformat=require(_0xbc35('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbc35('0x1'));var jsonpatch=require(_0xbc35('0x2'));var rp=require(_0xbc35('0x3'));var moment=require(_0xbc35('0x4'));var BPromise=require(_0xbc35('0x5'));var Mustache=require(_0xbc35('0x6'));var util=require(_0xbc35('0x7'));var path=require('path');var sox=require(_0xbc35('0x8'));var csv=require(_0xbc35('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbc35('0xa'));var _=require('lodash');var squel=require(_0xbc35('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbc35('0xc'));var toCsv=require('to-csv');var querystring=require(_0xbc35('0xd'));var Papa=require(_0xbc35('0xe'));var Redis=require(_0xbc35('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbc35('0x10'))(_0xbc35('0x11'));var utils=require(_0xbc35('0x12'));var config=require(_0xbc35('0x13'));var licenseUtil=require(_0xbc35('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x598533,_0x4fac5a){_0x4fac5a=_0x4fac5a||0xcc;return function(_0x168317){if(_0x168317){return _0x598533[_0xbc35('0x15')](_0x4fac5a);}return _0x598533[_0xbc35('0x16')](_0x4fac5a)[_0xbc35('0x17')]();};}function respondWithResult(_0x8fd0,_0x5cff7d){_0x5cff7d=_0x5cff7d||0xc8;return function(_0x208eb3){if(_0x208eb3){return _0x8fd0[_0xbc35('0x16')](_0x5cff7d)[_0xbc35('0x18')](_0x208eb3);}};}function respondWithFilteredResult(_0x1ed563,_0xbbcfe4){return function(_0x54e8d5){if(_0x54e8d5){var _0x498fd5=typeof _0xbbcfe4['offset']==='undefined'&&typeof _0xbbcfe4['limit']===_0xbc35('0x19');var _0x13d210=_0x54e8d5['count'];var _0x628c5f=_0x498fd5?0x0:_0xbbcfe4['offset'];var _0x1c6682=_0x498fd5?_0x54e8d5[_0xbc35('0x1a')]:_0xbbcfe4[_0xbc35('0x1b')]+_0xbbcfe4['limit'];var _0x5d4b00;if(_0x1c6682>=_0x13d210){_0x1c6682=_0x13d210;_0x5d4b00=0xc8;}else{_0x5d4b00=0xce;}_0x1ed563[_0xbc35('0x16')](_0x5d4b00);return _0x1ed563['set'](_0xbc35('0x1c'),_0x628c5f+'-'+_0x1c6682+'/'+_0x13d210)[_0xbc35('0x18')](_0x54e8d5);}return null;};}function patchUpdates(_0x3f2fad){return function(_0x487406){try{jsonpatch['apply'](_0x487406,_0x3f2fad,!![]);}catch(_0x4821a3){return BPromise[_0xbc35('0x1d')](_0x4821a3);}return _0x487406[_0xbc35('0x1e')]();};}function saveUpdates(_0x4884ae,_0x4f0b5c){return function(_0x58f94e){if(_0x58f94e){return _0x58f94e[_0xbc35('0x1f')](_0x4884ae)[_0xbc35('0x20')](function(_0x11996d){return _0x11996d;});}return null;};}function removeEntity(_0x3158ad,_0x50500e){return function(_0x2abca5){if(_0x2abca5){return _0x2abca5[_0xbc35('0x21')]()[_0xbc35('0x20')](function(){var _0x3c724d=_0x2abca5[_0xbc35('0x22')]({'plain':!![]});var _0x3e867c=_0xbc35('0x23');return db[_0xbc35('0x24')]['destroy']({'where':{'type':_0x3e867c,'resourceId':_0x3c724d['id']}})[_0xbc35('0x20')](function(){return _0x2abca5;});})[_0xbc35('0x20')](function(){_0x3158ad[_0xbc35('0x16')](0xcc)[_0xbc35('0x17')]();});}};}function handleEntityNotFound(_0x6e30bb,_0x40ae03){return function(_0x3e063b){if(!_0x3e063b){_0x6e30bb[_0xbc35('0x15')](0x194);}return _0x3e063b;};}function handleError(_0xfe7805,_0x131447){_0x131447=_0x131447||0x1f4;return function(_0x23f3f9){logger['error'](_0x23f3f9[_0xbc35('0x25')]);if(_0x23f3f9['name']){delete _0x23f3f9['name'];}_0xfe7805[_0xbc35('0x16')](_0x131447)[_0xbc35('0x26')](_0x23f3f9);};}exports['index']=function(_0x1071ed,_0x30eed2){var _0x105f21={},_0xe8fd6a={},_0x489117={'count':0x0,'rows':[]};var _0x2dbaa4=_[_0xbc35('0x27')](db['AnalyticExtractedReport'][_0xbc35('0x28')],function(_0x4d3986){return{'name':_0x4d3986['fieldName'],'type':_0x4d3986[_0xbc35('0x29')][_0xbc35('0x2a')]};});_0xe8fd6a['model']=_['map'](_0x2dbaa4,_0xbc35('0x2b'));_0xe8fd6a[_0xbc35('0x2c')]=_[_0xbc35('0x2d')](_0x1071ed[_0xbc35('0x2c')]);_0xe8fd6a['filters']=_[_0xbc35('0x2e')](_0xe8fd6a[_0xbc35('0x2f')],_0xe8fd6a[_0xbc35('0x2c')]);_0x105f21[_0xbc35('0x30')]=_[_0xbc35('0x2e')](_0xe8fd6a[_0xbc35('0x2f')],qs[_0xbc35('0x31')](_0x1071ed[_0xbc35('0x2c')][_0xbc35('0x31')]));_0x105f21[_0xbc35('0x30')]=_0x105f21[_0xbc35('0x30')]['length']?_0x105f21[_0xbc35('0x30')]:_0xe8fd6a[_0xbc35('0x2f')];if(!_0x1071ed[_0xbc35('0x2c')][_0xbc35('0x32')](_0xbc35('0x33'))){_0x105f21[_0xbc35('0x34')]=qs[_0xbc35('0x34')](_0x1071ed[_0xbc35('0x2c')][_0xbc35('0x34')]);_0x105f21['offset']=qs[_0xbc35('0x1b')](_0x1071ed[_0xbc35('0x2c')][_0xbc35('0x1b')]);}_0x105f21[_0xbc35('0x35')]=qs[_0xbc35('0x36')](_0x1071ed[_0xbc35('0x2c')][_0xbc35('0x36')]);_0x105f21['where']=qs[_0xbc35('0x37')](_['pick'](_0x1071ed[_0xbc35('0x2c')],_0xe8fd6a[_0xbc35('0x37')]),_0x2dbaa4);if(_0x1071ed['query'][_0xbc35('0x38')]){_0x105f21[_0xbc35('0x39')]=_[_0xbc35('0x3a')](_0x105f21[_0xbc35('0x39')],{'$or':_['map'](_0x2dbaa4,function(_0x3feef5){if(_0x3feef5[_0xbc35('0x29')]!==_0xbc35('0x3b')){var _0x2662c7={};_0x2662c7[_0x3feef5['name']]={'$like':'%'+_0x1071ed[_0xbc35('0x2c')][_0xbc35('0x38')]+'%'};return _0x2662c7;}})});}_0x105f21=_[_0xbc35('0x3a')]({},_0x105f21,_0x1071ed[_0xbc35('0x3c')]);var _0x4f45ed={'where':_0x105f21[_0xbc35('0x39')]};return db[_0xbc35('0x3d')][_0xbc35('0x1a')](_0x4f45ed)[_0xbc35('0x20')](function(_0x5da34b){_0x489117[_0xbc35('0x1a')]=_0x5da34b;if(_0x1071ed['query'][_0xbc35('0x3e')]){_0x105f21[_0xbc35('0x3f')]=[{'all':!![]}];}return db[_0xbc35('0x3d')][_0xbc35('0x40')](_0x105f21);})[_0xbc35('0x20')](function(_0x325d3e){_0x489117[_0xbc35('0x41')]=_0x325d3e;return _0x489117;})[_0xbc35('0x20')](respondWithFilteredResult(_0x30eed2,_0x105f21))['catch'](handleError(_0x30eed2,null));};exports[_0xbc35('0x42')]=function(_0x10323f,_0xd529ff){var _0x4bb452={'raw':!![],'where':{'id':_0x10323f[_0xbc35('0x43')]['id']}},_0x558743={};_0x558743[_0xbc35('0x2f')]=_['keys'](db[_0xbc35('0x3d')]['rawAttributes']);_0x558743[_0xbc35('0x2c')]=_[_0xbc35('0x2d')](_0x10323f[_0xbc35('0x2c')]);_0x558743[_0xbc35('0x37')]=_[_0xbc35('0x2e')](_0x558743[_0xbc35('0x2f')],_0x558743['query']);_0x4bb452['attributes']=_[_0xbc35('0x2e')](_0x558743[_0xbc35('0x2f')],qs[_0xbc35('0x31')](_0x10323f['query'][_0xbc35('0x31')]));_0x4bb452[_0xbc35('0x30')]=_0x4bb452[_0xbc35('0x30')][_0xbc35('0x44')]?_0x4bb452[_0xbc35('0x30')]:_0x558743[_0xbc35('0x2f')];if(_0x10323f[_0xbc35('0x2c')]['includeAll']){_0x4bb452[_0xbc35('0x3f')]=[{'all':!![]}];}_0x4bb452=_[_0xbc35('0x3a')]({},_0x4bb452,_0x10323f[_0xbc35('0x3c')]);return db[_0xbc35('0x3d')][_0xbc35('0x45')](_0x4bb452)[_0xbc35('0x20')](handleEntityNotFound(_0xd529ff,null))[_0xbc35('0x20')](respondWithResult(_0xd529ff,null))[_0xbc35('0x46')](handleError(_0xd529ff,null));};exports[_0xbc35('0x47')]=function(_0x42e926,_0x164769){return db[_0xbc35('0x3d')][_0xbc35('0x47')](_0x42e926[_0xbc35('0x48')],{})[_0xbc35('0x20')](function(_0x501f57){var _0x5a12f4=_0x42e926[_0xbc35('0x49')][_0xbc35('0x22')]({'plain':!![]});if(!_0x5a12f4)throw new Error(_0xbc35('0x4a'));if(_0x5a12f4['role']===_0xbc35('0x49')){var _0x1b0907=_0x501f57[_0xbc35('0x22')]({'plain':!![]});var _0xc8eed='ExtractedReports';return db[_0xbc35('0x4b')]['find']({'where':{'name':_0xc8eed,'userProfileId':_0x5a12f4['userProfileId']},'raw':!![]})[_0xbc35('0x20')](function(_0x141147){if(_0x141147&&_0x141147['autoAssociation']===0x0){return db[_0xbc35('0x24')][_0xbc35('0x47')]({'name':_0x1b0907[_0xbc35('0x2b')],'resourceId':_0x1b0907['id'],'type':_0x141147['name'],'sectionId':_0x141147['id']},{})[_0xbc35('0x20')](function(){return _0x501f57;});}else{return _0x501f57;}})[_0xbc35('0x46')](function(_0x1a2a93){logger[_0xbc35('0x4c')](_0xbc35('0x4d'),_0x1a2a93);throw _0x1a2a93;});}return _0x501f57;})['then'](respondWithResult(_0x164769,0xc9))['catch'](handleError(_0x164769,null));};exports[_0xbc35('0x1f')]=function(_0x520d45,_0x253cbc){if(_0x520d45[_0xbc35('0x48')]['id']){delete _0x520d45[_0xbc35('0x48')]['id'];}return db[_0xbc35('0x3d')]['find']({'where':{'id':_0x520d45[_0xbc35('0x43')]['id']}})[_0xbc35('0x20')](handleEntityNotFound(_0x253cbc,null))[_0xbc35('0x20')](saveUpdates(_0x520d45[_0xbc35('0x48')],null))[_0xbc35('0x20')](respondWithResult(_0x253cbc,null))[_0xbc35('0x46')](handleError(_0x253cbc,null));};exports['destroy']=function(_0x16f308,_0x1cd7c8){return db[_0xbc35('0x3d')][_0xbc35('0x45')]({'where':{'id':_0x16f308[_0xbc35('0x43')]['id']}})['then'](handleEntityNotFound(_0x1cd7c8,null))[_0xbc35('0x20')](removeEntity(_0x1cd7c8,null))['catch'](handleError(_0x1cd7c8,null));};exports[_0xbc35('0x4e')]=function(_0x11b970,_0x39e740,_0x3b2d87){return db[_0xbc35('0x3d')]['find']({'where':{'id':_0x11b970['params']['id']},'attributes':[_0xbc35('0x2b'),_0xbc35('0x4f'),_0xbc35('0x50'),_0xbc35('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x39e740,null))['then'](function(_0x2bfc43){if(_0x2bfc43){if(!fs[_0xbc35('0x52')](path[_0xbc35('0x53')](config[_0xbc35('0x54')],_0xbc35('0x55'),_0x2bfc43[_0xbc35('0x50')]))){throw new db['Sequelize'][(_0xbc35('0x56'))](_0xbc35('0x57'));}if(_0x11b970['query'][_0xbc35('0x58')]){return _0x39e740[_0xbc35('0x15')](0xc8);}return _0x39e740[_0xbc35('0x4e')](path[_0xbc35('0x53')](config[_0xbc35('0x54')],_0xbc35('0x55'),_0x2bfc43['savename']),util['format'](_0xbc35('0x59'),_0x2bfc43['basename']||_0x2bfc43[_0xbc35('0x2b')],_0x2bfc43[_0xbc35('0x51')][_0xbc35('0x5a')]()));}})[_0xbc35('0x46')](handleError(_0x39e740,null));}; \ No newline at end of file +var _0x13b7=['ExtractedReports','UserProfileResource','end','stack','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','keys','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','download','basename','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get'];(function(_0x4f2536,_0x1c0a21){var _0x164eb9=function(_0xcb8d76){while(--_0xcb8d76){_0x4f2536['push'](_0x4f2536['shift']());}};_0x164eb9(++_0x1c0a21);}(_0x13b7,0x14b));var _0x713b=function(_0x40c0c6,_0x49f7bb){_0x40c0c6=_0x40c0c6-0x0;var _0x2acfe2=_0x13b7[_0x40c0c6];return _0x2acfe2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x713b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x713b('0x1'));var rp=require(_0x713b('0x2'));var moment=require('moment');var BPromise=require(_0x713b('0x3'));var Mustache=require(_0x713b('0x4'));var util=require(_0x713b('0x5'));var path=require('path');var sox=require(_0x713b('0x6'));var csv=require(_0x713b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x713b('0x8'));var _=require(_0x713b('0x9'));var squel=require(_0x713b('0xa'));var crypto=require(_0x713b('0xb'));var jsforce=require(_0x713b('0xc'));var deskjs=require(_0x713b('0xd'));var toCsv=require(_0x713b('0x7'));var querystring=require('querystring');var Papa=require(_0x713b('0xe'));var Redis=require(_0x713b('0xf'));var authService=require(_0x713b('0x10'));var qs=require(_0x713b('0x11'));var as=require(_0x713b('0x12'));var hardwareService=require(_0x713b('0x13'));var logger=require('../../config/logger')(_0x713b('0x14'));var utils=require('../../config/utils');var config=require(_0x713b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x713b('0x16'))['db'];function respondWithStatusCode(_0x2bd6d0,_0x4c570b){_0x4c570b=_0x4c570b||0xcc;return function(_0x3a6a35){if(_0x3a6a35){return _0x2bd6d0[_0x713b('0x17')](_0x4c570b);}return _0x2bd6d0[_0x713b('0x18')](_0x4c570b)['end']();};}function respondWithResult(_0x1a93b1,_0x26d8a4){_0x26d8a4=_0x26d8a4||0xc8;return function(_0x23351b){if(_0x23351b){return _0x1a93b1['status'](_0x26d8a4)[_0x713b('0x19')](_0x23351b);}};}function respondWithFilteredResult(_0x488a8d,_0x5b55bc){return function(_0x28034e){if(_0x28034e){var _0x28b8b1=typeof _0x5b55bc[_0x713b('0x1a')]===_0x713b('0x1b')&&typeof _0x5b55bc[_0x713b('0x1c')]===_0x713b('0x1b');var _0x59705f=_0x28034e[_0x713b('0x1d')];var _0x56380c=_0x28b8b1?0x0:_0x5b55bc[_0x713b('0x1a')];var _0x37be83=_0x28b8b1?_0x28034e[_0x713b('0x1d')]:_0x5b55bc[_0x713b('0x1a')]+_0x5b55bc[_0x713b('0x1c')];var _0x434fbd;if(_0x37be83>=_0x59705f){_0x37be83=_0x59705f;_0x434fbd=0xc8;}else{_0x434fbd=0xce;}_0x488a8d['status'](_0x434fbd);return _0x488a8d['set'](_0x713b('0x1e'),_0x56380c+'-'+_0x37be83+'/'+_0x59705f)[_0x713b('0x19')](_0x28034e);}return null;};}function patchUpdates(_0x20b360){return function(_0x39ec7c){try{jsonpatch['apply'](_0x39ec7c,_0x20b360,!![]);}catch(_0x389168){return BPromise[_0x713b('0x1f')](_0x389168);}return _0x39ec7c[_0x713b('0x20')]();};}function saveUpdates(_0x3884aa,_0x4be940){return function(_0x72ccf6){if(_0x72ccf6){return _0x72ccf6[_0x713b('0x21')](_0x3884aa)[_0x713b('0x22')](function(_0x585fdb){return _0x585fdb;});}return null;};}function removeEntity(_0x2ef6b2,_0x4dc28a){return function(_0x11ad8e){if(_0x11ad8e){return _0x11ad8e[_0x713b('0x23')]()[_0x713b('0x22')](function(){var _0x346096=_0x11ad8e[_0x713b('0x24')]({'plain':!![]});var _0x42dff3=_0x713b('0x25');return db[_0x713b('0x26')][_0x713b('0x23')]({'where':{'type':_0x42dff3,'resourceId':_0x346096['id']}})[_0x713b('0x22')](function(){return _0x11ad8e;});})['then'](function(){_0x2ef6b2[_0x713b('0x18')](0xcc)[_0x713b('0x27')]();});}};}function handleEntityNotFound(_0x2c9a8e,_0x175a52){return function(_0x1660c2){if(!_0x1660c2){_0x2c9a8e[_0x713b('0x17')](0x194);}return _0x1660c2;};}function handleError(_0x225632,_0x380896){_0x380896=_0x380896||0x1f4;return function(_0x1967a4){logger['error'](_0x1967a4[_0x713b('0x28')]);if(_0x1967a4[_0x713b('0x29')]){delete _0x1967a4['name'];}_0x225632[_0x713b('0x18')](_0x380896)[_0x713b('0x2a')](_0x1967a4);};}exports[_0x713b('0x2b')]=function(_0x101847,_0x23f6b5){var _0x4e7431={},_0x59df8b={},_0x4f7eab={'count':0x0,'rows':[]};var _0x3cea9d=_['map'](db[_0x713b('0x2c')][_0x713b('0x2d')],function(_0x346e3c){return{'name':_0x346e3c[_0x713b('0x2e')],'type':_0x346e3c[_0x713b('0x2f')][_0x713b('0x30')]};});_0x59df8b[_0x713b('0x31')]=_[_0x713b('0x32')](_0x3cea9d,_0x713b('0x29'));_0x59df8b[_0x713b('0x33')]=_['keys'](_0x101847['query']);_0x59df8b['filters']=_[_0x713b('0x34')](_0x59df8b[_0x713b('0x31')],_0x59df8b[_0x713b('0x33')]);_0x4e7431['attributes']=_[_0x713b('0x34')](_0x59df8b[_0x713b('0x31')],qs[_0x713b('0x35')](_0x101847[_0x713b('0x33')][_0x713b('0x35')]));_0x4e7431[_0x713b('0x36')]=_0x4e7431[_0x713b('0x36')][_0x713b('0x37')]?_0x4e7431[_0x713b('0x36')]:_0x59df8b[_0x713b('0x31')];if(!_0x101847[_0x713b('0x33')][_0x713b('0x38')]('nolimit')){_0x4e7431[_0x713b('0x1c')]=qs[_0x713b('0x1c')](_0x101847[_0x713b('0x33')][_0x713b('0x1c')]);_0x4e7431[_0x713b('0x1a')]=qs[_0x713b('0x1a')](_0x101847[_0x713b('0x33')][_0x713b('0x1a')]);}_0x4e7431[_0x713b('0x39')]=qs[_0x713b('0x3a')](_0x101847['query'][_0x713b('0x3a')]);_0x4e7431[_0x713b('0x3b')]=qs[_0x713b('0x3c')](_[_0x713b('0x3d')](_0x101847[_0x713b('0x33')],_0x59df8b[_0x713b('0x3c')]),_0x3cea9d);if(_0x101847[_0x713b('0x33')]['filter']){_0x4e7431['where']=_[_0x713b('0x3e')](_0x4e7431[_0x713b('0x3b')],{'$or':_[_0x713b('0x32')](_0x3cea9d,function(_0xb26fe0){if(_0xb26fe0[_0x713b('0x2f')]!==_0x713b('0x3f')){var _0x2aab12={};_0x2aab12[_0xb26fe0[_0x713b('0x29')]]={'$like':'%'+_0x101847[_0x713b('0x33')][_0x713b('0x40')]+'%'};return _0x2aab12;}})});}_0x4e7431=_['merge']({},_0x4e7431,_0x101847[_0x713b('0x41')]);var _0x41380b={'where':_0x4e7431[_0x713b('0x3b')]};return db[_0x713b('0x2c')][_0x713b('0x1d')](_0x41380b)[_0x713b('0x22')](function(_0xd879cd){_0x4f7eab[_0x713b('0x1d')]=_0xd879cd;if(_0x101847[_0x713b('0x33')][_0x713b('0x42')]){_0x4e7431['include']=[{'all':!![]}];}return db[_0x713b('0x2c')][_0x713b('0x43')](_0x4e7431);})[_0x713b('0x22')](function(_0x4abde9){_0x4f7eab[_0x713b('0x44')]=_0x4abde9;return _0x4f7eab;})[_0x713b('0x22')](respondWithFilteredResult(_0x23f6b5,_0x4e7431))[_0x713b('0x45')](handleError(_0x23f6b5,null));};exports[_0x713b('0x46')]=function(_0x4c4915,_0x5be995){var _0x38a52f={'raw':!![],'where':{'id':_0x4c4915[_0x713b('0x47')]['id']}},_0x266ede={};_0x266ede['model']=_[_0x713b('0x48')](db[_0x713b('0x2c')]['rawAttributes']);_0x266ede[_0x713b('0x33')]=_[_0x713b('0x48')](_0x4c4915[_0x713b('0x33')]);_0x266ede['filters']=_[_0x713b('0x34')](_0x266ede[_0x713b('0x31')],_0x266ede[_0x713b('0x33')]);_0x38a52f[_0x713b('0x36')]=_[_0x713b('0x34')](_0x266ede[_0x713b('0x31')],qs[_0x713b('0x35')](_0x4c4915[_0x713b('0x33')]['fields']));_0x38a52f['attributes']=_0x38a52f[_0x713b('0x36')][_0x713b('0x37')]?_0x38a52f[_0x713b('0x36')]:_0x266ede[_0x713b('0x31')];if(_0x4c4915['query'][_0x713b('0x42')]){_0x38a52f[_0x713b('0x49')]=[{'all':!![]}];}_0x38a52f=_['merge']({},_0x38a52f,_0x4c4915[_0x713b('0x41')]);return db['AnalyticExtractedReport']['find'](_0x38a52f)['then'](handleEntityNotFound(_0x5be995,null))[_0x713b('0x22')](respondWithResult(_0x5be995,null))[_0x713b('0x45')](handleError(_0x5be995,null));};exports[_0x713b('0x4a')]=function(_0x13f567,_0x321e69){return db[_0x713b('0x2c')][_0x713b('0x4a')](_0x13f567[_0x713b('0x4b')],{})[_0x713b('0x22')](function(_0x405576){var _0x346f5d=_0x13f567['user']['get']({'plain':!![]});if(!_0x346f5d)throw new Error(_0x713b('0x4c'));if(_0x346f5d[_0x713b('0x4d')]==='user'){var _0x386675=_0x405576[_0x713b('0x24')]({'plain':!![]});var _0x1144b2=_0x713b('0x25');return db['UserProfileSection'][_0x713b('0x4e')]({'where':{'name':_0x1144b2,'userProfileId':_0x346f5d['userProfileId']},'raw':!![]})['then'](function(_0x57a8f7){if(_0x57a8f7&&_0x57a8f7['autoAssociation']===0x0){return db[_0x713b('0x26')][_0x713b('0x4a')]({'name':_0x386675[_0x713b('0x29')],'resourceId':_0x386675['id'],'type':_0x57a8f7[_0x713b('0x29')],'sectionId':_0x57a8f7['id']},{})[_0x713b('0x22')](function(){return _0x405576;});}else{return _0x405576;}})['catch'](function(_0x417776){logger[_0x713b('0x4f')](_0x713b('0x50'),_0x417776);throw _0x417776;});}return _0x405576;})[_0x713b('0x22')](respondWithResult(_0x321e69,0xc9))['catch'](handleError(_0x321e69,null));};exports['update']=function(_0xe2b025,_0x16d776){if(_0xe2b025[_0x713b('0x4b')]['id']){delete _0xe2b025[_0x713b('0x4b')]['id'];}return db['AnalyticExtractedReport'][_0x713b('0x4e')]({'where':{'id':_0xe2b025[_0x713b('0x47')]['id']}})[_0x713b('0x22')](handleEntityNotFound(_0x16d776,null))['then'](saveUpdates(_0xe2b025[_0x713b('0x4b')],null))[_0x713b('0x22')](respondWithResult(_0x16d776,null))['catch'](handleError(_0x16d776,null));};exports['destroy']=function(_0x10ba65,_0x3ba30e){return db[_0x713b('0x2c')][_0x713b('0x4e')]({'where':{'id':_0x10ba65[_0x713b('0x47')]['id']}})['then'](handleEntityNotFound(_0x3ba30e,null))['then'](removeEntity(_0x3ba30e,null))[_0x713b('0x45')](handleError(_0x3ba30e,null));};exports['download']=function(_0x44b96d,_0x488f63,_0x18f10c){return db[_0x713b('0x2c')]['find']({'where':{'id':_0x44b96d[_0x713b('0x47')]['id']},'attributes':[_0x713b('0x29'),'basename',_0x713b('0x51'),_0x713b('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x488f63,null))[_0x713b('0x22')](function(_0x44951e){if(_0x44951e){if(!fs[_0x713b('0x53')](path[_0x713b('0x54')](config[_0x713b('0x55')],_0x713b('0x56'),_0x44951e[_0x713b('0x51')]))){throw new db[(_0x713b('0x57'))][(_0x713b('0x58'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x44b96d[_0x713b('0x33')][_0x713b('0x59')]){return _0x488f63['sendStatus'](0xc8);}return _0x488f63[_0x713b('0x5a')](path[_0x713b('0x54')](config[_0x713b('0x55')],_0x713b('0x56'),_0x44951e[_0x713b('0x51')]),util['format']('%s.%s',_0x44951e[_0x713b('0x5b')]||_0x44951e[_0x713b('0x29')],_0x44951e[_0x713b('0x52')]['toLowerCase']()));}})['catch'](handleError(_0x488f63,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 9b70316..3113a45 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 _0x6ee4=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','util'];(function(_0x110f18,_0x36ea5c){var _0x36ccbf=function(_0xe113f4){while(--_0xe113f4){_0x110f18['push'](_0x110f18['shift']());}};_0x36ccbf(++_0x36ea5c);}(_0x6ee4,0x197));var _0x46ee=function(_0x39add0,_0x855b75){_0x39add0=_0x39add0-0x0;var _0x191987=_0x6ee4[_0x39add0];return _0x191987;};'use strict';var _=require('lodash');var util=require(_0x46ee('0x0'));var logger=require(_0x46ee('0x1'))(_0x46ee('0x2'));var moment=require(_0x46ee('0x3'));var BPromise=require(_0x46ee('0x4'));var rp=require(_0x46ee('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x46ee('0x6'));var config=require(_0x46ee('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0x46ee('0x8')]=function(_0x3b1583,_0x3f65d8){return _0x3b1583[_0x46ee('0x9')](_0x46ee('0xa'),attributes,{'tableName':_0x46ee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6647=['bluebird','request-promise','rimraf','../../config/environment','define','analytics_extracted_reports','util','../../config/logger','api'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x6647,0x14a));var _0x7664=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6647[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x7664('0x0'));var logger=require(_0x7664('0x1'))(_0x7664('0x2'));var moment=require('moment');var BPromise=require(_0x7664('0x3'));var rp=require(_0x7664('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7664('0x5'));var config=require(_0x7664('0x6'));var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x7e472e,_0x13dc00){return _0x7e472e[_0x7664('0x7')]('AnalyticExtractedReport',attributes,{'tableName':_0x7664('0x8'),'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 2e7e985..d3ec5bd 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 _0x8ce1=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x2769ea,_0x4e63ed){var _0x7a61a4=function(_0x21bfd8){while(--_0x21bfd8){_0x2769ea['push'](_0x2769ea['shift']());}};_0x7a61a4(++_0x4e63ed);}(_0x8ce1,0xc7));var _0x18ce=function(_0x2ed1a2,_0x10ad1d){_0x2ed1a2=_0x2ed1a2-0x0;var _0x2c03ef=_0x8ce1[_0x2ed1a2];return _0x2c03ef;};'use strict';var _=require(_0x18ce('0x0'));var util=require('util');var moment=require(_0x18ce('0x1'));var BPromise=require(_0x18ce('0x2'));var rs=require(_0x18ce('0x3'));var fs=require('fs');var Redis=require(_0x18ce('0x4'));var db=require(_0x18ce('0x5'))['db'];var utils=require(_0x18ce('0x6'));var logger=require(_0x18ce('0x7'))(_0x18ce('0x8'));var config=require('../../config/environment');var jayson=require(_0x18ce('0x9'));var client=jayson[_0x18ce('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31f7c4,_0x37334e,_0x5843b1){return new BPromise(function(_0x367129,_0x2a5a41){return client[_0x18ce('0xb')](_0x31f7c4,_0x5843b1)['then'](function(_0x437b22){logger[_0x18ce('0xc')](_0x18ce('0xd'),_0x37334e,_0x18ce('0xe'));logger[_0x18ce('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x37334e,_0x18ce('0xe'),JSON[_0x18ce('0x10')](_0x437b22));if(_0x437b22[_0x18ce('0x11')]){if(_0x437b22[_0x18ce('0x11')][_0x18ce('0x12')]===0x1f4){logger[_0x18ce('0x11')](_0x18ce('0xd'),_0x37334e,_0x437b22[_0x18ce('0x11')]['message']);return _0x2a5a41(_0x437b22[_0x18ce('0x11')][_0x18ce('0x13')]);}logger['error'](_0x18ce('0xd'),_0x37334e,_0x437b22[_0x18ce('0x11')]['message']);return _0x367129(_0x437b22[_0x18ce('0x11')][_0x18ce('0x13')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x37334e,'request\x20sent');_0x367129(_0x437b22[_0x18ce('0x14')][_0x18ce('0x13')]);}})[_0x18ce('0x15')](function(_0x2f33cc){logger[_0x18ce('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x37334e,_0x2f33cc);_0x2a5a41(_0x2f33cc);});});} \ No newline at end of file +var _0x157f=['debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x2a03fa,_0xb1d8dd){var _0xf84bf7=function(_0x5a6e50){while(--_0x5a6e50){_0x2a03fa['push'](_0x2a03fa['shift']());}};_0xf84bf7(++_0xb1d8dd);}(_0x157f,0x141));var _0xf157=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x157f[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xf157('0x0'));var util=require(_0xf157('0x1'));var moment=require(_0xf157('0x2'));var BPromise=require(_0xf157('0x3'));var rs=require(_0xf157('0x4'));var fs=require('fs');var Redis=require(_0xf157('0x5'));var db=require(_0xf157('0x6'))['db'];var utils=require(_0xf157('0x7'));var logger=require(_0xf157('0x8'))(_0xf157('0x9'));var config=require(_0xf157('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xf157('0xb')][_0xf157('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x50b3f3,_0x34d1d3,_0x456434){return new BPromise(function(_0x4fb474,_0x11a655){return client[_0xf157('0xd')](_0x50b3f3,_0x456434)[_0xf157('0xe')](function(_0xaa0699){logger[_0xf157('0xf')](_0xf157('0x10'),_0x34d1d3,'request\x20sent');logger[_0xf157('0x11')](_0xf157('0x12'),_0x34d1d3,_0xf157('0x13'),JSON[_0xf157('0x14')](_0xaa0699));if(_0xaa0699[_0xf157('0x15')]){if(_0xaa0699['error'][_0xf157('0x16')]===0x1f4){logger[_0xf157('0x15')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x34d1d3,_0xaa0699[_0xf157('0x15')]['message']);return _0x11a655(_0xaa0699[_0xf157('0x15')][_0xf157('0x17')]);}logger[_0xf157('0x15')](_0xf157('0x10'),_0x34d1d3,_0xaa0699[_0xf157('0x15')][_0xf157('0x17')]);return _0x4fb474(_0xaa0699[_0xf157('0x15')]['message']);}else{logger[_0xf157('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x34d1d3,'request\x20sent');_0x4fb474(_0xaa0699[_0xf157('0x18')][_0xf157('0x17')]);}})[_0xf157('0x19')](function(_0x208746){logger[_0xf157('0x15')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x34d1d3,_0x208746);_0x11a655(_0x208746);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 945d1e2..0e7061e 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 _0x98aa=['../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x98aa,0x7e));var _0xa98a=function(_0x19e013,_0x5c74e0){_0x19e013=_0x19e013-0x0;var _0x58c128=_0x98aa[_0x19e013];return _0x58c128;};'use strict';var multer=require(_0xa98a('0x0'));var util=require(_0xa98a('0x1'));var path=require(_0xa98a('0x2'));var timeout=require(_0xa98a('0x3'));var express=require(_0xa98a('0x4'));var router=express[_0xa98a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa98a('0x6'));var config=require(_0xa98a('0x7'));var controller=require(_0xa98a('0x8'));router[_0xa98a('0x9')]('/',auth[_0xa98a('0xa')](),controller[_0xa98a('0xb')]);router[_0xa98a('0x9')](_0xa98a('0xc'),auth[_0xa98a('0xa')](),controller[_0xa98a('0xd')]);router[_0xa98a('0x9')](_0xa98a('0xe'),auth[_0xa98a('0xa')](),controller[_0xa98a('0xf')]);router[_0xa98a('0x10')]('/',auth[_0xa98a('0xa')](),controller['create']);router[_0xa98a('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa98a('0x12')]);router[_0xa98a('0x13')]('/:id',auth[_0xa98a('0xa')](),controller[_0xa98a('0x14')]);module[_0xa98a('0x15')]=router; \ No newline at end of file +var _0x4036=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','put','delete','destroy','exports','multer','util'];(function(_0x2a1a0b,_0x52086b){var _0x58a15d=function(_0x36989e){while(--_0x36989e){_0x2a1a0b['push'](_0x2a1a0b['shift']());}};_0x58a15d(++_0x52086b);}(_0x4036,0x9e));var _0x6403=function(_0x5ebfb1,_0x15a7bb){_0x5ebfb1=_0x5ebfb1-0x0;var _0x291643=_0x4036[_0x5ebfb1];return _0x291643;};'use strict';var multer=require(_0x6403('0x0'));var util=require(_0x6403('0x1'));var path=require(_0x6403('0x2'));var timeout=require(_0x6403('0x3'));var express=require(_0x6403('0x4'));var router=express[_0x6403('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6403('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6403('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0x6403('0x8')]('/',auth[_0x6403('0x9')](),controller[_0x6403('0xa')]);router['get'](_0x6403('0xb'),auth[_0x6403('0x9')](),controller[_0x6403('0xc')]);router[_0x6403('0x8')](_0x6403('0xd'),auth[_0x6403('0x9')](),controller[_0x6403('0xe')]);router[_0x6403('0xf')]('/',auth[_0x6403('0x9')](),controller['create']);router[_0x6403('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6403('0x11')](_0x6403('0xb'),auth[_0x6403('0x9')](),controller[_0x6403('0x12')]);module[_0x6403('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index d978386..2d18cb1 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 _0x73fc=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x5dc073,_0x3d21d2){var _0x2c7c3a=function(_0x41c036){while(--_0x41c036){_0x5dc073['push'](_0x5dc073['shift']());}};_0x2c7c3a(++_0x3d21d2);}(_0x73fc,0x152));var _0xc73f=function(_0x140beb,_0x57472d){_0x140beb=_0x140beb-0x0;var _0x265f48=_0x73fc[_0x140beb];return _0x265f48;};'use strict';var Sequelize=require(_0xc73f('0x0'));module[_0xc73f('0x1')]={'field':{'type':Sequelize[_0xc73f('0x2')]},'alias':{'type':Sequelize[_0xc73f('0x3')]},'function':{'type':Sequelize[_0xc73f('0x3')]},'format':{'type':Sequelize[_0xc73f('0x3')]},'groupBy':{'type':Sequelize[_0xc73f('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xc73f('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x2ee0=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x1dbf70,_0x3bcdb8){var _0x20adb4=function(_0x374fa3){while(--_0x374fa3){_0x1dbf70['push'](_0x1dbf70['shift']());}};_0x20adb4(++_0x3bcdb8);}(_0x2ee0,0x110));var _0x02ee=function(_0x418ed8,_0x441581){_0x418ed8=_0x418ed8-0x0;var _0xac0bc8=_0x2ee0[_0x418ed8];return _0xac0bc8;};'use strict';var Sequelize=require(_0x02ee('0x0'));module[_0x02ee('0x1')]={'field':{'type':Sequelize[_0x02ee('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x02ee('0x3')]},'format':{'type':Sequelize[_0x02ee('0x3')]},'groupBy':{'type':Sequelize[_0x02ee('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x02ee('0x3')]},'custom':{'type':Sequelize[_0x02ee('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 5718efa..159d7ee 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 _0x374f=['destroy','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','create','bulkCreate','body','find','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x374f,0x13f));var _0xf374=function(_0x4cdd01,_0x465a1c){_0x4cdd01=_0x4cdd01-0x0;var _0x476661=_0x374f[_0x4cdd01];return _0x476661;};'use strict';var emlformat=require(_0xf374('0x0'));var rimraf=require(_0xf374('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf374('0x2'));var rp=require(_0xf374('0x3'));var moment=require(_0xf374('0x4'));var BPromise=require(_0xf374('0x5'));var Mustache=require(_0xf374('0x6'));var util=require(_0xf374('0x7'));var path=require(_0xf374('0x8'));var sox=require(_0xf374('0x9'));var csv=require(_0xf374('0xa'));var ejs=require(_0xf374('0xb'));var fs=require('fs');var fs_extra=require(_0xf374('0xc'));var _=require(_0xf374('0xd'));var squel=require(_0xf374('0xe'));var crypto=require(_0xf374('0xf'));var jsforce=require(_0xf374('0x10'));var deskjs=require(_0xf374('0x11'));var toCsv=require('to-csv');var querystring=require(_0xf374('0x12'));var Papa=require(_0xf374('0x13'));var Redis=require(_0xf374('0x14'));var authService=require(_0xf374('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xf374('0x16'));var hardwareService=require(_0xf374('0x17'));var logger=require(_0xf374('0x18'))(_0xf374('0x19'));var utils=require(_0xf374('0x1a'));var config=require(_0xf374('0x1b'));var licenseUtil=require(_0xf374('0x1c'));var db=require(_0xf374('0x1d'))['db'];function respondWithStatusCode(_0x2fe28e,_0x25f4c0){_0x25f4c0=_0x25f4c0||0xcc;return function(_0x2ac881){if(_0x2ac881){return _0x2fe28e[_0xf374('0x1e')](_0x25f4c0);}return _0x2fe28e['status'](_0x25f4c0)[_0xf374('0x1f')]();};}function respondWithResult(_0x12983f,_0x1d580e){_0x1d580e=_0x1d580e||0xc8;return function(_0x140bdd){if(_0x140bdd){return _0x12983f[_0xf374('0x20')](_0x1d580e)['json'](_0x140bdd);}};}function respondWithFilteredResult(_0x36e19e,_0x106c95){return function(_0x4f3f78){if(_0x4f3f78){var _0x3fe252=typeof _0x106c95[_0xf374('0x21')]===_0xf374('0x22')&&typeof _0x106c95[_0xf374('0x23')]===_0xf374('0x22');var _0x5b79c7=_0x4f3f78[_0xf374('0x24')];var _0x52bb31=_0x3fe252?0x0:_0x106c95[_0xf374('0x21')];var _0x55a2dd=_0x3fe252?_0x4f3f78['count']:_0x106c95[_0xf374('0x21')]+_0x106c95['limit'];var _0x37321c;if(_0x55a2dd>=_0x5b79c7){_0x55a2dd=_0x5b79c7;_0x37321c=0xc8;}else{_0x37321c=0xce;}_0x36e19e[_0xf374('0x20')](_0x37321c);return _0x36e19e[_0xf374('0x25')](_0xf374('0x26'),_0x52bb31+'-'+_0x55a2dd+'/'+_0x5b79c7)[_0xf374('0x27')](_0x4f3f78);}return null;};}function patchUpdates(_0x4a45c1){return function(_0xc99a43){try{jsonpatch[_0xf374('0x28')](_0xc99a43,_0x4a45c1,!![]);}catch(_0x49df64){return BPromise[_0xf374('0x29')](_0x49df64);}return _0xc99a43[_0xf374('0x2a')]();};}function saveUpdates(_0x34f811,_0x39b3e0){return function(_0x13788b){if(_0x13788b){return _0x13788b[_0xf374('0x2b')](_0x34f811)[_0xf374('0x2c')](function(_0xa2d4c1){return _0xa2d4c1;});}return null;};}function removeEntity(_0x48e06a,_0xeb9fc6){return function(_0x5d611e){if(_0x5d611e){return _0x5d611e[_0xf374('0x2d')]()[_0xf374('0x2c')](function(){_0x48e06a[_0xf374('0x20')](0xcc)[_0xf374('0x1f')]();});}};}function handleEntityNotFound(_0x296816,_0x4c79f4){return function(_0x1d74d7){if(!_0x1d74d7){_0x296816[_0xf374('0x1e')](0x194);}return _0x1d74d7;};}function handleError(_0x1ba198,_0x9bcd4c){_0x9bcd4c=_0x9bcd4c||0x1f4;return function(_0x3733c4){logger['error'](_0x3733c4[_0xf374('0x2e')]);if(_0x3733c4[_0xf374('0x2f')]){delete _0x3733c4['name'];}_0x1ba198['status'](_0x9bcd4c)[_0xf374('0x30')](_0x3733c4);};}exports[_0xf374('0x31')]=function(_0x5246b0,_0x3c3b67){var _0x428154={},_0x33b1cc={},_0x57ecc7={'count':0x0,'rows':[]};var _0x59e890=_[_0xf374('0x32')](db[_0xf374('0x33')][_0xf374('0x34')],function(_0x425750){return{'name':_0x425750[_0xf374('0x35')],'type':_0x425750[_0xf374('0x36')][_0xf374('0x37')]};});_0x33b1cc[_0xf374('0x38')]=_['map'](_0x59e890,_0xf374('0x2f'));_0x33b1cc[_0xf374('0x39')]=_[_0xf374('0x3a')](_0x5246b0[_0xf374('0x39')]);_0x33b1cc['filters']=_[_0xf374('0x3b')](_0x33b1cc[_0xf374('0x38')],_0x33b1cc[_0xf374('0x39')]);_0x428154[_0xf374('0x3c')]=_['intersection'](_0x33b1cc[_0xf374('0x38')],qs[_0xf374('0x3d')](_0x5246b0['query'][_0xf374('0x3d')]));_0x428154['attributes']=_0x428154[_0xf374('0x3c')][_0xf374('0x3e')]?_0x428154[_0xf374('0x3c')]:_0x33b1cc[_0xf374('0x38')];if(!_0x5246b0[_0xf374('0x39')][_0xf374('0x3f')](_0xf374('0x40'))){_0x428154[_0xf374('0x23')]=qs[_0xf374('0x23')](_0x5246b0[_0xf374('0x39')]['limit']);_0x428154[_0xf374('0x21')]=qs[_0xf374('0x21')](_0x5246b0['query'][_0xf374('0x21')]);}_0x428154[_0xf374('0x41')]=qs[_0xf374('0x42')](_0x5246b0['query'][_0xf374('0x42')]);_0x428154[_0xf374('0x43')]=qs[_0xf374('0x44')](_[_0xf374('0x45')](_0x5246b0[_0xf374('0x39')],_0x33b1cc[_0xf374('0x44')]),_0x59e890);if(_0x5246b0[_0xf374('0x39')][_0xf374('0x46')]){_0x428154[_0xf374('0x43')]=_[_0xf374('0x47')](_0x428154['where'],{'$or':_['map'](_0x59e890,function(_0x15ec51){if(_0x15ec51[_0xf374('0x36')]!==_0xf374('0x48')){var _0x5e9027={};_0x5e9027[_0x15ec51['name']]={'$like':'%'+_0x5246b0[_0xf374('0x39')][_0xf374('0x46')]+'%'};return _0x5e9027;}})});}_0x428154=_[_0xf374('0x47')]({},_0x428154,_0x5246b0[_0xf374('0x49')]);var _0x2c16e5={'where':_0x428154[_0xf374('0x43')]};return db[_0xf374('0x33')]['count'](_0x2c16e5)[_0xf374('0x2c')](function(_0x4eb530){_0x57ecc7['count']=_0x4eb530;if(_0x5246b0[_0xf374('0x39')][_0xf374('0x4a')]){_0x428154['include']=[{'all':!![]}];}return db[_0xf374('0x33')][_0xf374('0x4b')](_0x428154);})['then'](function(_0x5bde7c){_0x57ecc7[_0xf374('0x4c')]=_0x5bde7c;return _0x57ecc7;})['then'](respondWithFilteredResult(_0x3c3b67,_0x428154))[_0xf374('0x4d')](handleError(_0x3c3b67,null));};exports['show']=function(_0x486784,_0x1e3397){var _0x1b3c29={'raw':![],'where':{'id':_0x486784[_0xf374('0x4e')]['id']}},_0x3aef83={};_0x3aef83[_0xf374('0x38')]=_[_0xf374('0x3a')](db['AnalyticFieldReport']['rawAttributes']);_0x3aef83['query']=_[_0xf374('0x3a')](_0x486784[_0xf374('0x39')]);_0x3aef83[_0xf374('0x44')]=_[_0xf374('0x3b')](_0x3aef83[_0xf374('0x38')],_0x3aef83[_0xf374('0x39')]);_0x1b3c29[_0xf374('0x3c')]=_[_0xf374('0x3b')](_0x3aef83[_0xf374('0x38')],qs[_0xf374('0x3d')](_0x486784[_0xf374('0x39')]['fields']));_0x1b3c29[_0xf374('0x3c')]=_0x1b3c29[_0xf374('0x3c')][_0xf374('0x3e')]?_0x1b3c29[_0xf374('0x3c')]:_0x3aef83[_0xf374('0x38')];if(_0x486784[_0xf374('0x39')]['includeAll']){_0x1b3c29[_0xf374('0x4f')]=[{'all':!![]}];}_0x1b3c29=_[_0xf374('0x47')]({},_0x1b3c29,_0x486784['options']);return db[_0xf374('0x33')]['find'](_0x1b3c29)[_0xf374('0x2c')](handleEntityNotFound(_0x1e3397,null))[_0xf374('0x2c')](respondWithResult(_0x1e3397,null))[_0xf374('0x4d')](handleError(_0x1e3397,null));};exports['create']=function(_0x4c27d6,_0xfb9de2){return db[_0xf374('0x33')][_0xf374('0x50')](_0x4c27d6['body'],{})['then'](respondWithResult(_0xfb9de2,0xc9))['catch'](handleError(_0xfb9de2,null));};exports[_0xf374('0x51')]=function(_0x2c7088,_0x25a241){return db[_0xf374('0x33')][_0xf374('0x51')](_0x2c7088['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x25a241,0xc9))[_0xf374('0x4d')](handleError(_0x25a241,null));};exports['update']=function(_0x20f016,_0xfb2908){if(_0x20f016[_0xf374('0x52')]['id']){delete _0x20f016[_0xf374('0x52')]['id'];}return db[_0xf374('0x33')][_0xf374('0x53')]({'where':{'id':_0x20f016['params']['id']}})['then'](handleEntityNotFound(_0xfb2908,null))[_0xf374('0x2c')](saveUpdates(_0x20f016[_0xf374('0x52')],null))[_0xf374('0x2c')](respondWithResult(_0xfb2908,null))[_0xf374('0x4d')](handleError(_0xfb2908,null));};exports[_0xf374('0x2d')]=function(_0x45b4b9,_0x41489a){return db[_0xf374('0x33')]['find']({'where':{'id':_0x45b4b9[_0xf374('0x4e')]['id']}})['then'](handleEntityNotFound(_0x41489a,null))[_0xf374('0x2c')](removeEntity(_0x41489a,null))[_0xf374('0x4d')](handleError(_0x41489a,null));};exports[_0xf374('0x54')]=function(_0x324a97,_0x56dc14){return db[_0xf374('0x33')][_0xf374('0x2d')]({'where':{'id':_0x324a97[_0xf374('0x39')][_0xf374('0x55')]||[]},'raw':![],'individualHooks':!![]})[_0xf374('0x2c')](respondWithResult(_0x56dc14,0xcc))[_0xf374('0x4d')](handleError(_0x56dc14,null));};exports['addFields']=function(_0x2a19b4,_0x27b4b1,_0x32da9a){return db[_0xf374('0x56')][_0xf374('0x57')]({'where':{'id':_0x2a19b4[_0xf374('0x4e')]['id']}})[_0xf374('0x2c')](handleEntityNotFound(_0x27b4b1,null))[_0xf374('0x2c')](function(_0x331081){if(_0x331081){return db[_0xf374('0x58')][_0xf374('0x59')](function(_0x8c26c7){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x2a19b4[_0xf374('0x4e')]['id']},'transaction':_0x8c26c7})['then'](function(_0x48f2c6){var _0x513b84=_[_0xf374('0x32')](_0x2a19b4['body'],function(_0x31b22c){delete _0x31b22c['id'];_0x31b22c[_0xf374('0x5a')]=_0x2a19b4[_0xf374('0x4e')]['id'];return _0x31b22c;});return db[_0xf374('0x33')][_0xf374('0x51')](_0x513b84,{'transaction':_0x8c26c7});});})['then'](function(){return db[_0xf374('0x33')][_0xf374('0x4b')]({'where':{'CustomReportId':_0x2a19b4[_0xf374('0x4e')]['id']}});});}})['then'](respondWithResult(_0x27b4b1,null))[_0xf374('0x4d')](handleError(_0x27b4b1,null));}; \ No newline at end of file +var _0x8ed2=['AnalyticCustomReport','findOne','sequelize','transaction','eml-format','rimraf','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','AnalyticFieldReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','merge','options','includeAll','findAll','catch','show','rawAttributes','include','bulkCreate','body','update','find','params','bulkDestroy','ids','addFields'];(function(_0x292e60,_0x186dbb){var _0x30227b=function(_0x5fdcd7){while(--_0x5fdcd7){_0x292e60['push'](_0x292e60['shift']());}};_0x30227b(++_0x186dbb);}(_0x8ed2,0xe8));var _0x28ed=function(_0x5b7448,_0x708cff){_0x5b7448=_0x5b7448-0x0;var _0x35d571=_0x8ed2[_0x5b7448];return _0x35d571;};'use strict';var emlformat=require(_0x28ed('0x0'));var rimraf=require(_0x28ed('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x28ed('0x2'));var moment=require('moment');var BPromise=require(_0x28ed('0x3'));var Mustache=require('mustache');var util=require(_0x28ed('0x4'));var path=require('path');var sox=require(_0x28ed('0x5'));var csv=require(_0x28ed('0x6'));var ejs=require(_0x28ed('0x7'));var fs=require('fs');var fs_extra=require(_0x28ed('0x8'));var _=require(_0x28ed('0x9'));var squel=require('squel');var crypto=require(_0x28ed('0xa'));var jsforce=require(_0x28ed('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x28ed('0xc'));var Papa=require('papaparse');var Redis=require(_0x28ed('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x28ed('0xe'));var hardwareService=require(_0x28ed('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x28ed('0x10'));var licenseUtil=require(_0x28ed('0x11'));var db=require(_0x28ed('0x12'))['db'];function respondWithStatusCode(_0x2f36d0,_0x36fc99){_0x36fc99=_0x36fc99||0xcc;return function(_0x4d5f0a){if(_0x4d5f0a){return _0x2f36d0[_0x28ed('0x13')](_0x36fc99);}return _0x2f36d0[_0x28ed('0x14')](_0x36fc99)[_0x28ed('0x15')]();};}function respondWithResult(_0xf37952,_0x31e641){_0x31e641=_0x31e641||0xc8;return function(_0x346b1f){if(_0x346b1f){return _0xf37952[_0x28ed('0x14')](_0x31e641)['json'](_0x346b1f);}};}function respondWithFilteredResult(_0x44dff8,_0x4ed412){return function(_0x20bf59){if(_0x20bf59){var _0x42c6db=typeof _0x4ed412[_0x28ed('0x16')]==='undefined'&&typeof _0x4ed412[_0x28ed('0x17')]===_0x28ed('0x18');var _0x3e0f17=_0x20bf59['count'];var _0x4bb0b9=_0x42c6db?0x0:_0x4ed412[_0x28ed('0x16')];var _0x12162e=_0x42c6db?_0x20bf59[_0x28ed('0x19')]:_0x4ed412[_0x28ed('0x16')]+_0x4ed412['limit'];var _0x3cc0c4;if(_0x12162e>=_0x3e0f17){_0x12162e=_0x3e0f17;_0x3cc0c4=0xc8;}else{_0x3cc0c4=0xce;}_0x44dff8[_0x28ed('0x14')](_0x3cc0c4);return _0x44dff8[_0x28ed('0x1a')](_0x28ed('0x1b'),_0x4bb0b9+'-'+_0x12162e+'/'+_0x3e0f17)['json'](_0x20bf59);}return null;};}function patchUpdates(_0x5ca178){return function(_0x4bc609){try{jsonpatch[_0x28ed('0x1c')](_0x4bc609,_0x5ca178,!![]);}catch(_0x170bc9){return BPromise[_0x28ed('0x1d')](_0x170bc9);}return _0x4bc609[_0x28ed('0x1e')]();};}function saveUpdates(_0x350dd5,_0x22ba11){return function(_0x1426f4){if(_0x1426f4){return _0x1426f4['update'](_0x350dd5)['then'](function(_0x52ef1d){return _0x52ef1d;});}return null;};}function removeEntity(_0x508ecf,_0x5dfe6b){return function(_0x27f5b7){if(_0x27f5b7){return _0x27f5b7[_0x28ed('0x1f')]()[_0x28ed('0x20')](function(){_0x508ecf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d5939,_0x4bad7b){return function(_0x301755){if(!_0x301755){_0x3d5939[_0x28ed('0x13')](0x194);}return _0x301755;};}function handleError(_0xc14f9e,_0x46017d){_0x46017d=_0x46017d||0x1f4;return function(_0x36fd86){logger[_0x28ed('0x21')](_0x36fd86['stack']);if(_0x36fd86[_0x28ed('0x22')]){delete _0x36fd86[_0x28ed('0x22')];}_0xc14f9e['status'](_0x46017d)[_0x28ed('0x23')](_0x36fd86);};}exports[_0x28ed('0x24')]=function(_0x5e9890,_0x383295){var _0x2961fb={},_0x553480={},_0x32c154={'count':0x0,'rows':[]};var _0x254720=_[_0x28ed('0x25')](db[_0x28ed('0x26')]['rawAttributes'],function(_0x5e9406){return{'name':_0x5e9406[_0x28ed('0x27')],'type':_0x5e9406['type'][_0x28ed('0x28')]};});_0x553480[_0x28ed('0x29')]=_[_0x28ed('0x25')](_0x254720,_0x28ed('0x22'));_0x553480[_0x28ed('0x2a')]=_[_0x28ed('0x2b')](_0x5e9890[_0x28ed('0x2a')]);_0x553480[_0x28ed('0x2c')]=_[_0x28ed('0x2d')](_0x553480['model'],_0x553480[_0x28ed('0x2a')]);_0x2961fb[_0x28ed('0x2e')]=_[_0x28ed('0x2d')](_0x553480[_0x28ed('0x29')],qs[_0x28ed('0x2f')](_0x5e9890['query']['fields']));_0x2961fb[_0x28ed('0x2e')]=_0x2961fb[_0x28ed('0x2e')][_0x28ed('0x30')]?_0x2961fb[_0x28ed('0x2e')]:_0x553480[_0x28ed('0x29')];if(!_0x5e9890[_0x28ed('0x2a')][_0x28ed('0x31')]('nolimit')){_0x2961fb[_0x28ed('0x17')]=qs[_0x28ed('0x17')](_0x5e9890[_0x28ed('0x2a')]['limit']);_0x2961fb['offset']=qs[_0x28ed('0x16')](_0x5e9890[_0x28ed('0x2a')][_0x28ed('0x16')]);}_0x2961fb[_0x28ed('0x32')]=qs[_0x28ed('0x33')](_0x5e9890['query'][_0x28ed('0x33')]);_0x2961fb[_0x28ed('0x34')]=qs['filters'](_[_0x28ed('0x35')](_0x5e9890[_0x28ed('0x2a')],_0x553480[_0x28ed('0x2c')]),_0x254720);if(_0x5e9890['query'][_0x28ed('0x36')]){_0x2961fb[_0x28ed('0x34')]=_['merge'](_0x2961fb[_0x28ed('0x34')],{'$or':_['map'](_0x254720,function(_0x44a4c7){if(_0x44a4c7[_0x28ed('0x37')]!=='VIRTUAL'){var _0x1401f5={};_0x1401f5[_0x44a4c7[_0x28ed('0x22')]]={'$like':'%'+_0x5e9890[_0x28ed('0x2a')][_0x28ed('0x36')]+'%'};return _0x1401f5;}})});}_0x2961fb=_[_0x28ed('0x38')]({},_0x2961fb,_0x5e9890[_0x28ed('0x39')]);var _0x389a0b={'where':_0x2961fb[_0x28ed('0x34')]};return db[_0x28ed('0x26')][_0x28ed('0x19')](_0x389a0b)[_0x28ed('0x20')](function(_0x2bd450){_0x32c154['count']=_0x2bd450;if(_0x5e9890[_0x28ed('0x2a')][_0x28ed('0x3a')]){_0x2961fb['include']=[{'all':!![]}];}return db[_0x28ed('0x26')][_0x28ed('0x3b')](_0x2961fb);})[_0x28ed('0x20')](function(_0x359a04){_0x32c154['rows']=_0x359a04;return _0x32c154;})[_0x28ed('0x20')](respondWithFilteredResult(_0x383295,_0x2961fb))[_0x28ed('0x3c')](handleError(_0x383295,null));};exports[_0x28ed('0x3d')]=function(_0x28290f,_0x1032bd){var _0x4ab177={'raw':![],'where':{'id':_0x28290f['params']['id']}},_0x2c3ed8={};_0x2c3ed8[_0x28ed('0x29')]=_[_0x28ed('0x2b')](db['AnalyticFieldReport'][_0x28ed('0x3e')]);_0x2c3ed8['query']=_['keys'](_0x28290f[_0x28ed('0x2a')]);_0x2c3ed8[_0x28ed('0x2c')]=_[_0x28ed('0x2d')](_0x2c3ed8['model'],_0x2c3ed8[_0x28ed('0x2a')]);_0x4ab177['attributes']=_[_0x28ed('0x2d')](_0x2c3ed8[_0x28ed('0x29')],qs[_0x28ed('0x2f')](_0x28290f[_0x28ed('0x2a')][_0x28ed('0x2f')]));_0x4ab177[_0x28ed('0x2e')]=_0x4ab177['attributes'][_0x28ed('0x30')]?_0x4ab177['attributes']:_0x2c3ed8['model'];if(_0x28290f['query'][_0x28ed('0x3a')]){_0x4ab177[_0x28ed('0x3f')]=[{'all':!![]}];}_0x4ab177=_[_0x28ed('0x38')]({},_0x4ab177,_0x28290f[_0x28ed('0x39')]);return db[_0x28ed('0x26')]['find'](_0x4ab177)['then'](handleEntityNotFound(_0x1032bd,null))[_0x28ed('0x20')](respondWithResult(_0x1032bd,null))[_0x28ed('0x3c')](handleError(_0x1032bd,null));};exports['create']=function(_0x2d01f3,_0x35715f){return db[_0x28ed('0x26')]['create'](_0x2d01f3['body'],{})['then'](respondWithResult(_0x35715f,0xc9))['catch'](handleError(_0x35715f,null));};exports['bulkCreate']=function(_0x4451a7,_0x4b2338){return db[_0x28ed('0x26')][_0x28ed('0x40')](_0x4451a7[_0x28ed('0x41')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4b2338,0xc9))[_0x28ed('0x3c')](handleError(_0x4b2338,null));};exports[_0x28ed('0x42')]=function(_0x18a4a0,_0x484ccd){if(_0x18a4a0[_0x28ed('0x41')]['id']){delete _0x18a4a0[_0x28ed('0x41')]['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x18a4a0['params']['id']}})[_0x28ed('0x20')](handleEntityNotFound(_0x484ccd,null))[_0x28ed('0x20')](saveUpdates(_0x18a4a0[_0x28ed('0x41')],null))[_0x28ed('0x20')](respondWithResult(_0x484ccd,null))[_0x28ed('0x3c')](handleError(_0x484ccd,null));};exports['destroy']=function(_0x5df10a,_0x39d9a9){return db[_0x28ed('0x26')][_0x28ed('0x43')]({'where':{'id':_0x5df10a[_0x28ed('0x44')]['id']}})[_0x28ed('0x20')](handleEntityNotFound(_0x39d9a9,null))[_0x28ed('0x20')](removeEntity(_0x39d9a9,null))[_0x28ed('0x3c')](handleError(_0x39d9a9,null));};exports[_0x28ed('0x45')]=function(_0x54a941,_0x47ca5d){return db[_0x28ed('0x26')][_0x28ed('0x1f')]({'where':{'id':_0x54a941[_0x28ed('0x2a')][_0x28ed('0x46')]||[]},'raw':![],'individualHooks':!![]})[_0x28ed('0x20')](respondWithResult(_0x47ca5d,0xcc))['catch'](handleError(_0x47ca5d,null));};exports[_0x28ed('0x47')]=function(_0x2bf646,_0x1bcea6,_0xe7cf8a){return db[_0x28ed('0x48')][_0x28ed('0x49')]({'where':{'id':_0x2bf646[_0x28ed('0x44')]['id']}})[_0x28ed('0x20')](handleEntityNotFound(_0x1bcea6,null))['then'](function(_0x2e2f2e){if(_0x2e2f2e){return db[_0x28ed('0x4a')][_0x28ed('0x4b')](function(_0x4664c8){return db[_0x28ed('0x26')][_0x28ed('0x1f')]({'where':{'CustomReportId':_0x2bf646['params']['id']},'transaction':_0x4664c8})['then'](function(_0x1595d1){var _0x48b3f3=_[_0x28ed('0x25')](_0x2bf646[_0x28ed('0x41')],function(_0x187a1a){delete _0x187a1a['id'];_0x187a1a['CustomReportId']=_0x2bf646[_0x28ed('0x44')]['id'];return _0x187a1a;});return db['AnalyticFieldReport'][_0x28ed('0x40')](_0x48b3f3,{'transaction':_0x4664c8});});})[_0x28ed('0x20')](function(){return db['AnalyticFieldReport'][_0x28ed('0x3b')]({'where':{'CustomReportId':_0x2bf646[_0x28ed('0x44')]['id']}});});}})[_0x28ed('0x20')](respondWithResult(_0x1bcea6,null))[_0x28ed('0x3c')](handleError(_0x1bcea6,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 628b7b4..d3ffca6 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 _0xdd9c=['AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x2339ba,_0x206746){var _0x52d482=function(_0x154923){while(--_0x154923){_0x2339ba['push'](_0x2339ba['shift']());}};_0x52d482(++_0x206746);}(_0xdd9c,0x66));var _0xcdd9=function(_0x3d86bf,_0x189cfa){_0x3d86bf=_0x3d86bf-0x0;var _0x40bfba=_0xdd9c[_0x3d86bf];return _0x40bfba;};'use strict';var _=require(_0xcdd9('0x0'));var util=require(_0xcdd9('0x1'));var logger=require(_0xcdd9('0x2'))(_0xcdd9('0x3'));var moment=require('moment');var BPromise=require(_0xcdd9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcdd9('0x5'));var config=require(_0xcdd9('0x6'));var attributes=require(_0xcdd9('0x7'));module['exports']=function(_0x43330c,_0x4d2941){return _0x43330c['define'](_0xcdd9('0x8'),attributes,{'tableName':_0xcdd9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c57=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','lodash','util','../../config/logger'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x9c57,0x1b9));var _0x79c5=function(_0x333edc,_0x338e2f){_0x333edc=_0x333edc-0x0;var _0x27418d=_0x9c57[_0x333edc];return _0x27418d;};'use strict';var _=require(_0x79c5('0x0'));var util=require(_0x79c5('0x1'));var logger=require(_0x79c5('0x2'))(_0x79c5('0x3'));var moment=require(_0x79c5('0x4'));var BPromise=require(_0x79c5('0x5'));var rp=require(_0x79c5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x79c5('0x7'));var config=require(_0x79c5('0x8'));var attributes=require(_0x79c5('0x9'));module['exports']=function(_0x17b13d,_0x42c850){return _0x17b13d[_0x79c5('0xa')](_0x79c5('0xb'),attributes,{'tableName':'analytics_report_fields','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 a6da7e7..ef313b2 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 _0x0a69=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message'];(function(_0x421366,_0x7163df){var _0x4a0aad=function(_0x163b2f){while(--_0x163b2f){_0x421366['push'](_0x421366['shift']());}};_0x4a0aad(++_0x7163df);}(_0x0a69,0x152));var _0x90a6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0a69[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x90a6('0x0'));var util=require(_0x90a6('0x1'));var moment=require(_0x90a6('0x2'));var BPromise=require(_0x90a6('0x3'));var rs=require(_0x90a6('0x4'));var fs=require('fs');var Redis=require(_0x90a6('0x5'));var db=require(_0x90a6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x90a6('0x7'))(_0x90a6('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x90a6('0x9')][_0x90a6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ef235,_0x366787,_0x220218){return new BPromise(function(_0x300dbf,_0x1783f9){return client[_0x90a6('0xb')](_0x5ef235,_0x220218)[_0x90a6('0xc')](function(_0x54ee79){logger[_0x90a6('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x366787,_0x90a6('0xe'));logger[_0x90a6('0xf')](_0x90a6('0x10'),_0x366787,_0x90a6('0xe'),JSON[_0x90a6('0x11')](_0x54ee79));if(_0x54ee79[_0x90a6('0x12')]){if(_0x54ee79[_0x90a6('0x12')][_0x90a6('0x13')]===0x1f4){logger[_0x90a6('0x12')](_0x90a6('0x14'),_0x366787,_0x54ee79['error'][_0x90a6('0x15')]);return _0x1783f9(_0x54ee79[_0x90a6('0x12')][_0x90a6('0x15')]);}logger['error'](_0x90a6('0x14'),_0x366787,_0x54ee79[_0x90a6('0x12')][_0x90a6('0x15')]);return _0x300dbf(_0x54ee79[_0x90a6('0x12')][_0x90a6('0x15')]);}else{logger[_0x90a6('0xd')](_0x90a6('0x14'),_0x366787,_0x90a6('0xe'));_0x300dbf(_0x54ee79[_0x90a6('0x16')][_0x90a6('0x15')]);}})[_0x90a6('0x17')](function(_0x33bf7a){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x366787,_0x33bf7a);_0x1783f9(_0x33bf7a);});});} \ No newline at end of file +var _0xce5a=['client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x554d29,_0x28c27e){var _0x395e80=function(_0x559c25){while(--_0x559c25){_0x554d29['push'](_0x554d29['shift']());}};_0x395e80(++_0x28c27e);}(_0xce5a,0x141));var _0xace5=function(_0x5a6961,_0xd41ca6){_0x5a6961=_0x5a6961-0x0;var _0x4af0a6=_0xce5a[_0x5a6961];return _0x4af0a6;};'use strict';var _=require(_0xace5('0x0'));var util=require('util');var moment=require(_0xace5('0x1'));var BPromise=require(_0xace5('0x2'));var rs=require(_0xace5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xace5('0x4'))['db'];var utils=require(_0xace5('0x5'));var logger=require('../../config/logger')(_0xace5('0x6'));var config=require(_0xace5('0x7'));var jayson=require(_0xace5('0x8'));var client=jayson[_0xace5('0x9')][_0xace5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cceca,_0x1c29b7,_0x34e83a){return new BPromise(function(_0x5322a3,_0x2ef11c){return client[_0xace5('0xb')](_0x4cceca,_0x34e83a)['then'](function(_0x587805){logger[_0xace5('0xc')](_0xace5('0xd'),_0x1c29b7,_0xace5('0xe'));logger[_0xace5('0xf')](_0xace5('0x10'),_0x1c29b7,'request\x20sent',JSON[_0xace5('0x11')](_0x587805));if(_0x587805['error']){if(_0x587805['error'][_0xace5('0x12')]===0x1f4){logger[_0xace5('0x13')](_0xace5('0xd'),_0x1c29b7,_0x587805[_0xace5('0x13')]['message']);return _0x2ef11c(_0x587805[_0xace5('0x13')]['message']);}logger[_0xace5('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1c29b7,_0x587805[_0xace5('0x13')][_0xace5('0x14')]);return _0x5322a3(_0x587805[_0xace5('0x13')]['message']);}else{logger[_0xace5('0xc')](_0xace5('0xd'),_0x1c29b7,_0xace5('0xe'));_0x5322a3(_0x587805[_0xace5('0x15')]['message']);}})['catch'](function(_0x3abcf1){logger[_0xace5('0x13')](_0xace5('0xd'),_0x1c29b7,_0x3abcf1);_0x2ef11c(_0x3abcf1);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 5a3fa9a..1dda60e 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(_0x49e1c5,_0x1f4a4f){var _0x576240=function(_0x1f5672){while(--_0x1f5672){_0x49e1c5['push'](_0x49e1c5['shift']());}};_0x576240(++_0x1f4a4f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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(_0x4db4e5,_0x1e1289){var _0xc7329c=function(_0x59e3f7){while(--_0x59e3f7){_0x4db4e5['push'](_0x4db4e5['shift']());}};_0xc7329c(++_0x1e1289);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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 9ba3997..67362ee 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 _0x851a=['STRING','name','TEXT','sequelize'];(function(_0x35fabd,_0x825452){var _0x61a8ee=function(_0x218f4c){while(--_0x218f4c){_0x35fabd['push'](_0x35fabd['shift']());}};_0x61a8ee(++_0x825452);}(_0x851a,0x19b));var _0xa851=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x851a[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0xa851('0x0'));module['exports']={'name':{'type':Sequelize[_0xa851('0x1')],'allowNull':![],'unique':_0xa851('0x2')},'table':{'type':Sequelize[_0xa851('0x1')]},'metric':{'type':Sequelize[_0xa851('0x3')]},'description':{'type':Sequelize[_0xa851('0x1')]}}; \ No newline at end of file +var _0xcecc=['sequelize','STRING','TEXT'];(function(_0x4a944e,_0x4143d8){var _0x1da079=function(_0x425393){while(--_0x425393){_0x4a944e['push'](_0x4a944e['shift']());}};_0x1da079(++_0x4143d8);}(_0xcecc,0x186));var _0xccec=function(_0x2f146c,_0x1ecc99){_0x2f146c=_0x2f146c-0x0;var _0x11fccd=_0xcecc[_0x2f146c];return _0x11fccd;};'use strict';var Sequelize=require(_0xccec('0x0'));module['exports']={'name':{'type':Sequelize[_0xccec('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xccec('0x2')]},'description':{'type':Sequelize[_0xccec('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 2f8f7b1..18b12e3 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 _0x6aa7=['json','apply','reject','save','update','then','destroy','get','Metrics','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','catch','error','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','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','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range'];(function(_0xa1e3ca,_0x559022){var _0x5005ab=function(_0x12f90e){while(--_0x12f90e){_0xa1e3ca['push'](_0xa1e3ca['shift']());}};_0x5005ab(++_0x559022);}(_0x6aa7,0x178));var _0x76aa=function(_0x56d9a7,_0xd18b64){_0x56d9a7=_0x56d9a7-0x0;var _0x39b910=_0x6aa7[_0x56d9a7];return _0x39b910;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x112c39,_0x5df49c){_0x5df49c=_0x5df49c||0xcc;return function(_0x226536){if(_0x226536){return _0x112c39[_0x76aa('0x19')](_0x5df49c);}return _0x112c39[_0x76aa('0x1a')](_0x5df49c)[_0x76aa('0x1b')]();};}function respondWithResult(_0x10432c,_0x4e309f){_0x4e309f=_0x4e309f||0xc8;return function(_0x5f5b59){if(_0x5f5b59){return _0x10432c[_0x76aa('0x1a')](_0x4e309f)['json'](_0x5f5b59);}};}function respondWithFilteredResult(_0x180d92,_0x319bf1){return function(_0x5cf594){if(_0x5cf594){var _0x2111c7=typeof _0x319bf1['offset']===_0x76aa('0x1c')&&typeof _0x319bf1['limit']===_0x76aa('0x1c');var _0x413cf6=_0x5cf594[_0x76aa('0x1d')];var _0x21c16d=_0x2111c7?0x0:_0x319bf1[_0x76aa('0x1e')];var _0x3ead3f=_0x2111c7?_0x5cf594['count']:_0x319bf1['offset']+_0x319bf1[_0x76aa('0x1f')];var _0x454dd3;if(_0x3ead3f>=_0x413cf6){_0x3ead3f=_0x413cf6;_0x454dd3=0xc8;}else{_0x454dd3=0xce;}_0x180d92[_0x76aa('0x1a')](_0x454dd3);return _0x180d92[_0x76aa('0x20')](_0x76aa('0x21'),_0x21c16d+'-'+_0x3ead3f+'/'+_0x413cf6)[_0x76aa('0x22')](_0x5cf594);}return null;};}function patchUpdates(_0x19af92){return function(_0x2eaf48){try{jsonpatch[_0x76aa('0x23')](_0x2eaf48,_0x19af92,!![]);}catch(_0x5990c1){return BPromise[_0x76aa('0x24')](_0x5990c1);}return _0x2eaf48[_0x76aa('0x25')]();};}function saveUpdates(_0x338a6b,_0x5b3f55){return function(_0x41463a){if(_0x41463a){return _0x41463a[_0x76aa('0x26')](_0x338a6b)[_0x76aa('0x27')](function(_0x2bd2c6){return _0x2bd2c6;});}return null;};}function removeEntity(_0x29c50c,_0xc1044c){return function(_0x3cd039){if(_0x3cd039){return _0x3cd039[_0x76aa('0x28')]()[_0x76aa('0x27')](function(){var _0x2cba6d=_0x3cd039[_0x76aa('0x29')]({'plain':!![]});var _0x26b75e=_0x76aa('0x2a');return db['UserProfileResource'][_0x76aa('0x28')]({'where':{'type':_0x26b75e,'resourceId':_0x2cba6d['id']}})[_0x76aa('0x27')](function(){return _0x3cd039;});})[_0x76aa('0x27')](function(){_0x29c50c[_0x76aa('0x1a')](0xcc)[_0x76aa('0x1b')]();});}};}function handleEntityNotFound(_0x2f9316,_0x25a803){return function(_0x282d0a){if(!_0x282d0a){_0x2f9316[_0x76aa('0x19')](0x194);}return _0x282d0a;};}function handleError(_0x1bdc3d,_0x545b06){_0x545b06=_0x545b06||0x1f4;return function(_0x3fcb7f){logger['error'](_0x3fcb7f[_0x76aa('0x2b')]);if(_0x3fcb7f[_0x76aa('0x2c')]){delete _0x3fcb7f[_0x76aa('0x2c')];}_0x1bdc3d[_0x76aa('0x1a')](_0x545b06)[_0x76aa('0x2d')](_0x3fcb7f);};}exports[_0x76aa('0x2e')]=function(_0x2ee0f9,_0x3827ec){var _0x19fd4f={},_0x3ea05a={},_0x5edcd8={'count':0x0,'rows':[]};var _0x430ad6=_[_0x76aa('0x2f')](db[_0x76aa('0x30')][_0x76aa('0x31')],function(_0x458ac3){return{'name':_0x458ac3[_0x76aa('0x32')],'type':_0x458ac3[_0x76aa('0x33')]['key']};});_0x3ea05a[_0x76aa('0x34')]=_[_0x76aa('0x2f')](_0x430ad6,'name');_0x3ea05a[_0x76aa('0x35')]=_['keys'](_0x2ee0f9[_0x76aa('0x35')]);_0x3ea05a['filters']=_[_0x76aa('0x36')](_0x3ea05a['model'],_0x3ea05a['query']);_0x19fd4f[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x3ea05a[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x2ee0f9['query']['fields']));_0x19fd4f[_0x76aa('0x37')]=_0x19fd4f[_0x76aa('0x37')][_0x76aa('0x39')]?_0x19fd4f[_0x76aa('0x37')]:_0x3ea05a[_0x76aa('0x34')];if(!_0x2ee0f9['query'][_0x76aa('0x3a')]('nolimit')){_0x19fd4f['limit']=qs[_0x76aa('0x1f')](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1f')]);_0x19fd4f[_0x76aa('0x1e')]=qs['offset'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1e')]);}_0x19fd4f[_0x76aa('0x3b')]=qs['sort'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x3c')]);_0x19fd4f[_0x76aa('0x3d')]=qs[_0x76aa('0x3e')](_[_0x76aa('0x3f')](_0x2ee0f9[_0x76aa('0x35')],_0x3ea05a[_0x76aa('0x3e')]),_0x430ad6);if(_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]){_0x19fd4f['where']=_[_0x76aa('0x41')](_0x19fd4f[_0x76aa('0x3d')],{'$or':_[_0x76aa('0x2f')](_0x430ad6,function(_0xa824e8){if(_0xa824e8[_0x76aa('0x33')]!==_0x76aa('0x42')){var _0x572fdb={};_0x572fdb[_0xa824e8['name']]={'$like':'%'+_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]+'%'};return _0x572fdb;}})});}_0x19fd4f=_[_0x76aa('0x41')]({},_0x19fd4f,_0x2ee0f9[_0x76aa('0x43')]);var _0x50599f={'where':_0x19fd4f[_0x76aa('0x3d')]};return db[_0x76aa('0x30')][_0x76aa('0x1d')](_0x50599f)[_0x76aa('0x27')](function(_0x1138b5){_0x5edcd8['count']=_0x1138b5;if(_0x2ee0f9[_0x76aa('0x35')]['includeAll']){_0x19fd4f[_0x76aa('0x44')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x19fd4f);})['then'](function(_0x144f0a){_0x5edcd8['rows']=_0x144f0a;return _0x5edcd8;})['then'](respondWithFilteredResult(_0x3827ec,_0x19fd4f))['catch'](handleError(_0x3827ec,null));};exports[_0x76aa('0x45')]=function(_0x3fd153,_0x116dc5){var _0x2c0744={'raw':!![],'where':{'id':_0x3fd153['params']['id']}},_0x27a52e={};_0x27a52e[_0x76aa('0x34')]=_[_0x76aa('0x46')](db[_0x76aa('0x30')][_0x76aa('0x31')]);_0x27a52e[_0x76aa('0x35')]=_['keys'](_0x3fd153[_0x76aa('0x35')]);_0x27a52e[_0x76aa('0x3e')]=_['intersection'](_0x27a52e[_0x76aa('0x34')],_0x27a52e['query']);_0x2c0744[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x27a52e[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x3fd153[_0x76aa('0x35')][_0x76aa('0x38')]));_0x2c0744[_0x76aa('0x37')]=_0x2c0744[_0x76aa('0x37')][_0x76aa('0x39')]?_0x2c0744[_0x76aa('0x37')]:_0x27a52e['model'];if(_0x3fd153[_0x76aa('0x35')]['includeAll']){_0x2c0744[_0x76aa('0x44')]=[{'all':!![]}];}_0x2c0744=_[_0x76aa('0x41')]({},_0x2c0744,_0x3fd153[_0x76aa('0x43')]);return db[_0x76aa('0x30')]['find'](_0x2c0744)['then'](handleEntityNotFound(_0x116dc5,null))[_0x76aa('0x27')](respondWithResult(_0x116dc5,null))['catch'](handleError(_0x116dc5,null));};exports[_0x76aa('0x47')]=function(_0x302a0c,_0x4315b3){return db[_0x76aa('0x30')][_0x76aa('0x47')](_0x302a0c[_0x76aa('0x48')],{})['then'](function(_0x564546){var _0x2fcf8f=_0x302a0c[_0x76aa('0x49')][_0x76aa('0x29')]({'plain':!![]});if(!_0x2fcf8f)throw new Error(_0x76aa('0x4a'));if(_0x2fcf8f[_0x76aa('0x4b')]===_0x76aa('0x49')){var _0x4c52d5=_0x564546[_0x76aa('0x29')]({'plain':!![]});var _0x2d631e=_0x76aa('0x2a');return db['UserProfileSection'][_0x76aa('0x4c')]({'where':{'name':_0x2d631e,'userProfileId':_0x2fcf8f['userProfileId']},'raw':!![]})[_0x76aa('0x27')](function(_0x5e1d84){if(_0x5e1d84&&_0x5e1d84[_0x76aa('0x4d')]===0x0){return db[_0x76aa('0x4e')][_0x76aa('0x47')]({'name':_0x4c52d5[_0x76aa('0x2c')],'resourceId':_0x4c52d5['id'],'type':_0x5e1d84[_0x76aa('0x2c')],'sectionId':_0x5e1d84['id']},{})[_0x76aa('0x27')](function(){return _0x564546;});}else{return _0x564546;}})[_0x76aa('0x4f')](function(_0x4f2c2b){logger[_0x76aa('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f2c2b);throw _0x4f2c2b;});}return _0x564546;})[_0x76aa('0x27')](respondWithResult(_0x4315b3,0xc9))[_0x76aa('0x4f')](handleError(_0x4315b3,null));};exports[_0x76aa('0x26')]=function(_0x53be10,_0x3fa7ec){if(_0x53be10[_0x76aa('0x48')]['id']){delete _0x53be10[_0x76aa('0x48')]['id'];}return db['AnalyticMetric'][_0x76aa('0x4c')]({'where':{'id':_0x53be10[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x3fa7ec,null))[_0x76aa('0x27')](saveUpdates(_0x53be10['body'],null))[_0x76aa('0x27')](respondWithResult(_0x3fa7ec,null))[_0x76aa('0x4f')](handleError(_0x3fa7ec,null));};exports[_0x76aa('0x28')]=function(_0x410933,_0x2027f8){return db[_0x76aa('0x30')]['find']({'where':{'id':_0x410933[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x2027f8,null))[_0x76aa('0x27')](removeEntity(_0x2027f8,null))[_0x76aa('0x4f')](handleError(_0x2027f8,null));}; \ No newline at end of file +var _0x8ef6=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','index','map','fieldName','key','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','options','AnalyticMetric','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3a1b5f,_0xdd8290){var _0x12c585=function(_0x30626e){while(--_0x30626e){_0x3a1b5f['push'](_0x3a1b5f['shift']());}};_0x12c585(++_0xdd8290);}(_0x8ef6,0xf2));var _0x68ef=function(_0x5f031a,_0x5c070f){_0x5f031a=_0x5f031a-0x0;var _0x4da4ca=_0x8ef6[_0x5f031a];return _0x4da4ca;};'use strict';var emlformat=require(_0x68ef('0x0'));var rimraf=require(_0x68ef('0x1'));var zipdir=require(_0x68ef('0x2'));var jsonpatch=require(_0x68ef('0x3'));var rp=require(_0x68ef('0x4'));var moment=require(_0x68ef('0x5'));var BPromise=require(_0x68ef('0x6'));var Mustache=require('mustache');var util=require(_0x68ef('0x7'));var path=require(_0x68ef('0x8'));var sox=require(_0x68ef('0x9'));var csv=require(_0x68ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xa'));var querystring=require(_0x68ef('0xf'));var Papa=require(_0x68ef('0x10'));var Redis=require(_0x68ef('0x11'));var authService=require(_0x68ef('0x12'));var qs=require(_0x68ef('0x13'));var as=require(_0x68ef('0x14'));var hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x68ef('0x19'));var db=require(_0x68ef('0x1a'))['db'];function respondWithStatusCode(_0x1e117a,_0x454ef4){_0x454ef4=_0x454ef4||0xcc;return function(_0x40f253){if(_0x40f253){return _0x1e117a[_0x68ef('0x1b')](_0x454ef4);}return _0x1e117a['status'](_0x454ef4)[_0x68ef('0x1c')]();};}function respondWithResult(_0xc50cce,_0x2657c5){_0x2657c5=_0x2657c5||0xc8;return function(_0x47fbb5){if(_0x47fbb5){return _0xc50cce[_0x68ef('0x1d')](_0x2657c5)[_0x68ef('0x1e')](_0x47fbb5);}};}function respondWithFilteredResult(_0x24682d,_0x5005ba){return function(_0x35493d){if(_0x35493d){var _0x37c4cc=typeof _0x5005ba[_0x68ef('0x1f')]===_0x68ef('0x20')&&typeof _0x5005ba['limit']===_0x68ef('0x20');var _0x54139e=_0x35493d['count'];var _0x2633c1=_0x37c4cc?0x0:_0x5005ba[_0x68ef('0x1f')];var _0x4ade0d=_0x37c4cc?_0x35493d['count']:_0x5005ba[_0x68ef('0x1f')]+_0x5005ba[_0x68ef('0x21')];var _0x318514;if(_0x4ade0d>=_0x54139e){_0x4ade0d=_0x54139e;_0x318514=0xc8;}else{_0x318514=0xce;}_0x24682d['status'](_0x318514);return _0x24682d[_0x68ef('0x22')](_0x68ef('0x23'),_0x2633c1+'-'+_0x4ade0d+'/'+_0x54139e)[_0x68ef('0x1e')](_0x35493d);}return null;};}function patchUpdates(_0x5b246b){return function(_0x3c46d4){try{jsonpatch[_0x68ef('0x24')](_0x3c46d4,_0x5b246b,!![]);}catch(_0x5af19f){return BPromise[_0x68ef('0x25')](_0x5af19f);}return _0x3c46d4[_0x68ef('0x26')]();};}function saveUpdates(_0x19aa3d,_0x5ddec7){return function(_0x59723c){if(_0x59723c){return _0x59723c['update'](_0x19aa3d)[_0x68ef('0x27')](function(_0x2023f2){return _0x2023f2;});}return null;};}function removeEntity(_0x312cc9,_0x2e6e39){return function(_0x438b4c){if(_0x438b4c){return _0x438b4c[_0x68ef('0x28')]()[_0x68ef('0x27')](function(){var _0x49374f=_0x438b4c[_0x68ef('0x29')]({'plain':!![]});var _0x13280b='Metrics';return db[_0x68ef('0x2a')]['destroy']({'where':{'type':_0x13280b,'resourceId':_0x49374f['id']}})['then'](function(){return _0x438b4c;});})['then'](function(){_0x312cc9[_0x68ef('0x1d')](0xcc)[_0x68ef('0x1c')]();});}};}function handleEntityNotFound(_0x123041,_0x29518e){return function(_0x52e67e){if(!_0x52e67e){_0x123041['sendStatus'](0x194);}return _0x52e67e;};}function handleError(_0x1cbe4f,_0x28907a){_0x28907a=_0x28907a||0x1f4;return function(_0x7bf96){logger[_0x68ef('0x2b')](_0x7bf96[_0x68ef('0x2c')]);if(_0x7bf96[_0x68ef('0x2d')]){delete _0x7bf96[_0x68ef('0x2d')];}_0x1cbe4f[_0x68ef('0x1d')](_0x28907a)['send'](_0x7bf96);};}exports[_0x68ef('0x2e')]=function(_0x4314bd,_0x132d9e){var _0x4c25aa={},_0x370a8f={},_0x523120={'count':0x0,'rows':[]};var _0x133788=_[_0x68ef('0x2f')](db['AnalyticMetric']['rawAttributes'],function(_0x159395){return{'name':_0x159395[_0x68ef('0x30')],'type':_0x159395['type'][_0x68ef('0x31')]};});_0x370a8f[_0x68ef('0x32')]=_[_0x68ef('0x2f')](_0x133788,_0x68ef('0x2d'));_0x370a8f['query']=_[_0x68ef('0x33')](_0x4314bd[_0x68ef('0x34')]);_0x370a8f['filters']=_[_0x68ef('0x35')](_0x370a8f['model'],_0x370a8f[_0x68ef('0x34')]);_0x4c25aa[_0x68ef('0x36')]=_['intersection'](_0x370a8f[_0x68ef('0x32')],qs['fields'](_0x4314bd[_0x68ef('0x34')]['fields']));_0x4c25aa[_0x68ef('0x36')]=_0x4c25aa[_0x68ef('0x36')][_0x68ef('0x37')]?_0x4c25aa['attributes']:_0x370a8f[_0x68ef('0x32')];if(!_0x4314bd['query'][_0x68ef('0x38')]('nolimit')){_0x4c25aa[_0x68ef('0x21')]=qs[_0x68ef('0x21')](_0x4314bd[_0x68ef('0x34')][_0x68ef('0x21')]);_0x4c25aa[_0x68ef('0x1f')]=qs[_0x68ef('0x1f')](_0x4314bd['query'][_0x68ef('0x1f')]);}_0x4c25aa[_0x68ef('0x39')]=qs[_0x68ef('0x3a')](_0x4314bd['query'][_0x68ef('0x3a')]);_0x4c25aa[_0x68ef('0x3b')]=qs[_0x68ef('0x3c')](_['pick'](_0x4314bd['query'],_0x370a8f[_0x68ef('0x3c')]),_0x133788);if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x3d')]){_0x4c25aa[_0x68ef('0x3b')]=_[_0x68ef('0x3e')](_0x4c25aa[_0x68ef('0x3b')],{'$or':_[_0x68ef('0x2f')](_0x133788,function(_0x5b1246){if(_0x5b1246[_0x68ef('0x3f')]!==_0x68ef('0x40')){var _0x2f6ee0={};_0x2f6ee0[_0x5b1246[_0x68ef('0x2d')]]={'$like':'%'+_0x4314bd['query'][_0x68ef('0x3d')]+'%'};return _0x2f6ee0;}})});}_0x4c25aa=_[_0x68ef('0x3e')]({},_0x4c25aa,_0x4314bd[_0x68ef('0x41')]);var _0x410c10={'where':_0x4c25aa[_0x68ef('0x3b')]};return db[_0x68ef('0x42')]['count'](_0x410c10)[_0x68ef('0x27')](function(_0x3f7699){_0x523120[_0x68ef('0x43')]=_0x3f7699;if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x44')]){_0x4c25aa[_0x68ef('0x45')]=[{'all':!![]}];}return db[_0x68ef('0x42')][_0x68ef('0x46')](_0x4c25aa);})[_0x68ef('0x27')](function(_0x531096){_0x523120[_0x68ef('0x47')]=_0x531096;return _0x523120;})[_0x68ef('0x27')](respondWithFilteredResult(_0x132d9e,_0x4c25aa))[_0x68ef('0x48')](handleError(_0x132d9e,null));};exports[_0x68ef('0x49')]=function(_0xdeacf2,_0x183377){var _0xcac58f={'raw':!![],'where':{'id':_0xdeacf2[_0x68ef('0x4a')]['id']}},_0x576767={};_0x576767['model']=_[_0x68ef('0x33')](db[_0x68ef('0x42')][_0x68ef('0x4b')]);_0x576767[_0x68ef('0x34')]=_['keys'](_0xdeacf2[_0x68ef('0x34')]);_0x576767['filters']=_[_0x68ef('0x35')](_0x576767['model'],_0x576767[_0x68ef('0x34')]);_0xcac58f[_0x68ef('0x36')]=_[_0x68ef('0x35')](_0x576767['model'],qs['fields'](_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x4c')]));_0xcac58f['attributes']=_0xcac58f['attributes']['length']?_0xcac58f[_0x68ef('0x36')]:_0x576767[_0x68ef('0x32')];if(_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x44')]){_0xcac58f[_0x68ef('0x45')]=[{'all':!![]}];}_0xcac58f=_['merge']({},_0xcac58f,_0xdeacf2['options']);return db[_0x68ef('0x42')][_0x68ef('0x4d')](_0xcac58f)[_0x68ef('0x27')](handleEntityNotFound(_0x183377,null))[_0x68ef('0x27')](respondWithResult(_0x183377,null))['catch'](handleError(_0x183377,null));};exports[_0x68ef('0x4e')]=function(_0x474e5a,_0x1c9b6f){return db[_0x68ef('0x42')]['create'](_0x474e5a['body'],{})[_0x68ef('0x27')](function(_0x3c3074){var _0x566e7c=_0x474e5a[_0x68ef('0x4f')][_0x68ef('0x29')]({'plain':!![]});if(!_0x566e7c)throw new Error(_0x68ef('0x50'));if(_0x566e7c[_0x68ef('0x51')]===_0x68ef('0x4f')){var _0x4f0f77=_0x3c3074[_0x68ef('0x29')]({'plain':!![]});var _0x3984ca=_0x68ef('0x52');return db['UserProfileSection'][_0x68ef('0x4d')]({'where':{'name':_0x3984ca,'userProfileId':_0x566e7c[_0x68ef('0x53')]},'raw':!![]})[_0x68ef('0x27')](function(_0x50ef1f){if(_0x50ef1f&&_0x50ef1f[_0x68ef('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x4f0f77[_0x68ef('0x2d')],'resourceId':_0x4f0f77['id'],'type':_0x50ef1f['name'],'sectionId':_0x50ef1f['id']},{})[_0x68ef('0x27')](function(){return _0x3c3074;});}else{return _0x3c3074;}})[_0x68ef('0x48')](function(_0x53ebd){logger[_0x68ef('0x2b')](_0x68ef('0x55'),_0x53ebd);throw _0x53ebd;});}return _0x3c3074;})[_0x68ef('0x27')](respondWithResult(_0x1c9b6f,0xc9))[_0x68ef('0x48')](handleError(_0x1c9b6f,null));};exports[_0x68ef('0x56')]=function(_0x2b35f4,_0x247915){if(_0x2b35f4['body']['id']){delete _0x2b35f4['body']['id'];}return db[_0x68ef('0x42')][_0x68ef('0x4d')]({'where':{'id':_0x2b35f4[_0x68ef('0x4a')]['id']}})[_0x68ef('0x27')](handleEntityNotFound(_0x247915,null))[_0x68ef('0x27')](saveUpdates(_0x2b35f4[_0x68ef('0x57')],null))[_0x68ef('0x27')](respondWithResult(_0x247915,null))[_0x68ef('0x48')](handleError(_0x247915,null));};exports[_0x68ef('0x28')]=function(_0x4c2e9c,_0x5685bb){return db[_0x68ef('0x42')]['find']({'where':{'id':_0x4c2e9c[_0x68ef('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5685bb,null))[_0x68ef('0x27')](removeEntity(_0x5685bb,null))[_0x68ef('0x48')](handleError(_0x5685bb,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index e7ccbbb..267d308 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 _0xbc1c=['path','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric','util','api','bluebird','request-promise'];(function(_0x52922a,_0x5d457f){var _0x21ca07=function(_0x5f31d9){while(--_0x5f31d9){_0x52922a['push'](_0x52922a['shift']());}};_0x21ca07(++_0x5d457f);}(_0xbc1c,0xd8));var _0xcbc1=function(_0x267d8d,_0xe90f65){_0x267d8d=_0x267d8d-0x0;var _0x11a98f=_0xbc1c[_0x267d8d];return _0x11a98f;};'use strict';var _=require('lodash');var util=require(_0xcbc1('0x0'));var logger=require('../../config/logger')(_0xcbc1('0x1'));var moment=require('moment');var BPromise=require(_0xcbc1('0x2'));var rp=require(_0xcbc1('0x3'));var fs=require('fs');var path=require(_0xcbc1('0x4'));var rimraf=require(_0xcbc1('0x5'));var config=require('../../config/environment');var attributes=require(_0xcbc1('0x6'));module[_0xcbc1('0x7')]=function(_0x54c13c,_0x27da8d){return _0x54c13c[_0xcbc1('0x8')](_0xcbc1('0x9'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4553=['rimraf','../../config/environment','./analyticMetric.attributes','exports','define','analytics_metrics','util','../../config/logger','api','request-promise','path'];(function(_0x5d3620,_0x34b31f){var _0x4723f5=function(_0xb8bf90){while(--_0xb8bf90){_0x5d3620['push'](_0x5d3620['shift']());}};_0x4723f5(++_0x34b31f);}(_0x4553,0x1be));var _0x3455=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x4553[_0x3c4737];return _0x2bb926;};'use strict';var _=require('lodash');var util=require(_0x3455('0x0'));var logger=require(_0x3455('0x1'))(_0x3455('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3455('0x3'));var fs=require('fs');var path=require(_0x3455('0x4'));var rimraf=require(_0x3455('0x5'));var config=require(_0x3455('0x6'));var attributes=require(_0x3455('0x7'));module[_0x3455('0x8')]=function(_0x2aa1ed,_0x4010cd){return _0x2aa1ed[_0x3455('0x9')]('AnalyticMetric',attributes,{'tableName':_0x3455('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 2aa3d33..deb001b 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 _0xaa03=['AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info'];(function(_0x1f286d,_0x190c4c){var _0x88842b=function(_0x198d36){while(--_0x198d36){_0x1f286d['push'](_0x1f286d['shift']());}};_0x88842b(++_0x190c4c);}(_0xaa03,0x13d));var _0x3aa0=function(_0x2f3fb3,_0x33100){_0x2f3fb3=_0x2f3fb3-0x0;var _0xed14fc=_0xaa03[_0x2f3fb3];return _0xed14fc;};'use strict';var _=require(_0x3aa0('0x0'));var util=require(_0x3aa0('0x1'));var moment=require(_0x3aa0('0x2'));var BPromise=require(_0x3aa0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3aa0('0x4'))['db'];var utils=require(_0x3aa0('0x5'));var logger=require(_0x3aa0('0x6'))(_0x3aa0('0x7'));var config=require(_0x3aa0('0x8'));var jayson=require(_0x3aa0('0x9'));var client=jayson[_0x3aa0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b9632,_0x134a39,_0x210ac9){return new BPromise(function(_0x4cc2d5,_0x59e424){return client['request'](_0x1b9632,_0x210ac9)[_0x3aa0('0xb')](function(_0x1396bf){logger[_0x3aa0('0xc')](_0x3aa0('0xd'),_0x134a39,_0x3aa0('0xe'));logger[_0x3aa0('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x134a39,'request\x20sent',JSON[_0x3aa0('0x10')](_0x1396bf));if(_0x1396bf[_0x3aa0('0x11')]){if(_0x1396bf[_0x3aa0('0x11')][_0x3aa0('0x12')]===0x1f4){logger['error'](_0x3aa0('0xd'),_0x134a39,_0x1396bf[_0x3aa0('0x11')]['message']);return _0x59e424(_0x1396bf[_0x3aa0('0x11')][_0x3aa0('0x13')]);}logger[_0x3aa0('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x134a39,_0x1396bf[_0x3aa0('0x11')][_0x3aa0('0x13')]);return _0x4cc2d5(_0x1396bf[_0x3aa0('0x11')][_0x3aa0('0x13')]);}else{logger[_0x3aa0('0xc')](_0x3aa0('0xd'),_0x134a39,_0x3aa0('0xe'));_0x4cc2d5(_0x1396bf[_0x3aa0('0x14')][_0x3aa0('0x13')]);}})[_0x3aa0('0x15')](function(_0x1a820b){logger[_0x3aa0('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x134a39,_0x1a820b);_0x59e424(_0x1a820b);});});} \ No newline at end of file +var _0x98ae=['request\x20sent','debug','stringify','error','code','message','result','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','AnalyticMetric,\x20%s,\x20%s'];(function(_0x5dc4ff,_0x5e2436){var _0x5478ab=function(_0x21f709){while(--_0x21f709){_0x5dc4ff['push'](_0x5dc4ff['shift']());}};_0x5478ab(++_0x5e2436);}(_0x98ae,0x79));var _0xe98a=function(_0x4fc00d,_0x325659){_0x4fc00d=_0x4fc00d-0x0;var _0x3a62c7=_0x98ae[_0x4fc00d];return _0x3a62c7;};'use strict';var _=require('lodash');var util=require(_0xe98a('0x0'));var moment=require(_0xe98a('0x1'));var BPromise=require('bluebird');var rs=require(_0xe98a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe98a('0x3'));var logger=require(_0xe98a('0x4'))(_0xe98a('0x5'));var config=require(_0xe98a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe98a('0x7')][_0xe98a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a7ccb,_0x33ea9c,_0x283e11){return new BPromise(function(_0x23613d,_0x3a534f){return client['request'](_0x4a7ccb,_0x283e11)[_0xe98a('0x9')](function(_0x40dca9){logger[_0xe98a('0xa')](_0xe98a('0xb'),_0x33ea9c,_0xe98a('0xc'));logger[_0xe98a('0xd')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x33ea9c,_0xe98a('0xc'),JSON[_0xe98a('0xe')](_0x40dca9));if(_0x40dca9['error']){if(_0x40dca9[_0xe98a('0xf')][_0xe98a('0x10')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x33ea9c,_0x40dca9[_0xe98a('0xf')]['message']);return _0x3a534f(_0x40dca9['error'][_0xe98a('0x11')]);}logger['error'](_0xe98a('0xb'),_0x33ea9c,_0x40dca9['error'][_0xe98a('0x11')]);return _0x23613d(_0x40dca9[_0xe98a('0xf')][_0xe98a('0x11')]);}else{logger['info'](_0xe98a('0xb'),_0x33ea9c,_0xe98a('0xc'));_0x23613d(_0x40dca9[_0xe98a('0x12')][_0xe98a('0x11')]);}})['catch'](function(_0x2c7517){logger[_0xe98a('0xf')](_0xe98a('0xb'),_0x33ea9c,_0x2c7517);_0x3a534f(_0x2c7517);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 603a25c..a3e059c 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 _0x0dec=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x406ce7,_0x2db8b1){var _0x557881=function(_0x3af7b7){while(--_0x3af7b7){_0x406ce7['push'](_0x406ce7['shift']());}};_0x557881(++_0x2db8b1);}(_0x0dec,0x11c));var _0xc0de=function(_0x4c23e8,_0x2cbe43){_0x4c23e8=_0x4c23e8-0x0;var _0x35f49a=_0x0dec[_0x4c23e8];return _0x35f49a;};'use strict';var multer=require(_0xc0de('0x0'));var util=require(_0xc0de('0x1'));var path=require(_0xc0de('0x2'));var timeout=require(_0xc0de('0x3'));var express=require('express');var router=express[_0xc0de('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc0de('0x5'));var config=require(_0xc0de('0x6'));var controller=require(_0xc0de('0x7'));router[_0xc0de('0x8')]('/',auth[_0xc0de('0x9')](),controller[_0xc0de('0xa')]);router[_0xc0de('0x8')](_0xc0de('0xb'),auth[_0xc0de('0x9')](),controller[_0xc0de('0xc')]);router[_0xc0de('0xd')]('/',auth[_0xc0de('0x9')](),controller[_0xc0de('0xe')]);router[_0xc0de('0xf')](_0xc0de('0xb'),auth[_0xc0de('0x9')](),controller[_0xc0de('0x10')]);router[_0xc0de('0x11')](_0xc0de('0xb'),auth[_0xc0de('0x9')](),controller[_0xc0de('0x12')]);module[_0xc0de('0x13')]=router; \ No newline at end of file +var _0xe314=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','index','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','util','path'];(function(_0x3e1572,_0x1b8ad4){var _0x136237=function(_0x5b4e4c){while(--_0x5b4e4c){_0x3e1572['push'](_0x3e1572['shift']());}};_0x136237(++_0x1b8ad4);}(_0xe314,0x7c));var _0x4e31=function(_0x2744c5,_0x3caacd){_0x2744c5=_0x2744c5-0x0;var _0x4d044b=_0xe314[_0x2744c5];return _0x4d044b;};'use strict';var multer=require('multer');var util=require(_0x4e31('0x0'));var path=require(_0x4e31('0x1'));var timeout=require(_0x4e31('0x2'));var express=require(_0x4e31('0x3'));var router=express[_0x4e31('0x4')]();var fs_extra=require(_0x4e31('0x5'));var auth=require(_0x4e31('0x6'));var interaction=require(_0x4e31('0x7'));var config=require(_0x4e31('0x8'));var controller=require(_0x4e31('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x4e31('0xa')]);router[_0x4e31('0xb')](_0x4e31('0xc'),auth[_0x4e31('0xd')](),controller[_0x4e31('0xe')]);router[_0x4e31('0xf')]('/',auth['isAuthenticated'](),controller[_0x4e31('0x10')]);router[_0x4e31('0x11')](_0x4e31('0xc'),auth[_0x4e31('0xd')](),controller['update']);router[_0x4e31('0x12')](_0x4e31('0xc'),auth[_0x4e31('0xd')](),controller[_0x4e31('0x13')]);module[_0x4e31('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 34cbf5e..86f50b6 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 _0x5fa7=['sequelize','TEXT'];(function(_0x3a9aec,_0x318f70){var _0x3e7fd6=function(_0x475604){while(--_0x475604){_0x3a9aec['push'](_0x3a9aec['shift']());}};_0x3e7fd6(++_0x318f70);}(_0x5fa7,0xa0));var _0x75fa=function(_0x277995,_0x1112b3){_0x277995=_0x277995-0x0;var _0x235320=_0x5fa7[_0x277995];return _0x235320;};'use strict';var Sequelize=require(_0x75fa('0x0'));module['exports']={'tree':{'type':Sequelize[_0x75fa('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x6327=['exports','TEXT','sequelize'];(function(_0x365a31,_0x542d3f){var _0xe860a5=function(_0x59a0c5){while(--_0x59a0c5){_0x365a31['push'](_0x365a31['shift']());}};_0xe860a5(++_0x542d3f);}(_0x6327,0x131));var _0x7632=function(_0x291d3f,_0x3ef99f){_0x291d3f=_0x291d3f-0x0;var _0x242080=_0x6327[_0x291d3f];return _0x242080;};'use strict';var Sequelize=require(_0x7632('0x0'));module[_0x7632('0x1')]={'tree':{'type':Sequelize[_0x7632('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index d8fb159..006fab6 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 _0x9ed7=['params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','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/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','sendStatus','error','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filter','where','VIRTUAL','options','includeAll','include','rows','catch','show'];(function(_0x3d2b52,_0x361713){var _0x4a2180=function(_0x30d93f){while(--_0x30d93f){_0x3d2b52['push'](_0x3d2b52['shift']());}};_0x4a2180(++_0x361713);}(_0x9ed7,0x17b));var _0x79ed=function(_0x476b00,_0x250877){_0x476b00=_0x476b00-0x0;var _0x44ec8e=_0x9ed7[_0x476b00];return _0x44ec8e;};'use strict';var emlformat=require(_0x79ed('0x0'));var rimraf=require(_0x79ed('0x1'));var zipdir=require(_0x79ed('0x2'));var jsonpatch=require(_0x79ed('0x3'));var rp=require(_0x79ed('0x4'));var moment=require(_0x79ed('0x5'));var BPromise=require(_0x79ed('0x6'));var Mustache=require(_0x79ed('0x7'));var util=require(_0x79ed('0x8'));var path=require('path');var sox=require(_0x79ed('0x9'));var csv=require('to-csv');var ejs=require(_0x79ed('0xa'));var fs=require('fs');var fs_extra=require(_0x79ed('0xb'));var _=require(_0x79ed('0xc'));var squel=require(_0x79ed('0xd'));var crypto=require(_0x79ed('0xe'));var jsforce=require(_0x79ed('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x79ed('0x10'));var querystring=require(_0x79ed('0x11'));var Papa=require('papaparse');var Redis=require(_0x79ed('0x12'));var authService=require(_0x79ed('0x13'));var qs=require(_0x79ed('0x14'));var as=require(_0x79ed('0x15'));var hardwareService=require(_0x79ed('0x16'));var logger=require(_0x79ed('0x17'))(_0x79ed('0x18'));var utils=require('../../config/utils');var config=require(_0x79ed('0x19'));var licenseUtil=require(_0x79ed('0x1a'));var db=require(_0x79ed('0x1b'))['db'];function respondWithStatusCode(_0x289110,_0x5b1950){_0x5b1950=_0x5b1950||0xcc;return function(_0x2629f0){if(_0x2629f0){return _0x289110['sendStatus'](_0x5b1950);}return _0x289110[_0x79ed('0x1c')](_0x5b1950)[_0x79ed('0x1d')]();};}function respondWithResult(_0x268bf4,_0x319194){_0x319194=_0x319194||0xc8;return function(_0x3f549b){if(_0x3f549b){return _0x268bf4[_0x79ed('0x1c')](_0x319194)[_0x79ed('0x1e')](_0x3f549b);}};}function respondWithFilteredResult(_0x2ff459,_0x5e4f2b){return function(_0x5d4a06){if(_0x5d4a06){var _0x2b3551=typeof _0x5e4f2b[_0x79ed('0x1f')]==='undefined'&&typeof _0x5e4f2b[_0x79ed('0x20')]===_0x79ed('0x21');var _0x1b7079=_0x5d4a06[_0x79ed('0x22')];var _0x5200f4=_0x2b3551?0x0:_0x5e4f2b['offset'];var _0x8ec1a6=_0x2b3551?_0x5d4a06[_0x79ed('0x22')]:_0x5e4f2b[_0x79ed('0x1f')]+_0x5e4f2b[_0x79ed('0x20')];var _0x56cb47;if(_0x8ec1a6>=_0x1b7079){_0x8ec1a6=_0x1b7079;_0x56cb47=0xc8;}else{_0x56cb47=0xce;}_0x2ff459[_0x79ed('0x1c')](_0x56cb47);return _0x2ff459['set'](_0x79ed('0x23'),_0x5200f4+'-'+_0x8ec1a6+'/'+_0x1b7079)[_0x79ed('0x1e')](_0x5d4a06);}return null;};}function patchUpdates(_0x5ac913){return function(_0xfa4bc3){try{jsonpatch['apply'](_0xfa4bc3,_0x5ac913,!![]);}catch(_0x585972){return BPromise[_0x79ed('0x24')](_0x585972);}return _0xfa4bc3[_0x79ed('0x25')]();};}function saveUpdates(_0x76b9f7,_0xe95aa9){return function(_0x5e0c22){if(_0x5e0c22){return _0x5e0c22[_0x79ed('0x26')](_0x76b9f7)[_0x79ed('0x27')](function(_0x28190f){return _0x28190f;});}return null;};}function removeEntity(_0x587aa7,_0x3f1270){return function(_0x3d560a){if(_0x3d560a){return _0x3d560a[_0x79ed('0x28')]()[_0x79ed('0x27')](function(){_0x587aa7[_0x79ed('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x364568,_0x519b19){return function(_0x482daa){if(!_0x482daa){_0x364568[_0x79ed('0x29')](0x194);}return _0x482daa;};}function handleError(_0x596298,_0x21d065){_0x21d065=_0x21d065||0x1f4;return function(_0x373a8c){logger[_0x79ed('0x2a')](_0x373a8c['stack']);if(_0x373a8c[_0x79ed('0x2b')]){delete _0x373a8c[_0x79ed('0x2b')];}_0x596298[_0x79ed('0x1c')](_0x21d065)[_0x79ed('0x2c')](_0x373a8c);};}exports['index']=function(_0x2e23af,_0x7421ca){var _0x4f3ef7={},_0x340b19={},_0xadfc32={'count':0x0,'rows':[]};var _0x2d4b37=_[_0x79ed('0x2d')](db[_0x79ed('0x2e')][_0x79ed('0x2f')],function(_0x87b03c){return{'name':_0x87b03c[_0x79ed('0x30')],'type':_0x87b03c[_0x79ed('0x31')][_0x79ed('0x32')]};});_0x340b19['model']=_['map'](_0x2d4b37,_0x79ed('0x2b'));_0x340b19[_0x79ed('0x33')]=_[_0x79ed('0x34')](_0x2e23af[_0x79ed('0x33')]);_0x340b19[_0x79ed('0x35')]=_[_0x79ed('0x36')](_0x340b19[_0x79ed('0x37')],_0x340b19[_0x79ed('0x33')]);_0x4f3ef7[_0x79ed('0x38')]=_[_0x79ed('0x36')](_0x340b19[_0x79ed('0x37')],qs[_0x79ed('0x39')](_0x2e23af[_0x79ed('0x33')]['fields']));_0x4f3ef7['attributes']=_0x4f3ef7['attributes'][_0x79ed('0x3a')]?_0x4f3ef7[_0x79ed('0x38')]:_0x340b19[_0x79ed('0x37')];if(!_0x2e23af[_0x79ed('0x33')][_0x79ed('0x3b')]('nolimit')){_0x4f3ef7[_0x79ed('0x20')]=qs[_0x79ed('0x20')](_0x2e23af[_0x79ed('0x33')]['limit']);_0x4f3ef7[_0x79ed('0x1f')]=qs[_0x79ed('0x1f')](_0x2e23af[_0x79ed('0x33')][_0x79ed('0x1f')]);}_0x4f3ef7[_0x79ed('0x3c')]=qs[_0x79ed('0x3d')](_0x2e23af[_0x79ed('0x33')][_0x79ed('0x3d')]);_0x4f3ef7['where']=qs[_0x79ed('0x35')](_['pick'](_0x2e23af[_0x79ed('0x33')],_0x340b19[_0x79ed('0x35')]),_0x2d4b37);if(_0x2e23af[_0x79ed('0x33')][_0x79ed('0x3e')]){_0x4f3ef7[_0x79ed('0x3f')]=_['merge'](_0x4f3ef7[_0x79ed('0x3f')],{'$or':_[_0x79ed('0x2d')](_0x2d4b37,function(_0x3aae23){if(_0x3aae23[_0x79ed('0x31')]!==_0x79ed('0x40')){var _0x2ef0c5={};_0x2ef0c5[_0x3aae23[_0x79ed('0x2b')]]={'$like':'%'+_0x2e23af[_0x79ed('0x33')]['filter']+'%'};return _0x2ef0c5;}})});}_0x4f3ef7=_['merge']({},_0x4f3ef7,_0x2e23af[_0x79ed('0x41')]);var _0x3ce6e1={'where':_0x4f3ef7[_0x79ed('0x3f')]};return db[_0x79ed('0x2e')][_0x79ed('0x22')](_0x3ce6e1)[_0x79ed('0x27')](function(_0xb400df){_0xadfc32[_0x79ed('0x22')]=_0xb400df;if(_0x2e23af[_0x79ed('0x33')][_0x79ed('0x42')]){_0x4f3ef7[_0x79ed('0x43')]=[{'all':!![]}];}return db[_0x79ed('0x2e')]['findAll'](_0x4f3ef7);})[_0x79ed('0x27')](function(_0x43d878){_0xadfc32[_0x79ed('0x44')]=_0x43d878;return _0xadfc32;})[_0x79ed('0x27')](respondWithFilteredResult(_0x7421ca,_0x4f3ef7))[_0x79ed('0x45')](handleError(_0x7421ca,null));};exports[_0x79ed('0x46')]=function(_0x48f33b,_0x11de8b){var _0x3012b6={'raw':!![],'where':{'id':_0x48f33b[_0x79ed('0x47')]['id']}},_0xace129={};_0xace129[_0x79ed('0x37')]=_['keys'](db[_0x79ed('0x2e')]['rawAttributes']);_0xace129[_0x79ed('0x33')]=_['keys'](_0x48f33b[_0x79ed('0x33')]);_0xace129[_0x79ed('0x35')]=_[_0x79ed('0x36')](_0xace129[_0x79ed('0x37')],_0xace129[_0x79ed('0x33')]);_0x3012b6[_0x79ed('0x38')]=_[_0x79ed('0x36')](_0xace129[_0x79ed('0x37')],qs[_0x79ed('0x39')](_0x48f33b['query']['fields']));_0x3012b6[_0x79ed('0x38')]=_0x3012b6[_0x79ed('0x38')][_0x79ed('0x3a')]?_0x3012b6[_0x79ed('0x38')]:_0xace129[_0x79ed('0x37')];if(_0x48f33b[_0x79ed('0x33')]['includeAll']){_0x3012b6[_0x79ed('0x43')]=[{'all':!![]}];}_0x3012b6=_['merge']({},_0x3012b6,_0x48f33b['options']);return db['AnalyticTreeReport'][_0x79ed('0x48')](_0x3012b6)[_0x79ed('0x27')](handleEntityNotFound(_0x11de8b,null))[_0x79ed('0x27')](respondWithResult(_0x11de8b,null))['catch'](handleError(_0x11de8b,null));};exports[_0x79ed('0x49')]=function(_0x26aa56,_0x133990){return db['AnalyticTreeReport'][_0x79ed('0x49')](_0x26aa56[_0x79ed('0x4a')],{})[_0x79ed('0x27')](respondWithResult(_0x133990,0xc9))[_0x79ed('0x45')](handleError(_0x133990,null));};exports[_0x79ed('0x26')]=function(_0x12c69b,_0x15ac71){if(_0x12c69b[_0x79ed('0x4a')]['id']){delete _0x12c69b['body']['id'];}return db['AnalyticTreeReport'][_0x79ed('0x48')]({'where':{'id':_0x12c69b[_0x79ed('0x47')]['id']}})[_0x79ed('0x27')](handleEntityNotFound(_0x15ac71,null))[_0x79ed('0x27')](saveUpdates(_0x12c69b[_0x79ed('0x4a')],null))['then'](respondWithResult(_0x15ac71,null))[_0x79ed('0x45')](handleError(_0x15ac71,null));};exports[_0x79ed('0x28')]=function(_0x710e65,_0x2ea0ba){return db['AnalyticTreeReport']['find']({'where':{'id':_0x710e65['params']['id']}})[_0x79ed('0x27')](handleEntityNotFound(_0x2ea0ba,null))['then'](removeEntity(_0x2ea0ba,null))[_0x79ed('0x45')](handleError(_0x2ea0ba,null));}; \ No newline at end of file +var _0x0f63=['include','findAll','catch','show','params','options','find','body','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','includeAll'];(function(_0x1d6dea,_0x1f8978){var _0x1b5967=function(_0x4a95f6){while(--_0x4a95f6){_0x1d6dea['push'](_0x1d6dea['shift']());}};_0x1b5967(++_0x1f8978);}(_0x0f63,0xe6));var _0x30f6=function(_0x5b6f43,_0x2f5d8a){_0x5b6f43=_0x5b6f43-0x0;var _0x3d0477=_0x0f63[_0x5b6f43];return _0x3d0477;};'use strict';var emlformat=require(_0x30f6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x30f6('0x1'));var rp=require(_0x30f6('0x2'));var moment=require('moment');var BPromise=require(_0x30f6('0x3'));var Mustache=require(_0x30f6('0x4'));var util=require(_0x30f6('0x5'));var path=require('path');var sox=require(_0x30f6('0x6'));var csv=require(_0x30f6('0x7'));var ejs=require(_0x30f6('0x8'));var fs=require('fs');var fs_extra=require(_0x30f6('0x9'));var _=require(_0x30f6('0xa'));var squel=require(_0x30f6('0xb'));var crypto=require(_0x30f6('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x30f6('0x7'));var querystring=require('querystring');var Papa=require(_0x30f6('0xd'));var Redis=require(_0x30f6('0xe'));var authService=require(_0x30f6('0xf'));var qs=require(_0x30f6('0x10'));var as=require(_0x30f6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x30f6('0x12'))(_0x30f6('0x13'));var utils=require(_0x30f6('0x14'));var config=require(_0x30f6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x30f6('0x16'))['db'];function respondWithStatusCode(_0x1cd36,_0x2df3a2){_0x2df3a2=_0x2df3a2||0xcc;return function(_0x26fc11){if(_0x26fc11){return _0x1cd36[_0x30f6('0x17')](_0x2df3a2);}return _0x1cd36[_0x30f6('0x18')](_0x2df3a2)[_0x30f6('0x19')]();};}function respondWithResult(_0x1efffe,_0x5c7b1a){_0x5c7b1a=_0x5c7b1a||0xc8;return function(_0x23197f){if(_0x23197f){return _0x1efffe[_0x30f6('0x18')](_0x5c7b1a)['json'](_0x23197f);}};}function respondWithFilteredResult(_0x1b5526,_0x3ae331){return function(_0x79999b){if(_0x79999b){var _0x3f2a5b=typeof _0x3ae331['offset']===_0x30f6('0x1a')&&typeof _0x3ae331['limit']===_0x30f6('0x1a');var _0x106ffc=_0x79999b['count'];var _0x3b6d8b=_0x3f2a5b?0x0:_0x3ae331[_0x30f6('0x1b')];var _0x3b06cb=_0x3f2a5b?_0x79999b[_0x30f6('0x1c')]:_0x3ae331[_0x30f6('0x1b')]+_0x3ae331['limit'];var _0x425f54;if(_0x3b06cb>=_0x106ffc){_0x3b06cb=_0x106ffc;_0x425f54=0xc8;}else{_0x425f54=0xce;}_0x1b5526[_0x30f6('0x18')](_0x425f54);return _0x1b5526[_0x30f6('0x1d')](_0x30f6('0x1e'),_0x3b6d8b+'-'+_0x3b06cb+'/'+_0x106ffc)[_0x30f6('0x1f')](_0x79999b);}return null;};}function patchUpdates(_0x5dec7){return function(_0x533ae2){try{jsonpatch[_0x30f6('0x20')](_0x533ae2,_0x5dec7,!![]);}catch(_0x546c61){return BPromise[_0x30f6('0x21')](_0x546c61);}return _0x533ae2[_0x30f6('0x22')]();};}function saveUpdates(_0xced398,_0x20e7c2){return function(_0x56e2d1){if(_0x56e2d1){return _0x56e2d1[_0x30f6('0x23')](_0xced398)[_0x30f6('0x24')](function(_0x585dea){return _0x585dea;});}return null;};}function removeEntity(_0x410b4c,_0x26888f){return function(_0x313d85){if(_0x313d85){return _0x313d85[_0x30f6('0x25')]()['then'](function(){_0x410b4c[_0x30f6('0x18')](0xcc)[_0x30f6('0x19')]();});}};}function handleEntityNotFound(_0x5c832b,_0x2cb456){return function(_0x2ec3a8){if(!_0x2ec3a8){_0x5c832b[_0x30f6('0x17')](0x194);}return _0x2ec3a8;};}function handleError(_0x37ddc9,_0x59bb4d){_0x59bb4d=_0x59bb4d||0x1f4;return function(_0x26c04d){logger['error'](_0x26c04d[_0x30f6('0x26')]);if(_0x26c04d[_0x30f6('0x27')]){delete _0x26c04d[_0x30f6('0x27')];}_0x37ddc9[_0x30f6('0x18')](_0x59bb4d)[_0x30f6('0x28')](_0x26c04d);};}exports[_0x30f6('0x29')]=function(_0x410ac9,_0x41ef76){var _0x1ad26a={},_0x237d77={},_0x378cb5={'count':0x0,'rows':[]};var _0x2640b2=_['map'](db[_0x30f6('0x2a')][_0x30f6('0x2b')],function(_0x381c1c){return{'name':_0x381c1c[_0x30f6('0x2c')],'type':_0x381c1c[_0x30f6('0x2d')][_0x30f6('0x2e')]};});_0x237d77[_0x30f6('0x2f')]=_[_0x30f6('0x30')](_0x2640b2,_0x30f6('0x27'));_0x237d77['query']=_[_0x30f6('0x31')](_0x410ac9[_0x30f6('0x32')]);_0x237d77[_0x30f6('0x33')]=_[_0x30f6('0x34')](_0x237d77['model'],_0x237d77[_0x30f6('0x32')]);_0x1ad26a[_0x30f6('0x35')]=_[_0x30f6('0x34')](_0x237d77[_0x30f6('0x2f')],qs[_0x30f6('0x36')](_0x410ac9[_0x30f6('0x32')][_0x30f6('0x36')]));_0x1ad26a['attributes']=_0x1ad26a[_0x30f6('0x35')][_0x30f6('0x37')]?_0x1ad26a[_0x30f6('0x35')]:_0x237d77[_0x30f6('0x2f')];if(!_0x410ac9['query'][_0x30f6('0x38')](_0x30f6('0x39'))){_0x1ad26a[_0x30f6('0x3a')]=qs[_0x30f6('0x3a')](_0x410ac9[_0x30f6('0x32')]['limit']);_0x1ad26a[_0x30f6('0x1b')]=qs[_0x30f6('0x1b')](_0x410ac9[_0x30f6('0x32')][_0x30f6('0x1b')]);}_0x1ad26a[_0x30f6('0x3b')]=qs[_0x30f6('0x3c')](_0x410ac9[_0x30f6('0x32')]['sort']);_0x1ad26a[_0x30f6('0x3d')]=qs[_0x30f6('0x33')](_['pick'](_0x410ac9[_0x30f6('0x32')],_0x237d77[_0x30f6('0x33')]),_0x2640b2);if(_0x410ac9['query'][_0x30f6('0x3e')]){_0x1ad26a[_0x30f6('0x3d')]=_[_0x30f6('0x3f')](_0x1ad26a[_0x30f6('0x3d')],{'$or':_['map'](_0x2640b2,function(_0x265a78){if(_0x265a78[_0x30f6('0x2d')]!==_0x30f6('0x40')){var _0x546da7={};_0x546da7[_0x265a78[_0x30f6('0x27')]]={'$like':'%'+_0x410ac9[_0x30f6('0x32')][_0x30f6('0x3e')]+'%'};return _0x546da7;}})});}_0x1ad26a=_['merge']({},_0x1ad26a,_0x410ac9['options']);var _0x22f4c7={'where':_0x1ad26a['where']};return db[_0x30f6('0x2a')][_0x30f6('0x1c')](_0x22f4c7)[_0x30f6('0x24')](function(_0x3f137a){_0x378cb5[_0x30f6('0x1c')]=_0x3f137a;if(_0x410ac9['query'][_0x30f6('0x41')]){_0x1ad26a[_0x30f6('0x42')]=[{'all':!![]}];}return db[_0x30f6('0x2a')][_0x30f6('0x43')](_0x1ad26a);})['then'](function(_0x202466){_0x378cb5['rows']=_0x202466;return _0x378cb5;})[_0x30f6('0x24')](respondWithFilteredResult(_0x41ef76,_0x1ad26a))[_0x30f6('0x44')](handleError(_0x41ef76,null));};exports[_0x30f6('0x45')]=function(_0x43fb71,_0x5bbeaa){var _0x665b73={'raw':!![],'where':{'id':_0x43fb71[_0x30f6('0x46')]['id']}},_0x2924fe={};_0x2924fe[_0x30f6('0x2f')]=_[_0x30f6('0x31')](db['AnalyticTreeReport'][_0x30f6('0x2b')]);_0x2924fe[_0x30f6('0x32')]=_['keys'](_0x43fb71[_0x30f6('0x32')]);_0x2924fe['filters']=_[_0x30f6('0x34')](_0x2924fe['model'],_0x2924fe['query']);_0x665b73['attributes']=_[_0x30f6('0x34')](_0x2924fe['model'],qs['fields'](_0x43fb71[_0x30f6('0x32')][_0x30f6('0x36')]));_0x665b73[_0x30f6('0x35')]=_0x665b73[_0x30f6('0x35')][_0x30f6('0x37')]?_0x665b73[_0x30f6('0x35')]:_0x2924fe['model'];if(_0x43fb71[_0x30f6('0x32')][_0x30f6('0x41')]){_0x665b73[_0x30f6('0x42')]=[{'all':!![]}];}_0x665b73=_[_0x30f6('0x3f')]({},_0x665b73,_0x43fb71[_0x30f6('0x47')]);return db[_0x30f6('0x2a')][_0x30f6('0x48')](_0x665b73)[_0x30f6('0x24')](handleEntityNotFound(_0x5bbeaa,null))[_0x30f6('0x24')](respondWithResult(_0x5bbeaa,null))['catch'](handleError(_0x5bbeaa,null));};exports['create']=function(_0x40cef8,_0x16b49a){return db[_0x30f6('0x2a')]['create'](_0x40cef8[_0x30f6('0x49')],{})['then'](respondWithResult(_0x16b49a,0xc9))[_0x30f6('0x44')](handleError(_0x16b49a,null));};exports[_0x30f6('0x23')]=function(_0x23d09a,_0x3e7ed8){if(_0x23d09a['body']['id']){delete _0x23d09a['body']['id'];}return db[_0x30f6('0x2a')][_0x30f6('0x48')]({'where':{'id':_0x23d09a['params']['id']}})[_0x30f6('0x24')](handleEntityNotFound(_0x3e7ed8,null))[_0x30f6('0x24')](saveUpdates(_0x23d09a[_0x30f6('0x49')],null))[_0x30f6('0x24')](respondWithResult(_0x3e7ed8,null))['catch'](handleError(_0x3e7ed8,null));};exports['destroy']=function(_0x11422b,_0x48bd28){return db['AnalyticTreeReport'][_0x30f6('0x48')]({'where':{'id':_0x11422b['params']['id']}})['then'](handleEntityNotFound(_0x48bd28,null))[_0x30f6('0x24')](removeEntity(_0x48bd28,null))[_0x30f6('0x44')](handleError(_0x48bd28,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 751ed21..c334251 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 _0xf172=['path','rimraf','../../config/environment','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3c6614,_0x2c8250){var _0x4da19b=function(_0x36b8ca){while(--_0x36b8ca){_0x3c6614['push'](_0x3c6614['shift']());}};_0x4da19b(++_0x2c8250);}(_0xf172,0xf0));var _0x2f17=function(_0x1fed23,_0x899c14){_0x1fed23=_0x1fed23-0x0;var _0x35735f=_0xf172[_0x1fed23];return _0x35735f;};'use strict';var _=require(_0x2f17('0x0'));var util=require(_0x2f17('0x1'));var logger=require(_0x2f17('0x2'))(_0x2f17('0x3'));var moment=require(_0x2f17('0x4'));var BPromise=require(_0x2f17('0x5'));var rp=require(_0x2f17('0x6'));var fs=require('fs');var path=require(_0x2f17('0x7'));var rimraf=require(_0x2f17('0x8'));var config=require(_0x2f17('0x9'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x3be5cf,_0x25bd0c){return _0x3be5cf[_0x2f17('0xa')](_0x2f17('0xb'),attributes,{'tableName':_0x2f17('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed4f=['rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','path'];(function(_0x4b08be,_0xa3caac){var _0x30b817=function(_0x7624aa){while(--_0x7624aa){_0x4b08be['push'](_0x4b08be['shift']());}};_0x30b817(++_0xa3caac);}(_0xed4f,0x7c));var _0xfed4=function(_0x1bf7c6,_0x2d9527){_0x1bf7c6=_0x1bf7c6-0x0;var _0x162c30=_0xed4f[_0x1bf7c6];return _0x162c30;};'use strict';var _=require(_0xfed4('0x0'));var util=require(_0xfed4('0x1'));var logger=require(_0xfed4('0x2'))(_0xfed4('0x3'));var moment=require(_0xfed4('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfed4('0x5'));var rimraf=require(_0xfed4('0x6'));var config=require(_0xfed4('0x7'));var attributes=require(_0xfed4('0x8'));module[_0xfed4('0x9')]=function(_0x527536,_0x25f386){return _0x527536[_0xfed4('0xa')](_0xfed4('0xb'),attributes,{'tableName':_0xfed4('0xc'),'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 1903407..2bca7ef 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x2f64c0,_0x5b6f26){var _0x38cb5f=function(_0x4cf5c4){while(--_0x4cf5c4){_0x2f64c0['push'](_0x2f64c0['shift']());}};_0x38cb5f(++_0x5b6f26);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xc4aa[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _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(_0x1136a4,_0x5ae392){var _0x4acef5=function(_0x481cf6){while(--_0x481cf6){_0x1136a4['push'](_0x1136a4['shift']());}};_0x4acef5(++_0x5ae392);}(_0xdb28,0x106));var _0x8db2=function(_0x15fb31,_0x7e636e){_0x15fb31=_0x15fb31-0x0;var _0x36011b=_0xdb28[_0x15fb31];return _0x36011b;};'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 diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 7e5096d..eff191d 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 _0x05b7=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','put','update','destroy','exports','multer','util','path'];(function(_0x3b2d9d,_0x1f73b0){var _0x48142e=function(_0x5e9c7f){while(--_0x5e9c7f){_0x3b2d9d['push'](_0x3b2d9d['shift']());}};_0x48142e(++_0x1f73b0);}(_0x05b7,0x173));var _0x705b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x05b7[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x705b('0x0'));var util=require(_0x705b('0x1'));var path=require(_0x705b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x705b('0x3')]();var fs_extra=require(_0x705b('0x4'));var auth=require(_0x705b('0x5'));var interaction=require(_0x705b('0x6'));var config=require(_0x705b('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x705b('0x8')]('/',auth[_0x705b('0x9')](),controller[_0x705b('0xa')]);router[_0x705b('0x8')](_0x705b('0xb'),auth[_0x705b('0x9')](),controller[_0x705b('0xc')]);router['post']('/',auth[_0x705b('0x9')](),controller['create']);router[_0x705b('0xd')](_0x705b('0xb'),auth[_0x705b('0x9')](),controller[_0x705b('0xe')]);router['delete']('/:id',auth[_0x705b('0x9')](),controller[_0x705b('0xf')]);module[_0x705b('0x10')]=router; \ No newline at end of file +var _0xf00c=['../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x5f15c3,_0x5657e1){var _0x48405e=function(_0x1052c4){while(--_0x1052c4){_0x5f15c3['push'](_0x5f15c3['shift']());}};_0x48405e(++_0x5657e1);}(_0xf00c,0x14d));var _0xcf00=function(_0x645c00,_0x46fe36){_0x645c00=_0x645c00-0x0;var _0x26776d=_0xf00c[_0x645c00];return _0x26776d;};'use strict';var multer=require(_0xcf00('0x0'));var util=require('util');var path=require(_0xcf00('0x1'));var timeout=require(_0xcf00('0x2'));var express=require(_0xcf00('0x3'));var router=express[_0xcf00('0x4')]();var fs_extra=require(_0xcf00('0x5'));var auth=require(_0xcf00('0x6'));var interaction=require(_0xcf00('0x7'));var config=require(_0xcf00('0x8'));var controller=require(_0xcf00('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xcf00('0xa')]('/:id',auth[_0xcf00('0xb')](),controller[_0xcf00('0xc')]);router[_0xcf00('0xd')]('/',auth[_0xcf00('0xb')](),controller[_0xcf00('0xe')]);router[_0xcf00('0xf')](_0xcf00('0x10'),auth[_0xcf00('0xb')](),controller[_0xcf00('0x11')]);router[_0xcf00('0x12')](_0xcf00('0x10'),auth[_0xcf00('0xb')](),controller['destroy']);module[_0xcf00('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 f8aeeaa..e94e631 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 _0x5cd8=['sequelize','STRING'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x5cd8,0x1d2));var _0x85cd=function(_0x27755a,_0x1a2a4e){_0x27755a=_0x27755a-0x0;var _0x2a57b2=_0x5cd8[_0x27755a];return _0x2a57b2;};'use strict';var Sequelize=require(_0x85cd('0x0'));module['exports']={'name':{'type':Sequelize[_0x85cd('0x1')]},'basename':{'type':Sequelize[_0x85cd('0x1')]},'type':{'type':Sequelize[_0x85cd('0x1')]}}; \ No newline at end of file +var _0x61df=['STRING'];(function(_0x1e0f14,_0x4140c6){var _0x34fd61=function(_0x5a427f){while(--_0x5a427f){_0x1e0f14['push'](_0x1e0f14['shift']());}};_0x34fd61(++_0x4140c6);}(_0x61df,0xbd));var _0xf61d=function(_0x93d894,_0x209806){_0x93d894=_0x93d894-0x0;var _0x4919da=_0x61df[_0x93d894];return _0x4919da;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xf61d('0x0')]},'type':{'type':Sequelize[_0xf61d('0x0')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 5c44fb4..ff10203 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 _0xc316=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','set','reject','then','destroy','sendStatus','stack','name','send','Attachment','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','clone','get','omit','createdAt','updatedAt','create','body','update','find','file','originalname','basename','mimetype','download','findOne','ChatOfflineMessageId','join','offline-chat/','zip-dir','moment','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x495235,_0x3bc3dc){var _0x51cb41=function(_0x434259){while(--_0x434259){_0x495235['push'](_0x495235['shift']());}};_0x51cb41(++_0x3bc3dc);}(_0xc316,0x99));var _0x6c31=function(_0x37689d,_0x429426){_0x37689d=_0x37689d-0x0;var _0x25fc9e=_0xc316[_0x37689d];return _0x25fc9e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6c31('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6c31('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6c31('0x2'));var sox=require(_0x6c31('0x3'));var csv=require(_0x6c31('0x4'));var ejs=require(_0x6c31('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6c31('0x6'));var squel=require(_0x6c31('0x7'));var crypto=require(_0x6c31('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6c31('0x4'));var querystring=require(_0x6c31('0x9'));var Papa=require(_0x6c31('0xa'));var Redis=require(_0x6c31('0xb'));var authService=require(_0x6c31('0xc'));var qs=require(_0x6c31('0xd'));var as=require(_0x6c31('0xe'));var hardwareService=require(_0x6c31('0xf'));var logger=require(_0x6c31('0x10'))(_0x6c31('0x11'));var utils=require(_0x6c31('0x12'));var config=require(_0x6c31('0x13'));var licenseUtil=require(_0x6c31('0x14'));var db=require(_0x6c31('0x15'))['db'];function respondWithStatusCode(_0x4eef0b,_0x55fd66){_0x55fd66=_0x55fd66||0xcc;return function(_0x3136e0){if(_0x3136e0){return _0x4eef0b['sendStatus'](_0x55fd66);}return _0x4eef0b['status'](_0x55fd66)[_0x6c31('0x16')]();};}function respondWithResult(_0x2afe1a,_0x542bc4){_0x542bc4=_0x542bc4||0xc8;return function(_0x855337){if(_0x855337){return _0x2afe1a['status'](_0x542bc4)[_0x6c31('0x17')](_0x855337);}};}function respondWithFilteredResult(_0x420563,_0x232764){return function(_0x5c2a86){if(_0x5c2a86){var _0x3887e0=typeof _0x232764[_0x6c31('0x18')]===_0x6c31('0x19')&&typeof _0x232764[_0x6c31('0x1a')]===_0x6c31('0x19');var _0x119c8b=_0x5c2a86[_0x6c31('0x1b')];var _0x5ecec0=_0x3887e0?0x0:_0x232764['offset'];var _0x56c16f=_0x3887e0?_0x5c2a86['count']:_0x232764[_0x6c31('0x18')]+_0x232764['limit'];var _0x52c31a;if(_0x56c16f>=_0x119c8b){_0x56c16f=_0x119c8b;_0x52c31a=0xc8;}else{_0x52c31a=0xce;}_0x420563[_0x6c31('0x1c')](_0x52c31a);return _0x420563[_0x6c31('0x1d')]('Content-Range',_0x5ecec0+'-'+_0x56c16f+'/'+_0x119c8b)[_0x6c31('0x17')](_0x5c2a86);}return null;};}function patchUpdates(_0x4448b7){return function(_0x37b060){try{jsonpatch['apply'](_0x37b060,_0x4448b7,!![]);}catch(_0xf2bba6){return BPromise[_0x6c31('0x1e')](_0xf2bba6);}return _0x37b060['save']();};}function saveUpdates(_0x3f752f,_0x450c9a){return function(_0x33004f){if(_0x33004f){return _0x33004f['update'](_0x3f752f)[_0x6c31('0x1f')](function(_0x1f1de7){return _0x1f1de7;});}return null;};}function removeEntity(_0x209de0,_0x33b42c){return function(_0xeb386a){if(_0xeb386a){return _0xeb386a[_0x6c31('0x20')]()[_0x6c31('0x1f')](function(){_0x209de0[_0x6c31('0x1c')](0xcc)[_0x6c31('0x16')]();});}};}function handleEntityNotFound(_0x2cf828,_0xfcee0f){return function(_0x259c26){if(!_0x259c26){_0x2cf828[_0x6c31('0x21')](0x194);}return _0x259c26;};}function handleError(_0x43a906,_0x530c15){_0x530c15=_0x530c15||0x1f4;return function(_0x416953){logger['error'](_0x416953[_0x6c31('0x22')]);if(_0x416953[_0x6c31('0x23')]){delete _0x416953[_0x6c31('0x23')];}_0x43a906[_0x6c31('0x1c')](_0x530c15)[_0x6c31('0x24')](_0x416953);};}exports['index']=function(_0x46c0cb,_0x345b63){var _0x536790={},_0x3d3139={},_0x5eba0e={'count':0x0,'rows':[]};var _0x28b6d1=_['map'](db[_0x6c31('0x25')][_0x6c31('0x26')],function(_0x913404){return{'name':_0x913404['fieldName'],'type':_0x913404[_0x6c31('0x27')]['key']};});_0x3d3139[_0x6c31('0x28')]=_[_0x6c31('0x29')](_0x28b6d1,_0x6c31('0x23'));_0x3d3139[_0x6c31('0x2a')]=_[_0x6c31('0x2b')](_0x46c0cb[_0x6c31('0x2a')]);_0x3d3139[_0x6c31('0x2c')]=_[_0x6c31('0x2d')](_0x3d3139[_0x6c31('0x28')],_0x3d3139['query']);_0x536790[_0x6c31('0x2e')]=_['intersection'](_0x3d3139[_0x6c31('0x28')],qs[_0x6c31('0x2f')](_0x46c0cb[_0x6c31('0x2a')][_0x6c31('0x2f')]));_0x536790[_0x6c31('0x2e')]=_0x536790['attributes'][_0x6c31('0x30')]?_0x536790[_0x6c31('0x2e')]:_0x3d3139[_0x6c31('0x28')];if(!_0x46c0cb[_0x6c31('0x2a')][_0x6c31('0x31')](_0x6c31('0x32'))){_0x536790[_0x6c31('0x1a')]=qs['limit'](_0x46c0cb['query']['limit']);_0x536790['offset']=qs[_0x6c31('0x18')](_0x46c0cb[_0x6c31('0x2a')][_0x6c31('0x18')]);}_0x536790[_0x6c31('0x33')]=qs['sort'](_0x46c0cb['query'][_0x6c31('0x34')]);_0x536790[_0x6c31('0x35')]=qs[_0x6c31('0x2c')](_[_0x6c31('0x36')](_0x46c0cb[_0x6c31('0x2a')],_0x3d3139['filters']),_0x28b6d1);if(_0x46c0cb[_0x6c31('0x2a')][_0x6c31('0x37')]){_0x536790[_0x6c31('0x35')]=_[_0x6c31('0x38')](_0x536790[_0x6c31('0x35')],{'$or':_[_0x6c31('0x29')](_0x28b6d1,function(_0x24ea6e){if(_0x24ea6e[_0x6c31('0x27')]!==_0x6c31('0x39')){var _0x1a2fb2={};_0x1a2fb2[_0x24ea6e[_0x6c31('0x23')]]={'$like':'%'+_0x46c0cb[_0x6c31('0x2a')][_0x6c31('0x37')]+'%'};return _0x1a2fb2;}})});}_0x536790=_[_0x6c31('0x38')]({},_0x536790,_0x46c0cb[_0x6c31('0x3a')]);var _0x5a5876={'where':_0x536790[_0x6c31('0x35')]};return db['Attachment']['count'](_0x5a5876)[_0x6c31('0x1f')](function(_0x1084e4){_0x5eba0e[_0x6c31('0x1b')]=_0x1084e4;if(_0x46c0cb[_0x6c31('0x2a')][_0x6c31('0x3b')]){_0x536790['include']=[{'all':!![]}];}return db[_0x6c31('0x25')][_0x6c31('0x3c')](_0x536790);})[_0x6c31('0x1f')](function(_0x5046f7){_0x5eba0e[_0x6c31('0x3d')]=_0x5046f7;return _0x5eba0e;})[_0x6c31('0x1f')](respondWithFilteredResult(_0x345b63,_0x536790))[_0x6c31('0x3e')](handleError(_0x345b63,null));};exports['show']=function(_0x1ae2ad,_0x565a77){var _0x482400={'raw':!![],'where':{'id':_0x1ae2ad[_0x6c31('0x3f')]['id']}},_0x20fdb5={};_0x20fdb5[_0x6c31('0x28')]=_[_0x6c31('0x2b')](db['Attachment']['rawAttributes']);_0x20fdb5[_0x6c31('0x2a')]=_['keys'](_0x1ae2ad[_0x6c31('0x2a')]);_0x20fdb5['filters']=_[_0x6c31('0x2d')](_0x20fdb5[_0x6c31('0x28')],_0x20fdb5['query']);_0x482400['attributes']=_[_0x6c31('0x2d')](_0x20fdb5[_0x6c31('0x28')],qs[_0x6c31('0x2f')](_0x1ae2ad[_0x6c31('0x2a')][_0x6c31('0x2f')]));_0x482400[_0x6c31('0x2e')]=_0x482400[_0x6c31('0x2e')][_0x6c31('0x30')]?_0x482400[_0x6c31('0x2e')]:_0x20fdb5[_0x6c31('0x28')];if(_0x1ae2ad[_0x6c31('0x2a')][_0x6c31('0x3b')]){_0x482400[_0x6c31('0x40')]=[{'all':!![]}];}_0x482400=_[_0x6c31('0x38')]({},_0x482400,_0x1ae2ad['options']);return db[_0x6c31('0x25')]['find'](_0x482400)[_0x6c31('0x1f')](handleEntityNotFound(_0x565a77,null))[_0x6c31('0x1f')](respondWithResult(_0x565a77,null))[_0x6c31('0x3e')](handleError(_0x565a77,null));};exports[_0x6c31('0x41')]=function(_0x1e89a2,_0x2220eb){var _0xb5d509={'where':{'id':_0x1e89a2[_0x6c31('0x3f')]['id']}},_0x3035e0={};_0x3035e0[_0x6c31('0x28')]=_[_0x6c31('0x2b')](db['Attachment'][_0x6c31('0x26')]);_0xb5d509[_0x6c31('0x2e')]=_[_0x6c31('0x2d')](_0x3035e0[_0x6c31('0x28')],qs[_0x6c31('0x2f')](_0x1e89a2[_0x6c31('0x2a')][_0x6c31('0x2f')]));_0xb5d509[_0x6c31('0x2e')]=_0xb5d509[_0x6c31('0x2e')]['length']?_0xb5d509['attributes']:_0x3035e0[_0x6c31('0x28')];if(_0x1e89a2[_0x6c31('0x2a')]['includeAll']){_0xb5d509[_0x6c31('0x40')]=[{'all':!![]}];}_0xb5d509=_['merge']({},_0xb5d509,_0x1e89a2['options']);return db[_0x6c31('0x25')]['find'](_0xb5d509)[_0x6c31('0x1f')](handleEntityNotFound(_0x2220eb,null))[_0x6c31('0x1f')](function(_0x28f484){if(_0x28f484){var _0x430b08=_0x28f484[_0x6c31('0x42')]({'plain':!![]});_0x430b08=qs[_0x6c31('0x43')](_0x430b08,['id',_0x6c31('0x44'),'updatedAt']);_0x1e89a2['body']=_[_0x6c31('0x43')](_0x1e89a2['body'],['id',_0x6c31('0x44'),_0x6c31('0x45')]);return db[_0x6c31('0x25')][_0x6c31('0x46')](_[_0x6c31('0x38')](_0x430b08,_0x1e89a2[_0x6c31('0x47')]),{'include':_0x1e89a2[_0x6c31('0x2a')][_0x6c31('0x3b')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x2220eb,0xc9))['catch'](handleError(_0x2220eb,null));};exports[_0x6c31('0x48')]=function(_0x4bef7c,_0x372634){if(_0x4bef7c[_0x6c31('0x47')]['id']){delete _0x4bef7c[_0x6c31('0x47')]['id'];}return db[_0x6c31('0x25')][_0x6c31('0x49')]({'where':{'id':_0x4bef7c[_0x6c31('0x3f')]['id']}})[_0x6c31('0x1f')](handleEntityNotFound(_0x372634,null))[_0x6c31('0x1f')](saveUpdates(_0x4bef7c[_0x6c31('0x47')],null))[_0x6c31('0x1f')](respondWithResult(_0x372634,null))[_0x6c31('0x3e')](handleError(_0x372634,null));};exports['destroy']=function(_0x529814,_0x5882ad){return db[_0x6c31('0x25')][_0x6c31('0x49')]({'where':{'id':_0x529814[_0x6c31('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5882ad,null))[_0x6c31('0x1f')](removeEntity(_0x5882ad,null))['catch'](handleError(_0x5882ad,null));};exports[_0x6c31('0x46')]=function(_0x3a84b2,_0x2f0f32,_0xfb0ed7){_0x3a84b2['body'][_0x6c31('0x23')]=_0x3a84b2[_0x6c31('0x4a')][_0x6c31('0x4b')];_0x3a84b2[_0x6c31('0x47')][_0x6c31('0x4c')]=_0x3a84b2[_0x6c31('0x4a')]['filename'];_0x3a84b2['body'][_0x6c31('0x27')]=_0x3a84b2[_0x6c31('0x4a')][_0x6c31('0x4d')];return db[_0x6c31('0x25')][_0x6c31('0x46')](_0x3a84b2[_0x6c31('0x47')])[_0x6c31('0x1f')](respondWithResult(_0x2f0f32,0xc9))[_0x6c31('0x3e')](handleError(_0x2f0f32,null));};exports[_0x6c31('0x4e')]=function(_0x5a28f4,_0x27ffcb,_0x2087a5){return db[_0x6c31('0x25')][_0x6c31('0x4f')]({'where':{'id':_0x5a28f4[_0x6c31('0x3f')]['id']},'raw':!![]})[_0x6c31('0x1f')](handleEntityNotFound(_0x27ffcb,null))['then'](function(_0x29511f){if(_0x29511f){var _0x9f8848=_0x29511f[_0x6c31('0x50')]!==null;var _0x2d1155=path[_0x6c31('0x51')](config['root'],'server/files/attachments/');if(_0x9f8848){_0x2d1155=path[_0x6c31('0x51')](_0x2d1155,_0x6c31('0x52'));}var _0x3a830d=path[_0x6c31('0x51')](_0x2d1155,_0x29511f[_0x6c31('0x4c')]);return _0x27ffcb['download'](_0x3a830d);}})['catch'](handleError(_0x27ffcb,null));}; \ No newline at end of file +var _0x1f15=['catch','show','params','keys','fields','includeAll','find','clone','omit','createdAt','body','updatedAt','create','file','basename','filename','mimetype','download','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','length','nolimit','order','sort','where','filters','merge','filter','options','Attachment','include','findAll','rows','then'];(function(_0x156a0d,_0x3946ce){var _0x98a9ba=function(_0x46c1b2){while(--_0x46c1b2){_0x156a0d['push'](_0x156a0d['shift']());}};_0x98a9ba(++_0x3946ce);}(_0x1f15,0xc8));var _0x51f1=function(_0x2e4ffa,_0xeb3d5){_0x2e4ffa=_0x2e4ffa-0x0;var _0x205ff7=_0x1f15[_0x2e4ffa];return _0x205ff7;};'use strict';var emlformat=require(_0x51f1('0x0'));var rimraf=require(_0x51f1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x51f1('0x2'));var rp=require(_0x51f1('0x3'));var moment=require(_0x51f1('0x4'));var BPromise=require(_0x51f1('0x5'));var Mustache=require(_0x51f1('0x6'));var util=require('util');var path=require(_0x51f1('0x7'));var sox=require('sox');var csv=require(_0x51f1('0x8'));var ejs=require(_0x51f1('0x9'));var fs=require('fs');var fs_extra=require(_0x51f1('0xa'));var _=require(_0x51f1('0xb'));var squel=require('squel');var crypto=require(_0x51f1('0xc'));var jsforce=require(_0x51f1('0xd'));var deskjs=require(_0x51f1('0xe'));var toCsv=require(_0x51f1('0x8'));var querystring=require(_0x51f1('0xf'));var Papa=require(_0x51f1('0x10'));var Redis=require(_0x51f1('0x11'));var authService=require(_0x51f1('0x12'));var qs=require(_0x51f1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x51f1('0x14'));var logger=require(_0x51f1('0x15'))(_0x51f1('0x16'));var utils=require(_0x51f1('0x17'));var config=require(_0x51f1('0x18'));var licenseUtil=require(_0x51f1('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5da936,_0x1b636e){_0x1b636e=_0x1b636e||0xcc;return function(_0x4a8017){if(_0x4a8017){return _0x5da936[_0x51f1('0x1a')](_0x1b636e);}return _0x5da936[_0x51f1('0x1b')](_0x1b636e)[_0x51f1('0x1c')]();};}function respondWithResult(_0x351930,_0x50bf1d){_0x50bf1d=_0x50bf1d||0xc8;return function(_0x39462f){if(_0x39462f){return _0x351930[_0x51f1('0x1b')](_0x50bf1d)[_0x51f1('0x1d')](_0x39462f);}};}function respondWithFilteredResult(_0x51402c,_0x31a5a5){return function(_0x25cd3d){if(_0x25cd3d){var _0x2dba9d=typeof _0x31a5a5[_0x51f1('0x1e')]===_0x51f1('0x1f')&&typeof _0x31a5a5[_0x51f1('0x20')]===_0x51f1('0x1f');var _0x1468f8=_0x25cd3d[_0x51f1('0x21')];var _0x5c7430=_0x2dba9d?0x0:_0x31a5a5[_0x51f1('0x1e')];var _0x4aab50=_0x2dba9d?_0x25cd3d['count']:_0x31a5a5[_0x51f1('0x1e')]+_0x31a5a5[_0x51f1('0x20')];var _0x4d294f;if(_0x4aab50>=_0x1468f8){_0x4aab50=_0x1468f8;_0x4d294f=0xc8;}else{_0x4d294f=0xce;}_0x51402c['status'](_0x4d294f);return _0x51402c['set'](_0x51f1('0x22'),_0x5c7430+'-'+_0x4aab50+'/'+_0x1468f8)['json'](_0x25cd3d);}return null;};}function patchUpdates(_0x2aa6d0){return function(_0x428e1b){try{jsonpatch[_0x51f1('0x23')](_0x428e1b,_0x2aa6d0,!![]);}catch(_0x415b86){return BPromise[_0x51f1('0x24')](_0x415b86);}return _0x428e1b['save']();};}function saveUpdates(_0x452a51,_0x3bc6d2){return function(_0x3c7490){if(_0x3c7490){return _0x3c7490[_0x51f1('0x25')](_0x452a51)['then'](function(_0x427033){return _0x427033;});}return null;};}function removeEntity(_0x2abd8e,_0x330723){return function(_0x3b9c2d){if(_0x3b9c2d){return _0x3b9c2d[_0x51f1('0x26')]()['then'](function(){_0x2abd8e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc4e0ca,_0x193823){return function(_0x666a52){if(!_0x666a52){_0xc4e0ca['sendStatus'](0x194);}return _0x666a52;};}function handleError(_0x3c9a75,_0x196e42){_0x196e42=_0x196e42||0x1f4;return function(_0x3737b7){logger[_0x51f1('0x27')](_0x3737b7[_0x51f1('0x28')]);if(_0x3737b7[_0x51f1('0x29')]){delete _0x3737b7[_0x51f1('0x29')];}_0x3c9a75[_0x51f1('0x1b')](_0x196e42)[_0x51f1('0x2a')](_0x3737b7);};}exports[_0x51f1('0x2b')]=function(_0x50602c,_0x2387bd){var _0x15b89d={},_0x2ad0d9={},_0x5a3572={'count':0x0,'rows':[]};var _0x30cd66=_[_0x51f1('0x2c')](db['Attachment'][_0x51f1('0x2d')],function(_0x77d552){return{'name':_0x77d552[_0x51f1('0x2e')],'type':_0x77d552[_0x51f1('0x2f')][_0x51f1('0x30')]};});_0x2ad0d9[_0x51f1('0x31')]=_['map'](_0x30cd66,_0x51f1('0x29'));_0x2ad0d9[_0x51f1('0x32')]=_['keys'](_0x50602c[_0x51f1('0x32')]);_0x2ad0d9['filters']=_[_0x51f1('0x33')](_0x2ad0d9['model'],_0x2ad0d9[_0x51f1('0x32')]);_0x15b89d[_0x51f1('0x34')]=_[_0x51f1('0x33')](_0x2ad0d9['model'],qs['fields'](_0x50602c[_0x51f1('0x32')]['fields']));_0x15b89d[_0x51f1('0x34')]=_0x15b89d[_0x51f1('0x34')][_0x51f1('0x35')]?_0x15b89d[_0x51f1('0x34')]:_0x2ad0d9['model'];if(!_0x50602c[_0x51f1('0x32')]['hasOwnProperty'](_0x51f1('0x36'))){_0x15b89d[_0x51f1('0x20')]=qs['limit'](_0x50602c['query'][_0x51f1('0x20')]);_0x15b89d[_0x51f1('0x1e')]=qs['offset'](_0x50602c[_0x51f1('0x32')][_0x51f1('0x1e')]);}_0x15b89d[_0x51f1('0x37')]=qs[_0x51f1('0x38')](_0x50602c[_0x51f1('0x32')][_0x51f1('0x38')]);_0x15b89d[_0x51f1('0x39')]=qs[_0x51f1('0x3a')](_['pick'](_0x50602c[_0x51f1('0x32')],_0x2ad0d9['filters']),_0x30cd66);if(_0x50602c[_0x51f1('0x32')]['filter']){_0x15b89d[_0x51f1('0x39')]=_[_0x51f1('0x3b')](_0x15b89d[_0x51f1('0x39')],{'$or':_[_0x51f1('0x2c')](_0x30cd66,function(_0x5514ff){if(_0x5514ff['type']!=='VIRTUAL'){var _0x466ca0={};_0x466ca0[_0x5514ff['name']]={'$like':'%'+_0x50602c[_0x51f1('0x32')][_0x51f1('0x3c')]+'%'};return _0x466ca0;}})});}_0x15b89d=_[_0x51f1('0x3b')]({},_0x15b89d,_0x50602c[_0x51f1('0x3d')]);var _0xb3e688={'where':_0x15b89d[_0x51f1('0x39')]};return db[_0x51f1('0x3e')][_0x51f1('0x21')](_0xb3e688)['then'](function(_0x4435bd){_0x5a3572[_0x51f1('0x21')]=_0x4435bd;if(_0x50602c[_0x51f1('0x32')]['includeAll']){_0x15b89d[_0x51f1('0x3f')]=[{'all':!![]}];}return db[_0x51f1('0x3e')][_0x51f1('0x40')](_0x15b89d);})['then'](function(_0x419d7f){_0x5a3572[_0x51f1('0x41')]=_0x419d7f;return _0x5a3572;})[_0x51f1('0x42')](respondWithFilteredResult(_0x2387bd,_0x15b89d))[_0x51f1('0x43')](handleError(_0x2387bd,null));};exports[_0x51f1('0x44')]=function(_0x73dbd1,_0x327bc5){var _0x3643ed={'raw':!![],'where':{'id':_0x73dbd1[_0x51f1('0x45')]['id']}},_0x144e7d={};_0x144e7d[_0x51f1('0x31')]=_[_0x51f1('0x46')](db[_0x51f1('0x3e')][_0x51f1('0x2d')]);_0x144e7d[_0x51f1('0x32')]=_[_0x51f1('0x46')](_0x73dbd1[_0x51f1('0x32')]);_0x144e7d[_0x51f1('0x3a')]=_['intersection'](_0x144e7d[_0x51f1('0x31')],_0x144e7d[_0x51f1('0x32')]);_0x3643ed[_0x51f1('0x34')]=_[_0x51f1('0x33')](_0x144e7d[_0x51f1('0x31')],qs[_0x51f1('0x47')](_0x73dbd1[_0x51f1('0x32')][_0x51f1('0x47')]));_0x3643ed[_0x51f1('0x34')]=_0x3643ed[_0x51f1('0x34')][_0x51f1('0x35')]?_0x3643ed[_0x51f1('0x34')]:_0x144e7d[_0x51f1('0x31')];if(_0x73dbd1[_0x51f1('0x32')][_0x51f1('0x48')]){_0x3643ed[_0x51f1('0x3f')]=[{'all':!![]}];}_0x3643ed=_[_0x51f1('0x3b')]({},_0x3643ed,_0x73dbd1[_0x51f1('0x3d')]);return db['Attachment'][_0x51f1('0x49')](_0x3643ed)['then'](handleEntityNotFound(_0x327bc5,null))[_0x51f1('0x42')](respondWithResult(_0x327bc5,null))[_0x51f1('0x43')](handleError(_0x327bc5,null));};exports[_0x51f1('0x4a')]=function(_0x97ce69,_0x8f2350){var _0x48a7b9={'where':{'id':_0x97ce69[_0x51f1('0x45')]['id']}},_0x5f5d63={};_0x5f5d63['model']=_['keys'](db[_0x51f1('0x3e')][_0x51f1('0x2d')]);_0x48a7b9[_0x51f1('0x34')]=_[_0x51f1('0x33')](_0x5f5d63['model'],qs[_0x51f1('0x47')](_0x97ce69[_0x51f1('0x32')][_0x51f1('0x47')]));_0x48a7b9[_0x51f1('0x34')]=_0x48a7b9[_0x51f1('0x34')]['length']?_0x48a7b9['attributes']:_0x5f5d63[_0x51f1('0x31')];if(_0x97ce69[_0x51f1('0x32')][_0x51f1('0x48')]){_0x48a7b9['include']=[{'all':!![]}];}_0x48a7b9=_[_0x51f1('0x3b')]({},_0x48a7b9,_0x97ce69['options']);return db[_0x51f1('0x3e')][_0x51f1('0x49')](_0x48a7b9)[_0x51f1('0x42')](handleEntityNotFound(_0x8f2350,null))['then'](function(_0x25cdba){if(_0x25cdba){var _0x22125f=_0x25cdba['get']({'plain':!![]});_0x22125f=qs[_0x51f1('0x4b')](_0x22125f,['id',_0x51f1('0x4c'),'updatedAt']);_0x97ce69[_0x51f1('0x4d')]=_[_0x51f1('0x4b')](_0x97ce69[_0x51f1('0x4d')],['id',_0x51f1('0x4c'),_0x51f1('0x4e')]);return db['Attachment'][_0x51f1('0x4f')](_[_0x51f1('0x3b')](_0x22125f,_0x97ce69[_0x51f1('0x4d')]),{'include':_0x97ce69[_0x51f1('0x32')][_0x51f1('0x48')]?[{'all':!![]}]:undefined});}})[_0x51f1('0x42')](respondWithResult(_0x8f2350,0xc9))[_0x51f1('0x43')](handleError(_0x8f2350,null));};exports[_0x51f1('0x25')]=function(_0x3b9778,_0x4fde1c){if(_0x3b9778['body']['id']){delete _0x3b9778[_0x51f1('0x4d')]['id'];}return db[_0x51f1('0x3e')][_0x51f1('0x49')]({'where':{'id':_0x3b9778[_0x51f1('0x45')]['id']}})[_0x51f1('0x42')](handleEntityNotFound(_0x4fde1c,null))[_0x51f1('0x42')](saveUpdates(_0x3b9778[_0x51f1('0x4d')],null))[_0x51f1('0x42')](respondWithResult(_0x4fde1c,null))[_0x51f1('0x43')](handleError(_0x4fde1c,null));};exports[_0x51f1('0x26')]=function(_0x25e00a,_0x299d4c){return db[_0x51f1('0x3e')][_0x51f1('0x49')]({'where':{'id':_0x25e00a['params']['id']}})[_0x51f1('0x42')](handleEntityNotFound(_0x299d4c,null))[_0x51f1('0x42')](removeEntity(_0x299d4c,null))[_0x51f1('0x43')](handleError(_0x299d4c,null));};exports['create']=function(_0x49ae95,_0x4ca370,_0x56bc0e){_0x49ae95[_0x51f1('0x4d')][_0x51f1('0x29')]=_0x49ae95[_0x51f1('0x50')]['originalname'];_0x49ae95[_0x51f1('0x4d')][_0x51f1('0x51')]=_0x49ae95['file'][_0x51f1('0x52')];_0x49ae95[_0x51f1('0x4d')][_0x51f1('0x2f')]=_0x49ae95[_0x51f1('0x50')][_0x51f1('0x53')];return db['Attachment'][_0x51f1('0x4f')](_0x49ae95[_0x51f1('0x4d')])['then'](respondWithResult(_0x4ca370,0xc9))[_0x51f1('0x43')](handleError(_0x4ca370,null));};exports[_0x51f1('0x54')]=function(_0x10ee77,_0x657336,_0x4e17de){return db['Attachment']['findOne']({'where':{'id':_0x10ee77[_0x51f1('0x45')]['id']},'raw':!![]})[_0x51f1('0x42')](handleEntityNotFound(_0x657336,null))[_0x51f1('0x42')](function(_0x1d3a3d){if(_0x1d3a3d){var _0x57ed2b=_0x1d3a3d['ChatOfflineMessageId']!==null;var _0x5622d5=path[_0x51f1('0x55')](config[_0x51f1('0x56')],_0x51f1('0x57'));if(_0x57ed2b){_0x5622d5=path[_0x51f1('0x55')](_0x5622d5,_0x51f1('0x58'));}var _0x58d28d=path[_0x51f1('0x55')](_0x5622d5,_0x1d3a3d['basename']);return _0x657336[_0x51f1('0x54')](_0x58d28d);}})['catch'](handleError(_0x657336,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index a868f9a..250227e 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 _0xe6a1=['request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0xe6a1,0x153));var _0x1e6a=function(_0x3beefb,_0x24f918){_0x3beefb=_0x3beefb-0x0;var _0x58807a=_0xe6a1[_0x3beefb];return _0x58807a;};'use strict';var _=require(_0x1e6a('0x0'));var util=require(_0x1e6a('0x1'));var logger=require(_0x1e6a('0x2'))(_0x1e6a('0x3'));var moment=require(_0x1e6a('0x4'));var BPromise=require(_0x1e6a('0x5'));var rp=require(_0x1e6a('0x6'));var fs=require('fs');var path=require(_0x1e6a('0x7'));var rimraf=require(_0x1e6a('0x8'));var config=require(_0x1e6a('0x9'));var attributes=require(_0x1e6a('0xa'));module[_0x1e6a('0xb')]=function(_0x36b92b,_0x16458f){return _0x36b92b[_0x1e6a('0xc')](_0x1e6a('0xd'),attributes,{'tableName':_0x1e6a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd10f=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./attachment.attributes','exports','Attachment','attachments','lodash'];(function(_0x4b4638,_0xe99cda){var _0x59e92b=function(_0x2817ea){while(--_0x2817ea){_0x4b4638['push'](_0x4b4638['shift']());}};_0x59e92b(++_0xe99cda);}(_0xd10f,0x6b));var _0xfd10=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xd10f[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xfd10('0x0'));var util=require(_0xfd10('0x1'));var logger=require(_0xfd10('0x2'))(_0xfd10('0x3'));var moment=require('moment');var BPromise=require(_0xfd10('0x4'));var rp=require(_0xfd10('0x5'));var fs=require('fs');var path=require(_0xfd10('0x6'));var rimraf=require(_0xfd10('0x7'));var config=require('../../config/environment');var attributes=require(_0xfd10('0x8'));module[_0xfd10('0x9')]=function(_0x2bef22,_0x41f8e1){return _0x2bef22['define'](_0xfd10('0xa'),attributes,{'tableName':_0xfd10('0xb'),'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 f343cb2..e9716c8 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 _0xee11=['options','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Attachment,\x20%s,\x20%s','result','CreateAttachment','Attachment','body'];(function(_0x4583a9,_0x16aef1){var _0x4c3559=function(_0x232bd0){while(--_0x232bd0){_0x4583a9['push'](_0x4583a9['shift']());}};_0x4c3559(++_0x16aef1);}(_0xee11,0x146));var _0x1ee1=function(_0x14510c,_0x3f66f0){_0x14510c=_0x14510c-0x0;var _0x31c5f8=_0xee11[_0x14510c];return _0x31c5f8;};'use strict';var _=require(_0x1ee1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1ee1('0x1'));var rs=require(_0x1ee1('0x2'));var fs=require('fs');var Redis=require(_0x1ee1('0x3'));var db=require(_0x1ee1('0x4'))['db'];var utils=require(_0x1ee1('0x5'));var logger=require(_0x1ee1('0x6'))(_0x1ee1('0x7'));var config=require(_0x1ee1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1ee1('0x9')][_0x1ee1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fdb3b,_0x289d4c,_0x356919){return new BPromise(function(_0x47f984,_0x48af4c){return client[_0x1ee1('0xb')](_0x3fdb3b,_0x356919)[_0x1ee1('0xc')](function(_0x5899ca){logger[_0x1ee1('0xd')]('Attachment,\x20%s,\x20%s',_0x289d4c,_0x1ee1('0xe'));logger['debug'](_0x1ee1('0xf'),_0x289d4c,_0x1ee1('0xe'),JSON[_0x1ee1('0x10')](_0x5899ca));if(_0x5899ca[_0x1ee1('0x11')]){if(_0x5899ca['error'][_0x1ee1('0x12')]===0x1f4){logger[_0x1ee1('0x11')]('Attachment,\x20%s,\x20%s',_0x289d4c,_0x5899ca[_0x1ee1('0x11')][_0x1ee1('0x13')]);return _0x48af4c(_0x5899ca[_0x1ee1('0x11')][_0x1ee1('0x13')]);}logger[_0x1ee1('0x11')](_0x1ee1('0x14'),_0x289d4c,_0x5899ca[_0x1ee1('0x11')][_0x1ee1('0x13')]);return _0x47f984(_0x5899ca[_0x1ee1('0x11')][_0x1ee1('0x13')]);}else{logger[_0x1ee1('0xd')](_0x1ee1('0x14'),_0x289d4c,_0x1ee1('0xe'));_0x47f984(_0x5899ca[_0x1ee1('0x15')]['message']);}})['catch'](function(_0x7ff856){logger[_0x1ee1('0x11')](_0x1ee1('0x14'),_0x289d4c,_0x7ff856);_0x48af4c(_0x7ff856);});});}exports[_0x1ee1('0x16')]=function(_0x1e18b9){var _0xff3d76=this;return new Promise(function(_0x55abff,_0x39229e){return db[_0x1ee1('0x17')]['create'](_0x1e18b9[_0x1ee1('0x18')],{'raw':_0x1e18b9[_0x1ee1('0x19')]?_0x1e18b9['options']['raw']===undefined?!![]:![]:!![]})[_0x1ee1('0xc')](function(_0x1b6cdf){logger[_0x1ee1('0xd')](_0x1ee1('0x16'),_0x1e18b9);logger['debug'](_0x1ee1('0x16'),_0x1e18b9,JSON[_0x1ee1('0x10')](_0x1b6cdf));_0x55abff(_0x1b6cdf);})[_0x1ee1('0x1a')](function(_0x5093ff){logger[_0x1ee1('0x11')](_0x1ee1('0x16'),_0x5093ff[_0x1ee1('0x13')],_0x1e18b9);_0x39229e(_0xff3d76[_0x1ee1('0x11')](0x1f4,_0x5093ff[_0x1ee1('0x13')]));});});}; \ No newline at end of file +var _0xa0bc=['options','raw','debug','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateAttachment','create','body'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xca0b('0x0'));var moment=require(_0xca0b('0x1'));var BPromise=require('bluebird');var rs=require(_0xca0b('0x2'));var fs=require('fs');var Redis=require(_0xca0b('0x3'));var db=require(_0xca0b('0x4'))['db'];var utils=require(_0xca0b('0x5'));var logger=require(_0xca0b('0x6'))(_0xca0b('0x7'));var config=require(_0xca0b('0x8'));var jayson=require(_0xca0b('0x9'));var client=jayson[_0xca0b('0xa')][_0xca0b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbe64c7,_0x30202d,_0xa506a4){return new BPromise(function(_0x19acc2,_0x55a1de){return client[_0xca0b('0xc')](_0xbe64c7,_0xa506a4)[_0xca0b('0xd')](function(_0x3e3909){logger[_0xca0b('0xe')](_0xca0b('0xf'),_0x30202d,_0xca0b('0x10'));logger['debug'](_0xca0b('0x11'),_0x30202d,_0xca0b('0x10'),JSON[_0xca0b('0x12')](_0x3e3909));if(_0x3e3909[_0xca0b('0x13')]){if(_0x3e3909[_0xca0b('0x13')][_0xca0b('0x14')]===0x1f4){logger[_0xca0b('0x13')](_0xca0b('0xf'),_0x30202d,_0x3e3909[_0xca0b('0x13')][_0xca0b('0x15')]);return _0x55a1de(_0x3e3909['error'][_0xca0b('0x15')]);}logger[_0xca0b('0x13')](_0xca0b('0xf'),_0x30202d,_0x3e3909['error'][_0xca0b('0x15')]);return _0x19acc2(_0x3e3909[_0xca0b('0x13')][_0xca0b('0x15')]);}else{logger[_0xca0b('0xe')](_0xca0b('0xf'),_0x30202d,_0xca0b('0x10'));_0x19acc2(_0x3e3909['result'][_0xca0b('0x15')]);}})[_0xca0b('0x16')](function(_0x4d9b16){logger[_0xca0b('0x13')]('Attachment,\x20%s,\x20%s',_0x30202d,_0x4d9b16);_0x55a1de(_0x4d9b16);});});}exports[_0xca0b('0x17')]=function(_0x5050b7){var _0x236503=this;return new Promise(function(_0x32eff7,_0x97be82){return db['Attachment'][_0xca0b('0x18')](_0x5050b7[_0xca0b('0x19')],{'raw':_0x5050b7['options']?_0x5050b7[_0xca0b('0x1a')][_0xca0b('0x1b')]===undefined?!![]:![]:!![]})[_0xca0b('0xd')](function(_0x59bda9){logger[_0xca0b('0xe')](_0xca0b('0x17'),_0x5050b7);logger[_0xca0b('0x1c')](_0xca0b('0x17'),_0x5050b7,JSON[_0xca0b('0x12')](_0x59bda9));_0x32eff7(_0x59bda9);})[_0xca0b('0x16')](function(_0x49e695){logger[_0xca0b('0x13')](_0xca0b('0x17'),_0x49e695[_0xca0b('0x15')],_0x5050b7);_0x97be82(_0x236503['error'](0x1f4,_0x49e695['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 88e7185..08192d0 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 _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x302088,_0x521f67){var _0xbfe239=function(_0x2e8fd7){while(--_0x2e8fd7){_0x302088['push'](_0x302088['shift']());}};_0xbfe239(++_0x521f67);}(_0x757a,0xde));var _0xa757=function(_0x349b8b,_0x1b8e0b){_0x349b8b=_0x349b8b-0x0;var _0x2f5cac=_0x757a[_0x349b8b];return _0x2f5cac;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router; \ No newline at end of file +var _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x3baad0,_0x5a76fc){var _0x33651d=function(_0x36561c){while(--_0x36561c){_0x3baad0['push'](_0x3baad0['shift']());}};_0x33651d(++_0x5a76fc);}(_0x757a,0xde));var _0xa757=function(_0x454b26,_0x29e187){_0x454b26=_0x454b26-0x0;var _0x3f3121=_0x757a[_0x454b26];return _0x3f3121;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index d5534de..3cc802f 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 _0xefdb=['activedirectory','baseDN','url','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','user','agent','domain','minutes','clearBlockUser','getLicense','catch','status','send','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','User','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../config/utils','../../config/logger','undefined'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0xefdb,0x1c3));var _0xbefd=function(_0x29f7db,_0x5c1a37){_0x29f7db=_0x29f7db-0x0;var _0x1349d6=_0xefdb[_0x29f7db];return _0x1349d6;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xbefd('0x0'))[_0xbefd('0x1')];var moment=require(_0xbefd('0x2'));var ActiveDirectory=require(_0xbefd('0x3'));var BPromise=require(_0xbefd('0x4'));var util=require(_0xbefd('0x5'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0xbefd('0x6'));var config=require('../../config/environment');var logger=require(_0xbefd('0x7'))('api');function isActiveDirectoryConfigured(_0xd337a9){var _0x56a545=![];if(typeof _0xd337a9['activedirectory']!==_0xbefd('0x8')){_0x56a545=_0xd337a9[_0xbefd('0x9')][_0xbefd('0xa')]&&_0xd337a9[_0xbefd('0x9')][_0xbefd('0xb')]&&_0xd337a9[_0xbefd('0x9')]['domain'];}return _0x56a545;}function adAuthenticate(_0x309e40,_0x55284d,_0x15f850){return new BPromise(function(_0x51d92d,_0x4b26e4){try{var _0x47d8fe=new ActiveDirectory(_0x309e40);_0x47d8fe['authenticate'](_0x55284d,_0x15f850,function(_0x4ef43d,_0x508f2e){if(_0x4ef43d){logger[_0xbefd('0xc')](_0xbefd('0xd'),_0x55284d,util['inspect'](_0x4ef43d,{'showHidden':![],'depth':null}));_0x4b26e4(_0xbefd('0xe'));}else if(!_0x508f2e){logger[_0xbefd('0xc')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x55284d);_0x4b26e4(_0xbefd('0xe'));}else{_0x51d92d(_0x508f2e);}});}catch(_0x216dc0){_0x4b26e4(_0x216dc0);}});}function ActiveDirectoryAuthenticate(_0x172bad,_0x15941d,_0x458751,_0x48def7){var _0xdad20f,_0xb1d2e4;if(!isActiveDirectoryConfigured(config)){logger['error'](_0xbefd('0xf'),_0x15941d);return _0x48def7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xbefd('0x10')][_0xbefd('0x11')]({'where':{'id':0x1},'attributes':[_0xbefd('0x12'),_0xbefd('0x13')],'raw':!![]})[_0xbefd('0x14')](function(_0x313a80){_0xdad20f=_0x313a80;if(!_0xdad20f['adSsoEnabled']){logger[_0xbefd('0xc')](_0xbefd('0x15'),_0x15941d);throw new Error(_0xbefd('0xe'));}return _0x172bad[_0xbefd('0x11')]({'attributes':['id',_0xbefd('0x16'),_0xbefd('0x17'),_0xbefd('0x18'),_0xbefd('0x19'),_0xbefd('0x1a'),_0xbefd('0x1b'),_0xbefd('0x1c'),'online'],'where':{'name':_0x15941d,'role':{'$or':['admin',_0xbefd('0x1d'),_0xbefd('0x1e')]},'adSsoEnabled':!![]}});})['then'](function(_0x40ea93){if(!_0x40ea93||_0x40ea93&&_0x40ea93[_0xbefd('0x16')]!==_0x15941d){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0xb1d2e4=_0x40ea93;var _0x1f467e=_0xb1d2e4[_0xbefd('0x16')]+'@'+config[_0xbefd('0x9')][_0xbefd('0x1f')];return adAuthenticate(config[_0xbefd('0x9')],_0x1f467e,_0x458751);})['then'](function(_0x2f2d05){if(_0xb1d2e4[_0xbefd('0x1a')]){throw new Error(_0xbefd('0xe'));}if(_0xdad20f[_0xbefd('0x13')]>0x0){if(_0xb1d2e4['blocked']){if(moment(_0xb1d2e4[_0xbefd('0x1c')])['add'](_0xdad20f[_0xbefd('0x13')],_0xbefd('0x20'))>moment()){throw new Error(_0xbefd('0xe'));}return utils[_0xbefd('0x21')](_0xb1d2e4,0x0,![],null)['then'](function(){return utils['getLicense'](_0xb1d2e4);})['then'](function(){return _0x48def7(null,_0xb1d2e4);});}else{return utils[_0xbefd('0x22')](_0xb1d2e4)[_0xbefd('0x14')](function(){return _0x48def7(null,_0xb1d2e4);});}}else{return utils['getLicense'](_0xb1d2e4)[_0xbefd('0x14')](function(){return _0x48def7(null,_0xb1d2e4);});}})[_0xbefd('0x23')](function(_0x5a1590){return _0x48def7(null,![],_0x5a1590);});}function handleError(_0x505765,_0x2d3b29,_0x237d65){return _0x505765[_0xbefd('0x24')](_0x2d3b29||0x1f4)[_0xbefd('0x25')]({'message':_0x237d65?_0x237d65['message']||_0x237d65:''});}exports[_0xbefd('0x26')]=function(_0xeea723,_0x2ae229,_0x2d0cb8){passport[_0xbefd('0x27')](_0xbefd('0x28'),function(_0x31475c,_0x42abfc,_0x2ca292){var _0x4ab056=_0x31475c||_0x2ca292;if(_0x4ab056){return handleError(_0x2ae229,0x191,_0x4ab056);}if(!_0x42abfc){return handleError(_0x2ae229,0x194,{'message':_0xbefd('0x29')});}else{var _0x17f777={'payload':{'id':_0x42abfc['id'],'role':_0x42abfc[_0xbefd('0x19')]},'options':{'expiresIn':0x15180}};return authService[_0xbefd('0x2a')](_0x17f777)[_0xbefd('0x14')](function(_0x2a0ff0){_0x2ae229[_0xbefd('0x2b')]({'id':_0x42abfc['id'],'token':_0x2a0ff0,'statusCall':'','isAlreadyLogged':_0x42abfc[_0xbefd('0x2c')]});});}})(_0xeea723,_0x2ae229,_0x2d0cb8);};passport['use']('ad-login',new LocalStrategy({'usernameField':_0xbefd('0x16'),'passwordField':_0xbefd('0x17')},function(_0x2d3fbb,_0xa5c471,_0x71c850){return ActiveDirectoryAuthenticate(db[_0xbefd('0x2d')],_0x2d3fbb,_0xa5c471,_0x71c850);})); \ No newline at end of file +var _0xde7f=['blocked','blockedAt','online','agent','blockDuration','add','clearBlockUser','getLicense','status','send','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','use','moment','activedirectory2','util','api','undefined','activedirectory','url','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','then','name','password','salt','disabled'];(function(_0xcd7a10,_0x59b6cd){var _0x4dd6cb=function(_0x4bd6bc){while(--_0x4bd6bc){_0xcd7a10['push'](_0xcd7a10['shift']());}};_0x4dd6cb(++_0x59b6cd);}(_0xde7f,0x1f0));var _0xfde7=function(_0xe11d55,_0xf10bdf){_0xe11d55=_0xe11d55-0x0;var _0x2087cb=_0xde7f[_0xe11d55];return _0x2087cb;};'use strict';var passport=require('passport');var LocalStrategy=require('passport-local')['Strategy'];var moment=require(_0xfde7('0x0'));var ActiveDirectory=require(_0xfde7('0x1'));var BPromise=require('bluebird');var util=require(_0xfde7('0x2'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require('../../config/logger')(_0xfde7('0x3'));function isActiveDirectoryConfigured(_0x2c6045){var _0x15c7f5=![];if(typeof _0x2c6045['activedirectory']!==_0xfde7('0x4')){_0x15c7f5=_0x2c6045[_0xfde7('0x5')]['baseDN']&&_0x2c6045[_0xfde7('0x5')][_0xfde7('0x6')]&&_0x2c6045[_0xfde7('0x5')]['domain'];}return _0x15c7f5;}function adAuthenticate(_0x1aeae4,_0x3b7df5,_0x1914b4){return new BPromise(function(_0x1cf57e,_0x4c440e){try{var _0x387f0d=new ActiveDirectory(_0x1aeae4);_0x387f0d[_0xfde7('0x7')](_0x3b7df5,_0x1914b4,function(_0x317b89,_0x32016a){if(_0x317b89){logger[_0xfde7('0x8')](_0xfde7('0x9'),_0x3b7df5,util[_0xfde7('0xa')](_0x317b89,{'showHidden':![],'depth':null}));_0x4c440e('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x32016a){logger['error'](_0xfde7('0xb'),_0x3b7df5);_0x4c440e(_0xfde7('0xc'));}else{_0x1cf57e(_0x32016a);}});}catch(_0x33a664){_0x4c440e(_0x33a664);}});}function ActiveDirectoryAuthenticate(_0x352ded,_0xe7097c,_0x36d637,_0x5af4a8){var _0xb19ec2,_0x3edbfc;if(!isActiveDirectoryConfigured(config)){logger[_0xfde7('0x8')](_0xfde7('0xd'),_0xe7097c);return _0x5af4a8(null,![],{'message':_0xfde7('0xc')});}return db[_0xfde7('0xe')][_0xfde7('0xf')]({'where':{'id':0x1},'attributes':[_0xfde7('0x10'),'blockDuration'],'raw':!![]})[_0xfde7('0x11')](function(_0x10d007){_0xb19ec2=_0x10d007;if(!_0xb19ec2['adSsoEnabled']){logger[_0xfde7('0x8')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0xe7097c);throw new Error(_0xfde7('0xc'));}return _0x352ded[_0xfde7('0xf')]({'attributes':['id',_0xfde7('0x12'),_0xfde7('0x13'),_0xfde7('0x14'),'role',_0xfde7('0x15'),_0xfde7('0x16'),_0xfde7('0x17'),_0xfde7('0x18')],'where':{'name':_0xe7097c,'role':{'$or':['admin','user',_0xfde7('0x19')]},'adSsoEnabled':!![]}});})['then'](function(_0x727546){if(!_0x727546||_0x727546&&_0x727546[_0xfde7('0x12')]!==_0xe7097c){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x3edbfc=_0x727546;var _0x35cf7f=_0x3edbfc[_0xfde7('0x12')]+'@'+config[_0xfde7('0x5')]['domain'];return adAuthenticate(config['activedirectory'],_0x35cf7f,_0x36d637);})[_0xfde7('0x11')](function(_0x27ed39){if(_0x3edbfc[_0xfde7('0x15')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0xb19ec2[_0xfde7('0x1a')]>0x0){if(_0x3edbfc['blocked']){if(moment(_0x3edbfc['blockedAt'])[_0xfde7('0x1b')](_0xb19ec2[_0xfde7('0x1a')],'minutes')>moment()){throw new Error(_0xfde7('0xc'));}return utils[_0xfde7('0x1c')](_0x3edbfc,0x0,![],null)[_0xfde7('0x11')](function(){return utils[_0xfde7('0x1d')](_0x3edbfc);})[_0xfde7('0x11')](function(){return _0x5af4a8(null,_0x3edbfc);});}else{return utils[_0xfde7('0x1d')](_0x3edbfc)['then'](function(){return _0x5af4a8(null,_0x3edbfc);});}}else{return utils[_0xfde7('0x1d')](_0x3edbfc)[_0xfde7('0x11')](function(){return _0x5af4a8(null,_0x3edbfc);});}})['catch'](function(_0x576a0c){return _0x5af4a8(null,![],_0x576a0c);});}function handleError(_0x1ae353,_0x11fb12,_0x394017){return _0x1ae353[_0xfde7('0x1e')](_0x11fb12||0x1f4)[_0xfde7('0x1f')]({'message':_0x394017?_0x394017[_0xfde7('0x20')]||_0x394017:''});}exports['login']=function(_0x494ab5,_0x1190e4,_0x2a9ea8){passport[_0xfde7('0x7')](_0xfde7('0x21'),function(_0x460981,_0x113a1e,_0x219008){var _0x440daf=_0x460981||_0x219008;if(_0x440daf){return handleError(_0x1190e4,0x191,_0x440daf);}if(!_0x113a1e){return handleError(_0x1190e4,0x194,{'message':_0xfde7('0x22')});}else{var _0x5a38a8={'payload':{'id':_0x113a1e['id'],'role':_0x113a1e[_0xfde7('0x23')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x5a38a8)[_0xfde7('0x11')](function(_0x3ee1e4){_0x1190e4['json']({'id':_0x113a1e['id'],'token':_0x3ee1e4,'statusCall':'','isAlreadyLogged':_0x113a1e['online']});});}})(_0x494ab5,_0x1190e4,_0x2a9ea8);};passport[_0xfde7('0x24')]('ad-login',new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x512dfb,_0xe01162,_0x1ad046){return ActiveDirectoryAuthenticate(db['User'],_0x512dfb,_0xe01162,_0x1ad046);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 15a957e..f15173a 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 _0x90c2=['Router','./authActiveDirectory.controller','post','login','exports'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x90c2,0x131));var _0x290c=function(_0x24ffab,_0x496256){_0x24ffab=_0x24ffab-0x0;var _0x464b68=_0x90c2[_0x24ffab];return _0x464b68;};'use strict';var express=require('express');var router=express[_0x290c('0x0')]();var controller=require(_0x290c('0x1'));router[_0x290c('0x2')]('/',controller[_0x290c('0x3')]);module[_0x290c('0x4')]=router; \ No newline at end of file +var _0x508e=['Router','./authActiveDirectory.controller','post','login','exports'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x508e,0x1b8));var _0xe508=function(_0x58c1e0,_0x1b061a){_0x58c1e0=_0x58c1e0-0x0;var _0x5e8e0e=_0x508e[_0x58c1e0];return _0x5e8e0e;};'use strict';var express=require('express');var router=express[_0xe508('0x0')]();var controller=require(_0xe508('0x1'));router[_0xe508('0x2')]('/',controller[_0xe508('0x3')]);module[_0xe508('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 7ddbbdf..e5e90ce 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 _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x3ba4ef,_0x2667e9){var _0x35edf9=function(_0x52f6ba){while(--_0x52f6ba){_0x3ba4ef['push'](_0x3ba4ef['shift']());}};_0x35edf9(++_0x2667e9);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ 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(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x7a54,0x106));var _0x47a5=function(_0x14e3fd,_0x37e13c){_0x14e3fd=_0x14e3fd-0x0;var _0x17befc=_0x7a54[_0x14e3fd];return _0x17befc;};'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 a0d3931..2e749b2 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 _0x2aaa=['../../components/auth/service','login','/callback','isMiddleware','exports','passport','Router','./authGoogle.controller'];(function(_0x35d4e9,_0x298c61){var _0x5c2770=function(_0x2f326a){while(--_0x2f326a){_0x35d4e9['push'](_0x35d4e9['shift']());}};_0x5c2770(++_0x298c61);}(_0x2aaa,0x185));var _0xa2aa=function(_0x4b91e5,_0x44b343){_0x4b91e5=_0x4b91e5-0x0;var _0xc57634=_0x2aaa[_0x4b91e5];return _0xc57634;};'use strict';var express=require('express');var passport=require(_0xa2aa('0x0'));var router=express[_0xa2aa('0x1')]();var controller=require(_0xa2aa('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0xa2aa('0x3'));router['get']('/',controller[_0xa2aa('0x4')]);router['get'](_0xa2aa('0x5'),controller['callback'],authService[_0xa2aa('0x6')],userController['login'],authService['setTokenCookie']);module[_0xa2aa('0x7')]=router; \ No newline at end of file +var _0x20c0=['isMiddleware','login','passport','Router','../user/user.controller.js','../../components/auth/service','get','/callback','callback'];(function(_0x4c045d,_0x4f2995){var _0x1e381d=function(_0x184d8f){while(--_0x184d8f){_0x4c045d['push'](_0x4c045d['shift']());}};_0x1e381d(++_0x4f2995);}(_0x20c0,0x13d));var _0x020c=function(_0x4e0471,_0x4f1b1c){_0x4e0471=_0x4e0471-0x0;var _0x196d80=_0x20c0[_0x4e0471];return _0x196d80;};'use strict';var express=require('express');var passport=require(_0x020c('0x0'));var router=express[_0x020c('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0x020c('0x2'));var authService=require(_0x020c('0x3'));router[_0x020c('0x4')]('/',controller['login']);router['get'](_0x020c('0x5'),controller[_0x020c('0x6')],authService[_0x020c('0x7')],userController[_0x020c('0x8')],authService['setTokenCookie']);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 2ab6099..9f66c43 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 _0x6a8b=['online','forgot','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','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://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','validatePasswordHistory','previousPasswords','Password\x20reset!','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','client','http','Setting','allowedLoginAttempts','blockDuration','findOne','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','then','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','\x22%s\x22\x20<%s>','request','SendMail','error','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json'];(function(_0x105659,_0x523ac9){var _0xd390c2=function(_0x3bc15e){while(--_0x3bc15e){_0x105659['push'](_0x105659['shift']());}};_0xd390c2(++_0x523ac9);}(_0x6a8b,0x71));var _0xb6a8=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x6a8b[_0x3ab51d];return _0x29a04e;};'use strict';var util=require('util');var passport=require(_0xb6a8('0x0'));var LocalStrategy=require(_0xb6a8('0x1'))[_0xb6a8('0x2')];var jayson=require(_0xb6a8('0x3'));var _=require(_0xb6a8('0x4'));var rs=require(_0xb6a8('0x5'));var moment=require(_0xb6a8('0x6'));var db=require(_0xb6a8('0x7'))['db'];var authService=require(_0xb6a8('0x8'));var utils=require('../../config/utils');var client=jayson[_0xb6a8('0x9')][_0xb6a8('0xa')]({'port':0x232b});function localAuthenticate(_0x1c7e53,_0xbc33be,_0x7bed0,_0xd18f5c){var _0x13c818,_0x13a5f8;return db[_0xb6a8('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0xb6a8('0xc'),_0xb6a8('0xd')],'raw':!![]})['then'](function(_0x558413){_0x13c818=_0x558413;return _0x1c7e53[_0xb6a8('0xe')]({'attributes':['id','name',_0xb6a8('0xf'),_0xb6a8('0x10'),_0xb6a8('0x11'),_0xb6a8('0x12'),_0xb6a8('0x13'),_0xb6a8('0x14'),_0xb6a8('0x15')],'where':{'name':_0xbc33be,'role':{'$or':[_0xb6a8('0x16'),_0xb6a8('0x17'),_0xb6a8('0x18')]}}});})[_0xb6a8('0x19')](function(_0x2d7d5b){if(!_0x2d7d5b||_0x2d7d5b&&_0x2d7d5b[_0xb6a8('0x1a')]!==_0xbc33be){throw new Error(_0xb6a8('0x1b'));}else{_0x13a5f8=_0x2d7d5b;return _0x13a5f8;}})[_0xb6a8('0x19')](function(){_0x13a5f8[_0xb6a8('0x1c')](_0x7bed0,function(_0x1094a6,_0x4c18aa){var _0x1e2cad=_0x13a5f8['loginAttempts']+0x1;if(_0x1094a6){return _0xd18f5c(_0x1094a6);}else if(!_0x4c18aa){if(_0x13a5f8[_0xb6a8('0x12')]){return _0xd18f5c(null,![],{'message':_0xb6a8('0x1b')});}else if(_0x13c818[_0xb6a8('0xc')]>0x0){if(_0x13a5f8[_0xb6a8('0x13')]){if(_0x13c818[_0xb6a8('0xd')]>0x0){if(moment(_0x13a5f8[_0xb6a8('0x14')])[_0xb6a8('0x1d')](_0x13c818[_0xb6a8('0xd')],_0xb6a8('0x1e'))>moment()){return _0xd18f5c(null,![],{'message':_0xb6a8('0x1b')});}else{return utils['clearBlockUser'](_0x13a5f8,_0x1e2cad,![],null)[_0xb6a8('0x19')](function(){return _0xd18f5c(null,![],{'message':_0xb6a8('0x1b')});});}}else{return _0xd18f5c(null,![],{'message':_0xb6a8('0x1b')});}}else{if(_0x1e2cad>=_0x13c818['allowedLoginAttempts']){return utils[_0xb6a8('0x1f')](_0x13a5f8,0x0,!![],moment())[_0xb6a8('0x19')](function(){return _0xd18f5c(null,![],{'message':_0xb6a8('0x1b')});});}else{return utils[_0xb6a8('0x1f')](_0x13a5f8,_0x1e2cad,![],null)[_0xb6a8('0x19')](function(){return _0xd18f5c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0xd18f5c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x13a5f8[_0xb6a8('0x12')]){return _0xd18f5c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x13c818['allowedLoginAttempts']>0x0){if(_0x13a5f8[_0xb6a8('0x13')]){if(_0x13c818[_0xb6a8('0xd')]>0x0){if(moment(_0x13a5f8['blockedAt'])['add'](_0x13c818[_0xb6a8('0xd')],_0xb6a8('0x1e'))>moment()){return _0xd18f5c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xb6a8('0x1f')](_0x13a5f8,0x0,![],null)[_0xb6a8('0x19')](function(){return utils[_0xb6a8('0x20')](_0x13a5f8);})[_0xb6a8('0x19')](function(){return _0xd18f5c(null,_0x13a5f8);});}}else{return _0xd18f5c(null,![],{'message':_0xb6a8('0x1b')});}}else{return utils[_0xb6a8('0x1f')](_0x13a5f8,0x0,![],null)[_0xb6a8('0x19')](function(){return utils[_0xb6a8('0x20')](_0x13a5f8);})[_0xb6a8('0x19')](function(){return _0xd18f5c(null,_0x13a5f8);})[_0xb6a8('0x21')](function(_0x5a439b){return _0xd18f5c(null,![],_0x5a439b);});}}else{if(_0x13a5f8[_0xb6a8('0x13')]){return _0xd18f5c(null,![],{'message':_0xb6a8('0x1b')});}else{return utils[_0xb6a8('0x20')](_0x13a5f8)[_0xb6a8('0x19')](function(){return _0xd18f5c(null,_0x13a5f8);});}}}});})[_0xb6a8('0x21')](function(_0x6a8f20){return _0xd18f5c(null,![],_0x6a8f20);});}function sendServiceMail(_0x19a257){return db[_0xb6a8('0x22')][_0xb6a8('0x23')]({'where':{'service':!![]},'attributes':['id',_0xb6a8('0x1a'),_0xb6a8('0x24')],'include':[{'model':db[_0xb6a8('0x25')],'as':_0xb6a8('0x26'),'include':[{'model':db[_0xb6a8('0x27')],'as':'CloudProvider'}]}]})[_0xb6a8('0x19')](function(_0xa53b6b){if(!_0xa53b6b){throw new Error(_0xb6a8('0x28'));}var _0x4195b9=_0xa53b6b['getSmtpOptions']();var _0x2f3968={'account':_0x4195b9,'message':_[_0xb6a8('0x29')]({'from':util['format'](_0xb6a8('0x2a'),_0xa53b6b[_0xb6a8('0x1a')],_0xa53b6b[_0xb6a8('0x24')]||_0xa53b6b['Smtp'][_0xb6a8('0x17')])},_0x19a257)};return client[_0xb6a8('0x2b')](_0xb6a8('0x2c'),_0x2f3968);})[_0xb6a8('0x19')](function(_0x49500f){if(_0x49500f[_0xb6a8('0x2d')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x49500f[_0xb6a8('0x2d')][_0xb6a8('0x2e')]||JSON[_0xb6a8('0x2f')](_0x49500f[_0xb6a8('0x2d')])));}return!![];});}function handleError(_0x524b3c,_0x18cc00,_0x313aff){return _0x524b3c[_0xb6a8('0x30')](_0x18cc00||0x1f4)[_0xb6a8('0x31')]({'message':_0x313aff?_0x313aff[_0xb6a8('0x2e')]||_0x313aff:''});}exports[_0xb6a8('0x32')]=function(_0x2bea98,_0x21c767,_0x92fd99){passport[_0xb6a8('0x1c')](_0xb6a8('0x33'),function(_0x2461c8,_0x3b7fc3,_0x41d2f0){var _0x3c7bf4=_0x2461c8||_0x41d2f0;if(_0x3c7bf4){return handleError(_0x21c767,0x191,_0x3c7bf4);}if(!_0x3b7fc3){return handleError(_0x21c767,0x194,{'message':_0xb6a8('0x34')});}else{var _0x963022={'payload':{'id':_0x3b7fc3['id'],'role':_0x3b7fc3['role']},'options':{'expiresIn':0x15180}};return authService[_0xb6a8('0x35')](_0x963022)[_0xb6a8('0x19')](function(_0x17d3ef){_0x21c767[_0xb6a8('0x36')]({'id':_0x3b7fc3['id'],'token':_0x17d3ef,'statusCall':'','isAlreadyLogged':_0x3b7fc3[_0xb6a8('0x37')]});});}})(_0x2bea98,_0x21c767,_0x92fd99);};exports[_0xb6a8('0x38')]=function(_0xb91cb7,_0x556ff2){if(!_0xb91cb7['body'][_0xb6a8('0x24')]){return handleError(_0x556ff2,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x57e9b2=rs['generate']();_0xb91cb7[_0xb6a8('0x39')][_0xb6a8('0x24')]=_0xb91cb7[_0xb6a8('0x39')]['email'][_0xb6a8('0x3a')]()[_0xb6a8('0x3b')]();var _0x4db719;return db[_0xb6a8('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0xb6a8('0xc'),_0xb6a8('0xd')],'raw':!![]})['then'](function(_0x15b892){_0x4db719=_0x15b892;return db[_0xb6a8('0x3c')][_0xb6a8('0x23')]({'where':{'email':_0xb91cb7['body'][_0xb6a8('0x24')]}});})[_0xb6a8('0x19')](function(_0x4ce91a){if(!_0x4ce91a){throw new Error(_0xb6a8('0x3d'));}if(_0x4ce91a[_0xb6a8('0x12')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x4ce91a[_0xb6a8('0x13')]){if(moment(_0x4ce91a[_0xb6a8('0x14')])['add'](_0x4db719['blockDuration'],_0xb6a8('0x1e'))>moment()){throw new Error(_0xb6a8('0x3e'));}else{_0x4ce91a[_0xb6a8('0x13')]=![];_0x4ce91a['blockedAt']=null;}}_0x4ce91a[_0xb6a8('0x3f')]=_0x57e9b2;_0x4ce91a[_0xb6a8('0x40')]=Date[_0xb6a8('0x41')]()+0x36ee80;return _0x4ce91a[_0xb6a8('0x42')]();})[_0xb6a8('0x19')](function(){return sendServiceMail({'to':_0xb91cb7[_0xb6a8('0x39')][_0xb6a8('0x24')],'subject':_0xb6a8('0x43'),'text':_0xb6a8('0x44')+_0xb6a8('0x45')+_0xb6a8('0x46')+_0xb91cb7['headers'][_0xb6a8('0x47')]+_0xb6a8('0x48')+_0x57e9b2+'\x0a\x0a'+_0xb6a8('0x49')});})[_0xb6a8('0x19')](function(){_0x556ff2[_0xb6a8('0x30')](0xc8)[_0xb6a8('0x31')]({'message':'Reset\x20Email\x20sent!'});})[_0xb6a8('0x21')](function(_0x291bdd){return handleError(_0x556ff2,0x1f4,_0x291bdd);});};exports[_0xb6a8('0x4a')]=function(_0x84851c,_0x30e64a){return db['User'][_0xb6a8('0x23')]({'where':{'resetPasswordToken':_0x84851c[_0xb6a8('0x4b')]['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x34f827){if(!_0x34f827){throw new Error(_0xb6a8('0x4c'));}return db['Setting'][_0xb6a8('0xe')]({'attributes':['id',_0xb6a8('0x4d'),'enforcePasswordHistory',_0xb6a8('0x4e')]})[_0xb6a8('0x19')](function(_0x3583ac){if(_0x3583ac[_0xb6a8('0x4d')])authService[_0xb6a8('0x4f')](_0x84851c[_0xb6a8('0x39')][_0xb6a8('0xf')]);if(!_0x3583ac[_0xb6a8('0x50')]||!_0x34f827['previousPasswords'])return _0x34f827;authService[_0xb6a8('0x51')](_0x84851c[_0xb6a8('0x39')][_0xb6a8('0xf')],_0x34f827[_0xb6a8('0x52')],_0x3583ac['passwordHistoryLimit']);return _0x34f827;})[_0xb6a8('0x19')](function(){_0x34f827[_0xb6a8('0xf')]=_0x84851c[_0xb6a8('0x39')][_0xb6a8('0xf')];_0x34f827[_0xb6a8('0x3f')]=null;_0x34f827[_0xb6a8('0x40')]=null;return _0x34f827[_0xb6a8('0x42')]();});})['then'](function(){_0x30e64a[_0xb6a8('0x30')](0xc8)[_0xb6a8('0x31')]({'message':_0xb6a8('0x53')});})['catch'](function(_0x387a5d){return handleError(_0x30e64a,0x1f4,_0x387a5d);});};passport['use'](_0xb6a8('0x33'),new LocalStrategy({'usernameField':_0xb6a8('0x1a'),'passwordField':_0xb6a8('0xf')},function(_0x2759c4,_0xaf6ee2,_0x559d69){return localAuthenticate(db['User'],_0x2759c4,_0xaf6ee2,_0x559d69);})); \ No newline at end of file +var _0x96f3=['admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','blocked','add','clearBlockUser','blockedAt','minutes','getLicense','catch','MailAccount','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','email','request','SendMail','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','status','send','login','signToken','json','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','validatePasswordHistory','previousPasswords','Password\x20reset!','use','local-login','util','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','loginAttempts'];(function(_0x2dc9b7,_0x45bf6f){var _0x5da719=function(_0x2930de){while(--_0x2930de){_0x2dc9b7['push'](_0x2dc9b7['shift']());}};_0x5da719(++_0x45bf6f);}(_0x96f3,0x8d));var _0x396f=function(_0x417059,_0x49da59){_0x417059=_0x417059-0x0;var _0x429c7b=_0x96f3[_0x417059];return _0x429c7b;};'use strict';var util=require(_0x396f('0x0'));var passport=require(_0x396f('0x1'));var LocalStrategy=require(_0x396f('0x2'))[_0x396f('0x3')];var jayson=require(_0x396f('0x4'));var _=require(_0x396f('0x5'));var rs=require('randomstring');var moment=require(_0x396f('0x6'));var db=require(_0x396f('0x7'))['db'];var authService=require(_0x396f('0x8'));var utils=require(_0x396f('0x9'));var client=jayson[_0x396f('0xa')]['http']({'port':0x232b});function localAuthenticate(_0x50c466,_0x1c6467,_0x2d2806,_0x1503ad){var _0x596f76,_0x55045e;return db[_0x396f('0xb')][_0x396f('0xc')]({'where':{'id':0x1},'attributes':[_0x396f('0xd'),_0x396f('0xe')],'raw':!![]})[_0x396f('0xf')](function(_0x48ac72){_0x596f76=_0x48ac72;return _0x50c466[_0x396f('0xc')]({'attributes':['id',_0x396f('0x10'),_0x396f('0x11'),_0x396f('0x12'),_0x396f('0x13'),'disabled','blocked','blockedAt',_0x396f('0x14')],'where':{'name':_0x1c6467,'role':{'$or':[_0x396f('0x15'),_0x396f('0x16'),_0x396f('0x17')]}}});})[_0x396f('0xf')](function(_0x5a58e7){if(!_0x5a58e7||_0x5a58e7&&_0x5a58e7[_0x396f('0x10')]!==_0x1c6467){throw new Error(_0x396f('0x18'));}else{_0x55045e=_0x5a58e7;return _0x55045e;}})[_0x396f('0xf')](function(){_0x55045e[_0x396f('0x19')](_0x2d2806,function(_0x18d37f,_0x433aec){var _0x39306e=_0x55045e[_0x396f('0x14')]+0x1;if(_0x18d37f){return _0x1503ad(_0x18d37f);}else if(!_0x433aec){if(_0x55045e[_0x396f('0x1a')]){return _0x1503ad(null,![],{'message':_0x396f('0x18')});}else if(_0x596f76[_0x396f('0xd')]>0x0){if(_0x55045e[_0x396f('0x1b')]){if(_0x596f76['blockDuration']>0x0){if(moment(_0x55045e['blockedAt'])[_0x396f('0x1c')](_0x596f76[_0x396f('0xe')],'minutes')>moment()){return _0x1503ad(null,![],{'message':_0x396f('0x18')});}else{return utils[_0x396f('0x1d')](_0x55045e,_0x39306e,![],null)['then'](function(){return _0x1503ad(null,![],{'message':_0x396f('0x18')});});}}else{return _0x1503ad(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x39306e>=_0x596f76[_0x396f('0xd')]){return utils[_0x396f('0x1d')](_0x55045e,0x0,!![],moment())[_0x396f('0xf')](function(){return _0x1503ad(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x396f('0x1d')](_0x55045e,_0x39306e,![],null)[_0x396f('0xf')](function(){return _0x1503ad(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x1503ad(null,![],{'message':_0x396f('0x18')});}}else{if(_0x55045e[_0x396f('0x1a')]){return _0x1503ad(null,![],{'message':_0x396f('0x18')});}else if(_0x596f76[_0x396f('0xd')]>0x0){if(_0x55045e[_0x396f('0x1b')]){if(_0x596f76[_0x396f('0xe')]>0x0){if(moment(_0x55045e[_0x396f('0x1e')])[_0x396f('0x1c')](_0x596f76[_0x396f('0xe')],_0x396f('0x1f'))>moment()){return _0x1503ad(null,![],{'message':_0x396f('0x18')});}else{return utils[_0x396f('0x1d')](_0x55045e,0x0,![],null)[_0x396f('0xf')](function(){return utils[_0x396f('0x20')](_0x55045e);})[_0x396f('0xf')](function(){return _0x1503ad(null,_0x55045e);});}}else{return _0x1503ad(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x396f('0x1d')](_0x55045e,0x0,![],null)[_0x396f('0xf')](function(){return utils[_0x396f('0x20')](_0x55045e);})[_0x396f('0xf')](function(){return _0x1503ad(null,_0x55045e);})['catch'](function(_0x5d6c20){return _0x1503ad(null,![],_0x5d6c20);});}}else{if(_0x55045e[_0x396f('0x1b')]){return _0x1503ad(null,![],{'message':_0x396f('0x18')});}else{return utils[_0x396f('0x20')](_0x55045e)['then'](function(){return _0x1503ad(null,_0x55045e);});}}}});})[_0x396f('0x21')](function(_0x127556){return _0x1503ad(null,![],_0x127556);});}function sendServiceMail(_0x5436b8){return db[_0x396f('0x22')][_0x396f('0x23')]({'where':{'service':!![]},'attributes':['id',_0x396f('0x10'),'email'],'include':[{'model':db[_0x396f('0x24')],'as':_0x396f('0x25'),'include':[{'model':db[_0x396f('0x26')],'as':'CloudProvider'}]}]})['then'](function(_0x47c538){if(!_0x47c538){throw new Error(_0x396f('0x27'));}var _0xd84683=_0x47c538['getSmtpOptions']();var _0x5531b7={'account':_0xd84683,'message':_['merge']({'from':util['format']('\x22%s\x22\x20<%s>',_0x47c538[_0x396f('0x10')],_0x47c538[_0x396f('0x28')]||_0x47c538[_0x396f('0x25')][_0x396f('0x16')])},_0x5436b8)};return client[_0x396f('0x29')](_0x396f('0x2a'),_0x5531b7);})[_0x396f('0xf')](function(_0x572754){if(_0x572754['error']){throw new Error(util[_0x396f('0x2b')](_0x396f('0x2c'),_0x572754[_0x396f('0x2d')][_0x396f('0x2e')]||JSON['stringify'](_0x572754[_0x396f('0x2d')])));}return!![];});}function handleError(_0xff8628,_0x591482,_0xc20eac){return _0xff8628[_0x396f('0x2f')](_0x591482||0x1f4)[_0x396f('0x30')]({'message':_0xc20eac?_0xc20eac[_0x396f('0x2e')]||_0xc20eac:''});}exports[_0x396f('0x31')]=function(_0x5038e3,_0x104e48,_0x15e330){passport[_0x396f('0x19')]('local-login',function(_0x4522e8,_0x136e4d,_0x9045b1){var _0x4ef281=_0x4522e8||_0x9045b1;if(_0x4ef281){return handleError(_0x104e48,0x191,_0x4ef281);}if(!_0x136e4d){return handleError(_0x104e48,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x232b26={'payload':{'id':_0x136e4d['id'],'role':_0x136e4d[_0x396f('0x13')]},'options':{'expiresIn':0x15180}};return authService[_0x396f('0x32')](_0x232b26)[_0x396f('0xf')](function(_0xefc881){_0x104e48[_0x396f('0x33')]({'id':_0x136e4d['id'],'token':_0xefc881,'statusCall':'','isAlreadyLogged':_0x136e4d['online']});});}})(_0x5038e3,_0x104e48,_0x15e330);};exports['forgot']=function(_0x4e7f3b,_0x100f8e){if(!_0x4e7f3b['body'][_0x396f('0x28')]){return handleError(_0x100f8e,0x1f4,{'message':_0x396f('0x34')});}var _0x28f64e=rs[_0x396f('0x35')]();_0x4e7f3b['body'][_0x396f('0x28')]=_0x4e7f3b[_0x396f('0x36')]['email'][_0x396f('0x37')]()[_0x396f('0x38')]();var _0x19a69e;return db['Setting'][_0x396f('0xc')]({'where':{'id':0x1},'attributes':[_0x396f('0xd'),'blockDuration'],'raw':!![]})[_0x396f('0xf')](function(_0xbf97ae){_0x19a69e=_0xbf97ae;return db[_0x396f('0x39')][_0x396f('0x23')]({'where':{'email':_0x4e7f3b[_0x396f('0x36')]['email']}});})[_0x396f('0xf')](function(_0x42ce47){if(!_0x42ce47){throw new Error(_0x396f('0x3a'));}if(_0x42ce47['disabled']){throw new Error(_0x396f('0x3b'));}if(_0x42ce47['blocked']){if(moment(_0x42ce47[_0x396f('0x1e')])[_0x396f('0x1c')](_0x19a69e['blockDuration'],_0x396f('0x1f'))>moment()){throw new Error(_0x396f('0x3c'));}else{_0x42ce47[_0x396f('0x1b')]=![];_0x42ce47['blockedAt']=null;}}_0x42ce47['resetPasswordToken']=_0x28f64e;_0x42ce47[_0x396f('0x3d')]=Date[_0x396f('0x3e')]()+0x36ee80;return _0x42ce47[_0x396f('0x3f')]();})[_0x396f('0xf')](function(){return sendServiceMail({'to':_0x4e7f3b[_0x396f('0x36')][_0x396f('0x28')],'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'+_0x396f('0x40')+'https://'+_0x4e7f3b[_0x396f('0x41')]['host']+_0x396f('0x42')+_0x28f64e+'\x0a\x0a'+_0x396f('0x43')});})[_0x396f('0xf')](function(){_0x100f8e[_0x396f('0x2f')](0xc8)['send']({'message':_0x396f('0x44')});})[_0x396f('0x21')](function(_0x2414cc){return handleError(_0x100f8e,0x1f4,_0x2414cc);});};exports['reset']=function(_0x553b89,_0x18ae92){return db[_0x396f('0x39')][_0x396f('0x23')]({'where':{'resetPasswordToken':_0x553b89[_0x396f('0x45')][_0x396f('0x46')],'resetPasswordExpires':{'$gt':Date[_0x396f('0x3e')]()}}})[_0x396f('0xf')](function(_0x39395b){if(!_0x39395b){throw new Error(_0x396f('0x47'));}return db['Setting'][_0x396f('0xc')]({'attributes':['id',_0x396f('0x48'),'enforcePasswordHistory',_0x396f('0x49')]})[_0x396f('0xf')](function(_0x4f79db){if(_0x4f79db[_0x396f('0x48')])authService[_0x396f('0x4a')](_0x553b89[_0x396f('0x36')][_0x396f('0x11')]);if(!_0x4f79db[_0x396f('0x4b')]||!_0x39395b['previousPasswords'])return _0x39395b;authService[_0x396f('0x4c')](_0x553b89[_0x396f('0x36')][_0x396f('0x11')],_0x39395b[_0x396f('0x4d')],_0x4f79db[_0x396f('0x49')]);return _0x39395b;})[_0x396f('0xf')](function(){_0x39395b['password']=_0x553b89['body'][_0x396f('0x11')];_0x39395b['resetPasswordToken']=null;_0x39395b['resetPasswordExpires']=null;return _0x39395b[_0x396f('0x3f')]();});})[_0x396f('0xf')](function(){_0x18ae92[_0x396f('0x2f')](0xc8)[_0x396f('0x30')]({'message':_0x396f('0x4e')});})[_0x396f('0x21')](function(_0x1d9a54){return handleError(_0x18ae92,0x1f4,_0x1d9a54);});};passport[_0x396f('0x4f')](_0x396f('0x50'),new LocalStrategy({'usernameField':_0x396f('0x10'),'passwordField':'password'},function(_0x37a3ce,_0x31117c,_0x4d89d8){return localAuthenticate(db['User'],_0x37a3ce,_0x31117c,_0x4d89d8);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index acefc6b..8a12e60 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 _0x10b7=['/forgot','forgot','/reset/:token','exports','express','Router','./authLocal.controller','post','login'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x10b7,0x67));var _0x710b=function(_0x4a19f7,_0x34f60a){_0x4a19f7=_0x4a19f7-0x0;var _0x11372a=_0x10b7[_0x4a19f7];return _0x11372a;};'use strict';var express=require(_0x710b('0x0'));var router=express[_0x710b('0x1')]();var controller=require(_0x710b('0x2'));router[_0x710b('0x3')]('/',controller[_0x710b('0x4')]);router[_0x710b('0x3')](_0x710b('0x5'),controller[_0x710b('0x6')]);router[_0x710b('0x3')](_0x710b('0x7'),controller['reset']);module[_0x710b('0x8')]=router; \ No newline at end of file +var _0xc703=['Router','post','login','forgot','/reset/:token','exports','express'];(function(_0x104be8,_0x51a270){var _0x49b8cf=function(_0x21ee42){while(--_0x21ee42){_0x104be8['push'](_0x104be8['shift']());}};_0x49b8cf(++_0x51a270);}(_0xc703,0x1f0));var _0x3c70=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc703[_0x4a9fb1];return _0x348672;};'use strict';var express=require(_0x3c70('0x0'));var router=express[_0x3c70('0x1')]();var controller=require('./authLocal.controller');router[_0x3c70('0x2')]('/',controller[_0x3c70('0x3')]);router['post']('/forgot',controller[_0x3c70('0x4')]);router[_0x3c70('0x2')](_0x3c70('0x5'),controller['reset']);module[_0x3c70('0x6')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 7816df6..70f3e36 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 _0x2f6e=['STRING','INTEGER','exports'];(function(_0x2c9fd9,_0x1984d0){var _0x4727e1=function(_0x1f0e27){while(--_0x1f0e27){_0x2c9fd9['push'](_0x2c9fd9['shift']());}};_0x4727e1(++_0x1984d0);}(_0x2f6e,0xec));var _0xe2f6=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2f6e[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module[_0xe2f6('0x0')]={'name':{'type':Sequelize[_0xe2f6('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xe2f6('0x1')]},'description':{'type':Sequelize[_0xe2f6('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xe2f6('0x2')],'defaultValue':0xa}}; \ No newline at end of file +var _0xa025=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x145e87,_0x244827){var _0xbdddad=function(_0x106153){while(--_0x106153){_0x145e87['push'](_0x145e87['shift']());}};_0xbdddad(++_0x244827);}(_0xa025,0x9c));var _0x5a02=function(_0x540133,_0x41783f){_0x540133=_0x540133-0x0;var _0x26b6e9=_0xa025[_0x540133];return _0x26b6e9;};'use strict';var Sequelize=require(_0x5a02('0x0'));module[_0x5a02('0x1')]={'name':{'type':Sequelize[_0x5a02('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x5a02('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x5a02('0x4')],'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 3c4aebe..9231a3d 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 _0x101d=['rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','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/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','then','error','stack','name','send','index','Automation','rawAttributes','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','catch','show','params','keys','create','body','find','Condition','ids','omit','getConditions','findOne','addActions','getActions','Action','eml-format'];(function(_0x190572,_0x130dbc){var _0x281dab=function(_0x3bdeb3){while(--_0x3bdeb3){_0x190572['push'](_0x190572['shift']());}};_0x281dab(++_0x130dbc);}(_0x101d,0xec));var _0xd101=function(_0x222054,_0x45620f){_0x222054=_0x222054-0x0;var _0x5de492=_0x101d[_0x222054];return _0x5de492;};'use strict';var emlformat=require(_0xd101('0x0'));var rimraf=require(_0xd101('0x1'));var zipdir=require(_0xd101('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd101('0x3'));var moment=require(_0xd101('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd101('0x5'));var util=require(_0xd101('0x6'));var path=require(_0xd101('0x7'));var sox=require('sox');var csv=require(_0xd101('0x8'));var ejs=require(_0xd101('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd101('0xa'));var squel=require(_0xd101('0xb'));var crypto=require('crypto');var jsforce=require(_0xd101('0xc'));var deskjs=require(_0xd101('0xd'));var toCsv=require(_0xd101('0x8'));var querystring=require(_0xd101('0xe'));var Papa=require(_0xd101('0xf'));var Redis=require(_0xd101('0x10'));var authService=require(_0xd101('0x11'));var qs=require(_0xd101('0x12'));var as=require(_0xd101('0x13'));var hardwareService=require(_0xd101('0x14'));var logger=require(_0xd101('0x15'))(_0xd101('0x16'));var utils=require(_0xd101('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd101('0x18'));var db=require(_0xd101('0x19'))['db'];function respondWithStatusCode(_0x5b7111,_0x97b42e){_0x97b42e=_0x97b42e||0xcc;return function(_0x34e5fb){if(_0x34e5fb){return _0x5b7111[_0xd101('0x1a')](_0x97b42e);}return _0x5b7111[_0xd101('0x1b')](_0x97b42e)[_0xd101('0x1c')]();};}function respondWithResult(_0x52d73c,_0x32ef53){_0x32ef53=_0x32ef53||0xc8;return function(_0x284ac2){if(_0x284ac2){return _0x52d73c[_0xd101('0x1b')](_0x32ef53)[_0xd101('0x1d')](_0x284ac2);}};}function respondWithFilteredResult(_0x270453,_0x27b159){return function(_0x174664){if(_0x174664){var _0x26666c=typeof _0x27b159['offset']==='undefined'&&typeof _0x27b159['limit']==='undefined';var _0x214ebb=_0x174664[_0xd101('0x1e')];var _0x5169d5=_0x26666c?0x0:_0x27b159['offset'];var _0x5660c7=_0x26666c?_0x174664[_0xd101('0x1e')]:_0x27b159[_0xd101('0x1f')]+_0x27b159[_0xd101('0x20')];var _0xc40af6;if(_0x5660c7>=_0x214ebb){_0x5660c7=_0x214ebb;_0xc40af6=0xc8;}else{_0xc40af6=0xce;}_0x270453['status'](_0xc40af6);return _0x270453[_0xd101('0x21')](_0xd101('0x22'),_0x5169d5+'-'+_0x5660c7+'/'+_0x214ebb)[_0xd101('0x1d')](_0x174664);}return null;};}function patchUpdates(_0x42c82f){return function(_0x3503ba){try{jsonpatch['apply'](_0x3503ba,_0x42c82f,!![]);}catch(_0x370727){return BPromise['reject'](_0x370727);}return _0x3503ba[_0xd101('0x23')]();};}function saveUpdates(_0x15eac0,_0x388fae){return function(_0x334fc7){if(_0x334fc7){return _0x334fc7['update'](_0x15eac0)[_0xd101('0x24')](function(_0x572d68){return _0x572d68;});}return null;};}function removeEntity(_0x4f9eee,_0x4803cb){return function(_0x575af7){if(_0x575af7){return _0x575af7['destroy']()['then'](function(){_0x4f9eee[_0xd101('0x1b')](0xcc)[_0xd101('0x1c')]();});}};}function handleEntityNotFound(_0x468e19,_0x292abf){return function(_0x78d669){if(!_0x78d669){_0x468e19[_0xd101('0x1a')](0x194);}return _0x78d669;};}function handleError(_0xb7db9b,_0x4b9520){_0x4b9520=_0x4b9520||0x1f4;return function(_0x46e94a){logger[_0xd101('0x25')](_0x46e94a[_0xd101('0x26')]);if(_0x46e94a[_0xd101('0x27')]){delete _0x46e94a[_0xd101('0x27')];}_0xb7db9b[_0xd101('0x1b')](_0x4b9520)[_0xd101('0x28')](_0x46e94a);};}exports[_0xd101('0x29')]=function(_0x4674e2,_0x61f8ac){var _0x199526={},_0x5a94fd={},_0x9e178e={'count':0x0,'rows':[]};var _0x361d49=_['map'](db[_0xd101('0x2a')][_0xd101('0x2b')],function(_0x40b3c4){return{'name':_0x40b3c4['fieldName'],'type':_0x40b3c4[_0xd101('0x2c')]['key']};});_0x5a94fd[_0xd101('0x2d')]=_['map'](_0x361d49,'name');_0x5a94fd['query']=_['keys'](_0x4674e2[_0xd101('0x2e')]);_0x5a94fd[_0xd101('0x2f')]=_[_0xd101('0x30')](_0x5a94fd[_0xd101('0x2d')],_0x5a94fd[_0xd101('0x2e')]);_0x199526['attributes']=_[_0xd101('0x30')](_0x5a94fd[_0xd101('0x2d')],qs[_0xd101('0x31')](_0x4674e2[_0xd101('0x2e')][_0xd101('0x31')]));_0x199526[_0xd101('0x32')]=_0x199526['attributes'][_0xd101('0x33')]?_0x199526[_0xd101('0x32')]:_0x5a94fd[_0xd101('0x2d')];if(!_0x4674e2[_0xd101('0x2e')][_0xd101('0x34')]('nolimit')){_0x199526['limit']=qs[_0xd101('0x20')](_0x4674e2[_0xd101('0x2e')][_0xd101('0x20')]);_0x199526[_0xd101('0x1f')]=qs[_0xd101('0x1f')](_0x4674e2[_0xd101('0x2e')]['offset']);}_0x199526[_0xd101('0x35')]=qs[_0xd101('0x36')](_0x4674e2[_0xd101('0x2e')]['sort']);_0x199526[_0xd101('0x37')]=qs[_0xd101('0x2f')](_[_0xd101('0x38')](_0x4674e2[_0xd101('0x2e')],_0x5a94fd[_0xd101('0x2f')]),_0x361d49);if(_0x4674e2[_0xd101('0x2e')][_0xd101('0x39')]){_0x199526[_0xd101('0x37')]=_[_0xd101('0x3a')](_0x199526['where'],{'$or':_[_0xd101('0x3b')](_0x361d49,function(_0x3d0d2f){if(_0x3d0d2f['type']!=='VIRTUAL'){var _0x4f5f7b={};_0x4f5f7b[_0x3d0d2f[_0xd101('0x27')]]={'$like':'%'+_0x4674e2['query'][_0xd101('0x39')]+'%'};return _0x4f5f7b;}})});}_0x199526=_['merge']({},_0x199526,_0x4674e2[_0xd101('0x3c')]);var _0x5188b2={'where':_0x199526['where']};return db[_0xd101('0x2a')]['count'](_0x5188b2)[_0xd101('0x24')](function(_0x29dccc){_0x9e178e[_0xd101('0x1e')]=_0x29dccc;if(_0x4674e2[_0xd101('0x2e')][_0xd101('0x3d')]){_0x199526[_0xd101('0x3e')]=[{'all':!![]}];}return db[_0xd101('0x2a')][_0xd101('0x3f')](_0x199526);})['then'](function(_0x59368f){_0x9e178e['rows']=_0x59368f;return _0x9e178e;})[_0xd101('0x24')](respondWithFilteredResult(_0x61f8ac,_0x199526))[_0xd101('0x40')](handleError(_0x61f8ac,null));};exports[_0xd101('0x41')]=function(_0x12b59a,_0x2c2018){var _0x16b778={'raw':![],'where':{'id':_0x12b59a[_0xd101('0x42')]['id']}},_0x22283b={};_0x22283b[_0xd101('0x2d')]=_['keys'](db[_0xd101('0x2a')]['rawAttributes']);_0x22283b[_0xd101('0x2e')]=_[_0xd101('0x43')](_0x12b59a[_0xd101('0x2e')]);_0x22283b['filters']=_[_0xd101('0x30')](_0x22283b['model'],_0x22283b['query']);_0x16b778[_0xd101('0x32')]=_[_0xd101('0x30')](_0x22283b[_0xd101('0x2d')],qs['fields'](_0x12b59a[_0xd101('0x2e')][_0xd101('0x31')]));_0x16b778['attributes']=_0x16b778[_0xd101('0x32')][_0xd101('0x33')]?_0x16b778[_0xd101('0x32')]:_0x22283b[_0xd101('0x2d')];if(_0x12b59a[_0xd101('0x2e')][_0xd101('0x3d')]){_0x16b778[_0xd101('0x3e')]=[{'all':!![]}];}_0x16b778=_[_0xd101('0x3a')]({},_0x16b778,_0x12b59a[_0xd101('0x3c')]);return db['Automation']['find'](_0x16b778)[_0xd101('0x24')](handleEntityNotFound(_0x2c2018,null))[_0xd101('0x24')](respondWithResult(_0x2c2018,null))[_0xd101('0x40')](handleError(_0x2c2018,null));};exports[_0xd101('0x44')]=function(_0x13540a,_0x3eccc7){return db[_0xd101('0x2a')]['create'](_0x13540a[_0xd101('0x45')],{})['then'](respondWithResult(_0x3eccc7,0xc9))[_0xd101('0x40')](handleError(_0x3eccc7,null));};exports['update']=function(_0xbaa1ad,_0x351a08){if(_0xbaa1ad['body']['id']){delete _0xbaa1ad['body']['id'];}return db[_0xd101('0x2a')]['find']({'where':{'id':_0xbaa1ad['params']['id']}})['then'](handleEntityNotFound(_0x351a08,null))[_0xd101('0x24')](saveUpdates(_0xbaa1ad['body'],null))['then'](respondWithResult(_0x351a08,null))[_0xd101('0x40')](handleError(_0x351a08,null));};exports['destroy']=function(_0x5a77d7,_0x2ee277){return db[_0xd101('0x2a')][_0xd101('0x46')]({'where':{'id':_0x5a77d7[_0xd101('0x42')]['id']}})[_0xd101('0x24')](handleEntityNotFound(_0x2ee277,null))[_0xd101('0x24')](removeEntity(_0x2ee277,null))['catch'](handleError(_0x2ee277,null));};exports['addConditions']=function(_0x4ec672,_0x1f925b,_0x206cd8){return db[_0xd101('0x47')][_0xd101('0x46')]({'where':{'id':_0x4ec672[_0xd101('0x42')]['id']}})[_0xd101('0x24')](handleEntityNotFound(_0x1f925b,null))['then'](function(_0x3b43a4){if(_0x3b43a4){return _0x3b43a4['addConditions'](_0x4ec672[_0xd101('0x45')][_0xd101('0x48')],_[_0xd101('0x49')](_0x4ec672[_0xd101('0x45')],[_0xd101('0x48'),'id'])||{});}})[_0xd101('0x24')](respondWithResult(_0x1f925b,null))[_0xd101('0x40')](handleError(_0x1f925b,null));};exports[_0xd101('0x4a')]=function(_0x1eea00,_0x1a0c70,_0x5a7b9a){var _0x23b35d={};var _0x562593={};var _0x230580;var _0x49cf21;return db[_0xd101('0x2a')][_0xd101('0x4b')]({'where':{'id':_0x1eea00[_0xd101('0x42')]['id']}})[_0xd101('0x24')](handleEntityNotFound(_0x1a0c70,null))['then'](function(_0x93f895){if(_0x93f895){_0x230580=_0x93f895;_0x562593['model']=_['keys'](db[_0xd101('0x47')][_0xd101('0x2b')]);_0x562593['query']=_['keys'](_0x1eea00['query']);_0x562593[_0xd101('0x2f')]=_[_0xd101('0x30')](_0x562593['model'],_0x562593[_0xd101('0x2e')]);_0x23b35d[_0xd101('0x32')]=_['intersection'](_0x562593[_0xd101('0x2d')],qs['fields'](_0x1eea00[_0xd101('0x2e')][_0xd101('0x31')]));_0x23b35d['attributes']=_0x23b35d['attributes'][_0xd101('0x33')]?_0x23b35d[_0xd101('0x32')]:_0x562593[_0xd101('0x2d')];_0x23b35d[_0xd101('0x35')]=qs[_0xd101('0x36')](_0x1eea00[_0xd101('0x2e')][_0xd101('0x36')]);_0x23b35d[_0xd101('0x37')]=qs['filters'](_[_0xd101('0x38')](_0x1eea00[_0xd101('0x2e')],_0x562593['filters']));if(_0x1eea00[_0xd101('0x2e')][_0xd101('0x39')]){_0x23b35d['where']=_[_0xd101('0x3a')](_0x23b35d['where'],{'$or':_['map'](_0x23b35d[_0xd101('0x32')],function(_0x317a47){var _0x14f9a1={};_0x14f9a1[_0x317a47]={'$like':'%'+_0x1eea00[_0xd101('0x2e')][_0xd101('0x39')]+'%'};return _0x14f9a1;})});}_0x23b35d=_[_0xd101('0x3a')]({},_0x23b35d,_0x1eea00[_0xd101('0x3c')]);return _0x230580['getConditions'](_0x23b35d);}})[_0xd101('0x24')](function(_0x2e369a){if(_0x2e369a){_0x49cf21=_0x2e369a['length'];if(!_0x1eea00[_0xd101('0x2e')][_0xd101('0x34')]('nolimit')){_0x23b35d[_0xd101('0x20')]=qs[_0xd101('0x20')](_0x1eea00[_0xd101('0x2e')][_0xd101('0x20')]);_0x23b35d['offset']=qs[_0xd101('0x1f')](_0x1eea00[_0xd101('0x2e')][_0xd101('0x1f')]);}return _0x230580[_0xd101('0x4a')](_0x23b35d);}})[_0xd101('0x24')](function(_0x1cc83b){if(_0x1cc83b){return _0x1cc83b?{'count':_0x49cf21,'rows':_0x1cc83b}:null;}})[_0xd101('0x24')](respondWithResult(_0x1a0c70,null))['catch'](handleError(_0x1a0c70,null));};exports['addActions']=function(_0x2ab4e8,_0x5a079d,_0x398bdf){return db['Action'][_0xd101('0x46')]({'where':{'id':_0x2ab4e8['params']['id']}})[_0xd101('0x24')](handleEntityNotFound(_0x5a079d,null))['then'](function(_0x1192f0){if(_0x1192f0){return _0x1192f0[_0xd101('0x4c')](_0x2ab4e8[_0xd101('0x45')][_0xd101('0x48')],_['omit'](_0x2ab4e8[_0xd101('0x45')],[_0xd101('0x48'),'id'])||{});}})['then'](respondWithResult(_0x5a079d,null))[_0xd101('0x40')](handleError(_0x5a079d,null));};exports[_0xd101('0x4d')]=function(_0x258f9b,_0x2f93b9,_0x51c94c){var _0x2f56e4={};var _0x147d5e={};var _0x3dff82;var _0x177fbd;return db[_0xd101('0x2a')]['findOne']({'where':{'id':_0x258f9b[_0xd101('0x42')]['id']}})[_0xd101('0x24')](handleEntityNotFound(_0x2f93b9,null))[_0xd101('0x24')](function(_0x4279e8){if(_0x4279e8){_0x3dff82=_0x4279e8;_0x147d5e[_0xd101('0x2d')]=_[_0xd101('0x43')](db[_0xd101('0x4e')][_0xd101('0x2b')]);_0x147d5e[_0xd101('0x2e')]=_[_0xd101('0x43')](_0x258f9b[_0xd101('0x2e')]);_0x147d5e['filters']=_[_0xd101('0x30')](_0x147d5e[_0xd101('0x2d')],_0x147d5e[_0xd101('0x2e')]);_0x2f56e4[_0xd101('0x32')]=_[_0xd101('0x30')](_0x147d5e[_0xd101('0x2d')],qs[_0xd101('0x31')](_0x258f9b[_0xd101('0x2e')][_0xd101('0x31')]));_0x2f56e4[_0xd101('0x32')]=_0x2f56e4[_0xd101('0x32')][_0xd101('0x33')]?_0x2f56e4['attributes']:_0x147d5e[_0xd101('0x2d')];_0x2f56e4[_0xd101('0x35')]=qs[_0xd101('0x36')](_0x258f9b[_0xd101('0x2e')][_0xd101('0x36')]);_0x2f56e4['where']=qs[_0xd101('0x2f')](_[_0xd101('0x38')](_0x258f9b[_0xd101('0x2e')],_0x147d5e['filters']));if(_0x258f9b[_0xd101('0x2e')][_0xd101('0x39')]){_0x2f56e4[_0xd101('0x37')]=_[_0xd101('0x3a')](_0x2f56e4[_0xd101('0x37')],{'$or':_[_0xd101('0x3b')](_0x2f56e4[_0xd101('0x32')],function(_0x30c8c6){var _0x261dee={};_0x261dee[_0x30c8c6]={'$like':'%'+_0x258f9b[_0xd101('0x2e')][_0xd101('0x39')]+'%'};return _0x261dee;})});}_0x2f56e4=_[_0xd101('0x3a')]({},_0x2f56e4,_0x258f9b['options']);return _0x3dff82[_0xd101('0x4d')](_0x2f56e4);}})[_0xd101('0x24')](function(_0x4a8351){if(_0x4a8351){_0x177fbd=_0x4a8351['length'];if(!_0x258f9b[_0xd101('0x2e')][_0xd101('0x34')]('nolimit')){_0x2f56e4[_0xd101('0x20')]=qs[_0xd101('0x20')](_0x258f9b[_0xd101('0x2e')][_0xd101('0x20')]);_0x2f56e4[_0xd101('0x1f')]=qs[_0xd101('0x1f')](_0x258f9b['query'][_0xd101('0x1f')]);}return _0x3dff82[_0xd101('0x4d')](_0x2f56e4);}})[_0xd101('0x24')](function(_0x2f10a1){if(_0x2f10a1){return _0x2f10a1?{'count':_0x177fbd,'rows':_0x2f10a1}:null;}})[_0xd101('0x24')](respondWithResult(_0x2f93b9,null))[_0xd101('0x40')](handleError(_0x2f93b9,null));}; \ No newline at end of file +var _0x64e6=['save','then','destroy','end','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','params','find','create','update','body','addConditions','Condition','ids','omit','getConditions','order','addActions','Action','getActions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject'];(function(_0xab8c7f,_0x5f0c5b){var _0x51e138=function(_0x1807f8){while(--_0x1807f8){_0xab8c7f['push'](_0xab8c7f['shift']());}};_0x51e138(++_0x5f0c5b);}(_0x64e6,0xdb));var _0x664e=function(_0x527f7d,_0x1fe947){_0x527f7d=_0x527f7d-0x0;var _0x1127c4=_0x64e6[_0x527f7d];return _0x1127c4;};'use strict';var emlformat=require(_0x664e('0x0'));var rimraf=require(_0x664e('0x1'));var zipdir=require(_0x664e('0x2'));var jsonpatch=require(_0x664e('0x3'));var rp=require(_0x664e('0x4'));var moment=require(_0x664e('0x5'));var BPromise=require(_0x664e('0x6'));var Mustache=require(_0x664e('0x7'));var util=require('util');var path=require(_0x664e('0x8'));var sox=require(_0x664e('0x9'));var csv=require(_0x664e('0xa'));var ejs=require(_0x664e('0xb'));var fs=require('fs');var fs_extra=require(_0x664e('0xc'));var _=require(_0x664e('0xd'));var squel=require('squel');var crypto=require(_0x664e('0xe'));var jsforce=require(_0x664e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x664e('0xa'));var querystring=require('querystring');var Papa=require(_0x664e('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x664e('0x11'));var logger=require(_0x664e('0x12'))(_0x664e('0x13'));var utils=require(_0x664e('0x14'));var config=require(_0x664e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x664e('0x16'))['db'];function respondWithStatusCode(_0x1d6cff,_0x34479b){_0x34479b=_0x34479b||0xcc;return function(_0x1d77bc){if(_0x1d77bc){return _0x1d6cff[_0x664e('0x17')](_0x34479b);}return _0x1d6cff[_0x664e('0x18')](_0x34479b)['end']();};}function respondWithResult(_0x27d09e,_0x48cd14){_0x48cd14=_0x48cd14||0xc8;return function(_0x503c3a){if(_0x503c3a){return _0x27d09e[_0x664e('0x18')](_0x48cd14)[_0x664e('0x19')](_0x503c3a);}};}function respondWithFilteredResult(_0x57e5d1,_0x1de99f){return function(_0xbed73b){if(_0xbed73b){var _0x288c9a=typeof _0x1de99f[_0x664e('0x1a')]===_0x664e('0x1b')&&typeof _0x1de99f[_0x664e('0x1c')]===_0x664e('0x1b');var _0x2b85fd=_0xbed73b[_0x664e('0x1d')];var _0x154e44=_0x288c9a?0x0:_0x1de99f[_0x664e('0x1a')];var _0x2803b8=_0x288c9a?_0xbed73b[_0x664e('0x1d')]:_0x1de99f[_0x664e('0x1a')]+_0x1de99f[_0x664e('0x1c')];var _0x455773;if(_0x2803b8>=_0x2b85fd){_0x2803b8=_0x2b85fd;_0x455773=0xc8;}else{_0x455773=0xce;}_0x57e5d1[_0x664e('0x18')](_0x455773);return _0x57e5d1[_0x664e('0x1e')](_0x664e('0x1f'),_0x154e44+'-'+_0x2803b8+'/'+_0x2b85fd)[_0x664e('0x19')](_0xbed73b);}return null;};}function patchUpdates(_0x1df8eb){return function(_0x10036d){try{jsonpatch['apply'](_0x10036d,_0x1df8eb,!![]);}catch(_0x520e37){return BPromise[_0x664e('0x20')](_0x520e37);}return _0x10036d[_0x664e('0x21')]();};}function saveUpdates(_0x32edd9,_0x4b93cf){return function(_0x3d4503){if(_0x3d4503){return _0x3d4503['update'](_0x32edd9)[_0x664e('0x22')](function(_0x30b0d5){return _0x30b0d5;});}return null;};}function removeEntity(_0x5e6f2f,_0x47475a){return function(_0x50bb88){if(_0x50bb88){return _0x50bb88[_0x664e('0x23')]()['then'](function(){_0x5e6f2f[_0x664e('0x18')](0xcc)[_0x664e('0x24')]();});}};}function handleEntityNotFound(_0x5b296c,_0x28110b){return function(_0x1445b2){if(!_0x1445b2){_0x5b296c[_0x664e('0x17')](0x194);}return _0x1445b2;};}function handleError(_0x317a19,_0x56d1c8){_0x56d1c8=_0x56d1c8||0x1f4;return function(_0x4b4f18){logger[_0x664e('0x25')](_0x4b4f18[_0x664e('0x26')]);if(_0x4b4f18[_0x664e('0x27')]){delete _0x4b4f18[_0x664e('0x27')];}_0x317a19['status'](_0x56d1c8)[_0x664e('0x28')](_0x4b4f18);};}exports[_0x664e('0x29')]=function(_0x122781,_0x2e1bb9){var _0x257fb5={},_0xd8e01e={},_0x881c39={'count':0x0,'rows':[]};var _0x488767=_[_0x664e('0x2a')](db[_0x664e('0x2b')][_0x664e('0x2c')],function(_0x99a2f5){return{'name':_0x99a2f5[_0x664e('0x2d')],'type':_0x99a2f5['type'][_0x664e('0x2e')]};});_0xd8e01e['model']=_[_0x664e('0x2a')](_0x488767,_0x664e('0x27'));_0xd8e01e[_0x664e('0x2f')]=_[_0x664e('0x30')](_0x122781[_0x664e('0x2f')]);_0xd8e01e[_0x664e('0x31')]=_[_0x664e('0x32')](_0xd8e01e[_0x664e('0x33')],_0xd8e01e[_0x664e('0x2f')]);_0x257fb5[_0x664e('0x34')]=_[_0x664e('0x32')](_0xd8e01e[_0x664e('0x33')],qs[_0x664e('0x35')](_0x122781[_0x664e('0x2f')][_0x664e('0x35')]));_0x257fb5[_0x664e('0x34')]=_0x257fb5[_0x664e('0x34')][_0x664e('0x36')]?_0x257fb5['attributes']:_0xd8e01e[_0x664e('0x33')];if(!_0x122781[_0x664e('0x2f')][_0x664e('0x37')](_0x664e('0x38'))){_0x257fb5[_0x664e('0x1c')]=qs[_0x664e('0x1c')](_0x122781[_0x664e('0x2f')][_0x664e('0x1c')]);_0x257fb5[_0x664e('0x1a')]=qs[_0x664e('0x1a')](_0x122781['query'][_0x664e('0x1a')]);}_0x257fb5['order']=qs[_0x664e('0x39')](_0x122781['query'][_0x664e('0x39')]);_0x257fb5[_0x664e('0x3a')]=qs[_0x664e('0x31')](_[_0x664e('0x3b')](_0x122781[_0x664e('0x2f')],_0xd8e01e[_0x664e('0x31')]),_0x488767);if(_0x122781[_0x664e('0x2f')]['filter']){_0x257fb5['where']=_['merge'](_0x257fb5[_0x664e('0x3a')],{'$or':_['map'](_0x488767,function(_0x3064b1){if(_0x3064b1[_0x664e('0x3c')]!==_0x664e('0x3d')){var _0x1cb223={};_0x1cb223[_0x3064b1['name']]={'$like':'%'+_0x122781[_0x664e('0x2f')][_0x664e('0x3e')]+'%'};return _0x1cb223;}})});}_0x257fb5=_[_0x664e('0x3f')]({},_0x257fb5,_0x122781[_0x664e('0x40')]);var _0x197272={'where':_0x257fb5['where']};return db[_0x664e('0x2b')][_0x664e('0x1d')](_0x197272)[_0x664e('0x22')](function(_0x2423cf){_0x881c39[_0x664e('0x1d')]=_0x2423cf;if(_0x122781[_0x664e('0x2f')][_0x664e('0x41')]){_0x257fb5[_0x664e('0x42')]=[{'all':!![]}];}return db[_0x664e('0x2b')][_0x664e('0x43')](_0x257fb5);})[_0x664e('0x22')](function(_0x4ec734){_0x881c39['rows']=_0x4ec734;return _0x881c39;})[_0x664e('0x22')](respondWithFilteredResult(_0x2e1bb9,_0x257fb5))[_0x664e('0x44')](handleError(_0x2e1bb9,null));};exports['show']=function(_0x23991e,_0x3b5d6a){var _0x31fd14={'raw':![],'where':{'id':_0x23991e[_0x664e('0x45')]['id']}},_0x3164f6={};_0x3164f6[_0x664e('0x33')]=_[_0x664e('0x30')](db[_0x664e('0x2b')][_0x664e('0x2c')]);_0x3164f6[_0x664e('0x2f')]=_[_0x664e('0x30')](_0x23991e[_0x664e('0x2f')]);_0x3164f6[_0x664e('0x31')]=_[_0x664e('0x32')](_0x3164f6['model'],_0x3164f6['query']);_0x31fd14[_0x664e('0x34')]=_[_0x664e('0x32')](_0x3164f6[_0x664e('0x33')],qs[_0x664e('0x35')](_0x23991e[_0x664e('0x2f')][_0x664e('0x35')]));_0x31fd14[_0x664e('0x34')]=_0x31fd14[_0x664e('0x34')][_0x664e('0x36')]?_0x31fd14[_0x664e('0x34')]:_0x3164f6[_0x664e('0x33')];if(_0x23991e['query']['includeAll']){_0x31fd14[_0x664e('0x42')]=[{'all':!![]}];}_0x31fd14=_[_0x664e('0x3f')]({},_0x31fd14,_0x23991e[_0x664e('0x40')]);return db[_0x664e('0x2b')][_0x664e('0x46')](_0x31fd14)['then'](handleEntityNotFound(_0x3b5d6a,null))['then'](respondWithResult(_0x3b5d6a,null))[_0x664e('0x44')](handleError(_0x3b5d6a,null));};exports[_0x664e('0x47')]=function(_0x112509,_0x3e632f){return db['Automation'][_0x664e('0x47')](_0x112509['body'],{})['then'](respondWithResult(_0x3e632f,0xc9))[_0x664e('0x44')](handleError(_0x3e632f,null));};exports[_0x664e('0x48')]=function(_0x51655d,_0x43a6dd){if(_0x51655d[_0x664e('0x49')]['id']){delete _0x51655d[_0x664e('0x49')]['id'];}return db[_0x664e('0x2b')][_0x664e('0x46')]({'where':{'id':_0x51655d[_0x664e('0x45')]['id']}})[_0x664e('0x22')](handleEntityNotFound(_0x43a6dd,null))['then'](saveUpdates(_0x51655d[_0x664e('0x49')],null))[_0x664e('0x22')](respondWithResult(_0x43a6dd,null))['catch'](handleError(_0x43a6dd,null));};exports[_0x664e('0x23')]=function(_0x3f0544,_0x46111f){return db['Automation'][_0x664e('0x46')]({'where':{'id':_0x3f0544[_0x664e('0x45')]['id']}})[_0x664e('0x22')](handleEntityNotFound(_0x46111f,null))['then'](removeEntity(_0x46111f,null))['catch'](handleError(_0x46111f,null));};exports[_0x664e('0x4a')]=function(_0x5e105c,_0x30db89,_0x15d750){return db[_0x664e('0x4b')]['find']({'where':{'id':_0x5e105c[_0x664e('0x45')]['id']}})[_0x664e('0x22')](handleEntityNotFound(_0x30db89,null))[_0x664e('0x22')](function(_0xccc764){if(_0xccc764){return _0xccc764[_0x664e('0x4a')](_0x5e105c['body'][_0x664e('0x4c')],_[_0x664e('0x4d')](_0x5e105c[_0x664e('0x49')],[_0x664e('0x4c'),'id'])||{});}})[_0x664e('0x22')](respondWithResult(_0x30db89,null))[_0x664e('0x44')](handleError(_0x30db89,null));};exports[_0x664e('0x4e')]=function(_0x2c844b,_0x757554,_0x3dc289){var _0x3792a4={};var _0x3d222d={};var _0x3c02fe;var _0x27331e;return db['Automation']['findOne']({'where':{'id':_0x2c844b['params']['id']}})[_0x664e('0x22')](handleEntityNotFound(_0x757554,null))['then'](function(_0x5e2711){if(_0x5e2711){_0x3c02fe=_0x5e2711;_0x3d222d[_0x664e('0x33')]=_[_0x664e('0x30')](db[_0x664e('0x4b')]['rawAttributes']);_0x3d222d[_0x664e('0x2f')]=_[_0x664e('0x30')](_0x2c844b[_0x664e('0x2f')]);_0x3d222d[_0x664e('0x31')]=_[_0x664e('0x32')](_0x3d222d[_0x664e('0x33')],_0x3d222d[_0x664e('0x2f')]);_0x3792a4[_0x664e('0x34')]=_['intersection'](_0x3d222d[_0x664e('0x33')],qs[_0x664e('0x35')](_0x2c844b[_0x664e('0x2f')][_0x664e('0x35')]));_0x3792a4[_0x664e('0x34')]=_0x3792a4[_0x664e('0x34')][_0x664e('0x36')]?_0x3792a4[_0x664e('0x34')]:_0x3d222d[_0x664e('0x33')];_0x3792a4[_0x664e('0x4f')]=qs[_0x664e('0x39')](_0x2c844b[_0x664e('0x2f')][_0x664e('0x39')]);_0x3792a4[_0x664e('0x3a')]=qs[_0x664e('0x31')](_[_0x664e('0x3b')](_0x2c844b[_0x664e('0x2f')],_0x3d222d['filters']));if(_0x2c844b[_0x664e('0x2f')][_0x664e('0x3e')]){_0x3792a4[_0x664e('0x3a')]=_[_0x664e('0x3f')](_0x3792a4[_0x664e('0x3a')],{'$or':_[_0x664e('0x2a')](_0x3792a4[_0x664e('0x34')],function(_0x31f797){var _0x36ec29={};_0x36ec29[_0x31f797]={'$like':'%'+_0x2c844b[_0x664e('0x2f')][_0x664e('0x3e')]+'%'};return _0x36ec29;})});}_0x3792a4=_['merge']({},_0x3792a4,_0x2c844b[_0x664e('0x40')]);return _0x3c02fe['getConditions'](_0x3792a4);}})[_0x664e('0x22')](function(_0x18d7c5){if(_0x18d7c5){_0x27331e=_0x18d7c5[_0x664e('0x36')];if(!_0x2c844b[_0x664e('0x2f')][_0x664e('0x37')]('nolimit')){_0x3792a4['limit']=qs[_0x664e('0x1c')](_0x2c844b[_0x664e('0x2f')][_0x664e('0x1c')]);_0x3792a4['offset']=qs[_0x664e('0x1a')](_0x2c844b[_0x664e('0x2f')][_0x664e('0x1a')]);}return _0x3c02fe['getConditions'](_0x3792a4);}})[_0x664e('0x22')](function(_0x2775fd){if(_0x2775fd){return _0x2775fd?{'count':_0x27331e,'rows':_0x2775fd}:null;}})[_0x664e('0x22')](respondWithResult(_0x757554,null))[_0x664e('0x44')](handleError(_0x757554,null));};exports[_0x664e('0x50')]=function(_0x3e6722,_0x20dd77,_0x2d1c34){return db[_0x664e('0x51')][_0x664e('0x46')]({'where':{'id':_0x3e6722[_0x664e('0x45')]['id']}})['then'](handleEntityNotFound(_0x20dd77,null))[_0x664e('0x22')](function(_0x46193){if(_0x46193){return _0x46193['addActions'](_0x3e6722['body'][_0x664e('0x4c')],_[_0x664e('0x4d')](_0x3e6722[_0x664e('0x49')],['ids','id'])||{});}})[_0x664e('0x22')](respondWithResult(_0x20dd77,null))[_0x664e('0x44')](handleError(_0x20dd77,null));};exports[_0x664e('0x52')]=function(_0x408ff6,_0x4c9a57,_0x467b9e){var _0x5f58e3={};var _0x266fc4={};var _0x1a3169;var _0x4b1fc5;return db[_0x664e('0x2b')][_0x664e('0x53')]({'where':{'id':_0x408ff6[_0x664e('0x45')]['id']}})[_0x664e('0x22')](handleEntityNotFound(_0x4c9a57,null))[_0x664e('0x22')](function(_0x1ab6b0){if(_0x1ab6b0){_0x1a3169=_0x1ab6b0;_0x266fc4[_0x664e('0x33')]=_[_0x664e('0x30')](db[_0x664e('0x51')][_0x664e('0x2c')]);_0x266fc4[_0x664e('0x2f')]=_[_0x664e('0x30')](_0x408ff6[_0x664e('0x2f')]);_0x266fc4[_0x664e('0x31')]=_[_0x664e('0x32')](_0x266fc4[_0x664e('0x33')],_0x266fc4[_0x664e('0x2f')]);_0x5f58e3['attributes']=_['intersection'](_0x266fc4[_0x664e('0x33')],qs[_0x664e('0x35')](_0x408ff6[_0x664e('0x2f')]['fields']));_0x5f58e3[_0x664e('0x34')]=_0x5f58e3[_0x664e('0x34')][_0x664e('0x36')]?_0x5f58e3[_0x664e('0x34')]:_0x266fc4[_0x664e('0x33')];_0x5f58e3[_0x664e('0x4f')]=qs[_0x664e('0x39')](_0x408ff6[_0x664e('0x2f')][_0x664e('0x39')]);_0x5f58e3[_0x664e('0x3a')]=qs['filters'](_[_0x664e('0x3b')](_0x408ff6[_0x664e('0x2f')],_0x266fc4['filters']));if(_0x408ff6[_0x664e('0x2f')][_0x664e('0x3e')]){_0x5f58e3['where']=_[_0x664e('0x3f')](_0x5f58e3[_0x664e('0x3a')],{'$or':_[_0x664e('0x2a')](_0x5f58e3[_0x664e('0x34')],function(_0x59f728){var _0x1d15e1={};_0x1d15e1[_0x59f728]={'$like':'%'+_0x408ff6['query'][_0x664e('0x3e')]+'%'};return _0x1d15e1;})});}_0x5f58e3=_[_0x664e('0x3f')]({},_0x5f58e3,_0x408ff6[_0x664e('0x40')]);return _0x1a3169[_0x664e('0x52')](_0x5f58e3);}})[_0x664e('0x22')](function(_0x22b963){if(_0x22b963){_0x4b1fc5=_0x22b963['length'];if(!_0x408ff6[_0x664e('0x2f')]['hasOwnProperty']('nolimit')){_0x5f58e3[_0x664e('0x1c')]=qs['limit'](_0x408ff6[_0x664e('0x2f')][_0x664e('0x1c')]);_0x5f58e3[_0x664e('0x1a')]=qs[_0x664e('0x1a')](_0x408ff6['query'][_0x664e('0x1a')]);}return _0x1a3169[_0x664e('0x52')](_0x5f58e3);}})['then'](function(_0x500795){if(_0x500795){return _0x500795?{'count':_0x4b1fc5,'rows':_0x500795}:null;}})[_0x664e('0x22')](respondWithResult(_0x4c9a57,null))[_0x664e('0x44')](handleError(_0x4c9a57,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index db66157..04836af 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 _0xdc85=['util','../../config/logger','api','path','rimraf','./automation.attributes','exports','define','Automation','tools_automations','lodash'];(function(_0x164af1,_0x3cf772){var _0x5d81a2=function(_0xa57547){while(--_0xa57547){_0x164af1['push'](_0x164af1['shift']());}};_0x5d81a2(++_0x3cf772);}(_0xdc85,0x196));var _0x5dc8=function(_0x2f2a8b,_0x377a31){_0x2f2a8b=_0x2f2a8b-0x0;var _0x3f795b=_0xdc85[_0x2f2a8b];return _0x3f795b;};'use strict';var _=require(_0x5dc8('0x0'));var util=require(_0x5dc8('0x1'));var logger=require(_0x5dc8('0x2'))(_0x5dc8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5dc8('0x4'));var rimraf=require(_0x5dc8('0x5'));var config=require('../../config/environment');var attributes=require(_0x5dc8('0x6'));module[_0x5dc8('0x7')]=function(_0x39c1d4,_0x28f784){return _0x39c1d4[_0x5dc8('0x8')](_0x5dc8('0x9'),attributes,{'tableName':_0x5dc8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x26b3=['bluebird','request-promise','./automation.attributes','define','Automation','tools_automations','util','../../config/logger','api'];(function(_0x404fa0,_0xf828f7){var _0x1d7c6b=function(_0x40b247){while(--_0x40b247){_0x404fa0['push'](_0x404fa0['shift']());}};_0x1d7c6b(++_0xf828f7);}(_0x26b3,0x84));var _0x326b=function(_0x1743c8,_0x331a38){_0x1743c8=_0x1743c8-0x0;var _0x1e975c=_0x26b3[_0x1743c8];return _0x1e975c;};'use strict';var _=require('lodash');var util=require(_0x326b('0x0'));var logger=require(_0x326b('0x1'))(_0x326b('0x2'));var moment=require('moment');var BPromise=require(_0x326b('0x3'));var rp=require(_0x326b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x326b('0x5'));module['exports']=function(_0x5a6652,_0x5033f7){return _0x5a6652[_0x326b('0x6')](_0x326b('0x7'),attributes,{'tableName':_0x326b('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 a358126..2dc01f0 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 _0xd824=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','randomstring','ioredis'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xd824,0xc2));var _0x4d82=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd824[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x4d82('0x0'));var util=require(_0x4d82('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4d82('0x2'));var fs=require('fs');var Redis=require(_0x4d82('0x3'));var db=require(_0x4d82('0x4'))['db'];var utils=require(_0x4d82('0x5'));var logger=require(_0x4d82('0x6'))(_0x4d82('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4d82('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b842f,_0x464caf,_0xb54db2){return new BPromise(function(_0x13d624,_0x5cccb6){return client[_0x4d82('0x9')](_0x4b842f,_0xb54db2)['then'](function(_0x5356cd){logger[_0x4d82('0xa')](_0x4d82('0xb'),_0x464caf,_0x4d82('0xc'));logger['debug'](_0x4d82('0xd'),_0x464caf,'request\x20sent',JSON[_0x4d82('0xe')](_0x5356cd));if(_0x5356cd[_0x4d82('0xf')]){if(_0x5356cd[_0x4d82('0xf')]['code']===0x1f4){logger['error'](_0x4d82('0xb'),_0x464caf,_0x5356cd[_0x4d82('0xf')][_0x4d82('0x10')]);return _0x5cccb6(_0x5356cd[_0x4d82('0xf')]['message']);}logger[_0x4d82('0xf')](_0x4d82('0xb'),_0x464caf,_0x5356cd[_0x4d82('0xf')]['message']);return _0x13d624(_0x5356cd[_0x4d82('0xf')]['message']);}else{logger[_0x4d82('0xa')]('Automation,\x20%s,\x20%s',_0x464caf,_0x4d82('0xc'));_0x13d624(_0x5356cd['result'][_0x4d82('0x10')]);}})[_0x4d82('0x11')](function(_0x461476){logger[_0x4d82('0xf')](_0x4d82('0xb'),_0x464caf,_0x461476);_0x5cccb6(_0x461476);});});} \ No newline at end of file +var _0x8a9a=['rpc','../../config/environment','jayson/promise','client','request','then','info','Automation,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x19cb2e,_0x1ae057){var _0x5abc62=function(_0x39cfe6){while(--_0x39cfe6){_0x19cb2e['push'](_0x19cb2e['shift']());}};_0x5abc62(++_0x1ae057);}(_0x8a9a,0x17f));var _0xa8a9=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x8a9a[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0xa8a9('0x0'));var moment=require(_0xa8a9('0x1'));var BPromise=require(_0xa8a9('0x2'));var rs=require(_0xa8a9('0x3'));var fs=require('fs');var Redis=require(_0xa8a9('0x4'));var db=require(_0xa8a9('0x5'))['db'];var utils=require(_0xa8a9('0x6'));var logger=require(_0xa8a9('0x7'))(_0xa8a9('0x8'));var config=require(_0xa8a9('0x9'));var jayson=require(_0xa8a9('0xa'));var client=jayson[_0xa8a9('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24a2bc,_0x4a091d,_0x1b4873){return new BPromise(function(_0x129e9f,_0x1477b0){return client[_0xa8a9('0xc')](_0x24a2bc,_0x1b4873)[_0xa8a9('0xd')](function(_0x4ebe24){logger[_0xa8a9('0xe')](_0xa8a9('0xf'),_0x4a091d,'request\x20sent');logger[_0xa8a9('0x10')]('Automation,\x20%s,\x20%s,\x20%s',_0x4a091d,_0xa8a9('0x11'),JSON[_0xa8a9('0x12')](_0x4ebe24));if(_0x4ebe24['error']){if(_0x4ebe24[_0xa8a9('0x13')][_0xa8a9('0x14')]===0x1f4){logger[_0xa8a9('0x13')](_0xa8a9('0xf'),_0x4a091d,_0x4ebe24[_0xa8a9('0x13')][_0xa8a9('0x15')]);return _0x1477b0(_0x4ebe24['error'][_0xa8a9('0x15')]);}logger[_0xa8a9('0x13')](_0xa8a9('0xf'),_0x4a091d,_0x4ebe24['error']['message']);return _0x129e9f(_0x4ebe24[_0xa8a9('0x13')][_0xa8a9('0x15')]);}else{logger[_0xa8a9('0xe')]('Automation,\x20%s,\x20%s',_0x4a091d,_0xa8a9('0x11'));_0x129e9f(_0x4ebe24[_0xa8a9('0x16')]['message']);}})['catch'](function(_0x1039c9){logger[_0xa8a9('0x13')](_0xa8a9('0xf'),_0x4a091d,_0x1039c9);_0x1477b0(_0x1039c9);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index c8b2d68..ec4a264 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 _0x740a=['get','/:id','show','getConditions','/:id/actions','post','/:id/conditions','addConditions','addActions','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index'];(function(_0x1d9be9,_0x4dfc4e){var _0x571e2d=function(_0x1fd7e1){while(--_0x1fd7e1){_0x1d9be9['push'](_0x1d9be9['shift']());}};_0x571e2d(++_0x4dfc4e);}(_0x740a,0x175));var _0xa740=function(_0x4c0a30,_0x196192){_0x4c0a30=_0x4c0a30-0x0;var _0x219ed8=_0x740a[_0x4c0a30];return _0x219ed8;};'use strict';var multer=require(_0xa740('0x0'));var util=require(_0xa740('0x1'));var path=require(_0xa740('0x2'));var timeout=require(_0xa740('0x3'));var express=require(_0xa740('0x4'));var router=express[_0xa740('0x5')]();var fs_extra=require(_0xa740('0x6'));var auth=require(_0xa740('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa740('0x8'));var controller=require('./automation.controller');router['get']('/',auth[_0xa740('0x9')](),controller[_0xa740('0xa')]);router[_0xa740('0xb')](_0xa740('0xc'),auth[_0xa740('0x9')](),controller[_0xa740('0xd')]);router[_0xa740('0xb')]('/:id/conditions',auth[_0xa740('0x9')](),controller[_0xa740('0xe')]);router[_0xa740('0xb')](_0xa740('0xf'),auth[_0xa740('0x9')](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xa740('0x10')](_0xa740('0x11'),auth[_0xa740('0x9')](),controller[_0xa740('0x12')]);router['post']('/:id/actions',auth['isAuthenticated'](),controller[_0xa740('0x13')]);router[_0xa740('0x14')](_0xa740('0xc'),auth[_0xa740('0x9')](),controller[_0xa740('0x15')]);router[_0xa740('0x16')](_0xa740('0xc'),auth[_0xa740('0x9')](),controller[_0xa740('0x17')]);module['exports']=router; \ No newline at end of file +var _0x0a34=['index','/:id','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x188fa4,_0x3e93f0){var _0x5b1d9b=function(_0x176bc1){while(--_0x176bc1){_0x188fa4['push'](_0x188fa4['shift']());}};_0x5b1d9b(++_0x3e93f0);}(_0x0a34,0x12a));var _0x40a3=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x0a34[_0x5a3cf0];return _0x5a64ee;};'use strict';var multer=require(_0x40a3('0x0'));var util=require(_0x40a3('0x1'));var path=require('path');var timeout=require(_0x40a3('0x2'));var express=require(_0x40a3('0x3'));var router=express[_0x40a3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x40a3('0x5'));var interaction=require(_0x40a3('0x6'));var config=require(_0x40a3('0x7'));var controller=require('./automation.controller');router[_0x40a3('0x8')]('/',auth[_0x40a3('0x9')](),controller[_0x40a3('0xa')]);router[_0x40a3('0x8')](_0x40a3('0xb'),auth[_0x40a3('0x9')](),controller['show']);router[_0x40a3('0x8')](_0x40a3('0xc'),auth[_0x40a3('0x9')](),controller[_0x40a3('0xd')]);router[_0x40a3('0x8')](_0x40a3('0xe'),auth['isAuthenticated'](),controller[_0x40a3('0xf')]);router[_0x40a3('0x10')]('/',auth[_0x40a3('0x9')](),controller['create']);router[_0x40a3('0x10')](_0x40a3('0xc'),auth['isAuthenticated'](),controller[_0x40a3('0x11')]);router[_0x40a3('0x10')]('/:id/actions',auth[_0x40a3('0x9')](),controller[_0x40a3('0x12')]);router['put'](_0x40a3('0xb'),auth[_0x40a3('0x9')](),controller[_0x40a3('0x13')]);router[_0x40a3('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x40a3('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 990c764..c36bfae 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 _0xbaaa=['#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\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'];(function(_0x2b9cce,_0xbb8890){var _0x4e4ddf=function(_0x5ef3cd){while(--_0x5ef3cd){_0x2b9cce['push'](_0x2b9cce['shift']());}};_0x4e4ddf(++_0xbb8890);}(_0xbaaa,0x137));var _0xabaa=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xbaaa[_0xaa0309];return _0x5de7ce;};'use strict';var Sequelize=require(_0xabaa('0x0'));module['exports']={'name':{'type':Sequelize[_0xabaa('0x1')],'unique':_0xabaa('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xabaa('0x3')]('ivr'),'allowNull':![],'defaultValue':_0xabaa('0x4')},'description':{'type':Sequelize[_0xabaa('0x1')]},'active':{'type':Sequelize[_0xabaa('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xabaa('0x6')](0x4)[_0xabaa('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xabaa('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xabaa('0x6')](0x3)[_0xabaa('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xabaa('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xabaa('0x6')](0x3)[_0xabaa('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xabaa('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xabaa('0x6')](0x5)[_0xabaa('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xabaa('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xabaa('0x6')](0x3)[_0xabaa('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xabaa('0x6')](0x5)[_0xabaa('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xabaa('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xabaa('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xabaa('0x6')](0x5)[_0xabaa('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xabaa('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xabaa('0xc')},'dialTimezone':{'type':Sequelize[_0xabaa('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xabaa('0xd')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xabaa('0xe'),_0xabaa('0xf'),_0xabaa('0x10')),'defaultValue':_0xabaa('0xe')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xabaa('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0xabaa('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xabaa('0x12')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xabaa('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xabaa('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xabaa('0x6')](0x9)[_0xabaa('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xabaa('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xabaa('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xabaa('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xabaa('0x6')](0x9)[_0xabaa('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xabaa('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xabaa('0x6')](0x9)[_0xabaa('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xabaa('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xabaa('0x6')](0x9)[_0xabaa('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xabaa('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xabaa('0x6')](0x5)[_0xabaa('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xabaa('0x6')](0x9)[_0xabaa('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xabaa('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xabaa('0x1a'),_0xabaa('0x1b')),'defaultValue':_0xabaa('0x1a')},'dialPrefix':{'type':Sequelize[_0xabaa('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xabaa('0x1c')},'dialCutDigit':{'type':Sequelize[_0xabaa('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xabaa('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xabaa('0x6')](0x3)[_0xabaa('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xabaa('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xabaa('0x6')](0x5)[_0xabaa('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xabaa('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0xabaa('0x6')](0x3)[_0xabaa('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xabaa('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0xabaa('0x6')](0x5)[_0xabaa('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xabaa('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xabaa('0x6')](0x3)[_0xabaa('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xabaa('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xabaa('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xabaa('0x6')](0x3)[_0xabaa('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xabaa('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xabaa('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xabaa('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xabaa('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xabaa('0x24')}}; \ No newline at end of file +var _0xf71f=['#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#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','ASC','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\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)'];(function(_0x47003d,_0x5e27ac){var _0x20715b=function(_0x260128){while(--_0x260128){_0x47003d['push'](_0x47003d['shift']());}};_0x20715b(++_0x5e27ac);}(_0xf71f,0xcb));var _0xff71=function(_0x54d6d0,_0x1edbb1){_0x54d6d0=_0x54d6d0-0x0;var _0x599158=_0xf71f[_0x54d6d0];return _0x599158;};'use strict';var Sequelize=require(_0xff71('0x0'));module[_0xff71('0x1')]={'name':{'type':Sequelize[_0xff71('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xff71('0x3')](_0xff71('0x4')),'allowNull':![],'defaultValue':_0xff71('0x4')},'description':{'type':Sequelize[_0xff71('0x2')]},'active':{'type':Sequelize[_0xff71('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xff71('0x6')](0x4)[_0xff71('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xff71('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xff71('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xff71('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xff71('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xff71('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xff71('0x6')](0x5)[_0xff71('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xff71('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xff71('0x6')](0x3)[_0xff71('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xff71('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xff71('0x6')](0x5)[_0xff71('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xff71('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xff71('0x6')](0x3)[_0xff71('0x7')],'defaultValue':0x3,'comment':_0xff71('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xff71('0x6')](0x5)[_0xff71('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xff71('0x6')](0x3)[_0xff71('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xff71('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xff71('0x2')],'defaultValue':_0xff71('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xff71('0x3')]('always','never',_0xff71('0x11')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xff71('0x5')],'defaultValue':0x0,'comment':_0xff71('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xff71('0x6')](0x9)[_0xff71('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xff71('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xff71('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xff71('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xff71('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xff71('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xff71('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xff71('0x6')](0x9)[_0xff71('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xff71('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xff71('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xff71('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xff71('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xff71('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xff71('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xff71('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xff71('0x6')](0x9)[_0xff71('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xff71('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xff71('0x3')]('DESC',_0xff71('0x1b')),'defaultValue':_0xff71('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xff71('0x6')](0x3)[_0xff71('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xff71('0x1d')},'dialCutDigit':{'type':Sequelize[_0xff71('0x6')](0x3)[_0xff71('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xff71('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xff71('0x6')](0x3)[_0xff71('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xff71('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xff71('0x6')](0x5)[_0xff71('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xff71('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xff71('0x6')](0x3)[_0xff71('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xff71('0x21')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xff71('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xff71('0x6')](0x3)[_0xff71('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xff71('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xff71('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xff71('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0xff71('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xff71('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0xff71('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xff71('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xff71('0x6')](0x3)[_0xff71('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xff71('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xff71('0x6')](0x5)[_0xff71('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 8397c07..4d7871d 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 _0x7cd6=['omit','user','update','getHoppers','findOne','CmHopper','hasOwnProperty','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','ids','spread','dialCheckDuplicateType','always','into','fromQuery','phone','scheduledAt','ListId','field','NOW()','ContactId','CmListId','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','from','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','phone\x20IS\x20NOT\x20NULL','cm_contacts','insert','cm_hopper_additional_phones','OrderBy','h.id','ci.item','ci.OrderBY','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','to-csv','querystring','ioredis','../../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','then','destroy','IvrCampaigns','UserProfileResource','error','stack','send','index','Campaign','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','length','nolimit','order','sort','pick','merge','where','map','filter','count','includeAll','include','findAll','rows','catch','params','fields','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','body'];(function(_0x24679e,_0x22d9d7){var _0x291f21=function(_0x329529){while(--_0x329529){_0x24679e['push'](_0x24679e['shift']());}};_0x291f21(++_0x22d9d7);}(_0x7cd6,0x1f4));var _0x67cd=function(_0x735d48,_0x54ff20){_0x735d48=_0x735d48-0x0;var _0x34441e=_0x7cd6[_0x735d48];return _0x34441e;};'use strict';var emlformat=require(_0x67cd('0x0'));var rimraf=require(_0x67cd('0x1'));var zipdir=require(_0x67cd('0x2'));var jsonpatch=require(_0x67cd('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x67cd('0x4'));var Mustache=require(_0x67cd('0x5'));var util=require(_0x67cd('0x6'));var path=require('path');var sox=require(_0x67cd('0x7'));var csv=require('to-csv');var ejs=require(_0x67cd('0x8'));var fs=require('fs');var fs_extra=require(_0x67cd('0x9'));var _=require(_0x67cd('0xa'));var squel=require(_0x67cd('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x67cd('0xc'));var querystring=require(_0x67cd('0xd'));var Papa=require('papaparse');var Redis=require(_0x67cd('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x67cd('0xf'));var logger=require(_0x67cd('0x10'))(_0x67cd('0x11'));var utils=require(_0x67cd('0x12'));var config=require(_0x67cd('0x13'));var licenseUtil=require(_0x67cd('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0a05,_0x39c6ca){_0x39c6ca=_0x39c6ca||0xcc;return function(_0x1693d7){if(_0x1693d7){return _0x2a0a05[_0x67cd('0x15')](_0x39c6ca);}return _0x2a0a05[_0x67cd('0x16')](_0x39c6ca)[_0x67cd('0x17')]();};}function respondWithResult(_0x158bf0,_0x2d5aca){_0x2d5aca=_0x2d5aca||0xc8;return function(_0x15da7d){if(_0x15da7d){return _0x158bf0[_0x67cd('0x16')](_0x2d5aca)[_0x67cd('0x18')](_0x15da7d);}};}function respondWithFilteredResult(_0xc3fb41,_0x4c5b6d){return function(_0x3fdccf){if(_0x3fdccf){var _0x465590=typeof _0x4c5b6d[_0x67cd('0x19')]===_0x67cd('0x1a')&&typeof _0x4c5b6d[_0x67cd('0x1b')]==='undefined';var _0xb147d8=_0x3fdccf['count'];var _0x30cb35=_0x465590?0x0:_0x4c5b6d['offset'];var _0x5596e0=_0x465590?_0x3fdccf['count']:_0x4c5b6d[_0x67cd('0x19')]+_0x4c5b6d[_0x67cd('0x1b')];var _0x4370e0;if(_0x5596e0>=_0xb147d8){_0x5596e0=_0xb147d8;_0x4370e0=0xc8;}else{_0x4370e0=0xce;}_0xc3fb41[_0x67cd('0x16')](_0x4370e0);return _0xc3fb41[_0x67cd('0x1c')](_0x67cd('0x1d'),_0x30cb35+'-'+_0x5596e0+'/'+_0xb147d8)[_0x67cd('0x18')](_0x3fdccf);}return null;};}function patchUpdates(_0x2011e5){return function(_0x1fff15){try{jsonpatch[_0x67cd('0x1e')](_0x1fff15,_0x2011e5,!![]);}catch(_0x591019){return BPromise[_0x67cd('0x1f')](_0x591019);}return _0x1fff15[_0x67cd('0x20')]();};}function saveUpdates(_0x1003b6,_0x22b153){return function(_0x512760){if(_0x512760){return _0x512760['update'](_0x1003b6)[_0x67cd('0x21')](function(_0x35ba2f){return _0x35ba2f;});}return null;};}function removeEntity(_0x21d5f1,_0x5f042c){return function(_0x2230c1){if(_0x2230c1){return _0x2230c1[_0x67cd('0x22')]()['then'](function(){var _0x3428aa=_0x2230c1['get']({'plain':!![]});var _0x6b9e7=_0x67cd('0x23');return db[_0x67cd('0x24')][_0x67cd('0x22')]({'where':{'type':_0x6b9e7,'resourceId':_0x3428aa['id']}})[_0x67cd('0x21')](function(){return _0x2230c1;});})['then'](function(){_0x21d5f1[_0x67cd('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x104b8e,_0x46002e){return function(_0x363b24){if(!_0x363b24){_0x104b8e[_0x67cd('0x15')](0x194);}return _0x363b24;};}function handleError(_0x55caae,_0x4c1d39){_0x4c1d39=_0x4c1d39||0x1f4;return function(_0x1f252d){logger[_0x67cd('0x25')](_0x1f252d[_0x67cd('0x26')]);if(_0x1f252d['name']){delete _0x1f252d['name'];}_0x55caae[_0x67cd('0x16')](_0x4c1d39)[_0x67cd('0x27')](_0x1f252d);};}exports[_0x67cd('0x28')]=function(_0x3868af,_0x49e1e2){var _0x1578ce={},_0x2fbcca={},_0x331aba={'count':0x0,'rows':[]};var _0x554566=_['map'](db[_0x67cd('0x29')][_0x67cd('0x2a')],function(_0x528bb2){return{'name':_0x528bb2[_0x67cd('0x2b')],'type':_0x528bb2[_0x67cd('0x2c')][_0x67cd('0x2d')]};});_0x2fbcca[_0x67cd('0x2e')]=_['map'](_0x554566,_0x67cd('0x2f'));_0x2fbcca[_0x67cd('0x30')]=_[_0x67cd('0x31')](_0x3868af[_0x67cd('0x30')]);_0x2fbcca[_0x67cd('0x32')]=_[_0x67cd('0x33')](_0x2fbcca[_0x67cd('0x2e')],_0x2fbcca[_0x67cd('0x30')]);_0x1578ce[_0x67cd('0x34')]=_[_0x67cd('0x33')](_0x2fbcca['model'],qs['fields'](_0x3868af[_0x67cd('0x30')]['fields']));_0x1578ce[_0x67cd('0x34')]=_0x1578ce[_0x67cd('0x34')][_0x67cd('0x35')]?_0x1578ce['attributes']:_0x2fbcca[_0x67cd('0x2e')];if(!_0x3868af[_0x67cd('0x30')]['hasOwnProperty'](_0x67cd('0x36'))){_0x1578ce['limit']=qs[_0x67cd('0x1b')](_0x3868af[_0x67cd('0x30')]['limit']);_0x1578ce[_0x67cd('0x19')]=qs[_0x67cd('0x19')](_0x3868af[_0x67cd('0x30')][_0x67cd('0x19')]);}_0x1578ce[_0x67cd('0x37')]=qs[_0x67cd('0x38')](_0x3868af[_0x67cd('0x30')][_0x67cd('0x38')]);_0x1578ce['where']=qs[_0x67cd('0x32')](_[_0x67cd('0x39')](_0x3868af[_0x67cd('0x30')],_0x2fbcca[_0x67cd('0x32')]),_0x554566);if(_0x3868af[_0x67cd('0x30')]['filter']){_0x1578ce['where']=_[_0x67cd('0x3a')](_0x1578ce[_0x67cd('0x3b')],{'$or':_[_0x67cd('0x3c')](_0x554566,function(_0x2bb9d1){if(_0x2bb9d1['type']!=='VIRTUAL'){var _0x8f018e={};_0x8f018e[_0x2bb9d1[_0x67cd('0x2f')]]={'$like':'%'+_0x3868af[_0x67cd('0x30')][_0x67cd('0x3d')]+'%'};return _0x8f018e;}})});}_0x1578ce=_[_0x67cd('0x3a')]({},_0x1578ce,_0x3868af['options']);var _0x363c49={'where':_0x1578ce[_0x67cd('0x3b')]};return db[_0x67cd('0x29')][_0x67cd('0x3e')](_0x363c49)['then'](function(_0x2bccd4){_0x331aba[_0x67cd('0x3e')]=_0x2bccd4;if(_0x3868af[_0x67cd('0x30')][_0x67cd('0x3f')]){_0x1578ce[_0x67cd('0x40')]=[{'all':!![]}];}return db[_0x67cd('0x29')][_0x67cd('0x41')](_0x1578ce);})[_0x67cd('0x21')](function(_0x9ab74f){_0x331aba[_0x67cd('0x42')]=_0x9ab74f;return _0x331aba;})['then'](respondWithFilteredResult(_0x49e1e2,_0x1578ce))[_0x67cd('0x43')](handleError(_0x49e1e2,null));};exports['show']=function(_0x418859,_0x595ed3){var _0xbcaa74={'raw':![],'where':{'id':_0x418859[_0x67cd('0x44')]['id']}},_0x956307={};_0x956307[_0x67cd('0x2e')]=_[_0x67cd('0x31')](db[_0x67cd('0x29')][_0x67cd('0x2a')]);_0x956307[_0x67cd('0x30')]=_[_0x67cd('0x31')](_0x418859[_0x67cd('0x30')]);_0x956307[_0x67cd('0x32')]=_[_0x67cd('0x33')](_0x956307[_0x67cd('0x2e')],_0x956307[_0x67cd('0x30')]);_0xbcaa74[_0x67cd('0x34')]=_['intersection'](_0x956307[_0x67cd('0x2e')],qs[_0x67cd('0x45')](_0x418859[_0x67cd('0x30')]['fields']));_0xbcaa74[_0x67cd('0x34')]=_0xbcaa74['attributes'][_0x67cd('0x35')]?_0xbcaa74[_0x67cd('0x34')]:_0x956307['model'];if(_0x418859[_0x67cd('0x30')][_0x67cd('0x3f')]){_0xbcaa74[_0x67cd('0x40')]=[{'all':!![]}];}_0xbcaa74=_[_0x67cd('0x3a')]({},_0xbcaa74,_0x418859[_0x67cd('0x46')]);return db[_0x67cd('0x29')][_0x67cd('0x47')](_0xbcaa74)[_0x67cd('0x21')](handleEntityNotFound(_0x595ed3,null))[_0x67cd('0x21')](respondWithResult(_0x595ed3,null))[_0x67cd('0x43')](handleError(_0x595ed3,null));};exports['create']=function(_0x227278,_0x591450){return db[_0x67cd('0x29')][_0x67cd('0x48')](_0x227278['body'],{})['then'](function(_0x5a0cb9){var _0x1fd7f0=_0x227278['user']['get']({'plain':!![]});if(!_0x1fd7f0)throw new Error(_0x67cd('0x49'));if(_0x1fd7f0[_0x67cd('0x4a')]==='user'){var _0x5bdafb=_0x5a0cb9[_0x67cd('0x4b')]({'plain':!![]});var _0x7c94ac='IvrCampaigns';return db[_0x67cd('0x4c')][_0x67cd('0x47')]({'where':{'name':_0x7c94ac,'userProfileId':_0x1fd7f0[_0x67cd('0x4d')]},'raw':!![]})[_0x67cd('0x21')](function(_0x49d2f5){if(_0x49d2f5&&_0x49d2f5[_0x67cd('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x5bdafb['name'],'resourceId':_0x5bdafb['id'],'type':_0x49d2f5[_0x67cd('0x2f')],'sectionId':_0x49d2f5['id']},{})[_0x67cd('0x21')](function(){return _0x5a0cb9;});}else{return _0x5a0cb9;}})['catch'](function(_0x4f357f){logger[_0x67cd('0x25')](_0x67cd('0x4f'),_0x4f357f);throw _0x4f357f;});}return _0x5a0cb9;})[_0x67cd('0x21')](respondWithResult(_0x591450,0xc9))[_0x67cd('0x43')](handleError(_0x591450,null));};exports[_0x67cd('0x50')]=function(_0x2ba07f,_0x5f382d){var _0x19bc5d={'where':{'id':_0x2ba07f[_0x67cd('0x44')]['id']}},_0x4a07bb={};_0x4a07bb[_0x67cd('0x2e')]=_[_0x67cd('0x31')](db[_0x67cd('0x29')][_0x67cd('0x2a')]);_0x19bc5d[_0x67cd('0x34')]=_[_0x67cd('0x33')](_0x4a07bb[_0x67cd('0x2e')],qs[_0x67cd('0x45')](_0x2ba07f['query']['fields']));_0x19bc5d[_0x67cd('0x34')]=_0x19bc5d[_0x67cd('0x34')][_0x67cd('0x35')]?_0x19bc5d[_0x67cd('0x34')]:_0x4a07bb[_0x67cd('0x2e')];if(_0x2ba07f['query'][_0x67cd('0x3f')]){_0x19bc5d[_0x67cd('0x40')]=[{'all':!![]}];}_0x19bc5d=_[_0x67cd('0x3a')]({},_0x19bc5d,_0x2ba07f['options']);return db[_0x67cd('0x29')]['find'](_0x19bc5d)['then'](handleEntityNotFound(_0x5f382d,null))[_0x67cd('0x21')](function(_0x3dacaa){if(_0x3dacaa){var _0x15234d=_0x3dacaa[_0x67cd('0x4b')]({'plain':!![]});_0x15234d=qs['omit'](_0x15234d,['id',_0x67cd('0x51'),_0x67cd('0x52')]);_0x2ba07f[_0x67cd('0x53')]=_[_0x67cd('0x54')](_0x2ba07f[_0x67cd('0x53')],['id',_0x67cd('0x51'),_0x67cd('0x52')]);return db['Campaign'][_0x67cd('0x48')](_[_0x67cd('0x3a')](_0x15234d,_0x2ba07f[_0x67cd('0x53')]),{'include':_0x2ba07f[_0x67cd('0x30')]['includeAll']?[{'all':!![]}]:undefined})[_0x67cd('0x21')](function(_0x149a39){var _0x391558=_0x2ba07f['user'][_0x67cd('0x4b')]({'plain':!![]});if(!_0x391558)throw new Error(_0x67cd('0x49'));if(_0x391558[_0x67cd('0x4a')]===_0x67cd('0x55')){var _0x5632db=_0x149a39[_0x67cd('0x4b')]({'plain':!![]});var _0x4e944e=_0x67cd('0x23');return db['UserProfileSection'][_0x67cd('0x47')]({'where':{'name':_0x4e944e,'userProfileId':_0x391558[_0x67cd('0x4d')]},'raw':!![]})[_0x67cd('0x21')](function(_0x506cdb){if(_0x506cdb&&_0x506cdb[_0x67cd('0x4e')]===0x0){return db[_0x67cd('0x24')][_0x67cd('0x48')]({'name':_0x5632db['name'],'resourceId':_0x5632db['id'],'type':_0x506cdb[_0x67cd('0x2f')],'sectionId':_0x506cdb['id']},{})[_0x67cd('0x21')](function(){return _0x149a39;});}else{return _0x149a39;}})['catch'](function(_0x30b6b1){logger['error'](_0x67cd('0x4f'),_0x30b6b1);throw _0x30b6b1;});}return _0x149a39;});}})[_0x67cd('0x21')](respondWithResult(_0x5f382d,0xc9))[_0x67cd('0x43')](handleError(_0x5f382d,null));};exports[_0x67cd('0x56')]=function(_0x52fdbe,_0x2745b0){if(_0x52fdbe[_0x67cd('0x53')]['id']){delete _0x52fdbe[_0x67cd('0x53')]['id'];}return db['Campaign']['find']({'where':{'id':_0x52fdbe[_0x67cd('0x44')]['id']}})[_0x67cd('0x21')](handleEntityNotFound(_0x2745b0,null))[_0x67cd('0x21')](saveUpdates(_0x52fdbe['body'],null))[_0x67cd('0x21')](respondWithResult(_0x2745b0,null))['catch'](handleError(_0x2745b0,null));};exports[_0x67cd('0x22')]=function(_0x361df7,_0x35d3e1){return db['Campaign']['find']({'where':{'id':_0x361df7[_0x67cd('0x44')]['id']}})['then'](handleEntityNotFound(_0x35d3e1,null))[_0x67cd('0x21')](removeEntity(_0x35d3e1,null))['catch'](handleError(_0x35d3e1,null));};exports[_0x67cd('0x57')]=function(_0x238ea9,_0x168124,_0x16a22e){var _0x492873={'raw':!![],'where':{}};var _0x5dcb0c={};var _0x185f40={'count':0x0,'rows':[]};return db[_0x67cd('0x29')][_0x67cd('0x58')]({'where':{'id':_0x238ea9[_0x67cd('0x44')]['id']}})[_0x67cd('0x21')](handleEntityNotFound(_0x168124,null))[_0x67cd('0x21')](function(_0x3d745d){if(_0x3d745d){_0x5dcb0c[_0x67cd('0x2e')]=_[_0x67cd('0x31')](db[_0x67cd('0x59')][_0x67cd('0x2a')]);_0x5dcb0c['query']=_[_0x67cd('0x31')](_0x238ea9[_0x67cd('0x30')]);_0x5dcb0c[_0x67cd('0x32')]=_[_0x67cd('0x33')](_0x5dcb0c[_0x67cd('0x2e')],_0x5dcb0c[_0x67cd('0x30')]);_0x492873[_0x67cd('0x34')]=_[_0x67cd('0x33')](_0x5dcb0c[_0x67cd('0x2e')],qs[_0x67cd('0x45')](_0x238ea9['query'][_0x67cd('0x45')]));_0x492873[_0x67cd('0x34')]=_0x492873[_0x67cd('0x34')][_0x67cd('0x35')]?_0x492873['attributes']:_0x5dcb0c[_0x67cd('0x2e')];if(!_0x238ea9[_0x67cd('0x30')][_0x67cd('0x5a')]('nolimit')){_0x492873[_0x67cd('0x1b')]=qs[_0x67cd('0x1b')](_0x238ea9[_0x67cd('0x30')][_0x67cd('0x1b')]);_0x492873['offset']=qs[_0x67cd('0x19')](_0x238ea9[_0x67cd('0x30')][_0x67cd('0x19')]);}_0x492873[_0x67cd('0x37')]=qs[_0x67cd('0x38')](_0x238ea9[_0x67cd('0x30')][_0x67cd('0x38')]);_0x492873[_0x67cd('0x3b')]=qs[_0x67cd('0x32')](_['pick'](_0x238ea9[_0x67cd('0x30')],_0x5dcb0c[_0x67cd('0x32')]));_0x492873[_0x67cd('0x3b')][_0x67cd('0x5b')]=_0x3d745d['id'];if(_0x238ea9[_0x67cd('0x30')][_0x67cd('0x3d')]){_0x492873[_0x67cd('0x3b')]=_[_0x67cd('0x3a')](_0x492873[_0x67cd('0x3b')],{'$or':_[_0x67cd('0x3c')](_0x492873[_0x67cd('0x34')],function(_0x8d313d){var _0x11e473={};_0x11e473[_0x8d313d]={'$like':'%'+_0x238ea9[_0x67cd('0x30')][_0x67cd('0x3d')]+'%'};return _0x11e473;})});}_0x492873=_[_0x67cd('0x3a')]({},_0x492873,_0x238ea9[_0x67cd('0x46')]);return db[_0x67cd('0x59')]['count']({'where':_0x492873[_0x67cd('0x3b')]})['then'](function(_0xfed9d5){_0x185f40['count']=_0xfed9d5;if(_0x238ea9[_0x67cd('0x30')][_0x67cd('0x3f')]){_0x492873['include']=[{'all':!![]}];}return db[_0x67cd('0x59')][_0x67cd('0x41')](_0x492873);})[_0x67cd('0x21')](function(_0x54e89d){_0x185f40['rows']=_0x54e89d;return _0x185f40;});}})[_0x67cd('0x21')](respondWithFilteredResult(_0x168124,_0x492873))[_0x67cd('0x43')](handleError(_0x168124,null));};exports[_0x67cd('0x5c')]=function(_0x392235,_0x33aa3d,_0x2adc5f){var _0x17ce4a={'raw':!![],'where':{}};var _0x198652={};var _0x58afd1={'count':0x0,'rows':[]};return db[_0x67cd('0x29')][_0x67cd('0x58')]({'where':{'id':_0x392235[_0x67cd('0x44')]['id']}})['then'](handleEntityNotFound(_0x33aa3d,null))[_0x67cd('0x21')](function(_0x23fab3){if(_0x23fab3){_0x198652['model']=_[_0x67cd('0x31')](db[_0x67cd('0x5d')]['rawAttributes']);_0x198652['query']=_[_0x67cd('0x31')](_0x392235['query']);_0x198652[_0x67cd('0x32')]=_[_0x67cd('0x33')](_0x198652['model'],_0x198652[_0x67cd('0x30')]);_0x17ce4a[_0x67cd('0x34')]=_[_0x67cd('0x33')](_0x198652[_0x67cd('0x2e')],qs[_0x67cd('0x45')](_0x392235[_0x67cd('0x30')][_0x67cd('0x45')]));_0x17ce4a[_0x67cd('0x34')]=_0x17ce4a['attributes'][_0x67cd('0x35')]?_0x17ce4a['attributes']:_0x198652['model'];if(!_0x392235[_0x67cd('0x30')][_0x67cd('0x5a')](_0x67cd('0x36'))){_0x17ce4a[_0x67cd('0x1b')]=qs['limit'](_0x392235[_0x67cd('0x30')][_0x67cd('0x1b')]);_0x17ce4a[_0x67cd('0x19')]=qs['offset'](_0x392235[_0x67cd('0x30')][_0x67cd('0x19')]);}_0x17ce4a[_0x67cd('0x37')]=qs['sort'](_0x392235[_0x67cd('0x30')][_0x67cd('0x38')]);_0x17ce4a['where']=qs[_0x67cd('0x32')](_['pick'](_0x392235['query'],_0x198652[_0x67cd('0x32')]));_0x17ce4a[_0x67cd('0x3b')][_0x67cd('0x5b')]=_0x23fab3['id'];if(_0x392235[_0x67cd('0x30')][_0x67cd('0x3d')]){_0x17ce4a['where']=_[_0x67cd('0x3a')](_0x17ce4a[_0x67cd('0x3b')],{'$or':_['map'](_0x17ce4a['attributes'],function(_0x4f9060){var _0x5932b2={};_0x5932b2[_0x4f9060]={'$like':'%'+_0x392235['query'][_0x67cd('0x3d')]+'%'};return _0x5932b2;})});}_0x17ce4a=_[_0x67cd('0x3a')]({},_0x17ce4a,_0x392235[_0x67cd('0x46')]);return db[_0x67cd('0x5d')][_0x67cd('0x3e')]({'where':_0x17ce4a[_0x67cd('0x3b')]})[_0x67cd('0x21')](function(_0x18ba85){_0x58afd1['count']=_0x18ba85;if(_0x392235[_0x67cd('0x30')][_0x67cd('0x3f')]){_0x17ce4a['include']=[{'all':!![]}];}return db[_0x67cd('0x5d')][_0x67cd('0x41')](_0x17ce4a);})['then'](function(_0x63f484){_0x58afd1[_0x67cd('0x42')]=_0x63f484;return _0x58afd1;});}})['then'](respondWithFilteredResult(_0x33aa3d,_0x17ce4a))[_0x67cd('0x43')](handleError(_0x33aa3d,null));};exports[_0x67cd('0x5e')]=function(_0x19d061,_0x49025d,_0x4ecb85){var _0x17260c={'raw':!![],'where':{}};var _0x32c769={};var _0x56c50a={'count':0x0,'rows':[]};return db['Campaign'][_0x67cd('0x58')]({'where':{'id':_0x19d061[_0x67cd('0x44')]['id']}})[_0x67cd('0x21')](handleEntityNotFound(_0x49025d,null))[_0x67cd('0x21')](function(_0x526982){if(_0x526982){_0x32c769[_0x67cd('0x2e')]=_[_0x67cd('0x31')](db[_0x67cd('0x5f')][_0x67cd('0x2a')]);_0x32c769[_0x67cd('0x30')]=_[_0x67cd('0x31')](_0x19d061[_0x67cd('0x30')]);_0x32c769['filters']=_['intersection'](_0x32c769[_0x67cd('0x2e')],_0x32c769['query']);_0x17260c[_0x67cd('0x34')]=_[_0x67cd('0x33')](_0x32c769[_0x67cd('0x2e')],qs['fields'](_0x19d061[_0x67cd('0x30')][_0x67cd('0x45')]));_0x17260c[_0x67cd('0x34')]=_0x17260c[_0x67cd('0x34')][_0x67cd('0x35')]?_0x17260c[_0x67cd('0x34')]:_0x32c769['model'];if(!_0x19d061[_0x67cd('0x30')][_0x67cd('0x5a')](_0x67cd('0x36'))){_0x17260c[_0x67cd('0x1b')]=qs[_0x67cd('0x1b')](_0x19d061[_0x67cd('0x30')]['limit']);_0x17260c[_0x67cd('0x19')]=qs[_0x67cd('0x19')](_0x19d061[_0x67cd('0x30')][_0x67cd('0x19')]);}_0x17260c['order']=qs[_0x67cd('0x38')](_0x19d061[_0x67cd('0x30')]['sort']);_0x17260c['where']=qs[_0x67cd('0x32')](_[_0x67cd('0x39')](_0x19d061[_0x67cd('0x30')],_0x32c769['filters']));_0x17260c[_0x67cd('0x3b')][_0x67cd('0x5b')]=_0x526982['id'];if(_0x19d061['query']['filter']){_0x17260c[_0x67cd('0x3b')]=_[_0x67cd('0x3a')](_0x17260c[_0x67cd('0x3b')],{'$or':_[_0x67cd('0x3c')](_0x17260c[_0x67cd('0x34')],function(_0x4ea3f5){var _0x4fbe6b={};_0x4fbe6b[_0x4ea3f5]={'$like':'%'+_0x19d061[_0x67cd('0x30')][_0x67cd('0x3d')]+'%'};return _0x4fbe6b;})});}_0x17260c=_[_0x67cd('0x3a')]({},_0x17260c,_0x19d061['options']);return db[_0x67cd('0x5f')][_0x67cd('0x3e')]({'where':_0x17260c[_0x67cd('0x3b')]})[_0x67cd('0x21')](function(_0x57997b){_0x56c50a[_0x67cd('0x3e')]=_0x57997b;if(_0x19d061[_0x67cd('0x30')][_0x67cd('0x3f')]){_0x17260c['include']=[{'all':!![]}];}return db[_0x67cd('0x5f')][_0x67cd('0x41')](_0x17260c);})[_0x67cd('0x21')](function(_0x153531){_0x56c50a[_0x67cd('0x42')]=_0x153531;return _0x56c50a;});}})[_0x67cd('0x21')](respondWithFilteredResult(_0x49025d,_0x17260c))['catch'](handleError(_0x49025d,null));};exports[_0x67cd('0x60')]=function(_0x5722d2,_0x30ee6a,_0x3c0ad6){var _0x523216={'raw':!![],'where':{}};var _0x411b54={};var _0x4af7e4={'count':0x0,'rows':[]};return db[_0x67cd('0x29')]['findOne']({'where':{'id':_0x5722d2['params']['id']}})['then'](handleEntityNotFound(_0x30ee6a,null))[_0x67cd('0x21')](function(_0x73271c){if(_0x73271c){_0x411b54[_0x67cd('0x2e')]=_[_0x67cd('0x31')](db[_0x67cd('0x61')]['rawAttributes']);_0x411b54[_0x67cd('0x30')]=_[_0x67cd('0x31')](_0x5722d2[_0x67cd('0x30')]);_0x411b54['filters']=_[_0x67cd('0x33')](_0x411b54['model'],_0x411b54[_0x67cd('0x30')]);_0x523216[_0x67cd('0x34')]=_['intersection'](_0x411b54[_0x67cd('0x2e')],qs[_0x67cd('0x45')](_0x5722d2[_0x67cd('0x30')][_0x67cd('0x45')]));_0x523216[_0x67cd('0x34')]=_0x523216[_0x67cd('0x34')][_0x67cd('0x35')]?_0x523216[_0x67cd('0x34')]:_0x411b54[_0x67cd('0x2e')];if(!_0x5722d2[_0x67cd('0x30')][_0x67cd('0x5a')](_0x67cd('0x36'))){_0x523216[_0x67cd('0x1b')]=qs[_0x67cd('0x1b')](_0x5722d2[_0x67cd('0x30')][_0x67cd('0x1b')]);_0x523216['offset']=qs[_0x67cd('0x19')](_0x5722d2[_0x67cd('0x30')]['offset']);}_0x523216[_0x67cd('0x37')]=qs['sort'](_0x5722d2[_0x67cd('0x30')][_0x67cd('0x38')]);_0x523216[_0x67cd('0x3b')]=qs[_0x67cd('0x32')](_[_0x67cd('0x39')](_0x5722d2[_0x67cd('0x30')],_0x411b54['filters']));_0x523216[_0x67cd('0x3b')][_0x67cd('0x5b')]=_0x73271c['id'];if(_0x5722d2[_0x67cd('0x30')][_0x67cd('0x3d')]){_0x523216['where']=_['merge'](_0x523216['where'],{'$or':_[_0x67cd('0x3c')](_0x523216[_0x67cd('0x34')],function(_0x2f2933){var _0xdce66d={};_0xdce66d[_0x2f2933]={'$like':'%'+_0x5722d2['query'][_0x67cd('0x3d')]+'%'};return _0xdce66d;})});}_0x523216=_[_0x67cd('0x3a')]({},_0x523216,_0x5722d2[_0x67cd('0x46')]);return db['CmHopperBlack'][_0x67cd('0x3e')]({'where':_0x523216[_0x67cd('0x3b')]})['then'](function(_0x2a8068){_0x4af7e4[_0x67cd('0x3e')]=_0x2a8068;if(_0x5722d2[_0x67cd('0x30')][_0x67cd('0x3f')]){_0x523216[_0x67cd('0x40')]=[{'all':!![]}];}return db[_0x67cd('0x61')][_0x67cd('0x41')](_0x523216);})[_0x67cd('0x21')](function(_0x427bbc){_0x4af7e4['rows']=_0x427bbc;return _0x4af7e4;});}})['then'](respondWithFilteredResult(_0x30ee6a,_0x523216))['catch'](handleError(_0x30ee6a,null));};exports['getLists']=function(_0x44afe,_0x102b0d,_0x4e8932){var _0x571d08={};var _0x55907b={};var _0x3ba364;var _0xda520e;return db[_0x67cd('0x29')][_0x67cd('0x58')]({'where':{'id':_0x44afe[_0x67cd('0x44')]['id']}})[_0x67cd('0x21')](handleEntityNotFound(_0x102b0d,null))[_0x67cd('0x21')](function(_0x3b082f){if(_0x3b082f){_0x3ba364=_0x3b082f;_0x55907b['model']=_[_0x67cd('0x31')](db['CmList'][_0x67cd('0x2a')]);_0x55907b[_0x67cd('0x30')]=_[_0x67cd('0x31')](_0x44afe['query']);_0x55907b[_0x67cd('0x32')]=_[_0x67cd('0x33')](_0x55907b[_0x67cd('0x2e')],_0x55907b['query']);_0x571d08[_0x67cd('0x34')]=_[_0x67cd('0x33')](_0x55907b['model'],qs['fields'](_0x44afe[_0x67cd('0x30')][_0x67cd('0x45')]));_0x571d08[_0x67cd('0x34')]=_0x571d08[_0x67cd('0x34')][_0x67cd('0x35')]?_0x571d08[_0x67cd('0x34')]:_0x55907b[_0x67cd('0x2e')];_0x571d08[_0x67cd('0x37')]=qs['sort'](_0x44afe[_0x67cd('0x30')]['sort']);_0x571d08[_0x67cd('0x3b')]=qs[_0x67cd('0x32')](_[_0x67cd('0x39')](_0x44afe[_0x67cd('0x30')],_0x55907b[_0x67cd('0x32')]));if(_0x44afe['query'][_0x67cd('0x3d')]){_0x571d08[_0x67cd('0x3b')]=_[_0x67cd('0x3a')](_0x571d08['where'],{'$or':_[_0x67cd('0x3c')](_0x571d08[_0x67cd('0x34')],function(_0x5b930b){var _0x4d962e={};_0x4d962e[_0x5b930b]={'$like':'%'+_0x44afe['query'][_0x67cd('0x3d')]+'%'};return _0x4d962e;})});}_0x571d08=_[_0x67cd('0x3a')]({},_0x571d08,_0x44afe['options']);return _0x3ba364[_0x67cd('0x62')](_0x571d08);}})['then'](function(_0x3ac4c3){if(_0x3ac4c3){_0xda520e=_0x3ac4c3[_0x67cd('0x35')];if(!_0x44afe[_0x67cd('0x30')][_0x67cd('0x5a')]('nolimit')){_0x571d08[_0x67cd('0x1b')]=qs[_0x67cd('0x1b')](_0x44afe['query'][_0x67cd('0x1b')]);_0x571d08[_0x67cd('0x19')]=qs['offset'](_0x44afe[_0x67cd('0x30')][_0x67cd('0x19')]);}return _0x3ba364['getLists'](_0x571d08);}})[_0x67cd('0x21')](function(_0x23b4db){if(_0x23b4db){return _0x23b4db?{'count':_0xda520e,'rows':_0x23b4db}:null;}})[_0x67cd('0x21')](respondWithResult(_0x102b0d,null))[_0x67cd('0x43')](handleError(_0x102b0d,null));};exports[_0x67cd('0x63')]=function(_0x22e9d7,_0x348a86,_0x2b987a){var _0x3ac334,_0x3e9c6d;var _0x44bf95=[];var _0xfb8e19=moment()[_0x67cd('0x64')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x67cd('0x29')]['find']({'where':{'id':_0x22e9d7[_0x67cd('0x44')]['id']}})[_0x67cd('0x21')](handleEntityNotFound(_0x348a86,null))[_0x67cd('0x21')](function(_0x78ca70){if(_0x78ca70){_0x3e9c6d=_0x78ca70;return _0x78ca70['addLists'](_0x22e9d7['body']['ids'],_['omit'](_0x22e9d7[_0x67cd('0x53')],[_0x67cd('0x65'),'id'])||{});}return null;})[_0x67cd('0x66')](function(_0x2eb7cd){var _0x2509dd;var _0x4bdef2;_0x3ac334=_0x2eb7cd||[];var _0x5341ab=[];if(_0x2eb7cd){for(var _0x9a6549=0x0;_0x9a6549<_0x2eb7cd[_0x67cd('0x35')];_0x9a6549+=0x1){var _0x47c329=_0x2eb7cd[_0x9a6549][_0x67cd('0x4b')]({'plain':!![]});_0x3e9c6d[_0x67cd('0x67')]=_0x22e9d7[_0x67cd('0x53')][_0x67cd('0x67')]?_0x22e9d7[_0x67cd('0x53')][_0x67cd('0x67')]:_0x3e9c6d[_0x67cd('0x67')];switch(_0x3e9c6d[_0x67cd('0x67')]){case _0x67cd('0x68'):_0x2509dd=squel['insert']()[_0x67cd('0x69')]('cm_hopper')[_0x67cd('0x6a')]([_0x67cd('0x6b'),_0x67cd('0x6c'),'ContactId',_0x67cd('0x6d'),_0x67cd('0x5b'),'createdAt',_0x67cd('0x52')],squel['select']()['field'](_0x67cd('0x6b'),'phone')[_0x67cd('0x6e')](_0x67cd('0x6f'),'scheduledAt')[_0x67cd('0x6e')]('id',_0x67cd('0x70'))[_0x67cd('0x6e')](_0x47c329[_0x67cd('0x71')][_0x67cd('0x72')](),_0x67cd('0x6d'))[_0x67cd('0x6e')](_0x22e9d7['params']['id']['toString'](),_0x67cd('0x5b'))['field']('\x27'+_0xfb8e19+'\x27',_0x67cd('0x51'))[_0x67cd('0x6e')]('\x27'+_0xfb8e19+'\x27','updatedAt')['from']('cm_contacts')[_0x67cd('0x3b')](_0x67cd('0x73'))[_0x67cd('0x3b')](_0x67cd('0x74'),_0x47c329['CmListId'][_0x67cd('0x72')]())[_0x67cd('0x3b')]('phone\x20IS\x20NOT\x20NULL')[_0x67cd('0x3b')](_0x67cd('0x75'),squel[_0x67cd('0x76')]()[_0x67cd('0x6e')](_0x67cd('0x77'))[_0x67cd('0x78')]('cm_hopper_final')['where'](_0x67cd('0x79'),_0x22e9d7[_0x67cd('0x44')]['id'][_0x67cd('0x72')]()))['where'](_0x67cd('0x75'),squel[_0x67cd('0x76')]()['field'](_0x67cd('0x7a'))[_0x67cd('0x78')](_0x67cd('0x7b'))['where'](_0x67cd('0x79'),_0x22e9d7['params']['id'][_0x67cd('0x72')]())))[_0x67cd('0x72')]();break;case'onlyIfOpen':_0x2509dd=squel['insert']()[_0x67cd('0x69')](_0x67cd('0x7b'))['fromQuery']([_0x67cd('0x6b'),_0x67cd('0x6c'),_0x67cd('0x70'),'ListId',_0x67cd('0x5b'),_0x67cd('0x51'),_0x67cd('0x52')],squel[_0x67cd('0x76')]()[_0x67cd('0x6e')](_0x67cd('0x6b'),_0x67cd('0x6b'))[_0x67cd('0x6e')]('NOW()','scheduledAt')[_0x67cd('0x6e')]('id',_0x67cd('0x70'))[_0x67cd('0x6e')](_0x47c329['CmListId'][_0x67cd('0x72')](),_0x67cd('0x6d'))[_0x67cd('0x6e')](_0x22e9d7['params']['id'][_0x67cd('0x72')](),_0x67cd('0x5b'))['field']('\x27'+_0xfb8e19+'\x27','createdAt')['field']('\x27'+_0xfb8e19+'\x27',_0x67cd('0x52'))[_0x67cd('0x78')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x67cd('0x3b')](_0x67cd('0x74'),_0x47c329[_0x67cd('0x71')][_0x67cd('0x72')]())['where'](_0x67cd('0x7c'))[_0x67cd('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x67cd('0x76')]()['field']('COALESCE(phone,\x27\x27)')[_0x67cd('0x78')](_0x67cd('0x7b'))[_0x67cd('0x3b')](_0x67cd('0x79'),_0x22e9d7[_0x67cd('0x44')]['id'][_0x67cd('0x72')]())))['toString']();break;default:_0x2509dd=squel['insert']()[_0x67cd('0x69')](_0x67cd('0x7b'))[_0x67cd('0x6a')]([_0x67cd('0x6b'),_0x67cd('0x6c'),_0x67cd('0x70'),'ListId',_0x67cd('0x5b'),_0x67cd('0x51'),_0x67cd('0x52')],squel[_0x67cd('0x76')]()[_0x67cd('0x6e')]('phone',_0x67cd('0x6b'))[_0x67cd('0x6e')]('NOW()',_0x67cd('0x6c'))[_0x67cd('0x6e')]('id',_0x67cd('0x70'))[_0x67cd('0x6e')](_0x47c329[_0x67cd('0x71')][_0x67cd('0x72')](),_0x67cd('0x6d'))[_0x67cd('0x6e')](_0x22e9d7['params']['id'][_0x67cd('0x72')](),'CampaignId')['field']('\x27'+_0xfb8e19+'\x27',_0x67cd('0x51'))['field']('\x27'+_0xfb8e19+'\x27',_0x67cd('0x52'))[_0x67cd('0x78')](_0x67cd('0x7d'))['where'](_0x67cd('0x73'))[_0x67cd('0x3b')](_0x67cd('0x74'),_0x47c329[_0x67cd('0x71')][_0x67cd('0x72')]())['where'](_0x67cd('0x7c')))[_0x67cd('0x72')]();}_0x4bdef2=squel[_0x67cd('0x7e')]()['into'](_0x67cd('0x7f'))['fromQuery'](['cmHopperId',_0x67cd('0x6c'),_0x67cd('0x6b'),_0x67cd('0x80'),_0x67cd('0x51'),_0x67cd('0x52')],squel['select']()[_0x67cd('0x6e')](_0x67cd('0x81'),'id')[_0x67cd('0x6e')](_0x67cd('0x6f'),'scheduledAt')[_0x67cd('0x6e')](_0x67cd('0x82'),'phone')[_0x67cd('0x6e')](_0x67cd('0x83'),_0x67cd('0x80'))[_0x67cd('0x6e')]('\x27'+_0xfb8e19+'\x27',_0x67cd('0x51'))[_0x67cd('0x6e')]('\x27'+_0xfb8e19+'\x27',_0x67cd('0x52'))[_0x67cd('0x78')]('cm_contact_has_items','ci')[_0x67cd('0x84')]('cm_hopper','h',_0x67cd('0x85'))[_0x67cd('0x3b')](_0x67cd('0x86'),_0x47c329[_0x67cd('0x71')][_0x67cd('0x72')]())[_0x67cd('0x3b')](_0x67cd('0x87'),_0x22e9d7['params']['id'][_0x67cd('0x72')]())[_0x67cd('0x3b')](_0x67cd('0x88'),_0xfb8e19))[_0x67cd('0x72')]();_0x5341ab[_0x67cd('0x89')](db['sequelize']['query'](_0x2509dd));_0x44bf95[_0x67cd('0x89')](db['sequelize'][_0x67cd('0x30')](_0x4bdef2));}return BPromise[_0x67cd('0x8a')](_0x5341ab);}})[_0x67cd('0x21')](function(){return BPromise[_0x67cd('0x8a')](_0x44bf95);})['then'](function(){return _0x3ac334;})[_0x67cd('0x21')](respondWithResult(_0x348a86,null))['catch'](handleError(_0x348a86,null));};exports[_0x67cd('0x8b')]=function(_0x5f0184,_0x478a7a,_0x5a30aa){return db[_0x67cd('0x29')]['find']({'where':{'id':_0x5f0184['params']['id']}})[_0x67cd('0x21')](handleEntityNotFound(_0x478a7a,null))[_0x67cd('0x21')](function(_0xf92096){if(_0xf92096){return _0xf92096[_0x67cd('0x8b')](_0x5f0184[_0x67cd('0x30')]['ids']);}})[_0x67cd('0x21')](function(_0x4f21db){if(_0x4f21db){return db[_0x67cd('0x59')][_0x67cd('0x22')]({'where':{'ListId':_0x5f0184[_0x67cd('0x30')][_0x67cd('0x65')],'CampaignId':_0x5f0184[_0x67cd('0x44')]['id']}})[_0x67cd('0x21')](function(){return _0x4f21db;});}})[_0x67cd('0x21')](respondWithStatusCode(_0x478a7a,null))[_0x67cd('0x43')](handleError(_0x478a7a,null));};exports[_0x67cd('0x8c')]=function(_0x36e2cd,_0x6ef969,_0x4091a7){var _0xbe2366={};var _0x507038={};var _0x49a160;var _0x16aa8f;return db['Campaign'][_0x67cd('0x58')]({'where':{'id':_0x36e2cd['params']['id']}})[_0x67cd('0x21')](handleEntityNotFound(_0x6ef969,null))['then'](function(_0x90992a){if(_0x90992a){_0x49a160=_0x90992a;_0x507038['model']=_[_0x67cd('0x31')](db[_0x67cd('0x8d')][_0x67cd('0x2a')]);_0x507038[_0x67cd('0x30')]=_[_0x67cd('0x31')](_0x36e2cd[_0x67cd('0x30')]);_0x507038[_0x67cd('0x32')]=_[_0x67cd('0x33')](_0x507038['model'],_0x507038[_0x67cd('0x30')]);_0xbe2366[_0x67cd('0x34')]=_[_0x67cd('0x33')](_0x507038[_0x67cd('0x2e')],qs['fields'](_0x36e2cd['query'][_0x67cd('0x45')]));_0xbe2366[_0x67cd('0x34')]=_0xbe2366['attributes']['length']?_0xbe2366['attributes']:_0x507038['model'];_0xbe2366[_0x67cd('0x37')]=qs[_0x67cd('0x38')](_0x36e2cd[_0x67cd('0x30')][_0x67cd('0x38')]);_0xbe2366['where']=qs[_0x67cd('0x32')](_[_0x67cd('0x39')](_0x36e2cd[_0x67cd('0x30')],_0x507038[_0x67cd('0x32')]));if(_0x36e2cd[_0x67cd('0x30')][_0x67cd('0x3d')]){_0xbe2366['where']=_[_0x67cd('0x3a')](_0xbe2366[_0x67cd('0x3b')],{'$or':_[_0x67cd('0x3c')](_0xbe2366[_0x67cd('0x34')],function(_0x268c32){var _0x206b85={};_0x206b85[_0x268c32]={'$like':'%'+_0x36e2cd[_0x67cd('0x30')][_0x67cd('0x3d')]+'%'};return _0x206b85;})});}_0xbe2366=_[_0x67cd('0x3a')]({},_0xbe2366,_0x36e2cd[_0x67cd('0x46')]);return _0x49a160[_0x67cd('0x8c')](_0xbe2366);}})[_0x67cd('0x21')](function(_0x4e2cbe){if(_0x4e2cbe){_0x16aa8f=_0x4e2cbe[_0x67cd('0x35')];if(!_0x36e2cd['query'][_0x67cd('0x5a')](_0x67cd('0x36'))){_0xbe2366[_0x67cd('0x1b')]=qs['limit'](_0x36e2cd[_0x67cd('0x30')][_0x67cd('0x1b')]);_0xbe2366[_0x67cd('0x19')]=qs[_0x67cd('0x19')](_0x36e2cd[_0x67cd('0x30')]['offset']);}return _0x49a160[_0x67cd('0x8c')](_0xbe2366);}})[_0x67cd('0x21')](function(_0x3d20d7){if(_0x3d20d7){return _0x3d20d7?{'count':_0x16aa8f,'rows':_0x3d20d7}:null;}})[_0x67cd('0x21')](respondWithResult(_0x6ef969,null))['catch'](handleError(_0x6ef969,null));};exports[_0x67cd('0x8e')]=function(_0x2d414c,_0x312f65,_0x336159){var _0x4b8be1,_0x5d8939;var _0x424470=[];var _0x2ad2ed=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db['Campaign']['find']({'where':{'id':_0x2d414c[_0x67cd('0x44')]['id']}})[_0x67cd('0x21')](handleEntityNotFound(_0x312f65,null))[_0x67cd('0x21')](function(_0x40b42e){if(_0x40b42e){_0x5d8939=_0x40b42e;return _0x40b42e[_0x67cd('0x8e')](_0x2d414c[_0x67cd('0x53')]['ids'],_[_0x67cd('0x54')](_0x2d414c[_0x67cd('0x53')],['ids','id'])||{});}return null;})[_0x67cd('0x66')](function(_0x369290){var _0x1580d4;var _0x82241;_0x4b8be1=_0x369290||[];var _0x3930f0=[];if(_0x369290){for(var _0x4bd0f1=0x0;_0x4bd0f1<_0x369290['length'];_0x4bd0f1+=0x1){var _0x459e17=_0x369290[_0x4bd0f1][_0x67cd('0x4b')]({'plain':!![]});_0x1580d4=squel[_0x67cd('0x7e')]()[_0x67cd('0x69')](_0x67cd('0x8f'))[_0x67cd('0x6a')](['phone',_0x67cd('0x70'),_0x67cd('0x6d'),'CampaignId',_0x67cd('0x51'),_0x67cd('0x52')],squel[_0x67cd('0x76')]()['field'](_0x67cd('0x6b'),_0x67cd('0x6b'))['field']('id','ContactId')[_0x67cd('0x6e')](_0x459e17[_0x67cd('0x71')][_0x67cd('0x72')](),_0x67cd('0x6d'))['field'](_0x2d414c[_0x67cd('0x44')]['id'][_0x67cd('0x72')](),'CampaignId')['field'](_0x67cd('0x6f'),_0x67cd('0x51'))[_0x67cd('0x6e')](_0x67cd('0x6f'),'updatedAt')[_0x67cd('0x78')](_0x67cd('0x7d'))[_0x67cd('0x3b')]('deletedAt\x20IS\x20NULL')[_0x67cd('0x3b')](_0x67cd('0x74'),_0x459e17[_0x67cd('0x71')][_0x67cd('0x72')]())[_0x67cd('0x3b')](_0x67cd('0x7c')))['toString']();_0x3930f0[_0x67cd('0x89')](db[_0x67cd('0x90')][_0x67cd('0x30')](_0x1580d4));}return BPromise[_0x67cd('0x8a')](_0x3930f0);}})[_0x67cd('0x21')](function(){return _0x4b8be1;})['then'](respondWithResult(_0x312f65,null))[_0x67cd('0x43')](handleError(_0x312f65,null));};exports[_0x67cd('0x91')]=function(_0x22b551,_0x103419,_0x1e1cc7){return db[_0x67cd('0x29')]['find']({'where':{'id':_0x22b551['params']['id']}})[_0x67cd('0x21')](handleEntityNotFound(_0x103419,null))[_0x67cd('0x21')](function(_0x45ecd7){if(_0x45ecd7){return _0x45ecd7[_0x67cd('0x91')](_0x22b551['query']['ids']);}})['then'](function(_0x3e6eea){if(_0x3e6eea){return db[_0x67cd('0x61')]['destroy']({'where':{'ListId':_0x22b551['query']['ids'],'CampaignId':_0x22b551[_0x67cd('0x44')]['id']}})[_0x67cd('0x21')](function(){return _0x3e6eea;});}})[_0x67cd('0x21')](respondWithStatusCode(_0x103419,null))[_0x67cd('0x43')](handleError(_0x103419,null));}; \ No newline at end of file +var _0xd23d=['ci.OrderBY','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','omit','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','map','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','Campaign','findAll','rows','catch','show','params','rawAttributes','fields','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','createdAt','updatedAt','autoAssociation','getHoppers','findOne','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','cm_hopper','phone','scheduledAt','ContactId','field','CmListId','ListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','from','CampaignId\x20=\x20?','onlyIfOpen','into','fromQuery','NOW()','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','OrderBy','h.id'];(function(_0x3cb152,_0x57eb54){var _0x4f54c3=function(_0x273a45){while(--_0x273a45){_0x3cb152['push'](_0x3cb152['shift']());}};_0x4f54c3(++_0x57eb54);}(_0xd23d,0xa0));var _0xdd23=function(_0x478c8a,_0x9afc92){_0x478c8a=_0x478c8a-0x0;var _0x3b6b3e=_0xd23d[_0x478c8a];return _0x3b6b3e;};'use strict';var emlformat=require(_0xdd23('0x0'));var rimraf=require(_0xdd23('0x1'));var zipdir=require(_0xdd23('0x2'));var jsonpatch=require(_0xdd23('0x3'));var rp=require(_0xdd23('0x4'));var moment=require(_0xdd23('0x5'));var BPromise=require(_0xdd23('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xdd23('0x7'));var csv=require(_0xdd23('0x8'));var ejs=require(_0xdd23('0x9'));var fs=require('fs');var fs_extra=require(_0xdd23('0xa'));var _=require(_0xdd23('0xb'));var squel=require(_0xdd23('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdd23('0xd'));var toCsv=require(_0xdd23('0x8'));var querystring=require(_0xdd23('0xe'));var Papa=require(_0xdd23('0xf'));var Redis=require(_0xdd23('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xdd23('0x11'));var as=require(_0xdd23('0x12'));var hardwareService=require(_0xdd23('0x13'));var logger=require('../../config/logger')(_0xdd23('0x14'));var utils=require(_0xdd23('0x15'));var config=require(_0xdd23('0x16'));var licenseUtil=require(_0xdd23('0x17'));var db=require(_0xdd23('0x18'))['db'];function respondWithStatusCode(_0x103a43,_0x1484d7){_0x1484d7=_0x1484d7||0xcc;return function(_0x1e4739){if(_0x1e4739){return _0x103a43[_0xdd23('0x19')](_0x1484d7);}return _0x103a43['status'](_0x1484d7)['end']();};}function respondWithResult(_0x294683,_0x27a280){_0x27a280=_0x27a280||0xc8;return function(_0x2f2869){if(_0x2f2869){return _0x294683['status'](_0x27a280)[_0xdd23('0x1a')](_0x2f2869);}};}function respondWithFilteredResult(_0x21f67a,_0x2abcd7){return function(_0x3743cf){if(_0x3743cf){var _0x5d0087=typeof _0x2abcd7[_0xdd23('0x1b')]===_0xdd23('0x1c')&&typeof _0x2abcd7[_0xdd23('0x1d')]===_0xdd23('0x1c');var _0x111e0f=_0x3743cf[_0xdd23('0x1e')];var _0x49d959=_0x5d0087?0x0:_0x2abcd7['offset'];var _0x7f3048=_0x5d0087?_0x3743cf[_0xdd23('0x1e')]:_0x2abcd7[_0xdd23('0x1b')]+_0x2abcd7[_0xdd23('0x1d')];var _0x3d2720;if(_0x7f3048>=_0x111e0f){_0x7f3048=_0x111e0f;_0x3d2720=0xc8;}else{_0x3d2720=0xce;}_0x21f67a[_0xdd23('0x1f')](_0x3d2720);return _0x21f67a[_0xdd23('0x20')](_0xdd23('0x21'),_0x49d959+'-'+_0x7f3048+'/'+_0x111e0f)[_0xdd23('0x1a')](_0x3743cf);}return null;};}function patchUpdates(_0x198059){return function(_0x7d557d){try{jsonpatch[_0xdd23('0x22')](_0x7d557d,_0x198059,!![]);}catch(_0x46056c){return BPromise['reject'](_0x46056c);}return _0x7d557d['save']();};}function saveUpdates(_0x4f53fa,_0x5b874b){return function(_0x4ee5e3){if(_0x4ee5e3){return _0x4ee5e3[_0xdd23('0x23')](_0x4f53fa)[_0xdd23('0x24')](function(_0x98a2be){return _0x98a2be;});}return null;};}function removeEntity(_0x151dd5,_0x65feab){return function(_0x15d80c){if(_0x15d80c){return _0x15d80c[_0xdd23('0x25')]()[_0xdd23('0x24')](function(){var _0x395b2e=_0x15d80c[_0xdd23('0x26')]({'plain':!![]});var _0x21834a=_0xdd23('0x27');return db[_0xdd23('0x28')][_0xdd23('0x25')]({'where':{'type':_0x21834a,'resourceId':_0x395b2e['id']}})['then'](function(){return _0x15d80c;});})['then'](function(){_0x151dd5[_0xdd23('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x300a79,_0x494640){return function(_0x4be3b3){if(!_0x4be3b3){_0x300a79[_0xdd23('0x19')](0x194);}return _0x4be3b3;};}function handleError(_0x3b6eee,_0x4ba8f6){_0x4ba8f6=_0x4ba8f6||0x1f4;return function(_0x25149e){logger[_0xdd23('0x29')](_0x25149e[_0xdd23('0x2a')]);if(_0x25149e['name']){delete _0x25149e[_0xdd23('0x2b')];}_0x3b6eee[_0xdd23('0x1f')](_0x4ba8f6)[_0xdd23('0x2c')](_0x25149e);};}exports[_0xdd23('0x2d')]=function(_0x2da49d,_0x1d3cfd){var _0x1bca59={},_0x46c432={},_0x4aa771={'count':0x0,'rows':[]};var _0x22a302=_[_0xdd23('0x2e')](db['Campaign']['rawAttributes'],function(_0x2f59f3){return{'name':_0x2f59f3['fieldName'],'type':_0x2f59f3[_0xdd23('0x2f')][_0xdd23('0x30')]};});_0x46c432[_0xdd23('0x31')]=_[_0xdd23('0x2e')](_0x22a302,_0xdd23('0x2b'));_0x46c432[_0xdd23('0x32')]=_[_0xdd23('0x33')](_0x2da49d['query']);_0x46c432[_0xdd23('0x34')]=_[_0xdd23('0x35')](_0x46c432[_0xdd23('0x31')],_0x46c432[_0xdd23('0x32')]);_0x1bca59['attributes']=_[_0xdd23('0x35')](_0x46c432[_0xdd23('0x31')],qs['fields'](_0x2da49d[_0xdd23('0x32')]['fields']));_0x1bca59['attributes']=_0x1bca59[_0xdd23('0x36')]['length']?_0x1bca59[_0xdd23('0x36')]:_0x46c432[_0xdd23('0x31')];if(!_0x2da49d[_0xdd23('0x32')][_0xdd23('0x37')](_0xdd23('0x38'))){_0x1bca59['limit']=qs['limit'](_0x2da49d[_0xdd23('0x32')][_0xdd23('0x1d')]);_0x1bca59[_0xdd23('0x1b')]=qs[_0xdd23('0x1b')](_0x2da49d['query'][_0xdd23('0x1b')]);}_0x1bca59[_0xdd23('0x39')]=qs[_0xdd23('0x3a')](_0x2da49d[_0xdd23('0x32')]['sort']);_0x1bca59[_0xdd23('0x3b')]=qs[_0xdd23('0x34')](_[_0xdd23('0x3c')](_0x2da49d[_0xdd23('0x32')],_0x46c432[_0xdd23('0x34')]),_0x22a302);if(_0x2da49d[_0xdd23('0x32')][_0xdd23('0x3d')]){_0x1bca59[_0xdd23('0x3b')]=_[_0xdd23('0x3e')](_0x1bca59[_0xdd23('0x3b')],{'$or':_['map'](_0x22a302,function(_0x1f64e2){if(_0x1f64e2[_0xdd23('0x2f')]!=='VIRTUAL'){var _0x7930a6={};_0x7930a6[_0x1f64e2[_0xdd23('0x2b')]]={'$like':'%'+_0x2da49d[_0xdd23('0x32')][_0xdd23('0x3d')]+'%'};return _0x7930a6;}})});}_0x1bca59=_['merge']({},_0x1bca59,_0x2da49d[_0xdd23('0x3f')]);var _0x4967f9={'where':_0x1bca59[_0xdd23('0x3b')]};return db['Campaign']['count'](_0x4967f9)['then'](function(_0x4b2024){_0x4aa771[_0xdd23('0x1e')]=_0x4b2024;if(_0x2da49d[_0xdd23('0x32')][_0xdd23('0x40')]){_0x1bca59['include']=[{'all':!![]}];}return db[_0xdd23('0x41')][_0xdd23('0x42')](_0x1bca59);})[_0xdd23('0x24')](function(_0x32cb33){_0x4aa771[_0xdd23('0x43')]=_0x32cb33;return _0x4aa771;})[_0xdd23('0x24')](respondWithFilteredResult(_0x1d3cfd,_0x1bca59))[_0xdd23('0x44')](handleError(_0x1d3cfd,null));};exports[_0xdd23('0x45')]=function(_0x2f6d90,_0x3075a1){var _0x2fd6f9={'raw':![],'where':{'id':_0x2f6d90[_0xdd23('0x46')]['id']}},_0x59a7de={};_0x59a7de[_0xdd23('0x31')]=_[_0xdd23('0x33')](db[_0xdd23('0x41')][_0xdd23('0x47')]);_0x59a7de[_0xdd23('0x32')]=_[_0xdd23('0x33')](_0x2f6d90[_0xdd23('0x32')]);_0x59a7de[_0xdd23('0x34')]=_['intersection'](_0x59a7de['model'],_0x59a7de['query']);_0x2fd6f9[_0xdd23('0x36')]=_[_0xdd23('0x35')](_0x59a7de[_0xdd23('0x31')],qs[_0xdd23('0x48')](_0x2f6d90['query'][_0xdd23('0x48')]));_0x2fd6f9[_0xdd23('0x36')]=_0x2fd6f9[_0xdd23('0x36')][_0xdd23('0x49')]?_0x2fd6f9[_0xdd23('0x36')]:_0x59a7de['model'];if(_0x2f6d90[_0xdd23('0x32')][_0xdd23('0x40')]){_0x2fd6f9['include']=[{'all':!![]}];}_0x2fd6f9=_[_0xdd23('0x3e')]({},_0x2fd6f9,_0x2f6d90['options']);return db[_0xdd23('0x41')][_0xdd23('0x4a')](_0x2fd6f9)[_0xdd23('0x24')](handleEntityNotFound(_0x3075a1,null))['then'](respondWithResult(_0x3075a1,null))['catch'](handleError(_0x3075a1,null));};exports[_0xdd23('0x4b')]=function(_0x411e2f,_0x298a17){return db[_0xdd23('0x41')][_0xdd23('0x4b')](_0x411e2f[_0xdd23('0x4c')],{})[_0xdd23('0x24')](function(_0x300c1a){var _0x409339=_0x411e2f['user'][_0xdd23('0x26')]({'plain':!![]});if(!_0x409339)throw new Error(_0xdd23('0x4d'));if(_0x409339[_0xdd23('0x4e')]===_0xdd23('0x4f')){var _0x51aaee=_0x300c1a[_0xdd23('0x26')]({'plain':!![]});var _0x3a9039=_0xdd23('0x27');return db[_0xdd23('0x50')][_0xdd23('0x4a')]({'where':{'name':_0x3a9039,'userProfileId':_0x409339[_0xdd23('0x51')]},'raw':!![]})['then'](function(_0x4f2b2f){if(_0x4f2b2f&&_0x4f2b2f['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x51aaee['name'],'resourceId':_0x51aaee['id'],'type':_0x4f2b2f[_0xdd23('0x2b')],'sectionId':_0x4f2b2f['id']},{})[_0xdd23('0x24')](function(){return _0x300c1a;});}else{return _0x300c1a;}})['catch'](function(_0x4b3020){logger[_0xdd23('0x29')](_0xdd23('0x52'),_0x4b3020);throw _0x4b3020;});}return _0x300c1a;})[_0xdd23('0x24')](respondWithResult(_0x298a17,0xc9))[_0xdd23('0x44')](handleError(_0x298a17,null));};exports[_0xdd23('0x53')]=function(_0x1eb8a8,_0x3c8caf){var _0x1f4552={'where':{'id':_0x1eb8a8[_0xdd23('0x46')]['id']}},_0x153111={};_0x153111[_0xdd23('0x31')]=_[_0xdd23('0x33')](db[_0xdd23('0x41')]['rawAttributes']);_0x1f4552[_0xdd23('0x36')]=_['intersection'](_0x153111[_0xdd23('0x31')],qs['fields'](_0x1eb8a8[_0xdd23('0x32')][_0xdd23('0x48')]));_0x1f4552[_0xdd23('0x36')]=_0x1f4552[_0xdd23('0x36')][_0xdd23('0x49')]?_0x1f4552[_0xdd23('0x36')]:_0x153111[_0xdd23('0x31')];if(_0x1eb8a8[_0xdd23('0x32')][_0xdd23('0x40')]){_0x1f4552[_0xdd23('0x54')]=[{'all':!![]}];}_0x1f4552=_[_0xdd23('0x3e')]({},_0x1f4552,_0x1eb8a8[_0xdd23('0x3f')]);return db[_0xdd23('0x41')][_0xdd23('0x4a')](_0x1f4552)[_0xdd23('0x24')](handleEntityNotFound(_0x3c8caf,null))[_0xdd23('0x24')](function(_0x437432){if(_0x437432){var _0x44344e=_0x437432[_0xdd23('0x26')]({'plain':!![]});_0x44344e=qs['omit'](_0x44344e,['id',_0xdd23('0x55'),'updatedAt']);_0x1eb8a8[_0xdd23('0x4c')]=_['omit'](_0x1eb8a8[_0xdd23('0x4c')],['id',_0xdd23('0x55'),_0xdd23('0x56')]);return db[_0xdd23('0x41')][_0xdd23('0x4b')](_[_0xdd23('0x3e')](_0x44344e,_0x1eb8a8[_0xdd23('0x4c')]),{'include':_0x1eb8a8[_0xdd23('0x32')][_0xdd23('0x40')]?[{'all':!![]}]:undefined})[_0xdd23('0x24')](function(_0x37ed33){var _0x5e16b0=_0x1eb8a8[_0xdd23('0x4f')][_0xdd23('0x26')]({'plain':!![]});if(!_0x5e16b0)throw new Error(_0xdd23('0x4d'));if(_0x5e16b0[_0xdd23('0x4e')]===_0xdd23('0x4f')){var _0x235af3=_0x37ed33['get']({'plain':!![]});var _0x430ecf='IvrCampaigns';return db[_0xdd23('0x50')][_0xdd23('0x4a')]({'where':{'name':_0x430ecf,'userProfileId':_0x5e16b0[_0xdd23('0x51')]},'raw':!![]})[_0xdd23('0x24')](function(_0x34ab17){if(_0x34ab17&&_0x34ab17[_0xdd23('0x57')]===0x0){return db['UserProfileResource'][_0xdd23('0x4b')]({'name':_0x235af3[_0xdd23('0x2b')],'resourceId':_0x235af3['id'],'type':_0x34ab17['name'],'sectionId':_0x34ab17['id']},{})[_0xdd23('0x24')](function(){return _0x37ed33;});}else{return _0x37ed33;}})['catch'](function(_0x40eca1){logger[_0xdd23('0x29')](_0xdd23('0x52'),_0x40eca1);throw _0x40eca1;});}return _0x37ed33;});}})[_0xdd23('0x24')](respondWithResult(_0x3c8caf,0xc9))[_0xdd23('0x44')](handleError(_0x3c8caf,null));};exports[_0xdd23('0x23')]=function(_0x1aebe8,_0x516705){if(_0x1aebe8[_0xdd23('0x4c')]['id']){delete _0x1aebe8['body']['id'];}return db['Campaign'][_0xdd23('0x4a')]({'where':{'id':_0x1aebe8[_0xdd23('0x46')]['id']}})['then'](handleEntityNotFound(_0x516705,null))[_0xdd23('0x24')](saveUpdates(_0x1aebe8[_0xdd23('0x4c')],null))['then'](respondWithResult(_0x516705,null))['catch'](handleError(_0x516705,null));};exports[_0xdd23('0x25')]=function(_0x3c7e07,_0x4b84b3){return db[_0xdd23('0x41')]['find']({'where':{'id':_0x3c7e07[_0xdd23('0x46')]['id']}})[_0xdd23('0x24')](handleEntityNotFound(_0x4b84b3,null))[_0xdd23('0x24')](removeEntity(_0x4b84b3,null))[_0xdd23('0x44')](handleError(_0x4b84b3,null));};exports[_0xdd23('0x58')]=function(_0xf90c83,_0x3d214d,_0x405edc){var _0x4bdcef={'raw':!![],'where':{}};var _0x5581b6={};var _0x4fc65c={'count':0x0,'rows':[]};return db[_0xdd23('0x41')][_0xdd23('0x59')]({'where':{'id':_0xf90c83[_0xdd23('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d214d,null))[_0xdd23('0x24')](function(_0xac8e67){if(_0xac8e67){_0x5581b6[_0xdd23('0x31')]=_[_0xdd23('0x33')](db['CmHopper'][_0xdd23('0x47')]);_0x5581b6[_0xdd23('0x32')]=_[_0xdd23('0x33')](_0xf90c83[_0xdd23('0x32')]);_0x5581b6[_0xdd23('0x34')]=_[_0xdd23('0x35')](_0x5581b6[_0xdd23('0x31')],_0x5581b6['query']);_0x4bdcef[_0xdd23('0x36')]=_[_0xdd23('0x35')](_0x5581b6['model'],qs[_0xdd23('0x48')](_0xf90c83[_0xdd23('0x32')][_0xdd23('0x48')]));_0x4bdcef['attributes']=_0x4bdcef[_0xdd23('0x36')][_0xdd23('0x49')]?_0x4bdcef[_0xdd23('0x36')]:_0x5581b6[_0xdd23('0x31')];if(!_0xf90c83[_0xdd23('0x32')][_0xdd23('0x37')](_0xdd23('0x38'))){_0x4bdcef['limit']=qs['limit'](_0xf90c83[_0xdd23('0x32')][_0xdd23('0x1d')]);_0x4bdcef[_0xdd23('0x1b')]=qs[_0xdd23('0x1b')](_0xf90c83['query'][_0xdd23('0x1b')]);}_0x4bdcef[_0xdd23('0x39')]=qs['sort'](_0xf90c83[_0xdd23('0x32')][_0xdd23('0x3a')]);_0x4bdcef[_0xdd23('0x3b')]=qs['filters'](_[_0xdd23('0x3c')](_0xf90c83[_0xdd23('0x32')],_0x5581b6['filters']));_0x4bdcef['where'][_0xdd23('0x5a')]=_0xac8e67['id'];if(_0xf90c83[_0xdd23('0x32')][_0xdd23('0x3d')]){_0x4bdcef[_0xdd23('0x3b')]=_[_0xdd23('0x3e')](_0x4bdcef[_0xdd23('0x3b')],{'$or':_[_0xdd23('0x2e')](_0x4bdcef['attributes'],function(_0x1b32d5){var _0x4816f2={};_0x4816f2[_0x1b32d5]={'$like':'%'+_0xf90c83[_0xdd23('0x32')]['filter']+'%'};return _0x4816f2;})});}_0x4bdcef=_[_0xdd23('0x3e')]({},_0x4bdcef,_0xf90c83[_0xdd23('0x3f')]);return db['CmHopper']['count']({'where':_0x4bdcef[_0xdd23('0x3b')]})[_0xdd23('0x24')](function(_0x40307d){_0x4fc65c[_0xdd23('0x1e')]=_0x40307d;if(_0xf90c83[_0xdd23('0x32')]['includeAll']){_0x4bdcef[_0xdd23('0x54')]=[{'all':!![]}];}return db[_0xdd23('0x5b')][_0xdd23('0x42')](_0x4bdcef);})[_0xdd23('0x24')](function(_0x10b29a){_0x4fc65c['rows']=_0x10b29a;return _0x4fc65c;});}})[_0xdd23('0x24')](respondWithFilteredResult(_0x3d214d,_0x4bdcef))[_0xdd23('0x44')](handleError(_0x3d214d,null));};exports[_0xdd23('0x5c')]=function(_0x5684cf,_0x54d366,_0x1d277e){var _0x4a2491={'raw':!![],'where':{}};var _0x156108={};var _0x5925b9={'count':0x0,'rows':[]};return db['Campaign'][_0xdd23('0x59')]({'where':{'id':_0x5684cf[_0xdd23('0x46')]['id']}})[_0xdd23('0x24')](handleEntityNotFound(_0x54d366,null))[_0xdd23('0x24')](function(_0x533e64){if(_0x533e64){_0x156108[_0xdd23('0x31')]=_[_0xdd23('0x33')](db['CmHopperHistory'][_0xdd23('0x47')]);_0x156108[_0xdd23('0x32')]=_[_0xdd23('0x33')](_0x5684cf['query']);_0x156108[_0xdd23('0x34')]=_['intersection'](_0x156108[_0xdd23('0x31')],_0x156108[_0xdd23('0x32')]);_0x4a2491[_0xdd23('0x36')]=_[_0xdd23('0x35')](_0x156108['model'],qs[_0xdd23('0x48')](_0x5684cf['query'][_0xdd23('0x48')]));_0x4a2491[_0xdd23('0x36')]=_0x4a2491[_0xdd23('0x36')][_0xdd23('0x49')]?_0x4a2491[_0xdd23('0x36')]:_0x156108[_0xdd23('0x31')];if(!_0x5684cf[_0xdd23('0x32')][_0xdd23('0x37')](_0xdd23('0x38'))){_0x4a2491[_0xdd23('0x1d')]=qs[_0xdd23('0x1d')](_0x5684cf[_0xdd23('0x32')][_0xdd23('0x1d')]);_0x4a2491[_0xdd23('0x1b')]=qs[_0xdd23('0x1b')](_0x5684cf['query']['offset']);}_0x4a2491[_0xdd23('0x39')]=qs[_0xdd23('0x3a')](_0x5684cf['query'][_0xdd23('0x3a')]);_0x4a2491[_0xdd23('0x3b')]=qs[_0xdd23('0x34')](_[_0xdd23('0x3c')](_0x5684cf[_0xdd23('0x32')],_0x156108[_0xdd23('0x34')]));_0x4a2491[_0xdd23('0x3b')][_0xdd23('0x5a')]=_0x533e64['id'];if(_0x5684cf[_0xdd23('0x32')]['filter']){_0x4a2491[_0xdd23('0x3b')]=_[_0xdd23('0x3e')](_0x4a2491[_0xdd23('0x3b')],{'$or':_['map'](_0x4a2491[_0xdd23('0x36')],function(_0x4f963e){var _0x5e1fd6={};_0x5e1fd6[_0x4f963e]={'$like':'%'+_0x5684cf[_0xdd23('0x32')]['filter']+'%'};return _0x5e1fd6;})});}_0x4a2491=_[_0xdd23('0x3e')]({},_0x4a2491,_0x5684cf['options']);return db[_0xdd23('0x5d')][_0xdd23('0x1e')]({'where':_0x4a2491[_0xdd23('0x3b')]})[_0xdd23('0x24')](function(_0x19f38c){_0x5925b9[_0xdd23('0x1e')]=_0x19f38c;if(_0x5684cf[_0xdd23('0x32')][_0xdd23('0x40')]){_0x4a2491[_0xdd23('0x54')]=[{'all':!![]}];}return db[_0xdd23('0x5d')][_0xdd23('0x42')](_0x4a2491);})['then'](function(_0x419803){_0x5925b9[_0xdd23('0x43')]=_0x419803;return _0x5925b9;});}})[_0xdd23('0x24')](respondWithFilteredResult(_0x54d366,_0x4a2491))['catch'](handleError(_0x54d366,null));};exports[_0xdd23('0x5e')]=function(_0x384c50,_0xcf2142,_0x5605d7){var _0x4144c5={'raw':!![],'where':{}};var _0x5d1146={};var _0x28a07e={'count':0x0,'rows':[]};return db[_0xdd23('0x41')][_0xdd23('0x59')]({'where':{'id':_0x384c50['params']['id']}})['then'](handleEntityNotFound(_0xcf2142,null))['then'](function(_0x9ef648){if(_0x9ef648){_0x5d1146['model']=_[_0xdd23('0x33')](db['CmHopperFinal'][_0xdd23('0x47')]);_0x5d1146['query']=_[_0xdd23('0x33')](_0x384c50[_0xdd23('0x32')]);_0x5d1146[_0xdd23('0x34')]=_[_0xdd23('0x35')](_0x5d1146['model'],_0x5d1146[_0xdd23('0x32')]);_0x4144c5[_0xdd23('0x36')]=_[_0xdd23('0x35')](_0x5d1146['model'],qs['fields'](_0x384c50[_0xdd23('0x32')]['fields']));_0x4144c5['attributes']=_0x4144c5[_0xdd23('0x36')][_0xdd23('0x49')]?_0x4144c5[_0xdd23('0x36')]:_0x5d1146['model'];if(!_0x384c50[_0xdd23('0x32')][_0xdd23('0x37')](_0xdd23('0x38'))){_0x4144c5[_0xdd23('0x1d')]=qs['limit'](_0x384c50[_0xdd23('0x32')][_0xdd23('0x1d')]);_0x4144c5[_0xdd23('0x1b')]=qs[_0xdd23('0x1b')](_0x384c50[_0xdd23('0x32')][_0xdd23('0x1b')]);}_0x4144c5['order']=qs[_0xdd23('0x3a')](_0x384c50[_0xdd23('0x32')][_0xdd23('0x3a')]);_0x4144c5['where']=qs[_0xdd23('0x34')](_[_0xdd23('0x3c')](_0x384c50[_0xdd23('0x32')],_0x5d1146[_0xdd23('0x34')]));_0x4144c5[_0xdd23('0x3b')][_0xdd23('0x5a')]=_0x9ef648['id'];if(_0x384c50['query'][_0xdd23('0x3d')]){_0x4144c5[_0xdd23('0x3b')]=_[_0xdd23('0x3e')](_0x4144c5[_0xdd23('0x3b')],{'$or':_[_0xdd23('0x2e')](_0x4144c5['attributes'],function(_0x18c8e8){var _0x382975={};_0x382975[_0x18c8e8]={'$like':'%'+_0x384c50['query'][_0xdd23('0x3d')]+'%'};return _0x382975;})});}_0x4144c5=_[_0xdd23('0x3e')]({},_0x4144c5,_0x384c50[_0xdd23('0x3f')]);return db[_0xdd23('0x5f')][_0xdd23('0x1e')]({'where':_0x4144c5[_0xdd23('0x3b')]})['then'](function(_0x2fdf72){_0x28a07e[_0xdd23('0x1e')]=_0x2fdf72;if(_0x384c50['query'][_0xdd23('0x40')]){_0x4144c5[_0xdd23('0x54')]=[{'all':!![]}];}return db[_0xdd23('0x5f')]['findAll'](_0x4144c5);})['then'](function(_0x55e784){_0x28a07e[_0xdd23('0x43')]=_0x55e784;return _0x28a07e;});}})[_0xdd23('0x24')](respondWithFilteredResult(_0xcf2142,_0x4144c5))[_0xdd23('0x44')](handleError(_0xcf2142,null));};exports[_0xdd23('0x60')]=function(_0x4c1f07,_0x516bfe,_0x44353a){var _0xa92e0f={'raw':!![],'where':{}};var _0xca94e7={};var _0xf9054={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x4c1f07[_0xdd23('0x46')]['id']}})[_0xdd23('0x24')](handleEntityNotFound(_0x516bfe,null))['then'](function(_0xe88418){if(_0xe88418){_0xca94e7['model']=_[_0xdd23('0x33')](db[_0xdd23('0x61')]['rawAttributes']);_0xca94e7[_0xdd23('0x32')]=_['keys'](_0x4c1f07['query']);_0xca94e7['filters']=_[_0xdd23('0x35')](_0xca94e7[_0xdd23('0x31')],_0xca94e7['query']);_0xa92e0f[_0xdd23('0x36')]=_['intersection'](_0xca94e7[_0xdd23('0x31')],qs[_0xdd23('0x48')](_0x4c1f07['query'][_0xdd23('0x48')]));_0xa92e0f['attributes']=_0xa92e0f[_0xdd23('0x36')][_0xdd23('0x49')]?_0xa92e0f[_0xdd23('0x36')]:_0xca94e7[_0xdd23('0x31')];if(!_0x4c1f07[_0xdd23('0x32')]['hasOwnProperty'](_0xdd23('0x38'))){_0xa92e0f[_0xdd23('0x1d')]=qs[_0xdd23('0x1d')](_0x4c1f07[_0xdd23('0x32')][_0xdd23('0x1d')]);_0xa92e0f[_0xdd23('0x1b')]=qs[_0xdd23('0x1b')](_0x4c1f07['query'][_0xdd23('0x1b')]);}_0xa92e0f[_0xdd23('0x39')]=qs[_0xdd23('0x3a')](_0x4c1f07[_0xdd23('0x32')]['sort']);_0xa92e0f[_0xdd23('0x3b')]=qs[_0xdd23('0x34')](_[_0xdd23('0x3c')](_0x4c1f07[_0xdd23('0x32')],_0xca94e7[_0xdd23('0x34')]));_0xa92e0f[_0xdd23('0x3b')][_0xdd23('0x5a')]=_0xe88418['id'];if(_0x4c1f07[_0xdd23('0x32')][_0xdd23('0x3d')]){_0xa92e0f['where']=_[_0xdd23('0x3e')](_0xa92e0f[_0xdd23('0x3b')],{'$or':_['map'](_0xa92e0f[_0xdd23('0x36')],function(_0x3a0a98){var _0x35c7ec={};_0x35c7ec[_0x3a0a98]={'$like':'%'+_0x4c1f07['query'][_0xdd23('0x3d')]+'%'};return _0x35c7ec;})});}_0xa92e0f=_['merge']({},_0xa92e0f,_0x4c1f07[_0xdd23('0x3f')]);return db['CmHopperBlack'][_0xdd23('0x1e')]({'where':_0xa92e0f[_0xdd23('0x3b')]})[_0xdd23('0x24')](function(_0x319c68){_0xf9054[_0xdd23('0x1e')]=_0x319c68;if(_0x4c1f07['query'][_0xdd23('0x40')]){_0xa92e0f[_0xdd23('0x54')]=[{'all':!![]}];}return db[_0xdd23('0x61')][_0xdd23('0x42')](_0xa92e0f);})[_0xdd23('0x24')](function(_0x278dbe){_0xf9054[_0xdd23('0x43')]=_0x278dbe;return _0xf9054;});}})['then'](respondWithFilteredResult(_0x516bfe,_0xa92e0f))[_0xdd23('0x44')](handleError(_0x516bfe,null));};exports[_0xdd23('0x62')]=function(_0x20d298,_0xd76c54,_0x3aa381){var _0x2d05fc={};var _0x52501a={};var _0x5112ee;var _0x10bbeb;return db[_0xdd23('0x41')][_0xdd23('0x59')]({'where':{'id':_0x20d298[_0xdd23('0x46')]['id']}})[_0xdd23('0x24')](handleEntityNotFound(_0xd76c54,null))[_0xdd23('0x24')](function(_0x4dc0a6){if(_0x4dc0a6){_0x5112ee=_0x4dc0a6;_0x52501a['model']=_['keys'](db[_0xdd23('0x63')]['rawAttributes']);_0x52501a[_0xdd23('0x32')]=_[_0xdd23('0x33')](_0x20d298['query']);_0x52501a[_0xdd23('0x34')]=_[_0xdd23('0x35')](_0x52501a['model'],_0x52501a[_0xdd23('0x32')]);_0x2d05fc[_0xdd23('0x36')]=_['intersection'](_0x52501a[_0xdd23('0x31')],qs[_0xdd23('0x48')](_0x20d298[_0xdd23('0x32')][_0xdd23('0x48')]));_0x2d05fc['attributes']=_0x2d05fc[_0xdd23('0x36')][_0xdd23('0x49')]?_0x2d05fc[_0xdd23('0x36')]:_0x52501a[_0xdd23('0x31')];_0x2d05fc[_0xdd23('0x39')]=qs[_0xdd23('0x3a')](_0x20d298[_0xdd23('0x32')][_0xdd23('0x3a')]);_0x2d05fc['where']=qs[_0xdd23('0x34')](_[_0xdd23('0x3c')](_0x20d298[_0xdd23('0x32')],_0x52501a[_0xdd23('0x34')]));if(_0x20d298[_0xdd23('0x32')]['filter']){_0x2d05fc[_0xdd23('0x3b')]=_[_0xdd23('0x3e')](_0x2d05fc[_0xdd23('0x3b')],{'$or':_['map'](_0x2d05fc[_0xdd23('0x36')],function(_0x2b0d8d){var _0x56486c={};_0x56486c[_0x2b0d8d]={'$like':'%'+_0x20d298[_0xdd23('0x32')][_0xdd23('0x3d')]+'%'};return _0x56486c;})});}_0x2d05fc=_[_0xdd23('0x3e')]({},_0x2d05fc,_0x20d298[_0xdd23('0x3f')]);return _0x5112ee[_0xdd23('0x62')](_0x2d05fc);}})[_0xdd23('0x24')](function(_0x3c28c1){if(_0x3c28c1){_0x10bbeb=_0x3c28c1[_0xdd23('0x49')];if(!_0x20d298[_0xdd23('0x32')][_0xdd23('0x37')]('nolimit')){_0x2d05fc[_0xdd23('0x1d')]=qs[_0xdd23('0x1d')](_0x20d298[_0xdd23('0x32')][_0xdd23('0x1d')]);_0x2d05fc[_0xdd23('0x1b')]=qs[_0xdd23('0x1b')](_0x20d298[_0xdd23('0x32')][_0xdd23('0x1b')]);}return _0x5112ee[_0xdd23('0x62')](_0x2d05fc);}})[_0xdd23('0x24')](function(_0x1f2d3a){if(_0x1f2d3a){return _0x1f2d3a?{'count':_0x10bbeb,'rows':_0x1f2d3a}:null;}})[_0xdd23('0x24')](respondWithResult(_0xd76c54,null))[_0xdd23('0x44')](handleError(_0xd76c54,null));};exports[_0xdd23('0x64')]=function(_0x422272,_0x52710b,_0x28ce54){var _0x2026e3,_0x366598;var _0x3b2fc=[];var _0x71b74=moment()[_0xdd23('0x65')](_0xdd23('0x66'));return db[_0xdd23('0x41')][_0xdd23('0x4a')]({'where':{'id':_0x422272[_0xdd23('0x46')]['id']}})[_0xdd23('0x24')](handleEntityNotFound(_0x52710b,null))['then'](function(_0x1bfe43){if(_0x1bfe43){_0x366598=_0x1bfe43;return _0x1bfe43['addLists'](_0x422272[_0xdd23('0x4c')][_0xdd23('0x67')],_['omit'](_0x422272['body'],[_0xdd23('0x67'),'id'])||{});}return null;})[_0xdd23('0x68')](function(_0x386362){var _0x567587;var _0x4ad48e;_0x2026e3=_0x386362||[];var _0x19cb65=[];if(_0x386362){for(var _0x2b8b32=0x0;_0x2b8b32<_0x386362[_0xdd23('0x49')];_0x2b8b32+=0x1){var _0x11e198=_0x386362[_0x2b8b32]['get']({'plain':!![]});_0x366598['dialCheckDuplicateType']=_0x422272[_0xdd23('0x4c')][_0xdd23('0x69')]?_0x422272[_0xdd23('0x4c')]['dialCheckDuplicateType']:_0x366598[_0xdd23('0x69')];switch(_0x366598[_0xdd23('0x69')]){case'always':_0x567587=squel[_0xdd23('0x6a')]()['into'](_0xdd23('0x6b'))['fromQuery']([_0xdd23('0x6c'),_0xdd23('0x6d'),_0xdd23('0x6e'),'ListId','CampaignId',_0xdd23('0x55'),_0xdd23('0x56')],squel['select']()[_0xdd23('0x6f')]('phone','phone')[_0xdd23('0x6f')]('NOW()',_0xdd23('0x6d'))[_0xdd23('0x6f')]('id',_0xdd23('0x6e'))['field'](_0x11e198[_0xdd23('0x70')]['toString'](),_0xdd23('0x71'))[_0xdd23('0x6f')](_0x422272[_0xdd23('0x46')]['id'][_0xdd23('0x72')](),_0xdd23('0x5a'))[_0xdd23('0x6f')]('\x27'+_0x71b74+'\x27','createdAt')['field']('\x27'+_0x71b74+'\x27',_0xdd23('0x56'))['from'](_0xdd23('0x73'))[_0xdd23('0x3b')](_0xdd23('0x74'))[_0xdd23('0x3b')](_0xdd23('0x75'),_0x11e198['CmListId'][_0xdd23('0x72')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0xdd23('0x76'),squel[_0xdd23('0x77')]()[_0xdd23('0x6f')](_0xdd23('0x78'))[_0xdd23('0x79')]('cm_hopper_final')[_0xdd23('0x3b')](_0xdd23('0x7a'),_0x422272[_0xdd23('0x46')]['id'][_0xdd23('0x72')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xdd23('0x77')]()[_0xdd23('0x6f')]('COALESCE(phone,\x27\x27)')[_0xdd23('0x79')](_0xdd23('0x6b'))[_0xdd23('0x3b')]('CampaignId\x20=\x20?',_0x422272['params']['id']['toString']())))[_0xdd23('0x72')]();break;case _0xdd23('0x7b'):_0x567587=squel[_0xdd23('0x6a')]()[_0xdd23('0x7c')](_0xdd23('0x6b'))[_0xdd23('0x7d')](['phone','scheduledAt','ContactId',_0xdd23('0x71'),_0xdd23('0x5a'),'createdAt',_0xdd23('0x56')],squel[_0xdd23('0x77')]()[_0xdd23('0x6f')](_0xdd23('0x6c'),'phone')[_0xdd23('0x6f')](_0xdd23('0x7e'),_0xdd23('0x6d'))[_0xdd23('0x6f')]('id','ContactId')[_0xdd23('0x6f')](_0x11e198[_0xdd23('0x70')][_0xdd23('0x72')](),'ListId')['field'](_0x422272[_0xdd23('0x46')]['id']['toString'](),'CampaignId')[_0xdd23('0x6f')]('\x27'+_0x71b74+'\x27',_0xdd23('0x55'))[_0xdd23('0x6f')]('\x27'+_0x71b74+'\x27',_0xdd23('0x56'))['from'](_0xdd23('0x73'))[_0xdd23('0x3b')](_0xdd23('0x74'))[_0xdd23('0x3b')](_0xdd23('0x75'),_0x11e198[_0xdd23('0x70')][_0xdd23('0x72')]())[_0xdd23('0x3b')](_0xdd23('0x7f'))['where'](_0xdd23('0x76'),squel[_0xdd23('0x77')]()[_0xdd23('0x6f')](_0xdd23('0x80'))[_0xdd23('0x79')]('cm_hopper')['where'](_0xdd23('0x7a'),_0x422272['params']['id'][_0xdd23('0x72')]())))[_0xdd23('0x72')]();break;default:_0x567587=squel[_0xdd23('0x6a')]()[_0xdd23('0x7c')](_0xdd23('0x6b'))[_0xdd23('0x7d')](['phone',_0xdd23('0x6d'),_0xdd23('0x6e'),_0xdd23('0x71'),_0xdd23('0x5a'),_0xdd23('0x55'),_0xdd23('0x56')],squel[_0xdd23('0x77')]()[_0xdd23('0x6f')](_0xdd23('0x6c'),'phone')[_0xdd23('0x6f')](_0xdd23('0x7e'),_0xdd23('0x6d'))[_0xdd23('0x6f')]('id',_0xdd23('0x6e'))[_0xdd23('0x6f')](_0x11e198[_0xdd23('0x70')][_0xdd23('0x72')](),_0xdd23('0x71'))[_0xdd23('0x6f')](_0x422272[_0xdd23('0x46')]['id'][_0xdd23('0x72')](),_0xdd23('0x5a'))[_0xdd23('0x6f')]('\x27'+_0x71b74+'\x27','createdAt')['field']('\x27'+_0x71b74+'\x27','updatedAt')['from'](_0xdd23('0x73'))[_0xdd23('0x3b')](_0xdd23('0x74'))[_0xdd23('0x3b')](_0xdd23('0x75'),_0x11e198[_0xdd23('0x70')]['toString']())['where'](_0xdd23('0x7f')))[_0xdd23('0x72')]();}_0x4ad48e=squel[_0xdd23('0x6a')]()[_0xdd23('0x7c')](_0xdd23('0x81'))[_0xdd23('0x7d')](['cmHopperId',_0xdd23('0x6d'),_0xdd23('0x6c'),_0xdd23('0x82'),'createdAt',_0xdd23('0x56')],squel[_0xdd23('0x77')]()['field'](_0xdd23('0x83'),'id')[_0xdd23('0x6f')](_0xdd23('0x7e'),'scheduledAt')[_0xdd23('0x6f')]('ci.item',_0xdd23('0x6c'))[_0xdd23('0x6f')](_0xdd23('0x84'),_0xdd23('0x82'))['field']('\x27'+_0x71b74+'\x27','createdAt')['field']('\x27'+_0x71b74+'\x27',_0xdd23('0x56'))[_0xdd23('0x79')]('cm_contact_has_items','ci')['join'](_0xdd23('0x6b'),'h',_0xdd23('0x85'))[_0xdd23('0x3b')](_0xdd23('0x86'),_0x11e198[_0xdd23('0x70')][_0xdd23('0x72')]())[_0xdd23('0x3b')](_0xdd23('0x87'),_0x422272['params']['id']['toString']())[_0xdd23('0x3b')](_0xdd23('0x88'),_0x71b74))[_0xdd23('0x72')]();_0x19cb65[_0xdd23('0x89')](db[_0xdd23('0x8a')]['query'](_0x567587));_0x3b2fc[_0xdd23('0x89')](db[_0xdd23('0x8a')]['query'](_0x4ad48e));}return BPromise[_0xdd23('0x8b')](_0x19cb65);}})[_0xdd23('0x24')](function(){return BPromise[_0xdd23('0x8b')](_0x3b2fc);})[_0xdd23('0x24')](function(){return _0x2026e3;})[_0xdd23('0x24')](respondWithResult(_0x52710b,null))[_0xdd23('0x44')](handleError(_0x52710b,null));};exports[_0xdd23('0x8c')]=function(_0x57da4f,_0x55f2b1,_0x5ef3d3){return db[_0xdd23('0x41')][_0xdd23('0x4a')]({'where':{'id':_0x57da4f['params']['id']}})[_0xdd23('0x24')](handleEntityNotFound(_0x55f2b1,null))[_0xdd23('0x24')](function(_0x49aaed){if(_0x49aaed){return _0x49aaed[_0xdd23('0x8c')](_0x57da4f['query'][_0xdd23('0x67')]);}})[_0xdd23('0x24')](function(_0x2e56f3){if(_0x2e56f3){return db['CmHopper']['destroy']({'where':{'ListId':_0x57da4f[_0xdd23('0x32')][_0xdd23('0x67')],'CampaignId':_0x57da4f['params']['id']}})[_0xdd23('0x24')](function(){return _0x2e56f3;});}})['then'](respondWithStatusCode(_0x55f2b1,null))['catch'](handleError(_0x55f2b1,null));};exports[_0xdd23('0x8d')]=function(_0x5e9b6c,_0x34ae36,_0x133cc3){var _0x163d5a={};var _0x285fd9={};var _0x489c29;var _0x1e15fc;return db[_0xdd23('0x41')][_0xdd23('0x59')]({'where':{'id':_0x5e9b6c['params']['id']}})['then'](handleEntityNotFound(_0x34ae36,null))[_0xdd23('0x24')](function(_0x3c2965){if(_0x3c2965){_0x489c29=_0x3c2965;_0x285fd9[_0xdd23('0x31')]=_[_0xdd23('0x33')](db[_0xdd23('0x63')]['rawAttributes']);_0x285fd9[_0xdd23('0x32')]=_['keys'](_0x5e9b6c[_0xdd23('0x32')]);_0x285fd9[_0xdd23('0x34')]=_[_0xdd23('0x35')](_0x285fd9[_0xdd23('0x31')],_0x285fd9['query']);_0x163d5a[_0xdd23('0x36')]=_[_0xdd23('0x35')](_0x285fd9[_0xdd23('0x31')],qs[_0xdd23('0x48')](_0x5e9b6c['query']['fields']));_0x163d5a[_0xdd23('0x36')]=_0x163d5a[_0xdd23('0x36')][_0xdd23('0x49')]?_0x163d5a[_0xdd23('0x36')]:_0x285fd9[_0xdd23('0x31')];_0x163d5a[_0xdd23('0x39')]=qs[_0xdd23('0x3a')](_0x5e9b6c[_0xdd23('0x32')][_0xdd23('0x3a')]);_0x163d5a[_0xdd23('0x3b')]=qs[_0xdd23('0x34')](_[_0xdd23('0x3c')](_0x5e9b6c[_0xdd23('0x32')],_0x285fd9[_0xdd23('0x34')]));if(_0x5e9b6c[_0xdd23('0x32')][_0xdd23('0x3d')]){_0x163d5a[_0xdd23('0x3b')]=_[_0xdd23('0x3e')](_0x163d5a[_0xdd23('0x3b')],{'$or':_['map'](_0x163d5a['attributes'],function(_0x23e241){var _0xfa10aa={};_0xfa10aa[_0x23e241]={'$like':'%'+_0x5e9b6c[_0xdd23('0x32')][_0xdd23('0x3d')]+'%'};return _0xfa10aa;})});}_0x163d5a=_['merge']({},_0x163d5a,_0x5e9b6c[_0xdd23('0x3f')]);return _0x489c29['getBlackLists'](_0x163d5a);}})[_0xdd23('0x24')](function(_0x256464){if(_0x256464){_0x1e15fc=_0x256464[_0xdd23('0x49')];if(!_0x5e9b6c['query'][_0xdd23('0x37')](_0xdd23('0x38'))){_0x163d5a[_0xdd23('0x1d')]=qs[_0xdd23('0x1d')](_0x5e9b6c[_0xdd23('0x32')][_0xdd23('0x1d')]);_0x163d5a[_0xdd23('0x1b')]=qs['offset'](_0x5e9b6c['query'][_0xdd23('0x1b')]);}return _0x489c29['getBlackLists'](_0x163d5a);}})[_0xdd23('0x24')](function(_0x5eb022){if(_0x5eb022){return _0x5eb022?{'count':_0x1e15fc,'rows':_0x5eb022}:null;}})[_0xdd23('0x24')](respondWithResult(_0x34ae36,null))[_0xdd23('0x44')](handleError(_0x34ae36,null));};exports[_0xdd23('0x8e')]=function(_0x254bc3,_0x359f29,_0x321478){var _0x86a25d,_0x553764;var _0x38b37c=[];var _0x17a30f=moment()[_0xdd23('0x65')](_0xdd23('0x66'));return db[_0xdd23('0x41')][_0xdd23('0x4a')]({'where':{'id':_0x254bc3['params']['id']}})['then'](handleEntityNotFound(_0x359f29,null))[_0xdd23('0x24')](function(_0x5caec4){if(_0x5caec4){_0x553764=_0x5caec4;return _0x5caec4[_0xdd23('0x8e')](_0x254bc3[_0xdd23('0x4c')]['ids'],_[_0xdd23('0x8f')](_0x254bc3[_0xdd23('0x4c')],['ids','id'])||{});}return null;})[_0xdd23('0x68')](function(_0x3d4903){var _0x13acf2;var _0x3765bc;_0x86a25d=_0x3d4903||[];var _0x23b230=[];if(_0x3d4903){for(var _0x3cc9f2=0x0;_0x3cc9f2<_0x3d4903[_0xdd23('0x49')];_0x3cc9f2+=0x1){var _0x24afca=_0x3d4903[_0x3cc9f2][_0xdd23('0x26')]({'plain':!![]});_0x13acf2=squel['insert']()['into'](_0xdd23('0x90'))['fromQuery'](['phone',_0xdd23('0x6e'),'ListId',_0xdd23('0x5a'),_0xdd23('0x55'),'updatedAt'],squel[_0xdd23('0x77')]()['field'](_0xdd23('0x6c'),_0xdd23('0x6c'))[_0xdd23('0x6f')]('id',_0xdd23('0x6e'))[_0xdd23('0x6f')](_0x24afca[_0xdd23('0x70')][_0xdd23('0x72')](),'ListId')[_0xdd23('0x6f')](_0x254bc3[_0xdd23('0x46')]['id'][_0xdd23('0x72')](),_0xdd23('0x5a'))[_0xdd23('0x6f')](_0xdd23('0x7e'),_0xdd23('0x55'))[_0xdd23('0x6f')]('NOW()',_0xdd23('0x56'))[_0xdd23('0x79')](_0xdd23('0x73'))['where'](_0xdd23('0x74'))['where'](_0xdd23('0x75'),_0x24afca[_0xdd23('0x70')][_0xdd23('0x72')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xdd23('0x72')]();_0x23b230[_0xdd23('0x89')](db[_0xdd23('0x8a')]['query'](_0x13acf2));}return BPromise[_0xdd23('0x8b')](_0x23b230);}})[_0xdd23('0x24')](function(){return _0x86a25d;})[_0xdd23('0x24')](respondWithResult(_0x359f29,null))[_0xdd23('0x44')](handleError(_0x359f29,null));};exports[_0xdd23('0x91')]=function(_0x53608c,_0x557686,_0x1c2938){return db[_0xdd23('0x41')][_0xdd23('0x4a')]({'where':{'id':_0x53608c[_0xdd23('0x46')]['id']}})[_0xdd23('0x24')](handleEntityNotFound(_0x557686,null))['then'](function(_0x173122){if(_0x173122){return _0x173122[_0xdd23('0x91')](_0x53608c['query'][_0xdd23('0x67')]);}})[_0xdd23('0x24')](function(_0xfd512e){if(_0xfd512e){return db[_0xdd23('0x61')][_0xdd23('0x25')]({'where':{'ListId':_0x53608c[_0xdd23('0x32')][_0xdd23('0x67')],'CampaignId':_0x53608c[_0xdd23('0x46')]['id']}})['then'](function(){return _0xfd512e;});}})['then'](respondWithStatusCode(_0x557686,null))['catch'](handleError(_0x557686,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 63a95d1..e897087 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 _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x405a7a,_0x5937ac){var _0x4c9a54=function(_0x826698){while(--_0x826698){_0x405a7a['push'](_0x405a7a['shift']());}};_0x4c9a54(++_0x5937ac);}(_0x7a54,0x106));var _0x47a5=function(_0xb6699e,_0x67ec85){_0xb6699e=_0xb6699e-0x0;var _0x53d746=_0x7a54[_0xb6699e];return _0x53d746;};'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 3c58b73..32dd702 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 _0xa101=['then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','include','model','map','stringify','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x2f2360,_0x151089){var _0x1cc8d3=function(_0x5e356f){while(--_0x5e356f){_0x2f2360['push'](_0x2f2360['shift']());}};_0x1cc8d3(++_0x151089);}(_0xa101,0x15f));var _0x1a10=function(_0x540133,_0x41783f){_0x540133=_0x540133-0x0;var _0x26b6e9=_0xa101[_0x540133];return _0x26b6e9;};'use strict';var _=require(_0x1a10('0x0'));var util=require(_0x1a10('0x1'));var moment=require('moment');var BPromise=require(_0x1a10('0x2'));var rs=require(_0x1a10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1a10('0x4'))['db'];var utils=require(_0x1a10('0x5'));var logger=require('../../config/logger')(_0x1a10('0x6'));var config=require(_0x1a10('0x7'));var jayson=require(_0x1a10('0x8'));var client=jayson[_0x1a10('0x9')][_0x1a10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b95f3,_0x5eea77,_0x4f0cd4){return new BPromise(function(_0x3c90fa,_0x2df5ef){return client[_0x1a10('0xb')](_0x2b95f3,_0x4f0cd4)[_0x1a10('0xc')](function(_0x7c7a8a){logger[_0x1a10('0xd')](_0x1a10('0xe'),_0x5eea77,'request\x20sent');logger[_0x1a10('0xf')](_0x1a10('0x10'),_0x5eea77,_0x1a10('0x11'),JSON['stringify'](_0x7c7a8a));if(_0x7c7a8a[_0x1a10('0x12')]){if(_0x7c7a8a[_0x1a10('0x12')][_0x1a10('0x13')]===0x1f4){logger['error'](_0x1a10('0xe'),_0x5eea77,_0x7c7a8a[_0x1a10('0x12')][_0x1a10('0x14')]);return _0x2df5ef(_0x7c7a8a[_0x1a10('0x12')][_0x1a10('0x14')]);}logger['error'](_0x1a10('0xe'),_0x5eea77,_0x7c7a8a['error']['message']);return _0x3c90fa(_0x7c7a8a['error'][_0x1a10('0x14')]);}else{logger[_0x1a10('0xd')](_0x1a10('0xe'),_0x5eea77,_0x1a10('0x11'));_0x3c90fa(_0x7c7a8a['result'][_0x1a10('0x14')]);}})[_0x1a10('0x15')](function(_0x5395b4){logger[_0x1a10('0x12')](_0x1a10('0xe'),_0x5eea77,_0x5395b4);_0x2df5ef(_0x5395b4);});});}exports[_0x1a10('0x16')]=function(_0x457e2f){var _0x4a3813=this;return new Promise(function(_0x169cf2,_0x1b394c){return db[_0x1a10('0x17')][_0x1a10('0x18')]({'raw':_0x457e2f[_0x1a10('0x19')]?_0x457e2f[_0x1a10('0x19')][_0x1a10('0x1a')]===undefined?!![]:![]:!![],'where':_0x457e2f[_0x1a10('0x19')]?_0x457e2f[_0x1a10('0x19')][_0x1a10('0x1b')]||null:null,'attributes':_0x457e2f[_0x1a10('0x19')]?_0x457e2f[_0x1a10('0x19')][_0x1a10('0x1c')]||null:null,'limit':_0x457e2f[_0x1a10('0x19')]?_0x457e2f[_0x1a10('0x19')]['limit']||null:null,'include':_0x457e2f[_0x1a10('0x19')]?_0x457e2f['options'][_0x1a10('0x1d')]?_['map'](_0x457e2f[_0x1a10('0x19')]['include'],function(_0x11148c){return{'model':db[_0x11148c[_0x1a10('0x1e')]],'as':_0x11148c['as'],'attributes':_0x11148c['attributes'],'include':_0x11148c[_0x1a10('0x1d')]?_[_0x1a10('0x1f')](_0x11148c[_0x1a10('0x1d')],function(_0x43cae0){return{'model':db[_0x43cae0['model']],'as':_0x43cae0['as'],'attributes':_0x43cae0[_0x1a10('0x1c')],'include':_0x43cae0[_0x1a10('0x1d')]?_[_0x1a10('0x1f')](_0x43cae0[_0x1a10('0x1d')],function(_0xc093f6){return{'model':db[_0xc093f6[_0x1a10('0x1e')]],'as':_0xc093f6['as'],'attributes':_0xc093f6[_0x1a10('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1a10('0xc')](function(_0x4ba1a2){logger['info']('GetCampaign',_0x457e2f);logger[_0x1a10('0xf')](_0x1a10('0x16'),_0x457e2f,JSON[_0x1a10('0x20')](_0x4ba1a2));_0x169cf2(_0x4ba1a2);})[_0x1a10('0x15')](function(_0x4c2d92){logger[_0x1a10('0x12')](_0x1a10('0x16'),_0x4c2d92['message'],_0x457e2f);_0x1b394c(_0x4a3813[_0x1a10('0x12')](0x1f4,_0x4c2d92[_0x1a10('0x14')]));});});}; \ No newline at end of file +var _0xe14d=['limit','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','raw','attributes'];(function(_0x45b29d,_0x44ce43){var _0x32d74=function(_0x559eff){while(--_0x559eff){_0x45b29d['push'](_0x45b29d['shift']());}};_0x32d74(++_0x44ce43);}(_0xe14d,0x1ee));var _0xde14=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xe14d[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var moment=require(_0xde14('0x2'));var BPromise=require(_0xde14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde14('0x4'));var db=require(_0xde14('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde14('0x6'))(_0xde14('0x7'));var config=require(_0xde14('0x8'));var jayson=require(_0xde14('0x9'));var client=jayson[_0xde14('0xa')][_0xde14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b1f6b,_0x5a1344,_0x1bd49d){return new BPromise(function(_0x115b7d,_0x2b0e7c){return client[_0xde14('0xc')](_0x4b1f6b,_0x1bd49d)[_0xde14('0xd')](function(_0x176909){logger[_0xde14('0xe')](_0xde14('0xf'),_0x5a1344,'request\x20sent');logger[_0xde14('0x10')](_0xde14('0x11'),_0x5a1344,_0xde14('0x12'),JSON[_0xde14('0x13')](_0x176909));if(_0x176909[_0xde14('0x14')]){if(_0x176909[_0xde14('0x14')][_0xde14('0x15')]===0x1f4){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909[_0xde14('0x14')][_0xde14('0x16')]);return _0x2b0e7c(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909['error']['message']);return _0x115b7d(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}else{logger[_0xde14('0xe')]('Campaign,\x20%s,\x20%s',_0x5a1344,_0xde14('0x12'));_0x115b7d(_0x176909[_0xde14('0x17')][_0xde14('0x16')]);}})[_0xde14('0x18')](function(_0x3de959){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x3de959);_0x2b0e7c(_0x3de959);});});}exports[_0xde14('0x19')]=function(_0x3cc317){var _0x10c4ab=this;return new Promise(function(_0x590a8b,_0x3f5fcf){return db[_0xde14('0x1a')][_0xde14('0x1b')]({'raw':_0x3cc317[_0xde14('0x1c')]?_0x3cc317['options'][_0xde14('0x1d')]===undefined?!![]:![]:!![],'where':_0x3cc317['options']?_0x3cc317[_0xde14('0x1c')]['where']||null:null,'attributes':_0x3cc317[_0xde14('0x1c')]?_0x3cc317[_0xde14('0x1c')][_0xde14('0x1e')]||null:null,'limit':_0x3cc317[_0xde14('0x1c')]?_0x3cc317[_0xde14('0x1c')][_0xde14('0x1f')]||null:null,'include':_0x3cc317[_0xde14('0x1c')]?_0x3cc317[_0xde14('0x1c')][_0xde14('0x20')]?_[_0xde14('0x21')](_0x3cc317[_0xde14('0x1c')][_0xde14('0x20')],function(_0x8f8033){return{'model':db[_0x8f8033['model']],'as':_0x8f8033['as'],'attributes':_0x8f8033[_0xde14('0x1e')],'include':_0x8f8033[_0xde14('0x20')]?_[_0xde14('0x21')](_0x8f8033[_0xde14('0x20')],function(_0x1bb7be){return{'model':db[_0x1bb7be[_0xde14('0x22')]],'as':_0x1bb7be['as'],'attributes':_0x1bb7be[_0xde14('0x1e')],'include':_0x1bb7be[_0xde14('0x20')]?_[_0xde14('0x21')](_0x1bb7be[_0xde14('0x20')],function(_0x4eff65){return{'model':db[_0x4eff65[_0xde14('0x22')]],'as':_0x4eff65['as'],'attributes':_0x4eff65[_0xde14('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xde14('0xd')](function(_0xf8279a){logger['info'](_0xde14('0x19'),_0x3cc317);logger[_0xde14('0x10')](_0xde14('0x19'),_0x3cc317,JSON['stringify'](_0xf8279a));_0x590a8b(_0xf8279a);})[_0xde14('0x18')](function(_0x582537){logger[_0xde14('0x14')](_0xde14('0x19'),_0x582537[_0xde14('0x16')],_0x3cc317);_0x3f5fcf(_0x10c4ab[_0xde14('0x14')](0x1f4,_0x582537[_0xde14('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 03693d7..96a695a 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 _0x9e93=['create','/:id/clone','clone','addLists','addBlackLists','update','delete','destroy','removeLists','removeBlackLists','multer','path','express','Router','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9e93,0xca));var _0x39e9=function(_0x1b25c1,_0x2c6ce6){_0x1b25c1=_0x1b25c1-0x0;var _0x1e4447=_0x9e93[_0x1b25c1];return _0x1e4447;};'use strict';var multer=require(_0x39e9('0x0'));var util=require('util');var path=require(_0x39e9('0x1'));var timeout=require('connect-timeout');var express=require(_0x39e9('0x2'));var router=express[_0x39e9('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x39e9('0x4'));var config=require(_0x39e9('0x5'));var controller=require(_0x39e9('0x6'));router[_0x39e9('0x7')]('/',auth[_0x39e9('0x8')](),controller['index']);router['get'](_0x39e9('0x9'),auth['isAuthenticated'](),controller[_0x39e9('0xa')]);router[_0x39e9('0x7')](_0x39e9('0xb'),auth['isAuthenticated'](),controller[_0x39e9('0xc')]);router['get'](_0x39e9('0xd'),auth[_0x39e9('0x8')](),controller[_0x39e9('0xe')]);router[_0x39e9('0x7')](_0x39e9('0xf'),auth[_0x39e9('0x8')](),controller['getHopperFinals']);router[_0x39e9('0x7')](_0x39e9('0x10'),auth[_0x39e9('0x8')](),controller[_0x39e9('0x11')]);router[_0x39e9('0x7')](_0x39e9('0x12'),auth[_0x39e9('0x8')](),controller['getLists']);router[_0x39e9('0x7')](_0x39e9('0x13'),auth['isAuthenticated'](),controller[_0x39e9('0x14')]);router[_0x39e9('0x15')]('/',auth['isAuthenticated'](),controller[_0x39e9('0x16')]);router[_0x39e9('0x15')](_0x39e9('0x17'),auth[_0x39e9('0x8')](),controller[_0x39e9('0x18')]);router['post']('/:id/lists',auth[_0x39e9('0x8')](),controller[_0x39e9('0x19')]);router['post']('/:id/blacklists',auth[_0x39e9('0x8')](),controller[_0x39e9('0x1a')]);router['put'](_0x39e9('0x9'),auth[_0x39e9('0x8')](),controller[_0x39e9('0x1b')]);router[_0x39e9('0x1c')](_0x39e9('0x9'),auth[_0x39e9('0x8')](),controller[_0x39e9('0x1d')]);router[_0x39e9('0x1c')](_0x39e9('0x12'),auth[_0x39e9('0x8')](),controller[_0x39e9('0x1e')]);router[_0x39e9('0x1c')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x39e9('0x1f')]);module['exports']=router; \ No newline at end of file +var _0xbb7f=['/:id/clone','clone','addLists','addBlackLists','put','update','destroy','delete','removeLists','removeBlackLists','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create'];(function(_0x420030,_0x323141){var _0x2cbd2a=function(_0x5c005f){while(--_0x5c005f){_0x420030['push'](_0x420030['shift']());}};_0x2cbd2a(++_0x323141);}(_0xbb7f,0xe3));var _0xfbb7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbb7f[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xfbb7('0x0'));var util=require(_0xfbb7('0x1'));var path=require('path');var timeout=require(_0xfbb7('0x2'));var express=require(_0xfbb7('0x3'));var router=express[_0xfbb7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfbb7('0x5'));var interaction=require(_0xfbb7('0x6'));var config=require(_0xfbb7('0x7'));var controller=require(_0xfbb7('0x8'));router['get']('/',auth[_0xfbb7('0x9')](),controller[_0xfbb7('0xa')]);router[_0xfbb7('0xb')](_0xfbb7('0xc'),auth[_0xfbb7('0x9')](),controller[_0xfbb7('0xd')]);router['get'](_0xfbb7('0xe'),auth[_0xfbb7('0x9')](),controller[_0xfbb7('0xf')]);router[_0xfbb7('0xb')](_0xfbb7('0x10'),auth[_0xfbb7('0x9')](),controller['getHopperHistories']);router[_0xfbb7('0xb')](_0xfbb7('0x11'),auth[_0xfbb7('0x9')](),controller[_0xfbb7('0x12')]);router[_0xfbb7('0xb')]('/:id/hopper_black',auth[_0xfbb7('0x9')](),controller['getHopperBlacks']);router[_0xfbb7('0xb')](_0xfbb7('0x13'),auth[_0xfbb7('0x9')](),controller[_0xfbb7('0x14')]);router[_0xfbb7('0xb')](_0xfbb7('0x15'),auth[_0xfbb7('0x9')](),controller[_0xfbb7('0x16')]);router[_0xfbb7('0x17')]('/',auth[_0xfbb7('0x9')](),controller[_0xfbb7('0x18')]);router[_0xfbb7('0x17')](_0xfbb7('0x19'),auth[_0xfbb7('0x9')](),controller[_0xfbb7('0x1a')]);router[_0xfbb7('0x17')](_0xfbb7('0x13'),auth[_0xfbb7('0x9')](),controller[_0xfbb7('0x1b')]);router['post'](_0xfbb7('0x15'),auth[_0xfbb7('0x9')](),controller[_0xfbb7('0x1c')]);router[_0xfbb7('0x1d')](_0xfbb7('0xc'),auth[_0xfbb7('0x9')](),controller[_0xfbb7('0x1e')]);router['delete']('/:id',auth[_0xfbb7('0x9')](),controller[_0xfbb7('0x1f')]);router[_0xfbb7('0x20')](_0xfbb7('0x13'),auth['isAuthenticated'](),controller[_0xfbb7('0x21')]);router[_0xfbb7('0x20')](_0xfbb7('0x15'),auth[_0xfbb7('0x9')](),controller[_0xfbb7('0x22')]);module[_0xfbb7('0x23')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index df02eb3..a8fcdc4 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 _0x2db5=['getDataValue','key','STRING','VIRTUAL'];(function(_0x13048a,_0xa3d206){var _0x53297c=function(_0x360580){while(--_0x360580){_0x13048a['push'](_0x13048a['shift']());}};_0x53297c(++_0xa3d206);}(_0x2db5,0x12e));var _0x52db=function(_0x1193ea,_0xc04ef0){_0x1193ea=_0x1193ea-0x0;var _0x5e4000=_0x2db5[_0x1193ea];return _0x5e4000;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x52db('0x0')]},'name':{'type':Sequelize[_0x52db('0x1')],'get':function(){return this[_0x52db('0x2')](_0x52db('0x3'));}}}; \ No newline at end of file +var _0x1067=['STRING','TEXT','VIRTUAL','key','sequelize'];(function(_0x5cfc3c,_0x5a40d3){var _0x55fdab=function(_0x4ef059){while(--_0x4ef059){_0x5cfc3c['push'](_0x5cfc3c['shift']());}};_0x55fdab(++_0x5a40d3);}(_0x1067,0x171));var _0x7106=function(_0x32d788,_0xbaa65e){_0x32d788=_0x32d788-0x0;var _0x1b671a=_0x1067[_0x32d788];return _0x1b671a;};'use strict';var Sequelize=require(_0x7106('0x0'));module['exports']={'key':{'type':Sequelize[_0x7106('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x7106('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7106('0x1')]},'name':{'type':Sequelize[_0x7106('0x3')],'get':function(){return this['getDataValue'](_0x7106('0x4'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 0b54533..1e0bda4 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 _0x55df=['include','find','update','destroy','body','MailAccountId','SmsAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CannedAnswers','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','UserProfileResource','error','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','merge','filter','options','includeAll','findAll','catch','show','params','keys','length'];(function(_0x18fe69,_0x209621){var _0x2905b0=function(_0x56d2d5){while(--_0x56d2d5){_0x18fe69['push'](_0x18fe69['shift']());}};_0x2905b0(++_0x209621);}(_0x55df,0x1ce));var _0xf55d=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x55df[_0x3511d3];return _0x5d6321;};'use strict';var emlformat=require(_0xf55d('0x0'));var rimraf=require(_0xf55d('0x1'));var zipdir=require(_0xf55d('0x2'));var jsonpatch=require(_0xf55d('0x3'));var rp=require(_0xf55d('0x4'));var moment=require('moment');var BPromise=require(_0xf55d('0x5'));var Mustache=require(_0xf55d('0x6'));var util=require('util');var path=require(_0xf55d('0x7'));var sox=require(_0xf55d('0x8'));var csv=require(_0xf55d('0x9'));var ejs=require(_0xf55d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf55d('0xb'));var squel=require(_0xf55d('0xc'));var crypto=require(_0xf55d('0xd'));var jsforce=require(_0xf55d('0xe'));var deskjs=require(_0xf55d('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf55d('0x10'));var Redis=require('ioredis');var authService=require(_0xf55d('0x11'));var qs=require(_0xf55d('0x12'));var as=require(_0xf55d('0x13'));var hardwareService=require(_0xf55d('0x14'));var logger=require(_0xf55d('0x15'))(_0xf55d('0x16'));var utils=require(_0xf55d('0x17'));var config=require(_0xf55d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf55d('0x19'))['db'];function respondWithStatusCode(_0x34c7f3,_0x2dee42){_0x2dee42=_0x2dee42||0xcc;return function(_0x3dd3e6){if(_0x3dd3e6){return _0x34c7f3[_0xf55d('0x1a')](_0x2dee42);}return _0x34c7f3[_0xf55d('0x1b')](_0x2dee42)[_0xf55d('0x1c')]();};}function respondWithResult(_0x295468,_0xb7b786){_0xb7b786=_0xb7b786||0xc8;return function(_0x3962db){if(_0x3962db){return _0x295468[_0xf55d('0x1b')](_0xb7b786)[_0xf55d('0x1d')](_0x3962db);}};}function respondWithFilteredResult(_0x21144c,_0x54518c){return function(_0x2444e3){if(_0x2444e3){var _0xf016ac=typeof _0x54518c[_0xf55d('0x1e')]===_0xf55d('0x1f')&&typeof _0x54518c[_0xf55d('0x20')]===_0xf55d('0x1f');var _0x475901=_0x2444e3[_0xf55d('0x21')];var _0x3eff98=_0xf016ac?0x0:_0x54518c[_0xf55d('0x1e')];var _0x54e645=_0xf016ac?_0x2444e3[_0xf55d('0x21')]:_0x54518c[_0xf55d('0x1e')]+_0x54518c[_0xf55d('0x20')];var _0x224af8;if(_0x54e645>=_0x475901){_0x54e645=_0x475901;_0x224af8=0xc8;}else{_0x224af8=0xce;}_0x21144c['status'](_0x224af8);return _0x21144c[_0xf55d('0x22')](_0xf55d('0x23'),_0x3eff98+'-'+_0x54e645+'/'+_0x475901)[_0xf55d('0x1d')](_0x2444e3);}return null;};}function patchUpdates(_0x4b5c64){return function(_0x43824d){try{jsonpatch[_0xf55d('0x24')](_0x43824d,_0x4b5c64,!![]);}catch(_0x384993){return BPromise[_0xf55d('0x25')](_0x384993);}return _0x43824d[_0xf55d('0x26')]();};}function saveUpdates(_0x459171,_0x231e87){return function(_0x17ac78){if(_0x17ac78){return _0x17ac78['update'](_0x459171)[_0xf55d('0x27')](function(_0xcea301){return _0xcea301;});}return null;};}function removeEntity(_0x1d4f01,_0x2350d5){return function(_0x5ade54){if(_0x5ade54){return _0x5ade54['destroy']()[_0xf55d('0x27')](function(){var _0x36a319=_0x5ade54[_0xf55d('0x28')]({'plain':!![]});var _0x28d97d='CannedAnswers';return db[_0xf55d('0x29')]['destroy']({'where':{'type':_0x28d97d,'resourceId':_0x36a319['id']}})[_0xf55d('0x27')](function(){return _0x5ade54;});})[_0xf55d('0x27')](function(){_0x1d4f01[_0xf55d('0x1b')](0xcc)[_0xf55d('0x1c')]();});}};}function handleEntityNotFound(_0x1676f3,_0x6c5f55){return function(_0x447292){if(!_0x447292){_0x1676f3[_0xf55d('0x1a')](0x194);}return _0x447292;};}function handleError(_0x460991,_0x3442ae){_0x3442ae=_0x3442ae||0x1f4;return function(_0x455f4f){logger[_0xf55d('0x2a')](_0x455f4f['stack']);if(_0x455f4f[_0xf55d('0x2b')]){delete _0x455f4f[_0xf55d('0x2b')];}_0x460991['status'](_0x3442ae)[_0xf55d('0x2c')](_0x455f4f);};}exports[_0xf55d('0x2d')]=function(_0x419033,_0x55ab60){var _0x2f7c10={},_0x2b76bc={},_0x144dfd={'count':0x0,'rows':[]};var _0xafc6be=_[_0xf55d('0x2e')](db[_0xf55d('0x2f')][_0xf55d('0x30')],function(_0x25cc4c){return{'name':_0x25cc4c[_0xf55d('0x31')],'type':_0x25cc4c[_0xf55d('0x32')][_0xf55d('0x33')]};});_0x2b76bc[_0xf55d('0x34')]=_[_0xf55d('0x2e')](_0xafc6be,_0xf55d('0x2b'));_0x2b76bc[_0xf55d('0x35')]=_['keys'](_0x419033['query']);_0x2b76bc[_0xf55d('0x36')]=_[_0xf55d('0x37')](_0x2b76bc['model'],_0x2b76bc[_0xf55d('0x35')]);_0x2f7c10[_0xf55d('0x38')]=_['intersection'](_0x2b76bc[_0xf55d('0x34')],qs[_0xf55d('0x39')](_0x419033[_0xf55d('0x35')][_0xf55d('0x39')]));_0x2f7c10['attributes']=_0x2f7c10[_0xf55d('0x38')]['length']?_0x2f7c10[_0xf55d('0x38')]:_0x2b76bc[_0xf55d('0x34')];if(!_0x419033['query']['hasOwnProperty'](_0xf55d('0x3a'))){_0x2f7c10[_0xf55d('0x20')]=qs[_0xf55d('0x20')](_0x419033[_0xf55d('0x35')]['limit']);_0x2f7c10[_0xf55d('0x1e')]=qs[_0xf55d('0x1e')](_0x419033['query']['offset']);}_0x2f7c10[_0xf55d('0x3b')]=qs[_0xf55d('0x3c')](_0x419033[_0xf55d('0x35')][_0xf55d('0x3c')]);_0x2f7c10[_0xf55d('0x3d')]=qs[_0xf55d('0x36')](_['pick'](_0x419033[_0xf55d('0x35')],_0x2b76bc[_0xf55d('0x36')]),_0xafc6be);if(_0x419033[_0xf55d('0x35')]['filter']){_0x2f7c10['where']=_[_0xf55d('0x3e')](_0x2f7c10[_0xf55d('0x3d')],{'$or':[{'key':{'$like':'%'+_0x419033['query'][_0xf55d('0x3f')]+'%'}},{'value':{'$like':'%'+_0x419033[_0xf55d('0x35')][_0xf55d('0x3f')]+'%'}}]});}_0x2f7c10=_[_0xf55d('0x3e')]({},_0x2f7c10,_0x419033[_0xf55d('0x40')]);var _0x6ece21={'where':_0x2f7c10[_0xf55d('0x3d')]};return db[_0xf55d('0x2f')]['count'](_0x6ece21)[_0xf55d('0x27')](function(_0x1eda9d){_0x144dfd[_0xf55d('0x21')]=_0x1eda9d;if(_0x419033[_0xf55d('0x35')][_0xf55d('0x41')]){_0x2f7c10['include']=[{'all':!![]}];}return db[_0xf55d('0x2f')][_0xf55d('0x42')](_0x2f7c10);})['then'](function(_0x533137){_0x144dfd['rows']=_0x533137;return _0x144dfd;})[_0xf55d('0x27')](respondWithFilteredResult(_0x55ab60,_0x2f7c10))[_0xf55d('0x43')](handleError(_0x55ab60,null));};exports[_0xf55d('0x44')]=function(_0x2671bf,_0x1c1023){var _0x21f979={'raw':!![],'where':{'id':_0x2671bf[_0xf55d('0x45')]['id']}},_0x345ee2={};_0x345ee2['model']=_['keys'](db[_0xf55d('0x2f')][_0xf55d('0x30')]);_0x345ee2[_0xf55d('0x35')]=_[_0xf55d('0x46')](_0x2671bf[_0xf55d('0x35')]);_0x345ee2[_0xf55d('0x36')]=_['intersection'](_0x345ee2[_0xf55d('0x34')],_0x345ee2[_0xf55d('0x35')]);_0x21f979['attributes']=_['intersection'](_0x345ee2[_0xf55d('0x34')],qs[_0xf55d('0x39')](_0x2671bf[_0xf55d('0x35')][_0xf55d('0x39')]));_0x21f979['attributes']=_0x21f979[_0xf55d('0x38')][_0xf55d('0x47')]?_0x21f979[_0xf55d('0x38')]:_0x345ee2[_0xf55d('0x34')];if(_0x2671bf[_0xf55d('0x35')][_0xf55d('0x41')]){_0x21f979[_0xf55d('0x48')]=[{'all':!![]}];}_0x21f979=_[_0xf55d('0x3e')]({},_0x21f979,_0x2671bf['options']);return db[_0xf55d('0x2f')][_0xf55d('0x49')](_0x21f979)[_0xf55d('0x27')](handleEntityNotFound(_0x1c1023,null))[_0xf55d('0x27')](respondWithResult(_0x1c1023,null))[_0xf55d('0x43')](handleError(_0x1c1023,null));};exports[_0xf55d('0x4a')]=function(_0x19b0ba,_0x5832bd){if(_0x19b0ba['body']['id']){delete _0x19b0ba['body']['id'];}return db[_0xf55d('0x2f')]['find']({'where':{'id':_0x19b0ba[_0xf55d('0x45')]['id']}})['then'](handleEntityNotFound(_0x5832bd,null))[_0xf55d('0x27')](saveUpdates(_0x19b0ba['body'],null))[_0xf55d('0x27')](respondWithResult(_0x5832bd,null))[_0xf55d('0x43')](handleError(_0x5832bd,null));};exports[_0xf55d('0x4b')]=function(_0x1e6fcb,_0x370f0e){return db[_0xf55d('0x2f')][_0xf55d('0x49')]({'where':{'id':_0x1e6fcb[_0xf55d('0x45')]['id']}})[_0xf55d('0x27')](handleEntityNotFound(_0x370f0e,null))['then'](removeEntity(_0x370f0e,null))[_0xf55d('0x43')](handleError(_0x370f0e,null));};exports['create']=function(_0x42f01b,_0x5b5073){var _0x4bfacf={'key':_0x42f01b['body'][_0xf55d('0x33')]};if(_0x42f01b[_0xf55d('0x4c')][_0xf55d('0x4d')]){_0x4bfacf['MailAccountId']=_0x42f01b[_0xf55d('0x4c')][_0xf55d('0x4d')];}else if(_0x42f01b[_0xf55d('0x4c')][_0xf55d('0x4e')]){_0x4bfacf[_0xf55d('0x4e')]=_0x42f01b[_0xf55d('0x4c')][_0xf55d('0x4e')];}else if(_0x42f01b[_0xf55d('0x4c')]['OpenchannelAccountId']){_0x4bfacf['OpenchannelAccountId']=_0x42f01b[_0xf55d('0x4c')]['OpenchannelAccountId'];}else if(_0x42f01b[_0xf55d('0x4c')]['ChatWebsiteId']){_0x4bfacf[_0xf55d('0x4f')]=_0x42f01b[_0xf55d('0x4c')][_0xf55d('0x4f')];}return db[_0xf55d('0x2f')][_0xf55d('0x49')]({'where':_0x4bfacf})[_0xf55d('0x27')](function(_0x3ba7fa){if(_0x3ba7fa){throw new db[(_0xf55d('0x50'))]['ValidationError'](_0xf55d('0x51'));}return db[_0xf55d('0x2f')][_0xf55d('0x52')](_0x42f01b[_0xf55d('0x4c')]);})[_0xf55d('0x27')](function(_0x1b3da6){var _0x4ba254=_0x42f01b[_0xf55d('0x53')][_0xf55d('0x28')]({'plain':!![]});if(!_0x4ba254)throw new Error(_0xf55d('0x54'));if(_0x4ba254[_0xf55d('0x55')]===_0xf55d('0x53')){var _0x5742c4=_0x1b3da6['get']({'plain':!![]});return db['UserProfileSection'][_0xf55d('0x49')]({'where':{'name':_0xf55d('0x56'),'userProfileId':_0x4ba254[_0xf55d('0x57')]},'raw':!![]})[_0xf55d('0x27')](function(_0x2dd087){if(_0x2dd087&&_0x2dd087[_0xf55d('0x58')]===0x0){return db[_0xf55d('0x29')][_0xf55d('0x52')]({'name':_0x5742c4[_0xf55d('0x2b')],'resourceId':_0x5742c4['id'],'type':_0x2dd087[_0xf55d('0x2b')],'sectionId':_0x2dd087['id']},{})['then'](function(){return _0x1b3da6;});}else{return _0x1b3da6;}})[_0xf55d('0x43')](function(_0x40773b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40773b);throw _0x40773b;});}return _0x1b3da6;})[_0xf55d('0x27')](respondWithResult(_0x5b5073,0xc9))[_0xf55d('0x43')](handleError(_0x5b5073,null));}; \ No newline at end of file +var _0x6da9=['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','undefined','offset','count','set','Content-Range','json','apply','reject','save','then','CannedAnswers','UserProfileResource','destroy','end','error','send','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','options','CannedAnswer','include','findAll','rows','catch','show','params','includeAll','merge','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel'];(function(_0x28d885,_0x22d916){var _0x54e080=function(_0x1b9e76){while(--_0x1b9e76){_0x28d885['push'](_0x28d885['shift']());}};_0x54e080(++_0x22d916);}(_0x6da9,0xaa));var _0x96da=function(_0x1f4a2f,_0x39c4a5){_0x1f4a2f=_0x1f4a2f-0x0;var _0x4b060e=_0x6da9[_0x1f4a2f];return _0x4b060e;};'use strict';var emlformat=require(_0x96da('0x0'));var rimraf=require(_0x96da('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x96da('0x2'));var rp=require(_0x96da('0x3'));var moment=require(_0x96da('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x96da('0x5'));var util=require(_0x96da('0x6'));var path=require(_0x96da('0x7'));var sox=require(_0x96da('0x8'));var csv=require(_0x96da('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x96da('0xa'));var _=require('lodash');var squel=require(_0x96da('0xb'));var crypto=require('crypto');var jsforce=require(_0x96da('0xc'));var deskjs=require(_0x96da('0xd'));var toCsv=require(_0x96da('0x9'));var querystring=require(_0x96da('0xe'));var Papa=require(_0x96da('0xf'));var Redis=require(_0x96da('0x10'));var authService=require(_0x96da('0x11'));var qs=require(_0x96da('0x12'));var as=require(_0x96da('0x13'));var hardwareService=require(_0x96da('0x14'));var logger=require(_0x96da('0x15'))(_0x96da('0x16'));var utils=require(_0x96da('0x17'));var config=require(_0x96da('0x18'));var licenseUtil=require(_0x96da('0x19'));var db=require(_0x96da('0x1a'))['db'];function respondWithStatusCode(_0x59727a,_0x242d6a){_0x242d6a=_0x242d6a||0xcc;return function(_0x1b4e02){if(_0x1b4e02){return _0x59727a['sendStatus'](_0x242d6a);}return _0x59727a[_0x96da('0x1b')](_0x242d6a)['end']();};}function respondWithResult(_0x4a6000,_0x4855fe){_0x4855fe=_0x4855fe||0xc8;return function(_0x227e35){if(_0x227e35){return _0x4a6000['status'](_0x4855fe)['json'](_0x227e35);}};}function respondWithFilteredResult(_0x4ec6e4,_0xedfc7c){return function(_0x2d9a87){if(_0x2d9a87){var _0x1afa6b=typeof _0xedfc7c['offset']===_0x96da('0x1c')&&typeof _0xedfc7c['limit']==='undefined';var _0x13a6c1=_0x2d9a87['count'];var _0x19960e=_0x1afa6b?0x0:_0xedfc7c[_0x96da('0x1d')];var _0x53141d=_0x1afa6b?_0x2d9a87[_0x96da('0x1e')]:_0xedfc7c['offset']+_0xedfc7c['limit'];var _0x480231;if(_0x53141d>=_0x13a6c1){_0x53141d=_0x13a6c1;_0x480231=0xc8;}else{_0x480231=0xce;}_0x4ec6e4['status'](_0x480231);return _0x4ec6e4[_0x96da('0x1f')](_0x96da('0x20'),_0x19960e+'-'+_0x53141d+'/'+_0x13a6c1)[_0x96da('0x21')](_0x2d9a87);}return null;};}function patchUpdates(_0xf887da){return function(_0x17f646){try{jsonpatch[_0x96da('0x22')](_0x17f646,_0xf887da,!![]);}catch(_0xa75e1e){return BPromise[_0x96da('0x23')](_0xa75e1e);}return _0x17f646[_0x96da('0x24')]();};}function saveUpdates(_0x1e8be9,_0x5282b9){return function(_0x5186fe){if(_0x5186fe){return _0x5186fe['update'](_0x1e8be9)[_0x96da('0x25')](function(_0x466278){return _0x466278;});}return null;};}function removeEntity(_0x4b01ad,_0x374908){return function(_0x47764f){if(_0x47764f){return _0x47764f['destroy']()[_0x96da('0x25')](function(){var _0x10ae4c=_0x47764f['get']({'plain':!![]});var _0x461b19=_0x96da('0x26');return db[_0x96da('0x27')][_0x96da('0x28')]({'where':{'type':_0x461b19,'resourceId':_0x10ae4c['id']}})[_0x96da('0x25')](function(){return _0x47764f;});})['then'](function(){_0x4b01ad[_0x96da('0x1b')](0xcc)[_0x96da('0x29')]();});}};}function handleEntityNotFound(_0x34a70b,_0x11a552){return function(_0x36a4c1){if(!_0x36a4c1){_0x34a70b['sendStatus'](0x194);}return _0x36a4c1;};}function handleError(_0x2d5adb,_0x485f3c){_0x485f3c=_0x485f3c||0x1f4;return function(_0xeac755){logger[_0x96da('0x2a')](_0xeac755['stack']);if(_0xeac755['name']){delete _0xeac755['name'];}_0x2d5adb[_0x96da('0x1b')](_0x485f3c)[_0x96da('0x2b')](_0xeac755);};}exports['index']=function(_0x8e4979,_0x437cda){var _0x2a7d35={},_0x58251c={},_0xd57e3={'count':0x0,'rows':[]};var _0x383205=_[_0x96da('0x2c')](db['CannedAnswer'][_0x96da('0x2d')],function(_0x3bd7c6){return{'name':_0x3bd7c6['fieldName'],'type':_0x3bd7c6['type'][_0x96da('0x2e')]};});_0x58251c[_0x96da('0x2f')]=_[_0x96da('0x2c')](_0x383205,'name');_0x58251c[_0x96da('0x30')]=_[_0x96da('0x31')](_0x8e4979[_0x96da('0x30')]);_0x58251c[_0x96da('0x32')]=_[_0x96da('0x33')](_0x58251c[_0x96da('0x2f')],_0x58251c['query']);_0x2a7d35[_0x96da('0x34')]=_[_0x96da('0x33')](_0x58251c[_0x96da('0x2f')],qs[_0x96da('0x35')](_0x8e4979[_0x96da('0x30')][_0x96da('0x35')]));_0x2a7d35[_0x96da('0x34')]=_0x2a7d35['attributes'][_0x96da('0x36')]?_0x2a7d35[_0x96da('0x34')]:_0x58251c[_0x96da('0x2f')];if(!_0x8e4979[_0x96da('0x30')][_0x96da('0x37')](_0x96da('0x38'))){_0x2a7d35[_0x96da('0x39')]=qs[_0x96da('0x39')](_0x8e4979[_0x96da('0x30')][_0x96da('0x39')]);_0x2a7d35[_0x96da('0x1d')]=qs[_0x96da('0x1d')](_0x8e4979[_0x96da('0x30')][_0x96da('0x1d')]);}_0x2a7d35[_0x96da('0x3a')]=qs[_0x96da('0x3b')](_0x8e4979[_0x96da('0x30')]['sort']);_0x2a7d35[_0x96da('0x3c')]=qs[_0x96da('0x32')](_[_0x96da('0x3d')](_0x8e4979[_0x96da('0x30')],_0x58251c['filters']),_0x383205);if(_0x8e4979[_0x96da('0x30')]['filter']){_0x2a7d35[_0x96da('0x3c')]=_['merge'](_0x2a7d35['where'],{'$or':[{'key':{'$like':'%'+_0x8e4979[_0x96da('0x30')]['filter']+'%'}},{'value':{'$like':'%'+_0x8e4979['query']['filter']+'%'}}]});}_0x2a7d35=_['merge']({},_0x2a7d35,_0x8e4979[_0x96da('0x3e')]);var _0x49a978={'where':_0x2a7d35[_0x96da('0x3c')]};return db[_0x96da('0x3f')]['count'](_0x49a978)[_0x96da('0x25')](function(_0x550cff){_0xd57e3[_0x96da('0x1e')]=_0x550cff;if(_0x8e4979[_0x96da('0x30')]['includeAll']){_0x2a7d35[_0x96da('0x40')]=[{'all':!![]}];}return db[_0x96da('0x3f')][_0x96da('0x41')](_0x2a7d35);})['then'](function(_0x4bf247){_0xd57e3[_0x96da('0x42')]=_0x4bf247;return _0xd57e3;})[_0x96da('0x25')](respondWithFilteredResult(_0x437cda,_0x2a7d35))[_0x96da('0x43')](handleError(_0x437cda,null));};exports[_0x96da('0x44')]=function(_0x26e812,_0x4844e9){var _0x4e9dfc={'raw':!![],'where':{'id':_0x26e812[_0x96da('0x45')]['id']}},_0x5168b4={};_0x5168b4[_0x96da('0x2f')]=_['keys'](db['CannedAnswer'][_0x96da('0x2d')]);_0x5168b4[_0x96da('0x30')]=_[_0x96da('0x31')](_0x26e812['query']);_0x5168b4['filters']=_['intersection'](_0x5168b4[_0x96da('0x2f')],_0x5168b4[_0x96da('0x30')]);_0x4e9dfc[_0x96da('0x34')]=_[_0x96da('0x33')](_0x5168b4[_0x96da('0x2f')],qs[_0x96da('0x35')](_0x26e812[_0x96da('0x30')][_0x96da('0x35')]));_0x4e9dfc[_0x96da('0x34')]=_0x4e9dfc[_0x96da('0x34')][_0x96da('0x36')]?_0x4e9dfc['attributes']:_0x5168b4[_0x96da('0x2f')];if(_0x26e812[_0x96da('0x30')][_0x96da('0x46')]){_0x4e9dfc[_0x96da('0x40')]=[{'all':!![]}];}_0x4e9dfc=_[_0x96da('0x47')]({},_0x4e9dfc,_0x26e812[_0x96da('0x3e')]);return db[_0x96da('0x3f')][_0x96da('0x48')](_0x4e9dfc)['then'](handleEntityNotFound(_0x4844e9,null))[_0x96da('0x25')](respondWithResult(_0x4844e9,null))[_0x96da('0x43')](handleError(_0x4844e9,null));};exports[_0x96da('0x49')]=function(_0x14bdb1,_0x3a9f54){if(_0x14bdb1[_0x96da('0x4a')]['id']){delete _0x14bdb1[_0x96da('0x4a')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x14bdb1[_0x96da('0x45')]['id']}})[_0x96da('0x25')](handleEntityNotFound(_0x3a9f54,null))['then'](saveUpdates(_0x14bdb1[_0x96da('0x4a')],null))[_0x96da('0x25')](respondWithResult(_0x3a9f54,null))[_0x96da('0x43')](handleError(_0x3a9f54,null));};exports[_0x96da('0x28')]=function(_0x1de6c2,_0x3fb280){return db['CannedAnswer'][_0x96da('0x48')]({'where':{'id':_0x1de6c2['params']['id']}})[_0x96da('0x25')](handleEntityNotFound(_0x3fb280,null))['then'](removeEntity(_0x3fb280,null))['catch'](handleError(_0x3fb280,null));};exports[_0x96da('0x4b')]=function(_0x4cc7ea,_0xaaa833){var _0x267e70={'key':_0x4cc7ea[_0x96da('0x4a')]['key']};if(_0x4cc7ea['body'][_0x96da('0x4c')]){_0x267e70[_0x96da('0x4c')]=_0x4cc7ea[_0x96da('0x4a')]['MailAccountId'];}else if(_0x4cc7ea[_0x96da('0x4a')]['SmsAccountId']){_0x267e70['SmsAccountId']=_0x4cc7ea[_0x96da('0x4a')][_0x96da('0x4d')];}else if(_0x4cc7ea[_0x96da('0x4a')]['OpenchannelAccountId']){_0x267e70[_0x96da('0x4e')]=_0x4cc7ea[_0x96da('0x4a')]['OpenchannelAccountId'];}else if(_0x4cc7ea[_0x96da('0x4a')][_0x96da('0x4f')]){_0x267e70[_0x96da('0x4f')]=_0x4cc7ea[_0x96da('0x4a')]['ChatWebsiteId'];}return db['CannedAnswer']['find']({'where':_0x267e70})['then'](function(_0x27a7de){if(_0x27a7de){throw new db[(_0x96da('0x50'))][(_0x96da('0x51'))](_0x96da('0x52'));}return db[_0x96da('0x3f')][_0x96da('0x4b')](_0x4cc7ea[_0x96da('0x4a')]);})[_0x96da('0x25')](function(_0x2690dc){var _0x563332=_0x4cc7ea[_0x96da('0x53')][_0x96da('0x54')]({'plain':!![]});if(!_0x563332)throw new Error(_0x96da('0x55'));if(_0x563332[_0x96da('0x56')]===_0x96da('0x53')){var _0x486b50=_0x2690dc['get']({'plain':!![]});return db[_0x96da('0x57')][_0x96da('0x48')]({'where':{'name':_0x96da('0x26'),'userProfileId':_0x563332['userProfileId']},'raw':!![]})['then'](function(_0x1df54f){if(_0x1df54f&&_0x1df54f[_0x96da('0x58')]===0x0){return db[_0x96da('0x27')][_0x96da('0x4b')]({'name':_0x486b50[_0x96da('0x59')],'resourceId':_0x486b50['id'],'type':_0x1df54f[_0x96da('0x59')],'sectionId':_0x1df54f['id']},{})['then'](function(){return _0x2690dc;});}else{return _0x2690dc;}})[_0x96da('0x43')](function(_0xfd9044){logger[_0x96da('0x2a')](_0x96da('0x5a'),_0xfd9044);throw _0xfd9044;});}return _0x2690dc;})[_0x96da('0x25')](respondWithResult(_0xaaa833,0xc9))[_0x96da('0x43')](handleError(_0xaaa833,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 6bc90aa..161f914 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 _0xe511=['rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise'];(function(_0x519876,_0x9d0dbc){var _0x1c1771=function(_0x57dcc0){while(--_0x57dcc0){_0x519876['push'](_0x519876['shift']());}};_0x1c1771(++_0x9d0dbc);}(_0xe511,0x16f));var _0x1e51=function(_0xd75d34,_0x2d31c6){_0xd75d34=_0xd75d34-0x0;var _0x8c5975=_0xe511[_0xd75d34];return _0x8c5975;};'use strict';var _=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var logger=require('../../config/logger')(_0x1e51('0x2'));var moment=require('moment');var BPromise=require(_0x1e51('0x3'));var rp=require(_0x1e51('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e51('0x5'));var config=require(_0x1e51('0x6'));var attributes=require(_0x1e51('0x7'));module[_0x1e51('0x8')]=function(_0x480cca,_0x26b22c){return _0x480cca[_0x1e51('0x9')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1e51('0xa'),'collate':_0x1e51('0xb')});}; \ No newline at end of file +var _0xf4fb=['exports','define','CannedAnswer','utf8mb4','lodash','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xf4fb,0x12d));var _0xbf4f=function(_0x239b90,_0xb0bf10){_0x239b90=_0x239b90-0x0;var _0x57f19b=_0xf4fb[_0x239b90];return _0x57f19b;};'use strict';var _=require(_0xbf4f('0x0'));var util=require('util');var logger=require(_0xbf4f('0x1'))('api');var moment=require('moment');var BPromise=require(_0xbf4f('0x2'));var rp=require(_0xbf4f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf4f('0x4'));var config=require(_0xbf4f('0x5'));var attributes=require(_0xbf4f('0x6'));module[_0xbf4f('0x7')]=function(_0x5ce884,_0x977e51){return _0x5ce884[_0xbf4f('0x8')](_0xbf4f('0x9'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbf4f('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 9e40984..a4f2da0 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(_0x55e934,_0x5c7a2e){var _0x289755=function(_0x17fc22){while(--_0x17fc22){_0x55e934['push'](_0x55e934['shift']());}};_0x289755(++_0x5c7a2e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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(_0x41baa3,_0x557b11){var _0x380294=function(_0x63e9e7){while(--_0x63e9e7){_0x41baa3['push'](_0x41baa3['shift']());}};_0x380294(++_0x557b11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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 e98a6f3..8a0b757 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 _0x023e=['delete','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','update'];(function(_0x54cd0b,_0x182ab9){var _0x2dbfb7=function(_0x41d47e){while(--_0x41d47e){_0x54cd0b['push'](_0x54cd0b['shift']());}};_0x2dbfb7(++_0x182ab9);}(_0x023e,0x1a3));var _0xe023=function(_0x4ddfa5,_0x5c7c33){_0x4ddfa5=_0x4ddfa5-0x0;var _0xb53e0=_0x023e[_0x4ddfa5];return _0xb53e0;};'use strict';var multer=require(_0xe023('0x0'));var util=require(_0xe023('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe023('0x2'));var router=express['Router']();var fs_extra=require(_0xe023('0x3'));var auth=require(_0xe023('0x4'));var interaction=require(_0xe023('0x5'));var config=require(_0xe023('0x6'));var controller=require('./cannedAnswer.controller');router[_0xe023('0x7')]('/',auth[_0xe023('0x8')](),controller[_0xe023('0x9')]);router[_0xe023('0x7')](_0xe023('0xa'),auth[_0xe023('0x8')](),controller[_0xe023('0xb')]);router['post']('/',auth[_0xe023('0x8')](),controller['create']);router['put'](_0xe023('0xa'),auth[_0xe023('0x8')](),controller[_0xe023('0xc')]);router[_0xe023('0xd')](_0xe023('0xa'),auth[_0xe023('0x8')](),controller[_0xe023('0xe')]);module[_0xe023('0xf')]=router; \ No newline at end of file +var _0x4889=['destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x32f9ca,_0x2fa8bc){var _0x52e083=function(_0x4fd86a){while(--_0x4fd86a){_0x32f9ca['push'](_0x32f9ca['shift']());}};_0x52e083(++_0x2fa8bc);}(_0x4889,0x1c3));var _0x9488=function(_0x30730c,_0x5e00f2){_0x30730c=_0x30730c-0x0;var _0x554424=_0x4889[_0x30730c];return _0x554424;};'use strict';var multer=require(_0x9488('0x0'));var util=require(_0x9488('0x1'));var path=require(_0x9488('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9488('0x3')]();var fs_extra=require(_0x9488('0x4'));var auth=require(_0x9488('0x5'));var interaction=require(_0x9488('0x6'));var config=require('../../config/environment');var controller=require(_0x9488('0x7'));router[_0x9488('0x8')]('/',auth[_0x9488('0x9')](),controller[_0x9488('0xa')]);router[_0x9488('0x8')](_0x9488('0xb'),auth[_0x9488('0x9')](),controller[_0x9488('0xc')]);router[_0x9488('0xd')]('/',auth[_0x9488('0x9')](),controller[_0x9488('0xe')]);router[_0x9488('0xf')](_0x9488('0xb'),auth[_0x9488('0x9')](),controller[_0x9488('0x10')]);router['delete']('/:id',auth[_0x9488('0x9')](),controller[_0x9488('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index df8fc6e..ec47348 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 _0xf2c7=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0xf5d71c,_0x2613a6){var _0x5af672=function(_0x191f52){while(--_0x191f52){_0xf5d71c['push'](_0xf5d71c['shift']());}};_0x5af672(++_0x2613a6);}(_0xf2c7,0x1d8));var _0x7f2c=function(_0x39ea42,_0x3c1f50){_0x39ea42=_0x39ea42-0x0;var _0x33f5b7=_0xf2c7[_0x39ea42];return _0x33f5b7;};'use strict';var Sequelize=require(_0x7f2c('0x0'));module[_0x7f2c('0x1')]={'calldate':{'type':Sequelize[_0x7f2c('0x2')],'allowNull':![],'defaultValue':_0x7f2c('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x7f2c('0x4')]},'dst':{'type':Sequelize[_0x7f2c('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x7f2c('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x7f2c('0x4')]},'duration':{'type':Sequelize[_0x7f2c('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7f2c('0x4')]},'amaflags':{'type':Sequelize[_0x7f2c('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x7f2c('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x7f2c('0x4')]},'linkedid':{'type':Sequelize[_0x7f2c('0x4')]},'sequence':{'type':Sequelize[_0x7f2c('0x4')]},'peeraccount':{'type':Sequelize[_0x7f2c('0x4')]},'type':{'type':Sequelize[_0x7f2c('0x4')]},'tag':{'type':Sequelize[_0x7f2c('0x4')]}}; \ No newline at end of file +var _0xbf3f=['INTEGER','sequelize','STRING'];(function(_0x1de329,_0x36924c){var _0xc91708=function(_0x4a12f0){while(--_0x4a12f0){_0x1de329['push'](_0x1de329['shift']());}};_0xc91708(++_0x36924c);}(_0xbf3f,0x10f));var _0xfbf3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf3f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xfbf3('0x0'));module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xfbf3('0x1')]},'dcontext':{'type':Sequelize[_0xfbf3('0x1')]},'channel':{'type':Sequelize[_0xfbf3('0x1')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xfbf3('0x1')]},'lastdata':{'type':Sequelize[_0xfbf3('0x1')]},'duration':{'type':Sequelize[_0xfbf3('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xfbf3('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xfbf3('0x1')]},'amaflags':{'type':Sequelize[_0xfbf3('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xfbf3('0x1')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xfbf3('0x1')]},'linkedid':{'type':Sequelize[_0xfbf3('0x1')]},'sequence':{'type':Sequelize[_0xfbf3('0x1')]},'peeraccount':{'type':Sequelize[_0xfbf3('0x1')]},'type':{'type':Sequelize[_0xfbf3('0x1')]},'tag':{'type':Sequelize[_0xfbf3('0x1')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 0411e41..64db42a 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 _0x7217=['query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','Cdr','fieldName','type','model','name','keys'];(function(_0x3e5bd9,_0x17e1c1){var _0x545659=function(_0x4ddd25){while(--_0x4ddd25){_0x3e5bd9['push'](_0x3e5bd9['shift']());}};_0x545659(++_0x17e1c1);}(_0x7217,0x19e));var _0x7721=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x7217[_0x34bf97];return _0x292719;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){_0x1caad8[_0x7721('0x1c')](0xcc)[_0x7721('0x1d')]();});}};}function handleEntityNotFound(_0x125564,_0x1f67c7){return function(_0x40d550){if(!_0x40d550){_0x125564[_0x7721('0x2b')](0x194);}return _0x40d550;};}function handleError(_0x424e05,_0xf753f1){_0xf753f1=_0xf753f1||0x1f4;return function(_0x40f367){logger['error'](_0x40f367[_0x7721('0x2c')]);if(_0x40f367['name']){delete _0x40f367['name'];}_0x424e05[_0x7721('0x1c')](_0xf753f1)[_0x7721('0x2d')](_0x40f367);};}exports[_0x7721('0x2e')]=function(_0x158d98,_0x1ea4d){var _0x37b9f0={},_0xd7d703={},_0x1da2d8={'count':0x0,'rows':[]};var _0x5c54f0=_[_0x7721('0x2f')](db[_0x7721('0x30')]['rawAttributes'],function(_0x4a25c9){return{'name':_0x4a25c9[_0x7721('0x31')],'type':_0x4a25c9[_0x7721('0x32')]['key']};});_0xd7d703[_0x7721('0x33')]=_[_0x7721('0x2f')](_0x5c54f0,_0x7721('0x34'));_0xd7d703['query']=_[_0x7721('0x35')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x37')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],_0xd7d703['query']);_0x37b9f0[_0x7721('0x39')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],qs['fields'](_0x158d98[_0x7721('0x36')][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')]['length']?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3b')](_0x7721('0x3c'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0['order']=qs[_0x7721('0x3d')](_0x158d98[_0x7721('0x36')][_0x7721('0x3d')]);_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x37')](_[_0x7721('0x3f')](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98['query']['filter']){_0x37b9f0[_0x7721('0x3e')]=_[_0x7721('0x40')](_0x37b9f0[_0x7721('0x3e')],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4a90ce){if(_0x4a90ce[_0x7721('0x32')]!=='VIRTUAL'){var _0xfab37b={};_0xfab37b[_0x4a90ce[_0x7721('0x34')]]={'$like':'%'+_0x158d98['query'][_0x7721('0x41')]+'%'};return _0xfab37b;}})});}_0x37b9f0=_[_0x7721('0x40')]({},_0x37b9f0,_0x158d98['options']);var _0x4d0111={'where':_0x37b9f0[_0x7721('0x3e')]};return db[_0x7721('0x30')][_0x7721('0x22')](_0x4d0111)[_0x7721('0x29')](function(_0x577af9){_0x1da2d8[_0x7721('0x22')]=_0x577af9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x42')]){_0x37b9f0[_0x7721('0x43')]=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a2c28){_0x1da2d8[_0x7721('0x44')]=_0x4a2c28;return _0x1da2d8;})['then'](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x45')](handleError(_0x1ea4d,null));};exports[_0x7721('0x46')]=function(_0x231dad,_0x49e0c5){var _0x1453d4={'raw':!![],'where':{'id':_0x231dad[_0x7721('0x47')]['id']}},_0x11d853={};_0x11d853['model']=_[_0x7721('0x35')](db[_0x7721('0x30')][_0x7721('0x48')]);_0x11d853[_0x7721('0x36')]=_[_0x7721('0x35')](_0x231dad[_0x7721('0x36')]);_0x11d853[_0x7721('0x37')]=_['intersection'](_0x11d853['model'],_0x11d853[_0x7721('0x36')]);_0x1453d4[_0x7721('0x39')]=_[_0x7721('0x38')](_0x11d853[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x231dad[_0x7721('0x36')][_0x7721('0x3a')]));_0x1453d4[_0x7721('0x39')]=_0x1453d4[_0x7721('0x39')][_0x7721('0x49')]?_0x1453d4['attributes']:_0x11d853['model'];if(_0x231dad[_0x7721('0x36')][_0x7721('0x42')]){_0x1453d4[_0x7721('0x43')]=[{'all':!![]}];}_0x1453d4=_[_0x7721('0x40')]({},_0x1453d4,_0x231dad['options']);return db[_0x7721('0x30')][_0x7721('0x4a')](_0x1453d4)['then'](handleEntityNotFound(_0x49e0c5,null))[_0x7721('0x29')](respondWithResult(_0x49e0c5,null))['catch'](handleError(_0x49e0c5,null));};exports[_0x7721('0x4b')]=function(_0x5c6922,_0x334f23){return db[_0x7721('0x30')][_0x7721('0x4b')](_0x5c6922['body'],{})[_0x7721('0x29')](respondWithResult(_0x334f23,0xc9))[_0x7721('0x45')](handleError(_0x334f23,null));};exports['update']=function(_0x223d93,_0x1196c2){if(_0x223d93[_0x7721('0x4c')]['id']){delete _0x223d93['body']['id'];}return db[_0x7721('0x30')]['find']({'where':{'id':_0x223d93[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x1196c2,null))[_0x7721('0x29')](saveUpdates(_0x223d93[_0x7721('0x4c')],null))[_0x7721('0x29')](respondWithResult(_0x1196c2,null))[_0x7721('0x45')](handleError(_0x1196c2,null));};exports[_0x7721('0x2a')]=function(_0x7fbb73,_0x694d2f){return db[_0x7721('0x30')][_0x7721('0x4a')]({'where':{'id':_0x7fbb73[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x694d2f,null))[_0x7721('0x29')](removeEntity(_0x694d2f,null))[_0x7721('0x45')](handleError(_0x694d2f,null));};exports['describe']=function(_0x474f32,_0x2f6f30){return db[_0x7721('0x30')][_0x7721('0x4d')]()[_0x7721('0x29')](respondWithResult(_0x2f6f30,null))[_0x7721('0x45')](handleError(_0x2f6f30,null));}; \ No newline at end of file +var _0xafdd=['pick','filter','merge','type','VIRTUAL','options','Cdr','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','fieldName','model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','where'];(function(_0x564d53,_0x31ac8a){var _0x1ba891=function(_0x51cad3){while(--_0x51cad3){_0x564d53['push'](_0x564d53['shift']());}};_0x1ba891(++_0x31ac8a);}(_0xafdd,0x19a));var _0xdafd=function(_0x59aa87,_0x4b0699){_0x59aa87=_0x59aa87-0x0;var _0x3e96bb=_0xafdd[_0x59aa87];return _0x3e96bb;};'use strict';var emlformat=require(_0xdafd('0x0'));var rimraf=require(_0xdafd('0x1'));var zipdir=require(_0xdafd('0x2'));var jsonpatch=require(_0xdafd('0x3'));var rp=require(_0xdafd('0x4'));var moment=require(_0xdafd('0x5'));var BPromise=require(_0xdafd('0x6'));var Mustache=require(_0xdafd('0x7'));var util=require('util');var path=require(_0xdafd('0x8'));var sox=require(_0xdafd('0x9'));var csv=require(_0xdafd('0xa'));var ejs=require(_0xdafd('0xb'));var fs=require('fs');var fs_extra=require(_0xdafd('0xc'));var _=require(_0xdafd('0xd'));var squel=require(_0xdafd('0xe'));var crypto=require('crypto');var jsforce=require(_0xdafd('0xf'));var deskjs=require(_0xdafd('0x10'));var toCsv=require(_0xdafd('0xa'));var querystring=require('querystring');var Papa=require(_0xdafd('0x11'));var Redis=require(_0xdafd('0x12'));var authService=require(_0xdafd('0x13'));var qs=require(_0xdafd('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdafd('0x15'));var logger=require(_0xdafd('0x16'))(_0xdafd('0x17'));var utils=require(_0xdafd('0x18'));var config=require(_0xdafd('0x19'));var licenseUtil=require(_0xdafd('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x166176,_0x594f47){_0x594f47=_0x594f47||0xcc;return function(_0x553508){if(_0x553508){return _0x166176[_0xdafd('0x1b')](_0x594f47);}return _0x166176[_0xdafd('0x1c')](_0x594f47)['end']();};}function respondWithResult(_0x43a716,_0x490382){_0x490382=_0x490382||0xc8;return function(_0x4b09da){if(_0x4b09da){return _0x43a716[_0xdafd('0x1c')](_0x490382)[_0xdafd('0x1d')](_0x4b09da);}};}function respondWithFilteredResult(_0x583b1d,_0x267bfc){return function(_0x186379){if(_0x186379){var _0x496515=typeof _0x267bfc[_0xdafd('0x1e')]===_0xdafd('0x1f')&&typeof _0x267bfc[_0xdafd('0x20')]==='undefined';var _0xb382ca=_0x186379[_0xdafd('0x21')];var _0x4fc3a4=_0x496515?0x0:_0x267bfc['offset'];var _0x2569b2=_0x496515?_0x186379['count']:_0x267bfc[_0xdafd('0x1e')]+_0x267bfc[_0xdafd('0x20')];var _0x1e64d3;if(_0x2569b2>=_0xb382ca){_0x2569b2=_0xb382ca;_0x1e64d3=0xc8;}else{_0x1e64d3=0xce;}_0x583b1d[_0xdafd('0x1c')](_0x1e64d3);return _0x583b1d[_0xdafd('0x22')](_0xdafd('0x23'),_0x4fc3a4+'-'+_0x2569b2+'/'+_0xb382ca)[_0xdafd('0x1d')](_0x186379);}return null;};}function patchUpdates(_0x42e0f9){return function(_0x8480a8){try{jsonpatch[_0xdafd('0x24')](_0x8480a8,_0x42e0f9,!![]);}catch(_0xee767e){return BPromise[_0xdafd('0x25')](_0xee767e);}return _0x8480a8[_0xdafd('0x26')]();};}function saveUpdates(_0xf4a521,_0x491d96){return function(_0x230495){if(_0x230495){return _0x230495['update'](_0xf4a521)[_0xdafd('0x27')](function(_0x5e96cc){return _0x5e96cc;});}return null;};}function removeEntity(_0x439bbf,_0x35ef78){return function(_0x7f10f6){if(_0x7f10f6){return _0x7f10f6[_0xdafd('0x28')]()[_0xdafd('0x27')](function(){_0x439bbf[_0xdafd('0x1c')](0xcc)[_0xdafd('0x29')]();});}};}function handleEntityNotFound(_0x30cba9,_0x3846dd){return function(_0x5cd11d){if(!_0x5cd11d){_0x30cba9[_0xdafd('0x1b')](0x194);}return _0x5cd11d;};}function handleError(_0x2ab575,_0x18554c){_0x18554c=_0x18554c||0x1f4;return function(_0x1feb5b){logger[_0xdafd('0x2a')](_0x1feb5b[_0xdafd('0x2b')]);if(_0x1feb5b[_0xdafd('0x2c')]){delete _0x1feb5b[_0xdafd('0x2c')];}_0x2ab575[_0xdafd('0x1c')](_0x18554c)[_0xdafd('0x2d')](_0x1feb5b);};}exports['index']=function(_0x243182,_0x14626b){var _0x13ab81={},_0x249743={},_0x21edb6={'count':0x0,'rows':[]};var _0x324f0f=_['map'](db['Cdr']['rawAttributes'],function(_0xcca4f){return{'name':_0xcca4f[_0xdafd('0x2e')],'type':_0xcca4f['type']['key']};});_0x249743[_0xdafd('0x2f')]=_[_0xdafd('0x30')](_0x324f0f,_0xdafd('0x2c'));_0x249743[_0xdafd('0x31')]=_[_0xdafd('0x32')](_0x243182[_0xdafd('0x31')]);_0x249743[_0xdafd('0x33')]=_['intersection'](_0x249743[_0xdafd('0x2f')],_0x249743[_0xdafd('0x31')]);_0x13ab81[_0xdafd('0x34')]=_['intersection'](_0x249743[_0xdafd('0x2f')],qs[_0xdafd('0x35')](_0x243182['query'][_0xdafd('0x35')]));_0x13ab81[_0xdafd('0x34')]=_0x13ab81[_0xdafd('0x34')]['length']?_0x13ab81[_0xdafd('0x34')]:_0x249743[_0xdafd('0x2f')];if(!_0x243182[_0xdafd('0x31')][_0xdafd('0x36')](_0xdafd('0x37'))){_0x13ab81[_0xdafd('0x20')]=qs[_0xdafd('0x20')](_0x243182['query'][_0xdafd('0x20')]);_0x13ab81[_0xdafd('0x1e')]=qs[_0xdafd('0x1e')](_0x243182[_0xdafd('0x31')][_0xdafd('0x1e')]);}_0x13ab81['order']=qs[_0xdafd('0x38')](_0x243182[_0xdafd('0x31')]['sort']);_0x13ab81[_0xdafd('0x39')]=qs[_0xdafd('0x33')](_[_0xdafd('0x3a')](_0x243182[_0xdafd('0x31')],_0x249743[_0xdafd('0x33')]),_0x324f0f);if(_0x243182[_0xdafd('0x31')][_0xdafd('0x3b')]){_0x13ab81[_0xdafd('0x39')]=_[_0xdafd('0x3c')](_0x13ab81[_0xdafd('0x39')],{'$or':_[_0xdafd('0x30')](_0x324f0f,function(_0x245163){if(_0x245163[_0xdafd('0x3d')]!==_0xdafd('0x3e')){var _0xb1e264={};_0xb1e264[_0x245163[_0xdafd('0x2c')]]={'$like':'%'+_0x243182[_0xdafd('0x31')][_0xdafd('0x3b')]+'%'};return _0xb1e264;}})});}_0x13ab81=_[_0xdafd('0x3c')]({},_0x13ab81,_0x243182[_0xdafd('0x3f')]);var _0x3f25c2={'where':_0x13ab81[_0xdafd('0x39')]};return db[_0xdafd('0x40')][_0xdafd('0x21')](_0x3f25c2)[_0xdafd('0x27')](function(_0x21d43d){_0x21edb6['count']=_0x21d43d;if(_0x243182['query'][_0xdafd('0x41')]){_0x13ab81['include']=[{'all':!![]}];}return db[_0xdafd('0x40')][_0xdafd('0x42')](_0x13ab81);})['then'](function(_0x4b463c){_0x21edb6[_0xdafd('0x43')]=_0x4b463c;return _0x21edb6;})[_0xdafd('0x27')](respondWithFilteredResult(_0x14626b,_0x13ab81))[_0xdafd('0x44')](handleError(_0x14626b,null));};exports[_0xdafd('0x45')]=function(_0xbc5159,_0x184a59){var _0x3a3a14={'raw':!![],'where':{'id':_0xbc5159[_0xdafd('0x46')]['id']}},_0x2417f8={};_0x2417f8['model']=_['keys'](db[_0xdafd('0x40')][_0xdafd('0x47')]);_0x2417f8[_0xdafd('0x31')]=_[_0xdafd('0x32')](_0xbc5159[_0xdafd('0x31')]);_0x2417f8[_0xdafd('0x33')]=_[_0xdafd('0x48')](_0x2417f8[_0xdafd('0x2f')],_0x2417f8[_0xdafd('0x31')]);_0x3a3a14[_0xdafd('0x34')]=_[_0xdafd('0x48')](_0x2417f8[_0xdafd('0x2f')],qs[_0xdafd('0x35')](_0xbc5159['query'][_0xdafd('0x35')]));_0x3a3a14['attributes']=_0x3a3a14[_0xdafd('0x34')]['length']?_0x3a3a14[_0xdafd('0x34')]:_0x2417f8[_0xdafd('0x2f')];if(_0xbc5159[_0xdafd('0x31')][_0xdafd('0x41')]){_0x3a3a14[_0xdafd('0x49')]=[{'all':!![]}];}_0x3a3a14=_[_0xdafd('0x3c')]({},_0x3a3a14,_0xbc5159['options']);return db[_0xdafd('0x40')][_0xdafd('0x4a')](_0x3a3a14)[_0xdafd('0x27')](handleEntityNotFound(_0x184a59,null))[_0xdafd('0x27')](respondWithResult(_0x184a59,null))[_0xdafd('0x44')](handleError(_0x184a59,null));};exports['create']=function(_0x48cc85,_0x189d61){return db[_0xdafd('0x40')][_0xdafd('0x4b')](_0x48cc85[_0xdafd('0x4c')],{})[_0xdafd('0x27')](respondWithResult(_0x189d61,0xc9))[_0xdafd('0x44')](handleError(_0x189d61,null));};exports[_0xdafd('0x4d')]=function(_0x2f5e4c,_0x2ae4cd){if(_0x2f5e4c['body']['id']){delete _0x2f5e4c[_0xdafd('0x4c')]['id'];}return db[_0xdafd('0x40')][_0xdafd('0x4a')]({'where':{'id':_0x2f5e4c[_0xdafd('0x46')]['id']}})['then'](handleEntityNotFound(_0x2ae4cd,null))[_0xdafd('0x27')](saveUpdates(_0x2f5e4c[_0xdafd('0x4c')],null))[_0xdafd('0x27')](respondWithResult(_0x2ae4cd,null))[_0xdafd('0x44')](handleError(_0x2ae4cd,null));};exports[_0xdafd('0x28')]=function(_0x4b6fbb,_0x5af1a8){return db[_0xdafd('0x40')][_0xdafd('0x4a')]({'where':{'id':_0x4b6fbb['params']['id']}})['then'](handleEntityNotFound(_0x5af1a8,null))[_0xdafd('0x27')](removeEntity(_0x5af1a8,null))[_0xdafd('0x44')](handleError(_0x5af1a8,null));};exports['describe']=function(_0x2dde06,_0x5dc9a0){return db[_0xdafd('0x40')]['describe']()['then'](respondWithResult(_0x5dc9a0,null))[_0xdafd('0x44')](handleError(_0x5dc9a0,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 3c61736..65e3a61 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x351b03,_0x1bae0f){var _0x5bce92=function(_0x1df940){while(--_0x1df940){_0x351b03['push'](_0x351b03['shift']());}};_0x5bce92(++_0x1bae0f);}(_0x7a54,0x106));var _0x47a5=function(_0x56cc59,_0x28d603){_0x56cc59=_0x56cc59-0x0;var _0x4dc1aa=_0x7a54[_0x56cc59];return _0x4dc1aa;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x4f16bd,_0x2f9263){var _0x2dd933=function(_0x3acb70){while(--_0x3acb70){_0x4f16bd['push'](_0x4f16bd['shift']());}};_0x2dd933(++_0x2f9263);}(_0x7a54,0x106));var _0x47a5=function(_0x33720c,_0x5d7320){_0x33720c=_0x33720c-0x0;var _0x5939ff=_0x7a54[_0x33720c];return _0x5939ff;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 04c77f1..3e85dc8 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 _0xba93=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x5e139c,_0x3c357b){var _0x1fc429=function(_0x420f69){while(--_0x420f69){_0x5e139c['push'](_0x5e139c['shift']());}};_0x1fc429(++_0x3c357b);}(_0xba93,0x74));var _0x3ba9=function(_0x5e8b8c,_0xf51661){_0x5e8b8c=_0x5e8b8c-0x0;var _0x3902dc=_0xba93[_0x5e8b8c];return _0x3902dc;};'use strict';var _=require(_0x3ba9('0x0'));var util=require(_0x3ba9('0x1'));var moment=require(_0x3ba9('0x2'));var BPromise=require(_0x3ba9('0x3'));var rs=require(_0x3ba9('0x4'));var fs=require('fs');var Redis=require(_0x3ba9('0x5'));var db=require(_0x3ba9('0x6'))['db'];var utils=require(_0x3ba9('0x7'));var logger=require(_0x3ba9('0x8'))(_0x3ba9('0x9'));var config=require(_0x3ba9('0xa'));var jayson=require(_0x3ba9('0xb'));var client=jayson[_0x3ba9('0xc')][_0x3ba9('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xda2d73,_0x1dc9a2,_0x416f57){return new BPromise(function(_0x1934e7,_0x7d64e9){return client[_0x3ba9('0xe')](_0xda2d73,_0x416f57)['then'](function(_0x1e5d50){logger[_0x3ba9('0xf')](_0x3ba9('0x10'),_0x1dc9a2,_0x3ba9('0x11'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x1dc9a2,_0x3ba9('0x11'),JSON[_0x3ba9('0x12')](_0x1e5d50));if(_0x1e5d50['error']){if(_0x1e5d50[_0x3ba9('0x13')][_0x3ba9('0x14')]===0x1f4){logger[_0x3ba9('0x13')](_0x3ba9('0x10'),_0x1dc9a2,_0x1e5d50[_0x3ba9('0x13')][_0x3ba9('0x15')]);return _0x7d64e9(_0x1e5d50[_0x3ba9('0x13')][_0x3ba9('0x15')]);}logger[_0x3ba9('0x13')]('Cdr,\x20%s,\x20%s',_0x1dc9a2,_0x1e5d50[_0x3ba9('0x13')]['message']);return _0x1934e7(_0x1e5d50[_0x3ba9('0x13')][_0x3ba9('0x15')]);}else{logger['info'](_0x3ba9('0x10'),_0x1dc9a2,'request\x20sent');_0x1934e7(_0x1e5d50[_0x3ba9('0x16')][_0x3ba9('0x15')]);}})['catch'](function(_0x24b7c2){logger[_0x3ba9('0x13')]('Cdr,\x20%s,\x20%s',_0x1dc9a2,_0x24b7c2);_0x7d64e9(_0x24b7c2);});});} \ No newline at end of file +var _0x34c3=['debug','code','error','message','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x34c3,0xe1));var _0x334c=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x34c3[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0x334c('0x0'));var util=require(_0x334c('0x1'));var moment=require(_0x334c('0x2'));var BPromise=require(_0x334c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x334c('0x4'));var logger=require(_0x334c('0x5'))(_0x334c('0x6'));var config=require('../../config/environment');var jayson=require(_0x334c('0x7'));var client=jayson[_0x334c('0x8')][_0x334c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x486dfe,_0x47e52e,_0x1e9a43){return new BPromise(function(_0x43f5c2,_0xe6b6a9){return client[_0x334c('0xa')](_0x486dfe,_0x1e9a43)[_0x334c('0xb')](function(_0x2c39af){logger[_0x334c('0xc')](_0x334c('0xd'),_0x47e52e,_0x334c('0xe'));logger[_0x334c('0xf')]('Cdr,\x20%s,\x20%s,\x20%s',_0x47e52e,_0x334c('0xe'),JSON['stringify'](_0x2c39af));if(_0x2c39af['error']){if(_0x2c39af['error'][_0x334c('0x10')]===0x1f4){logger[_0x334c('0x11')](_0x334c('0xd'),_0x47e52e,_0x2c39af[_0x334c('0x11')]['message']);return _0xe6b6a9(_0x2c39af[_0x334c('0x11')][_0x334c('0x12')]);}logger[_0x334c('0x11')](_0x334c('0xd'),_0x47e52e,_0x2c39af[_0x334c('0x11')][_0x334c('0x12')]);return _0x43f5c2(_0x2c39af[_0x334c('0x11')][_0x334c('0x12')]);}else{logger[_0x334c('0xc')](_0x334c('0xd'),_0x47e52e,_0x334c('0xe'));_0x43f5c2(_0x2c39af['result'][_0x334c('0x12')]);}})[_0x334c('0x13')](function(_0x3ac76e){logger[_0x334c('0x11')](_0x334c('0xd'),_0x47e52e,_0x3ac76e);_0xe6b6a9(_0x3ac76e);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index d852076..4719d10 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x18f64a,_0x1c8248){var _0x44687f=function(_0x1234ad){while(--_0x1234ad){_0x18f64a['push'](_0x18f64a['shift']());}};_0x44687f(++_0x1c8248);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +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(_0x2c4e1b,_0x48a2dc){var _0x335117=function(_0x3cac61){while(--_0x3cac61){_0x2c4e1b['push'](_0x2c4e1b['shift']());}};_0x335117(++_0x48a2dc);}(_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 5dcd7d6..941ffa3 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 _0xae4c=['*,*,*,*','sequelize','exports','INTEGER','noop','TEXT','STRING'];(function(_0x590195,_0x559e2a){var _0x4251a3=function(_0x2dd2ab){while(--_0x2dd2ab){_0x590195['push'](_0x590195['shift']());}};_0x4251a3(++_0x559e2a);}(_0xae4c,0xa2));var _0xcae4=function(_0x16de43,_0x2bb75f){_0x16de43=_0x16de43-0x0;var _0x2aaa5d=_0xae4c[_0x16de43];return _0x2aaa5d;};'use strict';var Sequelize=require(_0xcae4('0x0'));module[_0xcae4('0x1')]={'priority':{'type':Sequelize[_0xcae4('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcae4('0x3')},'appdata':{'type':Sequelize[_0xcae4('0x4')]()},'description':{'type':Sequelize[_0xcae4('0x5')]},'interval':{'type':Sequelize[_0xcae4('0x5')],'defaultValue':_0xcae4('0x6')}}; \ No newline at end of file +var _0x4942=['noop','TEXT','STRING','exports','INTEGER'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4942,0x12a));var _0x2494=function(_0x18656b,_0x427122){_0x18656b=_0x18656b-0x0;var _0x2612ec=_0x4942[_0x18656b];return _0x2612ec;};'use strict';var Sequelize=require('sequelize');module[_0x2494('0x0')]={'priority':{'type':Sequelize[_0x2494('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2494('0x2')},'appdata':{'type':Sequelize[_0x2494('0x3')]()},'description':{'type':Sequelize[_0x2494('0x4')]},'interval':{'type':Sequelize[_0x2494('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 64abd4b..3ede5f1 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 _0x1c8a=['fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','model','keys','rawAttributes','query','attributes','intersection','fields','length','include','options','ChatApplication','find','catch','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs'];(function(_0x4996d5,_0x123daf){var _0x4793f9=function(_0x30c7ec){while(--_0x30c7ec){_0x4996d5['push'](_0x4996d5['shift']());}};_0x4793f9(++_0x123daf);}(_0x1c8a,0x140));var _0xa1c8=function(_0x5933e0,_0x5b4d80){_0x5933e0=_0x5933e0-0x0;var _0x91492d=_0x1c8a[_0x5933e0];return _0x91492d;};'use strict';var emlformat=require(_0xa1c8('0x0'));var rimraf=require(_0xa1c8('0x1'));var zipdir=require(_0xa1c8('0x2'));var jsonpatch=require(_0xa1c8('0x3'));var rp=require(_0xa1c8('0x4'));var moment=require('moment');var BPromise=require(_0xa1c8('0x5'));var Mustache=require('mustache');var util=require(_0xa1c8('0x6'));var path=require(_0xa1c8('0x7'));var sox=require(_0xa1c8('0x8'));var csv=require('to-csv');var ejs=require(_0xa1c8('0x9'));var fs=require('fs');var fs_extra=require(_0xa1c8('0xa'));var _=require(_0xa1c8('0xb'));var squel=require('squel');var crypto=require(_0xa1c8('0xc'));var jsforce=require(_0xa1c8('0xd'));var deskjs=require(_0xa1c8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa1c8('0xf'));var Papa=require(_0xa1c8('0x10'));var Redis=require(_0xa1c8('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa1c8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa1c8('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa1c8('0x14'));var db=require(_0xa1c8('0x15'))['db'];function respondWithStatusCode(_0x2647fa,_0x707249){_0x707249=_0x707249||0xcc;return function(_0x644e9c){if(_0x644e9c){return _0x2647fa[_0xa1c8('0x16')](_0x707249);}return _0x2647fa['status'](_0x707249)[_0xa1c8('0x17')]();};}function respondWithResult(_0x282525,_0xcccc7b){_0xcccc7b=_0xcccc7b||0xc8;return function(_0x3797fe){if(_0x3797fe){return _0x282525[_0xa1c8('0x18')](_0xcccc7b)[_0xa1c8('0x19')](_0x3797fe);}};}function respondWithFilteredResult(_0x517130,_0x7f1128){return function(_0x51b1c3){if(_0x51b1c3){var _0x17d4d2=typeof _0x7f1128[_0xa1c8('0x1a')]===_0xa1c8('0x1b')&&typeof _0x7f1128['limit']===_0xa1c8('0x1b');var _0x59284a=_0x51b1c3['count'];var _0x1fe87f=_0x17d4d2?0x0:_0x7f1128[_0xa1c8('0x1a')];var _0x57fe23=_0x17d4d2?_0x51b1c3[_0xa1c8('0x1c')]:_0x7f1128[_0xa1c8('0x1a')]+_0x7f1128[_0xa1c8('0x1d')];var _0x4e967e;if(_0x57fe23>=_0x59284a){_0x57fe23=_0x59284a;_0x4e967e=0xc8;}else{_0x4e967e=0xce;}_0x517130[_0xa1c8('0x18')](_0x4e967e);return _0x517130[_0xa1c8('0x1e')](_0xa1c8('0x1f'),_0x1fe87f+'-'+_0x57fe23+'/'+_0x59284a)['json'](_0x51b1c3);}return null;};}function patchUpdates(_0x2eabb2){return function(_0x874b1f){try{jsonpatch['apply'](_0x874b1f,_0x2eabb2,!![]);}catch(_0x38008a){return BPromise[_0xa1c8('0x20')](_0x38008a);}return _0x874b1f[_0xa1c8('0x21')]();};}function saveUpdates(_0x2a7fa5,_0x19fe5a){return function(_0x23ff11){if(_0x23ff11){return _0x23ff11[_0xa1c8('0x22')](_0x2a7fa5)[_0xa1c8('0x23')](function(_0x40bb1d){return _0x40bb1d;});}return null;};}function removeEntity(_0x193077,_0x28473c){return function(_0x125047){if(_0x125047){return _0x125047[_0xa1c8('0x24')]()[_0xa1c8('0x23')](function(){_0x193077[_0xa1c8('0x18')](0xcc)[_0xa1c8('0x17')]();});}};}function handleEntityNotFound(_0x572362,_0x1e9a50){return function(_0x550b68){if(!_0x550b68){_0x572362[_0xa1c8('0x16')](0x194);}return _0x550b68;};}function handleError(_0x4efb73,_0x404cb8){_0x404cb8=_0x404cb8||0x1f4;return function(_0x508742){logger[_0xa1c8('0x25')](_0x508742['stack']);if(_0x508742[_0xa1c8('0x26')]){delete _0x508742[_0xa1c8('0x26')];}_0x4efb73[_0xa1c8('0x18')](_0x404cb8)[_0xa1c8('0x27')](_0x508742);};}exports['show']=function(_0x23131b,_0x404fa1){var _0x28b9e5={'raw':!![],'where':{'id':_0x23131b['params']['id']}},_0x4d0a4f={};_0x4d0a4f[_0xa1c8('0x28')]=_[_0xa1c8('0x29')](db['ChatApplication'][_0xa1c8('0x2a')]);_0x4d0a4f[_0xa1c8('0x2b')]=_[_0xa1c8('0x29')](_0x23131b['query']);_0x4d0a4f['filters']=_['intersection'](_0x4d0a4f[_0xa1c8('0x28')],_0x4d0a4f['query']);_0x28b9e5[_0xa1c8('0x2c')]=_[_0xa1c8('0x2d')](_0x4d0a4f[_0xa1c8('0x28')],qs[_0xa1c8('0x2e')](_0x23131b[_0xa1c8('0x2b')][_0xa1c8('0x2e')]));_0x28b9e5['attributes']=_0x28b9e5[_0xa1c8('0x2c')][_0xa1c8('0x2f')]?_0x28b9e5[_0xa1c8('0x2c')]:_0x4d0a4f[_0xa1c8('0x28')];if(_0x23131b['query']['includeAll']){_0x28b9e5[_0xa1c8('0x30')]=[{'all':!![]}];}_0x28b9e5=_['merge']({},_0x28b9e5,_0x23131b[_0xa1c8('0x31')]);return db[_0xa1c8('0x32')][_0xa1c8('0x33')](_0x28b9e5)[_0xa1c8('0x23')](handleEntityNotFound(_0x404fa1,null))[_0xa1c8('0x23')](respondWithResult(_0x404fa1,null))[_0xa1c8('0x34')](handleError(_0x404fa1,null));};exports[_0xa1c8('0x22')]=function(_0xb4441e,_0x55c485){if(_0xb4441e[_0xa1c8('0x35')]['id']){delete _0xb4441e[_0xa1c8('0x35')]['id'];}return db[_0xa1c8('0x32')][_0xa1c8('0x33')]({'where':{'id':_0xb4441e[_0xa1c8('0x36')]['id']}})[_0xa1c8('0x23')](handleEntityNotFound(_0x55c485,null))[_0xa1c8('0x23')](saveUpdates(_0xb4441e[_0xa1c8('0x35')],null))[_0xa1c8('0x23')](respondWithResult(_0x55c485,null))[_0xa1c8('0x34')](handleError(_0x55c485,null));};exports[_0xa1c8('0x24')]=function(_0x4205f0,_0x3d6b35){return db[_0xa1c8('0x32')]['find']({'where':{'id':_0x4205f0['params']['id']}})[_0xa1c8('0x23')](handleEntityNotFound(_0x3d6b35,null))[_0xa1c8('0x23')](removeEntity(_0x3d6b35,null))[_0xa1c8('0x34')](handleError(_0x3d6b35,null));}; \ No newline at end of file +var _0xbfcc=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','undefined','offset','count','set','Content-Range','json','reject','then','destroy','error','stack','name','send','show','params','model','keys','ChatApplication','query','filters','attributes','intersection','fields','options','find','catch','update','body','eml-format','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','lodash','crypto'];(function(_0xc39233,_0x1765bc){var _0xc8acb2=function(_0x2d67a4){while(--_0x2d67a4){_0xc39233['push'](_0xc39233['shift']());}};_0xc8acb2(++_0x1765bc);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xbfcc[_0x1d1779];return _0x2377e9;};'use strict';var emlformat=require(_0xcbfc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcbfc('0x1'));var rp=require(_0xcbfc('0x2'));var moment=require(_0xcbfc('0x3'));var BPromise=require(_0xcbfc('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xcbfc('0x5'));var ejs=require(_0xcbfc('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbfc('0x7'));var squel=require('squel');var crypto=require(_0xcbfc('0x8'));var jsforce=require(_0xcbfc('0x9'));var deskjs=require(_0xcbfc('0xa'));var toCsv=require(_0xcbfc('0x5'));var querystring=require('querystring');var Papa=require(_0xcbfc('0xb'));var Redis=require(_0xcbfc('0xc'));var authService=require(_0xcbfc('0xd'));var qs=require(_0xcbfc('0xe'));var as=require(_0xcbfc('0xf'));var hardwareService=require(_0xcbfc('0x10'));var logger=require('../../config/logger')(_0xcbfc('0x11'));var utils=require(_0xcbfc('0x12'));var config=require(_0xcbfc('0x13'));var licenseUtil=require(_0xcbfc('0x14'));var db=require(_0xcbfc('0x15'))['db'];function respondWithStatusCode(_0x4e8b34,_0x3bfd05){_0x3bfd05=_0x3bfd05||0xcc;return function(_0x86f67c){if(_0x86f67c){return _0x4e8b34[_0xcbfc('0x16')](_0x3bfd05);}return _0x4e8b34['status'](_0x3bfd05)[_0xcbfc('0x17')]();};}function respondWithResult(_0x3ec338,_0x2f2bdd){_0x2f2bdd=_0x2f2bdd||0xc8;return function(_0x45a5cc){if(_0x45a5cc){return _0x3ec338[_0xcbfc('0x18')](_0x2f2bdd)['json'](_0x45a5cc);}};}function respondWithFilteredResult(_0x3c69ed,_0x1963de){return function(_0x1ec8c4){if(_0x1ec8c4){var _0x4317e4=typeof _0x1963de['offset']==='undefined'&&typeof _0x1963de[_0xcbfc('0x19')]===_0xcbfc('0x1a');var _0xa65368=_0x1ec8c4['count'];var _0x5b078f=_0x4317e4?0x0:_0x1963de[_0xcbfc('0x1b')];var _0x99b59d=_0x4317e4?_0x1ec8c4[_0xcbfc('0x1c')]:_0x1963de['offset']+_0x1963de[_0xcbfc('0x19')];var _0x552777;if(_0x99b59d>=_0xa65368){_0x99b59d=_0xa65368;_0x552777=0xc8;}else{_0x552777=0xce;}_0x3c69ed[_0xcbfc('0x18')](_0x552777);return _0x3c69ed[_0xcbfc('0x1d')](_0xcbfc('0x1e'),_0x5b078f+'-'+_0x99b59d+'/'+_0xa65368)[_0xcbfc('0x1f')](_0x1ec8c4);}return null;};}function patchUpdates(_0x25c167){return function(_0x2653b1){try{jsonpatch['apply'](_0x2653b1,_0x25c167,!![]);}catch(_0x9c79da){return BPromise[_0xcbfc('0x20')](_0x9c79da);}return _0x2653b1['save']();};}function saveUpdates(_0x1da958,_0x5a449b){return function(_0x4cc8b3){if(_0x4cc8b3){return _0x4cc8b3['update'](_0x1da958)[_0xcbfc('0x21')](function(_0x4a0fcb){return _0x4a0fcb;});}return null;};}function removeEntity(_0x4a1915,_0x1b3e42){return function(_0x34cffa){if(_0x34cffa){return _0x34cffa[_0xcbfc('0x22')]()[_0xcbfc('0x21')](function(){_0x4a1915['status'](0xcc)[_0xcbfc('0x17')]();});}};}function handleEntityNotFound(_0x51284a,_0x280b78){return function(_0x75bca0){if(!_0x75bca0){_0x51284a['sendStatus'](0x194);}return _0x75bca0;};}function handleError(_0x28bdcf,_0x3b73a3){_0x3b73a3=_0x3b73a3||0x1f4;return function(_0x4ab48e){logger[_0xcbfc('0x23')](_0x4ab48e[_0xcbfc('0x24')]);if(_0x4ab48e[_0xcbfc('0x25')]){delete _0x4ab48e[_0xcbfc('0x25')];}_0x28bdcf['status'](_0x3b73a3)[_0xcbfc('0x26')](_0x4ab48e);};}exports[_0xcbfc('0x27')]=function(_0x4f632a,_0x1f6a14){var _0x26463f={'raw':!![],'where':{'id':_0x4f632a[_0xcbfc('0x28')]['id']}},_0x7cbdfa={};_0x7cbdfa[_0xcbfc('0x29')]=_[_0xcbfc('0x2a')](db[_0xcbfc('0x2b')]['rawAttributes']);_0x7cbdfa[_0xcbfc('0x2c')]=_[_0xcbfc('0x2a')](_0x4f632a[_0xcbfc('0x2c')]);_0x7cbdfa[_0xcbfc('0x2d')]=_['intersection'](_0x7cbdfa[_0xcbfc('0x29')],_0x7cbdfa[_0xcbfc('0x2c')]);_0x26463f[_0xcbfc('0x2e')]=_[_0xcbfc('0x2f')](_0x7cbdfa[_0xcbfc('0x29')],qs[_0xcbfc('0x30')](_0x4f632a[_0xcbfc('0x2c')]['fields']));_0x26463f[_0xcbfc('0x2e')]=_0x26463f[_0xcbfc('0x2e')]['length']?_0x26463f[_0xcbfc('0x2e')]:_0x7cbdfa[_0xcbfc('0x29')];if(_0x4f632a[_0xcbfc('0x2c')]['includeAll']){_0x26463f['include']=[{'all':!![]}];}_0x26463f=_['merge']({},_0x26463f,_0x4f632a[_0xcbfc('0x31')]);return db[_0xcbfc('0x2b')][_0xcbfc('0x32')](_0x26463f)[_0xcbfc('0x21')](handleEntityNotFound(_0x1f6a14,null))[_0xcbfc('0x21')](respondWithResult(_0x1f6a14,null))[_0xcbfc('0x33')](handleError(_0x1f6a14,null));};exports[_0xcbfc('0x34')]=function(_0xc5176f,_0x49ad63){if(_0xc5176f[_0xcbfc('0x35')]['id']){delete _0xc5176f[_0xcbfc('0x35')]['id'];}return db['ChatApplication'][_0xcbfc('0x32')]({'where':{'id':_0xc5176f['params']['id']}})[_0xcbfc('0x21')](handleEntityNotFound(_0x49ad63,null))[_0xcbfc('0x21')](saveUpdates(_0xc5176f[_0xcbfc('0x35')],null))['then'](respondWithResult(_0x49ad63,null))[_0xcbfc('0x33')](handleError(_0x49ad63,null));};exports['destroy']=function(_0x5af34d,_0x2baf2f){return db[_0xcbfc('0x2b')][_0xcbfc('0x32')]({'where':{'id':_0x5af34d[_0xcbfc('0x28')]['id']}})[_0xcbfc('0x21')](handleEntityNotFound(_0x2baf2f,null))[_0xcbfc('0x21')](removeEntity(_0x2baf2f,null))[_0xcbfc('0x33')](handleError(_0x2baf2f,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index c8c69ea..844b944 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 _0xfb78=['bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x26ce09,_0x495d74){var _0x482a5a=function(_0x1778f8){while(--_0x1778f8){_0x26ce09['push'](_0x26ce09['shift']());}};_0x482a5a(++_0x495d74);}(_0xfb78,0x141));var _0x8fb7=function(_0x53ddab,_0x4ada9d){_0x53ddab=_0x53ddab-0x0;var _0x5819ac=_0xfb78[_0x53ddab];return _0x5819ac;};'use strict';var _=require(_0x8fb7('0x0'));var util=require(_0x8fb7('0x1'));var logger=require(_0x8fb7('0x2'))(_0x8fb7('0x3'));var moment=require('moment');var BPromise=require(_0x8fb7('0x4'));var rp=require(_0x8fb7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8fb7('0x6'));var config=require(_0x8fb7('0x7'));var attributes=require(_0x8fb7('0x8'));module[_0x8fb7('0x9')]=function(_0x5ef4b0,_0x2db8ae){return _0x5ef4b0[_0x8fb7('0xa')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8fb7('0xb'),'collate':_0x8fb7('0xc')});}; \ No newline at end of file +var _0x2ba4=['api','moment','path','rimraf','../../config/environment','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x18edae,_0x3496ef){var _0x562e93=function(_0x325375){while(--_0x325375){_0x18edae['push'](_0x18edae['shift']());}};_0x562e93(++_0x3496ef);}(_0x2ba4,0x184));var _0x42ba=function(_0x49870c,_0xf03aee){_0x49870c=_0x49870c-0x0;var _0x57434a=_0x2ba4[_0x49870c];return _0x57434a;};'use strict';var _=require(_0x42ba('0x0'));var util=require(_0x42ba('0x1'));var logger=require('../../config/logger')(_0x42ba('0x2'));var moment=require(_0x42ba('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x42ba('0x4'));var rimraf=require(_0x42ba('0x5'));var config=require(_0x42ba('0x6'));var attributes=require(_0x42ba('0x7'));module['exports']=function(_0x4a2987,_0x34b638){return _0x4a2987[_0x42ba('0x8')](_0x42ba('0x9'),attributes,{'tableName':_0x42ba('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x42ba('0xb'),'collate':_0x42ba('0xc')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 38591bd..8235dae 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 _0xc5f2=['ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x336f4d,_0xed10b0){var _0x4abef8=function(_0x2e70c4){while(--_0x2e70c4){_0x336f4d['push'](_0x336f4d['shift']());}};_0x4abef8(++_0xed10b0);}(_0xc5f2,0x1ea));var _0x2c5f=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc5f2[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x2c5f('0x0'));var util=require(_0x2c5f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c5f('0x2'));var db=require(_0x2c5f('0x3'))['db'];var utils=require(_0x2c5f('0x4'));var logger=require(_0x2c5f('0x5'))(_0x2c5f('0x6'));var config=require(_0x2c5f('0x7'));var jayson=require(_0x2c5f('0x8'));var client=jayson[_0x2c5f('0x9')][_0x2c5f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27ad73,_0x6cfc10,_0x44fbbd){return new BPromise(function(_0x6c9da0,_0x218a43){return client[_0x2c5f('0xb')](_0x27ad73,_0x44fbbd)[_0x2c5f('0xc')](function(_0x2ecf2f){logger[_0x2c5f('0xd')](_0x2c5f('0xe'),_0x6cfc10,_0x2c5f('0xf'));logger['debug'](_0x2c5f('0x10'),_0x6cfc10,_0x2c5f('0xf'),JSON['stringify'](_0x2ecf2f));if(_0x2ecf2f[_0x2c5f('0x11')]){if(_0x2ecf2f[_0x2c5f('0x11')][_0x2c5f('0x12')]===0x1f4){logger[_0x2c5f('0x11')](_0x2c5f('0xe'),_0x6cfc10,_0x2ecf2f[_0x2c5f('0x11')][_0x2c5f('0x13')]);return _0x218a43(_0x2ecf2f[_0x2c5f('0x11')][_0x2c5f('0x13')]);}logger[_0x2c5f('0x11')](_0x2c5f('0xe'),_0x6cfc10,_0x2ecf2f[_0x2c5f('0x11')]['message']);return _0x6c9da0(_0x2ecf2f['error'][_0x2c5f('0x13')]);}else{logger[_0x2c5f('0xd')]('ChatApplication,\x20%s,\x20%s',_0x6cfc10,'request\x20sent');_0x6c9da0(_0x2ecf2f[_0x2c5f('0x14')][_0x2c5f('0x13')]);}})[_0x2c5f('0x15')](function(_0x44ab5b){logger[_0x2c5f('0x11')](_0x2c5f('0xe'),_0x6cfc10,_0x44ab5b);_0x218a43(_0x44ab5b);});});} \ No newline at end of file +var _0x30f4=['ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x12a58e,_0x443e99){var _0x3a81b7=function(_0x4b444f){while(--_0x4b444f){_0x12a58e['push'](_0x12a58e['shift']());}};_0x3a81b7(++_0x443e99);}(_0x30f4,0x1bf));var _0x430f=function(_0x5806cd,_0x1c26f4){_0x5806cd=_0x5806cd-0x0;var _0x47495e=_0x30f4[_0x5806cd];return _0x47495e;};'use strict';var _=require(_0x430f('0x0'));var util=require(_0x430f('0x1'));var moment=require('moment');var BPromise=require(_0x430f('0x2'));var rs=require(_0x430f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x430f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x430f('0x5'))(_0x430f('0x6'));var config=require(_0x430f('0x7'));var jayson=require(_0x430f('0x8'));var client=jayson[_0x430f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cc955,_0x73877e,_0x7ac4c7){return new BPromise(function(_0x3ffe2c,_0x4d0ebf){return client[_0x430f('0xa')](_0x3cc955,_0x7ac4c7)[_0x430f('0xb')](function(_0x75345){logger[_0x430f('0xc')](_0x430f('0xd'),_0x73877e,_0x430f('0xe'));logger['debug'](_0x430f('0xf'),_0x73877e,_0x430f('0xe'),JSON[_0x430f('0x10')](_0x75345));if(_0x75345[_0x430f('0x11')]){if(_0x75345[_0x430f('0x11')][_0x430f('0x12')]===0x1f4){logger[_0x430f('0x11')]('ChatApplication,\x20%s,\x20%s',_0x73877e,_0x75345['error']['message']);return _0x4d0ebf(_0x75345[_0x430f('0x11')]['message']);}logger[_0x430f('0x11')](_0x430f('0xd'),_0x73877e,_0x75345[_0x430f('0x11')][_0x430f('0x13')]);return _0x3ffe2c(_0x75345[_0x430f('0x11')][_0x430f('0x13')]);}else{logger['info'](_0x430f('0xd'),_0x73877e,_0x430f('0xe'));_0x3ffe2c(_0x75345[_0x430f('0x14')][_0x430f('0x13')]);}})['catch'](function(_0x50039b){logger[_0x430f('0x11')](_0x430f('0xd'),_0x73877e,_0x50039b);_0x4d0ebf(_0x50039b);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 905a2d7..a0009f7 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 _0x1fc2=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','util','path','fs-extra'];(function(_0x29792f,_0x5ab098){var _0x300e7b=function(_0x32b5bb){while(--_0x32b5bb){_0x29792f['push'](_0x29792f['shift']());}};_0x300e7b(++_0x5ab098);}(_0x1fc2,0xcd));var _0x21fc=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x1fc2[_0x8c43de];return _0xa6591b;};'use strict';var multer=require('multer');var util=require(_0x21fc('0x0'));var path=require(_0x21fc('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x21fc('0x2'));var auth=require(_0x21fc('0x3'));var interaction=require(_0x21fc('0x4'));var config=require(_0x21fc('0x5'));var controller=require(_0x21fc('0x6'));router[_0x21fc('0x7')](_0x21fc('0x8'),auth[_0x21fc('0x9')](),controller[_0x21fc('0xa')]);router[_0x21fc('0xb')](_0x21fc('0x8'),auth[_0x21fc('0x9')](),controller[_0x21fc('0xc')]);router[_0x21fc('0xd')](_0x21fc('0x8'),auth[_0x21fc('0x9')](),controller[_0x21fc('0xe')]);module[_0x21fc('0xf')]=router; \ No newline at end of file +var _0x5318=['get','/:id','isAuthenticated','show','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller'];(function(_0x4c1c6a,_0x4c1ef5){var _0x59a9df=function(_0x6825f8){while(--_0x6825f8){_0x4c1c6a['push'](_0x4c1c6a['shift']());}};_0x59a9df(++_0x4c1ef5);}(_0x5318,0xf1));var _0x8531=function(_0x2bf888,_0x374f0b){_0x2bf888=_0x2bf888-0x0;var _0x3038d6=_0x5318[_0x2bf888];return _0x3038d6;};'use strict';var multer=require(_0x8531('0x0'));var util=require(_0x8531('0x1'));var path=require(_0x8531('0x2'));var timeout=require(_0x8531('0x3'));var express=require(_0x8531('0x4'));var router=express[_0x8531('0x5')]();var fs_extra=require(_0x8531('0x6'));var auth=require(_0x8531('0x7'));var interaction=require(_0x8531('0x8'));var config=require(_0x8531('0x9'));var controller=require(_0x8531('0xa'));router[_0x8531('0xb')](_0x8531('0xc'),auth[_0x8531('0xd')](),controller[_0x8531('0xe')]);router[_0x8531('0xf')](_0x8531('0xc'),auth['isAuthenticated'](),controller[_0x8531('0x10')]);router[_0x8531('0x11')](_0x8531('0xc'),auth[_0x8531('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 83992b3..0e99b1e 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 _0x398a=['STRING','BOOLEAN','sequelize','exports'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0x398a,0x11a));var _0xa398=function(_0xb560d3,_0x88481){_0xb560d3=_0xb560d3-0x0;var _0x31eda6=_0x398a[_0xb560d3];return _0x31eda6;};'use strict';var Sequelize=require(_0xa398('0x0'));module[_0xa398('0x1')]={'name':{'type':Sequelize[_0xa398('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa398('0x2')]},'write':{'type':Sequelize[_0xa398('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xdf76=['BOOLEAN','sequelize','exports','STRING'];(function(_0x29ceb8,_0x4521b3){var _0x3608c8=function(_0x45595a){while(--_0x45595a){_0x29ceb8['push'](_0x29ceb8['shift']());}};_0x3608c8(++_0x4521b3);}(_0xdf76,0x1d5));var _0x6df7=function(_0x1d0fa7,_0x1ad70f){_0x1d0fa7=_0x1d0fa7-0x0;var _0x5b2d91=_0xdf76[_0x1d0fa7];return _0x5b2d91;};'use strict';var Sequelize=require(_0x6df7('0x0'));module[_0x6df7('0x1')]={'name':{'type':Sequelize[_0x6df7('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6df7('0x2')]},'write':{'type':Sequelize[_0x6df7('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 6a7a343..8f5cb1a 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 _0x1638=['keys','filters','intersection','model','query','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','type','VIRTUAL','options','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','getUnread','user','addMembers','ids','omit','getMembers','findOne','User','order','filter','nolimit','removeMembers','ChatInternalMessage','getMessages','$gte','split','format','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatGroup','fieldName'];(function(_0x5b9717,_0x464976){var _0x375515=function(_0x24a749){while(--_0x24a749){_0x5b9717['push'](_0x5b9717['shift']());}};_0x375515(++_0x464976);}(_0x1638,0x1e8));var _0x8163=function(_0x45b1ad,_0x215b03){_0x45b1ad=_0x45b1ad-0x0;var _0x3d5696=_0x1638[_0x45b1ad];return _0x3d5696;};'use strict';var emlformat=require(_0x8163('0x0'));var rimraf=require(_0x8163('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8163('0x2'));var rp=require(_0x8163('0x3'));var moment=require(_0x8163('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8163('0x5'));var util=require(_0x8163('0x6'));var path=require(_0x8163('0x7'));var sox=require(_0x8163('0x8'));var csv=require(_0x8163('0x9'));var ejs=require(_0x8163('0xa'));var fs=require('fs');var fs_extra=require(_0x8163('0xb'));var _=require(_0x8163('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8163('0xd'));var toCsv=require(_0x8163('0x9'));var querystring=require(_0x8163('0xe'));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(_0x8163('0xf'));var logger=require(_0x8163('0x10'))('api');var utils=require(_0x8163('0x11'));var config=require(_0x8163('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x8163('0x13'))['db'];config['redis']=_['defaults'](config[_0x8163('0x14')],{'host':_0x8163('0x15'),'port':0x18eb});var socket=require(_0x8163('0x16'))(new Redis(config[_0x8163('0x14')]));require(_0x8163('0x17'))['register'](socket);function respondWithStatusCode(_0x250219,_0x1b0d71){_0x1b0d71=_0x1b0d71||0xcc;return function(_0x46f3f9){if(_0x46f3f9){return _0x250219['sendStatus'](_0x1b0d71);}return _0x250219['status'](_0x1b0d71)[_0x8163('0x18')]();};}function respondWithResult(_0xc84c26,_0x115f23){_0x115f23=_0x115f23||0xc8;return function(_0x3012b6){if(_0x3012b6){return _0xc84c26[_0x8163('0x19')](_0x115f23)['json'](_0x3012b6);}};}function respondWithFilteredResult(_0x486cdf,_0x50c03d){return function(_0xdc8c78){if(_0xdc8c78){var _0x489dc2=typeof _0x50c03d[_0x8163('0x1a')]===_0x8163('0x1b')&&typeof _0x50c03d[_0x8163('0x1c')]===_0x8163('0x1b');var _0x7183c9=_0xdc8c78[_0x8163('0x1d')];var _0x41d74e=_0x489dc2?0x0:_0x50c03d[_0x8163('0x1a')];var _0x4b002a=_0x489dc2?_0xdc8c78[_0x8163('0x1d')]:_0x50c03d['offset']+_0x50c03d[_0x8163('0x1c')];var _0x4f825d;if(_0x4b002a>=_0x7183c9){_0x4b002a=_0x7183c9;_0x4f825d=0xc8;}else{_0x4f825d=0xce;}_0x486cdf[_0x8163('0x19')](_0x4f825d);return _0x486cdf['set'](_0x8163('0x1e'),_0x41d74e+'-'+_0x4b002a+'/'+_0x7183c9)[_0x8163('0x1f')](_0xdc8c78);}return null;};}function patchUpdates(_0x282654){return function(_0x5e0307){try{jsonpatch[_0x8163('0x20')](_0x5e0307,_0x282654,!![]);}catch(_0x544afe){return BPromise[_0x8163('0x21')](_0x544afe);}return _0x5e0307['save']();};}function saveUpdates(_0x4aa156,_0x1b4ed2){return function(_0x22170f){if(_0x22170f){return _0x22170f[_0x8163('0x22')](_0x4aa156)[_0x8163('0x23')](function(_0x1794dc){return _0x1794dc;});}return null;};}function removeEntity(_0x176ece,_0x284045){return function(_0x1a0f19){if(_0x1a0f19){return _0x1a0f19[_0x8163('0x24')]()[_0x8163('0x23')](function(){_0x176ece[_0x8163('0x19')](0xcc)[_0x8163('0x18')]();});}};}function handleEntityNotFound(_0x35025c,_0x40c578){return function(_0x1944c4){if(!_0x1944c4){_0x35025c[_0x8163('0x25')](0x194);}return _0x1944c4;};}function handleError(_0x18b873,_0x18e807){_0x18e807=_0x18e807||0x1f4;return function(_0xfedc1d){logger[_0x8163('0x26')](_0xfedc1d[_0x8163('0x27')]);if(_0xfedc1d[_0x8163('0x28')]){delete _0xfedc1d[_0x8163('0x28')];}_0x18b873[_0x8163('0x19')](_0x18e807)[_0x8163('0x29')](_0xfedc1d);};}exports[_0x8163('0x2a')]=function(_0x23012b,_0x4a2b30){var _0x136151={},_0x1298a2={},_0x15eebd={'count':0x0,'rows':[]};var _0x2d3d63=_[_0x8163('0x2b')](db[_0x8163('0x2c')]['rawAttributes'],function(_0x45ada8){return{'name':_0x45ada8[_0x8163('0x2d')],'type':_0x45ada8['type']['key']};});_0x1298a2['model']=_['map'](_0x2d3d63,_0x8163('0x28'));_0x1298a2['query']=_[_0x8163('0x2e')](_0x23012b['query']);_0x1298a2[_0x8163('0x2f')]=_[_0x8163('0x30')](_0x1298a2[_0x8163('0x31')],_0x1298a2[_0x8163('0x32')]);_0x136151['attributes']=_[_0x8163('0x30')](_0x1298a2[_0x8163('0x31')],qs[_0x8163('0x33')](_0x23012b[_0x8163('0x32')][_0x8163('0x33')]));_0x136151[_0x8163('0x34')]=_0x136151['attributes'][_0x8163('0x35')]?_0x136151[_0x8163('0x34')]:_0x1298a2[_0x8163('0x31')];if(!_0x23012b[_0x8163('0x32')][_0x8163('0x36')]('nolimit')){_0x136151['limit']=qs[_0x8163('0x1c')](_0x23012b[_0x8163('0x32')][_0x8163('0x1c')]);_0x136151['offset']=qs[_0x8163('0x1a')](_0x23012b[_0x8163('0x32')][_0x8163('0x1a')]);}_0x136151['order']=qs[_0x8163('0x37')](_0x23012b[_0x8163('0x32')]['sort']);_0x136151[_0x8163('0x38')]=qs['filters'](_[_0x8163('0x39')](_0x23012b['query'],_0x1298a2[_0x8163('0x2f')]),_0x2d3d63);if(_0x23012b[_0x8163('0x32')]['filter']){_0x136151[_0x8163('0x38')]=_[_0x8163('0x3a')](_0x136151['where'],{'$or':_[_0x8163('0x2b')](_0x2d3d63,function(_0xb0c379){if(_0xb0c379[_0x8163('0x3b')]!==_0x8163('0x3c')){var _0x4b38fd={};_0x4b38fd[_0xb0c379[_0x8163('0x28')]]={'$like':'%'+_0x23012b[_0x8163('0x32')]['filter']+'%'};return _0x4b38fd;}})});}_0x136151=_['merge']({},_0x136151,_0x23012b[_0x8163('0x3d')]);var _0x1d1fd2={'where':_0x136151[_0x8163('0x38')]};return db['ChatGroup'][_0x8163('0x1d')](_0x1d1fd2)[_0x8163('0x23')](function(_0x1a1ba6){_0x15eebd['count']=_0x1a1ba6;if(_0x23012b[_0x8163('0x32')][_0x8163('0x3e')]){_0x136151['include']=[{'all':!![]}];}return db[_0x8163('0x2c')][_0x8163('0x3f')](_0x136151);})[_0x8163('0x23')](function(_0x4b257){_0x15eebd['rows']=_0x4b257;return _0x15eebd;})[_0x8163('0x23')](respondWithFilteredResult(_0x4a2b30,_0x136151))[_0x8163('0x40')](handleError(_0x4a2b30,null));};exports[_0x8163('0x41')]=function(_0x3a81a9,_0x231fe2){var _0x35daf3={'raw':!![],'where':{'id':_0x3a81a9[_0x8163('0x42')]['id']}},_0x2c0fc5={};_0x2c0fc5[_0x8163('0x31')]=_[_0x8163('0x2e')](db[_0x8163('0x2c')][_0x8163('0x43')]);_0x2c0fc5['query']=_[_0x8163('0x2e')](_0x3a81a9[_0x8163('0x32')]);_0x2c0fc5[_0x8163('0x2f')]=_[_0x8163('0x30')](_0x2c0fc5[_0x8163('0x31')],_0x2c0fc5[_0x8163('0x32')]);_0x35daf3[_0x8163('0x34')]=_['intersection'](_0x2c0fc5['model'],qs[_0x8163('0x33')](_0x3a81a9[_0x8163('0x32')][_0x8163('0x33')]));_0x35daf3[_0x8163('0x34')]=_0x35daf3[_0x8163('0x34')][_0x8163('0x35')]?_0x35daf3[_0x8163('0x34')]:_0x2c0fc5['model'];if(_0x3a81a9[_0x8163('0x32')][_0x8163('0x3e')]){_0x35daf3[_0x8163('0x44')]=[{'all':!![]}];}_0x35daf3=_['merge']({},_0x35daf3,_0x3a81a9[_0x8163('0x3d')]);return db[_0x8163('0x2c')][_0x8163('0x45')](_0x35daf3)['then'](handleEntityNotFound(_0x231fe2,null))[_0x8163('0x23')](respondWithResult(_0x231fe2,null))[_0x8163('0x40')](handleError(_0x231fe2,null));};exports['create']=function(_0x1342ee,_0x5f0073){return db[_0x8163('0x2c')][_0x8163('0x46')](_0x1342ee[_0x8163('0x47')],{})[_0x8163('0x23')](respondWithResult(_0x5f0073,0xc9))[_0x8163('0x40')](handleError(_0x5f0073,null));};exports[_0x8163('0x22')]=function(_0x3131e8,_0x55e463){if(_0x3131e8['body']['id']){delete _0x3131e8['body']['id'];}return db['ChatGroup']['find']({'where':{'id':_0x3131e8[_0x8163('0x42')]['id']}})[_0x8163('0x23')](handleEntityNotFound(_0x55e463,null))[_0x8163('0x23')](saveUpdates(_0x3131e8[_0x8163('0x47')],null))[_0x8163('0x23')](respondWithResult(_0x55e463,null))[_0x8163('0x40')](handleError(_0x55e463,null));};exports[_0x8163('0x24')]=function(_0x4bd7af,_0xdbc67b){return db[_0x8163('0x2c')][_0x8163('0x45')]({'where':{'id':_0x4bd7af[_0x8163('0x42')]['id']}})[_0x8163('0x23')](handleEntityNotFound(_0xdbc67b,null))[_0x8163('0x23')](removeEntity(_0xdbc67b,null))[_0x8163('0x40')](handleError(_0xdbc67b,null));};exports['describe']=function(_0x9e32ac,_0x52749c){return db[_0x8163('0x2c')]['describe']()[_0x8163('0x23')](respondWithResult(_0x52749c,null))[_0x8163('0x40')](handleError(_0x52749c,null));};exports[_0x8163('0x48')]=function(_0x4a9ef3,_0x5cdae8,_0x99570e){return db['ChatInternalMessage'][_0x8163('0x1d')]({'where':{'ChatGroupId':_0x4a9ef3[_0x8163('0x42')]['id'],'ToId':_0x4a9ef3[_0x8163('0x49')]['id'],'read':![]}})[_0x8163('0x23')](function(_0x179756){return{'id':_['toInteger'](_0x4a9ef3['params']['id']),'count':_0x179756};})[_0x8163('0x23')](respondWithResult(_0x5cdae8,null))['catch'](handleError(_0x5cdae8,null));};exports['addMembers']=function(_0x3c85d0,_0x66547a,_0x20314f){return db[_0x8163('0x2c')][_0x8163('0x45')]({'where':{'id':_0x3c85d0[_0x8163('0x42')]['id']}})[_0x8163('0x23')](handleEntityNotFound(_0x66547a,null))[_0x8163('0x23')](function(_0x1f2381){if(_0x1f2381){return _0x1f2381[_0x8163('0x4a')](_0x3c85d0[_0x8163('0x47')][_0x8163('0x4b')],_[_0x8163('0x4c')](_0x3c85d0[_0x8163('0x47')],['ids','id'])||{});}})['then'](respondWithResult(_0x66547a,null))[_0x8163('0x40')](handleError(_0x66547a,null));};exports[_0x8163('0x4d')]=function(_0x372cef,_0x4e8a6c,_0x5c0cca){var _0x5c0591={};var _0x32e1aa={};var _0x2c500a;var _0x622200;return db[_0x8163('0x2c')][_0x8163('0x4e')]({'where':{'id':_0x372cef[_0x8163('0x42')]['id']}})[_0x8163('0x23')](handleEntityNotFound(_0x4e8a6c,null))[_0x8163('0x23')](function(_0x39a1e0){if(_0x39a1e0){_0x2c500a=_0x39a1e0;_0x32e1aa['model']=_['keys'](db[_0x8163('0x4f')][_0x8163('0x43')]);_0x32e1aa[_0x8163('0x32')]=_[_0x8163('0x2e')](_0x372cef[_0x8163('0x32')]);_0x32e1aa['filters']=_['intersection'](_0x32e1aa['model'],_0x32e1aa['query']);_0x5c0591[_0x8163('0x34')]=_[_0x8163('0x30')](_0x32e1aa[_0x8163('0x31')],qs[_0x8163('0x33')](_0x372cef[_0x8163('0x32')]['fields']));_0x5c0591[_0x8163('0x34')]=_0x5c0591['attributes'][_0x8163('0x35')]?_0x5c0591[_0x8163('0x34')]:_0x32e1aa[_0x8163('0x31')];_0x5c0591[_0x8163('0x50')]=qs['sort'](_0x372cef[_0x8163('0x32')][_0x8163('0x37')]);_0x5c0591[_0x8163('0x38')]=qs[_0x8163('0x2f')](_[_0x8163('0x39')](_0x372cef[_0x8163('0x32')],_0x32e1aa[_0x8163('0x2f')]));if(_0x372cef['query'][_0x8163('0x51')]){_0x5c0591[_0x8163('0x38')]=_[_0x8163('0x3a')](_0x5c0591[_0x8163('0x38')],{'$or':_[_0x8163('0x2b')](_0x5c0591['attributes'],function(_0x46378b){var _0x6c7a2b={};_0x6c7a2b[_0x46378b]={'$like':'%'+_0x372cef[_0x8163('0x32')][_0x8163('0x51')]+'%'};return _0x6c7a2b;})});}_0x5c0591=_['merge']({},_0x5c0591,_0x372cef['options']);return _0x2c500a['getMembers'](_0x5c0591);}})['then'](function(_0x2231ee){if(_0x2231ee){_0x622200=_0x2231ee[_0x8163('0x35')];if(!_0x372cef[_0x8163('0x32')][_0x8163('0x36')](_0x8163('0x52'))){_0x5c0591[_0x8163('0x1c')]=qs['limit'](_0x372cef[_0x8163('0x32')]['limit']);_0x5c0591[_0x8163('0x1a')]=qs[_0x8163('0x1a')](_0x372cef[_0x8163('0x32')][_0x8163('0x1a')]);}return _0x2c500a[_0x8163('0x4d')](_0x5c0591);}})[_0x8163('0x23')](function(_0x234767){if(_0x234767){return _0x234767?{'count':_0x622200,'rows':_0x234767}:null;}})[_0x8163('0x23')](respondWithResult(_0x4e8a6c,null))[_0x8163('0x40')](handleError(_0x4e8a6c,null));};exports['removeMembers']=function(_0x195b64,_0x3ae9f3,_0x780c28){return db[_0x8163('0x2c')][_0x8163('0x45')]({'where':{'id':_0x195b64[_0x8163('0x42')]['id']}})[_0x8163('0x23')](handleEntityNotFound(_0x3ae9f3,null))[_0x8163('0x23')](function(_0x4d37bb){if(_0x4d37bb){return _0x4d37bb[_0x8163('0x53')](_0x195b64[_0x8163('0x32')][_0x8163('0x4b')]);}})['then'](respondWithStatusCode(_0x3ae9f3,null))[_0x8163('0x40')](handleError(_0x3ae9f3,null));};exports['addMessage']=function(_0xc068e4,_0x2f2511,_0x24dfd6){if(_0xc068e4[_0x8163('0x47')]['id']){delete _0xc068e4[_0x8163('0x47')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0xc068e4[_0x8163('0x42')]['id']}})[_0x8163('0x23')](handleEntityNotFound(_0x2f2511,null))[_0x8163('0x23')](function(_0xfe020f){if(_0xfe020f){_0xc068e4[_0x8163('0x47')]['ChatGroupId']=_0xfe020f['id'];return db[_0x8163('0x54')]['create'](_0xc068e4[_0x8163('0x47')]);}})[_0x8163('0x23')](respondWithResult(_0x2f2511,null))[_0x8163('0x40')](handleError(_0x2f2511,null));};exports[_0x8163('0x55')]=function(_0xcd42a7,_0x493a15,_0x17b957){var _0x241c02={};var _0x2cb229={};var _0xcdafa1;var _0x55c543;return db[_0x8163('0x2c')][_0x8163('0x4e')]({'where':{'id':_0xcd42a7[_0x8163('0x42')]['id']}})[_0x8163('0x23')](handleEntityNotFound(_0x493a15,null))[_0x8163('0x23')](function(_0x272986){if(_0x272986){_0xcdafa1=_0x272986;_0x2cb229['model']=_['keys'](db[_0x8163('0x54')][_0x8163('0x43')]);_0x2cb229[_0x8163('0x32')]=_[_0x8163('0x2e')](_0xcd42a7[_0x8163('0x32')]);_0x2cb229[_0x8163('0x2f')]=_[_0x8163('0x30')](_0x2cb229[_0x8163('0x31')],_0x2cb229[_0x8163('0x32')]);_0x241c02[_0x8163('0x34')]=_[_0x8163('0x30')](_0x2cb229[_0x8163('0x31')],qs[_0x8163('0x33')](_0xcd42a7[_0x8163('0x32')]['fields']));_0x241c02[_0x8163('0x34')]=_0x241c02[_0x8163('0x34')][_0x8163('0x35')]?_0x241c02[_0x8163('0x34')]:_0x2cb229[_0x8163('0x31')];_0x241c02[_0x8163('0x50')]=qs[_0x8163('0x37')](_0xcd42a7['query'][_0x8163('0x37')]);_0x241c02[_0x8163('0x38')]=qs[_0x8163('0x2f')](_['pick'](_0xcd42a7[_0x8163('0x32')],_0x2cb229['filters']));if(_0xcd42a7[_0x8163('0x32')]['filter']){_0x241c02[_0x8163('0x38')]=_[_0x8163('0x3a')](_0x241c02['where'],{'$or':_[_0x8163('0x2b')](_0x241c02[_0x8163('0x34')],function(_0x5bb63f){var _0x318462={};_0x318462[_0x5bb63f]={'$like':'%'+_0xcd42a7[_0x8163('0x32')][_0x8163('0x51')]+'%'};return _0x318462;})});}if(_0xcd42a7['query'][_0x8163('0x56')]){var _0x5d4d76=_0xcd42a7['query'][_0x8163('0x56')][_0x8163('0x57')](',');var _0x44e5a2={};_0x44e5a2[_0x5d4d76[0x0]]={'$gte':moment(_0x5d4d76[0x1])[_0x8163('0x58')]('YYYY-MM-DD\x20HH:mm:ss')};_0x241c02['where']=_[_0x8163('0x3a')](_0x241c02[_0x8163('0x38')],_0x44e5a2);}_0x241c02=_[_0x8163('0x3a')]({},_0x241c02,_0xcd42a7[_0x8163('0x3d')]);return _0xcdafa1[_0x8163('0x55')](_0x241c02);}})[_0x8163('0x23')](function(_0xd5c520){if(_0xd5c520){_0x55c543=_0xd5c520[_0x8163('0x35')];if(!_0xcd42a7[_0x8163('0x32')][_0x8163('0x36')](_0x8163('0x52'))){_0x241c02[_0x8163('0x1c')]=qs[_0x8163('0x1c')](_0xcd42a7[_0x8163('0x32')][_0x8163('0x1c')]);_0x241c02[_0x8163('0x1a')]=qs['offset'](_0xcd42a7[_0x8163('0x32')]['offset']);}return _0xcdafa1[_0x8163('0x55')](_0x241c02);}})[_0x8163('0x23')](function(_0x4863d1){if(_0x4863d1){return _0x4863d1?{'count':_0x55c543,'rows':_0x4863d1}:null;}})[_0x8163('0x23')](respondWithResult(_0x493a15,null))[_0x8163('0x40')](handleError(_0x493a15,null));}; \ No newline at end of file +var _0xe0f4=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','sendStatus','error','stack','name','send','index','map','ChatGroup','rawAttributes','type','query','keys','filters','model','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','catch','params','fields','find','create','body','destroy','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','findOne','intersection','getMembers','removeMembers','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service'];(function(_0x2a0738,_0x3c0bc5){var _0x159679=function(_0x9c9ec7){while(--_0x9c9ec7){_0x2a0738['push'](_0x2a0738['shift']());}};_0x159679(++_0x3c0bc5);}(_0xe0f4,0x1bf));var _0x4e0f=function(_0x33fa47,_0xfa22bc){_0x33fa47=_0x33fa47-0x0;var _0x4d34be=_0xe0f4[_0x33fa47];return _0x4d34be;};'use strict';var emlformat=require(_0x4e0f('0x0'));var rimraf=require(_0x4e0f('0x1'));var zipdir=require(_0x4e0f('0x2'));var jsonpatch=require(_0x4e0f('0x3'));var rp=require(_0x4e0f('0x4'));var moment=require(_0x4e0f('0x5'));var BPromise=require(_0x4e0f('0x6'));var Mustache=require(_0x4e0f('0x7'));var util=require(_0x4e0f('0x8'));var path=require(_0x4e0f('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4e0f('0xa'));var fs=require('fs');var fs_extra=require(_0x4e0f('0xb'));var _=require('lodash');var squel=require(_0x4e0f('0xc'));var crypto=require('crypto');var jsforce=require(_0x4e0f('0xd'));var deskjs=require(_0x4e0f('0xe'));var toCsv=require(_0x4e0f('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4e0f('0x10'));var authService=require(_0x4e0f('0x11'));var qs=require(_0x4e0f('0x12'));var as=require(_0x4e0f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4e0f('0x14'))(_0x4e0f('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4e0f('0x16'))['db'];config[_0x4e0f('0x17')]=_[_0x4e0f('0x18')](config['redis'],{'host':_0x4e0f('0x19'),'port':0x18eb});var socket=require(_0x4e0f('0x1a'))(new Redis(config[_0x4e0f('0x17')]));require(_0x4e0f('0x1b'))[_0x4e0f('0x1c')](socket);function respondWithStatusCode(_0xe2f4d5,_0x1561bb){_0x1561bb=_0x1561bb||0xcc;return function(_0x2dfaec){if(_0x2dfaec){return _0xe2f4d5['sendStatus'](_0x1561bb);}return _0xe2f4d5[_0x4e0f('0x1d')](_0x1561bb)[_0x4e0f('0x1e')]();};}function respondWithResult(_0x379133,_0x35cd01){_0x35cd01=_0x35cd01||0xc8;return function(_0x488ea2){if(_0x488ea2){return _0x379133[_0x4e0f('0x1d')](_0x35cd01)[_0x4e0f('0x1f')](_0x488ea2);}};}function respondWithFilteredResult(_0xf3668d,_0x11a999){return function(_0x5017b6){if(_0x5017b6){var _0x1a6498=typeof _0x11a999[_0x4e0f('0x20')]===_0x4e0f('0x21')&&typeof _0x11a999['limit']===_0x4e0f('0x21');var _0x25aaa6=_0x5017b6[_0x4e0f('0x22')];var _0x145959=_0x1a6498?0x0:_0x11a999[_0x4e0f('0x20')];var _0x24167a=_0x1a6498?_0x5017b6[_0x4e0f('0x22')]:_0x11a999[_0x4e0f('0x20')]+_0x11a999[_0x4e0f('0x23')];var _0x1a32cd;if(_0x24167a>=_0x25aaa6){_0x24167a=_0x25aaa6;_0x1a32cd=0xc8;}else{_0x1a32cd=0xce;}_0xf3668d[_0x4e0f('0x1d')](_0x1a32cd);return _0xf3668d[_0x4e0f('0x24')](_0x4e0f('0x25'),_0x145959+'-'+_0x24167a+'/'+_0x25aaa6)['json'](_0x5017b6);}return null;};}function patchUpdates(_0x179116){return function(_0x590990){try{jsonpatch['apply'](_0x590990,_0x179116,!![]);}catch(_0x6b5d5b){return BPromise[_0x4e0f('0x26')](_0x6b5d5b);}return _0x590990[_0x4e0f('0x27')]();};}function saveUpdates(_0x1a232b,_0x354508){return function(_0x554f64){if(_0x554f64){return _0x554f64[_0x4e0f('0x28')](_0x1a232b)[_0x4e0f('0x29')](function(_0x45a05a){return _0x45a05a;});}return null;};}function removeEntity(_0x2eb20d,_0x47dc4c){return function(_0x596248){if(_0x596248){return _0x596248['destroy']()[_0x4e0f('0x29')](function(){_0x2eb20d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x8c8381,_0x23c174){return function(_0x46acf1){if(!_0x46acf1){_0x8c8381[_0x4e0f('0x2a')](0x194);}return _0x46acf1;};}function handleError(_0x3fca87,_0x53a5f4){_0x53a5f4=_0x53a5f4||0x1f4;return function(_0x118644){logger[_0x4e0f('0x2b')](_0x118644[_0x4e0f('0x2c')]);if(_0x118644['name']){delete _0x118644[_0x4e0f('0x2d')];}_0x3fca87[_0x4e0f('0x1d')](_0x53a5f4)[_0x4e0f('0x2e')](_0x118644);};}exports[_0x4e0f('0x2f')]=function(_0x6e0318,_0x173a33){var _0x50d64b={},_0x3269c3={},_0x9154c1={'count':0x0,'rows':[]};var _0x5708db=_[_0x4e0f('0x30')](db[_0x4e0f('0x31')][_0x4e0f('0x32')],function(_0x50344d){return{'name':_0x50344d['fieldName'],'type':_0x50344d[_0x4e0f('0x33')]['key']};});_0x3269c3['model']=_[_0x4e0f('0x30')](_0x5708db,_0x4e0f('0x2d'));_0x3269c3[_0x4e0f('0x34')]=_[_0x4e0f('0x35')](_0x6e0318['query']);_0x3269c3[_0x4e0f('0x36')]=_['intersection'](_0x3269c3[_0x4e0f('0x37')],_0x3269c3[_0x4e0f('0x34')]);_0x50d64b[_0x4e0f('0x38')]=_['intersection'](_0x3269c3[_0x4e0f('0x37')],qs['fields'](_0x6e0318[_0x4e0f('0x34')]['fields']));_0x50d64b[_0x4e0f('0x38')]=_0x50d64b['attributes'][_0x4e0f('0x39')]?_0x50d64b[_0x4e0f('0x38')]:_0x3269c3[_0x4e0f('0x37')];if(!_0x6e0318[_0x4e0f('0x34')][_0x4e0f('0x3a')](_0x4e0f('0x3b'))){_0x50d64b[_0x4e0f('0x23')]=qs[_0x4e0f('0x23')](_0x6e0318[_0x4e0f('0x34')]['limit']);_0x50d64b[_0x4e0f('0x20')]=qs[_0x4e0f('0x20')](_0x6e0318['query'][_0x4e0f('0x20')]);}_0x50d64b[_0x4e0f('0x3c')]=qs[_0x4e0f('0x3d')](_0x6e0318[_0x4e0f('0x34')]['sort']);_0x50d64b['where']=qs[_0x4e0f('0x36')](_[_0x4e0f('0x3e')](_0x6e0318[_0x4e0f('0x34')],_0x3269c3['filters']),_0x5708db);if(_0x6e0318[_0x4e0f('0x34')][_0x4e0f('0x3f')]){_0x50d64b[_0x4e0f('0x40')]=_[_0x4e0f('0x41')](_0x50d64b['where'],{'$or':_['map'](_0x5708db,function(_0xda2d15){if(_0xda2d15['type']!=='VIRTUAL'){var _0x12a2fe={};_0x12a2fe[_0xda2d15['name']]={'$like':'%'+_0x6e0318[_0x4e0f('0x34')]['filter']+'%'};return _0x12a2fe;}})});}_0x50d64b=_[_0x4e0f('0x41')]({},_0x50d64b,_0x6e0318[_0x4e0f('0x42')]);var _0x519f4d={'where':_0x50d64b[_0x4e0f('0x40')]};return db[_0x4e0f('0x31')][_0x4e0f('0x22')](_0x519f4d)['then'](function(_0x5f27f2){_0x9154c1[_0x4e0f('0x22')]=_0x5f27f2;if(_0x6e0318[_0x4e0f('0x34')][_0x4e0f('0x43')]){_0x50d64b[_0x4e0f('0x44')]=[{'all':!![]}];}return db[_0x4e0f('0x31')]['findAll'](_0x50d64b);})[_0x4e0f('0x29')](function(_0x790f37){_0x9154c1['rows']=_0x790f37;return _0x9154c1;})[_0x4e0f('0x29')](respondWithFilteredResult(_0x173a33,_0x50d64b))[_0x4e0f('0x45')](handleError(_0x173a33,null));};exports['show']=function(_0x9ab0a8,_0x4f16ea){var _0xacf216={'raw':!![],'where':{'id':_0x9ab0a8[_0x4e0f('0x46')]['id']}},_0x11d641={};_0x11d641[_0x4e0f('0x37')]=_['keys'](db['ChatGroup']['rawAttributes']);_0x11d641[_0x4e0f('0x34')]=_[_0x4e0f('0x35')](_0x9ab0a8[_0x4e0f('0x34')]);_0x11d641[_0x4e0f('0x36')]=_['intersection'](_0x11d641[_0x4e0f('0x37')],_0x11d641[_0x4e0f('0x34')]);_0xacf216[_0x4e0f('0x38')]=_['intersection'](_0x11d641[_0x4e0f('0x37')],qs[_0x4e0f('0x47')](_0x9ab0a8['query'][_0x4e0f('0x47')]));_0xacf216[_0x4e0f('0x38')]=_0xacf216[_0x4e0f('0x38')][_0x4e0f('0x39')]?_0xacf216[_0x4e0f('0x38')]:_0x11d641[_0x4e0f('0x37')];if(_0x9ab0a8['query']['includeAll']){_0xacf216[_0x4e0f('0x44')]=[{'all':!![]}];}_0xacf216=_[_0x4e0f('0x41')]({},_0xacf216,_0x9ab0a8[_0x4e0f('0x42')]);return db['ChatGroup'][_0x4e0f('0x48')](_0xacf216)[_0x4e0f('0x29')](handleEntityNotFound(_0x4f16ea,null))[_0x4e0f('0x29')](respondWithResult(_0x4f16ea,null))[_0x4e0f('0x45')](handleError(_0x4f16ea,null));};exports[_0x4e0f('0x49')]=function(_0x2fa9f5,_0x1afbeb){return db[_0x4e0f('0x31')][_0x4e0f('0x49')](_0x2fa9f5[_0x4e0f('0x4a')],{})['then'](respondWithResult(_0x1afbeb,0xc9))['catch'](handleError(_0x1afbeb,null));};exports[_0x4e0f('0x28')]=function(_0x16e640,_0x191720){if(_0x16e640['body']['id']){delete _0x16e640['body']['id'];}return db[_0x4e0f('0x31')]['find']({'where':{'id':_0x16e640[_0x4e0f('0x46')]['id']}})[_0x4e0f('0x29')](handleEntityNotFound(_0x191720,null))[_0x4e0f('0x29')](saveUpdates(_0x16e640[_0x4e0f('0x4a')],null))[_0x4e0f('0x29')](respondWithResult(_0x191720,null))['catch'](handleError(_0x191720,null));};exports[_0x4e0f('0x4b')]=function(_0x4977eb,_0x3c0def){return db[_0x4e0f('0x31')][_0x4e0f('0x48')]({'where':{'id':_0x4977eb[_0x4e0f('0x46')]['id']}})[_0x4e0f('0x29')](handleEntityNotFound(_0x3c0def,null))['then'](removeEntity(_0x3c0def,null))[_0x4e0f('0x45')](handleError(_0x3c0def,null));};exports[_0x4e0f('0x4c')]=function(_0x1ed3f5,_0x2307b0){return db[_0x4e0f('0x31')]['describe']()[_0x4e0f('0x29')](respondWithResult(_0x2307b0,null))[_0x4e0f('0x45')](handleError(_0x2307b0,null));};exports[_0x4e0f('0x4d')]=function(_0x3e07be,_0x43e52d,_0x54897c){return db[_0x4e0f('0x4e')]['count']({'where':{'ChatGroupId':_0x3e07be[_0x4e0f('0x46')]['id'],'ToId':_0x3e07be['user']['id'],'read':![]}})[_0x4e0f('0x29')](function(_0x30ac26){return{'id':_[_0x4e0f('0x4f')](_0x3e07be[_0x4e0f('0x46')]['id']),'count':_0x30ac26};})['then'](respondWithResult(_0x43e52d,null))[_0x4e0f('0x45')](handleError(_0x43e52d,null));};exports[_0x4e0f('0x50')]=function(_0x113dd2,_0x41ec49,_0x233555){return db[_0x4e0f('0x31')][_0x4e0f('0x48')]({'where':{'id':_0x113dd2['params']['id']}})[_0x4e0f('0x29')](handleEntityNotFound(_0x41ec49,null))[_0x4e0f('0x29')](function(_0x124e94){if(_0x124e94){return _0x124e94[_0x4e0f('0x50')](_0x113dd2[_0x4e0f('0x4a')][_0x4e0f('0x51')],_[_0x4e0f('0x52')](_0x113dd2[_0x4e0f('0x4a')],[_0x4e0f('0x51'),'id'])||{});}})[_0x4e0f('0x29')](respondWithResult(_0x41ec49,null))['catch'](handleError(_0x41ec49,null));};exports['getMembers']=function(_0x479cb6,_0x43d455,_0x156df3){var _0x270721={};var _0x3054d3={};var _0x2b6a1f;var _0x14e49d;return db[_0x4e0f('0x31')][_0x4e0f('0x53')]({'where':{'id':_0x479cb6['params']['id']}})['then'](handleEntityNotFound(_0x43d455,null))[_0x4e0f('0x29')](function(_0x4d4af3){if(_0x4d4af3){_0x2b6a1f=_0x4d4af3;_0x3054d3['model']=_[_0x4e0f('0x35')](db['User'][_0x4e0f('0x32')]);_0x3054d3[_0x4e0f('0x34')]=_[_0x4e0f('0x35')](_0x479cb6['query']);_0x3054d3[_0x4e0f('0x36')]=_['intersection'](_0x3054d3['model'],_0x3054d3['query']);_0x270721['attributes']=_[_0x4e0f('0x54')](_0x3054d3['model'],qs[_0x4e0f('0x47')](_0x479cb6[_0x4e0f('0x34')][_0x4e0f('0x47')]));_0x270721['attributes']=_0x270721[_0x4e0f('0x38')][_0x4e0f('0x39')]?_0x270721[_0x4e0f('0x38')]:_0x3054d3[_0x4e0f('0x37')];_0x270721['order']=qs[_0x4e0f('0x3d')](_0x479cb6[_0x4e0f('0x34')][_0x4e0f('0x3d')]);_0x270721['where']=qs[_0x4e0f('0x36')](_[_0x4e0f('0x3e')](_0x479cb6['query'],_0x3054d3[_0x4e0f('0x36')]));if(_0x479cb6['query'][_0x4e0f('0x3f')]){_0x270721['where']=_[_0x4e0f('0x41')](_0x270721[_0x4e0f('0x40')],{'$or':_[_0x4e0f('0x30')](_0x270721['attributes'],function(_0x323221){var _0xcd244c={};_0xcd244c[_0x323221]={'$like':'%'+_0x479cb6['query'][_0x4e0f('0x3f')]+'%'};return _0xcd244c;})});}_0x270721=_[_0x4e0f('0x41')]({},_0x270721,_0x479cb6['options']);return _0x2b6a1f[_0x4e0f('0x55')](_0x270721);}})[_0x4e0f('0x29')](function(_0x552c6e){if(_0x552c6e){_0x14e49d=_0x552c6e[_0x4e0f('0x39')];if(!_0x479cb6['query']['hasOwnProperty']('nolimit')){_0x270721[_0x4e0f('0x23')]=qs[_0x4e0f('0x23')](_0x479cb6['query'][_0x4e0f('0x23')]);_0x270721[_0x4e0f('0x20')]=qs['offset'](_0x479cb6[_0x4e0f('0x34')][_0x4e0f('0x20')]);}return _0x2b6a1f[_0x4e0f('0x55')](_0x270721);}})[_0x4e0f('0x29')](function(_0x57d4c5){if(_0x57d4c5){return _0x57d4c5?{'count':_0x14e49d,'rows':_0x57d4c5}:null;}})[_0x4e0f('0x29')](respondWithResult(_0x43d455,null))[_0x4e0f('0x45')](handleError(_0x43d455,null));};exports[_0x4e0f('0x56')]=function(_0x4d0d4f,_0x1aec91,_0x3667f0){return db[_0x4e0f('0x31')]['find']({'where':{'id':_0x4d0d4f['params']['id']}})[_0x4e0f('0x29')](handleEntityNotFound(_0x1aec91,null))[_0x4e0f('0x29')](function(_0x2269e7){if(_0x2269e7){return _0x2269e7[_0x4e0f('0x56')](_0x4d0d4f[_0x4e0f('0x34')]['ids']);}})[_0x4e0f('0x29')](respondWithStatusCode(_0x1aec91,null))[_0x4e0f('0x45')](handleError(_0x1aec91,null));};exports['addMessage']=function(_0x49dd7b,_0x3be7af,_0x2080ba){if(_0x49dd7b[_0x4e0f('0x4a')]['id']){delete _0x49dd7b['body']['id'];}return db[_0x4e0f('0x31')][_0x4e0f('0x48')]({'where':{'id':_0x49dd7b[_0x4e0f('0x46')]['id']}})[_0x4e0f('0x29')](handleEntityNotFound(_0x3be7af,null))[_0x4e0f('0x29')](function(_0x3f56b4){if(_0x3f56b4){_0x49dd7b['body'][_0x4e0f('0x57')]=_0x3f56b4['id'];return db[_0x4e0f('0x4e')][_0x4e0f('0x49')](_0x49dd7b['body']);}})['then'](respondWithResult(_0x3be7af,null))[_0x4e0f('0x45')](handleError(_0x3be7af,null));};exports['getMessages']=function(_0xd25838,_0x4b0555,_0x3116f){var _0x57ef15={};var _0x51b391={};var _0x7715fb;var _0x5a431b;return db[_0x4e0f('0x31')][_0x4e0f('0x53')]({'where':{'id':_0xd25838[_0x4e0f('0x46')]['id']}})[_0x4e0f('0x29')](handleEntityNotFound(_0x4b0555,null))['then'](function(_0x8de1a3){if(_0x8de1a3){_0x7715fb=_0x8de1a3;_0x51b391['model']=_['keys'](db[_0x4e0f('0x4e')][_0x4e0f('0x32')]);_0x51b391[_0x4e0f('0x34')]=_[_0x4e0f('0x35')](_0xd25838[_0x4e0f('0x34')]);_0x51b391[_0x4e0f('0x36')]=_[_0x4e0f('0x54')](_0x51b391[_0x4e0f('0x37')],_0x51b391[_0x4e0f('0x34')]);_0x57ef15[_0x4e0f('0x38')]=_[_0x4e0f('0x54')](_0x51b391[_0x4e0f('0x37')],qs[_0x4e0f('0x47')](_0xd25838[_0x4e0f('0x34')][_0x4e0f('0x47')]));_0x57ef15[_0x4e0f('0x38')]=_0x57ef15[_0x4e0f('0x38')][_0x4e0f('0x39')]?_0x57ef15['attributes']:_0x51b391[_0x4e0f('0x37')];_0x57ef15[_0x4e0f('0x3c')]=qs['sort'](_0xd25838[_0x4e0f('0x34')][_0x4e0f('0x3d')]);_0x57ef15[_0x4e0f('0x40')]=qs[_0x4e0f('0x36')](_[_0x4e0f('0x3e')](_0xd25838[_0x4e0f('0x34')],_0x51b391['filters']));if(_0xd25838['query'][_0x4e0f('0x3f')]){_0x57ef15[_0x4e0f('0x40')]=_['merge'](_0x57ef15[_0x4e0f('0x40')],{'$or':_[_0x4e0f('0x30')](_0x57ef15[_0x4e0f('0x38')],function(_0x56945f){var _0x54fe78={};_0x54fe78[_0x56945f]={'$like':'%'+_0xd25838[_0x4e0f('0x34')][_0x4e0f('0x3f')]+'%'};return _0x54fe78;})});}if(_0xd25838[_0x4e0f('0x34')][_0x4e0f('0x58')]){var _0x51ca6a=_0xd25838['query'][_0x4e0f('0x58')][_0x4e0f('0x59')](',');var _0x593f37={};_0x593f37[_0x51ca6a[0x0]]={'$gte':moment(_0x51ca6a[0x1])[_0x4e0f('0x5a')](_0x4e0f('0x5b'))};_0x57ef15['where']=_[_0x4e0f('0x41')](_0x57ef15['where'],_0x593f37);}_0x57ef15=_[_0x4e0f('0x41')]({},_0x57ef15,_0xd25838[_0x4e0f('0x42')]);return _0x7715fb[_0x4e0f('0x5c')](_0x57ef15);}})['then'](function(_0x13c4ab){if(_0x13c4ab){_0x5a431b=_0x13c4ab[_0x4e0f('0x39')];if(!_0xd25838[_0x4e0f('0x34')]['hasOwnProperty'](_0x4e0f('0x3b'))){_0x57ef15['limit']=qs[_0x4e0f('0x23')](_0xd25838[_0x4e0f('0x34')][_0x4e0f('0x23')]);_0x57ef15[_0x4e0f('0x20')]=qs[_0x4e0f('0x20')](_0xd25838[_0x4e0f('0x34')][_0x4e0f('0x20')]);}return _0x7715fb[_0x4e0f('0x5c')](_0x57ef15);}})[_0x4e0f('0x29')](function(_0x4e195a){if(_0x4e195a){return _0x4e195a?{'count':_0x5a431b,'rows':_0x4e195a}:null;}})[_0x4e0f('0x29')](respondWithResult(_0x4b0555,null))[_0x4e0f('0x45')](handleError(_0x4b0555,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 2b91ae6..0b596bd 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 _0xd2f5=['ChatGroup','setMaxListeners','update','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xd2f5,0x12e));var _0x5d2f=function(_0x2b5d02,_0x164512){_0x2b5d02=_0x2b5d02-0x0;var _0x15661a=_0xd2f5[_0x2b5d02];return _0x15661a;};'use strict';var EventEmitter=require(_0x5d2f('0x0'));var ChatGroup=require(_0x5d2f('0x1'))['db'][_0x5d2f('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5d2f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5d2f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4abf61){return function(_0x11bc44,_0x436447,_0x263891){ChatGroupEvents['emit'](_0x4abf61+':'+_0x11bc44['id'],_0x11bc44);ChatGroupEvents[_0x5d2f('0x5')](_0x4abf61,_0x11bc44);_0x263891(null);};}for(var e in events){if(events[_0x5d2f('0x6')](e)){var event=events[e];ChatGroup[_0x5d2f('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x9147=['remove','emit','hook','events','../../mysqldb','ChatGroup','setMaxListeners','save','update'];(function(_0x293f81,_0x4c0c78){var _0x26e3a1=function(_0x32c554){while(--_0x32c554){_0x293f81['push'](_0x293f81['shift']());}};_0x26e3a1(++_0x4c0c78);}(_0x9147,0x81));var _0x7914=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x9147[_0xae7c2f];return _0x5d7001;};'use strict';var EventEmitter=require(_0x7914('0x0'));var ChatGroup=require(_0x7914('0x1'))['db'][_0x7914('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x7914('0x3')](0x0);var events={'afterCreate':_0x7914('0x4'),'afterUpdate':_0x7914('0x5'),'afterDestroy':_0x7914('0x6')};function emitEvent(_0x53d9c7){return function(_0x21cae6,_0x1de2bc,_0x1f8716){ChatGroupEvents[_0x7914('0x7')](_0x53d9c7+':'+_0x21cae6['id'],_0x21cae6);ChatGroupEvents[_0x7914('0x7')](_0x53d9c7,_0x21cae6);_0x1f8716(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x7914('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 5f3acb2..3cbb750 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 _0xe3df=['api','moment','bluebird','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','util','../../config/logger'];(function(_0x373ebb,_0x34cb54){var _0x58c179=function(_0x4a33c6){while(--_0x4a33c6){_0x373ebb['push'](_0x373ebb['shift']());}};_0x58c179(++_0x34cb54);}(_0xe3df,0x66));var _0xfe3d=function(_0x1ecb02,_0x4ede3e){_0x1ecb02=_0x1ecb02-0x0;var _0x328ab6=_0xe3df[_0x1ecb02];return _0x328ab6;};'use strict';var _=require('lodash');var util=require(_0xfe3d('0x0'));var logger=require(_0xfe3d('0x1'))(_0xfe3d('0x2'));var moment=require(_0xfe3d('0x3'));var BPromise=require(_0xfe3d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe3d('0x5'));var rimraf=require(_0xfe3d('0x6'));var config=require(_0xfe3d('0x7'));var attributes=require(_0xfe3d('0x8'));module[_0xfe3d('0x9')]=function(_0x4ee8e1,_0x3c1dcf){return _0x4ee8e1[_0xfe3d('0xa')](_0xfe3d('0xb'),attributes,{'tableName':_0xfe3d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f4e=['rimraf','../../config/environment','./chatGroup.attributes','define','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x9f4e,0xd6));var _0xe9f4=function(_0x3522c8,_0x1e7c82){_0x3522c8=_0x3522c8-0x0;var _0x22f498=_0x9f4e[_0x3522c8];return _0x22f498;};'use strict';var _=require(_0xe9f4('0x0'));var util=require(_0xe9f4('0x1'));var logger=require(_0xe9f4('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe9f4('0x3'));var rp=require(_0xe9f4('0x4'));var fs=require('fs');var path=require(_0xe9f4('0x5'));var rimraf=require(_0xe9f4('0x6'));var config=require(_0xe9f4('0x7'));var attributes=require(_0xe9f4('0x8'));module['exports']=function(_0x5a1494,_0x1d9757){return _0x5a1494[_0xe9f4('0x9')]('ChatGroup',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 48d8a1e..1b09553 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 _0x56e7=['defaults','localhost','./chatGroup.socket','register','request','info','debug','request\x20sent','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis'];(function(_0x5b466,_0x42e075){var _0x19a4c5=function(_0x49c92d){while(--_0x49c92d){_0x5b466['push'](_0x5b466['shift']());}};_0x19a4c5(++_0x42e075);}(_0x56e7,0x7b));var _0x756e=function(_0x5396b5,_0x1c0766){_0x5396b5=_0x5396b5-0x0;var _0x687961=_0x56e7[_0x5396b5];return _0x687961;};'use strict';var _=require('lodash');var util=require(_0x756e('0x0'));var moment=require(_0x756e('0x1'));var BPromise=require('bluebird');var rs=require(_0x756e('0x2'));var fs=require('fs');var Redis=require(_0x756e('0x3'));var db=require(_0x756e('0x4'))['db'];var utils=require(_0x756e('0x5'));var logger=require(_0x756e('0x6'))(_0x756e('0x7'));var config=require(_0x756e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x756e('0x9')][_0x756e('0xa')]({'port':0x232a});config[_0x756e('0xb')]=_[_0x756e('0xc')](config['redis'],{'host':_0x756e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x756e('0xb')]));require(_0x756e('0xe'))[_0x756e('0xf')](socket);function respondWithRpcPromise(_0x4738dc,_0x4adf8f,_0x5d5b90){return new BPromise(function(_0x324d36,_0x2be615){return client[_0x756e('0x10')](_0x4738dc,_0x5d5b90)['then'](function(_0x330076){logger[_0x756e('0x11')]('ChatGroup,\x20%s,\x20%s',_0x4adf8f,'request\x20sent');logger[_0x756e('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x4adf8f,_0x756e('0x13'),JSON[_0x756e('0x14')](_0x330076));if(_0x330076[_0x756e('0x15')]){if(_0x330076[_0x756e('0x15')][_0x756e('0x16')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x4adf8f,_0x330076[_0x756e('0x15')][_0x756e('0x17')]);return _0x2be615(_0x330076[_0x756e('0x15')]['message']);}logger['error'](_0x756e('0x18'),_0x4adf8f,_0x330076[_0x756e('0x15')][_0x756e('0x17')]);return _0x324d36(_0x330076[_0x756e('0x15')][_0x756e('0x17')]);}else{logger[_0x756e('0x11')](_0x756e('0x18'),_0x4adf8f,_0x756e('0x13'));_0x324d36(_0x330076[_0x756e('0x19')]['message']);}})[_0x756e('0x1a')](function(_0x47c3c4){logger['error'](_0x756e('0x18'),_0x4adf8f,_0x47c3c4);_0x2be615(_0x47c3c4);});});} \ No newline at end of file +var _0xf360=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatGroup.socket','register','request','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring'];(function(_0x372148,_0x433764){var _0x1b507b=function(_0x48a8f1){while(--_0x48a8f1){_0x372148['push'](_0x372148['shift']());}};_0x1b507b(++_0x433764);}(_0xf360,0x9e));var _0x0f36=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf360[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0f36('0x0'));var util=require(_0x0f36('0x1'));var moment=require(_0x0f36('0x2'));var BPromise=require('bluebird');var rs=require(_0x0f36('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f36('0x4'))['db'];var utils=require(_0x0f36('0x5'));var logger=require(_0x0f36('0x6'))('rpc');var config=require(_0x0f36('0x7'));var jayson=require(_0x0f36('0x8'));var client=jayson[_0x0f36('0x9')][_0x0f36('0xa')]({'port':0x232a});config[_0x0f36('0xb')]=_[_0x0f36('0xc')](config[_0x0f36('0xb')],{'host':_0x0f36('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0f36('0xb')]));require(_0x0f36('0xe'))[_0x0f36('0xf')](socket);function respondWithRpcPromise(_0x4036b5,_0x146814,_0x4015fc){return new BPromise(function(_0x4963fb,_0x35d5ee){return client[_0x0f36('0x10')](_0x4036b5,_0x4015fc)[_0x0f36('0x11')](function(_0x5044af){logger[_0x0f36('0x12')]('ChatGroup,\x20%s,\x20%s',_0x146814,'request\x20sent');logger[_0x0f36('0x13')](_0x0f36('0x14'),_0x146814,'request\x20sent',JSON[_0x0f36('0x15')](_0x5044af));if(_0x5044af[_0x0f36('0x16')]){if(_0x5044af[_0x0f36('0x16')][_0x0f36('0x17')]===0x1f4){logger['error'](_0x0f36('0x18'),_0x146814,_0x5044af['error'][_0x0f36('0x19')]);return _0x35d5ee(_0x5044af[_0x0f36('0x16')][_0x0f36('0x19')]);}logger[_0x0f36('0x16')](_0x0f36('0x18'),_0x146814,_0x5044af[_0x0f36('0x16')][_0x0f36('0x19')]);return _0x4963fb(_0x5044af['error']['message']);}else{logger[_0x0f36('0x12')](_0x0f36('0x18'),_0x146814,'request\x20sent');_0x4963fb(_0x5044af['result'][_0x0f36('0x19')]);}})[_0x0f36('0x1a')](function(_0x523c43){logger[_0x0f36('0x16')](_0x0f36('0x18'),_0x146814,_0x523c43);_0x35d5ee(_0x523c43);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index fd08778..3a43a26 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 _0xb7bd=['save','remove','update','removeListener','register','length','./chatGroup.events'];(function(_0x3592fc,_0x3c8a44){var _0x27c04f=function(_0x183a69){while(--_0x183a69){_0x3592fc['push'](_0x3592fc['shift']());}};_0x27c04f(++_0x3c8a44);}(_0xb7bd,0x164));var _0xdb7b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb7bd[_0x2641f9];return _0x585741;};'use strict';var ChatGroupEvents=require(_0xdb7b('0x0'));var events=[_0xdb7b('0x1'),_0xdb7b('0x2'),_0xdb7b('0x3')];function createListener(_0x183b20,_0x50b6a6){return function(_0x2ef171){_0x50b6a6['emit'](_0x183b20,_0x2ef171);};}function removeListener(_0x3dbb40,_0x159db5){return function(){ChatGroupEvents[_0xdb7b('0x4')](_0x3dbb40,_0x159db5);};}exports[_0xdb7b('0x5')]=function(_0x802c30){for(var _0x49a27d=0x0,_0x55acd0=events[_0xdb7b('0x6')];_0x49a27d<_0x55acd0;_0x49a27d++){var _0x1b797c=events[_0x49a27d];var _0x23f0f0=createListener('chatGroup:'+_0x1b797c,_0x802c30);ChatGroupEvents['on'](_0x1b797c,_0x23f0f0);}}; \ No newline at end of file +var _0x8c8d=['update','register','length','chatGroup:','save','remove'];(function(_0x742c21,_0x44bb26){var _0x1abc0f=function(_0x4b9515){while(--_0x4b9515){_0x742c21['push'](_0x742c21['shift']());}};_0x1abc0f(++_0x44bb26);}(_0x8c8d,0x12a));var _0xd8c8=function(_0x2f0166,_0x2c9892){_0x2f0166=_0x2f0166-0x0;var _0x1ba662=_0x8c8d[_0x2f0166];return _0x1ba662;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xd8c8('0x0'),_0xd8c8('0x1'),_0xd8c8('0x2')];function createListener(_0x412f20,_0x4e1c16){return function(_0x5d8058){_0x4e1c16['emit'](_0x412f20,_0x5d8058);};}function removeListener(_0x46cc1e,_0x3f7332){return function(){ChatGroupEvents['removeListener'](_0x46cc1e,_0x3f7332);};}exports[_0xd8c8('0x3')]=function(_0x266b78){for(var _0x1e994a=0x0,_0x37168e=events[_0xd8c8('0x4')];_0x1e994a<_0x37168e;_0x1e994a++){var _0x5cf3ba=events[_0x1e994a];var _0x2d6b25=createListener(_0xd8c8('0x5')+_0x5cf3ba,_0x266b78);ChatGroupEvents['on'](_0x5cf3ba,_0x2d6b25);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 37ccfec..a649071 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 _0x92c3=['update','delete','removeMembers','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','put'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x92c3,0xc8));var _0x392c=function(_0x115570,_0x22a206){_0x115570=_0x115570-0x0;var _0x16568e=_0x92c3[_0x115570];return _0x16568e;};'use strict';var multer=require('multer');var util=require(_0x392c('0x0'));var path=require(_0x392c('0x1'));var timeout=require('connect-timeout');var express=require(_0x392c('0x2'));var router=express[_0x392c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x392c('0x4'));var interaction=require(_0x392c('0x5'));var config=require(_0x392c('0x6'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0x392c('0x7')](),controller[_0x392c('0x8')]);router[_0x392c('0x9')](_0x392c('0xa'),auth[_0x392c('0x7')](),controller[_0x392c('0xb')]);router[_0x392c('0x9')](_0x392c('0xc'),auth[_0x392c('0x7')](),controller[_0x392c('0xd')]);router[_0x392c('0x9')](_0x392c('0xe'),auth[_0x392c('0x7')](),controller[_0x392c('0xf')]);router['get'](_0x392c('0x10'),auth[_0x392c('0x7')](),controller[_0x392c('0x11')]);router[_0x392c('0x9')](_0x392c('0x12'),auth[_0x392c('0x7')](),controller[_0x392c('0x13')]);router[_0x392c('0x14')]('/',auth['isAuthenticated'](),controller[_0x392c('0x15')]);router[_0x392c('0x14')](_0x392c('0x10'),auth[_0x392c('0x7')](),controller[_0x392c('0x16')]);router[_0x392c('0x14')](_0x392c('0x12'),auth[_0x392c('0x7')](),controller['addMessage']);router[_0x392c('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x392c('0x18')]);router['delete']('/:id',auth[_0x392c('0x7')](),controller['destroy']);router[_0x392c('0x19')](_0x392c('0x10'),auth[_0x392c('0x7')](),controller[_0x392c('0x1a')]);module[_0x392c('0x1b')]=router; \ No newline at end of file +var _0xf5eb=['getUnread','/:id/members','/:id/messages','getMessages','post','create','addMembers','put','update','delete','removeMembers','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/describe','describe','get','/:id','isAuthenticated','show','/:id/unread'];(function(_0x402c71,_0x7d3f25){var _0xdac8b5=function(_0x223ca7){while(--_0x223ca7){_0x402c71['push'](_0x402c71['shift']());}};_0xdac8b5(++_0x7d3f25);}(_0xf5eb,0x14f));var _0xbf5e=function(_0x5cf101,_0x48e000){_0x5cf101=_0x5cf101-0x0;var _0x54ddb4=_0xf5eb[_0x5cf101];return _0x54ddb4;};'use strict';var multer=require(_0xbf5e('0x0'));var util=require(_0xbf5e('0x1'));var path=require(_0xbf5e('0x2'));var timeout=require(_0xbf5e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbf5e('0x4'));var auth=require(_0xbf5e('0x5'));var interaction=require(_0xbf5e('0x6'));var config=require(_0xbf5e('0x7'));var controller=require('./chatGroup.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xbf5e('0x8')]);router['get'](_0xbf5e('0x9'),auth['isAuthenticated'](),controller[_0xbf5e('0xa')]);router[_0xbf5e('0xb')](_0xbf5e('0xc'),auth[_0xbf5e('0xd')](),controller[_0xbf5e('0xe')]);router[_0xbf5e('0xb')](_0xbf5e('0xf'),auth[_0xbf5e('0xd')](),controller[_0xbf5e('0x10')]);router[_0xbf5e('0xb')](_0xbf5e('0x11'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbf5e('0xb')](_0xbf5e('0x12'),auth['isAuthenticated'](),controller[_0xbf5e('0x13')]);router[_0xbf5e('0x14')]('/',auth[_0xbf5e('0xd')](),controller[_0xbf5e('0x15')]);router[_0xbf5e('0x14')]('/:id/members',auth[_0xbf5e('0xd')](),controller[_0xbf5e('0x16')]);router[_0xbf5e('0x14')](_0xbf5e('0x12'),auth[_0xbf5e('0xd')](),controller['addMessage']);router[_0xbf5e('0x17')](_0xbf5e('0xc'),auth[_0xbf5e('0xd')](),controller[_0xbf5e('0x18')]);router[_0xbf5e('0x19')](_0xbf5e('0xc'),auth[_0xbf5e('0xd')](),controller['destroy']);router['delete'](_0xbf5e('0x11'),auth[_0xbf5e('0xd')](),controller[_0xbf5e('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 044e58d..e631581 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 _0xe9ad=['BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','out','sequelize','exports'];(function(_0x29bd18,_0x5103e8){var _0x4b9e7e=function(_0x588741){while(--_0x588741){_0x29bd18['push'](_0x29bd18['shift']());}};_0x4b9e7e(++_0x5103e8);}(_0xe9ad,0x82));var _0xde9a=function(_0x133851,_0x4d6780){_0x133851=_0x133851-0x0;var _0x188215=_0xe9ad[_0x133851];return _0x188215;};'use strict';var Sequelize=require(_0xde9a('0x0'));module[_0xde9a('0x1')]={'closed':{'type':Sequelize[_0xde9a('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xde9a('0x3')]},'ratingType':{'type':Sequelize[_0xde9a('0x4')](_0xde9a('0x5'),_0xde9a('0x6')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xde9a('0x7')]},'pathTranscript':{'type':Sequelize[_0xde9a('0x7')]},'mailTranscript':{'type':Sequelize[_0xde9a('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xde9a('0x9')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xde9a('0x8')]},'thirdDisposition':{'type':Sequelize[_0xde9a('0x8')]},'note':{'type':Sequelize[_0xde9a('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xde9a('0x8')]},'osName':{'type':Sequelize[_0xde9a('0x8')]},'osVersion':{'type':Sequelize[_0xde9a('0x8')]},'deviceModel':{'type':Sequelize[_0xde9a('0x8')]},'deviceVendor':{'type':Sequelize[_0xde9a('0x8')]},'deviceType':{'type':Sequelize[_0xde9a('0x8')]},'referer':{'type':Sequelize[_0xde9a('0x7')]},'customerIp':{'type':Sequelize[_0xde9a('0x8')]},'formData':{'type':Sequelize[_0xde9a('0x7')]('long')},'read1stAt':{'type':Sequelize[_0xde9a('0x9')]},'lastMsgAt':{'type':Sequelize[_0xde9a('0x9')]},'lastMsgDirection':{'type':Sequelize[_0xde9a('0x4')]('in',_0xde9a('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xde9a('0x8')]},'customerPort':{'type':Sequelize[_0xde9a('0x8')]},'vidaooSessionId':{'type':Sequelize[_0xde9a('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0xde9a('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x56bd=['DATE','ENUM','out','exports','BOOLEAN','INTEGER','star','thumb','TEXT','STRING'];(function(_0x2301c1,_0x3c5a47){var _0x28f1eb=function(_0x6a6bb){while(--_0x6a6bb){_0x2301c1['push'](_0x2301c1['shift']());}};_0x28f1eb(++_0x3c5a47);}(_0x56bd,0xe9));var _0xd56b=function(_0x490aad,_0x1c7c91){_0x490aad=_0x490aad-0x0;var _0x54582a=_0x56bd[_0x490aad];return _0x54582a;};'use strict';var Sequelize=require('sequelize');module[_0xd56b('0x0')]={'closed':{'type':Sequelize[_0xd56b('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xd56b('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0xd56b('0x3'),_0xd56b('0x4')),'defaultValue':_0xd56b('0x3')},'ratingMessage':{'type':Sequelize[_0xd56b('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xd56b('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xd56b('0x7')]},'disposition':{'type':Sequelize[_0xd56b('0x6')]},'secondDisposition':{'type':Sequelize[_0xd56b('0x6')]},'thirdDisposition':{'type':Sequelize[_0xd56b('0x6')]},'note':{'type':Sequelize[_0xd56b('0x6')]},'browserName':{'type':Sequelize[_0xd56b('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xd56b('0x6')]},'osVersion':{'type':Sequelize[_0xd56b('0x6')]},'deviceModel':{'type':Sequelize[_0xd56b('0x6')]},'deviceVendor':{'type':Sequelize[_0xd56b('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xd56b('0x6')]},'formData':{'type':Sequelize[_0xd56b('0x5')]('long')},'read1stAt':{'type':Sequelize[_0xd56b('0x7')]},'lastMsgAt':{'type':Sequelize[_0xd56b('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xd56b('0x8')]('in',_0xd56b('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xd56b('0x6')]},'customerPort':{'type':Sequelize[_0xd56b('0x6')]},'vidaooSessionId':{'type':Sequelize[_0xd56b('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0xd56b('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index a1f5446..48ce81e 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 _0x21e1=['transcript-%d-%s.zip','lastName','direction','read','Account','Owner','mkdirSync','Chat','N.A.','browserName','customerIp','customerPort','tail','createReadStream','createWriteStream','firstName','value','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','update','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','index','map','ChatInteraction','fieldName','key','getOptions','findAll','chat','query','user','show','params','model','rawAttributes','filters','intersection','fields','attributes','length','includeAll','include','find','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','fullname','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','filename','type','mimetype','Attachment','create','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','close','server/files/chat/upload/','transcript-%s.txt','now','Messages','User','ContactId','format','agentAlias','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','email','mailTranscript','Mail\x20Transcript','ChatMessage','addMessage','ids','omit','keys','hasOwnProperty','nolimit','sort','pick','ChatInteractionId','where','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','rows','getMyMessages','order','filter','secret','includeAgent','push','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','download','unix','toString','server','files','tmp','attachments'];(function(_0x4953c9,_0x24591d){var _0x263a5e=function(_0x4181bf){while(--_0x4181bf){_0x4953c9['push'](_0x4953c9['shift']());}};_0x263a5e(++_0x24591d);}(_0x21e1,0x1cd));var _0x121e=function(_0x367839,_0x2ccb36){_0x367839=_0x367839-0x0;var _0x5c8360=_0x21e1[_0x367839];return _0x5c8360;};'use strict';var rimraf=require(_0x121e('0x0'));var zipdir=require(_0x121e('0x1'));var rp=require(_0x121e('0x2'));var moment=require(_0x121e('0x3'));var BPromise=require(_0x121e('0x4'));var Mustache=require(_0x121e('0x5'));var util=require(_0x121e('0x6'));var path=require(_0x121e('0x7'));var ejs=require(_0x121e('0x8'));var fs=require('fs');var _=require(_0x121e('0x9'));var Redis=require(_0x121e('0xa'));var interaction=require(_0x121e('0xb'));var qs=require(_0x121e('0xc'));var pdf=require(_0x121e('0xd'));var logger=require(_0x121e('0xe'))(_0x121e('0xf'));var config=require(_0x121e('0x10'));var db=require(_0x121e('0x11'))['db'];config[_0x121e('0x12')]=_[_0x121e('0x13')](config[_0x121e('0x12')],{'host':_0x121e('0x14'),'port':0x18eb});var socket=require(_0x121e('0x15'))(new Redis(config['redis']));require(_0x121e('0x16'))[_0x121e('0x17')](socket);var jayson=require(_0x121e('0x18'));var client=jayson[_0x121e('0x19')][_0x121e('0x1a')]({'port':0x232b});var client9004=jayson[_0x121e('0x19')][_0x121e('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0x152fe2,_0x3a7e01,_0x15fd52,_0x387b45){return new BPromise(function(_0x5e0283,_0x11740c){var _0xa32bde=_0x387b45||client;return _0xa32bde[_0x121e('0x1b')](_0x152fe2,_0x15fd52)[_0x121e('0x1c')](function(_0x92e065){logger[_0x121e('0x1d')](_0x121e('0x1e'),_0x3a7e01,_0x121e('0x1f'));logger[_0x121e('0x20')](_0x121e('0x21'),_0x3a7e01,_0x121e('0x1f'),JSON[_0x121e('0x22')](_0x92e065));if(_0x92e065[_0x121e('0x23')]){if(_0x92e065['error']['code']===0x1f4){logger[_0x121e('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x3a7e01,_0x92e065[_0x121e('0x23')]['message']);return _0x11740c(_0x92e065['error']['message']);}logger['error'](_0x121e('0x1e'),_0x3a7e01,_0x92e065[_0x121e('0x23')][_0x121e('0x24')]);return _0x5e0283(_0x92e065[_0x121e('0x23')]['message']);}else{logger['info'](_0x121e('0x1e'),_0x3a7e01,_0x121e('0x1f'));_0x5e0283(_0x92e065['result']['message']);}})[_0x121e('0x25')](function(_0x234bff){logger[_0x121e('0x23')](_0x121e('0x1e'),_0x3a7e01,_0x234bff);_0x11740c(_0x234bff);});});}function respondWithStatusCode(_0x3e5fbe,_0x49130d){_0x49130d=_0x49130d||0xcc;return function(_0x1a1761){if(_0x1a1761){return _0x3e5fbe[_0x121e('0x26')](_0x49130d);}return _0x3e5fbe[_0x121e('0x27')](_0x49130d)['end']();};}function respondWithResult(_0x370c56,_0x4ced7b){_0x4ced7b=_0x4ced7b||0xc8;return function(_0xdad874){if(_0xdad874){return _0x370c56['status'](_0x4ced7b)[_0x121e('0x28')](_0xdad874);}};}function respondWithFilteredResult(_0x425871,_0x2c66e7){return function(_0x4806c3){if(_0x4806c3){var _0x44804e=typeof _0x2c66e7[_0x121e('0x29')]===_0x121e('0x2a')&&typeof _0x2c66e7[_0x121e('0x2b')]==='undefined';var _0x136054=_0x4806c3[_0x121e('0x2c')];var _0x2e8380=_0x44804e?0x0:_0x2c66e7['offset'];var _0x3d2927=_0x44804e?_0x4806c3[_0x121e('0x2c')]:_0x2c66e7[_0x121e('0x29')]+_0x2c66e7[_0x121e('0x2b')];var _0x300aac;if(_0x3d2927>=_0x136054){_0x3d2927=_0x136054;_0x300aac=0xc8;}else{_0x300aac=0xce;}_0x425871[_0x121e('0x27')](_0x300aac);return _0x425871['set'](_0x121e('0x2d'),_0x2e8380+'-'+_0x3d2927+'/'+_0x136054)[_0x121e('0x28')](_0x4806c3);}return null;};}function saveUpdates(_0x2883c5){return function(_0xfb6e4d){if(_0xfb6e4d){return _0xfb6e4d[_0x121e('0x2e')](_0x2883c5)[_0x121e('0x1c')](function(_0x5a81db){return _0x5a81db;});}return null;};}function removeEntity(_0x3a4a23){return function(_0x46e38e){if(_0x46e38e){return _0x46e38e[_0x121e('0x2f')]()[_0x121e('0x1c')](function(){_0x3a4a23[_0x121e('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x519011){return function(_0x16c000){if(!_0x16c000){_0x519011[_0x121e('0x26')](0x194);}return _0x16c000;};}function handleError(_0xa21411,_0x426fa6){_0x426fa6=_0x426fa6||0x1f4;return function(_0x234088){logger[_0x121e('0x23')](_0x234088[_0x121e('0x30')]);if(_0x234088[_0x121e('0x31')]){delete _0x234088[_0x121e('0x31')];}_0xa21411[_0x121e('0x27')](_0x426fa6)[_0x121e('0x32')](_0x234088);};}function getMustacheRender(_0xa20f16,_0x56cf66){return Mustache[_0x121e('0x33')](_0xa20f16,_[_0x121e('0x34')](_0x56cf66[_0x121e('0x35')],{'contact':_0x56cf66[_0x121e('0x36')],'message':_0x56cf66['message'],'agent':_0x56cf66[_0x121e('0x37')],'interaction':_0x56cf66[_0x121e('0x38')],'account':_0x56cf66[_0x121e('0x39')]}))||'';}exports[_0x121e('0x3a')]=function(_0x3039bb,_0x499eb6){var _0xa8c9f8={};var _0x161048=_[_0x121e('0x3b')](db[_0x121e('0x3c')]['rawAttributes'],function(_0x18d8d7){return{'name':_0x18d8d7[_0x121e('0x3d')],'type':_0x18d8d7['type'][_0x121e('0x3e')]};});_0xa8c9f8=qs[_0x121e('0x3f')](_0x161048,_0x3039bb);return interaction[_0x121e('0x40')](_0x121e('0x41'),_0x3039bb[_0x121e('0x42')],_0x3039bb[_0x121e('0x43')],_0xa8c9f8,_0x161048)[_0x121e('0x1c')](respondWithFilteredResult(_0x499eb6,_0xa8c9f8))['catch'](handleError(_0x499eb6,null));};exports[_0x121e('0x44')]=function(_0x34746b,_0x11eef5){var _0x246051={'raw':![],'where':{'id':_0x34746b[_0x121e('0x45')]['id']}},_0x938c3d={};_0x938c3d[_0x121e('0x46')]=_['keys'](db['ChatInteraction'][_0x121e('0x47')]);_0x938c3d[_0x121e('0x42')]=_['keys'](_0x34746b['query']);_0x938c3d[_0x121e('0x48')]=_[_0x121e('0x49')](_0x938c3d[_0x121e('0x46')],_0x938c3d[_0x121e('0x42')]);_0x246051['attributes']=_[_0x121e('0x49')](_0x938c3d['model'],qs[_0x121e('0x4a')](_0x34746b['query'][_0x121e('0x4a')]));_0x246051[_0x121e('0x4b')]=_0x246051[_0x121e('0x4b')][_0x121e('0x4c')]?_0x246051['attributes']:_0x938c3d['model'];if(_0x34746b[_0x121e('0x42')][_0x121e('0x4d')]){_0x246051[_0x121e('0x4e')]=[{'all':!![]}];}_0x246051=_[_0x121e('0x34')]({},_0x246051,_0x34746b['options']);return db['ChatInteraction'][_0x121e('0x4f')](_0x246051)[_0x121e('0x1c')](handleEntityNotFound(_0x11eef5,null))[_0x121e('0x1c')](respondWithResult(_0x11eef5,null))[_0x121e('0x25')](handleError(_0x11eef5,null));};exports['create']=function(_0x48b04f,_0xb4696a){return db['ChatInteraction']['create'](_0x48b04f['body'],{})[_0x121e('0x1c')](respondWithResult(_0xb4696a,0xc9))['catch'](handleError(_0xb4696a,null));};exports[_0x121e('0x2e')]=function(_0x1d48dc,_0x292dd6){if(_0x1d48dc[_0x121e('0x35')]['id']){delete _0x1d48dc[_0x121e('0x35')]['id'];}return db[_0x121e('0x3c')]['find']({'where':{'id':_0x1d48dc[_0x121e('0x45')]['id']}})[_0x121e('0x1c')](handleEntityNotFound(_0x292dd6,null))[_0x121e('0x1c')](saveUpdates(_0x1d48dc[_0x121e('0x35')],null))[_0x121e('0x1c')](respondWithResult(_0x292dd6,null))[_0x121e('0x25')](handleError(_0x292dd6,null));};exports[_0x121e('0x2f')]=function(_0x5f2e5c,_0x2d0ff8){return db[_0x121e('0x3c')][_0x121e('0x4f')]({'where':{'id':_0x5f2e5c[_0x121e('0x45')]['id']}})[_0x121e('0x1c')](handleEntityNotFound(_0x2d0ff8,null))[_0x121e('0x1c')](removeEntity(_0x2d0ff8,null))[_0x121e('0x25')](handleError(_0x2d0ff8,null));};exports[_0x121e('0x50')]=function(_0x336042,_0x4a1486){return db[_0x121e('0x3c')][_0x121e('0x50')]()[_0x121e('0x1c')](respondWithResult(_0x4a1486,null))[_0x121e('0x25')](handleError(_0x4a1486,null));};exports[_0x121e('0x51')]=function(_0x107cb4,_0x495f2e){var _0x11e6be=_0x107cb4[_0x121e('0x45')]['id'];var _0x8d8729;var _0xe312f2;var _0x599f8d;return db[_0x121e('0x3c')][_0x121e('0x52')]({'where':{'id':_0x11e6be}})[_0x121e('0x1c')](function(_0x2d332c){_0x8d8729=_0x2d332c;return db[_0x121e('0x53')][_0x121e('0x52')]({'where':{'id':_0x2d332c[_0x121e('0x54')]},'attributes':['id','vidaooApiKey',_0x121e('0x55'),_0x121e('0x56'),_0x121e('0x57'),_0x121e('0x58')],'raw':!![]});})[_0x121e('0x1c')](function(_0x75facc){if(_0x75facc&&_0x75facc[_0x121e('0x59')]&&_0x75facc[_0x121e('0x55')]){_0xe312f2=_0x75facc;var _0x32c5e7={'interaction':{'id':_0x11e6be},'agent':{'id':_0x107cb4[_0x121e('0x43')]['id'],'name':_0x107cb4[_0x121e('0x43')][_0x121e('0x31')],'fullname':_0x107cb4[_0x121e('0x43')][_0x121e('0x5a')],'email':_0x107cb4[_0x121e('0x43')]['email']},'contact':_0x107cb4[_0x121e('0x35')][_0x121e('0x36')],'account':_0x107cb4[_0x121e('0x35')][_0x121e('0x39')]};var _0x364b79={'rejectUnauthorized':![],'method':_0x121e('0x5b'),'url':_0x121e('0x5c'),'headers':{'X-APIKEY':_0x75facc[_0x121e('0x59')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x107cb4[_0x121e('0x43')]['email']],'buttons':null,'topic':_0xe312f2[_0x121e('0x56')],'note':_[_0x121e('0x5d')](_0xe312f2[_0x121e('0x57')])?null:getMustacheRender(_0xe312f2['vidaooNote'],_0x32c5e7),'metadata':null},'redirect':_0x121e('0x5e'),'json':!![]};try{if(!_[_0x121e('0x5d')](_0xe312f2[_0x121e('0x58')])){var _0x588c6c=getMustacheRender(_0xe312f2[_0x121e('0x58')],_0x32c5e7);var _0x4f691e=JSON[_0x121e('0x5f')](_0x588c6c);_0x364b79[_0x121e('0x35')]['metadata']=_0x4f691e;}}catch(_0xb9fccb){throw new db['Sequelize'][(_0x121e('0x60'))](_0x121e('0x61'));}return rp(_0x364b79);}else{throw new db[(_0x121e('0x62'))][(_0x121e('0x60'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x121e('0x1c')](function(_0x357122){_0x599f8d=_0x357122;if(_0x599f8d['id']){var _0x2b15e5={'body':_0x599f8d[_0x121e('0x63')],'ChatWebsiteId':_0xe312f2['id'],'ChatInteractionId':_0x8d8729['id'],'direction':_0x121e('0x64'),'UserId':_0x107cb4[_0x121e('0x43')]['id']};return db['ChatMessage']['create'](_0x2b15e5,{});}else{throw new db[(_0x121e('0x62'))]['ValidationError'](_0x121e('0x65'));}})[_0x121e('0x1c')](function(){return _0x8d8729['updateAttributes']({'vidaooSessionId':_0x599f8d['id']});})[_0x121e('0x1c')](respondWithResult(_0x495f2e,null))[_0x121e('0x25')](handleError(_0x495f2e,null));};exports[_0x121e('0x66')]=function(_0x2407f9,_0x46ff71){if(_0x2407f9[_0x121e('0x35')]['id']){delete _0x2407f9[_0x121e('0x35')]['id'];}return db[_0x121e('0x3c')][_0x121e('0x4f')]({'where':{'id':_0x2407f9[_0x121e('0x45')]['id']},'include':[{'model':db[_0x121e('0x67')],'as':_0x121e('0x68')}]})[_0x121e('0x1c')](handleEntityNotFound(_0x46ff71,null))[_0x121e('0x1c')](saveUpdates(_0x2407f9[_0x121e('0x35')],null))['then'](respondWithResult(_0x46ff71,null))[_0x121e('0x25')](handleError(_0x46ff71,null));};exports[_0x121e('0x69')]=function(_0x2bbb08,_0x51eba3){if(_0x2bbb08[_0x121e('0x35')]['id']){delete _0x2bbb08['body']['id'];}return db[_0x121e('0x3c')][_0x121e('0x4f')]({'where':{'id':_0x2bbb08[_0x121e('0x45')]['id']}})[_0x121e('0x1c')](function(_0x2148f5){if(!_0x2148f5){logger['error'](_0x121e('0x6a'),'abandon',0x194,_0x121e('0x6b'));_0x51eba3['sendStatus'](0x194);}else{if(_0x2148f5[_0x121e('0x6c')]){throw new db['Sequelize'][(_0x121e('0x60'))](_0x121e('0x6d'));}}return _0x2148f5;})[_0x121e('0x1c')](function(_0x5bc026){if(_0x5bc026){return _0x5bc026[_0x121e('0x2e')]({'closed':_0x2bbb08['body'][_0x121e('0x6e')],'disposition':_0x2bbb08[_0x121e('0x35')][_0x121e('0x6f')]})['then'](function(_0xeb7eab){return _0xeb7eab;});}})[_0x121e('0x1c')](function(){return respondWithRpcPromise(_0x121e('0x70'),_0x121e('0x69'),_0x2bbb08[_0x121e('0x35')],client9004);})[_0x121e('0x1c')](respondWithResult(_0x51eba3,null))[_0x121e('0x25')](handleError(_0x51eba3,null));};exports[_0x121e('0x71')]=function(_0x112ab5,_0x5bbac6){_0x112ab5[_0x121e('0x35')]['name']=_0x112ab5[_0x121e('0x72')][_0x121e('0x73')];_0x112ab5[_0x121e('0x35')]['basename']=_0x112ab5[_0x121e('0x72')][_0x121e('0x74')];_0x112ab5[_0x121e('0x35')][_0x121e('0x75')]=_0x112ab5[_0x121e('0x72')][_0x121e('0x76')];return db[_0x121e('0x77')][_0x121e('0x78')](_0x112ab5['body'])['then'](respondWithResult(_0x5bbac6,0xc9))[_0x121e('0x25')](handleError(_0x5bbac6,null));};exports[_0x121e('0x79')]=function(_0xe8f66c,_0x16793c){return db[_0x121e('0x3c')][_0x121e('0x52')]({'where':{'id':_0xe8f66c[_0x121e('0x45')]['id']},'raw':!![]})[_0x121e('0x1c')](handleEntityNotFound(_0x16793c,null))[_0x121e('0x1c')](function(_0x264303){if(_0x264303){if(_0x264303[_0x121e('0x6e')]){return _0x16793c['status'](0x193)[_0x121e('0x28')]({'status':0x193,'message':_0x121e('0x7a')});}return db[_0x121e('0x77')]['findOne']({'where':{'id':_0xe8f66c['query'][_0x121e('0x7b')]},'raw':!![]})[_0x121e('0x1c')](handleEntityNotFound(_0x16793c,null));}})['then'](function(_0x2241e7){if(_0x2241e7){var _0x10afb9=_0x2241e7[_0x121e('0x7c')]!==null;var _0x51ca8b=path[_0x121e('0x7d')](config[_0x121e('0x7e')],_0x121e('0x7f'));if(_0x10afb9){_0x51ca8b=path[_0x121e('0x7d')](_0x51ca8b,_0x121e('0x80'));}var _0x3e1ec3=path[_0x121e('0x7d')](_0x51ca8b,_0x2241e7[_0x121e('0x81')]);return _0x16793c['download'](_0x3e1ec3);}})[_0x121e('0x25')](handleError(_0x16793c,null));};exports[_0x121e('0x82')]=function(_0x638733,_0x573095){var _0x44c139=null;var _0x11e2e6=null;var _0x2ccda7=null;if(_0x638733[_0x121e('0x35')]['id']){delete _0x638733[_0x121e('0x35')]['id'];}if(_0x638733[_0x121e('0x35')]['mailTranscript']){_0x2ccda7=path[_0x121e('0x7d')](config[_0x121e('0x7e')],_0x121e('0x83'),util['format'](_0x121e('0x84'),Date[_0x121e('0x85')]()));_0x638733['body']['pathTranscript']=_0x2ccda7;}return db[_0x121e('0x3c')]['find']({'where':{'id':_0x638733[_0x121e('0x45')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x121e('0x86'),'include':[{'model':db[_0x121e('0x87')],'as':'User'}]}]})[_0x121e('0x1c')](handleEntityNotFound(_0x573095,null))['then'](saveUpdates(_0x638733[_0x121e('0x35')],null))[_0x121e('0x1c')](function(_0x13b5f6){if(_0x13b5f6){_0x44c139=_0x13b5f6;return db[_0x121e('0x53')][_0x121e('0x4f')]({'where':{'id':_0x44c139[_0x121e('0x54')]}});}})['then'](function(_0x69ebf6){if(_0x69ebf6){_0x11e2e6=_0x69ebf6;return db[_0x121e('0x67')][_0x121e('0x4f')]({'where':{'id':_0x44c139[_0x121e('0x88')]}});}})[_0x121e('0x1c')](function(_0x3dd7e7){if(_0x3dd7e7){if(_0x2ccda7){var _0x5e5cc4=null;for(var _0x2b4a82=0x1;_0x2b4a82<_0x44c139['Messages'][_0x121e('0x4c')];++_0x2b4a82){_0x5e5cc4=_0x44c139['Messages'][_0x2b4a82];var _0x1af90a=_0x5e5cc4[_0x121e('0x6c')]?util[_0x121e('0x89')]('%s%d',_0x11e2e6[_0x121e('0x8a')],_0x5e5cc4[_0x121e('0x6c')]):_0x121e('0x8b');var _0x38c05f=_0x638733[_0x121e('0x35')][_0x121e('0x8c')]||util['format'](_0x121e('0x8d'),_0x121e('0x8e'),_0x5e5cc4[_0x121e('0x88')]);switch(_0x11e2e6[_0x121e('0x8f')]){case _0x121e('0x90'):_0x1af90a=_0x5e5cc4[_0x121e('0x6c')]?util[_0x121e('0x89')](_0x121e('0x8d'),_0x11e2e6[_0x121e('0x8a')],_0x5e5cc4['UserId']):_0x121e('0x8b');break;case _0x121e('0x91'):_0x1af90a=_0x5e5cc4[_0x121e('0x6c')]?_0x5e5cc4[_0x121e('0x87')][_0x121e('0x92')]||_0x5e5cc4[_0x121e('0x87')]['fullname']:_0x121e('0x8b');break;case _0x121e('0x93'):_0x1af90a=_0x5e5cc4[_0x121e('0x6c')]?_0x5e5cc4['User'][_0x121e('0x5a')]:'System';break;default:_0x1af90a=_0x5e5cc4[_0x121e('0x6c')]?util[_0x121e('0x89')](_0x121e('0x8d'),_0x11e2e6[_0x121e('0x8a')],_0x5e5cc4['UserId']):'System';}var _0x58f38a=util[_0x121e('0x89')]('[%s]\x20%s:\x20%s\x0a',moment(_0x5e5cc4[_0x121e('0x94')])[_0x121e('0x89')](_0x121e('0x95')),_0x5e5cc4['direction']==='in'?_0x38c05f:_0x1af90a,_0x5e5cc4[_0x121e('0x35')]);if(!_0x5e5cc4['secret']){fs[_0x121e('0x96')](_0x2ccda7,_0x58f38a);}}return db[_0x121e('0x97')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x121e('0x98')],'as':_0x121e('0x99'),'raw':!![],'include':[{'model':db[_0x121e('0x9a')],'as':'CloudProvider','raw':!![]}]}]});}}})['then'](function(_0xc1d2f7){if(!_0xc1d2f7||!_0xc1d2f7[_0x121e('0x99')]||!_0x638733[_0x121e('0x35')])return _0x44c139;var _0x44e101=_0xc1d2f7['getSmtpOptions']();return respondWithRpcPromise(_0x121e('0x9b'),_0x121e('0x9c'),{'account':_0x44e101,'message':{'from':util['format'](_0x121e('0x9d'),_0xc1d2f7[_0x121e('0x31')],_0xc1d2f7[_0x121e('0x9e')]||_0xc1d2f7[_0x121e('0x99')]['user']),'to':_0x638733[_0x121e('0x35')][_0x121e('0x9f')],'subject':_0x121e('0xa0'),'text':util[_0x121e('0x89')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x638733[_0x121e('0x35')][_0x121e('0x9f')]),'attachments':[{'path':_0x2ccda7}]}})[_0x121e('0x1c')](function(){return _0x44c139;})[_0x121e('0x25')](function(_0x5577f4){logger[_0x121e('0x23')](_0x5577f4);});})['then'](respondWithStatusCode(_0x573095,0xc8))[_0x121e('0x25')](handleError(_0x573095,null));};exports['addMessage']=function(_0xffce4d,_0x3e6e40){return db[_0x121e('0xa1')][_0x121e('0x4f')]({'where':{'id':_0xffce4d[_0x121e('0x45')]['id']}})[_0x121e('0x1c')](handleEntityNotFound(_0x3e6e40,null))['then'](function(_0x5f491a){if(_0x5f491a){return _0x5f491a[_0x121e('0xa2')](_0xffce4d['body'][_0x121e('0xa3')],_[_0x121e('0xa4')](_0xffce4d[_0x121e('0x35')],[_0x121e('0xa3'),'id'])||{});}})[_0x121e('0x1c')](respondWithResult(_0x3e6e40,null))[_0x121e('0x25')](handleError(_0x3e6e40,null));};exports['getMessages']=function(_0xc5e636,_0x68a692){var _0x757807={'raw':![],'where':{}};var _0x4d809a={};var _0x25aa5e={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0xc5e636[_0x121e('0x45')]['id']}})[_0x121e('0x1c')](handleEntityNotFound(_0x68a692,null))[_0x121e('0x1c')](function(_0x2417a6){if(_0x2417a6){_0x4d809a[_0x121e('0x46')]=_[_0x121e('0xa5')](db[_0x121e('0xa1')][_0x121e('0x47')]);_0x4d809a['query']=_[_0x121e('0xa5')](_0xc5e636[_0x121e('0x42')]);_0x4d809a['filters']=_['intersection'](_0x4d809a[_0x121e('0x46')],_0x4d809a[_0x121e('0x42')]);_0x757807[_0x121e('0x4b')]=_[_0x121e('0x49')](_0x4d809a[_0x121e('0x46')],qs[_0x121e('0x4a')](_0xc5e636[_0x121e('0x42')][_0x121e('0x4a')]));_0x757807['attributes']=_0x757807['attributes']['length']?_0x757807[_0x121e('0x4b')]:_0x4d809a[_0x121e('0x46')];if(!_0xc5e636[_0x121e('0x42')][_0x121e('0xa6')](_0x121e('0xa7'))){_0x757807[_0x121e('0x2b')]=qs['limit'](_0xc5e636[_0x121e('0x42')][_0x121e('0x2b')]);_0x757807['offset']=qs[_0x121e('0x29')](_0xc5e636[_0x121e('0x42')][_0x121e('0x29')]);}_0x757807['order']=qs[_0x121e('0xa8')](_0xc5e636[_0x121e('0x42')][_0x121e('0xa8')]);_0x757807['where']=qs[_0x121e('0x48')](_[_0x121e('0xa9')](_0xc5e636[_0x121e('0x42')],_0x4d809a['filters']));_0x757807['where'][_0x121e('0xaa')]=_0x2417a6['id'];if(_0xc5e636['query']['filter']){_0x757807['where']=_[_0x121e('0x34')](_0x757807[_0x121e('0xab')],{'$or':_[_0x121e('0x3b')](_0x757807['attributes'],function(_0x31a969){var _0x11c4cc={};_0x11c4cc[_0x31a969]={'$like':'%'+_0xc5e636[_0x121e('0x42')]['filter']+'%'};return _0x11c4cc;})});}if(_0xc5e636[_0x121e('0x42')][_0x121e('0xac')]){var _0xae1016=_0xc5e636[_0x121e('0x42')][_0x121e('0xac')][_0x121e('0xad')](',');var _0x3faba0={};_0x3faba0[_0xae1016[0x0]]={'$gte':moment(_0xae1016[0x1])[_0x121e('0x89')](_0x121e('0xae'))};_0x757807[_0x121e('0xab')]=_[_0x121e('0x34')](_0x757807['where'],_0x3faba0);}_0x757807=_[_0x121e('0x34')]({},_0x757807,_0xc5e636[_0x121e('0xaf')]);return db[_0x121e('0xa1')][_0x121e('0x2c')]({'where':_0x757807[_0x121e('0xab')]})[_0x121e('0x1c')](function(_0x1b9872){_0x25aa5e[_0x121e('0x2c')]=_0x1b9872;if(_0xc5e636[_0x121e('0x42')][_0x121e('0x4d')]){_0x757807[_0x121e('0x4e')]=[{'all':!![]}];}return db[_0x121e('0xa1')][_0x121e('0x40')](_0x757807);})['then'](function(_0x37e4b8){_0x25aa5e[_0x121e('0xb0')]=_0x37e4b8;return _0x25aa5e;});}})[_0x121e('0x1c')](respondWithFilteredResult(_0x68a692,_0x757807))[_0x121e('0x25')](handleError(_0x68a692,null));};exports[_0x121e('0xb1')]=function(_0x22b285,_0x479e23){var _0x35727f={'where':{}},_0x18c2ce={},_0x1e8f3f={'count':0x0,'rows':[]};return db[_0x121e('0x3c')][_0x121e('0x52')]({'where':{'id':_0x22b285[_0x121e('0x45')]['id']}})[_0x121e('0x1c')](handleEntityNotFound(_0x479e23,null))[_0x121e('0x1c')](function(_0x155a52){if(_0x155a52){_0x18c2ce[_0x121e('0x46')]=_[_0x121e('0xa5')](db[_0x121e('0xa1')][_0x121e('0x47')]);_0x18c2ce[_0x121e('0x42')]=_[_0x121e('0xa5')](_0x22b285[_0x121e('0x42')]);_0x18c2ce['filters']=_['intersection'](_0x18c2ce[_0x121e('0x46')],_0x18c2ce['query']);_0x35727f[_0x121e('0x4b')]=_[_0x121e('0x49')](_0x18c2ce[_0x121e('0x46')],qs['fields'](_0x22b285[_0x121e('0x42')][_0x121e('0x4a')]));_0x35727f['attributes']=_0x35727f[_0x121e('0x4b')][_0x121e('0x4c')]?_0x35727f[_0x121e('0x4b')]:_0x18c2ce[_0x121e('0x46')];if(!_0x22b285['query'][_0x121e('0xa6')](_0x121e('0xa7'))){_0x35727f[_0x121e('0x2b')]=qs[_0x121e('0x2b')](_0x22b285[_0x121e('0x42')][_0x121e('0x2b')]);_0x35727f[_0x121e('0x29')]=qs['offset'](_0x22b285['query'][_0x121e('0x29')]);}_0x35727f[_0x121e('0xb2')]=qs[_0x121e('0xa8')](_0x22b285[_0x121e('0x42')]['sort']);_0x35727f['where']=qs[_0x121e('0x48')](_[_0x121e('0xa9')](_0x22b285[_0x121e('0x42')],_0x18c2ce[_0x121e('0x48')]));_0x35727f[_0x121e('0xab')][_0x121e('0xaa')]=_0x155a52['id'];if(_0x22b285[_0x121e('0x42')][_0x121e('0xb3')]){_0x35727f['where']=_[_0x121e('0x34')](_0x35727f[_0x121e('0xab')],{'$or':_[_0x121e('0x3b')](_0x35727f[_0x121e('0x4b')],function(_0x25c78f){var _0x4c1e46={};_0x4c1e46[_0x25c78f]={'$like':'%'+_0x22b285['query']['filter']+'%'};return _0x4c1e46;})});}_0x35727f['where'][_0x121e('0xb4')]=![];if(_0x22b285['query']['id']){_0x35727f[_0x121e('0xab')]['id']={'$gt':_0x22b285[_0x121e('0x42')]['id']};}_0x35727f=_['merge']({},_0x35727f,_0x22b285[_0x121e('0xaf')]);return db[_0x121e('0xa1')][_0x121e('0x2c')]({'where':_0x35727f['where']})[_0x121e('0x1c')](function(_0x112d90){_0x1e8f3f['count']=_0x112d90;_0x35727f[_0x121e('0x4e')]=[];if(_0x22b285['query'][_0x121e('0xb5')]){_0x35727f['include'][_0x121e('0xb6')]({'model':db[_0x121e('0x87')],'as':_0x121e('0x87'),'attributes':['id','fullname',_0x121e('0x92')]});}if(_0x22b285['query'][_0x121e('0x4d')]){_0x35727f[_0x121e('0x4e')]=[{'all':!![]}];}return db[_0x121e('0xa1')][_0x121e('0x40')](_0x35727f);})[_0x121e('0x1c')](function(_0x2a5b99){_0x1e8f3f[_0x121e('0xb0')]=_0x2a5b99;return _0x1e8f3f;});}})[_0x121e('0x1c')](respondWithFilteredResult(_0x479e23,_0x35727f))[_0x121e('0x25')](handleError(_0x479e23,null));};exports['addTags']=function(_0x4f69ee,_0x282a47){return db[_0x121e('0x3c')]['find']({'where':{'id':_0x4f69ee[_0x121e('0x45')]['id']}})[_0x121e('0x1c')](handleEntityNotFound(_0x282a47,null))[_0x121e('0x1c')](function(_0x3d3dcf){if(_0x3d3dcf){return _0x3d3dcf[_0x121e('0xb7')](_0x4f69ee['body'][_0x121e('0xa3')],_['omit'](_0x4f69ee[_0x121e('0x35')],['ids','id'])||{})[_0x121e('0xb8')](function(){return db[_0x121e('0xb9')][_0x121e('0x40')]({'attributes':['id',_0x121e('0x31'),'color'],'where':{'id':_0x4f69ee['body'][_0x121e('0xa3')]}});})[_0x121e('0x1c')](function(_0x2a7b2f){socket[_0x121e('0xba')](_0x121e('0xbb'),{'id':Number(_0x4f69ee[_0x121e('0x45')]['id']),'tags':_0x2a7b2f||[]});return{'id':Number(_0x4f69ee[_0x121e('0x45')]['id']),'tags':_0x2a7b2f||[]};});}})[_0x121e('0x1c')](respondWithResult(_0x282a47,null))[_0x121e('0x25')](handleError(_0x282a47,null));};exports[_0x121e('0xbc')]=function(_0x1a98e9,_0x26c8b0){return db[_0x121e('0x3c')][_0x121e('0x4f')]({'where':{'id':_0x1a98e9[_0x121e('0x45')]['id']}})[_0x121e('0x1c')](handleEntityNotFound(_0x26c8b0,null))[_0x121e('0x1c')](function(_0xffef0){if(_0xffef0){return _0xffef0[_0x121e('0xbc')](_0x1a98e9['query']['ids']);}})[_0x121e('0x1c')](respondWithStatusCode(_0x26c8b0,null))['catch'](handleError(_0x26c8b0,null));};exports[_0x121e('0xbd')]=function(_0x255d40,_0x586c88){var _0x538c3f=moment()[_0x121e('0xbe')]()[_0x121e('0xbf')]();var _0x2f5b6e=path[_0x121e('0x7d')](config[_0x121e('0x7e')],_0x121e('0xc0'),_0x121e('0xc1'),_0x121e('0xc2'));var _0x5ec2=path[_0x121e('0x7d')](config[_0x121e('0x7e')],'server',_0x121e('0xc1'),_0x121e('0xc3'));var _0x2a9477=path[_0x121e('0x7d')](_0x2f5b6e,_0x538c3f);var _0x5f4c68=util[_0x121e('0x89')](_0x121e('0xc4'),_0x255d40[_0x121e('0x45')]['id'],_0x538c3f);var _0x5a68a5=path['join'](_0x2f5b6e,_0x5f4c68);var _0x13cf3b=[];_0x13cf3b[_0x121e('0xb6')]({'model':db[_0x121e('0x87')],'as':'User','attributes':['id',_0x121e('0x5a')],'raw':!![]});_0x13cf3b[_0x121e('0xb6')]({'model':db[_0x121e('0x67')],'as':_0x121e('0x68'),'attributes':['id','firstName',_0x121e('0xc5')],'raw':!![]});if(_0x255d40['query']['attachments']){_0x13cf3b[_0x121e('0xb6')]({'model':db[_0x121e('0x77')],'as':_0x121e('0x77'),'raw':!![]});}var _0x224d1a=[{'model':db[_0x121e('0xa1')],'as':'Messages','attributes':['id','body','createdAt',_0x121e('0xc6'),'secret',_0x121e('0xc7')],'include':_0x13cf3b}];_0x224d1a['push']({'model':db['ChatWebsite'],'as':_0x121e('0xc8'),'attributes':['id',_0x121e('0x31')]});_0x224d1a['push']({'model':db['User'],'as':_0x121e('0xc9'),'attributes':['id',_0x121e('0x5a')]});return db[_0x121e('0x3c')]['find']({'where':{'id':_0x255d40['params']['id']},'include':_0x224d1a})[_0x121e('0x1c')](handleEntityNotFound(_0x586c88,null))[_0x121e('0x1c')](function(_0x34f31a){if(_0x34f31a){var _0x3da3dc=_0x34f31a['get']({'plain':!![]});fs[_0x121e('0xca')](_0x2a9477);var _0x1b3229={'channel':_0x121e('0xcb'),'account':_0x3da3dc[_0x121e('0xc8')][_0x121e('0x31')],'agent':_0x3da3dc[_0x121e('0xc9')]?_0x3da3dc[_0x121e('0xc9')][_0x121e('0x5a')]:_0x121e('0xcc'),'createdAt':moment(_0x3da3dc['createdAt'])[_0x121e('0x89')]('YYYY-MM-DD\x20HH:mm:ss')[_0x121e('0xbf')](),'closedAt':_0x3da3dc['closed']?moment(_0x3da3dc['closedAt'])[_0x121e('0x89')](_0x121e('0xae'))[_0x121e('0xbf')]():'','disposition':_0x3da3dc['disposition'],'chatInfo':{'browser':_0x3da3dc[_0x121e('0xcd')],'os':_0x3da3dc['osName'],'referer':_0x3da3dc['referer'],'customerIp':_0x3da3dc[_0x121e('0xce')],'customerPort':_0x3da3dc[_0x121e('0xcf')]?_0x3da3dc['customerPort']:'N.A.'},'messages':_(_0x3da3dc[_0x121e('0x86')])[_0x121e('0xd0')]()[_0x121e('0xb3')]({'secret':![]})[_0x121e('0x3b')](function(_0x5b8a25){if(_0x5b8a25['Attachment']){var _0x15af1a=path['join'](_0x5ec2,_0x5b8a25[_0x121e('0x77')][_0x121e('0x81')]);if(fs['existsSync'](_0x15af1a)){fs[_0x121e('0xd1')](_0x15af1a)['pipe'](fs[_0x121e('0xd2')](path[_0x121e('0x7d')](_0x2a9477,_0x5b8a25['Attachment'][_0x121e('0x81')])));}}return{'date':moment(_0x5b8a25[_0x121e('0x94')])[_0x121e('0x89')](_0x121e('0xae'))[_0x121e('0xbf')](),'sender':_0x5b8a25[_0x121e('0xc6')]===_0x121e('0x64')?_0x5b8a25['User']?_0x5b8a25[_0x121e('0x87')][_0x121e('0x5a')]:_0x121e('0x8b'):_0x5b8a25[_0x121e('0x68')][_0x121e('0xd3')]+(_0x5b8a25[_0x121e('0x68')][_0x121e('0xc5')]?'\x20'+_0x5b8a25[_0x121e('0x68')][_0x121e('0xc5')]:''),'body':_0x5b8a25[_0x121e('0x77')]?_0x5b8a25[_0x121e('0x77')]['basename']:_0x5b8a25[_0x121e('0x35')],'direction':_0x5b8a25['direction']==='out'?'A':'C','secret':_0x5b8a25['secret'],'read':_0x5b8a25[_0x121e('0xc7')],'attachment':_0x5b8a25[_0x121e('0x77')]};})[_0x121e('0xd4')]()};return ejs['renderFile'](path[_0x121e('0x7d')](config[_0x121e('0x7e')],'server','views',_0x121e('0xd5')),{'interaction':_0x1b3229})[_0x121e('0x1c')](function(_0x1431cd){var _0x1c433e=path[_0x121e('0x7d')](_0x2a9477,_0x121e('0xd6')+_0x3da3dc['id']+'-'+_0x538c3f+_0x121e('0xd7'));var _0x3bcba8={'path':_0x1c433e,'channel':'Chat','interactionId':_0x3da3dc['id']};return pdf[_0x121e('0xd8')](_0x1431cd,_0x3bcba8);})[_0x121e('0x1c')](function(){return new Promise(function(_0x475a4c,_0x123d80){zipdir(_0x2a9477,{'saveTo':_0x5a68a5},function(_0x125118,_0x1e38ce){if(_0x125118)return _0x123d80(_0x125118);return _0x475a4c(_0x1e38ce);});})[_0x121e('0x1c')](function(){return new BPromise(function(_0x255ddd,_0x930df9){rimraf(_0x2a9477,function(_0x4b1a5e){if(_0x4b1a5e)_0x930df9(_0x4b1a5e);return _0x255ddd();});});})[_0x121e('0x1c')](function(){return _0x586c88[_0x121e('0xbd')](_0x5a68a5,_0x5f4c68,function(_0x23a343){if(_0x23a343){logger[_0x121e('0x23')](_0x121e('0xd9'),_0x23a343);}else{fs[_0x121e('0xda')](_0x5a68a5);}});});});}else{return _0x586c88[_0x121e('0x26')](0xc8);}})[_0x121e('0x25')](handleError(_0x586c88,null));}; \ No newline at end of file +var _0x3fd4=['limit','count','set','Content-Range','update','destroy','name','send','render','merge','agent','interaction','account','index','map','rawAttributes','fieldName','type','getOptions','findAll','user','show','keys','ChatInteraction','query','filters','intersection','model','fields','attributes','length','includeAll','include','options','find','create','body','params','describe','findOne','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','root','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','ContactId','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','fullname','agent_fullname','createdAt','direction','secret','appendFileSync','MailServerOut','Smtp','SendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','sort','where','pick','ChatInteractionId','filter','$gte','getMyMessages','order','push','rows','addTags','setTags','spread','Tag','color','removeTags','unix','tmp','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','read','ChatWebsite','get','mkdirSync','Chat','Account','Owner','YYYY-MM-DD\x20HH:mm:ss','toString','browserName','osName','customerPort','N.A.','tail','existsSync','createReadStream','createWriteStream','out','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','request-promise','bluebird','mustache','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','ChatInteraction,\x20%s,\x20%s','catch','sendStatus','status','end','json','offset','undefined'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x3fd4,0x165));var _0x43fd=function(_0x43d440,_0x30a005){_0x43d440=_0x43d440-0x0;var _0x58a4ed=_0x3fd4[_0x43d440];return _0x58a4ed;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var rp=require(_0x43fd('0x0'));var moment=require('moment');var BPromise=require(_0x43fd('0x1'));var Mustache=require(_0x43fd('0x2'));var util=require('util');var path=require('path');var ejs=require(_0x43fd('0x3'));var fs=require('fs');var _=require(_0x43fd('0x4'));var Redis=require(_0x43fd('0x5'));var interaction=require(_0x43fd('0x6'));var qs=require(_0x43fd('0x7'));var pdf=require('../../components/export/pdf');var logger=require(_0x43fd('0x8'))(_0x43fd('0x9'));var config=require(_0x43fd('0xa'));var db=require('../../mysqldb')['db'];config[_0x43fd('0xb')]=_[_0x43fd('0xc')](config[_0x43fd('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x43fd('0xd'))(new Redis(config[_0x43fd('0xb')]));require('./chatInteraction.socket')[_0x43fd('0xe')](socket);var jayson=require(_0x43fd('0xf'));var client=jayson[_0x43fd('0x10')][_0x43fd('0x11')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x291a2f,_0x15dcba,_0x3903c3,_0x28f1ec){return new BPromise(function(_0x5c3248,_0x5c4cce){var _0x3eae2d=_0x28f1ec||client;return _0x3eae2d[_0x43fd('0x12')](_0x291a2f,_0x3903c3)[_0x43fd('0x13')](function(_0x2dc839){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x15dcba,_0x43fd('0x14'));logger[_0x43fd('0x15')](_0x43fd('0x16'),_0x15dcba,'request\x20sent',JSON[_0x43fd('0x17')](_0x2dc839));if(_0x2dc839['error']){if(_0x2dc839['error'][_0x43fd('0x18')]===0x1f4){logger[_0x43fd('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x15dcba,_0x2dc839['error'][_0x43fd('0x1a')]);return _0x5c4cce(_0x2dc839[_0x43fd('0x19')][_0x43fd('0x1a')]);}logger['error'](_0x43fd('0x1b'),_0x15dcba,_0x2dc839[_0x43fd('0x19')][_0x43fd('0x1a')]);return _0x5c3248(_0x2dc839[_0x43fd('0x19')][_0x43fd('0x1a')]);}else{logger['info'](_0x43fd('0x1b'),_0x15dcba,_0x43fd('0x14'));_0x5c3248(_0x2dc839['result'][_0x43fd('0x1a')]);}})[_0x43fd('0x1c')](function(_0x23c381){logger[_0x43fd('0x19')](_0x43fd('0x1b'),_0x15dcba,_0x23c381);_0x5c4cce(_0x23c381);});});}function respondWithStatusCode(_0x3c199c,_0x53fbf6){_0x53fbf6=_0x53fbf6||0xcc;return function(_0x2c283d){if(_0x2c283d){return _0x3c199c[_0x43fd('0x1d')](_0x53fbf6);}return _0x3c199c[_0x43fd('0x1e')](_0x53fbf6)[_0x43fd('0x1f')]();};}function respondWithResult(_0x12cdda,_0x7ee0ab){_0x7ee0ab=_0x7ee0ab||0xc8;return function(_0x45bfd2){if(_0x45bfd2){return _0x12cdda['status'](_0x7ee0ab)[_0x43fd('0x20')](_0x45bfd2);}};}function respondWithFilteredResult(_0x57e5eb,_0x34b44b){return function(_0x98b728){if(_0x98b728){var _0x1ca613=typeof _0x34b44b[_0x43fd('0x21')]===_0x43fd('0x22')&&typeof _0x34b44b[_0x43fd('0x23')]===_0x43fd('0x22');var _0x2679c3=_0x98b728[_0x43fd('0x24')];var _0x57ce36=_0x1ca613?0x0:_0x34b44b[_0x43fd('0x21')];var _0x48bafe=_0x1ca613?_0x98b728[_0x43fd('0x24')]:_0x34b44b[_0x43fd('0x21')]+_0x34b44b[_0x43fd('0x23')];var _0x1bae69;if(_0x48bafe>=_0x2679c3){_0x48bafe=_0x2679c3;_0x1bae69=0xc8;}else{_0x1bae69=0xce;}_0x57e5eb[_0x43fd('0x1e')](_0x1bae69);return _0x57e5eb[_0x43fd('0x25')](_0x43fd('0x26'),_0x57ce36+'-'+_0x48bafe+'/'+_0x2679c3)[_0x43fd('0x20')](_0x98b728);}return null;};}function saveUpdates(_0x3869c3){return function(_0x3bd390){if(_0x3bd390){return _0x3bd390[_0x43fd('0x27')](_0x3869c3)['then'](function(_0x36e547){return _0x36e547;});}return null;};}function removeEntity(_0x3a7153){return function(_0x3cde15){if(_0x3cde15){return _0x3cde15[_0x43fd('0x28')]()[_0x43fd('0x13')](function(){_0x3a7153[_0x43fd('0x1e')](0xcc)[_0x43fd('0x1f')]();});}};}function handleEntityNotFound(_0x43f14c){return function(_0x5750ef){if(!_0x5750ef){_0x43f14c['sendStatus'](0x194);}return _0x5750ef;};}function handleError(_0x53caa1,_0x1785a5){_0x1785a5=_0x1785a5||0x1f4;return function(_0x34af13){logger[_0x43fd('0x19')](_0x34af13['stack']);if(_0x34af13[_0x43fd('0x29')]){delete _0x34af13[_0x43fd('0x29')];}_0x53caa1[_0x43fd('0x1e')](_0x1785a5)[_0x43fd('0x2a')](_0x34af13);};}function getMustacheRender(_0x1275ce,_0x469be0){return Mustache[_0x43fd('0x2b')](_0x1275ce,_[_0x43fd('0x2c')](_0x469be0['body'],{'contact':_0x469be0['contact'],'message':_0x469be0[_0x43fd('0x1a')],'agent':_0x469be0[_0x43fd('0x2d')],'interaction':_0x469be0[_0x43fd('0x2e')],'account':_0x469be0[_0x43fd('0x2f')]}))||'';}exports[_0x43fd('0x30')]=function(_0xa9a204,_0x5ea1cd){var _0x1038ff={};var _0x178e02=_[_0x43fd('0x31')](db['ChatInteraction'][_0x43fd('0x32')],function(_0x2bf6c8){return{'name':_0x2bf6c8[_0x43fd('0x33')],'type':_0x2bf6c8[_0x43fd('0x34')]['key']};});_0x1038ff=qs[_0x43fd('0x35')](_0x178e02,_0xa9a204);return interaction[_0x43fd('0x36')]('chat',_0xa9a204['query'],_0xa9a204[_0x43fd('0x37')],_0x1038ff,_0x178e02)['then'](respondWithFilteredResult(_0x5ea1cd,_0x1038ff))[_0x43fd('0x1c')](handleError(_0x5ea1cd,null));};exports[_0x43fd('0x38')]=function(_0xfcff7c,_0x1a02fa){var _0x478367={'raw':![],'where':{'id':_0xfcff7c['params']['id']}},_0x1c2987={};_0x1c2987['model']=_[_0x43fd('0x39')](db[_0x43fd('0x3a')][_0x43fd('0x32')]);_0x1c2987[_0x43fd('0x3b')]=_[_0x43fd('0x39')](_0xfcff7c[_0x43fd('0x3b')]);_0x1c2987[_0x43fd('0x3c')]=_[_0x43fd('0x3d')](_0x1c2987[_0x43fd('0x3e')],_0x1c2987[_0x43fd('0x3b')]);_0x478367['attributes']=_[_0x43fd('0x3d')](_0x1c2987[_0x43fd('0x3e')],qs[_0x43fd('0x3f')](_0xfcff7c[_0x43fd('0x3b')][_0x43fd('0x3f')]));_0x478367[_0x43fd('0x40')]=_0x478367[_0x43fd('0x40')][_0x43fd('0x41')]?_0x478367[_0x43fd('0x40')]:_0x1c2987[_0x43fd('0x3e')];if(_0xfcff7c['query'][_0x43fd('0x42')]){_0x478367[_0x43fd('0x43')]=[{'all':!![]}];}_0x478367=_[_0x43fd('0x2c')]({},_0x478367,_0xfcff7c[_0x43fd('0x44')]);return db[_0x43fd('0x3a')][_0x43fd('0x45')](_0x478367)[_0x43fd('0x13')](handleEntityNotFound(_0x1a02fa,null))[_0x43fd('0x13')](respondWithResult(_0x1a02fa,null))[_0x43fd('0x1c')](handleError(_0x1a02fa,null));};exports[_0x43fd('0x46')]=function(_0x186420,_0x74a1e3){return db[_0x43fd('0x3a')]['create'](_0x186420[_0x43fd('0x47')],{})[_0x43fd('0x13')](respondWithResult(_0x74a1e3,0xc9))[_0x43fd('0x1c')](handleError(_0x74a1e3,null));};exports['update']=function(_0x675566,_0x14d4ad){if(_0x675566[_0x43fd('0x47')]['id']){delete _0x675566['body']['id'];}return db[_0x43fd('0x3a')][_0x43fd('0x45')]({'where':{'id':_0x675566[_0x43fd('0x48')]['id']}})[_0x43fd('0x13')](handleEntityNotFound(_0x14d4ad,null))[_0x43fd('0x13')](saveUpdates(_0x675566[_0x43fd('0x47')],null))[_0x43fd('0x13')](respondWithResult(_0x14d4ad,null))['catch'](handleError(_0x14d4ad,null));};exports[_0x43fd('0x28')]=function(_0x2a72b8,_0xd98a8b){return db['ChatInteraction'][_0x43fd('0x45')]({'where':{'id':_0x2a72b8[_0x43fd('0x48')]['id']}})[_0x43fd('0x13')](handleEntityNotFound(_0xd98a8b,null))[_0x43fd('0x13')](removeEntity(_0xd98a8b,null))[_0x43fd('0x1c')](handleError(_0xd98a8b,null));};exports[_0x43fd('0x49')]=function(_0x1dabb6,_0x183036){return db[_0x43fd('0x3a')][_0x43fd('0x49')]()[_0x43fd('0x13')](respondWithResult(_0x183036,null))[_0x43fd('0x1c')](handleError(_0x183036,null));};exports['createVidaooSession']=function(_0x33c9f6,_0x440bb1){var _0x2bbb89=_0x33c9f6[_0x43fd('0x48')]['id'];var _0x23eb7e;var _0x1c3e81;var _0x4af990;return db[_0x43fd('0x3a')][_0x43fd('0x4a')]({'where':{'id':_0x2bbb89}})[_0x43fd('0x13')](function(_0x5f3834){_0x23eb7e=_0x5f3834;return db['ChatWebsite'][_0x43fd('0x4a')]({'where':{'id':_0x5f3834[_0x43fd('0x4b')]},'attributes':['id','vidaooApiKey',_0x43fd('0x4c'),_0x43fd('0x4d'),_0x43fd('0x4e'),_0x43fd('0x4f')],'raw':!![]});})[_0x43fd('0x13')](function(_0x22456b){if(_0x22456b&&_0x22456b['vidaooApiKey']&&_0x22456b['vidaooEscalation']){_0x1c3e81=_0x22456b;var _0x4fd3b3={'interaction':{'id':_0x2bbb89},'agent':{'id':_0x33c9f6['user']['id'],'name':_0x33c9f6[_0x43fd('0x37')][_0x43fd('0x29')],'fullname':_0x33c9f6[_0x43fd('0x37')]['fullname'],'email':_0x33c9f6[_0x43fd('0x37')][_0x43fd('0x50')]},'contact':_0x33c9f6['body'][_0x43fd('0x51')],'account':_0x33c9f6['body']['account']};var _0x4c437b={'rejectUnauthorized':![],'method':_0x43fd('0x52'),'url':_0x43fd('0x53'),'headers':{'X-APIKEY':_0x22456b['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x33c9f6[_0x43fd('0x37')][_0x43fd('0x50')]],'buttons':null,'topic':_0x1c3e81[_0x43fd('0x4d')],'note':_[_0x43fd('0x54')](_0x1c3e81['vidaooNote'])?null:getMustacheRender(_0x1c3e81[_0x43fd('0x4e')],_0x4fd3b3),'metadata':null},'redirect':_0x43fd('0x55'),'json':!![]};try{if(!_['isNull'](_0x1c3e81['vidaooMetadata'])){var _0x433b60=getMustacheRender(_0x1c3e81['vidaooMetadata'],_0x4fd3b3);var _0x509036=JSON[_0x43fd('0x56')](_0x433b60);_0x4c437b[_0x43fd('0x47')]['metadata']=_0x509036;}}catch(_0x2939bd){throw new db[(_0x43fd('0x57'))][(_0x43fd('0x58'))](_0x43fd('0x59'));}return rp(_0x4c437b);}else{throw new db['Sequelize'][(_0x43fd('0x58'))](_0x43fd('0x5a'));}})['then'](function(_0x524e98){_0x4af990=_0x524e98;if(_0x4af990['id']){var _0x32d75e={'body':_0x4af990[_0x43fd('0x5b')],'ChatWebsiteId':_0x1c3e81['id'],'ChatInteractionId':_0x23eb7e['id'],'direction':'out','UserId':_0x33c9f6[_0x43fd('0x37')]['id']};return db[_0x43fd('0x5c')][_0x43fd('0x46')](_0x32d75e,{});}else{throw new db[(_0x43fd('0x57'))][(_0x43fd('0x58'))](_0x43fd('0x5d'));}})[_0x43fd('0x13')](function(){return _0x23eb7e[_0x43fd('0x5e')]({'vidaooSessionId':_0x4af990['id']});})[_0x43fd('0x13')](respondWithResult(_0x440bb1,null))['catch'](handleError(_0x440bb1,null));};exports[_0x43fd('0x5f')]=function(_0x1296a9,_0x114149){if(_0x1296a9[_0x43fd('0x47')]['id']){delete _0x1296a9[_0x43fd('0x47')]['id'];}return db[_0x43fd('0x3a')][_0x43fd('0x45')]({'where':{'id':_0x1296a9[_0x43fd('0x48')]['id']},'include':[{'model':db[_0x43fd('0x60')],'as':_0x43fd('0x61')}]})[_0x43fd('0x13')](handleEntityNotFound(_0x114149,null))['then'](saveUpdates(_0x1296a9['body'],null))[_0x43fd('0x13')](respondWithResult(_0x114149,null))[_0x43fd('0x1c')](handleError(_0x114149,null));};exports[_0x43fd('0x62')]=function(_0x3eab69,_0x2cdd6e){if(_0x3eab69['body']['id']){delete _0x3eab69[_0x43fd('0x47')]['id'];}return db[_0x43fd('0x3a')][_0x43fd('0x45')]({'where':{'id':_0x3eab69['params']['id']}})[_0x43fd('0x13')](function(_0x734a5f){if(!_0x734a5f){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x43fd('0x62'),0x194,_0x43fd('0x63'));_0x2cdd6e['sendStatus'](0x194);}else{if(_0x734a5f[_0x43fd('0x64')]){throw new db['Sequelize'][(_0x43fd('0x58'))](_0x43fd('0x65'));}}return _0x734a5f;})['then'](function(_0x418252){if(_0x418252){return _0x418252[_0x43fd('0x27')]({'closed':_0x3eab69[_0x43fd('0x47')][_0x43fd('0x66')],'disposition':_0x3eab69['body'][_0x43fd('0x67')]})['then'](function(_0x40f734){return _0x40f734;});}})[_0x43fd('0x13')](function(){return respondWithRpcPromise('AbandonInteraction',_0x43fd('0x62'),_0x3eab69[_0x43fd('0x47')],client9004);})[_0x43fd('0x13')](respondWithResult(_0x2cdd6e,null))[_0x43fd('0x1c')](handleError(_0x2cdd6e,null));};exports[_0x43fd('0x68')]=function(_0x19e916,_0x3a0302){_0x19e916[_0x43fd('0x47')][_0x43fd('0x29')]=_0x19e916[_0x43fd('0x69')]['originalname'];_0x19e916[_0x43fd('0x47')]['basename']=_0x19e916[_0x43fd('0x69')]['filename'];_0x19e916[_0x43fd('0x47')]['type']=_0x19e916['file'][_0x43fd('0x6a')];return db[_0x43fd('0x6b')][_0x43fd('0x46')](_0x19e916['body'])[_0x43fd('0x13')](respondWithResult(_0x3a0302,0xc9))[_0x43fd('0x1c')](handleError(_0x3a0302,null));};exports[_0x43fd('0x6c')]=function(_0xbe5beb,_0x45b7ee){return db[_0x43fd('0x3a')][_0x43fd('0x4a')]({'where':{'id':_0xbe5beb['params']['id']},'raw':!![]})[_0x43fd('0x13')](handleEntityNotFound(_0x45b7ee,null))[_0x43fd('0x13')](function(_0x51b465){if(_0x51b465){if(_0x51b465[_0x43fd('0x66')]){return _0x45b7ee[_0x43fd('0x1e')](0x193)[_0x43fd('0x20')]({'status':0x193,'message':_0x43fd('0x6d')});}return db[_0x43fd('0x6b')][_0x43fd('0x4a')]({'where':{'id':_0xbe5beb[_0x43fd('0x3b')]['attachId']},'raw':!![]})[_0x43fd('0x13')](handleEntityNotFound(_0x45b7ee,null));}})[_0x43fd('0x13')](function(_0x2b8e25){if(_0x2b8e25){var _0x23983c=_0x2b8e25[_0x43fd('0x6e')]!==null;var _0x11e661=path[_0x43fd('0x6f')](config[_0x43fd('0x70')],'server/files/attachments/');if(_0x23983c){_0x11e661=path[_0x43fd('0x6f')](_0x11e661,'offline-chat/');}var _0x4a8eb2=path[_0x43fd('0x6f')](_0x11e661,_0x2b8e25['basename']);return _0x45b7ee[_0x43fd('0x71')](_0x4a8eb2);}})[_0x43fd('0x1c')](handleError(_0x45b7ee,null));};exports['close']=function(_0x1d7533,_0x9b30b0){var _0x588364=null;var _0x15a491=null;var _0x2258bd=null;if(_0x1d7533[_0x43fd('0x47')]['id']){delete _0x1d7533[_0x43fd('0x47')]['id'];}if(_0x1d7533['body'][_0x43fd('0x72')]){_0x2258bd=path['join'](config[_0x43fd('0x70')],_0x43fd('0x73'),util[_0x43fd('0x74')](_0x43fd('0x75'),Date[_0x43fd('0x76')]()));_0x1d7533[_0x43fd('0x47')][_0x43fd('0x77')]=_0x2258bd;}return db[_0x43fd('0x3a')]['find']({'where':{'id':_0x1d7533[_0x43fd('0x48')]['id']},'include':[{'model':db[_0x43fd('0x5c')],'as':_0x43fd('0x78'),'include':[{'model':db['User'],'as':_0x43fd('0x79')}]}]})['then'](handleEntityNotFound(_0x9b30b0,null))[_0x43fd('0x13')](saveUpdates(_0x1d7533[_0x43fd('0x47')],null))[_0x43fd('0x13')](function(_0x508dda){if(_0x508dda){_0x588364=_0x508dda;return db['ChatWebsite'][_0x43fd('0x45')]({'where':{'id':_0x588364[_0x43fd('0x4b')]}});}})[_0x43fd('0x13')](function(_0x13f0cb){if(_0x13f0cb){_0x15a491=_0x13f0cb;return db['CmContact'][_0x43fd('0x45')]({'where':{'id':_0x588364[_0x43fd('0x7a')]}});}})['then'](function(_0x2b003d){if(_0x2b003d){if(_0x2258bd){var _0x4e8753=null;for(var _0x1c37ae=0x1;_0x1c37ae<_0x588364['Messages'][_0x43fd('0x41')];++_0x1c37ae){_0x4e8753=_0x588364[_0x43fd('0x78')][_0x1c37ae];var _0x1eed7b=_0x4e8753[_0x43fd('0x64')]?util[_0x43fd('0x74')](_0x43fd('0x7b'),_0x15a491[_0x43fd('0x7c')],_0x4e8753[_0x43fd('0x64')]):_0x43fd('0x7d');var _0x5c70f0=_0x1d7533[_0x43fd('0x47')]['customer']||util[_0x43fd('0x74')]('%s%d',_0x43fd('0x7e'),_0x4e8753[_0x43fd('0x7a')]);switch(_0x15a491[_0x43fd('0x7f')]){case _0x43fd('0x80'):_0x1eed7b=_0x4e8753[_0x43fd('0x64')]?util['format']('%s%d',_0x15a491['agentAlias'],_0x4e8753[_0x43fd('0x64')]):_0x43fd('0x7d');break;case _0x43fd('0x81'):_0x1eed7b=_0x4e8753['UserId']?_0x4e8753['User'][_0x43fd('0x82')]||_0x4e8753[_0x43fd('0x79')][_0x43fd('0x83')]:'System';break;case _0x43fd('0x84'):_0x1eed7b=_0x4e8753['UserId']?_0x4e8753[_0x43fd('0x79')][_0x43fd('0x83')]:_0x43fd('0x7d');break;default:_0x1eed7b=_0x4e8753[_0x43fd('0x64')]?util[_0x43fd('0x74')]('%s%d',_0x15a491[_0x43fd('0x7c')],_0x4e8753[_0x43fd('0x64')]):_0x43fd('0x7d');}var _0x417ae8=util[_0x43fd('0x74')]('[%s]\x20%s:\x20%s\x0a',moment(_0x4e8753[_0x43fd('0x85')])[_0x43fd('0x74')]('MM/DD/YYYY\x20HH:mm:ss'),_0x4e8753[_0x43fd('0x86')]==='in'?_0x5c70f0:_0x1eed7b,_0x4e8753[_0x43fd('0x47')]);if(!_0x4e8753[_0x43fd('0x87')]){fs[_0x43fd('0x88')](_0x2258bd,_0x417ae8);}}return db['MailAccount'][_0x43fd('0x4a')]({'where':{'service':!![]},'include':[{'model':db[_0x43fd('0x89')],'as':_0x43fd('0x8a'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}}})['then'](function(_0x5a7165){if(!_0x5a7165||!_0x5a7165['Smtp']||!_0x1d7533[_0x43fd('0x47')])return _0x588364;var _0x396f26=_0x5a7165['getSmtpOptions']();return respondWithRpcPromise(_0x43fd('0x8b'),'sendMail',{'account':_0x396f26,'message':{'from':util[_0x43fd('0x74')](_0x43fd('0x8c'),_0x5a7165[_0x43fd('0x29')],_0x5a7165[_0x43fd('0x50')]||_0x5a7165[_0x43fd('0x8a')][_0x43fd('0x37')]),'to':_0x1d7533[_0x43fd('0x47')][_0x43fd('0x72')],'subject':'Mail\x20Transcript','text':util[_0x43fd('0x74')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x1d7533['body']['mailTranscript']),'attachments':[{'path':_0x2258bd}]}})[_0x43fd('0x13')](function(){return _0x588364;})[_0x43fd('0x1c')](function(_0x77f9a4){logger[_0x43fd('0x19')](_0x77f9a4);});})['then'](respondWithStatusCode(_0x9b30b0,0xc8))['catch'](handleError(_0x9b30b0,null));};exports[_0x43fd('0x8d')]=function(_0x3adcfe,_0x15953f){return db[_0x43fd('0x5c')]['find']({'where':{'id':_0x3adcfe['params']['id']}})[_0x43fd('0x13')](handleEntityNotFound(_0x15953f,null))[_0x43fd('0x13')](function(_0x32b70f){if(_0x32b70f){return _0x32b70f[_0x43fd('0x8d')](_0x3adcfe[_0x43fd('0x47')][_0x43fd('0x8e')],_[_0x43fd('0x8f')](_0x3adcfe[_0x43fd('0x47')],[_0x43fd('0x8e'),'id'])||{});}})[_0x43fd('0x13')](respondWithResult(_0x15953f,null))['catch'](handleError(_0x15953f,null));};exports[_0x43fd('0x90')]=function(_0x24f167,_0x5b7c46){var _0x562b8b={'raw':![],'where':{}};var _0x30c2e9={};var _0x4fcec7={'count':0x0,'rows':[]};return db[_0x43fd('0x3a')][_0x43fd('0x4a')]({'where':{'id':_0x24f167[_0x43fd('0x48')]['id']}})['then'](handleEntityNotFound(_0x5b7c46,null))[_0x43fd('0x13')](function(_0x58a475){if(_0x58a475){_0x30c2e9[_0x43fd('0x3e')]=_['keys'](db[_0x43fd('0x5c')][_0x43fd('0x32')]);_0x30c2e9[_0x43fd('0x3b')]=_[_0x43fd('0x39')](_0x24f167[_0x43fd('0x3b')]);_0x30c2e9[_0x43fd('0x3c')]=_[_0x43fd('0x3d')](_0x30c2e9[_0x43fd('0x3e')],_0x30c2e9[_0x43fd('0x3b')]);_0x562b8b[_0x43fd('0x40')]=_['intersection'](_0x30c2e9[_0x43fd('0x3e')],qs[_0x43fd('0x3f')](_0x24f167[_0x43fd('0x3b')][_0x43fd('0x3f')]));_0x562b8b[_0x43fd('0x40')]=_0x562b8b[_0x43fd('0x40')][_0x43fd('0x41')]?_0x562b8b[_0x43fd('0x40')]:_0x30c2e9['model'];if(!_0x24f167[_0x43fd('0x3b')][_0x43fd('0x91')](_0x43fd('0x92'))){_0x562b8b[_0x43fd('0x23')]=qs[_0x43fd('0x23')](_0x24f167[_0x43fd('0x3b')][_0x43fd('0x23')]);_0x562b8b[_0x43fd('0x21')]=qs['offset'](_0x24f167[_0x43fd('0x3b')][_0x43fd('0x21')]);}_0x562b8b['order']=qs[_0x43fd('0x93')](_0x24f167[_0x43fd('0x3b')][_0x43fd('0x93')]);_0x562b8b[_0x43fd('0x94')]=qs[_0x43fd('0x3c')](_[_0x43fd('0x95')](_0x24f167[_0x43fd('0x3b')],_0x30c2e9[_0x43fd('0x3c')]));_0x562b8b[_0x43fd('0x94')][_0x43fd('0x96')]=_0x58a475['id'];if(_0x24f167[_0x43fd('0x3b')][_0x43fd('0x97')]){_0x562b8b[_0x43fd('0x94')]=_[_0x43fd('0x2c')](_0x562b8b[_0x43fd('0x94')],{'$or':_[_0x43fd('0x31')](_0x562b8b[_0x43fd('0x40')],function(_0x345191){var _0x1575c6={};_0x1575c6[_0x345191]={'$like':'%'+_0x24f167[_0x43fd('0x3b')][_0x43fd('0x97')]+'%'};return _0x1575c6;})});}if(_0x24f167[_0x43fd('0x3b')][_0x43fd('0x98')]){var _0x24acd1=_0x24f167[_0x43fd('0x3b')][_0x43fd('0x98')]['split'](',');var _0x541703={};_0x541703[_0x24acd1[0x0]]={'$gte':moment(_0x24acd1[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x562b8b[_0x43fd('0x94')]=_[_0x43fd('0x2c')](_0x562b8b['where'],_0x541703);}_0x562b8b=_['merge']({},_0x562b8b,_0x24f167['options']);return db[_0x43fd('0x5c')]['count']({'where':_0x562b8b[_0x43fd('0x94')]})[_0x43fd('0x13')](function(_0x47790e){_0x4fcec7[_0x43fd('0x24')]=_0x47790e;if(_0x24f167[_0x43fd('0x3b')]['includeAll']){_0x562b8b[_0x43fd('0x43')]=[{'all':!![]}];}return db[_0x43fd('0x5c')][_0x43fd('0x36')](_0x562b8b);})[_0x43fd('0x13')](function(_0x47b450){_0x4fcec7['rows']=_0x47b450;return _0x4fcec7;});}})[_0x43fd('0x13')](respondWithFilteredResult(_0x5b7c46,_0x562b8b))[_0x43fd('0x1c')](handleError(_0x5b7c46,null));};exports[_0x43fd('0x99')]=function(_0x4677c8,_0x427637){var _0x356ad2={'where':{}},_0x30a2ca={},_0xaf54bc={'count':0x0,'rows':[]};return db[_0x43fd('0x3a')][_0x43fd('0x4a')]({'where':{'id':_0x4677c8[_0x43fd('0x48')]['id']}})[_0x43fd('0x13')](handleEntityNotFound(_0x427637,null))[_0x43fd('0x13')](function(_0x9cb030){if(_0x9cb030){_0x30a2ca[_0x43fd('0x3e')]=_['keys'](db['ChatMessage'][_0x43fd('0x32')]);_0x30a2ca[_0x43fd('0x3b')]=_[_0x43fd('0x39')](_0x4677c8[_0x43fd('0x3b')]);_0x30a2ca[_0x43fd('0x3c')]=_[_0x43fd('0x3d')](_0x30a2ca[_0x43fd('0x3e')],_0x30a2ca[_0x43fd('0x3b')]);_0x356ad2[_0x43fd('0x40')]=_[_0x43fd('0x3d')](_0x30a2ca[_0x43fd('0x3e')],qs[_0x43fd('0x3f')](_0x4677c8[_0x43fd('0x3b')][_0x43fd('0x3f')]));_0x356ad2['attributes']=_0x356ad2[_0x43fd('0x40')][_0x43fd('0x41')]?_0x356ad2['attributes']:_0x30a2ca['model'];if(!_0x4677c8[_0x43fd('0x3b')][_0x43fd('0x91')](_0x43fd('0x92'))){_0x356ad2[_0x43fd('0x23')]=qs[_0x43fd('0x23')](_0x4677c8['query']['limit']);_0x356ad2[_0x43fd('0x21')]=qs[_0x43fd('0x21')](_0x4677c8[_0x43fd('0x3b')][_0x43fd('0x21')]);}_0x356ad2[_0x43fd('0x9a')]=qs[_0x43fd('0x93')](_0x4677c8[_0x43fd('0x3b')][_0x43fd('0x93')]);_0x356ad2[_0x43fd('0x94')]=qs['filters'](_[_0x43fd('0x95')](_0x4677c8[_0x43fd('0x3b')],_0x30a2ca[_0x43fd('0x3c')]));_0x356ad2[_0x43fd('0x94')][_0x43fd('0x96')]=_0x9cb030['id'];if(_0x4677c8[_0x43fd('0x3b')]['filter']){_0x356ad2[_0x43fd('0x94')]=_[_0x43fd('0x2c')](_0x356ad2[_0x43fd('0x94')],{'$or':_[_0x43fd('0x31')](_0x356ad2['attributes'],function(_0x27fd9b){var _0x17f65a={};_0x17f65a[_0x27fd9b]={'$like':'%'+_0x4677c8[_0x43fd('0x3b')]['filter']+'%'};return _0x17f65a;})});}_0x356ad2[_0x43fd('0x94')][_0x43fd('0x87')]=![];if(_0x4677c8[_0x43fd('0x3b')]['id']){_0x356ad2['where']['id']={'$gt':_0x4677c8['query']['id']};}_0x356ad2=_[_0x43fd('0x2c')]({},_0x356ad2,_0x4677c8[_0x43fd('0x44')]);return db[_0x43fd('0x5c')][_0x43fd('0x24')]({'where':_0x356ad2[_0x43fd('0x94')]})['then'](function(_0x227def){_0xaf54bc[_0x43fd('0x24')]=_0x227def;_0x356ad2[_0x43fd('0x43')]=[];if(_0x4677c8[_0x43fd('0x3b')]['includeAgent']){_0x356ad2[_0x43fd('0x43')][_0x43fd('0x9b')]({'model':db['User'],'as':_0x43fd('0x79'),'attributes':['id',_0x43fd('0x83'),'alias']});}if(_0x4677c8[_0x43fd('0x3b')][_0x43fd('0x42')]){_0x356ad2[_0x43fd('0x43')]=[{'all':!![]}];}return db[_0x43fd('0x5c')][_0x43fd('0x36')](_0x356ad2);})[_0x43fd('0x13')](function(_0x1f6582){_0xaf54bc[_0x43fd('0x9c')]=_0x1f6582;return _0xaf54bc;});}})['then'](respondWithFilteredResult(_0x427637,_0x356ad2))['catch'](handleError(_0x427637,null));};exports[_0x43fd('0x9d')]=function(_0xdc5539,_0x1f2893){return db['ChatInteraction'][_0x43fd('0x45')]({'where':{'id':_0xdc5539[_0x43fd('0x48')]['id']}})[_0x43fd('0x13')](handleEntityNotFound(_0x1f2893,null))[_0x43fd('0x13')](function(_0x1abec0){if(_0x1abec0){return _0x1abec0[_0x43fd('0x9e')](_0xdc5539[_0x43fd('0x47')][_0x43fd('0x8e')],_[_0x43fd('0x8f')](_0xdc5539[_0x43fd('0x47')],[_0x43fd('0x8e'),'id'])||{})[_0x43fd('0x9f')](function(){return db[_0x43fd('0xa0')][_0x43fd('0x36')]({'attributes':['id',_0x43fd('0x29'),_0x43fd('0xa1')],'where':{'id':_0xdc5539['body']['ids']}});})[_0x43fd('0x13')](function(_0x18cb14){socket['emit']('chatInteractionTags:save',{'id':Number(_0xdc5539['params']['id']),'tags':_0x18cb14||[]});return{'id':Number(_0xdc5539[_0x43fd('0x48')]['id']),'tags':_0x18cb14||[]};});}})[_0x43fd('0x13')](respondWithResult(_0x1f2893,null))[_0x43fd('0x1c')](handleError(_0x1f2893,null));};exports[_0x43fd('0xa2')]=function(_0x47661b,_0x5235ab){return db[_0x43fd('0x3a')][_0x43fd('0x45')]({'where':{'id':_0x47661b[_0x43fd('0x48')]['id']}})['then'](handleEntityNotFound(_0x5235ab,null))[_0x43fd('0x13')](function(_0x564064){if(_0x564064){return _0x564064[_0x43fd('0xa2')](_0x47661b['query'][_0x43fd('0x8e')]);}})[_0x43fd('0x13')](respondWithStatusCode(_0x5235ab,null))[_0x43fd('0x1c')](handleError(_0x5235ab,null));};exports[_0x43fd('0x71')]=function(_0x2280ca,_0x25fd70){var _0x44431c=moment()[_0x43fd('0xa3')]()['toString']();var _0x456180=path['join'](config[_0x43fd('0x70')],'server','files',_0x43fd('0xa4'));var _0x46d8bd=path[_0x43fd('0x6f')](config[_0x43fd('0x70')],_0x43fd('0xa5'),_0x43fd('0xa6'),_0x43fd('0xa7'));var _0x554d5d=path[_0x43fd('0x6f')](_0x456180,_0x44431c);var _0x2738f1=util[_0x43fd('0x74')](_0x43fd('0xa8'),_0x2280ca[_0x43fd('0x48')]['id'],_0x44431c);var _0x331fd4=path[_0x43fd('0x6f')](_0x456180,_0x2738f1);var _0x56f882=[];_0x56f882[_0x43fd('0x9b')]({'model':db['User'],'as':_0x43fd('0x79'),'attributes':['id',_0x43fd('0x83')],'raw':!![]});_0x56f882[_0x43fd('0x9b')]({'model':db[_0x43fd('0x60')],'as':_0x43fd('0x61'),'attributes':['id',_0x43fd('0xa9'),_0x43fd('0xaa')],'raw':!![]});if(_0x2280ca[_0x43fd('0x3b')][_0x43fd('0xa7')]){_0x56f882[_0x43fd('0x9b')]({'model':db[_0x43fd('0x6b')],'as':_0x43fd('0x6b'),'raw':!![]});}var _0x5deb37=[{'model':db[_0x43fd('0x5c')],'as':'Messages','attributes':['id',_0x43fd('0x47'),_0x43fd('0x85'),_0x43fd('0x86'),_0x43fd('0x87'),_0x43fd('0xab')],'include':_0x56f882}];_0x5deb37[_0x43fd('0x9b')]({'model':db[_0x43fd('0xac')],'as':'Account','attributes':['id',_0x43fd('0x29')]});_0x5deb37['push']({'model':db['User'],'as':'Owner','attributes':['id',_0x43fd('0x83')]});return db[_0x43fd('0x3a')]['find']({'where':{'id':_0x2280ca[_0x43fd('0x48')]['id']},'include':_0x5deb37})[_0x43fd('0x13')](handleEntityNotFound(_0x25fd70,null))[_0x43fd('0x13')](function(_0x4d71df){if(_0x4d71df){var _0x490fab=_0x4d71df[_0x43fd('0xad')]({'plain':!![]});fs[_0x43fd('0xae')](_0x554d5d);var _0x32d145={'channel':_0x43fd('0xaf'),'account':_0x490fab[_0x43fd('0xb0')][_0x43fd('0x29')],'agent':_0x490fab[_0x43fd('0xb1')]?_0x490fab['Owner']['fullname']:'N.A.','createdAt':moment(_0x490fab['createdAt'])[_0x43fd('0x74')](_0x43fd('0xb2'))[_0x43fd('0xb3')](),'closedAt':_0x490fab['closed']?moment(_0x490fab['closedAt'])[_0x43fd('0x74')](_0x43fd('0xb2'))[_0x43fd('0xb3')]():'','disposition':_0x490fab['disposition'],'chatInfo':{'browser':_0x490fab[_0x43fd('0xb4')],'os':_0x490fab[_0x43fd('0xb5')],'referer':_0x490fab['referer'],'customerIp':_0x490fab['customerIp'],'customerPort':_0x490fab[_0x43fd('0xb6')]?_0x490fab[_0x43fd('0xb6')]:_0x43fd('0xb7')},'messages':_(_0x490fab[_0x43fd('0x78')])[_0x43fd('0xb8')]()[_0x43fd('0x97')]({'secret':![]})[_0x43fd('0x31')](function(_0xb548cb){if(_0xb548cb[_0x43fd('0x6b')]){var _0x315763=path[_0x43fd('0x6f')](_0x46d8bd,_0xb548cb[_0x43fd('0x6b')]['basename']);if(fs[_0x43fd('0xb9')](_0x315763)){fs[_0x43fd('0xba')](_0x315763)['pipe'](fs[_0x43fd('0xbb')](path[_0x43fd('0x6f')](_0x554d5d,_0xb548cb[_0x43fd('0x6b')]['basename'])));}}return{'date':moment(_0xb548cb[_0x43fd('0x85')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x43fd('0xb3')](),'sender':_0xb548cb[_0x43fd('0x86')]===_0x43fd('0xbc')?_0xb548cb['User']?_0xb548cb[_0x43fd('0x79')]['fullname']:_0x43fd('0x7d'):_0xb548cb[_0x43fd('0x61')]['firstName']+(_0xb548cb['Contact'][_0x43fd('0xaa')]?'\x20'+_0xb548cb['Contact'][_0x43fd('0xaa')]:''),'body':_0xb548cb[_0x43fd('0x6b')]?_0xb548cb[_0x43fd('0x6b')]['basename']:_0xb548cb[_0x43fd('0x47')],'direction':_0xb548cb[_0x43fd('0x86')]===_0x43fd('0xbc')?'A':'C','secret':_0xb548cb[_0x43fd('0x87')],'read':_0xb548cb[_0x43fd('0xab')],'attachment':_0xb548cb['Attachment']};})[_0x43fd('0xbd')]()};return ejs[_0x43fd('0xbe')](path['join'](config[_0x43fd('0x70')],_0x43fd('0xa5'),_0x43fd('0xbf'),_0x43fd('0xc0')),{'interaction':_0x32d145})['then'](function(_0x3709ca){var _0x50a8ef=path[_0x43fd('0x6f')](_0x554d5d,_0x43fd('0xc1')+_0x490fab['id']+'-'+_0x44431c+'.pdf');var _0x5b9d52={'path':_0x50a8ef,'channel':_0x43fd('0xaf'),'interactionId':_0x490fab['id']};return pdf[_0x43fd('0xc2')](_0x3709ca,_0x5b9d52);})[_0x43fd('0x13')](function(){return new Promise(function(_0x8ad329,_0x1a120e){zipdir(_0x554d5d,{'saveTo':_0x331fd4},function(_0x7f082e,_0x4a49c4){if(_0x7f082e)return _0x1a120e(_0x7f082e);return _0x8ad329(_0x4a49c4);});})[_0x43fd('0x13')](function(){return new BPromise(function(_0x2a7cac,_0x2408fb){rimraf(_0x554d5d,function(_0x25c9fb){if(_0x25c9fb)_0x2408fb(_0x25c9fb);return _0x2a7cac();});});})[_0x43fd('0x13')](function(){return _0x25fd70['download'](_0x331fd4,_0x2738f1,function(_0x3112ef){if(_0x3112ef){logger[_0x43fd('0x19')](_0x43fd('0xc3'),_0x3112ef);}else{fs['unlinkSync'](_0x331fd4);}});});});}else{return _0x25fd70[_0x43fd('0x1d')](0xc8);}})[_0x43fd('0x1c')](handleError(_0x25fd70,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index d51fbac..c375213 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 _0x5214=['getUsers','then','setDataValue','map','findAll','length','emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','ChatMessage','save','update'];(function(_0x19fe31,_0x4664eb){var _0x1ed7d0=function(_0x200b11){while(--_0x200b11){_0x19fe31['push'](_0x19fe31['shift']());}};_0x1ed7d0(++_0x4664eb);}(_0x5214,0x1d6));var _0x4521=function(_0x53fa47,_0xdff043){_0x53fa47=_0x53fa47-0x0;var _0x471ddb=_0x5214[_0x53fa47];return _0x471ddb;};'use strict';var EventEmitter=require(_0x4521('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x4521('0x1')];var ChatMessage=require(_0x4521('0x2'))['db'][_0x4521('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4521('0x4'),'afterUpdate':_0x4521('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1ecbbe){return function(_0x39e0f4,_0x494a57,_0x2acea1){_0x39e0f4[_0x4521('0x6')]({'attributes':['id'],'raw':!![]})[_0x4521('0x7')](function(_0x3a4a08){_0x39e0f4[_0x4521('0x8')]('Users',_0x3a4a08[_0x4521('0x9')](function(_0x1760eb){return{'id':_0x1760eb['id']};}));return ChatMessage[_0x4521('0xa')]({'where':{'ChatInteractionId':_0x39e0f4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4521('0x7')](function(_0xa4f2c6){_0x39e0f4['setDataValue']('unreadMessages',_0xa4f2c6[_0x4521('0xb')]);ChatInteractionEvents[_0x4521('0xc')](_0x1ecbbe+':'+_0x39e0f4['id'],_0x39e0f4);ChatInteractionEvents[_0x4521('0xc')](_0x1ecbbe,_0x39e0f4);_0x2acea1(null);})[_0x4521('0xd')](_0x2acea1(null));};}for(var e in events){if(events[_0x4521('0xe')](e)){var event=events[e];ChatInteraction[_0x4521('0xf')](e,emitEvent(event));}}module[_0x4521('0x10')]=ChatInteractionEvents; \ No newline at end of file +var _0x3c14=['catch','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','unreadMessages','length','emit'];(function(_0x96f74c,_0xfc30a4){var _0x379222=function(_0x1bbde9){while(--_0x1bbde9){_0x96f74c['push'](_0x96f74c['shift']());}};_0x379222(++_0xfc30a4);}(_0x3c14,0x1f3));var _0x43c1=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x3c14[_0x5d6456];return _0x4d66c1;};'use strict';var EventEmitter=require(_0x43c1('0x0'));var ChatInteraction=require(_0x43c1('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x43c1('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x43c1('0x2')](0x0);var events={'afterCreate':_0x43c1('0x3'),'afterUpdate':_0x43c1('0x4'),'afterDestroy':_0x43c1('0x5')};function emitEvent(_0x288982){return function(_0x197783,_0x203fa9,_0x503962){_0x197783[_0x43c1('0x6')]({'attributes':['id'],'raw':!![]})[_0x43c1('0x7')](function(_0x58d78a){_0x197783[_0x43c1('0x8')]('Users',_0x58d78a[_0x43c1('0x9')](function(_0x2aad79){return{'id':_0x2aad79['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x197783['id'],'direction':'in','read':![]},'raw':!![]});})[_0x43c1('0x7')](function(_0x2024e0){_0x197783[_0x43c1('0x8')](_0x43c1('0xa'),_0x2024e0[_0x43c1('0xb')]);ChatInteractionEvents[_0x43c1('0xc')](_0x288982+':'+_0x197783['id'],_0x197783);ChatInteractionEvents['emit'](_0x288982,_0x197783);_0x503962(null);})[_0x43c1('0xd')](_0x503962(null));};}for(var e in events){if(events[_0x43c1('0xe')](e)){var event=events[e];ChatInteraction[_0x43c1('0xf')](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 24d05bf..4041cd9 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 _0xd2c6=['ChatInteraction','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','util','api','moment','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','define'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xd2c6,0xc7));var _0x6d2c=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0xd2c6[_0x2aa0e7];return _0x1472c0;};'use strict';var _=require('lodash');var util=require(_0x6d2c('0x0'));var logger=require('../../config/logger')(_0x6d2c('0x1'));var moment=require(_0x6d2c('0x2'));var BPromise=require(_0x6d2c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d2c('0x4'));var rimraf=require(_0x6d2c('0x5'));var config=require(_0x6d2c('0x6'));var attributes=require(_0x6d2c('0x7'));module['exports']=function(_0x58839b,_0x3413f7){return _0x58839b[_0x6d2c('0x8')](_0x6d2c('0x9'),attributes,{'tableName':_0x6d2c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3c5864,_0x1f3845,_0x38775e){if(_0x3c5864[_0x6d2c('0xb')]('closed')){_0x3c5864[_0x6d2c('0xc')]=moment()[_0x6d2c('0xd')](_0x6d2c('0xe'));}_0x38775e(null,_0x3c5864);}},'charset':'utf8mb4','collate':_0x6d2c('0xf')});}; \ No newline at end of file +var _0xf194=['format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','closedAt'];(function(_0x1ca37b,_0x5a279a){var _0x3cdd9e=function(_0xdbb5ae){while(--_0xdbb5ae){_0x1ca37b['push'](_0x1ca37b['shift']());}};_0x3cdd9e(++_0x5a279a);}(_0xf194,0xdc));var _0x4f19=function(_0x1d1e05,_0x27eaed){_0x1d1e05=_0x1d1e05-0x0;var _0x2f49cf=_0xf194[_0x1d1e05];return _0x2f49cf;};'use strict';var _=require(_0x4f19('0x0'));var util=require('util');var logger=require(_0x4f19('0x1'))(_0x4f19('0x2'));var moment=require(_0x4f19('0x3'));var BPromise=require(_0x4f19('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f19('0x5'));var rimraf=require(_0x4f19('0x6'));var config=require(_0x4f19('0x7'));var attributes=require(_0x4f19('0x8'));module['exports']=function(_0x5c8973,_0x4fb25a){return _0x5c8973[_0x4f19('0x9')](_0x4f19('0xa'),attributes,{'tableName':_0x4f19('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x36fce1,_0x36420b,_0x2ab265){if(_0x36fce1[_0x4f19('0xc')]('closed')){_0x36fce1[_0x4f19('0xd')]=moment()[_0x4f19('0xe')](_0x4f19('0xf'));}_0x2ab265(null,_0x36fce1);}},'charset':_0x4f19('0x10'),'collate':_0x4f19('0x11')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 7712ad8..7ad1de7 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 _0xb9ba=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','UpdateChatInteraction','ChatInteraction','body','options','raw','where','attributes','limit','debug','stringify','find','addTags','ids','omit','AddTags','lodash','util','moment'];(function(_0x36d67a,_0xfd65a5){var _0x29bdcb=function(_0x172698){while(--_0x172698){_0x36d67a['push'](_0x36d67a['shift']());}};_0x29bdcb(++_0xfd65a5);}(_0xb9ba,0x1c0));var _0xab9b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb9ba[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xab9b('0x0'));var util=require(_0xab9b('0x1'));var moment=require(_0xab9b('0x2'));var BPromise=require(_0xab9b('0x3'));var rs=require(_0xab9b('0x4'));var fs=require('fs');var Redis=require(_0xab9b('0x5'));var db=require(_0xab9b('0x6'))['db'];var utils=require(_0xab9b('0x7'));var logger=require(_0xab9b('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xab9b('0x9'));var client=jayson['client'][_0xab9b('0xa')]({'port':0x232a});config[_0xab9b('0xb')]=_[_0xab9b('0xc')](config[_0xab9b('0xb')],{'host':_0xab9b('0xd'),'port':0x18eb});var socket=require(_0xab9b('0xe'))(new Redis(config[_0xab9b('0xb')]));require(_0xab9b('0xf'))[_0xab9b('0x10')](socket);function respondWithRpcPromise(_0x26808d,_0x230050,_0x36c4be){return new BPromise(function(_0x4797c9,_0x4e3ced){return client['request'](_0x26808d,_0x36c4be)[_0xab9b('0x11')](function(_0x597715){logger[_0xab9b('0x12')](_0xab9b('0x13'),_0x230050,'request\x20sent');logger['debug'](_0xab9b('0x14'),_0x230050,_0xab9b('0x15'),JSON['stringify'](_0x597715));if(_0x597715[_0xab9b('0x16')]){if(_0x597715[_0xab9b('0x16')][_0xab9b('0x17')]===0x1f4){logger[_0xab9b('0x16')](_0xab9b('0x13'),_0x230050,_0x597715[_0xab9b('0x16')][_0xab9b('0x18')]);return _0x4e3ced(_0x597715[_0xab9b('0x16')]['message']);}logger['error'](_0xab9b('0x13'),_0x230050,_0x597715[_0xab9b('0x16')][_0xab9b('0x18')]);return _0x4797c9(_0x597715['error'][_0xab9b('0x18')]);}else{logger[_0xab9b('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x230050,_0xab9b('0x15'));_0x4797c9(_0x597715['result'][_0xab9b('0x18')]);}})[_0xab9b('0x19')](function(_0x3a5ec9){logger[_0xab9b('0x16')](_0xab9b('0x13'),_0x230050,_0x3a5ec9);_0x4e3ced(_0x3a5ec9);});});}exports[_0xab9b('0x1a')]=function(_0x475be9){var _0x4740f8=this;return new Promise(function(_0x25517d,_0x79ec0){return db[_0xab9b('0x1b')]['update'](_0x475be9[_0xab9b('0x1c')],{'raw':_0x475be9['options']?_0x475be9[_0xab9b('0x1d')][_0xab9b('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x475be9[_0xab9b('0x1d')]?_0x475be9[_0xab9b('0x1d')][_0xab9b('0x1f')]||null:null,'attributes':_0x475be9['options']?_0x475be9[_0xab9b('0x1d')][_0xab9b('0x20')]||null:null,'limit':_0x475be9[_0xab9b('0x1d')]?_0x475be9[_0xab9b('0x1d')][_0xab9b('0x21')]||null:null})[_0xab9b('0x11')](function(_0x24579c){logger['info'](_0xab9b('0x1a'),_0x475be9);logger[_0xab9b('0x22')](_0xab9b('0x1a'),_0x475be9,JSON[_0xab9b('0x23')](_0x24579c));_0x25517d(_0x24579c);})[_0xab9b('0x19')](function(_0x18145b){logger['error'](_0xab9b('0x1a'),_0x18145b[_0xab9b('0x18')],_0x475be9);_0x79ec0(_0x4740f8[_0xab9b('0x16')](0x1f4,_0x18145b[_0xab9b('0x18')]));});});};exports['AddTagsToChatInteraction']=function(_0x5b03ed){return new Promise(function(_0x23e5ad,_0x19f0d3){return db[_0xab9b('0x1b')][_0xab9b('0x24')]({'where':_0x5b03ed[_0xab9b('0x1d')]?_0x5b03ed[_0xab9b('0x1d')]['where']||null:null})[_0xab9b('0x11')](function(_0x5e36fe){if(_0x5e36fe){return _0x5e36fe[_0xab9b('0x25')](_0x5b03ed[_0xab9b('0x1c')][_0xab9b('0x26')],_[_0xab9b('0x27')](_0x5b03ed[_0xab9b('0x1c')],[_0xab9b('0x26'),'id'])||{});}})['spread'](function(_0x5e1bf9){logger[_0xab9b('0x12')](_0xab9b('0x28'),_0x5b03ed);logger[_0xab9b('0x22')](_0xab9b('0x28'),_0x5b03ed,JSON['stringify'](_0x5e1bf9));_0x23e5ad(_0x5e1bf9);})['catch'](function(_0x245ee2){logger[_0xab9b('0x16')](_0xab9b('0x28'),_0x245ee2[_0xab9b('0x18')],_0x5b03ed);_0x19f0d3(_this[_0xab9b('0x16')](0x1f4,_0x245ee2[_0xab9b('0x18')]));});});}; \ No newline at end of file +var _0x95fa=['omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatInteraction','body','options','where','attributes','limit','UpdateChatInteraction','debug','AddTagsToChatInteraction','find','ids'];(function(_0x50dcd7,_0x34b6e6){var _0x2d2017=function(_0x1592b0){while(--_0x1592b0){_0x50dcd7['push'](_0x50dcd7['shift']());}};_0x2d2017(++_0x34b6e6);}(_0x95fa,0x143));var _0xa95f=function(_0x828291,_0x576a49){_0x828291=_0x828291-0x0;var _0x306620=_0x95fa[_0x828291];return _0x306620;};'use strict';var _=require('lodash');var util=require(_0xa95f('0x0'));var moment=require(_0xa95f('0x1'));var BPromise=require(_0xa95f('0x2'));var rs=require(_0xa95f('0x3'));var fs=require('fs');var Redis=require(_0xa95f('0x4'));var db=require(_0xa95f('0x5'))['db'];var utils=require(_0xa95f('0x6'));var logger=require(_0xa95f('0x7'))('rpc');var config=require(_0xa95f('0x8'));var jayson=require(_0xa95f('0x9'));var client=jayson[_0xa95f('0xa')][_0xa95f('0xb')]({'port':0x232a});config[_0xa95f('0xc')]=_['defaults'](config[_0xa95f('0xc')],{'host':_0xa95f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa95f('0xc')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x37687c,_0x22b727,_0x34c357){return new BPromise(function(_0x2aee13,_0x5033ae){return client[_0xa95f('0xe')](_0x37687c,_0x34c357)[_0xa95f('0xf')](function(_0x1e97d2){logger[_0xa95f('0x10')](_0xa95f('0x11'),_0x22b727,_0xa95f('0x12'));logger['debug'](_0xa95f('0x13'),_0x22b727,_0xa95f('0x12'),JSON[_0xa95f('0x14')](_0x1e97d2));if(_0x1e97d2[_0xa95f('0x15')]){if(_0x1e97d2['error'][_0xa95f('0x16')]===0x1f4){logger['error'](_0xa95f('0x11'),_0x22b727,_0x1e97d2['error'][_0xa95f('0x17')]);return _0x5033ae(_0x1e97d2[_0xa95f('0x15')][_0xa95f('0x17')]);}logger[_0xa95f('0x15')](_0xa95f('0x11'),_0x22b727,_0x1e97d2[_0xa95f('0x15')][_0xa95f('0x17')]);return _0x2aee13(_0x1e97d2[_0xa95f('0x15')]['message']);}else{logger[_0xa95f('0x10')](_0xa95f('0x11'),_0x22b727,_0xa95f('0x12'));_0x2aee13(_0x1e97d2[_0xa95f('0x18')][_0xa95f('0x17')]);}})[_0xa95f('0x19')](function(_0x26c06a){logger[_0xa95f('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x22b727,_0x26c06a);_0x5033ae(_0x26c06a);});});}exports['UpdateChatInteraction']=function(_0x30d197){var _0xbcb447=this;return new Promise(function(_0x19b6ec,_0x3cbb85){return db[_0xa95f('0x1a')]['update'](_0x30d197[_0xa95f('0x1b')],{'raw':_0x30d197['options']?_0x30d197[_0xa95f('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30d197['options']?_0x30d197[_0xa95f('0x1c')][_0xa95f('0x1d')]||null:null,'attributes':_0x30d197[_0xa95f('0x1c')]?_0x30d197[_0xa95f('0x1c')][_0xa95f('0x1e')]||null:null,'limit':_0x30d197[_0xa95f('0x1c')]?_0x30d197[_0xa95f('0x1c')][_0xa95f('0x1f')]||null:null})[_0xa95f('0xf')](function(_0x240e44){logger[_0xa95f('0x10')](_0xa95f('0x20'),_0x30d197);logger[_0xa95f('0x21')](_0xa95f('0x20'),_0x30d197,JSON[_0xa95f('0x14')](_0x240e44));_0x19b6ec(_0x240e44);})[_0xa95f('0x19')](function(_0x241d9f){logger[_0xa95f('0x15')](_0xa95f('0x20'),_0x241d9f['message'],_0x30d197);_0x3cbb85(_0xbcb447[_0xa95f('0x15')](0x1f4,_0x241d9f[_0xa95f('0x17')]));});});};exports[_0xa95f('0x22')]=function(_0x3032aa){return new Promise(function(_0x2a328d,_0x3b0e2c){return db[_0xa95f('0x1a')][_0xa95f('0x23')]({'where':_0x3032aa[_0xa95f('0x1c')]?_0x3032aa['options'][_0xa95f('0x1d')]||null:null})[_0xa95f('0xf')](function(_0x540342){if(_0x540342){return _0x540342['addTags'](_0x3032aa[_0xa95f('0x1b')][_0xa95f('0x24')],_[_0xa95f('0x25')](_0x3032aa[_0xa95f('0x1b')],['ids','id'])||{});}})[_0xa95f('0x26')](function(_0x3a9d55){logger[_0xa95f('0x10')](_0xa95f('0x27'),_0x3032aa);logger[_0xa95f('0x21')](_0xa95f('0x27'),_0x3032aa,JSON[_0xa95f('0x14')](_0x3a9d55));_0x2a328d(_0x3a9d55);})[_0xa95f('0x19')](function(_0x2d2f62){logger[_0xa95f('0x15')](_0xa95f('0x27'),_0x2d2f62[_0xa95f('0x17')],_0x3032aa);_0x3b0e2c(_this[_0xa95f('0x15')](0x1f4,_0x2d2f62[_0xa95f('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 0f11fcd..277cba0 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 _0x1c3d=['length','chatInteraction:','./chatInteraction.events','remove','emit','removeListener','register'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1c3d,0x12f));var _0xd1c3=function(_0x292ec9,_0x3f304d){_0x292ec9=_0x292ec9-0x0;var _0xce9423=_0x1c3d[_0x292ec9];return _0xce9423;};'use strict';var ChatInteractionEvents=require(_0xd1c3('0x0'));var events=['save',_0xd1c3('0x1'),'update'];function createListener(_0x1340d9,_0x549868){return function(_0x485529){_0x549868[_0xd1c3('0x2')](_0x1340d9,_0x485529);};}function removeListener(_0x5ec6f3,_0x3ebeec){return function(){ChatInteractionEvents[_0xd1c3('0x3')](_0x5ec6f3,_0x3ebeec);};}exports[_0xd1c3('0x4')]=function(_0x57e488){for(var _0x4998c5=0x0,_0x336da5=events[_0xd1c3('0x5')];_0x4998c5<_0x336da5;_0x4998c5++){var _0x436399=events[_0x4998c5];var _0x3762db=createListener(_0xd1c3('0x6')+_0x436399,_0x57e488);ChatInteractionEvents['on'](_0x436399,_0x3762db);}}; \ No newline at end of file +var _0x46f4=['update','emit','removeListener','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x46f4,0x115));var _0x446f=function(_0x1d07ab,_0x22f50f){_0x1d07ab=_0x1d07ab-0x0;var _0x572ce3=_0x46f4[_0x1d07ab];return _0x572ce3;};'use strict';var ChatInteractionEvents=require(_0x446f('0x0'));var events=[_0x446f('0x1'),_0x446f('0x2'),_0x446f('0x3')];function createListener(_0x411989,_0xf8e0e4){return function(_0x5064f0){_0xf8e0e4[_0x446f('0x4')](_0x411989,_0x5064f0);};}function removeListener(_0x47f9d0,_0x4b5d43){return function(){ChatInteractionEvents[_0x446f('0x5')](_0x47f9d0,_0x4b5d43);};}exports['register']=function(_0xb6054){for(var _0x3c822c=0x0,_0x2e1761=events[_0x446f('0x6')];_0x3c822c<_0x2e1761;_0x3c822c++){var _0x14b76f=events[_0x3c822c];var _0xce5535=createListener(_0x446f('0x7')+_0x14b76f,_0xb6054);ChatInteractionEvents['on'](_0x14b76f,_0xce5535);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index cd16454..2e911e7 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 _0xf2e5=['/:id/close','delete','chatinteraction:destroy','destroy','removeTags','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','isChatInteractionAuthorized','getMyMessages','/:id/download','download','post','create','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','file','addMessage','/:id/tags','tracked','chatinteraction:addtags','addTags','put','/:id','chat','update','customUpdate','/:id/abandon','abandon'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf2e5,0x109));var _0x5f2e=function(_0x1aece3,_0x4ce790){_0x1aece3=_0x1aece3-0x0;var _0x36254e=_0xf2e5[_0x1aece3];return _0x36254e;};'use strict';var multer=require('multer');var util=require(_0x5f2e('0x0'));var path=require(_0x5f2e('0x1'));var timeout=require(_0x5f2e('0x2'));var express=require(_0x5f2e('0x3'));var router=express[_0x5f2e('0x4')]();var fs_extra=require(_0x5f2e('0x5'));var auth=require(_0x5f2e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5f2e('0x7'));var controller=require('./chatInteraction.controller');router[_0x5f2e('0x8')]('/',auth[_0x5f2e('0x9')](),controller['index']);router[_0x5f2e('0x8')](_0x5f2e('0xa'),auth[_0x5f2e('0x9')](),controller[_0x5f2e('0xb')]);router[_0x5f2e('0x8')]('/:id',auth['isChatInteractionAuthorized'](),controller[_0x5f2e('0xc')]);router[_0x5f2e('0x8')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0x5f2e('0xd')]);router[_0x5f2e('0x8')](_0x5f2e('0xe'),auth[_0x5f2e('0x9')](),controller[_0x5f2e('0xf')]);router[_0x5f2e('0x8')](_0x5f2e('0x10'),auth[_0x5f2e('0x11')](),controller[_0x5f2e('0x12')]);router[_0x5f2e('0x8')](_0x5f2e('0x13'),auth[_0x5f2e('0x9')](),controller[_0x5f2e('0x14')]);router[_0x5f2e('0x15')]('/',auth[_0x5f2e('0x9')](),controller[_0x5f2e('0x16')]);router[_0x5f2e('0x15')]('/:id/vidaoo',auth[_0x5f2e('0x9')](),controller[_0x5f2e('0x17')]);var upload=multer({'storage':multer[_0x5f2e('0x18')]({'destination':function(_0x243ac0,_0xe5a034,_0x4ac1cf){_0x4ac1cf(null,path[_0x5f2e('0x19')](config[_0x5f2e('0x1a')],_0x5f2e('0x1b')));},'filename':function(_0xabedff,_0x7006f4,_0x4f9b90){_0x4f9b90(null,util[_0x5f2e('0x1c')]('%s-%s',Date[_0x5f2e('0x1d')](),_0x7006f4[_0x5f2e('0x1e')][_0x5f2e('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5f2e('0x15')](_0x5f2e('0x20'),upload[_0x5f2e('0x21')](_0x5f2e('0x22')),controller['attachmentUpload']);router[_0x5f2e('0x15')](_0x5f2e('0xe'),auth['isChatInteractionAuthorized'](),controller[_0x5f2e('0x23')]);router[_0x5f2e('0x15')](_0x5f2e('0x24'),auth[_0x5f2e('0x9')](),interaction[_0x5f2e('0x25')]('chat',_0x5f2e('0x26')),controller[_0x5f2e('0x27')]);router[_0x5f2e('0x28')](_0x5f2e('0x29'),auth[_0x5f2e('0x9')](),interaction['tracked'](_0x5f2e('0x2a'),'chatinteraction:update'),controller[_0x5f2e('0x2b')]);router[_0x5f2e('0x28')]('/:id/custom_update',controller[_0x5f2e('0x2c')]);router[_0x5f2e('0x28')](_0x5f2e('0x2d'),auth[_0x5f2e('0x11')](),controller[_0x5f2e('0x2e')]);router[_0x5f2e('0x28')](_0x5f2e('0x2f'),controller['close']);router[_0x5f2e('0x30')](_0x5f2e('0x29'),auth['isAuthenticated'](),interaction[_0x5f2e('0x25')](_0x5f2e('0x2a'),_0x5f2e('0x31')),controller[_0x5f2e('0x32')]);router[_0x5f2e('0x30')](_0x5f2e('0x24'),auth[_0x5f2e('0x9')](),controller[_0x5f2e('0x33')]);module['exports']=router; \ No newline at end of file +var _0x3f41=['show','/:id/attachment_download','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','%s-%s','originalname','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','tracked','chat','addTags','put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','close','delete','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','isChatInteractionAuthorized'];(function(_0x38f0fe,_0xebf141){var _0x9ace4a=function(_0x30bb5b){while(--_0x30bb5b){_0x38f0fe['push'](_0x38f0fe['shift']());}};_0x9ace4a(++_0xebf141);}(_0x3f41,0xa3));var _0x13f4=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0x3f41[_0x39e283];return _0x7de89f;};'use strict';var multer=require('multer');var util=require(_0x13f4('0x0'));var path=require(_0x13f4('0x1'));var timeout=require(_0x13f4('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x13f4('0x3'));var auth=require(_0x13f4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x13f4('0x5'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0x13f4('0x6')](),controller[_0x13f4('0x7')]);router['get'](_0x13f4('0x8'),auth['isAuthenticated'](),controller[_0x13f4('0x9')]);router[_0x13f4('0xa')](_0x13f4('0xb'),auth[_0x13f4('0xc')](),controller[_0x13f4('0xd')]);router['get'](_0x13f4('0xe'),auth[_0x13f4('0xc')](),controller['attachmentDownload']);router['get']('/:id/messages',auth[_0x13f4('0x6')](),controller[_0x13f4('0xf')]);router[_0x13f4('0xa')](_0x13f4('0x10'),auth[_0x13f4('0xc')](),controller[_0x13f4('0x11')]);router[_0x13f4('0xa')](_0x13f4('0x12'),auth[_0x13f4('0x6')](),controller['download']);router[_0x13f4('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x13f4('0x13')](_0x13f4('0x14'),auth['isAuthenticated'](),controller[_0x13f4('0x15')]);var upload=multer({'storage':multer[_0x13f4('0x16')]({'destination':function(_0x1ca8da,_0x198889,_0x1f17f3){_0x1f17f3(null,path[_0x13f4('0x17')](config['root'],'server/files/attachments/'));},'filename':function(_0x2d2cbe,_0x609c58,_0x36356e){_0x36356e(null,util['format'](_0x13f4('0x18'),Date['now'](),_0x609c58[_0x13f4('0x19')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x13f4('0x13')]('/:id/attachment_upload',upload[_0x13f4('0x1a')](_0x13f4('0x1b')),controller[_0x13f4('0x1c')]);router[_0x13f4('0x13')](_0x13f4('0x1d'),auth[_0x13f4('0xc')](),controller[_0x13f4('0x1e')]);router[_0x13f4('0x13')](_0x13f4('0x1f'),auth[_0x13f4('0x6')](),interaction[_0x13f4('0x20')](_0x13f4('0x21'),'chatinteraction:addtags'),controller[_0x13f4('0x22')]);router[_0x13f4('0x23')](_0x13f4('0xb'),auth[_0x13f4('0x6')](),interaction[_0x13f4('0x20')](_0x13f4('0x21'),_0x13f4('0x24')),controller[_0x13f4('0x25')]);router[_0x13f4('0x23')]('/:id/custom_update',controller[_0x13f4('0x26')]);router[_0x13f4('0x23')](_0x13f4('0x27'),auth[_0x13f4('0xc')](),controller[_0x13f4('0x28')]);router[_0x13f4('0x23')]('/:id/close',controller[_0x13f4('0x29')]);router[_0x13f4('0x2a')](_0x13f4('0xb'),auth['isAuthenticated'](),interaction[_0x13f4('0x20')](_0x13f4('0x21'),'chatinteraction:destroy'),controller['destroy']);router['delete'](_0x13f4('0x1f'),auth[_0x13f4('0x6')](),controller['removeTags']);module[_0x13f4('0x2b')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index d5f84e9..7c9d76d 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 _0x335a=['medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x5c98ea,_0xa782aa){var _0x51e853=function(_0x57d5b0){while(--_0x57d5b0){_0x5c98ea['push'](_0x5c98ea['shift']());}};_0x51e853(++_0xa782aa);}(_0x335a,0x17f));var _0xa335=function(_0x16001a,_0x29e9af){_0x16001a=_0x16001a-0x0;var _0x1ab682=_0x335a[_0x16001a];return _0x1ab682;};'use strict';var Sequelize=require(_0xa335('0x0'));module[_0xa335('0x1')]={'body':{'type':Sequelize['TEXT'](_0xa335('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xa335('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xa335('0x4')]}}; \ No newline at end of file +var _0x07ca=['exports','TEXT','BOOLEAN','INTEGER','sequelize'];(function(_0x3695fe,_0x47bd31){var _0x42fbdd=function(_0x23ec1a){while(--_0x23ec1a){_0x3695fe['push'](_0x3695fe['shift']());}};_0x42fbdd(++_0x47bd31);}(_0x07ca,0x18f));var _0xa07c=function(_0x5180c3,_0x4b35f7){_0x5180c3=_0x5180c3-0x0;var _0x55c975=_0x07ca[_0x5180c3];return _0x55c975;};'use strict';var Sequelize=require(_0xa07c('0x0'));module[_0xa07c('0x1')]={'body':{'type':Sequelize[_0xa07c('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xa07c('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xa07c('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 8b14708..a777912 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 _0xfead=['push','ToId','read','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','name','send','index','map','ChatInternalMessage','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','type','VIRTUAL','merge','options','count','includeAll','findAll','rows','catch','show','params','include','create','body','update','find','describe','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','user','fullname','role','userpic','internal','showWebBar','-online','VoiceQueue','VoiceQueues','get','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId'];(function(_0x5f2a01,_0x7f2015){var _0x14e9f9=function(_0x28dd19){while(--_0x28dd19){_0x5f2a01['push'](_0x5f2a01['shift']());}};_0x14e9f9(++_0x7f2015);}(_0xfead,0x14f));var _0xdfea=function(_0x47d4d3,_0x34a248){_0x47d4d3=_0x47d4d3-0x0;var _0x554bdc=_0xfead[_0x47d4d3];return _0x554bdc;};'use strict';var emlformat=require(_0xdfea('0x0'));var rimraf=require(_0xdfea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdfea('0x2'));var rp=require(_0xdfea('0x3'));var moment=require('moment');var BPromise=require(_0xdfea('0x4'));var Mustache=require(_0xdfea('0x5'));var util=require(_0xdfea('0x6'));var path=require(_0xdfea('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdfea('0x8'));var fs=require('fs');var fs_extra=require(_0xdfea('0x9'));var _=require(_0xdfea('0xa'));var squel=require(_0xdfea('0xb'));var crypto=require(_0xdfea('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdfea('0xd'));var toCsv=require(_0xdfea('0xe'));var querystring=require(_0xdfea('0xf'));var Papa=require('papaparse');var Redis=require(_0xdfea('0x10'));var authService=require(_0xdfea('0x11'));var qs=require(_0xdfea('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdfea('0x13'))(_0xdfea('0x14'));var utils=require(_0xdfea('0x15'));var config=require(_0xdfea('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xdfea('0x17')]=_['defaults'](config[_0xdfea('0x17')],{'host':_0xdfea('0x18'),'port':0x18eb});var socket=require(_0xdfea('0x19'))(new Redis(config[_0xdfea('0x17')]));require(_0xdfea('0x1a'))[_0xdfea('0x1b')](socket);function respondWithStatusCode(_0x2d8f6c,_0x2166b2){_0x2166b2=_0x2166b2||0xcc;return function(_0x27c5c1){if(_0x27c5c1){return _0x2d8f6c[_0xdfea('0x1c')](_0x2166b2);}return _0x2d8f6c['status'](_0x2166b2)[_0xdfea('0x1d')]();};}function respondWithResult(_0x583d96,_0x3a2a6a){_0x3a2a6a=_0x3a2a6a||0xc8;return function(_0x32fa7d){if(_0x32fa7d){return _0x583d96[_0xdfea('0x1e')](_0x3a2a6a)[_0xdfea('0x1f')](_0x32fa7d);}};}function respondWithFilteredResult(_0x5a38e4,_0x1e3448){return function(_0x180f60){if(_0x180f60){var _0x171351=typeof _0x1e3448[_0xdfea('0x20')]==='undefined'&&typeof _0x1e3448['limit']===_0xdfea('0x21');var _0x2f55d7=_0x180f60['count'];var _0x3f53de=_0x171351?0x0:_0x1e3448[_0xdfea('0x20')];var _0x9b4138=_0x171351?_0x180f60['count']:_0x1e3448[_0xdfea('0x20')]+_0x1e3448[_0xdfea('0x22')];var _0x32135a;if(_0x9b4138>=_0x2f55d7){_0x9b4138=_0x2f55d7;_0x32135a=0xc8;}else{_0x32135a=0xce;}_0x5a38e4[_0xdfea('0x1e')](_0x32135a);return _0x5a38e4[_0xdfea('0x23')](_0xdfea('0x24'),_0x3f53de+'-'+_0x9b4138+'/'+_0x2f55d7)[_0xdfea('0x1f')](_0x180f60);}return null;};}function patchUpdates(_0x58dbc0){return function(_0x2409ea){try{jsonpatch[_0xdfea('0x25')](_0x2409ea,_0x58dbc0,!![]);}catch(_0x274db6){return BPromise[_0xdfea('0x26')](_0x274db6);}return _0x2409ea[_0xdfea('0x27')]();};}function saveUpdates(_0x386f32,_0x1e8f9e){return function(_0x57b65d){if(_0x57b65d){return _0x57b65d['update'](_0x386f32)[_0xdfea('0x28')](function(_0x188837){return _0x188837;});}return null;};}function removeEntity(_0x2b0aca,_0x5e51e8){return function(_0x3b61f5){if(_0x3b61f5){return _0x3b61f5[_0xdfea('0x29')]()[_0xdfea('0x28')](function(){_0x2b0aca[_0xdfea('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18128b,_0x24fcb8){return function(_0x22fb23){if(!_0x22fb23){_0x18128b[_0xdfea('0x1c')](0x194);}return _0x22fb23;};}function handleError(_0x2ab94d,_0x55058b){_0x55058b=_0x55058b||0x1f4;return function(_0x12cb23){logger['error'](_0x12cb23['stack']);if(_0x12cb23[_0xdfea('0x2a')]){delete _0x12cb23[_0xdfea('0x2a')];}_0x2ab94d[_0xdfea('0x1e')](_0x55058b)[_0xdfea('0x2b')](_0x12cb23);};}exports[_0xdfea('0x2c')]=function(_0x5af228,_0x1d826d){var _0x342422={},_0x22c590={},_0x5bb613={'count':0x0,'rows':[]};var _0x2996d8=_[_0xdfea('0x2d')](db[_0xdfea('0x2e')][_0xdfea('0x2f')],function(_0x21052c){return{'name':_0x21052c['fieldName'],'type':_0x21052c['type']['key']};});_0x22c590[_0xdfea('0x30')]=_[_0xdfea('0x2d')](_0x2996d8,_0xdfea('0x2a'));_0x22c590['query']=_[_0xdfea('0x31')](_0x5af228[_0xdfea('0x32')]);_0x22c590['filters']=_[_0xdfea('0x33')](_0x22c590['model'],_0x22c590[_0xdfea('0x32')]);_0x342422[_0xdfea('0x34')]=_[_0xdfea('0x33')](_0x22c590[_0xdfea('0x30')],qs[_0xdfea('0x35')](_0x5af228['query'][_0xdfea('0x35')]));_0x342422['attributes']=_0x342422[_0xdfea('0x34')][_0xdfea('0x36')]?_0x342422['attributes']:_0x22c590[_0xdfea('0x30')];if(!_0x5af228['query'][_0xdfea('0x37')](_0xdfea('0x38'))){_0x342422[_0xdfea('0x22')]=qs[_0xdfea('0x22')](_0x5af228[_0xdfea('0x32')][_0xdfea('0x22')]);_0x342422[_0xdfea('0x20')]=qs[_0xdfea('0x20')](_0x5af228[_0xdfea('0x32')][_0xdfea('0x20')]);}_0x342422[_0xdfea('0x39')]=qs['sort'](_0x5af228['query'][_0xdfea('0x3a')]);_0x342422['where']=qs[_0xdfea('0x3b')](_['pick'](_0x5af228[_0xdfea('0x32')],_0x22c590[_0xdfea('0x3b')]),_0x2996d8);if(_0x5af228[_0xdfea('0x32')][_0xdfea('0x3c')]){_0x342422[_0xdfea('0x3d')]=_['merge'](_0x342422[_0xdfea('0x3d')],{'$or':_[_0xdfea('0x2d')](_0x2996d8,function(_0x2d7a80){if(_0x2d7a80[_0xdfea('0x3e')]!==_0xdfea('0x3f')){var _0x4c0810={};_0x4c0810[_0x2d7a80[_0xdfea('0x2a')]]={'$like':'%'+_0x5af228[_0xdfea('0x32')][_0xdfea('0x3c')]+'%'};return _0x4c0810;}})});}_0x342422=_[_0xdfea('0x40')]({},_0x342422,_0x5af228[_0xdfea('0x41')]);var _0x54ad70={'where':_0x342422[_0xdfea('0x3d')]};return db[_0xdfea('0x2e')][_0xdfea('0x42')](_0x54ad70)['then'](function(_0x48cab7){_0x5bb613[_0xdfea('0x42')]=_0x48cab7;if(_0x5af228[_0xdfea('0x32')][_0xdfea('0x43')]){_0x342422['include']=[{'all':!![]}];}return db[_0xdfea('0x2e')][_0xdfea('0x44')](_0x342422);})['then'](function(_0x57b5b8){_0x5bb613[_0xdfea('0x45')]=_0x57b5b8;return _0x5bb613;})['then'](respondWithFilteredResult(_0x1d826d,_0x342422))[_0xdfea('0x46')](handleError(_0x1d826d,null));};exports[_0xdfea('0x47')]=function(_0x5de738,_0x2eda2b){var _0x4fd35b={'raw':!![],'where':{'id':_0x5de738[_0xdfea('0x48')]['id']}},_0x1ce4d0={};_0x1ce4d0[_0xdfea('0x30')]=_['keys'](db[_0xdfea('0x2e')]['rawAttributes']);_0x1ce4d0[_0xdfea('0x32')]=_[_0xdfea('0x31')](_0x5de738[_0xdfea('0x32')]);_0x1ce4d0[_0xdfea('0x3b')]=_[_0xdfea('0x33')](_0x1ce4d0[_0xdfea('0x30')],_0x1ce4d0[_0xdfea('0x32')]);_0x4fd35b[_0xdfea('0x34')]=_[_0xdfea('0x33')](_0x1ce4d0[_0xdfea('0x30')],qs['fields'](_0x5de738[_0xdfea('0x32')][_0xdfea('0x35')]));_0x4fd35b['attributes']=_0x4fd35b[_0xdfea('0x34')][_0xdfea('0x36')]?_0x4fd35b['attributes']:_0x1ce4d0[_0xdfea('0x30')];if(_0x5de738[_0xdfea('0x32')]['includeAll']){_0x4fd35b[_0xdfea('0x49')]=[{'all':!![]}];}_0x4fd35b=_[_0xdfea('0x40')]({},_0x4fd35b,_0x5de738[_0xdfea('0x41')]);return db[_0xdfea('0x2e')]['find'](_0x4fd35b)['then'](handleEntityNotFound(_0x2eda2b,null))[_0xdfea('0x28')](respondWithResult(_0x2eda2b,null))[_0xdfea('0x46')](handleError(_0x2eda2b,null));};exports[_0xdfea('0x4a')]=function(_0x446acc,_0x12adb3){return db[_0xdfea('0x2e')][_0xdfea('0x4a')](_0x446acc[_0xdfea('0x4b')],{})['then'](respondWithResult(_0x12adb3,0xc9))[_0xdfea('0x46')](handleError(_0x12adb3,null));};exports[_0xdfea('0x4c')]=function(_0x1e08fc,_0x5b1189){if(_0x1e08fc[_0xdfea('0x4b')]['id']){delete _0x1e08fc[_0xdfea('0x4b')]['id'];}return db['ChatInternalMessage'][_0xdfea('0x4d')]({'where':{'id':_0x1e08fc['params']['id']}})[_0xdfea('0x28')](handleEntityNotFound(_0x5b1189,null))[_0xdfea('0x28')](saveUpdates(_0x1e08fc[_0xdfea('0x4b')],null))[_0xdfea('0x28')](respondWithResult(_0x5b1189,null))['catch'](handleError(_0x5b1189,null));};exports[_0xdfea('0x29')]=function(_0x12218e,_0x1a8dd1){return db[_0xdfea('0x2e')]['find']({'where':{'id':_0x12218e['params']['id']}})[_0xdfea('0x28')](handleEntityNotFound(_0x1a8dd1,null))[_0xdfea('0x28')](removeEntity(_0x1a8dd1,null))[_0xdfea('0x46')](handleError(_0x1a8dd1,null));};exports['describe']=function(_0x2e0fc7,_0x3009b0){return db[_0xdfea('0x2e')][_0xdfea('0x4e')]()['then'](respondWithResult(_0x3009b0,null))['catch'](handleError(_0x3009b0,null));};function wrapUser(_0x58ccf2){return function(_0x39860b){var _0x2b9c9c=_0x58ccf2['get']({'plain':!![]});_0x2b9c9c[_0xdfea('0x4f')]=[];if(_0x39860b){_0x2b9c9c[_0xdfea('0x50')]=_0x39860b[_0xdfea('0x51')];_0x2b9c9c[_0xdfea('0x52')]=_0x39860b;}else{_0x2b9c9c['lastMessageAt']=moment(0x0)[_0xdfea('0x53')](_0xdfea('0x54'));_0x2b9c9c[_0xdfea('0x52')]={};}return _0x2b9c9c;};}exports[_0xdfea('0x55')]=function(_0x4331de,_0x16bc84,_0x293a2f){var _0x1cca25=[];return db['User'][_0xdfea('0x44')]({'where':{'role':[_0xdfea('0x56'),_0xdfea('0x57'),_0xdfea('0x58')]},'attributes':['id',_0xdfea('0x59'),_0xdfea('0x2a'),_0xdfea('0x5a'),_0xdfea('0x5b'),_0xdfea('0x5c'),'online','lastLoginAt','allowmessenger',_0xdfea('0x5d')],'order':qs['sort'](_0xdfea('0x5e')),'include':[{'model':db[_0xdfea('0x5f')],'as':_0xdfea('0x60'),'attributes':['id',_0xdfea('0x2a'),_0xdfea('0x3e')],'through':{'attributes':[]}}]})[_0xdfea('0x28')](function(_0x5d8e2f){if(_0x5d8e2f){var _0x3327b9=_0x4331de[_0xdfea('0x58')][_0xdfea('0x61')]({'plain':!![]});if(!_0x3327b9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3327b9[_0xdfea('0x5a')]==='user'){return db[_0xdfea('0x62')][_0xdfea('0x4d')]({'where':{'name':_0xdfea('0x63'),'userProfileId':_0x3327b9[_0xdfea('0x64')]},'raw':!![]})[_0xdfea('0x28')](function(_0x252162){if(_0x252162){if(_0x252162[_0xdfea('0x65')]===0x0){return db[_0xdfea('0x66')][_0xdfea('0x44')]({'where':{'sectionId':_0x252162['id']},'raw':!![]})[_0xdfea('0x28')](function(_0x2e88d6){var _0x5c206e=[];if(_[_0xdfea('0x67')](_0x2e88d6)){_0x5c206e=_[_0xdfea('0x3c')](_0x5d8e2f,function(_0x584231){if(_0x584231[_0xdfea('0x5a')]!==_0xdfea('0x56')){return _0x584231;}});return _0x5c206e;}else{for(var _0x344583=0x0;_0x344583<_0x5d8e2f[_0xdfea('0x36')];_0x344583++){var _0x3d6f37=_0x5d8e2f[_0x344583];if(_0x3d6f37[_0xdfea('0x5a')]===_0xdfea('0x56')){var _0xdb1cf0=_[_0xdfea('0x4d')](_0x2e88d6,function(_0x529fa5){return _0x529fa5[_0xdfea('0x68')]===_0x3d6f37['id'];});if(_0xdb1cf0)_0x5c206e[_0xdfea('0x69')](_0x3d6f37);}else{_0x5c206e['push'](_0x3d6f37);}}return _0x5c206e;}});}else{return _0x5d8e2f;}}else{var _0xd7c352=_['filter'](_0x5d8e2f,function(_0x1a9c2d){if(_0x1a9c2d[_0xdfea('0x5a')]!=='agent'){return _0x1a9c2d;}});return _0xd7c352;}});}else{return _0x5d8e2f;}}})[_0xdfea('0x28')](function(_0x86c1be){var _0x56b9ae=[];if(_0x86c1be){_0x1cca25=_0x86c1be;for(var _0xc18b4=0x0;_0xc18b4<_0x86c1be[_0xdfea('0x36')];_0xc18b4+=0x1){_0x1cca25[_0xc18b4]['messages']=[];_0x56b9ae[_0xdfea('0x69')](db[_0xdfea('0x2e')]['find']({'where':{'FromId':[_0x4331de[_0xdfea('0x58')]['id'],_0x86c1be[_0xc18b4]['id']],'ToId':[_0x4331de[_0xdfea('0x58')]['id'],_0x86c1be[_0xc18b4]['id']],'ChatGroupId':null},'attributes':['id',_0xdfea('0x51'),'FromId',_0xdfea('0x6a'),_0xdfea('0x6b'),_0xdfea('0x4b')],'order':qs[_0xdfea('0x3a')](_0xdfea('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xdfea('0x28')](wrapUser(_0x86c1be[_0xc18b4])));}return BPromise[_0xdfea('0x6d')](_0x56b9ae);}return[];})[_0xdfea('0x28')](function(_0x18c66e){return{'rows':_0x18c66e,'count':_0x18c66e[_0xdfea('0x36')]};})['then'](respondWithResult(_0x16bc84,null))[_0xdfea('0x46')](handleError(_0x16bc84,null));}; \ No newline at end of file +var _0x1e9f=['moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','ChatInternalMessage','includeAll','findAll','catch','keys','include','find','create','body','params','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','user','role','userpic','internal','lastLoginAt','showWebBar','VoiceQueue','VoiceQueues','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','length','push','FromId','ToId','read','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0xc1c4,_0x1e9763){var _0x3b83a4=function(_0x546e81){while(--_0x546e81){_0xc1c4['push'](_0xc1c4['shift']());}};_0x3b83a4(++_0x1e9763);}(_0x1e9f,0x140));var _0xf1e9=function(_0x245b3b,_0x161dff){_0x245b3b=_0x245b3b-0x0;var _0x249d89=_0x1e9f[_0x245b3b];return _0x249d89;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf1e9('0x0'));var zipdir=require(_0xf1e9('0x1'));var jsonpatch=require(_0xf1e9('0x2'));var rp=require(_0xf1e9('0x3'));var moment=require(_0xf1e9('0x4'));var BPromise=require(_0xf1e9('0x5'));var Mustache=require('mustache');var util=require(_0xf1e9('0x6'));var path=require(_0xf1e9('0x7'));var sox=require(_0xf1e9('0x8'));var csv=require(_0xf1e9('0x9'));var ejs=require(_0xf1e9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf1e9('0xb'));var squel=require(_0xf1e9('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf1e9('0xd'));var toCsv=require(_0xf1e9('0x9'));var querystring=require('querystring');var Papa=require(_0xf1e9('0xe'));var Redis=require(_0xf1e9('0xf'));var authService=require(_0xf1e9('0x10'));var qs=require(_0xf1e9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf1e9('0x12'));var logger=require(_0xf1e9('0x13'))(_0xf1e9('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf1e9('0x15'));var db=require(_0xf1e9('0x16'))['db'];config[_0xf1e9('0x17')]=_[_0xf1e9('0x18')](config[_0xf1e9('0x17')],{'host':_0xf1e9('0x19'),'port':0x18eb});var socket=require(_0xf1e9('0x1a'))(new Redis(config[_0xf1e9('0x17')]));require(_0xf1e9('0x1b'))[_0xf1e9('0x1c')](socket);function respondWithStatusCode(_0x568af4,_0x244c63){_0x244c63=_0x244c63||0xcc;return function(_0x35c442){if(_0x35c442){return _0x568af4[_0xf1e9('0x1d')](_0x244c63);}return _0x568af4['status'](_0x244c63)[_0xf1e9('0x1e')]();};}function respondWithResult(_0x40a3b0,_0x117c7f){_0x117c7f=_0x117c7f||0xc8;return function(_0x1cc778){if(_0x1cc778){return _0x40a3b0[_0xf1e9('0x1f')](_0x117c7f)[_0xf1e9('0x20')](_0x1cc778);}};}function respondWithFilteredResult(_0x53e3db,_0x4bf6b6){return function(_0x54312f){if(_0x54312f){var _0x5348e3=typeof _0x4bf6b6[_0xf1e9('0x21')]===_0xf1e9('0x22')&&typeof _0x4bf6b6[_0xf1e9('0x23')]===_0xf1e9('0x22');var _0x1f5239=_0x54312f[_0xf1e9('0x24')];var _0x5ecf23=_0x5348e3?0x0:_0x4bf6b6[_0xf1e9('0x21')];var _0x43b7d0=_0x5348e3?_0x54312f[_0xf1e9('0x24')]:_0x4bf6b6[_0xf1e9('0x21')]+_0x4bf6b6[_0xf1e9('0x23')];var _0x59790e;if(_0x43b7d0>=_0x1f5239){_0x43b7d0=_0x1f5239;_0x59790e=0xc8;}else{_0x59790e=0xce;}_0x53e3db[_0xf1e9('0x1f')](_0x59790e);return _0x53e3db['set']('Content-Range',_0x5ecf23+'-'+_0x43b7d0+'/'+_0x1f5239)[_0xf1e9('0x20')](_0x54312f);}return null;};}function patchUpdates(_0x5169d7){return function(_0x8819dd){try{jsonpatch[_0xf1e9('0x25')](_0x8819dd,_0x5169d7,!![]);}catch(_0x46640b){return BPromise[_0xf1e9('0x26')](_0x46640b);}return _0x8819dd[_0xf1e9('0x27')]();};}function saveUpdates(_0x4b77c2,_0x180b8d){return function(_0x321874){if(_0x321874){return _0x321874[_0xf1e9('0x28')](_0x4b77c2)['then'](function(_0x37744b){return _0x37744b;});}return null;};}function removeEntity(_0x4919c8,_0x414be1){return function(_0x50c83e){if(_0x50c83e){return _0x50c83e[_0xf1e9('0x29')]()[_0xf1e9('0x2a')](function(){_0x4919c8[_0xf1e9('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a00e7,_0x423b1e){return function(_0x3879d9){if(!_0x3879d9){_0x4a00e7['sendStatus'](0x194);}return _0x3879d9;};}function handleError(_0x240b50,_0x3f516e){_0x3f516e=_0x3f516e||0x1f4;return function(_0x48211b){logger[_0xf1e9('0x2b')](_0x48211b['stack']);if(_0x48211b[_0xf1e9('0x2c')]){delete _0x48211b[_0xf1e9('0x2c')];}_0x240b50['status'](_0x3f516e)[_0xf1e9('0x2d')](_0x48211b);};}exports[_0xf1e9('0x2e')]=function(_0x2d1b93,_0x443ad4){var _0x47ec95={},_0x3ca6e6={},_0x51a4c7={'count':0x0,'rows':[]};var _0x4676c5=_['map'](db['ChatInternalMessage'][_0xf1e9('0x2f')],function(_0x2dfde0){return{'name':_0x2dfde0[_0xf1e9('0x30')],'type':_0x2dfde0[_0xf1e9('0x31')][_0xf1e9('0x32')]};});_0x3ca6e6[_0xf1e9('0x33')]=_[_0xf1e9('0x34')](_0x4676c5,_0xf1e9('0x2c'));_0x3ca6e6[_0xf1e9('0x35')]=_['keys'](_0x2d1b93[_0xf1e9('0x35')]);_0x3ca6e6[_0xf1e9('0x36')]=_[_0xf1e9('0x37')](_0x3ca6e6['model'],_0x3ca6e6[_0xf1e9('0x35')]);_0x47ec95['attributes']=_[_0xf1e9('0x37')](_0x3ca6e6[_0xf1e9('0x33')],qs['fields'](_0x2d1b93[_0xf1e9('0x35')][_0xf1e9('0x38')]));_0x47ec95['attributes']=_0x47ec95[_0xf1e9('0x39')]['length']?_0x47ec95[_0xf1e9('0x39')]:_0x3ca6e6[_0xf1e9('0x33')];if(!_0x2d1b93['query'][_0xf1e9('0x3a')](_0xf1e9('0x3b'))){_0x47ec95[_0xf1e9('0x23')]=qs[_0xf1e9('0x23')](_0x2d1b93[_0xf1e9('0x35')][_0xf1e9('0x23')]);_0x47ec95[_0xf1e9('0x21')]=qs[_0xf1e9('0x21')](_0x2d1b93[_0xf1e9('0x35')][_0xf1e9('0x21')]);}_0x47ec95[_0xf1e9('0x3c')]=qs[_0xf1e9('0x3d')](_0x2d1b93[_0xf1e9('0x35')]['sort']);_0x47ec95['where']=qs[_0xf1e9('0x36')](_['pick'](_0x2d1b93[_0xf1e9('0x35')],_0x3ca6e6[_0xf1e9('0x36')]),_0x4676c5);if(_0x2d1b93[_0xf1e9('0x35')][_0xf1e9('0x3e')]){_0x47ec95['where']=_['merge'](_0x47ec95[_0xf1e9('0x3f')],{'$or':_[_0xf1e9('0x34')](_0x4676c5,function(_0x2b1a63){if(_0x2b1a63[_0xf1e9('0x31')]!==_0xf1e9('0x40')){var _0x5eb5df={};_0x5eb5df[_0x2b1a63['name']]={'$like':'%'+_0x2d1b93[_0xf1e9('0x35')][_0xf1e9('0x3e')]+'%'};return _0x5eb5df;}})});}_0x47ec95=_[_0xf1e9('0x41')]({},_0x47ec95,_0x2d1b93[_0xf1e9('0x42')]);var _0x68a24c={'where':_0x47ec95[_0xf1e9('0x3f')]};return db[_0xf1e9('0x43')][_0xf1e9('0x24')](_0x68a24c)[_0xf1e9('0x2a')](function(_0x37784c){_0x51a4c7[_0xf1e9('0x24')]=_0x37784c;if(_0x2d1b93['query'][_0xf1e9('0x44')]){_0x47ec95['include']=[{'all':!![]}];}return db[_0xf1e9('0x43')][_0xf1e9('0x45')](_0x47ec95);})[_0xf1e9('0x2a')](function(_0x1ca10d){_0x51a4c7['rows']=_0x1ca10d;return _0x51a4c7;})[_0xf1e9('0x2a')](respondWithFilteredResult(_0x443ad4,_0x47ec95))[_0xf1e9('0x46')](handleError(_0x443ad4,null));};exports['show']=function(_0x34929e,_0x3c21d5){var _0x380a02={'raw':!![],'where':{'id':_0x34929e['params']['id']}},_0x3f8dee={};_0x3f8dee['model']=_[_0xf1e9('0x47')](db[_0xf1e9('0x43')][_0xf1e9('0x2f')]);_0x3f8dee[_0xf1e9('0x35')]=_[_0xf1e9('0x47')](_0x34929e[_0xf1e9('0x35')]);_0x3f8dee[_0xf1e9('0x36')]=_[_0xf1e9('0x37')](_0x3f8dee[_0xf1e9('0x33')],_0x3f8dee[_0xf1e9('0x35')]);_0x380a02[_0xf1e9('0x39')]=_['intersection'](_0x3f8dee[_0xf1e9('0x33')],qs['fields'](_0x34929e['query'][_0xf1e9('0x38')]));_0x380a02[_0xf1e9('0x39')]=_0x380a02[_0xf1e9('0x39')]['length']?_0x380a02[_0xf1e9('0x39')]:_0x3f8dee[_0xf1e9('0x33')];if(_0x34929e['query'][_0xf1e9('0x44')]){_0x380a02[_0xf1e9('0x48')]=[{'all':!![]}];}_0x380a02=_[_0xf1e9('0x41')]({},_0x380a02,_0x34929e[_0xf1e9('0x42')]);return db[_0xf1e9('0x43')][_0xf1e9('0x49')](_0x380a02)[_0xf1e9('0x2a')](handleEntityNotFound(_0x3c21d5,null))['then'](respondWithResult(_0x3c21d5,null))['catch'](handleError(_0x3c21d5,null));};exports[_0xf1e9('0x4a')]=function(_0x4c3d43,_0x5e5a7b){return db[_0xf1e9('0x43')][_0xf1e9('0x4a')](_0x4c3d43[_0xf1e9('0x4b')],{})[_0xf1e9('0x2a')](respondWithResult(_0x5e5a7b,0xc9))[_0xf1e9('0x46')](handleError(_0x5e5a7b,null));};exports['update']=function(_0x332af4,_0x1f6522){if(_0x332af4[_0xf1e9('0x4b')]['id']){delete _0x332af4[_0xf1e9('0x4b')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x332af4[_0xf1e9('0x4c')]['id']}})[_0xf1e9('0x2a')](handleEntityNotFound(_0x1f6522,null))[_0xf1e9('0x2a')](saveUpdates(_0x332af4[_0xf1e9('0x4b')],null))[_0xf1e9('0x2a')](respondWithResult(_0x1f6522,null))[_0xf1e9('0x46')](handleError(_0x1f6522,null));};exports[_0xf1e9('0x29')]=function(_0x55bee9,_0x5990c7){return db[_0xf1e9('0x43')]['find']({'where':{'id':_0x55bee9[_0xf1e9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5990c7,null))[_0xf1e9('0x2a')](removeEntity(_0x5990c7,null))[_0xf1e9('0x46')](handleError(_0x5990c7,null));};exports[_0xf1e9('0x4d')]=function(_0x5f2f75,_0x3fd160){return db[_0xf1e9('0x43')][_0xf1e9('0x4d')]()[_0xf1e9('0x2a')](respondWithResult(_0x3fd160,null))[_0xf1e9('0x46')](handleError(_0x3fd160,null));};function wrapUser(_0x2ddc8b){return function(_0x17f759){var _0x2aebb0=_0x2ddc8b[_0xf1e9('0x4e')]({'plain':!![]});_0x2aebb0[_0xf1e9('0x4f')]=[];if(_0x17f759){_0x2aebb0[_0xf1e9('0x50')]=_0x17f759[_0xf1e9('0x51')];_0x2aebb0['lastMessage']=_0x17f759;}else{_0x2aebb0[_0xf1e9('0x50')]=moment(0x0)[_0xf1e9('0x52')](_0xf1e9('0x53'));_0x2aebb0[_0xf1e9('0x54')]={};}return _0x2aebb0;};}exports[_0xf1e9('0x55')]=function(_0x48ee7a,_0x44e890,_0x12cb39){var _0x5bc962=[];return db[_0xf1e9('0x56')]['findAll']({'where':{'role':[_0xf1e9('0x57'),'admin',_0xf1e9('0x58')]},'attributes':['id','fullname',_0xf1e9('0x2c'),_0xf1e9('0x59'),_0xf1e9('0x5a'),_0xf1e9('0x5b'),'online',_0xf1e9('0x5c'),'allowmessenger',_0xf1e9('0x5d')],'order':qs[_0xf1e9('0x3d')]('-online'),'include':[{'model':db[_0xf1e9('0x5e')],'as':_0xf1e9('0x5f'),'attributes':['id','name',_0xf1e9('0x31')],'through':{'attributes':[]}}]})[_0xf1e9('0x2a')](function(_0x13f02c){if(_0x13f02c){var _0x1bebb5=_0x48ee7a[_0xf1e9('0x58')][_0xf1e9('0x4e')]({'plain':!![]});if(!_0x1bebb5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1bebb5[_0xf1e9('0x59')]===_0xf1e9('0x58')){return db[_0xf1e9('0x60')][_0xf1e9('0x49')]({'where':{'name':_0xf1e9('0x61'),'userProfileId':_0x1bebb5[_0xf1e9('0x62')]},'raw':!![]})[_0xf1e9('0x2a')](function(_0x1c5ea4){if(_0x1c5ea4){if(_0x1c5ea4[_0xf1e9('0x63')]===0x0){return db[_0xf1e9('0x64')][_0xf1e9('0x45')]({'where':{'sectionId':_0x1c5ea4['id']},'raw':!![]})[_0xf1e9('0x2a')](function(_0x5f2a9b){var _0x5c097a=[];if(_['isEmpty'](_0x5f2a9b)){_0x5c097a=_[_0xf1e9('0x3e')](_0x13f02c,function(_0x2d3873){if(_0x2d3873[_0xf1e9('0x59')]!==_0xf1e9('0x57')){return _0x2d3873;}});return _0x5c097a;}else{for(var _0x3216b8=0x0;_0x3216b8<_0x13f02c[_0xf1e9('0x65')];_0x3216b8++){var _0x2ad208=_0x13f02c[_0x3216b8];if(_0x2ad208[_0xf1e9('0x59')]===_0xf1e9('0x57')){var _0x1075b5=_[_0xf1e9('0x49')](_0x5f2a9b,function(_0x43af9d){return _0x43af9d['resourceId']===_0x2ad208['id'];});if(_0x1075b5)_0x5c097a[_0xf1e9('0x66')](_0x2ad208);}else{_0x5c097a[_0xf1e9('0x66')](_0x2ad208);}}return _0x5c097a;}});}else{return _0x13f02c;}}else{var _0x2792cc=_[_0xf1e9('0x3e')](_0x13f02c,function(_0x5b8e1c){if(_0x5b8e1c[_0xf1e9('0x59')]!==_0xf1e9('0x57')){return _0x5b8e1c;}});return _0x2792cc;}});}else{return _0x13f02c;}}})[_0xf1e9('0x2a')](function(_0x25327c){var _0xb37281=[];if(_0x25327c){_0x5bc962=_0x25327c;for(var _0x101b28=0x0;_0x101b28<_0x25327c[_0xf1e9('0x65')];_0x101b28+=0x1){_0x5bc962[_0x101b28]['messages']=[];_0xb37281['push'](db['ChatInternalMessage'][_0xf1e9('0x49')]({'where':{'FromId':[_0x48ee7a[_0xf1e9('0x58')]['id'],_0x25327c[_0x101b28]['id']],'ToId':[_0x48ee7a[_0xf1e9('0x58')]['id'],_0x25327c[_0x101b28]['id']],'ChatGroupId':null},'attributes':['id',_0xf1e9('0x51'),_0xf1e9('0x67'),_0xf1e9('0x68'),_0xf1e9('0x69'),_0xf1e9('0x4b')],'order':qs['sort'](_0xf1e9('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xf1e9('0x2a')](wrapUser(_0x25327c[_0x101b28])));}return BPromise[_0xf1e9('0x6b')](_0xb37281);}return[];})[_0xf1e9('0x2a')](function(_0x14f375){return{'rows':_0x14f375,'count':_0x14f375[_0xf1e9('0x65')]};})['then'](respondWithResult(_0x44e890,null))[_0xf1e9('0x46')](handleError(_0x44e890,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 91fce77..9f7a248 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 _0xc021=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc021,0x15d));var _0x1c02=function(_0x386958,_0x55d171){_0x386958=_0x386958-0x0;var _0x33119a=_0xc021[_0x386958];return _0x33119a;};'use strict';var EventEmitter=require(_0x1c02('0x0'));var ChatInternalMessage=require(_0x1c02('0x1'))['db'][_0x1c02('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x1c02('0x3')](0x0);var events={'afterCreate':_0x1c02('0x4'),'afterUpdate':_0x1c02('0x5'),'afterDestroy':_0x1c02('0x6')};function emitEvent(_0x2399ff){return function(_0x2784e5,_0x14ed3d,_0x271897){ChatInternalMessageEvents[_0x1c02('0x7')](_0x2399ff+':'+_0x2784e5['id'],_0x2784e5);ChatInternalMessageEvents[_0x1c02('0x7')](_0x2399ff,_0x2784e5);_0x271897(null);};}for(var e in events){if(events[_0x1c02('0x8')](e)){var event=events[e];ChatInternalMessage[_0x1c02('0x9')](e,emitEvent(event));}}module[_0x1c02('0xa')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xdde1=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb','setMaxListeners'];(function(_0x53d510,_0x539932){var _0x2a7907=function(_0x4aa1f6){while(--_0x4aa1f6){_0x53d510['push'](_0x53d510['shift']());}};_0x2a7907(++_0x539932);}(_0xdde1,0xf5));var _0x1dde=function(_0x35f154,_0x50c6e2){_0x35f154=_0x35f154-0x0;var _0x3302b6=_0xdde1[_0x35f154];return _0x3302b6;};'use strict';var EventEmitter=require(_0x1dde('0x0'));var ChatInternalMessage=require(_0x1dde('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x1dde('0x2')](0x0);var events={'afterCreate':_0x1dde('0x3'),'afterUpdate':_0x1dde('0x4'),'afterDestroy':_0x1dde('0x5')};function emitEvent(_0x4690a7){return function(_0x15078c,_0x4af0a1,_0x180389){ChatInternalMessageEvents[_0x1dde('0x6')](_0x4690a7+':'+_0x15078c['id'],_0x15078c);ChatInternalMessageEvents[_0x1dde('0x6')](_0x4690a7,_0x15078c);_0x180389(null);};}for(var e in events){if(events[_0x1dde('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 87b9d1c..4e858f1 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 _0xc545=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage'];(function(_0x4132bf,_0x53eae1){var _0x1f55a8=function(_0x129cd6){while(--_0x129cd6){_0x4132bf['push'](_0x4132bf['shift']());}};_0x1f55a8(++_0x53eae1);}(_0xc545,0x153));var _0x5c54=function(_0x1cb693,_0x20aab3){_0x1cb693=_0x1cb693-0x0;var _0x1726dc=_0xc545[_0x1cb693];return _0x1726dc;};'use strict';var _=require(_0x5c54('0x0'));var util=require(_0x5c54('0x1'));var logger=require(_0x5c54('0x2'))(_0x5c54('0x3'));var moment=require(_0x5c54('0x4'));var BPromise=require(_0x5c54('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5c54('0x6'));var config=require(_0x5c54('0x7'));var attributes=require(_0x5c54('0x8'));module[_0x5c54('0x9')]=function(_0x5d5185,_0x86654d){return _0x5d5185[_0x5c54('0xa')](_0x5c54('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5c54('0xc')});}; \ No newline at end of file +var _0x31db=['path','rimraf','./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','util','api','request-promise'];(function(_0x289c3e,_0x3614b5){var _0x25a4b3=function(_0x1ea94b){while(--_0x1ea94b){_0x289c3e['push'](_0x289c3e['shift']());}};_0x25a4b3(++_0x3614b5);}(_0x31db,0x96));var _0xb31d=function(_0x3c4dad,_0x25ffd5){_0x3c4dad=_0x3c4dad-0x0;var _0x1a4f49=_0x31db[_0x3c4dad];return _0x1a4f49;};'use strict';var _=require(_0xb31d('0x0'));var util=require(_0xb31d('0x1'));var logger=require('../../config/logger')(_0xb31d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb31d('0x3'));var fs=require('fs');var path=require(_0xb31d('0x4'));var rimraf=require(_0xb31d('0x5'));var config=require('../../config/environment');var attributes=require(_0xb31d('0x6'));module[_0xb31d('0x7')]=function(_0x2fc845,_0x4a0f4d){return _0x2fc845['define'](_0xb31d('0x8'),attributes,{'tableName':_0xb31d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb31d('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 10ab74e..c85fb7e 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 _0x1d4d=['message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','request','then','info','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1d4d,0x160));var _0xd1d4=function(_0x28f19b,_0x55b03d){_0x28f19b=_0x28f19b-0x0;var _0x3ab54b=_0x1d4d[_0x28f19b];return _0x3ab54b;};'use strict';var _=require(_0xd1d4('0x0'));var util=require(_0xd1d4('0x1'));var moment=require(_0xd1d4('0x2'));var BPromise=require(_0xd1d4('0x3'));var rs=require(_0xd1d4('0x4'));var fs=require('fs');var Redis=require(_0xd1d4('0x5'));var db=require(_0xd1d4('0x6'))['db'];var utils=require(_0xd1d4('0x7'));var logger=require(_0xd1d4('0x8'))(_0xd1d4('0x9'));var config=require('../../config/environment');var jayson=require(_0xd1d4('0xa'));var client=jayson[_0xd1d4('0xb')][_0xd1d4('0xc')]({'port':0x232a});config[_0xd1d4('0xd')]=_[_0xd1d4('0xe')](config[_0xd1d4('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xd1d4('0xf'))(new Redis(config['redis']));require(_0xd1d4('0x10'))['register'](socket);function respondWithRpcPromise(_0xbebf18,_0x8167a3,_0x203d7f){return new BPromise(function(_0x52ecbc,_0x5bba6a){return client[_0xd1d4('0x11')](_0xbebf18,_0x203d7f)[_0xd1d4('0x12')](function(_0x32405d){logger[_0xd1d4('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x8167a3,_0xd1d4('0x14'));logger['debug'](_0xd1d4('0x15'),_0x8167a3,'request\x20sent',JSON[_0xd1d4('0x16')](_0x32405d));if(_0x32405d[_0xd1d4('0x17')]){if(_0x32405d[_0xd1d4('0x17')][_0xd1d4('0x18')]===0x1f4){logger[_0xd1d4('0x17')](_0xd1d4('0x19'),_0x8167a3,_0x32405d[_0xd1d4('0x17')][_0xd1d4('0x1a')]);return _0x5bba6a(_0x32405d[_0xd1d4('0x17')][_0xd1d4('0x1a')]);}logger[_0xd1d4('0x17')](_0xd1d4('0x19'),_0x8167a3,_0x32405d[_0xd1d4('0x17')]['message']);return _0x52ecbc(_0x32405d[_0xd1d4('0x17')][_0xd1d4('0x1a')]);}else{logger[_0xd1d4('0x13')](_0xd1d4('0x19'),_0x8167a3,'request\x20sent');_0x52ecbc(_0x32405d['result'][_0xd1d4('0x1a')]);}})['catch'](function(_0x5883aa){logger['error'](_0xd1d4('0x19'),_0x8167a3,_0x5883aa);_0x5bba6a(_0x5883aa);});});} \ No newline at end of file +var _0x9f62=['code','ChatInternalMessage,\x20%s,\x20%s','message','result','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','request','info','request\x20sent','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f62,0x154));var _0x29f6=function(_0x4ec303,_0x5d4eb5){_0x4ec303=_0x4ec303-0x0;var _0x5516fe=_0x9f62[_0x4ec303];return _0x5516fe;};'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('./chatInternalMessage.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')]('ChatInternalMessage,\x20%s,\x20%s',_0x44db16,'request\x20sent');logger['debug']('ChatInternalMessage,\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']('ChatInternalMessage,\x20%s,\x20%s',_0x44db16,_0x29f6('0xe'));_0x5a0724(_0x17b69c[_0x29f6('0x14')][_0x29f6('0x13')]);}})['catch'](function(_0xcb90){logger[_0x29f6('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x44db16,_0xcb90);_0x29b3f5(_0xcb90);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 3baba37..e51b755 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 _0x30a0=['update','emit','removeListener','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x15fd57,_0xd96a98){var _0x1c9251=function(_0x4ea2ba){while(--_0x4ea2ba){_0x15fd57['push'](_0x15fd57['shift']());}};_0x1c9251(++_0xd96a98);}(_0x30a0,0x16a));var _0x030a=function(_0xa6de8a,_0x2a9578){_0xa6de8a=_0xa6de8a-0x0;var _0x40654c=_0x30a0[_0xa6de8a];return _0x40654c;};'use strict';var ChatInternalMessageEvents=require(_0x030a('0x0'));var events=[_0x030a('0x1'),'remove',_0x030a('0x2')];function createListener(_0x5de685,_0x5c79db){return function(_0x5e4dd1){_0x5c79db[_0x030a('0x3')](_0x5de685,_0x5e4dd1);};}function removeListener(_0x198172,_0xa3a894){return function(){ChatInternalMessageEvents[_0x030a('0x4')](_0x198172,_0xa3a894);};}exports['register']=function(_0x17bdb5){for(var _0xb521b3=0x0,_0xdfcb24=events[_0x030a('0x5')];_0xb521b3<_0xdfcb24;_0xb521b3++){var _0x14918f=events[_0xb521b3];var _0x4dd88c=createListener(_0x030a('0x6')+_0x14918f,_0x17bdb5);ChatInternalMessageEvents['on'](_0x14918f,_0x4dd88c);}}; \ No newline at end of file +var _0x07e0=['remove','emit','removeListener','register','length','chatInternalMessage:','save'];(function(_0x134192,_0x36adc5){var _0x3cd080=function(_0x134371){while(--_0x134371){_0x134192['push'](_0x134192['shift']());}};_0x3cd080(++_0x36adc5);}(_0x07e0,0x117));var _0x007e=function(_0x1eba37,_0x4e5cfa){_0x1eba37=_0x1eba37-0x0;var _0xdea13=_0x07e0[_0x1eba37];return _0xdea13;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x007e('0x0'),_0x007e('0x1'),'update'];function createListener(_0x54b4b5,_0x26335b){return function(_0x5b721e){_0x26335b[_0x007e('0x2')](_0x54b4b5,_0x5b721e);};}function removeListener(_0xcfe18c,_0x2eff14){return function(){ChatInternalMessageEvents[_0x007e('0x3')](_0xcfe18c,_0x2eff14);};}exports[_0x007e('0x4')]=function(_0x5dd24a){for(var _0x5bc5a7=0x0,_0x2e61a8=events[_0x007e('0x5')];_0x5bc5a7<_0x2e61a8;_0x5bc5a7++){var _0x62255d=events[_0x5bc5a7];var _0x3c0a3d=createListener(_0x007e('0x6')+_0x62255d,_0x5dd24a);ChatInternalMessageEvents['on'](_0x62255d,_0x3c0a3d);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index f6d3338..d076747 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 _0xeb50=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/users','getUsers','create','put','/:id','destroy','exports','util','path','connect-timeout','express'];(function(_0x29507e,_0x5cbf20){var _0x1ec3eb=function(_0x51d250){while(--_0x51d250){_0x29507e['push'](_0x29507e['shift']());}};_0x1ec3eb(++_0x5cbf20);}(_0xeb50,0x152));var _0x0eb5=function(_0x527a53,_0x3265d6){_0x527a53=_0x527a53-0x0;var _0x2332f5=_0xeb50[_0x527a53];return _0x2332f5;};'use strict';var multer=require('multer');var util=require(_0x0eb5('0x0'));var path=require(_0x0eb5('0x1'));var timeout=require(_0x0eb5('0x2'));var express=require(_0x0eb5('0x3'));var router=express[_0x0eb5('0x4')]();var fs_extra=require(_0x0eb5('0x5'));var auth=require(_0x0eb5('0x6'));var interaction=require(_0x0eb5('0x7'));var config=require(_0x0eb5('0x8'));var controller=require('./chatInternalMessage.controller');router[_0x0eb5('0x9')]('/',auth[_0x0eb5('0xa')](),controller['index']);router['get']('/describe',auth[_0x0eb5('0xa')](),controller[_0x0eb5('0xb')]);router[_0x0eb5('0x9')](_0x0eb5('0xc'),auth[_0x0eb5('0xa')](),controller[_0x0eb5('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x0eb5('0xe')]);router[_0x0eb5('0xf')]('/:id',controller['update']);router['delete'](_0x0eb5('0x10'),auth[_0x0eb5('0xa')](),controller[_0x0eb5('0x11')]);module[_0x0eb5('0x12')]=router; \ No newline at end of file +var _0xb49d=['describe','/users','getUsers','create','/:id','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','/describe','isAuthenticated'];(function(_0xf81b04,_0x348467){var _0x3efc97=function(_0x9e0f00){while(--_0x9e0f00){_0xf81b04['push'](_0xf81b04['shift']());}};_0x3efc97(++_0x348467);}(_0xb49d,0x182));var _0xdb49=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb49d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xdb49('0x0'));var util=require(_0xdb49('0x1'));var path=require(_0xdb49('0x2'));var timeout=require('connect-timeout');var express=require(_0xdb49('0x3'));var router=express[_0xdb49('0x4')]();var fs_extra=require(_0xdb49('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdb49('0x6'));var config=require(_0xdb49('0x7'));var controller=require(_0xdb49('0x8'));router[_0xdb49('0x9')]('/',auth['isAuthenticated'](),controller[_0xdb49('0xa')]);router[_0xdb49('0x9')](_0xdb49('0xb'),auth[_0xdb49('0xc')](),controller[_0xdb49('0xd')]);router[_0xdb49('0x9')](_0xdb49('0xe'),auth[_0xdb49('0xc')](),controller[_0xdb49('0xf')]);router[_0xdb49('0x9')]('/:id',auth[_0xdb49('0xc')](),controller['show']);router['post']('/',auth[_0xdb49('0xc')](),controller[_0xdb49('0x10')]);router['put'](_0xdb49('0x11'),controller[_0xdb49('0x12')]);router[_0xdb49('0x13')](_0xdb49('0x11'),auth[_0xdb49('0xc')](),controller['destroy']);module[_0xdb49('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 71244f6..9704829 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 _0x56bd=['out','STRING','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0xf32c6d,_0x372704){var _0x156c11=function(_0x34ef76){while(--_0x34ef76){_0xf32c6d['push'](_0xf32c6d['shift']());}};_0x156c11(++_0x372704);}(_0x56bd,0xe9));var _0xd56b=function(_0x5cd565,_0x3145de){_0x5cd565=_0x5cd565-0x0;var _0x4da3ef=_0x56bd[_0x5cd565];return _0x4da3ef;};'use strict';var Sequelize=require('sequelize');module[_0xd56b('0x0')]={'body':{'type':Sequelize[_0xd56b('0x1')](_0xd56b('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xd56b('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd56b('0x4')]('in',_0xd56b('0x5')),'defaultValue':_0xd56b('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xd56b('0x6')]},'providerResponse':{'type':Sequelize[_0xd56b('0x1')]}}; \ No newline at end of file +var _0x61d0=['STRING','sequelize','TEXT','medium','BOOLEAN','out'];(function(_0x34cafc,_0x419a2a){var _0x2a3051=function(_0xaf9b5c){while(--_0xaf9b5c){_0x34cafc['push'](_0x34cafc['shift']());}};_0x2a3051(++_0x419a2a);}(_0x61d0,0x187));var _0x061d=function(_0x285800,_0x26765e){_0x285800=_0x285800-0x0;var _0x4b809e=_0x61d0[_0x285800];return _0x4b809e;};'use strict';var Sequelize=require(_0x061d('0x0'));module['exports']={'body':{'type':Sequelize[_0x061d('0x1')](_0x061d('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x061d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x061d('0x4')),'defaultValue':_0x061d('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x061d('0x5')]},'providerResponse':{'type':Sequelize[_0x061d('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 7e8922c..7b379e2 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 _0x6f49=['code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','end','stack','name','send','map','ChatMessage','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','pick','filters','filter','merge','type','VIRTUAL','options','where','includeAll','include','findAll','rows','show','params','find','create','body','describe','chat-interactions','accept','readAt','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','get','ChatInteraction','isNil','read1stAt','interaction','info','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','interface','format','channel','event','parse','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','Sequelize','fullname','email','internal','SIP/%s','motionChannel','EventManager','formData','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xa3588a,_0x4483e5){var _0x2bd1fc=function(_0x5f316b){while(--_0x5f316b){_0xa3588a['push'](_0xa3588a['shift']());}};_0x2bd1fc(++_0x4483e5);}(_0x6f49,0x168));var _0x96f4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6f49[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x96f4('0x0'));var rimraf=require(_0x96f4('0x1'));var zipdir=require(_0x96f4('0x2'));var jsonpatch=require(_0x96f4('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x96f4('0x4'));var Mustache=require(_0x96f4('0x5'));var util=require(_0x96f4('0x6'));var path=require(_0x96f4('0x7'));var sox=require(_0x96f4('0x8'));var csv=require('to-csv');var ejs=require(_0x96f4('0x9'));var fs=require('fs');var fs_extra=require(_0x96f4('0xa'));var _=require(_0x96f4('0xb'));var squel=require(_0x96f4('0xc'));var crypto=require(_0x96f4('0xd'));var jsforce=require(_0x96f4('0xe'));var deskjs=require(_0x96f4('0xf'));var toCsv=require(_0x96f4('0x10'));var querystring=require(_0x96f4('0x11'));var Papa=require(_0x96f4('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x96f4('0x13'));var hardwareService=require(_0x96f4('0x14'));var logger=require(_0x96f4('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x96f4('0x16'));var licenseUtil=require(_0x96f4('0x17'));var db=require('../../mysqldb')['db'];config[_0x96f4('0x18')]=_['defaults'](config[_0x96f4('0x18')],{'host':_0x96f4('0x19'),'port':0x18eb});var socket=require(_0x96f4('0x1a'))(new Redis(config[_0x96f4('0x18')]));require(_0x96f4('0x1b'))[_0x96f4('0x1c')](socket);var jayson=require(_0x96f4('0x1d'));var client=jayson['client'][_0x96f4('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x96f4('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x240091,_0x4afbf0,_0x34fc0c,_0x536c0b){return new BPromise(function(_0x479d5b,_0xd1415b){var _0x4af9ab=_0x536c0b||client;return _0x4af9ab[_0x96f4('0x1f')](_0x240091,_0x34fc0c)[_0x96f4('0x20')](function(_0x1eedf1){logger['info'](_0x96f4('0x21'),_0x4afbf0,_0x96f4('0x22'));logger[_0x96f4('0x23')](_0x96f4('0x24'),_0x4afbf0,_0x96f4('0x22'),JSON[_0x96f4('0x25')](_0x1eedf1));if(_0x1eedf1[_0x96f4('0x26')]){if(_0x1eedf1['error'][_0x96f4('0x27')]===0x1f4){logger['error'](_0x96f4('0x21'),_0x4afbf0,_0x1eedf1['error'][_0x96f4('0x28')]);return _0xd1415b(_0x1eedf1[_0x96f4('0x26')]['message']);}logger[_0x96f4('0x26')](_0x96f4('0x21'),_0x4afbf0,_0x1eedf1['error']['message']);return _0x479d5b(_0x1eedf1['error'][_0x96f4('0x28')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x4afbf0,_0x96f4('0x22'));_0x479d5b(_0x1eedf1[_0x96f4('0x29')][_0x96f4('0x28')]);}})[_0x96f4('0x2a')](function(_0x42bd84){logger['error'](_0x96f4('0x21'),_0x4afbf0,_0x42bd84);_0xd1415b(_0x42bd84);});});}function respondWithStatusCode(_0x1a25c0,_0x4cf763){_0x4cf763=_0x4cf763||0xcc;return function(_0x3b9677){if(_0x3b9677){return _0x1a25c0[_0x96f4('0x2b')](_0x4cf763);}return _0x1a25c0[_0x96f4('0x2c')](_0x4cf763)['end']();};}function respondWithResult(_0x2eafdf,_0x252b60){_0x252b60=_0x252b60||0xc8;return function(_0x1f1274){if(_0x1f1274){return _0x2eafdf[_0x96f4('0x2c')](_0x252b60)[_0x96f4('0x2d')](_0x1f1274);}};}function respondWithFilteredResult(_0xc64dd1,_0x4df310){return function(_0x4bd31e){if(_0x4bd31e){var _0x5481f4=typeof _0x4df310[_0x96f4('0x2e')]===_0x96f4('0x2f')&&typeof _0x4df310[_0x96f4('0x30')]===_0x96f4('0x2f');var _0x390e1c=_0x4bd31e[_0x96f4('0x31')];var _0xc9da3b=_0x5481f4?0x0:_0x4df310['offset'];var _0x48869e=_0x5481f4?_0x4bd31e[_0x96f4('0x31')]:_0x4df310[_0x96f4('0x2e')]+_0x4df310[_0x96f4('0x30')];var _0x511719;if(_0x48869e>=_0x390e1c){_0x48869e=_0x390e1c;_0x511719=0xc8;}else{_0x511719=0xce;}_0xc64dd1[_0x96f4('0x2c')](_0x511719);return _0xc64dd1[_0x96f4('0x32')](_0x96f4('0x33'),_0xc9da3b+'-'+_0x48869e+'/'+_0x390e1c)[_0x96f4('0x2d')](_0x4bd31e);}return null;};}function patchUpdates(_0xb2823d){return function(_0x341896){try{jsonpatch['apply'](_0x341896,_0xb2823d,!![]);}catch(_0x2d34ae){return BPromise[_0x96f4('0x34')](_0x2d34ae);}return _0x341896[_0x96f4('0x35')]();};}function saveUpdates(_0x29b701,_0x3e27f5){return function(_0xfc086){if(_0xfc086){return _0xfc086[_0x96f4('0x36')](_0x29b701)['then'](function(_0x2550f1){return _0x2550f1;});}return null;};}function removeEntity(_0x8d85a4,_0x46b627){return function(_0x4ff6b3){if(_0x4ff6b3){return _0x4ff6b3[_0x96f4('0x37')]()['then'](function(){_0x8d85a4['status'](0xcc)[_0x96f4('0x38')]();});}};}function handleEntityNotFound(_0x3f0915,_0x4d0a06){return function(_0x2b9c7f){if(!_0x2b9c7f){_0x3f0915[_0x96f4('0x2b')](0x194);}return _0x2b9c7f;};}function handleError(_0xc5ea27,_0x2f2b38){_0x2f2b38=_0x2f2b38||0x1f4;return function(_0x4f62e0){logger[_0x96f4('0x26')](_0x4f62e0[_0x96f4('0x39')]);if(_0x4f62e0['name']){delete _0x4f62e0[_0x96f4('0x3a')];}_0xc5ea27[_0x96f4('0x2c')](_0x2f2b38)[_0x96f4('0x3b')](_0x4f62e0);};}exports['index']=function(_0x3246a1,_0x398ec7){var _0xe20012={},_0x27b095={},_0x1328b2={'count':0x0,'rows':[]};var _0x514a7b=_[_0x96f4('0x3c')](db[_0x96f4('0x3d')][_0x96f4('0x3e')],function(_0x353bc2){return{'name':_0x353bc2[_0x96f4('0x3f')],'type':_0x353bc2['type'][_0x96f4('0x40')]};});_0x27b095[_0x96f4('0x41')]=_[_0x96f4('0x3c')](_0x514a7b,'name');_0x27b095['query']=_[_0x96f4('0x42')](_0x3246a1[_0x96f4('0x43')]);_0x27b095['filters']=_[_0x96f4('0x44')](_0x27b095[_0x96f4('0x41')],_0x27b095[_0x96f4('0x43')]);_0xe20012[_0x96f4('0x45')]=_[_0x96f4('0x44')](_0x27b095[_0x96f4('0x41')],qs['fields'](_0x3246a1[_0x96f4('0x43')][_0x96f4('0x46')]));_0xe20012['attributes']=_0xe20012['attributes'][_0x96f4('0x47')]?_0xe20012[_0x96f4('0x45')]:_0x27b095['model'];if(!_0x3246a1[_0x96f4('0x43')]['hasOwnProperty'](_0x96f4('0x48'))){_0xe20012['limit']=qs[_0x96f4('0x30')](_0x3246a1[_0x96f4('0x43')][_0x96f4('0x30')]);_0xe20012['offset']=qs[_0x96f4('0x2e')](_0x3246a1['query']['offset']);}_0xe20012[_0x96f4('0x49')]=qs[_0x96f4('0x4a')](_0x3246a1[_0x96f4('0x43')]['sort']);_0xe20012['where']=qs['filters'](_[_0x96f4('0x4b')](_0x3246a1[_0x96f4('0x43')],_0x27b095[_0x96f4('0x4c')]),_0x514a7b);if(_0x3246a1[_0x96f4('0x43')][_0x96f4('0x4d')]){_0xe20012['where']=_[_0x96f4('0x4e')](_0xe20012['where'],{'$or':_[_0x96f4('0x3c')](_0x514a7b,function(_0x212649){if(_0x212649[_0x96f4('0x4f')]!==_0x96f4('0x50')){var _0x3e74db={};_0x3e74db[_0x212649[_0x96f4('0x3a')]]={'$like':'%'+_0x3246a1[_0x96f4('0x43')][_0x96f4('0x4d')]+'%'};return _0x3e74db;}})});}_0xe20012=_[_0x96f4('0x4e')]({},_0xe20012,_0x3246a1[_0x96f4('0x51')]);var _0xec1d45={'where':_0xe20012[_0x96f4('0x52')]};return db[_0x96f4('0x3d')][_0x96f4('0x31')](_0xec1d45)[_0x96f4('0x20')](function(_0x554d1a){_0x1328b2[_0x96f4('0x31')]=_0x554d1a;if(_0x3246a1['query'][_0x96f4('0x53')]){_0xe20012[_0x96f4('0x54')]=[{'all':!![]}];}return db[_0x96f4('0x3d')][_0x96f4('0x55')](_0xe20012);})['then'](function(_0x38246c){_0x1328b2[_0x96f4('0x56')]=_0x38246c;return _0x1328b2;})[_0x96f4('0x20')](respondWithFilteredResult(_0x398ec7,_0xe20012))[_0x96f4('0x2a')](handleError(_0x398ec7,null));};exports[_0x96f4('0x57')]=function(_0x2524ae,_0x33dbe1){var _0x20544b={'raw':!![],'where':{'id':_0x2524ae[_0x96f4('0x58')]['id']}},_0x5e47b0={};_0x5e47b0['model']=_[_0x96f4('0x42')](db[_0x96f4('0x3d')]['rawAttributes']);_0x5e47b0[_0x96f4('0x43')]=_[_0x96f4('0x42')](_0x2524ae[_0x96f4('0x43')]);_0x5e47b0[_0x96f4('0x4c')]=_['intersection'](_0x5e47b0['model'],_0x5e47b0[_0x96f4('0x43')]);_0x20544b[_0x96f4('0x45')]=_[_0x96f4('0x44')](_0x5e47b0['model'],qs[_0x96f4('0x46')](_0x2524ae['query'][_0x96f4('0x46')]));_0x20544b[_0x96f4('0x45')]=_0x20544b[_0x96f4('0x45')][_0x96f4('0x47')]?_0x20544b['attributes']:_0x5e47b0['model'];if(_0x2524ae[_0x96f4('0x43')]['includeAll']){_0x20544b[_0x96f4('0x54')]=[{'all':!![]}];}_0x20544b=_[_0x96f4('0x4e')]({},_0x20544b,_0x2524ae[_0x96f4('0x51')]);return db[_0x96f4('0x3d')][_0x96f4('0x59')](_0x20544b)[_0x96f4('0x20')](handleEntityNotFound(_0x33dbe1,null))['then'](respondWithResult(_0x33dbe1,null))[_0x96f4('0x2a')](handleError(_0x33dbe1,null));};exports[_0x96f4('0x5a')]=function(_0xe75229,_0x571bd0){return db[_0x96f4('0x3d')]['create'](_0xe75229[_0x96f4('0x5b')],{})['then'](respondWithResult(_0x571bd0,0xc9))[_0x96f4('0x2a')](handleError(_0x571bd0,null));};exports['update']=function(_0x2c4d40,_0x20aafe){if(_0x2c4d40['body']['id']){delete _0x2c4d40[_0x96f4('0x5b')]['id'];}return db[_0x96f4('0x3d')][_0x96f4('0x59')]({'where':{'id':_0x2c4d40[_0x96f4('0x58')]['id']}})['then'](handleEntityNotFound(_0x20aafe,null))[_0x96f4('0x20')](saveUpdates(_0x2c4d40['body'],null))[_0x96f4('0x20')](respondWithResult(_0x20aafe,null))[_0x96f4('0x2a')](handleError(_0x20aafe,null));};exports[_0x96f4('0x37')]=function(_0x177340,_0x80c3a6){return db[_0x96f4('0x3d')][_0x96f4('0x59')]({'where':{'id':_0x177340[_0x96f4('0x58')]['id']}})[_0x96f4('0x20')](handleEntityNotFound(_0x80c3a6,null))[_0x96f4('0x20')](removeEntity(_0x80c3a6,null))['catch'](handleError(_0x80c3a6,null));};exports[_0x96f4('0x5c')]=function(_0x1e3eb8,_0x518453){return db[_0x96f4('0x3d')][_0x96f4('0x5c')]()[_0x96f4('0x20')](respondWithResult(_0x518453,null))['catch'](handleError(_0x518453,null));};var interaction_log=require(_0x96f4('0x15'))(_0x96f4('0x5d'));exports[_0x96f4('0x5e')]=function(_0x226cfc,_0xfb232b,_0x5951c0){var _0x5227cf={'agent':{},'channel':'chat'};if(_0x226cfc[_0x96f4('0x5b')]['id']){delete _0x226cfc[_0x96f4('0x5b')]['id'];}_0x226cfc[_0x96f4('0x5b')]['read']=!![];_0x226cfc[_0x96f4('0x5b')][_0x96f4('0x5f')]=moment()['format'](_0x96f4('0x60'));_0x226cfc[_0x96f4('0x5b')]['UserId']=_0x226cfc[_0x96f4('0x5b')]['UserId']||_0x226cfc[_0x96f4('0x61')]['id'];_0x5227cf[_0x96f4('0x62')]['id']=_0x226cfc['body'][_0x96f4('0x63')];return db[_0x96f4('0x3d')][_0x96f4('0x59')]({'where':{'id':_0x226cfc[_0x96f4('0x58')]['id'],'UserId':null}})[_0x96f4('0x20')](handleEntityNotFound(_0xfb232b,null))[_0x96f4('0x20')](saveUpdates(_0x226cfc[_0x96f4('0x5b')],null))[_0x96f4('0x20')](function(_0x5221f6){if(_0x5221f6){_0x5227cf[_0x96f4('0x28')]=_0x5221f6[_0x96f4('0x64')]({'plain':!![]});return db[_0x96f4('0x65')][_0x96f4('0x59')]({'where':{'id':_0x5221f6['ChatInteractionId']}});}return null;})[_0x96f4('0x20')](handleEntityNotFound(_0xfb232b,null))[_0x96f4('0x20')](function(_0x3bedc4){if(_0x3bedc4){return _0x3bedc4[_0x96f4('0x36')]({'UserId':_0x226cfc[_0x96f4('0x5b')][_0x96f4('0x63')],'read1stAt':_[_0x96f4('0x66')](_0x3bedc4[_0x96f4('0x67')])?moment()['format'](_0x96f4('0x60')):undefined});}return null;})[_0x96f4('0x20')](function(_0x57565e){if(_0x57565e){_0x5227cf[_0x96f4('0x68')]=_0x57565e[_0x96f4('0x64')]({'plain':!![]});interaction_log[_0x96f4('0x69')](_0x96f4('0x6a'),_0x226cfc['user']['id'],_0x226cfc['user'][_0x96f4('0x3a')],_0x226cfc[_0x96f4('0x61')]['role'],_0x5227cf[_0x96f4('0x68')]['id'],_0x226cfc[_0x96f4('0x5b')]?JSON[_0x96f4('0x25')](_0x226cfc[_0x96f4('0x5b')]):_0x96f4('0x6b'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x5227cf);}return null;})[_0x96f4('0x20')](function(_0x4a3381){var _0x3d071e=_0x96f4('0x6c')+_0x4a3381[_0x96f4('0x28')][_0x96f4('0x6d')];return db[_0x96f4('0x6e')]['query'](_0x3d071e,{'type':db['Sequelize'][_0x96f4('0x6f')][_0x96f4('0x70')],'raw':!![]})[_0x96f4('0x20')](function(_0x237977){return _0x237977;});})[_0x96f4('0x20')](function(_0x1f455e){if(_0x1f455e){_0x5227cf[_0x96f4('0x28')][_0x96f4('0x71')]=_0x1f455e[0x0];if(!_0x226cfc['body'][_0x96f4('0x63')])return;return db[_0x96f4('0x72')][_0x96f4('0x59')]({'where':{'id':_0x226cfc[_0x96f4('0x5b')][_0x96f4('0x63')],'role':_0x96f4('0x62')},'attributes':['id','name','fullname','email','internal'],'raw':!![]});}return null;})[_0x96f4('0x20')](function(_0x43f7ad){if(!_0x43f7ad)return null;_0x5227cf['message'][_0x96f4('0x62')]=_0x43f7ad;return _0x5227cf;})[_0x96f4('0x20')](function(_0xaff078){if(_0xaff078){if(_0x226cfc['body']['manual']){_0x5227cf['message'][_0x96f4('0x73')]=util[_0x96f4('0x74')]('SIP/%s',_0x226cfc[_0x96f4('0x61')][_0x96f4('0x3a')]);_0x5227cf[_0x96f4('0x28')][_0x96f4('0x75')]=_0x5227cf[_0x96f4('0x75')];_0x5227cf[_0x96f4('0x28')]['motionChannel']=_0x5227cf[_0x96f4('0x75')];_0x5227cf[_0x96f4('0x28')][_0x96f4('0x76')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_[_0x96f4('0x4e')](_0x5227cf['message'],JSON[_0x96f4('0x77')](_0x5227cf[_0x96f4('0x68')]['formData']))},client9002)[_0x96f4('0x20')](function(){return _0x5227cf;});}return _0x5227cf;}return null;})[_0x96f4('0x20')](respondWithResult(_0xfb232b,null))[_0x96f4('0x2a')](handleError(_0xfb232b,null));};var interaction_log=require(_0x96f4('0x15'))(_0x96f4('0x5d'));exports[_0x96f4('0x34')]=function(_0x18751c,_0x21f8d8,_0x37795d){var _0x2e6174={'agent':{},'channel':_0x96f4('0x78')};if(_0x18751c['body']['id']){delete _0x18751c[_0x96f4('0x5b')]['id'];}_0x18751c[_0x96f4('0x5b')][_0x96f4('0x63')]=_0x18751c[_0x96f4('0x5b')][_0x96f4('0x63')]||_0x18751c[_0x96f4('0x61')]['id'];_0x2e6174[_0x96f4('0x62')]['id']=_0x18751c[_0x96f4('0x5b')]['UserId'];return db[_0x96f4('0x3d')]['find']({'where':{'id':_0x18751c['params']['id'],'UserId':null}})[_0x96f4('0x20')](handleEntityNotFound(_0x21f8d8,null))['then'](function(_0x50a5d3){if(_0x50a5d3){_0x2e6174['message']=_0x50a5d3[_0x96f4('0x64')]({'plain':!![]});return db[_0x96f4('0x65')][_0x96f4('0x59')]({'where':{'id':_0x50a5d3['ChatInteractionId']}});}return null;})[_0x96f4('0x20')](handleEntityNotFound(_0x21f8d8,null))[_0x96f4('0x20')](function(_0x283e73){if(_0x283e73){_0x2e6174[_0x96f4('0x68')]=_0x283e73['get']({'plain':!![]});interaction_log[_0x96f4('0x69')](_0x96f4('0x79'),_0x18751c[_0x96f4('0x61')]['id'],_0x18751c[_0x96f4('0x61')][_0x96f4('0x3a')],_0x18751c[_0x96f4('0x61')][_0x96f4('0x7a')],_0x2e6174[_0x96f4('0x68')]['id'],_0x18751c[_0x96f4('0x5b')]?JSON['stringify'](_0x18751c[_0x96f4('0x5b')]):'null');return respondWithRpcPromise(_0x96f4('0x7b'),_0x96f4('0x7c'),_0x2e6174);}return null;})[_0x96f4('0x20')](function(_0x24349d){var _0x4f6359=_0x96f4('0x6c')+_0x24349d[_0x96f4('0x28')]['ContactId'];return db[_0x96f4('0x6e')]['query'](_0x4f6359,{'type':db[_0x96f4('0x7d')][_0x96f4('0x6f')][_0x96f4('0x70')],'raw':!![]})[_0x96f4('0x20')](function(_0x5a43eb){return _0x5a43eb;});})['then'](function(_0x508734){if(_0x508734){_0x2e6174[_0x96f4('0x28')]['contact']=_0x508734[0x0];if(!_0x18751c[_0x96f4('0x5b')][_0x96f4('0x63')])return;return db[_0x96f4('0x72')][_0x96f4('0x59')]({'where':{'id':_0x18751c['body']['UserId'],'role':'agent'},'attributes':['id',_0x96f4('0x3a'),_0x96f4('0x7e'),_0x96f4('0x7f'),_0x96f4('0x80')],'raw':!![]});}return null;})[_0x96f4('0x20')](function(_0x1b84d4){if(!_0x1b84d4)return null;_0x2e6174[_0x96f4('0x28')][_0x96f4('0x62')]=_0x1b84d4;return _0x2e6174;})[_0x96f4('0x20')](function(_0x1f2405){if(_0x1f2405){_0x1f2405['message']['interface']=util['format'](_0x96f4('0x81'),_0x18751c['user']['name']);_0x1f2405[_0x96f4('0x28')][_0x96f4('0x75')]=_0x2e6174['channel'];_0x1f2405['message'][_0x96f4('0x82')]=_0x2e6174[_0x96f4('0x75')];_0x1f2405['message'][_0x96f4('0x76')]=_0x96f4('0x34');respondWithRpcPromise(_0x96f4('0x83'),_0x96f4('0x83'),{'event':'rejectmessage','message':_['merge'](_0x2e6174[_0x96f4('0x28')],JSON[_0x96f4('0x77')](_0x2e6174[_0x96f4('0x68')][_0x96f4('0x84')]))},client9002);return _0x2e6174;}return null;})[_0x96f4('0x20')](respondWithResult(_0x21f8d8,null))[_0x96f4('0x2a')](handleError(_0x21f8d8,null));}; \ No newline at end of file +var _0x1025=['catch','sendStatus','status','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ChatMessage','count','includeAll','include','findAll','rows','show','params','find','create','body','describe','chat-interactions','accept','chat','format','UserId','ChatInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','stringify','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','agent','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','parse','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','sequelize','SIP/%s','rimraf','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../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','register','client','http','request','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result'];(function(_0x36f6fb,_0x249aa3){var _0x39c006=function(_0x2ba353){while(--_0x2ba353){_0x36f6fb['push'](_0x36f6fb['shift']());}};_0x39c006(++_0x249aa3);}(_0x1025,0x15b));var _0x5102=function(_0x514a57,_0x3f68f0){_0x514a57=_0x514a57-0x0;var _0x5814ac=_0x1025[_0x514a57];return _0x5814ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5102('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5102('0x1'));var rp=require(_0x5102('0x2'));var moment=require(_0x5102('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5102('0x4'));var path=require(_0x5102('0x5'));var sox=require(_0x5102('0x6'));var csv=require('to-csv');var ejs=require(_0x5102('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5102('0x8'));var squel=require(_0x5102('0x9'));var crypto=require('crypto');var jsforce=require(_0x5102('0xa'));var deskjs=require(_0x5102('0xb'));var toCsv=require(_0x5102('0xc'));var querystring=require('querystring');var Papa=require(_0x5102('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5102('0xe'));var as=require(_0x5102('0xf'));var hardwareService=require(_0x5102('0x10'));var logger=require(_0x5102('0x11'))(_0x5102('0x12'));var utils=require(_0x5102('0x13'));var config=require(_0x5102('0x14'));var licenseUtil=require(_0x5102('0x15'));var db=require(_0x5102('0x16'))['db'];config[_0x5102('0x17')]=_['defaults'](config['redis'],{'host':_0x5102('0x18'),'port':0x18eb});var socket=require(_0x5102('0x19'))(new Redis(config[_0x5102('0x17')]));require('./chatMessage.socket')[_0x5102('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5102('0x1b')][_0x5102('0x1c')]({'port':0x232c});var client9002=jayson[_0x5102('0x1b')][_0x5102('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d51bd,_0x5e19a8,_0x3a02b9,_0x380a87){return new BPromise(function(_0x238e10,_0x2fbb60){var _0xae64c4=_0x380a87||client;return _0xae64c4[_0x5102('0x1d')](_0x5d51bd,_0x3a02b9)['then'](function(_0x157c9d){logger[_0x5102('0x1e')](_0x5102('0x1f'),_0x5e19a8,'request\x20sent');logger['debug'](_0x5102('0x20'),_0x5e19a8,'request\x20sent',JSON['stringify'](_0x157c9d));if(_0x157c9d[_0x5102('0x21')]){if(_0x157c9d[_0x5102('0x21')]['code']===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x5e19a8,_0x157c9d[_0x5102('0x21')][_0x5102('0x22')]);return _0x2fbb60(_0x157c9d[_0x5102('0x21')][_0x5102('0x22')]);}logger[_0x5102('0x21')](_0x5102('0x1f'),_0x5e19a8,_0x157c9d[_0x5102('0x21')]['message']);return _0x238e10(_0x157c9d[_0x5102('0x21')][_0x5102('0x22')]);}else{logger['info'](_0x5102('0x1f'),_0x5e19a8,_0x5102('0x23'));_0x238e10(_0x157c9d[_0x5102('0x24')][_0x5102('0x22')]);}})[_0x5102('0x25')](function(_0x34e0f4){logger[_0x5102('0x21')]('ChatMessage,\x20%s,\x20%s',_0x5e19a8,_0x34e0f4);_0x2fbb60(_0x34e0f4);});});}function respondWithStatusCode(_0x468f5b,_0x3e9ad6){_0x3e9ad6=_0x3e9ad6||0xcc;return function(_0xc82fab){if(_0xc82fab){return _0x468f5b[_0x5102('0x26')](_0x3e9ad6);}return _0x468f5b[_0x5102('0x27')](_0x3e9ad6)['end']();};}function respondWithResult(_0x53927a,_0x4dd6eb){_0x4dd6eb=_0x4dd6eb||0xc8;return function(_0x314812){if(_0x314812){return _0x53927a[_0x5102('0x27')](_0x4dd6eb)[_0x5102('0x28')](_0x314812);}};}function respondWithFilteredResult(_0x3fd58a,_0xaea7cb){return function(_0x232306){if(_0x232306){var _0x1c4eb5=typeof _0xaea7cb['offset']===_0x5102('0x29')&&typeof _0xaea7cb[_0x5102('0x2a')]==='undefined';var _0x5bd69d=_0x232306['count'];var _0x22e214=_0x1c4eb5?0x0:_0xaea7cb[_0x5102('0x2b')];var _0x1fbabe=_0x1c4eb5?_0x232306['count']:_0xaea7cb[_0x5102('0x2b')]+_0xaea7cb[_0x5102('0x2a')];var _0x20b298;if(_0x1fbabe>=_0x5bd69d){_0x1fbabe=_0x5bd69d;_0x20b298=0xc8;}else{_0x20b298=0xce;}_0x3fd58a[_0x5102('0x27')](_0x20b298);return _0x3fd58a[_0x5102('0x2c')](_0x5102('0x2d'),_0x22e214+'-'+_0x1fbabe+'/'+_0x5bd69d)[_0x5102('0x28')](_0x232306);}return null;};}function patchUpdates(_0x3af300){return function(_0x4bca14){try{jsonpatch[_0x5102('0x2e')](_0x4bca14,_0x3af300,!![]);}catch(_0x328835){return BPromise[_0x5102('0x2f')](_0x328835);}return _0x4bca14[_0x5102('0x30')]();};}function saveUpdates(_0x518948,_0x4134c3){return function(_0x3e1a26){if(_0x3e1a26){return _0x3e1a26[_0x5102('0x31')](_0x518948)[_0x5102('0x32')](function(_0x7e2774){return _0x7e2774;});}return null;};}function removeEntity(_0x46acc3,_0x3f72fe){return function(_0x4d78d8){if(_0x4d78d8){return _0x4d78d8[_0x5102('0x33')]()['then'](function(){_0x46acc3[_0x5102('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b257a,_0x23321b){return function(_0x3cf41c){if(!_0x3cf41c){_0x4b257a[_0x5102('0x26')](0x194);}return _0x3cf41c;};}function handleError(_0x335a82,_0x5711c3){_0x5711c3=_0x5711c3||0x1f4;return function(_0x4c5f02){logger[_0x5102('0x21')](_0x4c5f02[_0x5102('0x34')]);if(_0x4c5f02[_0x5102('0x35')]){delete _0x4c5f02[_0x5102('0x35')];}_0x335a82[_0x5102('0x27')](_0x5711c3)[_0x5102('0x36')](_0x4c5f02);};}exports[_0x5102('0x37')]=function(_0x115555,_0x44e5af){var _0x2ccd5d={},_0x4ab014={},_0x51c6b3={'count':0x0,'rows':[]};var _0x273569=_[_0x5102('0x38')](db['ChatMessage'][_0x5102('0x39')],function(_0xefb324){return{'name':_0xefb324[_0x5102('0x3a')],'type':_0xefb324['type'][_0x5102('0x3b')]};});_0x4ab014[_0x5102('0x3c')]=_[_0x5102('0x38')](_0x273569,_0x5102('0x35'));_0x4ab014[_0x5102('0x3d')]=_[_0x5102('0x3e')](_0x115555[_0x5102('0x3d')]);_0x4ab014[_0x5102('0x3f')]=_['intersection'](_0x4ab014[_0x5102('0x3c')],_0x4ab014[_0x5102('0x3d')]);_0x2ccd5d[_0x5102('0x40')]=_[_0x5102('0x41')](_0x4ab014[_0x5102('0x3c')],qs[_0x5102('0x42')](_0x115555[_0x5102('0x3d')][_0x5102('0x42')]));_0x2ccd5d[_0x5102('0x40')]=_0x2ccd5d[_0x5102('0x40')][_0x5102('0x43')]?_0x2ccd5d['attributes']:_0x4ab014['model'];if(!_0x115555[_0x5102('0x3d')][_0x5102('0x44')](_0x5102('0x45'))){_0x2ccd5d[_0x5102('0x2a')]=qs[_0x5102('0x2a')](_0x115555[_0x5102('0x3d')][_0x5102('0x2a')]);_0x2ccd5d['offset']=qs[_0x5102('0x2b')](_0x115555[_0x5102('0x3d')][_0x5102('0x2b')]);}_0x2ccd5d[_0x5102('0x46')]=qs[_0x5102('0x47')](_0x115555[_0x5102('0x3d')][_0x5102('0x47')]);_0x2ccd5d[_0x5102('0x48')]=qs[_0x5102('0x3f')](_[_0x5102('0x49')](_0x115555[_0x5102('0x3d')],_0x4ab014[_0x5102('0x3f')]),_0x273569);if(_0x115555[_0x5102('0x3d')][_0x5102('0x4a')]){_0x2ccd5d[_0x5102('0x48')]=_[_0x5102('0x4b')](_0x2ccd5d[_0x5102('0x48')],{'$or':_[_0x5102('0x38')](_0x273569,function(_0x340597){if(_0x340597[_0x5102('0x4c')]!==_0x5102('0x4d')){var _0x3a3701={};_0x3a3701[_0x340597[_0x5102('0x35')]]={'$like':'%'+_0x115555['query'][_0x5102('0x4a')]+'%'};return _0x3a3701;}})});}_0x2ccd5d=_['merge']({},_0x2ccd5d,_0x115555[_0x5102('0x4e')]);var _0x33d15b={'where':_0x2ccd5d['where']};return db[_0x5102('0x4f')][_0x5102('0x50')](_0x33d15b)[_0x5102('0x32')](function(_0x3bc43b){_0x51c6b3['count']=_0x3bc43b;if(_0x115555[_0x5102('0x3d')][_0x5102('0x51')]){_0x2ccd5d[_0x5102('0x52')]=[{'all':!![]}];}return db[_0x5102('0x4f')][_0x5102('0x53')](_0x2ccd5d);})[_0x5102('0x32')](function(_0x2458ec){_0x51c6b3[_0x5102('0x54')]=_0x2458ec;return _0x51c6b3;})[_0x5102('0x32')](respondWithFilteredResult(_0x44e5af,_0x2ccd5d))[_0x5102('0x25')](handleError(_0x44e5af,null));};exports[_0x5102('0x55')]=function(_0x5a1e88,_0x11cbec){var _0x48d4de={'raw':!![],'where':{'id':_0x5a1e88[_0x5102('0x56')]['id']}},_0x1d6bc0={};_0x1d6bc0[_0x5102('0x3c')]=_[_0x5102('0x3e')](db['ChatMessage'][_0x5102('0x39')]);_0x1d6bc0[_0x5102('0x3d')]=_[_0x5102('0x3e')](_0x5a1e88[_0x5102('0x3d')]);_0x1d6bc0[_0x5102('0x3f')]=_['intersection'](_0x1d6bc0[_0x5102('0x3c')],_0x1d6bc0[_0x5102('0x3d')]);_0x48d4de[_0x5102('0x40')]=_[_0x5102('0x41')](_0x1d6bc0['model'],qs[_0x5102('0x42')](_0x5a1e88['query'][_0x5102('0x42')]));_0x48d4de[_0x5102('0x40')]=_0x48d4de[_0x5102('0x40')][_0x5102('0x43')]?_0x48d4de['attributes']:_0x1d6bc0[_0x5102('0x3c')];if(_0x5a1e88['query'][_0x5102('0x51')]){_0x48d4de[_0x5102('0x52')]=[{'all':!![]}];}_0x48d4de=_[_0x5102('0x4b')]({},_0x48d4de,_0x5a1e88[_0x5102('0x4e')]);return db[_0x5102('0x4f')][_0x5102('0x57')](_0x48d4de)[_0x5102('0x32')](handleEntityNotFound(_0x11cbec,null))[_0x5102('0x32')](respondWithResult(_0x11cbec,null))['catch'](handleError(_0x11cbec,null));};exports[_0x5102('0x58')]=function(_0xf6ef92,_0x25cdff){return db[_0x5102('0x4f')]['create'](_0xf6ef92['body'],{})[_0x5102('0x32')](respondWithResult(_0x25cdff,0xc9))[_0x5102('0x25')](handleError(_0x25cdff,null));};exports[_0x5102('0x31')]=function(_0x3d9fb1,_0x5dc983){if(_0x3d9fb1[_0x5102('0x59')]['id']){delete _0x3d9fb1[_0x5102('0x59')]['id'];}return db[_0x5102('0x4f')][_0x5102('0x57')]({'where':{'id':_0x3d9fb1[_0x5102('0x56')]['id']}})['then'](handleEntityNotFound(_0x5dc983,null))[_0x5102('0x32')](saveUpdates(_0x3d9fb1[_0x5102('0x59')],null))[_0x5102('0x32')](respondWithResult(_0x5dc983,null))['catch'](handleError(_0x5dc983,null));};exports[_0x5102('0x33')]=function(_0x21aaef,_0x70f6f5){return db[_0x5102('0x4f')][_0x5102('0x57')]({'where':{'id':_0x21aaef[_0x5102('0x56')]['id']}})[_0x5102('0x32')](handleEntityNotFound(_0x70f6f5,null))['then'](removeEntity(_0x70f6f5,null))[_0x5102('0x25')](handleError(_0x70f6f5,null));};exports[_0x5102('0x5a')]=function(_0x15b896,_0x18d1fd){return db[_0x5102('0x4f')][_0x5102('0x5a')]()[_0x5102('0x32')](respondWithResult(_0x18d1fd,null))[_0x5102('0x25')](handleError(_0x18d1fd,null));};var interaction_log=require(_0x5102('0x11'))(_0x5102('0x5b'));exports[_0x5102('0x5c')]=function(_0x4f2dd2,_0x4714b4,_0x373082){var _0x5e959a={'agent':{},'channel':_0x5102('0x5d')};if(_0x4f2dd2['body']['id']){delete _0x4f2dd2[_0x5102('0x59')]['id'];}_0x4f2dd2[_0x5102('0x59')]['read']=!![];_0x4f2dd2[_0x5102('0x59')]['readAt']=moment()[_0x5102('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x4f2dd2[_0x5102('0x59')][_0x5102('0x5f')]=_0x4f2dd2[_0x5102('0x59')][_0x5102('0x5f')]||_0x4f2dd2['user']['id'];_0x5e959a['agent']['id']=_0x4f2dd2[_0x5102('0x59')][_0x5102('0x5f')];return db[_0x5102('0x4f')]['find']({'where':{'id':_0x4f2dd2['params']['id'],'UserId':null}})[_0x5102('0x32')](handleEntityNotFound(_0x4714b4,null))[_0x5102('0x32')](saveUpdates(_0x4f2dd2['body'],null))[_0x5102('0x32')](function(_0x217946){if(_0x217946){_0x5e959a['message']=_0x217946['get']({'plain':!![]});return db['ChatInteraction'][_0x5102('0x57')]({'where':{'id':_0x217946[_0x5102('0x60')]}});}return null;})[_0x5102('0x32')](handleEntityNotFound(_0x4714b4,null))[_0x5102('0x32')](function(_0x4e3008){if(_0x4e3008){return _0x4e3008['update']({'UserId':_0x4f2dd2['body'][_0x5102('0x5f')],'read1stAt':_[_0x5102('0x61')](_0x4e3008['read1stAt'])?moment()[_0x5102('0x5e')](_0x5102('0x62')):undefined});}return null;})[_0x5102('0x32')](function(_0x12d3e8){if(_0x12d3e8){_0x5e959a['interaction']=_0x12d3e8['get']({'plain':!![]});interaction_log[_0x5102('0x1e')](_0x5102('0x63'),_0x4f2dd2[_0x5102('0x64')]['id'],_0x4f2dd2[_0x5102('0x64')]['name'],_0x4f2dd2[_0x5102('0x64')][_0x5102('0x65')],_0x5e959a[_0x5102('0x66')]['id'],_0x4f2dd2[_0x5102('0x59')]?JSON[_0x5102('0x67')](_0x4f2dd2['body']):'null');return respondWithRpcPromise(_0x5102('0x68'),'acceptMessage',_0x5e959a);}return null;})[_0x5102('0x32')](function(_0x248ee7){var _0x1c5d28=_0x5102('0x69')+_0x248ee7['message'][_0x5102('0x6a')];return db['sequelize'][_0x5102('0x3d')](_0x1c5d28,{'type':db[_0x5102('0x6b')]['QueryTypes'][_0x5102('0x6c')],'raw':!![]})[_0x5102('0x32')](function(_0x1688de){return _0x1688de;});})[_0x5102('0x32')](function(_0x4518ff){if(_0x4518ff){_0x5e959a[_0x5102('0x22')][_0x5102('0x6d')]=_0x4518ff[0x0];if(!_0x4f2dd2['body'][_0x5102('0x5f')])return;return db[_0x5102('0x6e')][_0x5102('0x57')]({'where':{'id':_0x4f2dd2[_0x5102('0x59')][_0x5102('0x5f')],'role':_0x5102('0x6f')},'attributes':['id',_0x5102('0x35'),'fullname',_0x5102('0x70'),_0x5102('0x71')],'raw':!![]});}return null;})[_0x5102('0x32')](function(_0x302b8f){if(!_0x302b8f)return null;_0x5e959a[_0x5102('0x22')]['agent']=_0x302b8f;return _0x5e959a;})[_0x5102('0x32')](function(_0x1952ea){if(_0x1952ea){if(_0x4f2dd2[_0x5102('0x59')][_0x5102('0x72')]){_0x5e959a[_0x5102('0x22')][_0x5102('0x73')]=util[_0x5102('0x5e')]('SIP/%s',_0x4f2dd2[_0x5102('0x64')][_0x5102('0x35')]);_0x5e959a[_0x5102('0x22')][_0x5102('0x74')]=_0x5e959a[_0x5102('0x74')];_0x5e959a[_0x5102('0x22')][_0x5102('0x75')]=_0x5e959a[_0x5102('0x74')];_0x5e959a[_0x5102('0x22')][_0x5102('0x76')]=_0x5102('0x5c');return respondWithRpcPromise('EventManager',_0x5102('0x77'),{'event':_0x5102('0x78'),'message':_['merge'](_0x5e959a['message'],JSON[_0x5102('0x79')](_0x5e959a[_0x5102('0x66')]['formData']))},client9002)[_0x5102('0x32')](function(){return _0x5e959a;});}return _0x5e959a;}return null;})['then'](respondWithResult(_0x4714b4,null))[_0x5102('0x25')](handleError(_0x4714b4,null));};var interaction_log=require(_0x5102('0x11'))(_0x5102('0x5b'));exports[_0x5102('0x2f')]=function(_0x18a839,_0x29ea66,_0x2a96c2){var _0x17ae74={'agent':{},'channel':_0x5102('0x5d')};if(_0x18a839[_0x5102('0x59')]['id']){delete _0x18a839[_0x5102('0x59')]['id'];}_0x18a839['body'][_0x5102('0x5f')]=_0x18a839['body']['UserId']||_0x18a839[_0x5102('0x64')]['id'];_0x17ae74[_0x5102('0x6f')]['id']=_0x18a839[_0x5102('0x59')][_0x5102('0x5f')];return db[_0x5102('0x4f')][_0x5102('0x57')]({'where':{'id':_0x18a839[_0x5102('0x56')]['id'],'UserId':null}})[_0x5102('0x32')](handleEntityNotFound(_0x29ea66,null))[_0x5102('0x32')](function(_0x319f98){if(_0x319f98){_0x17ae74[_0x5102('0x22')]=_0x319f98[_0x5102('0x7a')]({'plain':!![]});return db['ChatInteraction'][_0x5102('0x57')]({'where':{'id':_0x319f98[_0x5102('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x29ea66,null))[_0x5102('0x32')](function(_0x3072ba){if(_0x3072ba){_0x17ae74[_0x5102('0x66')]=_0x3072ba[_0x5102('0x7a')]({'plain':!![]});interaction_log[_0x5102('0x1e')](_0x5102('0x7b'),_0x18a839[_0x5102('0x64')]['id'],_0x18a839[_0x5102('0x64')][_0x5102('0x35')],_0x18a839[_0x5102('0x64')][_0x5102('0x65')],_0x17ae74['interaction']['id'],_0x18a839['body']?JSON[_0x5102('0x67')](_0x18a839[_0x5102('0x59')]):_0x5102('0x7c'));return respondWithRpcPromise('RejectMessage',_0x5102('0x7d'),_0x17ae74);}return null;})[_0x5102('0x32')](function(_0x5e4992){var _0x515b8e=_0x5102('0x69')+_0x5e4992[_0x5102('0x22')][_0x5102('0x6a')];return db[_0x5102('0x7e')]['query'](_0x515b8e,{'type':db['Sequelize']['QueryTypes'][_0x5102('0x6c')],'raw':!![]})[_0x5102('0x32')](function(_0x2dae00){return _0x2dae00;});})[_0x5102('0x32')](function(_0x4f2f3b){if(_0x4f2f3b){_0x17ae74[_0x5102('0x22')][_0x5102('0x6d')]=_0x4f2f3b[0x0];if(!_0x18a839['body'][_0x5102('0x5f')])return;return db[_0x5102('0x6e')][_0x5102('0x57')]({'where':{'id':_0x18a839[_0x5102('0x59')][_0x5102('0x5f')],'role':_0x5102('0x6f')},'attributes':['id',_0x5102('0x35'),'fullname','email','internal'],'raw':!![]});}return null;})[_0x5102('0x32')](function(_0xee3a65){if(!_0xee3a65)return null;_0x17ae74[_0x5102('0x22')][_0x5102('0x6f')]=_0xee3a65;return _0x17ae74;})[_0x5102('0x32')](function(_0x260aff){if(_0x260aff){_0x260aff[_0x5102('0x22')][_0x5102('0x73')]=util[_0x5102('0x5e')](_0x5102('0x7f'),_0x18a839[_0x5102('0x64')][_0x5102('0x35')]);_0x260aff[_0x5102('0x22')]['channel']=_0x17ae74[_0x5102('0x74')];_0x260aff[_0x5102('0x22')][_0x5102('0x75')]=_0x17ae74['channel'];_0x260aff[_0x5102('0x22')]['event']='reject';respondWithRpcPromise(_0x5102('0x77'),_0x5102('0x77'),{'event':'rejectmessage','message':_[_0x5102('0x4b')](_0x17ae74[_0x5102('0x22')],JSON[_0x5102('0x79')](_0x17ae74[_0x5102('0x66')]['formData']))},client9002);return _0x17ae74;}return null;})[_0x5102('0x32')](respondWithResult(_0x29ea66,null))[_0x5102('0x25')](handleError(_0x29ea66,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index c46230a..027b88a 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 _0xdda1=['remove','emit','hook','events','../../mysqldb','setMaxListeners','update'];(function(_0x437536,_0x923c6e){var _0x518a23=function(_0x9b6bbc){while(--_0x9b6bbc){_0x437536['push'](_0x437536['shift']());}};_0x518a23(++_0x923c6e);}(_0xdda1,0x11b));var _0x1dda=function(_0xa88c4d,_0x5660d5){_0xa88c4d=_0xa88c4d-0x0;var _0x10c20c=_0xdda1[_0xa88c4d];return _0x10c20c;};'use strict';var EventEmitter=require(_0x1dda('0x0'));var ChatMessage=require(_0x1dda('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x1dda('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1dda('0x3'),'afterDestroy':_0x1dda('0x4')};function emitEvent(_0x178159){return function(_0x1a62e4,_0x1d9f4f,_0x19d657){ChatMessageEvents[_0x1dda('0x5')](_0x178159+':'+_0x1a62e4['id'],_0x1a62e4);ChatMessageEvents[_0x1dda('0x5')](_0x178159,_0x1a62e4);_0x19d657(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x1dda('0x6')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0xa312=['exports','../../mysqldb','ChatMessage','save','update','remove','emit','hasOwnProperty'];(function(_0x5a2436,_0x11375a){var _0x2d8468=function(_0x5b77b9){while(--_0x5b77b9){_0x5a2436['push'](_0x5a2436['shift']());}};_0x2d8468(++_0x11375a);}(_0xa312,0x1f1));var _0x2a31=function(_0x55ef8b,_0x5deb5e){_0x55ef8b=_0x55ef8b-0x0;var _0x359c84=_0xa312[_0x55ef8b];return _0x359c84;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x2a31('0x0'))['db'][_0x2a31('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2a31('0x2'),'afterUpdate':_0x2a31('0x3'),'afterDestroy':_0x2a31('0x4')};function emitEvent(_0x417c17){return function(_0x57fd8b,_0x197584,_0x54de06){ChatMessageEvents[_0x2a31('0x5')](_0x417c17+':'+_0x57fd8b['id'],_0x57fd8b);ChatMessageEvents[_0x2a31('0x5')](_0x417c17,_0x57fd8b);_0x54de06(null);};}for(var e in events){if(events[_0x2a31('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x2a31('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index c0f03ca..a3368cf 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 _0xe58b=['api','moment','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','UserId','ChatInteraction','findOne','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x75854d,_0x15f62d){var _0x3284b4=function(_0x46a214){while(--_0x46a214){_0x75854d['push'](_0x75854d['shift']());}};_0x3284b4(++_0x15f62d);}(_0xe58b,0x1e3));var _0xbe58=function(_0xd274ec,_0x6b590b){_0xd274ec=_0xd274ec-0x0;var _0x5345c8=_0xe58b[_0xd274ec];return _0x5345c8;};'use strict';var _=require(_0xbe58('0x0'));var util=require(_0xbe58('0x1'));var logger=require(_0xbe58('0x2'))(_0xbe58('0x3'));var moment=require(_0xbe58('0x4'));var BPromise=require(_0xbe58('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe58('0x6'));var rimraf=require(_0xbe58('0x7'));var config=require(_0xbe58('0x8'));var attributes=require(_0xbe58('0x9'));module[_0xbe58('0xa')]=function(_0x29f976,_0x514fca){return _0x29f976[_0xbe58('0xb')]('ChatMessage',attributes,{'tableName':_0xbe58('0xc'),'paranoid':![],'indexes':[{'name':_0xbe58('0xd'),'fields':[_0xbe58('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x29091c,_0x351a41,_0xbcc9d8){var _0x47048f=_0x29f976[_0xbe58('0xf')];var _0x23bc78=_0x29091c[_0xbe58('0x10')]({'plain':!![]});if(_0x23bc78[_0xbe58('0x11')][_0xbe58('0x12')]()==='in'||_0x23bc78[_0xbe58('0x11')]['toLowerCase']()==='out'&&!_0x23bc78['secret']&&!_['isNil'](_0x23bc78[_0xbe58('0x13')])){_0x47048f[_0xbe58('0x14')][_0xbe58('0x15')]({'where':{'id':_0x23bc78['ChatInteractionId']}})['then'](function(_0x35dea0){if(_0x35dea0){_0x35dea0['update']({'lastMsgAt':_0x23bc78[_0xbe58('0x16')],'lastMsgDirection':_0x23bc78[_0xbe58('0x11')][_0xbe58('0x12')]()});}})[_0xbe58('0x17')](function(_0x588632){console[_0xbe58('0x18')](_0x588632);});}_0xbcc9d8();}},'charset':_0xbe58('0x19'),'collate':_0xbe58('0x1a')});}; \ No newline at end of file +var _0x3c79=['ChatInteraction','findOne','ChatInteractionId','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId'];(function(_0x1fab82,_0x587291){var _0x4e3378=function(_0x364a28){while(--_0x364a28){_0x1fab82['push'](_0x1fab82['shift']());}};_0x4e3378(++_0x587291);}(_0x3c79,0xef));var _0x93c7=function(_0x183878,_0x23a8a2){_0x183878=_0x183878-0x0;var _0x4688cf=_0x3c79[_0x183878];return _0x4688cf;};'use strict';var _=require(_0x93c7('0x0'));var util=require(_0x93c7('0x1'));var logger=require('../../config/logger')(_0x93c7('0x2'));var moment=require(_0x93c7('0x3'));var BPromise=require(_0x93c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x93c7('0x5'));var rimraf=require(_0x93c7('0x6'));var config=require('../../config/environment');var attributes=require(_0x93c7('0x7'));module[_0x93c7('0x8')]=function(_0x1827d4,_0x363419){return _0x1827d4[_0x93c7('0x9')](_0x93c7('0xa'),attributes,{'tableName':_0x93c7('0xb'),'paranoid':![],'indexes':[{'name':_0x93c7('0xc'),'fields':[_0x93c7('0xd')],'type':_0x93c7('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xbc7194,_0x1a331a,_0xdea5a5){var _0x93c935=_0x1827d4[_0x93c7('0xf')];var _0xa25754=_0xbc7194['get']({'plain':!![]});if(_0xa25754[_0x93c7('0x10')][_0x93c7('0x11')]()==='in'||_0xa25754['direction']['toLowerCase']()===_0x93c7('0x12')&&!_0xa25754[_0x93c7('0x13')]&&!_[_0x93c7('0x14')](_0xa25754[_0x93c7('0x15')])){_0x93c935[_0x93c7('0x16')][_0x93c7('0x17')]({'where':{'id':_0xa25754[_0x93c7('0x18')]}})['then'](function(_0xc2c892){if(_0xc2c892){_0xc2c892[_0x93c7('0x19')]({'lastMsgAt':_0xa25754['createdAt'],'lastMsgDirection':_0xa25754['direction']['toLowerCase']()});}})[_0x93c7('0x1a')](function(_0x1b291f){console['error'](_0x1b291f);});}_0xdea5a5();}},'charset':_0x93c7('0x1b'),'collate':_0x93c7('0x1c')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 3718da9..932577a 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 _0xaefe=['ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x414653,_0x4d4b43){var _0x1504fa=function(_0x304a59){while(--_0x304a59){_0x414653['push'](_0x414653['shift']());}};_0x1504fa(++_0x4d4b43);}(_0xaefe,0x91));var _0xeaef=function(_0x1809c5,_0x46cabc){_0x1809c5=_0x1809c5-0x0;var _0x5254a4=_0xaefe[_0x1809c5];return _0x5254a4;};'use strict';var _=require(_0xeaef('0x0'));var util=require(_0xeaef('0x1'));var moment=require(_0xeaef('0x2'));var BPromise=require(_0xeaef('0x3'));var rs=require(_0xeaef('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeaef('0x5'))['db'];var utils=require(_0xeaef('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xeaef('0x7'));var jayson=require(_0xeaef('0x8'));var client=jayson['client'][_0xeaef('0x9')]({'port':0x232a});config[_0xeaef('0xa')]=_[_0xeaef('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xeaef('0xc'))(new Redis(config[_0xeaef('0xa')]));require(_0xeaef('0xd'))[_0xeaef('0xe')](socket);function respondWithRpcPromise(_0x52db36,_0x5ba94d,_0x5494e2){return new BPromise(function(_0xccb571,_0x252d17){return client['request'](_0x52db36,_0x5494e2)[_0xeaef('0xf')](function(_0x5a7a9b){logger[_0xeaef('0x10')](_0xeaef('0x11'),_0x5ba94d,_0xeaef('0x12'));logger[_0xeaef('0x13')](_0xeaef('0x14'),_0x5ba94d,_0xeaef('0x12'),JSON[_0xeaef('0x15')](_0x5a7a9b));if(_0x5a7a9b[_0xeaef('0x16')]){if(_0x5a7a9b[_0xeaef('0x16')][_0xeaef('0x17')]===0x1f4){logger[_0xeaef('0x16')]('ChatMessage,\x20%s,\x20%s',_0x5ba94d,_0x5a7a9b[_0xeaef('0x16')][_0xeaef('0x18')]);return _0x252d17(_0x5a7a9b['error'][_0xeaef('0x18')]);}logger[_0xeaef('0x16')](_0xeaef('0x11'),_0x5ba94d,_0x5a7a9b['error'][_0xeaef('0x18')]);return _0xccb571(_0x5a7a9b[_0xeaef('0x16')][_0xeaef('0x18')]);}else{logger[_0xeaef('0x10')]('ChatMessage,\x20%s,\x20%s',_0x5ba94d,_0xeaef('0x12'));_0xccb571(_0x5a7a9b[_0xeaef('0x19')][_0xeaef('0x18')]);}})[_0xeaef('0x1a')](function(_0x2bccb2){logger[_0xeaef('0x16')](_0xeaef('0x11'),_0x5ba94d,_0x2bccb2);_0x252d17(_0x2bccb2);});});}exports[_0xeaef('0x1b')]=function(_0x574cd6){var _0x1322eb=this;return new Promise(function(_0x2e480f,_0x4bfa88){return db[_0xeaef('0x1c')][_0xeaef('0x1d')](_0x574cd6[_0xeaef('0x1e')],{'raw':_0x574cd6[_0xeaef('0x1f')]?_0x574cd6[_0xeaef('0x1f')][_0xeaef('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x3689ae){logger[_0xeaef('0x10')]('CreateChatMessage',_0x574cd6);logger[_0xeaef('0x13')](_0xeaef('0x1b'),_0x574cd6,JSON[_0xeaef('0x15')](_0x3689ae));_0x2e480f(_0x3689ae);})[_0xeaef('0x1a')](function(_0x48e83c){logger[_0xeaef('0x16')]('CreateChatMessage',_0x48e83c['message'],_0x574cd6);_0x4bfa88(_0x1322eb[_0xeaef('0x16')](0x1f4,_0x48e83c[_0xeaef('0x18')]));});});}; \ No newline at end of file +var _0xc677=['error','code','message','result','catch','CreateChatMessage','ChatMessage','body','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x8af54b,_0x280be5){var _0x27d8f0=function(_0x559734){while(--_0x559734){_0x8af54b['push'](_0x8af54b['shift']());}};_0x27d8f0(++_0x280be5);}(_0xc677,0x18a));var _0x7c67=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc677[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x7c67('0x0'));var util=require(_0x7c67('0x1'));var moment=require(_0x7c67('0x2'));var BPromise=require(_0x7c67('0x3'));var rs=require(_0x7c67('0x4'));var fs=require('fs');var Redis=require(_0x7c67('0x5'));var db=require(_0x7c67('0x6'))['db'];var utils=require(_0x7c67('0x7'));var logger=require(_0x7c67('0x8'))(_0x7c67('0x9'));var config=require(_0x7c67('0xa'));var jayson=require(_0x7c67('0xb'));var client=jayson[_0x7c67('0xc')]['http']({'port':0x232a});config[_0x7c67('0xd')]=_['defaults'](config[_0x7c67('0xd')],{'host':_0x7c67('0xe'),'port':0x18eb});var socket=require(_0x7c67('0xf'))(new Redis(config[_0x7c67('0xd')]));require(_0x7c67('0x10'))[_0x7c67('0x11')](socket);function respondWithRpcPromise(_0x82e663,_0x290c3d,_0x3e9cc0){return new BPromise(function(_0x3e35d6,_0x3219a3){return client[_0x7c67('0x12')](_0x82e663,_0x3e9cc0)[_0x7c67('0x13')](function(_0x27a0e8){logger[_0x7c67('0x14')](_0x7c67('0x15'),_0x290c3d,'request\x20sent');logger[_0x7c67('0x16')](_0x7c67('0x17'),_0x290c3d,_0x7c67('0x18'),JSON[_0x7c67('0x19')](_0x27a0e8));if(_0x27a0e8[_0x7c67('0x1a')]){if(_0x27a0e8[_0x7c67('0x1a')][_0x7c67('0x1b')]===0x1f4){logger[_0x7c67('0x1a')](_0x7c67('0x15'),_0x290c3d,_0x27a0e8[_0x7c67('0x1a')][_0x7c67('0x1c')]);return _0x3219a3(_0x27a0e8[_0x7c67('0x1a')]['message']);}logger[_0x7c67('0x1a')](_0x7c67('0x15'),_0x290c3d,_0x27a0e8[_0x7c67('0x1a')]['message']);return _0x3e35d6(_0x27a0e8[_0x7c67('0x1a')]['message']);}else{logger['info'](_0x7c67('0x15'),_0x290c3d,_0x7c67('0x18'));_0x3e35d6(_0x27a0e8[_0x7c67('0x1d')][_0x7c67('0x1c')]);}})[_0x7c67('0x1e')](function(_0x17319d){logger[_0x7c67('0x1a')](_0x7c67('0x15'),_0x290c3d,_0x17319d);_0x3219a3(_0x17319d);});});}exports[_0x7c67('0x1f')]=function(_0x55d4a9){var _0xd4045f=this;return new Promise(function(_0x2092fd,_0xb1f6a3){return db[_0x7c67('0x20')]['create'](_0x55d4a9[_0x7c67('0x21')],{'raw':_0x55d4a9['options']?_0x55d4a9['options'][_0x7c67('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0x339e9f){logger['info']('CreateChatMessage',_0x55d4a9);logger[_0x7c67('0x16')](_0x7c67('0x1f'),_0x55d4a9,JSON[_0x7c67('0x19')](_0x339e9f));_0x2092fd(_0x339e9f);})['catch'](function(_0x4f7b05){logger[_0x7c67('0x1a')]('CreateChatMessage',_0x4f7b05[_0x7c67('0x1c')],_0x55d4a9);_0xb1f6a3(_0xd4045f[_0x7c67('0x1a')](0x1f4,_0x4f7b05['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 05ff693..276c18e 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 _0x1670=['./chatMessage.events','save','update','emit','register','length','chatMessage:'];(function(_0x43026b,_0x928d8c){var _0x4a96cd=function(_0x362cbd){while(--_0x362cbd){_0x43026b['push'](_0x43026b['shift']());}};_0x4a96cd(++_0x928d8c);}(_0x1670,0x9a));var _0x0167=function(_0x1b2e34,_0x8d3ab5){_0x1b2e34=_0x1b2e34-0x0;var _0x13c2b9=_0x1670[_0x1b2e34];return _0x13c2b9;};'use strict';var ChatMessageEvents=require(_0x0167('0x0'));var events=[_0x0167('0x1'),'remove',_0x0167('0x2')];function createListener(_0x4dc6f6,_0x1c7a08){return function(_0x45bbfd){_0x1c7a08[_0x0167('0x3')](_0x4dc6f6,_0x45bbfd);};}function removeListener(_0x6f87ae,_0x5786d8){return function(){ChatMessageEvents['removeListener'](_0x6f87ae,_0x5786d8);};}exports[_0x0167('0x4')]=function(_0x1ae650){for(var _0x295e51=0x0,_0x3e1507=events[_0x0167('0x5')];_0x295e51<_0x3e1507;_0x295e51++){var _0x149956=events[_0x295e51];var _0xcdfc5=createListener(_0x0167('0x6')+_0x149956,_0x1ae650);ChatMessageEvents['on'](_0x149956,_0xcdfc5);}}; \ No newline at end of file +var _0x42b0=['register','length','./chatMessage.events','save','update','removeListener'];(function(_0x76d2c0,_0x1f52f1){var _0x46d590=function(_0x50e08b){while(--_0x50e08b){_0x76d2c0['push'](_0x76d2c0['shift']());}};_0x46d590(++_0x1f52f1);}(_0x42b0,0xbc));var _0x042b=function(_0x18bccf,_0x515956){_0x18bccf=_0x18bccf-0x0;var _0x3d07bd=_0x42b0[_0x18bccf];return _0x3d07bd;};'use strict';var ChatMessageEvents=require(_0x042b('0x0'));var events=[_0x042b('0x1'),'remove',_0x042b('0x2')];function createListener(_0x4bf494,_0x1d7aa3){return function(_0x5a7e27){_0x1d7aa3['emit'](_0x4bf494,_0x5a7e27);};}function removeListener(_0x401a0c,_0xd73d53){return function(){ChatMessageEvents[_0x042b('0x3')](_0x401a0c,_0xd73d53);};}exports[_0x042b('0x4')]=function(_0x135bc1){for(var _0x5d194a=0x0,_0x51c41c=events[_0x042b('0x5')];_0x5d194a<_0x51c41c;_0x5d194a++){var _0x1ec28f=events[_0x5d194a];var _0x49ab70=createListener('chatMessage:'+_0x1ec28f,_0x135bc1);ChatMessageEvents['on'](_0x1ec28f,_0x49ab70);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 42e036b..7aa027e 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 _0x1231=['chatmessage:create','create','put','/:id','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','index','get','/describe','isAuthenticated','post'];(function(_0x144220,_0x24a156){var _0x3c92a4=function(_0x299fb3){while(--_0x299fb3){_0x144220['push'](_0x144220['shift']());}};_0x3c92a4(++_0x24a156);}(_0x1231,0x1cc));var _0x1123=function(_0xb5c2e1,_0x3b2db2){_0xb5c2e1=_0xb5c2e1-0x0;var _0x3c5a5b=_0x1231[_0xb5c2e1];return _0x3c5a5b;};'use strict';var multer=require(_0x1123('0x0'));var util=require(_0x1123('0x1'));var path=require(_0x1123('0x2'));var timeout=require(_0x1123('0x3'));var express=require(_0x1123('0x4'));var router=express[_0x1123('0x5')]();var fs_extra=require(_0x1123('0x6'));var auth=require(_0x1123('0x7'));var interaction=require(_0x1123('0x8'));var config=require('../../config/environment');var controller=require(_0x1123('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1123('0xa')]);router[_0x1123('0xb')](_0x1123('0xc'),auth[_0x1123('0xd')](),controller['describe']);router[_0x1123('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1123('0xe')]('/',auth[_0x1123('0xd')](),interaction['tracked']('chat',_0x1123('0xf')),controller[_0x1123('0x10')]);router[_0x1123('0x11')](_0x1123('0x12'),controller['update']);router[_0x1123('0x11')](_0x1123('0x13'),auth[_0x1123('0xd')](),controller['accept']);router['put'](_0x1123('0x14'),auth[_0x1123('0xd')](),controller[_0x1123('0x15')]);router[_0x1123('0x16')](_0x1123('0x12'),auth[_0x1123('0xd')](),controller[_0x1123('0x17')]);module[_0x1123('0x18')]=router; \ No newline at end of file +var _0x685d=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','describe','show','tracked','chatmessage:create','create','/:id','put','/:id/accept','/:id/reject'];(function(_0xa74972,_0x4148b3){var _0x172494=function(_0x3e2a3d){while(--_0x3e2a3d){_0xa74972['push'](_0xa74972['shift']());}};_0x172494(++_0x4148b3);}(_0x685d,0x99));var _0xd685=function(_0x292d80,_0x18a9ab){_0x292d80=_0x292d80-0x0;var _0x464d14=_0x685d[_0x292d80];return _0x464d14;};'use strict';var multer=require(_0xd685('0x0'));var util=require(_0xd685('0x1'));var path=require(_0xd685('0x2'));var timeout=require(_0xd685('0x3'));var express=require(_0xd685('0x4'));var router=express['Router']();var fs_extra=require(_0xd685('0x5'));var auth=require(_0xd685('0x6'));var interaction=require(_0xd685('0x7'));var config=require(_0xd685('0x8'));var controller=require(_0xd685('0x9'));router[_0xd685('0xa')]('/',auth[_0xd685('0xb')](),controller['index']);router['get'](_0xd685('0xc'),auth['isAuthenticated'](),controller[_0xd685('0xd')]);router[_0xd685('0xa')]('/:id',auth[_0xd685('0xb')](),controller[_0xd685('0xe')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xd685('0xf')]('chat',_0xd685('0x10')),controller[_0xd685('0x11')]);router['put'](_0xd685('0x12'),controller['update']);router[_0xd685('0x13')](_0xd685('0x14'),auth[_0xd685('0xb')](),controller['accept']);router[_0xd685('0x13')](_0xd685('0x15'),auth[_0xd685('0xb')](),controller['reject']);router[_0xd685('0x16')](_0xd685('0x12'),auth['isAuthenticated'](),controller[_0xd685('0x17')]);module[_0xd685('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index b29667d..e6bfa3c 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 _0x2032=['medium','exports','TEXT'];(function(_0x295876,_0x3e51c0){var _0x2b7b65=function(_0x586d48){while(--_0x586d48){_0x295876['push'](_0x295876['shift']());}};_0x2b7b65(++_0x3e51c0);}(_0x2032,0xd9));var _0x2203=function(_0x244f37,_0x3121a3){_0x244f37=_0x244f37-0x0;var _0x5b3cd7=_0x2032[_0x244f37];return _0x5b3cd7;};'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 +var _0x2032=['medium','exports','TEXT'];(function(_0x1b1ed8,_0x2b0f38){var _0x33e1d6=function(_0x545491){while(--_0x545491){_0x1b1ed8['push'](_0x1b1ed8['shift']());}};_0x33e1d6(++_0x2b0f38);}(_0x2032,0xd9));var _0x2203=function(_0x39b4b4,_0x2255c1){_0x39b4b4=_0x39b4b4-0x0;var _0x142af1=_0x2032[_0x39b4b4];return _0x142af1;};'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 a8c9406..9b4a7ba 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(_0x2ef3f7,_0x596a24){var _0x17afcc=function(_0x47f557){while(--_0x47f557){_0x2ef3f7['push'](_0x2ef3f7['shift']());}};_0x17afcc(++_0x596a24);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x7a54,0x106));var _0x47a5=function(_0x55d236,_0x33e798){_0x55d236=_0x55d236-0x0;var _0x1bc851=_0x7a54[_0x55d236];return _0x1bc851;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 5ddb134..ede407e 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 _0xb5f1=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x520ef4,_0x424164){var _0x59908f=function(_0xfcf439){while(--_0xfcf439){_0x520ef4['push'](_0x520ef4['shift']());}};_0x59908f(++_0x424164);}(_0xb5f1,0x150));var _0x1b5f=function(_0x15201a,_0x10eedb){_0x15201a=_0x15201a-0x0;var _0x5640ee=_0xb5f1[_0x15201a];return _0x5640ee;};'use strict';var EventEmitter=require(_0x1b5f('0x0'));var ChatOfflineMessage=require(_0x1b5f('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x1b5f('0x2')](0x0);var events={'afterCreate':_0x1b5f('0x3'),'afterUpdate':_0x1b5f('0x4'),'afterDestroy':_0x1b5f('0x5')};function emitEvent(_0x361326){return function(_0x49f2a6,_0x6c0add,_0x40ee35){ChatOfflineMessageEvents[_0x1b5f('0x6')](_0x361326+':'+_0x49f2a6['id'],_0x49f2a6);ChatOfflineMessageEvents['emit'](_0x361326,_0x49f2a6);_0x40ee35(null);};}for(var e in events){if(events[_0x1b5f('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x1b5f('0x8')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file +var _0x4a6d=['hook','exports','../../mysqldb','save','update','remove','hasOwnProperty'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x4a6d,0x121));var _0xd4a6=function(_0x45c943,_0xb1e866){_0x45c943=_0x45c943-0x0;var _0x5a254b=_0x4a6d[_0x45c943];return _0x5a254b;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0xd4a6('0x0'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd4a6('0x1'),'afterUpdate':_0xd4a6('0x2'),'afterDestroy':_0xd4a6('0x3')};function emitEvent(_0x9cfdf){return function(_0x49994a,_0x13fd34,_0x4ec60f){ChatOfflineMessageEvents['emit'](_0x9cfdf+':'+_0x49994a['id'],_0x49994a);ChatOfflineMessageEvents['emit'](_0x9cfdf,_0x49994a);_0x4ec60f(null);};}for(var e in events){if(events[_0xd4a6('0x4')](e)){var event=events[e];ChatOfflineMessage[_0xd4a6('0x5')](e,emitEvent(event));}}module[_0xd4a6('0x6')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 7e16df9..b0efea4 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 _0x9459=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4d2fae,_0x24b77e){var _0x1c7710=function(_0x5279fa){while(--_0x5279fa){_0x4d2fae['push'](_0x4d2fae['shift']());}};_0x1c7710(++_0x24b77e);}(_0x9459,0xe7));var _0x9945=function(_0x67cfd6,_0x13725a){_0x67cfd6=_0x67cfd6-0x0;var _0x59d49e=_0x9459[_0x67cfd6];return _0x59d49e;};'use strict';var attributes=require(_0x9945('0x0'));module[_0x9945('0x1')]=function(_0x527611){return _0x527611[_0x9945('0x2')](_0x9945('0x3'),attributes,{'tableName':_0x9945('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9945('0x5'),'collate':_0x9945('0x6')});}; \ No newline at end of file +var _0xca48=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define','ChatOfflineMessage'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0xca48,0x181));var _0x8ca4=function(_0x283127,_0x54d4d5){_0x283127=_0x283127-0x0;var _0x43da5d=_0xca48[_0x283127];return _0x43da5d;};'use strict';var attributes=require(_0x8ca4('0x0'));module['exports']=function(_0x1c10d5){return _0x1c10d5[_0x8ca4('0x1')](_0x8ca4('0x2'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8ca4('0x3')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 4c9e6d8..8e7d480 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 _0x2e49=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2e49,0x175));var _0x92e4=function(_0x30bfbe,_0xa5df3f){_0x30bfbe=_0x30bfbe-0x0;var _0x2d672c=_0x2e49[_0x30bfbe];return _0x2d672c;};'use strict';var _=require(_0x92e4('0x0'));var util=require(_0x92e4('0x1'));var moment=require('moment');var BPromise=require(_0x92e4('0x2'));var rs=require(_0x92e4('0x3'));var fs=require('fs');var Redis=require(_0x92e4('0x4'));var db=require(_0x92e4('0x5'))['db'];var utils=require(_0x92e4('0x6'));var logger=require(_0x92e4('0x7'))(_0x92e4('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x92e4('0x9')][_0x92e4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3af5fe,_0x5ac19f,_0x57c9cd){return new BPromise(function(_0x44ac6a,_0x37d6d9){return client[_0x92e4('0xb')](_0x3af5fe,_0x57c9cd)[_0x92e4('0xc')](function(_0x299f59){logger['info'](_0x92e4('0xd'),_0x5ac19f,'request\x20sent');logger['debug'](_0x92e4('0xe'),_0x5ac19f,_0x92e4('0xf'),JSON[_0x92e4('0x10')](_0x299f59));if(_0x299f59[_0x92e4('0x11')]){if(_0x299f59[_0x92e4('0x11')]['code']===0x1f4){logger[_0x92e4('0x11')](_0x92e4('0xd'),_0x5ac19f,_0x299f59['error'][_0x92e4('0x12')]);return _0x37d6d9(_0x299f59[_0x92e4('0x11')][_0x92e4('0x12')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x5ac19f,_0x299f59['error'][_0x92e4('0x12')]);return _0x44ac6a(_0x299f59['error']['message']);}else{logger[_0x92e4('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5ac19f,_0x92e4('0xf'));_0x44ac6a(_0x299f59[_0x92e4('0x14')]['message']);}})[_0x92e4('0x15')](function(_0x1003b6){logger['error'](_0x92e4('0xd'),_0x5ac19f,_0x1003b6);_0x37d6d9(_0x1003b6);});});} \ No newline at end of file +var _0x3836=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment'];(function(_0x11ec5d,_0x144772){var _0x45d165=function(_0x45b124){while(--_0x45b124){_0x11ec5d['push'](_0x11ec5d['shift']());}};_0x45d165(++_0x144772);}(_0x3836,0x140));var _0x6383=function(_0x2304c0,_0xea170e){_0x2304c0=_0x2304c0-0x0;var _0x28eb5e=_0x3836[_0x2304c0];return _0x28eb5e;};'use strict';var _=require(_0x6383('0x0'));var util=require('util');var moment=require(_0x6383('0x1'));var BPromise=require(_0x6383('0x2'));var rs=require(_0x6383('0x3'));var fs=require('fs');var Redis=require(_0x6383('0x4'));var db=require(_0x6383('0x5'))['db'];var utils=require(_0x6383('0x6'));var logger=require('../../config/logger')(_0x6383('0x7'));var config=require(_0x6383('0x8'));var jayson=require(_0x6383('0x9'));var client=jayson[_0x6383('0xa')][_0x6383('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x338653,_0x26e828,_0x25c287){return new BPromise(function(_0x3d2182,_0x5a249e){return client['request'](_0x338653,_0x25c287)[_0x6383('0xc')](function(_0x24b7a4){logger[_0x6383('0xd')](_0x6383('0xe'),_0x26e828,_0x6383('0xf'));logger[_0x6383('0x10')](_0x6383('0x11'),_0x26e828,'request\x20sent',JSON['stringify'](_0x24b7a4));if(_0x24b7a4[_0x6383('0x12')]){if(_0x24b7a4[_0x6383('0x12')][_0x6383('0x13')]===0x1f4){logger[_0x6383('0x12')](_0x6383('0xe'),_0x26e828,_0x24b7a4[_0x6383('0x12')][_0x6383('0x14')]);return _0x5a249e(_0x24b7a4['error']['message']);}logger[_0x6383('0x12')](_0x6383('0xe'),_0x26e828,_0x24b7a4[_0x6383('0x12')][_0x6383('0x14')]);return _0x3d2182(_0x24b7a4[_0x6383('0x12')][_0x6383('0x14')]);}else{logger[_0x6383('0xd')](_0x6383('0xe'),_0x26e828,_0x6383('0xf'));_0x3d2182(_0x24b7a4[_0x6383('0x15')]['message']);}})[_0x6383('0x16')](function(_0x5a0634){logger[_0x6383('0x12')](_0x6383('0xe'),_0x26e828,_0x5a0634);_0x5a249e(_0x5a0634);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 7e8bf64..bbd5522 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 _0x1ea3=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout'];(function(_0x30c649,_0x2ebbac){var _0x3edfb9=function(_0xab82f5){while(--_0xab82f5){_0x30c649['push'](_0x30c649['shift']());}};_0x3edfb9(++_0x2ebbac);}(_0x1ea3,0x75));var _0x31ea=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x1ea3[_0x273c39];return _0x46d6b5;};'use strict';var multer=require('multer');var util=require(_0x31ea('0x0'));var path=require(_0x31ea('0x1'));var timeout=require(_0x31ea('0x2'));var express=require('express');var router=express[_0x31ea('0x3')]();var fs_extra=require(_0x31ea('0x4'));var auth=require(_0x31ea('0x5'));var interaction=require(_0x31ea('0x6'));var config=require(_0x31ea('0x7'));var controller=require(_0x31ea('0x8'));router[_0x31ea('0x9')]('/',auth[_0x31ea('0xa')](),controller['index']);router[_0x31ea('0x9')]('/describe',auth[_0x31ea('0xa')](),controller[_0x31ea('0xb')]);router[_0x31ea('0x9')](_0x31ea('0xc'),auth[_0x31ea('0xa')](),controller[_0x31ea('0xd')]);router[_0x31ea('0xe')]('/',auth['isAuthenticated'](),controller[_0x31ea('0xf')]);router[_0x31ea('0x10')](_0x31ea('0xc'),auth[_0x31ea('0xa')](),controller['update']);router[_0x31ea('0x11')]('/:id',auth[_0x31ea('0xa')](),controller[_0x31ea('0x12')]);module[_0x31ea('0x13')]=router; \ No newline at end of file +var _0x9671=['fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','/:id','post','create','put','update','exports','multer','util','path','connect-timeout','express'];(function(_0x11bc7e,_0x999be1){var _0x5056d3=function(_0x5b315f){while(--_0x5b315f){_0x11bc7e['push'](_0x11bc7e['shift']());}};_0x5056d3(++_0x999be1);}(_0x9671,0x6d));var _0x1967=function(_0x279ce7,_0x192ba8){_0x279ce7=_0x279ce7-0x0;var _0x2e4d69=_0x9671[_0x279ce7];return _0x2e4d69;};'use strict';var multer=require(_0x1967('0x0'));var util=require(_0x1967('0x1'));var path=require(_0x1967('0x2'));var timeout=require(_0x1967('0x3'));var express=require(_0x1967('0x4'));var router=express['Router']();var fs_extra=require(_0x1967('0x5'));var auth=require(_0x1967('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1967('0x7'));var controller=require(_0x1967('0x8'));router[_0x1967('0x9')]('/',auth[_0x1967('0xa')](),controller['index']);router[_0x1967('0x9')](_0x1967('0xb'),auth[_0x1967('0xa')](),controller[_0x1967('0xc')]);router[_0x1967('0x9')](_0x1967('0xd'),auth[_0x1967('0xa')](),controller['show']);router[_0x1967('0xe')]('/',auth[_0x1967('0xa')](),controller[_0x1967('0xf')]);router[_0x1967('0x10')]('/:id',auth[_0x1967('0xa')](),controller[_0x1967('0x11')]);router['delete'](_0x1967('0xd'),auth[_0x1967('0xa')](),controller['destroy']);module[_0x1967('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index f645be5..b90fbf3 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 _0xd978=['sequelize','exports','STRING','ENUM','mouseOver','INTEGER'];(function(_0x462d39,_0x275eaa){var _0x2f852e=function(_0x39f232){while(--_0x39f232){_0x462d39['push'](_0x462d39['shift']());}};_0x2f852e(++_0x275eaa);}(_0xd978,0x132));var _0x8d97=function(_0xcb8fde,_0x24399c){_0xcb8fde=_0xcb8fde-0x0;var _0x16dd77=_0xd978[_0xcb8fde];return _0x16dd77;};'use strict';var Sequelize=require(_0x8d97('0x0'));module[_0x8d97('0x1')]={'name':{'type':Sequelize[_0x8d97('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8d97('0x3')](_0x8d97('0x4'),'timeout'),'defaultValue':_0x8d97('0x4')},'selector':{'type':Sequelize[_0x8d97('0x2')]},'timeout':{'type':Sequelize[_0x8d97('0x5')]}}; \ No newline at end of file +var _0xce5e=['exports','ENUM','mouseOver','timeout','STRING'];(function(_0x1bcad6,_0x1ac0c){var _0x3c8778=function(_0x4d07a9){while(--_0x4d07a9){_0x1bcad6['push'](_0x1bcad6['shift']());}};_0x3c8778(++_0x1ac0c);}(_0xce5e,0x64));var _0xece5=function(_0x230bd0,_0x56529b){_0x230bd0=_0x230bd0-0x0;var _0x1ae9a1=_0xce5e[_0x230bd0];return _0x1ae9a1;};'use strict';var Sequelize=require('sequelize');module[_0xece5('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xece5('0x1')](_0xece5('0x2'),_0xece5('0x3')),'defaultValue':_0xece5('0x2')},'selector':{'type':Sequelize[_0xece5('0x4')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index de81ac4..477d42a 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 _0xf23b=['show','params','ChatProactiveAction','query','keys','filters','intersection','model','attributes','fields','length','includeAll','include','find','create','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name'];(function(_0x3f767e,_0x89132c){var _0x4db93f=function(_0xa1419c){while(--_0xa1419c){_0x3f767e['push'](_0x3f767e['shift']());}};_0x4db93f(++_0x89132c);}(_0xf23b,0x133));var _0xbf23=function(_0x300e0d,_0x19220e){_0x300e0d=_0x300e0d-0x0;var _0x46e6f2=_0xf23b[_0x300e0d];return _0x46e6f2;};'use strict';var emlformat=require(_0xbf23('0x0'));var rimraf=require(_0xbf23('0x1'));var zipdir=require(_0xbf23('0x2'));var jsonpatch=require(_0xbf23('0x3'));var rp=require(_0xbf23('0x4'));var moment=require('moment');var BPromise=require(_0xbf23('0x5'));var Mustache=require(_0xbf23('0x6'));var util=require(_0xbf23('0x7'));var path=require('path');var sox=require(_0xbf23('0x8'));var csv=require(_0xbf23('0x9'));var ejs=require(_0xbf23('0xa'));var fs=require('fs');var fs_extra=require(_0xbf23('0xb'));var _=require(_0xbf23('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbf23('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbf23('0x9'));var querystring=require(_0xbf23('0xe'));var Papa=require(_0xbf23('0xf'));var Redis=require(_0xbf23('0x10'));var authService=require(_0xbf23('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbf23('0x12'));var hardwareService=require(_0xbf23('0x13'));var logger=require(_0xbf23('0x14'))(_0xbf23('0x15'));var utils=require(_0xbf23('0x16'));var config=require(_0xbf23('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xbf23('0x18'))['db'];function respondWithStatusCode(_0x51e816,_0xd01a98){_0xd01a98=_0xd01a98||0xcc;return function(_0x4aea28){if(_0x4aea28){return _0x51e816[_0xbf23('0x19')](_0xd01a98);}return _0x51e816[_0xbf23('0x1a')](_0xd01a98)['end']();};}function respondWithResult(_0xb6880,_0x5a738f){_0x5a738f=_0x5a738f||0xc8;return function(_0x4db531){if(_0x4db531){return _0xb6880[_0xbf23('0x1a')](_0x5a738f)[_0xbf23('0x1b')](_0x4db531);}};}function respondWithFilteredResult(_0x5dd4f9,_0x4cb2a8){return function(_0x1cc52b){if(_0x1cc52b){var _0x581f9a=typeof _0x4cb2a8[_0xbf23('0x1c')]===_0xbf23('0x1d')&&typeof _0x4cb2a8[_0xbf23('0x1e')]===_0xbf23('0x1d');var _0x4c1cca=_0x1cc52b['count'];var _0x58b78f=_0x581f9a?0x0:_0x4cb2a8[_0xbf23('0x1c')];var _0x39f4f3=_0x581f9a?_0x1cc52b[_0xbf23('0x1f')]:_0x4cb2a8[_0xbf23('0x1c')]+_0x4cb2a8['limit'];var _0x9259ca;if(_0x39f4f3>=_0x4c1cca){_0x39f4f3=_0x4c1cca;_0x9259ca=0xc8;}else{_0x9259ca=0xce;}_0x5dd4f9[_0xbf23('0x1a')](_0x9259ca);return _0x5dd4f9[_0xbf23('0x20')]('Content-Range',_0x58b78f+'-'+_0x39f4f3+'/'+_0x4c1cca)[_0xbf23('0x1b')](_0x1cc52b);}return null;};}function patchUpdates(_0x3b6f7e){return function(_0x2bc340){try{jsonpatch[_0xbf23('0x21')](_0x2bc340,_0x3b6f7e,!![]);}catch(_0x570c84){return BPromise[_0xbf23('0x22')](_0x570c84);}return _0x2bc340['save']();};}function saveUpdates(_0xc683e8,_0x5858c7){return function(_0x190d99){if(_0x190d99){return _0x190d99[_0xbf23('0x23')](_0xc683e8)[_0xbf23('0x24')](function(_0x16e0f8){return _0x16e0f8;});}return null;};}function removeEntity(_0x5a4852,_0x5e65c8){return function(_0x5c6e8c){if(_0x5c6e8c){return _0x5c6e8c[_0xbf23('0x25')]()[_0xbf23('0x24')](function(){_0x5a4852['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1896f1,_0xa39dbc){return function(_0x130be4){if(!_0x130be4){_0x1896f1[_0xbf23('0x19')](0x194);}return _0x130be4;};}function handleError(_0x2faf90,_0x1fa3f3){_0x1fa3f3=_0x1fa3f3||0x1f4;return function(_0x30ce6a){logger[_0xbf23('0x26')](_0x30ce6a[_0xbf23('0x27')]);if(_0x30ce6a[_0xbf23('0x28')]){delete _0x30ce6a[_0xbf23('0x28')];}_0x2faf90['status'](_0x1fa3f3)['send'](_0x30ce6a);};}exports[_0xbf23('0x29')]=function(_0x5e6804,_0x2a7baf){var _0x16189f={'raw':!![],'where':{'id':_0x5e6804[_0xbf23('0x2a')]['id']}},_0x58d130={};_0x58d130['model']=_['keys'](db[_0xbf23('0x2b')]['rawAttributes']);_0x58d130[_0xbf23('0x2c')]=_[_0xbf23('0x2d')](_0x5e6804[_0xbf23('0x2c')]);_0x58d130[_0xbf23('0x2e')]=_[_0xbf23('0x2f')](_0x58d130[_0xbf23('0x30')],_0x58d130[_0xbf23('0x2c')]);_0x16189f[_0xbf23('0x31')]=_['intersection'](_0x58d130[_0xbf23('0x30')],qs[_0xbf23('0x32')](_0x5e6804['query']['fields']));_0x16189f[_0xbf23('0x31')]=_0x16189f['attributes'][_0xbf23('0x33')]?_0x16189f[_0xbf23('0x31')]:_0x58d130[_0xbf23('0x30')];if(_0x5e6804[_0xbf23('0x2c')][_0xbf23('0x34')]){_0x16189f[_0xbf23('0x35')]=[{'all':!![]}];}_0x16189f=_['merge']({},_0x16189f,_0x5e6804['options']);return db[_0xbf23('0x2b')][_0xbf23('0x36')](_0x16189f)['then'](handleEntityNotFound(_0x2a7baf,null))[_0xbf23('0x24')](respondWithResult(_0x2a7baf,null))['catch'](handleError(_0x2a7baf,null));};exports['create']=function(_0x1011f0,_0x3c821b){return db[_0xbf23('0x2b')][_0xbf23('0x37')](_0x1011f0['body'],{})[_0xbf23('0x24')](respondWithResult(_0x3c821b,0xc9))[_0xbf23('0x38')](handleError(_0x3c821b,null));};exports[_0xbf23('0x23')]=function(_0x3c9859,_0x272069){if(_0x3c9859['body']['id']){delete _0x3c9859['body']['id'];}return db['ChatProactiveAction'][_0xbf23('0x36')]({'where':{'id':_0x3c9859[_0xbf23('0x2a')]['id']}})['then'](handleEntityNotFound(_0x272069,null))['then'](saveUpdates(_0x3c9859[_0xbf23('0x39')],null))[_0xbf23('0x24')](respondWithResult(_0x272069,null))['catch'](handleError(_0x272069,null));};exports[_0xbf23('0x25')]=function(_0x441e51,_0x4d2ba4){return db[_0xbf23('0x2b')][_0xbf23('0x36')]({'where':{'id':_0x441e51[_0xbf23('0x2a')]['id']}})['then'](handleEntityNotFound(_0x4d2ba4,null))['then'](removeEntity(_0x4d2ba4,null))[_0xbf23('0x38')](handleError(_0x4d2ba4,null));}; \ No newline at end of file +var _0xc5c7=['query','filters','intersection','attributes','fields','length','include','merge','options','ChatProactiveAction','create','body','catch','update','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','then','destroy','name','send','show','params','model','keys','rawAttributes'];(function(_0x2900ca,_0x17a523){var _0x36342f=function(_0xeda161){while(--_0xeda161){_0x2900ca['push'](_0x2900ca['shift']());}};_0x36342f(++_0x17a523);}(_0xc5c7,0x1cf));var _0x7c5c=function(_0x162ea6,_0x4aecdc){_0x162ea6=_0x162ea6-0x0;var _0x4319ef=_0xc5c7[_0x162ea6];return _0x4319ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c5c('0x0'));var zipdir=require(_0x7c5c('0x1'));var jsonpatch=require(_0x7c5c('0x2'));var rp=require(_0x7c5c('0x3'));var moment=require(_0x7c5c('0x4'));var BPromise=require(_0x7c5c('0x5'));var Mustache=require('mustache');var util=require(_0x7c5c('0x6'));var path=require(_0x7c5c('0x7'));var sox=require(_0x7c5c('0x8'));var csv=require(_0x7c5c('0x9'));var ejs=require(_0x7c5c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7c5c('0xb'));var crypto=require('crypto');var jsforce=require(_0x7c5c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7c5c('0x9'));var querystring=require(_0x7c5c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7c5c('0xe'));var qs=require(_0x7c5c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7c5c('0x10'));var logger=require('../../config/logger')(_0x7c5c('0x11'));var utils=require('../../config/utils');var config=require(_0x7c5c('0x12'));var licenseUtil=require(_0x7c5c('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x207464,_0x326230){_0x326230=_0x326230||0xcc;return function(_0x3f1bb4){if(_0x3f1bb4){return _0x207464[_0x7c5c('0x14')](_0x326230);}return _0x207464[_0x7c5c('0x15')](_0x326230)[_0x7c5c('0x16')]();};}function respondWithResult(_0x184f0f,_0x33a9d2){_0x33a9d2=_0x33a9d2||0xc8;return function(_0x2f2285){if(_0x2f2285){return _0x184f0f[_0x7c5c('0x15')](_0x33a9d2)[_0x7c5c('0x17')](_0x2f2285);}};}function respondWithFilteredResult(_0x31bfdb,_0x2af6b3){return function(_0x1ac739){if(_0x1ac739){var _0x4c5b9d=typeof _0x2af6b3['offset']===_0x7c5c('0x18')&&typeof _0x2af6b3[_0x7c5c('0x19')]===_0x7c5c('0x18');var _0x266aea=_0x1ac739['count'];var _0x41bbee=_0x4c5b9d?0x0:_0x2af6b3[_0x7c5c('0x1a')];var _0x3f9704=_0x4c5b9d?_0x1ac739[_0x7c5c('0x1b')]:_0x2af6b3[_0x7c5c('0x1a')]+_0x2af6b3['limit'];var _0x568a95;if(_0x3f9704>=_0x266aea){_0x3f9704=_0x266aea;_0x568a95=0xc8;}else{_0x568a95=0xce;}_0x31bfdb[_0x7c5c('0x15')](_0x568a95);return _0x31bfdb[_0x7c5c('0x1c')](_0x7c5c('0x1d'),_0x41bbee+'-'+_0x3f9704+'/'+_0x266aea)['json'](_0x1ac739);}return null;};}function patchUpdates(_0x170896){return function(_0x1bf163){try{jsonpatch[_0x7c5c('0x1e')](_0x1bf163,_0x170896,!![]);}catch(_0x469b29){return BPromise[_0x7c5c('0x1f')](_0x469b29);}return _0x1bf163['save']();};}function saveUpdates(_0x28a95f,_0x42a551){return function(_0x116528){if(_0x116528){return _0x116528['update'](_0x28a95f)[_0x7c5c('0x20')](function(_0x42d9a0){return _0x42d9a0;});}return null;};}function removeEntity(_0x536916,_0xccd178){return function(_0x4641f3){if(_0x4641f3){return _0x4641f3[_0x7c5c('0x21')]()[_0x7c5c('0x20')](function(){_0x536916[_0x7c5c('0x15')](0xcc)[_0x7c5c('0x16')]();});}};}function handleEntityNotFound(_0x348da0,_0x348930){return function(_0x4673f8){if(!_0x4673f8){_0x348da0[_0x7c5c('0x14')](0x194);}return _0x4673f8;};}function handleError(_0x56a351,_0x4b9dd8){_0x4b9dd8=_0x4b9dd8||0x1f4;return function(_0x43d38b){logger['error'](_0x43d38b['stack']);if(_0x43d38b[_0x7c5c('0x22')]){delete _0x43d38b['name'];}_0x56a351[_0x7c5c('0x15')](_0x4b9dd8)[_0x7c5c('0x23')](_0x43d38b);};}exports[_0x7c5c('0x24')]=function(_0x1b8d20,_0x54094c){var _0x5de2c1={'raw':!![],'where':{'id':_0x1b8d20[_0x7c5c('0x25')]['id']}},_0x447e0d={};_0x447e0d[_0x7c5c('0x26')]=_[_0x7c5c('0x27')](db['ChatProactiveAction'][_0x7c5c('0x28')]);_0x447e0d[_0x7c5c('0x29')]=_[_0x7c5c('0x27')](_0x1b8d20[_0x7c5c('0x29')]);_0x447e0d[_0x7c5c('0x2a')]=_[_0x7c5c('0x2b')](_0x447e0d[_0x7c5c('0x26')],_0x447e0d['query']);_0x5de2c1[_0x7c5c('0x2c')]=_[_0x7c5c('0x2b')](_0x447e0d['model'],qs[_0x7c5c('0x2d')](_0x1b8d20[_0x7c5c('0x29')][_0x7c5c('0x2d')]));_0x5de2c1[_0x7c5c('0x2c')]=_0x5de2c1['attributes'][_0x7c5c('0x2e')]?_0x5de2c1['attributes']:_0x447e0d[_0x7c5c('0x26')];if(_0x1b8d20[_0x7c5c('0x29')]['includeAll']){_0x5de2c1[_0x7c5c('0x2f')]=[{'all':!![]}];}_0x5de2c1=_[_0x7c5c('0x30')]({},_0x5de2c1,_0x1b8d20[_0x7c5c('0x31')]);return db['ChatProactiveAction']['find'](_0x5de2c1)[_0x7c5c('0x20')](handleEntityNotFound(_0x54094c,null))[_0x7c5c('0x20')](respondWithResult(_0x54094c,null))['catch'](handleError(_0x54094c,null));};exports['create']=function(_0x311f65,_0x49e8ee){return db[_0x7c5c('0x32')][_0x7c5c('0x33')](_0x311f65[_0x7c5c('0x34')],{})[_0x7c5c('0x20')](respondWithResult(_0x49e8ee,0xc9))[_0x7c5c('0x35')](handleError(_0x49e8ee,null));};exports[_0x7c5c('0x36')]=function(_0x4a76f9,_0x27bc9b){if(_0x4a76f9['body']['id']){delete _0x4a76f9[_0x7c5c('0x34')]['id'];}return db[_0x7c5c('0x32')][_0x7c5c('0x37')]({'where':{'id':_0x4a76f9['params']['id']}})[_0x7c5c('0x20')](handleEntityNotFound(_0x27bc9b,null))[_0x7c5c('0x20')](saveUpdates(_0x4a76f9[_0x7c5c('0x34')],null))[_0x7c5c('0x20')](respondWithResult(_0x27bc9b,null))[_0x7c5c('0x35')](handleError(_0x27bc9b,null));};exports[_0x7c5c('0x21')]=function(_0x22e459,_0x2f1734){return db['ChatProactiveAction'][_0x7c5c('0x37')]({'where':{'id':_0x22e459[_0x7c5c('0x25')]['id']}})[_0x7c5c('0x20')](handleEntityNotFound(_0x2f1734,null))[_0x7c5c('0x20')](removeEntity(_0x2f1734,null))[_0x7c5c('0x35')](handleError(_0x2f1734,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 7c081be..7f71701 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 _0xa2fc=['util','../../config/logger','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','exports','lodash'];(function(_0x4a7193,_0x5fa9a5){var _0x417395=function(_0x10e155){while(--_0x10e155){_0x4a7193['push'](_0x4a7193['shift']());}};_0x417395(++_0x5fa9a5);}(_0xa2fc,0x8f));var _0xca2f=function(_0x4b7e4d,_0x82d2ab){_0x4b7e4d=_0x4b7e4d-0x0;var _0x38d6af=_0xa2fc[_0x4b7e4d];return _0x38d6af;};'use strict';var _=require(_0xca2f('0x0'));var util=require(_0xca2f('0x1'));var logger=require(_0xca2f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xca2f('0x3'));var rp=require(_0xca2f('0x4'));var fs=require('fs');var path=require(_0xca2f('0x5'));var rimraf=require(_0xca2f('0x6'));var config=require('../../config/environment');var attributes=require(_0xca2f('0x7'));module[_0xca2f('0x8')]=function(_0x374dc0,_0x4d414c){return _0x374dc0['define']('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7cc3=['../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','util'];(function(_0x1af9ed,_0x313f91){var _0x30206e=function(_0x211c37){while(--_0x211c37){_0x1af9ed['push'](_0x1af9ed['shift']());}};_0x30206e(++_0x313f91);}(_0x7cc3,0x1a1));var _0x37cc=function(_0x221853,_0xe338ab){_0x221853=_0x221853-0x0;var _0x3d725f=_0x7cc3[_0x221853];return _0x3d725f;};'use strict';var _=require('lodash');var util=require(_0x37cc('0x0'));var logger=require(_0x37cc('0x1'))(_0x37cc('0x2'));var moment=require(_0x37cc('0x3'));var BPromise=require('bluebird');var rp=require(_0x37cc('0x4'));var fs=require('fs');var path=require(_0x37cc('0x5'));var rimraf=require('rimraf');var config=require(_0x37cc('0x6'));var attributes=require('./chatProactiveAction.attributes');module[_0x37cc('0x7')]=function(_0x53ecc8,_0x3f4bb9){return _0x53ecc8[_0x37cc('0x8')](_0x37cc('0x9'),attributes,{'tableName':_0x37cc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 9ceb7d7..bd6bb43 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 _0x8403=['request','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise'];(function(_0x27d614,_0x4bf4d6){var _0x378d4e=function(_0x489e04){while(--_0x489e04){_0x27d614['push'](_0x27d614['shift']());}};_0x378d4e(++_0x4bf4d6);}(_0x8403,0x119));var _0x3840=function(_0x239de7,_0x4f2574){_0x239de7=_0x239de7-0x0;var _0x4020a0=_0x8403[_0x239de7];return _0x4020a0;};'use strict';var _=require('lodash');var util=require(_0x3840('0x0'));var moment=require(_0x3840('0x1'));var BPromise=require(_0x3840('0x2'));var rs=require(_0x3840('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3840('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x3840('0x5'));var jayson=require(_0x3840('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x298ed1,_0x283cba,_0x29c078){return new BPromise(function(_0x52d449,_0x3a5c4a){return client[_0x3840('0x7')](_0x298ed1,_0x29c078)['then'](function(_0x235b12){logger['info'](_0x3840('0x8'),_0x283cba,_0x3840('0x9'));logger[_0x3840('0xa')](_0x3840('0xb'),_0x283cba,_0x3840('0x9'),JSON[_0x3840('0xc')](_0x235b12));if(_0x235b12[_0x3840('0xd')]){if(_0x235b12[_0x3840('0xd')][_0x3840('0xe')]===0x1f4){logger[_0x3840('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x283cba,_0x235b12[_0x3840('0xd')][_0x3840('0xf')]);return _0x3a5c4a(_0x235b12[_0x3840('0xd')][_0x3840('0xf')]);}logger[_0x3840('0xd')](_0x3840('0x8'),_0x283cba,_0x235b12[_0x3840('0xd')][_0x3840('0xf')]);return _0x52d449(_0x235b12[_0x3840('0xd')][_0x3840('0xf')]);}else{logger[_0x3840('0x10')](_0x3840('0x8'),_0x283cba,_0x3840('0x9'));_0x52d449(_0x235b12['result'][_0x3840('0xf')]);}})[_0x3840('0x11')](function(_0x3ae7cb){logger['error'](_0x3840('0x8'),_0x283cba,_0x3ae7cb);_0x3a5c4a(_0x3ae7cb);});});} \ No newline at end of file +var _0xfb2c=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x13327e,_0x855c59){var _0x10dae8=function(_0x4eab79){while(--_0x4eab79){_0x13327e['push'](_0x13327e['shift']());}};_0x10dae8(++_0x855c59);}(_0xfb2c,0x9b));var _0xcfb2=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xfb2c[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0xcfb2('0x0'));var util=require(_0xcfb2('0x1'));var moment=require('moment');var BPromise=require(_0xcfb2('0x2'));var rs=require(_0xcfb2('0x3'));var fs=require('fs');var Redis=require(_0xcfb2('0x4'));var db=require(_0xcfb2('0x5'))['db'];var utils=require(_0xcfb2('0x6'));var logger=require(_0xcfb2('0x7'))(_0xcfb2('0x8'));var config=require(_0xcfb2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xcfb2('0xa')][_0xcfb2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x423b8a,_0x5a674a,_0x47ee54){return new BPromise(function(_0xa67587,_0x45ac06){return client['request'](_0x423b8a,_0x47ee54)[_0xcfb2('0xc')](function(_0x1131aa){logger['info'](_0xcfb2('0xd'),_0x5a674a,_0xcfb2('0xe'));logger[_0xcfb2('0xf')](_0xcfb2('0x10'),_0x5a674a,_0xcfb2('0xe'),JSON[_0xcfb2('0x11')](_0x1131aa));if(_0x1131aa['error']){if(_0x1131aa[_0xcfb2('0x12')]['code']===0x1f4){logger[_0xcfb2('0x12')](_0xcfb2('0xd'),_0x5a674a,_0x1131aa[_0xcfb2('0x12')]['message']);return _0x45ac06(_0x1131aa[_0xcfb2('0x12')][_0xcfb2('0x13')]);}logger[_0xcfb2('0x12')](_0xcfb2('0xd'),_0x5a674a,_0x1131aa[_0xcfb2('0x12')][_0xcfb2('0x13')]);return _0xa67587(_0x1131aa[_0xcfb2('0x12')][_0xcfb2('0x13')]);}else{logger[_0xcfb2('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x5a674a,'request\x20sent');_0xa67587(_0x1131aa[_0xcfb2('0x15')][_0xcfb2('0x13')]);}})[_0xcfb2('0x16')](function(_0x29645f){logger['error'](_0xcfb2('0xd'),_0x5a674a,_0x29645f);_0x45ac06(_0x29645f);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index c856977..2c582e2 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 _0xb138=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','post','create','destroy','exports','multer','util','path'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0xb138,0x1dd));var _0x8b13=function(_0x28f51b,_0x2a063b){_0x28f51b=_0x28f51b-0x0;var _0x2dc6ff=_0xb138[_0x28f51b];return _0x2dc6ff;};'use strict';var multer=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var path=require(_0x8b13('0x2'));var timeout=require(_0x8b13('0x3'));var express=require(_0x8b13('0x4'));var router=express[_0x8b13('0x5')]();var fs_extra=require(_0x8b13('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var controller=require(_0x8b13('0x9'));router['get'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['show']);router[_0x8b13('0xc')]('/',auth[_0x8b13('0xb')](),controller[_0x8b13('0xd')]);router['put'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['update']);router['delete'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller[_0x8b13('0xe')]);module[_0x8b13('0xf')]=router; \ No newline at end of file +var _0xf2ca=['show','create','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated'];(function(_0x8c697,_0x5f32fd){var _0x290bd5=function(_0x35d768){while(--_0x35d768){_0x8c697['push'](_0x8c697['shift']());}};_0x290bd5(++_0x5f32fd);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x36147b,_0x57f40b){_0x36147b=_0x36147b-0x0;var _0x141351=_0xf2ca[_0x36147b];return _0x141351;};'use strict';var multer=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x3'));var router=express[_0xaf2c('0x4')]();var fs_extra=require(_0xaf2c('0x5'));var auth=require(_0xaf2c('0x6'));var interaction=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var controller=require('./chatProactiveAction.controller');router[_0xaf2c('0x9')](_0xaf2c('0xa'),auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xc')]);router['post']('/',auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xd')]);router['put'](_0xaf2c('0xa'),auth['isAuthenticated'](),controller[_0xaf2c('0xe')]);router['delete'](_0xaf2c('0xa'),auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xf')]);module[_0xaf2c('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index a6a71e0..9336c88 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 _0x5aa1=['STRING','name','ENUM','sequelize','exports'];(function(_0x18f9e6,_0x6ec00){var _0x3aa805=function(_0x2e32ff){while(--_0x2e32ff){_0x18f9e6['push'](_0x18f9e6['shift']());}};_0x3aa805(++_0x6ec00);}(_0x5aa1,0xbc));var _0x15aa=function(_0xaef3d3,_0x174e0a){_0xaef3d3=_0xaef3d3-0x0;var _0x16c2db=_0x5aa1[_0xaef3d3];return _0x16c2db;};'use strict';var Sequelize=require(_0x15aa('0x0'));module[_0x15aa('0x1')]={'name':{'type':Sequelize[_0x15aa('0x2')],'unique':_0x15aa('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x15aa('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x15aa('0x4')]('rrmemory','beepall','roundrobin')}}; \ No newline at end of file +var _0x5414=['beepall','roundrobin','sequelize','exports','name','STRING','ENUM'];(function(_0x1ad659,_0x1ab26a){var _0x56d7e2=function(_0x3c3f02){while(--_0x3c3f02){_0x1ad659['push'](_0x1ad659['shift']());}};_0x56d7e2(++_0x1ab26a);}(_0x5414,0x121));var _0x4541=function(_0x1bf956,_0x88182a){_0x1bf956=_0x1bf956-0x0;var _0x10b8dc=_0x5414[_0x1bf956];return _0x10b8dc;};'use strict';var Sequelize=require(_0x4541('0x0'));module[_0x4541('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4541('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4541('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4541('0x4')]('rrmemory',_0x4541('0x5'),_0x4541('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index c2e2d92..13fccf4 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 _0x8dc4=['intersection','model','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','hasOwnProperty','pick','ChatQueueId','filter','User','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','ids','Agents','voicePause','interface','flatMap','sequelize','addTeams','each','UserChatQueue','findOrCreate','emit','select','tq.TeamId','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','all','union','compact','value','transaction','removeTeams','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','destroy','get','ChatQueues','UserProfileResource','stack','name','index','ChatQueue','rawAttributes','fieldName','type','key','map','query','filters'];(function(_0x8261bb,_0x48e718){var _0x530867=function(_0x4b2b4e){while(--_0x4b2b4e){_0x8261bb['push'](_0x8261bb['shift']());}};_0x530867(++_0x48e718);}(_0x8dc4,0x185));var _0x48dc=function(_0x566269,_0x423f18){_0x566269=_0x566269-0x0;var _0x4ffd0a=_0x8dc4[_0x566269];return _0x4ffd0a;};'use strict';var emlformat=require(_0x48dc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x48dc('0x1'));var jsonpatch=require(_0x48dc('0x2'));var rp=require(_0x48dc('0x3'));var moment=require(_0x48dc('0x4'));var BPromise=require(_0x48dc('0x5'));var Mustache=require(_0x48dc('0x6'));var util=require(_0x48dc('0x7'));var path=require(_0x48dc('0x8'));var sox=require(_0x48dc('0x9'));var csv=require(_0x48dc('0xa'));var ejs=require(_0x48dc('0xb'));var fs=require('fs');var fs_extra=require(_0x48dc('0xc'));var _=require('lodash');var squel=require(_0x48dc('0xd'));var crypto=require(_0x48dc('0xe'));var jsforce=require(_0x48dc('0xf'));var deskjs=require(_0x48dc('0x10'));var toCsv=require(_0x48dc('0xa'));var querystring=require(_0x48dc('0x11'));var Papa=require('papaparse');var Redis=require(_0x48dc('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x48dc('0x13'));var hardwareService=require(_0x48dc('0x14'));var logger=require(_0x48dc('0x15'))('api');var utils=require(_0x48dc('0x16'));var config=require(_0x48dc('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x48dc('0x18')],{'host':_0x48dc('0x19'),'port':0x18eb});var socket=require(_0x48dc('0x1a'))(new Redis(config[_0x48dc('0x18')]));require(_0x48dc('0x1b'))[_0x48dc('0x1c')](socket);var jayson=require(_0x48dc('0x1d'));var client=jayson[_0x48dc('0x1e')][_0x48dc('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x522238,_0x25cba8,_0x911d77,_0x1a3b5d){return new BPromise(function(_0x3866c7,_0x29c82f){var _0x59cdf4=_0x1a3b5d||client;return _0x59cdf4[_0x48dc('0x20')](_0x522238,_0x911d77)[_0x48dc('0x21')](function(_0x143996){logger[_0x48dc('0x22')]('ChatQueue,\x20%s,\x20%s',_0x25cba8,_0x48dc('0x23'));logger[_0x48dc('0x24')](_0x48dc('0x25'),_0x25cba8,_0x48dc('0x23'),JSON[_0x48dc('0x26')](_0x143996));if(_0x143996[_0x48dc('0x27')]){if(_0x143996[_0x48dc('0x27')]['code']===0x1f4){logger[_0x48dc('0x27')](_0x48dc('0x28'),_0x25cba8,_0x143996['error'][_0x48dc('0x29')]);return _0x29c82f(_0x143996[_0x48dc('0x27')]['message']);}logger[_0x48dc('0x27')]('ChatQueue,\x20%s,\x20%s',_0x25cba8,_0x143996[_0x48dc('0x27')]['message']);return _0x3866c7(_0x143996[_0x48dc('0x27')][_0x48dc('0x29')]);}else{logger[_0x48dc('0x22')](_0x48dc('0x28'),_0x25cba8,_0x48dc('0x23'));_0x3866c7(_0x143996[_0x48dc('0x2a')][_0x48dc('0x29')]);}})[_0x48dc('0x2b')](function(_0x39397b){logger[_0x48dc('0x27')](_0x48dc('0x28'),_0x25cba8,_0x39397b);_0x29c82f(_0x39397b);});});}function respondWithStatusCode(_0x555041,_0x14b8d6){_0x14b8d6=_0x14b8d6||0xcc;return function(_0x15fb91){if(_0x15fb91){return _0x555041[_0x48dc('0x2c')](_0x14b8d6);}return _0x555041['status'](_0x14b8d6)[_0x48dc('0x2d')]();};}function respondWithResult(_0x4061cf,_0x5b3138){_0x5b3138=_0x5b3138||0xc8;return function(_0x54dd1d){if(_0x54dd1d){return _0x4061cf[_0x48dc('0x2e')](_0x5b3138)[_0x48dc('0x2f')](_0x54dd1d);}};}function respondWithFilteredResult(_0x4a4b33,_0x430a21){return function(_0x1dd02c){if(_0x1dd02c){var _0x58be07=typeof _0x430a21[_0x48dc('0x30')]===_0x48dc('0x31')&&typeof _0x430a21[_0x48dc('0x32')]===_0x48dc('0x31');var _0x25b637=_0x1dd02c['count'];var _0x5d50f7=_0x58be07?0x0:_0x430a21['offset'];var _0x54c7c7=_0x58be07?_0x1dd02c[_0x48dc('0x33')]:_0x430a21[_0x48dc('0x30')]+_0x430a21[_0x48dc('0x32')];var _0x2c0fa1;if(_0x54c7c7>=_0x25b637){_0x54c7c7=_0x25b637;_0x2c0fa1=0xc8;}else{_0x2c0fa1=0xce;}_0x4a4b33[_0x48dc('0x2e')](_0x2c0fa1);return _0x4a4b33['set'](_0x48dc('0x34'),_0x5d50f7+'-'+_0x54c7c7+'/'+_0x25b637)[_0x48dc('0x2f')](_0x1dd02c);}return null;};}function patchUpdates(_0x30b1f5){return function(_0x13cd3e){try{jsonpatch[_0x48dc('0x35')](_0x13cd3e,_0x30b1f5,!![]);}catch(_0x1767c5){return BPromise['reject'](_0x1767c5);}return _0x13cd3e[_0x48dc('0x36')]();};}function saveUpdates(_0x39904c,_0x243c1b){return function(_0x5a6d96){if(_0x5a6d96){return _0x5a6d96['update'](_0x39904c)[_0x48dc('0x21')](function(_0x51c562){return _0x51c562;});}return null;};}function removeEntity(_0x33be66,_0x35630c){return function(_0x1bf5e1){if(_0x1bf5e1){return _0x1bf5e1[_0x48dc('0x37')]()['then'](function(){var _0xad5762=_0x1bf5e1[_0x48dc('0x38')]({'plain':!![]});var _0x2d5f30=_0x48dc('0x39');return db[_0x48dc('0x3a')][_0x48dc('0x37')]({'where':{'type':_0x2d5f30,'resourceId':_0xad5762['id']}})[_0x48dc('0x21')](function(){return _0x1bf5e1;});})[_0x48dc('0x21')](function(){_0x33be66[_0x48dc('0x2e')](0xcc)[_0x48dc('0x2d')]();});}};}function handleEntityNotFound(_0xe4449c,_0x2ed60d){return function(_0x592e88){if(!_0x592e88){_0xe4449c[_0x48dc('0x2c')](0x194);}return _0x592e88;};}function handleError(_0x951b35,_0x2958a){_0x2958a=_0x2958a||0x1f4;return function(_0x545f68){logger[_0x48dc('0x27')](_0x545f68[_0x48dc('0x3b')]);if(_0x545f68['name']){delete _0x545f68[_0x48dc('0x3c')];}_0x951b35[_0x48dc('0x2e')](_0x2958a)['send'](_0x545f68);};}exports[_0x48dc('0x3d')]=function(_0x4f090e,_0x14a667){var _0xbd022c={},_0x3817fe={},_0x54bc1d={'count':0x0,'rows':[]};var _0x2478bc=_['map'](db[_0x48dc('0x3e')][_0x48dc('0x3f')],function(_0x299017){return{'name':_0x299017[_0x48dc('0x40')],'type':_0x299017[_0x48dc('0x41')][_0x48dc('0x42')]};});_0x3817fe['model']=_[_0x48dc('0x43')](_0x2478bc,_0x48dc('0x3c'));_0x3817fe[_0x48dc('0x44')]=_['keys'](_0x4f090e[_0x48dc('0x44')]);_0x3817fe[_0x48dc('0x45')]=_[_0x48dc('0x46')](_0x3817fe[_0x48dc('0x47')],_0x3817fe[_0x48dc('0x44')]);_0xbd022c[_0x48dc('0x48')]=_[_0x48dc('0x46')](_0x3817fe[_0x48dc('0x47')],qs[_0x48dc('0x49')](_0x4f090e[_0x48dc('0x44')]['fields']));_0xbd022c[_0x48dc('0x48')]=_0xbd022c['attributes'][_0x48dc('0x4a')]?_0xbd022c[_0x48dc('0x48')]:_0x3817fe[_0x48dc('0x47')];if(!_0x4f090e[_0x48dc('0x44')]['hasOwnProperty'](_0x48dc('0x4b'))){_0xbd022c[_0x48dc('0x32')]=qs[_0x48dc('0x32')](_0x4f090e[_0x48dc('0x44')][_0x48dc('0x32')]);_0xbd022c[_0x48dc('0x30')]=qs['offset'](_0x4f090e['query'][_0x48dc('0x30')]);}_0xbd022c[_0x48dc('0x4c')]=qs[_0x48dc('0x4d')](_0x4f090e[_0x48dc('0x44')]['sort']);_0xbd022c[_0x48dc('0x4e')]=qs[_0x48dc('0x45')](_['pick'](_0x4f090e['query'],_0x3817fe[_0x48dc('0x45')]),_0x2478bc);if(_0x4f090e[_0x48dc('0x44')]['filter']){_0xbd022c['where']=_[_0x48dc('0x4f')](_0xbd022c[_0x48dc('0x4e')],{'$or':_[_0x48dc('0x43')](_0x2478bc,function(_0x3eb7a5){if(_0x3eb7a5[_0x48dc('0x41')]!==_0x48dc('0x50')){var _0x2b09e3={};_0x2b09e3[_0x3eb7a5[_0x48dc('0x3c')]]={'$like':'%'+_0x4f090e[_0x48dc('0x44')]['filter']+'%'};return _0x2b09e3;}})});}_0xbd022c=_[_0x48dc('0x4f')]({},_0xbd022c,_0x4f090e[_0x48dc('0x51')]);var _0x17e566={'where':_0xbd022c[_0x48dc('0x4e')]};return db[_0x48dc('0x3e')][_0x48dc('0x33')](_0x17e566)['then'](function(_0x2754a8){_0x54bc1d[_0x48dc('0x33')]=_0x2754a8;if(_0x4f090e[_0x48dc('0x44')][_0x48dc('0x52')]){_0xbd022c[_0x48dc('0x53')]=[{'all':!![]}];}return db[_0x48dc('0x3e')][_0x48dc('0x54')](_0xbd022c);})[_0x48dc('0x21')](function(_0x4a7c2f){_0x54bc1d['rows']=_0x4a7c2f;return _0x54bc1d;})[_0x48dc('0x21')](respondWithFilteredResult(_0x14a667,_0xbd022c))['catch'](handleError(_0x14a667,null));};exports[_0x48dc('0x55')]=function(_0x1bcf7c,_0xa45291){var _0x3a422f={'raw':!![],'where':{'id':_0x1bcf7c[_0x48dc('0x56')]['id']}},_0x52aa39={};_0x52aa39[_0x48dc('0x47')]=_['keys'](db[_0x48dc('0x3e')][_0x48dc('0x3f')]);_0x52aa39[_0x48dc('0x44')]=_[_0x48dc('0x57')](_0x1bcf7c[_0x48dc('0x44')]);_0x52aa39['filters']=_[_0x48dc('0x46')](_0x52aa39['model'],_0x52aa39['query']);_0x3a422f['attributes']=_['intersection'](_0x52aa39[_0x48dc('0x47')],qs[_0x48dc('0x49')](_0x1bcf7c[_0x48dc('0x44')]['fields']));_0x3a422f[_0x48dc('0x48')]=_0x3a422f[_0x48dc('0x48')][_0x48dc('0x4a')]?_0x3a422f[_0x48dc('0x48')]:_0x52aa39[_0x48dc('0x47')];if(_0x1bcf7c[_0x48dc('0x44')][_0x48dc('0x52')]){_0x3a422f[_0x48dc('0x53')]=[{'all':!![]}];}_0x3a422f=_[_0x48dc('0x4f')]({},_0x3a422f,_0x1bcf7c[_0x48dc('0x51')]);return db[_0x48dc('0x3e')][_0x48dc('0x58')](_0x3a422f)['then'](handleEntityNotFound(_0xa45291,null))[_0x48dc('0x21')](respondWithResult(_0xa45291,null))[_0x48dc('0x2b')](handleError(_0xa45291,null));};exports[_0x48dc('0x59')]=function(_0x1da67f,_0x3fc6c5){return db[_0x48dc('0x3e')][_0x48dc('0x59')](_0x1da67f[_0x48dc('0x5a')],{})[_0x48dc('0x21')](function(_0xe8306d){var _0x2d9312=_0x1da67f['user'][_0x48dc('0x38')]({'plain':!![]});if(!_0x2d9312)throw new Error(_0x48dc('0x5b'));if(_0x2d9312[_0x48dc('0x5c')]==='user'){var _0x58cb3f=_0xe8306d['get']({'plain':!![]});var _0x471c5c=_0x48dc('0x39');return db[_0x48dc('0x5d')][_0x48dc('0x58')]({'where':{'name':_0x471c5c,'userProfileId':_0x2d9312[_0x48dc('0x5e')]},'raw':!![]})['then'](function(_0x30e99b){if(_0x30e99b&&_0x30e99b[_0x48dc('0x5f')]===0x0){return db['UserProfileResource'][_0x48dc('0x59')]({'name':_0x58cb3f['name'],'resourceId':_0x58cb3f['id'],'type':_0x30e99b['name'],'sectionId':_0x30e99b['id']},{})['then'](function(){return _0xe8306d;});}else{return _0xe8306d;}})[_0x48dc('0x2b')](function(_0x3e1711){logger[_0x48dc('0x27')](_0x48dc('0x60'),_0x3e1711);throw _0x3e1711;});}return _0xe8306d;})[_0x48dc('0x21')](respondWithResult(_0x3fc6c5,0xc9))[_0x48dc('0x2b')](handleError(_0x3fc6c5,null));};exports[_0x48dc('0x61')]=function(_0x107bee,_0x28f08a){if(_0x107bee['body']['id']){delete _0x107bee[_0x48dc('0x5a')]['id'];}return db['ChatQueue'][_0x48dc('0x58')]({'where':{'id':_0x107bee['params']['id']}})['then'](handleEntityNotFound(_0x28f08a,null))[_0x48dc('0x21')](saveUpdates(_0x107bee[_0x48dc('0x5a')],null))[_0x48dc('0x21')](respondWithResult(_0x28f08a,null))['catch'](handleError(_0x28f08a,null));};exports['destroy']=function(_0x384810,_0x30e112){return db['ChatQueue'][_0x48dc('0x58')]({'where':{'id':_0x384810[_0x48dc('0x56')]['id']}})['then'](handleEntityNotFound(_0x30e112,null))['then'](removeEntity(_0x30e112,null))[_0x48dc('0x2b')](handleError(_0x30e112,null));};exports['describe']=function(_0x5f009f,_0x1a772f){return db[_0x48dc('0x3e')][_0x48dc('0x62')]()[_0x48dc('0x21')](respondWithResult(_0x1a772f,null))[_0x48dc('0x2b')](handleError(_0x1a772f,null));};exports[_0x48dc('0x63')]=function(_0x562e84,_0x3f95bc,_0x5d944d){var _0x2319af={'raw':!![],'where':{}},_0x251f33={},_0x552e45;return db[_0x48dc('0x3e')][_0x48dc('0x64')]({'where':{'id':_0x562e84[_0x48dc('0x56')]['id']}})[_0x48dc('0x21')](handleEntityNotFound(_0x3f95bc,null))[_0x48dc('0x21')](function(_0x32bb1c){if(_0x32bb1c){_0x552e45=_0x32bb1c[_0x48dc('0x38')]({'plain':!![]});_0x251f33['model']=_[_0x48dc('0x57')](db['UserChatQueue'][_0x48dc('0x3f')]);_0x251f33[_0x48dc('0x44')]=_[_0x48dc('0x57')](_0x562e84['query']);_0x251f33['filters']=_[_0x48dc('0x46')](_0x251f33[_0x48dc('0x47')],_0x251f33[_0x48dc('0x44')]);_0x2319af[_0x48dc('0x48')]=_[_0x48dc('0x46')](_0x251f33[_0x48dc('0x47')],qs[_0x48dc('0x49')](_0x562e84[_0x48dc('0x44')][_0x48dc('0x49')]));_0x2319af[_0x48dc('0x48')]=_0x2319af[_0x48dc('0x48')]['length']?_0x2319af[_0x48dc('0x48')]:_0x251f33[_0x48dc('0x47')];if(!_0x562e84[_0x48dc('0x44')][_0x48dc('0x65')](_0x48dc('0x4b'))){_0x2319af[_0x48dc('0x32')]=qs['limit'](_0x562e84['query'][_0x48dc('0x32')]);_0x2319af[_0x48dc('0x30')]=qs['offset'](_0x562e84[_0x48dc('0x44')][_0x48dc('0x30')]);}_0x2319af[_0x48dc('0x4c')]=qs[_0x48dc('0x4d')](_0x562e84[_0x48dc('0x44')][_0x48dc('0x4d')]);_0x2319af[_0x48dc('0x4e')]=qs[_0x48dc('0x45')](_[_0x48dc('0x66')](_0x562e84[_0x48dc('0x44')],_0x251f33[_0x48dc('0x45')]));_0x2319af['where'][_0x48dc('0x67')]=_0x32bb1c['id'];if(_0x562e84[_0x48dc('0x44')][_0x48dc('0x68')]){_0x2319af[_0x48dc('0x4e')]=_['merge'](_0x2319af[_0x48dc('0x4e')],{'$or':_[_0x48dc('0x43')](_0x2319af['attributes'],function(_0x4f96a8){var _0x5244ff={};_0x5244ff[_0x4f96a8]={'$like':'%'+_0x562e84[_0x48dc('0x44')][_0x48dc('0x68')]+'%'};return _0x5244ff;})});}_0x2319af=_['merge']({},_0x2319af,_0x562e84[_0x48dc('0x51')]);return db['UserChatQueue'][_0x48dc('0x54')](_0x2319af);}})[_0x48dc('0x21')](function(_0x21fbcb){if(_0x21fbcb){return db[_0x48dc('0x69')]['findAndCountAll']({'where':{'id':_[_0x48dc('0x43')](_0x21fbcb,'UserId'),'role':_0x48dc('0x6a')},'attributes':['id','name',_0x48dc('0x6b'),_0x48dc('0x6c'),_0x48dc('0x6d')]});}})['then'](function(_0x34d813){if(_0x34d813){return{'count':_0x34d813[_0x48dc('0x33')],'rows':_[_0x48dc('0x43')](_0x34d813[_0x48dc('0x6e')],function(_0xbc485f){return{'membername':_0xbc485f[_0x48dc('0x3c')],'UserId':_0xbc485f['id'],'queue_name':_0x552e45['name'],'ChatQueueId':_0x552e45['id'],'interface':util[_0x48dc('0x6f')](_0x48dc('0x70'),_0x48dc('0x71'),_0xbc485f[_0x48dc('0x3c')]),'penalty':0x0,'paused':_0xbc485f['chatPause'],'createdAt':_0xbc485f[_0x48dc('0x6d')],'updatedAt':_0xbc485f['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x48dc('0x21')](respondWithFilteredResult(_0x3f95bc,_0x2319af))[_0x48dc('0x2b')](handleError(_0x3f95bc,null));};exports[_0x48dc('0x72')]=function(_0x104e71,_0x133bc8,_0x49a142){var _0x5e2f9c={};var _0x5df683={};var _0x1c6b8d;var _0xff09fe;return db[_0x48dc('0x3e')][_0x48dc('0x64')]({'where':{'id':_0x104e71[_0x48dc('0x56')]['id']}})[_0x48dc('0x21')](handleEntityNotFound(_0x133bc8,null))[_0x48dc('0x21')](function(_0x39fef3){if(_0x39fef3){_0x1c6b8d=_0x39fef3;_0x5df683[_0x48dc('0x47')]=_[_0x48dc('0x57')](db[_0x48dc('0x73')][_0x48dc('0x3f')]);_0x5df683[_0x48dc('0x44')]=_[_0x48dc('0x57')](_0x104e71[_0x48dc('0x44')]);_0x5df683[_0x48dc('0x45')]=_[_0x48dc('0x46')](_0x5df683[_0x48dc('0x47')],_0x5df683[_0x48dc('0x44')]);_0x5e2f9c[_0x48dc('0x48')]=_[_0x48dc('0x46')](_0x5df683[_0x48dc('0x47')],qs[_0x48dc('0x49')](_0x104e71[_0x48dc('0x44')]['fields']));_0x5e2f9c[_0x48dc('0x48')]=_0x5e2f9c[_0x48dc('0x48')][_0x48dc('0x4a')]?_0x5e2f9c[_0x48dc('0x48')]:_0x5df683['model'];_0x5e2f9c[_0x48dc('0x4c')]=qs[_0x48dc('0x4d')](_0x104e71[_0x48dc('0x44')][_0x48dc('0x4d')]);_0x5e2f9c[_0x48dc('0x4e')]=qs[_0x48dc('0x45')](_[_0x48dc('0x66')](_0x104e71[_0x48dc('0x44')],_0x5df683[_0x48dc('0x45')]));if(_0x104e71['query'][_0x48dc('0x68')]){_0x5e2f9c[_0x48dc('0x4e')]=_['merge'](_0x5e2f9c['where'],{'$or':_['map'](_0x5e2f9c['attributes'],function(_0x59d534){var _0xeaafc5={};_0xeaafc5[_0x59d534]={'$like':'%'+_0x104e71['query'][_0x48dc('0x68')]+'%'};return _0xeaafc5;})});}_0x5e2f9c=_['merge']({},_0x5e2f9c,_0x104e71[_0x48dc('0x51')]);return _0x1c6b8d['getTeams'](_0x5e2f9c);}})[_0x48dc('0x21')](function(_0x314f6a){if(_0x314f6a){_0xff09fe=_0x314f6a[_0x48dc('0x4a')];if(!_0x104e71[_0x48dc('0x44')][_0x48dc('0x65')](_0x48dc('0x4b'))){_0x5e2f9c[_0x48dc('0x32')]=qs[_0x48dc('0x32')](_0x104e71[_0x48dc('0x44')][_0x48dc('0x32')]);_0x5e2f9c['offset']=qs[_0x48dc('0x30')](_0x104e71[_0x48dc('0x44')]['offset']);}return _0x1c6b8d[_0x48dc('0x72')](_0x5e2f9c);}})[_0x48dc('0x21')](function(_0x23da6f){if(_0x23da6f){return _0x23da6f?{'count':_0xff09fe,'rows':_0x23da6f}:null;}})['then'](respondWithResult(_0x133bc8,null))[_0x48dc('0x2b')](handleError(_0x133bc8,null));};exports['addTeams']=function(_0xa0d2b9,_0x11e0fb,_0x56a72f){var _0x9f58b0=_0xa0d2b9[_0x48dc('0x5a')][_0x48dc('0x74')];return db[_0x48dc('0x73')][_0x48dc('0x54')]({'where':{'id':_0x9f58b0},'attributes':['id'],'include':[{'model':db[_0x48dc('0x69')],'as':_0x48dc('0x75'),'attributes':['id',_0x48dc('0x3c'),'online',_0x48dc('0x76'),_0x48dc('0x77')],'raw':!![]}]})['then'](function(_0x557be3){if(_0x557be3){var _0x5b1a01=_[_0x48dc('0x78')](_0x557be3,function(_0x57ab89){var _0x58568d=_0x57ab89['get']({'plain':!![]});return _0x58568d[_0x48dc('0x75')];});return db[_0x48dc('0x3e')][_0x48dc('0x58')]({'where':{'id':_0xa0d2b9[_0x48dc('0x56')]['id']}})['then'](function(_0x12bde6){return db[_0x48dc('0x79')]['transaction'](function(_0x4028a0){return _0x12bde6[_0x48dc('0x7a')](_0x9f58b0,{'transaction':_0x4028a0})[_0x48dc('0x21')](function(){return BPromise[_0x48dc('0x7b')](_0x5b1a01,function(_0x4f9a6c){return db[_0x48dc('0x7c')][_0x48dc('0x7d')]({'where':{'UserId':_0x4f9a6c['id'],'ChatQueueId':_0xa0d2b9[_0x48dc('0x56')]['id']},'transaction':_0x4028a0});});})[_0x48dc('0x21')](function(){_0x5b1a01['forEach'](function(_0x5e0c2c){socket[_0x48dc('0x7e')]('userChatQueue:save',{'UserId':_0x5e0c2c['id'],'ChatQueueId':_0x12bde6['id']});});});});});}})[_0x48dc('0x21')](respondWithStatusCode(_0x11e0fb,null))['catch'](handleError(_0x11e0fb,null));};exports['removeTeams']=function(_0x1ef6b4,_0x3b611,_0x1bb77d){return db[_0x48dc('0x73')][_0x48dc('0x54')]({'where':{'id':_0x1ef6b4[_0x48dc('0x44')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x48dc('0x75'),'attributes':['id'],'raw':!![]}]})[_0x48dc('0x21')](handleEntityNotFound(_0x3b611,null))[_0x48dc('0x21')](function(_0x50fd3e){var _0x930140=_[_0x48dc('0x43')](_0x50fd3e,'id');var _0x2e5e0d=[];var _0x18d1bc=[];var _0xac0e7f=squel[_0x48dc('0x7f')]();_0xac0e7f['field'](_0x48dc('0x80'))['from'](_0x48dc('0x81'),'tq')[_0x48dc('0x82')]('user_has_teams','ut',_0x48dc('0x83'))[_0x48dc('0x4e')]('ChatQueueId\x20=\x20?',_0x1ef6b4[_0x48dc('0x56')]['id']);for(var _0x41ea1a=0x0;_0x41ea1a<_0x50fd3e[_0x48dc('0x4a')];_0x41ea1a+=0x1){let _0x355f0f=_0x50fd3e[_0x41ea1a];for(var _0x4c2b3e=0x0;_0x4c2b3e<_0x355f0f['Agents'][_0x48dc('0x4a')];_0x4c2b3e+=0x1){let _0x2feab1=_0x355f0f[_0x48dc('0x75')][_0x4c2b3e];var _0x421d88=_0xac0e7f[_0x48dc('0x84')]();_0x421d88[_0x48dc('0x4e')](_0x48dc('0x85'),_0x2feab1['id']);_0x18d1bc[_0x48dc('0x86')](db[_0x48dc('0x79')][_0x48dc('0x44')](_0x421d88['toString'](),{'type':db[_0x48dc('0x79')][_0x48dc('0x87')][_0x48dc('0x88')]})[_0x48dc('0x21')](function(_0x497e30){if(_0x497e30[_0x48dc('0x4a')]===0x1){return _0x2feab1['id'];}else{var _0x4320e8=_[_0x48dc('0x89')](_['map'](_0x497e30,'TeamId'),function(_0x5e61fa){return _[_0x48dc('0x8a')](_0x930140,_0x5e61fa);});if(_0x4320e8){return _0x2feab1['id'];}}}));}}return BPromise[_0x48dc('0x8b')](_0x18d1bc)['then'](function(_0x3a8c83){_0x2e5e0d=_(_0x2e5e0d)[_0x48dc('0x8c')](_0x3a8c83)[_0x48dc('0x8d')]()[_0x48dc('0x8e')]();return db[_0x48dc('0x3e')]['find']({'where':{'id':_0x1ef6b4['params']['id']}})[_0x48dc('0x21')](function(_0x241d2d){return db[_0x48dc('0x79')][_0x48dc('0x8f')](function(_0x385d3c){return _0x241d2d[_0x48dc('0x90')](_0x1ef6b4['query'][_0x48dc('0x74')],{'transaction':_0x385d3c})['then'](function(){if(!_[_0x48dc('0x91')](_0x2e5e0d)){return _0x241d2d[_0x48dc('0x92')](_0x2e5e0d,{'transaction':_0x385d3c});}})[_0x48dc('0x21')](function(){_0x2e5e0d['forEach'](function(_0x5afc83){socket[_0x48dc('0x7e')](_0x48dc('0x93'),{'UserId':_0x5afc83,'ChatQueueId':_0x241d2d['id']});});});});});});})[_0x48dc('0x21')](respondWithStatusCode(_0x3b611,null))['catch'](handleError(_0x3b611,null));};exports[_0x48dc('0x94')]=function(_0xf0c674,_0x3a1ad2,_0x11a90b){return db[_0x48dc('0x3e')][_0x48dc('0x58')]({'where':{'id':_0xf0c674[_0x48dc('0x56')]['id']}})['then'](handleEntityNotFound(_0x3a1ad2,null))[_0x48dc('0x21')](function(_0x132b8a){if(_0x132b8a){return _0x132b8a[_0x48dc('0x94')](_0xf0c674['body'][_0x48dc('0x74')],_[_0x48dc('0x95')](_0xf0c674[_0x48dc('0x5a')],[_0x48dc('0x74'),'id'])||{})[_0x48dc('0x96')](function(_0x223375){for(var _0x404e47=0x0;_0x404e47<_0xf0c674['body']['ids'][_0x48dc('0x4a')];_0x404e47+=0x1){socket[_0x48dc('0x7e')](_0x48dc('0x97'),{'UserId':Number(_0xf0c674[_0x48dc('0x5a')][_0x48dc('0x74')][_0x404e47]),'ChatQueueId':Number(_0xf0c674[_0x48dc('0x56')]['id'])});}return _0x223375;});}})[_0x48dc('0x21')](respondWithResult(_0x3a1ad2,null))[_0x48dc('0x2b')](handleError(_0x3a1ad2,null));};exports['removeAgents']=function(_0x5490bf,_0x38ca41,_0x48517b){return db[_0x48dc('0x3e')][_0x48dc('0x58')]({'where':{'id':_0x5490bf['params']['id']}})[_0x48dc('0x21')](handleEntityNotFound(_0x38ca41,null))[_0x48dc('0x21')](function(_0x11c7e9){if(_0x11c7e9){return _0x11c7e9[_0x48dc('0x92')](_0x5490bf[_0x48dc('0x44')]['ids'])[_0x48dc('0x21')](function(){if(_['isArray'](_0x5490bf['query'][_0x48dc('0x74')])){for(var _0x433bd0=0x0;_0x433bd0<_0x5490bf[_0x48dc('0x44')][_0x48dc('0x74')][_0x48dc('0x4a')];_0x433bd0+=0x1){socket[_0x48dc('0x7e')]('userChatQueue:remove',{'UserId':Number(_0x5490bf[_0x48dc('0x44')]['ids'][_0x433bd0]),'ChatQueueId':Number(_0x5490bf[_0x48dc('0x56')]['id'])});}}else{socket[_0x48dc('0x7e')](_0x48dc('0x93'),{'UserId':Number(_0x5490bf[_0x48dc('0x44')][_0x48dc('0x74')]),'ChatQueueId':Number(_0x5490bf[_0x48dc('0x56')]['id'])});}});}})[_0x48dc('0x21')](respondWithStatusCode(_0x38ca41,null))[_0x48dc('0x2b')](handleError(_0x38ca41,null));};exports[_0x48dc('0x98')]=function(_0x34cd8e,_0x3f493d,_0x31009c){var _0x2667dc={};var _0x21d52d={};var _0xa0edcb;var _0x2a8474;return db[_0x48dc('0x3e')][_0x48dc('0x64')]({'where':{'id':_0x34cd8e[_0x48dc('0x56')]['id']}})[_0x48dc('0x21')](handleEntityNotFound(_0x3f493d,null))['then'](function(_0x30361b){if(_0x30361b){_0xa0edcb=_0x30361b;_0x21d52d[_0x48dc('0x47')]=_[_0x48dc('0x57')](db[_0x48dc('0x69')][_0x48dc('0x3f')]);_0x21d52d[_0x48dc('0x44')]=_['keys'](_0x34cd8e['query']);_0x21d52d[_0x48dc('0x45')]=_[_0x48dc('0x46')](_0x21d52d['model'],_0x21d52d['query']);_0x2667dc[_0x48dc('0x48')]=_[_0x48dc('0x46')](_0x21d52d[_0x48dc('0x47')],qs['fields'](_0x34cd8e[_0x48dc('0x44')]['fields']));_0x2667dc['attributes']=_0x2667dc['attributes'][_0x48dc('0x4a')]?_0x2667dc[_0x48dc('0x48')]:_0x21d52d[_0x48dc('0x47')];_0x2667dc[_0x48dc('0x4c')]=qs[_0x48dc('0x4d')](_0x34cd8e[_0x48dc('0x44')][_0x48dc('0x4d')]);_0x2667dc[_0x48dc('0x4e')]=qs['filters'](_[_0x48dc('0x66')](_0x34cd8e[_0x48dc('0x44')],_0x21d52d[_0x48dc('0x45')]));if(_0x34cd8e[_0x48dc('0x44')][_0x48dc('0x68')]){_0x2667dc[_0x48dc('0x4e')]=_[_0x48dc('0x4f')](_0x2667dc[_0x48dc('0x4e')],{'$or':_[_0x48dc('0x43')](_0x2667dc['attributes'],function(_0x2c1ad6){var _0x4d894c={};_0x4d894c[_0x2c1ad6]={'$like':'%'+_0x34cd8e[_0x48dc('0x44')]['filter']+'%'};return _0x4d894c;})});}_0x2667dc=_['merge']({},_0x2667dc,_0x34cd8e[_0x48dc('0x51')]);return _0xa0edcb[_0x48dc('0x98')](_0x2667dc);}})[_0x48dc('0x21')](function(_0x53dc3d){if(_0x53dc3d){_0x2a8474=_0x53dc3d['length'];if(!_0x34cd8e['query'][_0x48dc('0x65')]('nolimit')){_0x2667dc['limit']=qs['limit'](_0x34cd8e[_0x48dc('0x44')]['limit']);_0x2667dc[_0x48dc('0x30')]=qs[_0x48dc('0x30')](_0x34cd8e[_0x48dc('0x44')][_0x48dc('0x30')]);}return _0xa0edcb[_0x48dc('0x98')](_0x2667dc);}})[_0x48dc('0x21')](function(_0x4c88c3){if(_0x4c88c3){return _0x4c88c3?{'count':_0x2a8474,'rows':_0x4c88c3}:null;}})[_0x48dc('0x21')](respondWithResult(_0x3f493d,null))['catch'](handleError(_0x3f493d,null));}; \ No newline at end of file +var _0x510e=['../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','then','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','destroy','get','ChatQueues','name','send','map','ChatQueue','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','describe','findOne','UserChatQueue','ChatQueueId','findAll','findAndCountAll','UserId','chatPause','createdAt','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','ids','User','online','voicePause','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','Agents','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','clone','ut.UserId\x20=\x20?','push','every','all','value','sequelize','isEmpty','removeAgents','omit','spread','isArray','userChatQueue:remove','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x3281f7,_0x4d613c){var _0x47f6ee=function(_0x404ee7){while(--_0x404ee7){_0x3281f7['push'](_0x3281f7['shift']());}};_0x47f6ee(++_0x4d613c);}(_0x510e,0x1a1));var _0xe510=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x510e[_0x125ff8];return _0x2d9ef;};'use strict';var emlformat=require(_0xe510('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe510('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe510('0x2'));var moment=require(_0xe510('0x3'));var BPromise=require(_0xe510('0x4'));var Mustache=require(_0xe510('0x5'));var util=require('util');var path=require(_0xe510('0x6'));var sox=require(_0xe510('0x7'));var csv=require(_0xe510('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe510('0x9'));var _=require(_0xe510('0xa'));var squel=require('squel');var crypto=require(_0xe510('0xb'));var jsforce=require(_0xe510('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe510('0x8'));var querystring=require(_0xe510('0xd'));var Papa=require('papaparse');var Redis=require(_0xe510('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe510('0xf'));var as=require(_0xe510('0x10'));var hardwareService=require(_0xe510('0x11'));var logger=require(_0xe510('0x12'))(_0xe510('0x13'));var utils=require('../../config/utils');var config=require(_0xe510('0x14'));var licenseUtil=require(_0xe510('0x15'));var db=require(_0xe510('0x16'))['db'];config[_0xe510('0x17')]=_[_0xe510('0x18')](config[_0xe510('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xe510('0x19'))(new Redis(config[_0xe510('0x17')]));require('./chatQueue.socket')[_0xe510('0x1a')](socket);var jayson=require(_0xe510('0x1b'));var client=jayson[_0xe510('0x1c')][_0xe510('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x13421a,_0x57cdfb,_0x5efb07,_0x1660c2){return new BPromise(function(_0x4f4719,_0x4b1fdd){var _0x4bee31=_0x1660c2||client;return _0x4bee31['request'](_0x13421a,_0x5efb07)[_0xe510('0x1e')](function(_0x5c6f50){logger['info'](_0xe510('0x1f'),_0x57cdfb,'request\x20sent');logger[_0xe510('0x20')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x57cdfb,_0xe510('0x21'),JSON[_0xe510('0x22')](_0x5c6f50));if(_0x5c6f50[_0xe510('0x23')]){if(_0x5c6f50[_0xe510('0x23')][_0xe510('0x24')]===0x1f4){logger[_0xe510('0x23')](_0xe510('0x1f'),_0x57cdfb,_0x5c6f50[_0xe510('0x23')][_0xe510('0x25')]);return _0x4b1fdd(_0x5c6f50[_0xe510('0x23')]['message']);}logger[_0xe510('0x23')](_0xe510('0x1f'),_0x57cdfb,_0x5c6f50['error'][_0xe510('0x25')]);return _0x4f4719(_0x5c6f50[_0xe510('0x23')]['message']);}else{logger[_0xe510('0x26')](_0xe510('0x1f'),_0x57cdfb,_0xe510('0x21'));_0x4f4719(_0x5c6f50[_0xe510('0x27')][_0xe510('0x25')]);}})[_0xe510('0x28')](function(_0x25dd79){logger[_0xe510('0x23')](_0xe510('0x1f'),_0x57cdfb,_0x25dd79);_0x4b1fdd(_0x25dd79);});});}function respondWithStatusCode(_0x1718f8,_0x36adc2){_0x36adc2=_0x36adc2||0xcc;return function(_0x5cdc37){if(_0x5cdc37){return _0x1718f8[_0xe510('0x29')](_0x36adc2);}return _0x1718f8[_0xe510('0x2a')](_0x36adc2)[_0xe510('0x2b')]();};}function respondWithResult(_0xaee073,_0x3bf7be){_0x3bf7be=_0x3bf7be||0xc8;return function(_0x11cb7a){if(_0x11cb7a){return _0xaee073[_0xe510('0x2a')](_0x3bf7be)[_0xe510('0x2c')](_0x11cb7a);}};}function respondWithFilteredResult(_0x557bc2,_0xd50367){return function(_0x46e755){if(_0x46e755){var _0x184128=typeof _0xd50367['offset']==='undefined'&&typeof _0xd50367[_0xe510('0x2d')]===_0xe510('0x2e');var _0x586d31=_0x46e755[_0xe510('0x2f')];var _0x52596a=_0x184128?0x0:_0xd50367[_0xe510('0x30')];var _0x124a69=_0x184128?_0x46e755[_0xe510('0x2f')]:_0xd50367['offset']+_0xd50367[_0xe510('0x2d')];var _0x422d3c;if(_0x124a69>=_0x586d31){_0x124a69=_0x586d31;_0x422d3c=0xc8;}else{_0x422d3c=0xce;}_0x557bc2['status'](_0x422d3c);return _0x557bc2[_0xe510('0x31')](_0xe510('0x32'),_0x52596a+'-'+_0x124a69+'/'+_0x586d31)[_0xe510('0x2c')](_0x46e755);}return null;};}function patchUpdates(_0x57ab6b){return function(_0x518eb8){try{jsonpatch[_0xe510('0x33')](_0x518eb8,_0x57ab6b,!![]);}catch(_0x1f8f8f){return BPromise[_0xe510('0x34')](_0x1f8f8f);}return _0x518eb8[_0xe510('0x35')]();};}function saveUpdates(_0x49df44,_0x2d3aef){return function(_0x2e475d){if(_0x2e475d){return _0x2e475d['update'](_0x49df44)[_0xe510('0x1e')](function(_0x49b9b4){return _0x49b9b4;});}return null;};}function removeEntity(_0x1c375c,_0x17fbed){return function(_0x21ebaa){if(_0x21ebaa){return _0x21ebaa[_0xe510('0x36')]()[_0xe510('0x1e')](function(){var _0x5d9a48=_0x21ebaa[_0xe510('0x37')]({'plain':!![]});var _0x623ad3=_0xe510('0x38');return db['UserProfileResource'][_0xe510('0x36')]({'where':{'type':_0x623ad3,'resourceId':_0x5d9a48['id']}})[_0xe510('0x1e')](function(){return _0x21ebaa;});})['then'](function(){_0x1c375c[_0xe510('0x2a')](0xcc)[_0xe510('0x2b')]();});}};}function handleEntityNotFound(_0x3785a9,_0xd4737e){return function(_0x13bc56){if(!_0x13bc56){_0x3785a9[_0xe510('0x29')](0x194);}return _0x13bc56;};}function handleError(_0x4aa9bb,_0x1d0576){_0x1d0576=_0x1d0576||0x1f4;return function(_0x28a5d0){logger['error'](_0x28a5d0['stack']);if(_0x28a5d0[_0xe510('0x39')]){delete _0x28a5d0['name'];}_0x4aa9bb[_0xe510('0x2a')](_0x1d0576)[_0xe510('0x3a')](_0x28a5d0);};}exports['index']=function(_0xe02c57,_0x3720b4){var _0x4aea21={},_0x265033={},_0x26ae3a={'count':0x0,'rows':[]};var _0x37a05a=_[_0xe510('0x3b')](db[_0xe510('0x3c')]['rawAttributes'],function(_0x56815e){return{'name':_0x56815e[_0xe510('0x3d')],'type':_0x56815e[_0xe510('0x3e')][_0xe510('0x3f')]};});_0x265033[_0xe510('0x40')]=_[_0xe510('0x3b')](_0x37a05a,'name');_0x265033[_0xe510('0x41')]=_[_0xe510('0x42')](_0xe02c57[_0xe510('0x41')]);_0x265033['filters']=_[_0xe510('0x43')](_0x265033['model'],_0x265033[_0xe510('0x41')]);_0x4aea21[_0xe510('0x44')]=_[_0xe510('0x43')](_0x265033[_0xe510('0x40')],qs[_0xe510('0x45')](_0xe02c57['query'][_0xe510('0x45')]));_0x4aea21[_0xe510('0x44')]=_0x4aea21[_0xe510('0x44')][_0xe510('0x46')]?_0x4aea21[_0xe510('0x44')]:_0x265033[_0xe510('0x40')];if(!_0xe02c57[_0xe510('0x41')][_0xe510('0x47')](_0xe510('0x48'))){_0x4aea21['limit']=qs[_0xe510('0x2d')](_0xe02c57[_0xe510('0x41')]['limit']);_0x4aea21[_0xe510('0x30')]=qs['offset'](_0xe02c57[_0xe510('0x41')][_0xe510('0x30')]);}_0x4aea21[_0xe510('0x49')]=qs[_0xe510('0x4a')](_0xe02c57[_0xe510('0x41')]['sort']);_0x4aea21[_0xe510('0x4b')]=qs['filters'](_[_0xe510('0x4c')](_0xe02c57['query'],_0x265033[_0xe510('0x4d')]),_0x37a05a);if(_0xe02c57[_0xe510('0x41')][_0xe510('0x4e')]){_0x4aea21['where']=_[_0xe510('0x4f')](_0x4aea21['where'],{'$or':_[_0xe510('0x3b')](_0x37a05a,function(_0xada5b3){if(_0xada5b3['type']!==_0xe510('0x50')){var _0x4ee891={};_0x4ee891[_0xada5b3[_0xe510('0x39')]]={'$like':'%'+_0xe02c57[_0xe510('0x41')][_0xe510('0x4e')]+'%'};return _0x4ee891;}})});}_0x4aea21=_['merge']({},_0x4aea21,_0xe02c57[_0xe510('0x51')]);var _0x360f04={'where':_0x4aea21[_0xe510('0x4b')]};return db['ChatQueue'][_0xe510('0x2f')](_0x360f04)[_0xe510('0x1e')](function(_0x4c0edf){_0x26ae3a['count']=_0x4c0edf;if(_0xe02c57['query'][_0xe510('0x52')]){_0x4aea21[_0xe510('0x53')]=[{'all':!![]}];}return db[_0xe510('0x3c')]['findAll'](_0x4aea21);})[_0xe510('0x1e')](function(_0x38be30){_0x26ae3a[_0xe510('0x54')]=_0x38be30;return _0x26ae3a;})[_0xe510('0x1e')](respondWithFilteredResult(_0x3720b4,_0x4aea21))[_0xe510('0x28')](handleError(_0x3720b4,null));};exports[_0xe510('0x55')]=function(_0x3c26c1,_0xe2d63f){var _0x5d2e7d={'raw':!![],'where':{'id':_0x3c26c1[_0xe510('0x56')]['id']}},_0x3e021b={};_0x3e021b[_0xe510('0x40')]=_['keys'](db[_0xe510('0x3c')][_0xe510('0x57')]);_0x3e021b[_0xe510('0x41')]=_[_0xe510('0x42')](_0x3c26c1[_0xe510('0x41')]);_0x3e021b[_0xe510('0x4d')]=_[_0xe510('0x43')](_0x3e021b[_0xe510('0x40')],_0x3e021b[_0xe510('0x41')]);_0x5d2e7d[_0xe510('0x44')]=_[_0xe510('0x43')](_0x3e021b['model'],qs[_0xe510('0x45')](_0x3c26c1[_0xe510('0x41')]['fields']));_0x5d2e7d[_0xe510('0x44')]=_0x5d2e7d['attributes'][_0xe510('0x46')]?_0x5d2e7d[_0xe510('0x44')]:_0x3e021b[_0xe510('0x40')];if(_0x3c26c1[_0xe510('0x41')][_0xe510('0x52')]){_0x5d2e7d[_0xe510('0x53')]=[{'all':!![]}];}_0x5d2e7d=_[_0xe510('0x4f')]({},_0x5d2e7d,_0x3c26c1[_0xe510('0x51')]);return db[_0xe510('0x3c')][_0xe510('0x58')](_0x5d2e7d)[_0xe510('0x1e')](handleEntityNotFound(_0xe2d63f,null))[_0xe510('0x1e')](respondWithResult(_0xe2d63f,null))[_0xe510('0x28')](handleError(_0xe2d63f,null));};exports[_0xe510('0x59')]=function(_0x440f41,_0x277bd9){return db[_0xe510('0x3c')][_0xe510('0x59')](_0x440f41[_0xe510('0x5a')],{})['then'](function(_0x41db27){var _0x5ac162=_0x440f41[_0xe510('0x5b')][_0xe510('0x37')]({'plain':!![]});if(!_0x5ac162)throw new Error(_0xe510('0x5c'));if(_0x5ac162[_0xe510('0x5d')]===_0xe510('0x5b')){var _0x3b04dc=_0x41db27[_0xe510('0x37')]({'plain':!![]});var _0x3b3ca3=_0xe510('0x38');return db[_0xe510('0x5e')][_0xe510('0x58')]({'where':{'name':_0x3b3ca3,'userProfileId':_0x5ac162[_0xe510('0x5f')]},'raw':!![]})['then'](function(_0x475763){if(_0x475763&&_0x475763[_0xe510('0x60')]===0x0){return db[_0xe510('0x61')][_0xe510('0x59')]({'name':_0x3b04dc[_0xe510('0x39')],'resourceId':_0x3b04dc['id'],'type':_0x475763[_0xe510('0x39')],'sectionId':_0x475763['id']},{})[_0xe510('0x1e')](function(){return _0x41db27;});}else{return _0x41db27;}})[_0xe510('0x28')](function(_0x3d5746){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d5746);throw _0x3d5746;});}return _0x41db27;})['then'](respondWithResult(_0x277bd9,0xc9))[_0xe510('0x28')](handleError(_0x277bd9,null));};exports[_0xe510('0x62')]=function(_0x13920a,_0x44434e){if(_0x13920a[_0xe510('0x5a')]['id']){delete _0x13920a[_0xe510('0x5a')]['id'];}return db['ChatQueue'][_0xe510('0x58')]({'where':{'id':_0x13920a[_0xe510('0x56')]['id']}})[_0xe510('0x1e')](handleEntityNotFound(_0x44434e,null))[_0xe510('0x1e')](saveUpdates(_0x13920a[_0xe510('0x5a')],null))[_0xe510('0x1e')](respondWithResult(_0x44434e,null))['catch'](handleError(_0x44434e,null));};exports['destroy']=function(_0x418cc6,_0x2d7abc){return db[_0xe510('0x3c')][_0xe510('0x58')]({'where':{'id':_0x418cc6['params']['id']}})['then'](handleEntityNotFound(_0x2d7abc,null))[_0xe510('0x1e')](removeEntity(_0x2d7abc,null))[_0xe510('0x28')](handleError(_0x2d7abc,null));};exports[_0xe510('0x63')]=function(_0x2a0328,_0x2e8c7b){return db['ChatQueue'][_0xe510('0x63')]()[_0xe510('0x1e')](respondWithResult(_0x2e8c7b,null))[_0xe510('0x28')](handleError(_0x2e8c7b,null));};exports['getMembers']=function(_0x437d98,_0xbcf813,_0x2517c9){var _0x93b09f={'raw':!![],'where':{}},_0x39e8d8={},_0x5116cb;return db[_0xe510('0x3c')][_0xe510('0x64')]({'where':{'id':_0x437d98[_0xe510('0x56')]['id']}})[_0xe510('0x1e')](handleEntityNotFound(_0xbcf813,null))[_0xe510('0x1e')](function(_0x53348a){if(_0x53348a){_0x5116cb=_0x53348a[_0xe510('0x37')]({'plain':!![]});_0x39e8d8[_0xe510('0x40')]=_[_0xe510('0x42')](db[_0xe510('0x65')][_0xe510('0x57')]);_0x39e8d8[_0xe510('0x41')]=_[_0xe510('0x42')](_0x437d98[_0xe510('0x41')]);_0x39e8d8[_0xe510('0x4d')]=_[_0xe510('0x43')](_0x39e8d8[_0xe510('0x40')],_0x39e8d8['query']);_0x93b09f[_0xe510('0x44')]=_[_0xe510('0x43')](_0x39e8d8[_0xe510('0x40')],qs[_0xe510('0x45')](_0x437d98['query'][_0xe510('0x45')]));_0x93b09f[_0xe510('0x44')]=_0x93b09f[_0xe510('0x44')][_0xe510('0x46')]?_0x93b09f[_0xe510('0x44')]:_0x39e8d8[_0xe510('0x40')];if(!_0x437d98[_0xe510('0x41')][_0xe510('0x47')](_0xe510('0x48'))){_0x93b09f[_0xe510('0x2d')]=qs[_0xe510('0x2d')](_0x437d98[_0xe510('0x41')][_0xe510('0x2d')]);_0x93b09f[_0xe510('0x30')]=qs[_0xe510('0x30')](_0x437d98[_0xe510('0x41')][_0xe510('0x30')]);}_0x93b09f[_0xe510('0x49')]=qs[_0xe510('0x4a')](_0x437d98[_0xe510('0x41')][_0xe510('0x4a')]);_0x93b09f[_0xe510('0x4b')]=qs[_0xe510('0x4d')](_[_0xe510('0x4c')](_0x437d98[_0xe510('0x41')],_0x39e8d8[_0xe510('0x4d')]));_0x93b09f[_0xe510('0x4b')][_0xe510('0x66')]=_0x53348a['id'];if(_0x437d98[_0xe510('0x41')][_0xe510('0x4e')]){_0x93b09f['where']=_[_0xe510('0x4f')](_0x93b09f[_0xe510('0x4b')],{'$or':_[_0xe510('0x3b')](_0x93b09f[_0xe510('0x44')],function(_0x1dd363){var _0x4f8e3f={};_0x4f8e3f[_0x1dd363]={'$like':'%'+_0x437d98[_0xe510('0x41')][_0xe510('0x4e')]+'%'};return _0x4f8e3f;})});}_0x93b09f=_['merge']({},_0x93b09f,_0x437d98['options']);return db[_0xe510('0x65')][_0xe510('0x67')](_0x93b09f);}})[_0xe510('0x1e')](function(_0x2d7bce){if(_0x2d7bce){return db['User'][_0xe510('0x68')]({'where':{'id':_[_0xe510('0x3b')](_0x2d7bce,_0xe510('0x69')),'role':'agent'},'attributes':['id','name',_0xe510('0x6a'),'updatedAt',_0xe510('0x6b')]});}})[_0xe510('0x1e')](function(_0xc9d116){if(_0xc9d116){return{'count':_0xc9d116[_0xe510('0x2f')],'rows':_[_0xe510('0x3b')](_0xc9d116['rows'],function(_0x961cf1){return{'membername':_0x961cf1[_0xe510('0x39')],'UserId':_0x961cf1['id'],'queue_name':_0x5116cb[_0xe510('0x39')],'ChatQueueId':_0x5116cb['id'],'interface':util['format'](_0xe510('0x6c'),_0xe510('0x6d'),_0x961cf1['name']),'penalty':0x0,'paused':_0x961cf1[_0xe510('0x6a')],'createdAt':_0x961cf1[_0xe510('0x6b')],'updatedAt':_0x961cf1[_0xe510('0x6e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe510('0x1e')](respondWithFilteredResult(_0xbcf813,_0x93b09f))[_0xe510('0x28')](handleError(_0xbcf813,null));};exports[_0xe510('0x6f')]=function(_0x594778,_0x509298,_0x6c7277){var _0x438146={};var _0x18b162={};var _0x43ede1;var _0x25b3fb;return db['ChatQueue'][_0xe510('0x64')]({'where':{'id':_0x594778[_0xe510('0x56')]['id']}})[_0xe510('0x1e')](handleEntityNotFound(_0x509298,null))[_0xe510('0x1e')](function(_0x24c9f7){if(_0x24c9f7){_0x43ede1=_0x24c9f7;_0x18b162['model']=_[_0xe510('0x42')](db[_0xe510('0x70')]['rawAttributes']);_0x18b162[_0xe510('0x41')]=_[_0xe510('0x42')](_0x594778[_0xe510('0x41')]);_0x18b162['filters']=_[_0xe510('0x43')](_0x18b162['model'],_0x18b162[_0xe510('0x41')]);_0x438146['attributes']=_[_0xe510('0x43')](_0x18b162['model'],qs['fields'](_0x594778[_0xe510('0x41')][_0xe510('0x45')]));_0x438146[_0xe510('0x44')]=_0x438146[_0xe510('0x44')][_0xe510('0x46')]?_0x438146['attributes']:_0x18b162[_0xe510('0x40')];_0x438146[_0xe510('0x49')]=qs[_0xe510('0x4a')](_0x594778['query'][_0xe510('0x4a')]);_0x438146[_0xe510('0x4b')]=qs[_0xe510('0x4d')](_['pick'](_0x594778[_0xe510('0x41')],_0x18b162[_0xe510('0x4d')]));if(_0x594778[_0xe510('0x41')][_0xe510('0x4e')]){_0x438146[_0xe510('0x4b')]=_[_0xe510('0x4f')](_0x438146[_0xe510('0x4b')],{'$or':_['map'](_0x438146['attributes'],function(_0x1218f0){var _0x2e9215={};_0x2e9215[_0x1218f0]={'$like':'%'+_0x594778[_0xe510('0x41')][_0xe510('0x4e')]+'%'};return _0x2e9215;})});}_0x438146=_[_0xe510('0x4f')]({},_0x438146,_0x594778[_0xe510('0x51')]);return _0x43ede1[_0xe510('0x6f')](_0x438146);}})['then'](function(_0x492f03){if(_0x492f03){_0x25b3fb=_0x492f03[_0xe510('0x46')];if(!_0x594778[_0xe510('0x41')][_0xe510('0x47')](_0xe510('0x48'))){_0x438146[_0xe510('0x2d')]=qs[_0xe510('0x2d')](_0x594778[_0xe510('0x41')][_0xe510('0x2d')]);_0x438146[_0xe510('0x30')]=qs[_0xe510('0x30')](_0x594778[_0xe510('0x41')][_0xe510('0x30')]);}return _0x43ede1['getTeams'](_0x438146);}})[_0xe510('0x1e')](function(_0x33a8d4){if(_0x33a8d4){return _0x33a8d4?{'count':_0x25b3fb,'rows':_0x33a8d4}:null;}})['then'](respondWithResult(_0x509298,null))[_0xe510('0x28')](handleError(_0x509298,null));};exports[_0xe510('0x71')]=function(_0xde9dcd,_0x5e6769,_0x50119c){var _0x473684=_0xde9dcd['body'][_0xe510('0x72')];return db[_0xe510('0x70')][_0xe510('0x67')]({'where':{'id':_0x473684},'attributes':['id'],'include':[{'model':db[_0xe510('0x73')],'as':'Agents','attributes':['id',_0xe510('0x39'),_0xe510('0x74'),_0xe510('0x75'),'interface'],'raw':!![]}]})[_0xe510('0x1e')](function(_0x2337cd){if(_0x2337cd){var _0x29f7fb=_['flatMap'](_0x2337cd,function(_0x4eb3bb){var _0x409a8b=_0x4eb3bb[_0xe510('0x37')]({'plain':!![]});return _0x409a8b['Agents'];});return db['ChatQueue'][_0xe510('0x58')]({'where':{'id':_0xde9dcd['params']['id']}})[_0xe510('0x1e')](function(_0x3ff24c){return db['sequelize'][_0xe510('0x76')](function(_0x568914){return _0x3ff24c[_0xe510('0x71')](_0x473684,{'transaction':_0x568914})[_0xe510('0x1e')](function(){return BPromise[_0xe510('0x77')](_0x29f7fb,function(_0x2cdd07){return db['UserChatQueue'][_0xe510('0x78')]({'where':{'UserId':_0x2cdd07['id'],'ChatQueueId':_0xde9dcd[_0xe510('0x56')]['id']},'transaction':_0x568914});});})[_0xe510('0x1e')](function(){_0x29f7fb[_0xe510('0x79')](function(_0x317250){socket[_0xe510('0x7a')](_0xe510('0x7b'),{'UserId':_0x317250['id'],'ChatQueueId':_0x3ff24c['id']});});});});});}})[_0xe510('0x1e')](respondWithStatusCode(_0x5e6769,null))[_0xe510('0x28')](handleError(_0x5e6769,null));};exports[_0xe510('0x7c')]=function(_0x5828e7,_0x55ba1f,_0x411792){return db[_0xe510('0x70')]['findAll']({'where':{'id':_0x5828e7['query'][_0xe510('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe510('0x7d'),'attributes':['id'],'raw':!![]}]})[_0xe510('0x1e')](handleEntityNotFound(_0x55ba1f,null))[_0xe510('0x1e')](function(_0x371fa2){var _0x3e49a3=_['map'](_0x371fa2,'id');var _0x1405ff=[];var _0x2bd3a5=[];var _0x31f79b=squel[_0xe510('0x7e')]();_0x31f79b[_0xe510('0x7f')](_0xe510('0x80'))[_0xe510('0x81')](_0xe510('0x82'),'tq')['join'](_0xe510('0x83'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('ChatQueueId\x20=\x20?',_0x5828e7['params']['id']);for(var _0x362cba=0x0;_0x362cba<_0x371fa2[_0xe510('0x46')];_0x362cba+=0x1){let _0x14c6e7=_0x371fa2[_0x362cba];for(var _0x499efb=0x0;_0x499efb<_0x14c6e7[_0xe510('0x7d')][_0xe510('0x46')];_0x499efb+=0x1){let _0x14b23d=_0x14c6e7[_0xe510('0x7d')][_0x499efb];var _0x9df798=_0x31f79b[_0xe510('0x84')]();_0x9df798[_0xe510('0x4b')](_0xe510('0x85'),_0x14b23d['id']);_0x2bd3a5[_0xe510('0x86')](db['sequelize'][_0xe510('0x41')](_0x9df798['toString'](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0xe510('0x1e')](function(_0x346a4c){if(_0x346a4c[_0xe510('0x46')]===0x1){return _0x14b23d['id'];}else{var _0x47fca3=_[_0xe510('0x87')](_[_0xe510('0x3b')](_0x346a4c,'TeamId'),function(_0x1112bb){return _['includes'](_0x3e49a3,_0x1112bb);});if(_0x47fca3){return _0x14b23d['id'];}}}));}}return BPromise[_0xe510('0x88')](_0x2bd3a5)['then'](function(_0x33cc4a){_0x1405ff=_(_0x1405ff)['union'](_0x33cc4a)['compact']()[_0xe510('0x89')]();return db['ChatQueue'][_0xe510('0x58')]({'where':{'id':_0x5828e7[_0xe510('0x56')]['id']}})[_0xe510('0x1e')](function(_0x57f4b4){return db[_0xe510('0x8a')]['transaction'](function(_0x1e5886){return _0x57f4b4[_0xe510('0x7c')](_0x5828e7[_0xe510('0x41')]['ids'],{'transaction':_0x1e5886})[_0xe510('0x1e')](function(){if(!_[_0xe510('0x8b')](_0x1405ff)){return _0x57f4b4[_0xe510('0x8c')](_0x1405ff,{'transaction':_0x1e5886});}})[_0xe510('0x1e')](function(){_0x1405ff[_0xe510('0x79')](function(_0x33ed07){socket['emit']('userChatQueue:remove',{'UserId':_0x33ed07,'ChatQueueId':_0x57f4b4['id']});});});});});});})[_0xe510('0x1e')](respondWithStatusCode(_0x55ba1f,null))[_0xe510('0x28')](handleError(_0x55ba1f,null));};exports['addAgents']=function(_0x25464a,_0x1ea073,_0x337122){return db['ChatQueue'][_0xe510('0x58')]({'where':{'id':_0x25464a[_0xe510('0x56')]['id']}})['then'](handleEntityNotFound(_0x1ea073,null))[_0xe510('0x1e')](function(_0x5ae6be){if(_0x5ae6be){return _0x5ae6be['addAgents'](_0x25464a[_0xe510('0x5a')][_0xe510('0x72')],_[_0xe510('0x8d')](_0x25464a[_0xe510('0x5a')],['ids','id'])||{})[_0xe510('0x8e')](function(_0xd1b551){for(var _0x4b6a66=0x0;_0x4b6a66<_0x25464a[_0xe510('0x5a')][_0xe510('0x72')][_0xe510('0x46')];_0x4b6a66+=0x1){socket[_0xe510('0x7a')](_0xe510('0x7b'),{'UserId':Number(_0x25464a[_0xe510('0x5a')][_0xe510('0x72')][_0x4b6a66]),'ChatQueueId':Number(_0x25464a[_0xe510('0x56')]['id'])});}return _0xd1b551;});}})[_0xe510('0x1e')](respondWithResult(_0x1ea073,null))[_0xe510('0x28')](handleError(_0x1ea073,null));};exports[_0xe510('0x8c')]=function(_0x5698bd,_0x21dde2,_0x4fefd8){return db[_0xe510('0x3c')]['find']({'where':{'id':_0x5698bd[_0xe510('0x56')]['id']}})[_0xe510('0x1e')](handleEntityNotFound(_0x21dde2,null))[_0xe510('0x1e')](function(_0x587fc6){if(_0x587fc6){return _0x587fc6[_0xe510('0x8c')](_0x5698bd['query'][_0xe510('0x72')])[_0xe510('0x1e')](function(){if(_[_0xe510('0x8f')](_0x5698bd['query'][_0xe510('0x72')])){for(var _0x32aab7=0x0;_0x32aab7<_0x5698bd['query'][_0xe510('0x72')][_0xe510('0x46')];_0x32aab7+=0x1){socket['emit'](_0xe510('0x90'),{'UserId':Number(_0x5698bd['query'][_0xe510('0x72')][_0x32aab7]),'ChatQueueId':Number(_0x5698bd[_0xe510('0x56')]['id'])});}}else{socket[_0xe510('0x7a')](_0xe510('0x90'),{'UserId':Number(_0x5698bd['query'][_0xe510('0x72')]),'ChatQueueId':Number(_0x5698bd[_0xe510('0x56')]['id'])});}});}})[_0xe510('0x1e')](respondWithStatusCode(_0x21dde2,null))[_0xe510('0x28')](handleError(_0x21dde2,null));};exports[_0xe510('0x91')]=function(_0x2afe5e,_0x498ef0,_0x18e6ed){var _0x4f58ac={};var _0x2e7df1={};var _0x131b7a;var _0x132e73;return db[_0xe510('0x3c')][_0xe510('0x64')]({'where':{'id':_0x2afe5e[_0xe510('0x56')]['id']}})[_0xe510('0x1e')](handleEntityNotFound(_0x498ef0,null))[_0xe510('0x1e')](function(_0xecfa45){if(_0xecfa45){_0x131b7a=_0xecfa45;_0x2e7df1[_0xe510('0x40')]=_['keys'](db['User']['rawAttributes']);_0x2e7df1['query']=_['keys'](_0x2afe5e[_0xe510('0x41')]);_0x2e7df1['filters']=_[_0xe510('0x43')](_0x2e7df1[_0xe510('0x40')],_0x2e7df1[_0xe510('0x41')]);_0x4f58ac[_0xe510('0x44')]=_[_0xe510('0x43')](_0x2e7df1[_0xe510('0x40')],qs['fields'](_0x2afe5e['query'][_0xe510('0x45')]));_0x4f58ac[_0xe510('0x44')]=_0x4f58ac['attributes'][_0xe510('0x46')]?_0x4f58ac[_0xe510('0x44')]:_0x2e7df1['model'];_0x4f58ac[_0xe510('0x49')]=qs['sort'](_0x2afe5e[_0xe510('0x41')][_0xe510('0x4a')]);_0x4f58ac['where']=qs['filters'](_[_0xe510('0x4c')](_0x2afe5e['query'],_0x2e7df1[_0xe510('0x4d')]));if(_0x2afe5e[_0xe510('0x41')][_0xe510('0x4e')]){_0x4f58ac[_0xe510('0x4b')]=_[_0xe510('0x4f')](_0x4f58ac[_0xe510('0x4b')],{'$or':_['map'](_0x4f58ac[_0xe510('0x44')],function(_0x3343cd){var _0x305132={};_0x305132[_0x3343cd]={'$like':'%'+_0x2afe5e[_0xe510('0x41')]['filter']+'%'};return _0x305132;})});}_0x4f58ac=_[_0xe510('0x4f')]({},_0x4f58ac,_0x2afe5e[_0xe510('0x51')]);return _0x131b7a[_0xe510('0x91')](_0x4f58ac);}})[_0xe510('0x1e')](function(_0x4b043c){if(_0x4b043c){_0x132e73=_0x4b043c['length'];if(!_0x2afe5e[_0xe510('0x41')][_0xe510('0x47')](_0xe510('0x48'))){_0x4f58ac[_0xe510('0x2d')]=qs[_0xe510('0x2d')](_0x2afe5e[_0xe510('0x41')][_0xe510('0x2d')]);_0x4f58ac[_0xe510('0x30')]=qs['offset'](_0x2afe5e[_0xe510('0x41')][_0xe510('0x30')]);}return _0x131b7a[_0xe510('0x91')](_0x4f58ac);}})['then'](function(_0x3ce968){if(_0x3ce968){return _0x3ce968?{'count':_0x132e73,'rows':_0x3ce968}:null;}})['then'](respondWithResult(_0x498ef0,null))['catch'](handleError(_0x498ef0,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 42df1f8..3c78c59 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 _0x3f95=['ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3877c1,_0x238c29){var _0x59056a=function(_0x3567cd){while(--_0x3567cd){_0x3877c1['push'](_0x3877c1['shift']());}};_0x59056a(++_0x238c29);}(_0x3f95,0x153));var _0x53f9=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3f95[_0x4565bf];return _0x5610ba;};'use strict';var EventEmitter=require(_0x53f9('0x0'));var ChatQueue=require(_0x53f9('0x1'))['db'][_0x53f9('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x53f9('0x3')](0x0);var events={'afterCreate':_0x53f9('0x4'),'afterUpdate':_0x53f9('0x5'),'afterDestroy':_0x53f9('0x6')};function emitEvent(_0x2c4985){return function(_0x604c5a,_0xa86209,_0x41bfe3){ChatQueueEvents[_0x53f9('0x7')](_0x2c4985+':'+_0x604c5a['id'],_0x604c5a);ChatQueueEvents[_0x53f9('0x7')](_0x2c4985,_0x604c5a);_0x41bfe3(null);};}for(var e in events){if(events[_0x53f9('0x8')](e)){var event=events[e];ChatQueue[_0x53f9('0x9')](e,emitEvent(event));}}module[_0x53f9('0xa')]=ChatQueueEvents; \ No newline at end of file +var _0x3bde=['../../mysqldb','ChatQueue','setMaxListeners','emit','hasOwnProperty','hook','events'];(function(_0x2840f7,_0x443096){var _0x9c65da=function(_0x5a30d6){while(--_0x5a30d6){_0x2840f7['push'](_0x2840f7['shift']());}};_0x9c65da(++_0x443096);}(_0x3bde,0x68));var _0xe3bd=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x3bde[_0x1573ea];return _0x51c0e2;};'use strict';var EventEmitter=require(_0xe3bd('0x0'));var ChatQueue=require(_0xe3bd('0x1'))['db'][_0xe3bd('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xe3bd('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4a9511){return function(_0x4a2a7f,_0x17c2bd,_0x276ae8){ChatQueueEvents[_0xe3bd('0x4')](_0x4a9511+':'+_0x4a2a7f['id'],_0x4a2a7f);ChatQueueEvents[_0xe3bd('0x4')](_0x4a9511,_0x4a2a7f);_0x276ae8(null);};}for(var e in events){if(events[_0xe3bd('0x5')](e)){var event=events[e];ChatQueue[_0xe3bd('0x6')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 7686a80..096d733 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 _0xf6e3=['define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./chatQueue.attributes','exports'];(function(_0x4bab56,_0xb67586){var _0x49ccdc=function(_0x407c67){while(--_0x407c67){_0x4bab56['push'](_0x4bab56['shift']());}};_0x49ccdc(++_0xb67586);}(_0xf6e3,0xb9));var _0x3f6e=function(_0x2e033f,_0x1517ba){_0x2e033f=_0x2e033f-0x0;var _0x452338=_0xf6e3[_0x2e033f];return _0x452338;};'use strict';var _=require(_0x3f6e('0x0'));var util=require(_0x3f6e('0x1'));var logger=require(_0x3f6e('0x2'))(_0x3f6e('0x3'));var moment=require(_0x3f6e('0x4'));var BPromise=require(_0x3f6e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3f6e('0x6'));var config=require(_0x3f6e('0x7'));var attributes=require(_0x3f6e('0x8'));module[_0x3f6e('0x9')]=function(_0x12bbcd,_0x12c191){return _0x12bbcd[_0x3f6e('0xa')](_0x3f6e('0xb'),attributes,{'tableName':_0x3f6e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfdb0=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueue.attributes','exports','ChatQueue'];(function(_0x39c43e,_0x2a01e0){var _0x5458ad=function(_0x8c710c){while(--_0x8c710c){_0x39c43e['push'](_0x39c43e['shift']());}};_0x5458ad(++_0x2a01e0);}(_0xfdb0,0x6c));var _0x0fdb=function(_0xd21f9c,_0x869969){_0xd21f9c=_0xd21f9c-0x0;var _0x5bd476=_0xfdb0[_0xd21f9c];return _0x5bd476;};'use strict';var _=require(_0x0fdb('0x0'));var util=require(_0x0fdb('0x1'));var logger=require(_0x0fdb('0x2'))(_0x0fdb('0x3'));var moment=require(_0x0fdb('0x4'));var BPromise=require(_0x0fdb('0x5'));var rp=require(_0x0fdb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fdb('0x7'));var config=require(_0x0fdb('0x8'));var attributes=require(_0x0fdb('0x9'));module[_0x0fdb('0xa')]=function(_0x4e5ca7,_0x1bb39a){return _0x4e5ca7['define'](_0x0fdb('0xb'),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 2ab82fa..dcd7717 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 _0xb4e5=['GetChatQueue','findAll','options','raw','attributes','limit','include','model','map','then','ShowChatQueue','ChatQueue','find','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x56740a,_0x568894){var _0x257144=function(_0x2b8cc5){while(--_0x2b8cc5){_0x56740a['push'](_0x56740a['shift']());}};_0x257144(++_0x568894);}(_0xb4e5,0x104));var _0x5b4e=function(_0x575871,_0x4449c8){_0x575871=_0x575871-0x0;var _0x44d15c=_0xb4e5[_0x575871];return _0x44d15c;};'use strict';var _=require(_0x5b4e('0x0'));var util=require('util');var moment=require(_0x5b4e('0x1'));var BPromise=require(_0x5b4e('0x2'));var rs=require(_0x5b4e('0x3'));var fs=require('fs');var Redis=require(_0x5b4e('0x4'));var db=require(_0x5b4e('0x5'))['db'];var utils=require(_0x5b4e('0x6'));var logger=require(_0x5b4e('0x7'))(_0x5b4e('0x8'));var config=require('../../config/environment');var jayson=require(_0x5b4e('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x5b4e('0xa')]=_[_0x5b4e('0xb')](config['redis'],{'host':_0x5b4e('0xc'),'port':0x18eb});var socket=require(_0x5b4e('0xd'))(new Redis(config[_0x5b4e('0xa')]));require(_0x5b4e('0xe'))[_0x5b4e('0xf')](socket);function respondWithRpcPromise(_0x36944e,_0x3ff333,_0x161d8e){return new BPromise(function(_0x4143c4,_0x2b8afd){return client[_0x5b4e('0x10')](_0x36944e,_0x161d8e)['then'](function(_0x186c47){logger[_0x5b4e('0x11')](_0x5b4e('0x12'),_0x3ff333,_0x5b4e('0x13'));logger[_0x5b4e('0x14')](_0x5b4e('0x15'),_0x3ff333,_0x5b4e('0x13'),JSON[_0x5b4e('0x16')](_0x186c47));if(_0x186c47['error']){if(_0x186c47[_0x5b4e('0x17')]['code']===0x1f4){logger[_0x5b4e('0x17')]('ChatQueue,\x20%s,\x20%s',_0x3ff333,_0x186c47[_0x5b4e('0x17')][_0x5b4e('0x18')]);return _0x2b8afd(_0x186c47[_0x5b4e('0x17')][_0x5b4e('0x18')]);}logger[_0x5b4e('0x17')](_0x5b4e('0x12'),_0x3ff333,_0x186c47['error'][_0x5b4e('0x18')]);return _0x4143c4(_0x186c47[_0x5b4e('0x17')]['message']);}else{logger[_0x5b4e('0x11')](_0x5b4e('0x12'),_0x3ff333,_0x5b4e('0x13'));_0x4143c4(_0x186c47[_0x5b4e('0x19')][_0x5b4e('0x18')]);}})[_0x5b4e('0x1a')](function(_0x22f4d0){logger['error'](_0x5b4e('0x12'),_0x3ff333,_0x22f4d0);_0x2b8afd(_0x22f4d0);});});}exports[_0x5b4e('0x1b')]=function(_0x241947){var _0x2d798d=this;return new Promise(function(_0x32439f,_0x4fa79a){return db['ChatQueue'][_0x5b4e('0x1c')]({'raw':_0x241947['options']?_0x241947[_0x5b4e('0x1d')][_0x5b4e('0x1e')]===undefined?!![]:![]:!![],'where':_0x241947['options']?_0x241947[_0x5b4e('0x1d')]['where']||null:null,'attributes':_0x241947[_0x5b4e('0x1d')]?_0x241947[_0x5b4e('0x1d')][_0x5b4e('0x1f')]||null:null,'limit':_0x241947['options']?_0x241947[_0x5b4e('0x1d')][_0x5b4e('0x20')]||null:null,'include':_0x241947[_0x5b4e('0x1d')]?_0x241947[_0x5b4e('0x1d')]['include']?_['map'](_0x241947['options'][_0x5b4e('0x21')],function(_0x36bfaf){return{'model':db[_0x36bfaf[_0x5b4e('0x22')]],'as':_0x36bfaf['as'],'attributes':_0x36bfaf[_0x5b4e('0x1f')],'include':_0x36bfaf[_0x5b4e('0x21')]?_[_0x5b4e('0x23')](_0x36bfaf[_0x5b4e('0x21')],function(_0x2a9aa6){return{'model':db[_0x2a9aa6[_0x5b4e('0x22')]],'as':_0x2a9aa6['as'],'attributes':_0x2a9aa6[_0x5b4e('0x1f')],'include':_0x2a9aa6[_0x5b4e('0x21')]?_[_0x5b4e('0x23')](_0x2a9aa6['include'],function(_0x37e4fd){return{'model':db[_0x37e4fd[_0x5b4e('0x22')]],'as':_0x37e4fd['as'],'attributes':_0x37e4fd[_0x5b4e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5b4e('0x24')](function(_0x305e68){logger['info'](_0x5b4e('0x1b'),_0x241947);logger['debug'](_0x5b4e('0x1b'),_0x241947,JSON['stringify'](_0x305e68));_0x32439f(_0x305e68);})['catch'](function(_0x3a22ea){logger[_0x5b4e('0x17')](_0x5b4e('0x1b'),_0x3a22ea[_0x5b4e('0x18')],_0x241947);_0x4fa79a(_0x2d798d[_0x5b4e('0x17')](0x1f4,_0x3a22ea[_0x5b4e('0x18')]));});});};exports[_0x5b4e('0x25')]=function(_0x432ae0){var _0x1e3f8f=this;return new Promise(function(_0x363a5a,_0x38c0d2){return db[_0x5b4e('0x26')][_0x5b4e('0x27')]({'raw':_0x432ae0[_0x5b4e('0x1d')]?_0x432ae0[_0x5b4e('0x1d')][_0x5b4e('0x1e')]===undefined?!![]:![]:!![],'where':_0x432ae0[_0x5b4e('0x1d')]?_0x432ae0[_0x5b4e('0x1d')][_0x5b4e('0x28')]||null:null,'attributes':_0x432ae0[_0x5b4e('0x1d')]?_0x432ae0[_0x5b4e('0x1d')][_0x5b4e('0x1f')]||null:null,'include':_0x432ae0['options']?_0x432ae0['options'][_0x5b4e('0x21')]?_[_0x5b4e('0x23')](_0x432ae0[_0x5b4e('0x1d')]['include'],function(_0x268dcc){return{'model':db[_0x268dcc[_0x5b4e('0x22')]],'as':_0x268dcc['as'],'attributes':_0x268dcc[_0x5b4e('0x1f')],'include':_0x268dcc['include']?_[_0x5b4e('0x23')](_0x268dcc[_0x5b4e('0x21')],function(_0x4bff4d){return{'model':db[_0x4bff4d[_0x5b4e('0x22')]],'as':_0x4bff4d['as'],'attributes':_0x4bff4d['attributes'],'include':_0x4bff4d[_0x5b4e('0x21')]?_[_0x5b4e('0x23')](_0x4bff4d[_0x5b4e('0x21')],function(_0x53da7f){return{'model':db[_0x53da7f['model']],'as':_0x53da7f['as'],'attributes':_0x53da7f[_0x5b4e('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x200f78){logger[_0x5b4e('0x11')](_0x5b4e('0x25'),_0x432ae0);logger[_0x5b4e('0x14')](_0x5b4e('0x25'),_0x432ae0,JSON[_0x5b4e('0x16')](_0x200f78));_0x363a5a(_0x200f78);})['catch'](function(_0x599110){logger[_0x5b4e('0x17')](_0x5b4e('0x25'),_0x599110[_0x5b4e('0x18')],_0x432ae0);_0x38c0d2(_0x1e3f8f[_0x5b4e('0x17')](0x1f4,_0x599110[_0x5b4e('0x18')]));});});}; \ No newline at end of file +var _0xab40=['GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','info','catch','ShowChatQueue','find','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','register','request','then','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xab40,0xcd));var _0x0ab4=function(_0x90db4,_0x5911db){_0x90db4=_0x90db4-0x0;var _0x3d4960=_0xab40[_0x90db4];return _0x3d4960;};'use strict';var _=require(_0x0ab4('0x0'));var util=require(_0x0ab4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ab4('0x2'));var db=require(_0x0ab4('0x3'))['db'];var utils=require(_0x0ab4('0x4'));var logger=require(_0x0ab4('0x5'))(_0x0ab4('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0ab4('0x7')]['http']({'port':0x232a});config[_0x0ab4('0x8')]=_[_0x0ab4('0x9')](config[_0x0ab4('0x8')],{'host':_0x0ab4('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatQueue.socket')[_0x0ab4('0xb')](socket);function respondWithRpcPromise(_0x30e726,_0x40e4d1,_0x464f7e){return new BPromise(function(_0x413d9b,_0x24c6c1){return client[_0x0ab4('0xc')](_0x30e726,_0x464f7e)[_0x0ab4('0xd')](function(_0x4e1708){logger['info'](_0x0ab4('0xe'),_0x40e4d1,'request\x20sent');logger[_0x0ab4('0xf')](_0x0ab4('0x10'),_0x40e4d1,_0x0ab4('0x11'),JSON[_0x0ab4('0x12')](_0x4e1708));if(_0x4e1708[_0x0ab4('0x13')]){if(_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x14')]===0x1f4){logger[_0x0ab4('0x13')](_0x0ab4('0xe'),_0x40e4d1,_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x15')]);return _0x24c6c1(_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x15')]);}logger[_0x0ab4('0x13')](_0x0ab4('0xe'),_0x40e4d1,_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x15')]);return _0x413d9b(_0x4e1708[_0x0ab4('0x13')]['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x40e4d1,_0x0ab4('0x11'));_0x413d9b(_0x4e1708[_0x0ab4('0x16')][_0x0ab4('0x15')]);}})['catch'](function(_0x1e3fe2){logger[_0x0ab4('0x13')](_0x0ab4('0xe'),_0x40e4d1,_0x1e3fe2);_0x24c6c1(_0x1e3fe2);});});}exports[_0x0ab4('0x17')]=function(_0x4e7852){var _0x4ff836=this;return new Promise(function(_0xdb0797,_0x5b1ed5){return db[_0x0ab4('0x18')][_0x0ab4('0x19')]({'raw':_0x4e7852['options']?_0x4e7852[_0x0ab4('0x1a')][_0x0ab4('0x1b')]===undefined?!![]:![]:!![],'where':_0x4e7852[_0x0ab4('0x1a')]?_0x4e7852[_0x0ab4('0x1a')][_0x0ab4('0x1c')]||null:null,'attributes':_0x4e7852['options']?_0x4e7852['options'][_0x0ab4('0x1d')]||null:null,'limit':_0x4e7852[_0x0ab4('0x1a')]?_0x4e7852[_0x0ab4('0x1a')][_0x0ab4('0x1e')]||null:null,'include':_0x4e7852['options']?_0x4e7852[_0x0ab4('0x1a')][_0x0ab4('0x1f')]?_[_0x0ab4('0x20')](_0x4e7852['options']['include'],function(_0x176ff1){return{'model':db[_0x176ff1[_0x0ab4('0x21')]],'as':_0x176ff1['as'],'attributes':_0x176ff1[_0x0ab4('0x1d')],'include':_0x176ff1['include']?_['map'](_0x176ff1['include'],function(_0x19ecc6){return{'model':db[_0x19ecc6['model']],'as':_0x19ecc6['as'],'attributes':_0x19ecc6[_0x0ab4('0x1d')],'include':_0x19ecc6[_0x0ab4('0x1f')]?_['map'](_0x19ecc6['include'],function(_0x4d0cc1){return{'model':db[_0x4d0cc1[_0x0ab4('0x21')]],'as':_0x4d0cc1['as'],'attributes':_0x4d0cc1[_0x0ab4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0ab4('0xd')](function(_0x3f61cb){logger[_0x0ab4('0x22')]('GetChatQueue',_0x4e7852);logger['debug']('GetChatQueue',_0x4e7852,JSON[_0x0ab4('0x12')](_0x3f61cb));_0xdb0797(_0x3f61cb);})[_0x0ab4('0x23')](function(_0x155d96){logger[_0x0ab4('0x13')](_0x0ab4('0x17'),_0x155d96['message'],_0x4e7852);_0x5b1ed5(_0x4ff836['error'](0x1f4,_0x155d96[_0x0ab4('0x15')]));});});};exports[_0x0ab4('0x24')]=function(_0x361f7c){var _0x4819be=this;return new Promise(function(_0x48e430,_0x1b19db){return db['ChatQueue'][_0x0ab4('0x25')]({'raw':_0x361f7c[_0x0ab4('0x1a')]?_0x361f7c[_0x0ab4('0x1a')][_0x0ab4('0x1b')]===undefined?!![]:![]:!![],'where':_0x361f7c[_0x0ab4('0x1a')]?_0x361f7c[_0x0ab4('0x1a')]['where']||null:null,'attributes':_0x361f7c[_0x0ab4('0x1a')]?_0x361f7c[_0x0ab4('0x1a')][_0x0ab4('0x1d')]||null:null,'include':_0x361f7c[_0x0ab4('0x1a')]?_0x361f7c['options']['include']?_[_0x0ab4('0x20')](_0x361f7c[_0x0ab4('0x1a')][_0x0ab4('0x1f')],function(_0x4fca1b){return{'model':db[_0x4fca1b['model']],'as':_0x4fca1b['as'],'attributes':_0x4fca1b['attributes'],'include':_0x4fca1b[_0x0ab4('0x1f')]?_[_0x0ab4('0x20')](_0x4fca1b[_0x0ab4('0x1f')],function(_0x53d1fc){return{'model':db[_0x53d1fc['model']],'as':_0x53d1fc['as'],'attributes':_0x53d1fc['attributes'],'include':_0x53d1fc[_0x0ab4('0x1f')]?_[_0x0ab4('0x20')](_0x53d1fc[_0x0ab4('0x1f')],function(_0x39d99b){return{'model':db[_0x39d99b[_0x0ab4('0x21')]],'as':_0x39d99b['as'],'attributes':_0x39d99b[_0x0ab4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0ab4('0xd')](function(_0xfb7f92){logger[_0x0ab4('0x22')](_0x0ab4('0x24'),_0x361f7c);logger['debug'](_0x0ab4('0x24'),_0x361f7c,JSON[_0x0ab4('0x12')](_0xfb7f92));_0x48e430(_0xfb7f92);})[_0x0ab4('0x23')](function(_0x97d4ad){logger[_0x0ab4('0x13')](_0x0ab4('0x24'),_0x97d4ad[_0x0ab4('0x15')],_0x361f7c);_0x1b19db(_0x4819be[_0x0ab4('0x13')](0x1f4,_0x97d4ad[_0x0ab4('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index f23c9c3..a15b072 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 _0x3140=['removeListener','register','length','chatQueue:','./chatQueue.events','save','remove','update','emit'];(function(_0x35dd20,_0x48eb70){var _0xcca198=function(_0x17d104){while(--_0x17d104){_0x35dd20['push'](_0x35dd20['shift']());}};_0xcca198(++_0x48eb70);}(_0x3140,0xaf));var _0x0314=function(_0x3ad1ab,_0x3c8799){_0x3ad1ab=_0x3ad1ab-0x0;var _0x26d4c9=_0x3140[_0x3ad1ab];return _0x26d4c9;};'use strict';var ChatQueueEvents=require(_0x0314('0x0'));var events=[_0x0314('0x1'),_0x0314('0x2'),_0x0314('0x3')];function createListener(_0x4ac557,_0x4cf353){return function(_0x285be5){_0x4cf353[_0x0314('0x4')](_0x4ac557,_0x285be5);};}function removeListener(_0x1c0f66,_0x3e4284){return function(){ChatQueueEvents[_0x0314('0x5')](_0x1c0f66,_0x3e4284);};}exports[_0x0314('0x6')]=function(_0x9e308d){for(var _0xf87d26=0x0,_0x11ee94=events[_0x0314('0x7')];_0xf87d26<_0x11ee94;_0xf87d26++){var _0x176944=events[_0xf87d26];var _0x495b27=createListener(_0x0314('0x8')+_0x176944,_0x9e308d);ChatQueueEvents['on'](_0x176944,_0x495b27);}}; \ No newline at end of file +var _0x68fc=['emit','removeListener','register','chatQueue:','./chatQueue.events','save','remove'];(function(_0x2cde2a,_0x4325c4){var _0x110f55=function(_0x4927f5){while(--_0x4927f5){_0x2cde2a['push'](_0x2cde2a['shift']());}};_0x110f55(++_0x4325c4);}(_0x68fc,0xa5));var _0xc68f=function(_0x58335a,_0x44b6bf){_0x58335a=_0x58335a-0x0;var _0x5be056=_0x68fc[_0x58335a];return _0x5be056;};'use strict';var ChatQueueEvents=require(_0xc68f('0x0'));var events=[_0xc68f('0x1'),_0xc68f('0x2'),'update'];function createListener(_0x49aa95,_0x26513f){return function(_0x506fb5){_0x26513f[_0xc68f('0x3')](_0x49aa95,_0x506fb5);};}function removeListener(_0x593648,_0x5899ea){return function(){ChatQueueEvents[_0xc68f('0x4')](_0x593648,_0x5899ea);};}exports[_0xc68f('0x5')]=function(_0x1c6df9){for(var _0x363cdf=0x0,_0x4fcce4=events['length'];_0x363cdf<_0x4fcce4;_0x363cdf++){var _0x9f2705=events[_0x363cdf];var _0x2bf3fd=createListener(_0xc68f('0x6')+_0x9f2705,_0x1c6df9);ChatQueueEvents['on'](_0x9f2705,_0x2bf3fd);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 5be0d81..13a6641 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 _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x361f37,_0x297b1d){var _0x3f151f=function(_0x71140){while(--_0x71140){_0x361f37['push'](_0x361f37['shift']());}};_0x3f151f(++_0x297b1d);}(_0x814b,0x1a2));var _0xb814=function(_0x4b2b03,_0xbf34ee){_0x4b2b03=_0x4b2b03-0x0;var _0x1bf0ed=_0x814b[_0x4b2b03];return _0x1bf0ed;};'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('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5573ee,_0x3db368){var _0x123163=function(_0x5a92db){while(--_0x5a92db){_0x5573ee['push'](_0x5573ee['shift']());}};_0x123163(++_0x3db368);}(_0x008c,0x188));var _0xc008=function(_0x568d30,_0x50fceb){_0x568d30=_0x568d30-0x0;var _0xabb817=_0x008c[_0x568d30];return _0xabb817;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index f425b4d..dac5702 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 _0x7511=['sequelize','exports','STRING','DATE','moment'];(function(_0x5846b4,_0x2a47f9){var _0x49a222=function(_0x1387cb){while(--_0x1387cb){_0x5846b4['push'](_0x5846b4['shift']());}};_0x49a222(++_0x2a47f9);}(_0x7511,0x86));var _0x1751=function(_0x544463,_0x214963){_0x544463=_0x544463-0x0;var _0x1add2a=_0x7511[_0x544463];return _0x1add2a;};'use strict';var moment=require(_0x1751('0x0'));var Sequelize=require(_0x1751('0x1'));module[_0x1751('0x2')]={'uniqueid':{'type':Sequelize[_0x1751('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1751('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x1751('0x4')]},'exitAt':{'type':Sequelize[_0x1751('0x4')]},'reason':{'type':Sequelize[_0x1751('0x3')]}}; \ No newline at end of file +var _0xd88c=['sequelize','exports','STRING','DATE','moment'];(function(_0xbcb09a,_0x4ce38b){var _0x2cf112=function(_0x4a3849){while(--_0x4a3849){_0xbcb09a['push'](_0xbcb09a['shift']());}};_0x2cf112(++_0x4ce38b);}(_0xd88c,0x162));var _0xcd88=function(_0x39d711,_0xe11eb7){_0x39d711=_0x39d711-0x0;var _0xee1d0c=_0xd88c[_0x39d711];return _0xee1d0c;};'use strict';var moment=require(_0xcd88('0x0'));var Sequelize=require(_0xcd88('0x1'));module[_0xcd88('0x2')]={'uniqueid':{'type':Sequelize[_0xcd88('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xcd88('0x4')]},'leaveAt':{'type':Sequelize[_0xcd88('0x4')]},'acceptAt':{'type':Sequelize[_0xcd88('0x4')]},'exitAt':{'type':Sequelize[_0xcd88('0x4')]},'reason':{'type':Sequelize[_0xcd88('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 27fa9e1..d64238d 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 _0xdbb9=['map','ChatQueueReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','save','then','destroy','stack','name','index'];(function(_0x20c47c,_0x116409){var _0x4793e9=function(_0x4d0cfa){while(--_0x4d0cfa){_0x20c47c['push'](_0x20c47c['shift']());}};_0x4793e9(++_0x116409);}(_0xdbb9,0xf9));var _0x9dbb=function(_0x16021e,_0x418f89){_0x16021e=_0x16021e-0x0;var _0x8bd8cb=_0xdbb9[_0x16021e];return _0x8bd8cb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9dbb('0x0'));var zipdir=require(_0x9dbb('0x1'));var jsonpatch=require(_0x9dbb('0x2'));var rp=require(_0x9dbb('0x3'));var moment=require('moment');var BPromise=require(_0x9dbb('0x4'));var Mustache=require(_0x9dbb('0x5'));var util=require(_0x9dbb('0x6'));var path=require(_0x9dbb('0x7'));var sox=require(_0x9dbb('0x8'));var csv=require(_0x9dbb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9dbb('0xa'));var crypto=require(_0x9dbb('0xb'));var jsforce=require(_0x9dbb('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9dbb('0xd'));var Papa=require(_0x9dbb('0xe'));var Redis=require(_0x9dbb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9dbb('0x10'));var as=require(_0x9dbb('0x11'));var hardwareService=require(_0x9dbb('0x12'));var logger=require(_0x9dbb('0x13'))('api');var utils=require(_0x9dbb('0x14'));var config=require(_0x9dbb('0x15'));var licenseUtil=require(_0x9dbb('0x16'));var db=require(_0x9dbb('0x17'))['db'];function respondWithStatusCode(_0x3fe0bd,_0x4468e8){_0x4468e8=_0x4468e8||0xcc;return function(_0x382cc6){if(_0x382cc6){return _0x3fe0bd[_0x9dbb('0x18')](_0x4468e8);}return _0x3fe0bd[_0x9dbb('0x19')](_0x4468e8)[_0x9dbb('0x1a')]();};}function respondWithResult(_0x293028,_0x2c36d3){_0x2c36d3=_0x2c36d3||0xc8;return function(_0x24b20b){if(_0x24b20b){return _0x293028[_0x9dbb('0x19')](_0x2c36d3)[_0x9dbb('0x1b')](_0x24b20b);}};}function respondWithFilteredResult(_0x464df5,_0x528110){return function(_0x1366b2){if(_0x1366b2){var _0x30add1=typeof _0x528110[_0x9dbb('0x1c')]===_0x9dbb('0x1d')&&typeof _0x528110[_0x9dbb('0x1e')]==='undefined';var _0x382d61=_0x1366b2[_0x9dbb('0x1f')];var _0x2383cf=_0x30add1?0x0:_0x528110[_0x9dbb('0x1c')];var _0x45c6f5=_0x30add1?_0x1366b2['count']:_0x528110[_0x9dbb('0x1c')]+_0x528110['limit'];var _0x3de435;if(_0x45c6f5>=_0x382d61){_0x45c6f5=_0x382d61;_0x3de435=0xc8;}else{_0x3de435=0xce;}_0x464df5['status'](_0x3de435);return _0x464df5[_0x9dbb('0x20')]('Content-Range',_0x2383cf+'-'+_0x45c6f5+'/'+_0x382d61)[_0x9dbb('0x1b')](_0x1366b2);}return null;};}function patchUpdates(_0x192eb5){return function(_0x188c75){try{jsonpatch['apply'](_0x188c75,_0x192eb5,!![]);}catch(_0x50e5e3){return BPromise['reject'](_0x50e5e3);}return _0x188c75[_0x9dbb('0x21')]();};}function saveUpdates(_0x35c136,_0x48bb65){return function(_0x4a07ef){if(_0x4a07ef){return _0x4a07ef['update'](_0x35c136)[_0x9dbb('0x22')](function(_0x245d12){return _0x245d12;});}return null;};}function removeEntity(_0x10c06a,_0x55e2ef){return function(_0x1f30ec){if(_0x1f30ec){return _0x1f30ec[_0x9dbb('0x23')]()[_0x9dbb('0x22')](function(){_0x10c06a[_0x9dbb('0x19')](0xcc)[_0x9dbb('0x1a')]();});}};}function handleEntityNotFound(_0x3e51ca,_0x668f7b){return function(_0x187486){if(!_0x187486){_0x3e51ca[_0x9dbb('0x18')](0x194);}return _0x187486;};}function handleError(_0x127742,_0x25614a){_0x25614a=_0x25614a||0x1f4;return function(_0x27a6f6){logger['error'](_0x27a6f6[_0x9dbb('0x24')]);if(_0x27a6f6['name']){delete _0x27a6f6[_0x9dbb('0x25')];}_0x127742[_0x9dbb('0x19')](_0x25614a)['send'](_0x27a6f6);};}exports[_0x9dbb('0x26')]=function(_0x4ebd57,_0x4b5ce1){var _0x589f63={},_0x25555c={},_0x3578b3={'count':0x0,'rows':[]};var _0x491324=_[_0x9dbb('0x27')](db[_0x9dbb('0x28')]['rawAttributes'],function(_0x71692a){return{'name':_0x71692a[_0x9dbb('0x29')],'type':_0x71692a[_0x9dbb('0x2a')]['key']};});_0x25555c[_0x9dbb('0x2b')]=_['map'](_0x491324,_0x9dbb('0x25'));_0x25555c[_0x9dbb('0x2c')]=_[_0x9dbb('0x2d')](_0x4ebd57[_0x9dbb('0x2c')]);_0x25555c[_0x9dbb('0x2e')]=_[_0x9dbb('0x2f')](_0x25555c[_0x9dbb('0x2b')],_0x25555c[_0x9dbb('0x2c')]);_0x589f63[_0x9dbb('0x30')]=_[_0x9dbb('0x2f')](_0x25555c[_0x9dbb('0x2b')],qs['fields'](_0x4ebd57[_0x9dbb('0x2c')][_0x9dbb('0x31')]));_0x589f63[_0x9dbb('0x30')]=_0x589f63[_0x9dbb('0x30')][_0x9dbb('0x32')]?_0x589f63[_0x9dbb('0x30')]:_0x25555c[_0x9dbb('0x2b')];if(!_0x4ebd57[_0x9dbb('0x2c')][_0x9dbb('0x33')](_0x9dbb('0x34'))){_0x589f63[_0x9dbb('0x1e')]=qs[_0x9dbb('0x1e')](_0x4ebd57[_0x9dbb('0x2c')][_0x9dbb('0x1e')]);_0x589f63[_0x9dbb('0x1c')]=qs[_0x9dbb('0x1c')](_0x4ebd57[_0x9dbb('0x2c')]['offset']);}_0x589f63[_0x9dbb('0x35')]=qs[_0x9dbb('0x36')](_0x4ebd57[_0x9dbb('0x2c')]['sort']);_0x589f63[_0x9dbb('0x37')]=qs[_0x9dbb('0x2e')](_[_0x9dbb('0x38')](_0x4ebd57[_0x9dbb('0x2c')],_0x25555c[_0x9dbb('0x2e')]),_0x491324);if(_0x4ebd57[_0x9dbb('0x2c')]['filter']){_0x589f63[_0x9dbb('0x37')]=_['merge'](_0x589f63[_0x9dbb('0x37')],{'$or':_[_0x9dbb('0x27')](_0x491324,function(_0xa3bc3){if(_0xa3bc3[_0x9dbb('0x2a')]!=='VIRTUAL'){var _0x1a5eeb={};_0x1a5eeb[_0xa3bc3['name']]={'$like':'%'+_0x4ebd57[_0x9dbb('0x2c')]['filter']+'%'};return _0x1a5eeb;}})});}_0x589f63=_[_0x9dbb('0x39')]({},_0x589f63,_0x4ebd57[_0x9dbb('0x3a')]);var _0x34524e={'where':_0x589f63[_0x9dbb('0x37')]};return db[_0x9dbb('0x28')]['count'](_0x34524e)[_0x9dbb('0x22')](function(_0x59eea1){_0x3578b3[_0x9dbb('0x1f')]=_0x59eea1;if(_0x4ebd57[_0x9dbb('0x2c')][_0x9dbb('0x3b')]){_0x589f63[_0x9dbb('0x3c')]=[{'all':!![]}];}return db[_0x9dbb('0x28')][_0x9dbb('0x3d')](_0x589f63);})[_0x9dbb('0x22')](function(_0x49e63f){_0x3578b3[_0x9dbb('0x3e')]=_0x49e63f;return _0x3578b3;})['then'](respondWithFilteredResult(_0x4b5ce1,_0x589f63))[_0x9dbb('0x3f')](handleError(_0x4b5ce1,null));};exports[_0x9dbb('0x40')]=function(_0x34c114,_0x104ec5){var _0x490833={'raw':!![],'where':{'id':_0x34c114['params']['id']}},_0x2f99ed={};_0x2f99ed[_0x9dbb('0x2b')]=_['keys'](db[_0x9dbb('0x28')][_0x9dbb('0x41')]);_0x2f99ed['query']=_['keys'](_0x34c114[_0x9dbb('0x2c')]);_0x2f99ed[_0x9dbb('0x2e')]=_[_0x9dbb('0x2f')](_0x2f99ed[_0x9dbb('0x2b')],_0x2f99ed[_0x9dbb('0x2c')]);_0x490833[_0x9dbb('0x30')]=_[_0x9dbb('0x2f')](_0x2f99ed[_0x9dbb('0x2b')],qs[_0x9dbb('0x31')](_0x34c114['query'][_0x9dbb('0x31')]));_0x490833['attributes']=_0x490833[_0x9dbb('0x30')][_0x9dbb('0x32')]?_0x490833[_0x9dbb('0x30')]:_0x2f99ed[_0x9dbb('0x2b')];if(_0x34c114['query'][_0x9dbb('0x3b')]){_0x490833['include']=[{'all':!![]}];}_0x490833=_['merge']({},_0x490833,_0x34c114[_0x9dbb('0x3a')]);return db[_0x9dbb('0x28')][_0x9dbb('0x42')](_0x490833)[_0x9dbb('0x22')](handleEntityNotFound(_0x104ec5,null))[_0x9dbb('0x22')](respondWithResult(_0x104ec5,null))[_0x9dbb('0x3f')](handleError(_0x104ec5,null));};exports['create']=function(_0x202235,_0x56d319){return db[_0x9dbb('0x28')][_0x9dbb('0x43')](_0x202235[_0x9dbb('0x44')],{})[_0x9dbb('0x22')](respondWithResult(_0x56d319,0xc9))[_0x9dbb('0x3f')](handleError(_0x56d319,null));};exports[_0x9dbb('0x45')]=function(_0x34304a,_0x31c532){if(_0x34304a['body']['id']){delete _0x34304a[_0x9dbb('0x44')]['id'];}return db['ChatQueueReport'][_0x9dbb('0x42')]({'where':{'id':_0x34304a[_0x9dbb('0x46')]['id']}})['then'](handleEntityNotFound(_0x31c532,null))[_0x9dbb('0x22')](saveUpdates(_0x34304a['body'],null))['then'](respondWithResult(_0x31c532,null))['catch'](handleError(_0x31c532,null));};exports[_0x9dbb('0x23')]=function(_0x3c19bb,_0x5c398b){return db[_0x9dbb('0x28')]['find']({'where':{'id':_0x3c19bb[_0x9dbb('0x46')]['id']}})[_0x9dbb('0x22')](handleEntityNotFound(_0x5c398b,null))[_0x9dbb('0x22')](removeEntity(_0x5c398b,null))[_0x9dbb('0x3f')](handleError(_0x5c398b,null));};exports[_0x9dbb('0x47')]=function(_0x6a6f55,_0x56ac9a){return db['ChatQueueReport'][_0x9dbb('0x47')]()[_0x9dbb('0x22')](respondWithResult(_0x56ac9a,null))['catch'](handleError(_0x56ac9a,null));}; \ No newline at end of file +var _0x77f7=['name','send','index','map','ChatQueueReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','rawAttributes','catch','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x1ac279,_0x4127cb){var _0x3ecefa=function(_0x144441){while(--_0x144441){_0x1ac279['push'](_0x1ac279['shift']());}};_0x3ecefa(++_0x4127cb);}(_0x77f7,0xbd));var _0x777f=function(_0xe5fedd,_0x5eda04){_0xe5fedd=_0xe5fedd-0x0;var _0x123fd0=_0x77f7[_0xe5fedd];return _0x123fd0;};'use strict';var emlformat=require(_0x777f('0x0'));var rimraf=require(_0x777f('0x1'));var zipdir=require(_0x777f('0x2'));var jsonpatch=require(_0x777f('0x3'));var rp=require(_0x777f('0x4'));var moment=require(_0x777f('0x5'));var BPromise=require(_0x777f('0x6'));var Mustache=require(_0x777f('0x7'));var util=require(_0x777f('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x777f('0x9'));var ejs=require(_0x777f('0xa'));var fs=require('fs');var fs_extra=require(_0x777f('0xb'));var _=require(_0x777f('0xc'));var squel=require(_0x777f('0xd'));var crypto=require(_0x777f('0xe'));var jsforce=require(_0x777f('0xf'));var deskjs=require(_0x777f('0x10'));var toCsv=require(_0x777f('0x9'));var querystring=require(_0x777f('0x11'));var Papa=require('papaparse');var Redis=require(_0x777f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x777f('0x13'));var as=require(_0x777f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x777f('0x15'))(_0x777f('0x16'));var utils=require(_0x777f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x777f('0x18'));var db=require(_0x777f('0x19'))['db'];function respondWithStatusCode(_0x285bf7,_0x30f31b){_0x30f31b=_0x30f31b||0xcc;return function(_0xee481c){if(_0xee481c){return _0x285bf7[_0x777f('0x1a')](_0x30f31b);}return _0x285bf7['status'](_0x30f31b)[_0x777f('0x1b')]();};}function respondWithResult(_0x2cef15,_0x5468c0){_0x5468c0=_0x5468c0||0xc8;return function(_0x36652d){if(_0x36652d){return _0x2cef15[_0x777f('0x1c')](_0x5468c0)[_0x777f('0x1d')](_0x36652d);}};}function respondWithFilteredResult(_0x43d45a,_0xf4d60b){return function(_0x217e98){if(_0x217e98){var _0x41855a=typeof _0xf4d60b['offset']===_0x777f('0x1e')&&typeof _0xf4d60b[_0x777f('0x1f')]===_0x777f('0x1e');var _0x1ef1c5=_0x217e98[_0x777f('0x20')];var _0x3aeb58=_0x41855a?0x0:_0xf4d60b[_0x777f('0x21')];var _0x4e1153=_0x41855a?_0x217e98['count']:_0xf4d60b[_0x777f('0x21')]+_0xf4d60b[_0x777f('0x1f')];var _0x31f786;if(_0x4e1153>=_0x1ef1c5){_0x4e1153=_0x1ef1c5;_0x31f786=0xc8;}else{_0x31f786=0xce;}_0x43d45a[_0x777f('0x1c')](_0x31f786);return _0x43d45a[_0x777f('0x22')](_0x777f('0x23'),_0x3aeb58+'-'+_0x4e1153+'/'+_0x1ef1c5)[_0x777f('0x1d')](_0x217e98);}return null;};}function patchUpdates(_0x143f3d){return function(_0x5d31f1){try{jsonpatch[_0x777f('0x24')](_0x5d31f1,_0x143f3d,!![]);}catch(_0x5637d0){return BPromise[_0x777f('0x25')](_0x5637d0);}return _0x5d31f1[_0x777f('0x26')]();};}function saveUpdates(_0x1cc281,_0x38e32f){return function(_0x3a0c1d){if(_0x3a0c1d){return _0x3a0c1d[_0x777f('0x27')](_0x1cc281)[_0x777f('0x28')](function(_0x5732c6){return _0x5732c6;});}return null;};}function removeEntity(_0x780490,_0x17f1ed){return function(_0x5089ba){if(_0x5089ba){return _0x5089ba[_0x777f('0x29')]()['then'](function(){_0x780490[_0x777f('0x1c')](0xcc)[_0x777f('0x1b')]();});}};}function handleEntityNotFound(_0x109a8e,_0x3fe93d){return function(_0x43a7c1){if(!_0x43a7c1){_0x109a8e[_0x777f('0x1a')](0x194);}return _0x43a7c1;};}function handleError(_0x2c9edc,_0x1c0984){_0x1c0984=_0x1c0984||0x1f4;return function(_0x104b86){logger['error'](_0x104b86['stack']);if(_0x104b86[_0x777f('0x2a')]){delete _0x104b86[_0x777f('0x2a')];}_0x2c9edc[_0x777f('0x1c')](_0x1c0984)[_0x777f('0x2b')](_0x104b86);};}exports[_0x777f('0x2c')]=function(_0x32007e,_0x221dda){var _0x5b0504={},_0x2ebed8={},_0x3940cb={'count':0x0,'rows':[]};var _0x5b78b8=_[_0x777f('0x2d')](db[_0x777f('0x2e')]['rawAttributes'],function(_0x502924){return{'name':_0x502924[_0x777f('0x2f')],'type':_0x502924[_0x777f('0x30')][_0x777f('0x31')]};});_0x2ebed8[_0x777f('0x32')]=_[_0x777f('0x2d')](_0x5b78b8,_0x777f('0x2a'));_0x2ebed8[_0x777f('0x33')]=_[_0x777f('0x34')](_0x32007e[_0x777f('0x33')]);_0x2ebed8[_0x777f('0x35')]=_['intersection'](_0x2ebed8[_0x777f('0x32')],_0x2ebed8[_0x777f('0x33')]);_0x5b0504[_0x777f('0x36')]=_[_0x777f('0x37')](_0x2ebed8[_0x777f('0x32')],qs[_0x777f('0x38')](_0x32007e['query'][_0x777f('0x38')]));_0x5b0504[_0x777f('0x36')]=_0x5b0504['attributes'][_0x777f('0x39')]?_0x5b0504['attributes']:_0x2ebed8['model'];if(!_0x32007e[_0x777f('0x33')][_0x777f('0x3a')](_0x777f('0x3b'))){_0x5b0504[_0x777f('0x1f')]=qs[_0x777f('0x1f')](_0x32007e[_0x777f('0x33')][_0x777f('0x1f')]);_0x5b0504[_0x777f('0x21')]=qs['offset'](_0x32007e['query'][_0x777f('0x21')]);}_0x5b0504[_0x777f('0x3c')]=qs[_0x777f('0x3d')](_0x32007e[_0x777f('0x33')][_0x777f('0x3d')]);_0x5b0504[_0x777f('0x3e')]=qs[_0x777f('0x35')](_[_0x777f('0x3f')](_0x32007e['query'],_0x2ebed8[_0x777f('0x35')]),_0x5b78b8);if(_0x32007e[_0x777f('0x33')][_0x777f('0x40')]){_0x5b0504[_0x777f('0x3e')]=_[_0x777f('0x41')](_0x5b0504[_0x777f('0x3e')],{'$or':_[_0x777f('0x2d')](_0x5b78b8,function(_0x1f32ad){if(_0x1f32ad['type']!=='VIRTUAL'){var _0x19795e={};_0x19795e[_0x1f32ad['name']]={'$like':'%'+_0x32007e[_0x777f('0x33')][_0x777f('0x40')]+'%'};return _0x19795e;}})});}_0x5b0504=_[_0x777f('0x41')]({},_0x5b0504,_0x32007e[_0x777f('0x42')]);var _0x2727d0={'where':_0x5b0504['where']};return db[_0x777f('0x2e')][_0x777f('0x20')](_0x2727d0)[_0x777f('0x28')](function(_0x3a5d34){_0x3940cb[_0x777f('0x20')]=_0x3a5d34;if(_0x32007e['query'][_0x777f('0x43')]){_0x5b0504[_0x777f('0x44')]=[{'all':!![]}];}return db[_0x777f('0x2e')][_0x777f('0x45')](_0x5b0504);})[_0x777f('0x28')](function(_0x43e53d){_0x3940cb[_0x777f('0x46')]=_0x43e53d;return _0x3940cb;})[_0x777f('0x28')](respondWithFilteredResult(_0x221dda,_0x5b0504))['catch'](handleError(_0x221dda,null));};exports['show']=function(_0x2924e9,_0x4a4eb6){var _0x5ac30a={'raw':!![],'where':{'id':_0x2924e9[_0x777f('0x47')]['id']}},_0xdfb525={};_0xdfb525[_0x777f('0x32')]=_['keys'](db['ChatQueueReport'][_0x777f('0x48')]);_0xdfb525[_0x777f('0x33')]=_[_0x777f('0x34')](_0x2924e9[_0x777f('0x33')]);_0xdfb525['filters']=_[_0x777f('0x37')](_0xdfb525[_0x777f('0x32')],_0xdfb525[_0x777f('0x33')]);_0x5ac30a[_0x777f('0x36')]=_[_0x777f('0x37')](_0xdfb525[_0x777f('0x32')],qs[_0x777f('0x38')](_0x2924e9[_0x777f('0x33')][_0x777f('0x38')]));_0x5ac30a[_0x777f('0x36')]=_0x5ac30a[_0x777f('0x36')][_0x777f('0x39')]?_0x5ac30a[_0x777f('0x36')]:_0xdfb525[_0x777f('0x32')];if(_0x2924e9[_0x777f('0x33')]['includeAll']){_0x5ac30a[_0x777f('0x44')]=[{'all':!![]}];}_0x5ac30a=_[_0x777f('0x41')]({},_0x5ac30a,_0x2924e9[_0x777f('0x42')]);return db[_0x777f('0x2e')]['find'](_0x5ac30a)[_0x777f('0x28')](handleEntityNotFound(_0x4a4eb6,null))[_0x777f('0x28')](respondWithResult(_0x4a4eb6,null))[_0x777f('0x49')](handleError(_0x4a4eb6,null));};exports['create']=function(_0x486664,_0x364d41){return db['ChatQueueReport']['create'](_0x486664[_0x777f('0x4a')],{})[_0x777f('0x28')](respondWithResult(_0x364d41,0xc9))[_0x777f('0x49')](handleError(_0x364d41,null));};exports[_0x777f('0x27')]=function(_0x3ba76d,_0x45ea24){if(_0x3ba76d[_0x777f('0x4a')]['id']){delete _0x3ba76d[_0x777f('0x4a')]['id'];}return db['ChatQueueReport'][_0x777f('0x4b')]({'where':{'id':_0x3ba76d[_0x777f('0x47')]['id']}})[_0x777f('0x28')](handleEntityNotFound(_0x45ea24,null))[_0x777f('0x28')](saveUpdates(_0x3ba76d[_0x777f('0x4a')],null))[_0x777f('0x28')](respondWithResult(_0x45ea24,null))[_0x777f('0x49')](handleError(_0x45ea24,null));};exports[_0x777f('0x29')]=function(_0x124fc5,_0x145cbb){return db[_0x777f('0x2e')][_0x777f('0x4b')]({'where':{'id':_0x124fc5[_0x777f('0x47')]['id']}})[_0x777f('0x28')](handleEntityNotFound(_0x145cbb,null))[_0x777f('0x28')](removeEntity(_0x145cbb,null))[_0x777f('0x49')](handleError(_0x145cbb,null));};exports[_0x777f('0x4c')]=function(_0x4d9f46,_0x126b50){return db['ChatQueueReport'][_0x777f('0x4c')]()[_0x777f('0x28')](respondWithResult(_0x126b50,null))[_0x777f('0x49')](handleError(_0x126b50,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 885cc37..2d12130 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(_0x4c9c81,_0x4387de){var _0x3b0c4c=function(_0x4f2205){while(--_0x4f2205){_0x4c9c81['push'](_0x4c9c81['shift']());}};_0x3b0c4c(++_0x4387de);}(_0xb7e7,0x121));var _0x7b7e=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xb7e7[_0x487b0c];return _0x1adbdc;};'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(_0x5c9491,_0x387e70){var _0x72b4d=function(_0x49dc6a){while(--_0x49dc6a){_0x5c9491['push'](_0x5c9491['shift']());}};_0x72b4d(++_0x387e70);}(_0x757a,0xde));var _0xa757=function(_0x58abbf,_0x2a16f7){_0x58abbf=_0x58abbf-0x0;var _0x35e6e2=_0x757a[_0x58abbf];return _0x35e6e2;};'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 80d23e4..3c75244 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 _0x5c63=['options','raw','UpdateChatQueueReport','update','where','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','body'];(function(_0xd7907e,_0x360d98){var _0x308f94=function(_0x538e6e){while(--_0x538e6e){_0xd7907e['push'](_0xd7907e['shift']());}};_0x308f94(++_0x360d98);}(_0x5c63,0x15a));var _0x35c6=function(_0xe376cd,_0x4c9b68){_0xe376cd=_0xe376cd-0x0;var _0x4fcc56=_0x5c63[_0xe376cd];return _0x4fcc56;};'use strict';var _=require(_0x35c6('0x0'));var util=require('util');var moment=require(_0x35c6('0x1'));var BPromise=require(_0x35c6('0x2'));var rs=require(_0x35c6('0x3'));var fs=require('fs');var Redis=require(_0x35c6('0x4'));var db=require(_0x35c6('0x5'))['db'];var utils=require(_0x35c6('0x6'));var logger=require(_0x35c6('0x7'))('rpc');var config=require(_0x35c6('0x8'));var jayson=require(_0x35c6('0x9'));var client=jayson[_0x35c6('0xa')][_0x35c6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x298986,_0x2498d3,_0x1e15c6){return new BPromise(function(_0x16490a,_0x1c75e9){return client[_0x35c6('0xc')](_0x298986,_0x1e15c6)[_0x35c6('0xd')](function(_0x2aa9e5){logger[_0x35c6('0xe')](_0x35c6('0xf'),_0x2498d3,_0x35c6('0x10'));logger[_0x35c6('0x11')](_0x35c6('0x12'),_0x2498d3,_0x35c6('0x10'),JSON[_0x35c6('0x13')](_0x2aa9e5));if(_0x2aa9e5['error']){if(_0x2aa9e5[_0x35c6('0x14')][_0x35c6('0x15')]===0x1f4){logger[_0x35c6('0x14')](_0x35c6('0xf'),_0x2498d3,_0x2aa9e5['error'][_0x35c6('0x16')]);return _0x1c75e9(_0x2aa9e5[_0x35c6('0x14')][_0x35c6('0x16')]);}logger[_0x35c6('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x2498d3,_0x2aa9e5['error'][_0x35c6('0x16')]);return _0x16490a(_0x2aa9e5[_0x35c6('0x14')][_0x35c6('0x16')]);}else{logger['info'](_0x35c6('0xf'),_0x2498d3,_0x35c6('0x10'));_0x16490a(_0x2aa9e5[_0x35c6('0x17')][_0x35c6('0x16')]);}})[_0x35c6('0x18')](function(_0x3ff58f){logger[_0x35c6('0x14')](_0x35c6('0xf'),_0x2498d3,_0x3ff58f);_0x1c75e9(_0x3ff58f);});});}exports[_0x35c6('0x19')]=function(_0x2566c5){var _0x4a383c=this;return new Promise(function(_0x24f72c,_0x41cf63){return db[_0x35c6('0x1a')]['create'](_0x2566c5[_0x35c6('0x1b')],{'raw':_0x2566c5[_0x35c6('0x1c')]?_0x2566c5['options'][_0x35c6('0x1d')]===undefined?!![]:![]:!![]})[_0x35c6('0xd')](function(_0x5e2a8e){logger[_0x35c6('0xe')](_0x35c6('0x19'),_0x2566c5);logger[_0x35c6('0x11')](_0x35c6('0x19'),_0x2566c5,JSON[_0x35c6('0x13')](_0x5e2a8e));_0x24f72c(_0x5e2a8e);})[_0x35c6('0x18')](function(_0x48aecb){logger[_0x35c6('0x14')](_0x35c6('0x19'),_0x48aecb['message'],_0x2566c5);_0x41cf63(_0x4a383c['error'](0x1f4,_0x48aecb[_0x35c6('0x16')]));});});};exports[_0x35c6('0x1e')]=function(_0x21721f){var _0x47a5e6=this;return new Promise(function(_0x4ef813,_0x226dbf){return db[_0x35c6('0x1a')][_0x35c6('0x1f')](_0x21721f[_0x35c6('0x1b')],{'raw':_0x21721f[_0x35c6('0x1c')]?_0x21721f[_0x35c6('0x1c')][_0x35c6('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21721f['options']?_0x21721f[_0x35c6('0x1c')][_0x35c6('0x20')]||null:null,'attributes':_0x21721f['options']?_0x21721f['options']['attributes']||null:null,'limit':_0x21721f[_0x35c6('0x1c')]?_0x21721f[_0x35c6('0x1c')][_0x35c6('0x21')]||null:null})[_0x35c6('0xd')](function(_0x236c46){logger[_0x35c6('0xe')]('UpdateChatQueueReport',_0x21721f);logger[_0x35c6('0x11')](_0x35c6('0x1e'),_0x21721f,JSON[_0x35c6('0x13')](_0x236c46));_0x4ef813(_0x236c46);})[_0x35c6('0x18')](function(_0x413482){logger['error'](_0x35c6('0x1e'),_0x413482['message'],_0x21721f);_0x226dbf(_0x47a5e6[_0x35c6('0x14')](0x1f4,_0x413482[_0x35c6('0x16')]));});});}; \ No newline at end of file +var _0xd67c=['../../config/environment','jayson/promise','client','http','ChatQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','attributes','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0xd67c,0x177));var _0xcd67=function(_0xcafb2b,_0x2cc85e){_0xcafb2b=_0xcafb2b-0x0;var _0x539f9a=_0xd67c[_0xcafb2b];return _0x539f9a;};'use strict';var _=require(_0xcd67('0x0'));var util=require(_0xcd67('0x1'));var moment=require(_0xcd67('0x2'));var BPromise=require(_0xcd67('0x3'));var rs=require(_0xcd67('0x4'));var fs=require('fs');var Redis=require(_0xcd67('0x5'));var db=require(_0xcd67('0x6'))['db'];var utils=require(_0xcd67('0x7'));var logger=require(_0xcd67('0x8'))(_0xcd67('0x9'));var config=require(_0xcd67('0xa'));var jayson=require(_0xcd67('0xb'));var client=jayson[_0xcd67('0xc')][_0xcd67('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4e925b,_0x247fbe,_0x5f9757){return new BPromise(function(_0xcd56a,_0x1c7c85){return client['request'](_0x4e925b,_0x5f9757)['then'](function(_0x3fa769){logger['info'](_0xcd67('0xe'),_0x247fbe,'request\x20sent');logger[_0xcd67('0xf')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x247fbe,_0xcd67('0x10'),JSON[_0xcd67('0x11')](_0x3fa769));if(_0x3fa769[_0xcd67('0x12')]){if(_0x3fa769[_0xcd67('0x12')][_0xcd67('0x13')]===0x1f4){logger[_0xcd67('0x12')](_0xcd67('0xe'),_0x247fbe,_0x3fa769[_0xcd67('0x12')]['message']);return _0x1c7c85(_0x3fa769['error'][_0xcd67('0x14')]);}logger['error'](_0xcd67('0xe'),_0x247fbe,_0x3fa769[_0xcd67('0x12')][_0xcd67('0x14')]);return _0xcd56a(_0x3fa769[_0xcd67('0x12')]['message']);}else{logger[_0xcd67('0x15')](_0xcd67('0xe'),_0x247fbe,_0xcd67('0x10'));_0xcd56a(_0x3fa769[_0xcd67('0x16')][_0xcd67('0x14')]);}})[_0xcd67('0x17')](function(_0x2e9992){logger['error'](_0xcd67('0xe'),_0x247fbe,_0x2e9992);_0x1c7c85(_0x2e9992);});});}exports[_0xcd67('0x18')]=function(_0x5ef506){var _0x2c22cb=this;return new Promise(function(_0x3ab890,_0xa54e5f){return db[_0xcd67('0x19')][_0xcd67('0x1a')](_0x5ef506[_0xcd67('0x1b')],{'raw':_0x5ef506[_0xcd67('0x1c')]?_0x5ef506['options'][_0xcd67('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x5dc2d2){logger[_0xcd67('0x15')](_0xcd67('0x18'),_0x5ef506);logger[_0xcd67('0xf')](_0xcd67('0x18'),_0x5ef506,JSON[_0xcd67('0x11')](_0x5dc2d2));_0x3ab890(_0x5dc2d2);})[_0xcd67('0x17')](function(_0x381957){logger['error']('CreateChatQueueReport',_0x381957[_0xcd67('0x14')],_0x5ef506);_0xa54e5f(_0x2c22cb[_0xcd67('0x12')](0x1f4,_0x381957['message']));});});};exports[_0xcd67('0x1e')]=function(_0x42a85f){var _0x5e3728=this;return new Promise(function(_0x28282d,_0x45c431){return db[_0xcd67('0x19')][_0xcd67('0x1f')](_0x42a85f[_0xcd67('0x1b')],{'raw':_0x42a85f[_0xcd67('0x1c')]?_0x42a85f[_0xcd67('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42a85f[_0xcd67('0x1c')]?_0x42a85f[_0xcd67('0x1c')]['where']||null:null,'attributes':_0x42a85f[_0xcd67('0x1c')]?_0x42a85f['options'][_0xcd67('0x20')]||null:null,'limit':_0x42a85f['options']?_0x42a85f[_0xcd67('0x1c')][_0xcd67('0x21')]||null:null})[_0xcd67('0x22')](function(_0x4b8e9d){logger[_0xcd67('0x15')](_0xcd67('0x1e'),_0x42a85f);logger[_0xcd67('0xf')]('UpdateChatQueueReport',_0x42a85f,JSON[_0xcd67('0x11')](_0x4b8e9d));_0x28282d(_0x4b8e9d);})[_0xcd67('0x17')](function(_0x1a678e){logger[_0xcd67('0x12')]('UpdateChatQueueReport',_0x1a678e[_0xcd67('0x14')],_0x42a85f);_0x45c431(_0x5e3728['error'](0x1f4,_0x1a678e[_0xcd67('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index f83b5cf..92a85bc 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 _0xa051=['delete','destroy','exports','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show','create','put','update'];(function(_0x5ca644,_0x3d2165){var _0x5c87a2=function(_0x3dc7d9){while(--_0x3dc7d9){_0x5ca644['push'](_0x5ca644['shift']());}};_0x5c87a2(++_0x3d2165);}(_0xa051,0x16c));var _0x1a05=function(_0x154f3a,_0x2d6844){_0x154f3a=_0x154f3a-0x0;var _0x40fb44=_0xa051[_0x154f3a];return _0x40fb44;};'use strict';var multer=require(_0x1a05('0x0'));var util=require('util');var path=require(_0x1a05('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x1a05('0x2'));var auth=require(_0x1a05('0x3'));var interaction=require(_0x1a05('0x4'));var config=require(_0x1a05('0x5'));var controller=require(_0x1a05('0x6'));router['get']('/',auth[_0x1a05('0x7')](),controller[_0x1a05('0x8')]);router[_0x1a05('0x9')](_0x1a05('0xa'),auth[_0x1a05('0x7')](),controller['describe']);router[_0x1a05('0x9')](_0x1a05('0xb'),auth[_0x1a05('0x7')](),controller[_0x1a05('0xc')]);router['post']('/',auth[_0x1a05('0x7')](),controller[_0x1a05('0xd')]);router[_0x1a05('0xe')](_0x1a05('0xb'),auth[_0x1a05('0x7')](),controller[_0x1a05('0xf')]);router[_0x1a05('0x10')]('/:id',auth[_0x1a05('0x7')](),controller[_0x1a05('0x11')]);module[_0x1a05('0x12')]=router; \ No newline at end of file +var _0x4b95=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatQueueReport.controller','isAuthenticated','/describe','get','/:id','create','put','util'];(function(_0x17d831,_0x1f0cc2){var _0x15a6c2=function(_0x2ed3f1){while(--_0x2ed3f1){_0x17d831['push'](_0x17d831['shift']());}};_0x15a6c2(++_0x1f0cc2);}(_0x4b95,0x137));var _0x54b9=function(_0x57702a,_0x57c215){_0x57702a=_0x57702a-0x0;var _0x487e5a=_0x4b95[_0x57702a];return _0x487e5a;};'use strict';var multer=require('multer');var util=require(_0x54b9('0x0'));var path=require('path');var timeout=require(_0x54b9('0x1'));var express=require(_0x54b9('0x2'));var router=express[_0x54b9('0x3')]();var fs_extra=require(_0x54b9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x54b9('0x5'));var config=require('../../config/environment');var controller=require(_0x54b9('0x6'));router['get']('/',auth[_0x54b9('0x7')](),controller['index']);router['get'](_0x54b9('0x8'),auth[_0x54b9('0x7')](),controller['describe']);router[_0x54b9('0x9')](_0x54b9('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x54b9('0xb')]);router[_0x54b9('0xc')](_0x54b9('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x54b9('0xa'),auth[_0x54b9('0x7')](),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 b9f819d..62decbc 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x11fbaa,_0x52dc16){var _0x1831fd=function(_0x2bbced){while(--_0x2bbced){_0x11fbaa['push'](_0x11fbaa['shift']());}};_0x1831fd(++_0x52dc16);}(_0x9c44,0x178));var _0x49c4=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x9c44[_0xb0f7c3];return _0x28ea68;};'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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x1cd0a7,_0x50fb43){var _0x3c965b=function(_0x57d309){while(--_0x57d309){_0x1cd0a7['push'](_0x1cd0a7['shift']());}};_0x3c965b(++_0x50fb43);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3ba924,_0x3b99f0){_0x3ba924=_0x3ba924-0x0;var _0x4cc1df=_0xcb91[_0x3ba924];return _0x4cc1df;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index e8d298d..d5d3875 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 _0x4d13=['then','destroy','end','error','stack','name','send','map','ChatTransferReport','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','findAll','rows','params','rawAttributes','includeAll','find','create','body','catch','describe','eml-format','rimraf','fast-json-patch','bluebird','path','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update'];(function(_0x20c66b,_0x31b9dd){var _0x54c011=function(_0x349b90){while(--_0x349b90){_0x20c66b['push'](_0x20c66b['shift']());}};_0x54c011(++_0x31b9dd);}(_0x4d13,0xa6));var _0x34d1=function(_0x1f18bc,_0x184ce0){_0x1f18bc=_0x1f18bc-0x0;var _0x35f109=_0x4d13[_0x1f18bc];return _0x35f109;};'use strict';var emlformat=require(_0x34d1('0x0'));var rimraf=require(_0x34d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x34d1('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x34d1('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x34d1('0x4'));var sox=require('sox');var csv=require(_0x34d1('0x5'));var ejs=require(_0x34d1('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x34d1('0x7'));var squel=require('squel');var crypto=require(_0x34d1('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x34d1('0x9'));var toCsv=require('to-csv');var querystring=require(_0x34d1('0xa'));var Papa=require('papaparse');var Redis=require(_0x34d1('0xb'));var authService=require(_0x34d1('0xc'));var qs=require(_0x34d1('0xd'));var as=require(_0x34d1('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x34d1('0xf'));var licenseUtil=require(_0x34d1('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a8d05,_0x5f1155){_0x5f1155=_0x5f1155||0xcc;return function(_0x254300){if(_0x254300){return _0x4a8d05[_0x34d1('0x11')](_0x5f1155);}return _0x4a8d05[_0x34d1('0x12')](_0x5f1155)['end']();};}function respondWithResult(_0x352796,_0x186f12){_0x186f12=_0x186f12||0xc8;return function(_0x23be9e){if(_0x23be9e){return _0x352796[_0x34d1('0x12')](_0x186f12)[_0x34d1('0x13')](_0x23be9e);}};}function respondWithFilteredResult(_0x181b3e,_0x4a4afb){return function(_0x5b11a6){if(_0x5b11a6){var _0x15fb95=typeof _0x4a4afb[_0x34d1('0x14')]===_0x34d1('0x15')&&typeof _0x4a4afb[_0x34d1('0x16')]==='undefined';var _0x29a5cb=_0x5b11a6[_0x34d1('0x17')];var _0x5040c2=_0x15fb95?0x0:_0x4a4afb[_0x34d1('0x14')];var _0x1ff3a3=_0x15fb95?_0x5b11a6[_0x34d1('0x17')]:_0x4a4afb['offset']+_0x4a4afb['limit'];var _0x53a97e;if(_0x1ff3a3>=_0x29a5cb){_0x1ff3a3=_0x29a5cb;_0x53a97e=0xc8;}else{_0x53a97e=0xce;}_0x181b3e[_0x34d1('0x12')](_0x53a97e);return _0x181b3e[_0x34d1('0x18')](_0x34d1('0x19'),_0x5040c2+'-'+_0x1ff3a3+'/'+_0x29a5cb)[_0x34d1('0x13')](_0x5b11a6);}return null;};}function patchUpdates(_0x41bc06){return function(_0x1a6f69){try{jsonpatch[_0x34d1('0x1a')](_0x1a6f69,_0x41bc06,!![]);}catch(_0x49e40a){return BPromise['reject'](_0x49e40a);}return _0x1a6f69[_0x34d1('0x1b')]();};}function saveUpdates(_0x46c5a9,_0x18b71d){return function(_0x9b2bee){if(_0x9b2bee){return _0x9b2bee[_0x34d1('0x1c')](_0x46c5a9)[_0x34d1('0x1d')](function(_0x12655b){return _0x12655b;});}return null;};}function removeEntity(_0x43601a,_0x5cf668){return function(_0xd7798){if(_0xd7798){return _0xd7798[_0x34d1('0x1e')]()[_0x34d1('0x1d')](function(){_0x43601a['status'](0xcc)[_0x34d1('0x1f')]();});}};}function handleEntityNotFound(_0x11f42d,_0xfa6571){return function(_0x5952bd){if(!_0x5952bd){_0x11f42d[_0x34d1('0x11')](0x194);}return _0x5952bd;};}function handleError(_0x2dee0f,_0x4de47d){_0x4de47d=_0x4de47d||0x1f4;return function(_0xc1b69b){logger[_0x34d1('0x20')](_0xc1b69b[_0x34d1('0x21')]);if(_0xc1b69b[_0x34d1('0x22')]){delete _0xc1b69b[_0x34d1('0x22')];}_0x2dee0f[_0x34d1('0x12')](_0x4de47d)[_0x34d1('0x23')](_0xc1b69b);};}exports['index']=function(_0x2d4bce,_0x1ea86b){var _0x261a9a={},_0x4c9b75={},_0x1ef510={'count':0x0,'rows':[]};var _0x1f4241=_[_0x34d1('0x24')](db[_0x34d1('0x25')]['rawAttributes'],function(_0x587730){return{'name':_0x587730[_0x34d1('0x26')],'type':_0x587730[_0x34d1('0x27')]['key']};});_0x4c9b75[_0x34d1('0x28')]=_[_0x34d1('0x24')](_0x1f4241,_0x34d1('0x22'));_0x4c9b75['query']=_[_0x34d1('0x29')](_0x2d4bce[_0x34d1('0x2a')]);_0x4c9b75[_0x34d1('0x2b')]=_['intersection'](_0x4c9b75[_0x34d1('0x28')],_0x4c9b75[_0x34d1('0x2a')]);_0x261a9a[_0x34d1('0x2c')]=_[_0x34d1('0x2d')](_0x4c9b75[_0x34d1('0x28')],qs[_0x34d1('0x2e')](_0x2d4bce['query'][_0x34d1('0x2e')]));_0x261a9a['attributes']=_0x261a9a[_0x34d1('0x2c')][_0x34d1('0x2f')]?_0x261a9a[_0x34d1('0x2c')]:_0x4c9b75[_0x34d1('0x28')];if(!_0x2d4bce[_0x34d1('0x2a')][_0x34d1('0x30')](_0x34d1('0x31'))){_0x261a9a[_0x34d1('0x16')]=qs['limit'](_0x2d4bce[_0x34d1('0x2a')][_0x34d1('0x16')]);_0x261a9a[_0x34d1('0x14')]=qs['offset'](_0x2d4bce['query'][_0x34d1('0x14')]);}_0x261a9a['order']=qs[_0x34d1('0x32')](_0x2d4bce[_0x34d1('0x2a')][_0x34d1('0x32')]);_0x261a9a[_0x34d1('0x33')]=qs[_0x34d1('0x2b')](_['pick'](_0x2d4bce[_0x34d1('0x2a')],_0x4c9b75[_0x34d1('0x2b')]),_0x1f4241);if(_0x2d4bce[_0x34d1('0x2a')][_0x34d1('0x34')]){_0x261a9a[_0x34d1('0x33')]=_[_0x34d1('0x35')](_0x261a9a[_0x34d1('0x33')],{'$or':_[_0x34d1('0x24')](_0x1f4241,function(_0x3e18ff){if(_0x3e18ff['type']!=='VIRTUAL'){var _0x584a9a={};_0x584a9a[_0x3e18ff[_0x34d1('0x22')]]={'$like':'%'+_0x2d4bce[_0x34d1('0x2a')][_0x34d1('0x34')]+'%'};return _0x584a9a;}})});}_0x261a9a=_['merge']({},_0x261a9a,_0x2d4bce[_0x34d1('0x36')]);var _0x442fee={'where':_0x261a9a['where']};return db[_0x34d1('0x25')][_0x34d1('0x17')](_0x442fee)[_0x34d1('0x1d')](function(_0x36d2d3){_0x1ef510[_0x34d1('0x17')]=_0x36d2d3;if(_0x2d4bce[_0x34d1('0x2a')]['includeAll']){_0x261a9a['include']=[{'all':!![]}];}return db[_0x34d1('0x25')][_0x34d1('0x37')](_0x261a9a);})['then'](function(_0x40520e){_0x1ef510[_0x34d1('0x38')]=_0x40520e;return _0x1ef510;})[_0x34d1('0x1d')](respondWithFilteredResult(_0x1ea86b,_0x261a9a))['catch'](handleError(_0x1ea86b,null));};exports['show']=function(_0x2592c2,_0x3dc9ae){var _0x3cf010={'raw':!![],'where':{'id':_0x2592c2[_0x34d1('0x39')]['id']}},_0x7fbcc9={};_0x7fbcc9[_0x34d1('0x28')]=_[_0x34d1('0x29')](db[_0x34d1('0x25')][_0x34d1('0x3a')]);_0x7fbcc9[_0x34d1('0x2a')]=_[_0x34d1('0x29')](_0x2592c2[_0x34d1('0x2a')]);_0x7fbcc9[_0x34d1('0x2b')]=_[_0x34d1('0x2d')](_0x7fbcc9[_0x34d1('0x28')],_0x7fbcc9[_0x34d1('0x2a')]);_0x3cf010[_0x34d1('0x2c')]=_[_0x34d1('0x2d')](_0x7fbcc9[_0x34d1('0x28')],qs[_0x34d1('0x2e')](_0x2592c2['query']['fields']));_0x3cf010['attributes']=_0x3cf010[_0x34d1('0x2c')]['length']?_0x3cf010[_0x34d1('0x2c')]:_0x7fbcc9[_0x34d1('0x28')];if(_0x2592c2[_0x34d1('0x2a')][_0x34d1('0x3b')]){_0x3cf010['include']=[{'all':!![]}];}_0x3cf010=_['merge']({},_0x3cf010,_0x2592c2[_0x34d1('0x36')]);return db[_0x34d1('0x25')][_0x34d1('0x3c')](_0x3cf010)[_0x34d1('0x1d')](handleEntityNotFound(_0x3dc9ae,null))[_0x34d1('0x1d')](respondWithResult(_0x3dc9ae,null))['catch'](handleError(_0x3dc9ae,null));};exports[_0x34d1('0x3d')]=function(_0x5e5f15,_0x305a98){return db[_0x34d1('0x25')][_0x34d1('0x3d')](_0x5e5f15[_0x34d1('0x3e')],{})[_0x34d1('0x1d')](respondWithResult(_0x305a98,0xc9))[_0x34d1('0x3f')](handleError(_0x305a98,null));};exports[_0x34d1('0x1c')]=function(_0xb36e25,_0x2f366e){if(_0xb36e25[_0x34d1('0x3e')]['id']){delete _0xb36e25[_0x34d1('0x3e')]['id'];}return db[_0x34d1('0x25')][_0x34d1('0x3c')]({'where':{'id':_0xb36e25[_0x34d1('0x39')]['id']}})[_0x34d1('0x1d')](handleEntityNotFound(_0x2f366e,null))[_0x34d1('0x1d')](saveUpdates(_0xb36e25['body'],null))['then'](respondWithResult(_0x2f366e,null))[_0x34d1('0x3f')](handleError(_0x2f366e,null));};exports[_0x34d1('0x1e')]=function(_0x3630de,_0x55955e){return db[_0x34d1('0x25')][_0x34d1('0x3c')]({'where':{'id':_0x3630de[_0x34d1('0x39')]['id']}})['then'](handleEntityNotFound(_0x55955e,null))['then'](removeEntity(_0x55955e,null))[_0x34d1('0x3f')](handleError(_0x55955e,null));};exports[_0x34d1('0x40')]=function(_0x152230,_0x3331a1){return db[_0x34d1('0x25')][_0x34d1('0x40')]()[_0x34d1('0x1d')](respondWithResult(_0x3331a1,null))['catch'](handleError(_0x3331a1,null));}; \ No newline at end of file +var _0x1cfc=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','keys','options','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x4fc702,_0x590060){var _0x1357d3=function(_0x45a119){while(--_0x45a119){_0x4fc702['push'](_0x4fc702['shift']());}};_0x1357d3(++_0x590060);}(_0x1cfc,0x85));var _0xc1cf=function(_0x6a960a,_0x1d2e3c){_0x6a960a=_0x6a960a-0x0;var _0x2758da=_0x1cfc[_0x6a960a];return _0x2758da;};'use strict';var emlformat=require(_0xc1cf('0x0'));var rimraf=require(_0xc1cf('0x1'));var zipdir=require(_0xc1cf('0x2'));var jsonpatch=require(_0xc1cf('0x3'));var rp=require(_0xc1cf('0x4'));var moment=require(_0xc1cf('0x5'));var BPromise=require(_0xc1cf('0x6'));var Mustache=require(_0xc1cf('0x7'));var util=require(_0xc1cf('0x8'));var path=require(_0xc1cf('0x9'));var sox=require(_0xc1cf('0xa'));var csv=require(_0xc1cf('0xb'));var ejs=require(_0xc1cf('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc1cf('0xd'));var squel=require('squel');var crypto=require(_0xc1cf('0xe'));var jsforce=require(_0xc1cf('0xf'));var deskjs=require(_0xc1cf('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc1cf('0x11'));var Papa=require(_0xc1cf('0x12'));var Redis=require('ioredis');var authService=require(_0xc1cf('0x13'));var qs=require(_0xc1cf('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc1cf('0x15'));var logger=require(_0xc1cf('0x16'))(_0xc1cf('0x17'));var utils=require(_0xc1cf('0x18'));var config=require(_0xc1cf('0x19'));var licenseUtil=require(_0xc1cf('0x1a'));var db=require(_0xc1cf('0x1b'))['db'];function respondWithStatusCode(_0x12cb77,_0x582ff4){_0x582ff4=_0x582ff4||0xcc;return function(_0x3b5018){if(_0x3b5018){return _0x12cb77['sendStatus'](_0x582ff4);}return _0x12cb77[_0xc1cf('0x1c')](_0x582ff4)[_0xc1cf('0x1d')]();};}function respondWithResult(_0x1c96a5,_0x1fcafa){_0x1fcafa=_0x1fcafa||0xc8;return function(_0x4eef75){if(_0x4eef75){return _0x1c96a5[_0xc1cf('0x1c')](_0x1fcafa)[_0xc1cf('0x1e')](_0x4eef75);}};}function respondWithFilteredResult(_0x430fba,_0x35fadf){return function(_0x1e87a4){if(_0x1e87a4){var _0x35bec7=typeof _0x35fadf['offset']==='undefined'&&typeof _0x35fadf['limit']===_0xc1cf('0x1f');var _0x4d2be7=_0x1e87a4[_0xc1cf('0x20')];var _0x31768c=_0x35bec7?0x0:_0x35fadf['offset'];var _0x3d0ee4=_0x35bec7?_0x1e87a4[_0xc1cf('0x20')]:_0x35fadf[_0xc1cf('0x21')]+_0x35fadf[_0xc1cf('0x22')];var _0x280ada;if(_0x3d0ee4>=_0x4d2be7){_0x3d0ee4=_0x4d2be7;_0x280ada=0xc8;}else{_0x280ada=0xce;}_0x430fba[_0xc1cf('0x1c')](_0x280ada);return _0x430fba['set'](_0xc1cf('0x23'),_0x31768c+'-'+_0x3d0ee4+'/'+_0x4d2be7)[_0xc1cf('0x1e')](_0x1e87a4);}return null;};}function patchUpdates(_0x31804b){return function(_0x2c146a){try{jsonpatch[_0xc1cf('0x24')](_0x2c146a,_0x31804b,!![]);}catch(_0x2da10c){return BPromise[_0xc1cf('0x25')](_0x2da10c);}return _0x2c146a[_0xc1cf('0x26')]();};}function saveUpdates(_0x2d2933,_0x5aac80){return function(_0x685021){if(_0x685021){return _0x685021[_0xc1cf('0x27')](_0x2d2933)[_0xc1cf('0x28')](function(_0x2d4c34){return _0x2d4c34;});}return null;};}function removeEntity(_0x51e9c1,_0x54745e){return function(_0x8304b5){if(_0x8304b5){return _0x8304b5[_0xc1cf('0x29')]()['then'](function(){_0x51e9c1[_0xc1cf('0x1c')](0xcc)[_0xc1cf('0x1d')]();});}};}function handleEntityNotFound(_0x5162f2,_0x34b687){return function(_0x689e29){if(!_0x689e29){_0x5162f2['sendStatus'](0x194);}return _0x689e29;};}function handleError(_0x3c7bb0,_0x1c6b5a){_0x1c6b5a=_0x1c6b5a||0x1f4;return function(_0x31a2d3){logger[_0xc1cf('0x2a')](_0x31a2d3['stack']);if(_0x31a2d3[_0xc1cf('0x2b')]){delete _0x31a2d3[_0xc1cf('0x2b')];}_0x3c7bb0[_0xc1cf('0x1c')](_0x1c6b5a)['send'](_0x31a2d3);};}exports[_0xc1cf('0x2c')]=function(_0x14822f,_0x289a16){var _0x17bdb9={},_0x4eda5c={},_0xed5d98={'count':0x0,'rows':[]};var _0x54e5a3=_[_0xc1cf('0x2d')](db[_0xc1cf('0x2e')][_0xc1cf('0x2f')],function(_0x38f81f){return{'name':_0x38f81f[_0xc1cf('0x30')],'type':_0x38f81f[_0xc1cf('0x31')][_0xc1cf('0x32')]};});_0x4eda5c[_0xc1cf('0x33')]=_['map'](_0x54e5a3,_0xc1cf('0x2b'));_0x4eda5c[_0xc1cf('0x34')]=_['keys'](_0x14822f[_0xc1cf('0x34')]);_0x4eda5c[_0xc1cf('0x35')]=_[_0xc1cf('0x36')](_0x4eda5c[_0xc1cf('0x33')],_0x4eda5c[_0xc1cf('0x34')]);_0x17bdb9[_0xc1cf('0x37')]=_[_0xc1cf('0x36')](_0x4eda5c['model'],qs[_0xc1cf('0x38')](_0x14822f[_0xc1cf('0x34')][_0xc1cf('0x38')]));_0x17bdb9[_0xc1cf('0x37')]=_0x17bdb9[_0xc1cf('0x37')][_0xc1cf('0x39')]?_0x17bdb9[_0xc1cf('0x37')]:_0x4eda5c[_0xc1cf('0x33')];if(!_0x14822f[_0xc1cf('0x34')]['hasOwnProperty']('nolimit')){_0x17bdb9[_0xc1cf('0x22')]=qs[_0xc1cf('0x22')](_0x14822f[_0xc1cf('0x34')][_0xc1cf('0x22')]);_0x17bdb9['offset']=qs[_0xc1cf('0x21')](_0x14822f[_0xc1cf('0x34')][_0xc1cf('0x21')]);}_0x17bdb9[_0xc1cf('0x3a')]=qs[_0xc1cf('0x3b')](_0x14822f[_0xc1cf('0x34')][_0xc1cf('0x3b')]);_0x17bdb9[_0xc1cf('0x3c')]=qs[_0xc1cf('0x35')](_[_0xc1cf('0x3d')](_0x14822f['query'],_0x4eda5c[_0xc1cf('0x35')]),_0x54e5a3);if(_0x14822f[_0xc1cf('0x34')][_0xc1cf('0x3e')]){_0x17bdb9[_0xc1cf('0x3c')]=_[_0xc1cf('0x3f')](_0x17bdb9['where'],{'$or':_[_0xc1cf('0x2d')](_0x54e5a3,function(_0x298206){if(_0x298206[_0xc1cf('0x31')]!=='VIRTUAL'){var _0x42e861={};_0x42e861[_0x298206[_0xc1cf('0x2b')]]={'$like':'%'+_0x14822f[_0xc1cf('0x34')]['filter']+'%'};return _0x42e861;}})});}_0x17bdb9=_['merge']({},_0x17bdb9,_0x14822f['options']);var _0x471b03={'where':_0x17bdb9['where']};return db[_0xc1cf('0x2e')][_0xc1cf('0x20')](_0x471b03)['then'](function(_0x23cd3e){_0xed5d98[_0xc1cf('0x20')]=_0x23cd3e;if(_0x14822f[_0xc1cf('0x34')][_0xc1cf('0x40')]){_0x17bdb9[_0xc1cf('0x41')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x17bdb9);})[_0xc1cf('0x28')](function(_0x516ff2){_0xed5d98[_0xc1cf('0x42')]=_0x516ff2;return _0xed5d98;})['then'](respondWithFilteredResult(_0x289a16,_0x17bdb9))[_0xc1cf('0x43')](handleError(_0x289a16,null));};exports[_0xc1cf('0x44')]=function(_0x5a53fd,_0x3c3d79){var _0x4f3d69={'raw':!![],'where':{'id':_0x5a53fd['params']['id']}},_0x3c399a={};_0x3c399a[_0xc1cf('0x33')]=_['keys'](db[_0xc1cf('0x2e')]['rawAttributes']);_0x3c399a['query']=_[_0xc1cf('0x45')](_0x5a53fd[_0xc1cf('0x34')]);_0x3c399a[_0xc1cf('0x35')]=_[_0xc1cf('0x36')](_0x3c399a['model'],_0x3c399a['query']);_0x4f3d69['attributes']=_['intersection'](_0x3c399a[_0xc1cf('0x33')],qs[_0xc1cf('0x38')](_0x5a53fd['query'][_0xc1cf('0x38')]));_0x4f3d69['attributes']=_0x4f3d69['attributes'][_0xc1cf('0x39')]?_0x4f3d69[_0xc1cf('0x37')]:_0x3c399a[_0xc1cf('0x33')];if(_0x5a53fd[_0xc1cf('0x34')]['includeAll']){_0x4f3d69[_0xc1cf('0x41')]=[{'all':!![]}];}_0x4f3d69=_[_0xc1cf('0x3f')]({},_0x4f3d69,_0x5a53fd[_0xc1cf('0x46')]);return db[_0xc1cf('0x2e')]['find'](_0x4f3d69)[_0xc1cf('0x28')](handleEntityNotFound(_0x3c3d79,null))[_0xc1cf('0x28')](respondWithResult(_0x3c3d79,null))[_0xc1cf('0x43')](handleError(_0x3c3d79,null));};exports[_0xc1cf('0x47')]=function(_0x2e2460,_0x1478df){return db[_0xc1cf('0x2e')]['create'](_0x2e2460[_0xc1cf('0x48')],{})[_0xc1cf('0x28')](respondWithResult(_0x1478df,0xc9))['catch'](handleError(_0x1478df,null));};exports[_0xc1cf('0x27')]=function(_0x1558f3,_0x62d047){if(_0x1558f3[_0xc1cf('0x48')]['id']){delete _0x1558f3[_0xc1cf('0x48')]['id'];}return db[_0xc1cf('0x2e')][_0xc1cf('0x49')]({'where':{'id':_0x1558f3[_0xc1cf('0x4a')]['id']}})[_0xc1cf('0x28')](handleEntityNotFound(_0x62d047,null))['then'](saveUpdates(_0x1558f3[_0xc1cf('0x48')],null))[_0xc1cf('0x28')](respondWithResult(_0x62d047,null))['catch'](handleError(_0x62d047,null));};exports['destroy']=function(_0x1625ca,_0x3e25f6){return db[_0xc1cf('0x2e')]['find']({'where':{'id':_0x1625ca[_0xc1cf('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3e25f6,null))[_0xc1cf('0x28')](removeEntity(_0x3e25f6,null))[_0xc1cf('0x43')](handleError(_0x3e25f6,null));};exports[_0xc1cf('0x4b')]=function(_0x92c64f,_0x4f66ad){return db[_0xc1cf('0x2e')]['describe']()[_0xc1cf('0x28')](respondWithResult(_0x4f66ad,null))['catch'](handleError(_0x4f66ad,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 49c14fb..f394958 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 _0xe8ea=['define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x2b6a67,_0xae2af){var _0x393c8b=function(_0x16a97f){while(--_0x16a97f){_0x2b6a67['push'](_0x2b6a67['shift']());}};_0x393c8b(++_0xae2af);}(_0xe8ea,0x1cb));var _0xae8e=function(_0x3449b3,_0x10ed6e){_0x3449b3=_0x3449b3-0x0;var _0x4ff9ef=_0xe8ea[_0x3449b3];return _0x4ff9ef;};'use strict';var _=require(_0xae8e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xae8e('0x1'));var moment=require(_0xae8e('0x2'));var BPromise=require(_0xae8e('0x3'));var rp=require(_0xae8e('0x4'));var fs=require('fs');var path=require(_0xae8e('0x5'));var rimraf=require(_0xae8e('0x6'));var config=require(_0xae8e('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0xae8e('0x8')]=function(_0xcea244,_0x3182d3){return _0xcea244[_0xae8e('0x9')](_0xae8e('0xa'),attributes,{'tableName':_0xae8e('0xb'),'paranoid':![],'indexes':[{'name':_0xae8e('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xaf4a=['define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports'];(function(_0x122e9b,_0x391bf4){var _0x22c247=function(_0x1b2c65){while(--_0x1b2c65){_0x122e9b['push'](_0x122e9b['shift']());}};_0x22c247(++_0x391bf4);}(_0xaf4a,0x74));var _0xaaf4=function(_0x289c79,_0x2d17ba){_0x289c79=_0x289c79-0x0;var _0x2ad590=_0xaf4a[_0x289c79];return _0x2ad590;};'use strict';var _=require(_0xaaf4('0x0'));var util=require(_0xaaf4('0x1'));var logger=require(_0xaaf4('0x2'))(_0xaaf4('0x3'));var moment=require(_0xaaf4('0x4'));var BPromise=require(_0xaaf4('0x5'));var rp=require(_0xaaf4('0x6'));var fs=require('fs');var path=require(_0xaaf4('0x7'));var rimraf=require(_0xaaf4('0x8'));var config=require(_0xaaf4('0x9'));var attributes=require(_0xaaf4('0xa'));module[_0xaaf4('0xb')]=function(_0x1b3716,_0x10e716){return _0x1b3716[_0xaaf4('0xc')](_0xaaf4('0xd'),attributes,{'tableName':_0xaaf4('0xe'),'paranoid':![],'indexes':[{'name':_0xaaf4('0xf'),'fields':[_0xaaf4('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 7945d3d..2a5f95f 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 _0xcff3=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x40e170,_0x3f5e22){var _0x3857fa=function(_0x1013ae){while(--_0x1013ae){_0x40e170['push'](_0x40e170['shift']());}};_0x3857fa(++_0x3f5e22);}(_0xcff3,0x101));var _0x3cff=function(_0x13b330,_0x297092){_0x13b330=_0x13b330-0x0;var _0x1f666c=_0xcff3[_0x13b330];return _0x1f666c;};'use strict';var _=require(_0x3cff('0x0'));var util=require(_0x3cff('0x1'));var moment=require(_0x3cff('0x2'));var BPromise=require(_0x3cff('0x3'));var rs=require(_0x3cff('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3cff('0x5'))['db'];var utils=require(_0x3cff('0x6'));var logger=require(_0x3cff('0x7'))(_0x3cff('0x8'));var config=require(_0x3cff('0x9'));var jayson=require(_0x3cff('0xa'));var client=jayson[_0x3cff('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57c51e,_0x27a250,_0xf8c6b){return new BPromise(function(_0x4e7857,_0x18658c){return client['request'](_0x57c51e,_0xf8c6b)[_0x3cff('0xc')](function(_0x287081){logger[_0x3cff('0xd')](_0x3cff('0xe'),_0x27a250,_0x3cff('0xf'));logger[_0x3cff('0x10')](_0x3cff('0x11'),_0x27a250,'request\x20sent',JSON[_0x3cff('0x12')](_0x287081));if(_0x287081[_0x3cff('0x13')]){if(_0x287081[_0x3cff('0x13')][_0x3cff('0x14')]===0x1f4){logger[_0x3cff('0x13')](_0x3cff('0xe'),_0x27a250,_0x287081['error'][_0x3cff('0x15')]);return _0x18658c(_0x287081[_0x3cff('0x13')][_0x3cff('0x15')]);}logger[_0x3cff('0x13')](_0x3cff('0xe'),_0x27a250,_0x287081[_0x3cff('0x13')][_0x3cff('0x15')]);return _0x4e7857(_0x287081[_0x3cff('0x13')][_0x3cff('0x15')]);}else{logger[_0x3cff('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x27a250,_0x3cff('0xf'));_0x4e7857(_0x287081[_0x3cff('0x16')][_0x3cff('0x15')]);}})[_0x3cff('0x17')](function(_0x2d62cc){logger[_0x3cff('0x13')](_0x3cff('0xe'),_0x27a250,_0x2d62cc);_0x18658c(_0x2d62cc);});});} \ No newline at end of file +var _0xdac0=['result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x50c8b9,_0x1c4951){var _0x3f184e=function(_0x2627c5){while(--_0x2627c5){_0x50c8b9['push'](_0x50c8b9['shift']());}};_0x3f184e(++_0x1c4951);}(_0xdac0,0x152));var _0x0dac=function(_0x528e77,_0x272034){_0x528e77=_0x528e77-0x0;var _0x2b858a=_0xdac0[_0x528e77];return _0x2b858a;};'use strict';var _=require(_0x0dac('0x0'));var util=require('util');var moment=require(_0x0dac('0x1'));var BPromise=require(_0x0dac('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0dac('0x3'));var db=require(_0x0dac('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0dac('0x5'))(_0x0dac('0x6'));var config=require('../../config/environment');var jayson=require(_0x0dac('0x7'));var client=jayson[_0x0dac('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x927883,_0x302a5c,_0x10d6e3){return new BPromise(function(_0x4a8fd8,_0x11a8d9){return client[_0x0dac('0x9')](_0x927883,_0x10d6e3)['then'](function(_0x423c87){logger[_0x0dac('0xa')](_0x0dac('0xb'),_0x302a5c,_0x0dac('0xc'));logger[_0x0dac('0xd')](_0x0dac('0xe'),_0x302a5c,_0x0dac('0xc'),JSON[_0x0dac('0xf')](_0x423c87));if(_0x423c87[_0x0dac('0x10')]){if(_0x423c87[_0x0dac('0x10')][_0x0dac('0x11')]===0x1f4){logger[_0x0dac('0x10')](_0x0dac('0xb'),_0x302a5c,_0x423c87[_0x0dac('0x10')]['message']);return _0x11a8d9(_0x423c87[_0x0dac('0x10')][_0x0dac('0x12')]);}logger['error'](_0x0dac('0xb'),_0x302a5c,_0x423c87[_0x0dac('0x10')][_0x0dac('0x12')]);return _0x4a8fd8(_0x423c87[_0x0dac('0x10')]['message']);}else{logger[_0x0dac('0xa')](_0x0dac('0xb'),_0x302a5c,'request\x20sent');_0x4a8fd8(_0x423c87[_0x0dac('0x13')][_0x0dac('0x12')]);}})[_0x0dac('0x14')](function(_0x266242){logger['error'](_0x0dac('0xb'),_0x302a5c,_0x266242);_0x11a8d9(_0x266242);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 255e502..8ae2660 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 _0x4f65=['create','put','update','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x44747b,_0x59d77c){var _0x81365f=function(_0x1a11bc){while(--_0x1a11bc){_0x44747b['push'](_0x44747b['shift']());}};_0x81365f(++_0x59d77c);}(_0x4f65,0x83));var _0x54f6=function(_0x326f2c,_0xf8ae42){_0x326f2c=_0x326f2c-0x0;var _0x4f2723=_0x4f65[_0x326f2c];return _0x4f2723;};'use strict';var multer=require(_0x54f6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x54f6('0x1'));var express=require(_0x54f6('0x2'));var router=express[_0x54f6('0x3')]();var fs_extra=require(_0x54f6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x54f6('0x5'));var config=require(_0x54f6('0x6'));var controller=require(_0x54f6('0x7'));router[_0x54f6('0x8')]('/',auth[_0x54f6('0x9')](),controller[_0x54f6('0xa')]);router[_0x54f6('0x8')](_0x54f6('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x54f6('0xc'),auth[_0x54f6('0x9')](),controller['show']);router['post']('/',auth[_0x54f6('0x9')](),controller[_0x54f6('0xd')]);router[_0x54f6('0xe')](_0x54f6('0xc'),auth[_0x54f6('0x9')](),controller[_0x54f6('0xf')]);router['delete'](_0x54f6('0xc'),auth[_0x54f6('0x9')](),controller[_0x54f6('0x10')]);module[_0x54f6('0x11')]=router; \ No newline at end of file +var _0xbaad=['../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3dc56a,_0x407515){var _0x201c74=function(_0x447605){while(--_0x447605){_0x3dc56a['push'](_0x3dc56a['shift']());}};_0x201c74(++_0x407515);}(_0xbaad,0x15d));var _0xdbaa=function(_0x592ca9,_0x426497){_0x592ca9=_0x592ca9-0x0;var _0x360721=_0xbaad[_0x592ca9];return _0x360721;};'use strict';var multer=require(_0xdbaa('0x0'));var util=require(_0xdbaa('0x1'));var path=require(_0xdbaa('0x2'));var timeout=require(_0xdbaa('0x3'));var express=require(_0xdbaa('0x4'));var router=express[_0xdbaa('0x5')]();var fs_extra=require(_0xdbaa('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xdbaa('0x7'));var config=require(_0xdbaa('0x8'));var controller=require(_0xdbaa('0x9'));router[_0xdbaa('0xa')]('/',auth[_0xdbaa('0xb')](),controller['index']);router[_0xdbaa('0xa')](_0xdbaa('0xc'),auth[_0xdbaa('0xb')](),controller[_0xdbaa('0xd')]);router['get']('/:id',auth[_0xdbaa('0xb')](),controller[_0xdbaa('0xe')]);router[_0xdbaa('0xf')]('/',auth['isAuthenticated'](),controller[_0xdbaa('0x10')]);router[_0xdbaa('0x11')](_0xdbaa('0x12'),auth[_0xdbaa('0xb')](),controller[_0xdbaa('0x13')]);router['delete'](_0xdbaa('0x12'),auth[_0xdbaa('0xb')](),controller[_0xdbaa('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index e9b57e3..d822522 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 _0x91a7=['rounded','squared','We\x20are\x20here!','Send','INTEGER','Powered\x20by\x20xCALLY','TEXT','Form\x20submission\x20error','Note','Type\x20a\x20message','Feedback','ENUM','star','thumb','stringify','input','name','text','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','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:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','website_alias','bottom_right','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN'];(function(_0x1f11bc,_0x4dd926){var _0xab5070=function(_0x347548){while(--_0x347548){_0x1f11bc['push'](_0x1f11bc['shift']());}};_0xab5070(++_0x4dd926);}(_0x91a7,0xe7));var _0x791a=function(_0x31bdc4,_0xf6f99a){_0x31bdc4=_0x31bdc4-0x0;var _0x1e2895=_0x91a7[_0x31bdc4];return _0x1e2895;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x791a('0x0'));module[_0x791a('0x1')]={'name':{'type':Sequelize[_0x791a('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x791a('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x791a('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x791a('0x4')},'key':{'type':Sequelize[_0x791a('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x791a('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x791a('0x2')],'allowNull':![],'defaultValue':_0x791a('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x791a('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x791a('0x2')],'allowNull':![],'defaultValue':_0x791a('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x791a('0x2')],'allowNull':![],'defaultValue':_0x791a('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x791a('0x2')]},'animation':{'type':Sequelize[_0x791a('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x791a('0x9'),_0x791a('0xa')),'defaultValue':_0x791a('0x9')},'header_online':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0xb')},'start_chat_button':{'type':Sequelize[_0x791a('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x791a('0xc')},'header_offline':{'type':Sequelize[_0x791a('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x791a('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x791a('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x791a('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x791a('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x791a('0xf')]},'closingQuestion':{'type':Sequelize[_0x791a('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x791a('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0x10')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x791a('0x11')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x791a('0x12')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x791a('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x791a('0x13')},'ratingType':{'type':Sequelize[_0x791a('0x14')](_0x791a('0x15'),_0x791a('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x791a('0xd')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x791a('0xf')],'defaultValue':function(){return JSON[_0x791a('0x17')]({'items':[{'type':_0x791a('0x18'),'variable':null,'config':{'placeholder':_0x791a('0x19'),'type':_0x791a('0x1a'),'required':!![]},'props':{'title':_0x791a('0x19'),'helpText':''}},{'type':_0x791a('0x18'),'props':{'title':_0x791a('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x791a('0x4'),'type':_0x791a('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x791a('0x1b'))?JSON[_0x791a('0x1c')](this[_0x791a('0x1d')](_0x791a('0x1b'))):{};},'set':function(_0x4d748a){return this[_0x791a('0x1e')](_0x791a('0x1b'),JSON['stringify'](_0x4d748a));}},'offlineForm':{'type':Sequelize[_0x791a('0xf')],'defaultValue':function(){return JSON[_0x791a('0x17')]({'items':[{'type':_0x791a('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x791a('0x4'),'type':_0x791a('0x4')},'variable':null},{'type':_0x791a('0x1f'),'config':{'placeholder':_0x791a('0x20')},'props':{'title':_0x791a('0x20'),'helpText':_0x791a('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x791a('0x1d')](_0x791a('0x22'))?JSON['parse'](this[_0x791a('0x1d')](_0x791a('0x22'))):{};},'set':function(_0x1b10a7){return this['setDataValue'](_0x791a('0x22'),JSON['stringify'](_0x1b10a7));}},'token':{'type':Sequelize[_0x791a('0x2')],'defaultValue':function(){return rs[_0x791a('0x23')]();}},'autoclose':{'type':Sequelize[_0x791a('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x791a('0x2')]},'forwardOffline':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0x24')},'waitingMessage':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x791a('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x791a('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0x27')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x791a('0x28')},'sendUnmanaged':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x791a('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x791a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x791a('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x791a('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x791a('0x2')]},'customerAvatar':{'type':Sequelize[_0x791a('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x791a('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x791a('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x791a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x791a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0x2b')},'systemAvatar':{'type':Sequelize[_0x791a('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x791a('0xd')],'comment':_0x791a('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x15f066){if(!_0x15f066)this[_0x791a('0x1e')](_0x791a('0x2d'),null);this['setDataValue'](_0x791a('0x2e'),_0x15f066);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x791a('0x2f')},'vidaooNote':{'type':Sequelize[_0x791a('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x791a('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x791a('0xf')]}}; \ No newline at end of file +var _0xedd9=['mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Type\x20a\x20message','Skip','star','thumb','stringify','input','text','name','getDataValue','onlineForm','parse','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x196ce1,_0x46e836){var _0x360a64=function(_0x3f339f){while(--_0x3f339f){_0x196ce1['push'](_0x196ce1['shift']());}};_0x360a64(++_0x46e836);}(_0xedd9,0xfc));var _0x9edd=function(_0x57d740,_0x50be99){_0x57d740=_0x57d740-0x0;var _0x6607ef=_0xedd9[_0x57d740];return _0x6607ef;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'name':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![],'unique':_0x9edd('0x3')},'description':{'type':Sequelize[_0x9edd('0x2')]},'mapKey':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x9edd('0x4')},'key':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![],'defaultValue':_0x9edd('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![],'defaultValue':_0x9edd('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9edd('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x9edd('0x2')]},'animation':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x9edd('0x9'),_0x9edd('0xa')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0xb')},'start_chat_button':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0xc')},'offline_chat_button':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0xd')},'header_offline':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x9edd('0xf')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x9edd('0x11')]},'closingQuestion':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x13')},'noteTitle':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x14')},'closingMessage':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM'](_0x9edd('0x16'),_0x9edd('0x17')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x9edd('0x11')],'defaultValue':function(){return JSON[_0x9edd('0x18')]({'items':[{'type':_0x9edd('0x19'),'variable':null,'config':{'placeholder':'name','type':_0x9edd('0x1a'),'required':!![]},'props':{'title':_0x9edd('0x1b'),'helpText':''}},{'type':_0x9edd('0x19'),'props':{'title':_0x9edd('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x9edd('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x9edd('0x1c')](_0x9edd('0x1d'))?JSON[_0x9edd('0x1e')](this[_0x9edd('0x1c')](_0x9edd('0x1d'))):{};},'set':function(_0x4d507f){return this['setDataValue'](_0x9edd('0x1d'),JSON[_0x9edd('0x18')](_0x4d507f));}},'offlineForm':{'type':Sequelize[_0x9edd('0x11')],'defaultValue':function(){return JSON[_0x9edd('0x18')]({'items':[{'type':_0x9edd('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x9edd('0x4')},'variable':null},{'type':_0x9edd('0x1f'),'config':{'placeholder':_0x9edd('0x20')},'props':{'title':'Comments','helpText':_0x9edd('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x9edd('0x1c')](_0x9edd('0x22'))?JSON[_0x9edd('0x1e')](this['getDataValue'](_0x9edd('0x22'))):{};},'set':function(_0x3fb556){return this[_0x9edd('0x23')](_0x9edd('0x22'),JSON[_0x9edd('0x18')](_0x3fb556));}},'token':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':function(){return rs[_0x9edd('0x24')]();}},'autoclose':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x9edd('0x2')]},'forwardOffline':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x9edd('0x2')]},'waitingTitle':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9edd('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x27')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x9edd('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x29')},'skipUnmanaged':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x15')},'sendUnmanaged':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x9edd('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x9edd('0x2')]},'notificationTemplate':{'type':Sequelize[_0x9edd('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x9edd('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x9edd('0xf')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x2b')},'messagesAlignment':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x2c')},'defaultTitle':{'type':Sequelize[_0x9edd('0x2')]},'customerAvatar':{'type':Sequelize[_0x9edd('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x9edd('0xf')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x2d')},'systemAvatar':{'type':Sequelize[_0x9edd('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x9edd('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![],'comment':_0x9edd('0x2f'),'set':function(_0x48958a){if(!_0x48958a)this[_0x9edd('0x23')]('mandatoryDispositionPauseId',null);this[_0x9edd('0x23')](_0x9edd('0x30'),_0x48958a);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x9edd('0x2')]},'vidaooTopic':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![],'defaultValue':_0x9edd('0x31')},'vidaooNote':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x9edd('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x9edd('0x11')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 188a68b..6bae009 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 _0xa137=['Transaction','ISOLATION_LEVELS','READ_COMMITTED','destroy','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','getFields','online','false','onlineForm','fromKey','ChatOfflineMessage','Attachments','addAgents','userChatWebsite:save','removeAgents','emit','userChatWebsite:remove','getAgents','bluebird','mustache','util','ejs','fs-extra','lodash','ioredis','../../components/parsers/qs','api','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','http','client','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','create','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','rawAttributes','pick','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','filename','addAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','agentAvatar','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','ChatApplication','Applications','applications','list','orderBy','asc','account','ListId','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','originalname','mimetype','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','License','chatLicenseExceeded','push','all','some','server/files/chat/iframe.ejs','x-real-ip','connection','remoteAddress','render','alignment','verticalAlignment','labelText','textButtonColor','color_button','transaction'];(function(_0x53b5e5,_0xc27f6f){var _0x542342=function(_0xcddd50){while(--_0xcddd50){_0x53b5e5['push'](_0x53b5e5['shift']());}};_0x542342(++_0xc27f6f);}(_0xa137,0x13f));var _0x7a13=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xa137[_0x4e676e];return _0x336a3c;};'use strict';var BPromise=require(_0x7a13('0x0'));var Mustache=require(_0x7a13('0x1'));var util=require(_0x7a13('0x2'));var path=require('path');var ejs=require(_0x7a13('0x3'));var fs=require('fs');var fs_extra=require(_0x7a13('0x4'));var _=require(_0x7a13('0x5'));var querystring=require('querystring');var Redis=require(_0x7a13('0x6'));var qs=require(_0x7a13('0x7'));var logger=require('../../config/logger')(_0x7a13('0x8'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x7a13('0x9')]=_[_0x7a13('0xa')](config['redis'],{'host':_0x7a13('0xb'),'port':0x18eb});var socket=require(_0x7a13('0xc'))(new Redis(config[_0x7a13('0x9')]));require(_0x7a13('0xd'))[_0x7a13('0xe')](socket);var htmlToText=require(_0x7a13('0xf'));var jayson=require(_0x7a13('0x10'));var client=jayson['client'][_0x7a13('0x11')]({'port':0x232c});var client9002=jayson[_0x7a13('0x12')][_0x7a13('0x11')]({'port':0x232a});var client9003=jayson['client'][_0x7a13('0x11')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x1ace2a,_0x3ca95b,_0xeb5d7b,_0x3b8c2){return new BPromise(function(_0x4003c5,_0x5b18f4){var _0x5296c2=_0x3b8c2||client;return _0x5296c2['request'](_0x1ace2a,_0xeb5d7b)['then'](function(_0x5bb654){logger[_0x7a13('0x13')](_0x7a13('0x14'),_0x3ca95b,_0x7a13('0x15'));logger['debug'](_0x7a13('0x16'),_0x3ca95b,_0x7a13('0x15'),JSON[_0x7a13('0x17')](_0x5bb654));if(_0x5bb654[_0x7a13('0x18')]){if(_0x5bb654[_0x7a13('0x18')][_0x7a13('0x19')]===0x1f4){logger['error'](_0x7a13('0x14'),_0x3ca95b,_0x5bb654[_0x7a13('0x18')]['message']);return _0x5b18f4(_0x5bb654[_0x7a13('0x18')][_0x7a13('0x1a')]);}logger[_0x7a13('0x18')](_0x7a13('0x14'),_0x3ca95b,_0x5bb654['error'][_0x7a13('0x1a')]);return _0x4003c5(_0x5bb654[_0x7a13('0x18')]['message']);}else{logger[_0x7a13('0x13')](_0x7a13('0x14'),_0x3ca95b,_0x7a13('0x15'));_0x4003c5(_0x5bb654['result']['message']);}})['catch'](function(_0x47a684){logger[_0x7a13('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x3ca95b,_0x47a684);_0x5b18f4(_0x47a684);});});}function respondWithStatusCode(_0x18778f,_0x281394){_0x281394=_0x281394||0xcc;return function(_0x1d1878){if(_0x1d1878){return _0x18778f[_0x7a13('0x1b')](_0x281394);}return _0x18778f[_0x7a13('0x1c')](_0x281394)[_0x7a13('0x1d')]();};}function respondWithResult(_0x146fff,_0x5a11b0){_0x5a11b0=_0x5a11b0||0xc8;return function(_0x1a8b62){if(_0x1a8b62){return _0x146fff[_0x7a13('0x1c')](_0x5a11b0)[_0x7a13('0x1e')](_0x1a8b62);}};}function respondWithFilteredResult(_0x189700,_0x50552e){return function(_0x1e23cb){if(_0x1e23cb){var _0x2ea051=typeof _0x50552e[_0x7a13('0x1f')]===_0x7a13('0x20')&&typeof _0x50552e[_0x7a13('0x21')]==='undefined';var _0xe8c9ea=_0x1e23cb[_0x7a13('0x22')];var _0x49dc88=_0x2ea051?0x0:_0x50552e[_0x7a13('0x1f')];var _0x30be21=_0x2ea051?_0x1e23cb[_0x7a13('0x22')]:_0x50552e[_0x7a13('0x1f')]+_0x50552e[_0x7a13('0x21')];var _0x23bf65;if(_0x30be21>=_0xe8c9ea){_0x30be21=_0xe8c9ea;_0x23bf65=0xc8;}else{_0x23bf65=0xce;}_0x189700['status'](_0x23bf65);return _0x189700[_0x7a13('0x23')](_0x7a13('0x24'),_0x49dc88+'-'+_0x30be21+'/'+_0xe8c9ea)['json'](_0x1e23cb);}return null;};}function saveUpdates(_0x24c380){return function(_0x591575){if(_0x591575){return _0x591575[_0x7a13('0x25')](_0x24c380)[_0x7a13('0x26')](function(_0x18ae37){return _0x18ae37;});}return null;};}function removeEntity(_0x1a1750){return function(_0xf631ea){if(_0xf631ea){return _0xf631ea['destroy']()[_0x7a13('0x26')](function(){var _0x2075b8=_0xf631ea[_0x7a13('0x27')]({'plain':!![]});var _0x2b564b=_0x7a13('0x28');return db[_0x7a13('0x29')]['destroy']({'where':{'type':_0x2b564b,'resourceId':_0x2075b8['id']}})[_0x7a13('0x26')](function(){return _0xf631ea;});})['then'](function(){_0x1a1750[_0x7a13('0x1c')](0xcc)[_0x7a13('0x1d')]();});}};}function handleEntityNotFound(_0xeeb5b9){return function(_0x4d8a7a){if(!_0x4d8a7a){_0xeeb5b9[_0x7a13('0x1b')](0x194);}return _0x4d8a7a;};}function handleError(_0x2bc1dc,_0x59ef27){_0x59ef27=_0x59ef27||0x1f4;return function(_0x336042){logger[_0x7a13('0x18')](_0x336042[_0x7a13('0x2a')]);if(_0x336042[_0x7a13('0x2b')]){delete _0x336042['name'];}_0x2bc1dc[_0x7a13('0x1c')](_0x59ef27)[_0x7a13('0x2c')](_0x336042);};}exports[_0x7a13('0x2d')]=function(_0x310e7f,_0x2aa87c){var _0x46b6fa={'include':[{'model':db[_0x7a13('0x2e')],'as':_0x7a13('0x2f')}]},_0x1f9776={},_0x20979e={'count':0x0,'rows':[]};var _0x9fa037=_[_0x7a13('0x30')](db[_0x7a13('0x31')]['rawAttributes'],function(_0x33d19c){return{'name':_0x33d19c['fieldName'],'type':_0x33d19c[_0x7a13('0x32')][_0x7a13('0x33')]};});_0x1f9776[_0x7a13('0x34')]=_[_0x7a13('0x30')](_0x9fa037,_0x7a13('0x2b'));_0x1f9776[_0x7a13('0x35')]=_[_0x7a13('0x36')](_0x310e7f[_0x7a13('0x35')]);_0x1f9776[_0x7a13('0x37')]=_[_0x7a13('0x38')](_0x1f9776[_0x7a13('0x34')],_0x1f9776[_0x7a13('0x35')]);_0x46b6fa[_0x7a13('0x39')]=_['intersection'](_0x1f9776['model'],qs[_0x7a13('0x3a')](_0x310e7f[_0x7a13('0x35')][_0x7a13('0x3a')]));_0x46b6fa[_0x7a13('0x39')]=_0x46b6fa[_0x7a13('0x39')][_0x7a13('0x3b')]?_0x46b6fa[_0x7a13('0x39')]:_0x1f9776[_0x7a13('0x34')];if(!_0x310e7f[_0x7a13('0x35')][_0x7a13('0x3c')](_0x7a13('0x3d'))){_0x46b6fa[_0x7a13('0x21')]=qs[_0x7a13('0x21')](_0x310e7f[_0x7a13('0x35')][_0x7a13('0x21')]);_0x46b6fa[_0x7a13('0x1f')]=qs[_0x7a13('0x1f')](_0x310e7f['query'][_0x7a13('0x1f')]);}_0x46b6fa[_0x7a13('0x3e')]=qs[_0x7a13('0x3f')](_0x310e7f[_0x7a13('0x35')][_0x7a13('0x3f')]);_0x46b6fa[_0x7a13('0x40')]=qs[_0x7a13('0x37')](_['pick'](_0x310e7f['query'],_0x1f9776['filters']),_0x9fa037);if(_0x310e7f['query'][_0x7a13('0x41')]){_0x46b6fa[_0x7a13('0x40')]=_['merge'](_0x46b6fa['where'],{'$or':_[_0x7a13('0x30')](_0x9fa037,function(_0x4142ec){if(_0x4142ec[_0x7a13('0x32')]!==_0x7a13('0x42')){var _0x185009={};_0x185009[_0x4142ec[_0x7a13('0x2b')]]={'$like':'%'+_0x310e7f['query'][_0x7a13('0x41')]+'%'};return _0x185009;}})});}_0x46b6fa=_[_0x7a13('0x43')]({},_0x46b6fa,_0x310e7f['options']);var _0x24ff2a={'where':_0x46b6fa[_0x7a13('0x40')]};return db[_0x7a13('0x31')][_0x7a13('0x22')](_0x24ff2a)[_0x7a13('0x26')](function(_0x1960f6){_0x20979e[_0x7a13('0x22')]=_0x1960f6;if(_0x310e7f[_0x7a13('0x35')][_0x7a13('0x44')]){_0x46b6fa[_0x7a13('0x45')]=[{'all':!![]}];}return db[_0x7a13('0x31')][_0x7a13('0x46')](_0x46b6fa);})[_0x7a13('0x26')](function(_0x46ef7c){_0x20979e[_0x7a13('0x47')]=_0x46ef7c;return _0x20979e;})[_0x7a13('0x26')](respondWithFilteredResult(_0x2aa87c,_0x46b6fa))[_0x7a13('0x48')](handleError(_0x2aa87c,null));};exports[_0x7a13('0x49')]=function(_0x155e6c,_0xd5b213){var _0x2e662c={'raw':![],'where':{'id':_0x155e6c[_0x7a13('0x4a')]['id']},'include':[{'model':db[_0x7a13('0x2e')],'as':_0x7a13('0x2f')}]},_0x5143ce={};_0x5143ce[_0x7a13('0x34')]=_[_0x7a13('0x36')](db[_0x7a13('0x31')]['rawAttributes']);_0x5143ce[_0x7a13('0x35')]=_[_0x7a13('0x36')](_0x155e6c[_0x7a13('0x35')]);_0x5143ce[_0x7a13('0x37')]=_[_0x7a13('0x38')](_0x5143ce[_0x7a13('0x34')],_0x5143ce[_0x7a13('0x35')]);_0x2e662c[_0x7a13('0x39')]=_[_0x7a13('0x38')](_0x5143ce[_0x7a13('0x34')],qs['fields'](_0x155e6c[_0x7a13('0x35')][_0x7a13('0x3a')]));_0x2e662c['attributes']=_0x2e662c[_0x7a13('0x39')][_0x7a13('0x3b')]?_0x2e662c[_0x7a13('0x39')]:_0x5143ce[_0x7a13('0x34')];if(_0x155e6c[_0x7a13('0x35')][_0x7a13('0x44')]){_0x2e662c[_0x7a13('0x45')]=[{'all':!![]}];}_0x2e662c=_[_0x7a13('0x43')]({},_0x2e662c,_0x155e6c[_0x7a13('0x4b')]);return db['ChatWebsite']['find'](_0x2e662c)[_0x7a13('0x26')](handleEntityNotFound(_0xd5b213,null))[_0x7a13('0x26')](respondWithResult(_0xd5b213,null))[_0x7a13('0x48')](handleError(_0xd5b213,null));};exports[_0x7a13('0x4c')]=function(_0x86525f,_0x202110){return db[_0x7a13('0x31')][_0x7a13('0x4c')](_0x86525f['body'],{})[_0x7a13('0x26')](function(_0x2ae71a){var _0x3e1ac1=_0x86525f[_0x7a13('0x4d')][_0x7a13('0x27')]({'plain':!![]});if(!_0x3e1ac1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e1ac1[_0x7a13('0x4e')]==='user'){var _0x3a8728=_0x2ae71a[_0x7a13('0x27')]({'plain':!![]});var _0x410170='ChatWebsites';return db[_0x7a13('0x4f')][_0x7a13('0x50')]({'where':{'name':_0x410170,'userProfileId':_0x3e1ac1[_0x7a13('0x51')]},'raw':!![]})[_0x7a13('0x26')](function(_0x4a5740){if(_0x4a5740&&_0x4a5740[_0x7a13('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x3a8728[_0x7a13('0x2b')],'resourceId':_0x3a8728['id'],'type':_0x4a5740['name'],'sectionId':_0x4a5740['id']},{})[_0x7a13('0x26')](function(){return _0x2ae71a;});}else{return _0x2ae71a;}})[_0x7a13('0x48')](function(_0x345cdd){logger[_0x7a13('0x18')](_0x7a13('0x53'),_0x345cdd);throw _0x345cdd;});}return _0x2ae71a;})[_0x7a13('0x26')](respondWithResult(_0x202110,0xc9))['catch'](handleError(_0x202110,null));};exports[_0x7a13('0x25')]=function(_0x113064,_0x546a9d){if(_0x113064[_0x7a13('0x54')]['id']){delete _0x113064['body']['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x113064['params']['id']},'include':[{'model':db[_0x7a13('0x2e')],'as':_0x7a13('0x2f')}]})['then'](handleEntityNotFound(_0x546a9d,null))['then'](saveUpdates(_0x113064['body'],null))[_0x7a13('0x26')](respondWithResult(_0x546a9d,null))[_0x7a13('0x48')](handleError(_0x546a9d,null));};exports['destroy']=function(_0x131a47,_0x2bc009){return db[_0x7a13('0x31')][_0x7a13('0x50')]({'where':{'id':_0x131a47[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x2bc009,null))[_0x7a13('0x26')](removeEntity(_0x2bc009,null))[_0x7a13('0x48')](handleError(_0x2bc009,null));};exports[_0x7a13('0x55')]=function(_0x3a3d24,_0x3d36f1){return db['ChatWebsite'][_0x7a13('0x55')]()[_0x7a13('0x26')](respondWithResult(_0x3d36f1,null))[_0x7a13('0x48')](handleError(_0x3d36f1,null));};exports[_0x7a13('0x56')]=function(_0x3a4c96,_0x43d203){if(_0x3a4c96[_0x7a13('0x54')]['id']){delete _0x3a4c96['body']['id'];}return db[_0x7a13('0x31')][_0x7a13('0x50')]({'where':{'id':_0x3a4c96[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x43d203,null))[_0x7a13('0x26')](function(_0x5b25d1){if(_0x5b25d1){_0x3a4c96[_0x7a13('0x54')][_0x7a13('0x57')]=_0x5b25d1['id'];return db[_0x7a13('0x58')]['create'](_0x3a4c96[_0x7a13('0x54')]);}})['then'](respondWithResult(_0x43d203,null))[_0x7a13('0x48')](handleError(_0x43d203,null));};exports[_0x7a13('0x59')]=function(_0x1ca865,_0x26207e){var _0x43c2d3={'raw':![],'where':{}};var _0x201d79={};var _0x36f7c1={'count':0x0,'rows':[]};return db[_0x7a13('0x31')][_0x7a13('0x5a')]({'where':{'id':_0x1ca865['params']['id']}})['then'](handleEntityNotFound(_0x26207e,null))[_0x7a13('0x26')](function(_0xb92f30){if(_0xb92f30){_0x201d79[_0x7a13('0x34')]=_['keys'](db[_0x7a13('0x58')][_0x7a13('0x5b')]);_0x201d79[_0x7a13('0x35')]=_['keys'](_0x1ca865[_0x7a13('0x35')]);_0x201d79['filters']=_[_0x7a13('0x38')](_0x201d79[_0x7a13('0x34')],_0x201d79['query']);_0x43c2d3['attributes']=_[_0x7a13('0x38')](_0x201d79['model'],qs[_0x7a13('0x3a')](_0x1ca865[_0x7a13('0x35')][_0x7a13('0x3a')]));_0x43c2d3[_0x7a13('0x39')]=_0x43c2d3['attributes'][_0x7a13('0x3b')]?_0x43c2d3[_0x7a13('0x39')]:_0x201d79[_0x7a13('0x34')];if(!_0x1ca865['query'][_0x7a13('0x3c')](_0x7a13('0x3d'))){_0x43c2d3[_0x7a13('0x21')]=qs[_0x7a13('0x21')](_0x1ca865['query']['limit']);_0x43c2d3[_0x7a13('0x1f')]=qs[_0x7a13('0x1f')](_0x1ca865['query']['offset']);}_0x43c2d3[_0x7a13('0x3e')]=qs[_0x7a13('0x3f')](_0x1ca865[_0x7a13('0x35')][_0x7a13('0x3f')]);_0x43c2d3[_0x7a13('0x40')]=qs[_0x7a13('0x37')](_[_0x7a13('0x5c')](_0x1ca865[_0x7a13('0x35')],_0x201d79[_0x7a13('0x37')]));_0x43c2d3[_0x7a13('0x40')][_0x7a13('0x57')]=_0xb92f30['id'];if(_0x1ca865[_0x7a13('0x35')][_0x7a13('0x41')]){_0x43c2d3[_0x7a13('0x40')]=_[_0x7a13('0x43')](_0x43c2d3[_0x7a13('0x40')],{'$or':_[_0x7a13('0x30')](_0x43c2d3[_0x7a13('0x39')],function(_0x28af9c){var _0x56d7a7={};_0x56d7a7[_0x28af9c]={'$like':'%'+_0x1ca865[_0x7a13('0x35')]['filter']+'%'};return _0x56d7a7;})});}_0x43c2d3=_[_0x7a13('0x43')]({},_0x43c2d3,_0x1ca865[_0x7a13('0x4b')]);return db[_0x7a13('0x58')][_0x7a13('0x22')]({'where':_0x43c2d3[_0x7a13('0x40')]})['then'](function(_0x3255f1){_0x36f7c1[_0x7a13('0x22')]=_0x3255f1;if(_0x1ca865[_0x7a13('0x35')]['includeAll']){_0x43c2d3['include']=[{'all':!![]}];}return db[_0x7a13('0x58')][_0x7a13('0x46')](_0x43c2d3);})[_0x7a13('0x26')](function(_0x4d2fc3){_0x36f7c1[_0x7a13('0x47')]=_0x4d2fc3;return _0x36f7c1;});}})[_0x7a13('0x26')](respondWithFilteredResult(_0x26207e,_0x43c2d3))[_0x7a13('0x48')](handleError(_0x26207e,null));};exports[_0x7a13('0x5d')]=function(_0x3b8ace,_0x3dd0cb){return db[_0x7a13('0x31')][_0x7a13('0x50')]({'where':{'id':_0x3b8ace['params']['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x3dd0cb,null))[_0x7a13('0x26')](function(_0x5397fa){if(_0x5397fa){return _0x5397fa[_0x7a13('0x5d')](_0x3b8ace[_0x7a13('0x35')][_0x7a13('0x5e')]);}})[_0x7a13('0x26')](respondWithStatusCode(_0x3dd0cb,null))[_0x7a13('0x48')](handleError(_0x3dd0cb,null));};exports['addAnswer']=function(_0x51aab0,_0xe19a20){if(_0x51aab0[_0x7a13('0x54')]['id']){delete _0x51aab0[_0x7a13('0x54')]['id'];}return db[_0x7a13('0x31')][_0x7a13('0x50')]({'where':{'id':_0x51aab0[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0xe19a20,null))[_0x7a13('0x26')](function(_0x400096){if(_0x400096){_0x51aab0[_0x7a13('0x54')][_0x7a13('0x57')]=_0x400096['id'];return db[_0x7a13('0x5f')]['create'](_0x51aab0[_0x7a13('0x54')]);}})[_0x7a13('0x26')](respondWithResult(_0xe19a20,null))['catch'](handleError(_0xe19a20,null));};exports[_0x7a13('0x60')]=function(_0xdf2947,_0x39f055){var _0x39a075={'raw':![],'where':{}};var _0x400ccf={};var _0x4c6ec1={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x7a13('0x5a')]({'where':{'id':_0xdf2947[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x39f055,null))[_0x7a13('0x26')](function(_0x2abc3b){if(_0x2abc3b){_0x400ccf[_0x7a13('0x34')]=_['keys'](db[_0x7a13('0x5f')]['rawAttributes']);_0x400ccf['query']=_['keys'](_0xdf2947[_0x7a13('0x35')]);_0x400ccf[_0x7a13('0x37')]=_[_0x7a13('0x38')](_0x400ccf[_0x7a13('0x34')],_0x400ccf[_0x7a13('0x35')]);_0x39a075[_0x7a13('0x39')]=_[_0x7a13('0x38')](_0x400ccf[_0x7a13('0x34')],qs[_0x7a13('0x3a')](_0xdf2947[_0x7a13('0x35')]['fields']));_0x39a075[_0x7a13('0x39')]=_0x39a075[_0x7a13('0x39')][_0x7a13('0x3b')]?_0x39a075[_0x7a13('0x39')]:_0x400ccf[_0x7a13('0x34')];if(!_0xdf2947[_0x7a13('0x35')][_0x7a13('0x3c')](_0x7a13('0x3d'))){_0x39a075['limit']=qs[_0x7a13('0x21')](_0xdf2947[_0x7a13('0x35')]['limit']);_0x39a075[_0x7a13('0x1f')]=qs[_0x7a13('0x1f')](_0xdf2947['query'][_0x7a13('0x1f')]);}_0x39a075['order']=qs[_0x7a13('0x3f')](_0xdf2947[_0x7a13('0x35')][_0x7a13('0x3f')]);_0x39a075[_0x7a13('0x40')]=qs[_0x7a13('0x37')](_[_0x7a13('0x5c')](_0xdf2947[_0x7a13('0x35')],_0x400ccf[_0x7a13('0x37')]));_0x39a075[_0x7a13('0x40')]['ChatWebsiteId']=_0x2abc3b['id'];if(_0xdf2947[_0x7a13('0x35')][_0x7a13('0x41')]){_0x39a075[_0x7a13('0x40')]=_[_0x7a13('0x43')](_0x39a075[_0x7a13('0x40')],{'$or':_[_0x7a13('0x30')](_0x39a075[_0x7a13('0x39')],function(_0x5be7fe){var _0x3bf2c8={};_0x3bf2c8[_0x5be7fe]={'$like':'%'+_0xdf2947[_0x7a13('0x35')][_0x7a13('0x41')]+'%'};return _0x3bf2c8;})});}_0x39a075=_[_0x7a13('0x43')]({},_0x39a075,_0xdf2947[_0x7a13('0x4b')]);return db[_0x7a13('0x5f')][_0x7a13('0x22')]({'where':_0x39a075['where']})['then'](function(_0x5445de){_0x4c6ec1['count']=_0x5445de;if(_0xdf2947[_0x7a13('0x35')][_0x7a13('0x44')]){_0x39a075['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x7a13('0x46')](_0x39a075);})[_0x7a13('0x26')](function(_0x435a1b){_0x4c6ec1[_0x7a13('0x47')]=_0x435a1b;return _0x4c6ec1;});}})[_0x7a13('0x26')](respondWithFilteredResult(_0x39f055,_0x39a075))['catch'](handleError(_0x39f055,null));};exports[_0x7a13('0x61')]=function(_0x4e3c72,_0x567a12){return db[_0x7a13('0x31')][_0x7a13('0x50')]({'where':{'id':_0x4e3c72['params']['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x567a12,null))[_0x7a13('0x26')](function(_0xae128a){if(_0xae128a){return _0xae128a['removeAnswers'](_0x4e3c72['query'][_0x7a13('0x5e')]);}})['then'](respondWithStatusCode(_0x567a12,null))[_0x7a13('0x48')](handleError(_0x567a12,null));};exports[_0x7a13('0x62')]=function(_0x2d8e6c,_0x231321){_0x2d8e6c['body'][_0x7a13('0x63')]=_0x2d8e6c['file'][_0x7a13('0x64')];return db[_0x7a13('0x31')]['find']({'where':{'id':_0x2d8e6c[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x231321,null))[_0x7a13('0x26')](saveUpdates(_0x2d8e6c['body'],null))[_0x7a13('0x26')](respondWithResult(_0x231321,null))['catch'](handleError(_0x231321,null));};exports[_0x7a13('0x65')]=function(_0xa54855,_0x5f2855){_0xa54855[_0x7a13('0x54')]['agentAvatar']=_0xa54855[_0x7a13('0x66')]['filename'];return db[_0x7a13('0x31')]['find']({'where':{'id':_0xa54855[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x5f2855,null))[_0x7a13('0x26')](saveUpdates(_0xa54855[_0x7a13('0x54')],null))[_0x7a13('0x26')](respondWithResult(_0x5f2855,null))['catch'](handleError(_0x5f2855,null));};exports[_0x7a13('0x67')]=function(_0x426a17,_0x26ec1c){_0x426a17[_0x7a13('0x54')][_0x7a13('0x68')]=_0x426a17['file']['filename'];return db[_0x7a13('0x31')]['find']({'where':{'id':_0x426a17[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x26ec1c,null))[_0x7a13('0x26')](saveUpdates(_0x426a17['body'],null))['then'](respondWithResult(_0x26ec1c,null))[_0x7a13('0x48')](handleError(_0x26ec1c,null));};exports[_0x7a13('0x69')]=function(_0x4e8ceb,_0x3607d5){_0x4e8ceb[_0x7a13('0x54')][_0x7a13('0x6a')]=_0x4e8ceb['file'][_0x7a13('0x64')];return db[_0x7a13('0x31')][_0x7a13('0x50')]({'where':{'id':_0x4e8ceb[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x3607d5,null))[_0x7a13('0x26')](saveUpdates(_0x4e8ceb['body'],null))[_0x7a13('0x26')](respondWithResult(_0x3607d5,null))[_0x7a13('0x48')](handleError(_0x3607d5,null));};exports[_0x7a13('0x6b')]=function(_0x2d09a2,_0x359a35){var _0x4331c2=path[_0x7a13('0x6c')](config[_0x7a13('0x6d')],'server/files/images/logos/default_logo.svg');var _0x2f7bab={'where':{'id':_0x2d09a2['params']['id']},'attributes':['id',_0x7a13('0x63')],'raw':!![]};var _0x2dde42=![];return require(_0x7a13('0x6e'))['getLicense']()['then'](function(_0x516d23){if(_0x516d23){_0x2dde42=_0x516d23[_0x7a13('0x6f')];}})[_0x7a13('0x26')](function(){return db[_0x7a13('0x31')][_0x7a13('0x50')](_0x2f7bab);})[_0x7a13('0x26')](handleEntityNotFound(_0x359a35,null))['then'](function(_0xda9e77){if(_0xda9e77){if(!_[_0x7a13('0x70')](_0xda9e77[_0x7a13('0x63')])){if(fs[_0x7a13('0x71')](path[_0x7a13('0x6c')](config[_0x7a13('0x6d')],_0x7a13('0x72'),_0xda9e77[_0x7a13('0x63')]))&&_0x2dde42){_0x4331c2=path['join'](config['root'],_0x7a13('0x72'),_0xda9e77[_0x7a13('0x63')]);}}return _0x359a35[_0x7a13('0x73')](_0x4331c2);}})['catch'](handleError(_0x359a35,null));};exports[_0x7a13('0x74')]=function(_0x141793,_0x185152){var _0x54e909=path[_0x7a13('0x6c')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x498734={'where':{'id':_0x141793['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x7a13('0x31')][_0x7a13('0x50')](_0x498734)['then'](handleEntityNotFound(_0x185152,null))['then'](function(_0xcd0f4c){if(_0xcd0f4c){if(!_['isNil'](_0xcd0f4c[_0x7a13('0x75')])){if(fs[_0x7a13('0x71')](path['join'](config[_0x7a13('0x6d')],_0x7a13('0x76'),_0xcd0f4c[_0x7a13('0x75')]))){_0x54e909=path['join'](config[_0x7a13('0x6d')],_0x7a13('0x76'),_0xcd0f4c['agentAvatar']);}}return _0x185152[_0x7a13('0x73')](_0x54e909);}})[_0x7a13('0x48')](handleError(_0x185152,null));};exports['getCustomerAvatar']=function(_0x64516a,_0x58cbc9){var _0x22c1ba=path[_0x7a13('0x6c')](config[_0x7a13('0x6d')],_0x7a13('0x77'));var _0x5329ed={'where':{'id':_0x64516a[_0x7a13('0x4a')]['id']},'attributes':['id',_0x7a13('0x68'),_0x7a13('0x78')],'raw':!![]};return db[_0x7a13('0x31')][_0x7a13('0x50')](_0x5329ed)[_0x7a13('0x26')](handleEntityNotFound(_0x58cbc9,null))[_0x7a13('0x26')](function(_0x360b5e){if(_0x360b5e){if(!_[_0x7a13('0x70')](_0x360b5e[_0x7a13('0x68')])){if(fs['existsSync'](path[_0x7a13('0x6c')](config[_0x7a13('0x6d')],_0x7a13('0x76'),_0x360b5e[_0x7a13('0x68')]))&&_0x360b5e[_0x7a13('0x78')]){_0x22c1ba=path['join'](config['root'],'server/files/images/avatars/',_0x360b5e[_0x7a13('0x68')]);}}return _0x58cbc9['download'](_0x22c1ba);}})['catch'](handleError(_0x58cbc9,null));};exports[_0x7a13('0x79')]=function(_0x3b4bf,_0x425f81){var _0x42cae6=path['join'](config['root'],_0x7a13('0x7a'));var _0x119392={'where':{'id':_0x3b4bf[_0x7a13('0x4a')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x7a13('0x31')][_0x7a13('0x50')](_0x119392)[_0x7a13('0x26')](handleEntityNotFound(_0x425f81,null))[_0x7a13('0x26')](function(_0x495d8f){if(_0x495d8f){if(!_[_0x7a13('0x70')](_0x495d8f[_0x7a13('0x6a')])){if(fs[_0x7a13('0x71')](path[_0x7a13('0x6c')](config[_0x7a13('0x6d')],_0x7a13('0x76'),_0x495d8f[_0x7a13('0x6a')]))){_0x42cae6=path[_0x7a13('0x6c')](config[_0x7a13('0x6d')],_0x7a13('0x76'),_0x495d8f['systemAvatar']);}}return _0x425f81['download'](_0x42cae6);}})[_0x7a13('0x48')](handleError(_0x425f81,null));};exports[_0x7a13('0x7b')]=function(_0x169890,_0x4e70fb){var _0x11d2c7=require('user-agent-parser');var _0x44d0b0=new _0x11d2c7();var _0x5b81d7=_0x44d0b0[_0x7a13('0x7c')](_0x169890[_0x7a13('0x7d')][_0x7a13('0x7e')])[_0x7a13('0x7f')]();var _0x44c6ca={'body':_0x169890['body'],'channel':_0x7a13('0x80')};var _0x9cce9f=[];var _0x582f12=[];var _0x40b4ea={};var _0x3c0427=![];return db[_0x7a13('0x81')][_0x7a13('0x55')]()[_0x7a13('0x26')](function(_0x53dd24){if(!_0x53dd24){throw new db['Sequelize'][(_0x7a13('0x82'))](_0x7a13('0x83'));}_0x9cce9f=_[_0x7a13('0x84')](_['keys'](_0x53dd24),['createdAt',_0x7a13('0x85')]);_0x582f12=_['difference'](_[_0x7a13('0x36')](_0x53dd24),[_0x7a13('0x86'),_0x7a13('0x85'),_0x7a13('0x87'),'ListId']);if(_0x169890[_0x7a13('0x54')]['id']){delete _0x169890[_0x7a13('0x54')]['id'];}if(_['isNil'](_0x169890['body'][_0x7a13('0x88')])){throw new db[(_0x7a13('0x89'))][(_0x7a13('0x82'))](_0x7a13('0x8a'));}if(_[_0x7a13('0x70')](_0x169890['body'][_0x7a13('0x54')])||_0x169890[_0x7a13('0x54')][_0x7a13('0x54')]===''){throw new db[(_0x7a13('0x89'))][(_0x7a13('0x82'))](_0x7a13('0x8b'));}if(_[_0x7a13('0x70')](_0x169890[_0x7a13('0x54')][_0x7a13('0x8c')])){throw new db[(_0x7a13('0x89'))]['ValidationError'](_0x7a13('0x8d')+_0x582f12);}if(!_['includes'](_0x582f12,_0x169890['body'][_0x7a13('0x8c')])){throw new db[(_0x7a13('0x89'))][(_0x7a13('0x82'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x582f12);}_0x40b4ea[_0x169890[_0x7a13('0x54')][_0x7a13('0x8c')]]=_0x169890[_0x7a13('0x54')][_0x7a13('0x88')];})['then'](function(){return db['ChatWebsite'][_0x7a13('0x50')]({'where':{'id':_0x169890['params']['id']},'include':[{'model':db[_0x7a13('0x8e')],'as':_0x7a13('0x8f'),'include':[{'model':db[_0x7a13('0x81')],'as':_0x7a13('0x90'),'where':_0x40b4ea,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x7a13('0x91')],'as':_0x7a13('0x92')}]});})[_0x7a13('0x26')](handleEntityNotFound(_0x4e70fb,null))[_0x7a13('0x26')](function(_0x105baa){if(_0x105baa&&_0x105baa[_0x7a13('0x8f')]){_0x44c6ca['account']=_0x105baa;_0x44c6ca[_0x7a13('0x93')]=_0x105baa[_0x7a13('0x92')];_0x44c6ca[_0x7a13('0x94')]=_0x105baa[_0x7a13('0x8f')];_0x44c6ca[_0x7a13('0x93')]=_[_0x7a13('0x95')](_0x44c6ca[_0x7a13('0x93')],['priority'],[_0x7a13('0x96')]);if(_0x44c6ca[_0x7a13('0x97')][_0x7a13('0x92')]){delete _0x44c6ca['account'][_0x7a13('0x92')];}if(_0x44c6ca[_0x7a13('0x97')]['List']&&_0x44c6ca[_0x7a13('0x97')]['List'][_0x7a13('0x90')][_0x7a13('0x3b')]){return _0x44c6ca[_0x7a13('0x97')][_0x7a13('0x8f')]['Contacts'][0x0];}var _0x43543a=_[_0x7a13('0xa')](_0x169890[_0x7a13('0x54')],{'firstName':_0x169890[_0x7a13('0x54')][_0x7a13('0x88')],'ListId':_0x105baa[_0x7a13('0x98')]});_0x43543a[_0x169890[_0x7a13('0x54')][_0x7a13('0x8c')]]=_0x169890[_0x7a13('0x54')][_0x7a13('0x88')];return db[_0x7a13('0x81')][_0x7a13('0x4c')](_0x43543a,{'fields':_0x9cce9f,'raw':!![]});}})[_0x7a13('0x26')](handleEntityNotFound(_0x4e70fb,null))[_0x7a13('0x26')](function(_0x10d8ac){_0x44c6ca[_0x7a13('0x99')]=_0x10d8ac;var _0x317b89=_0x169890[_0x7a13('0x54')][_0x7a13('0x9a')];if(_0x169890[_0x7a13('0x7d')][_0x7a13('0x9b')]){_0x317b89=_0x169890[_0x7a13('0x7d')][_0x7a13('0x9b')];}else if(_0x169890['headers'][_0x7a13('0x9c')]){_0x317b89=_[_0x7a13('0x9d')](_0x169890[_0x7a13('0x7d')][_0x7a13('0x9c')][_0x7a13('0x9e')](','));}if(_0x10d8ac){var _0x10db6c={'ContactId':_0x10d8ac['id'],'ChatWebsiteId':_0x169890[_0x7a13('0x4a')]['id'],'from':(_0x10d8ac[_0x7a13('0x9f')]||'')+'\x20'+(_0x10d8ac[_0x7a13('0xa0')]||''),'customerIp':_0x317b89,'customerPort':_0x169890[_0x7a13('0x7d')][_0x7a13('0xa1')]?_0x169890[_0x7a13('0x7d')]['x-real-port']:null,'referer':_0x169890[_0x7a13('0x54')][_0x7a13('0xa2')],'browserName':_0x5b81d7['browser'][_0x7a13('0x2b')]&&_0x5b81d7[_0x7a13('0xa3')][_0x7a13('0xa4')]?util[_0x7a13('0xa5')](_0x7a13('0xa6'),_0x5b81d7['browser'][_0x7a13('0x2b')],_0x5b81d7[_0x7a13('0xa3')][_0x7a13('0xa4')]):_0x7a13('0xa7'),'browserVersion':_0x5b81d7['browser'][_0x7a13('0xa4')]||_0x7a13('0xa7'),'osName':util[_0x7a13('0xa5')](_0x7a13('0xa6'),_0x5b81d7['os'][_0x7a13('0x2b')],_0x5b81d7['os'][_0x7a13('0xa4')]),'osVersion':_0x5b81d7['os'][_0x7a13('0xa4')],'deviceModel':_0x5b81d7[_0x7a13('0xa8')][_0x7a13('0x34')]&&_0x5b81d7[_0x7a13('0xa8')][_0x7a13('0xa9')]?util[_0x7a13('0xa5')](_0x7a13('0xaa'),_0x5b81d7['device'][_0x7a13('0x34')],_0x5b81d7[_0x7a13('0xa8')][_0x7a13('0xa9')],_0x5b81d7[_0x7a13('0xa8')][_0x7a13('0x32')]):null,'deviceVendor':_0x5b81d7[_0x7a13('0xa8')][_0x7a13('0xa9')],'deviceType':_0x5b81d7[_0x7a13('0xa8')]['type'],'formData':JSON[_0x7a13('0x17')](_0x169890[_0x7a13('0x54')])};var _0x5803e6={'ChatWebsiteId':_0x169890['params']['id'],'closed':![]};if(_0x169890['body'][_0x7a13('0xab')]){_0x5803e6[_0x7a13('0xab')]=_0x169890[_0x7a13('0x54')]['threadId'];return db[_0x7a13('0xac')]['find']({'where':_0x5803e6})['then'](function(_0x4b76f6){if(_0x4b76f6){return[_0x4b76f6,![]];}_0x10db6c['threadId']=_0x169890[_0x7a13('0x54')][_0x7a13('0xab')];_0x10db6c[_0x7a13('0xad')]=_0x169890[_0x7a13('0x54')][_0x7a13('0xad')];return db[_0x7a13('0xac')]['create'](_0x10db6c)[_0x7a13('0x26')](function(_0x2420b6){return[_0x2420b6,!![]];});});}_0x5803e6['ContactId']=_0x10d8ac['id'];if(_0x169890[_0x7a13('0x54')][_0x7a13('0xae')]&&_0x169890[_0x7a13('0x54')][_0x7a13('0xae')]['id']){_0x5803e6['id']=_0x169890[_0x7a13('0x54')][_0x7a13('0xae')]['id'];return db[_0x7a13('0xac')][_0x7a13('0x50')]({'where':_0x5803e6})[_0x7a13('0x26')](function(_0x3477d2){if(_0x3477d2){return[_0x3477d2,![]];}return db[_0x7a13('0xac')]['create'](_0x10db6c)[_0x7a13('0x26')](function(_0x33b9e1){return[_0x33b9e1,!![]];});});}return db[_0x7a13('0xac')][_0x7a13('0x4c')](_0x10db6c)[_0x7a13('0x26')](function(_0x53efe3){return[_0x53efe3,!![]];});}})[_0x7a13('0xaf')](function(_0x596cdc,_0x5ed2c9){if(_0x596cdc){_0x3c0427=_0x5ed2c9;if(!_0x5ed2c9){var _0xff4612={'from':(_0x44c6ca[_0x7a13('0x99')]['firstName']||'')+'\x20'+(_0x44c6ca[_0x7a13('0x99')][_0x7a13('0xa0')]||'')};if(_0x169890[_0x7a13('0x54')][_0x7a13('0xab')]&&_0x169890['body'][_0x7a13('0xb0')]&&_0x169890['body']['threadId']!=_0x169890[_0x7a13('0x54')][_0x7a13('0xb0')]){_0xff4612[_0x7a13('0xab')]=_0x169890['body'][_0x7a13('0xb0')];}return _0x596cdc[_0x7a13('0x25')](_0xff4612);}else{return _0x596cdc;}}})[_0x7a13('0x26')](function(_0x32b502){_0x44c6ca[_0x7a13('0xae')]=_0x32b502[_0x7a13('0x27')]({'plain':!![]});_0x44c6ca[_0x7a13('0xae')][_0x7a13('0xb1')]=_0x3c0427;if(_0x44c6ca[_0x7a13('0xae')][_0x7a13('0xb1')]){if(_0x44c6ca[_0x7a13('0x97')][_0x7a13('0xb2')]){_0x44c6ca[_0x7a13('0x93')]['push']({'id':0x0,'priority':_0x44c6ca[_0x7a13('0x93')][_0x7a13('0x3b')]+0x1,'app':_0x7a13('0xb3'),'appdata':_0x7a13('0xb4'),'interval':_0x7a13('0xb5')});}}return db[_0x7a13('0xb6')][_0x7a13('0x4c')]({'body':_0x169890[_0x7a13('0x54')]['body'],'ChatWebsiteId':_0x169890[_0x7a13('0x4a')]['id'],'ChatInteractionId':_0x32b502['id'],'direction':'in','ContactId':_0x44c6ca[_0x7a13('0x99')]['id'],'AttachmentId':_0x169890[_0x7a13('0x54')]['AttachmentId']});})[_0x7a13('0x26')](function(_0x40775c){_0x44c6ca['message']=_0x40775c;if(_0x44c6ca['interaction'][_0x7a13('0xb7')]){return db['User'][_0x7a13('0x50')]({'attributes':['id','name'],'where':{'id':_0x44c6ca[_0x7a13('0xae')][_0x7a13('0xb7')]}})['then'](function(_0x3a9cbb){if(_0x3a9cbb){_0x44c6ca[_0x7a13('0x93')][_0x7a13('0xb8')]({'id':0x0,'priority':0x0,'app':_0x7a13('0xb9'),'appdata':_0x3a9cbb[_0x7a13('0x2b')]+','+(_0x44c6ca[_0x7a13('0x97')][_0x7a13('0xba')]||0xa),'interval':_0x7a13('0xb5')});_0x44c6ca[_0x7a13('0xbb')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x44c6ca);});}return respondWithRpcPromise(_0x7a13('0xbc'),'startRouting',_0x44c6ca);})[_0x7a13('0x26')](function(_0xc71fd3){respondWithRpcPromise('EventManager','EventManager',{'event':'notify','message':_0xc71fd3},client9002);return _0xc71fd3;})['then'](respondWithResult(_0x4e70fb,null))[_0x7a13('0x48')](handleError(_0x4e70fb,null));};exports[_0x7a13('0xbd')]=function(_0x581d89,_0xa91294){var _0x24ed8e,_0x1aa947,_0xe71c2b;var _0x3328cb=[];var _0x57059a={};var _0x370316=_0x581d89[_0x7a13('0xbe')]||[];var _0x58f507=[];var _0x7aea76;return db['CmContact'][_0x7a13('0x55')]()[_0x7a13('0x26')](function(_0x259f0d){if(!_0x259f0d){throw new db[(_0x7a13('0x89'))]['ValidationError'](_0x7a13('0x83'));}_0x3328cb=_[_0x7a13('0x84')](_[_0x7a13('0x36')](_0x259f0d),[_0x7a13('0x86'),_0x7a13('0x85'),_0x7a13('0x87'),_0x7a13('0x98')]);if(_0x581d89['body']['id']){delete _0x581d89[_0x7a13('0x54')]['id'];}if(_[_0x7a13('0x70')](_0x581d89['body'][_0x7a13('0x88')])){throw _0xa91294[_0x7a13('0x1c')](0x1f4)['send'](new db['Sequelize'][(_0x7a13('0x82'))](_0x7a13('0x8a')));}if(_[_0x7a13('0x70')](_0x581d89[_0x7a13('0x54')][_0x7a13('0x54')])||_0x581d89['body'][_0x7a13('0x54')]===''){throw _0xa91294[_0x7a13('0x1c')](0x1f4)[_0x7a13('0x2c')](new db[(_0x7a13('0x89'))][(_0x7a13('0x82'))](_0x7a13('0x8b')));}if(_[_0x7a13('0x70')](_0x581d89[_0x7a13('0x54')][_0x7a13('0xbf')])){throw _0xa91294[_0x7a13('0x1c')](0x1f4)[_0x7a13('0x2c')](new db[(_0x7a13('0x89'))][(_0x7a13('0x82'))](_0x7a13('0xc0')+_0x3328cb));}if(!_[_0x7a13('0xc1')](_0x3328cb,_0x581d89['body'][_0x7a13('0xbf')])){throw _0xa91294['status'](0x1f4)[_0x7a13('0x2c')](new db[(_0x7a13('0x89'))]['ValidationError'](_0x7a13('0xc2')+_0x3328cb));}_0x57059a[_0x581d89[_0x7a13('0x54')]['mapKeyOffline']]=_0x581d89[_0x7a13('0x54')]['from'];})[_0x7a13('0x26')](function(){return db[_0x7a13('0x31')]['find']({'where':{'id':_0x581d89['params']['id']},'include':[{'model':db[_0x7a13('0x8e')],'as':'List'},{'model':db[_0x7a13('0xc3')],'as':'MailAccount'}]});})[_0x7a13('0x26')](handleEntityNotFound(_0xa91294,null))[_0x7a13('0x26')](function(_0x2b9199){if(_0x2b9199&&_0x2b9199[_0x7a13('0x8f')]){_0x1aa947=_0x2b9199;var _0x274407=_[_0x7a13('0xa')](_0x581d89[_0x7a13('0x54')],{'firstName':_0x581d89[_0x7a13('0x54')][_0x7a13('0x88')],'phone':_0x581d89[_0x7a13('0x54')]['from'],'ListId':_0x2b9199[_0x7a13('0x98')]});_0x274407[_0x581d89['body']['mapKeyOffline']]=_0x581d89[_0x7a13('0x54')][_0x7a13('0x88')];return db[_0x7a13('0x81')][_0x7a13('0xc4')]({'where':_0x57059a,'defaults':_0x274407});}})[_0x7a13('0xaf')](function(_0x1d6269){if(_0x1d6269){_0xe71c2b=_0x1d6269;var _0x1128c5=fs[_0x7a13('0xc5')](path[_0x7a13('0x6c')](config['root'],_0x7a13('0xc6')),_0x7a13('0xc7'));var _0x5ba3e9=ejs['render'](_0x1128c5,{'body':_[_0x7a13('0xc8')](_0x581d89[_0x7a13('0x54')][_0x7a13('0x54')]),'bodyTitle':_0x1aa947[_0x7a13('0xc9')]});return db['ChatOfflineMessage'][_0x7a13('0x4c')]({'body':_0x5ba3e9,'plainBody':htmlToText['fromString'](_0x5ba3e9),'ContactId':_0x1d6269['id'],'ChatWebsiteId':_0x1aa947['id']});}})['then'](function(_0x514294){_0x7aea76=_0x514294;if(_0x370316['length']){var _0x3a57d4=_0x370316[_0x7a13('0x30')](function(_0x5ae2ee){return{'name':_0x5ae2ee[_0x7a13('0xca')],'basename':_0x5ae2ee[_0x7a13('0x64')],'type':_0x5ae2ee[_0x7a13('0xcb')],'ChatOfflineMessageId':_0x514294['id']};});_0x58f507=_0x3a57d4['map'](_0x2329fc=>{var _0x14a779={'filename':_0x2329fc['name'],'path':path[_0x7a13('0x6c')](config[_0x7a13('0x6d')],'server',_0x7a13('0xbe'),_0x7a13('0xcc'),_0x7a13('0xcd'),_0x2329fc[_0x7a13('0xce')])};return _0x14a779;});if(!_0x1aa947[_0x7a13('0xcf')]){return db[_0x7a13('0xd0')]['transaction'](function(_0x13d228){return db[_0x7a13('0xd1')][_0x7a13('0xd2')](_0x3a57d4,{'transaction':_0x13d228});});}}})[_0x7a13('0x26')](function(){if(_0x7aea76){_0x24ed8e=_0x7aea76;return db['MailAccount'][_0x7a13('0x5a')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x7a13('0xd3'),'raw':!![],'include':[{'model':db[_0x7a13('0xd4')],'as':_0x7a13('0xd4'),'raw':!![]}]}]});}})[_0x7a13('0x26')](function(_0x4af42b){if(_0x4af42b&&_0x4af42b[_0x7a13('0xd3')]&&_0x1aa947[_0x7a13('0xd5')]&&_0x1aa947['forwardOfflineAddress']){var _0xbb9a9e=_0x4af42b[_0x7a13('0xd6')]();return respondWithRpcPromise(_0x7a13('0xd7'),_0x7a13('0xd8'),{'account':_0xbb9a9e,'message':{'from':util[_0x7a13('0xa5')]('\x22%s\x22\x20<%s>',_0x4af42b[_0x7a13('0x2b')],_0x4af42b[_0x7a13('0xd9')]||_0x4af42b[_0x7a13('0xd3')]['user']),'to':_0x1aa947[_0x7a13('0xda')],'subject':_0x1aa947[_0x7a13('0xdb')],'html':_0x24ed8e[_0x7a13('0x54')],'attachments':_0x58f507}},client9003)[_0x7a13('0x26')](function(){return _0x24ed8e;})['catch'](function(_0x4497f1){logger[_0x7a13('0x18')](_0x4497f1);});}})[_0x7a13('0x26')](function(){if(_0x1aa947&&_0x1aa947['openNewInteraction']&&_0x1aa947[_0x7a13('0xdc')]){var _0x316497=[];if(_0x370316[_0x7a13('0x3b')]){_0x316497=_0x370316[_0x7a13('0x30')](function(_0x4854cd){return{'name':_0x4854cd[_0x7a13('0xca')],'basename':_0x4854cd[_0x7a13('0x64')],'type':_0x4854cd[_0x7a13('0xcb')],'ChatOfflineMessageId':_0x7aea76['id']};});}var _0x53a6d8;if(!_[_0x7a13('0x70')](_0x1aa947[_0x7a13('0xdd')])){var _0x5a197b=_[_0x7a13('0x30')](_0x581d89['body'],function(_0x3657a8){return _0x3657a8;});var _0x2b33cd=_[_0x7a13('0xde')](_0x5a197b)[0x0];var _0xd6d502=_[_0x7a13('0xdf')](_0x2b33cd,function(_0x211a02){return _0x211a02;});_0x53a6d8=_0xd6d502[0x1][_0x1aa947[_0x7a13('0xdd')]];}var _0x466102={'from':_0xe71c2b[_0x7a13('0xd9')],'firstName':_0xe71c2b['firstName'],'lastName':_0xe71c2b[_0x7a13('0xa0')],'mapKey':_0x7a13('0xd9'),'message':{'from':_0xe71c2b[_0x7a13('0xd9')],'to':_0x1aa947[_0x7a13('0xc3')][_0x7a13('0xd9')],'cc':'','subject':_['isNil'](_0x53a6d8)?_0x1aa947[_0x7a13('0xdb')]:_0x53a6d8,'messageId':'','sentAt':new Date(),'attach':_0x316497[_0x7a13('0x3b')],'attachments':_0x316497,'originChannel':'Chat','ChatWebsiteId':_0x1aa947['id'],'ChatOfflineMessageId':_0x24ed8e['id'],'originTo':_0x1aa947[_0x7a13('0xc3')][_0x7a13('0xd9')]},'body':_0x24ed8e[_0x7a13('0x54')]};var _0x307409={'account':{'id':_0x1aa947['MailAccountId']},'body':_0x466102,'log':_0x7a13('0xe0')};return respondWithRpcPromise('NotifyMailAccount',_0x7a13('0xe1'),_0x307409,client9001)[_0x7a13('0x26')](function(){return _0x24ed8e;})[_0x7a13('0x48')](function(_0x155df5){logger['error'](_0x155df5);});}return;})[_0x7a13('0x26')](function(){if(_0x24ed8e){return _0x24ed8e;}})['then'](respondWithResult(_0xa91294,null))[_0x7a13('0x48')](function(_0x5e3b2b){logger[_0x7a13('0x18')](_0x7a13('0x48'),_0x5e3b2b);for(var _0x2465f7 of _0x370316){var _0x17a307=path[_0x7a13('0x6c')](config['root'],'server',_0x7a13('0xbe'),'attachments',_0x7a13('0xcd'),_0x2465f7[_0x7a13('0x64')]);fs_extra[_0x7a13('0xe2')](_0x17a307)[_0x7a13('0x48')](function(_0x43ccac){logger[_0x7a13('0x18')](_0x7a13('0xe3'),_0x17a307,_0x43ccac);});}});};exports[_0x7a13('0xe4')]=function(_0xb169ee,_0x7b476){return db[_0x7a13('0xac')][_0x7a13('0x50')]({'where':{'id':_0xb169ee[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x7b476,null))[_0x7a13('0x26')](function(_0x25b305){if(_0x25b305){return _0x25b305[_0x7a13('0xe4')](_0xb169ee[_0x7a13('0x54')]['ids'],_['omit'](_0xb169ee[_0x7a13('0x54')],['ids','id'])||{});}})[_0x7a13('0x26')](respondWithResult(_0x7b476,null))[_0x7a13('0x48')](handleError(_0x7b476,null));};exports[_0x7a13('0xe5')]=function(_0x1c16e8,_0x218353){var _0x4c97e4={'raw':![],'where':{}};var _0xa8ac7={};var _0x7f709f={'count':0x0,'rows':[]};return db[_0x7a13('0x31')]['findOne']({'where':{'id':_0x1c16e8[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x218353,null))[_0x7a13('0x26')](function(_0xcd5ac4){if(_0xcd5ac4){_0xa8ac7['model']=_[_0x7a13('0x36')](db[_0x7a13('0xac')][_0x7a13('0x5b')]);_0xa8ac7[_0x7a13('0x35')]=_[_0x7a13('0x36')](_0x1c16e8[_0x7a13('0x35')]);_0xa8ac7[_0x7a13('0x37')]=_[_0x7a13('0x38')](_0xa8ac7[_0x7a13('0x34')],_0xa8ac7[_0x7a13('0x35')]);_0x4c97e4[_0x7a13('0x39')]=_['intersection'](_0xa8ac7['model'],qs['fields'](_0x1c16e8[_0x7a13('0x35')][_0x7a13('0x3a')]));_0x4c97e4[_0x7a13('0x39')]=_0x4c97e4['attributes'][_0x7a13('0x3b')]?_0x4c97e4['attributes']:_0xa8ac7[_0x7a13('0x34')];if(!_0x1c16e8[_0x7a13('0x35')][_0x7a13('0x3c')](_0x7a13('0x3d'))){_0x4c97e4[_0x7a13('0x21')]=qs['limit'](_0x1c16e8[_0x7a13('0x35')]['limit']);_0x4c97e4[_0x7a13('0x1f')]=qs[_0x7a13('0x1f')](_0x1c16e8[_0x7a13('0x35')][_0x7a13('0x1f')]);}_0x4c97e4['order']=qs[_0x7a13('0x3f')](_0x1c16e8['query']['sort']);_0x4c97e4[_0x7a13('0x40')]=qs[_0x7a13('0x37')](_['pick'](_0x1c16e8[_0x7a13('0x35')],_0xa8ac7[_0x7a13('0x37')]));_0x4c97e4[_0x7a13('0x40')][_0x7a13('0x57')]=_0xcd5ac4['id'];if(_0x1c16e8[_0x7a13('0x35')]['filter']){_0x4c97e4[_0x7a13('0x40')]=_[_0x7a13('0x43')](_0x4c97e4[_0x7a13('0x40')],{'$or':_[_0x7a13('0x30')](_0x4c97e4['attributes'],function(_0x2e017e){var _0xea214={};_0xea214[_0x2e017e]={'$like':'%'+_0x1c16e8['query'][_0x7a13('0x41')]+'%'};return _0xea214;})});}_0x4c97e4=_[_0x7a13('0x43')]({},_0x4c97e4,_0x1c16e8[_0x7a13('0x4b')]);return db[_0x7a13('0xac')][_0x7a13('0x22')]({'where':_0x4c97e4[_0x7a13('0x40')]})[_0x7a13('0x26')](function(_0x7dbc9e){_0x7f709f['count']=_0x7dbc9e;if(_0x1c16e8[_0x7a13('0x35')][_0x7a13('0x44')]){_0x4c97e4[_0x7a13('0x45')]=[{'model':db['CmContact'],'as':_0x7a13('0xe6'),'required':![]},{'model':db[_0x7a13('0xe7')],'as':_0x7a13('0xe8'),'attributes':[_0x7a13('0x2b'),_0x7a13('0xe9'),_0x7a13('0xea')],'required':![]},{'model':db[_0x7a13('0xeb')],'as':_0x7a13('0xec'),'attributes':['id',_0x7a13('0x2b'),_0x7a13('0xed')],'where':_0x1c16e8[_0x7a13('0x35')][_0x7a13('0xee')]?{'id':_0x1c16e8[_0x7a13('0x35')][_0x7a13('0xee')]}:undefined,'required':_0x1c16e8[_0x7a13('0x35')][_0x7a13('0xee')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x4c97e4);})['then'](function(_0x41431d){_0x7f709f['rows']=_0x41431d;return _0x7f709f;});}})[_0x7a13('0x26')](respondWithFilteredResult(_0x218353,_0x4c97e4))['catch'](handleError(_0x218353,null));};function iftimePromise(_0x3bc3dd,_0x16a4ab){return respondWithRpcPromise(_0x7a13('0xef'),_0x7a13('0xf0'),{'command':_0x16a4ab[_0x7a13('0xf1')]?util[_0x7a13('0xa5')](_0x7a13('0xf2'),_0x3bc3dd[_0x7a13('0xf3')],_0x16a4ab[_0x7a13('0xf1')]):util['format']('iftime\x20%s',_0x3bc3dd['interval'])},client9002)[_0x7a13('0x26')](function(_0x337ddf){var _0x1919fa=_0x337ddf&&_0x337ddf[_0x7a13('0xf4')](_0x7a13('0xf5'))>=0x0?!![]:![];logger[_0x7a13('0x13')](_0x7a13('0xf6'),_0x16a4ab['id'],_0x3bc3dd['id'],_0x3bc3dd[_0x7a13('0xf3')],_0x1919fa?_0x7a13('0xf7'):_0x7a13('0xf8'),_0x16a4ab[_0x7a13('0xf1')]?_0x16a4ab[_0x7a13('0xf1')]:_0x7a13('0xf9'));return _0x1919fa;})[_0x7a13('0x48')](function(_0x4dc9ae){logger['error'](_0x7a13('0xf6'),_0x16a4ab['id'],_0x3bc3dd['id'],_0x3bc3dd[_0x7a13('0xf3')],util[_0x7a13('0xfa')](_0x4dc9ae,{'showHidden':![],'depth':null}),_0x16a4ab[_0x7a13('0xf1')]?_0x16a4ab['timezone']:'No\x20timezone');return![];});}exports['getSnippet']=function(_0x1757ce,_0x1a7102){var _0x3128a2=0x0;var _0x1ba247=0x0;var _0x594508=![];var _0x55f0fd;var _0x4e02dc;return db['ChatWebsite']['find']({'where':{'id':_0x1757ce['params']['id']},'include':[{'model':db[_0x7a13('0xfb')],'as':'Interval','include':[{'model':db[_0x7a13('0xfb')],'as':_0x7a13('0xfc'),'attributes':['id',_0x7a13('0xf3')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x1a7102,null))['then'](function(_0x381bd0){if(_0x381bd0){_0x55f0fd=_0x381bd0;return _0x381bd0[_0x7a13('0xfd')]({'raw':!![]});}})[_0x7a13('0x26')](function(_0x645ace){if(_0x55f0fd){if(_0x645ace){_0x4e02dc=_0x645ace;}}return require('../../config/license/util')['getLicense']();})['then'](function(_0xa47633){if(_0xa47633){_0x1ba247=_0xa47633[_0x7a13('0xfe')];_0x594508=_0xa47633[_0x7a13('0x6f')];}})[_0x7a13('0x26')](function(){return db[_0x7a13('0xac')]['count']({'where':{'closed':![]}});})[_0x7a13('0x26')](function(_0x241462){_0x3128a2=_0x241462;if(_0x1ba247&&_0x241462>_0x1ba247){return db[_0x7a13('0xff')]['findOne']({'where':{'id':0x1}})[_0x7a13('0x26')](function(_0x5555b3){if(_0x5555b3){_0x5555b3['increment'](_0x7a13('0x100'));}});}})[_0x7a13('0x26')](function(){if(_0x55f0fd['Interval']&&_0x55f0fd[_0x7a13('0xfb')][_0x7a13('0xfc')]){var _0x9e904d=[];for(var _0x186de5=0x0;_0x186de5<_0x55f0fd[_0x7a13('0xfb')][_0x7a13('0xfc')][_0x7a13('0x3b')];_0x186de5++){var _0x5e099e=_0x55f0fd['Interval'][_0x7a13('0xfc')][_0x186de5][_0x7a13('0x27')]({'plain':!![]});_0x9e904d[_0x7a13('0x101')](iftimePromise(_0x5e099e,_0x55f0fd));}return BPromise[_0x7a13('0x102')](_0x9e904d)[_0x7a13('0x26')](function(_0x4b90d6){return _[_0x7a13('0x103')](_0x4b90d6);});}else{return!![];}})[_0x7a13('0x26')](function(_0x413f4e){var _0x502039=fs[_0x7a13('0xc5')](path[_0x7a13('0x6c')](config[_0x7a13('0x6d')],_0x7a13('0x104')),_0x7a13('0xc7'));var _0x5d7ec5={'remote':_0x55f0fd['remote'],'query':querystring['stringify'](_[_0x7a13('0x43')](_0x55f0fd['get']({'plain':!![]}),{'customerIp':_0x1757ce[_0x7a13('0x7d')][_0x7a13('0x9c')]||_0x1757ce[_0x7a13('0x7d')][_0x7a13('0x105')]||_0x1757ce[_0x7a13('0x106')][_0x7a13('0x107')]||_0x1757ce['ip'],'referer':_0x1757ce[_0x7a13('0x7d')][_0x7a13('0xa2')],'openedInteractions':_0x3128a2,'maxInteractions':_0x1ba247,'virtual':_0x594508[_0x7a13('0xfe')],'online':_0x413f4e,'custom':_0x594508}))['replace'](/'/g,'\x5c\x27')};_0x1a7102['send'](ejs[_0x7a13('0x108')](Mustache[_0x7a13('0x108')](_0x502039,_0x5d7ec5),{'proactiveActions':_0x4e02dc,'alignment':_0x55f0fd[_0x7a13('0x109')],'verticalAlignment':_0x55f0fd[_0x7a13('0x10a')],'div_color':_0x55f0fd[_0x7a13('0xed')],'labelText':_0x55f0fd[_0x7a13('0x10b')],'text_color':_0x55f0fd['textColor'],'text_button_color':_0x55f0fd[_0x7a13('0x10c')],'button_color':_0x55f0fd[_0x7a13('0x10d')],'background_color':_0x55f0fd['backgroundColor'],'hideWhenOffline':_0x55f0fd['hideWhenOffline'],'interval':_0x55f0fd['IntervalId']}));})[_0x7a13('0x48')](handleError(_0x1a7102,null));};exports['addApplications']=function(_0x1266d5,_0x57f9bd){var _0x521d5d=_0x1266d5[_0x7a13('0x4a')]['id'];var _0xa5cc8b=_0x1266d5[_0x7a13('0x54')];var _0x54987f=0xc8;var _0x287e87=null;return db[_0x7a13('0xd0')][_0x7a13('0x10e')]({'isolationLevel':db[_0x7a13('0xd0')][_0x7a13('0x10f')][_0x7a13('0x110')][_0x7a13('0x111')]},function(_0x1351ed){return db[_0x7a13('0x31')][_0x7a13('0x5a')]({'where':{'id':_0x521d5d},'transaction':_0x1351ed})[_0x7a13('0x26')](function(_0x3858bb){if(_0x3858bb){return db[_0x7a13('0x91')][_0x7a13('0x112')]({'where':{'ChatWebsiteId':_0x521d5d},'transaction':_0x1351ed})[_0x7a13('0x26')](function(){var _0x58a116=_[_0x7a13('0x30')](_0xa5cc8b,function(_0x36a6e3){_0x36a6e3[_0x7a13('0x57')]=_0x521d5d;return _0x36a6e3;});return db[_0x7a13('0x91')][_0x7a13('0xd2')](_0x58a116,{'transaction':_0x1351ed});});}else{_0x54987f=0x194;_0x287e87=[];}});})[_0x7a13('0x26')](function(){if(_0x54987f!==0x194){return db[_0x7a13('0x91')][_0x7a13('0x113')]({'where':{'ChatWebsiteId':_0x521d5d},'order':'priority'})[_0x7a13('0x26')](function(_0x1e2e5e){_0x287e87=_0x1e2e5e;});}})['catch'](function(_0x8fc0ef){_0x54987f=0x1f4;logger['error'](_0x8fc0ef['stack']);if(_0x8fc0ef[_0x7a13('0x2b')]){delete _0x8fc0ef['name'];}_0x287e87=_0x8fc0ef;})[_0x7a13('0x114')](function(){if(_0x287e87===null){_0x57f9bd[_0x7a13('0x1b')](_0x54987f);}else{if(_0x54987f===0x1f4){_0x57f9bd['status'](_0x54987f)[_0x7a13('0x2c')](_0x287e87);}else{_0x57f9bd[_0x7a13('0x1c')](_0x54987f)[_0x7a13('0x1e')](_0x287e87);}}});};exports['getApplications']=function(_0x2fdb38,_0x48fef6){var _0x50fdba={};var _0x15da70={};var _0x6a5e5a;var _0x467316;return db['ChatWebsite'][_0x7a13('0x5a')]({'where':{'id':_0x2fdb38[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x48fef6,null))[_0x7a13('0x26')](function(_0x37dca5){if(_0x37dca5){_0x6a5e5a=_0x37dca5;_0x15da70[_0x7a13('0x34')]=_['keys'](db[_0x7a13('0x91')][_0x7a13('0x5b')]);_0x15da70[_0x7a13('0x35')]=_[_0x7a13('0x36')](_0x2fdb38[_0x7a13('0x35')]);_0x15da70[_0x7a13('0x37')]=_[_0x7a13('0x38')](_0x15da70[_0x7a13('0x34')],_0x15da70[_0x7a13('0x35')]);_0x50fdba[_0x7a13('0x39')]=_['intersection'](_0x15da70[_0x7a13('0x34')],qs[_0x7a13('0x3a')](_0x2fdb38[_0x7a13('0x35')][_0x7a13('0x3a')]));_0x50fdba[_0x7a13('0x39')]=_0x50fdba[_0x7a13('0x39')][_0x7a13('0x3b')]?_0x50fdba[_0x7a13('0x39')]:_0x15da70[_0x7a13('0x34')];_0x50fdba['order']=qs['sort'](_0x2fdb38[_0x7a13('0x35')][_0x7a13('0x3f')]);_0x50fdba['where']=qs['filters'](_[_0x7a13('0x5c')](_0x2fdb38[_0x7a13('0x35')],_0x15da70[_0x7a13('0x37')]));if(_0x2fdb38[_0x7a13('0x35')][_0x7a13('0x41')]){_0x50fdba[_0x7a13('0x40')]=_[_0x7a13('0x43')](_0x50fdba[_0x7a13('0x40')],{'$or':_['map'](_0x50fdba[_0x7a13('0x39')],function(_0x49deee){var _0x1fd448={};_0x1fd448[_0x49deee]={'$like':'%'+_0x2fdb38[_0x7a13('0x35')]['filter']+'%'};return _0x1fd448;})});}_0x50fdba=_[_0x7a13('0x43')]({},_0x50fdba,_0x2fdb38[_0x7a13('0x4b')]);return _0x6a5e5a[_0x7a13('0x115')](_0x50fdba);}})[_0x7a13('0x26')](function(_0x5b1e83){if(_0x5b1e83){_0x467316=_0x5b1e83[_0x7a13('0x3b')];if(!_0x2fdb38[_0x7a13('0x35')]['hasOwnProperty']('nolimit')){_0x50fdba[_0x7a13('0x21')]=qs['limit'](_0x2fdb38[_0x7a13('0x35')][_0x7a13('0x21')]);_0x50fdba[_0x7a13('0x1f')]=qs[_0x7a13('0x1f')](_0x2fdb38[_0x7a13('0x35')][_0x7a13('0x1f')]);}return _0x6a5e5a[_0x7a13('0x115')](_0x50fdba);}})[_0x7a13('0x26')](function(_0x100565){if(_0x100565){return _0x100565?{'count':_0x467316,'rows':_0x100565}:null;}})[_0x7a13('0x26')](respondWithResult(_0x48fef6,null))[_0x7a13('0x48')](handleError(_0x48fef6,null));};exports[_0x7a13('0x116')]=function(_0x554d53,_0x136487){return db[_0x7a13('0x117')]['find']({'where':{'id':_0x554d53['params']['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x136487,null))['then'](function(_0x3d038b){if(_0x3d038b){return _0x3d038b['addProactiveActions'](_0x554d53['body'][_0x7a13('0x5e')],_[_0x7a13('0x118')](_0x554d53[_0x7a13('0x54')],['ids','id'])||{});}})[_0x7a13('0x26')](respondWithResult(_0x136487,null))[_0x7a13('0x48')](handleError(_0x136487,null));};exports[_0x7a13('0xfd')]=function(_0x514515,_0x3aeec0){var _0x1cba42={};var _0x3ce9e4={};var _0x2eea70;var _0x3a8877;return db[_0x7a13('0x31')][_0x7a13('0x5a')]({'where':{'id':_0x514515[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x3aeec0,null))['then'](function(_0x3105ae){if(_0x3105ae){_0x2eea70=_0x3105ae;_0x3ce9e4[_0x7a13('0x34')]=_[_0x7a13('0x36')](db[_0x7a13('0x119')]['rawAttributes']);_0x3ce9e4[_0x7a13('0x35')]=_[_0x7a13('0x36')](_0x514515[_0x7a13('0x35')]);_0x3ce9e4[_0x7a13('0x37')]=_[_0x7a13('0x38')](_0x3ce9e4[_0x7a13('0x34')],_0x3ce9e4[_0x7a13('0x35')]);_0x1cba42[_0x7a13('0x39')]=_[_0x7a13('0x38')](_0x3ce9e4['model'],qs[_0x7a13('0x3a')](_0x514515[_0x7a13('0x35')]['fields']));_0x1cba42[_0x7a13('0x39')]=_0x1cba42[_0x7a13('0x39')]['length']?_0x1cba42[_0x7a13('0x39')]:_0x3ce9e4[_0x7a13('0x34')];_0x1cba42[_0x7a13('0x3e')]=qs[_0x7a13('0x3f')](_0x514515[_0x7a13('0x35')]['sort']);_0x1cba42['where']=qs[_0x7a13('0x37')](_['pick'](_0x514515[_0x7a13('0x35')],_0x3ce9e4['filters']));if(_0x514515[_0x7a13('0x35')][_0x7a13('0x41')]){_0x1cba42[_0x7a13('0x40')]=_[_0x7a13('0x43')](_0x1cba42[_0x7a13('0x40')],{'$or':_['map'](_0x1cba42[_0x7a13('0x39')],function(_0x5aa316){var _0x14f8ac={};_0x14f8ac[_0x5aa316]={'$like':'%'+_0x514515[_0x7a13('0x35')]['filter']+'%'};return _0x14f8ac;})});}_0x1cba42=_['merge']({},_0x1cba42,_0x514515[_0x7a13('0x4b')]);return _0x2eea70[_0x7a13('0xfd')](_0x1cba42);}})[_0x7a13('0x26')](function(_0x88be03){if(_0x88be03){_0x3a8877=_0x88be03['length'];if(!_0x514515[_0x7a13('0x35')]['hasOwnProperty'](_0x7a13('0x3d'))){_0x1cba42[_0x7a13('0x21')]=qs[_0x7a13('0x21')](_0x514515[_0x7a13('0x35')][_0x7a13('0x21')]);_0x1cba42[_0x7a13('0x1f')]=qs[_0x7a13('0x1f')](_0x514515[_0x7a13('0x35')][_0x7a13('0x1f')]);}return _0x2eea70[_0x7a13('0xfd')](_0x1cba42);}})[_0x7a13('0x26')](function(_0x42345d){if(_0x42345d){return _0x42345d?{'count':_0x3a8877,'rows':_0x42345d}:null;}})['then'](respondWithResult(_0x3aeec0,null))['catch'](handleError(_0x3aeec0,null));};exports[_0x7a13('0x11a')]=function(_0x31d24e,_0x25b4fd){var _0x35353a=_0x31d24e[_0x7a13('0x35')][_0x7a13('0x11b')]===_0x7a13('0x11c')?'offlineForm':_0x7a13('0x11d');return db['ChatWebsite'][_0x7a13('0x50')]({'attributes':['id',_0x35353a],'where':{'id':_0x31d24e[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x25b4fd,null))[_0x7a13('0x26')](function(_0xd2dff8){if(_0xd2dff8){var _0x2f7274=_0xd2dff8[_0x35353a];var _0x1fe942=_0x2f7274&&_0x2f7274['items']?_0x2f7274['items']:[];_0x25b4fd['send']({'fromKey':_[_0x7a13('0x70')](_0x2f7274[_0x7a13('0x11e')])?undefined:_0x2f7274[_0x7a13('0x11e')],'count':_0x1fe942['length'],'rows':_0x1fe942});}})['catch'](handleError(_0x25b4fd,null));};exports['getOfflineMessages']=function(_0x3e7d5c,_0x3dfb5d){var _0x590257={'raw':![],'where':{}};var _0x38cbcb={};var _0x5e3203={'count':0x0,'rows':[]};return db[_0x7a13('0x31')][_0x7a13('0x5a')]({'where':{'id':_0x3e7d5c[_0x7a13('0x4a')]['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x3dfb5d,null))[_0x7a13('0x26')](function(_0x1a287e){if(_0x1a287e){_0x38cbcb['model']=_['keys'](db['ChatOfflineMessage'][_0x7a13('0x5b')]);_0x38cbcb[_0x7a13('0x35')]=_[_0x7a13('0x36')](_0x3e7d5c[_0x7a13('0x35')]);_0x38cbcb['filters']=_[_0x7a13('0x38')](_0x38cbcb[_0x7a13('0x34')],_0x38cbcb[_0x7a13('0x35')]);_0x590257[_0x7a13('0x39')]=_[_0x7a13('0x38')](_0x38cbcb[_0x7a13('0x34')],qs[_0x7a13('0x3a')](_0x3e7d5c[_0x7a13('0x35')][_0x7a13('0x3a')]));_0x590257[_0x7a13('0x39')]=_0x590257['attributes'][_0x7a13('0x3b')]?_0x590257['attributes']:_0x38cbcb[_0x7a13('0x34')];if(!_0x3e7d5c[_0x7a13('0x35')][_0x7a13('0x3c')](_0x7a13('0x3d'))){_0x590257[_0x7a13('0x21')]=qs[_0x7a13('0x21')](_0x3e7d5c['query'][_0x7a13('0x21')]);_0x590257['offset']=qs['offset'](_0x3e7d5c[_0x7a13('0x35')]['offset']);}_0x590257[_0x7a13('0x3e')]=qs[_0x7a13('0x3f')](_0x3e7d5c[_0x7a13('0x35')][_0x7a13('0x3f')]);_0x590257['where']=qs[_0x7a13('0x37')](_[_0x7a13('0x5c')](_0x3e7d5c[_0x7a13('0x35')],_0x38cbcb['filters']));_0x590257[_0x7a13('0x40')][_0x7a13('0x57')]=_0x1a287e['id'];if(_0x3e7d5c[_0x7a13('0x35')][_0x7a13('0x41')]){_0x590257[_0x7a13('0x40')]=_[_0x7a13('0x43')](_0x590257[_0x7a13('0x40')],{'$or':_['map'](_0x590257[_0x7a13('0x39')],function(_0x39dd70){var _0x1668e8={};_0x1668e8[_0x39dd70]={'$like':'%'+_0x3e7d5c[_0x7a13('0x35')][_0x7a13('0x41')]+'%'};return _0x1668e8;})});}_0x590257=_[_0x7a13('0x43')]({},_0x590257,_0x3e7d5c[_0x7a13('0x4b')]);return db[_0x7a13('0x11f')]['count']({'where':_0x590257[_0x7a13('0x40')]})[_0x7a13('0x26')](function(_0x5e2df9){_0x5e3203[_0x7a13('0x22')]=_0x5e2df9;if(_0x3e7d5c[_0x7a13('0x35')][_0x7a13('0x44')]){_0x590257[_0x7a13('0x45')]=[{'all':!![]}];}else{_0x590257[_0x7a13('0x45')]=[{'model':db['CmContact'],'as':_0x7a13('0xe6'),'required':![]},{'model':db[_0x7a13('0xd1')],'as':_0x7a13('0x120'),'required':![]}];}return db[_0x7a13('0x11f')]['findAll'](_0x590257);})[_0x7a13('0x26')](function(_0x3c6f90){_0x5e3203[_0x7a13('0x47')]=_0x3c6f90;return _0x5e3203;});}})[_0x7a13('0x26')](respondWithFilteredResult(_0x3dfb5d,_0x590257))[_0x7a13('0x48')](handleError(_0x3dfb5d,null));};exports[_0x7a13('0x121')]=function(_0x370b67,_0x1c4616){return db[_0x7a13('0x31')]['find']({'where':{'id':_0x370b67['params']['id']}})['then'](handleEntityNotFound(_0x1c4616,null))[_0x7a13('0x26')](function(_0x560ce8){if(_0x560ce8){return _0x560ce8['addAgents'](_0x370b67[_0x7a13('0x54')]['ids'],_[_0x7a13('0x118')](_0x370b67['body'],[_0x7a13('0x5e'),'id'])||{})[_0x7a13('0xaf')](function(_0x3f5bd5){for(var _0x10627d=0x0;_0x10627d<_0x370b67[_0x7a13('0x54')][_0x7a13('0x5e')][_0x7a13('0x3b')];_0x10627d+=0x1){socket['emit'](_0x7a13('0x122'),{'UserId':Number(_0x370b67[_0x7a13('0x54')][_0x7a13('0x5e')][_0x10627d]),'ChatWebsiteId':Number(_0x370b67['params']['id'])});}return _0x3f5bd5;});}})[_0x7a13('0x26')](respondWithResult(_0x1c4616,null))[_0x7a13('0x48')](handleError(_0x1c4616,null));};exports[_0x7a13('0x123')]=function(_0x1bf363,_0x31df00){return db[_0x7a13('0x31')]['find']({'where':{'id':_0x1bf363[_0x7a13('0x4a')]['id']}})['then'](handleEntityNotFound(_0x31df00,null))[_0x7a13('0x26')](function(_0x2b07e0){if(_0x2b07e0){return _0x2b07e0[_0x7a13('0x123')](_0x1bf363[_0x7a13('0x35')][_0x7a13('0x5e')])['then'](function(){if(_['isArray'](_0x1bf363[_0x7a13('0x35')][_0x7a13('0x5e')])){for(var _0x260384=0x0;_0x260384<_0x1bf363[_0x7a13('0x35')][_0x7a13('0x5e')][_0x7a13('0x3b')];_0x260384+=0x1){socket[_0x7a13('0x124')]('userChatWebsite:remove',{'UserId':Number(_0x1bf363[_0x7a13('0x35')][_0x7a13('0x5e')][_0x260384]),'ChatWebsiteId':Number(_0x1bf363[_0x7a13('0x4a')]['id'])});}}else{socket[_0x7a13('0x124')](_0x7a13('0x125'),{'UserId':Number(_0x1bf363[_0x7a13('0x35')][_0x7a13('0x5e')]),'ChatWebsiteId':Number(_0x1bf363[_0x7a13('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x31df00,null))['catch'](handleError(_0x31df00,null));};exports[_0x7a13('0x126')]=function(_0x36e8b2,_0x20d640){var _0x8182b6={};var _0x54b127={};var _0x553206;var _0x350170;return db[_0x7a13('0x31')]['findOne']({'where':{'id':_0x36e8b2['params']['id']}})[_0x7a13('0x26')](handleEntityNotFound(_0x20d640,null))['then'](function(_0x4ee4de){if(_0x4ee4de){_0x553206=_0x4ee4de;_0x54b127['model']=_[_0x7a13('0x36')](db[_0x7a13('0xe7')]['rawAttributes']);_0x54b127[_0x7a13('0x35')]=_[_0x7a13('0x36')](_0x36e8b2[_0x7a13('0x35')]);_0x54b127['filters']=_[_0x7a13('0x38')](_0x54b127[_0x7a13('0x34')],_0x54b127['query']);_0x8182b6[_0x7a13('0x39')]=_['intersection'](_0x54b127[_0x7a13('0x34')],qs[_0x7a13('0x3a')](_0x36e8b2['query']['fields']));_0x8182b6[_0x7a13('0x39')]=_0x8182b6[_0x7a13('0x39')][_0x7a13('0x3b')]?_0x8182b6['attributes']:_0x54b127[_0x7a13('0x34')];_0x8182b6[_0x7a13('0x3e')]=qs[_0x7a13('0x3f')](_0x36e8b2[_0x7a13('0x35')][_0x7a13('0x3f')]);_0x8182b6[_0x7a13('0x40')]=qs[_0x7a13('0x37')](_[_0x7a13('0x5c')](_0x36e8b2[_0x7a13('0x35')],_0x54b127[_0x7a13('0x37')]));if(_0x36e8b2['query'][_0x7a13('0x41')]){_0x8182b6[_0x7a13('0x40')]=_[_0x7a13('0x43')](_0x8182b6[_0x7a13('0x40')],{'$or':_[_0x7a13('0x30')](_0x8182b6[_0x7a13('0x39')],function(_0x359461){var _0x5d68a3={};_0x5d68a3[_0x359461]={'$like':'%'+_0x36e8b2[_0x7a13('0x35')]['filter']+'%'};return _0x5d68a3;})});}_0x8182b6=_[_0x7a13('0x43')]({},_0x8182b6,_0x36e8b2['options']);return _0x553206['getAgents'](_0x8182b6);}})[_0x7a13('0x26')](function(_0x667284){if(_0x667284){_0x350170=_0x667284['length'];if(!_0x36e8b2[_0x7a13('0x35')]['hasOwnProperty'](_0x7a13('0x3d'))){_0x8182b6[_0x7a13('0x21')]=qs[_0x7a13('0x21')](_0x36e8b2[_0x7a13('0x35')][_0x7a13('0x21')]);_0x8182b6[_0x7a13('0x1f')]=qs[_0x7a13('0x1f')](_0x36e8b2[_0x7a13('0x35')]['offset']);}return _0x553206[_0x7a13('0x126')](_0x8182b6);}})['then'](function(_0x299123){if(_0x299123){return _0x299123?{'count':_0x350170,'rows':_0x299123}:null;}})['then'](respondWithResult(_0x20d640,null))[_0x7a13('0x48')](handleError(_0x20d640,null));}; \ No newline at end of file +var _0x591c=['agent','startRouting','EventManager','notify','offline','ListId','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','ChatOfflineMessage','originalname','mimetype','server','files','attachments','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','MailAccountId','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','NotifyMailAccount','notifyMail','offline-chat','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','getSnippet','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','custom','License','increment','all','some','x-real-ip','connection','remoteAddress','referer','replace','render','verticalAlignment','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority','finally','getApplications','chatProactiveAction','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','path','lodash','querystring','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','http','client','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','end','json','offset','limit','undefined','count','status','set','Content-Range','update','get','ChatWebsites','destroy','sendStatus','stack','name','send','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','ChatWebsite','includeAll','include','findAll','rows','show','mandatoryDispositionPause','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','Pause','params','describe','ChatWebsiteId','getDispositions','findOne','Disposition','removeDispositions','addAnswer','getAnswers','map','CannedAnswer','removeAnswers','ids','addLogo','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','getLicense','isNil','sitepic','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','user-agent','getResult','chat','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','ChatApplication','Applications','List','account','applications','list','orderBy','asc','Contacts','CmContact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User'];(function(_0x5c6022,_0x5cd10b){var _0x4ab5af=function(_0x988aff){while(--_0x988aff){_0x5c6022['push'](_0x5c6022['shift']());}};_0x4ab5af(++_0x5cd10b);}(_0x591c,0x1a1));var _0xc591=function(_0x27ff1a,_0x596dc2){_0x27ff1a=_0x27ff1a-0x0;var _0xa7f1d7=_0x591c[_0x27ff1a];return _0xa7f1d7;};'use strict';var BPromise=require(_0xc591('0x0'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc591('0x1'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc591('0x2'));var querystring=require(_0xc591('0x3'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xc591('0x4'))(_0xc591('0x5'));var config=require(_0xc591('0x6'));var db=require(_0xc591('0x7'))['db'];config['redis']=_[_0xc591('0x8')](config[_0xc591('0x9')],{'host':_0xc591('0xa'),'port':0x18eb});var socket=require(_0xc591('0xb'))(new Redis(config[_0xc591('0x9')]));require(_0xc591('0xc'))[_0xc591('0xd')](socket);var htmlToText=require(_0xc591('0xe'));var jayson=require(_0xc591('0xf'));var client=jayson['client'][_0xc591('0x10')]({'port':0x232c});var client9002=jayson[_0xc591('0x11')][_0xc591('0x10')]({'port':0x232a});var client9003=jayson['client'][_0xc591('0x10')]({'port':0x232b});var client9001=jayson['client'][_0xc591('0x10')]({'port':0x2329});function respondWithRpcPromise(_0xcb9b99,_0x56a472,_0x417148,_0x517167){return new BPromise(function(_0x4925b0,_0x1732f9){var _0x566130=_0x517167||client;return _0x566130[_0xc591('0x12')](_0xcb9b99,_0x417148)[_0xc591('0x13')](function(_0x5d8c6c){logger['info'](_0xc591('0x14'),_0x56a472,_0xc591('0x15'));logger[_0xc591('0x16')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x56a472,_0xc591('0x15'),JSON[_0xc591('0x17')](_0x5d8c6c));if(_0x5d8c6c[_0xc591('0x18')]){if(_0x5d8c6c[_0xc591('0x18')][_0xc591('0x19')]===0x1f4){logger[_0xc591('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x56a472,_0x5d8c6c[_0xc591('0x18')][_0xc591('0x1a')]);return _0x1732f9(_0x5d8c6c[_0xc591('0x18')][_0xc591('0x1a')]);}logger[_0xc591('0x18')](_0xc591('0x14'),_0x56a472,_0x5d8c6c['error']['message']);return _0x4925b0(_0x5d8c6c[_0xc591('0x18')][_0xc591('0x1a')]);}else{logger[_0xc591('0x1b')]('ChatWebsite,\x20%s,\x20%s',_0x56a472,'request\x20sent');_0x4925b0(_0x5d8c6c[_0xc591('0x1c')]['message']);}})[_0xc591('0x1d')](function(_0x11d3b8){logger[_0xc591('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x56a472,_0x11d3b8);_0x1732f9(_0x11d3b8);});});}function respondWithStatusCode(_0x3310c2,_0x1330c6){_0x1330c6=_0x1330c6||0xcc;return function(_0x5580b4){if(_0x5580b4){return _0x3310c2['sendStatus'](_0x1330c6);}return _0x3310c2['status'](_0x1330c6)[_0xc591('0x1e')]();};}function respondWithResult(_0x460ff6,_0x3fdb3a){_0x3fdb3a=_0x3fdb3a||0xc8;return function(_0x149929){if(_0x149929){return _0x460ff6['status'](_0x3fdb3a)[_0xc591('0x1f')](_0x149929);}};}function respondWithFilteredResult(_0x13d07b,_0x5460fb){return function(_0x3d0674){if(_0x3d0674){var _0xae787=typeof _0x5460fb[_0xc591('0x20')]==='undefined'&&typeof _0x5460fb[_0xc591('0x21')]===_0xc591('0x22');var _0x32051e=_0x3d0674[_0xc591('0x23')];var _0x511131=_0xae787?0x0:_0x5460fb['offset'];var _0x6ba746=_0xae787?_0x3d0674[_0xc591('0x23')]:_0x5460fb['offset']+_0x5460fb[_0xc591('0x21')];var _0x4ae2c4;if(_0x6ba746>=_0x32051e){_0x6ba746=_0x32051e;_0x4ae2c4=0xc8;}else{_0x4ae2c4=0xce;}_0x13d07b[_0xc591('0x24')](_0x4ae2c4);return _0x13d07b[_0xc591('0x25')](_0xc591('0x26'),_0x511131+'-'+_0x6ba746+'/'+_0x32051e)[_0xc591('0x1f')](_0x3d0674);}return null;};}function saveUpdates(_0x3370fc){return function(_0x2f2108){if(_0x2f2108){return _0x2f2108[_0xc591('0x27')](_0x3370fc)['then'](function(_0x4626ed){return _0x4626ed;});}return null;};}function removeEntity(_0x3e64d3){return function(_0x37f967){if(_0x37f967){return _0x37f967['destroy']()[_0xc591('0x13')](function(){var _0x60a65d=_0x37f967[_0xc591('0x28')]({'plain':!![]});var _0x48396a=_0xc591('0x29');return db['UserProfileResource'][_0xc591('0x2a')]({'where':{'type':_0x48396a,'resourceId':_0x60a65d['id']}})[_0xc591('0x13')](function(){return _0x37f967;});})[_0xc591('0x13')](function(){_0x3e64d3[_0xc591('0x24')](0xcc)[_0xc591('0x1e')]();});}};}function handleEntityNotFound(_0x90f3a9){return function(_0x5876ca){if(!_0x5876ca){_0x90f3a9[_0xc591('0x2b')](0x194);}return _0x5876ca;};}function handleError(_0x5ad618,_0x14e7af){_0x14e7af=_0x14e7af||0x1f4;return function(_0x2cdc03){logger[_0xc591('0x18')](_0x2cdc03[_0xc591('0x2c')]);if(_0x2cdc03['name']){delete _0x2cdc03[_0xc591('0x2d')];}_0x5ad618['status'](_0x14e7af)[_0xc591('0x2e')](_0x2cdc03);};}exports['index']=function(_0x5d186c,_0xac07f5){var _0x8b2cc8={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x48782f={},_0x45eba8={'count':0x0,'rows':[]};var _0x8d831f=_['map'](db['ChatWebsite'][_0xc591('0x2f')],function(_0xdb2c5){return{'name':_0xdb2c5[_0xc591('0x30')],'type':_0xdb2c5[_0xc591('0x31')]['key']};});_0x48782f['model']=_['map'](_0x8d831f,_0xc591('0x2d'));_0x48782f[_0xc591('0x32')]=_[_0xc591('0x33')](_0x5d186c[_0xc591('0x32')]);_0x48782f[_0xc591('0x34')]=_[_0xc591('0x35')](_0x48782f[_0xc591('0x36')],_0x48782f[_0xc591('0x32')]);_0x8b2cc8['attributes']=_[_0xc591('0x35')](_0x48782f[_0xc591('0x36')],qs[_0xc591('0x37')](_0x5d186c[_0xc591('0x32')]['fields']));_0x8b2cc8[_0xc591('0x38')]=_0x8b2cc8['attributes'][_0xc591('0x39')]?_0x8b2cc8[_0xc591('0x38')]:_0x48782f[_0xc591('0x36')];if(!_0x5d186c[_0xc591('0x32')][_0xc591('0x3a')](_0xc591('0x3b'))){_0x8b2cc8[_0xc591('0x21')]=qs[_0xc591('0x21')](_0x5d186c[_0xc591('0x32')][_0xc591('0x21')]);_0x8b2cc8['offset']=qs[_0xc591('0x20')](_0x5d186c[_0xc591('0x32')][_0xc591('0x20')]);}_0x8b2cc8[_0xc591('0x3c')]=qs['sort'](_0x5d186c[_0xc591('0x32')][_0xc591('0x3d')]);_0x8b2cc8[_0xc591('0x3e')]=qs[_0xc591('0x34')](_[_0xc591('0x3f')](_0x5d186c[_0xc591('0x32')],_0x48782f[_0xc591('0x34')]),_0x8d831f);if(_0x5d186c[_0xc591('0x32')]['filter']){_0x8b2cc8[_0xc591('0x3e')]=_[_0xc591('0x40')](_0x8b2cc8['where'],{'$or':_['map'](_0x8d831f,function(_0x20fc86){if(_0x20fc86[_0xc591('0x31')]!==_0xc591('0x41')){var _0x31e028={};_0x31e028[_0x20fc86[_0xc591('0x2d')]]={'$like':'%'+_0x5d186c[_0xc591('0x32')][_0xc591('0x42')]+'%'};return _0x31e028;}})});}_0x8b2cc8=_['merge']({},_0x8b2cc8,_0x5d186c[_0xc591('0x43')]);var _0x1ee7cc={'where':_0x8b2cc8[_0xc591('0x3e')]};return db[_0xc591('0x44')][_0xc591('0x23')](_0x1ee7cc)[_0xc591('0x13')](function(_0x498113){_0x45eba8[_0xc591('0x23')]=_0x498113;if(_0x5d186c['query'][_0xc591('0x45')]){_0x8b2cc8[_0xc591('0x46')]=[{'all':!![]}];}return db[_0xc591('0x44')][_0xc591('0x47')](_0x8b2cc8);})[_0xc591('0x13')](function(_0x694f7){_0x45eba8[_0xc591('0x48')]=_0x694f7;return _0x45eba8;})[_0xc591('0x13')](respondWithFilteredResult(_0xac07f5,_0x8b2cc8))[_0xc591('0x1d')](handleError(_0xac07f5,null));};exports[_0xc591('0x49')]=function(_0x4b9071,_0x3ea631){var _0x39bbd3={'raw':![],'where':{'id':_0x4b9071['params']['id']},'include':[{'model':db['Pause'],'as':_0xc591('0x4a')}]},_0x410b5e={};_0x410b5e[_0xc591('0x36')]=_[_0xc591('0x33')](db[_0xc591('0x44')][_0xc591('0x2f')]);_0x410b5e['query']=_[_0xc591('0x33')](_0x4b9071[_0xc591('0x32')]);_0x410b5e[_0xc591('0x34')]=_[_0xc591('0x35')](_0x410b5e[_0xc591('0x36')],_0x410b5e[_0xc591('0x32')]);_0x39bbd3['attributes']=_[_0xc591('0x35')](_0x410b5e[_0xc591('0x36')],qs['fields'](_0x4b9071[_0xc591('0x32')][_0xc591('0x37')]));_0x39bbd3['attributes']=_0x39bbd3[_0xc591('0x38')][_0xc591('0x39')]?_0x39bbd3['attributes']:_0x410b5e[_0xc591('0x36')];if(_0x4b9071['query'][_0xc591('0x45')]){_0x39bbd3[_0xc591('0x46')]=[{'all':!![]}];}_0x39bbd3=_[_0xc591('0x40')]({},_0x39bbd3,_0x4b9071[_0xc591('0x43')]);return db[_0xc591('0x44')]['find'](_0x39bbd3)['then'](handleEntityNotFound(_0x3ea631,null))[_0xc591('0x13')](respondWithResult(_0x3ea631,null))['catch'](handleError(_0x3ea631,null));};exports[_0xc591('0x4b')]=function(_0x1ae8fe,_0x4a349f){return db['ChatWebsite']['create'](_0x1ae8fe[_0xc591('0x4c')],{})[_0xc591('0x13')](function(_0x3a11a4){var _0x543716=_0x1ae8fe[_0xc591('0x4d')][_0xc591('0x28')]({'plain':!![]});if(!_0x543716)throw new Error(_0xc591('0x4e'));if(_0x543716[_0xc591('0x4f')]===_0xc591('0x4d')){var _0x2d3431=_0x3a11a4['get']({'plain':!![]});var _0x1d0b73='ChatWebsites';return db[_0xc591('0x50')]['find']({'where':{'name':_0x1d0b73,'userProfileId':_0x543716[_0xc591('0x51')]},'raw':!![]})[_0xc591('0x13')](function(_0xe38d5){if(_0xe38d5&&_0xe38d5[_0xc591('0x52')]===0x0){return db[_0xc591('0x53')]['create']({'name':_0x2d3431[_0xc591('0x2d')],'resourceId':_0x2d3431['id'],'type':_0xe38d5[_0xc591('0x2d')],'sectionId':_0xe38d5['id']},{})[_0xc591('0x13')](function(){return _0x3a11a4;});}else{return _0x3a11a4;}})[_0xc591('0x1d')](function(_0x5f2227){logger[_0xc591('0x18')](_0xc591('0x54'),_0x5f2227);throw _0x5f2227;});}return _0x3a11a4;})[_0xc591('0x13')](respondWithResult(_0x4a349f,0xc9))[_0xc591('0x1d')](handleError(_0x4a349f,null));};exports['update']=function(_0x1ee6ee,_0x2da3ae){if(_0x1ee6ee[_0xc591('0x4c')]['id']){delete _0x1ee6ee[_0xc591('0x4c')]['id'];}return db['ChatWebsite'][_0xc591('0x55')]({'where':{'id':_0x1ee6ee['params']['id']},'include':[{'model':db[_0xc591('0x56')],'as':'mandatoryDispositionPause'}]})[_0xc591('0x13')](handleEntityNotFound(_0x2da3ae,null))[_0xc591('0x13')](saveUpdates(_0x1ee6ee['body'],null))[_0xc591('0x13')](respondWithResult(_0x2da3ae,null))['catch'](handleError(_0x2da3ae,null));};exports[_0xc591('0x2a')]=function(_0x376180,_0x390272){return db['ChatWebsite'][_0xc591('0x55')]({'where':{'id':_0x376180[_0xc591('0x57')]['id']}})[_0xc591('0x13')](handleEntityNotFound(_0x390272,null))[_0xc591('0x13')](removeEntity(_0x390272,null))[_0xc591('0x1d')](handleError(_0x390272,null));};exports['describe']=function(_0x337862,_0x41b471){return db[_0xc591('0x44')][_0xc591('0x58')]()['then'](respondWithResult(_0x41b471,null))[_0xc591('0x1d')](handleError(_0x41b471,null));};exports['addDisposition']=function(_0xfbc3f4,_0x3347f7){if(_0xfbc3f4[_0xc591('0x4c')]['id']){delete _0xfbc3f4[_0xc591('0x4c')]['id'];}return db[_0xc591('0x44')]['find']({'where':{'id':_0xfbc3f4[_0xc591('0x57')]['id']}})[_0xc591('0x13')](handleEntityNotFound(_0x3347f7,null))[_0xc591('0x13')](function(_0x4db306){if(_0x4db306){_0xfbc3f4[_0xc591('0x4c')][_0xc591('0x59')]=_0x4db306['id'];return db['Disposition'][_0xc591('0x4b')](_0xfbc3f4[_0xc591('0x4c')]);}})[_0xc591('0x13')](respondWithResult(_0x3347f7,null))[_0xc591('0x1d')](handleError(_0x3347f7,null));};exports[_0xc591('0x5a')]=function(_0x364d50,_0x6251b){var _0x9e6443={'raw':![],'where':{}};var _0x291dfe={};var _0x57efa0={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc591('0x5b')]({'where':{'id':_0x364d50[_0xc591('0x57')]['id']}})[_0xc591('0x13')](handleEntityNotFound(_0x6251b,null))['then'](function(_0x4226b7){if(_0x4226b7){_0x291dfe[_0xc591('0x36')]=_['keys'](db['Disposition'][_0xc591('0x2f')]);_0x291dfe[_0xc591('0x32')]=_[_0xc591('0x33')](_0x364d50['query']);_0x291dfe['filters']=_[_0xc591('0x35')](_0x291dfe[_0xc591('0x36')],_0x291dfe[_0xc591('0x32')]);_0x9e6443[_0xc591('0x38')]=_[_0xc591('0x35')](_0x291dfe[_0xc591('0x36')],qs[_0xc591('0x37')](_0x364d50[_0xc591('0x32')][_0xc591('0x37')]));_0x9e6443[_0xc591('0x38')]=_0x9e6443[_0xc591('0x38')][_0xc591('0x39')]?_0x9e6443[_0xc591('0x38')]:_0x291dfe[_0xc591('0x36')];if(!_0x364d50['query'][_0xc591('0x3a')]('nolimit')){_0x9e6443['limit']=qs[_0xc591('0x21')](_0x364d50[_0xc591('0x32')]['limit']);_0x9e6443[_0xc591('0x20')]=qs[_0xc591('0x20')](_0x364d50['query'][_0xc591('0x20')]);}_0x9e6443[_0xc591('0x3c')]=qs[_0xc591('0x3d')](_0x364d50['query']['sort']);_0x9e6443[_0xc591('0x3e')]=qs[_0xc591('0x34')](_[_0xc591('0x3f')](_0x364d50[_0xc591('0x32')],_0x291dfe['filters']));_0x9e6443['where'][_0xc591('0x59')]=_0x4226b7['id'];if(_0x364d50[_0xc591('0x32')][_0xc591('0x42')]){_0x9e6443[_0xc591('0x3e')]=_['merge'](_0x9e6443[_0xc591('0x3e')],{'$or':_['map'](_0x9e6443[_0xc591('0x38')],function(_0x55420b){var _0x25adbf={};_0x25adbf[_0x55420b]={'$like':'%'+_0x364d50[_0xc591('0x32')]['filter']+'%'};return _0x25adbf;})});}_0x9e6443=_[_0xc591('0x40')]({},_0x9e6443,_0x364d50[_0xc591('0x43')]);return db[_0xc591('0x5c')][_0xc591('0x23')]({'where':_0x9e6443[_0xc591('0x3e')]})[_0xc591('0x13')](function(_0x10b317){_0x57efa0[_0xc591('0x23')]=_0x10b317;if(_0x364d50['query']['includeAll']){_0x9e6443[_0xc591('0x46')]=[{'all':!![]}];}return db[_0xc591('0x5c')][_0xc591('0x47')](_0x9e6443);})[_0xc591('0x13')](function(_0x32101b){_0x57efa0[_0xc591('0x48')]=_0x32101b;return _0x57efa0;});}})[_0xc591('0x13')](respondWithFilteredResult(_0x6251b,_0x9e6443))['catch'](handleError(_0x6251b,null));};exports[_0xc591('0x5d')]=function(_0x10248c,_0x27780b){return db['ChatWebsite']['find']({'where':{'id':_0x10248c[_0xc591('0x57')]['id']}})['then'](handleEntityNotFound(_0x27780b,null))[_0xc591('0x13')](function(_0x130c6d){if(_0x130c6d){return _0x130c6d[_0xc591('0x5d')](_0x10248c[_0xc591('0x32')]['ids']);}})[_0xc591('0x13')](respondWithStatusCode(_0x27780b,null))[_0xc591('0x1d')](handleError(_0x27780b,null));};exports[_0xc591('0x5e')]=function(_0x13233e,_0x4bbb69){if(_0x13233e[_0xc591('0x4c')]['id']){delete _0x13233e[_0xc591('0x4c')]['id'];}return db['ChatWebsite'][_0xc591('0x55')]({'where':{'id':_0x13233e[_0xc591('0x57')]['id']}})[_0xc591('0x13')](handleEntityNotFound(_0x4bbb69,null))[_0xc591('0x13')](function(_0x183b3b){if(_0x183b3b){_0x13233e[_0xc591('0x4c')][_0xc591('0x59')]=_0x183b3b['id'];return db['CannedAnswer'][_0xc591('0x4b')](_0x13233e[_0xc591('0x4c')]);}})[_0xc591('0x13')](respondWithResult(_0x4bbb69,null))[_0xc591('0x1d')](handleError(_0x4bbb69,null));};exports[_0xc591('0x5f')]=function(_0x568e0a,_0x5f0908){var _0x2fcd39={'raw':![],'where':{}};var _0x467964={};var _0x2e0c59={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc591('0x5b')]({'where':{'id':_0x568e0a[_0xc591('0x57')]['id']}})['then'](handleEntityNotFound(_0x5f0908,null))[_0xc591('0x13')](function(_0x3f38f7){if(_0x3f38f7){_0x467964[_0xc591('0x36')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x467964['query']=_[_0xc591('0x33')](_0x568e0a[_0xc591('0x32')]);_0x467964[_0xc591('0x34')]=_['intersection'](_0x467964[_0xc591('0x36')],_0x467964['query']);_0x2fcd39[_0xc591('0x38')]=_[_0xc591('0x35')](_0x467964[_0xc591('0x36')],qs['fields'](_0x568e0a[_0xc591('0x32')][_0xc591('0x37')]));_0x2fcd39[_0xc591('0x38')]=_0x2fcd39[_0xc591('0x38')][_0xc591('0x39')]?_0x2fcd39[_0xc591('0x38')]:_0x467964[_0xc591('0x36')];if(!_0x568e0a[_0xc591('0x32')][_0xc591('0x3a')](_0xc591('0x3b'))){_0x2fcd39['limit']=qs[_0xc591('0x21')](_0x568e0a['query'][_0xc591('0x21')]);_0x2fcd39[_0xc591('0x20')]=qs[_0xc591('0x20')](_0x568e0a[_0xc591('0x32')][_0xc591('0x20')]);}_0x2fcd39['order']=qs[_0xc591('0x3d')](_0x568e0a[_0xc591('0x32')]['sort']);_0x2fcd39[_0xc591('0x3e')]=qs[_0xc591('0x34')](_['pick'](_0x568e0a[_0xc591('0x32')],_0x467964[_0xc591('0x34')]));_0x2fcd39[_0xc591('0x3e')][_0xc591('0x59')]=_0x3f38f7['id'];if(_0x568e0a[_0xc591('0x32')]['filter']){_0x2fcd39[_0xc591('0x3e')]=_['merge'](_0x2fcd39[_0xc591('0x3e')],{'$or':_[_0xc591('0x60')](_0x2fcd39[_0xc591('0x38')],function(_0x5d8563){var _0x3f33b9={};_0x3f33b9[_0x5d8563]={'$like':'%'+_0x568e0a[_0xc591('0x32')]['filter']+'%'};return _0x3f33b9;})});}_0x2fcd39=_[_0xc591('0x40')]({},_0x2fcd39,_0x568e0a[_0xc591('0x43')]);return db[_0xc591('0x61')][_0xc591('0x23')]({'where':_0x2fcd39[_0xc591('0x3e')]})[_0xc591('0x13')](function(_0xffee00){_0x2e0c59[_0xc591('0x23')]=_0xffee00;if(_0x568e0a[_0xc591('0x32')]['includeAll']){_0x2fcd39[_0xc591('0x46')]=[{'all':!![]}];}return db[_0xc591('0x61')][_0xc591('0x47')](_0x2fcd39);})[_0xc591('0x13')](function(_0x51007e){_0x2e0c59[_0xc591('0x48')]=_0x51007e;return _0x2e0c59;});}})[_0xc591('0x13')](respondWithFilteredResult(_0x5f0908,_0x2fcd39))[_0xc591('0x1d')](handleError(_0x5f0908,null));};exports[_0xc591('0x62')]=function(_0x53f440,_0x3f3272){return db[_0xc591('0x44')]['find']({'where':{'id':_0x53f440['params']['id']}})[_0xc591('0x13')](handleEntityNotFound(_0x3f3272,null))[_0xc591('0x13')](function(_0x258262){if(_0x258262){return _0x258262[_0xc591('0x62')](_0x53f440['query'][_0xc591('0x63')]);}})[_0xc591('0x13')](respondWithStatusCode(_0x3f3272,null))['catch'](handleError(_0x3f3272,null));};exports[_0xc591('0x64')]=function(_0x1140e0,_0x5b75ee){_0x1140e0[_0xc591('0x4c')]['sitepic']=_0x1140e0[_0xc591('0x65')][_0xc591('0x66')];return db[_0xc591('0x44')][_0xc591('0x55')]({'where':{'id':_0x1140e0[_0xc591('0x57')]['id']}})['then'](handleEntityNotFound(_0x5b75ee,null))['then'](saveUpdates(_0x1140e0[_0xc591('0x4c')],null))[_0xc591('0x13')](respondWithResult(_0x5b75ee,null))[_0xc591('0x1d')](handleError(_0x5b75ee,null));};exports[_0xc591('0x67')]=function(_0x382590,_0x47e96a){_0x382590[_0xc591('0x4c')]['agentAvatar']=_0x382590[_0xc591('0x65')][_0xc591('0x66')];return db[_0xc591('0x44')][_0xc591('0x55')]({'where':{'id':_0x382590[_0xc591('0x57')]['id']}})[_0xc591('0x13')](handleEntityNotFound(_0x47e96a,null))[_0xc591('0x13')](saveUpdates(_0x382590['body'],null))[_0xc591('0x13')](respondWithResult(_0x47e96a,null))['catch'](handleError(_0x47e96a,null));};exports[_0xc591('0x68')]=function(_0x4207cd,_0x5b588d){_0x4207cd[_0xc591('0x4c')][_0xc591('0x69')]=_0x4207cd[_0xc591('0x65')]['filename'];return db[_0xc591('0x44')][_0xc591('0x55')]({'where':{'id':_0x4207cd[_0xc591('0x57')]['id']}})[_0xc591('0x13')](handleEntityNotFound(_0x5b588d,null))['then'](saveUpdates(_0x4207cd['body'],null))['then'](respondWithResult(_0x5b588d,null))[_0xc591('0x1d')](handleError(_0x5b588d,null));};exports[_0xc591('0x6a')]=function(_0x134908,_0x2f9b4e){_0x134908['body'][_0xc591('0x6b')]=_0x134908[_0xc591('0x65')][_0xc591('0x66')];return db[_0xc591('0x44')][_0xc591('0x55')]({'where':{'id':_0x134908['params']['id']}})[_0xc591('0x13')](handleEntityNotFound(_0x2f9b4e,null))[_0xc591('0x13')](saveUpdates(_0x134908[_0xc591('0x4c')],null))['then'](respondWithResult(_0x2f9b4e,null))['catch'](handleError(_0x2f9b4e,null));};exports[_0xc591('0x6c')]=function(_0x1952d,_0x1242b2){var _0x42d650=path[_0xc591('0x6d')](config['root'],_0xc591('0x6e'));var _0x7790c0={'where':{'id':_0x1952d[_0xc591('0x57')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0xf58cf9=![];return require('../../config/license/util')[_0xc591('0x6f')]()[_0xc591('0x13')](function(_0x301b00){if(_0x301b00){_0xf58cf9=_0x301b00['custom'];}})['then'](function(){return db[_0xc591('0x44')][_0xc591('0x55')](_0x7790c0);})[_0xc591('0x13')](handleEntityNotFound(_0x1242b2,null))[_0xc591('0x13')](function(_0x3324d5){if(_0x3324d5){if(!_[_0xc591('0x70')](_0x3324d5[_0xc591('0x71')])){if(fs[_0xc591('0x72')](path['join'](config[_0xc591('0x73')],_0xc591('0x74'),_0x3324d5['sitepic']))&&_0xf58cf9){_0x42d650=path[_0xc591('0x6d')](config[_0xc591('0x73')],_0xc591('0x74'),_0x3324d5[_0xc591('0x71')]);}}return _0x1242b2[_0xc591('0x75')](_0x42d650);}})[_0xc591('0x1d')](handleError(_0x1242b2,null));};exports[_0xc591('0x76')]=function(_0x50478d,_0xa05c78){var _0x3703cb=path['join'](config['root'],_0xc591('0x77'));var _0xe65d8c={'where':{'id':_0x50478d[_0xc591('0x57')]['id']},'attributes':['id',_0xc591('0x78')],'raw':!![]};return db[_0xc591('0x44')][_0xc591('0x55')](_0xe65d8c)['then'](handleEntityNotFound(_0xa05c78,null))[_0xc591('0x13')](function(_0x27c8ea){if(_0x27c8ea){if(!_[_0xc591('0x70')](_0x27c8ea[_0xc591('0x78')])){if(fs[_0xc591('0x72')](path[_0xc591('0x6d')](config[_0xc591('0x73')],'server/files/images/avatars/',_0x27c8ea['agentAvatar']))){_0x3703cb=path[_0xc591('0x6d')](config['root'],_0xc591('0x79'),_0x27c8ea[_0xc591('0x78')]);}}return _0xa05c78[_0xc591('0x75')](_0x3703cb);}})[_0xc591('0x1d')](handleError(_0xa05c78,null));};exports[_0xc591('0x7a')]=function(_0x1acec8,_0xc411f1){var _0x24d122=path['join'](config['root'],_0xc591('0x7b'));var _0x1bfc9d={'where':{'id':_0x1acec8['params']['id']},'attributes':['id',_0xc591('0x69'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0x1bfc9d)[_0xc591('0x13')](handleEntityNotFound(_0xc411f1,null))['then'](function(_0x4757a0){if(_0x4757a0){if(!_['isNil'](_0x4757a0[_0xc591('0x69')])){if(fs[_0xc591('0x72')](path[_0xc591('0x6d')](config[_0xc591('0x73')],'server/files/images/avatars/',_0x4757a0['customerAvatar']))&&_0x4757a0[_0xc591('0x7c')]){_0x24d122=path['join'](config[_0xc591('0x73')],'server/files/images/avatars/',_0x4757a0[_0xc591('0x69')]);}}return _0xc411f1[_0xc591('0x75')](_0x24d122);}})['catch'](handleError(_0xc411f1,null));};exports[_0xc591('0x7d')]=function(_0x2b1763,_0x34deaa){var _0xd90e4a=path[_0xc591('0x6d')](config[_0xc591('0x73')],_0xc591('0x7e'));var _0x454106={'where':{'id':_0x2b1763[_0xc591('0x57')]['id']},'attributes':['id',_0xc591('0x6b')],'raw':!![]};return db['ChatWebsite'][_0xc591('0x55')](_0x454106)['then'](handleEntityNotFound(_0x34deaa,null))[_0xc591('0x13')](function(_0x2a32b8){if(_0x2a32b8){if(!_[_0xc591('0x70')](_0x2a32b8[_0xc591('0x6b')])){if(fs['existsSync'](path[_0xc591('0x6d')](config[_0xc591('0x73')],_0xc591('0x79'),_0x2a32b8['systemAvatar']))){_0xd90e4a=path[_0xc591('0x6d')](config[_0xc591('0x73')],_0xc591('0x79'),_0x2a32b8[_0xc591('0x6b')]);}}return _0x34deaa[_0xc591('0x75')](_0xd90e4a);}})[_0xc591('0x1d')](handleError(_0x34deaa,null));};exports['notify']=function(_0x4a094f,_0x398800){var _0x370895=require(_0xc591('0x7f'));var _0x1e5191=new _0x370895();var _0x37f92b=_0x1e5191[_0xc591('0x80')](_0x4a094f['headers'][_0xc591('0x81')])[_0xc591('0x82')]();var _0x2841f2={'body':_0x4a094f['body'],'channel':_0xc591('0x83')};var _0x27397e=[];var _0x3e45a8=[];var _0x5640bd={};var _0x32739f=![];return db['CmContact'][_0xc591('0x58')]()['then'](function(_0x8750d3){if(!_0x8750d3){throw new db[(_0xc591('0x84'))][(_0xc591('0x85'))](_0xc591('0x86'));}_0x27397e=_['difference'](_[_0xc591('0x33')](_0x8750d3),['createdAt',_0xc591('0x87')]);_0x3e45a8=_[_0xc591('0x88')](_[_0xc591('0x33')](_0x8750d3),[_0xc591('0x89'),_0xc591('0x87'),_0xc591('0x8a'),'ListId']);if(_0x4a094f[_0xc591('0x4c')]['id']){delete _0x4a094f[_0xc591('0x4c')]['id'];}if(_[_0xc591('0x70')](_0x4a094f[_0xc591('0x4c')][_0xc591('0x8b')])){throw new db[(_0xc591('0x84'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xc591('0x70')](_0x4a094f[_0xc591('0x4c')][_0xc591('0x4c')])||_0x4a094f[_0xc591('0x4c')][_0xc591('0x4c')]===''){throw new db['Sequelize'][(_0xc591('0x85'))](_0xc591('0x8c'));}if(_[_0xc591('0x70')](_0x4a094f[_0xc591('0x4c')][_0xc591('0x8d')])){throw new db[(_0xc591('0x84'))][(_0xc591('0x85'))](_0xc591('0x8e')+_0x3e45a8);}if(!_['includes'](_0x3e45a8,_0x4a094f['body'][_0xc591('0x8d')])){throw new db[(_0xc591('0x84'))]['ValidationError'](_0xc591('0x8f')+_0x3e45a8);}_0x5640bd[_0x4a094f[_0xc591('0x4c')]['mapKey']]=_0x4a094f[_0xc591('0x4c')][_0xc591('0x8b')];})[_0xc591('0x13')](function(){return db[_0xc591('0x44')][_0xc591('0x55')]({'where':{'id':_0x4a094f[_0xc591('0x57')]['id']},'include':[{'model':db[_0xc591('0x90')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x5640bd,'limit':0x1,'order':[[_0xc591('0x87'),_0xc591('0x91')]]}]},{'model':db[_0xc591('0x92')],'as':_0xc591('0x93')}]});})['then'](handleEntityNotFound(_0x398800,null))[_0xc591('0x13')](function(_0x523dd7){if(_0x523dd7&&_0x523dd7[_0xc591('0x94')]){_0x2841f2[_0xc591('0x95')]=_0x523dd7;_0x2841f2[_0xc591('0x96')]=_0x523dd7['Applications'];_0x2841f2[_0xc591('0x97')]=_0x523dd7[_0xc591('0x94')];_0x2841f2['applications']=_[_0xc591('0x98')](_0x2841f2[_0xc591('0x96')],['priority'],[_0xc591('0x99')]);if(_0x2841f2[_0xc591('0x95')][_0xc591('0x93')]){delete _0x2841f2['account'][_0xc591('0x93')];}if(_0x2841f2[_0xc591('0x95')][_0xc591('0x94')]&&_0x2841f2[_0xc591('0x95')][_0xc591('0x94')][_0xc591('0x9a')][_0xc591('0x39')]){return _0x2841f2[_0xc591('0x95')]['List'][_0xc591('0x9a')][0x0];}var _0x299c2c=_[_0xc591('0x8')](_0x4a094f[_0xc591('0x4c')],{'firstName':_0x4a094f[_0xc591('0x4c')][_0xc591('0x8b')],'ListId':_0x523dd7['ListId']});_0x299c2c[_0x4a094f[_0xc591('0x4c')][_0xc591('0x8d')]]=_0x4a094f[_0xc591('0x4c')][_0xc591('0x8b')];return db[_0xc591('0x9b')][_0xc591('0x4b')](_0x299c2c,{'fields':_0x27397e,'raw':!![]});}})['then'](handleEntityNotFound(_0x398800,null))[_0xc591('0x13')](function(_0x539722){_0x2841f2['contact']=_0x539722;var _0x2115a3=_0x4a094f[_0xc591('0x4c')][_0xc591('0x9c')];if(_0x4a094f[_0xc591('0x9d')][_0xc591('0x9e')]){_0x2115a3=_0x4a094f[_0xc591('0x9d')][_0xc591('0x9e')];}else if(_0x4a094f[_0xc591('0x9d')][_0xc591('0x9f')]){_0x2115a3=_[_0xc591('0xa0')](_0x4a094f[_0xc591('0x9d')][_0xc591('0x9f')][_0xc591('0xa1')](','));}if(_0x539722){var _0xdfce15={'ContactId':_0x539722['id'],'ChatWebsiteId':_0x4a094f[_0xc591('0x57')]['id'],'from':(_0x539722[_0xc591('0xa2')]||'')+'\x20'+(_0x539722[_0xc591('0xa3')]||''),'customerIp':_0x2115a3,'customerPort':_0x4a094f[_0xc591('0x9d')][_0xc591('0xa4')]?_0x4a094f[_0xc591('0x9d')][_0xc591('0xa4')]:null,'referer':_0x4a094f['body']['referer'],'browserName':_0x37f92b[_0xc591('0xa5')][_0xc591('0x2d')]&&_0x37f92b[_0xc591('0xa5')][_0xc591('0xa6')]?util[_0xc591('0xa7')](_0xc591('0xa8'),_0x37f92b[_0xc591('0xa5')][_0xc591('0x2d')],_0x37f92b[_0xc591('0xa5')][_0xc591('0xa6')]):_0xc591('0xa9'),'browserVersion':_0x37f92b[_0xc591('0xa5')][_0xc591('0xa6')]||_0xc591('0xa9'),'osName':util['format'](_0xc591('0xa8'),_0x37f92b['os']['name'],_0x37f92b['os'][_0xc591('0xa6')]),'osVersion':_0x37f92b['os'][_0xc591('0xa6')],'deviceModel':_0x37f92b[_0xc591('0xaa')][_0xc591('0x36')]&&_0x37f92b[_0xc591('0xaa')][_0xc591('0xab')]?util['format'](_0xc591('0xac'),_0x37f92b[_0xc591('0xaa')][_0xc591('0x36')],_0x37f92b[_0xc591('0xaa')][_0xc591('0xab')],_0x37f92b[_0xc591('0xaa')][_0xc591('0x31')]):null,'deviceVendor':_0x37f92b[_0xc591('0xaa')][_0xc591('0xab')],'deviceType':_0x37f92b[_0xc591('0xaa')][_0xc591('0x31')],'formData':JSON[_0xc591('0x17')](_0x4a094f[_0xc591('0x4c')])};var _0x1725ab={'ChatWebsiteId':_0x4a094f[_0xc591('0x57')]['id'],'closed':![]};if(_0x4a094f['body'][_0xc591('0xad')]){_0x1725ab['threadId']=_0x4a094f[_0xc591('0x4c')][_0xc591('0xad')];return db[_0xc591('0xae')][_0xc591('0x55')]({'where':_0x1725ab})['then'](function(_0x1c70b7){if(_0x1c70b7){return[_0x1c70b7,![]];}_0xdfce15[_0xc591('0xad')]=_0x4a094f['body'][_0xc591('0xad')];_0xdfce15[_0xc591('0xaf')]=_0x4a094f[_0xc591('0x4c')][_0xc591('0xaf')];return db[_0xc591('0xae')][_0xc591('0x4b')](_0xdfce15)[_0xc591('0x13')](function(_0x4b20bf){return[_0x4b20bf,!![]];});});}_0x1725ab[_0xc591('0xb0')]=_0x539722['id'];if(_0x4a094f['body']['interaction']&&_0x4a094f[_0xc591('0x4c')]['interaction']['id']){_0x1725ab['id']=_0x4a094f[_0xc591('0x4c')][_0xc591('0xb1')]['id'];return db[_0xc591('0xae')][_0xc591('0x55')]({'where':_0x1725ab})[_0xc591('0x13')](function(_0x5672ef){if(_0x5672ef){return[_0x5672ef,![]];}return db[_0xc591('0xae')][_0xc591('0x4b')](_0xdfce15)['then'](function(_0x1d0220){return[_0x1d0220,!![]];});});}return db[_0xc591('0xae')][_0xc591('0x4b')](_0xdfce15)[_0xc591('0x13')](function(_0x1c0658){return[_0x1c0658,!![]];});}})[_0xc591('0xb2')](function(_0x2fd2df,_0x5bd375){if(_0x2fd2df){_0x32739f=_0x5bd375;if(!_0x5bd375){var _0x5d376e={'from':(_0x2841f2[_0xc591('0xb3')]['firstName']||'')+'\x20'+(_0x2841f2[_0xc591('0xb3')][_0xc591('0xa3')]||'')};if(_0x4a094f[_0xc591('0x4c')][_0xc591('0xad')]&&_0x4a094f[_0xc591('0x4c')]['messageId']&&_0x4a094f[_0xc591('0x4c')]['threadId']!=_0x4a094f[_0xc591('0x4c')][_0xc591('0xb4')]){_0x5d376e[_0xc591('0xad')]=_0x4a094f['body'][_0xc591('0xb4')];}return _0x2fd2df[_0xc591('0x27')](_0x5d376e);}else{return _0x2fd2df;}}})[_0xc591('0x13')](function(_0x17555a){_0x2841f2[_0xc591('0xb1')]=_0x17555a[_0xc591('0x28')]({'plain':!![]});_0x2841f2[_0xc591('0xb1')]['created']=_0x32739f;if(_0x2841f2['interaction'][_0xc591('0xb5')]){if(_0x2841f2[_0xc591('0x95')][_0xc591('0xb6')]){_0x2841f2[_0xc591('0x96')][_0xc591('0xb7')]({'id':0x0,'priority':_0x2841f2[_0xc591('0x96')][_0xc591('0x39')]+0x1,'app':_0xc591('0xb8'),'appdata':_0xc591('0xb9'),'interval':_0xc591('0xba')});}}return db[_0xc591('0xbb')][_0xc591('0x4b')]({'body':_0x4a094f[_0xc591('0x4c')]['body'],'ChatWebsiteId':_0x4a094f[_0xc591('0x57')]['id'],'ChatInteractionId':_0x17555a['id'],'direction':'in','ContactId':_0x2841f2['contact']['id'],'AttachmentId':_0x4a094f[_0xc591('0x4c')][_0xc591('0xbc')]});})[_0xc591('0x13')](function(_0x3fc4dc){_0x2841f2[_0xc591('0x1a')]=_0x3fc4dc;if(_0x2841f2['interaction'][_0xc591('0xbd')]){return db[_0xc591('0xbe')][_0xc591('0x55')]({'attributes':['id',_0xc591('0x2d')],'where':{'id':_0x2841f2[_0xc591('0xb1')]['UserId']}})[_0xc591('0x13')](function(_0x537394){if(_0x537394){_0x2841f2['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xc591('0xbf'),'appdata':_0x537394[_0xc591('0x2d')]+','+(_0x2841f2['account']['waitForTheAssignedAgent']||0xa),'interval':_0xc591('0xba')});_0x2841f2['forcedOwnership']=!![];}return respondWithRpcPromise('Start',_0xc591('0xc0'),_0x2841f2);});}return respondWithRpcPromise('Start',_0xc591('0xc0'),_0x2841f2);})[_0xc591('0x13')](function(_0x489786){respondWithRpcPromise(_0xc591('0xc1'),_0xc591('0xc1'),{'event':_0xc591('0xc2'),'message':_0x489786},client9002);return _0x489786;})[_0xc591('0x13')](respondWithResult(_0x398800,null))[_0xc591('0x1d')](handleError(_0x398800,null));};exports[_0xc591('0xc3')]=function(_0x31e8c4,_0x6779d1){var _0x4003be,_0x404d81,_0x5a00f7;var _0x1caa4b=[];var _0x1d7ec4={};var _0x4dae99=_0x31e8c4['files']||[];var _0x535daf=[];var _0xb2907b;return db[_0xc591('0x9b')][_0xc591('0x58')]()[_0xc591('0x13')](function(_0x1d4f98){if(!_0x1d4f98){throw new db[(_0xc591('0x84'))][(_0xc591('0x85'))]('no\x20available\x20attributes');}_0x1caa4b=_[_0xc591('0x88')](_[_0xc591('0x33')](_0x1d4f98),[_0xc591('0x89'),_0xc591('0x87'),_0xc591('0x8a'),_0xc591('0xc4')]);if(_0x31e8c4[_0xc591('0x4c')]['id']){delete _0x31e8c4[_0xc591('0x4c')]['id'];}if(_[_0xc591('0x70')](_0x31e8c4[_0xc591('0x4c')][_0xc591('0x8b')])){throw _0x6779d1['status'](0x1f4)[_0xc591('0x2e')](new db[(_0xc591('0x84'))][(_0xc591('0x85'))](_0xc591('0xc5')));}if(_[_0xc591('0x70')](_0x31e8c4[_0xc591('0x4c')][_0xc591('0x4c')])||_0x31e8c4[_0xc591('0x4c')][_0xc591('0x4c')]===''){throw _0x6779d1[_0xc591('0x24')](0x1f4)[_0xc591('0x2e')](new db[(_0xc591('0x84'))][(_0xc591('0x85'))](_0xc591('0x8c')));}if(_[_0xc591('0x70')](_0x31e8c4[_0xc591('0x4c')][_0xc591('0xc6')])){throw _0x6779d1['status'](0x1f4)[_0xc591('0x2e')](new db['Sequelize'][(_0xc591('0x85'))](_0xc591('0xc7')+_0x1caa4b));}if(!_[_0xc591('0xc8')](_0x1caa4b,_0x31e8c4[_0xc591('0x4c')][_0xc591('0xc6')])){throw _0x6779d1[_0xc591('0x24')](0x1f4)['send'](new db[(_0xc591('0x84'))]['ValidationError'](_0xc591('0xc9')+_0x1caa4b));}_0x1d7ec4[_0x31e8c4[_0xc591('0x4c')]['mapKeyOffline']]=_0x31e8c4[_0xc591('0x4c')][_0xc591('0x8b')];})[_0xc591('0x13')](function(){return db[_0xc591('0x44')][_0xc591('0x55')]({'where':{'id':_0x31e8c4['params']['id']},'include':[{'model':db[_0xc591('0x90')],'as':'List'},{'model':db[_0xc591('0xca')],'as':_0xc591('0xca')}]});})[_0xc591('0x13')](handleEntityNotFound(_0x6779d1,null))[_0xc591('0x13')](function(_0x16e440){if(_0x16e440&&_0x16e440['List']){_0x404d81=_0x16e440;var _0xb857a7=_[_0xc591('0x8')](_0x31e8c4[_0xc591('0x4c')],{'firstName':_0x31e8c4['body'][_0xc591('0x8b')],'phone':_0x31e8c4[_0xc591('0x4c')]['from'],'ListId':_0x16e440[_0xc591('0xc4')]});_0xb857a7[_0x31e8c4['body'][_0xc591('0xc6')]]=_0x31e8c4[_0xc591('0x4c')]['from'];return db['CmContact']['findOrCreate']({'where':_0x1d7ec4,'defaults':_0xb857a7});}})[_0xc591('0xb2')](function(_0x4a14e0){if(_0x4a14e0){_0x5a00f7=_0x4a14e0;var _0x1d34d5=fs[_0xc591('0xcb')](path[_0xc591('0x6d')](config[_0xc591('0x73')],_0xc591('0xcc')),_0xc591('0xcd'));var _0x3bac61=ejs['render'](_0x1d34d5,{'body':_[_0xc591('0xce')](_0x31e8c4[_0xc591('0x4c')][_0xc591('0x4c')]),'bodyTitle':_0x404d81['offlineMessageBody']});return db[_0xc591('0xcf')][_0xc591('0x4b')]({'body':_0x3bac61,'plainBody':htmlToText['fromString'](_0x3bac61),'ContactId':_0x4a14e0['id'],'ChatWebsiteId':_0x404d81['id']});}})['then'](function(_0x4d638d){_0xb2907b=_0x4d638d;if(_0x4dae99['length']){var _0x277570=_0x4dae99[_0xc591('0x60')](function(_0x1e8bbe){return{'name':_0x1e8bbe[_0xc591('0xd0')],'basename':_0x1e8bbe[_0xc591('0x66')],'type':_0x1e8bbe[_0xc591('0xd1')],'ChatOfflineMessageId':_0x4d638d['id']};});_0x535daf=_0x277570[_0xc591('0x60')](_0x2d7033=>{var _0x1d630d={'filename':_0x2d7033[_0xc591('0x2d')],'path':path[_0xc591('0x6d')](config[_0xc591('0x73')],_0xc591('0xd2'),_0xc591('0xd3'),_0xc591('0xd4'),'offline-chat',_0x2d7033['basename'])};return _0x1d630d;});if(!_0x404d81[_0xc591('0xd5')]){return db[_0xc591('0xd6')][_0xc591('0xd7')](function(_0x361765){return db[_0xc591('0xd8')][_0xc591('0xd9')](_0x277570,{'transaction':_0x361765});});}}})[_0xc591('0x13')](function(){if(_0xb2907b){_0x4003be=_0xb2907b;return db['MailAccount'][_0xc591('0x5b')]({'where':{'service':!![]},'include':[{'model':db[_0xc591('0xda')],'as':_0xc591('0xdb'),'raw':!![],'include':[{'model':db[_0xc591('0xdc')],'as':'CloudProvider','raw':!![]}]}]});}})[_0xc591('0x13')](function(_0x2820f3){if(_0x2820f3&&_0x2820f3['Smtp']&&_0x404d81['forwardOffline']&&_0x404d81['forwardOfflineAddress']){var _0x520457=_0x2820f3[_0xc591('0xdd')]();return respondWithRpcPromise(_0xc591('0xde'),'sendMail',{'account':_0x520457,'message':{'from':util[_0xc591('0xa7')](_0xc591('0xdf'),_0x2820f3['name'],_0x2820f3[_0xc591('0xe0')]||_0x2820f3[_0xc591('0xdb')][_0xc591('0x4d')]),'to':_0x404d81['forwardOfflineAddress'],'subject':_0x404d81['offlineMessageSubject'],'html':_0x4003be['body'],'attachments':_0x535daf}},client9003)[_0xc591('0x13')](function(){return _0x4003be;})[_0xc591('0x1d')](function(_0x3fb6d3){logger['error'](_0x3fb6d3);});}})[_0xc591('0x13')](function(){if(_0x404d81&&_0x404d81['openNewInteraction']&&_0x404d81[_0xc591('0xe1')]){var _0x29d080=[];if(_0x4dae99[_0xc591('0x39')]){_0x29d080=_0x4dae99['map'](function(_0x100959){return{'name':_0x100959[_0xc591('0xd0')],'basename':_0x100959[_0xc591('0x66')],'type':_0x100959['mimetype'],'ChatOfflineMessageId':_0xb2907b['id']};});}var _0x5d0cfa;if(!_[_0xc591('0x70')](_0x404d81[_0xc591('0xe2')])){var _0xaa77e8=_[_0xc591('0x60')](_0x31e8c4[_0xc591('0x4c')],function(_0xa6087c){return _0xa6087c;});var _0x2581dc=_[_0xc591('0xe3')](_0xaa77e8)[0x0];var _0x110ce6=_[_0xc591('0xe4')](_0x2581dc,function(_0x832cf8){return _0x832cf8;});_0x5d0cfa=_0x110ce6[0x1][_0x404d81[_0xc591('0xe2')]];}var _0xb2f53d={'from':_0x5a00f7[_0xc591('0xe0')],'firstName':_0x5a00f7[_0xc591('0xa2')],'lastName':_0x5a00f7[_0xc591('0xa3')],'mapKey':_0xc591('0xe0'),'message':{'from':_0x5a00f7[_0xc591('0xe0')],'to':_0x404d81[_0xc591('0xca')]['email'],'cc':'','subject':_[_0xc591('0x70')](_0x5d0cfa)?_0x404d81[_0xc591('0xe5')]:_0x5d0cfa,'messageId':'','sentAt':new Date(),'attach':_0x29d080[_0xc591('0x39')],'attachments':_0x29d080,'originChannel':'Chat','ChatWebsiteId':_0x404d81['id'],'ChatOfflineMessageId':_0x4003be['id'],'originTo':_0x404d81[_0xc591('0xca')][_0xc591('0xe0')]},'body':_0x4003be[_0xc591('0x4c')]};var _0x4a3498={'account':{'id':_0x404d81['MailAccountId']},'body':_0xb2f53d,'log':_0xc591('0xe6')};return respondWithRpcPromise(_0xc591('0xe6'),_0xc591('0xe7'),_0x4a3498,client9001)[_0xc591('0x13')](function(){return _0x4003be;})['catch'](function(_0x40e54d){logger[_0xc591('0x18')](_0x40e54d);});}return;})['then'](function(){if(_0x4003be){return _0x4003be;}})[_0xc591('0x13')](respondWithResult(_0x6779d1,null))['catch'](function(_0x2b8552){logger[_0xc591('0x18')]('catch',_0x2b8552);for(var _0x101460 of _0x4dae99){var _0x17f018=path[_0xc591('0x6d')](config['root'],_0xc591('0xd2'),_0xc591('0xd3'),'attachments',_0xc591('0xe8'),_0x101460['filename']);fs_extra['remove'](_0x17f018)['catch'](function(_0x1f77d2){logger[_0xc591('0x18')]('Could\x20not\x20remove\x20attachment\x20file',_0x17f018,_0x1f77d2);});}});};exports[_0xc591('0xe9')]=function(_0x8bc27c,_0x5c0647){return db[_0xc591('0xae')][_0xc591('0x55')]({'where':{'id':_0x8bc27c[_0xc591('0x57')]['id']}})['then'](handleEntityNotFound(_0x5c0647,null))[_0xc591('0x13')](function(_0x36e7ee){if(_0x36e7ee){return _0x36e7ee[_0xc591('0xe9')](_0x8bc27c[_0xc591('0x4c')][_0xc591('0x63')],_[_0xc591('0xea')](_0x8bc27c['body'],[_0xc591('0x63'),'id'])||{});}})['then'](respondWithResult(_0x5c0647,null))[_0xc591('0x1d')](handleError(_0x5c0647,null));};exports[_0xc591('0xeb')]=function(_0x1f866f,_0x71fbc){var _0x50cd70={'raw':![],'where':{}};var _0x325890={};var _0x10b77a={'count':0x0,'rows':[]};return db[_0xc591('0x44')]['findOne']({'where':{'id':_0x1f866f['params']['id']}})[_0xc591('0x13')](handleEntityNotFound(_0x71fbc,null))[_0xc591('0x13')](function(_0x2fe4ae){if(_0x2fe4ae){_0x325890['model']=_['keys'](db[_0xc591('0xae')]['rawAttributes']);_0x325890[_0xc591('0x32')]=_[_0xc591('0x33')](_0x1f866f[_0xc591('0x32')]);_0x325890['filters']=_[_0xc591('0x35')](_0x325890['model'],_0x325890[_0xc591('0x32')]);_0x50cd70[_0xc591('0x38')]=_[_0xc591('0x35')](_0x325890['model'],qs['fields'](_0x1f866f[_0xc591('0x32')][_0xc591('0x37')]));_0x50cd70[_0xc591('0x38')]=_0x50cd70[_0xc591('0x38')][_0xc591('0x39')]?_0x50cd70[_0xc591('0x38')]:_0x325890[_0xc591('0x36')];if(!_0x1f866f['query']['hasOwnProperty']('nolimit')){_0x50cd70[_0xc591('0x21')]=qs[_0xc591('0x21')](_0x1f866f[_0xc591('0x32')][_0xc591('0x21')]);_0x50cd70['offset']=qs[_0xc591('0x20')](_0x1f866f[_0xc591('0x32')][_0xc591('0x20')]);}_0x50cd70[_0xc591('0x3c')]=qs[_0xc591('0x3d')](_0x1f866f[_0xc591('0x32')]['sort']);_0x50cd70['where']=qs[_0xc591('0x34')](_['pick'](_0x1f866f[_0xc591('0x32')],_0x325890['filters']));_0x50cd70[_0xc591('0x3e')][_0xc591('0x59')]=_0x2fe4ae['id'];if(_0x1f866f[_0xc591('0x32')]['filter']){_0x50cd70[_0xc591('0x3e')]=_[_0xc591('0x40')](_0x50cd70['where'],{'$or':_[_0xc591('0x60')](_0x50cd70[_0xc591('0x38')],function(_0x50bce3){var _0x476de6={};_0x476de6[_0x50bce3]={'$like':'%'+_0x1f866f[_0xc591('0x32')][_0xc591('0x42')]+'%'};return _0x476de6;})});}_0x50cd70=_[_0xc591('0x40')]({},_0x50cd70,_0x1f866f[_0xc591('0x43')]);return db[_0xc591('0xae')][_0xc591('0x23')]({'where':_0x50cd70[_0xc591('0x3e')]})[_0xc591('0x13')](function(_0x189652){_0x10b77a[_0xc591('0x23')]=_0x189652;if(_0x1f866f['query'][_0xc591('0x45')]){_0x50cd70['include']=[{'model':db[_0xc591('0x9b')],'as':_0xc591('0xec'),'required':![]},{'model':db[_0xc591('0xbe')],'as':_0xc591('0xed'),'attributes':[_0xc591('0x2d'),_0xc591('0xee'),_0xc591('0xef')],'required':![]},{'model':db[_0xc591('0xf0')],'as':_0xc591('0xf1'),'attributes':['id',_0xc591('0x2d'),_0xc591('0xf2')],'where':_0x1f866f[_0xc591('0x32')][_0xc591('0xf3')]?{'id':_0x1f866f[_0xc591('0x32')][_0xc591('0xf3')]}:undefined,'required':_0x1f866f[_0xc591('0x32')][_0xc591('0xf3')]?!![]:![]}];}return db[_0xc591('0xae')][_0xc591('0x47')](_0x50cd70);})['then'](function(_0x256655){_0x10b77a['rows']=_0x256655;return _0x10b77a;});}})[_0xc591('0x13')](respondWithFilteredResult(_0x71fbc,_0x50cd70))[_0xc591('0x1d')](handleError(_0x71fbc,null));};function iftimePromise(_0x102bf6,_0x241496){return respondWithRpcPromise(_0xc591('0xf4'),'getSnippet',{'command':_0x241496[_0xc591('0xf5')]?util[_0xc591('0xa7')](_0xc591('0xf6'),_0x102bf6[_0xc591('0xf7')],_0x241496['timezone']):util[_0xc591('0xa7')](_0xc591('0xf8'),_0x102bf6[_0xc591('0xf7')])},client9002)['then'](function(_0x55f9e1){var _0xcd512f=_0x55f9e1&&_0x55f9e1[_0xc591('0xf9')](_0xc591('0xfa'))>=0x0?!![]:![];logger[_0xc591('0x1b')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x241496['id'],_0x102bf6['id'],_0x102bf6['interval'],_0xcd512f?'ONLINE':_0xc591('0xfb'),_0x241496['timezone']?_0x241496['timezone']:_0xc591('0xfc'));return _0xcd512f;})[_0xc591('0x1d')](function(_0x5240e2){logger['error'](_0xc591('0xfd'),_0x241496['id'],_0x102bf6['id'],_0x102bf6[_0xc591('0xf7')],util[_0xc591('0xfe')](_0x5240e2,{'showHidden':![],'depth':null}),_0x241496[_0xc591('0xf5')]?_0x241496[_0xc591('0xf5')]:_0xc591('0xfc'));return![];});}exports[_0xc591('0xff')]=function(_0x10e919,_0x4dc6ab){var _0x5cfe69=0x0;var _0x4f3ba3=0x0;var _0x27e647=![];var _0x29c91f;var _0x31a6d2;return db[_0xc591('0x44')][_0xc591('0x55')]({'where':{'id':_0x10e919['params']['id']},'include':[{'model':db['Interval'],'as':_0xc591('0x100'),'include':[{'model':db['Interval'],'as':_0xc591('0x101'),'attributes':['id',_0xc591('0xf7')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x4dc6ab,null))[_0xc591('0x13')](function(_0xe8266a){if(_0xe8266a){_0x29c91f=_0xe8266a;return _0xe8266a[_0xc591('0x102')]({'raw':!![]});}})[_0xc591('0x13')](function(_0x3f76f4){if(_0x29c91f){if(_0x3f76f4){_0x31a6d2=_0x3f76f4;}}return require(_0xc591('0x103'))[_0xc591('0x6f')]();})['then'](function(_0xe496cd){if(_0xe496cd){_0x4f3ba3=_0xe496cd[_0xc591('0x104')];_0x27e647=_0xe496cd[_0xc591('0x105')];}})[_0xc591('0x13')](function(){return db['ChatInteraction'][_0xc591('0x23')]({'where':{'closed':![]}});})['then'](function(_0x4385dc){_0x5cfe69=_0x4385dc;if(_0x4f3ba3&&_0x4385dc>_0x4f3ba3){return db[_0xc591('0x106')][_0xc591('0x5b')]({'where':{'id':0x1}})[_0xc591('0x13')](function(_0x5d7368){if(_0x5d7368){_0x5d7368[_0xc591('0x107')]('chatLicenseExceeded');}});}})['then'](function(){if(_0x29c91f[_0xc591('0x100')]&&_0x29c91f[_0xc591('0x100')][_0xc591('0x101')]){var _0x18cbe0=[];for(var _0x581a78=0x0;_0x581a78<_0x29c91f[_0xc591('0x100')][_0xc591('0x101')][_0xc591('0x39')];_0x581a78++){var _0x3d9985=_0x29c91f[_0xc591('0x100')][_0xc591('0x101')][_0x581a78][_0xc591('0x28')]({'plain':!![]});_0x18cbe0[_0xc591('0xb7')](iftimePromise(_0x3d9985,_0x29c91f));}return BPromise[_0xc591('0x108')](_0x18cbe0)[_0xc591('0x13')](function(_0x173c16){return _[_0xc591('0x109')](_0x173c16);});}else{return!![];}})[_0xc591('0x13')](function(_0x2e047a){var _0x1521f7=fs[_0xc591('0xcb')](path[_0xc591('0x6d')](config[_0xc591('0x73')],'server/files/chat/iframe.ejs'),_0xc591('0xcd'));var _0x3d9c0e={'remote':_0x29c91f['remote'],'query':querystring['stringify'](_[_0xc591('0x40')](_0x29c91f['get']({'plain':!![]}),{'customerIp':_0x10e919['headers'][_0xc591('0x9f')]||_0x10e919[_0xc591('0x9d')][_0xc591('0x10a')]||_0x10e919[_0xc591('0x10b')][_0xc591('0x10c')]||_0x10e919['ip'],'referer':_0x10e919['headers'][_0xc591('0x10d')],'openedInteractions':_0x5cfe69,'maxInteractions':_0x4f3ba3,'virtual':_0x27e647[_0xc591('0x104')],'online':_0x2e047a,'custom':_0x27e647}))[_0xc591('0x10e')](/'/g,'\x5c\x27')};_0x4dc6ab[_0xc591('0x2e')](ejs[_0xc591('0x10f')](Mustache[_0xc591('0x10f')](_0x1521f7,_0x3d9c0e),{'proactiveActions':_0x31a6d2,'alignment':_0x29c91f['alignment'],'verticalAlignment':_0x29c91f[_0xc591('0x110')],'div_color':_0x29c91f[_0xc591('0xf2')],'labelText':_0x29c91f['labelText'],'text_color':_0x29c91f[_0xc591('0x111')],'text_button_color':_0x29c91f[_0xc591('0x112')],'button_color':_0x29c91f[_0xc591('0x113')],'background_color':_0x29c91f[_0xc591('0x114')],'hideWhenOffline':_0x29c91f[_0xc591('0x115')],'interval':_0x29c91f[_0xc591('0x116')]}));})[_0xc591('0x1d')](handleError(_0x4dc6ab,null));};exports[_0xc591('0x117')]=function(_0x5eddbc,_0x4e419f){var _0x54986b=_0x5eddbc['params']['id'];var _0x1496ef=_0x5eddbc[_0xc591('0x4c')];var _0x238ebd=0xc8;var _0x9671d0=null;return db[_0xc591('0xd6')][_0xc591('0xd7')]({'isolationLevel':db[_0xc591('0xd6')][_0xc591('0x118')][_0xc591('0x119')][_0xc591('0x11a')]},function(_0x4993a8){return db[_0xc591('0x44')][_0xc591('0x5b')]({'where':{'id':_0x54986b},'transaction':_0x4993a8})[_0xc591('0x13')](function(_0x1fcb11){if(_0x1fcb11){return db[_0xc591('0x92')]['destroy']({'where':{'ChatWebsiteId':_0x54986b},'transaction':_0x4993a8})['then'](function(){var _0x2d89a1=_['map'](_0x1496ef,function(_0x57094a){_0x57094a[_0xc591('0x59')]=_0x54986b;return _0x57094a;});return db[_0xc591('0x92')][_0xc591('0xd9')](_0x2d89a1,{'transaction':_0x4993a8});});}else{_0x238ebd=0x194;_0x9671d0=[];}});})[_0xc591('0x13')](function(){if(_0x238ebd!==0x194){return db['ChatApplication'][_0xc591('0x11b')]({'where':{'ChatWebsiteId':_0x54986b},'order':_0xc591('0x11c')})[_0xc591('0x13')](function(_0x19b92b){_0x9671d0=_0x19b92b;});}})[_0xc591('0x1d')](function(_0x2d1cf9){_0x238ebd=0x1f4;logger[_0xc591('0x18')](_0x2d1cf9[_0xc591('0x2c')]);if(_0x2d1cf9[_0xc591('0x2d')]){delete _0x2d1cf9[_0xc591('0x2d')];}_0x9671d0=_0x2d1cf9;})[_0xc591('0x11d')](function(){if(_0x9671d0===null){_0x4e419f[_0xc591('0x2b')](_0x238ebd);}else{if(_0x238ebd===0x1f4){_0x4e419f[_0xc591('0x24')](_0x238ebd)[_0xc591('0x2e')](_0x9671d0);}else{_0x4e419f['status'](_0x238ebd)[_0xc591('0x1f')](_0x9671d0);}}});};exports['getApplications']=function(_0x3760b8,_0xc9023d){var _0x5f44ce={};var _0x40927d={};var _0xd6b6ff;var _0x24adfe;return db[_0xc591('0x44')][_0xc591('0x5b')]({'where':{'id':_0x3760b8[_0xc591('0x57')]['id']}})[_0xc591('0x13')](handleEntityNotFound(_0xc9023d,null))[_0xc591('0x13')](function(_0xcfd3){if(_0xcfd3){_0xd6b6ff=_0xcfd3;_0x40927d[_0xc591('0x36')]=_[_0xc591('0x33')](db[_0xc591('0x92')][_0xc591('0x2f')]);_0x40927d[_0xc591('0x32')]=_['keys'](_0x3760b8[_0xc591('0x32')]);_0x40927d['filters']=_[_0xc591('0x35')](_0x40927d[_0xc591('0x36')],_0x40927d[_0xc591('0x32')]);_0x5f44ce[_0xc591('0x38')]=_['intersection'](_0x40927d[_0xc591('0x36')],qs[_0xc591('0x37')](_0x3760b8[_0xc591('0x32')][_0xc591('0x37')]));_0x5f44ce['attributes']=_0x5f44ce[_0xc591('0x38')][_0xc591('0x39')]?_0x5f44ce[_0xc591('0x38')]:_0x40927d['model'];_0x5f44ce[_0xc591('0x3c')]=qs[_0xc591('0x3d')](_0x3760b8['query'][_0xc591('0x3d')]);_0x5f44ce[_0xc591('0x3e')]=qs[_0xc591('0x34')](_[_0xc591('0x3f')](_0x3760b8[_0xc591('0x32')],_0x40927d[_0xc591('0x34')]));if(_0x3760b8['query'][_0xc591('0x42')]){_0x5f44ce[_0xc591('0x3e')]=_[_0xc591('0x40')](_0x5f44ce[_0xc591('0x3e')],{'$or':_[_0xc591('0x60')](_0x5f44ce['attributes'],function(_0x240e25){var _0x592e5c={};_0x592e5c[_0x240e25]={'$like':'%'+_0x3760b8[_0xc591('0x32')][_0xc591('0x42')]+'%'};return _0x592e5c;})});}_0x5f44ce=_['merge']({},_0x5f44ce,_0x3760b8[_0xc591('0x43')]);return _0xd6b6ff[_0xc591('0x11e')](_0x5f44ce);}})['then'](function(_0x314ca6){if(_0x314ca6){_0x24adfe=_0x314ca6[_0xc591('0x39')];if(!_0x3760b8[_0xc591('0x32')][_0xc591('0x3a')]('nolimit')){_0x5f44ce[_0xc591('0x21')]=qs[_0xc591('0x21')](_0x3760b8[_0xc591('0x32')][_0xc591('0x21')]);_0x5f44ce[_0xc591('0x20')]=qs[_0xc591('0x20')](_0x3760b8[_0xc591('0x32')]['offset']);}return _0xd6b6ff[_0xc591('0x11e')](_0x5f44ce);}})['then'](function(_0x87ffe5){if(_0x87ffe5){return _0x87ffe5?{'count':_0x24adfe,'rows':_0x87ffe5}:null;}})[_0xc591('0x13')](respondWithResult(_0xc9023d,null))[_0xc591('0x1d')](handleError(_0xc9023d,null));};exports['addProactiveActions']=function(_0xac9686,_0x13871f){return db[_0xc591('0x11f')][_0xc591('0x55')]({'where':{'id':_0xac9686[_0xc591('0x57')]['id']}})[_0xc591('0x13')](handleEntityNotFound(_0x13871f,null))[_0xc591('0x13')](function(_0x332455){if(_0x332455){return _0x332455['addProactiveActions'](_0xac9686[_0xc591('0x4c')][_0xc591('0x63')],_[_0xc591('0xea')](_0xac9686[_0xc591('0x4c')],[_0xc591('0x63'),'id'])||{});}})[_0xc591('0x13')](respondWithResult(_0x13871f,null))['catch'](handleError(_0x13871f,null));};exports['getProactiveActions']=function(_0x308c12,_0x1b06bc){var _0x3bb91a={};var _0x593c12={};var _0x5ad424;var _0xd615f9;return db[_0xc591('0x44')][_0xc591('0x5b')]({'where':{'id':_0x308c12[_0xc591('0x57')]['id']}})[_0xc591('0x13')](handleEntityNotFound(_0x1b06bc,null))[_0xc591('0x13')](function(_0x31f816){if(_0x31f816){_0x5ad424=_0x31f816;_0x593c12['model']=_['keys'](db[_0xc591('0x120')][_0xc591('0x2f')]);_0x593c12['query']=_['keys'](_0x308c12[_0xc591('0x32')]);_0x593c12['filters']=_['intersection'](_0x593c12[_0xc591('0x36')],_0x593c12[_0xc591('0x32')]);_0x3bb91a[_0xc591('0x38')]=_[_0xc591('0x35')](_0x593c12[_0xc591('0x36')],qs[_0xc591('0x37')](_0x308c12[_0xc591('0x32')][_0xc591('0x37')]));_0x3bb91a[_0xc591('0x38')]=_0x3bb91a['attributes'][_0xc591('0x39')]?_0x3bb91a[_0xc591('0x38')]:_0x593c12['model'];_0x3bb91a[_0xc591('0x3c')]=qs[_0xc591('0x3d')](_0x308c12[_0xc591('0x32')]['sort']);_0x3bb91a[_0xc591('0x3e')]=qs[_0xc591('0x34')](_[_0xc591('0x3f')](_0x308c12[_0xc591('0x32')],_0x593c12[_0xc591('0x34')]));if(_0x308c12['query'][_0xc591('0x42')]){_0x3bb91a[_0xc591('0x3e')]=_[_0xc591('0x40')](_0x3bb91a[_0xc591('0x3e')],{'$or':_['map'](_0x3bb91a[_0xc591('0x38')],function(_0x2548ad){var _0x4d530d={};_0x4d530d[_0x2548ad]={'$like':'%'+_0x308c12[_0xc591('0x32')][_0xc591('0x42')]+'%'};return _0x4d530d;})});}_0x3bb91a=_[_0xc591('0x40')]({},_0x3bb91a,_0x308c12[_0xc591('0x43')]);return _0x5ad424['getProactiveActions'](_0x3bb91a);}})['then'](function(_0x27c0a9){if(_0x27c0a9){_0xd615f9=_0x27c0a9[_0xc591('0x39')];if(!_0x308c12['query']['hasOwnProperty'](_0xc591('0x3b'))){_0x3bb91a[_0xc591('0x21')]=qs[_0xc591('0x21')](_0x308c12['query'][_0xc591('0x21')]);_0x3bb91a[_0xc591('0x20')]=qs[_0xc591('0x20')](_0x308c12[_0xc591('0x32')]['offset']);}return _0x5ad424['getProactiveActions'](_0x3bb91a);}})[_0xc591('0x13')](function(_0x232c15){if(_0x232c15){return _0x232c15?{'count':_0xd615f9,'rows':_0x232c15}:null;}})[_0xc591('0x13')](respondWithResult(_0x1b06bc,null))['catch'](handleError(_0x1b06bc,null));};exports['getFields']=function(_0x10967b,_0x2ac2a7){var _0x3424f6=_0x10967b['query'][_0xc591('0x121')]===_0xc591('0x122')?_0xc591('0x123'):_0xc591('0x124');return db['ChatWebsite']['find']({'attributes':['id',_0x3424f6],'where':{'id':_0x10967b[_0xc591('0x57')]['id']}})[_0xc591('0x13')](handleEntityNotFound(_0x2ac2a7,null))[_0xc591('0x13')](function(_0x35932b){if(_0x35932b){var _0x490411=_0x35932b[_0x3424f6];var _0x2abe6a=_0x490411&&_0x490411[_0xc591('0x125')]?_0x490411[_0xc591('0x125')]:[];_0x2ac2a7[_0xc591('0x2e')]({'fromKey':_[_0xc591('0x70')](_0x490411[_0xc591('0x126')])?undefined:_0x490411[_0xc591('0x126')],'count':_0x2abe6a[_0xc591('0x39')],'rows':_0x2abe6a});}})[_0xc591('0x1d')](handleError(_0x2ac2a7,null));};exports[_0xc591('0x127')]=function(_0x3664fc,_0x5a7c29){var _0x30b7c4={'raw':![],'where':{}};var _0x2b7902={};var _0x3685b5={'count':0x0,'rows':[]};return db[_0xc591('0x44')][_0xc591('0x5b')]({'where':{'id':_0x3664fc[_0xc591('0x57')]['id']}})['then'](handleEntityNotFound(_0x5a7c29,null))['then'](function(_0x59c7f8){if(_0x59c7f8){_0x2b7902[_0xc591('0x36')]=_['keys'](db[_0xc591('0xcf')]['rawAttributes']);_0x2b7902['query']=_['keys'](_0x3664fc[_0xc591('0x32')]);_0x2b7902[_0xc591('0x34')]=_[_0xc591('0x35')](_0x2b7902[_0xc591('0x36')],_0x2b7902[_0xc591('0x32')]);_0x30b7c4['attributes']=_[_0xc591('0x35')](_0x2b7902[_0xc591('0x36')],qs[_0xc591('0x37')](_0x3664fc[_0xc591('0x32')][_0xc591('0x37')]));_0x30b7c4[_0xc591('0x38')]=_0x30b7c4['attributes'][_0xc591('0x39')]?_0x30b7c4['attributes']:_0x2b7902['model'];if(!_0x3664fc[_0xc591('0x32')][_0xc591('0x3a')]('nolimit')){_0x30b7c4[_0xc591('0x21')]=qs[_0xc591('0x21')](_0x3664fc[_0xc591('0x32')]['limit']);_0x30b7c4[_0xc591('0x20')]=qs[_0xc591('0x20')](_0x3664fc['query'][_0xc591('0x20')]);}_0x30b7c4[_0xc591('0x3c')]=qs['sort'](_0x3664fc[_0xc591('0x32')][_0xc591('0x3d')]);_0x30b7c4[_0xc591('0x3e')]=qs[_0xc591('0x34')](_[_0xc591('0x3f')](_0x3664fc[_0xc591('0x32')],_0x2b7902[_0xc591('0x34')]));_0x30b7c4[_0xc591('0x3e')]['ChatWebsiteId']=_0x59c7f8['id'];if(_0x3664fc[_0xc591('0x32')]['filter']){_0x30b7c4[_0xc591('0x3e')]=_[_0xc591('0x40')](_0x30b7c4[_0xc591('0x3e')],{'$or':_[_0xc591('0x60')](_0x30b7c4[_0xc591('0x38')],function(_0x3a9bc2){var _0x3df9d8={};_0x3df9d8[_0x3a9bc2]={'$like':'%'+_0x3664fc[_0xc591('0x32')]['filter']+'%'};return _0x3df9d8;})});}_0x30b7c4=_['merge']({},_0x30b7c4,_0x3664fc[_0xc591('0x43')]);return db[_0xc591('0xcf')][_0xc591('0x23')]({'where':_0x30b7c4[_0xc591('0x3e')]})[_0xc591('0x13')](function(_0x44d883){_0x3685b5[_0xc591('0x23')]=_0x44d883;if(_0x3664fc[_0xc591('0x32')][_0xc591('0x45')]){_0x30b7c4['include']=[{'all':!![]}];}else{_0x30b7c4['include']=[{'model':db[_0xc591('0x9b')],'as':'Contact','required':![]},{'model':db[_0xc591('0xd8')],'as':_0xc591('0x128'),'required':![]}];}return db[_0xc591('0xcf')][_0xc591('0x47')](_0x30b7c4);})[_0xc591('0x13')](function(_0x5c05c2){_0x3685b5['rows']=_0x5c05c2;return _0x3685b5;});}})['then'](respondWithFilteredResult(_0x5a7c29,_0x30b7c4))[_0xc591('0x1d')](handleError(_0x5a7c29,null));};exports[_0xc591('0x129')]=function(_0x5cafbc,_0x4b28cb){return db['ChatWebsite'][_0xc591('0x55')]({'where':{'id':_0x5cafbc['params']['id']}})['then'](handleEntityNotFound(_0x4b28cb,null))[_0xc591('0x13')](function(_0x381165){if(_0x381165){return _0x381165[_0xc591('0x129')](_0x5cafbc[_0xc591('0x4c')][_0xc591('0x63')],_['omit'](_0x5cafbc[_0xc591('0x4c')],[_0xc591('0x63'),'id'])||{})[_0xc591('0xb2')](function(_0x294229){for(var _0x30beec=0x0;_0x30beec<_0x5cafbc[_0xc591('0x4c')][_0xc591('0x63')][_0xc591('0x39')];_0x30beec+=0x1){socket[_0xc591('0x12a')](_0xc591('0x12b'),{'UserId':Number(_0x5cafbc['body'][_0xc591('0x63')][_0x30beec]),'ChatWebsiteId':Number(_0x5cafbc['params']['id'])});}return _0x294229;});}})[_0xc591('0x13')](respondWithResult(_0x4b28cb,null))[_0xc591('0x1d')](handleError(_0x4b28cb,null));};exports[_0xc591('0x12c')]=function(_0x22fbda,_0x4e3c4b){return db[_0xc591('0x44')][_0xc591('0x55')]({'where':{'id':_0x22fbda[_0xc591('0x57')]['id']}})[_0xc591('0x13')](handleEntityNotFound(_0x4e3c4b,null))[_0xc591('0x13')](function(_0x181b12){if(_0x181b12){return _0x181b12[_0xc591('0x12c')](_0x22fbda[_0xc591('0x32')][_0xc591('0x63')])['then'](function(){if(_[_0xc591('0x12d')](_0x22fbda['query'][_0xc591('0x63')])){for(var _0x494694=0x0;_0x494694<_0x22fbda[_0xc591('0x32')][_0xc591('0x63')][_0xc591('0x39')];_0x494694+=0x1){socket[_0xc591('0x12a')](_0xc591('0x12e'),{'UserId':Number(_0x22fbda[_0xc591('0x32')]['ids'][_0x494694]),'ChatWebsiteId':Number(_0x22fbda[_0xc591('0x57')]['id'])});}}else{socket[_0xc591('0x12a')]('userChatWebsite:remove',{'UserId':Number(_0x22fbda[_0xc591('0x32')][_0xc591('0x63')]),'ChatWebsiteId':Number(_0x22fbda[_0xc591('0x57')]['id'])});}});}})[_0xc591('0x13')](respondWithStatusCode(_0x4e3c4b,null))[_0xc591('0x1d')](handleError(_0x4e3c4b,null));};exports[_0xc591('0x12f')]=function(_0x994470,_0x274311){var _0x2378cc={};var _0x4aac0c={};var _0x35c840;var _0x232421;return db[_0xc591('0x44')]['findOne']({'where':{'id':_0x994470[_0xc591('0x57')]['id']}})['then'](handleEntityNotFound(_0x274311,null))[_0xc591('0x13')](function(_0x2d539a){if(_0x2d539a){_0x35c840=_0x2d539a;_0x4aac0c['model']=_['keys'](db[_0xc591('0xbe')]['rawAttributes']);_0x4aac0c['query']=_['keys'](_0x994470['query']);_0x4aac0c[_0xc591('0x34')]=_[_0xc591('0x35')](_0x4aac0c[_0xc591('0x36')],_0x4aac0c['query']);_0x2378cc['attributes']=_[_0xc591('0x35')](_0x4aac0c['model'],qs['fields'](_0x994470['query'][_0xc591('0x37')]));_0x2378cc['attributes']=_0x2378cc[_0xc591('0x38')]['length']?_0x2378cc[_0xc591('0x38')]:_0x4aac0c[_0xc591('0x36')];_0x2378cc[_0xc591('0x3c')]=qs['sort'](_0x994470[_0xc591('0x32')][_0xc591('0x3d')]);_0x2378cc[_0xc591('0x3e')]=qs[_0xc591('0x34')](_['pick'](_0x994470['query'],_0x4aac0c['filters']));if(_0x994470[_0xc591('0x32')]['filter']){_0x2378cc[_0xc591('0x3e')]=_[_0xc591('0x40')](_0x2378cc[_0xc591('0x3e')],{'$or':_['map'](_0x2378cc[_0xc591('0x38')],function(_0x157455){var _0x351f12={};_0x351f12[_0x157455]={'$like':'%'+_0x994470[_0xc591('0x32')][_0xc591('0x42')]+'%'};return _0x351f12;})});}_0x2378cc=_[_0xc591('0x40')]({},_0x2378cc,_0x994470[_0xc591('0x43')]);return _0x35c840[_0xc591('0x12f')](_0x2378cc);}})['then'](function(_0x531d92){if(_0x531d92){_0x232421=_0x531d92[_0xc591('0x39')];if(!_0x994470[_0xc591('0x32')][_0xc591('0x3a')](_0xc591('0x3b'))){_0x2378cc[_0xc591('0x21')]=qs[_0xc591('0x21')](_0x994470[_0xc591('0x32')][_0xc591('0x21')]);_0x2378cc['offset']=qs[_0xc591('0x20')](_0x994470[_0xc591('0x32')][_0xc591('0x20')]);}return _0x35c840[_0xc591('0x12f')](_0x2378cc);}})[_0xc591('0x13')](function(_0x2b7201){if(_0x2b7201){return _0x2b7201?{'count':_0x232421,'rows':_0x2b7201}:null;}})[_0xc591('0x13')](respondWithResult(_0x274311,null))[_0xc591('0x1d')](handleError(_0x274311,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 14da8fd..723de2a 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 _0x0738=['hook','exports','events','ChatWebsite','setMaxListeners','save','update','remove','emit'];(function(_0x1e3dfb,_0xfaf395){var _0x4b4100=function(_0x40a5a8){while(--_0x40a5a8){_0x1e3dfb['push'](_0x1e3dfb['shift']());}};_0x4b4100(++_0xfaf395);}(_0x0738,0x6e));var _0x8073=function(_0x40b2ed,_0x2b1765){_0x40b2ed=_0x40b2ed-0x0;var _0x18397d=_0x0738[_0x40b2ed];return _0x18397d;};'use strict';var EventEmitter=require(_0x8073('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x8073('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x8073('0x2')](0x0);var events={'afterCreate':_0x8073('0x3'),'afterUpdate':_0x8073('0x4'),'afterDestroy':_0x8073('0x5')};function emitEvent(_0xac9f0){return function(_0x176f52,_0x38b47d,_0x387cfe){ChatWebsiteEvents[_0x8073('0x6')](_0xac9f0+':'+_0x176f52['id'],_0x176f52);ChatWebsiteEvents[_0x8073('0x6')](_0xac9f0,_0x176f52);_0x387cfe(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x8073('0x7')](e,emitEvent(event));}}module[_0x8073('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x4b47=['update','remove','emit','exports','events','ChatWebsite','setMaxListeners','save'];(function(_0x1f23c0,_0x18fffd){var _0x56ab73=function(_0x340121){while(--_0x340121){_0x1f23c0['push'](_0x1f23c0['shift']());}};_0x56ab73(++_0x18fffd);}(_0x4b47,0x1b4));var _0x74b4=function(_0x6d5912,_0x2c82ac){_0x6d5912=_0x6d5912-0x0;var _0x1fdff9=_0x4b47[_0x6d5912];return _0x1fdff9;};'use strict';var EventEmitter=require(_0x74b4('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x74b4('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x74b4('0x2')](0x0);var events={'afterCreate':_0x74b4('0x3'),'afterUpdate':_0x74b4('0x4'),'afterDestroy':_0x74b4('0x5')};function emitEvent(_0x2795e9){return function(_0x565f6b,_0x4ed4fe,_0x27ddaf){ChatWebsiteEvents[_0x74b4('0x6')](_0x2795e9+':'+_0x565f6b['id'],_0x565f6b);ChatWebsiteEvents['emit'](_0x2795e9,_0x565f6b);_0x27ddaf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x74b4('0x7')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index de3a144..eb087b2 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 _0x174f=['moment','bluebird','request-promise','../../config/environment','define','ChatWebsite','chat_websites','lodash','../../config/logger'];(function(_0x5f3743,_0x50fe6b){var _0x2206f9=function(_0x4aa70f){while(--_0x4aa70f){_0x5f3743['push'](_0x5f3743['shift']());}};_0x2206f9(++_0x50fe6b);}(_0x174f,0x1a5));var _0xf174=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x174f[_0xbb091];return _0x467a04;};'use strict';var _=require(_0xf174('0x0'));var util=require('util');var logger=require(_0xf174('0x1'))('api');var moment=require(_0xf174('0x2'));var BPromise=require(_0xf174('0x3'));var rp=require(_0xf174('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf174('0x5'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0xbd72b6,_0x3e3af5){return _0xbd72b6[_0xf174('0x6')](_0xf174('0x7'),attributes,{'tableName':_0xf174('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdcfd=['chat_websites','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite'];(function(_0x5e6cea,_0x24b02a){var _0x55a315=function(_0x395b80){while(--_0x395b80){_0x5e6cea['push'](_0x5e6cea['shift']());}};_0x55a315(++_0x24b02a);}(_0xdcfd,0x181));var _0xddcf=function(_0x4a8418,_0x39078a){_0x4a8418=_0x4a8418-0x0;var _0x390174=_0xdcfd[_0x4a8418];return _0x390174;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xddcf('0x0'))(_0xddcf('0x1'));var moment=require(_0xddcf('0x2'));var BPromise=require('bluebird');var rp=require(_0xddcf('0x3'));var fs=require('fs');var path=require(_0xddcf('0x4'));var rimraf=require(_0xddcf('0x5'));var config=require(_0xddcf('0x6'));var attributes=require(_0xddcf('0x7'));module[_0xddcf('0x8')]=function(_0x22ba4a,_0x4910a7){return _0x22ba4a[_0xddcf('0x9')](_0xddcf('0xa'),attributes,{'tableName':_0xddcf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 75d74dd..6abbc39 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 _0xa9f7=['ChatWebsite,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatWebsite.socket','register','request','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9f7,0x1cf));var _0x7a9f=function(_0x51b6aa,_0x584154){_0x51b6aa=_0x51b6aa-0x0;var _0x4c3e43=_0xa9f7[_0x51b6aa];return _0x4c3e43;};'use strict';var _=require('lodash');var util=require(_0x7a9f('0x0'));var moment=require(_0x7a9f('0x1'));var BPromise=require(_0x7a9f('0x2'));var rs=require(_0x7a9f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7a9f('0x4'))['db'];var utils=require(_0x7a9f('0x5'));var logger=require('../../config/logger')(_0x7a9f('0x6'));var config=require(_0x7a9f('0x7'));var jayson=require(_0x7a9f('0x8'));var client=jayson[_0x7a9f('0x9')][_0x7a9f('0xa')]({'port':0x232a});config[_0x7a9f('0xb')]=_[_0x7a9f('0xc')](config[_0x7a9f('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7a9f('0xb')]));require(_0x7a9f('0xd'))[_0x7a9f('0xe')](socket);function respondWithRpcPromise(_0x491e93,_0x321bea,_0x33c6ea){return new BPromise(function(_0x35214e,_0x21cde6){return client[_0x7a9f('0xf')](_0x491e93,_0x33c6ea)['then'](function(_0x528f45){logger[_0x7a9f('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x321bea,'request\x20sent');logger[_0x7a9f('0x11')](_0x7a9f('0x12'),_0x321bea,_0x7a9f('0x13'),JSON[_0x7a9f('0x14')](_0x528f45));if(_0x528f45[_0x7a9f('0x15')]){if(_0x528f45[_0x7a9f('0x15')][_0x7a9f('0x16')]===0x1f4){logger['error'](_0x7a9f('0x17'),_0x321bea,_0x528f45[_0x7a9f('0x15')][_0x7a9f('0x18')]);return _0x21cde6(_0x528f45['error']['message']);}logger[_0x7a9f('0x15')](_0x7a9f('0x17'),_0x321bea,_0x528f45[_0x7a9f('0x15')][_0x7a9f('0x18')]);return _0x35214e(_0x528f45[_0x7a9f('0x15')]['message']);}else{logger[_0x7a9f('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x321bea,_0x7a9f('0x13'));_0x35214e(_0x528f45[_0x7a9f('0x19')]['message']);}})[_0x7a9f('0x1a')](function(_0xfe8ced){logger[_0x7a9f('0x15')](_0x7a9f('0x17'),_0x321bea,_0xfe8ced);_0x21cde6(_0xfe8ced);});});} \ No newline at end of file +var _0xe580=['jayson/promise','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x596386,_0x58583e){var _0x2d33db=function(_0x4b59cd){while(--_0x4b59cd){_0x596386['push'](_0x596386['shift']());}};_0x2d33db(++_0x58583e);}(_0xe580,0x101));var _0x0e58=function(_0x514ea3,_0x38b18f){_0x514ea3=_0x514ea3-0x0;var _0x2654ae=_0xe580[_0x514ea3];return _0x2654ae;};'use strict';var _=require(_0x0e58('0x0'));var util=require(_0x0e58('0x1'));var moment=require(_0x0e58('0x2'));var BPromise=require(_0x0e58('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e58('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0e58('0x5'));var logger=require(_0x0e58('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0e58('0x7'));var client=jayson['client'][_0x0e58('0x8')]({'port':0x232a});config[_0x0e58('0x9')]=_[_0x0e58('0xa')](config[_0x0e58('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x0e58('0xb'))(new Redis(config['redis']));require(_0x0e58('0xc'))['register'](socket);function respondWithRpcPromise(_0x594ac6,_0x154d80,_0x574bfb){return new BPromise(function(_0x52a2de,_0x59a224){return client[_0x0e58('0xd')](_0x594ac6,_0x574bfb)[_0x0e58('0xe')](function(_0x54648a){logger[_0x0e58('0xf')](_0x0e58('0x10'),_0x154d80,'request\x20sent');logger['debug'](_0x0e58('0x11'),_0x154d80,_0x0e58('0x12'),JSON[_0x0e58('0x13')](_0x54648a));if(_0x54648a[_0x0e58('0x14')]){if(_0x54648a[_0x0e58('0x14')]['code']===0x1f4){logger[_0x0e58('0x14')](_0x0e58('0x10'),_0x154d80,_0x54648a['error'][_0x0e58('0x15')]);return _0x59a224(_0x54648a[_0x0e58('0x14')][_0x0e58('0x15')]);}logger[_0x0e58('0x14')](_0x0e58('0x10'),_0x154d80,_0x54648a[_0x0e58('0x14')][_0x0e58('0x15')]);return _0x52a2de(_0x54648a['error'][_0x0e58('0x15')]);}else{logger[_0x0e58('0xf')](_0x0e58('0x10'),_0x154d80,_0x0e58('0x12'));_0x52a2de(_0x54648a[_0x0e58('0x16')][_0x0e58('0x15')]);}})[_0x0e58('0x17')](function(_0x3e07ea){logger['error'](_0x0e58('0x10'),_0x154d80,_0x3e07ea);_0x59a224(_0x3e07ea);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 99292c6..a808080 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 _0xbc80=['update','emit','removeListener','register','length','./chatWebsite.events','remove'];(function(_0x2ee93b,_0x82445f){var _0x37c343=function(_0x1632b8){while(--_0x1632b8){_0x2ee93b['push'](_0x2ee93b['shift']());}};_0x37c343(++_0x82445f);}(_0xbc80,0x1da));var _0x0bc8=function(_0x1d8119,_0xc98f17){_0x1d8119=_0x1d8119-0x0;var _0x3e30f6=_0xbc80[_0x1d8119];return _0x3e30f6;};'use strict';var ChatWebsiteEvents=require(_0x0bc8('0x0'));var events=['save',_0x0bc8('0x1'),_0x0bc8('0x2')];function createListener(_0x20e2cd,_0x3f1d33){return function(_0x399b6e){_0x3f1d33[_0x0bc8('0x3')](_0x20e2cd,_0x399b6e);};}function removeListener(_0x3d0574,_0x505b72){return function(){ChatWebsiteEvents[_0x0bc8('0x4')](_0x3d0574,_0x505b72);};}exports[_0x0bc8('0x5')]=function(_0x3c0d7a){for(var _0x28602b=0x0,_0x6a3e3e=events[_0x0bc8('0x6')];_0x28602b<_0x6a3e3e;_0x28602b++){var _0x201e2a=events[_0x28602b];var _0x3029cf=createListener('chatWebsite:'+_0x201e2a,_0x3c0d7a);ChatWebsiteEvents['on'](_0x201e2a,_0x3029cf);}}; \ No newline at end of file +var _0x6df0=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x2ad3d4,_0x17cc94){var _0x268254=function(_0xfb2ec){while(--_0xfb2ec){_0x2ad3d4['push'](_0x2ad3d4['shift']());}};_0x268254(++_0x17cc94);}(_0x6df0,0x18a));var _0x06df=function(_0x37ffea,_0x25b006){_0x37ffea=_0x37ffea-0x0;var _0x2e2615=_0x6df0[_0x37ffea];return _0x2e2615;};'use strict';var ChatWebsiteEvents=require(_0x06df('0x0'));var events=[_0x06df('0x1'),_0x06df('0x2'),_0x06df('0x3')];function createListener(_0x33c327,_0x2169e6){return function(_0x264f8b){_0x2169e6[_0x06df('0x4')](_0x33c327,_0x264f8b);};}function removeListener(_0xc374f4,_0x2560bc){return function(){ChatWebsiteEvents[_0x06df('0x5')](_0xc374f4,_0x2560bc);};}exports[_0x06df('0x6')]=function(_0x201535){for(var _0x43b36f=0x0,_0x762a12=events[_0x06df('0x7')];_0x43b36f<_0x762a12;_0x43b36f++){var _0x34f247=events[_0x43b36f];var _0x24952a=createListener(_0x06df('0x8')+_0x34f247,_0x201535);ChatWebsiteEvents['on'](_0x34f247,_0x24952a);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index ac486df..e381044 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 _0xf53a=['removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/logo','/:id/avatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','/:id/applications','getApplications','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','root','%s-%s','now','single','file','addLogo','diskStorage','join','server/files/images/avatars/','originalname','addAvatar','format','addCustomerAvatar','addSystemAvatar','attachments','offline-chat','ensureDir','extname','/:id/offline','any','/:id/interactions','/:id/proactive_actions','addProactiveActions','addAgents','delete'];(function(_0x447d04,_0x17d2ce){var _0x36a9e7=function(_0x49aa85){while(--_0x49aa85){_0x447d04['push'](_0x447d04['shift']());}};_0x36a9e7(++_0x17d2ce);}(_0xf53a,0x85));var _0xaf53=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0xf53a[_0x576170];return _0x397c70;};'use strict';var multer=require(_0xaf53('0x0'));var util=require('util');var path=require(_0xaf53('0x1'));var timeout=require(_0xaf53('0x2'));var express=require(_0xaf53('0x3'));var router=express[_0xaf53('0x4')]();var fs_extra=require(_0xaf53('0x5'));var auth=require(_0xaf53('0x6'));var interaction=require(_0xaf53('0x7'));var config=require(_0xaf53('0x8'));var controller=require(_0xaf53('0x9'));router[_0xaf53('0xa')]('/',auth[_0xaf53('0xb')](),controller[_0xaf53('0xc')]);router[_0xaf53('0xa')](_0xaf53('0xd'),auth[_0xaf53('0xb')](),controller[_0xaf53('0xe')]);router[_0xaf53('0xa')](_0xaf53('0xf'),auth[_0xaf53('0xb')](),controller[_0xaf53('0x10')]);router['get'](_0xaf53('0x11'),auth[_0xaf53('0xb')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0xaf53('0xa')](_0xaf53('0x12'),controller['getLogo']);router[_0xaf53('0xa')](_0xaf53('0x13'),controller['getAvatar']);router['get'](_0xaf53('0x14'),controller['getCustomerAvatar']);router[_0xaf53('0xa')](_0xaf53('0x15'),controller[_0xaf53('0x16')]);router[_0xaf53('0xa')]('/:id/interactions',auth[_0xaf53('0xb')](),controller[_0xaf53('0x17')]);router[_0xaf53('0xa')](_0xaf53('0x18'),controller['getSnippet']);router[_0xaf53('0xa')](_0xaf53('0x19'),auth[_0xaf53('0xb')](),controller[_0xaf53('0x1a')]);router[_0xaf53('0xa')]('/:id/proactive_actions',auth[_0xaf53('0xb')](),controller[_0xaf53('0x1b')]);router[_0xaf53('0xa')]('/:id/fields',controller[_0xaf53('0x1c')]);router[_0xaf53('0xa')](_0xaf53('0x1d'),auth[_0xaf53('0xb')](),controller[_0xaf53('0x1e')]);router['get'](_0xaf53('0x1f'),auth[_0xaf53('0xb')](),controller[_0xaf53('0x20')]);router[_0xaf53('0x21')]('/',auth[_0xaf53('0xb')](),controller[_0xaf53('0x22')]);router[_0xaf53('0x21')](_0xaf53('0x11'),auth[_0xaf53('0xb')](),controller[_0xaf53('0x23')]);router[_0xaf53('0x21')](_0xaf53('0x24'),auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x43ffbf,_0x29980c,_0x4097f8){_0x4097f8(null,path['join'](config[_0xaf53('0x25')],'server/files/images/logos/'));},'filename':function(_0x240c69,_0x3c711a,_0x30453f){_0x30453f(null,util['format'](_0xaf53('0x26'),Date[_0xaf53('0x27')](),_0x3c711a['originalname']));}})});router['post'](_0xaf53('0x12'),upload[_0xaf53('0x28')](_0xaf53('0x29')),controller[_0xaf53('0x2a')]);var upload=multer({'storage':multer[_0xaf53('0x2b')]({'destination':function(_0x1e62ad,_0xe0a3d5,_0x335cb8){_0x335cb8(null,path[_0xaf53('0x2c')](config[_0xaf53('0x25')],_0xaf53('0x2d')));},'filename':function(_0x5f5025,_0x599a23,_0x434fa3){_0x434fa3(null,util['format'](_0xaf53('0x26'),Date['now'](),_0x599a23[_0xaf53('0x2e')]));}})});router['post']('/:id/avatar',upload[_0xaf53('0x28')]('file'),controller[_0xaf53('0x2f')]);var upload=multer({'storage':multer[_0xaf53('0x2b')]({'destination':function(_0x3a1c4d,_0xea548e,_0x22234f){_0x22234f(null,path[_0xaf53('0x2c')](config['root'],_0xaf53('0x2d')));},'filename':function(_0x54181b,_0x15f3fb,_0x4bb7d5){_0x4bb7d5(null,util[_0xaf53('0x30')](_0xaf53('0x26'),Date[_0xaf53('0x27')](),_0x15f3fb[_0xaf53('0x2e')]));}})});router[_0xaf53('0x21')](_0xaf53('0x14'),upload[_0xaf53('0x28')](_0xaf53('0x29')),controller[_0xaf53('0x31')]);var upload=multer({'storage':multer[_0xaf53('0x2b')]({'destination':function(_0x15e1bc,_0x257e5a,_0x44dba5){_0x44dba5(null,path[_0xaf53('0x2c')](config[_0xaf53('0x25')],_0xaf53('0x2d')));},'filename':function(_0x297cec,_0xc8ddec,_0x4b6241){_0x4b6241(null,util['format'](_0xaf53('0x26'),Date[_0xaf53('0x27')](),_0xc8ddec[_0xaf53('0x2e')]));}})});router[_0xaf53('0x21')](_0xaf53('0x15'),upload[_0xaf53('0x28')](_0xaf53('0x29')),controller[_0xaf53('0x32')]);router[_0xaf53('0x21')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xaf53('0x2b')]({'destination':function(_0xe24aaf,_0x5b0625,_0x6c78c7){const _0x3bbe58=path[_0xaf53('0x2c')](config['root'],'server/files',_0xaf53('0x33'),_0xaf53('0x34'));fs_extra[_0xaf53('0x35')](_0x3bbe58,function(){_0x6c78c7(null,_0x3bbe58);});},'filename':function(_0x4bb7f2,_0x4cd7f8,_0x1c16a4){const _0x340ca2=_0x4cd7f8['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x574780=path[_0xaf53('0x36')](_0x340ca2);const _0x5ba018=Date[_0xaf53('0x27')]()+'-'+_0x340ca2['replace'](_0x574780,'')+_0x574780;_0x1c16a4(null,_0x5ba018);}})});router[_0xaf53('0x21')](_0xaf53('0x37'),offlineUploadMulter[_0xaf53('0x38')](),controller['offline']);router[_0xaf53('0x21')](_0xaf53('0x39'),auth[_0xaf53('0xb')](),controller['addInteraction']);router[_0xaf53('0x21')]('/:id/applications',auth[_0xaf53('0xb')](),controller['addApplications']);router[_0xaf53('0x21')](_0xaf53('0x3a'),auth[_0xaf53('0xb')](),controller[_0xaf53('0x3b')]);router[_0xaf53('0x21')](_0xaf53('0x1f'),auth[_0xaf53('0xb')](),controller[_0xaf53('0x3c')]);router['put']('/:id',auth[_0xaf53('0xb')](),controller['update']);router[_0xaf53('0x3d')](_0xaf53('0xf'),auth[_0xaf53('0xb')](),controller['destroy']);router[_0xaf53('0x3d')](_0xaf53('0x11'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0xaf53('0x24'),auth[_0xaf53('0xb')](),controller[_0xaf53('0x3e')]);router[_0xaf53('0x3d')](_0xaf53('0x1f'),auth[_0xaf53('0xb')](),controller[_0xaf53('0x3f')]);module[_0xaf53('0x40')]=router; \ No newline at end of file +var _0x8b1e=['/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','/:id/avatar','addAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','any','/:id/users','addAgents','update','delete','destroy','removeDispositions','removeAgents','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','/:id/logo','getLogo','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','getSnippet'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8b1e,0x175));var _0xe8b1=function(_0x238b1e,_0x3cdef9){_0x238b1e=_0x238b1e-0x0;var _0x175491=_0x8b1e[_0x238b1e];return _0x175491;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe8b1('0x0'));var timeout=require(_0xe8b1('0x1'));var express=require(_0xe8b1('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe8b1('0x3'));var interaction=require(_0xe8b1('0x4'));var config=require(_0xe8b1('0x5'));var controller=require(_0xe8b1('0x6'));router[_0xe8b1('0x7')]('/',auth[_0xe8b1('0x8')](),controller[_0xe8b1('0x9')]);router['get'](_0xe8b1('0xa'),auth[_0xe8b1('0x8')](),controller[_0xe8b1('0xb')]);router[_0xe8b1('0x7')](_0xe8b1('0xc'),auth['isAuthenticated'](),controller[_0xe8b1('0xd')]);router['get'](_0xe8b1('0xe'),auth[_0xe8b1('0x8')](),controller['getDispositions']);router[_0xe8b1('0x7')](_0xe8b1('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xe8b1('0x7')](_0xe8b1('0x10'),controller[_0xe8b1('0x11')]);router[_0xe8b1('0x7')]('/:id/avatar',controller['getAvatar']);router[_0xe8b1('0x7')]('/:id/customer_avatar',controller[_0xe8b1('0x12')]);router[_0xe8b1('0x7')](_0xe8b1('0x13'),controller['getSystemAvatar']);router['get'](_0xe8b1('0x14'),auth[_0xe8b1('0x8')](),controller[_0xe8b1('0x15')]);router[_0xe8b1('0x7')]('/:id/snippet',controller[_0xe8b1('0x16')]);router[_0xe8b1('0x7')](_0xe8b1('0x17'),auth['isAuthenticated'](),controller[_0xe8b1('0x18')]);router['get'](_0xe8b1('0x19'),auth['isAuthenticated'](),controller['getProactiveActions']);router[_0xe8b1('0x7')](_0xe8b1('0x1a'),controller[_0xe8b1('0x1b')]);router[_0xe8b1('0x7')](_0xe8b1('0x1c'),auth[_0xe8b1('0x8')](),controller[_0xe8b1('0x1d')]);router['get']('/:id/users',auth[_0xe8b1('0x8')](),controller[_0xe8b1('0x1e')]);router[_0xe8b1('0x1f')]('/',auth[_0xe8b1('0x8')](),controller[_0xe8b1('0x20')]);router[_0xe8b1('0x1f')](_0xe8b1('0xe'),auth[_0xe8b1('0x8')](),controller[_0xe8b1('0x21')]);router[_0xe8b1('0x1f')](_0xe8b1('0xf'),auth[_0xe8b1('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xe8b1('0x22')]({'destination':function(_0x13f451,_0x760ff2,_0x296e0f){_0x296e0f(null,path[_0xe8b1('0x23')](config[_0xe8b1('0x24')],_0xe8b1('0x25')));},'filename':function(_0x54ebc7,_0x2b471c,_0x34ab8f){_0x34ab8f(null,util[_0xe8b1('0x26')](_0xe8b1('0x27'),Date[_0xe8b1('0x28')](),_0x2b471c[_0xe8b1('0x29')]));}})});router[_0xe8b1('0x1f')](_0xe8b1('0x10'),upload[_0xe8b1('0x2a')](_0xe8b1('0x2b')),controller[_0xe8b1('0x2c')]);var upload=multer({'storage':multer[_0xe8b1('0x22')]({'destination':function(_0x364423,_0x4a5d1e,_0x3aa5a6){_0x3aa5a6(null,path[_0xe8b1('0x23')](config[_0xe8b1('0x24')],_0xe8b1('0x2d')));},'filename':function(_0x57c362,_0x14e0f0,_0x215c78){_0x215c78(null,util['format'](_0xe8b1('0x27'),Date[_0xe8b1('0x28')](),_0x14e0f0['originalname']));}})});router[_0xe8b1('0x1f')](_0xe8b1('0x2e'),upload[_0xe8b1('0x2a')](_0xe8b1('0x2b')),controller[_0xe8b1('0x2f')]);var upload=multer({'storage':multer[_0xe8b1('0x22')]({'destination':function(_0x212fd8,_0x491183,_0x124979){_0x124979(null,path[_0xe8b1('0x23')](config[_0xe8b1('0x24')],_0xe8b1('0x2d')));},'filename':function(_0xe94d90,_0x13bb30,_0x18083b){_0x18083b(null,util[_0xe8b1('0x26')](_0xe8b1('0x27'),Date[_0xe8b1('0x28')](),_0x13bb30['originalname']));}})});router[_0xe8b1('0x1f')]('/:id/customer_avatar',upload['single'](_0xe8b1('0x2b')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xe8b1('0x22')]({'destination':function(_0x356f7a,_0x36e0ca,_0x97c3f9){_0x97c3f9(null,path[_0xe8b1('0x23')](config[_0xe8b1('0x24')],_0xe8b1('0x2d')));},'filename':function(_0xa0b936,_0x4ccbc0,_0x163a70){_0x163a70(null,util[_0xe8b1('0x26')](_0xe8b1('0x27'),Date[_0xe8b1('0x28')](),_0x4ccbc0[_0xe8b1('0x29')]));}})});router[_0xe8b1('0x1f')]('/:id/system_avatar',upload[_0xe8b1('0x2a')](_0xe8b1('0x2b')),controller[_0xe8b1('0x30')]);router[_0xe8b1('0x1f')](_0xe8b1('0x31'),controller[_0xe8b1('0x32')]);const offlineUploadMulter=multer({'storage':multer[_0xe8b1('0x22')]({'destination':function(_0x5c33e0,_0x5f1619,_0x4e1dc7){const _0x4cc22e=path[_0xe8b1('0x23')](config[_0xe8b1('0x24')],_0xe8b1('0x33'),_0xe8b1('0x34'),_0xe8b1('0x35'));fs_extra[_0xe8b1('0x36')](_0x4cc22e,function(){_0x4e1dc7(null,_0x4cc22e);});},'filename':function(_0x37258a,_0x368fff,_0x5efc19){const _0x49e2ab=_0x368fff[_0xe8b1('0x29')][_0xe8b1('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x176f2b=path['extname'](_0x49e2ab);const _0x1bcf9b=Date[_0xe8b1('0x28')]()+'-'+_0x49e2ab[_0xe8b1('0x37')](_0x176f2b,'')+_0x176f2b;_0x5efc19(null,_0x1bcf9b);}})});router[_0xe8b1('0x1f')](_0xe8b1('0x38'),offlineUploadMulter[_0xe8b1('0x39')](),controller['offline']);router[_0xe8b1('0x1f')](_0xe8b1('0x14'),auth[_0xe8b1('0x8')](),controller['addInteraction']);router[_0xe8b1('0x1f')]('/:id/applications',auth[_0xe8b1('0x8')](),controller['addApplications']);router[_0xe8b1('0x1f')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['addProactiveActions']);router[_0xe8b1('0x1f')](_0xe8b1('0x3a'),auth[_0xe8b1('0x8')](),controller[_0xe8b1('0x3b')]);router['put'](_0xe8b1('0xc'),auth[_0xe8b1('0x8')](),controller[_0xe8b1('0x3c')]);router[_0xe8b1('0x3d')](_0xe8b1('0xc'),auth[_0xe8b1('0x8')](),controller[_0xe8b1('0x3e')]);router['delete'](_0xe8b1('0xe'),auth['isAuthenticated'](),controller[_0xe8b1('0x3f')]);router[_0xe8b1('0x3d')](_0xe8b1('0xf'),auth[_0xe8b1('0x8')](),controller['removeAnswers']);router[_0xe8b1('0x3d')](_0xe8b1('0x3a'),auth[_0xe8b1('0x8')](),controller[_0xe8b1('0x40')]);module[_0xe8b1('0x41')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index ecd1bdf..6f8378c 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 _0xe801=['../components/auth/service','../config/environment','Router','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express'];(function(_0x466bc5,_0x3a0f2a){var _0x138952=function(_0x392fa2){while(--_0x392fa2){_0x466bc5['push'](_0x466bc5['shift']());}};_0x138952(++_0x3a0f2a);}(_0xe801,0xfe));var _0x1e80=function(_0x2e28ca,_0x4d6a16){_0x2e28ca=_0x2e28ca-0x0;var _0x45d143=_0xe801[_0x2e28ca];return _0x45d143;};var beaverLogger=require(_0x1e80('0x0'));var express=require(_0x1e80('0x1'));var auth=require(_0x1e80('0x2'));var config=require(_0x1e80('0x3'));var router=express[_0x1e80('0x4')]();var isProduction=config[_0x1e80('0x5')]===_0x1e80('0x6')||![];function clientSideLogs(_0x50f3b5,_0x4e1af4,_0x40cbda){var _0x23c4d2=_0x50f3b5[_0x1e80('0x7')][_0x1e80('0x8')](_0x1e80('0x9'));if(!_0x23c4d2){throw new Error(_0x1e80('0xa'));}return beaverLogger[_0x1e80('0xb')]({'uri':_0x1e80('0xc'),'logger':_0x23c4d2,'enableCors':!isProduction})(_0x50f3b5,_0x4e1af4,_0x40cbda);}router[_0x1e80('0xd')](auth[_0x1e80('0xe')](),clientSideLogs);module[_0x1e80('0xf')]=router; \ No newline at end of file +var _0x647c=['isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment','env','production','app','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use'];(function(_0x21549c,_0x24d668){var _0x25ad23=function(_0x517d14){while(--_0x517d14){_0x21549c['push'](_0x21549c['shift']());}};_0x25ad23(++_0x24d668);}(_0x647c,0x10c));var _0xc647=function(_0x59bd6a,_0x540db8){_0x59bd6a=_0x59bd6a-0x0;var _0x54ffd0=_0x647c[_0x59bd6a];return _0x54ffd0;};var beaverLogger=require(_0xc647('0x0'));var express=require(_0xc647('0x1'));var auth=require(_0xc647('0x2'));var config=require(_0xc647('0x3'));var router=express['Router']();var isProduction=config[_0xc647('0x4')]===_0xc647('0x5')||![];function clientSideLogs(_0x40629c,_0x2dedb5,_0x15726f){var _0x818d86=_0x40629c[_0xc647('0x6')][_0xc647('0x7')]('client-side-logger');if(!_0x818d86){throw new Error(_0xc647('0x8'));}return beaverLogger[_0xc647('0x9')]({'uri':_0xc647('0xa'),'logger':_0x818d86,'enableCors':!isProduction})(_0x40629c,_0x2dedb5,_0x15726f);}router[_0xc647('0xb')](auth[_0xc647('0xc')](),clientSideLogs);module[_0xc647('0xd')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index dd5de88..b957fce 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 _0x6fc7=['Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure'];(function(_0x57259d,_0x5da1b1){var _0x3c4c75=function(_0x18f5f0){while(--_0x18f5f0){_0x57259d['push'](_0x57259d['shift']());}};_0x3c4c75(++_0x5da1b1);}(_0x6fc7,0x8f));var _0x76fc=function(_0x39410c,_0x4b8259){_0x39410c=_0x39410c-0x0;var _0x11e99a=_0x6fc7[_0x39410c];return _0x11e99a;};'use strict';var Sequelize=require(_0x76fc('0x0'));module[_0x76fc('0x1')]={'name':{'type':Sequelize[_0x76fc('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x76fc('0x3')](_0x76fc('0x4'),_0x76fc('0x5'),_0x76fc('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x76fc('0x7'),_0x76fc('0x8'))},'data1':{'type':Sequelize[_0x76fc('0x2')],'comment':_0x76fc('0x9')},'data2':{'type':Sequelize[_0x76fc('0x2')],'comment':_0x76fc('0xa')},'data3':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize['STRING'],'comment':_0x76fc('0xb')},'data5':{'type':Sequelize['TEXT'],'comment':_0x76fc('0xc')},'data6':{'type':Sequelize[_0x76fc('0xd')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x76fc('0xd')],'comment':_0x76fc('0xe')}}; \ No newline at end of file +var _0x2e92=['Google','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS'];(function(_0x22e429,_0x274567){var _0x39bde9=function(_0x34d023){while(--_0x34d023){_0x22e429['push'](_0x22e429['shift']());}};_0x39bde9(++_0x274567);}(_0x2e92,0xdb));var _0x22e9=function(_0x5927f8,_0x420239){_0x5927f8=_0x5927f8-0x0;var _0x399a2f=_0x2e92[_0x5927f8];return _0x399a2f;};'use strict';var Sequelize=require(_0x22e9('0x0'));module[_0x22e9('0x1')]={'name':{'type':Sequelize[_0x22e9('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x22e9('0x3')](_0x22e9('0x4'),_0x22e9('0x5'),_0x22e9('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x22e9('0x3')](_0x22e9('0x7'),'Dynamics365')},'data1':{'type':Sequelize[_0x22e9('0x2')],'comment':_0x22e9('0x8')},'data2':{'type':Sequelize[_0x22e9('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x22e9('0x2')],'comment':_0x22e9('0x9')},'data4':{'type':Sequelize['STRING'],'comment':_0x22e9('0xa')},'data5':{'type':Sequelize[_0x22e9('0xb')],'comment':_0x22e9('0xc')},'data6':{'type':Sequelize[_0x22e9('0xb')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x22e9('0xb')],'comment':_0x22e9('0xd')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 7ef932c..b834ed5 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 _0x3722=['redis','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','update','then','error','stack','send','padEnd','index','map','CloudProvider','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','name','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','include','options','find','create','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','destroy','oauth2MicrosoftAuthorize','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','from','base64','toString','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','stringify','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults'];(function(_0x38bd4c,_0x44ee91){var _0x3284cc=function(_0x5365b1){while(--_0x5365b1){_0x38bd4c['push'](_0x38bd4c['shift']());}};_0x3284cc(++_0x44ee91);}(_0x3722,0x1c4));var _0x2372=function(_0x3faea4,_0x410619){_0x3faea4=_0x3faea4-0x0;var _0x24f357=_0x3722[_0x3faea4];return _0x24f357;};'use strict';var _=require(_0x2372('0x0'));var Redis=require(_0x2372('0x1'));var qs=require(_0x2372('0x2'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0x2372('0x3'))(_0x2372('0x4'));var db=require(_0x2372('0x5'))['db'];var oauth=require(_0x2372('0x6'));config['redis']=_[_0x2372('0x7')](config[_0x2372('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x2372('0x9'))(new Redis(config[_0x2372('0x8')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x52cb40,_0x20a00d){_0x20a00d=_0x20a00d||0xcc;return function(_0x39629d){if(_0x39629d){return _0x52cb40[_0x2372('0xa')](_0x20a00d);}return _0x52cb40[_0x2372('0xb')](_0x20a00d)[_0x2372('0xc')]();};}function respondWithResult(_0x39649c,_0x4bee6e){_0x4bee6e=_0x4bee6e||0xc8;return function(_0x1bde9a){if(_0x1bde9a){return _0x39649c[_0x2372('0xb')](_0x4bee6e)[_0x2372('0xd')](_0x1bde9a);}};}function respondWithFilteredResult(_0x5c4de5,_0x93800c){return function(_0x14da25){if(_0x14da25){var _0x21ad06=typeof _0x93800c[_0x2372('0xe')]===_0x2372('0xf')&&typeof _0x93800c[_0x2372('0x10')]===_0x2372('0xf');var _0x2141f3=_0x14da25['count'];var _0x420a92=_0x21ad06?0x0:_0x93800c[_0x2372('0xe')];var _0x3b974f=_0x21ad06?_0x14da25[_0x2372('0x11')]:_0x93800c[_0x2372('0xe')]+_0x93800c[_0x2372('0x10')];var _0x42b79a;if(_0x3b974f>=_0x2141f3){_0x3b974f=_0x2141f3;_0x42b79a=0xc8;}else{_0x42b79a=0xce;}_0x5c4de5[_0x2372('0xb')](_0x42b79a);return _0x5c4de5['set']('Content-Range',_0x420a92+'-'+_0x3b974f+'/'+_0x2141f3)[_0x2372('0xd')](_0x14da25);}return null;};}function saveUpdates(_0x46ff6a){return function(_0x3a5865){if(_0x3a5865){return _0x3a5865[_0x2372('0x12')](_0x46ff6a)[_0x2372('0x13')](function(_0x5ba21d){return _0x5ba21d;});}return null;};}function removeEntity(_0x6adba3){return function(_0x387fc7){if(_0x387fc7){return _0x387fc7['destroy']()[_0x2372('0x13')](function(){_0x6adba3[_0x2372('0xb')](0xcc)[_0x2372('0xc')]();});}};}function handleEntityNotFound(_0x4f4da8){return function(_0x326ba7){if(!_0x326ba7){_0x4f4da8[_0x2372('0xa')](0x194);}return _0x326ba7;};}function handleError(_0x2e9b4b,_0x500195){_0x500195=_0x500195||0x1f4;return function(_0x2c5a1d){logger[_0x2372('0x14')](_0x2c5a1d[_0x2372('0x15')]);if(_0x2c5a1d['name']){delete _0x2c5a1d['name'];}_0x2e9b4b['status'](_0x500195)[_0x2372('0x16')](_0x2c5a1d);};}function maskClientSecret(_0x40583b){return _[_0x2372('0x17')](_0x40583b['slice'](0x0,0x3),0x14,'*');}exports[_0x2372('0x18')]=function(_0x55b444,_0x29c9a0){var _0x5e288a={},_0x444458={},_0x5f40ee={'count':0x0,'rows':[]};var _0x2a3eb4=_[_0x2372('0x19')](db[_0x2372('0x1a')][_0x2372('0x1b')],function(_0x3c9973){return{'name':_0x3c9973[_0x2372('0x1c')],'type':_0x3c9973['type'][_0x2372('0x1d')]};});_0x444458[_0x2372('0x1e')]=_['map'](_0x2a3eb4,'name');_0x444458['query']=_[_0x2372('0x1f')](_0x55b444[_0x2372('0x20')]);_0x444458[_0x2372('0x21')]=_['intersection'](_0x444458[_0x2372('0x1e')],_0x444458[_0x2372('0x20')]);_0x5e288a[_0x2372('0x22')]=_[_0x2372('0x23')](_0x444458[_0x2372('0x1e')],qs[_0x2372('0x24')](_0x55b444['query'][_0x2372('0x24')]));_0x5e288a['attributes']=_0x5e288a[_0x2372('0x22')][_0x2372('0x25')]?_0x5e288a[_0x2372('0x22')]:_0x444458[_0x2372('0x1e')];if(!_0x55b444[_0x2372('0x20')][_0x2372('0x26')]('nolimit')){_0x5e288a[_0x2372('0x10')]=qs[_0x2372('0x10')](_0x55b444['query'][_0x2372('0x10')]);_0x5e288a['offset']=qs[_0x2372('0xe')](_0x55b444[_0x2372('0x20')][_0x2372('0xe')]);}_0x5e288a[_0x2372('0x27')]=qs[_0x2372('0x28')](_0x55b444[_0x2372('0x20')][_0x2372('0x28')]);_0x5e288a[_0x2372('0x29')]=qs[_0x2372('0x21')](_[_0x2372('0x2a')](_0x55b444[_0x2372('0x20')],_0x444458[_0x2372('0x21')]),_0x2a3eb4);if(_0x55b444[_0x2372('0x20')][_0x2372('0x2b')]){_0x5e288a[_0x2372('0x29')]=_[_0x2372('0x2c')](_0x5e288a[_0x2372('0x29')],{'$or':_['map'](_0x2a3eb4,function(_0x520a4a){if(_0x520a4a[_0x2372('0x2d')]!=='VIRTUAL'){var _0x124713={};_0x124713[_0x520a4a[_0x2372('0x2e')]]={'$like':'%'+_0x55b444[_0x2372('0x20')][_0x2372('0x2b')]+'%'};return _0x124713;}})});}_0x5e288a=_[_0x2372('0x2c')]({},_0x5e288a,_0x55b444['options']);var _0x2314d7={'where':_0x5e288a[_0x2372('0x29')]};return db[_0x2372('0x1a')][_0x2372('0x11')](_0x2314d7)[_0x2372('0x13')](function(_0x493f4f){_0x5f40ee[_0x2372('0x11')]=_0x493f4f;if(_0x55b444[_0x2372('0x20')]['includeAll']){_0x5e288a['include']=[{'all':!![]}];}return db[_0x2372('0x1a')]['findAll'](_0x5e288a);})['then'](function(_0x2e1e03){_0x5f40ee[_0x2372('0x2f')]=_[_0x2372('0x19')](_0x2e1e03,function(_0x39fb16){if(_0x39fb16[_0x2372('0x30')]===_0x2372('0x31')){var _0x11b011=encryptor[_0x2372('0x32')](_0x39fb16[_0x2372('0x33')]);_0x39fb16['data3']=maskClientSecret(_0x11b011);}return _0x39fb16;});return _0x5f40ee;})[_0x2372('0x13')](respondWithFilteredResult(_0x29c9a0,_0x5e288a))[_0x2372('0x34')](handleError(_0x29c9a0,null));};exports[_0x2372('0x35')]=function(_0x5f2f35,_0x42557d){var _0x4cd0c7={'raw':!![],'where':{'id':_0x5f2f35[_0x2372('0x36')]['id']}},_0x5c82b1={};_0x5c82b1[_0x2372('0x1e')]=_[_0x2372('0x1f')](db[_0x2372('0x1a')][_0x2372('0x1b')]);_0x5c82b1['query']=_['keys'](_0x5f2f35[_0x2372('0x20')]);_0x5c82b1[_0x2372('0x21')]=_[_0x2372('0x23')](_0x5c82b1[_0x2372('0x1e')],_0x5c82b1[_0x2372('0x20')]);_0x4cd0c7[_0x2372('0x22')]=_[_0x2372('0x23')](_0x5c82b1[_0x2372('0x1e')],qs[_0x2372('0x24')](_0x5f2f35[_0x2372('0x20')][_0x2372('0x24')]));_0x4cd0c7['attributes']=_0x4cd0c7['attributes'][_0x2372('0x25')]?_0x4cd0c7['attributes']:_0x5c82b1[_0x2372('0x1e')];if(_0x5f2f35['query']['includeAll']){_0x4cd0c7[_0x2372('0x37')]=[{'all':!![]}];}_0x4cd0c7=_['merge']({},_0x4cd0c7,_0x5f2f35[_0x2372('0x38')]);return db[_0x2372('0x1a')][_0x2372('0x39')](_0x4cd0c7)[_0x2372('0x13')](handleEntityNotFound(_0x42557d,null))[_0x2372('0x13')](function(_0x42ce78){if(_0x42ce78[_0x2372('0x30')]==='MicrosoftAzure'){var _0xe8f171=encryptor[_0x2372('0x32')](_0x42ce78[_0x2372('0x33')]);_0x42ce78[_0x2372('0x33')]=maskClientSecret(_0xe8f171);}return _0x42ce78;})[_0x2372('0x13')](respondWithResult(_0x42557d,null))[_0x2372('0x34')](handleError(_0x42557d,null));};exports[_0x2372('0x3a')]=function(_0x4e0c93,_0x5e52cb){if(!_0x4e0c93[_0x2372('0x3b')][_0x2372('0x2e')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x4e0c93[_0x2372('0x3b')][_0x2372('0x30')])throw new Error(_0x2372('0x3c'));var _0x2c493b=db['CloudProvider'][_0x2372('0x1b')][_0x2372('0x30')][_0x2372('0x3d')];if(!_0x2c493b[_0x2372('0x3e')](_0x4e0c93['body']['service']))throw new Error(_0x2372('0x3f')+_0x2c493b[_0x2372('0x40')](',\x20'));if(_0x4e0c93[_0x2372('0x3b')]['service']===_0x2372('0x31')&&_0x4e0c93[_0x2372('0x3b')]['data3']){_0x4e0c93['body']['data3']=encryptor[_0x2372('0x41')](_0x4e0c93[_0x2372('0x3b')][_0x2372('0x33')]);}return db[_0x2372('0x1a')][_0x2372('0x3a')](_0x4e0c93['body'],{})[_0x2372('0x13')](respondWithResult(_0x5e52cb,0xc9))[_0x2372('0x34')](handleError(_0x5e52cb,null));};exports['update']=function(_0x5deb09,_0x533900){if(_0x5deb09[_0x2372('0x3b')]['id']){delete _0x5deb09[_0x2372('0x3b')]['id'];}return db[_0x2372('0x1a')]['find']({'where':{'id':_0x5deb09[_0x2372('0x36')]['id']}})[_0x2372('0x13')](handleEntityNotFound(_0x533900,null))[_0x2372('0x13')](function(_0x18f46e){if(_0x18f46e[_0x2372('0x30')]==='MicrosoftAzure'&&_0x5deb09['body'][_0x2372('0x33')]){_0x5deb09[_0x2372('0x3b')][_0x2372('0x33')]=encryptor[_0x2372('0x41')](_0x5deb09[_0x2372('0x3b')][_0x2372('0x33')]);}return _0x18f46e;})[_0x2372('0x13')](saveUpdates(_0x5deb09['body'],null))['then'](respondWithResult(_0x533900,null))[_0x2372('0x34')](handleError(_0x533900,null));};exports[_0x2372('0x42')]=function(_0x5014a2,_0xd59051){return db['CloudProvider'][_0x2372('0x39')]({'where':{'id':_0x5014a2[_0x2372('0x36')]['id']}})[_0x2372('0x13')](handleEntityNotFound(_0xd59051,null))[_0x2372('0x13')](removeEntity(_0xd59051,null))[_0x2372('0x34')](handleError(_0xd59051,null));};exports[_0x2372('0x43')]=function(_0x495ef3,_0x21df07){return db[_0x2372('0x1a')]['findOne']({'where':{'id':_0x495ef3['params']['id']},'raw':!![]})[_0x2372('0x13')](function(_0x26bab9){if(!_0x26bab9)return _0x21df07['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x26bab9,_0x495ef3[_0x2372('0x44')]['id'])};})[_0x2372('0x13')](respondWithResult(_0x21df07,null))[_0x2372('0x34')](handleError(_0x21df07,null));};exports[_0x2372('0x45')]=function(_0x2e6099,_0x2eca00){var _0x11d4e7=_0x2e6099[_0x2372('0x3b')];var _0x4fdecc;var _0x4e11d2;if(_0x11d4e7[_0x2372('0x14')])throw _0x11d4e7;redis[_0x2372('0x46')](_0x11d4e7[_0x2372('0x47')])[_0x2372('0x13')](function(_0x3c1608){if(!_0x3c1608)throw new Error(_0x2372('0x48'));_0x4fdecc=JSON['parse'](_0x3c1608);var _0x2903b3=Buffer[_0x2372('0x49')](_0x11d4e7[_0x2372('0x47')],_0x2372('0x4a'))[_0x2372('0x4b')]('ascii');_0x4e11d2=JSON[_0x2372('0x4c')](_0x2903b3);if(!oauth[_0x2372('0x4d')](_0x11d4e7[_0x2372('0x4e')],_0x4fdecc[_0x2372('0x4f')]))throw new Error(_0x2372('0x50'));redis[_0x2372('0x51')](_0x11d4e7['state']);return oauth[_0x2372('0x52')](_0x11d4e7[_0x2372('0x53')],_0x4fdecc);})['then'](function(_0x5a1d20){_0x4fdecc[_0x2372('0x54')]=_0x5a1d20[_0x2372('0x55')];_0x4fdecc[_0x2372('0x56')]=_0x5a1d20[_0x2372('0x57')];return db[_0x2372('0x1a')][_0x2372('0x12')]({'data5':_0x4fdecc[_0x2372('0x54')],'data6':_0x4fdecc['data6']},{'where':{'id':_0x4fdecc['id']}});})['then'](function(){oauth[_0x2372('0x58')](_0x4fdecc);socket[_0x2372('0x59')](_0x2372('0x5a'),{'id':_0x4e11d2['id']});return;})[_0x2372('0x13')](respondWithStatusCode(_0x2eca00,null))[_0x2372('0x34')](function(_0x3bfb92){if(_0x4e11d2){socket['emit']('microsoftAuthorization:error',{'id':_0x4e11d2['id']});}if(!_0x4fdecc){logger[_0x2372('0x14')]('Invalid\x20authentication\x20state\x20parameter',_0x3bfb92);return _0x2eca00[_0x2372('0xb')](0x1f4)[_0x2372('0x16')](_0x3bfb92['message']);}logger[_0x2372('0x14')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x4fdecc['id'],JSON[_0x2372('0x5b')](_0x3bfb92));});}; \ No newline at end of file +var _0xc711=['includeAll','include','options','MicrosoftAzure','create','body','Service\x20parameter\x20not\x20specified','includes','join','find','params','encryptString','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','del','state','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','../../components/encryptor','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','status','end','offset','undefined','limit','set','json','update','then','destroy','sendStatus','error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','keys','query','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','count','rows','service','decryptString','data3','catch','show','length'];(function(_0x15b281,_0x571cb4){var _0x372ee8=function(_0x16f32f){while(--_0x16f32f){_0x15b281['push'](_0x15b281['shift']());}};_0x372ee8(++_0x571cb4);}(_0xc711,0x13b));var _0x1c71=function(_0x2cd1fb,_0x291f55){_0x2cd1fb=_0x2cd1fb-0x0;var _0x48fd2b=_0xc711[_0x2cd1fb];return _0x48fd2b;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require(_0x1c71('0x0'));var config=require('../../config/environment');var logger=require(_0x1c71('0x1'))(_0x1c71('0x2'));var db=require(_0x1c71('0x3'))['db'];var oauth=require(_0x1c71('0x4'));config[_0x1c71('0x5')]=_[_0x1c71('0x6')](config[_0x1c71('0x5')],{'host':_0x1c71('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1c71('0x5')]));var redis=new Redis(config[_0x1c71('0x5')]);function respondWithStatusCode(_0x361251,_0x295e12){_0x295e12=_0x295e12||0xcc;return function(_0x114cfe){if(_0x114cfe){return _0x361251['sendStatus'](_0x295e12);}return _0x361251[_0x1c71('0x8')](_0x295e12)[_0x1c71('0x9')]();};}function respondWithResult(_0x507ddc,_0x1b1416){_0x1b1416=_0x1b1416||0xc8;return function(_0x29f651){if(_0x29f651){return _0x507ddc[_0x1c71('0x8')](_0x1b1416)['json'](_0x29f651);}};}function respondWithFilteredResult(_0x1e0acf,_0x1d0908){return function(_0x1631e1){if(_0x1631e1){var _0x46cb3f=typeof _0x1d0908[_0x1c71('0xa')]===_0x1c71('0xb')&&typeof _0x1d0908['limit']==='undefined';var _0x384a81=_0x1631e1['count'];var _0x26440f=_0x46cb3f?0x0:_0x1d0908['offset'];var _0x56b325=_0x46cb3f?_0x1631e1['count']:_0x1d0908[_0x1c71('0xa')]+_0x1d0908[_0x1c71('0xc')];var _0x8c04b7;if(_0x56b325>=_0x384a81){_0x56b325=_0x384a81;_0x8c04b7=0xc8;}else{_0x8c04b7=0xce;}_0x1e0acf['status'](_0x8c04b7);return _0x1e0acf[_0x1c71('0xd')]('Content-Range',_0x26440f+'-'+_0x56b325+'/'+_0x384a81)[_0x1c71('0xe')](_0x1631e1);}return null;};}function saveUpdates(_0x2bc642){return function(_0xe6b8b0){if(_0xe6b8b0){return _0xe6b8b0[_0x1c71('0xf')](_0x2bc642)[_0x1c71('0x10')](function(_0x50aa36){return _0x50aa36;});}return null;};}function removeEntity(_0x5f31e4){return function(_0x487317){if(_0x487317){return _0x487317[_0x1c71('0x11')]()[_0x1c71('0x10')](function(){_0x5f31e4[_0x1c71('0x8')](0xcc)[_0x1c71('0x9')]();});}};}function handleEntityNotFound(_0x36e1b3){return function(_0x55c78c){if(!_0x55c78c){_0x36e1b3[_0x1c71('0x12')](0x194);}return _0x55c78c;};}function handleError(_0x3b169b,_0x45aab0){_0x45aab0=_0x45aab0||0x1f4;return function(_0x410d02){logger[_0x1c71('0x13')](_0x410d02[_0x1c71('0x14')]);if(_0x410d02['name']){delete _0x410d02[_0x1c71('0x15')];}_0x3b169b[_0x1c71('0x8')](_0x45aab0)[_0x1c71('0x16')](_0x410d02);};}function maskClientSecret(_0x540727){return _[_0x1c71('0x17')](_0x540727[_0x1c71('0x18')](0x0,0x3),0x14,'*');}exports[_0x1c71('0x19')]=function(_0x1f788f,_0x555555){var _0x3282a1={},_0x44e73f={},_0x567c04={'count':0x0,'rows':[]};var _0x56b987=_[_0x1c71('0x1a')](db[_0x1c71('0x1b')][_0x1c71('0x1c')],function(_0x24f7a8){return{'name':_0x24f7a8[_0x1c71('0x1d')],'type':_0x24f7a8[_0x1c71('0x1e')]['key']};});_0x44e73f['model']=_['map'](_0x56b987,_0x1c71('0x15'));_0x44e73f['query']=_[_0x1c71('0x1f')](_0x1f788f[_0x1c71('0x20')]);_0x44e73f['filters']=_['intersection'](_0x44e73f[_0x1c71('0x21')],_0x44e73f[_0x1c71('0x20')]);_0x3282a1[_0x1c71('0x22')]=_[_0x1c71('0x23')](_0x44e73f['model'],qs[_0x1c71('0x24')](_0x1f788f[_0x1c71('0x20')][_0x1c71('0x24')]));_0x3282a1[_0x1c71('0x22')]=_0x3282a1[_0x1c71('0x22')]['length']?_0x3282a1[_0x1c71('0x22')]:_0x44e73f[_0x1c71('0x21')];if(!_0x1f788f[_0x1c71('0x20')][_0x1c71('0x25')](_0x1c71('0x26'))){_0x3282a1[_0x1c71('0xc')]=qs[_0x1c71('0xc')](_0x1f788f['query'][_0x1c71('0xc')]);_0x3282a1[_0x1c71('0xa')]=qs[_0x1c71('0xa')](_0x1f788f['query']['offset']);}_0x3282a1['order']=qs['sort'](_0x1f788f['query'][_0x1c71('0x27')]);_0x3282a1[_0x1c71('0x28')]=qs['filters'](_[_0x1c71('0x29')](_0x1f788f[_0x1c71('0x20')],_0x44e73f['filters']),_0x56b987);if(_0x1f788f['query']['filter']){_0x3282a1['where']=_[_0x1c71('0x2a')](_0x3282a1[_0x1c71('0x28')],{'$or':_['map'](_0x56b987,function(_0xae89b7){if(_0xae89b7[_0x1c71('0x1e')]!==_0x1c71('0x2b')){var _0x8baff7={};_0x8baff7[_0xae89b7['name']]={'$like':'%'+_0x1f788f[_0x1c71('0x20')][_0x1c71('0x2c')]+'%'};return _0x8baff7;}})});}_0x3282a1=_[_0x1c71('0x2a')]({},_0x3282a1,_0x1f788f['options']);var _0x7923cf={'where':_0x3282a1['where']};return db[_0x1c71('0x1b')][_0x1c71('0x2d')](_0x7923cf)[_0x1c71('0x10')](function(_0x3f0760){_0x567c04[_0x1c71('0x2d')]=_0x3f0760;if(_0x1f788f[_0x1c71('0x20')]['includeAll']){_0x3282a1['include']=[{'all':!![]}];}return db[_0x1c71('0x1b')]['findAll'](_0x3282a1);})['then'](function(_0x1f8b36){_0x567c04[_0x1c71('0x2e')]=_[_0x1c71('0x1a')](_0x1f8b36,function(_0x14c63c){if(_0x14c63c[_0x1c71('0x2f')]==='MicrosoftAzure'){var _0x49ba46=encryptor[_0x1c71('0x30')](_0x14c63c[_0x1c71('0x31')]);_0x14c63c[_0x1c71('0x31')]=maskClientSecret(_0x49ba46);}return _0x14c63c;});return _0x567c04;})['then'](respondWithFilteredResult(_0x555555,_0x3282a1))[_0x1c71('0x32')](handleError(_0x555555,null));};exports[_0x1c71('0x33')]=function(_0x390b6f,_0x274e0c){var _0x582e5f={'raw':!![],'where':{'id':_0x390b6f['params']['id']}},_0x9b5c3d={};_0x9b5c3d[_0x1c71('0x21')]=_[_0x1c71('0x1f')](db[_0x1c71('0x1b')]['rawAttributes']);_0x9b5c3d['query']=_[_0x1c71('0x1f')](_0x390b6f['query']);_0x9b5c3d['filters']=_[_0x1c71('0x23')](_0x9b5c3d[_0x1c71('0x21')],_0x9b5c3d[_0x1c71('0x20')]);_0x582e5f[_0x1c71('0x22')]=_[_0x1c71('0x23')](_0x9b5c3d[_0x1c71('0x21')],qs[_0x1c71('0x24')](_0x390b6f[_0x1c71('0x20')][_0x1c71('0x24')]));_0x582e5f[_0x1c71('0x22')]=_0x582e5f[_0x1c71('0x22')][_0x1c71('0x34')]?_0x582e5f['attributes']:_0x9b5c3d['model'];if(_0x390b6f['query'][_0x1c71('0x35')]){_0x582e5f[_0x1c71('0x36')]=[{'all':!![]}];}_0x582e5f=_[_0x1c71('0x2a')]({},_0x582e5f,_0x390b6f[_0x1c71('0x37')]);return db['CloudProvider']['find'](_0x582e5f)[_0x1c71('0x10')](handleEntityNotFound(_0x274e0c,null))[_0x1c71('0x10')](function(_0x102989){if(_0x102989[_0x1c71('0x2f')]===_0x1c71('0x38')){var _0x556659=encryptor['decryptString'](_0x102989[_0x1c71('0x31')]);_0x102989[_0x1c71('0x31')]=maskClientSecret(_0x556659);}return _0x102989;})['then'](respondWithResult(_0x274e0c,null))[_0x1c71('0x32')](handleError(_0x274e0c,null));};exports[_0x1c71('0x39')]=function(_0x43108d,_0x26c48e){if(!_0x43108d[_0x1c71('0x3a')]['name'])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x43108d[_0x1c71('0x3a')][_0x1c71('0x2f')])throw new Error(_0x1c71('0x3b'));var _0x51f4f0=db[_0x1c71('0x1b')][_0x1c71('0x1c')][_0x1c71('0x2f')]['values'];if(!_0x51f4f0[_0x1c71('0x3c')](_0x43108d['body'][_0x1c71('0x2f')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x51f4f0[_0x1c71('0x3d')](',\x20'));if(_0x43108d[_0x1c71('0x3a')][_0x1c71('0x2f')]===_0x1c71('0x38')&&_0x43108d['body'][_0x1c71('0x31')]){_0x43108d['body'][_0x1c71('0x31')]=encryptor['encryptString'](_0x43108d['body'][_0x1c71('0x31')]);}return db[_0x1c71('0x1b')]['create'](_0x43108d[_0x1c71('0x3a')],{})[_0x1c71('0x10')](respondWithResult(_0x26c48e,0xc9))['catch'](handleError(_0x26c48e,null));};exports[_0x1c71('0xf')]=function(_0x51bf15,_0x1cc1ba){if(_0x51bf15[_0x1c71('0x3a')]['id']){delete _0x51bf15[_0x1c71('0x3a')]['id'];}return db[_0x1c71('0x1b')][_0x1c71('0x3e')]({'where':{'id':_0x51bf15[_0x1c71('0x3f')]['id']}})[_0x1c71('0x10')](handleEntityNotFound(_0x1cc1ba,null))[_0x1c71('0x10')](function(_0x909c4b){if(_0x909c4b[_0x1c71('0x2f')]===_0x1c71('0x38')&&_0x51bf15[_0x1c71('0x3a')][_0x1c71('0x31')]){_0x51bf15[_0x1c71('0x3a')][_0x1c71('0x31')]=encryptor[_0x1c71('0x40')](_0x51bf15[_0x1c71('0x3a')][_0x1c71('0x31')]);}return _0x909c4b;})[_0x1c71('0x10')](saveUpdates(_0x51bf15['body'],null))[_0x1c71('0x10')](respondWithResult(_0x1cc1ba,null))[_0x1c71('0x32')](handleError(_0x1cc1ba,null));};exports[_0x1c71('0x11')]=function(_0xb86059,_0x383634){return db[_0x1c71('0x1b')][_0x1c71('0x3e')]({'where':{'id':_0xb86059[_0x1c71('0x3f')]['id']}})[_0x1c71('0x10')](handleEntityNotFound(_0x383634,null))[_0x1c71('0x10')](removeEntity(_0x383634,null))['catch'](handleError(_0x383634,null));};exports[_0x1c71('0x41')]=function(_0x52399b,_0x445ea7){return db[_0x1c71('0x1b')]['findOne']({'where':{'id':_0x52399b[_0x1c71('0x3f')]['id']},'raw':!![]})['then'](function(_0x1e73a6){if(!_0x1e73a6)return _0x445ea7['sendStatus'](0x194);return{'url':oauth[_0x1c71('0x42')](_0x1e73a6,_0x52399b[_0x1c71('0x43')]['id'])};})[_0x1c71('0x10')](respondWithResult(_0x445ea7,null))['catch'](handleError(_0x445ea7,null));};exports[_0x1c71('0x44')]=function(_0x25901d,_0x5766da){var _0x21039e=_0x25901d[_0x1c71('0x3a')];var _0xf19e1c;var _0x5a93e0;if(_0x21039e[_0x1c71('0x13')])throw _0x21039e;redis[_0x1c71('0x45')](_0x21039e['state'])[_0x1c71('0x10')](function(_0x5bf094){if(!_0x5bf094)throw new Error(_0x1c71('0x46'));_0xf19e1c=JSON[_0x1c71('0x47')](_0x5bf094);var _0x3af11d=Buffer[_0x1c71('0x48')](_0x21039e['state'],_0x1c71('0x49'))[_0x1c71('0x4a')](_0x1c71('0x4b'));_0x5a93e0=JSON[_0x1c71('0x47')](_0x3af11d);if(!oauth[_0x1c71('0x4c')](_0x21039e['id_token'],_0xf19e1c['oauth2Claims']))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x1c71('0x4d')](_0x21039e[_0x1c71('0x4e')]);return oauth[_0x1c71('0x4f')](_0x21039e[_0x1c71('0x50')],_0xf19e1c);})['then'](function(_0x2d961b){_0xf19e1c[_0x1c71('0x51')]=_0x2d961b[_0x1c71('0x52')];_0xf19e1c[_0x1c71('0x53')]=_0x2d961b[_0x1c71('0x54')];return db[_0x1c71('0x1b')][_0x1c71('0xf')]({'data5':_0xf19e1c[_0x1c71('0x51')],'data6':_0xf19e1c[_0x1c71('0x53')]},{'where':{'id':_0xf19e1c['id']}});})[_0x1c71('0x10')](function(){oauth['startRefreshInterval'](_0xf19e1c);socket[_0x1c71('0x55')](_0x1c71('0x56'),{'id':_0x5a93e0['id']});return;})[_0x1c71('0x10')](respondWithStatusCode(_0x5766da,null))[_0x1c71('0x32')](function(_0x244a07){if(_0x5a93e0){socket[_0x1c71('0x55')](_0x1c71('0x57'),{'id':_0x5a93e0['id']});}if(!_0xf19e1c){logger[_0x1c71('0x13')](_0x1c71('0x58'),_0x244a07);return _0x5766da['status'](0x1f4)[_0x1c71('0x16')](_0x244a07[_0x1c71('0x59')]);}logger[_0x1c71('0x13')](_0x1c71('0x5a'),_0xf19e1c['id'],JSON[_0x1c71('0x5b')](_0x244a07));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index f80261b..dbc51e4 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 _0x275d=['../../config/environment','./cloudProvider.attributes','exports','CloudProvider','cloud_providers','api','moment','request-promise','path','rimraf'];(function(_0x375fa9,_0x2505fa){var _0x5c8f27=function(_0x655c3){while(--_0x655c3){_0x375fa9['push'](_0x375fa9['shift']());}};_0x5c8f27(++_0x2505fa);}(_0x275d,0x13b));var _0xd275=function(_0x16cb03,_0x43ea58){_0x16cb03=_0x16cb03-0x0;var _0x10944e=_0x275d[_0x16cb03];return _0x10944e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd275('0x0'));var moment=require(_0xd275('0x1'));var BPromise=require('bluebird');var rp=require(_0xd275('0x2'));var fs=require('fs');var path=require(_0xd275('0x3'));var rimraf=require(_0xd275('0x4'));var config=require(_0xd275('0x5'));var attributes=require(_0xd275('0x6'));module[_0xd275('0x7')]=function(_0x3c7716,_0x1b853e){return _0x3c7716['define'](_0xd275('0x8'),attributes,{'tableName':_0xd275('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc5e6=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','cloud_providers','lodash','util'];(function(_0x5b306b,_0x19f1d5){var _0x3ab72d=function(_0x385f58){while(--_0x385f58){_0x5b306b['push'](_0x5b306b['shift']());}};_0x3ab72d(++_0x19f1d5);}(_0xc5e6,0xbe));var _0x6c5e=function(_0x40df5f,_0x8fd59f){_0x40df5f=_0x40df5f-0x0;var _0x1573f1=_0xc5e6[_0x40df5f];return _0x1573f1;};'use strict';var _=require(_0x6c5e('0x0'));var util=require(_0x6c5e('0x1'));var logger=require(_0x6c5e('0x2'))('api');var moment=require(_0x6c5e('0x3'));var BPromise=require('bluebird');var rp=require(_0x6c5e('0x4'));var fs=require('fs');var path=require(_0x6c5e('0x5'));var rimraf=require(_0x6c5e('0x6'));var config=require(_0x6c5e('0x7'));var attributes=require(_0x6c5e('0x8'));module[_0x6c5e('0x9')]=function(_0x5849be,_0x173bcf){return _0x5849be[_0x6c5e('0xa')]('CloudProvider',attributes,{'tableName':_0x6c5e('0xb'),'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 111144a..fc23a16 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 _0x3bb4=['set','iss','issuer','aud','isAfter','unix','exp','then','data3','CloudProvider','refresh_token','decryptString','POST','access_token','data6','update','data5','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','findAll','all','catch','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','data7','/.default','join','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','{TENANT_ID}','data2','code','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','state','nonce','prompt','map','oauth2Claims','oauth2/'];(function(_0x5bd741,_0x481b9c){var _0xd3be3d=function(_0x4fc75c){while(--_0x4fc75c){_0x5bd741['push'](_0x5bd741['shift']());}};_0xd3be3d(++_0x481b9c);}(_0x3bb4,0x66));var _0x43bb=function(_0x2bc196,_0x53e04d){_0x2bc196=_0x2bc196-0x0;var _0x164869=_0x3bb4[_0x2bc196];return _0x164869;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require(_0x43bb('0x0'));var moment=require(_0x43bb('0x1'));var Redis=require('ioredis');var rp=require(_0x43bb('0x2'));var util=require(_0x43bb('0x3'));var encryptor=require(_0x43bb('0x4'));var config=require('../../config/environment');var logger=require(_0x43bb('0x5'))(_0x43bb('0x6'));var schedule=require(_0x43bb('0x7'));var db=require(_0x43bb('0x8'))['db'];config[_0x43bb('0x9')]=_[_0x43bb('0xa')](config['redis'],{'host':_0x43bb('0xb'),'port':0x18eb});var redis=new Redis(config[_0x43bb('0x9')]);var MICROSOFT_AUTH_URL=_0x43bb('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x43bb('0xd'),_0x43bb('0xe'),'email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All',_0x43bb('0xf'),_0x43bb('0x10')],'Dynamics365':[_0x43bb('0xd'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x43bb('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0x43bb('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4a6a5c){var _0x5f0a1d=_['map'](AZURE_AUTH_SCOPES[_0x4a6a5c[_0x43bb('0x13')]]);if(_0x4a6a5c[_0x43bb('0x13')]==='Dynamics365')_0x5f0a1d['push'](_0x4a6a5c[_0x43bb('0x14')]+_0x43bb('0x15'));return _0x5f0a1d[_0x43bb('0x16')]('\x20');}function getAccessTokenScope(_0x3bf477){if(_0x3bf477[_0x43bb('0x13')]==='Outlook365')return _0x43bb('0x17');if(_0x3bf477[_0x43bb('0x13')]==='Dynamics365')return _0x3bf477[_0x43bb('0x14')]+_0x43bb('0x15');}function generateMicrosoftAuthorizationUrl(_0x3b9c81,_0x1bb4bc){var _0x1a75c8=MICROSOFT_AUTH_URL[_0x43bb('0x18')](_0x43bb('0x19'),_0x3b9c81[_0x43bb('0x1a')]);var _0x4df53f=[_0x43bb('0x1b'),'id_token'];var _0x3196b1=Buffer['from'](JSON[_0x43bb('0x1c')]({'id':_0x1bb4bc}))[_0x43bb('0x1d')](_0x43bb('0x1e'));var _0x1293e6=crypto[_0x43bb('0x1f')](0x10)[_0x43bb('0x1d')](_0x43bb('0x20'));var _0xbb365c=getAuthorizationScopes(_0x3b9c81);var _0xd680e9=[{'key':_0x43bb('0x21'),'value':_0x3b9c81[_0x43bb('0x22')]},{'key':_0x43bb('0x23'),'value':encodeURIComponent(_0x4df53f[_0x43bb('0x16')]('\x20'))},{'key':_0x43bb('0x24'),'value':_0x3b9c81[_0x43bb('0x25')]},{'key':_0x43bb('0x26'),'value':_0x43bb('0x27')},{'key':'scope','value':encodeURIComponent(_0xbb365c)},{'key':_0x43bb('0x28'),'value':_0x3196b1},{'key':_0x43bb('0x29'),'value':_0x1293e6},{'key':_0x43bb('0x2a'),'value':'login'}];var _0x1448fd=_0x1a75c8+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x43bb('0x2b')](_0xd680e9,function(_0x3620f9){return _0x3620f9['key']+'='+_0x3620f9['value'];})[_0x43bb('0x16')]('&');_0x3b9c81[_0x43bb('0x2c')]={'issuer':_0x1a75c8[_0x43bb('0x18')](_0x43bb('0x2d'),''),'audience':_0x3b9c81[_0x43bb('0x22')],'state':_0x3196b1,'nonce':_0x1293e6};redis[_0x43bb('0x2e')](_0x3196b1,JSON[_0x43bb('0x1c')](_0x3b9c81));return _0x1448fd;}function isValidIdToken(_0x2ce71b,_0x33e99b){try{var _0x57b333=jwt['decode'](_0x2ce71b,{'complete':!![]});var _0x41a5d5=_0x57b333['payload'];if(_0x41a5d5[_0x43bb('0x2f')]!==_0x33e99b[_0x43bb('0x30')])return![];if(_0x41a5d5[_0x43bb('0x31')]!==_0x33e99b['audience'])return![];if(_0x41a5d5[_0x43bb('0x29')]!==_0x33e99b['nonce'])return![];if(moment()[_0x43bb('0x32')](moment[_0x43bb('0x33')](_0x41a5d5[_0x43bb('0x34')])))return![];return!![];}catch(_0x411405){throw _0x411405;}}function refreshOauth2MicrosoftAccessToken(_0x105dbd){return Promise['resolve']()[_0x43bb('0x35')](function(){if(_0x105dbd[_0x43bb('0x36')])return _0x105dbd;return db[_0x43bb('0x37')]['findOne']({'where':{'id':_0x105dbd['id']},'raw':!![]});})[_0x43bb('0x35')](function(_0x287ec6){var _0x742a3={'grant_type':_0x43bb('0x38'),'refresh_token':_0x287ec6['data6'],'scope':getAccessTokenScope(_0x287ec6),'redirect_uri':_0x287ec6[_0x43bb('0x25')],'client_id':_0x287ec6['data1'],'client_secret':encryptor[_0x43bb('0x39')](_0x287ec6['data3'])};var _0x2a1e6e={'method':_0x43bb('0x3a'),'uri':MICROSOFT_AUTH_URL['replace'](_0x43bb('0x19'),_0x287ec6['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x742a3,'json':!![]};return rp(_0x2a1e6e);})['then'](function(_0x1211c7){_0x105dbd['data5']=_0x1211c7[_0x43bb('0x3b')];_0x105dbd[_0x43bb('0x3c')]=_0x1211c7['refresh_token'];return db[_0x43bb('0x37')][_0x43bb('0x3d')]({'data5':_0x105dbd[_0x43bb('0x3e')],'data6':_0x105dbd[_0x43bb('0x3c')]},{'where':{'id':_0x105dbd['id']}});})[_0x43bb('0x35')](function(){return _0x105dbd;})['catch'](function(_0x36a91d){logger['error'](_0x43bb('0x3f'),_0x105dbd['id'],_0x36a91d);});}function getOauth2MicrosoftAccessToken(_0x36e4e4,_0x28c8c4){var _0x33b11f={'grant_type':_0x43bb('0x40'),'code':_0x36e4e4,'scope':getAccessTokenScope(_0x28c8c4),'redirect_uri':_0x28c8c4[_0x43bb('0x25')],'client_id':_0x28c8c4['data1'],'client_secret':encryptor[_0x43bb('0x39')](_0x28c8c4[_0x43bb('0x36')])};var _0x12a4f2={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x43bb('0x18')]('{TENANT_ID}',_0x28c8c4[_0x43bb('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x33b11f,'json':!![]};return rp(_0x12a4f2);}function startRefreshInterval(_0x15c53b){var _0x3f7fdb=schedule[_0x43bb('0x41')];if(_0x3f7fdb[_0x15c53b['id']])clearInterval(_0x3f7fdb[_0x15c53b['id']]);_0x3f7fdb[_0x15c53b['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x43bb('0x42')](this,{'id':_0x15c53b['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x43bb('0x41')]=_0x3f7fdb;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x43bb('0x43')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x43bb('0x35')](function(_0x42d490){var _0xe66612=_0x42d490[_0x43bb('0x2b')](function(_0x34e03c){return refreshOauth2MicrosoftAccessToken(_0x34e03c)[_0x43bb('0x35')](function(_0x40ffb2){startRefreshInterval(_0x40ffb2);});});return Promise[_0x43bb('0x44')](_0xe66612);})[_0x43bb('0x45')](function(_0x5e17ed){var _0x331103=_0x5e17ed?util[_0x43bb('0x46')](_0x5e17ed,{'showHidden':![],'depth':null}):'';logger[_0x43bb('0x47')](_0x43bb('0x48'),_0x331103);});}module[_0x43bb('0x49')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x5e8a=['isAfter','resolve','then','data3','CloudProvider','refresh_token','decryptString','{TENANT_ID}','access_token','data6','update','data5','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','bind','findAll','all','catch','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','https://outlook.office365.com/IMAP.AccessAsUser.All','offline_access','/authorize','map','type','data7','/.default','join','Dynamics365','replace','data2','code','toString','base64','hex','client_id','data1','response_type','data4','form_post','scope','state','nonce','prompt','login','key','value','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','aud','audience'];(function(_0x367f24,_0x3dc831){var _0x25fa11=function(_0x9f01b3){while(--_0x9f01b3){_0x367f24['push'](_0x367f24['shift']());}};_0x25fa11(++_0x3dc831);}(_0x5e8a,0x13e));var _0xa5e8=function(_0x1d290e,_0x54d916){_0x1d290e=_0x1d290e-0x0;var _0x37314b=_0x5e8a[_0x1d290e];return _0x37314b;};'use strict';var _=require(_0xa5e8('0x0'));var crypto=require(_0xa5e8('0x1'));var jwt=require(_0xa5e8('0x2'));var moment=require(_0xa5e8('0x3'));var Redis=require(_0xa5e8('0x4'));var rp=require(_0xa5e8('0x5'));var util=require(_0xa5e8('0x6'));var encryptor=require(_0xa5e8('0x7'));var config=require(_0xa5e8('0x8'));var logger=require('../../config/logger')(_0xa5e8('0x9'));var schedule=require(_0xa5e8('0xa'));var db=require('../../mysqldb')['db'];config[_0xa5e8('0xb')]=_[_0xa5e8('0xc')](config[_0xa5e8('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xa5e8('0xb')]);var MICROSOFT_AUTH_URL=_0xa5e8('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0xa5e8('0xe'),_0xa5e8('0xf'),'email','offline_access',_0xa5e8('0x10'),'https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xa5e8('0xe'),_0xa5e8('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0xa5e8('0x12');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x417327){var _0x31d926=_[_0xa5e8('0x13')](AZURE_AUTH_SCOPES[_0x417327[_0xa5e8('0x14')]]);if(_0x417327[_0xa5e8('0x14')]==='Dynamics365')_0x31d926['push'](_0x417327[_0xa5e8('0x15')]+_0xa5e8('0x16'));return _0x31d926[_0xa5e8('0x17')]('\x20');}function getAccessTokenScope(_0x149f59){if(_0x149f59[_0xa5e8('0x14')]==='Outlook365')return _0xa5e8('0x10');if(_0x149f59[_0xa5e8('0x14')]===_0xa5e8('0x18'))return _0x149f59[_0xa5e8('0x15')]+_0xa5e8('0x16');}function generateMicrosoftAuthorizationUrl(_0x50ecb3,_0x35f405){var _0x350d1a=MICROSOFT_AUTH_URL[_0xa5e8('0x19')]('{TENANT_ID}',_0x50ecb3[_0xa5e8('0x1a')]);var _0x5c1989=[_0xa5e8('0x1b'),'id_token'];var _0x4548da=Buffer['from'](JSON['stringify']({'id':_0x35f405}))[_0xa5e8('0x1c')](_0xa5e8('0x1d'));var _0x1160b1=crypto['randomBytes'](0x10)[_0xa5e8('0x1c')](_0xa5e8('0x1e'));var _0x365c1f=getAuthorizationScopes(_0x50ecb3);var _0x3df6bd=[{'key':_0xa5e8('0x1f'),'value':_0x50ecb3[_0xa5e8('0x20')]},{'key':_0xa5e8('0x21'),'value':encodeURIComponent(_0x5c1989[_0xa5e8('0x17')]('\x20'))},{'key':'redirect_uri','value':_0x50ecb3[_0xa5e8('0x22')]},{'key':'response_mode','value':_0xa5e8('0x23')},{'key':_0xa5e8('0x24'),'value':encodeURIComponent(_0x365c1f)},{'key':_0xa5e8('0x25'),'value':_0x4548da},{'key':_0xa5e8('0x26'),'value':_0x1160b1},{'key':_0xa5e8('0x27'),'value':_0xa5e8('0x28')}];var _0x4b9ce3=_0x350d1a+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xa5e8('0x13')](_0x3df6bd,function(_0x591765){return _0x591765[_0xa5e8('0x29')]+'='+_0x591765[_0xa5e8('0x2a')];})['join']('&');_0x50ecb3[_0xa5e8('0x2b')]={'issuer':_0x350d1a[_0xa5e8('0x19')](_0xa5e8('0x2c'),''),'audience':_0x50ecb3[_0xa5e8('0x20')],'state':_0x4548da,'nonce':_0x1160b1};redis[_0xa5e8('0x2d')](_0x4548da,JSON['stringify'](_0x50ecb3));return _0x4b9ce3;}function isValidIdToken(_0x325a74,_0x54d07c){try{var _0xfc1fd1=jwt[_0xa5e8('0x2e')](_0x325a74,{'complete':!![]});var _0x213386=_0xfc1fd1[_0xa5e8('0x2f')];if(_0x213386[_0xa5e8('0x30')]!==_0x54d07c[_0xa5e8('0x31')])return![];if(_0x213386[_0xa5e8('0x32')]!==_0x54d07c[_0xa5e8('0x33')])return![];if(_0x213386[_0xa5e8('0x26')]!==_0x54d07c[_0xa5e8('0x26')])return![];if(moment()[_0xa5e8('0x34')](moment['unix'](_0x213386['exp'])))return![];return!![];}catch(_0x4c26ca){throw _0x4c26ca;}}function refreshOauth2MicrosoftAccessToken(_0x4233c8){return Promise[_0xa5e8('0x35')]()[_0xa5e8('0x36')](function(){if(_0x4233c8[_0xa5e8('0x37')])return _0x4233c8;return db[_0xa5e8('0x38')]['findOne']({'where':{'id':_0x4233c8['id']},'raw':!![]});})['then'](function(_0xb7a6d6){var _0x11a6d7={'grant_type':_0xa5e8('0x39'),'refresh_token':_0xb7a6d6['data6'],'scope':getAccessTokenScope(_0xb7a6d6),'redirect_uri':_0xb7a6d6[_0xa5e8('0x22')],'client_id':_0xb7a6d6['data1'],'client_secret':encryptor[_0xa5e8('0x3a')](_0xb7a6d6[_0xa5e8('0x37')])};var _0x50b62c={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xa5e8('0x19')](_0xa5e8('0x3b'),_0xb7a6d6[_0xa5e8('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x11a6d7,'json':!![]};return rp(_0x50b62c);})[_0xa5e8('0x36')](function(_0x4e072f){_0x4233c8['data5']=_0x4e072f[_0xa5e8('0x3c')];_0x4233c8[_0xa5e8('0x3d')]=_0x4e072f[_0xa5e8('0x39')];return db[_0xa5e8('0x38')][_0xa5e8('0x3e')]({'data5':_0x4233c8[_0xa5e8('0x3f')],'data6':_0x4233c8[_0xa5e8('0x3d')]},{'where':{'id':_0x4233c8['id']}});})[_0xa5e8('0x36')](function(){return _0x4233c8;})['catch'](function(_0x7a9406){logger[_0xa5e8('0x40')](_0xa5e8('0x41'),_0x4233c8['id'],_0x7a9406);});}function getOauth2MicrosoftAccessToken(_0x205c0d,_0x35ff83){var _0x5c83b0={'grant_type':_0xa5e8('0x42'),'code':_0x205c0d,'scope':getAccessTokenScope(_0x35ff83),'redirect_uri':_0x35ff83[_0xa5e8('0x22')],'client_id':_0x35ff83['data1'],'client_secret':encryptor[_0xa5e8('0x3a')](_0x35ff83[_0xa5e8('0x37')])};var _0x111940={'method':_0xa5e8('0x43'),'uri':MICROSOFT_AUTH_URL['replace'](_0xa5e8('0x3b'),_0x35ff83[_0xa5e8('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5c83b0,'json':!![]};return rp(_0x111940);}function startRefreshInterval(_0x42c3e0){var _0x56ac3a=schedule[_0xa5e8('0x44')];if(_0x56ac3a[_0x42c3e0['id']])clearInterval(_0x56ac3a[_0x42c3e0['id']]);_0x56ac3a[_0x42c3e0['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xa5e8('0x45')](this,{'id':_0x42c3e0['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xa5e8('0x44')]=_0x56ac3a;}function startAllRefreshIntervals(){return db['CloudProvider'][_0xa5e8('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xa5e8('0x36')](function(_0x3879fc){var _0x452323=_0x3879fc[_0xa5e8('0x13')](function(_0x2b4fef){return refreshOauth2MicrosoftAccessToken(_0x2b4fef)[_0xa5e8('0x36')](function(_0x5352a6){startRefreshInterval(_0x5352a6);});});return Promise[_0xa5e8('0x47')](_0x452323);})[_0xa5e8('0x48')](function(_0x3e42ec){var _0x41f1fa=_0x3e42ec?util['inspect'](_0x3e42ec,{'showHidden':![],'depth':null}):'';logger[_0xa5e8('0x40')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x41f1fa);});}module[_0xa5e8('0x49')]={'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 b75f656..bc625d2 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 _0x4213=['CloudProvider,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x494ae9,_0x36971c){var _0x119e70=function(_0x3aafd7){while(--_0x3aafd7){_0x494ae9['push'](_0x494ae9['shift']());}};_0x119e70(++_0x36971c);}(_0x4213,0x77));var _0x3421=function(_0x25018f,_0x2f7d26){_0x25018f=_0x25018f-0x0;var _0x20e940=_0x4213[_0x25018f];return _0x20e940;};'use strict';var _=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var moment=require(_0x3421('0x2'));var BPromise=require(_0x3421('0x3'));var rs=require(_0x3421('0x4'));var fs=require('fs');var Redis=require(_0x3421('0x5'));var db=require(_0x3421('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3421('0x7'))('rpc');var config=require(_0x3421('0x8'));var jayson=require(_0x3421('0x9'));var client=jayson[_0x3421('0xa')][_0x3421('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5469d8,_0x50e464,_0x1b152f){return new BPromise(function(_0x130625,_0x1cf6a0){return client[_0x3421('0xc')](_0x5469d8,_0x1b152f)['then'](function(_0x1f20cf){logger['info']('CloudProvider,\x20%s,\x20%s',_0x50e464,_0x3421('0xd'));logger['debug'](_0x3421('0xe'),_0x50e464,_0x3421('0xd'),JSON[_0x3421('0xf')](_0x1f20cf));if(_0x1f20cf[_0x3421('0x10')]){if(_0x1f20cf[_0x3421('0x10')][_0x3421('0x11')]===0x1f4){logger[_0x3421('0x10')]('CloudProvider,\x20%s,\x20%s',_0x50e464,_0x1f20cf[_0x3421('0x10')][_0x3421('0x12')]);return _0x1cf6a0(_0x1f20cf[_0x3421('0x10')][_0x3421('0x12')]);}logger[_0x3421('0x10')](_0x3421('0x13'),_0x50e464,_0x1f20cf[_0x3421('0x10')]['message']);return _0x130625(_0x1f20cf[_0x3421('0x10')]['message']);}else{logger[_0x3421('0x14')](_0x3421('0x13'),_0x50e464,'request\x20sent');_0x130625(_0x1f20cf[_0x3421('0x15')]['message']);}})[_0x3421('0x16')](function(_0x23694b){logger['error'](_0x3421('0x13'),_0x50e464,_0x23694b);_0x1cf6a0(_0x23694b);});});} \ No newline at end of file +var _0x5464=['info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x184c37,_0x275925){var _0x5473a7=function(_0x532106){while(--_0x532106){_0x184c37['push'](_0x184c37['shift']());}};_0x5473a7(++_0x275925);}(_0x5464,0x15d));var _0x4546=function(_0x23427e,_0x43d445){_0x23427e=_0x23427e-0x0;var _0x46c8b=_0x5464[_0x23427e];return _0x46c8b;};'use strict';var _=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var moment=require(_0x4546('0x2'));var BPromise=require('bluebird');var rs=require(_0x4546('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4546('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4546('0x5'))(_0x4546('0x6'));var config=require(_0x4546('0x7'));var jayson=require(_0x4546('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c5e09,_0x224c7c,_0x36c875){return new BPromise(function(_0x1a76c1,_0x2e860a){return client[_0x4546('0x9')](_0x5c5e09,_0x36c875)[_0x4546('0xa')](function(_0x11d63e){logger[_0x4546('0xb')](_0x4546('0xc'),_0x224c7c,'request\x20sent');logger[_0x4546('0xd')](_0x4546('0xe'),_0x224c7c,_0x4546('0xf'),JSON['stringify'](_0x11d63e));if(_0x11d63e[_0x4546('0x10')]){if(_0x11d63e[_0x4546('0x10')][_0x4546('0x11')]===0x1f4){logger[_0x4546('0x10')]('CloudProvider,\x20%s,\x20%s',_0x224c7c,_0x11d63e['error'][_0x4546('0x12')]);return _0x2e860a(_0x11d63e['error']['message']);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x224c7c,_0x11d63e['error']['message']);return _0x1a76c1(_0x11d63e[_0x4546('0x10')]['message']);}else{logger[_0x4546('0xb')]('CloudProvider,\x20%s,\x20%s',_0x224c7c,_0x4546('0xf'));_0x1a76c1(_0x11d63e['result'][_0x4546('0x12')]);}})[_0x4546('0x13')](function(_0x24b32a){logger[_0x4546('0x10')](_0x4546('0xc'),_0x224c7c,_0x24b32a);_0x2e860a(_0x24b32a);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 724217a..8b52309 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 _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x2e61ea,_0x57f270){var _0x6c630=function(_0x434976){while(--_0x434976){_0x2e61ea['push'](_0x2e61ea['shift']());}};_0x6c630(++_0x57f270);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xc4aa[_0x255d5b];return _0x3e141a;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router; \ No newline at end of file +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(_0x3fa296,_0x2bd315){var _0x10b19f=function(_0x2c868d){while(--_0x2c868d){_0x3fa296['push'](_0x3fa296['shift']());}};_0x10b19f(++_0x2bd315);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4b98e0,_0x442fa3){_0x4b98e0=_0x4b98e0-0x0;var _0x1cf1f2=_0x5f2f[_0x4b98e0];return _0x1cf1f2;};'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 diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index da9538c..0190822 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 _0xd58c=['sequelize','exports','STRING','name'];(function(_0x653c4e,_0x17dc30){var _0x43e975=function(_0x21c37a){while(--_0x21c37a){_0x653c4e['push'](_0x653c4e['shift']());}};_0x43e975(++_0x17dc30);}(_0xd58c,0x70));var _0xcd58=function(_0x18ee78,_0x5d1bf2){_0x18ee78=_0x18ee78-0x0;var _0x581884=_0xd58c[_0x18ee78];return _0x581884;};'use strict';var Sequelize=require(_0xcd58('0x0'));module[_0xcd58('0x1')]={'name':{'type':Sequelize[_0xcd58('0x2')],'unique':_0xcd58('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xcd58('0x2')]},'companyId':{'type':Sequelize[_0xcd58('0x2')]},'website':{'type':Sequelize[_0xcd58('0x2')]},'phone':{'type':Sequelize[_0xcd58('0x2')]},'fax':{'type':Sequelize[_0xcd58('0x2')]},'type':{'type':Sequelize[_0xcd58('0x2')]},'street':{'type':Sequelize[_0xcd58('0x2')]},'postalCode':{'type':Sequelize[_0xcd58('0x2')]},'city':{'type':Sequelize[_0xcd58('0x2')]},'country':{'type':Sequelize[_0xcd58('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xcd58('0x2')]},'sPostalCode':{'type':Sequelize[_0xcd58('0x2')]},'sCity':{'type':Sequelize[_0xcd58('0x2')]},'sCountry':{'type':Sequelize[_0xcd58('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf879=['exports','STRING','sequelize'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0xf879,0x158));var _0x9f87=function(_0x199c16,_0x43f421){_0x199c16=_0x199c16-0x0;var _0x3a69de=_0xf879[_0x199c16];return _0x3a69de;};'use strict';var Sequelize=require(_0x9f87('0x0'));module[_0x9f87('0x1')]={'name':{'type':Sequelize[_0x9f87('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x9f87('0x2')]},'website':{'type':Sequelize[_0x9f87('0x2')]},'phone':{'type':Sequelize[_0x9f87('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9f87('0x2')]},'street':{'type':Sequelize[_0x9f87('0x2')]},'postalCode':{'type':Sequelize[_0x9f87('0x2')]},'city':{'type':Sequelize[_0x9f87('0x2')]},'country':{'type':Sequelize[_0x9f87('0x2')]},'email':{'type':Sequelize[_0x9f87('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x9f87('0x2')]},'sStreet':{'type':Sequelize[_0x9f87('0x2')]},'sPostalCode':{'type':Sequelize[_0x9f87('0x2')]},'sCity':{'type':Sequelize[_0x9f87('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index daabc6d..7400847 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 _0x5d7a=['map','filter','options','includeAll','include','show','params','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','addContacts','ids','getContacts','findOne','CmContact','rawAttributes','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','then','get','Companies','UserProfileResource','error','stack','name','index','CmCompany','describe','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge'];(function(_0x24c554,_0x1032c0){var _0x15f619=function(_0x7fdefa){while(--_0x7fdefa){_0x24c554['push'](_0x24c554['shift']());}};_0x15f619(++_0x1032c0);}(_0x5d7a,0x11c));var _0xa5d7=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5d7a[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xa5d7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa5d7('0x1'));var rp=require(_0xa5d7('0x2'));var moment=require(_0xa5d7('0x3'));var BPromise=require(_0xa5d7('0x4'));var Mustache=require(_0xa5d7('0x5'));var util=require(_0xa5d7('0x6'));var path=require(_0xa5d7('0x7'));var sox=require(_0xa5d7('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa5d7('0x9'));var _=require('lodash');var squel=require(_0xa5d7('0xa'));var crypto=require(_0xa5d7('0xb'));var jsforce=require(_0xa5d7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa5d7('0xd'));var querystring=require(_0xa5d7('0xe'));var Papa=require(_0xa5d7('0xf'));var Redis=require('ioredis');var authService=require(_0xa5d7('0x10'));var qs=require(_0xa5d7('0x11'));var as=require(_0xa5d7('0x12'));var hardwareService=require(_0xa5d7('0x13'));var logger=require(_0xa5d7('0x14'))(_0xa5d7('0x15'));var utils=require(_0xa5d7('0x16'));var config=require(_0xa5d7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa5d7('0x18'))['db'];function respondWithStatusCode(_0x2e23f8,_0xdd22fa){_0xdd22fa=_0xdd22fa||0xcc;return function(_0x366776){if(_0x366776){return _0x2e23f8[_0xa5d7('0x19')](_0xdd22fa);}return _0x2e23f8['status'](_0xdd22fa)[_0xa5d7('0x1a')]();};}function respondWithResult(_0x3caf1c,_0x5c80fa){_0x5c80fa=_0x5c80fa||0xc8;return function(_0x41e319){if(_0x41e319){return _0x3caf1c[_0xa5d7('0x1b')](_0x5c80fa)[_0xa5d7('0x1c')](_0x41e319);}};}function respondWithFilteredResult(_0x4d0adb,_0x3e2a27){return function(_0x352a12){if(_0x352a12){var _0x255e50=typeof _0x3e2a27[_0xa5d7('0x1d')]==='undefined'&&typeof _0x3e2a27['limit']===_0xa5d7('0x1e');var _0x220ed8=_0x352a12[_0xa5d7('0x1f')];var _0x165057=_0x255e50?0x0:_0x3e2a27[_0xa5d7('0x1d')];var _0x42bc51=_0x255e50?_0x352a12[_0xa5d7('0x1f')]:_0x3e2a27[_0xa5d7('0x1d')]+_0x3e2a27[_0xa5d7('0x20')];var _0x3160b4;if(_0x42bc51>=_0x220ed8){_0x42bc51=_0x220ed8;_0x3160b4=0xc8;}else{_0x3160b4=0xce;}_0x4d0adb['status'](_0x3160b4);return _0x4d0adb[_0xa5d7('0x21')](_0xa5d7('0x22'),_0x165057+'-'+_0x42bc51+'/'+_0x220ed8)[_0xa5d7('0x1c')](_0x352a12);}return null;};}function patchUpdates(_0x314317){return function(_0x2c2d33){try{jsonpatch[_0xa5d7('0x23')](_0x2c2d33,_0x314317,!![]);}catch(_0x43b208){return BPromise['reject'](_0x43b208);}return _0x2c2d33[_0xa5d7('0x24')]();};}function saveUpdates(_0x49fb87,_0x5438d5){return function(_0x53563d){if(_0x53563d){return _0x53563d[_0xa5d7('0x25')](_0x49fb87)['then'](function(_0x5d6eb3){return _0x5d6eb3;});}return null;};}function removeEntity(_0x2513dd,_0x5a7d19){return function(_0x53e2f4){if(_0x53e2f4){return _0x53e2f4[_0xa5d7('0x26')]()[_0xa5d7('0x27')](function(){var _0x537c9c=_0x53e2f4[_0xa5d7('0x28')]({'plain':!![]});var _0x32e982=_0xa5d7('0x29');return db[_0xa5d7('0x2a')][_0xa5d7('0x26')]({'where':{'type':_0x32e982,'resourceId':_0x537c9c['id']}})[_0xa5d7('0x27')](function(){return _0x53e2f4;});})[_0xa5d7('0x27')](function(){_0x2513dd[_0xa5d7('0x1b')](0xcc)[_0xa5d7('0x1a')]();});}};}function handleEntityNotFound(_0x1fb045,_0x90a2dd){return function(_0x419259){if(!_0x419259){_0x1fb045['sendStatus'](0x194);}return _0x419259;};}function handleError(_0x4c518d,_0x2c163b){_0x2c163b=_0x2c163b||0x1f4;return function(_0x21bc75){logger[_0xa5d7('0x2b')](_0x21bc75[_0xa5d7('0x2c')]);if(_0x21bc75[_0xa5d7('0x2d')]){delete _0x21bc75[_0xa5d7('0x2d')];}_0x4c518d[_0xa5d7('0x1b')](_0x2c163b)['send'](_0x21bc75);};}exports[_0xa5d7('0x2e')]=function(_0x59eac2,_0xd6813){var _0x4de64c={},_0x3d1028={},_0x38eca1={'count':0x0,'rows':[]};return db[_0xa5d7('0x2f')][_0xa5d7('0x30')]()['then'](function(_0x60e58b){_0x3d1028[_0xa5d7('0x31')]=_[_0xa5d7('0x32')](_0x60e58b);_0x3d1028['query']=_['keys'](_0x59eac2[_0xa5d7('0x33')]);_0x3d1028['filters']=_['intersection'](_0x3d1028['model'],_0x3d1028['query']);_0x4de64c[_0xa5d7('0x34')]=_[_0xa5d7('0x35')](_0x3d1028[_0xa5d7('0x31')],qs[_0xa5d7('0x36')](_0x59eac2['query'][_0xa5d7('0x36')]));_0x4de64c[_0xa5d7('0x34')]=_0x4de64c[_0xa5d7('0x34')][_0xa5d7('0x37')]?_0x4de64c[_0xa5d7('0x34')]:_0x3d1028['model'];if(!_0x59eac2['query'][_0xa5d7('0x38')](_0xa5d7('0x39'))){_0x4de64c[_0xa5d7('0x20')]=qs[_0xa5d7('0x20')](_0x59eac2['query']['limit']);_0x4de64c[_0xa5d7('0x1d')]=qs[_0xa5d7('0x1d')](_0x59eac2[_0xa5d7('0x33')]['offset']);}_0x4de64c[_0xa5d7('0x3a')]=qs[_0xa5d7('0x3b')](_0x59eac2[_0xa5d7('0x33')]['sort']);_0x4de64c[_0xa5d7('0x3c')]=qs[_0xa5d7('0x3d')](_[_0xa5d7('0x3e')](_0x59eac2[_0xa5d7('0x33')],_0x3d1028[_0xa5d7('0x3d')]),_0x60e58b);if(_0x59eac2[_0xa5d7('0x33')]['filter']){_0x4de64c['where']=_[_0xa5d7('0x3f')](_0x4de64c['where'],{'$or':_[_0xa5d7('0x40')](_0x4de64c[_0xa5d7('0x34')],function(_0x136772){var _0x20f8d1={};_0x20f8d1[_0x136772]={'$like':'%'+_0x59eac2[_0xa5d7('0x33')][_0xa5d7('0x41')]+'%'};return _0x20f8d1;})});}_0x4de64c=_[_0xa5d7('0x3f')]({},_0x4de64c,_0x59eac2[_0xa5d7('0x42')]);var _0x39c59c={'where':_0x4de64c[_0xa5d7('0x3c')]};return db[_0xa5d7('0x2f')]['count'](_0x39c59c)[_0xa5d7('0x27')](function(_0x5b58a4){_0x38eca1[_0xa5d7('0x1f')]=_0x5b58a4;if(_0x59eac2[_0xa5d7('0x33')][_0xa5d7('0x43')]){_0x4de64c[_0xa5d7('0x44')]=[{'all':!![]}];}return db[_0xa5d7('0x2f')]['findAll'](_0x4de64c);})[_0xa5d7('0x27')](function(_0x262b3a){_0x38eca1['rows']=_0x262b3a;return _0x38eca1;})[_0xa5d7('0x27')](respondWithFilteredResult(_0xd6813,_0x4de64c))['catch'](handleError(_0xd6813,null));})['catch'](handleError(_0xd6813,null));};exports[_0xa5d7('0x45')]=function(_0x33d941,_0x577aa9){var _0x2f2ec1={'raw':![],'where':{'id':_0x33d941[_0xa5d7('0x46')]['id']}},_0x476a21={};_0x476a21[_0xa5d7('0x31')]=_['keys'](db[_0xa5d7('0x2f')]['rawAttributes']);_0x476a21[_0xa5d7('0x33')]=_[_0xa5d7('0x32')](_0x33d941[_0xa5d7('0x33')]);_0x476a21[_0xa5d7('0x3d')]=_[_0xa5d7('0x35')](_0x476a21['model'],_0x476a21[_0xa5d7('0x33')]);_0x2f2ec1['attributes']=_[_0xa5d7('0x35')](_0x476a21['model'],qs['fields'](_0x33d941[_0xa5d7('0x33')]['fields']));_0x2f2ec1[_0xa5d7('0x34')]=_0x2f2ec1[_0xa5d7('0x34')][_0xa5d7('0x37')]?_0x2f2ec1[_0xa5d7('0x34')]:_0x476a21['model'];if(_0x33d941[_0xa5d7('0x33')][_0xa5d7('0x43')]){_0x2f2ec1[_0xa5d7('0x44')]=[{'all':!![]}];}_0x2f2ec1=_[_0xa5d7('0x3f')]({},_0x2f2ec1,_0x33d941['options']);return db[_0xa5d7('0x2f')][_0xa5d7('0x47')](_0x2f2ec1)[_0xa5d7('0x27')](handleEntityNotFound(_0x577aa9,null))[_0xa5d7('0x27')](respondWithResult(_0x577aa9,null))[_0xa5d7('0x48')](handleError(_0x577aa9,null));};exports[_0xa5d7('0x49')]=function(_0x1655c3,_0x736ce2){return db[_0xa5d7('0x2f')][_0xa5d7('0x49')](_0x1655c3[_0xa5d7('0x4a')],{})[_0xa5d7('0x27')](function(_0x26f07a){var _0x4d7715=_0x1655c3['user']['get']({'plain':!![]});if(!_0x4d7715)throw new Error(_0xa5d7('0x4b'));if(_0x4d7715[_0xa5d7('0x4c')]===_0xa5d7('0x4d')){var _0x80b0e9=_0x26f07a[_0xa5d7('0x28')]({'plain':!![]});var _0x1c6c7e=_0xa5d7('0x29');return db[_0xa5d7('0x4e')][_0xa5d7('0x47')]({'where':{'name':_0x1c6c7e,'userProfileId':_0x4d7715[_0xa5d7('0x4f')]},'raw':!![]})[_0xa5d7('0x27')](function(_0x4cc714){if(_0x4cc714&&_0x4cc714[_0xa5d7('0x50')]===0x0){return db['UserProfileResource'][_0xa5d7('0x49')]({'name':_0x80b0e9[_0xa5d7('0x2d')],'resourceId':_0x80b0e9['id'],'type':_0x4cc714[_0xa5d7('0x2d')],'sectionId':_0x4cc714['id']},{})['then'](function(){return _0x26f07a;});}else{return _0x26f07a;}})[_0xa5d7('0x48')](function(_0x559ec0){logger[_0xa5d7('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x559ec0);throw _0x559ec0;});}return _0x26f07a;})['then'](respondWithResult(_0x736ce2,0xc9))[_0xa5d7('0x48')](handleError(_0x736ce2,null));};exports[_0xa5d7('0x25')]=function(_0x52a141,_0x2c667d){if(_0x52a141[_0xa5d7('0x4a')]['id']){delete _0x52a141[_0xa5d7('0x4a')]['id'];}return db[_0xa5d7('0x2f')][_0xa5d7('0x47')]({'where':{'id':_0x52a141[_0xa5d7('0x46')]['id']}})[_0xa5d7('0x27')](handleEntityNotFound(_0x2c667d,null))[_0xa5d7('0x27')](saveUpdates(_0x52a141['body'],null))[_0xa5d7('0x27')](respondWithResult(_0x2c667d,null))[_0xa5d7('0x48')](handleError(_0x2c667d,null));};exports['destroy']=function(_0x11f090,_0x304ded){return db[_0xa5d7('0x2f')]['find']({'where':{'id':_0x11f090[_0xa5d7('0x46')]['id']}})[_0xa5d7('0x27')](handleEntityNotFound(_0x304ded,null))[_0xa5d7('0x27')](removeEntity(_0x304ded,null))['catch'](handleError(_0x304ded,null));};exports[_0xa5d7('0x30')]=function(_0x59904c,_0x38aa43){return db[_0xa5d7('0x2f')][_0xa5d7('0x30')]()[_0xa5d7('0x27')](respondWithResult(_0x38aa43,null))[_0xa5d7('0x48')](handleError(_0x38aa43,null));};exports[_0xa5d7('0x51')]=function(_0xc22959,_0x23c138,_0x56c3ff){return db['CmContact'][_0xa5d7('0x47')]({'where':{'id':_0xc22959[_0xa5d7('0x46')]['id']}})[_0xa5d7('0x27')](handleEntityNotFound(_0x23c138,null))[_0xa5d7('0x27')](function(_0x32328f){if(_0x32328f){return _0x32328f[_0xa5d7('0x51')](_0xc22959[_0xa5d7('0x4a')][_0xa5d7('0x52')],_['omit'](_0xc22959[_0xa5d7('0x4a')],[_0xa5d7('0x52'),'id'])||{});}})['then'](respondWithResult(_0x23c138,null))[_0xa5d7('0x48')](handleError(_0x23c138,null));};exports[_0xa5d7('0x53')]=function(_0x2a7a3d,_0x100af1,_0x2b6962){var _0xe12fe4={};var _0x1e4291={};var _0x3e76e2;var _0x53a42c;return db[_0xa5d7('0x2f')][_0xa5d7('0x54')]({'where':{'id':_0x2a7a3d[_0xa5d7('0x46')]['id']}})[_0xa5d7('0x27')](handleEntityNotFound(_0x100af1,null))[_0xa5d7('0x27')](function(_0x1f7d5c){if(_0x1f7d5c){_0x3e76e2=_0x1f7d5c;_0x1e4291['model']=_[_0xa5d7('0x32')](db[_0xa5d7('0x55')][_0xa5d7('0x56')]);_0x1e4291['query']=_[_0xa5d7('0x32')](_0x2a7a3d[_0xa5d7('0x33')]);_0x1e4291[_0xa5d7('0x3d')]=_[_0xa5d7('0x35')](_0x1e4291['model'],_0x1e4291['query']);_0xe12fe4['attributes']=_[_0xa5d7('0x35')](_0x1e4291[_0xa5d7('0x31')],qs['fields'](_0x2a7a3d[_0xa5d7('0x33')]['fields']));_0xe12fe4[_0xa5d7('0x34')]=_0xe12fe4[_0xa5d7('0x34')][_0xa5d7('0x37')]?_0xe12fe4[_0xa5d7('0x34')]:_0x1e4291[_0xa5d7('0x31')];_0xe12fe4[_0xa5d7('0x3a')]=qs[_0xa5d7('0x3b')](_0x2a7a3d[_0xa5d7('0x33')][_0xa5d7('0x3b')]);_0xe12fe4['where']=qs['filters'](_['pick'](_0x2a7a3d[_0xa5d7('0x33')],_0x1e4291['filters']));if(_0x2a7a3d['query']['filter']){_0xe12fe4[_0xa5d7('0x3c')]=_[_0xa5d7('0x3f')](_0xe12fe4[_0xa5d7('0x3c')],{'$or':_['map'](_0xe12fe4['attributes'],function(_0x397ee2){var _0x1cc7e2={};_0x1cc7e2[_0x397ee2]={'$like':'%'+_0x2a7a3d['query'][_0xa5d7('0x41')]+'%'};return _0x1cc7e2;})});}_0xe12fe4=_[_0xa5d7('0x3f')]({},_0xe12fe4,_0x2a7a3d['options']);return _0x3e76e2[_0xa5d7('0x53')](_0xe12fe4);}})[_0xa5d7('0x27')](function(_0x243b31){if(_0x243b31){_0x53a42c=_0x243b31[_0xa5d7('0x37')];if(!_0x2a7a3d[_0xa5d7('0x33')][_0xa5d7('0x38')]('nolimit')){_0xe12fe4[_0xa5d7('0x20')]=qs['limit'](_0x2a7a3d['query'][_0xa5d7('0x20')]);_0xe12fe4[_0xa5d7('0x1d')]=qs[_0xa5d7('0x1d')](_0x2a7a3d[_0xa5d7('0x33')]['offset']);}return _0x3e76e2[_0xa5d7('0x53')](_0xe12fe4);}})['then'](function(_0x4898b2){if(_0x4898b2){return _0x4898b2?{'count':_0x53a42c,'rows':_0x4898b2}:null;}})[_0xa5d7('0x27')](respondWithResult(_0x100af1,null))[_0xa5d7('0x48')](handleError(_0x100af1,null));}; \ No newline at end of file +var _0x5a46=['count','Content-Range','apply','save','update','then','destroy','get','Companies','UserProfileResource','error','name','send','index','CmCompany','describe','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','filter','options','includeAll','rows','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','addContacts','CmContact','ids','omit','getContacts','findOne','rawAttributes','pick','map','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','sendStatus','status','end','json','offset','limit','undefined'];(function(_0x2c4996,_0x118be3){var _0x2152c0=function(_0x30b4f9){while(--_0x30b4f9){_0x2c4996['push'](_0x2c4996['shift']());}};_0x2152c0(++_0x118be3);}(_0x5a46,0x86));var _0x65a4=function(_0x365a95,_0x5ae25c){_0x365a95=_0x365a95-0x0;var _0x24bf15=_0x5a46[_0x365a95];return _0x24bf15;};'use strict';var emlformat=require(_0x65a4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x65a4('0x1'));var jsonpatch=require(_0x65a4('0x2'));var rp=require(_0x65a4('0x3'));var moment=require(_0x65a4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x65a4('0x5'));var util=require(_0x65a4('0x6'));var path=require(_0x65a4('0x7'));var sox=require(_0x65a4('0x8'));var csv=require('to-csv');var ejs=require(_0x65a4('0x9'));var fs=require('fs');var fs_extra=require(_0x65a4('0xa'));var _=require(_0x65a4('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x65a4('0xc'));var deskjs=require(_0x65a4('0xd'));var toCsv=require(_0x65a4('0xe'));var querystring=require('querystring');var Papa=require(_0x65a4('0xf'));var Redis=require('ioredis');var authService=require(_0x65a4('0x10'));var qs=require(_0x65a4('0x11'));var as=require(_0x65a4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x65a4('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x65a4('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4baac3,_0x3d8ae1){_0x3d8ae1=_0x3d8ae1||0xcc;return function(_0x252270){if(_0x252270){return _0x4baac3[_0x65a4('0x15')](_0x3d8ae1);}return _0x4baac3[_0x65a4('0x16')](_0x3d8ae1)[_0x65a4('0x17')]();};}function respondWithResult(_0x12810c,_0x53d5bd){_0x53d5bd=_0x53d5bd||0xc8;return function(_0x333204){if(_0x333204){return _0x12810c[_0x65a4('0x16')](_0x53d5bd)[_0x65a4('0x18')](_0x333204);}};}function respondWithFilteredResult(_0x163e3b,_0x1b8f64){return function(_0x1432b0){if(_0x1432b0){var _0x53152a=typeof _0x1b8f64[_0x65a4('0x19')]==='undefined'&&typeof _0x1b8f64[_0x65a4('0x1a')]===_0x65a4('0x1b');var _0x31f624=_0x1432b0[_0x65a4('0x1c')];var _0x362084=_0x53152a?0x0:_0x1b8f64[_0x65a4('0x19')];var _0x128c49=_0x53152a?_0x1432b0[_0x65a4('0x1c')]:_0x1b8f64[_0x65a4('0x19')]+_0x1b8f64['limit'];var _0x15f206;if(_0x128c49>=_0x31f624){_0x128c49=_0x31f624;_0x15f206=0xc8;}else{_0x15f206=0xce;}_0x163e3b['status'](_0x15f206);return _0x163e3b['set'](_0x65a4('0x1d'),_0x362084+'-'+_0x128c49+'/'+_0x31f624)[_0x65a4('0x18')](_0x1432b0);}return null;};}function patchUpdates(_0x2e6647){return function(_0xea5e3d){try{jsonpatch[_0x65a4('0x1e')](_0xea5e3d,_0x2e6647,!![]);}catch(_0x42a47b){return BPromise['reject'](_0x42a47b);}return _0xea5e3d[_0x65a4('0x1f')]();};}function saveUpdates(_0x39e82b,_0x47d908){return function(_0x32c59b){if(_0x32c59b){return _0x32c59b[_0x65a4('0x20')](_0x39e82b)[_0x65a4('0x21')](function(_0xb1bf62){return _0xb1bf62;});}return null;};}function removeEntity(_0x16cd6c,_0x35fe23){return function(_0x616017){if(_0x616017){return _0x616017[_0x65a4('0x22')]()[_0x65a4('0x21')](function(){var _0x4374b8=_0x616017[_0x65a4('0x23')]({'plain':!![]});var _0x18e421=_0x65a4('0x24');return db[_0x65a4('0x25')][_0x65a4('0x22')]({'where':{'type':_0x18e421,'resourceId':_0x4374b8['id']}})[_0x65a4('0x21')](function(){return _0x616017;});})[_0x65a4('0x21')](function(){_0x16cd6c[_0x65a4('0x16')](0xcc)[_0x65a4('0x17')]();});}};}function handleEntityNotFound(_0x2a8b8f,_0x97632d){return function(_0x269121){if(!_0x269121){_0x2a8b8f[_0x65a4('0x15')](0x194);}return _0x269121;};}function handleError(_0x114252,_0x4e4b7b){_0x4e4b7b=_0x4e4b7b||0x1f4;return function(_0x3adc1a){logger[_0x65a4('0x26')](_0x3adc1a['stack']);if(_0x3adc1a['name']){delete _0x3adc1a[_0x65a4('0x27')];}_0x114252[_0x65a4('0x16')](_0x4e4b7b)[_0x65a4('0x28')](_0x3adc1a);};}exports[_0x65a4('0x29')]=function(_0x13ed75,_0x1ce309){var _0x273505={},_0x4dcb6d={},_0x241daa={'count':0x0,'rows':[]};return db[_0x65a4('0x2a')][_0x65a4('0x2b')]()[_0x65a4('0x21')](function(_0x5a7e72){_0x4dcb6d[_0x65a4('0x2c')]=_['keys'](_0x5a7e72);_0x4dcb6d[_0x65a4('0x2d')]=_[_0x65a4('0x2e')](_0x13ed75['query']);_0x4dcb6d[_0x65a4('0x2f')]=_[_0x65a4('0x30')](_0x4dcb6d[_0x65a4('0x2c')],_0x4dcb6d[_0x65a4('0x2d')]);_0x273505[_0x65a4('0x31')]=_['intersection'](_0x4dcb6d[_0x65a4('0x2c')],qs[_0x65a4('0x32')](_0x13ed75[_0x65a4('0x2d')][_0x65a4('0x32')]));_0x273505[_0x65a4('0x31')]=_0x273505['attributes'][_0x65a4('0x33')]?_0x273505['attributes']:_0x4dcb6d['model'];if(!_0x13ed75['query'][_0x65a4('0x34')](_0x65a4('0x35'))){_0x273505[_0x65a4('0x1a')]=qs[_0x65a4('0x1a')](_0x13ed75[_0x65a4('0x2d')][_0x65a4('0x1a')]);_0x273505[_0x65a4('0x19')]=qs['offset'](_0x13ed75[_0x65a4('0x2d')][_0x65a4('0x19')]);}_0x273505['order']=qs[_0x65a4('0x36')](_0x13ed75['query'][_0x65a4('0x36')]);_0x273505[_0x65a4('0x37')]=qs[_0x65a4('0x2f')](_['pick'](_0x13ed75[_0x65a4('0x2d')],_0x4dcb6d[_0x65a4('0x2f')]),_0x5a7e72);if(_0x13ed75['query']['filter']){_0x273505[_0x65a4('0x37')]=_[_0x65a4('0x38')](_0x273505[_0x65a4('0x37')],{'$or':_['map'](_0x273505[_0x65a4('0x31')],function(_0x471272){var _0x509a3a={};_0x509a3a[_0x471272]={'$like':'%'+_0x13ed75[_0x65a4('0x2d')][_0x65a4('0x39')]+'%'};return _0x509a3a;})});}_0x273505=_[_0x65a4('0x38')]({},_0x273505,_0x13ed75[_0x65a4('0x3a')]);var _0x4b1bba={'where':_0x273505[_0x65a4('0x37')]};return db[_0x65a4('0x2a')][_0x65a4('0x1c')](_0x4b1bba)[_0x65a4('0x21')](function(_0x1eed94){_0x241daa['count']=_0x1eed94;if(_0x13ed75['query'][_0x65a4('0x3b')]){_0x273505['include']=[{'all':!![]}];}return db[_0x65a4('0x2a')]['findAll'](_0x273505);})[_0x65a4('0x21')](function(_0x463e58){_0x241daa[_0x65a4('0x3c')]=_0x463e58;return _0x241daa;})['then'](respondWithFilteredResult(_0x1ce309,_0x273505))[_0x65a4('0x3d')](handleError(_0x1ce309,null));})[_0x65a4('0x3d')](handleError(_0x1ce309,null));};exports[_0x65a4('0x3e')]=function(_0x4d1e52,_0x9d9971){var _0x11fac={'raw':![],'where':{'id':_0x4d1e52[_0x65a4('0x3f')]['id']}},_0x234da0={};_0x234da0[_0x65a4('0x2c')]=_[_0x65a4('0x2e')](db[_0x65a4('0x2a')]['rawAttributes']);_0x234da0[_0x65a4('0x2d')]=_[_0x65a4('0x2e')](_0x4d1e52[_0x65a4('0x2d')]);_0x234da0[_0x65a4('0x2f')]=_['intersection'](_0x234da0[_0x65a4('0x2c')],_0x234da0['query']);_0x11fac[_0x65a4('0x31')]=_[_0x65a4('0x30')](_0x234da0[_0x65a4('0x2c')],qs['fields'](_0x4d1e52[_0x65a4('0x2d')]['fields']));_0x11fac[_0x65a4('0x31')]=_0x11fac['attributes'][_0x65a4('0x33')]?_0x11fac[_0x65a4('0x31')]:_0x234da0[_0x65a4('0x2c')];if(_0x4d1e52[_0x65a4('0x2d')]['includeAll']){_0x11fac['include']=[{'all':!![]}];}_0x11fac=_[_0x65a4('0x38')]({},_0x11fac,_0x4d1e52[_0x65a4('0x3a')]);return db[_0x65a4('0x2a')]['find'](_0x11fac)[_0x65a4('0x21')](handleEntityNotFound(_0x9d9971,null))[_0x65a4('0x21')](respondWithResult(_0x9d9971,null))[_0x65a4('0x3d')](handleError(_0x9d9971,null));};exports[_0x65a4('0x40')]=function(_0x3409a2,_0x25f438){return db[_0x65a4('0x2a')][_0x65a4('0x40')](_0x3409a2[_0x65a4('0x41')],{})['then'](function(_0x1e56ab){var _0x2b75bc=_0x3409a2['user'][_0x65a4('0x23')]({'plain':!![]});if(!_0x2b75bc)throw new Error(_0x65a4('0x42'));if(_0x2b75bc[_0x65a4('0x43')]==='user'){var _0x1baff1=_0x1e56ab[_0x65a4('0x23')]({'plain':!![]});var _0x1b1380=_0x65a4('0x24');return db[_0x65a4('0x44')]['find']({'where':{'name':_0x1b1380,'userProfileId':_0x2b75bc['userProfileId']},'raw':!![]})['then'](function(_0x44aee9){if(_0x44aee9&&_0x44aee9[_0x65a4('0x45')]===0x0){return db['UserProfileResource'][_0x65a4('0x40')]({'name':_0x1baff1['name'],'resourceId':_0x1baff1['id'],'type':_0x44aee9['name'],'sectionId':_0x44aee9['id']},{})[_0x65a4('0x21')](function(){return _0x1e56ab;});}else{return _0x1e56ab;}})['catch'](function(_0x1091fe){logger['error'](_0x65a4('0x46'),_0x1091fe);throw _0x1091fe;});}return _0x1e56ab;})[_0x65a4('0x21')](respondWithResult(_0x25f438,0xc9))[_0x65a4('0x3d')](handleError(_0x25f438,null));};exports[_0x65a4('0x20')]=function(_0x2dc864,_0x2d9317){if(_0x2dc864[_0x65a4('0x41')]['id']){delete _0x2dc864[_0x65a4('0x41')]['id'];}return db[_0x65a4('0x2a')][_0x65a4('0x47')]({'where':{'id':_0x2dc864[_0x65a4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2d9317,null))[_0x65a4('0x21')](saveUpdates(_0x2dc864[_0x65a4('0x41')],null))[_0x65a4('0x21')](respondWithResult(_0x2d9317,null))[_0x65a4('0x3d')](handleError(_0x2d9317,null));};exports['destroy']=function(_0x221c89,_0x48bcd1){return db[_0x65a4('0x2a')][_0x65a4('0x47')]({'where':{'id':_0x221c89[_0x65a4('0x3f')]['id']}})[_0x65a4('0x21')](handleEntityNotFound(_0x48bcd1,null))[_0x65a4('0x21')](removeEntity(_0x48bcd1,null))[_0x65a4('0x3d')](handleError(_0x48bcd1,null));};exports[_0x65a4('0x2b')]=function(_0x3df4be,_0x2550bb){return db[_0x65a4('0x2a')]['describe']()[_0x65a4('0x21')](respondWithResult(_0x2550bb,null))[_0x65a4('0x3d')](handleError(_0x2550bb,null));};exports[_0x65a4('0x48')]=function(_0x3878ba,_0x1dc29f,_0x1d3adc){return db[_0x65a4('0x49')][_0x65a4('0x47')]({'where':{'id':_0x3878ba['params']['id']}})[_0x65a4('0x21')](handleEntityNotFound(_0x1dc29f,null))['then'](function(_0x10e978){if(_0x10e978){return _0x10e978['addContacts'](_0x3878ba['body'][_0x65a4('0x4a')],_[_0x65a4('0x4b')](_0x3878ba['body'],[_0x65a4('0x4a'),'id'])||{});}})[_0x65a4('0x21')](respondWithResult(_0x1dc29f,null))['catch'](handleError(_0x1dc29f,null));};exports[_0x65a4('0x4c')]=function(_0x13cab7,_0x259077,_0x109e4f){var _0x1f3cd6={};var _0x50d4c6={};var _0x1a38df;var _0x2c6b8d;return db[_0x65a4('0x2a')][_0x65a4('0x4d')]({'where':{'id':_0x13cab7[_0x65a4('0x3f')]['id']}})[_0x65a4('0x21')](handleEntityNotFound(_0x259077,null))[_0x65a4('0x21')](function(_0x477463){if(_0x477463){_0x1a38df=_0x477463;_0x50d4c6[_0x65a4('0x2c')]=_[_0x65a4('0x2e')](db[_0x65a4('0x49')][_0x65a4('0x4e')]);_0x50d4c6[_0x65a4('0x2d')]=_[_0x65a4('0x2e')](_0x13cab7[_0x65a4('0x2d')]);_0x50d4c6['filters']=_['intersection'](_0x50d4c6[_0x65a4('0x2c')],_0x50d4c6[_0x65a4('0x2d')]);_0x1f3cd6[_0x65a4('0x31')]=_[_0x65a4('0x30')](_0x50d4c6['model'],qs[_0x65a4('0x32')](_0x13cab7['query']['fields']));_0x1f3cd6[_0x65a4('0x31')]=_0x1f3cd6['attributes']['length']?_0x1f3cd6[_0x65a4('0x31')]:_0x50d4c6[_0x65a4('0x2c')];_0x1f3cd6['order']=qs[_0x65a4('0x36')](_0x13cab7[_0x65a4('0x2d')]['sort']);_0x1f3cd6['where']=qs[_0x65a4('0x2f')](_[_0x65a4('0x4f')](_0x13cab7[_0x65a4('0x2d')],_0x50d4c6[_0x65a4('0x2f')]));if(_0x13cab7[_0x65a4('0x2d')][_0x65a4('0x39')]){_0x1f3cd6[_0x65a4('0x37')]=_[_0x65a4('0x38')](_0x1f3cd6[_0x65a4('0x37')],{'$or':_[_0x65a4('0x50')](_0x1f3cd6[_0x65a4('0x31')],function(_0x38de54){var _0xc98299={};_0xc98299[_0x38de54]={'$like':'%'+_0x13cab7['query'][_0x65a4('0x39')]+'%'};return _0xc98299;})});}_0x1f3cd6=_[_0x65a4('0x38')]({},_0x1f3cd6,_0x13cab7['options']);return _0x1a38df[_0x65a4('0x4c')](_0x1f3cd6);}})[_0x65a4('0x21')](function(_0x4f0ddb){if(_0x4f0ddb){_0x2c6b8d=_0x4f0ddb[_0x65a4('0x33')];if(!_0x13cab7['query'][_0x65a4('0x34')](_0x65a4('0x35'))){_0x1f3cd6['limit']=qs[_0x65a4('0x1a')](_0x13cab7[_0x65a4('0x2d')][_0x65a4('0x1a')]);_0x1f3cd6[_0x65a4('0x19')]=qs[_0x65a4('0x19')](_0x13cab7['query']['offset']);}return _0x1a38df[_0x65a4('0x4c')](_0x1f3cd6);}})[_0x65a4('0x21')](function(_0x4b7fa7){if(_0x4b7fa7){return _0x4b7fa7?{'count':_0x2c6b8d,'rows':_0x4b7fa7}:null;}})['then'](respondWithResult(_0x259077,null))[_0x65a4('0x3d')](handleError(_0x259077,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index d5d3099..015cac5 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 _0x722f=['moment','bluebird','path','../../config/environment','./cmCompany.attributes','define','cm_companies','util','../../config/logger'];(function(_0x496d91,_0x5371f6){var _0x1e5f62=function(_0x83ab9b){while(--_0x83ab9b){_0x496d91['push'](_0x496d91['shift']());}};_0x1e5f62(++_0x5371f6);}(_0x722f,0x1ed));var _0xf722=function(_0x19baab,_0x3b2716){_0x19baab=_0x19baab-0x0;var _0x317bf6=_0x722f[_0x19baab];return _0x317bf6;};'use strict';var _=require('lodash');var util=require(_0xf722('0x0'));var logger=require(_0xf722('0x1'))('api');var moment=require(_0xf722('0x2'));var BPromise=require(_0xf722('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf722('0x4'));var rimraf=require('rimraf');var config=require(_0xf722('0x5'));var attributes=require(_0xf722('0x6'));module['exports']=function(_0x7188e4,_0x40127d){return _0x7188e4[_0xf722('0x7')]('CmCompany',attributes,{'tableName':_0xf722('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7301=['bluebird','request-promise','path','rimraf','./cmCompany.attributes','exports','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment'];(function(_0x434783,_0xff395d){var _0x13efcf=function(_0x235dac){while(--_0x235dac){_0x434783['push'](_0x434783['shift']());}};_0x13efcf(++_0xff395d);}(_0x7301,0xbe));var _0x1730=function(_0x103495,_0x2b18ce){_0x103495=_0x103495-0x0;var _0x4fc9c1=_0x7301[_0x103495];return _0x4fc9c1;};'use strict';var _=require(_0x1730('0x0'));var util=require(_0x1730('0x1'));var logger=require(_0x1730('0x2'))(_0x1730('0x3'));var moment=require(_0x1730('0x4'));var BPromise=require(_0x1730('0x5'));var rp=require(_0x1730('0x6'));var fs=require('fs');var path=require(_0x1730('0x7'));var rimraf=require(_0x1730('0x8'));var config=require('../../config/environment');var attributes=require(_0x1730('0x9'));module[_0x1730('0xa')]=function(_0xe4f2ce,_0x2527e8){return _0xe4f2ce['define'](_0x1730('0xb'),attributes,{'tableName':_0x1730('0xc'),'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 bc1f1fe..1625445 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 _0xcc8d=['stringify','error','code','message','CmCompany,\x20%s,\x20%s','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug'];(function(_0x43eb54,_0x35e944){var _0x3892ac=function(_0xbc2e6b){while(--_0xbc2e6b){_0x43eb54['push'](_0x43eb54['shift']());}};_0x3892ac(++_0x35e944);}(_0xcc8d,0x1a8));var _0xdcc8=function(_0x43e885,_0x5700f1){_0x43e885=_0x43e885-0x0;var _0x18df65=_0xcc8d[_0x43e885];return _0x18df65;};'use strict';var _=require(_0xdcc8('0x0'));var util=require(_0xdcc8('0x1'));var moment=require(_0xdcc8('0x2'));var BPromise=require('bluebird');var rs=require(_0xdcc8('0x3'));var fs=require('fs');var Redis=require(_0xdcc8('0x4'));var db=require(_0xdcc8('0x5'))['db'];var utils=require(_0xdcc8('0x6'));var logger=require(_0xdcc8('0x7'))(_0xdcc8('0x8'));var config=require('../../config/environment');var jayson=require(_0xdcc8('0x9'));var client=jayson[_0xdcc8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27caea,_0x20b619,_0x467e2d){return new BPromise(function(_0x5149f5,_0x12f180){return client[_0xdcc8('0xb')](_0x27caea,_0x467e2d)[_0xdcc8('0xc')](function(_0x472e5d){logger[_0xdcc8('0xd')]('CmCompany,\x20%s,\x20%s',_0x20b619,_0xdcc8('0xe'));logger[_0xdcc8('0xf')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x20b619,_0xdcc8('0xe'),JSON[_0xdcc8('0x10')](_0x472e5d));if(_0x472e5d[_0xdcc8('0x11')]){if(_0x472e5d[_0xdcc8('0x11')][_0xdcc8('0x12')]===0x1f4){logger[_0xdcc8('0x11')]('CmCompany,\x20%s,\x20%s',_0x20b619,_0x472e5d[_0xdcc8('0x11')][_0xdcc8('0x13')]);return _0x12f180(_0x472e5d[_0xdcc8('0x11')][_0xdcc8('0x13')]);}logger['error'](_0xdcc8('0x14'),_0x20b619,_0x472e5d['error'][_0xdcc8('0x13')]);return _0x5149f5(_0x472e5d[_0xdcc8('0x11')][_0xdcc8('0x13')]);}else{logger[_0xdcc8('0xd')]('CmCompany,\x20%s,\x20%s',_0x20b619,_0xdcc8('0xe'));_0x5149f5(_0x472e5d[_0xdcc8('0x15')][_0xdcc8('0x13')]);}})['catch'](function(_0x29ac81){logger[_0xdcc8('0x11')](_0xdcc8('0x14'),_0x20b619,_0x29ac81);_0x12f180(_0x29ac81);});});} \ No newline at end of file +var _0xf0ce=['message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','CmCompany,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x25b022,_0x394a08){var _0x2e13a5=function(_0xe9495d){while(--_0xe9495d){_0x25b022['push'](_0x25b022['shift']());}};_0x2e13a5(++_0x394a08);}(_0xf0ce,0xde));var _0xef0c=function(_0xb44ced,_0x369a5c){_0xb44ced=_0xb44ced-0x0;var _0x4c14af=_0xf0ce[_0xb44ced];return _0x4c14af;};'use strict';var _=require(_0xef0c('0x0'));var util=require(_0xef0c('0x1'));var moment=require('moment');var BPromise=require(_0xef0c('0x2'));var rs=require(_0xef0c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef0c('0x4'))['db'];var utils=require(_0xef0c('0x5'));var logger=require(_0xef0c('0x6'))('rpc');var config=require(_0xef0c('0x7'));var jayson=require(_0xef0c('0x8'));var client=jayson[_0xef0c('0x9')][_0xef0c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e4819,_0x10a419,_0x143bea){return new BPromise(function(_0x228c40,_0x41bac5){return client['request'](_0x5e4819,_0x143bea)[_0xef0c('0xb')](function(_0x1976d8){logger[_0xef0c('0xc')](_0xef0c('0xd'),_0x10a419,'request\x20sent');logger[_0xef0c('0xe')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x10a419,_0xef0c('0xf'),JSON[_0xef0c('0x10')](_0x1976d8));if(_0x1976d8[_0xef0c('0x11')]){if(_0x1976d8[_0xef0c('0x11')]['code']===0x1f4){logger[_0xef0c('0x11')](_0xef0c('0xd'),_0x10a419,_0x1976d8[_0xef0c('0x11')][_0xef0c('0x12')]);return _0x41bac5(_0x1976d8['error'][_0xef0c('0x12')]);}logger['error'](_0xef0c('0xd'),_0x10a419,_0x1976d8[_0xef0c('0x11')]['message']);return _0x228c40(_0x1976d8[_0xef0c('0x11')][_0xef0c('0x12')]);}else{logger[_0xef0c('0xc')]('CmCompany,\x20%s,\x20%s',_0x10a419,'request\x20sent');_0x228c40(_0x1976d8[_0xef0c('0x13')][_0xef0c('0x12')]);}})['catch'](function(_0x15b698){logger[_0xef0c('0x11')](_0xef0c('0xd'),_0x10a419,_0x15b698);_0x41bac5(_0x15b698);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index fd94c6b..8c2e0d6 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 _0x48c5=['describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','isAuthenticated','get'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x48c5,0x14e));var _0x548c=function(_0x509318,_0xf0d257){_0x509318=_0x509318-0x0;var _0x39289a=_0x48c5[_0x509318];return _0x39289a;};'use strict';var multer=require('multer');var util=require(_0x548c('0x0'));var path=require(_0x548c('0x1'));var timeout=require(_0x548c('0x2'));var express=require(_0x548c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x548c('0x4'));var config=require(_0x548c('0x5'));var controller=require('./cmCompany.controller');router['get']('/',auth[_0x548c('0x6')](),controller['index']);router[_0x548c('0x7')]('/describe',auth[_0x548c('0x6')](),controller[_0x548c('0x8')]);router[_0x548c('0x7')](_0x548c('0x9'),auth[_0x548c('0x6')](),controller[_0x548c('0xa')]);router[_0x548c('0x7')](_0x548c('0xb'),auth[_0x548c('0x6')](),controller[_0x548c('0xc')]);router[_0x548c('0xd')]('/',auth[_0x548c('0x6')](),controller[_0x548c('0xe')]);router[_0x548c('0xd')]('/:id/contacts',auth[_0x548c('0x6')](),controller[_0x548c('0xf')]);router[_0x548c('0x10')](_0x548c('0x9'),auth[_0x548c('0x6')](),controller[_0x548c('0x11')]);router[_0x548c('0x12')](_0x548c('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x906b=['./cmCompany.controller','index','get','/describe','isAuthenticated','describe','/:id/contacts','getContacts','post','create','addContacts','put','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x906b,0x1ef));var _0xb906=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x906b[_0x11c573];return _0x6b72de;};'use strict';var multer=require(_0xb906('0x0'));var util=require(_0xb906('0x1'));var path=require(_0xb906('0x2'));var timeout=require(_0xb906('0x3'));var express=require(_0xb906('0x4'));var router=express[_0xb906('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb906('0x6'));var interaction=require(_0xb906('0x7'));var config=require(_0xb906('0x8'));var controller=require(_0xb906('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xb906('0xa')]);router[_0xb906('0xb')](_0xb906('0xc'),auth[_0xb906('0xd')](),controller[_0xb906('0xe')]);router['get']('/:id',auth[_0xb906('0xd')](),controller['show']);router['get'](_0xb906('0xf'),auth[_0xb906('0xd')](),controller[_0xb906('0x10')]);router[_0xb906('0x11')]('/',auth['isAuthenticated'](),controller[_0xb906('0x12')]);router[_0xb906('0x11')](_0xb906('0xf'),auth[_0xb906('0xd')](),controller[_0xb906('0x13')]);router[_0xb906('0x14')](_0xb906('0x15'),auth[_0xb906('0xd')](),controller['update']);router['delete'](_0xb906('0x15'),auth[_0xb906('0xd')](),controller[_0xb906('0x16')]);module[_0xb906('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index bb58ad7..bfd36fb 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 _0xfbae=['sequelize','exports','STRING','INTEGER','UNSIGNED','DATE','NOW','lodash'];(function(_0x2ca9d4,_0x51d5c6){var _0x258956=function(_0x47a0e5){while(--_0x47a0e5){_0x2ca9d4['push'](_0x2ca9d4['shift']());}};_0x258956(++_0x51d5c6);}(_0xfbae,0x1b7));var _0xefba=function(_0x52256e,_0xdb5686){_0x52256e=_0x52256e-0x0;var _0x1c951c=_0xfbae[_0x52256e];return _0x1c951c;};'use strict';var _=require(_0xefba('0x0'));var Sequelize=require(_0xefba('0x1'));module[_0xefba('0x2')]={'firstName':{'type':Sequelize[_0xefba('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xefba('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xefba('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xefba('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xefba('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xefba('0x3')]},'url':{'type':Sequelize[_0xefba('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xefba('0x3')]},'skype':{'type':Sequelize[_0xefba('0x3')]},'teams':{'type':Sequelize[_0xefba('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xefba('0x3')]},'wechat':{'type':Sequelize[_0xefba('0x3')]},'telegram':{'type':Sequelize[_0xefba('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xefba('0x3')]},'priority':{'type':Sequelize[_0xefba('0x4')](0x2)[_0xefba('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xefba('0x6')],'defaultValue':Sequelize[_0xefba('0x7')]},'dialTimezone':{'type':Sequelize[_0xefba('0x3')]},'utcOffset':{'type':Sequelize[_0xefba('0x4')]}}; \ No newline at end of file +var _0x891a=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize'];(function(_0x3a3e88,_0x4801a0){var _0x1f4fc8=function(_0x1536a4){while(--_0x1536a4){_0x3a3e88['push'](_0x3a3e88['shift']());}};_0x1f4fc8(++_0x4801a0);}(_0x891a,0x178));var _0xa891=function(_0x115cdd,_0x1db606){_0x115cdd=_0x115cdd-0x0;var _0x3bd6d5=_0x891a[_0x115cdd];return _0x3bd6d5;};'use strict';var _=require(_0xa891('0x0'));var Sequelize=require(_0xa891('0x1'));module[_0xa891('0x2')]={'firstName':{'type':Sequelize[_0xa891('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xa891('0x3')]},'street':{'type':Sequelize[_0xa891('0x3')]},'postalCode':{'type':Sequelize[_0xa891('0x3')]},'city':{'type':Sequelize[_0xa891('0x3')]},'country':{'type':Sequelize[_0xa891('0x3')]},'dateOfBirth':{'type':Sequelize[_0xa891('0x3')]},'description':{'type':Sequelize[_0xa891('0x4')]},'phone':{'type':Sequelize[_0xa891('0x3')]},'mobile':{'type':Sequelize[_0xa891('0x3')]},'fax':{'type':Sequelize[_0xa891('0x3')]},'email':{'type':Sequelize[_0xa891('0x3')]},'url':{'type':Sequelize[_0xa891('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xa891('0x3')]},'twitter':{'type':Sequelize[_0xa891('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xa891('0x3')]},'viber':{'type':Sequelize[_0xa891('0x3')]},'line':{'type':Sequelize[_0xa891('0x3')]},'wechat':{'type':Sequelize[_0xa891('0x3')]},'telegram':{'type':Sequelize[_0xa891('0x3')]},'UserId':{'type':Sequelize[_0xa891('0x5')]},'AdditionalPhones':{'type':Sequelize[_0xa891('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xa891('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa891('0x7')],'defaultValue':Sequelize[_0xa891('0x8')]},'dialTimezone':{'type':Sequelize[_0xa891('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 5ce1e7b..bb3e52b 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 _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x4bb581,_0x6f7037){var _0x316bf5=function(_0x1f6ed0){while(--_0x1f6ed0){_0x4bb581['push'](_0x4bb581['shift']());}};_0x316bf5(++_0x6f7037);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];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 respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file +var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];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 respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 359620d..7b2bc48 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 _0x1686=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','CmContact','save'];(function(_0x115a89,_0x24c57d){var _0x5945d9=function(_0x3c4916){while(--_0x3c4916){_0x115a89['push'](_0x115a89['shift']());}};_0x5945d9(++_0x24c57d);}(_0x1686,0xc5));var _0x6168=function(_0x190c0d,_0xa56b65){_0x190c0d=_0x190c0d-0x0;var _0x3e350f=_0x1686[_0x190c0d];return _0x3e350f;};'use strict';var EventEmitter=require('events');var CmContact=require(_0x6168('0x0'))['db'][_0x6168('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6168('0x2'),'afterUpdate':_0x6168('0x3'),'afterDestroy':_0x6168('0x4')};function emitEvent(_0x4a5773){return function(_0x227e14,_0x74413,_0x10b396){CmContactEvents[_0x6168('0x5')](_0x4a5773+':'+_0x227e14['id'],_0x227e14);CmContactEvents[_0x6168('0x5')](_0x4a5773,_0x227e14);_0x10b396(null);};}for(var e in events){if(events[_0x6168('0x6')](e)){var event=events[e];CmContact[_0x6168('0x7')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file +var _0x1db0=['emit','exports','events','../../mysqldb','CmContact','update','remove'];(function(_0x2145ae,_0x20a3d4){var _0x49aa0d=function(_0x1220e5){while(--_0x1220e5){_0x2145ae['push'](_0x2145ae['shift']());}};_0x49aa0d(++_0x20a3d4);}(_0x1db0,0x198));var _0x01db=function(_0x2166a3,_0x237c50){_0x2166a3=_0x2166a3-0x0;var _0x260035=_0x1db0[_0x2166a3];return _0x260035;};'use strict';var EventEmitter=require(_0x01db('0x0'));var CmContact=require(_0x01db('0x1'))['db'][_0x01db('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x01db('0x3'),'afterDestroy':_0x01db('0x4')};function emitEvent(_0x2424eb){return function(_0x41daec,_0x32b45f,_0x14407a){CmContactEvents[_0x01db('0x5')](_0x2424eb+':'+_0x41daec['id'],_0x41daec);CmContactEvents['emit'](_0x2424eb,_0x41daec);_0x14407a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x01db('0x6')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index f0d273e..31ca9f7 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 _0x240d=['push','all','info','[CmContact][afterDestroy][Error]','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','fax','FULLTEXT','utf8mb4_unicode_ci','models','get','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','findOne','timezones','utcOffset','add','then','ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','priority','callbackUniqueid','catch','\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','ListId','error','Campaign','minutes','\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','VoiceQueue','findAll','outbound','CmList','length','dialCheckDuplicateType','always','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','Lists','List\x20not\x20found','destroy','ContactId','VoiceQueueId','CampaignId'];(function(_0x5b48b0,_0x51077f){var _0x54eed0=function(_0x292227){while(--_0x292227){_0x5b48b0['push'](_0x5b48b0['shift']());}};_0x54eed0(++_0x51077f);}(_0x240d,0x98));var _0xd240=function(_0x2ff7b1,_0x56e78e){_0x2ff7b1=_0x2ff7b1-0x0;var _0x48936b=_0x240d[_0x2ff7b1];return _0x48936b;};'use strict';var _=require('lodash');var util=require(_0xd240('0x0'));var logger=require(_0xd240('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd240('0x2'));var rp=require(_0xd240('0x3'));var fs=require('fs');var path=require(_0xd240('0x4'));var rimraf=require(_0xd240('0x5'));var config=require(_0xd240('0x6'));var shared=require(_0xd240('0x7'));var attributes=require(_0xd240('0x8'));module[_0xd240('0x9')]=function(_0x149718,_0x4338b8){return _0x149718[_0xd240('0xa')](_0xd240('0xb'),attributes,{'tableName':_0xd240('0xc'),'paranoid':!![],'indexes':[{'name':_0xd240('0xd'),'fields':[_0xd240('0xd')]},{'name':_0xd240('0xe'),'fields':[_0xd240('0xf'),'lastName',_0xd240('0xd'),'mobile',_0xd240('0x10'),'email'],'type':_0xd240('0x11')}],'timestamps':!![],'charset':'utf8mb4','collate':_0xd240('0x12'),'hooks':{'afterCreate':function(_0x591a10,_0x1d8934,_0x3ea1e8){var _0x148fd1=_0x149718[_0xd240('0x13')];var _0x45a8ee=_0x591a10[_0xd240('0x14')]({'plain':!![]});function _0x5cf762(){return function(_0x3bb635){logger['error'](_0xd240('0x15'),_0xd240('0x16'),util[_0xd240('0x17')](_0x3bb635,{'showHidden':![],'depth':null}));};}function _0x79c3a1(_0x37bbce,_0x3d0175){var _0x50bc1e=_0x3d0175[_0xd240('0x18')]?_0x3d0175[_0xd240('0x18')]:moment()[_0xd240('0x19')](_0xd240('0x1a'));return new BPromise(function(_0x32f272,_0x13ff36){if(_[_0xd240('0x1b')](_0x3d0175[_0xd240('0x1c')])){_0x32f272({'ret':_0x50bc1e});}else{_0x148fd1['VoiceQueue'][_0xd240('0x1d')]({'where':{'id':_0x37bbce['id']}})['then'](function(_0x370a3a){if(!_[_0xd240('0x1b')](_0x370a3a)){var _0x302201=_0x370a3a[_0xd240('0x1c')];if(!_[_0xd240('0x1b')](_0x302201)){var _0x230eec=shared[_0xd240('0x1e')];var _0x594e29=_0x230eec[_0x302201];var _0x2d2d80=_0x230eec[_0x3d0175['dialTimezone']];if(!_['isNil'](_0x594e29)&&!_[_0xd240('0x1b')](_0x2d2d80)){var _0x40921f=_0x594e29[_0xd240('0x1f')]-_0x2d2d80[_0xd240('0x1f')];_0x50bc1e=_0x3d0175[_0xd240('0x18')]?_0x3d0175['scheduledat']:moment();var _0xbe327e=moment(_0x50bc1e)[_0xd240('0x20')](_0x40921f,'minutes');_0x32f272({'ret':_0xbe327e[_0xd240('0x19')](_0xd240('0x1a'))});}else _0x32f272({'ret':_0x50bc1e});}else _0x32f272({'ret':_0x50bc1e});}else{_0x32f272({'ret':_0x50bc1e});}});}});return 0xa;}var _0x267cdb=function(_0x4784c6){return new BPromise(function(_0x4eb3a3,_0x44f953){_0x79c3a1(_0x4784c6,_0x45a8ee)[_0xd240('0x21')](function(_0x1ece25){_0x45a8ee[_0xd240('0x18')]=_0x1ece25[_0xd240('0x22')];_0x148fd1[_0xd240('0x23')][_0xd240('0x1d')]({'where':{'phone':_0x45a8ee['phone'],'VoiceQueueId':_0x4784c6['id']}})[_0xd240('0x21')](function(_0x43e874){if(!_[_0xd240('0x1b')](_0x43e874)){throw new Error(_0xd240('0x24')+_0x45a8ee[_0xd240('0xd')]+_0xd240('0x25')+_0x4784c6['id']);}return _0x148fd1[_0xd240('0x23')][_0xd240('0x26')]({'phone':_0x45a8ee[_0xd240('0xd')],'ContactId':_0x45a8ee['id'],'ListId':_0x45a8ee['ListId'],'priority':_0x45a8ee[_0xd240('0x27')]?_0x45a8ee[_0xd240('0x27')]:0x2,'scheduledat':_0x45a8ee[_0xd240('0x18')]?_0x45a8ee[_0xd240('0x18')]:moment()[_0xd240('0x19')](_0xd240('0x1a')),'callback':_0x45a8ee[_0xd240('0x28')]?!![]:![],'callbackuniqueid':_0x45a8ee[_0xd240('0x28')]?_0x45a8ee[_0xd240('0x28')]:undefined,'callbackat':_0x45a8ee[_0xd240('0x28')]?moment()[_0xd240('0x19')](_0xd240('0x1a')):undefined,'VoiceQueueId':_0x4784c6['id']});})[_0xd240('0x29')](function(_0x76598c){_0x44f953(_0x76598c);});});});};var _0x3b816c=function(_0x1d405b){return new BPromise(function(_0x179d25,_0x585698){_0x79c3a1(_0x1d405b,_0x45a8ee)[_0xd240('0x21')](function(_0xd3a87d){_0x45a8ee[_0xd240('0x18')]=_0xd3a87d[_0xd240('0x22')];_0x148fd1['CmHopper'][_0xd240('0x1d')]({'where':{'phone':_0x45a8ee[_0xd240('0xd')],'VoiceQueueId':_0x1d405b['id']}})[_0xd240('0x21')](function(_0x3d5df2){if(!_['isNil'](_0x3d5df2)){throw new Error(_0xd240('0x24')+_0x45a8ee[_0xd240('0xd')]+_0xd240('0x2a')+_0x1d405b['id']);}return _0x148fd1[_0xd240('0x2b')]['findOne']({'where':{'calleridnum':_0x45a8ee[_0xd240('0xd')],'VoiceQueueId':_0x1d405b['id']}});})['then'](function(_0x358742){if(!_[_0xd240('0x1b')](_0x358742)){throw new Error(_0xd240('0x2c')+_0x45a8ee[_0xd240('0xd')]+_0xd240('0x2d')+_0x1d405b['id']);}return _0x148fd1[_0xd240('0x23')][_0xd240('0x26')]({'phone':_0x45a8ee['phone'],'ContactId':_0x45a8ee['id'],'ListId':_0x45a8ee[_0xd240('0x2e')],'priority':_0x45a8ee[_0xd240('0x27')]?_0x45a8ee['priority']:0x2,'scheduledat':_0x45a8ee[_0xd240('0x18')]?_0x45a8ee[_0xd240('0x18')]:moment()[_0xd240('0x19')](_0xd240('0x1a')),'callback':_0x45a8ee['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x45a8ee[_0xd240('0x28')]?_0x45a8ee[_0xd240('0x28')]:undefined,'callbackat':_0x45a8ee[_0xd240('0x28')]?moment()[_0xd240('0x19')](_0xd240('0x1a')):undefined,'VoiceQueueId':_0x1d405b['id']});})[_0xd240('0x29')](function(_0x20f9b8){_0x585698(_0x20f9b8);});});});};function _0x5a85ad(){return function(_0x4011b5){logger[_0xd240('0x2f')](_0xd240('0x15'),'afterCreate',util[_0xd240('0x17')](_0x4011b5,{'showHidden':![],'depth':null}));};}function _0x1ba8ce(_0x4ddf7c,_0x190849){var _0x1777bb=_0x190849[_0xd240('0x18')]?_0x190849['scheduledat']:moment()[_0xd240('0x19')](_0xd240('0x1a'));return new BPromise(function(_0x1ff4ee,_0x3b460b){if(_[_0xd240('0x1b')](_0x190849['dialTimezone'])){_0x1ff4ee({'ret':_0x1777bb});}else{_0x148fd1[_0xd240('0x30')][_0xd240('0x1d')]({'where':{'id':_0x4ddf7c['id']}})['then'](function(_0x2aaf88){if(!_[_0xd240('0x1b')](_0x2aaf88)){var _0x383a2f=_0x2aaf88[_0xd240('0x1c')];if(!_[_0xd240('0x1b')](_0x383a2f)){var _0x3bd106=shared[_0xd240('0x1e')];var _0x62805c=_0x3bd106[_0x383a2f];var _0x4aaf3f=_0x3bd106[_0x190849[_0xd240('0x1c')]];if(!_['isNil'](_0x62805c)&&!_[_0xd240('0x1b')](_0x4aaf3f)){var _0x272100=_0x62805c[_0xd240('0x1f')]-_0x4aaf3f[_0xd240('0x1f')];_0x1777bb=_0x190849[_0xd240('0x18')]?_0x190849[_0xd240('0x18')]:moment();var _0x132755=moment(_0x1777bb)[_0xd240('0x20')](_0x272100,_0xd240('0x31'));_0x1ff4ee({'ret':_0x132755[_0xd240('0x19')](_0xd240('0x1a'))});}else _0x1ff4ee({'ret':_0x1777bb});}else _0x1ff4ee({'ret':_0x1777bb});}else{_0x1ff4ee({'ret':_0x1777bb});}});}});return 0xa;}var _0x2e1cdf=function(_0x39e88b){return new BPromise(function(_0x584e70,_0x3d3d0a){_0x1ba8ce(_0x39e88b,_0x45a8ee)[_0xd240('0x21')](function(_0x2fd27a){_0x45a8ee[_0xd240('0x18')]=_0x2fd27a['ret'];_0x148fd1['CmHopper'][_0xd240('0x1d')]({'where':{'phone':_0x45a8ee[_0xd240('0xd')],'CampaignId':_0x39e88b['id']}})['then'](function(_0x599102){if(!_[_0xd240('0x1b')](_0x599102)){throw new Error(_0xd240('0x24')+_0x45a8ee[_0xd240('0xd')]+_0xd240('0x32')+_0x39e88b['id']);}return _0x148fd1[_0xd240('0x23')][_0xd240('0x26')]({'phone':_0x45a8ee['phone'],'ContactId':_0x45a8ee['id'],'ListId':_0x45a8ee[_0xd240('0x2e')],'priority':_0x45a8ee[_0xd240('0x27')]?_0x45a8ee[_0xd240('0x27')]:0x2,'scheduledat':_0x45a8ee[_0xd240('0x18')]?_0x45a8ee[_0xd240('0x18')]:moment()[_0xd240('0x19')](_0xd240('0x1a')),'callback':_0x45a8ee[_0xd240('0x28')]?!![]:![],'callbackuniqueid':_0x45a8ee[_0xd240('0x28')]?_0x45a8ee['callbackUniqueid']:undefined,'callbackat':_0x45a8ee['callbackUniqueid']?moment()[_0xd240('0x19')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x39e88b['id']});})[_0xd240('0x29')](function(_0x2448ac){_0x3d3d0a(_0x2448ac);});});});};var _0x4f4eaf=function(_0x26dd90){return new BPromise(function(_0x141222,_0x210c6c){_0x1ba8ce(_0x26dd90,_0x45a8ee)[_0xd240('0x21')](function(_0x12c060){_0x45a8ee['scheduledat']=_0x12c060[_0xd240('0x22')];_0x148fd1[_0xd240('0x23')][_0xd240('0x1d')]({'where':{'phone':_0x45a8ee['phone'],'CampaignId':_0x26dd90['id']}})['then'](function(_0x92b9d0){if(!_[_0xd240('0x1b')](_0x92b9d0)){throw new Error(_0xd240('0x24')+_0x45a8ee[_0xd240('0xd')]+_0xd240('0x33')+_0x26dd90['id']);}return _0x148fd1[_0xd240('0x2b')]['findOne']({'where':{'calleridnum':_0x45a8ee[_0xd240('0xd')],'CampaignId':_0x26dd90['id']}});})['then'](function(_0x553efd){if(!_[_0xd240('0x1b')](_0x553efd)){throw new Error(_0xd240('0x2c')+_0x45a8ee[_0xd240('0xd')]+_0xd240('0x34')+_0x26dd90['id']);}return _0x148fd1[_0xd240('0x23')]['create']({'phone':_0x45a8ee[_0xd240('0xd')],'ContactId':_0x45a8ee['id'],'ListId':_0x45a8ee[_0xd240('0x2e')],'priority':_0x45a8ee[_0xd240('0x27')]?_0x45a8ee[_0xd240('0x27')]:0x2,'scheduledat':_0x45a8ee[_0xd240('0x18')]?_0x45a8ee[_0xd240('0x18')]:moment()[_0xd240('0x19')](_0xd240('0x1a')),'callback':_0x45a8ee['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x45a8ee[_0xd240('0x28')]?_0x45a8ee[_0xd240('0x28')]:undefined,'callbackat':_0x45a8ee[_0xd240('0x28')]?moment()['format'](_0xd240('0x1a')):undefined,'CampaignId':_0x26dd90['id']});})[_0xd240('0x29')](function(_0x132c87){_0x210c6c(_0x132c87);});});});};if(_0x45a8ee[_0xd240('0x2e')]){_0x148fd1[_0xd240('0x35')][_0xd240('0x36')]({'where':{'type':_0xd240('0x37')},'attributes':['id','dialCheckDuplicateType','dialTimezone'],'include':[{'model':_0x148fd1[_0xd240('0x38')],'as':'Lists','where':{'id':_0x45a8ee['ListId']}}]})[_0xd240('0x21')](function(_0x4d309e){if(_0x4d309e){var _0x6195f9=[];for(var _0x18c92d=0x0,_0x4ca863;_0x18c92d<_0x4d309e[_0xd240('0x39')];_0x18c92d+=0x1){_0x4ca863=_0x4d309e[_0x18c92d][_0xd240('0x14')]({'plain':!![]});switch(_0x4ca863[_0xd240('0x3a')]){case _0xd240('0x3b'):_0x3b816c(_0x4ca863)['catch'](_0x5cf762());break;case'onlyIfOpen':_0x267cdb(_0x4ca863)[_0xd240('0x29')](_0x5cf762());break;default:_0x1ba8ce(_0x4ca863,_0x45a8ee)[_0xd240('0x21')](function(_0x14649f){_0x45a8ee[_0xd240('0x18')]=_0x14649f[_0xd240('0x22')];_0x148fd1[_0xd240('0x23')]['create']({'phone':_0x45a8ee['phone'],'ContactId':_0x45a8ee['id'],'ListId':_0x45a8ee[_0xd240('0x2e')],'scheduledat':_0x45a8ee[_0xd240('0x18')]?_0x45a8ee[_0xd240('0x18')]:moment()['format'](_0xd240('0x1a')),'priority':_0x45a8ee[_0xd240('0x27')]?_0x45a8ee[_0xd240('0x27')]:0x2,'callback':_0x45a8ee[_0xd240('0x28')]?!![]:![],'callbackuniqueid':_0x45a8ee[_0xd240('0x28')]?_0x45a8ee[_0xd240('0x28')]:undefined,'callbackat':_0x45a8ee[_0xd240('0x28')]?moment()[_0xd240('0x19')](_0xd240('0x1a')):undefined,'VoiceQueueId':_0x4ca863['id']})[_0xd240('0x29')](_0x5cf762());});}}}})['then'](function(){return _0x148fd1[_0xd240('0x35')][_0xd240('0x36')]({'where':{'type':_0xd240('0x37')},'attributes':['id'],'include':[{'model':_0x148fd1['CmList'],'as':_0xd240('0x3c'),'where':{'id':_0x45a8ee[_0xd240('0x2e')]}}]})[_0xd240('0x21')](function(_0x5e5090){if(_0x5e5090){var _0x4ce6cf=[];for(var _0x3fed82=0x0,_0x2f6170;_0x3fed82<_0x5e5090[_0xd240('0x39')];_0x3fed82+=0x1){_0x2f6170=_0x5e5090[_0x3fed82][_0xd240('0x14')]({'plain':!![]});_0x148fd1[_0xd240('0x3d')][_0xd240('0x26')]({'phone':_0x45a8ee[_0xd240('0xd')],'ContactId':_0x45a8ee['id'],'ListId':_0x45a8ee[_0xd240('0x2e')],'VoiceQueueId':_0x2f6170['id']})['catch'](function(_0x55553a){logger[_0xd240('0x2f')](_0xd240('0x3e'),'afterCreate',_0x55553a[_0xd240('0x3f')]);});}}});})[_0xd240('0x21')](function(){return _0x148fd1['Campaign'][_0xd240('0x36')]({'attributes':['id','dialCheckDuplicateType',_0xd240('0x1c')],'include':[{'model':_0x148fd1[_0xd240('0x38')],'as':_0xd240('0x40'),'where':{'id':_0x45a8ee[_0xd240('0x2e')]}}]})[_0xd240('0x21')](function(_0x4118f0){if(_0x4118f0){var _0x2d0578=[];for(var _0x53ed2b=0x0,_0x3d9dc1;_0x53ed2b<_0x4118f0['length'];_0x53ed2b+=0x1){_0x3d9dc1=_0x4118f0[_0x53ed2b][_0xd240('0x14')]({'plain':!![]});switch(_0x3d9dc1['dialCheckDuplicateType']){case _0xd240('0x3b'):_0x4f4eaf(_0x3d9dc1)[_0xd240('0x29')](_0x5a85ad());break;case'onlyIfOpen':_0x2e1cdf(_0x3d9dc1)['catch'](_0x5a85ad());break;default:_0x148fd1[_0xd240('0x23')]['create']({'phone':_0x45a8ee[_0xd240('0xd')],'ContactId':_0x45a8ee['id'],'ListId':_0x45a8ee[_0xd240('0x2e')],'scheduledat':_0x45a8ee[_0xd240('0x18')]?_0x45a8ee[_0xd240('0x18')]:moment()[_0xd240('0x19')](_0xd240('0x1a')),'priority':_0x45a8ee[_0xd240('0x27')]?_0x45a8ee[_0xd240('0x27')]:0x2,'callback':_0x45a8ee['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x45a8ee[_0xd240('0x28')]?_0x45a8ee[_0xd240('0x28')]:undefined,'callbackat':_0x45a8ee[_0xd240('0x28')]?moment()[_0xd240('0x19')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x3d9dc1['id']})[_0xd240('0x29')](_0x5a85ad());}}}});})[_0xd240('0x21')](function(){return _0x148fd1[_0xd240('0x30')]['findAll']({'attributes':['id'],'include':[{'model':_0x148fd1[_0xd240('0x38')],'as':_0xd240('0x3c'),'where':{'id':_0x45a8ee[_0xd240('0x2e')]}}]})['then'](function(_0x25a99d){if(_0x25a99d){var _0x2c9d0a=[];for(var _0x59539d=0x0,_0x2545cb;_0x59539d<_0x25a99d[_0xd240('0x39')];_0x59539d+=0x1){_0x2545cb=_0x25a99d[_0x59539d][_0xd240('0x14')]({'plain':!![]});_0x148fd1[_0xd240('0x3d')]['create']({'phone':_0x45a8ee[_0xd240('0xd')],'ContactId':_0x45a8ee['id'],'ListId':_0x45a8ee[_0xd240('0x2e')],'CampaignId':_0x2545cb['id']})[_0xd240('0x29')](function(_0x364ea4){logger[_0xd240('0x2f')](_0xd240('0x3e'),_0xd240('0x16'),_0x364ea4[_0xd240('0x3f')]);});}}});})[_0xd240('0x21')](function(){_0x3ea1e8();})[_0xd240('0x29')](function(_0x1be35c){logger[_0xd240('0x2f')](_0xd240('0x3e'),'afterCreate',_0x1be35c[_0xd240('0x3f')]);_0x3ea1e8(_0x1be35c);});}else{_0x3ea1e8(new Error(_0xd240('0x41')));}},'afterDestroy':function(_0x5dd161,_0x7b3efb,_0x1bd2fa){var _0x3d5765=_0x149718[_0xd240('0x13')];var _0x5bf422=_0x5dd161[_0xd240('0x14')]({'plain':!![]});return _0x3d5765[_0xd240('0x23')][_0xd240('0x36')]({'raw':!![],'where':{'ListId':_0x5bf422[_0xd240('0x2e')],'ContactId':_0x5bf422['id']}})[_0xd240('0x21')](function(_0xbfe84d){if(!_['isEmpty'](_0xbfe84d)){var _0x18f220=[];for(var _0x373977=0x0;_0x373977<_0xbfe84d['length'];_0x373977+=0x1){var _0x209467=_0x3d5765[_0xd240('0x23')][_0xd240('0x42')]({'where':{'ListId':_0xbfe84d[_0x373977][_0xd240('0x2e')],'ContactId':_0xbfe84d[_0x373977][_0xd240('0x43')],'VoiceQueueId':_0xbfe84d[_0x373977][_0xd240('0x44')],'CampaignId':_0xbfe84d[_0x373977][_0xd240('0x45')]}});_0x18f220[_0xd240('0x46')](_0x209467);}return BPromise[_0xd240('0x47')](_0x18f220);}})['then'](function(_0x24b8fa){logger[_0xd240('0x48')]('[CmContact][afterDestroy][Succesfull]',util[_0xd240('0x17')](_0x24b8fa,{'showHidden':![],'depth':null}));_0x1bd2fa();})[_0xd240('0x29')](function(_0x1edb6a){logger[_0xd240('0x2f')](_0xd240('0x49'),util[_0xd240('0x17')](_0x1edb6a,{'showHidden':![],'depth':null}));_0x1bd2fa(_0x1edb6a);});}}});}; \ No newline at end of file +var _0x90e0=['all','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','bluebird','request-promise','path','../../config/environment','define','CmContact','cm_contacts','phone','firstName','mobile','fax','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','findOne','then','utcOffset','add','minutes','ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','priority','callbackUniqueid','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','ListId','catch','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','cmContact,\x20afterCreate,\x20','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','always','onlyIfOpen','List\x20not\x20found','isEmpty','destroy','ContactId','push'];(function(_0x57e4db,_0x4c5b81){var _0x3fc8a6=function(_0xb01a26){while(--_0xb01a26){_0x57e4db['push'](_0x57e4db['shift']());}};_0x3fc8a6(++_0x4c5b81);}(_0x90e0,0x8b));var _0x090e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x90e0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x090e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x090e('0x1'));var rp=require(_0x090e('0x2'));var fs=require('fs');var path=require(_0x090e('0x3'));var rimraf=require('rimraf');var config=require(_0x090e('0x4'));var shared=require('../../config/environment/shared');var attributes=require('./cmContact.attributes');module['exports']=function(_0x5eedd3,_0x252e7b){return _0x5eedd3[_0x090e('0x5')](_0x090e('0x6'),attributes,{'tableName':_0x090e('0x7'),'paranoid':!![],'indexes':[{'name':_0x090e('0x8'),'fields':['phone']},{'name':'fti_cm_contacts','fields':[_0x090e('0x9'),'lastName',_0x090e('0x8'),_0x090e('0xa'),_0x090e('0xb'),'email'],'type':_0x090e('0xc')}],'timestamps':!![],'charset':_0x090e('0xd'),'collate':_0x090e('0xe'),'hooks':{'afterCreate':function(_0x46092,_0x2a252e,_0x53b688){var _0x167529=_0x5eedd3[_0x090e('0xf')];var _0x5e92b5=_0x46092[_0x090e('0x10')]({'plain':!![]});function _0x40810a(){return function(_0x24f761){logger[_0x090e('0x11')](_0x090e('0x12'),_0x090e('0x13'),util[_0x090e('0x14')](_0x24f761,{'showHidden':![],'depth':null}));};}function _0x50ee58(_0x2cc18b,_0x289bbc){var _0x3eb187=_0x289bbc[_0x090e('0x15')]?_0x289bbc['scheduledat']:moment()[_0x090e('0x16')](_0x090e('0x17'));return new BPromise(function(_0x290f18,_0x2cae42){if(_[_0x090e('0x18')](_0x289bbc[_0x090e('0x19')])){_0x290f18({'ret':_0x3eb187});}else{_0x167529['VoiceQueue'][_0x090e('0x1a')]({'where':{'id':_0x2cc18b['id']}})[_0x090e('0x1b')](function(_0x182f06){if(!_['isNil'](_0x182f06)){var _0x6255c7=_0x182f06[_0x090e('0x19')];if(!_[_0x090e('0x18')](_0x6255c7)){var _0x144784=shared['timezones'];var _0x5aece4=_0x144784[_0x6255c7];var _0x462fe0=_0x144784[_0x289bbc['dialTimezone']];if(!_[_0x090e('0x18')](_0x5aece4)&&!_['isNil'](_0x462fe0)){var _0x11bc2f=_0x5aece4[_0x090e('0x1c')]-_0x462fe0['utcOffset'];_0x3eb187=_0x289bbc['scheduledat']?_0x289bbc[_0x090e('0x15')]:moment();var _0x1ef70d=moment(_0x3eb187)[_0x090e('0x1d')](_0x11bc2f,_0x090e('0x1e'));_0x290f18({'ret':_0x1ef70d['format'](_0x090e('0x17'))});}else _0x290f18({'ret':_0x3eb187});}else _0x290f18({'ret':_0x3eb187});}else{_0x290f18({'ret':_0x3eb187});}});}});return 0xa;}var _0x5ddb30=function(_0x5346f3){return new BPromise(function(_0xf57248,_0x2f9aba){_0x50ee58(_0x5346f3,_0x5e92b5)['then'](function(_0x3bc1b0){_0x5e92b5['scheduledat']=_0x3bc1b0[_0x090e('0x1f')];_0x167529[_0x090e('0x20')][_0x090e('0x1a')]({'where':{'phone':_0x5e92b5['phone'],'VoiceQueueId':_0x5346f3['id']}})[_0x090e('0x1b')](function(_0x44302a){if(!_[_0x090e('0x18')](_0x44302a)){throw new Error(_0x090e('0x21')+_0x5e92b5[_0x090e('0x8')]+_0x090e('0x22')+_0x5346f3['id']);}return _0x167529[_0x090e('0x20')][_0x090e('0x23')]({'phone':_0x5e92b5['phone'],'ContactId':_0x5e92b5['id'],'ListId':_0x5e92b5['ListId'],'priority':_0x5e92b5[_0x090e('0x24')]?_0x5e92b5['priority']:0x2,'scheduledat':_0x5e92b5['scheduledat']?_0x5e92b5[_0x090e('0x15')]:moment()[_0x090e('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x5e92b5[_0x090e('0x25')]?!![]:![],'callbackuniqueid':_0x5e92b5['callbackUniqueid']?_0x5e92b5[_0x090e('0x25')]:undefined,'callbackat':_0x5e92b5['callbackUniqueid']?moment()[_0x090e('0x16')](_0x090e('0x17')):undefined,'VoiceQueueId':_0x5346f3['id']});})['catch'](function(_0x4edc3a){_0x2f9aba(_0x4edc3a);});});});};var _0x2dee87=function(_0x7d260){return new BPromise(function(_0x17f82d,_0x2903d0){_0x50ee58(_0x7d260,_0x5e92b5)[_0x090e('0x1b')](function(_0x42823d){_0x5e92b5[_0x090e('0x15')]=_0x42823d['ret'];_0x167529[_0x090e('0x20')][_0x090e('0x1a')]({'where':{'phone':_0x5e92b5[_0x090e('0x8')],'VoiceQueueId':_0x7d260['id']}})[_0x090e('0x1b')](function(_0x58bfcf){if(!_[_0x090e('0x18')](_0x58bfcf)){throw new Error(_0x090e('0x21')+_0x5e92b5[_0x090e('0x8')]+_0x090e('0x26')+_0x7d260['id']);}return _0x167529[_0x090e('0x27')][_0x090e('0x1a')]({'where':{'calleridnum':_0x5e92b5[_0x090e('0x8')],'VoiceQueueId':_0x7d260['id']}});})[_0x090e('0x1b')](function(_0x2e6801){if(!_[_0x090e('0x18')](_0x2e6801)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x5e92b5[_0x090e('0x8')]+_0x090e('0x28')+_0x7d260['id']);}return _0x167529[_0x090e('0x20')][_0x090e('0x23')]({'phone':_0x5e92b5[_0x090e('0x8')],'ContactId':_0x5e92b5['id'],'ListId':_0x5e92b5[_0x090e('0x29')],'priority':_0x5e92b5[_0x090e('0x24')]?_0x5e92b5[_0x090e('0x24')]:0x2,'scheduledat':_0x5e92b5['scheduledat']?_0x5e92b5[_0x090e('0x15')]:moment()[_0x090e('0x16')](_0x090e('0x17')),'callback':_0x5e92b5[_0x090e('0x25')]?!![]:![],'callbackuniqueid':_0x5e92b5['callbackUniqueid']?_0x5e92b5[_0x090e('0x25')]:undefined,'callbackat':_0x5e92b5[_0x090e('0x25')]?moment()['format'](_0x090e('0x17')):undefined,'VoiceQueueId':_0x7d260['id']});})[_0x090e('0x2a')](function(_0x4ce209){_0x2903d0(_0x4ce209);});});});};function _0x4dc845(){return function(_0x3bbc66){logger[_0x090e('0x11')]('cmContact',_0x090e('0x13'),util[_0x090e('0x14')](_0x3bbc66,{'showHidden':![],'depth':null}));};}function _0x457e5e(_0x30aacd,_0x1897bc){var _0x4a401e=_0x1897bc['scheduledat']?_0x1897bc[_0x090e('0x15')]:moment()[_0x090e('0x16')](_0x090e('0x17'));return new BPromise(function(_0x12a280,_0x1267b1){if(_[_0x090e('0x18')](_0x1897bc['dialTimezone'])){_0x12a280({'ret':_0x4a401e});}else{_0x167529[_0x090e('0x2b')][_0x090e('0x1a')]({'where':{'id':_0x30aacd['id']}})[_0x090e('0x1b')](function(_0x229a5d){if(!_[_0x090e('0x18')](_0x229a5d)){var _0x59ef99=_0x229a5d['dialTimezone'];if(!_[_0x090e('0x18')](_0x59ef99)){var _0x2ec56b=shared['timezones'];var _0x43fdbf=_0x2ec56b[_0x59ef99];var _0x557d92=_0x2ec56b[_0x1897bc[_0x090e('0x19')]];if(!_[_0x090e('0x18')](_0x43fdbf)&&!_['isNil'](_0x557d92)){var _0xd73fbf=_0x43fdbf[_0x090e('0x1c')]-_0x557d92[_0x090e('0x1c')];_0x4a401e=_0x1897bc['scheduledat']?_0x1897bc[_0x090e('0x15')]:moment();var _0x7bd0b9=moment(_0x4a401e)[_0x090e('0x1d')](_0xd73fbf,_0x090e('0x1e'));_0x12a280({'ret':_0x7bd0b9['format'](_0x090e('0x17'))});}else _0x12a280({'ret':_0x4a401e});}else _0x12a280({'ret':_0x4a401e});}else{_0x12a280({'ret':_0x4a401e});}});}});return 0xa;}var _0x3836f2=function(_0x49ee7e){return new BPromise(function(_0x3b80be,_0x14bd02){_0x457e5e(_0x49ee7e,_0x5e92b5)['then'](function(_0x3194e1){_0x5e92b5[_0x090e('0x15')]=_0x3194e1[_0x090e('0x1f')];_0x167529[_0x090e('0x20')][_0x090e('0x1a')]({'where':{'phone':_0x5e92b5['phone'],'CampaignId':_0x49ee7e['id']}})[_0x090e('0x1b')](function(_0x1e6b1c){if(!_[_0x090e('0x18')](_0x1e6b1c)){throw new Error(_0x090e('0x21')+_0x5e92b5[_0x090e('0x8')]+_0x090e('0x2c')+_0x49ee7e['id']);}return _0x167529[_0x090e('0x20')][_0x090e('0x23')]({'phone':_0x5e92b5[_0x090e('0x8')],'ContactId':_0x5e92b5['id'],'ListId':_0x5e92b5[_0x090e('0x29')],'priority':_0x5e92b5[_0x090e('0x24')]?_0x5e92b5[_0x090e('0x24')]:0x2,'scheduledat':_0x5e92b5[_0x090e('0x15')]?_0x5e92b5[_0x090e('0x15')]:moment()[_0x090e('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x5e92b5[_0x090e('0x25')]?!![]:![],'callbackuniqueid':_0x5e92b5[_0x090e('0x25')]?_0x5e92b5[_0x090e('0x25')]:undefined,'callbackat':_0x5e92b5[_0x090e('0x25')]?moment()['format'](_0x090e('0x17')):undefined,'CampaignId':_0x49ee7e['id']});})[_0x090e('0x2a')](function(_0x32f0d8){_0x14bd02(_0x32f0d8);});});});};var _0x2115ee=function(_0x3f77ed){return new BPromise(function(_0x1ce962,_0x4bb300){_0x457e5e(_0x3f77ed,_0x5e92b5)['then'](function(_0x58103b){_0x5e92b5[_0x090e('0x15')]=_0x58103b[_0x090e('0x1f')];_0x167529[_0x090e('0x20')][_0x090e('0x1a')]({'where':{'phone':_0x5e92b5[_0x090e('0x8')],'CampaignId':_0x3f77ed['id']}})['then'](function(_0x3b90df){if(!_['isNil'](_0x3b90df)){throw new Error(_0x090e('0x21')+_0x5e92b5[_0x090e('0x8')]+_0x090e('0x2d')+_0x3f77ed['id']);}return _0x167529[_0x090e('0x27')][_0x090e('0x1a')]({'where':{'calleridnum':_0x5e92b5[_0x090e('0x8')],'CampaignId':_0x3f77ed['id']}});})[_0x090e('0x1b')](function(_0x15cd3e){if(!_['isNil'](_0x15cd3e)){throw new Error(_0x090e('0x2e')+_0x5e92b5[_0x090e('0x8')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x3f77ed['id']);}return _0x167529[_0x090e('0x20')][_0x090e('0x23')]({'phone':_0x5e92b5[_0x090e('0x8')],'ContactId':_0x5e92b5['id'],'ListId':_0x5e92b5[_0x090e('0x29')],'priority':_0x5e92b5[_0x090e('0x24')]?_0x5e92b5[_0x090e('0x24')]:0x2,'scheduledat':_0x5e92b5[_0x090e('0x15')]?_0x5e92b5[_0x090e('0x15')]:moment()[_0x090e('0x16')](_0x090e('0x17')),'callback':_0x5e92b5['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x5e92b5[_0x090e('0x25')]?_0x5e92b5[_0x090e('0x25')]:undefined,'callbackat':_0x5e92b5[_0x090e('0x25')]?moment()[_0x090e('0x16')](_0x090e('0x17')):undefined,'CampaignId':_0x3f77ed['id']});})[_0x090e('0x2a')](function(_0x49e683){_0x4bb300(_0x49e683);});});});};if(_0x5e92b5['ListId']){_0x167529[_0x090e('0x2f')][_0x090e('0x30')]({'where':{'type':_0x090e('0x31')},'attributes':['id',_0x090e('0x32'),_0x090e('0x19')],'include':[{'model':_0x167529[_0x090e('0x33')],'as':_0x090e('0x34'),'where':{'id':_0x5e92b5[_0x090e('0x29')]}}]})[_0x090e('0x1b')](function(_0x2aa9a7){if(_0x2aa9a7){var _0xe2f1c6=[];for(var _0x4a7b6b=0x0,_0x4a4739;_0x4a7b6b<_0x2aa9a7[_0x090e('0x35')];_0x4a7b6b+=0x1){_0x4a4739=_0x2aa9a7[_0x4a7b6b][_0x090e('0x10')]({'plain':!![]});switch(_0x4a4739[_0x090e('0x32')]){case'always':_0x2dee87(_0x4a4739)[_0x090e('0x2a')](_0x40810a());break;case'onlyIfOpen':_0x5ddb30(_0x4a4739)['catch'](_0x40810a());break;default:_0x457e5e(_0x4a4739,_0x5e92b5)[_0x090e('0x1b')](function(_0x30ed02){_0x5e92b5[_0x090e('0x15')]=_0x30ed02[_0x090e('0x1f')];_0x167529[_0x090e('0x20')][_0x090e('0x23')]({'phone':_0x5e92b5[_0x090e('0x8')],'ContactId':_0x5e92b5['id'],'ListId':_0x5e92b5[_0x090e('0x29')],'scheduledat':_0x5e92b5['scheduledat']?_0x5e92b5['scheduledat']:moment()['format'](_0x090e('0x17')),'priority':_0x5e92b5[_0x090e('0x24')]?_0x5e92b5[_0x090e('0x24')]:0x2,'callback':_0x5e92b5[_0x090e('0x25')]?!![]:![],'callbackuniqueid':_0x5e92b5[_0x090e('0x25')]?_0x5e92b5[_0x090e('0x25')]:undefined,'callbackat':_0x5e92b5[_0x090e('0x25')]?moment()[_0x090e('0x16')](_0x090e('0x17')):undefined,'VoiceQueueId':_0x4a4739['id']})[_0x090e('0x2a')](_0x40810a());});}}}})[_0x090e('0x1b')](function(){return _0x167529[_0x090e('0x2f')][_0x090e('0x30')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x167529['CmList'],'as':_0x090e('0x36'),'where':{'id':_0x5e92b5[_0x090e('0x29')]}}]})['then'](function(_0x45fbb0){if(_0x45fbb0){var _0x4fb42b=[];for(var _0x42650b=0x0,_0x779296;_0x42650b<_0x45fbb0['length'];_0x42650b+=0x1){_0x779296=_0x45fbb0[_0x42650b]['get']({'plain':!![]});_0x167529[_0x090e('0x37')][_0x090e('0x23')]({'phone':_0x5e92b5[_0x090e('0x8')],'ContactId':_0x5e92b5['id'],'ListId':_0x5e92b5[_0x090e('0x29')],'VoiceQueueId':_0x779296['id']})[_0x090e('0x2a')](function(_0x451586){logger[_0x090e('0x11')](_0x090e('0x38'),_0x090e('0x13'),_0x451586[_0x090e('0x39')]);});}}});})[_0x090e('0x1b')](function(){return _0x167529[_0x090e('0x2b')][_0x090e('0x30')]({'attributes':['id',_0x090e('0x32'),_0x090e('0x19')],'include':[{'model':_0x167529[_0x090e('0x33')],'as':_0x090e('0x34'),'where':{'id':_0x5e92b5[_0x090e('0x29')]}}]})['then'](function(_0x3bf7bd){if(_0x3bf7bd){var _0x42e619=[];for(var _0x4699b3=0x0,_0x5444e6;_0x4699b3<_0x3bf7bd[_0x090e('0x35')];_0x4699b3+=0x1){_0x5444e6=_0x3bf7bd[_0x4699b3][_0x090e('0x10')]({'plain':!![]});switch(_0x5444e6[_0x090e('0x32')]){case _0x090e('0x3a'):_0x2115ee(_0x5444e6)[_0x090e('0x2a')](_0x4dc845());break;case _0x090e('0x3b'):_0x3836f2(_0x5444e6)['catch'](_0x4dc845());break;default:_0x167529[_0x090e('0x20')]['create']({'phone':_0x5e92b5[_0x090e('0x8')],'ContactId':_0x5e92b5['id'],'ListId':_0x5e92b5['ListId'],'scheduledat':_0x5e92b5[_0x090e('0x15')]?_0x5e92b5[_0x090e('0x15')]:moment()[_0x090e('0x16')](_0x090e('0x17')),'priority':_0x5e92b5[_0x090e('0x24')]?_0x5e92b5[_0x090e('0x24')]:0x2,'callback':_0x5e92b5['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x5e92b5[_0x090e('0x25')]?_0x5e92b5[_0x090e('0x25')]:undefined,'callbackat':_0x5e92b5[_0x090e('0x25')]?moment()[_0x090e('0x16')](_0x090e('0x17')):undefined,'CampaignId':_0x5444e6['id']})[_0x090e('0x2a')](_0x4dc845());}}}});})['then'](function(){return _0x167529[_0x090e('0x2b')][_0x090e('0x30')]({'attributes':['id'],'include':[{'model':_0x167529[_0x090e('0x33')],'as':'BlackLists','where':{'id':_0x5e92b5['ListId']}}]})[_0x090e('0x1b')](function(_0x3784a5){if(_0x3784a5){var _0x2a0798=[];for(var _0x2881cf=0x0,_0x57d02b;_0x2881cf<_0x3784a5[_0x090e('0x35')];_0x2881cf+=0x1){_0x57d02b=_0x3784a5[_0x2881cf]['get']({'plain':!![]});_0x167529[_0x090e('0x37')][_0x090e('0x23')]({'phone':_0x5e92b5[_0x090e('0x8')],'ContactId':_0x5e92b5['id'],'ListId':_0x5e92b5[_0x090e('0x29')],'CampaignId':_0x57d02b['id']})[_0x090e('0x2a')](function(_0x27055f){logger[_0x090e('0x11')](_0x090e('0x38'),'afterCreate',_0x27055f[_0x090e('0x39')]);});}}});})[_0x090e('0x1b')](function(){_0x53b688();})[_0x090e('0x2a')](function(_0x1b36b2){logger[_0x090e('0x11')](_0x090e('0x38'),_0x090e('0x13'),_0x1b36b2[_0x090e('0x39')]);_0x53b688(_0x1b36b2);});}else{_0x53b688(new Error(_0x090e('0x3c')));}},'afterDestroy':function(_0x2de6b1,_0x2b19f6,_0x4b8ea5){var _0x27d60a=_0x5eedd3['models'];var _0x40cb8a=_0x2de6b1['get']({'plain':!![]});return _0x27d60a['CmHopper'][_0x090e('0x30')]({'raw':!![],'where':{'ListId':_0x40cb8a[_0x090e('0x29')],'ContactId':_0x40cb8a['id']}})[_0x090e('0x1b')](function(_0x2e4607){if(!_[_0x090e('0x3d')](_0x2e4607)){var _0x41d5a3=[];for(var _0x300b70=0x0;_0x300b70<_0x2e4607[_0x090e('0x35')];_0x300b70+=0x1){var _0x110bbe=_0x27d60a[_0x090e('0x20')][_0x090e('0x3e')]({'where':{'ListId':_0x2e4607[_0x300b70]['ListId'],'ContactId':_0x2e4607[_0x300b70][_0x090e('0x3f')],'VoiceQueueId':_0x2e4607[_0x300b70]['VoiceQueueId'],'CampaignId':_0x2e4607[_0x300b70]['CampaignId']}});_0x41d5a3[_0x090e('0x40')](_0x110bbe);}return BPromise[_0x090e('0x41')](_0x41d5a3);}})[_0x090e('0x1b')](function(_0x1a772b){logger['info'](_0x090e('0x42'),util[_0x090e('0x14')](_0x1a772b,{'showHidden':![],'depth':null}));_0x4b8ea5();})[_0x090e('0x2a')](function(_0x7dd3ca){logger[_0x090e('0x11')](_0x090e('0x43'),util[_0x090e('0x14')](_0x7dd3ca,{'showHidden':![],'depth':null}));_0x4b8ea5(_0x7dd3ca);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 6832e7f..23504ef 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x4f3e4a,_0x44f857){var _0x2c54c3=function(_0x3ab94b){while(--_0x3ab94b){_0x4f3e4a['push'](_0x4f3e4a['shift']());}};_0x2c54c3(++_0x44f857);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x1c5ff6,_0x4f3905){var _0x464324=function(_0x20c1a9){while(--_0x20c1a9){_0x1c5ff6['push'](_0x1c5ff6['shift']());}};_0x464324(++_0x4f3905);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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 8df3776..7e8d8dc 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 _0x50a6=['exports','INTEGER','PHONE','STRING','sequelize'];(function(_0x1a7cde,_0x369ea4){var _0x56be2d=function(_0x47faae){while(--_0x47faae){_0x1a7cde['push'](_0x1a7cde['shift']());}};_0x56be2d(++_0x369ea4);}(_0x50a6,0xa4));var _0x650a=function(_0x1f83ac,_0x8016fc){_0x1f83ac=_0x1f83ac-0x0;var _0x1985de=_0x50a6[_0x1f83ac];return _0x1985de;};'use strict';var Sequelize=require(_0x650a('0x0'));module[_0x650a('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x650a('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0x650a('0x3')},'OrderBy':{'type':Sequelize[_0x650a('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x650a('0x4')],'defaultValue':null}}; \ No newline at end of file +var _0xf021=['exports','INTEGER','STRING','PHONE','sequelize'];(function(_0x4e4519,_0x392ae){var _0x340044=function(_0x11721f){while(--_0x11721f){_0x4e4519['push'](_0x4e4519['shift']());}};_0x340044(++_0x392ae);}(_0xf021,0x18f));var _0x1f02=function(_0x1389e3,_0x2ed4bd){_0x1389e3=_0x1389e3-0x0;var _0x3f6873=_0xf021[_0x1389e3];return _0x3f6873;};'use strict';var Sequelize=require(_0x1f02('0x0'));module[_0x1f02('0x1')]={'CmContactId':{'type':Sequelize[_0x1f02('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x1f02('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x1f02('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0x1f02('0x4')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0x1f02('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 0ce1147..d0f17c3 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 _0xbf69=['squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','destroy','then','CmContactHasItems','end','error','stack','name','send','index','map','CmContactHasItem','fieldName','type','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','intersection','include','find','catch','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','body','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x352f58,_0x44551b){var _0x2c8806=function(_0x1384ce){while(--_0x1384ce){_0x352f58['push'](_0x352f58['shift']());}};_0x2c8806(++_0x44551b);}(_0xbf69,0x193));var _0x9bf6=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0xbf69[_0x556927];return _0x5f1235;};'use strict';var emlformat=require(_0x9bf6('0x0'));var rimraf=require(_0x9bf6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9bf6('0x2'));var rp=require('request-promise');var moment=require(_0x9bf6('0x3'));var BPromise=require(_0x9bf6('0x4'));var Mustache=require('mustache');var util=require(_0x9bf6('0x5'));var path=require(_0x9bf6('0x6'));var sox=require(_0x9bf6('0x7'));var csv=require(_0x9bf6('0x8'));var ejs=require(_0x9bf6('0x9'));var fs=require('fs');var fs_extra=require(_0x9bf6('0xa'));var _=require(_0x9bf6('0xb'));var squel=require(_0x9bf6('0xc'));var crypto=require('crypto');var jsforce=require(_0x9bf6('0xd'));var deskjs=require(_0x9bf6('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9bf6('0xf'));var Redis=require(_0x9bf6('0x10'));var authService=require(_0x9bf6('0x11'));var qs=require(_0x9bf6('0x12'));var as=require(_0x9bf6('0x13'));var hardwareService=require(_0x9bf6('0x14'));var logger=require(_0x9bf6('0x15'))(_0x9bf6('0x16'));var utils=require(_0x9bf6('0x17'));var config=require(_0x9bf6('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x9bf6('0x19'))['db'];function respondWithStatusCode(_0x16a5d7,_0x34f60c){_0x34f60c=_0x34f60c||0xcc;return function(_0x20ac7a){if(_0x20ac7a){return _0x16a5d7[_0x9bf6('0x1a')](_0x34f60c);}return _0x16a5d7[_0x9bf6('0x1b')](_0x34f60c)['end']();};}function respondWithResult(_0x41fcbe,_0x15a842){_0x15a842=_0x15a842||0xc8;return function(_0x1a89d8){if(_0x1a89d8){return _0x41fcbe[_0x9bf6('0x1b')](_0x15a842)[_0x9bf6('0x1c')](_0x1a89d8);}};}function respondWithFilteredResult(_0x411c09,_0x332578){return function(_0x52c6cc){if(_0x52c6cc){var _0x5e7ab7=typeof _0x332578['offset']==='undefined'&&typeof _0x332578[_0x9bf6('0x1d')]===_0x9bf6('0x1e');var _0x45d184=_0x52c6cc[_0x9bf6('0x1f')];var _0x5c3612=_0x5e7ab7?0x0:_0x332578[_0x9bf6('0x20')];var _0x53a4f2=_0x5e7ab7?_0x52c6cc[_0x9bf6('0x1f')]:_0x332578[_0x9bf6('0x20')]+_0x332578['limit'];var _0x30cb70;if(_0x53a4f2>=_0x45d184){_0x53a4f2=_0x45d184;_0x30cb70=0xc8;}else{_0x30cb70=0xce;}_0x411c09[_0x9bf6('0x1b')](_0x30cb70);return _0x411c09['set'](_0x9bf6('0x21'),_0x5c3612+'-'+_0x53a4f2+'/'+_0x45d184)['json'](_0x52c6cc);}return null;};}function patchUpdates(_0x3fdd9d){return function(_0x3178e7){try{jsonpatch[_0x9bf6('0x22')](_0x3178e7,_0x3fdd9d,!![]);}catch(_0xeb8f74){return BPromise[_0x9bf6('0x23')](_0xeb8f74);}return _0x3178e7[_0x9bf6('0x24')]();};}function saveUpdates(_0x43de3a,_0x4e51de){return function(_0x101c59){if(_0x101c59){return _0x101c59[_0x9bf6('0x25')](_0x43de3a)['then'](function(_0x4b318b){return _0x4b318b;});}return null;};}function removeEntity(_0x5cd94a,_0x1ba153){return function(_0x36d4bc){if(_0x36d4bc){return _0x36d4bc[_0x9bf6('0x26')]()[_0x9bf6('0x27')](function(){var _0x247b4c=_0x36d4bc['get']({'plain':!![]});var _0x283286=_0x9bf6('0x28');return db['UserProfileResource'][_0x9bf6('0x26')]({'where':{'type':_0x283286,'resourceId':_0x247b4c['id']}})[_0x9bf6('0x27')](function(){return _0x36d4bc;});})[_0x9bf6('0x27')](function(){_0x5cd94a[_0x9bf6('0x1b')](0xcc)[_0x9bf6('0x29')]();});}};}function handleEntityNotFound(_0x4e1d17,_0x1506a9){return function(_0xaba03c){if(!_0xaba03c){_0x4e1d17['sendStatus'](0x194);}return _0xaba03c;};}function handleError(_0x3f2443,_0x2cfd8b){_0x2cfd8b=_0x2cfd8b||0x1f4;return function(_0xb995c0){logger[_0x9bf6('0x2a')](_0xb995c0[_0x9bf6('0x2b')]);if(_0xb995c0[_0x9bf6('0x2c')]){delete _0xb995c0['name'];}_0x3f2443['status'](_0x2cfd8b)[_0x9bf6('0x2d')](_0xb995c0);};}exports[_0x9bf6('0x2e')]=function(_0x5eb730,_0x5c50b7){var _0x41aa32={},_0x2e1e65={},_0x9b4ca1={'count':0x0,'rows':[]};var _0x1987aa=_[_0x9bf6('0x2f')](db[_0x9bf6('0x30')]['rawAttributes'],function(_0x228386){return{'name':_0x228386[_0x9bf6('0x31')],'type':_0x228386[_0x9bf6('0x32')]['key']};});_0x2e1e65[_0x9bf6('0x33')]=_[_0x9bf6('0x2f')](_0x1987aa,'name');_0x2e1e65[_0x9bf6('0x34')]=_[_0x9bf6('0x35')](_0x5eb730['query']);_0x2e1e65[_0x9bf6('0x36')]=_['intersection'](_0x2e1e65['model'],_0x2e1e65[_0x9bf6('0x34')]);_0x41aa32[_0x9bf6('0x37')]=_['intersection'](_0x2e1e65[_0x9bf6('0x33')],qs[_0x9bf6('0x38')](_0x5eb730[_0x9bf6('0x34')]['fields']));_0x41aa32[_0x9bf6('0x37')]=_0x41aa32[_0x9bf6('0x37')]['length']?_0x41aa32[_0x9bf6('0x37')]:_0x2e1e65[_0x9bf6('0x33')];if(!_0x5eb730['query'][_0x9bf6('0x39')](_0x9bf6('0x3a'))){_0x41aa32[_0x9bf6('0x1d')]=qs[_0x9bf6('0x1d')](_0x5eb730[_0x9bf6('0x34')][_0x9bf6('0x1d')]);_0x41aa32[_0x9bf6('0x20')]=qs[_0x9bf6('0x20')](_0x5eb730[_0x9bf6('0x34')][_0x9bf6('0x20')]);}_0x41aa32['order']=qs[_0x9bf6('0x3b')](_0x5eb730[_0x9bf6('0x34')][_0x9bf6('0x3b')]);_0x41aa32['where']=qs['filters'](_['pick'](_0x5eb730[_0x9bf6('0x34')],_0x2e1e65[_0x9bf6('0x36')]),_0x1987aa);if(_0x5eb730['query']['filter']){_0x41aa32[_0x9bf6('0x3c')]=_[_0x9bf6('0x3d')](_0x41aa32[_0x9bf6('0x3c')],{'$or':_[_0x9bf6('0x2f')](_0x1987aa,function(_0x404f94){if(_0x404f94[_0x9bf6('0x32')]!==_0x9bf6('0x3e')){var _0x4f6b30={};_0x4f6b30[_0x404f94[_0x9bf6('0x2c')]]={'$like':'%'+_0x5eb730['query']['filter']+'%'};return _0x4f6b30;}})});}_0x41aa32=_[_0x9bf6('0x3d')]({},_0x41aa32,_0x5eb730[_0x9bf6('0x3f')]);var _0x52c5bb={'where':_0x41aa32[_0x9bf6('0x3c')]};return db[_0x9bf6('0x30')][_0x9bf6('0x1f')](_0x52c5bb)['then'](function(_0x95cd13){_0x9b4ca1[_0x9bf6('0x1f')]=_0x95cd13;if(_0x5eb730[_0x9bf6('0x34')][_0x9bf6('0x40')]){_0x41aa32['include']=[{'all':!![]}];}return db[_0x9bf6('0x30')][_0x9bf6('0x41')](_0x41aa32);})[_0x9bf6('0x27')](function(_0x382fcd){_0x9b4ca1[_0x9bf6('0x42')]=_0x382fcd;return _0x9b4ca1;})['then'](respondWithFilteredResult(_0x5c50b7,_0x41aa32))['catch'](handleError(_0x5c50b7,null));};exports[_0x9bf6('0x43')]=function(_0x2f228d,_0x4a480b){var _0x1a763d={'raw':!![],'where':{'id':_0x2f228d[_0x9bf6('0x44')]['id']}},_0x1c4b18={};_0x1c4b18['model']=_[_0x9bf6('0x35')](db[_0x9bf6('0x30')][_0x9bf6('0x45')]);_0x1c4b18[_0x9bf6('0x34')]=_[_0x9bf6('0x35')](_0x2f228d[_0x9bf6('0x34')]);_0x1c4b18[_0x9bf6('0x36')]=_['intersection'](_0x1c4b18['model'],_0x1c4b18[_0x9bf6('0x34')]);_0x1a763d[_0x9bf6('0x37')]=_[_0x9bf6('0x46')](_0x1c4b18[_0x9bf6('0x33')],qs['fields'](_0x2f228d[_0x9bf6('0x34')][_0x9bf6('0x38')]));_0x1a763d[_0x9bf6('0x37')]=_0x1a763d[_0x9bf6('0x37')]['length']?_0x1a763d[_0x9bf6('0x37')]:_0x1c4b18['model'];if(_0x2f228d[_0x9bf6('0x34')][_0x9bf6('0x40')]){_0x1a763d[_0x9bf6('0x47')]=[{'all':!![]}];}_0x1a763d=_[_0x9bf6('0x3d')]({},_0x1a763d,_0x2f228d[_0x9bf6('0x3f')]);return db[_0x9bf6('0x30')][_0x9bf6('0x48')](_0x1a763d)[_0x9bf6('0x27')](handleEntityNotFound(_0x4a480b,null))[_0x9bf6('0x27')](respondWithResult(_0x4a480b,null))[_0x9bf6('0x49')](handleError(_0x4a480b,null));};exports[_0x9bf6('0x4a')]=function(_0x2d5408,_0xc134fc){return db[_0x9bf6('0x30')][_0x9bf6('0x4a')](_0x2d5408['body'],{})[_0x9bf6('0x27')](function(_0x45e297){var _0x2358db=_0x2d5408['user'][_0x9bf6('0x4b')]({'plain':!![]});if(!_0x2358db)throw new Error(_0x9bf6('0x4c'));if(_0x2358db[_0x9bf6('0x4d')]===_0x9bf6('0x4e')){var _0x4a5ac3=_0x45e297['get']({'plain':!![]});var _0x10d08e=_0x9bf6('0x28');return db['UserProfileSection'][_0x9bf6('0x48')]({'where':{'name':_0x10d08e,'userProfileId':_0x2358db[_0x9bf6('0x4f')]},'raw':!![]})['then'](function(_0x2a72b5){if(_0x2a72b5&&_0x2a72b5[_0x9bf6('0x50')]===0x0){return db[_0x9bf6('0x51')]['create']({'name':_0x4a5ac3[_0x9bf6('0x2c')],'resourceId':_0x4a5ac3['id'],'type':_0x2a72b5[_0x9bf6('0x2c')],'sectionId':_0x2a72b5['id']},{})['then'](function(){return _0x45e297;});}else{return _0x45e297;}})[_0x9bf6('0x49')](function(_0x325768){logger[_0x9bf6('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x325768);throw _0x325768;});}return _0x45e297;})['then'](respondWithResult(_0xc134fc,0xc9))[_0x9bf6('0x49')](handleError(_0xc134fc,null));};exports[_0x9bf6('0x25')]=function(_0x29d96f,_0x2c53a0){if(_0x29d96f[_0x9bf6('0x52')]['id']){delete _0x29d96f[_0x9bf6('0x52')]['id'];}return db[_0x9bf6('0x30')][_0x9bf6('0x48')]({'where':{'id':_0x29d96f['params']['id']}})[_0x9bf6('0x27')](handleEntityNotFound(_0x2c53a0,null))[_0x9bf6('0x27')](saveUpdates(_0x29d96f[_0x9bf6('0x52')],null))[_0x9bf6('0x27')](respondWithResult(_0x2c53a0,null))[_0x9bf6('0x49')](handleError(_0x2c53a0,null));};exports['destroy']=function(_0x295579,_0x3b8e0a){return db['CmContactHasItem'][_0x9bf6('0x48')]({'where':{'id':_0x295579[_0x9bf6('0x44')]['id']}})[_0x9bf6('0x27')](handleEntityNotFound(_0x3b8e0a,null))[_0x9bf6('0x27')](removeEntity(_0x3b8e0a,null))['catch'](handleError(_0x3b8e0a,null));}; \ No newline at end of file +var _0x2f95=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','get','CmContactHasItems','end','error','stack','name','send','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','CmContactHasItem','include','catch','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0x2f95,0x180));var _0x52f9=function(_0x1d9547,_0x544568){_0x1d9547=_0x1d9547-0x0;var _0x86d9c2=_0x2f95[_0x1d9547];return _0x86d9c2;};'use strict';var emlformat=require(_0x52f9('0x0'));var rimraf=require(_0x52f9('0x1'));var zipdir=require(_0x52f9('0x2'));var jsonpatch=require(_0x52f9('0x3'));var rp=require(_0x52f9('0x4'));var moment=require(_0x52f9('0x5'));var BPromise=require(_0x52f9('0x6'));var Mustache=require(_0x52f9('0x7'));var util=require(_0x52f9('0x8'));var path=require(_0x52f9('0x9'));var sox=require(_0x52f9('0xa'));var csv=require(_0x52f9('0xb'));var ejs=require(_0x52f9('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x52f9('0xd'));var crypto=require('crypto');var jsforce=require(_0x52f9('0xe'));var deskjs=require(_0x52f9('0xf'));var toCsv=require(_0x52f9('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x52f9('0x10'));var authService=require(_0x52f9('0x11'));var qs=require(_0x52f9('0x12'));var as=require(_0x52f9('0x13'));var hardwareService=require(_0x52f9('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x52f9('0x15'));var config=require(_0x52f9('0x16'));var licenseUtil=require(_0x52f9('0x17'));var db=require(_0x52f9('0x18'))['db'];function respondWithStatusCode(_0x186ee0,_0x5c7e43){_0x5c7e43=_0x5c7e43||0xcc;return function(_0xbe8639){if(_0xbe8639){return _0x186ee0[_0x52f9('0x19')](_0x5c7e43);}return _0x186ee0[_0x52f9('0x1a')](_0x5c7e43)['end']();};}function respondWithResult(_0x35c230,_0xcb05fe){_0xcb05fe=_0xcb05fe||0xc8;return function(_0x1461a1){if(_0x1461a1){return _0x35c230[_0x52f9('0x1a')](_0xcb05fe)[_0x52f9('0x1b')](_0x1461a1);}};}function respondWithFilteredResult(_0x25e4cc,_0x16b11b){return function(_0x2f4b36){if(_0x2f4b36){var _0x7eecc9=typeof _0x16b11b[_0x52f9('0x1c')]===_0x52f9('0x1d')&&typeof _0x16b11b[_0x52f9('0x1e')]==='undefined';var _0x2bc490=_0x2f4b36[_0x52f9('0x1f')];var _0x27e7cc=_0x7eecc9?0x0:_0x16b11b[_0x52f9('0x1c')];var _0x321a96=_0x7eecc9?_0x2f4b36[_0x52f9('0x1f')]:_0x16b11b[_0x52f9('0x1c')]+_0x16b11b[_0x52f9('0x1e')];var _0x3abe2b;if(_0x321a96>=_0x2bc490){_0x321a96=_0x2bc490;_0x3abe2b=0xc8;}else{_0x3abe2b=0xce;}_0x25e4cc[_0x52f9('0x1a')](_0x3abe2b);return _0x25e4cc['set'](_0x52f9('0x20'),_0x27e7cc+'-'+_0x321a96+'/'+_0x2bc490)[_0x52f9('0x1b')](_0x2f4b36);}return null;};}function patchUpdates(_0x489de1){return function(_0x3c4e5e){try{jsonpatch['apply'](_0x3c4e5e,_0x489de1,!![]);}catch(_0x5af1c2){return BPromise[_0x52f9('0x21')](_0x5af1c2);}return _0x3c4e5e[_0x52f9('0x22')]();};}function saveUpdates(_0x5bca2c,_0x92ecbd){return function(_0x3f5937){if(_0x3f5937){return _0x3f5937[_0x52f9('0x23')](_0x5bca2c)['then'](function(_0x19ef86){return _0x19ef86;});}return null;};}function removeEntity(_0x35a553,_0x3e4e43){return function(_0x2fc2d9){if(_0x2fc2d9){return _0x2fc2d9[_0x52f9('0x24')]()[_0x52f9('0x25')](function(){var _0x2a80ee=_0x2fc2d9[_0x52f9('0x26')]({'plain':!![]});var _0x4c132b=_0x52f9('0x27');return db['UserProfileResource'][_0x52f9('0x24')]({'where':{'type':_0x4c132b,'resourceId':_0x2a80ee['id']}})[_0x52f9('0x25')](function(){return _0x2fc2d9;});})['then'](function(){_0x35a553[_0x52f9('0x1a')](0xcc)[_0x52f9('0x28')]();});}};}function handleEntityNotFound(_0x10d314,_0x2a2395){return function(_0x5f357e){if(!_0x5f357e){_0x10d314['sendStatus'](0x194);}return _0x5f357e;};}function handleError(_0x297917,_0x3df452){_0x3df452=_0x3df452||0x1f4;return function(_0x20ca7a){logger[_0x52f9('0x29')](_0x20ca7a[_0x52f9('0x2a')]);if(_0x20ca7a[_0x52f9('0x2b')]){delete _0x20ca7a['name'];}_0x297917[_0x52f9('0x1a')](_0x3df452)[_0x52f9('0x2c')](_0x20ca7a);};}exports['index']=function(_0x2d5e3c,_0x304bf6){var _0x316fe4={},_0x7eff1c={},_0x576cdc={'count':0x0,'rows':[]};var _0x39642c=_[_0x52f9('0x2d')](db['CmContactHasItem'][_0x52f9('0x2e')],function(_0x124818){return{'name':_0x124818[_0x52f9('0x2f')],'type':_0x124818['type'][_0x52f9('0x30')]};});_0x7eff1c['model']=_[_0x52f9('0x2d')](_0x39642c,_0x52f9('0x2b'));_0x7eff1c[_0x52f9('0x31')]=_[_0x52f9('0x32')](_0x2d5e3c['query']);_0x7eff1c[_0x52f9('0x33')]=_[_0x52f9('0x34')](_0x7eff1c[_0x52f9('0x35')],_0x7eff1c[_0x52f9('0x31')]);_0x316fe4[_0x52f9('0x36')]=_[_0x52f9('0x34')](_0x7eff1c[_0x52f9('0x35')],qs[_0x52f9('0x37')](_0x2d5e3c['query'][_0x52f9('0x37')]));_0x316fe4['attributes']=_0x316fe4['attributes'][_0x52f9('0x38')]?_0x316fe4[_0x52f9('0x36')]:_0x7eff1c[_0x52f9('0x35')];if(!_0x2d5e3c[_0x52f9('0x31')][_0x52f9('0x39')](_0x52f9('0x3a'))){_0x316fe4[_0x52f9('0x1e')]=qs[_0x52f9('0x1e')](_0x2d5e3c['query'][_0x52f9('0x1e')]);_0x316fe4[_0x52f9('0x1c')]=qs[_0x52f9('0x1c')](_0x2d5e3c['query'][_0x52f9('0x1c')]);}_0x316fe4['order']=qs['sort'](_0x2d5e3c[_0x52f9('0x31')][_0x52f9('0x3b')]);_0x316fe4[_0x52f9('0x3c')]=qs[_0x52f9('0x33')](_[_0x52f9('0x3d')](_0x2d5e3c[_0x52f9('0x31')],_0x7eff1c[_0x52f9('0x33')]),_0x39642c);if(_0x2d5e3c[_0x52f9('0x31')][_0x52f9('0x3e')]){_0x316fe4[_0x52f9('0x3c')]=_[_0x52f9('0x3f')](_0x316fe4[_0x52f9('0x3c')],{'$or':_[_0x52f9('0x2d')](_0x39642c,function(_0x21a73b){if(_0x21a73b[_0x52f9('0x40')]!==_0x52f9('0x41')){var _0x3abcc1={};_0x3abcc1[_0x21a73b[_0x52f9('0x2b')]]={'$like':'%'+_0x2d5e3c[_0x52f9('0x31')][_0x52f9('0x3e')]+'%'};return _0x3abcc1;}})});}_0x316fe4=_['merge']({},_0x316fe4,_0x2d5e3c[_0x52f9('0x42')]);var _0x5ea6a6={'where':_0x316fe4[_0x52f9('0x3c')]};return db[_0x52f9('0x43')]['count'](_0x5ea6a6)[_0x52f9('0x25')](function(_0x1073ae){_0x576cdc[_0x52f9('0x1f')]=_0x1073ae;if(_0x2d5e3c[_0x52f9('0x31')]['includeAll']){_0x316fe4[_0x52f9('0x44')]=[{'all':!![]}];}return db[_0x52f9('0x43')]['findAll'](_0x316fe4);})[_0x52f9('0x25')](function(_0x43f14c){_0x576cdc['rows']=_0x43f14c;return _0x576cdc;})[_0x52f9('0x25')](respondWithFilteredResult(_0x304bf6,_0x316fe4))[_0x52f9('0x45')](handleError(_0x304bf6,null));};exports['show']=function(_0x4652b3,_0x3909ca){var _0x151d1f={'raw':!![],'where':{'id':_0x4652b3['params']['id']}},_0x4990ea={};_0x4990ea[_0x52f9('0x35')]=_[_0x52f9('0x32')](db[_0x52f9('0x43')][_0x52f9('0x2e')]);_0x4990ea['query']=_[_0x52f9('0x32')](_0x4652b3['query']);_0x4990ea['filters']=_['intersection'](_0x4990ea[_0x52f9('0x35')],_0x4990ea[_0x52f9('0x31')]);_0x151d1f[_0x52f9('0x36')]=_[_0x52f9('0x34')](_0x4990ea[_0x52f9('0x35')],qs['fields'](_0x4652b3[_0x52f9('0x31')][_0x52f9('0x37')]));_0x151d1f[_0x52f9('0x36')]=_0x151d1f[_0x52f9('0x36')]['length']?_0x151d1f[_0x52f9('0x36')]:_0x4990ea[_0x52f9('0x35')];if(_0x4652b3[_0x52f9('0x31')][_0x52f9('0x46')]){_0x151d1f[_0x52f9('0x44')]=[{'all':!![]}];}_0x151d1f=_[_0x52f9('0x3f')]({},_0x151d1f,_0x4652b3[_0x52f9('0x42')]);return db[_0x52f9('0x43')]['find'](_0x151d1f)[_0x52f9('0x25')](handleEntityNotFound(_0x3909ca,null))[_0x52f9('0x25')](respondWithResult(_0x3909ca,null))['catch'](handleError(_0x3909ca,null));};exports[_0x52f9('0x47')]=function(_0x368948,_0x3a97c2){return db['CmContactHasItem'][_0x52f9('0x47')](_0x368948[_0x52f9('0x48')],{})[_0x52f9('0x25')](function(_0xdd7255){var _0xde0793=_0x368948[_0x52f9('0x49')][_0x52f9('0x26')]({'plain':!![]});if(!_0xde0793)throw new Error(_0x52f9('0x4a'));if(_0xde0793[_0x52f9('0x4b')]===_0x52f9('0x49')){var _0x404398=_0xdd7255[_0x52f9('0x26')]({'plain':!![]});var _0x36123d=_0x52f9('0x27');return db[_0x52f9('0x4c')][_0x52f9('0x4d')]({'where':{'name':_0x36123d,'userProfileId':_0xde0793[_0x52f9('0x4e')]},'raw':!![]})[_0x52f9('0x25')](function(_0x15b3db){if(_0x15b3db&&_0x15b3db['autoAssociation']===0x0){return db['UserProfileResource'][_0x52f9('0x47')]({'name':_0x404398[_0x52f9('0x2b')],'resourceId':_0x404398['id'],'type':_0x15b3db[_0x52f9('0x2b')],'sectionId':_0x15b3db['id']},{})['then'](function(){return _0xdd7255;});}else{return _0xdd7255;}})[_0x52f9('0x45')](function(_0x4d7afe){logger[_0x52f9('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4d7afe);throw _0x4d7afe;});}return _0xdd7255;})['then'](respondWithResult(_0x3a97c2,0xc9))['catch'](handleError(_0x3a97c2,null));};exports[_0x52f9('0x23')]=function(_0x5457c5,_0x49015c){if(_0x5457c5[_0x52f9('0x48')]['id']){delete _0x5457c5[_0x52f9('0x48')]['id'];}return db[_0x52f9('0x43')]['find']({'where':{'id':_0x5457c5[_0x52f9('0x4f')]['id']}})[_0x52f9('0x25')](handleEntityNotFound(_0x49015c,null))[_0x52f9('0x25')](saveUpdates(_0x5457c5[_0x52f9('0x48')],null))[_0x52f9('0x25')](respondWithResult(_0x49015c,null))[_0x52f9('0x45')](handleError(_0x49015c,null));};exports[_0x52f9('0x24')]=function(_0x94aa11,_0x16d12b){return db[_0x52f9('0x43')][_0x52f9('0x4d')]({'where':{'id':_0x94aa11['params']['id']}})['then'](handleEntityNotFound(_0x16d12b,null))[_0x52f9('0x25')](removeEntity(_0x16d12b,null))[_0x52f9('0x45')](handleError(_0x16d12b,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index ffb5c6b..5644fd8 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 _0xc693=['./cmContactHasItem.attributes','exports','define','CmContactHasItem','util','../../config/logger','moment','rimraf'];(function(_0x4eb7ab,_0x1720ab){var _0x5e99a7=function(_0x51f96e){while(--_0x51f96e){_0x4eb7ab['push'](_0x4eb7ab['shift']());}};_0x5e99a7(++_0x1720ab);}(_0xc693,0x11c));var _0x3c69=function(_0x28b40e,_0x2c5a0a){_0x28b40e=_0x28b40e-0x0;var _0x3762=_0xc693[_0x28b40e];return _0x3762;};'use strict';var _=require('lodash');var util=require(_0x3c69('0x0'));var logger=require(_0x3c69('0x1'))('api');var moment=require(_0x3c69('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3c69('0x3'));var config=require('../../config/environment');var attributes=require(_0x3c69('0x4'));module[_0x3c69('0x5')]=function(_0xcda651,_0x159300){return _0xcda651[_0x3c69('0x6')](_0x3c69('0x7'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb68=['rimraf','./cmContactHasItem.attributes','CmContactHasItem','cm_contact_has_items','util','api','moment','bluebird','request-promise'];(function(_0x30f31c,_0x2f8ddc){var _0xcef126=function(_0x43699e){while(--_0x43699e){_0x30f31c['push'](_0x30f31c['shift']());}};_0xcef126(++_0x2f8ddc);}(_0xcb68,0x1a2));var _0x8cb6=function(_0x811622,_0x53a2ea){_0x811622=_0x811622-0x0;var _0x1d2a2e=_0xcb68[_0x811622];return _0x1d2a2e;};'use strict';var _=require('lodash');var util=require(_0x8cb6('0x0'));var logger=require('../../config/logger')(_0x8cb6('0x1'));var moment=require(_0x8cb6('0x2'));var BPromise=require(_0x8cb6('0x3'));var rp=require(_0x8cb6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8cb6('0x5'));var config=require('../../config/environment');var attributes=require(_0x8cb6('0x6'));module['exports']=function(_0x33cc19,_0x3d7a62){return _0x33cc19['define'](_0x8cb6('0x7'),attributes,{'tableName':_0x8cb6('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 38f58ba..b78d1d4 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 _0x4298=['CmContactHasItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','then','info','debug'];(function(_0x1a3c8a,_0x49a4f5){var _0x34488f=function(_0x3ea79c){while(--_0x3ea79c){_0x1a3c8a['push'](_0x1a3c8a['shift']());}};_0x34488f(++_0x49a4f5);}(_0x4298,0x119));var _0x8429=function(_0x18df8a,_0x4f98a2){_0x18df8a=_0x18df8a-0x0;var _0x363711=_0x4298[_0x18df8a];return _0x363711;};'use strict';var _=require(_0x8429('0x0'));var util=require(_0x8429('0x1'));var moment=require(_0x8429('0x2'));var BPromise=require(_0x8429('0x3'));var rs=require(_0x8429('0x4'));var fs=require('fs');var Redis=require(_0x8429('0x5'));var db=require(_0x8429('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8429('0x7'));var config=require(_0x8429('0x8'));var jayson=require(_0x8429('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2667e7,_0x370eb1,_0x2359f8){return new BPromise(function(_0x1493ef,_0x403a2c){return client['request'](_0x2667e7,_0x2359f8)[_0x8429('0xa')](function(_0x3d0eba){logger[_0x8429('0xb')]('CmContactHasItem,\x20%s,\x20%s',_0x370eb1,'request\x20sent');logger[_0x8429('0xc')](_0x8429('0xd'),_0x370eb1,_0x8429('0xe'),JSON[_0x8429('0xf')](_0x3d0eba));if(_0x3d0eba[_0x8429('0x10')]){if(_0x3d0eba[_0x8429('0x10')][_0x8429('0x11')]===0x1f4){logger[_0x8429('0x10')](_0x8429('0x12'),_0x370eb1,_0x3d0eba['error'][_0x8429('0x13')]);return _0x403a2c(_0x3d0eba[_0x8429('0x10')][_0x8429('0x13')]);}logger[_0x8429('0x10')](_0x8429('0x12'),_0x370eb1,_0x3d0eba[_0x8429('0x10')][_0x8429('0x13')]);return _0x1493ef(_0x3d0eba[_0x8429('0x10')][_0x8429('0x13')]);}else{logger[_0x8429('0xb')](_0x8429('0x12'),_0x370eb1,_0x8429('0xe'));_0x1493ef(_0x3d0eba['result'][_0x8429('0x13')]);}})[_0x8429('0x14')](function(_0xe4bc37){logger['error'](_0x8429('0x12'),_0x370eb1,_0xe4bc37);_0x403a2c(_0xe4bc37);});});} \ No newline at end of file +var _0x9e39=['request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','CmContactHasItem,\x20%s,\x20%s'];(function(_0x10c930,_0x49d445){var _0x4f1440=function(_0x1ad327){while(--_0x1ad327){_0x10c930['push'](_0x10c930['shift']());}};_0x4f1440(++_0x49d445);}(_0x9e39,0x159));var _0x99e3=function(_0x995124,_0x52bfec){_0x995124=_0x995124-0x0;var _0x114a81=_0x9e39[_0x995124];return _0x114a81;};'use strict';var _=require(_0x99e3('0x0'));var util=require('util');var moment=require(_0x99e3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x99e3('0x2'))['db'];var utils=require(_0x99e3('0x3'));var logger=require(_0x99e3('0x4'))('rpc');var config=require(_0x99e3('0x5'));var jayson=require(_0x99e3('0x6'));var client=jayson[_0x99e3('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f0f86,_0x2ab7b4,_0x19b2e5){return new BPromise(function(_0x58e8f6,_0x5d3206){return client[_0x99e3('0x8')](_0x5f0f86,_0x19b2e5)[_0x99e3('0x9')](function(_0x26db52){logger[_0x99e3('0xa')](_0x99e3('0xb'),_0x2ab7b4,_0x99e3('0xc'));logger[_0x99e3('0xd')](_0x99e3('0xe'),_0x2ab7b4,_0x99e3('0xc'),JSON[_0x99e3('0xf')](_0x26db52));if(_0x26db52[_0x99e3('0x10')]){if(_0x26db52[_0x99e3('0x10')][_0x99e3('0x11')]===0x1f4){logger[_0x99e3('0x10')](_0x99e3('0xb'),_0x2ab7b4,_0x26db52[_0x99e3('0x10')]['message']);return _0x5d3206(_0x26db52[_0x99e3('0x10')][_0x99e3('0x12')]);}logger[_0x99e3('0x10')](_0x99e3('0xb'),_0x2ab7b4,_0x26db52[_0x99e3('0x10')]['message']);return _0x58e8f6(_0x26db52[_0x99e3('0x10')][_0x99e3('0x12')]);}else{logger[_0x99e3('0xa')](_0x99e3('0xb'),_0x2ab7b4,_0x99e3('0xc'));_0x58e8f6(_0x26db52[_0x99e3('0x13')]['message']);}})[_0x99e3('0x14')](function(_0x4a4516){logger[_0x99e3('0x10')](_0x99e3('0xb'),_0x2ab7b4,_0x4a4516);_0x5d3206(_0x4a4516);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 1969169..4a19b38 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 _0x2171=['post','create','put','update','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show'];(function(_0x4358f5,_0x5b1ac6){var _0x4d8104=function(_0x1d4aee){while(--_0x1d4aee){_0x4358f5['push'](_0x4358f5['shift']());}};_0x4d8104(++_0x5b1ac6);}(_0x2171,0x15c));var _0x1217=function(_0x1fa3f4,_0x56868e){_0x1fa3f4=_0x1fa3f4-0x0;var _0x491768=_0x2171[_0x1fa3f4];return _0x491768;};'use strict';var multer=require(_0x1217('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1217('0x1'));var express=require(_0x1217('0x2'));var router=express[_0x1217('0x3')]();var fs_extra=require(_0x1217('0x4'));var auth=require(_0x1217('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1217('0x6'));var controller=require('./cmContactHasItem.controller');router['get']('/',auth[_0x1217('0x7')](),controller[_0x1217('0x8')]);router[_0x1217('0x9')](_0x1217('0xa'),auth['isAuthenticated'](),controller[_0x1217('0xb')]);router[_0x1217('0xc')]('/',auth['isAuthenticated'](),controller[_0x1217('0xd')]);router[_0x1217('0xe')](_0x1217('0xa'),auth[_0x1217('0x7')](),controller[_0x1217('0xf')]);router['delete'](_0x1217('0xa'),auth[_0x1217('0x7')](),controller[_0x1217('0x10')]);module[_0x1217('0x11')]=router; \ No newline at end of file +var _0x9895=['isAuthenticated','index','/:id','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9895,0x113));var _0x5989=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9895[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x5989('0x0'));var util=require('util');var path=require(_0x5989('0x1'));var timeout=require(_0x5989('0x2'));var express=require(_0x5989('0x3'));var router=express[_0x5989('0x4')]();var fs_extra=require(_0x5989('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5989('0x6'));var config=require(_0x5989('0x7'));var controller=require(_0x5989('0x8'));router[_0x5989('0x9')]('/',auth[_0x5989('0xa')](),controller[_0x5989('0xb')]);router['get'](_0x5989('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x5989('0xd')]('/',auth[_0x5989('0xa')](),controller[_0x5989('0xe')]);router['put']('/:id',auth[_0x5989('0xa')](),controller[_0x5989('0xf')]);router[_0x5989('0x10')](_0x5989('0xc'),auth['isAuthenticated'](),controller[_0x5989('0x11')]);module[_0x5989('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 936f2d0..a971370 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 _0x76d8=['BOOLEAN','ENUM','voice','lodash','exports','getDataValue','alias','STRING','setDataValue','name','TEXT','long','type','select','parse','values','isArray','stringify'];(function(_0xb1c5d5,_0x3a2038){var _0x3766dc=function(_0x12344b){while(--_0x12344b){_0xb1c5d5['push'](_0xb1c5d5['shift']());}};_0x3766dc(++_0x3a2038);}(_0x76d8,0x123));var _0x876d=function(_0x154c95,_0x27e851){_0x154c95=_0x154c95-0x0;var _0x464376=_0x76d8[_0x154c95];return _0x464376;};'use strict';var Sequelize=require('sequelize');var _=require(_0x876d('0x0'));module[_0x876d('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1a8121){return this[_0x876d('0x2')](_0x876d('0x3'));}},'alias':{'type':Sequelize[_0x876d('0x4')],'allowNull':![],'set':function(_0x173946){this[_0x876d('0x5')](_0x876d('0x3'),_0x173946?_0x173946:this['getDataValue'](_0x876d('0x6')));}},'type':{'type':Sequelize[_0x876d('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x876d('0x7')](_0x876d('0x8')),'get':function(){if(this['getDataValue'](_0x876d('0x9'))===_0x876d('0xa')){return JSON[_0x876d('0xb')](this[_0x876d('0x2')](_0x876d('0xc')));}else{return this[_0x876d('0x2')]('values');}},'set':function(_0xa9844a){if(Array[_0x876d('0xd')](_0xa9844a)){this['setDataValue'](_0x876d('0xc'),JSON[_0x876d('0xe')](_0xa9844a));}else{this['setDataValue']('values',_0xa9844a);}}},'required':{'type':Sequelize[_0x876d('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x876d('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x876d('0x10')](_0x876d('0x11'))}}; \ No newline at end of file +var _0x743d=['long','select','values','stringify','BOOLEAN','ENUM','voice','exports','VIRTUAL','STRING','setDataValue','alias','getDataValue','name','TEXT'];(function(_0x3a7634,_0x2db384){var _0x23bbe9=function(_0x226734){while(--_0x226734){_0x3a7634['push'](_0x3a7634['shift']());}};_0x23bbe9(++_0x2db384);}(_0x743d,0x18d));var _0xd743=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x743d[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0xd743('0x0')]={'name':{'type':Sequelize[_0xd743('0x1')],'get':function(_0x225ecd){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0xd743('0x2')],'allowNull':![],'set':function(_0x511909){this[_0xd743('0x3')](_0xd743('0x4'),_0x511909?_0x511909:this[_0xd743('0x5')](_0xd743('0x6')));}},'type':{'type':Sequelize[_0xd743('0x2')],'allowNull':![]},'values':{'type':Sequelize[_0xd743('0x7')](_0xd743('0x8')),'get':function(){if(this[_0xd743('0x5')]('type')===_0xd743('0x9')){return JSON['parse'](this['getDataValue'](_0xd743('0xa')));}else{return this[_0xd743('0x5')](_0xd743('0xa'));}},'set':function(_0x5d11eb){if(Array['isArray'](_0x5d11eb)){this['setDataValue'](_0xd743('0xa'),JSON[_0xd743('0xb')](_0x5d11eb));}else{this[_0xd743('0x3')](_0xd743('0xa'),_0x5d11eb);}}},'required':{'type':Sequelize[_0xd743('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xd743('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xd743('0xd')](_0xd743('0xe'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 0b991a5..f1ebff5 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 _0x7e67=['includeAll','include','rows','catch','show','params','body','find','create','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','status','end','json','undefined','limit','count','offset','set','save','update','then','destroy','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options'];(function(_0xce7f45,_0x3576af){var _0x246734=function(_0x1a63f3){while(--_0x1a63f3){_0xce7f45['push'](_0xce7f45['shift']());}};_0x246734(++_0x3576af);}(_0x7e67,0x6c));var _0x77e6=function(_0xce7822,_0x5d4996){_0xce7822=_0xce7822-0x0;var _0x1a24a7=_0x7e67[_0xce7822];return _0x1a24a7;};'use strict';var emlformat=require(_0x77e6('0x0'));var rimraf=require(_0x77e6('0x1'));var zipdir=require(_0x77e6('0x2'));var jsonpatch=require(_0x77e6('0x3'));var rp=require(_0x77e6('0x4'));var moment=require(_0x77e6('0x5'));var BPromise=require(_0x77e6('0x6'));var Mustache=require(_0x77e6('0x7'));var util=require('util');var path=require(_0x77e6('0x8'));var sox=require(_0x77e6('0x9'));var csv=require(_0x77e6('0xa'));var ejs=require(_0x77e6('0xb'));var fs=require('fs');var fs_extra=require(_0x77e6('0xc'));var _=require(_0x77e6('0xd'));var squel=require(_0x77e6('0xe'));var crypto=require(_0x77e6('0xf'));var jsforce=require(_0x77e6('0x10'));var deskjs=require(_0x77e6('0x11'));var toCsv=require(_0x77e6('0xa'));var querystring=require(_0x77e6('0x12'));var Papa=require('papaparse');var Redis=require(_0x77e6('0x13'));var authService=require(_0x77e6('0x14'));var qs=require(_0x77e6('0x15'));var as=require(_0x77e6('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x77e6('0x17'))(_0x77e6('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x77e6('0x19'))['db'];function respondWithStatusCode(_0x399c02,_0x7d6b3f){_0x7d6b3f=_0x7d6b3f||0xcc;return function(_0x9b1ddd){if(_0x9b1ddd){return _0x399c02['sendStatus'](_0x7d6b3f);}return _0x399c02[_0x77e6('0x1a')](_0x7d6b3f)[_0x77e6('0x1b')]();};}function respondWithResult(_0x1ced72,_0x237352){_0x237352=_0x237352||0xc8;return function(_0x4cef15){if(_0x4cef15){return _0x1ced72[_0x77e6('0x1a')](_0x237352)[_0x77e6('0x1c')](_0x4cef15);}};}function respondWithFilteredResult(_0x43647a,_0x5baffd){return function(_0x1ae6c1){if(_0x1ae6c1){var _0x45c24d=typeof _0x5baffd['offset']===_0x77e6('0x1d')&&typeof _0x5baffd[_0x77e6('0x1e')]===_0x77e6('0x1d');var _0x3cf058=_0x1ae6c1[_0x77e6('0x1f')];var _0x13b325=_0x45c24d?0x0:_0x5baffd['offset'];var _0x2183f2=_0x45c24d?_0x1ae6c1[_0x77e6('0x1f')]:_0x5baffd[_0x77e6('0x20')]+_0x5baffd['limit'];var _0x5979dc;if(_0x2183f2>=_0x3cf058){_0x2183f2=_0x3cf058;_0x5979dc=0xc8;}else{_0x5979dc=0xce;}_0x43647a[_0x77e6('0x1a')](_0x5979dc);return _0x43647a[_0x77e6('0x21')]('Content-Range',_0x13b325+'-'+_0x2183f2+'/'+_0x3cf058)[_0x77e6('0x1c')](_0x1ae6c1);}return null;};}function patchUpdates(_0x1d7457){return function(_0x43525f){try{jsonpatch['apply'](_0x43525f,_0x1d7457,!![]);}catch(_0x175aa0){return BPromise['reject'](_0x175aa0);}return _0x43525f[_0x77e6('0x22')]();};}function saveUpdates(_0x5580ba,_0x697767){return function(_0x231d2c){if(_0x231d2c){return _0x231d2c[_0x77e6('0x23')](_0x5580ba)[_0x77e6('0x24')](function(_0x2236fc){return _0x2236fc;});}return null;};}function removeEntity(_0x2f0ef3,_0x46915f){return function(_0x9a2d82){if(_0x9a2d82){return _0x9a2d82[_0x77e6('0x25')]()[_0x77e6('0x24')](function(){_0x2f0ef3[_0x77e6('0x1a')](0xcc)[_0x77e6('0x1b')]();});}};}function handleEntityNotFound(_0x3dd6cb,_0x34a75f){return function(_0x3548f3){if(!_0x3548f3){_0x3dd6cb['sendStatus'](0x194);}return _0x3548f3;};}function handleError(_0x44f34d,_0x19dff9){_0x19dff9=_0x19dff9||0x1f4;return function(_0x1a2413){logger[_0x77e6('0x26')](_0x1a2413[_0x77e6('0x27')]);if(_0x1a2413[_0x77e6('0x28')]){delete _0x1a2413['name'];}_0x44f34d[_0x77e6('0x1a')](_0x19dff9)[_0x77e6('0x29')](_0x1a2413);};}exports[_0x77e6('0x2a')]=function(_0x26af5d,_0x31b87c){var _0x3c7f31={},_0x32d2c5={},_0x49af7f={'count':0x0,'rows':[]};var _0x485f37=_[_0x77e6('0x2b')](db[_0x77e6('0x2c')][_0x77e6('0x2d')],function(_0x44bddb){return{'name':_0x44bddb[_0x77e6('0x2e')],'type':_0x44bddb[_0x77e6('0x2f')][_0x77e6('0x30')]};});_0x32d2c5['model']=_['differenceBy'](_[_0x77e6('0x2b')](_0x485f37,_0x77e6('0x28')),[_0x77e6('0x28')]);_0x32d2c5[_0x77e6('0x31')]=_[_0x77e6('0x32')](_0x26af5d[_0x77e6('0x31')]);_0x32d2c5[_0x77e6('0x33')]=_[_0x77e6('0x34')](_0x32d2c5[_0x77e6('0x35')],_0x32d2c5[_0x77e6('0x31')]);_0x3c7f31[_0x77e6('0x36')]=_[_0x77e6('0x34')](_0x32d2c5[_0x77e6('0x35')],qs['fields'](_0x26af5d[_0x77e6('0x31')][_0x77e6('0x37')]));_0x3c7f31[_0x77e6('0x36')]=_0x3c7f31[_0x77e6('0x36')][_0x77e6('0x38')]?_0x3c7f31[_0x77e6('0x36')]:_0x32d2c5[_0x77e6('0x35')];if(!_0x26af5d['query'][_0x77e6('0x39')](_0x77e6('0x3a'))){_0x3c7f31[_0x77e6('0x1e')]=qs[_0x77e6('0x1e')](_0x26af5d['query'][_0x77e6('0x1e')]);_0x3c7f31['offset']=qs['offset'](_0x26af5d['query'][_0x77e6('0x20')]);}_0x3c7f31[_0x77e6('0x3b')]=qs[_0x77e6('0x3c')](_0x26af5d[_0x77e6('0x31')]['sort']);_0x3c7f31['where']=qs['filters'](_['pick'](_0x26af5d[_0x77e6('0x31')],_0x32d2c5['filters']),_0x485f37);if(_0x26af5d[_0x77e6('0x31')][_0x77e6('0x3d')]){_0x3c7f31[_0x77e6('0x3e')]=_[_0x77e6('0x3f')](_0x3c7f31[_0x77e6('0x3e')],{'$or':_[_0x77e6('0x2b')](_0x485f37,function(_0x2c9506){if(_0x2c9506['type']!==_0x77e6('0x40')){var _0x195941={};_0x195941[_0x2c9506[_0x77e6('0x28')]]={'$like':'%'+_0x26af5d[_0x77e6('0x31')]['filter']+'%'};return _0x195941;}})});}_0x3c7f31=_[_0x77e6('0x3f')]({},_0x3c7f31,_0x26af5d[_0x77e6('0x41')]);var _0x3b42be={'where':_0x3c7f31['where']};return db[_0x77e6('0x2c')][_0x77e6('0x1f')](_0x3b42be)['then'](function(_0xe699e3){_0x49af7f[_0x77e6('0x1f')]=_0xe699e3;if(_0x26af5d[_0x77e6('0x31')][_0x77e6('0x42')]){_0x3c7f31[_0x77e6('0x43')]=[{'all':!![]}];}return db[_0x77e6('0x2c')]['findAll'](_0x3c7f31);})[_0x77e6('0x24')](function(_0x527404){_0x49af7f[_0x77e6('0x44')]=_0x527404;return _0x49af7f;})[_0x77e6('0x24')](respondWithFilteredResult(_0x31b87c,_0x3c7f31))[_0x77e6('0x45')](handleError(_0x31b87c,null));};exports[_0x77e6('0x46')]=function(_0x160e6d,_0xa7b006){var _0x5b3839={'raw':!![],'where':{'id':_0x160e6d[_0x77e6('0x47')]['id']}},_0x1a1d1c={};_0x1a1d1c[_0x77e6('0x35')]=_[_0x77e6('0x32')](db[_0x77e6('0x2c')][_0x77e6('0x2d')]);_0x1a1d1c[_0x77e6('0x31')]=_['keys'](_0x160e6d['query']);_0x1a1d1c['filters']=_['intersection'](_0x1a1d1c[_0x77e6('0x35')],_0x1a1d1c[_0x77e6('0x31')]);_0x5b3839[_0x77e6('0x36')]=_['intersection'](_0x1a1d1c[_0x77e6('0x35')],qs[_0x77e6('0x37')](_0x160e6d[_0x77e6('0x31')][_0x77e6('0x37')]));_0x5b3839[_0x77e6('0x36')]=_0x5b3839['attributes'][_0x77e6('0x38')]?_0x5b3839[_0x77e6('0x36')]:_0x1a1d1c[_0x77e6('0x35')];if(_0x160e6d[_0x77e6('0x31')][_0x77e6('0x42')]){_0x5b3839['include']=[{'all':!![]}];}_0x5b3839=_['merge']({},_0x5b3839,_0x160e6d[_0x77e6('0x41')]);return db[_0x77e6('0x2c')]['find'](_0x5b3839)[_0x77e6('0x24')](handleEntityNotFound(_0xa7b006,null))[_0x77e6('0x24')](respondWithResult(_0xa7b006,null))[_0x77e6('0x45')](handleError(_0xa7b006,null));};exports[_0x77e6('0x23')]=function(_0x40f75b,_0x1d70c8){if(_0x40f75b['body']['id']){delete _0x40f75b[_0x77e6('0x48')]['id'];}return db[_0x77e6('0x2c')]['find']({'where':{'id':_0x40f75b['params']['id']}})[_0x77e6('0x24')](handleEntityNotFound(_0x1d70c8,null))[_0x77e6('0x24')](saveUpdates(_0x40f75b[_0x77e6('0x48')],null))[_0x77e6('0x24')](respondWithResult(_0x1d70c8,null))[_0x77e6('0x45')](handleError(_0x1d70c8,null));};exports[_0x77e6('0x25')]=function(_0x3e732b,_0x4d4cd1){return db['CmCustomField'][_0x77e6('0x49')]({'where':{'id':_0x3e732b[_0x77e6('0x47')]['id']}})['then'](handleEntityNotFound(_0x4d4cd1,null))[_0x77e6('0x24')](removeEntity(_0x4d4cd1,null))['catch'](handleError(_0x4d4cd1,null));};exports[_0x77e6('0x4a')]=function(_0x64f9ec,_0x46dae6){var _0x59aa2e;return db['sequelize'][_0x77e6('0x4b')](function(_0x4e0c9){return db[_0x77e6('0x2c')][_0x77e6('0x4a')](_0x64f9ec[_0x77e6('0x48')],{'transaction':_0x4e0c9})[_0x77e6('0x24')](function(_0x57a32e){_0x59aa2e=_0x57a32e;var _0x43fcb9={'type':db[_0x77e6('0x4c')][_0x77e6('0x4d')],'transaction':_0x4e0c9};switch(_0x64f9ec[_0x77e6('0x48')][_0x77e6('0x2f')]){case _0x77e6('0x4e'):_0x43fcb9[_0x77e6('0x2f')]=db['Sequelize']['TEXT'];break;case _0x77e6('0x4f'):_0x43fcb9['type']=db['Sequelize'][_0x77e6('0x50')];break;case _0x77e6('0x51'):_0x43fcb9[_0x77e6('0x2f')]=db['Sequelize'][_0x77e6('0x52')];_0x43fcb9[_0x77e6('0x53')]=![];break;default:}return db['sequelize']['queryInterface'][_0x77e6('0x54')](_0x77e6('0x55'),util['format'](_0x77e6('0x56'),_0x59aa2e['id']),_0x43fcb9);})[_0x77e6('0x24')](function(){return _0x59aa2e;});})[_0x77e6('0x24')](respondWithResult(_0x46dae6,0xc9))[_0x77e6('0x45')](handleError(_0x46dae6,null));}; \ No newline at end of file +var _0xdc60=['number','switch','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','CmCustomField','fieldName','key','model','differenceBy','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','rows','catch','params','keys','rawAttributes','length','include','update','body','find','create','sequelize','Sequelize','text'];(function(_0x56dcec,_0x5c0797){var _0x2ab264=function(_0x5ee542){while(--_0x5ee542){_0x56dcec['push'](_0x56dcec['shift']());}};_0x2ab264(++_0x5c0797);}(_0xdc60,0x168));var _0x0dc6=function(_0x47f0b6,_0x3daf1a){_0x47f0b6=_0x47f0b6-0x0;var _0x53c469=_0xdc60[_0x47f0b6];return _0x53c469;};'use strict';var emlformat=require(_0x0dc6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0dc6('0x1'));var jsonpatch=require(_0x0dc6('0x2'));var rp=require(_0x0dc6('0x3'));var moment=require('moment');var BPromise=require(_0x0dc6('0x4'));var Mustache=require(_0x0dc6('0x5'));var util=require(_0x0dc6('0x6'));var path=require(_0x0dc6('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0dc6('0x8'));var fs=require('fs');var fs_extra=require(_0x0dc6('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0dc6('0xa'));var jsforce=require(_0x0dc6('0xb'));var deskjs=require(_0x0dc6('0xc'));var toCsv=require(_0x0dc6('0xd'));var querystring=require('querystring');var Papa=require(_0x0dc6('0xe'));var Redis=require(_0x0dc6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0dc6('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0dc6('0x11'));var logger=require(_0x0dc6('0x12'))(_0x0dc6('0x13'));var utils=require(_0x0dc6('0x14'));var config=require(_0x0dc6('0x15'));var licenseUtil=require(_0x0dc6('0x16'));var db=require(_0x0dc6('0x17'))['db'];function respondWithStatusCode(_0x14a3f7,_0x54f57c){_0x54f57c=_0x54f57c||0xcc;return function(_0x9991a3){if(_0x9991a3){return _0x14a3f7[_0x0dc6('0x18')](_0x54f57c);}return _0x14a3f7['status'](_0x54f57c)[_0x0dc6('0x19')]();};}function respondWithResult(_0x1b77ae,_0x47983a){_0x47983a=_0x47983a||0xc8;return function(_0x87b1ef){if(_0x87b1ef){return _0x1b77ae[_0x0dc6('0x1a')](_0x47983a)[_0x0dc6('0x1b')](_0x87b1ef);}};}function respondWithFilteredResult(_0x147fd7,_0x545752){return function(_0x23e8c0){if(_0x23e8c0){var _0x441ae8=typeof _0x545752[_0x0dc6('0x1c')]==='undefined'&&typeof _0x545752['limit']===_0x0dc6('0x1d');var _0x59f6bd=_0x23e8c0[_0x0dc6('0x1e')];var _0x95ba87=_0x441ae8?0x0:_0x545752[_0x0dc6('0x1c')];var _0x5f54ed=_0x441ae8?_0x23e8c0[_0x0dc6('0x1e')]:_0x545752[_0x0dc6('0x1c')]+_0x545752['limit'];var _0xd41ab2;if(_0x5f54ed>=_0x59f6bd){_0x5f54ed=_0x59f6bd;_0xd41ab2=0xc8;}else{_0xd41ab2=0xce;}_0x147fd7[_0x0dc6('0x1a')](_0xd41ab2);return _0x147fd7[_0x0dc6('0x1f')](_0x0dc6('0x20'),_0x95ba87+'-'+_0x5f54ed+'/'+_0x59f6bd)['json'](_0x23e8c0);}return null;};}function patchUpdates(_0x508902){return function(_0x5f4000){try{jsonpatch[_0x0dc6('0x21')](_0x5f4000,_0x508902,!![]);}catch(_0x49651f){return BPromise['reject'](_0x49651f);}return _0x5f4000[_0x0dc6('0x22')]();};}function saveUpdates(_0x175e55,_0x2bcbd1){return function(_0x21b7a5){if(_0x21b7a5){return _0x21b7a5['update'](_0x175e55)[_0x0dc6('0x23')](function(_0x41c81d){return _0x41c81d;});}return null;};}function removeEntity(_0x3cea51,_0x4d2d9e){return function(_0x5b54ea){if(_0x5b54ea){return _0x5b54ea[_0x0dc6('0x24')]()[_0x0dc6('0x23')](function(){_0x3cea51[_0x0dc6('0x1a')](0xcc)[_0x0dc6('0x19')]();});}};}function handleEntityNotFound(_0xe77b5a,_0x7424d4){return function(_0x123936){if(!_0x123936){_0xe77b5a[_0x0dc6('0x18')](0x194);}return _0x123936;};}function handleError(_0x4c2547,_0xa0443b){_0xa0443b=_0xa0443b||0x1f4;return function(_0x4f63e4){logger[_0x0dc6('0x25')](_0x4f63e4[_0x0dc6('0x26')]);if(_0x4f63e4[_0x0dc6('0x27')]){delete _0x4f63e4[_0x0dc6('0x27')];}_0x4c2547['status'](_0xa0443b)[_0x0dc6('0x28')](_0x4f63e4);};}exports[_0x0dc6('0x29')]=function(_0x26df36,_0x519e3f){var _0x5f3986={},_0x5c9a77={},_0x42963b={'count':0x0,'rows':[]};var _0x11f1b8=_[_0x0dc6('0x2a')](db[_0x0dc6('0x2b')]['rawAttributes'],function(_0x2897ba){return{'name':_0x2897ba[_0x0dc6('0x2c')],'type':_0x2897ba['type'][_0x0dc6('0x2d')]};});_0x5c9a77[_0x0dc6('0x2e')]=_[_0x0dc6('0x2f')](_[_0x0dc6('0x2a')](_0x11f1b8,_0x0dc6('0x27')),[_0x0dc6('0x27')]);_0x5c9a77[_0x0dc6('0x30')]=_['keys'](_0x26df36['query']);_0x5c9a77[_0x0dc6('0x31')]=_['intersection'](_0x5c9a77['model'],_0x5c9a77[_0x0dc6('0x30')]);_0x5f3986['attributes']=_[_0x0dc6('0x32')](_0x5c9a77[_0x0dc6('0x2e')],qs[_0x0dc6('0x33')](_0x26df36[_0x0dc6('0x30')]['fields']));_0x5f3986[_0x0dc6('0x34')]=_0x5f3986['attributes']['length']?_0x5f3986[_0x0dc6('0x34')]:_0x5c9a77[_0x0dc6('0x2e')];if(!_0x26df36[_0x0dc6('0x30')][_0x0dc6('0x35')](_0x0dc6('0x36'))){_0x5f3986[_0x0dc6('0x37')]=qs['limit'](_0x26df36[_0x0dc6('0x30')][_0x0dc6('0x37')]);_0x5f3986[_0x0dc6('0x1c')]=qs[_0x0dc6('0x1c')](_0x26df36[_0x0dc6('0x30')]['offset']);}_0x5f3986[_0x0dc6('0x38')]=qs[_0x0dc6('0x39')](_0x26df36[_0x0dc6('0x30')][_0x0dc6('0x39')]);_0x5f3986[_0x0dc6('0x3a')]=qs[_0x0dc6('0x31')](_[_0x0dc6('0x3b')](_0x26df36[_0x0dc6('0x30')],_0x5c9a77['filters']),_0x11f1b8);if(_0x26df36[_0x0dc6('0x30')]['filter']){_0x5f3986['where']=_['merge'](_0x5f3986['where'],{'$or':_[_0x0dc6('0x2a')](_0x11f1b8,function(_0x32ca8b){if(_0x32ca8b[_0x0dc6('0x3c')]!==_0x0dc6('0x3d')){var _0x4450f9={};_0x4450f9[_0x32ca8b['name']]={'$like':'%'+_0x26df36[_0x0dc6('0x30')][_0x0dc6('0x3e')]+'%'};return _0x4450f9;}})});}_0x5f3986=_[_0x0dc6('0x3f')]({},_0x5f3986,_0x26df36[_0x0dc6('0x40')]);var _0xafd0af={'where':_0x5f3986[_0x0dc6('0x3a')]};return db[_0x0dc6('0x2b')][_0x0dc6('0x1e')](_0xafd0af)['then'](function(_0x455b9b){_0x42963b['count']=_0x455b9b;if(_0x26df36['query'][_0x0dc6('0x41')]){_0x5f3986['include']=[{'all':!![]}];}return db[_0x0dc6('0x2b')]['findAll'](_0x5f3986);})[_0x0dc6('0x23')](function(_0x4072c4){_0x42963b[_0x0dc6('0x42')]=_0x4072c4;return _0x42963b;})['then'](respondWithFilteredResult(_0x519e3f,_0x5f3986))[_0x0dc6('0x43')](handleError(_0x519e3f,null));};exports['show']=function(_0x25d35b,_0x2d94fa){var _0x378410={'raw':!![],'where':{'id':_0x25d35b[_0x0dc6('0x44')]['id']}},_0x11d78b={};_0x11d78b[_0x0dc6('0x2e')]=_[_0x0dc6('0x45')](db['CmCustomField'][_0x0dc6('0x46')]);_0x11d78b[_0x0dc6('0x30')]=_[_0x0dc6('0x45')](_0x25d35b[_0x0dc6('0x30')]);_0x11d78b[_0x0dc6('0x31')]=_[_0x0dc6('0x32')](_0x11d78b[_0x0dc6('0x2e')],_0x11d78b[_0x0dc6('0x30')]);_0x378410[_0x0dc6('0x34')]=_['intersection'](_0x11d78b[_0x0dc6('0x2e')],qs['fields'](_0x25d35b[_0x0dc6('0x30')]['fields']));_0x378410[_0x0dc6('0x34')]=_0x378410['attributes'][_0x0dc6('0x47')]?_0x378410[_0x0dc6('0x34')]:_0x11d78b[_0x0dc6('0x2e')];if(_0x25d35b[_0x0dc6('0x30')][_0x0dc6('0x41')]){_0x378410[_0x0dc6('0x48')]=[{'all':!![]}];}_0x378410=_[_0x0dc6('0x3f')]({},_0x378410,_0x25d35b[_0x0dc6('0x40')]);return db[_0x0dc6('0x2b')]['find'](_0x378410)[_0x0dc6('0x23')](handleEntityNotFound(_0x2d94fa,null))['then'](respondWithResult(_0x2d94fa,null))[_0x0dc6('0x43')](handleError(_0x2d94fa,null));};exports[_0x0dc6('0x49')]=function(_0x51865c,_0x204ef5){if(_0x51865c[_0x0dc6('0x4a')]['id']){delete _0x51865c['body']['id'];}return db[_0x0dc6('0x2b')][_0x0dc6('0x4b')]({'where':{'id':_0x51865c['params']['id']}})['then'](handleEntityNotFound(_0x204ef5,null))['then'](saveUpdates(_0x51865c[_0x0dc6('0x4a')],null))[_0x0dc6('0x23')](respondWithResult(_0x204ef5,null))[_0x0dc6('0x43')](handleError(_0x204ef5,null));};exports[_0x0dc6('0x24')]=function(_0x467286,_0x333fb3){return db[_0x0dc6('0x2b')]['find']({'where':{'id':_0x467286[_0x0dc6('0x44')]['id']}})[_0x0dc6('0x23')](handleEntityNotFound(_0x333fb3,null))['then'](removeEntity(_0x333fb3,null))['catch'](handleError(_0x333fb3,null));};exports[_0x0dc6('0x4c')]=function(_0x924492,_0x192930){var _0x387c91;return db[_0x0dc6('0x4d')]['transaction'](function(_0x2c761b){return db['CmCustomField']['create'](_0x924492['body'],{'transaction':_0x2c761b})[_0x0dc6('0x23')](function(_0x3ffac6){_0x387c91=_0x3ffac6;var _0x34c570={'type':db[_0x0dc6('0x4e')]['TEXT'],'transaction':_0x2c761b};switch(_0x924492[_0x0dc6('0x4a')][_0x0dc6('0x3c')]){case _0x0dc6('0x4f'):_0x34c570[_0x0dc6('0x3c')]=db['Sequelize']['TEXT'];break;case _0x0dc6('0x50'):_0x34c570[_0x0dc6('0x3c')]=db['Sequelize']['INTEGER'];break;case _0x0dc6('0x51'):_0x34c570[_0x0dc6('0x3c')]=db['Sequelize']['BOOLEAN'];_0x34c570[_0x0dc6('0x52')]=![];break;default:}return db[_0x0dc6('0x4d')][_0x0dc6('0x53')][_0x0dc6('0x54')](_0x0dc6('0x55'),util[_0x0dc6('0x56')](_0x0dc6('0x57'),_0x387c91['id']),_0x34c570);})[_0x0dc6('0x23')](function(){return _0x387c91;});})['then'](respondWithResult(_0x192930,0xc9))['catch'](handleError(_0x192930,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index c813e96..883fb3b 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 _0xbf59=['moment','bluebird','rimraf','../../config/environment','./cmCustomField.attributes','exports','cm_custom_fields','lodash','util','../../config/logger','api'];(function(_0x17c39d,_0x5dcc31){var _0x84e339=function(_0x1e756b){while(--_0x1e756b){_0x17c39d['push'](_0x17c39d['shift']());}};_0x84e339(++_0x5dcc31);}(_0xbf59,0x15c));var _0x9bf5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf59[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9bf5('0x0'));var util=require(_0x9bf5('0x1'));var logger=require(_0x9bf5('0x2'))(_0x9bf5('0x3'));var moment=require(_0x9bf5('0x4'));var BPromise=require(_0x9bf5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9bf5('0x6'));var config=require(_0x9bf5('0x7'));var attributes=require(_0x9bf5('0x8'));module[_0x9bf5('0x9')]=function(_0x37f26e,_0x2199f3){return _0x37f26e['define']('CmCustomField',attributes,{'tableName':_0x9bf5('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3779=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','CmCustomField','cm_custom_fields'];(function(_0x398294,_0x5ceb9d){var _0x2a872d=function(_0x390883){while(--_0x390883){_0x398294['push'](_0x398294['shift']());}};_0x2a872d(++_0x5ceb9d);}(_0x3779,0xf0));var _0x9377=function(_0x39a04c,_0x2b4002){_0x39a04c=_0x39a04c-0x0;var _0x580cb0=_0x3779[_0x39a04c];return _0x580cb0;};'use strict';var _=require(_0x9377('0x0'));var util=require('util');var logger=require(_0x9377('0x1'))(_0x9377('0x2'));var moment=require('moment');var BPromise=require(_0x9377('0x3'));var rp=require(_0x9377('0x4'));var fs=require('fs');var path=require(_0x9377('0x5'));var rimraf=require(_0x9377('0x6'));var config=require(_0x9377('0x7'));var attributes=require(_0x9377('0x8'));module[_0x9377('0x9')]=function(_0xc023c7,_0x10af85){return _0xc023c7['define'](_0x9377('0xa'),attributes,{'tableName':_0x9377('0xb'),'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 c617853..c66cad9 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 _0x24d6=['request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s'];(function(_0x192772,_0x100b16){var _0x2b50bd=function(_0x3cbf90){while(--_0x3cbf90){_0x192772['push'](_0x192772['shift']());}};_0x2b50bd(++_0x100b16);}(_0x24d6,0xee));var _0x624d=function(_0x2675da,_0x5a250e){_0x2675da=_0x2675da-0x0;var _0x5e6153=_0x24d6[_0x2675da];return _0x5e6153;};'use strict';var _=require('lodash');var util=require(_0x624d('0x0'));var moment=require(_0x624d('0x1'));var BPromise=require(_0x624d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x624d('0x3'));var db=require(_0x624d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x624d('0x5'))('rpc');var config=require(_0x624d('0x6'));var jayson=require(_0x624d('0x7'));var client=jayson[_0x624d('0x8')][_0x624d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d5639,_0x48f00a,_0x1b0a05){return new BPromise(function(_0x2608db,_0x577005){return client[_0x624d('0xa')](_0x2d5639,_0x1b0a05)[_0x624d('0xb')](function(_0x29a955){logger[_0x624d('0xc')](_0x624d('0xd'),_0x48f00a,_0x624d('0xe'));logger['debug'](_0x624d('0xf'),_0x48f00a,'request\x20sent',JSON[_0x624d('0x10')](_0x29a955));if(_0x29a955['error']){if(_0x29a955['error'][_0x624d('0x11')]===0x1f4){logger[_0x624d('0x12')](_0x624d('0xd'),_0x48f00a,_0x29a955['error'][_0x624d('0x13')]);return _0x577005(_0x29a955[_0x624d('0x12')][_0x624d('0x13')]);}logger[_0x624d('0x12')](_0x624d('0xd'),_0x48f00a,_0x29a955['error'][_0x624d('0x13')]);return _0x2608db(_0x29a955[_0x624d('0x12')][_0x624d('0x13')]);}else{logger['info'](_0x624d('0xd'),_0x48f00a,_0x624d('0xe'));_0x2608db(_0x29a955[_0x624d('0x14')][_0x624d('0x13')]);}})['catch'](function(_0x397029){logger[_0x624d('0x12')](_0x624d('0xd'),_0x48f00a,_0x397029);_0x577005(_0x397029);});});} \ No newline at end of file +var _0x4c6e=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','info','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x4c6e,0x105));var _0xe4c6=function(_0x185ffe,_0x5254a1){_0x185ffe=_0x185ffe-0x0;var _0x570f97=_0x4c6e[_0x185ffe];return _0x570f97;};'use strict';var _=require(_0xe4c6('0x0'));var util=require(_0xe4c6('0x1'));var moment=require(_0xe4c6('0x2'));var BPromise=require(_0xe4c6('0x3'));var rs=require(_0xe4c6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4c6('0x5'))['db'];var utils=require(_0xe4c6('0x6'));var logger=require(_0xe4c6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe4c6('0x8')][_0xe4c6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4436e1,_0xb3281f,_0x4dd4fe){return new BPromise(function(_0x5d3c27,_0x51d5c4){return client[_0xe4c6('0xa')](_0x4436e1,_0x4dd4fe)['then'](function(_0x2b8dfd){logger[_0xe4c6('0xb')](_0xe4c6('0xc'),_0xb3281f,'request\x20sent');logger[_0xe4c6('0xd')](_0xe4c6('0xe'),_0xb3281f,_0xe4c6('0xf'),JSON['stringify'](_0x2b8dfd));if(_0x2b8dfd['error']){if(_0x2b8dfd[_0xe4c6('0x10')][_0xe4c6('0x11')]===0x1f4){logger[_0xe4c6('0x10')](_0xe4c6('0xc'),_0xb3281f,_0x2b8dfd['error'][_0xe4c6('0x12')]);return _0x51d5c4(_0x2b8dfd[_0xe4c6('0x10')][_0xe4c6('0x12')]);}logger['error'](_0xe4c6('0xc'),_0xb3281f,_0x2b8dfd[_0xe4c6('0x10')][_0xe4c6('0x12')]);return _0x5d3c27(_0x2b8dfd[_0xe4c6('0x10')][_0xe4c6('0x12')]);}else{logger[_0xe4c6('0xb')](_0xe4c6('0xc'),_0xb3281f,'request\x20sent');_0x5d3c27(_0x2b8dfd['result'][_0xe4c6('0x12')]);}})[_0xe4c6('0x13')](function(_0x563de3){logger['error'](_0xe4c6('0xc'),_0xb3281f,_0x563de3);_0x51d5c4(_0x563de3);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index bc253e4..cb9a1ea 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 _0x39c7=['put','update','delete','/:id','isAuthenticated','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCustomField.controller','index','get','show','post','create'];(function(_0x1efa5c,_0x4deafb){var _0x4f8376=function(_0x132a82){while(--_0x132a82){_0x1efa5c['push'](_0x1efa5c['shift']());}};_0x4f8376(++_0x4deafb);}(_0x39c7,0x85));var _0x739c=function(_0x3d6b1,_0x4e401e){_0x3d6b1=_0x3d6b1-0x0;var _0x2479e7=_0x39c7[_0x3d6b1];return _0x2479e7;};'use strict';var multer=require('multer');var util=require(_0x739c('0x0'));var path=require(_0x739c('0x1'));var timeout=require(_0x739c('0x2'));var express=require(_0x739c('0x3'));var router=express[_0x739c('0x4')]();var fs_extra=require(_0x739c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x739c('0x6'));var config=require(_0x739c('0x7'));var controller=require(_0x739c('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x739c('0x9')]);router[_0x739c('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x739c('0xb')]);router[_0x739c('0xc')]('/',auth['isAuthenticated'](),controller[_0x739c('0xd')]);router[_0x739c('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x739c('0xf')]);router[_0x739c('0x10')](_0x739c('0x11'),auth[_0x739c('0x12')](),controller[_0x739c('0x13')]);module[_0x739c('0x14')]=router; \ No newline at end of file +var _0xfc76=['index','get','show','post','create','put','update','delete','/:id','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','isAuthenticated'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xfc76,0xb5));var _0x6fc7=function(_0x37b2c1,_0x74b1d4){_0x37b2c1=_0x37b2c1-0x0;var _0x387437=_0xfc76[_0x37b2c1];return _0x387437;};'use strict';var multer=require('multer');var util=require(_0x6fc7('0x0'));var path=require(_0x6fc7('0x1'));var timeout=require(_0x6fc7('0x2'));var express=require(_0x6fc7('0x3'));var router=express[_0x6fc7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6fc7('0x5'));var interaction=require(_0x6fc7('0x6'));var config=require('../../config/environment');var controller=require(_0x6fc7('0x7'));router['get']('/',auth[_0x6fc7('0x8')](),controller[_0x6fc7('0x9')]);router[_0x6fc7('0xa')]('/:id',auth[_0x6fc7('0x8')](),controller[_0x6fc7('0xb')]);router[_0x6fc7('0xc')]('/',auth[_0x6fc7('0x8')](),controller[_0x6fc7('0xd')]);router[_0x6fc7('0xe')]('/:id',auth[_0x6fc7('0x8')](),controller[_0x6fc7('0xf')]);router[_0x6fc7('0x10')](_0x6fc7('0x11'),auth[_0x6fc7('0x8')](),controller[_0x6fc7('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 306ce4d..8e6fa46 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 _0x8f1a=['UNSIGNED','contactListQueue','moment','sequelize','exports','BOOLEAN','DATE','INTEGER','STRING'];(function(_0x3cc464,_0x3f020d){var _0x325fc8=function(_0x2b54e8){while(--_0x2b54e8){_0x3cc464['push'](_0x3cc464['shift']());}};_0x325fc8(++_0x3f020d);}(_0x8f1a,0x1f1));var _0xa8f1=function(_0x2dcbf7,_0x2abfd1){_0x2dcbf7=_0x2dcbf7-0x0;var _0x49ee91=_0x8f1a[_0x2dcbf7];return _0x49ee91;};'use strict';var moment=require(_0xa8f1('0x0'));var Sequelize=require(_0xa8f1('0x1'));module[_0xa8f1('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xa8f1('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xa8f1('0x4')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa8f1('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xa8f1('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa8f1('0x6')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa8f1('0x4')]},'priority':{'type':Sequelize[_0xa8f1('0x5')](0x2)[_0xa8f1('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xa8f1('0x5')],'unique':_0xa8f1('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xa8f1('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xa8f1('0x8')},'CampaignId':{'type':Sequelize[_0xa8f1('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa8f1('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa8f1('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa8f1('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa8f1('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xa8f1('0x6')]},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xc470=['DATE','UNSIGNED','contactListQueue','moment','exports','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x2ba7f7,_0x539a61){var _0x463fb2=function(_0x2974d9){while(--_0x2974d9){_0x2ba7f7['push'](_0x2ba7f7['shift']());}};_0x463fb2(++_0x539a61);}(_0xc470,0xcb));var _0x0c47=function(_0x4ab6a1,_0x4d64d5){_0x4ab6a1=_0x4ab6a1-0x0;var _0x2a24cc=_0xc470[_0x4ab6a1];return _0x2a24cc;};'use strict';var moment=require(_0x0c47('0x0'));var Sequelize=require('sequelize');module[_0x0c47('0x1')]={'phone':{'type':Sequelize[_0x0c47('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x0c47('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x0c47('0x4')](_0x0c47('0x5'))},'countbusyretry':{'type':Sequelize[_0x0c47('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0c47('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0c47('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x0c47('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0c47('0x7')]},'priority':{'type':Sequelize[_0x0c47('0x6')](0x2)[_0x0c47('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x0c47('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x0c47('0x6')],'unique':_0x0c47('0x9')},'ListId':{'type':Sequelize[_0x0c47('0x6')],'unique':_0x0c47('0x9')},'UserId':{'type':Sequelize[_0x0c47('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x0c47('0x6')],'unique':_0x0c47('0x9')},'CampaignId':{'type':Sequelize[_0x0c47('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0c47('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0c47('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0c47('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x0c47('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x0c47('0x2')]},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index b1aad44..3bef426 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 _0x723e=['concat','$and','$or','$gt','$lt','$ne','$eq','$not','$between','$notBetween','$notIn','$iLike','$like','$overlap','$contains','$any','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','CmHopper','then','includeAll','include','rows','rawAttributes','find','catch','create','body','params','describe','destroy','CampaignId','VoiceQueueId','Campaign','omit','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','deletedat','format','calleridnum','phone','queue','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','outbound','preview','dialPreviewAutoRecallMe','transaction','value','direction','prev','isEmpty','hopperIds','priority','dialOrderByScheduledAt','ASC','DESC','literal','scheduledAt','findOne','scheduledat','recallme','LOCK','CmCompany','Company','CmList','List','VoiceQueue','Queue','dialActive','update','getPreviewRecall','sequelize','Contact','getOpenContacts','getVoiceQueues','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','sendStatus','error','stack','name','send','index','map','fieldName','key','model','keys','query','filters','intersection'];(function(_0x2d2661,_0x4b7213){var _0x2376a2=function(_0x2949cd){while(--_0x2949cd){_0x2d2661['push'](_0x2d2661['shift']());}};_0x2376a2(++_0x4b7213);}(_0x723e,0x179));var _0xe723=function(_0x4ed23c,_0x463194){_0x4ed23c=_0x4ed23c-0x0;var _0x38c249=_0x723e[_0x4ed23c];return _0x38c249;};'use strict';var moment=require('moment');var _=require(_0xe723('0x0'));var qs=require(_0xe723('0x1'));var logger=require(_0xe723('0x2'))(_0xe723('0x3'));var shared=require(_0xe723('0x4'));var db=require(_0xe723('0x5'))['db'];function respondWithResult(_0x39e35c,_0x1da20f){_0x1da20f=_0x1da20f||0xc8;return function(_0x8f78b2){if(_0x8f78b2){return _0x39e35c[_0xe723('0x6')](_0x1da20f)['json'](_0x8f78b2);}};}function respondWithFilteredResult(_0x32d689,_0x20c13b){return function(_0x1335cd){if(_0x1335cd){var _0x3bf082=typeof _0x20c13b[_0xe723('0x7')]===_0xe723('0x8')&&typeof _0x20c13b[_0xe723('0x9')]===_0xe723('0x8');var _0x4a6983=_0x1335cd[_0xe723('0xa')];var _0x270346=_0x3bf082?0x0:_0x20c13b[_0xe723('0x7')];var _0x5a43fb=_0x3bf082?_0x1335cd[_0xe723('0xa')]:_0x20c13b[_0xe723('0x7')]+_0x20c13b[_0xe723('0x9')];var _0x583291;if(_0x5a43fb>=_0x4a6983){_0x5a43fb=_0x4a6983;_0x583291=0xc8;}else{_0x583291=0xce;}_0x32d689[_0xe723('0x6')](_0x583291);return _0x32d689[_0xe723('0xb')](_0xe723('0xc'),_0x270346+'-'+_0x5a43fb+'/'+_0x4a6983)[_0xe723('0xd')](_0x1335cd);}return null;};}function saveUpdates(_0x236b69,_0x5c066c){return function(_0x29a1e){if(_0x29a1e){return _0x29a1e['update'](_0x236b69)['then'](function(_0x5201f2){return _0x5201f2;});}return null;};}function handleEntityNotFound(_0x57bc0e,_0x75c12c){return function(_0x30b2ba){if(!_0x30b2ba){_0x57bc0e[_0xe723('0xe')](0x194);}return _0x30b2ba;};}function handleError(_0x2b010b,_0xf29a39){_0xf29a39=_0xf29a39||0x1f4;return function(_0x5aec97){logger[_0xe723('0xf')](_0x5aec97[_0xe723('0x10')]);if(_0x5aec97[_0xe723('0x11')]){delete _0x5aec97[_0xe723('0x11')];}_0x2b010b[_0xe723('0x6')](_0xf29a39)[_0xe723('0x12')](_0x5aec97);};}exports[_0xe723('0x13')]=function(_0x4a6f95,_0x17e2c1){var _0x3906ea={},_0x2057d7={},_0x3012cf={'count':0x0,'rows':[]};var _0x262a8d=_[_0xe723('0x14')](db['CmHopper']['rawAttributes'],function(_0x31c839){return{'name':_0x31c839[_0xe723('0x15')],'type':_0x31c839['type'][_0xe723('0x16')]};});_0x2057d7[_0xe723('0x17')]=_['map'](_0x262a8d,_0xe723('0x11'));_0x2057d7['query']=_[_0xe723('0x18')](_0x4a6f95[_0xe723('0x19')]);_0x2057d7[_0xe723('0x1a')]=_[_0xe723('0x1b')](_0x2057d7[_0xe723('0x17')],_0x2057d7[_0xe723('0x19')]);_0x2057d7[_0xe723('0x1a')]=_[_0xe723('0x1c')](_0x2057d7[_0xe723('0x1a')],[_0xe723('0x1d'),_0xe723('0x1e'),_0xe723('0x1f'),'$gte',_0xe723('0x20'),'$lte',_0xe723('0x21'),_0xe723('0x22'),_0xe723('0x23'),_0xe723('0x24'),_0xe723('0x25'),'$in',_0xe723('0x26'),'$like','$notLike',_0xe723('0x27'),'$notILike',_0xe723('0x28'),_0xe723('0x29'),_0xe723('0x2a'),'$contained',_0xe723('0x2b')]);_0x3906ea[_0xe723('0x2c')]=_['intersection'](_0x2057d7[_0xe723('0x17')],qs['fields'](_0x4a6f95['query'][_0xe723('0x2d')]));_0x3906ea[_0xe723('0x2c')]=_0x3906ea[_0xe723('0x2c')][_0xe723('0x2e')]?_0x3906ea['attributes']:_0x2057d7['model'];if(!_0x4a6f95[_0xe723('0x19')]['hasOwnProperty'](_0xe723('0x2f'))){_0x3906ea[_0xe723('0x9')]=qs[_0xe723('0x9')](_0x4a6f95[_0xe723('0x19')][_0xe723('0x9')]);_0x3906ea[_0xe723('0x7')]=qs[_0xe723('0x7')](_0x4a6f95[_0xe723('0x19')][_0xe723('0x7')]);}_0x3906ea[_0xe723('0x30')]=qs[_0xe723('0x31')](_0x4a6f95[_0xe723('0x19')][_0xe723('0x31')]);_0x3906ea[_0xe723('0x32')]=qs['filters'](_[_0xe723('0x33')](_0x4a6f95['query'],_0x2057d7[_0xe723('0x1a')]),_0x262a8d);if(_0x4a6f95[_0xe723('0x19')]['filter']){_0x3906ea['where']=_[_0xe723('0x34')](_0x3906ea[_0xe723('0x32')],{'$or':_[_0xe723('0x14')](_0x262a8d,function(_0x2ef00d){if(_0x2ef00d[_0xe723('0x35')]!==_0xe723('0x36')){var _0x5122da={};_0x5122da[_0x2ef00d[_0xe723('0x11')]]={'$like':'%'+_0x4a6f95[_0xe723('0x19')][_0xe723('0x37')]+'%'};return _0x5122da;}})});}_0x3906ea=_[_0xe723('0x34')]({},_0x3906ea,_0x4a6f95[_0xe723('0x38')]);var _0x37bb5d={'where':_0x3906ea[_0xe723('0x32')]};return db[_0xe723('0x39')][_0xe723('0xa')](_0x37bb5d)[_0xe723('0x3a')](function(_0x9918d9){_0x3012cf[_0xe723('0xa')]=_0x9918d9;if(_0x4a6f95[_0xe723('0x19')][_0xe723('0x3b')]){_0x3906ea[_0xe723('0x3c')]=[{'all':!![]}];}return db[_0xe723('0x39')]['findAll'](_0x3906ea);})[_0xe723('0x3a')](function(_0x29c148){_0x3012cf[_0xe723('0x3d')]=_0x29c148;return _0x3012cf;})[_0xe723('0x3a')](respondWithFilteredResult(_0x17e2c1,_0x3906ea))['catch'](handleError(_0x17e2c1,null));};exports['show']=function(_0x105233,_0x3ba6ef){var _0xc0c2c7={'raw':!![],'where':{'id':_0x105233['params']['id']}},_0xfafc1d={};_0xfafc1d['model']=_[_0xe723('0x18')](db[_0xe723('0x39')][_0xe723('0x3e')]);_0xfafc1d[_0xe723('0x19')]=_[_0xe723('0x18')](_0x105233[_0xe723('0x19')]);_0xfafc1d[_0xe723('0x1a')]=_[_0xe723('0x1b')](_0xfafc1d[_0xe723('0x17')],_0xfafc1d['query']);_0xc0c2c7['attributes']=_[_0xe723('0x1b')](_0xfafc1d['model'],qs['fields'](_0x105233[_0xe723('0x19')]['fields']));_0xc0c2c7[_0xe723('0x2c')]=_0xc0c2c7[_0xe723('0x2c')][_0xe723('0x2e')]?_0xc0c2c7[_0xe723('0x2c')]:_0xfafc1d[_0xe723('0x17')];if(_0x105233[_0xe723('0x19')][_0xe723('0x3b')]){_0xc0c2c7['include']=[{'all':!![]}];}_0xc0c2c7=_['merge']({},_0xc0c2c7,_0x105233[_0xe723('0x38')]);return db['CmHopper'][_0xe723('0x3f')](_0xc0c2c7)['then'](handleEntityNotFound(_0x3ba6ef,null))[_0xe723('0x3a')](respondWithResult(_0x3ba6ef,null))[_0xe723('0x40')](handleError(_0x3ba6ef,null));};exports[_0xe723('0x41')]=function(_0x2c22c4,_0x119550){return db[_0xe723('0x39')][_0xe723('0x41')](_0x2c22c4[_0xe723('0x42')],{})[_0xe723('0x3a')](respondWithResult(_0x119550,0xc9))['catch'](handleError(_0x119550,null));};exports['update']=function(_0x1824b6,_0x23425b){if(_0x1824b6[_0xe723('0x42')]['id']){delete _0x1824b6['body']['id'];}return db['CmHopper']['find']({'where':{'id':_0x1824b6[_0xe723('0x43')]['id']}})[_0xe723('0x3a')](handleEntityNotFound(_0x23425b,null))[_0xe723('0x3a')](saveUpdates(_0x1824b6['body'],null))[_0xe723('0x3a')](respondWithResult(_0x23425b,null))[_0xe723('0x40')](handleError(_0x23425b,null));};exports[_0xe723('0x44')]=function(_0x38bd1a,_0x15bfd0){return db['CmHopper'][_0xe723('0x44')]()['then'](respondWithResult(_0x15bfd0,null))[_0xe723('0x40')](handleError(_0x15bfd0,null));};exports['destroy']=function(_0x52f42e,_0x1590fe){var _0x42a302;var _0x22a1d3=_0x52f42e['params']['id'];return db[_0xe723('0x39')]['find']({'where':{'id':_0x52f42e[_0xe723('0x43')]['id']}})[_0xe723('0x3a')](handleEntityNotFound(_0x1590fe,null))[_0xe723('0x3a')](function(_0x37329e){if(_0x37329e){return _0x37329e[_0xe723('0x45')]()[_0xe723('0x3a')](function(_0x41e1c4){return _0x41e1c4;});}})[_0xe723('0x3a')](function(_0x1bf58b){_0x42a302=_0x1bf58b;if(_0x1bf58b){if(_0x1bf58b['VoiceQueueId']||_0x1bf58b[_0xe723('0x46')]){return db[_0x1bf58b[_0xe723('0x47')]?'VoiceQueue':_0xe723('0x48')][_0xe723('0x3f')]({'where':{'id':_0x1bf58b['VoiceQueueId']?_0x1bf58b[_0xe723('0x47')]:_0x1bf58b['CampaignId']},'attributes':['id','name'],'raw':!![]});}}})[_0xe723('0x3a')](function(_0x1825fa){var _0x21d3ef={};if(_0x1825fa){_[_0xe723('0x34')](_0x21d3ef,_[_0xe723('0x49')](_0x42a302['dataValues'],[_0xe723('0x4a'),_0xe723('0x4b'),'id']));_0x21d3ef[_0xe723('0x4c')]=0x15;_0x21d3ef[_0xe723('0x4d')]=_0xe723('0x4e');_0x21d3ef[_0xe723('0x4f')]=_0x1825fa[_0xe723('0x11')];_0x21d3ef[_0xe723('0x50')]=_0x52f42e[_0xe723('0x51')][_0xe723('0x11')];_0x21d3ef['UserId']=_0x52f42e[_0xe723('0x51')]['id'];_0x21d3ef[_0xe723('0x4e')]=!![];_0x21d3ef[_0xe723('0x52')]=moment()[_0xe723('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x21d3ef[_0xe723('0x54')]=_0x42a302[_0xe723('0x55')];_0x21d3ef['campaigntype']=_0x42a302[_0xe723('0x47')]?_0xe723('0x56'):_0xe723('0x57');return db[_0xe723('0x58')][_0xe723('0x3f')]({'where':{'id':_0x21d3ef[_0xe723('0x59')]},'attributes':['firstName',_0xe723('0x5a')]})['then'](function(_0x58a39f){if(!_[_0xe723('0x5b')](_0x1590fe)&&!_['isNil'](_0x58a39f[_0xe723('0x5c')])){_0x21d3ef[_0xe723('0x5d')]=_0x58a39f[_0xe723('0x5c')];if(!_[_0xe723('0x5b')](_0x58a39f[_0xe723('0x5a')])){_0x21d3ef['calleridname']+='\x20'+_0x58a39f[_0xe723('0x5a')];}}})[_0xe723('0x5e')](function(){return db[_0xe723('0x5f')]['create'](_0x21d3ef);});}})['then'](function(_0x4022a7){return db[_0xe723('0x60')][_0xe723('0x45')]({'where':{'CmHopperId':_0x22a1d3}});})['then'](function(){return _0x1590fe[_0xe723('0x6')](0xcc)[_0xe723('0x61')]();})['catch'](handleError(_0x1590fe,null));};exports['getPreview']=function(_0x2556bf,_0x7b0dd9){var _0x113860=[];return db[_0xe723('0x58')][_0xe723('0x44')]()[_0xe723('0x3a')](function(_0x6fbf5e){_0x113860=_['keys'](_0x6fbf5e);return _0x2556bf['user']['getVoiceQueues']({'where':{'type':_0xe723('0x62'),'dialActive':!![],'dialMethod':_0xe723('0x63')},'attributes':['id','dialOrderByScheduledAt',_0xe723('0x64')],'raw':!![]});})[_0xe723('0x3a')](function(_0x189b5c){if(_0x189b5c&&_0x189b5c['length']){return db['sequelize'][_0xe723('0x65')](function(_0x3868a9){var _0x2463c3={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xe723('0x14')](_0x189b5c,'id')},'$or':[{'UserId':null},{'UserId':_0x2556bf['user']['id']}]};var _0x876a6d={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x189b5c)[_0xe723('0x37')]([_0xe723('0x64'),0x0])[_0xe723('0x14')]('id')[_0xe723('0x66')]()},'$or':[{'UserId':null},{'UserId':_0x2556bf[_0xe723('0x51')]['id']}]};var _0x1b0cd6={'$or':[_0x2463c3,_0x876a6d]};var _0x421520=[];if(_0x2556bf[_0xe723('0x42')]['direction']&&_0x2556bf[_0xe723('0x42')][_0xe723('0x67')]===_0xe723('0x68')){if(!_[_0xe723('0x69')](_0x2556bf[_0xe723('0x42')][_0xe723('0x6a')])){_0x1b0cd6['id']={'$in':_0x2556bf['body'][_0xe723('0x6a')]};}_0x421520=[[_0xe723('0x6b'),'ASC'],['scheduledAt',_0x189b5c[0x0][_0xe723('0x6c')]===_0xe723('0x6d')?_0xe723('0x6e'):'ASC'],db['sequelize'][_0xe723('0x6f')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xe723('0x6e')]];}else{if(!_[_0xe723('0x69')](_0x2556bf[_0xe723('0x42')][_0xe723('0x6a')])){_0x1b0cd6['id']={'$notIn':_0x2556bf[_0xe723('0x42')]['hopperIds']};}_0x421520=[['priority',_0xe723('0x6e')],[_0xe723('0x70'),_0x189b5c[0x0][_0xe723('0x6c')]],db['sequelize'][_0xe723('0x6f')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0xe723('0x39')][_0xe723('0x71')]({'attributes':['id',_0xe723('0x72'),_0xe723('0x55'),_0xe723('0x73')],'where':_0x1b0cd6,'order':_0x421520,'transaction':_0x3868a9,'lock':_0x3868a9[_0xe723('0x74')]['UPDATE'],'include':[{'model':db[_0xe723('0x58')],'as':'Contact','attributes':_0x113860,'include':[{'model':db[_0xe723('0x75')],'as':_0xe723('0x76'),'attributes':['id','name']}]},{'model':db[_0xe723('0x77')],'as':_0xe723('0x78'),'attributes':['id',_0xe723('0x11')]},{'model':db[_0xe723('0x79')],'as':_0xe723('0x7a'),'attributes':['id',_0xe723('0x11'),_0xe723('0x7b')]}]})[_0xe723('0x3a')](function(_0x33685e){if(_0x33685e){return _0x33685e[_0xe723('0x7c')]({'UserId':_0x2556bf[_0xe723('0x51')]['id']},{'transaction':_0x3868a9});}});});}})[_0xe723('0x3a')](handleEntityNotFound(_0x7b0dd9,null))[_0xe723('0x3a')](respondWithResult(_0x7b0dd9,null))[_0xe723('0x40')](handleError(_0x7b0dd9,null));};exports[_0xe723('0x7d')]=function(_0x4d5685,_0x3e8bd4,_0x44468e){var _0x1d4fe0=[];var _0x507267=_0x4d5685[_0xe723('0x43')]['id'];var _0x7af941=_0x4d5685[_0xe723('0x51')]['id'];return db[_0xe723('0x58')][_0xe723('0x44')]()[_0xe723('0x3a')](function(_0x1e2cb0){_0x1d4fe0=_[_0xe723('0x18')](_0x1e2cb0);return db[_0xe723('0x7e')][_0xe723('0x65')](function(_0x5dc44a){const _0x14cd1d={'id':_0x507267};return db[_0xe723('0x39')][_0xe723('0x71')]({'attributes':['id',_0xe723('0x72'),_0xe723('0x73')],'where':_0x14cd1d,'transaction':_0x5dc44a,'lock':_0x5dc44a[_0xe723('0x74')]['UPDATE'],'include':[{'model':db[_0xe723('0x58')],'as':_0xe723('0x7f'),'attributes':_0x1d4fe0,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0xe723('0x11')]}]},{'model':db[_0xe723('0x77')],'as':'List','attributes':['id',_0xe723('0x11')]},{'model':db[_0xe723('0x79')],'as':'Queue','attributes':['id','name','dialActive']}]})[_0xe723('0x3a')](function(_0x48b73c){if(_0x48b73c){return _0x48b73c['update']({'UserId':_0x7af941},{'transaction':_0x5dc44a});}});});})['then'](handleEntityNotFound(_0x3e8bd4,null))[_0xe723('0x3a')](respondWithResult(_0x3e8bd4,null))[_0xe723('0x40')](handleError(_0x3e8bd4,null));};exports[_0xe723('0x80')]=function(_0x296bf1,_0x31ccef){return _0x296bf1[_0xe723('0x51')][_0xe723('0x81')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xe723('0x63')},'attributes':['id'],'raw':!![]})[_0xe723('0x3a')](function(_0x36d962){if(_0x36d962&&_0x36d962[_0xe723('0x2e')]){return db[_0xe723('0x39')][_0xe723('0xa')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xe723('0x14')](_0x36d962,'id')},'$or':[{'UserId':null},{'UserId':_0x296bf1['user']['id']}]}});}return 0x0;})['then'](function(_0x345278){if(!_[_0xe723('0x5b')](_0x345278)&&_['isNumber'](_0x345278)){return _0x31ccef[_0xe723('0x6')](0xc8)[_0xe723('0xd')]({'contacts':_0x345278});}else{logger[_0xe723('0xf')]('CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts',0x194,_0xe723('0x82'));_0x31ccef[_0xe723('0xe')](0x194);}})[_0xe723('0x40')](handleError(_0x31ccef,null));};exports[_0xe723('0x83')]=function(_0x155e7c,_0x34e46f){var _0x2674dd=shared[_0xe723('0x84')];var _0x5a8810=[];_['map'](_0x2674dd,function(_0x4b359f){_0x5a8810[_0xe723('0x85')]({'id':_0x4b359f[_0xe723('0x11')],'name':_0x4b359f[_0xe723('0x11')],'utcOffset':_0x4b359f[_0xe723('0x86')]});});return _0x34e46f[_0xe723('0x6')](0xc8)['json']({'tz':_0x5a8810});};exports['getTimezone']=function(_0x4cecc8,_0x374476){var _0x231ac9=shared[_0xe723('0x84')];var _0x1597aa={};if(!_['isNil'](_0x231ac9[_0x4cecc8['body']['id']]))_0x1597aa=_0x231ac9[_0x4cecc8['body']['id']];return _0x374476['status'](0xc8)[_0xe723('0xd')](_0x1597aa);}; \ No newline at end of file +var _0x72b1=['$contained','$any','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','params','catch','create','body','describe','destroy','find','VoiceQueueId','CampaignId','Campaign','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','ivr','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','CmContact','user','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','findOne','scheduledat','phone','LOCK','UPDATE','CmCompany','Company','CmList','List','VoiceQueue','Queue','getPreviewRecall','recallme','Contact','dialActive','getOpenContacts','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','utcOffset','timezones','moment','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','undefined','count','offset','limit','set','update','sendStatus','stack','name','map','CmHopper','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','concat','$and','$or','$gte','$lt','$lte','$ne','$eq','$not','$between','$in','$notIn','$notLike','$iLike','$notILike','$like','$overlap'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x72b1,0x16e));var _0x172b=function(_0x434ea5,_0x43a53d){_0x434ea5=_0x434ea5-0x0;var _0x1d030d=_0x72b1[_0x434ea5];return _0x1d030d;};'use strict';var moment=require(_0x172b('0x0'));var _=require('lodash');var qs=require(_0x172b('0x1'));var logger=require(_0x172b('0x2'))(_0x172b('0x3'));var shared=require(_0x172b('0x4'));var db=require(_0x172b('0x5'))['db'];function respondWithResult(_0x3fa10d,_0x2c1d6e){_0x2c1d6e=_0x2c1d6e||0xc8;return function(_0x558038){if(_0x558038){return _0x3fa10d[_0x172b('0x6')](_0x2c1d6e)[_0x172b('0x7')](_0x558038);}};}function respondWithFilteredResult(_0x475fd6,_0x222624){return function(_0x571994){if(_0x571994){var _0x345e5e=typeof _0x222624['offset']===_0x172b('0x8')&&typeof _0x222624['limit']===_0x172b('0x8');var _0x2238f1=_0x571994[_0x172b('0x9')];var _0x392f1e=_0x345e5e?0x0:_0x222624['offset'];var _0x3b6daf=_0x345e5e?_0x571994[_0x172b('0x9')]:_0x222624[_0x172b('0xa')]+_0x222624[_0x172b('0xb')];var _0xa4ada9;if(_0x3b6daf>=_0x2238f1){_0x3b6daf=_0x2238f1;_0xa4ada9=0xc8;}else{_0xa4ada9=0xce;}_0x475fd6[_0x172b('0x6')](_0xa4ada9);return _0x475fd6[_0x172b('0xc')]('Content-Range',_0x392f1e+'-'+_0x3b6daf+'/'+_0x2238f1)[_0x172b('0x7')](_0x571994);}return null;};}function saveUpdates(_0x82727f,_0xdf832e){return function(_0x4970f8){if(_0x4970f8){return _0x4970f8[_0x172b('0xd')](_0x82727f)['then'](function(_0x2611c2){return _0x2611c2;});}return null;};}function handleEntityNotFound(_0x81e11e,_0x5239b9){return function(_0x1b7247){if(!_0x1b7247){_0x81e11e[_0x172b('0xe')](0x194);}return _0x1b7247;};}function handleError(_0x2790ed,_0xa28463){_0xa28463=_0xa28463||0x1f4;return function(_0x5b0ab1){logger['error'](_0x5b0ab1[_0x172b('0xf')]);if(_0x5b0ab1[_0x172b('0x10')]){delete _0x5b0ab1[_0x172b('0x10')];}_0x2790ed[_0x172b('0x6')](_0xa28463)['send'](_0x5b0ab1);};}exports['index']=function(_0x10c80b,_0x3b2701){var _0x18c22a={},_0xba7825={},_0x1f20ac={'count':0x0,'rows':[]};var _0x4e7cb9=_[_0x172b('0x11')](db[_0x172b('0x12')][_0x172b('0x13')],function(_0x33c62c){return{'name':_0x33c62c[_0x172b('0x14')],'type':_0x33c62c[_0x172b('0x15')][_0x172b('0x16')]};});_0xba7825['model']=_['map'](_0x4e7cb9,'name');_0xba7825['query']=_[_0x172b('0x17')](_0x10c80b['query']);_0xba7825[_0x172b('0x18')]=_[_0x172b('0x19')](_0xba7825[_0x172b('0x1a')],_0xba7825[_0x172b('0x1b')]);_0xba7825[_0x172b('0x18')]=_[_0x172b('0x1c')](_0xba7825[_0x172b('0x18')],[_0x172b('0x1d'),_0x172b('0x1e'),'$gt',_0x172b('0x1f'),_0x172b('0x20'),_0x172b('0x21'),_0x172b('0x22'),_0x172b('0x23'),_0x172b('0x24'),_0x172b('0x25'),'$notBetween',_0x172b('0x26'),_0x172b('0x27'),'$like',_0x172b('0x28'),_0x172b('0x29'),_0x172b('0x2a'),_0x172b('0x2b'),_0x172b('0x2c'),'$contains',_0x172b('0x2d'),_0x172b('0x2e')]);_0x18c22a['attributes']=_['intersection'](_0xba7825[_0x172b('0x1a')],qs[_0x172b('0x2f')](_0x10c80b[_0x172b('0x1b')][_0x172b('0x2f')]));_0x18c22a[_0x172b('0x30')]=_0x18c22a[_0x172b('0x30')][_0x172b('0x31')]?_0x18c22a[_0x172b('0x30')]:_0xba7825[_0x172b('0x1a')];if(!_0x10c80b[_0x172b('0x1b')][_0x172b('0x32')](_0x172b('0x33'))){_0x18c22a[_0x172b('0xb')]=qs[_0x172b('0xb')](_0x10c80b[_0x172b('0x1b')][_0x172b('0xb')]);_0x18c22a[_0x172b('0xa')]=qs[_0x172b('0xa')](_0x10c80b[_0x172b('0x1b')][_0x172b('0xa')]);}_0x18c22a[_0x172b('0x34')]=qs[_0x172b('0x35')](_0x10c80b[_0x172b('0x1b')][_0x172b('0x35')]);_0x18c22a[_0x172b('0x36')]=qs['filters'](_[_0x172b('0x37')](_0x10c80b[_0x172b('0x1b')],_0xba7825[_0x172b('0x18')]),_0x4e7cb9);if(_0x10c80b['query'][_0x172b('0x38')]){_0x18c22a['where']=_['merge'](_0x18c22a['where'],{'$or':_[_0x172b('0x11')](_0x4e7cb9,function(_0x5cadaa){if(_0x5cadaa['type']!==_0x172b('0x39')){var _0x375cb6={};_0x375cb6[_0x5cadaa[_0x172b('0x10')]]={'$like':'%'+_0x10c80b['query'][_0x172b('0x38')]+'%'};return _0x375cb6;}})});}_0x18c22a=_[_0x172b('0x3a')]({},_0x18c22a,_0x10c80b[_0x172b('0x3b')]);var _0x3c0e6a={'where':_0x18c22a[_0x172b('0x36')]};return db[_0x172b('0x12')][_0x172b('0x9')](_0x3c0e6a)[_0x172b('0x3c')](function(_0x40b14c){_0x1f20ac[_0x172b('0x9')]=_0x40b14c;if(_0x10c80b[_0x172b('0x1b')][_0x172b('0x3d')]){_0x18c22a[_0x172b('0x3e')]=[{'all':!![]}];}return db[_0x172b('0x12')][_0x172b('0x3f')](_0x18c22a);})[_0x172b('0x3c')](function(_0x220e6f){_0x1f20ac[_0x172b('0x40')]=_0x220e6f;return _0x1f20ac;})[_0x172b('0x3c')](respondWithFilteredResult(_0x3b2701,_0x18c22a))['catch'](handleError(_0x3b2701,null));};exports['show']=function(_0x3cb17d,_0x4fc858){var _0x5e8ff6={'raw':!![],'where':{'id':_0x3cb17d[_0x172b('0x41')]['id']}},_0x5321e0={};_0x5321e0[_0x172b('0x1a')]=_[_0x172b('0x17')](db['CmHopper'][_0x172b('0x13')]);_0x5321e0[_0x172b('0x1b')]=_[_0x172b('0x17')](_0x3cb17d['query']);_0x5321e0[_0x172b('0x18')]=_['intersection'](_0x5321e0[_0x172b('0x1a')],_0x5321e0[_0x172b('0x1b')]);_0x5e8ff6[_0x172b('0x30')]=_[_0x172b('0x19')](_0x5321e0[_0x172b('0x1a')],qs[_0x172b('0x2f')](_0x3cb17d[_0x172b('0x1b')]['fields']));_0x5e8ff6[_0x172b('0x30')]=_0x5e8ff6[_0x172b('0x30')][_0x172b('0x31')]?_0x5e8ff6[_0x172b('0x30')]:_0x5321e0[_0x172b('0x1a')];if(_0x3cb17d[_0x172b('0x1b')]['includeAll']){_0x5e8ff6['include']=[{'all':!![]}];}_0x5e8ff6=_[_0x172b('0x3a')]({},_0x5e8ff6,_0x3cb17d['options']);return db['CmHopper']['find'](_0x5e8ff6)[_0x172b('0x3c')](handleEntityNotFound(_0x4fc858,null))[_0x172b('0x3c')](respondWithResult(_0x4fc858,null))[_0x172b('0x42')](handleError(_0x4fc858,null));};exports[_0x172b('0x43')]=function(_0x4a3e63,_0x8c3d6){return db[_0x172b('0x12')][_0x172b('0x43')](_0x4a3e63[_0x172b('0x44')],{})[_0x172b('0x3c')](respondWithResult(_0x8c3d6,0xc9))[_0x172b('0x42')](handleError(_0x8c3d6,null));};exports[_0x172b('0xd')]=function(_0x219e29,_0x17f786){if(_0x219e29[_0x172b('0x44')]['id']){delete _0x219e29[_0x172b('0x44')]['id'];}return db[_0x172b('0x12')]['find']({'where':{'id':_0x219e29[_0x172b('0x41')]['id']}})[_0x172b('0x3c')](handleEntityNotFound(_0x17f786,null))['then'](saveUpdates(_0x219e29['body'],null))[_0x172b('0x3c')](respondWithResult(_0x17f786,null))[_0x172b('0x42')](handleError(_0x17f786,null));};exports[_0x172b('0x45')]=function(_0x571504,_0x3bfdf8){return db['CmHopper']['describe']()[_0x172b('0x3c')](respondWithResult(_0x3bfdf8,null))[_0x172b('0x42')](handleError(_0x3bfdf8,null));};exports[_0x172b('0x46')]=function(_0x3941d4,_0x24ab0c){var _0x230ba3;var _0x3131eb=_0x3941d4[_0x172b('0x41')]['id'];return db[_0x172b('0x12')][_0x172b('0x47')]({'where':{'id':_0x3941d4['params']['id']}})['then'](handleEntityNotFound(_0x24ab0c,null))[_0x172b('0x3c')](function(_0x29ee62){if(_0x29ee62){return _0x29ee62['destroy']()['then'](function(_0x3db238){return _0x3db238;});}})[_0x172b('0x3c')](function(_0x10543d){_0x230ba3=_0x10543d;if(_0x10543d){if(_0x10543d[_0x172b('0x48')]||_0x10543d[_0x172b('0x49')]){return db[_0x10543d[_0x172b('0x48')]?'VoiceQueue':_0x172b('0x4a')]['find']({'where':{'id':_0x10543d['VoiceQueueId']?_0x10543d[_0x172b('0x48')]:_0x10543d[_0x172b('0x49')]},'attributes':['id',_0x172b('0x10')],'raw':!![]});}}})['then'](function(_0x3c2fbd){var _0x1cb872={};if(_0x3c2fbd){_[_0x172b('0x3a')](_0x1cb872,_['omit'](_0x230ba3['dataValues'],[_0x172b('0x4b'),_0x172b('0x4c'),'id']));_0x1cb872[_0x172b('0x4d')]=0x15;_0x1cb872[_0x172b('0x4e')]=_0x172b('0x4f');_0x1cb872[_0x172b('0x50')]=_0x3c2fbd[_0x172b('0x10')];_0x1cb872[_0x172b('0x51')]=_0x3941d4['user'][_0x172b('0x10')];_0x1cb872['UserId']=_0x3941d4['user']['id'];_0x1cb872[_0x172b('0x4f')]=!![];_0x1cb872['deletedat']=moment()[_0x172b('0x52')](_0x172b('0x53'));_0x1cb872[_0x172b('0x54')]=_0x230ba3['phone'];_0x1cb872[_0x172b('0x55')]=_0x230ba3['VoiceQueueId']?_0x172b('0x56'):_0x172b('0x57');return db['CmContact'][_0x172b('0x47')]({'where':{'id':_0x1cb872['ContactId']},'attributes':[_0x172b('0x58'),_0x172b('0x59')]})[_0x172b('0x3c')](function(_0x3914aa){if(!_[_0x172b('0x5a')](_0x24ab0c)&&!_['isNil'](_0x3914aa[_0x172b('0x58')])){_0x1cb872[_0x172b('0x5b')]=_0x3914aa[_0x172b('0x58')];if(!_[_0x172b('0x5a')](_0x3914aa['lastName'])){_0x1cb872[_0x172b('0x5b')]+='\x20'+_0x3914aa['lastName'];}}})[_0x172b('0x5c')](function(){return db[_0x172b('0x5d')][_0x172b('0x43')](_0x1cb872);});}})[_0x172b('0x3c')](function(_0x2cf075){return db[_0x172b('0x5e')]['destroy']({'where':{'CmHopperId':_0x3131eb}});})[_0x172b('0x3c')](function(){return _0x24ab0c[_0x172b('0x6')](0xcc)[_0x172b('0x5f')]();})['catch'](handleError(_0x24ab0c,null));};exports[_0x172b('0x60')]=function(_0x57c3eb,_0x4eff2b){var _0xe975c=[];return db[_0x172b('0x61')][_0x172b('0x45')]()[_0x172b('0x3c')](function(_0x1b6f27){_0xe975c=_[_0x172b('0x17')](_0x1b6f27);return _0x57c3eb[_0x172b('0x62')][_0x172b('0x63')]({'where':{'type':_0x172b('0x64'),'dialActive':!![],'dialMethod':_0x172b('0x65')},'attributes':['id','dialOrderByScheduledAt',_0x172b('0x66')],'raw':!![]});})[_0x172b('0x3c')](function(_0x1f108a){if(_0x1f108a&&_0x1f108a[_0x172b('0x31')]){return db[_0x172b('0x67')][_0x172b('0x68')](function(_0x32d480){var _0x4646fc={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x172b('0x52')](_0x172b('0x53'))},'VoiceQueueId':{'$in':_[_0x172b('0x11')](_0x1f108a,'id')},'$or':[{'UserId':null},{'UserId':_0x57c3eb['user']['id']}]};var _0x2a8360={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x1f108a)[_0x172b('0x38')]([_0x172b('0x66'),0x0])[_0x172b('0x11')]('id')[_0x172b('0x69')]()},'$or':[{'UserId':null},{'UserId':_0x57c3eb[_0x172b('0x62')]['id']}]};var _0x54e62e={'$or':[_0x4646fc,_0x2a8360]};var _0x575269=[];if(_0x57c3eb[_0x172b('0x44')][_0x172b('0x6a')]&&_0x57c3eb[_0x172b('0x44')][_0x172b('0x6a')]===_0x172b('0x6b')){if(!_[_0x172b('0x6c')](_0x57c3eb[_0x172b('0x44')]['hopperIds'])){_0x54e62e['id']={'$in':_0x57c3eb[_0x172b('0x44')][_0x172b('0x6d')]};}_0x575269=[[_0x172b('0x6e'),_0x172b('0x6f')],[_0x172b('0x70'),_0x1f108a[0x0]['dialOrderByScheduledAt']===_0x172b('0x6f')?_0x172b('0x71'):'ASC'],db[_0x172b('0x67')][_0x172b('0x72')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x172b('0x71')]];}else{if(!_[_0x172b('0x6c')](_0x57c3eb[_0x172b('0x44')][_0x172b('0x6d')])){_0x54e62e['id']={'$notIn':_0x57c3eb['body'][_0x172b('0x6d')]};}_0x575269=[[_0x172b('0x6e'),'DESC'],[_0x172b('0x70'),_0x1f108a[0x0]['dialOrderByScheduledAt']],db[_0x172b('0x67')][_0x172b('0x72')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x172b('0x6f')]];}return db[_0x172b('0x12')][_0x172b('0x73')]({'attributes':['id',_0x172b('0x74'),_0x172b('0x75'),'recallme'],'where':_0x54e62e,'order':_0x575269,'transaction':_0x32d480,'lock':_0x32d480[_0x172b('0x76')][_0x172b('0x77')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0xe975c,'include':[{'model':db[_0x172b('0x78')],'as':_0x172b('0x79'),'attributes':['id','name']}]},{'model':db[_0x172b('0x7a')],'as':_0x172b('0x7b'),'attributes':['id',_0x172b('0x10')]},{'model':db[_0x172b('0x7c')],'as':_0x172b('0x7d'),'attributes':['id','name','dialActive']}]})['then'](function(_0x4885f9){if(_0x4885f9){return _0x4885f9['update']({'UserId':_0x57c3eb[_0x172b('0x62')]['id']},{'transaction':_0x32d480});}});});}})[_0x172b('0x3c')](handleEntityNotFound(_0x4eff2b,null))['then'](respondWithResult(_0x4eff2b,null))[_0x172b('0x42')](handleError(_0x4eff2b,null));};exports[_0x172b('0x7e')]=function(_0x241d44,_0x7b7b41,_0x1d7de8){var _0x21e7cb=[];var _0x5aca7f=_0x241d44[_0x172b('0x41')]['id'];var _0x3781e4=_0x241d44[_0x172b('0x62')]['id'];return db[_0x172b('0x61')][_0x172b('0x45')]()[_0x172b('0x3c')](function(_0x59583b){_0x21e7cb=_[_0x172b('0x17')](_0x59583b);return db[_0x172b('0x67')][_0x172b('0x68')](function(_0x3cca24){const _0x48cd9e={'id':_0x5aca7f};return db[_0x172b('0x12')]['findOne']({'attributes':['id',_0x172b('0x74'),_0x172b('0x7f')],'where':_0x48cd9e,'transaction':_0x3cca24,'lock':_0x3cca24[_0x172b('0x76')][_0x172b('0x77')],'include':[{'model':db[_0x172b('0x61')],'as':_0x172b('0x80'),'attributes':_0x21e7cb,'include':[{'model':db[_0x172b('0x78')],'as':_0x172b('0x79'),'attributes':['id',_0x172b('0x10')]}]},{'model':db['CmList'],'as':_0x172b('0x7b'),'attributes':['id','name']},{'model':db[_0x172b('0x7c')],'as':_0x172b('0x7d'),'attributes':['id',_0x172b('0x10'),_0x172b('0x81')]}]})[_0x172b('0x3c')](function(_0x4b7577){if(_0x4b7577){return _0x4b7577[_0x172b('0xd')]({'UserId':_0x3781e4},{'transaction':_0x3cca24});}});});})[_0x172b('0x3c')](handleEntityNotFound(_0x7b7b41,null))['then'](respondWithResult(_0x7b7b41,null))[_0x172b('0x42')](handleError(_0x7b7b41,null));};exports[_0x172b('0x82')]=function(_0x2f7855,_0x4bb59f){return _0x2f7855[_0x172b('0x62')][_0x172b('0x63')]({'where':{'type':_0x172b('0x64'),'dialActive':!![],'dialMethod':_0x172b('0x65')},'attributes':['id'],'raw':!![]})[_0x172b('0x3c')](function(_0x297a90){if(_0x297a90&&_0x297a90[_0x172b('0x31')]){return db['CmHopper'][_0x172b('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x172b('0x52')](_0x172b('0x53'))},'VoiceQueueId':{'$in':_[_0x172b('0x11')](_0x297a90,'id')},'$or':[{'UserId':null},{'UserId':_0x2f7855[_0x172b('0x62')]['id']}]}});}return 0x0;})[_0x172b('0x3c')](function(_0x1dd677){if(!_[_0x172b('0x5a')](_0x1dd677)&&_['isNumber'](_0x1dd677)){return _0x4bb59f[_0x172b('0x6')](0xc8)[_0x172b('0x7')]({'contacts':_0x1dd677});}else{logger[_0x172b('0x83')](_0x172b('0x84'),_0x172b('0x82'),0x194,_0x172b('0x85'));_0x4bb59f[_0x172b('0xe')](0x194);}})[_0x172b('0x42')](handleError(_0x4bb59f,null));};exports[_0x172b('0x86')]=function(_0x16b0ae,_0x14bf75){var _0x5650d8=shared['timezones'];var _0x5b8a16=[];_[_0x172b('0x11')](_0x5650d8,function(_0x3f7e09){_0x5b8a16['push']({'id':_0x3f7e09['name'],'name':_0x3f7e09['name'],'utcOffset':_0x3f7e09[_0x172b('0x87')]});});return _0x14bf75[_0x172b('0x6')](0xc8)[_0x172b('0x7')]({'tz':_0x5b8a16});};exports['getTimezone']=function(_0x887047,_0x400871){var _0x465847=shared[_0x172b('0x88')];var _0x3906fe={};if(!_['isNil'](_0x465847[_0x887047['body']['id']]))_0x3906fe=_0x465847[_0x887047[_0x172b('0x44')]['id']];return _0x400871['status'](0xc8)[_0x172b('0x7')](_0x3906fe);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 5f889ed..a7283f7 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 _0x4975=['exports','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes'];(function(_0x485907,_0x47224d){var _0x3ed143=function(_0x12e968){while(--_0x12e968){_0x485907['push'](_0x485907['shift']());}};_0x3ed143(++_0x47224d);}(_0x4975,0x86));var _0x5497=function(_0x3b0f55,_0x387df4){_0x3b0f55=_0x3b0f55-0x0;var _0x39894b=_0x4975[_0x3b0f55];return _0x39894b;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[{'name':_0x5497('0xd'),'fields':['scheduledat']},{'name':_0x5497('0xe'),'fields':['phone']},{'name':_0x5497('0xf'),'fields':[_0x5497('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x46ed=['lodash','util','api','moment','bluebird','path','rimraf','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority'];(function(_0xe7c6ee,_0x1028a5){var _0xedf0bf=function(_0x4ec771){while(--_0x4ec771){_0xe7c6ee['push'](_0xe7c6ee['shift']());}};_0xedf0bf(++_0x1028a5);}(_0x46ed,0x168));var _0xd46e=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x46ed[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var logger=require('../../config/logger')(_0xd46e('0x2'));var moment=require(_0xd46e('0x3'));var BPromise=require(_0xd46e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd46e('0x5'));var rimraf=require(_0xd46e('0x6'));var config=require('../../config/environment');var attributes=require(_0xd46e('0x7'));module[_0xd46e('0x8')]=function(_0x160bcf,_0x25cf78){return _0x160bcf[_0xd46e('0x9')](_0xd46e('0xa'),attributes,{'tableName':_0xd46e('0xb'),'paranoid':![],'indexes':[{'name':_0xd46e('0xc'),'fields':[_0xd46e('0xc')]},{'name':_0xd46e('0xd'),'fields':[_0xd46e('0xd')]},{'name':'priority','fields':[_0xd46e('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 44e7861..f81d427 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 _0xcf3b=['where','body','CreateCmHopper','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','User','Agent','name','voicePause','length','push','update','all','GetContactDialer','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','COUNT','literal','\x22%s\x22','format','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','GetCmHopperPreview','Contact','keys','findOne','phone','getContactByPhone','ResetActiveCalls','interval','NOW()\x20+\x20INTERVAL\x20','CmList','CmHopperHandlePreviewRecallNotifications','util','moment','bluebird','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','attributes','limit','include','map','model','debug','ShowCmHopper','find'];(function(_0x2730da,_0x1098bd){var _0xfe9991=function(_0x2ea521){while(--_0x2ea521){_0x2730da['push'](_0x2730da['shift']());}};_0xfe9991(++_0x1098bd);}(_0xcf3b,0x7f));var _0xbcf3=function(_0x5ced88,_0x30bd98){_0x5ced88=_0x5ced88-0x0;var _0x408d35=_0xcf3b[_0x5ced88];return _0x408d35;};'use strict';var _=require('lodash');var util=require(_0xbcf3('0x0'));var moment=require(_0xbcf3('0x1'));var BPromise=require(_0xbcf3('0x2'));var db=require(_0xbcf3('0x3'))['db'];var logger=require('../../config/logger')(_0xbcf3('0x4'));var jayson=require(_0xbcf3('0x5'));var client=jayson[_0xbcf3('0x6')][_0xbcf3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x24594e,_0x58af7a,_0x108510){return new BPromise(function(_0x4980dc,_0x5ef19d){return client[_0xbcf3('0x8')](_0x24594e,_0x108510)[_0xbcf3('0x9')](function(_0x1c3805){logger[_0xbcf3('0xa')](_0xbcf3('0xb'),_0x58af7a,'request\x20sent');logger['debug']('CmHopper,\x20%s,\x20%s,\x20%s',_0x58af7a,_0xbcf3('0xc'),JSON[_0xbcf3('0xd')](_0x1c3805));if(_0x1c3805[_0xbcf3('0xe')]){if(_0x1c3805[_0xbcf3('0xe')]['code']===0x1f4){logger[_0xbcf3('0xe')](_0xbcf3('0xb'),_0x58af7a,_0x1c3805[_0xbcf3('0xe')][_0xbcf3('0xf')]);return _0x5ef19d(_0x1c3805[_0xbcf3('0xe')][_0xbcf3('0xf')]);}logger['error']('CmHopper,\x20%s,\x20%s',_0x58af7a,_0x1c3805[_0xbcf3('0xe')]['message']);return _0x4980dc(_0x1c3805[_0xbcf3('0xe')][_0xbcf3('0xf')]);}else{logger['info']('CmHopper,\x20%s,\x20%s',_0x58af7a,_0xbcf3('0xc'));_0x4980dc(_0x1c3805[_0xbcf3('0x10')]['message']);}})[_0xbcf3('0x11')](function(_0x38ab4b){logger[_0xbcf3('0xe')](_0xbcf3('0xb'),_0x58af7a,_0x38ab4b);_0x5ef19d(_0x38ab4b);});});}exports[_0xbcf3('0x12')]=function(_0x3f8245){var _0x4954ef=this;return new Promise(function(_0x328fc7,_0x47b791){return db[_0xbcf3('0x13')][_0xbcf3('0x14')]({'raw':_0x3f8245[_0xbcf3('0x15')]?_0x3f8245[_0xbcf3('0x15')][_0xbcf3('0x16')]===undefined?!![]:![]:!![],'where':_0x3f8245[_0xbcf3('0x15')]?_0x3f8245[_0xbcf3('0x15')]['where']||null:null,'attributes':_0x3f8245['options']?_0x3f8245['options'][_0xbcf3('0x17')]||null:null,'limit':_0x3f8245[_0xbcf3('0x15')]?_0x3f8245[_0xbcf3('0x15')][_0xbcf3('0x18')]||null:null,'include':_0x3f8245['options']?_0x3f8245['options'][_0xbcf3('0x19')]?_[_0xbcf3('0x1a')](_0x3f8245[_0xbcf3('0x15')][_0xbcf3('0x19')],function(_0x48b992){return{'model':db[_0x48b992['model']],'as':_0x48b992['as'],'attributes':_0x48b992[_0xbcf3('0x17')],'include':_0x48b992['include']?_[_0xbcf3('0x1a')](_0x48b992['include'],function(_0x49dcb9){return{'model':db[_0x49dcb9[_0xbcf3('0x1b')]],'as':_0x49dcb9['as'],'attributes':_0x49dcb9[_0xbcf3('0x17')],'include':_0x49dcb9['include']?_[_0xbcf3('0x1a')](_0x49dcb9[_0xbcf3('0x19')],function(_0x22074c){return{'model':db[_0x22074c[_0xbcf3('0x1b')]],'as':_0x22074c['as'],'attributes':_0x22074c[_0xbcf3('0x17')]};}):[]};}):[]};}):[]:[]})[_0xbcf3('0x9')](function(_0x54d7b1){logger[_0xbcf3('0xa')](_0xbcf3('0x12'),_0x3f8245);logger[_0xbcf3('0x1c')]('GetCmHopper',_0x3f8245,JSON[_0xbcf3('0xd')](_0x54d7b1));_0x328fc7(_0x54d7b1);})[_0xbcf3('0x11')](function(_0xd2c94f){logger[_0xbcf3('0xe')](_0xbcf3('0x12'),_0xd2c94f[_0xbcf3('0xf')],_0x3f8245);_0x47b791(_0x4954ef['error'](0x1f4,_0xd2c94f[_0xbcf3('0xf')]));});});};exports[_0xbcf3('0x1d')]=function(_0x3095c3){var _0x1dfa51=this;return new Promise(function(_0x43d62c,_0x2cef69){return db[_0xbcf3('0x13')][_0xbcf3('0x1e')]({'raw':_0x3095c3[_0xbcf3('0x15')]?_0x3095c3['options'][_0xbcf3('0x16')]===undefined?!![]:![]:!![],'where':_0x3095c3['options']?_0x3095c3[_0xbcf3('0x15')][_0xbcf3('0x1f')]||null:null,'attributes':_0x3095c3[_0xbcf3('0x15')]?_0x3095c3[_0xbcf3('0x15')][_0xbcf3('0x17')]||null:null,'include':_0x3095c3[_0xbcf3('0x15')]?_0x3095c3[_0xbcf3('0x15')][_0xbcf3('0x19')]?_['map'](_0x3095c3['options']['include'],function(_0x399ab0){return{'model':db[_0x399ab0[_0xbcf3('0x1b')]],'as':_0x399ab0['as'],'attributes':_0x399ab0['attributes'],'include':_0x399ab0[_0xbcf3('0x19')]?_[_0xbcf3('0x1a')](_0x399ab0[_0xbcf3('0x19')],function(_0x191346){return{'model':db[_0x191346['model']],'as':_0x191346['as'],'attributes':_0x191346[_0xbcf3('0x17')],'include':_0x191346['include']?_[_0xbcf3('0x1a')](_0x191346[_0xbcf3('0x19')],function(_0x25a929){return{'model':db[_0x25a929['model']],'as':_0x25a929['as'],'attributes':_0x25a929[_0xbcf3('0x17')]};}):[]};}):[]};}):[]:[]})[_0xbcf3('0x9')](function(_0x568d0c){logger[_0xbcf3('0xa')](_0xbcf3('0x1d'),_0x3095c3);logger[_0xbcf3('0x1c')](_0xbcf3('0x1d'),_0x3095c3,JSON[_0xbcf3('0xd')](_0x568d0c));_0x43d62c(_0x568d0c);})[_0xbcf3('0x11')](function(_0x482183){logger[_0xbcf3('0xe')]('ShowCmHopper',_0x482183[_0xbcf3('0xf')],_0x3095c3);_0x2cef69(_0x1dfa51[_0xbcf3('0xe')](0x1f4,_0x482183[_0xbcf3('0xf')]));});});};exports['CreateCmHopper']=function(_0x171b1c){var _0x54ba26=this;return new Promise(function(_0x4c01e6,_0x360abd){return db['CmHopper']['create'](_0x171b1c[_0xbcf3('0x20')],{'raw':_0x171b1c['options']?_0x171b1c['options'][_0xbcf3('0x16')]===undefined?!![]:![]:!![]})[_0xbcf3('0x9')](function(_0x4dab50){logger[_0xbcf3('0xa')](_0xbcf3('0x21'),_0x171b1c);logger['debug'](_0xbcf3('0x21'),_0x171b1c,JSON[_0xbcf3('0xd')](_0x4dab50));_0x4c01e6(_0x4dab50);})[_0xbcf3('0x11')](function(_0x17c2f3){logger['error']('CreateCmHopper',_0x17c2f3[_0xbcf3('0xf')],_0x171b1c);_0x360abd(_0x54ba26[_0xbcf3('0xe')](0x1f4,_0x17c2f3[_0xbcf3('0xf')]));});});};exports[_0xbcf3('0x22')]=function(_0x4aa5c0){var _0x47d656=this;return new Promise(function(_0x360c1c,_0x3702e1){return db[_0xbcf3('0x13')]['update'](_0x4aa5c0['body'],{'raw':_0x4aa5c0[_0xbcf3('0x15')]?_0x4aa5c0[_0xbcf3('0x15')][_0xbcf3('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4aa5c0[_0xbcf3('0x15')]?_0x4aa5c0[_0xbcf3('0x15')]['where']||null:null,'attributes':_0x4aa5c0[_0xbcf3('0x15')]?_0x4aa5c0[_0xbcf3('0x15')]['attributes']||null:null,'limit':_0x4aa5c0[_0xbcf3('0x15')]?_0x4aa5c0[_0xbcf3('0x15')][_0xbcf3('0x18')]||null:null})['then'](function(_0x364b75){logger['info'](_0xbcf3('0x22'),_0x4aa5c0);logger[_0xbcf3('0xa')](_0xbcf3('0x23'),JSON[_0xbcf3('0xd')](_0x4aa5c0[_0xbcf3('0x15')][_0xbcf3('0x1f')]),_0x4aa5c0['body'][_0xbcf3('0x24')]);logger[_0xbcf3('0x1c')](_0xbcf3('0x22'),_0x4aa5c0,JSON[_0xbcf3('0xd')](_0x364b75));_0x360c1c(_0x364b75);})['catch'](function(_0x465662){logger['error']('UpdateCmHopper',_0x465662[_0xbcf3('0xf')],_0x4aa5c0);_0x3702e1(_0x47d656[_0xbcf3('0xe')](0x1f4,_0x465662['message']));});});};exports[_0xbcf3('0x25')]=function(_0x30f9e3){var _0x4f6b98=this;return new Promise(function(_0x43911e,_0x4188c4){return db['CmHopper'][_0xbcf3('0x26')]({'where':_0x30f9e3[_0xbcf3('0x15')]?_0x30f9e3[_0xbcf3('0x15')][_0xbcf3('0x1f')]||null:null})[_0xbcf3('0x9')](function(_0x3e8b35){logger[_0xbcf3('0xa')](_0xbcf3('0x25'),_0x30f9e3);logger['debug']('DestroyCmHopper',_0x30f9e3,JSON[_0xbcf3('0xd')](_0x3e8b35));_0x43911e(_0x3e8b35);})['catch'](function(_0x5bf2a0){logger[_0xbcf3('0xe')](_0xbcf3('0x25'),_0x5bf2a0[_0xbcf3('0xf')],_0x30f9e3);_0x4188c4(_0x4f6b98[_0xbcf3('0xe')](0x1f4,_0x5bf2a0[_0xbcf3('0xf')]));});});};exports['GetContactDialer']=function(_0x769b86){var _0x1a7b58=this;return new Promise(function(_0x567d4f,_0x2dc506){return db[_0xbcf3('0x27')][_0xbcf3('0x28')]()[_0xbcf3('0x9')](function(_0x1efe0f){return db[_0xbcf3('0x29')][_0xbcf3('0x2a')](function(_0x2f6986){return db[_0xbcf3('0x13')]['findAll']({'where':_0x769b86[_0xbcf3('0x15')]?_0x769b86[_0xbcf3('0x15')][_0xbcf3('0x1f')]||null:null,'attributes':_0x769b86[_0xbcf3('0x15')]?_0x769b86[_0xbcf3('0x15')][_0xbcf3('0x17')]||null:null,'limit':_0x769b86[_0xbcf3('0x15')]?_0x769b86[_0xbcf3('0x15')][_0xbcf3('0x18')]||null:null,'order':_0x769b86[_0xbcf3('0x15')]?_0x769b86[_0xbcf3('0x15')][_0xbcf3('0x2b')]||null:null,'transaction':_0x2f6986,'lock':_0x2f6986[_0xbcf3('0x2c')][_0xbcf3('0x2d')],'include':[{'model':db[_0xbcf3('0x27')],'as':'Contact','attributes':_['keys'](_0x1efe0f)},{'model':db[_0xbcf3('0x2e')],'as':_0xbcf3('0x2f'),'attributes':['id',_0xbcf3('0x30'),_0xbcf3('0x31')]}]})['then'](function(_0xed805a){var _0x2b76bb=[];var _0x3b2f92=[];for(var _0x27b9d9=0x0;_0x27b9d9<_0xed805a[_0xbcf3('0x32')];_0x27b9d9+=0x1){var _0xfd687b=_0xed805a[_0x27b9d9]['UserId'];if(_0xfd687b===null){_0x2b76bb['push'](_0xed805a[_0x27b9d9]['update'](_0x769b86[_0xbcf3('0x20')],{'transaction':_0x2f6986}));}else if(!_0x3b2f92['includes'](_0xfd687b)){_0x3b2f92[_0xbcf3('0x33')](_0xfd687b);_0x2b76bb[_0xbcf3('0x33')](_0xed805a[_0x27b9d9][_0xbcf3('0x34')](_0x769b86[_0xbcf3('0x20')],{'transaction':_0x2f6986}));}}return BPromise[_0xbcf3('0x35')](_0x2b76bb);});})[_0xbcf3('0x9')](function(_0x30284f){logger[_0xbcf3('0xa')](_0xbcf3('0x36'),_0x769b86);if(_0x30284f[_0xbcf3('0x32')]>0x0){logger[_0xbcf3('0xa')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x30284f[0x0]['dataValues']['id'],_0x30284f[0x0][_0xbcf3('0x37')][_0xbcf3('0x38')],_0x30284f[0x0][_0xbcf3('0x37')][_0xbcf3('0x24')]);}logger[_0xbcf3('0x1c')](_0xbcf3('0x36'),_0x769b86,JSON['stringify'](_0x30284f));_0x567d4f(_0x30284f);})[_0xbcf3('0x11')](function(_0x4d769f){logger[_0xbcf3('0xe')](_0xbcf3('0x36'),_0x4d769f['message'],_0x769b86);_0x2dc506(_0x1a7b58[_0xbcf3('0xe')](0x1f4,_0x4d769f[_0xbcf3('0xf')]));});});});};exports[_0xbcf3('0x39')]=function(_0x3a00a8){var _0x4f8b4a=this;return new Promise(function(_0x2aea65,_0x23bc09){return db[_0xbcf3('0x29')][_0xbcf3('0x2a')](function(_0x342dc8){return db[_0xbcf3('0x3a')]['create'](_0x3a00a8[_0xbcf3('0x20')],{'raw':_0x3a00a8[_0xbcf3('0x15')]?_0x3a00a8['options'][_0xbcf3('0x16')]===undefined?!![]:![]:!![],'transaction':_0x342dc8})[_0xbcf3('0x9')](function(){logger[_0xbcf3('0xa')](_0xbcf3('0x3b'),JSON['stringify'](_0x3a00a8[_0xbcf3('0x15')]['where']),_0x3a00a8[_0xbcf3('0x15')][_0xbcf3('0x1f')]['active']);return db['CmHopper'][_0xbcf3('0x26')]({'where':_0x3a00a8[_0xbcf3('0x15')]?_0x3a00a8['options'][_0xbcf3('0x1f')]||null:null,'transaction':_0x342dc8});});})[_0xbcf3('0x9')](function(_0x3daf25){logger[_0xbcf3('0xa')]('MoveContactManagedDialer',_0x3a00a8);logger[_0xbcf3('0x1c')]('MoveContactManagedDialer',_0x3a00a8,JSON['stringify'](_0x3daf25));_0x2aea65(_0x3daf25);})['catch'](function(_0x31cdee){logger['error'](_0xbcf3('0x39'),_0x31cdee[_0xbcf3('0xf')],_0x3a00a8);_0x23bc09(_0x4f8b4a['error'](0x1f4,_0x31cdee[_0xbcf3('0xf')]));});});};exports['CountReScheduled']=function(_0x777bdc){var _0x4207b0=this;return new Promise(function(_0x514f41,_0x45f27c){return db[_0xbcf3('0x13')][_0xbcf3('0x14')]({'raw':_0x777bdc[_0xbcf3('0x15')]?_0x777bdc[_0xbcf3('0x15')][_0xbcf3('0x16')]===undefined?!![]:![]:!![],'where':_0x777bdc['options']?_0x777bdc[_0xbcf3('0x15')][_0xbcf3('0x1f')]||null:null,'attributes':[[db[_0xbcf3('0x29')]['fn'](_0xbcf3('0x3c'),db[_0xbcf3('0x29')]['fn']('IF',db[_0xbcf3('0x29')][_0xbcf3('0x3d')]('`scheduledat`\x20>=\x20'+util['format'](_0xbcf3('0x3e'),moment()[_0xbcf3('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xbcf3('0x40')))),_0xbcf3('0x41')]]})[_0xbcf3('0x9')](function(_0x3ee8ea){logger['info'](_0xbcf3('0x42'),_0x777bdc);logger[_0xbcf3('0x1c')]('CountReScheduled',_0x777bdc,JSON[_0xbcf3('0xd')](_0x3ee8ea));_0x514f41(_0x3ee8ea);})['catch'](function(_0x11b504){logger[_0xbcf3('0xe')](_0xbcf3('0x42'),_0x11b504[_0xbcf3('0xf')],_0x777bdc);_0x45f27c(_0x4207b0[_0xbcf3('0xe')](0x1f4,_0x11b504['message']));});});};exports[_0xbcf3('0x43')]=function(_0x37a115){var _0x1e4783=this;return new Promise(function(_0x223e47,_0x481d01){return db[_0xbcf3('0x27')]['describe']()['then'](function(_0x4206d1){return db['sequelize'][_0xbcf3('0x2a')](function(_0x17c044){return db['CmHopper'][_0xbcf3('0x14')]({'where':_0x37a115[_0xbcf3('0x15')]?_0x37a115[_0xbcf3('0x15')][_0xbcf3('0x1f')]||null:null,'attributes':_0x37a115['options']?_0x37a115[_0xbcf3('0x15')][_0xbcf3('0x17')]||null:null,'limit':0x1,'order':_0x37a115[_0xbcf3('0x15')]?_0x37a115[_0xbcf3('0x15')][_0xbcf3('0x2b')]||null:null,'group':db['CmHopper']['UserId'],'transaction':_0x17c044,'lock':_0x17c044['LOCK'][_0xbcf3('0x2d')],'include':_0x37a115[_0xbcf3('0x15')]?_0x37a115['options'][_0xbcf3('0x19')]?_[_0xbcf3('0x1a')](_0x37a115[_0xbcf3('0x15')]['include'],function(_0x308438){return{'model':db[_0x308438[_0xbcf3('0x1b')]],'as':_0x308438['as'],'attributes':_0x308438[_0xbcf3('0x17')],'include':_0x308438[_0xbcf3('0x19')]?_[_0xbcf3('0x1a')](_0x308438[_0xbcf3('0x19')],function(_0x3ce787){return{'model':db[_0x3ce787[_0xbcf3('0x1b')]],'as':_0x3ce787['as'],'attributes':_0x3ce787['attributes'],'include':_0x3ce787['include']?_[_0xbcf3('0x1a')](_0x3ce787[_0xbcf3('0x19')],function(_0x4e68bb){return{'model':db[_0x4e68bb[_0xbcf3('0x1b')]],'as':_0x4e68bb['as'],'attributes':_0x4e68bb[_0xbcf3('0x17')]};}):[]};}):[]};}):[]:[]})[_0xbcf3('0x9')](function(_0x8eeef4){var _0x300982=[];for(var _0x25bf8c=0x0;_0x25bf8c<_0x8eeef4['length'];_0x25bf8c+=0x1){_0x300982[_0xbcf3('0x33')](_0x8eeef4[_0x25bf8c][_0xbcf3('0x34')](_0x37a115[_0xbcf3('0x20')],{'transaction':_0x17c044}));}return BPromise[_0xbcf3('0x35')](_0x300982);});})['then'](function(_0x2e008f){logger[_0xbcf3('0xa')]('GetContactRecallMe',_0x37a115);logger[_0xbcf3('0x1c')](_0xbcf3('0x43'),_0x37a115,JSON['stringify'](_0x2e008f));_0x223e47(_0x2e008f);})[_0xbcf3('0x11')](function(_0x280767){logger[_0xbcf3('0xe')](_0xbcf3('0x43'),_0x280767[_0xbcf3('0xf')],_0x37a115);_0x481d01(_0x1e4783[_0xbcf3('0xe')](0x1f4,_0x280767[_0xbcf3('0xf')]));});});});};exports[_0xbcf3('0x44')]=function(_0x528d01){var _0xd0d26e=this;return new Promise(function(_0x23cf48,_0x3a3353){db[_0xbcf3('0x27')]['describe']()[_0xbcf3('0x9')](function(_0x39404a){return db[_0xbcf3('0x13')]['findAll']({'raw':_0x528d01['options']?_0x528d01[_0xbcf3('0x15')][_0xbcf3('0x16')]===undefined?!![]:![]:!![],'where':_0x528d01[_0xbcf3('0x15')]?_0x528d01[_0xbcf3('0x15')][_0xbcf3('0x1f')]||null:null,'attributes':_0x528d01[_0xbcf3('0x15')]?_0x528d01[_0xbcf3('0x15')][_0xbcf3('0x17')]||null:null,'limit':_0x528d01[_0xbcf3('0x15')]?_0x528d01[_0xbcf3('0x15')][_0xbcf3('0x18')]||null:null,'include':_0x528d01['options']?_0x528d01[_0xbcf3('0x15')][_0xbcf3('0x19')]?_[_0xbcf3('0x1a')](_0x528d01[_0xbcf3('0x15')][_0xbcf3('0x19')],function(_0x55d324){return{'model':db[_0x55d324['model']],'as':_0x55d324['as'],'attributes':_0x55d324['as']===_0xbcf3('0x45')?_[_0xbcf3('0x46')](_0x39404a):_0x55d324[_0xbcf3('0x17')],'include':_0x55d324[_0xbcf3('0x19')]?_[_0xbcf3('0x1a')](_0x55d324[_0xbcf3('0x19')],function(_0x335563){return{'model':db[_0x335563[_0xbcf3('0x1b')]],'as':_0x335563['as'],'attributes':_0x335563[_0xbcf3('0x17')],'include':_0x335563['include']?_['map'](_0x335563[_0xbcf3('0x19')],function(_0x21402f){return{'model':db[_0x21402f[_0xbcf3('0x1b')]],'as':_0x21402f['as'],'attributes':_0x21402f['attributes']};}):[]};}):[]};}):[]:[]})[_0xbcf3('0x9')](function(_0x45ae28){logger[_0xbcf3('0xa')]('GetCmHopper',_0x528d01);logger[_0xbcf3('0x1c')](_0xbcf3('0x12'),_0x528d01,JSON[_0xbcf3('0xd')](_0x45ae28));_0x23cf48(_0x45ae28);})[_0xbcf3('0x11')](function(_0x5dfb9e){logger[_0xbcf3('0xe')](_0xbcf3('0x12'),_0x5dfb9e['message'],_0x528d01);_0x3a3353(_0xd0d26e[_0xbcf3('0xe')](0x1f4,_0x5dfb9e[_0xbcf3('0xf')]));});});});};exports['GetContactByPhone']=function(_0x4dc82e){var _0x20c666=this;return new Promise(function(_0x1ae291,_0x2ca2cf){return db['CmContact'][_0xbcf3('0x47')]({'raw':!![],'where':{'phone':_0x4dc82e[_0xbcf3('0x15')][_0xbcf3('0x1f')][_0xbcf3('0x48')]},'attributes':['id','dialTimezone'],'order':[['id','DESC']]})[_0xbcf3('0x9')](function(_0x14cc58){logger[_0xbcf3('0xa')]('getContactByPhone',_0x4dc82e);logger[_0xbcf3('0x1c')]('getContactByPhone',_0x4dc82e,JSON['stringify'](_0x14cc58));_0x1ae291(_0x14cc58);})[_0xbcf3('0x11')](function(_0x11f310){logger[_0xbcf3('0xe')](_0xbcf3('0x49'),_0x11f310[_0xbcf3('0xf')],_0x4dc82e);_0x2ca2cf(_0x20c666[_0xbcf3('0xe')](0x1f4,_0x11f310[_0xbcf3('0xf')]));});});};exports[_0xbcf3('0x4a')]=function(_0x5b2c2e){var _0x2b95b6=this;return new Promise(function(_0x54bdd7,_0x433bb2){return db['sequelize'][_0xbcf3('0x2a')](function(_0x363edb){return db[_0xbcf3('0x13')][_0xbcf3('0x34')](_0x5b2c2e[_0xbcf3('0x20')],{'where':{},'transaction':_0x363edb})['then'](function(_0x5866fd){logger[_0xbcf3('0xa')]('ResetActiveCalls',_0x5b2c2e);logger[_0xbcf3('0x1c')](_0xbcf3('0x4a'),_0x5b2c2e,JSON[_0xbcf3('0xd')](_0x5866fd));_0x54bdd7(_0x5866fd);})[_0xbcf3('0x11')](function(_0x47ab5c){logger['error'](_0xbcf3('0x4a'),_0x47ab5c['message'],_0x5b2c2e);_0x433bb2(_0x2b95b6[_0xbcf3('0xe')](0x1f4,_0x47ab5c[_0xbcf3('0xf')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x475d0a){var _0x105237=this;var _0x380436=_0x475d0a[_0xbcf3('0x20')][_0xbcf3('0x1f')]['voiceQueueIds'];var _0x51c1c5=_0x475d0a[_0xbcf3('0x20')][_0xbcf3('0x1f')][_0xbcf3('0x4b')];var _0xc5610c=_0x475d0a[_0xbcf3('0x20')][_0xbcf3('0x1f')]['availableAgentsIds'];return new Promise(function(_0x13640a,_0x3b0841){return db[_0xbcf3('0x13')][_0xbcf3('0x14')]({'where':{'voiceQueueId':{'$in':_0x380436},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xbcf3('0x29')]['literal'](_0xbcf3('0x4c')+_0x51c1c5+'\x20MINUTE'),'$gt':db[_0xbcf3('0x29')][_0xbcf3('0x3d')]('NOW()')}},'UserId':{'$in':_0xc5610c}},'include':[{'model':db['CmContact'],'as':_0xbcf3('0x45')},{'model':db['User'],'as':_0xbcf3('0x2f'),'attributes':['id',_0xbcf3('0x30'),_0xbcf3('0x31')]},{'model':db[_0xbcf3('0x4d')],'as':'List'}]})['then'](function(_0x3d8db2){if(_0x3d8db2[_0xbcf3('0x32')]>0x0){return db['sequelize'][_0xbcf3('0x2a')](function(_0x4e2163){return db[_0xbcf3('0x13')]['update']({'recallmeNotifiedDate':db['sequelize'][_0xbcf3('0x3d')]('NOW()')},{'where':{'id':{'$in':_[_0xbcf3('0x1a')](_0x3d8db2,'id')}},'transaction':_0x4e2163})[_0xbcf3('0x9')](function(){_0x13640a(_0x3d8db2);})[_0xbcf3('0x11')](function(_0x551171){logger[_0xbcf3('0xe')]('CmHopperHandlePreviewRecallNotifications',_0x551171[_0xbcf3('0xf')],_0x475d0a);_0x3b0841(_0x105237[_0xbcf3('0xe')](0x1f4,_0x551171['message']));});})[_0xbcf3('0x11')](function(_0x402d7c){logger[_0xbcf3('0xe')](_0xbcf3('0x4e'),_0x402d7c[_0xbcf3('0xf')],_0x475d0a);_0x3b0841(_0x105237['error'](0x1f4,_0x402d7c['message']));});}else{_0x13640a(_0x3d8db2);}});});}; \ No newline at end of file +var _0xf706=['findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','NOW()\x20+\x20INTERVAL\x20','Contact','CmList','List','lodash','util','bluebird','rpc','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetCmHopper','CmHopper','findAll','options','where','attributes','limit','include','map','model','ShowCmHopper','find','raw','CreateCmHopper','body','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','debug','DestroyCmHopper','CmContact','transaction','order','LOCK','UPDATE','keys','User','Agent','name','voicePause','UserId','push','update','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','GetContactDialer','sequelize','CmHopperFinal','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','CountReScheduled','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','describe','length','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone'];(function(_0x35ca9c,_0x44b0c7){var _0x4dd5bd=function(_0x31b1d6){while(--_0x31b1d6){_0x35ca9c['push'](_0x35ca9c['shift']());}};_0x4dd5bd(++_0x44b0c7);}(_0xf706,0x16d));var _0x6f70=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0xf706[_0x4e6ae6];return _0x23c108;};'use strict';var _=require(_0x6f70('0x0'));var util=require(_0x6f70('0x1'));var moment=require('moment');var BPromise=require(_0x6f70('0x2'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x6f70('0x3'));var jayson=require(_0x6f70('0x4'));var client=jayson[_0x6f70('0x5')][_0x6f70('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x44b0e3,_0x58a53e,_0x5417c5){return new BPromise(function(_0x92e315,_0x5104fd){return client[_0x6f70('0x7')](_0x44b0e3,_0x5417c5)[_0x6f70('0x8')](function(_0x11cc8c){logger[_0x6f70('0x9')](_0x6f70('0xa'),_0x58a53e,'request\x20sent');logger['debug'](_0x6f70('0xb'),_0x58a53e,'request\x20sent',JSON[_0x6f70('0xc')](_0x11cc8c));if(_0x11cc8c[_0x6f70('0xd')]){if(_0x11cc8c[_0x6f70('0xd')][_0x6f70('0xe')]===0x1f4){logger['error']('CmHopper,\x20%s,\x20%s',_0x58a53e,_0x11cc8c['error'][_0x6f70('0xf')]);return _0x5104fd(_0x11cc8c[_0x6f70('0xd')]['message']);}logger['error'](_0x6f70('0xa'),_0x58a53e,_0x11cc8c['error'][_0x6f70('0xf')]);return _0x92e315(_0x11cc8c[_0x6f70('0xd')][_0x6f70('0xf')]);}else{logger[_0x6f70('0x9')](_0x6f70('0xa'),_0x58a53e,_0x6f70('0x10'));_0x92e315(_0x11cc8c[_0x6f70('0x11')][_0x6f70('0xf')]);}})[_0x6f70('0x12')](function(_0x444b97){logger['error'](_0x6f70('0xa'),_0x58a53e,_0x444b97);_0x5104fd(_0x444b97);});});}exports[_0x6f70('0x13')]=function(_0x4408f7){var _0x381cab=this;return new Promise(function(_0x5e35cd,_0x5aeffa){return db[_0x6f70('0x14')][_0x6f70('0x15')]({'raw':_0x4408f7[_0x6f70('0x16')]?_0x4408f7[_0x6f70('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4408f7[_0x6f70('0x16')]?_0x4408f7[_0x6f70('0x16')][_0x6f70('0x17')]||null:null,'attributes':_0x4408f7[_0x6f70('0x16')]?_0x4408f7[_0x6f70('0x16')][_0x6f70('0x18')]||null:null,'limit':_0x4408f7['options']?_0x4408f7[_0x6f70('0x16')][_0x6f70('0x19')]||null:null,'include':_0x4408f7[_0x6f70('0x16')]?_0x4408f7['options'][_0x6f70('0x1a')]?_[_0x6f70('0x1b')](_0x4408f7[_0x6f70('0x16')][_0x6f70('0x1a')],function(_0x1597fe){return{'model':db[_0x1597fe[_0x6f70('0x1c')]],'as':_0x1597fe['as'],'attributes':_0x1597fe[_0x6f70('0x18')],'include':_0x1597fe[_0x6f70('0x1a')]?_[_0x6f70('0x1b')](_0x1597fe[_0x6f70('0x1a')],function(_0x58d18e){return{'model':db[_0x58d18e[_0x6f70('0x1c')]],'as':_0x58d18e['as'],'attributes':_0x58d18e[_0x6f70('0x18')],'include':_0x58d18e['include']?_[_0x6f70('0x1b')](_0x58d18e[_0x6f70('0x1a')],function(_0x3eb568){return{'model':db[_0x3eb568['model']],'as':_0x3eb568['as'],'attributes':_0x3eb568[_0x6f70('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x48846b){logger['info'](_0x6f70('0x13'),_0x4408f7);logger['debug'](_0x6f70('0x13'),_0x4408f7,JSON[_0x6f70('0xc')](_0x48846b));_0x5e35cd(_0x48846b);})[_0x6f70('0x12')](function(_0x1ff400){logger[_0x6f70('0xd')]('GetCmHopper',_0x1ff400[_0x6f70('0xf')],_0x4408f7);_0x5aeffa(_0x381cab['error'](0x1f4,_0x1ff400[_0x6f70('0xf')]));});});};exports[_0x6f70('0x1d')]=function(_0x3969cb){var _0x352ebb=this;return new Promise(function(_0x8f2c44,_0x4fae58){return db[_0x6f70('0x14')][_0x6f70('0x1e')]({'raw':_0x3969cb[_0x6f70('0x16')]?_0x3969cb['options'][_0x6f70('0x1f')]===undefined?!![]:![]:!![],'where':_0x3969cb['options']?_0x3969cb[_0x6f70('0x16')][_0x6f70('0x17')]||null:null,'attributes':_0x3969cb[_0x6f70('0x16')]?_0x3969cb[_0x6f70('0x16')][_0x6f70('0x18')]||null:null,'include':_0x3969cb[_0x6f70('0x16')]?_0x3969cb[_0x6f70('0x16')][_0x6f70('0x1a')]?_[_0x6f70('0x1b')](_0x3969cb[_0x6f70('0x16')][_0x6f70('0x1a')],function(_0x4da069){return{'model':db[_0x4da069['model']],'as':_0x4da069['as'],'attributes':_0x4da069['attributes'],'include':_0x4da069[_0x6f70('0x1a')]?_[_0x6f70('0x1b')](_0x4da069[_0x6f70('0x1a')],function(_0x51903a){return{'model':db[_0x51903a[_0x6f70('0x1c')]],'as':_0x51903a['as'],'attributes':_0x51903a[_0x6f70('0x18')],'include':_0x51903a[_0x6f70('0x1a')]?_[_0x6f70('0x1b')](_0x51903a[_0x6f70('0x1a')],function(_0x430770){return{'model':db[_0x430770['model']],'as':_0x430770['as'],'attributes':_0x430770[_0x6f70('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6f70('0x8')](function(_0xe3d4f7){logger[_0x6f70('0x9')](_0x6f70('0x1d'),_0x3969cb);logger['debug']('ShowCmHopper',_0x3969cb,JSON[_0x6f70('0xc')](_0xe3d4f7));_0x8f2c44(_0xe3d4f7);})['catch'](function(_0x2c1354){logger[_0x6f70('0xd')](_0x6f70('0x1d'),_0x2c1354[_0x6f70('0xf')],_0x3969cb);_0x4fae58(_0x352ebb[_0x6f70('0xd')](0x1f4,_0x2c1354[_0x6f70('0xf')]));});});};exports[_0x6f70('0x20')]=function(_0x51b98d){var _0x59243b=this;return new Promise(function(_0x32449c,_0x277d90){return db[_0x6f70('0x14')]['create'](_0x51b98d[_0x6f70('0x21')],{'raw':_0x51b98d[_0x6f70('0x16')]?_0x51b98d[_0x6f70('0x16')][_0x6f70('0x1f')]===undefined?!![]:![]:!![]})[_0x6f70('0x8')](function(_0x4bb4cd){logger[_0x6f70('0x9')](_0x6f70('0x20'),_0x51b98d);logger['debug'](_0x6f70('0x20'),_0x51b98d,JSON['stringify'](_0x4bb4cd));_0x32449c(_0x4bb4cd);})[_0x6f70('0x12')](function(_0xa53266){logger[_0x6f70('0xd')]('CreateCmHopper',_0xa53266['message'],_0x51b98d);_0x277d90(_0x59243b[_0x6f70('0xd')](0x1f4,_0xa53266['message']));});});};exports[_0x6f70('0x22')]=function(_0x32b45f){var _0x5873a4=this;return new Promise(function(_0x59fbab,_0x59b1c1){return db['CmHopper']['update'](_0x32b45f[_0x6f70('0x21')],{'raw':_0x32b45f[_0x6f70('0x16')]?_0x32b45f[_0x6f70('0x16')][_0x6f70('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32b45f[_0x6f70('0x16')]?_0x32b45f[_0x6f70('0x16')][_0x6f70('0x17')]||null:null,'attributes':_0x32b45f[_0x6f70('0x16')]?_0x32b45f[_0x6f70('0x16')][_0x6f70('0x18')]||null:null,'limit':_0x32b45f[_0x6f70('0x16')]?_0x32b45f['options'][_0x6f70('0x19')]||null:null})[_0x6f70('0x8')](function(_0x4a029a){logger[_0x6f70('0x9')]('UpdateCmHopper',_0x32b45f);logger[_0x6f70('0x9')](_0x6f70('0x23'),JSON[_0x6f70('0xc')](_0x32b45f[_0x6f70('0x16')]['where']),_0x32b45f[_0x6f70('0x21')][_0x6f70('0x24')]);logger[_0x6f70('0x25')](_0x6f70('0x22'),_0x32b45f,JSON['stringify'](_0x4a029a));_0x59fbab(_0x4a029a);})[_0x6f70('0x12')](function(_0x479dd1){logger[_0x6f70('0xd')]('UpdateCmHopper',_0x479dd1['message'],_0x32b45f);_0x59b1c1(_0x5873a4[_0x6f70('0xd')](0x1f4,_0x479dd1['message']));});});};exports['DestroyCmHopper']=function(_0x580116){var _0x5f4e0e=this;return new Promise(function(_0x418177,_0x43b847){return db['CmHopper']['destroy']({'where':_0x580116[_0x6f70('0x16')]?_0x580116[_0x6f70('0x16')][_0x6f70('0x17')]||null:null})['then'](function(_0x2728fd){logger[_0x6f70('0x9')](_0x6f70('0x26'),_0x580116);logger[_0x6f70('0x25')]('DestroyCmHopper',_0x580116,JSON['stringify'](_0x2728fd));_0x418177(_0x2728fd);})['catch'](function(_0xa11d13){logger['error'](_0x6f70('0x26'),_0xa11d13[_0x6f70('0xf')],_0x580116);_0x43b847(_0x5f4e0e['error'](0x1f4,_0xa11d13[_0x6f70('0xf')]));});});};exports['GetContactDialer']=function(_0x12142d){var _0x110d08=this;return new Promise(function(_0x493acf,_0xa134eb){return db[_0x6f70('0x27')]['describe']()[_0x6f70('0x8')](function(_0x463d52){return db['sequelize'][_0x6f70('0x28')](function(_0x5dedf7){return db[_0x6f70('0x14')]['findAll']({'where':_0x12142d[_0x6f70('0x16')]?_0x12142d[_0x6f70('0x16')][_0x6f70('0x17')]||null:null,'attributes':_0x12142d[_0x6f70('0x16')]?_0x12142d[_0x6f70('0x16')][_0x6f70('0x18')]||null:null,'limit':_0x12142d[_0x6f70('0x16')]?_0x12142d[_0x6f70('0x16')]['limit']||null:null,'order':_0x12142d['options']?_0x12142d[_0x6f70('0x16')][_0x6f70('0x29')]||null:null,'transaction':_0x5dedf7,'lock':_0x5dedf7[_0x6f70('0x2a')][_0x6f70('0x2b')],'include':[{'model':db[_0x6f70('0x27')],'as':'Contact','attributes':_[_0x6f70('0x2c')](_0x463d52)},{'model':db[_0x6f70('0x2d')],'as':_0x6f70('0x2e'),'attributes':['id',_0x6f70('0x2f'),_0x6f70('0x30')]}]})['then'](function(_0x6fb5ae){var _0x41d5a2=[];var _0xd47cce=[];for(var _0x125713=0x0;_0x125713<_0x6fb5ae['length'];_0x125713+=0x1){var _0x5c29cf=_0x6fb5ae[_0x125713][_0x6f70('0x31')];if(_0x5c29cf===null){_0x41d5a2[_0x6f70('0x32')](_0x6fb5ae[_0x125713][_0x6f70('0x33')](_0x12142d[_0x6f70('0x21')],{'transaction':_0x5dedf7}));}else if(!_0xd47cce[_0x6f70('0x34')](_0x5c29cf)){_0xd47cce['push'](_0x5c29cf);_0x41d5a2[_0x6f70('0x32')](_0x6fb5ae[_0x125713]['update'](_0x12142d[_0x6f70('0x21')],{'transaction':_0x5dedf7}));}}return BPromise[_0x6f70('0x35')](_0x41d5a2);});})[_0x6f70('0x8')](function(_0x14f314){logger[_0x6f70('0x9')]('GetContactDialer',_0x12142d);if(_0x14f314['length']>0x0){logger[_0x6f70('0x9')](_0x6f70('0x36'),_0x14f314[0x0][_0x6f70('0x37')]['id'],_0x14f314[0x0][_0x6f70('0x37')][_0x6f70('0x38')],_0x14f314[0x0]['dataValues'][_0x6f70('0x24')]);}logger['debug'](_0x6f70('0x39'),_0x12142d,JSON[_0x6f70('0xc')](_0x14f314));_0x493acf(_0x14f314);})['catch'](function(_0x20ed8c){logger[_0x6f70('0xd')](_0x6f70('0x39'),_0x20ed8c[_0x6f70('0xf')],_0x12142d);_0xa134eb(_0x110d08[_0x6f70('0xd')](0x1f4,_0x20ed8c[_0x6f70('0xf')]));});});});};exports['MoveContactManagedDialer']=function(_0x3f3ab5){var _0x2d87fb=this;return new Promise(function(_0x5dcfa5,_0x3aacf8){return db[_0x6f70('0x3a')][_0x6f70('0x28')](function(_0x1457f8){return db[_0x6f70('0x3b')][_0x6f70('0x3c')](_0x3f3ab5[_0x6f70('0x21')],{'raw':_0x3f3ab5['options']?_0x3f3ab5[_0x6f70('0x16')][_0x6f70('0x1f')]===undefined?!![]:![]:!![],'transaction':_0x1457f8})[_0x6f70('0x8')](function(){logger[_0x6f70('0x9')](_0x6f70('0x3d'),JSON['stringify'](_0x3f3ab5[_0x6f70('0x16')][_0x6f70('0x17')]),_0x3f3ab5[_0x6f70('0x16')][_0x6f70('0x17')][_0x6f70('0x24')]);return db[_0x6f70('0x14')][_0x6f70('0x3e')]({'where':_0x3f3ab5['options']?_0x3f3ab5[_0x6f70('0x16')][_0x6f70('0x17')]||null:null,'transaction':_0x1457f8});});})['then'](function(_0x1a974f){logger['info']('MoveContactManagedDialer',_0x3f3ab5);logger[_0x6f70('0x25')]('MoveContactManagedDialer',_0x3f3ab5,JSON['stringify'](_0x1a974f));_0x5dcfa5(_0x1a974f);})[_0x6f70('0x12')](function(_0x3b25f4){logger[_0x6f70('0xd')]('MoveContactManagedDialer',_0x3b25f4[_0x6f70('0xf')],_0x3f3ab5);_0x3aacf8(_0x2d87fb[_0x6f70('0xd')](0x1f4,_0x3b25f4['message']));});});};exports[_0x6f70('0x3f')]=function(_0x5465a3){var _0x45c9b1=this;return new Promise(function(_0x4f77bf,_0x53f38d){return db[_0x6f70('0x14')][_0x6f70('0x15')]({'raw':_0x5465a3[_0x6f70('0x16')]?_0x5465a3[_0x6f70('0x16')][_0x6f70('0x1f')]===undefined?!![]:![]:!![],'where':_0x5465a3[_0x6f70('0x16')]?_0x5465a3['options'][_0x6f70('0x17')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x6f70('0x3a')]['fn']('IF',db['sequelize'][_0x6f70('0x40')](_0x6f70('0x41')+util['format']('\x22%s\x22',moment()[_0x6f70('0x42')](_0x6f70('0x43')))+_0x6f70('0x44')))),_0x6f70('0x45')]]})[_0x6f70('0x8')](function(_0xd0c2b){logger[_0x6f70('0x9')](_0x6f70('0x3f'),_0x5465a3);logger[_0x6f70('0x25')]('CountReScheduled',_0x5465a3,JSON[_0x6f70('0xc')](_0xd0c2b));_0x4f77bf(_0xd0c2b);})[_0x6f70('0x12')](function(_0x11cae8){logger[_0x6f70('0xd')](_0x6f70('0x3f'),_0x11cae8[_0x6f70('0xf')],_0x5465a3);_0x53f38d(_0x45c9b1[_0x6f70('0xd')](0x1f4,_0x11cae8[_0x6f70('0xf')]));});});};exports['GetContactRecallMe']=function(_0x14eaa0){var _0x35db64=this;return new Promise(function(_0x257e7f,_0x6362e3){return db['CmContact'][_0x6f70('0x46')]()[_0x6f70('0x8')](function(_0x3965c0){return db[_0x6f70('0x3a')]['transaction'](function(_0x53698b){return db[_0x6f70('0x14')][_0x6f70('0x15')]({'where':_0x14eaa0[_0x6f70('0x16')]?_0x14eaa0[_0x6f70('0x16')][_0x6f70('0x17')]||null:null,'attributes':_0x14eaa0['options']?_0x14eaa0['options'][_0x6f70('0x18')]||null:null,'limit':0x1,'order':_0x14eaa0['options']?_0x14eaa0[_0x6f70('0x16')][_0x6f70('0x29')]||null:null,'group':db[_0x6f70('0x14')][_0x6f70('0x31')],'transaction':_0x53698b,'lock':_0x53698b[_0x6f70('0x2a')][_0x6f70('0x2b')],'include':_0x14eaa0[_0x6f70('0x16')]?_0x14eaa0[_0x6f70('0x16')][_0x6f70('0x1a')]?_[_0x6f70('0x1b')](_0x14eaa0[_0x6f70('0x16')]['include'],function(_0xb2ea02){return{'model':db[_0xb2ea02['model']],'as':_0xb2ea02['as'],'attributes':_0xb2ea02[_0x6f70('0x18')],'include':_0xb2ea02['include']?_[_0x6f70('0x1b')](_0xb2ea02[_0x6f70('0x1a')],function(_0x1c497d){return{'model':db[_0x1c497d[_0x6f70('0x1c')]],'as':_0x1c497d['as'],'attributes':_0x1c497d[_0x6f70('0x18')],'include':_0x1c497d['include']?_[_0x6f70('0x1b')](_0x1c497d[_0x6f70('0x1a')],function(_0x403ed6){return{'model':db[_0x403ed6[_0x6f70('0x1c')]],'as':_0x403ed6['as'],'attributes':_0x403ed6[_0x6f70('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6f70('0x8')](function(_0x31285f){var _0x4a6eba=[];for(var _0x1daec0=0x0;_0x1daec0<_0x31285f[_0x6f70('0x47')];_0x1daec0+=0x1){_0x4a6eba['push'](_0x31285f[_0x1daec0][_0x6f70('0x33')](_0x14eaa0[_0x6f70('0x21')],{'transaction':_0x53698b}));}return BPromise[_0x6f70('0x35')](_0x4a6eba);});})['then'](function(_0x5b790a){logger[_0x6f70('0x9')](_0x6f70('0x48'),_0x14eaa0);logger['debug']('GetContactRecallMe',_0x14eaa0,JSON[_0x6f70('0xc')](_0x5b790a));_0x257e7f(_0x5b790a);})[_0x6f70('0x12')](function(_0x1e17d2){logger[_0x6f70('0xd')]('GetContactRecallMe',_0x1e17d2[_0x6f70('0xf')],_0x14eaa0);_0x6362e3(_0x35db64[_0x6f70('0xd')](0x1f4,_0x1e17d2[_0x6f70('0xf')]));});});});};exports[_0x6f70('0x49')]=function(_0x2b7f3e){var _0xa34080=this;return new Promise(function(_0x45d72f,_0xdc7f2c){db[_0x6f70('0x27')][_0x6f70('0x46')]()['then'](function(_0x1c71fc){return db[_0x6f70('0x14')][_0x6f70('0x15')]({'raw':_0x2b7f3e[_0x6f70('0x16')]?_0x2b7f3e['options'][_0x6f70('0x1f')]===undefined?!![]:![]:!![],'where':_0x2b7f3e[_0x6f70('0x16')]?_0x2b7f3e[_0x6f70('0x16')][_0x6f70('0x17')]||null:null,'attributes':_0x2b7f3e['options']?_0x2b7f3e[_0x6f70('0x16')][_0x6f70('0x18')]||null:null,'limit':_0x2b7f3e[_0x6f70('0x16')]?_0x2b7f3e[_0x6f70('0x16')][_0x6f70('0x19')]||null:null,'include':_0x2b7f3e[_0x6f70('0x16')]?_0x2b7f3e[_0x6f70('0x16')][_0x6f70('0x1a')]?_[_0x6f70('0x1b')](_0x2b7f3e['options'][_0x6f70('0x1a')],function(_0x1c7642){return{'model':db[_0x1c7642[_0x6f70('0x1c')]],'as':_0x1c7642['as'],'attributes':_0x1c7642['as']==='Contact'?_[_0x6f70('0x2c')](_0x1c71fc):_0x1c7642[_0x6f70('0x18')],'include':_0x1c7642['include']?_[_0x6f70('0x1b')](_0x1c7642['include'],function(_0x3f0b4d){return{'model':db[_0x3f0b4d[_0x6f70('0x1c')]],'as':_0x3f0b4d['as'],'attributes':_0x3f0b4d[_0x6f70('0x18')],'include':_0x3f0b4d['include']?_['map'](_0x3f0b4d[_0x6f70('0x1a')],function(_0x26fa43){return{'model':db[_0x26fa43[_0x6f70('0x1c')]],'as':_0x26fa43['as'],'attributes':_0x26fa43[_0x6f70('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6f70('0x8')](function(_0x5a45e9){logger[_0x6f70('0x9')](_0x6f70('0x13'),_0x2b7f3e);logger[_0x6f70('0x25')](_0x6f70('0x13'),_0x2b7f3e,JSON[_0x6f70('0xc')](_0x5a45e9));_0x45d72f(_0x5a45e9);})['catch'](function(_0x599a6d){logger[_0x6f70('0xd')](_0x6f70('0x13'),_0x599a6d[_0x6f70('0xf')],_0x2b7f3e);_0xdc7f2c(_0xa34080[_0x6f70('0xd')](0x1f4,_0x599a6d[_0x6f70('0xf')]));});});});};exports[_0x6f70('0x4a')]=function(_0x4024b1){var _0x26309f=this;return new Promise(function(_0x23b77f,_0x4a6117){return db[_0x6f70('0x27')][_0x6f70('0x4b')]({'raw':!![],'where':{'phone':_0x4024b1[_0x6f70('0x16')][_0x6f70('0x17')][_0x6f70('0x4c')]},'attributes':['id',_0x6f70('0x4d')],'order':[['id',_0x6f70('0x4e')]]})[_0x6f70('0x8')](function(_0x5c7a44){logger[_0x6f70('0x9')](_0x6f70('0x4f'),_0x4024b1);logger[_0x6f70('0x25')](_0x6f70('0x4f'),_0x4024b1,JSON[_0x6f70('0xc')](_0x5c7a44));_0x23b77f(_0x5c7a44);})[_0x6f70('0x12')](function(_0x3a244f){logger[_0x6f70('0xd')](_0x6f70('0x4f'),_0x3a244f[_0x6f70('0xf')],_0x4024b1);_0x4a6117(_0x26309f[_0x6f70('0xd')](0x1f4,_0x3a244f['message']));});});};exports[_0x6f70('0x50')]=function(_0xc6f3ae){var _0x4509d6=this;return new Promise(function(_0x4296d6,_0x50a7ea){return db[_0x6f70('0x3a')][_0x6f70('0x28')](function(_0x3e0b21){return db[_0x6f70('0x14')][_0x6f70('0x33')](_0xc6f3ae[_0x6f70('0x21')],{'where':{},'transaction':_0x3e0b21})['then'](function(_0x237944){logger[_0x6f70('0x9')](_0x6f70('0x50'),_0xc6f3ae);logger[_0x6f70('0x25')](_0x6f70('0x50'),_0xc6f3ae,JSON['stringify'](_0x237944));_0x4296d6(_0x237944);})[_0x6f70('0x12')](function(_0x3e77a2){logger['error'](_0x6f70('0x50'),_0x3e77a2['message'],_0xc6f3ae);_0x50a7ea(_0x4509d6['error'](0x1f4,_0x3e77a2[_0x6f70('0xf')]));});});});};exports[_0x6f70('0x51')]=function(_0x290052){var _0x199dac=this;var _0x590d4a=_0x290052[_0x6f70('0x21')][_0x6f70('0x17')][_0x6f70('0x52')];var _0x316346=_0x290052[_0x6f70('0x21')][_0x6f70('0x17')][_0x6f70('0x53')];var _0x40336c=_0x290052[_0x6f70('0x21')]['where']['availableAgentsIds'];return new Promise(function(_0x3807bc,_0x5ddc60){return db[_0x6f70('0x14')]['findAll']({'where':{'voiceQueueId':{'$in':_0x590d4a},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x6f70('0x3a')][_0x6f70('0x40')](_0x6f70('0x54')+_0x316346+'\x20MINUTE'),'$gt':db[_0x6f70('0x3a')][_0x6f70('0x40')]('NOW()')}},'UserId':{'$in':_0x40336c}},'include':[{'model':db[_0x6f70('0x27')],'as':_0x6f70('0x55')},{'model':db['User'],'as':_0x6f70('0x2e'),'attributes':['id','name',_0x6f70('0x30')]},{'model':db[_0x6f70('0x56')],'as':_0x6f70('0x57')}]})[_0x6f70('0x8')](function(_0x5379c4){if(_0x5379c4[_0x6f70('0x47')]>0x0){return db[_0x6f70('0x3a')][_0x6f70('0x28')](function(_0x93e596){return db[_0x6f70('0x14')][_0x6f70('0x33')]({'recallmeNotifiedDate':db[_0x6f70('0x3a')]['literal']('NOW()')},{'where':{'id':{'$in':_['map'](_0x5379c4,'id')}},'transaction':_0x93e596})[_0x6f70('0x8')](function(){_0x3807bc(_0x5379c4);})[_0x6f70('0x12')](function(_0x429f26){logger[_0x6f70('0xd')]('CmHopperHandlePreviewRecallNotifications',_0x429f26[_0x6f70('0xf')],_0x290052);_0x5ddc60(_0x199dac[_0x6f70('0xd')](0x1f4,_0x429f26[_0x6f70('0xf')]));});})[_0x6f70('0x12')](function(_0x4b834d){logger['error'](_0x6f70('0x51'),_0x4b834d[_0x6f70('0xf')],_0x290052);_0x5ddc60(_0x199dac[_0x6f70('0xd')](0x1f4,_0x4b834d[_0x6f70('0xf')]));});}else{_0x3807bc(_0x5379c4);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 8ebea73..2ecd450 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 _0x7759=['put','delete','destroy','exports','express','Router','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','getTimezone'];(function(_0x13b7fd,_0x4eaf7f){var _0x32a74a=function(_0x2c5d80){while(--_0x2c5d80){_0x13b7fd['push'](_0x13b7fd['shift']());}};_0x32a74a(++_0x4eaf7f);}(_0x7759,0xcc));var _0x9775=function(_0x5a3f3a,_0x47d054){_0x5a3f3a=_0x5a3f3a-0x0;var _0x244fba=_0x7759[_0x5a3f3a];return _0x244fba;};'use strict';var express=require(_0x9775('0x0'));var router=express[_0x9775('0x1')]();var auth=require(_0x9775('0x2'));var controller=require(_0x9775('0x3'));router[_0x9775('0x4')]('/',auth[_0x9775('0x5')](),controller[_0x9775('0x6')]);router[_0x9775('0x4')]('/describe',auth[_0x9775('0x5')](),controller[_0x9775('0x7')]);router[_0x9775('0x4')](_0x9775('0x8'),auth[_0x9775('0x5')](),controller[_0x9775('0x9')]);router[_0x9775('0x4')](_0x9775('0xa'),auth[_0x9775('0x5')](),controller[_0x9775('0xb')]);router['get'](_0x9775('0xc'),auth[_0x9775('0x5')](),controller[_0x9775('0xd')]);router[_0x9775('0x4')](_0x9775('0xe'),auth[_0x9775('0x5')](),controller[_0x9775('0xf')]);router[_0x9775('0x10')]('/',auth['isAuthenticated'](),controller[_0x9775('0x11')]);router[_0x9775('0x10')](_0x9775('0x12'),auth[_0x9775('0x5')](),controller[_0x9775('0x13')]);router[_0x9775('0x10')]('/timezone',auth[_0x9775('0x5')](),controller[_0x9775('0x14')]);router[_0x9775('0x15')]('/:id',auth[_0x9775('0x5')](),controller['update']);router[_0x9775('0x16')](_0x9775('0xc'),auth['isAuthenticated'](),controller[_0x9775('0x17')]);module[_0x9775('0x18')]=router; \ No newline at end of file +var _0xf8d8=['/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','show','post','/preview','getPreview','/timezone','getTimezone','put','update','delete','destroy','express','Router','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','/describe','describe'];(function(_0x302e16,_0x4fa5c6){var _0x32380e=function(_0x2e86dc){while(--_0x2e86dc){_0x302e16['push'](_0x302e16['shift']());}};_0x32380e(++_0x4fa5c6);}(_0xf8d8,0xc7));var _0x8f8d=function(_0x88eed3,_0x1741d7){_0x88eed3=_0x88eed3-0x0;var _0xf8b3a6=_0xf8d8[_0x88eed3];return _0xf8b3a6;};'use strict';var express=require(_0x8f8d('0x0'));var router=express[_0x8f8d('0x1')]();var auth=require(_0x8f8d('0x2'));var controller=require(_0x8f8d('0x3'));router[_0x8f8d('0x4')]('/',auth[_0x8f8d('0x5')](),controller['index']);router[_0x8f8d('0x4')](_0x8f8d('0x6'),auth[_0x8f8d('0x5')](),controller[_0x8f8d('0x7')]);router['get'](_0x8f8d('0x8'),auth[_0x8f8d('0x5')](),controller[_0x8f8d('0x9')]);router[_0x8f8d('0x4')](_0x8f8d('0xa'),auth[_0x8f8d('0x5')](),controller[_0x8f8d('0xb')]);router[_0x8f8d('0x4')](_0x8f8d('0xc'),auth['isAuthenticated'](),controller[_0x8f8d('0xd')]);router[_0x8f8d('0x4')]('/:id/previewrecall',auth[_0x8f8d('0x5')](),controller['getPreviewRecall']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x8f8d('0xe')](_0x8f8d('0xf'),auth[_0x8f8d('0x5')](),controller[_0x8f8d('0x10')]);router[_0x8f8d('0xe')](_0x8f8d('0x11'),auth[_0x8f8d('0x5')](),controller[_0x8f8d('0x12')]);router[_0x8f8d('0x13')](_0x8f8d('0xc'),auth['isAuthenticated'](),controller[_0x8f8d('0x14')]);router[_0x8f8d('0x15')](_0x8f8d('0xc'),auth[_0x8f8d('0x5')](),controller[_0x8f8d('0x16')]);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 c53203e..466ee4e 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 _0x5626=['exports','STRING','INTEGER','format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize'];(function(_0x1a98b8,_0x5dd8a4){var _0x6d9a9d=function(_0x5928b3){while(--_0x5928b3){_0x1a98b8['push'](_0x1a98b8['shift']());}};_0x6d9a9d(++_0x5dd8a4);}(_0x5626,0x16a));var _0x6562=function(_0x2b4543,_0x1e4bab){_0x2b4543=_0x2b4543-0x0;var _0x1a5896=_0x5626[_0x2b4543];return _0x1a5896;};'use strict';var moment=require(_0x6562('0x0'));var Sequelize=require(_0x6562('0x1'));module[_0x6562('0x2')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x6562('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x6562('0x4')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x6562('0x5')](_0x6562('0x6'))},'countbusyretry':{'type':Sequelize[_0x6562('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6562('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x6562('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6562('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6562('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6562('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8769=['moment','sequelize','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x5260ad,_0x1f4603){var _0x55c77e=function(_0x2a2b4b){while(--_0x2a2b4b){_0x5260ad['push'](_0x5260ad['shift']());}};_0x55c77e(++_0x1f4603);}(_0x8769,0x130));var _0x9876=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0x8769[_0x26f702];return _0x11417d;};'use strict';var moment=require(_0x9876('0x0'));var Sequelize=require(_0x9876('0x1'));module[_0x9876('0x2')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x9876('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x9876('0x4')],'defaultValue':moment()[_0x9876('0x5')](_0x9876('0x6'))},'countbusyretry':{'type':Sequelize[_0x9876('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9876('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9876('0x7')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9876('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9876('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9876('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9876('0x7')],'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 2f79104..fc47b3b 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 _0x4d1f=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','CmHopperAdditionalPhones','UserProfileResource','destroy','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','length','find'];(function(_0x88543b,_0x9c2121){var _0x42fcd4=function(_0xdf1705){while(--_0xdf1705){_0x88543b['push'](_0x88543b['shift']());}};_0x42fcd4(++_0x9c2121);}(_0x4d1f,0x10f));var _0xf4d1=function(_0x24c116,_0x530980){_0x24c116=_0x24c116-0x0;var _0x5e821e=_0x4d1f[_0x24c116];return _0x5e821e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf4d1('0x0'));var zipdir=require(_0xf4d1('0x1'));var jsonpatch=require(_0xf4d1('0x2'));var rp=require(_0xf4d1('0x3'));var moment=require(_0xf4d1('0x4'));var BPromise=require(_0xf4d1('0x5'));var Mustache=require(_0xf4d1('0x6'));var util=require(_0xf4d1('0x7'));var path=require(_0xf4d1('0x8'));var sox=require('sox');var csv=require(_0xf4d1('0x9'));var ejs=require(_0xf4d1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf4d1('0xb'));var squel=require(_0xf4d1('0xc'));var crypto=require(_0xf4d1('0xd'));var jsforce=require(_0xf4d1('0xe'));var deskjs=require(_0xf4d1('0xf'));var toCsv=require(_0xf4d1('0x9'));var querystring=require(_0xf4d1('0x10'));var Papa=require(_0xf4d1('0x11'));var Redis=require(_0xf4d1('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf4d1('0x13'));var as=require(_0xf4d1('0x14'));var hardwareService=require(_0xf4d1('0x15'));var logger=require(_0xf4d1('0x16'))(_0xf4d1('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf4d1('0x18'));var db=require(_0xf4d1('0x19'))['db'];function respondWithStatusCode(_0x1d3c0d,_0x3c0875){_0x3c0875=_0x3c0875||0xcc;return function(_0x494d5d){if(_0x494d5d){return _0x1d3c0d[_0xf4d1('0x1a')](_0x3c0875);}return _0x1d3c0d[_0xf4d1('0x1b')](_0x3c0875)[_0xf4d1('0x1c')]();};}function respondWithResult(_0x4f1fe7,_0x58acce){_0x58acce=_0x58acce||0xc8;return function(_0x53be6b){if(_0x53be6b){return _0x4f1fe7['status'](_0x58acce)[_0xf4d1('0x1d')](_0x53be6b);}};}function respondWithFilteredResult(_0x2ef204,_0x2c81cf){return function(_0x144880){if(_0x144880){var _0x29dd4f=typeof _0x2c81cf[_0xf4d1('0x1e')]===_0xf4d1('0x1f')&&typeof _0x2c81cf[_0xf4d1('0x20')]===_0xf4d1('0x1f');var _0x17ada1=_0x144880[_0xf4d1('0x21')];var _0xa89f67=_0x29dd4f?0x0:_0x2c81cf[_0xf4d1('0x1e')];var _0x2cc42f=_0x29dd4f?_0x144880[_0xf4d1('0x21')]:_0x2c81cf['offset']+_0x2c81cf[_0xf4d1('0x20')];var _0x32fbd4;if(_0x2cc42f>=_0x17ada1){_0x2cc42f=_0x17ada1;_0x32fbd4=0xc8;}else{_0x32fbd4=0xce;}_0x2ef204[_0xf4d1('0x1b')](_0x32fbd4);return _0x2ef204[_0xf4d1('0x22')](_0xf4d1('0x23'),_0xa89f67+'-'+_0x2cc42f+'/'+_0x17ada1)[_0xf4d1('0x1d')](_0x144880);}return null;};}function patchUpdates(_0x1baca9){return function(_0x45fa5b){try{jsonpatch[_0xf4d1('0x24')](_0x45fa5b,_0x1baca9,!![]);}catch(_0x44668c){return BPromise[_0xf4d1('0x25')](_0x44668c);}return _0x45fa5b[_0xf4d1('0x26')]();};}function saveUpdates(_0x2b09e0,_0x3a4dfe){return function(_0x183045){if(_0x183045){return _0x183045[_0xf4d1('0x27')](_0x2b09e0)['then'](function(_0x567048){return _0x567048;});}return null;};}function removeEntity(_0x1983c8,_0x15d318){return function(_0x465a46){if(_0x465a46){return _0x465a46['destroy']()[_0xf4d1('0x28')](function(){var _0x4437b8=_0x465a46[_0xf4d1('0x29')]({'plain':!![]});var _0x253642=_0xf4d1('0x2a');return db[_0xf4d1('0x2b')][_0xf4d1('0x2c')]({'where':{'type':_0x253642,'resourceId':_0x4437b8['id']}})[_0xf4d1('0x28')](function(){return _0x465a46;});})[_0xf4d1('0x28')](function(){_0x1983c8[_0xf4d1('0x1b')](0xcc)[_0xf4d1('0x1c')]();});}};}function handleEntityNotFound(_0x5db1d6,_0x22dba7){return function(_0x48f1ef){if(!_0x48f1ef){_0x5db1d6['sendStatus'](0x194);}return _0x48f1ef;};}function handleError(_0xd8ff58,_0x3dd149){_0x3dd149=_0x3dd149||0x1f4;return function(_0x1f019b){logger['error'](_0x1f019b['stack']);if(_0x1f019b[_0xf4d1('0x2d')]){delete _0x1f019b[_0xf4d1('0x2d')];}_0xd8ff58[_0xf4d1('0x1b')](_0x3dd149)[_0xf4d1('0x2e')](_0x1f019b);};}exports[_0xf4d1('0x2f')]=function(_0x56e4a1,_0x441773){var _0x5659af={},_0x361bf5={},_0x187e44={'count':0x0,'rows':[]};var _0x137447=_[_0xf4d1('0x30')](db[_0xf4d1('0x31')][_0xf4d1('0x32')],function(_0x5654d0){return{'name':_0x5654d0[_0xf4d1('0x33')],'type':_0x5654d0['type'][_0xf4d1('0x34')]};});_0x361bf5['model']=_[_0xf4d1('0x30')](_0x137447,'name');_0x361bf5[_0xf4d1('0x35')]=_['keys'](_0x56e4a1[_0xf4d1('0x35')]);_0x361bf5[_0xf4d1('0x36')]=_[_0xf4d1('0x37')](_0x361bf5[_0xf4d1('0x38')],_0x361bf5[_0xf4d1('0x35')]);_0x5659af[_0xf4d1('0x39')]=_[_0xf4d1('0x37')](_0x361bf5[_0xf4d1('0x38')],qs[_0xf4d1('0x3a')](_0x56e4a1[_0xf4d1('0x35')]['fields']));_0x5659af[_0xf4d1('0x39')]=_0x5659af[_0xf4d1('0x39')]['length']?_0x5659af[_0xf4d1('0x39')]:_0x361bf5[_0xf4d1('0x38')];if(!_0x56e4a1[_0xf4d1('0x35')][_0xf4d1('0x3b')]('nolimit')){_0x5659af[_0xf4d1('0x20')]=qs[_0xf4d1('0x20')](_0x56e4a1['query'][_0xf4d1('0x20')]);_0x5659af['offset']=qs[_0xf4d1('0x1e')](_0x56e4a1[_0xf4d1('0x35')][_0xf4d1('0x1e')]);}_0x5659af[_0xf4d1('0x3c')]=qs[_0xf4d1('0x3d')](_0x56e4a1[_0xf4d1('0x35')]['sort']);_0x5659af[_0xf4d1('0x3e')]=qs['filters'](_[_0xf4d1('0x3f')](_0x56e4a1[_0xf4d1('0x35')],_0x361bf5[_0xf4d1('0x36')]),_0x137447);if(_0x56e4a1['query']['filter']){_0x5659af[_0xf4d1('0x3e')]=_[_0xf4d1('0x40')](_0x5659af[_0xf4d1('0x3e')],{'$or':_[_0xf4d1('0x30')](_0x137447,function(_0x3aae0d){if(_0x3aae0d[_0xf4d1('0x41')]!==_0xf4d1('0x42')){var _0xf1ffa1={};_0xf1ffa1[_0x3aae0d[_0xf4d1('0x2d')]]={'$like':'%'+_0x56e4a1[_0xf4d1('0x35')][_0xf4d1('0x43')]+'%'};return _0xf1ffa1;}})});}_0x5659af=_[_0xf4d1('0x40')]({},_0x5659af,_0x56e4a1[_0xf4d1('0x44')]);var _0x16871f={'where':_0x5659af[_0xf4d1('0x3e')]};return db['CmHopperAdditionalPhone'][_0xf4d1('0x21')](_0x16871f)[_0xf4d1('0x28')](function(_0x3dc56f){_0x187e44[_0xf4d1('0x21')]=_0x3dc56f;if(_0x56e4a1[_0xf4d1('0x35')][_0xf4d1('0x45')]){_0x5659af[_0xf4d1('0x46')]=[{'all':!![]}];}return db[_0xf4d1('0x31')][_0xf4d1('0x47')](_0x5659af);})[_0xf4d1('0x28')](function(_0x1adf19){_0x187e44[_0xf4d1('0x48')]=_0x1adf19;return _0x187e44;})[_0xf4d1('0x28')](respondWithFilteredResult(_0x441773,_0x5659af))[_0xf4d1('0x49')](handleError(_0x441773,null));};exports[_0xf4d1('0x4a')]=function(_0x4bfd9a,_0xe272dc){var _0x463503={'raw':!![],'where':{'id':_0x4bfd9a['params']['id']}},_0x28b1fc={};_0x28b1fc[_0xf4d1('0x38')]=_['keys'](db[_0xf4d1('0x31')][_0xf4d1('0x32')]);_0x28b1fc[_0xf4d1('0x35')]=_['keys'](_0x4bfd9a['query']);_0x28b1fc[_0xf4d1('0x36')]=_[_0xf4d1('0x37')](_0x28b1fc[_0xf4d1('0x38')],_0x28b1fc['query']);_0x463503[_0xf4d1('0x39')]=_['intersection'](_0x28b1fc[_0xf4d1('0x38')],qs[_0xf4d1('0x3a')](_0x4bfd9a[_0xf4d1('0x35')][_0xf4d1('0x3a')]));_0x463503['attributes']=_0x463503[_0xf4d1('0x39')][_0xf4d1('0x4b')]?_0x463503[_0xf4d1('0x39')]:_0x28b1fc[_0xf4d1('0x38')];if(_0x4bfd9a[_0xf4d1('0x35')][_0xf4d1('0x45')]){_0x463503[_0xf4d1('0x46')]=[{'all':!![]}];}_0x463503=_[_0xf4d1('0x40')]({},_0x463503,_0x4bfd9a[_0xf4d1('0x44')]);return db['CmHopperAdditionalPhone'][_0xf4d1('0x4c')](_0x463503)[_0xf4d1('0x28')](handleEntityNotFound(_0xe272dc,null))['then'](respondWithResult(_0xe272dc,null))[_0xf4d1('0x49')](handleError(_0xe272dc,null));};exports[_0xf4d1('0x4d')]=function(_0x3fabe6,_0x237b20){return db['CmHopperAdditionalPhone'][_0xf4d1('0x4d')](_0x3fabe6[_0xf4d1('0x4e')],{})[_0xf4d1('0x28')](function(_0x138387){var _0x24278f=_0x3fabe6[_0xf4d1('0x4f')][_0xf4d1('0x29')]({'plain':!![]});if(!_0x24278f)throw new Error(_0xf4d1('0x50'));if(_0x24278f[_0xf4d1('0x51')]===_0xf4d1('0x4f')){var _0x3468ac=_0x138387['get']({'plain':!![]});var _0x4cf011=_0xf4d1('0x2a');return db[_0xf4d1('0x52')][_0xf4d1('0x4c')]({'where':{'name':_0x4cf011,'userProfileId':_0x24278f[_0xf4d1('0x53')]},'raw':!![]})[_0xf4d1('0x28')](function(_0x241a11){if(_0x241a11&&_0x241a11[_0xf4d1('0x54')]===0x0){return db[_0xf4d1('0x2b')]['create']({'name':_0x3468ac[_0xf4d1('0x2d')],'resourceId':_0x3468ac['id'],'type':_0x241a11[_0xf4d1('0x2d')],'sectionId':_0x241a11['id']},{})[_0xf4d1('0x28')](function(){return _0x138387;});}else{return _0x138387;}})['catch'](function(_0x19f3a6){logger['error'](_0xf4d1('0x55'),_0x19f3a6);throw _0x19f3a6;});}return _0x138387;})[_0xf4d1('0x28')](respondWithResult(_0x237b20,0xc9))[_0xf4d1('0x49')](handleError(_0x237b20,null));};exports[_0xf4d1('0x27')]=function(_0xc0d64c,_0x3b005f){if(_0xc0d64c[_0xf4d1('0x4e')]['id']){delete _0xc0d64c[_0xf4d1('0x4e')]['id'];}return db[_0xf4d1('0x31')][_0xf4d1('0x4c')]({'where':{'id':_0xc0d64c[_0xf4d1('0x56')]['id']}})['then'](handleEntityNotFound(_0x3b005f,null))[_0xf4d1('0x28')](saveUpdates(_0xc0d64c[_0xf4d1('0x4e')],null))[_0xf4d1('0x28')](respondWithResult(_0x3b005f,null))[_0xf4d1('0x49')](handleError(_0x3b005f,null));};exports['destroy']=function(_0x17f5d2,_0x470822){return db['CmHopperAdditionalPhone'][_0xf4d1('0x4c')]({'where':{'id':_0x17f5d2[_0xf4d1('0x56')]['id']}})[_0xf4d1('0x28')](handleEntityNotFound(_0x470822,null))[_0xf4d1('0x28')](removeEntity(_0x470822,null))[_0xf4d1('0x49')](handleError(_0x470822,null));}; \ No newline at end of file +var _0x5195=['sendStatus','stack','name','send','CmHopperAdditionalPhone','rawAttributes','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','options','find','catch','create','user','get','role','CmHopperAdditionalPhones','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/logger','../../config/environment','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','UserProfileResource'];(function(_0x1b7541,_0x222c38){var _0x2b8e5a=function(_0x43c1a9){while(--_0x43c1a9){_0x1b7541['push'](_0x1b7541['shift']());}};_0x2b8e5a(++_0x222c38);}(_0x5195,0x151));var _0x5519=function(_0x5a213a,_0x2b4a23){_0x5a213a=_0x5a213a-0x0;var _0x3577b3=_0x5195[_0x5a213a];return _0x3577b3;};'use strict';var emlformat=require(_0x5519('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5519('0x1'));var jsonpatch=require(_0x5519('0x2'));var rp=require(_0x5519('0x3'));var moment=require(_0x5519('0x4'));var BPromise=require(_0x5519('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5519('0x6'));var sox=require(_0x5519('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5519('0x8'));var _=require(_0x5519('0x9'));var squel=require(_0x5519('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5519('0xb'));var toCsv=require(_0x5519('0xc'));var querystring=require(_0x5519('0xd'));var Papa=require(_0x5519('0xe'));var Redis=require('ioredis');var authService=require(_0x5519('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5519('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x5519('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x168795,_0x2c3777){_0x2c3777=_0x2c3777||0xcc;return function(_0x16e948){if(_0x16e948){return _0x168795['sendStatus'](_0x2c3777);}return _0x168795['status'](_0x2c3777)[_0x5519('0x12')]();};}function respondWithResult(_0x1a5936,_0x4c28c1){_0x4c28c1=_0x4c28c1||0xc8;return function(_0x2e08a6){if(_0x2e08a6){return _0x1a5936[_0x5519('0x13')](_0x4c28c1)[_0x5519('0x14')](_0x2e08a6);}};}function respondWithFilteredResult(_0x42fce6,_0x25a8c0){return function(_0x1bb4f1){if(_0x1bb4f1){var _0x27ad7c=typeof _0x25a8c0[_0x5519('0x15')]===_0x5519('0x16')&&typeof _0x25a8c0[_0x5519('0x17')]===_0x5519('0x16');var _0x47c89d=_0x1bb4f1['count'];var _0x292f34=_0x27ad7c?0x0:_0x25a8c0['offset'];var _0xc399ab=_0x27ad7c?_0x1bb4f1[_0x5519('0x18')]:_0x25a8c0[_0x5519('0x15')]+_0x25a8c0['limit'];var _0x3a6f9f;if(_0xc399ab>=_0x47c89d){_0xc399ab=_0x47c89d;_0x3a6f9f=0xc8;}else{_0x3a6f9f=0xce;}_0x42fce6[_0x5519('0x13')](_0x3a6f9f);return _0x42fce6[_0x5519('0x19')](_0x5519('0x1a'),_0x292f34+'-'+_0xc399ab+'/'+_0x47c89d)[_0x5519('0x14')](_0x1bb4f1);}return null;};}function patchUpdates(_0x55761b){return function(_0x20bc5d){try{jsonpatch[_0x5519('0x1b')](_0x20bc5d,_0x55761b,!![]);}catch(_0x3e46b2){return BPromise[_0x5519('0x1c')](_0x3e46b2);}return _0x20bc5d[_0x5519('0x1d')]();};}function saveUpdates(_0x273d8c,_0x173f2e){return function(_0x5a651c){if(_0x5a651c){return _0x5a651c['update'](_0x273d8c)[_0x5519('0x1e')](function(_0x2f92e8){return _0x2f92e8;});}return null;};}function removeEntity(_0x768c71,_0x8e3bbd){return function(_0x38b1c1){if(_0x38b1c1){return _0x38b1c1[_0x5519('0x1f')]()[_0x5519('0x1e')](function(){var _0x1a7321=_0x38b1c1['get']({'plain':!![]});var _0x10f80f='CmHopperAdditionalPhones';return db[_0x5519('0x20')][_0x5519('0x1f')]({'where':{'type':_0x10f80f,'resourceId':_0x1a7321['id']}})[_0x5519('0x1e')](function(){return _0x38b1c1;});})[_0x5519('0x1e')](function(){_0x768c71[_0x5519('0x13')](0xcc)[_0x5519('0x12')]();});}};}function handleEntityNotFound(_0x31b25a,_0x30c218){return function(_0x256f4c){if(!_0x256f4c){_0x31b25a[_0x5519('0x21')](0x194);}return _0x256f4c;};}function handleError(_0x10b2e3,_0x420f20){_0x420f20=_0x420f20||0x1f4;return function(_0xa80ea4){logger['error'](_0xa80ea4[_0x5519('0x22')]);if(_0xa80ea4['name']){delete _0xa80ea4[_0x5519('0x23')];}_0x10b2e3[_0x5519('0x13')](_0x420f20)[_0x5519('0x24')](_0xa80ea4);};}exports['index']=function(_0x341348,_0x4c3349){var _0x18f85a={},_0x32833c={},_0x355df6={'count':0x0,'rows':[]};var _0x210441=_['map'](db[_0x5519('0x25')][_0x5519('0x26')],function(_0x5d9536){return{'name':_0x5d9536['fieldName'],'type':_0x5d9536['type'][_0x5519('0x27')]};});_0x32833c[_0x5519('0x28')]=_[_0x5519('0x29')](_0x210441,_0x5519('0x23'));_0x32833c['query']=_[_0x5519('0x2a')](_0x341348['query']);_0x32833c[_0x5519('0x2b')]=_[_0x5519('0x2c')](_0x32833c[_0x5519('0x28')],_0x32833c[_0x5519('0x2d')]);_0x18f85a[_0x5519('0x2e')]=_['intersection'](_0x32833c['model'],qs[_0x5519('0x2f')](_0x341348['query'][_0x5519('0x2f')]));_0x18f85a[_0x5519('0x2e')]=_0x18f85a[_0x5519('0x2e')][_0x5519('0x30')]?_0x18f85a['attributes']:_0x32833c['model'];if(!_0x341348[_0x5519('0x2d')][_0x5519('0x31')]('nolimit')){_0x18f85a[_0x5519('0x17')]=qs[_0x5519('0x17')](_0x341348[_0x5519('0x2d')]['limit']);_0x18f85a[_0x5519('0x15')]=qs['offset'](_0x341348[_0x5519('0x2d')]['offset']);}_0x18f85a['order']=qs[_0x5519('0x32')](_0x341348[_0x5519('0x2d')][_0x5519('0x32')]);_0x18f85a[_0x5519('0x33')]=qs['filters'](_[_0x5519('0x34')](_0x341348[_0x5519('0x2d')],_0x32833c[_0x5519('0x2b')]),_0x210441);if(_0x341348[_0x5519('0x2d')]['filter']){_0x18f85a['where']=_[_0x5519('0x35')](_0x18f85a[_0x5519('0x33')],{'$or':_[_0x5519('0x29')](_0x210441,function(_0x1c762e){if(_0x1c762e[_0x5519('0x36')]!==_0x5519('0x37')){var _0x200006={};_0x200006[_0x1c762e['name']]={'$like':'%'+_0x341348[_0x5519('0x2d')][_0x5519('0x38')]+'%'};return _0x200006;}})});}_0x18f85a=_[_0x5519('0x35')]({},_0x18f85a,_0x341348['options']);var _0x47fc9c={'where':_0x18f85a['where']};return db[_0x5519('0x25')]['count'](_0x47fc9c)['then'](function(_0x329bd1){_0x355df6[_0x5519('0x18')]=_0x329bd1;if(_0x341348['query'][_0x5519('0x39')]){_0x18f85a[_0x5519('0x3a')]=[{'all':!![]}];}return db[_0x5519('0x25')][_0x5519('0x3b')](_0x18f85a);})[_0x5519('0x1e')](function(_0xe64d33){_0x355df6[_0x5519('0x3c')]=_0xe64d33;return _0x355df6;})[_0x5519('0x1e')](respondWithFilteredResult(_0x4c3349,_0x18f85a))['catch'](handleError(_0x4c3349,null));};exports[_0x5519('0x3d')]=function(_0x371f0e,_0x501676){var _0x69ff7={'raw':!![],'where':{'id':_0x371f0e[_0x5519('0x3e')]['id']}},_0x37e25c={};_0x37e25c[_0x5519('0x28')]=_[_0x5519('0x2a')](db[_0x5519('0x25')][_0x5519('0x26')]);_0x37e25c[_0x5519('0x2d')]=_[_0x5519('0x2a')](_0x371f0e[_0x5519('0x2d')]);_0x37e25c['filters']=_['intersection'](_0x37e25c[_0x5519('0x28')],_0x37e25c[_0x5519('0x2d')]);_0x69ff7[_0x5519('0x2e')]=_[_0x5519('0x2c')](_0x37e25c[_0x5519('0x28')],qs[_0x5519('0x2f')](_0x371f0e[_0x5519('0x2d')][_0x5519('0x2f')]));_0x69ff7[_0x5519('0x2e')]=_0x69ff7[_0x5519('0x2e')][_0x5519('0x30')]?_0x69ff7[_0x5519('0x2e')]:_0x37e25c[_0x5519('0x28')];if(_0x371f0e['query'][_0x5519('0x39')]){_0x69ff7[_0x5519('0x3a')]=[{'all':!![]}];}_0x69ff7=_[_0x5519('0x35')]({},_0x69ff7,_0x371f0e[_0x5519('0x3f')]);return db[_0x5519('0x25')][_0x5519('0x40')](_0x69ff7)[_0x5519('0x1e')](handleEntityNotFound(_0x501676,null))[_0x5519('0x1e')](respondWithResult(_0x501676,null))[_0x5519('0x41')](handleError(_0x501676,null));};exports[_0x5519('0x42')]=function(_0xca684f,_0x1beeb3){return db[_0x5519('0x25')]['create'](_0xca684f['body'],{})[_0x5519('0x1e')](function(_0x22b60c){var _0x2c293f=_0xca684f[_0x5519('0x43')][_0x5519('0x44')]({'plain':!![]});if(!_0x2c293f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c293f[_0x5519('0x45')]===_0x5519('0x43')){var _0x11f1bc=_0x22b60c['get']({'plain':!![]});var _0x3ffff6=_0x5519('0x46');return db['UserProfileSection'][_0x5519('0x40')]({'where':{'name':_0x3ffff6,'userProfileId':_0x2c293f['userProfileId']},'raw':!![]})[_0x5519('0x1e')](function(_0x1591aa){if(_0x1591aa&&_0x1591aa['autoAssociation']===0x0){return db[_0x5519('0x20')]['create']({'name':_0x11f1bc[_0x5519('0x23')],'resourceId':_0x11f1bc['id'],'type':_0x1591aa['name'],'sectionId':_0x1591aa['id']},{})[_0x5519('0x1e')](function(){return _0x22b60c;});}else{return _0x22b60c;}})[_0x5519('0x41')](function(_0x20af9b){logger['error'](_0x5519('0x47'),_0x20af9b);throw _0x20af9b;});}return _0x22b60c;})[_0x5519('0x1e')](respondWithResult(_0x1beeb3,0xc9))[_0x5519('0x41')](handleError(_0x1beeb3,null));};exports[_0x5519('0x48')]=function(_0x1a9102,_0x17915b){if(_0x1a9102[_0x5519('0x49')]['id']){delete _0x1a9102[_0x5519('0x49')]['id'];}return db[_0x5519('0x25')][_0x5519('0x40')]({'where':{'id':_0x1a9102[_0x5519('0x3e')]['id']}})[_0x5519('0x1e')](handleEntityNotFound(_0x17915b,null))[_0x5519('0x1e')](saveUpdates(_0x1a9102[_0x5519('0x49')],null))[_0x5519('0x1e')](respondWithResult(_0x17915b,null))[_0x5519('0x41')](handleError(_0x17915b,null));};exports[_0x5519('0x1f')]=function(_0x29a2ad,_0x571322){return db[_0x5519('0x25')][_0x5519('0x40')]({'where':{'id':_0x29a2ad[_0x5519('0x3e')]['id']}})['then'](handleEntityNotFound(_0x571322,null))[_0x5519('0x1e')](removeEntity(_0x571322,null))[_0x5519('0x41')](handleError(_0x571322,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 7d7dccb..9a16f78 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 _0x34a9=['api','request-promise','path','rimraf','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','lodash','util'];(function(_0x2a6a8b,_0x2146df){var _0x39d530=function(_0xa309e0){while(--_0xa309e0){_0x2a6a8b['push'](_0x2a6a8b['shift']());}};_0x39d530(++_0x2146df);}(_0x34a9,0x148));var _0x934a=function(_0x3ff67f,_0x2e7de8){_0x3ff67f=_0x3ff67f-0x0;var _0xa0b62c=_0x34a9[_0x3ff67f];return _0xa0b62c;};'use strict';var _=require(_0x934a('0x0'));var util=require(_0x934a('0x1'));var logger=require('../../config/logger')(_0x934a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x934a('0x3'));var fs=require('fs');var path=require(_0x934a('0x4'));var rimraf=require(_0x934a('0x5'));var config=require('../../config/environment');var attributes=require(_0x934a('0x6'));module[_0x934a('0x7')]=function(_0x348caa,_0x2fa652){return _0x348caa[_0x934a('0x8')](_0x934a('0x9'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x30e2=['api','moment','request-promise','path','./cmHopperAdditionalPhone.attributes','exports','CmHopperAdditionalPhone','util'];(function(_0x2858f6,_0x4eefba){var _0x80e9e5=function(_0xa5937f){while(--_0xa5937f){_0x2858f6['push'](_0x2858f6['shift']());}};_0x80e9e5(++_0x4eefba);}(_0x30e2,0x6f));var _0x230e=function(_0x55ef8c,_0x44f66c){_0x55ef8c=_0x55ef8c-0x0;var _0x39d9b0=_0x30e2[_0x55ef8c];return _0x39d9b0;};'use strict';var _=require('lodash');var util=require(_0x230e('0x0'));var logger=require('../../config/logger')(_0x230e('0x1'));var moment=require(_0x230e('0x2'));var BPromise=require('bluebird');var rp=require(_0x230e('0x3'));var fs=require('fs');var path=require(_0x230e('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x230e('0x5'));module[_0x230e('0x6')]=function(_0x3febd4,_0xf9b5e1){return _0x3febd4['define'](_0x230e('0x7'),attributes,{'tableName':'cm_hopper_additional_phones','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 4b2e56b..106f039 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 _0x2deb=['countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','entity','findOne','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','VerifyAdditionalPhones','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat','add','minutes','phone','createdAt','updatedAt','sequelize','IncrementPreviewCounters','field','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info','request\x20sent','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','error','CmHopperAdditionalPhone,\x20%s,\x20%s','message','result','catch','CmHopper','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','then','countbusyretry','countcongestionretry'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2deb,0xef));var _0xb2de=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2deb[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb2de('0x0'));var util=require('util');var moment=require(_0xb2de('0x1'));var BPromise=require(_0xb2de('0x2'));var rs=require(_0xb2de('0x3'));var fs=require('fs');var Redis=require(_0xb2de('0x4'));var db=require(_0xb2de('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb2de('0x6'))('rpc');var config=require(_0xb2de('0x7'));var jayson=require(_0xb2de('0x8'));var client=jayson['client'][_0xb2de('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55a85e,_0x3a6640,_0x3cf403){return new BPromise(function(_0x2d704a,_0x5d9759){return client[_0xb2de('0xa')](_0x55a85e,_0x3cf403)['then'](function(_0x42322f){logger[_0xb2de('0xb')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x3a6640,_0xb2de('0xc'));logger['debug'](_0xb2de('0xd'),_0x3a6640,_0xb2de('0xc'),JSON['stringify'](_0x42322f));if(_0x42322f[_0xb2de('0xe')]){if(_0x42322f[_0xb2de('0xe')]['code']===0x1f4){logger['error'](_0xb2de('0xf'),_0x3a6640,_0x42322f[_0xb2de('0xe')][_0xb2de('0x10')]);return _0x5d9759(_0x42322f[_0xb2de('0xe')]['message']);}logger[_0xb2de('0xe')](_0xb2de('0xf'),_0x3a6640,_0x42322f['error'][_0xb2de('0x10')]);return _0x2d704a(_0x42322f[_0xb2de('0xe')][_0xb2de('0x10')]);}else{logger['info'](_0xb2de('0xf'),_0x3a6640,_0xb2de('0xc'));_0x2d704a(_0x42322f[_0xb2de('0x11')][_0xb2de('0x10')]);}})[_0xb2de('0x12')](function(_0x152d89){logger['error'](_0xb2de('0xf'),_0x3a6640,_0x152d89);_0x5d9759(_0x152d89);});});}exports['VerifyAdditionalPhones']=function(_0x13331a){var _0x3084c4=this;return new Promise(function(_0x323987,_0x1160ea){return db[_0xb2de('0x13')]['findOne']({'raw':!![],'where':{'ContactId':_0x13331a[_0xb2de('0x14')][_0xb2de('0x15')],'ListId':_0x13331a[_0xb2de('0x14')][_0xb2de('0x16')],'VoiceQueueId':_0x13331a['body'][_0xb2de('0x17')]===undefined?null:_0x13331a[_0xb2de('0x14')][_0xb2de('0x17')],'CampaignId':_0x13331a[_0xb2de('0x14')][_0xb2de('0x18')]===undefined?null:_0x13331a[_0xb2de('0x14')][_0xb2de('0x18')]}})['then'](function(_0x5ed5fc){if(_0x5ed5fc!=null){return db[_0xb2de('0x19')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x5ed5fc['id'],'OrderBy':{'$gt':_0x5ed5fc[_0xb2de('0x1a')]}},'order':[[_0xb2de('0x1a'),_0xb2de('0x1b')]]})[_0xb2de('0x1c')](function(_0x33918d){var _0x889de3=0x0;if(_0x33918d){if(_0x33918d[_0xb2de('0x1d')]+_0x33918d[_0xb2de('0x1e')]+_0x33918d[_0xb2de('0x1f')]+_0x33918d['countnosuchnumberretry']+_0x33918d[_0xb2de('0x20')]+_0x33918d[_0xb2de('0x21')]+_0x33918d[_0xb2de('0x22')]+_0x33918d['countagentrejectretry']<_0x13331a[_0xb2de('0x23')]['dialGlobalMaxRetry'])_0x889de3=0x1;_0x323987({'additional':_0x889de3});}else{return db[_0xb2de('0x19')][_0xb2de('0x24')]({'raw':!![],'where':{'CmHopperId':_0x5ed5fc['id']},'order':[['OrderBy','ASC']]})[_0xb2de('0x1c')](function(_0x4e5056){var _0x9af401=0x0;if(_0x4e5056){if(_0x4e5056[_0xb2de('0x1d')]+_0x4e5056[_0xb2de('0x1e')]+_0x4e5056['countnoanswerretry']+_0x4e5056[_0xb2de('0x25')]+_0x4e5056[_0xb2de('0x20')]+_0x4e5056[_0xb2de('0x21')]+_0x4e5056['countmachineretry']+_0x4e5056[_0xb2de('0x26')]<_0x13331a[_0xb2de('0x23')][_0xb2de('0x27')])_0x9af401=0x1;_0x323987({'additional':_0x9af401});}else{_0x323987({'additional':0x0});}})[_0xb2de('0x12')](function(_0x51bef6){logger[_0xb2de('0xe')](_0xb2de('0x28'),_0x51bef6[_0xb2de('0x10')]);_0x1160ea(_0x3084c4[_0xb2de('0xe')](0x1f4,_0x51bef6[_0xb2de('0x10')]));});}})[_0xb2de('0x12')](function(_0x7b77f2){logger['error']('VerifyAdditionalPhones',_0x7b77f2['message']);_0x1160ea(_0x3084c4[_0xb2de('0xe')](0x1f4,_0x7b77f2[_0xb2de('0x10')]));});}else _0x323987({'additional':0x0});});});};exports[_0xb2de('0x29')]=function(_0x415d35){var _0x1741c1=this;return new Promise(function(_0x25df05,_0x5bfd79){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0x415d35['body'][_0xb2de('0x15')],'ListId':_0x415d35['body']['ListId'],'VoiceQueueId':_0x415d35['body']['VoiceQueueId']===undefined?null:_0x415d35[_0xb2de('0x14')]['VoiceQueueId'],'CampaignId':_0x415d35[_0xb2de('0x14')][_0xb2de('0x18')]===undefined?null:_0x415d35[_0xb2de('0x14')][_0xb2de('0x18')]}})[_0xb2de('0x1c')](function(_0x5193d5){if(_0x5193d5!=null){return db[_0xb2de('0x19')][_0xb2de('0x24')]({'raw':!![],'where':{'CmHopperId':_0x5193d5['id'],'OrderBy':{'$gte':_0x5193d5[_0xb2de('0x1a')]}},'order':[[_0xb2de('0x1a'),_0xb2de('0x1b')]]})[_0xb2de('0x1c')](function(_0x27f5d1){if(_0x27f5d1)return activateAdditionalPhone(_0x5193d5,_0x415d35[_0xb2de('0x14')],_0x27f5d1,_0x415d35[_0xb2de('0x2a')],_0x415d35[_0xb2de('0x2b')])[_0xb2de('0x1c')](function(_0x4dbac5){_0x25df05(_0x4dbac5);});else{return db[_0xb2de('0x19')][_0xb2de('0x24')]({'raw':!![],'where':{'CmHopperId':_0x5193d5['id']},'order':[[_0xb2de('0x1a'),_0xb2de('0x1b')]]})['then'](function(_0x2ba30b){if(_0x2ba30b)return activateAdditionalPhone(_0x5193d5,_0x415d35[_0xb2de('0x14')],_0x2ba30b,_0x415d35[_0xb2de('0x2a')],_0x415d35[_0xb2de('0x2b')])[_0xb2de('0x1c')](function(_0x502a04){_0x25df05(_0x502a04);});else{_0x25df05({'id':_0x5193d5['id'],'phone':''});}})[_0xb2de('0x12')](function(_0x3e9b77){logger[_0xb2de('0xe')](_0xb2de('0x28'),_0x3e9b77[_0xb2de('0x10')]);_0x5bfd79(_0x1741c1['error'](0x1f4,_0x3e9b77[_0xb2de('0x10')]));});}})[_0xb2de('0x12')](function(_0x149bc1){logger[_0xb2de('0xe')](_0xb2de('0x28'),_0x149bc1[_0xb2de('0x10')]);_0x5bfd79(_0x1741c1[_0xb2de('0xe')](0x1f4,_0x149bc1[_0xb2de('0x10')]));});}else _0x25df05(0x1);});});};function activateAdditionalPhone(_0x18fd1f,_0x59c8d0,_0x43a0bb,_0x496b0,_0x2a540e){return new Promise(function(_0x3ae2bb,_0x373f97){var _0xaeeb41;if(_[_0xb2de('0x2c')](_0x43a0bb[_0xb2de('0x2d')])){_0x43a0bb[_0xb2de('0x2d')]=moment();}if(moment()>moment(_0x43a0bb['scheduledat'])){_0xaeeb41=moment()[_0xb2de('0x2e')](_0x2a540e||0x3,_0xb2de('0x2f'));}else{if(_0x43a0bb['OrderBy']==0x0){_0xaeeb41=moment(_0x43a0bb[_0xb2de('0x2d')]);}else{_0xaeeb41=moment()[_0xb2de('0x2e')](_0x2a540e||0x3,_0xb2de('0x2f'));}}if(_[_0xb2de('0x2c')](_0xaeeb41)){_0xaeeb41=moment()[_0xb2de('0x2e')](_0x2a540e||0x3,_0xb2de('0x2f'));}var _0x3ad83e={'phone':_0x18fd1f[_0xb2de('0x30')],'active':0x0,'OrderBy':_[_0xb2de('0x2c')](_0x18fd1f[_0xb2de('0x1a')])?0x0:_0x18fd1f[_0xb2de('0x1a')],'scheduledat':moment()[_0xb2de('0x2e')](_0x496b0||0x1,_0xb2de('0x2f')),'countbusyretry':_0x59c8d0[_0xb2de('0x1d')],'countcongestionretry':_0x59c8d0[_0xb2de('0x1e')],'countnoanswerretry':_0x59c8d0[_0xb2de('0x1f')],'countnosuchnumberretry':_0x59c8d0[_0xb2de('0x25')],'countdropretry':_0x59c8d0['countdropretry'],'countabandonedretry':_0x59c8d0['countabandonedretry'],'countmachineretry':_0x59c8d0[_0xb2de('0x22')],'countagentrejectretry':_0x59c8d0['countagentrejectretry'],'createdAt':_0x59c8d0[_0xb2de('0x31')],'updatedAt':_0x59c8d0[_0xb2de('0x32')]};var _0x3e1e63={'CmHopperId':_0x18fd1f['id'],'phone':_0x43a0bb[_0xb2de('0x30')],'active':0x0,'OrderBy':_[_0xb2de('0x2c')](_0x43a0bb[_0xb2de('0x1a')])?0x0:_0x43a0bb[_0xb2de('0x1a')],'scheduledat':_0xaeeb41,'countbusyretry':_0x43a0bb[_0xb2de('0x1d')],'countcongestionretry':_0x43a0bb[_0xb2de('0x1e')],'countnoanswerretry':_0x43a0bb[_0xb2de('0x1f')],'countnosuchnumberretry':_0x43a0bb[_0xb2de('0x25')],'countdropretry':_0x43a0bb[_0xb2de('0x20')],'countabandonedretry':_0x43a0bb[_0xb2de('0x21')],'countmachineretry':_0x43a0bb['countmachineretry'],'countagentrejectretry':_0x43a0bb[_0xb2de('0x26')],'createdAt':_0x43a0bb['createdAt'],'updatedAt':_0x43a0bb[_0xb2de('0x32')]};return db[_0xb2de('0x33')]['transaction'](function(_0x42ec16){return db[_0xb2de('0x19')]['update'](_0x3ad83e,{'where':{'id':_0x43a0bb['id']}},{'transaction':_0x42ec16})[_0xb2de('0x1c')](function(){return db[_0xb2de('0x13')]['update'](_0x3e1e63,{'where':{'id':_0x18fd1f['id']}},{'transaction':_0x42ec16});});})[_0xb2de('0x1c')](function(_0x16af7f){_0x3ae2bb({'id':_0x18fd1f['id'],'phone':_0x43a0bb[_0xb2de('0x30')]});})['catch'](function(_0x2c84e0){logger[_0xb2de('0xe')]('activateAdditionalPhone',_0x2c84e0['message']);_0x373f97({'error':_0x2c84e0[_0xb2de('0x10')]});});});}exports[_0xb2de('0x34')]=function(_0x14e760){var _0x1bdcb6=this;return new Promise(function(_0x1b4e35,_0x31a7e2){return db['CmHopper']['update'](_0x14e760[_0xb2de('0x14')][_0xb2de('0x35')],{'where':{'id':_0x14e760['body']['id']}})['then'](function(_0x2243bd){_0x1b4e35(_0x2243bd);})[_0xb2de('0x12')](function(_0x17320a){logger[_0xb2de('0xe')]('IncrementPreviewCounters',_0x17320a[_0xb2de('0x10')]);_0x31a7e2(_0x1bdcb6[_0xb2de('0xe')](0x1f4,_0x17320a[_0xb2de('0x10')]));});});}; \ No newline at end of file +var _0x3854=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','entity','dialGlobalMaxRetry','ASC','countnoanswerretry','SwapAdditionalPhones','duration','waitTime','scheduledat','minutes','add','phone','isNil','countmachineretry','createdAt','updatedAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','util','moment','bluebird','randomstring'];(function(_0x86c18f,_0x541256){var _0x28dd92=function(_0x10c10d){while(--_0x10c10d){_0x86c18f['push'](_0x86c18f['shift']());}};_0x28dd92(++_0x541256);}(_0x3854,0x184));var _0x4385=function(_0x43c4f7,_0x362d33){_0x43c4f7=_0x43c4f7-0x0;var _0x376c42=_0x3854[_0x43c4f7];return _0x376c42;};'use strict';var _=require('lodash');var util=require(_0x4385('0x0'));var moment=require(_0x4385('0x1'));var BPromise=require(_0x4385('0x2'));var rs=require(_0x4385('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4385('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4385('0x5'))(_0x4385('0x6'));var config=require(_0x4385('0x7'));var jayson=require(_0x4385('0x8'));var client=jayson['client'][_0x4385('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f49f8,_0x54db25,_0xc693a){return new BPromise(function(_0x4e9304,_0x198d3b){return client['request'](_0x3f49f8,_0xc693a)[_0x4385('0xa')](function(_0x23a34f){logger[_0x4385('0xb')](_0x4385('0xc'),_0x54db25,'request\x20sent');logger['debug'](_0x4385('0xd'),_0x54db25,'request\x20sent',JSON[_0x4385('0xe')](_0x23a34f));if(_0x23a34f['error']){if(_0x23a34f['error']['code']===0x1f4){logger[_0x4385('0xf')](_0x4385('0xc'),_0x54db25,_0x23a34f[_0x4385('0xf')][_0x4385('0x10')]);return _0x198d3b(_0x23a34f['error'][_0x4385('0x10')]);}logger[_0x4385('0xf')](_0x4385('0xc'),_0x54db25,_0x23a34f[_0x4385('0xf')][_0x4385('0x10')]);return _0x4e9304(_0x23a34f['error']['message']);}else{logger['info'](_0x4385('0xc'),_0x54db25,_0x4385('0x11'));_0x4e9304(_0x23a34f[_0x4385('0x12')]['message']);}})[_0x4385('0x13')](function(_0x44e114){logger[_0x4385('0xf')](_0x4385('0xc'),_0x54db25,_0x44e114);_0x198d3b(_0x44e114);});});}exports[_0x4385('0x14')]=function(_0x19b72b){var _0x185478=this;return new Promise(function(_0x10bdb5,_0x2c0742){return db[_0x4385('0x15')][_0x4385('0x16')]({'raw':!![],'where':{'ContactId':_0x19b72b[_0x4385('0x17')]['ContactId'],'ListId':_0x19b72b[_0x4385('0x17')][_0x4385('0x18')],'VoiceQueueId':_0x19b72b[_0x4385('0x17')][_0x4385('0x19')]===undefined?null:_0x19b72b[_0x4385('0x17')]['VoiceQueueId'],'CampaignId':_0x19b72b['body'][_0x4385('0x1a')]===undefined?null:_0x19b72b[_0x4385('0x17')][_0x4385('0x1a')]}})['then'](function(_0x21e201){if(_0x21e201!=null){return db[_0x4385('0x1b')][_0x4385('0x16')]({'raw':!![],'where':{'CmHopperId':_0x21e201['id'],'OrderBy':{'$gt':_0x21e201[_0x4385('0x1c')]}},'order':[['OrderBy','ASC']]})[_0x4385('0xa')](function(_0x5e2766){var _0x31ebaf=0x0;if(_0x5e2766){if(_0x5e2766[_0x4385('0x1d')]+_0x5e2766[_0x4385('0x1e')]+_0x5e2766['countnoanswerretry']+_0x5e2766[_0x4385('0x1f')]+_0x5e2766[_0x4385('0x20')]+_0x5e2766[_0x4385('0x21')]+_0x5e2766['countmachineretry']+_0x5e2766[_0x4385('0x22')]<_0x19b72b[_0x4385('0x23')][_0x4385('0x24')])_0x31ebaf=0x1;_0x10bdb5({'additional':_0x31ebaf});}else{return db[_0x4385('0x1b')][_0x4385('0x16')]({'raw':!![],'where':{'CmHopperId':_0x21e201['id']},'order':[[_0x4385('0x1c'),_0x4385('0x25')]]})[_0x4385('0xa')](function(_0x470e82){var _0x57688c=0x0;if(_0x470e82){if(_0x470e82[_0x4385('0x1d')]+_0x470e82[_0x4385('0x1e')]+_0x470e82[_0x4385('0x26')]+_0x470e82[_0x4385('0x1f')]+_0x470e82[_0x4385('0x20')]+_0x470e82[_0x4385('0x21')]+_0x470e82['countmachineretry']+_0x470e82['countagentrejectretry']<_0x19b72b[_0x4385('0x23')][_0x4385('0x24')])_0x57688c=0x1;_0x10bdb5({'additional':_0x57688c});}else{_0x10bdb5({'additional':0x0});}})[_0x4385('0x13')](function(_0x1de652){logger['error']('VerifyAdditionalPhones',_0x1de652[_0x4385('0x10')]);_0x2c0742(_0x185478[_0x4385('0xf')](0x1f4,_0x1de652[_0x4385('0x10')]));});}})[_0x4385('0x13')](function(_0x5e2047){logger[_0x4385('0xf')](_0x4385('0x14'),_0x5e2047[_0x4385('0x10')]);_0x2c0742(_0x185478['error'](0x1f4,_0x5e2047[_0x4385('0x10')]));});}else _0x10bdb5({'additional':0x0});});});};exports[_0x4385('0x27')]=function(_0x2c285e){var _0x4126ca=this;return new Promise(function(_0x3d3dcd,_0x2f3c78){return db['CmHopper'][_0x4385('0x16')]({'raw':!![],'where':{'ContactId':_0x2c285e[_0x4385('0x17')]['ContactId'],'ListId':_0x2c285e[_0x4385('0x17')]['ListId'],'VoiceQueueId':_0x2c285e[_0x4385('0x17')][_0x4385('0x19')]===undefined?null:_0x2c285e[_0x4385('0x17')][_0x4385('0x19')],'CampaignId':_0x2c285e[_0x4385('0x17')][_0x4385('0x1a')]===undefined?null:_0x2c285e[_0x4385('0x17')][_0x4385('0x1a')]}})[_0x4385('0xa')](function(_0x1ab587){if(_0x1ab587!=null){return db[_0x4385('0x1b')][_0x4385('0x16')]({'raw':!![],'where':{'CmHopperId':_0x1ab587['id'],'OrderBy':{'$gte':_0x1ab587['OrderBy']}},'order':[[_0x4385('0x1c'),_0x4385('0x25')]]})[_0x4385('0xa')](function(_0x20a473){if(_0x20a473)return activateAdditionalPhone(_0x1ab587,_0x2c285e['body'],_0x20a473,_0x2c285e[_0x4385('0x28')],_0x2c285e[_0x4385('0x29')])[_0x4385('0xa')](function(_0x4eee2a){_0x3d3dcd(_0x4eee2a);});else{return db[_0x4385('0x1b')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x1ab587['id']},'order':[[_0x4385('0x1c'),_0x4385('0x25')]]})[_0x4385('0xa')](function(_0x61b1fe){if(_0x61b1fe)return activateAdditionalPhone(_0x1ab587,_0x2c285e[_0x4385('0x17')],_0x61b1fe,_0x2c285e[_0x4385('0x28')],_0x2c285e[_0x4385('0x29')])['then'](function(_0x5ae82b){_0x3d3dcd(_0x5ae82b);});else{_0x3d3dcd({'id':_0x1ab587['id'],'phone':''});}})[_0x4385('0x13')](function(_0x8e5575){logger[_0x4385('0xf')](_0x4385('0x14'),_0x8e5575[_0x4385('0x10')]);_0x2f3c78(_0x4126ca['error'](0x1f4,_0x8e5575[_0x4385('0x10')]));});}})['catch'](function(_0x5bd6a7){logger[_0x4385('0xf')](_0x4385('0x14'),_0x5bd6a7[_0x4385('0x10')]);_0x2f3c78(_0x4126ca[_0x4385('0xf')](0x1f4,_0x5bd6a7[_0x4385('0x10')]));});}else _0x3d3dcd(0x1);});});};function activateAdditionalPhone(_0x2a4ace,_0x420971,_0xfaa024,_0x2189e2,_0x52377e){return new Promise(function(_0x23b881,_0xadb7ba){var _0x5a3d6e;if(_['isNil'](_0xfaa024['scheduledat'])){_0xfaa024[_0x4385('0x2a')]=moment();}if(moment()>moment(_0xfaa024[_0x4385('0x2a')])){_0x5a3d6e=moment()['add'](_0x52377e||0x3,_0x4385('0x2b'));}else{if(_0xfaa024[_0x4385('0x1c')]==0x0){_0x5a3d6e=moment(_0xfaa024[_0x4385('0x2a')]);}else{_0x5a3d6e=moment()[_0x4385('0x2c')](_0x52377e||0x3,_0x4385('0x2b'));}}if(_['isNil'](_0x5a3d6e)){_0x5a3d6e=moment()[_0x4385('0x2c')](_0x52377e||0x3,'minutes');}var _0x3fdc0b={'phone':_0x2a4ace[_0x4385('0x2d')],'active':0x0,'OrderBy':_[_0x4385('0x2e')](_0x2a4ace[_0x4385('0x1c')])?0x0:_0x2a4ace[_0x4385('0x1c')],'scheduledat':moment()[_0x4385('0x2c')](_0x2189e2||0x1,_0x4385('0x2b')),'countbusyretry':_0x420971['countbusyretry'],'countcongestionretry':_0x420971[_0x4385('0x1e')],'countnoanswerretry':_0x420971[_0x4385('0x26')],'countnosuchnumberretry':_0x420971[_0x4385('0x1f')],'countdropretry':_0x420971['countdropretry'],'countabandonedretry':_0x420971['countabandonedretry'],'countmachineretry':_0x420971[_0x4385('0x2f')],'countagentrejectretry':_0x420971['countagentrejectretry'],'createdAt':_0x420971[_0x4385('0x30')],'updatedAt':_0x420971[_0x4385('0x31')]};var _0x15fd92={'CmHopperId':_0x2a4ace['id'],'phone':_0xfaa024['phone'],'active':0x0,'OrderBy':_['isNil'](_0xfaa024['OrderBy'])?0x0:_0xfaa024[_0x4385('0x1c')],'scheduledat':_0x5a3d6e,'countbusyretry':_0xfaa024[_0x4385('0x1d')],'countcongestionretry':_0xfaa024['countcongestionretry'],'countnoanswerretry':_0xfaa024['countnoanswerretry'],'countnosuchnumberretry':_0xfaa024['countnosuchnumberretry'],'countdropretry':_0xfaa024[_0x4385('0x20')],'countabandonedretry':_0xfaa024[_0x4385('0x21')],'countmachineretry':_0xfaa024[_0x4385('0x2f')],'countagentrejectretry':_0xfaa024[_0x4385('0x22')],'createdAt':_0xfaa024[_0x4385('0x30')],'updatedAt':_0xfaa024[_0x4385('0x31')]};return db[_0x4385('0x32')][_0x4385('0x33')](function(_0x25093d){return db[_0x4385('0x1b')][_0x4385('0x34')](_0x3fdc0b,{'where':{'id':_0xfaa024['id']}},{'transaction':_0x25093d})[_0x4385('0xa')](function(){return db['CmHopper'][_0x4385('0x34')](_0x15fd92,{'where':{'id':_0x2a4ace['id']}},{'transaction':_0x25093d});});})['then'](function(_0x4082ad){_0x23b881({'id':_0x2a4ace['id'],'phone':_0xfaa024[_0x4385('0x2d')]});})['catch'](function(_0x48cd5d){logger[_0x4385('0xf')](_0x4385('0x35'),_0x48cd5d['message']);_0xadb7ba({'error':_0x48cd5d['message']});});});}exports[_0x4385('0x36')]=function(_0xcae7b7){var _0x58a70c=this;return new Promise(function(_0x903ab2,_0x1d0643){return db[_0x4385('0x15')]['update'](_0xcae7b7[_0x4385('0x17')][_0x4385('0x37')],{'where':{'id':_0xcae7b7[_0x4385('0x17')]['id']}})[_0x4385('0xa')](function(_0x2647d5){_0x903ab2(_0x2647d5);})[_0x4385('0x13')](function(_0x3b7975){logger[_0x4385('0xf')]('IncrementPreviewCounters',_0x3b7975['message']);_0x1d0643(_0x58a70c[_0x4385('0xf')](0x1f4,_0x3b7975['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index b74e528..4032338 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 _0x5423=['../../config/environment','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x5423,0xe3));var _0x3542=function(_0x21f7a6,_0x2fbafc){_0x21f7a6=_0x21f7a6-0x0;var _0x3df18a=_0x5423[_0x21f7a6];return _0x3df18a;};'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('./cmHopperAdditionalPhone.controller');router[_0x3542('0x8')]('/',auth[_0x3542('0x9')](),controller[_0x3542('0xa')]);router[_0x3542('0x8')](_0x3542('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x3542('0xc')]('/',auth[_0x3542('0x9')](),controller['create']);router[_0x3542('0xd')](_0x3542('0xb'),auth['isAuthenticated'](),controller[_0x3542('0xe')]);router[_0x3542('0xf')]('/:id',auth[_0x3542('0x9')](),controller[_0x3542('0x10')]);module[_0x3542('0x11')]=router; \ No newline at end of file +var _0x4091=['show','post','create','put','update','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x327ab3,_0x48aff7){var _0x5c33c3=function(_0x2035e7){while(--_0x2035e7){_0x327ab3['push'](_0x327ab3['shift']());}};_0x5c33c3(++_0x48aff7);}(_0x4091,0x181));var _0x1409=function(_0x3ac615,_0x1ba1f1){_0x3ac615=_0x3ac615-0x0;var _0x39048c=_0x4091[_0x3ac615];return _0x39048c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1409('0x0'));var timeout=require(_0x1409('0x1'));var express=require(_0x1409('0x2'));var router=express['Router']();var fs_extra=require(_0x1409('0x3'));var auth=require(_0x1409('0x4'));var interaction=require(_0x1409('0x5'));var config=require(_0x1409('0x6'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0x1409('0x7')]('/',auth[_0x1409('0x8')](),controller[_0x1409('0x9')]);router[_0x1409('0x7')](_0x1409('0xa'),auth[_0x1409('0x8')](),controller[_0x1409('0xb')]);router[_0x1409('0xc')]('/',auth['isAuthenticated'](),controller[_0x1409('0xd')]);router[_0x1409('0xe')]('/:id',auth[_0x1409('0x8')](),controller[_0x1409('0xf')]);router['delete']('/:id',auth[_0x1409('0x8')](),controller[_0x1409('0x10')]);module[_0x1409('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index cd15ce9..284e72b 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 _0x1261=['exports','STRING','INTEGER','contactListQueue','sequelize'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x1261,0x144));var _0x1126=function(_0x34d6cb,_0x1ae55c){_0x34d6cb=_0x34d6cb-0x0;var _0x4372cb=_0x1261[_0x34d6cb];return _0x4372cb;};'use strict';var moment=require('moment');var Sequelize=require(_0x1126('0x0'));module[_0x1126('0x1')]={'phone':{'type':Sequelize[_0x1126('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x1126('0x3')],'unique':_0x1126('0x4')},'ListId':{'type':Sequelize[_0x1126('0x3')],'unique':_0x1126('0x4')},'VoiceQueueId':{'type':Sequelize[_0x1126('0x3')],'unique':_0x1126('0x4')}}; \ No newline at end of file +var _0xb182=['exports','STRING','INTEGER','contactListQueue','sequelize'];(function(_0x21be74,_0x40d85a){var _0x573dc6=function(_0x191c35){while(--_0x191c35){_0x21be74['push'](_0x21be74['shift']());}};_0x573dc6(++_0x40d85a);}(_0xb182,0x121));var _0x2b18=function(_0x5c768b,_0x5e88a6){_0x5c768b=_0x5c768b-0x0;var _0x335af8=_0xb182[_0x5c768b];return _0x335af8;};'use strict';var moment=require('moment');var Sequelize=require(_0x2b18('0x0'));module[_0x2b18('0x1')]={'phone':{'type':Sequelize[_0x2b18('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x2b18('0x3')],'unique':_0x2b18('0x4')},'VoiceQueueId':{'type':Sequelize[_0x2b18('0x3')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index fc16aa6..2ff786a 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 _0x6052=['rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filters','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','params','find','catch','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','reject','save','then','destroy','error','stack','name','send','index','map','CmHopperBlack'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x6052,0xb0));var _0x2605=function(_0x2b8bc2,_0x333bc0){_0x2b8bc2=_0x2b8bc2-0x0;var _0x18e56e=_0x6052[_0x2b8bc2];return _0x18e56e;};'use strict';var emlformat=require(_0x2605('0x0'));var rimraf=require(_0x2605('0x1'));var zipdir=require(_0x2605('0x2'));var jsonpatch=require(_0x2605('0x3'));var rp=require(_0x2605('0x4'));var moment=require(_0x2605('0x5'));var BPromise=require(_0x2605('0x6'));var Mustache=require(_0x2605('0x7'));var util=require(_0x2605('0x8'));var path=require(_0x2605('0x9'));var sox=require(_0x2605('0xa'));var csv=require(_0x2605('0xb'));var ejs=require(_0x2605('0xc'));var fs=require('fs');var fs_extra=require(_0x2605('0xd'));var _=require('lodash');var squel=require(_0x2605('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2605('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2605('0x10'));var Redis=require(_0x2605('0x11'));var authService=require(_0x2605('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2605('0x13'));var hardwareService=require(_0x2605('0x14'));var logger=require(_0x2605('0x15'))(_0x2605('0x16'));var utils=require(_0x2605('0x17'));var config=require(_0x2605('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a0a5f,_0x4d0cc9){_0x4d0cc9=_0x4d0cc9||0xcc;return function(_0x2cc592){if(_0x2cc592){return _0x1a0a5f[_0x2605('0x19')](_0x4d0cc9);}return _0x1a0a5f[_0x2605('0x1a')](_0x4d0cc9)[_0x2605('0x1b')]();};}function respondWithResult(_0x1dba4b,_0x46767c){_0x46767c=_0x46767c||0xc8;return function(_0x294f0e){if(_0x294f0e){return _0x1dba4b[_0x2605('0x1a')](_0x46767c)[_0x2605('0x1c')](_0x294f0e);}};}function respondWithFilteredResult(_0x4a1215,_0x2803e9){return function(_0x2c6448){if(_0x2c6448){var _0x5c0ee4=typeof _0x2803e9[_0x2605('0x1d')]===_0x2605('0x1e')&&typeof _0x2803e9[_0x2605('0x1f')]===_0x2605('0x1e');var _0x1e952f=_0x2c6448['count'];var _0x1b70af=_0x5c0ee4?0x0:_0x2803e9['offset'];var _0x1c62db=_0x5c0ee4?_0x2c6448['count']:_0x2803e9['offset']+_0x2803e9[_0x2605('0x1f')];var _0x2b7780;if(_0x1c62db>=_0x1e952f){_0x1c62db=_0x1e952f;_0x2b7780=0xc8;}else{_0x2b7780=0xce;}_0x4a1215[_0x2605('0x1a')](_0x2b7780);return _0x4a1215['set']('Content-Range',_0x1b70af+'-'+_0x1c62db+'/'+_0x1e952f)[_0x2605('0x1c')](_0x2c6448);}return null;};}function patchUpdates(_0x382d38){return function(_0xcc2317){try{jsonpatch['apply'](_0xcc2317,_0x382d38,!![]);}catch(_0x224b71){return BPromise[_0x2605('0x20')](_0x224b71);}return _0xcc2317[_0x2605('0x21')]();};}function saveUpdates(_0x4236ed,_0x3be6d4){return function(_0x4ac057){if(_0x4ac057){return _0x4ac057['update'](_0x4236ed)[_0x2605('0x22')](function(_0x5bf875){return _0x5bf875;});}return null;};}function removeEntity(_0x44ba6c,_0x2741c2){return function(_0x41de77){if(_0x41de77){return _0x41de77[_0x2605('0x23')]()[_0x2605('0x22')](function(){_0x44ba6c['status'](0xcc)[_0x2605('0x1b')]();});}};}function handleEntityNotFound(_0x58a7d2,_0x11e1c8){return function(_0x522028){if(!_0x522028){_0x58a7d2['sendStatus'](0x194);}return _0x522028;};}function handleError(_0x15db4e,_0x1c74d8){_0x1c74d8=_0x1c74d8||0x1f4;return function(_0x365b03){logger[_0x2605('0x24')](_0x365b03[_0x2605('0x25')]);if(_0x365b03[_0x2605('0x26')]){delete _0x365b03['name'];}_0x15db4e['status'](_0x1c74d8)[_0x2605('0x27')](_0x365b03);};}exports[_0x2605('0x28')]=function(_0x59e452,_0x23a481){var _0x2a4010={},_0x3ebccf={},_0x340815={'count':0x0,'rows':[]};var _0x12fa84=_[_0x2605('0x29')](db[_0x2605('0x2a')][_0x2605('0x2b')],function(_0x54af58){return{'name':_0x54af58[_0x2605('0x2c')],'type':_0x54af58[_0x2605('0x2d')][_0x2605('0x2e')]};});_0x3ebccf[_0x2605('0x2f')]=_['map'](_0x12fa84,'name');_0x3ebccf['query']=_[_0x2605('0x30')](_0x59e452['query']);_0x3ebccf['filters']=_[_0x2605('0x31')](_0x3ebccf[_0x2605('0x2f')],_0x3ebccf[_0x2605('0x32')]);_0x2a4010[_0x2605('0x33')]=_['intersection'](_0x3ebccf[_0x2605('0x2f')],qs['fields'](_0x59e452['query'][_0x2605('0x34')]));_0x2a4010[_0x2605('0x33')]=_0x2a4010['attributes'][_0x2605('0x35')]?_0x2a4010['attributes']:_0x3ebccf[_0x2605('0x2f')];if(!_0x59e452[_0x2605('0x32')][_0x2605('0x36')](_0x2605('0x37'))){_0x2a4010[_0x2605('0x1f')]=qs[_0x2605('0x1f')](_0x59e452[_0x2605('0x32')][_0x2605('0x1f')]);_0x2a4010[_0x2605('0x1d')]=qs[_0x2605('0x1d')](_0x59e452['query'][_0x2605('0x1d')]);}_0x2a4010['order']=qs['sort'](_0x59e452[_0x2605('0x32')]['sort']);_0x2a4010[_0x2605('0x38')]=qs['filters'](_[_0x2605('0x39')](_0x59e452[_0x2605('0x32')],_0x3ebccf[_0x2605('0x3a')]),_0x12fa84);if(_0x59e452[_0x2605('0x32')][_0x2605('0x3b')]){_0x2a4010[_0x2605('0x38')]=_[_0x2605('0x3c')](_0x2a4010[_0x2605('0x38')],{'$or':_[_0x2605('0x29')](_0x12fa84,function(_0x423f9b){if(_0x423f9b[_0x2605('0x2d')]!==_0x2605('0x3d')){var _0x16fef6={};_0x16fef6[_0x423f9b[_0x2605('0x26')]]={'$like':'%'+_0x59e452['query'][_0x2605('0x3b')]+'%'};return _0x16fef6;}})});}_0x2a4010=_['merge']({},_0x2a4010,_0x59e452['options']);var _0x575dd5={'where':_0x2a4010[_0x2605('0x38')]};return db['CmHopperBlack']['count'](_0x575dd5)['then'](function(_0x569403){_0x340815[_0x2605('0x3e')]=_0x569403;if(_0x59e452[_0x2605('0x32')][_0x2605('0x3f')]){_0x2a4010[_0x2605('0x40')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x2605('0x41')](_0x2a4010);})[_0x2605('0x22')](function(_0x239b72){_0x340815[_0x2605('0x42')]=_0x239b72;return _0x340815;})[_0x2605('0x22')](respondWithFilteredResult(_0x23a481,_0x2a4010))['catch'](handleError(_0x23a481,null));};exports['show']=function(_0x34d40b,_0x4a181f){var _0x162af6={'raw':!![],'where':{'id':_0x34d40b[_0x2605('0x43')]['id']}},_0xae8926={};_0xae8926[_0x2605('0x2f')]=_['keys'](db[_0x2605('0x2a')][_0x2605('0x2b')]);_0xae8926['query']=_[_0x2605('0x30')](_0x34d40b[_0x2605('0x32')]);_0xae8926[_0x2605('0x3a')]=_['intersection'](_0xae8926[_0x2605('0x2f')],_0xae8926[_0x2605('0x32')]);_0x162af6['attributes']=_[_0x2605('0x31')](_0xae8926['model'],qs['fields'](_0x34d40b[_0x2605('0x32')][_0x2605('0x34')]));_0x162af6[_0x2605('0x33')]=_0x162af6[_0x2605('0x33')][_0x2605('0x35')]?_0x162af6['attributes']:_0xae8926[_0x2605('0x2f')];if(_0x34d40b[_0x2605('0x32')][_0x2605('0x3f')]){_0x162af6['include']=[{'all':!![]}];}_0x162af6=_[_0x2605('0x3c')]({},_0x162af6,_0x34d40b['options']);return db['CmHopperBlack'][_0x2605('0x44')](_0x162af6)[_0x2605('0x22')](handleEntityNotFound(_0x4a181f,null))[_0x2605('0x22')](respondWithResult(_0x4a181f,null))[_0x2605('0x45')](handleError(_0x4a181f,null));};exports[_0x2605('0x46')]=function(_0x10fc96,_0x529f93){if(_0x10fc96[_0x2605('0x47')]['id']){delete _0x10fc96[_0x2605('0x47')]['id'];}return db[_0x2605('0x2a')][_0x2605('0x44')]({'where':{'id':_0x10fc96[_0x2605('0x43')]['id']}})[_0x2605('0x22')](handleEntityNotFound(_0x529f93,null))[_0x2605('0x22')](saveUpdates(_0x10fc96[_0x2605('0x47')],null))[_0x2605('0x22')](respondWithResult(_0x529f93,null))[_0x2605('0x45')](handleError(_0x529f93,null));};exports[_0x2605('0x23')]=function(_0xf9bb56,_0x1f914d){return db['CmHopperBlack'][_0x2605('0x44')]({'where':{'id':_0xf9bb56['params']['id']}})[_0x2605('0x22')](handleEntityNotFound(_0x1f914d,null))['then'](removeEntity(_0x1f914d,null))[_0x2605('0x45')](handleError(_0x1f914d,null));};exports[_0x2605('0x48')]=function(_0x45da96,_0x20137f){return db[_0x2605('0x2a')][_0x2605('0x48')]()['then'](respondWithResult(_0x20137f,null))['catch'](handleError(_0x20137f,null));}; \ No newline at end of file +var _0x6d21=['error','name','send','index','CmHopperBlack','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','rows','catch','params','length','find','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','squel','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus'];(function(_0x49d19d,_0x245cf5){var _0x4ebef1=function(_0xf0a4e6){while(--_0xf0a4e6){_0x49d19d['push'](_0x49d19d['shift']());}};_0x4ebef1(++_0x245cf5);}(_0x6d21,0xfd));var _0x16d2=function(_0xcccd92,_0x135e42){_0xcccd92=_0xcccd92-0x0;var _0x34b822=_0x6d21[_0xcccd92];return _0x34b822;};'use strict';var emlformat=require(_0x16d2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x16d2('0x1'));var jsonpatch=require(_0x16d2('0x2'));var rp=require(_0x16d2('0x3'));var moment=require(_0x16d2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x16d2('0x5'));var util=require('util');var path=require('path');var sox=require(_0x16d2('0x6'));var csv=require(_0x16d2('0x7'));var ejs=require(_0x16d2('0x8'));var fs=require('fs');var fs_extra=require(_0x16d2('0x9'));var _=require('lodash');var squel=require(_0x16d2('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x16d2('0x7'));var querystring=require(_0x16d2('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x16d2('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x16d2('0xd'));var hardwareService=require(_0x16d2('0xe'));var logger=require(_0x16d2('0xf'))(_0x16d2('0x10'));var utils=require(_0x16d2('0x11'));var config=require(_0x16d2('0x12'));var licenseUtil=require(_0x16d2('0x13'));var db=require(_0x16d2('0x14'))['db'];function respondWithStatusCode(_0x510c3a,_0x359b1a){_0x359b1a=_0x359b1a||0xcc;return function(_0x229703){if(_0x229703){return _0x510c3a['sendStatus'](_0x359b1a);}return _0x510c3a[_0x16d2('0x15')](_0x359b1a)[_0x16d2('0x16')]();};}function respondWithResult(_0x5c9d35,_0x419498){_0x419498=_0x419498||0xc8;return function(_0x7b30ae){if(_0x7b30ae){return _0x5c9d35[_0x16d2('0x15')](_0x419498)[_0x16d2('0x17')](_0x7b30ae);}};}function respondWithFilteredResult(_0x12e294,_0x122028){return function(_0x19595e){if(_0x19595e){var _0x1fa6b1=typeof _0x122028[_0x16d2('0x18')]===_0x16d2('0x19')&&typeof _0x122028['limit']===_0x16d2('0x19');var _0x37df06=_0x19595e['count'];var _0x162eea=_0x1fa6b1?0x0:_0x122028[_0x16d2('0x18')];var _0x36f275=_0x1fa6b1?_0x19595e['count']:_0x122028[_0x16d2('0x18')]+_0x122028['limit'];var _0x1d92af;if(_0x36f275>=_0x37df06){_0x36f275=_0x37df06;_0x1d92af=0xc8;}else{_0x1d92af=0xce;}_0x12e294[_0x16d2('0x15')](_0x1d92af);return _0x12e294[_0x16d2('0x1a')](_0x16d2('0x1b'),_0x162eea+'-'+_0x36f275+'/'+_0x37df06)[_0x16d2('0x17')](_0x19595e);}return null;};}function patchUpdates(_0x2f0100){return function(_0x31b14d){try{jsonpatch[_0x16d2('0x1c')](_0x31b14d,_0x2f0100,!![]);}catch(_0x16d3d0){return BPromise[_0x16d2('0x1d')](_0x16d3d0);}return _0x31b14d[_0x16d2('0x1e')]();};}function saveUpdates(_0x122e3f,_0x14bf60){return function(_0x882a58){if(_0x882a58){return _0x882a58[_0x16d2('0x1f')](_0x122e3f)[_0x16d2('0x20')](function(_0x4076fe){return _0x4076fe;});}return null;};}function removeEntity(_0x59d410,_0x61eb7c){return function(_0x257da9){if(_0x257da9){return _0x257da9[_0x16d2('0x21')]()[_0x16d2('0x20')](function(){_0x59d410['status'](0xcc)[_0x16d2('0x16')]();});}};}function handleEntityNotFound(_0x55b47a,_0x15bb6b){return function(_0x32ec20){if(!_0x32ec20){_0x55b47a[_0x16d2('0x22')](0x194);}return _0x32ec20;};}function handleError(_0x18545a,_0x3b704d){_0x3b704d=_0x3b704d||0x1f4;return function(_0x3243c8){logger[_0x16d2('0x23')](_0x3243c8['stack']);if(_0x3243c8[_0x16d2('0x24')]){delete _0x3243c8[_0x16d2('0x24')];}_0x18545a[_0x16d2('0x15')](_0x3b704d)[_0x16d2('0x25')](_0x3243c8);};}exports[_0x16d2('0x26')]=function(_0x28796c,_0x494bfc){var _0x556cf6={},_0x288ef9={},_0xf657a6={'count':0x0,'rows':[]};var _0x43edf0=_['map'](db[_0x16d2('0x27')][_0x16d2('0x28')],function(_0x1b9092){return{'name':_0x1b9092[_0x16d2('0x29')],'type':_0x1b9092['type'][_0x16d2('0x2a')]};});_0x288ef9[_0x16d2('0x2b')]=_[_0x16d2('0x2c')](_0x43edf0,_0x16d2('0x24'));_0x288ef9[_0x16d2('0x2d')]=_[_0x16d2('0x2e')](_0x28796c['query']);_0x288ef9[_0x16d2('0x2f')]=_[_0x16d2('0x30')](_0x288ef9[_0x16d2('0x2b')],_0x288ef9['query']);_0x556cf6['attributes']=_['intersection'](_0x288ef9[_0x16d2('0x2b')],qs[_0x16d2('0x31')](_0x28796c['query'][_0x16d2('0x31')]));_0x556cf6['attributes']=_0x556cf6[_0x16d2('0x32')]['length']?_0x556cf6[_0x16d2('0x32')]:_0x288ef9['model'];if(!_0x28796c[_0x16d2('0x2d')]['hasOwnProperty'](_0x16d2('0x33'))){_0x556cf6[_0x16d2('0x34')]=qs[_0x16d2('0x34')](_0x28796c['query']['limit']);_0x556cf6[_0x16d2('0x18')]=qs[_0x16d2('0x18')](_0x28796c[_0x16d2('0x2d')][_0x16d2('0x18')]);}_0x556cf6[_0x16d2('0x35')]=qs[_0x16d2('0x36')](_0x28796c[_0x16d2('0x2d')][_0x16d2('0x36')]);_0x556cf6[_0x16d2('0x37')]=qs['filters'](_[_0x16d2('0x38')](_0x28796c[_0x16d2('0x2d')],_0x288ef9[_0x16d2('0x2f')]),_0x43edf0);if(_0x28796c['query'][_0x16d2('0x39')]){_0x556cf6[_0x16d2('0x37')]=_[_0x16d2('0x3a')](_0x556cf6[_0x16d2('0x37')],{'$or':_[_0x16d2('0x2c')](_0x43edf0,function(_0x43e89a){if(_0x43e89a[_0x16d2('0x3b')]!==_0x16d2('0x3c')){var _0x374062={};_0x374062[_0x43e89a['name']]={'$like':'%'+_0x28796c[_0x16d2('0x2d')][_0x16d2('0x39')]+'%'};return _0x374062;}})});}_0x556cf6=_[_0x16d2('0x3a')]({},_0x556cf6,_0x28796c[_0x16d2('0x3d')]);var _0x12b586={'where':_0x556cf6[_0x16d2('0x37')]};return db[_0x16d2('0x27')][_0x16d2('0x3e')](_0x12b586)[_0x16d2('0x20')](function(_0x1c7357){_0xf657a6[_0x16d2('0x3e')]=_0x1c7357;if(_0x28796c['query'][_0x16d2('0x3f')]){_0x556cf6[_0x16d2('0x40')]=[{'all':!![]}];}return db[_0x16d2('0x27')]['findAll'](_0x556cf6);})[_0x16d2('0x20')](function(_0x3c0096){_0xf657a6[_0x16d2('0x41')]=_0x3c0096;return _0xf657a6;})[_0x16d2('0x20')](respondWithFilteredResult(_0x494bfc,_0x556cf6))[_0x16d2('0x42')](handleError(_0x494bfc,null));};exports['show']=function(_0x5d2175,_0xe6f99f){var _0x49a748={'raw':!![],'where':{'id':_0x5d2175[_0x16d2('0x43')]['id']}},_0x42f6bc={};_0x42f6bc[_0x16d2('0x2b')]=_[_0x16d2('0x2e')](db['CmHopperBlack']['rawAttributes']);_0x42f6bc[_0x16d2('0x2d')]=_['keys'](_0x5d2175[_0x16d2('0x2d')]);_0x42f6bc['filters']=_['intersection'](_0x42f6bc[_0x16d2('0x2b')],_0x42f6bc['query']);_0x49a748[_0x16d2('0x32')]=_['intersection'](_0x42f6bc[_0x16d2('0x2b')],qs[_0x16d2('0x31')](_0x5d2175['query'][_0x16d2('0x31')]));_0x49a748[_0x16d2('0x32')]=_0x49a748[_0x16d2('0x32')][_0x16d2('0x44')]?_0x49a748['attributes']:_0x42f6bc[_0x16d2('0x2b')];if(_0x5d2175[_0x16d2('0x2d')]['includeAll']){_0x49a748['include']=[{'all':!![]}];}_0x49a748=_[_0x16d2('0x3a')]({},_0x49a748,_0x5d2175[_0x16d2('0x3d')]);return db['CmHopperBlack'][_0x16d2('0x45')](_0x49a748)[_0x16d2('0x20')](handleEntityNotFound(_0xe6f99f,null))[_0x16d2('0x20')](respondWithResult(_0xe6f99f,null))['catch'](handleError(_0xe6f99f,null));};exports['update']=function(_0xc78a07,_0x5efe27){if(_0xc78a07[_0x16d2('0x46')]['id']){delete _0xc78a07[_0x16d2('0x46')]['id'];}return db[_0x16d2('0x27')][_0x16d2('0x45')]({'where':{'id':_0xc78a07[_0x16d2('0x43')]['id']}})[_0x16d2('0x20')](handleEntityNotFound(_0x5efe27,null))[_0x16d2('0x20')](saveUpdates(_0xc78a07[_0x16d2('0x46')],null))[_0x16d2('0x20')](respondWithResult(_0x5efe27,null))[_0x16d2('0x42')](handleError(_0x5efe27,null));};exports['destroy']=function(_0x584249,_0x348f53){return db[_0x16d2('0x27')][_0x16d2('0x45')]({'where':{'id':_0x584249['params']['id']}})[_0x16d2('0x20')](handleEntityNotFound(_0x348f53,null))['then'](removeEntity(_0x348f53,null))['catch'](handleError(_0x348f53,null));};exports[_0x16d2('0x47')]=function(_0x56caf9,_0x2684a7){return db[_0x16d2('0x27')][_0x16d2('0x47')]()[_0x16d2('0x20')](respondWithResult(_0x2684a7,null))['catch'](handleError(_0x2684a7,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 532e4c5..6fba603 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 _0x8e11=['CmHopperBlack','cm_hopper_black','lodash','util','api','bluebird','request-promise','path','rimraf','./cmHopperBlack.attributes','exports','define'];(function(_0x191373,_0x349e12){var _0x3038a7=function(_0x2dafa2){while(--_0x2dafa2){_0x191373['push'](_0x191373['shift']());}};_0x3038a7(++_0x349e12);}(_0x8e11,0x1a6));var _0x18e1=function(_0x950e99,_0x2e2639){_0x950e99=_0x950e99-0x0;var _0x16f9e6=_0x8e11[_0x950e99];return _0x16f9e6;};'use strict';var _=require(_0x18e1('0x0'));var util=require(_0x18e1('0x1'));var logger=require('../../config/logger')(_0x18e1('0x2'));var moment=require('moment');var BPromise=require(_0x18e1('0x3'));var rp=require(_0x18e1('0x4'));var fs=require('fs');var path=require(_0x18e1('0x5'));var rimraf=require(_0x18e1('0x6'));var config=require('../../config/environment');var attributes=require(_0x18e1('0x7'));module[_0x18e1('0x8')]=function(_0x23c2d1,_0x1e6f69){return _0x23c2d1[_0x18e1('0x9')](_0x18e1('0xa'),attributes,{'tableName':_0x18e1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b89=['../../config/logger','bluebird','request-promise','rimraf','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','util'];(function(_0xb1353b,_0x44adad){var _0x4ba33f=function(_0x453bf6){while(--_0x453bf6){_0xb1353b['push'](_0xb1353b['shift']());}};_0x4ba33f(++_0x44adad);}(_0x5b89,0x149));var _0x95b8=function(_0x5f6a8a,_0x45f474){_0x5f6a8a=_0x5f6a8a-0x0;var _0x2cce4d=_0x5b89[_0x5f6a8a];return _0x2cce4d;};'use strict';var _=require('lodash');var util=require(_0x95b8('0x0'));var logger=require(_0x95b8('0x1'))('api');var moment=require('moment');var BPromise=require(_0x95b8('0x2'));var rp=require(_0x95b8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x95b8('0x4'));var config=require('../../config/environment');var attributes=require(_0x95b8('0x5'));module[_0x95b8('0x6')]=function(_0x3e0407,_0x5b63bd){return _0x3e0407[_0x95b8('0x7')](_0x95b8('0x8'),attributes,{'tableName':_0x95b8('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 d9f90da..da6f861 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 _0xef51=['update','body','where','DestroyCmHopperBlack','destroy','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetCmHopperBlack','options','raw','limit','include','attributes','model','map','UpdateCmHopperBlack','CmHopperBlack'];(function(_0x55d6c8,_0x4fff7f){var _0x56794d=function(_0x350b27){while(--_0x350b27){_0x55d6c8['push'](_0x55d6c8['shift']());}};_0x56794d(++_0x4fff7f);}(_0xef51,0xd1));var _0x1ef5=function(_0x46f7fe,_0x40ecd3){_0x46f7fe=_0x46f7fe-0x0;var _0x276f00=_0xef51[_0x46f7fe];return _0x276f00;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x1ef5('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1ef5('0x1'));var db=require(_0x1ef5('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ef5('0x3'))(_0x1ef5('0x4'));var config=require('../../config/environment');var jayson=require(_0x1ef5('0x5'));var client=jayson['client'][_0x1ef5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x583109,_0x4d98e3,_0x2b582f){return new BPromise(function(_0x1aef2b,_0x11a7dc){return client[_0x1ef5('0x7')](_0x583109,_0x2b582f)[_0x1ef5('0x8')](function(_0x4d69d1){logger[_0x1ef5('0x9')](_0x1ef5('0xa'),_0x4d98e3,_0x1ef5('0xb'));logger[_0x1ef5('0xc')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x4d98e3,_0x1ef5('0xb'),JSON[_0x1ef5('0xd')](_0x4d69d1));if(_0x4d69d1[_0x1ef5('0xe')]){if(_0x4d69d1['error'][_0x1ef5('0xf')]===0x1f4){logger[_0x1ef5('0xe')](_0x1ef5('0xa'),_0x4d98e3,_0x4d69d1[_0x1ef5('0xe')][_0x1ef5('0x10')]);return _0x11a7dc(_0x4d69d1[_0x1ef5('0xe')][_0x1ef5('0x10')]);}logger[_0x1ef5('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x4d98e3,_0x4d69d1[_0x1ef5('0xe')][_0x1ef5('0x10')]);return _0x1aef2b(_0x4d69d1['error'][_0x1ef5('0x10')]);}else{logger[_0x1ef5('0x9')]('CmHopperBlack,\x20%s,\x20%s',_0x4d98e3,_0x1ef5('0xb'));_0x1aef2b(_0x4d69d1[_0x1ef5('0x11')]['message']);}})[_0x1ef5('0x12')](function(_0x146031){logger[_0x1ef5('0xe')](_0x1ef5('0xa'),_0x4d98e3,_0x146031);_0x11a7dc(_0x146031);});});}exports[_0x1ef5('0x13')]=function(_0x1603c3){var _0x281c0a=this;return new Promise(function(_0xdc9b8b,_0x401e34){return db['CmHopperBlack']['findAll']({'raw':_0x1603c3['options']?_0x1603c3[_0x1ef5('0x14')][_0x1ef5('0x15')]===undefined?!![]:![]:!![],'where':_0x1603c3[_0x1ef5('0x14')]?_0x1603c3[_0x1ef5('0x14')]['where']||null:null,'attributes':_0x1603c3[_0x1ef5('0x14')]?_0x1603c3['options']['attributes']||null:null,'limit':_0x1603c3[_0x1ef5('0x14')]?_0x1603c3[_0x1ef5('0x14')][_0x1ef5('0x16')]||null:null,'include':_0x1603c3[_0x1ef5('0x14')]?_0x1603c3[_0x1ef5('0x14')]['include']?_['map'](_0x1603c3[_0x1ef5('0x14')][_0x1ef5('0x17')],function(_0x20bde3){return{'model':db[_0x20bde3['model']],'as':_0x20bde3['as'],'attributes':_0x20bde3[_0x1ef5('0x18')],'include':_0x20bde3[_0x1ef5('0x17')]?_['map'](_0x20bde3[_0x1ef5('0x17')],function(_0x279c95){return{'model':db[_0x279c95[_0x1ef5('0x19')]],'as':_0x279c95['as'],'attributes':_0x279c95[_0x1ef5('0x18')],'include':_0x279c95['include']?_[_0x1ef5('0x1a')](_0x279c95[_0x1ef5('0x17')],function(_0x26eb84){return{'model':db[_0x26eb84['model']],'as':_0x26eb84['as'],'attributes':_0x26eb84[_0x1ef5('0x18')]};}):[]};}):[]};}):[]:[]})[_0x1ef5('0x8')](function(_0x4cd2ac){logger[_0x1ef5('0x9')](_0x1ef5('0x13'),_0x1603c3);logger['debug'](_0x1ef5('0x13'),_0x1603c3,JSON[_0x1ef5('0xd')](_0x4cd2ac));_0xdc9b8b(_0x4cd2ac);})[_0x1ef5('0x12')](function(_0x8387fa){logger[_0x1ef5('0xe')](_0x1ef5('0x13'),_0x8387fa[_0x1ef5('0x10')],_0x1603c3);_0x401e34(_0x281c0a[_0x1ef5('0xe')](0x1f4,_0x8387fa['message']));});});};exports[_0x1ef5('0x1b')]=function(_0x57a8db){var _0x264e20=this;return new Promise(function(_0x25cbe2,_0x4e0ebe){return db[_0x1ef5('0x1c')][_0x1ef5('0x1d')](_0x57a8db[_0x1ef5('0x1e')],{'raw':_0x57a8db[_0x1ef5('0x14')]?_0x57a8db[_0x1ef5('0x14')][_0x1ef5('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57a8db[_0x1ef5('0x14')]?_0x57a8db[_0x1ef5('0x14')][_0x1ef5('0x1f')]||null:null,'attributes':_0x57a8db[_0x1ef5('0x14')]?_0x57a8db[_0x1ef5('0x14')][_0x1ef5('0x18')]||null:null,'limit':_0x57a8db[_0x1ef5('0x14')]?_0x57a8db[_0x1ef5('0x14')][_0x1ef5('0x16')]||null:null})['then'](function(_0x330d57){logger[_0x1ef5('0x9')]('UpdateCmHopperBlack',_0x57a8db);logger[_0x1ef5('0xc')](_0x1ef5('0x1b'),_0x57a8db,JSON['stringify'](_0x330d57));_0x25cbe2(_0x330d57);})[_0x1ef5('0x12')](function(_0x3ccada){logger[_0x1ef5('0xe')]('UpdateCmHopperBlack',_0x3ccada[_0x1ef5('0x10')],_0x57a8db);_0x4e0ebe(_0x264e20[_0x1ef5('0xe')](0x1f4,_0x3ccada['message']));});});};exports[_0x1ef5('0x20')]=function(_0x14f09b){var _0x3a2abd=this;return new Promise(function(_0x81a24e,_0x307124){return db[_0x1ef5('0x1c')][_0x1ef5('0x21')]({'where':_0x14f09b[_0x1ef5('0x14')]?_0x14f09b[_0x1ef5('0x14')][_0x1ef5('0x1f')]||null:null})[_0x1ef5('0x8')](function(_0x3523a0){logger[_0x1ef5('0x9')]('DestroyCmHopperBlack',_0x14f09b);logger[_0x1ef5('0xc')](_0x1ef5('0x20'),_0x14f09b,JSON[_0x1ef5('0xd')](_0x3523a0));_0x81a24e(_0x3523a0);})[_0x1ef5('0x12')](function(_0x497792){logger[_0x1ef5('0xe')](_0x1ef5('0x20'),_0x497792[_0x1ef5('0x10')],_0x14f09b);_0x307124(_0x3a2abd['error'](0x1f4,_0x497792[_0x1ef5('0x10')]));});});}; \ No newline at end of file +var _0x5d30=['catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','stringify','UpdateCmHopperBlack','update','destroy','DestroyCmHopperBlack','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x5d30,0x1c9));var _0x05d3=function(_0x3a3b9e,_0xc59037){_0x3a3b9e=_0x3a3b9e-0x0;var _0x148103=_0x5d30[_0x3a3b9e];return _0x148103;};'use strict';var _=require('lodash');var util=require(_0x05d3('0x0'));var moment=require(_0x05d3('0x1'));var BPromise=require(_0x05d3('0x2'));var rs=require(_0x05d3('0x3'));var fs=require('fs');var Redis=require(_0x05d3('0x4'));var db=require(_0x05d3('0x5'))['db'];var utils=require(_0x05d3('0x6'));var logger=require(_0x05d3('0x7'))(_0x05d3('0x8'));var config=require('../../config/environment');var jayson=require(_0x05d3('0x9'));var client=jayson[_0x05d3('0xa')][_0x05d3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x151dc9,_0x3e3686,_0x51176f){return new BPromise(function(_0x4c0d64,_0xd61a9b){return client[_0x05d3('0xc')](_0x151dc9,_0x51176f)[_0x05d3('0xd')](function(_0x35ebf6){logger[_0x05d3('0xe')](_0x05d3('0xf'),_0x3e3686,_0x05d3('0x10'));logger[_0x05d3('0x11')](_0x05d3('0x12'),_0x3e3686,_0x05d3('0x10'),JSON['stringify'](_0x35ebf6));if(_0x35ebf6[_0x05d3('0x13')]){if(_0x35ebf6[_0x05d3('0x13')][_0x05d3('0x14')]===0x1f4){logger['error'](_0x05d3('0xf'),_0x3e3686,_0x35ebf6[_0x05d3('0x13')]['message']);return _0xd61a9b(_0x35ebf6[_0x05d3('0x13')][_0x05d3('0x15')]);}logger[_0x05d3('0x13')](_0x05d3('0xf'),_0x3e3686,_0x35ebf6[_0x05d3('0x13')][_0x05d3('0x15')]);return _0x4c0d64(_0x35ebf6[_0x05d3('0x13')]['message']);}else{logger[_0x05d3('0xe')](_0x05d3('0xf'),_0x3e3686,_0x05d3('0x10'));_0x4c0d64(_0x35ebf6[_0x05d3('0x16')][_0x05d3('0x15')]);}})[_0x05d3('0x17')](function(_0x15c9e4){logger['error'](_0x05d3('0xf'),_0x3e3686,_0x15c9e4);_0xd61a9b(_0x15c9e4);});});}exports[_0x05d3('0x18')]=function(_0x108077){var _0x1757ef=this;return new Promise(function(_0x5c5b9f,_0x23993c){return db[_0x05d3('0x19')][_0x05d3('0x1a')]({'raw':_0x108077[_0x05d3('0x1b')]?_0x108077[_0x05d3('0x1b')][_0x05d3('0x1c')]===undefined?!![]:![]:!![],'where':_0x108077[_0x05d3('0x1b')]?_0x108077[_0x05d3('0x1b')][_0x05d3('0x1d')]||null:null,'attributes':_0x108077[_0x05d3('0x1b')]?_0x108077['options'][_0x05d3('0x1e')]||null:null,'limit':_0x108077[_0x05d3('0x1b')]?_0x108077['options'][_0x05d3('0x1f')]||null:null,'include':_0x108077[_0x05d3('0x1b')]?_0x108077[_0x05d3('0x1b')][_0x05d3('0x20')]?_[_0x05d3('0x21')](_0x108077[_0x05d3('0x1b')][_0x05d3('0x20')],function(_0x2dc534){return{'model':db[_0x2dc534[_0x05d3('0x22')]],'as':_0x2dc534['as'],'attributes':_0x2dc534[_0x05d3('0x1e')],'include':_0x2dc534['include']?_[_0x05d3('0x21')](_0x2dc534['include'],function(_0x3692e8){return{'model':db[_0x3692e8['model']],'as':_0x3692e8['as'],'attributes':_0x3692e8[_0x05d3('0x1e')],'include':_0x3692e8[_0x05d3('0x20')]?_[_0x05d3('0x21')](_0x3692e8[_0x05d3('0x20')],function(_0x94c752){return{'model':db[_0x94c752[_0x05d3('0x22')]],'as':_0x94c752['as'],'attributes':_0x94c752[_0x05d3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x05d3('0xd')](function(_0x533ef3){logger['info'](_0x05d3('0x18'),_0x108077);logger['debug']('GetCmHopperBlack',_0x108077,JSON[_0x05d3('0x23')](_0x533ef3));_0x5c5b9f(_0x533ef3);})[_0x05d3('0x17')](function(_0x13c207){logger[_0x05d3('0x13')]('GetCmHopperBlack',_0x13c207[_0x05d3('0x15')],_0x108077);_0x23993c(_0x1757ef[_0x05d3('0x13')](0x1f4,_0x13c207['message']));});});};exports[_0x05d3('0x24')]=function(_0x128e35){var _0x1c09e8=this;return new Promise(function(_0x53072e,_0x5cee43){return db[_0x05d3('0x19')][_0x05d3('0x25')](_0x128e35['body'],{'raw':_0x128e35['options']?_0x128e35[_0x05d3('0x1b')][_0x05d3('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x128e35['options']?_0x128e35[_0x05d3('0x1b')][_0x05d3('0x1d')]||null:null,'attributes':_0x128e35['options']?_0x128e35[_0x05d3('0x1b')][_0x05d3('0x1e')]||null:null,'limit':_0x128e35[_0x05d3('0x1b')]?_0x128e35[_0x05d3('0x1b')]['limit']||null:null})[_0x05d3('0xd')](function(_0x1eeb03){logger[_0x05d3('0xe')](_0x05d3('0x24'),_0x128e35);logger[_0x05d3('0x11')](_0x05d3('0x24'),_0x128e35,JSON['stringify'](_0x1eeb03));_0x53072e(_0x1eeb03);})[_0x05d3('0x17')](function(_0x41d163){logger[_0x05d3('0x13')](_0x05d3('0x24'),_0x41d163['message'],_0x128e35);_0x5cee43(_0x1c09e8[_0x05d3('0x13')](0x1f4,_0x41d163[_0x05d3('0x15')]));});});};exports['DestroyCmHopperBlack']=function(_0x568084){var _0x2ae155=this;return new Promise(function(_0x30eef3,_0x2a4303){return db[_0x05d3('0x19')][_0x05d3('0x26')]({'where':_0x568084[_0x05d3('0x1b')]?_0x568084['options'][_0x05d3('0x1d')]||null:null})['then'](function(_0x12fb96){logger[_0x05d3('0xe')]('DestroyCmHopperBlack',_0x568084);logger[_0x05d3('0x11')]('DestroyCmHopperBlack',_0x568084,JSON[_0x05d3('0x23')](_0x12fb96));_0x30eef3(_0x12fb96);})['catch'](function(_0x5d4dbc){logger[_0x05d3('0x13')](_0x05d3('0x27'),_0x5d4dbc[_0x05d3('0x15')],_0x568084);_0x2a4303(_0x2ae155[_0x05d3('0x13')](0x1f4,_0x5d4dbc['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 6b1bb1b..0f86f02 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 _0xffd6=['path','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','/describe','describe','show','/:id','update','delete','destroy','multer','util'];(function(_0x3a7634,_0x2db384){var _0x23bbe9=function(_0x226734){while(--_0x226734){_0x3a7634['push'](_0x3a7634['shift']());}};_0x23bbe9(++_0x2db384);}(_0xffd6,0x97));var _0x6ffd=function(_0x2601b4,_0x315e78){_0x2601b4=_0x2601b4-0x0;var _0x3e3661=_0xffd6[_0x2601b4];return _0x3e3661;};'use strict';var multer=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var path=require(_0x6ffd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6ffd('0x3')]();var fs_extra=require(_0x6ffd('0x4'));var auth=require(_0x6ffd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6ffd('0x6'));var controller=require(_0x6ffd('0x7'));router[_0x6ffd('0x8')]('/',auth[_0x6ffd('0x9')](),controller['index']);router[_0x6ffd('0x8')](_0x6ffd('0xa'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0xb')]);router[_0x6ffd('0x8')]('/:id',auth[_0x6ffd('0x9')](),controller[_0x6ffd('0xc')]);router['put'](_0x6ffd('0xd'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0xe')]);router[_0x6ffd('0xf')](_0x6ffd('0xd'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0x10')]);module['exports']=router; \ No newline at end of file +var _0x2ef3=['describe','/:id','show','put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','/describe','isAuthenticated'];(function(_0x4df587,_0x55f069){var _0xf372bd=function(_0xc12074){while(--_0xc12074){_0x4df587['push'](_0x4df587['shift']());}};_0xf372bd(++_0x55f069);}(_0x2ef3,0xba));var _0x32ef=function(_0x3f0b7e,_0x377c37){_0x3f0b7e=_0x3f0b7e-0x0;var _0x17238b=_0x2ef3[_0x3f0b7e];return _0x17238b;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0xf')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x32ef('0x10')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 0f63ac5..5f292a4 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 _0x6662=['endtime','diff','BOOLEAN','moment','exports','INTEGER','STRING','DATE'];(function(_0x59c86e,_0x38ce57){var _0x48a50e=function(_0x1eeda5){while(--_0x1eeda5){_0x59c86e['push'](_0x59c86e['shift']());}};_0x48a50e(++_0x38ce57);}(_0x6662,0x9b));var _0x2666=function(_0xd89fde,_0x4d2417){_0xd89fde=_0xd89fde-0x0;var _0xe67f58=_0x6662[_0xd89fde];return _0xe67f58;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2666('0x0'));module[_0x2666('0x1')]={'state':{'type':Sequelize[_0x2666('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x2666('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2666('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2666('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2666('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x2666('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x2666('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x2666('0x3')]},'calleridname':{'type':Sequelize[_0x2666('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x2666('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x2666('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x2666('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2666('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x2666('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2666('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x2666('0x3')]},'campaigntype':{'type':Sequelize[_0x2666('0x3')]},'membername':{'type':Sequelize[_0x2666('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2666('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x2666('0x4')],'set':function(_0x1be216){var _0x348cf2=this['getDataValue'](_0x2666('0x5'));if(_0x348cf2&&_0x1be216){this['setDataValue']('followuptime',moment(_0x1be216)[_0x2666('0x6')](moment(_0x348cf2),'seconds'));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x2666('0x7')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x2666('0x7')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x2666('0x4')]},'callback':{'type':Sequelize[_0x2666('0x7')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2666('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2666('0x4')]},'deleted':{'type':Sequelize[_0x2666('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x2666('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x2666('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x2666('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2666('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2666('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2666('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2666('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3be3=['DATE','INTEGER','STRING','followuptime','diff','seconds','BOOLEAN','moment','exports'];(function(_0x5033d,_0x4a9772){var _0x3063c7=function(_0x5d0271){while(--_0x5d0271){_0x5033d['push'](_0x5033d['shift']());}};_0x3063c7(++_0x4a9772);}(_0x3be3,0x15d));var _0x33be=function(_0x3ab353,_0x5d5283){_0x3ab353=_0x3ab353-0x0;var _0x1e2285=_0x3be3[_0x3ab353];return _0x1e2285;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x33be('0x0'));module[_0x33be('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x33be('0x2')]},'countbusyretry':{'type':Sequelize[_0x33be('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x33be('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x33be('0x4')]},'originatecalleridname':{'type':Sequelize[_0x33be('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x33be('0x4')]},'starttime':{'type':Sequelize[_0x33be('0x2')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x33be('0x2')]},'droptime':{'type':Sequelize[_0x33be('0x2')]},'endtime':{'type':Sequelize[_0x33be('0x2')]},'ringtime':{'type':Sequelize[_0x33be('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x33be('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x33be('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x33be('0x4')]},'campaign':{'type':Sequelize[_0x33be('0x4')]},'campaigntype':{'type':Sequelize[_0x33be('0x4')]},'membername':{'type':Sequelize[_0x33be('0x4')]},'reason':{'type':Sequelize[_0x33be('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x33be('0x4')]},'dispositionat':{'type':Sequelize[_0x33be('0x2')],'set':function(_0x331686){var _0x1aa277=this['getDataValue']('endtime');if(_0x1aa277&&_0x331686){this['setDataValue'](_0x33be('0x5'),moment(_0x331686)[_0x33be('0x6')](moment(_0x1aa277),_0x33be('0x7')));}}},'amd':{'type':Sequelize[_0x33be('0x8')],'defaultValue':![]},'fax':{'type':Sequelize[_0x33be('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x33be('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x33be('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x33be('0x2')]},'callback':{'type':Sequelize[_0x33be('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x33be('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x33be('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x33be('0x2')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x33be('0x2')]},'countnosuchnumberretry':{'type':Sequelize[_0x33be('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x33be('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x33be('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x33be('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 1b788bd..bf1659b 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 _0x4888=['ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','NOW()','from','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','find','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','cm_hopper_final','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','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','status','json','offset','limit','undefined','count','set','apply','reject','save','then','sendStatus','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','CmHopperFinal','includeAll','include','rows','catch','params','options','describe','update','body','uniqueid','countContactsQueueCampaignHopperFinal','findAll','COUNT','sequelize','literal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','dropContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','createdAt','updatedAt','select','field','ANY_VALUE(ContactId)','ContactId'];(function(_0x40b493,_0x4050de){var _0x548365=function(_0x8ceba7){while(--_0x8ceba7){_0x40b493['push'](_0x40b493['shift']());}};_0x548365(++_0x4050de);}(_0x4888,0x198));var _0x8488=function(_0x595e7b,_0x32000d){_0x595e7b=_0x595e7b-0x0;var _0x330302=_0x4888[_0x595e7b];return _0x330302;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8488('0x0'));var zipdir=require(_0x8488('0x1'));var jsonpatch=require(_0x8488('0x2'));var rp=require(_0x8488('0x3'));var moment=require(_0x8488('0x4'));var BPromise=require(_0x8488('0x5'));var Mustache=require(_0x8488('0x6'));var util=require('util');var path=require(_0x8488('0x7'));var sox=require(_0x8488('0x8'));var csv=require(_0x8488('0x9'));var ejs=require(_0x8488('0xa'));var fs=require('fs');var fs_extra=require(_0x8488('0xb'));var _=require(_0x8488('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8488('0x9'));var querystring=require(_0x8488('0xd'));var Papa=require('papaparse');var Redis=require(_0x8488('0xe'));var authService=require(_0x8488('0xf'));var qs=require(_0x8488('0x10'));var as=require(_0x8488('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8488('0x12'))(_0x8488('0x13'));var utils=require(_0x8488('0x14'));var config=require(_0x8488('0x15'));var licenseUtil=require(_0x8488('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14462e,_0x3d1f7a){_0x3d1f7a=_0x3d1f7a||0xcc;return function(_0x58f83d){if(_0x58f83d){return _0x14462e['sendStatus'](_0x3d1f7a);}return _0x14462e[_0x8488('0x17')](_0x3d1f7a)['end']();};}function respondWithResult(_0x214083,_0x4e94fc){_0x4e94fc=_0x4e94fc||0xc8;return function(_0x5161a3){if(_0x5161a3){return _0x214083[_0x8488('0x17')](_0x4e94fc)[_0x8488('0x18')](_0x5161a3);}};}function respondWithFilteredResult(_0x5700b,_0x2bcb7c){return function(_0x3b3cfa){if(_0x3b3cfa){var _0x8d3b3d=typeof _0x2bcb7c[_0x8488('0x19')]==='undefined'&&typeof _0x2bcb7c[_0x8488('0x1a')]===_0x8488('0x1b');var _0x3edfe4=_0x3b3cfa[_0x8488('0x1c')];var _0x60ae2f=_0x8d3b3d?0x0:_0x2bcb7c[_0x8488('0x19')];var _0x1aedb1=_0x8d3b3d?_0x3b3cfa[_0x8488('0x1c')]:_0x2bcb7c[_0x8488('0x19')]+_0x2bcb7c[_0x8488('0x1a')];var _0x10bfd6;if(_0x1aedb1>=_0x3edfe4){_0x1aedb1=_0x3edfe4;_0x10bfd6=0xc8;}else{_0x10bfd6=0xce;}_0x5700b[_0x8488('0x17')](_0x10bfd6);return _0x5700b[_0x8488('0x1d')]('Content-Range',_0x60ae2f+'-'+_0x1aedb1+'/'+_0x3edfe4)['json'](_0x3b3cfa);}return null;};}function patchUpdates(_0x340d6b){return function(_0x12d40f){try{jsonpatch[_0x8488('0x1e')](_0x12d40f,_0x340d6b,!![]);}catch(_0x3c9fc2){return BPromise[_0x8488('0x1f')](_0x3c9fc2);}return _0x12d40f[_0x8488('0x20')]();};}function saveUpdates(_0x43b672,_0x3c078c){return function(_0x39dd43){if(_0x39dd43){return _0x39dd43['update'](_0x43b672)[_0x8488('0x21')](function(_0x4e07e1){return _0x4e07e1;});}return null;};}function removeEntity(_0x140b0b,_0x1361a6){return function(_0x290b33){if(_0x290b33){return _0x290b33['destroy']()['then'](function(){_0x140b0b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x472624,_0x51fe30){return function(_0x58057a){if(!_0x58057a){_0x472624[_0x8488('0x22')](0x194);}return _0x58057a;};}function handleError(_0x2f350a,_0x2b3c97){_0x2b3c97=_0x2b3c97||0x1f4;return function(_0x6ebee0){logger[_0x8488('0x23')](_0x6ebee0['stack']);if(_0x6ebee0[_0x8488('0x24')]){delete _0x6ebee0[_0x8488('0x24')];}_0x2f350a[_0x8488('0x17')](_0x2b3c97)[_0x8488('0x25')](_0x6ebee0);};}exports[_0x8488('0x26')]=function(_0x27f5cf,_0x2c15ff){var _0x296b6c={},_0x368f9c={},_0x1d9317={'count':0x0,'rows':[]};var _0x888b24=_['map'](db['CmHopperFinal']['rawAttributes'],function(_0x292fe8){return{'name':_0x292fe8[_0x8488('0x27')],'type':_0x292fe8[_0x8488('0x28')][_0x8488('0x29')]};});_0x368f9c[_0x8488('0x2a')]=_[_0x8488('0x2b')](_0x888b24,'name');_0x368f9c[_0x8488('0x2c')]=_[_0x8488('0x2d')](_0x27f5cf[_0x8488('0x2c')]);_0x368f9c[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x368f9c['model'],_0x368f9c[_0x8488('0x2c')]);_0x296b6c[_0x8488('0x30')]=_['intersection'](_0x368f9c[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x31')]));_0x296b6c[_0x8488('0x30')]=_0x296b6c['attributes'][_0x8488('0x32')]?_0x296b6c[_0x8488('0x30')]:_0x368f9c[_0x8488('0x2a')];if(!_0x27f5cf['query'][_0x8488('0x33')]('nolimit')){_0x296b6c[_0x8488('0x1a')]=qs[_0x8488('0x1a')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x1a')]);_0x296b6c['offset']=qs[_0x8488('0x19')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x19')]);}_0x296b6c['order']=qs[_0x8488('0x34')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x34')]);_0x296b6c[_0x8488('0x35')]=qs[_0x8488('0x2e')](_[_0x8488('0x36')](_0x27f5cf[_0x8488('0x2c')],_0x368f9c[_0x8488('0x2e')]),_0x888b24);if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]){_0x296b6c[_0x8488('0x35')]=_['merge'](_0x296b6c['where'],{'$or':_[_0x8488('0x2b')](_0x888b24,function(_0x36c17a){if(_0x36c17a[_0x8488('0x28')]!==_0x8488('0x38')){var _0x2d9fa1={};_0x2d9fa1[_0x36c17a[_0x8488('0x24')]]={'$like':'%'+_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]+'%'};return _0x2d9fa1;}})});}_0x296b6c=_[_0x8488('0x39')]({},_0x296b6c,_0x27f5cf['options']);var _0xf5a0a0={'where':_0x296b6c[_0x8488('0x35')]};return db[_0x8488('0x3a')]['count'](_0xf5a0a0)[_0x8488('0x21')](function(_0xa50c4b){_0x1d9317[_0x8488('0x1c')]=_0xa50c4b;if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x3b')]){_0x296b6c[_0x8488('0x3c')]=[{'all':!![]}];}return db[_0x8488('0x3a')]['findAll'](_0x296b6c);})[_0x8488('0x21')](function(_0x1c33a1){_0x1d9317[_0x8488('0x3d')]=_0x1c33a1;return _0x1d9317;})['then'](respondWithFilteredResult(_0x2c15ff,_0x296b6c))[_0x8488('0x3e')](handleError(_0x2c15ff,null));};exports['show']=function(_0x40ee7e,_0x34b11b){var _0x5cbd11={'raw':!![],'where':{'id':_0x40ee7e[_0x8488('0x3f')]['id']}},_0x22a3f3={};_0x22a3f3[_0x8488('0x2a')]=_[_0x8488('0x2d')](db[_0x8488('0x3a')]['rawAttributes']);_0x22a3f3[_0x8488('0x2c')]=_['keys'](_0x40ee7e[_0x8488('0x2c')]);_0x22a3f3[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],_0x22a3f3[_0x8488('0x2c')]);_0x5cbd11[_0x8488('0x30')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x40ee7e[_0x8488('0x2c')][_0x8488('0x31')]));_0x5cbd11[_0x8488('0x30')]=_0x5cbd11[_0x8488('0x30')][_0x8488('0x32')]?_0x5cbd11[_0x8488('0x30')]:_0x22a3f3[_0x8488('0x2a')];if(_0x40ee7e[_0x8488('0x2c')]['includeAll']){_0x5cbd11[_0x8488('0x3c')]=[{'all':!![]}];}_0x5cbd11=_[_0x8488('0x39')]({},_0x5cbd11,_0x40ee7e[_0x8488('0x40')]);return db[_0x8488('0x3a')]['find'](_0x5cbd11)[_0x8488('0x21')](handleEntityNotFound(_0x34b11b,null))[_0x8488('0x21')](respondWithResult(_0x34b11b,null))[_0x8488('0x3e')](handleError(_0x34b11b,null));};exports[_0x8488('0x41')]=function(_0x52042c,_0x1f0516){return db[_0x8488('0x3a')][_0x8488('0x41')]()[_0x8488('0x21')](respondWithResult(_0x1f0516,null))[_0x8488('0x3e')](handleError(_0x1f0516,null));};exports[_0x8488('0x42')]=function(_0x886a9e,_0x299d8e){if(_0x886a9e[_0x8488('0x43')][_0x8488('0x44')]){delete _0x886a9e[_0x8488('0x43')][_0x8488('0x44')];}return db[_0x8488('0x3a')]['find']({'where':{'uniqueid':_0x886a9e['params']['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x299d8e,null))[_0x8488('0x21')](saveUpdates(_0x886a9e[_0x8488('0x43')],null))[_0x8488('0x21')](respondWithResult(_0x299d8e,null))[_0x8488('0x3e')](handleError(_0x299d8e,null));};exports[_0x8488('0x45')]=function(_0x25f2dc,_0x27dfd2,_0x24fa20){return db['CmHopperFinal'][_0x8488('0x46')]({'raw':![],'where':{'VoiceQueueId':_0x25f2dc[_0x8488('0x3f')]['id']},'attributes':[[db['sequelize']['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')]('`state`\x20=\x200,\x201,\x20null'))),_0x8488('0x4a')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')](_0x8488('0x4b')))),_0x8488('0x4c')],[db['sequelize']['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db['sequelize'][_0x8488('0x49')]('`state`\x20=\x205,\x201,\x20null'))),_0x8488('0x4d')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')]('`state`\x20=\x208,\x201,\x20null'))),_0x8488('0x4e')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')]['literal'](_0x8488('0x4f')))),'dropContacts'],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')](_0x8488('0x50')))),_0x8488('0x51')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')]['literal'](_0x8488('0x52')))),_0x8488('0x53')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')]['literal'](_0x8488('0x54')))),'answeringMachine']]})[_0x8488('0x21')](handleEntityNotFound(_0x27dfd2,null))[_0x8488('0x21')](respondWithResult(_0x27dfd2,null))[_0x8488('0x3e')](handleError(_0x27dfd2,null));};exports[_0x8488('0x55')]=function(_0x1971f3,_0x24ba2d,_0x4facfb){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x1971f3[_0x8488('0x3f')]['id']},'attributes':[[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')](_0x8488('0x56')))),_0x8488('0x4a')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')](_0x8488('0x4b')))),'noAnswerContacts'],[db['sequelize']['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')]('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db['sequelize'][_0x8488('0x49')](_0x8488('0x57')))),_0x8488('0x4e')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x8488('0x58')],[db[_0x8488('0x48')]['fn']('COUNT',db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')](_0x8488('0x50')))),_0x8488('0x51')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')]('`state`\x20=\x2022,\x201,\x20null'))),'reCallContacts'],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db['sequelize'][_0x8488('0x49')](_0x8488('0x54')))),'answeringMachine']]})[_0x8488('0x21')](handleEntityNotFound(_0x24ba2d,null))['then'](respondWithResult(_0x24ba2d,null))[_0x8488('0x3e')](handleError(_0x24ba2d,null));};exports[_0x8488('0x59')]=function(_0x44a50b,_0x5815cb,_0xbee86e){return db[_0x8488('0x5a')]['find']({'where':{'id':_0x44a50b['params']['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x5815cb,null))[_0x8488('0x21')](function(_0xfedfd2){var _0x3ab1b6;if(_0xfedfd2){_0x3ab1b6=squel[_0x8488('0x5b')]()[_0x8488('0x5c')](_0x8488('0x5d'))[_0x8488('0x5e')]([_0x8488('0x5f'),_0x8488('0x60'),'ContactId',_0x8488('0x61'),'VoiceQueueId',_0x8488('0x62'),_0x8488('0x63')],squel[_0x8488('0x64')]()[_0x8488('0x65')]('ANY_VALUE(calleridnum)',_0x8488('0x5f'))[_0x8488('0x65')]('NOW()',_0x8488('0x60'))['field'](_0x8488('0x66'),_0x8488('0x67'))[_0x8488('0x65')](_0x8488('0x68'),_0x8488('0x61'))[_0x8488('0x65')](_0x8488('0x69'),_0x8488('0x6a'))['field'](_0x8488('0x6b'),'createdAt')['field'](_0x8488('0x6b'),_0x8488('0x63'))[_0x8488('0x6c')]('cm_hopper_final')['where'](_0x8488('0x6d'),_0x44a50b[_0x8488('0x3f')]['id']['toString']())[_0x8488('0x35')](_0x8488('0x6e'),_0x44a50b[_0x8488('0x43')][_0x8488('0x6f')][_0x8488('0x70')]())[_0x8488('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x8488('0x35')](_0x8488('0x71'),squel[_0x8488('0x64')]()['field'](_0x8488('0x5f'))[_0x8488('0x6c')](_0x8488('0x5d'))['where'](_0x8488('0x6d'),_0x44a50b[_0x8488('0x3f')]['id']['toString']()))['where'](_0x8488('0x71'),squel[_0x8488('0x64')]()['field'](_0x8488('0x72'))[_0x8488('0x6c')]('cm_hopper_final')['where'](_0x8488('0x6d'),_0x44a50b['params']['id'][_0x8488('0x70')]())[_0x8488('0x35')](_0x8488('0x73')))[_0x8488('0x74')]('ContactId'))[_0x8488('0x70')]();return db['sequelize'][_0x8488('0x2c')](_0x3ab1b6);}return[];})['then'](respondWithResult(_0x5815cb,null))[_0x8488('0x3e')](handleError(_0x5815cb,null));};exports[_0x8488('0x75')]=function(_0x267401,_0x1e635a,_0x31ab35){return db[_0x8488('0x76')][_0x8488('0x77')]({'where':{'id':_0x267401[_0x8488('0x3f')]['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x1e635a,null))[_0x8488('0x21')](function(_0xce1d1a){var _0xc9c221;if(_0xce1d1a){_0xc9c221=squel[_0x8488('0x5b')]()[_0x8488('0x5c')]('cm_hopper')[_0x8488('0x5e')]([_0x8488('0x5f'),'scheduledAt',_0x8488('0x67'),_0x8488('0x61'),_0x8488('0x78'),_0x8488('0x62'),_0x8488('0x63')],squel[_0x8488('0x64')]()[_0x8488('0x65')](_0x8488('0x79'),_0x8488('0x5f'))[_0x8488('0x65')](_0x8488('0x6b'),'scheduledAt')[_0x8488('0x65')](_0x8488('0x66'),'ContactId')[_0x8488('0x65')](_0x8488('0x68'),_0x8488('0x61'))[_0x8488('0x65')](_0x8488('0x7a'),'CampaignId')['field'](_0x8488('0x6b'),_0x8488('0x62'))[_0x8488('0x65')](_0x8488('0x6b'),_0x8488('0x63'))[_0x8488('0x6c')](_0x8488('0x7b'))[_0x8488('0x35')](_0x8488('0x7c'),_0x267401[_0x8488('0x3f')]['id'][_0x8488('0x70')]())[_0x8488('0x35')](_0x8488('0x6e'),_0x267401[_0x8488('0x43')][_0x8488('0x6f')]['toString']())[_0x8488('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0x8488('0x71'),squel[_0x8488('0x64')]()[_0x8488('0x65')](_0x8488('0x5f'))[_0x8488('0x6c')](_0x8488('0x5d'))[_0x8488('0x35')](_0x8488('0x7c'),_0x267401[_0x8488('0x3f')]['id'][_0x8488('0x70')]()))['where'](_0x8488('0x71'),squel[_0x8488('0x64')]()[_0x8488('0x65')](_0x8488('0x72'))[_0x8488('0x6c')](_0x8488('0x7b'))['where'](_0x8488('0x7c'),_0x267401['params']['id'][_0x8488('0x70')]())[_0x8488('0x35')]('state\x20=\x204'))['group'](_0x8488('0x67')))[_0x8488('0x70')]();return db[_0x8488('0x48')][_0x8488('0x2c')](_0xc9c221);}return[];})[_0x8488('0x21')](respondWithResult(_0x1e635a,null))['catch'](handleError(_0x1e635a,null));};exports[_0x8488('0x7d')]=function(_0x19c5c6,_0x50f773,_0x52c750){return db[_0x8488('0x7e')][_0x8488('0x7f')]({'where':{'VoiceQueueId':_0x19c5c6[_0x8488('0x43')]['VoiceQueueId'],'CampaignId':_0x19c5c6['body'][_0x8488('0x78')],'ContactId':_0x19c5c6[_0x8488('0x43')][_0x8488('0x67')]}})['then'](handleEntityNotFound(_0x50f773,null))[_0x8488('0x21')](function(_0x1e4e51){if(_0x1e4e51){return _0x1e4e51;}return null;})[_0x8488('0x21')](respondWithResult(_0x50f773,null))[_0x8488('0x3e')](handleError(_0x50f773,null));}; \ No newline at end of file +var _0x814b=['into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','from','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','VoiceQueueId\x20=\x20?','state\x20=\x204','group','Campaign','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId','cm_hopper_final','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','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/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','CmHopperFinal','includeAll','include','findAll','catch','params','find','describe','body','uniqueid','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','COUNT','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noAnswerContacts','busyContacts','congestionContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x814b,0x1a2));var _0xb814=function(_0x43444b,_0x8cf95b){_0x43444b=_0x43444b-0x0;var _0x392fe5=_0x814b[_0x43444b];return _0x392fe5;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];function respondWithStatusCode(_0x35b10d,_0x2cc46b){_0x2cc46b=_0x2cc46b||0xcc;return function(_0x2ce718){if(_0x2ce718){return _0x35b10d[_0xb814('0x1b')](_0x2cc46b);}return _0x35b10d[_0xb814('0x1c')](_0x2cc46b)[_0xb814('0x1d')]();};}function respondWithResult(_0xa0a2e5,_0x2ab627){_0x2ab627=_0x2ab627||0xc8;return function(_0x3f4881){if(_0x3f4881){return _0xa0a2e5[_0xb814('0x1c')](_0x2ab627)[_0xb814('0x1e')](_0x3f4881);}};}function respondWithFilteredResult(_0x39bfcf,_0x303aca){return function(_0x3a71d6){if(_0x3a71d6){var _0x45e0d0=typeof _0x303aca[_0xb814('0x1f')]===_0xb814('0x20')&&typeof _0x303aca[_0xb814('0x21')]===_0xb814('0x20');var _0x48c9df=_0x3a71d6[_0xb814('0x22')];var _0x55ba16=_0x45e0d0?0x0:_0x303aca[_0xb814('0x1f')];var _0xfac75b=_0x45e0d0?_0x3a71d6['count']:_0x303aca['offset']+_0x303aca['limit'];var _0x399b43;if(_0xfac75b>=_0x48c9df){_0xfac75b=_0x48c9df;_0x399b43=0xc8;}else{_0x399b43=0xce;}_0x39bfcf['status'](_0x399b43);return _0x39bfcf['set'](_0xb814('0x23'),_0x55ba16+'-'+_0xfac75b+'/'+_0x48c9df)[_0xb814('0x1e')](_0x3a71d6);}return null;};}function patchUpdates(_0x25b6b6){return function(_0x4e139e){try{jsonpatch[_0xb814('0x24')](_0x4e139e,_0x25b6b6,!![]);}catch(_0x531032){return BPromise[_0xb814('0x25')](_0x531032);}return _0x4e139e[_0xb814('0x26')]();};}function saveUpdates(_0x3b267e,_0x470e81){return function(_0x27352e){if(_0x27352e){return _0x27352e[_0xb814('0x27')](_0x3b267e)[_0xb814('0x28')](function(_0x594470){return _0x594470;});}return null;};}function removeEntity(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(_0x3f81d0){return _0x3f81d0[_0xb814('0x29')]()[_0xb814('0x28')](function(){_0x2ead86[_0xb814('0x1c')](0xcc)[_0xb814('0x1d')]();});}};}function handleEntityNotFound(_0xb9e57d,_0x3d836c){return function(_0x5755ea){if(!_0x5755ea){_0xb9e57d[_0xb814('0x1b')](0x194);}return _0x5755ea;};}function handleError(_0xc0ef66,_0x1c2625){_0x1c2625=_0x1c2625||0x1f4;return function(_0x349394){logger[_0xb814('0x2a')](_0x349394[_0xb814('0x2b')]);if(_0x349394[_0xb814('0x2c')]){delete _0x349394[_0xb814('0x2c')];}_0xc0ef66['status'](_0x1c2625)[_0xb814('0x2d')](_0x349394);};}exports[_0xb814('0x2e')]=function(_0x52ed64,_0x9008b2){var _0x37d24d={},_0x530744={},_0x499f22={'count':0x0,'rows':[]};var _0x20577b=_[_0xb814('0x2f')](db['CmHopperFinal'][_0xb814('0x30')],function(_0x526610){return{'name':_0x526610[_0xb814('0x31')],'type':_0x526610['type']['key']};});_0x530744[_0xb814('0x32')]=_['map'](_0x20577b,_0xb814('0x2c'));_0x530744[_0xb814('0x33')]=_[_0xb814('0x34')](_0x52ed64['query']);_0x530744['filters']=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],_0x530744['query']);_0x37d24d[_0xb814('0x36')]=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],qs[_0xb814('0x37')](_0x52ed64[_0xb814('0x33')][_0xb814('0x37')]));_0x37d24d[_0xb814('0x36')]=_0x37d24d['attributes'][_0xb814('0x38')]?_0x37d24d[_0xb814('0x36')]:_0x530744[_0xb814('0x32')];if(!_0x52ed64[_0xb814('0x33')][_0xb814('0x39')]('nolimit')){_0x37d24d[_0xb814('0x21')]=qs['limit'](_0x52ed64[_0xb814('0x33')][_0xb814('0x21')]);_0x37d24d[_0xb814('0x1f')]=qs['offset'](_0x52ed64[_0xb814('0x33')][_0xb814('0x1f')]);}_0x37d24d['order']=qs[_0xb814('0x3a')](_0x52ed64[_0xb814('0x33')][_0xb814('0x3a')]);_0x37d24d[_0xb814('0x3b')]=qs[_0xb814('0x3c')](_[_0xb814('0x3d')](_0x52ed64['query'],_0x530744[_0xb814('0x3c')]),_0x20577b);if(_0x52ed64['query'][_0xb814('0x3e')]){_0x37d24d['where']=_[_0xb814('0x3f')](_0x37d24d['where'],{'$or':_[_0xb814('0x2f')](_0x20577b,function(_0x26675a){if(_0x26675a['type']!=='VIRTUAL'){var _0x5dd6bc={};_0x5dd6bc[_0x26675a['name']]={'$like':'%'+_0x52ed64[_0xb814('0x33')][_0xb814('0x3e')]+'%'};return _0x5dd6bc;}})});}_0x37d24d=_[_0xb814('0x3f')]({},_0x37d24d,_0x52ed64[_0xb814('0x40')]);var _0x51cdba={'where':_0x37d24d['where']};return db[_0xb814('0x41')]['count'](_0x51cdba)[_0xb814('0x28')](function(_0x1098eb){_0x499f22[_0xb814('0x22')]=_0x1098eb;if(_0x52ed64[_0xb814('0x33')][_0xb814('0x42')]){_0x37d24d[_0xb814('0x43')]=[{'all':!![]}];}return db[_0xb814('0x41')][_0xb814('0x44')](_0x37d24d);})[_0xb814('0x28')](function(_0x4b6ff8){_0x499f22['rows']=_0x4b6ff8;return _0x499f22;})['then'](respondWithFilteredResult(_0x9008b2,_0x37d24d))[_0xb814('0x45')](handleError(_0x9008b2,null));};exports['show']=function(_0x29416a,_0x580171){var _0x411723={'raw':!![],'where':{'id':_0x29416a[_0xb814('0x46')]['id']}},_0x44ff56={};_0x44ff56[_0xb814('0x32')]=_['keys'](db[_0xb814('0x41')][_0xb814('0x30')]);_0x44ff56[_0xb814('0x33')]=_[_0xb814('0x34')](_0x29416a[_0xb814('0x33')]);_0x44ff56[_0xb814('0x3c')]=_['intersection'](_0x44ff56[_0xb814('0x32')],_0x44ff56[_0xb814('0x33')]);_0x411723[_0xb814('0x36')]=_[_0xb814('0x35')](_0x44ff56[_0xb814('0x32')],qs[_0xb814('0x37')](_0x29416a[_0xb814('0x33')]['fields']));_0x411723['attributes']=_0x411723[_0xb814('0x36')][_0xb814('0x38')]?_0x411723[_0xb814('0x36')]:_0x44ff56[_0xb814('0x32')];if(_0x29416a[_0xb814('0x33')][_0xb814('0x42')]){_0x411723[_0xb814('0x43')]=[{'all':!![]}];}_0x411723=_[_0xb814('0x3f')]({},_0x411723,_0x29416a[_0xb814('0x40')]);return db[_0xb814('0x41')][_0xb814('0x47')](_0x411723)['then'](handleEntityNotFound(_0x580171,null))[_0xb814('0x28')](respondWithResult(_0x580171,null))[_0xb814('0x45')](handleError(_0x580171,null));};exports['describe']=function(_0x338e80,_0x55234d){return db[_0xb814('0x41')][_0xb814('0x48')]()[_0xb814('0x28')](respondWithResult(_0x55234d,null))[_0xb814('0x45')](handleError(_0x55234d,null));};exports[_0xb814('0x27')]=function(_0x4096d4,_0x2cc806){if(_0x4096d4[_0xb814('0x49')][_0xb814('0x4a')]){delete _0x4096d4[_0xb814('0x49')]['uniqueid'];}return db['CmHopperFinal'][_0xb814('0x47')]({'where':{'uniqueid':_0x4096d4[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x2cc806,null))[_0xb814('0x28')](saveUpdates(_0x4096d4[_0xb814('0x49')],null))[_0xb814('0x28')](respondWithResult(_0x2cc806,null))[_0xb814('0x45')](handleError(_0x2cc806,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x26fd0b,_0x388324,_0xf27a6e){return db['CmHopperFinal'][_0xb814('0x44')]({'raw':![],'where':{'VoiceQueueId':_0x26fd0b['params']['id']},'attributes':[[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x4c')))),_0xb814('0x4d')],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')](_0xb814('0x4f')))),'noAnswerContacts'],[db[_0xb814('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x50')))),'busyContacts'],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x51')))),'congestionContacts'],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x53')))),_0xb814('0x54')],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x55')))),_0xb814('0x56')],[db['sequelize']['fn'](_0xb814('0x52'),db['sequelize']['fn']('IF',db['sequelize'][_0xb814('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0xb814('0x57')],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db['sequelize']['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x58')))),_0xb814('0x59')]]})[_0xb814('0x28')](handleEntityNotFound(_0x388324,null))[_0xb814('0x28')](respondWithResult(_0x388324,null))[_0xb814('0x45')](handleError(_0x388324,null));};exports[_0xb814('0x5a')]=function(_0x2e5f99,_0x113350,_0x46014f){return db['CmHopperFinal'][_0xb814('0x44')]({'raw':![],'where':{'CampaignId':_0x2e5f99[_0xb814('0x46')]['id']},'attributes':[[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x4c')))),'noSuchContacts'],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')]('`state`\x20=\x203,\x201,\x20null'))),_0xb814('0x5b')],[db['sequelize']['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x50')))),_0xb814('0x5c')],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')](_0xb814('0x51')))),_0xb814('0x5d')],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')](_0xb814('0x53')))),'dropContacts'],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xb814('0x56')],[db['sequelize']['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x5e')))),_0xb814('0x57')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x58')))),_0xb814('0x59')]]})[_0xb814('0x28')](handleEntityNotFound(_0x113350,null))['then'](respondWithResult(_0x113350,null))[_0xb814('0x45')](handleError(_0x113350,null));};exports[_0xb814('0x5f')]=function(_0xee204,_0x5aabbe,_0x30f717){return db[_0xb814('0x60')][_0xb814('0x47')]({'where':{'id':_0xee204[_0xb814('0x46')]['id']}})['then'](handleEntityNotFound(_0x5aabbe,null))['then'](function(_0x28eaf8){var _0x295488;if(_0x28eaf8){_0x295488=squel[_0xb814('0x61')]()[_0xb814('0x62')](_0xb814('0x63'))[_0xb814('0x64')]([_0xb814('0x65'),_0xb814('0x66'),_0xb814('0x67'),_0xb814('0x68'),_0xb814('0x69'),_0xb814('0x6a'),_0xb814('0x6b')],squel[_0xb814('0x6c')]()[_0xb814('0x6d')]('ANY_VALUE(calleridnum)',_0xb814('0x65'))[_0xb814('0x6d')](_0xb814('0x6e'),_0xb814('0x66'))[_0xb814('0x6d')](_0xb814('0x6f'),'ContactId')[_0xb814('0x6d')]('ANY_VALUE(ListId)',_0xb814('0x68'))[_0xb814('0x6d')](_0xb814('0x70'),_0xb814('0x69'))[_0xb814('0x6d')]('NOW()','createdAt')[_0xb814('0x6d')](_0xb814('0x6e'),_0xb814('0x6b'))[_0xb814('0x71')]('cm_hopper_final')[_0xb814('0x3b')]('VoiceQueueId\x20=\x20?',_0xee204[_0xb814('0x46')]['id'][_0xb814('0x72')]())['where']('state\x20=\x20?',_0xee204[_0xb814('0x49')]['state'][_0xb814('0x72')]())[_0xb814('0x3b')](_0xb814('0x73'))[_0xb814('0x3b')](_0xb814('0x74'),squel[_0xb814('0x6c')]()[_0xb814('0x6d')]('phone')[_0xb814('0x71')]('cm_hopper')[_0xb814('0x3b')]('VoiceQueueId\x20=\x20?',_0xee204[_0xb814('0x46')]['id'][_0xb814('0x72')]()))['where'](_0xb814('0x74'),squel['select']()[_0xb814('0x6d')](_0xb814('0x75'))['from']('cm_hopper_final')[_0xb814('0x3b')](_0xb814('0x76'),_0xee204[_0xb814('0x46')]['id'][_0xb814('0x72')]())[_0xb814('0x3b')](_0xb814('0x77')))[_0xb814('0x78')](_0xb814('0x67')))[_0xb814('0x72')]();return db[_0xb814('0x4b')]['query'](_0x295488);}return[];})['then'](respondWithResult(_0x5aabbe,null))['catch'](handleError(_0x5aabbe,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x52b6da,_0x45a202,_0x75a33){return db[_0xb814('0x79')]['find']({'where':{'id':_0x52b6da[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x45a202,null))[_0xb814('0x28')](function(_0x26ce5b){var _0x161658;if(_0x26ce5b){_0x161658=squel[_0xb814('0x61')]()[_0xb814('0x62')](_0xb814('0x63'))['fromQuery']([_0xb814('0x65'),_0xb814('0x66'),_0xb814('0x67'),_0xb814('0x68'),'CampaignId',_0xb814('0x6a'),_0xb814('0x6b')],squel[_0xb814('0x6c')]()[_0xb814('0x6d')](_0xb814('0x7a'),'phone')['field'](_0xb814('0x6e'),'scheduledAt')[_0xb814('0x6d')](_0xb814('0x6f'),'ContactId')[_0xb814('0x6d')]('ANY_VALUE(ListId)',_0xb814('0x68'))['field'](_0xb814('0x7b'),_0xb814('0x7c'))[_0xb814('0x6d')](_0xb814('0x6e'),_0xb814('0x6a'))[_0xb814('0x6d')](_0xb814('0x6e'),'updatedAt')['from'](_0xb814('0x7d'))['where']('CampaignId\x20=\x20?',_0x52b6da[_0xb814('0x46')]['id'][_0xb814('0x72')]())[_0xb814('0x3b')]('state\x20=\x20?',_0x52b6da[_0xb814('0x49')]['state'][_0xb814('0x72')]())[_0xb814('0x3b')](_0xb814('0x73'))[_0xb814('0x3b')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb814('0x6c')]()[_0xb814('0x6d')](_0xb814('0x65'))['from'](_0xb814('0x63'))[_0xb814('0x3b')](_0xb814('0x7e'),_0x52b6da['params']['id'][_0xb814('0x72')]()))[_0xb814('0x3b')](_0xb814('0x74'),squel[_0xb814('0x6c')]()[_0xb814('0x6d')](_0xb814('0x75'))[_0xb814('0x71')](_0xb814('0x7d'))[_0xb814('0x3b')](_0xb814('0x7e'),_0x52b6da[_0xb814('0x46')]['id'][_0xb814('0x72')]())[_0xb814('0x3b')]('state\x20=\x204'))['group'](_0xb814('0x67')))['toString']();return db[_0xb814('0x4b')][_0xb814('0x33')](_0x161658);}return[];})[_0xb814('0x28')](respondWithResult(_0x45a202,null))[_0xb814('0x45')](handleError(_0x45a202,null));};exports[_0xb814('0x7f')]=function(_0x2f1674,_0xf0610f,_0x5db5d0){return db['CmHopper'][_0xb814('0x80')]({'where':{'VoiceQueueId':_0x2f1674['body'][_0xb814('0x69')],'CampaignId':_0x2f1674[_0xb814('0x49')][_0xb814('0x7c')],'ContactId':_0x2f1674['body'][_0xb814('0x67')]}})[_0xb814('0x28')](handleEntityNotFound(_0xf0610f,null))[_0xb814('0x28')](function(_0x38c6da){if(_0x38c6da){return _0x38c6da;}return null;})[_0xb814('0x28')](respondWithResult(_0xf0610f,null))['catch'](handleError(_0xf0610f,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 1c601f4..7332d46 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 _0x5115=['bluebird','request-promise','../../config/environment','./cmHopperFinal.attributes','exports','define','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x36c6eb,_0x4fb127){var _0x30675b=function(_0x3a788b){while(--_0x3a788b){_0x36c6eb['push'](_0x36c6eb['shift']());}};_0x30675b(++_0x4fb127);}(_0x5115,0x79));var _0x5511=function(_0x319574,_0x208f29){_0x319574=_0x319574-0x0;var _0x5ace53=_0x5115[_0x319574];return _0x5ace53;};'use strict';var _=require(_0x5511('0x0'));var util=require(_0x5511('0x1'));var logger=require(_0x5511('0x2'))(_0x5511('0x3'));var moment=require(_0x5511('0x4'));var BPromise=require(_0x5511('0x5'));var rp=require(_0x5511('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5511('0x7'));var attributes=require(_0x5511('0x8'));module[_0x5511('0x9')]=function(_0x243dea,_0x1c5660){return _0x243dea[_0x5511('0xa')]('CmHopperFinal',attributes,{'tableName':_0x5511('0xb'),'paranoid':![],'indexes':[{'name':_0x5511('0xc'),'fields':[_0x5511('0xc')]},{'name':_0x5511('0xd'),'fields':[_0x5511('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd4e1=['path','rimraf','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4efd88,_0x57b9a3){var _0x37ca3d=function(_0x3291f5){while(--_0x3291f5){_0x4efd88['push'](_0x4efd88['shift']());}};_0x37ca3d(++_0x57b9a3);}(_0xd4e1,0x116));var _0x1d4e=function(_0x49e7f4,_0x1d1b24){_0x49e7f4=_0x49e7f4-0x0;var _0x27d188=_0xd4e1[_0x49e7f4];return _0x27d188;};'use strict';var _=require(_0x1d4e('0x0'));var util=require(_0x1d4e('0x1'));var logger=require(_0x1d4e('0x2'))(_0x1d4e('0x3'));var moment=require(_0x1d4e('0x4'));var BPromise=require(_0x1d4e('0x5'));var rp=require(_0x1d4e('0x6'));var fs=require('fs');var path=require(_0x1d4e('0x7'));var rimraf=require(_0x1d4e('0x8'));var config=require('../../config/environment');var attributes=require(_0x1d4e('0x9'));module[_0x1d4e('0xa')]=function(_0xa4607b,_0x355a0c){return _0xa4607b['define'](_0x1d4e('0xb'),attributes,{'tableName':_0x1d4e('0xc'),'paranoid':![],'indexes':[{'name':_0x1d4e('0xd'),'fields':[_0x1d4e('0xd')]},{'name':_0x1d4e('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 3da9f46..0aa324e 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(_0x57e783,_0x1ffa00){var _0x3a5a8e=function(_0x46f606){while(--_0x46f606){_0x57e783['push'](_0x57e783['shift']());}};_0x3a5a8e(++_0x1ffa00);}(_0x7a54,0x106));var _0x47a5=function(_0x5d59c8,_0x1f766b){_0x5d59c8=_0x5d59c8-0x0;var _0x487093=_0x7a54[_0x5d59c8];return _0x487093;};'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 _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x5885d9,_0x402333){var _0x5c655e=function(_0x53596c){while(--_0x53596c){_0x5885d9['push'](_0x5885d9['shift']());}};_0x5c655e(++_0x402333);}(_0xb10b,0x12a));var _0xbb10=function(_0x1e3e59,_0x596d22){_0x1e3e59=_0x1e3e59-0x0;var _0x4cdd16=_0xb10b[_0x1e3e59];return _0x4cdd16;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index f295cca..e479249 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 _0x31c4=['post','/checkContactHopper','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','get','index','/describe','isAuthenticated','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal'];(function(_0x4f8977,_0x337cd2){var _0xa5c7e1=function(_0x5f5c31){while(--_0x5f5c31){_0x4f8977['push'](_0x4f8977['shift']());}};_0xa5c7e1(++_0x337cd2);}(_0x31c4,0x113));var _0x431c=function(_0x108494,_0x3badb1){_0x108494=_0x108494-0x0;var _0x41500e=_0x31c4[_0x108494];return _0x41500e;};'use strict';var multer=require(_0x431c('0x0'));var util=require('util');var path=require(_0x431c('0x1'));var timeout=require(_0x431c('0x2'));var express=require(_0x431c('0x3'));var router=express[_0x431c('0x4')]();var fs_extra=require(_0x431c('0x5'));var auth=require(_0x431c('0x6'));var interaction=require(_0x431c('0x7'));var config=require('../../config/environment');var controller=require(_0x431c('0x8'));router[_0x431c('0x9')]('/',auth['isAuthenticated'](),controller[_0x431c('0xa')]);router[_0x431c('0x9')](_0x431c('0xb'),auth[_0x431c('0xc')](),controller['describe']);router['get'](_0x431c('0xd'),auth['isAuthenticated'](),controller[_0x431c('0xe')]);router[_0x431c('0x9')](_0x431c('0xf'),auth[_0x431c('0xc')](),controller[_0x431c('0x10')]);router[_0x431c('0x9')]('/campaign/countAttributes/:id',auth['isAuthenticated'](),controller[_0x431c('0x11')]);router['post'](_0x431c('0x12'),auth['isAuthenticated'](),controller[_0x431c('0x13')]);router['post'](_0x431c('0x14'),auth[_0x431c('0xc')](),controller[_0x431c('0x15')]);router[_0x431c('0x16')](_0x431c('0x17'),auth[_0x431c('0xc')](),controller['checkContactHopper']);router[_0x431c('0x18')](_0x431c('0xd'),auth[_0x431c('0xc')](),controller[_0x431c('0x19')]);module[_0x431c('0x1a')]=router; \ No newline at end of file +var _0x3e9c=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','update','multer'];(function(_0x3249d6,_0x18ad8b){var _0x411b10=function(_0xdca4dc){while(--_0xdca4dc){_0x3249d6['push'](_0x3249d6['shift']());}};_0x411b10(++_0x18ad8b);}(_0x3e9c,0x6f));var _0xc3e9=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x3e9c[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0xc3e9('0x0'));var util=require(_0xc3e9('0x1'));var path=require(_0xc3e9('0x2'));var timeout=require(_0xc3e9('0x3'));var express=require(_0xc3e9('0x4'));var router=express[_0xc3e9('0x5')]();var fs_extra=require(_0xc3e9('0x6'));var auth=require(_0xc3e9('0x7'));var interaction=require(_0xc3e9('0x8'));var config=require(_0xc3e9('0x9'));var controller=require(_0xc3e9('0xa'));router[_0xc3e9('0xb')]('/',auth[_0xc3e9('0xc')](),controller[_0xc3e9('0xd')]);router[_0xc3e9('0xb')](_0xc3e9('0xe'),auth[_0xc3e9('0xc')](),controller[_0xc3e9('0xf')]);router['get'](_0xc3e9('0x10'),auth[_0xc3e9('0xc')](),controller[_0xc3e9('0x11')]);router[_0xc3e9('0xb')]('/voice/queue/countAttributes/:id',auth[_0xc3e9('0xc')](),controller['countContactsQueueCampaignHopperFinal']);router[_0xc3e9('0xb')](_0xc3e9('0x12'),auth[_0xc3e9('0xc')](),controller[_0xc3e9('0x13')]);router[_0xc3e9('0x14')](_0xc3e9('0x15'),auth[_0xc3e9('0xc')](),controller[_0xc3e9('0x16')]);router['post'](_0xc3e9('0x17'),auth['isAuthenticated'](),controller[_0xc3e9('0x18')]);router['post'](_0xc3e9('0x19'),auth[_0xc3e9('0xc')](),controller['checkContactHopper']);router[_0xc3e9('0x1a')](_0xc3e9('0x10'),auth[_0xc3e9('0xc')](),controller[_0xc3e9('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 5d793c3..36b7032 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 _0xb2b6=['STRING','DATE','BOOLEAN','sequelize','INTEGER'];(function(_0x5d19ce,_0x56310b){var _0x17c120=function(_0x6606d8){while(--_0x6606d8){_0x5d19ce['push'](_0x5d19ce['shift']());}};_0x17c120(++_0x56310b);}(_0xb2b6,0x1bb));var _0x6b2b=function(_0x40f3fb,_0x26b0cb){_0x40f3fb=_0x40f3fb-0x0;var _0x5ede31=_0xb2b6[_0x40f3fb];return _0x5ede31;};'use strict';var Sequelize=require(_0x6b2b('0x0'));module['exports']={'state':{'type':Sequelize[_0x6b2b('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x6b2b('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x6b2b('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6b2b('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6b2b('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x6b2b('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x6b2b('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x6b2b('0x2')]},'originatecalleridname':{'type':Sequelize[_0x6b2b('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x6b2b('0x2')]},'starttime':{'type':Sequelize[_0x6b2b('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x6b2b('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x6b2b('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x6b2b('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x6b2b('0x2')]},'campaign':{'type':Sequelize[_0x6b2b('0x2')]},'campaigntype':{'type':Sequelize[_0x6b2b('0x2')]},'membername':{'type':Sequelize[_0x6b2b('0x2')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x6b2b('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x6b2b('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6b2b('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6b2b('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6b2b('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6b2b('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa151=['exports','STRING','DATE','INTEGER','BOOLEAN','sequelize'];(function(_0x2e6810,_0x3a2399){var _0x26f9f0=function(_0x349b20){while(--_0x349b20){_0x2e6810['push'](_0x2e6810['shift']());}};_0x26f9f0(++_0x3a2399);}(_0xa151,0x13d));var _0x1a15=function(_0x19c72a,_0x55698a){_0x19c72a=_0x19c72a-0x0;var _0x2f1152=_0xa151[_0x19c72a];return _0x2f1152;};'use strict';var Sequelize=require(_0x1a15('0x0'));module[_0x1a15('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x1a15('0x2')]},'scheduledat':{'type':Sequelize[_0x1a15('0x3')]},'countbusyretry':{'type':Sequelize[_0x1a15('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1a15('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x1a15('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x1a15('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x1a15('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x1a15('0x2')]},'starttime':{'type':Sequelize[_0x1a15('0x3')]},'responsetime':{'type':Sequelize[_0x1a15('0x3')]},'answertime':{'type':Sequelize[_0x1a15('0x3')]},'droptime':{'type':Sequelize[_0x1a15('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x1a15('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x1a15('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x1a15('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x1a15('0x2')]},'campaign':{'type':Sequelize[_0x1a15('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x1a15('0x2')]},'reason':{'type':Sequelize[_0x1a15('0x2')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x1a15('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x1a15('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1a15('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1a15('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x1a15('0x3')]},'edited':{'type':Sequelize[_0x1a15('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x1a15('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1a15('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1a15('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1a15('0x4')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x1a15('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 9722bba..79ea99a 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 _0xae38=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','set','apply','reject','save','destroy','then','error','name','send','map','CmHopperHistory','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','filter','merge','options','count','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find','create','body','describe','update','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto'];(function(_0x243128,_0x46f40c){var _0x3e7038=function(_0x13a863){while(--_0x13a863){_0x243128['push'](_0x243128['shift']());}};_0x3e7038(++_0x46f40c);}(_0xae38,0xd6));var _0x8ae3=function(_0x22bda3,_0x42fa50){_0x22bda3=_0x22bda3-0x0;var _0x2cd001=_0xae38[_0x22bda3];return _0x2cd001;};'use strict';var emlformat=require(_0x8ae3('0x0'));var rimraf=require(_0x8ae3('0x1'));var zipdir=require(_0x8ae3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8ae3('0x3'));var moment=require(_0x8ae3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8ae3('0x5'));var util=require(_0x8ae3('0x6'));var path=require(_0x8ae3('0x7'));var sox=require(_0x8ae3('0x8'));var csv=require('to-csv');var ejs=require(_0x8ae3('0x9'));var fs=require('fs');var fs_extra=require(_0x8ae3('0xa'));var _=require(_0x8ae3('0xb'));var squel=require(_0x8ae3('0xc'));var crypto=require(_0x8ae3('0xd'));var jsforce=require(_0x8ae3('0xe'));var deskjs=require(_0x8ae3('0xf'));var toCsv=require(_0x8ae3('0x10'));var querystring=require(_0x8ae3('0x11'));var Papa=require(_0x8ae3('0x12'));var Redis=require(_0x8ae3('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x8ae3('0x14'));var as=require(_0x8ae3('0x15'));var hardwareService=require(_0x8ae3('0x16'));var logger=require(_0x8ae3('0x17'))(_0x8ae3('0x18'));var utils=require(_0x8ae3('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x8ae3('0x1a'));var db=require(_0x8ae3('0x1b'))['db'];function respondWithStatusCode(_0x3c8fe1,_0x55fc68){_0x55fc68=_0x55fc68||0xcc;return function(_0x9264b2){if(_0x9264b2){return _0x3c8fe1[_0x8ae3('0x1c')](_0x55fc68);}return _0x3c8fe1[_0x8ae3('0x1d')](_0x55fc68)[_0x8ae3('0x1e')]();};}function respondWithResult(_0x5620a8,_0x4cefab){_0x4cefab=_0x4cefab||0xc8;return function(_0x33c2f2){if(_0x33c2f2){return _0x5620a8['status'](_0x4cefab)[_0x8ae3('0x1f')](_0x33c2f2);}};}function respondWithFilteredResult(_0x56d29c,_0x27c33b){return function(_0x1db1da){if(_0x1db1da){var _0x5612c2=typeof _0x27c33b['offset']===_0x8ae3('0x20')&&typeof _0x27c33b[_0x8ae3('0x21')]===_0x8ae3('0x20');var _0x180462=_0x1db1da['count'];var _0x310603=_0x5612c2?0x0:_0x27c33b[_0x8ae3('0x22')];var _0xb4ec35=_0x5612c2?_0x1db1da['count']:_0x27c33b[_0x8ae3('0x22')]+_0x27c33b[_0x8ae3('0x21')];var _0x23b7f9;if(_0xb4ec35>=_0x180462){_0xb4ec35=_0x180462;_0x23b7f9=0xc8;}else{_0x23b7f9=0xce;}_0x56d29c[_0x8ae3('0x1d')](_0x23b7f9);return _0x56d29c[_0x8ae3('0x23')]('Content-Range',_0x310603+'-'+_0xb4ec35+'/'+_0x180462)['json'](_0x1db1da);}return null;};}function patchUpdates(_0xfb3e9f){return function(_0x2c8a7c){try{jsonpatch[_0x8ae3('0x24')](_0x2c8a7c,_0xfb3e9f,!![]);}catch(_0x302c0e){return BPromise[_0x8ae3('0x25')](_0x302c0e);}return _0x2c8a7c[_0x8ae3('0x26')]();};}function saveUpdates(_0x120e9a,_0x4ca6d2){return function(_0x1d604a){if(_0x1d604a){return _0x1d604a['update'](_0x120e9a)['then'](function(_0xcecada){return _0xcecada;});}return null;};}function removeEntity(_0x1a2533,_0x8315d9){return function(_0x58da29){if(_0x58da29){return _0x58da29[_0x8ae3('0x27')]()[_0x8ae3('0x28')](function(){_0x1a2533[_0x8ae3('0x1d')](0xcc)[_0x8ae3('0x1e')]();});}};}function handleEntityNotFound(_0x106113,_0x567b5d){return function(_0x2229c5){if(!_0x2229c5){_0x106113['sendStatus'](0x194);}return _0x2229c5;};}function handleError(_0x37f1dc,_0x1087e9){_0x1087e9=_0x1087e9||0x1f4;return function(_0x32a400){logger[_0x8ae3('0x29')](_0x32a400['stack']);if(_0x32a400[_0x8ae3('0x2a')]){delete _0x32a400[_0x8ae3('0x2a')];}_0x37f1dc[_0x8ae3('0x1d')](_0x1087e9)[_0x8ae3('0x2b')](_0x32a400);};}exports['index']=function(_0x239b21,_0x441244){var _0x4ea973={},_0x472c97={},_0x59a006={'count':0x0,'rows':[]};var _0x458ef3=_[_0x8ae3('0x2c')](db[_0x8ae3('0x2d')]['rawAttributes'],function(_0x11e36d){return{'name':_0x11e36d[_0x8ae3('0x2e')],'type':_0x11e36d[_0x8ae3('0x2f')][_0x8ae3('0x30')]};});_0x472c97[_0x8ae3('0x31')]=_[_0x8ae3('0x2c')](_0x458ef3,_0x8ae3('0x2a'));_0x472c97[_0x8ae3('0x32')]=_[_0x8ae3('0x33')](_0x239b21[_0x8ae3('0x32')]);_0x472c97[_0x8ae3('0x34')]=_[_0x8ae3('0x35')](_0x472c97[_0x8ae3('0x31')],_0x472c97[_0x8ae3('0x32')]);_0x4ea973[_0x8ae3('0x36')]=_[_0x8ae3('0x35')](_0x472c97[_0x8ae3('0x31')],qs[_0x8ae3('0x37')](_0x239b21[_0x8ae3('0x32')]['fields']));_0x4ea973['attributes']=_0x4ea973[_0x8ae3('0x36')]['length']?_0x4ea973[_0x8ae3('0x36')]:_0x472c97[_0x8ae3('0x31')];if(!_0x239b21[_0x8ae3('0x32')]['hasOwnProperty'](_0x8ae3('0x38'))){_0x4ea973['limit']=qs[_0x8ae3('0x21')](_0x239b21[_0x8ae3('0x32')][_0x8ae3('0x21')]);_0x4ea973[_0x8ae3('0x22')]=qs[_0x8ae3('0x22')](_0x239b21[_0x8ae3('0x32')]['offset']);}_0x4ea973['order']=qs[_0x8ae3('0x39')](_0x239b21[_0x8ae3('0x32')][_0x8ae3('0x39')]);_0x4ea973[_0x8ae3('0x3a')]=qs['filters'](_['pick'](_0x239b21['query'],_0x472c97[_0x8ae3('0x34')]),_0x458ef3);if(_0x239b21[_0x8ae3('0x32')][_0x8ae3('0x3b')]){_0x4ea973[_0x8ae3('0x3a')]=_[_0x8ae3('0x3c')](_0x4ea973[_0x8ae3('0x3a')],{'$or':_[_0x8ae3('0x2c')](_0x458ef3,function(_0x1e1dc2){if(_0x1e1dc2['type']!=='VIRTUAL'){var _0x12f241={};_0x12f241[_0x1e1dc2['name']]={'$like':'%'+_0x239b21['query']['filter']+'%'};return _0x12f241;}})});}_0x4ea973=_['merge']({},_0x4ea973,_0x239b21[_0x8ae3('0x3d')]);var _0x145735={'where':_0x4ea973[_0x8ae3('0x3a')]};return db[_0x8ae3('0x2d')][_0x8ae3('0x3e')](_0x145735)[_0x8ae3('0x28')](function(_0x3a1748){_0x59a006['count']=_0x3a1748;if(_0x239b21[_0x8ae3('0x32')][_0x8ae3('0x3f')]){_0x4ea973[_0x8ae3('0x40')]=[{'all':!![]}];}return db[_0x8ae3('0x2d')][_0x8ae3('0x41')](_0x4ea973);})[_0x8ae3('0x28')](function(_0x2fe00d){_0x59a006[_0x8ae3('0x42')]=_0x2fe00d;return _0x59a006;})[_0x8ae3('0x28')](respondWithFilteredResult(_0x441244,_0x4ea973))[_0x8ae3('0x43')](handleError(_0x441244,null));};exports['show']=function(_0x148a1d,_0x480e69){var _0xf5ad1a={'raw':!![],'where':{'id':_0x148a1d[_0x8ae3('0x44')]['id']}},_0x4eedc6={};_0x4eedc6[_0x8ae3('0x31')]=_[_0x8ae3('0x33')](db[_0x8ae3('0x2d')][_0x8ae3('0x45')]);_0x4eedc6[_0x8ae3('0x32')]=_[_0x8ae3('0x33')](_0x148a1d['query']);_0x4eedc6[_0x8ae3('0x34')]=_['intersection'](_0x4eedc6[_0x8ae3('0x31')],_0x4eedc6[_0x8ae3('0x32')]);_0xf5ad1a[_0x8ae3('0x36')]=_['intersection'](_0x4eedc6[_0x8ae3('0x31')],qs[_0x8ae3('0x37')](_0x148a1d[_0x8ae3('0x32')][_0x8ae3('0x37')]));_0xf5ad1a[_0x8ae3('0x36')]=_0xf5ad1a[_0x8ae3('0x36')][_0x8ae3('0x46')]?_0xf5ad1a['attributes']:_0x4eedc6[_0x8ae3('0x31')];if(_0x148a1d['query']['includeAll']){_0xf5ad1a[_0x8ae3('0x40')]=[{'all':!![]}];}_0xf5ad1a=_[_0x8ae3('0x3c')]({},_0xf5ad1a,_0x148a1d[_0x8ae3('0x3d')]);return db[_0x8ae3('0x2d')][_0x8ae3('0x47')](_0xf5ad1a)[_0x8ae3('0x28')](handleEntityNotFound(_0x480e69,null))['then'](respondWithResult(_0x480e69,null))[_0x8ae3('0x43')](handleError(_0x480e69,null));};exports['create']=function(_0x4f7f1d,_0x11c73c){return db[_0x8ae3('0x2d')][_0x8ae3('0x48')](_0x4f7f1d[_0x8ae3('0x49')],{})['then'](respondWithResult(_0x11c73c,0xc9))[_0x8ae3('0x43')](handleError(_0x11c73c,null));};exports[_0x8ae3('0x4a')]=function(_0x392f72,_0x4c720a){return db['CmHopperHistory'][_0x8ae3('0x4a')]()['then'](respondWithResult(_0x4c720a,null))[_0x8ae3('0x43')](handleError(_0x4c720a,null));};exports[_0x8ae3('0x4b')]=function(_0x105bb5,_0x1c9ddf){if(_0x105bb5['body']['uniqueid']){delete _0x105bb5[_0x8ae3('0x49')]['uniqueid'];}return db[_0x8ae3('0x2d')][_0x8ae3('0x47')]({'where':{'uniqueid':_0x105bb5['params']['id']}})[_0x8ae3('0x28')](handleEntityNotFound(_0x1c9ddf,null))['then'](saveUpdates(_0x105bb5[_0x8ae3('0x49')],null))[_0x8ae3('0x28')](respondWithResult(_0x1c9ddf,null))['catch'](handleError(_0x1c9ddf,null));}; \ No newline at end of file +var _0x61f6=['Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','includeAll','findAll','catch','show','params','include','options','body','describe','uniqueid','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0xd7b0a4,_0x53c7d3){var _0x184e9e=function(_0x325bbd){while(--_0x325bbd){_0xd7b0a4['push'](_0xd7b0a4['shift']());}};_0x184e9e(++_0x53c7d3);}(_0x61f6,0x198));var _0x661f=function(_0x5906a5,_0x48af0a){_0x5906a5=_0x5906a5-0x0;var _0x1b9a31=_0x61f6[_0x5906a5];return _0x1b9a31;};'use strict';var emlformat=require(_0x661f('0x0'));var rimraf=require(_0x661f('0x1'));var zipdir=require(_0x661f('0x2'));var jsonpatch=require(_0x661f('0x3'));var rp=require(_0x661f('0x4'));var moment=require(_0x661f('0x5'));var BPromise=require(_0x661f('0x6'));var Mustache=require(_0x661f('0x7'));var util=require(_0x661f('0x8'));var path=require(_0x661f('0x9'));var sox=require(_0x661f('0xa'));var csv=require(_0x661f('0xb'));var ejs=require(_0x661f('0xc'));var fs=require('fs');var fs_extra=require(_0x661f('0xd'));var _=require(_0x661f('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x661f('0xb'));var querystring=require(_0x661f('0xf'));var Papa=require('papaparse');var Redis=require(_0x661f('0x10'));var authService=require(_0x661f('0x11'));var qs=require(_0x661f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x661f('0x13'));var config=require(_0x661f('0x14'));var licenseUtil=require(_0x661f('0x15'));var db=require(_0x661f('0x16'))['db'];function respondWithStatusCode(_0x2d42b6,_0x185001){_0x185001=_0x185001||0xcc;return function(_0x236c5c){if(_0x236c5c){return _0x2d42b6[_0x661f('0x17')](_0x185001);}return _0x2d42b6[_0x661f('0x18')](_0x185001)['end']();};}function respondWithResult(_0x15bd92,_0x183252){_0x183252=_0x183252||0xc8;return function(_0x209cce){if(_0x209cce){return _0x15bd92[_0x661f('0x18')](_0x183252)[_0x661f('0x19')](_0x209cce);}};}function respondWithFilteredResult(_0x1245b7,_0x3c6239){return function(_0x22b232){if(_0x22b232){var _0x52f2dc=typeof _0x3c6239[_0x661f('0x1a')]===_0x661f('0x1b')&&typeof _0x3c6239[_0x661f('0x1c')]===_0x661f('0x1b');var _0x2d33ee=_0x22b232['count'];var _0xd154e4=_0x52f2dc?0x0:_0x3c6239[_0x661f('0x1a')];var _0x2e979a=_0x52f2dc?_0x22b232[_0x661f('0x1d')]:_0x3c6239[_0x661f('0x1a')]+_0x3c6239[_0x661f('0x1c')];var _0x4f0a9d;if(_0x2e979a>=_0x2d33ee){_0x2e979a=_0x2d33ee;_0x4f0a9d=0xc8;}else{_0x4f0a9d=0xce;}_0x1245b7[_0x661f('0x18')](_0x4f0a9d);return _0x1245b7['set'](_0x661f('0x1e'),_0xd154e4+'-'+_0x2e979a+'/'+_0x2d33ee)[_0x661f('0x19')](_0x22b232);}return null;};}function patchUpdates(_0x5d10b6){return function(_0x4f0488){try{jsonpatch[_0x661f('0x1f')](_0x4f0488,_0x5d10b6,!![]);}catch(_0x42c619){return BPromise[_0x661f('0x20')](_0x42c619);}return _0x4f0488[_0x661f('0x21')]();};}function saveUpdates(_0x37b97b,_0x4d9632){return function(_0x3b63dd){if(_0x3b63dd){return _0x3b63dd[_0x661f('0x22')](_0x37b97b)[_0x661f('0x23')](function(_0x1e4c90){return _0x1e4c90;});}return null;};}function removeEntity(_0x1859f0,_0x46436b){return function(_0x20fb78){if(_0x20fb78){return _0x20fb78[_0x661f('0x24')]()[_0x661f('0x23')](function(){_0x1859f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x344a49,_0x36d425){return function(_0x3bcf33){if(!_0x3bcf33){_0x344a49['sendStatus'](0x194);}return _0x3bcf33;};}function handleError(_0x29fe0e,_0x537f58){_0x537f58=_0x537f58||0x1f4;return function(_0xaaa8b7){logger[_0x661f('0x25')](_0xaaa8b7[_0x661f('0x26')]);if(_0xaaa8b7['name']){delete _0xaaa8b7[_0x661f('0x27')];}_0x29fe0e['status'](_0x537f58)[_0x661f('0x28')](_0xaaa8b7);};}exports[_0x661f('0x29')]=function(_0x327182,_0x4d3261){var _0x33e13f={},_0x3da4a2={},_0x3811c9={'count':0x0,'rows':[]};var _0x189d32=_[_0x661f('0x2a')](db[_0x661f('0x2b')][_0x661f('0x2c')],function(_0x28e267){return{'name':_0x28e267['fieldName'],'type':_0x28e267[_0x661f('0x2d')][_0x661f('0x2e')]};});_0x3da4a2[_0x661f('0x2f')]=_[_0x661f('0x2a')](_0x189d32,_0x661f('0x27'));_0x3da4a2[_0x661f('0x30')]=_[_0x661f('0x31')](_0x327182[_0x661f('0x30')]);_0x3da4a2[_0x661f('0x32')]=_[_0x661f('0x33')](_0x3da4a2[_0x661f('0x2f')],_0x3da4a2[_0x661f('0x30')]);_0x33e13f['attributes']=_[_0x661f('0x33')](_0x3da4a2[_0x661f('0x2f')],qs[_0x661f('0x34')](_0x327182[_0x661f('0x30')][_0x661f('0x34')]));_0x33e13f[_0x661f('0x35')]=_0x33e13f[_0x661f('0x35')][_0x661f('0x36')]?_0x33e13f[_0x661f('0x35')]:_0x3da4a2['model'];if(!_0x327182[_0x661f('0x30')][_0x661f('0x37')](_0x661f('0x38'))){_0x33e13f['limit']=qs[_0x661f('0x1c')](_0x327182[_0x661f('0x30')][_0x661f('0x1c')]);_0x33e13f[_0x661f('0x1a')]=qs[_0x661f('0x1a')](_0x327182[_0x661f('0x30')][_0x661f('0x1a')]);}_0x33e13f[_0x661f('0x39')]=qs[_0x661f('0x3a')](_0x327182[_0x661f('0x30')][_0x661f('0x3a')]);_0x33e13f[_0x661f('0x3b')]=qs[_0x661f('0x32')](_['pick'](_0x327182[_0x661f('0x30')],_0x3da4a2['filters']),_0x189d32);if(_0x327182['query']['filter']){_0x33e13f[_0x661f('0x3b')]=_[_0x661f('0x3c')](_0x33e13f['where'],{'$or':_[_0x661f('0x2a')](_0x189d32,function(_0x313fe3){if(_0x313fe3[_0x661f('0x2d')]!=='VIRTUAL'){var _0x222d80={};_0x222d80[_0x313fe3['name']]={'$like':'%'+_0x327182[_0x661f('0x30')][_0x661f('0x3d')]+'%'};return _0x222d80;}})});}_0x33e13f=_[_0x661f('0x3c')]({},_0x33e13f,_0x327182['options']);var _0x5664e0={'where':_0x33e13f[_0x661f('0x3b')]};return db[_0x661f('0x2b')][_0x661f('0x1d')](_0x5664e0)['then'](function(_0x45a40e){_0x3811c9[_0x661f('0x1d')]=_0x45a40e;if(_0x327182[_0x661f('0x30')][_0x661f('0x3e')]){_0x33e13f['include']=[{'all':!![]}];}return db[_0x661f('0x2b')][_0x661f('0x3f')](_0x33e13f);})[_0x661f('0x23')](function(_0x3ee99c){_0x3811c9['rows']=_0x3ee99c;return _0x3811c9;})[_0x661f('0x23')](respondWithFilteredResult(_0x4d3261,_0x33e13f))[_0x661f('0x40')](handleError(_0x4d3261,null));};exports[_0x661f('0x41')]=function(_0x1e31fa,_0x3fee6c){var _0x5c3455={'raw':!![],'where':{'id':_0x1e31fa[_0x661f('0x42')]['id']}},_0x17b40b={};_0x17b40b[_0x661f('0x2f')]=_[_0x661f('0x31')](db[_0x661f('0x2b')]['rawAttributes']);_0x17b40b[_0x661f('0x30')]=_[_0x661f('0x31')](_0x1e31fa[_0x661f('0x30')]);_0x17b40b[_0x661f('0x32')]=_[_0x661f('0x33')](_0x17b40b[_0x661f('0x2f')],_0x17b40b[_0x661f('0x30')]);_0x5c3455[_0x661f('0x35')]=_[_0x661f('0x33')](_0x17b40b[_0x661f('0x2f')],qs[_0x661f('0x34')](_0x1e31fa['query']['fields']));_0x5c3455[_0x661f('0x35')]=_0x5c3455[_0x661f('0x35')][_0x661f('0x36')]?_0x5c3455['attributes']:_0x17b40b[_0x661f('0x2f')];if(_0x1e31fa['query'][_0x661f('0x3e')]){_0x5c3455[_0x661f('0x43')]=[{'all':!![]}];}_0x5c3455=_['merge']({},_0x5c3455,_0x1e31fa[_0x661f('0x44')]);return db[_0x661f('0x2b')]['find'](_0x5c3455)[_0x661f('0x23')](handleEntityNotFound(_0x3fee6c,null))[_0x661f('0x23')](respondWithResult(_0x3fee6c,null))['catch'](handleError(_0x3fee6c,null));};exports['create']=function(_0x31e3e1,_0x4c758d){return db[_0x661f('0x2b')]['create'](_0x31e3e1[_0x661f('0x45')],{})[_0x661f('0x23')](respondWithResult(_0x4c758d,0xc9))[_0x661f('0x40')](handleError(_0x4c758d,null));};exports['describe']=function(_0x106c3f,_0x29017d){return db[_0x661f('0x2b')][_0x661f('0x46')]()['then'](respondWithResult(_0x29017d,null))[_0x661f('0x40')](handleError(_0x29017d,null));};exports[_0x661f('0x22')]=function(_0x4ac03e,_0x61b9b8){if(_0x4ac03e[_0x661f('0x45')][_0x661f('0x47')]){delete _0x4ac03e[_0x661f('0x45')]['uniqueid'];}return db[_0x661f('0x2b')][_0x661f('0x48')]({'where':{'uniqueid':_0x4ac03e[_0x661f('0x42')]['id']}})[_0x661f('0x23')](handleEntityNotFound(_0x61b9b8,null))[_0x661f('0x23')](saveUpdates(_0x4ac03e[_0x661f('0x45')],null))[_0x661f('0x23')](respondWithResult(_0x61b9b8,null))['catch'](handleError(_0x61b9b8,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 9273080..fbcfcb9 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 _0x88c7=['uniqueid','lodash','api','moment','path','rimraf','./cmHopperHistory.attributes','exports','define','endtime'];(function(_0x3598bb,_0x24befa){var _0x13c837=function(_0x3de578){while(--_0x3de578){_0x3598bb['push'](_0x3598bb['shift']());}};_0x13c837(++_0x24befa);}(_0x88c7,0x6f));var _0x788c=function(_0x4ee35e,_0xc6acba){_0x4ee35e=_0x4ee35e-0x0;var _0x210d09=_0x88c7[_0x4ee35e];return _0x210d09;};'use strict';var _=require(_0x788c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x788c('0x1'));var moment=require(_0x788c('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x788c('0x3'));var rimraf=require(_0x788c('0x4'));var config=require('../../config/environment');var attributes=require(_0x788c('0x5'));module[_0x788c('0x6')]=function(_0x4e6f8b,_0xbde9d1){return _0x4e6f8b[_0x788c('0x7')]('CmHopperHistory',attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x788c('0x8'),'fields':[_0x788c('0x8')]},{'name':_0x788c('0x9'),'fields':[_0x788c('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1967=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','util','../../config/logger','api','moment'];(function(_0x5ebe10,_0x10e193){var _0x17b7bb=function(_0x45a02b){while(--_0x45a02b){_0x5ebe10['push'](_0x5ebe10['shift']());}};_0x17b7bb(++_0x10e193);}(_0x1967,0x173));var _0x7196=function(_0xbfbb78,_0x4e4b7b){_0xbfbb78=_0xbfbb78-0x0;var _0x1aed9d=_0x1967[_0xbfbb78];return _0x1aed9d;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var logger=require(_0x7196('0x1'))(_0x7196('0x2'));var moment=require(_0x7196('0x3'));var BPromise=require(_0x7196('0x4'));var rp=require(_0x7196('0x5'));var fs=require('fs');var path=require(_0x7196('0x6'));var rimraf=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var attributes=require(_0x7196('0x9'));module['exports']=function(_0x36b01e,_0x186175){return _0x36b01e[_0x7196('0xa')](_0x7196('0xb'),attributes,{'tableName':_0x7196('0xc'),'paranoid':![],'indexes':[{'name':_0x7196('0xd'),'fields':['endtime']},{'name':_0x7196('0xe'),'fields':[_0x7196('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 4cc0fcc..72e84d6 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 _0x4e81=['`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime'];(function(_0x2db02c,_0x4cbd76){var _0x351e12=function(_0x584775){while(--_0x584775){_0x2db02c['push'](_0x2db02c['shift']());}};_0x351e12(++_0x4cbd76);}(_0x4e81,0x1bc));var _0x14e8=function(_0x337a10,_0x5191c7){_0x337a10=_0x337a10-0x0;var _0x575f98=_0x4e81[_0x337a10];return _0x575f98;};'use strict';var _=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var moment=require(_0x14e8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14e8('0x3'))['db'];var utils=require(_0x14e8('0x4'));var logger=require(_0x14e8('0x5'))(_0x14e8('0x6'));var config=require(_0x14e8('0x7'));var jayson=require(_0x14e8('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e73d2,_0x449fa3,_0x21f860){return new BPromise(function(_0x3c1b93,_0x11ec3b){return client[_0x14e8('0x9')](_0x3e73d2,_0x21f860)[_0x14e8('0xa')](function(_0x1d8402){logger[_0x14e8('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x449fa3,_0x14e8('0xc'));logger[_0x14e8('0xd')](_0x14e8('0xe'),_0x449fa3,_0x14e8('0xc'),JSON[_0x14e8('0xf')](_0x1d8402));if(_0x1d8402[_0x14e8('0x10')]){if(_0x1d8402[_0x14e8('0x10')][_0x14e8('0x11')]===0x1f4){logger['error'](_0x14e8('0x12'),_0x449fa3,_0x1d8402['error'][_0x14e8('0x13')]);return _0x11ec3b(_0x1d8402[_0x14e8('0x10')][_0x14e8('0x13')]);}logger['error'](_0x14e8('0x12'),_0x449fa3,_0x1d8402['error'][_0x14e8('0x13')]);return _0x3c1b93(_0x1d8402['error'][_0x14e8('0x13')]);}else{logger[_0x14e8('0xb')](_0x14e8('0x12'),_0x449fa3,_0x14e8('0xc'));_0x3c1b93(_0x1d8402['result'][_0x14e8('0x13')]);}})[_0x14e8('0x14')](function(_0x30581){logger[_0x14e8('0x10')](_0x14e8('0x12'),_0x449fa3,_0x30581);_0x11ec3b(_0x30581);});});}exports[_0x14e8('0x15')]=function(_0x10dc8b){var _0x462259=this;return new Promise(function(_0x5a38c1,_0x328c5a){return db[_0x14e8('0x16')][_0x14e8('0x17')](_0x10dc8b[_0x14e8('0x18')],{'raw':_0x10dc8b[_0x14e8('0x19')]?_0x10dc8b['options'][_0x14e8('0x1a')]===undefined?!![]:![]:!![]})[_0x14e8('0xa')](function(_0x2abfec){logger['info'](_0x14e8('0x15'),_0x10dc8b);logger['debug'](_0x14e8('0x15'),_0x10dc8b,JSON[_0x14e8('0xf')](_0x2abfec));_0x5a38c1(_0x2abfec);})[_0x14e8('0x14')](function(_0x117b00){logger[_0x14e8('0x10')]('CreateCmHopperHistory',_0x117b00[_0x14e8('0x13')],_0x10dc8b);_0x328c5a(_0x462259['error'](0x1f4,_0x117b00[_0x14e8('0x13')]));});});};exports[_0x14e8('0x1b')]=function(_0x4ffc8b){var _0x58a3a1=this;return new Promise(function(_0x4e7ec5,_0x4a758c){return db[_0x14e8('0x16')][_0x14e8('0x1c')]({'raw':_0x4ffc8b[_0x14e8('0x19')]?_0x4ffc8b[_0x14e8('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4ffc8b[_0x14e8('0x19')]?_0x4ffc8b[_0x14e8('0x19')][_0x14e8('0x1d')]||null:null,'attributes':[[db[_0x14e8('0x1e')]['fn'](_0x14e8('0x1f'),db[_0x14e8('0x1e')][_0x14e8('0x20')]('id')),'predictiveIntervalTotalCalls'],[db[_0x14e8('0x1e')]['fn'](_0x14e8('0x1f'),db[_0x14e8('0x1e')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x14e8('0x21')],[db[_0x14e8('0x1e')]['fn']('COUNT',db[_0x14e8('0x1e')]['fn']('IF',db[_0x14e8('0x1e')][_0x14e8('0x22')](_0x14e8('0x23')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x14e8('0x1e')]['fn'](_0x14e8('0x1f'),db[_0x14e8('0x1e')]['fn']('IF',db[_0x14e8('0x1e')][_0x14e8('0x22')]('`state`\x20=\x2011,\x201,\x20null'))),_0x14e8('0x24')],[db[_0x14e8('0x1e')]['fn'](_0x14e8('0x25'),db[_0x14e8('0x1e')]['fn']('IF',db['sequelize'][_0x14e8('0x22')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x14e8('0x26')],[db[_0x14e8('0x1e')]['fn'](_0x14e8('0x25'),db[_0x14e8('0x1e')]['fn']('IF',db[_0x14e8('0x1e')][_0x14e8('0x22')](_0x14e8('0x27')))),_0x14e8('0x28')]]})[_0x14e8('0xa')](function(_0x2acf6a){logger[_0x14e8('0xb')](_0x14e8('0x1b'),_0x4ffc8b);logger['debug']('AvgHandleTime',_0x4ffc8b,JSON['stringify'](_0x2acf6a));_0x4e7ec5(_0x2acf6a);})[_0x14e8('0x14')](function(_0x4da5f4){logger[_0x14e8('0x10')]('AvgHandleTime',_0x4da5f4[_0x14e8('0x13')],_0x4ffc8b);_0x4a758c(_0x58a3a1[_0x14e8('0x10')](0x1f4,_0x4da5f4[_0x14e8('0x13')]));});});};exports[_0x14e8('0x29')]=function(_0x51a63d){var _0x13b44e=this;return new Promise(function(_0x514415,_0x5f0ee3){return db[_0x14e8('0x16')][_0x14e8('0x1c')]({'raw':_0x51a63d[_0x14e8('0x19')]?_0x51a63d[_0x14e8('0x19')][_0x14e8('0x1a')]===undefined?!![]:![]:!![],'where':_0x51a63d['options']?_0x51a63d[_0x14e8('0x19')]['where']||null:null,'attributes':[[_0x14e8('0x2a'),_0x14e8('0x2b')],[db[_0x14e8('0x1e')]['fn']('COUNT',db[_0x14e8('0x1e')]['fn']('IF',db[_0x14e8('0x1e')]['literal'](_0x14e8('0x2c')))),_0x14e8('0x2d')],[db[_0x14e8('0x1e')]['fn'](_0x14e8('0x1f'),db[_0x14e8('0x1e')]['fn']('IF',db[_0x14e8('0x1e')][_0x14e8('0x22')](_0x14e8('0x2e')))),_0x14e8('0x2f')],[db[_0x14e8('0x1e')]['fn'](_0x14e8('0x1f'),db[_0x14e8('0x1e')]['fn']('IF',db[_0x14e8('0x1e')][_0x14e8('0x22')](_0x14e8('0x30')))),'outboundAnswerCallsDay'],[db[_0x14e8('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x14e8('0x22')]('`state`\x20=\x205,\x201,\x20null'))),_0x14e8('0x31')],[db[_0x14e8('0x1e')]['fn'](_0x14e8('0x1f'),db[_0x14e8('0x1e')]['fn']('IF',db[_0x14e8('0x1e')][_0x14e8('0x22')](_0x14e8('0x32')))),_0x14e8('0x33')],[db[_0x14e8('0x1e')]['fn'](_0x14e8('0x1f'),db[_0x14e8('0x1e')]['fn']('IF',db['sequelize'][_0x14e8('0x22')](_0x14e8('0x34')))),_0x14e8('0x35')],[db[_0x14e8('0x1e')]['fn']('COUNT',db[_0x14e8('0x1e')]['fn']('IF',db[_0x14e8('0x1e')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x14e8('0x36')],[db['sequelize']['fn']('COUNT',db[_0x14e8('0x1e')]['fn']('IF',db[_0x14e8('0x1e')]['literal'](_0x14e8('0x37')))),_0x14e8('0x38')],[db['sequelize']['fn'](_0x14e8('0x1f'),db[_0x14e8('0x1e')]['fn']('IF',db[_0x14e8('0x1e')][_0x14e8('0x22')](_0x14e8('0x39')))),_0x14e8('0x3a')],[db[_0x14e8('0x1e')]['fn'](_0x14e8('0x1f'),db[_0x14e8('0x1e')]['fn']('IF',db[_0x14e8('0x1e')][_0x14e8('0x22')](_0x14e8('0x3b')))),_0x14e8('0x3c')],[db[_0x14e8('0x1e')]['fn'](_0x14e8('0x1f'),db[_0x14e8('0x1e')]['fn']('IF',db['sequelize'][_0x14e8('0x22')]('`state`\x20=\x2018,\x201,\x20null'))),_0x14e8('0x3d')],[db[_0x14e8('0x1e')]['fn'](_0x14e8('0x1f'),db[_0x14e8('0x1e')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2016,\x201,\x20null'))),_0x14e8('0x3e')],[db['sequelize']['fn']('COUNT',db[_0x14e8('0x1e')]['fn']('IF',db[_0x14e8('0x1e')]['literal'](_0x14e8('0x3f')))),_0x14e8('0x3d')],[db[_0x14e8('0x1e')]['fn'](_0x14e8('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0x14e8('0x22')](_0x14e8('0x40')))),_0x14e8('0x41')]],'group':[_0x14e8('0x2a')]})[_0x14e8('0xa')](function(_0x2fbac7){logger['info'](_0x14e8('0x29'),_0x51a63d);logger[_0x14e8('0xd')](_0x14e8('0x29'),_0x51a63d,JSON[_0x14e8('0xf')](_0x2fbac7));_0x514415(_0x2fbac7);})['catch'](function(_0x2af48f){logger[_0x14e8('0x10')](_0x14e8('0x29'),_0x2af48f[_0x14e8('0x13')],_0x51a63d);_0x5f0ee3(_0x13b44e['error'](0x1f4,_0x2af48f[_0x14e8('0x13')]));});});};exports[_0x14e8('0x42')]=function(_0x17e482){var _0x1b0f36=this;return new Promise(function(_0x5a1fd4,_0x370200){return db[_0x14e8('0x16')][_0x14e8('0x1c')]({'raw':_0x17e482['options']?_0x17e482['options'][_0x14e8('0x1a')]===undefined?!![]:![]:!![],'where':_0x17e482[_0x14e8('0x19')]?_0x17e482[_0x14e8('0x19')][_0x14e8('0x1d')]||null:null,'attributes':[[_0x14e8('0x2a'),'name'],[db['sequelize']['fn']('COUNT',db[_0x14e8('0x1e')][_0x14e8('0x20')]('id')),_0x14e8('0x43')],[db['sequelize']['fn'](_0x14e8('0x1f'),db[_0x14e8('0x1e')]['fn']('IF',db[_0x14e8('0x1e')]['literal'](_0x14e8('0x30')))),_0x14e8('0x44')]],'group':[_0x14e8('0x2a')]})[_0x14e8('0xa')](function(_0x45053a){logger[_0x14e8('0xb')](_0x14e8('0x42'),_0x17e482);logger[_0x14e8('0xd')](_0x14e8('0x42'),_0x17e482,JSON[_0x14e8('0xf')](_0x45053a));_0x5a1fd4(_0x45053a);})[_0x14e8('0x14')](function(_0x4c6f1d){logger[_0x14e8('0x10')](_0x14e8('0x42'),_0x4c6f1d[_0x14e8('0x13')],_0x17e482);_0x370200(_0x1b0f36[_0x14e8('0x10')](0x1f4,_0x4c6f1d[_0x14e8('0x13')]));});});}; \ No newline at end of file +var _0x534d=['findAll','options','sequelize','COUNT','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','where','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateCmHopperHistory','create','body','raw','debug','AvgHandleTime','CmHopperHistory'];(function(_0x23cc7d,_0x553e85){var _0x41abb3=function(_0x3cbbde){while(--_0x3cbbde){_0x23cc7d['push'](_0x23cc7d['shift']());}};_0x41abb3(++_0x553e85);}(_0x534d,0x79));var _0xd534=function(_0xb40d09,_0x33bb41){_0xb40d09=_0xb40d09-0x0;var _0x5b6705=_0x534d[_0xb40d09];return _0x5b6705;};'use strict';var _=require(_0xd534('0x0'));var util=require(_0xd534('0x1'));var moment=require(_0xd534('0x2'));var BPromise=require(_0xd534('0x3'));var rs=require(_0xd534('0x4'));var fs=require('fs');var Redis=require(_0xd534('0x5'));var db=require(_0xd534('0x6'))['db'];var utils=require(_0xd534('0x7'));var logger=require(_0xd534('0x8'))(_0xd534('0x9'));var config=require(_0xd534('0xa'));var jayson=require(_0xd534('0xb'));var client=jayson[_0xd534('0xc')][_0xd534('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1db778,_0x3c8772,_0x4419ee){return new BPromise(function(_0x1a00af,_0x2be8e1){return client['request'](_0x1db778,_0x4419ee)[_0xd534('0xe')](function(_0x37a2c8){logger[_0xd534('0xf')](_0xd534('0x10'),_0x3c8772,_0xd534('0x11'));logger['debug'](_0xd534('0x12'),_0x3c8772,_0xd534('0x11'),JSON[_0xd534('0x13')](_0x37a2c8));if(_0x37a2c8[_0xd534('0x14')]){if(_0x37a2c8[_0xd534('0x14')][_0xd534('0x15')]===0x1f4){logger[_0xd534('0x14')](_0xd534('0x10'),_0x3c8772,_0x37a2c8['error']['message']);return _0x2be8e1(_0x37a2c8[_0xd534('0x14')][_0xd534('0x16')]);}logger[_0xd534('0x14')](_0xd534('0x10'),_0x3c8772,_0x37a2c8[_0xd534('0x14')][_0xd534('0x16')]);return _0x1a00af(_0x37a2c8[_0xd534('0x14')][_0xd534('0x16')]);}else{logger[_0xd534('0xf')](_0xd534('0x10'),_0x3c8772,'request\x20sent');_0x1a00af(_0x37a2c8['result'][_0xd534('0x16')]);}})[_0xd534('0x17')](function(_0x398435){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x3c8772,_0x398435);_0x2be8e1(_0x398435);});});}exports[_0xd534('0x18')]=function(_0x477b62){var _0x36cc6c=this;return new Promise(function(_0xb097fd,_0x4d02b1){return db['CmHopperHistory'][_0xd534('0x19')](_0x477b62[_0xd534('0x1a')],{'raw':_0x477b62['options']?_0x477b62['options'][_0xd534('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x3c0f39){logger[_0xd534('0xf')](_0xd534('0x18'),_0x477b62);logger[_0xd534('0x1c')](_0xd534('0x18'),_0x477b62,JSON['stringify'](_0x3c0f39));_0xb097fd(_0x3c0f39);})['catch'](function(_0x25a176){logger['error'](_0xd534('0x18'),_0x25a176[_0xd534('0x16')],_0x477b62);_0x4d02b1(_0x36cc6c['error'](0x1f4,_0x25a176[_0xd534('0x16')]));});});};exports[_0xd534('0x1d')]=function(_0x3c030e){var _0x2e93fd=this;return new Promise(function(_0x549659,_0x526134){return db[_0xd534('0x1e')][_0xd534('0x1f')]({'raw':_0x3c030e[_0xd534('0x20')]?_0x3c030e['options'][_0xd534('0x1b')]===undefined?!![]:![]:!![],'where':_0x3c030e[_0xd534('0x20')]?_0x3c030e[_0xd534('0x20')]['where']||null:null,'attributes':[[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db['sequelize'][_0xd534('0x23')]('id')),_0xd534('0x24')],[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db[_0xd534('0x21')]['fn']('IF',db[_0xd534('0x21')]['literal'](_0xd534('0x25')))),_0xd534('0x26')],[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db[_0xd534('0x21')]['fn']('IF',db[_0xd534('0x21')][_0xd534('0x27')](_0xd534('0x28')))),_0xd534('0x29')],[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db[_0xd534('0x21')]['fn']('IF',db['sequelize'][_0xd534('0x27')](_0xd534('0x2a')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0xd534('0x21')]['fn'](_0xd534('0x2b'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xd534('0x2c')))),_0xd534('0x2d')],[db['sequelize']['fn'](_0xd534('0x2b'),db[_0xd534('0x21')]['fn']('IF',db[_0xd534('0x21')]['literal'](_0xd534('0x2e')))),_0xd534('0x2f')]]})[_0xd534('0xe')](function(_0x4d9404){logger[_0xd534('0xf')](_0xd534('0x1d'),_0x3c030e);logger[_0xd534('0x1c')]('AvgHandleTime',_0x3c030e,JSON[_0xd534('0x13')](_0x4d9404));_0x549659(_0x4d9404);})[_0xd534('0x17')](function(_0x4fbd5d){logger[_0xd534('0x14')](_0xd534('0x1d'),_0x4fbd5d[_0xd534('0x16')],_0x3c030e);_0x526134(_0x2e93fd[_0xd534('0x14')](0x1f4,_0x4fbd5d['message']));});});};exports[_0xd534('0x30')]=function(_0x4ac69b){var _0x503fe7=this;return new Promise(function(_0x5bda69,_0x3d7980){return db[_0xd534('0x1e')][_0xd534('0x1f')]({'raw':_0x4ac69b[_0xd534('0x20')]?_0x4ac69b['options']['raw']===undefined?!![]:![]:!![],'where':_0x4ac69b[_0xd534('0x20')]?_0x4ac69b[_0xd534('0x20')][_0xd534('0x31')]||null:null,'attributes':[[_0xd534('0x32'),_0xd534('0x33')],[db[_0xd534('0x21')]['fn']('COUNT',db[_0xd534('0x21')]['fn']('IF',db['sequelize'][_0xd534('0x27')](_0xd534('0x34')))),_0xd534('0x35')],[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db['sequelize']['fn']('IF',db[_0xd534('0x21')]['literal'](_0xd534('0x36')))),_0xd534('0x37')],[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db[_0xd534('0x21')]['fn']('IF',db['sequelize']['literal'](_0xd534('0x25')))),_0xd534('0x38')],[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db[_0xd534('0x21')]['fn']('IF',db[_0xd534('0x21')][_0xd534('0x27')](_0xd534('0x39')))),'outboundBusyCallsDay'],[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db[_0xd534('0x21')]['fn']('IF',db['sequelize']['literal'](_0xd534('0x3a')))),_0xd534('0x3b')],[db['sequelize']['fn'](_0xd534('0x22'),db['sequelize']['fn']('IF',db[_0xd534('0x21')][_0xd534('0x27')](_0xd534('0x3c')))),'outboundDropCallsDayTimeout'],[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db[_0xd534('0x21')]['fn']('IF',db[_0xd534('0x21')][_0xd534('0x27')](_0xd534('0x3d')))),_0xd534('0x3e')],[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db[_0xd534('0x21')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2012,\x201,\x20null'))),_0xd534('0x3f')],[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db[_0xd534('0x21')]['fn']('IF',db[_0xd534('0x21')][_0xd534('0x27')]('`state`\x20=\x2013,\x201,\x20null'))),_0xd534('0x40')],[db['sequelize']['fn'](_0xd534('0x22'),db[_0xd534('0x21')]['fn']('IF',db['sequelize'][_0xd534('0x27')](_0xd534('0x41')))),_0xd534('0x42')],[db[_0xd534('0x21')]['fn']('COUNT',db[_0xd534('0x21')]['fn']('IF',db[_0xd534('0x21')][_0xd534('0x27')](_0xd534('0x43')))),_0xd534('0x44')],[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db['sequelize']['fn']('IF',db['sequelize'][_0xd534('0x27')](_0xd534('0x45')))),'outboundAnswerAgiCallsDay'],[db['sequelize']['fn']('COUNT',db[_0xd534('0x21')]['fn']('IF',db['sequelize'][_0xd534('0x27')](_0xd534('0x46')))),_0xd534('0x44')],[db[_0xd534('0x21')]['fn']('COUNT',db[_0xd534('0x21')]['fn']('IF',db[_0xd534('0x21')][_0xd534('0x27')](_0xd534('0x47')))),_0xd534('0x48')]],'group':[_0xd534('0x32')]})[_0xd534('0xe')](function(_0x597506){logger[_0xd534('0xf')](_0xd534('0x30'),_0x4ac69b);logger['debug']('GetVoiceQueueHopperHistory',_0x4ac69b,JSON[_0xd534('0x13')](_0x597506));_0x5bda69(_0x597506);})[_0xd534('0x17')](function(_0x439d13){logger[_0xd534('0x14')](_0xd534('0x30'),_0x439d13[_0xd534('0x16')],_0x4ac69b);_0x3d7980(_0x503fe7['error'](0x1f4,_0x439d13[_0xd534('0x16')]));});});};exports[_0xd534('0x49')]=function(_0x2b140a){var _0x4c8e59=this;return new Promise(function(_0x3646a4,_0x4d11e0){return db['CmHopperHistory'][_0xd534('0x1f')]({'raw':_0x2b140a[_0xd534('0x20')]?_0x2b140a[_0xd534('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x2b140a[_0xd534('0x20')]?_0x2b140a['options'][_0xd534('0x31')]||null:null,'attributes':[[_0xd534('0x32'),'name'],[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db['sequelize'][_0xd534('0x23')]('id')),_0xd534('0x4a')],[db[_0xd534('0x21')]['fn'](_0xd534('0x22'),db[_0xd534('0x21')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x201,\x20null'))),_0xd534('0x4b')]],'group':[_0xd534('0x32')]})['then'](function(_0x5a35d3){logger[_0xd534('0xf')](_0xd534('0x49'),_0x2b140a);logger[_0xd534('0x1c')]('GetCampaignHopperHistory',_0x2b140a,JSON['stringify'](_0x5a35d3));_0x3646a4(_0x5a35d3);})['catch'](function(_0x24112f){logger[_0xd534('0x14')]('GetCampaignHopperHistory',_0x24112f['message'],_0x2b140a);_0x4d11e0(_0x4c8e59['error'](0x1f4,_0x24112f['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 3fd11ce..35d9eb7 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 _0xf6cd=['fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','exports','multer','util','connect-timeout','express','Router'];(function(_0x40ef08,_0x6d88f1){var _0x451bb6=function(_0x596c26){while(--_0x596c26){_0x40ef08['push'](_0x40ef08['shift']());}};_0x451bb6(++_0x6d88f1);}(_0xf6cd,0x12d));var _0xdf6c=function(_0x4bbe00,_0x1d2f14){_0x4bbe00=_0x4bbe00-0x0;var _0x3999d2=_0xf6cd[_0x4bbe00];return _0x3999d2;};'use strict';var multer=require(_0xdf6c('0x0'));var util=require(_0xdf6c('0x1'));var path=require('path');var timeout=require(_0xdf6c('0x2'));var express=require(_0xdf6c('0x3'));var router=express[_0xdf6c('0x4')]();var fs_extra=require(_0xdf6c('0x5'));var auth=require(_0xdf6c('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmHopperHistory.controller');router[_0xdf6c('0x7')]('/',auth[_0xdf6c('0x8')](),controller[_0xdf6c('0x9')]);router[_0xdf6c('0x7')](_0xdf6c('0xa'),auth[_0xdf6c('0x8')](),controller[_0xdf6c('0xb')]);router[_0xdf6c('0x7')](_0xdf6c('0xc'),auth[_0xdf6c('0x8')](),controller[_0xdf6c('0xd')]);router['post']('/',auth[_0xdf6c('0x8')](),controller[_0xdf6c('0xe')]);router[_0xdf6c('0xf')](_0xdf6c('0xc'),auth[_0xdf6c('0x8')](),controller[_0xdf6c('0x10')]);module[_0xdf6c('0x11')]=router; \ No newline at end of file +var _0x0640=['describe','/:id','show','post','create','put','update','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe'];(function(_0x3a2a8f,_0x48ba88){var _0x18f5fb=function(_0x2a3415){while(--_0x2a3415){_0x3a2a8f['push'](_0x3a2a8f['shift']());}};_0x18f5fb(++_0x48ba88);}(_0x0640,0x197));var _0x0064=function(_0x24b292,_0x2290a5){_0x24b292=_0x24b292-0x0;var _0x283871=_0x0640[_0x24b292];return _0x283871;};'use strict';var multer=require(_0x0064('0x0'));var util=require('util');var path=require(_0x0064('0x1'));var timeout=require('connect-timeout');var express=require(_0x0064('0x2'));var router=express[_0x0064('0x3')]();var fs_extra=require(_0x0064('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0064('0x5'));var config=require(_0x0064('0x6'));var controller=require(_0x0064('0x7'));router[_0x0064('0x8')]('/',auth[_0x0064('0x9')](),controller['index']);router[_0x0064('0x8')](_0x0064('0xa'),auth[_0x0064('0x9')](),controller[_0x0064('0xb')]);router[_0x0064('0x8')](_0x0064('0xc'),auth['isAuthenticated'](),controller[_0x0064('0xd')]);router[_0x0064('0xe')]('/',auth[_0x0064('0x9')](),controller[_0x0064('0xf')]);router[_0x0064('0x10')](_0x0064('0xc'),auth[_0x0064('0x9')](),controller[_0x0064('0x11')]);module[_0x0064('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 5119372..e8a28b9 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 _0x979e=['name','sequelize','exports','STRING'];(function(_0x3a224c,_0x2f7189){var _0x54a734=function(_0x44775c){while(--_0x44775c){_0x3a224c['push'](_0x3a224c['shift']());}};_0x54a734(++_0x2f7189);}(_0x979e,0x195));var _0xe979=function(_0x184a19,_0x14e30f){_0x184a19=_0x184a19-0x0;var _0x186656=_0x979e[_0x184a19];return _0x186656;};'use strict';var Sequelize=require(_0xe979('0x0'));module[_0xe979('0x1')]={'name':{'type':Sequelize[_0xe979('0x2')],'unique':_0xe979('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0xe979('0x2')]}}; \ No newline at end of file +var _0x32c0=['exports','name','STRING','sequelize'];(function(_0x2ad1b8,_0x1ea09b){var _0x52547d=function(_0x33b77c){while(--_0x33b77c){_0x2ad1b8['push'](_0x2ad1b8['shift']());}};_0x52547d(++_0x1ea09b);}(_0x32c0,0x1f3));var _0x032c=function(_0x1fe154,_0x3fb5e8){_0x1fe154=_0x1fe154-0x0;var _0x172f83=_0x32c0[_0x1fe154];return _0x172f83;};'use strict';var Sequelize=require(_0x032c('0x0'));module[_0x032c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x032c('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x032c('0x3')]},'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 76defdc..e5e5bb6 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 _0x29ed=['dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','format','raw','getContactsCsv','ContactItemType','alias','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description_additionalPhone_','toString','each','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','addCustomField','sequelize','transaction','Sequelize','TEXT','text','INTEGER','switch','addColumn','cf_%s','findAndCountAll','addAgents','emit','removeAgents','userCmList:remove','getAgents','User','info','spread','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','Lists','UserProfileResource','end','error','stack','name','index','map','CmList','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ListId','getDispositions','findOne','Disposition','removeDispositions','addContacts','CmContact','tags','join','isArray','push','omit','ids','success'];(function(_0x5aa373,_0x54c7f4){var _0x590e8e=function(_0x505e62){while(--_0x505e62){_0x5aa373['push'](_0x5aa373['shift']());}};_0x590e8e(++_0x54c7f4);}(_0x29ed,0x181));var _0xd29e=function(_0x48eb11,_0x2a697c){_0x48eb11=_0x48eb11-0x0;var _0x2b1a9c=_0x29ed[_0x48eb11];return _0x2b1a9c;};'use strict';var emlformat=require(_0xd29e('0x0'));var rimraf=require(_0xd29e('0x1'));var zipdir=require(_0xd29e('0x2'));var jsonpatch=require(_0xd29e('0x3'));var rp=require(_0xd29e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd29e('0x5'));var path=require(_0xd29e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd29e('0x7'));var fs=require('fs');var fs_extra=require(_0xd29e('0x8'));var _=require(_0xd29e('0x9'));var squel=require(_0xd29e('0xa'));var crypto=require(_0xd29e('0xb'));var jsforce=require(_0xd29e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd29e('0xd'));var querystring=require(_0xd29e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd29e('0xf'));var qs=require(_0xd29e('0x10'));var as=require(_0xd29e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd29e('0x12'))(_0xd29e('0x13'));var utils=require(_0xd29e('0x14'));var config=require(_0xd29e('0x15'));var licenseUtil=require(_0xd29e('0x16'));var db=require(_0xd29e('0x17'))['db'];var csv_results;config[_0xd29e('0x18')]=_[_0xd29e('0x19')](config[_0xd29e('0x18')],{'host':_0xd29e('0x1a'),'port':0x18eb});var socket=require(_0xd29e('0x1b'))(new Redis(config['redis']));require(_0xd29e('0x1c'))[_0xd29e('0x1d')](socket);function respondWithStatusCode(_0x3ac182,_0x18fb89){_0x18fb89=_0x18fb89||0xcc;return function(_0x159a23){if(_0x159a23){return _0x3ac182[_0xd29e('0x1e')](_0x18fb89);}return _0x3ac182['status'](_0x18fb89)['end']();};}function respondWithResult(_0x306848,_0x25efdc){_0x25efdc=_0x25efdc||0xc8;return function(_0x86dc01){if(_0x86dc01){return _0x306848[_0xd29e('0x1f')](_0x25efdc)[_0xd29e('0x20')](_0x86dc01);}};}function respondWithFilteredResult(_0x533355,_0x581cf2){return function(_0x4a79be){if(_0x4a79be){var _0x19d6b6=typeof _0x581cf2[_0xd29e('0x21')]===_0xd29e('0x22')&&typeof _0x581cf2[_0xd29e('0x23')]==='undefined';var _0x11f84f=_0x4a79be[_0xd29e('0x24')];var _0x3cb945=_0x19d6b6?0x0:_0x581cf2[_0xd29e('0x21')];var _0x3d47f9=_0x19d6b6?_0x4a79be['count']:_0x581cf2[_0xd29e('0x21')]+_0x581cf2[_0xd29e('0x23')];var _0xea7b5d;if(_0x3d47f9>=_0x11f84f){_0x3d47f9=_0x11f84f;_0xea7b5d=0xc8;}else{_0xea7b5d=0xce;}_0x533355[_0xd29e('0x1f')](_0xea7b5d);return _0x533355[_0xd29e('0x25')](_0xd29e('0x26'),_0x3cb945+'-'+_0x3d47f9+'/'+_0x11f84f)[_0xd29e('0x20')](_0x4a79be);}return null;};}function patchUpdates(_0x5c3614){return function(_0x6c93d){try{jsonpatch['apply'](_0x6c93d,_0x5c3614,!![]);}catch(_0x3c791f){return BPromise['reject'](_0x3c791f);}return _0x6c93d[_0xd29e('0x27')]();};}function saveUpdates(_0x132e3a,_0x532bfb){return function(_0x1d0f4c){if(_0x1d0f4c){return _0x1d0f4c[_0xd29e('0x28')](_0x132e3a)[_0xd29e('0x29')](function(_0x4b8865){return _0x4b8865;});}return null;};}function removeEntity(_0x28c69d,_0x57091e){return function(_0x55d4f9){if(_0x55d4f9){return _0x55d4f9[_0xd29e('0x2a')]()[_0xd29e('0x29')](function(){var _0xd624b5=_0x55d4f9[_0xd29e('0x2b')]({'plain':!![]});var _0x2d818c=_0xd29e('0x2c');return db[_0xd29e('0x2d')]['destroy']({'where':{'type':_0x2d818c,'resourceId':_0xd624b5['id']}})[_0xd29e('0x29')](function(){return _0x55d4f9;});})['then'](function(){_0x28c69d[_0xd29e('0x1f')](0xcc)[_0xd29e('0x2e')]();});}};}function handleEntityNotFound(_0x1675b7,_0x2dc62c){return function(_0x24b955){if(!_0x24b955){_0x1675b7[_0xd29e('0x1e')](0x194);}return _0x24b955;};}function handleError(_0x351e6b,_0x491f26){_0x491f26=_0x491f26||0x1f4;return function(_0x42a29b){logger[_0xd29e('0x2f')](_0x42a29b[_0xd29e('0x30')]);if(_0x42a29b[_0xd29e('0x31')]){delete _0x42a29b[_0xd29e('0x31')];}_0x351e6b[_0xd29e('0x1f')](_0x491f26)['send'](_0x42a29b);};}exports[_0xd29e('0x32')]=function(_0x355c96,_0x274479){var _0x4b86b7={},_0x32759b={},_0x3490c6={'count':0x0,'rows':[]};var _0x111d60=_[_0xd29e('0x33')](db[_0xd29e('0x34')]['rawAttributes'],function(_0x35d685){return{'name':_0x35d685[_0xd29e('0x35')],'type':_0x35d685[_0xd29e('0x36')][_0xd29e('0x37')]};});_0x32759b[_0xd29e('0x38')]=_[_0xd29e('0x33')](_0x111d60,'name');_0x32759b[_0xd29e('0x39')]=_['keys'](_0x355c96[_0xd29e('0x39')]);_0x32759b[_0xd29e('0x3a')]=_[_0xd29e('0x3b')](_0x32759b[_0xd29e('0x38')],_0x32759b[_0xd29e('0x39')]);_0x4b86b7['attributes']=_[_0xd29e('0x3b')](_0x32759b[_0xd29e('0x38')],qs[_0xd29e('0x3c')](_0x355c96[_0xd29e('0x39')]['fields']));_0x4b86b7['attributes']=_0x4b86b7[_0xd29e('0x3d')][_0xd29e('0x3e')]?_0x4b86b7[_0xd29e('0x3d')]:_0x32759b[_0xd29e('0x38')];if(!_0x355c96['query'][_0xd29e('0x3f')](_0xd29e('0x40'))){_0x4b86b7[_0xd29e('0x23')]=qs['limit'](_0x355c96['query']['limit']);_0x4b86b7[_0xd29e('0x21')]=qs[_0xd29e('0x21')](_0x355c96[_0xd29e('0x39')]['offset']);}_0x4b86b7[_0xd29e('0x41')]=qs['sort'](_0x355c96[_0xd29e('0x39')][_0xd29e('0x42')]);_0x4b86b7[_0xd29e('0x43')]=qs[_0xd29e('0x3a')](_[_0xd29e('0x44')](_0x355c96['query'],_0x32759b[_0xd29e('0x3a')]),_0x111d60);if(_0x355c96[_0xd29e('0x39')]['filter']){_0x4b86b7[_0xd29e('0x43')]=_[_0xd29e('0x45')](_0x4b86b7[_0xd29e('0x43')],{'$or':_['map'](_0x111d60,function(_0x49978a){if(_0x49978a[_0xd29e('0x36')]!==_0xd29e('0x46')){var _0x145d1f={};_0x145d1f[_0x49978a[_0xd29e('0x31')]]={'$like':'%'+_0x355c96['query'][_0xd29e('0x47')]+'%'};return _0x145d1f;}})});}_0x4b86b7=_['merge']({},_0x4b86b7,_0x355c96[_0xd29e('0x48')]);var _0x150bf8={'where':_0x4b86b7[_0xd29e('0x43')]};return db[_0xd29e('0x34')][_0xd29e('0x24')](_0x150bf8)['then'](function(_0xa52493){_0x3490c6['count']=_0xa52493;if(_0x355c96[_0xd29e('0x39')][_0xd29e('0x49')]){_0x4b86b7[_0xd29e('0x4a')]=[{'all':!![]}];}return db[_0xd29e('0x34')][_0xd29e('0x4b')](_0x4b86b7);})[_0xd29e('0x29')](function(_0x55bca1){_0x3490c6[_0xd29e('0x4c')]=_0x55bca1;return _0x3490c6;})[_0xd29e('0x29')](respondWithFilteredResult(_0x274479,_0x4b86b7))[_0xd29e('0x4d')](handleError(_0x274479,null));};exports[_0xd29e('0x4e')]=function(_0x26a6ce,_0x5c945c){var _0x51eba0={'raw':![],'where':{'id':_0x26a6ce[_0xd29e('0x4f')]['id']}},_0x3b90f4={};_0x3b90f4[_0xd29e('0x38')]=_[_0xd29e('0x50')](db[_0xd29e('0x34')][_0xd29e('0x51')]);_0x3b90f4[_0xd29e('0x39')]=_['keys'](_0x26a6ce['query']);_0x3b90f4[_0xd29e('0x3a')]=_[_0xd29e('0x3b')](_0x3b90f4[_0xd29e('0x38')],_0x3b90f4[_0xd29e('0x39')]);_0x51eba0[_0xd29e('0x3d')]=_['intersection'](_0x3b90f4['model'],qs[_0xd29e('0x3c')](_0x26a6ce[_0xd29e('0x39')][_0xd29e('0x3c')]));_0x51eba0[_0xd29e('0x3d')]=_0x51eba0[_0xd29e('0x3d')]['length']?_0x51eba0['attributes']:_0x3b90f4[_0xd29e('0x38')];if(_0x26a6ce[_0xd29e('0x39')][_0xd29e('0x49')]){_0x51eba0['include']=[{'all':!![]}];}_0x51eba0=_[_0xd29e('0x45')]({},_0x51eba0,_0x26a6ce['options']);return db[_0xd29e('0x34')][_0xd29e('0x52')](_0x51eba0)[_0xd29e('0x29')](handleEntityNotFound(_0x5c945c,null))[_0xd29e('0x29')](respondWithResult(_0x5c945c,null))[_0xd29e('0x4d')](handleError(_0x5c945c,null));};exports['create']=function(_0x21bf01,_0x2311a6){return db[_0xd29e('0x34')]['create'](_0x21bf01[_0xd29e('0x53')],{})[_0xd29e('0x29')](function(_0x3bfa4e){var _0x318d38=_0x21bf01[_0xd29e('0x54')][_0xd29e('0x2b')]({'plain':!![]});if(!_0x318d38)throw new Error(_0xd29e('0x55'));if(_0x318d38[_0xd29e('0x56')]===_0xd29e('0x54')){var _0x3301b6=_0x3bfa4e[_0xd29e('0x2b')]({'plain':!![]});var _0x5e4c10=_0xd29e('0x2c');return db[_0xd29e('0x57')][_0xd29e('0x52')]({'where':{'name':_0x5e4c10,'userProfileId':_0x318d38[_0xd29e('0x58')]},'raw':!![]})[_0xd29e('0x29')](function(_0x10adab){if(_0x10adab&&_0x10adab[_0xd29e('0x59')]===0x0){return db[_0xd29e('0x2d')][_0xd29e('0x5a')]({'name':_0x3301b6['name'],'resourceId':_0x3301b6['id'],'type':_0x10adab['name'],'sectionId':_0x10adab['id']},{})[_0xd29e('0x29')](function(){return _0x3bfa4e;});}else{return _0x3bfa4e;}})[_0xd29e('0x4d')](function(_0x2a8e64){logger[_0xd29e('0x2f')](_0xd29e('0x5b'),_0x2a8e64);throw _0x2a8e64;});}return _0x3bfa4e;})['then'](respondWithResult(_0x2311a6,0xc9))[_0xd29e('0x4d')](handleError(_0x2311a6,null));};exports[_0xd29e('0x28')]=function(_0xb4c215,_0x13359d){if(_0xb4c215[_0xd29e('0x53')]['id']){delete _0xb4c215[_0xd29e('0x53')]['id'];}return db[_0xd29e('0x34')][_0xd29e('0x52')]({'where':{'id':_0xb4c215[_0xd29e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x13359d,null))[_0xd29e('0x29')](saveUpdates(_0xb4c215[_0xd29e('0x53')],null))[_0xd29e('0x29')](respondWithResult(_0x13359d,null))['catch'](handleError(_0x13359d,null));};exports[_0xd29e('0x2a')]=function(_0x325cf1,_0x39b668){return db[_0xd29e('0x34')][_0xd29e('0x52')]({'where':{'id':_0x325cf1[_0xd29e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x39b668,null))[_0xd29e('0x29')](removeEntity(_0x39b668,null))['catch'](handleError(_0x39b668,null));};exports['describe']=function(_0x2d100c,_0x36896f){return db['CmList'][_0xd29e('0x5c')]()[_0xd29e('0x29')](respondWithResult(_0x36896f,null))[_0xd29e('0x4d')](handleError(_0x36896f,null));};exports['addDisposition']=function(_0x18185a,_0x46782b,_0x3d7981){if(_0x18185a[_0xd29e('0x53')]['id']){delete _0x18185a[_0xd29e('0x53')]['id'];}return db[_0xd29e('0x34')][_0xd29e('0x52')]({'where':{'id':_0x18185a['params']['id']}})[_0xd29e('0x29')](handleEntityNotFound(_0x46782b,null))['then'](function(_0x290e55){if(_0x290e55){_0x18185a[_0xd29e('0x53')][_0xd29e('0x5d')]=_0x290e55['id'];return db['Disposition'][_0xd29e('0x5a')](_0x18185a['body']);}})[_0xd29e('0x29')](respondWithResult(_0x46782b,null))[_0xd29e('0x4d')](handleError(_0x46782b,null));};exports[_0xd29e('0x5e')]=function(_0x3f8bc9,_0xefe83,_0x256702){var _0x5944b6={'raw':![],'where':{}};var _0x5433a5={};var _0x4994e4={'count':0x0,'rows':[]};return db[_0xd29e('0x34')][_0xd29e('0x5f')]({'where':{'id':_0x3f8bc9[_0xd29e('0x4f')]['id']}})['then'](handleEntityNotFound(_0xefe83,null))[_0xd29e('0x29')](function(_0x55d430){if(_0x55d430){_0x5433a5['model']=_[_0xd29e('0x50')](db[_0xd29e('0x60')][_0xd29e('0x51')]);_0x5433a5[_0xd29e('0x39')]=_[_0xd29e('0x50')](_0x3f8bc9[_0xd29e('0x39')]);_0x5433a5[_0xd29e('0x3a')]=_[_0xd29e('0x3b')](_0x5433a5[_0xd29e('0x38')],_0x5433a5[_0xd29e('0x39')]);_0x5944b6[_0xd29e('0x3d')]=_['intersection'](_0x5433a5['model'],qs[_0xd29e('0x3c')](_0x3f8bc9[_0xd29e('0x39')][_0xd29e('0x3c')]));_0x5944b6[_0xd29e('0x3d')]=_0x5944b6[_0xd29e('0x3d')][_0xd29e('0x3e')]?_0x5944b6[_0xd29e('0x3d')]:_0x5433a5[_0xd29e('0x38')];if(!_0x3f8bc9[_0xd29e('0x39')][_0xd29e('0x3f')]('nolimit')){_0x5944b6[_0xd29e('0x23')]=qs['limit'](_0x3f8bc9[_0xd29e('0x39')][_0xd29e('0x23')]);_0x5944b6['offset']=qs[_0xd29e('0x21')](_0x3f8bc9[_0xd29e('0x39')][_0xd29e('0x21')]);}_0x5944b6[_0xd29e('0x41')]=qs[_0xd29e('0x42')](_0x3f8bc9[_0xd29e('0x39')]['sort']);_0x5944b6[_0xd29e('0x43')]=qs[_0xd29e('0x3a')](_[_0xd29e('0x44')](_0x3f8bc9['query'],_0x5433a5['filters']));_0x5944b6[_0xd29e('0x43')]['ListId']=_0x55d430['id'];if(_0x3f8bc9['query'][_0xd29e('0x47')]){_0x5944b6[_0xd29e('0x43')]=_['merge'](_0x5944b6['where'],{'$or':_[_0xd29e('0x33')](_0x5944b6[_0xd29e('0x3d')],function(_0x101b98){var _0x200544={};_0x200544[_0x101b98]={'$like':'%'+_0x3f8bc9[_0xd29e('0x39')]['filter']+'%'};return _0x200544;})});}_0x5944b6=_[_0xd29e('0x45')]({},_0x5944b6,_0x3f8bc9[_0xd29e('0x48')]);return db[_0xd29e('0x60')][_0xd29e('0x24')]({'where':_0x5944b6[_0xd29e('0x43')]})['then'](function(_0x3a26fb){_0x4994e4[_0xd29e('0x24')]=_0x3a26fb;if(_0x3f8bc9[_0xd29e('0x39')][_0xd29e('0x49')]){_0x5944b6[_0xd29e('0x4a')]=[{'all':!![]}];}return db[_0xd29e('0x60')][_0xd29e('0x4b')](_0x5944b6);})['then'](function(_0x1ce819){_0x4994e4[_0xd29e('0x4c')]=_0x1ce819;return _0x4994e4;});}})[_0xd29e('0x29')](respondWithFilteredResult(_0xefe83,_0x5944b6))[_0xd29e('0x4d')](handleError(_0xefe83,null));};exports['removeDispositions']=function(_0x1c2673,_0x54243c,_0x4bcf37){return db['CmList'][_0xd29e('0x52')]({'where':{'id':_0x1c2673[_0xd29e('0x4f')]['id']}})[_0xd29e('0x29')](handleEntityNotFound(_0x54243c,null))['then'](function(_0x32c679){if(_0x32c679){return _0x32c679[_0xd29e('0x61')](_0x1c2673[_0xd29e('0x39')]['ids']);}})[_0xd29e('0x29')](respondWithStatusCode(_0x54243c,null))[_0xd29e('0x4d')](handleError(_0x54243c,null));};exports[_0xd29e('0x62')]=function(_0x41bffb,_0x417616,_0x6386e){return db[_0xd29e('0x34')][_0xd29e('0x52')]({'where':{'id':_0x41bffb[_0xd29e('0x4f')]['id']}})[_0xd29e('0x29')](handleEntityNotFound(_0x417616,null))['then'](function(_0x10b40e){if(_0x10b40e){var _0x46fd87=[];var _0x41ed9f={'success':[],'errors':[]};return db[_0xd29e('0x63')][_0xd29e('0x5c')]()[_0xd29e('0x29')](function(_0x3603ff){if(_0x41bffb[_0xd29e('0x53')][_0xd29e('0x64')]&&_['isArray'](_0x41bffb[_0xd29e('0x53')]['tags'])){if(_0x41bffb[_0xd29e('0x53')]['tags'][_0xd29e('0x3e')]){_0x41bffb['body']['tags']=_0x41bffb[_0xd29e('0x53')]['tags'][_0xd29e('0x65')](';')+';';}else{_0x41bffb[_0xd29e('0x53')][_0xd29e('0x64')]=null;}}else{_0x41bffb[_0xd29e('0x53')][_0xd29e('0x64')]=null;}if(_0x41bffb['body']&&_[_0xd29e('0x66')](_0x41bffb[_0xd29e('0x53')])){for(var _0x1ea1a4=0x0;_0x1ea1a4<_0x41bffb[_0xd29e('0x53')][_0xd29e('0x3e')];_0x1ea1a4+=0x1){_0x41bffb[_0xd29e('0x53')][_0x1ea1a4][_0xd29e('0x5d')]=_0x41bffb['params']['id'];_0x46fd87[_0xd29e('0x67')](_0x41bffb[_0xd29e('0x53')][_0x1ea1a4]);}return BPromise['each'](_0x46fd87,function(_0x342549){return db[_0xd29e('0x63')][_0xd29e('0x5a')](_[_0xd29e('0x68')](_0x342549,[_0xd29e('0x69'),'id'])||{},{'fields':_[_0xd29e('0x50')](_0x3603ff),'raw':!![]})['then'](function(_0x24276e){_0x41ed9f[_0xd29e('0x6a')][_0xd29e('0x67')](_0x24276e[_0xd29e('0x6b')]);})['catch'](function(_0x5e65c5){_0x41ed9f[_0xd29e('0x6c')][_0xd29e('0x67')]({'data':_0x342549,'error':_0x5e65c5[_0xd29e('0x6d')]});});})[_0xd29e('0x29')](function(_0xeaf846){return _0x41ed9f;})[_0xd29e('0x4d')](function(_0x3ec5b5){return _0x3ec5b5;});}else{_0x417616[_0xd29e('0x1f')](0x190)[_0xd29e('0x20')]({'message':_0xd29e('0x6e')});}});}})[_0xd29e('0x29')](respondWithResult(_0x417616,null))[_0xd29e('0x4d')](handleError(_0x417616,null));};exports[_0xd29e('0x6f')]=function(_0x3e1b28,_0xbbfd8a,_0x1db2e8){var _0x1db8a9;return db[_0xd29e('0x34')][_0xd29e('0x52')]({'where':{'id':_0x3e1b28[_0xd29e('0x4f')]['id']},'include':[{'model':db[_0xd29e('0x70')],'as':'CustomFields'}]})['then'](handleEntityNotFound(_0xbbfd8a,null))['then'](function(_0x3b888a){if(_0x3b888a){_0x1db8a9=_0x3b888a;return db[_0xd29e('0x63')][_0xd29e('0x51')];}})['then'](function(_0x47c106){if(_0x47c106){var _0x3c0397={};var _0x7dd58c={};_0x7dd58c['model']=_[_0xd29e('0x71')](_['keys'](_0x47c106),_[_0xd29e('0x33')](_0x1db8a9[_0xd29e('0x72')],function(_0x2675e8){return util[_0xd29e('0x73')]('cf_%d',_0x2675e8['id']);}));_0x7dd58c[_0xd29e('0x39')]=_[_0xd29e('0x50')](_0x3e1b28['query']);_0x7dd58c[_0xd29e('0x3a')]=_[_0xd29e('0x3b')](_0x7dd58c[_0xd29e('0x38')],_0x7dd58c[_0xd29e('0x39')]);_0x3c0397['attributes']=_['intersection'](_0x7dd58c[_0xd29e('0x38')],qs[_0xd29e('0x3c')](_0x3e1b28[_0xd29e('0x39')][_0xd29e('0x3c')]));_0x3c0397[_0xd29e('0x3d')]=_0x3c0397[_0xd29e('0x3d')][_0xd29e('0x3e')]?_0x3c0397[_0xd29e('0x3d')]:_0x7dd58c[_0xd29e('0x38')];if(!_0x3e1b28['query'][_0xd29e('0x3f')]('nolimit')){_0x3c0397[_0xd29e('0x23')]=qs['limit'](_0x3e1b28['query']['limit']);_0x3c0397['offset']=qs[_0xd29e('0x21')](_0x3e1b28[_0xd29e('0x39')][_0xd29e('0x21')]);}_0x3c0397['order']=qs['sort'](_0x3e1b28[_0xd29e('0x39')][_0xd29e('0x42')]);_0x3c0397[_0xd29e('0x43')]=qs['filters'](_[_0xd29e('0x44')](_0x3e1b28['query'],_0x7dd58c['filters']));_0x3c0397[_0xd29e('0x74')]=!![];if(_0x3e1b28[_0xd29e('0x39')][_0xd29e('0x47')]){_0x3c0397[_0xd29e('0x43')]=_[_0xd29e('0x45')](_0x3c0397['where'],{'$or':_[_0xd29e('0x33')](_0x3c0397[_0xd29e('0x3d')],function(_0xc47764){var _0x5c8a3e={};_0x5c8a3e[_0xc47764]={'$like':'%'+_0x3e1b28[_0xd29e('0x39')][_0xd29e('0x47')]+'%'};return _0x5c8a3e;})});}_0x3c0397=_[_0xd29e('0x45')]({},_0x3c0397,_0x3e1b28['options']);return _0x1db8a9[_0xd29e('0x6f')](_0x3c0397);}})[_0xd29e('0x29')](respondWithResult(_0xbbfd8a,null))['catch'](handleError(_0xbbfd8a,null));};exports[_0xd29e('0x75')]=function(_0x1943fa,_0xab2492,_0x245470){var _0x583712;var _0x4038da;var _0x3a44c3;var _0x42c1ea=_0x1943fa['params']['id'];csv_results=[];return db[_0xd29e('0x76')]['findAll']({'attributes':['id','name'],'raw':!![],'order':['OrderBy']})[_0xd29e('0x29')](function(_0x507e2d){_0x583712=_0x507e2d;var _0x519bc2=_[_0xd29e('0x50')](db[_0xd29e('0x63')][_0xd29e('0x51')]);return db['CmCustomField']['findAll']({'raw':!![],'attributes':['id',_0xd29e('0x77')]})['then'](function(_0x37668f){_0x4038da=_0x37668f;var _0x478312=squel[_0xd29e('0x78')]()['fields'](_0x519bc2)[_0xd29e('0x79')](_0xd29e('0x7a'),'c')[_0xd29e('0x43')](_0xd29e('0x7b'),_0x42c1ea)['where'](_0xd29e('0x7c'))[_0xd29e('0x7d')]();for(var _0x34035b=0x0;_0x34035b<_0x4038da[_0xd29e('0x3e')];_0x34035b++){_0x478312[_0xd29e('0x7e')]('c.cf_'+_0x4038da[_0x34035b]['id'],_0xd29e('0x7f')+_0x4038da[_0x34035b]['alias']);}for(var _0x34035b=0x0;_0x34035b<_0x583712[_0xd29e('0x3e')];_0x34035b++){_0x478312['field'](squel[_0xd29e('0x78')]()[_0xd29e('0x7e')](_0xd29e('0x80'))[_0xd29e('0x79')](_0xd29e('0x81'))['where'](_0xd29e('0x82'),_0x583712[_0x34035b]['id'])[_0xd29e('0x43')](_0xd29e('0x83')),_0xd29e('0x84')+_0x583712[_0x34035b][_0xd29e('0x31')]);_0x478312[_0xd29e('0x7e')](squel[_0xd29e('0x78')]()[_0xd29e('0x7e')]('description')[_0xd29e('0x79')]('cm_contact_has_items')['where'](_0xd29e('0x82'),_0x583712[_0x34035b]['id'])[_0xd29e('0x43')](_0xd29e('0x83')),_0xd29e('0x85')+_0x583712[_0x34035b][_0xd29e('0x31')]);}var _0x272984=[];_0x272984[_0xd29e('0x67')](_0x478312[_0xd29e('0x86')]());BPromise[_0xd29e('0x87')](_0x272984,handleQuery)[_0xd29e('0x29')](function(_0x54aee3){handleQuery(_0x478312[_0xd29e('0x86')]());var _0x516eed=csv_results[0x0];if(!_['isEmpty'](_0x516eed)){var _0xfad30e=toCsv(_0x516eed);var _0x439655=Date[_0xd29e('0x88')]();fs[_0xd29e('0x89')](util[_0xd29e('0x73')](_0xd29e('0x8a'),_0x42c1ea,_0x439655),_0xfad30e);_0xab2492[_0xd29e('0x8b')](_0xd29e('0x8c'),_0xd29e('0x8d')+util[_0xd29e('0x73')]('list_%d_%s.csv',_0x42c1ea,_0x439655));_0xab2492['setHeader'](_0xd29e('0x8e'),_0xd29e('0x8f'));return _0xab2492[_0xd29e('0x90')](util[_0xd29e('0x73')](_0xd29e('0x8a'),_0x42c1ea,_0x439655));}else{return _0xab2492[_0xd29e('0x1e')](0xcc);}});});});};exports[_0xd29e('0x91')]=function(_0x5c6475,_0x4816b6,_0x21b477){var _0x59ffe3;delete _0x5c6475[_0xd29e('0x53')]['id'];return db[_0xd29e('0x34')][_0xd29e('0x5f')]({'where':{'id':_0x5c6475[_0xd29e('0x4f')]['id']}})[_0xd29e('0x29')](handleEntityNotFound(_0x4816b6,null))['then'](function(_0x1235b2){if(_0x1235b2){return db[_0xd29e('0x92')][_0xd29e('0x93')](function(_0x2233c7){return db[_0xd29e('0x70')]['create'](_0x5c6475['body'],{'transaction':_0x2233c7})[_0xd29e('0x29')](function(_0xf84d05){_0x59ffe3=_0xf84d05;return _0x1235b2['addCustomFields'](_0xf84d05,{'transaction':_0x2233c7});})[_0xd29e('0x29')](function(){var _0x5bd077={'type':db[_0xd29e('0x94')][_0xd29e('0x95')],'transaction':_0x2233c7};switch(_0x5c6475['body'][_0xd29e('0x36')]){case _0xd29e('0x96'):_0x5bd077[_0xd29e('0x36')]=db['Sequelize'][_0xd29e('0x95')];break;case'number':_0x5bd077[_0xd29e('0x36')]=db[_0xd29e('0x94')][_0xd29e('0x97')];break;case _0xd29e('0x98'):_0x5bd077[_0xd29e('0x36')]=db[_0xd29e('0x94')]['BOOLEAN'];_0x5bd077['defaultValue']=![];break;default:}return db[_0xd29e('0x92')]['queryInterface'][_0xd29e('0x99')](_0xd29e('0x7a'),util[_0xd29e('0x73')](_0xd29e('0x9a'),_0x59ffe3['id']),_0x5bd077);})[_0xd29e('0x29')](function(){return _0x59ffe3;});});}})[_0xd29e('0x29')](respondWithResult(_0x4816b6,null))['catch'](handleError(_0x4816b6,null));};exports['getCustomFields']=function(_0x3184e5,_0x3f5548,_0x24bf95){var _0x1c8bac={};var _0x43652e={};var _0x45b475;var _0x402afb;return db[_0xd29e('0x34')][_0xd29e('0x5f')]({'where':{'id':_0x3184e5[_0xd29e('0x4f')]['id']}})[_0xd29e('0x29')](handleEntityNotFound(_0x3f5548,null))[_0xd29e('0x29')](function(_0x3c578d){if(_0x3c578d){_0x45b475=_0x3c578d;_0x43652e[_0xd29e('0x38')]=_[_0xd29e('0x50')](db[_0xd29e('0x70')][_0xd29e('0x51')]);_0x43652e['query']=_[_0xd29e('0x50')](_0x3184e5[_0xd29e('0x39')]);_0x43652e[_0xd29e('0x3a')]=_[_0xd29e('0x3b')](_0x43652e[_0xd29e('0x38')],_0x43652e[_0xd29e('0x39')]);_0x1c8bac['attributes']=_[_0xd29e('0x3b')](_0x43652e[_0xd29e('0x38')],qs['fields'](_0x3184e5[_0xd29e('0x39')][_0xd29e('0x3c')]));_0x1c8bac['attributes']=_0x1c8bac[_0xd29e('0x3d')][_0xd29e('0x3e')]?_0x1c8bac[_0xd29e('0x3d')]:_0x43652e['model'];_0x1c8bac[_0xd29e('0x41')]=qs[_0xd29e('0x42')](_0x3184e5['query']['sort']);_0x1c8bac[_0xd29e('0x43')]=qs['filters'](_[_0xd29e('0x44')](_0x3184e5[_0xd29e('0x39')],_0x43652e[_0xd29e('0x3a')]));_0x1c8bac[_0xd29e('0x43')]=_[_0xd29e('0x45')](_0x1c8bac[_0xd29e('0x43')],{'$or':[{'ListId':_0x3c578d['id']},{'ListId':null}]});if(_0x3184e5[_0xd29e('0x39')][_0xd29e('0x47')]){_0x1c8bac[_0xd29e('0x43')]=_[_0xd29e('0x45')](_0x1c8bac['where'],{'$or':_['map'](_0x1c8bac[_0xd29e('0x3d')],function(_0x1a1c50){var _0x47d68c={};_0x47d68c[_0x1a1c50]={'$like':'%'+_0x3184e5['query'][_0xd29e('0x47')]+'%'};return _0x47d68c;})});}_0x1c8bac=_[_0xd29e('0x45')]({},_0x1c8bac,_0x3184e5[_0xd29e('0x48')]);return db['CmCustomField'][_0xd29e('0x9b')](_0x1c8bac);}})[_0xd29e('0x29')](respondWithResult(_0x3f5548,null))[_0xd29e('0x4d')](handleError(_0x3f5548,null));};exports['getGlobalCustomFields']=function(_0x4d359a,_0x5111fa){return db['CmCustomField'][_0xd29e('0x9b')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x5111fa,null))[_0xd29e('0x29')](function(_0x1b727c){return _0x1b727c;})['then'](respondWithResult(_0x5111fa,null))[_0xd29e('0x4d')](handleError(_0x5111fa,null));};exports[_0xd29e('0x9c')]=function(_0x56542f,_0x4e3324,_0x251473){return db['CmList'][_0xd29e('0x52')]({'where':{'id':_0x56542f[_0xd29e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4e3324,null))[_0xd29e('0x29')](function(_0x460f69){if(_0x460f69){return _0x460f69[_0xd29e('0x9c')](_0x56542f[_0xd29e('0x53')]['ids'],_[_0xd29e('0x68')](_0x56542f[_0xd29e('0x53')],[_0xd29e('0x69'),'id'])||{})['spread'](function(_0x27001c){for(var _0xa47a82=0x0;_0xa47a82<_0x56542f[_0xd29e('0x53')][_0xd29e('0x69')][_0xd29e('0x3e')];_0xa47a82+=0x1){socket[_0xd29e('0x9d')]('userCmList:save',{'UserId':Number(_0x56542f[_0xd29e('0x53')][_0xd29e('0x69')][_0xa47a82]),'CmListId':Number(_0x56542f[_0xd29e('0x4f')]['id'])});}return _0x27001c;});}})[_0xd29e('0x29')](respondWithResult(_0x4e3324,null))[_0xd29e('0x4d')](handleError(_0x4e3324,null));};exports[_0xd29e('0x9e')]=function(_0x7c4dbd,_0x22c307,_0x2f22e9){return db[_0xd29e('0x34')][_0xd29e('0x52')]({'where':{'id':_0x7c4dbd[_0xd29e('0x4f')]['id']}})[_0xd29e('0x29')](handleEntityNotFound(_0x22c307,null))[_0xd29e('0x29')](function(_0x48b168){if(_0x48b168){return _0x48b168[_0xd29e('0x9e')](_0x7c4dbd[_0xd29e('0x39')][_0xd29e('0x69')])[_0xd29e('0x29')](function(){if(_[_0xd29e('0x66')](_0x7c4dbd[_0xd29e('0x39')][_0xd29e('0x69')])){for(var _0x3cf094=0x0;_0x3cf094<_0x7c4dbd[_0xd29e('0x39')][_0xd29e('0x69')][_0xd29e('0x3e')];_0x3cf094+=0x1){socket[_0xd29e('0x9d')](_0xd29e('0x9f'),{'UserId':Number(_0x7c4dbd[_0xd29e('0x39')][_0xd29e('0x69')][_0x3cf094]),'CmListId':Number(_0x7c4dbd['params']['id'])});}}else{socket[_0xd29e('0x9d')](_0xd29e('0x9f'),{'UserId':Number(_0x7c4dbd[_0xd29e('0x39')][_0xd29e('0x69')]),'CmListId':Number(_0x7c4dbd[_0xd29e('0x4f')]['id'])});}});}})[_0xd29e('0x29')](respondWithStatusCode(_0x22c307,null))[_0xd29e('0x4d')](handleError(_0x22c307,null));};exports[_0xd29e('0xa0')]=function(_0x16d39f,_0x2eef41,_0x2834c7){var _0x3d1c69={};var _0x4f6521={};var _0x767fbe;var _0x1a48ca;return db[_0xd29e('0x34')][_0xd29e('0x5f')]({'where':{'id':_0x16d39f[_0xd29e('0x4f')]['id']}})[_0xd29e('0x29')](handleEntityNotFound(_0x2eef41,null))[_0xd29e('0x29')](function(_0x25f961){if(_0x25f961){_0x767fbe=_0x25f961;_0x4f6521[_0xd29e('0x38')]=_[_0xd29e('0x50')](db[_0xd29e('0xa1')][_0xd29e('0x51')]);_0x4f6521[_0xd29e('0x39')]=_[_0xd29e('0x50')](_0x16d39f['query']);_0x4f6521[_0xd29e('0x3a')]=_[_0xd29e('0x3b')](_0x4f6521[_0xd29e('0x38')],_0x4f6521[_0xd29e('0x39')]);_0x3d1c69['attributes']=_[_0xd29e('0x3b')](_0x4f6521[_0xd29e('0x38')],qs[_0xd29e('0x3c')](_0x16d39f[_0xd29e('0x39')][_0xd29e('0x3c')]));_0x3d1c69[_0xd29e('0x3d')]=_0x3d1c69[_0xd29e('0x3d')][_0xd29e('0x3e')]?_0x3d1c69[_0xd29e('0x3d')]:_0x4f6521['model'];_0x3d1c69['order']=qs[_0xd29e('0x42')](_0x16d39f[_0xd29e('0x39')][_0xd29e('0x42')]);_0x3d1c69['where']=qs[_0xd29e('0x3a')](_['pick'](_0x16d39f[_0xd29e('0x39')],_0x4f6521[_0xd29e('0x3a')]));if(_0x16d39f['query'][_0xd29e('0x47')]){_0x3d1c69['where']=_[_0xd29e('0x45')](_0x3d1c69[_0xd29e('0x43')],{'$or':_[_0xd29e('0x33')](_0x3d1c69[_0xd29e('0x3d')],function(_0x3d81e1){var _0x2cfb2d={};_0x2cfb2d[_0x3d81e1]={'$like':'%'+_0x16d39f[_0xd29e('0x39')][_0xd29e('0x47')]+'%'};return _0x2cfb2d;})});}_0x3d1c69=_[_0xd29e('0x45')]({},_0x3d1c69,_0x16d39f[_0xd29e('0x48')]);return _0x767fbe[_0xd29e('0xa0')](_0x3d1c69);}})['then'](function(_0x189045){if(_0x189045){_0x1a48ca=_0x189045[_0xd29e('0x3e')];if(!_0x16d39f[_0xd29e('0x39')][_0xd29e('0x3f')](_0xd29e('0x40'))){_0x3d1c69['limit']=qs[_0xd29e('0x23')](_0x16d39f[_0xd29e('0x39')][_0xd29e('0x23')]);_0x3d1c69['offset']=qs[_0xd29e('0x21')](_0x16d39f[_0xd29e('0x39')][_0xd29e('0x21')]);}return _0x767fbe[_0xd29e('0xa0')](_0x3d1c69);}})['then'](function(_0xef9cb5){if(_0xef9cb5){return _0xef9cb5?{'count':_0x1a48ca,'rows':_0xef9cb5}:null;}})[_0xd29e('0x29')](respondWithResult(_0x2eef41,null))[_0xd29e('0x4d')](handleError(_0x2eef41,null));};function handleQuery(_0x1802a7){logger[_0xd29e('0xa2')](_0x1802a7);return db[_0xd29e('0x92')][_0xd29e('0x39')](_0x1802a7)[_0xd29e('0xa3')](function(_0x4edbc4){csv_results[_0xd29e('0x67')](_0x4edbc4);})[_0xd29e('0x4d')](function(_0x33c9fb){logger['error'](_0x33c9fb['message']);});} \ No newline at end of file +var _0x7214=['cm_contact_has_items','CmContactId\x20=\x20c.id','additionalPhone_','description','from','ItemTypeId\x20=\x20?','description_additionalPhone_','toString','now','writeFileSync','setHeader','list_%d_%s.csv','Content-type','text/csv','download','/tmp/list_%d_%s.csv','findOne','sequelize','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','getCustomFields','findAndCountAll','addAgents','omit','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','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/license/util','redis','defaults','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','Lists','UserProfileResource','error','stack','send','map','CmList','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','ListId','Disposition','getDispositions','nolimit','pick','rows','removeDispositions','ids','addContacts','CmContact','isArray','tags','join','push','each','dataValues','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','format','cf_%d','raw','getContactsCsv','ContactItemType','OrderBy','select','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','c.cf_','customField_','field','item'];(function(_0x43c232,_0x2a50ac){var _0x34a159=function(_0x5e2f54){while(--_0x5e2f54){_0x43c232['push'](_0x43c232['shift']());}};_0x34a159(++_0x2a50ac);}(_0x7214,0x172));var _0x4721=function(_0x5ada29,_0x339d44){_0x5ada29=_0x5ada29-0x0;var _0xb65f3=_0x7214[_0x5ada29];return _0xb65f3;};'use strict';var emlformat=require(_0x4721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4721('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4721('0x2'));var moment=require(_0x4721('0x3'));var BPromise=require(_0x4721('0x4'));var Mustache=require(_0x4721('0x5'));var util=require('util');var path=require(_0x4721('0x6'));var sox=require(_0x4721('0x7'));var csv=require(_0x4721('0x8'));var ejs=require(_0x4721('0x9'));var fs=require('fs');var fs_extra=require(_0x4721('0xa'));var _=require(_0x4721('0xb'));var squel=require(_0x4721('0xc'));var crypto=require(_0x4721('0xd'));var jsforce=require(_0x4721('0xe'));var deskjs=require(_0x4721('0xf'));var toCsv=require(_0x4721('0x8'));var querystring=require(_0x4721('0x10'));var Papa=require('papaparse');var Redis=require(_0x4721('0x11'));var authService=require(_0x4721('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4721('0x13'));var hardwareService=require(_0x4721('0x14'));var logger=require(_0x4721('0x15'))(_0x4721('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4721('0x17'));var db=require('../../mysqldb')['db'];var csv_results;config[_0x4721('0x18')]=_[_0x4721('0x19')](config['redis'],{'host':_0x4721('0x1a'),'port':0x18eb});var socket=require(_0x4721('0x1b'))(new Redis(config['redis']));require(_0x4721('0x1c'))['register'](socket);function respondWithStatusCode(_0x424ab7,_0xd80705){_0xd80705=_0xd80705||0xcc;return function(_0xcd5148){if(_0xcd5148){return _0x424ab7[_0x4721('0x1d')](_0xd80705);}return _0x424ab7[_0x4721('0x1e')](_0xd80705)[_0x4721('0x1f')]();};}function respondWithResult(_0x3abf49,_0x40ab94){_0x40ab94=_0x40ab94||0xc8;return function(_0x518432){if(_0x518432){return _0x3abf49['status'](_0x40ab94)[_0x4721('0x20')](_0x518432);}};}function respondWithFilteredResult(_0xe72698,_0x3f096b){return function(_0x2f3e49){if(_0x2f3e49){var _0x553575=typeof _0x3f096b[_0x4721('0x21')]===_0x4721('0x22')&&typeof _0x3f096b[_0x4721('0x23')]===_0x4721('0x22');var _0x4043f1=_0x2f3e49[_0x4721('0x24')];var _0x35b563=_0x553575?0x0:_0x3f096b[_0x4721('0x21')];var _0x2efb2a=_0x553575?_0x2f3e49[_0x4721('0x24')]:_0x3f096b['offset']+_0x3f096b[_0x4721('0x23')];var _0x4e4a77;if(_0x2efb2a>=_0x4043f1){_0x2efb2a=_0x4043f1;_0x4e4a77=0xc8;}else{_0x4e4a77=0xce;}_0xe72698[_0x4721('0x1e')](_0x4e4a77);return _0xe72698[_0x4721('0x25')]('Content-Range',_0x35b563+'-'+_0x2efb2a+'/'+_0x4043f1)[_0x4721('0x20')](_0x2f3e49);}return null;};}function patchUpdates(_0x2b250c){return function(_0xd3b253){try{jsonpatch[_0x4721('0x26')](_0xd3b253,_0x2b250c,!![]);}catch(_0x27fb94){return BPromise['reject'](_0x27fb94);}return _0xd3b253[_0x4721('0x27')]();};}function saveUpdates(_0x242d10,_0x2e69dd){return function(_0x52d6f7){if(_0x52d6f7){return _0x52d6f7[_0x4721('0x28')](_0x242d10)[_0x4721('0x29')](function(_0x24179c){return _0x24179c;});}return null;};}function removeEntity(_0x32b323,_0x3fa35d){return function(_0x3fd646){if(_0x3fd646){return _0x3fd646['destroy']()[_0x4721('0x29')](function(){var _0x30d9c8=_0x3fd646['get']({'plain':!![]});var _0x35055e=_0x4721('0x2a');return db[_0x4721('0x2b')]['destroy']({'where':{'type':_0x35055e,'resourceId':_0x30d9c8['id']}})[_0x4721('0x29')](function(){return _0x3fd646;});})[_0x4721('0x29')](function(){_0x32b323[_0x4721('0x1e')](0xcc)[_0x4721('0x1f')]();});}};}function handleEntityNotFound(_0x9c5a98,_0xb20aca){return function(_0x40506f){if(!_0x40506f){_0x9c5a98[_0x4721('0x1d')](0x194);}return _0x40506f;};}function handleError(_0xf6878a,_0x1e2d8d){_0x1e2d8d=_0x1e2d8d||0x1f4;return function(_0x25a647){logger[_0x4721('0x2c')](_0x25a647[_0x4721('0x2d')]);if(_0x25a647['name']){delete _0x25a647['name'];}_0xf6878a[_0x4721('0x1e')](_0x1e2d8d)[_0x4721('0x2e')](_0x25a647);};}exports['index']=function(_0x4630f4,_0x6fd09b){var _0x4bad69={},_0x261d6e={},_0x1aa863={'count':0x0,'rows':[]};var _0x26d9dd=_[_0x4721('0x2f')](db[_0x4721('0x30')]['rawAttributes'],function(_0x42e697){return{'name':_0x42e697[_0x4721('0x31')],'type':_0x42e697[_0x4721('0x32')][_0x4721('0x33')]};});_0x261d6e['model']=_['map'](_0x26d9dd,_0x4721('0x34'));_0x261d6e[_0x4721('0x35')]=_[_0x4721('0x36')](_0x4630f4[_0x4721('0x35')]);_0x261d6e[_0x4721('0x37')]=_[_0x4721('0x38')](_0x261d6e[_0x4721('0x39')],_0x261d6e[_0x4721('0x35')]);_0x4bad69[_0x4721('0x3a')]=_[_0x4721('0x38')](_0x261d6e[_0x4721('0x39')],qs[_0x4721('0x3b')](_0x4630f4[_0x4721('0x35')][_0x4721('0x3b')]));_0x4bad69['attributes']=_0x4bad69[_0x4721('0x3a')][_0x4721('0x3c')]?_0x4bad69[_0x4721('0x3a')]:_0x261d6e[_0x4721('0x39')];if(!_0x4630f4['query'][_0x4721('0x3d')]('nolimit')){_0x4bad69[_0x4721('0x23')]=qs[_0x4721('0x23')](_0x4630f4[_0x4721('0x35')]['limit']);_0x4bad69[_0x4721('0x21')]=qs[_0x4721('0x21')](_0x4630f4[_0x4721('0x35')][_0x4721('0x21')]);}_0x4bad69[_0x4721('0x3e')]=qs['sort'](_0x4630f4[_0x4721('0x35')][_0x4721('0x3f')]);_0x4bad69[_0x4721('0x40')]=qs[_0x4721('0x37')](_['pick'](_0x4630f4[_0x4721('0x35')],_0x261d6e[_0x4721('0x37')]),_0x26d9dd);if(_0x4630f4['query'][_0x4721('0x41')]){_0x4bad69[_0x4721('0x40')]=_[_0x4721('0x42')](_0x4bad69['where'],{'$or':_['map'](_0x26d9dd,function(_0xe7eaf0){if(_0xe7eaf0[_0x4721('0x32')]!==_0x4721('0x43')){var _0x5711ce={};_0x5711ce[_0xe7eaf0['name']]={'$like':'%'+_0x4630f4['query'][_0x4721('0x41')]+'%'};return _0x5711ce;}})});}_0x4bad69=_[_0x4721('0x42')]({},_0x4bad69,_0x4630f4[_0x4721('0x44')]);var _0x26a250={'where':_0x4bad69[_0x4721('0x40')]};return db['CmList'][_0x4721('0x24')](_0x26a250)[_0x4721('0x29')](function(_0x2c511b){_0x1aa863[_0x4721('0x24')]=_0x2c511b;if(_0x4630f4[_0x4721('0x35')][_0x4721('0x45')]){_0x4bad69[_0x4721('0x46')]=[{'all':!![]}];}return db['CmList'][_0x4721('0x47')](_0x4bad69);})[_0x4721('0x29')](function(_0x585e58){_0x1aa863['rows']=_0x585e58;return _0x1aa863;})['then'](respondWithFilteredResult(_0x6fd09b,_0x4bad69))[_0x4721('0x48')](handleError(_0x6fd09b,null));};exports['show']=function(_0x25faad,_0x54804d){var _0x483513={'raw':![],'where':{'id':_0x25faad[_0x4721('0x49')]['id']}},_0x34fb97={};_0x34fb97[_0x4721('0x39')]=_[_0x4721('0x36')](db[_0x4721('0x30')][_0x4721('0x4a')]);_0x34fb97[_0x4721('0x35')]=_['keys'](_0x25faad['query']);_0x34fb97['filters']=_[_0x4721('0x38')](_0x34fb97[_0x4721('0x39')],_0x34fb97[_0x4721('0x35')]);_0x483513[_0x4721('0x3a')]=_['intersection'](_0x34fb97[_0x4721('0x39')],qs[_0x4721('0x3b')](_0x25faad[_0x4721('0x35')][_0x4721('0x3b')]));_0x483513['attributes']=_0x483513[_0x4721('0x3a')][_0x4721('0x3c')]?_0x483513['attributes']:_0x34fb97['model'];if(_0x25faad[_0x4721('0x35')]['includeAll']){_0x483513[_0x4721('0x46')]=[{'all':!![]}];}_0x483513=_[_0x4721('0x42')]({},_0x483513,_0x25faad['options']);return db[_0x4721('0x30')][_0x4721('0x4b')](_0x483513)[_0x4721('0x29')](handleEntityNotFound(_0x54804d,null))['then'](respondWithResult(_0x54804d,null))[_0x4721('0x48')](handleError(_0x54804d,null));};exports[_0x4721('0x4c')]=function(_0x100576,_0x7aa4d4){return db[_0x4721('0x30')][_0x4721('0x4c')](_0x100576[_0x4721('0x4d')],{})[_0x4721('0x29')](function(_0x3082a8){var _0xd2ce70=_0x100576[_0x4721('0x4e')][_0x4721('0x4f')]({'plain':!![]});if(!_0xd2ce70)throw new Error(_0x4721('0x50'));if(_0xd2ce70[_0x4721('0x51')]===_0x4721('0x4e')){var _0x19c56b=_0x3082a8[_0x4721('0x4f')]({'plain':!![]});var _0x49c5e8=_0x4721('0x2a');return db[_0x4721('0x52')][_0x4721('0x4b')]({'where':{'name':_0x49c5e8,'userProfileId':_0xd2ce70['userProfileId']},'raw':!![]})[_0x4721('0x29')](function(_0x4172d8){if(_0x4172d8&&_0x4172d8[_0x4721('0x53')]===0x0){return db['UserProfileResource'][_0x4721('0x4c')]({'name':_0x19c56b[_0x4721('0x34')],'resourceId':_0x19c56b['id'],'type':_0x4172d8['name'],'sectionId':_0x4172d8['id']},{})[_0x4721('0x29')](function(){return _0x3082a8;});}else{return _0x3082a8;}})[_0x4721('0x48')](function(_0x30ff62){logger[_0x4721('0x2c')](_0x4721('0x54'),_0x30ff62);throw _0x30ff62;});}return _0x3082a8;})[_0x4721('0x29')](respondWithResult(_0x7aa4d4,0xc9))[_0x4721('0x48')](handleError(_0x7aa4d4,null));};exports[_0x4721('0x28')]=function(_0x319d02,_0x45e112){if(_0x319d02[_0x4721('0x4d')]['id']){delete _0x319d02[_0x4721('0x4d')]['id'];}return db[_0x4721('0x30')]['find']({'where':{'id':_0x319d02['params']['id']}})[_0x4721('0x29')](handleEntityNotFound(_0x45e112,null))[_0x4721('0x29')](saveUpdates(_0x319d02['body'],null))[_0x4721('0x29')](respondWithResult(_0x45e112,null))[_0x4721('0x48')](handleError(_0x45e112,null));};exports[_0x4721('0x55')]=function(_0x5b1d18,_0xcc94c7){return db[_0x4721('0x30')][_0x4721('0x4b')]({'where':{'id':_0x5b1d18[_0x4721('0x49')]['id']}})['then'](handleEntityNotFound(_0xcc94c7,null))[_0x4721('0x29')](removeEntity(_0xcc94c7,null))[_0x4721('0x48')](handleError(_0xcc94c7,null));};exports[_0x4721('0x56')]=function(_0x2923e5,_0x3e6e8b){return db[_0x4721('0x30')][_0x4721('0x56')]()[_0x4721('0x29')](respondWithResult(_0x3e6e8b,null))[_0x4721('0x48')](handleError(_0x3e6e8b,null));};exports[_0x4721('0x57')]=function(_0x4ca005,_0x40a8ec,_0xe41102){if(_0x4ca005[_0x4721('0x4d')]['id']){delete _0x4ca005[_0x4721('0x4d')]['id'];}return db[_0x4721('0x30')][_0x4721('0x4b')]({'where':{'id':_0x4ca005[_0x4721('0x49')]['id']}})['then'](handleEntityNotFound(_0x40a8ec,null))['then'](function(_0x3e7f9d){if(_0x3e7f9d){_0x4ca005[_0x4721('0x4d')][_0x4721('0x58')]=_0x3e7f9d['id'];return db[_0x4721('0x59')]['create'](_0x4ca005['body']);}})[_0x4721('0x29')](respondWithResult(_0x40a8ec,null))['catch'](handleError(_0x40a8ec,null));};exports[_0x4721('0x5a')]=function(_0xd9e0a8,_0x5c3a50,_0x441750){var _0x480487={'raw':![],'where':{}};var _0x3b0c1b={};var _0x502e2e={'count':0x0,'rows':[]};return db[_0x4721('0x30')]['findOne']({'where':{'id':_0xd9e0a8['params']['id']}})[_0x4721('0x29')](handleEntityNotFound(_0x5c3a50,null))[_0x4721('0x29')](function(_0x409d60){if(_0x409d60){_0x3b0c1b[_0x4721('0x39')]=_[_0x4721('0x36')](db[_0x4721('0x59')][_0x4721('0x4a')]);_0x3b0c1b[_0x4721('0x35')]=_[_0x4721('0x36')](_0xd9e0a8['query']);_0x3b0c1b[_0x4721('0x37')]=_[_0x4721('0x38')](_0x3b0c1b[_0x4721('0x39')],_0x3b0c1b['query']);_0x480487['attributes']=_[_0x4721('0x38')](_0x3b0c1b['model'],qs[_0x4721('0x3b')](_0xd9e0a8['query'][_0x4721('0x3b')]));_0x480487[_0x4721('0x3a')]=_0x480487['attributes'][_0x4721('0x3c')]?_0x480487[_0x4721('0x3a')]:_0x3b0c1b[_0x4721('0x39')];if(!_0xd9e0a8[_0x4721('0x35')][_0x4721('0x3d')](_0x4721('0x5b'))){_0x480487[_0x4721('0x23')]=qs[_0x4721('0x23')](_0xd9e0a8[_0x4721('0x35')][_0x4721('0x23')]);_0x480487['offset']=qs[_0x4721('0x21')](_0xd9e0a8[_0x4721('0x35')]['offset']);}_0x480487['order']=qs[_0x4721('0x3f')](_0xd9e0a8[_0x4721('0x35')][_0x4721('0x3f')]);_0x480487[_0x4721('0x40')]=qs[_0x4721('0x37')](_[_0x4721('0x5c')](_0xd9e0a8[_0x4721('0x35')],_0x3b0c1b[_0x4721('0x37')]));_0x480487[_0x4721('0x40')][_0x4721('0x58')]=_0x409d60['id'];if(_0xd9e0a8[_0x4721('0x35')][_0x4721('0x41')]){_0x480487[_0x4721('0x40')]=_[_0x4721('0x42')](_0x480487[_0x4721('0x40')],{'$or':_[_0x4721('0x2f')](_0x480487[_0x4721('0x3a')],function(_0x18c8ad){var _0x4c3c37={};_0x4c3c37[_0x18c8ad]={'$like':'%'+_0xd9e0a8[_0x4721('0x35')][_0x4721('0x41')]+'%'};return _0x4c3c37;})});}_0x480487=_[_0x4721('0x42')]({},_0x480487,_0xd9e0a8['options']);return db[_0x4721('0x59')][_0x4721('0x24')]({'where':_0x480487['where']})[_0x4721('0x29')](function(_0x576f39){_0x502e2e[_0x4721('0x24')]=_0x576f39;if(_0xd9e0a8[_0x4721('0x35')]['includeAll']){_0x480487[_0x4721('0x46')]=[{'all':!![]}];}return db[_0x4721('0x59')][_0x4721('0x47')](_0x480487);})[_0x4721('0x29')](function(_0x5842cb){_0x502e2e[_0x4721('0x5d')]=_0x5842cb;return _0x502e2e;});}})['then'](respondWithFilteredResult(_0x5c3a50,_0x480487))['catch'](handleError(_0x5c3a50,null));};exports[_0x4721('0x5e')]=function(_0x20d814,_0x17eb2c,_0xd2c83b){return db[_0x4721('0x30')][_0x4721('0x4b')]({'where':{'id':_0x20d814[_0x4721('0x49')]['id']}})[_0x4721('0x29')](handleEntityNotFound(_0x17eb2c,null))[_0x4721('0x29')](function(_0x19a260){if(_0x19a260){return _0x19a260['removeDispositions'](_0x20d814[_0x4721('0x35')][_0x4721('0x5f')]);}})[_0x4721('0x29')](respondWithStatusCode(_0x17eb2c,null))[_0x4721('0x48')](handleError(_0x17eb2c,null));};exports[_0x4721('0x60')]=function(_0x1868e5,_0x24e135,_0x5ebded){return db[_0x4721('0x30')][_0x4721('0x4b')]({'where':{'id':_0x1868e5['params']['id']}})[_0x4721('0x29')](handleEntityNotFound(_0x24e135,null))[_0x4721('0x29')](function(_0x59f472){if(_0x59f472){var _0x537aad=[];var _0x281617={'success':[],'errors':[]};return db[_0x4721('0x61')]['describe']()[_0x4721('0x29')](function(_0x2f4a5e){if(_0x1868e5[_0x4721('0x4d')]['tags']&&_[_0x4721('0x62')](_0x1868e5['body'][_0x4721('0x63')])){if(_0x1868e5[_0x4721('0x4d')]['tags'][_0x4721('0x3c')]){_0x1868e5[_0x4721('0x4d')][_0x4721('0x63')]=_0x1868e5[_0x4721('0x4d')]['tags'][_0x4721('0x64')](';')+';';}else{_0x1868e5[_0x4721('0x4d')]['tags']=null;}}else{_0x1868e5['body'][_0x4721('0x63')]=null;}if(_0x1868e5['body']&&_[_0x4721('0x62')](_0x1868e5[_0x4721('0x4d')])){for(var _0x3caae8=0x0;_0x3caae8<_0x1868e5[_0x4721('0x4d')][_0x4721('0x3c')];_0x3caae8+=0x1){_0x1868e5[_0x4721('0x4d')][_0x3caae8]['ListId']=_0x1868e5[_0x4721('0x49')]['id'];_0x537aad[_0x4721('0x65')](_0x1868e5[_0x4721('0x4d')][_0x3caae8]);}return BPromise[_0x4721('0x66')](_0x537aad,function(_0x110656){return db[_0x4721('0x61')][_0x4721('0x4c')](_['omit'](_0x110656,['ids','id'])||{},{'fields':_['keys'](_0x2f4a5e),'raw':!![]})['then'](function(_0x3cd813){_0x281617['success']['push'](_0x3cd813[_0x4721('0x67')]);})[_0x4721('0x48')](function(_0x2c619d){_0x281617['errors'][_0x4721('0x65')]({'data':_0x110656,'error':_0x2c619d[_0x4721('0x68')]});});})[_0x4721('0x29')](function(_0x6f8e52){return _0x281617;})['catch'](function(_0x3d8b02){return _0x3d8b02;});}else{_0x24e135[_0x4721('0x1e')](0x190)[_0x4721('0x20')]({'message':_0x4721('0x69')});}});}})[_0x4721('0x29')](respondWithResult(_0x24e135,null))[_0x4721('0x48')](handleError(_0x24e135,null));};exports[_0x4721('0x6a')]=function(_0x1fd9eb,_0x3a9397,_0x4e9369){var _0x275817;return db[_0x4721('0x30')][_0x4721('0x4b')]({'where':{'id':_0x1fd9eb['params']['id']},'include':[{'model':db[_0x4721('0x6b')],'as':'CustomFields'}]})[_0x4721('0x29')](handleEntityNotFound(_0x3a9397,null))[_0x4721('0x29')](function(_0x7dde35){if(_0x7dde35){_0x275817=_0x7dde35;return db[_0x4721('0x61')][_0x4721('0x4a')];}})[_0x4721('0x29')](function(_0x59bd97){if(_0x59bd97){var _0x587393={};var _0x348963={};_0x348963['model']=_[_0x4721('0x6c')](_['keys'](_0x59bd97),_[_0x4721('0x2f')](_0x275817[_0x4721('0x6d')],function(_0x4b3a5c){return util[_0x4721('0x6e')](_0x4721('0x6f'),_0x4b3a5c['id']);}));_0x348963['query']=_[_0x4721('0x36')](_0x1fd9eb['query']);_0x348963['filters']=_[_0x4721('0x38')](_0x348963[_0x4721('0x39')],_0x348963[_0x4721('0x35')]);_0x587393[_0x4721('0x3a')]=_[_0x4721('0x38')](_0x348963[_0x4721('0x39')],qs['fields'](_0x1fd9eb[_0x4721('0x35')]['fields']));_0x587393['attributes']=_0x587393['attributes'][_0x4721('0x3c')]?_0x587393[_0x4721('0x3a')]:_0x348963[_0x4721('0x39')];if(!_0x1fd9eb['query'][_0x4721('0x3d')](_0x4721('0x5b'))){_0x587393['limit']=qs['limit'](_0x1fd9eb[_0x4721('0x35')][_0x4721('0x23')]);_0x587393[_0x4721('0x21')]=qs['offset'](_0x1fd9eb[_0x4721('0x35')][_0x4721('0x21')]);}_0x587393[_0x4721('0x3e')]=qs[_0x4721('0x3f')](_0x1fd9eb[_0x4721('0x35')][_0x4721('0x3f')]);_0x587393[_0x4721('0x40')]=qs[_0x4721('0x37')](_['pick'](_0x1fd9eb[_0x4721('0x35')],_0x348963[_0x4721('0x37')]));_0x587393[_0x4721('0x70')]=!![];if(_0x1fd9eb[_0x4721('0x35')]['filter']){_0x587393['where']=_[_0x4721('0x42')](_0x587393[_0x4721('0x40')],{'$or':_[_0x4721('0x2f')](_0x587393['attributes'],function(_0x382bca){var _0x2b8d52={};_0x2b8d52[_0x382bca]={'$like':'%'+_0x1fd9eb[_0x4721('0x35')][_0x4721('0x41')]+'%'};return _0x2b8d52;})});}_0x587393=_[_0x4721('0x42')]({},_0x587393,_0x1fd9eb[_0x4721('0x44')]);return _0x275817[_0x4721('0x6a')](_0x587393);}})[_0x4721('0x29')](respondWithResult(_0x3a9397,null))[_0x4721('0x48')](handleError(_0x3a9397,null));};exports[_0x4721('0x71')]=function(_0x1cf3f9,_0x30af7c,_0xa071ed){var _0x5a016c;var _0x3e5647;var _0xff5d9f;var _0x18a781=_0x1cf3f9['params']['id'];csv_results=[];return db[_0x4721('0x72')][_0x4721('0x47')]({'attributes':['id',_0x4721('0x34')],'raw':!![],'order':[_0x4721('0x73')]})[_0x4721('0x29')](function(_0x3b4d30){_0x5a016c=_0x3b4d30;var _0x3a5572=_[_0x4721('0x36')](db[_0x4721('0x61')][_0x4721('0x4a')]);return db[_0x4721('0x6b')]['findAll']({'raw':!![],'attributes':['id','alias']})[_0x4721('0x29')](function(_0x19d54c){_0x3e5647=_0x19d54c;var _0x3c84bc=squel[_0x4721('0x74')]()[_0x4721('0x3b')](_0x3a5572)['from'](_0x4721('0x75'),'c')[_0x4721('0x40')](_0x4721('0x76'),_0x18a781)[_0x4721('0x40')](_0x4721('0x77'))[_0x4721('0x78')]();for(var _0x44b9b3=0x0;_0x44b9b3<_0x3e5647[_0x4721('0x3c')];_0x44b9b3++){_0x3c84bc['field'](_0x4721('0x79')+_0x3e5647[_0x44b9b3]['id'],_0x4721('0x7a')+_0x3e5647[_0x44b9b3]['alias']);}for(var _0x44b9b3=0x0;_0x44b9b3<_0x5a016c[_0x4721('0x3c')];_0x44b9b3++){_0x3c84bc['field'](squel['select']()[_0x4721('0x7b')](_0x4721('0x7c'))['from'](_0x4721('0x7d'))[_0x4721('0x40')]('ItemTypeId\x20=\x20?',_0x5a016c[_0x44b9b3]['id'])[_0x4721('0x40')](_0x4721('0x7e')),_0x4721('0x7f')+_0x5a016c[_0x44b9b3][_0x4721('0x34')]);_0x3c84bc[_0x4721('0x7b')](squel[_0x4721('0x74')]()['field'](_0x4721('0x80'))[_0x4721('0x81')](_0x4721('0x7d'))[_0x4721('0x40')](_0x4721('0x82'),_0x5a016c[_0x44b9b3]['id'])[_0x4721('0x40')](_0x4721('0x7e')),_0x4721('0x83')+_0x5a016c[_0x44b9b3][_0x4721('0x34')]);}var _0x531363=[];_0x531363[_0x4721('0x65')](_0x3c84bc['toString']());BPromise[_0x4721('0x66')](_0x531363,handleQuery)[_0x4721('0x29')](function(_0x550d93){handleQuery(_0x3c84bc[_0x4721('0x84')]());var _0xaf8232=csv_results[0x0];if(!_['isEmpty'](_0xaf8232)){var _0xad4413=toCsv(_0xaf8232);var _0x2a2af2=Date[_0x4721('0x85')]();fs[_0x4721('0x86')](util[_0x4721('0x6e')]('/tmp/list_%d_%s.csv',_0x18a781,_0x2a2af2),_0xad4413);_0x30af7c[_0x4721('0x87')]('Content-disposition','attachment;\x20filename='+util[_0x4721('0x6e')](_0x4721('0x88'),_0x18a781,_0x2a2af2));_0x30af7c[_0x4721('0x87')](_0x4721('0x89'),_0x4721('0x8a'));return _0x30af7c[_0x4721('0x8b')](util[_0x4721('0x6e')](_0x4721('0x8c'),_0x18a781,_0x2a2af2));}else{return _0x30af7c[_0x4721('0x1d')](0xcc);}});});});};exports['addCustomField']=function(_0x15aca4,_0x31536a,_0x12e6ef){var _0x463e85;delete _0x15aca4[_0x4721('0x4d')]['id'];return db['CmList'][_0x4721('0x8d')]({'where':{'id':_0x15aca4[_0x4721('0x49')]['id']}})[_0x4721('0x29')](handleEntityNotFound(_0x31536a,null))[_0x4721('0x29')](function(_0x53d649){if(_0x53d649){return db[_0x4721('0x8e')]['transaction'](function(_0x273f82){return db['CmCustomField'][_0x4721('0x4c')](_0x15aca4[_0x4721('0x4d')],{'transaction':_0x273f82})[_0x4721('0x29')](function(_0x5272e1){_0x463e85=_0x5272e1;return _0x53d649[_0x4721('0x8f')](_0x5272e1,{'transaction':_0x273f82});})[_0x4721('0x29')](function(){var _0x33c97a={'type':db[_0x4721('0x90')][_0x4721('0x91')],'transaction':_0x273f82};switch(_0x15aca4[_0x4721('0x4d')][_0x4721('0x32')]){case _0x4721('0x92'):_0x33c97a[_0x4721('0x32')]=db['Sequelize'][_0x4721('0x91')];break;case _0x4721('0x93'):_0x33c97a[_0x4721('0x32')]=db[_0x4721('0x90')][_0x4721('0x94')];break;case _0x4721('0x95'):_0x33c97a[_0x4721('0x32')]=db[_0x4721('0x90')][_0x4721('0x96')];_0x33c97a[_0x4721('0x97')]=![];break;default:}return db[_0x4721('0x8e')][_0x4721('0x98')][_0x4721('0x99')](_0x4721('0x75'),util[_0x4721('0x6e')]('cf_%s',_0x463e85['id']),_0x33c97a);})[_0x4721('0x29')](function(){return _0x463e85;});});}})['then'](respondWithResult(_0x31536a,null))['catch'](handleError(_0x31536a,null));};exports[_0x4721('0x9a')]=function(_0x72689c,_0x1f86e7,_0x4b9955){var _0x317bcb={};var _0x354aa2={};var _0x24950d;var _0x34e2ca;return db[_0x4721('0x30')][_0x4721('0x8d')]({'where':{'id':_0x72689c['params']['id']}})[_0x4721('0x29')](handleEntityNotFound(_0x1f86e7,null))[_0x4721('0x29')](function(_0x4f10cf){if(_0x4f10cf){_0x24950d=_0x4f10cf;_0x354aa2[_0x4721('0x39')]=_[_0x4721('0x36')](db['CmCustomField']['rawAttributes']);_0x354aa2[_0x4721('0x35')]=_[_0x4721('0x36')](_0x72689c['query']);_0x354aa2[_0x4721('0x37')]=_[_0x4721('0x38')](_0x354aa2[_0x4721('0x39')],_0x354aa2[_0x4721('0x35')]);_0x317bcb[_0x4721('0x3a')]=_[_0x4721('0x38')](_0x354aa2['model'],qs[_0x4721('0x3b')](_0x72689c[_0x4721('0x35')][_0x4721('0x3b')]));_0x317bcb[_0x4721('0x3a')]=_0x317bcb['attributes'][_0x4721('0x3c')]?_0x317bcb[_0x4721('0x3a')]:_0x354aa2[_0x4721('0x39')];_0x317bcb[_0x4721('0x3e')]=qs['sort'](_0x72689c[_0x4721('0x35')][_0x4721('0x3f')]);_0x317bcb[_0x4721('0x40')]=qs[_0x4721('0x37')](_[_0x4721('0x5c')](_0x72689c[_0x4721('0x35')],_0x354aa2[_0x4721('0x37')]));_0x317bcb['where']=_[_0x4721('0x42')](_0x317bcb[_0x4721('0x40')],{'$or':[{'ListId':_0x4f10cf['id']},{'ListId':null}]});if(_0x72689c[_0x4721('0x35')][_0x4721('0x41')]){_0x317bcb[_0x4721('0x40')]=_[_0x4721('0x42')](_0x317bcb[_0x4721('0x40')],{'$or':_[_0x4721('0x2f')](_0x317bcb[_0x4721('0x3a')],function(_0x44e8eb){var _0x428cea={};_0x428cea[_0x44e8eb]={'$like':'%'+_0x72689c[_0x4721('0x35')][_0x4721('0x41')]+'%'};return _0x428cea;})});}_0x317bcb=_[_0x4721('0x42')]({},_0x317bcb,_0x72689c[_0x4721('0x44')]);return db[_0x4721('0x6b')][_0x4721('0x9b')](_0x317bcb);}})[_0x4721('0x29')](respondWithResult(_0x1f86e7,null))['catch'](handleError(_0x1f86e7,null));};exports['getGlobalCustomFields']=function(_0x315c6c,_0xc54344){return db[_0x4721('0x6b')]['findAndCountAll']({'where':{'ListId':null}})[_0x4721('0x29')](handleEntityNotFound(_0xc54344,null))[_0x4721('0x29')](function(_0x530fa8){return _0x530fa8;})[_0x4721('0x29')](respondWithResult(_0xc54344,null))[_0x4721('0x48')](handleError(_0xc54344,null));};exports[_0x4721('0x9c')]=function(_0x4b5a59,_0x2b0bcf,_0x46016a){return db[_0x4721('0x30')][_0x4721('0x4b')]({'where':{'id':_0x4b5a59[_0x4721('0x49')]['id']}})[_0x4721('0x29')](handleEntityNotFound(_0x2b0bcf,null))[_0x4721('0x29')](function(_0x47964f){if(_0x47964f){return _0x47964f[_0x4721('0x9c')](_0x4b5a59[_0x4721('0x4d')][_0x4721('0x5f')],_[_0x4721('0x9d')](_0x4b5a59[_0x4721('0x4d')],['ids','id'])||{})[_0x4721('0x9e')](function(_0x1d8a66){for(var _0xe3da6a=0x0;_0xe3da6a<_0x4b5a59[_0x4721('0x4d')][_0x4721('0x5f')][_0x4721('0x3c')];_0xe3da6a+=0x1){socket['emit'](_0x4721('0x9f'),{'UserId':Number(_0x4b5a59[_0x4721('0x4d')][_0x4721('0x5f')][_0xe3da6a]),'CmListId':Number(_0x4b5a59[_0x4721('0x49')]['id'])});}return _0x1d8a66;});}})[_0x4721('0x29')](respondWithResult(_0x2b0bcf,null))['catch'](handleError(_0x2b0bcf,null));};exports[_0x4721('0xa0')]=function(_0x34f91a,_0x1634a7,_0x4ce0c6){return db[_0x4721('0x30')][_0x4721('0x4b')]({'where':{'id':_0x34f91a['params']['id']}})['then'](handleEntityNotFound(_0x1634a7,null))[_0x4721('0x29')](function(_0x3a624d){if(_0x3a624d){return _0x3a624d['removeAgents'](_0x34f91a[_0x4721('0x35')][_0x4721('0x5f')])['then'](function(){if(_[_0x4721('0x62')](_0x34f91a['query'][_0x4721('0x5f')])){for(var _0x36b19f=0x0;_0x36b19f<_0x34f91a[_0x4721('0x35')][_0x4721('0x5f')][_0x4721('0x3c')];_0x36b19f+=0x1){socket[_0x4721('0xa1')]('userCmList:remove',{'UserId':Number(_0x34f91a[_0x4721('0x35')][_0x4721('0x5f')][_0x36b19f]),'CmListId':Number(_0x34f91a['params']['id'])});}}else{socket['emit'](_0x4721('0xa2'),{'UserId':Number(_0x34f91a['query'][_0x4721('0x5f')]),'CmListId':Number(_0x34f91a[_0x4721('0x49')]['id'])});}});}})[_0x4721('0x29')](respondWithStatusCode(_0x1634a7,null))[_0x4721('0x48')](handleError(_0x1634a7,null));};exports[_0x4721('0xa3')]=function(_0x5e46c5,_0x2dbd81,_0x5165eb){var _0x3ab944={};var _0x55af0f={};var _0x1c4fad;var _0x180c34;return db[_0x4721('0x30')]['findOne']({'where':{'id':_0x5e46c5[_0x4721('0x49')]['id']}})[_0x4721('0x29')](handleEntityNotFound(_0x2dbd81,null))[_0x4721('0x29')](function(_0x54e4f7){if(_0x54e4f7){_0x1c4fad=_0x54e4f7;_0x55af0f[_0x4721('0x39')]=_[_0x4721('0x36')](db[_0x4721('0xa4')][_0x4721('0x4a')]);_0x55af0f[_0x4721('0x35')]=_[_0x4721('0x36')](_0x5e46c5[_0x4721('0x35')]);_0x55af0f[_0x4721('0x37')]=_[_0x4721('0x38')](_0x55af0f['model'],_0x55af0f['query']);_0x3ab944[_0x4721('0x3a')]=_[_0x4721('0x38')](_0x55af0f[_0x4721('0x39')],qs[_0x4721('0x3b')](_0x5e46c5[_0x4721('0x35')]['fields']));_0x3ab944[_0x4721('0x3a')]=_0x3ab944['attributes'][_0x4721('0x3c')]?_0x3ab944[_0x4721('0x3a')]:_0x55af0f[_0x4721('0x39')];_0x3ab944[_0x4721('0x3e')]=qs['sort'](_0x5e46c5['query'][_0x4721('0x3f')]);_0x3ab944[_0x4721('0x40')]=qs[_0x4721('0x37')](_[_0x4721('0x5c')](_0x5e46c5[_0x4721('0x35')],_0x55af0f['filters']));if(_0x5e46c5[_0x4721('0x35')][_0x4721('0x41')]){_0x3ab944[_0x4721('0x40')]=_['merge'](_0x3ab944['where'],{'$or':_[_0x4721('0x2f')](_0x3ab944['attributes'],function(_0x1ebc50){var _0xf71744={};_0xf71744[_0x1ebc50]={'$like':'%'+_0x5e46c5['query'][_0x4721('0x41')]+'%'};return _0xf71744;})});}_0x3ab944=_[_0x4721('0x42')]({},_0x3ab944,_0x5e46c5[_0x4721('0x44')]);return _0x1c4fad[_0x4721('0xa3')](_0x3ab944);}})[_0x4721('0x29')](function(_0x2b621d){if(_0x2b621d){_0x180c34=_0x2b621d[_0x4721('0x3c')];if(!_0x5e46c5[_0x4721('0x35')]['hasOwnProperty'](_0x4721('0x5b'))){_0x3ab944[_0x4721('0x23')]=qs[_0x4721('0x23')](_0x5e46c5[_0x4721('0x35')][_0x4721('0x23')]);_0x3ab944[_0x4721('0x21')]=qs[_0x4721('0x21')](_0x5e46c5[_0x4721('0x35')][_0x4721('0x21')]);}return _0x1c4fad[_0x4721('0xa3')](_0x3ab944);}})['then'](function(_0x292cfc){if(_0x292cfc){return _0x292cfc?{'count':_0x180c34,'rows':_0x292cfc}:null;}})['then'](respondWithResult(_0x2dbd81,null))[_0x4721('0x48')](handleError(_0x2dbd81,null));};function handleQuery(_0x5c9fe7){logger['info'](_0x5c9fe7);return db[_0x4721('0x8e')][_0x4721('0x35')](_0x5c9fe7)[_0x4721('0x9e')](function(_0x3c0a8d){csv_results[_0x4721('0x65')](_0x3c0a8d);})[_0x4721('0x48')](function(_0x576417){logger[_0x4721('0x2c')](_0x576417['message']);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 6d87bfd..08836d2 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 _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x234e1a,_0x500d79){var _0x55aad2=function(_0x272396){while(--_0x272396){_0x234e1a['push'](_0x234e1a['shift']());}};_0x55aad2(++_0x500d79);}(_0x7217,0x19e));var _0x7721=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x7217[_0x5783f4];return _0x28e380;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents; \ No newline at end of file +var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x36cb4d,_0x2dc7aa){var _0x35ca7c=function(_0x3e8fbf){while(--_0x3e8fbf){_0x36cb4d['push'](_0x36cb4d['shift']());}};_0x35ca7c(++_0x2dc7aa);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 9adcd52..cab081e 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 _0x22fb=['define','CmList','../../config/logger','moment','bluebird','request-promise','path','rimraf','./cmList.attributes','exports'];(function(_0x2faea5,_0x4923f0){var _0x8029a1=function(_0x192659){while(--_0x192659){_0x2faea5['push'](_0x2faea5['shift']());}};_0x8029a1(++_0x4923f0);}(_0x22fb,0x192));var _0xb22f=function(_0x4bb069,_0x404522){_0x4bb069=_0x4bb069-0x0;var _0x16f2d6=_0x22fb[_0x4bb069];return _0x16f2d6;};'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':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac4a=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./cmList.attributes','define','cm_lists'];(function(_0x851ae7,_0x5ad0da){var _0x417421=function(_0x10797d){while(--_0x10797d){_0x851ae7['push'](_0x851ae7['shift']());}};_0x417421(++_0x5ad0da);}(_0xac4a,0x13f));var _0xaac4=function(_0x19220a,_0x3a9c89){_0x19220a=_0x19220a-0x0;var _0x4fdaac=_0xac4a[_0x19220a];return _0x4fdaac;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var moment=require(_0xaac4('0x4'));var BPromise=require(_0xaac4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var attributes=require(_0xaac4('0x8'));module['exports']=function(_0x1283a5,_0x53d03a){return _0x1283a5[_0xaac4('0x9')]('CmList',attributes,{'tableName':_0xaac4('0xa'),'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 a91291c..f9153d0 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 _0xd469=['localhost','socket.io-emitter','./cmList.socket','register','request','info','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xd469,0x66));var _0x9d46=function(_0xf619b6,_0x1f963c){_0xf619b6=_0xf619b6-0x0;var _0x5c30da=_0xd469[_0xf619b6];return _0x5c30da;};'use strict';var _=require('lodash');var util=require(_0x9d46('0x0'));var moment=require('moment');var BPromise=require(_0x9d46('0x1'));var rs=require(_0x9d46('0x2'));var fs=require('fs');var Redis=require(_0x9d46('0x3'));var db=require(_0x9d46('0x4'))['db'];var utils=require(_0x9d46('0x5'));var logger=require(_0x9d46('0x6'))(_0x9d46('0x7'));var config=require(_0x9d46('0x8'));var jayson=require(_0x9d46('0x9'));var client=jayson[_0x9d46('0xa')][_0x9d46('0xb')]({'port':0x232a});config[_0x9d46('0xc')]=_[_0x9d46('0xd')](config[_0x9d46('0xc')],{'host':_0x9d46('0xe'),'port':0x18eb});var socket=require(_0x9d46('0xf'))(new Redis(config['redis']));require(_0x9d46('0x10'))[_0x9d46('0x11')](socket);function respondWithRpcPromise(_0x51d5d,_0xb34c44,_0x1f8b0a){return new BPromise(function(_0x1f57f8,_0x2322ed){return client[_0x9d46('0x12')](_0x51d5d,_0x1f8b0a)['then'](function(_0x87db46){logger[_0x9d46('0x13')](_0x9d46('0x14'),_0xb34c44,'request\x20sent');logger[_0x9d46('0x15')](_0x9d46('0x16'),_0xb34c44,'request\x20sent',JSON[_0x9d46('0x17')](_0x87db46));if(_0x87db46['error']){if(_0x87db46['error'][_0x9d46('0x18')]===0x1f4){logger['error'](_0x9d46('0x14'),_0xb34c44,_0x87db46['error']['message']);return _0x2322ed(_0x87db46[_0x9d46('0x19')]['message']);}logger['error'](_0x9d46('0x14'),_0xb34c44,_0x87db46['error'][_0x9d46('0x1a')]);return _0x1f57f8(_0x87db46['error']['message']);}else{logger[_0x9d46('0x13')](_0x9d46('0x14'),_0xb34c44,_0x9d46('0x1b'));_0x1f57f8(_0x87db46['result'][_0x9d46('0x1a')]);}})[_0x9d46('0x1c')](function(_0x2a5152){logger[_0x9d46('0x19')](_0x9d46('0x14'),_0xb34c44,_0x2a5152);_0x2322ed(_0x2a5152);});});} \ No newline at end of file +var _0x652b=['client','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','error','message','info','result','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x652b,0x1d8));var _0xb652=function(_0x1265ed,_0x4b85e8){_0x1265ed=_0x1265ed-0x0;var _0x5ac459=_0x652b[_0x1265ed];return _0x5ac459;};'use strict';var _=require('lodash');var util=require(_0xb652('0x0'));var moment=require(_0xb652('0x1'));var BPromise=require('bluebird');var rs=require(_0xb652('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb652('0x3'));var logger=require(_0xb652('0x4'))(_0xb652('0x5'));var config=require(_0xb652('0x6'));var jayson=require(_0xb652('0x7'));var client=jayson[_0xb652('0x8')]['http']({'port':0x232a});config[_0xb652('0x9')]=_[_0xb652('0xa')](config[_0xb652('0x9')],{'host':_0xb652('0xb'),'port':0x18eb});var socket=require(_0xb652('0xc'))(new Redis(config[_0xb652('0x9')]));require(_0xb652('0xd'))[_0xb652('0xe')](socket);function respondWithRpcPromise(_0x129e46,_0x1f8cee,_0x21565a){return new BPromise(function(_0x3c853c,_0x5afef9){return client[_0xb652('0xf')](_0x129e46,_0x21565a)[_0xb652('0x10')](function(_0xba701){logger['info'](_0xb652('0x11'),_0x1f8cee,_0xb652('0x12'));logger['debug'](_0xb652('0x13'),_0x1f8cee,_0xb652('0x12'),JSON['stringify'](_0xba701));if(_0xba701[_0xb652('0x14')]){if(_0xba701[_0xb652('0x14')]['code']===0x1f4){logger['error'](_0xb652('0x11'),_0x1f8cee,_0xba701[_0xb652('0x14')][_0xb652('0x15')]);return _0x5afef9(_0xba701[_0xb652('0x14')][_0xb652('0x15')]);}logger[_0xb652('0x14')](_0xb652('0x11'),_0x1f8cee,_0xba701[_0xb652('0x14')][_0xb652('0x15')]);return _0x3c853c(_0xba701[_0xb652('0x14')][_0xb652('0x15')]);}else{logger[_0xb652('0x16')](_0xb652('0x11'),_0x1f8cee,_0xb652('0x12'));_0x3c853c(_0xba701[_0xb652('0x17')][_0xb652('0x15')]);}})['catch'](function(_0x428f69){logger['error']('CmList,\x20%s,\x20%s',_0x1f8cee,_0x428f69);_0x5afef9(_0x428f69);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index a0a6636..1f7671a 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 _0x5359=['emit','removeListener','length','cmList:','save','remove'];(function(_0x2c2d99,_0x1a61ce){var _0xc9af40=function(_0x4bc502){while(--_0x4bc502){_0x2c2d99['push'](_0x2c2d99['shift']());}};_0xc9af40(++_0x1a61ce);}(_0x5359,0x130));var _0x9535=function(_0x5739ed,_0x18e59f){_0x5739ed=_0x5739ed-0x0;var _0x1793b3=_0x5359[_0x5739ed];return _0x1793b3;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x9535('0x0'),_0x9535('0x1'),'update'];function createListener(_0x123798,_0x903127){return function(_0x48a044){_0x903127[_0x9535('0x2')](_0x123798,_0x48a044);};}function removeListener(_0x2bd892,_0x520350){return function(){CmListEvents[_0x9535('0x3')](_0x2bd892,_0x520350);};}exports['register']=function(_0x34d7d5){for(var _0x263bad=0x0,_0x21367c=events[_0x9535('0x4')];_0x263bad<_0x21367c;_0x263bad++){var _0xa6ad6=events[_0x263bad];var _0x48f6ec=createListener(_0x9535('0x5')+_0xa6ad6,_0x34d7d5);CmListEvents['on'](_0xa6ad6,_0x48f6ec);}}; \ No newline at end of file +var _0x000b=['remove','update','emit','cmList:','./cmList.events','save'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x000b,0xf4));var _0xb000=function(_0x5192de,_0x4e91cd){_0x5192de=_0x5192de-0x0;var _0x4e287e=_0x000b[_0x5192de];return _0x4e287e;};'use strict';var CmListEvents=require(_0xb000('0x0'));var events=[_0xb000('0x1'),_0xb000('0x2'),_0xb000('0x3')];function createListener(_0xcceeb0,_0x4436aa){return function(_0x219e90){_0x4436aa[_0xb000('0x4')](_0xcceeb0,_0x219e90);};}function removeListener(_0x2de19d,_0x169b31){return function(){CmListEvents['removeListener'](_0x2de19d,_0x169b31);};}exports['register']=function(_0x42bec){for(var _0x6941=0x0,_0x51f597=events['length'];_0x6941<_0x51f597;_0x6941++){var _0x5d69f3=events[_0x6941];var _0x32cfe4=createListener(_0xb000('0x5')+_0x5d69f3,_0x42bec);CmListEvents['on'](_0x5d69f3,_0x32cfe4);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 1ae6d79..77cac1f 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 _0xe829=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','index','get','/describe','getGlobalCustomFields','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addContacts','addAgents','update','delete','/:id','destroy','removeDispositions','removeAgents','multer','util','path','Router'];(function(_0x30ac9f,_0x1da5e5){var _0x1f291a=function(_0x4504ff){while(--_0x4504ff){_0x30ac9f['push'](_0x30ac9f['shift']());}};_0x1f291a(++_0x1da5e5);}(_0xe829,0x1d8));var _0x9e82=function(_0x5cca9f,_0x154684){_0x5cca9f=_0x5cca9f-0x0;var _0x55edda=_0xe829[_0x5cca9f];return _0x55edda;};'use strict';var multer=require(_0x9e82('0x0'));var util=require(_0x9e82('0x1'));var path=require(_0x9e82('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9e82('0x3')]();var fs_extra=require(_0x9e82('0x4'));var auth=require(_0x9e82('0x5'));var interaction=require(_0x9e82('0x6'));var config=require(_0x9e82('0x7'));var controller=require(_0x9e82('0x8'));router['get']('/',auth[_0x9e82('0x9')](),controller[_0x9e82('0xa')]);router[_0x9e82('0xb')](_0x9e82('0xc'),auth[_0x9e82('0x9')](),controller['describe']);router[_0x9e82('0xb')]('/global_fields',auth[_0x9e82('0x9')](),controller[_0x9e82('0xd')]);router['get']('/:id',auth[_0x9e82('0x9')](),controller[_0x9e82('0xe')]);router[_0x9e82('0xb')](_0x9e82('0xf'),auth[_0x9e82('0x9')](),controller[_0x9e82('0x10')]);router[_0x9e82('0xb')](_0x9e82('0x11'),auth[_0x9e82('0x9')](),controller[_0x9e82('0x12')]);router[_0x9e82('0xb')](_0x9e82('0x13'),auth['isAuthenticated'](),controller['getContactsCsv']);router[_0x9e82('0xb')](_0x9e82('0x14'),auth[_0x9e82('0x9')](),controller[_0x9e82('0x15')]);router['get'](_0x9e82('0x16'),auth[_0x9e82('0x9')](),controller[_0x9e82('0x17')]);router[_0x9e82('0x18')]('/',auth['isAuthenticated'](),controller[_0x9e82('0x19')]);router[_0x9e82('0x18')](_0x9e82('0xf'),auth[_0x9e82('0x9')](),controller['addDisposition']);router['post']('/:id/contacts',auth[_0x9e82('0x9')](),controller[_0x9e82('0x1a')]);router[_0x9e82('0x18')](_0x9e82('0x14'),auth[_0x9e82('0x9')](),controller['addCustomField']);router[_0x9e82('0x18')](_0x9e82('0x16'),auth[_0x9e82('0x9')](),controller[_0x9e82('0x1b')]);router['put']('/:id',auth[_0x9e82('0x9')](),controller[_0x9e82('0x1c')]);router[_0x9e82('0x1d')](_0x9e82('0x1e'),auth[_0x9e82('0x9')](),controller[_0x9e82('0x1f')]);router['delete'](_0x9e82('0xf'),auth[_0x9e82('0x9')](),controller[_0x9e82('0x20')]);router[_0x9e82('0x1d')](_0x9e82('0x16'),auth['isAuthenticated'](),controller[_0x9e82('0x21')]);module['exports']=router; \ No newline at end of file +var _0x167e=['getContactsCsv','/:id/fields','getCustomFields','/:id/users','post','create','/:id/dispositions','addDisposition','addContacts','addCustomField','put','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv'];(function(_0x34a14d,_0xc49d24){var _0x2015f2=function(_0x2a0b48){while(--_0x2a0b48){_0x34a14d['push'](_0x34a14d['shift']());}};_0x2015f2(++_0xc49d24);}(_0x167e,0xa3));var _0xe167=function(_0x360765,_0x5867a0){_0x360765=_0x360765-0x0;var _0x5710d1=_0x167e[_0x360765];return _0x5710d1;};'use strict';var multer=require(_0xe167('0x0'));var util=require(_0xe167('0x1'));var path=require(_0xe167('0x2'));var timeout=require(_0xe167('0x3'));var express=require(_0xe167('0x4'));var router=express[_0xe167('0x5')]();var fs_extra=require(_0xe167('0x6'));var auth=require(_0xe167('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe167('0x8'));var controller=require('./cmList.controller');router[_0xe167('0x9')]('/',auth[_0xe167('0xa')](),controller[_0xe167('0xb')]);router[_0xe167('0x9')](_0xe167('0xc'),auth['isAuthenticated'](),controller[_0xe167('0xd')]);router['get'](_0xe167('0xe'),auth[_0xe167('0xa')](),controller[_0xe167('0xf')]);router[_0xe167('0x9')](_0xe167('0x10'),auth[_0xe167('0xa')](),controller[_0xe167('0x11')]);router[_0xe167('0x9')]('/:id/dispositions',auth[_0xe167('0xa')](),controller[_0xe167('0x12')]);router['get'](_0xe167('0x13'),auth[_0xe167('0xa')](),controller[_0xe167('0x14')]);router[_0xe167('0x9')](_0xe167('0x15'),auth[_0xe167('0xa')](),controller[_0xe167('0x16')]);router[_0xe167('0x9')](_0xe167('0x17'),auth['isAuthenticated'](),controller[_0xe167('0x18')]);router[_0xe167('0x9')](_0xe167('0x19'),auth[_0xe167('0xa')](),controller['getAgents']);router[_0xe167('0x1a')]('/',auth[_0xe167('0xa')](),controller[_0xe167('0x1b')]);router[_0xe167('0x1a')](_0xe167('0x1c'),auth['isAuthenticated'](),controller[_0xe167('0x1d')]);router[_0xe167('0x1a')](_0xe167('0x13'),auth[_0xe167('0xa')](),controller[_0xe167('0x1e')]);router[_0xe167('0x1a')]('/:id/fields',auth[_0xe167('0xa')](),controller[_0xe167('0x1f')]);router[_0xe167('0x1a')](_0xe167('0x19'),auth[_0xe167('0xa')](),controller['addAgents']);router[_0xe167('0x20')](_0xe167('0x10'),auth[_0xe167('0xa')](),controller[_0xe167('0x21')]);router[_0xe167('0x22')]('/:id',auth[_0xe167('0xa')](),controller[_0xe167('0x23')]);router[_0xe167('0x22')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0xe167('0x19'),auth[_0xe167('0xa')](),controller[_0xe167('0x24')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index bcfc0d7..d4e553f 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 _0x1130=['VIRTUAL','getDataValue','field','STRING','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1130,0x1c6));var _0x0113=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x1130[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require(_0x0113('0x0'));module[_0x0113('0x1')]={'name':{'type':Sequelize[_0x0113('0x2')],'get':function(_0x16f5c6){return this[_0x0113('0x3')](_0x0113('0x4'));}},'field':{'type':Sequelize[_0x0113('0x5')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x0113('0x5')],'allowNull':![]}}; \ No newline at end of file +var _0x7973=['STRING','exports','VIRTUAL','getDataValue','field'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x7973,0x105));var _0x3797=function(_0x104b99,_0x15877a){_0x104b99=_0x104b99-0x0;var _0x3ac501=_0x7973[_0x104b99];return _0x3ac501;};'use strict';var Sequelize=require('sequelize');module[_0x3797('0x0')]={'name':{'type':Sequelize[_0x3797('0x1')],'get':function(_0x49f5b1){return this[_0x3797('0x2')](_0x3797('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x3797('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x3797('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index eb238c4..7f72f0e 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 _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(_0x5dc12e,_0x40b2c0){var _0x5cce1a=function(_0x407547){while(--_0x407547){_0x5dc12e['push'](_0x5dc12e['shift']());}};_0x5cce1a(++_0x40b2c0);}(_0x7a54,0x106));var _0x47a5=function(_0x4f8465,_0x145797){_0x4f8465=_0x4f8465-0x0;var _0x123e48=_0x7a54[_0x4f8465];return _0x123e48;};'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 +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(_0x3126a1,_0x2fb75a){var _0x5265ee=function(_0x3786d4){while(--_0x3786d4){_0x3126a1['push'](_0x3126a1['shift']());}};_0x5265ee(++_0x2fb75a);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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 diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 2ab80b5..7ea9f90 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 _0xf025=['path','rimraf','../../config/environment','./condition.attributes','define','Condition','tools_conditions','lodash','../../config/logger','api','moment','request-promise'];(function(_0x51149a,_0x3e2829){var _0x4af506=function(_0x32d039){while(--_0x32d039){_0x51149a['push'](_0x51149a['shift']());}};_0x4af506(++_0x3e2829);}(_0xf025,0x97));var _0x5f02=function(_0x1ca4c3,_0x554126){_0x1ca4c3=_0x1ca4c3-0x0;var _0x4426a6=_0xf025[_0x1ca4c3];return _0x4426a6;};'use strict';var _=require(_0x5f02('0x0'));var util=require('util');var logger=require(_0x5f02('0x1'))(_0x5f02('0x2'));var moment=require(_0x5f02('0x3'));var BPromise=require('bluebird');var rp=require(_0x5f02('0x4'));var fs=require('fs');var path=require(_0x5f02('0x5'));var rimraf=require(_0x5f02('0x6'));var config=require(_0x5f02('0x7'));var attributes=require(_0x5f02('0x8'));module['exports']=function(_0x382006,_0x10213b){return _0x382006[_0x5f02('0x9')](_0x5f02('0xa'),attributes,{'tableName':_0x5f02('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf6bb=['define','../../config/logger','bluebird','path','../../config/environment','./condition.attributes','exports'];(function(_0x4c219e,_0x1cc27e){var _0x20c14a=function(_0x5bc78b){while(--_0x5bc78b){_0x4c219e['push'](_0x4c219e['shift']());}};_0x20c14a(++_0x1cc27e);}(_0xf6bb,0x16d));var _0xbf6b=function(_0x2a1b33,_0x409f50){_0x2a1b33=_0x2a1b33-0x0;var _0x4c50e7=_0xf6bb[_0x2a1b33];return _0x4c50e7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbf6b('0x0'))('api');var moment=require('moment');var BPromise=require(_0xbf6b('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf6b('0x2'));var rimraf=require('rimraf');var config=require(_0xbf6b('0x3'));var attributes=require(_0xbf6b('0x4'));module[_0xbf6b('0x5')]=function(_0x4a78e7,_0x2fcc92){return _0x4a78e7[_0xbf6b('0x6')]('Condition',attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index a245263..090710d 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 _0xc413=['../../config/environment','jayson/promise','client','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x14041b,_0x807ebc){var _0x367372=function(_0x43e3d5){while(--_0x43e3d5){_0x14041b['push'](_0x14041b['shift']());}};_0x367372(++_0x807ebc);}(_0xc413,0x67));var _0x3c41=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xc413[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x3c41('0x0'));var util=require('util');var moment=require(_0x3c41('0x1'));var BPromise=require(_0x3c41('0x2'));var rs=require(_0x3c41('0x3'));var fs=require('fs');var Redis=require(_0x3c41('0x4'));var db=require(_0x3c41('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3c41('0x6'));var config=require(_0x3c41('0x7'));var jayson=require(_0x3c41('0x8'));var client=jayson[_0x3c41('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x533f03,_0x514ed2,_0x1cba3a){return new BPromise(function(_0x28dbf4,_0x1da2a1){return client['request'](_0x533f03,_0x1cba3a)[_0x3c41('0xa')](function(_0x1adc9d){logger[_0x3c41('0xb')](_0x3c41('0xc'),_0x514ed2,_0x3c41('0xd'));logger[_0x3c41('0xe')](_0x3c41('0xf'),_0x514ed2,_0x3c41('0xd'),JSON[_0x3c41('0x10')](_0x1adc9d));if(_0x1adc9d[_0x3c41('0x11')]){if(_0x1adc9d[_0x3c41('0x11')][_0x3c41('0x12')]===0x1f4){logger[_0x3c41('0x11')](_0x3c41('0xc'),_0x514ed2,_0x1adc9d[_0x3c41('0x11')]['message']);return _0x1da2a1(_0x1adc9d[_0x3c41('0x11')][_0x3c41('0x13')]);}logger[_0x3c41('0x11')](_0x3c41('0xc'),_0x514ed2,_0x1adc9d[_0x3c41('0x11')]['message']);return _0x28dbf4(_0x1adc9d[_0x3c41('0x11')][_0x3c41('0x13')]);}else{logger[_0x3c41('0xb')](_0x3c41('0xc'),_0x514ed2,'request\x20sent');_0x28dbf4(_0x1adc9d[_0x3c41('0x14')][_0x3c41('0x13')]);}})[_0x3c41('0x15')](function(_0x1d1271){logger['error'](_0x3c41('0xc'),_0x514ed2,_0x1d1271);_0x1da2a1(_0x1d1271);});});} \ No newline at end of file +var _0x9706=['Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Condition,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug'];(function(_0x31dac5,_0x1fa6a0){var _0x5e8cb3=function(_0x865f82){while(--_0x865f82){_0x31dac5['push'](_0x31dac5['shift']());}};_0x5e8cb3(++_0x1fa6a0);}(_0x9706,0x133));var _0x6970=function(_0x50cbcd,_0x438ae4){_0x50cbcd=_0x50cbcd-0x0;var _0x148ea1=_0x9706[_0x50cbcd];return _0x148ea1;};'use strict';var _=require(_0x6970('0x0'));var util=require(_0x6970('0x1'));var moment=require(_0x6970('0x2'));var BPromise=require(_0x6970('0x3'));var rs=require(_0x6970('0x4'));var fs=require('fs');var Redis=require(_0x6970('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6970('0x6'));var logger=require('../../config/logger')(_0x6970('0x7'));var config=require(_0x6970('0x8'));var jayson=require(_0x6970('0x9'));var client=jayson['client'][_0x6970('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5755ad,_0x468a93,_0x462319){return new BPromise(function(_0x5481db,_0x193c11){return client['request'](_0x5755ad,_0x462319)[_0x6970('0xb')](function(_0xabd7b0){logger[_0x6970('0xc')]('Condition,\x20%s,\x20%s',_0x468a93,_0x6970('0xd'));logger[_0x6970('0xe')](_0x6970('0xf'),_0x468a93,_0x6970('0xd'),JSON[_0x6970('0x10')](_0xabd7b0));if(_0xabd7b0[_0x6970('0x11')]){if(_0xabd7b0[_0x6970('0x11')][_0x6970('0x12')]===0x1f4){logger[_0x6970('0x11')]('Condition,\x20%s,\x20%s',_0x468a93,_0xabd7b0[_0x6970('0x11')][_0x6970('0x13')]);return _0x193c11(_0xabd7b0[_0x6970('0x11')][_0x6970('0x13')]);}logger[_0x6970('0x11')](_0x6970('0x14'),_0x468a93,_0xabd7b0[_0x6970('0x11')]['message']);return _0x5481db(_0xabd7b0[_0x6970('0x11')][_0x6970('0x13')]);}else{logger[_0x6970('0xc')]('Condition,\x20%s,\x20%s',_0x468a93,_0x6970('0xd'));_0x5481db(_0xabd7b0[_0x6970('0x15')][_0x6970('0x13')]);}})[_0x6970('0x16')](function(_0x230593){logger[_0x6970('0x11')](_0x6970('0x14'),_0x468a93,_0x230593);_0x193c11(_0x230593);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 1db4f8c..c728743 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 _0x676b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','multer','util','express','fs-extra'];(function(_0x2c1aa8,_0x3e0609){var _0x4019f5=function(_0x916eac){while(--_0x916eac){_0x2c1aa8['push'](_0x2c1aa8['shift']());}};_0x4019f5(++_0x3e0609);}(_0x676b,0x168));var _0xb676=function(_0x114b7c,_0xc4b93b){_0x114b7c=_0x114b7c-0x0;var _0x47185f=_0x676b[_0x114b7c];return _0x47185f;};'use strict';var multer=require(_0xb676('0x0'));var util=require(_0xb676('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb676('0x2'));var router=express['Router']();var fs_extra=require(_0xb676('0x3'));var auth=require(_0xb676('0x4'));var interaction=require(_0xb676('0x5'));var config=require(_0xb676('0x6'));var controller=require(_0xb676('0x7'));router[_0xb676('0x8')](_0xb676('0x9'),auth[_0xb676('0xa')](),controller[_0xb676('0xb')]);router[_0xb676('0xc')](_0xb676('0x9'),auth[_0xb676('0xa')](),controller[_0xb676('0xd')]);module['exports']=router; \ No newline at end of file +var _0xa031=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','update','isAuthenticated','destroy','multer'];(function(_0x2300c7,_0x255f74){var _0x23f720=function(_0x3fea57){while(--_0x3fea57){_0x2300c7['push'](_0x2300c7['shift']());}};_0x23f720(++_0x255f74);}(_0xa031,0x8b));var _0x1a03=function(_0x5c630c,_0xa2e96b){_0x5c630c=_0x5c630c-0x0;var _0x55c4b7=_0xa031[_0x5c630c];return _0x55c4b7;};'use strict';var multer=require(_0x1a03('0x0'));var util=require(_0x1a03('0x1'));var path=require(_0x1a03('0x2'));var timeout=require('connect-timeout');var express=require(_0x1a03('0x3'));var router=express[_0x1a03('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1a03('0x5'));var interaction=require(_0x1a03('0x6'));var config=require(_0x1a03('0x7'));var controller=require(_0x1a03('0x8'));router[_0x1a03('0x9')](_0x1a03('0xa'),auth['isAuthenticated'](),controller[_0x1a03('0xb')]);router['delete'](_0x1a03('0xa'),auth[_0x1a03('0xc')](),controller[_0x1a03('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 4530d6b..a880860 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 _0xcade=['sequelize','exports','STRING','name'];(function(_0x8b69e9,_0x1407f9){var _0x485d2d=function(_0x3b9ce1){while(--_0x3b9ce1){_0x8b69e9['push'](_0x8b69e9['shift']());}};_0x485d2d(++_0x1407f9);}(_0xcade,0x158));var _0xecad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcade[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xecad('0x0'));module[_0xecad('0x1')]={'name':{'type':Sequelize[_0xecad('0x2')],'allowNull':![],'unique':_0xecad('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xecad('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xd0f9=['sequelize','exports','STRING','name','INTEGER'];(function(_0x5b2a4c,_0x428307){var _0x555f58=function(_0xfd344){while(--_0xfd344){_0x5b2a4c['push'](_0x5b2a4c['shift']());}};_0x555f58(++_0x428307);}(_0xd0f9,0x9b));var _0x9d0f=function(_0x50e593,_0x3ae998){_0x50e593=_0x50e593-0x0;var _0x3821d0=_0xd0f9[_0x50e593];return _0x3821d0;};'use strict';var Sequelize=require(_0x9d0f('0x0'));module[_0x9d0f('0x1')]={'name':{'type':Sequelize[_0x9d0f('0x2')],'allowNull':![],'unique':_0x9d0f('0x3')},'OrderBy':{'type':Sequelize[_0x9d0f('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 5b50f19..2129071 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 _0xaebd=['error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','ContactItemTypes','destroy','stack','name','send','map','ContactItemType','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','rows','show','keys','rawAttributes','length','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation'];(function(_0x5d44fa,_0x43563d){var _0x62d8ec=function(_0x279a11){while(--_0x279a11){_0x5d44fa['push'](_0x5d44fa['shift']());}};_0x62d8ec(++_0x43563d);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x345476,_0x1f7b15){_0x345476=_0x345476-0x0;var _0x3191c5=_0xaebd[_0x345476];return _0x3191c5;};'use strict';var emlformat=require(_0xdaeb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdaeb('0x1'));var jsonpatch=require(_0xdaeb('0x2'));var rp=require(_0xdaeb('0x3'));var moment=require(_0xdaeb('0x4'));var BPromise=require(_0xdaeb('0x5'));var Mustache=require('mustache');var util=require(_0xdaeb('0x6'));var path=require(_0xdaeb('0x7'));var sox=require(_0xdaeb('0x8'));var csv=require(_0xdaeb('0x9'));var ejs=require(_0xdaeb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdaeb('0xb'));var squel=require(_0xdaeb('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdaeb('0xd'));var toCsv=require(_0xdaeb('0x9'));var querystring=require(_0xdaeb('0xe'));var Papa=require('papaparse');var Redis=require(_0xdaeb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xdaeb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdaeb('0x11'));var logger=require('../../config/logger')(_0xdaeb('0x12'));var utils=require(_0xdaeb('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdaeb('0x14'))['db'];function respondWithStatusCode(_0x5aedaa,_0x4ee3cc){_0x4ee3cc=_0x4ee3cc||0xcc;return function(_0x2673db){if(_0x2673db){return _0x5aedaa[_0xdaeb('0x15')](_0x4ee3cc);}return _0x5aedaa[_0xdaeb('0x16')](_0x4ee3cc)[_0xdaeb('0x17')]();};}function respondWithResult(_0x1f31be,_0xc6c611){_0xc6c611=_0xc6c611||0xc8;return function(_0x49ba9a){if(_0x49ba9a){return _0x1f31be['status'](_0xc6c611)[_0xdaeb('0x18')](_0x49ba9a);}};}function respondWithFilteredResult(_0x306bdb,_0x34b2fe){return function(_0x18ec4e){if(_0x18ec4e){var _0x538a25=typeof _0x34b2fe['offset']===_0xdaeb('0x19')&&typeof _0x34b2fe['limit']==='undefined';var _0x42e509=_0x18ec4e[_0xdaeb('0x1a')];var _0x1b5243=_0x538a25?0x0:_0x34b2fe[_0xdaeb('0x1b')];var _0x2d8f11=_0x538a25?_0x18ec4e[_0xdaeb('0x1a')]:_0x34b2fe['offset']+_0x34b2fe[_0xdaeb('0x1c')];var _0x5ccf66;if(_0x2d8f11>=_0x42e509){_0x2d8f11=_0x42e509;_0x5ccf66=0xc8;}else{_0x5ccf66=0xce;}_0x306bdb[_0xdaeb('0x16')](_0x5ccf66);return _0x306bdb[_0xdaeb('0x1d')](_0xdaeb('0x1e'),_0x1b5243+'-'+_0x2d8f11+'/'+_0x42e509)['json'](_0x18ec4e);}return null;};}function patchUpdates(_0x4e97e0){return function(_0x13563c){try{jsonpatch[_0xdaeb('0x1f')](_0x13563c,_0x4e97e0,!![]);}catch(_0x23fccb){return BPromise[_0xdaeb('0x20')](_0x23fccb);}return _0x13563c[_0xdaeb('0x21')]();};}function saveUpdates(_0x536aae,_0x597bb7){return function(_0x2c969d){if(_0x2c969d){return _0x2c969d[_0xdaeb('0x22')](_0x536aae)[_0xdaeb('0x23')](function(_0x1d919a){return _0x1d919a;});}return null;};}function removeEntity(_0x39dfae,_0x55c825){return function(_0x254c3b){if(_0x254c3b){return _0x254c3b['destroy']()[_0xdaeb('0x23')](function(){var _0x398616=_0x254c3b[_0xdaeb('0x24')]({'plain':!![]});var _0x3b0770=_0xdaeb('0x25');return db['UserProfileResource'][_0xdaeb('0x26')]({'where':{'type':_0x3b0770,'resourceId':_0x398616['id']}})[_0xdaeb('0x23')](function(){return _0x254c3b;});})[_0xdaeb('0x23')](function(){_0x39dfae['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x43095f,_0x4e7f44){return function(_0x5045f8){if(!_0x5045f8){_0x43095f[_0xdaeb('0x15')](0x194);}return _0x5045f8;};}function handleError(_0x1ff9af,_0x3e2b8c){_0x3e2b8c=_0x3e2b8c||0x1f4;return function(_0x5eb7b5){logger['error'](_0x5eb7b5[_0xdaeb('0x27')]);if(_0x5eb7b5[_0xdaeb('0x28')]){delete _0x5eb7b5[_0xdaeb('0x28')];}_0x1ff9af['status'](_0x3e2b8c)[_0xdaeb('0x29')](_0x5eb7b5);};}exports['index']=function(_0x4da82d,_0x28812c){var _0x21f6cf={},_0x2fb019={},_0x28c15c={'count':0x0,'rows':[]};var _0x3276c2=_[_0xdaeb('0x2a')](db[_0xdaeb('0x2b')]['rawAttributes'],function(_0x1c1c7c){return{'name':_0x1c1c7c[_0xdaeb('0x2c')],'type':_0x1c1c7c[_0xdaeb('0x2d')][_0xdaeb('0x2e')]};});_0x2fb019[_0xdaeb('0x2f')]=_['map'](_0x3276c2,_0xdaeb('0x28'));_0x2fb019[_0xdaeb('0x30')]=_['keys'](_0x4da82d[_0xdaeb('0x30')]);_0x2fb019[_0xdaeb('0x31')]=_[_0xdaeb('0x32')](_0x2fb019[_0xdaeb('0x2f')],_0x2fb019[_0xdaeb('0x30')]);_0x21f6cf[_0xdaeb('0x33')]=_[_0xdaeb('0x32')](_0x2fb019[_0xdaeb('0x2f')],qs[_0xdaeb('0x34')](_0x4da82d[_0xdaeb('0x30')]['fields']));_0x21f6cf['attributes']=_0x21f6cf[_0xdaeb('0x33')]['length']?_0x21f6cf[_0xdaeb('0x33')]:_0x2fb019[_0xdaeb('0x2f')];if(!_0x4da82d[_0xdaeb('0x30')][_0xdaeb('0x35')](_0xdaeb('0x36'))){_0x21f6cf[_0xdaeb('0x1c')]=qs['limit'](_0x4da82d[_0xdaeb('0x30')][_0xdaeb('0x1c')]);_0x21f6cf[_0xdaeb('0x1b')]=qs['offset'](_0x4da82d[_0xdaeb('0x30')][_0xdaeb('0x1b')]);}_0x21f6cf[_0xdaeb('0x37')]=qs[_0xdaeb('0x38')](_0x4da82d[_0xdaeb('0x30')][_0xdaeb('0x38')]);_0x21f6cf[_0xdaeb('0x39')]=qs['filters'](_[_0xdaeb('0x3a')](_0x4da82d[_0xdaeb('0x30')],_0x2fb019['filters']),_0x3276c2);if(_0x4da82d['query'][_0xdaeb('0x3b')]){_0x21f6cf[_0xdaeb('0x39')]=_['merge'](_0x21f6cf[_0xdaeb('0x39')],{'$or':_[_0xdaeb('0x2a')](_0x3276c2,function(_0x5a4de2){if(_0x5a4de2[_0xdaeb('0x2d')]!==_0xdaeb('0x3c')){var _0x4ecba7={};_0x4ecba7[_0x5a4de2['name']]={'$like':'%'+_0x4da82d[_0xdaeb('0x30')][_0xdaeb('0x3b')]+'%'};return _0x4ecba7;}})});}_0x21f6cf=_[_0xdaeb('0x3d')]({},_0x21f6cf,_0x4da82d[_0xdaeb('0x3e')]);var _0x2ea883={'where':_0x21f6cf[_0xdaeb('0x39')]};return db['ContactItemType'][_0xdaeb('0x1a')](_0x2ea883)['then'](function(_0x46aa44){_0x28c15c['count']=_0x46aa44;if(_0x4da82d['query'][_0xdaeb('0x3f')]){_0x21f6cf['include']=[{'all':!![]}];}return db[_0xdaeb('0x2b')]['findAll'](_0x21f6cf);})[_0xdaeb('0x23')](function(_0x244369){_0x28c15c[_0xdaeb('0x40')]=_0x244369;return _0x28c15c;})[_0xdaeb('0x23')](respondWithFilteredResult(_0x28812c,_0x21f6cf))['catch'](handleError(_0x28812c,null));};exports[_0xdaeb('0x41')]=function(_0x5a4b41,_0x3cc6a4){var _0xfb250e={'raw':!![],'where':{'id':_0x5a4b41['params']['id']}},_0x447ef0={};_0x447ef0[_0xdaeb('0x2f')]=_[_0xdaeb('0x42')](db[_0xdaeb('0x2b')][_0xdaeb('0x43')]);_0x447ef0[_0xdaeb('0x30')]=_[_0xdaeb('0x42')](_0x5a4b41[_0xdaeb('0x30')]);_0x447ef0[_0xdaeb('0x31')]=_[_0xdaeb('0x32')](_0x447ef0[_0xdaeb('0x2f')],_0x447ef0[_0xdaeb('0x30')]);_0xfb250e[_0xdaeb('0x33')]=_['intersection'](_0x447ef0[_0xdaeb('0x2f')],qs[_0xdaeb('0x34')](_0x5a4b41['query']['fields']));_0xfb250e[_0xdaeb('0x33')]=_0xfb250e[_0xdaeb('0x33')][_0xdaeb('0x44')]?_0xfb250e['attributes']:_0x447ef0[_0xdaeb('0x2f')];if(_0x5a4b41[_0xdaeb('0x30')][_0xdaeb('0x3f')]){_0xfb250e[_0xdaeb('0x45')]=[{'all':!![]}];}_0xfb250e=_[_0xdaeb('0x3d')]({},_0xfb250e,_0x5a4b41[_0xdaeb('0x3e')]);return db[_0xdaeb('0x2b')][_0xdaeb('0x46')](_0xfb250e)['then'](handleEntityNotFound(_0x3cc6a4,null))[_0xdaeb('0x23')](respondWithResult(_0x3cc6a4,null))[_0xdaeb('0x47')](handleError(_0x3cc6a4,null));};exports['create']=function(_0x38d2ee,_0x4dd70c){return db[_0xdaeb('0x2b')][_0xdaeb('0x48')](_0x38d2ee[_0xdaeb('0x49')],{})[_0xdaeb('0x23')](function(_0x5df403){var _0x449f64=_0x38d2ee[_0xdaeb('0x4a')][_0xdaeb('0x24')]({'plain':!![]});if(!_0x449f64)throw new Error(_0xdaeb('0x4b'));if(_0x449f64['role']==='user'){var _0x1403c8=_0x5df403[_0xdaeb('0x24')]({'plain':!![]});var _0x311219=_0xdaeb('0x25');return db[_0xdaeb('0x4c')][_0xdaeb('0x46')]({'where':{'name':_0x311219,'userProfileId':_0x449f64['userProfileId']},'raw':!![]})[_0xdaeb('0x23')](function(_0x42af1a){if(_0x42af1a&&_0x42af1a[_0xdaeb('0x4d')]===0x0){return db['UserProfileResource'][_0xdaeb('0x48')]({'name':_0x1403c8['name'],'resourceId':_0x1403c8['id'],'type':_0x42af1a[_0xdaeb('0x28')],'sectionId':_0x42af1a['id']},{})[_0xdaeb('0x23')](function(){return _0x5df403;});}else{return _0x5df403;}})[_0xdaeb('0x47')](function(_0x395e2c){logger[_0xdaeb('0x4e')](_0xdaeb('0x4f'),_0x395e2c);throw _0x395e2c;});}return _0x5df403;})['then'](respondWithResult(_0x4dd70c,0xc9))['catch'](handleError(_0x4dd70c,null));};exports['update']=function(_0x2260c5,_0x10287e){if(_0x2260c5['body']['id']){delete _0x2260c5['body']['id'];}return db['ContactItemType'][_0xdaeb('0x46')]({'where':{'id':_0x2260c5[_0xdaeb('0x50')]['id']}})[_0xdaeb('0x23')](handleEntityNotFound(_0x10287e,null))[_0xdaeb('0x23')](saveUpdates(_0x2260c5[_0xdaeb('0x49')],null))['then'](respondWithResult(_0x10287e,null))[_0xdaeb('0x47')](handleError(_0x10287e,null));};exports['destroy']=function(_0x25e58f,_0x1b87b2){return db[_0xdaeb('0x2b')][_0xdaeb('0x46')]({'where':{'id':_0x25e58f[_0xdaeb('0x50')]['id']}})[_0xdaeb('0x23')](handleEntityNotFound(_0x1b87b2,null))['then'](db['CmContactHasItem'][_0xdaeb('0x22')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x25e58f['params']['id']}}))[_0xdaeb('0x23')](removeEntity(_0x1b87b2,null))[_0xdaeb('0x47')](handleError(_0x1b87b2,null));}; \ No newline at end of file +var _0x28f2=['api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','Content-Range','apply','reject','save','update','then','destroy','get','ContactItemTypes','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','ContactItemType','count','include','findAll','rows','catch','show','keys','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','params','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0xcaa712,_0x562e5b){var _0x462ef8=function(_0x279076){while(--_0x279076){_0xcaa712['push'](_0xcaa712['shift']());}};_0x462ef8(++_0x562e5b);}(_0x28f2,0x193));var _0x228f=function(_0x281326,_0x15ada8){_0x281326=_0x281326-0x0;var _0x33bfff=_0x28f2[_0x281326];return _0x33bfff;};'use strict';var emlformat=require(_0x228f('0x0'));var rimraf=require(_0x228f('0x1'));var zipdir=require(_0x228f('0x2'));var jsonpatch=require(_0x228f('0x3'));var rp=require(_0x228f('0x4'));var moment=require('moment');var BPromise=require(_0x228f('0x5'));var Mustache=require(_0x228f('0x6'));var util=require(_0x228f('0x7'));var path=require(_0x228f('0x8'));var sox=require(_0x228f('0x9'));var csv=require(_0x228f('0xa'));var ejs=require(_0x228f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x228f('0xc'));var squel=require('squel');var crypto=require(_0x228f('0xd'));var jsforce=require(_0x228f('0xe'));var deskjs=require(_0x228f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x228f('0x10'));var Papa=require('papaparse');var Redis=require(_0x228f('0x11'));var authService=require(_0x228f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x228f('0x13'));var hardwareService=require(_0x228f('0x14'));var logger=require(_0x228f('0x15'))(_0x228f('0x16'));var utils=require(_0x228f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x228f('0x18'));var db=require(_0x228f('0x19'))['db'];function respondWithStatusCode(_0x24f69c,_0x14073a){_0x14073a=_0x14073a||0xcc;return function(_0x2e1a43){if(_0x2e1a43){return _0x24f69c[_0x228f('0x1a')](_0x14073a);}return _0x24f69c[_0x228f('0x1b')](_0x14073a)[_0x228f('0x1c')]();};}function respondWithResult(_0x572535,_0x2fab95){_0x2fab95=_0x2fab95||0xc8;return function(_0xfb6aff){if(_0xfb6aff){return _0x572535[_0x228f('0x1b')](_0x2fab95)[_0x228f('0x1d')](_0xfb6aff);}};}function respondWithFilteredResult(_0x2a4d87,_0x21a913){return function(_0x272723){if(_0x272723){var _0x5b5abb=typeof _0x21a913[_0x228f('0x1e')]==='undefined'&&typeof _0x21a913[_0x228f('0x1f')]===_0x228f('0x20');var _0x195e65=_0x272723['count'];var _0x2d4819=_0x5b5abb?0x0:_0x21a913['offset'];var _0x33e32e=_0x5b5abb?_0x272723['count']:_0x21a913[_0x228f('0x1e')]+_0x21a913['limit'];var _0x5aa203;if(_0x33e32e>=_0x195e65){_0x33e32e=_0x195e65;_0x5aa203=0xc8;}else{_0x5aa203=0xce;}_0x2a4d87[_0x228f('0x1b')](_0x5aa203);return _0x2a4d87['set'](_0x228f('0x21'),_0x2d4819+'-'+_0x33e32e+'/'+_0x195e65)[_0x228f('0x1d')](_0x272723);}return null;};}function patchUpdates(_0x1294a8){return function(_0x3a623a){try{jsonpatch[_0x228f('0x22')](_0x3a623a,_0x1294a8,!![]);}catch(_0x313cf2){return BPromise[_0x228f('0x23')](_0x313cf2);}return _0x3a623a[_0x228f('0x24')]();};}function saveUpdates(_0x15d54f,_0x4ee0c9){return function(_0x1e96d4){if(_0x1e96d4){return _0x1e96d4[_0x228f('0x25')](_0x15d54f)[_0x228f('0x26')](function(_0x3c00ad){return _0x3c00ad;});}return null;};}function removeEntity(_0x1dad27,_0x194d1a){return function(_0x33e882){if(_0x33e882){return _0x33e882[_0x228f('0x27')]()[_0x228f('0x26')](function(){var _0x56fbc2=_0x33e882[_0x228f('0x28')]({'plain':!![]});var _0x306928=_0x228f('0x29');return db[_0x228f('0x2a')][_0x228f('0x27')]({'where':{'type':_0x306928,'resourceId':_0x56fbc2['id']}})['then'](function(){return _0x33e882;});})[_0x228f('0x26')](function(){_0x1dad27['status'](0xcc)[_0x228f('0x1c')]();});}};}function handleEntityNotFound(_0x5afa52,_0x58a151){return function(_0x2b9802){if(!_0x2b9802){_0x5afa52[_0x228f('0x1a')](0x194);}return _0x2b9802;};}function handleError(_0x2a7842,_0x3ab339){_0x3ab339=_0x3ab339||0x1f4;return function(_0x34c735){logger[_0x228f('0x2b')](_0x34c735[_0x228f('0x2c')]);if(_0x34c735[_0x228f('0x2d')]){delete _0x34c735[_0x228f('0x2d')];}_0x2a7842[_0x228f('0x1b')](_0x3ab339)[_0x228f('0x2e')](_0x34c735);};}exports[_0x228f('0x2f')]=function(_0xc25917,_0xc6921f){var _0x2a3677={},_0x4e9ca8={},_0x4148ff={'count':0x0,'rows':[]};var _0x40bf17=_[_0x228f('0x30')](db['ContactItemType'][_0x228f('0x31')],function(_0x41be2d){return{'name':_0x41be2d['fieldName'],'type':_0x41be2d[_0x228f('0x32')][_0x228f('0x33')]};});_0x4e9ca8[_0x228f('0x34')]=_[_0x228f('0x30')](_0x40bf17,'name');_0x4e9ca8[_0x228f('0x35')]=_['keys'](_0xc25917[_0x228f('0x35')]);_0x4e9ca8[_0x228f('0x36')]=_[_0x228f('0x37')](_0x4e9ca8[_0x228f('0x34')],_0x4e9ca8['query']);_0x2a3677[_0x228f('0x38')]=_[_0x228f('0x37')](_0x4e9ca8['model'],qs['fields'](_0xc25917['query'][_0x228f('0x39')]));_0x2a3677[_0x228f('0x38')]=_0x2a3677[_0x228f('0x38')][_0x228f('0x3a')]?_0x2a3677[_0x228f('0x38')]:_0x4e9ca8[_0x228f('0x34')];if(!_0xc25917[_0x228f('0x35')][_0x228f('0x3b')](_0x228f('0x3c'))){_0x2a3677['limit']=qs['limit'](_0xc25917[_0x228f('0x35')][_0x228f('0x1f')]);_0x2a3677[_0x228f('0x1e')]=qs[_0x228f('0x1e')](_0xc25917[_0x228f('0x35')][_0x228f('0x1e')]);}_0x2a3677[_0x228f('0x3d')]=qs[_0x228f('0x3e')](_0xc25917[_0x228f('0x35')][_0x228f('0x3e')]);_0x2a3677['where']=qs['filters'](_[_0x228f('0x3f')](_0xc25917[_0x228f('0x35')],_0x4e9ca8[_0x228f('0x36')]),_0x40bf17);if(_0xc25917[_0x228f('0x35')]['filter']){_0x2a3677[_0x228f('0x40')]=_[_0x228f('0x41')](_0x2a3677['where'],{'$or':_['map'](_0x40bf17,function(_0x3da115){if(_0x3da115[_0x228f('0x32')]!=='VIRTUAL'){var _0x12a750={};_0x12a750[_0x3da115[_0x228f('0x2d')]]={'$like':'%'+_0xc25917['query']['filter']+'%'};return _0x12a750;}})});}_0x2a3677=_[_0x228f('0x41')]({},_0x2a3677,_0xc25917['options']);var _0x323d68={'where':_0x2a3677[_0x228f('0x40')]};return db[_0x228f('0x42')][_0x228f('0x43')](_0x323d68)[_0x228f('0x26')](function(_0x20c178){_0x4148ff['count']=_0x20c178;if(_0xc25917[_0x228f('0x35')]['includeAll']){_0x2a3677[_0x228f('0x44')]=[{'all':!![]}];}return db[_0x228f('0x42')][_0x228f('0x45')](_0x2a3677);})[_0x228f('0x26')](function(_0x41cba5){_0x4148ff[_0x228f('0x46')]=_0x41cba5;return _0x4148ff;})[_0x228f('0x26')](respondWithFilteredResult(_0xc6921f,_0x2a3677))[_0x228f('0x47')](handleError(_0xc6921f,null));};exports[_0x228f('0x48')]=function(_0x2592a1,_0x788e8b){var _0x345114={'raw':!![],'where':{'id':_0x2592a1['params']['id']}},_0x19839d={};_0x19839d['model']=_[_0x228f('0x49')](db[_0x228f('0x42')][_0x228f('0x31')]);_0x19839d[_0x228f('0x35')]=_[_0x228f('0x49')](_0x2592a1[_0x228f('0x35')]);_0x19839d[_0x228f('0x36')]=_[_0x228f('0x37')](_0x19839d[_0x228f('0x34')],_0x19839d[_0x228f('0x35')]);_0x345114['attributes']=_[_0x228f('0x37')](_0x19839d[_0x228f('0x34')],qs['fields'](_0x2592a1[_0x228f('0x35')]['fields']));_0x345114[_0x228f('0x38')]=_0x345114['attributes'][_0x228f('0x3a')]?_0x345114['attributes']:_0x19839d[_0x228f('0x34')];if(_0x2592a1[_0x228f('0x35')][_0x228f('0x4a')]){_0x345114[_0x228f('0x44')]=[{'all':!![]}];}_0x345114=_[_0x228f('0x41')]({},_0x345114,_0x2592a1[_0x228f('0x4b')]);return db[_0x228f('0x42')][_0x228f('0x4c')](_0x345114)[_0x228f('0x26')](handleEntityNotFound(_0x788e8b,null))[_0x228f('0x26')](respondWithResult(_0x788e8b,null))[_0x228f('0x47')](handleError(_0x788e8b,null));};exports[_0x228f('0x4d')]=function(_0x4099d4,_0x250345){return db[_0x228f('0x42')][_0x228f('0x4d')](_0x4099d4[_0x228f('0x4e')],{})[_0x228f('0x26')](function(_0x1872e2){var _0x55e140=_0x4099d4['user'][_0x228f('0x28')]({'plain':!![]});if(!_0x55e140)throw new Error(_0x228f('0x4f'));if(_0x55e140[_0x228f('0x50')]==='user'){var _0x17bcd9=_0x1872e2[_0x228f('0x28')]({'plain':!![]});var _0x28f91e='ContactItemTypes';return db['UserProfileSection']['find']({'where':{'name':_0x28f91e,'userProfileId':_0x55e140[_0x228f('0x51')]},'raw':!![]})[_0x228f('0x26')](function(_0x208397){if(_0x208397&&_0x208397[_0x228f('0x52')]===0x0){return db[_0x228f('0x2a')][_0x228f('0x4d')]({'name':_0x17bcd9[_0x228f('0x2d')],'resourceId':_0x17bcd9['id'],'type':_0x208397[_0x228f('0x2d')],'sectionId':_0x208397['id']},{})[_0x228f('0x26')](function(){return _0x1872e2;});}else{return _0x1872e2;}})[_0x228f('0x47')](function(_0x43bbd2){logger[_0x228f('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43bbd2);throw _0x43bbd2;});}return _0x1872e2;})[_0x228f('0x26')](respondWithResult(_0x250345,0xc9))[_0x228f('0x47')](handleError(_0x250345,null));};exports[_0x228f('0x25')]=function(_0x561144,_0x3e9f76){if(_0x561144[_0x228f('0x4e')]['id']){delete _0x561144[_0x228f('0x4e')]['id'];}return db[_0x228f('0x42')]['find']({'where':{'id':_0x561144[_0x228f('0x53')]['id']}})[_0x228f('0x26')](handleEntityNotFound(_0x3e9f76,null))[_0x228f('0x26')](saveUpdates(_0x561144[_0x228f('0x4e')],null))['then'](respondWithResult(_0x3e9f76,null))[_0x228f('0x47')](handleError(_0x3e9f76,null));};exports[_0x228f('0x27')]=function(_0x4b516e,_0x32787c){return db[_0x228f('0x42')][_0x228f('0x4c')]({'where':{'id':_0x4b516e[_0x228f('0x53')]['id']}})[_0x228f('0x26')](handleEntityNotFound(_0x32787c,null))[_0x228f('0x26')](db[_0x228f('0x54')][_0x228f('0x25')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x4b516e[_0x228f('0x53')]['id']}}))[_0x228f('0x26')](removeEntity(_0x32787c,null))['catch'](handleError(_0x32787c,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 9351969..ef4c0a0 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 _0x2c20=['moment','path','rimraf','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType','lodash','../../config/logger','api'];(function(_0x4d1965,_0x43152e){var _0xdcfade=function(_0x3d3b8a){while(--_0x3d3b8a){_0x4d1965['push'](_0x4d1965['shift']());}};_0xdcfade(++_0x43152e);}(_0x2c20,0x131));var _0x02c2=function(_0x52a059,_0x46e42e){_0x52a059=_0x52a059-0x0;var _0x250df2=_0x2c20[_0x52a059];return _0x250df2;};'use strict';var _=require(_0x02c2('0x0'));var util=require('util');var logger=require(_0x02c2('0x1'))(_0x02c2('0x2'));var moment=require(_0x02c2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x02c2('0x4'));var rimraf=require(_0x02c2('0x5'));var config=require(_0x02c2('0x6'));var attributes=require(_0x02c2('0x7'));module[_0x02c2('0x8')]=function(_0x20ff9a,_0x4a7379){return _0x20ff9a[_0x02c2('0x9')](_0x02c2('0xa'),attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9794=['tools_contact_item_types','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./contactItemType.attributes','exports','define'];(function(_0x555048,_0x11572){var _0x13ab62=function(_0x531595){while(--_0x531595){_0x555048['push'](_0x555048['shift']());}};_0x13ab62(++_0x11572);}(_0x9794,0xd2));var _0x4979=function(_0x5d0131,_0x1b1497){_0x5d0131=_0x5d0131-0x0;var _0x3915d8=_0x9794[_0x5d0131];return _0x3915d8;};'use strict';var _=require('lodash');var util=require(_0x4979('0x0'));var logger=require(_0x4979('0x1'))(_0x4979('0x2'));var moment=require(_0x4979('0x3'));var BPromise=require(_0x4979('0x4'));var rp=require(_0x4979('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4979('0x6'));var config=require('../../config/environment');var attributes=require(_0x4979('0x7'));module[_0x4979('0x8')]=function(_0x2cb883,_0xa4d103){return _0x2cb883[_0x4979('0x9')]('ContactItemType',attributes,{'tableName':_0x4979('0xa'),'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 de6fc43..9993a15 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 _0x7f97=['stringify','error','code','message','ContactItemType,\x20%s,\x20%s','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s'];(function(_0x28f078,_0x20349e){var _0xee8fe6=function(_0x349442){while(--_0x349442){_0x28f078['push'](_0x28f078['shift']());}};_0xee8fe6(++_0x20349e);}(_0x7f97,0x157));var _0x77f9=function(_0x54ce25,_0x512ed2){_0x54ce25=_0x54ce25-0x0;var _0x244f10=_0x7f97[_0x54ce25];return _0x244f10;};'use strict';var _=require('lodash');var util=require(_0x77f9('0x0'));var moment=require(_0x77f9('0x1'));var BPromise=require('bluebird');var rs=require(_0x77f9('0x2'));var fs=require('fs');var Redis=require(_0x77f9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x77f9('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x77f9('0x5'));var jayson=require(_0x77f9('0x6'));var client=jayson['client'][_0x77f9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1a833a,_0x29a7b4,_0x1be0b5){return new BPromise(function(_0x1d917a,_0x437964){return client[_0x77f9('0x8')](_0x1a833a,_0x1be0b5)[_0x77f9('0x9')](function(_0x1d2ae5){logger[_0x77f9('0xa')]('ContactItemType,\x20%s,\x20%s',_0x29a7b4,_0x77f9('0xb'));logger[_0x77f9('0xc')](_0x77f9('0xd'),_0x29a7b4,'request\x20sent',JSON[_0x77f9('0xe')](_0x1d2ae5));if(_0x1d2ae5[_0x77f9('0xf')]){if(_0x1d2ae5[_0x77f9('0xf')][_0x77f9('0x10')]===0x1f4){logger[_0x77f9('0xf')]('ContactItemType,\x20%s,\x20%s',_0x29a7b4,_0x1d2ae5[_0x77f9('0xf')][_0x77f9('0x11')]);return _0x437964(_0x1d2ae5[_0x77f9('0xf')][_0x77f9('0x11')]);}logger['error'](_0x77f9('0x12'),_0x29a7b4,_0x1d2ae5[_0x77f9('0xf')]['message']);return _0x1d917a(_0x1d2ae5[_0x77f9('0xf')][_0x77f9('0x11')]);}else{logger[_0x77f9('0xa')](_0x77f9('0x12'),_0x29a7b4,_0x77f9('0xb'));_0x1d917a(_0x1d2ae5[_0x77f9('0x13')][_0x77f9('0x11')]);}})[_0x77f9('0x14')](function(_0xa20f3e){logger[_0x77f9('0xf')](_0x77f9('0x12'),_0x29a7b4,_0xa20f3e);_0x437964(_0xa20f3e);});});} \ No newline at end of file +var _0x360c=['then','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','jayson/promise','http','request'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x360c,0x129));var _0xc360=function(_0x4ec682,_0xfb328f){_0x4ec682=_0x4ec682-0x0;var _0x143568=_0x360c[_0x4ec682];return _0x143568;};'use strict';var _=require(_0xc360('0x0'));var util=require(_0xc360('0x1'));var moment=require(_0xc360('0x2'));var BPromise=require('bluebird');var rs=require(_0xc360('0x3'));var fs=require('fs');var Redis=require(_0xc360('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc360('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc360('0x6'));var client=jayson['client'][_0xc360('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x333c67,_0x5a5595,_0x2ebff3){return new BPromise(function(_0x113e89,_0x444cdd){return client[_0xc360('0x8')](_0x333c67,_0x2ebff3)[_0xc360('0x9')](function(_0x23185b){logger['info'](_0xc360('0xa'),_0x5a5595,_0xc360('0xb'));logger[_0xc360('0xc')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x5a5595,_0xc360('0xb'),JSON[_0xc360('0xd')](_0x23185b));if(_0x23185b[_0xc360('0xe')]){if(_0x23185b[_0xc360('0xe')][_0xc360('0xf')]===0x1f4){logger[_0xc360('0xe')]('ContactItemType,\x20%s,\x20%s',_0x5a5595,_0x23185b[_0xc360('0xe')][_0xc360('0x10')]);return _0x444cdd(_0x23185b[_0xc360('0xe')][_0xc360('0x10')]);}logger[_0xc360('0xe')](_0xc360('0xa'),_0x5a5595,_0x23185b[_0xc360('0xe')][_0xc360('0x10')]);return _0x113e89(_0x23185b['error']['message']);}else{logger['info']('ContactItemType,\x20%s,\x20%s',_0x5a5595,_0xc360('0xb'));_0x113e89(_0x23185b['result']['message']);}})[_0xc360('0x11')](function(_0x5bf545){logger[_0xc360('0xe')]('ContactItemType,\x20%s,\x20%s',_0x5a5595,_0x5bf545);_0x444cdd(_0x5bf545);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 4db639e..b483eaf 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 _0x042d=['get','isAuthenticated','index','/:id','post','create','put','update','delete','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller'];(function(_0x528763,_0xd9454){var _0x58f4f8=function(_0x55f3f9){while(--_0x55f3f9){_0x528763['push'](_0x528763['shift']());}};_0x58f4f8(++_0xd9454);}(_0x042d,0x1ba));var _0xd042=function(_0x1dd82f,_0x52acb7){_0x1dd82f=_0x1dd82f-0x0;var _0x353ca4=_0x042d[_0x1dd82f];return _0x353ca4;};'use strict';var multer=require('multer');var util=require(_0xd042('0x0'));var path=require(_0xd042('0x1'));var timeout=require(_0xd042('0x2'));var express=require(_0xd042('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd042('0x4'));var interaction=require(_0xd042('0x5'));var config=require(_0xd042('0x6'));var controller=require(_0xd042('0x7'));router[_0xd042('0x8')]('/',auth[_0xd042('0x9')](),controller[_0xd042('0xa')]);router[_0xd042('0x8')](_0xd042('0xb'),auth[_0xd042('0x9')](),controller['show']);router[_0xd042('0xc')]('/',auth[_0xd042('0x9')](),controller[_0xd042('0xd')]);router[_0xd042('0xe')]('/:id',auth[_0xd042('0x9')](),controller[_0xd042('0xf')]);router[_0xd042('0x10')](_0xd042('0xb'),auth[_0xd042('0x9')](),controller['destroy']);module[_0xd042('0x11')]=router; \ No newline at end of file +var _0x50d1=['/:id','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x50d1,0xcd));var _0x150d=function(_0x3a6104,_0x4fdd9f){_0x3a6104=_0x3a6104-0x0;var _0x6db10c=_0x50d1[_0x3a6104];return _0x6db10c;};'use strict';var multer=require('multer');var util=require(_0x150d('0x0'));var path=require(_0x150d('0x1'));var timeout=require(_0x150d('0x2'));var express=require(_0x150d('0x3'));var router=express['Router']();var fs_extra=require(_0x150d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x150d('0x5'));var config=require(_0x150d('0x6'));var controller=require(_0x150d('0x7'));router[_0x150d('0x8')]('/',auth[_0x150d('0x9')](),controller[_0x150d('0xa')]);router['get'](_0x150d('0xb'),auth[_0x150d('0x9')](),controller['show']);router['post']('/',auth[_0x150d('0x9')](),controller[_0x150d('0xc')]);router[_0x150d('0xd')]('/:id',auth[_0x150d('0x9')](),controller[_0x150d('0xe')]);router[_0x150d('0xf')](_0x150d('0xb'),auth[_0x150d('0x9')](),controller[_0x150d('0x10')]);module[_0x150d('0x11')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 77f090f..237df58 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 _0x0713=['STRING','name'];(function(_0x5df6f0,_0x197a9f){var _0x252619=function(_0x310e38){while(--_0x310e38){_0x5df6f0['push'](_0x5df6f0['shift']());}};_0x252619(++_0x197a9f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x11f064,_0x49e57d){var _0x1fb0e4=function(_0x5a622e){while(--_0x5a622e){_0x11f064['push'](_0x11f064['shift']());}};_0x1fb0e4(++_0x49e57d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 2d209bc..a1633a1 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 _0x0424=['merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','rawAttributes','fields','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','user','userProfileId','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','type','attrRefresh','widgetAttributes:\x20%s','DashboardId','findOne','DashboardItem','order','getItems','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./dashboard.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','get','CustomDashboards','UserProfileResource','then','error','stack','name','send','map','Dashboard','fieldName','key','model','query','intersection','attributes','length','hasOwnProperty','sort','where','pick','filters','filter'];(function(_0x2fea90,_0x3ff48d){var _0x3ef0ff=function(_0x3b0152){while(--_0x3b0152){_0x2fea90['push'](_0x2fea90['shift']());}};_0x3ef0ff(++_0x3ff48d);}(_0x0424,0x1c2));var _0x4042=function(_0x9664b9,_0x51d10e){_0x9664b9=_0x9664b9-0x0;var _0x420c36=_0x0424[_0x9664b9];return _0x420c36;};'use strict';var emlformat=require(_0x4042('0x0'));var rimraf=require(_0x4042('0x1'));var zipdir=require(_0x4042('0x2'));var jsonpatch=require(_0x4042('0x3'));var rp=require(_0x4042('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4042('0x5'));var util=require(_0x4042('0x6'));var path=require(_0x4042('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4042('0x8'));var fs=require('fs');var fs_extra=require(_0x4042('0x9'));var _=require(_0x4042('0xa'));var squel=require(_0x4042('0xb'));var crypto=require(_0x4042('0xc'));var jsforce=require(_0x4042('0xd'));var deskjs=require(_0x4042('0xe'));var toCsv=require(_0x4042('0xf'));var querystring=require(_0x4042('0x10'));var Papa=require(_0x4042('0x11'));var Redis=require(_0x4042('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4042('0x13'));var as=require(_0x4042('0x14'));var hardwareService=require(_0x4042('0x15'));var logger=require('../../config/logger')(_0x4042('0x16'));var utils=require(_0x4042('0x17'));var config=require(_0x4042('0x18'));var licenseUtil=require(_0x4042('0x19'));var db=require('../../mysqldb')['db'];config[_0x4042('0x1a')]=_['defaults'](config[_0x4042('0x1a')],{'host':_0x4042('0x1b'),'port':0x18eb});var socket=require(_0x4042('0x1c'))(new Redis(config[_0x4042('0x1a')]));require(_0x4042('0x1d'))[_0x4042('0x1e')](socket);function respondWithStatusCode(_0xb97a1c,_0x4fff2d){_0x4fff2d=_0x4fff2d||0xcc;return function(_0x5ef2f4){if(_0x5ef2f4){return _0xb97a1c['sendStatus'](_0x4fff2d);}return _0xb97a1c[_0x4042('0x1f')](_0x4fff2d)[_0x4042('0x20')]();};}function respondWithResult(_0x268dbd,_0x30e437){_0x30e437=_0x30e437||0xc8;return function(_0x22b465){if(_0x22b465){return _0x268dbd['status'](_0x30e437)[_0x4042('0x21')](_0x22b465);}};}function respondWithFilteredResult(_0x5703b4,_0x1ac6ae){return function(_0x6e06f0){if(_0x6e06f0){var _0x56ad5f=typeof _0x1ac6ae[_0x4042('0x22')]===_0x4042('0x23')&&typeof _0x1ac6ae[_0x4042('0x24')]===_0x4042('0x23');var _0x558aca=_0x6e06f0['count'];var _0x2defa4=_0x56ad5f?0x0:_0x1ac6ae['offset'];var _0x3c7e30=_0x56ad5f?_0x6e06f0[_0x4042('0x25')]:_0x1ac6ae[_0x4042('0x22')]+_0x1ac6ae[_0x4042('0x24')];var _0x36e252;if(_0x3c7e30>=_0x558aca){_0x3c7e30=_0x558aca;_0x36e252=0xc8;}else{_0x36e252=0xce;}_0x5703b4[_0x4042('0x1f')](_0x36e252);return _0x5703b4[_0x4042('0x26')](_0x4042('0x27'),_0x2defa4+'-'+_0x3c7e30+'/'+_0x558aca)['json'](_0x6e06f0);}return null;};}function patchUpdates(_0x24fe2e){return function(_0x4ea016){try{jsonpatch[_0x4042('0x28')](_0x4ea016,_0x24fe2e,!![]);}catch(_0x5c3d5a){return BPromise['reject'](_0x5c3d5a);}return _0x4ea016['save']();};}function saveUpdates(_0x43c7e1,_0x118fc7){return function(_0x1450fd){if(_0x1450fd){return _0x1450fd[_0x4042('0x29')](_0x43c7e1)['then'](function(_0x47f82b){return _0x47f82b;});}return null;};}function removeEntity(_0x174a2f,_0x149cce){return function(_0x255a56){if(_0x255a56){return _0x255a56[_0x4042('0x2a')]()['then'](function(){var _0x20e93b=_0x255a56[_0x4042('0x2b')]({'plain':!![]});var _0x1dd801=_0x4042('0x2c');return db[_0x4042('0x2d')][_0x4042('0x2a')]({'where':{'type':_0x1dd801,'resourceId':_0x20e93b['id']}})[_0x4042('0x2e')](function(){return _0x255a56;});})[_0x4042('0x2e')](function(){_0x174a2f['status'](0xcc)[_0x4042('0x20')]();});}};}function handleEntityNotFound(_0x4d9443,_0x45fb53){return function(_0x193b1d){if(!_0x193b1d){_0x4d9443['sendStatus'](0x194);}return _0x193b1d;};}function handleError(_0x22ffa7,_0x7a4d6a){_0x7a4d6a=_0x7a4d6a||0x1f4;return function(_0x5d30d8){logger[_0x4042('0x2f')](_0x5d30d8[_0x4042('0x30')]);if(_0x5d30d8[_0x4042('0x31')]){delete _0x5d30d8[_0x4042('0x31')];}_0x22ffa7[_0x4042('0x1f')](_0x7a4d6a)[_0x4042('0x32')](_0x5d30d8);};}exports['index']=function(_0x22ca9e,_0x4c06fb){var _0x27231d={},_0x3ea5a1={},_0x232b28={'count':0x0,'rows':[]};var _0xba35fe=_[_0x4042('0x33')](db[_0x4042('0x34')]['rawAttributes'],function(_0x19ccc7){return{'name':_0x19ccc7[_0x4042('0x35')],'type':_0x19ccc7['type'][_0x4042('0x36')]};});_0x3ea5a1[_0x4042('0x37')]=_[_0x4042('0x33')](_0xba35fe,_0x4042('0x31'));_0x3ea5a1[_0x4042('0x38')]=_['keys'](_0x22ca9e[_0x4042('0x38')]);_0x3ea5a1['filters']=_[_0x4042('0x39')](_0x3ea5a1[_0x4042('0x37')],_0x3ea5a1[_0x4042('0x38')]);_0x27231d[_0x4042('0x3a')]=_['intersection'](_0x3ea5a1[_0x4042('0x37')],qs['fields'](_0x22ca9e['query']['fields']));_0x27231d['attributes']=_0x27231d[_0x4042('0x3a')][_0x4042('0x3b')]?_0x27231d[_0x4042('0x3a')]:_0x3ea5a1['model'];if(!_0x22ca9e[_0x4042('0x38')][_0x4042('0x3c')]('nolimit')){_0x27231d[_0x4042('0x24')]=qs[_0x4042('0x24')](_0x22ca9e[_0x4042('0x38')][_0x4042('0x24')]);_0x27231d['offset']=qs[_0x4042('0x22')](_0x22ca9e[_0x4042('0x38')][_0x4042('0x22')]);}_0x27231d['order']=qs[_0x4042('0x3d')](_0x22ca9e[_0x4042('0x38')][_0x4042('0x3d')]);_0x27231d[_0x4042('0x3e')]=qs['filters'](_[_0x4042('0x3f')](_0x22ca9e[_0x4042('0x38')],_0x3ea5a1[_0x4042('0x40')]),_0xba35fe);if(_0x22ca9e['query'][_0x4042('0x41')]){_0x27231d[_0x4042('0x3e')]=_[_0x4042('0x42')](_0x27231d[_0x4042('0x3e')],{'$or':_['map'](_0xba35fe,function(_0x437682){if(_0x437682['type']!==_0x4042('0x43')){var _0x5950a1={};_0x5950a1[_0x437682[_0x4042('0x31')]]={'$like':'%'+_0x22ca9e['query'][_0x4042('0x41')]+'%'};return _0x5950a1;}})});}_0x27231d=_[_0x4042('0x42')]({},_0x27231d,_0x22ca9e[_0x4042('0x44')]);var _0x500afd={'where':_0x27231d[_0x4042('0x3e')]};return db[_0x4042('0x34')][_0x4042('0x25')](_0x500afd)['then'](function(_0x576c5b){_0x232b28['count']=_0x576c5b;if(_0x22ca9e[_0x4042('0x38')][_0x4042('0x45')]){_0x27231d[_0x4042('0x46')]=[{'all':!![]}];}return db[_0x4042('0x34')]['findAll'](_0x27231d);})[_0x4042('0x2e')](function(_0x1866dd){_0x232b28[_0x4042('0x47')]=_0x1866dd;return _0x232b28;})[_0x4042('0x2e')](respondWithFilteredResult(_0x4c06fb,_0x27231d))['catch'](handleError(_0x4c06fb,null));};exports[_0x4042('0x48')]=function(_0x56c8f3,_0x1a2c96){var _0x147a7b={'raw':![],'where':{'id':_0x56c8f3[_0x4042('0x49')]['id']}},_0x594265={};_0x594265['model']=_[_0x4042('0x4a')](db[_0x4042('0x34')][_0x4042('0x4b')]);_0x594265[_0x4042('0x38')]=_[_0x4042('0x4a')](_0x56c8f3['query']);_0x594265[_0x4042('0x40')]=_[_0x4042('0x39')](_0x594265[_0x4042('0x37')],_0x594265[_0x4042('0x38')]);_0x147a7b[_0x4042('0x3a')]=_[_0x4042('0x39')](_0x594265['model'],qs['fields'](_0x56c8f3['query'][_0x4042('0x4c')]));_0x147a7b['attributes']=_0x147a7b[_0x4042('0x3a')]['length']?_0x147a7b[_0x4042('0x3a')]:_0x594265[_0x4042('0x37')];if(_0x56c8f3['query'][_0x4042('0x45')]){_0x147a7b[_0x4042('0x46')]=[{'all':!![]}];}_0x147a7b=_[_0x4042('0x42')]({},_0x147a7b,_0x56c8f3[_0x4042('0x44')]);return db['Dashboard'][_0x4042('0x4d')](_0x147a7b)[_0x4042('0x2e')](handleEntityNotFound(_0x1a2c96,null))[_0x4042('0x2e')](respondWithResult(_0x1a2c96,null))[_0x4042('0x4e')](handleError(_0x1a2c96,null));};exports['create']=function(_0x143d4c,_0xb2e14d){return db['Dashboard'][_0x4042('0x4f')](_0x143d4c[_0x4042('0x50')],{})[_0x4042('0x2e')](function(_0x644914){var _0x15af8a=_0x143d4c['user'][_0x4042('0x2b')]({'plain':!![]});if(!_0x15af8a)throw new Error(_0x4042('0x51'));if(_0x15af8a[_0x4042('0x52')]==='user'){var _0x2b6c93=_0x644914[_0x4042('0x2b')]({'plain':!![]});var _0x172be8=_0x4042('0x2c');return db[_0x4042('0x53')][_0x4042('0x4d')]({'where':{'name':_0x172be8,'userProfileId':_0x15af8a['userProfileId']},'raw':!![]})[_0x4042('0x2e')](function(_0x2ef2c0){if(_0x2ef2c0&&_0x2ef2c0[_0x4042('0x54')]===0x0){return db[_0x4042('0x2d')][_0x4042('0x4f')]({'name':_0x2b6c93['name'],'resourceId':_0x2b6c93['id'],'type':_0x2ef2c0[_0x4042('0x31')],'sectionId':_0x2ef2c0['id']},{})[_0x4042('0x2e')](function(){return _0x644914;});}else{return _0x644914;}})[_0x4042('0x4e')](function(_0x55619a){logger[_0x4042('0x2f')](_0x4042('0x55'),_0x55619a);throw _0x55619a;});}return _0x644914;})[_0x4042('0x2e')](respondWithResult(_0xb2e14d,0xc9))[_0x4042('0x4e')](handleError(_0xb2e14d,null));};exports[_0x4042('0x56')]=function(_0x2366fd,_0x5ec12f){var _0x1c262c={'where':{'id':_0x2366fd[_0x4042('0x49')]['id']}},_0xa71807={};_0xa71807[_0x4042('0x37')]=_[_0x4042('0x4a')](db[_0x4042('0x34')][_0x4042('0x4b')]);_0x1c262c[_0x4042('0x3a')]=_['intersection'](_0xa71807['model'],qs['fields'](_0x2366fd['query'][_0x4042('0x4c')]));_0x1c262c['attributes']=_0x1c262c[_0x4042('0x3a')][_0x4042('0x3b')]?_0x1c262c[_0x4042('0x3a')]:_0xa71807[_0x4042('0x37')];if(_0x2366fd[_0x4042('0x38')][_0x4042('0x45')]){_0x1c262c[_0x4042('0x46')]=[{'all':!![]}];}_0x1c262c=_[_0x4042('0x42')]({},_0x1c262c,_0x2366fd[_0x4042('0x44')]);return db['Dashboard']['find'](_0x1c262c)['then'](handleEntityNotFound(_0x5ec12f,null))[_0x4042('0x2e')](function(_0x5bac7f){if(_0x5bac7f){var _0x166736=_0x5bac7f[_0x4042('0x2b')]({'plain':!![]});_0x166736=qs[_0x4042('0x57')](_0x166736,['id',_0x4042('0x58'),_0x4042('0x59')]);_0x2366fd[_0x4042('0x50')]=_[_0x4042('0x57')](_0x2366fd[_0x4042('0x50')],['id',_0x4042('0x58'),_0x4042('0x59')]);return db[_0x4042('0x34')][_0x4042('0x4f')](_[_0x4042('0x42')](_0x166736,_0x2366fd[_0x4042('0x50')]),{'include':_0x2366fd[_0x4042('0x38')][_0x4042('0x45')]?[{'all':!![]}]:undefined})[_0x4042('0x2e')](function(_0x5f397e){var _0x22161b=_0x2366fd[_0x4042('0x5a')]['get']({'plain':!![]});if(!_0x22161b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x22161b[_0x4042('0x52')]===_0x4042('0x5a')){var _0x38cc03=_0x5f397e['get']({'plain':!![]});var _0x1acd4b=_0x4042('0x2c');return db[_0x4042('0x53')][_0x4042('0x4d')]({'where':{'name':_0x1acd4b,'userProfileId':_0x22161b[_0x4042('0x5b')]},'raw':!![]})[_0x4042('0x2e')](function(_0x548574){if(_0x548574&&_0x548574['autoAssociation']===0x0){return db[_0x4042('0x2d')][_0x4042('0x4f')]({'name':_0x38cc03[_0x4042('0x31')],'resourceId':_0x38cc03['id'],'type':_0x548574[_0x4042('0x31')],'sectionId':_0x548574['id']},{})[_0x4042('0x2e')](function(){return _0x5f397e;});}else{return _0x5f397e;}})[_0x4042('0x4e')](function(_0x2c7833){logger[_0x4042('0x2f')](_0x4042('0x55'),_0x2c7833);throw _0x2c7833;});}return _0x5f397e;});}})[_0x4042('0x2e')](respondWithResult(_0x5ec12f,0xc9))[_0x4042('0x4e')](handleError(_0x5ec12f,null));};exports['update']=function(_0x27741b,_0x1d069f){if(_0x27741b[_0x4042('0x50')]['id']){delete _0x27741b[_0x4042('0x50')]['id'];}return db[_0x4042('0x34')][_0x4042('0x4d')]({'where':{'id':_0x27741b[_0x4042('0x49')]['id']}})[_0x4042('0x2e')](handleEntityNotFound(_0x1d069f,null))['then'](saveUpdates(_0x27741b[_0x4042('0x50')],null))['then'](respondWithResult(_0x1d069f,null))['catch'](handleError(_0x1d069f,null));};exports['destroy']=function(_0x18f6ae,_0x5a34f7){return db['Dashboard'][_0x4042('0x4d')]({'where':{'id':_0x18f6ae[_0x4042('0x49')]['id']}})[_0x4042('0x2e')](handleEntityNotFound(_0x5a34f7,null))[_0x4042('0x2e')](removeEntity(_0x5a34f7,null))[_0x4042('0x4e')](handleError(_0x5a34f7,null));};function widgetAttributes(_0x42d47e){try{switch(_0x42d47e['type']){case _0x4042('0x5c'):return[{'name':_0x4042('0x5d'),'value':_0x42d47e[_0x4042('0x5d')]||(_0x42d47e[_0x4042('0x5e')]&&_0x42d47e[_0x4042('0x5e')][0x0]?_0x42d47e[_0x4042('0x5e')][0x0][_0x4042('0x5f')]:undefined)||_0x4042('0x60')}];case'custom':return[{'name':'attrPath','value':_0x42d47e[_0x4042('0x61')]||(_0x42d47e[_0x4042('0x5e')]&&_0x42d47e[_0x4042('0x5e')][0x0]?_0x42d47e[_0x4042('0x5e')][0x0][_0x4042('0x5f')]:undefined)||''}];case _0x4042('0x62'):return[{'name':_0x4042('0x63'),'value':_0x42d47e['attrHourFormat']||(_0x42d47e['attrs']&&_0x42d47e['attrs'][0x0]?_0x42d47e['attrs'][0x0]['value']:undefined)||_0x4042('0x64')},{'name':'attrTimezone','value':_0x42d47e['attrTimezone']||(_0x42d47e[_0x4042('0x5e')]&&_0x42d47e[_0x4042('0x5e')][0x1]?_0x42d47e[_0x4042('0x5e')][0x1][_0x4042('0x5f')]:undefined)||_0x4042('0x65')},{'name':_0x4042('0x66'),'value':_0x42d47e['attrFontSize']||(_0x42d47e[_0x4042('0x5e')]&&_0x42d47e[_0x4042('0x5e')][0x2]?_0x42d47e[_0x4042('0x5e')][0x2][_0x4042('0x5f')]:undefined)||0xc}];case'counter':return[{'name':_0x4042('0x67'),'value':_0x42d47e[_0x4042('0x67')]||(_0x42d47e[_0x4042('0x5e')]&&_0x42d47e['attrs'][0x0]?_0x42d47e[_0x4042('0x5e')][0x0][_0x4042('0x5f')]:undefined)||_0x4042('0x68')},{'name':_0x4042('0x69'),'value':_0x42d47e[_0x4042('0x69')]||(_0x42d47e['attrs']&&_0x42d47e['attrs'][0x1]?_0x42d47e[_0x4042('0x5e')][0x1][_0x4042('0x5f')]:undefined)||[]},{'name':_0x4042('0x66'),'value':_0x42d47e[_0x4042('0x66')]||(_0x42d47e['attrs']&&_0x42d47e[_0x4042('0x5e')][0x2]?_0x42d47e['attrs'][0x2][_0x4042('0x5f')]:undefined)||0x14},{'name':_0x4042('0x6a'),'value':_0x42d47e[_0x4042('0x6a')]||(_0x42d47e[_0x4042('0x5e')]&&_0x42d47e['attrs'][0x3]?_0x42d47e[_0x4042('0x5e')][0x3][_0x4042('0x5f')]:undefined)||_0x4042('0x6b')},{'name':_0x4042('0x6c'),'value':_0x42d47e[_0x4042('0x6c')]||(_0x42d47e[_0x4042('0x5e')]&&_0x42d47e[_0x4042('0x5e')][0x4]?_0x42d47e[_0x4042('0x5e')][0x4][_0x4042('0x5f')]:undefined)||''},{'name':_0x4042('0x6d'),'value':_0x42d47e[_0x4042('0x6d')]||(_0x42d47e[_0x4042('0x5e')]&&_0x42d47e[_0x4042('0x5e')][0x5]?_0x42d47e[_0x4042('0x5e')][0x5][_0x4042('0x5f')]:undefined)||''},{'name':_0x4042('0x6e'),'value':_0x42d47e[_0x4042('0x6e')]||(_0x42d47e[_0x4042('0x5e')]&&_0x42d47e['attrs'][0x6]?_0x42d47e['attrs'][0x6][_0x4042('0x5f')]:undefined)||''},{'name':_0x4042('0x6f'),'value':_0x42d47e[_0x4042('0x6f')]||(_0x42d47e[_0x4042('0x5e')]&&_0x42d47e['attrs'][0x7]?_0x42d47e[_0x4042('0x5e')][0x7]['value']:undefined)||''},{'name':_0x4042('0x70'),'value':_0x42d47e[_0x4042('0x70')]||(_0x42d47e[_0x4042('0x5e')]&&_0x42d47e['attrs'][0x8]?_0x42d47e[_0x4042('0x5e')][0x8][_0x4042('0x5f')]:undefined)||''},{'name':'attrChatWebsites','value':_0x42d47e[_0x4042('0x71')]||(_0x42d47e[_0x4042('0x5e')]&&_0x42d47e[_0x4042('0x5e')][0x9]?_0x42d47e['attrs'][0x9][_0x4042('0x5f')]:undefined)||''}];case'multibar-chart':case _0x4042('0x72'):return[{'name':_0x4042('0x73'),'value':_0x42d47e[_0x4042('0x73')]||(_0x42d47e['attrs']&&_0x42d47e[_0x4042('0x5e')][0x0]?_0x42d47e[_0x4042('0x5e')][0x0]['value']:undefined)||_0x4042('0x68')},{'name':_0x4042('0x74'),'value':_0x42d47e['attrSerie2']||(_0x42d47e[_0x4042('0x5e')]&&_0x42d47e['attrs'][0x1]?_0x42d47e['attrs'][0x1][_0x4042('0x5f')]:undefined)||null},{'name':'attrSerie3','value':_0x42d47e[_0x4042('0x75')]||(_0x42d47e['attrs']&&_0x42d47e['attrs'][0x2]?_0x42d47e['attrs'][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x42d47e['attrVoiceQueues']||(_0x42d47e[_0x4042('0x5e')]&&_0x42d47e[_0x4042('0x5e')][0x3]?_0x42d47e[_0x4042('0x5e')][0x3][_0x4042('0x5f')]:undefined)||[]},{'name':_0x4042('0x6a'),'value':_0x42d47e[_0x4042('0x6a')]||(_0x42d47e[_0x4042('0x5e')]&&_0x42d47e['attrs'][0x4]?_0x42d47e[_0x4042('0x5e')][0x4][_0x4042('0x5f')]:undefined)||_0x4042('0x6b')},{'name':_0x4042('0x6c'),'value':_0x42d47e[_0x4042('0x6c')]||(_0x42d47e[_0x4042('0x5e')]&&_0x42d47e[_0x4042('0x5e')][0x5]?_0x42d47e['attrs'][0x5][_0x4042('0x5f')]:undefined)||''},{'name':_0x4042('0x6d'),'value':_0x42d47e['attrFaxAccounts']||(_0x42d47e[_0x4042('0x5e')]&&_0x42d47e[_0x4042('0x5e')][0x6]?_0x42d47e['attrs'][0x6][_0x4042('0x5f')]:undefined)||''},{'name':_0x4042('0x6e'),'value':_0x42d47e['attrSmsAccounts']||(_0x42d47e[_0x4042('0x5e')]&&_0x42d47e[_0x4042('0x5e')][0x7]?_0x42d47e[_0x4042('0x5e')][0x7][_0x4042('0x5f')]:undefined)||''},{'name':_0x4042('0x6f'),'value':_0x42d47e[_0x4042('0x6f')]||(_0x42d47e['attrs']&&_0x42d47e[_0x4042('0x5e')][0x8]?_0x42d47e['attrs'][0x8]['value']:undefined)||''},{'name':_0x4042('0x70'),'value':_0x42d47e[_0x4042('0x70')]||(_0x42d47e[_0x4042('0x5e')]&&_0x42d47e[_0x4042('0x5e')][0x9]?_0x42d47e[_0x4042('0x5e')][0x9][_0x4042('0x5f')]:undefined)||''},{'name':_0x4042('0x71'),'value':_0x42d47e[_0x4042('0x71')]||(_0x42d47e[_0x4042('0x5e')]&&_0x42d47e[_0x4042('0x5e')][0xa]?_0x42d47e[_0x4042('0x5e')][0xa][_0x4042('0x5f')]:undefined)||''}];case _0x4042('0x76'):return[{'name':_0x4042('0x77'),'type':_0x42d47e['reportType']||(_0x42d47e['attrs']&&_0x42d47e[_0x4042('0x5e')][0x0]?_0x42d47e[_0x4042('0x5e')][0x0][_0x4042('0x78')]:undefined)||null,'value':_0x42d47e[_0x4042('0x77')]||(_0x42d47e['attrs']&&_0x42d47e['attrs'][0x0]?_0x42d47e['attrs'][0x0][_0x4042('0x5f')]:undefined)||null},{'name':_0x4042('0x79'),'value':_0x42d47e[_0x4042('0x79')]||(_0x42d47e[_0x4042('0x5e')]&&_0x42d47e[_0x4042('0x5e')][0x1]?_0x42d47e[_0x4042('0x5e')][0x1][_0x4042('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x5c63c9){logger['error'](_0x4042('0x7a'),JSON['stringify'](_0x5c63c9));return[];}}exports['addItem']=function(_0x27484f,_0x2e933e,_0x240b69){if(_0x27484f[_0x4042('0x50')]['id']){delete _0x27484f[_0x4042('0x50')]['id'];}return db['Dashboard']['find']({'where':{'id':_0x27484f[_0x4042('0x49')]['id']}})[_0x4042('0x2e')](handleEntityNotFound(_0x2e933e,null))[_0x4042('0x2e')](function(_0x4409d8){if(_0x4409d8){_0x27484f[_0x4042('0x50')][_0x4042('0x7b')]=_0x4409d8['id'];_0x27484f['body'][_0x4042('0x5e')]=widgetAttributes(_0x27484f[_0x4042('0x50')]);return db['DashboardItem'][_0x4042('0x4f')](_0x27484f['body']);}})[_0x4042('0x2e')](respondWithResult(_0x2e933e,null))[_0x4042('0x4e')](handleError(_0x2e933e,null));};exports['getItems']=function(_0x376940,_0x388188,_0x3cd65c){var _0x193ae5={};var _0x5d09d3={};var _0x29dee6;var _0x3f7eda;return db['Dashboard'][_0x4042('0x7c')]({'where':{'id':_0x376940[_0x4042('0x49')]['id']}})[_0x4042('0x2e')](handleEntityNotFound(_0x388188,null))[_0x4042('0x2e')](function(_0x2495f8){if(_0x2495f8){_0x29dee6=_0x2495f8;_0x5d09d3[_0x4042('0x37')]=_[_0x4042('0x4a')](db[_0x4042('0x7d')][_0x4042('0x4b')]);_0x5d09d3[_0x4042('0x38')]=_[_0x4042('0x4a')](_0x376940[_0x4042('0x38')]);_0x5d09d3[_0x4042('0x40')]=_[_0x4042('0x39')](_0x5d09d3[_0x4042('0x37')],_0x5d09d3[_0x4042('0x38')]);_0x193ae5[_0x4042('0x3a')]=_[_0x4042('0x39')](_0x5d09d3[_0x4042('0x37')],qs['fields'](_0x376940[_0x4042('0x38')][_0x4042('0x4c')]));_0x193ae5[_0x4042('0x3a')]=_0x193ae5['attributes'][_0x4042('0x3b')]?_0x193ae5['attributes']:_0x5d09d3['model'];_0x193ae5[_0x4042('0x7e')]=qs[_0x4042('0x3d')](_0x376940[_0x4042('0x38')][_0x4042('0x3d')]);_0x193ae5['where']=qs[_0x4042('0x40')](_[_0x4042('0x3f')](_0x376940[_0x4042('0x38')],_0x5d09d3[_0x4042('0x40')]));if(_0x376940['query']['filter']){_0x193ae5[_0x4042('0x3e')]=_['merge'](_0x193ae5[_0x4042('0x3e')],{'$or':_[_0x4042('0x33')](_0x193ae5[_0x4042('0x3a')],function(_0x53ce93){var _0x5ee4cc={};_0x5ee4cc[_0x53ce93]={'$like':'%'+_0x376940[_0x4042('0x38')][_0x4042('0x41')]+'%'};return _0x5ee4cc;})});}_0x193ae5=_[_0x4042('0x42')]({},_0x193ae5,_0x376940['options']);return _0x29dee6[_0x4042('0x7f')](_0x193ae5);}})[_0x4042('0x2e')](function(_0x4ec7a6){if(_0x4ec7a6){_0x3f7eda=_0x4ec7a6[_0x4042('0x3b')];if(!_0x376940[_0x4042('0x38')][_0x4042('0x3c')](_0x4042('0x80'))){_0x193ae5[_0x4042('0x24')]=qs[_0x4042('0x24')](_0x376940[_0x4042('0x38')][_0x4042('0x24')]);_0x193ae5[_0x4042('0x22')]=qs[_0x4042('0x22')](_0x376940[_0x4042('0x38')][_0x4042('0x22')]);}return _0x29dee6['getItems'](_0x193ae5);}})[_0x4042('0x2e')](function(_0x2373e6){if(_0x2373e6){return _0x2373e6?{'count':_0x3f7eda,'rows':_0x2373e6}:null;}})[_0x4042('0x2e')](respondWithResult(_0x388188,null))[_0x4042('0x4e')](handleError(_0x388188,null));}; \ No newline at end of file +var _0x8a97=['error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','Dashboard','findAll','rows','catch','length','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','find','updatedAt','omit','createdAt','iframe','attrUrl','attrs','custom','attrPath','clock','attrHourFormat','value','HH:mm:ss','attrTimezone','attrFontSize','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSmsAccounts','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardItem','findOne','getItems','eml-format','rimraf','fast-json-patch','request-promise','moment','util','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','redis','defaults','socket.io-emitter','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','get','CustomDashboards','UserProfileResource','sendStatus'];(function(_0x201b93,_0x236edc){var _0x35df8b=function(_0x91a6b7){while(--_0x91a6b7){_0x201b93['push'](_0x201b93['shift']());}};_0x35df8b(++_0x236edc);}(_0x8a97,0x14d));var _0x78a9=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x8a97[_0x243b2f];return _0xcb3c2d;};'use strict';var emlformat=require(_0x78a9('0x0'));var rimraf=require(_0x78a9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x78a9('0x2'));var rp=require(_0x78a9('0x3'));var moment=require(_0x78a9('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x78a9('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x78a9('0x6'));var ejs=require(_0x78a9('0x7'));var fs=require('fs');var fs_extra=require(_0x78a9('0x8'));var _=require(_0x78a9('0x9'));var squel=require(_0x78a9('0xa'));var crypto=require(_0x78a9('0xb'));var jsforce=require(_0x78a9('0xc'));var deskjs=require(_0x78a9('0xd'));var toCsv=require(_0x78a9('0x6'));var querystring=require(_0x78a9('0xe'));var Papa=require(_0x78a9('0xf'));var Redis=require(_0x78a9('0x10'));var authService=require(_0x78a9('0x11'));var qs=require(_0x78a9('0x12'));var as=require(_0x78a9('0x13'));var hardwareService=require(_0x78a9('0x14'));var logger=require(_0x78a9('0x15'))(_0x78a9('0x16'));var utils=require(_0x78a9('0x17'));var config=require(_0x78a9('0x18'));var licenseUtil=require(_0x78a9('0x19'));var db=require('../../mysqldb')['db'];config[_0x78a9('0x1a')]=_[_0x78a9('0x1b')](config[_0x78a9('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x78a9('0x1c'))(new Redis(config[_0x78a9('0x1a')]));require('./dashboard.socket')[_0x78a9('0x1d')](socket);function respondWithStatusCode(_0x393009,_0x1f1d4d){_0x1f1d4d=_0x1f1d4d||0xcc;return function(_0x52c519){if(_0x52c519){return _0x393009['sendStatus'](_0x1f1d4d);}return _0x393009[_0x78a9('0x1e')](_0x1f1d4d)[_0x78a9('0x1f')]();};}function respondWithResult(_0x12c857,_0x5700cb){_0x5700cb=_0x5700cb||0xc8;return function(_0x40c50e){if(_0x40c50e){return _0x12c857[_0x78a9('0x1e')](_0x5700cb)[_0x78a9('0x20')](_0x40c50e);}};}function respondWithFilteredResult(_0x15afff,_0x58aa82){return function(_0x3995bc){if(_0x3995bc){var _0x5a78c2=typeof _0x58aa82[_0x78a9('0x21')]==='undefined'&&typeof _0x58aa82['limit']===_0x78a9('0x22');var _0x5dca07=_0x3995bc[_0x78a9('0x23')];var _0x132e47=_0x5a78c2?0x0:_0x58aa82[_0x78a9('0x21')];var _0x1c8b06=_0x5a78c2?_0x3995bc[_0x78a9('0x23')]:_0x58aa82[_0x78a9('0x21')]+_0x58aa82[_0x78a9('0x24')];var _0x486e11;if(_0x1c8b06>=_0x5dca07){_0x1c8b06=_0x5dca07;_0x486e11=0xc8;}else{_0x486e11=0xce;}_0x15afff[_0x78a9('0x1e')](_0x486e11);return _0x15afff[_0x78a9('0x25')](_0x78a9('0x26'),_0x132e47+'-'+_0x1c8b06+'/'+_0x5dca07)[_0x78a9('0x20')](_0x3995bc);}return null;};}function patchUpdates(_0x4c7f3d){return function(_0x4bc052){try{jsonpatch[_0x78a9('0x27')](_0x4bc052,_0x4c7f3d,!![]);}catch(_0x3eb2ea){return BPromise['reject'](_0x3eb2ea);}return _0x4bc052[_0x78a9('0x28')]();};}function saveUpdates(_0x63937d,_0x54004b){return function(_0x58b0f7){if(_0x58b0f7){return _0x58b0f7[_0x78a9('0x29')](_0x63937d)[_0x78a9('0x2a')](function(_0x52f907){return _0x52f907;});}return null;};}function removeEntity(_0x3dc103,_0x1bc8bd){return function(_0x4e1ee2){if(_0x4e1ee2){return _0x4e1ee2[_0x78a9('0x2b')]()[_0x78a9('0x2a')](function(){var _0x1d2161=_0x4e1ee2[_0x78a9('0x2c')]({'plain':!![]});var _0x418637=_0x78a9('0x2d');return db[_0x78a9('0x2e')][_0x78a9('0x2b')]({'where':{'type':_0x418637,'resourceId':_0x1d2161['id']}})['then'](function(){return _0x4e1ee2;});})[_0x78a9('0x2a')](function(){_0x3dc103[_0x78a9('0x1e')](0xcc)[_0x78a9('0x1f')]();});}};}function handleEntityNotFound(_0x1de033,_0x4b05e6){return function(_0x1e5905){if(!_0x1e5905){_0x1de033[_0x78a9('0x2f')](0x194);}return _0x1e5905;};}function handleError(_0x5dd118,_0x16ae9a){_0x16ae9a=_0x16ae9a||0x1f4;return function(_0x5ba81a){logger[_0x78a9('0x30')](_0x5ba81a[_0x78a9('0x31')]);if(_0x5ba81a[_0x78a9('0x32')]){delete _0x5ba81a['name'];}_0x5dd118['status'](_0x16ae9a)['send'](_0x5ba81a);};}exports[_0x78a9('0x33')]=function(_0x14c0d7,_0x373c36){var _0x118c5b={},_0x5929a3={},_0x1d3002={'count':0x0,'rows':[]};var _0x4c20a8=_['map'](db['Dashboard'][_0x78a9('0x34')],function(_0x524440){return{'name':_0x524440[_0x78a9('0x35')],'type':_0x524440[_0x78a9('0x36')][_0x78a9('0x37')]};});_0x5929a3[_0x78a9('0x38')]=_[_0x78a9('0x39')](_0x4c20a8,_0x78a9('0x32'));_0x5929a3[_0x78a9('0x3a')]=_[_0x78a9('0x3b')](_0x14c0d7[_0x78a9('0x3a')]);_0x5929a3['filters']=_[_0x78a9('0x3c')](_0x5929a3[_0x78a9('0x38')],_0x5929a3[_0x78a9('0x3a')]);_0x118c5b[_0x78a9('0x3d')]=_['intersection'](_0x5929a3[_0x78a9('0x38')],qs[_0x78a9('0x3e')](_0x14c0d7['query'][_0x78a9('0x3e')]));_0x118c5b[_0x78a9('0x3d')]=_0x118c5b[_0x78a9('0x3d')]['length']?_0x118c5b[_0x78a9('0x3d')]:_0x5929a3[_0x78a9('0x38')];if(!_0x14c0d7['query'][_0x78a9('0x3f')](_0x78a9('0x40'))){_0x118c5b[_0x78a9('0x24')]=qs[_0x78a9('0x24')](_0x14c0d7[_0x78a9('0x3a')][_0x78a9('0x24')]);_0x118c5b[_0x78a9('0x21')]=qs[_0x78a9('0x21')](_0x14c0d7[_0x78a9('0x3a')][_0x78a9('0x21')]);}_0x118c5b[_0x78a9('0x41')]=qs[_0x78a9('0x42')](_0x14c0d7['query'][_0x78a9('0x42')]);_0x118c5b['where']=qs[_0x78a9('0x43')](_[_0x78a9('0x44')](_0x14c0d7[_0x78a9('0x3a')],_0x5929a3[_0x78a9('0x43')]),_0x4c20a8);if(_0x14c0d7[_0x78a9('0x3a')]['filter']){_0x118c5b[_0x78a9('0x45')]=_[_0x78a9('0x46')](_0x118c5b['where'],{'$or':_[_0x78a9('0x39')](_0x4c20a8,function(_0x500960){if(_0x500960[_0x78a9('0x36')]!==_0x78a9('0x47')){var _0x46a6ac={};_0x46a6ac[_0x500960['name']]={'$like':'%'+_0x14c0d7[_0x78a9('0x3a')][_0x78a9('0x48')]+'%'};return _0x46a6ac;}})});}_0x118c5b=_[_0x78a9('0x46')]({},_0x118c5b,_0x14c0d7[_0x78a9('0x49')]);var _0x35bc09={'where':_0x118c5b[_0x78a9('0x45')]};return db['Dashboard'][_0x78a9('0x23')](_0x35bc09)['then'](function(_0x2def02){_0x1d3002[_0x78a9('0x23')]=_0x2def02;if(_0x14c0d7[_0x78a9('0x3a')][_0x78a9('0x4a')]){_0x118c5b[_0x78a9('0x4b')]=[{'all':!![]}];}return db[_0x78a9('0x4c')][_0x78a9('0x4d')](_0x118c5b);})[_0x78a9('0x2a')](function(_0x55b96a){_0x1d3002[_0x78a9('0x4e')]=_0x55b96a;return _0x1d3002;})['then'](respondWithFilteredResult(_0x373c36,_0x118c5b))[_0x78a9('0x4f')](handleError(_0x373c36,null));};exports['show']=function(_0x5c5481,_0x47ea84){var _0x244b81={'raw':![],'where':{'id':_0x5c5481['params']['id']}},_0x25cb62={};_0x25cb62[_0x78a9('0x38')]=_[_0x78a9('0x3b')](db[_0x78a9('0x4c')][_0x78a9('0x34')]);_0x25cb62[_0x78a9('0x3a')]=_['keys'](_0x5c5481[_0x78a9('0x3a')]);_0x25cb62[_0x78a9('0x43')]=_['intersection'](_0x25cb62[_0x78a9('0x38')],_0x25cb62[_0x78a9('0x3a')]);_0x244b81[_0x78a9('0x3d')]=_['intersection'](_0x25cb62[_0x78a9('0x38')],qs[_0x78a9('0x3e')](_0x5c5481[_0x78a9('0x3a')]['fields']));_0x244b81[_0x78a9('0x3d')]=_0x244b81[_0x78a9('0x3d')][_0x78a9('0x50')]?_0x244b81[_0x78a9('0x3d')]:_0x25cb62['model'];if(_0x5c5481['query'][_0x78a9('0x4a')]){_0x244b81['include']=[{'all':!![]}];}_0x244b81=_[_0x78a9('0x46')]({},_0x244b81,_0x5c5481['options']);return db['Dashboard']['find'](_0x244b81)['then'](handleEntityNotFound(_0x47ea84,null))[_0x78a9('0x2a')](respondWithResult(_0x47ea84,null))['catch'](handleError(_0x47ea84,null));};exports[_0x78a9('0x51')]=function(_0x28460a,_0x1b8643){return db[_0x78a9('0x4c')][_0x78a9('0x51')](_0x28460a[_0x78a9('0x52')],{})[_0x78a9('0x2a')](function(_0x3e424f){var _0x512373=_0x28460a['user']['get']({'plain':!![]});if(!_0x512373)throw new Error(_0x78a9('0x53'));if(_0x512373[_0x78a9('0x54')]===_0x78a9('0x55')){var _0x2b11f4=_0x3e424f['get']({'plain':!![]});var _0x17fa1a='CustomDashboards';return db[_0x78a9('0x56')]['find']({'where':{'name':_0x17fa1a,'userProfileId':_0x512373[_0x78a9('0x57')]},'raw':!![]})['then'](function(_0x53dfae){if(_0x53dfae&&_0x53dfae['autoAssociation']===0x0){return db['UserProfileResource'][_0x78a9('0x51')]({'name':_0x2b11f4[_0x78a9('0x32')],'resourceId':_0x2b11f4['id'],'type':_0x53dfae['name'],'sectionId':_0x53dfae['id']},{})[_0x78a9('0x2a')](function(){return _0x3e424f;});}else{return _0x3e424f;}})[_0x78a9('0x4f')](function(_0x38e22c){logger[_0x78a9('0x30')](_0x78a9('0x58'),_0x38e22c);throw _0x38e22c;});}return _0x3e424f;})[_0x78a9('0x2a')](respondWithResult(_0x1b8643,0xc9))[_0x78a9('0x4f')](handleError(_0x1b8643,null));};exports[_0x78a9('0x59')]=function(_0x3a4b0e,_0x13bd2f){var _0x577585={'where':{'id':_0x3a4b0e[_0x78a9('0x5a')]['id']}},_0x263756={};_0x263756[_0x78a9('0x38')]=_['keys'](db[_0x78a9('0x4c')][_0x78a9('0x34')]);_0x577585[_0x78a9('0x3d')]=_[_0x78a9('0x3c')](_0x263756['model'],qs[_0x78a9('0x3e')](_0x3a4b0e[_0x78a9('0x3a')][_0x78a9('0x3e')]));_0x577585['attributes']=_0x577585[_0x78a9('0x3d')][_0x78a9('0x50')]?_0x577585[_0x78a9('0x3d')]:_0x263756[_0x78a9('0x38')];if(_0x3a4b0e[_0x78a9('0x3a')][_0x78a9('0x4a')]){_0x577585[_0x78a9('0x4b')]=[{'all':!![]}];}_0x577585=_[_0x78a9('0x46')]({},_0x577585,_0x3a4b0e[_0x78a9('0x49')]);return db[_0x78a9('0x4c')][_0x78a9('0x5b')](_0x577585)['then'](handleEntityNotFound(_0x13bd2f,null))[_0x78a9('0x2a')](function(_0x4a7863){if(_0x4a7863){var _0x2ebbc6=_0x4a7863[_0x78a9('0x2c')]({'plain':!![]});_0x2ebbc6=qs['omit'](_0x2ebbc6,['id','createdAt',_0x78a9('0x5c')]);_0x3a4b0e[_0x78a9('0x52')]=_[_0x78a9('0x5d')](_0x3a4b0e[_0x78a9('0x52')],['id',_0x78a9('0x5e'),'updatedAt']);return db[_0x78a9('0x4c')][_0x78a9('0x51')](_[_0x78a9('0x46')](_0x2ebbc6,_0x3a4b0e[_0x78a9('0x52')]),{'include':_0x3a4b0e[_0x78a9('0x3a')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x49362b){var _0x1e9bd2=_0x3a4b0e[_0x78a9('0x55')][_0x78a9('0x2c')]({'plain':!![]});if(!_0x1e9bd2)throw new Error(_0x78a9('0x53'));if(_0x1e9bd2[_0x78a9('0x54')]===_0x78a9('0x55')){var _0x5053cc=_0x49362b[_0x78a9('0x2c')]({'plain':!![]});var _0x46b346=_0x78a9('0x2d');return db['UserProfileSection']['find']({'where':{'name':_0x46b346,'userProfileId':_0x1e9bd2[_0x78a9('0x57')]},'raw':!![]})[_0x78a9('0x2a')](function(_0x4d8811){if(_0x4d8811&&_0x4d8811['autoAssociation']===0x0){return db[_0x78a9('0x2e')][_0x78a9('0x51')]({'name':_0x5053cc[_0x78a9('0x32')],'resourceId':_0x5053cc['id'],'type':_0x4d8811[_0x78a9('0x32')],'sectionId':_0x4d8811['id']},{})[_0x78a9('0x2a')](function(){return _0x49362b;});}else{return _0x49362b;}})[_0x78a9('0x4f')](function(_0x6bc5cc){logger[_0x78a9('0x30')](_0x78a9('0x58'),_0x6bc5cc);throw _0x6bc5cc;});}return _0x49362b;});}})[_0x78a9('0x2a')](respondWithResult(_0x13bd2f,0xc9))[_0x78a9('0x4f')](handleError(_0x13bd2f,null));};exports[_0x78a9('0x29')]=function(_0x2f1f75,_0x1c30f6){if(_0x2f1f75[_0x78a9('0x52')]['id']){delete _0x2f1f75[_0x78a9('0x52')]['id'];}return db[_0x78a9('0x4c')][_0x78a9('0x5b')]({'where':{'id':_0x2f1f75[_0x78a9('0x5a')]['id']}})[_0x78a9('0x2a')](handleEntityNotFound(_0x1c30f6,null))[_0x78a9('0x2a')](saveUpdates(_0x2f1f75[_0x78a9('0x52')],null))['then'](respondWithResult(_0x1c30f6,null))[_0x78a9('0x4f')](handleError(_0x1c30f6,null));};exports['destroy']=function(_0x218c16,_0x4e3672){return db[_0x78a9('0x4c')]['find']({'where':{'id':_0x218c16['params']['id']}})['then'](handleEntityNotFound(_0x4e3672,null))[_0x78a9('0x2a')](removeEntity(_0x4e3672,null))[_0x78a9('0x4f')](handleError(_0x4e3672,null));};function widgetAttributes(_0x52fc5f){try{switch(_0x52fc5f[_0x78a9('0x36')]){case _0x78a9('0x5f'):return[{'name':_0x78a9('0x60'),'value':_0x52fc5f[_0x78a9('0x60')]||(_0x52fc5f[_0x78a9('0x61')]&&_0x52fc5f[_0x78a9('0x61')][0x0]?_0x52fc5f[_0x78a9('0x61')][0x0]['value']:undefined)||'https://'}];case _0x78a9('0x62'):return[{'name':_0x78a9('0x63'),'value':_0x52fc5f[_0x78a9('0x63')]||(_0x52fc5f[_0x78a9('0x61')]&&_0x52fc5f[_0x78a9('0x61')][0x0]?_0x52fc5f[_0x78a9('0x61')][0x0]['value']:undefined)||''}];case _0x78a9('0x64'):return[{'name':_0x78a9('0x65'),'value':_0x52fc5f[_0x78a9('0x65')]||(_0x52fc5f['attrs']&&_0x52fc5f[_0x78a9('0x61')][0x0]?_0x52fc5f['attrs'][0x0][_0x78a9('0x66')]:undefined)||_0x78a9('0x67')},{'name':_0x78a9('0x68'),'value':_0x52fc5f['attrTimezone']||(_0x52fc5f[_0x78a9('0x61')]&&_0x52fc5f[_0x78a9('0x61')][0x1]?_0x52fc5f[_0x78a9('0x61')][0x1][_0x78a9('0x66')]:undefined)||'0.00'},{'name':_0x78a9('0x69'),'value':_0x52fc5f[_0x78a9('0x69')]||(_0x52fc5f[_0x78a9('0x61')]&&_0x52fc5f[_0x78a9('0x61')][0x2]?_0x52fc5f[_0x78a9('0x61')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x52fc5f[_0x78a9('0x6a')]||(_0x52fc5f[_0x78a9('0x61')]&&_0x52fc5f['attrs'][0x0]?_0x52fc5f[_0x78a9('0x61')][0x0][_0x78a9('0x66')]:undefined)||'total'},{'name':_0x78a9('0x6b'),'value':_0x52fc5f[_0x78a9('0x6b')]||(_0x52fc5f[_0x78a9('0x61')]&&_0x52fc5f[_0x78a9('0x61')][0x1]?_0x52fc5f[_0x78a9('0x61')][0x1]['value']:undefined)||[]},{'name':_0x78a9('0x69'),'value':_0x52fc5f[_0x78a9('0x69')]||(_0x52fc5f['attrs']&&_0x52fc5f[_0x78a9('0x61')][0x2]?_0x52fc5f[_0x78a9('0x61')][0x2][_0x78a9('0x66')]:undefined)||0x14},{'name':_0x78a9('0x6c'),'value':_0x52fc5f['attrChannel']||(_0x52fc5f[_0x78a9('0x61')]&&_0x52fc5f[_0x78a9('0x61')][0x3]?_0x52fc5f['attrs'][0x3][_0x78a9('0x66')]:undefined)||_0x78a9('0x6d')},{'name':_0x78a9('0x6e'),'value':_0x52fc5f[_0x78a9('0x6e')]||(_0x52fc5f[_0x78a9('0x61')]&&_0x52fc5f[_0x78a9('0x61')][0x4]?_0x52fc5f[_0x78a9('0x61')][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x52fc5f['attrFaxAccounts']||(_0x52fc5f[_0x78a9('0x61')]&&_0x52fc5f[_0x78a9('0x61')][0x5]?_0x52fc5f[_0x78a9('0x61')][0x5][_0x78a9('0x66')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x52fc5f['attrSmsAccounts']||(_0x52fc5f[_0x78a9('0x61')]&&_0x52fc5f[_0x78a9('0x61')][0x6]?_0x52fc5f[_0x78a9('0x61')][0x6][_0x78a9('0x66')]:undefined)||''},{'name':_0x78a9('0x6f'),'value':_0x52fc5f[_0x78a9('0x6f')]||(_0x52fc5f[_0x78a9('0x61')]&&_0x52fc5f[_0x78a9('0x61')][0x7]?_0x52fc5f[_0x78a9('0x61')][0x7][_0x78a9('0x66')]:undefined)||''},{'name':_0x78a9('0x70'),'value':_0x52fc5f[_0x78a9('0x70')]||(_0x52fc5f['attrs']&&_0x52fc5f['attrs'][0x8]?_0x52fc5f[_0x78a9('0x61')][0x8]['value']:undefined)||''},{'name':_0x78a9('0x71'),'value':_0x52fc5f['attrChatWebsites']||(_0x52fc5f[_0x78a9('0x61')]&&_0x52fc5f[_0x78a9('0x61')][0x9]?_0x52fc5f['attrs'][0x9][_0x78a9('0x66')]:undefined)||''}];case _0x78a9('0x72'):case _0x78a9('0x73'):return[{'name':'attrSerie1','value':_0x52fc5f[_0x78a9('0x74')]||(_0x52fc5f[_0x78a9('0x61')]&&_0x52fc5f['attrs'][0x0]?_0x52fc5f[_0x78a9('0x61')][0x0][_0x78a9('0x66')]:undefined)||'total'},{'name':_0x78a9('0x75'),'value':_0x52fc5f['attrSerie2']||(_0x52fc5f[_0x78a9('0x61')]&&_0x52fc5f[_0x78a9('0x61')][0x1]?_0x52fc5f[_0x78a9('0x61')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x52fc5f['attrSerie3']||(_0x52fc5f[_0x78a9('0x61')]&&_0x52fc5f['attrs'][0x2]?_0x52fc5f[_0x78a9('0x61')][0x2][_0x78a9('0x66')]:undefined)||null},{'name':_0x78a9('0x6b'),'value':_0x52fc5f[_0x78a9('0x6b')]||(_0x52fc5f[_0x78a9('0x61')]&&_0x52fc5f[_0x78a9('0x61')][0x3]?_0x52fc5f[_0x78a9('0x61')][0x3][_0x78a9('0x66')]:undefined)||[]},{'name':_0x78a9('0x6c'),'value':_0x52fc5f[_0x78a9('0x6c')]||(_0x52fc5f[_0x78a9('0x61')]&&_0x52fc5f[_0x78a9('0x61')][0x4]?_0x52fc5f[_0x78a9('0x61')][0x4][_0x78a9('0x66')]:undefined)||_0x78a9('0x6d')},{'name':_0x78a9('0x6e'),'value':_0x52fc5f[_0x78a9('0x6e')]||(_0x52fc5f[_0x78a9('0x61')]&&_0x52fc5f[_0x78a9('0x61')][0x5]?_0x52fc5f[_0x78a9('0x61')][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x52fc5f['attrFaxAccounts']||(_0x52fc5f[_0x78a9('0x61')]&&_0x52fc5f['attrs'][0x6]?_0x52fc5f[_0x78a9('0x61')][0x6][_0x78a9('0x66')]:undefined)||''},{'name':_0x78a9('0x76'),'value':_0x52fc5f[_0x78a9('0x76')]||(_0x52fc5f[_0x78a9('0x61')]&&_0x52fc5f['attrs'][0x7]?_0x52fc5f[_0x78a9('0x61')][0x7][_0x78a9('0x66')]:undefined)||''},{'name':_0x78a9('0x6f'),'value':_0x52fc5f[_0x78a9('0x6f')]||(_0x52fc5f[_0x78a9('0x61')]&&_0x52fc5f[_0x78a9('0x61')][0x8]?_0x52fc5f[_0x78a9('0x61')][0x8][_0x78a9('0x66')]:undefined)||''},{'name':_0x78a9('0x70'),'value':_0x52fc5f[_0x78a9('0x70')]||(_0x52fc5f['attrs']&&_0x52fc5f[_0x78a9('0x61')][0x9]?_0x52fc5f[_0x78a9('0x61')][0x9]['value']:undefined)||''},{'name':_0x78a9('0x71'),'value':_0x52fc5f[_0x78a9('0x71')]||(_0x52fc5f[_0x78a9('0x61')]&&_0x52fc5f[_0x78a9('0x61')][0xa]?_0x52fc5f[_0x78a9('0x61')][0xa][_0x78a9('0x66')]:undefined)||''}];case'web-report':return[{'name':_0x78a9('0x77'),'type':_0x52fc5f[_0x78a9('0x78')]||(_0x52fc5f[_0x78a9('0x61')]&&_0x52fc5f[_0x78a9('0x61')][0x0]?_0x52fc5f['attrs'][0x0][_0x78a9('0x36')]:undefined)||null,'value':_0x52fc5f[_0x78a9('0x77')]||(_0x52fc5f[_0x78a9('0x61')]&&_0x52fc5f[_0x78a9('0x61')][0x0]?_0x52fc5f['attrs'][0x0][_0x78a9('0x66')]:undefined)||null},{'name':_0x78a9('0x79'),'value':_0x52fc5f[_0x78a9('0x79')]||(_0x52fc5f[_0x78a9('0x61')]&&_0x52fc5f[_0x78a9('0x61')][0x1]?_0x52fc5f[_0x78a9('0x61')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x42ba8b){logger[_0x78a9('0x30')](_0x78a9('0x7a'),JSON[_0x78a9('0x7b')](_0x42ba8b));return[];}}exports['addItem']=function(_0x492ad4,_0x552d5a,_0x477af1){if(_0x492ad4[_0x78a9('0x52')]['id']){delete _0x492ad4[_0x78a9('0x52')]['id'];}return db[_0x78a9('0x4c')]['find']({'where':{'id':_0x492ad4[_0x78a9('0x5a')]['id']}})['then'](handleEntityNotFound(_0x552d5a,null))['then'](function(_0x5b3215){if(_0x5b3215){_0x492ad4[_0x78a9('0x52')]['DashboardId']=_0x5b3215['id'];_0x492ad4[_0x78a9('0x52')][_0x78a9('0x61')]=widgetAttributes(_0x492ad4[_0x78a9('0x52')]);return db[_0x78a9('0x7c')]['create'](_0x492ad4[_0x78a9('0x52')]);}})[_0x78a9('0x2a')](respondWithResult(_0x552d5a,null))[_0x78a9('0x4f')](handleError(_0x552d5a,null));};exports['getItems']=function(_0x245a50,_0xde24de,_0x134fca){var _0x1be036={};var _0x4eed97={};var _0x2ee389;var _0x216dd4;return db[_0x78a9('0x4c')][_0x78a9('0x7d')]({'where':{'id':_0x245a50['params']['id']}})[_0x78a9('0x2a')](handleEntityNotFound(_0xde24de,null))[_0x78a9('0x2a')](function(_0x3d4413){if(_0x3d4413){_0x2ee389=_0x3d4413;_0x4eed97[_0x78a9('0x38')]=_[_0x78a9('0x3b')](db[_0x78a9('0x7c')][_0x78a9('0x34')]);_0x4eed97['query']=_[_0x78a9('0x3b')](_0x245a50[_0x78a9('0x3a')]);_0x4eed97['filters']=_['intersection'](_0x4eed97[_0x78a9('0x38')],_0x4eed97['query']);_0x1be036[_0x78a9('0x3d')]=_[_0x78a9('0x3c')](_0x4eed97[_0x78a9('0x38')],qs['fields'](_0x245a50[_0x78a9('0x3a')]['fields']));_0x1be036[_0x78a9('0x3d')]=_0x1be036[_0x78a9('0x3d')]['length']?_0x1be036['attributes']:_0x4eed97[_0x78a9('0x38')];_0x1be036[_0x78a9('0x41')]=qs[_0x78a9('0x42')](_0x245a50[_0x78a9('0x3a')][_0x78a9('0x42')]);_0x1be036['where']=qs['filters'](_[_0x78a9('0x44')](_0x245a50[_0x78a9('0x3a')],_0x4eed97[_0x78a9('0x43')]));if(_0x245a50[_0x78a9('0x3a')]['filter']){_0x1be036['where']=_['merge'](_0x1be036[_0x78a9('0x45')],{'$or':_[_0x78a9('0x39')](_0x1be036['attributes'],function(_0x1b75f5){var _0x4b9042={};_0x4b9042[_0x1b75f5]={'$like':'%'+_0x245a50['query'][_0x78a9('0x48')]+'%'};return _0x4b9042;})});}_0x1be036=_['merge']({},_0x1be036,_0x245a50[_0x78a9('0x49')]);return _0x2ee389[_0x78a9('0x7e')](_0x1be036);}})[_0x78a9('0x2a')](function(_0x3ce1aa){if(_0x3ce1aa){_0x216dd4=_0x3ce1aa['length'];if(!_0x245a50[_0x78a9('0x3a')][_0x78a9('0x3f')](_0x78a9('0x40'))){_0x1be036['limit']=qs[_0x78a9('0x24')](_0x245a50[_0x78a9('0x3a')][_0x78a9('0x24')]);_0x1be036[_0x78a9('0x21')]=qs[_0x78a9('0x21')](_0x245a50['query'][_0x78a9('0x21')]);}return _0x2ee389[_0x78a9('0x7e')](_0x1be036);}})[_0x78a9('0x2a')](function(_0x571241){if(_0x571241){return _0x571241?{'count':_0x216dd4,'rows':_0x571241}:null;}})[_0x78a9('0x2a')](respondWithResult(_0xde24de,null))[_0x78a9('0x4f')](handleError(_0xde24de,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index a37d7f5..cc9607a 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 _0xbf3e=['save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xbf3e,0xee));var _0xebf3=function(_0x284340,_0x13d6ff){_0x284340=_0x284340-0x0;var _0x5107a0=_0xbf3e[_0x284340];return _0x5107a0;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0xebf3('0x0'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xebf3('0x1')](0x0);var events={'afterCreate':_0xebf3('0x2'),'afterUpdate':_0xebf3('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4aa4bf){return function(_0x3f9330,_0xcbde2b,_0x3bf2f9){DashboardEvents[_0xebf3('0x4')](_0x4aa4bf+':'+_0x3f9330['id'],_0x3f9330);DashboardEvents['emit'](_0x4aa4bf,_0x3f9330);_0x3bf2f9(null);};}for(var e in events){if(events[_0xebf3('0x5')](e)){var event=events[e];Dashboard[_0xebf3('0x6')](e,emitEvent(event));}}module[_0xebf3('0x7')]=DashboardEvents; \ No newline at end of file +var _0x7f73=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x1886d0,_0x36d4b4){var _0x152689=function(_0x4515e4){while(--_0x4515e4){_0x1886d0['push'](_0x1886d0['shift']());}};_0x152689(++_0x36d4b4);}(_0x7f73,0xfa));var _0x37f7=function(_0x5d8107,_0xac6cff){_0x5d8107=_0x5d8107-0x0;var _0x3c61fd=_0x7f73[_0x5d8107];return _0x3c61fd;};'use strict';var EventEmitter=require(_0x37f7('0x0'));var Dashboard=require(_0x37f7('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x37f7('0x2')](0x0);var events={'afterCreate':_0x37f7('0x3'),'afterUpdate':_0x37f7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1adcd7){return function(_0x5fbc39,_0x412bc7,_0x19f16c){DashboardEvents[_0x37f7('0x5')](_0x1adcd7+':'+_0x5fbc39['id'],_0x5fbc39);DashboardEvents[_0x37f7('0x5')](_0x1adcd7,_0x5fbc39);_0x19f16c(null);};}for(var e in events){if(events[_0x37f7('0x6')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x37f7('0x7')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 62361e8..354161a 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 _0xc31c=['lodash','util','api','bluebird','request-promise','path','exports','define','dashboards'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xc31c,0x144));var _0xcc31=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xc31c[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0xcc31('0x0'));var util=require(_0xcc31('0x1'));var logger=require('../../config/logger')(_0xcc31('0x2'));var moment=require('moment');var BPromise=require(_0xcc31('0x3'));var rp=require(_0xcc31('0x4'));var fs=require('fs');var path=require(_0xcc31('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./dashboard.attributes');module[_0xcc31('0x6')]=function(_0x34d025,_0xfb2453){return _0x34d025[_0xcc31('0x7')]('Dashboard',attributes,{'tableName':_0xcc31('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x927d=['dashboards','util','api','moment','bluebird','rimraf','../../config/environment','exports','Dashboard'];(function(_0x276f8d,_0x46a8ea){var _0x525575=function(_0x9a9137){while(--_0x9a9137){_0x276f8d['push'](_0x276f8d['shift']());}};_0x525575(++_0x46a8ea);}(_0x927d,0x88));var _0xd927=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x927d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd927('0x0'));var logger=require('../../config/logger')(_0xd927('0x1'));var moment=require(_0xd927('0x2'));var BPromise=require(_0xd927('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd927('0x4'));var config=require(_0xd927('0x5'));var attributes=require('./dashboard.attributes');module[_0xd927('0x6')]=function(_0x5810d9,_0x17ee19){return _0x5810d9['define'](_0xd927('0x7'),attributes,{'tableName':_0xd927('0x8'),'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 b0875ea..44d6e06 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 _0xf8e9=['jayson/promise','http','redis','defaults','localhost','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring'];(function(_0x5109bc,_0x5d8217){var _0x49c6f2=function(_0x268340){while(--_0x268340){_0x5109bc['push'](_0x5109bc['shift']());}};_0x49c6f2(++_0x5d8217);}(_0xf8e9,0xee));var _0x9f8e=function(_0x11bbc5,_0x2a4491){_0x11bbc5=_0x11bbc5-0x0;var _0x132d54=_0xf8e9[_0x11bbc5];return _0x132d54;};'use strict';var _=require(_0x9f8e('0x0'));var util=require(_0x9f8e('0x1'));var moment=require('moment');var BPromise=require(_0x9f8e('0x2'));var rs=require(_0x9f8e('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(_0x9f8e('0x4'));var client=jayson['client'][_0x9f8e('0x5')]({'port':0x232a});config[_0x9f8e('0x6')]=_[_0x9f8e('0x7')](config[_0x9f8e('0x6')],{'host':_0x9f8e('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9f8e('0x6')]));require(_0x9f8e('0x9'))[_0x9f8e('0xa')](socket);function respondWithRpcPromise(_0x43a37c,_0xea55e8,_0x942a1f){return new BPromise(function(_0x16a45c,_0x535f57){return client[_0x9f8e('0xb')](_0x43a37c,_0x942a1f)[_0x9f8e('0xc')](function(_0x122756){logger[_0x9f8e('0xd')](_0x9f8e('0xe'),_0xea55e8,_0x9f8e('0xf'));logger[_0x9f8e('0x10')](_0x9f8e('0x11'),_0xea55e8,_0x9f8e('0xf'),JSON[_0x9f8e('0x12')](_0x122756));if(_0x122756['error']){if(_0x122756[_0x9f8e('0x13')][_0x9f8e('0x14')]===0x1f4){logger['error'](_0x9f8e('0xe'),_0xea55e8,_0x122756['error'][_0x9f8e('0x15')]);return _0x535f57(_0x122756['error'][_0x9f8e('0x15')]);}logger[_0x9f8e('0x13')](_0x9f8e('0xe'),_0xea55e8,_0x122756['error'][_0x9f8e('0x15')]);return _0x16a45c(_0x122756[_0x9f8e('0x13')][_0x9f8e('0x15')]);}else{logger[_0x9f8e('0xd')]('Dashboard,\x20%s,\x20%s',_0xea55e8,_0x9f8e('0xf'));_0x16a45c(_0x122756['result'][_0x9f8e('0x15')]);}})['catch'](function(_0x903d8){logger[_0x9f8e('0x13')](_0x9f8e('0xe'),_0xea55e8,_0x903d8);_0x535f57(_0x903d8);});});} \ No newline at end of file +var _0xcc37=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x140bde,_0x445256){var _0x6b0a88=function(_0x5d9f2c){while(--_0x5d9f2c){_0x140bde['push'](_0x140bde['shift']());}};_0x6b0a88(++_0x445256);}(_0xcc37,0xa7));var _0x7cc3=function(_0x2a18a2,_0x4470ab){_0x2a18a2=_0x2a18a2-0x0;var _0x543c79=_0xcc37[_0x2a18a2];return _0x543c79;};'use strict';var _=require('lodash');var util=require(_0x7cc3('0x0'));var moment=require(_0x7cc3('0x1'));var BPromise=require('bluebird');var rs=require(_0x7cc3('0x2'));var fs=require('fs');var Redis=require(_0x7cc3('0x3'));var db=require(_0x7cc3('0x4'))['db'];var utils=require(_0x7cc3('0x5'));var logger=require(_0x7cc3('0x6'))(_0x7cc3('0x7'));var config=require('../../config/environment');var jayson=require(_0x7cc3('0x8'));var client=jayson[_0x7cc3('0x9')]['http']({'port':0x232a});config[_0x7cc3('0xa')]=_[_0x7cc3('0xb')](config[_0x7cc3('0xa')],{'host':_0x7cc3('0xc'),'port':0x18eb});var socket=require(_0x7cc3('0xd'))(new Redis(config[_0x7cc3('0xa')]));require(_0x7cc3('0xe'))[_0x7cc3('0xf')](socket);function respondWithRpcPromise(_0xf2ab9,_0x631d0,_0x52537f){return new BPromise(function(_0x517ed8,_0x1d0af6){return client[_0x7cc3('0x10')](_0xf2ab9,_0x52537f)[_0x7cc3('0x11')](function(_0x4c8afe){logger['info'](_0x7cc3('0x12'),_0x631d0,_0x7cc3('0x13'));logger[_0x7cc3('0x14')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x631d0,_0x7cc3('0x13'),JSON[_0x7cc3('0x15')](_0x4c8afe));if(_0x4c8afe[_0x7cc3('0x16')]){if(_0x4c8afe[_0x7cc3('0x16')]['code']===0x1f4){logger[_0x7cc3('0x16')](_0x7cc3('0x12'),_0x631d0,_0x4c8afe[_0x7cc3('0x16')][_0x7cc3('0x17')]);return _0x1d0af6(_0x4c8afe['error']['message']);}logger[_0x7cc3('0x16')](_0x7cc3('0x12'),_0x631d0,_0x4c8afe[_0x7cc3('0x16')][_0x7cc3('0x17')]);return _0x517ed8(_0x4c8afe[_0x7cc3('0x16')][_0x7cc3('0x17')]);}else{logger['info'](_0x7cc3('0x12'),_0x631d0,_0x7cc3('0x13'));_0x517ed8(_0x4c8afe['result'][_0x7cc3('0x17')]);}})[_0x7cc3('0x18')](function(_0xc71b35){logger['error'](_0x7cc3('0x12'),_0x631d0,_0xc71b35);_0x1d0af6(_0xc71b35);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 324c8bd..75e4d8c 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 _0x34e8=['register','length','./dashboard.events','remove','emit'];(function(_0x337d97,_0x19c381){var _0x53aa89=function(_0x1ee5eb){while(--_0x1ee5eb){_0x337d97['push'](_0x337d97['shift']());}};_0x53aa89(++_0x19c381);}(_0x34e8,0x188));var _0x834e=function(_0x547770,_0x53d55b){_0x547770=_0x547770-0x0;var _0x316d7e=_0x34e8[_0x547770];return _0x316d7e;};'use strict';var DashboardEvents=require(_0x834e('0x0'));var events=['save',_0x834e('0x1'),'update'];function createListener(_0x15cd04,_0x106ae9){return function(_0x1bd835){_0x106ae9[_0x834e('0x2')](_0x15cd04,_0x1bd835);};}function removeListener(_0x1460f6,_0x192c65){return function(){DashboardEvents['removeListener'](_0x1460f6,_0x192c65);};}exports[_0x834e('0x3')]=function(_0x5f4a26){for(var _0x284371=0x0,_0x38f828=events[_0x834e('0x4')];_0x284371<_0x38f828;_0x284371++){var _0x5e448d=events[_0x284371];var _0x466244=createListener('dashboard:'+_0x5e448d,_0x5f4a26);DashboardEvents['on'](_0x5e448d,_0x466244);}}; \ No newline at end of file +var _0x7862=['dashboard:','save','remove','update','removeListener','register','length'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7862,0xf6));var _0x2786=function(_0x512a62,_0x1b6c2f){_0x512a62=_0x512a62-0x0;var _0x3d3346=_0x7862[_0x512a62];return _0x3d3346;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x2786('0x0'),_0x2786('0x1'),_0x2786('0x2')];function createListener(_0x59e38a,_0x36df0f){return function(_0x316469){_0x36df0f['emit'](_0x59e38a,_0x316469);};}function removeListener(_0x199cf2,_0x37283d){return function(){DashboardEvents[_0x2786('0x3')](_0x199cf2,_0x37283d);};}exports[_0x2786('0x4')]=function(_0x16d9ed){for(var _0x86b344=0x0,_0x412cf4=events[_0x2786('0x5')];_0x86b344<_0x412cf4;_0x86b344++){var _0x6057a3=events[_0x86b344];var _0x22a1bc=createListener(_0x2786('0x6')+_0x6057a3,_0x16d9ed);DashboardEvents['on'](_0x6057a3,_0x22a1bc);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index cbd2392..82e5bd1 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 _0x4b1b=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','post','create','/:id/clone','clone','update','delete','destroy','exports','multer','util'];(function(_0x318cec,_0x3d6b46){var _0x448145=function(_0x1bf875){while(--_0x1bf875){_0x318cec['push'](_0x318cec['shift']());}};_0x448145(++_0x3d6b46);}(_0x4b1b,0x76));var _0xb4b1=function(_0x37d90e,_0x4bd74a){_0x37d90e=_0x37d90e-0x0;var _0x37dc8c=_0x4b1b[_0x37d90e];return _0x37dc8c;};'use strict';var multer=require(_0xb4b1('0x0'));var util=require(_0xb4b1('0x1'));var path=require(_0xb4b1('0x2'));var timeout=require(_0xb4b1('0x3'));var express=require(_0xb4b1('0x4'));var router=express['Router']();var fs_extra=require(_0xb4b1('0x5'));var auth=require(_0xb4b1('0x6'));var interaction=require(_0xb4b1('0x7'));var config=require(_0xb4b1('0x8'));var controller=require(_0xb4b1('0x9'));router[_0xb4b1('0xa')]('/',auth[_0xb4b1('0xb')](),controller[_0xb4b1('0xc')]);router[_0xb4b1('0xa')](_0xb4b1('0xd'),auth['isAuthenticated'](),controller[_0xb4b1('0xe')]);router[_0xb4b1('0xa')](_0xb4b1('0xf'),auth[_0xb4b1('0xb')](),controller['getItems']);router[_0xb4b1('0x10')]('/',auth['isAuthenticated'](),controller[_0xb4b1('0x11')]);router['post'](_0xb4b1('0x12'),auth['isAuthenticated'](),controller[_0xb4b1('0x13')]);router['post'](_0xb4b1('0xf'),auth[_0xb4b1('0xb')](),controller['addItem']);router['put']('/:id',auth[_0xb4b1('0xb')](),controller[_0xb4b1('0x14')]);router[_0xb4b1('0x15')](_0xb4b1('0xd'),auth['isAuthenticated'](),controller[_0xb4b1('0x16')]);module[_0xb4b1('0x17')]=router; \ No newline at end of file +var _0x4aab=['isAuthenticated','show','/:id/items','create','/:id/clone','clone','/:id','update','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','index','get'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4aab,0x11b));var _0xb4aa=function(_0x79a3fe,_0x4b97e4){_0x79a3fe=_0x79a3fe-0x0;var _0x1d6ddf=_0x4aab[_0x79a3fe];return _0x1d6ddf;};'use strict';var multer=require(_0xb4aa('0x0'));var util=require(_0xb4aa('0x1'));var path=require(_0xb4aa('0x2'));var timeout=require(_0xb4aa('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb4aa('0x4'));var auth=require(_0xb4aa('0x5'));var interaction=require(_0xb4aa('0x6'));var config=require(_0xb4aa('0x7'));var controller=require(_0xb4aa('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xb4aa('0x9')]);router[_0xb4aa('0xa')]('/:id',auth[_0xb4aa('0xb')](),controller[_0xb4aa('0xc')]);router[_0xb4aa('0xa')](_0xb4aa('0xd'),auth[_0xb4aa('0xb')](),controller['getItems']);router['post']('/',auth[_0xb4aa('0xb')](),controller[_0xb4aa('0xe')]);router['post'](_0xb4aa('0xf'),auth[_0xb4aa('0xb')](),controller[_0xb4aa('0x10')]);router['post']('/:id/items',auth[_0xb4aa('0xb')](),controller['addItem']);router['put'](_0xb4aa('0x11'),auth['isAuthenticated'](),controller[_0xb4aa('0x12')]);router['delete'](_0xb4aa('0x11'),auth[_0xb4aa('0xb')](),controller[_0xb4aa('0x13')]);module[_0xb4aa('0x14')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 393e79d..b140819 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 _0x7a54=['lodash','STRING','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize','squel'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x7a54,0x106));var _0x47a5=function(_0x4f6bb0,_0x5cbcff){_0x4f6bb0=_0x4f6bb0-0x0;var _0x42d228=_0x7a54[_0x4f6bb0];return _0x42d228;};'use strict';var Sequelize=require(_0x47a5('0x0'));var squel=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));module['exports']={'title':{'type':Sequelize[_0x47a5('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x47a5('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x47a5('0x4')),'get':function(){try{return JSON[_0x47a5('0x5')](this[_0x47a5('0x6')](_0x47a5('0x7')));}catch(_0xfdf934){return[];}},'set':function(_0x545a97){try{this[_0x47a5('0x8')]('attrs',JSON[_0x47a5('0x9')](_0x545a97));}catch(_0x30e405){this['setDataValue'](_0x47a5('0x7'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x47a5('0xa')]},'col':{'type':Sequelize[_0x47a5('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x47a5('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x47a5('0x3')]},'titleFontSize':{'type':Sequelize[_0x47a5('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0xadb5=['long','parse','getDataValue','setDataValue','attrs','stringify','INTEGER','#2196f3','squel','exports','STRING'];(function(_0x559f83,_0x2eb410){var _0x6f5638=function(_0x5269f5){while(--_0x5269f5){_0x559f83['push'](_0x559f83['shift']());}};_0x6f5638(++_0x2eb410);}(_0xadb5,0xad));var _0x5adb=function(_0x133f20,_0xadc5a2){_0x133f20=_0x133f20-0x0;var _0x398a30=_0xadb5[_0x133f20];return _0x398a30;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x5adb('0x0'));var _=require('lodash');module[_0x5adb('0x1')]={'title':{'type':Sequelize[_0x5adb('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x5adb('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x5adb('0x3')),'get':function(){try{return JSON[_0x5adb('0x4')](this[_0x5adb('0x5')]('attrs'));}catch(_0x35a5d3){return[];}},'set':function(_0x168d89){try{this[_0x5adb('0x6')](_0x5adb('0x7'),JSON[_0x5adb('0x8')](_0x168d89));}catch(_0x353885){this[_0x5adb('0x6')](_0x5adb('0x7'),JSON[_0x5adb('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x5adb('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x5adb('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x5adb('0x9')]},'col':{'type':Sequelize[_0x5adb('0x9')]},'background':{'type':Sequelize[_0x5adb('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5adb('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x5adb('0x2')]},'titleFontSize':{'type':Sequelize[_0x5adb('0x9')],'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 f2b3fdb..54866af 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 _0xf69d=['attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','voice','web-report','attrReport','type','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','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','defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket','sendStatus','end','json','undefined','limit','count','status','set','reject','save','update','then','destroy','error','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','include','options','find','catch','iframe','attrUrl','value','custom','attrPath','attrs','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','counter','attrMetric','total','attrVoiceQueues','attrFontSize','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts'];(function(_0x7feb90,_0x28e700){var _0x3c5b33=function(_0x113cfa){while(--_0x113cfa){_0x7feb90['push'](_0x7feb90['shift']());}};_0x3c5b33(++_0x28e700);}(_0xf69d,0xd3));var _0xdf69=function(_0x8e2184,_0x3e96ca){_0x8e2184=_0x8e2184-0x0;var _0x5c7b9f=_0xf69d[_0x8e2184];return _0x5c7b9f;};'use strict';var emlformat=require(_0xdf69('0x0'));var rimraf=require(_0xdf69('0x1'));var zipdir=require(_0xdf69('0x2'));var jsonpatch=require(_0xdf69('0x3'));var rp=require(_0xdf69('0x4'));var moment=require('moment');var BPromise=require(_0xdf69('0x5'));var Mustache=require(_0xdf69('0x6'));var util=require(_0xdf69('0x7'));var path=require(_0xdf69('0x8'));var sox=require(_0xdf69('0x9'));var csv=require(_0xdf69('0xa'));var ejs=require(_0xdf69('0xb'));var fs=require('fs');var fs_extra=require(_0xdf69('0xc'));var _=require(_0xdf69('0xd'));var squel=require(_0xdf69('0xe'));var crypto=require(_0xdf69('0xf'));var jsforce=require(_0xdf69('0x10'));var deskjs=require(_0xdf69('0x11'));var toCsv=require(_0xdf69('0xa'));var querystring=require(_0xdf69('0x12'));var Papa=require(_0xdf69('0x13'));var Redis=require(_0xdf69('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xdf69('0x15'));var as=require(_0xdf69('0x16'));var hardwareService=require(_0xdf69('0x17'));var logger=require(_0xdf69('0x18'))(_0xdf69('0x19'));var utils=require(_0xdf69('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xdf69('0x1b')](config[_0xdf69('0x1c')],{'host':_0xdf69('0x1d'),'port':0x18eb});var socket=require(_0xdf69('0x1e'))(new Redis(config[_0xdf69('0x1c')]));require(_0xdf69('0x1f'))['register'](socket);function respondWithStatusCode(_0x41cc77,_0x42d448){_0x42d448=_0x42d448||0xcc;return function(_0x3da128){if(_0x3da128){return _0x41cc77[_0xdf69('0x20')](_0x42d448);}return _0x41cc77['status'](_0x42d448)[_0xdf69('0x21')]();};}function respondWithResult(_0x56be66,_0x2a6e55){_0x2a6e55=_0x2a6e55||0xc8;return function(_0x1899a2){if(_0x1899a2){return _0x56be66['status'](_0x2a6e55)[_0xdf69('0x22')](_0x1899a2);}};}function respondWithFilteredResult(_0x449908,_0x1af696){return function(_0x85d1d){if(_0x85d1d){var _0x59bfd2=typeof _0x1af696['offset']===_0xdf69('0x23')&&typeof _0x1af696[_0xdf69('0x24')]==='undefined';var _0x32cf65=_0x85d1d[_0xdf69('0x25')];var _0x68fa80=_0x59bfd2?0x0:_0x1af696['offset'];var _0x4776df=_0x59bfd2?_0x85d1d[_0xdf69('0x25')]:_0x1af696['offset']+_0x1af696['limit'];var _0x32505a;if(_0x4776df>=_0x32cf65){_0x4776df=_0x32cf65;_0x32505a=0xc8;}else{_0x32505a=0xce;}_0x449908[_0xdf69('0x26')](_0x32505a);return _0x449908[_0xdf69('0x27')]('Content-Range',_0x68fa80+'-'+_0x4776df+'/'+_0x32cf65)['json'](_0x85d1d);}return null;};}function patchUpdates(_0x5be7dd){return function(_0x2ae7d4){try{jsonpatch['apply'](_0x2ae7d4,_0x5be7dd,!![]);}catch(_0x21f757){return BPromise[_0xdf69('0x28')](_0x21f757);}return _0x2ae7d4[_0xdf69('0x29')]();};}function saveUpdates(_0x54d2ca,_0x541da0){return function(_0x3c916d){if(_0x3c916d){return _0x3c916d[_0xdf69('0x2a')](_0x54d2ca)[_0xdf69('0x2b')](function(_0x3fd933){return _0x3fd933;});}return null;};}function removeEntity(_0x549191,_0x3b727c){return function(_0x2dfacd){if(_0x2dfacd){return _0x2dfacd[_0xdf69('0x2c')]()['then'](function(){_0x549191[_0xdf69('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5dcabd,_0x4acf8e){return function(_0x5c2738){if(!_0x5c2738){_0x5dcabd[_0xdf69('0x20')](0x194);}return _0x5c2738;};}function handleError(_0xe339ac,_0x4fc007){_0x4fc007=_0x4fc007||0x1f4;return function(_0x301bd2){logger[_0xdf69('0x2d')](_0x301bd2[_0xdf69('0x2e')]);if(_0x301bd2[_0xdf69('0x2f')]){delete _0x301bd2[_0xdf69('0x2f')];}_0xe339ac[_0xdf69('0x26')](_0x4fc007)[_0xdf69('0x30')](_0x301bd2);};}exports[_0xdf69('0x31')]=function(_0x1f67fe,_0x3b97df){var _0x38c1bb={'raw':![],'where':{'id':_0x1f67fe[_0xdf69('0x32')]['id']}},_0x2a23ed={};_0x2a23ed[_0xdf69('0x33')]=_[_0xdf69('0x34')](db[_0xdf69('0x35')][_0xdf69('0x36')]);_0x2a23ed['query']=_[_0xdf69('0x34')](_0x1f67fe[_0xdf69('0x37')]);_0x2a23ed[_0xdf69('0x38')]=_[_0xdf69('0x39')](_0x2a23ed[_0xdf69('0x33')],_0x2a23ed['query']);_0x38c1bb[_0xdf69('0x3a')]=_['intersection'](_0x2a23ed[_0xdf69('0x33')],qs[_0xdf69('0x3b')](_0x1f67fe['query'][_0xdf69('0x3b')]));_0x38c1bb['attributes']=_0x38c1bb[_0xdf69('0x3a')][_0xdf69('0x3c')]?_0x38c1bb[_0xdf69('0x3a')]:_0x2a23ed[_0xdf69('0x33')];if(_0x1f67fe[_0xdf69('0x37')]['includeAll']){_0x38c1bb[_0xdf69('0x3d')]=[{'all':!![]}];}_0x38c1bb=_['merge']({},_0x38c1bb,_0x1f67fe[_0xdf69('0x3e')]);return db[_0xdf69('0x35')][_0xdf69('0x3f')](_0x38c1bb)[_0xdf69('0x2b')](handleEntityNotFound(_0x3b97df,null))['then'](respondWithResult(_0x3b97df,null))[_0xdf69('0x40')](handleError(_0x3b97df,null));};exports['destroy']=function(_0xb25bed,_0x59c00e){return db[_0xdf69('0x35')]['find']({'where':{'id':_0xb25bed[_0xdf69('0x32')]['id']}})[_0xdf69('0x2b')](handleEntityNotFound(_0x59c00e,null))[_0xdf69('0x2b')](removeEntity(_0x59c00e,null))[_0xdf69('0x40')](handleError(_0x59c00e,null));};function widgetAttributes(_0xf77362){try{switch(_0xf77362['type']){case _0xdf69('0x41'):return[{'name':_0xdf69('0x42'),'value':_0xf77362['attrUrl']||(_0xf77362['attrs']&&_0xf77362['attrs'][0x0]?_0xf77362['attrs'][0x0][_0xdf69('0x43')]:undefined)||'https://'}];case _0xdf69('0x44'):return[{'name':_0xdf69('0x45'),'value':_0xf77362[_0xdf69('0x45')]||(_0xf77362[_0xdf69('0x46')]&&_0xf77362['attrs'][0x0]?_0xf77362[_0xdf69('0x46')][0x0][_0xdf69('0x43')]:undefined)||''}];case _0xdf69('0x47'):return[{'name':'attrHourFormat','value':_0xf77362[_0xdf69('0x48')]||(_0xf77362[_0xdf69('0x46')]&&_0xf77362[_0xdf69('0x46')][0x0]?_0xf77362[_0xdf69('0x46')][0x0][_0xdf69('0x43')]:undefined)||_0xdf69('0x49')},{'name':_0xdf69('0x4a'),'value':_0xf77362['attrTimezone']||(_0xf77362['attrs']&&_0xf77362[_0xdf69('0x46')][0x1]?_0xf77362[_0xdf69('0x46')][0x1][_0xdf69('0x43')]:undefined)||_0xdf69('0x4b')},{'name':'attrFontSize','value':_0xf77362['attrFontSize']||(_0xf77362['attrs']&&_0xf77362['attrs'][0x2]?_0xf77362[_0xdf69('0x46')][0x2]['value']:undefined)||0xc}];case _0xdf69('0x4c'):return[{'name':'attrMetric','value':_0xf77362[_0xdf69('0x4d')]||(_0xf77362[_0xdf69('0x46')]&&_0xf77362[_0xdf69('0x46')][0x0]?_0xf77362[_0xdf69('0x46')][0x0][_0xdf69('0x43')]:undefined)||_0xdf69('0x4e')},{'name':_0xdf69('0x4f'),'value':_0xf77362[_0xdf69('0x4f')]||(_0xf77362[_0xdf69('0x46')]&&_0xf77362['attrs'][0x1]?_0xf77362['attrs'][0x1][_0xdf69('0x43')]:undefined)||[]},{'name':'attrFontSize','value':_0xf77362[_0xdf69('0x50')]||(_0xf77362[_0xdf69('0x46')]&&_0xf77362[_0xdf69('0x46')][0x2]?_0xf77362['attrs'][0x2][_0xdf69('0x43')]:undefined)||0x14},{'name':_0xdf69('0x51'),'value':_0xf77362[_0xdf69('0x51')]||(_0xf77362[_0xdf69('0x46')]&&_0xf77362['attrs'][0x3]?_0xf77362[_0xdf69('0x46')][0x3][_0xdf69('0x43')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0xf77362[_0xdf69('0x52')]||(_0xf77362[_0xdf69('0x46')]&&_0xf77362[_0xdf69('0x46')][0x4]?_0xf77362[_0xdf69('0x46')][0x4][_0xdf69('0x43')]:undefined)||''},{'name':_0xdf69('0x53'),'value':_0xf77362['attrFaxAccounts']||(_0xf77362['attrs']&&_0xf77362[_0xdf69('0x46')][0x5]?_0xf77362[_0xdf69('0x46')][0x5][_0xdf69('0x43')]:undefined)||''},{'name':_0xdf69('0x54'),'value':_0xf77362['attrSmsAccounts']||(_0xf77362['attrs']&&_0xf77362[_0xdf69('0x46')][0x6]?_0xf77362[_0xdf69('0x46')][0x6][_0xdf69('0x43')]:undefined)||''},{'name':_0xdf69('0x55'),'value':_0xf77362[_0xdf69('0x55')]||(_0xf77362[_0xdf69('0x46')]&&_0xf77362[_0xdf69('0x46')][0x7]?_0xf77362[_0xdf69('0x46')][0x7][_0xdf69('0x43')]:undefined)||''},{'name':_0xdf69('0x56'),'value':_0xf77362[_0xdf69('0x56')]||(_0xf77362[_0xdf69('0x46')]&&_0xf77362[_0xdf69('0x46')][0x8]?_0xf77362[_0xdf69('0x46')][0x8]['value']:undefined)||''},{'name':_0xdf69('0x57'),'value':_0xf77362[_0xdf69('0x57')]||(_0xf77362[_0xdf69('0x46')]&&_0xf77362['attrs'][0x9]?_0xf77362[_0xdf69('0x46')][0x9][_0xdf69('0x43')]:undefined)||''}];case _0xdf69('0x58'):case'pie-chart':return[{'name':_0xdf69('0x59'),'value':_0xf77362['attrSerie1']||(_0xf77362[_0xdf69('0x46')]&&_0xf77362[_0xdf69('0x46')][0x0]?_0xf77362[_0xdf69('0x46')][0x0][_0xdf69('0x43')]:undefined)||'total'},{'name':_0xdf69('0x5a'),'value':_0xf77362[_0xdf69('0x5a')]||(_0xf77362[_0xdf69('0x46')]&&_0xf77362[_0xdf69('0x46')][0x1]?_0xf77362[_0xdf69('0x46')][0x1][_0xdf69('0x43')]:undefined)||null},{'name':_0xdf69('0x5b'),'value':_0xf77362[_0xdf69('0x5b')]||(_0xf77362[_0xdf69('0x46')]&&_0xf77362['attrs'][0x2]?_0xf77362[_0xdf69('0x46')][0x2][_0xdf69('0x43')]:undefined)||null},{'name':'attrVoiceQueues','value':_0xf77362[_0xdf69('0x4f')]||(_0xf77362[_0xdf69('0x46')]&&_0xf77362['attrs'][0x3]?_0xf77362['attrs'][0x3][_0xdf69('0x43')]:undefined)||[]},{'name':'attrChannel','value':_0xf77362[_0xdf69('0x51')]||(_0xf77362[_0xdf69('0x46')]&&_0xf77362[_0xdf69('0x46')][0x4]?_0xf77362['attrs'][0x4]['value']:undefined)||_0xdf69('0x5c')},{'name':_0xdf69('0x52'),'value':_0xf77362[_0xdf69('0x52')]||(_0xf77362[_0xdf69('0x46')]&&_0xf77362[_0xdf69('0x46')][0x5]?_0xf77362[_0xdf69('0x46')][0x5][_0xdf69('0x43')]:undefined)||''},{'name':_0xdf69('0x53'),'value':_0xf77362[_0xdf69('0x53')]||(_0xf77362[_0xdf69('0x46')]&&_0xf77362['attrs'][0x6]?_0xf77362[_0xdf69('0x46')][0x6][_0xdf69('0x43')]:undefined)||''},{'name':_0xdf69('0x54'),'value':_0xf77362[_0xdf69('0x54')]||(_0xf77362[_0xdf69('0x46')]&&_0xf77362[_0xdf69('0x46')][0x7]?_0xf77362[_0xdf69('0x46')][0x7][_0xdf69('0x43')]:undefined)||''},{'name':_0xdf69('0x55'),'value':_0xf77362['attrOpenchannelAccounts']||(_0xf77362['attrs']&&_0xf77362[_0xdf69('0x46')][0x8]?_0xf77362[_0xdf69('0x46')][0x8]['value']:undefined)||''},{'name':_0xdf69('0x56'),'value':_0xf77362[_0xdf69('0x56')]||(_0xf77362[_0xdf69('0x46')]&&_0xf77362[_0xdf69('0x46')][0x9]?_0xf77362[_0xdf69('0x46')][0x9][_0xdf69('0x43')]:undefined)||''},{'name':'attrChatWebsites','value':_0xf77362[_0xdf69('0x57')]||(_0xf77362['attrs']&&_0xf77362[_0xdf69('0x46')][0xa]?_0xf77362['attrs'][0xa]['value']:undefined)||''}];case _0xdf69('0x5d'):return[{'name':_0xdf69('0x5e'),'type':_0xf77362['reportType']||(_0xf77362[_0xdf69('0x46')]&&_0xf77362[_0xdf69('0x46')][0x0]?_0xf77362[_0xdf69('0x46')][0x0][_0xdf69('0x5f')]:undefined)||null,'value':_0xf77362[_0xdf69('0x5e')]||(_0xf77362[_0xdf69('0x46')]&&_0xf77362[_0xdf69('0x46')][0x0]?_0xf77362[_0xdf69('0x46')][0x0][_0xdf69('0x43')]:undefined)||null},{'name':'attrRefresh','value':_0xf77362['attrRefresh']||(_0xf77362['attrs']&&_0xf77362[_0xdf69('0x46')][0x1]?_0xf77362['attrs'][0x1][_0xdf69('0x43')]:undefined)||0x0}];default:return[];}}catch(_0x39873f){logger['error']('widgetAttributes:\x20%s',JSON[_0xdf69('0x60')](_0x39873f));return[];}}exports[_0xdf69('0x61')]=function(_0x9e50d8,_0x451d6b){if(_0x9e50d8[_0xdf69('0x62')]){_0x9e50d8[_0xdf69('0x62')][_0xdf69('0x46')]=widgetAttributes(_0x9e50d8[_0xdf69('0x62')]);}return db['DashboardItem'][_0xdf69('0x61')](_0x9e50d8[_0xdf69('0x62')],{})[_0xdf69('0x2b')](respondWithResult(_0x451d6b,0xc9))[_0xdf69('0x40')](handleError(_0x451d6b,null));};exports['update']=function(_0x22f6a0,_0x3f37d1){if(_0x22f6a0[_0xdf69('0x62')]['id']){delete _0x22f6a0[_0xdf69('0x62')]['id'];}_0x22f6a0[_0xdf69('0x62')]['attrs']=widgetAttributes(_0x22f6a0['body']);return db['DashboardItem']['find']({'where':{'id':_0x22f6a0['params']['id']}})[_0xdf69('0x2b')](handleEntityNotFound(_0x3f37d1,null))['then'](saveUpdates(_0x22f6a0['body'],null))['then'](respondWithResult(_0x3f37d1,null))['catch'](handleError(_0x3f37d1,null));}; \ No newline at end of file +var _0xabce=['redis','defaults','socket.io-emitter','./dashboardItem.socket','sendStatus','end','status','offset','undefined','limit','count','set','json','reject','save','then','destroy','error','stack','name','send','show','model','keys','DashboardItem','rawAttributes','query','intersection','fields','attributes','include','merge','find','catch','params','type','attrs','value','https://','attrPath','clock','attrTimezone','0.00','counter','attrMetric','total','attrVoiceQueues','attrFontSize','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','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','../../mysqldb'];(function(_0x82b0ee,_0x2d0ee5){var _0x371191=function(_0x1e1957){while(--_0x1e1957){_0x82b0ee['push'](_0x82b0ee['shift']());}};_0x371191(++_0x2d0ee5);}(_0xabce,0x103));var _0xeabc=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xabce[_0x5783f4];return _0x28e380;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];config[_0xeabc('0x1a')]=_[_0xeabc('0x1b')](config[_0xeabc('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xeabc('0x1c'))(new Redis(config[_0xeabc('0x1a')]));require(_0xeabc('0x1d'))['register'](socket);function respondWithStatusCode(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xcc;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1e')](_0x3170ea);}return _0x5f4ee8['status'](_0x3170ea)[_0xeabc('0x1f')]();};}function respondWithResult(_0x638976,_0x49f2d8){_0x49f2d8=_0x49f2d8||0xc8;return function(_0x53fe28){if(_0x53fe28){return _0x638976[_0xeabc('0x20')](_0x49f2d8)['json'](_0x53fe28);}};}function respondWithFilteredResult(_0x3d0e21,_0x1b64b9){return function(_0x58a3c0){if(_0x58a3c0){var _0x16f08b=typeof _0x1b64b9[_0xeabc('0x21')]===_0xeabc('0x22')&&typeof _0x1b64b9[_0xeabc('0x23')]===_0xeabc('0x22');var _0x5d92e5=_0x58a3c0[_0xeabc('0x24')];var _0x4d68ea=_0x16f08b?0x0:_0x1b64b9[_0xeabc('0x21')];var _0x16530c=_0x16f08b?_0x58a3c0['count']:_0x1b64b9[_0xeabc('0x21')]+_0x1b64b9[_0xeabc('0x23')];var _0x254590;if(_0x16530c>=_0x5d92e5){_0x16530c=_0x5d92e5;_0x254590=0xc8;}else{_0x254590=0xce;}_0x3d0e21[_0xeabc('0x20')](_0x254590);return _0x3d0e21[_0xeabc('0x25')]('Content-Range',_0x4d68ea+'-'+_0x16530c+'/'+_0x5d92e5)[_0xeabc('0x26')](_0x58a3c0);}return null;};}function patchUpdates(_0x10c675){return function(_0x91ab00){try{jsonpatch['apply'](_0x91ab00,_0x10c675,!![]);}catch(_0x457f27){return BPromise[_0xeabc('0x27')](_0x457f27);}return _0x91ab00[_0xeabc('0x28')]();};}function saveUpdates(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['update'](_0x319119)[_0xeabc('0x29')](function(_0x4d4e29){return _0x4d4e29;});}return null;};}function removeEntity(_0x811f0d,_0x12acbd){return function(_0x269621){if(_0x269621){return _0x269621[_0xeabc('0x2a')]()[_0xeabc('0x29')](function(){_0x811f0d[_0xeabc('0x20')](0xcc)[_0xeabc('0x1f')]();});}};}function handleEntityNotFound(_0x4c2693,_0x5b2934){return function(_0x459c8a){if(!_0x459c8a){_0x4c2693['sendStatus'](0x194);}return _0x459c8a;};}function handleError(_0x3c1b5b,_0x2b342c){_0x2b342c=_0x2b342c||0x1f4;return function(_0x48fb52){logger[_0xeabc('0x2b')](_0x48fb52[_0xeabc('0x2c')]);if(_0x48fb52[_0xeabc('0x2d')]){delete _0x48fb52[_0xeabc('0x2d')];}_0x3c1b5b[_0xeabc('0x20')](_0x2b342c)[_0xeabc('0x2e')](_0x48fb52);};}exports[_0xeabc('0x2f')]=function(_0x38dc0a,_0x2915c1){var _0x5ebb86={'raw':![],'where':{'id':_0x38dc0a['params']['id']}},_0x5b34dd={};_0x5b34dd[_0xeabc('0x30')]=_[_0xeabc('0x31')](db[_0xeabc('0x32')][_0xeabc('0x33')]);_0x5b34dd[_0xeabc('0x34')]=_[_0xeabc('0x31')](_0x38dc0a[_0xeabc('0x34')]);_0x5b34dd['filters']=_[_0xeabc('0x35')](_0x5b34dd[_0xeabc('0x30')],_0x5b34dd[_0xeabc('0x34')]);_0x5ebb86['attributes']=_[_0xeabc('0x35')](_0x5b34dd[_0xeabc('0x30')],qs[_0xeabc('0x36')](_0x38dc0a['query'][_0xeabc('0x36')]));_0x5ebb86[_0xeabc('0x37')]=_0x5ebb86[_0xeabc('0x37')]['length']?_0x5ebb86[_0xeabc('0x37')]:_0x5b34dd[_0xeabc('0x30')];if(_0x38dc0a['query']['includeAll']){_0x5ebb86[_0xeabc('0x38')]=[{'all':!![]}];}_0x5ebb86=_[_0xeabc('0x39')]({},_0x5ebb86,_0x38dc0a['options']);return db[_0xeabc('0x32')][_0xeabc('0x3a')](_0x5ebb86)[_0xeabc('0x29')](handleEntityNotFound(_0x2915c1,null))[_0xeabc('0x29')](respondWithResult(_0x2915c1,null))[_0xeabc('0x3b')](handleError(_0x2915c1,null));};exports['destroy']=function(_0x353e48,_0x5b61fa){return db[_0xeabc('0x32')][_0xeabc('0x3a')]({'where':{'id':_0x353e48[_0xeabc('0x3c')]['id']}})['then'](handleEntityNotFound(_0x5b61fa,null))['then'](removeEntity(_0x5b61fa,null))[_0xeabc('0x3b')](handleError(_0x5b61fa,null));};function widgetAttributes(_0x560d4a){try{switch(_0x560d4a[_0xeabc('0x3d')]){case'iframe':return[{'name':'attrUrl','value':_0x560d4a['attrUrl']||(_0x560d4a['attrs']&&_0x560d4a[_0xeabc('0x3e')][0x0]?_0x560d4a['attrs'][0x0][_0xeabc('0x3f')]:undefined)||_0xeabc('0x40')}];case'custom':return[{'name':_0xeabc('0x41'),'value':_0x560d4a['attrPath']||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a['attrs'][0x0]?_0x560d4a[_0xeabc('0x3e')][0x0][_0xeabc('0x3f')]:undefined)||''}];case _0xeabc('0x42'):return[{'name':'attrHourFormat','value':_0x560d4a['attrHourFormat']||(_0x560d4a['attrs']&&_0x560d4a[_0xeabc('0x3e')][0x0]?_0x560d4a[_0xeabc('0x3e')][0x0][_0xeabc('0x3f')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x560d4a[_0xeabc('0x43')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a['attrs'][0x1]?_0x560d4a[_0xeabc('0x3e')][0x1]['value']:undefined)||_0xeabc('0x44')},{'name':'attrFontSize','value':_0x560d4a['attrFontSize']||(_0x560d4a['attrs']&&_0x560d4a[_0xeabc('0x3e')][0x2]?_0x560d4a[_0xeabc('0x3e')][0x2][_0xeabc('0x3f')]:undefined)||0xc}];case _0xeabc('0x45'):return[{'name':'attrMetric','value':_0x560d4a[_0xeabc('0x46')]||(_0x560d4a['attrs']&&_0x560d4a[_0xeabc('0x3e')][0x0]?_0x560d4a[_0xeabc('0x3e')][0x0][_0xeabc('0x3f')]:undefined)||_0xeabc('0x47')},{'name':_0xeabc('0x48'),'value':_0x560d4a['attrVoiceQueues']||(_0x560d4a['attrs']&&_0x560d4a[_0xeabc('0x3e')][0x1]?_0x560d4a['attrs'][0x1][_0xeabc('0x3f')]:undefined)||[]},{'name':_0xeabc('0x49'),'value':_0x560d4a['attrFontSize']||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a[_0xeabc('0x3e')][0x2]?_0x560d4a[_0xeabc('0x3e')][0x2][_0xeabc('0x3f')]:undefined)||0x14},{'name':_0xeabc('0x4a'),'value':_0x560d4a[_0xeabc('0x4a')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a['attrs'][0x3]?_0x560d4a[_0xeabc('0x3e')][0x3][_0xeabc('0x3f')]:undefined)||_0xeabc('0x4b')},{'name':_0xeabc('0x4c'),'value':_0x560d4a[_0xeabc('0x4c')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a[_0xeabc('0x3e')][0x4]?_0x560d4a[_0xeabc('0x3e')][0x4][_0xeabc('0x3f')]:undefined)||''},{'name':_0xeabc('0x4d'),'value':_0x560d4a['attrFaxAccounts']||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a[_0xeabc('0x3e')][0x5]?_0x560d4a[_0xeabc('0x3e')][0x5][_0xeabc('0x3f')]:undefined)||''},{'name':_0xeabc('0x4e'),'value':_0x560d4a[_0xeabc('0x4e')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a['attrs'][0x6]?_0x560d4a[_0xeabc('0x3e')][0x6][_0xeabc('0x3f')]:undefined)||''},{'name':_0xeabc('0x4f'),'value':_0x560d4a[_0xeabc('0x4f')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a['attrs'][0x7]?_0x560d4a[_0xeabc('0x3e')][0x7][_0xeabc('0x3f')]:undefined)||''},{'name':_0xeabc('0x50'),'value':_0x560d4a[_0xeabc('0x50')]||(_0x560d4a['attrs']&&_0x560d4a[_0xeabc('0x3e')][0x8]?_0x560d4a[_0xeabc('0x3e')][0x8]['value']:undefined)||''},{'name':_0xeabc('0x51'),'value':_0x560d4a['attrChatWebsites']||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a['attrs'][0x9]?_0x560d4a[_0xeabc('0x3e')][0x9][_0xeabc('0x3f')]:undefined)||''}];case _0xeabc('0x52'):case _0xeabc('0x53'):return[{'name':_0xeabc('0x54'),'value':_0x560d4a[_0xeabc('0x54')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a[_0xeabc('0x3e')][0x0]?_0x560d4a[_0xeabc('0x3e')][0x0][_0xeabc('0x3f')]:undefined)||'total'},{'name':_0xeabc('0x55'),'value':_0x560d4a[_0xeabc('0x55')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a[_0xeabc('0x3e')][0x1]?_0x560d4a['attrs'][0x1][_0xeabc('0x3f')]:undefined)||null},{'name':_0xeabc('0x56'),'value':_0x560d4a[_0xeabc('0x56')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a['attrs'][0x2]?_0x560d4a[_0xeabc('0x3e')][0x2][_0xeabc('0x3f')]:undefined)||null},{'name':_0xeabc('0x48'),'value':_0x560d4a[_0xeabc('0x48')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a[_0xeabc('0x3e')][0x3]?_0x560d4a[_0xeabc('0x3e')][0x3][_0xeabc('0x3f')]:undefined)||[]},{'name':_0xeabc('0x4a'),'value':_0x560d4a['attrChannel']||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a['attrs'][0x4]?_0x560d4a['attrs'][0x4]['value']:undefined)||_0xeabc('0x4b')},{'name':_0xeabc('0x4c'),'value':_0x560d4a[_0xeabc('0x4c')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a[_0xeabc('0x3e')][0x5]?_0x560d4a[_0xeabc('0x3e')][0x5]['value']:undefined)||''},{'name':_0xeabc('0x4d'),'value':_0x560d4a[_0xeabc('0x4d')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a[_0xeabc('0x3e')][0x6]?_0x560d4a[_0xeabc('0x3e')][0x6][_0xeabc('0x3f')]:undefined)||''},{'name':_0xeabc('0x4e'),'value':_0x560d4a[_0xeabc('0x4e')]||(_0x560d4a['attrs']&&_0x560d4a['attrs'][0x7]?_0x560d4a[_0xeabc('0x3e')][0x7][_0xeabc('0x3f')]:undefined)||''},{'name':_0xeabc('0x4f'),'value':_0x560d4a['attrOpenchannelAccounts']||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a['attrs'][0x8]?_0x560d4a['attrs'][0x8][_0xeabc('0x3f')]:undefined)||''},{'name':_0xeabc('0x50'),'value':_0x560d4a[_0xeabc('0x50')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a[_0xeabc('0x3e')][0x9]?_0x560d4a[_0xeabc('0x3e')][0x9]['value']:undefined)||''},{'name':_0xeabc('0x51'),'value':_0x560d4a[_0xeabc('0x51')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a[_0xeabc('0x3e')][0xa]?_0x560d4a[_0xeabc('0x3e')][0xa][_0xeabc('0x3f')]:undefined)||''}];case'web-report':return[{'name':_0xeabc('0x57'),'type':_0x560d4a[_0xeabc('0x58')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a[_0xeabc('0x3e')][0x0]?_0x560d4a[_0xeabc('0x3e')][0x0][_0xeabc('0x3d')]:undefined)||null,'value':_0x560d4a[_0xeabc('0x57')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a[_0xeabc('0x3e')][0x0]?_0x560d4a['attrs'][0x0][_0xeabc('0x3f')]:undefined)||null},{'name':'attrRefresh','value':_0x560d4a[_0xeabc('0x59')]||(_0x560d4a[_0xeabc('0x3e')]&&_0x560d4a[_0xeabc('0x3e')][0x1]?_0x560d4a[_0xeabc('0x3e')][0x1][_0xeabc('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x1a3ef2){logger[_0xeabc('0x2b')](_0xeabc('0x5a'),JSON[_0xeabc('0x5b')](_0x1a3ef2));return[];}}exports[_0xeabc('0x5c')]=function(_0x5702cb,_0x3fa31b){if(_0x5702cb[_0xeabc('0x5d')]){_0x5702cb[_0xeabc('0x5d')][_0xeabc('0x3e')]=widgetAttributes(_0x5702cb['body']);}return db[_0xeabc('0x32')]['create'](_0x5702cb['body'],{})[_0xeabc('0x29')](respondWithResult(_0x3fa31b,0xc9))[_0xeabc('0x3b')](handleError(_0x3fa31b,null));};exports[_0xeabc('0x5e')]=function(_0x1c91e4,_0x4b7730){if(_0x1c91e4['body']['id']){delete _0x1c91e4[_0xeabc('0x5d')]['id'];}_0x1c91e4['body']['attrs']=widgetAttributes(_0x1c91e4[_0xeabc('0x5d')]);return db['DashboardItem']['find']({'where':{'id':_0x1c91e4[_0xeabc('0x3c')]['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x4b7730,null))['then'](saveUpdates(_0x1c91e4['body'],null))[_0xeabc('0x29')](respondWithResult(_0x4b7730,null))['catch'](handleError(_0x4b7730,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index ff4a6ab..7f0598b 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 _0x5900=['DashboardItem','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x16bdb0,_0x133151){var _0x1815c1=function(_0x5edefa){while(--_0x5edefa){_0x16bdb0['push'](_0x16bdb0['shift']());}};_0x1815c1(++_0x133151);}(_0x5900,0x184));var _0x0590=function(_0x5deee9,_0xf7bae7){_0x5deee9=_0x5deee9-0x0;var _0x1d84e0=_0x5900[_0x5deee9];return _0x1d84e0;};'use strict';var EventEmitter=require(_0x0590('0x0'));var DashboardItem=require(_0x0590('0x1'))['db'][_0x0590('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x0590('0x3')](0x0);var events={'afterCreate':_0x0590('0x4'),'afterUpdate':_0x0590('0x5'),'afterDestroy':'remove'};function emitEvent(_0x414fbd){return function(_0xd743ff,_0x122f96,_0x440d7d){DashboardItemEvents['emit'](_0x414fbd+':'+_0xd743ff['id'],_0xd743ff);DashboardItemEvents[_0x0590('0x6')](_0x414fbd,_0xd743ff);_0x440d7d(null);};}for(var e in events){if(events[_0x0590('0x7')](e)){var event=events[e];DashboardItem[_0x0590('0x8')](e,emitEvent(event));}}module[_0x0590('0x9')]=DashboardItemEvents; \ No newline at end of file +var _0x8af6=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8af6,0x76));var _0x68af=function(_0x1d6544,_0x1113cf){_0x1d6544=_0x1d6544-0x0;var _0x209118=_0x8af6[_0x1d6544];return _0x209118;};'use strict';var EventEmitter=require(_0x68af('0x0'));var DashboardItem=require(_0x68af('0x1'))['db'][_0x68af('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x68af('0x3')](0x0);var events={'afterCreate':_0x68af('0x4'),'afterUpdate':_0x68af('0x5'),'afterDestroy':_0x68af('0x6')};function emitEvent(_0xe2ba54){return function(_0x1f8b3a,_0x3d1c16,_0x52bd87){DashboardItemEvents[_0x68af('0x7')](_0xe2ba54+':'+_0x1f8b3a['id'],_0x1f8b3a);DashboardItemEvents['emit'](_0xe2ba54,_0x1f8b3a);_0x52bd87(null);};}for(var e in events){if(events[_0x68af('0x8')](e)){var event=events[e];DashboardItem[_0x68af('0x9')](e,emitEvent(event));}}module[_0x68af('0xa')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 5d6ed21..e52f9b8 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 _0x2751=['lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./dashboardItem.attributes','exports','define'];(function(_0x208fd8,_0x2ad2a4){var _0x5d6831=function(_0x519eeb){while(--_0x519eeb){_0x208fd8['push'](_0x208fd8['shift']());}};_0x5d6831(++_0x2ad2a4);}(_0x2751,0xbe));var _0x1275=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2751[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x1275('0x0'));var util=require(_0x1275('0x1'));var logger=require(_0x1275('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1275('0x3'));var rp=require(_0x1275('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1275('0x5'));var config=require(_0x1275('0x6'));var attributes=require(_0x1275('0x7'));module[_0x1275('0x8')]=function(_0x4516c8,_0x483199){return _0x4516c8[_0x1275('0x9')]('DashboardItem',attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa884=['define','dashboard_items','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x81c3bb,_0x170db2){var _0x684738=function(_0xe20a31){while(--_0xe20a31){_0x81c3bb['push'](_0x81c3bb['shift']());}};_0x684738(++_0x170db2);}(_0xa884,0x182));var _0x4a88=function(_0x42c118,_0x197006){_0x42c118=_0x42c118-0x0;var _0x112ebd=_0xa884[_0x42c118];return _0x112ebd;};'use strict';var _=require(_0x4a88('0x0'));var util=require(_0x4a88('0x1'));var logger=require(_0x4a88('0x2'))('api');var moment=require(_0x4a88('0x3'));var BPromise=require(_0x4a88('0x4'));var rp=require(_0x4a88('0x5'));var fs=require('fs');var path=require(_0x4a88('0x6'));var rimraf=require(_0x4a88('0x7'));var config=require(_0x4a88('0x8'));var attributes=require('./dashboardItem.attributes');module[_0x4a88('0x9')]=function(_0x57f5fc,_0x4cd5c0){return _0x57f5fc[_0x4a88('0xa')]('DashboardItem',attributes,{'tableName':_0x4a88('0xb'),'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 7798261..778752c 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 _0xd552=['error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','info','DashboardItem,\x20%s,\x20%s','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xd552,0x109));var _0x2d55=function(_0x4a6ff8,_0x43ecd5){_0x4a6ff8=_0x4a6ff8-0x0;var _0x4fcff7=_0xd552[_0x4a6ff8];return _0x4fcff7;};'use strict';var _=require(_0x2d55('0x0'));var util=require(_0x2d55('0x1'));var moment=require(_0x2d55('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d55('0x3'));var db=require(_0x2d55('0x4'))['db'];var utils=require(_0x2d55('0x5'));var logger=require(_0x2d55('0x6'))(_0x2d55('0x7'));var config=require(_0x2d55('0x8'));var jayson=require(_0x2d55('0x9'));var client=jayson[_0x2d55('0xa')][_0x2d55('0xb')]({'port':0x232a});config[_0x2d55('0xc')]=_[_0x2d55('0xd')](config[_0x2d55('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x2d55('0xe'))(new Redis(config[_0x2d55('0xc')]));require('./dashboardItem.socket')[_0x2d55('0xf')](socket);function respondWithRpcPromise(_0x470944,_0x2a6bfa,_0x449569){return new BPromise(function(_0xaa1c9b,_0xa6010){return client[_0x2d55('0x10')](_0x470944,_0x449569)['then'](function(_0xadc03e){logger[_0x2d55('0x11')](_0x2d55('0x12'),_0x2a6bfa,'request\x20sent');logger['debug'](_0x2d55('0x13'),_0x2a6bfa,_0x2d55('0x14'),JSON['stringify'](_0xadc03e));if(_0xadc03e[_0x2d55('0x15')]){if(_0xadc03e[_0x2d55('0x15')][_0x2d55('0x16')]===0x1f4){logger[_0x2d55('0x15')](_0x2d55('0x12'),_0x2a6bfa,_0xadc03e[_0x2d55('0x15')][_0x2d55('0x17')]);return _0xa6010(_0xadc03e[_0x2d55('0x15')][_0x2d55('0x17')]);}logger[_0x2d55('0x15')](_0x2d55('0x12'),_0x2a6bfa,_0xadc03e[_0x2d55('0x15')][_0x2d55('0x17')]);return _0xaa1c9b(_0xadc03e['error']['message']);}else{logger[_0x2d55('0x11')]('DashboardItem,\x20%s,\x20%s',_0x2a6bfa,'request\x20sent');_0xaa1c9b(_0xadc03e[_0x2d55('0x18')][_0x2d55('0x17')]);}})[_0x2d55('0x19')](function(_0x5217ca){logger[_0x2d55('0x15')](_0x2d55('0x12'),_0x2a6bfa,_0x5217ca);_0xa6010(_0x5217ca);});});} \ No newline at end of file +var _0x34ca=['moment','randomstring','ioredis','../../config/utils','../../config/environment','client','http','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util'];(function(_0xc76588,_0x12dd18){var _0x4a008f=function(_0x438595){while(--_0x438595){_0xc76588['push'](_0xc76588['shift']());}};_0x4a008f(++_0x12dd18);}(_0x34ca,0x12a));var _0xa34c=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x34ca[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0xa34c('0x0'));var moment=require(_0xa34c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa34c('0x2'));var fs=require('fs');var Redis=require(_0xa34c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa34c('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa34c('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xa34c('0x6')][_0xa34c('0x7')]({'port':0x232a});config[_0xa34c('0x8')]=_[_0xa34c('0x9')](config[_0xa34c('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xa34c('0xa'))(new Redis(config['redis']));require(_0xa34c('0xb'))[_0xa34c('0xc')](socket);function respondWithRpcPromise(_0xca4ad3,_0x1ed649,_0x649f2c){return new BPromise(function(_0x2d961d,_0xcd4fe7){return client['request'](_0xca4ad3,_0x649f2c)[_0xa34c('0xd')](function(_0x29c966){logger[_0xa34c('0xe')](_0xa34c('0xf'),_0x1ed649,_0xa34c('0x10'));logger[_0xa34c('0x11')](_0xa34c('0x12'),_0x1ed649,_0xa34c('0x10'),JSON[_0xa34c('0x13')](_0x29c966));if(_0x29c966[_0xa34c('0x14')]){if(_0x29c966['error'][_0xa34c('0x15')]===0x1f4){logger[_0xa34c('0x14')]('DashboardItem,\x20%s,\x20%s',_0x1ed649,_0x29c966[_0xa34c('0x14')][_0xa34c('0x16')]);return _0xcd4fe7(_0x29c966[_0xa34c('0x14')][_0xa34c('0x16')]);}logger[_0xa34c('0x14')](_0xa34c('0xf'),_0x1ed649,_0x29c966[_0xa34c('0x14')][_0xa34c('0x16')]);return _0x2d961d(_0x29c966[_0xa34c('0x14')]['message']);}else{logger[_0xa34c('0xe')](_0xa34c('0xf'),_0x1ed649,'request\x20sent');_0x2d961d(_0x29c966['result']['message']);}})['catch'](function(_0x46b6da){logger[_0xa34c('0x14')]('DashboardItem,\x20%s,\x20%s',_0x1ed649,_0x46b6da);_0xcd4fe7(_0x46b6da);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 4ec65db..49d599e 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 _0x76cd=['length','dashboardItem:','./dashboardItem.events','update','emit','removeListener','register'];(function(_0x171b2f,_0x282d27){var _0x4c73a6=function(_0x1ec0df){while(--_0x1ec0df){_0x171b2f['push'](_0x171b2f['shift']());}};_0x4c73a6(++_0x282d27);}(_0x76cd,0x159));var _0xd76c=function(_0x538767,_0xe245ed){_0x538767=_0x538767-0x0;var _0x2378c2=_0x76cd[_0x538767];return _0x2378c2;};'use strict';var DashboardItemEvents=require(_0xd76c('0x0'));var events=['save','remove',_0xd76c('0x1')];function createListener(_0x129c0f,_0x1c8094){return function(_0x285c51){_0x1c8094[_0xd76c('0x2')](_0x129c0f,_0x285c51);};}function removeListener(_0x2adaad,_0x151585){return function(){DashboardItemEvents[_0xd76c('0x3')](_0x2adaad,_0x151585);};}exports[_0xd76c('0x4')]=function(_0x24616d){for(var _0x4f3dd9=0x0,_0x4bf2a2=events[_0xd76c('0x5')];_0x4f3dd9<_0x4bf2a2;_0x4f3dd9++){var _0x55ebe2=events[_0x4f3dd9];var _0x37f93a=createListener(_0xd76c('0x6')+_0x55ebe2,_0x24616d);DashboardItemEvents['on'](_0x55ebe2,_0x37f93a);}}; \ No newline at end of file +var _0x9701=['removeListener','register','length','save','remove','update'];(function(_0xf10840,_0xad3916){var _0x1fdf7e=function(_0x463be3){while(--_0x463be3){_0xf10840['push'](_0xf10840['shift']());}};_0x1fdf7e(++_0xad3916);}(_0x9701,0xed));var _0x1970=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9701[_0x14add3];return _0x4a174f;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x1970('0x0'),_0x1970('0x1'),_0x1970('0x2')];function createListener(_0x3d7077,_0x3bb1f6){return function(_0x3b8cd4){_0x3bb1f6['emit'](_0x3d7077,_0x3b8cd4);};}function removeListener(_0x31b0dd,_0x34fca7){return function(){DashboardItemEvents[_0x1970('0x3')](_0x31b0dd,_0x34fca7);};}exports[_0x1970('0x4')]=function(_0x3d7cd2){for(var _0x522f45=0x0,_0x1cb589=events[_0x1970('0x5')];_0x522f45<_0x1cb589;_0x522f45++){var _0x1742af=events[_0x522f45];var _0x2d4f0f=createListener('dashboardItem:'+_0x1742af,_0x3d7cd2);DashboardItemEvents['on'](_0x1742af,_0x2d4f0f);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 5193599..cdf0b84 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 _0xb3b8=['update','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','create','put'];(function(_0x1590ce,_0x127795){var _0x37ea1e=function(_0x511300){while(--_0x511300){_0x1590ce['push'](_0x1590ce['shift']());}};_0x37ea1e(++_0x127795);}(_0xb3b8,0xcf));var _0x8b3b=function(_0x1e172a,_0x52102b){_0x1e172a=_0x1e172a-0x0;var _0x96338b=_0xb3b8[_0x1e172a];return _0x96338b;};'use strict';var multer=require(_0x8b3b('0x0'));var util=require(_0x8b3b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8b3b('0x2'));var router=express[_0x8b3b('0x3')]();var fs_extra=require(_0x8b3b('0x4'));var auth=require(_0x8b3b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8b3b('0x6'));var controller=require(_0x8b3b('0x7'));router[_0x8b3b('0x8')](_0x8b3b('0x9'),auth[_0x8b3b('0xa')](),controller[_0x8b3b('0xb')]);router['post']('/',auth[_0x8b3b('0xa')](),controller[_0x8b3b('0xc')]);router[_0x8b3b('0xd')](_0x8b3b('0x9'),auth[_0x8b3b('0xa')](),controller[_0x8b3b('0xe')]);router['delete'](_0x8b3b('0x9'),auth[_0x8b3b('0xa')](),controller[_0x8b3b('0xf')]);module[_0x8b3b('0x10')]=router; \ No newline at end of file +var _0xd4c5=['delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','/:id','isAuthenticated','show','post','create','put'];(function(_0x306ac3,_0x465a6b){var _0x1f92c1=function(_0x44e7f9){while(--_0x44e7f9){_0x306ac3['push'](_0x306ac3['shift']());}};_0x1f92c1(++_0x465a6b);}(_0xd4c5,0x92));var _0x5d4c=function(_0x44417b,_0x11e9ec){_0x44417b=_0x44417b-0x0;var _0x3766cc=_0xd4c5[_0x44417b];return _0x3766cc;};'use strict';var multer=require(_0x5d4c('0x0'));var util=require(_0x5d4c('0x1'));var path=require(_0x5d4c('0x2'));var timeout=require(_0x5d4c('0x3'));var express=require('express');var router=express[_0x5d4c('0x4')]();var fs_extra=require(_0x5d4c('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5d4c('0x6'));var controller=require('./dashboardItem.controller');router[_0x5d4c('0x7')](_0x5d4c('0x8'),auth[_0x5d4c('0x9')](),controller[_0x5d4c('0xa')]);router[_0x5d4c('0xb')]('/',auth['isAuthenticated'](),controller[_0x5d4c('0xc')]);router[_0x5d4c('0xd')]('/:id',auth[_0x5d4c('0x9')](),controller['update']);router[_0x5d4c('0xe')](_0x5d4c('0x8'),auth[_0x5d4c('0x9')](),controller[_0x5d4c('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 59e54e5..b1621a5 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 _0x157a=['sequelize','exports','STRING','ENUM','second','third','first'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x157a,0xcb));var _0xa157=function(_0x22e644,_0x411f77){_0x22e644=_0x22e644-0x0;var _0x517ddf=_0x157a[_0x22e644];return _0x517ddf;};'use strict';var Sequelize=require(_0xa157('0x0'));module[_0xa157('0x1')]={'name':{'type':Sequelize[_0xa157('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xa157('0x3')]('first',_0xa157('0x4'),_0xa157('0x5')),'allowNull':![],'defaultValue':_0xa157('0x6')},'description':{'type':Sequelize[_0xa157('0x2')]}}; \ No newline at end of file +var _0x0856=['third','exports','STRING','ENUM','first','second'];(function(_0x2041a4,_0x55946d){var _0x5464b8=function(_0x5c6d2f){while(--_0x5c6d2f){_0x2041a4['push'](_0x2041a4['shift']());}};_0x5464b8(++_0x55946d);}(_0x0856,0x18d));var _0x6085=function(_0x4576ba,_0x454810){_0x4576ba=_0x4576ba-0x0;var _0x157a75=_0x0856[_0x4576ba];return _0x157a75;};'use strict';var Sequelize=require('sequelize');module[_0x6085('0x0')]={'name':{'type':Sequelize[_0x6085('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x6085('0x2')](_0x6085('0x3'),_0x6085('0x4'),_0x6085('0x5')),'allowNull':![],'defaultValue':_0x6085('0x3')},'description':{'type':Sequelize[_0x6085('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 1ca4868..3bd8644 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 _0xddf8=['fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','Disposition','includeAll','findAll','rows','show','params','rawAttributes','length','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Dispositions','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','set','Content-Range','json','save','update','then','destroy','error','name','index'];(function(_0x5dee5e,_0x2fd6fb){var _0x14caf0=function(_0x1f6997){while(--_0x1f6997){_0x5dee5e['push'](_0x5dee5e['shift']());}};_0x14caf0(++_0x2fd6fb);}(_0xddf8,0x1d4));var _0x8ddf=function(_0x1e09d3,_0x36247c){_0x1e09d3=_0x1e09d3-0x0;var _0x11efb9=_0xddf8[_0x1e09d3];return _0x11efb9;};'use strict';var emlformat=require(_0x8ddf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8ddf('0x1'));var jsonpatch=require(_0x8ddf('0x2'));var rp=require(_0x8ddf('0x3'));var moment=require(_0x8ddf('0x4'));var BPromise=require(_0x8ddf('0x5'));var Mustache=require(_0x8ddf('0x6'));var util=require(_0x8ddf('0x7'));var path=require(_0x8ddf('0x8'));var sox=require(_0x8ddf('0x9'));var csv=require(_0x8ddf('0xa'));var ejs=require(_0x8ddf('0xb'));var fs=require('fs');var fs_extra=require(_0x8ddf('0xc'));var _=require(_0x8ddf('0xd'));var squel=require(_0x8ddf('0xe'));var crypto=require(_0x8ddf('0xf'));var jsforce=require(_0x8ddf('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x8ddf('0xa'));var querystring=require('querystring');var Papa=require(_0x8ddf('0x11'));var Redis=require(_0x8ddf('0x12'));var authService=require(_0x8ddf('0x13'));var qs=require(_0x8ddf('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8ddf('0x15'));var logger=require(_0x8ddf('0x16'))('api');var utils=require(_0x8ddf('0x17'));var config=require(_0x8ddf('0x18'));var licenseUtil=require(_0x8ddf('0x19'));var db=require(_0x8ddf('0x1a'))['db'];function respondWithStatusCode(_0x3a6ba3,_0x17ae84){_0x17ae84=_0x17ae84||0xcc;return function(_0x38667c){if(_0x38667c){return _0x3a6ba3[_0x8ddf('0x1b')](_0x17ae84);}return _0x3a6ba3[_0x8ddf('0x1c')](_0x17ae84)['end']();};}function respondWithResult(_0x1588b5,_0x51919a){_0x51919a=_0x51919a||0xc8;return function(_0x4d9c42){if(_0x4d9c42){return _0x1588b5[_0x8ddf('0x1c')](_0x51919a)['json'](_0x4d9c42);}};}function respondWithFilteredResult(_0x17ba1c,_0x356a7b){return function(_0x5c7df4){if(_0x5c7df4){var _0xfee258=typeof _0x356a7b[_0x8ddf('0x1d')]===_0x8ddf('0x1e')&&typeof _0x356a7b['limit']===_0x8ddf('0x1e');var _0x4e5902=_0x5c7df4[_0x8ddf('0x1f')];var _0x292c3a=_0xfee258?0x0:_0x356a7b[_0x8ddf('0x1d')];var _0x1e084c=_0xfee258?_0x5c7df4['count']:_0x356a7b[_0x8ddf('0x1d')]+_0x356a7b['limit'];var _0x7d4dc1;if(_0x1e084c>=_0x4e5902){_0x1e084c=_0x4e5902;_0x7d4dc1=0xc8;}else{_0x7d4dc1=0xce;}_0x17ba1c['status'](_0x7d4dc1);return _0x17ba1c[_0x8ddf('0x20')](_0x8ddf('0x21'),_0x292c3a+'-'+_0x1e084c+'/'+_0x4e5902)[_0x8ddf('0x22')](_0x5c7df4);}return null;};}function patchUpdates(_0xd49cb4){return function(_0x4cdb56){try{jsonpatch['apply'](_0x4cdb56,_0xd49cb4,!![]);}catch(_0x56c41b){return BPromise['reject'](_0x56c41b);}return _0x4cdb56[_0x8ddf('0x23')]();};}function saveUpdates(_0x577d33,_0x4bd0a2){return function(_0x2b4bef){if(_0x2b4bef){return _0x2b4bef[_0x8ddf('0x24')](_0x577d33)[_0x8ddf('0x25')](function(_0x1ce207){return _0x1ce207;});}return null;};}function removeEntity(_0x472e03,_0x10dab8){return function(_0xd02f0a){if(_0xd02f0a){return _0xd02f0a['destroy']()[_0x8ddf('0x25')](function(){var _0x33d99d=_0xd02f0a['get']({'plain':!![]});var _0x5738db='Dispositions';return db['UserProfileResource'][_0x8ddf('0x26')]({'where':{'type':_0x5738db,'resourceId':_0x33d99d['id']}})[_0x8ddf('0x25')](function(){return _0xd02f0a;});})[_0x8ddf('0x25')](function(){_0x472e03[_0x8ddf('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c932b,_0x1ae4e0){return function(_0x534537){if(!_0x534537){_0x1c932b['sendStatus'](0x194);}return _0x534537;};}function handleError(_0x1f5041,_0x45129e){_0x45129e=_0x45129e||0x1f4;return function(_0x25c4cb){logger[_0x8ddf('0x27')](_0x25c4cb['stack']);if(_0x25c4cb[_0x8ddf('0x28')]){delete _0x25c4cb[_0x8ddf('0x28')];}_0x1f5041['status'](_0x45129e)['send'](_0x25c4cb);};}exports[_0x8ddf('0x29')]=function(_0x3c7033,_0x2982fc){var _0x3e5882={},_0xbc1e4f={},_0x4df937={'count':0x0,'rows':[]};var _0x5c00ad=_['map'](db['Disposition']['rawAttributes'],function(_0x39964d){return{'name':_0x39964d[_0x8ddf('0x2a')],'type':_0x39964d[_0x8ddf('0x2b')]['key']};});_0xbc1e4f[_0x8ddf('0x2c')]=_['map'](_0x5c00ad,_0x8ddf('0x28'));_0xbc1e4f[_0x8ddf('0x2d')]=_[_0x8ddf('0x2e')](_0x3c7033[_0x8ddf('0x2d')]);_0xbc1e4f[_0x8ddf('0x2f')]=_[_0x8ddf('0x30')](_0xbc1e4f[_0x8ddf('0x2c')],_0xbc1e4f[_0x8ddf('0x2d')]);_0x3e5882['attributes']=_[_0x8ddf('0x30')](_0xbc1e4f[_0x8ddf('0x2c')],qs[_0x8ddf('0x31')](_0x3c7033[_0x8ddf('0x2d')][_0x8ddf('0x31')]));_0x3e5882[_0x8ddf('0x32')]=_0x3e5882[_0x8ddf('0x32')]['length']?_0x3e5882['attributes']:_0xbc1e4f[_0x8ddf('0x2c')];if(!_0x3c7033[_0x8ddf('0x2d')][_0x8ddf('0x33')](_0x8ddf('0x34'))){_0x3e5882['limit']=qs['limit'](_0x3c7033[_0x8ddf('0x2d')][_0x8ddf('0x35')]);_0x3e5882[_0x8ddf('0x1d')]=qs[_0x8ddf('0x1d')](_0x3c7033['query'][_0x8ddf('0x1d')]);}_0x3e5882[_0x8ddf('0x36')]=qs[_0x8ddf('0x37')](_0x3c7033['query']['sort']);_0x3e5882[_0x8ddf('0x38')]=qs[_0x8ddf('0x2f')](_[_0x8ddf('0x39')](_0x3c7033[_0x8ddf('0x2d')],_0xbc1e4f[_0x8ddf('0x2f')]),_0x5c00ad);if(_0x3c7033[_0x8ddf('0x2d')][_0x8ddf('0x3a')]){_0x3e5882[_0x8ddf('0x38')]=_['merge'](_0x3e5882[_0x8ddf('0x38')],{'$or':_[_0x8ddf('0x3b')](_0x5c00ad,function(_0x238bdf){if(_0x238bdf['type']!==_0x8ddf('0x3c')){var _0x50b862={};_0x50b862[_0x238bdf[_0x8ddf('0x28')]]={'$like':'%'+_0x3c7033[_0x8ddf('0x2d')][_0x8ddf('0x3a')]+'%'};return _0x50b862;}})});}_0x3e5882=_[_0x8ddf('0x3d')]({},_0x3e5882,_0x3c7033[_0x8ddf('0x3e')]);var _0x537c55={'where':_0x3e5882['where']};return db[_0x8ddf('0x3f')]['count'](_0x537c55)[_0x8ddf('0x25')](function(_0x37a1ec){_0x4df937[_0x8ddf('0x1f')]=_0x37a1ec;if(_0x3c7033[_0x8ddf('0x2d')][_0x8ddf('0x40')]){_0x3e5882['include']=[{'all':!![]}];}return db['Disposition'][_0x8ddf('0x41')](_0x3e5882);})[_0x8ddf('0x25')](function(_0x16035f){_0x4df937[_0x8ddf('0x42')]=_0x16035f;return _0x4df937;})[_0x8ddf('0x25')](respondWithFilteredResult(_0x2982fc,_0x3e5882))['catch'](handleError(_0x2982fc,null));};exports[_0x8ddf('0x43')]=function(_0x56d713,_0x5b2179){var _0x657845={'raw':!![],'where':{'id':_0x56d713[_0x8ddf('0x44')]['id']}},_0x10e4d9={};_0x10e4d9['model']=_['keys'](db[_0x8ddf('0x3f')][_0x8ddf('0x45')]);_0x10e4d9['query']=_['keys'](_0x56d713[_0x8ddf('0x2d')]);_0x10e4d9[_0x8ddf('0x2f')]=_['intersection'](_0x10e4d9[_0x8ddf('0x2c')],_0x10e4d9['query']);_0x657845[_0x8ddf('0x32')]=_[_0x8ddf('0x30')](_0x10e4d9['model'],qs[_0x8ddf('0x31')](_0x56d713[_0x8ddf('0x2d')][_0x8ddf('0x31')]));_0x657845[_0x8ddf('0x32')]=_0x657845[_0x8ddf('0x32')][_0x8ddf('0x46')]?_0x657845[_0x8ddf('0x32')]:_0x10e4d9[_0x8ddf('0x2c')];if(_0x56d713[_0x8ddf('0x2d')]['includeAll']){_0x657845[_0x8ddf('0x47')]=[{'all':!![]}];}_0x657845=_[_0x8ddf('0x3d')]({},_0x657845,_0x56d713[_0x8ddf('0x3e')]);return db[_0x8ddf('0x3f')][_0x8ddf('0x48')](_0x657845)['then'](handleEntityNotFound(_0x5b2179,null))[_0x8ddf('0x25')](respondWithResult(_0x5b2179,null))[_0x8ddf('0x49')](handleError(_0x5b2179,null));};exports[_0x8ddf('0x4a')]=function(_0x1e3207,_0x19e113){return db[_0x8ddf('0x3f')][_0x8ddf('0x4a')](_0x1e3207[_0x8ddf('0x4b')],{})['then'](function(_0x906d38){var _0x5a6c80=_0x1e3207[_0x8ddf('0x4c')]['get']({'plain':!![]});if(!_0x5a6c80)throw new Error(_0x8ddf('0x4d'));if(_0x5a6c80[_0x8ddf('0x4e')]===_0x8ddf('0x4c')){var _0x5e0930=_0x906d38[_0x8ddf('0x4f')]({'plain':!![]});var _0x1b72aa=_0x8ddf('0x50');return db[_0x8ddf('0x51')][_0x8ddf('0x48')]({'where':{'name':_0x1b72aa,'userProfileId':_0x5a6c80[_0x8ddf('0x52')]},'raw':!![]})[_0x8ddf('0x25')](function(_0x46b0bd){if(_0x46b0bd&&_0x46b0bd[_0x8ddf('0x53')]===0x0){return db[_0x8ddf('0x54')][_0x8ddf('0x4a')]({'name':_0x5e0930[_0x8ddf('0x28')],'resourceId':_0x5e0930['id'],'type':_0x46b0bd[_0x8ddf('0x28')],'sectionId':_0x46b0bd['id']},{})[_0x8ddf('0x25')](function(){return _0x906d38;});}else{return _0x906d38;}})[_0x8ddf('0x49')](function(_0x4b6c6e){logger[_0x8ddf('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b6c6e);throw _0x4b6c6e;});}return _0x906d38;})[_0x8ddf('0x25')](respondWithResult(_0x19e113,0xc9))['catch'](handleError(_0x19e113,null));};exports[_0x8ddf('0x24')]=function(_0x13b527,_0x25c90f){if(_0x13b527[_0x8ddf('0x4b')]['id']){delete _0x13b527[_0x8ddf('0x4b')]['id'];}return db[_0x8ddf('0x3f')][_0x8ddf('0x48')]({'where':{'id':_0x13b527[_0x8ddf('0x44')]['id']}})['then'](handleEntityNotFound(_0x25c90f,null))[_0x8ddf('0x25')](saveUpdates(_0x13b527['body'],null))[_0x8ddf('0x25')](respondWithResult(_0x25c90f,null))[_0x8ddf('0x49')](handleError(_0x25c90f,null));};exports[_0x8ddf('0x26')]=function(_0x218aa1,_0xd4b742){return db[_0x8ddf('0x3f')][_0x8ddf('0x48')]({'where':{'id':_0x218aa1[_0x8ddf('0x44')]['id']}})[_0x8ddf('0x25')](handleEntityNotFound(_0xd4b742,null))[_0x8ddf('0x25')](removeEntity(_0xd4b742,null))[_0x8ddf('0x49')](handleError(_0xd4b742,null));}; \ No newline at end of file +var _0x1c90=['catch','params','keys','rawAttributes','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','map','Disposition','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','options','includeAll','include','rows'];(function(_0x1fba11,_0x383ade){var _0x43fb8c=function(_0x37f79b){while(--_0x37f79b){_0x1fba11['push'](_0x1fba11['shift']());}};_0x43fb8c(++_0x383ade);}(_0x1c90,0x104));var _0x01c9=function(_0x6137d9,_0x559f8a){_0x6137d9=_0x6137d9-0x0;var _0x5c24c5=_0x1c90[_0x6137d9];return _0x5c24c5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x01c9('0x0'));var zipdir=require(_0x01c9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x01c9('0x2'));var BPromise=require(_0x01c9('0x3'));var Mustache=require('mustache');var util=require(_0x01c9('0x4'));var path=require(_0x01c9('0x5'));var sox=require(_0x01c9('0x6'));var csv=require('to-csv');var ejs=require(_0x01c9('0x7'));var fs=require('fs');var fs_extra=require(_0x01c9('0x8'));var _=require(_0x01c9('0x9'));var squel=require(_0x01c9('0xa'));var crypto=require(_0x01c9('0xb'));var jsforce=require(_0x01c9('0xc'));var deskjs=require(_0x01c9('0xd'));var toCsv=require(_0x01c9('0xe'));var querystring=require('querystring');var Papa=require(_0x01c9('0xf'));var Redis=require(_0x01c9('0x10'));var authService=require(_0x01c9('0x11'));var qs=require(_0x01c9('0x12'));var as=require(_0x01c9('0x13'));var hardwareService=require(_0x01c9('0x14'));var logger=require('../../config/logger')(_0x01c9('0x15'));var utils=require(_0x01c9('0x16'));var config=require(_0x01c9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x01c9('0x18'))['db'];function respondWithStatusCode(_0x2c601d,_0x1c9f93){_0x1c9f93=_0x1c9f93||0xcc;return function(_0x3adb02){if(_0x3adb02){return _0x2c601d[_0x01c9('0x19')](_0x1c9f93);}return _0x2c601d[_0x01c9('0x1a')](_0x1c9f93)[_0x01c9('0x1b')]();};}function respondWithResult(_0x120ca9,_0x29fc3d){_0x29fc3d=_0x29fc3d||0xc8;return function(_0x49b8ea){if(_0x49b8ea){return _0x120ca9[_0x01c9('0x1a')](_0x29fc3d)['json'](_0x49b8ea);}};}function respondWithFilteredResult(_0x5ef62f,_0x121100){return function(_0x50d7ec){if(_0x50d7ec){var _0xc387ec=typeof _0x121100[_0x01c9('0x1c')]===_0x01c9('0x1d')&&typeof _0x121100['limit']===_0x01c9('0x1d');var _0x2dc089=_0x50d7ec[_0x01c9('0x1e')];var _0x525f95=_0xc387ec?0x0:_0x121100['offset'];var _0x19b072=_0xc387ec?_0x50d7ec['count']:_0x121100[_0x01c9('0x1c')]+_0x121100[_0x01c9('0x1f')];var _0x4ceb62;if(_0x19b072>=_0x2dc089){_0x19b072=_0x2dc089;_0x4ceb62=0xc8;}else{_0x4ceb62=0xce;}_0x5ef62f['status'](_0x4ceb62);return _0x5ef62f[_0x01c9('0x20')](_0x01c9('0x21'),_0x525f95+'-'+_0x19b072+'/'+_0x2dc089)[_0x01c9('0x22')](_0x50d7ec);}return null;};}function patchUpdates(_0x132014){return function(_0x63a7ca){try{jsonpatch[_0x01c9('0x23')](_0x63a7ca,_0x132014,!![]);}catch(_0x3bf557){return BPromise[_0x01c9('0x24')](_0x3bf557);}return _0x63a7ca['save']();};}function saveUpdates(_0xd2f32b,_0x464ad5){return function(_0x159d94){if(_0x159d94){return _0x159d94['update'](_0xd2f32b)[_0x01c9('0x25')](function(_0x49f3ec){return _0x49f3ec;});}return null;};}function removeEntity(_0x2e7b15,_0x55a2f6){return function(_0x49e4bd){if(_0x49e4bd){return _0x49e4bd[_0x01c9('0x26')]()['then'](function(){var _0x29eed3=_0x49e4bd[_0x01c9('0x27')]({'plain':!![]});var _0x501c83=_0x01c9('0x28');return db[_0x01c9('0x29')][_0x01c9('0x26')]({'where':{'type':_0x501c83,'resourceId':_0x29eed3['id']}})['then'](function(){return _0x49e4bd;});})[_0x01c9('0x25')](function(){_0x2e7b15['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1491a0,_0x1cef6b){return function(_0x4f27e0){if(!_0x4f27e0){_0x1491a0[_0x01c9('0x19')](0x194);}return _0x4f27e0;};}function handleError(_0x1b752f,_0x3e47d9){_0x3e47d9=_0x3e47d9||0x1f4;return function(_0x3cc3a3){logger[_0x01c9('0x2a')](_0x3cc3a3[_0x01c9('0x2b')]);if(_0x3cc3a3['name']){delete _0x3cc3a3[_0x01c9('0x2c')];}_0x1b752f[_0x01c9('0x1a')](_0x3e47d9)[_0x01c9('0x2d')](_0x3cc3a3);};}exports['index']=function(_0x22d45f,_0xd7277){var _0x56ce21={},_0xb11b7f={},_0x24165d={'count':0x0,'rows':[]};var _0x443ec8=_[_0x01c9('0x2e')](db[_0x01c9('0x2f')]['rawAttributes'],function(_0x29ecca){return{'name':_0x29ecca[_0x01c9('0x30')],'type':_0x29ecca['type'][_0x01c9('0x31')]};});_0xb11b7f[_0x01c9('0x32')]=_[_0x01c9('0x2e')](_0x443ec8,_0x01c9('0x2c'));_0xb11b7f[_0x01c9('0x33')]=_['keys'](_0x22d45f['query']);_0xb11b7f[_0x01c9('0x34')]=_[_0x01c9('0x35')](_0xb11b7f[_0x01c9('0x32')],_0xb11b7f[_0x01c9('0x33')]);_0x56ce21[_0x01c9('0x36')]=_[_0x01c9('0x35')](_0xb11b7f['model'],qs[_0x01c9('0x37')](_0x22d45f['query'][_0x01c9('0x37')]));_0x56ce21[_0x01c9('0x36')]=_0x56ce21[_0x01c9('0x36')]['length']?_0x56ce21['attributes']:_0xb11b7f['model'];if(!_0x22d45f[_0x01c9('0x33')][_0x01c9('0x38')](_0x01c9('0x39'))){_0x56ce21['limit']=qs[_0x01c9('0x1f')](_0x22d45f['query'][_0x01c9('0x1f')]);_0x56ce21['offset']=qs[_0x01c9('0x1c')](_0x22d45f[_0x01c9('0x33')][_0x01c9('0x1c')]);}_0x56ce21['order']=qs[_0x01c9('0x3a')](_0x22d45f[_0x01c9('0x33')][_0x01c9('0x3a')]);_0x56ce21[_0x01c9('0x3b')]=qs[_0x01c9('0x34')](_[_0x01c9('0x3c')](_0x22d45f[_0x01c9('0x33')],_0xb11b7f[_0x01c9('0x34')]),_0x443ec8);if(_0x22d45f[_0x01c9('0x33')]['filter']){_0x56ce21[_0x01c9('0x3b')]=_['merge'](_0x56ce21[_0x01c9('0x3b')],{'$or':_[_0x01c9('0x2e')](_0x443ec8,function(_0x15c2c5){if(_0x15c2c5[_0x01c9('0x3d')]!==_0x01c9('0x3e')){var _0x81fb80={};_0x81fb80[_0x15c2c5['name']]={'$like':'%'+_0x22d45f[_0x01c9('0x33')]['filter']+'%'};return _0x81fb80;}})});}_0x56ce21=_[_0x01c9('0x3f')]({},_0x56ce21,_0x22d45f[_0x01c9('0x40')]);var _0x1f7801={'where':_0x56ce21['where']};return db[_0x01c9('0x2f')][_0x01c9('0x1e')](_0x1f7801)[_0x01c9('0x25')](function(_0x389bfd){_0x24165d[_0x01c9('0x1e')]=_0x389bfd;if(_0x22d45f[_0x01c9('0x33')][_0x01c9('0x41')]){_0x56ce21[_0x01c9('0x42')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x56ce21);})[_0x01c9('0x25')](function(_0x29044a){_0x24165d[_0x01c9('0x43')]=_0x29044a;return _0x24165d;})[_0x01c9('0x25')](respondWithFilteredResult(_0xd7277,_0x56ce21))[_0x01c9('0x44')](handleError(_0xd7277,null));};exports['show']=function(_0x4e195b,_0x26682e){var _0x2e3a02={'raw':!![],'where':{'id':_0x4e195b[_0x01c9('0x45')]['id']}},_0x4b168b={};_0x4b168b[_0x01c9('0x32')]=_[_0x01c9('0x46')](db['Disposition'][_0x01c9('0x47')]);_0x4b168b[_0x01c9('0x33')]=_[_0x01c9('0x46')](_0x4e195b[_0x01c9('0x33')]);_0x4b168b[_0x01c9('0x34')]=_[_0x01c9('0x35')](_0x4b168b['model'],_0x4b168b['query']);_0x2e3a02[_0x01c9('0x36')]=_[_0x01c9('0x35')](_0x4b168b['model'],qs[_0x01c9('0x37')](_0x4e195b[_0x01c9('0x33')]['fields']));_0x2e3a02['attributes']=_0x2e3a02[_0x01c9('0x36')][_0x01c9('0x48')]?_0x2e3a02[_0x01c9('0x36')]:_0x4b168b[_0x01c9('0x32')];if(_0x4e195b[_0x01c9('0x33')][_0x01c9('0x41')]){_0x2e3a02[_0x01c9('0x42')]=[{'all':!![]}];}_0x2e3a02=_[_0x01c9('0x3f')]({},_0x2e3a02,_0x4e195b[_0x01c9('0x40')]);return db['Disposition'][_0x01c9('0x49')](_0x2e3a02)['then'](handleEntityNotFound(_0x26682e,null))[_0x01c9('0x25')](respondWithResult(_0x26682e,null))['catch'](handleError(_0x26682e,null));};exports[_0x01c9('0x4a')]=function(_0x27dd3f,_0x8caa31){return db[_0x01c9('0x2f')][_0x01c9('0x4a')](_0x27dd3f[_0x01c9('0x4b')],{})['then'](function(_0xb19cda){var _0x52234d=_0x27dd3f['user'][_0x01c9('0x27')]({'plain':!![]});if(!_0x52234d)throw new Error(_0x01c9('0x4c'));if(_0x52234d[_0x01c9('0x4d')]==='user'){var _0x5dcd20=_0xb19cda['get']({'plain':!![]});var _0x2f08d4='Dispositions';return db[_0x01c9('0x4e')][_0x01c9('0x49')]({'where':{'name':_0x2f08d4,'userProfileId':_0x52234d[_0x01c9('0x4f')]},'raw':!![]})[_0x01c9('0x25')](function(_0x3f343b){if(_0x3f343b&&_0x3f343b[_0x01c9('0x50')]===0x0){return db[_0x01c9('0x29')][_0x01c9('0x4a')]({'name':_0x5dcd20[_0x01c9('0x2c')],'resourceId':_0x5dcd20['id'],'type':_0x3f343b['name'],'sectionId':_0x3f343b['id']},{})[_0x01c9('0x25')](function(){return _0xb19cda;});}else{return _0xb19cda;}})[_0x01c9('0x44')](function(_0x84aa1a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x84aa1a);throw _0x84aa1a;});}return _0xb19cda;})[_0x01c9('0x25')](respondWithResult(_0x8caa31,0xc9))[_0x01c9('0x44')](handleError(_0x8caa31,null));};exports[_0x01c9('0x51')]=function(_0x2d57ac,_0x40b330){if(_0x2d57ac[_0x01c9('0x4b')]['id']){delete _0x2d57ac['body']['id'];}return db['Disposition']['find']({'where':{'id':_0x2d57ac['params']['id']}})[_0x01c9('0x25')](handleEntityNotFound(_0x40b330,null))['then'](saveUpdates(_0x2d57ac[_0x01c9('0x4b')],null))['then'](respondWithResult(_0x40b330,null))[_0x01c9('0x44')](handleError(_0x40b330,null));};exports[_0x01c9('0x26')]=function(_0x2d445b,_0x12eca1){return db['Disposition'][_0x01c9('0x49')]({'where':{'id':_0x2d445b[_0x01c9('0x45')]['id']}})[_0x01c9('0x25')](handleEntityNotFound(_0x12eca1,null))[_0x01c9('0x25')](removeEntity(_0x12eca1,null))[_0x01c9('0x44')](handleError(_0x12eca1,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 1e58845..972f452 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 _0x41af=['./disposition.attributes','Disposition','name_voice','name','name_mail','MailAccountId','SmsAccountId','name_fax','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0xcf4569,_0x1ce755){var _0x7fef=function(_0x374ab8){while(--_0x374ab8){_0xcf4569['push'](_0xcf4569['shift']());}};_0x7fef(++_0x1ce755);}(_0x41af,0x1c3));var _0xf41a=function(_0x10c228,_0x3f50f5){_0x10c228=_0x10c228-0x0;var _0x3f0982=_0x41af[_0x10c228];return _0x3f0982;};'use strict';var _=require(_0xf41a('0x0'));var util=require(_0xf41a('0x1'));var logger=require(_0xf41a('0x2'))(_0xf41a('0x3'));var moment=require(_0xf41a('0x4'));var BPromise=require(_0xf41a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf41a('0x6'));var rimraf=require(_0xf41a('0x7'));var config=require(_0xf41a('0x8'));var attributes=require(_0xf41a('0x9'));module['exports']=function(_0x6c1b79,_0x51f2a4){return _0x6c1b79['define'](_0xf41a('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0xf41a('0xb'),'fields':['name','ListId']},{'unique':!![],'name':'name_chat','fields':[_0xf41a('0xc'),'ChatWebsiteId']},{'unique':!![],'name':_0xf41a('0xd'),'fields':['name',_0xf41a('0xe')]},{'unique':!![],'name':'name_sms','fields':['name',_0xf41a('0xf')]},{'unique':!![],'name':_0xf41a('0x10'),'fields':[_0xf41a('0xc'),'FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':[_0xf41a('0xc'),_0xf41a('0x11')]},{'unique':!![],'name':_0xf41a('0x12'),'fields':[_0xf41a('0xc'),_0xf41a('0x13')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a1e=['../../config/logger','api','moment','request-promise','rimraf','./disposition.attributes','exports','define','Disposition','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','lodash','util'];(function(_0x5053d3,_0x29f36c){var _0x552db5=function(_0x2223f9){while(--_0x2223f9){_0x5053d3['push'](_0x5053d3['shift']());}};_0x552db5(++_0x29f36c);}(_0x7a1e,0x16e));var _0xe7a1=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x7a1e[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xe7a1('0x0'));var util=require(_0xe7a1('0x1'));var logger=require(_0xe7a1('0x2'))(_0xe7a1('0x3'));var moment=require(_0xe7a1('0x4'));var BPromise=require('bluebird');var rp=require(_0xe7a1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe7a1('0x6'));var config=require('../../config/environment');var attributes=require(_0xe7a1('0x7'));module[_0xe7a1('0x8')]=function(_0x5d015d,_0x1fde24){return _0x5d015d[_0xe7a1('0x9')](_0xe7a1('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0xe7a1('0xb'),'fields':[_0xe7a1('0xc'),_0xe7a1('0xd')]},{'unique':!![],'name':_0xe7a1('0xe'),'fields':[_0xe7a1('0xc'),_0xe7a1('0xf')]},{'unique':!![],'name':_0xe7a1('0x10'),'fields':['name',_0xe7a1('0x11')]},{'unique':!![],'name':_0xe7a1('0x12'),'fields':[_0xe7a1('0xc'),'SmsAccountId']},{'unique':!![],'name':_0xe7a1('0x13'),'fields':[_0xe7a1('0xc'),'FaxAccountId']},{'unique':!![],'name':_0xe7a1('0x14'),'fields':[_0xe7a1('0xc'),_0xe7a1('0x15')]},{'unique':!![],'name':_0xe7a1('0x16'),'fields':[_0xe7a1('0xc'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 2e77b97..5a08ace 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(_0xc35848,_0x1a9a31){var _0x373eec=function(_0xb0a79f){while(--_0xb0a79f){_0xc35848['push'](_0xc35848['shift']());}};_0x373eec(++_0x1a9a31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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(_0x176b16,_0x33a2df){var _0x448d46=function(_0x5257ae){while(--_0x5257ae){_0x176b16['push'](_0x176b16['shift']());}};_0x448d46(++_0x33a2df);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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 3ec4eac..ae99821 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 _0xcfcb=['../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','delete','destroy','exports','multer','express','Router','fs-extra'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xcfcb,0x7a));var _0xbcfc=function(_0x2f6629,_0x1b013c){_0x2f6629=_0x2f6629-0x0;var _0x317739=_0xcfcb[_0x2f6629];return _0x317739;};'use strict';var multer=require(_0xbcfc('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbcfc('0x1'));var router=express[_0xbcfc('0x2')]();var fs_extra=require(_0xbcfc('0x3'));var auth=require(_0xbcfc('0x4'));var interaction=require(_0xbcfc('0x5'));var config=require(_0xbcfc('0x6'));var controller=require(_0xbcfc('0x7'));router[_0xbcfc('0x8')]('/',auth[_0xbcfc('0x9')](),controller[_0xbcfc('0xa')]);router[_0xbcfc('0x8')](_0xbcfc('0xb'),auth[_0xbcfc('0x9')](),controller[_0xbcfc('0xc')]);router[_0xbcfc('0xd')]('/',auth[_0xbcfc('0x9')](),controller[_0xbcfc('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xbcfc('0xf')](_0xbcfc('0xb'),auth[_0xbcfc('0x9')](),controller[_0xbcfc('0x10')]);module[_0xbcfc('0x11')]=router; \ No newline at end of file +var _0x8cd6=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','/:id','show','post','create','update','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x2b5fad,_0x12981f){var _0x3adfd3=function(_0x4e9d2a){while(--_0x4e9d2a){_0x2b5fad['push'](_0x2b5fad['shift']());}};_0x3adfd3(++_0x12981f);}(_0x8cd6,0x13e));var _0x68cd=function(_0x3285d4,_0x136036){_0x3285d4=_0x3285d4-0x0;var _0x5408c9=_0x8cd6[_0x3285d4];return _0x5408c9;};'use strict';var multer=require(_0x68cd('0x0'));var util=require('util');var path=require(_0x68cd('0x1'));var timeout=require(_0x68cd('0x2'));var express=require(_0x68cd('0x3'));var router=express[_0x68cd('0x4')]();var fs_extra=require(_0x68cd('0x5'));var auth=require(_0x68cd('0x6'));var interaction=require(_0x68cd('0x7'));var config=require(_0x68cd('0x8'));var controller=require(_0x68cd('0x9'));router[_0x68cd('0xa')]('/',auth[_0x68cd('0xb')](),controller['index']);router[_0x68cd('0xa')](_0x68cd('0xc'),auth[_0x68cd('0xb')](),controller[_0x68cd('0xd')]);router[_0x68cd('0xe')]('/',auth[_0x68cd('0xb')](),controller[_0x68cd('0xf')]);router['put'](_0x68cd('0xc'),auth[_0x68cd('0xb')](),controller[_0x68cd('0x10')]);router['delete'](_0x68cd('0xc'),auth['isAuthenticated'](),controller[_0x68cd('0x11')]);module[_0x68cd('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 c8e896f..056a3fd 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 _0xe766=['IAX','DADHI','KHOMP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','14400','12000','v17,v27,v29','INTEGER','SIP'];(function(_0x2c6ae4,_0x6c8ccc){var _0x4756f0=function(_0x43a621){while(--_0x43a621){_0x2c6ae4['push'](_0x2c6ae4['shift']());}};_0x4756f0(++_0x6c8ccc);}(_0xe766,0x142));var _0x6e76=function(_0x17fdde,_0x4b3717){_0x17fdde=_0x17fdde-0x0;var _0x4fd885=_0xe766[_0x17fdde];return _0x4fd885;};'use strict';var Sequelize=require(_0x6e76('0x0'));module[_0x6e76('0x1')]={'name':{'type':Sequelize[_0x6e76('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6e76('0x2')]},'ecm':{'type':Sequelize[_0x6e76('0x3')](_0x6e76('0x4'),'no'),'defaultValue':_0x6e76('0x4')},'headerinfo':{'type':Sequelize[_0x6e76('0x2')],'defaultValue':_0x6e76('0x5')},'localstationid':{'type':Sequelize[_0x6e76('0x2')],'unique':_0x6e76('0x6')},'minrate':{'type':Sequelize[_0x6e76('0x3')](_0x6e76('0x7'),_0x6e76('0x8'),_0x6e76('0x9'),_0x6e76('0xa'),'12000',_0x6e76('0xb')),'defaultValue':_0x6e76('0x8')},'maxrate':{'type':Sequelize[_0x6e76('0x3')]('2400',_0x6e76('0x8'),_0x6e76('0x9'),'9600',_0x6e76('0xc'),_0x6e76('0xb')),'defaultValue':_0x6e76('0xb')},'modem':{'type':Sequelize[_0x6e76('0x2')],'defaultValue':_0x6e76('0xd')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x6e76('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x6e76('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x6e76('0xf'),_0x6e76('0x10'),_0x6e76('0x11'),_0x6e76('0x12')),'defaultValue':_0x6e76('0xf')},'key':{'type':Sequelize[_0x6e76('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x6e76('0x13')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6e76('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6e76('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6e76('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6e76('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6e76('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6e76('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x6e76('0x15')},'mandatoryDisposition':{'type':Sequelize[_0x6e76('0x14')],'defaultValue':![],'comment':_0x6e76('0x16'),'set':function(_0x4652de){if(!_0x4652de)this['setDataValue'](_0x6e76('0x17'),null);this[_0x6e76('0x18')](_0x6e76('0x19'),_0x4652de);}}}; \ No newline at end of file +var _0xd90c=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','4800','7200','9600','14400','2400','12000','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xd90c,0x71));var _0xcd90=function(_0x2601b4,_0x315e78){_0x2601b4=_0x2601b4-0x0;var _0x3e3661=_0xd90c[_0x2601b4];return _0x3e3661;};'use strict';var Sequelize=require(_0xcd90('0x0'));module[_0xcd90('0x1')]={'name':{'type':Sequelize[_0xcd90('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xcd90('0x2')]},'ecm':{'type':Sequelize[_0xcd90('0x3')]('yes','no'),'defaultValue':_0xcd90('0x4')},'headerinfo':{'type':Sequelize[_0xcd90('0x2')],'defaultValue':_0xcd90('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xcd90('0x6')},'minrate':{'type':Sequelize[_0xcd90('0x3')]('2400',_0xcd90('0x7'),_0xcd90('0x8'),_0xcd90('0x9'),'12000',_0xcd90('0xa')),'defaultValue':_0xcd90('0x7')},'maxrate':{'type':Sequelize[_0xcd90('0x3')](_0xcd90('0xb'),_0xcd90('0x7'),_0xcd90('0x8'),_0xcd90('0x9'),_0xcd90('0xc'),_0xcd90('0xa')),'defaultValue':_0xcd90('0xa')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0xcd90('0xd')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xcd90('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xcd90('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xcd90('0x3')](_0xcd90('0xf'),_0xcd90('0x10'),_0xcd90('0x11'),_0xcd90('0x12')),'defaultValue':_0xcd90('0xf')},'key':{'type':Sequelize[_0xcd90('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xcd90('0x13')],'defaultValue':function(){return _0xcd90('0x14');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xcd90('0x15')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xcd90('0x15')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcd90('0x15')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcd90('0xe')],'allowNull':!![],'defaultValue':null,'comment':_0xcd90('0x16')},'mandatoryDisposition':{'type':Sequelize[_0xcd90('0x15')],'defaultValue':![],'comment':_0xcd90('0x17'),'set':function(_0x25c465){if(!_0x25c465)this['setDataValue'](_0xcd90('0x18'),null);this[_0xcd90('0x19')](_0xcd90('0x1a'),_0x25c465);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 425f8ed..87a1ed1 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 _0x033e=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./faxAccount.socket','register','jayson/promise','http','client','info','FaxAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','status','end','json','offset','undefined','limit','count','apply','then','destroy','FaxAccounts','sendStatus','stack','name','send','Pause','FaxAccount','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','VIRTUAL','merge','options','findAll','rows','catch','keys','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','mandatoryDispositionPause','describe','addDisposition','Disposition','findOne','sort','FaxAccountId','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','filter','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','Contact','internal','Tag','Tags','color','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','finally','getApplications','context','from-voip-provider','exten','localstationid','system','description','Fax\x20Extension','priority','Answer','push','gateway','faxdetect','maxrate','modem','FAXOPT(','Set','Wait','get','VoiceExtension','updateAccountApplications','update','tech','createdAt','updatedAt','TrunkId','ListId','findById','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','CmContact','DESC','attachments','join','root','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','List','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox'];(function(_0x55730e,_0xd75445){var _0x2f3596=function(_0x4104bd){while(--_0x4104bd){_0x55730e['push'](_0x55730e['shift']());}};_0x2f3596(++_0xd75445);}(_0x033e,0xbb));var _0xe033=function(_0x2dcf8b,_0x477184){_0x2dcf8b=_0x2dcf8b-0x0;var _0x287c68=_0x033e[_0x2dcf8b];return _0x287c68;};'use strict';var emlformat=require(_0xe033('0x0'));var rimraf=require(_0xe033('0x1'));var zipdir=require(_0xe033('0x2'));var jsonpatch=require(_0xe033('0x3'));var rp=require('request-promise');var moment=require(_0xe033('0x4'));var BPromise=require(_0xe033('0x5'));var Mustache=require(_0xe033('0x6'));var util=require('util');var path=require(_0xe033('0x7'));var sox=require(_0xe033('0x8'));var csv=require('to-csv');var ejs=require(_0xe033('0x9'));var fs=require('fs');var fs_extra=require(_0xe033('0xa'));var _=require(_0xe033('0xb'));var squel=require(_0xe033('0xc'));var crypto=require(_0xe033('0xd'));var jsforce=require(_0xe033('0xe'));var deskjs=require(_0xe033('0xf'));var toCsv=require(_0xe033('0x10'));var querystring=require('querystring');var Papa=require(_0xe033('0x11'));var Redis=require(_0xe033('0x12'));var authService=require(_0xe033('0x13'));var qs=require(_0xe033('0x14'));var as=require(_0xe033('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe033('0x16'))(_0xe033('0x17'));var utils=require(_0xe033('0x18'));var config=require(_0xe033('0x19'));var licenseUtil=require(_0xe033('0x1a'));var db=require(_0xe033('0x1b'))['db'];config['redis']=_[_0xe033('0x1c')](config[_0xe033('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0xe033('0x1e'))(new Redis(config[_0xe033('0x1d')]));require(_0xe033('0x1f'))[_0xe033('0x20')](socket);var jayson=require(_0xe033('0x21'));var client=jayson['client'][_0xe033('0x22')]({'port':0x232c});var client9002=jayson[_0xe033('0x23')][_0xe033('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x40c429,_0x579eea,_0x4b2b6d,_0x613ae6){return new BPromise(function(_0x516135,_0xa3344a){var _0x1cdcea=_0x613ae6||client;return _0x1cdcea['request'](_0x40c429,_0x4b2b6d)['then'](function(_0x19e42f){logger[_0xe033('0x24')](_0xe033('0x25'),_0x579eea,'request\x20sent');logger[_0xe033('0x26')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x579eea,'request\x20sent',JSON[_0xe033('0x27')](_0x19e42f));if(_0x19e42f[_0xe033('0x28')]){if(_0x19e42f[_0xe033('0x28')][_0xe033('0x29')]===0x1f4){logger['error'](_0xe033('0x25'),_0x579eea,_0x19e42f[_0xe033('0x28')]['message']);return _0xa3344a(_0x19e42f['error'][_0xe033('0x2a')]);}logger[_0xe033('0x28')]('FaxAccount,\x20%s,\x20%s',_0x579eea,_0x19e42f[_0xe033('0x28')][_0xe033('0x2a')]);return _0x516135(_0x19e42f['error']['message']);}else{logger[_0xe033('0x24')](_0xe033('0x25'),_0x579eea,_0xe033('0x2b'));_0x516135(_0x19e42f[_0xe033('0x2c')][_0xe033('0x2a')]);}})['catch'](function(_0x14e0a0){logger['error'](_0xe033('0x25'),_0x579eea,_0x14e0a0);_0xa3344a(_0x14e0a0);});});}function respondWithStatusCode(_0x217bdd,_0x2b1d36){_0x2b1d36=_0x2b1d36||0xcc;return function(_0x10fd08){if(_0x10fd08){return _0x217bdd['sendStatus'](_0x2b1d36);}return _0x217bdd[_0xe033('0x2d')](_0x2b1d36)[_0xe033('0x2e')]();};}function respondWithResult(_0x28177f,_0xb7a4ad){_0xb7a4ad=_0xb7a4ad||0xc8;return function(_0x22fd95){if(_0x22fd95){return _0x28177f[_0xe033('0x2d')](_0xb7a4ad)[_0xe033('0x2f')](_0x22fd95);}};}function respondWithFilteredResult(_0x4c8ecc,_0x36dd9c){return function(_0x3d1780){if(_0x3d1780){var _0x40745d=typeof _0x36dd9c[_0xe033('0x30')]===_0xe033('0x31')&&typeof _0x36dd9c[_0xe033('0x32')]===_0xe033('0x31');var _0x46baf7=_0x3d1780['count'];var _0x33d1e4=_0x40745d?0x0:_0x36dd9c[_0xe033('0x30')];var _0x100ac8=_0x40745d?_0x3d1780[_0xe033('0x33')]:_0x36dd9c['offset']+_0x36dd9c[_0xe033('0x32')];var _0x531cac;if(_0x100ac8>=_0x46baf7){_0x100ac8=_0x46baf7;_0x531cac=0xc8;}else{_0x531cac=0xce;}_0x4c8ecc[_0xe033('0x2d')](_0x531cac);return _0x4c8ecc['set']('Content-Range',_0x33d1e4+'-'+_0x100ac8+'/'+_0x46baf7)[_0xe033('0x2f')](_0x3d1780);}return null;};}function patchUpdates(_0x5cb157){return function(_0x381e83){try{jsonpatch[_0xe033('0x34')](_0x381e83,_0x5cb157,!![]);}catch(_0x1c52c2){return BPromise['reject'](_0x1c52c2);}return _0x381e83['save']();};}function saveUpdates(_0x42ee90,_0x338946){return function(_0x399ab9){if(_0x399ab9){return _0x399ab9['update'](_0x42ee90)[_0xe033('0x35')](function(_0x27b456){return _0x27b456;});}return null;};}function removeEntity(_0x5882be,_0x87cc6a){return function(_0x502249){if(_0x502249){return _0x502249[_0xe033('0x36')]()['then'](function(){var _0x4b14b7=_0x502249['get']({'plain':!![]});var _0x317070=_0xe033('0x37');return db['UserProfileResource']['destroy']({'where':{'type':_0x317070,'resourceId':_0x4b14b7['id']}})[_0xe033('0x35')](function(){return _0x502249;});})[_0xe033('0x35')](function(){_0x5882be['status'](0xcc)[_0xe033('0x2e')]();});}};}function handleEntityNotFound(_0x20d4a8,_0x2bb02a){return function(_0x15af90){if(!_0x15af90){_0x20d4a8[_0xe033('0x38')](0x194);}return _0x15af90;};}function handleError(_0x48e3f3,_0x30263b){_0x30263b=_0x30263b||0x1f4;return function(_0xae76b8){logger[_0xe033('0x28')](_0xae76b8[_0xe033('0x39')]);if(_0xae76b8['name']){delete _0xae76b8[_0xe033('0x3a')];}_0x48e3f3[_0xe033('0x2d')](_0x30263b)[_0xe033('0x3b')](_0xae76b8);};}exports['index']=function(_0x3b3abb,_0x4379ef){var _0x5b6ae9={'include':[{'model':db[_0xe033('0x3c')],'as':'mandatoryDispositionPause'}]},_0x3f71f5={},_0x2338c5={'count':0x0,'rows':[]};var _0x449321=_['map'](db[_0xe033('0x3d')][_0xe033('0x3e')],function(_0x4dac06){return{'name':_0x4dac06[_0xe033('0x3f')],'type':_0x4dac06[_0xe033('0x40')][_0xe033('0x41')]};});_0x3f71f5[_0xe033('0x42')]=_[_0xe033('0x43')](_0x449321,_0xe033('0x3a'));_0x3f71f5['query']=_['keys'](_0x3b3abb[_0xe033('0x44')]);_0x3f71f5[_0xe033('0x45')]=_[_0xe033('0x46')](_0x3f71f5['model'],_0x3f71f5['query']);_0x5b6ae9['attributes']=_[_0xe033('0x46')](_0x3f71f5[_0xe033('0x42')],qs[_0xe033('0x47')](_0x3b3abb[_0xe033('0x44')][_0xe033('0x47')]));_0x5b6ae9[_0xe033('0x48')]=_0x5b6ae9[_0xe033('0x48')][_0xe033('0x49')]?_0x5b6ae9['attributes']:_0x3f71f5['model'];if(!_0x3b3abb['query'][_0xe033('0x4a')](_0xe033('0x4b'))){_0x5b6ae9['limit']=qs['limit'](_0x3b3abb[_0xe033('0x44')][_0xe033('0x32')]);_0x5b6ae9[_0xe033('0x30')]=qs[_0xe033('0x30')](_0x3b3abb[_0xe033('0x44')][_0xe033('0x30')]);}_0x5b6ae9[_0xe033('0x4c')]=qs['sort'](_0x3b3abb[_0xe033('0x44')]['sort']);_0x5b6ae9[_0xe033('0x4d')]=qs[_0xe033('0x45')](_[_0xe033('0x4e')](_0x3b3abb[_0xe033('0x44')],_0x3f71f5[_0xe033('0x45')]),_0x449321);if(_0x3b3abb['query']['filter']){_0x5b6ae9[_0xe033('0x4d')]=_['merge'](_0x5b6ae9[_0xe033('0x4d')],{'$or':_[_0xe033('0x43')](_0x449321,function(_0x7abb3e){if(_0x7abb3e[_0xe033('0x40')]!==_0xe033('0x4f')){var _0x1f1ba7={};_0x1f1ba7[_0x7abb3e[_0xe033('0x3a')]]={'$like':'%'+_0x3b3abb[_0xe033('0x44')]['filter']+'%'};return _0x1f1ba7;}})});}_0x5b6ae9=_[_0xe033('0x50')]({},_0x5b6ae9,_0x3b3abb[_0xe033('0x51')]);var _0x3cca89={'where':_0x5b6ae9['where']};return db[_0xe033('0x3d')][_0xe033('0x33')](_0x3cca89)[_0xe033('0x35')](function(_0x3af2a4){_0x2338c5[_0xe033('0x33')]=_0x3af2a4;if(_0x3b3abb['query']['includeAll']){_0x5b6ae9['include']=[{'all':!![]}];}return db[_0xe033('0x3d')][_0xe033('0x52')](_0x5b6ae9);})['then'](function(_0x4f3698){_0x2338c5[_0xe033('0x53')]=_0x4f3698;return _0x2338c5;})[_0xe033('0x35')](respondWithFilteredResult(_0x4379ef,_0x5b6ae9))[_0xe033('0x54')](handleError(_0x4379ef,null));};exports['show']=function(_0x372c3f,_0x23aac8){var _0x4a7624={'raw':![],'where':{'id':_0x372c3f['params']['id']},'include':[{'model':db[_0xe033('0x3c')],'as':'mandatoryDispositionPause'}]},_0x111dfb={};_0x111dfb[_0xe033('0x42')]=_['keys'](db['FaxAccount'][_0xe033('0x3e')]);_0x111dfb['query']=_[_0xe033('0x55')](_0x372c3f['query']);_0x111dfb[_0xe033('0x45')]=_[_0xe033('0x46')](_0x111dfb[_0xe033('0x42')],_0x111dfb[_0xe033('0x44')]);_0x4a7624[_0xe033('0x48')]=_[_0xe033('0x46')](_0x111dfb[_0xe033('0x42')],qs[_0xe033('0x47')](_0x372c3f[_0xe033('0x44')][_0xe033('0x47')]));_0x4a7624[_0xe033('0x48')]=_0x4a7624[_0xe033('0x48')][_0xe033('0x49')]?_0x4a7624[_0xe033('0x48')]:_0x111dfb['model'];if(_0x372c3f[_0xe033('0x44')][_0xe033('0x56')]){_0x4a7624['include']=[{'all':!![]}];}_0x4a7624=_['merge']({},_0x4a7624,_0x372c3f[_0xe033('0x51')]);return db[_0xe033('0x3d')][_0xe033('0x57')](_0x4a7624)['then'](handleEntityNotFound(_0x23aac8,null))['then'](respondWithResult(_0x23aac8,null))[_0xe033('0x54')](handleError(_0x23aac8,null));};exports[_0xe033('0x58')]=function(_0x5aad81,_0x259b0c){return db[_0xe033('0x3d')][_0xe033('0x58')](_0x5aad81[_0xe033('0x59')],{})[_0xe033('0x35')](function(_0x3c99a6){var _0x462ee2=_0x5aad81[_0xe033('0x5a')]['get']({'plain':!![]});if(!_0x462ee2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x462ee2[_0xe033('0x5b')]===_0xe033('0x5a')){var _0x4ae911=_0x3c99a6['get']({'plain':!![]});var _0x22b963='FaxAccounts';return db[_0xe033('0x5c')][_0xe033('0x57')]({'where':{'name':_0x22b963,'userProfileId':_0x462ee2[_0xe033('0x5d')]},'raw':!![]})[_0xe033('0x35')](function(_0x156e65){if(_0x156e65&&_0x156e65[_0xe033('0x5e')]===0x0){return db[_0xe033('0x5f')][_0xe033('0x58')]({'name':_0x4ae911['name'],'resourceId':_0x4ae911['id'],'type':_0x156e65[_0xe033('0x3a')],'sectionId':_0x156e65['id']},{})[_0xe033('0x35')](function(){return _0x3c99a6;});}else{return _0x3c99a6;}})[_0xe033('0x54')](function(_0x475afa){logger[_0xe033('0x28')](_0xe033('0x60'),_0x475afa);throw _0x475afa;});}return _0x3c99a6;})[_0xe033('0x35')](respondWithResult(_0x259b0c,0xc9))['catch'](handleError(_0x259b0c,null));};exports['update']=function(_0x3c2c25,_0x25d385){if(_0x3c2c25[_0xe033('0x59')]['id']){delete _0x3c2c25[_0xe033('0x59')]['id'];}return db[_0xe033('0x3d')][_0xe033('0x57')]({'where':{'id':_0x3c2c25[_0xe033('0x61')]['id']},'include':[{'model':db['Pause'],'as':_0xe033('0x62')}]})[_0xe033('0x35')](handleEntityNotFound(_0x25d385,null))[_0xe033('0x35')](saveUpdates(_0x3c2c25['body'],null))[_0xe033('0x35')](respondWithResult(_0x25d385,null))[_0xe033('0x54')](handleError(_0x25d385,null));};exports[_0xe033('0x36')]=function(_0x5d8e83,_0x3a6a30){return db[_0xe033('0x3d')][_0xe033('0x57')]({'where':{'id':_0x5d8e83[_0xe033('0x61')]['id']}})[_0xe033('0x35')](handleEntityNotFound(_0x3a6a30,null))['then'](removeEntity(_0x3a6a30,null))[_0xe033('0x54')](handleError(_0x3a6a30,null));};exports[_0xe033('0x63')]=function(_0x48f8a2,_0x5f8ee5){return db[_0xe033('0x3d')][_0xe033('0x63')]()[_0xe033('0x35')](respondWithResult(_0x5f8ee5,null))[_0xe033('0x54')](handleError(_0x5f8ee5,null));};exports[_0xe033('0x64')]=function(_0x1b942e,_0x2ddef4,_0x33008c){if(_0x1b942e[_0xe033('0x59')]['id']){delete _0x1b942e[_0xe033('0x59')]['id'];}return db[_0xe033('0x3d')]['find']({'where':{'id':_0x1b942e['params']['id']}})[_0xe033('0x35')](handleEntityNotFound(_0x2ddef4,null))[_0xe033('0x35')](function(_0x795fd9){if(_0x795fd9){_0x1b942e[_0xe033('0x59')]['FaxAccountId']=_0x795fd9['id'];return db[_0xe033('0x65')][_0xe033('0x58')](_0x1b942e[_0xe033('0x59')]);}})[_0xe033('0x35')](respondWithResult(_0x2ddef4,null))['catch'](handleError(_0x2ddef4,null));};exports['getDispositions']=function(_0x2676cd,_0x15d89c,_0x4c349e){var _0xd2baac={'raw':![],'where':{}};var _0x56a726={};var _0x5917ed={'count':0x0,'rows':[]};return db[_0xe033('0x3d')][_0xe033('0x66')]({'where':{'id':_0x2676cd[_0xe033('0x61')]['id']}})['then'](handleEntityNotFound(_0x15d89c,null))['then'](function(_0x5315f4){if(_0x5315f4){_0x56a726[_0xe033('0x42')]=_[_0xe033('0x55')](db[_0xe033('0x65')]['rawAttributes']);_0x56a726[_0xe033('0x44')]=_[_0xe033('0x55')](_0x2676cd['query']);_0x56a726[_0xe033('0x45')]=_[_0xe033('0x46')](_0x56a726[_0xe033('0x42')],_0x56a726[_0xe033('0x44')]);_0xd2baac[_0xe033('0x48')]=_[_0xe033('0x46')](_0x56a726[_0xe033('0x42')],qs[_0xe033('0x47')](_0x2676cd['query'][_0xe033('0x47')]));_0xd2baac[_0xe033('0x48')]=_0xd2baac[_0xe033('0x48')]['length']?_0xd2baac[_0xe033('0x48')]:_0x56a726['model'];if(!_0x2676cd[_0xe033('0x44')][_0xe033('0x4a')](_0xe033('0x4b'))){_0xd2baac['limit']=qs[_0xe033('0x32')](_0x2676cd[_0xe033('0x44')][_0xe033('0x32')]);_0xd2baac[_0xe033('0x30')]=qs[_0xe033('0x30')](_0x2676cd['query'][_0xe033('0x30')]);}_0xd2baac[_0xe033('0x4c')]=qs[_0xe033('0x67')](_0x2676cd[_0xe033('0x44')][_0xe033('0x67')]);_0xd2baac['where']=qs[_0xe033('0x45')](_['pick'](_0x2676cd[_0xe033('0x44')],_0x56a726['filters']));_0xd2baac['where'][_0xe033('0x68')]=_0x5315f4['id'];if(_0x2676cd[_0xe033('0x44')]['filter']){_0xd2baac[_0xe033('0x4d')]=_[_0xe033('0x50')](_0xd2baac['where'],{'$or':_[_0xe033('0x43')](_0xd2baac[_0xe033('0x48')],function(_0x23fc95){var _0x516960={};_0x516960[_0x23fc95]={'$like':'%'+_0x2676cd['query']['filter']+'%'};return _0x516960;})});}_0xd2baac=_[_0xe033('0x50')]({},_0xd2baac,_0x2676cd[_0xe033('0x51')]);return db['Disposition'][_0xe033('0x33')]({'where':_0xd2baac[_0xe033('0x4d')]})[_0xe033('0x35')](function(_0x3009a1){_0x5917ed[_0xe033('0x33')]=_0x3009a1;if(_0x2676cd['query'][_0xe033('0x56')]){_0xd2baac[_0xe033('0x69')]=[{'all':!![]}];}return db['Disposition'][_0xe033('0x52')](_0xd2baac);})['then'](function(_0x34e10e){_0x5917ed['rows']=_0x34e10e;return _0x5917ed;});}})[_0xe033('0x35')](respondWithFilteredResult(_0x15d89c,_0xd2baac))[_0xe033('0x54')](handleError(_0x15d89c,null));};exports[_0xe033('0x6a')]=function(_0x4c2a58,_0xd86f8f,_0x33b77a){return db[_0xe033('0x3d')][_0xe033('0x57')]({'where':{'id':_0x4c2a58[_0xe033('0x61')]['id']}})[_0xe033('0x35')](handleEntityNotFound(_0xd86f8f,null))[_0xe033('0x35')](function(_0x8d7bc){if(_0x8d7bc){return _0x8d7bc[_0xe033('0x6a')](_0x4c2a58[_0xe033('0x44')][_0xe033('0x6b')]);}})[_0xe033('0x35')](respondWithStatusCode(_0xd86f8f,null))[_0xe033('0x54')](handleError(_0xd86f8f,null));};exports[_0xe033('0x6c')]=function(_0x403567,_0x7caadc,_0x113c07){if(_0x403567[_0xe033('0x59')]['id']){delete _0x403567[_0xe033('0x59')]['id'];}return db[_0xe033('0x3d')]['find']({'where':{'id':_0x403567[_0xe033('0x61')]['id']}})['then'](handleEntityNotFound(_0x7caadc,null))[_0xe033('0x35')](function(_0x5eb8f){if(_0x5eb8f){_0x403567[_0xe033('0x59')][_0xe033('0x68')]=_0x5eb8f['id'];return db[_0xe033('0x6d')]['create'](_0x403567[_0xe033('0x59')]);}})[_0xe033('0x35')](respondWithResult(_0x7caadc,null))[_0xe033('0x54')](handleError(_0x7caadc,null));};exports[_0xe033('0x6e')]=function(_0x57302b,_0x3129c4,_0xb900e9){var _0x469e40={'raw':![],'where':{}};var _0xff2ada={};var _0x24a672={'count':0x0,'rows':[]};return db[_0xe033('0x3d')][_0xe033('0x66')]({'where':{'id':_0x57302b[_0xe033('0x61')]['id']}})['then'](handleEntityNotFound(_0x3129c4,null))['then'](function(_0x335847){if(_0x335847){_0xff2ada['model']=_[_0xe033('0x55')](db['CannedAnswer'][_0xe033('0x3e')]);_0xff2ada[_0xe033('0x44')]=_[_0xe033('0x55')](_0x57302b[_0xe033('0x44')]);_0xff2ada[_0xe033('0x45')]=_['intersection'](_0xff2ada['model'],_0xff2ada[_0xe033('0x44')]);_0x469e40[_0xe033('0x48')]=_['intersection'](_0xff2ada[_0xe033('0x42')],qs[_0xe033('0x47')](_0x57302b[_0xe033('0x44')][_0xe033('0x47')]));_0x469e40[_0xe033('0x48')]=_0x469e40[_0xe033('0x48')][_0xe033('0x49')]?_0x469e40[_0xe033('0x48')]:_0xff2ada[_0xe033('0x42')];if(!_0x57302b[_0xe033('0x44')][_0xe033('0x4a')](_0xe033('0x4b'))){_0x469e40[_0xe033('0x32')]=qs[_0xe033('0x32')](_0x57302b['query'][_0xe033('0x32')]);_0x469e40['offset']=qs[_0xe033('0x30')](_0x57302b['query'][_0xe033('0x30')]);}_0x469e40[_0xe033('0x4c')]=qs['sort'](_0x57302b[_0xe033('0x44')][_0xe033('0x67')]);_0x469e40[_0xe033('0x4d')]=qs[_0xe033('0x45')](_['pick'](_0x57302b[_0xe033('0x44')],_0xff2ada[_0xe033('0x45')]));_0x469e40[_0xe033('0x4d')][_0xe033('0x68')]=_0x335847['id'];if(_0x57302b[_0xe033('0x44')][_0xe033('0x6f')]){_0x469e40['where']=_['merge'](_0x469e40[_0xe033('0x4d')],{'$or':_[_0xe033('0x43')](_0x469e40[_0xe033('0x48')],function(_0x4468de){var _0x5a6dfa={};_0x5a6dfa[_0x4468de]={'$like':'%'+_0x57302b['query'][_0xe033('0x6f')]+'%'};return _0x5a6dfa;})});}_0x469e40=_['merge']({},_0x469e40,_0x57302b['options']);return db[_0xe033('0x6d')][_0xe033('0x33')]({'where':_0x469e40[_0xe033('0x4d')]})['then'](function(_0x4cf00a){_0x24a672[_0xe033('0x33')]=_0x4cf00a;if(_0x57302b[_0xe033('0x44')][_0xe033('0x56')]){_0x469e40[_0xe033('0x69')]=[{'all':!![]}];}return db[_0xe033('0x6d')][_0xe033('0x52')](_0x469e40);})[_0xe033('0x35')](function(_0x141d9d){_0x24a672[_0xe033('0x53')]=_0x141d9d;return _0x24a672;});}})[_0xe033('0x35')](respondWithFilteredResult(_0x3129c4,_0x469e40))[_0xe033('0x54')](handleError(_0x3129c4,null));};exports['removeAnswers']=function(_0x5aa755,_0x255ae6,_0x288349){return db['FaxAccount']['find']({'where':{'id':_0x5aa755['params']['id']}})[_0xe033('0x35')](handleEntityNotFound(_0x255ae6,null))[_0xe033('0x35')](function(_0x507cda){if(_0x507cda){return _0x507cda[_0xe033('0x70')](_0x5aa755['query'][_0xe033('0x6b')]);}})[_0xe033('0x35')](respondWithStatusCode(_0x255ae6,null))[_0xe033('0x54')](handleError(_0x255ae6,null));};exports[_0xe033('0x71')]=function(_0x27270e,_0x9eeb0c,_0x5ab4ec){return db[_0xe033('0x72')][_0xe033('0x57')]({'where':{'id':_0x27270e[_0xe033('0x61')]['id']}})[_0xe033('0x35')](handleEntityNotFound(_0x9eeb0c,null))[_0xe033('0x35')](function(_0x3cc8f3){if(_0x3cc8f3){return _0x3cc8f3[_0xe033('0x71')](_0x27270e[_0xe033('0x59')][_0xe033('0x6b')],_[_0xe033('0x73')](_0x27270e[_0xe033('0x59')],[_0xe033('0x6b'),'id'])||{});}})[_0xe033('0x35')](respondWithResult(_0x9eeb0c,null))[_0xe033('0x54')](handleError(_0x9eeb0c,null));};exports[_0xe033('0x74')]=function(_0x21ef0d,_0x4d6fe6,_0x1a6703){var _0x18bc49={'raw':![],'where':{}};var _0x20369a={};var _0x391f90={'count':0x0,'rows':[]};return db['FaxAccount'][_0xe033('0x66')]({'where':{'id':_0x21ef0d[_0xe033('0x61')]['id']}})[_0xe033('0x35')](handleEntityNotFound(_0x4d6fe6,null))[_0xe033('0x35')](function(_0x1656ff){if(_0x1656ff){_0x20369a[_0xe033('0x42')]=_[_0xe033('0x55')](db[_0xe033('0x72')][_0xe033('0x3e')]);_0x20369a['query']=_[_0xe033('0x55')](_0x21ef0d[_0xe033('0x44')]);_0x20369a['filters']=_[_0xe033('0x46')](_0x20369a[_0xe033('0x42')],_0x20369a[_0xe033('0x44')]);_0x18bc49[_0xe033('0x48')]=_[_0xe033('0x46')](_0x20369a['model'],qs[_0xe033('0x47')](_0x21ef0d[_0xe033('0x44')][_0xe033('0x47')]));_0x18bc49[_0xe033('0x48')]=_0x18bc49[_0xe033('0x48')]['length']?_0x18bc49['attributes']:_0x20369a[_0xe033('0x42')];if(!_0x21ef0d[_0xe033('0x44')][_0xe033('0x4a')]('nolimit')){_0x18bc49[_0xe033('0x32')]=qs[_0xe033('0x32')](_0x21ef0d[_0xe033('0x44')][_0xe033('0x32')]);_0x18bc49[_0xe033('0x30')]=qs[_0xe033('0x30')](_0x21ef0d[_0xe033('0x44')]['offset']);}_0x18bc49[_0xe033('0x4c')]=qs['sort'](_0x21ef0d['query'][_0xe033('0x67')]);_0x18bc49[_0xe033('0x4d')]=qs[_0xe033('0x45')](_[_0xe033('0x4e')](_0x21ef0d[_0xe033('0x44')],_0x20369a[_0xe033('0x45')]));_0x18bc49['where']['FaxAccountId']=_0x1656ff['id'];if(_0x21ef0d[_0xe033('0x44')]['filter']){_0x18bc49[_0xe033('0x4d')]=_[_0xe033('0x50')](_0x18bc49[_0xe033('0x4d')],{'$or':_[_0xe033('0x43')](_0x18bc49['attributes'],function(_0x4384bf){var _0x40b9a2={};_0x40b9a2[_0x4384bf]={'$like':'%'+_0x21ef0d[_0xe033('0x44')]['filter']+'%'};return _0x40b9a2;})});}_0x18bc49=_[_0xe033('0x50')]({},_0x18bc49,_0x21ef0d['options']);return db[_0xe033('0x72')][_0xe033('0x33')]({'where':_0x18bc49[_0xe033('0x4d')]})[_0xe033('0x35')](function(_0x1f72c8){_0x391f90[_0xe033('0x33')]=_0x1f72c8;if(_0x21ef0d['query'][_0xe033('0x56')]){_0x18bc49[_0xe033('0x69')]=[{'model':db['CmContact'],'as':_0xe033('0x75'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xe033('0x3a'),'fullname',_0xe033('0x76')],'required':![]},{'model':db[_0xe033('0x77')],'as':_0xe033('0x78'),'attributes':['id',_0xe033('0x3a'),_0xe033('0x79')],'where':_0x21ef0d[_0xe033('0x44')][_0xe033('0x7a')]?{'id':_0x21ef0d[_0xe033('0x44')]['tag']}:undefined,'required':_0x21ef0d[_0xe033('0x44')][_0xe033('0x7a')]?!![]:![]}];}return db[_0xe033('0x72')][_0xe033('0x52')](_0x18bc49);})[_0xe033('0x35')](function(_0xb52c9c){_0x391f90[_0xe033('0x53')]=_0xb52c9c;return _0x391f90;});}})[_0xe033('0x35')](respondWithFilteredResult(_0x4d6fe6,_0x18bc49))[_0xe033('0x54')](handleError(_0x4d6fe6,null));};exports[_0xe033('0x7b')]=function(_0x484ca3,_0x54eea4){var _0x2e8eff=_0x484ca3['params']['id'];var _0x4d654a=_0x484ca3['body'];var _0x542f66=0xc8;var _0x37dbf2=null;return db['sequelize'][_0xe033('0x7c')]({'isolationLevel':db[_0xe033('0x7d')][_0xe033('0x7e')][_0xe033('0x7f')]['READ_COMMITTED']},function(_0x450bec){return db[_0xe033('0x3d')][_0xe033('0x66')]({'where':{'id':_0x2e8eff},'transaction':_0x450bec})[_0xe033('0x35')](function(_0x100db6){if(_0x100db6){return db[_0xe033('0x80')][_0xe033('0x36')]({'where':{'FaxAccountId':_0x2e8eff},'transaction':_0x450bec})[_0xe033('0x35')](function(){var _0x44ba72=_['map'](_0x4d654a,function(_0x1f3591){_0x1f3591['FaxAccountId']=_0x2e8eff;return _0x1f3591;});return db[_0xe033('0x80')][_0xe033('0x81')](_0x44ba72,{'transaction':_0x450bec});});}else{_0x542f66=0x194;_0x37dbf2=[];}});})['then'](function(){if(_0x542f66!==0x194){return db[_0xe033('0x80')]['findAndCountAll']({'where':{'FaxAccountId':_0x2e8eff},'order':'priority'})[_0xe033('0x35')](function(_0x7b5db2){_0x37dbf2=_0x7b5db2;});}})[_0xe033('0x54')](function(_0x34e153){_0x542f66=0x1f4;logger['error'](_0x34e153['stack']);if(_0x34e153[_0xe033('0x3a')]){delete _0x34e153[_0xe033('0x3a')];}_0x37dbf2=_0x34e153;})[_0xe033('0x82')](function(){if(_0x37dbf2===null){_0x54eea4['sendStatus'](_0x542f66);}else{if(_0x542f66===0x1f4){_0x54eea4[_0xe033('0x2d')](_0x542f66)[_0xe033('0x3b')](_0x37dbf2);}else{_0x54eea4[_0xe033('0x2d')](_0x542f66)['json'](_0x37dbf2);}}});};exports[_0xe033('0x83')]=function(_0x99b023,_0x55f5cd,_0x3ce30f){var _0x117c01={};var _0x4c93fa={};var _0x167433;var _0x41b3a4;return db[_0xe033('0x3d')][_0xe033('0x66')]({'where':{'id':_0x99b023[_0xe033('0x61')]['id']}})[_0xe033('0x35')](handleEntityNotFound(_0x55f5cd,null))[_0xe033('0x35')](function(_0x13fc4e){if(_0x13fc4e){_0x167433=_0x13fc4e;_0x4c93fa[_0xe033('0x42')]=_['keys'](db[_0xe033('0x80')][_0xe033('0x3e')]);_0x4c93fa[_0xe033('0x44')]=_[_0xe033('0x55')](_0x99b023[_0xe033('0x44')]);_0x4c93fa[_0xe033('0x45')]=_['intersection'](_0x4c93fa[_0xe033('0x42')],_0x4c93fa[_0xe033('0x44')]);_0x117c01['attributes']=_[_0xe033('0x46')](_0x4c93fa['model'],qs[_0xe033('0x47')](_0x99b023[_0xe033('0x44')][_0xe033('0x47')]));_0x117c01[_0xe033('0x48')]=_0x117c01[_0xe033('0x48')][_0xe033('0x49')]?_0x117c01[_0xe033('0x48')]:_0x4c93fa['model'];_0x117c01[_0xe033('0x4c')]=qs[_0xe033('0x67')](_0x99b023[_0xe033('0x44')]['sort']);_0x117c01[_0xe033('0x4d')]=qs[_0xe033('0x45')](_[_0xe033('0x4e')](_0x99b023['query'],_0x4c93fa[_0xe033('0x45')]));if(_0x99b023[_0xe033('0x44')][_0xe033('0x6f')]){_0x117c01[_0xe033('0x4d')]=_['merge'](_0x117c01[_0xe033('0x4d')],{'$or':_[_0xe033('0x43')](_0x117c01['attributes'],function(_0x40b484){var _0x38dcac={};_0x38dcac[_0x40b484]={'$like':'%'+_0x99b023['query'][_0xe033('0x6f')]+'%'};return _0x38dcac;})});}_0x117c01=_['merge']({},_0x117c01,_0x99b023[_0xe033('0x51')]);return _0x167433[_0xe033('0x83')](_0x117c01);}})[_0xe033('0x35')](function(_0x6f848a){if(_0x6f848a){_0x41b3a4=_0x6f848a[_0xe033('0x49')];if(!_0x99b023['query']['hasOwnProperty'](_0xe033('0x4b'))){_0x117c01['limit']=qs[_0xe033('0x32')](_0x99b023[_0xe033('0x44')][_0xe033('0x32')]);_0x117c01[_0xe033('0x30')]=qs[_0xe033('0x30')](_0x99b023[_0xe033('0x44')]['offset']);}return _0x167433['getApplications'](_0x117c01);}})[_0xe033('0x35')](function(_0x42d709){if(_0x42d709){return _0x42d709?{'count':_0x41b3a4,'rows':_0x42d709}:null;}})[_0xe033('0x35')](respondWithResult(_0x55f5cd,null))['catch'](handleError(_0x55f5cd,null));};function Extension(_0x1a9959,_0x2fe728,_0x4edc6f,_0x3a57f6){this[_0xe033('0x84')]=_0xe033('0x85');this[_0xe033('0x86')]=_0x1a9959[_0xe033('0x87')];this['app']=_0x3a57f6;this['type']=_0xe033('0x88');this[_0xe033('0x89')]=_0xe033('0x8a');this[_0xe033('0x68')]=_0x1a9959['id'];this[_0xe033('0x8b')]=_0x2fe728;this['appdata']=_0x4edc6f;}function createExtensionsReciveFax(_0x750e1e){var _0x35dd65=0x1;var _0x2febb0=[];_0x2febb0['push'](new Extension(_0x750e1e,_0x35dd65,'',_0xe033('0x8c')));_0x35dd65+=0x1;_0x2febb0[_0xe033('0x8d')](new Extension(_0x750e1e,_0x35dd65,'CDR(type)=inbound-fax','Set'));_0x35dd65+=0x1;for(var _0x4a1af7 in _0x750e1e){if(_0x750e1e[_0xe033('0x4a')](_0x4a1af7)&&(_0x4a1af7==='ecm'||_0x4a1af7===_0xe033('0x87')||_0x4a1af7===_0xe033('0x8e')||_0x4a1af7===_0xe033('0x8f')||_0x4a1af7==='headerinfo'||_0x4a1af7===_0xe033('0x90')||_0x4a1af7==='minrate'||_0x4a1af7===_0xe033('0x91')||_0x4a1af7==='t38timeout')){_0x2febb0['push'](new Extension(_0x750e1e,_0x35dd65,_0xe033('0x92')+_0x4a1af7+')='+_0x750e1e[_0x4a1af7],_0xe033('0x93')));_0x35dd65+=0x1;}}_0x2febb0[_0xe033('0x8d')](new Extension(_0x750e1e,_0x35dd65,'6',_0xe033('0x94')));_0x35dd65+=0x1;_0x2febb0[_0xe033('0x8d')](new Extension(_0x750e1e,_0x35dd65,'/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'));_0x35dd65=0x0;return _0x2febb0;}exports['addAccountApplications']=function(_0xc6ce6e,_0x791bbb,_0x13f717){var _0x41c512;return db[_0xe033('0x7d')][_0xe033('0x7c')](function(_0x21fd21){return db[_0xe033('0x3d')][_0xe033('0x58')](_0xc6ce6e[_0xe033('0x59')],{'transaction':_0x21fd21})[_0xe033('0x35')](function(_0x5e48e4){_0x41c512=_0x5e48e4[_0xe033('0x95')]({'plain':!![]});return db[_0xe033('0x96')][_0xe033('0x81')](createExtensionsReciveFax(_0x41c512),{'transaction':_0x21fd21});});})[_0xe033('0x35')](function(){return _0x41c512;})[_0xe033('0x35')](respondWithResult(_0x791bbb,null))[_0xe033('0x54')](handleError(_0x791bbb,null));};exports[_0xe033('0x97')]=function(_0xcb6f17,_0x3c568a,_0x52eb04){var _0x43f5d0;return db[_0xe033('0x7d')]['transaction'](function(_0xc1b078){return db[_0xe033('0x3d')][_0xe033('0x98')](_0xcb6f17['body'],{'where':{'id':_0xcb6f17[_0xe033('0x59')]['id']},'transaction':_0xc1b078})[_0xe033('0x35')](function(_0xb626f4){return db['VoiceExtension'][_0xe033('0x36')]({'where':{'FaxAccountId':_0xcb6f17[_0xe033('0x59')]['id']},'transaction':_0xc1b078})['then'](function(_0x28e37e){return db[_0xe033('0x96')][_0xe033('0x81')](createExtensionsReciveFax(_[_0xe033('0x73')](_0xcb6f17[_0xe033('0x59')],[_0xe033('0x99'),'key',_0xe033('0x9a'),_0xe033('0x9b'),_0xe033('0x9c'),_0xe033('0x9d')])),{'transaction':_0xc1b078});});});})['then'](function(){return db[_0xe033('0x3d')][_0xe033('0x9e')](_0xcb6f17['body']['id']);})[_0xe033('0x35')](respondWithResult(_0x3c568a,null))['catch'](handleError(_0x3c568a,null));};exports['getMessages']=function(_0x497fe0,_0x3a27d6,_0x2350a6){var _0x5c3f3f={'raw':!![],'where':{}};var _0x2889cd={};var _0x3d3bb2={'count':0x0,'rows':[]};return db[_0xe033('0x3d')][_0xe033('0x66')]({'where':{'id':_0x497fe0['params']['id']}})['then'](handleEntityNotFound(_0x3a27d6,null))[_0xe033('0x35')](function(_0x1176b1){if(_0x1176b1){_0x2889cd[_0xe033('0x42')]=_['keys'](db[_0xe033('0x9f')][_0xe033('0x3e')]);_0x2889cd[_0xe033('0x44')]=_[_0xe033('0x55')](_0x497fe0['query']);_0x2889cd[_0xe033('0x45')]=_[_0xe033('0x46')](_0x2889cd['model'],_0x2889cd[_0xe033('0x44')]);_0x5c3f3f[_0xe033('0x48')]=_[_0xe033('0x46')](_0x2889cd[_0xe033('0x42')],qs['fields'](_0x497fe0[_0xe033('0x44')][_0xe033('0x47')]));_0x5c3f3f['attributes']=_0x5c3f3f[_0xe033('0x48')]['length']?_0x5c3f3f[_0xe033('0x48')]:_0x2889cd[_0xe033('0x42')];if(!_0x497fe0[_0xe033('0x44')]['hasOwnProperty'](_0xe033('0x4b'))){_0x5c3f3f[_0xe033('0x32')]=qs['limit'](_0x497fe0[_0xe033('0x44')][_0xe033('0x32')]);_0x5c3f3f['offset']=qs[_0xe033('0x30')](_0x497fe0[_0xe033('0x44')]['offset']);}_0x5c3f3f[_0xe033('0x4c')]=qs[_0xe033('0x67')](_0x497fe0[_0xe033('0x44')][_0xe033('0x67')]);_0x5c3f3f['where']=qs['filters'](_[_0xe033('0x4e')](_0x497fe0['query'],_0x2889cd[_0xe033('0x45')]));_0x5c3f3f[_0xe033('0x4d')][_0xe033('0x68')]=_0x1176b1['id'];if(_0x497fe0[_0xe033('0x44')][_0xe033('0x6f')]){_0x5c3f3f[_0xe033('0x4d')]=_[_0xe033('0x50')](_0x5c3f3f[_0xe033('0x4d')],{'$or':_[_0xe033('0x43')](_0x5c3f3f[_0xe033('0x48')],function(_0x4e256c){var _0x2512f5={};_0x2512f5[_0x4e256c]={'$like':'%'+_0x497fe0[_0xe033('0x44')][_0xe033('0x6f')]+'%'};return _0x2512f5;})});}if(_0x497fe0[_0xe033('0x44')][_0xe033('0xa0')]){var _0x4cc6f7=_0x497fe0['query']['$gte'][_0xe033('0xa1')](',');var _0x1860bb={};_0x1860bb[_0x4cc6f7[0x0]]={'$gte':moment(_0x4cc6f7[0x1])[_0xe033('0xa2')](_0xe033('0xa3'))};_0x5c3f3f[_0xe033('0x4d')]=_[_0xe033('0x50')](_0x5c3f3f[_0xe033('0x4d')],_0x1860bb);}_0x5c3f3f=_[_0xe033('0x50')]({},_0x5c3f3f,_0x497fe0[_0xe033('0x51')]);return db[_0xe033('0x9f')][_0xe033('0x33')]({'where':_0x5c3f3f[_0xe033('0x4d')]})['then'](function(_0xaa0553){_0x3d3bb2[_0xe033('0x33')]=_0xaa0553;if(_0x497fe0[_0xe033('0x44')][_0xe033('0x56')]){_0x5c3f3f['include']=[{'all':!![]}];}return db[_0xe033('0x9f')][_0xe033('0x52')](_0x5c3f3f);})[_0xe033('0x35')](function(_0x5ceb7b){_0x3d3bb2[_0xe033('0x53')]=_0x5ceb7b;return _0x3d3bb2;});}})['then'](respondWithFilteredResult(_0x3a27d6,_0x5c3f3f))['catch'](handleError(_0x3a27d6,null));};exports[_0xe033('0x3b')]=function(_0x353853,_0x29dd3a,_0x2e1b0b){var _0x10ca55,_0x1b1153={},_0x152500;if(_0x353853[_0xe033('0x59')]['to']){_0x152500=_0x353853[_0xe033('0x59')]['to'][0x0];}return db[_0xe033('0x3d')][_0xe033('0x57')]({'where':{'id':_0x353853['params']['id']},'include':[{'model':db[_0xe033('0xa4')],'as':'List','include':[{'model':db[_0xe033('0xa5')],'as':'Contacts','where':{'fax':_0x152500},'limit':0x1,'order':[[_0xe033('0x9b'),_0xe033('0xa6')]]}]}]})['then'](handleEntityNotFound(_0x29dd3a,null))['then'](function(_0xdbbbf1){_0x10ca55=_0xdbbbf1;if(_0x353853[_0xe033('0x59')]['attachments']&&_0x353853[_0xe033('0x59')]['attachments'][_0xe033('0x49')]){for(var _0x5c3279=0x0;_0x5c3279<_0x353853[_0xe033('0x59')][_0xe033('0xa7')][_0xe033('0x49')];_0x5c3279+=0x1){_0x353853[_0xe033('0x59')][_0xe033('0xa7')][_0x5c3279]={'filename':_0x353853[_0xe033('0x59')][_0xe033('0xa7')][_0x5c3279][_0xe033('0x3a')],'id':_0x353853[_0xe033('0x59')][_0xe033('0xa7')][_0x5c3279]['id'],'path':path[_0xe033('0xa8')](config[_0xe033('0xa9')],'server/files/attachments',_0x353853[_0xe033('0x59')]['attachments'][_0x5c3279][_0xe033('0xaa')])};}}return respondWithRpcPromise(_0xe033('0xab'),_0xe033('0xab'),{'FaxAccountId':_[_0xe033('0xac')](_0x353853[_0xe033('0x61')]['id'])?undefined:_0x353853['params']['id'],'path':_['isNil'](_0x353853[_0xe033('0x59')][_0xe033('0xa7')][0x0]['path'])?undefined:_0x353853['body'][_0xe033('0xa7')][0x0]['path'],'fax':_[_0xe033('0xac')](_0x353853[_0xe033('0x59')]['to'][0x0])?undefined:_0x353853[_0xe033('0x59')]['to'][0x0]},client9002);})[_0xe033('0x35')](function(){if(_0x10ca55){if(_[_0xe033('0xac')](_0x353853[_0xe033('0x59')][_0xe033('0xad')])){_0x353853[_0xe033('0x59')]['from']=util['format'](_0xe033('0xae'),_0x10ca55[_0xe033('0x3a')],_0x10ca55['fax']);}if(_0x10ca55['List']){if(_0x10ca55[_0xe033('0xaf')][_0xe033('0xb0')][_0xe033('0x49')]){return _0x10ca55[_0xe033('0xaf')][_0xe033('0xb0')][0x0];}else{return db['CmContact'][_0xe033('0x58')](_['defaults'](_0x353853[_0xe033('0x59')],{'firstName':_0x353853[_0xe033('0x59')]['to'][0x0],'phone':_0x353853[_0xe033('0x59')]['to'][0x0],'fax':_0x353853[_0xe033('0x59')]['to'][0x0],'ListId':_0x10ca55[_0xe033('0x9d')]}));}}else{throw new Error(_0xe033('0xb1'));}}else{throw new Error(_0xe033('0xb2'));}})['then'](function(_0x3c4e18){if(_0x3c4e18){return db['FaxInteraction'][_0xe033('0x57')]({'where':{'ContactId':_0x3c4e18['id'],'closed':![],'FaxAccountId':_0x10ca55['id']}})[_0xe033('0x35')](function(_0x104eb0){if(_0x104eb0){return[_0x104eb0,![]];}return db[_0xe033('0x72')][_0xe033('0x58')]({'UserId':_0x353853[_0xe033('0x5a')]['id'],'ContactId':_0x3c4e18['id'],'FaxAccountId':_0x10ca55['id'],'fax':_0x353853[_0xe033('0x59')]['to'][0x0],'firstMsgDirection':_0xe033('0xb3'),'Messages':[_['merge'](_0x353853[_0xe033('0x59')],{'read':![],'body':_0x353853['body']['attachments'][0x0][_0xe033('0xb4')],'FaxAccountId':_0x10ca55['id'],'UserId':_0x353853[_0xe033('0x5a')]['id'],'ContactId':_0x3c4e18['id'],'AttachmentId':_0x353853[_0xe033('0x59')][_0xe033('0xa7')][0x0]['id']})]},{'include':[{'model':db[_0xe033('0x9f')],'as':_0xe033('0xb5')}]})[_0xe033('0x35')](function(_0x2e85e1){return[_0x2e85e1,!![]];});});}else{throw new Error(_0xe033('0xb6'));}})[_0xe033('0xb7')](function(_0x3453e1,_0x333600){if(_0x333600){return _0x3453e1;}return db[_0xe033('0x9f')]['create']({'direction':_0xe033('0xb3'),'read':![],'body':_0x353853[_0xe033('0x59')]['attachments'][0x0][_0xe033('0xb4')],'FaxAccountId':_0x10ca55['id'],'FaxInteractionId':_0x3453e1['id'],'UserId':_0x353853[_0xe033('0x5a')]['id'],'ContactId':_0x3453e1[_0xe033('0xb8')],'AttachmentId':_0x353853[_0xe033('0x59')][_0xe033('0xa7')][0x0]['id']})['then'](function(_0x573e1c){_0x3453e1[_0xe033('0xb9')][_0xe033('0xb5')]=[];_0x3453e1[_0xe033('0xb9')][_0xe033('0xb5')][_0xe033('0x8d')](_0x573e1c['dataValues']);return _0x3453e1;});})[_0xe033('0x35')](function(_0x47272e){respondWithRpcPromise('SendFax',_0xe033('0xba'),{'FaxAccountId':_[_0xe033('0xac')](_0x353853[_0xe033('0x61')]['id'])?undefined:_0x353853[_0xe033('0x61')]['id'],'path':_[_0xe033('0xac')](_0x353853[_0xe033('0x59')]['attachments'][0x0][_0xe033('0x7')])?undefined:_0x353853[_0xe033('0x59')]['attachments'][0x0][_0xe033('0x7')],'fax':_[_0xe033('0xac')](_0x353853[_0xe033('0x59')]['to'][0x0])?undefined:_0x353853[_0xe033('0x59')]['to'][0x0],'AttachmentId':_0x353853[_0xe033('0x59')][_0xe033('0xa7')][0x0]['id']},client9002)['then'](function(_0x152966){logger[_0xe033('0x24')]('SendFaxRpc,\x20%s',_0x152966);})[_0xe033('0x54')](function(_0x2a1b85){logger[_0xe033('0x24')](_0xe033('0xbb'),_0x2a1b85);});return _0x47272e;})[_0xe033('0x35')](respondWithResult(_0x29dd3a,null))[_0xe033('0x54')](handleError(_0x29dd3a,null));};exports[_0xe033('0xbc')]=function(_0x5ad1dd,_0x19b991,_0x4d6ae3){return db[_0xe033('0x3d')][_0xe033('0x57')]({'where':{'id':_0x5ad1dd['params']['id']}})[_0xe033('0x35')](handleEntityNotFound(_0x19b991,null))[_0xe033('0x35')](function(_0x51d086){if(_0x51d086){return _0x51d086[_0xe033('0xbc')](_0x5ad1dd[_0xe033('0x59')][_0xe033('0x6b')],_[_0xe033('0x73')](_0x5ad1dd[_0xe033('0x59')],[_0xe033('0x6b'),'id'])||{})['spread'](function(_0x3aee89){for(var _0x30dded=0x0;_0x30dded<_0x5ad1dd[_0xe033('0x59')][_0xe033('0x6b')][_0xe033('0x49')];_0x30dded+=0x1){socket[_0xe033('0xbd')](_0xe033('0xbe'),{'UserId':Number(_0x5ad1dd['body'][_0xe033('0x6b')][_0x30dded]),'FaxAccountId':Number(_0x5ad1dd[_0xe033('0x61')]['id'])});}return _0x3aee89;});}})[_0xe033('0x35')](respondWithResult(_0x19b991,null))[_0xe033('0x54')](handleError(_0x19b991,null));};exports['removeAgents']=function(_0x5a8fb6,_0x54ad37,_0x298caf){return db[_0xe033('0x3d')]['find']({'where':{'id':_0x5a8fb6[_0xe033('0x61')]['id']}})[_0xe033('0x35')](handleEntityNotFound(_0x54ad37,null))[_0xe033('0x35')](function(_0x1ac794){if(_0x1ac794){return _0x1ac794[_0xe033('0xbf')](_0x5a8fb6[_0xe033('0x44')]['ids'])[_0xe033('0x35')](function(){if(_[_0xe033('0xc0')](_0x5a8fb6[_0xe033('0x44')][_0xe033('0x6b')])){for(var _0x4db974=0x0;_0x4db974<_0x5a8fb6[_0xe033('0x44')][_0xe033('0x6b')][_0xe033('0x49')];_0x4db974+=0x1){socket[_0xe033('0xbd')](_0xe033('0xc1'),{'UserId':Number(_0x5a8fb6[_0xe033('0x44')]['ids'][_0x4db974]),'FaxAccountId':Number(_0x5a8fb6[_0xe033('0x61')]['id'])});}}else{socket[_0xe033('0xbd')]('userFaxAccount:remove',{'UserId':Number(_0x5a8fb6[_0xe033('0x44')][_0xe033('0x6b')]),'FaxAccountId':Number(_0x5a8fb6[_0xe033('0x61')]['id'])});}});}})['then'](respondWithStatusCode(_0x54ad37,null))[_0xe033('0x54')](handleError(_0x54ad37,null));};exports[_0xe033('0xc2')]=function(_0x556c38,_0x1c4b3d,_0x32c494){var _0x25ef8c={};var _0x11046b={};var _0x3ea5aa;var _0x700f0a;return db[_0xe033('0x3d')]['findOne']({'where':{'id':_0x556c38[_0xe033('0x61')]['id']}})[_0xe033('0x35')](handleEntityNotFound(_0x1c4b3d,null))[_0xe033('0x35')](function(_0x575be2){if(_0x575be2){_0x3ea5aa=_0x575be2;_0x11046b['model']=_[_0xe033('0x55')](db[_0xe033('0xc3')]['rawAttributes']);_0x11046b[_0xe033('0x44')]=_['keys'](_0x556c38[_0xe033('0x44')]);_0x11046b[_0xe033('0x45')]=_[_0xe033('0x46')](_0x11046b[_0xe033('0x42')],_0x11046b[_0xe033('0x44')]);_0x25ef8c['attributes']=_['intersection'](_0x11046b[_0xe033('0x42')],qs[_0xe033('0x47')](_0x556c38[_0xe033('0x44')][_0xe033('0x47')]));_0x25ef8c['attributes']=_0x25ef8c[_0xe033('0x48')][_0xe033('0x49')]?_0x25ef8c['attributes']:_0x11046b[_0xe033('0x42')];_0x25ef8c['order']=qs[_0xe033('0x67')](_0x556c38[_0xe033('0x44')][_0xe033('0x67')]);_0x25ef8c[_0xe033('0x4d')]=qs['filters'](_[_0xe033('0x4e')](_0x556c38['query'],_0x11046b['filters']));if(_0x556c38[_0xe033('0x44')][_0xe033('0x6f')]){_0x25ef8c['where']=_['merge'](_0x25ef8c[_0xe033('0x4d')],{'$or':_[_0xe033('0x43')](_0x25ef8c['attributes'],function(_0x9e8a95){var _0x596bea={};_0x596bea[_0x9e8a95]={'$like':'%'+_0x556c38[_0xe033('0x44')]['filter']+'%'};return _0x596bea;})});}_0x25ef8c=_['merge']({},_0x25ef8c,_0x556c38['options']);return _0x3ea5aa[_0xe033('0xc2')](_0x25ef8c);}})[_0xe033('0x35')](function(_0x538340){if(_0x538340){_0x700f0a=_0x538340['length'];if(!_0x556c38[_0xe033('0x44')]['hasOwnProperty'](_0xe033('0x4b'))){_0x25ef8c[_0xe033('0x32')]=qs[_0xe033('0x32')](_0x556c38[_0xe033('0x44')]['limit']);_0x25ef8c[_0xe033('0x30')]=qs['offset'](_0x556c38[_0xe033('0x44')][_0xe033('0x30')]);}return _0x3ea5aa['getAgents'](_0x25ef8c);}})[_0xe033('0x35')](function(_0x52b865){if(_0x52b865){return _0x52b865?{'count':_0x700f0a,'rows':_0x52b865}:null;}})['then'](respondWithResult(_0x1c4b3d,null))[_0xe033('0x54')](handleError(_0x1c4b3d,null));}; \ No newline at end of file +var _0x819b=['filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','describe','FaxAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','nolimit','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Contact','User','Owner','internal','Tag','Tags','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','priority','finally','getApplications','context','from-voip-provider','localstationid','app','system','description','push','Answer','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','maxrate','minrate','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','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','DESC','attachments','join','root','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Contacts','defaults','out','filename','Contact\x20not\x20found','spread','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','isArray','emit','userFaxAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick'];(function(_0xf2a3bf,_0x30b52d){var _0x1d5527=function(_0x3e10d6){while(--_0x3e10d6){_0xf2a3bf['push'](_0xf2a3bf['shift']());}};_0x1d5527(++_0x30b52d);}(_0x819b,0x75));var _0xb819=function(_0x29a09e,_0x178d0d){_0x29a09e=_0x29a09e-0x0;var _0x5c3e2c=_0x819b[_0x29a09e];return _0x5c3e2c;};'use strict';var emlformat=require(_0xb819('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb819('0x1'));var jsonpatch=require(_0xb819('0x2'));var rp=require('request-promise');var moment=require(_0xb819('0x3'));var BPromise=require(_0xb819('0x4'));var Mustache=require(_0xb819('0x5'));var util=require(_0xb819('0x6'));var path=require(_0xb819('0x7'));var sox=require(_0xb819('0x8'));var csv=require(_0xb819('0x9'));var ejs=require(_0xb819('0xa'));var fs=require('fs');var fs_extra=require(_0xb819('0xb'));var _=require(_0xb819('0xc'));var squel=require(_0xb819('0xd'));var crypto=require(_0xb819('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb819('0xf'));var toCsv=require(_0xb819('0x9'));var querystring=require(_0xb819('0x10'));var Papa=require(_0xb819('0x11'));var Redis=require(_0xb819('0x12'));var authService=require(_0xb819('0x13'));var qs=require(_0xb819('0x14'));var as=require(_0xb819('0x15'));var hardwareService=require(_0xb819('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb819('0x17'));var db=require(_0xb819('0x18'))['db'];config[_0xb819('0x19')]=_['defaults'](config[_0xb819('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xb819('0x1a'))(new Redis(config[_0xb819('0x19')]));require(_0xb819('0x1b'))[_0xb819('0x1c')](socket);var jayson=require(_0xb819('0x1d'));var client=jayson[_0xb819('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0xb819('0x1e')][_0xb819('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2e50a3,_0x129c1f,_0x2bd379,_0x1b5014){return new BPromise(function(_0xdda3ed,_0x16f20b){var _0x174c70=_0x1b5014||client;return _0x174c70[_0xb819('0x20')](_0x2e50a3,_0x2bd379)[_0xb819('0x21')](function(_0x35068b){logger[_0xb819('0x22')](_0xb819('0x23'),_0x129c1f,_0xb819('0x24'));logger[_0xb819('0x25')](_0xb819('0x26'),_0x129c1f,_0xb819('0x24'),JSON['stringify'](_0x35068b));if(_0x35068b[_0xb819('0x27')]){if(_0x35068b[_0xb819('0x27')][_0xb819('0x28')]===0x1f4){logger[_0xb819('0x27')](_0xb819('0x23'),_0x129c1f,_0x35068b[_0xb819('0x27')][_0xb819('0x29')]);return _0x16f20b(_0x35068b[_0xb819('0x27')][_0xb819('0x29')]);}logger[_0xb819('0x27')](_0xb819('0x23'),_0x129c1f,_0x35068b[_0xb819('0x27')][_0xb819('0x29')]);return _0xdda3ed(_0x35068b[_0xb819('0x27')]['message']);}else{logger[_0xb819('0x22')](_0xb819('0x23'),_0x129c1f,_0xb819('0x24'));_0xdda3ed(_0x35068b[_0xb819('0x2a')][_0xb819('0x29')]);}})['catch'](function(_0x11eba2){logger['error'](_0xb819('0x23'),_0x129c1f,_0x11eba2);_0x16f20b(_0x11eba2);});});}function respondWithStatusCode(_0x4619ef,_0x335ca2){_0x335ca2=_0x335ca2||0xcc;return function(_0x1a8717){if(_0x1a8717){return _0x4619ef[_0xb819('0x2b')](_0x335ca2);}return _0x4619ef[_0xb819('0x2c')](_0x335ca2)['end']();};}function respondWithResult(_0x21e72d,_0x12b4c2){_0x12b4c2=_0x12b4c2||0xc8;return function(_0x2f92b7){if(_0x2f92b7){return _0x21e72d[_0xb819('0x2c')](_0x12b4c2)[_0xb819('0x2d')](_0x2f92b7);}};}function respondWithFilteredResult(_0x2cca8e,_0x2290a3){return function(_0x1e3ef4){if(_0x1e3ef4){var _0x1ee191=typeof _0x2290a3[_0xb819('0x2e')]===_0xb819('0x2f')&&typeof _0x2290a3[_0xb819('0x30')]==='undefined';var _0x21ba28=_0x1e3ef4[_0xb819('0x31')];var _0x291d08=_0x1ee191?0x0:_0x2290a3[_0xb819('0x2e')];var _0x266a55=_0x1ee191?_0x1e3ef4[_0xb819('0x31')]:_0x2290a3[_0xb819('0x2e')]+_0x2290a3[_0xb819('0x30')];var _0x137feb;if(_0x266a55>=_0x21ba28){_0x266a55=_0x21ba28;_0x137feb=0xc8;}else{_0x137feb=0xce;}_0x2cca8e[_0xb819('0x2c')](_0x137feb);return _0x2cca8e[_0xb819('0x32')](_0xb819('0x33'),_0x291d08+'-'+_0x266a55+'/'+_0x21ba28)[_0xb819('0x2d')](_0x1e3ef4);}return null;};}function patchUpdates(_0x5a163c){return function(_0xa19770){try{jsonpatch[_0xb819('0x34')](_0xa19770,_0x5a163c,!![]);}catch(_0x337a0b){return BPromise['reject'](_0x337a0b);}return _0xa19770['save']();};}function saveUpdates(_0x44ddc5,_0xb56522){return function(_0x1628d4){if(_0x1628d4){return _0x1628d4[_0xb819('0x35')](_0x44ddc5)[_0xb819('0x21')](function(_0x3952fe){return _0x3952fe;});}return null;};}function removeEntity(_0x5b2a97,_0x41dce3){return function(_0x1f1237){if(_0x1f1237){return _0x1f1237[_0xb819('0x36')]()[_0xb819('0x21')](function(){var _0x546f68=_0x1f1237[_0xb819('0x37')]({'plain':!![]});var _0x26082b=_0xb819('0x38');return db[_0xb819('0x39')][_0xb819('0x36')]({'where':{'type':_0x26082b,'resourceId':_0x546f68['id']}})[_0xb819('0x21')](function(){return _0x1f1237;});})[_0xb819('0x21')](function(){_0x5b2a97[_0xb819('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x276b94,_0x21a0c8){return function(_0x156597){if(!_0x156597){_0x276b94[_0xb819('0x2b')](0x194);}return _0x156597;};}function handleError(_0x215cc6,_0x12ca6d){_0x12ca6d=_0x12ca6d||0x1f4;return function(_0x2bedb0){logger[_0xb819('0x27')](_0x2bedb0[_0xb819('0x3a')]);if(_0x2bedb0[_0xb819('0x3b')]){delete _0x2bedb0[_0xb819('0x3b')];}_0x215cc6[_0xb819('0x2c')](_0x12ca6d)[_0xb819('0x3c')](_0x2bedb0);};}exports[_0xb819('0x3d')]=function(_0x4a531d,_0x55e960){var _0x487311={'include':[{'model':db[_0xb819('0x3e')],'as':_0xb819('0x3f')}]},_0x20e5e8={},_0xb6e99d={'count':0x0,'rows':[]};var _0x1f5993=_[_0xb819('0x40')](db[_0xb819('0x41')]['rawAttributes'],function(_0x491ee2){return{'name':_0x491ee2[_0xb819('0x42')],'type':_0x491ee2[_0xb819('0x43')]['key']};});_0x20e5e8[_0xb819('0x44')]=_[_0xb819('0x40')](_0x1f5993,'name');_0x20e5e8[_0xb819('0x45')]=_[_0xb819('0x46')](_0x4a531d['query']);_0x20e5e8[_0xb819('0x47')]=_[_0xb819('0x48')](_0x20e5e8[_0xb819('0x44')],_0x20e5e8[_0xb819('0x45')]);_0x487311[_0xb819('0x49')]=_[_0xb819('0x48')](_0x20e5e8['model'],qs['fields'](_0x4a531d[_0xb819('0x45')][_0xb819('0x4a')]));_0x487311[_0xb819('0x49')]=_0x487311[_0xb819('0x49')]['length']?_0x487311[_0xb819('0x49')]:_0x20e5e8['model'];if(!_0x4a531d['query'][_0xb819('0x4b')]('nolimit')){_0x487311[_0xb819('0x30')]=qs[_0xb819('0x30')](_0x4a531d[_0xb819('0x45')]['limit']);_0x487311[_0xb819('0x2e')]=qs['offset'](_0x4a531d[_0xb819('0x45')][_0xb819('0x2e')]);}_0x487311[_0xb819('0x4c')]=qs[_0xb819('0x4d')](_0x4a531d['query'][_0xb819('0x4d')]);_0x487311[_0xb819('0x4e')]=qs[_0xb819('0x47')](_[_0xb819('0x4f')](_0x4a531d['query'],_0x20e5e8['filters']),_0x1f5993);if(_0x4a531d[_0xb819('0x45')][_0xb819('0x50')]){_0x487311[_0xb819('0x4e')]=_[_0xb819('0x51')](_0x487311[_0xb819('0x4e')],{'$or':_[_0xb819('0x40')](_0x1f5993,function(_0x5b153c){if(_0x5b153c[_0xb819('0x43')]!==_0xb819('0x52')){var _0x52d635={};_0x52d635[_0x5b153c[_0xb819('0x3b')]]={'$like':'%'+_0x4a531d['query'][_0xb819('0x50')]+'%'};return _0x52d635;}})});}_0x487311=_[_0xb819('0x51')]({},_0x487311,_0x4a531d['options']);var _0x3efceb={'where':_0x487311[_0xb819('0x4e')]};return db[_0xb819('0x41')][_0xb819('0x31')](_0x3efceb)[_0xb819('0x21')](function(_0x5aa66f){_0xb6e99d[_0xb819('0x31')]=_0x5aa66f;if(_0x4a531d['query'][_0xb819('0x53')]){_0x487311[_0xb819('0x54')]=[{'all':!![]}];}return db[_0xb819('0x41')][_0xb819('0x55')](_0x487311);})[_0xb819('0x21')](function(_0x23194d){_0xb6e99d[_0xb819('0x56')]=_0x23194d;return _0xb6e99d;})['then'](respondWithFilteredResult(_0x55e960,_0x487311))[_0xb819('0x57')](handleError(_0x55e960,null));};exports[_0xb819('0x58')]=function(_0x19255f,_0x38d59c){var _0xa929f0={'raw':![],'where':{'id':_0x19255f[_0xb819('0x59')]['id']},'include':[{'model':db[_0xb819('0x3e')],'as':'mandatoryDispositionPause'}]},_0x44da93={};_0x44da93[_0xb819('0x44')]=_[_0xb819('0x46')](db[_0xb819('0x41')][_0xb819('0x5a')]);_0x44da93[_0xb819('0x45')]=_[_0xb819('0x46')](_0x19255f[_0xb819('0x45')]);_0x44da93[_0xb819('0x47')]=_['intersection'](_0x44da93[_0xb819('0x44')],_0x44da93[_0xb819('0x45')]);_0xa929f0['attributes']=_['intersection'](_0x44da93[_0xb819('0x44')],qs[_0xb819('0x4a')](_0x19255f[_0xb819('0x45')][_0xb819('0x4a')]));_0xa929f0[_0xb819('0x49')]=_0xa929f0[_0xb819('0x49')][_0xb819('0x5b')]?_0xa929f0[_0xb819('0x49')]:_0x44da93[_0xb819('0x44')];if(_0x19255f[_0xb819('0x45')][_0xb819('0x53')]){_0xa929f0[_0xb819('0x54')]=[{'all':!![]}];}_0xa929f0=_[_0xb819('0x51')]({},_0xa929f0,_0x19255f[_0xb819('0x5c')]);return db[_0xb819('0x41')][_0xb819('0x5d')](_0xa929f0)[_0xb819('0x21')](handleEntityNotFound(_0x38d59c,null))[_0xb819('0x21')](respondWithResult(_0x38d59c,null))[_0xb819('0x57')](handleError(_0x38d59c,null));};exports[_0xb819('0x5e')]=function(_0x3f068e,_0x4b2fcc){return db[_0xb819('0x41')][_0xb819('0x5e')](_0x3f068e[_0xb819('0x5f')],{})[_0xb819('0x21')](function(_0x5e7cb5){var _0x331bd5=_0x3f068e[_0xb819('0x60')]['get']({'plain':!![]});if(!_0x331bd5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x331bd5[_0xb819('0x61')]==='user'){var _0x579a74=_0x5e7cb5['get']({'plain':!![]});var _0x10c1bf=_0xb819('0x38');return db[_0xb819('0x62')][_0xb819('0x5d')]({'where':{'name':_0x10c1bf,'userProfileId':_0x331bd5[_0xb819('0x63')]},'raw':!![]})['then'](function(_0x9f19e3){if(_0x9f19e3&&_0x9f19e3[_0xb819('0x64')]===0x0){return db[_0xb819('0x39')][_0xb819('0x5e')]({'name':_0x579a74['name'],'resourceId':_0x579a74['id'],'type':_0x9f19e3[_0xb819('0x3b')],'sectionId':_0x9f19e3['id']},{})[_0xb819('0x21')](function(){return _0x5e7cb5;});}else{return _0x5e7cb5;}})[_0xb819('0x57')](function(_0x1e483d){logger[_0xb819('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e483d);throw _0x1e483d;});}return _0x5e7cb5;})[_0xb819('0x21')](respondWithResult(_0x4b2fcc,0xc9))['catch'](handleError(_0x4b2fcc,null));};exports['update']=function(_0x28d349,_0x324849){if(_0x28d349[_0xb819('0x5f')]['id']){delete _0x28d349[_0xb819('0x5f')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x28d349['params']['id']},'include':[{'model':db[_0xb819('0x3e')],'as':_0xb819('0x3f')}]})[_0xb819('0x21')](handleEntityNotFound(_0x324849,null))[_0xb819('0x21')](saveUpdates(_0x28d349[_0xb819('0x5f')],null))[_0xb819('0x21')](respondWithResult(_0x324849,null))[_0xb819('0x57')](handleError(_0x324849,null));};exports[_0xb819('0x36')]=function(_0x20dfed,_0xf81dd8){return db[_0xb819('0x41')][_0xb819('0x5d')]({'where':{'id':_0x20dfed[_0xb819('0x59')]['id']}})[_0xb819('0x21')](handleEntityNotFound(_0xf81dd8,null))[_0xb819('0x21')](removeEntity(_0xf81dd8,null))[_0xb819('0x57')](handleError(_0xf81dd8,null));};exports[_0xb819('0x65')]=function(_0x2585da,_0x42f63f){return db[_0xb819('0x41')]['describe']()['then'](respondWithResult(_0x42f63f,null))[_0xb819('0x57')](handleError(_0x42f63f,null));};exports['addDisposition']=function(_0x529798,_0x54e0e0,_0x59acaa){if(_0x529798[_0xb819('0x5f')]['id']){delete _0x529798[_0xb819('0x5f')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x529798[_0xb819('0x59')]['id']}})[_0xb819('0x21')](handleEntityNotFound(_0x54e0e0,null))[_0xb819('0x21')](function(_0x416283){if(_0x416283){_0x529798['body'][_0xb819('0x66')]=_0x416283['id'];return db[_0xb819('0x67')]['create'](_0x529798[_0xb819('0x5f')]);}})['then'](respondWithResult(_0x54e0e0,null))[_0xb819('0x57')](handleError(_0x54e0e0,null));};exports[_0xb819('0x68')]=function(_0x3d2d16,_0x40cbb4,_0x500766){var _0x4c7a77={'raw':![],'where':{}};var _0x14c571={};var _0x508f02={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x3d2d16[_0xb819('0x59')]['id']}})[_0xb819('0x21')](handleEntityNotFound(_0x40cbb4,null))['then'](function(_0x3cd369){if(_0x3cd369){_0x14c571[_0xb819('0x44')]=_[_0xb819('0x46')](db['Disposition'][_0xb819('0x5a')]);_0x14c571[_0xb819('0x45')]=_['keys'](_0x3d2d16[_0xb819('0x45')]);_0x14c571[_0xb819('0x47')]=_['intersection'](_0x14c571['model'],_0x14c571[_0xb819('0x45')]);_0x4c7a77['attributes']=_[_0xb819('0x48')](_0x14c571['model'],qs[_0xb819('0x4a')](_0x3d2d16['query'][_0xb819('0x4a')]));_0x4c7a77[_0xb819('0x49')]=_0x4c7a77[_0xb819('0x49')][_0xb819('0x5b')]?_0x4c7a77[_0xb819('0x49')]:_0x14c571[_0xb819('0x44')];if(!_0x3d2d16[_0xb819('0x45')]['hasOwnProperty']('nolimit')){_0x4c7a77['limit']=qs[_0xb819('0x30')](_0x3d2d16[_0xb819('0x45')][_0xb819('0x30')]);_0x4c7a77[_0xb819('0x2e')]=qs[_0xb819('0x2e')](_0x3d2d16[_0xb819('0x45')][_0xb819('0x2e')]);}_0x4c7a77[_0xb819('0x4c')]=qs[_0xb819('0x4d')](_0x3d2d16['query'][_0xb819('0x4d')]);_0x4c7a77[_0xb819('0x4e')]=qs[_0xb819('0x47')](_[_0xb819('0x4f')](_0x3d2d16[_0xb819('0x45')],_0x14c571[_0xb819('0x47')]));_0x4c7a77['where'][_0xb819('0x66')]=_0x3cd369['id'];if(_0x3d2d16[_0xb819('0x45')][_0xb819('0x50')]){_0x4c7a77['where']=_[_0xb819('0x51')](_0x4c7a77[_0xb819('0x4e')],{'$or':_[_0xb819('0x40')](_0x4c7a77['attributes'],function(_0xa035f3){var _0x979382={};_0x979382[_0xa035f3]={'$like':'%'+_0x3d2d16[_0xb819('0x45')][_0xb819('0x50')]+'%'};return _0x979382;})});}_0x4c7a77=_[_0xb819('0x51')]({},_0x4c7a77,_0x3d2d16[_0xb819('0x5c')]);return db[_0xb819('0x67')][_0xb819('0x31')]({'where':_0x4c7a77[_0xb819('0x4e')]})[_0xb819('0x21')](function(_0x59d912){_0x508f02[_0xb819('0x31')]=_0x59d912;if(_0x3d2d16['query'][_0xb819('0x53')]){_0x4c7a77[_0xb819('0x54')]=[{'all':!![]}];}return db[_0xb819('0x67')][_0xb819('0x55')](_0x4c7a77);})['then'](function(_0x1b488d){_0x508f02[_0xb819('0x56')]=_0x1b488d;return _0x508f02;});}})[_0xb819('0x21')](respondWithFilteredResult(_0x40cbb4,_0x4c7a77))[_0xb819('0x57')](handleError(_0x40cbb4,null));};exports['removeDispositions']=function(_0x492463,_0x30f700,_0x52db99){return db[_0xb819('0x41')][_0xb819('0x5d')]({'where':{'id':_0x492463[_0xb819('0x59')]['id']}})[_0xb819('0x21')](handleEntityNotFound(_0x30f700,null))[_0xb819('0x21')](function(_0x2dd402){if(_0x2dd402){return _0x2dd402[_0xb819('0x69')](_0x492463['query'][_0xb819('0x6a')]);}})[_0xb819('0x21')](respondWithStatusCode(_0x30f700,null))['catch'](handleError(_0x30f700,null));};exports[_0xb819('0x6b')]=function(_0x577053,_0x46a067,_0xc933e8){if(_0x577053['body']['id']){delete _0x577053[_0xb819('0x5f')]['id'];}return db['FaxAccount'][_0xb819('0x5d')]({'where':{'id':_0x577053[_0xb819('0x59')]['id']}})[_0xb819('0x21')](handleEntityNotFound(_0x46a067,null))[_0xb819('0x21')](function(_0x1d9ef3){if(_0x1d9ef3){_0x577053[_0xb819('0x5f')][_0xb819('0x66')]=_0x1d9ef3['id'];return db[_0xb819('0x6c')][_0xb819('0x5e')](_0x577053[_0xb819('0x5f')]);}})['then'](respondWithResult(_0x46a067,null))[_0xb819('0x57')](handleError(_0x46a067,null));};exports[_0xb819('0x6d')]=function(_0x49b928,_0x2aacbf,_0x3042f0){var _0x2969f5={'raw':![],'where':{}};var _0x26df69={};var _0x45b388={'count':0x0,'rows':[]};return db[_0xb819('0x41')][_0xb819('0x6e')]({'where':{'id':_0x49b928[_0xb819('0x59')]['id']}})[_0xb819('0x21')](handleEntityNotFound(_0x2aacbf,null))[_0xb819('0x21')](function(_0x4ea89){if(_0x4ea89){_0x26df69[_0xb819('0x44')]=_[_0xb819('0x46')](db[_0xb819('0x6c')][_0xb819('0x5a')]);_0x26df69[_0xb819('0x45')]=_[_0xb819('0x46')](_0x49b928[_0xb819('0x45')]);_0x26df69[_0xb819('0x47')]=_[_0xb819('0x48')](_0x26df69[_0xb819('0x44')],_0x26df69[_0xb819('0x45')]);_0x2969f5[_0xb819('0x49')]=_[_0xb819('0x48')](_0x26df69[_0xb819('0x44')],qs[_0xb819('0x4a')](_0x49b928['query'][_0xb819('0x4a')]));_0x2969f5['attributes']=_0x2969f5[_0xb819('0x49')][_0xb819('0x5b')]?_0x2969f5[_0xb819('0x49')]:_0x26df69['model'];if(!_0x49b928[_0xb819('0x45')][_0xb819('0x4b')](_0xb819('0x6f'))){_0x2969f5[_0xb819('0x30')]=qs[_0xb819('0x30')](_0x49b928[_0xb819('0x45')][_0xb819('0x30')]);_0x2969f5[_0xb819('0x2e')]=qs[_0xb819('0x2e')](_0x49b928[_0xb819('0x45')][_0xb819('0x2e')]);}_0x2969f5[_0xb819('0x4c')]=qs[_0xb819('0x4d')](_0x49b928[_0xb819('0x45')][_0xb819('0x4d')]);_0x2969f5[_0xb819('0x4e')]=qs[_0xb819('0x47')](_[_0xb819('0x4f')](_0x49b928[_0xb819('0x45')],_0x26df69[_0xb819('0x47')]));_0x2969f5[_0xb819('0x4e')][_0xb819('0x66')]=_0x4ea89['id'];if(_0x49b928[_0xb819('0x45')][_0xb819('0x50')]){_0x2969f5[_0xb819('0x4e')]=_[_0xb819('0x51')](_0x2969f5['where'],{'$or':_[_0xb819('0x40')](_0x2969f5['attributes'],function(_0x2859bc){var _0x215fb1={};_0x215fb1[_0x2859bc]={'$like':'%'+_0x49b928[_0xb819('0x45')]['filter']+'%'};return _0x215fb1;})});}_0x2969f5=_[_0xb819('0x51')]({},_0x2969f5,_0x49b928[_0xb819('0x5c')]);return db['CannedAnswer'][_0xb819('0x31')]({'where':_0x2969f5[_0xb819('0x4e')]})['then'](function(_0x71c969){_0x45b388[_0xb819('0x31')]=_0x71c969;if(_0x49b928[_0xb819('0x45')][_0xb819('0x53')]){_0x2969f5[_0xb819('0x54')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x2969f5);})[_0xb819('0x21')](function(_0x18a913){_0x45b388['rows']=_0x18a913;return _0x45b388;});}})['then'](respondWithFilteredResult(_0x2aacbf,_0x2969f5))['catch'](handleError(_0x2aacbf,null));};exports['removeAnswers']=function(_0x55c943,_0x146d6c,_0x4ff290){return db['FaxAccount']['find']({'where':{'id':_0x55c943[_0xb819('0x59')]['id']}})[_0xb819('0x21')](handleEntityNotFound(_0x146d6c,null))[_0xb819('0x21')](function(_0x529bde){if(_0x529bde){return _0x529bde[_0xb819('0x70')](_0x55c943[_0xb819('0x45')][_0xb819('0x6a')]);}})[_0xb819('0x21')](respondWithStatusCode(_0x146d6c,null))['catch'](handleError(_0x146d6c,null));};exports[_0xb819('0x71')]=function(_0x21f897,_0x4b40a0,_0x4e18b1){return db['FaxInteraction']['find']({'where':{'id':_0x21f897[_0xb819('0x59')]['id']}})[_0xb819('0x21')](handleEntityNotFound(_0x4b40a0,null))[_0xb819('0x21')](function(_0x584859){if(_0x584859){return _0x584859['addInteraction'](_0x21f897[_0xb819('0x5f')][_0xb819('0x6a')],_[_0xb819('0x72')](_0x21f897[_0xb819('0x5f')],[_0xb819('0x6a'),'id'])||{});}})[_0xb819('0x21')](respondWithResult(_0x4b40a0,null))['catch'](handleError(_0x4b40a0,null));};exports[_0xb819('0x73')]=function(_0x3d3cdf,_0xbc1766,_0x3dac33){var _0x3f85ed={'raw':![],'where':{}};var _0x5a6412={};var _0x3f7651={'count':0x0,'rows':[]};return db[_0xb819('0x41')][_0xb819('0x6e')]({'where':{'id':_0x3d3cdf[_0xb819('0x59')]['id']}})['then'](handleEntityNotFound(_0xbc1766,null))[_0xb819('0x21')](function(_0x4ba517){if(_0x4ba517){_0x5a6412[_0xb819('0x44')]=_[_0xb819('0x46')](db[_0xb819('0x74')][_0xb819('0x5a')]);_0x5a6412[_0xb819('0x45')]=_['keys'](_0x3d3cdf['query']);_0x5a6412[_0xb819('0x47')]=_[_0xb819('0x48')](_0x5a6412[_0xb819('0x44')],_0x5a6412['query']);_0x3f85ed[_0xb819('0x49')]=_[_0xb819('0x48')](_0x5a6412[_0xb819('0x44')],qs[_0xb819('0x4a')](_0x3d3cdf['query'][_0xb819('0x4a')]));_0x3f85ed[_0xb819('0x49')]=_0x3f85ed[_0xb819('0x49')][_0xb819('0x5b')]?_0x3f85ed[_0xb819('0x49')]:_0x5a6412[_0xb819('0x44')];if(!_0x3d3cdf[_0xb819('0x45')][_0xb819('0x4b')]('nolimit')){_0x3f85ed[_0xb819('0x30')]=qs[_0xb819('0x30')](_0x3d3cdf[_0xb819('0x45')][_0xb819('0x30')]);_0x3f85ed[_0xb819('0x2e')]=qs['offset'](_0x3d3cdf['query'][_0xb819('0x2e')]);}_0x3f85ed[_0xb819('0x4c')]=qs[_0xb819('0x4d')](_0x3d3cdf[_0xb819('0x45')][_0xb819('0x4d')]);_0x3f85ed['where']=qs[_0xb819('0x47')](_[_0xb819('0x4f')](_0x3d3cdf[_0xb819('0x45')],_0x5a6412['filters']));_0x3f85ed['where'][_0xb819('0x66')]=_0x4ba517['id'];if(_0x3d3cdf[_0xb819('0x45')]['filter']){_0x3f85ed[_0xb819('0x4e')]=_[_0xb819('0x51')](_0x3f85ed['where'],{'$or':_['map'](_0x3f85ed['attributes'],function(_0x163dc3){var _0x22d629={};_0x22d629[_0x163dc3]={'$like':'%'+_0x3d3cdf[_0xb819('0x45')][_0xb819('0x50')]+'%'};return _0x22d629;})});}_0x3f85ed=_[_0xb819('0x51')]({},_0x3f85ed,_0x3d3cdf['options']);return db[_0xb819('0x74')][_0xb819('0x31')]({'where':_0x3f85ed['where']})[_0xb819('0x21')](function(_0x27fa2d){_0x3f7651['count']=_0x27fa2d;if(_0x3d3cdf[_0xb819('0x45')][_0xb819('0x53')]){_0x3f85ed[_0xb819('0x54')]=[{'model':db[_0xb819('0x75')],'as':_0xb819('0x76'),'required':![]},{'model':db[_0xb819('0x77')],'as':_0xb819('0x78'),'attributes':['name','fullname',_0xb819('0x79')],'required':![]},{'model':db[_0xb819('0x7a')],'as':_0xb819('0x7b'),'attributes':['id',_0xb819('0x3b'),'color'],'where':_0x3d3cdf['query']['tag']?{'id':_0x3d3cdf['query'][_0xb819('0x7c')]}:undefined,'required':_0x3d3cdf[_0xb819('0x45')][_0xb819('0x7c')]?!![]:![]}];}return db[_0xb819('0x74')]['findAll'](_0x3f85ed);})['then'](function(_0x3de496){_0x3f7651[_0xb819('0x56')]=_0x3de496;return _0x3f7651;});}})['then'](respondWithFilteredResult(_0xbc1766,_0x3f85ed))['catch'](handleError(_0xbc1766,null));};exports[_0xb819('0x7d')]=function(_0x20bee9,_0x49549b){var _0x3793c1=_0x20bee9['params']['id'];var _0x2eb592=_0x20bee9[_0xb819('0x5f')];var _0x5a8f54=0xc8;var _0x485c6b=null;return db[_0xb819('0x7e')][_0xb819('0x7f')]({'isolationLevel':db['sequelize'][_0xb819('0x80')][_0xb819('0x81')][_0xb819('0x82')]},function(_0x20c3c1){return db[_0xb819('0x41')][_0xb819('0x6e')]({'where':{'id':_0x3793c1},'transaction':_0x20c3c1})[_0xb819('0x21')](function(_0x9e72b6){if(_0x9e72b6){return db[_0xb819('0x83')]['destroy']({'where':{'FaxAccountId':_0x3793c1},'transaction':_0x20c3c1})[_0xb819('0x21')](function(){var _0x4e8df6=_[_0xb819('0x40')](_0x2eb592,function(_0x3bddfd){_0x3bddfd[_0xb819('0x66')]=_0x3793c1;return _0x3bddfd;});return db[_0xb819('0x83')][_0xb819('0x84')](_0x4e8df6,{'transaction':_0x20c3c1});});}else{_0x5a8f54=0x194;_0x485c6b=[];}});})['then'](function(){if(_0x5a8f54!==0x194){return db[_0xb819('0x83')]['findAndCountAll']({'where':{'FaxAccountId':_0x3793c1},'order':_0xb819('0x85')})[_0xb819('0x21')](function(_0x100695){_0x485c6b=_0x100695;});}})['catch'](function(_0x4ae994){_0x5a8f54=0x1f4;logger[_0xb819('0x27')](_0x4ae994[_0xb819('0x3a')]);if(_0x4ae994['name']){delete _0x4ae994[_0xb819('0x3b')];}_0x485c6b=_0x4ae994;})[_0xb819('0x86')](function(){if(_0x485c6b===null){_0x49549b[_0xb819('0x2b')](_0x5a8f54);}else{if(_0x5a8f54===0x1f4){_0x49549b[_0xb819('0x2c')](_0x5a8f54)[_0xb819('0x3c')](_0x485c6b);}else{_0x49549b[_0xb819('0x2c')](_0x5a8f54)['json'](_0x485c6b);}}});};exports[_0xb819('0x87')]=function(_0x39f814,_0xf26475,_0x519617){var _0x365c77={};var _0x12b692={};var _0x33ebbb;var _0x17f748;return db[_0xb819('0x41')][_0xb819('0x6e')]({'where':{'id':_0x39f814[_0xb819('0x59')]['id']}})[_0xb819('0x21')](handleEntityNotFound(_0xf26475,null))[_0xb819('0x21')](function(_0x539ac2){if(_0x539ac2){_0x33ebbb=_0x539ac2;_0x12b692[_0xb819('0x44')]=_['keys'](db[_0xb819('0x83')][_0xb819('0x5a')]);_0x12b692[_0xb819('0x45')]=_[_0xb819('0x46')](_0x39f814['query']);_0x12b692[_0xb819('0x47')]=_['intersection'](_0x12b692[_0xb819('0x44')],_0x12b692['query']);_0x365c77[_0xb819('0x49')]=_['intersection'](_0x12b692[_0xb819('0x44')],qs['fields'](_0x39f814[_0xb819('0x45')][_0xb819('0x4a')]));_0x365c77['attributes']=_0x365c77[_0xb819('0x49')][_0xb819('0x5b')]?_0x365c77[_0xb819('0x49')]:_0x12b692[_0xb819('0x44')];_0x365c77['order']=qs['sort'](_0x39f814[_0xb819('0x45')]['sort']);_0x365c77[_0xb819('0x4e')]=qs[_0xb819('0x47')](_[_0xb819('0x4f')](_0x39f814['query'],_0x12b692[_0xb819('0x47')]));if(_0x39f814[_0xb819('0x45')][_0xb819('0x50')]){_0x365c77['where']=_[_0xb819('0x51')](_0x365c77[_0xb819('0x4e')],{'$or':_[_0xb819('0x40')](_0x365c77[_0xb819('0x49')],function(_0x1a42f5){var _0x28c815={};_0x28c815[_0x1a42f5]={'$like':'%'+_0x39f814[_0xb819('0x45')][_0xb819('0x50')]+'%'};return _0x28c815;})});}_0x365c77=_[_0xb819('0x51')]({},_0x365c77,_0x39f814[_0xb819('0x5c')]);return _0x33ebbb[_0xb819('0x87')](_0x365c77);}})[_0xb819('0x21')](function(_0x5f2acd){if(_0x5f2acd){_0x17f748=_0x5f2acd[_0xb819('0x5b')];if(!_0x39f814[_0xb819('0x45')][_0xb819('0x4b')](_0xb819('0x6f'))){_0x365c77['limit']=qs[_0xb819('0x30')](_0x39f814[_0xb819('0x45')][_0xb819('0x30')]);_0x365c77[_0xb819('0x2e')]=qs[_0xb819('0x2e')](_0x39f814[_0xb819('0x45')]['offset']);}return _0x33ebbb['getApplications'](_0x365c77);}})[_0xb819('0x21')](function(_0x216680){if(_0x216680){return _0x216680?{'count':_0x17f748,'rows':_0x216680}:null;}})['then'](respondWithResult(_0xf26475,null))[_0xb819('0x57')](handleError(_0xf26475,null));};function Extension(_0x3d61ba,_0x13b116,_0x175d47,_0x1d3be0){this[_0xb819('0x88')]=_0xb819('0x89');this['exten']=_0x3d61ba[_0xb819('0x8a')];this[_0xb819('0x8b')]=_0x1d3be0;this[_0xb819('0x43')]=_0xb819('0x8c');this[_0xb819('0x8d')]='Fax\x20Extension';this[_0xb819('0x66')]=_0x3d61ba['id'];this['priority']=_0x13b116;this['appdata']=_0x175d47;}function createExtensionsReciveFax(_0xeca72){var _0x585584=0x1;var _0x3fc244=[];_0x3fc244[_0xb819('0x8e')](new Extension(_0xeca72,_0x585584,'',_0xb819('0x8f')));_0x585584+=0x1;_0x3fc244[_0xb819('0x8e')](new Extension(_0xeca72,_0x585584,_0xb819('0x90'),_0xb819('0x91')));_0x585584+=0x1;for(var _0x2ef136 in _0xeca72){if(_0xeca72['hasOwnProperty'](_0x2ef136)&&(_0x2ef136==='ecm'||_0x2ef136===_0xb819('0x8a')||_0x2ef136===_0xb819('0x92')||_0x2ef136===_0xb819('0x93')||_0x2ef136===_0xb819('0x94')||_0x2ef136===_0xb819('0x95')||_0x2ef136===_0xb819('0x96')||_0x2ef136==='modem'||_0x2ef136==='t38timeout')){_0x3fc244[_0xb819('0x8e')](new Extension(_0xeca72,_0x585584,_0xb819('0x97')+_0x2ef136+')='+_0xeca72[_0x2ef136],'Set'));_0x585584+=0x1;}}_0x3fc244[_0xb819('0x8e')](new Extension(_0xeca72,_0x585584,'6',_0xb819('0x98')));_0x585584+=0x1;_0x3fc244[_0xb819('0x8e')](new Extension(_0xeca72,_0x585584,_0xb819('0x99'),_0xb819('0x9a')));_0x585584=0x0;return _0x3fc244;}exports[_0xb819('0x9b')]=function(_0x366d05,_0x4a7080,_0x4db5a3){var _0x3e5f67;return db[_0xb819('0x7e')][_0xb819('0x7f')](function(_0x13e912){return db[_0xb819('0x41')][_0xb819('0x5e')](_0x366d05['body'],{'transaction':_0x13e912})[_0xb819('0x21')](function(_0x36444d){_0x3e5f67=_0x36444d[_0xb819('0x37')]({'plain':!![]});return db['VoiceExtension'][_0xb819('0x84')](createExtensionsReciveFax(_0x3e5f67),{'transaction':_0x13e912});});})['then'](function(){return _0x3e5f67;})[_0xb819('0x21')](respondWithResult(_0x4a7080,null))[_0xb819('0x57')](handleError(_0x4a7080,null));};exports['updateAccountApplications']=function(_0x3a66bd,_0x10f3cf,_0x5b5062){var _0x47efa9;return db[_0xb819('0x7e')][_0xb819('0x7f')](function(_0x378bd0){return db[_0xb819('0x41')]['update'](_0x3a66bd[_0xb819('0x5f')],{'where':{'id':_0x3a66bd['body']['id']},'transaction':_0x378bd0})[_0xb819('0x21')](function(_0x54b6f7){return db[_0xb819('0x9c')][_0xb819('0x36')]({'where':{'FaxAccountId':_0x3a66bd[_0xb819('0x5f')]['id']},'transaction':_0x378bd0})[_0xb819('0x21')](function(_0x117ba3){return db[_0xb819('0x9c')][_0xb819('0x84')](createExtensionsReciveFax(_[_0xb819('0x72')](_0x3a66bd[_0xb819('0x5f')],[_0xb819('0x9d'),'key',_0xb819('0x9e'),_0xb819('0x9f'),_0xb819('0xa0'),_0xb819('0xa1')])),{'transaction':_0x378bd0});});});})[_0xb819('0x21')](function(){return db[_0xb819('0x41')][_0xb819('0xa2')](_0x3a66bd[_0xb819('0x5f')]['id']);})[_0xb819('0x21')](respondWithResult(_0x10f3cf,null))['catch'](handleError(_0x10f3cf,null));};exports[_0xb819('0xa3')]=function(_0x56f4eb,_0x3da505,_0x3a2e0c){var _0x431099={'raw':!![],'where':{}};var _0x3ae7a2={};var _0x290698={'count':0x0,'rows':[]};return db[_0xb819('0x41')]['findOne']({'where':{'id':_0x56f4eb[_0xb819('0x59')]['id']}})[_0xb819('0x21')](handleEntityNotFound(_0x3da505,null))[_0xb819('0x21')](function(_0x5de27e){if(_0x5de27e){_0x3ae7a2['model']=_['keys'](db[_0xb819('0xa4')][_0xb819('0x5a')]);_0x3ae7a2['query']=_[_0xb819('0x46')](_0x56f4eb[_0xb819('0x45')]);_0x3ae7a2[_0xb819('0x47')]=_[_0xb819('0x48')](_0x3ae7a2[_0xb819('0x44')],_0x3ae7a2[_0xb819('0x45')]);_0x431099[_0xb819('0x49')]=_[_0xb819('0x48')](_0x3ae7a2[_0xb819('0x44')],qs['fields'](_0x56f4eb['query'][_0xb819('0x4a')]));_0x431099['attributes']=_0x431099['attributes'][_0xb819('0x5b')]?_0x431099['attributes']:_0x3ae7a2['model'];if(!_0x56f4eb['query'][_0xb819('0x4b')](_0xb819('0x6f'))){_0x431099[_0xb819('0x30')]=qs['limit'](_0x56f4eb[_0xb819('0x45')][_0xb819('0x30')]);_0x431099[_0xb819('0x2e')]=qs[_0xb819('0x2e')](_0x56f4eb[_0xb819('0x45')][_0xb819('0x2e')]);}_0x431099['order']=qs[_0xb819('0x4d')](_0x56f4eb[_0xb819('0x45')][_0xb819('0x4d')]);_0x431099[_0xb819('0x4e')]=qs['filters'](_[_0xb819('0x4f')](_0x56f4eb[_0xb819('0x45')],_0x3ae7a2[_0xb819('0x47')]));_0x431099['where']['FaxAccountId']=_0x5de27e['id'];if(_0x56f4eb[_0xb819('0x45')][_0xb819('0x50')]){_0x431099['where']=_['merge'](_0x431099[_0xb819('0x4e')],{'$or':_[_0xb819('0x40')](_0x431099['attributes'],function(_0x56b3bf){var _0x147064={};_0x147064[_0x56b3bf]={'$like':'%'+_0x56f4eb[_0xb819('0x45')]['filter']+'%'};return _0x147064;})});}if(_0x56f4eb[_0xb819('0x45')][_0xb819('0xa5')]){var _0x201cab=_0x56f4eb[_0xb819('0x45')][_0xb819('0xa5')]['split'](',');var _0x25fd59={};_0x25fd59[_0x201cab[0x0]]={'$gte':moment(_0x201cab[0x1])[_0xb819('0xa6')](_0xb819('0xa7'))};_0x431099[_0xb819('0x4e')]=_[_0xb819('0x51')](_0x431099[_0xb819('0x4e')],_0x25fd59);}_0x431099=_[_0xb819('0x51')]({},_0x431099,_0x56f4eb['options']);return db[_0xb819('0xa4')][_0xb819('0x31')]({'where':_0x431099['where']})[_0xb819('0x21')](function(_0x4fbf2f){_0x290698['count']=_0x4fbf2f;if(_0x56f4eb[_0xb819('0x45')][_0xb819('0x53')]){_0x431099[_0xb819('0x54')]=[{'all':!![]}];}return db[_0xb819('0xa4')][_0xb819('0x55')](_0x431099);})[_0xb819('0x21')](function(_0x51139d){_0x290698['rows']=_0x51139d;return _0x290698;});}})['then'](respondWithFilteredResult(_0x3da505,_0x431099))[_0xb819('0x57')](handleError(_0x3da505,null));};exports[_0xb819('0x3c')]=function(_0x588647,_0x160230,_0x502960){var _0x36a582,_0x15bbfe={},_0x416b04;if(_0x588647[_0xb819('0x5f')]['to']){_0x416b04=_0x588647[_0xb819('0x5f')]['to'][0x0];}return db[_0xb819('0x41')][_0xb819('0x5d')]({'where':{'id':_0x588647[_0xb819('0x59')]['id']},'include':[{'model':db[_0xb819('0xa8')],'as':_0xb819('0xa9'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'fax':_0x416b04},'limit':0x1,'order':[[_0xb819('0x9f'),_0xb819('0xaa')]]}]}]})['then'](handleEntityNotFound(_0x160230,null))[_0xb819('0x21')](function(_0x16dbb4){_0x36a582=_0x16dbb4;if(_0x588647[_0xb819('0x5f')][_0xb819('0xab')]&&_0x588647[_0xb819('0x5f')][_0xb819('0xab')][_0xb819('0x5b')]){for(var _0x1772b1=0x0;_0x1772b1<_0x588647[_0xb819('0x5f')]['attachments'][_0xb819('0x5b')];_0x1772b1+=0x1){_0x588647['body'][_0xb819('0xab')][_0x1772b1]={'filename':_0x588647[_0xb819('0x5f')]['attachments'][_0x1772b1][_0xb819('0x3b')],'id':_0x588647[_0xb819('0x5f')][_0xb819('0xab')][_0x1772b1]['id'],'path':path[_0xb819('0xac')](config[_0xb819('0xad')],'server/files/attachments',_0x588647[_0xb819('0x5f')]['attachments'][_0x1772b1][_0xb819('0xae')])};}}return respondWithRpcPromise(_0xb819('0xaf'),_0xb819('0xaf'),{'FaxAccountId':_[_0xb819('0xb0')](_0x588647[_0xb819('0x59')]['id'])?undefined:_0x588647['params']['id'],'path':_[_0xb819('0xb0')](_0x588647[_0xb819('0x5f')][_0xb819('0xab')][0x0][_0xb819('0x7')])?undefined:_0x588647[_0xb819('0x5f')][_0xb819('0xab')][0x0]['path'],'fax':_[_0xb819('0xb0')](_0x588647['body']['to'][0x0])?undefined:_0x588647['body']['to'][0x0]},client9002);})['then'](function(){if(_0x36a582){if(_[_0xb819('0xb0')](_0x588647[_0xb819('0x5f')]['from'])){_0x588647[_0xb819('0x5f')][_0xb819('0xb1')]=util['format'](_0xb819('0xb2'),_0x36a582['name'],_0x36a582[_0xb819('0xb3')]);}if(_0x36a582['List']){if(_0x36a582['List'][_0xb819('0xb4')]['length']){return _0x36a582[_0xb819('0xa9')][_0xb819('0xb4')][0x0];}else{return db[_0xb819('0x75')][_0xb819('0x5e')](_[_0xb819('0xb5')](_0x588647[_0xb819('0x5f')],{'firstName':_0x588647[_0xb819('0x5f')]['to'][0x0],'phone':_0x588647[_0xb819('0x5f')]['to'][0x0],'fax':_0x588647[_0xb819('0x5f')]['to'][0x0],'ListId':_0x36a582[_0xb819('0xa1')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error('Send\x20Fax\x20failed');}})[_0xb819('0x21')](function(_0x1a2f55){if(_0x1a2f55){return db[_0xb819('0x74')][_0xb819('0x5d')]({'where':{'ContactId':_0x1a2f55['id'],'closed':![],'FaxAccountId':_0x36a582['id']}})[_0xb819('0x21')](function(_0x727c7f){if(_0x727c7f){return[_0x727c7f,![]];}return db[_0xb819('0x74')]['create']({'UserId':_0x588647['user']['id'],'ContactId':_0x1a2f55['id'],'FaxAccountId':_0x36a582['id'],'fax':_0x588647['body']['to'][0x0],'firstMsgDirection':_0xb819('0xb6'),'Messages':[_[_0xb819('0x51')](_0x588647[_0xb819('0x5f')],{'read':![],'body':_0x588647[_0xb819('0x5f')][_0xb819('0xab')][0x0][_0xb819('0xb7')],'FaxAccountId':_0x36a582['id'],'UserId':_0x588647[_0xb819('0x60')]['id'],'ContactId':_0x1a2f55['id'],'AttachmentId':_0x588647['body'][_0xb819('0xab')][0x0]['id']})]},{'include':[{'model':db[_0xb819('0xa4')],'as':'Messages'}]})[_0xb819('0x21')](function(_0x156145){return[_0x156145,!![]];});});}else{throw new Error(_0xb819('0xb8'));}})[_0xb819('0xb9')](function(_0x2fa2e0,_0x15e4b3){if(_0x15e4b3){return _0x2fa2e0;}return db['FaxMessage']['create']({'direction':'out','read':![],'body':_0x588647['body'][_0xb819('0xab')][0x0]['filename'],'FaxAccountId':_0x36a582['id'],'FaxInteractionId':_0x2fa2e0['id'],'UserId':_0x588647[_0xb819('0x60')]['id'],'ContactId':_0x2fa2e0[_0xb819('0xba')],'AttachmentId':_0x588647[_0xb819('0x5f')][_0xb819('0xab')][0x0]['id']})[_0xb819('0x21')](function(_0x330014){_0x2fa2e0[_0xb819('0xbb')][_0xb819('0xbc')]=[];_0x2fa2e0[_0xb819('0xbb')]['Messages'][_0xb819('0x8e')](_0x330014[_0xb819('0xbb')]);return _0x2fa2e0;});})[_0xb819('0x21')](function(_0x55513a){respondWithRpcPromise('SendFax',_0xb819('0xbd'),{'FaxAccountId':_[_0xb819('0xb0')](_0x588647[_0xb819('0x59')]['id'])?undefined:_0x588647['params']['id'],'path':_['isNil'](_0x588647['body'][_0xb819('0xab')][0x0]['path'])?undefined:_0x588647[_0xb819('0x5f')][_0xb819('0xab')][0x0][_0xb819('0x7')],'fax':_[_0xb819('0xb0')](_0x588647[_0xb819('0x5f')]['to'][0x0])?undefined:_0x588647['body']['to'][0x0],'AttachmentId':_0x588647['body'][_0xb819('0xab')][0x0]['id']},client9002)['then'](function(_0x2209be){logger[_0xb819('0x22')]('SendFaxRpc,\x20%s',_0x2209be);})[_0xb819('0x57')](function(_0x184220){logger[_0xb819('0x22')](_0xb819('0xbe'),_0x184220);});return _0x55513a;})['then'](respondWithResult(_0x160230,null))[_0xb819('0x57')](handleError(_0x160230,null));};exports[_0xb819('0xbf')]=function(_0x1b709f,_0x64c4f8,_0x36cc96){return db[_0xb819('0x41')][_0xb819('0x5d')]({'where':{'id':_0x1b709f[_0xb819('0x59')]['id']}})[_0xb819('0x21')](handleEntityNotFound(_0x64c4f8,null))[_0xb819('0x21')](function(_0x110993){if(_0x110993){return _0x110993[_0xb819('0xbf')](_0x1b709f['body'][_0xb819('0x6a')],_[_0xb819('0x72')](_0x1b709f[_0xb819('0x5f')],['ids','id'])||{})[_0xb819('0xb9')](function(_0x5be859){for(var _0x583042=0x0;_0x583042<_0x1b709f[_0xb819('0x5f')][_0xb819('0x6a')][_0xb819('0x5b')];_0x583042+=0x1){socket['emit'](_0xb819('0xc0'),{'UserId':Number(_0x1b709f['body'][_0xb819('0x6a')][_0x583042]),'FaxAccountId':Number(_0x1b709f[_0xb819('0x59')]['id'])});}return _0x5be859;});}})[_0xb819('0x21')](respondWithResult(_0x64c4f8,null))[_0xb819('0x57')](handleError(_0x64c4f8,null));};exports['removeAgents']=function(_0x5ca03f,_0x3cfbc7,_0x58fd34){return db[_0xb819('0x41')][_0xb819('0x5d')]({'where':{'id':_0x5ca03f[_0xb819('0x59')]['id']}})[_0xb819('0x21')](handleEntityNotFound(_0x3cfbc7,null))['then'](function(_0x5653c8){if(_0x5653c8){return _0x5653c8['removeAgents'](_0x5ca03f[_0xb819('0x45')][_0xb819('0x6a')])[_0xb819('0x21')](function(){if(_[_0xb819('0xc1')](_0x5ca03f['query'][_0xb819('0x6a')])){for(var _0x56d9dc=0x0;_0x56d9dc<_0x5ca03f[_0xb819('0x45')][_0xb819('0x6a')][_0xb819('0x5b')];_0x56d9dc+=0x1){socket[_0xb819('0xc2')](_0xb819('0xc3'),{'UserId':Number(_0x5ca03f[_0xb819('0x45')][_0xb819('0x6a')][_0x56d9dc]),'FaxAccountId':Number(_0x5ca03f['params']['id'])});}}else{socket[_0xb819('0xc2')](_0xb819('0xc3'),{'UserId':Number(_0x5ca03f['query'][_0xb819('0x6a')]),'FaxAccountId':Number(_0x5ca03f[_0xb819('0x59')]['id'])});}});}})[_0xb819('0x21')](respondWithStatusCode(_0x3cfbc7,null))['catch'](handleError(_0x3cfbc7,null));};exports[_0xb819('0xc4')]=function(_0x263c11,_0x343856,_0xf90fd6){var _0x3dbcef={};var _0x2227ab={};var _0x5a4999;var _0xfeea24;return db['FaxAccount'][_0xb819('0x6e')]({'where':{'id':_0x263c11['params']['id']}})[_0xb819('0x21')](handleEntityNotFound(_0x343856,null))[_0xb819('0x21')](function(_0x59cb80){if(_0x59cb80){_0x5a4999=_0x59cb80;_0x2227ab[_0xb819('0x44')]=_['keys'](db[_0xb819('0x77')][_0xb819('0x5a')]);_0x2227ab[_0xb819('0x45')]=_[_0xb819('0x46')](_0x263c11[_0xb819('0x45')]);_0x2227ab[_0xb819('0x47')]=_[_0xb819('0x48')](_0x2227ab[_0xb819('0x44')],_0x2227ab[_0xb819('0x45')]);_0x3dbcef[_0xb819('0x49')]=_[_0xb819('0x48')](_0x2227ab['model'],qs[_0xb819('0x4a')](_0x263c11[_0xb819('0x45')]['fields']));_0x3dbcef[_0xb819('0x49')]=_0x3dbcef[_0xb819('0x49')][_0xb819('0x5b')]?_0x3dbcef[_0xb819('0x49')]:_0x2227ab['model'];_0x3dbcef[_0xb819('0x4c')]=qs['sort'](_0x263c11[_0xb819('0x45')]['sort']);_0x3dbcef[_0xb819('0x4e')]=qs[_0xb819('0x47')](_['pick'](_0x263c11[_0xb819('0x45')],_0x2227ab['filters']));if(_0x263c11[_0xb819('0x45')][_0xb819('0x50')]){_0x3dbcef['where']=_['merge'](_0x3dbcef['where'],{'$or':_[_0xb819('0x40')](_0x3dbcef[_0xb819('0x49')],function(_0x138d6e){var _0x5ae62a={};_0x5ae62a[_0x138d6e]={'$like':'%'+_0x263c11[_0xb819('0x45')][_0xb819('0x50')]+'%'};return _0x5ae62a;})});}_0x3dbcef=_['merge']({},_0x3dbcef,_0x263c11[_0xb819('0x5c')]);return _0x5a4999[_0xb819('0xc4')](_0x3dbcef);}})['then'](function(_0x18275b){if(_0x18275b){_0xfeea24=_0x18275b['length'];if(!_0x263c11[_0xb819('0x45')][_0xb819('0x4b')]('nolimit')){_0x3dbcef[_0xb819('0x30')]=qs[_0xb819('0x30')](_0x263c11[_0xb819('0x45')][_0xb819('0x30')]);_0x3dbcef[_0xb819('0x2e')]=qs[_0xb819('0x2e')](_0x263c11['query']['offset']);}return _0x5a4999['getAgents'](_0x3dbcef);}})['then'](function(_0x14454c){if(_0x14454c){return _0x14454c?{'count':_0xfeea24,'rows':_0x14454c}:null;}})[_0xb819('0x21')](respondWithResult(_0x343856,null))[_0xb819('0x57')](handleError(_0x343856,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 50b8890..cbed7db 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 _0x84e5=['hook','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x574f63,_0x455021){var _0x31fa34=function(_0x54c3c4){while(--_0x54c3c4){_0x574f63['push'](_0x574f63['shift']());}};_0x31fa34(++_0x455021);}(_0x84e5,0x111));var _0x584e=function(_0x40b3f2,_0x2c4f5f){_0x40b3f2=_0x40b3f2-0x0;var _0x4ce90c=_0x84e5[_0x40b3f2];return _0x4ce90c;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x584e('0x0'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x584e('0x1')](0x0);var events={'afterCreate':_0x584e('0x2'),'afterUpdate':_0x584e('0x3'),'afterDestroy':_0x584e('0x4')};function emitEvent(_0x4de15a){return function(_0x20db99,_0x2d2e61,_0x2f210e){FaxAccountEvents[_0x584e('0x5')](_0x4de15a+':'+_0x20db99['id'],_0x20db99);FaxAccountEvents[_0x584e('0x5')](_0x4de15a,_0x20db99);_0x2f210e(null);};}for(var e in events){if(events[_0x584e('0x6')](e)){var event=events[e];FaxAccount[_0x584e('0x7')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0x8c5a=['hasOwnProperty','hook','events','../../mysqldb','FaxAccount','setMaxListeners','save','update','remove','emit'];(function(_0x59478c,_0x4416cf){var _0x28d205=function(_0x599c6c){while(--_0x599c6c){_0x59478c['push'](_0x59478c['shift']());}};_0x28d205(++_0x4416cf);}(_0x8c5a,0xfc));var _0xa8c5=function(_0x53310e,_0x11336d){_0x53310e=_0x53310e-0x0;var _0x32e9d6=_0x8c5a[_0x53310e];return _0x32e9d6;};'use strict';var EventEmitter=require(_0xa8c5('0x0'));var FaxAccount=require(_0xa8c5('0x1'))['db'][_0xa8c5('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xa8c5('0x3')](0x0);var events={'afterCreate':_0xa8c5('0x4'),'afterUpdate':_0xa8c5('0x5'),'afterDestroy':_0xa8c5('0x6')};function emitEvent(_0x28d9c4){return function(_0x44d0a1,_0x95d3b9,_0xdac072){FaxAccountEvents[_0xa8c5('0x7')](_0x28d9c4+':'+_0x44d0a1['id'],_0x44d0a1);FaxAccountEvents[_0xa8c5('0x7')](_0x28d9c4,_0x44d0a1);_0xdac072(null);};}for(var e in events){if(events[_0xa8c5('0x8')](e)){var event=events[e];FaxAccount[_0xa8c5('0x9')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 4bf89d5..ac74a5b 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 _0x1679=['fax_accounts','lodash','../../config/logger','api','moment','request-promise','rimraf','./faxAccount.attributes','FaxAccount'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1679,0x196));var _0x9167=function(_0xc2b8c9,_0x2d42c1){_0xc2b8c9=_0xc2b8c9-0x0;var _0x185e7e=_0x1679[_0xc2b8c9];return _0x185e7e;};'use strict';var _=require(_0x9167('0x0'));var util=require('util');var logger=require(_0x9167('0x1'))(_0x9167('0x2'));var moment=require(_0x9167('0x3'));var BPromise=require('bluebird');var rp=require(_0x9167('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9167('0x5'));var config=require('../../config/environment');var attributes=require(_0x9167('0x6'));module['exports']=function(_0x4ee79f,_0x4d9ee6){return _0x4ee79f['define'](_0x9167('0x7'),attributes,{'tableName':_0x9167('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x74e7=['../../config/logger','api','bluebird','request-promise','rimraf','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','util'];(function(_0x1058ac,_0x1e8378){var _0x28aa14=function(_0x2054b8){while(--_0x2054b8){_0x1058ac['push'](_0x1058ac['shift']());}};_0x28aa14(++_0x1e8378);}(_0x74e7,0xa4));var _0x774e=function(_0xa5352f,_0x580fd7){_0xa5352f=_0xa5352f-0x0;var _0x2a7556=_0x74e7[_0xa5352f];return _0x2a7556;};'use strict';var _=require('lodash');var util=require(_0x774e('0x0'));var logger=require(_0x774e('0x1'))(_0x774e('0x2'));var moment=require('moment');var BPromise=require(_0x774e('0x3'));var rp=require(_0x774e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x774e('0x5'));var config=require('../../config/environment');var attributes=require(_0x774e('0x6'));module[_0x774e('0x7')]=function(_0x505fab,_0x47b834){return _0x505fab[_0x774e('0x8')](_0x774e('0x9'),attributes,{'tableName':_0x774e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 7fb7ae9..f7837cc 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 _0x863e=['waitForTheAssignedAgent','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','FaxAccount,\x20%s,\x20%s','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','attributes','limit','include','map','model','NotifyFaxAccount','CmContact','Sequelize','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','isNil','from','ValidationError','body','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','List','Contacts','DESC','FaxApplication','get','applications','Applications','orderBy','priority','asc','length','defaults','ListId','create','fax','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','UserId','User','name','unshift','agent'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x863e,0x1ca));var _0xe863=function(_0x7cd529,_0x50e1b0){_0x7cd529=_0x7cd529-0x0;var _0x29913b=_0x863e[_0x7cd529];return _0x29913b;};'use strict';var _=require(_0xe863('0x0'));var util=require(_0xe863('0x1'));var moment=require('moment');var BPromise=require(_0xe863('0x2'));var rs=require(_0xe863('0x3'));var fs=require('fs');var Redis=require(_0xe863('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe863('0x5'))(_0xe863('0x6'));var config=require(_0xe863('0x7'));var jayson=require(_0xe863('0x8'));var client=jayson[_0xe863('0x9')][_0xe863('0xa')]({'port':0x232c});config[_0xe863('0xb')]=_['defaults'](config[_0xe863('0xb')],{'host':_0xe863('0xc'),'port':0x18eb});var socket=require(_0xe863('0xd'))(new Redis(config[_0xe863('0xb')]));require(_0xe863('0xe'))[_0xe863('0xf')](socket);function respondWithRpcPromise(_0x377bef,_0x3b6974,_0x4d591d){return new BPromise(function(_0x534631,_0x4b538d){return client[_0xe863('0x10')](_0x377bef,_0x4d591d)[_0xe863('0x11')](function(_0x5315e7){logger[_0xe863('0x12')]('FaxAccount,\x20%s,\x20%s',_0x3b6974,_0xe863('0x13'));logger[_0xe863('0x14')](_0xe863('0x15'),_0x3b6974,_0xe863('0x13'),JSON[_0xe863('0x16')](_0x5315e7));if(_0x5315e7[_0xe863('0x17')]){if(_0x5315e7['error']['code']===0x1f4){logger[_0xe863('0x17')](_0xe863('0x18'),_0x3b6974,_0x5315e7['error'][_0xe863('0x19')]);return _0x4b538d(_0x5315e7[_0xe863('0x17')][_0xe863('0x19')]);}logger[_0xe863('0x17')](_0xe863('0x18'),_0x3b6974,_0x5315e7['error'][_0xe863('0x19')]);return _0x534631(_0x5315e7[_0xe863('0x17')]['message']);}else{logger['info'](_0xe863('0x18'),_0x3b6974,'request\x20sent');_0x534631(_0x5315e7[_0xe863('0x1a')]['message']);}})[_0xe863('0x1b')](function(_0x267f5f){logger['error'](_0xe863('0x18'),_0x3b6974,_0x267f5f);_0x4b538d(_0x267f5f);});});}exports[_0xe863('0x1c')]=function(_0x4d0156){var _0xe32849=this;return new Promise(function(_0x10dfb1,_0x23de76){return db[_0xe863('0x1d')][_0xe863('0x1e')]({'raw':_0x4d0156[_0xe863('0x1f')]?_0x4d0156[_0xe863('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x4d0156[_0xe863('0x1f')]?_0x4d0156[_0xe863('0x1f')]['where']||null:null,'attributes':_0x4d0156['options']?_0x4d0156[_0xe863('0x1f')][_0xe863('0x20')]||null:null,'limit':_0x4d0156[_0xe863('0x1f')]?_0x4d0156[_0xe863('0x1f')][_0xe863('0x21')]||null:null,'include':_0x4d0156[_0xe863('0x1f')]?_0x4d0156[_0xe863('0x1f')][_0xe863('0x22')]?_[_0xe863('0x23')](_0x4d0156[_0xe863('0x1f')][_0xe863('0x22')],function(_0x1ed180){return{'model':db[_0x1ed180['model']],'as':_0x1ed180['as'],'attributes':_0x1ed180[_0xe863('0x20')],'include':_0x1ed180[_0xe863('0x22')]?_[_0xe863('0x23')](_0x1ed180[_0xe863('0x22')],function(_0xefda1d){return{'model':db[_0xefda1d[_0xe863('0x24')]],'as':_0xefda1d['as'],'attributes':_0xefda1d['attributes'],'include':_0xefda1d[_0xe863('0x22')]?_[_0xe863('0x23')](_0xefda1d['include'],function(_0x142888){return{'model':db[_0x142888[_0xe863('0x24')]],'as':_0x142888['as'],'attributes':_0x142888['attributes']};}):[]};}):[]};}):[]:[]})[_0xe863('0x11')](function(_0x4b4bf3){logger[_0xe863('0x12')](_0xe863('0x1c'),_0x4d0156);logger['debug'](_0xe863('0x1c'),_0x4d0156,JSON[_0xe863('0x16')](_0x4b4bf3));_0x10dfb1(_0x4b4bf3);})[_0xe863('0x1b')](function(_0x51cf7b){logger[_0xe863('0x17')](_0xe863('0x1c'),_0x51cf7b['message'],_0x4d0156);_0x23de76(_0xe32849[_0xe863('0x17')](0x1f4,_0x51cf7b[_0xe863('0x19')]));});});};exports[_0xe863('0x25')]=function(_0x2235d4,_0x2bfca4,_0x5a5ee3){var _0x588ec1=this;return new Promise(function(_0x547fc9,_0x2a53a0){var _0x435684={'body':_0x2235d4['body'],'channel':'fax'};var _0x5c88f4=[];var _0x362990=[];var _0x5f2c70={};return db[_0xe863('0x26')]['describe']()[_0xe863('0x11')](function(_0x553eb2){if(!_0x553eb2){throw new db[(_0xe863('0x27'))]['ValidationError'](_0xe863('0x28'));}_0x5c88f4=_[_0xe863('0x29')](_[_0xe863('0x2a')](_0x553eb2),[_0xe863('0x2b'),_0xe863('0x2c')]);_0x362990=_['difference'](_[_0xe863('0x2a')](_0x553eb2),[_0xe863('0x2b'),_0xe863('0x2c'),'CompanyId','ListId']);if(_0x2235d4['body']['id']){delete _0x2235d4['body']['id'];}if(_[_0xe863('0x2d')](_0x2235d4['body'][_0xe863('0x2e')])){throw new db[(_0xe863('0x27'))][(_0xe863('0x2f'))]('from\x20is\x20mandatory');}if(_[_0xe863('0x2d')](_0x2235d4[_0xe863('0x30')][_0xe863('0x30')])||_0x2235d4[_0xe863('0x30')][_0xe863('0x30')]===''){throw new db[(_0xe863('0x27'))]['ValidationError'](_0xe863('0x31'));}if(_['isNil'](_0x2235d4[_0xe863('0x30')]['mapKey'])){throw new db[(_0xe863('0x27'))][(_0xe863('0x2f'))](_0xe863('0x32')+_0x362990);}if(!_[_0xe863('0x33')](_0x362990,_0x2235d4[_0xe863('0x30')][_0xe863('0x34')])){throw new db[(_0xe863('0x27'))][(_0xe863('0x2f'))](_0xe863('0x35')+_0x362990);}_0x5f2c70[_0x2235d4['body'][_0xe863('0x34')]]=_0x2235d4[_0xe863('0x30')][_0xe863('0x2e')];})[_0xe863('0x11')](function(){return db[_0xe863('0x1d')][_0xe863('0x36')]({'where':{'id':_0x2235d4[_0xe863('0x37')]['id']},'include':[{'model':db['CmList'],'as':_0xe863('0x38'),'include':[{'model':db[_0xe863('0x26')],'as':_0xe863('0x39'),'where':_0x5f2c70,'limit':0x1,'order':[['updatedAt',_0xe863('0x3a')]]}]},{'model':db[_0xe863('0x3b')],'as':'Applications'}]});})[_0xe863('0x11')](function(_0x15aa07){if(_0x15aa07&&_0x15aa07['List']){var _0x259e78=_0x15aa07[_0xe863('0x3c')]({'plain':!![]});_0x435684['account']=_0x259e78;_0x435684[_0xe863('0x3d')]=_0x259e78[_0xe863('0x3e')];_0x435684['list']=_0x259e78[_0xe863('0x38')];_0x435684[_0xe863('0x3d')]=_[_0xe863('0x3f')](_0x435684[_0xe863('0x3d')],[_0xe863('0x40')],[_0xe863('0x41')]);if(_0x435684['account']['Applications']){delete _0x435684['account']['Applications'];}if(_0x435684[_0xe863('0x37')][_0xe863('0x38')]&&_0x435684[_0xe863('0x37')][_0xe863('0x38')][_0xe863('0x39')][_0xe863('0x42')]){return _0x435684[_0xe863('0x37')][_0xe863('0x38')]['Contacts'][0x0];}var _0x2dd754=_[_0xe863('0x43')](_0x2235d4[_0xe863('0x30')],{'firstName':_0x2235d4[_0xe863('0x30')][_0xe863('0x2e')],'ListId':_0x259e78[_0xe863('0x44')]});_0x2dd754[_0x2235d4[_0xe863('0x30')][_0xe863('0x34')]]=_0x2235d4[_0xe863('0x30')][_0xe863('0x2e')];return db[_0xe863('0x26')][_0xe863('0x45')](_0x2dd754,{'fields':_0x5c88f4,'raw':!![]});}})[_0xe863('0x11')](function(_0x5a038d){_0x435684['contact']=_0x5a038d;if(_0x5a038d){var _0x2921d8={'ContactId':_0x5a038d['id'],'FaxAccountId':_0x2235d4[_0xe863('0x37')]['id'],'fax':_0x5a038d[_0xe863('0x46')]};return db[_0xe863('0x47')]['find']({'where':{'ContactId':_0x5a038d['id'],'closed':![],'FaxAccountId':_0x2235d4[_0xe863('0x37')]['id']}})['then'](function(_0x3d27f3){if(_0x3d27f3){return[_0x3d27f3,![]];}return db[_0xe863('0x47')][_0xe863('0x45')](_0x2921d8)[_0xe863('0x11')](function(_0x133df0){return[_0x133df0,!![]];});});}else{throw new Error(_0xe863('0x48'));}})[_0xe863('0x49')](function(_0x1bf4b0,_0x251bab){var _0x266b6d=_0x1bf4b0['get']({'plain':!![]});if(_0x251bab){if(_0x435684['account'][_0xe863('0x4a')]){_0x435684[_0xe863('0x3d')][_0xe863('0x4b')]({'id':0x0,'priority':_0x435684['applications'][_0xe863('0x42')]+0x1,'app':_0xe863('0x4c'),'appdata':_0xe863('0x4d'),'interval':_0xe863('0x4e')});}_0x266b6d['created']=!![];}else{_0x266b6d[_0xe863('0x4f')]=![];}_0x435684[_0xe863('0x50')]=_0x266b6d;return db[_0xe863('0x51')][_0xe863('0x45')]({'body':_0x2235d4[_0xe863('0x30')][_0xe863('0x30')],'FaxAccountId':_0x2235d4[_0xe863('0x37')]['id'],'FaxInteractionId':_0x1bf4b0['id'],'direction':'in','ContactId':_0x1bf4b0[_0xe863('0x52')],'AttachmentId':_0x2235d4['body']['AttachmentId']});})[_0xe863('0x11')](function(_0x3262d8){_0x435684[_0xe863('0x19')]=_0x3262d8;if(_0x435684[_0xe863('0x50')][_0xe863('0x53')]){return db[_0xe863('0x54')][_0xe863('0x36')]({'attributes':['id',_0xe863('0x55')],'where':{'id':_0x435684['interaction'][_0xe863('0x53')]}})[_0xe863('0x11')](function(_0x3a47b1){if(_0x3a47b1){_0x435684[_0xe863('0x3d')][_0xe863('0x56')]({'id':0x0,'priority':0x0,'app':_0xe863('0x57'),'appdata':_0x3a47b1[_0xe863('0x55')]+','+(_0x435684[_0xe863('0x37')][_0xe863('0x58')]||0xa),'interval':_0xe863('0x4e')});}return respondWithRpcPromise(_0xe863('0x59'),_0xe863('0x5a'),_0x435684);});}return respondWithRpcPromise(_0xe863('0x59'),_0xe863('0x5a'),_0x435684);})[_0xe863('0x11')](function(_0x57f13d){_0x547fc9(_0x57f13d);})['catch'](function(_0x532587){_0x2a53a0(_0x588ec1[_0xe863('0x17')](0x1f4,_0x532587[_0xe863('0x19')]));});});}; \ No newline at end of file +var _0x4c7f=['updatedAt','difference','CompanyId','ListId','isNil','from','ValidationError','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','list','applications','orderBy','priority','length','FaxInteraction','create','Contact\x20not\x20found','close','unmanaged','created','interaction','ContactId','UserId','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','FaxAccount,\x20%s,\x20%s','result','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','body','fax','CmContact','describe','Sequelize','no\x20available\x20attributes','keys','createdAt'];(function(_0x56b71e,_0x3858d0){var _0x22623a=function(_0x1f1074){while(--_0x1f1074){_0x56b71e['push'](_0x56b71e['shift']());}};_0x22623a(++_0x3858d0);}(_0x4c7f,0x7e));var _0xf4c7=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x4c7f[_0x3d42d8];return _0x27fc41;};'use strict';var _=require('lodash');var util=require(_0xf4c7('0x0'));var moment=require(_0xf4c7('0x1'));var BPromise=require(_0xf4c7('0x2'));var rs=require(_0xf4c7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf4c7('0x4'))['db'];var utils=require(_0xf4c7('0x5'));var logger=require(_0xf4c7('0x6'))(_0xf4c7('0x7'));var config=require(_0xf4c7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf4c7('0x9')]['http']({'port':0x232c});config[_0xf4c7('0xa')]=_[_0xf4c7('0xb')](config[_0xf4c7('0xa')],{'host':_0xf4c7('0xc'),'port':0x18eb});var socket=require(_0xf4c7('0xd'))(new Redis(config['redis']));require(_0xf4c7('0xe'))[_0xf4c7('0xf')](socket);function respondWithRpcPromise(_0x52d05c,_0x285cbc,_0x4d6fa3){return new BPromise(function(_0x3d9d51,_0x344116){return client[_0xf4c7('0x10')](_0x52d05c,_0x4d6fa3)[_0xf4c7('0x11')](function(_0x1f6984){logger['info']('FaxAccount,\x20%s,\x20%s',_0x285cbc,'request\x20sent');logger[_0xf4c7('0x12')](_0xf4c7('0x13'),_0x285cbc,_0xf4c7('0x14'),JSON[_0xf4c7('0x15')](_0x1f6984));if(_0x1f6984[_0xf4c7('0x16')]){if(_0x1f6984[_0xf4c7('0x16')][_0xf4c7('0x17')]===0x1f4){logger[_0xf4c7('0x16')]('FaxAccount,\x20%s,\x20%s',_0x285cbc,_0x1f6984['error']['message']);return _0x344116(_0x1f6984[_0xf4c7('0x16')][_0xf4c7('0x18')]);}logger[_0xf4c7('0x16')]('FaxAccount,\x20%s,\x20%s',_0x285cbc,_0x1f6984[_0xf4c7('0x16')][_0xf4c7('0x18')]);return _0x3d9d51(_0x1f6984[_0xf4c7('0x16')][_0xf4c7('0x18')]);}else{logger[_0xf4c7('0x19')](_0xf4c7('0x1a'),_0x285cbc,_0xf4c7('0x14'));_0x3d9d51(_0x1f6984[_0xf4c7('0x1b')]['message']);}})['catch'](function(_0x1a7546){logger[_0xf4c7('0x16')](_0xf4c7('0x1a'),_0x285cbc,_0x1a7546);_0x344116(_0x1a7546);});});}exports[_0xf4c7('0x1c')]=function(_0x3b38c9){var _0x2bff67=this;return new Promise(function(_0x2bf5a4,_0xe9aacf){return db[_0xf4c7('0x1d')][_0xf4c7('0x1e')]({'raw':_0x3b38c9[_0xf4c7('0x1f')]?_0x3b38c9['options'][_0xf4c7('0x20')]===undefined?!![]:![]:!![],'where':_0x3b38c9['options']?_0x3b38c9[_0xf4c7('0x1f')][_0xf4c7('0x21')]||null:null,'attributes':_0x3b38c9[_0xf4c7('0x1f')]?_0x3b38c9['options'][_0xf4c7('0x22')]||null:null,'limit':_0x3b38c9[_0xf4c7('0x1f')]?_0x3b38c9[_0xf4c7('0x1f')][_0xf4c7('0x23')]||null:null,'include':_0x3b38c9[_0xf4c7('0x1f')]?_0x3b38c9[_0xf4c7('0x1f')][_0xf4c7('0x24')]?_[_0xf4c7('0x25')](_0x3b38c9['options'][_0xf4c7('0x24')],function(_0x1093e6){return{'model':db[_0x1093e6['model']],'as':_0x1093e6['as'],'attributes':_0x1093e6[_0xf4c7('0x22')],'include':_0x1093e6[_0xf4c7('0x24')]?_['map'](_0x1093e6[_0xf4c7('0x24')],function(_0x64a2bd){return{'model':db[_0x64a2bd[_0xf4c7('0x26')]],'as':_0x64a2bd['as'],'attributes':_0x64a2bd[_0xf4c7('0x22')],'include':_0x64a2bd[_0xf4c7('0x24')]?_['map'](_0x64a2bd[_0xf4c7('0x24')],function(_0xad8cf3){return{'model':db[_0xad8cf3[_0xf4c7('0x26')]],'as':_0xad8cf3['as'],'attributes':_0xad8cf3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e0ab7){logger[_0xf4c7('0x19')](_0xf4c7('0x1c'),_0x3b38c9);logger[_0xf4c7('0x12')](_0xf4c7('0x1c'),_0x3b38c9,JSON['stringify'](_0x5e0ab7));_0x2bf5a4(_0x5e0ab7);})[_0xf4c7('0x27')](function(_0x28c79b){logger[_0xf4c7('0x16')](_0xf4c7('0x1c'),_0x28c79b[_0xf4c7('0x18')],_0x3b38c9);_0xe9aacf(_0x2bff67[_0xf4c7('0x16')](0x1f4,_0x28c79b[_0xf4c7('0x18')]));});});};exports['NotifyFaxAccount']=function(_0x522026,_0x4bf364,_0x325e8c){var _0x2f9129=this;return new Promise(function(_0x32602c,_0x4798a8){var _0x54b573={'body':_0x522026[_0xf4c7('0x28')],'channel':_0xf4c7('0x29')};var _0x353aaa=[];var _0x3af270=[];var _0x1f0f75={};return db[_0xf4c7('0x2a')][_0xf4c7('0x2b')]()[_0xf4c7('0x11')](function(_0x454346){if(!_0x454346){throw new db[(_0xf4c7('0x2c'))]['ValidationError'](_0xf4c7('0x2d'));}_0x353aaa=_['difference'](_[_0xf4c7('0x2e')](_0x454346),[_0xf4c7('0x2f'),_0xf4c7('0x30')]);_0x3af270=_[_0xf4c7('0x31')](_['keys'](_0x454346),['createdAt',_0xf4c7('0x30'),_0xf4c7('0x32'),_0xf4c7('0x33')]);if(_0x522026[_0xf4c7('0x28')]['id']){delete _0x522026[_0xf4c7('0x28')]['id'];}if(_[_0xf4c7('0x34')](_0x522026[_0xf4c7('0x28')][_0xf4c7('0x35')])){throw new db[(_0xf4c7('0x2c'))][(_0xf4c7('0x36'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x522026[_0xf4c7('0x28')]['body'])||_0x522026['body'][_0xf4c7('0x28')]===''){throw new db[(_0xf4c7('0x2c'))][(_0xf4c7('0x36'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf4c7('0x34')](_0x522026[_0xf4c7('0x28')][_0xf4c7('0x37')])){throw new db[(_0xf4c7('0x2c'))][(_0xf4c7('0x36'))](_0xf4c7('0x38')+_0x3af270);}if(!_['includes'](_0x3af270,_0x522026[_0xf4c7('0x28')]['mapKey'])){throw new db[(_0xf4c7('0x2c'))][(_0xf4c7('0x36'))](_0xf4c7('0x39')+_0x3af270);}_0x1f0f75[_0x522026[_0xf4c7('0x28')]['mapKey']]=_0x522026['body']['from'];})[_0xf4c7('0x11')](function(){return db[_0xf4c7('0x1d')][_0xf4c7('0x3a')]({'where':{'id':_0x522026[_0xf4c7('0x3b')]['id']},'include':[{'model':db[_0xf4c7('0x3c')],'as':_0xf4c7('0x3d'),'include':[{'model':db[_0xf4c7('0x2a')],'as':_0xf4c7('0x3e'),'where':_0x1f0f75,'limit':0x1,'order':[[_0xf4c7('0x30'),_0xf4c7('0x3f')]]}]},{'model':db[_0xf4c7('0x40')],'as':_0xf4c7('0x41')}]});})['then'](function(_0x3038d9){if(_0x3038d9&&_0x3038d9[_0xf4c7('0x3d')]){var _0x16edb7=_0x3038d9['get']({'plain':!![]});_0x54b573[_0xf4c7('0x3b')]=_0x16edb7;_0x54b573['applications']=_0x16edb7['Applications'];_0x54b573[_0xf4c7('0x42')]=_0x16edb7[_0xf4c7('0x3d')];_0x54b573[_0xf4c7('0x43')]=_[_0xf4c7('0x44')](_0x54b573['applications'],[_0xf4c7('0x45')],['asc']);if(_0x54b573[_0xf4c7('0x3b')][_0xf4c7('0x41')]){delete _0x54b573[_0xf4c7('0x3b')][_0xf4c7('0x41')];}if(_0x54b573[_0xf4c7('0x3b')][_0xf4c7('0x3d')]&&_0x54b573[_0xf4c7('0x3b')][_0xf4c7('0x3d')][_0xf4c7('0x3e')][_0xf4c7('0x46')]){return _0x54b573[_0xf4c7('0x3b')][_0xf4c7('0x3d')][_0xf4c7('0x3e')][0x0];}var _0x34da34=_['defaults'](_0x522026[_0xf4c7('0x28')],{'firstName':_0x522026['body'][_0xf4c7('0x35')],'ListId':_0x16edb7[_0xf4c7('0x33')]});_0x34da34[_0x522026[_0xf4c7('0x28')][_0xf4c7('0x37')]]=_0x522026[_0xf4c7('0x28')][_0xf4c7('0x35')];return db[_0xf4c7('0x2a')]['create'](_0x34da34,{'fields':_0x353aaa,'raw':!![]});}})[_0xf4c7('0x11')](function(_0x44728f){_0x54b573['contact']=_0x44728f;if(_0x44728f){var _0x381041={'ContactId':_0x44728f['id'],'FaxAccountId':_0x522026[_0xf4c7('0x3b')]['id'],'fax':_0x44728f[_0xf4c7('0x29')]};return db[_0xf4c7('0x47')][_0xf4c7('0x3a')]({'where':{'ContactId':_0x44728f['id'],'closed':![],'FaxAccountId':_0x522026[_0xf4c7('0x3b')]['id']}})[_0xf4c7('0x11')](function(_0x2533a2){if(_0x2533a2){return[_0x2533a2,![]];}return db[_0xf4c7('0x47')][_0xf4c7('0x48')](_0x381041)['then'](function(_0x4cef7f){return[_0x4cef7f,!![]];});});}else{throw new Error(_0xf4c7('0x49'));}})['spread'](function(_0x301dd9,_0x3005eb){var _0x5e70bd=_0x301dd9['get']({'plain':!![]});if(_0x3005eb){if(_0x54b573['account']['autoclose']){_0x54b573[_0xf4c7('0x43')]['push']({'id':0x0,'priority':_0x54b573[_0xf4c7('0x43')][_0xf4c7('0x46')]+0x1,'app':_0xf4c7('0x4a'),'appdata':_0xf4c7('0x4b'),'interval':'*,*,*,*'});}_0x5e70bd[_0xf4c7('0x4c')]=!![];}else{_0x5e70bd[_0xf4c7('0x4c')]=![];}_0x54b573[_0xf4c7('0x4d')]=_0x5e70bd;return db['FaxMessage']['create']({'body':_0x522026['body'][_0xf4c7('0x28')],'FaxAccountId':_0x522026[_0xf4c7('0x3b')]['id'],'FaxInteractionId':_0x301dd9['id'],'direction':'in','ContactId':_0x301dd9[_0xf4c7('0x4e')],'AttachmentId':_0x522026['body']['AttachmentId']});})[_0xf4c7('0x11')](function(_0x31497b){_0x54b573[_0xf4c7('0x18')]=_0x31497b;if(_0x54b573['interaction'][_0xf4c7('0x4f')]){return db['User']['find']({'attributes':['id',_0xf4c7('0x50')],'where':{'id':_0x54b573[_0xf4c7('0x4d')]['UserId']}})['then'](function(_0x5db205){if(_0x5db205){_0x54b573[_0xf4c7('0x43')][_0xf4c7('0x51')]({'id':0x0,'priority':0x0,'app':_0xf4c7('0x52'),'appdata':_0x5db205['name']+','+(_0x54b573['account'][_0xf4c7('0x53')]||0xa),'interval':_0xf4c7('0x54')});}return respondWithRpcPromise('Start','startRouting',_0x54b573);});}return respondWithRpcPromise(_0xf4c7('0x55'),_0xf4c7('0x56'),_0x54b573);})['then'](function(_0x2da7fd){_0x32602c(_0x2da7fd);})[_0xf4c7('0x27')](function(_0x460af0){_0x4798a8(_0x2f9129[_0xf4c7('0x16')](0x1f4,_0x460af0[_0xf4c7('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index ba58278..a9d89d5 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 _0x540a=['faxAccount:','save','remove','update','removeListener','register'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x540a,0x169));var _0xa540=function(_0x3d46fb,_0x3af1ad){_0x3d46fb=_0x3d46fb-0x0;var _0x59a402=_0x540a[_0x3d46fb];return _0x59a402;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xa540('0x0'),_0xa540('0x1'),_0xa540('0x2')];function createListener(_0xb6293b,_0x3647bf){return function(_0x49cedb){_0x3647bf['emit'](_0xb6293b,_0x49cedb);};}function removeListener(_0x33b47e,_0x4abba3){return function(){FaxAccountEvents[_0xa540('0x3')](_0x33b47e,_0x4abba3);};}exports[_0xa540('0x4')]=function(_0x178361){for(var _0x562bb7=0x0,_0x5d80a6=events['length'];_0x562bb7<_0x5d80a6;_0x562bb7++){var _0x28281f=events[_0x562bb7];var _0x4c7166=createListener(_0xa540('0x5')+_0x28281f,_0x178361);FaxAccountEvents['on'](_0x28281f,_0x4c7166);}}; \ No newline at end of file +var _0xde9c=['length','faxAccount:','./faxAccount.events','remove','update','emit','removeListener','register'];(function(_0x376226,_0x430f59){var _0x51fa58=function(_0x546ab4){while(--_0x546ab4){_0x376226['push'](_0x376226['shift']());}};_0x51fa58(++_0x430f59);}(_0xde9c,0x152));var _0xcde9=function(_0x5ebbef,_0x76675c){_0x5ebbef=_0x5ebbef-0x0;var _0x195422=_0xde9c[_0x5ebbef];return _0x195422;};'use strict';var FaxAccountEvents=require(_0xcde9('0x0'));var events=['save',_0xcde9('0x1'),_0xcde9('0x2')];function createListener(_0x167d8b,_0x2b9c26){return function(_0x151f89){_0x2b9c26[_0xcde9('0x3')](_0x167d8b,_0x151f89);};}function removeListener(_0x31b100,_0x20006e){return function(){FaxAccountEvents[_0xcde9('0x4')](_0x31b100,_0x20006e);};}exports[_0xcde9('0x5')]=function(_0x2654fb){for(var _0x285e71=0x0,_0x35354d=events[_0xcde9('0x6')];_0x285e71<_0x35354d;_0x285e71++){var _0x4987a3=events[_0x285e71];var _0x53b45d=createListener(_0xcde9('0x7')+_0x4987a3,_0x2654fb);FaxAccountEvents['on'](_0x4987a3,_0x53b45d);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 96dd6c4..72f8035 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 _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x3600e4,_0x215e86){var _0x494bfa=function(_0x27c571){while(--_0x27c571){_0x3600e4['push'](_0x3600e4['shift']());}};_0x494bfa(++_0x215e86);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x373afd,_0x4afa02){var _0x48a7a9=function(_0x5787ce){while(--_0x5787ce){_0x373afd['push'](_0x373afd['shift']());}};_0x48a7a9(++_0x4afa02);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 73d0825..b483be9 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 _0x925d=['TEXT','exports','STRING'];(function(_0xc18ce1,_0x329f9b){var _0x12ea8b=function(_0x1cac01){while(--_0x1cac01){_0xc18ce1['push'](_0xc18ce1['shift']());}};_0x12ea8b(++_0x329f9b);}(_0x925d,0x1c0));var _0xd925=function(_0x39f452,_0x4de63f){_0x39f452=_0x39f452-0x0;var _0x55963c=_0x925d[_0x39f452];return _0x55963c;};'use strict';var Sequelize=require('sequelize');module[_0xd925('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xd925('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xd925('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xd925('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xb8c8=['sequelize','STRING','noop','TEXT','*,*,*,*'];(function(_0x2b3d7d,_0x55a11e){var _0x137475=function(_0x42949c){while(--_0x42949c){_0x2b3d7d['push'](_0x2b3d7d['shift']());}};_0x137475(++_0x55a11e);}(_0xb8c8,0xb4));var _0x8b8c=function(_0x2d6a45,_0x318b2d){_0x2d6a45=_0x2d6a45-0x0;var _0x1f5734=_0xb8c8[_0x2d6a45];return _0x1f5734;};'use strict';var Sequelize=require(_0x8b8c('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x8b8c('0x1')],'allowNull':![],'defaultValue':_0x8b8c('0x2')},'appdata':{'type':Sequelize[_0x8b8c('0x3')]()},'description':{'type':Sequelize[_0x8b8c('0x1')]},'interval':{'type':Sequelize[_0x8b8c('0x1')],'defaultValue':_0x8b8c('0x4')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 255eeb2..af625f0 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 _0xd74a=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','options','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','name','index','map','FaxApplication','fieldName','type','key','model','query'];(function(_0x3df871,_0xda2e11){var _0x570f7b=function(_0xfaac78){while(--_0xfaac78){_0x3df871['push'](_0x3df871['shift']());}};_0x570f7b(++_0xda2e11);}(_0xd74a,0x147));var _0xad74=function(_0x23adc4,_0x4cbe3c){_0x23adc4=_0x23adc4-0x0;var _0x7242a9=_0xd74a[_0x23adc4];return _0x7242a9;};'use strict';var emlformat=require(_0xad74('0x0'));var rimraf=require(_0xad74('0x1'));var zipdir=require(_0xad74('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xad74('0x3'));var moment=require(_0xad74('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xad74('0x5'));var path=require(_0xad74('0x6'));var sox=require('sox');var csv=require(_0xad74('0x7'));var ejs=require(_0xad74('0x8'));var fs=require('fs');var fs_extra=require(_0xad74('0x9'));var _=require(_0xad74('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xad74('0xb'));var deskjs=require(_0xad74('0xc'));var toCsv=require(_0xad74('0x7'));var querystring=require(_0xad74('0xd'));var Papa=require('papaparse');var Redis=require(_0xad74('0xe'));var authService=require(_0xad74('0xf'));var qs=require(_0xad74('0x10'));var as=require(_0xad74('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xad74('0x12'))(_0xad74('0x13'));var utils=require(_0xad74('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xad74('0x15'));var db=require(_0xad74('0x16'))['db'];function respondWithStatusCode(_0x210f25,_0x59dd1a){_0x59dd1a=_0x59dd1a||0xcc;return function(_0x2a3244){if(_0x2a3244){return _0x210f25['sendStatus'](_0x59dd1a);}return _0x210f25[_0xad74('0x17')](_0x59dd1a)[_0xad74('0x18')]();};}function respondWithResult(_0x37596c,_0x40644c){_0x40644c=_0x40644c||0xc8;return function(_0x101a6a){if(_0x101a6a){return _0x37596c['status'](_0x40644c)['json'](_0x101a6a);}};}function respondWithFilteredResult(_0x33fdd6,_0x3a0c9e){return function(_0x2f5ca5){if(_0x2f5ca5){var _0x471319=typeof _0x3a0c9e['offset']==='undefined'&&typeof _0x3a0c9e['limit']===_0xad74('0x19');var _0xb45cc2=_0x2f5ca5[_0xad74('0x1a')];var _0x5081d2=_0x471319?0x0:_0x3a0c9e[_0xad74('0x1b')];var _0x22685b=_0x471319?_0x2f5ca5['count']:_0x3a0c9e[_0xad74('0x1b')]+_0x3a0c9e[_0xad74('0x1c')];var _0x57644a;if(_0x22685b>=_0xb45cc2){_0x22685b=_0xb45cc2;_0x57644a=0xc8;}else{_0x57644a=0xce;}_0x33fdd6[_0xad74('0x17')](_0x57644a);return _0x33fdd6[_0xad74('0x1d')](_0xad74('0x1e'),_0x5081d2+'-'+_0x22685b+'/'+_0xb45cc2)[_0xad74('0x1f')](_0x2f5ca5);}return null;};}function patchUpdates(_0x165b82){return function(_0x2b6592){try{jsonpatch[_0xad74('0x20')](_0x2b6592,_0x165b82,!![]);}catch(_0x1cc9b1){return BPromise[_0xad74('0x21')](_0x1cc9b1);}return _0x2b6592['save']();};}function saveUpdates(_0x68373f,_0x2c2ba2){return function(_0x2be4b2){if(_0x2be4b2){return _0x2be4b2[_0xad74('0x22')](_0x68373f)[_0xad74('0x23')](function(_0x2716af){return _0x2716af;});}return null;};}function removeEntity(_0x56561c,_0xeaad3){return function(_0xb6833e){if(_0xb6833e){return _0xb6833e[_0xad74('0x24')]()[_0xad74('0x23')](function(){_0x56561c[_0xad74('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24b5a2,_0x1a7a34){return function(_0x2c8a30){if(!_0x2c8a30){_0x24b5a2[_0xad74('0x25')](0x194);}return _0x2c8a30;};}function handleError(_0x3edc32,_0x4a6ffa){_0x4a6ffa=_0x4a6ffa||0x1f4;return function(_0x2a6cc1){logger[_0xad74('0x26')](_0x2a6cc1['stack']);if(_0x2a6cc1['name']){delete _0x2a6cc1[_0xad74('0x27')];}_0x3edc32[_0xad74('0x17')](_0x4a6ffa)['send'](_0x2a6cc1);};}exports[_0xad74('0x28')]=function(_0x4c1bae,_0x2a200b){var _0x1d34ba={},_0x6bd007={},_0x10d327={'count':0x0,'rows':[]};var _0xf3fb79=_[_0xad74('0x29')](db[_0xad74('0x2a')]['rawAttributes'],function(_0x5046ca){return{'name':_0x5046ca[_0xad74('0x2b')],'type':_0x5046ca[_0xad74('0x2c')][_0xad74('0x2d')]};});_0x6bd007[_0xad74('0x2e')]=_['map'](_0xf3fb79,_0xad74('0x27'));_0x6bd007[_0xad74('0x2f')]=_[_0xad74('0x30')](_0x4c1bae[_0xad74('0x2f')]);_0x6bd007[_0xad74('0x31')]=_[_0xad74('0x32')](_0x6bd007[_0xad74('0x2e')],_0x6bd007['query']);_0x1d34ba[_0xad74('0x33')]=_[_0xad74('0x32')](_0x6bd007[_0xad74('0x2e')],qs[_0xad74('0x34')](_0x4c1bae['query'][_0xad74('0x34')]));_0x1d34ba[_0xad74('0x33')]=_0x1d34ba[_0xad74('0x33')][_0xad74('0x35')]?_0x1d34ba[_0xad74('0x33')]:_0x6bd007[_0xad74('0x2e')];if(!_0x4c1bae[_0xad74('0x2f')][_0xad74('0x36')](_0xad74('0x37'))){_0x1d34ba[_0xad74('0x1c')]=qs['limit'](_0x4c1bae[_0xad74('0x2f')][_0xad74('0x1c')]);_0x1d34ba[_0xad74('0x1b')]=qs[_0xad74('0x1b')](_0x4c1bae[_0xad74('0x2f')][_0xad74('0x1b')]);}_0x1d34ba[_0xad74('0x38')]=qs[_0xad74('0x39')](_0x4c1bae[_0xad74('0x2f')]['sort']);_0x1d34ba[_0xad74('0x3a')]=qs['filters'](_[_0xad74('0x3b')](_0x4c1bae[_0xad74('0x2f')],_0x6bd007['filters']),_0xf3fb79);if(_0x4c1bae['query'][_0xad74('0x3c')]){_0x1d34ba['where']=_['merge'](_0x1d34ba['where'],{'$or':_[_0xad74('0x29')](_0xf3fb79,function(_0x5ee2c3){if(_0x5ee2c3[_0xad74('0x2c')]!==_0xad74('0x3d')){var _0x1d6bae={};_0x1d6bae[_0x5ee2c3[_0xad74('0x27')]]={'$like':'%'+_0x4c1bae[_0xad74('0x2f')]['filter']+'%'};return _0x1d6bae;}})});}_0x1d34ba=_['merge']({},_0x1d34ba,_0x4c1bae['options']);var _0x768b1c={'where':_0x1d34ba['where']};return db[_0xad74('0x2a')][_0xad74('0x1a')](_0x768b1c)[_0xad74('0x23')](function(_0x5c1b2c){_0x10d327[_0xad74('0x1a')]=_0x5c1b2c;if(_0x4c1bae[_0xad74('0x2f')][_0xad74('0x3e')]){_0x1d34ba[_0xad74('0x3f')]=[{'all':!![]}];}return db[_0xad74('0x2a')][_0xad74('0x40')](_0x1d34ba);})[_0xad74('0x23')](function(_0x36c2fe){_0x10d327[_0xad74('0x41')]=_0x36c2fe;return _0x10d327;})[_0xad74('0x23')](respondWithFilteredResult(_0x2a200b,_0x1d34ba))[_0xad74('0x42')](handleError(_0x2a200b,null));};exports[_0xad74('0x43')]=function(_0x1e8f41,_0x595aa1){var _0x4cf1a7={'raw':!![],'where':{'id':_0x1e8f41[_0xad74('0x44')]['id']}},_0x2a3c3f={};_0x2a3c3f[_0xad74('0x2e')]=_[_0xad74('0x30')](db['FaxApplication'][_0xad74('0x45')]);_0x2a3c3f[_0xad74('0x2f')]=_[_0xad74('0x30')](_0x1e8f41[_0xad74('0x2f')]);_0x2a3c3f[_0xad74('0x31')]=_[_0xad74('0x32')](_0x2a3c3f[_0xad74('0x2e')],_0x2a3c3f[_0xad74('0x2f')]);_0x4cf1a7[_0xad74('0x33')]=_[_0xad74('0x32')](_0x2a3c3f['model'],qs[_0xad74('0x34')](_0x1e8f41[_0xad74('0x2f')][_0xad74('0x34')]));_0x4cf1a7[_0xad74('0x33')]=_0x4cf1a7[_0xad74('0x33')][_0xad74('0x35')]?_0x4cf1a7['attributes']:_0x2a3c3f[_0xad74('0x2e')];if(_0x1e8f41['query'][_0xad74('0x3e')]){_0x4cf1a7[_0xad74('0x3f')]=[{'all':!![]}];}_0x4cf1a7=_[_0xad74('0x46')]({},_0x4cf1a7,_0x1e8f41[_0xad74('0x47')]);return db[_0xad74('0x2a')][_0xad74('0x48')](_0x4cf1a7)[_0xad74('0x23')](handleEntityNotFound(_0x595aa1,null))['then'](respondWithResult(_0x595aa1,null))[_0xad74('0x42')](handleError(_0x595aa1,null));};exports[_0xad74('0x49')]=function(_0x25e6a5,_0x5f5ad2){return db[_0xad74('0x2a')]['create'](_0x25e6a5[_0xad74('0x4a')],{})[_0xad74('0x23')](respondWithResult(_0x5f5ad2,0xc9))[_0xad74('0x42')](handleError(_0x5f5ad2,null));};exports[_0xad74('0x22')]=function(_0x4d745d,_0x277413){if(_0x4d745d[_0xad74('0x4a')]['id']){delete _0x4d745d[_0xad74('0x4a')]['id'];}return db[_0xad74('0x2a')][_0xad74('0x48')]({'where':{'id':_0x4d745d[_0xad74('0x44')]['id']}})['then'](handleEntityNotFound(_0x277413,null))[_0xad74('0x23')](saveUpdates(_0x4d745d[_0xad74('0x4a')],null))['then'](respondWithResult(_0x277413,null))[_0xad74('0x42')](handleError(_0x277413,null));};exports[_0xad74('0x24')]=function(_0x2d61eb,_0x355234){return db[_0xad74('0x2a')][_0xad74('0x48')]({'where':{'id':_0x2d61eb['params']['id']}})[_0xad74('0x23')](handleEntityNotFound(_0x355234,null))[_0xad74('0x23')](removeEntity(_0x355234,null))[_0xad74('0x42')](handleError(_0x355234,null));}; \ No newline at end of file +var _0xac1f=['bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','then','stack','name','map','FaxApplication','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','find','create','body','update','eml-format','fast-json-patch'];(function(_0x3a35f1,_0x52e050){var _0x5bdca8=function(_0x48217e){while(--_0x48217e){_0x3a35f1['push'](_0x3a35f1['shift']());}};_0x5bdca8(++_0x52e050);}(_0xac1f,0x17e));var _0xfac1=function(_0x509bc7,_0x1fb56b){_0x509bc7=_0x509bc7-0x0;var _0x15c686=_0xac1f[_0x509bc7];return _0x15c686;};'use strict';var emlformat=require(_0xfac1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfac1('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfac1('0x2'));var Mustache=require(_0xfac1('0x3'));var util=require(_0xfac1('0x4'));var path=require('path');var sox=require(_0xfac1('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfac1('0x6'));var _=require(_0xfac1('0x7'));var squel=require(_0xfac1('0x8'));var crypto=require(_0xfac1('0x9'));var jsforce=require(_0xfac1('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xfac1('0xb'));var querystring=require('querystring');var Papa=require(_0xfac1('0xc'));var Redis=require(_0xfac1('0xd'));var authService=require(_0xfac1('0xe'));var qs=require(_0xfac1('0xf'));var as=require(_0xfac1('0x10'));var hardwareService=require(_0xfac1('0x11'));var logger=require(_0xfac1('0x12'))(_0xfac1('0x13'));var utils=require('../../config/utils');var config=require(_0xfac1('0x14'));var licenseUtil=require(_0xfac1('0x15'));var db=require(_0xfac1('0x16'))['db'];function respondWithStatusCode(_0x51cb2f,_0x2db771){_0x2db771=_0x2db771||0xcc;return function(_0x3b998f){if(_0x3b998f){return _0x51cb2f[_0xfac1('0x17')](_0x2db771);}return _0x51cb2f[_0xfac1('0x18')](_0x2db771)['end']();};}function respondWithResult(_0x294a9e,_0x2d8dd1){_0x2d8dd1=_0x2d8dd1||0xc8;return function(_0x5c64cc){if(_0x5c64cc){return _0x294a9e[_0xfac1('0x18')](_0x2d8dd1)['json'](_0x5c64cc);}};}function respondWithFilteredResult(_0x3ebcd1,_0x4d4960){return function(_0x30ba69){if(_0x30ba69){var _0x4fa690=typeof _0x4d4960[_0xfac1('0x19')]===_0xfac1('0x1a')&&typeof _0x4d4960[_0xfac1('0x1b')]===_0xfac1('0x1a');var _0x2d94d5=_0x30ba69[_0xfac1('0x1c')];var _0x22237a=_0x4fa690?0x0:_0x4d4960['offset'];var _0x40b85e=_0x4fa690?_0x30ba69[_0xfac1('0x1c')]:_0x4d4960[_0xfac1('0x19')]+_0x4d4960[_0xfac1('0x1b')];var _0xebef45;if(_0x40b85e>=_0x2d94d5){_0x40b85e=_0x2d94d5;_0xebef45=0xc8;}else{_0xebef45=0xce;}_0x3ebcd1[_0xfac1('0x18')](_0xebef45);return _0x3ebcd1[_0xfac1('0x1d')](_0xfac1('0x1e'),_0x22237a+'-'+_0x40b85e+'/'+_0x2d94d5)['json'](_0x30ba69);}return null;};}function patchUpdates(_0x14f1fb){return function(_0x2fd264){try{jsonpatch[_0xfac1('0x1f')](_0x2fd264,_0x14f1fb,!![]);}catch(_0x58702c){return BPromise['reject'](_0x58702c);}return _0x2fd264['save']();};}function saveUpdates(_0x3ef75f,_0x1b54c0){return function(_0x485c65){if(_0x485c65){return _0x485c65['update'](_0x3ef75f)[_0xfac1('0x20')](function(_0x4b90c3){return _0x4b90c3;});}return null;};}function removeEntity(_0x28c3cb,_0x4a5ccf){return function(_0x3fa217){if(_0x3fa217){return _0x3fa217['destroy']()['then'](function(){_0x28c3cb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x248c72,_0x1aad6f){return function(_0x4ad106){if(!_0x4ad106){_0x248c72[_0xfac1('0x17')](0x194);}return _0x4ad106;};}function handleError(_0x33ae33,_0x35388b){_0x35388b=_0x35388b||0x1f4;return function(_0x377cd3){logger['error'](_0x377cd3[_0xfac1('0x21')]);if(_0x377cd3[_0xfac1('0x22')]){delete _0x377cd3[_0xfac1('0x22')];}_0x33ae33[_0xfac1('0x18')](_0x35388b)['send'](_0x377cd3);};}exports['index']=function(_0x304443,_0x336cc1){var _0x35860d={},_0x5f107c={},_0x17be8f={'count':0x0,'rows':[]};var _0x3b7f4b=_[_0xfac1('0x23')](db[_0xfac1('0x24')]['rawAttributes'],function(_0x544d92){return{'name':_0x544d92['fieldName'],'type':_0x544d92[_0xfac1('0x25')]['key']};});_0x5f107c[_0xfac1('0x26')]=_[_0xfac1('0x23')](_0x3b7f4b,'name');_0x5f107c[_0xfac1('0x27')]=_[_0xfac1('0x28')](_0x304443[_0xfac1('0x27')]);_0x5f107c[_0xfac1('0x29')]=_[_0xfac1('0x2a')](_0x5f107c[_0xfac1('0x26')],_0x5f107c['query']);_0x35860d['attributes']=_[_0xfac1('0x2a')](_0x5f107c[_0xfac1('0x26')],qs[_0xfac1('0x2b')](_0x304443[_0xfac1('0x27')][_0xfac1('0x2b')]));_0x35860d[_0xfac1('0x2c')]=_0x35860d[_0xfac1('0x2c')][_0xfac1('0x2d')]?_0x35860d[_0xfac1('0x2c')]:_0x5f107c['model'];if(!_0x304443[_0xfac1('0x27')][_0xfac1('0x2e')]('nolimit')){_0x35860d[_0xfac1('0x1b')]=qs['limit'](_0x304443[_0xfac1('0x27')]['limit']);_0x35860d['offset']=qs['offset'](_0x304443[_0xfac1('0x27')][_0xfac1('0x19')]);}_0x35860d['order']=qs[_0xfac1('0x2f')](_0x304443[_0xfac1('0x27')]['sort']);_0x35860d[_0xfac1('0x30')]=qs['filters'](_[_0xfac1('0x31')](_0x304443[_0xfac1('0x27')],_0x5f107c[_0xfac1('0x29')]),_0x3b7f4b);if(_0x304443['query'][_0xfac1('0x32')]){_0x35860d[_0xfac1('0x30')]=_[_0xfac1('0x33')](_0x35860d[_0xfac1('0x30')],{'$or':_[_0xfac1('0x23')](_0x3b7f4b,function(_0x556f97){if(_0x556f97[_0xfac1('0x25')]!==_0xfac1('0x34')){var _0x34c0e8={};_0x34c0e8[_0x556f97[_0xfac1('0x22')]]={'$like':'%'+_0x304443['query'][_0xfac1('0x32')]+'%'};return _0x34c0e8;}})});}_0x35860d=_[_0xfac1('0x33')]({},_0x35860d,_0x304443[_0xfac1('0x35')]);var _0x13519b={'where':_0x35860d[_0xfac1('0x30')]};return db['FaxApplication'][_0xfac1('0x1c')](_0x13519b)[_0xfac1('0x20')](function(_0x7f8d4b){_0x17be8f[_0xfac1('0x1c')]=_0x7f8d4b;if(_0x304443[_0xfac1('0x27')][_0xfac1('0x36')]){_0x35860d[_0xfac1('0x37')]=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0x35860d);})[_0xfac1('0x20')](function(_0x2680cc){_0x17be8f[_0xfac1('0x38')]=_0x2680cc;return _0x17be8f;})[_0xfac1('0x20')](respondWithFilteredResult(_0x336cc1,_0x35860d))[_0xfac1('0x39')](handleError(_0x336cc1,null));};exports['show']=function(_0x3d38f1,_0x195876){var _0x187059={'raw':!![],'where':{'id':_0x3d38f1[_0xfac1('0x3a')]['id']}},_0x2fe828={};_0x2fe828['model']=_['keys'](db['FaxApplication'][_0xfac1('0x3b')]);_0x2fe828[_0xfac1('0x27')]=_['keys'](_0x3d38f1['query']);_0x2fe828[_0xfac1('0x29')]=_[_0xfac1('0x2a')](_0x2fe828[_0xfac1('0x26')],_0x2fe828['query']);_0x187059[_0xfac1('0x2c')]=_[_0xfac1('0x2a')](_0x2fe828['model'],qs['fields'](_0x3d38f1['query']['fields']));_0x187059['attributes']=_0x187059[_0xfac1('0x2c')][_0xfac1('0x2d')]?_0x187059[_0xfac1('0x2c')]:_0x2fe828[_0xfac1('0x26')];if(_0x3d38f1['query']['includeAll']){_0x187059[_0xfac1('0x37')]=[{'all':!![]}];}_0x187059=_[_0xfac1('0x33')]({},_0x187059,_0x3d38f1[_0xfac1('0x35')]);return db[_0xfac1('0x24')][_0xfac1('0x3c')](_0x187059)[_0xfac1('0x20')](handleEntityNotFound(_0x195876,null))[_0xfac1('0x20')](respondWithResult(_0x195876,null))[_0xfac1('0x39')](handleError(_0x195876,null));};exports[_0xfac1('0x3d')]=function(_0x191f7f,_0x565890){return db[_0xfac1('0x24')][_0xfac1('0x3d')](_0x191f7f[_0xfac1('0x3e')],{})[_0xfac1('0x20')](respondWithResult(_0x565890,0xc9))['catch'](handleError(_0x565890,null));};exports[_0xfac1('0x3f')]=function(_0x15ba97,_0x5ac12a){if(_0x15ba97[_0xfac1('0x3e')]['id']){delete _0x15ba97[_0xfac1('0x3e')]['id'];}return db[_0xfac1('0x24')][_0xfac1('0x3c')]({'where':{'id':_0x15ba97[_0xfac1('0x3a')]['id']}})[_0xfac1('0x20')](handleEntityNotFound(_0x5ac12a,null))[_0xfac1('0x20')](saveUpdates(_0x15ba97[_0xfac1('0x3e')],null))['then'](respondWithResult(_0x5ac12a,null))[_0xfac1('0x39')](handleError(_0x5ac12a,null));};exports['destroy']=function(_0x1af130,_0x243d54){return db[_0xfac1('0x24')][_0xfac1('0x3c')]({'where':{'id':_0x1af130['params']['id']}})[_0xfac1('0x20')](handleEntityNotFound(_0x243d54,null))[_0xfac1('0x20')](removeEntity(_0x243d54,null))[_0xfac1('0x39')](handleError(_0x243d54,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 1b94ff6..609d6e7 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 _0x5e0c=['path','rimraf','../../config/environment','exports','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x5e0c,0x89));var _0xc5e0=function(_0x32f616,_0x373411){_0x32f616=_0x32f616-0x0;var _0x52f6ee=_0x5e0c[_0x32f616];return _0x52f6ee;};'use strict';var _=require(_0xc5e0('0x0'));var util=require(_0xc5e0('0x1'));var logger=require('../../config/logger')(_0xc5e0('0x2'));var moment=require(_0xc5e0('0x3'));var BPromise=require(_0xc5e0('0x4'));var rp=require(_0xc5e0('0x5'));var fs=require('fs');var path=require(_0xc5e0('0x6'));var rimraf=require(_0xc5e0('0x7'));var config=require(_0xc5e0('0x8'));var attributes=require('./faxApplication.attributes');module[_0xc5e0('0x9')]=function(_0x1412e5,_0x3d6642){return _0x1412e5['define']('FaxApplication',attributes,{'tableName':_0xc5e0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc5e0('0xb'),'collate':_0xc5e0('0xc')});}; \ No newline at end of file +var _0x0323=['bluebird','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment'];(function(_0x245afe,_0x319cde){var _0x4eefde=function(_0x15a1fa){while(--_0x15a1fa){_0x245afe['push'](_0x245afe['shift']());}};_0x4eefde(++_0x319cde);}(_0x0323,0x168));var _0x3032=function(_0x5d12c5,_0x36a5d8){_0x5d12c5=_0x5d12c5-0x0;var _0x3ccedf=_0x0323[_0x5d12c5];return _0x3ccedf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3032('0x0'))(_0x3032('0x1'));var moment=require(_0x3032('0x2'));var BPromise=require(_0x3032('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3032('0x4'));var attributes=require(_0x3032('0x5'));module[_0x3032('0x6')]=function(_0x34b248,_0x21a608){return _0x34b248[_0x3032('0x7')](_0x3032('0x8'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3032('0x9'),'collate':_0x3032('0xa')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index a1aeedc..8dc4281 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 _0x5c39=['UpdateFaxApplication','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','FaxApplication','update','body','options','raw','where','attributes','then'];(function(_0x21bf0d,_0x91bf98){var _0x561491=function(_0x2e6102){while(--_0x2e6102){_0x21bf0d['push'](_0x21bf0d['shift']());}};_0x561491(++_0x91bf98);}(_0x5c39,0x82));var _0x95c3=function(_0x564463,_0x3db0f3){_0x564463=_0x564463-0x0;var _0x233061=_0x5c39[_0x564463];return _0x233061;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x95c3('0x0'));var BPromise=require(_0x95c3('0x1'));var rs=require(_0x95c3('0x2'));var fs=require('fs');var Redis=require(_0x95c3('0x3'));var db=require(_0x95c3('0x4'))['db'];var utils=require(_0x95c3('0x5'));var logger=require(_0x95c3('0x6'))('rpc');var config=require(_0x95c3('0x7'));var jayson=require(_0x95c3('0x8'));var client=jayson[_0x95c3('0x9')][_0x95c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24ed6c,_0x4f2abd,_0x106708){return new BPromise(function(_0x2143c5,_0x1140f3){return client[_0x95c3('0xb')](_0x24ed6c,_0x106708)['then'](function(_0x191dea){logger[_0x95c3('0xc')](_0x95c3('0xd'),_0x4f2abd,_0x95c3('0xe'));logger[_0x95c3('0xf')](_0x95c3('0x10'),_0x4f2abd,'request\x20sent',JSON[_0x95c3('0x11')](_0x191dea));if(_0x191dea[_0x95c3('0x12')]){if(_0x191dea[_0x95c3('0x12')][_0x95c3('0x13')]===0x1f4){logger[_0x95c3('0x12')]('FaxApplication,\x20%s,\x20%s',_0x4f2abd,_0x191dea[_0x95c3('0x12')][_0x95c3('0x14')]);return _0x1140f3(_0x191dea[_0x95c3('0x12')]['message']);}logger[_0x95c3('0x12')](_0x95c3('0xd'),_0x4f2abd,_0x191dea['error'][_0x95c3('0x14')]);return _0x2143c5(_0x191dea[_0x95c3('0x12')][_0x95c3('0x14')]);}else{logger[_0x95c3('0xc')](_0x95c3('0xd'),_0x4f2abd,_0x95c3('0xe'));_0x2143c5(_0x191dea[_0x95c3('0x15')][_0x95c3('0x14')]);}})['catch'](function(_0x200cb4){logger[_0x95c3('0x12')](_0x95c3('0xd'),_0x4f2abd,_0x200cb4);_0x1140f3(_0x200cb4);});});}exports['UpdateFaxApplication']=function(_0x5e0b33){var _0x3d4deb=this;return new Promise(function(_0x422eb6,_0x49fedf){return db[_0x95c3('0x16')][_0x95c3('0x17')](_0x5e0b33[_0x95c3('0x18')],{'raw':_0x5e0b33[_0x95c3('0x19')]?_0x5e0b33[_0x95c3('0x19')][_0x95c3('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e0b33[_0x95c3('0x19')]?_0x5e0b33[_0x95c3('0x19')][_0x95c3('0x1b')]||null:null,'attributes':_0x5e0b33[_0x95c3('0x19')]?_0x5e0b33[_0x95c3('0x19')][_0x95c3('0x1c')]||null:null,'limit':_0x5e0b33[_0x95c3('0x19')]?_0x5e0b33[_0x95c3('0x19')]['limit']||null:null})[_0x95c3('0x1d')](function(_0x2e872d){logger[_0x95c3('0xc')](_0x95c3('0x1e'),_0x5e0b33);logger['debug'](_0x95c3('0x1e'),_0x5e0b33,JSON[_0x95c3('0x11')](_0x2e872d));_0x422eb6(_0x2e872d);})[_0x95c3('0x1f')](function(_0x3ba725){logger[_0x95c3('0x12')](_0x95c3('0x1e'),_0x3ba725[_0x95c3('0x14')],_0x5e0b33);_0x49fedf(_0x3d4deb[_0x95c3('0x12')](0x1f4,_0x3ba725['message']));});});}; \ No newline at end of file +var _0x343f=['client','then','info','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','result','UpdateFaxApplication','FaxApplication','body','options','raw','attributes','limit','debug','catch','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x5bb0ba,_0x3a1803){var _0x551a4e=function(_0x46de11){while(--_0x46de11){_0x5bb0ba['push'](_0x5bb0ba['shift']());}};_0x551a4e(++_0x3a1803);}(_0x343f,0xb6));var _0xf343=function(_0x28570f,_0x5a645f){_0x28570f=_0x28570f-0x0;var _0x43bc5d=_0x343f[_0x28570f];return _0x43bc5d;};'use strict';var _=require(_0xf343('0x0'));var util=require('util');var moment=require(_0xf343('0x1'));var BPromise=require('bluebird');var rs=require(_0xf343('0x2'));var fs=require('fs');var Redis=require(_0xf343('0x3'));var db=require(_0xf343('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf343('0x5'));var config=require(_0xf343('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf343('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36d20b,_0x3c09ba,_0x3e83de){return new BPromise(function(_0x3d6e22,_0x14cde5){return client['request'](_0x36d20b,_0x3e83de)[_0xf343('0x8')](function(_0x3ab2d1){logger[_0xf343('0x9')]('FaxApplication,\x20%s,\x20%s',_0x3c09ba,_0xf343('0xa'));logger['debug'](_0xf343('0xb'),_0x3c09ba,_0xf343('0xa'),JSON[_0xf343('0xc')](_0x3ab2d1));if(_0x3ab2d1[_0xf343('0xd')]){if(_0x3ab2d1[_0xf343('0xd')][_0xf343('0xe')]===0x1f4){logger[_0xf343('0xd')](_0xf343('0xf'),_0x3c09ba,_0x3ab2d1['error'][_0xf343('0x10')]);return _0x14cde5(_0x3ab2d1[_0xf343('0xd')][_0xf343('0x10')]);}logger['error']('FaxApplication,\x20%s,\x20%s',_0x3c09ba,_0x3ab2d1['error']['message']);return _0x3d6e22(_0x3ab2d1[_0xf343('0xd')][_0xf343('0x10')]);}else{logger[_0xf343('0x9')]('FaxApplication,\x20%s,\x20%s',_0x3c09ba,'request\x20sent');_0x3d6e22(_0x3ab2d1[_0xf343('0x11')][_0xf343('0x10')]);}})['catch'](function(_0xa26b83){logger[_0xf343('0xd')]('FaxApplication,\x20%s,\x20%s',_0x3c09ba,_0xa26b83);_0x14cde5(_0xa26b83);});});}exports[_0xf343('0x12')]=function(_0x17eed6){var _0x242a66=this;return new Promise(function(_0x3148e0,_0x473bb4){return db[_0xf343('0x13')]['update'](_0x17eed6[_0xf343('0x14')],{'raw':_0x17eed6[_0xf343('0x15')]?_0x17eed6['options'][_0xf343('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17eed6[_0xf343('0x15')]?_0x17eed6[_0xf343('0x15')]['where']||null:null,'attributes':_0x17eed6[_0xf343('0x15')]?_0x17eed6[_0xf343('0x15')][_0xf343('0x17')]||null:null,'limit':_0x17eed6['options']?_0x17eed6[_0xf343('0x15')][_0xf343('0x18')]||null:null})['then'](function(_0x3152e7){logger[_0xf343('0x9')](_0xf343('0x12'),_0x17eed6);logger[_0xf343('0x19')](_0xf343('0x12'),_0x17eed6,JSON[_0xf343('0xc')](_0x3152e7));_0x3148e0(_0x3152e7);})[_0xf343('0x1a')](function(_0x59929b){logger[_0xf343('0xd')](_0xf343('0x12'),_0x59929b[_0xf343('0x10')],_0x17eed6);_0x473bb4(_0x242a66[_0xf343('0xd')](0x1f4,_0x59929b[_0xf343('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 2b9a555..7acd9a9 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 _0x6cb4=['get','/:id','show','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxApplication.controller','isAuthenticated'];(function(_0x2eaaa2,_0x54f04f){var _0x1d73b2=function(_0xa0fa76){while(--_0xa0fa76){_0x2eaaa2['push'](_0x2eaaa2['shift']());}};_0x1d73b2(++_0x54f04f);}(_0x6cb4,0xff));var _0x46cb=function(_0x25f64e,_0xa6023e){_0x25f64e=_0x25f64e-0x0;var _0x417f9b=_0x6cb4[_0x25f64e];return _0x417f9b;};'use strict';var multer=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var path=require(_0x46cb('0x2'));var timeout=require(_0x46cb('0x3'));var express=require(_0x46cb('0x4'));var router=express[_0x46cb('0x5')]();var fs_extra=require(_0x46cb('0x6'));var auth=require(_0x46cb('0x7'));var interaction=require(_0x46cb('0x8'));var config=require('../../config/environment');var controller=require(_0x46cb('0x9'));router['get']('/',auth[_0x46cb('0xa')](),controller['index']);router[_0x46cb('0xb')](_0x46cb('0xc'),auth[_0x46cb('0xa')](),controller[_0x46cb('0xd')]);router[_0x46cb('0xe')]('/',auth[_0x46cb('0xa')](),controller['create']);router[_0x46cb('0xf')](_0x46cb('0xc'),auth['isAuthenticated'](),controller[_0x46cb('0x10')]);router[_0x46cb('0x11')]('/:id',auth[_0x46cb('0xa')](),controller[_0x46cb('0x12')]);module['exports']=router; \ No newline at end of file +var _0x6324=['util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','update','delete','/:id','destroy','exports','multer'];(function(_0x2c0ee7,_0x5dd85b){var _0xcbc2f=function(_0x49376c){while(--_0x49376c){_0x2c0ee7['push'](_0x2c0ee7['shift']());}};_0xcbc2f(++_0x5dd85b);}(_0x6324,0x142));var _0x4632=function(_0x2deb01,_0x4e741c){_0x2deb01=_0x2deb01-0x0;var _0x3920b3=_0x6324[_0x2deb01];return _0x3920b3;};'use strict';var multer=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var path=require(_0x4632('0x2'));var timeout=require(_0x4632('0x3'));var express=require('express');var router=express[_0x4632('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4632('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4632('0x6'));var controller=require('./faxApplication.controller');router[_0x4632('0x7')]('/',auth[_0x4632('0x8')](),controller[_0x4632('0x9')]);router[_0x4632('0x7')]('/:id',auth[_0x4632('0x8')](),controller[_0x4632('0xa')]);router[_0x4632('0xb')]('/',auth['isAuthenticated'](),controller[_0x4632('0xc')]);router[_0x4632('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x4632('0xe')]);router[_0x4632('0xf')](_0x4632('0x10'),auth[_0x4632('0x8')](),controller[_0x4632('0x11')]);module[_0x4632('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 3eab4e3..5778109 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 _0x0bf1=['BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x3db1f7,_0x2beb9b){var _0x5016ed=function(_0x344ece){while(--_0x344ece){_0x3db1f7['push'](_0x3db1f7['shift']());}};_0x5016ed(++_0x2beb9b);}(_0x0bf1,0x1bb));var _0x10bf=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x0bf1[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x10bf('0x0'));module['exports']={'closed':{'type':Sequelize[_0x10bf('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x10bf('0x2')]},'disposition':{'type':Sequelize[_0x10bf('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x10bf('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x10bf('0x4')]('in',_0x10bf('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x10bf('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x29ef=['BOOLEAN','DATE','STRING','out','sequelize'];(function(_0x16295e,_0x4a9b05){var _0x2d9e54=function(_0x396291){while(--_0x396291){_0x16295e['push'](_0x16295e['shift']());}};_0x2d9e54(++_0x4a9b05);}(_0x29ef,0x16c));var _0xf29e=function(_0x6e1239,_0x3562ac){_0x6e1239=_0x6e1239-0x0;var _0x418150=_0x29ef[_0x6e1239];return _0x418150;};'use strict';var Sequelize=require(_0xf29e('0x0'));module['exports']={'closed':{'type':Sequelize[_0xf29e('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf29e('0x2')]},'disposition':{'type':Sequelize[_0xf29e('0x3')]},'secondDisposition':{'type':Sequelize[_0xf29e('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf29e('0x3')]},'read1stAt':{'type':Sequelize[_0xf29e('0x2')]},'fax':{'type':Sequelize[_0xf29e('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xf29e('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf29e('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xf29e('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index ee8223c..25aebcd 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 _0xe6dd=['Attachment','Messages','createdAt','get','basename','existsSync','createReadStream','pipe','createWriteStream','log','rimraf','zip-dir','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','update','then','error','stack','name','send','map','FaxInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','user','catch','show','params','model','keys','filters','query','intersection','fields','attributes','length','includeAll','include','merge','options','find','create','body','destroy','describe','addMessage','FaxMessage','omit','getMessages','findOne','nolimit','order','where','pick','FaxInteractionId','filter','split','format','YYYY-MM-DD\x20HH:mm:ss','setTags','ids','Tag','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','root','files','join','server','push'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0xe6dd,0xca));var _0xde6d=function(_0xefd4b5,_0x3a29ae){_0xefd4b5=_0xefd4b5-0x0;var _0xe4ee7d=_0xe6dd[_0xefd4b5];return _0xe4ee7d;};'use strict';var rimraf=require(_0xde6d('0x0'));var zipdir=require(_0xde6d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var util=require('util');var path=require(_0xde6d('0x2'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xde6d('0x3'));var interaction=require(_0xde6d('0x4'));var qs=require(_0xde6d('0x5'));var logger=require(_0xde6d('0x6'))(_0xde6d('0x7'));var config=require('../../config/environment');var db=require(_0xde6d('0x8'))['db'];config[_0xde6d('0x9')]=_[_0xde6d('0xa')](config['redis'],{'host':_0xde6d('0xb'),'port':0x18eb});var socket=require(_0xde6d('0xc'))(new Redis(config['redis']));require(_0xde6d('0xd'))['register'](socket);function respondWithStatusCode(_0x108326,_0x4abfdb){_0x4abfdb=_0x4abfdb||0xcc;return function(_0x5a728d){if(_0x5a728d){return _0x108326[_0xde6d('0xe')](_0x4abfdb);}return _0x108326['status'](_0x4abfdb)[_0xde6d('0xf')]();};}function respondWithResult(_0x18c246,_0xdcc15){_0xdcc15=_0xdcc15||0xc8;return function(_0x5e2a79){if(_0x5e2a79){return _0x18c246[_0xde6d('0x10')](_0xdcc15)[_0xde6d('0x11')](_0x5e2a79);}};}function respondWithFilteredResult(_0x4e00df,_0x359625){return function(_0x1f198e){if(_0x1f198e){var _0x411f5d=typeof _0x359625[_0xde6d('0x12')]===_0xde6d('0x13')&&typeof _0x359625[_0xde6d('0x14')]===_0xde6d('0x13');var _0x435312=_0x1f198e[_0xde6d('0x15')];var _0x478713=_0x411f5d?0x0:_0x359625['offset'];var _0x522bc6=_0x411f5d?_0x1f198e[_0xde6d('0x15')]:_0x359625[_0xde6d('0x12')]+_0x359625['limit'];var _0x19bda4;if(_0x522bc6>=_0x435312){_0x522bc6=_0x435312;_0x19bda4=0xc8;}else{_0x19bda4=0xce;}_0x4e00df[_0xde6d('0x10')](_0x19bda4);return _0x4e00df['set']('Content-Range',_0x478713+'-'+_0x522bc6+'/'+_0x435312)['json'](_0x1f198e);}return null;};}function saveUpdates(_0x101f8f){return function(_0x4da94f){if(_0x4da94f){return _0x4da94f[_0xde6d('0x16')](_0x101f8f)['then'](function(_0x4ea7cc){return _0x4ea7cc;});}return null;};}function removeEntity(_0x3d3ad2){return function(_0x2fcb3f){if(_0x2fcb3f){return _0x2fcb3f['destroy']()[_0xde6d('0x17')](function(){_0x3d3ad2[_0xde6d('0x10')](0xcc)[_0xde6d('0xf')]();});}};}function handleEntityNotFound(_0x130cde){return function(_0x25349a){if(!_0x25349a){_0x130cde['sendStatus'](0x194);}return _0x25349a;};}function handleError(_0x192b40,_0x347733){_0x347733=_0x347733||0x1f4;return function(_0x4d2ae4){logger[_0xde6d('0x18')](_0x4d2ae4[_0xde6d('0x19')]);if(_0x4d2ae4[_0xde6d('0x1a')]){delete _0x4d2ae4[_0xde6d('0x1a')];}_0x192b40[_0xde6d('0x10')](_0x347733)[_0xde6d('0x1b')](_0x4d2ae4);};}exports['index']=function(_0x519ab2,_0x2a4ab0){var _0xa4810={};var _0x15ca74=_[_0xde6d('0x1c')](db[_0xde6d('0x1d')][_0xde6d('0x1e')],function(_0x1f7db1){return{'name':_0x1f7db1[_0xde6d('0x1f')],'type':_0x1f7db1[_0xde6d('0x20')][_0xde6d('0x21')]};});_0xa4810=qs[_0xde6d('0x22')](_0x15ca74,_0x519ab2);return interaction[_0xde6d('0x23')]('fax',_0x519ab2['query'],_0x519ab2[_0xde6d('0x24')],_0xa4810,_0x15ca74)[_0xde6d('0x17')](respondWithFilteredResult(_0x2a4ab0,_0xa4810))[_0xde6d('0x25')](handleError(_0x2a4ab0,null));};exports[_0xde6d('0x26')]=function(_0x2bf16e,_0x1bf49f){var _0x597ce5={'raw':![],'where':{'id':_0x2bf16e[_0xde6d('0x27')]['id']}},_0x2cf2dd={};_0x2cf2dd[_0xde6d('0x28')]=_[_0xde6d('0x29')](db[_0xde6d('0x1d')][_0xde6d('0x1e')]);_0x2cf2dd['query']=_['keys'](_0x2bf16e['query']);_0x2cf2dd[_0xde6d('0x2a')]=_['intersection'](_0x2cf2dd['model'],_0x2cf2dd[_0xde6d('0x2b')]);_0x597ce5['attributes']=_[_0xde6d('0x2c')](_0x2cf2dd[_0xde6d('0x28')],qs['fields'](_0x2bf16e['query'][_0xde6d('0x2d')]));_0x597ce5[_0xde6d('0x2e')]=_0x597ce5[_0xde6d('0x2e')][_0xde6d('0x2f')]?_0x597ce5[_0xde6d('0x2e')]:_0x2cf2dd[_0xde6d('0x28')];if(_0x2bf16e['query'][_0xde6d('0x30')]){_0x597ce5[_0xde6d('0x31')]=[{'all':!![]}];}_0x597ce5=_[_0xde6d('0x32')]({},_0x597ce5,_0x2bf16e[_0xde6d('0x33')]);return db['FaxInteraction'][_0xde6d('0x34')](_0x597ce5)[_0xde6d('0x17')](handleEntityNotFound(_0x1bf49f,null))[_0xde6d('0x17')](respondWithResult(_0x1bf49f,null))[_0xde6d('0x25')](handleError(_0x1bf49f,null));};exports[_0xde6d('0x35')]=function(_0x3e5ec1,_0x2c9199){return db['FaxInteraction'][_0xde6d('0x35')](_0x3e5ec1[_0xde6d('0x36')],{})[_0xde6d('0x17')](respondWithResult(_0x2c9199,0xc9))[_0xde6d('0x25')](handleError(_0x2c9199,null));};exports[_0xde6d('0x16')]=function(_0x395514,_0x317dbc){if(_0x395514[_0xde6d('0x36')]['id']){delete _0x395514['body']['id'];}return db['FaxInteraction'][_0xde6d('0x34')]({'where':{'id':_0x395514[_0xde6d('0x27')]['id']}})[_0xde6d('0x17')](handleEntityNotFound(_0x317dbc,null))[_0xde6d('0x17')](saveUpdates(_0x395514[_0xde6d('0x36')],null))[_0xde6d('0x17')](respondWithResult(_0x317dbc,null))['catch'](handleError(_0x317dbc,null));};exports[_0xde6d('0x37')]=function(_0x30b2e0,_0x383b91){return db[_0xde6d('0x1d')][_0xde6d('0x34')]({'where':{'id':_0x30b2e0['params']['id']}})[_0xde6d('0x17')](handleEntityNotFound(_0x383b91,null))[_0xde6d('0x17')](removeEntity(_0x383b91,null))[_0xde6d('0x25')](handleError(_0x383b91,null));};exports[_0xde6d('0x38')]=function(_0x27fe73,_0x577ce5){return db[_0xde6d('0x1d')][_0xde6d('0x38')]()[_0xde6d('0x17')](respondWithResult(_0x577ce5,null))[_0xde6d('0x25')](handleError(_0x577ce5,null));};exports[_0xde6d('0x39')]=function(_0x5a8c3c,_0x563ab4){return db[_0xde6d('0x3a')][_0xde6d('0x34')]({'where':{'id':_0x5a8c3c[_0xde6d('0x27')]['id']}})[_0xde6d('0x17')](handleEntityNotFound(_0x563ab4,null))['then'](function(_0xed0725){if(_0xed0725){return _0xed0725[_0xde6d('0x39')](_0x5a8c3c[_0xde6d('0x36')]['ids'],_[_0xde6d('0x3b')](_0x5a8c3c[_0xde6d('0x36')],['ids','id'])||{});}})[_0xde6d('0x17')](respondWithResult(_0x563ab4,null))[_0xde6d('0x25')](handleError(_0x563ab4,null));};exports[_0xde6d('0x3c')]=function(_0x1f7221,_0x1ed9e2){var _0x5c7c2c={'raw':![],'where':{}};var _0x4cd87d={};var _0x1b60d9={'count':0x0,'rows':[]};return db[_0xde6d('0x1d')][_0xde6d('0x3d')]({'where':{'id':_0x1f7221['params']['id']}})[_0xde6d('0x17')](handleEntityNotFound(_0x1ed9e2,null))['then'](function(_0x380274){if(_0x380274){_0x4cd87d[_0xde6d('0x28')]=_[_0xde6d('0x29')](db[_0xde6d('0x3a')][_0xde6d('0x1e')]);_0x4cd87d[_0xde6d('0x2b')]=_[_0xde6d('0x29')](_0x1f7221['query']);_0x4cd87d[_0xde6d('0x2a')]=_[_0xde6d('0x2c')](_0x4cd87d[_0xde6d('0x28')],_0x4cd87d['query']);_0x5c7c2c['attributes']=_['intersection'](_0x4cd87d[_0xde6d('0x28')],qs[_0xde6d('0x2d')](_0x1f7221[_0xde6d('0x2b')][_0xde6d('0x2d')]));_0x5c7c2c[_0xde6d('0x2e')]=_0x5c7c2c[_0xde6d('0x2e')]['length']?_0x5c7c2c['attributes']:_0x4cd87d['model'];if(!_0x1f7221[_0xde6d('0x2b')]['hasOwnProperty'](_0xde6d('0x3e'))){_0x5c7c2c[_0xde6d('0x14')]=qs['limit'](_0x1f7221[_0xde6d('0x2b')]['limit']);_0x5c7c2c[_0xde6d('0x12')]=qs[_0xde6d('0x12')](_0x1f7221['query']['offset']);}_0x5c7c2c[_0xde6d('0x3f')]=qs['sort'](_0x1f7221['query']['sort']);_0x5c7c2c[_0xde6d('0x40')]=qs[_0xde6d('0x2a')](_[_0xde6d('0x41')](_0x1f7221[_0xde6d('0x2b')],_0x4cd87d['filters']));_0x5c7c2c[_0xde6d('0x40')][_0xde6d('0x42')]=_0x380274['id'];if(_0x1f7221['query'][_0xde6d('0x43')]){_0x5c7c2c[_0xde6d('0x40')]=_[_0xde6d('0x32')](_0x5c7c2c[_0xde6d('0x40')],{'$or':_[_0xde6d('0x1c')](_0x5c7c2c[_0xde6d('0x2e')],function(_0xb5a1f9){var _0x22f788={};_0x22f788[_0xb5a1f9]={'$like':'%'+_0x1f7221['query']['filter']+'%'};return _0x22f788;})});}if(_0x1f7221[_0xde6d('0x2b')]['$gte']){var _0x289778=_0x1f7221[_0xde6d('0x2b')]['$gte'][_0xde6d('0x44')](',');var _0x2620c5={};_0x2620c5[_0x289778[0x0]]={'$gte':moment(_0x289778[0x1])[_0xde6d('0x45')](_0xde6d('0x46'))};_0x5c7c2c['where']=_['merge'](_0x5c7c2c[_0xde6d('0x40')],_0x2620c5);}_0x5c7c2c=_[_0xde6d('0x32')]({},_0x5c7c2c,_0x1f7221[_0xde6d('0x33')]);return db[_0xde6d('0x3a')][_0xde6d('0x15')]({'where':_0x5c7c2c[_0xde6d('0x40')]})['then'](function(_0x56ff80){_0x1b60d9[_0xde6d('0x15')]=_0x56ff80;if(_0x1f7221['query']['includeAll']){_0x5c7c2c['include']=[{'all':!![]}];}return db[_0xde6d('0x3a')][_0xde6d('0x23')](_0x5c7c2c);})[_0xde6d('0x17')](function(_0x2fa3fb){_0x1b60d9['rows']=_0x2fa3fb;return _0x1b60d9;});}})[_0xde6d('0x17')](respondWithFilteredResult(_0x1ed9e2,_0x5c7c2c))[_0xde6d('0x25')](handleError(_0x1ed9e2,null));};exports['addTags']=function(_0x27b175,_0x4ee547){return db[_0xde6d('0x1d')][_0xde6d('0x34')]({'where':{'id':_0x27b175[_0xde6d('0x27')]['id']}})[_0xde6d('0x17')](handleEntityNotFound(_0x4ee547,null))[_0xde6d('0x17')](function(_0x4fc267){if(_0x4fc267){return _0x4fc267[_0xde6d('0x47')](_0x27b175[_0xde6d('0x36')]['ids'],_[_0xde6d('0x3b')](_0x27b175[_0xde6d('0x36')],[_0xde6d('0x48'),'id'])||{})['spread'](function(){return db[_0xde6d('0x49')][_0xde6d('0x23')]({'attributes':['id',_0xde6d('0x1a'),_0xde6d('0x4a')],'where':{'id':_0x27b175['body']['ids']}});})['then'](function(_0x63ff01){socket[_0xde6d('0x4b')](_0xde6d('0x4c'),{'id':Number(_0x27b175[_0xde6d('0x27')]['id']),'tags':_0x63ff01||[]});return{'id':Number(_0x27b175[_0xde6d('0x27')]['id']),'tags':_0x63ff01||[]};});}})[_0xde6d('0x17')](respondWithResult(_0x4ee547,null))[_0xde6d('0x25')](handleError(_0x4ee547,null));};exports[_0xde6d('0x4d')]=function(_0x438683,_0x58a86a){return db[_0xde6d('0x1d')][_0xde6d('0x34')]({'where':{'id':_0x438683['params']['id']}})[_0xde6d('0x17')](handleEntityNotFound(_0x58a86a,null))[_0xde6d('0x17')](function(_0x1a0bb1){if(_0x1a0bb1){return _0x1a0bb1[_0xde6d('0x4d')](_0x438683['query'][_0xde6d('0x48')]);}})[_0xde6d('0x17')](respondWithStatusCode(_0x58a86a,null))[_0xde6d('0x25')](handleError(_0x58a86a,null));};exports[_0xde6d('0x4e')]=function(_0x3c7a17,_0x37d020){var _0x399603=moment()[_0xde6d('0x4f')]()[_0xde6d('0x50')]();var _0x2323a6=path['join'](config[_0xde6d('0x51')],'server',_0xde6d('0x52'),'tmp');var _0x3f332c=path[_0xde6d('0x53')](config[_0xde6d('0x51')],_0xde6d('0x54'),_0xde6d('0x52'),'attachments');var _0xd894d5=path[_0xde6d('0x53')](_0x2323a6,_0x399603);var _0xab7e2b=util[_0xde6d('0x45')]('transcript-%d-%s.zip',_0x3c7a17['params']['id'],_0x399603);var _0x36ed54=path[_0xde6d('0x53')](_0x2323a6,_0xab7e2b);var _0x6337a6=[];_0x6337a6[_0xde6d('0x55')]({'model':db['Attachment'],'as':_0xde6d('0x56'),'raw':!![]});var _0x63af81=[{'model':db['FaxMessage'],'as':_0xde6d('0x57'),'attributes':['id',_0xde6d('0x36'),_0xde6d('0x58')],'include':_0x6337a6}];return db[_0xde6d('0x1d')][_0xde6d('0x34')]({'where':{'id':_0x3c7a17['params']['id']},'include':_0x63af81})[_0xde6d('0x17')](handleEntityNotFound(_0x37d020,null))[_0xde6d('0x17')](function(_0x3773a1){if(_0x3773a1&&_0x3773a1[_0xde6d('0x57')]){var _0x389d91=_0x3773a1[_0xde6d('0x59')]({'plain':!![]});fs['mkdirSync'](_0xd894d5);for(var _0x354f23=0x0;_0x354f23<_0x389d91['Messages'][_0xde6d('0x2f')];_0x354f23++){var _0x196a89=_0x389d91['Messages'][_0x354f23][_0xde6d('0x56')];if(_0x196a89){var _0x3729ad=path[_0xde6d('0x53')](_0x3f332c,_0x196a89[_0xde6d('0x5a')]);if(fs[_0xde6d('0x5b')](_0x3729ad)){fs[_0xde6d('0x5c')](_0x3729ad)[_0xde6d('0x5d')](fs[_0xde6d('0x5e')](path[_0xde6d('0x53')](_0xd894d5,_0x196a89[_0xde6d('0x5a')])));}}}return BPromise['resolve']()['then'](function(){return new BPromise(function(_0x3b87e7,_0x13b39a){zipdir(_0xd894d5,{'saveTo':_0x36ed54},function(_0xeaab11,_0x85a5a8){if(_0xeaab11)return _0x13b39a(_0xeaab11);return _0x3b87e7(_0x85a5a8);});})[_0xde6d('0x17')](function(){return new BPromise(function(_0x2c9c1d,_0x62dab4){rimraf(_0xd894d5,function(_0x36d907){if(_0x36d907)_0x62dab4(_0x36d907);return _0x2c9c1d();});});})[_0xde6d('0x17')](function(){return _0x37d020[_0xde6d('0x4e')](_0x36ed54,_0xab7e2b,function(_0x2262a0){if(_0x2262a0){console[_0xde6d('0x5f')]('err',_0x2262a0);}else{fs['unlinkSync'](_0x36ed54);}});});});}else{return _0x37d020[_0xde6d('0xe')](0xc8);}})[_0xde6d('0x25')](handleError(_0x37d020,null));}; \ No newline at end of file +var _0x3198=['attachments','transcript-%d-%s.zip','push','Attachment','Messages','get','mkdirSync','basename','existsSync','createWriteStream','resolve','download','log','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','update','then','error','name','index','FaxInteraction','rawAttributes','type','key','getOptions','findAll','fax','query','catch','params','model','keys','attributes','intersection','fields','length','merge','options','find','create','body','destroy','describe','addMessage','FaxMessage','ids','findOne','filters','hasOwnProperty','nolimit','order','sort','where','pick','FaxInteractionId','map','filter','$gte','split','format','include','rows','setTags','spread','Tag','color','emit','removeTags','unix','toString','join','root','server','files','tmp'];(function(_0xea42b4,_0x27ea39){var _0x3d6f5a=function(_0xce9211){while(--_0xce9211){_0xea42b4['push'](_0xea42b4['shift']());}};_0x3d6f5a(++_0x27ea39);}(_0x3198,0xd8));var _0x8319=function(_0x3d955d,_0x4471a3){_0x3d955d=_0x3d955d-0x0;var _0x29679e=_0x3198[_0x3d955d];return _0x29679e;};'use strict';var rimraf=require(_0x8319('0x0'));var zipdir=require(_0x8319('0x1'));var moment=require(_0x8319('0x2'));var BPromise=require(_0x8319('0x3'));var util=require(_0x8319('0x4'));var path=require(_0x8319('0x5'));var fs=require('fs');var _=require(_0x8319('0x6'));var Redis=require('ioredis');var interaction=require(_0x8319('0x7'));var qs=require(_0x8319('0x8'));var logger=require(_0x8319('0x9'))('api');var config=require(_0x8319('0xa'));var db=require(_0x8319('0xb'))['db'];config[_0x8319('0xc')]=_[_0x8319('0xd')](config['redis'],{'host':_0x8319('0xe'),'port':0x18eb});var socket=require(_0x8319('0xf'))(new Redis(config['redis']));require(_0x8319('0x10'))[_0x8319('0x11')](socket);function respondWithStatusCode(_0x5c7edb,_0x21e849){_0x21e849=_0x21e849||0xcc;return function(_0x5c9ed4){if(_0x5c9ed4){return _0x5c7edb[_0x8319('0x12')](_0x21e849);}return _0x5c7edb['status'](_0x21e849)[_0x8319('0x13')]();};}function respondWithResult(_0x5201ab,_0x45f69d){_0x45f69d=_0x45f69d||0xc8;return function(_0x20be3e){if(_0x20be3e){return _0x5201ab['status'](_0x45f69d)[_0x8319('0x14')](_0x20be3e);}};}function respondWithFilteredResult(_0x4ad3fd,_0x5073d4){return function(_0x4d9eef){if(_0x4d9eef){var _0x40e6a2=typeof _0x5073d4[_0x8319('0x15')]===_0x8319('0x16')&&typeof _0x5073d4[_0x8319('0x17')]==='undefined';var _0x1c2d9b=_0x4d9eef['count'];var _0x245ef0=_0x40e6a2?0x0:_0x5073d4[_0x8319('0x15')];var _0x2dd515=_0x40e6a2?_0x4d9eef[_0x8319('0x18')]:_0x5073d4['offset']+_0x5073d4[_0x8319('0x17')];var _0x2f74f9;if(_0x2dd515>=_0x1c2d9b){_0x2dd515=_0x1c2d9b;_0x2f74f9=0xc8;}else{_0x2f74f9=0xce;}_0x4ad3fd[_0x8319('0x19')](_0x2f74f9);return _0x4ad3fd[_0x8319('0x1a')]('Content-Range',_0x245ef0+'-'+_0x2dd515+'/'+_0x1c2d9b)['json'](_0x4d9eef);}return null;};}function saveUpdates(_0x1c6904){return function(_0x4786d0){if(_0x4786d0){return _0x4786d0[_0x8319('0x1b')](_0x1c6904)[_0x8319('0x1c')](function(_0x24f05c){return _0x24f05c;});}return null;};}function removeEntity(_0x3fa60f){return function(_0x1d8d34){if(_0x1d8d34){return _0x1d8d34['destroy']()[_0x8319('0x1c')](function(){_0x3fa60f[_0x8319('0x19')](0xcc)[_0x8319('0x13')]();});}};}function handleEntityNotFound(_0x1127d5){return function(_0x5814a3){if(!_0x5814a3){_0x1127d5[_0x8319('0x12')](0x194);}return _0x5814a3;};}function handleError(_0x3468c7,_0x5619c5){_0x5619c5=_0x5619c5||0x1f4;return function(_0x469a83){logger[_0x8319('0x1d')](_0x469a83['stack']);if(_0x469a83[_0x8319('0x1e')]){delete _0x469a83[_0x8319('0x1e')];}_0x3468c7[_0x8319('0x19')](_0x5619c5)['send'](_0x469a83);};}exports[_0x8319('0x1f')]=function(_0x41e0a2,_0x49aa82){var _0x532bb3={};var _0xdf2a91=_['map'](db[_0x8319('0x20')][_0x8319('0x21')],function(_0x158b8e){return{'name':_0x158b8e['fieldName'],'type':_0x158b8e[_0x8319('0x22')][_0x8319('0x23')]};});_0x532bb3=qs[_0x8319('0x24')](_0xdf2a91,_0x41e0a2);return interaction[_0x8319('0x25')](_0x8319('0x26'),_0x41e0a2[_0x8319('0x27')],_0x41e0a2['user'],_0x532bb3,_0xdf2a91)[_0x8319('0x1c')](respondWithFilteredResult(_0x49aa82,_0x532bb3))[_0x8319('0x28')](handleError(_0x49aa82,null));};exports['show']=function(_0x351f66,_0x29232d){var _0x933e7c={'raw':![],'where':{'id':_0x351f66[_0x8319('0x29')]['id']}},_0x540840={};_0x540840[_0x8319('0x2a')]=_[_0x8319('0x2b')](db[_0x8319('0x20')][_0x8319('0x21')]);_0x540840[_0x8319('0x27')]=_[_0x8319('0x2b')](_0x351f66[_0x8319('0x27')]);_0x540840['filters']=_['intersection'](_0x540840['model'],_0x540840[_0x8319('0x27')]);_0x933e7c[_0x8319('0x2c')]=_[_0x8319('0x2d')](_0x540840['model'],qs['fields'](_0x351f66[_0x8319('0x27')][_0x8319('0x2e')]));_0x933e7c[_0x8319('0x2c')]=_0x933e7c[_0x8319('0x2c')][_0x8319('0x2f')]?_0x933e7c[_0x8319('0x2c')]:_0x540840['model'];if(_0x351f66[_0x8319('0x27')]['includeAll']){_0x933e7c['include']=[{'all':!![]}];}_0x933e7c=_[_0x8319('0x30')]({},_0x933e7c,_0x351f66[_0x8319('0x31')]);return db['FaxInteraction'][_0x8319('0x32')](_0x933e7c)[_0x8319('0x1c')](handleEntityNotFound(_0x29232d,null))[_0x8319('0x1c')](respondWithResult(_0x29232d,null))[_0x8319('0x28')](handleError(_0x29232d,null));};exports[_0x8319('0x33')]=function(_0x4afd99,_0x1cbc3d){return db[_0x8319('0x20')][_0x8319('0x33')](_0x4afd99['body'],{})[_0x8319('0x1c')](respondWithResult(_0x1cbc3d,0xc9))['catch'](handleError(_0x1cbc3d,null));};exports[_0x8319('0x1b')]=function(_0x3963a1,_0x3623c3){if(_0x3963a1[_0x8319('0x34')]['id']){delete _0x3963a1[_0x8319('0x34')]['id'];}return db[_0x8319('0x20')][_0x8319('0x32')]({'where':{'id':_0x3963a1['params']['id']}})['then'](handleEntityNotFound(_0x3623c3,null))[_0x8319('0x1c')](saveUpdates(_0x3963a1[_0x8319('0x34')],null))[_0x8319('0x1c')](respondWithResult(_0x3623c3,null))['catch'](handleError(_0x3623c3,null));};exports[_0x8319('0x35')]=function(_0x10a1ac,_0x56c873){return db['FaxInteraction'][_0x8319('0x32')]({'where':{'id':_0x10a1ac[_0x8319('0x29')]['id']}})[_0x8319('0x1c')](handleEntityNotFound(_0x56c873,null))[_0x8319('0x1c')](removeEntity(_0x56c873,null))[_0x8319('0x28')](handleError(_0x56c873,null));};exports[_0x8319('0x36')]=function(_0x867785,_0x23b0f2){return db['FaxInteraction'][_0x8319('0x36')]()[_0x8319('0x1c')](respondWithResult(_0x23b0f2,null))[_0x8319('0x28')](handleError(_0x23b0f2,null));};exports[_0x8319('0x37')]=function(_0x2bd8ee,_0x14b9ed){return db[_0x8319('0x38')]['find']({'where':{'id':_0x2bd8ee['params']['id']}})[_0x8319('0x1c')](handleEntityNotFound(_0x14b9ed,null))[_0x8319('0x1c')](function(_0x467b65){if(_0x467b65){return _0x467b65[_0x8319('0x37')](_0x2bd8ee[_0x8319('0x34')][_0x8319('0x39')],_['omit'](_0x2bd8ee['body'],[_0x8319('0x39'),'id'])||{});}})['then'](respondWithResult(_0x14b9ed,null))[_0x8319('0x28')](handleError(_0x14b9ed,null));};exports['getMessages']=function(_0x735ca1,_0x183b32){var _0x9f1fad={'raw':![],'where':{}};var _0xe19168={};var _0x27c090={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x8319('0x3a')]({'where':{'id':_0x735ca1[_0x8319('0x29')]['id']}})['then'](handleEntityNotFound(_0x183b32,null))[_0x8319('0x1c')](function(_0x16757d){if(_0x16757d){_0xe19168[_0x8319('0x2a')]=_[_0x8319('0x2b')](db['FaxMessage'][_0x8319('0x21')]);_0xe19168['query']=_[_0x8319('0x2b')](_0x735ca1['query']);_0xe19168[_0x8319('0x3b')]=_[_0x8319('0x2d')](_0xe19168[_0x8319('0x2a')],_0xe19168['query']);_0x9f1fad[_0x8319('0x2c')]=_[_0x8319('0x2d')](_0xe19168[_0x8319('0x2a')],qs[_0x8319('0x2e')](_0x735ca1[_0x8319('0x27')]['fields']));_0x9f1fad['attributes']=_0x9f1fad['attributes'][_0x8319('0x2f')]?_0x9f1fad[_0x8319('0x2c')]:_0xe19168['model'];if(!_0x735ca1[_0x8319('0x27')][_0x8319('0x3c')](_0x8319('0x3d'))){_0x9f1fad[_0x8319('0x17')]=qs['limit'](_0x735ca1[_0x8319('0x27')][_0x8319('0x17')]);_0x9f1fad[_0x8319('0x15')]=qs[_0x8319('0x15')](_0x735ca1[_0x8319('0x27')]['offset']);}_0x9f1fad[_0x8319('0x3e')]=qs['sort'](_0x735ca1[_0x8319('0x27')][_0x8319('0x3f')]);_0x9f1fad[_0x8319('0x40')]=qs[_0x8319('0x3b')](_[_0x8319('0x41')](_0x735ca1[_0x8319('0x27')],_0xe19168[_0x8319('0x3b')]));_0x9f1fad[_0x8319('0x40')][_0x8319('0x42')]=_0x16757d['id'];if(_0x735ca1['query']['filter']){_0x9f1fad[_0x8319('0x40')]=_['merge'](_0x9f1fad[_0x8319('0x40')],{'$or':_[_0x8319('0x43')](_0x9f1fad[_0x8319('0x2c')],function(_0x54401d){var _0x319a2e={};_0x319a2e[_0x54401d]={'$like':'%'+_0x735ca1[_0x8319('0x27')][_0x8319('0x44')]+'%'};return _0x319a2e;})});}if(_0x735ca1['query'][_0x8319('0x45')]){var _0x9121e0=_0x735ca1['query'][_0x8319('0x45')][_0x8319('0x46')](',');var _0x52d159={};_0x52d159[_0x9121e0[0x0]]={'$gte':moment(_0x9121e0[0x1])[_0x8319('0x47')]('YYYY-MM-DD\x20HH:mm:ss')};_0x9f1fad[_0x8319('0x40')]=_['merge'](_0x9f1fad[_0x8319('0x40')],_0x52d159);}_0x9f1fad=_['merge']({},_0x9f1fad,_0x735ca1[_0x8319('0x31')]);return db['FaxMessage'][_0x8319('0x18')]({'where':_0x9f1fad[_0x8319('0x40')]})['then'](function(_0x3ec325){_0x27c090[_0x8319('0x18')]=_0x3ec325;if(_0x735ca1[_0x8319('0x27')]['includeAll']){_0x9f1fad[_0x8319('0x48')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x9f1fad);})[_0x8319('0x1c')](function(_0x1b30cc){_0x27c090[_0x8319('0x49')]=_0x1b30cc;return _0x27c090;});}})[_0x8319('0x1c')](respondWithFilteredResult(_0x183b32,_0x9f1fad))[_0x8319('0x28')](handleError(_0x183b32,null));};exports['addTags']=function(_0x3d4327,_0x595e2a){return db['FaxInteraction'][_0x8319('0x32')]({'where':{'id':_0x3d4327[_0x8319('0x29')]['id']}})['then'](handleEntityNotFound(_0x595e2a,null))[_0x8319('0x1c')](function(_0x521258){if(_0x521258){return _0x521258[_0x8319('0x4a')](_0x3d4327[_0x8319('0x34')][_0x8319('0x39')],_['omit'](_0x3d4327[_0x8319('0x34')],['ids','id'])||{})[_0x8319('0x4b')](function(){return db[_0x8319('0x4c')][_0x8319('0x25')]({'attributes':['id',_0x8319('0x1e'),_0x8319('0x4d')],'where':{'id':_0x3d4327[_0x8319('0x34')][_0x8319('0x39')]}});})['then'](function(_0x548e5b){socket[_0x8319('0x4e')]('faxInteractionTags:save',{'id':Number(_0x3d4327[_0x8319('0x29')]['id']),'tags':_0x548e5b||[]});return{'id':Number(_0x3d4327[_0x8319('0x29')]['id']),'tags':_0x548e5b||[]};});}})[_0x8319('0x1c')](respondWithResult(_0x595e2a,null))[_0x8319('0x28')](handleError(_0x595e2a,null));};exports[_0x8319('0x4f')]=function(_0x371a53,_0x3f68ba){return db[_0x8319('0x20')][_0x8319('0x32')]({'where':{'id':_0x371a53[_0x8319('0x29')]['id']}})[_0x8319('0x1c')](handleEntityNotFound(_0x3f68ba,null))[_0x8319('0x1c')](function(_0x2a081c){if(_0x2a081c){return _0x2a081c['removeTags'](_0x371a53[_0x8319('0x27')][_0x8319('0x39')]);}})['then'](respondWithStatusCode(_0x3f68ba,null))['catch'](handleError(_0x3f68ba,null));};exports['download']=function(_0x1acd2e,_0x3953b1){var _0x5b228a=moment()[_0x8319('0x50')]()[_0x8319('0x51')]();var _0x4d3be3=path[_0x8319('0x52')](config[_0x8319('0x53')],_0x8319('0x54'),_0x8319('0x55'),_0x8319('0x56'));var _0x5f2fcc=path[_0x8319('0x52')](config[_0x8319('0x53')],_0x8319('0x54'),_0x8319('0x55'),_0x8319('0x57'));var _0x2d5c6b=path['join'](_0x4d3be3,_0x5b228a);var _0x207a9d=util['format'](_0x8319('0x58'),_0x1acd2e['params']['id'],_0x5b228a);var _0x10144c=path['join'](_0x4d3be3,_0x207a9d);var _0x3ccc89=[];_0x3ccc89[_0x8319('0x59')]({'model':db[_0x8319('0x5a')],'as':_0x8319('0x5a'),'raw':!![]});var _0xd38e12=[{'model':db[_0x8319('0x38')],'as':_0x8319('0x5b'),'attributes':['id',_0x8319('0x34'),'createdAt'],'include':_0x3ccc89}];return db[_0x8319('0x20')]['find']({'where':{'id':_0x1acd2e[_0x8319('0x29')]['id']},'include':_0xd38e12})[_0x8319('0x1c')](handleEntityNotFound(_0x3953b1,null))['then'](function(_0x11fa9e){if(_0x11fa9e&&_0x11fa9e[_0x8319('0x5b')]){var _0x45ce66=_0x11fa9e[_0x8319('0x5c')]({'plain':!![]});fs[_0x8319('0x5d')](_0x2d5c6b);for(var _0x6b917=0x0;_0x6b917<_0x45ce66['Messages'][_0x8319('0x2f')];_0x6b917++){var _0x14faf5=_0x45ce66[_0x8319('0x5b')][_0x6b917]['Attachment'];if(_0x14faf5){var _0x2d3906=path[_0x8319('0x52')](_0x5f2fcc,_0x14faf5[_0x8319('0x5e')]);if(fs[_0x8319('0x5f')](_0x2d3906)){fs['createReadStream'](_0x2d3906)['pipe'](fs[_0x8319('0x60')](path['join'](_0x2d5c6b,_0x14faf5[_0x8319('0x5e')])));}}}return BPromise[_0x8319('0x61')]()[_0x8319('0x1c')](function(){return new BPromise(function(_0x5e1828,_0x1a415c){zipdir(_0x2d5c6b,{'saveTo':_0x10144c},function(_0x9d69f0,_0x345302){if(_0x9d69f0)return _0x1a415c(_0x9d69f0);return _0x5e1828(_0x345302);});})[_0x8319('0x1c')](function(){return new BPromise(function(_0x2e8754,_0x473c40){rimraf(_0x2d5c6b,function(_0x20687c){if(_0x20687c)_0x473c40(_0x20687c);return _0x2e8754();});});})[_0x8319('0x1c')](function(){return _0x3953b1[_0x8319('0x62')](_0x10144c,_0x207a9d,function(_0x459f98){if(_0x459f98){console[_0x8319('0x63')]('err',_0x459f98);}else{fs[_0x8319('0x64')](_0x10144c);}});});});}else{return _0x3953b1[_0x8319('0x12')](0xc8);}})[_0x8319('0x28')](handleError(_0x3953b1,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 037f3fa..73ca888 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 _0xc4fe=['Users','map','then','unreadMessages','emit','hasOwnProperty','hook','events','../../mysqldb','FaxInteraction','FaxMessage','save','update','remove','getUsers','setDataValue'];(function(_0x3d16ad,_0x36675c){var _0x5ebf92=function(_0x1c0860){while(--_0x1c0860){_0x3d16ad['push'](_0x3d16ad['shift']());}};_0x5ebf92(++_0x36675c);}(_0xc4fe,0x1c7));var _0xec4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4fe[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xec4f('0x0'));var FaxInteraction=require(_0xec4f('0x1'))['db'][_0xec4f('0x2')];var FaxMessage=require(_0xec4f('0x1'))['db'][_0xec4f('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xec4f('0x4'),'afterUpdate':_0xec4f('0x5'),'afterDestroy':_0xec4f('0x6')};function emitEvent(_0x1e95e6){return function(_0x4603d3,_0x11655d,_0x293131){_0x4603d3[_0xec4f('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xc2ca51){_0x4603d3[_0xec4f('0x8')](_0xec4f('0x9'),_0xc2ca51[_0xec4f('0xa')](function(_0x3fe961){return{'id':_0x3fe961['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x4603d3['id'],'direction':'in','read':![]},'raw':!![]});})[_0xec4f('0xb')](function(_0x25f5e9){_0x4603d3[_0xec4f('0x8')](_0xec4f('0xc'),_0x25f5e9['length']);FaxInteractionEvents[_0xec4f('0xd')](_0x1e95e6+':'+_0x4603d3['id'],_0x4603d3);FaxInteractionEvents['emit'](_0x1e95e6,_0x4603d3);_0x293131(null);})['catch'](_0x293131(null));};}for(var e in events){if(events[_0xec4f('0xe')](e)){var event=events[e];FaxInteraction[_0xec4f('0xf')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0x5743=['emit','hook','exports','../../mysqldb','FaxInteraction','FaxMessage','save','update','remove','setDataValue','Users','map','unreadMessages'];(function(_0x4174bb,_0x2889f6){var _0x363e33=function(_0x193ce3){while(--_0x193ce3){_0x4174bb['push'](_0x4174bb['shift']());}};_0x363e33(++_0x2889f6);}(_0x5743,0xed));var _0x3574=function(_0x343f1d,_0x2ecc92){_0x343f1d=_0x343f1d-0x0;var _0x54beb9=_0x5743[_0x343f1d];return _0x54beb9;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x3574('0x0'))['db'][_0x3574('0x1')];var FaxMessage=require(_0x3574('0x0'))['db'][_0x3574('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3574('0x3'),'afterUpdate':_0x3574('0x4'),'afterDestroy':_0x3574('0x5')};function emitEvent(_0x598c4a){return function(_0x19e13c,_0x38ae33,_0x376b7c){_0x19e13c['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x51c5a7){_0x19e13c[_0x3574('0x6')](_0x3574('0x7'),_0x51c5a7[_0x3574('0x8')](function(_0x2a826f){return{'id':_0x2a826f['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x19e13c['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x197631){_0x19e13c['setDataValue'](_0x3574('0x9'),_0x197631['length']);FaxInteractionEvents[_0x3574('0xa')](_0x598c4a+':'+_0x19e13c['id'],_0x19e13c);FaxInteractionEvents[_0x3574('0xa')](_0x598c4a,_0x19e13c);_0x376b7c(null);})['catch'](_0x376b7c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x3574('0xb')](e,emitEvent(event));}}module[_0x3574('0xc')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index b8e1040..6f848b5 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 _0x6e2a=['closed','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','FaxInteraction','fax_interactions'];(function(_0x321061,_0x3f6750){var _0x2cd3e6=function(_0x31ed30){while(--_0x31ed30){_0x321061['push'](_0x321061['shift']());}};_0x2cd3e6(++_0x3f6750);}(_0x6e2a,0xfa));var _0xa6e2=function(_0x44cb2d,_0x58ebd3){_0x44cb2d=_0x44cb2d-0x0;var _0x4d996a=_0x6e2a[_0x44cb2d];return _0x4d996a;};'use strict';var _=require('lodash');var util=require(_0xa6e2('0x0'));var logger=require(_0xa6e2('0x1'))(_0xa6e2('0x2'));var moment=require(_0xa6e2('0x3'));var BPromise=require(_0xa6e2('0x4'));var rp=require(_0xa6e2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa6e2('0x6'));var config=require(_0xa6e2('0x7'));var attributes=require('./faxInteraction.attributes');module['exports']=function(_0x5a2e57,_0x2d00d3){return _0x5a2e57['define'](_0xa6e2('0x8'),attributes,{'tableName':_0xa6e2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4fda21,_0x3ce369,_0x15c801){if(_0x4fda21['changed'](_0xa6e2('0xa'))){_0x4fda21['closedAt']=moment()[_0xa6e2('0xb')](_0xa6e2('0xc'));}_0x15c801(null,_0x4fda21);}}});}; \ No newline at end of file +var _0xa984=['exports','fax_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0xa984,0x15a));var _0x4a98=function(_0x6b8e6,_0x5b5b8d){_0x6b8e6=_0x6b8e6-0x0;var _0x11e8d9=_0xa984[_0x6b8e6];return _0x11e8d9;};'use strict';var _=require(_0x4a98('0x0'));var util=require(_0x4a98('0x1'));var logger=require(_0x4a98('0x2'))(_0x4a98('0x3'));var moment=require(_0x4a98('0x4'));var BPromise=require(_0x4a98('0x5'));var rp=require(_0x4a98('0x6'));var fs=require('fs');var path=require(_0x4a98('0x7'));var rimraf=require(_0x4a98('0x8'));var config=require(_0x4a98('0x9'));var attributes=require(_0x4a98('0xa'));module[_0x4a98('0xb')]=function(_0x35e7f4,_0x310c98){return _0x35e7f4['define']('FaxInteraction',attributes,{'tableName':_0x4a98('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5d68ad,_0x43bf6d,_0x59e3a5){if(_0x5d68ad[_0x4a98('0xd')]('closed')){_0x5d68ad[_0x4a98('0xe')]=moment()[_0x4a98('0xf')](_0x4a98('0x10'));}_0x59e3a5(null,_0x5d68ad);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 614471e..fe19159 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 _0x08b9=['request\x20sent','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','options','attributes','limit','AddTagsToFaxInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x08b9,0x15c));var _0x908b=function(_0x1c288b,_0x377b72){_0x1c288b=_0x1c288b-0x0;var _0x5d9225=_0x08b9[_0x1c288b];return _0x5d9225;};'use strict';var _=require(_0x908b('0x0'));var util=require('util');var moment=require(_0x908b('0x1'));var BPromise=require(_0x908b('0x2'));var rs=require(_0x908b('0x3'));var fs=require('fs');var Redis=require(_0x908b('0x4'));var db=require(_0x908b('0x5'))['db'];var utils=require(_0x908b('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x908b('0x7'));var jayson=require(_0x908b('0x8'));var client=jayson[_0x908b('0x9')][_0x908b('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x908b('0xb')],{'host':_0x908b('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x908b('0xb')]));require(_0x908b('0xd'))[_0x908b('0xe')](socket);function respondWithRpcPromise(_0x3813c1,_0x4de2ea,_0x3c7760){return new BPromise(function(_0x2cfdf5,_0x36ccf8){return client[_0x908b('0xf')](_0x3813c1,_0x3c7760)[_0x908b('0x10')](function(_0x43bf8e){logger[_0x908b('0x11')](_0x908b('0x12'),_0x4de2ea,'request\x20sent');logger[_0x908b('0x13')](_0x908b('0x14'),_0x4de2ea,_0x908b('0x15'),JSON[_0x908b('0x16')](_0x43bf8e));if(_0x43bf8e[_0x908b('0x17')]){if(_0x43bf8e[_0x908b('0x17')][_0x908b('0x18')]===0x1f4){logger[_0x908b('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x4de2ea,_0x43bf8e[_0x908b('0x17')][_0x908b('0x19')]);return _0x36ccf8(_0x43bf8e['error'][_0x908b('0x19')]);}logger[_0x908b('0x17')](_0x908b('0x12'),_0x4de2ea,_0x43bf8e[_0x908b('0x17')][_0x908b('0x19')]);return _0x2cfdf5(_0x43bf8e[_0x908b('0x17')][_0x908b('0x19')]);}else{logger['info'](_0x908b('0x12'),_0x4de2ea,_0x908b('0x15'));_0x2cfdf5(_0x43bf8e[_0x908b('0x1a')][_0x908b('0x19')]);}})[_0x908b('0x1b')](function(_0x4e25ba){logger[_0x908b('0x17')](_0x908b('0x12'),_0x4de2ea,_0x4e25ba);_0x36ccf8(_0x4e25ba);});});}exports[_0x908b('0x1c')]=function(_0x4782bf){var _0x489ead=this;return new Promise(function(_0x5193a4,_0x3d0f1f){return db[_0x908b('0x1d')]['update'](_0x4782bf['body'],{'raw':_0x4782bf[_0x908b('0x1e')]?_0x4782bf[_0x908b('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4782bf[_0x908b('0x1e')]?_0x4782bf[_0x908b('0x1e')]['where']||null:null,'attributes':_0x4782bf['options']?_0x4782bf['options'][_0x908b('0x1f')]||null:null,'limit':_0x4782bf[_0x908b('0x1e')]?_0x4782bf[_0x908b('0x1e')][_0x908b('0x20')]||null:null})[_0x908b('0x10')](function(_0x1bf5c6){logger[_0x908b('0x11')](_0x908b('0x1c'),_0x4782bf);logger['debug'](_0x908b('0x1c'),_0x4782bf,JSON[_0x908b('0x16')](_0x1bf5c6));_0x5193a4(_0x1bf5c6);})[_0x908b('0x1b')](function(_0x33139f){logger[_0x908b('0x17')](_0x908b('0x1c'),_0x33139f[_0x908b('0x19')],_0x4782bf);_0x3d0f1f(_0x489ead[_0x908b('0x17')](0x1f4,_0x33139f[_0x908b('0x19')]));});});};exports[_0x908b('0x21')]=function(_0x1a88ca){return new Promise(function(_0x28cf45,_0x29c52b){return db['FaxInteraction'][_0x908b('0x22')]({'where':_0x1a88ca[_0x908b('0x1e')]?_0x1a88ca[_0x908b('0x1e')]['where']||null:null})[_0x908b('0x10')](function(_0x2ede9a){if(_0x2ede9a){return _0x2ede9a[_0x908b('0x23')](_0x1a88ca[_0x908b('0x24')][_0x908b('0x25')],_[_0x908b('0x26')](_0x1a88ca[_0x908b('0x24')],[_0x908b('0x25'),'id'])||{});}})[_0x908b('0x27')](function(_0x144256){logger[_0x908b('0x11')](_0x908b('0x28'),_0x1a88ca);logger['debug'](_0x908b('0x28'),_0x1a88ca,JSON['stringify'](_0x144256));_0x28cf45(_0x144256);})['catch'](function(_0x2fcdaf){logger['error'](_0x908b('0x28'),_0x2fcdaf['message'],_0x1a88ca);_0x29c52b(_this[_0x908b('0x17')](0x1f4,_0x2fcdaf['message']));});});}; \ No newline at end of file +var _0x9503=['FaxInteraction','update','options','raw','where','attributes','limit','stringify','catch','AddTagsToFaxInteraction','find','addTags','body','ids','spread','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxInteraction.socket','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','message','result','UpdateFaxInteraction'];(function(_0xa86251,_0x535ced){var _0x300ffe=function(_0x4e48ae){while(--_0x4e48ae){_0xa86251['push'](_0xa86251['shift']());}};_0x300ffe(++_0x535ced);}(_0x9503,0x127));var _0x3950=function(_0x589a9f,_0x24b01){_0x589a9f=_0x589a9f-0x0;var _0x14f626=_0x9503[_0x589a9f];return _0x14f626;};'use strict';var _=require(_0x3950('0x0'));var util=require('util');var moment=require(_0x3950('0x1'));var BPromise=require(_0x3950('0x2'));var rs=require(_0x3950('0x3'));var fs=require('fs');var Redis=require(_0x3950('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3950('0x5'))(_0x3950('0x6'));var config=require(_0x3950('0x7'));var jayson=require(_0x3950('0x8'));var client=jayson[_0x3950('0x9')][_0x3950('0xa')]({'port':0x232a});config[_0x3950('0xb')]=_['defaults'](config[_0x3950('0xb')],{'host':_0x3950('0xc'),'port':0x18eb});var socket=require(_0x3950('0xd'))(new Redis(config[_0x3950('0xb')]));require(_0x3950('0xe'))['register'](socket);function respondWithRpcPromise(_0x18b8cb,_0x5608fc,_0x5d55ad){return new BPromise(function(_0x3fb2ae,_0x43ab68){return client['request'](_0x18b8cb,_0x5d55ad)[_0x3950('0xf')](function(_0x190c1f){logger[_0x3950('0x10')](_0x3950('0x11'),_0x5608fc,_0x3950('0x12'));logger[_0x3950('0x13')](_0x3950('0x14'),_0x5608fc,'request\x20sent',JSON['stringify'](_0x190c1f));if(_0x190c1f[_0x3950('0x15')]){if(_0x190c1f[_0x3950('0x15')]['code']===0x1f4){logger[_0x3950('0x15')](_0x3950('0x11'),_0x5608fc,_0x190c1f[_0x3950('0x15')]['message']);return _0x43ab68(_0x190c1f[_0x3950('0x15')][_0x3950('0x16')]);}logger[_0x3950('0x15')](_0x3950('0x11'),_0x5608fc,_0x190c1f[_0x3950('0x15')]['message']);return _0x3fb2ae(_0x190c1f['error'][_0x3950('0x16')]);}else{logger['info'](_0x3950('0x11'),_0x5608fc,_0x3950('0x12'));_0x3fb2ae(_0x190c1f[_0x3950('0x17')][_0x3950('0x16')]);}})['catch'](function(_0x4baba8){logger[_0x3950('0x15')](_0x3950('0x11'),_0x5608fc,_0x4baba8);_0x43ab68(_0x4baba8);});});}exports[_0x3950('0x18')]=function(_0xe5c5cc){var _0x59c386=this;return new Promise(function(_0x1d5979,_0x289d4f){return db[_0x3950('0x19')][_0x3950('0x1a')](_0xe5c5cc['body'],{'raw':_0xe5c5cc['options']?_0xe5c5cc[_0x3950('0x1b')][_0x3950('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe5c5cc['options']?_0xe5c5cc[_0x3950('0x1b')][_0x3950('0x1d')]||null:null,'attributes':_0xe5c5cc[_0x3950('0x1b')]?_0xe5c5cc['options'][_0x3950('0x1e')]||null:null,'limit':_0xe5c5cc[_0x3950('0x1b')]?_0xe5c5cc['options'][_0x3950('0x1f')]||null:null})['then'](function(_0x2de1cd){logger[_0x3950('0x10')](_0x3950('0x18'),_0xe5c5cc);logger['debug'](_0x3950('0x18'),_0xe5c5cc,JSON[_0x3950('0x20')](_0x2de1cd));_0x1d5979(_0x2de1cd);})[_0x3950('0x21')](function(_0xe30807){logger[_0x3950('0x15')](_0x3950('0x18'),_0xe30807[_0x3950('0x16')],_0xe5c5cc);_0x289d4f(_0x59c386[_0x3950('0x15')](0x1f4,_0xe30807[_0x3950('0x16')]));});});};exports[_0x3950('0x22')]=function(_0x5859a3){return new Promise(function(_0x9290f,_0x4e009e){return db[_0x3950('0x19')][_0x3950('0x23')]({'where':_0x5859a3[_0x3950('0x1b')]?_0x5859a3['options'][_0x3950('0x1d')]||null:null})[_0x3950('0xf')](function(_0x10383a){if(_0x10383a){return _0x10383a[_0x3950('0x24')](_0x5859a3[_0x3950('0x25')][_0x3950('0x26')],_['omit'](_0x5859a3[_0x3950('0x25')],[_0x3950('0x26'),'id'])||{});}})[_0x3950('0x27')](function(_0x2f74ae){logger[_0x3950('0x10')]('AddTags',_0x5859a3);logger[_0x3950('0x13')]('AddTags',_0x5859a3,JSON[_0x3950('0x20')](_0x2f74ae));_0x9290f(_0x2f74ae);})['catch'](function(_0x436534){logger[_0x3950('0x15')]('AddTags',_0x436534[_0x3950('0x16')],_0x5859a3);_0x4e009e(_this[_0x3950('0x15')](0x1f4,_0x436534[_0x3950('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index d7d046d..b81f6e7 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 _0x09fb=['update','emit','removeListener','save','remove'];(function(_0x389832,_0x10a4a9){var _0x59429e=function(_0x5f3562){while(--_0x5f3562){_0x389832['push'](_0x389832['shift']());}};_0x59429e(++_0x10a4a9);}(_0x09fb,0x189));var _0xb09f=function(_0x3a3d21,_0x1cfefd){_0x3a3d21=_0x3a3d21-0x0;var _0x3c5260=_0x09fb[_0x3a3d21];return _0x3c5260;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0xb09f('0x0'),_0xb09f('0x1'),_0xb09f('0x2')];function createListener(_0x3a55c9,_0x236288){return function(_0x97a869){_0x236288[_0xb09f('0x3')](_0x3a55c9,_0x97a869);};}function removeListener(_0x4cdf86,_0x5b6dac){return function(){FaxInteractionEvents[_0xb09f('0x4')](_0x4cdf86,_0x5b6dac);};}exports['register']=function(_0x21a54f){for(var _0x47a8e8=0x0,_0xc6fe5f=events['length'];_0x47a8e8<_0xc6fe5f;_0x47a8e8++){var _0x21f02c=events[_0x47a8e8];var _0x1475ef=createListener('faxInteraction:'+_0x21f02c,_0x21a54f);FaxInteractionEvents['on'](_0x21f02c,_0x1475ef);}}; \ No newline at end of file +var _0x51eb=['./faxInteraction.events','save','remove','update','removeListener','length','faxInteraction:'];(function(_0x2724e5,_0x229d74){var _0x4b6621=function(_0x787046){while(--_0x787046){_0x2724e5['push'](_0x2724e5['shift']());}};_0x4b6621(++_0x229d74);}(_0x51eb,0xb6));var _0xb51e=function(_0x2e2d7e,_0x58052a){_0x2e2d7e=_0x2e2d7e-0x0;var _0x46c5b6=_0x51eb[_0x2e2d7e];return _0x46c5b6;};'use strict';var FaxInteractionEvents=require(_0xb51e('0x0'));var events=[_0xb51e('0x1'),_0xb51e('0x2'),_0xb51e('0x3')];function createListener(_0x3a368d,_0x76f7a2){return function(_0x3eba13){_0x76f7a2['emit'](_0x3a368d,_0x3eba13);};}function removeListener(_0x580a9e,_0x2dd4d6){return function(){FaxInteractionEvents[_0xb51e('0x4')](_0x580a9e,_0x2dd4d6);};}exports['register']=function(_0x4851c9){for(var _0x164695=0x0,_0x19d05f=events[_0xb51e('0x5')];_0x164695<_0x19d05f;_0x164695++){var _0x694115=events[_0x164695];var _0x31ef39=createListener(_0xb51e('0x6')+_0x694115,_0x4851c9);FaxInteractionEvents['on'](_0x694115,_0x31ef39);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 9c7d928..21196b9 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 _0x1f20=['faxinteraction:addtags','addTags','put','tracked','update','delete','fax','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','isAuthenticated','index','get','/:id','/:id/messages','/:id/download','create','addMessage','post','/:id/tags'];(function(_0x5cc51f,_0x22c480){var _0x315a2f=function(_0x4f93bd){while(--_0x4f93bd){_0x5cc51f['push'](_0x5cc51f['shift']());}};_0x315a2f(++_0x22c480);}(_0x1f20,0x72));var _0x01f2=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x1f20[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x01f2('0x0'));var util=require(_0x01f2('0x1'));var path=require(_0x01f2('0x2'));var timeout=require(_0x01f2('0x3'));var express=require('express');var router=express[_0x01f2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x01f2('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxInteraction.controller');router['get']('/',auth[_0x01f2('0x6')](),controller[_0x01f2('0x7')]);router[_0x01f2('0x8')]('/describe',auth[_0x01f2('0x6')](),controller['describe']);router[_0x01f2('0x8')](_0x01f2('0x9'),auth[_0x01f2('0x6')](),controller['show']);router[_0x01f2('0x8')](_0x01f2('0xa'),auth[_0x01f2('0x6')](),controller['getMessages']);router['get'](_0x01f2('0xb'),auth[_0x01f2('0x6')](),controller['download']);router['post']('/',auth[_0x01f2('0x6')](),controller[_0x01f2('0xc')]);router['post'](_0x01f2('0xa'),auth['isAuthenticated'](),controller[_0x01f2('0xd')]);router[_0x01f2('0xe')](_0x01f2('0xf'),auth[_0x01f2('0x6')](),interaction['tracked']('fax',_0x01f2('0x10')),controller[_0x01f2('0x11')]);router[_0x01f2('0x12')](_0x01f2('0x9'),auth['isAuthenticated'](),interaction[_0x01f2('0x13')]('fax','faxinteraction:update'),controller[_0x01f2('0x14')]);router[_0x01f2('0x15')]('/:id',auth[_0x01f2('0x6')](),interaction[_0x01f2('0x13')](_0x01f2('0x16'),'faxinteraction:destroy'),controller[_0x01f2('0x17')]);router[_0x01f2('0x15')](_0x01f2('0xf'),auth[_0x01f2('0x6')](),controller[_0x01f2('0x18')]);module[_0x01f2('0x19')]=router; \ No newline at end of file +var _0x802c=['create','post','/:id/messages','addMessage','fax','addTags','tracked','faxinteraction:update','update','delete','faxinteraction:destroy','removeTags','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','describe','/:id','getMessages','/:id/download','download'];(function(_0x1dc1bc,_0x13522c){var _0xe8656e=function(_0x486672){while(--_0x486672){_0x1dc1bc['push'](_0x1dc1bc['shift']());}};_0xe8656e(++_0x13522c);}(_0x802c,0x1dd));var _0xc802=function(_0x1330c2,_0x27a429){_0x1330c2=_0x1330c2-0x0;var _0x170285=_0x802c[_0x1330c2];return _0x170285;};'use strict';var multer=require(_0xc802('0x0'));var util=require(_0xc802('0x1'));var path=require(_0xc802('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc802('0x3')]();var fs_extra=require(_0xc802('0x4'));var auth=require(_0xc802('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc802('0x6'));var controller=require(_0xc802('0x7'));router[_0xc802('0x8')]('/',auth[_0xc802('0x9')](),controller[_0xc802('0xa')]);router[_0xc802('0x8')]('/describe',auth[_0xc802('0x9')](),controller[_0xc802('0xb')]);router[_0xc802('0x8')](_0xc802('0xc'),auth[_0xc802('0x9')](),controller['show']);router[_0xc802('0x8')]('/:id/messages',auth[_0xc802('0x9')](),controller[_0xc802('0xd')]);router[_0xc802('0x8')](_0xc802('0xe'),auth[_0xc802('0x9')](),controller[_0xc802('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc802('0x10')]);router[_0xc802('0x11')](_0xc802('0x12'),auth[_0xc802('0x9')](),controller[_0xc802('0x13')]);router[_0xc802('0x11')]('/:id/tags',auth[_0xc802('0x9')](),interaction['tracked'](_0xc802('0x14'),'faxinteraction:addtags'),controller[_0xc802('0x15')]);router['put'](_0xc802('0xc'),auth[_0xc802('0x9')](),interaction[_0xc802('0x16')](_0xc802('0x14'),_0xc802('0x17')),controller[_0xc802('0x18')]);router[_0xc802('0x19')](_0xc802('0xc'),auth[_0xc802('0x9')](),interaction[_0xc802('0x16')](_0xc802('0x14'),_0xc802('0x1a')),controller['destroy']);router[_0xc802('0x19')]('/:id/tags',auth['isAuthenticated'](),controller[_0xc802('0x1b')]);module[_0xc802('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 4566f14..1e1f87f 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 _0x27c5=['DATE','TEXT','medium','BOOLEAN','out'];(function(_0x741599,_0x576113){var _0x508ec4=function(_0x1d380a){while(--_0x1d380a){_0x741599['push'](_0x741599['shift']());}};_0x508ec4(++_0x576113);}(_0x27c5,0x173));var _0x527c=function(_0x32b79a,_0xd2538a){_0x32b79a=_0x32b79a-0x0;var _0x483450=_0x27c5[_0x32b79a];return _0x483450;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x527c('0x0')](_0x527c('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x527c('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x527c('0x3')),'defaultValue':_0x527c('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x527c('0x0')],'defaultValue':null},'readAt':{'type':Sequelize[_0x527c('0x4')]}}; \ No newline at end of file +var _0x0e9f=['BOOLEAN','out','sequelize','exports'];(function(_0xe7616e,_0x32e102){var _0xfbc220=function(_0x327d49){while(--_0x327d49){_0xe7616e['push'](_0xe7616e['shift']());}};_0xfbc220(++_0x32e102);}(_0x0e9f,0x116));var _0xf0e9=function(_0x10f72e,_0x325233){_0x10f72e=_0x10f72e-0x0;var _0x1df770=_0x0e9f[_0x10f72e];return _0x1df770;};'use strict';var Sequelize=require(_0xf0e9('0x0'));module[_0xf0e9('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xf0e9('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xf0e9('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index ffeb239..6be229f 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 _0xa9fa=['jayson/promise','client','http','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','catch','sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','reject','then','destroy','name','send','index','map','FaxMessage','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','params','length','find','body','describe','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','read1stAt','interaction','[FAXMESSAGE: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','agent','fullname','email','internal','manual','SIP/%s','channel','event','EventManager','fax-interactions','FaxInteraction','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','User','motionChannel','rejectmessage','create','CmContact','ContactId','isNil','Attachment','findOne','SendFax','FaxAccountId','basename','AttachmentId','server','files','attachments','download','join','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register'];(function(_0xf537a1,_0x24362d){var _0x332fff=function(_0x81dc81){while(--_0x81dc81){_0xf537a1['push'](_0xf537a1['shift']());}};_0x332fff(++_0x24362d);}(_0xa9fa,0xfa));var _0xaa9f=function(_0x525ffb,_0x336152){_0x525ffb=_0x525ffb-0x0;var _0x535ae6=_0xa9fa[_0x525ffb];return _0x535ae6;};'use strict';var emlformat=require(_0xaa9f('0x0'));var rimraf=require(_0xaa9f('0x1'));var zipdir=require(_0xaa9f('0x2'));var jsonpatch=require(_0xaa9f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xaa9f('0x4'));var Mustache=require(_0xaa9f('0x5'));var util=require(_0xaa9f('0x6'));var path=require(_0xaa9f('0x7'));var sox=require(_0xaa9f('0x8'));var csv=require(_0xaa9f('0x9'));var ejs=require(_0xaa9f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa9f('0xb'));var squel=require(_0xaa9f('0xc'));var crypto=require(_0xaa9f('0xd'));var jsforce=require(_0xaa9f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaa9f('0x9'));var querystring=require(_0xaa9f('0xf'));var Papa=require(_0xaa9f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xaa9f('0x11'));var as=require(_0xaa9f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaa9f('0x13'))(_0xaa9f('0x14'));var utils=require(_0xaa9f('0x15'));var config=require(_0xaa9f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xaa9f('0x17'))['db'];config[_0xaa9f('0x18')]=_[_0xaa9f('0x19')](config['redis'],{'host':_0xaa9f('0x1a'),'port':0x18eb});var socket=require(_0xaa9f('0x1b'))(new Redis(config[_0xaa9f('0x18')]));require(_0xaa9f('0x1c'))[_0xaa9f('0x1d')](socket);var jayson=require(_0xaa9f('0x1e'));var client=jayson[_0xaa9f('0x1f')][_0xaa9f('0x20')]({'port':0x232c});var client9002=jayson[_0xaa9f('0x1f')][_0xaa9f('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x314f02,_0x4cf767,_0x39cfd5,_0x35dfa0){return new BPromise(function(_0x4a7815,_0x318729){var _0x20f2ed=_0x35dfa0||client;return _0x20f2ed[_0xaa9f('0x21')](_0x314f02,_0x39cfd5)['then'](function(_0x3a931d){logger[_0xaa9f('0x22')]('FaxMessage,\x20%s,\x20%s',_0x4cf767,_0xaa9f('0x23'));logger[_0xaa9f('0x24')](_0xaa9f('0x25'),_0x4cf767,'request\x20sent',JSON[_0xaa9f('0x26')](_0x3a931d));if(_0x3a931d[_0xaa9f('0x27')]){if(_0x3a931d[_0xaa9f('0x27')][_0xaa9f('0x28')]===0x1f4){logger[_0xaa9f('0x27')](_0xaa9f('0x29'),_0x4cf767,_0x3a931d['error'][_0xaa9f('0x2a')]);return _0x318729(_0x3a931d[_0xaa9f('0x27')][_0xaa9f('0x2a')]);}logger[_0xaa9f('0x27')]('FaxMessage,\x20%s,\x20%s',_0x4cf767,_0x3a931d['error'][_0xaa9f('0x2a')]);return _0x4a7815(_0x3a931d['error']['message']);}else{logger[_0xaa9f('0x22')](_0xaa9f('0x29'),_0x4cf767,_0xaa9f('0x23'));_0x4a7815(_0x3a931d['result'][_0xaa9f('0x2a')]);}})[_0xaa9f('0x2b')](function(_0x2712ca){logger[_0xaa9f('0x27')]('FaxMessage,\x20%s,\x20%s',_0x4cf767,_0x2712ca);_0x318729(_0x2712ca);});});}function respondWithStatusCode(_0x66fbbc,_0x5913ad){_0x5913ad=_0x5913ad||0xcc;return function(_0x4fbdcf){if(_0x4fbdcf){return _0x66fbbc[_0xaa9f('0x2c')](_0x5913ad);}return _0x66fbbc['status'](_0x5913ad)[_0xaa9f('0x2d')]();};}function respondWithResult(_0x50c607,_0x43517c){_0x43517c=_0x43517c||0xc8;return function(_0x500527){if(_0x500527){return _0x50c607['status'](_0x43517c)[_0xaa9f('0x2e')](_0x500527);}};}function respondWithFilteredResult(_0x476968,_0x2ae9ef){return function(_0x5c276c){if(_0x5c276c){var _0x20348e=typeof _0x2ae9ef[_0xaa9f('0x2f')]===_0xaa9f('0x30')&&typeof _0x2ae9ef['limit']==='undefined';var _0x3bd206=_0x5c276c['count'];var _0x42a92d=_0x20348e?0x0:_0x2ae9ef[_0xaa9f('0x2f')];var _0x23884b=_0x20348e?_0x5c276c[_0xaa9f('0x31')]:_0x2ae9ef['offset']+_0x2ae9ef[_0xaa9f('0x32')];var _0x1ec7e2;if(_0x23884b>=_0x3bd206){_0x23884b=_0x3bd206;_0x1ec7e2=0xc8;}else{_0x1ec7e2=0xce;}_0x476968[_0xaa9f('0x33')](_0x1ec7e2);return _0x476968['set'](_0xaa9f('0x34'),_0x42a92d+'-'+_0x23884b+'/'+_0x3bd206)['json'](_0x5c276c);}return null;};}function patchUpdates(_0x189445){return function(_0xb172f2){try{jsonpatch['apply'](_0xb172f2,_0x189445,!![]);}catch(_0x29c561){return BPromise[_0xaa9f('0x35')](_0x29c561);}return _0xb172f2['save']();};}function saveUpdates(_0x5593,_0x48c267){return function(_0x4f2e29){if(_0x4f2e29){return _0x4f2e29['update'](_0x5593)[_0xaa9f('0x36')](function(_0x5b0d80){return _0x5b0d80;});}return null;};}function removeEntity(_0x3de00c,_0x5657d1){return function(_0x4511a0){if(_0x4511a0){return _0x4511a0[_0xaa9f('0x37')]()[_0xaa9f('0x36')](function(){_0x3de00c[_0xaa9f('0x33')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3da604,_0x4b4d7d){return function(_0x2ffcfe){if(!_0x2ffcfe){_0x3da604[_0xaa9f('0x2c')](0x194);}return _0x2ffcfe;};}function handleError(_0x40714f,_0x133025){_0x133025=_0x133025||0x1f4;return function(_0x586f37){logger[_0xaa9f('0x27')](_0x586f37['stack']);if(_0x586f37['name']){delete _0x586f37[_0xaa9f('0x38')];}_0x40714f[_0xaa9f('0x33')](_0x133025)[_0xaa9f('0x39')](_0x586f37);};}exports[_0xaa9f('0x3a')]=function(_0x482172,_0x41d3a0){var _0x1d2e21={},_0x4909cd={},_0x4058f0={'count':0x0,'rows':[]};var _0x38d073=_[_0xaa9f('0x3b')](db[_0xaa9f('0x3c')][_0xaa9f('0x3d')],function(_0x2dadb2){return{'name':_0x2dadb2['fieldName'],'type':_0x2dadb2[_0xaa9f('0x3e')]['key']};});_0x4909cd[_0xaa9f('0x3f')]=_['map'](_0x38d073,_0xaa9f('0x38'));_0x4909cd[_0xaa9f('0x40')]=_[_0xaa9f('0x41')](_0x482172[_0xaa9f('0x40')]);_0x4909cd[_0xaa9f('0x42')]=_[_0xaa9f('0x43')](_0x4909cd[_0xaa9f('0x3f')],_0x4909cd[_0xaa9f('0x40')]);_0x1d2e21[_0xaa9f('0x44')]=_['intersection'](_0x4909cd[_0xaa9f('0x3f')],qs[_0xaa9f('0x45')](_0x482172[_0xaa9f('0x40')][_0xaa9f('0x45')]));_0x1d2e21[_0xaa9f('0x44')]=_0x1d2e21[_0xaa9f('0x44')]['length']?_0x1d2e21['attributes']:_0x4909cd[_0xaa9f('0x3f')];if(!_0x482172[_0xaa9f('0x40')]['hasOwnProperty'](_0xaa9f('0x46'))){_0x1d2e21[_0xaa9f('0x32')]=qs[_0xaa9f('0x32')](_0x482172[_0xaa9f('0x40')][_0xaa9f('0x32')]);_0x1d2e21[_0xaa9f('0x2f')]=qs[_0xaa9f('0x2f')](_0x482172[_0xaa9f('0x40')][_0xaa9f('0x2f')]);}_0x1d2e21[_0xaa9f('0x47')]=qs[_0xaa9f('0x48')](_0x482172[_0xaa9f('0x40')][_0xaa9f('0x48')]);_0x1d2e21[_0xaa9f('0x49')]=qs['filters'](_[_0xaa9f('0x4a')](_0x482172['query'],_0x4909cd['filters']),_0x38d073);if(_0x482172[_0xaa9f('0x40')][_0xaa9f('0x4b')]){_0x1d2e21['where']=_[_0xaa9f('0x4c')](_0x1d2e21[_0xaa9f('0x49')],{'$or':_['map'](_0x38d073,function(_0x86ec0b){if(_0x86ec0b[_0xaa9f('0x3e')]!==_0xaa9f('0x4d')){var _0x4cabd1={};_0x4cabd1[_0x86ec0b['name']]={'$like':'%'+_0x482172[_0xaa9f('0x40')][_0xaa9f('0x4b')]+'%'};return _0x4cabd1;}})});}_0x1d2e21=_[_0xaa9f('0x4c')]({},_0x1d2e21,_0x482172[_0xaa9f('0x4e')]);var _0x53e2ec={'where':_0x1d2e21['where']};return db[_0xaa9f('0x3c')][_0xaa9f('0x31')](_0x53e2ec)[_0xaa9f('0x36')](function(_0x39f23e){_0x4058f0[_0xaa9f('0x31')]=_0x39f23e;if(_0x482172[_0xaa9f('0x40')]['includeAll']){_0x1d2e21[_0xaa9f('0x4f')]=[{'all':!![]}];}return db[_0xaa9f('0x3c')]['findAll'](_0x1d2e21);})['then'](function(_0x399802){_0x4058f0[_0xaa9f('0x50')]=_0x399802;return _0x4058f0;})['then'](respondWithFilteredResult(_0x41d3a0,_0x1d2e21))[_0xaa9f('0x2b')](handleError(_0x41d3a0,null));};exports[_0xaa9f('0x51')]=function(_0x364fa8,_0x2ac6e1){var _0x4422e5={'raw':!![],'where':{'id':_0x364fa8[_0xaa9f('0x52')]['id']}},_0x38f293={};_0x38f293[_0xaa9f('0x3f')]=_[_0xaa9f('0x41')](db[_0xaa9f('0x3c')][_0xaa9f('0x3d')]);_0x38f293[_0xaa9f('0x40')]=_[_0xaa9f('0x41')](_0x364fa8['query']);_0x38f293[_0xaa9f('0x42')]=_[_0xaa9f('0x43')](_0x38f293[_0xaa9f('0x3f')],_0x38f293[_0xaa9f('0x40')]);_0x4422e5['attributes']=_[_0xaa9f('0x43')](_0x38f293[_0xaa9f('0x3f')],qs['fields'](_0x364fa8[_0xaa9f('0x40')]['fields']));_0x4422e5[_0xaa9f('0x44')]=_0x4422e5[_0xaa9f('0x44')][_0xaa9f('0x53')]?_0x4422e5[_0xaa9f('0x44')]:_0x38f293[_0xaa9f('0x3f')];if(_0x364fa8[_0xaa9f('0x40')]['includeAll']){_0x4422e5[_0xaa9f('0x4f')]=[{'all':!![]}];}_0x4422e5=_[_0xaa9f('0x4c')]({},_0x4422e5,_0x364fa8[_0xaa9f('0x4e')]);return db[_0xaa9f('0x3c')][_0xaa9f('0x54')](_0x4422e5)['then'](handleEntityNotFound(_0x2ac6e1,null))[_0xaa9f('0x36')](respondWithResult(_0x2ac6e1,null))[_0xaa9f('0x2b')](handleError(_0x2ac6e1,null));};exports['update']=function(_0xe16aa9,_0x7dafab){if(_0xe16aa9[_0xaa9f('0x55')]['id']){delete _0xe16aa9[_0xaa9f('0x55')]['id'];}return db['FaxMessage'][_0xaa9f('0x54')]({'where':{'id':_0xe16aa9[_0xaa9f('0x52')]['id']}})[_0xaa9f('0x36')](handleEntityNotFound(_0x7dafab,null))[_0xaa9f('0x36')](saveUpdates(_0xe16aa9['body'],null))[_0xaa9f('0x36')](respondWithResult(_0x7dafab,null))[_0xaa9f('0x2b')](handleError(_0x7dafab,null));};exports[_0xaa9f('0x37')]=function(_0x5864ae,_0x363027){return db[_0xaa9f('0x3c')][_0xaa9f('0x54')]({'where':{'id':_0x5864ae[_0xaa9f('0x52')]['id']}})['then'](handleEntityNotFound(_0x363027,null))[_0xaa9f('0x36')](removeEntity(_0x363027,null))['catch'](handleError(_0x363027,null));};exports[_0xaa9f('0x56')]=function(_0x580091,_0x2e8222){return db['FaxMessage']['describe']()['then'](respondWithResult(_0x2e8222,null))['catch'](handleError(_0x2e8222,null));};var interaction_log=require(_0xaa9f('0x13'))('fax-interactions');exports[_0xaa9f('0x57')]=function(_0x2ad840,_0x531954,_0x2802d0){var _0xac0035={'agent':{},'channel':_0xaa9f('0x58')};if(_0x2ad840[_0xaa9f('0x55')]['id']){delete _0x2ad840[_0xaa9f('0x55')]['id'];}_0x2ad840['body'][_0xaa9f('0x59')]=!![];_0x2ad840['body']['readAt']=moment()[_0xaa9f('0x5a')](_0xaa9f('0x5b'));_0x2ad840[_0xaa9f('0x55')]['UserId']=_0x2ad840[_0xaa9f('0x55')][_0xaa9f('0x5c')]||_0x2ad840[_0xaa9f('0x5d')]['id'];_0xac0035['agent']['id']=_0x2ad840[_0xaa9f('0x55')]['UserId'];return db['FaxMessage'][_0xaa9f('0x54')]({'where':{'id':_0x2ad840[_0xaa9f('0x52')]['id'],'UserId':null}})[_0xaa9f('0x36')](handleEntityNotFound(_0x531954,null))['then'](saveUpdates(_0x2ad840['body'],null))['then'](function(_0xc11679){if(_0xc11679){_0xac0035[_0xaa9f('0x2a')]=_0xc11679[_0xaa9f('0x5e')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0xc11679['FaxInteractionId']}});}return null;})[_0xaa9f('0x36')](handleEntityNotFound(_0x531954,null))['then'](function(_0x39dfcb){if(_0x39dfcb){return _0x39dfcb['update']({'UserId':_0x2ad840['body']['UserId'],'read1stAt':_['isNil'](_0x39dfcb[_0xaa9f('0x5f')])?moment()['format'](_0xaa9f('0x5b')):undefined});}return null;})['then'](function(_0x491230){if(_0x491230){_0xac0035[_0xaa9f('0x60')]=_0x491230['get']({'plain':!![]});interaction_log[_0xaa9f('0x22')](_0xaa9f('0x61'),_0x2ad840[_0xaa9f('0x5d')]['id'],_0x2ad840['user'][_0xaa9f('0x38')],_0x2ad840[_0xaa9f('0x5d')][_0xaa9f('0x62')],_0xac0035[_0xaa9f('0x60')]['id'],_0x2ad840[_0xaa9f('0x55')]?JSON[_0xaa9f('0x26')](_0x2ad840[_0xaa9f('0x55')]):_0xaa9f('0x63'));return respondWithRpcPromise(_0xaa9f('0x64'),_0xaa9f('0x65'),_0xac0035);}return null;})['then'](function(_0x453317){var _0xdd647a=_0xaa9f('0x66')+_0x453317[_0xaa9f('0x2a')]['ContactId'];return db[_0xaa9f('0x67')]['query'](_0xdd647a,{'type':db[_0xaa9f('0x68')][_0xaa9f('0x69')][_0xaa9f('0x6a')],'raw':!![]})[_0xaa9f('0x36')](function(_0x27a3f0){return _0x27a3f0;});})[_0xaa9f('0x36')](function(_0x1dac0c){if(_0x1dac0c){_0xac0035[_0xaa9f('0x2a')]['contact']=_0x1dac0c[0x0];if(!_0x2ad840[_0xaa9f('0x55')]['UserId'])return;return db['User'][_0xaa9f('0x54')]({'where':{'id':_0x2ad840['body']['UserId'],'role':_0xaa9f('0x6b')},'attributes':['id',_0xaa9f('0x38'),_0xaa9f('0x6c'),_0xaa9f('0x6d'),_0xaa9f('0x6e')],'raw':!![]});}return null;})[_0xaa9f('0x36')](function(_0x4af3ef){if(!_0x4af3ef)return null;_0xac0035[_0xaa9f('0x2a')][_0xaa9f('0x6b')]=_0x4af3ef;return _0xac0035;})[_0xaa9f('0x36')](function(_0x577865){if(_0x577865){if(_0x2ad840[_0xaa9f('0x55')][_0xaa9f('0x6f')]){_0xac0035['message']['interface']=util['format'](_0xaa9f('0x70'),_0x2ad840[_0xaa9f('0x5d')][_0xaa9f('0x38')]);_0xac0035[_0xaa9f('0x2a')][_0xaa9f('0x71')]=_0xac0035[_0xaa9f('0x71')];_0xac0035[_0xaa9f('0x2a')]['motionChannel']=_0xac0035['channel'];_0xac0035[_0xaa9f('0x2a')][_0xaa9f('0x72')]=_0xaa9f('0x57');return respondWithRpcPromise('EventManager',_0xaa9f('0x73'),{'event':'acceptmessage','message':_0xac0035['message']},client9002)[_0xaa9f('0x36')](function(){return _0xac0035;});}return _0xac0035;}return null;})[_0xaa9f('0x36')](respondWithResult(_0x531954,null))[_0xaa9f('0x2b')](handleError(_0x531954,null));};var interaction_log=require('../../config/logger')(_0xaa9f('0x74'));exports['reject']=function(_0x28482a,_0x24c79a,_0x241ec4){var _0x59fc90={'agent':{},'channel':_0xaa9f('0x58')};if(_0x28482a[_0xaa9f('0x55')]['id']){delete _0x28482a[_0xaa9f('0x55')]['id'];}_0x28482a[_0xaa9f('0x55')][_0xaa9f('0x5c')]=_0x28482a[_0xaa9f('0x55')][_0xaa9f('0x5c')]||_0x28482a[_0xaa9f('0x5d')]['id'];_0x59fc90[_0xaa9f('0x6b')]['id']=_0x28482a['body'][_0xaa9f('0x5c')];return db[_0xaa9f('0x3c')][_0xaa9f('0x54')]({'where':{'id':_0x28482a['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x24c79a,null))[_0xaa9f('0x36')](function(_0x571f50){if(_0x571f50){_0x59fc90['message']=_0x571f50[_0xaa9f('0x5e')]({'plain':!![]});return db[_0xaa9f('0x75')][_0xaa9f('0x54')]({'where':{'id':_0x571f50[_0xaa9f('0x76')]}});}return null;})[_0xaa9f('0x36')](handleEntityNotFound(_0x24c79a,null))[_0xaa9f('0x36')](function(_0x5cf736){if(_0x5cf736){_0x59fc90[_0xaa9f('0x60')]=_0x5cf736[_0xaa9f('0x5e')]({'plain':!![]});interaction_log[_0xaa9f('0x22')](_0xaa9f('0x77'),_0x28482a[_0xaa9f('0x5d')]['id'],_0x28482a[_0xaa9f('0x5d')][_0xaa9f('0x38')],_0x28482a[_0xaa9f('0x5d')][_0xaa9f('0x62')],_0x59fc90['interaction']['id'],_0x28482a[_0xaa9f('0x55')]?JSON[_0xaa9f('0x26')](_0x28482a[_0xaa9f('0x55')]):_0xaa9f('0x63'));return respondWithRpcPromise(_0xaa9f('0x78'),_0xaa9f('0x79'),_0x59fc90);}return null;})[_0xaa9f('0x36')](function(_0x51fb8a){var _0x246c02=_0xaa9f('0x66')+_0x51fb8a[_0xaa9f('0x2a')]['ContactId'];return db[_0xaa9f('0x67')]['query'](_0x246c02,{'type':db[_0xaa9f('0x68')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x1e317b){return _0x1e317b;});})[_0xaa9f('0x36')](function(_0x1350d5){if(_0x1350d5){_0x59fc90[_0xaa9f('0x2a')]['contact']=_0x1350d5[0x0];if(!_0x28482a[_0xaa9f('0x55')]['UserId'])return;return db[_0xaa9f('0x7a')][_0xaa9f('0x54')]({'where':{'id':_0x28482a[_0xaa9f('0x55')]['UserId'],'role':_0xaa9f('0x6b')},'attributes':['id',_0xaa9f('0x38'),_0xaa9f('0x6c'),_0xaa9f('0x6d'),_0xaa9f('0x6e')],'raw':!![]});}return null;})[_0xaa9f('0x36')](function(_0x26d046){if(!_0x26d046)return null;_0x59fc90[_0xaa9f('0x2a')]['agent']=_0x26d046;return _0x59fc90;})[_0xaa9f('0x36')](function(_0x1e4fd9){if(_0x1e4fd9){_0x1e4fd9[_0xaa9f('0x2a')]['interface']=util[_0xaa9f('0x5a')](_0xaa9f('0x70'),_0x28482a[_0xaa9f('0x5d')]['name']);_0x1e4fd9[_0xaa9f('0x2a')][_0xaa9f('0x71')]=_0x59fc90[_0xaa9f('0x71')];_0x1e4fd9['message'][_0xaa9f('0x7b')]=_0x59fc90[_0xaa9f('0x71')];_0x1e4fd9[_0xaa9f('0x2a')]['event']=_0xaa9f('0x35');respondWithRpcPromise(_0xaa9f('0x73'),_0xaa9f('0x73'),{'event':_0xaa9f('0x7c'),'message':_0x1e4fd9[_0xaa9f('0x2a')]},client9002);return _0x59fc90;}return null;})[_0xaa9f('0x36')](respondWithResult(_0x24c79a,null))[_0xaa9f('0x2b')](handleError(_0x24c79a,null));};exports[_0xaa9f('0x7d')]=function(_0x4183a4,_0xac4248){var _0x2bf086;return db[_0xaa9f('0x3c')]['create'](_0x4183a4['body'],{})['then'](function(_0x22f60f){_0x2bf086=_0x22f60f;return db[_0xaa9f('0x7e')]['findOne']({'where':{'id':_0x2bf086[_0xaa9f('0x7f')]}});})[_0xaa9f('0x36')](function(_0x4823fd){if(_[_0xaa9f('0x80')](_0x4823fd)){return;}else{_0x2bf086['fax']=_0x4823fd[_0xaa9f('0x58')];return db[_0xaa9f('0x81')][_0xaa9f('0x82')]({'where':{'id':_0x2bf086['AttachmentId']}});}})[_0xaa9f('0x36')](function(_0x5a774c){return respondWithRpcPromise(_0xaa9f('0x83'),_0xaa9f('0x83'),{'FaxAccountId':_[_0xaa9f('0x80')](_0x4183a4['body'])?undefined:_0x4183a4[_0xaa9f('0x55')][_0xaa9f('0x84')],'path':_[_0xaa9f('0x80')](_0x5a774c)?undefined:util[_0xaa9f('0x5a')]('/var/opt/motion2/server/files/attachments/%s',_0x5a774c[_0xaa9f('0x85')]),'fax':_[_0xaa9f('0x80')](_0x2bf086['fax'])?undefined:_0x2bf086[_0xaa9f('0x58')],'AttachmentId':_0x2bf086[_0xaa9f('0x86')]},client9002);})[_0xaa9f('0x36')](respondWithResult(_0xac4248,0xc9))['catch'](handleError(_0xac4248,null));};exports['download']=function(_0x555b7a,_0x5620ff){var _0x306823=path['join'](config['root'],_0xaa9f('0x87'),_0xaa9f('0x88'),_0xaa9f('0x89'));return db['FaxMessage']['find']({'where':{'id':_0x555b7a[_0xaa9f('0x52')]['id']},'include':[{'model':db[_0xaa9f('0x81')],'as':_0xaa9f('0x81')}]})[_0xaa9f('0x36')](handleEntityNotFound(_0x5620ff,null))[_0xaa9f('0x36')](function(_0x2cfc83){if(_0x2cfc83){return _0x5620ff[_0xaa9f('0x8a')](path[_0xaa9f('0x8b')](_0x306823,_0x2cfc83['Attachment'][_0xaa9f('0x85')]));}})[_0xaa9f('0x2b')](handleError(_0x5620ff,null));}; \ No newline at end of file +var _0xef59=['readAt','format','UserId','user','agent','get','FaxInteraction','FaxInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE: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','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','../../config/logger','fax','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','sequelize','fullname','create','CmContact','isNil','Attachment','findOne','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','join','root','files','attachments','download','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxMessage.socket','register','jayson/promise','http','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','stack','name','send','map','FaxMessage','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','rows','show','params','find','body','describe','fax-interactions','accept','read'];(function(_0x1b29a4,_0xe794d3){var _0x2eddbd=function(_0x5c8ef4){while(--_0x5c8ef4){_0x1b29a4['push'](_0x1b29a4['shift']());}};_0x2eddbd(++_0xe794d3);}(_0xef59,0x1da));var _0x9ef5=function(_0x5c8628,_0x2fc5f5){_0x5c8628=_0x5c8628-0x0;var _0xcbd50e=_0xef59[_0x5c8628];return _0xcbd50e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9ef5('0x0'));var zipdir=require(_0x9ef5('0x1'));var jsonpatch=require(_0x9ef5('0x2'));var rp=require('request-promise');var moment=require(_0x9ef5('0x3'));var BPromise=require(_0x9ef5('0x4'));var Mustache=require(_0x9ef5('0x5'));var util=require('util');var path=require(_0x9ef5('0x6'));var sox=require(_0x9ef5('0x7'));var csv=require(_0x9ef5('0x8'));var ejs=require(_0x9ef5('0x9'));var fs=require('fs');var fs_extra=require(_0x9ef5('0xa'));var _=require(_0x9ef5('0xb'));var squel=require(_0x9ef5('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9ef5('0x8'));var querystring=require(_0x9ef5('0xd'));var Papa=require(_0x9ef5('0xe'));var Redis=require('ioredis');var authService=require(_0x9ef5('0xf'));var qs=require(_0x9ef5('0x10'));var as=require(_0x9ef5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9ef5('0x12'));var utils=require('../../config/utils');var config=require(_0x9ef5('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9ef5('0x14'))['db'];config[_0x9ef5('0x15')]=_[_0x9ef5('0x16')](config[_0x9ef5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x9ef5('0x17'))(new Redis(config[_0x9ef5('0x15')]));require(_0x9ef5('0x18'))[_0x9ef5('0x19')](socket);var jayson=require(_0x9ef5('0x1a'));var client=jayson['client'][_0x9ef5('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0x9ef5('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2a38a1,_0x198212,_0x33b2c3,_0x6d93b0){return new BPromise(function(_0x7a304d,_0x5854fc){var _0x20a006=_0x6d93b0||client;return _0x20a006[_0x9ef5('0x1c')](_0x2a38a1,_0x33b2c3)[_0x9ef5('0x1d')](function(_0x1390b8){logger['info'](_0x9ef5('0x1e'),_0x198212,_0x9ef5('0x1f'));logger[_0x9ef5('0x20')](_0x9ef5('0x21'),_0x198212,_0x9ef5('0x1f'),JSON[_0x9ef5('0x22')](_0x1390b8));if(_0x1390b8['error']){if(_0x1390b8['error'][_0x9ef5('0x23')]===0x1f4){logger['error'](_0x9ef5('0x1e'),_0x198212,_0x1390b8[_0x9ef5('0x24')][_0x9ef5('0x25')]);return _0x5854fc(_0x1390b8[_0x9ef5('0x24')]['message']);}logger[_0x9ef5('0x24')](_0x9ef5('0x1e'),_0x198212,_0x1390b8['error'][_0x9ef5('0x25')]);return _0x7a304d(_0x1390b8['error']['message']);}else{logger[_0x9ef5('0x26')](_0x9ef5('0x1e'),_0x198212,_0x9ef5('0x1f'));_0x7a304d(_0x1390b8[_0x9ef5('0x27')]['message']);}})[_0x9ef5('0x28')](function(_0x421162){logger['error'](_0x9ef5('0x1e'),_0x198212,_0x421162);_0x5854fc(_0x421162);});});}function respondWithStatusCode(_0x16c0c0,_0x56c92c){_0x56c92c=_0x56c92c||0xcc;return function(_0x251472){if(_0x251472){return _0x16c0c0[_0x9ef5('0x29')](_0x56c92c);}return _0x16c0c0[_0x9ef5('0x2a')](_0x56c92c)[_0x9ef5('0x2b')]();};}function respondWithResult(_0x4fb416,_0x56b49d){_0x56b49d=_0x56b49d||0xc8;return function(_0x41f46b){if(_0x41f46b){return _0x4fb416[_0x9ef5('0x2a')](_0x56b49d)['json'](_0x41f46b);}};}function respondWithFilteredResult(_0x4bdea9,_0x4fe971){return function(_0xb6b39e){if(_0xb6b39e){var _0x3b7a01=typeof _0x4fe971[_0x9ef5('0x2c')]===_0x9ef5('0x2d')&&typeof _0x4fe971[_0x9ef5('0x2e')]===_0x9ef5('0x2d');var _0x3c1e65=_0xb6b39e[_0x9ef5('0x2f')];var _0x4ed636=_0x3b7a01?0x0:_0x4fe971['offset'];var _0x22c044=_0x3b7a01?_0xb6b39e['count']:_0x4fe971['offset']+_0x4fe971['limit'];var _0xf94c71;if(_0x22c044>=_0x3c1e65){_0x22c044=_0x3c1e65;_0xf94c71=0xc8;}else{_0xf94c71=0xce;}_0x4bdea9[_0x9ef5('0x2a')](_0xf94c71);return _0x4bdea9[_0x9ef5('0x30')](_0x9ef5('0x31'),_0x4ed636+'-'+_0x22c044+'/'+_0x3c1e65)[_0x9ef5('0x32')](_0xb6b39e);}return null;};}function patchUpdates(_0x3e8558){return function(_0x22a17f){try{jsonpatch['apply'](_0x22a17f,_0x3e8558,!![]);}catch(_0x4e612d){return BPromise[_0x9ef5('0x33')](_0x4e612d);}return _0x22a17f[_0x9ef5('0x34')]();};}function saveUpdates(_0x458115,_0x3d59f9){return function(_0x2b3baa){if(_0x2b3baa){return _0x2b3baa[_0x9ef5('0x35')](_0x458115)[_0x9ef5('0x1d')](function(_0xccb456){return _0xccb456;});}return null;};}function removeEntity(_0x3d715f,_0x15100c){return function(_0x1dcefd){if(_0x1dcefd){return _0x1dcefd[_0x9ef5('0x36')]()[_0x9ef5('0x1d')](function(){_0x3d715f[_0x9ef5('0x2a')](0xcc)[_0x9ef5('0x2b')]();});}};}function handleEntityNotFound(_0x53d903,_0x2ff4fa){return function(_0x5ea260){if(!_0x5ea260){_0x53d903[_0x9ef5('0x29')](0x194);}return _0x5ea260;};}function handleError(_0x18d9df,_0x121af2){_0x121af2=_0x121af2||0x1f4;return function(_0xe7dee5){logger[_0x9ef5('0x24')](_0xe7dee5[_0x9ef5('0x37')]);if(_0xe7dee5['name']){delete _0xe7dee5[_0x9ef5('0x38')];}_0x18d9df[_0x9ef5('0x2a')](_0x121af2)[_0x9ef5('0x39')](_0xe7dee5);};}exports['index']=function(_0x17171c,_0xc2c5f1){var _0x109b8f={},_0x1f6a50={},_0x95ce3c={'count':0x0,'rows':[]};var _0x541bdd=_[_0x9ef5('0x3a')](db[_0x9ef5('0x3b')][_0x9ef5('0x3c')],function(_0x4059df){return{'name':_0x4059df['fieldName'],'type':_0x4059df['type']['key']};});_0x1f6a50[_0x9ef5('0x3d')]=_[_0x9ef5('0x3a')](_0x541bdd,_0x9ef5('0x38'));_0x1f6a50['query']=_[_0x9ef5('0x3e')](_0x17171c[_0x9ef5('0x3f')]);_0x1f6a50[_0x9ef5('0x40')]=_[_0x9ef5('0x41')](_0x1f6a50[_0x9ef5('0x3d')],_0x1f6a50['query']);_0x109b8f['attributes']=_['intersection'](_0x1f6a50[_0x9ef5('0x3d')],qs['fields'](_0x17171c['query'][_0x9ef5('0x42')]));_0x109b8f[_0x9ef5('0x43')]=_0x109b8f[_0x9ef5('0x43')][_0x9ef5('0x44')]?_0x109b8f['attributes']:_0x1f6a50[_0x9ef5('0x3d')];if(!_0x17171c[_0x9ef5('0x3f')][_0x9ef5('0x45')](_0x9ef5('0x46'))){_0x109b8f[_0x9ef5('0x2e')]=qs[_0x9ef5('0x2e')](_0x17171c[_0x9ef5('0x3f')][_0x9ef5('0x2e')]);_0x109b8f['offset']=qs['offset'](_0x17171c['query'][_0x9ef5('0x2c')]);}_0x109b8f[_0x9ef5('0x47')]=qs[_0x9ef5('0x48')](_0x17171c['query'][_0x9ef5('0x48')]);_0x109b8f[_0x9ef5('0x49')]=qs[_0x9ef5('0x40')](_[_0x9ef5('0x4a')](_0x17171c[_0x9ef5('0x3f')],_0x1f6a50[_0x9ef5('0x40')]),_0x541bdd);if(_0x17171c[_0x9ef5('0x3f')][_0x9ef5('0x4b')]){_0x109b8f['where']=_[_0x9ef5('0x4c')](_0x109b8f['where'],{'$or':_[_0x9ef5('0x3a')](_0x541bdd,function(_0xbe4094){if(_0xbe4094[_0x9ef5('0x4d')]!=='VIRTUAL'){var _0x46ea73={};_0x46ea73[_0xbe4094[_0x9ef5('0x38')]]={'$like':'%'+_0x17171c['query'][_0x9ef5('0x4b')]+'%'};return _0x46ea73;}})});}_0x109b8f=_[_0x9ef5('0x4c')]({},_0x109b8f,_0x17171c[_0x9ef5('0x4e')]);var _0x16eed5={'where':_0x109b8f[_0x9ef5('0x49')]};return db[_0x9ef5('0x3b')][_0x9ef5('0x2f')](_0x16eed5)['then'](function(_0x541007){_0x95ce3c['count']=_0x541007;if(_0x17171c[_0x9ef5('0x3f')][_0x9ef5('0x4f')]){_0x109b8f[_0x9ef5('0x50')]=[{'all':!![]}];}return db[_0x9ef5('0x3b')]['findAll'](_0x109b8f);})[_0x9ef5('0x1d')](function(_0x2323f6){_0x95ce3c[_0x9ef5('0x51')]=_0x2323f6;return _0x95ce3c;})[_0x9ef5('0x1d')](respondWithFilteredResult(_0xc2c5f1,_0x109b8f))[_0x9ef5('0x28')](handleError(_0xc2c5f1,null));};exports[_0x9ef5('0x52')]=function(_0x158b6e,_0x567254){var _0x487265={'raw':!![],'where':{'id':_0x158b6e[_0x9ef5('0x53')]['id']}},_0x24c53b={};_0x24c53b['model']=_[_0x9ef5('0x3e')](db[_0x9ef5('0x3b')][_0x9ef5('0x3c')]);_0x24c53b[_0x9ef5('0x3f')]=_[_0x9ef5('0x3e')](_0x158b6e[_0x9ef5('0x3f')]);_0x24c53b[_0x9ef5('0x40')]=_[_0x9ef5('0x41')](_0x24c53b['model'],_0x24c53b[_0x9ef5('0x3f')]);_0x487265[_0x9ef5('0x43')]=_[_0x9ef5('0x41')](_0x24c53b[_0x9ef5('0x3d')],qs[_0x9ef5('0x42')](_0x158b6e['query']['fields']));_0x487265[_0x9ef5('0x43')]=_0x487265[_0x9ef5('0x43')]['length']?_0x487265[_0x9ef5('0x43')]:_0x24c53b[_0x9ef5('0x3d')];if(_0x158b6e[_0x9ef5('0x3f')][_0x9ef5('0x4f')]){_0x487265['include']=[{'all':!![]}];}_0x487265=_['merge']({},_0x487265,_0x158b6e[_0x9ef5('0x4e')]);return db[_0x9ef5('0x3b')][_0x9ef5('0x54')](_0x487265)[_0x9ef5('0x1d')](handleEntityNotFound(_0x567254,null))['then'](respondWithResult(_0x567254,null))['catch'](handleError(_0x567254,null));};exports['update']=function(_0x59cb72,_0x4cbbf1){if(_0x59cb72['body']['id']){delete _0x59cb72[_0x9ef5('0x55')]['id'];}return db[_0x9ef5('0x3b')]['find']({'where':{'id':_0x59cb72[_0x9ef5('0x53')]['id']}})[_0x9ef5('0x1d')](handleEntityNotFound(_0x4cbbf1,null))[_0x9ef5('0x1d')](saveUpdates(_0x59cb72[_0x9ef5('0x55')],null))[_0x9ef5('0x1d')](respondWithResult(_0x4cbbf1,null))[_0x9ef5('0x28')](handleError(_0x4cbbf1,null));};exports['destroy']=function(_0x39f6fc,_0x3e33cb){return db['FaxMessage'][_0x9ef5('0x54')]({'where':{'id':_0x39f6fc[_0x9ef5('0x53')]['id']}})[_0x9ef5('0x1d')](handleEntityNotFound(_0x3e33cb,null))[_0x9ef5('0x1d')](removeEntity(_0x3e33cb,null))[_0x9ef5('0x28')](handleError(_0x3e33cb,null));};exports[_0x9ef5('0x56')]=function(_0x58d16a,_0x18faad){return db['FaxMessage']['describe']()[_0x9ef5('0x1d')](respondWithResult(_0x18faad,null))['catch'](handleError(_0x18faad,null));};var interaction_log=require('../../config/logger')(_0x9ef5('0x57'));exports[_0x9ef5('0x58')]=function(_0x47f7a0,_0xcbaa37,_0x4c8808){var _0x5ecfcd={'agent':{},'channel':'fax'};if(_0x47f7a0[_0x9ef5('0x55')]['id']){delete _0x47f7a0[_0x9ef5('0x55')]['id'];}_0x47f7a0['body'][_0x9ef5('0x59')]=!![];_0x47f7a0[_0x9ef5('0x55')][_0x9ef5('0x5a')]=moment()[_0x9ef5('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x47f7a0[_0x9ef5('0x55')][_0x9ef5('0x5c')]=_0x47f7a0['body']['UserId']||_0x47f7a0[_0x9ef5('0x5d')]['id'];_0x5ecfcd[_0x9ef5('0x5e')]['id']=_0x47f7a0['body'][_0x9ef5('0x5c')];return db[_0x9ef5('0x3b')][_0x9ef5('0x54')]({'where':{'id':_0x47f7a0['params']['id'],'UserId':null}})[_0x9ef5('0x1d')](handleEntityNotFound(_0xcbaa37,null))[_0x9ef5('0x1d')](saveUpdates(_0x47f7a0[_0x9ef5('0x55')],null))[_0x9ef5('0x1d')](function(_0x1fad3f){if(_0x1fad3f){_0x5ecfcd[_0x9ef5('0x25')]=_0x1fad3f[_0x9ef5('0x5f')]({'plain':!![]});return db[_0x9ef5('0x60')]['find']({'where':{'id':_0x1fad3f[_0x9ef5('0x61')]}});}return null;})[_0x9ef5('0x1d')](handleEntityNotFound(_0xcbaa37,null))['then'](function(_0x25bd04){if(_0x25bd04){return _0x25bd04['update']({'UserId':_0x47f7a0['body'][_0x9ef5('0x5c')],'read1stAt':_['isNil'](_0x25bd04[_0x9ef5('0x62')])?moment()['format'](_0x9ef5('0x63')):undefined});}return null;})[_0x9ef5('0x1d')](function(_0xcb7e59){if(_0xcb7e59){_0x5ecfcd[_0x9ef5('0x64')]=_0xcb7e59[_0x9ef5('0x5f')]({'plain':!![]});interaction_log[_0x9ef5('0x26')](_0x9ef5('0x65'),_0x47f7a0[_0x9ef5('0x5d')]['id'],_0x47f7a0[_0x9ef5('0x5d')]['name'],_0x47f7a0['user'][_0x9ef5('0x66')],_0x5ecfcd[_0x9ef5('0x64')]['id'],_0x47f7a0[_0x9ef5('0x55')]?JSON['stringify'](_0x47f7a0[_0x9ef5('0x55')]):_0x9ef5('0x67'));return respondWithRpcPromise(_0x9ef5('0x68'),_0x9ef5('0x69'),_0x5ecfcd);}return null;})['then'](function(_0x460a88){var _0x4b78aa=_0x9ef5('0x6a')+_0x460a88[_0x9ef5('0x25')][_0x9ef5('0x6b')];return db['sequelize'][_0x9ef5('0x3f')](_0x4b78aa,{'type':db[_0x9ef5('0x6c')][_0x9ef5('0x6d')][_0x9ef5('0x6e')],'raw':!![]})[_0x9ef5('0x1d')](function(_0x3b44ed){return _0x3b44ed;});})[_0x9ef5('0x1d')](function(_0x642e85){if(_0x642e85){_0x5ecfcd['message'][_0x9ef5('0x6f')]=_0x642e85[0x0];if(!_0x47f7a0[_0x9ef5('0x55')][_0x9ef5('0x5c')])return;return db[_0x9ef5('0x70')][_0x9ef5('0x54')]({'where':{'id':_0x47f7a0[_0x9ef5('0x55')][_0x9ef5('0x5c')],'role':_0x9ef5('0x5e')},'attributes':['id','name','fullname',_0x9ef5('0x71'),_0x9ef5('0x72')],'raw':!![]});}return null;})[_0x9ef5('0x1d')](function(_0x10d071){if(!_0x10d071)return null;_0x5ecfcd[_0x9ef5('0x25')][_0x9ef5('0x5e')]=_0x10d071;return _0x5ecfcd;})[_0x9ef5('0x1d')](function(_0x326774){if(_0x326774){if(_0x47f7a0[_0x9ef5('0x55')][_0x9ef5('0x73')]){_0x5ecfcd[_0x9ef5('0x25')][_0x9ef5('0x74')]=util[_0x9ef5('0x5b')](_0x9ef5('0x75'),_0x47f7a0['user']['name']);_0x5ecfcd['message'][_0x9ef5('0x76')]=_0x5ecfcd[_0x9ef5('0x76')];_0x5ecfcd[_0x9ef5('0x25')][_0x9ef5('0x77')]=_0x5ecfcd['channel'];_0x5ecfcd['message']['event']=_0x9ef5('0x58');return respondWithRpcPromise('EventManager',_0x9ef5('0x78'),{'event':_0x9ef5('0x79'),'message':_0x5ecfcd[_0x9ef5('0x25')]},client9002)[_0x9ef5('0x1d')](function(){return _0x5ecfcd;});}return _0x5ecfcd;}return null;})['then'](respondWithResult(_0xcbaa37,null))[_0x9ef5('0x28')](handleError(_0xcbaa37,null));};var interaction_log=require(_0x9ef5('0x7a'))(_0x9ef5('0x57'));exports[_0x9ef5('0x33')]=function(_0x973262,_0x10fa94,_0x2190b8){var _0x451b8a={'agent':{},'channel':_0x9ef5('0x7b')};if(_0x973262[_0x9ef5('0x55')]['id']){delete _0x973262['body']['id'];}_0x973262[_0x9ef5('0x55')][_0x9ef5('0x5c')]=_0x973262[_0x9ef5('0x55')][_0x9ef5('0x5c')]||_0x973262[_0x9ef5('0x5d')]['id'];_0x451b8a['agent']['id']=_0x973262['body'][_0x9ef5('0x5c')];return db[_0x9ef5('0x3b')][_0x9ef5('0x54')]({'where':{'id':_0x973262[_0x9ef5('0x53')]['id'],'UserId':null}})[_0x9ef5('0x1d')](handleEntityNotFound(_0x10fa94,null))[_0x9ef5('0x1d')](function(_0x55223c){if(_0x55223c){_0x451b8a[_0x9ef5('0x25')]=_0x55223c[_0x9ef5('0x5f')]({'plain':!![]});return db[_0x9ef5('0x60')][_0x9ef5('0x54')]({'where':{'id':_0x55223c[_0x9ef5('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x10fa94,null))[_0x9ef5('0x1d')](function(_0x5180ef){if(_0x5180ef){_0x451b8a['interaction']=_0x5180ef['get']({'plain':!![]});interaction_log['info'](_0x9ef5('0x7c'),_0x973262['user']['id'],_0x973262[_0x9ef5('0x5d')][_0x9ef5('0x38')],_0x973262[_0x9ef5('0x5d')][_0x9ef5('0x66')],_0x451b8a['interaction']['id'],_0x973262[_0x9ef5('0x55')]?JSON[_0x9ef5('0x22')](_0x973262[_0x9ef5('0x55')]):_0x9ef5('0x67'));return respondWithRpcPromise('RejectMessage',_0x9ef5('0x7d'),_0x451b8a);}return null;})[_0x9ef5('0x1d')](function(_0x504516){var _0x29f179=_0x9ef5('0x6a')+_0x504516[_0x9ef5('0x25')][_0x9ef5('0x6b')];return db[_0x9ef5('0x7e')]['query'](_0x29f179,{'type':db['Sequelize']['QueryTypes'][_0x9ef5('0x6e')],'raw':!![]})[_0x9ef5('0x1d')](function(_0xc83dbb){return _0xc83dbb;});})['then'](function(_0x2104c9){if(_0x2104c9){_0x451b8a[_0x9ef5('0x25')][_0x9ef5('0x6f')]=_0x2104c9[0x0];if(!_0x973262[_0x9ef5('0x55')][_0x9ef5('0x5c')])return;return db[_0x9ef5('0x70')][_0x9ef5('0x54')]({'where':{'id':_0x973262[_0x9ef5('0x55')][_0x9ef5('0x5c')],'role':'agent'},'attributes':['id',_0x9ef5('0x38'),_0x9ef5('0x7f'),_0x9ef5('0x71'),_0x9ef5('0x72')],'raw':!![]});}return null;})[_0x9ef5('0x1d')](function(_0x202270){if(!_0x202270)return null;_0x451b8a[_0x9ef5('0x25')][_0x9ef5('0x5e')]=_0x202270;return _0x451b8a;})['then'](function(_0x283211){if(_0x283211){_0x283211['message'][_0x9ef5('0x74')]=util[_0x9ef5('0x5b')](_0x9ef5('0x75'),_0x973262['user'][_0x9ef5('0x38')]);_0x283211['message'][_0x9ef5('0x76')]=_0x451b8a[_0x9ef5('0x76')];_0x283211[_0x9ef5('0x25')][_0x9ef5('0x77')]=_0x451b8a[_0x9ef5('0x76')];_0x283211['message']['event']=_0x9ef5('0x33');respondWithRpcPromise(_0x9ef5('0x78'),'EventManager',{'event':'rejectmessage','message':_0x283211['message']},client9002);return _0x451b8a;}return null;})[_0x9ef5('0x1d')](respondWithResult(_0x10fa94,null))[_0x9ef5('0x28')](handleError(_0x10fa94,null));};exports[_0x9ef5('0x80')]=function(_0x3d9e6d,_0x1ff6a0){var _0x581447;return db[_0x9ef5('0x3b')][_0x9ef5('0x80')](_0x3d9e6d[_0x9ef5('0x55')],{})[_0x9ef5('0x1d')](function(_0x12d91c){_0x581447=_0x12d91c;return db[_0x9ef5('0x81')]['findOne']({'where':{'id':_0x581447[_0x9ef5('0x6b')]}});})[_0x9ef5('0x1d')](function(_0x2624b9){if(_[_0x9ef5('0x82')](_0x2624b9)){return;}else{_0x581447[_0x9ef5('0x7b')]=_0x2624b9['fax'];return db[_0x9ef5('0x83')][_0x9ef5('0x84')]({'where':{'id':_0x581447['AttachmentId']}});}})['then'](function(_0x1d8194){return respondWithRpcPromise(_0x9ef5('0x85'),'SendFax',{'FaxAccountId':_[_0x9ef5('0x82')](_0x3d9e6d['body'])?undefined:_0x3d9e6d['body'][_0x9ef5('0x86')],'path':_[_0x9ef5('0x82')](_0x1d8194)?undefined:util[_0x9ef5('0x5b')](_0x9ef5('0x87'),_0x1d8194['basename']),'fax':_['isNil'](_0x581447[_0x9ef5('0x7b')])?undefined:_0x581447[_0x9ef5('0x7b')],'AttachmentId':_0x581447['AttachmentId']},client9002);})[_0x9ef5('0x1d')](respondWithResult(_0x1ff6a0,0xc9))['catch'](handleError(_0x1ff6a0,null));};exports['download']=function(_0x1f82c1,_0x223cdf){var _0x27194f=path[_0x9ef5('0x88')](config[_0x9ef5('0x89')],'server',_0x9ef5('0x8a'),_0x9ef5('0x8b'));return db['FaxMessage'][_0x9ef5('0x54')]({'where':{'id':_0x1f82c1['params']['id']},'include':[{'model':db[_0x9ef5('0x83')],'as':'Attachment'}]})[_0x9ef5('0x1d')](handleEntityNotFound(_0x223cdf,null))[_0x9ef5('0x1d')](function(_0x5a9e5f){if(_0x5a9e5f){return _0x223cdf[_0x9ef5('0x8c')](path[_0x9ef5('0x88')](_0x27194f,_0x5a9e5f[_0x9ef5('0x83')]['basename']));}})[_0x9ef5('0x28')](handleError(_0x223cdf,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 5759640..2f510a9 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 _0xfb0b=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','save','update'];(function(_0x59c703,_0x47f52d){var _0x560495=function(_0x366920){while(--_0x366920){_0x59c703['push'](_0x59c703['shift']());}};_0x560495(++_0x47f52d);}(_0xfb0b,0x94));var _0xbfb0=function(_0x16d18b,_0x2cabc9){_0x16d18b=_0x16d18b-0x0;var _0x596cd0=_0xfb0b[_0x16d18b];return _0x596cd0;};'use strict';var EventEmitter=require(_0xbfb0('0x0'));var FaxMessage=require(_0xbfb0('0x1'))['db'][_0xbfb0('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbfb0('0x3'),'afterUpdate':_0xbfb0('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4adab6){return function(_0x299a7b,_0x4ac75d,_0x238a87){FaxMessageEvents[_0xbfb0('0x5')](_0x4adab6+':'+_0x299a7b['id'],_0x299a7b);FaxMessageEvents[_0xbfb0('0x5')](_0x4adab6,_0x299a7b);_0x238a87(null);};}for(var e in events){if(events[_0xbfb0('0x6')](e)){var event=events[e];FaxMessage[_0xbfb0('0x7')](e,emitEvent(event));}}module[_0xbfb0('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0x5ae0=['emit','hasOwnProperty','exports','../../mysqldb','FaxMessage','save','update'];(function(_0x158f01,_0x12af3e){var _0x5ef74e=function(_0x5e7adc){while(--_0x5e7adc){_0x158f01['push'](_0x158f01['shift']());}};_0x5ef74e(++_0x12af3e);}(_0x5ae0,0xf8));var _0x05ae=function(_0x4d4fa5,_0x200d33){_0x4d4fa5=_0x4d4fa5-0x0;var _0x4f2999=_0x5ae0[_0x4d4fa5];return _0x4f2999;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x05ae('0x0'))['db'][_0x05ae('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x05ae('0x2'),'afterUpdate':_0x05ae('0x3'),'afterDestroy':'remove'};function emitEvent(_0xd7e47f){return function(_0xaae02b,_0x4aac85,_0x554b43){FaxMessageEvents[_0x05ae('0x4')](_0xd7e47f+':'+_0xaae02b['id'],_0xaae02b);FaxMessageEvents[_0x05ae('0x4')](_0xd7e47f,_0xaae02b);_0x554b43(null);};}for(var e in events){if(events[_0x05ae('0x5')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x05ae('0x6')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 3fd4fd5..48ba865 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 _0x4ee7=['fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','findOne','FaxInteractionId','update','createdAt','catch','error','utf8mb4_unicode_ci','api','bluebird','request-promise','path','../../config/environment','./faxMessage.attributes','exports','fax_messages'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x4ee7,0x1db));var _0x74ee=function(_0x5ee9ee,_0xf7d18d){_0x5ee9ee=_0x5ee9ee-0x0;var _0x4da338=_0x4ee7[_0x5ee9ee];return _0x4da338;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x74ee('0x0'));var moment=require('moment');var BPromise=require(_0x74ee('0x1'));var rp=require(_0x74ee('0x2'));var fs=require('fs');var path=require(_0x74ee('0x3'));var rimraf=require('rimraf');var config=require(_0x74ee('0x4'));var attributes=require(_0x74ee('0x5'));module[_0x74ee('0x6')]=function(_0x6a9334,_0x9cd2fb){return _0x6a9334['define']('FaxMessage',attributes,{'tableName':_0x74ee('0x7'),'paranoid':![],'indexes':[{'name':_0x74ee('0x8'),'fields':[_0x74ee('0x9')],'type':_0x74ee('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1ca946,_0x22a8b6,_0x2162fc){var _0x119573=_0x6a9334[_0x74ee('0xb')];var _0x42da74=_0x1ca946[_0x74ee('0xc')]({'plain':!![]});if(_0x42da74[_0x74ee('0xd')][_0x74ee('0xe')]()==='in'||_0x42da74[_0x74ee('0xd')]['toLowerCase']()==='out'&&!_0x42da74[_0x74ee('0xf')]&&!_['isNil'](_0x42da74['UserId'])){_0x119573['FaxInteraction'][_0x74ee('0x10')]({'where':{'id':_0x42da74[_0x74ee('0x11')]}})['then'](function(_0x16a249){if(_0x16a249){_0x16a249[_0x74ee('0x12')]({'lastMsgAt':_0x42da74[_0x74ee('0x13')],'lastMsgDirection':_0x42da74[_0x74ee('0xd')]['toLowerCase']()});}})[_0x74ee('0x14')](function(_0x4a6878){console[_0x74ee('0x15')](_0x4a6878);});}_0x2162fc();}},'charset':'utf8mb4','collate':_0x74ee('0x16')});}; \ No newline at end of file +var _0x89ba=['secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','direction','toLowerCase'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x89ba,0x10c));var _0xa89b=function(_0x37d798,_0x483c95){_0x37d798=_0x37d798-0x0;var _0x402b46=_0x89ba[_0x37d798];return _0x402b46;};'use strict';var _=require(_0xa89b('0x0'));var util=require(_0xa89b('0x1'));var logger=require(_0xa89b('0x2'))(_0xa89b('0x3'));var moment=require(_0xa89b('0x4'));var BPromise=require(_0xa89b('0x5'));var rp=require(_0xa89b('0x6'));var fs=require('fs');var path=require(_0xa89b('0x7'));var rimraf=require(_0xa89b('0x8'));var config=require('../../config/environment');var attributes=require(_0xa89b('0x9'));module[_0xa89b('0xa')]=function(_0xb910b8,_0x1b5116){return _0xb910b8[_0xa89b('0xb')](_0xa89b('0xc'),attributes,{'tableName':_0xa89b('0xd'),'paranoid':![],'indexes':[{'name':_0xa89b('0xe'),'fields':[_0xa89b('0xf')],'type':_0xa89b('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x12e6bc,_0x32cf25,_0x3b3292){var _0x5a33ae=_0xb910b8[_0xa89b('0x11')];var _0x3315cd=_0x12e6bc['get']({'plain':!![]});if(_0x3315cd[_0xa89b('0x12')][_0xa89b('0x13')]()==='in'||_0x3315cd[_0xa89b('0x12')]['toLowerCase']()==='out'&&!_0x3315cd[_0xa89b('0x14')]&&!_[_0xa89b('0x15')](_0x3315cd[_0xa89b('0x16')])){_0x5a33ae[_0xa89b('0x17')][_0xa89b('0x18')]({'where':{'id':_0x3315cd[_0xa89b('0x19')]}})[_0xa89b('0x1a')](function(_0x11abf7){if(_0x11abf7){_0x11abf7['update']({'lastMsgAt':_0x3315cd[_0xa89b('0x1b')],'lastMsgDirection':_0x3315cd[_0xa89b('0x12')][_0xa89b('0x13')]()});}})[_0xa89b('0x1c')](function(_0x35c717){console[_0xa89b('0x1d')](_0x35c717);});}_0x3b3292();}},'charset':_0xa89b('0x1e'),'collate':_0xa89b('0x1f')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index b2889df..48c0a6e 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 _0x17ba=['CreateFaxMessage','FaxMessage','create','options','raw','info','UpdateFaxMessage','update','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0xd124ce,_0x2260dc){var _0x4bf1e3=function(_0x5875f4){while(--_0x5875f4){_0xd124ce['push'](_0xd124ce['shift']());}};_0x4bf1e3(++_0x2260dc);}(_0x17ba,0xab));var _0xa17b=function(_0x5047f8,_0x2c02b1){_0x5047f8=_0x5047f8-0x0;var _0x48c418=_0x17ba[_0x5047f8];return _0x48c418;};'use strict';var _=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var moment=require('moment');var BPromise=require(_0xa17b('0x2'));var rs=require(_0xa17b('0x3'));var fs=require('fs');var Redis=require(_0xa17b('0x4'));var db=require(_0xa17b('0x5'))['db'];var utils=require(_0xa17b('0x6'));var logger=require(_0xa17b('0x7'))(_0xa17b('0x8'));var config=require(_0xa17b('0x9'));var jayson=require(_0xa17b('0xa'));var client=jayson[_0xa17b('0xb')][_0xa17b('0xc')]({'port':0x232a});config[_0xa17b('0xd')]=_[_0xa17b('0xe')](config[_0xa17b('0xd')],{'host':_0xa17b('0xf'),'port':0x18eb});var socket=require(_0xa17b('0x10'))(new Redis(config[_0xa17b('0xd')]));require(_0xa17b('0x11'))[_0xa17b('0x12')](socket);function respondWithRpcPromise(_0x578799,_0x2556c4,_0x38b8f1){return new BPromise(function(_0x322dc0,_0x1e799a){return client[_0xa17b('0x13')](_0x578799,_0x38b8f1)[_0xa17b('0x14')](function(_0xc5ef2e){logger['info'](_0xa17b('0x15'),_0x2556c4,_0xa17b('0x16'));logger[_0xa17b('0x17')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x2556c4,_0xa17b('0x16'),JSON[_0xa17b('0x18')](_0xc5ef2e));if(_0xc5ef2e[_0xa17b('0x19')]){if(_0xc5ef2e[_0xa17b('0x19')]['code']===0x1f4){logger[_0xa17b('0x19')]('FaxMessage,\x20%s,\x20%s',_0x2556c4,_0xc5ef2e[_0xa17b('0x19')][_0xa17b('0x1a')]);return _0x1e799a(_0xc5ef2e['error'][_0xa17b('0x1a')]);}logger[_0xa17b('0x19')](_0xa17b('0x15'),_0x2556c4,_0xc5ef2e[_0xa17b('0x19')]['message']);return _0x322dc0(_0xc5ef2e[_0xa17b('0x19')]['message']);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x2556c4,_0xa17b('0x16'));_0x322dc0(_0xc5ef2e[_0xa17b('0x1b')]['message']);}})[_0xa17b('0x1c')](function(_0x166d44){logger[_0xa17b('0x19')](_0xa17b('0x15'),_0x2556c4,_0x166d44);_0x1e799a(_0x166d44);});});}exports[_0xa17b('0x1d')]=function(_0x1ecaa2){var _0x24afc2=this;return new Promise(function(_0x584a0a,_0x610c2b){return db[_0xa17b('0x1e')][_0xa17b('0x1f')](_0x1ecaa2['body'],{'raw':_0x1ecaa2[_0xa17b('0x20')]?_0x1ecaa2[_0xa17b('0x20')][_0xa17b('0x21')]===undefined?!![]:![]:!![]})[_0xa17b('0x14')](function(_0x3c7ec2){logger[_0xa17b('0x22')]('CreateFaxMessage',_0x1ecaa2);logger[_0xa17b('0x17')]('CreateFaxMessage',_0x1ecaa2,JSON[_0xa17b('0x18')](_0x3c7ec2));_0x584a0a(_0x3c7ec2);})[_0xa17b('0x1c')](function(_0x4ba608){logger['error'](_0xa17b('0x1d'),_0x4ba608[_0xa17b('0x1a')],_0x1ecaa2);_0x610c2b(_0x24afc2[_0xa17b('0x19')](0x1f4,_0x4ba608[_0xa17b('0x1a')]));});});};exports[_0xa17b('0x23')]=function(_0x3a64f5){var _0x4cd38e=this;return new Promise(function(_0x47aff8,_0x5c98fe){return db['FaxMessage'][_0xa17b('0x24')](_0x3a64f5['body'],{'raw':_0x3a64f5[_0xa17b('0x20')]?_0x3a64f5['options'][_0xa17b('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a64f5[_0xa17b('0x20')]?_0x3a64f5[_0xa17b('0x20')][_0xa17b('0x25')]||null:null,'attributes':_0x3a64f5[_0xa17b('0x20')]?_0x3a64f5[_0xa17b('0x20')][_0xa17b('0x26')]||null:null,'limit':_0x3a64f5[_0xa17b('0x20')]?_0x3a64f5[_0xa17b('0x20')][_0xa17b('0x27')]||null:null})[_0xa17b('0x14')](function(_0x573585){logger['info']('UpdateFaxMessage',_0x3a64f5);logger[_0xa17b('0x17')](_0xa17b('0x23'),_0x3a64f5,JSON[_0xa17b('0x18')](_0x573585));_0x47aff8(_0x573585);})[_0xa17b('0x1c')](function(_0x16dd1f){logger[_0xa17b('0x19')](_0xa17b('0x23'),_0x16dd1f[_0xa17b('0x1a')],_0x3a64f5);_0x5c98fe(_0x4cd38e['error'](0x1f4,_0x16dd1f[_0xa17b('0x1a')]));});});}; \ No newline at end of file +var _0xe14d=['code','message','result','catch','FaxMessage','create','body','options','raw','CreateFaxMessage','UpdateFaxMessage','update','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x62cfe,_0x894025){var _0x3ecfda=function(_0x3169d0){while(--_0x3169d0){_0x62cfe['push'](_0x62cfe['shift']());}};_0x3ecfda(++_0x894025);}(_0xe14d,0x1ee));var _0xde14=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xe14d[_0x373dee];return _0x46798f;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var moment=require(_0xde14('0x2'));var BPromise=require(_0xde14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde14('0x4'));var db=require(_0xde14('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde14('0x6'))(_0xde14('0x7'));var config=require(_0xde14('0x8'));var jayson=require(_0xde14('0x9'));var client=jayson[_0xde14('0xa')][_0xde14('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xde14('0xc')],{'host':_0xde14('0xd'),'port':0x18eb});var socket=require(_0xde14('0xe'))(new Redis(config[_0xde14('0xc')]));require(_0xde14('0xf'))[_0xde14('0x10')](socket);function respondWithRpcPromise(_0xa17e8,_0x1ce0a2,_0x4b2b15){return new BPromise(function(_0x1a7167,_0xe785fb){return client[_0xde14('0x11')](_0xa17e8,_0x4b2b15)[_0xde14('0x12')](function(_0x8e0e){logger[_0xde14('0x13')](_0xde14('0x14'),_0x1ce0a2,_0xde14('0x15'));logger[_0xde14('0x16')](_0xde14('0x17'),_0x1ce0a2,_0xde14('0x15'),JSON[_0xde14('0x18')](_0x8e0e));if(_0x8e0e[_0xde14('0x19')]){if(_0x8e0e[_0xde14('0x19')][_0xde14('0x1a')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x1ce0a2,_0x8e0e[_0xde14('0x19')][_0xde14('0x1b')]);return _0xe785fb(_0x8e0e[_0xde14('0x19')]['message']);}logger[_0xde14('0x19')](_0xde14('0x14'),_0x1ce0a2,_0x8e0e[_0xde14('0x19')][_0xde14('0x1b')]);return _0x1a7167(_0x8e0e[_0xde14('0x19')][_0xde14('0x1b')]);}else{logger[_0xde14('0x13')](_0xde14('0x14'),_0x1ce0a2,_0xde14('0x15'));_0x1a7167(_0x8e0e[_0xde14('0x1c')]['message']);}})[_0xde14('0x1d')](function(_0x3bfc59){logger[_0xde14('0x19')](_0xde14('0x14'),_0x1ce0a2,_0x3bfc59);_0xe785fb(_0x3bfc59);});});}exports['CreateFaxMessage']=function(_0x394de7){var _0x53e905=this;return new Promise(function(_0x45d101,_0x4c24a8){return db[_0xde14('0x1e')][_0xde14('0x1f')](_0x394de7[_0xde14('0x20')],{'raw':_0x394de7[_0xde14('0x21')]?_0x394de7[_0xde14('0x21')][_0xde14('0x22')]===undefined?!![]:![]:!![]})[_0xde14('0x12')](function(_0x2dd9e7){logger[_0xde14('0x13')](_0xde14('0x23'),_0x394de7);logger[_0xde14('0x16')](_0xde14('0x23'),_0x394de7,JSON[_0xde14('0x18')](_0x2dd9e7));_0x45d101(_0x2dd9e7);})['catch'](function(_0x42dd4f){logger[_0xde14('0x19')](_0xde14('0x23'),_0x42dd4f[_0xde14('0x1b')],_0x394de7);_0x4c24a8(_0x53e905[_0xde14('0x19')](0x1f4,_0x42dd4f[_0xde14('0x1b')]));});});};exports[_0xde14('0x24')]=function(_0x23c735){var _0x1618e1=this;return new Promise(function(_0x350a78,_0x4eff65){return db[_0xde14('0x1e')][_0xde14('0x25')](_0x23c735[_0xde14('0x20')],{'raw':_0x23c735[_0xde14('0x21')]?_0x23c735['options'][_0xde14('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23c735[_0xde14('0x21')]?_0x23c735[_0xde14('0x21')]['where']||null:null,'attributes':_0x23c735[_0xde14('0x21')]?_0x23c735['options'][_0xde14('0x26')]||null:null,'limit':_0x23c735[_0xde14('0x21')]?_0x23c735[_0xde14('0x21')][_0xde14('0x27')]||null:null})[_0xde14('0x12')](function(_0x237d3f){logger[_0xde14('0x13')](_0xde14('0x24'),_0x23c735);logger['debug'](_0xde14('0x24'),_0x23c735,JSON[_0xde14('0x18')](_0x237d3f));_0x350a78(_0x237d3f);})['catch'](function(_0xf25a9e){logger['error'](_0xde14('0x24'),_0xf25a9e[_0xde14('0x1b')],_0x23c735);_0x4eff65(_0x1618e1[_0xde14('0x19')](0x1f4,_0xf25a9e[_0xde14('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index e22674c..a41eee1 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 _0x441a=['save','remove','emit','register','length','./faxMessage.events'];(function(_0x438914,_0x1db343){var _0x3f35c4=function(_0x3f43a5){while(--_0x3f43a5){_0x438914['push'](_0x438914['shift']());}};_0x3f35c4(++_0x1db343);}(_0x441a,0x191));var _0xa441=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x441a[_0x1ccdf7];return _0x52a0ae;};'use strict';var FaxMessageEvents=require(_0xa441('0x0'));var events=[_0xa441('0x1'),_0xa441('0x2'),'update'];function createListener(_0x47993f,_0x3859e0){return function(_0x3d8eb2){_0x3859e0[_0xa441('0x3')](_0x47993f,_0x3d8eb2);};}function removeListener(_0x4ddbd7,_0x4ab45a){return function(){FaxMessageEvents['removeListener'](_0x4ddbd7,_0x4ab45a);};}exports[_0xa441('0x4')]=function(_0x19b7dc){for(var _0x1b6b64=0x0,_0x1a39e3=events[_0xa441('0x5')];_0x1b6b64<_0x1a39e3;_0x1b6b64++){var _0x2aacc1=events[_0x1b6b64];var _0x341780=createListener('faxMessage:'+_0x2aacc1,_0x19b7dc);FaxMessageEvents['on'](_0x2aacc1,_0x341780);}}; \ No newline at end of file +var _0x62f3=['save','remove','emit','removeListener','length','faxMessage:','./faxMessage.events'];(function(_0x2fcaa3,_0x2ba904){var _0x8f4089=function(_0x581a3b){while(--_0x581a3b){_0x2fcaa3['push'](_0x2fcaa3['shift']());}};_0x8f4089(++_0x2ba904);}(_0x62f3,0x1d4));var _0x362f=function(_0x10b3e2,_0x93dbb){_0x10b3e2=_0x10b3e2-0x0;var _0x1bb90e=_0x62f3[_0x10b3e2];return _0x1bb90e;};'use strict';var FaxMessageEvents=require(_0x362f('0x0'));var events=[_0x362f('0x1'),_0x362f('0x2'),'update'];function createListener(_0x2409c0,_0x6c01d8){return function(_0x47500d){_0x6c01d8[_0x362f('0x3')](_0x2409c0,_0x47500d);};}function removeListener(_0xcb1266,_0x92102f){return function(){FaxMessageEvents[_0x362f('0x4')](_0xcb1266,_0x92102f);};}exports['register']=function(_0x4c3f64){for(var _0x43fcba=0x0,_0x3d6218=events[_0x362f('0x5')];_0x43fcba<_0x3d6218;_0x43fcba++){var _0xe551bc=events[_0x43fcba];var _0x5d2a0c=createListener(_0x362f('0x6')+_0xe551bc,_0x4c3f64);FaxMessageEvents['on'](_0xe551bc,_0x5d2a0c);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 26c3cf1..ec93846 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 _0x5ec6=['express','fs-extra','../../components/interaction/service','./faxMessage.controller','isAuthenticated','index','/describe','get','/:id','/:id/download','download','post','tracked','fax','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path'];(function(_0x3d54bc,_0x5eaeb6){var _0xacf617=function(_0x148c8d){while(--_0x148c8d){_0x3d54bc['push'](_0x3d54bc['shift']());}};_0xacf617(++_0x5eaeb6);}(_0x5ec6,0x7f));var _0x65ec=function(_0x48c65c,_0x2b7d93){_0x48c65c=_0x48c65c-0x0;var _0x1b067f=_0x5ec6[_0x48c65c];return _0x1b067f;};'use strict';var multer=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var path=require(_0x65ec('0x2'));var timeout=require('connect-timeout');var express=require(_0x65ec('0x3'));var router=express['Router']();var fs_extra=require(_0x65ec('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x65ec('0x5'));var config=require('../../config/environment');var controller=require(_0x65ec('0x6'));router['get']('/',auth[_0x65ec('0x7')](),controller[_0x65ec('0x8')]);router['get'](_0x65ec('0x9'),auth[_0x65ec('0x7')](),controller['describe']);router[_0x65ec('0xa')](_0x65ec('0xb'),auth[_0x65ec('0x7')](),controller['show']);router['get'](_0x65ec('0xc'),auth['isAuthenticated'](),controller[_0x65ec('0xd')]);router[_0x65ec('0xe')]('/',auth['isAuthenticated'](),interaction[_0x65ec('0xf')](_0x65ec('0x10'),'faxmessage:create'),controller[_0x65ec('0x11')]);router[_0x65ec('0x12')]('/:id',auth[_0x65ec('0x7')](),controller[_0x65ec('0x13')]);router[_0x65ec('0x12')](_0x65ec('0x14'),auth[_0x65ec('0x7')](),controller[_0x65ec('0x15')]);router[_0x65ec('0x12')](_0x65ec('0x16'),auth['isAuthenticated'](),controller[_0x65ec('0x17')]);router[_0x65ec('0x18')](_0x65ec('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x65ec('0x19')]=router; \ No newline at end of file +var _0xdb94=['express','fs-extra','../../components/auth/service','./faxMessage.controller','index','/describe','describe','get','/:id','isAuthenticated','show','/:id/download','download','post','fax','faxmessage:create','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','connect-timeout'];(function(_0x4a0cf2,_0x30dc69){var _0x1164a6=function(_0x3bffa5){while(--_0x3bffa5){_0x4a0cf2['push'](_0x4a0cf2['shift']());}};_0x1164a6(++_0x30dc69);}(_0xdb94,0xab));var _0x4db9=function(_0x4aa7f5,_0x2a747f){_0x4aa7f5=_0x4aa7f5-0x0;var _0xab2c07=_0xdb94[_0x4aa7f5];return _0xab2c07;};'use strict';var multer=require(_0x4db9('0x0'));var util=require(_0x4db9('0x1'));var path=require(_0x4db9('0x2'));var timeout=require(_0x4db9('0x3'));var express=require(_0x4db9('0x4'));var router=express['Router']();var fs_extra=require(_0x4db9('0x5'));var auth=require(_0x4db9('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4db9('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x4db9('0x8')]);router['get'](_0x4db9('0x9'),auth['isAuthenticated'](),controller[_0x4db9('0xa')]);router[_0x4db9('0xb')](_0x4db9('0xc'),auth[_0x4db9('0xd')](),controller[_0x4db9('0xe')]);router[_0x4db9('0xb')](_0x4db9('0xf'),auth[_0x4db9('0xd')](),controller[_0x4db9('0x10')]);router[_0x4db9('0x11')]('/',auth[_0x4db9('0xd')](),interaction['tracked'](_0x4db9('0x12'),_0x4db9('0x13')),controller['create']);router['put'](_0x4db9('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x4db9('0x14')](_0x4db9('0x15'),auth['isAuthenticated'](),controller[_0x4db9('0x16')]);router[_0x4db9('0x14')](_0x4db9('0x17'),auth[_0x4db9('0xd')](),controller['reject']);router['delete'](_0x4db9('0xc'),auth[_0x4db9('0xd')](),controller['destroy']);module[_0x4db9('0x18')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 89a23c3..8303483 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 _0xe08b=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','STRING'];(function(_0x4de877,_0x340170){var _0xb2cfeb=function(_0x488634){while(--_0x488634){_0x4de877['push'](_0x4de877['shift']());}};_0xb2cfeb(++_0x340170);}(_0xe08b,0x10e));var _0xbe08=function(_0x18abd2,_0x22d4b3){_0x18abd2=_0x18abd2-0x0;var _0x1dcad6=_0xe08b[_0x18abd2];return _0x1dcad6;};'use strict';var Sequelize=require(_0xbe08('0x0'));module['exports']={'name':{'type':Sequelize[_0xbe08('0x1')],'unique':_0xbe08('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xbe08('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbe08('0x4')](_0xbe08('0x5'),_0xbe08('0x6'),_0xbe08('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xbe08('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb6fa=['ENUM','rrmemory','beepall','roundrobin','sequelize','STRING','name','INTEGER'];(function(_0x2795b7,_0x9fdf79){var _0x5e393e=function(_0x50c713){while(--_0x50c713){_0x2795b7['push'](_0x2795b7['shift']());}};_0x5e393e(++_0x9fdf79);}(_0xb6fa,0x18c));var _0xab6f=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0xb6fa[_0x2ed8f3];return _0x525a55;};'use strict';var Sequelize=require(_0xab6f('0x0'));module['exports']={'name':{'type':Sequelize[_0xab6f('0x1')],'unique':_0xab6f('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xab6f('0x1')]},'timeout':{'type':Sequelize[_0xab6f('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xab6f('0x4')](_0xab6f('0x5'),_0xab6f('0x6'),_0xab6f('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xab6f('0x3')],'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 26b68f1..2ae0c5d 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 _0x25a8=['sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','destroy','then','get','FaxQueues','UserProfileResource','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','show','params','includeAll','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','error','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','options','findAndCountAll','UserId','agent','faxPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','userFaxQueue:save','removeTeams','User','select','field','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','union','compact','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','desk.js','to-csv','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','socket.io-emitter','./faxQueue.socket','register'];(function(_0x4c8196,_0x235f61){var _0x9aeaff=function(_0x14c03b){while(--_0x14c03b){_0x4c8196['push'](_0x4c8196['shift']());}};_0x9aeaff(++_0x235f61);}(_0x25a8,0x199));var _0x825a=function(_0x1c4188,_0x34e033){_0x1c4188=_0x1c4188-0x0;var _0x59a0a8=_0x25a8[_0x1c4188];return _0x59a0a8;};'use strict';var emlformat=require(_0x825a('0x0'));var rimraf=require(_0x825a('0x1'));var zipdir=require(_0x825a('0x2'));var jsonpatch=require(_0x825a('0x3'));var rp=require(_0x825a('0x4'));var moment=require(_0x825a('0x5'));var BPromise=require(_0x825a('0x6'));var Mustache=require(_0x825a('0x7'));var util=require(_0x825a('0x8'));var path=require(_0x825a('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x825a('0xa'));var fs=require('fs');var fs_extra=require(_0x825a('0xb'));var _=require(_0x825a('0xc'));var squel=require('squel');var crypto=require(_0x825a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x825a('0xe'));var toCsv=require(_0x825a('0xf'));var querystring=require(_0x825a('0x10'));var Papa=require(_0x825a('0x11'));var Redis=require('ioredis');var authService=require(_0x825a('0x12'));var qs=require(_0x825a('0x13'));var as=require(_0x825a('0x14'));var hardwareService=require(_0x825a('0x15'));var logger=require(_0x825a('0x16'))(_0x825a('0x17'));var utils=require('../../config/utils');var config=require(_0x825a('0x18'));var licenseUtil=require(_0x825a('0x19'));var db=require(_0x825a('0x1a'))['db'];config[_0x825a('0x1b')]=_[_0x825a('0x1c')](config[_0x825a('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x825a('0x1d'))(new Redis(config[_0x825a('0x1b')]));require(_0x825a('0x1e'))[_0x825a('0x1f')](socket);function respondWithStatusCode(_0x4a6e00,_0x765369){_0x765369=_0x765369||0xcc;return function(_0x36d895){if(_0x36d895){return _0x4a6e00[_0x825a('0x20')](_0x765369);}return _0x4a6e00[_0x825a('0x21')](_0x765369)[_0x825a('0x22')]();};}function respondWithResult(_0x1066ae,_0x9a62c4){_0x9a62c4=_0x9a62c4||0xc8;return function(_0x4c504){if(_0x4c504){return _0x1066ae[_0x825a('0x21')](_0x9a62c4)['json'](_0x4c504);}};}function respondWithFilteredResult(_0x36c71d,_0x5d6b56){return function(_0x3e648e){if(_0x3e648e){var _0x5c4f66=typeof _0x5d6b56[_0x825a('0x23')]===_0x825a('0x24')&&typeof _0x5d6b56['limit']===_0x825a('0x24');var _0x366f3e=_0x3e648e[_0x825a('0x25')];var _0x5eff17=_0x5c4f66?0x0:_0x5d6b56['offset'];var _0x4b2582=_0x5c4f66?_0x3e648e[_0x825a('0x25')]:_0x5d6b56[_0x825a('0x23')]+_0x5d6b56[_0x825a('0x26')];var _0x4d008e;if(_0x4b2582>=_0x366f3e){_0x4b2582=_0x366f3e;_0x4d008e=0xc8;}else{_0x4d008e=0xce;}_0x36c71d['status'](_0x4d008e);return _0x36c71d[_0x825a('0x27')](_0x825a('0x28'),_0x5eff17+'-'+_0x4b2582+'/'+_0x366f3e)[_0x825a('0x29')](_0x3e648e);}return null;};}function patchUpdates(_0x1f1659){return function(_0x1fdad1){try{jsonpatch[_0x825a('0x2a')](_0x1fdad1,_0x1f1659,!![]);}catch(_0x19dbd1){return BPromise['reject'](_0x19dbd1);}return _0x1fdad1[_0x825a('0x2b')]();};}function saveUpdates(_0x3c2be0,_0x3e1ad3){return function(_0x41b275){if(_0x41b275){return _0x41b275[_0x825a('0x2c')](_0x3c2be0)['then'](function(_0x4490b9){return _0x4490b9;});}return null;};}function removeEntity(_0x581e82,_0x558da7){return function(_0x56e302){if(_0x56e302){return _0x56e302[_0x825a('0x2d')]()[_0x825a('0x2e')](function(){var _0x549d4a=_0x56e302[_0x825a('0x2f')]({'plain':!![]});var _0x31bb0a=_0x825a('0x30');return db[_0x825a('0x31')][_0x825a('0x2d')]({'where':{'type':_0x31bb0a,'resourceId':_0x549d4a['id']}})[_0x825a('0x2e')](function(){return _0x56e302;});})[_0x825a('0x2e')](function(){_0x581e82['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa3b3ca,_0x23fa74){return function(_0x30e9bd){if(!_0x30e9bd){_0xa3b3ca[_0x825a('0x20')](0x194);}return _0x30e9bd;};}function handleError(_0x2f39e4,_0x4124b1){_0x4124b1=_0x4124b1||0x1f4;return function(_0x193ab9){logger['error'](_0x193ab9[_0x825a('0x32')]);if(_0x193ab9[_0x825a('0x33')]){delete _0x193ab9['name'];}_0x2f39e4[_0x825a('0x21')](_0x4124b1)[_0x825a('0x34')](_0x193ab9);};}exports[_0x825a('0x35')]=function(_0x14c177,_0x3eafe8){var _0x26b32a={},_0x1d5e80={},_0x5d3806={'count':0x0,'rows':[]};var _0x4966bb=_[_0x825a('0x36')](db[_0x825a('0x37')][_0x825a('0x38')],function(_0x568334){return{'name':_0x568334[_0x825a('0x39')],'type':_0x568334['type'][_0x825a('0x3a')]};});_0x1d5e80[_0x825a('0x3b')]=_[_0x825a('0x36')](_0x4966bb,_0x825a('0x33'));_0x1d5e80[_0x825a('0x3c')]=_[_0x825a('0x3d')](_0x14c177[_0x825a('0x3c')]);_0x1d5e80[_0x825a('0x3e')]=_[_0x825a('0x3f')](_0x1d5e80[_0x825a('0x3b')],_0x1d5e80[_0x825a('0x3c')]);_0x26b32a[_0x825a('0x40')]=_['intersection'](_0x1d5e80['model'],qs['fields'](_0x14c177[_0x825a('0x3c')][_0x825a('0x41')]));_0x26b32a[_0x825a('0x40')]=_0x26b32a[_0x825a('0x40')][_0x825a('0x42')]?_0x26b32a[_0x825a('0x40')]:_0x1d5e80[_0x825a('0x3b')];if(!_0x14c177['query'][_0x825a('0x43')](_0x825a('0x44'))){_0x26b32a['limit']=qs[_0x825a('0x26')](_0x14c177[_0x825a('0x3c')][_0x825a('0x26')]);_0x26b32a[_0x825a('0x23')]=qs[_0x825a('0x23')](_0x14c177[_0x825a('0x3c')]['offset']);}_0x26b32a[_0x825a('0x45')]=qs[_0x825a('0x46')](_0x14c177[_0x825a('0x3c')][_0x825a('0x46')]);_0x26b32a[_0x825a('0x47')]=qs[_0x825a('0x3e')](_[_0x825a('0x48')](_0x14c177[_0x825a('0x3c')],_0x1d5e80[_0x825a('0x3e')]),_0x4966bb);if(_0x14c177[_0x825a('0x3c')][_0x825a('0x49')]){_0x26b32a[_0x825a('0x47')]=_[_0x825a('0x4a')](_0x26b32a[_0x825a('0x47')],{'$or':_[_0x825a('0x36')](_0x4966bb,function(_0x57aa2e){if(_0x57aa2e['type']!==_0x825a('0x4b')){var _0x17a21d={};_0x17a21d[_0x57aa2e[_0x825a('0x33')]]={'$like':'%'+_0x14c177[_0x825a('0x3c')][_0x825a('0x49')]+'%'};return _0x17a21d;}})});}_0x26b32a=_[_0x825a('0x4a')]({},_0x26b32a,_0x14c177['options']);var _0x46e5da={'where':_0x26b32a[_0x825a('0x47')]};return db[_0x825a('0x37')]['count'](_0x46e5da)[_0x825a('0x2e')](function(_0x347e71){_0x5d3806['count']=_0x347e71;if(_0x14c177[_0x825a('0x3c')]['includeAll']){_0x26b32a['include']=[{'all':!![]}];}return db[_0x825a('0x37')][_0x825a('0x4c')](_0x26b32a);})[_0x825a('0x2e')](function(_0x508520){_0x5d3806[_0x825a('0x4d')]=_0x508520;return _0x5d3806;})[_0x825a('0x2e')](respondWithFilteredResult(_0x3eafe8,_0x26b32a))['catch'](handleError(_0x3eafe8,null));};exports[_0x825a('0x4e')]=function(_0x32f763,_0x12e52b){var _0x46627e={'raw':!![],'where':{'id':_0x32f763[_0x825a('0x4f')]['id']}},_0x57a25d={};_0x57a25d[_0x825a('0x3b')]=_[_0x825a('0x3d')](db[_0x825a('0x37')][_0x825a('0x38')]);_0x57a25d[_0x825a('0x3c')]=_[_0x825a('0x3d')](_0x32f763['query']);_0x57a25d[_0x825a('0x3e')]=_[_0x825a('0x3f')](_0x57a25d[_0x825a('0x3b')],_0x57a25d[_0x825a('0x3c')]);_0x46627e[_0x825a('0x40')]=_[_0x825a('0x3f')](_0x57a25d[_0x825a('0x3b')],qs['fields'](_0x32f763[_0x825a('0x3c')][_0x825a('0x41')]));_0x46627e[_0x825a('0x40')]=_0x46627e['attributes']['length']?_0x46627e[_0x825a('0x40')]:_0x57a25d[_0x825a('0x3b')];if(_0x32f763[_0x825a('0x3c')][_0x825a('0x50')]){_0x46627e['include']=[{'all':!![]}];}_0x46627e=_['merge']({},_0x46627e,_0x32f763['options']);return db[_0x825a('0x37')][_0x825a('0x51')](_0x46627e)['then'](handleEntityNotFound(_0x12e52b,null))[_0x825a('0x2e')](respondWithResult(_0x12e52b,null))[_0x825a('0x52')](handleError(_0x12e52b,null));};exports[_0x825a('0x53')]=function(_0x1bdf34,_0x552550){return db['FaxQueue'][_0x825a('0x53')](_0x1bdf34[_0x825a('0x54')],{})[_0x825a('0x2e')](function(_0x3f48e7){var _0x34084d=_0x1bdf34['user'][_0x825a('0x2f')]({'plain':!![]});if(!_0x34084d)throw new Error(_0x825a('0x55'));if(_0x34084d['role']===_0x825a('0x56')){var _0x4981de=_0x3f48e7[_0x825a('0x2f')]({'plain':!![]});var _0x5170ab=_0x825a('0x30');return db[_0x825a('0x57')][_0x825a('0x51')]({'where':{'name':_0x5170ab,'userProfileId':_0x34084d[_0x825a('0x58')]},'raw':!![]})['then'](function(_0x20cf49){if(_0x20cf49&&_0x20cf49[_0x825a('0x59')]===0x0){return db[_0x825a('0x31')][_0x825a('0x53')]({'name':_0x4981de[_0x825a('0x33')],'resourceId':_0x4981de['id'],'type':_0x20cf49[_0x825a('0x33')],'sectionId':_0x20cf49['id']},{})[_0x825a('0x2e')](function(){return _0x3f48e7;});}else{return _0x3f48e7;}})['catch'](function(_0x400b10){logger[_0x825a('0x5a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x400b10);throw _0x400b10;});}return _0x3f48e7;})['then'](respondWithResult(_0x552550,0xc9))[_0x825a('0x52')](handleError(_0x552550,null));};exports['update']=function(_0xb3d6c1,_0x32f12d){if(_0xb3d6c1[_0x825a('0x54')]['id']){delete _0xb3d6c1[_0x825a('0x54')]['id'];}return db[_0x825a('0x37')]['find']({'where':{'id':_0xb3d6c1[_0x825a('0x4f')]['id']}})[_0x825a('0x2e')](handleEntityNotFound(_0x32f12d,null))[_0x825a('0x2e')](saveUpdates(_0xb3d6c1['body'],null))[_0x825a('0x2e')](respondWithResult(_0x32f12d,null))[_0x825a('0x52')](handleError(_0x32f12d,null));};exports[_0x825a('0x2d')]=function(_0x29509e,_0x15d491){return db[_0x825a('0x37')][_0x825a('0x51')]({'where':{'id':_0x29509e[_0x825a('0x4f')]['id']}})[_0x825a('0x2e')](handleEntityNotFound(_0x15d491,null))['then'](removeEntity(_0x15d491,null))[_0x825a('0x52')](handleError(_0x15d491,null));};exports[_0x825a('0x5b')]=function(_0x270c84,_0x203d0c){return db[_0x825a('0x37')][_0x825a('0x5b')]()['then'](respondWithResult(_0x203d0c,null))[_0x825a('0x52')](handleError(_0x203d0c,null));};exports[_0x825a('0x5c')]=function(_0x6a21cf,_0x12ad9d,_0x31c05f){var _0x52b86c={'raw':!![],'where':{}},_0x33dc4d={},_0x459967;return db['FaxQueue'][_0x825a('0x5d')]({'where':{'id':_0x6a21cf[_0x825a('0x4f')]['id']}})[_0x825a('0x2e')](handleEntityNotFound(_0x12ad9d,null))[_0x825a('0x2e')](function(_0x28bab7){if(_0x28bab7){_0x459967=_0x28bab7[_0x825a('0x2f')]({'plain':!![]});_0x33dc4d[_0x825a('0x3b')]=_[_0x825a('0x3d')](db[_0x825a('0x5e')][_0x825a('0x38')]);_0x33dc4d[_0x825a('0x3c')]=_['keys'](_0x6a21cf[_0x825a('0x3c')]);_0x33dc4d[_0x825a('0x3e')]=_['intersection'](_0x33dc4d[_0x825a('0x3b')],_0x33dc4d[_0x825a('0x3c')]);_0x52b86c['attributes']=_[_0x825a('0x3f')](_0x33dc4d['model'],qs[_0x825a('0x41')](_0x6a21cf[_0x825a('0x3c')][_0x825a('0x41')]));_0x52b86c[_0x825a('0x40')]=_0x52b86c[_0x825a('0x40')][_0x825a('0x42')]?_0x52b86c[_0x825a('0x40')]:_0x33dc4d[_0x825a('0x3b')];if(!_0x6a21cf[_0x825a('0x3c')]['hasOwnProperty'](_0x825a('0x44'))){_0x52b86c[_0x825a('0x26')]=qs[_0x825a('0x26')](_0x6a21cf[_0x825a('0x3c')][_0x825a('0x26')]);_0x52b86c['offset']=qs[_0x825a('0x23')](_0x6a21cf[_0x825a('0x3c')]['offset']);}_0x52b86c['order']=qs[_0x825a('0x46')](_0x6a21cf['query']['sort']);_0x52b86c['where']=qs['filters'](_[_0x825a('0x48')](_0x6a21cf[_0x825a('0x3c')],_0x33dc4d[_0x825a('0x3e')]));_0x52b86c[_0x825a('0x47')][_0x825a('0x5f')]=_0x28bab7['id'];if(_0x6a21cf[_0x825a('0x3c')][_0x825a('0x49')]){_0x52b86c[_0x825a('0x47')]=_[_0x825a('0x4a')](_0x52b86c[_0x825a('0x47')],{'$or':_[_0x825a('0x36')](_0x52b86c[_0x825a('0x40')],function(_0x31459f){var _0x4dea79={};_0x4dea79[_0x31459f]={'$like':'%'+_0x6a21cf[_0x825a('0x3c')][_0x825a('0x49')]+'%'};return _0x4dea79;})});}_0x52b86c=_['merge']({},_0x52b86c,_0x6a21cf[_0x825a('0x60')]);return db[_0x825a('0x5e')][_0x825a('0x4c')](_0x52b86c);}})[_0x825a('0x2e')](function(_0xfc0f4c){if(_0xfc0f4c){return db['User'][_0x825a('0x61')]({'where':{'id':_[_0x825a('0x36')](_0xfc0f4c,_0x825a('0x62')),'role':_0x825a('0x63')},'attributes':['id',_0x825a('0x33'),_0x825a('0x64'),'updatedAt',_0x825a('0x65')]});}})[_0x825a('0x2e')](function(_0x12e708){if(_0x12e708){return{'count':_0x12e708['count'],'rows':_[_0x825a('0x36')](_0x12e708[_0x825a('0x4d')],function(_0x147c8c){return{'membername':_0x147c8c[_0x825a('0x33')],'UserId':_0x147c8c['id'],'queue_name':_0x459967[_0x825a('0x33')],'FaxQueueId':_0x459967['id'],'interface':util[_0x825a('0x66')](_0x825a('0x67'),_0x825a('0x68'),_0x147c8c['name']),'penalty':0x0,'paused':_0x147c8c['faxPause'],'createdAt':_0x147c8c[_0x825a('0x65')],'updatedAt':_0x147c8c[_0x825a('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x825a('0x2e')](respondWithFilteredResult(_0x12ad9d,_0x52b86c))[_0x825a('0x52')](handleError(_0x12ad9d,null));};exports[_0x825a('0x6a')]=function(_0x16ef1c,_0x15eac,_0x4b0deb){var _0x18c1eb={};var _0x3ca057={};var _0x204f25;var _0x18a706;return db[_0x825a('0x37')][_0x825a('0x5d')]({'where':{'id':_0x16ef1c['params']['id']}})[_0x825a('0x2e')](handleEntityNotFound(_0x15eac,null))[_0x825a('0x2e')](function(_0x55a8b4){if(_0x55a8b4){_0x204f25=_0x55a8b4;_0x3ca057[_0x825a('0x3b')]=_[_0x825a('0x3d')](db[_0x825a('0x6b')][_0x825a('0x38')]);_0x3ca057['query']=_[_0x825a('0x3d')](_0x16ef1c[_0x825a('0x3c')]);_0x3ca057[_0x825a('0x3e')]=_[_0x825a('0x3f')](_0x3ca057[_0x825a('0x3b')],_0x3ca057[_0x825a('0x3c')]);_0x18c1eb[_0x825a('0x40')]=_['intersection'](_0x3ca057['model'],qs['fields'](_0x16ef1c[_0x825a('0x3c')][_0x825a('0x41')]));_0x18c1eb[_0x825a('0x40')]=_0x18c1eb[_0x825a('0x40')][_0x825a('0x42')]?_0x18c1eb[_0x825a('0x40')]:_0x3ca057[_0x825a('0x3b')];_0x18c1eb[_0x825a('0x45')]=qs['sort'](_0x16ef1c[_0x825a('0x3c')]['sort']);_0x18c1eb['where']=qs[_0x825a('0x3e')](_['pick'](_0x16ef1c[_0x825a('0x3c')],_0x3ca057[_0x825a('0x3e')]));if(_0x16ef1c[_0x825a('0x3c')][_0x825a('0x49')]){_0x18c1eb['where']=_[_0x825a('0x4a')](_0x18c1eb[_0x825a('0x47')],{'$or':_['map'](_0x18c1eb[_0x825a('0x40')],function(_0x1c31b7){var _0x5e7584={};_0x5e7584[_0x1c31b7]={'$like':'%'+_0x16ef1c[_0x825a('0x3c')]['filter']+'%'};return _0x5e7584;})});}_0x18c1eb=_[_0x825a('0x4a')]({},_0x18c1eb,_0x16ef1c[_0x825a('0x60')]);return _0x204f25[_0x825a('0x6a')](_0x18c1eb);}})[_0x825a('0x2e')](function(_0x5bcd68){if(_0x5bcd68){_0x18a706=_0x5bcd68[_0x825a('0x42')];if(!_0x16ef1c[_0x825a('0x3c')][_0x825a('0x43')](_0x825a('0x44'))){_0x18c1eb[_0x825a('0x26')]=qs[_0x825a('0x26')](_0x16ef1c[_0x825a('0x3c')][_0x825a('0x26')]);_0x18c1eb[_0x825a('0x23')]=qs[_0x825a('0x23')](_0x16ef1c[_0x825a('0x3c')][_0x825a('0x23')]);}return _0x204f25[_0x825a('0x6a')](_0x18c1eb);}})[_0x825a('0x2e')](function(_0x598ec8){if(_0x598ec8){return _0x598ec8?{'count':_0x18a706,'rows':_0x598ec8}:null;}})[_0x825a('0x2e')](respondWithResult(_0x15eac,null))[_0x825a('0x52')](handleError(_0x15eac,null));};exports[_0x825a('0x6c')]=function(_0x29f76b,_0x530aa7,_0x52bf4c){var _0x51157d=_0x29f76b['body'][_0x825a('0x6d')];return db['Team'][_0x825a('0x4c')]({'where':{'id':_0x51157d},'attributes':['id'],'include':[{'model':db['User'],'as':_0x825a('0x6e'),'attributes':['id','name',_0x825a('0x6f'),_0x825a('0x70'),'interface'],'raw':!![]}]})[_0x825a('0x2e')](function(_0x44d2a1){if(_0x44d2a1){var _0x367e8f=_[_0x825a('0x71')](_0x44d2a1,function(_0x2d754a){var _0x4c9c05=_0x2d754a['get']({'plain':!![]});return _0x4c9c05[_0x825a('0x6e')];});return db[_0x825a('0x37')][_0x825a('0x51')]({'where':{'id':_0x29f76b[_0x825a('0x4f')]['id']}})['then'](function(_0x4a09fa){return db[_0x825a('0x72')][_0x825a('0x73')](function(_0x323dbb){return _0x4a09fa[_0x825a('0x6c')](_0x51157d,{'transaction':_0x323dbb})[_0x825a('0x2e')](function(){return BPromise[_0x825a('0x74')](_0x367e8f,function(_0x31b11e){return db['UserFaxQueue'][_0x825a('0x75')]({'where':{'UserId':_0x31b11e['id'],'FaxQueueId':_0x29f76b['params']['id']},'transaction':_0x323dbb});});})[_0x825a('0x2e')](function(){_0x367e8f[_0x825a('0x76')](function(_0x118392){socket['emit'](_0x825a('0x77'),{'UserId':_0x118392['id'],'FaxQueueId':_0x4a09fa['id']});});});});});}})[_0x825a('0x2e')](respondWithStatusCode(_0x530aa7,null))[_0x825a('0x52')](handleError(_0x530aa7,null));};exports[_0x825a('0x78')]=function(_0x5149bf,_0x5d4bef,_0x505c67){return db[_0x825a('0x6b')][_0x825a('0x4c')]({'where':{'id':_0x5149bf[_0x825a('0x3c')][_0x825a('0x6d')]},'attributes':['id'],'include':[{'model':db[_0x825a('0x79')],'as':_0x825a('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x825a('0x2e')](handleEntityNotFound(_0x5d4bef,null))[_0x825a('0x2e')](function(_0x4f9d5e){var _0x12d41b=_[_0x825a('0x36')](_0x4f9d5e,'id');var _0xc953c8=[];var _0x2696d6=[];var _0x1a7573=squel[_0x825a('0x7a')]();_0x1a7573[_0x825a('0x7b')](_0x825a('0x7c'))[_0x825a('0x7d')](_0x825a('0x7e'),'tq')[_0x825a('0x7f')]('user_has_teams','ut',_0x825a('0x80'))[_0x825a('0x47')](_0x825a('0x81'),_0x5149bf[_0x825a('0x4f')]['id']);for(var _0x17c2ed=0x0;_0x17c2ed<_0x4f9d5e['length'];_0x17c2ed+=0x1){let _0x235276=_0x4f9d5e[_0x17c2ed];for(var _0x2bfd12=0x0;_0x2bfd12<_0x235276[_0x825a('0x6e')][_0x825a('0x42')];_0x2bfd12+=0x1){let _0x36d1d2=_0x235276['Agents'][_0x2bfd12];var _0x4a5ecc=_0x1a7573['clone']();_0x4a5ecc[_0x825a('0x47')](_0x825a('0x82'),_0x36d1d2['id']);_0x2696d6[_0x825a('0x83')](db[_0x825a('0x72')][_0x825a('0x3c')](_0x4a5ecc[_0x825a('0x84')](),{'type':db[_0x825a('0x72')][_0x825a('0x85')]['SELECT']})[_0x825a('0x2e')](function(_0x20d060){if(_0x20d060[_0x825a('0x42')]===0x1){return _0x36d1d2['id'];}else{var _0x27e794=_[_0x825a('0x86')](_[_0x825a('0x36')](_0x20d060,_0x825a('0x87')),function(_0x58cd3c){return _[_0x825a('0x88')](_0x12d41b,_0x58cd3c);});if(_0x27e794){return _0x36d1d2['id'];}}}));}}return BPromise['all'](_0x2696d6)[_0x825a('0x2e')](function(_0x3f3671){_0xc953c8=_(_0xc953c8)[_0x825a('0x89')](_0x3f3671)[_0x825a('0x8a')]()['value']();return db['FaxQueue'][_0x825a('0x51')]({'where':{'id':_0x5149bf[_0x825a('0x4f')]['id']}})[_0x825a('0x2e')](function(_0x72dc26){return db[_0x825a('0x72')][_0x825a('0x73')](function(_0x2a41bb){return _0x72dc26[_0x825a('0x78')](_0x5149bf['query'][_0x825a('0x6d')],{'transaction':_0x2a41bb})[_0x825a('0x2e')](function(){if(!_[_0x825a('0x8b')](_0xc953c8)){return _0x72dc26[_0x825a('0x8c')](_0xc953c8,{'transaction':_0x2a41bb});}})['then'](function(){_0xc953c8[_0x825a('0x76')](function(_0x674f50){socket[_0x825a('0x8d')](_0x825a('0x8e'),{'UserId':_0x674f50,'FaxQueueId':_0x72dc26['id']});});});});});});})['then'](respondWithStatusCode(_0x5d4bef,null))[_0x825a('0x52')](handleError(_0x5d4bef,null));};exports[_0x825a('0x8f')]=function(_0x2dba60,_0x69c068,_0x540755){return db['FaxQueue']['find']({'where':{'id':_0x2dba60['params']['id']}})['then'](handleEntityNotFound(_0x69c068,null))[_0x825a('0x2e')](function(_0x1aba2c){if(_0x1aba2c){return _0x1aba2c[_0x825a('0x8f')](_0x2dba60[_0x825a('0x54')][_0x825a('0x6d')],_['omit'](_0x2dba60[_0x825a('0x54')],[_0x825a('0x6d'),'id'])||{})[_0x825a('0x90')](function(_0x36305e){for(var _0xe6677=0x0;_0xe6677<_0x2dba60[_0x825a('0x54')][_0x825a('0x6d')][_0x825a('0x42')];_0xe6677+=0x1){socket[_0x825a('0x8d')](_0x825a('0x77'),{'UserId':Number(_0x2dba60[_0x825a('0x54')][_0x825a('0x6d')][_0xe6677]),'FaxQueueId':Number(_0x2dba60[_0x825a('0x4f')]['id'])});}return _0x36305e;});}})[_0x825a('0x2e')](respondWithResult(_0x69c068,null))['catch'](handleError(_0x69c068,null));};exports[_0x825a('0x8c')]=function(_0x23228e,_0x1425de,_0x523c21){return db[_0x825a('0x37')]['find']({'where':{'id':_0x23228e['params']['id']}})[_0x825a('0x2e')](handleEntityNotFound(_0x1425de,null))[_0x825a('0x2e')](function(_0xf8e181){if(_0xf8e181){return _0xf8e181[_0x825a('0x8c')](_0x23228e[_0x825a('0x3c')][_0x825a('0x6d')])[_0x825a('0x2e')](function(){if(_[_0x825a('0x91')](_0x23228e[_0x825a('0x3c')]['ids'])){for(var _0x6b89ab=0x0;_0x6b89ab<_0x23228e[_0x825a('0x3c')][_0x825a('0x6d')][_0x825a('0x42')];_0x6b89ab+=0x1){socket[_0x825a('0x8d')](_0x825a('0x8e'),{'UserId':Number(_0x23228e['query'][_0x825a('0x6d')][_0x6b89ab]),'FaxQueueId':Number(_0x23228e['params']['id'])});}}else{socket[_0x825a('0x8d')](_0x825a('0x8e'),{'UserId':Number(_0x23228e[_0x825a('0x3c')]['ids']),'FaxQueueId':Number(_0x23228e['params']['id'])});}});}})[_0x825a('0x2e')](respondWithStatusCode(_0x1425de,null))[_0x825a('0x52')](handleError(_0x1425de,null));};exports['getAgents']=function(_0x24f191,_0x29bc9d,_0x2b458b){var _0x3bc3ce={};var _0x2b6608={};var _0x257eba;var _0x4a9416;return db[_0x825a('0x37')][_0x825a('0x5d')]({'where':{'id':_0x24f191[_0x825a('0x4f')]['id']}})['then'](handleEntityNotFound(_0x29bc9d,null))['then'](function(_0x4e6685){if(_0x4e6685){_0x257eba=_0x4e6685;_0x2b6608['model']=_[_0x825a('0x3d')](db[_0x825a('0x79')]['rawAttributes']);_0x2b6608['query']=_['keys'](_0x24f191['query']);_0x2b6608['filters']=_[_0x825a('0x3f')](_0x2b6608[_0x825a('0x3b')],_0x2b6608[_0x825a('0x3c')]);_0x3bc3ce[_0x825a('0x40')]=_[_0x825a('0x3f')](_0x2b6608['model'],qs['fields'](_0x24f191[_0x825a('0x3c')]['fields']));_0x3bc3ce['attributes']=_0x3bc3ce[_0x825a('0x40')][_0x825a('0x42')]?_0x3bc3ce['attributes']:_0x2b6608['model'];_0x3bc3ce['order']=qs[_0x825a('0x46')](_0x24f191['query']['sort']);_0x3bc3ce['where']=qs[_0x825a('0x3e')](_[_0x825a('0x48')](_0x24f191[_0x825a('0x3c')],_0x2b6608[_0x825a('0x3e')]));if(_0x24f191[_0x825a('0x3c')]['filter']){_0x3bc3ce[_0x825a('0x47')]=_[_0x825a('0x4a')](_0x3bc3ce[_0x825a('0x47')],{'$or':_[_0x825a('0x36')](_0x3bc3ce[_0x825a('0x40')],function(_0x1cf5dd){var _0x1e832d={};_0x1e832d[_0x1cf5dd]={'$like':'%'+_0x24f191[_0x825a('0x3c')]['filter']+'%'};return _0x1e832d;})});}_0x3bc3ce=_['merge']({},_0x3bc3ce,_0x24f191['options']);return _0x257eba[_0x825a('0x92')](_0x3bc3ce);}})[_0x825a('0x2e')](function(_0x305fe8){if(_0x305fe8){_0x4a9416=_0x305fe8[_0x825a('0x42')];if(!_0x24f191[_0x825a('0x3c')]['hasOwnProperty'](_0x825a('0x44'))){_0x3bc3ce['limit']=qs[_0x825a('0x26')](_0x24f191[_0x825a('0x3c')]['limit']);_0x3bc3ce[_0x825a('0x23')]=qs['offset'](_0x24f191[_0x825a('0x3c')][_0x825a('0x23')]);}return _0x257eba['getAgents'](_0x3bc3ce);}})['then'](function(_0x2c09f2){if(_0x2c09f2){return _0x2c09f2?{'count':_0x4a9416,'rows':_0x2c09f2}:null;}})[_0x825a('0x2e')](respondWithResult(_0x29bc9d,null))[_0x825a('0x52')](handleError(_0x29bc9d,null));}; \ No newline at end of file +var _0x9316=['count','limit','set','Content-Range','reject','save','then','destroy','get','sendStatus','error','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','sort','where','filters','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxQueues','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','FaxQueueId','UserId','agent','faxPause','updatedAt','%s/%s','SIP','createdAt','getTeams','findOne','Team','order','addTeams','ids','User','Agents','online','voicePause','flatMap','sequelize','each','findOrCreate','forEach','emit','removeTeams','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','transaction','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','userFaxQueue:save','isArray','getAgents','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','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/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxQueue.socket','register','status','end','json','offset','undefined'];(function(_0x392072,_0x57b434){var _0x5914f6=function(_0x290fb){while(--_0x290fb){_0x392072['push'](_0x392072['shift']());}};_0x5914f6(++_0x57b434);}(_0x9316,0x6e));var _0x6931=function(_0x1e218e,_0x1d73f5){_0x1e218e=_0x1e218e-0x0;var _0x30e2a4=_0x9316[_0x1e218e];return _0x30e2a4;};'use strict';var emlformat=require(_0x6931('0x0'));var rimraf=require(_0x6931('0x1'));var zipdir=require(_0x6931('0x2'));var jsonpatch=require(_0x6931('0x3'));var rp=require('request-promise');var moment=require(_0x6931('0x4'));var BPromise=require(_0x6931('0x5'));var Mustache=require(_0x6931('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6931('0x7'));var csv=require('to-csv');var ejs=require(_0x6931('0x8'));var fs=require('fs');var fs_extra=require(_0x6931('0x9'));var _=require(_0x6931('0xa'));var squel=require(_0x6931('0xb'));var crypto=require(_0x6931('0xc'));var jsforce=require(_0x6931('0xd'));var deskjs=require(_0x6931('0xe'));var toCsv=require(_0x6931('0xf'));var querystring=require(_0x6931('0x10'));var Papa=require(_0x6931('0x11'));var Redis=require(_0x6931('0x12'));var authService=require(_0x6931('0x13'));var qs=require(_0x6931('0x14'));var as=require(_0x6931('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6931('0x16'))(_0x6931('0x17'));var utils=require('../../config/utils');var config=require(_0x6931('0x18'));var licenseUtil=require(_0x6931('0x19'));var db=require(_0x6931('0x1a'))['db'];config[_0x6931('0x1b')]=_[_0x6931('0x1c')](config[_0x6931('0x1b')],{'host':_0x6931('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6931('0x1e'))[_0x6931('0x1f')](socket);function respondWithStatusCode(_0x3f6bad,_0x5e2cbc){_0x5e2cbc=_0x5e2cbc||0xcc;return function(_0x4ecf07){if(_0x4ecf07){return _0x3f6bad['sendStatus'](_0x5e2cbc);}return _0x3f6bad[_0x6931('0x20')](_0x5e2cbc)[_0x6931('0x21')]();};}function respondWithResult(_0x50b693,_0x53a616){_0x53a616=_0x53a616||0xc8;return function(_0x5ec2d7){if(_0x5ec2d7){return _0x50b693[_0x6931('0x20')](_0x53a616)[_0x6931('0x22')](_0x5ec2d7);}};}function respondWithFilteredResult(_0x81f8f9,_0x142a05){return function(_0x33443d){if(_0x33443d){var _0x35d129=typeof _0x142a05[_0x6931('0x23')]===_0x6931('0x24')&&typeof _0x142a05['limit']==='undefined';var _0x4f7d78=_0x33443d[_0x6931('0x25')];var _0x4c6bf4=_0x35d129?0x0:_0x142a05[_0x6931('0x23')];var _0x965dc4=_0x35d129?_0x33443d[_0x6931('0x25')]:_0x142a05[_0x6931('0x23')]+_0x142a05[_0x6931('0x26')];var _0x3a0c1c;if(_0x965dc4>=_0x4f7d78){_0x965dc4=_0x4f7d78;_0x3a0c1c=0xc8;}else{_0x3a0c1c=0xce;}_0x81f8f9[_0x6931('0x20')](_0x3a0c1c);return _0x81f8f9[_0x6931('0x27')](_0x6931('0x28'),_0x4c6bf4+'-'+_0x965dc4+'/'+_0x4f7d78)[_0x6931('0x22')](_0x33443d);}return null;};}function patchUpdates(_0x5d63a7){return function(_0x574a12){try{jsonpatch['apply'](_0x574a12,_0x5d63a7,!![]);}catch(_0x8f5938){return BPromise[_0x6931('0x29')](_0x8f5938);}return _0x574a12[_0x6931('0x2a')]();};}function saveUpdates(_0x222a5e,_0x47ac59){return function(_0x946238){if(_0x946238){return _0x946238['update'](_0x222a5e)[_0x6931('0x2b')](function(_0x3591ed){return _0x3591ed;});}return null;};}function removeEntity(_0x14c5e0,_0x308fe3){return function(_0x1e154c){if(_0x1e154c){return _0x1e154c[_0x6931('0x2c')]()[_0x6931('0x2b')](function(){var _0x5bd929=_0x1e154c[_0x6931('0x2d')]({'plain':!![]});var _0x1a096c='FaxQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x1a096c,'resourceId':_0x5bd929['id']}})[_0x6931('0x2b')](function(){return _0x1e154c;});})['then'](function(){_0x14c5e0[_0x6931('0x20')](0xcc)[_0x6931('0x21')]();});}};}function handleEntityNotFound(_0x52ff5f,_0x3874fe){return function(_0x21294e){if(!_0x21294e){_0x52ff5f[_0x6931('0x2e')](0x194);}return _0x21294e;};}function handleError(_0x2d7876,_0x5307df){_0x5307df=_0x5307df||0x1f4;return function(_0x1f18b8){logger[_0x6931('0x2f')](_0x1f18b8[_0x6931('0x30')]);if(_0x1f18b8[_0x6931('0x31')]){delete _0x1f18b8['name'];}_0x2d7876[_0x6931('0x20')](_0x5307df)[_0x6931('0x32')](_0x1f18b8);};}exports[_0x6931('0x33')]=function(_0x4d2ed3,_0x367ca1){var _0x5bc418={},_0xda7957={},_0x25320b={'count':0x0,'rows':[]};var _0x2da397=_[_0x6931('0x34')](db[_0x6931('0x35')][_0x6931('0x36')],function(_0x1cf300){return{'name':_0x1cf300[_0x6931('0x37')],'type':_0x1cf300['type'][_0x6931('0x38')]};});_0xda7957[_0x6931('0x39')]=_[_0x6931('0x34')](_0x2da397,_0x6931('0x31'));_0xda7957[_0x6931('0x3a')]=_[_0x6931('0x3b')](_0x4d2ed3[_0x6931('0x3a')]);_0xda7957['filters']=_[_0x6931('0x3c')](_0xda7957[_0x6931('0x39')],_0xda7957[_0x6931('0x3a')]);_0x5bc418['attributes']=_[_0x6931('0x3c')](_0xda7957[_0x6931('0x39')],qs[_0x6931('0x3d')](_0x4d2ed3['query'][_0x6931('0x3d')]));_0x5bc418[_0x6931('0x3e')]=_0x5bc418['attributes']['length']?_0x5bc418[_0x6931('0x3e')]:_0xda7957[_0x6931('0x39')];if(!_0x4d2ed3[_0x6931('0x3a')][_0x6931('0x3f')]('nolimit')){_0x5bc418[_0x6931('0x26')]=qs[_0x6931('0x26')](_0x4d2ed3['query'][_0x6931('0x26')]);_0x5bc418[_0x6931('0x23')]=qs[_0x6931('0x23')](_0x4d2ed3[_0x6931('0x3a')]['offset']);}_0x5bc418['order']=qs[_0x6931('0x40')](_0x4d2ed3['query'][_0x6931('0x40')]);_0x5bc418[_0x6931('0x41')]=qs[_0x6931('0x42')](_[_0x6931('0x43')](_0x4d2ed3[_0x6931('0x3a')],_0xda7957[_0x6931('0x42')]),_0x2da397);if(_0x4d2ed3[_0x6931('0x3a')][_0x6931('0x44')]){_0x5bc418[_0x6931('0x41')]=_['merge'](_0x5bc418[_0x6931('0x41')],{'$or':_[_0x6931('0x34')](_0x2da397,function(_0x40f6b6){if(_0x40f6b6[_0x6931('0x45')]!==_0x6931('0x46')){var _0x5c69ef={};_0x5c69ef[_0x40f6b6[_0x6931('0x31')]]={'$like':'%'+_0x4d2ed3[_0x6931('0x3a')]['filter']+'%'};return _0x5c69ef;}})});}_0x5bc418=_['merge']({},_0x5bc418,_0x4d2ed3[_0x6931('0x47')]);var _0x51df2e={'where':_0x5bc418[_0x6931('0x41')]};return db[_0x6931('0x35')][_0x6931('0x25')](_0x51df2e)['then'](function(_0x596b0e){_0x25320b[_0x6931('0x25')]=_0x596b0e;if(_0x4d2ed3['query'][_0x6931('0x48')]){_0x5bc418[_0x6931('0x49')]=[{'all':!![]}];}return db[_0x6931('0x35')][_0x6931('0x4a')](_0x5bc418);})[_0x6931('0x2b')](function(_0x12bbc2){_0x25320b[_0x6931('0x4b')]=_0x12bbc2;return _0x25320b;})['then'](respondWithFilteredResult(_0x367ca1,_0x5bc418))[_0x6931('0x4c')](handleError(_0x367ca1,null));};exports[_0x6931('0x4d')]=function(_0x4ba3a5,_0x5ace79){var _0x41a308={'raw':!![],'where':{'id':_0x4ba3a5['params']['id']}},_0x2be917={};_0x2be917['model']=_[_0x6931('0x3b')](db[_0x6931('0x35')][_0x6931('0x36')]);_0x2be917['query']=_[_0x6931('0x3b')](_0x4ba3a5['query']);_0x2be917['filters']=_[_0x6931('0x3c')](_0x2be917['model'],_0x2be917['query']);_0x41a308[_0x6931('0x3e')]=_[_0x6931('0x3c')](_0x2be917[_0x6931('0x39')],qs[_0x6931('0x3d')](_0x4ba3a5['query'][_0x6931('0x3d')]));_0x41a308[_0x6931('0x3e')]=_0x41a308[_0x6931('0x3e')][_0x6931('0x4e')]?_0x41a308[_0x6931('0x3e')]:_0x2be917[_0x6931('0x39')];if(_0x4ba3a5[_0x6931('0x3a')][_0x6931('0x48')]){_0x41a308[_0x6931('0x49')]=[{'all':!![]}];}_0x41a308=_[_0x6931('0x4f')]({},_0x41a308,_0x4ba3a5[_0x6931('0x47')]);return db[_0x6931('0x35')]['find'](_0x41a308)[_0x6931('0x2b')](handleEntityNotFound(_0x5ace79,null))[_0x6931('0x2b')](respondWithResult(_0x5ace79,null))['catch'](handleError(_0x5ace79,null));};exports[_0x6931('0x50')]=function(_0x5c7707,_0x5c41ac){return db[_0x6931('0x35')]['create'](_0x5c7707[_0x6931('0x51')],{})['then'](function(_0x25393e){var _0x3bbe7e=_0x5c7707[_0x6931('0x52')][_0x6931('0x2d')]({'plain':!![]});if(!_0x3bbe7e)throw new Error(_0x6931('0x53'));if(_0x3bbe7e[_0x6931('0x54')]===_0x6931('0x52')){var _0x2e4bda=_0x25393e[_0x6931('0x2d')]({'plain':!![]});var _0x3bc631=_0x6931('0x55');return db['UserProfileSection'][_0x6931('0x56')]({'where':{'name':_0x3bc631,'userProfileId':_0x3bbe7e[_0x6931('0x57')]},'raw':!![]})['then'](function(_0x3b0f36){if(_0x3b0f36&&_0x3b0f36[_0x6931('0x58')]===0x0){return db[_0x6931('0x59')][_0x6931('0x50')]({'name':_0x2e4bda[_0x6931('0x31')],'resourceId':_0x2e4bda['id'],'type':_0x3b0f36[_0x6931('0x31')],'sectionId':_0x3b0f36['id']},{})[_0x6931('0x2b')](function(){return _0x25393e;});}else{return _0x25393e;}})[_0x6931('0x4c')](function(_0x597c80){logger[_0x6931('0x2f')](_0x6931('0x5a'),_0x597c80);throw _0x597c80;});}return _0x25393e;})[_0x6931('0x2b')](respondWithResult(_0x5c41ac,0xc9))[_0x6931('0x4c')](handleError(_0x5c41ac,null));};exports[_0x6931('0x5b')]=function(_0x15d753,_0x54062c){if(_0x15d753[_0x6931('0x51')]['id']){delete _0x15d753['body']['id'];}return db[_0x6931('0x35')][_0x6931('0x56')]({'where':{'id':_0x15d753[_0x6931('0x5c')]['id']}})[_0x6931('0x2b')](handleEntityNotFound(_0x54062c,null))[_0x6931('0x2b')](saveUpdates(_0x15d753[_0x6931('0x51')],null))[_0x6931('0x2b')](respondWithResult(_0x54062c,null))[_0x6931('0x4c')](handleError(_0x54062c,null));};exports[_0x6931('0x2c')]=function(_0x13b2b8,_0x5245cf){return db[_0x6931('0x35')][_0x6931('0x56')]({'where':{'id':_0x13b2b8[_0x6931('0x5c')]['id']}})[_0x6931('0x2b')](handleEntityNotFound(_0x5245cf,null))[_0x6931('0x2b')](removeEntity(_0x5245cf,null))['catch'](handleError(_0x5245cf,null));};exports[_0x6931('0x5d')]=function(_0x911286,_0x5b6dcf){return db['FaxQueue'][_0x6931('0x5d')]()[_0x6931('0x2b')](respondWithResult(_0x5b6dcf,null))['catch'](handleError(_0x5b6dcf,null));};exports['getMembers']=function(_0x510412,_0x5163cf,_0x46d0c8){var _0x41a705={'raw':!![],'where':{}},_0x16204d={},_0x1b178e;return db[_0x6931('0x35')]['findOne']({'where':{'id':_0x510412[_0x6931('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5163cf,null))['then'](function(_0x2b78f2){if(_0x2b78f2){_0x1b178e=_0x2b78f2['get']({'plain':!![]});_0x16204d[_0x6931('0x39')]=_[_0x6931('0x3b')](db['UserFaxQueue'][_0x6931('0x36')]);_0x16204d[_0x6931('0x3a')]=_[_0x6931('0x3b')](_0x510412[_0x6931('0x3a')]);_0x16204d[_0x6931('0x42')]=_[_0x6931('0x3c')](_0x16204d['model'],_0x16204d[_0x6931('0x3a')]);_0x41a705[_0x6931('0x3e')]=_[_0x6931('0x3c')](_0x16204d[_0x6931('0x39')],qs[_0x6931('0x3d')](_0x510412[_0x6931('0x3a')]['fields']));_0x41a705[_0x6931('0x3e')]=_0x41a705[_0x6931('0x3e')]['length']?_0x41a705[_0x6931('0x3e')]:_0x16204d[_0x6931('0x39')];if(!_0x510412[_0x6931('0x3a')][_0x6931('0x3f')]('nolimit')){_0x41a705[_0x6931('0x26')]=qs[_0x6931('0x26')](_0x510412[_0x6931('0x3a')][_0x6931('0x26')]);_0x41a705[_0x6931('0x23')]=qs['offset'](_0x510412[_0x6931('0x3a')][_0x6931('0x23')]);}_0x41a705['order']=qs[_0x6931('0x40')](_0x510412[_0x6931('0x3a')][_0x6931('0x40')]);_0x41a705['where']=qs[_0x6931('0x42')](_[_0x6931('0x43')](_0x510412[_0x6931('0x3a')],_0x16204d['filters']));_0x41a705[_0x6931('0x41')][_0x6931('0x5e')]=_0x2b78f2['id'];if(_0x510412[_0x6931('0x3a')][_0x6931('0x44')]){_0x41a705['where']=_[_0x6931('0x4f')](_0x41a705[_0x6931('0x41')],{'$or':_[_0x6931('0x34')](_0x41a705[_0x6931('0x3e')],function(_0x3c4d04){var _0x56eb71={};_0x56eb71[_0x3c4d04]={'$like':'%'+_0x510412[_0x6931('0x3a')][_0x6931('0x44')]+'%'};return _0x56eb71;})});}_0x41a705=_[_0x6931('0x4f')]({},_0x41a705,_0x510412[_0x6931('0x47')]);return db['UserFaxQueue']['findAll'](_0x41a705);}})['then'](function(_0x22d4e1){if(_0x22d4e1){return db['User']['findAndCountAll']({'where':{'id':_[_0x6931('0x34')](_0x22d4e1,_0x6931('0x5f')),'role':_0x6931('0x60')},'attributes':['id','name',_0x6931('0x61'),_0x6931('0x62'),'createdAt']});}})['then'](function(_0x4375ce){if(_0x4375ce){return{'count':_0x4375ce[_0x6931('0x25')],'rows':_['map'](_0x4375ce['rows'],function(_0x461e5f){return{'membername':_0x461e5f[_0x6931('0x31')],'UserId':_0x461e5f['id'],'queue_name':_0x1b178e[_0x6931('0x31')],'FaxQueueId':_0x1b178e['id'],'interface':util['format'](_0x6931('0x63'),_0x6931('0x64'),_0x461e5f[_0x6931('0x31')]),'penalty':0x0,'paused':_0x461e5f[_0x6931('0x61')],'createdAt':_0x461e5f[_0x6931('0x65')],'updatedAt':_0x461e5f[_0x6931('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5163cf,_0x41a705))[_0x6931('0x4c')](handleError(_0x5163cf,null));};exports[_0x6931('0x66')]=function(_0x1d7ccf,_0x4f5e7e,_0x423139){var _0x11836f={};var _0x3ffa28={};var _0x47dcc5;var _0x17eedb;return db['FaxQueue'][_0x6931('0x67')]({'where':{'id':_0x1d7ccf['params']['id']}})[_0x6931('0x2b')](handleEntityNotFound(_0x4f5e7e,null))[_0x6931('0x2b')](function(_0x523f5c){if(_0x523f5c){_0x47dcc5=_0x523f5c;_0x3ffa28[_0x6931('0x39')]=_[_0x6931('0x3b')](db[_0x6931('0x68')]['rawAttributes']);_0x3ffa28[_0x6931('0x3a')]=_[_0x6931('0x3b')](_0x1d7ccf[_0x6931('0x3a')]);_0x3ffa28[_0x6931('0x42')]=_['intersection'](_0x3ffa28[_0x6931('0x39')],_0x3ffa28[_0x6931('0x3a')]);_0x11836f[_0x6931('0x3e')]=_[_0x6931('0x3c')](_0x3ffa28[_0x6931('0x39')],qs['fields'](_0x1d7ccf['query'][_0x6931('0x3d')]));_0x11836f['attributes']=_0x11836f[_0x6931('0x3e')][_0x6931('0x4e')]?_0x11836f[_0x6931('0x3e')]:_0x3ffa28[_0x6931('0x39')];_0x11836f[_0x6931('0x69')]=qs['sort'](_0x1d7ccf[_0x6931('0x3a')]['sort']);_0x11836f[_0x6931('0x41')]=qs[_0x6931('0x42')](_[_0x6931('0x43')](_0x1d7ccf[_0x6931('0x3a')],_0x3ffa28[_0x6931('0x42')]));if(_0x1d7ccf['query'][_0x6931('0x44')]){_0x11836f['where']=_['merge'](_0x11836f['where'],{'$or':_[_0x6931('0x34')](_0x11836f['attributes'],function(_0x224c2f){var _0xae9e76={};_0xae9e76[_0x224c2f]={'$like':'%'+_0x1d7ccf[_0x6931('0x3a')][_0x6931('0x44')]+'%'};return _0xae9e76;})});}_0x11836f=_[_0x6931('0x4f')]({},_0x11836f,_0x1d7ccf['options']);return _0x47dcc5[_0x6931('0x66')](_0x11836f);}})[_0x6931('0x2b')](function(_0x100a53){if(_0x100a53){_0x17eedb=_0x100a53[_0x6931('0x4e')];if(!_0x1d7ccf[_0x6931('0x3a')][_0x6931('0x3f')]('nolimit')){_0x11836f['limit']=qs['limit'](_0x1d7ccf[_0x6931('0x3a')][_0x6931('0x26')]);_0x11836f['offset']=qs[_0x6931('0x23')](_0x1d7ccf[_0x6931('0x3a')][_0x6931('0x23')]);}return _0x47dcc5[_0x6931('0x66')](_0x11836f);}})[_0x6931('0x2b')](function(_0x48f3f2){if(_0x48f3f2){return _0x48f3f2?{'count':_0x17eedb,'rows':_0x48f3f2}:null;}})[_0x6931('0x2b')](respondWithResult(_0x4f5e7e,null))[_0x6931('0x4c')](handleError(_0x4f5e7e,null));};exports[_0x6931('0x6a')]=function(_0xdb791,_0xdeb1f3,_0x5307ae){var _0x32a36a=_0xdb791['body'][_0x6931('0x6b')];return db['Team']['findAll']({'where':{'id':_0x32a36a},'attributes':['id'],'include':[{'model':db[_0x6931('0x6c')],'as':_0x6931('0x6d'),'attributes':['id','name',_0x6931('0x6e'),_0x6931('0x6f'),'interface'],'raw':!![]}]})['then'](function(_0x36f5f6){if(_0x36f5f6){var _0x398b8c=_[_0x6931('0x70')](_0x36f5f6,function(_0x26c13a){var _0x5afbf8=_0x26c13a[_0x6931('0x2d')]({'plain':!![]});return _0x5afbf8[_0x6931('0x6d')];});return db[_0x6931('0x35')][_0x6931('0x56')]({'where':{'id':_0xdb791[_0x6931('0x5c')]['id']}})[_0x6931('0x2b')](function(_0x474a61){return db[_0x6931('0x71')]['transaction'](function(_0x3448da){return _0x474a61[_0x6931('0x6a')](_0x32a36a,{'transaction':_0x3448da})[_0x6931('0x2b')](function(){return BPromise[_0x6931('0x72')](_0x398b8c,function(_0x9d06fa){return db['UserFaxQueue'][_0x6931('0x73')]({'where':{'UserId':_0x9d06fa['id'],'FaxQueueId':_0xdb791[_0x6931('0x5c')]['id']},'transaction':_0x3448da});});})[_0x6931('0x2b')](function(){_0x398b8c[_0x6931('0x74')](function(_0x44bb8b){socket[_0x6931('0x75')]('userFaxQueue:save',{'UserId':_0x44bb8b['id'],'FaxQueueId':_0x474a61['id']});});});});});}})[_0x6931('0x2b')](respondWithStatusCode(_0xdeb1f3,null))[_0x6931('0x4c')](handleError(_0xdeb1f3,null));};exports[_0x6931('0x76')]=function(_0x4a4286,_0x1a5cf6,_0x1cee7e){return db[_0x6931('0x68')][_0x6931('0x4a')]({'where':{'id':_0x4a4286[_0x6931('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0x6931('0x6c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x6931('0x2b')](handleEntityNotFound(_0x1a5cf6,null))[_0x6931('0x2b')](function(_0x491383){var _0x2e3f8b=_[_0x6931('0x34')](_0x491383,'id');var _0x4bbfa2=[];var _0x31cb08=[];var _0x4970c7=squel['select']();_0x4970c7['field'](_0x6931('0x77'))[_0x6931('0x78')](_0x6931('0x79'),'tq')[_0x6931('0x7a')](_0x6931('0x7b'),'ut',_0x6931('0x7c'))['where'](_0x6931('0x7d'),_0x4a4286[_0x6931('0x5c')]['id']);for(var _0x530cc2=0x0;_0x530cc2<_0x491383[_0x6931('0x4e')];_0x530cc2+=0x1){let _0x297ef9=_0x491383[_0x530cc2];for(var _0x5a1e2d=0x0;_0x5a1e2d<_0x297ef9[_0x6931('0x6d')]['length'];_0x5a1e2d+=0x1){let _0x5301b2=_0x297ef9[_0x6931('0x6d')][_0x5a1e2d];var _0x250aba=_0x4970c7['clone']();_0x250aba[_0x6931('0x41')](_0x6931('0x7e'),_0x5301b2['id']);_0x31cb08[_0x6931('0x7f')](db[_0x6931('0x71')][_0x6931('0x3a')](_0x250aba[_0x6931('0x80')](),{'type':db['sequelize'][_0x6931('0x81')][_0x6931('0x82')]})[_0x6931('0x2b')](function(_0x2c3321){if(_0x2c3321['length']===0x1){return _0x5301b2['id'];}else{var _0x270824=_[_0x6931('0x83')](_['map'](_0x2c3321,_0x6931('0x84')),function(_0x4007b0){return _[_0x6931('0x85')](_0x2e3f8b,_0x4007b0);});if(_0x270824){return _0x5301b2['id'];}}}));}}return BPromise[_0x6931('0x86')](_0x31cb08)[_0x6931('0x2b')](function(_0x95446){_0x4bbfa2=_(_0x4bbfa2)[_0x6931('0x87')](_0x95446)['compact']()[_0x6931('0x88')]();return db[_0x6931('0x35')][_0x6931('0x56')]({'where':{'id':_0x4a4286[_0x6931('0x5c')]['id']}})[_0x6931('0x2b')](function(_0xbc3b37){return db[_0x6931('0x71')][_0x6931('0x89')](function(_0x183809){return _0xbc3b37[_0x6931('0x76')](_0x4a4286[_0x6931('0x3a')]['ids'],{'transaction':_0x183809})['then'](function(){if(!_[_0x6931('0x8a')](_0x4bbfa2)){return _0xbc3b37[_0x6931('0x8b')](_0x4bbfa2,{'transaction':_0x183809});}})[_0x6931('0x2b')](function(){_0x4bbfa2[_0x6931('0x74')](function(_0x4a9dea){socket['emit'](_0x6931('0x8c'),{'UserId':_0x4a9dea,'FaxQueueId':_0xbc3b37['id']});});});});});});})[_0x6931('0x2b')](respondWithStatusCode(_0x1a5cf6,null))[_0x6931('0x4c')](handleError(_0x1a5cf6,null));};exports[_0x6931('0x8d')]=function(_0x23b63b,_0x59796b,_0x3ba3dc){return db[_0x6931('0x35')]['find']({'where':{'id':_0x23b63b[_0x6931('0x5c')]['id']}})[_0x6931('0x2b')](handleEntityNotFound(_0x59796b,null))['then'](function(_0x36e8eb){if(_0x36e8eb){return _0x36e8eb[_0x6931('0x8d')](_0x23b63b[_0x6931('0x51')]['ids'],_[_0x6931('0x8e')](_0x23b63b[_0x6931('0x51')],[_0x6931('0x6b'),'id'])||{})['spread'](function(_0x1ef8a8){for(var _0x56ec0c=0x0;_0x56ec0c<_0x23b63b[_0x6931('0x51')][_0x6931('0x6b')][_0x6931('0x4e')];_0x56ec0c+=0x1){socket['emit'](_0x6931('0x8f'),{'UserId':Number(_0x23b63b[_0x6931('0x51')][_0x6931('0x6b')][_0x56ec0c]),'FaxQueueId':Number(_0x23b63b[_0x6931('0x5c')]['id'])});}return _0x1ef8a8;});}})[_0x6931('0x2b')](respondWithResult(_0x59796b,null))[_0x6931('0x4c')](handleError(_0x59796b,null));};exports['removeAgents']=function(_0x5d3272,_0x1e90f6,_0x1559b5){return db['FaxQueue'][_0x6931('0x56')]({'where':{'id':_0x5d3272[_0x6931('0x5c')]['id']}})[_0x6931('0x2b')](handleEntityNotFound(_0x1e90f6,null))[_0x6931('0x2b')](function(_0x3bd20b){if(_0x3bd20b){return _0x3bd20b['removeAgents'](_0x5d3272[_0x6931('0x3a')][_0x6931('0x6b')])[_0x6931('0x2b')](function(){if(_[_0x6931('0x90')](_0x5d3272[_0x6931('0x3a')][_0x6931('0x6b')])){for(var _0x4d2ce6=0x0;_0x4d2ce6<_0x5d3272[_0x6931('0x3a')][_0x6931('0x6b')]['length'];_0x4d2ce6+=0x1){socket[_0x6931('0x75')](_0x6931('0x8c'),{'UserId':Number(_0x5d3272['query']['ids'][_0x4d2ce6]),'FaxQueueId':Number(_0x5d3272[_0x6931('0x5c')]['id'])});}}else{socket[_0x6931('0x75')](_0x6931('0x8c'),{'UserId':Number(_0x5d3272[_0x6931('0x3a')][_0x6931('0x6b')]),'FaxQueueId':Number(_0x5d3272[_0x6931('0x5c')]['id'])});}});}})[_0x6931('0x2b')](respondWithStatusCode(_0x1e90f6,null))[_0x6931('0x4c')](handleError(_0x1e90f6,null));};exports[_0x6931('0x91')]=function(_0x315e27,_0x30ac0e,_0x4675e8){var _0x38ed06={};var _0xd0da72={};var _0x13dfbe;var _0x2ddb0c;return db['FaxQueue'][_0x6931('0x67')]({'where':{'id':_0x315e27[_0x6931('0x5c')]['id']}})['then'](handleEntityNotFound(_0x30ac0e,null))[_0x6931('0x2b')](function(_0x58a06f){if(_0x58a06f){_0x13dfbe=_0x58a06f;_0xd0da72[_0x6931('0x39')]=_[_0x6931('0x3b')](db[_0x6931('0x6c')][_0x6931('0x36')]);_0xd0da72['query']=_[_0x6931('0x3b')](_0x315e27[_0x6931('0x3a')]);_0xd0da72[_0x6931('0x42')]=_[_0x6931('0x3c')](_0xd0da72['model'],_0xd0da72[_0x6931('0x3a')]);_0x38ed06[_0x6931('0x3e')]=_[_0x6931('0x3c')](_0xd0da72[_0x6931('0x39')],qs[_0x6931('0x3d')](_0x315e27['query'][_0x6931('0x3d')]));_0x38ed06[_0x6931('0x3e')]=_0x38ed06[_0x6931('0x3e')][_0x6931('0x4e')]?_0x38ed06['attributes']:_0xd0da72[_0x6931('0x39')];_0x38ed06[_0x6931('0x69')]=qs[_0x6931('0x40')](_0x315e27[_0x6931('0x3a')][_0x6931('0x40')]);_0x38ed06[_0x6931('0x41')]=qs[_0x6931('0x42')](_[_0x6931('0x43')](_0x315e27[_0x6931('0x3a')],_0xd0da72[_0x6931('0x42')]));if(_0x315e27[_0x6931('0x3a')][_0x6931('0x44')]){_0x38ed06[_0x6931('0x41')]=_['merge'](_0x38ed06[_0x6931('0x41')],{'$or':_[_0x6931('0x34')](_0x38ed06[_0x6931('0x3e')],function(_0x2cf665){var _0x402a99={};_0x402a99[_0x2cf665]={'$like':'%'+_0x315e27['query'][_0x6931('0x44')]+'%'};return _0x402a99;})});}_0x38ed06=_['merge']({},_0x38ed06,_0x315e27[_0x6931('0x47')]);return _0x13dfbe[_0x6931('0x91')](_0x38ed06);}})[_0x6931('0x2b')](function(_0x220eae){if(_0x220eae){_0x2ddb0c=_0x220eae[_0x6931('0x4e')];if(!_0x315e27[_0x6931('0x3a')][_0x6931('0x3f')](_0x6931('0x92'))){_0x38ed06[_0x6931('0x26')]=qs[_0x6931('0x26')](_0x315e27[_0x6931('0x3a')]['limit']);_0x38ed06[_0x6931('0x23')]=qs['offset'](_0x315e27[_0x6931('0x3a')][_0x6931('0x23')]);}return _0x13dfbe[_0x6931('0x91')](_0x38ed06);}})['then'](function(_0x75027c){if(_0x75027c){return _0x75027c?{'count':_0x2ddb0c,'rows':_0x75027c}:null;}})['then'](respondWithResult(_0x30ac0e,null))[_0x6931('0x4c')](handleError(_0x30ac0e,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 32e95d8..ed5ee0e 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 _0xe78a=['hook','exports','events','FaxQueue','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x39780c,_0x5782c9){var _0x53c19b=function(_0x594f01){while(--_0x594f01){_0x39780c['push'](_0x39780c['shift']());}};_0x53c19b(++_0x5782c9);}(_0xe78a,0x80));var _0xae78=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe78a[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0xae78('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0xae78('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xae78('0x2')](0x0);var events={'afterCreate':_0xae78('0x3'),'afterUpdate':_0xae78('0x4'),'afterDestroy':'remove'};function emitEvent(_0x375c9d){return function(_0xd665c3,_0x3ddc41,_0x556064){FaxQueueEvents[_0xae78('0x5')](_0x375c9d+':'+_0xd665c3['id'],_0xd665c3);FaxQueueEvents[_0xae78('0x5')](_0x375c9d,_0xd665c3);_0x556064(null);};}for(var e in events){if(events[_0xae78('0x6')](e)){var event=events[e];FaxQueue[_0xae78('0x7')](e,emitEvent(event));}}module[_0xae78('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0x2596=['hasOwnProperty','hook','exports','../../mysqldb','FaxQueue','setMaxListeners','update','emit'];(function(_0x240419,_0x2eb4a6){var _0x18437d=function(_0x3cbc73){while(--_0x3cbc73){_0x240419['push'](_0x240419['shift']());}};_0x18437d(++_0x2eb4a6);}(_0x2596,0xe3));var _0x6259=function(_0x52e130,_0x36a67c){_0x52e130=_0x52e130-0x0;var _0x167346=_0x2596[_0x52e130];return _0x167346;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x6259('0x0'))['db'][_0x6259('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x6259('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6259('0x3'),'afterDestroy':'remove'};function emitEvent(_0x13cbc4){return function(_0x5bc05c,_0x2154f1,_0x2dfc30){FaxQueueEvents[_0x6259('0x4')](_0x13cbc4+':'+_0x5bc05c['id'],_0x5bc05c);FaxQueueEvents[_0x6259('0x4')](_0x13cbc4,_0x5bc05c);_0x2dfc30(null);};}for(var e in events){if(events[_0x6259('0x5')](e)){var event=events[e];FaxQueue[_0x6259('0x6')](e,emitEvent(event));}}module[_0x6259('0x7')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index dcdd23b..49b4695 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 _0xeeed=['define','FaxQueue','fax_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x2b2706,_0x3f5179){var _0x403d5b=function(_0x572ee5){while(--_0x572ee5){_0x2b2706['push'](_0x2b2706['shift']());}};_0x403d5b(++_0x3f5179);}(_0xeeed,0xc6));var _0xdeee=function(_0x5dd9a1,_0x569a0c){_0x5dd9a1=_0x5dd9a1-0x0;var _0x2a9156=_0xeeed[_0x5dd9a1];return _0x2a9156;};'use strict';var _=require(_0xdeee('0x0'));var util=require(_0xdeee('0x1'));var logger=require(_0xdeee('0x2'))(_0xdeee('0x3'));var moment=require(_0xdeee('0x4'));var BPromise=require(_0xdeee('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdeee('0x6'));var rimraf=require(_0xdeee('0x7'));var config=require(_0xdeee('0x8'));var attributes=require('./faxQueue.attributes');module[_0xdeee('0x9')]=function(_0x41afbe,_0x28adc9){return _0x41afbe[_0xdeee('0xa')](_0xdeee('0xb'),attributes,{'tableName':_0xdeee('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7351=['api','moment','bluebird','path','rimraf','exports','define','FaxQueue','fax_queues','lodash','../../config/logger'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x7351,0x15e));var _0x1735=function(_0xb49ded,_0x28bfdb){_0xb49ded=_0xb49ded-0x0;var _0x337e69=_0x7351[_0xb49ded];return _0x337e69;};'use strict';var _=require(_0x1735('0x0'));var util=require('util');var logger=require(_0x1735('0x1'))(_0x1735('0x2'));var moment=require(_0x1735('0x3'));var BPromise=require(_0x1735('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1735('0x5'));var rimraf=require(_0x1735('0x6'));var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module[_0x1735('0x7')]=function(_0x4f45c5,_0x3ef7f6){return _0x4f45c5[_0x1735('0x8')](_0x1735('0x9'),attributes,{'tableName':_0x1735('0xa'),'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 3c63003..e03c63f 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 _0x81c3=['client','redis','localhost','socket.io-emitter','./faxQueue.socket','register','then','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','info','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowFaxQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x8bee69,_0x3c9bcb){var _0x32068f=function(_0x27da71){while(--_0x27da71){_0x8bee69['push'](_0x8bee69['shift']());}};_0x32068f(++_0x3c9bcb);}(_0x81c3,0xa0));var _0x381c=function(_0x1f5352,_0x49667e){_0x1f5352=_0x1f5352-0x0;var _0x4a7d8f=_0x81c3[_0x1f5352];return _0x4a7d8f;};'use strict';var _=require(_0x381c('0x0'));var util=require(_0x381c('0x1'));var moment=require(_0x381c('0x2'));var BPromise=require(_0x381c('0x3'));var rs=require(_0x381c('0x4'));var fs=require('fs');var Redis=require(_0x381c('0x5'));var db=require(_0x381c('0x6'))['db'];var utils=require(_0x381c('0x7'));var logger=require(_0x381c('0x8'))(_0x381c('0x9'));var config=require(_0x381c('0xa'));var jayson=require(_0x381c('0xb'));var client=jayson[_0x381c('0xc')]['http']({'port':0x232a});config[_0x381c('0xd')]=_['defaults'](config['redis'],{'host':_0x381c('0xe'),'port':0x18eb});var socket=require(_0x381c('0xf'))(new Redis(config[_0x381c('0xd')]));require(_0x381c('0x10'))[_0x381c('0x11')](socket);function respondWithRpcPromise(_0x4ef2d9,_0x303407,_0xc9ce8a){return new BPromise(function(_0x2812db,_0x5478b5){return client['request'](_0x4ef2d9,_0xc9ce8a)[_0x381c('0x12')](function(_0x5c3646){logger['info']('FaxQueue,\x20%s,\x20%s',_0x303407,_0x381c('0x13'));logger['debug'](_0x381c('0x14'),_0x303407,_0x381c('0x13'),JSON[_0x381c('0x15')](_0x5c3646));if(_0x5c3646[_0x381c('0x16')]){if(_0x5c3646['error'][_0x381c('0x17')]===0x1f4){logger[_0x381c('0x16')](_0x381c('0x18'),_0x303407,_0x5c3646[_0x381c('0x16')][_0x381c('0x19')]);return _0x5478b5(_0x5c3646[_0x381c('0x16')][_0x381c('0x19')]);}logger[_0x381c('0x16')](_0x381c('0x18'),_0x303407,_0x5c3646[_0x381c('0x16')]['message']);return _0x2812db(_0x5c3646[_0x381c('0x16')]['message']);}else{logger[_0x381c('0x1a')](_0x381c('0x18'),_0x303407,_0x381c('0x13'));_0x2812db(_0x5c3646[_0x381c('0x1b')][_0x381c('0x19')]);}})[_0x381c('0x1c')](function(_0x59b531){logger[_0x381c('0x16')](_0x381c('0x18'),_0x303407,_0x59b531);_0x5478b5(_0x59b531);});});}exports[_0x381c('0x1d')]=function(_0x448463){var _0x20401b=this;return new Promise(function(_0x30b826,_0xd884bd){return db[_0x381c('0x1e')][_0x381c('0x1f')]({'raw':_0x448463[_0x381c('0x20')]?_0x448463[_0x381c('0x20')][_0x381c('0x21')]===undefined?!![]:![]:!![],'where':_0x448463[_0x381c('0x20')]?_0x448463['options'][_0x381c('0x22')]||null:null,'attributes':_0x448463[_0x381c('0x20')]?_0x448463[_0x381c('0x20')][_0x381c('0x23')]||null:null,'limit':_0x448463[_0x381c('0x20')]?_0x448463[_0x381c('0x20')][_0x381c('0x24')]||null:null,'include':_0x448463['options']?_0x448463[_0x381c('0x20')][_0x381c('0x25')]?_[_0x381c('0x26')](_0x448463['options'][_0x381c('0x25')],function(_0x574e23){return{'model':db[_0x574e23['model']],'as':_0x574e23['as'],'attributes':_0x574e23[_0x381c('0x23')],'include':_0x574e23[_0x381c('0x25')]?_[_0x381c('0x26')](_0x574e23[_0x381c('0x25')],function(_0x3115e3){return{'model':db[_0x3115e3[_0x381c('0x27')]],'as':_0x3115e3['as'],'attributes':_0x3115e3[_0x381c('0x23')],'include':_0x3115e3['include']?_[_0x381c('0x26')](_0x3115e3['include'],function(_0x1c32e0){return{'model':db[_0x1c32e0[_0x381c('0x27')]],'as':_0x1c32e0['as'],'attributes':_0x1c32e0[_0x381c('0x23')]};}):[]};}):[]};}):[]:[]})[_0x381c('0x12')](function(_0x22174a){logger[_0x381c('0x1a')](_0x381c('0x1d'),_0x448463);logger[_0x381c('0x28')](_0x381c('0x1d'),_0x448463,JSON['stringify'](_0x22174a));_0x30b826(_0x22174a);})[_0x381c('0x1c')](function(_0xdffbcf){logger[_0x381c('0x16')]('GetFaxQueue',_0xdffbcf['message'],_0x448463);_0xd884bd(_0x20401b[_0x381c('0x16')](0x1f4,_0xdffbcf['message']));});});};exports[_0x381c('0x29')]=function(_0xd0800){var _0x3f0aa5=this;return new Promise(function(_0x463afc,_0x3d907e){return db[_0x381c('0x1e')][_0x381c('0x2a')]({'raw':_0xd0800[_0x381c('0x20')]?_0xd0800[_0x381c('0x20')][_0x381c('0x21')]===undefined?!![]:![]:!![],'where':_0xd0800[_0x381c('0x20')]?_0xd0800[_0x381c('0x20')][_0x381c('0x22')]||null:null,'attributes':_0xd0800[_0x381c('0x20')]?_0xd0800[_0x381c('0x20')][_0x381c('0x23')]||null:null,'include':_0xd0800[_0x381c('0x20')]?_0xd0800[_0x381c('0x20')][_0x381c('0x25')]?_['map'](_0xd0800[_0x381c('0x20')][_0x381c('0x25')],function(_0x1c696a){return{'model':db[_0x1c696a[_0x381c('0x27')]],'as':_0x1c696a['as'],'attributes':_0x1c696a['attributes'],'include':_0x1c696a['include']?_[_0x381c('0x26')](_0x1c696a['include'],function(_0x5d95df){return{'model':db[_0x5d95df[_0x381c('0x27')]],'as':_0x5d95df['as'],'attributes':_0x5d95df['attributes'],'include':_0x5d95df[_0x381c('0x25')]?_['map'](_0x5d95df['include'],function(_0x29b710){return{'model':db[_0x29b710['model']],'as':_0x29b710['as'],'attributes':_0x29b710['attributes']};}):[]};}):[]};}):[]:[]})[_0x381c('0x12')](function(_0x97d04c){logger['info'](_0x381c('0x29'),_0xd0800);logger[_0x381c('0x28')](_0x381c('0x29'),_0xd0800,JSON['stringify'](_0x97d04c));_0x463afc(_0x97d04c);})['catch'](function(_0x421c24){logger[_0x381c('0x16')]('ShowFaxQueue',_0x421c24[_0x381c('0x19')],_0xd0800);_0x3d907e(_0x3f0aa5[_0x381c('0x16')](0x1f4,_0x421c24[_0x381c('0x19')]));});});}; \ No newline at end of file +var _0x6d69=['debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','FaxQueue','options','raw','where','attributes','limit','include','map','model','GetFaxQueue','stringify','catch','ShowFaxQueue','find','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x56d44b,_0x332713){var _0xc033c8=function(_0x17712b){while(--_0x17712b){_0x56d44b['push'](_0x56d44b['shift']());}};_0xc033c8(++_0x332713);}(_0x6d69,0x134));var _0x96d6=function(_0x5b5b66,_0x2e6210){_0x5b5b66=_0x5b5b66-0x0;var _0x344fee=_0x6d69[_0x5b5b66];return _0x344fee;};'use strict';var _=require(_0x96d6('0x0'));var util=require(_0x96d6('0x1'));var moment=require(_0x96d6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x96d6('0x3'));var db=require(_0x96d6('0x4'))['db'];var utils=require(_0x96d6('0x5'));var logger=require(_0x96d6('0x6'))(_0x96d6('0x7'));var config=require(_0x96d6('0x8'));var jayson=require(_0x96d6('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x96d6('0xa')]=_[_0x96d6('0xb')](config[_0x96d6('0xa')],{'host':_0x96d6('0xc'),'port':0x18eb});var socket=require(_0x96d6('0xd'))(new Redis(config['redis']));require(_0x96d6('0xe'))[_0x96d6('0xf')](socket);function respondWithRpcPromise(_0x465fe9,_0x247c35,_0x519caa){return new BPromise(function(_0x50fad6,_0x710832){return client[_0x96d6('0x10')](_0x465fe9,_0x519caa)[_0x96d6('0x11')](function(_0x216f52){logger['info'](_0x96d6('0x12'),_0x247c35,_0x96d6('0x13'));logger[_0x96d6('0x14')](_0x96d6('0x15'),_0x247c35,_0x96d6('0x13'),JSON['stringify'](_0x216f52));if(_0x216f52[_0x96d6('0x16')]){if(_0x216f52[_0x96d6('0x16')][_0x96d6('0x17')]===0x1f4){logger[_0x96d6('0x16')](_0x96d6('0x12'),_0x247c35,_0x216f52['error'][_0x96d6('0x18')]);return _0x710832(_0x216f52[_0x96d6('0x16')][_0x96d6('0x18')]);}logger[_0x96d6('0x16')](_0x96d6('0x12'),_0x247c35,_0x216f52[_0x96d6('0x16')][_0x96d6('0x18')]);return _0x50fad6(_0x216f52[_0x96d6('0x16')]['message']);}else{logger[_0x96d6('0x19')]('FaxQueue,\x20%s,\x20%s',_0x247c35,_0x96d6('0x13'));_0x50fad6(_0x216f52[_0x96d6('0x1a')][_0x96d6('0x18')]);}})['catch'](function(_0x3a2acb){logger[_0x96d6('0x16')](_0x96d6('0x12'),_0x247c35,_0x3a2acb);_0x710832(_0x3a2acb);});});}exports['GetFaxQueue']=function(_0x21583a){var _0x188a2e=this;return new Promise(function(_0x4cf563,_0x265ad7){return db[_0x96d6('0x1b')]['findAll']({'raw':_0x21583a[_0x96d6('0x1c')]?_0x21583a[_0x96d6('0x1c')][_0x96d6('0x1d')]===undefined?!![]:![]:!![],'where':_0x21583a['options']?_0x21583a[_0x96d6('0x1c')][_0x96d6('0x1e')]||null:null,'attributes':_0x21583a[_0x96d6('0x1c')]?_0x21583a['options'][_0x96d6('0x1f')]||null:null,'limit':_0x21583a[_0x96d6('0x1c')]?_0x21583a[_0x96d6('0x1c')][_0x96d6('0x20')]||null:null,'include':_0x21583a[_0x96d6('0x1c')]?_0x21583a[_0x96d6('0x1c')][_0x96d6('0x21')]?_[_0x96d6('0x22')](_0x21583a['options'][_0x96d6('0x21')],function(_0x5e2431){return{'model':db[_0x5e2431[_0x96d6('0x23')]],'as':_0x5e2431['as'],'attributes':_0x5e2431[_0x96d6('0x1f')],'include':_0x5e2431[_0x96d6('0x21')]?_[_0x96d6('0x22')](_0x5e2431[_0x96d6('0x21')],function(_0x4ff5eb){return{'model':db[_0x4ff5eb[_0x96d6('0x23')]],'as':_0x4ff5eb['as'],'attributes':_0x4ff5eb['attributes'],'include':_0x4ff5eb['include']?_[_0x96d6('0x22')](_0x4ff5eb[_0x96d6('0x21')],function(_0x5c51ce){return{'model':db[_0x5c51ce[_0x96d6('0x23')]],'as':_0x5c51ce['as'],'attributes':_0x5c51ce['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5349f7){logger['info'](_0x96d6('0x24'),_0x21583a);logger[_0x96d6('0x14')](_0x96d6('0x24'),_0x21583a,JSON[_0x96d6('0x25')](_0x5349f7));_0x4cf563(_0x5349f7);})[_0x96d6('0x26')](function(_0xc64e98){logger[_0x96d6('0x16')](_0x96d6('0x24'),_0xc64e98[_0x96d6('0x18')],_0x21583a);_0x265ad7(_0x188a2e['error'](0x1f4,_0xc64e98[_0x96d6('0x18')]));});});};exports[_0x96d6('0x27')]=function(_0x3b0365){var _0x526130=this;return new Promise(function(_0x4efd6b,_0x450128){return db[_0x96d6('0x1b')][_0x96d6('0x28')]({'raw':_0x3b0365[_0x96d6('0x1c')]?_0x3b0365[_0x96d6('0x1c')][_0x96d6('0x1d')]===undefined?!![]:![]:!![],'where':_0x3b0365[_0x96d6('0x1c')]?_0x3b0365[_0x96d6('0x1c')][_0x96d6('0x1e')]||null:null,'attributes':_0x3b0365['options']?_0x3b0365[_0x96d6('0x1c')]['attributes']||null:null,'include':_0x3b0365[_0x96d6('0x1c')]?_0x3b0365[_0x96d6('0x1c')][_0x96d6('0x21')]?_['map'](_0x3b0365[_0x96d6('0x1c')][_0x96d6('0x21')],function(_0x303398){return{'model':db[_0x303398[_0x96d6('0x23')]],'as':_0x303398['as'],'attributes':_0x303398[_0x96d6('0x1f')],'include':_0x303398[_0x96d6('0x21')]?_[_0x96d6('0x22')](_0x303398['include'],function(_0x29ed4b){return{'model':db[_0x29ed4b['model']],'as':_0x29ed4b['as'],'attributes':_0x29ed4b[_0x96d6('0x1f')],'include':_0x29ed4b[_0x96d6('0x21')]?_[_0x96d6('0x22')](_0x29ed4b[_0x96d6('0x21')],function(_0x188d29){return{'model':db[_0x188d29[_0x96d6('0x23')]],'as':_0x188d29['as'],'attributes':_0x188d29[_0x96d6('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x96d6('0x11')](function(_0x3b5b30){logger['info'](_0x96d6('0x27'),_0x3b0365);logger[_0x96d6('0x14')](_0x96d6('0x27'),_0x3b0365,JSON[_0x96d6('0x25')](_0x3b5b30));_0x4efd6b(_0x3b5b30);})[_0x96d6('0x26')](function(_0x196440){logger[_0x96d6('0x16')](_0x96d6('0x27'),_0x196440[_0x96d6('0x18')],_0x3b0365);_0x450128(_0x526130[_0x96d6('0x16')](0x1f4,_0x196440[_0x96d6('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index ef961e2..ca6a7b9 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 _0x9935=['save','update','emit','removeListener','faxQueue:','./faxQueue.events'];(function(_0x3055f7,_0x5e58e8){var _0x1f50fe=function(_0x40e227){while(--_0x40e227){_0x3055f7['push'](_0x3055f7['shift']());}};_0x1f50fe(++_0x5e58e8);}(_0x9935,0x137));var _0x5993=function(_0x3e0398,_0x596edd){_0x3e0398=_0x3e0398-0x0;var _0xb3a038=_0x9935[_0x3e0398];return _0xb3a038;};'use strict';var FaxQueueEvents=require(_0x5993('0x0'));var events=[_0x5993('0x1'),'remove',_0x5993('0x2')];function createListener(_0x4b1a2e,_0x8bcd73){return function(_0x176dbc){_0x8bcd73[_0x5993('0x3')](_0x4b1a2e,_0x176dbc);};}function removeListener(_0x4cbd18,_0x82f0ee){return function(){FaxQueueEvents[_0x5993('0x4')](_0x4cbd18,_0x82f0ee);};}exports['register']=function(_0x298a4c){for(var _0x1c89ca=0x0,_0x59866f=events['length'];_0x1c89ca<_0x59866f;_0x1c89ca++){var _0x4f37f7=events[_0x1c89ca];var _0x58417b=createListener(_0x5993('0x5')+_0x4f37f7,_0x298a4c);FaxQueueEvents['on'](_0x4f37f7,_0x58417b);}}; \ No newline at end of file +var _0xa915=['length','faxQueue:','save','remove','update','emit','register'];(function(_0x3a6ac0,_0x1858bd){var _0x1e3adb=function(_0x95f1e8){while(--_0x95f1e8){_0x3a6ac0['push'](_0x3a6ac0['shift']());}};_0x1e3adb(++_0x1858bd);}(_0xa915,0x1d7));var _0x5a91=function(_0xd0dce5,_0x32178e){_0xd0dce5=_0xd0dce5-0x0;var _0x59d673=_0xa915[_0xd0dce5];return _0x59d673;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x5a91('0x0'),_0x5a91('0x1'),_0x5a91('0x2')];function createListener(_0x57e822,_0x5153ad){return function(_0x1adb8d){_0x5153ad[_0x5a91('0x3')](_0x57e822,_0x1adb8d);};}function removeListener(_0x50caed,_0x401165){return function(){FaxQueueEvents['removeListener'](_0x50caed,_0x401165);};}exports[_0x5a91('0x4')]=function(_0x1db91b){for(var _0x3f1e25=0x0,_0x1bd28c=events[_0x5a91('0x5')];_0x3f1e25<_0x1bd28c;_0x3f1e25++){var _0x1da3cb=events[_0x3f1e25];var _0xedcee7=createListener(_0x5a91('0x6')+_0x1da3cb,_0x1db91b);FaxQueueEvents['on'](_0x1da3cb,_0xedcee7);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 9e9c646..450258a 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 _0x5fdc=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express'];(function(_0x16816a,_0x4ef7c7){var _0x25780f=function(_0x4cc9ee){while(--_0x4cc9ee){_0x16816a['push'](_0x16816a['shift']());}};_0x25780f(++_0x4ef7c7);}(_0x5fdc,0x127));var _0xc5fd=function(_0x22ce9b,_0x34f409){_0x22ce9b=_0x22ce9b-0x0;var _0x4038eb=_0x5fdc[_0x22ce9b];return _0x4038eb;};'use strict';var multer=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var path=require(_0xc5fd('0x2'));var timeout=require(_0xc5fd('0x3'));var express=require(_0xc5fd('0x4'));var router=express[_0xc5fd('0x5')]();var fs_extra=require(_0xc5fd('0x6'));var auth=require(_0xc5fd('0x7'));var interaction=require(_0xc5fd('0x8'));var config=require(_0xc5fd('0x9'));var controller=require(_0xc5fd('0xa'));router[_0xc5fd('0xb')]('/',auth[_0xc5fd('0xc')](),controller[_0xc5fd('0xd')]);router[_0xc5fd('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xc5fd('0xb')](_0xc5fd('0xe'),auth[_0xc5fd('0xc')](),controller[_0xc5fd('0xf')]);router['get']('/:id/members',auth[_0xc5fd('0xc')](),controller[_0xc5fd('0x10')]);router[_0xc5fd('0xb')](_0xc5fd('0x11'),auth[_0xc5fd('0xc')](),controller[_0xc5fd('0x12')]);router['get'](_0xc5fd('0x13'),auth['isAuthenticated'](),controller['getAgents']);router[_0xc5fd('0x14')]('/',auth[_0xc5fd('0xc')](),controller[_0xc5fd('0x15')]);router[_0xc5fd('0x14')](_0xc5fd('0x11'),auth[_0xc5fd('0xc')](),controller[_0xc5fd('0x16')]);router[_0xc5fd('0x14')]('/:id/users',auth[_0xc5fd('0xc')](),controller[_0xc5fd('0x17')]);router[_0xc5fd('0x18')](_0xc5fd('0xe'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc5fd('0x19')]);router[_0xc5fd('0x1a')](_0xc5fd('0x11'),auth[_0xc5fd('0xc')](),controller[_0xc5fd('0x1b')]);router[_0xc5fd('0x1a')](_0xc5fd('0x13'),auth['isAuthenticated'](),controller[_0xc5fd('0x1c')]);module[_0xc5fd('0x1d')]=router; \ No newline at end of file +var _0xa498=['getTeams','/:id/users','post','create','addTeams','addAgents','put','delete','destroy','removeTeams','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','getMembers','/:id/teams'];(function(_0xf4e617,_0x22e5d0){var _0x9a19d0=function(_0x4934fa){while(--_0x4934fa){_0xf4e617['push'](_0xf4e617['shift']());}};_0x9a19d0(++_0x22e5d0);}(_0xa498,0x1d6));var _0x8a49=function(_0x134448,_0x591d7b){_0x134448=_0x134448-0x0;var _0x2d52a1=_0xa498[_0x134448];return _0x2d52a1;};'use strict';var multer=require('multer');var util=require(_0x8a49('0x0'));var path=require(_0x8a49('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8a49('0x2')]();var fs_extra=require(_0x8a49('0x3'));var auth=require(_0x8a49('0x4'));var interaction=require(_0x8a49('0x5'));var config=require(_0x8a49('0x6'));var controller=require('./faxQueue.controller');router[_0x8a49('0x7')]('/',auth['isAuthenticated'](),controller[_0x8a49('0x8')]);router[_0x8a49('0x7')](_0x8a49('0x9'),auth['isAuthenticated'](),controller[_0x8a49('0xa')]);router[_0x8a49('0x7')](_0x8a49('0xb'),auth[_0x8a49('0xc')](),controller[_0x8a49('0xd')]);router[_0x8a49('0x7')]('/:id/members',auth[_0x8a49('0xc')](),controller[_0x8a49('0xe')]);router[_0x8a49('0x7')](_0x8a49('0xf'),auth[_0x8a49('0xc')](),controller[_0x8a49('0x10')]);router[_0x8a49('0x7')](_0x8a49('0x11'),auth[_0x8a49('0xc')](),controller['getAgents']);router[_0x8a49('0x12')]('/',auth[_0x8a49('0xc')](),controller[_0x8a49('0x13')]);router['post'](_0x8a49('0xf'),auth['isAuthenticated'](),controller[_0x8a49('0x14')]);router[_0x8a49('0x12')]('/:id/users',auth[_0x8a49('0xc')](),controller[_0x8a49('0x15')]);router[_0x8a49('0x16')](_0x8a49('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8a49('0x17')](_0x8a49('0xb'),auth[_0x8a49('0xc')](),controller[_0x8a49('0x18')]);router['delete'](_0x8a49('0xf'),auth[_0x8a49('0xc')](),controller[_0x8a49('0x19')]);router[_0x8a49('0x17')](_0x8a49('0x11'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x8a49('0x1a')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index dbf2a5e..f8d15aa 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 _0xac5c=['STRING','DATE','moment','exports'];(function(_0x41dec1,_0x58e7f7){var _0x6e28a4=function(_0x40a092){while(--_0x40a092){_0x41dec1['push'](_0x41dec1['shift']());}};_0x6e28a4(++_0x58e7f7);}(_0xac5c,0xce));var _0xcac5=function(_0x965eee,_0x3b5b6b){_0x965eee=_0x965eee-0x0;var _0x585fe4=_0xac5c[_0x965eee];return _0x585fe4;};'use strict';var moment=require(_0xcac5('0x0'));var Sequelize=require('sequelize');module[_0xcac5('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xcac5('0x2')]},'joinAt':{'type':Sequelize[_0xcac5('0x3')]},'leaveAt':{'type':Sequelize[_0xcac5('0x3')]},'acceptAt':{'type':Sequelize[_0xcac5('0x3')]},'exitAt':{'type':Sequelize[_0xcac5('0x3')]},'reason':{'type':Sequelize[_0xcac5('0x2')]}}; \ No newline at end of file +var _0xd25b=['DATE','moment','exports','STRING'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd25b,0x7d));var _0xbd25=function(_0x4af2a4,_0x24c7af){_0x4af2a4=_0x4af2a4-0x0;var _0x16f2b8=_0xd25b[_0x4af2a4];return _0x16f2b8;};'use strict';var moment=require(_0xbd25('0x0'));var Sequelize=require('sequelize');module[_0xbd25('0x1')]={'uniqueid':{'type':Sequelize[_0xbd25('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xbd25('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xbd25('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 5834ef2..f8a0639 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 _0x80df=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','FaxQueueReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x2abf25,_0xc97226){var _0x3a24c6=function(_0x4cde3b){while(--_0x4cde3b){_0x2abf25['push'](_0x2abf25['shift']());}};_0x3a24c6(++_0xc97226);}(_0x80df,0x17e));var _0xf80d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x80df[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xf80d('0x0'));var rimraf=require(_0xf80d('0x1'));var zipdir=require(_0xf80d('0x2'));var jsonpatch=require(_0xf80d('0x3'));var rp=require('request-promise');var moment=require(_0xf80d('0x4'));var BPromise=require(_0xf80d('0x5'));var Mustache=require(_0xf80d('0x6'));var util=require(_0xf80d('0x7'));var path=require(_0xf80d('0x8'));var sox=require(_0xf80d('0x9'));var csv=require(_0xf80d('0xa'));var ejs=require(_0xf80d('0xb'));var fs=require('fs');var fs_extra=require(_0xf80d('0xc'));var _=require(_0xf80d('0xd'));var squel=require('squel');var crypto=require(_0xf80d('0xe'));var jsforce=require(_0xf80d('0xf'));var deskjs=require(_0xf80d('0x10'));var toCsv=require(_0xf80d('0xa'));var querystring=require(_0xf80d('0x11'));var Papa=require(_0xf80d('0x12'));var Redis=require(_0xf80d('0x13'));var authService=require(_0xf80d('0x14'));var qs=require(_0xf80d('0x15'));var as=require(_0xf80d('0x16'));var hardwareService=require(_0xf80d('0x17'));var logger=require(_0xf80d('0x18'))(_0xf80d('0x19'));var utils=require(_0xf80d('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf80d('0x1b'))['db'];function respondWithStatusCode(_0x74ce36,_0x489bdf){_0x489bdf=_0x489bdf||0xcc;return function(_0x34e130){if(_0x34e130){return _0x74ce36['sendStatus'](_0x489bdf);}return _0x74ce36[_0xf80d('0x1c')](_0x489bdf)['end']();};}function respondWithResult(_0x4285de,_0x50c968){_0x50c968=_0x50c968||0xc8;return function(_0x3be9a9){if(_0x3be9a9){return _0x4285de[_0xf80d('0x1c')](_0x50c968)[_0xf80d('0x1d')](_0x3be9a9);}};}function respondWithFilteredResult(_0x1e1b08,_0x2098d6){return function(_0x45751c){if(_0x45751c){var _0x482043=typeof _0x2098d6[_0xf80d('0x1e')]===_0xf80d('0x1f')&&typeof _0x2098d6[_0xf80d('0x20')]===_0xf80d('0x1f');var _0x27b2ea=_0x45751c[_0xf80d('0x21')];var _0x1d104a=_0x482043?0x0:_0x2098d6[_0xf80d('0x1e')];var _0x2ea2c1=_0x482043?_0x45751c[_0xf80d('0x21')]:_0x2098d6[_0xf80d('0x1e')]+_0x2098d6[_0xf80d('0x20')];var _0x5392c5;if(_0x2ea2c1>=_0x27b2ea){_0x2ea2c1=_0x27b2ea;_0x5392c5=0xc8;}else{_0x5392c5=0xce;}_0x1e1b08[_0xf80d('0x1c')](_0x5392c5);return _0x1e1b08[_0xf80d('0x22')]('Content-Range',_0x1d104a+'-'+_0x2ea2c1+'/'+_0x27b2ea)[_0xf80d('0x1d')](_0x45751c);}return null;};}function patchUpdates(_0x539c80){return function(_0x3f3a2a){try{jsonpatch[_0xf80d('0x23')](_0x3f3a2a,_0x539c80,!![]);}catch(_0x2d5e46){return BPromise[_0xf80d('0x24')](_0x2d5e46);}return _0x3f3a2a[_0xf80d('0x25')]();};}function saveUpdates(_0x25d031,_0x446153){return function(_0x269859){if(_0x269859){return _0x269859[_0xf80d('0x26')](_0x25d031)[_0xf80d('0x27')](function(_0x33d58c){return _0x33d58c;});}return null;};}function removeEntity(_0x739968,_0x570c99){return function(_0x32ad42){if(_0x32ad42){return _0x32ad42[_0xf80d('0x28')]()['then'](function(){_0x739968[_0xf80d('0x1c')](0xcc)[_0xf80d('0x29')]();});}};}function handleEntityNotFound(_0x323540,_0x947bb){return function(_0x4986ad){if(!_0x4986ad){_0x323540[_0xf80d('0x2a')](0x194);}return _0x4986ad;};}function handleError(_0x14399e,_0xf4c3af){_0xf4c3af=_0xf4c3af||0x1f4;return function(_0x2a4597){logger[_0xf80d('0x2b')](_0x2a4597[_0xf80d('0x2c')]);if(_0x2a4597[_0xf80d('0x2d')]){delete _0x2a4597[_0xf80d('0x2d')];}_0x14399e[_0xf80d('0x1c')](_0xf4c3af)['send'](_0x2a4597);};}exports[_0xf80d('0x2e')]=function(_0x1603a4,_0x3e2c8c){var _0x368865={},_0x3ce924={},_0x5eab42={'count':0x0,'rows':[]};var _0x401cfb=_['map'](db[_0xf80d('0x2f')][_0xf80d('0x30')],function(_0x214bff){return{'name':_0x214bff[_0xf80d('0x31')],'type':_0x214bff['type']['key']};});_0x3ce924[_0xf80d('0x32')]=_['map'](_0x401cfb,_0xf80d('0x2d'));_0x3ce924[_0xf80d('0x33')]=_[_0xf80d('0x34')](_0x1603a4['query']);_0x3ce924[_0xf80d('0x35')]=_[_0xf80d('0x36')](_0x3ce924['model'],_0x3ce924[_0xf80d('0x33')]);_0x368865[_0xf80d('0x37')]=_[_0xf80d('0x36')](_0x3ce924['model'],qs[_0xf80d('0x38')](_0x1603a4[_0xf80d('0x33')][_0xf80d('0x38')]));_0x368865[_0xf80d('0x37')]=_0x368865[_0xf80d('0x37')]['length']?_0x368865[_0xf80d('0x37')]:_0x3ce924['model'];if(!_0x1603a4[_0xf80d('0x33')][_0xf80d('0x39')](_0xf80d('0x3a'))){_0x368865[_0xf80d('0x20')]=qs['limit'](_0x1603a4[_0xf80d('0x33')][_0xf80d('0x20')]);_0x368865[_0xf80d('0x1e')]=qs[_0xf80d('0x1e')](_0x1603a4['query'][_0xf80d('0x1e')]);}_0x368865[_0xf80d('0x3b')]=qs[_0xf80d('0x3c')](_0x1603a4[_0xf80d('0x33')][_0xf80d('0x3c')]);_0x368865[_0xf80d('0x3d')]=qs[_0xf80d('0x35')](_[_0xf80d('0x3e')](_0x1603a4['query'],_0x3ce924[_0xf80d('0x35')]),_0x401cfb);if(_0x1603a4[_0xf80d('0x33')][_0xf80d('0x3f')]){_0x368865['where']=_[_0xf80d('0x40')](_0x368865['where'],{'$or':_[_0xf80d('0x41')](_0x401cfb,function(_0x1a4ab7){if(_0x1a4ab7[_0xf80d('0x42')]!==_0xf80d('0x43')){var _0x4a3c5e={};_0x4a3c5e[_0x1a4ab7['name']]={'$like':'%'+_0x1603a4['query'][_0xf80d('0x3f')]+'%'};return _0x4a3c5e;}})});}_0x368865=_[_0xf80d('0x40')]({},_0x368865,_0x1603a4[_0xf80d('0x44')]);var _0x4b9f1d={'where':_0x368865[_0xf80d('0x3d')]};return db[_0xf80d('0x2f')]['count'](_0x4b9f1d)[_0xf80d('0x27')](function(_0x511310){_0x5eab42[_0xf80d('0x21')]=_0x511310;if(_0x1603a4['query'][_0xf80d('0x45')]){_0x368865['include']=[{'all':!![]}];}return db[_0xf80d('0x2f')][_0xf80d('0x46')](_0x368865);})[_0xf80d('0x27')](function(_0x2cd371){_0x5eab42[_0xf80d('0x47')]=_0x2cd371;return _0x5eab42;})[_0xf80d('0x27')](respondWithFilteredResult(_0x3e2c8c,_0x368865))[_0xf80d('0x48')](handleError(_0x3e2c8c,null));};exports[_0xf80d('0x49')]=function(_0x99e531,_0x80f24a){var _0x1fcbad={'raw':!![],'where':{'id':_0x99e531[_0xf80d('0x4a')]['id']}},_0x437e44={};_0x437e44[_0xf80d('0x32')]=_[_0xf80d('0x34')](db[_0xf80d('0x2f')][_0xf80d('0x30')]);_0x437e44[_0xf80d('0x33')]=_[_0xf80d('0x34')](_0x99e531[_0xf80d('0x33')]);_0x437e44[_0xf80d('0x35')]=_[_0xf80d('0x36')](_0x437e44[_0xf80d('0x32')],_0x437e44[_0xf80d('0x33')]);_0x1fcbad[_0xf80d('0x37')]=_['intersection'](_0x437e44[_0xf80d('0x32')],qs[_0xf80d('0x38')](_0x99e531[_0xf80d('0x33')][_0xf80d('0x38')]));_0x1fcbad[_0xf80d('0x37')]=_0x1fcbad['attributes'][_0xf80d('0x4b')]?_0x1fcbad[_0xf80d('0x37')]:_0x437e44[_0xf80d('0x32')];if(_0x99e531[_0xf80d('0x33')][_0xf80d('0x45')]){_0x1fcbad[_0xf80d('0x4c')]=[{'all':!![]}];}_0x1fcbad=_[_0xf80d('0x40')]({},_0x1fcbad,_0x99e531[_0xf80d('0x44')]);return db[_0xf80d('0x2f')][_0xf80d('0x4d')](_0x1fcbad)[_0xf80d('0x27')](handleEntityNotFound(_0x80f24a,null))[_0xf80d('0x27')](respondWithResult(_0x80f24a,null))[_0xf80d('0x48')](handleError(_0x80f24a,null));};exports[_0xf80d('0x4e')]=function(_0x3a420d,_0x10d5b5){return db[_0xf80d('0x2f')]['create'](_0x3a420d[_0xf80d('0x4f')],{})[_0xf80d('0x27')](respondWithResult(_0x10d5b5,0xc9))[_0xf80d('0x48')](handleError(_0x10d5b5,null));};exports['update']=function(_0x3e5cf6,_0x1088ca){if(_0x3e5cf6['body']['id']){delete _0x3e5cf6['body']['id'];}return db[_0xf80d('0x2f')]['find']({'where':{'id':_0x3e5cf6[_0xf80d('0x4a')]['id']}})[_0xf80d('0x27')](handleEntityNotFound(_0x1088ca,null))[_0xf80d('0x27')](saveUpdates(_0x3e5cf6[_0xf80d('0x4f')],null))[_0xf80d('0x27')](respondWithResult(_0x1088ca,null))[_0xf80d('0x48')](handleError(_0x1088ca,null));};exports[_0xf80d('0x28')]=function(_0x114132,_0x115d1f){return db[_0xf80d('0x2f')][_0xf80d('0x4d')]({'where':{'id':_0x114132[_0xf80d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x115d1f,null))[_0xf80d('0x27')](removeEntity(_0x115d1f,null))[_0xf80d('0x48')](handleError(_0x115d1f,null));};exports[_0xf80d('0x50')]=function(_0x5c3c41,_0x34305b){return db[_0xf80d('0x2f')]['describe']()[_0xf80d('0x27')](respondWithResult(_0x34305b,null))[_0xf80d('0x48')](handleError(_0x34305b,null));}; \ No newline at end of file +var _0xd624=['ejs','squel','crypto','jsforce','desk.js','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','count','limit','set','Content-Range','reject','save','update','destroy','then','end','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','FaxQueueReport','findAll','rows','catch','show','params','fields','length','include','options','create','body','find','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv'];(function(_0x537003,_0x5b1bcc){var _0x2c039d=function(_0x2eaac1){while(--_0x2eaac1){_0x537003['push'](_0x537003['shift']());}};_0x2c039d(++_0x5b1bcc);}(_0xd624,0x124));var _0x4d62=function(_0x1d52c1,_0x12f988){_0x1d52c1=_0x1d52c1-0x0;var _0x475ad6=_0xd624[_0x1d52c1];return _0x475ad6;};'use strict';var emlformat=require(_0x4d62('0x0'));var rimraf=require(_0x4d62('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d62('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4d62('0x3'));var util=require(_0x4d62('0x4'));var path=require(_0x4d62('0x5'));var sox=require(_0x4d62('0x6'));var csv=require(_0x4d62('0x7'));var ejs=require(_0x4d62('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4d62('0x9'));var crypto=require(_0x4d62('0xa'));var jsforce=require(_0x4d62('0xb'));var deskjs=require(_0x4d62('0xc'));var toCsv=require(_0x4d62('0x7'));var querystring=require('querystring');var Papa=require(_0x4d62('0xd'));var Redis=require(_0x4d62('0xe'));var authService=require(_0x4d62('0xf'));var qs=require(_0x4d62('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4d62('0x11'));var logger=require(_0x4d62('0x12'))(_0x4d62('0x13'));var utils=require(_0x4d62('0x14'));var config=require(_0x4d62('0x15'));var licenseUtil=require(_0x4d62('0x16'));var db=require(_0x4d62('0x17'))['db'];function respondWithStatusCode(_0xc94193,_0x3d30a7){_0x3d30a7=_0x3d30a7||0xcc;return function(_0x282d79){if(_0x282d79){return _0xc94193[_0x4d62('0x18')](_0x3d30a7);}return _0xc94193[_0x4d62('0x19')](_0x3d30a7)['end']();};}function respondWithResult(_0x117c68,_0x409910){_0x409910=_0x409910||0xc8;return function(_0x1c6768){if(_0x1c6768){return _0x117c68['status'](_0x409910)[_0x4d62('0x1a')](_0x1c6768);}};}function respondWithFilteredResult(_0x1f3b54,_0x142396){return function(_0x5e2cee){if(_0x5e2cee){var _0x4974f4=typeof _0x142396[_0x4d62('0x1b')]===_0x4d62('0x1c')&&typeof _0x142396['limit']==='undefined';var _0x2e8602=_0x5e2cee[_0x4d62('0x1d')];var _0x54920b=_0x4974f4?0x0:_0x142396[_0x4d62('0x1b')];var _0x27ca77=_0x4974f4?_0x5e2cee[_0x4d62('0x1d')]:_0x142396[_0x4d62('0x1b')]+_0x142396[_0x4d62('0x1e')];var _0x45f78f;if(_0x27ca77>=_0x2e8602){_0x27ca77=_0x2e8602;_0x45f78f=0xc8;}else{_0x45f78f=0xce;}_0x1f3b54[_0x4d62('0x19')](_0x45f78f);return _0x1f3b54[_0x4d62('0x1f')](_0x4d62('0x20'),_0x54920b+'-'+_0x27ca77+'/'+_0x2e8602)[_0x4d62('0x1a')](_0x5e2cee);}return null;};}function patchUpdates(_0x494a8f){return function(_0x5d9e64){try{jsonpatch['apply'](_0x5d9e64,_0x494a8f,!![]);}catch(_0x435035){return BPromise[_0x4d62('0x21')](_0x435035);}return _0x5d9e64[_0x4d62('0x22')]();};}function saveUpdates(_0x5a0796,_0x3a5e4f){return function(_0x16fa3a){if(_0x16fa3a){return _0x16fa3a[_0x4d62('0x23')](_0x5a0796)['then'](function(_0x26c5e3){return _0x26c5e3;});}return null;};}function removeEntity(_0x30c443,_0x1a7ee9){return function(_0x57987b){if(_0x57987b){return _0x57987b[_0x4d62('0x24')]()[_0x4d62('0x25')](function(){_0x30c443['status'](0xcc)[_0x4d62('0x26')]();});}};}function handleEntityNotFound(_0x3b4eee,_0x2a09f9){return function(_0x414a9e){if(!_0x414a9e){_0x3b4eee[_0x4d62('0x18')](0x194);}return _0x414a9e;};}function handleError(_0x4e88cc,_0x5635a9){_0x5635a9=_0x5635a9||0x1f4;return function(_0x40c9c8){logger[_0x4d62('0x27')](_0x40c9c8[_0x4d62('0x28')]);if(_0x40c9c8[_0x4d62('0x29')]){delete _0x40c9c8['name'];}_0x4e88cc['status'](_0x5635a9)['send'](_0x40c9c8);};}exports[_0x4d62('0x2a')]=function(_0x566cce,_0x1b1f0c){var _0x2b76af={},_0x132181={},_0x50e6f0={'count':0x0,'rows':[]};var _0x2c450e=_['map'](db['FaxQueueReport'][_0x4d62('0x2b')],function(_0x5776d6){return{'name':_0x5776d6[_0x4d62('0x2c')],'type':_0x5776d6[_0x4d62('0x2d')][_0x4d62('0x2e')]};});_0x132181[_0x4d62('0x2f')]=_[_0x4d62('0x30')](_0x2c450e,_0x4d62('0x29'));_0x132181[_0x4d62('0x31')]=_[_0x4d62('0x32')](_0x566cce['query']);_0x132181[_0x4d62('0x33')]=_[_0x4d62('0x34')](_0x132181[_0x4d62('0x2f')],_0x132181['query']);_0x2b76af[_0x4d62('0x35')]=_['intersection'](_0x132181['model'],qs['fields'](_0x566cce[_0x4d62('0x31')]['fields']));_0x2b76af['attributes']=_0x2b76af['attributes']['length']?_0x2b76af[_0x4d62('0x35')]:_0x132181[_0x4d62('0x2f')];if(!_0x566cce[_0x4d62('0x31')][_0x4d62('0x36')](_0x4d62('0x37'))){_0x2b76af[_0x4d62('0x1e')]=qs[_0x4d62('0x1e')](_0x566cce[_0x4d62('0x31')][_0x4d62('0x1e')]);_0x2b76af['offset']=qs[_0x4d62('0x1b')](_0x566cce['query']['offset']);}_0x2b76af['order']=qs[_0x4d62('0x38')](_0x566cce[_0x4d62('0x31')][_0x4d62('0x38')]);_0x2b76af[_0x4d62('0x39')]=qs[_0x4d62('0x33')](_[_0x4d62('0x3a')](_0x566cce['query'],_0x132181[_0x4d62('0x33')]),_0x2c450e);if(_0x566cce['query'][_0x4d62('0x3b')]){_0x2b76af[_0x4d62('0x39')]=_[_0x4d62('0x3c')](_0x2b76af[_0x4d62('0x39')],{'$or':_['map'](_0x2c450e,function(_0x31f261){if(_0x31f261[_0x4d62('0x2d')]!=='VIRTUAL'){var _0x4fea95={};_0x4fea95[_0x31f261[_0x4d62('0x29')]]={'$like':'%'+_0x566cce[_0x4d62('0x31')][_0x4d62('0x3b')]+'%'};return _0x4fea95;}})});}_0x2b76af=_['merge']({},_0x2b76af,_0x566cce['options']);var _0x577b45={'where':_0x2b76af['where']};return db['FaxQueueReport']['count'](_0x577b45)[_0x4d62('0x25')](function(_0x3cfd3e){_0x50e6f0[_0x4d62('0x1d')]=_0x3cfd3e;if(_0x566cce[_0x4d62('0x31')][_0x4d62('0x3d')]){_0x2b76af['include']=[{'all':!![]}];}return db[_0x4d62('0x3e')][_0x4d62('0x3f')](_0x2b76af);})['then'](function(_0x178d83){_0x50e6f0[_0x4d62('0x40')]=_0x178d83;return _0x50e6f0;})[_0x4d62('0x25')](respondWithFilteredResult(_0x1b1f0c,_0x2b76af))[_0x4d62('0x41')](handleError(_0x1b1f0c,null));};exports[_0x4d62('0x42')]=function(_0x218017,_0x560d83){var _0x1873a2={'raw':!![],'where':{'id':_0x218017[_0x4d62('0x43')]['id']}},_0x570d11={};_0x570d11[_0x4d62('0x2f')]=_['keys'](db[_0x4d62('0x3e')]['rawAttributes']);_0x570d11[_0x4d62('0x31')]=_[_0x4d62('0x32')](_0x218017[_0x4d62('0x31')]);_0x570d11[_0x4d62('0x33')]=_[_0x4d62('0x34')](_0x570d11['model'],_0x570d11[_0x4d62('0x31')]);_0x1873a2[_0x4d62('0x35')]=_[_0x4d62('0x34')](_0x570d11[_0x4d62('0x2f')],qs[_0x4d62('0x44')](_0x218017[_0x4d62('0x31')][_0x4d62('0x44')]));_0x1873a2[_0x4d62('0x35')]=_0x1873a2[_0x4d62('0x35')][_0x4d62('0x45')]?_0x1873a2[_0x4d62('0x35')]:_0x570d11['model'];if(_0x218017['query'][_0x4d62('0x3d')]){_0x1873a2[_0x4d62('0x46')]=[{'all':!![]}];}_0x1873a2=_[_0x4d62('0x3c')]({},_0x1873a2,_0x218017[_0x4d62('0x47')]);return db[_0x4d62('0x3e')]['find'](_0x1873a2)['then'](handleEntityNotFound(_0x560d83,null))[_0x4d62('0x25')](respondWithResult(_0x560d83,null))[_0x4d62('0x41')](handleError(_0x560d83,null));};exports[_0x4d62('0x48')]=function(_0x388a02,_0x3a8c7e){return db['FaxQueueReport']['create'](_0x388a02[_0x4d62('0x49')],{})['then'](respondWithResult(_0x3a8c7e,0xc9))[_0x4d62('0x41')](handleError(_0x3a8c7e,null));};exports[_0x4d62('0x23')]=function(_0x230798,_0x485fe2){if(_0x230798[_0x4d62('0x49')]['id']){delete _0x230798[_0x4d62('0x49')]['id'];}return db[_0x4d62('0x3e')][_0x4d62('0x4a')]({'where':{'id':_0x230798[_0x4d62('0x43')]['id']}})[_0x4d62('0x25')](handleEntityNotFound(_0x485fe2,null))[_0x4d62('0x25')](saveUpdates(_0x230798[_0x4d62('0x49')],null))[_0x4d62('0x25')](respondWithResult(_0x485fe2,null))[_0x4d62('0x41')](handleError(_0x485fe2,null));};exports[_0x4d62('0x24')]=function(_0x51adc7,_0x1df6a5){return db[_0x4d62('0x3e')][_0x4d62('0x4a')]({'where':{'id':_0x51adc7['params']['id']}})[_0x4d62('0x25')](handleEntityNotFound(_0x1df6a5,null))[_0x4d62('0x25')](removeEntity(_0x1df6a5,null))[_0x4d62('0x41')](handleError(_0x1df6a5,null));};exports['describe']=function(_0x4fa78d,_0x412388){return db[_0x4d62('0x3e')]['describe']()['then'](respondWithResult(_0x412388,null))[_0x4d62('0x41')](handleError(_0x412388,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 61944a7..a2b6d73 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 _0x53ec=['path','../../config/environment','./faxQueueReport.attributes','define','FaxQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x589947,_0x3dce92){var _0x375480=function(_0x5ac3d9){while(--_0x5ac3d9){_0x589947['push'](_0x589947['shift']());}};_0x375480(++_0x3dce92);}(_0x53ec,0x192));var _0xc53e=function(_0x544baa,_0x1b17fe){_0x544baa=_0x544baa-0x0;var _0x5e8cc1=_0x53ec[_0x544baa];return _0x5e8cc1;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4975=['path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x36c7d0,_0x10a7e7){var _0x24c064=function(_0x5632b2){while(--_0x5632b2){_0x36c7d0['push'](_0x36c7d0['shift']());}};_0x24c064(++_0x10a7e7);}(_0x4975,0x86));var _0x5497=function(_0x1faabc,_0x11e15c){_0x1faabc=_0x1faabc-0x0;var _0x5e40c4=_0x4975[_0x1faabc];return _0x5e40c4;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[{'name':_0x5497('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 a40edb6..592ddc7 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 _0x954e=['error','message','info','catch','CreateFaxQueueReport','FaxQueueReport','body','options','stringify','update','raw','where','attributes','limit','UpdateFaxQueueReport','moment','ioredis','rpc','../../config/environment','http','request','then','FaxQueueReport,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x44c1cb,_0x357a68){var _0x4786c5=function(_0x5eebc4){while(--_0x5eebc4){_0x44c1cb['push'](_0x44c1cb['shift']());}};_0x4786c5(++_0x357a68);}(_0x954e,0x186));var _0xe954=function(_0x3712e2,_0x32d752){_0x3712e2=_0x3712e2-0x0;var _0x1faff4=_0x954e[_0x3712e2];return _0x1faff4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe954('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe954('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe954('0x2'));var config=require(_0xe954('0x3'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe954('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x566f1c,_0x16e12a,_0x222f25){return new BPromise(function(_0x46e5f7,_0x2949c1){return client[_0xe954('0x5')](_0x566f1c,_0x222f25)[_0xe954('0x6')](function(_0x62a73){logger['info'](_0xe954('0x7'),_0x16e12a,'request\x20sent');logger[_0xe954('0x8')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x16e12a,_0xe954('0x9'),JSON['stringify'](_0x62a73));if(_0x62a73['error']){if(_0x62a73['error']['code']===0x1f4){logger[_0xe954('0xa')]('FaxQueueReport,\x20%s,\x20%s',_0x16e12a,_0x62a73['error'][_0xe954('0xb')]);return _0x2949c1(_0x62a73['error'][_0xe954('0xb')]);}logger[_0xe954('0xa')]('FaxQueueReport,\x20%s,\x20%s',_0x16e12a,_0x62a73[_0xe954('0xa')]['message']);return _0x46e5f7(_0x62a73[_0xe954('0xa')][_0xe954('0xb')]);}else{logger[_0xe954('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x16e12a,_0xe954('0x9'));_0x46e5f7(_0x62a73['result'][_0xe954('0xb')]);}})[_0xe954('0xd')](function(_0x2d9e3e){logger[_0xe954('0xa')]('FaxQueueReport,\x20%s,\x20%s',_0x16e12a,_0x2d9e3e);_0x2949c1(_0x2d9e3e);});});}exports[_0xe954('0xe')]=function(_0x1b7612){var _0x429e38=this;return new Promise(function(_0x33a80b,_0x332d2c){return db[_0xe954('0xf')]['create'](_0x1b7612[_0xe954('0x10')],{'raw':_0x1b7612[_0xe954('0x11')]?_0x1b7612['options']['raw']===undefined?!![]:![]:!![]})[_0xe954('0x6')](function(_0x47b55f){logger[_0xe954('0xc')](_0xe954('0xe'),_0x1b7612);logger['debug']('CreateFaxQueueReport',_0x1b7612,JSON[_0xe954('0x12')](_0x47b55f));_0x33a80b(_0x47b55f);})[_0xe954('0xd')](function(_0x33ff00){logger[_0xe954('0xa')](_0xe954('0xe'),_0x33ff00[_0xe954('0xb')],_0x1b7612);_0x332d2c(_0x429e38[_0xe954('0xa')](0x1f4,_0x33ff00['message']));});});};exports['UpdateFaxQueueReport']=function(_0x518a92){var _0x324493=this;return new Promise(function(_0xf79fa3,_0xcb936d){return db[_0xe954('0xf')][_0xe954('0x13')](_0x518a92['body'],{'raw':_0x518a92[_0xe954('0x11')]?_0x518a92[_0xe954('0x11')][_0xe954('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x518a92[_0xe954('0x11')]?_0x518a92[_0xe954('0x11')][_0xe954('0x15')]||null:null,'attributes':_0x518a92[_0xe954('0x11')]?_0x518a92[_0xe954('0x11')][_0xe954('0x16')]||null:null,'limit':_0x518a92[_0xe954('0x11')]?_0x518a92[_0xe954('0x11')][_0xe954('0x17')]||null:null})[_0xe954('0x6')](function(_0x1ff06b){logger[_0xe954('0xc')](_0xe954('0x18'),_0x518a92);logger['debug']('UpdateFaxQueueReport',_0x518a92,JSON[_0xe954('0x12')](_0x1ff06b));_0xf79fa3(_0x1ff06b);})['catch'](function(_0x2b1dcf){logger[_0xe954('0xa')](_0xe954('0x18'),_0x2b1dcf[_0xe954('0xb')],_0x518a92);_0xcb936d(_0x324493[_0xe954('0xa')](0x1f4,_0x2b1dcf[_0xe954('0xb')]));});});}; \ No newline at end of file +var _0x976a=['result','FaxQueueReport','options','raw','CreateFaxQueueReport','catch','UpdateFaxQueueReport','update','body','where','attributes','limit','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x1f8c46,_0xd59a73){var _0x2db71a=function(_0xa925bc){while(--_0xa925bc){_0x1f8c46['push'](_0x1f8c46['shift']());}};_0x2db71a(++_0xd59a73);}(_0x976a,0xcc));var _0xa976=function(_0x2cc569,_0x4e9568){_0x2cc569=_0x2cc569-0x0;var _0x1bfc2e=_0x976a[_0x2cc569];return _0x1bfc2e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa976('0x0'));var BPromise=require(_0xa976('0x1'));var rs=require(_0xa976('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa976('0x3'))['db'];var utils=require(_0xa976('0x4'));var logger=require(_0xa976('0x5'))('rpc');var config=require(_0xa976('0x6'));var jayson=require(_0xa976('0x7'));var client=jayson[_0xa976('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6f48cd,_0x2d3e65,_0x3f913a){return new BPromise(function(_0x1dcf84,_0xbadf79){return client[_0xa976('0x9')](_0x6f48cd,_0x3f913a)[_0xa976('0xa')](function(_0x4ff198){logger[_0xa976('0xb')](_0xa976('0xc'),_0x2d3e65,_0xa976('0xd'));logger[_0xa976('0xe')](_0xa976('0xf'),_0x2d3e65,'request\x20sent',JSON[_0xa976('0x10')](_0x4ff198));if(_0x4ff198['error']){if(_0x4ff198['error'][_0xa976('0x11')]===0x1f4){logger[_0xa976('0x12')](_0xa976('0xc'),_0x2d3e65,_0x4ff198[_0xa976('0x12')][_0xa976('0x13')]);return _0xbadf79(_0x4ff198[_0xa976('0x12')]['message']);}logger[_0xa976('0x12')](_0xa976('0xc'),_0x2d3e65,_0x4ff198['error'][_0xa976('0x13')]);return _0x1dcf84(_0x4ff198['error'][_0xa976('0x13')]);}else{logger['info'](_0xa976('0xc'),_0x2d3e65,_0xa976('0xd'));_0x1dcf84(_0x4ff198[_0xa976('0x14')][_0xa976('0x13')]);}})['catch'](function(_0x49895e){logger[_0xa976('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x2d3e65,_0x49895e);_0xbadf79(_0x49895e);});});}exports['CreateFaxQueueReport']=function(_0x1eb2a9){var _0x1d71b4=this;return new Promise(function(_0x5b3ef2,_0x2e01ed){return db[_0xa976('0x15')]['create'](_0x1eb2a9['body'],{'raw':_0x1eb2a9[_0xa976('0x16')]?_0x1eb2a9[_0xa976('0x16')][_0xa976('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x33a403){logger[_0xa976('0xb')](_0xa976('0x18'),_0x1eb2a9);logger[_0xa976('0xe')](_0xa976('0x18'),_0x1eb2a9,JSON[_0xa976('0x10')](_0x33a403));_0x5b3ef2(_0x33a403);})[_0xa976('0x19')](function(_0x57f73f){logger[_0xa976('0x12')](_0xa976('0x18'),_0x57f73f['message'],_0x1eb2a9);_0x2e01ed(_0x1d71b4[_0xa976('0x12')](0x1f4,_0x57f73f['message']));});});};exports[_0xa976('0x1a')]=function(_0x371a9f){var _0x4b62bb=this;return new Promise(function(_0x401afe,_0x2ccdbd){return db['FaxQueueReport'][_0xa976('0x1b')](_0x371a9f[_0xa976('0x1c')],{'raw':_0x371a9f[_0xa976('0x16')]?_0x371a9f[_0xa976('0x16')][_0xa976('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x371a9f[_0xa976('0x16')]?_0x371a9f['options'][_0xa976('0x1d')]||null:null,'attributes':_0x371a9f['options']?_0x371a9f['options'][_0xa976('0x1e')]||null:null,'limit':_0x371a9f[_0xa976('0x16')]?_0x371a9f[_0xa976('0x16')][_0xa976('0x1f')]||null:null})[_0xa976('0xa')](function(_0x341bc3){logger[_0xa976('0xb')](_0xa976('0x1a'),_0x371a9f);logger[_0xa976('0xe')](_0xa976('0x1a'),_0x371a9f,JSON[_0xa976('0x10')](_0x341bc3));_0x401afe(_0x341bc3);})['catch'](function(_0x3121e9){logger[_0xa976('0x12')]('UpdateFaxQueueReport',_0x3121e9[_0xa976('0x13')],_0x371a9f);_0x2ccdbd(_0x4b62bb['error'](0x1f4,_0x3121e9[_0xa976('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 1955b95..a90ab02 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 _0x602f=['show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x602f,0x11f));var _0xf602=function(_0x5a7677,_0x23630f){_0x5a7677=_0x5a7677-0x0;var _0x2da6ef=_0x602f[_0x5a7677];return _0x2da6ef;};'use strict';var multer=require('multer');var util=require(_0xf602('0x0'));var path=require(_0xf602('0x1'));var timeout=require(_0xf602('0x2'));var express=require(_0xf602('0x3'));var router=express['Router']();var fs_extra=require(_0xf602('0x4'));var auth=require(_0xf602('0x5'));var interaction=require(_0xf602('0x6'));var config=require('../../config/environment');var controller=require(_0xf602('0x7'));router[_0xf602('0x8')]('/',auth[_0xf602('0x9')](),controller[_0xf602('0xa')]);router[_0xf602('0x8')](_0xf602('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xf602('0x8')](_0xf602('0xc'),auth[_0xf602('0x9')](),controller[_0xf602('0xd')]);router[_0xf602('0xe')]('/',auth[_0xf602('0x9')](),controller[_0xf602('0xf')]);router[_0xf602('0x10')](_0xf602('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf602('0x11')]('/:id',auth[_0xf602('0x9')](),controller[_0xf602('0x12')]);module[_0xf602('0x13')]=router; \ No newline at end of file +var _0x55ec=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','show','create','destroy','exports','multer','util','path'];(function(_0x255383,_0x22ec13){var _0x36ef78=function(_0x53222c){while(--_0x53222c){_0x255383['push'](_0x255383['shift']());}};_0x36ef78(++_0x22ec13);}(_0x55ec,0x11a));var _0xc55e=function(_0x12bcf7,_0xc11103){_0x12bcf7=_0x12bcf7-0x0;var _0x2825a=_0x55ec[_0x12bcf7];return _0x2825a;};'use strict';var multer=require(_0xc55e('0x0'));var util=require(_0xc55e('0x1'));var path=require(_0xc55e('0x2'));var timeout=require(_0xc55e('0x3'));var express=require(_0xc55e('0x4'));var router=express[_0xc55e('0x5')]();var fs_extra=require(_0xc55e('0x6'));var auth=require(_0xc55e('0x7'));var interaction=require(_0xc55e('0x8'));var config=require('../../config/environment');var controller=require(_0xc55e('0x9'));router[_0xc55e('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc55e('0xa')](_0xc55e('0xb'),auth[_0xc55e('0xc')](),controller[_0xc55e('0xd')]);router[_0xc55e('0xa')](_0xc55e('0xe'),auth[_0xc55e('0xc')](),controller[_0xc55e('0xf')]);router['post']('/',auth[_0xc55e('0xc')](),controller[_0xc55e('0x10')]);router['put'](_0xc55e('0xe'),auth[_0xc55e('0xc')](),controller['update']);router['delete'](_0xc55e('0xe'),auth['isAuthenticated'](),controller[_0xc55e('0x11')]);module[_0xc55e('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index c273ccd..4268733 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x2a4692,_0x5db910){var _0x370e6b=function(_0x5b4e23){while(--_0x5b4e23){_0x2a4692['push'](_0x2a4692['shift']());}};_0x370e6b(++_0x5db910);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x4ed786,_0x74f270){var _0x2f0243=function(_0x5642f5){while(--_0x5642f5){_0x4ed786['push'](_0x4ed786['shift']());}};_0x2f0243(++_0x74f270);}(_0xaa88,0x137));var _0x8aa8=function(_0x1a1b6e,_0x3a07a9){_0x1a1b6e=_0x1a1b6e-0x0;var _0x571e2c=_0xaa88[_0x1a1b6e];return _0x571e2c;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index eb46eb4..e848b2a 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 _0xc3fe=['crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','error','stack','name','send','index','map','FaxTransferReport','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','find','create','body','destroy','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','fs-extra'];(function(_0x171df6,_0x3ab58a){var _0x13db45=function(_0x5baf4d){while(--_0x5baf4d){_0x171df6['push'](_0x171df6['shift']());}};_0x13db45(++_0x3ab58a);}(_0xc3fe,0x19c));var _0xec3f=function(_0x25e780,_0x12522e){_0x25e780=_0x25e780-0x0;var _0xe85492=_0xc3fe[_0x25e780];return _0xe85492;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec3f('0x0'));var zipdir=require(_0xec3f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xec3f('0x2'));var moment=require(_0xec3f('0x3'));var BPromise=require(_0xec3f('0x4'));var Mustache=require(_0xec3f('0x5'));var util=require('util');var path=require('path');var sox=require(_0xec3f('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec3f('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xec3f('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xec3f('0x9'));var toCsv=require(_0xec3f('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xec3f('0xb'));var authService=require(_0xec3f('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xec3f('0xd'));var hardwareService=require(_0xec3f('0xe'));var logger=require(_0xec3f('0xf'))(_0xec3f('0x10'));var utils=require(_0xec3f('0x11'));var config=require(_0xec3f('0x12'));var licenseUtil=require(_0xec3f('0x13'));var db=require(_0xec3f('0x14'))['db'];function respondWithStatusCode(_0xa18072,_0x4ae52d){_0x4ae52d=_0x4ae52d||0xcc;return function(_0x541641){if(_0x541641){return _0xa18072['sendStatus'](_0x4ae52d);}return _0xa18072['status'](_0x4ae52d)[_0xec3f('0x15')]();};}function respondWithResult(_0xb62005,_0x34b194){_0x34b194=_0x34b194||0xc8;return function(_0x495a03){if(_0x495a03){return _0xb62005[_0xec3f('0x16')](_0x34b194)[_0xec3f('0x17')](_0x495a03);}};}function respondWithFilteredResult(_0xa7b5b9,_0x2a7c60){return function(_0x1877fe){if(_0x1877fe){var _0x2ed7ae=typeof _0x2a7c60[_0xec3f('0x18')]===_0xec3f('0x19')&&typeof _0x2a7c60['limit']===_0xec3f('0x19');var _0xc0fdd8=_0x1877fe[_0xec3f('0x1a')];var _0x489a87=_0x2ed7ae?0x0:_0x2a7c60[_0xec3f('0x18')];var _0x526b35=_0x2ed7ae?_0x1877fe[_0xec3f('0x1a')]:_0x2a7c60['offset']+_0x2a7c60[_0xec3f('0x1b')];var _0x5ea259;if(_0x526b35>=_0xc0fdd8){_0x526b35=_0xc0fdd8;_0x5ea259=0xc8;}else{_0x5ea259=0xce;}_0xa7b5b9['status'](_0x5ea259);return _0xa7b5b9['set'](_0xec3f('0x1c'),_0x489a87+'-'+_0x526b35+'/'+_0xc0fdd8)['json'](_0x1877fe);}return null;};}function patchUpdates(_0x13ddfb){return function(_0x463217){try{jsonpatch['apply'](_0x463217,_0x13ddfb,!![]);}catch(_0xad41cd){return BPromise[_0xec3f('0x1d')](_0xad41cd);}return _0x463217[_0xec3f('0x1e')]();};}function saveUpdates(_0x45f546,_0x3963de){return function(_0x580fad){if(_0x580fad){return _0x580fad[_0xec3f('0x1f')](_0x45f546)[_0xec3f('0x20')](function(_0x5e71e2){return _0x5e71e2;});}return null;};}function removeEntity(_0x104ea1,_0x4d5586){return function(_0xacfed5){if(_0xacfed5){return _0xacfed5['destroy']()['then'](function(){_0x104ea1[_0xec3f('0x16')](0xcc)[_0xec3f('0x15')]();});}};}function handleEntityNotFound(_0x3633b9,_0x1c1cbc){return function(_0x503f08){if(!_0x503f08){_0x3633b9['sendStatus'](0x194);}return _0x503f08;};}function handleError(_0x93c347,_0x6860bc){_0x6860bc=_0x6860bc||0x1f4;return function(_0x45b216){logger[_0xec3f('0x21')](_0x45b216[_0xec3f('0x22')]);if(_0x45b216[_0xec3f('0x23')]){delete _0x45b216[_0xec3f('0x23')];}_0x93c347['status'](_0x6860bc)[_0xec3f('0x24')](_0x45b216);};}exports[_0xec3f('0x25')]=function(_0x53441e,_0x467285){var _0xf79d5f={},_0x3b7813={},_0x48a4c2={'count':0x0,'rows':[]};var _0x5b5068=_[_0xec3f('0x26')](db[_0xec3f('0x27')]['rawAttributes'],function(_0x1bb36d){return{'name':_0x1bb36d[_0xec3f('0x28')],'type':_0x1bb36d['type'][_0xec3f('0x29')]};});_0x3b7813[_0xec3f('0x2a')]=_['map'](_0x5b5068,_0xec3f('0x23'));_0x3b7813[_0xec3f('0x2b')]=_['keys'](_0x53441e['query']);_0x3b7813[_0xec3f('0x2c')]=_[_0xec3f('0x2d')](_0x3b7813[_0xec3f('0x2a')],_0x3b7813[_0xec3f('0x2b')]);_0xf79d5f[_0xec3f('0x2e')]=_[_0xec3f('0x2d')](_0x3b7813['model'],qs[_0xec3f('0x2f')](_0x53441e[_0xec3f('0x2b')][_0xec3f('0x2f')]));_0xf79d5f['attributes']=_0xf79d5f['attributes'][_0xec3f('0x30')]?_0xf79d5f[_0xec3f('0x2e')]:_0x3b7813['model'];if(!_0x53441e[_0xec3f('0x2b')][_0xec3f('0x31')]('nolimit')){_0xf79d5f[_0xec3f('0x1b')]=qs[_0xec3f('0x1b')](_0x53441e[_0xec3f('0x2b')][_0xec3f('0x1b')]);_0xf79d5f['offset']=qs['offset'](_0x53441e[_0xec3f('0x2b')]['offset']);}_0xf79d5f[_0xec3f('0x32')]=qs['sort'](_0x53441e['query'][_0xec3f('0x33')]);_0xf79d5f[_0xec3f('0x34')]=qs[_0xec3f('0x2c')](_[_0xec3f('0x35')](_0x53441e['query'],_0x3b7813[_0xec3f('0x2c')]),_0x5b5068);if(_0x53441e[_0xec3f('0x2b')][_0xec3f('0x36')]){_0xf79d5f[_0xec3f('0x34')]=_['merge'](_0xf79d5f[_0xec3f('0x34')],{'$or':_[_0xec3f('0x26')](_0x5b5068,function(_0x218eb6){if(_0x218eb6['type']!=='VIRTUAL'){var _0x4565cb={};_0x4565cb[_0x218eb6[_0xec3f('0x23')]]={'$like':'%'+_0x53441e[_0xec3f('0x2b')][_0xec3f('0x36')]+'%'};return _0x4565cb;}})});}_0xf79d5f=_[_0xec3f('0x37')]({},_0xf79d5f,_0x53441e[_0xec3f('0x38')]);var _0x3c5d8c={'where':_0xf79d5f[_0xec3f('0x34')]};return db[_0xec3f('0x27')]['count'](_0x3c5d8c)[_0xec3f('0x20')](function(_0x5d40dc){_0x48a4c2['count']=_0x5d40dc;if(_0x53441e['query'][_0xec3f('0x39')]){_0xf79d5f[_0xec3f('0x3a')]=[{'all':!![]}];}return db['FaxTransferReport'][_0xec3f('0x3b')](_0xf79d5f);})[_0xec3f('0x20')](function(_0x32d721){_0x48a4c2[_0xec3f('0x3c')]=_0x32d721;return _0x48a4c2;})[_0xec3f('0x20')](respondWithFilteredResult(_0x467285,_0xf79d5f))[_0xec3f('0x3d')](handleError(_0x467285,null));};exports['show']=function(_0x4861c5,_0x15058e){var _0x364eb1={'raw':!![],'where':{'id':_0x4861c5[_0xec3f('0x3e')]['id']}},_0x904274={};_0x904274[_0xec3f('0x2a')]=_[_0xec3f('0x3f')](db[_0xec3f('0x27')][_0xec3f('0x40')]);_0x904274[_0xec3f('0x2b')]=_[_0xec3f('0x3f')](_0x4861c5[_0xec3f('0x2b')]);_0x904274[_0xec3f('0x2c')]=_[_0xec3f('0x2d')](_0x904274[_0xec3f('0x2a')],_0x904274[_0xec3f('0x2b')]);_0x364eb1[_0xec3f('0x2e')]=_[_0xec3f('0x2d')](_0x904274[_0xec3f('0x2a')],qs[_0xec3f('0x2f')](_0x4861c5[_0xec3f('0x2b')][_0xec3f('0x2f')]));_0x364eb1[_0xec3f('0x2e')]=_0x364eb1['attributes'][_0xec3f('0x30')]?_0x364eb1[_0xec3f('0x2e')]:_0x904274[_0xec3f('0x2a')];if(_0x4861c5[_0xec3f('0x2b')][_0xec3f('0x39')]){_0x364eb1[_0xec3f('0x3a')]=[{'all':!![]}];}_0x364eb1=_[_0xec3f('0x37')]({},_0x364eb1,_0x4861c5[_0xec3f('0x38')]);return db[_0xec3f('0x27')][_0xec3f('0x41')](_0x364eb1)[_0xec3f('0x20')](handleEntityNotFound(_0x15058e,null))['then'](respondWithResult(_0x15058e,null))['catch'](handleError(_0x15058e,null));};exports['create']=function(_0x190a44,_0x2d2a08){return db['FaxTransferReport'][_0xec3f('0x42')](_0x190a44[_0xec3f('0x43')],{})['then'](respondWithResult(_0x2d2a08,0xc9))['catch'](handleError(_0x2d2a08,null));};exports['update']=function(_0x363c0a,_0x2dbf74){if(_0x363c0a['body']['id']){delete _0x363c0a[_0xec3f('0x43')]['id'];}return db[_0xec3f('0x27')][_0xec3f('0x41')]({'where':{'id':_0x363c0a[_0xec3f('0x3e')]['id']}})[_0xec3f('0x20')](handleEntityNotFound(_0x2dbf74,null))[_0xec3f('0x20')](saveUpdates(_0x363c0a[_0xec3f('0x43')],null))[_0xec3f('0x20')](respondWithResult(_0x2dbf74,null))[_0xec3f('0x3d')](handleError(_0x2dbf74,null));};exports[_0xec3f('0x44')]=function(_0x2eb727,_0x2cf2ac){return db[_0xec3f('0x27')][_0xec3f('0x41')]({'where':{'id':_0x2eb727[_0xec3f('0x3e')]['id']}})[_0xec3f('0x20')](handleEntityNotFound(_0x2cf2ac,null))[_0xec3f('0x20')](removeEntity(_0x2cf2ac,null))['catch'](handleError(_0x2cf2ac,null));};exports[_0xec3f('0x45')]=function(_0x3e69af,_0x3f7b04){return db[_0xec3f('0x27')]['describe']()[_0xec3f('0x20')](respondWithResult(_0x3f7b04,null))[_0xec3f('0x3d')](handleError(_0x3f7b04,null));}; \ No newline at end of file +var _0x53e8=['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','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','FaxTransferReport','type','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','show','params','rawAttributes','includeAll','catch','create','body','describe','eml-format','rimraf','request-promise','moment','mustache','util','path','to-csv','ejs'];(function(_0x3ae349,_0x4c4b64){var _0x4e534c=function(_0x500624){while(--_0x500624){_0x3ae349['push'](_0x3ae349['shift']());}};_0x4e534c(++_0x4c4b64);}(_0x53e8,0x12f));var _0x853e=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x53e8[_0x710815];return _0x5b3b89;};'use strict';var emlformat=require(_0x853e('0x0'));var rimraf=require(_0x853e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x853e('0x2'));var moment=require(_0x853e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x853e('0x4'));var util=require(_0x853e('0x5'));var path=require(_0x853e('0x6'));var sox=require('sox');var csv=require(_0x853e('0x7'));var ejs=require(_0x853e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x853e('0x9'));var squel=require(_0x853e('0xa'));var crypto=require('crypto');var jsforce=require(_0x853e('0xb'));var deskjs=require(_0x853e('0xc'));var toCsv=require(_0x853e('0x7'));var querystring=require(_0x853e('0xd'));var Papa=require(_0x853e('0xe'));var Redis=require(_0x853e('0xf'));var authService=require(_0x853e('0x10'));var qs=require(_0x853e('0x11'));var as=require(_0x853e('0x12'));var hardwareService=require(_0x853e('0x13'));var logger=require(_0x853e('0x14'))(_0x853e('0x15'));var utils=require(_0x853e('0x16'));var config=require(_0x853e('0x17'));var licenseUtil=require(_0x853e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a82c6,_0x1508bd){_0x1508bd=_0x1508bd||0xcc;return function(_0x589a94){if(_0x589a94){return _0x2a82c6['sendStatus'](_0x1508bd);}return _0x2a82c6[_0x853e('0x19')](_0x1508bd)[_0x853e('0x1a')]();};}function respondWithResult(_0xe20d7d,_0x2f5c14){_0x2f5c14=_0x2f5c14||0xc8;return function(_0x5d941e){if(_0x5d941e){return _0xe20d7d[_0x853e('0x19')](_0x2f5c14)[_0x853e('0x1b')](_0x5d941e);}};}function respondWithFilteredResult(_0x8cf530,_0x37af89){return function(_0x152270){if(_0x152270){var _0x354d92=typeof _0x37af89['offset']===_0x853e('0x1c')&&typeof _0x37af89[_0x853e('0x1d')]===_0x853e('0x1c');var _0xa9eb94=_0x152270['count'];var _0x31261e=_0x354d92?0x0:_0x37af89[_0x853e('0x1e')];var _0x118553=_0x354d92?_0x152270['count']:_0x37af89['offset']+_0x37af89[_0x853e('0x1d')];var _0x1db212;if(_0x118553>=_0xa9eb94){_0x118553=_0xa9eb94;_0x1db212=0xc8;}else{_0x1db212=0xce;}_0x8cf530[_0x853e('0x19')](_0x1db212);return _0x8cf530[_0x853e('0x1f')](_0x853e('0x20'),_0x31261e+'-'+_0x118553+'/'+_0xa9eb94)['json'](_0x152270);}return null;};}function patchUpdates(_0x55a26c){return function(_0xc15a54){try{jsonpatch[_0x853e('0x21')](_0xc15a54,_0x55a26c,!![]);}catch(_0x4f2e71){return BPromise[_0x853e('0x22')](_0x4f2e71);}return _0xc15a54[_0x853e('0x23')]();};}function saveUpdates(_0x5d468d,_0x4e7971){return function(_0x47618c){if(_0x47618c){return _0x47618c[_0x853e('0x24')](_0x5d468d)[_0x853e('0x25')](function(_0x364a8f){return _0x364a8f;});}return null;};}function removeEntity(_0x3c00f8,_0x5771e7){return function(_0x505506){if(_0x505506){return _0x505506[_0x853e('0x26')]()[_0x853e('0x25')](function(){_0x3c00f8[_0x853e('0x19')](0xcc)[_0x853e('0x1a')]();});}};}function handleEntityNotFound(_0x1a29e8,_0x30daeb){return function(_0x3c9eb3){if(!_0x3c9eb3){_0x1a29e8[_0x853e('0x27')](0x194);}return _0x3c9eb3;};}function handleError(_0x52deae,_0x216410){_0x216410=_0x216410||0x1f4;return function(_0x3d62ce){logger[_0x853e('0x28')](_0x3d62ce[_0x853e('0x29')]);if(_0x3d62ce[_0x853e('0x2a')]){delete _0x3d62ce[_0x853e('0x2a')];}_0x52deae[_0x853e('0x19')](_0x216410)[_0x853e('0x2b')](_0x3d62ce);};}exports[_0x853e('0x2c')]=function(_0x4c3ff8,_0x1f96e6){var _0x1456ac={},_0x33ac41={},_0x1ef7cd={'count':0x0,'rows':[]};var _0x59a4aa=_[_0x853e('0x2d')](db[_0x853e('0x2e')]['rawAttributes'],function(_0x3c7262){return{'name':_0x3c7262['fieldName'],'type':_0x3c7262[_0x853e('0x2f')]['key']};});_0x33ac41[_0x853e('0x30')]=_[_0x853e('0x2d')](_0x59a4aa,_0x853e('0x2a'));_0x33ac41[_0x853e('0x31')]=_[_0x853e('0x32')](_0x4c3ff8['query']);_0x33ac41[_0x853e('0x33')]=_[_0x853e('0x34')](_0x33ac41[_0x853e('0x30')],_0x33ac41['query']);_0x1456ac['attributes']=_['intersection'](_0x33ac41['model'],qs[_0x853e('0x35')](_0x4c3ff8['query'][_0x853e('0x35')]));_0x1456ac['attributes']=_0x1456ac['attributes'][_0x853e('0x36')]?_0x1456ac[_0x853e('0x37')]:_0x33ac41[_0x853e('0x30')];if(!_0x4c3ff8[_0x853e('0x31')][_0x853e('0x38')](_0x853e('0x39'))){_0x1456ac[_0x853e('0x1d')]=qs[_0x853e('0x1d')](_0x4c3ff8['query']['limit']);_0x1456ac[_0x853e('0x1e')]=qs[_0x853e('0x1e')](_0x4c3ff8[_0x853e('0x31')][_0x853e('0x1e')]);}_0x1456ac[_0x853e('0x3a')]=qs[_0x853e('0x3b')](_0x4c3ff8['query'][_0x853e('0x3b')]);_0x1456ac[_0x853e('0x3c')]=qs[_0x853e('0x33')](_[_0x853e('0x3d')](_0x4c3ff8['query'],_0x33ac41[_0x853e('0x33')]),_0x59a4aa);if(_0x4c3ff8['query'][_0x853e('0x3e')]){_0x1456ac[_0x853e('0x3c')]=_[_0x853e('0x3f')](_0x1456ac[_0x853e('0x3c')],{'$or':_['map'](_0x59a4aa,function(_0x1aa2f3){if(_0x1aa2f3['type']!==_0x853e('0x40')){var _0x2b2d0f={};_0x2b2d0f[_0x1aa2f3[_0x853e('0x2a')]]={'$like':'%'+_0x4c3ff8['query'][_0x853e('0x3e')]+'%'};return _0x2b2d0f;}})});}_0x1456ac=_[_0x853e('0x3f')]({},_0x1456ac,_0x4c3ff8[_0x853e('0x41')]);var _0x21ad27={'where':_0x1456ac[_0x853e('0x3c')]};return db[_0x853e('0x2e')][_0x853e('0x42')](_0x21ad27)[_0x853e('0x25')](function(_0xdaf8d5){_0x1ef7cd[_0x853e('0x42')]=_0xdaf8d5;if(_0x4c3ff8['query']['includeAll']){_0x1456ac[_0x853e('0x43')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x853e('0x44')](_0x1456ac);})[_0x853e('0x25')](function(_0x51d19e){_0x1ef7cd[_0x853e('0x45')]=_0x51d19e;return _0x1ef7cd;})['then'](respondWithFilteredResult(_0x1f96e6,_0x1456ac))['catch'](handleError(_0x1f96e6,null));};exports[_0x853e('0x46')]=function(_0x58999b,_0x39816b){var _0x30c0ca={'raw':!![],'where':{'id':_0x58999b[_0x853e('0x47')]['id']}},_0x51aa25={};_0x51aa25[_0x853e('0x30')]=_[_0x853e('0x32')](db[_0x853e('0x2e')][_0x853e('0x48')]);_0x51aa25['query']=_[_0x853e('0x32')](_0x58999b['query']);_0x51aa25[_0x853e('0x33')]=_[_0x853e('0x34')](_0x51aa25[_0x853e('0x30')],_0x51aa25[_0x853e('0x31')]);_0x30c0ca[_0x853e('0x37')]=_['intersection'](_0x51aa25[_0x853e('0x30')],qs['fields'](_0x58999b[_0x853e('0x31')][_0x853e('0x35')]));_0x30c0ca[_0x853e('0x37')]=_0x30c0ca[_0x853e('0x37')][_0x853e('0x36')]?_0x30c0ca['attributes']:_0x51aa25[_0x853e('0x30')];if(_0x58999b[_0x853e('0x31')][_0x853e('0x49')]){_0x30c0ca[_0x853e('0x43')]=[{'all':!![]}];}_0x30c0ca=_['merge']({},_0x30c0ca,_0x58999b[_0x853e('0x41')]);return db[_0x853e('0x2e')]['find'](_0x30c0ca)[_0x853e('0x25')](handleEntityNotFound(_0x39816b,null))[_0x853e('0x25')](respondWithResult(_0x39816b,null))[_0x853e('0x4a')](handleError(_0x39816b,null));};exports[_0x853e('0x4b')]=function(_0x56fadb,_0x56ba5b){return db[_0x853e('0x2e')][_0x853e('0x4b')](_0x56fadb['body'],{})[_0x853e('0x25')](respondWithResult(_0x56ba5b,0xc9))['catch'](handleError(_0x56ba5b,null));};exports['update']=function(_0x6d772e,_0x21d5c6){if(_0x6d772e[_0x853e('0x4c')]['id']){delete _0x6d772e[_0x853e('0x4c')]['id'];}return db[_0x853e('0x2e')]['find']({'where':{'id':_0x6d772e[_0x853e('0x47')]['id']}})['then'](handleEntityNotFound(_0x21d5c6,null))[_0x853e('0x25')](saveUpdates(_0x6d772e['body'],null))[_0x853e('0x25')](respondWithResult(_0x21d5c6,null))[_0x853e('0x4a')](handleError(_0x21d5c6,null));};exports[_0x853e('0x26')]=function(_0x57bac8,_0x38319b){return db[_0x853e('0x2e')]['find']({'where':{'id':_0x57bac8[_0x853e('0x47')]['id']}})[_0x853e('0x25')](handleEntityNotFound(_0x38319b,null))['then'](removeEntity(_0x38319b,null))['catch'](handleError(_0x38319b,null));};exports[_0x853e('0x4d')]=function(_0x4eae61,_0x1dd9c1){return db[_0x853e('0x2e')][_0x853e('0x4d')]()[_0x853e('0x25')](respondWithResult(_0x1dd9c1,null))[_0x853e('0x4a')](handleError(_0x1dd9c1,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 350e394..bb44633 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 _0x808e=['rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','moment','request-promise','path'];(function(_0x12aaee,_0x5bf50c){var _0x37c350=function(_0x182775){while(--_0x182775){_0x12aaee['push'](_0x12aaee['shift']());}};_0x37c350(++_0x5bf50c);}(_0x808e,0x104));var _0xe808=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x808e[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xe808('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xe808('0x1'));var BPromise=require('bluebird');var rp=require(_0xe808('0x2'));var fs=require('fs');var path=require(_0xe808('0x3'));var rimraf=require(_0xe808('0x4'));var config=require(_0xe808('0x5'));var attributes=require(_0xe808('0x6'));module[_0xe808('0x7')]=function(_0x49e994,_0x44b667){return _0x49e994[_0xe808('0x8')](_0xe808('0x9'),attributes,{'tableName':_0xe808('0xa'),'paranoid':![],'indexes':[{'name':_0xe808('0xb'),'fields':[_0xe808('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xebe1=['define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports'];(function(_0xbb8c8c,_0xb1f7d9){var _0x18e5dd=function(_0x1419d5){while(--_0x1419d5){_0xbb8c8c['push'](_0xbb8c8c['shift']());}};_0x18e5dd(++_0xb1f7d9);}(_0xebe1,0x19a));var _0x1ebe=function(_0x29d5ac,_0x350be9){_0x29d5ac=_0x29d5ac-0x0;var _0x1a520a=_0xebe1[_0x29d5ac];return _0x1a520a;};'use strict';var _=require(_0x1ebe('0x0'));var util=require(_0x1ebe('0x1'));var logger=require(_0x1ebe('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1ebe('0x3'));var rp=require(_0x1ebe('0x4'));var fs=require('fs');var path=require(_0x1ebe('0x5'));var rimraf=require(_0x1ebe('0x6'));var config=require(_0x1ebe('0x7'));var attributes=require(_0x1ebe('0x8'));module[_0x1ebe('0x9')]=function(_0x101fd5,_0x5a98e1){return _0x101fd5[_0x1ebe('0xa')](_0x1ebe('0xb'),attributes,{'tableName':_0x1ebe('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1ebe('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 980e756..7e0fb65 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 _0x21ba=['http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x7fbd14,_0x5e9a6a){var _0xc944d7=function(_0x3ff966){while(--_0x3ff966){_0x7fbd14['push'](_0x7fbd14['shift']());}};_0xc944d7(++_0x5e9a6a);}(_0x21ba,0x7f));var _0xa21b=function(_0x5350c9,_0x130985){_0x5350c9=_0x5350c9-0x0;var _0x5e9458=_0x21ba[_0x5350c9];return _0x5e9458;};'use strict';var _=require('lodash');var util=require(_0xa21b('0x0'));var moment=require(_0xa21b('0x1'));var BPromise=require('bluebird');var rs=require(_0xa21b('0x2'));var fs=require('fs');var Redis=require(_0xa21b('0x3'));var db=require(_0xa21b('0x4'))['db'];var utils=require(_0xa21b('0x5'));var logger=require(_0xa21b('0x6'))(_0xa21b('0x7'));var config=require(_0xa21b('0x8'));var jayson=require(_0xa21b('0x9'));var client=jayson[_0xa21b('0xa')][_0xa21b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32b577,_0x2bb25b,_0x1c4a61){return new BPromise(function(_0x220003,_0x4eb994){return client[_0xa21b('0xc')](_0x32b577,_0x1c4a61)[_0xa21b('0xd')](function(_0x4dc062){logger[_0xa21b('0xe')](_0xa21b('0xf'),_0x2bb25b,_0xa21b('0x10'));logger['debug']('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x2bb25b,_0xa21b('0x10'),JSON[_0xa21b('0x11')](_0x4dc062));if(_0x4dc062[_0xa21b('0x12')]){if(_0x4dc062[_0xa21b('0x12')][_0xa21b('0x13')]===0x1f4){logger[_0xa21b('0x12')](_0xa21b('0xf'),_0x2bb25b,_0x4dc062['error']['message']);return _0x4eb994(_0x4dc062[_0xa21b('0x12')][_0xa21b('0x14')]);}logger[_0xa21b('0x12')](_0xa21b('0xf'),_0x2bb25b,_0x4dc062['error']['message']);return _0x220003(_0x4dc062['error'][_0xa21b('0x14')]);}else{logger[_0xa21b('0xe')](_0xa21b('0xf'),_0x2bb25b,_0xa21b('0x10'));_0x220003(_0x4dc062[_0xa21b('0x15')][_0xa21b('0x14')]);}})[_0xa21b('0x16')](function(_0x49f204){logger[_0xa21b('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x2bb25b,_0x49f204);_0x4eb994(_0x49f204);});});} \ No newline at end of file +var _0x9788=['client','http','request','then','info','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','FaxTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9788,0x115));var _0x8978=function(_0x52b60d,_0x3245a4){_0x52b60d=_0x52b60d-0x0;var _0x2390fe=_0x9788[_0x52b60d];return _0x2390fe;};'use strict';var _=require(_0x8978('0x0'));var util=require(_0x8978('0x1'));var moment=require(_0x8978('0x2'));var BPromise=require(_0x8978('0x3'));var rs=require(_0x8978('0x4'));var fs=require('fs');var Redis=require(_0x8978('0x5'));var db=require(_0x8978('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8978('0x7'))(_0x8978('0x8'));var config=require(_0x8978('0x9'));var jayson=require(_0x8978('0xa'));var client=jayson[_0x8978('0xb')][_0x8978('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x342848,_0x394c3f,_0x873709){return new BPromise(function(_0x471b30,_0x4ea680){return client[_0x8978('0xd')](_0x342848,_0x873709)[_0x8978('0xe')](function(_0x244396){logger[_0x8978('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x394c3f,_0x8978('0x10'));logger['debug'](_0x8978('0x11'),_0x394c3f,'request\x20sent',JSON['stringify'](_0x244396));if(_0x244396[_0x8978('0x12')]){if(_0x244396['error'][_0x8978('0x13')]===0x1f4){logger[_0x8978('0x12')](_0x8978('0x14'),_0x394c3f,_0x244396[_0x8978('0x12')]['message']);return _0x4ea680(_0x244396[_0x8978('0x12')][_0x8978('0x15')]);}logger[_0x8978('0x12')](_0x8978('0x14'),_0x394c3f,_0x244396['error'][_0x8978('0x15')]);return _0x471b30(_0x244396[_0x8978('0x12')][_0x8978('0x15')]);}else{logger['info'](_0x8978('0x14'),_0x394c3f,_0x8978('0x10'));_0x471b30(_0x244396[_0x8978('0x16')]['message']);}})[_0x8978('0x17')](function(_0x32f247){logger['error'](_0x8978('0x14'),_0x394c3f,_0x32f247);_0x4ea680(_0x32f247);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 614f66c..2d3a533 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 _0xcc71=['/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','describe','show','create','put'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xcc71,0x1d2));var _0x1cc7=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xcc71[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x1cc7('0x0'));var util=require(_0x1cc7('0x1'));var path=require(_0x1cc7('0x2'));var timeout=require(_0x1cc7('0x3'));var express=require(_0x1cc7('0x4'));var router=express[_0x1cc7('0x5')]();var fs_extra=require(_0x1cc7('0x6'));var auth=require(_0x1cc7('0x7'));var interaction=require(_0x1cc7('0x8'));var config=require(_0x1cc7('0x9'));var controller=require(_0x1cc7('0xa'));router[_0x1cc7('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1cc7('0xb')]('/describe',auth[_0x1cc7('0xc')](),controller[_0x1cc7('0xd')]);router[_0x1cc7('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x1cc7('0xe')]);router['post']('/',auth[_0x1cc7('0xc')](),controller[_0x1cc7('0xf')]);router[_0x1cc7('0x10')](_0x1cc7('0x11'),auth[_0x1cc7('0xc')](),controller[_0x1cc7('0x12')]);router[_0x1cc7('0x13')](_0x1cc7('0x11'),auth['isAuthenticated'](),controller[_0x1cc7('0x14')]);module['exports']=router; \ No newline at end of file +var _0x7b03=['index','/describe','describe','get','/:id','show','post','create','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x7b03,0xc7));var _0x37b0=function(_0x3358ba,_0x24c5fc){_0x3358ba=_0x3358ba-0x0;var _0x296e73=_0x7b03[_0x3358ba];return _0x296e73;};'use strict';var multer=require(_0x37b0('0x0'));var util=require(_0x37b0('0x1'));var path=require(_0x37b0('0x2'));var timeout=require(_0x37b0('0x3'));var express=require('express');var router=express[_0x37b0('0x4')]();var fs_extra=require(_0x37b0('0x5'));var auth=require(_0x37b0('0x6'));var interaction=require(_0x37b0('0x7'));var config=require(_0x37b0('0x8'));var controller=require(_0x37b0('0x9'));router['get']('/',auth[_0x37b0('0xa')](),controller[_0x37b0('0xb')]);router['get'](_0x37b0('0xc'),auth[_0x37b0('0xa')](),controller[_0x37b0('0xd')]);router[_0x37b0('0xe')](_0x37b0('0xf'),auth[_0x37b0('0xa')](),controller[_0x37b0('0x10')]);router[_0x37b0('0x11')]('/',auth[_0x37b0('0xa')](),controller[_0x37b0('0x12')]);router['put'](_0x37b0('0xf'),auth[_0x37b0('0xa')](),controller['update']);router['delete'](_0x37b0('0xf'),auth[_0x37b0('0xa')](),controller[_0x37b0('0x13')]);module[_0x37b0('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 83c9d2f..72fe355 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 _0x468d=['./intDeskAccount.controller','get','isAuthenticated','index','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x468d,0x169));var _0xd468=function(_0x1c4cd7,_0x4b7bf1){_0x1c4cd7=_0x1c4cd7-0x0;var _0x438bed=_0x468d[_0x1c4cd7];return _0x438bed;};'use strict';var multer=require(_0xd468('0x0'));var util=require(_0xd468('0x1'));var path=require('path');var timeout=require(_0xd468('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd468('0x3'));var auth=require(_0xd468('0x4'));var interaction=require(_0xd468('0x5'));var config=require(_0xd468('0x6'));var controller=require(_0xd468('0x7'));router[_0xd468('0x8')]('/',auth[_0xd468('0x9')](),controller[_0xd468('0xa')]);router['get']('/:id',auth[_0xd468('0x9')](),controller[_0xd468('0xb')]);router[_0xd468('0x8')]('/:id/configurations',auth[_0xd468('0x9')](),controller[_0xd468('0xc')]);router[_0xd468('0x8')](_0xd468('0xd'),auth[_0xd468('0x9')](),controller[_0xd468('0xe')]);router[_0xd468('0xf')]('/',auth['isAuthenticated'](),controller[_0xd468('0x10')]);router[_0xd468('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xd468('0x11')]);router[_0xd468('0x12')](_0xd468('0x13'),auth[_0xd468('0x9')](),controller['update']);router[_0xd468('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xd468('0x15')]);module[_0xd468('0x16')]=router; \ No newline at end of file +var _0x2847=['../../config/environment','./intDeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','create','addConfiguration','put','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x11560a,_0x19e152){var _0x2f53f3=function(_0x32f0a8){while(--_0x32f0a8){_0x11560a['push'](_0x11560a['shift']());}};_0x2f53f3(++_0x19e152);}(_0x2847,0x173));var _0x7284=function(_0x542f45,_0x37468a){_0x542f45=_0x542f45-0x0;var _0x38c609=_0x2847[_0x542f45];return _0x38c609;};'use strict';var multer=require(_0x7284('0x0'));var util=require(_0x7284('0x1'));var path=require(_0x7284('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7284('0x3')]();var fs_extra=require(_0x7284('0x4'));var auth=require(_0x7284('0x5'));var interaction=require(_0x7284('0x6'));var config=require(_0x7284('0x7'));var controller=require(_0x7284('0x8'));router[_0x7284('0x9')]('/',auth[_0x7284('0xa')](),controller['index']);router[_0x7284('0x9')](_0x7284('0xb'),auth[_0x7284('0xa')](),controller[_0x7284('0xc')]);router[_0x7284('0x9')](_0x7284('0xd'),auth[_0x7284('0xa')](),controller[_0x7284('0xe')]);router['get']('/:id/fields',auth[_0x7284('0xa')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0x7284('0xf')]);router['post'](_0x7284('0xd'),auth[_0x7284('0xa')](),controller[_0x7284('0x10')]);router[_0x7284('0x11')](_0x7284('0xb'),auth[_0x7284('0xa')](),controller['update']);router[_0x7284('0x12')]('/:id',auth[_0x7284('0xa')](),controller[_0x7284('0x13')]);module[_0x7284('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index f7c43a1..9dd42c4 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 _0x32b5=['basic','newTab','integrationTab','sequelize','exports','STRING'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x32b5,0x183));var _0x532b=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x32b5[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x532b('0x0'));module[_0x532b('0x1')]={'name':{'type':Sequelize[_0x532b('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x532b('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM'](_0x532b('0x3')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x532b('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x532b('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x532b('0x2')]},'serverUrl':{'type':Sequelize[_0x532b('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x532b('0x4')),'defaultValue':_0x532b('0x5')}}; \ No newline at end of file +var _0x8924=['newTab','sequelize','exports','STRING','ENUM','basic','integrationTab'];(function(_0x5d954a,_0x10e4b9){var _0x2c8dc9=function(_0x16870b){while(--_0x16870b){_0x5d954a['push'](_0x5d954a['shift']());}};_0x2c8dc9(++_0x10e4b9);}(_0x8924,0x6a));var _0x4892=function(_0xa5a920,_0x2d8772){_0xa5a920=_0xa5a920-0x0;var _0x596618=_0x8924[_0xa5a920];return _0x596618;};'use strict';var Sequelize=require(_0x4892('0x0'));module[_0x4892('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4892('0x2')]},'remoteUri':{'type':Sequelize[_0x4892('0x2')]},'authType':{'type':Sequelize[_0x4892('0x3')]('basic'),'defaultValue':_0x4892('0x4')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x4892('0x2')]},'consumerSecret':{'type':Sequelize[_0x4892('0x2')]},'token':{'type':Sequelize[_0x4892('0x2')]},'tokenSecret':{'type':Sequelize[_0x4892('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x4892('0x3')](_0x4892('0x5'),_0x4892('0x6')),'defaultValue':_0x4892('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 7d9e0fe..eef61c8 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 _0xa4f8=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','model','map','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','DeskAccount','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','filters','find','create','body','getConfigurations','findOne','DeskConfiguration','nolimit','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','DeskField','Subjects','getFields','priority','authType','username','password','consumerKey','consumerSecret','tokenSecret','remoteUri','slice','substring','lastIndexOf','GET','format','%s/custom_fields','basic','Authorization','Basic\x20%s','toString','base64','concat','_embedded','active','test','statusCode','stringify','eml-format','rimraf'];(function(_0x128239,_0x30a688){var _0x5543df=function(_0x251c03){while(--_0x251c03){_0x128239['push'](_0x128239['shift']());}};_0x5543df(++_0x30a688);}(_0xa4f8,0xe0));var _0x8a4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa4f8[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x8a4f('0x0'));var rimraf=require(_0x8a4f('0x1'));var zipdir=require(_0x8a4f('0x2'));var jsonpatch=require(_0x8a4f('0x3'));var rp=require(_0x8a4f('0x4'));var moment=require('moment');var BPromise=require(_0x8a4f('0x5'));var Mustache=require(_0x8a4f('0x6'));var util=require(_0x8a4f('0x7'));var path=require(_0x8a4f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a4f('0x9'));var _=require(_0x8a4f('0xa'));var squel=require(_0x8a4f('0xb'));var crypto=require('crypto');var jsforce=require(_0x8a4f('0xc'));var deskjs=require(_0x8a4f('0xd'));var toCsv=require(_0x8a4f('0xe'));var querystring=require(_0x8a4f('0xf'));var Papa=require(_0x8a4f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8a4f('0x11'));var as=require(_0x8a4f('0x12'));var hardwareService=require(_0x8a4f('0x13'));var logger=require(_0x8a4f('0x14'))(_0x8a4f('0x15'));var utils=require('../../config/utils');var config=require(_0x8a4f('0x16'));var licenseUtil=require(_0x8a4f('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x8a4f('0x18'));function respondWithStatusCode(_0x16fb8f,_0x2649b6){_0x2649b6=_0x2649b6||0xcc;return function(_0x4cdeea){if(_0x4cdeea){return _0x16fb8f[_0x8a4f('0x19')](_0x2649b6);}return _0x16fb8f[_0x8a4f('0x1a')](_0x2649b6)['end']();};}function respondWithResult(_0x5eee0d,_0xe03436){_0xe03436=_0xe03436||0xc8;return function(_0x44a019){if(_0x44a019){return _0x5eee0d['status'](_0xe03436)['json'](_0x44a019);}};}function respondWithFilteredResult(_0x2e38c4,_0x4de489){return function(_0x49efcf){if(_0x49efcf){var _0x181202=typeof _0x4de489[_0x8a4f('0x1b')]===_0x8a4f('0x1c')&&typeof _0x4de489[_0x8a4f('0x1d')]===_0x8a4f('0x1c');var _0xb0daea=_0x49efcf['count'];var _0x2cf749=_0x181202?0x0:_0x4de489[_0x8a4f('0x1b')];var _0x470e3b=_0x181202?_0x49efcf[_0x8a4f('0x1e')]:_0x4de489[_0x8a4f('0x1b')]+_0x4de489[_0x8a4f('0x1d')];var _0x4994e2;if(_0x470e3b>=_0xb0daea){_0x470e3b=_0xb0daea;_0x4994e2=0xc8;}else{_0x4994e2=0xce;}_0x2e38c4[_0x8a4f('0x1a')](_0x4994e2);return _0x2e38c4[_0x8a4f('0x1f')]('Content-Range',_0x2cf749+'-'+_0x470e3b+'/'+_0xb0daea)['json'](_0x49efcf);}return null;};}function patchUpdates(_0x1121d8){return function(_0x18e7a8){try{jsonpatch[_0x8a4f('0x20')](_0x18e7a8,_0x1121d8,!![]);}catch(_0x4a482c){return BPromise[_0x8a4f('0x21')](_0x4a482c);}return _0x18e7a8[_0x8a4f('0x22')]();};}function saveUpdates(_0x286c78,_0x53fcab){return function(_0x496efd){if(_0x496efd){return _0x496efd[_0x8a4f('0x23')](_0x286c78)[_0x8a4f('0x24')](function(_0x485b6f){return _0x485b6f;});}return null;};}function removeEntity(_0x160047,_0x39d15d){return function(_0x5252fb){if(_0x5252fb){return _0x5252fb[_0x8a4f('0x25')]()[_0x8a4f('0x24')](function(){_0x160047[_0x8a4f('0x1a')](0xcc)[_0x8a4f('0x26')]();});}};}function handleEntityNotFound(_0x3026fe,_0x3d16cb){return function(_0x419e4b){if(!_0x419e4b){_0x3026fe[_0x8a4f('0x19')](0x194);}return _0x419e4b;};}function handleError(_0x5ab14d,_0x2d3d3c){_0x2d3d3c=_0x2d3d3c||0x1f4;return function(_0x4b20fd){logger[_0x8a4f('0x27')](_0x4b20fd[_0x8a4f('0x28')]);if(_0x4b20fd[_0x8a4f('0x29')]){delete _0x4b20fd[_0x8a4f('0x29')];}_0x5ab14d[_0x8a4f('0x1a')](_0x2d3d3c)[_0x8a4f('0x2a')](_0x4b20fd);};}exports[_0x8a4f('0x2b')]=function(_0x2dbd94,_0x40c128){var _0x227167={},_0x3102af={},_0x37329c={'count':0x0,'rows':[]};var _0x3df083=_['map'](db['DeskAccount']['rawAttributes'],function(_0x27eff1){return{'name':_0x27eff1['fieldName'],'type':_0x27eff1['type']['key']};});_0x3102af[_0x8a4f('0x2c')]=_[_0x8a4f('0x2d')](_0x3df083,'name');_0x3102af[_0x8a4f('0x2e')]=_['keys'](_0x2dbd94[_0x8a4f('0x2e')]);_0x3102af['filters']=_[_0x8a4f('0x2f')](_0x3102af[_0x8a4f('0x2c')],_0x3102af[_0x8a4f('0x2e')]);_0x227167[_0x8a4f('0x30')]=_['intersection'](_0x3102af['model'],qs[_0x8a4f('0x31')](_0x2dbd94[_0x8a4f('0x2e')][_0x8a4f('0x31')]));_0x227167[_0x8a4f('0x30')]=_0x227167[_0x8a4f('0x30')][_0x8a4f('0x32')]?_0x227167[_0x8a4f('0x30')]:_0x3102af['model'];if(!_0x2dbd94['query'][_0x8a4f('0x33')]('nolimit')){_0x227167['limit']=qs[_0x8a4f('0x1d')](_0x2dbd94[_0x8a4f('0x2e')][_0x8a4f('0x1d')]);_0x227167[_0x8a4f('0x1b')]=qs[_0x8a4f('0x1b')](_0x2dbd94['query'][_0x8a4f('0x1b')]);}_0x227167[_0x8a4f('0x34')]=qs['sort'](_0x2dbd94[_0x8a4f('0x2e')][_0x8a4f('0x35')]);_0x227167[_0x8a4f('0x36')]=qs['filters'](_[_0x8a4f('0x37')](_0x2dbd94['query'],_0x3102af['filters']),_0x3df083);if(_0x2dbd94['query'][_0x8a4f('0x38')]){_0x227167[_0x8a4f('0x36')]=_[_0x8a4f('0x39')](_0x227167['where'],{'$or':_['map'](_0x3df083,function(_0x34d0fc){if(_0x34d0fc[_0x8a4f('0x3a')]!==_0x8a4f('0x3b')){var _0x255192={};_0x255192[_0x34d0fc[_0x8a4f('0x29')]]={'$like':'%'+_0x2dbd94['query']['filter']+'%'};return _0x255192;}})});}_0x227167=_['merge']({},_0x227167,_0x2dbd94[_0x8a4f('0x3c')]);var _0x1ac0f1={'where':_0x227167['where']};return db[_0x8a4f('0x3d')][_0x8a4f('0x1e')](_0x1ac0f1)['then'](function(_0x3e2f1a){_0x37329c[_0x8a4f('0x1e')]=_0x3e2f1a;if(_0x2dbd94['query'][_0x8a4f('0x3e')]){_0x227167[_0x8a4f('0x3f')]=[{'all':!![]}];}return db[_0x8a4f('0x3d')][_0x8a4f('0x40')](_0x227167);})[_0x8a4f('0x24')](function(_0x200e8a){_0x37329c[_0x8a4f('0x41')]=_0x200e8a;return _0x37329c;})['then'](respondWithFilteredResult(_0x40c128,_0x227167))[_0x8a4f('0x42')](handleError(_0x40c128,null));};exports[_0x8a4f('0x43')]=function(_0x5dfcd7,_0x254a3f){var _0x378873={'raw':![],'where':{'id':_0x5dfcd7[_0x8a4f('0x44')]['id']}},_0x35a731={};_0x35a731[_0x8a4f('0x2c')]=_[_0x8a4f('0x45')](db[_0x8a4f('0x3d')][_0x8a4f('0x46')]);_0x35a731[_0x8a4f('0x2e')]=_['keys'](_0x5dfcd7[_0x8a4f('0x2e')]);_0x35a731[_0x8a4f('0x47')]=_[_0x8a4f('0x2f')](_0x35a731[_0x8a4f('0x2c')],_0x35a731[_0x8a4f('0x2e')]);_0x378873[_0x8a4f('0x30')]=_[_0x8a4f('0x2f')](_0x35a731[_0x8a4f('0x2c')],qs['fields'](_0x5dfcd7[_0x8a4f('0x2e')]['fields']));_0x378873[_0x8a4f('0x30')]=_0x378873['attributes'][_0x8a4f('0x32')]?_0x378873[_0x8a4f('0x30')]:_0x35a731[_0x8a4f('0x2c')];if(_0x5dfcd7[_0x8a4f('0x2e')][_0x8a4f('0x3e')]){_0x378873[_0x8a4f('0x3f')]=[{'all':!![]}];}_0x378873=_[_0x8a4f('0x39')]({},_0x378873,_0x5dfcd7[_0x8a4f('0x3c')]);return db[_0x8a4f('0x3d')][_0x8a4f('0x48')](_0x378873)[_0x8a4f('0x24')](handleEntityNotFound(_0x254a3f,null))['then'](respondWithResult(_0x254a3f,null))['catch'](handleError(_0x254a3f,null));};exports[_0x8a4f('0x49')]=function(_0x5d95a7,_0x14b1c0){return db[_0x8a4f('0x3d')][_0x8a4f('0x49')](_0x5d95a7['body'],{})[_0x8a4f('0x24')](respondWithResult(_0x14b1c0,0xc9))['catch'](handleError(_0x14b1c0,null));};exports['update']=function(_0x24abe4,_0x33cb97){if(_0x24abe4[_0x8a4f('0x4a')]['id']){delete _0x24abe4['body']['id'];}return db[_0x8a4f('0x3d')][_0x8a4f('0x48')]({'where':{'id':_0x24abe4[_0x8a4f('0x44')]['id']}})['then'](handleEntityNotFound(_0x33cb97,null))[_0x8a4f('0x24')](saveUpdates(_0x24abe4['body'],null))['then'](respondWithResult(_0x33cb97,null))[_0x8a4f('0x42')](handleError(_0x33cb97,null));};exports[_0x8a4f('0x25')]=function(_0x2fa1de,_0x531b55){return db[_0x8a4f('0x3d')]['find']({'where':{'id':_0x2fa1de[_0x8a4f('0x44')]['id']}})[_0x8a4f('0x24')](handleEntityNotFound(_0x531b55,null))[_0x8a4f('0x24')](removeEntity(_0x531b55,null))[_0x8a4f('0x42')](handleError(_0x531b55,null));};exports[_0x8a4f('0x4b')]=function(_0x245c25,_0x44cca5,_0x48d69d){var _0x52f88b={};var _0x3f6aee={};var _0x508fdf;var _0x3855f7;return db[_0x8a4f('0x3d')][_0x8a4f('0x4c')]({'where':{'id':_0x245c25['params']['id']}})[_0x8a4f('0x24')](handleEntityNotFound(_0x44cca5,null))['then'](function(_0x990893){if(_0x990893){_0x508fdf=_0x990893;_0x3f6aee[_0x8a4f('0x2c')]=_[_0x8a4f('0x45')](db[_0x8a4f('0x4d')][_0x8a4f('0x46')]);_0x3f6aee[_0x8a4f('0x2e')]=_[_0x8a4f('0x45')](_0x245c25[_0x8a4f('0x2e')]);_0x3f6aee[_0x8a4f('0x47')]=_[_0x8a4f('0x2f')](_0x3f6aee[_0x8a4f('0x2c')],_0x3f6aee[_0x8a4f('0x2e')]);_0x52f88b[_0x8a4f('0x30')]=_[_0x8a4f('0x2f')](_0x3f6aee['model'],qs[_0x8a4f('0x31')](_0x245c25[_0x8a4f('0x2e')][_0x8a4f('0x31')]));_0x52f88b[_0x8a4f('0x30')]=_0x52f88b[_0x8a4f('0x30')][_0x8a4f('0x32')]?_0x52f88b[_0x8a4f('0x30')]:_0x3f6aee[_0x8a4f('0x2c')];_0x52f88b[_0x8a4f('0x34')]=qs[_0x8a4f('0x35')](_0x245c25[_0x8a4f('0x2e')][_0x8a4f('0x35')]);_0x52f88b[_0x8a4f('0x36')]=qs['filters'](_[_0x8a4f('0x37')](_0x245c25['query'],_0x3f6aee[_0x8a4f('0x47')]));if(_0x245c25[_0x8a4f('0x2e')][_0x8a4f('0x38')]){_0x52f88b[_0x8a4f('0x36')]=_[_0x8a4f('0x39')](_0x52f88b[_0x8a4f('0x36')],{'$or':_[_0x8a4f('0x2d')](_0x52f88b[_0x8a4f('0x30')],function(_0x1a16c2){var _0x3f313d={};_0x3f313d[_0x1a16c2]={'$like':'%'+_0x245c25[_0x8a4f('0x2e')][_0x8a4f('0x38')]+'%'};return _0x3f313d;})});}_0x52f88b=_[_0x8a4f('0x39')]({},_0x52f88b,_0x245c25[_0x8a4f('0x3c')]);return _0x508fdf[_0x8a4f('0x4b')](_0x52f88b);}})[_0x8a4f('0x24')](function(_0x45c62a){if(_0x45c62a){_0x3855f7=_0x45c62a[_0x8a4f('0x32')];if(!_0x245c25[_0x8a4f('0x2e')][_0x8a4f('0x33')](_0x8a4f('0x4e'))){_0x52f88b[_0x8a4f('0x1d')]=qs[_0x8a4f('0x1d')](_0x245c25[_0x8a4f('0x2e')][_0x8a4f('0x1d')]);_0x52f88b['offset']=qs['offset'](_0x245c25[_0x8a4f('0x2e')]['offset']);}return _0x508fdf[_0x8a4f('0x4b')](_0x52f88b);}})[_0x8a4f('0x24')](function(_0x4d0d48){if(_0x4d0d48){return _0x4d0d48?{'count':_0x3855f7,'rows':_0x4d0d48}:null;}})[_0x8a4f('0x24')](respondWithResult(_0x44cca5,null))['catch'](handleError(_0x44cca5,null));};exports[_0x8a4f('0x4f')]=function(_0x3131d1,_0x5de200,_0x57dcf5){if(_0x3131d1[_0x8a4f('0x4a')]['id']){delete _0x3131d1[_0x8a4f('0x4a')]['id'];}return db['DeskAccount'][_0x8a4f('0x4c')]({'where':{'id':_0x3131d1[_0x8a4f('0x44')]['id']}})[_0x8a4f('0x24')](handleEntityNotFound(_0x5de200,null))[_0x8a4f('0x24')](function(_0x29c9f0){if(_0x29c9f0){_0x3131d1[_0x8a4f('0x4a')][_0x8a4f('0x50')]=_0x29c9f0['id'];_0x3131d1['body']['Subjects']=integrations[_0x8a4f('0x51')](_0x3131d1['body']['channel'],_0x3131d1[_0x8a4f('0x4a')][_0x8a4f('0x3a')]);_0x3131d1[_0x8a4f('0x4a')][_0x8a4f('0x52')]=integrations[_0x8a4f('0x53')](_0x3131d1['body'][_0x8a4f('0x54')],_0x3131d1[_0x8a4f('0x4a')][_0x8a4f('0x3a')]);return db['DeskConfiguration']['create'](_0x3131d1['body'],{'include':[{'model':db[_0x8a4f('0x55')],'as':_0x8a4f('0x56')},{'model':db[_0x8a4f('0x55')],'as':_0x8a4f('0x52')}]});}return null;})['then'](respondWithResult(_0x5de200,null))[_0x8a4f('0x42')](handleError(_0x5de200,null));};exports[_0x8a4f('0x57')]=function(_0x58b5d0,_0x1bfa30,_0x5db4c9){var _0x6c4237=[{'name':'priority','label':_0x8a4f('0x58'),'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 _0x93ffe7='';return db['DeskAccount'][_0x8a4f('0x4c')]({'where':{'id':_0x58b5d0[_0x8a4f('0x44')]['id']},'attributes':['id','remoteUri',_0x8a4f('0x59'),_0x8a4f('0x5a'),_0x8a4f('0x5b'),_0x8a4f('0x5c'),_0x8a4f('0x5d'),'token',_0x8a4f('0x5e')]})[_0x8a4f('0x24')](handleEntityNotFound(_0x1bfa30,null))[_0x8a4f('0x24')](function(_0x3181e2){if(_0x3181e2){_0x93ffe7=_0x3181e2[_0x8a4f('0x5f')];var _0x4ade9a=_0x93ffe7[_0x8a4f('0x60')](-0x1);if(_0x4ade9a==='/'){_0x93ffe7=_0x93ffe7[_0x8a4f('0x61')](0x0,_0x93ffe7[_0x8a4f('0x62')](_0x4ade9a));}var _0x34b3da={'method':_0x8a4f('0x63'),'uri':util[_0x8a4f('0x64')](_0x8a4f('0x65'),_0x93ffe7),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x3181e2[_0x8a4f('0x59')]===_0x8a4f('0x66')){_0x34b3da['headers'][_0x8a4f('0x67')]=util[_0x8a4f('0x64')](_0x8a4f('0x68'),new Buffer(util[_0x8a4f('0x64')]('%s:%s',_0x3181e2[_0x8a4f('0x5a')],_0x3181e2[_0x8a4f('0x5b')]))[_0x8a4f('0x69')](_0x8a4f('0x6a')));}return rp(_0x34b3da)[_0x8a4f('0x24')](function(_0x2076a8){return _0x6c4237[_0x8a4f('0x6b')](_['map'](_0x2076a8[_0x8a4f('0x6c')]['entries'],function(_0x2441d1){return{'id':_0x2441d1[_0x8a4f('0x29')],'name':_0x2441d1[_0x8a4f('0x29')],'type':_0x2441d1[_0x8a4f('0x3a')],'active':_0x2441d1[_0x8a4f('0x6d')],'label':_0x2441d1['label'],'custom':!![]};}));});}})[_0x8a4f('0x24')](function(_0x238f01){return{'count':_0x238f01[_0x8a4f('0x32')],'rows':_0x238f01};})[_0x8a4f('0x24')](respondWithResult(_0x1bfa30,null))[_0x8a4f('0x42')](function(_0x22d593){var _0x5cfe4d=_0x58b5d0[_0x8a4f('0x2e')][_0x8a4f('0x6e')]?0x1f4:_0x22d593[_0x8a4f('0x6f')]||0x1f4;logger[_0x8a4f('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0x8a4f('0x57'),_0x5cfe4d,JSON[_0x8a4f('0x70')](_0x22d593));delete _0x22d593['name'];if(_0x5cfe4d===0x191){_0x5cfe4d=0x190;}_0x1bfa30['status'](_0x5cfe4d)['send'](_0x58b5d0[_0x8a4f('0x2e')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x22d593[_0x8a4f('0x6f')]}:_0x22d593);});}; \ No newline at end of file +var _0x670a=['moment','bluebird','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','DeskAccount','include','findAll','rows','catch','show','includeAll','options','find','create','body','params','destroy','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','DeskField','Subjects','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','_embedded','entries','active','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','rimraf','zip-dir','request-promise'];(function(_0x2651eb,_0x582d6e){var _0x2d9948=function(_0x981903){while(--_0x981903){_0x2651eb['push'](_0x2651eb['shift']());}};_0x2d9948(++_0x582d6e);}(_0x670a,0xed));var _0xa670=function(_0x217a7d,_0x44e36e){_0x217a7d=_0x217a7d-0x0;var _0x1afb74=_0x670a[_0x217a7d];return _0x1afb74;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa670('0x0'));var zipdir=require(_0xa670('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa670('0x2'));var moment=require(_0xa670('0x3'));var BPromise=require(_0xa670('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa670('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa670('0x6'));var fs=require('fs');var fs_extra=require(_0xa670('0x7'));var _=require('lodash');var squel=require(_0xa670('0x8'));var crypto=require(_0xa670('0x9'));var jsforce=require(_0xa670('0xa'));var deskjs=require(_0xa670('0xb'));var toCsv=require(_0xa670('0xc'));var querystring=require(_0xa670('0xd'));var Papa=require(_0xa670('0xe'));var Redis=require(_0xa670('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa670('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa670('0x11'));var logger=require(_0xa670('0x12'))(_0xa670('0x13'));var utils=require(_0xa670('0x14'));var config=require(_0xa670('0x15'));var licenseUtil=require(_0xa670('0x16'));var db=require(_0xa670('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x42c63c,_0x260048){_0x260048=_0x260048||0xcc;return function(_0x37c312){if(_0x37c312){return _0x42c63c[_0xa670('0x18')](_0x260048);}return _0x42c63c[_0xa670('0x19')](_0x260048)[_0xa670('0x1a')]();};}function respondWithResult(_0x52c08c,_0x39183e){_0x39183e=_0x39183e||0xc8;return function(_0xf44ecb){if(_0xf44ecb){return _0x52c08c[_0xa670('0x19')](_0x39183e)['json'](_0xf44ecb);}};}function respondWithFilteredResult(_0x53bc68,_0x40aac7){return function(_0x721a5b){if(_0x721a5b){var _0x331ca8=typeof _0x40aac7[_0xa670('0x1b')]===_0xa670('0x1c')&&typeof _0x40aac7['limit']==='undefined';var _0x1bfeb2=_0x721a5b[_0xa670('0x1d')];var _0x488089=_0x331ca8?0x0:_0x40aac7[_0xa670('0x1b')];var _0x518ad3=_0x331ca8?_0x721a5b[_0xa670('0x1d')]:_0x40aac7[_0xa670('0x1b')]+_0x40aac7[_0xa670('0x1e')];var _0x4e9be2;if(_0x518ad3>=_0x1bfeb2){_0x518ad3=_0x1bfeb2;_0x4e9be2=0xc8;}else{_0x4e9be2=0xce;}_0x53bc68[_0xa670('0x19')](_0x4e9be2);return _0x53bc68[_0xa670('0x1f')](_0xa670('0x20'),_0x488089+'-'+_0x518ad3+'/'+_0x1bfeb2)[_0xa670('0x21')](_0x721a5b);}return null;};}function patchUpdates(_0x2b1b72){return function(_0x35f411){try{jsonpatch[_0xa670('0x22')](_0x35f411,_0x2b1b72,!![]);}catch(_0x34da35){return BPromise[_0xa670('0x23')](_0x34da35);}return _0x35f411[_0xa670('0x24')]();};}function saveUpdates(_0x159728,_0x56e20f){return function(_0x1de7b7){if(_0x1de7b7){return _0x1de7b7[_0xa670('0x25')](_0x159728)[_0xa670('0x26')](function(_0x54774d){return _0x54774d;});}return null;};}function removeEntity(_0x157b2f,_0x13febd){return function(_0x3876b0){if(_0x3876b0){return _0x3876b0['destroy']()[_0xa670('0x26')](function(){_0x157b2f[_0xa670('0x19')](0xcc)[_0xa670('0x1a')]();});}};}function handleEntityNotFound(_0x65fe73,_0x15452b){return function(_0x3d1e7d){if(!_0x3d1e7d){_0x65fe73[_0xa670('0x18')](0x194);}return _0x3d1e7d;};}function handleError(_0x5603ea,_0x73608b){_0x73608b=_0x73608b||0x1f4;return function(_0x53c754){logger[_0xa670('0x27')](_0x53c754[_0xa670('0x28')]);if(_0x53c754[_0xa670('0x29')]){delete _0x53c754[_0xa670('0x29')];}_0x5603ea['status'](_0x73608b)[_0xa670('0x2a')](_0x53c754);};}exports[_0xa670('0x2b')]=function(_0x19991f,_0x5d0764){var _0x39c538={},_0x102eaa={},_0x22e06c={'count':0x0,'rows':[]};var _0x1344dd=_[_0xa670('0x2c')](db['DeskAccount'][_0xa670('0x2d')],function(_0x55d79f){return{'name':_0x55d79f[_0xa670('0x2e')],'type':_0x55d79f[_0xa670('0x2f')][_0xa670('0x30')]};});_0x102eaa[_0xa670('0x31')]=_[_0xa670('0x2c')](_0x1344dd,'name');_0x102eaa[_0xa670('0x32')]=_[_0xa670('0x33')](_0x19991f[_0xa670('0x32')]);_0x102eaa['filters']=_[_0xa670('0x34')](_0x102eaa[_0xa670('0x31')],_0x102eaa[_0xa670('0x32')]);_0x39c538[_0xa670('0x35')]=_[_0xa670('0x34')](_0x102eaa[_0xa670('0x31')],qs[_0xa670('0x36')](_0x19991f[_0xa670('0x32')][_0xa670('0x36')]));_0x39c538[_0xa670('0x35')]=_0x39c538[_0xa670('0x35')][_0xa670('0x37')]?_0x39c538[_0xa670('0x35')]:_0x102eaa['model'];if(!_0x19991f[_0xa670('0x32')][_0xa670('0x38')](_0xa670('0x39'))){_0x39c538[_0xa670('0x1e')]=qs[_0xa670('0x1e')](_0x19991f[_0xa670('0x32')][_0xa670('0x1e')]);_0x39c538[_0xa670('0x1b')]=qs[_0xa670('0x1b')](_0x19991f['query'][_0xa670('0x1b')]);}_0x39c538[_0xa670('0x3a')]=qs[_0xa670('0x3b')](_0x19991f['query'][_0xa670('0x3b')]);_0x39c538['where']=qs['filters'](_[_0xa670('0x3c')](_0x19991f[_0xa670('0x32')],_0x102eaa[_0xa670('0x3d')]),_0x1344dd);if(_0x19991f[_0xa670('0x32')][_0xa670('0x3e')]){_0x39c538[_0xa670('0x3f')]=_[_0xa670('0x40')](_0x39c538['where'],{'$or':_[_0xa670('0x2c')](_0x1344dd,function(_0x55351d){if(_0x55351d['type']!==_0xa670('0x41')){var _0x17dc2b={};_0x17dc2b[_0x55351d[_0xa670('0x29')]]={'$like':'%'+_0x19991f[_0xa670('0x32')][_0xa670('0x3e')]+'%'};return _0x17dc2b;}})});}_0x39c538=_[_0xa670('0x40')]({},_0x39c538,_0x19991f['options']);var _0x25dcc1={'where':_0x39c538[_0xa670('0x3f')]};return db[_0xa670('0x42')][_0xa670('0x1d')](_0x25dcc1)[_0xa670('0x26')](function(_0x3cb19b){_0x22e06c[_0xa670('0x1d')]=_0x3cb19b;if(_0x19991f['query']['includeAll']){_0x39c538[_0xa670('0x43')]=[{'all':!![]}];}return db[_0xa670('0x42')][_0xa670('0x44')](_0x39c538);})[_0xa670('0x26')](function(_0x42e519){_0x22e06c[_0xa670('0x45')]=_0x42e519;return _0x22e06c;})[_0xa670('0x26')](respondWithFilteredResult(_0x5d0764,_0x39c538))[_0xa670('0x46')](handleError(_0x5d0764,null));};exports[_0xa670('0x47')]=function(_0x759a0c,_0x174879){var _0x3ef585={'raw':![],'where':{'id':_0x759a0c['params']['id']}},_0x43d298={};_0x43d298['model']=_['keys'](db[_0xa670('0x42')]['rawAttributes']);_0x43d298[_0xa670('0x32')]=_['keys'](_0x759a0c[_0xa670('0x32')]);_0x43d298[_0xa670('0x3d')]=_[_0xa670('0x34')](_0x43d298[_0xa670('0x31')],_0x43d298['query']);_0x3ef585[_0xa670('0x35')]=_[_0xa670('0x34')](_0x43d298[_0xa670('0x31')],qs[_0xa670('0x36')](_0x759a0c[_0xa670('0x32')][_0xa670('0x36')]));_0x3ef585[_0xa670('0x35')]=_0x3ef585[_0xa670('0x35')][_0xa670('0x37')]?_0x3ef585[_0xa670('0x35')]:_0x43d298[_0xa670('0x31')];if(_0x759a0c[_0xa670('0x32')][_0xa670('0x48')]){_0x3ef585[_0xa670('0x43')]=[{'all':!![]}];}_0x3ef585=_[_0xa670('0x40')]({},_0x3ef585,_0x759a0c[_0xa670('0x49')]);return db[_0xa670('0x42')][_0xa670('0x4a')](_0x3ef585)['then'](handleEntityNotFound(_0x174879,null))[_0xa670('0x26')](respondWithResult(_0x174879,null))[_0xa670('0x46')](handleError(_0x174879,null));};exports[_0xa670('0x4b')]=function(_0x109823,_0x3b53f3){return db[_0xa670('0x42')][_0xa670('0x4b')](_0x109823[_0xa670('0x4c')],{})[_0xa670('0x26')](respondWithResult(_0x3b53f3,0xc9))[_0xa670('0x46')](handleError(_0x3b53f3,null));};exports[_0xa670('0x25')]=function(_0x2c92cd,_0x21a2ee){if(_0x2c92cd[_0xa670('0x4c')]['id']){delete _0x2c92cd[_0xa670('0x4c')]['id'];}return db[_0xa670('0x42')][_0xa670('0x4a')]({'where':{'id':_0x2c92cd[_0xa670('0x4d')]['id']}})[_0xa670('0x26')](handleEntityNotFound(_0x21a2ee,null))[_0xa670('0x26')](saveUpdates(_0x2c92cd[_0xa670('0x4c')],null))['then'](respondWithResult(_0x21a2ee,null))[_0xa670('0x46')](handleError(_0x21a2ee,null));};exports[_0xa670('0x4e')]=function(_0x2af1f0,_0x5ceb36){return db['DeskAccount'][_0xa670('0x4a')]({'where':{'id':_0x2af1f0['params']['id']}})['then'](handleEntityNotFound(_0x5ceb36,null))[_0xa670('0x26')](removeEntity(_0x5ceb36,null))[_0xa670('0x46')](handleError(_0x5ceb36,null));};exports[_0xa670('0x4f')]=function(_0x5b3ec1,_0x55c396,_0x12b109){var _0x484525={};var _0x489066={};var _0x514779;var _0x190fdd;return db['DeskAccount'][_0xa670('0x50')]({'where':{'id':_0x5b3ec1['params']['id']}})['then'](handleEntityNotFound(_0x55c396,null))['then'](function(_0x59ae42){if(_0x59ae42){_0x514779=_0x59ae42;_0x489066['model']=_[_0xa670('0x33')](db[_0xa670('0x51')]['rawAttributes']);_0x489066[_0xa670('0x32')]=_['keys'](_0x5b3ec1['query']);_0x489066[_0xa670('0x3d')]=_[_0xa670('0x34')](_0x489066[_0xa670('0x31')],_0x489066[_0xa670('0x32')]);_0x484525['attributes']=_[_0xa670('0x34')](_0x489066[_0xa670('0x31')],qs[_0xa670('0x36')](_0x5b3ec1[_0xa670('0x32')][_0xa670('0x36')]));_0x484525[_0xa670('0x35')]=_0x484525['attributes'][_0xa670('0x37')]?_0x484525[_0xa670('0x35')]:_0x489066['model'];_0x484525['order']=qs[_0xa670('0x3b')](_0x5b3ec1['query'][_0xa670('0x3b')]);_0x484525['where']=qs[_0xa670('0x3d')](_[_0xa670('0x3c')](_0x5b3ec1[_0xa670('0x32')],_0x489066[_0xa670('0x3d')]));if(_0x5b3ec1[_0xa670('0x32')]['filter']){_0x484525[_0xa670('0x3f')]=_[_0xa670('0x40')](_0x484525[_0xa670('0x3f')],{'$or':_['map'](_0x484525['attributes'],function(_0x5a5b9a){var _0x292d17={};_0x292d17[_0x5a5b9a]={'$like':'%'+_0x5b3ec1[_0xa670('0x32')]['filter']+'%'};return _0x292d17;})});}_0x484525=_[_0xa670('0x40')]({},_0x484525,_0x5b3ec1['options']);return _0x514779[_0xa670('0x4f')](_0x484525);}})[_0xa670('0x26')](function(_0x554746){if(_0x554746){_0x190fdd=_0x554746['length'];if(!_0x5b3ec1[_0xa670('0x32')][_0xa670('0x38')](_0xa670('0x39'))){_0x484525['limit']=qs['limit'](_0x5b3ec1[_0xa670('0x32')][_0xa670('0x1e')]);_0x484525['offset']=qs[_0xa670('0x1b')](_0x5b3ec1[_0xa670('0x32')][_0xa670('0x1b')]);}return _0x514779['getConfigurations'](_0x484525);}})['then'](function(_0x11243e){if(_0x11243e){return _0x11243e?{'count':_0x190fdd,'rows':_0x11243e}:null;}})['then'](respondWithResult(_0x55c396,null))[_0xa670('0x46')](handleError(_0x55c396,null));};exports[_0xa670('0x52')]=function(_0x1395d7,_0x2f6102,_0x57f9cd){if(_0x1395d7[_0xa670('0x4c')]['id']){delete _0x1395d7[_0xa670('0x4c')]['id'];}return db[_0xa670('0x42')]['findOne']({'where':{'id':_0x1395d7[_0xa670('0x4d')]['id']}})[_0xa670('0x26')](handleEntityNotFound(_0x2f6102,null))[_0xa670('0x26')](function(_0x193088){if(_0x193088){_0x1395d7[_0xa670('0x4c')][_0xa670('0x53')]=_0x193088['id'];_0x1395d7[_0xa670('0x4c')]['Subjects']=integrations[_0xa670('0x54')](_0x1395d7[_0xa670('0x4c')][_0xa670('0x55')],_0x1395d7[_0xa670('0x4c')][_0xa670('0x2f')]);_0x1395d7[_0xa670('0x4c')][_0xa670('0x56')]=integrations[_0xa670('0x57')](_0x1395d7[_0xa670('0x4c')][_0xa670('0x55')],_0x1395d7[_0xa670('0x4c')]['type']);return db[_0xa670('0x51')]['create'](_0x1395d7[_0xa670('0x4c')],{'include':[{'model':db[_0xa670('0x58')],'as':_0xa670('0x59')},{'model':db[_0xa670('0x58')],'as':'Descriptions'}]});}return null;})[_0xa670('0x26')](respondWithResult(_0x2f6102,null))[_0xa670('0x46')](handleError(_0x2f6102,null));};exports[_0xa670('0x5a')]=function(_0x379857,_0x333c38,_0x59f498){var _0x5bcdd3=[{'name':_0xa670('0x5b'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0xd62013='';return db[_0xa670('0x42')][_0xa670('0x50')]({'where':{'id':_0x379857[_0xa670('0x4d')]['id']},'attributes':['id',_0xa670('0x5c'),_0xa670('0x5d'),_0xa670('0x5e'),_0xa670('0x5f'),_0xa670('0x60'),_0xa670('0x61'),_0xa670('0x62'),'tokenSecret']})[_0xa670('0x26')](handleEntityNotFound(_0x333c38,null))[_0xa670('0x26')](function(_0x5a1294){if(_0x5a1294){_0xd62013=_0x5a1294[_0xa670('0x5c')];var _0x3448ef=_0xd62013[_0xa670('0x63')](-0x1);if(_0x3448ef==='/'){_0xd62013=_0xd62013['substring'](0x0,_0xd62013[_0xa670('0x64')](_0x3448ef));}var _0x17fa8b={'method':_0xa670('0x65'),'uri':util[_0xa670('0x66')](_0xa670('0x67'),_0xd62013),'headers':{'Content-Type':_0xa670('0x68'),'Accept':_0xa670('0x68')},'json':!![]};if(_0x5a1294[_0xa670('0x5d')]===_0xa670('0x69')){_0x17fa8b[_0xa670('0x6a')][_0xa670('0x6b')]=util['format'](_0xa670('0x6c'),new Buffer(util['format'](_0xa670('0x6d'),_0x5a1294[_0xa670('0x5e')],_0x5a1294[_0xa670('0x5f')]))[_0xa670('0x6e')](_0xa670('0x6f')));}return rp(_0x17fa8b)['then'](function(_0x22a13e){return _0x5bcdd3['concat'](_[_0xa670('0x2c')](_0x22a13e[_0xa670('0x70')][_0xa670('0x71')],function(_0x13cfbf){return{'id':_0x13cfbf[_0xa670('0x29')],'name':_0x13cfbf[_0xa670('0x29')],'type':_0x13cfbf[_0xa670('0x2f')],'active':_0x13cfbf[_0xa670('0x72')],'label':_0x13cfbf['label'],'custom':!![]};}));});}})[_0xa670('0x26')](function(_0x1985a7){return{'count':_0x1985a7['length'],'rows':_0x1985a7};})[_0xa670('0x26')](respondWithResult(_0x333c38,null))['catch'](function(_0x1887e5){var _0x1dacc5=_0x379857['query']['test']?0x1f4:_0x1887e5['statusCode']||0x1f4;logger[_0xa670('0x27')](_0xa670('0x73'),_0xa670('0x5a'),_0x1dacc5,JSON[_0xa670('0x74')](_0x1887e5));delete _0x1887e5['name'];if(_0x1dacc5===0x191){_0x1dacc5=0x190;}_0x333c38[_0xa670('0x19')](_0x1dacc5)[_0xa670('0x2a')](_0x379857[_0xa670('0x32')][_0xa670('0x75')]?{'message':_0xa670('0x76'),'statusCode':_0x1887e5[_0xa670('0x77')]}:_0x1887e5);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index c599d0c..4b3f915 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 _0x877f=['./intDeskAccount.attributes','exports','define','DeskAccount','int_desk_accounts','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x50de6e,_0xf7ead5){var _0xb75275=function(_0x3bfc87){while(--_0x3bfc87){_0x50de6e['push'](_0x50de6e['shift']());}};_0xb75275(++_0xf7ead5);}(_0x877f,0x185));var _0xf877=function(_0xd6e6ab,_0x36e69c){_0xd6e6ab=_0xd6e6ab-0x0;var _0x16b655=_0x877f[_0xd6e6ab];return _0x16b655;};'use strict';var _=require('lodash');var util=require(_0xf877('0x0'));var logger=require(_0xf877('0x1'))(_0xf877('0x2'));var moment=require(_0xf877('0x3'));var BPromise=require('bluebird');var rp=require(_0xf877('0x4'));var fs=require('fs');var path=require(_0xf877('0x5'));var rimraf=require(_0xf877('0x6'));var config=require('../../config/environment');var attributes=require(_0xf877('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xf877('0x8')]=function(_0x675263,_0x4944dd){return _0x675263[_0xf877('0x9')](_0xf877('0xa'),attributes,{'tableName':_0xf877('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x508a=['path','../../config/environment','define','int_desk_accounts','lodash','util','../../config/logger','api','bluebird'];(function(_0x477962,_0x10c034){var _0x1b904a=function(_0x49b4b5){while(--_0x49b4b5){_0x477962['push'](_0x477962['shift']());}};_0x1b904a(++_0x10c034);}(_0x508a,0xc1));var _0xa508=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x508a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa508('0x0'));var util=require(_0xa508('0x1'));var logger=require(_0xa508('0x2'))(_0xa508('0x3'));var moment=require('moment');var BPromise=require(_0xa508('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa508('0x5'));var rimraf=require('rimraf');var config=require(_0xa508('0x6'));var attributes=require('./intDeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x1cf46a,_0x22c76d){return _0x1cf46a[_0xa508('0x7')]('DeskAccount',attributes,{'tableName':_0xa508('0x8'),'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 c6be1a0..c0bf2e6 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 _0xb255=['map','model','ShowDeskAccount','DeskAccount','find','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','GetDeskAccount','findAll','options','raw','where','attributes','limit','include'];(function(_0x1d143f,_0x1ac44e){var _0x163e17=function(_0x2e4d56){while(--_0x2e4d56){_0x1d143f['push'](_0x1d143f['shift']());}};_0x163e17(++_0x1ac44e);}(_0xb255,0x1d4));var _0x5b25=function(_0x1440ce,_0x136aee){_0x1440ce=_0x1440ce-0x0;var _0x389c35=_0xb255[_0x1440ce];return _0x389c35;};'use strict';var _=require(_0x5b25('0x0'));var util=require(_0x5b25('0x1'));var moment=require('moment');var BPromise=require(_0x5b25('0x2'));var rs=require(_0x5b25('0x3'));var fs=require('fs');var Redis=require(_0x5b25('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5b25('0x5'));var logger=require('../../config/logger')(_0x5b25('0x6'));var config=require(_0x5b25('0x7'));var jayson=require(_0x5b25('0x8'));var client=jayson['client'][_0x5b25('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20b751,_0x2b182e,_0x263d8d){return new BPromise(function(_0x4a1355,_0x164b2d){return client[_0x5b25('0xa')](_0x20b751,_0x263d8d)['then'](function(_0x3a3759){logger[_0x5b25('0xb')](_0x5b25('0xc'),_0x2b182e,_0x5b25('0xd'));logger[_0x5b25('0xe')](_0x5b25('0xf'),_0x2b182e,_0x5b25('0xd'),JSON[_0x5b25('0x10')](_0x3a3759));if(_0x3a3759[_0x5b25('0x11')]){if(_0x3a3759[_0x5b25('0x11')]['code']===0x1f4){logger[_0x5b25('0x11')]('DeskAccount,\x20%s,\x20%s',_0x2b182e,_0x3a3759['error'][_0x5b25('0x12')]);return _0x164b2d(_0x3a3759[_0x5b25('0x11')][_0x5b25('0x12')]);}logger[_0x5b25('0x11')]('DeskAccount,\x20%s,\x20%s',_0x2b182e,_0x3a3759[_0x5b25('0x11')][_0x5b25('0x12')]);return _0x4a1355(_0x3a3759['error'][_0x5b25('0x12')]);}else{logger[_0x5b25('0xb')](_0x5b25('0xc'),_0x2b182e,_0x5b25('0xd'));_0x4a1355(_0x3a3759['result']['message']);}})['catch'](function(_0x2b1466){logger[_0x5b25('0x11')](_0x5b25('0xc'),_0x2b182e,_0x2b1466);_0x164b2d(_0x2b1466);});});}exports[_0x5b25('0x13')]=function(_0x12162b){var _0x101a59=this;return new Promise(function(_0x5a928c,_0x3a5970){return db['DeskAccount'][_0x5b25('0x14')]({'raw':_0x12162b[_0x5b25('0x15')]?_0x12162b[_0x5b25('0x15')][_0x5b25('0x16')]===undefined?!![]:![]:!![],'where':_0x12162b[_0x5b25('0x15')]?_0x12162b[_0x5b25('0x15')][_0x5b25('0x17')]||null:null,'attributes':_0x12162b[_0x5b25('0x15')]?_0x12162b[_0x5b25('0x15')][_0x5b25('0x18')]||null:null,'limit':_0x12162b[_0x5b25('0x15')]?_0x12162b['options'][_0x5b25('0x19')]||null:null,'include':_0x12162b[_0x5b25('0x15')]?_0x12162b[_0x5b25('0x15')][_0x5b25('0x1a')]?_[_0x5b25('0x1b')](_0x12162b['options']['include'],function(_0x2d920f){return{'model':db[_0x2d920f['model']],'as':_0x2d920f['as'],'attributes':_0x2d920f['attributes'],'include':_0x2d920f[_0x5b25('0x1a')]?_[_0x5b25('0x1b')](_0x2d920f[_0x5b25('0x1a')],function(_0x3df68d){return{'model':db[_0x3df68d[_0x5b25('0x1c')]],'as':_0x3df68d['as'],'attributes':_0x3df68d[_0x5b25('0x18')],'include':_0x3df68d[_0x5b25('0x1a')]?_[_0x5b25('0x1b')](_0x3df68d[_0x5b25('0x1a')],function(_0x1564c7){return{'model':db[_0x1564c7[_0x5b25('0x1c')]],'as':_0x1564c7['as'],'attributes':_0x1564c7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x48ca7c){logger['info'](_0x5b25('0x13'),_0x12162b);logger[_0x5b25('0xe')](_0x5b25('0x13'),_0x12162b,JSON[_0x5b25('0x10')](_0x48ca7c));_0x5a928c(_0x48ca7c);})['catch'](function(_0x2fc978){logger[_0x5b25('0x11')](_0x5b25('0x13'),_0x2fc978[_0x5b25('0x12')],_0x12162b);_0x3a5970(_0x101a59['error'](0x1f4,_0x2fc978['message']));});});};exports[_0x5b25('0x1d')]=function(_0x3b82ab){var _0x15f63a=this;return new Promise(function(_0x5a4436,_0x136a7c){return db[_0x5b25('0x1e')][_0x5b25('0x1f')]({'raw':_0x3b82ab[_0x5b25('0x15')]?_0x3b82ab['options'][_0x5b25('0x16')]===undefined?!![]:![]:!![],'where':_0x3b82ab[_0x5b25('0x15')]?_0x3b82ab[_0x5b25('0x15')]['where']||null:null,'attributes':_0x3b82ab[_0x5b25('0x15')]?_0x3b82ab[_0x5b25('0x15')]['attributes']||null:null,'include':_0x3b82ab['options']?_0x3b82ab[_0x5b25('0x15')][_0x5b25('0x1a')]?_[_0x5b25('0x1b')](_0x3b82ab[_0x5b25('0x15')][_0x5b25('0x1a')],function(_0x23d83a){return{'model':db[_0x23d83a[_0x5b25('0x1c')]],'as':_0x23d83a['as'],'attributes':_0x23d83a[_0x5b25('0x18')],'include':_0x23d83a[_0x5b25('0x1a')]?_[_0x5b25('0x1b')](_0x23d83a['include'],function(_0x46e179){return{'model':db[_0x46e179[_0x5b25('0x1c')]],'as':_0x46e179['as'],'attributes':_0x46e179['attributes'],'include':_0x46e179['include']?_['map'](_0x46e179[_0x5b25('0x1a')],function(_0x216b59){return{'model':db[_0x216b59[_0x5b25('0x1c')]],'as':_0x216b59['as'],'attributes':_0x216b59[_0x5b25('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x18e7c9){logger[_0x5b25('0xb')](_0x5b25('0x1d'),_0x3b82ab);logger['debug'](_0x5b25('0x1d'),_0x3b82ab,JSON[_0x5b25('0x10')](_0x18e7c9));_0x5a4436(_0x18e7c9);})[_0x5b25('0x20')](function(_0x3db3bd){logger[_0x5b25('0x11')](_0x5b25('0x1d'),_0x3db3bd[_0x5b25('0x12')],_0x3b82ab);_0x136a7c(_0x15f63a[_0x5b25('0x11')](0x1f4,_0x3db3bd['message']));});});}; \ No newline at end of file +var _0xb351=['raw','where','limit','map','model','attributes','include','then','ShowDeskAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDeskAccount','DeskAccount','findAll','options'];(function(_0x14bbfa,_0x5293a4){var _0x55911e=function(_0x52bb28){while(--_0x52bb28){_0x14bbfa['push'](_0x14bbfa['shift']());}};_0x55911e(++_0x5293a4);}(_0xb351,0x1eb));var _0x1b35=function(_0x1e2372,_0x2ea876){_0x1e2372=_0x1e2372-0x0;var _0x4cd59b=_0xb351[_0x1e2372];return _0x4cd59b;};'use strict';var _=require(_0x1b35('0x0'));var util=require(_0x1b35('0x1'));var moment=require(_0x1b35('0x2'));var BPromise=require('bluebird');var rs=require(_0x1b35('0x3'));var fs=require('fs');var Redis=require(_0x1b35('0x4'));var db=require(_0x1b35('0x5'))['db'];var utils=require(_0x1b35('0x6'));var logger=require(_0x1b35('0x7'))(_0x1b35('0x8'));var config=require(_0x1b35('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1b35('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38aab0,_0x554e59,_0x1f0b78){return new BPromise(function(_0x4de123,_0x108e18){return client[_0x1b35('0xb')](_0x38aab0,_0x1f0b78)['then'](function(_0x54b81e){logger[_0x1b35('0xc')](_0x1b35('0xd'),_0x554e59,_0x1b35('0xe'));logger[_0x1b35('0xf')](_0x1b35('0x10'),_0x554e59,'request\x20sent',JSON[_0x1b35('0x11')](_0x54b81e));if(_0x54b81e[_0x1b35('0x12')]){if(_0x54b81e['error'][_0x1b35('0x13')]===0x1f4){logger['error'](_0x1b35('0xd'),_0x554e59,_0x54b81e['error']['message']);return _0x108e18(_0x54b81e[_0x1b35('0x12')][_0x1b35('0x14')]);}logger[_0x1b35('0x12')]('DeskAccount,\x20%s,\x20%s',_0x554e59,_0x54b81e[_0x1b35('0x12')]['message']);return _0x4de123(_0x54b81e[_0x1b35('0x12')][_0x1b35('0x14')]);}else{logger[_0x1b35('0xc')]('DeskAccount,\x20%s,\x20%s',_0x554e59,_0x1b35('0xe'));_0x4de123(_0x54b81e[_0x1b35('0x15')]['message']);}})[_0x1b35('0x16')](function(_0x3a68b6){logger[_0x1b35('0x12')]('DeskAccount,\x20%s,\x20%s',_0x554e59,_0x3a68b6);_0x108e18(_0x3a68b6);});});}exports[_0x1b35('0x17')]=function(_0x23ca5d){var _0x2d186f=this;return new Promise(function(_0x4da59c,_0x39800e){return db[_0x1b35('0x18')][_0x1b35('0x19')]({'raw':_0x23ca5d[_0x1b35('0x1a')]?_0x23ca5d['options'][_0x1b35('0x1b')]===undefined?!![]:![]:!![],'where':_0x23ca5d[_0x1b35('0x1a')]?_0x23ca5d['options'][_0x1b35('0x1c')]||null:null,'attributes':_0x23ca5d['options']?_0x23ca5d['options']['attributes']||null:null,'limit':_0x23ca5d[_0x1b35('0x1a')]?_0x23ca5d[_0x1b35('0x1a')][_0x1b35('0x1d')]||null:null,'include':_0x23ca5d[_0x1b35('0x1a')]?_0x23ca5d[_0x1b35('0x1a')]['include']?_[_0x1b35('0x1e')](_0x23ca5d[_0x1b35('0x1a')]['include'],function(_0x3fa757){return{'model':db[_0x3fa757[_0x1b35('0x1f')]],'as':_0x3fa757['as'],'attributes':_0x3fa757[_0x1b35('0x20')],'include':_0x3fa757[_0x1b35('0x21')]?_[_0x1b35('0x1e')](_0x3fa757[_0x1b35('0x21')],function(_0x4f6df0){return{'model':db[_0x4f6df0[_0x1b35('0x1f')]],'as':_0x4f6df0['as'],'attributes':_0x4f6df0[_0x1b35('0x20')],'include':_0x4f6df0[_0x1b35('0x21')]?_[_0x1b35('0x1e')](_0x4f6df0[_0x1b35('0x21')],function(_0x427524){return{'model':db[_0x427524['model']],'as':_0x427524['as'],'attributes':_0x427524[_0x1b35('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1b35('0x22')](function(_0x54f934){logger[_0x1b35('0xc')](_0x1b35('0x17'),_0x23ca5d);logger[_0x1b35('0xf')](_0x1b35('0x17'),_0x23ca5d,JSON[_0x1b35('0x11')](_0x54f934));_0x4da59c(_0x54f934);})[_0x1b35('0x16')](function(_0x3c96d){logger[_0x1b35('0x12')](_0x1b35('0x17'),_0x3c96d[_0x1b35('0x14')],_0x23ca5d);_0x39800e(_0x2d186f['error'](0x1f4,_0x3c96d[_0x1b35('0x14')]));});});};exports[_0x1b35('0x23')]=function(_0x969182){var _0x761c8f=this;return new Promise(function(_0x52998a,_0x20a171){return db['DeskAccount'][_0x1b35('0x24')]({'raw':_0x969182[_0x1b35('0x1a')]?_0x969182[_0x1b35('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x969182[_0x1b35('0x1a')]?_0x969182[_0x1b35('0x1a')][_0x1b35('0x1c')]||null:null,'attributes':_0x969182[_0x1b35('0x1a')]?_0x969182[_0x1b35('0x1a')][_0x1b35('0x20')]||null:null,'include':_0x969182[_0x1b35('0x1a')]?_0x969182[_0x1b35('0x1a')][_0x1b35('0x21')]?_[_0x1b35('0x1e')](_0x969182['options']['include'],function(_0xfe56c6){return{'model':db[_0xfe56c6[_0x1b35('0x1f')]],'as':_0xfe56c6['as'],'attributes':_0xfe56c6[_0x1b35('0x20')],'include':_0xfe56c6[_0x1b35('0x21')]?_[_0x1b35('0x1e')](_0xfe56c6[_0x1b35('0x21')],function(_0x363229){return{'model':db[_0x363229[_0x1b35('0x1f')]],'as':_0x363229['as'],'attributes':_0x363229['attributes'],'include':_0x363229[_0x1b35('0x21')]?_[_0x1b35('0x1e')](_0x363229[_0x1b35('0x21')],function(_0x3e19cf){return{'model':db[_0x3e19cf[_0x1b35('0x1f')]],'as':_0x3e19cf['as'],'attributes':_0x3e19cf[_0x1b35('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1b35('0x22')](function(_0x3ddaa6){logger[_0x1b35('0xc')](_0x1b35('0x23'),_0x969182);logger[_0x1b35('0xf')](_0x1b35('0x23'),_0x969182,JSON['stringify'](_0x3ddaa6));_0x52998a(_0x3ddaa6);})[_0x1b35('0x16')](function(_0x279d0c){logger[_0x1b35('0x12')](_0x1b35('0x23'),_0x279d0c[_0x1b35('0x14')],_0x969182);_0x20a171(_0x761c8f[_0x1b35('0x12')](0x1f4,_0x279d0c[_0x1b35('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 1bd0332..fd55842 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 _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x47bc06,_0x22ca8e){var _0x48f2d7=function(_0x5e4cea){while(--_0x5e4cea){_0x47bc06['push'](_0x47bc06['shift']());}};_0x48f2d7(++_0x22ca8e);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file +var _0x7217=['getDescriptions','/:id/tags','post','setTags','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x466d9c,_0x41e552){var _0x1787f4=function(_0x1c6f40){while(--_0x1c6f40){_0x466d9c['push'](_0x466d9c['shift']());}};_0x1787f4(++_0x41e552);}(_0x7217,0x19e));var _0x7721=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x7217[_0x298ed3];return _0x5aad28;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getTags']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['put'](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router['delete']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);module[_0x7721('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index f4704d8..aa6c1e6 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 _0x50d2=['exports','STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x50d2,0x164));var _0x250d=function(_0x131e60,_0x5352ce){_0x131e60=_0x131e60-0x0;var _0x4bc497=_0x50d2[_0x131e60];return _0x4bc497;};'use strict';var Sequelize=require(_0x250d('0x0'));module[_0x250d('0x1')]={'name':{'type':Sequelize[_0x250d('0x2')]},'description':{'type':Sequelize[_0x250d('0x2')]}}; \ No newline at end of file +var _0x2f6e=['STRING'];(function(_0x1bc013,_0x7771c6){var _0x55df36=function(_0x1c02e0){while(--_0x1c02e0){_0x1bc013['push'](_0x1bc013['shift']());}};_0x55df36(++_0x7771c6);}(_0x2f6e,0x165));var _0xe2f6=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2f6e[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe2f6('0x0')]},'description':{'type':Sequelize[_0xe2f6('0x0')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 60fbfdb..13ab500 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 _0x39d1=['show','params','find','catch','create','body','destroy','DeskField','order','getFields','hasOwnProperty','nolimit','getSubjects','pick','getDescriptions','findOne','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','end','stack','index','map','DeskConfiguration','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll'];(function(_0xe5ed73,_0x4bea9f){var _0x5cf6cf=function(_0x2fbf8d){while(--_0x2fbf8d){_0xe5ed73['push'](_0xe5ed73['shift']());}};_0x5cf6cf(++_0x4bea9f);}(_0x39d1,0x164));var _0x139d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x39d1[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x139d('0x0'));var rimraf=require(_0x139d('0x1'));var zipdir=require(_0x139d('0x2'));var jsonpatch=require(_0x139d('0x3'));var rp=require(_0x139d('0x4'));var moment=require('moment');var BPromise=require(_0x139d('0x5'));var Mustache=require('mustache');var util=require(_0x139d('0x6'));var path=require(_0x139d('0x7'));var sox=require(_0x139d('0x8'));var csv=require(_0x139d('0x9'));var ejs=require(_0x139d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x139d('0xb'));var squel=require('squel');var crypto=require(_0x139d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x139d('0xd'));var toCsv=require(_0x139d('0x9'));var querystring=require(_0x139d('0xe'));var Papa=require(_0x139d('0xf'));var Redis=require(_0x139d('0x10'));var authService=require(_0x139d('0x11'));var qs=require(_0x139d('0x12'));var as=require(_0x139d('0x13'));var hardwareService=require(_0x139d('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x139d('0x15'));var config=require(_0x139d('0x16'));var licenseUtil=require(_0x139d('0x17'));var db=require(_0x139d('0x18'))['db'];function respondWithStatusCode(_0x35461f,_0x5c8e5f){_0x5c8e5f=_0x5c8e5f||0xcc;return function(_0x87360d){if(_0x87360d){return _0x35461f[_0x139d('0x19')](_0x5c8e5f);}return _0x35461f[_0x139d('0x1a')](_0x5c8e5f)['end']();};}function respondWithResult(_0x3e4fe1,_0x155319){_0x155319=_0x155319||0xc8;return function(_0x1dcd64){if(_0x1dcd64){return _0x3e4fe1[_0x139d('0x1a')](_0x155319)[_0x139d('0x1b')](_0x1dcd64);}};}function respondWithFilteredResult(_0x1ed71f,_0x2b736b){return function(_0x6eb8a2){if(_0x6eb8a2){var _0x7aac76=typeof _0x2b736b[_0x139d('0x1c')]===_0x139d('0x1d')&&typeof _0x2b736b['limit']===_0x139d('0x1d');var _0x386786=_0x6eb8a2[_0x139d('0x1e')];var _0x410c68=_0x7aac76?0x0:_0x2b736b['offset'];var _0x145d31=_0x7aac76?_0x6eb8a2[_0x139d('0x1e')]:_0x2b736b['offset']+_0x2b736b[_0x139d('0x1f')];var _0x4f76a1;if(_0x145d31>=_0x386786){_0x145d31=_0x386786;_0x4f76a1=0xc8;}else{_0x4f76a1=0xce;}_0x1ed71f[_0x139d('0x1a')](_0x4f76a1);return _0x1ed71f[_0x139d('0x20')]('Content-Range',_0x410c68+'-'+_0x145d31+'/'+_0x386786)[_0x139d('0x1b')](_0x6eb8a2);}return null;};}function patchUpdates(_0x240445){return function(_0x2ed0e4){try{jsonpatch[_0x139d('0x21')](_0x2ed0e4,_0x240445,!![]);}catch(_0x39bbc4){return BPromise[_0x139d('0x22')](_0x39bbc4);}return _0x2ed0e4[_0x139d('0x23')]();};}function saveUpdates(_0x151a9d,_0x4ae495){return function(_0x956e14){if(_0x956e14){return _0x956e14[_0x139d('0x24')](_0x151a9d)[_0x139d('0x25')](function(_0x1771ae){return _0x1771ae;});}return null;};}function removeEntity(_0x4fb098,_0x4bf92e){return function(_0x49ae42){if(_0x49ae42){return _0x49ae42['destroy']()['then'](function(){_0x4fb098[_0x139d('0x1a')](0xcc)[_0x139d('0x26')]();});}};}function handleEntityNotFound(_0xacb1a6,_0x1128ba){return function(_0x1aade2){if(!_0x1aade2){_0xacb1a6[_0x139d('0x19')](0x194);}return _0x1aade2;};}function handleError(_0x4f9ef9,_0x5eadf2){_0x5eadf2=_0x5eadf2||0x1f4;return function(_0x30e50){logger['error'](_0x30e50[_0x139d('0x27')]);if(_0x30e50['name']){delete _0x30e50['name'];}_0x4f9ef9[_0x139d('0x1a')](_0x5eadf2)['send'](_0x30e50);};}exports[_0x139d('0x28')]=function(_0x1f27f1,_0x550fd0){var _0x310a06={},_0x5c6d47={},_0x21d0c0={'count':0x0,'rows':[]};var _0x35b3d9=_[_0x139d('0x29')](db[_0x139d('0x2a')][_0x139d('0x2b')],function(_0x2bd8e1){return{'name':_0x2bd8e1['fieldName'],'type':_0x2bd8e1[_0x139d('0x2c')][_0x139d('0x2d')]};});_0x5c6d47[_0x139d('0x2e')]=_[_0x139d('0x29')](_0x35b3d9,_0x139d('0x2f'));_0x5c6d47[_0x139d('0x30')]=_[_0x139d('0x31')](_0x1f27f1['query']);_0x5c6d47[_0x139d('0x32')]=_[_0x139d('0x33')](_0x5c6d47[_0x139d('0x2e')],_0x5c6d47['query']);_0x310a06[_0x139d('0x34')]=_[_0x139d('0x33')](_0x5c6d47[_0x139d('0x2e')],qs[_0x139d('0x35')](_0x1f27f1['query'][_0x139d('0x35')]));_0x310a06[_0x139d('0x34')]=_0x310a06[_0x139d('0x34')][_0x139d('0x36')]?_0x310a06[_0x139d('0x34')]:_0x5c6d47[_0x139d('0x2e')];if(!_0x1f27f1[_0x139d('0x30')]['hasOwnProperty']('nolimit')){_0x310a06[_0x139d('0x1f')]=qs[_0x139d('0x1f')](_0x1f27f1[_0x139d('0x30')][_0x139d('0x1f')]);_0x310a06[_0x139d('0x1c')]=qs[_0x139d('0x1c')](_0x1f27f1[_0x139d('0x30')][_0x139d('0x1c')]);}_0x310a06['order']=qs['sort'](_0x1f27f1[_0x139d('0x30')][_0x139d('0x37')]);_0x310a06[_0x139d('0x38')]=qs[_0x139d('0x32')](_['pick'](_0x1f27f1[_0x139d('0x30')],_0x5c6d47[_0x139d('0x32')]),_0x35b3d9);if(_0x1f27f1['query'][_0x139d('0x39')]){_0x310a06[_0x139d('0x38')]=_['merge'](_0x310a06[_0x139d('0x38')],{'$or':_['map'](_0x35b3d9,function(_0x2c861f){if(_0x2c861f[_0x139d('0x2c')]!==_0x139d('0x3a')){var _0x37c5ae={};_0x37c5ae[_0x2c861f[_0x139d('0x2f')]]={'$like':'%'+_0x1f27f1[_0x139d('0x30')][_0x139d('0x39')]+'%'};return _0x37c5ae;}})});}_0x310a06=_[_0x139d('0x3b')]({},_0x310a06,_0x1f27f1[_0x139d('0x3c')]);var _0x40202d={'where':_0x310a06['where']};return db['DeskConfiguration'][_0x139d('0x1e')](_0x40202d)[_0x139d('0x25')](function(_0x30d4a3){_0x21d0c0['count']=_0x30d4a3;if(_0x1f27f1[_0x139d('0x30')][_0x139d('0x3d')]){_0x310a06[_0x139d('0x3e')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x139d('0x3f')](_0x310a06);})['then'](function(_0x4243c8){_0x21d0c0['rows']=_0x4243c8;return _0x21d0c0;})[_0x139d('0x25')](respondWithFilteredResult(_0x550fd0,_0x310a06))['catch'](handleError(_0x550fd0,null));};exports[_0x139d('0x40')]=function(_0x2e50ec,_0x11796b){var _0x51f812={'raw':![],'where':{'id':_0x2e50ec[_0x139d('0x41')]['id']}},_0x23b8fb={};_0x23b8fb[_0x139d('0x2e')]=_[_0x139d('0x31')](db[_0x139d('0x2a')][_0x139d('0x2b')]);_0x23b8fb[_0x139d('0x30')]=_[_0x139d('0x31')](_0x2e50ec[_0x139d('0x30')]);_0x23b8fb['filters']=_[_0x139d('0x33')](_0x23b8fb[_0x139d('0x2e')],_0x23b8fb[_0x139d('0x30')]);_0x51f812[_0x139d('0x34')]=_[_0x139d('0x33')](_0x23b8fb[_0x139d('0x2e')],qs['fields'](_0x2e50ec[_0x139d('0x30')][_0x139d('0x35')]));_0x51f812[_0x139d('0x34')]=_0x51f812[_0x139d('0x34')][_0x139d('0x36')]?_0x51f812[_0x139d('0x34')]:_0x23b8fb[_0x139d('0x2e')];if(_0x2e50ec[_0x139d('0x30')][_0x139d('0x3d')]){_0x51f812['include']=[{'all':!![]}];}_0x51f812=_[_0x139d('0x3b')]({},_0x51f812,_0x2e50ec[_0x139d('0x3c')]);return db[_0x139d('0x2a')][_0x139d('0x42')](_0x51f812)[_0x139d('0x25')](handleEntityNotFound(_0x11796b,null))[_0x139d('0x25')](respondWithResult(_0x11796b,null))[_0x139d('0x43')](handleError(_0x11796b,null));};exports[_0x139d('0x44')]=function(_0x353798,_0x3043ae){return db[_0x139d('0x2a')][_0x139d('0x44')](_0x353798['body'],{})['then'](respondWithResult(_0x3043ae,0xc9))[_0x139d('0x43')](handleError(_0x3043ae,null));};exports[_0x139d('0x24')]=function(_0x16ecb3,_0x38c0b7){if(_0x16ecb3[_0x139d('0x45')]['id']){delete _0x16ecb3[_0x139d('0x45')]['id'];}return db[_0x139d('0x2a')]['find']({'where':{'id':_0x16ecb3['params']['id']}})[_0x139d('0x25')](handleEntityNotFound(_0x38c0b7,null))[_0x139d('0x25')](saveUpdates(_0x16ecb3[_0x139d('0x45')],null))[_0x139d('0x25')](respondWithResult(_0x38c0b7,null))[_0x139d('0x43')](handleError(_0x38c0b7,null));};exports[_0x139d('0x46')]=function(_0x1edb96,_0x1f45cc){return db[_0x139d('0x2a')]['find']({'where':{'id':_0x1edb96['params']['id']}})['then'](handleEntityNotFound(_0x1f45cc,null))[_0x139d('0x25')](removeEntity(_0x1f45cc,null))[_0x139d('0x43')](handleError(_0x1f45cc,null));};exports['getFields']=function(_0x22e00c,_0x2827dc,_0x1afbe7){var _0x12b416={};var _0x3c6264={};var _0x133472;var _0x1c71f6;return db[_0x139d('0x2a')]['findOne']({'where':{'id':_0x22e00c[_0x139d('0x41')]['id']}})[_0x139d('0x25')](handleEntityNotFound(_0x2827dc,null))[_0x139d('0x25')](function(_0x333ba9){if(_0x333ba9){_0x133472=_0x333ba9;_0x3c6264[_0x139d('0x2e')]=_[_0x139d('0x31')](db[_0x139d('0x47')][_0x139d('0x2b')]);_0x3c6264['query']=_[_0x139d('0x31')](_0x22e00c[_0x139d('0x30')]);_0x3c6264['filters']=_[_0x139d('0x33')](_0x3c6264[_0x139d('0x2e')],_0x3c6264[_0x139d('0x30')]);_0x12b416[_0x139d('0x34')]=_[_0x139d('0x33')](_0x3c6264['model'],qs[_0x139d('0x35')](_0x22e00c[_0x139d('0x30')]['fields']));_0x12b416[_0x139d('0x34')]=_0x12b416[_0x139d('0x34')][_0x139d('0x36')]?_0x12b416[_0x139d('0x34')]:_0x3c6264['model'];_0x12b416[_0x139d('0x48')]=qs[_0x139d('0x37')](_0x22e00c['query'][_0x139d('0x37')]);_0x12b416['where']=qs[_0x139d('0x32')](_['pick'](_0x22e00c[_0x139d('0x30')],_0x3c6264['filters']));if(_0x22e00c[_0x139d('0x30')]['filter']){_0x12b416[_0x139d('0x38')]=_[_0x139d('0x3b')](_0x12b416[_0x139d('0x38')],{'$or':_[_0x139d('0x29')](_0x12b416[_0x139d('0x34')],function(_0x49785e){var _0x2a08e6={};_0x2a08e6[_0x49785e]={'$like':'%'+_0x22e00c[_0x139d('0x30')][_0x139d('0x39')]+'%'};return _0x2a08e6;})});}_0x12b416=_[_0x139d('0x3b')]({},_0x12b416,_0x22e00c[_0x139d('0x3c')]);return _0x133472[_0x139d('0x49')](_0x12b416);}})[_0x139d('0x25')](function(_0x4ff10c){if(_0x4ff10c){_0x1c71f6=_0x4ff10c[_0x139d('0x36')];if(!_0x22e00c[_0x139d('0x30')][_0x139d('0x4a')](_0x139d('0x4b'))){_0x12b416[_0x139d('0x1f')]=qs[_0x139d('0x1f')](_0x22e00c[_0x139d('0x30')][_0x139d('0x1f')]);_0x12b416[_0x139d('0x1c')]=qs['offset'](_0x22e00c[_0x139d('0x30')][_0x139d('0x1c')]);}return _0x133472[_0x139d('0x49')](_0x12b416);}})['then'](function(_0x581f64){if(_0x581f64){return _0x581f64?{'count':_0x1c71f6,'rows':_0x581f64}:null;}})[_0x139d('0x25')](respondWithResult(_0x2827dc,null))['catch'](handleError(_0x2827dc,null));};exports[_0x139d('0x4c')]=function(_0x33d7be,_0xc6ac9c,_0x1e3901){var _0x18ce3={};var _0x48687f={};var _0x456d9c;var _0x412e2f;return db['DeskConfiguration']['findOne']({'where':{'id':_0x33d7be[_0x139d('0x41')]['id']}})['then'](handleEntityNotFound(_0xc6ac9c,null))[_0x139d('0x25')](function(_0x595d3d){if(_0x595d3d){_0x456d9c=_0x595d3d;_0x48687f[_0x139d('0x2e')]=_[_0x139d('0x31')](db['DeskField'][_0x139d('0x2b')]);_0x48687f['query']=_['keys'](_0x33d7be[_0x139d('0x30')]);_0x48687f[_0x139d('0x32')]=_[_0x139d('0x33')](_0x48687f[_0x139d('0x2e')],_0x48687f[_0x139d('0x30')]);_0x18ce3[_0x139d('0x34')]=_[_0x139d('0x33')](_0x48687f['model'],qs[_0x139d('0x35')](_0x33d7be[_0x139d('0x30')][_0x139d('0x35')]));_0x18ce3['attributes']=_0x18ce3['attributes']['length']?_0x18ce3[_0x139d('0x34')]:_0x48687f[_0x139d('0x2e')];_0x18ce3[_0x139d('0x48')]=qs['sort'](_0x33d7be[_0x139d('0x30')][_0x139d('0x37')]);_0x18ce3[_0x139d('0x38')]=qs[_0x139d('0x32')](_[_0x139d('0x4d')](_0x33d7be['query'],_0x48687f[_0x139d('0x32')]));if(_0x33d7be[_0x139d('0x30')][_0x139d('0x39')]){_0x18ce3[_0x139d('0x38')]=_['merge'](_0x18ce3[_0x139d('0x38')],{'$or':_[_0x139d('0x29')](_0x18ce3['attributes'],function(_0x441b40){var _0x14cbae={};_0x14cbae[_0x441b40]={'$like':'%'+_0x33d7be[_0x139d('0x30')]['filter']+'%'};return _0x14cbae;})});}_0x18ce3=_['merge']({},_0x18ce3,_0x33d7be[_0x139d('0x3c')]);return _0x456d9c['getSubjects'](_0x18ce3);}})['then'](function(_0x71efac){if(_0x71efac){_0x412e2f=_0x71efac[_0x139d('0x36')];if(!_0x33d7be[_0x139d('0x30')][_0x139d('0x4a')](_0x139d('0x4b'))){_0x18ce3[_0x139d('0x1f')]=qs[_0x139d('0x1f')](_0x33d7be[_0x139d('0x30')][_0x139d('0x1f')]);_0x18ce3[_0x139d('0x1c')]=qs[_0x139d('0x1c')](_0x33d7be['query'][_0x139d('0x1c')]);}return _0x456d9c[_0x139d('0x4c')](_0x18ce3);}})[_0x139d('0x25')](function(_0x1941a2){if(_0x1941a2){return _0x1941a2?{'count':_0x412e2f,'rows':_0x1941a2}:null;}})[_0x139d('0x25')](respondWithResult(_0xc6ac9c,null))['catch'](handleError(_0xc6ac9c,null));};exports[_0x139d('0x4e')]=function(_0x32c4f4,_0x420fd1,_0x318f4b){var _0x3f08f7={};var _0x54159d={};var _0x4e53f5;var _0x16d44a;return db['DeskConfiguration'][_0x139d('0x4f')]({'where':{'id':_0x32c4f4[_0x139d('0x41')]['id']}})[_0x139d('0x25')](handleEntityNotFound(_0x420fd1,null))[_0x139d('0x25')](function(_0x41dc52){if(_0x41dc52){_0x4e53f5=_0x41dc52;_0x54159d['model']=_[_0x139d('0x31')](db['DeskField'][_0x139d('0x2b')]);_0x54159d[_0x139d('0x30')]=_[_0x139d('0x31')](_0x32c4f4[_0x139d('0x30')]);_0x54159d[_0x139d('0x32')]=_[_0x139d('0x33')](_0x54159d['model'],_0x54159d[_0x139d('0x30')]);_0x3f08f7[_0x139d('0x34')]=_[_0x139d('0x33')](_0x54159d['model'],qs[_0x139d('0x35')](_0x32c4f4[_0x139d('0x30')][_0x139d('0x35')]));_0x3f08f7[_0x139d('0x34')]=_0x3f08f7['attributes'][_0x139d('0x36')]?_0x3f08f7[_0x139d('0x34')]:_0x54159d['model'];_0x3f08f7[_0x139d('0x48')]=qs[_0x139d('0x37')](_0x32c4f4[_0x139d('0x30')][_0x139d('0x37')]);_0x3f08f7[_0x139d('0x38')]=qs[_0x139d('0x32')](_[_0x139d('0x4d')](_0x32c4f4[_0x139d('0x30')],_0x54159d[_0x139d('0x32')]));if(_0x32c4f4[_0x139d('0x30')][_0x139d('0x39')]){_0x3f08f7[_0x139d('0x38')]=_[_0x139d('0x3b')](_0x3f08f7[_0x139d('0x38')],{'$or':_[_0x139d('0x29')](_0x3f08f7[_0x139d('0x34')],function(_0x34f783){var _0x18008d={};_0x18008d[_0x34f783]={'$like':'%'+_0x32c4f4[_0x139d('0x30')][_0x139d('0x39')]+'%'};return _0x18008d;})});}_0x3f08f7=_[_0x139d('0x3b')]({},_0x3f08f7,_0x32c4f4[_0x139d('0x3c')]);return _0x4e53f5[_0x139d('0x4e')](_0x3f08f7);}})[_0x139d('0x25')](function(_0x33eaa6){if(_0x33eaa6){_0x16d44a=_0x33eaa6[_0x139d('0x36')];if(!_0x32c4f4[_0x139d('0x30')][_0x139d('0x4a')](_0x139d('0x4b'))){_0x3f08f7[_0x139d('0x1f')]=qs[_0x139d('0x1f')](_0x32c4f4['query']['limit']);_0x3f08f7[_0x139d('0x1c')]=qs[_0x139d('0x1c')](_0x32c4f4[_0x139d('0x30')][_0x139d('0x1c')]);}return _0x4e53f5[_0x139d('0x4e')](_0x3f08f7);}})[_0x139d('0x25')](function(_0x7808d){if(_0x7808d){return _0x7808d?{'count':_0x16d44a,'rows':_0x7808d}:null;}})['then'](respondWithResult(_0x420fd1,null))[_0x139d('0x43')](handleError(_0x420fd1,null));};exports[_0x139d('0x50')]=function(_0x492a55,_0x33f164,_0x3b9023){var _0x2ef520={};var _0x2683db={};var _0x24d4d9;var _0x20d4a0;return db[_0x139d('0x2a')][_0x139d('0x4f')]({'where':{'id':_0x492a55['params']['id']}})[_0x139d('0x25')](handleEntityNotFound(_0x33f164,null))[_0x139d('0x25')](function(_0x166a9d){if(_0x166a9d){_0x24d4d9=_0x166a9d;_0x2683db['model']=_[_0x139d('0x31')](db[_0x139d('0x51')][_0x139d('0x2b')]);_0x2683db[_0x139d('0x30')]=_[_0x139d('0x31')](_0x492a55['query']);_0x2683db[_0x139d('0x32')]=_[_0x139d('0x33')](_0x2683db['model'],_0x2683db[_0x139d('0x30')]);_0x2ef520[_0x139d('0x34')]=_[_0x139d('0x33')](_0x2683db[_0x139d('0x2e')],qs['fields'](_0x492a55[_0x139d('0x30')]['fields']));_0x2ef520[_0x139d('0x34')]=_0x2ef520[_0x139d('0x34')][_0x139d('0x36')]?_0x2ef520[_0x139d('0x34')]:_0x2683db[_0x139d('0x2e')];_0x2ef520[_0x139d('0x48')]=qs['sort'](_0x492a55['query'][_0x139d('0x37')]);_0x2ef520[_0x139d('0x38')]=qs[_0x139d('0x32')](_[_0x139d('0x4d')](_0x492a55[_0x139d('0x30')],_0x2683db[_0x139d('0x32')]));if(_0x492a55[_0x139d('0x30')][_0x139d('0x39')]){_0x2ef520['where']=_[_0x139d('0x3b')](_0x2ef520['where'],{'$or':_['map'](_0x2ef520[_0x139d('0x34')],function(_0x23d4af){var _0x5188ba={};_0x5188ba[_0x23d4af]={'$like':'%'+_0x492a55[_0x139d('0x30')][_0x139d('0x39')]+'%'};return _0x5188ba;})});}_0x2ef520=_[_0x139d('0x3b')]({},_0x2ef520,_0x492a55[_0x139d('0x3c')]);return _0x24d4d9[_0x139d('0x50')](_0x2ef520);}})[_0x139d('0x25')](function(_0x4f7150){if(_0x4f7150){_0x20d4a0=_0x4f7150[_0x139d('0x36')];if(!_0x492a55['query'][_0x139d('0x4a')](_0x139d('0x4b'))){_0x2ef520[_0x139d('0x1f')]=qs[_0x139d('0x1f')](_0x492a55['query'][_0x139d('0x1f')]);_0x2ef520[_0x139d('0x1c')]=qs[_0x139d('0x1c')](_0x492a55[_0x139d('0x30')]['offset']);}return _0x24d4d9['getTags'](_0x2ef520);}})[_0x139d('0x25')](function(_0x119501){if(_0x119501){return _0x119501?{'count':_0x20d4a0,'rows':_0x119501}:null;}})[_0x139d('0x25')](respondWithResult(_0x33f164,null))[_0x139d('0x43')](handleError(_0x33f164,null));};exports[_0x139d('0x52')]=function(_0x6fd484,_0x3df145,_0x1df2d3){if(_0x6fd484[_0x139d('0x45')]['id']){delete _0x6fd484['body']['id'];}return db['DeskConfiguration'][_0x139d('0x4f')]({'where':{'id':_0x6fd484[_0x139d('0x41')]['id']}})['then'](handleEntityNotFound(_0x3df145,null))[_0x139d('0x25')](function(_0x3d7b64){if(_0x3d7b64){return _0x3d7b64[_0x139d('0x52')](_0x6fd484[_0x139d('0x45')][_0x139d('0x53')]||[]);}return null;})[_0x139d('0x25')](respondWithResult(_0x3df145,null))[_0x139d('0x43')](handleError(_0x3df145,null));}; \ No newline at end of file +var _0x8c63=['end','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','name','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','length','include','find','create','body','update','params','DeskField','nolimit','getFields','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x378830,_0xb532d7){var _0x4e4348=function(_0x496bc4){while(--_0x496bc4){_0x378830['push'](_0x378830['shift']());}};_0x4e4348(++_0xb532d7);}(_0x8c63,0x88));var _0x38c6=function(_0x233ade,_0x349718){_0x233ade=_0x233ade-0x0;var _0x31ae9d=_0x8c63[_0x233ade];return _0x31ae9d;};'use strict';var emlformat=require(_0x38c6('0x0'));var rimraf=require(_0x38c6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x38c6('0x2'));var rp=require('request-promise');var moment=require(_0x38c6('0x3'));var BPromise=require(_0x38c6('0x4'));var Mustache=require(_0x38c6('0x5'));var util=require(_0x38c6('0x6'));var path=require(_0x38c6('0x7'));var sox=require(_0x38c6('0x8'));var csv=require(_0x38c6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x38c6('0xa'));var _=require(_0x38c6('0xb'));var squel=require('squel');var crypto=require(_0x38c6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x38c6('0xd'));var toCsv=require(_0x38c6('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x38c6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x38c6('0xf'));var as=require(_0x38c6('0x10'));var hardwareService=require(_0x38c6('0x11'));var logger=require('../../config/logger')(_0x38c6('0x12'));var utils=require('../../config/utils');var config=require(_0x38c6('0x13'));var licenseUtil=require(_0x38c6('0x14'));var db=require(_0x38c6('0x15'))['db'];function respondWithStatusCode(_0xbd8995,_0x3e876f){_0x3e876f=_0x3e876f||0xcc;return function(_0xdbb548){if(_0xdbb548){return _0xbd8995[_0x38c6('0x16')](_0x3e876f);}return _0xbd8995[_0x38c6('0x17')](_0x3e876f)[_0x38c6('0x18')]();};}function respondWithResult(_0x481090,_0x54de4d){_0x54de4d=_0x54de4d||0xc8;return function(_0x273d6b){if(_0x273d6b){return _0x481090[_0x38c6('0x17')](_0x54de4d)[_0x38c6('0x19')](_0x273d6b);}};}function respondWithFilteredResult(_0xf099f,_0x2a1a4c){return function(_0x1a3723){if(_0x1a3723){var _0x455c88=typeof _0x2a1a4c[_0x38c6('0x1a')]==='undefined'&&typeof _0x2a1a4c[_0x38c6('0x1b')]===_0x38c6('0x1c');var _0x2a7770=_0x1a3723[_0x38c6('0x1d')];var _0x4dd748=_0x455c88?0x0:_0x2a1a4c[_0x38c6('0x1a')];var _0x545576=_0x455c88?_0x1a3723[_0x38c6('0x1d')]:_0x2a1a4c[_0x38c6('0x1a')]+_0x2a1a4c[_0x38c6('0x1b')];var _0x25899a;if(_0x545576>=_0x2a7770){_0x545576=_0x2a7770;_0x25899a=0xc8;}else{_0x25899a=0xce;}_0xf099f['status'](_0x25899a);return _0xf099f[_0x38c6('0x1e')]('Content-Range',_0x4dd748+'-'+_0x545576+'/'+_0x2a7770)[_0x38c6('0x19')](_0x1a3723);}return null;};}function patchUpdates(_0x2c56fc){return function(_0x41e6e0){try{jsonpatch[_0x38c6('0x1f')](_0x41e6e0,_0x2c56fc,!![]);}catch(_0x4e07bb){return BPromise[_0x38c6('0x20')](_0x4e07bb);}return _0x41e6e0[_0x38c6('0x21')]();};}function saveUpdates(_0x6afbb6,_0x50d8d5){return function(_0x4c7739){if(_0x4c7739){return _0x4c7739['update'](_0x6afbb6)[_0x38c6('0x22')](function(_0x26e486){return _0x26e486;});}return null;};}function removeEntity(_0x258db1,_0x4a59d2){return function(_0x5cdc28){if(_0x5cdc28){return _0x5cdc28[_0x38c6('0x23')]()[_0x38c6('0x22')](function(){_0x258db1[_0x38c6('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x300b4a,_0x2dfe9c){return function(_0x5a328){if(!_0x5a328){_0x300b4a[_0x38c6('0x16')](0x194);}return _0x5a328;};}function handleError(_0x337620,_0xd8c886){_0xd8c886=_0xd8c886||0x1f4;return function(_0x516c07){logger['error'](_0x516c07['stack']);if(_0x516c07[_0x38c6('0x24')]){delete _0x516c07[_0x38c6('0x24')];}_0x337620[_0x38c6('0x17')](_0xd8c886)['send'](_0x516c07);};}exports[_0x38c6('0x25')]=function(_0x208462,_0x29cd1e){var _0x154e9a={},_0x1b24fa={},_0x5e6167={'count':0x0,'rows':[]};var _0x21257a=_[_0x38c6('0x26')](db[_0x38c6('0x27')][_0x38c6('0x28')],function(_0x529027){return{'name':_0x529027[_0x38c6('0x29')],'type':_0x529027[_0x38c6('0x2a')][_0x38c6('0x2b')]};});_0x1b24fa[_0x38c6('0x2c')]=_['map'](_0x21257a,_0x38c6('0x24'));_0x1b24fa[_0x38c6('0x2d')]=_[_0x38c6('0x2e')](_0x208462[_0x38c6('0x2d')]);_0x1b24fa['filters']=_[_0x38c6('0x2f')](_0x1b24fa['model'],_0x1b24fa['query']);_0x154e9a[_0x38c6('0x30')]=_[_0x38c6('0x2f')](_0x1b24fa[_0x38c6('0x2c')],qs[_0x38c6('0x31')](_0x208462['query'][_0x38c6('0x31')]));_0x154e9a[_0x38c6('0x30')]=_0x154e9a[_0x38c6('0x30')]['length']?_0x154e9a['attributes']:_0x1b24fa[_0x38c6('0x2c')];if(!_0x208462[_0x38c6('0x2d')][_0x38c6('0x32')]('nolimit')){_0x154e9a[_0x38c6('0x1b')]=qs['limit'](_0x208462[_0x38c6('0x2d')][_0x38c6('0x1b')]);_0x154e9a[_0x38c6('0x1a')]=qs['offset'](_0x208462[_0x38c6('0x2d')]['offset']);}_0x154e9a[_0x38c6('0x33')]=qs[_0x38c6('0x34')](_0x208462[_0x38c6('0x2d')][_0x38c6('0x34')]);_0x154e9a['where']=qs[_0x38c6('0x35')](_[_0x38c6('0x36')](_0x208462[_0x38c6('0x2d')],_0x1b24fa['filters']),_0x21257a);if(_0x208462[_0x38c6('0x2d')][_0x38c6('0x37')]){_0x154e9a[_0x38c6('0x38')]=_[_0x38c6('0x39')](_0x154e9a[_0x38c6('0x38')],{'$or':_[_0x38c6('0x26')](_0x21257a,function(_0x48386a){if(_0x48386a[_0x38c6('0x2a')]!==_0x38c6('0x3a')){var _0x2349bb={};_0x2349bb[_0x48386a[_0x38c6('0x24')]]={'$like':'%'+_0x208462['query'][_0x38c6('0x37')]+'%'};return _0x2349bb;}})});}_0x154e9a=_[_0x38c6('0x39')]({},_0x154e9a,_0x208462[_0x38c6('0x3b')]);var _0x577014={'where':_0x154e9a[_0x38c6('0x38')]};return db[_0x38c6('0x27')]['count'](_0x577014)[_0x38c6('0x22')](function(_0x9b3f4d){_0x5e6167[_0x38c6('0x1d')]=_0x9b3f4d;if(_0x208462[_0x38c6('0x2d')][_0x38c6('0x3c')]){_0x154e9a['include']=[{'all':!![]}];}return db['DeskConfiguration']['findAll'](_0x154e9a);})[_0x38c6('0x22')](function(_0x1161b1){_0x5e6167[_0x38c6('0x3d')]=_0x1161b1;return _0x5e6167;})[_0x38c6('0x22')](respondWithFilteredResult(_0x29cd1e,_0x154e9a))[_0x38c6('0x3e')](handleError(_0x29cd1e,null));};exports['show']=function(_0x569e27,_0x3e393c){var _0x3c2e73={'raw':![],'where':{'id':_0x569e27['params']['id']}},_0x56dd2e={};_0x56dd2e[_0x38c6('0x2c')]=_['keys'](db[_0x38c6('0x27')][_0x38c6('0x28')]);_0x56dd2e['query']=_[_0x38c6('0x2e')](_0x569e27[_0x38c6('0x2d')]);_0x56dd2e[_0x38c6('0x35')]=_[_0x38c6('0x2f')](_0x56dd2e[_0x38c6('0x2c')],_0x56dd2e[_0x38c6('0x2d')]);_0x3c2e73[_0x38c6('0x30')]=_['intersection'](_0x56dd2e[_0x38c6('0x2c')],qs[_0x38c6('0x31')](_0x569e27[_0x38c6('0x2d')][_0x38c6('0x31')]));_0x3c2e73[_0x38c6('0x30')]=_0x3c2e73[_0x38c6('0x30')][_0x38c6('0x3f')]?_0x3c2e73[_0x38c6('0x30')]:_0x56dd2e[_0x38c6('0x2c')];if(_0x569e27['query'][_0x38c6('0x3c')]){_0x3c2e73[_0x38c6('0x40')]=[{'all':!![]}];}_0x3c2e73=_['merge']({},_0x3c2e73,_0x569e27['options']);return db['DeskConfiguration'][_0x38c6('0x41')](_0x3c2e73)[_0x38c6('0x22')](handleEntityNotFound(_0x3e393c,null))[_0x38c6('0x22')](respondWithResult(_0x3e393c,null))[_0x38c6('0x3e')](handleError(_0x3e393c,null));};exports[_0x38c6('0x42')]=function(_0x2448ba,_0x5194fb){return db[_0x38c6('0x27')][_0x38c6('0x42')](_0x2448ba[_0x38c6('0x43')],{})['then'](respondWithResult(_0x5194fb,0xc9))[_0x38c6('0x3e')](handleError(_0x5194fb,null));};exports[_0x38c6('0x44')]=function(_0x5cfe22,_0x43893d){if(_0x5cfe22[_0x38c6('0x43')]['id']){delete _0x5cfe22['body']['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x5cfe22[_0x38c6('0x45')]['id']}})[_0x38c6('0x22')](handleEntityNotFound(_0x43893d,null))[_0x38c6('0x22')](saveUpdates(_0x5cfe22[_0x38c6('0x43')],null))[_0x38c6('0x22')](respondWithResult(_0x43893d,null))[_0x38c6('0x3e')](handleError(_0x43893d,null));};exports[_0x38c6('0x23')]=function(_0x3ecd3a,_0x3b2882){return db[_0x38c6('0x27')]['find']({'where':{'id':_0x3ecd3a[_0x38c6('0x45')]['id']}})[_0x38c6('0x22')](handleEntityNotFound(_0x3b2882,null))[_0x38c6('0x22')](removeEntity(_0x3b2882,null))['catch'](handleError(_0x3b2882,null));};exports['getFields']=function(_0x579612,_0x3213bc,_0x598be7){var _0x41aa7f={};var _0xe369b0={};var _0x5036ee;var _0x52565a;return db[_0x38c6('0x27')]['findOne']({'where':{'id':_0x579612[_0x38c6('0x45')]['id']}})[_0x38c6('0x22')](handleEntityNotFound(_0x3213bc,null))[_0x38c6('0x22')](function(_0x1a822f){if(_0x1a822f){_0x5036ee=_0x1a822f;_0xe369b0['model']=_[_0x38c6('0x2e')](db[_0x38c6('0x46')][_0x38c6('0x28')]);_0xe369b0['query']=_['keys'](_0x579612[_0x38c6('0x2d')]);_0xe369b0[_0x38c6('0x35')]=_['intersection'](_0xe369b0[_0x38c6('0x2c')],_0xe369b0[_0x38c6('0x2d')]);_0x41aa7f['attributes']=_[_0x38c6('0x2f')](_0xe369b0['model'],qs['fields'](_0x579612[_0x38c6('0x2d')]['fields']));_0x41aa7f['attributes']=_0x41aa7f['attributes'][_0x38c6('0x3f')]?_0x41aa7f['attributes']:_0xe369b0[_0x38c6('0x2c')];_0x41aa7f[_0x38c6('0x33')]=qs['sort'](_0x579612['query'][_0x38c6('0x34')]);_0x41aa7f[_0x38c6('0x38')]=qs['filters'](_[_0x38c6('0x36')](_0x579612['query'],_0xe369b0[_0x38c6('0x35')]));if(_0x579612[_0x38c6('0x2d')][_0x38c6('0x37')]){_0x41aa7f['where']=_[_0x38c6('0x39')](_0x41aa7f[_0x38c6('0x38')],{'$or':_[_0x38c6('0x26')](_0x41aa7f['attributes'],function(_0x5b9ac3){var _0x165da9={};_0x165da9[_0x5b9ac3]={'$like':'%'+_0x579612[_0x38c6('0x2d')]['filter']+'%'};return _0x165da9;})});}_0x41aa7f=_[_0x38c6('0x39')]({},_0x41aa7f,_0x579612[_0x38c6('0x3b')]);return _0x5036ee['getFields'](_0x41aa7f);}})['then'](function(_0x34598f){if(_0x34598f){_0x52565a=_0x34598f[_0x38c6('0x3f')];if(!_0x579612['query']['hasOwnProperty'](_0x38c6('0x47'))){_0x41aa7f[_0x38c6('0x1b')]=qs[_0x38c6('0x1b')](_0x579612['query'][_0x38c6('0x1b')]);_0x41aa7f[_0x38c6('0x1a')]=qs[_0x38c6('0x1a')](_0x579612['query'][_0x38c6('0x1a')]);}return _0x5036ee[_0x38c6('0x48')](_0x41aa7f);}})[_0x38c6('0x22')](function(_0x539db7){if(_0x539db7){return _0x539db7?{'count':_0x52565a,'rows':_0x539db7}:null;}})[_0x38c6('0x22')](respondWithResult(_0x3213bc,null))[_0x38c6('0x3e')](handleError(_0x3213bc,null));};exports[_0x38c6('0x49')]=function(_0x44fd70,_0x2b37d1,_0x32ec19){var _0x277c9f={};var _0x41e643={};var _0x12c751;var _0x50f720;return db[_0x38c6('0x27')]['findOne']({'where':{'id':_0x44fd70['params']['id']}})[_0x38c6('0x22')](handleEntityNotFound(_0x2b37d1,null))[_0x38c6('0x22')](function(_0x581f38){if(_0x581f38){_0x12c751=_0x581f38;_0x41e643[_0x38c6('0x2c')]=_[_0x38c6('0x2e')](db[_0x38c6('0x46')][_0x38c6('0x28')]);_0x41e643[_0x38c6('0x2d')]=_[_0x38c6('0x2e')](_0x44fd70[_0x38c6('0x2d')]);_0x41e643[_0x38c6('0x35')]=_['intersection'](_0x41e643[_0x38c6('0x2c')],_0x41e643[_0x38c6('0x2d')]);_0x277c9f[_0x38c6('0x30')]=_[_0x38c6('0x2f')](_0x41e643[_0x38c6('0x2c')],qs[_0x38c6('0x31')](_0x44fd70[_0x38c6('0x2d')][_0x38c6('0x31')]));_0x277c9f[_0x38c6('0x30')]=_0x277c9f['attributes'][_0x38c6('0x3f')]?_0x277c9f[_0x38c6('0x30')]:_0x41e643[_0x38c6('0x2c')];_0x277c9f[_0x38c6('0x33')]=qs[_0x38c6('0x34')](_0x44fd70[_0x38c6('0x2d')][_0x38c6('0x34')]);_0x277c9f[_0x38c6('0x38')]=qs[_0x38c6('0x35')](_[_0x38c6('0x36')](_0x44fd70[_0x38c6('0x2d')],_0x41e643['filters']));if(_0x44fd70[_0x38c6('0x2d')]['filter']){_0x277c9f[_0x38c6('0x38')]=_['merge'](_0x277c9f['where'],{'$or':_[_0x38c6('0x26')](_0x277c9f[_0x38c6('0x30')],function(_0x30767b){var _0x50e735={};_0x50e735[_0x30767b]={'$like':'%'+_0x44fd70['query'][_0x38c6('0x37')]+'%'};return _0x50e735;})});}_0x277c9f=_[_0x38c6('0x39')]({},_0x277c9f,_0x44fd70[_0x38c6('0x3b')]);return _0x12c751[_0x38c6('0x49')](_0x277c9f);}})[_0x38c6('0x22')](function(_0x5aa9a6){if(_0x5aa9a6){_0x50f720=_0x5aa9a6[_0x38c6('0x3f')];if(!_0x44fd70[_0x38c6('0x2d')][_0x38c6('0x32')]('nolimit')){_0x277c9f[_0x38c6('0x1b')]=qs['limit'](_0x44fd70['query'][_0x38c6('0x1b')]);_0x277c9f['offset']=qs[_0x38c6('0x1a')](_0x44fd70[_0x38c6('0x2d')][_0x38c6('0x1a')]);}return _0x12c751[_0x38c6('0x49')](_0x277c9f);}})[_0x38c6('0x22')](function(_0xa99133){if(_0xa99133){return _0xa99133?{'count':_0x50f720,'rows':_0xa99133}:null;}})['then'](respondWithResult(_0x2b37d1,null))['catch'](handleError(_0x2b37d1,null));};exports['getDescriptions']=function(_0x51ed89,_0x35306c,_0x4be9c5){var _0x5ef5c0={};var _0x5e4af8={};var _0x1a2b91;var _0x3a12ba;return db[_0x38c6('0x27')][_0x38c6('0x4a')]({'where':{'id':_0x51ed89[_0x38c6('0x45')]['id']}})[_0x38c6('0x22')](handleEntityNotFound(_0x35306c,null))['then'](function(_0x1d3722){if(_0x1d3722){_0x1a2b91=_0x1d3722;_0x5e4af8[_0x38c6('0x2c')]=_[_0x38c6('0x2e')](db[_0x38c6('0x46')]['rawAttributes']);_0x5e4af8['query']=_['keys'](_0x51ed89[_0x38c6('0x2d')]);_0x5e4af8['filters']=_[_0x38c6('0x2f')](_0x5e4af8[_0x38c6('0x2c')],_0x5e4af8['query']);_0x5ef5c0[_0x38c6('0x30')]=_[_0x38c6('0x2f')](_0x5e4af8[_0x38c6('0x2c')],qs[_0x38c6('0x31')](_0x51ed89[_0x38c6('0x2d')][_0x38c6('0x31')]));_0x5ef5c0[_0x38c6('0x30')]=_0x5ef5c0[_0x38c6('0x30')]['length']?_0x5ef5c0[_0x38c6('0x30')]:_0x5e4af8[_0x38c6('0x2c')];_0x5ef5c0[_0x38c6('0x33')]=qs[_0x38c6('0x34')](_0x51ed89[_0x38c6('0x2d')][_0x38c6('0x34')]);_0x5ef5c0[_0x38c6('0x38')]=qs['filters'](_[_0x38c6('0x36')](_0x51ed89[_0x38c6('0x2d')],_0x5e4af8['filters']));if(_0x51ed89['query'][_0x38c6('0x37')]){_0x5ef5c0[_0x38c6('0x38')]=_['merge'](_0x5ef5c0[_0x38c6('0x38')],{'$or':_[_0x38c6('0x26')](_0x5ef5c0[_0x38c6('0x30')],function(_0x276c6b){var _0x3d68e3={};_0x3d68e3[_0x276c6b]={'$like':'%'+_0x51ed89[_0x38c6('0x2d')][_0x38c6('0x37')]+'%'};return _0x3d68e3;})});}_0x5ef5c0=_[_0x38c6('0x39')]({},_0x5ef5c0,_0x51ed89[_0x38c6('0x3b')]);return _0x1a2b91[_0x38c6('0x4b')](_0x5ef5c0);}})[_0x38c6('0x22')](function(_0x3ba447){if(_0x3ba447){_0x3a12ba=_0x3ba447['length'];if(!_0x51ed89[_0x38c6('0x2d')][_0x38c6('0x32')]('nolimit')){_0x5ef5c0[_0x38c6('0x1b')]=qs[_0x38c6('0x1b')](_0x51ed89[_0x38c6('0x2d')][_0x38c6('0x1b')]);_0x5ef5c0[_0x38c6('0x1a')]=qs[_0x38c6('0x1a')](_0x51ed89['query'][_0x38c6('0x1a')]);}return _0x1a2b91[_0x38c6('0x4b')](_0x5ef5c0);}})[_0x38c6('0x22')](function(_0x45e571){if(_0x45e571){return _0x45e571?{'count':_0x3a12ba,'rows':_0x45e571}:null;}})[_0x38c6('0x22')](respondWithResult(_0x35306c,null))['catch'](handleError(_0x35306c,null));};exports[_0x38c6('0x4c')]=function(_0x33c33e,_0x59bb79,_0x21d3ca){var _0x3cb1fe={};var _0xcc990b={};var _0x180429;var _0x52ae56;return db[_0x38c6('0x27')][_0x38c6('0x4a')]({'where':{'id':_0x33c33e[_0x38c6('0x45')]['id']}})[_0x38c6('0x22')](handleEntityNotFound(_0x59bb79,null))['then'](function(_0x2306fd){if(_0x2306fd){_0x180429=_0x2306fd;_0xcc990b['model']=_[_0x38c6('0x2e')](db[_0x38c6('0x4d')][_0x38c6('0x28')]);_0xcc990b[_0x38c6('0x2d')]=_[_0x38c6('0x2e')](_0x33c33e[_0x38c6('0x2d')]);_0xcc990b[_0x38c6('0x35')]=_[_0x38c6('0x2f')](_0xcc990b[_0x38c6('0x2c')],_0xcc990b[_0x38c6('0x2d')]);_0x3cb1fe[_0x38c6('0x30')]=_[_0x38c6('0x2f')](_0xcc990b[_0x38c6('0x2c')],qs[_0x38c6('0x31')](_0x33c33e[_0x38c6('0x2d')][_0x38c6('0x31')]));_0x3cb1fe[_0x38c6('0x30')]=_0x3cb1fe[_0x38c6('0x30')]['length']?_0x3cb1fe[_0x38c6('0x30')]:_0xcc990b[_0x38c6('0x2c')];_0x3cb1fe['order']=qs[_0x38c6('0x34')](_0x33c33e[_0x38c6('0x2d')][_0x38c6('0x34')]);_0x3cb1fe[_0x38c6('0x38')]=qs[_0x38c6('0x35')](_[_0x38c6('0x36')](_0x33c33e['query'],_0xcc990b[_0x38c6('0x35')]));if(_0x33c33e['query'][_0x38c6('0x37')]){_0x3cb1fe[_0x38c6('0x38')]=_['merge'](_0x3cb1fe[_0x38c6('0x38')],{'$or':_[_0x38c6('0x26')](_0x3cb1fe[_0x38c6('0x30')],function(_0x811fe9){var _0x1b3477={};_0x1b3477[_0x811fe9]={'$like':'%'+_0x33c33e[_0x38c6('0x2d')][_0x38c6('0x37')]+'%'};return _0x1b3477;})});}_0x3cb1fe=_[_0x38c6('0x39')]({},_0x3cb1fe,_0x33c33e[_0x38c6('0x3b')]);return _0x180429[_0x38c6('0x4c')](_0x3cb1fe);}})[_0x38c6('0x22')](function(_0x45e07b){if(_0x45e07b){_0x52ae56=_0x45e07b['length'];if(!_0x33c33e['query'][_0x38c6('0x32')](_0x38c6('0x47'))){_0x3cb1fe[_0x38c6('0x1b')]=qs[_0x38c6('0x1b')](_0x33c33e[_0x38c6('0x2d')][_0x38c6('0x1b')]);_0x3cb1fe[_0x38c6('0x1a')]=qs['offset'](_0x33c33e[_0x38c6('0x2d')][_0x38c6('0x1a')]);}return _0x180429['getTags'](_0x3cb1fe);}})[_0x38c6('0x22')](function(_0x9a028f){if(_0x9a028f){return _0x9a028f?{'count':_0x52ae56,'rows':_0x9a028f}:null;}})['then'](respondWithResult(_0x59bb79,null))[_0x38c6('0x3e')](handleError(_0x59bb79,null));};exports[_0x38c6('0x4e')]=function(_0x55acd6,_0x4ff69a,_0x240a2a){if(_0x55acd6[_0x38c6('0x43')]['id']){delete _0x55acd6[_0x38c6('0x43')]['id'];}return db[_0x38c6('0x27')][_0x38c6('0x4a')]({'where':{'id':_0x55acd6[_0x38c6('0x45')]['id']}})['then'](handleEntityNotFound(_0x4ff69a,null))[_0x38c6('0x22')](function(_0x16a778){if(_0x16a778){return _0x16a778['setTags'](_0x55acd6[_0x38c6('0x43')][_0x38c6('0x4f')]||[]);}return null;})[_0x38c6('0x22')](respondWithResult(_0x4ff69a,null))[_0x38c6('0x3e')](handleError(_0x4ff69a,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 1f4cd13..0344020 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 _0x8efe=['DeskConfiguration','int_desk_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x5c27ed,_0x39ecec){var _0x26066e=function(_0x3551eb){while(--_0x3551eb){_0x5c27ed['push'](_0x5c27ed['shift']());}};_0x26066e(++_0x39ecec);}(_0x8efe,0x1e2));var _0xe8ef=function(_0x4e1371,_0x46b4a6){_0x4e1371=_0x4e1371-0x0;var _0x35fa5b=_0x8efe[_0x4e1371];return _0x35fa5b;};'use strict';var _=require('lodash');var util=require(_0xe8ef('0x0'));var logger=require(_0xe8ef('0x1'))(_0xe8ef('0x2'));var moment=require(_0xe8ef('0x3'));var BPromise=require(_0xe8ef('0x4'));var rp=require(_0xe8ef('0x5'));var fs=require('fs');var path=require(_0xe8ef('0x6'));var rimraf=require('rimraf');var config=require(_0xe8ef('0x7'));var attributes=require('./intDeskConfiguration.attributes');module[_0xe8ef('0x8')]=function(_0x38b959,_0x5f027e){return _0x38b959[_0xe8ef('0x9')](_0xe8ef('0xa'),attributes,{'tableName':_0xe8ef('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd187=['api','moment','bluebird','request-promise','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','util','../../config/logger'];(function(_0x134192,_0x36adc5){var _0x3cd080=function(_0x134371){while(--_0x134371){_0x134192['push'](_0x134192['shift']());}};_0x3cd080(++_0x36adc5);}(_0xd187,0x1ba));var _0x7d18=function(_0x40d078,_0x210a77){_0x40d078=_0x40d078-0x0;var _0x46fc81=_0xd187[_0x40d078];return _0x46fc81;};'use strict';var _=require('lodash');var util=require(_0x7d18('0x0'));var logger=require(_0x7d18('0x1'))(_0x7d18('0x2'));var moment=require(_0x7d18('0x3'));var BPromise=require(_0x7d18('0x4'));var rp=require(_0x7d18('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7d18('0x6'));var attributes=require(_0x7d18('0x7'));module[_0x7d18('0x8')]=function(_0x121cfb,_0x14b13e){return _0x121cfb[_0x7d18('0x9')](_0x7d18('0xa'),attributes,{'tableName':_0x7d18('0xb'),'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 6991d93..a088b91 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 _0xf470=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x17c148,_0x31746b){var _0x57171a=function(_0x269151){while(--_0x269151){_0x17c148['push'](_0x17c148['shift']());}};_0x57171a(++_0x31746b);}(_0xf470,0xfd));var _0x0f47=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xf470[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0x0f47('0x0'));var util=require(_0x0f47('0x1'));var moment=require(_0x0f47('0x2'));var BPromise=require(_0x0f47('0x3'));var rs=require(_0x0f47('0x4'));var fs=require('fs');var Redis=require(_0x0f47('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0f47('0x6'));var logger=require(_0x0f47('0x7'))('rpc');var config=require(_0x0f47('0x8'));var jayson=require(_0x0f47('0x9'));var client=jayson[_0x0f47('0xa')][_0x0f47('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42c33a,_0x3c1886,_0x36f17c){return new BPromise(function(_0x4500be,_0x145344){return client[_0x0f47('0xc')](_0x42c33a,_0x36f17c)[_0x0f47('0xd')](function(_0x30d884){logger[_0x0f47('0xe')](_0x0f47('0xf'),_0x3c1886,_0x0f47('0x10'));logger[_0x0f47('0x11')](_0x0f47('0x12'),_0x3c1886,_0x0f47('0x10'),JSON[_0x0f47('0x13')](_0x30d884));if(_0x30d884['error']){if(_0x30d884[_0x0f47('0x14')][_0x0f47('0x15')]===0x1f4){logger[_0x0f47('0x14')](_0x0f47('0xf'),_0x3c1886,_0x30d884[_0x0f47('0x14')]['message']);return _0x145344(_0x30d884['error'][_0x0f47('0x16')]);}logger[_0x0f47('0x14')](_0x0f47('0xf'),_0x3c1886,_0x30d884[_0x0f47('0x14')][_0x0f47('0x16')]);return _0x4500be(_0x30d884['error'][_0x0f47('0x16')]);}else{logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x3c1886,_0x0f47('0x10'));_0x4500be(_0x30d884[_0x0f47('0x17')][_0x0f47('0x16')]);}})[_0x0f47('0x18')](function(_0x475754){logger[_0x0f47('0x14')](_0x0f47('0xf'),_0x3c1886,_0x475754);_0x145344(_0x475754);});});} \ No newline at end of file +var _0xe195=['jayson/promise','client','request','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x2cbb42,_0x5862e8){var _0x1d4266=function(_0x16d166){while(--_0x16d166){_0x2cbb42['push'](_0x2cbb42['shift']());}};_0x1d4266(++_0x5862e8);}(_0xe195,0x1c6));var _0x5e19=function(_0x3e5992,_0xd30d25){_0x3e5992=_0x3e5992-0x0;var _0x2abeac=_0xe195[_0x3e5992];return _0x2abeac;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5e19('0x0'));var BPromise=require(_0x5e19('0x1'));var rs=require(_0x5e19('0x2'));var fs=require('fs');var Redis=require(_0x5e19('0x3'));var db=require(_0x5e19('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5e19('0x5'))(_0x5e19('0x6'));var config=require(_0x5e19('0x7'));var jayson=require(_0x5e19('0x8'));var client=jayson[_0x5e19('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ca278,_0x50b913,_0x1e40c4){return new BPromise(function(_0x21e440,_0x377428){return client[_0x5e19('0xa')](_0x2ca278,_0x1e40c4)['then'](function(_0x3a1974){logger['info'](_0x5e19('0xb'),_0x50b913,_0x5e19('0xc'));logger[_0x5e19('0xd')](_0x5e19('0xe'),_0x50b913,_0x5e19('0xc'),JSON[_0x5e19('0xf')](_0x3a1974));if(_0x3a1974[_0x5e19('0x10')]){if(_0x3a1974['error'][_0x5e19('0x11')]===0x1f4){logger[_0x5e19('0x10')](_0x5e19('0xb'),_0x50b913,_0x3a1974[_0x5e19('0x10')][_0x5e19('0x12')]);return _0x377428(_0x3a1974['error'][_0x5e19('0x12')]);}logger[_0x5e19('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x50b913,_0x3a1974[_0x5e19('0x10')][_0x5e19('0x12')]);return _0x21e440(_0x3a1974[_0x5e19('0x10')]['message']);}else{logger['info'](_0x5e19('0xb'),_0x50b913,'request\x20sent');_0x21e440(_0x3a1974[_0x5e19('0x13')][_0x5e19('0x12')]);}})[_0x5e19('0x14')](function(_0x5e72a3){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x50b913,_0x5e72a3);_0x377428(_0x5e72a3);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 7d527ea..14f70d0 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 _0x895e=['isAuthenticated','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intDeskField.controller','get'];(function(_0x6ae764,_0x5c842f){var _0x49d113=function(_0x1ee534){while(--_0x1ee534){_0x6ae764['push'](_0x6ae764['shift']());}};_0x49d113(++_0x5c842f);}(_0x895e,0xab));var _0xe895=function(_0x29a6bf,_0x2530e7){_0x29a6bf=_0x29a6bf-0x0;var _0x1edc25=_0x895e[_0x29a6bf];return _0x1edc25;};'use strict';var multer=require('multer');var util=require(_0xe895('0x0'));var path=require(_0xe895('0x1'));var timeout=require(_0xe895('0x2'));var express=require(_0xe895('0x3'));var router=express[_0xe895('0x4')]();var fs_extra=require(_0xe895('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe895('0x6'));var config=require('../../config/environment');var controller=require(_0xe895('0x7'));router[_0xe895('0x8')]('/',auth[_0xe895('0x9')](),controller['index']);router[_0xe895('0x8')](_0xe895('0xa'),auth['isAuthenticated'](),controller[_0xe895('0xb')]);router[_0xe895('0xc')]('/',auth[_0xe895('0x9')](),controller[_0xe895('0xd')]);router[_0xe895('0xe')]('/:id',auth[_0xe895('0x9')](),controller[_0xe895('0xf')]);router[_0xe895('0x10')](_0xe895('0xa'),auth['isAuthenticated'](),controller[_0xe895('0x11')]);module['exports']=router; \ No newline at end of file +var _0x011a=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','post','create','put','update','delete','/:id','destroy'];(function(_0x259275,_0x48e2d7){var _0x564963=function(_0x39b61d){while(--_0x39b61d){_0x259275['push'](_0x259275['shift']());}};_0x564963(++_0x48e2d7);}(_0x011a,0x1c8));var _0xa011=function(_0x3027b1,_0x282484){_0x3027b1=_0x3027b1-0x0;var _0x59447f=_0x011a[_0x3027b1];return _0x59447f;};'use strict';var multer=require(_0xa011('0x0'));var util=require(_0xa011('0x1'));var path=require(_0xa011('0x2'));var timeout=require(_0xa011('0x3'));var express=require('express');var router=express[_0xa011('0x4')]();var fs_extra=require(_0xa011('0x5'));var auth=require(_0xa011('0x6'));var interaction=require(_0xa011('0x7'));var config=require(_0xa011('0x8'));var controller=require(_0xa011('0x9'));router[_0xa011('0xa')]('/',auth[_0xa011('0xb')](),controller['index']);router['get']('/:id',auth[_0xa011('0xb')](),controller['show']);router[_0xa011('0xc')]('/',auth['isAuthenticated'](),controller[_0xa011('0xd')]);router[_0xa011('0xe')]('/:id',auth[_0xa011('0xb')](),controller[_0xa011('0xf')]);router[_0xa011('0x10')](_0xa011('0x11'),auth[_0xa011('0xb')](),controller[_0xa011('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 8ccc3aa..75538de 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 _0x57bb=['exports','string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize'];(function(_0x525bb4,_0x331d2f){var _0x26a946=function(_0x17b820){while(--_0x17b820){_0x525bb4['push'](_0x525bb4['shift']());}};_0x26a946(++_0x331d2f);}(_0x57bb,0xc7));var _0xb57b=function(_0x90e5,_0x407c72){_0x90e5=_0x90e5-0x0;var _0xc68f94=_0x57bb[_0x90e5];return _0xc68f94;};'use strict';var Sequelize=require(_0xb57b('0x0'));module[_0xb57b('0x1')]={'type':{'type':Sequelize['ENUM'](_0xb57b('0x2'),_0xb57b('0x3'),_0xb57b('0x4'),_0xb57b('0x5'),_0xb57b('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb57b('0x7')]},'keyType':{'type':Sequelize[_0xb57b('0x8')](_0xb57b('0x2'),_0xb57b('0x3'),_0xb57b('0x4'))},'keyContent':{'type':Sequelize[_0xb57b('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb57b('0x7')]},'customField':{'type':Sequelize[_0xb57b('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb57b('0x7')]}}; \ No newline at end of file +var _0x65ee=['picklist','STRING','ENUM','sequelize','exports','string','variable','customVariable'];(function(_0x32ca3d,_0x18d639){var _0x22ef70=function(_0x547ddb){while(--_0x547ddb){_0x32ca3d['push'](_0x32ca3d['shift']());}};_0x22ef70(++_0x18d639);}(_0x65ee,0xd3));var _0xe65e=function(_0xcea152,_0x3495bb){_0xcea152=_0xcea152-0x0;var _0x42110c=_0x65ee[_0xcea152];return _0x42110c;};'use strict';var Sequelize=require(_0xe65e('0x0'));module[_0xe65e('0x1')]={'type':{'type':Sequelize['ENUM'](_0xe65e('0x2'),_0xe65e('0x3'),_0xe65e('0x4'),'keyValue',_0xe65e('0x5')),'defaultValue':_0xe65e('0x2')},'content':{'type':Sequelize[_0xe65e('0x6')]},'key':{'type':Sequelize[_0xe65e('0x6')]},'keyType':{'type':Sequelize[_0xe65e('0x7')](_0xe65e('0x2'),_0xe65e('0x3'),_0xe65e('0x4'))},'keyContent':{'type':Sequelize[_0xe65e('0x6')]},'idField':{'type':Sequelize[_0xe65e('0x6')]},'nameField':{'type':Sequelize[_0xe65e('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe65e('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 7d5419d..6162d03 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 _0x1e50=['find','create','body','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','error','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','attributes'];(function(_0x4c9464,_0x1a9a63){var _0x18e7c3=function(_0x1a396a){while(--_0x1a396a){_0x4c9464['push'](_0x4c9464['shift']());}};_0x18e7c3(++_0x1a9a63);}(_0x1e50,0x11d));var _0x01e5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1e50[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x01e5('0x0'));var rimraf=require(_0x01e5('0x1'));var zipdir=require(_0x01e5('0x2'));var jsonpatch=require(_0x01e5('0x3'));var rp=require('request-promise');var moment=require(_0x01e5('0x4'));var BPromise=require(_0x01e5('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x01e5('0x6'));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(_0x01e5('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x01e5('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x01e5('0x9'));var querystring=require(_0x01e5('0xa'));var Papa=require(_0x01e5('0xb'));var Redis=require(_0x01e5('0xc'));var authService=require(_0x01e5('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x01e5('0xe'));var hardwareService=require(_0x01e5('0xf'));var logger=require(_0x01e5('0x10'))('api');var utils=require(_0x01e5('0x11'));var config=require(_0x01e5('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x142330,_0x59aed5){_0x59aed5=_0x59aed5||0xcc;return function(_0x46de69){if(_0x46de69){return _0x142330[_0x01e5('0x13')](_0x59aed5);}return _0x142330[_0x01e5('0x14')](_0x59aed5)[_0x01e5('0x15')]();};}function respondWithResult(_0x102eb3,_0x2ba644){_0x2ba644=_0x2ba644||0xc8;return function(_0x3215a8){if(_0x3215a8){return _0x102eb3[_0x01e5('0x14')](_0x2ba644)['json'](_0x3215a8);}};}function respondWithFilteredResult(_0x5bbb6c,_0x510522){return function(_0x242011){if(_0x242011){var _0x171fba=typeof _0x510522[_0x01e5('0x16')]===_0x01e5('0x17')&&typeof _0x510522[_0x01e5('0x18')]===_0x01e5('0x17');var _0x5dae6e=_0x242011[_0x01e5('0x19')];var _0x343099=_0x171fba?0x0:_0x510522[_0x01e5('0x16')];var _0xeaa197=_0x171fba?_0x242011[_0x01e5('0x19')]:_0x510522[_0x01e5('0x16')]+_0x510522['limit'];var _0x4a041b;if(_0xeaa197>=_0x5dae6e){_0xeaa197=_0x5dae6e;_0x4a041b=0xc8;}else{_0x4a041b=0xce;}_0x5bbb6c[_0x01e5('0x14')](_0x4a041b);return _0x5bbb6c['set'](_0x01e5('0x1a'),_0x343099+'-'+_0xeaa197+'/'+_0x5dae6e)[_0x01e5('0x1b')](_0x242011);}return null;};}function patchUpdates(_0x553e5f){return function(_0x5afeaa){try{jsonpatch[_0x01e5('0x1c')](_0x5afeaa,_0x553e5f,!![]);}catch(_0x298f02){return BPromise[_0x01e5('0x1d')](_0x298f02);}return _0x5afeaa[_0x01e5('0x1e')]();};}function saveUpdates(_0x2299de,_0x21d9cd){return function(_0x3ac704){if(_0x3ac704){return _0x3ac704[_0x01e5('0x1f')](_0x2299de)['then'](function(_0x411131){return _0x411131;});}return null;};}function removeEntity(_0x35e06e,_0x50f33a){return function(_0x3e7aa6){if(_0x3e7aa6){return _0x3e7aa6[_0x01e5('0x20')]()[_0x01e5('0x21')](function(){_0x35e06e['status'](0xcc)[_0x01e5('0x15')]();});}};}function handleEntityNotFound(_0x570c50,_0x334071){return function(_0x4bd3cb){if(!_0x4bd3cb){_0x570c50['sendStatus'](0x194);}return _0x4bd3cb;};}function handleError(_0x101838,_0x338936){_0x338936=_0x338936||0x1f4;return function(_0x2c1744){logger[_0x01e5('0x22')](_0x2c1744['stack']);if(_0x2c1744[_0x01e5('0x23')]){delete _0x2c1744[_0x01e5('0x23')];}_0x101838[_0x01e5('0x14')](_0x338936)[_0x01e5('0x24')](_0x2c1744);};}exports[_0x01e5('0x25')]=function(_0x13b7f5,_0x59eca6){var _0x62c250={},_0x224f2a={},_0x57a5e4={'count':0x0,'rows':[]};var _0x2406f2=_[_0x01e5('0x26')](db[_0x01e5('0x27')][_0x01e5('0x28')],function(_0x41640e){return{'name':_0x41640e[_0x01e5('0x29')],'type':_0x41640e[_0x01e5('0x2a')][_0x01e5('0x2b')]};});_0x224f2a[_0x01e5('0x2c')]=_[_0x01e5('0x26')](_0x2406f2,_0x01e5('0x23'));_0x224f2a[_0x01e5('0x2d')]=_[_0x01e5('0x2e')](_0x13b7f5[_0x01e5('0x2d')]);_0x224f2a[_0x01e5('0x2f')]=_[_0x01e5('0x30')](_0x224f2a[_0x01e5('0x2c')],_0x224f2a[_0x01e5('0x2d')]);_0x62c250['attributes']=_['intersection'](_0x224f2a[_0x01e5('0x2c')],qs[_0x01e5('0x31')](_0x13b7f5['query'][_0x01e5('0x31')]));_0x62c250['attributes']=_0x62c250['attributes'][_0x01e5('0x32')]?_0x62c250['attributes']:_0x224f2a[_0x01e5('0x2c')];if(!_0x13b7f5[_0x01e5('0x2d')][_0x01e5('0x33')](_0x01e5('0x34'))){_0x62c250[_0x01e5('0x18')]=qs[_0x01e5('0x18')](_0x13b7f5[_0x01e5('0x2d')][_0x01e5('0x18')]);_0x62c250['offset']=qs[_0x01e5('0x16')](_0x13b7f5['query'][_0x01e5('0x16')]);}_0x62c250[_0x01e5('0x35')]=qs[_0x01e5('0x36')](_0x13b7f5[_0x01e5('0x2d')]['sort']);_0x62c250[_0x01e5('0x37')]=qs[_0x01e5('0x2f')](_['pick'](_0x13b7f5['query'],_0x224f2a['filters']),_0x2406f2);if(_0x13b7f5[_0x01e5('0x2d')][_0x01e5('0x38')]){_0x62c250['where']=_[_0x01e5('0x39')](_0x62c250[_0x01e5('0x37')],{'$or':_[_0x01e5('0x26')](_0x2406f2,function(_0x2b7813){if(_0x2b7813[_0x01e5('0x2a')]!==_0x01e5('0x3a')){var _0x1a636b={};_0x1a636b[_0x2b7813[_0x01e5('0x23')]]={'$like':'%'+_0x13b7f5['query']['filter']+'%'};return _0x1a636b;}})});}_0x62c250=_['merge']({},_0x62c250,_0x13b7f5[_0x01e5('0x3b')]);var _0x5c90a6={'where':_0x62c250[_0x01e5('0x37')]};return db[_0x01e5('0x27')][_0x01e5('0x19')](_0x5c90a6)[_0x01e5('0x21')](function(_0x5e5cc6){_0x57a5e4[_0x01e5('0x19')]=_0x5e5cc6;if(_0x13b7f5[_0x01e5('0x2d')]['includeAll']){_0x62c250[_0x01e5('0x3c')]=[{'all':!![]}];}return db[_0x01e5('0x27')][_0x01e5('0x3d')](_0x62c250);})[_0x01e5('0x21')](function(_0x1bee5c){_0x57a5e4[_0x01e5('0x3e')]=_0x1bee5c;return _0x57a5e4;})[_0x01e5('0x21')](respondWithFilteredResult(_0x59eca6,_0x62c250))['catch'](handleError(_0x59eca6,null));};exports[_0x01e5('0x3f')]=function(_0x428de1,_0x5b3a37){var _0x2b1094={'raw':!![],'where':{'id':_0x428de1['params']['id']}},_0x22fe0c={};_0x22fe0c['model']=_['keys'](db[_0x01e5('0x27')]['rawAttributes']);_0x22fe0c[_0x01e5('0x2d')]=_['keys'](_0x428de1[_0x01e5('0x2d')]);_0x22fe0c[_0x01e5('0x2f')]=_['intersection'](_0x22fe0c[_0x01e5('0x2c')],_0x22fe0c[_0x01e5('0x2d')]);_0x2b1094['attributes']=_[_0x01e5('0x30')](_0x22fe0c['model'],qs[_0x01e5('0x31')](_0x428de1['query'][_0x01e5('0x31')]));_0x2b1094[_0x01e5('0x40')]=_0x2b1094[_0x01e5('0x40')][_0x01e5('0x32')]?_0x2b1094[_0x01e5('0x40')]:_0x22fe0c[_0x01e5('0x2c')];if(_0x428de1['query']['includeAll']){_0x2b1094['include']=[{'all':!![]}];}_0x2b1094=_[_0x01e5('0x39')]({},_0x2b1094,_0x428de1[_0x01e5('0x3b')]);return db['DeskField'][_0x01e5('0x41')](_0x2b1094)[_0x01e5('0x21')](handleEntityNotFound(_0x5b3a37,null))[_0x01e5('0x21')](respondWithResult(_0x5b3a37,null))['catch'](handleError(_0x5b3a37,null));};exports['create']=function(_0x1136da,_0x31c753){return db['DeskField'][_0x01e5('0x42')](_0x1136da[_0x01e5('0x43')],{})[_0x01e5('0x21')](respondWithResult(_0x31c753,0xc9))[_0x01e5('0x44')](handleError(_0x31c753,null));};exports[_0x01e5('0x1f')]=function(_0x23c3cb,_0x4c8db3){if(_0x23c3cb['body']['id']){delete _0x23c3cb[_0x01e5('0x43')]['id'];}return db[_0x01e5('0x27')][_0x01e5('0x41')]({'where':{'id':_0x23c3cb[_0x01e5('0x45')]['id']}})[_0x01e5('0x21')](handleEntityNotFound(_0x4c8db3,null))['then'](saveUpdates(_0x23c3cb[_0x01e5('0x43')],null))[_0x01e5('0x21')](respondWithResult(_0x4c8db3,null))['catch'](handleError(_0x4c8db3,null));};exports[_0x01e5('0x20')]=function(_0x46413d,_0xf24d4){return db[_0x01e5('0x27')][_0x01e5('0x41')]({'where':{'id':_0x46413d[_0x01e5('0x45')]['id']}})[_0x01e5('0x21')](handleEntityNotFound(_0xf24d4,null))[_0x01e5('0x21')](removeEntity(_0xf24d4,null))[_0x01e5('0x44')](handleError(_0xf24d4,null));}; \ No newline at end of file +var _0x53ab=['lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','map','DeskField','rawAttributes','fieldName','type','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','keys','length','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs'];(function(_0x1183d3,_0x3fc6c9){var _0x3cfa9e=function(_0x219d23){while(--_0x219d23){_0x1183d3['push'](_0x1183d3['shift']());}};_0x3cfa9e(++_0x3fc6c9);}(_0x53ab,0x130));var _0xb53a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53ab[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb53a('0x0'));var rimraf=require(_0xb53a('0x1'));var zipdir=require(_0xb53a('0x2'));var jsonpatch=require(_0xb53a('0x3'));var rp=require(_0xb53a('0x4'));var moment=require(_0xb53a('0x5'));var BPromise=require(_0xb53a('0x6'));var Mustache=require(_0xb53a('0x7'));var util=require(_0xb53a('0x8'));var path=require(_0xb53a('0x9'));var sox=require('sox');var csv=require(_0xb53a('0xa'));var ejs=require(_0xb53a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb53a('0xc'));var squel=require(_0xb53a('0xd'));var crypto=require('crypto');var jsforce=require(_0xb53a('0xe'));var deskjs=require(_0xb53a('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb53a('0x10'));var Papa=require(_0xb53a('0x11'));var Redis=require(_0xb53a('0x12'));var authService=require(_0xb53a('0x13'));var qs=require(_0xb53a('0x14'));var as=require(_0xb53a('0x15'));var hardwareService=require(_0xb53a('0x16'));var logger=require(_0xb53a('0x17'))(_0xb53a('0x18'));var utils=require('../../config/utils');var config=require(_0xb53a('0x19'));var licenseUtil=require(_0xb53a('0x1a'));var db=require(_0xb53a('0x1b'))['db'];function respondWithStatusCode(_0x38d6e5,_0x7f10a2){_0x7f10a2=_0x7f10a2||0xcc;return function(_0x53bf98){if(_0x53bf98){return _0x38d6e5[_0xb53a('0x1c')](_0x7f10a2);}return _0x38d6e5['status'](_0x7f10a2)['end']();};}function respondWithResult(_0x5a7657,_0x4c339f){_0x4c339f=_0x4c339f||0xc8;return function(_0x37cb1e){if(_0x37cb1e){return _0x5a7657[_0xb53a('0x1d')](_0x4c339f)[_0xb53a('0x1e')](_0x37cb1e);}};}function respondWithFilteredResult(_0x5d2978,_0x10c0c8){return function(_0x18b982){if(_0x18b982){var _0x11a337=typeof _0x10c0c8['offset']===_0xb53a('0x1f')&&typeof _0x10c0c8['limit']===_0xb53a('0x1f');var _0x473376=_0x18b982[_0xb53a('0x20')];var _0x4b94f5=_0x11a337?0x0:_0x10c0c8[_0xb53a('0x21')];var _0x5c2856=_0x11a337?_0x18b982[_0xb53a('0x20')]:_0x10c0c8[_0xb53a('0x21')]+_0x10c0c8[_0xb53a('0x22')];var _0x334113;if(_0x5c2856>=_0x473376){_0x5c2856=_0x473376;_0x334113=0xc8;}else{_0x334113=0xce;}_0x5d2978[_0xb53a('0x1d')](_0x334113);return _0x5d2978['set'](_0xb53a('0x23'),_0x4b94f5+'-'+_0x5c2856+'/'+_0x473376)['json'](_0x18b982);}return null;};}function patchUpdates(_0x324501){return function(_0x899b2d){try{jsonpatch[_0xb53a('0x24')](_0x899b2d,_0x324501,!![]);}catch(_0x4d4388){return BPromise[_0xb53a('0x25')](_0x4d4388);}return _0x899b2d[_0xb53a('0x26')]();};}function saveUpdates(_0x505f04,_0x135a3b){return function(_0x5c9067){if(_0x5c9067){return _0x5c9067[_0xb53a('0x27')](_0x505f04)['then'](function(_0x46d5cf){return _0x46d5cf;});}return null;};}function removeEntity(_0x39ad0e,_0x44a97c){return function(_0x1f8992){if(_0x1f8992){return _0x1f8992[_0xb53a('0x28')]()[_0xb53a('0x29')](function(){_0x39ad0e[_0xb53a('0x1d')](0xcc)[_0xb53a('0x2a')]();});}};}function handleEntityNotFound(_0x50439a,_0xa07add){return function(_0x202afa){if(!_0x202afa){_0x50439a[_0xb53a('0x1c')](0x194);}return _0x202afa;};}function handleError(_0xf4e934,_0x440dfc){_0x440dfc=_0x440dfc||0x1f4;return function(_0x4cb0d4){logger[_0xb53a('0x2b')](_0x4cb0d4[_0xb53a('0x2c')]);if(_0x4cb0d4[_0xb53a('0x2d')]){delete _0x4cb0d4['name'];}_0xf4e934['status'](_0x440dfc)[_0xb53a('0x2e')](_0x4cb0d4);};}exports['index']=function(_0x182317,_0x45bff6){var _0xa6bcee={},_0x5045fa={},_0x2a3457={'count':0x0,'rows':[]};var _0x74d913=_[_0xb53a('0x2f')](db[_0xb53a('0x30')][_0xb53a('0x31')],function(_0x7184b9){return{'name':_0x7184b9[_0xb53a('0x32')],'type':_0x7184b9[_0xb53a('0x33')]['key']};});_0x5045fa[_0xb53a('0x34')]=_[_0xb53a('0x2f')](_0x74d913,_0xb53a('0x2d'));_0x5045fa[_0xb53a('0x35')]=_['keys'](_0x182317[_0xb53a('0x35')]);_0x5045fa['filters']=_['intersection'](_0x5045fa[_0xb53a('0x34')],_0x5045fa[_0xb53a('0x35')]);_0xa6bcee[_0xb53a('0x36')]=_[_0xb53a('0x37')](_0x5045fa[_0xb53a('0x34')],qs[_0xb53a('0x38')](_0x182317[_0xb53a('0x35')][_0xb53a('0x38')]));_0xa6bcee[_0xb53a('0x36')]=_0xa6bcee[_0xb53a('0x36')]['length']?_0xa6bcee['attributes']:_0x5045fa[_0xb53a('0x34')];if(!_0x182317[_0xb53a('0x35')][_0xb53a('0x39')](_0xb53a('0x3a'))){_0xa6bcee[_0xb53a('0x22')]=qs[_0xb53a('0x22')](_0x182317[_0xb53a('0x35')][_0xb53a('0x22')]);_0xa6bcee['offset']=qs[_0xb53a('0x21')](_0x182317[_0xb53a('0x35')][_0xb53a('0x21')]);}_0xa6bcee[_0xb53a('0x3b')]=qs['sort'](_0x182317['query'][_0xb53a('0x3c')]);_0xa6bcee[_0xb53a('0x3d')]=qs[_0xb53a('0x3e')](_[_0xb53a('0x3f')](_0x182317[_0xb53a('0x35')],_0x5045fa['filters']),_0x74d913);if(_0x182317[_0xb53a('0x35')]['filter']){_0xa6bcee[_0xb53a('0x3d')]=_[_0xb53a('0x40')](_0xa6bcee[_0xb53a('0x3d')],{'$or':_[_0xb53a('0x2f')](_0x74d913,function(_0x3ceab0){if(_0x3ceab0['type']!=='VIRTUAL'){var _0x7856ec={};_0x7856ec[_0x3ceab0[_0xb53a('0x2d')]]={'$like':'%'+_0x182317[_0xb53a('0x35')][_0xb53a('0x41')]+'%'};return _0x7856ec;}})});}_0xa6bcee=_['merge']({},_0xa6bcee,_0x182317[_0xb53a('0x42')]);var _0x500e56={'where':_0xa6bcee[_0xb53a('0x3d')]};return db['DeskField'][_0xb53a('0x20')](_0x500e56)[_0xb53a('0x29')](function(_0x3dca7c){_0x2a3457[_0xb53a('0x20')]=_0x3dca7c;if(_0x182317[_0xb53a('0x35')][_0xb53a('0x43')]){_0xa6bcee[_0xb53a('0x44')]=[{'all':!![]}];}return db[_0xb53a('0x30')][_0xb53a('0x45')](_0xa6bcee);})['then'](function(_0x3f2e85){_0x2a3457[_0xb53a('0x46')]=_0x3f2e85;return _0x2a3457;})[_0xb53a('0x29')](respondWithFilteredResult(_0x45bff6,_0xa6bcee))[_0xb53a('0x47')](handleError(_0x45bff6,null));};exports[_0xb53a('0x48')]=function(_0x3789c2,_0x24078f){var _0x300eaf={'raw':!![],'where':{'id':_0x3789c2['params']['id']}},_0x23e56b={};_0x23e56b[_0xb53a('0x34')]=_[_0xb53a('0x49')](db[_0xb53a('0x30')][_0xb53a('0x31')]);_0x23e56b[_0xb53a('0x35')]=_[_0xb53a('0x49')](_0x3789c2[_0xb53a('0x35')]);_0x23e56b[_0xb53a('0x3e')]=_[_0xb53a('0x37')](_0x23e56b[_0xb53a('0x34')],_0x23e56b[_0xb53a('0x35')]);_0x300eaf[_0xb53a('0x36')]=_[_0xb53a('0x37')](_0x23e56b[_0xb53a('0x34')],qs[_0xb53a('0x38')](_0x3789c2[_0xb53a('0x35')][_0xb53a('0x38')]));_0x300eaf['attributes']=_0x300eaf['attributes'][_0xb53a('0x4a')]?_0x300eaf['attributes']:_0x23e56b[_0xb53a('0x34')];if(_0x3789c2[_0xb53a('0x35')][_0xb53a('0x43')]){_0x300eaf[_0xb53a('0x44')]=[{'all':!![]}];}_0x300eaf=_[_0xb53a('0x40')]({},_0x300eaf,_0x3789c2[_0xb53a('0x42')]);return db[_0xb53a('0x30')]['find'](_0x300eaf)[_0xb53a('0x29')](handleEntityNotFound(_0x24078f,null))['then'](respondWithResult(_0x24078f,null))['catch'](handleError(_0x24078f,null));};exports['create']=function(_0x1cbbf0,_0x508b99){return db[_0xb53a('0x30')][_0xb53a('0x4b')](_0x1cbbf0[_0xb53a('0x4c')],{})[_0xb53a('0x29')](respondWithResult(_0x508b99,0xc9))[_0xb53a('0x47')](handleError(_0x508b99,null));};exports[_0xb53a('0x27')]=function(_0x33da3a,_0x2f8169){if(_0x33da3a[_0xb53a('0x4c')]['id']){delete _0x33da3a[_0xb53a('0x4c')]['id'];}return db[_0xb53a('0x30')][_0xb53a('0x4d')]({'where':{'id':_0x33da3a[_0xb53a('0x4e')]['id']}})[_0xb53a('0x29')](handleEntityNotFound(_0x2f8169,null))[_0xb53a('0x29')](saveUpdates(_0x33da3a['body'],null))[_0xb53a('0x29')](respondWithResult(_0x2f8169,null))[_0xb53a('0x47')](handleError(_0x2f8169,null));};exports['destroy']=function(_0x395fed,_0x49cbb4){return db['DeskField'][_0xb53a('0x4d')]({'where':{'id':_0x395fed['params']['id']}})['then'](handleEntityNotFound(_0x49cbb4,null))['then'](removeEntity(_0x49cbb4,null))['catch'](handleError(_0x49cbb4,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index f1279c3..e544a57 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 _0xd208=['idField','FieldId','api','moment','request-promise','path','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index'];(function(_0x2ffb2c,_0x483651){var _0x80c35e=function(_0x5c283a){while(--_0x5c283a){_0x2ffb2c['push'](_0x2ffb2c['shift']());}};_0x80c35e(++_0x483651);}(_0xd208,0x161));var _0x8d20=function(_0x1eb2ac,_0x125d48){_0x1eb2ac=_0x1eb2ac-0x0;var _0xe4b8fc=_0xd208[_0x1eb2ac];return _0xe4b8fc;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8d20('0x0'));var moment=require(_0x8d20('0x1'));var BPromise=require('bluebird');var rp=require(_0x8d20('0x2'));var fs=require('fs');var path=require(_0x8d20('0x3'));var rimraf=require('rimraf');var config=require(_0x8d20('0x4'));var attributes=require(_0x8d20('0x5'));module[_0x8d20('0x6')]=function(_0x20f115,_0x5e590d){return _0x20f115[_0x8d20('0x7')](_0x8d20('0x8'),attributes,{'tableName':_0x8d20('0x9'),'paranoid':![],'indexes':[{'name':_0x8d20('0xa'),'fields':[_0x8d20('0xb'),_0x8d20('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcd2f=['request-promise','path','rimraf','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x5b8702,_0x29cb76){var _0x3f7217=function(_0x1a0a4c){while(--_0x1a0a4c){_0x5b8702['push'](_0x5b8702['shift']());}};_0x3f7217(++_0x29cb76);}(_0xcd2f,0xdc));var _0xfcd2=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xcd2f[_0x341e0f];return _0x59555a;};'use strict';var _=require(_0xfcd2('0x0'));var util=require(_0xfcd2('0x1'));var logger=require(_0xfcd2('0x2'))(_0xfcd2('0x3'));var moment=require(_0xfcd2('0x4'));var BPromise=require('bluebird');var rp=require(_0xfcd2('0x5'));var fs=require('fs');var path=require(_0xfcd2('0x6'));var rimraf=require(_0xfcd2('0x7'));var config=require('../../config/environment');var attributes=require(_0xfcd2('0x8'));module[_0xfcd2('0x9')]=function(_0xe8b090,_0x4ab541){return _0xe8b090[_0xfcd2('0xa')](_0xfcd2('0xb'),attributes,{'tableName':_0xfcd2('0xc'),'paranoid':![],'indexes':[{'name':_0xfcd2('0xd'),'fields':['idField',_0xfcd2('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 99ad4bf..4c1ba6e 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 _0x0dd2=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','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','error','code','message','result','catch','lodash'];(function(_0x20db6c,_0x4ff24a){var _0x30b5d3=function(_0x1ba9f0){while(--_0x1ba9f0){_0x20db6c['push'](_0x20db6c['shift']());}};_0x30b5d3(++_0x4ff24a);}(_0x0dd2,0x1a8));var _0x20dd=function(_0x4c12c1,_0x41926c){_0x4c12c1=_0x4c12c1-0x0;var _0x40bc9d=_0x0dd2[_0x4c12c1];return _0x40bc9d;};'use strict';var _=require(_0x20dd('0x0'));var util=require(_0x20dd('0x1'));var moment=require(_0x20dd('0x2'));var BPromise=require(_0x20dd('0x3'));var rs=require(_0x20dd('0x4'));var fs=require('fs');var Redis=require(_0x20dd('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x20dd('0x6'));var logger=require(_0x20dd('0x7'))(_0x20dd('0x8'));var config=require(_0x20dd('0x9'));var jayson=require(_0x20dd('0xa'));var client=jayson[_0x20dd('0xb')][_0x20dd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb55c51,_0x55750a,_0x91132e){return new BPromise(function(_0x40178c,_0x2cac4e){return client[_0x20dd('0xd')](_0xb55c51,_0x91132e)[_0x20dd('0xe')](function(_0x2ec26a){logger[_0x20dd('0xf')](_0x20dd('0x10'),_0x55750a,_0x20dd('0x11'));logger[_0x20dd('0x12')](_0x20dd('0x13'),_0x55750a,_0x20dd('0x11'),JSON['stringify'](_0x2ec26a));if(_0x2ec26a[_0x20dd('0x14')]){if(_0x2ec26a[_0x20dd('0x14')][_0x20dd('0x15')]===0x1f4){logger[_0x20dd('0x14')](_0x20dd('0x10'),_0x55750a,_0x2ec26a['error'][_0x20dd('0x16')]);return _0x2cac4e(_0x2ec26a['error'][_0x20dd('0x16')]);}logger[_0x20dd('0x14')]('DeskField,\x20%s,\x20%s',_0x55750a,_0x2ec26a[_0x20dd('0x14')][_0x20dd('0x16')]);return _0x40178c(_0x2ec26a[_0x20dd('0x14')]['message']);}else{logger[_0x20dd('0xf')](_0x20dd('0x10'),_0x55750a,_0x20dd('0x11'));_0x40178c(_0x2ec26a[_0x20dd('0x17')][_0x20dd('0x16')]);}})[_0x20dd('0x18')](function(_0x17be5c){logger['error'](_0x20dd('0x10'),_0x55750a,_0x17be5c);_0x2cac4e(_0x17be5c);});});} \ No newline at end of file +var _0xbc9e=['stringify','error','message','result','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x27b2b5,_0x4006b8){var _0x97e614=function(_0x13ae2e){while(--_0x13ae2e){_0x27b2b5['push'](_0x27b2b5['shift']());}};_0x97e614(++_0x4006b8);}(_0xbc9e,0xb5));var _0xebc9=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xbc9e[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0xebc9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xebc9('0x1'));var db=require(_0xebc9('0x2'))['db'];var utils=require(_0xebc9('0x3'));var logger=require(_0xebc9('0x4'))(_0xebc9('0x5'));var config=require(_0xebc9('0x6'));var jayson=require(_0xebc9('0x7'));var client=jayson[_0xebc9('0x8')][_0xebc9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc95ab1,_0x35fad6,_0x20e843){return new BPromise(function(_0x5c2a40,_0x5415bd){return client[_0xebc9('0xa')](_0xc95ab1,_0x20e843)[_0xebc9('0xb')](function(_0xd57b21){logger[_0xebc9('0xc')](_0xebc9('0xd'),_0x35fad6,'request\x20sent');logger[_0xebc9('0xe')](_0xebc9('0xf'),_0x35fad6,_0xebc9('0x10'),JSON[_0xebc9('0x11')](_0xd57b21));if(_0xd57b21[_0xebc9('0x12')]){if(_0xd57b21[_0xebc9('0x12')]['code']===0x1f4){logger[_0xebc9('0x12')]('DeskField,\x20%s,\x20%s',_0x35fad6,_0xd57b21[_0xebc9('0x12')][_0xebc9('0x13')]);return _0x5415bd(_0xd57b21['error'][_0xebc9('0x13')]);}logger[_0xebc9('0x12')]('DeskField,\x20%s,\x20%s',_0x35fad6,_0xd57b21['error'][_0xebc9('0x13')]);return _0x5c2a40(_0xd57b21[_0xebc9('0x12')]['message']);}else{logger['info'](_0xebc9('0xd'),_0x35fad6,_0xebc9('0x10'));_0x5c2a40(_0xd57b21[_0xebc9('0x14')][_0xebc9('0x13')]);}})[_0xebc9('0x15')](function(_0x37cfec){logger[_0xebc9('0x12')](_0xebc9('0xd'),_0x35fad6,_0x37cfec);_0x5415bd(_0x37cfec);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index bc467fa..0a47f47 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 _0x25f6=['addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','create','post','/:id/configurations'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x25f6,0xce));var _0x625f=function(_0x40124e,_0x47920b){_0x40124e=_0x40124e-0x0;var _0x2e8dc2=_0x25f6[_0x40124e];return _0x2e8dc2;};'use strict';var multer=require(_0x625f('0x0'));var util=require('util');var path=require(_0x625f('0x1'));var timeout=require(_0x625f('0x2'));var express=require(_0x625f('0x3'));var router=express[_0x625f('0x4')]();var fs_extra=require(_0x625f('0x5'));var auth=require(_0x625f('0x6'));var interaction=require(_0x625f('0x7'));var config=require(_0x625f('0x8'));var controller=require('./intDynamics365Account.controller');router[_0x625f('0x9')]('/',auth[_0x625f('0xa')](),controller[_0x625f('0xb')]);router[_0x625f('0x9')](_0x625f('0xc'),auth[_0x625f('0xa')](),controller[_0x625f('0xd')]);router[_0x625f('0x9')]('/:id/configurations',auth[_0x625f('0xa')](),controller[_0x625f('0xe')]);router[_0x625f('0x9')](_0x625f('0xf'),auth[_0x625f('0xa')](),controller['getFields']);router['post']('/',auth[_0x625f('0xa')](),controller[_0x625f('0x10')]);router[_0x625f('0x11')](_0x625f('0x12'),auth[_0x625f('0xa')](),controller[_0x625f('0x13')]);router[_0x625f('0x14')](_0x625f('0xc'),auth[_0x625f('0xa')](),controller[_0x625f('0x15')]);router[_0x625f('0x16')](_0x625f('0xc'),auth[_0x625f('0xa')](),controller[_0x625f('0x17')]);module[_0x625f('0x18')]=router; \ No newline at end of file +var _0xe597=['isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get'];(function(_0x2a1b33,_0x409f50){var _0x4c50e7=function(_0x13e16d){while(--_0x13e16d){_0x2a1b33['push'](_0x2a1b33['shift']());}};_0x4c50e7(++_0x409f50);}(_0xe597,0xdb));var _0x7e59=function(_0x230721,_0x239b87){_0x230721=_0x230721-0x0;var _0x2cf8a0=_0xe597[_0x230721];return _0x2cf8a0;};'use strict';var multer=require(_0x7e59('0x0'));var util=require(_0x7e59('0x1'));var path=require(_0x7e59('0x2'));var timeout=require(_0x7e59('0x3'));var express=require(_0x7e59('0x4'));var router=express[_0x7e59('0x5')]();var fs_extra=require(_0x7e59('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7e59('0x7'));var config=require(_0x7e59('0x8'));var controller=require(_0x7e59('0x9'));router[_0x7e59('0xa')]('/',auth[_0x7e59('0xb')](),controller[_0x7e59('0xc')]);router[_0x7e59('0xa')](_0x7e59('0xd'),auth[_0x7e59('0xb')](),controller['show']);router[_0x7e59('0xa')](_0x7e59('0xe'),auth[_0x7e59('0xb')](),controller[_0x7e59('0xf')]);router[_0x7e59('0xa')](_0x7e59('0x10'),auth[_0x7e59('0xb')](),controller[_0x7e59('0x11')]);router[_0x7e59('0x12')]('/',auth[_0x7e59('0xb')](),controller['create']);router[_0x7e59('0x12')](_0x7e59('0xe'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0x7e59('0xd'),auth[_0x7e59('0xb')](),controller[_0x7e59('0x13')]);router[_0x7e59('0x14')](_0x7e59('0xd'),auth[_0x7e59('0xb')](),controller[_0x7e59('0x15')]);module[_0x7e59('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 015fb37..0ffc20d 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 _0x398a=['STRING','BOOLEAN','sequelize','exports'];(function(_0x517809,_0xe707ff){var _0x49e4d6=function(_0x51ec83){while(--_0x51ec83){_0x517809['push'](_0x517809['shift']());}};_0x49e4d6(++_0xe707ff);}(_0x398a,0x11a));var _0xa398=function(_0x48e325,_0x214951){_0x48e325=_0x48e325-0x0;var _0x1cb26d=_0x398a[_0x48e325];return _0x1cb26d;};'use strict';var Sequelize=require(_0xa398('0x0'));module[_0xa398('0x1')]={'name':{'type':Sequelize[_0xa398('0x2')]},'username':{'type':Sequelize[_0xa398('0x2')]},'password':{'type':Sequelize[_0xa398('0x2')]},'remoteUri':{'type':Sequelize[_0xa398('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xa398('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa398('0x2')]},'modernAuthentication':{'type':Sequelize[_0xa398('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x7676=['sequelize','exports','STRING','BOOLEAN'];(function(_0x5a9841,_0x950566){var _0xb4f748=function(_0xdecea8){while(--_0xdecea8){_0x5a9841['push'](_0x5a9841['shift']());}};_0xb4f748(++_0x950566);}(_0x7676,0xb8));var _0x6767=function(_0xe6480d,_0xe1f2c3){_0xe6480d=_0xe6480d-0x0;var _0x55101e=_0x7676[_0xe6480d];return _0x55101e;};'use strict';var Sequelize=require(_0x6767('0x0'));module[_0x6767('0x1')]={'name':{'type':Sequelize[_0x6767('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x6767('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x6767('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x6767('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6767('0x2')]},'modernAuthentication':{'type':Sequelize[_0x6767('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index cf3aba5..b300f4a 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 _0xc627=['order','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','params','keys','options','catch','create','body','find','findOne','Dynamics365Configuration','pick','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','PhoneCall','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyname','createdon','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyyominame','modifiedon','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','data5','data7','access_token','CloudProvider','POST','https://login.microsoftonline.com/','/oauth2/token','GET','4.0','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','remove','includes','LogicalName','@odata.type','PicklistAttributeMetadata','push','MetadataId','all','isNil','forEach','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','statusCode','test',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','update','destroy','then','end','stack','name','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x37ec3d,_0x412c50){var _0x46d4ee=function(_0x7298c5){while(--_0x7298c5){_0x37ec3d['push'](_0x37ec3d['shift']());}};_0x46d4ee(++_0x412c50);}(_0xc627,0x90));var _0x7c62=function(_0x5f2e86,_0x4d8e13){_0x5f2e86=_0x5f2e86-0x0;var _0x32f37f=_0xc627[_0x5f2e86];return _0x32f37f;};'use strict';var rp=require(_0x7c62('0x0'));var util=require(_0x7c62('0x1'));var _=require(_0x7c62('0x2'));var qs=require(_0x7c62('0x3'));var logger=require(_0x7c62('0x4'))(_0x7c62('0x5'));var db=require(_0x7c62('0x6'))['db'];var integrations=require(_0x7c62('0x7'));function respondWithResult(_0x27229b,_0x63634f){_0x63634f=_0x63634f||0xc8;return function(_0x20e737){if(_0x20e737){return _0x27229b[_0x7c62('0x8')](_0x63634f)[_0x7c62('0x9')](_0x20e737);}};}function respondWithFilteredResult(_0x1a8740,_0x376b5b){return function(_0x4e378a){if(_0x4e378a){var _0x7f9ee4=typeof _0x376b5b[_0x7c62('0xa')]===_0x7c62('0xb')&&typeof _0x376b5b[_0x7c62('0xc')]===_0x7c62('0xb');var _0x3f7683=_0x4e378a[_0x7c62('0xd')];var _0x587d73=_0x7f9ee4?0x0:_0x376b5b['offset'];var _0x26bb16=_0x7f9ee4?_0x4e378a[_0x7c62('0xd')]:_0x376b5b['offset']+_0x376b5b[_0x7c62('0xc')];var _0x413f2d;if(_0x26bb16>=_0x3f7683){_0x26bb16=_0x3f7683;_0x413f2d=0xc8;}else{_0x413f2d=0xce;}_0x1a8740[_0x7c62('0x8')](_0x413f2d);return _0x1a8740['set']('Content-Range',_0x587d73+'-'+_0x26bb16+'/'+_0x3f7683)[_0x7c62('0x9')](_0x4e378a);}return null;};}function saveUpdates(_0x5efd7b){return function(_0x26173d){if(_0x26173d){return _0x26173d[_0x7c62('0xe')](_0x5efd7b)['then'](function(_0x36afcc){return _0x36afcc;});}return null;};}function removeEntity(_0x29dbcd){return function(_0x15f897){if(_0x15f897){return _0x15f897[_0x7c62('0xf')]()[_0x7c62('0x10')](function(){_0x29dbcd[_0x7c62('0x8')](0xcc)[_0x7c62('0x11')]();});}};}function handleEntityNotFound(_0x469dc4){return function(_0x1768da){if(!_0x1768da){_0x469dc4['sendStatus'](0x194);}return _0x1768da;};}function handleError(_0x243ec6,_0xd47f01){_0xd47f01=_0xd47f01||0x1f4;return function(_0x5b80c4){logger['error'](_0x5b80c4[_0x7c62('0x12')]);if(_0x5b80c4[_0x7c62('0x13')]){delete _0x5b80c4['name'];}_0x243ec6[_0x7c62('0x8')](_0xd47f01)['send'](_0x5b80c4);};}exports['index']=function(_0x59e5cd,_0x28c826){var _0xd1c47e={},_0xc2c933={},_0xd2f7c7={'count':0x0,'rows':[]};var _0x415401=_[_0x7c62('0x14')](db[_0x7c62('0x15')][_0x7c62('0x16')],function(_0x1f3a14){return{'name':_0x1f3a14[_0x7c62('0x17')],'type':_0x1f3a14[_0x7c62('0x18')][_0x7c62('0x19')]};});_0xc2c933[_0x7c62('0x1a')]=_[_0x7c62('0x14')](_0x415401,_0x7c62('0x13'));_0xc2c933[_0x7c62('0x1b')]=_['keys'](_0x59e5cd[_0x7c62('0x1b')]);_0xc2c933[_0x7c62('0x1c')]=_[_0x7c62('0x1d')](_0xc2c933[_0x7c62('0x1a')],_0xc2c933[_0x7c62('0x1b')]);_0xd1c47e[_0x7c62('0x1e')]=_[_0x7c62('0x1d')](_0xc2c933[_0x7c62('0x1a')],qs[_0x7c62('0x1f')](_0x59e5cd[_0x7c62('0x1b')]['fields']));_0xd1c47e['attributes']=_0xd1c47e['attributes'][_0x7c62('0x20')]?_0xd1c47e[_0x7c62('0x1e')]:_0xc2c933[_0x7c62('0x1a')];if(!_0x59e5cd[_0x7c62('0x1b')][_0x7c62('0x21')](_0x7c62('0x22'))){_0xd1c47e[_0x7c62('0xc')]=qs[_0x7c62('0xc')](_0x59e5cd['query']['limit']);_0xd1c47e[_0x7c62('0xa')]=qs[_0x7c62('0xa')](_0x59e5cd[_0x7c62('0x1b')]['offset']);}_0xd1c47e[_0x7c62('0x23')]=qs[_0x7c62('0x24')](_0x59e5cd[_0x7c62('0x1b')][_0x7c62('0x24')]);_0xd1c47e[_0x7c62('0x25')]=qs[_0x7c62('0x1c')](_['pick'](_0x59e5cd[_0x7c62('0x1b')],_0xc2c933[_0x7c62('0x1c')]),_0x415401);if(_0x59e5cd[_0x7c62('0x1b')][_0x7c62('0x26')]){_0xd1c47e[_0x7c62('0x25')]=_[_0x7c62('0x27')](_0xd1c47e[_0x7c62('0x25')],{'$or':_[_0x7c62('0x14')](_0x415401,function(_0xefcac7){if(_0xefcac7[_0x7c62('0x18')]!==_0x7c62('0x28')){var _0x1b8fd0={};_0x1b8fd0[_0xefcac7['name']]={'$like':'%'+_0x59e5cd[_0x7c62('0x1b')][_0x7c62('0x26')]+'%'};return _0x1b8fd0;}})});}_0xd1c47e=_[_0x7c62('0x27')]({},_0xd1c47e,_0x59e5cd['options']);var _0x31b803={'where':_0xd1c47e[_0x7c62('0x25')]};return db['Dynamics365Account']['count'](_0x31b803)['then'](function(_0x32b89e){_0xd2f7c7[_0x7c62('0xd')]=_0x32b89e;if(_0x59e5cd[_0x7c62('0x1b')][_0x7c62('0x29')]){_0xd1c47e[_0x7c62('0x2a')]=[{'all':!![]}];}return db['Dynamics365Account']['findAll'](_0xd1c47e);})['then'](function(_0x393531){_0xd2f7c7[_0x7c62('0x2b')]=_0x393531;return _0xd2f7c7;})[_0x7c62('0x10')](respondWithFilteredResult(_0x28c826,_0xd1c47e))['catch'](handleError(_0x28c826,null));};exports['show']=function(_0x2f9709,_0x8b7768){var _0x1203bf={'raw':![],'where':{'id':_0x2f9709[_0x7c62('0x2c')]['id']}},_0x2ede8b={};_0x2ede8b[_0x7c62('0x1a')]=_[_0x7c62('0x2d')](db[_0x7c62('0x15')]['rawAttributes']);_0x2ede8b[_0x7c62('0x1b')]=_[_0x7c62('0x2d')](_0x2f9709['query']);_0x2ede8b[_0x7c62('0x1c')]=_['intersection'](_0x2ede8b[_0x7c62('0x1a')],_0x2ede8b[_0x7c62('0x1b')]);_0x1203bf['attributes']=_['intersection'](_0x2ede8b['model'],qs[_0x7c62('0x1f')](_0x2f9709['query'][_0x7c62('0x1f')]));_0x1203bf[_0x7c62('0x1e')]=_0x1203bf['attributes']['length']?_0x1203bf[_0x7c62('0x1e')]:_0x2ede8b[_0x7c62('0x1a')];if(_0x2f9709[_0x7c62('0x1b')][_0x7c62('0x29')]){_0x1203bf[_0x7c62('0x2a')]=[{'all':!![]}];}_0x1203bf=_[_0x7c62('0x27')]({},_0x1203bf,_0x2f9709[_0x7c62('0x2e')]);return db[_0x7c62('0x15')]['find'](_0x1203bf)['then'](handleEntityNotFound(_0x8b7768,null))[_0x7c62('0x10')](respondWithResult(_0x8b7768,null))[_0x7c62('0x2f')](handleError(_0x8b7768,null));};exports[_0x7c62('0x30')]=function(_0x3abbf2,_0x3e4a87){return db[_0x7c62('0x15')][_0x7c62('0x30')](_0x3abbf2[_0x7c62('0x31')],{})['then'](respondWithResult(_0x3e4a87,0xc9))[_0x7c62('0x2f')](handleError(_0x3e4a87,null));};exports[_0x7c62('0xe')]=function(_0x1001c6,_0x3f0b5f){if(_0x1001c6[_0x7c62('0x31')]['id']){delete _0x1001c6[_0x7c62('0x31')]['id'];}return db['Dynamics365Account'][_0x7c62('0x32')]({'where':{'id':_0x1001c6['params']['id']}})[_0x7c62('0x10')](handleEntityNotFound(_0x3f0b5f,null))[_0x7c62('0x10')](saveUpdates(_0x1001c6[_0x7c62('0x31')],null))[_0x7c62('0x10')](respondWithResult(_0x3f0b5f,null))[_0x7c62('0x2f')](handleError(_0x3f0b5f,null));};exports[_0x7c62('0xf')]=function(_0x1301a6,_0x2feec0){return db['Dynamics365Account'][_0x7c62('0x32')]({'where':{'id':_0x1301a6[_0x7c62('0x2c')]['id']}})[_0x7c62('0x10')](handleEntityNotFound(_0x2feec0,null))[_0x7c62('0x10')](removeEntity(_0x2feec0,null))[_0x7c62('0x2f')](handleError(_0x2feec0,null));};exports['getConfigurations']=function(_0x2d52d7,_0x464632){var _0x1eb5ff={};var _0x49e9e5={};var _0x488cd5;var _0x200ab9;return db['Dynamics365Account'][_0x7c62('0x33')]({'where':{'id':_0x2d52d7[_0x7c62('0x2c')]['id']}})[_0x7c62('0x10')](handleEntityNotFound(_0x464632,null))[_0x7c62('0x10')](function(_0x3dd48b){if(_0x3dd48b){_0x488cd5=_0x3dd48b;_0x49e9e5['model']=_['keys'](db[_0x7c62('0x34')][_0x7c62('0x16')]);_0x49e9e5['query']=_[_0x7c62('0x2d')](_0x2d52d7[_0x7c62('0x1b')]);_0x49e9e5[_0x7c62('0x1c')]=_[_0x7c62('0x1d')](_0x49e9e5[_0x7c62('0x1a')],_0x49e9e5[_0x7c62('0x1b')]);_0x1eb5ff[_0x7c62('0x1e')]=_['intersection'](_0x49e9e5['model'],qs[_0x7c62('0x1f')](_0x2d52d7['query']['fields']));_0x1eb5ff['attributes']=_0x1eb5ff[_0x7c62('0x1e')]['length']?_0x1eb5ff['attributes']:_0x49e9e5[_0x7c62('0x1a')];_0x1eb5ff[_0x7c62('0x23')]=qs[_0x7c62('0x24')](_0x2d52d7[_0x7c62('0x1b')][_0x7c62('0x24')]);_0x1eb5ff['where']=qs[_0x7c62('0x1c')](_[_0x7c62('0x35')](_0x2d52d7['query'],_0x49e9e5[_0x7c62('0x1c')]));if(_0x2d52d7[_0x7c62('0x1b')][_0x7c62('0x26')]){_0x1eb5ff['where']=_[_0x7c62('0x27')](_0x1eb5ff[_0x7c62('0x25')],{'$or':_['map'](_0x1eb5ff['attributes'],function(_0xee1024){var _0x4ee884={};_0x4ee884[_0xee1024]={'$like':'%'+_0x2d52d7[_0x7c62('0x1b')]['filter']+'%'};return _0x4ee884;})});}_0x1eb5ff=_[_0x7c62('0x27')]({},_0x1eb5ff,_0x2d52d7[_0x7c62('0x2e')]);return _0x488cd5['getConfigurations'](_0x1eb5ff);}})['then'](function(_0x4b4c3a){if(_0x4b4c3a){_0x200ab9=_0x4b4c3a['length'];if(!_0x2d52d7[_0x7c62('0x1b')][_0x7c62('0x21')](_0x7c62('0x22'))){_0x1eb5ff[_0x7c62('0xc')]=qs[_0x7c62('0xc')](_0x2d52d7[_0x7c62('0x1b')]['limit']);_0x1eb5ff['offset']=qs[_0x7c62('0xa')](_0x2d52d7[_0x7c62('0x1b')]['offset']);}return _0x488cd5['getConfigurations'](_0x1eb5ff);}})['then'](function(_0x313ec5){if(_0x313ec5){return _0x313ec5?{'count':_0x200ab9,'rows':_0x313ec5}:null;}})[_0x7c62('0x10')](respondWithResult(_0x464632,null))[_0x7c62('0x2f')](handleError(_0x464632,null));};exports[_0x7c62('0x36')]=function(_0x3cd5ec,_0x8cf6eb){if(_0x3cd5ec['body']['id']){delete _0x3cd5ec[_0x7c62('0x31')]['id'];}return db['Dynamics365Account'][_0x7c62('0x33')]({'where':{'id':_0x3cd5ec[_0x7c62('0x2c')]['id']}})[_0x7c62('0x10')](handleEntityNotFound(_0x8cf6eb,null))['then'](function(_0x1cd314){if(_0x1cd314){_0x3cd5ec[_0x7c62('0x31')][_0x7c62('0x37')]=_0x1cd314['id'];_0x3cd5ec[_0x7c62('0x31')][_0x7c62('0x38')]=integrations['getSubjects'](_0x3cd5ec['body']['channel'],_0x3cd5ec[_0x7c62('0x31')][_0x7c62('0x18')]);_0x3cd5ec[_0x7c62('0x31')][_0x7c62('0x39')]=integrations[_0x7c62('0x3a')](_0x3cd5ec['body'][_0x7c62('0x3b')],_0x3cd5ec[_0x7c62('0x31')]['type']);return db[_0x7c62('0x34')][_0x7c62('0x30')](_0x3cd5ec[_0x7c62('0x31')],{'include':[{'model':db[_0x7c62('0x3c')],'as':_0x7c62('0x38')},{'model':db[_0x7c62('0x3c')],'as':_0x7c62('0x39')}]});}return null;})[_0x7c62('0x10')](respondWithResult(_0x8cf6eb,null))[_0x7c62('0x2f')](handleError(_0x8cf6eb,null));};function sanitizeRemoteUri(_0x3a4194){var _0x51f0c1=_0x3a4194[_0x7c62('0x3d')](-0x1);if(_0x51f0c1==='/')return _0x3a4194[_0x7c62('0x3e')](0x0,_0x3a4194[_0x7c62('0x3f')](_0x51f0c1));return _0x3a4194;}function getWebApiUrl(_0x395f5b){return util[_0x7c62('0x40')](_0x7c62('0x41'),_0x395f5b);}exports[_0x7c62('0x42')]=function(_0x229239,_0x4d986b){var _0xf5d57=_0x229239[_0x7c62('0x1b')][_0x7c62('0x43')];var _0x1d2180=_0xf5d57===_0x7c62('0x44')?'Incident':_0x7c62('0x45');var _0x4c387b='';var _0x261cd0='';var _0x540859='';var _0x414015='';var _0x538693='';var _0xfb8374='';var _0x2fcd78='';var _0x3418b7='';var _0x3bf139=['title','description','customerid',_0x7c62('0x46'),_0x7c62('0x47'),_0x7c62('0x48'),_0x7c62('0x49'),_0x7c62('0x4a'),'directioncode',_0x7c62('0x4b')];var _0x16b235=['accountidname',_0x7c62('0x4c'),_0x7c62('0x4d'),_0x7c62('0x4e'),'contactidname',_0x7c62('0x4f'),_0x7c62('0x50'),_0x7c62('0x51'),'createdbyexternalpartyname','createdbyexternalpartyyominame',_0x7c62('0x52'),'createdbyyominame',_0x7c62('0x53'),_0x7c62('0x54'),'createdonbehalfbyyominame',_0x7c62('0x55'),_0x7c62('0x56'),_0x7c62('0x57'),'emailaddress',_0x7c62('0x58'),_0x7c62('0x59'),'entityimage_url',_0x7c62('0x5a'),_0x7c62('0x5b'),_0x7c62('0x5c'),_0x7c62('0x5d'),_0x7c62('0x5e'),_0x7c62('0x5f'),_0x7c62('0x60'),_0x7c62('0x61'),'masteridname','modifiedbyexternalpartyname',_0x7c62('0x62'),'modifiedbyname','modifiedbyyominame',_0x7c62('0x63'),'modifiedonbehalfbyname','modifiedonbehalfbyyominame',_0x7c62('0x64'),_0x7c62('0x65'),'numberofchildincidents',_0x7c62('0x66'),'overriddencreatedon',_0x7c62('0x67'),_0x7c62('0x68'),_0x7c62('0x69'),_0x7c62('0x6a'),'primarycontactidname',_0x7c62('0x6b'),_0x7c62('0x6c'),_0x7c62('0x6d'),'productserialnumber',_0x7c62('0x6e'),_0x7c62('0x6f'),_0x7c62('0x70'),'responsiblecontactidname',_0x7c62('0x71'),_0x7c62('0x72'),_0x7c62('0x73'),_0x7c62('0x74'),_0x7c62('0x75'),_0x7c62('0x76'),_0x7c62('0x77'),_0x7c62('0x78'),_0x7c62('0x79'),_0x7c62('0x7a'),_0x7c62('0x7b'),_0x7c62('0x7c'),'utcconversiontimezonecode',_0x7c62('0x7d')];var _0x187e1f=_0x3bf139[_0x7c62('0x7e')](_0x16b235);return db[_0x7c62('0x15')]['findOne']({'where':{'id':_0x229239[_0x7c62('0x2c')]['id']},'attributes':['id',_0x7c62('0x7f'),_0x7c62('0x80'),_0x7c62('0x81'),_0x7c62('0x82'),_0x7c62('0x83'),_0x7c62('0x84'),_0x7c62('0x85')],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','attributes':['id',_0x7c62('0x86'),_0x7c62('0x87')]}]})[_0x7c62('0x10')](handleEntityNotFound(_0x4d986b,null))[_0x7c62('0x10')](function(_0x7e52b2){if(_0x7e52b2){if(_0x7e52b2['modernAuthentication']){_0x7e52b2[_0x7c62('0x88')]=_0x7e52b2[_0x7c62('0x89')][_0x7c62('0x86')];_0x3418b7=sanitizeRemoteUri(_0x7e52b2[_0x7c62('0x89')][_0x7c62('0x87')]);_0x2fcd78=getWebApiUrl(_0x3418b7);return _0x7e52b2;}_0x3418b7=sanitizeRemoteUri(_0x7e52b2['remoteUri']);_0x2fcd78=getWebApiUrl(_0x3418b7);var _0x2efdbe={'method':_0x7c62('0x8a'),'uri':_0x7c62('0x8b')+_0x7e52b2[_0x7c62('0x82')]+_0x7c62('0x8c'),'form':{'client_id':_0x7e52b2[_0x7c62('0x83')],'resource':_0x3418b7,'username':_0x7e52b2[_0x7c62('0x7f')],'password':_0x7e52b2[_0x7c62('0x80')],'grant_type':_0x7c62('0x80'),'client_secret':_0x7e52b2[_0x7c62('0x84')]},'json':!![]};return rp(_0x2efdbe);}})[_0x7c62('0x10')](function(_0x5d3804){_0xfb8374=_0x5d3804[_0x7c62('0x88')];var _0x3ae728={'method':_0x7c62('0x8d'),'uri':encodeURI(_0x2fcd78+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x1d2180+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0xfb8374,'If-None-Match':null,'OData-Version':_0x7c62('0x8e')},'json':!![]};return rp(_0x3ae728);})['then'](function(_0x3fd514){var _0x414cb6=_0x3fd514['value'][0x0];var _0x2afb40=_0x414cb6['MetadataId'];var _0x15ab8e={'method':'GET','uri':_0x2fcd78+_0x7c62('0x8f')+_0x2afb40+_0x7c62('0x90'),'headers':{'Authorization':_0x7c62('0x91')+_0xfb8374,'If-None-Match':null,'OData-Version':_0x7c62('0x8e')},'json':!![]};return rp(_0x15ab8e);})[_0x7c62('0x10')](function(_0x2116dd){_0x4c387b=_0x2116dd;_0x261cd0=_0x4c387b['Attributes'];_0x261cd0=_[_0x7c62('0x92')](_0x261cd0,function(_0xdf685){return!_0x187e1f[_0x7c62('0x93')](_0xdf685[_0x7c62('0x94')]);});var _0xe5763a=[];var _0x12103a=[];_0x261cd0['forEach'](function(_0x254a83){if(_0x254a83[_0x7c62('0x95')]){var _0x3d9b5e=_0x254a83[_0x7c62('0x95')][_0x7c62('0x3e')](_0x254a83[_0x7c62('0x95')][_0x7c62('0x3f')]('.')+0x1);if(_0x3d9b5e===_0x7c62('0x96')){_0xe5763a[_0x7c62('0x97')](getSelectList(_0x2fcd78,_0xf5d57,_0x12103a,_0x4c387b[_0x7c62('0x98')],_0x254a83[_0x7c62('0x98')],_0xfb8374));}}});return Promise[_0x7c62('0x99')](_0xe5763a);})['then'](function(_0x16dd94){_0x540859=_0x16dd94[0x0];var _0xa62e9f=[];var _0x2a1b97=[];_0x261cd0['forEach'](function(_0x3261dd){if(!_[_0x7c62('0x9a')](_0x3261dd[_0x7c62('0x95')])){var _0x3d2856=_0x3261dd['@odata.type']['substring'](_0x3261dd[_0x7c62('0x95')][_0x7c62('0x3f')]('.')+0x1);if(_0x3d2856==='BooleanAttributeMetadata'){_0xa62e9f['push'](getBooleanList(_0x2fcd78,_0xf5d57,_0x2a1b97,_0x4c387b[_0x7c62('0x98')],_0x3261dd[_0x7c62('0x98')],_0xfb8374));}}});return Promise[_0x7c62('0x99')](_0xa62e9f);})['then'](function(_0x466ec0){_0x414015=_0x466ec0[0x0];var _0x4efce4=[];var _0x247827=[];_0x261cd0[_0x7c62('0x9b')](function(_0xc4649d){if(_0xc4649d[_0x7c62('0x95')]){var _0x384219=_0xc4649d[_0x7c62('0x95')][_0x7c62('0x3e')](_0xc4649d[_0x7c62('0x95')][_0x7c62('0x3f')]('.')+0x1);if(_0x384219==='StringAttributeMetadata'||_0x384219===_0x7c62('0x9c')||_0x384219===_0x7c62('0x9d')||_0x384219==='IntegerAttributeMetadata'||_0x384219===_0x7c62('0x9e')||_0x384219==='DateTimeAttributeMetadata'||_0x384219===_0x7c62('0x9f')||_0x384219==='EntityNameAttributeMetadata'||_0x384219===_0x7c62('0xa0')||_0x384219==='DecimalAttributeMetadata'){_0x4efce4[_0x7c62('0x97')](getInputList(_0x2fcd78,_0xf5d57,_0x384219,_0x247827,_0x4c387b[_0x7c62('0x98')],_0xc4649d[_0x7c62('0x98')],_0xfb8374));}}});return Promise['all'](_0x4efce4);})[_0x7c62('0x10')](function(_0x3b9c51){_0x538693=_0x3b9c51[0x0];var _0x26a874=_0x540859[_0x7c62('0x7e')](_0x414015)[_0x7c62('0x7e')](_0x538693);var _0x20583d={'count':_0x26a874[_0x7c62('0x20')],'rows':_0x26a874};return _0x20583d;})['then'](respondWithResult(_0x4d986b,null))[_0x7c62('0x2f')](function(_0x51370d){var _0x54fc8a=_0x229239[_0x7c62('0x1b')]['test']?0x1f4:_0x51370d[_0x7c62('0xa1')]||0x1f4;logger['error'](_0x51370d[_0x7c62('0x12')]);delete _0x51370d[_0x7c62('0x13')];if(_0x54fc8a===0x191){_0x54fc8a=0x190;}_0x4d986b[_0x7c62('0x8')](_0x54fc8a)['send'](_0x229239[_0x7c62('0x1b')][_0x7c62('0xa2')]?{'message':'Wrong\x20credentials','statusCode':_0x51370d[_0x7c62('0xa1')]}:_0x51370d);});};function getSelectList(_0x325a80,_0x2154cf,_0x15c893,_0xd3b70a,_0x15125f,_0x442865){var _0x3dc181={'method':_0x7c62('0x8d'),'uri':_0x325a80+'EntityDefinitions('+_0xd3b70a+')/Attributes('+_0x15125f+_0x7c62('0xa3')+_0x7c62('0xa4'),'headers':{'Authorization':_0x7c62('0x91')+_0x442865,'If-None-Match':null,'OData-Version':_0x7c62('0x8e')},'json':!![]};return rp(_0x3dc181)[_0x7c62('0x10')](function(_0x4ce983){var _0x2323dd=[];var _0x3b7194=_0x4ce983[_0x7c62('0xa5')][_0x7c62('0xa6')];_0x3b7194[_0x7c62('0x9b')](function(_0x1884d1){_0x2323dd[_0x7c62('0x97')]({'name':_0x1884d1[_0x7c62('0xa7')][_0x7c62('0xa8')][_0x7c62('0xa7')],'value':String(_0x1884d1[_0x7c62('0xa9')])});});var _0x171e9b={'id':_0x2154cf+'_'+_0x4ce983[_0x7c62('0x94')],'name':_0x4ce983[_0x7c62('0xaa')][_0x7c62('0xa8')][_0x7c62('0xa7')],'custom':![],'options':_0x2323dd};_0x15c893[_0x7c62('0x97')](_0x171e9b);return _0x15c893;});}function getBooleanList(_0x3304d4,_0x219893,_0x3c24aa,_0x3f3541,_0x34a9d7,_0x385e6f){var _0x18aaa0={'method':_0x7c62('0x8d'),'uri':_0x3304d4+'EntityDefinitions('+_0x3f3541+_0x7c62('0xab')+_0x34a9d7+_0x7c62('0xac'),'headers':{'Authorization':_0x7c62('0x91')+_0x385e6f,'If-None-Match':null,'OData-Version':_0x7c62('0x8e')},'json':!![]};return rp(_0x18aaa0)[_0x7c62('0x10')](function(_0x3cc0c7){var _0x2d42c8=[];_0x2d42c8[_0x7c62('0x97')]({'name':_0x3cc0c7[_0x7c62('0xa5')][_0x7c62('0xad')][_0x7c62('0xa7')][_0x7c62('0xa8')][_0x7c62('0xa7')],'value':_0x7c62('0xae')},{'name':_0x3cc0c7[_0x7c62('0xa5')][_0x7c62('0xaf')][_0x7c62('0xa7')][_0x7c62('0xa8')][_0x7c62('0xa7')],'value':_0x7c62('0xb0')});var _0x173b03={'id':_0x219893+'_'+_0x3cc0c7[_0x7c62('0x94')],'name':_0x3cc0c7['DisplayName']['UserLocalizedLabel'][_0x7c62('0xa7')],'custom':![],'options':_0x2d42c8};_0x3c24aa[_0x7c62('0x97')](_0x173b03);return _0x3c24aa;});}function getInputList(_0x35f234,_0x5b22f0,_0x2a4332,_0x10671f,_0x470c40,_0x1af97e,_0x457f73){var _0x39289f={'method':_0x7c62('0x8d'),'uri':_0x35f234+_0x7c62('0x8f')+_0x470c40+')/Attributes('+_0x1af97e+_0x7c62('0xb1')+_0x2a4332+_0x7c62('0xb2'),'headers':{'Authorization':_0x7c62('0x91')+_0x457f73,'If-None-Match':null,'OData-Version':_0x7c62('0x8e')},'json':!![]};return rp(_0x39289f)[_0x7c62('0x10')](function(_0xb75096){var _0x5a91e7={'id':_0x5b22f0+'_'+_0xb75096[_0x7c62('0x94')],'name':_0xb75096[_0x7c62('0xaa')][_0x7c62('0xa8')]?_0xb75096[_0x7c62('0xaa')]['UserLocalizedLabel'][_0x7c62('0xa7')]:_0xb75096['LogicalName'],'custom':![],'options':[]};_0x10671f['push'](_0x5a91e7);return _0x10671f;});} \ No newline at end of file +var _0xfd11=['Dynamics365Account','findAll','catch','params','find','create','body','getConfigurations','Dynamics365Configuration','order','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','Descriptions','getDescriptions','slice','substring','lastIndexOf','%s/api/data/v9.0/','ticketType','incident','Incident','PhoneCall','description','subject','phonenumber','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','escalatedon','followupby','importsequencenumber','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','slaname','socialprofileidname','statecode','statuscode','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','username','password','remoteUri','tenantId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','POST','/oauth2/token','clientId','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','includes','LogicalName','forEach','@odata.type','push','all','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','statusCode','send','test','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','false','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','update','then','destroy','end','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include'];(function(_0x407836,_0xa1b373){var _0x1dcd8a=function(_0x2f6b28){while(--_0x2f6b28){_0x407836['push'](_0x407836['shift']());}};_0x1dcd8a(++_0xa1b373);}(_0xfd11,0x13a));var _0x1fd1=function(_0x1ae4a9,_0x4c0ed9){_0x1ae4a9=_0x1ae4a9-0x0;var _0x54d0b0=_0xfd11[_0x1ae4a9];return _0x54d0b0;};'use strict';var rp=require('request-promise');var util=require(_0x1fd1('0x0'));var _=require(_0x1fd1('0x1'));var qs=require(_0x1fd1('0x2'));var logger=require(_0x1fd1('0x3'))(_0x1fd1('0x4'));var db=require(_0x1fd1('0x5'))['db'];var integrations=require(_0x1fd1('0x6'));function respondWithResult(_0x261e5a,_0x3adf66){_0x3adf66=_0x3adf66||0xc8;return function(_0x4810b9){if(_0x4810b9){return _0x261e5a[_0x1fd1('0x7')](_0x3adf66)[_0x1fd1('0x8')](_0x4810b9);}};}function respondWithFilteredResult(_0x45b681,_0x59ac4b){return function(_0x1ed666){if(_0x1ed666){var _0x35308b=typeof _0x59ac4b[_0x1fd1('0x9')]===_0x1fd1('0xa')&&typeof _0x59ac4b['limit']==='undefined';var _0x51ee4a=_0x1ed666['count'];var _0x36d65c=_0x35308b?0x0:_0x59ac4b[_0x1fd1('0x9')];var _0x13f954=_0x35308b?_0x1ed666['count']:_0x59ac4b['offset']+_0x59ac4b['limit'];var _0x5156a7;if(_0x13f954>=_0x51ee4a){_0x13f954=_0x51ee4a;_0x5156a7=0xc8;}else{_0x5156a7=0xce;}_0x45b681[_0x1fd1('0x7')](_0x5156a7);return _0x45b681['set']('Content-Range',_0x36d65c+'-'+_0x13f954+'/'+_0x51ee4a)[_0x1fd1('0x8')](_0x1ed666);}return null;};}function saveUpdates(_0x212b08){return function(_0xbd48a6){if(_0xbd48a6){return _0xbd48a6[_0x1fd1('0xb')](_0x212b08)[_0x1fd1('0xc')](function(_0x4fbd1b){return _0x4fbd1b;});}return null;};}function removeEntity(_0xe26537){return function(_0x2b8e4e){if(_0x2b8e4e){return _0x2b8e4e[_0x1fd1('0xd')]()[_0x1fd1('0xc')](function(){_0xe26537['status'](0xcc)[_0x1fd1('0xe')]();});}};}function handleEntityNotFound(_0x55217c){return function(_0x213526){if(!_0x213526){_0x55217c['sendStatus'](0x194);}return _0x213526;};}function handleError(_0x5d696a,_0x49c5c6){_0x49c5c6=_0x49c5c6||0x1f4;return function(_0x3b0907){logger[_0x1fd1('0xf')](_0x3b0907[_0x1fd1('0x10')]);if(_0x3b0907[_0x1fd1('0x11')]){delete _0x3b0907[_0x1fd1('0x11')];}_0x5d696a[_0x1fd1('0x7')](_0x49c5c6)['send'](_0x3b0907);};}exports[_0x1fd1('0x12')]=function(_0x313296,_0x1c1dbd){var _0x50b60a={},_0x230037={},_0x192faa={'count':0x0,'rows':[]};var _0x56f77f=_['map'](db['Dynamics365Account'][_0x1fd1('0x13')],function(_0x11886b){return{'name':_0x11886b[_0x1fd1('0x14')],'type':_0x11886b[_0x1fd1('0x15')][_0x1fd1('0x16')]};});_0x230037[_0x1fd1('0x17')]=_[_0x1fd1('0x18')](_0x56f77f,_0x1fd1('0x11'));_0x230037[_0x1fd1('0x19')]=_[_0x1fd1('0x1a')](_0x313296[_0x1fd1('0x19')]);_0x230037[_0x1fd1('0x1b')]=_[_0x1fd1('0x1c')](_0x230037['model'],_0x230037[_0x1fd1('0x19')]);_0x50b60a[_0x1fd1('0x1d')]=_[_0x1fd1('0x1c')](_0x230037[_0x1fd1('0x17')],qs[_0x1fd1('0x1e')](_0x313296[_0x1fd1('0x19')]['fields']));_0x50b60a['attributes']=_0x50b60a['attributes'][_0x1fd1('0x1f')]?_0x50b60a[_0x1fd1('0x1d')]:_0x230037[_0x1fd1('0x17')];if(!_0x313296[_0x1fd1('0x19')]['hasOwnProperty'](_0x1fd1('0x20'))){_0x50b60a['limit']=qs['limit'](_0x313296[_0x1fd1('0x19')][_0x1fd1('0x21')]);_0x50b60a['offset']=qs['offset'](_0x313296[_0x1fd1('0x19')]['offset']);}_0x50b60a['order']=qs[_0x1fd1('0x22')](_0x313296[_0x1fd1('0x19')][_0x1fd1('0x22')]);_0x50b60a[_0x1fd1('0x23')]=qs[_0x1fd1('0x1b')](_[_0x1fd1('0x24')](_0x313296[_0x1fd1('0x19')],_0x230037['filters']),_0x56f77f);if(_0x313296['query']['filter']){_0x50b60a[_0x1fd1('0x23')]=_[_0x1fd1('0x25')](_0x50b60a[_0x1fd1('0x23')],{'$or':_[_0x1fd1('0x18')](_0x56f77f,function(_0xf8ca63){if(_0xf8ca63[_0x1fd1('0x15')]!==_0x1fd1('0x26')){var _0x304e9e={};_0x304e9e[_0xf8ca63[_0x1fd1('0x11')]]={'$like':'%'+_0x313296[_0x1fd1('0x19')][_0x1fd1('0x27')]+'%'};return _0x304e9e;}})});}_0x50b60a=_[_0x1fd1('0x25')]({},_0x50b60a,_0x313296[_0x1fd1('0x28')]);var _0x5737f3={'where':_0x50b60a[_0x1fd1('0x23')]};return db['Dynamics365Account']['count'](_0x5737f3)[_0x1fd1('0xc')](function(_0x34e9aa){_0x192faa[_0x1fd1('0x29')]=_0x34e9aa;if(_0x313296[_0x1fd1('0x19')][_0x1fd1('0x2a')]){_0x50b60a[_0x1fd1('0x2b')]=[{'all':!![]}];}return db[_0x1fd1('0x2c')][_0x1fd1('0x2d')](_0x50b60a);})['then'](function(_0x528bf0){_0x192faa['rows']=_0x528bf0;return _0x192faa;})[_0x1fd1('0xc')](respondWithFilteredResult(_0x1c1dbd,_0x50b60a))[_0x1fd1('0x2e')](handleError(_0x1c1dbd,null));};exports['show']=function(_0x12595d,_0x56dfae){var _0x117c67={'raw':![],'where':{'id':_0x12595d[_0x1fd1('0x2f')]['id']}},_0x3c00c6={};_0x3c00c6['model']=_[_0x1fd1('0x1a')](db[_0x1fd1('0x2c')][_0x1fd1('0x13')]);_0x3c00c6[_0x1fd1('0x19')]=_['keys'](_0x12595d['query']);_0x3c00c6[_0x1fd1('0x1b')]=_['intersection'](_0x3c00c6[_0x1fd1('0x17')],_0x3c00c6[_0x1fd1('0x19')]);_0x117c67[_0x1fd1('0x1d')]=_[_0x1fd1('0x1c')](_0x3c00c6[_0x1fd1('0x17')],qs[_0x1fd1('0x1e')](_0x12595d[_0x1fd1('0x19')][_0x1fd1('0x1e')]));_0x117c67[_0x1fd1('0x1d')]=_0x117c67['attributes'][_0x1fd1('0x1f')]?_0x117c67[_0x1fd1('0x1d')]:_0x3c00c6[_0x1fd1('0x17')];if(_0x12595d[_0x1fd1('0x19')][_0x1fd1('0x2a')]){_0x117c67[_0x1fd1('0x2b')]=[{'all':!![]}];}_0x117c67=_[_0x1fd1('0x25')]({},_0x117c67,_0x12595d[_0x1fd1('0x28')]);return db[_0x1fd1('0x2c')][_0x1fd1('0x30')](_0x117c67)[_0x1fd1('0xc')](handleEntityNotFound(_0x56dfae,null))[_0x1fd1('0xc')](respondWithResult(_0x56dfae,null))[_0x1fd1('0x2e')](handleError(_0x56dfae,null));};exports[_0x1fd1('0x31')]=function(_0x35af0a,_0x8e7d86){return db['Dynamics365Account']['create'](_0x35af0a[_0x1fd1('0x32')],{})[_0x1fd1('0xc')](respondWithResult(_0x8e7d86,0xc9))[_0x1fd1('0x2e')](handleError(_0x8e7d86,null));};exports[_0x1fd1('0xb')]=function(_0x4d5fd,_0x4f52ef){if(_0x4d5fd[_0x1fd1('0x32')]['id']){delete _0x4d5fd[_0x1fd1('0x32')]['id'];}return db[_0x1fd1('0x2c')][_0x1fd1('0x30')]({'where':{'id':_0x4d5fd['params']['id']}})[_0x1fd1('0xc')](handleEntityNotFound(_0x4f52ef,null))[_0x1fd1('0xc')](saveUpdates(_0x4d5fd['body'],null))[_0x1fd1('0xc')](respondWithResult(_0x4f52ef,null))['catch'](handleError(_0x4f52ef,null));};exports[_0x1fd1('0xd')]=function(_0x256825,_0x5f3a3f){return db['Dynamics365Account'][_0x1fd1('0x30')]({'where':{'id':_0x256825[_0x1fd1('0x2f')]['id']}})[_0x1fd1('0xc')](handleEntityNotFound(_0x5f3a3f,null))[_0x1fd1('0xc')](removeEntity(_0x5f3a3f,null))['catch'](handleError(_0x5f3a3f,null));};exports[_0x1fd1('0x33')]=function(_0x3f64a6,_0x8cebea){var _0x1740e3={};var _0x465454={};var _0x174382;var _0x5575b4;return db[_0x1fd1('0x2c')]['findOne']({'where':{'id':_0x3f64a6[_0x1fd1('0x2f')]['id']}})[_0x1fd1('0xc')](handleEntityNotFound(_0x8cebea,null))[_0x1fd1('0xc')](function(_0x38d45b){if(_0x38d45b){_0x174382=_0x38d45b;_0x465454[_0x1fd1('0x17')]=_[_0x1fd1('0x1a')](db[_0x1fd1('0x34')][_0x1fd1('0x13')]);_0x465454[_0x1fd1('0x19')]=_[_0x1fd1('0x1a')](_0x3f64a6[_0x1fd1('0x19')]);_0x465454[_0x1fd1('0x1b')]=_['intersection'](_0x465454[_0x1fd1('0x17')],_0x465454['query']);_0x1740e3['attributes']=_[_0x1fd1('0x1c')](_0x465454['model'],qs[_0x1fd1('0x1e')](_0x3f64a6['query'][_0x1fd1('0x1e')]));_0x1740e3[_0x1fd1('0x1d')]=_0x1740e3[_0x1fd1('0x1d')]['length']?_0x1740e3[_0x1fd1('0x1d')]:_0x465454[_0x1fd1('0x17')];_0x1740e3[_0x1fd1('0x35')]=qs[_0x1fd1('0x22')](_0x3f64a6[_0x1fd1('0x19')]['sort']);_0x1740e3['where']=qs[_0x1fd1('0x1b')](_[_0x1fd1('0x24')](_0x3f64a6[_0x1fd1('0x19')],_0x465454[_0x1fd1('0x1b')]));if(_0x3f64a6[_0x1fd1('0x19')]['filter']){_0x1740e3[_0x1fd1('0x23')]=_[_0x1fd1('0x25')](_0x1740e3[_0x1fd1('0x23')],{'$or':_[_0x1fd1('0x18')](_0x1740e3[_0x1fd1('0x1d')],function(_0x1a4556){var _0x190c96={};_0x190c96[_0x1a4556]={'$like':'%'+_0x3f64a6[_0x1fd1('0x19')]['filter']+'%'};return _0x190c96;})});}_0x1740e3=_[_0x1fd1('0x25')]({},_0x1740e3,_0x3f64a6[_0x1fd1('0x28')]);return _0x174382[_0x1fd1('0x33')](_0x1740e3);}})[_0x1fd1('0xc')](function(_0x44e5a9){if(_0x44e5a9){_0x5575b4=_0x44e5a9['length'];if(!_0x3f64a6['query'][_0x1fd1('0x36')](_0x1fd1('0x20'))){_0x1740e3[_0x1fd1('0x21')]=qs['limit'](_0x3f64a6[_0x1fd1('0x19')]['limit']);_0x1740e3[_0x1fd1('0x9')]=qs['offset'](_0x3f64a6['query'][_0x1fd1('0x9')]);}return _0x174382[_0x1fd1('0x33')](_0x1740e3);}})['then'](function(_0x30230a){if(_0x30230a){return _0x30230a?{'count':_0x5575b4,'rows':_0x30230a}:null;}})['then'](respondWithResult(_0x8cebea,null))['catch'](handleError(_0x8cebea,null));};exports[_0x1fd1('0x37')]=function(_0x185ad5,_0x27b2da){if(_0x185ad5[_0x1fd1('0x32')]['id']){delete _0x185ad5[_0x1fd1('0x32')]['id'];}return db['Dynamics365Account'][_0x1fd1('0x38')]({'where':{'id':_0x185ad5[_0x1fd1('0x2f')]['id']}})['then'](handleEntityNotFound(_0x27b2da,null))[_0x1fd1('0xc')](function(_0x3bf0c6){if(_0x3bf0c6){_0x185ad5[_0x1fd1('0x32')][_0x1fd1('0x39')]=_0x3bf0c6['id'];_0x185ad5['body'][_0x1fd1('0x3a')]=integrations['getSubjects'](_0x185ad5[_0x1fd1('0x32')]['channel'],_0x185ad5[_0x1fd1('0x32')][_0x1fd1('0x15')]);_0x185ad5[_0x1fd1('0x32')][_0x1fd1('0x3b')]=integrations[_0x1fd1('0x3c')](_0x185ad5[_0x1fd1('0x32')]['channel'],_0x185ad5[_0x1fd1('0x32')][_0x1fd1('0x15')]);return db[_0x1fd1('0x34')][_0x1fd1('0x31')](_0x185ad5['body'],{'include':[{'model':db['Dynamics365Field'],'as':'Subjects'},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0x1fd1('0xc')](respondWithResult(_0x27b2da,null))['catch'](handleError(_0x27b2da,null));};function sanitizeRemoteUri(_0x22f78a){var _0x39cdd6=_0x22f78a[_0x1fd1('0x3d')](-0x1);if(_0x39cdd6==='/')return _0x22f78a[_0x1fd1('0x3e')](0x0,_0x22f78a[_0x1fd1('0x3f')](_0x39cdd6));return _0x22f78a;}function getWebApiUrl(_0x3b2482){return util['format'](_0x1fd1('0x40'),_0x3b2482);}exports['getFields']=function(_0x314102,_0x19a152){var _0xfe5a2a=_0x314102[_0x1fd1('0x19')][_0x1fd1('0x41')];var _0x29f9bf=_0xfe5a2a===_0x1fd1('0x42')?_0x1fd1('0x43'):_0x1fd1('0x44');var _0xb05aee='';var _0x146292='';var _0x52af96='';var _0x3d809c='';var _0x37066c='';var _0x473edf='';var _0x36ca2e='';var _0x1f9c4f='';var _0x1af2cb=['title',_0x1fd1('0x45'),'customerid','ownerid','caseorigincode',_0x1fd1('0x46'),_0x1fd1('0x47'),'regardingobjectid',_0x1fd1('0x48'),_0x1fd1('0x49')];var _0x366e8f=[_0x1fd1('0x4a'),_0x1fd1('0x4b'),_0x1fd1('0x4c'),_0x1fd1('0x4d'),_0x1fd1('0x4e'),'contactidyominame',_0x1fd1('0x4f'),_0x1fd1('0x50'),_0x1fd1('0x51'),_0x1fd1('0x52'),_0x1fd1('0x53'),_0x1fd1('0x54'),_0x1fd1('0x55'),_0x1fd1('0x56'),_0x1fd1('0x57'),_0x1fd1('0x58'),'customeridtype',_0x1fd1('0x59'),_0x1fd1('0x5a'),_0x1fd1('0x5b'),_0x1fd1('0x5c'),'entityimage_url',_0x1fd1('0x5d'),'exchangerate','firstresponsebykpiidname',_0x1fd1('0x5e'),_0x1fd1('0x5f'),'influencescore',_0x1fd1('0x60'),_0x1fd1('0x61'),'masteridname',_0x1fd1('0x62'),'modifiedbyexternalpartyyominame',_0x1fd1('0x63'),_0x1fd1('0x64'),_0x1fd1('0x65'),_0x1fd1('0x66'),_0x1fd1('0x67'),_0x1fd1('0x68'),_0x1fd1('0x69'),'numberofchildincidents',_0x1fd1('0x6a'),_0x1fd1('0x6b'),_0x1fd1('0x6c'),'owneridtype',_0x1fd1('0x6d'),_0x1fd1('0x6e'),_0x1fd1('0x6f'),'primarycontactidyominame',_0x1fd1('0x70'),_0x1fd1('0x71'),_0x1fd1('0x72'),_0x1fd1('0x73'),_0x1fd1('0x74'),'responseby',_0x1fd1('0x75'),'responsiblecontactidyominame','sentimentvalue','slainvokedidname',_0x1fd1('0x76'),_0x1fd1('0x77'),_0x1fd1('0x78'),_0x1fd1('0x79'),'subjectidname','ticketnumber',_0x1fd1('0x7a'),'transactioncurrencyidname',_0x1fd1('0x7b'),_0x1fd1('0x7c'),'versionnumber'];var _0x4fbac9=_0x1af2cb['concat'](_0x366e8f);return db[_0x1fd1('0x2c')][_0x1fd1('0x38')]({'where':{'id':_0x314102[_0x1fd1('0x2f')]['id']},'attributes':['id',_0x1fd1('0x7d'),_0x1fd1('0x7e'),_0x1fd1('0x7f'),_0x1fd1('0x80'),'clientId',_0x1fd1('0x81'),_0x1fd1('0x82')],'include':[{'model':db[_0x1fd1('0x83')],'as':_0x1fd1('0x83'),'attributes':['id',_0x1fd1('0x84'),_0x1fd1('0x85')]}]})[_0x1fd1('0xc')](handleEntityNotFound(_0x19a152,null))['then'](function(_0x444277){if(_0x444277){if(_0x444277[_0x1fd1('0x82')]){_0x444277[_0x1fd1('0x86')]=_0x444277[_0x1fd1('0x83')]['data5'];_0x1f9c4f=sanitizeRemoteUri(_0x444277[_0x1fd1('0x83')][_0x1fd1('0x85')]);_0x36ca2e=getWebApiUrl(_0x1f9c4f);return _0x444277;}_0x1f9c4f=sanitizeRemoteUri(_0x444277['remoteUri']);_0x36ca2e=getWebApiUrl(_0x1f9c4f);var _0x31f973={'method':_0x1fd1('0x87'),'uri':'https://login.microsoftonline.com/'+_0x444277[_0x1fd1('0x80')]+_0x1fd1('0x88'),'form':{'client_id':_0x444277[_0x1fd1('0x89')],'resource':_0x1f9c4f,'username':_0x444277[_0x1fd1('0x7d')],'password':_0x444277[_0x1fd1('0x7e')],'grant_type':_0x1fd1('0x7e'),'client_secret':_0x444277[_0x1fd1('0x81')]},'json':!![]};return rp(_0x31f973);}})[_0x1fd1('0xc')](function(_0x23251d){_0x473edf=_0x23251d[_0x1fd1('0x86')];var _0x52e98a={'method':_0x1fd1('0x8a'),'uri':encodeURI(_0x36ca2e+_0x1fd1('0x8b')+_0x29f9bf+'\x27'),'headers':{'Authorization':_0x1fd1('0x8c')+_0x473edf,'If-None-Match':null,'OData-Version':_0x1fd1('0x8d')},'json':!![]};return rp(_0x52e98a);})[_0x1fd1('0xc')](function(_0x2ca379){var _0xbd9ec9=_0x2ca379[_0x1fd1('0x8e')][0x0];var _0x2f957c=_0xbd9ec9[_0x1fd1('0x8f')];var _0x513781={'method':_0x1fd1('0x8a'),'uri':_0x36ca2e+'EntityDefinitions('+_0x2f957c+_0x1fd1('0x90'),'headers':{'Authorization':_0x1fd1('0x8c')+_0x473edf,'If-None-Match':null,'OData-Version':_0x1fd1('0x8d')},'json':!![]};return rp(_0x513781);})[_0x1fd1('0xc')](function(_0x58a57c){_0xb05aee=_0x58a57c;_0x146292=_0xb05aee['Attributes'];_0x146292=_['remove'](_0x146292,function(_0x412974){return!_0x4fbac9[_0x1fd1('0x91')](_0x412974[_0x1fd1('0x92')]);});var _0x13855c=[];var _0x536159=[];_0x146292[_0x1fd1('0x93')](function(_0x132831){if(_0x132831[_0x1fd1('0x94')]){var _0x4d410d=_0x132831['@odata.type']['substring'](_0x132831[_0x1fd1('0x94')][_0x1fd1('0x3f')]('.')+0x1);if(_0x4d410d==='PicklistAttributeMetadata'){_0x13855c[_0x1fd1('0x95')](getSelectList(_0x36ca2e,_0xfe5a2a,_0x536159,_0xb05aee[_0x1fd1('0x8f')],_0x132831['MetadataId'],_0x473edf));}}});return Promise[_0x1fd1('0x96')](_0x13855c);})[_0x1fd1('0xc')](function(_0x305373){_0x52af96=_0x305373[0x0];var _0x2f7150=[];var _0x34dd39=[];_0x146292[_0x1fd1('0x93')](function(_0x171f62){if(!_['isNil'](_0x171f62['@odata.type'])){var _0x20b716=_0x171f62[_0x1fd1('0x94')][_0x1fd1('0x3e')](_0x171f62['@odata.type'][_0x1fd1('0x3f')]('.')+0x1);if(_0x20b716===_0x1fd1('0x97')){_0x2f7150[_0x1fd1('0x95')](getBooleanList(_0x36ca2e,_0xfe5a2a,_0x34dd39,_0xb05aee[_0x1fd1('0x8f')],_0x171f62[_0x1fd1('0x8f')],_0x473edf));}}});return Promise[_0x1fd1('0x96')](_0x2f7150);})[_0x1fd1('0xc')](function(_0x8b6d48){_0x3d809c=_0x8b6d48[0x0];var _0x29c487=[];var _0x1ab6c0=[];_0x146292[_0x1fd1('0x93')](function(_0x2068f5){if(_0x2068f5[_0x1fd1('0x94')]){var _0x1f5b0b=_0x2068f5[_0x1fd1('0x94')][_0x1fd1('0x3e')](_0x2068f5[_0x1fd1('0x94')][_0x1fd1('0x3f')]('.')+0x1);if(_0x1f5b0b===_0x1fd1('0x98')||_0x1f5b0b===_0x1fd1('0x99')||_0x1f5b0b===_0x1fd1('0x9a')||_0x1f5b0b===_0x1fd1('0x9b')||_0x1f5b0b===_0x1fd1('0x9c')||_0x1f5b0b==='DateTimeAttributeMetadata'||_0x1f5b0b===_0x1fd1('0x9d')||_0x1f5b0b==='EntityNameAttributeMetadata'||_0x1f5b0b===_0x1fd1('0x9e')||_0x1f5b0b===_0x1fd1('0x9f')){_0x29c487[_0x1fd1('0x95')](getInputList(_0x36ca2e,_0xfe5a2a,_0x1f5b0b,_0x1ab6c0,_0xb05aee['MetadataId'],_0x2068f5['MetadataId'],_0x473edf));}}});return Promise[_0x1fd1('0x96')](_0x29c487);})[_0x1fd1('0xc')](function(_0x30e94b){_0x37066c=_0x30e94b[0x0];var _0x59f555=_0x52af96[_0x1fd1('0xa0')](_0x3d809c)[_0x1fd1('0xa0')](_0x37066c);var _0x57ea37={'count':_0x59f555[_0x1fd1('0x1f')],'rows':_0x59f555};return _0x57ea37;})[_0x1fd1('0xc')](respondWithResult(_0x19a152,null))[_0x1fd1('0x2e')](function(_0x18d379){var _0x2fade4=_0x314102['query']['test']?0x1f4:_0x18d379[_0x1fd1('0xa1')]||0x1f4;logger[_0x1fd1('0xf')](_0x18d379[_0x1fd1('0x10')]);delete _0x18d379['name'];if(_0x2fade4===0x191){_0x2fade4=0x190;}_0x19a152[_0x1fd1('0x7')](_0x2fade4)[_0x1fd1('0xa2')](_0x314102[_0x1fd1('0x19')][_0x1fd1('0xa3')]?{'message':_0x1fd1('0xa4'),'statusCode':_0x18d379[_0x1fd1('0xa1')]}:_0x18d379);});};function getSelectList(_0x7d4b9b,_0x267c17,_0x224ffd,_0x19779f,_0x2faa9f,_0x445f0e){var _0x3a294f={'method':_0x1fd1('0x8a'),'uri':_0x7d4b9b+_0x1fd1('0xa5')+_0x19779f+_0x1fd1('0xa6')+_0x2faa9f+_0x1fd1('0xa7')+_0x1fd1('0xa8'),'headers':{'Authorization':_0x1fd1('0x8c')+_0x445f0e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3a294f)[_0x1fd1('0xc')](function(_0x7ca6c3){var _0x36dfaf=[];var _0x148a21=_0x7ca6c3['OptionSet'][_0x1fd1('0xa9')];_0x148a21[_0x1fd1('0x93')](function(_0x1660ff){_0x36dfaf[_0x1fd1('0x95')]({'name':_0x1660ff[_0x1fd1('0xaa')][_0x1fd1('0xab')][_0x1fd1('0xaa')],'value':String(_0x1660ff['Value'])});});var _0x4c6636={'id':_0x267c17+'_'+_0x7ca6c3[_0x1fd1('0x92')],'name':_0x7ca6c3['DisplayName'][_0x1fd1('0xab')][_0x1fd1('0xaa')],'custom':![],'options':_0x36dfaf};_0x224ffd['push'](_0x4c6636);return _0x224ffd;});}function getBooleanList(_0x2b30cb,_0x49e387,_0x3de451,_0x2990fb,_0x49ac9f,_0x18a89b){var _0x4d18ec={'method':'GET','uri':_0x2b30cb+_0x1fd1('0xa5')+_0x2990fb+_0x1fd1('0xa6')+_0x49ac9f+_0x1fd1('0xac'),'headers':{'Authorization':_0x1fd1('0x8c')+_0x18a89b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4d18ec)['then'](function(_0x257043){var _0x57a080=[];_0x57a080[_0x1fd1('0x95')]({'name':_0x257043[_0x1fd1('0xad')][_0x1fd1('0xae')][_0x1fd1('0xaa')][_0x1fd1('0xab')][_0x1fd1('0xaa')],'value':'true'},{'name':_0x257043[_0x1fd1('0xad')]['FalseOption']['Label'][_0x1fd1('0xab')]['Label'],'value':_0x1fd1('0xaf')});var _0x3c42fc={'id':_0x49e387+'_'+_0x257043[_0x1fd1('0x92')],'name':_0x257043[_0x1fd1('0xb0')][_0x1fd1('0xab')][_0x1fd1('0xaa')],'custom':![],'options':_0x57a080};_0x3de451[_0x1fd1('0x95')](_0x3c42fc);return _0x3de451;});}function getInputList(_0x144e73,_0x3bde6a,_0x4fb3b4,_0x1f7ffc,_0x35a4a9,_0x159da2,_0x4bcb51){var _0x4bdf5c={'method':_0x1fd1('0x8a'),'uri':_0x144e73+_0x1fd1('0xa5')+_0x35a4a9+_0x1fd1('0xa6')+_0x159da2+_0x1fd1('0xb1')+_0x4fb3b4+_0x1fd1('0xb2'),'headers':{'Authorization':_0x1fd1('0x8c')+_0x4bcb51,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4bdf5c)[_0x1fd1('0xc')](function(_0x5e1a52){var _0x427e31={'id':_0x3bde6a+'_'+_0x5e1a52[_0x1fd1('0x92')],'name':_0x5e1a52[_0x1fd1('0xb0')][_0x1fd1('0xab')]?_0x5e1a52[_0x1fd1('0xb0')][_0x1fd1('0xab')][_0x1fd1('0xaa')]:_0x5e1a52[_0x1fd1('0x92')],'custom':![],'options':[]};_0x1f7ffc[_0x1fd1('0x95')](_0x427e31);return _0x1f7ffc;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index eb11eb0..e160185 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x1f35da,_0x14e49a){var _0x3616c7=function(_0x2606a6){while(--_0x2606a6){_0x1f35da['push'](_0x1f35da['shift']());}};_0x3616c7(++_0x14e49a);}(_0xe706,0xa3));var _0x6e70=function(_0x4ec3de,_0x1c67c4){_0x4ec3de=_0x4ec3de-0x0;var _0x37478a=_0xe706[_0x4ec3de];return _0x37478a;};'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'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x361cf1,_0x14e633){var _0x37c499=function(_0x270461){while(--_0x270461){_0x361cf1['push'](_0x361cf1['shift']());}};_0x37c499(++_0x14e633);}(_0xb7e7,0x121));var _0x7b7e=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0xb7e7[_0x174ef5];return _0x1cc379;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 738d7a7..8a28a69 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 _0xda32=['Dynamics365Account,\x20%s,\x20%s','message','result','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','limit','include','model','attributes','map','ShowDynamics365Account','find','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x238b61,_0xb94d00){var _0x519752=function(_0x19a3a1){while(--_0x19a3a1){_0x238b61['push'](_0x238b61['shift']());}};_0x519752(++_0xb94d00);}(_0xda32,0x183));var _0x2da3=function(_0x19dcc2,_0x41b678){_0x19dcc2=_0x19dcc2-0x0;var _0xbdd7dc=_0xda32[_0x19dcc2];return _0xbdd7dc;};'use strict';var _=require(_0x2da3('0x0'));var util=require(_0x2da3('0x1'));var moment=require(_0x2da3('0x2'));var BPromise=require(_0x2da3('0x3'));var rs=require(_0x2da3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2da3('0x5'))['db'];var utils=require(_0x2da3('0x6'));var logger=require(_0x2da3('0x7'))(_0x2da3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2da3('0x9')][_0x2da3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d8226,_0x4d993a,_0x4a6891){return new BPromise(function(_0x344eb4,_0x2f2630){return client[_0x2da3('0xb')](_0x5d8226,_0x4a6891)[_0x2da3('0xc')](function(_0x1e141b){logger[_0x2da3('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x4d993a,_0x2da3('0xe'));logger[_0x2da3('0xf')](_0x2da3('0x10'),_0x4d993a,_0x2da3('0xe'),JSON[_0x2da3('0x11')](_0x1e141b));if(_0x1e141b[_0x2da3('0x12')]){if(_0x1e141b[_0x2da3('0x12')][_0x2da3('0x13')]===0x1f4){logger['error'](_0x2da3('0x14'),_0x4d993a,_0x1e141b['error']['message']);return _0x2f2630(_0x1e141b[_0x2da3('0x12')][_0x2da3('0x15')]);}logger[_0x2da3('0x12')](_0x2da3('0x14'),_0x4d993a,_0x1e141b[_0x2da3('0x12')][_0x2da3('0x15')]);return _0x344eb4(_0x1e141b[_0x2da3('0x12')][_0x2da3('0x15')]);}else{logger[_0x2da3('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x4d993a,_0x2da3('0xe'));_0x344eb4(_0x1e141b[_0x2da3('0x16')][_0x2da3('0x15')]);}})['catch'](function(_0x2e30a6){logger[_0x2da3('0x12')](_0x2da3('0x14'),_0x4d993a,_0x2e30a6);_0x2f2630(_0x2e30a6);});});}exports[_0x2da3('0x17')]=function(_0x328c4c){var _0x25c31b=this;return new Promise(function(_0x3ab431,_0x222c40){return db[_0x2da3('0x18')][_0x2da3('0x19')]({'raw':_0x328c4c[_0x2da3('0x1a')]?_0x328c4c[_0x2da3('0x1a')][_0x2da3('0x1b')]===undefined?!![]:![]:!![],'where':_0x328c4c['options']?_0x328c4c[_0x2da3('0x1a')][_0x2da3('0x1c')]||null:null,'attributes':_0x328c4c[_0x2da3('0x1a')]?_0x328c4c['options']['attributes']||null:null,'limit':_0x328c4c[_0x2da3('0x1a')]?_0x328c4c[_0x2da3('0x1a')][_0x2da3('0x1d')]||null:null,'include':_0x328c4c[_0x2da3('0x1a')]?_0x328c4c[_0x2da3('0x1a')][_0x2da3('0x1e')]?_['map'](_0x328c4c[_0x2da3('0x1a')][_0x2da3('0x1e')],function(_0x4846fb){return{'model':db[_0x4846fb[_0x2da3('0x1f')]],'as':_0x4846fb['as'],'attributes':_0x4846fb[_0x2da3('0x20')],'include':_0x4846fb['include']?_[_0x2da3('0x21')](_0x4846fb[_0x2da3('0x1e')],function(_0x231cc0){return{'model':db[_0x231cc0[_0x2da3('0x1f')]],'as':_0x231cc0['as'],'attributes':_0x231cc0[_0x2da3('0x20')],'include':_0x231cc0[_0x2da3('0x1e')]?_['map'](_0x231cc0['include'],function(_0x5bf557){return{'model':db[_0x5bf557[_0x2da3('0x1f')]],'as':_0x5bf557['as'],'attributes':_0x5bf557[_0x2da3('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2da3('0xc')](function(_0x204917){logger[_0x2da3('0xd')](_0x2da3('0x17'),_0x328c4c);logger[_0x2da3('0xf')](_0x2da3('0x17'),_0x328c4c,JSON[_0x2da3('0x11')](_0x204917));_0x3ab431(_0x204917);})['catch'](function(_0x5c5865){logger[_0x2da3('0x12')]('GetDynamics365Account',_0x5c5865[_0x2da3('0x15')],_0x328c4c);_0x222c40(_0x25c31b[_0x2da3('0x12')](0x1f4,_0x5c5865[_0x2da3('0x15')]));});});};exports[_0x2da3('0x22')]=function(_0x427eee){var _0x538896=this;return new Promise(function(_0x51dee3,_0xcaf554){return db[_0x2da3('0x18')][_0x2da3('0x23')]({'raw':_0x427eee[_0x2da3('0x1a')]?_0x427eee[_0x2da3('0x1a')][_0x2da3('0x1b')]===undefined?!![]:![]:!![],'where':_0x427eee[_0x2da3('0x1a')]?_0x427eee['options'][_0x2da3('0x1c')]||null:null,'attributes':_0x427eee['options']?_0x427eee[_0x2da3('0x1a')][_0x2da3('0x20')]||null:null,'include':_0x427eee[_0x2da3('0x1a')]?_0x427eee[_0x2da3('0x1a')][_0x2da3('0x1e')]?_[_0x2da3('0x21')](_0x427eee[_0x2da3('0x1a')][_0x2da3('0x1e')],function(_0x5af27d){return{'model':db[_0x5af27d[_0x2da3('0x1f')]],'as':_0x5af27d['as'],'attributes':_0x5af27d['attributes'],'include':_0x5af27d[_0x2da3('0x1e')]?_[_0x2da3('0x21')](_0x5af27d[_0x2da3('0x1e')],function(_0x121448){return{'model':db[_0x121448[_0x2da3('0x1f')]],'as':_0x121448['as'],'attributes':_0x121448[_0x2da3('0x20')],'include':_0x121448[_0x2da3('0x1e')]?_['map'](_0x121448['include'],function(_0x2f74d4){return{'model':db[_0x2f74d4[_0x2da3('0x1f')]],'as':_0x2f74d4['as'],'attributes':_0x2f74d4[_0x2da3('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29277a){logger[_0x2da3('0xd')](_0x2da3('0x22'),_0x427eee);logger['debug'](_0x2da3('0x22'),_0x427eee,JSON[_0x2da3('0x11')](_0x29277a));_0x51dee3(_0x29277a);})[_0x2da3('0x24')](function(_0x53470f){logger['error'](_0x2da3('0x22'),_0x53470f[_0x2da3('0x15')],_0x427eee);_0xcaf554(_0x538896[_0x2da3('0x12')](0x1f4,_0x53470f[_0x2da3('0x15')]));});});}; \ No newline at end of file +var _0x3ea3=['info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','error','message','result','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','then','stringify','catch','find','ShowDynamics365Account','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request'];(function(_0xde47a6,_0x110228){var _0x5bb183=function(_0x23773a){while(--_0x23773a){_0xde47a6['push'](_0xde47a6['shift']());}};_0x5bb183(++_0x110228);}(_0x3ea3,0x175));var _0x33ea=function(_0x3ebccf,_0x38937e){_0x3ebccf=_0x3ebccf-0x0;var _0x55ee31=_0x3ea3[_0x3ebccf];return _0x55ee31;};'use strict';var _=require(_0x33ea('0x0'));var util=require(_0x33ea('0x1'));var moment=require(_0x33ea('0x2'));var BPromise=require(_0x33ea('0x3'));var rs=require(_0x33ea('0x4'));var fs=require('fs');var Redis=require(_0x33ea('0x5'));var db=require(_0x33ea('0x6'))['db'];var utils=require(_0x33ea('0x7'));var logger=require(_0x33ea('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x33ea('0x9')][_0x33ea('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x157679,_0x4da21e,_0x3858df){return new BPromise(function(_0x5c8b0f,_0x1e7264){return client[_0x33ea('0xb')](_0x157679,_0x3858df)['then'](function(_0x25f8bb){logger[_0x33ea('0xc')](_0x33ea('0xd'),_0x4da21e,_0x33ea('0xe'));logger[_0x33ea('0xf')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x4da21e,'request\x20sent',JSON['stringify'](_0x25f8bb));if(_0x25f8bb['error']){if(_0x25f8bb[_0x33ea('0x10')]['code']===0x1f4){logger[_0x33ea('0x10')]('Dynamics365Account,\x20%s,\x20%s',_0x4da21e,_0x25f8bb[_0x33ea('0x10')]['message']);return _0x1e7264(_0x25f8bb[_0x33ea('0x10')][_0x33ea('0x11')]);}logger[_0x33ea('0x10')](_0x33ea('0xd'),_0x4da21e,_0x25f8bb[_0x33ea('0x10')][_0x33ea('0x11')]);return _0x5c8b0f(_0x25f8bb[_0x33ea('0x10')][_0x33ea('0x11')]);}else{logger[_0x33ea('0xc')](_0x33ea('0xd'),_0x4da21e,_0x33ea('0xe'));_0x5c8b0f(_0x25f8bb[_0x33ea('0x12')][_0x33ea('0x11')]);}})['catch'](function(_0x20fc57){logger[_0x33ea('0x10')](_0x33ea('0xd'),_0x4da21e,_0x20fc57);_0x1e7264(_0x20fc57);});});}exports[_0x33ea('0x13')]=function(_0xb49cf3){var _0x33016a=this;return new Promise(function(_0x468f2e,_0x234212){return db[_0x33ea('0x14')][_0x33ea('0x15')]({'raw':_0xb49cf3['options']?_0xb49cf3[_0x33ea('0x16')][_0x33ea('0x17')]===undefined?!![]:![]:!![],'where':_0xb49cf3[_0x33ea('0x16')]?_0xb49cf3[_0x33ea('0x16')][_0x33ea('0x18')]||null:null,'attributes':_0xb49cf3[_0x33ea('0x16')]?_0xb49cf3[_0x33ea('0x16')][_0x33ea('0x19')]||null:null,'limit':_0xb49cf3[_0x33ea('0x16')]?_0xb49cf3['options'][_0x33ea('0x1a')]||null:null,'include':_0xb49cf3['options']?_0xb49cf3['options'][_0x33ea('0x1b')]?_[_0x33ea('0x1c')](_0xb49cf3[_0x33ea('0x16')][_0x33ea('0x1b')],function(_0x23bc52){return{'model':db[_0x23bc52[_0x33ea('0x1d')]],'as':_0x23bc52['as'],'attributes':_0x23bc52[_0x33ea('0x19')],'include':_0x23bc52[_0x33ea('0x1b')]?_[_0x33ea('0x1c')](_0x23bc52[_0x33ea('0x1b')],function(_0x95086d){return{'model':db[_0x95086d[_0x33ea('0x1d')]],'as':_0x95086d['as'],'attributes':_0x95086d[_0x33ea('0x19')],'include':_0x95086d['include']?_[_0x33ea('0x1c')](_0x95086d['include'],function(_0x4b4be8){return{'model':db[_0x4b4be8['model']],'as':_0x4b4be8['as'],'attributes':_0x4b4be8[_0x33ea('0x19')]};}):[]};}):[]};}):[]:[]})[_0x33ea('0x1e')](function(_0x5d1e0f){logger['info'](_0x33ea('0x13'),_0xb49cf3);logger[_0x33ea('0xf')]('GetDynamics365Account',_0xb49cf3,JSON[_0x33ea('0x1f')](_0x5d1e0f));_0x468f2e(_0x5d1e0f);})[_0x33ea('0x20')](function(_0x49819f){logger['error'](_0x33ea('0x13'),_0x49819f[_0x33ea('0x11')],_0xb49cf3);_0x234212(_0x33016a[_0x33ea('0x10')](0x1f4,_0x49819f[_0x33ea('0x11')]));});});};exports['ShowDynamics365Account']=function(_0x255d3c){var _0x26714a=this;return new Promise(function(_0x30702a,_0x40655e){return db['Dynamics365Account'][_0x33ea('0x21')]({'raw':_0x255d3c[_0x33ea('0x16')]?_0x255d3c[_0x33ea('0x16')][_0x33ea('0x17')]===undefined?!![]:![]:!![],'where':_0x255d3c[_0x33ea('0x16')]?_0x255d3c[_0x33ea('0x16')][_0x33ea('0x18')]||null:null,'attributes':_0x255d3c[_0x33ea('0x16')]?_0x255d3c[_0x33ea('0x16')]['attributes']||null:null,'include':_0x255d3c[_0x33ea('0x16')]?_0x255d3c['options'][_0x33ea('0x1b')]?_[_0x33ea('0x1c')](_0x255d3c[_0x33ea('0x16')][_0x33ea('0x1b')],function(_0x5f2998){return{'model':db[_0x5f2998[_0x33ea('0x1d')]],'as':_0x5f2998['as'],'attributes':_0x5f2998[_0x33ea('0x19')],'include':_0x5f2998['include']?_[_0x33ea('0x1c')](_0x5f2998[_0x33ea('0x1b')],function(_0x5a7c19){return{'model':db[_0x5a7c19[_0x33ea('0x1d')]],'as':_0x5a7c19['as'],'attributes':_0x5a7c19['attributes'],'include':_0x5a7c19['include']?_[_0x33ea('0x1c')](_0x5a7c19['include'],function(_0x542781){return{'model':db[_0x542781[_0x33ea('0x1d')]],'as':_0x542781['as'],'attributes':_0x542781[_0x33ea('0x19')]};}):[]};}):[]};}):[]:[]})[_0x33ea('0x1e')](function(_0x2c2ab8){logger[_0x33ea('0xc')](_0x33ea('0x22'),_0x255d3c);logger[_0x33ea('0xf')](_0x33ea('0x22'),_0x255d3c,JSON['stringify'](_0x2c2ab8));_0x30702a(_0x2c2ab8);})['catch'](function(_0x544cec){logger['error'](_0x33ea('0x22'),_0x544cec[_0x33ea('0x11')],_0x255d3c);_0x40655e(_0x26714a[_0x33ea('0x10')](0x1f4,_0x544cec[_0x33ea('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index de4c504..b4e6a1b 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 _0x0817=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','show','/:id/subjects','getSubjects','getDescriptions','create','put','/:id','update','delete','destroy','exports'];(function(_0x5c797c,_0x1f9268){var _0x3e1356=function(_0x5bee1f){while(--_0x5bee1f){_0x5c797c['push'](_0x5c797c['shift']());}};_0x3e1356(++_0x1f9268);}(_0x0817,0x90));var _0x7081=function(_0x123100,_0x87542b){_0x123100=_0x123100-0x0;var _0x24659d=_0x0817[_0x123100];return _0x24659d;};'use strict';var multer=require(_0x7081('0x0'));var util=require('util');var path=require(_0x7081('0x1'));var timeout=require(_0x7081('0x2'));var express=require(_0x7081('0x3'));var router=express[_0x7081('0x4')]();var fs_extra=require(_0x7081('0x5'));var auth=require(_0x7081('0x6'));var interaction=require(_0x7081('0x7'));var config=require(_0x7081('0x8'));var controller=require(_0x7081('0x9'));router[_0x7081('0xa')]('/',auth[_0x7081('0xb')](),controller[_0x7081('0xc')]);router[_0x7081('0xa')]('/:id',auth[_0x7081('0xb')](),controller[_0x7081('0xd')]);router[_0x7081('0xa')]('/:id/fields',auth[_0x7081('0xb')](),controller['getFields']);router['get'](_0x7081('0xe'),auth[_0x7081('0xb')](),controller[_0x7081('0xf')]);router['get']('/:id/descriptions',auth[_0x7081('0xb')](),controller[_0x7081('0x10')]);router['post']('/',auth[_0x7081('0xb')](),controller[_0x7081('0x11')]);router[_0x7081('0x12')](_0x7081('0x13'),auth[_0x7081('0xb')](),controller[_0x7081('0x14')]);router[_0x7081('0x15')](_0x7081('0x13'),auth[_0x7081('0xb')](),controller[_0x7081('0x16')]);module[_0x7081('0x17')]=router; \ No newline at end of file +var _0xb982=['index','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get'];(function(_0x211032,_0xf3b31a){var _0x1879ee=function(_0x3c9609){while(--_0x3c9609){_0x211032['push'](_0x211032['shift']());}};_0x1879ee(++_0xf3b31a);}(_0xb982,0x15e));var _0x2b98=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb982[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2b98('0x0'));var timeout=require(_0x2b98('0x1'));var express=require(_0x2b98('0x2'));var router=express[_0x2b98('0x3')]();var fs_extra=require(_0x2b98('0x4'));var auth=require(_0x2b98('0x5'));var interaction=require(_0x2b98('0x6'));var config=require(_0x2b98('0x7'));var controller=require(_0x2b98('0x8'));router[_0x2b98('0x9')]('/',auth['isAuthenticated'](),controller[_0x2b98('0xa')]);router[_0x2b98('0x9')](_0x2b98('0xb'),auth[_0x2b98('0xc')](),controller[_0x2b98('0xd')]);router[_0x2b98('0x9')]('/:id/fields',auth[_0x2b98('0xc')](),controller[_0x2b98('0xe')]);router['get'](_0x2b98('0xf'),auth['isAuthenticated'](),controller[_0x2b98('0x10')]);router[_0x2b98('0x9')](_0x2b98('0x11'),auth[_0x2b98('0xc')](),controller[_0x2b98('0x12')]);router['post']('/',auth[_0x2b98('0xc')](),controller['create']);router[_0x2b98('0x13')](_0x2b98('0xb'),auth[_0x2b98('0xc')](),controller[_0x2b98('0x14')]);router[_0x2b98('0x15')](_0x2b98('0xb'),auth['isAuthenticated'](),controller[_0x2b98('0x16')]);module[_0x2b98('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 2c0d88b..8c0b5d7 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 _0x6479=['contact','BOOLEAN','sequelize','exports','ENUM','incident','phonecall','nothing'];(function(_0x25be15,_0x50fe73){var _0x965db9=function(_0x41f398){while(--_0x41f398){_0x25be15['push'](_0x25be15['shift']());}};_0x965db9(++_0x50fe73);}(_0x6479,0x1da));var _0x9647=function(_0x4c9296,_0x5d07f5){_0x4c9296=_0x4c9296-0x0;var _0x3d8557=_0x6479[_0x4c9296];return _0x3d8557;};'use strict';var Sequelize=require(_0x9647('0x0'));module[_0x9647('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x9647('0x2')](_0x9647('0x3'),_0x9647('0x4')),'defaultValue':_0x9647('0x3')},'moduleCreate':{'type':Sequelize[_0x9647('0x2')]('contact',_0x9647('0x5')),'defaultValue':_0x9647('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x9647('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0xce19=['nothing','BOOLEAN','sequelize','exports','STRING','ENUM','incident','phonecall','contact'];(function(_0x430290,_0x94c0cd){var _0x1c5d5e=function(_0x34d270){while(--_0x34d270){_0x430290['push'](_0x430290['shift']());}};_0x1c5d5e(++_0x94c0cd);}(_0xce19,0x77));var _0x9ce1=function(_0x565e14,_0x1bd0f2){_0x565e14=_0x565e14-0x0;var _0x5ada4a=_0xce19[_0x565e14];return _0x5ada4a;};'use strict';var Sequelize=require(_0x9ce1('0x0'));module[_0x9ce1('0x1')]={'name':{'type':Sequelize[_0x9ce1('0x2')]},'description':{'type':Sequelize[_0x9ce1('0x2')]},'ticketType':{'type':Sequelize[_0x9ce1('0x3')](_0x9ce1('0x4'),_0x9ce1('0x5')),'defaultValue':_0x9ce1('0x4')},'moduleCreate':{'type':Sequelize[_0x9ce1('0x3')](_0x9ce1('0x6'),_0x9ce1('0x7')),'defaultValue':_0x9ce1('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x9ce1('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x9ce1('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index aea53d2..e9281d7 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 _0xd94a=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','save','update','then','destroy','stack','name','index','rawAttributes','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','merge','options','Dynamics365Configuration','include','show','params','includeAll','find','catch','create','body','getFields','Dynamics365Field','sort','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','papaparse','ioredis'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xd94a,0x15e));var _0xad94=function(_0x2032db,_0x2d530b){_0x2032db=_0x2032db-0x0;var _0x488d3b=_0xd94a[_0x2032db];return _0x488d3b;};'use strict';var emlformat=require(_0xad94('0x0'));var rimraf=require(_0xad94('0x1'));var zipdir=require(_0xad94('0x2'));var jsonpatch=require(_0xad94('0x3'));var rp=require('request-promise');var moment=require(_0xad94('0x4'));var BPromise=require(_0xad94('0x5'));var Mustache=require(_0xad94('0x6'));var util=require(_0xad94('0x7'));var path=require(_0xad94('0x8'));var sox=require(_0xad94('0x9'));var csv=require(_0xad94('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xad94('0xb'));var squel=require('squel');var crypto=require(_0xad94('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xad94('0xa'));var querystring=require('querystring');var Papa=require(_0xad94('0xd'));var Redis=require(_0xad94('0xe'));var authService=require(_0xad94('0xf'));var qs=require(_0xad94('0x10'));var as=require(_0xad94('0x11'));var hardwareService=require(_0xad94('0x12'));var logger=require(_0xad94('0x13'))('api');var utils=require(_0xad94('0x14'));var config=require(_0xad94('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16da82,_0x225c81){_0x225c81=_0x225c81||0xcc;return function(_0x54490a){if(_0x54490a){return _0x16da82[_0xad94('0x16')](_0x225c81);}return _0x16da82['status'](_0x225c81)[_0xad94('0x17')]();};}function respondWithResult(_0x291199,_0x32cd65){_0x32cd65=_0x32cd65||0xc8;return function(_0x169126){if(_0x169126){return _0x291199[_0xad94('0x18')](_0x32cd65)[_0xad94('0x19')](_0x169126);}};}function respondWithFilteredResult(_0x117106,_0x3318a7){return function(_0x69777b){if(_0x69777b){var _0xfc84a8=typeof _0x3318a7['offset']===_0xad94('0x1a')&&typeof _0x3318a7[_0xad94('0x1b')]===_0xad94('0x1a');var _0x2d68d6=_0x69777b['count'];var _0x29e747=_0xfc84a8?0x0:_0x3318a7[_0xad94('0x1c')];var _0x104598=_0xfc84a8?_0x69777b[_0xad94('0x1d')]:_0x3318a7[_0xad94('0x1c')]+_0x3318a7[_0xad94('0x1b')];var _0x528fcf;if(_0x104598>=_0x2d68d6){_0x104598=_0x2d68d6;_0x528fcf=0xc8;}else{_0x528fcf=0xce;}_0x117106[_0xad94('0x18')](_0x528fcf);return _0x117106[_0xad94('0x1e')](_0xad94('0x1f'),_0x29e747+'-'+_0x104598+'/'+_0x2d68d6)['json'](_0x69777b);}return null;};}function patchUpdates(_0x5d67ea){return function(_0x53d694){try{jsonpatch['apply'](_0x53d694,_0x5d67ea,!![]);}catch(_0x27b17a){return BPromise['reject'](_0x27b17a);}return _0x53d694[_0xad94('0x20')]();};}function saveUpdates(_0x44c231,_0x116ec3){return function(_0x583d8c){if(_0x583d8c){return _0x583d8c[_0xad94('0x21')](_0x44c231)[_0xad94('0x22')](function(_0x1ecc66){return _0x1ecc66;});}return null;};}function removeEntity(_0x563465,_0x5d6d94){return function(_0x2dcb47){if(_0x2dcb47){return _0x2dcb47[_0xad94('0x23')]()['then'](function(){_0x563465[_0xad94('0x18')](0xcc)[_0xad94('0x17')]();});}};}function handleEntityNotFound(_0x231bce,_0x539099){return function(_0x1b45c9){if(!_0x1b45c9){_0x231bce[_0xad94('0x16')](0x194);}return _0x1b45c9;};}function handleError(_0x10a9a3,_0x4c9d9f){_0x4c9d9f=_0x4c9d9f||0x1f4;return function(_0x5a92d8){logger['error'](_0x5a92d8[_0xad94('0x24')]);if(_0x5a92d8[_0xad94('0x25')]){delete _0x5a92d8[_0xad94('0x25')];}_0x10a9a3[_0xad94('0x18')](_0x4c9d9f)['send'](_0x5a92d8);};}exports[_0xad94('0x26')]=function(_0x5eecc8,_0xd8a212){var _0x520ddd={},_0x108e0e={},_0x257a0c={'count':0x0,'rows':[]};var _0x4ed01f=_['map'](db['Dynamics365Configuration'][_0xad94('0x27')],function(_0x5014dc){return{'name':_0x5014dc['fieldName'],'type':_0x5014dc['type']['key']};});_0x108e0e[_0xad94('0x28')]=_[_0xad94('0x29')](_0x4ed01f,'name');_0x108e0e[_0xad94('0x2a')]=_[_0xad94('0x2b')](_0x5eecc8['query']);_0x108e0e[_0xad94('0x2c')]=_[_0xad94('0x2d')](_0x108e0e[_0xad94('0x28')],_0x108e0e[_0xad94('0x2a')]);_0x520ddd[_0xad94('0x2e')]=_[_0xad94('0x2d')](_0x108e0e[_0xad94('0x28')],qs['fields'](_0x5eecc8[_0xad94('0x2a')][_0xad94('0x2f')]));_0x520ddd[_0xad94('0x2e')]=_0x520ddd[_0xad94('0x2e')][_0xad94('0x30')]?_0x520ddd[_0xad94('0x2e')]:_0x108e0e[_0xad94('0x28')];if(!_0x5eecc8[_0xad94('0x2a')][_0xad94('0x31')](_0xad94('0x32'))){_0x520ddd[_0xad94('0x1b')]=qs[_0xad94('0x1b')](_0x5eecc8['query'][_0xad94('0x1b')]);_0x520ddd[_0xad94('0x1c')]=qs[_0xad94('0x1c')](_0x5eecc8['query'][_0xad94('0x1c')]);}_0x520ddd[_0xad94('0x33')]=qs['sort'](_0x5eecc8['query']['sort']);_0x520ddd[_0xad94('0x34')]=qs[_0xad94('0x2c')](_[_0xad94('0x35')](_0x5eecc8[_0xad94('0x2a')],_0x108e0e[_0xad94('0x2c')]),_0x4ed01f);if(_0x5eecc8[_0xad94('0x2a')][_0xad94('0x36')]){_0x520ddd['where']=_['merge'](_0x520ddd['where'],{'$or':_['map'](_0x4ed01f,function(_0x378e5d){if(_0x378e5d['type']!==_0xad94('0x37')){var _0x26fece={};_0x26fece[_0x378e5d[_0xad94('0x25')]]={'$like':'%'+_0x5eecc8['query'][_0xad94('0x36')]+'%'};return _0x26fece;}})});}_0x520ddd=_[_0xad94('0x38')]({},_0x520ddd,_0x5eecc8[_0xad94('0x39')]);var _0x1b9669={'where':_0x520ddd[_0xad94('0x34')]};return db[_0xad94('0x3a')][_0xad94('0x1d')](_0x1b9669)[_0xad94('0x22')](function(_0x2908c3){_0x257a0c[_0xad94('0x1d')]=_0x2908c3;if(_0x5eecc8['query']['includeAll']){_0x520ddd[_0xad94('0x3b')]=[{'all':!![]}];}return db[_0xad94('0x3a')]['findAll'](_0x520ddd);})['then'](function(_0x33c836){_0x257a0c['rows']=_0x33c836;return _0x257a0c;})['then'](respondWithFilteredResult(_0xd8a212,_0x520ddd))['catch'](handleError(_0xd8a212,null));};exports[_0xad94('0x3c')]=function(_0x10b760,_0x1792c3){var _0x393b5c={'raw':![],'where':{'id':_0x10b760[_0xad94('0x3d')]['id']}},_0x434aa5={};_0x434aa5[_0xad94('0x28')]=_['keys'](db[_0xad94('0x3a')][_0xad94('0x27')]);_0x434aa5[_0xad94('0x2a')]=_[_0xad94('0x2b')](_0x10b760[_0xad94('0x2a')]);_0x434aa5[_0xad94('0x2c')]=_[_0xad94('0x2d')](_0x434aa5[_0xad94('0x28')],_0x434aa5[_0xad94('0x2a')]);_0x393b5c[_0xad94('0x2e')]=_[_0xad94('0x2d')](_0x434aa5[_0xad94('0x28')],qs[_0xad94('0x2f')](_0x10b760['query'][_0xad94('0x2f')]));_0x393b5c[_0xad94('0x2e')]=_0x393b5c[_0xad94('0x2e')]['length']?_0x393b5c['attributes']:_0x434aa5['model'];if(_0x10b760['query'][_0xad94('0x3e')]){_0x393b5c[_0xad94('0x3b')]=[{'all':!![]}];}_0x393b5c=_[_0xad94('0x38')]({},_0x393b5c,_0x10b760[_0xad94('0x39')]);return db['Dynamics365Configuration'][_0xad94('0x3f')](_0x393b5c)[_0xad94('0x22')](handleEntityNotFound(_0x1792c3,null))[_0xad94('0x22')](respondWithResult(_0x1792c3,null))[_0xad94('0x40')](handleError(_0x1792c3,null));};exports[_0xad94('0x41')]=function(_0x1cb418,_0x195049){return db['Dynamics365Configuration'][_0xad94('0x41')](_0x1cb418[_0xad94('0x42')],{})[_0xad94('0x22')](respondWithResult(_0x195049,0xc9))[_0xad94('0x40')](handleError(_0x195049,null));};exports['update']=function(_0x79f9c,_0x7d26cf){if(_0x79f9c[_0xad94('0x42')]['id']){delete _0x79f9c[_0xad94('0x42')]['id'];}return db[_0xad94('0x3a')][_0xad94('0x3f')]({'where':{'id':_0x79f9c[_0xad94('0x3d')]['id']}})[_0xad94('0x22')](handleEntityNotFound(_0x7d26cf,null))[_0xad94('0x22')](saveUpdates(_0x79f9c[_0xad94('0x42')],null))[_0xad94('0x22')](respondWithResult(_0x7d26cf,null))[_0xad94('0x40')](handleError(_0x7d26cf,null));};exports[_0xad94('0x23')]=function(_0x1cee5e,_0x2073ae){return db[_0xad94('0x3a')][_0xad94('0x3f')]({'where':{'id':_0x1cee5e[_0xad94('0x3d')]['id']}})[_0xad94('0x22')](handleEntityNotFound(_0x2073ae,null))[_0xad94('0x22')](removeEntity(_0x2073ae,null))['catch'](handleError(_0x2073ae,null));};exports[_0xad94('0x43')]=function(_0x33b23c,_0xb1b6d8,_0x357726){var _0x55a7e7={};var _0x192203={};var _0x5f1599;var _0x168c3d;return db[_0xad94('0x3a')]['findOne']({'where':{'id':_0x33b23c[_0xad94('0x3d')]['id']}})[_0xad94('0x22')](handleEntityNotFound(_0xb1b6d8,null))['then'](function(_0x12d394){if(_0x12d394){_0x5f1599=_0x12d394;_0x192203[_0xad94('0x28')]=_[_0xad94('0x2b')](db[_0xad94('0x44')]['rawAttributes']);_0x192203[_0xad94('0x2a')]=_[_0xad94('0x2b')](_0x33b23c[_0xad94('0x2a')]);_0x192203[_0xad94('0x2c')]=_[_0xad94('0x2d')](_0x192203[_0xad94('0x28')],_0x192203['query']);_0x55a7e7[_0xad94('0x2e')]=_[_0xad94('0x2d')](_0x192203[_0xad94('0x28')],qs[_0xad94('0x2f')](_0x33b23c[_0xad94('0x2a')][_0xad94('0x2f')]));_0x55a7e7[_0xad94('0x2e')]=_0x55a7e7[_0xad94('0x2e')][_0xad94('0x30')]?_0x55a7e7[_0xad94('0x2e')]:_0x192203[_0xad94('0x28')];_0x55a7e7[_0xad94('0x33')]=qs[_0xad94('0x45')](_0x33b23c[_0xad94('0x2a')][_0xad94('0x45')]);_0x55a7e7[_0xad94('0x34')]=qs[_0xad94('0x2c')](_[_0xad94('0x35')](_0x33b23c[_0xad94('0x2a')],_0x192203[_0xad94('0x2c')]));if(_0x33b23c[_0xad94('0x2a')][_0xad94('0x36')]){_0x55a7e7[_0xad94('0x34')]=_[_0xad94('0x38')](_0x55a7e7[_0xad94('0x34')],{'$or':_[_0xad94('0x29')](_0x55a7e7[_0xad94('0x2e')],function(_0x292134){var _0x1c6098={};_0x1c6098[_0x292134]={'$like':'%'+_0x33b23c['query'][_0xad94('0x36')]+'%'};return _0x1c6098;})});}_0x55a7e7=_[_0xad94('0x38')]({},_0x55a7e7,_0x33b23c['options']);return _0x5f1599[_0xad94('0x43')](_0x55a7e7);}})['then'](function(_0x19ea83){if(_0x19ea83){_0x168c3d=_0x19ea83[_0xad94('0x30')];if(!_0x33b23c[_0xad94('0x2a')]['hasOwnProperty']('nolimit')){_0x55a7e7['limit']=qs[_0xad94('0x1b')](_0x33b23c[_0xad94('0x2a')][_0xad94('0x1b')]);_0x55a7e7['offset']=qs[_0xad94('0x1c')](_0x33b23c[_0xad94('0x2a')][_0xad94('0x1c')]);}return _0x5f1599[_0xad94('0x43')](_0x55a7e7);}})['then'](function(_0x2ef31b){if(_0x2ef31b){return _0x2ef31b?{'count':_0x168c3d,'rows':_0x2ef31b}:null;}})['then'](respondWithResult(_0xb1b6d8,null))[_0xad94('0x40')](handleError(_0xb1b6d8,null));};exports[_0xad94('0x46')]=function(_0x5978a8,_0x521d80,_0xa9383b){var _0x3a007f={};var _0x11e33e={};var _0x177dbd;var _0x5e68c3;return db['Dynamics365Configuration'][_0xad94('0x47')]({'where':{'id':_0x5978a8[_0xad94('0x3d')]['id']}})['then'](handleEntityNotFound(_0x521d80,null))[_0xad94('0x22')](function(_0x13e031){if(_0x13e031){_0x177dbd=_0x13e031;_0x11e33e['model']=_[_0xad94('0x2b')](db[_0xad94('0x44')][_0xad94('0x27')]);_0x11e33e[_0xad94('0x2a')]=_['keys'](_0x5978a8['query']);_0x11e33e[_0xad94('0x2c')]=_[_0xad94('0x2d')](_0x11e33e['model'],_0x11e33e[_0xad94('0x2a')]);_0x3a007f['attributes']=_['intersection'](_0x11e33e[_0xad94('0x28')],qs['fields'](_0x5978a8[_0xad94('0x2a')]['fields']));_0x3a007f['attributes']=_0x3a007f['attributes']['length']?_0x3a007f[_0xad94('0x2e')]:_0x11e33e['model'];_0x3a007f['order']=qs['sort'](_0x5978a8[_0xad94('0x2a')][_0xad94('0x45')]);_0x3a007f['where']=qs['filters'](_[_0xad94('0x35')](_0x5978a8['query'],_0x11e33e[_0xad94('0x2c')]));if(_0x5978a8[_0xad94('0x2a')]['filter']){_0x3a007f[_0xad94('0x34')]=_[_0xad94('0x38')](_0x3a007f[_0xad94('0x34')],{'$or':_[_0xad94('0x29')](_0x3a007f[_0xad94('0x2e')],function(_0x16b2b3){var _0x1b944f={};_0x1b944f[_0x16b2b3]={'$like':'%'+_0x5978a8[_0xad94('0x2a')][_0xad94('0x36')]+'%'};return _0x1b944f;})});}_0x3a007f=_[_0xad94('0x38')]({},_0x3a007f,_0x5978a8[_0xad94('0x39')]);return _0x177dbd[_0xad94('0x46')](_0x3a007f);}})[_0xad94('0x22')](function(_0x3795b3){if(_0x3795b3){_0x5e68c3=_0x3795b3[_0xad94('0x30')];if(!_0x5978a8[_0xad94('0x2a')][_0xad94('0x31')](_0xad94('0x32'))){_0x3a007f['limit']=qs['limit'](_0x5978a8['query']['limit']);_0x3a007f[_0xad94('0x1c')]=qs[_0xad94('0x1c')](_0x5978a8['query']['offset']);}return _0x177dbd[_0xad94('0x46')](_0x3a007f);}})[_0xad94('0x22')](function(_0xa5aae4){if(_0xa5aae4){return _0xa5aae4?{'count':_0x5e68c3,'rows':_0xa5aae4}:null;}})['then'](respondWithResult(_0x521d80,null))['catch'](handleError(_0x521d80,null));};exports['getDescriptions']=function(_0x1dcda4,_0x2da2ed,_0x2a6bbc){var _0xe6e44b={};var _0x48fded={};var _0x8482e3;var _0x40d876;return db[_0xad94('0x3a')][_0xad94('0x47')]({'where':{'id':_0x1dcda4[_0xad94('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2da2ed,null))[_0xad94('0x22')](function(_0x588644){if(_0x588644){_0x8482e3=_0x588644;_0x48fded['model']=_[_0xad94('0x2b')](db[_0xad94('0x44')][_0xad94('0x27')]);_0x48fded[_0xad94('0x2a')]=_['keys'](_0x1dcda4[_0xad94('0x2a')]);_0x48fded[_0xad94('0x2c')]=_[_0xad94('0x2d')](_0x48fded[_0xad94('0x28')],_0x48fded['query']);_0xe6e44b[_0xad94('0x2e')]=_[_0xad94('0x2d')](_0x48fded['model'],qs['fields'](_0x1dcda4['query'][_0xad94('0x2f')]));_0xe6e44b[_0xad94('0x2e')]=_0xe6e44b[_0xad94('0x2e')][_0xad94('0x30')]?_0xe6e44b[_0xad94('0x2e')]:_0x48fded[_0xad94('0x28')];_0xe6e44b['order']=qs[_0xad94('0x45')](_0x1dcda4['query'][_0xad94('0x45')]);_0xe6e44b['where']=qs[_0xad94('0x2c')](_['pick'](_0x1dcda4[_0xad94('0x2a')],_0x48fded[_0xad94('0x2c')]));if(_0x1dcda4[_0xad94('0x2a')][_0xad94('0x36')]){_0xe6e44b[_0xad94('0x34')]=_[_0xad94('0x38')](_0xe6e44b['where'],{'$or':_[_0xad94('0x29')](_0xe6e44b[_0xad94('0x2e')],function(_0x384135){var _0x43745a={};_0x43745a[_0x384135]={'$like':'%'+_0x1dcda4[_0xad94('0x2a')][_0xad94('0x36')]+'%'};return _0x43745a;})});}_0xe6e44b=_[_0xad94('0x38')]({},_0xe6e44b,_0x1dcda4[_0xad94('0x39')]);return _0x8482e3[_0xad94('0x48')](_0xe6e44b);}})[_0xad94('0x22')](function(_0x2dd0b1){if(_0x2dd0b1){_0x40d876=_0x2dd0b1[_0xad94('0x30')];if(!_0x1dcda4['query'][_0xad94('0x31')](_0xad94('0x32'))){_0xe6e44b[_0xad94('0x1b')]=qs[_0xad94('0x1b')](_0x1dcda4[_0xad94('0x2a')][_0xad94('0x1b')]);_0xe6e44b['offset']=qs[_0xad94('0x1c')](_0x1dcda4[_0xad94('0x2a')][_0xad94('0x1c')]);}return _0x8482e3[_0xad94('0x48')](_0xe6e44b);}})[_0xad94('0x22')](function(_0x580a4f){if(_0x580a4f){return _0x580a4f?{'count':_0x40d876,'rows':_0x580a4f}:null;}})['then'](respondWithResult(_0x2da2ed,null))[_0xad94('0x40')](handleError(_0x2da2ed,null));}; \ No newline at end of file +var _0xd786=['set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','Dynamics365Configuration','rawAttributes','fieldName','key','model','map','query','keys','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','include','findAll','rows','catch','show','params','intersection','includeAll','options','find','create','body','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','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','status','end','json','offset','limit','undefined','count'];(function(_0x3a9815,_0x47eb16){var _0x188653=function(_0x203e84){while(--_0x203e84){_0x3a9815['push'](_0x3a9815['shift']());}};_0x188653(++_0x47eb16);}(_0xd786,0x1e2));var _0x6d78=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd786[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0x6d78('0x0'));var rimraf=require(_0x6d78('0x1'));var zipdir=require(_0x6d78('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6d78('0x3'));var BPromise=require(_0x6d78('0x4'));var Mustache=require(_0x6d78('0x5'));var util=require(_0x6d78('0x6'));var path=require(_0x6d78('0x7'));var sox=require(_0x6d78('0x8'));var csv=require(_0x6d78('0x9'));var ejs=require(_0x6d78('0xa'));var fs=require('fs');var fs_extra=require(_0x6d78('0xb'));var _=require(_0x6d78('0xc'));var squel=require(_0x6d78('0xd'));var crypto=require('crypto');var jsforce=require(_0x6d78('0xe'));var deskjs=require(_0x6d78('0xf'));var toCsv=require(_0x6d78('0x9'));var querystring=require(_0x6d78('0x10'));var Papa=require(_0x6d78('0x11'));var Redis=require(_0x6d78('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6d78('0x13'));var as=require(_0x6d78('0x14'));var hardwareService=require(_0x6d78('0x15'));var logger=require(_0x6d78('0x16'))(_0x6d78('0x17'));var utils=require(_0x6d78('0x18'));var config=require(_0x6d78('0x19'));var licenseUtil=require(_0x6d78('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x593de6,_0x4fb63b){_0x4fb63b=_0x4fb63b||0xcc;return function(_0x5529a4){if(_0x5529a4){return _0x593de6['sendStatus'](_0x4fb63b);}return _0x593de6[_0x6d78('0x1b')](_0x4fb63b)[_0x6d78('0x1c')]();};}function respondWithResult(_0x5cfd7b,_0x394b70){_0x394b70=_0x394b70||0xc8;return function(_0xdcfa97){if(_0xdcfa97){return _0x5cfd7b[_0x6d78('0x1b')](_0x394b70)[_0x6d78('0x1d')](_0xdcfa97);}};}function respondWithFilteredResult(_0x30cc2b,_0xd3f7a7){return function(_0x258aa6){if(_0x258aa6){var _0x1f0af2=typeof _0xd3f7a7[_0x6d78('0x1e')]==='undefined'&&typeof _0xd3f7a7[_0x6d78('0x1f')]===_0x6d78('0x20');var _0x1b59e0=_0x258aa6[_0x6d78('0x21')];var _0x40f6f9=_0x1f0af2?0x0:_0xd3f7a7[_0x6d78('0x1e')];var _0x3eb00d=_0x1f0af2?_0x258aa6['count']:_0xd3f7a7['offset']+_0xd3f7a7[_0x6d78('0x1f')];var _0x5af6ae;if(_0x3eb00d>=_0x1b59e0){_0x3eb00d=_0x1b59e0;_0x5af6ae=0xc8;}else{_0x5af6ae=0xce;}_0x30cc2b[_0x6d78('0x1b')](_0x5af6ae);return _0x30cc2b[_0x6d78('0x22')](_0x6d78('0x23'),_0x40f6f9+'-'+_0x3eb00d+'/'+_0x1b59e0)[_0x6d78('0x1d')](_0x258aa6);}return null;};}function patchUpdates(_0xa770e8){return function(_0x1566d4){try{jsonpatch[_0x6d78('0x24')](_0x1566d4,_0xa770e8,!![]);}catch(_0x4ae2b5){return BPromise[_0x6d78('0x25')](_0x4ae2b5);}return _0x1566d4['save']();};}function saveUpdates(_0x59bbe6,_0x3ac96a){return function(_0x13f59f){if(_0x13f59f){return _0x13f59f[_0x6d78('0x26')](_0x59bbe6)[_0x6d78('0x27')](function(_0x53e767){return _0x53e767;});}return null;};}function removeEntity(_0x571838,_0x19168e){return function(_0x1d7543){if(_0x1d7543){return _0x1d7543[_0x6d78('0x28')]()[_0x6d78('0x27')](function(){_0x571838[_0x6d78('0x1b')](0xcc)[_0x6d78('0x1c')]();});}};}function handleEntityNotFound(_0x3067e2,_0x4deeaf){return function(_0x2d546c){if(!_0x2d546c){_0x3067e2[_0x6d78('0x29')](0x194);}return _0x2d546c;};}function handleError(_0x3a2208,_0x55860a){_0x55860a=_0x55860a||0x1f4;return function(_0x312059){logger[_0x6d78('0x2a')](_0x312059[_0x6d78('0x2b')]);if(_0x312059[_0x6d78('0x2c')]){delete _0x312059[_0x6d78('0x2c')];}_0x3a2208[_0x6d78('0x1b')](_0x55860a)[_0x6d78('0x2d')](_0x312059);};}exports[_0x6d78('0x2e')]=function(_0x5a201b,_0xaa1f9d){var _0x187f06={},_0x493489={},_0xe8b582={'count':0x0,'rows':[]};var _0x294c64=_['map'](db[_0x6d78('0x2f')][_0x6d78('0x30')],function(_0x3923c3){return{'name':_0x3923c3[_0x6d78('0x31')],'type':_0x3923c3['type'][_0x6d78('0x32')]};});_0x493489[_0x6d78('0x33')]=_[_0x6d78('0x34')](_0x294c64,_0x6d78('0x2c'));_0x493489[_0x6d78('0x35')]=_[_0x6d78('0x36')](_0x5a201b[_0x6d78('0x35')]);_0x493489['filters']=_['intersection'](_0x493489[_0x6d78('0x33')],_0x493489[_0x6d78('0x35')]);_0x187f06['attributes']=_['intersection'](_0x493489[_0x6d78('0x33')],qs[_0x6d78('0x37')](_0x5a201b[_0x6d78('0x35')][_0x6d78('0x37')]));_0x187f06[_0x6d78('0x38')]=_0x187f06[_0x6d78('0x38')][_0x6d78('0x39')]?_0x187f06['attributes']:_0x493489[_0x6d78('0x33')];if(!_0x5a201b['query'][_0x6d78('0x3a')](_0x6d78('0x3b'))){_0x187f06[_0x6d78('0x1f')]=qs[_0x6d78('0x1f')](_0x5a201b[_0x6d78('0x35')][_0x6d78('0x1f')]);_0x187f06[_0x6d78('0x1e')]=qs['offset'](_0x5a201b['query'][_0x6d78('0x1e')]);}_0x187f06[_0x6d78('0x3c')]=qs['sort'](_0x5a201b['query'][_0x6d78('0x3d')]);_0x187f06[_0x6d78('0x3e')]=qs[_0x6d78('0x3f')](_[_0x6d78('0x40')](_0x5a201b['query'],_0x493489[_0x6d78('0x3f')]),_0x294c64);if(_0x5a201b[_0x6d78('0x35')][_0x6d78('0x41')]){_0x187f06[_0x6d78('0x3e')]=_[_0x6d78('0x42')](_0x187f06[_0x6d78('0x3e')],{'$or':_[_0x6d78('0x34')](_0x294c64,function(_0x4944c6){if(_0x4944c6[_0x6d78('0x43')]!==_0x6d78('0x44')){var _0xd0096b={};_0xd0096b[_0x4944c6[_0x6d78('0x2c')]]={'$like':'%'+_0x5a201b[_0x6d78('0x35')]['filter']+'%'};return _0xd0096b;}})});}_0x187f06=_[_0x6d78('0x42')]({},_0x187f06,_0x5a201b['options']);var _0x2ed40a={'where':_0x187f06[_0x6d78('0x3e')]};return db['Dynamics365Configuration'][_0x6d78('0x21')](_0x2ed40a)[_0x6d78('0x27')](function(_0xcf6c7e){_0xe8b582[_0x6d78('0x21')]=_0xcf6c7e;if(_0x5a201b[_0x6d78('0x35')]['includeAll']){_0x187f06[_0x6d78('0x45')]=[{'all':!![]}];}return db[_0x6d78('0x2f')][_0x6d78('0x46')](_0x187f06);})[_0x6d78('0x27')](function(_0x52662c){_0xe8b582[_0x6d78('0x47')]=_0x52662c;return _0xe8b582;})[_0x6d78('0x27')](respondWithFilteredResult(_0xaa1f9d,_0x187f06))[_0x6d78('0x48')](handleError(_0xaa1f9d,null));};exports[_0x6d78('0x49')]=function(_0x3ac4bb,_0x35c1d2){var _0x43d06d={'raw':![],'where':{'id':_0x3ac4bb[_0x6d78('0x4a')]['id']}},_0x5393dc={};_0x5393dc[_0x6d78('0x33')]=_['keys'](db[_0x6d78('0x2f')][_0x6d78('0x30')]);_0x5393dc['query']=_['keys'](_0x3ac4bb[_0x6d78('0x35')]);_0x5393dc[_0x6d78('0x3f')]=_[_0x6d78('0x4b')](_0x5393dc[_0x6d78('0x33')],_0x5393dc[_0x6d78('0x35')]);_0x43d06d[_0x6d78('0x38')]=_[_0x6d78('0x4b')](_0x5393dc[_0x6d78('0x33')],qs['fields'](_0x3ac4bb[_0x6d78('0x35')][_0x6d78('0x37')]));_0x43d06d[_0x6d78('0x38')]=_0x43d06d[_0x6d78('0x38')][_0x6d78('0x39')]?_0x43d06d[_0x6d78('0x38')]:_0x5393dc[_0x6d78('0x33')];if(_0x3ac4bb[_0x6d78('0x35')][_0x6d78('0x4c')]){_0x43d06d[_0x6d78('0x45')]=[{'all':!![]}];}_0x43d06d=_['merge']({},_0x43d06d,_0x3ac4bb[_0x6d78('0x4d')]);return db[_0x6d78('0x2f')][_0x6d78('0x4e')](_0x43d06d)[_0x6d78('0x27')](handleEntityNotFound(_0x35c1d2,null))['then'](respondWithResult(_0x35c1d2,null))[_0x6d78('0x48')](handleError(_0x35c1d2,null));};exports['create']=function(_0x3f0e41,_0x4e1817){return db[_0x6d78('0x2f')][_0x6d78('0x4f')](_0x3f0e41[_0x6d78('0x50')],{})[_0x6d78('0x27')](respondWithResult(_0x4e1817,0xc9))[_0x6d78('0x48')](handleError(_0x4e1817,null));};exports['update']=function(_0x5b042d,_0x3a12e8){if(_0x5b042d[_0x6d78('0x50')]['id']){delete _0x5b042d[_0x6d78('0x50')]['id'];}return db[_0x6d78('0x2f')]['find']({'where':{'id':_0x5b042d[_0x6d78('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3a12e8,null))[_0x6d78('0x27')](saveUpdates(_0x5b042d[_0x6d78('0x50')],null))[_0x6d78('0x27')](respondWithResult(_0x3a12e8,null))[_0x6d78('0x48')](handleError(_0x3a12e8,null));};exports['destroy']=function(_0x45b0b5,_0x1d3703){return db[_0x6d78('0x2f')][_0x6d78('0x4e')]({'where':{'id':_0x45b0b5[_0x6d78('0x4a')]['id']}})[_0x6d78('0x27')](handleEntityNotFound(_0x1d3703,null))[_0x6d78('0x27')](removeEntity(_0x1d3703,null))[_0x6d78('0x48')](handleError(_0x1d3703,null));};exports[_0x6d78('0x51')]=function(_0x30601e,_0x2f1512,_0x1c7dbe){var _0x35e0ae={};var _0x4b60c8={};var _0x10d8de;var _0x31f508;return db[_0x6d78('0x2f')][_0x6d78('0x52')]({'where':{'id':_0x30601e[_0x6d78('0x4a')]['id']}})[_0x6d78('0x27')](handleEntityNotFound(_0x2f1512,null))[_0x6d78('0x27')](function(_0x37e5c9){if(_0x37e5c9){_0x10d8de=_0x37e5c9;_0x4b60c8['model']=_[_0x6d78('0x36')](db[_0x6d78('0x53')][_0x6d78('0x30')]);_0x4b60c8[_0x6d78('0x35')]=_[_0x6d78('0x36')](_0x30601e[_0x6d78('0x35')]);_0x4b60c8[_0x6d78('0x3f')]=_[_0x6d78('0x4b')](_0x4b60c8[_0x6d78('0x33')],_0x4b60c8['query']);_0x35e0ae[_0x6d78('0x38')]=_[_0x6d78('0x4b')](_0x4b60c8[_0x6d78('0x33')],qs[_0x6d78('0x37')](_0x30601e[_0x6d78('0x35')]['fields']));_0x35e0ae[_0x6d78('0x38')]=_0x35e0ae[_0x6d78('0x38')][_0x6d78('0x39')]?_0x35e0ae['attributes']:_0x4b60c8[_0x6d78('0x33')];_0x35e0ae[_0x6d78('0x3c')]=qs[_0x6d78('0x3d')](_0x30601e[_0x6d78('0x35')][_0x6d78('0x3d')]);_0x35e0ae[_0x6d78('0x3e')]=qs[_0x6d78('0x3f')](_[_0x6d78('0x40')](_0x30601e[_0x6d78('0x35')],_0x4b60c8[_0x6d78('0x3f')]));if(_0x30601e[_0x6d78('0x35')]['filter']){_0x35e0ae[_0x6d78('0x3e')]=_[_0x6d78('0x42')](_0x35e0ae['where'],{'$or':_[_0x6d78('0x34')](_0x35e0ae[_0x6d78('0x38')],function(_0x32e22f){var _0xfad510={};_0xfad510[_0x32e22f]={'$like':'%'+_0x30601e[_0x6d78('0x35')][_0x6d78('0x41')]+'%'};return _0xfad510;})});}_0x35e0ae=_[_0x6d78('0x42')]({},_0x35e0ae,_0x30601e[_0x6d78('0x4d')]);return _0x10d8de[_0x6d78('0x51')](_0x35e0ae);}})[_0x6d78('0x27')](function(_0x2f6707){if(_0x2f6707){_0x31f508=_0x2f6707[_0x6d78('0x39')];if(!_0x30601e[_0x6d78('0x35')][_0x6d78('0x3a')]('nolimit')){_0x35e0ae[_0x6d78('0x1f')]=qs[_0x6d78('0x1f')](_0x30601e['query']['limit']);_0x35e0ae['offset']=qs['offset'](_0x30601e[_0x6d78('0x35')][_0x6d78('0x1e')]);}return _0x10d8de[_0x6d78('0x51')](_0x35e0ae);}})['then'](function(_0x45f540){if(_0x45f540){return _0x45f540?{'count':_0x31f508,'rows':_0x45f540}:null;}})[_0x6d78('0x27')](respondWithResult(_0x2f1512,null))['catch'](handleError(_0x2f1512,null));};exports['getSubjects']=function(_0x29ec97,_0x2dbfc8,_0x1e2555){var _0x21d592={};var _0x25cc77={};var _0x45a2c1;var _0x5606da;return db[_0x6d78('0x2f')][_0x6d78('0x52')]({'where':{'id':_0x29ec97[_0x6d78('0x4a')]['id']}})[_0x6d78('0x27')](handleEntityNotFound(_0x2dbfc8,null))[_0x6d78('0x27')](function(_0x418d1d){if(_0x418d1d){_0x45a2c1=_0x418d1d;_0x25cc77[_0x6d78('0x33')]=_[_0x6d78('0x36')](db['Dynamics365Field'][_0x6d78('0x30')]);_0x25cc77['query']=_[_0x6d78('0x36')](_0x29ec97[_0x6d78('0x35')]);_0x25cc77[_0x6d78('0x3f')]=_[_0x6d78('0x4b')](_0x25cc77['model'],_0x25cc77[_0x6d78('0x35')]);_0x21d592[_0x6d78('0x38')]=_[_0x6d78('0x4b')](_0x25cc77[_0x6d78('0x33')],qs['fields'](_0x29ec97[_0x6d78('0x35')][_0x6d78('0x37')]));_0x21d592['attributes']=_0x21d592[_0x6d78('0x38')][_0x6d78('0x39')]?_0x21d592['attributes']:_0x25cc77[_0x6d78('0x33')];_0x21d592['order']=qs['sort'](_0x29ec97[_0x6d78('0x35')]['sort']);_0x21d592[_0x6d78('0x3e')]=qs['filters'](_['pick'](_0x29ec97['query'],_0x25cc77['filters']));if(_0x29ec97['query'][_0x6d78('0x41')]){_0x21d592[_0x6d78('0x3e')]=_[_0x6d78('0x42')](_0x21d592[_0x6d78('0x3e')],{'$or':_[_0x6d78('0x34')](_0x21d592[_0x6d78('0x38')],function(_0x12d919){var _0x3de8d6={};_0x3de8d6[_0x12d919]={'$like':'%'+_0x29ec97[_0x6d78('0x35')][_0x6d78('0x41')]+'%'};return _0x3de8d6;})});}_0x21d592=_[_0x6d78('0x42')]({},_0x21d592,_0x29ec97['options']);return _0x45a2c1[_0x6d78('0x54')](_0x21d592);}})[_0x6d78('0x27')](function(_0x50ea62){if(_0x50ea62){_0x5606da=_0x50ea62[_0x6d78('0x39')];if(!_0x29ec97['query']['hasOwnProperty']('nolimit')){_0x21d592[_0x6d78('0x1f')]=qs[_0x6d78('0x1f')](_0x29ec97['query'][_0x6d78('0x1f')]);_0x21d592['offset']=qs[_0x6d78('0x1e')](_0x29ec97[_0x6d78('0x35')]['offset']);}return _0x45a2c1['getSubjects'](_0x21d592);}})['then'](function(_0x5666b1){if(_0x5666b1){return _0x5666b1?{'count':_0x5606da,'rows':_0x5666b1}:null;}})[_0x6d78('0x27')](respondWithResult(_0x2dbfc8,null))[_0x6d78('0x48')](handleError(_0x2dbfc8,null));};exports[_0x6d78('0x55')]=function(_0x16659f,_0x13ef33,_0x30809e){var _0x418c75={};var _0xed9400={};var _0x2098eb;var _0x4a9c04;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x16659f['params']['id']}})[_0x6d78('0x27')](handleEntityNotFound(_0x13ef33,null))[_0x6d78('0x27')](function(_0x44fd78){if(_0x44fd78){_0x2098eb=_0x44fd78;_0xed9400[_0x6d78('0x33')]=_[_0x6d78('0x36')](db[_0x6d78('0x53')][_0x6d78('0x30')]);_0xed9400[_0x6d78('0x35')]=_[_0x6d78('0x36')](_0x16659f[_0x6d78('0x35')]);_0xed9400[_0x6d78('0x3f')]=_['intersection'](_0xed9400[_0x6d78('0x33')],_0xed9400['query']);_0x418c75[_0x6d78('0x38')]=_[_0x6d78('0x4b')](_0xed9400[_0x6d78('0x33')],qs['fields'](_0x16659f[_0x6d78('0x35')][_0x6d78('0x37')]));_0x418c75[_0x6d78('0x38')]=_0x418c75['attributes']['length']?_0x418c75[_0x6d78('0x38')]:_0xed9400[_0x6d78('0x33')];_0x418c75['order']=qs[_0x6d78('0x3d')](_0x16659f[_0x6d78('0x35')][_0x6d78('0x3d')]);_0x418c75[_0x6d78('0x3e')]=qs[_0x6d78('0x3f')](_['pick'](_0x16659f[_0x6d78('0x35')],_0xed9400[_0x6d78('0x3f')]));if(_0x16659f[_0x6d78('0x35')]['filter']){_0x418c75[_0x6d78('0x3e')]=_[_0x6d78('0x42')](_0x418c75[_0x6d78('0x3e')],{'$or':_[_0x6d78('0x34')](_0x418c75[_0x6d78('0x38')],function(_0x513e10){var _0x4ccb1d={};_0x4ccb1d[_0x513e10]={'$like':'%'+_0x16659f[_0x6d78('0x35')][_0x6d78('0x41')]+'%'};return _0x4ccb1d;})});}_0x418c75=_[_0x6d78('0x42')]({},_0x418c75,_0x16659f['options']);return _0x2098eb[_0x6d78('0x55')](_0x418c75);}})[_0x6d78('0x27')](function(_0x4bff8c){if(_0x4bff8c){_0x4a9c04=_0x4bff8c[_0x6d78('0x39')];if(!_0x16659f[_0x6d78('0x35')][_0x6d78('0x3a')](_0x6d78('0x3b'))){_0x418c75['limit']=qs['limit'](_0x16659f[_0x6d78('0x35')][_0x6d78('0x1f')]);_0x418c75[_0x6d78('0x1e')]=qs[_0x6d78('0x1e')](_0x16659f['query'][_0x6d78('0x1e')]);}return _0x2098eb[_0x6d78('0x55')](_0x418c75);}})[_0x6d78('0x27')](function(_0x2eb44b){if(_0x2eb44b){return _0x2eb44b?{'count':_0x4a9c04,'rows':_0x2eb44b}:null;}})[_0x6d78('0x27')](respondWithResult(_0x13ef33,null))[_0x6d78('0x48')](handleError(_0x13ef33,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 02bf4ed..112a4cc 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 _0x9a19=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x9a19,0x114));var _0x99a1=function(_0x71e493,_0x4308b7){_0x71e493=_0x71e493-0x0;var _0x3d40ab=_0x9a19[_0x71e493];return _0x3d40ab;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var logger=require(_0x99a1('0x2'))('api');var moment=require(_0x99a1('0x3'));var BPromise=require(_0x99a1('0x4'));var rp=require(_0x99a1('0x5'));var fs=require('fs');var path=require(_0x99a1('0x6'));var rimraf=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var attributes=require(_0x99a1('0x9'));module[_0x99a1('0xa')]=function(_0x3eff4a,_0xff0240){return _0x3eff4a[_0x99a1('0xb')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb821=['rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util','../../config/logger','bluebird'];(function(_0x3a129e,_0x4f871c){var _0x15f294=function(_0x5d1dd3){while(--_0x5d1dd3){_0x3a129e['push'](_0x3a129e['shift']());}};_0x15f294(++_0x4f871c);}(_0xb821,0xa7));var _0x1b82=function(_0x5a9c4d,_0x443f7f){_0x5a9c4d=_0x5a9c4d-0x0;var _0x409e45=_0xb821[_0x5a9c4d];return _0x409e45;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var logger=require(_0x1b82('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1b82('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1b82('0x3'));var config=require(_0x1b82('0x4'));var attributes=require(_0x1b82('0x5'));module[_0x1b82('0x6')]=function(_0x597ca7,_0x3e27c4){return _0x597ca7[_0x1b82('0x7')](_0x1b82('0x8'),attributes,{'tableName':_0x1b82('0x9'),'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 49a274d..9ac1bc0 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 _0x7c3e=['Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','info'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x7c3e,0x182));var _0xe7c3=function(_0xa911e,_0x1a9f9a){_0xa911e=_0xa911e-0x0;var _0x28bd6f=_0x7c3e[_0xa911e];return _0x28bd6f;};'use strict';var _=require(_0xe7c3('0x0'));var util=require(_0xe7c3('0x1'));var moment=require('moment');var BPromise=require(_0xe7c3('0x2'));var rs=require(_0xe7c3('0x3'));var fs=require('fs');var Redis=require(_0xe7c3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe7c3('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xe7c3('0x6'));var jayson=require(_0xe7c3('0x7'));var client=jayson[_0xe7c3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1428c8,_0x4cfb3c,_0x480268){return new BPromise(function(_0x140cdb,_0xa8703){return client['request'](_0x1428c8,_0x480268)['then'](function(_0x198d64){logger[_0xe7c3('0x9')](_0xe7c3('0xa'),_0x4cfb3c,_0xe7c3('0xb'));logger[_0xe7c3('0xc')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x4cfb3c,_0xe7c3('0xb'),JSON[_0xe7c3('0xd')](_0x198d64));if(_0x198d64[_0xe7c3('0xe')]){if(_0x198d64[_0xe7c3('0xe')][_0xe7c3('0xf')]===0x1f4){logger[_0xe7c3('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4cfb3c,_0x198d64[_0xe7c3('0xe')][_0xe7c3('0x10')]);return _0xa8703(_0x198d64['error'][_0xe7c3('0x10')]);}logger['error'](_0xe7c3('0xa'),_0x4cfb3c,_0x198d64['error'][_0xe7c3('0x10')]);return _0x140cdb(_0x198d64[_0xe7c3('0xe')][_0xe7c3('0x10')]);}else{logger[_0xe7c3('0x9')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4cfb3c,'request\x20sent');_0x140cdb(_0x198d64[_0xe7c3('0x11')][_0xe7c3('0x10')]);}})['catch'](function(_0x5819ac){logger[_0xe7c3('0xe')](_0xe7c3('0xa'),_0x4cfb3c,_0x5819ac);_0xa8703(_0x5819ac);});});} \ No newline at end of file +var _0x3e8a=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','moment','bluebird','randomstring'];(function(_0x36c6f0,_0x108e57){var _0x41b929=function(_0x5cbc58){while(--_0x5cbc58){_0x36c6f0['push'](_0x36c6f0['shift']());}};_0x41b929(++_0x108e57);}(_0x3e8a,0xe2));var _0xa3e8=function(_0x513213,_0x46a450){_0x513213=_0x513213-0x0;var _0x55d9d8=_0x3e8a[_0x513213];return _0x55d9d8;};'use strict';var _=require(_0xa3e8('0x0'));var util=require('util');var moment=require(_0xa3e8('0x1'));var BPromise=require(_0xa3e8('0x2'));var rs=require(_0xa3e8('0x3'));var fs=require('fs');var Redis=require(_0xa3e8('0x4'));var db=require(_0xa3e8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa3e8('0x6'))(_0xa3e8('0x7'));var config=require(_0xa3e8('0x8'));var jayson=require(_0xa3e8('0x9'));var client=jayson[_0xa3e8('0xa')][_0xa3e8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c4270,_0xee776a,_0x427324){return new BPromise(function(_0x4a48df,_0x5f3bbf){return client[_0xa3e8('0xc')](_0x1c4270,_0x427324)[_0xa3e8('0xd')](function(_0x5b1db8){logger['info'](_0xa3e8('0xe'),_0xee776a,_0xa3e8('0xf'));logger[_0xa3e8('0x10')](_0xa3e8('0x11'),_0xee776a,_0xa3e8('0xf'),JSON[_0xa3e8('0x12')](_0x5b1db8));if(_0x5b1db8[_0xa3e8('0x13')]){if(_0x5b1db8[_0xa3e8('0x13')][_0xa3e8('0x14')]===0x1f4){logger[_0xa3e8('0x13')](_0xa3e8('0xe'),_0xee776a,_0x5b1db8['error'][_0xa3e8('0x15')]);return _0x5f3bbf(_0x5b1db8[_0xa3e8('0x13')][_0xa3e8('0x15')]);}logger['error'](_0xa3e8('0xe'),_0xee776a,_0x5b1db8[_0xa3e8('0x13')]['message']);return _0x4a48df(_0x5b1db8['error'][_0xa3e8('0x15')]);}else{logger[_0xa3e8('0x16')](_0xa3e8('0xe'),_0xee776a,_0xa3e8('0xf'));_0x4a48df(_0x5b1db8['result']['message']);}})['catch'](function(_0x3d3d2b){logger[_0xa3e8('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0xee776a,_0x3d3d2b);_0x5f3bbf(_0x3d3d2b);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 43dd981..bd2b70a 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 _0x5b9e=['update','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x890c3a,_0x2fbaaa){var _0x18276e=function(_0x3c5b0f){while(--_0x3c5b0f){_0x890c3a['push'](_0x890c3a['shift']());}};_0x18276e(++_0x2fbaaa);}(_0x5b9e,0x134));var _0xe5b9=function(_0x9af914,_0x2ab624){_0x9af914=_0x9af914-0x0;var _0x405646=_0x5b9e[_0x9af914];return _0x405646;};'use strict';var multer=require(_0xe5b9('0x0'));var util=require('util');var path=require(_0xe5b9('0x1'));var timeout=require('connect-timeout');var express=require(_0xe5b9('0x2'));var router=express['Router']();var fs_extra=require(_0xe5b9('0x3'));var auth=require(_0xe5b9('0x4'));var interaction=require(_0xe5b9('0x5'));var config=require('../../config/environment');var controller=require(_0xe5b9('0x6'));router[_0xe5b9('0x7')]('/',auth[_0xe5b9('0x8')](),controller[_0xe5b9('0x9')]);router[_0xe5b9('0x7')](_0xe5b9('0xa'),auth['isAuthenticated'](),controller[_0xe5b9('0xb')]);router[_0xe5b9('0xc')]('/',auth['isAuthenticated'](),controller[_0xe5b9('0xd')]);router[_0xe5b9('0xe')](_0xe5b9('0xa'),auth[_0xe5b9('0x8')](),controller[_0xe5b9('0xf')]);router[_0xe5b9('0x10')](_0xe5b9('0xa'),auth[_0xe5b9('0x8')](),controller[_0xe5b9('0x11')]);module[_0xe5b9('0x12')]=router; \ No newline at end of file +var _0x014c=['../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x17550c,_0x4f9e05){var _0xded30f=function(_0x13045b){while(--_0x13045b){_0x17550c['push'](_0x17550c['shift']());}};_0xded30f(++_0x4f9e05);}(_0x014c,0x1b0));var _0xc014=function(_0x4a6cf8,_0x5534ef){_0x4a6cf8=_0x4a6cf8-0x0;var _0x22205e=_0x014c[_0x4a6cf8];return _0x22205e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xc014('0x0'));var express=require('express');var router=express[_0xc014('0x1')]();var fs_extra=require(_0xc014('0x2'));var auth=require(_0xc014('0x3'));var interaction=require(_0xc014('0x4'));var config=require(_0xc014('0x5'));var controller=require(_0xc014('0x6'));router[_0xc014('0x7')]('/',auth[_0xc014('0x8')](),controller[_0xc014('0x9')]);router[_0xc014('0x7')]('/:id',auth[_0xc014('0x8')](),controller[_0xc014('0xa')]);router[_0xc014('0xb')]('/',auth['isAuthenticated'](),controller[_0xc014('0xc')]);router[_0xc014('0xd')](_0xc014('0xe'),auth[_0xc014('0x8')](),controller[_0xc014('0xf')]);router[_0xc014('0x10')](_0xc014('0xe'),auth[_0xc014('0x8')](),controller[_0xc014('0x11')]);module[_0xc014('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index fba2516..cf0b3f8 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 _0xb4a3=['STRING','customVariable','sequelize','exports','ENUM','variable','keyValue','string'];(function(_0x2ebdf9,_0x28e9dc){var _0x31657a=function(_0x3f0c84){while(--_0x3f0c84){_0x2ebdf9['push'](_0x2ebdf9['shift']());}};_0x31657a(++_0x28e9dc);}(_0xb4a3,0x1e2));var _0x3b4a=function(_0x4c3070,_0xc2fb4c){_0x4c3070=_0x4c3070-0x0;var _0x536a44=_0xb4a3[_0x4c3070];return _0x536a44;};'use strict';var Sequelize=require(_0x3b4a('0x0'));module[_0x3b4a('0x1')]={'type':{'type':Sequelize[_0x3b4a('0x2')]('string',_0x3b4a('0x3'),'customVariable',_0x3b4a('0x4'),'picklist'),'defaultValue':_0x3b4a('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3b4a('0x6')]},'keyType':{'type':Sequelize[_0x3b4a('0x2')](_0x3b4a('0x5'),'variable',_0x3b4a('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3b4a('0x6')]},'nameField':{'type':Sequelize[_0x3b4a('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3b4a('0x6')]}}; \ No newline at end of file +var _0x154f=['sequelize','variable','keyValue','picklist','string','STRING','customVariable'];(function(_0x4170bb,_0x123bfe){var _0x3a1060=function(_0x33290f){while(--_0x33290f){_0x4170bb['push'](_0x4170bb['shift']());}};_0x3a1060(++_0x123bfe);}(_0x154f,0x93));var _0xf154=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x154f[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xf154('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0xf154('0x1'),'customVariable',_0xf154('0x2'),_0xf154('0x3')),'defaultValue':_0xf154('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf154('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xf154('0x4'),_0xf154('0x1'),_0xf154('0x6'))},'keyContent':{'type':Sequelize[_0xf154('0x5')]},'idField':{'type':Sequelize[_0xf154('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 3718c65..b51182b 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 _0xe130=['eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','destroy','then','error','name','send','index','Dynamics365Field','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','rows','catch','show','params','find','create','body'];(function(_0x25afea,_0x4b2a2b){var _0x30b4f4=function(_0x360982){while(--_0x360982){_0x25afea['push'](_0x25afea['shift']());}};_0x30b4f4(++_0x4b2a2b);}(_0xe130,0x120));var _0x0e13=function(_0x4a7f75,_0x3ba459){_0x4a7f75=_0x4a7f75-0x0;var _0x7e2e82=_0xe130[_0x4a7f75];return _0x7e2e82;};'use strict';var emlformat=require(_0x0e13('0x0'));var rimraf=require(_0x0e13('0x1'));var zipdir=require(_0x0e13('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0e13('0x3'));var moment=require(_0x0e13('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0e13('0x5'));var util=require(_0x0e13('0x6'));var path=require(_0x0e13('0x7'));var sox=require(_0x0e13('0x8'));var csv=require(_0x0e13('0x9'));var ejs=require(_0x0e13('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e13('0xb'));var squel=require(_0x0e13('0xc'));var crypto=require(_0x0e13('0xd'));var jsforce=require(_0x0e13('0xe'));var deskjs=require(_0x0e13('0xf'));var toCsv=require(_0x0e13('0x9'));var querystring=require('querystring');var Papa=require(_0x0e13('0x10'));var Redis=require('ioredis');var authService=require(_0x0e13('0x11'));var qs=require(_0x0e13('0x12'));var as=require(_0x0e13('0x13'));var hardwareService=require(_0x0e13('0x14'));var logger=require(_0x0e13('0x15'))('api');var utils=require(_0x0e13('0x16'));var config=require(_0x0e13('0x17'));var licenseUtil=require(_0x0e13('0x18'));var db=require(_0x0e13('0x19'))['db'];function respondWithStatusCode(_0x1ed4f5,_0xf1b8a7){_0xf1b8a7=_0xf1b8a7||0xcc;return function(_0x5805d2){if(_0x5805d2){return _0x1ed4f5[_0x0e13('0x1a')](_0xf1b8a7);}return _0x1ed4f5[_0x0e13('0x1b')](_0xf1b8a7)[_0x0e13('0x1c')]();};}function respondWithResult(_0x58b0ad,_0x504740){_0x504740=_0x504740||0xc8;return function(_0x332d12){if(_0x332d12){return _0x58b0ad[_0x0e13('0x1b')](_0x504740)[_0x0e13('0x1d')](_0x332d12);}};}function respondWithFilteredResult(_0xaff74,_0x372d04){return function(_0x3b65f2){if(_0x3b65f2){var _0x31a90f=typeof _0x372d04['offset']===_0x0e13('0x1e')&&typeof _0x372d04[_0x0e13('0x1f')]===_0x0e13('0x1e');var _0x853128=_0x3b65f2[_0x0e13('0x20')];var _0x2f284e=_0x31a90f?0x0:_0x372d04[_0x0e13('0x21')];var _0xb6e057=_0x31a90f?_0x3b65f2[_0x0e13('0x20')]:_0x372d04[_0x0e13('0x21')]+_0x372d04[_0x0e13('0x1f')];var _0x23f87c;if(_0xb6e057>=_0x853128){_0xb6e057=_0x853128;_0x23f87c=0xc8;}else{_0x23f87c=0xce;}_0xaff74[_0x0e13('0x1b')](_0x23f87c);return _0xaff74[_0x0e13('0x22')]('Content-Range',_0x2f284e+'-'+_0xb6e057+'/'+_0x853128)['json'](_0x3b65f2);}return null;};}function patchUpdates(_0x3a1aa3){return function(_0x24d327){try{jsonpatch['apply'](_0x24d327,_0x3a1aa3,!![]);}catch(_0x238f9e){return BPromise[_0x0e13('0x23')](_0x238f9e);}return _0x24d327[_0x0e13('0x24')]();};}function saveUpdates(_0x4e7f4e,_0xa941c5){return function(_0x31d653){if(_0x31d653){return _0x31d653['update'](_0x4e7f4e)['then'](function(_0x45942b){return _0x45942b;});}return null;};}function removeEntity(_0x221d4e,_0x3b5e91){return function(_0x236946){if(_0x236946){return _0x236946[_0x0e13('0x25')]()[_0x0e13('0x26')](function(){_0x221d4e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x25697f,_0x5c4a64){return function(_0x1b49ea){if(!_0x1b49ea){_0x25697f['sendStatus'](0x194);}return _0x1b49ea;};}function handleError(_0x4de61b,_0x2256e5){_0x2256e5=_0x2256e5||0x1f4;return function(_0x1117f1){logger[_0x0e13('0x27')](_0x1117f1['stack']);if(_0x1117f1[_0x0e13('0x28')]){delete _0x1117f1['name'];}_0x4de61b['status'](_0x2256e5)[_0x0e13('0x29')](_0x1117f1);};}exports[_0x0e13('0x2a')]=function(_0x4c89ea,_0x1f1578){var _0x3cedfc={},_0x293f7e={},_0x481add={'count':0x0,'rows':[]};var _0x2db98a=_['map'](db[_0x0e13('0x2b')][_0x0e13('0x2c')],function(_0x5a64f3){return{'name':_0x5a64f3['fieldName'],'type':_0x5a64f3[_0x0e13('0x2d')][_0x0e13('0x2e')]};});_0x293f7e[_0x0e13('0x2f')]=_[_0x0e13('0x30')](_0x2db98a,_0x0e13('0x28'));_0x293f7e[_0x0e13('0x31')]=_[_0x0e13('0x32')](_0x4c89ea['query']);_0x293f7e[_0x0e13('0x33')]=_[_0x0e13('0x34')](_0x293f7e['model'],_0x293f7e[_0x0e13('0x31')]);_0x3cedfc[_0x0e13('0x35')]=_[_0x0e13('0x34')](_0x293f7e[_0x0e13('0x2f')],qs[_0x0e13('0x36')](_0x4c89ea['query'][_0x0e13('0x36')]));_0x3cedfc['attributes']=_0x3cedfc[_0x0e13('0x35')]['length']?_0x3cedfc[_0x0e13('0x35')]:_0x293f7e[_0x0e13('0x2f')];if(!_0x4c89ea[_0x0e13('0x31')][_0x0e13('0x37')](_0x0e13('0x38'))){_0x3cedfc[_0x0e13('0x1f')]=qs[_0x0e13('0x1f')](_0x4c89ea['query'][_0x0e13('0x1f')]);_0x3cedfc['offset']=qs[_0x0e13('0x21')](_0x4c89ea[_0x0e13('0x31')][_0x0e13('0x21')]);}_0x3cedfc[_0x0e13('0x39')]=qs[_0x0e13('0x3a')](_0x4c89ea[_0x0e13('0x31')][_0x0e13('0x3a')]);_0x3cedfc[_0x0e13('0x3b')]=qs[_0x0e13('0x33')](_[_0x0e13('0x3c')](_0x4c89ea[_0x0e13('0x31')],_0x293f7e[_0x0e13('0x33')]),_0x2db98a);if(_0x4c89ea[_0x0e13('0x31')][_0x0e13('0x3d')]){_0x3cedfc[_0x0e13('0x3b')]=_['merge'](_0x3cedfc[_0x0e13('0x3b')],{'$or':_[_0x0e13('0x30')](_0x2db98a,function(_0x3a42ca){if(_0x3a42ca['type']!=='VIRTUAL'){var _0x26214d={};_0x26214d[_0x3a42ca[_0x0e13('0x28')]]={'$like':'%'+_0x4c89ea[_0x0e13('0x31')][_0x0e13('0x3d')]+'%'};return _0x26214d;}})});}_0x3cedfc=_[_0x0e13('0x3e')]({},_0x3cedfc,_0x4c89ea[_0x0e13('0x3f')]);var _0x2f9451={'where':_0x3cedfc[_0x0e13('0x3b')]};return db[_0x0e13('0x2b')][_0x0e13('0x20')](_0x2f9451)[_0x0e13('0x26')](function(_0x1c6a91){_0x481add[_0x0e13('0x20')]=_0x1c6a91;if(_0x4c89ea['query']['includeAll']){_0x3cedfc[_0x0e13('0x40')]=[{'all':!![]}];}return db[_0x0e13('0x2b')]['findAll'](_0x3cedfc);})[_0x0e13('0x26')](function(_0xadad6b){_0x481add[_0x0e13('0x41')]=_0xadad6b;return _0x481add;})[_0x0e13('0x26')](respondWithFilteredResult(_0x1f1578,_0x3cedfc))[_0x0e13('0x42')](handleError(_0x1f1578,null));};exports[_0x0e13('0x43')]=function(_0x1f0cfb,_0x48003f){var _0x8a7703={'raw':!![],'where':{'id':_0x1f0cfb[_0x0e13('0x44')]['id']}},_0x416c8d={};_0x416c8d[_0x0e13('0x2f')]=_['keys'](db[_0x0e13('0x2b')][_0x0e13('0x2c')]);_0x416c8d[_0x0e13('0x31')]=_[_0x0e13('0x32')](_0x1f0cfb[_0x0e13('0x31')]);_0x416c8d[_0x0e13('0x33')]=_[_0x0e13('0x34')](_0x416c8d['model'],_0x416c8d[_0x0e13('0x31')]);_0x8a7703[_0x0e13('0x35')]=_[_0x0e13('0x34')](_0x416c8d[_0x0e13('0x2f')],qs[_0x0e13('0x36')](_0x1f0cfb[_0x0e13('0x31')]['fields']));_0x8a7703['attributes']=_0x8a7703[_0x0e13('0x35')]['length']?_0x8a7703['attributes']:_0x416c8d['model'];if(_0x1f0cfb[_0x0e13('0x31')]['includeAll']){_0x8a7703[_0x0e13('0x40')]=[{'all':!![]}];}_0x8a7703=_[_0x0e13('0x3e')]({},_0x8a7703,_0x1f0cfb[_0x0e13('0x3f')]);return db[_0x0e13('0x2b')][_0x0e13('0x45')](_0x8a7703)['then'](handleEntityNotFound(_0x48003f,null))[_0x0e13('0x26')](respondWithResult(_0x48003f,null))[_0x0e13('0x42')](handleError(_0x48003f,null));};exports[_0x0e13('0x46')]=function(_0x543796,_0x49f662){return db[_0x0e13('0x2b')][_0x0e13('0x46')](_0x543796[_0x0e13('0x47')],{})[_0x0e13('0x26')](respondWithResult(_0x49f662,0xc9))[_0x0e13('0x42')](handleError(_0x49f662,null));};exports['update']=function(_0x511667,_0x537322){if(_0x511667['body']['id']){delete _0x511667['body']['id'];}return db[_0x0e13('0x2b')][_0x0e13('0x45')]({'where':{'id':_0x511667[_0x0e13('0x44')]['id']}})[_0x0e13('0x26')](handleEntityNotFound(_0x537322,null))[_0x0e13('0x26')](saveUpdates(_0x511667['body'],null))[_0x0e13('0x26')](respondWithResult(_0x537322,null))[_0x0e13('0x42')](handleError(_0x537322,null));};exports[_0x0e13('0x25')]=function(_0x2d1549,_0x1a18a1){return db[_0x0e13('0x2b')]['find']({'where':{'id':_0x2d1549[_0x0e13('0x44')]['id']}})[_0x0e13('0x26')](handleEntityNotFound(_0x1a18a1,null))[_0x0e13('0x26')](removeEntity(_0x1a18a1,null))['catch'](handleError(_0x1a18a1,null));}; \ No newline at end of file +var _0x406a=['error','stack','name','send','map','rawAttributes','fieldName','type','keys','filters','intersection','attributes','fields','query','length','model','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','Dynamics365Field','then','includeAll','include','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update'];(function(_0x47b359,_0x4cac22){var _0x2359ce=function(_0x5a5426){while(--_0x5a5426){_0x47b359['push'](_0x47b359['shift']());}};_0x2359ce(++_0x4cac22);}(_0x406a,0xaf));var _0xa406=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0x406a[_0x4e7d25];return _0x526fe6;};'use strict';var emlformat=require(_0xa406('0x0'));var rimraf=require(_0xa406('0x1'));var zipdir=require(_0xa406('0x2'));var jsonpatch=require(_0xa406('0x3'));var rp=require('request-promise');var moment=require(_0xa406('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa406('0x5'));var util=require(_0xa406('0x6'));var path=require(_0xa406('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa406('0x8'));var fs=require('fs');var fs_extra=require(_0xa406('0x9'));var _=require(_0xa406('0xa'));var squel=require(_0xa406('0xb'));var crypto=require(_0xa406('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa406('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa406('0xe'));var Redis=require(_0xa406('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa406('0x10'));var hardwareService=require(_0xa406('0x11'));var logger=require(_0xa406('0x12'))(_0xa406('0x13'));var utils=require('../../config/utils');var config=require(_0xa406('0x14'));var licenseUtil=require(_0xa406('0x15'));var db=require(_0xa406('0x16'))['db'];function respondWithStatusCode(_0x349a56,_0x251183){_0x251183=_0x251183||0xcc;return function(_0xc36545){if(_0xc36545){return _0x349a56[_0xa406('0x17')](_0x251183);}return _0x349a56[_0xa406('0x18')](_0x251183)[_0xa406('0x19')]();};}function respondWithResult(_0x149932,_0xc20590){_0xc20590=_0xc20590||0xc8;return function(_0x5cc7e8){if(_0x5cc7e8){return _0x149932[_0xa406('0x18')](_0xc20590)[_0xa406('0x1a')](_0x5cc7e8);}};}function respondWithFilteredResult(_0xd170e9,_0xe4a2a6){return function(_0x10ec65){if(_0x10ec65){var _0x582511=typeof _0xe4a2a6['offset']===_0xa406('0x1b')&&typeof _0xe4a2a6[_0xa406('0x1c')]===_0xa406('0x1b');var _0x434291=_0x10ec65[_0xa406('0x1d')];var _0x3bd1e7=_0x582511?0x0:_0xe4a2a6[_0xa406('0x1e')];var _0x21e158=_0x582511?_0x10ec65[_0xa406('0x1d')]:_0xe4a2a6[_0xa406('0x1e')]+_0xe4a2a6['limit'];var _0x47eb95;if(_0x21e158>=_0x434291){_0x21e158=_0x434291;_0x47eb95=0xc8;}else{_0x47eb95=0xce;}_0xd170e9['status'](_0x47eb95);return _0xd170e9['set']('Content-Range',_0x3bd1e7+'-'+_0x21e158+'/'+_0x434291)[_0xa406('0x1a')](_0x10ec65);}return null;};}function patchUpdates(_0x26ebd4){return function(_0x2ea462){try{jsonpatch[_0xa406('0x1f')](_0x2ea462,_0x26ebd4,!![]);}catch(_0x1dde38){return BPromise[_0xa406('0x20')](_0x1dde38);}return _0x2ea462[_0xa406('0x21')]();};}function saveUpdates(_0xe4e8ff,_0x2b4360){return function(_0x144702){if(_0x144702){return _0x144702[_0xa406('0x22')](_0xe4e8ff)['then'](function(_0x1ea205){return _0x1ea205;});}return null;};}function removeEntity(_0x17bac0,_0x143471){return function(_0x5f0487){if(_0x5f0487){return _0x5f0487['destroy']()['then'](function(){_0x17bac0[_0xa406('0x18')](0xcc)[_0xa406('0x19')]();});}};}function handleEntityNotFound(_0x4fbb7a,_0x1443c6){return function(_0x57ec1c){if(!_0x57ec1c){_0x4fbb7a[_0xa406('0x17')](0x194);}return _0x57ec1c;};}function handleError(_0x53e277,_0x483069){_0x483069=_0x483069||0x1f4;return function(_0x453d54){logger[_0xa406('0x23')](_0x453d54[_0xa406('0x24')]);if(_0x453d54[_0xa406('0x25')]){delete _0x453d54[_0xa406('0x25')];}_0x53e277[_0xa406('0x18')](_0x483069)[_0xa406('0x26')](_0x453d54);};}exports['index']=function(_0x1c5809,_0x2a344a){var _0x35f1c2={},_0x34da91={},_0x29d8ac={'count':0x0,'rows':[]};var _0x492ae3=_[_0xa406('0x27')](db['Dynamics365Field'][_0xa406('0x28')],function(_0x26a297){return{'name':_0x26a297[_0xa406('0x29')],'type':_0x26a297[_0xa406('0x2a')]['key']};});_0x34da91['model']=_[_0xa406('0x27')](_0x492ae3,'name');_0x34da91['query']=_[_0xa406('0x2b')](_0x1c5809['query']);_0x34da91[_0xa406('0x2c')]=_[_0xa406('0x2d')](_0x34da91['model'],_0x34da91['query']);_0x35f1c2[_0xa406('0x2e')]=_[_0xa406('0x2d')](_0x34da91['model'],qs[_0xa406('0x2f')](_0x1c5809[_0xa406('0x30')][_0xa406('0x2f')]));_0x35f1c2[_0xa406('0x2e')]=_0x35f1c2[_0xa406('0x2e')][_0xa406('0x31')]?_0x35f1c2[_0xa406('0x2e')]:_0x34da91[_0xa406('0x32')];if(!_0x1c5809['query'][_0xa406('0x33')](_0xa406('0x34'))){_0x35f1c2[_0xa406('0x1c')]=qs[_0xa406('0x1c')](_0x1c5809[_0xa406('0x30')][_0xa406('0x1c')]);_0x35f1c2[_0xa406('0x1e')]=qs['offset'](_0x1c5809['query'][_0xa406('0x1e')]);}_0x35f1c2[_0xa406('0x35')]=qs[_0xa406('0x36')](_0x1c5809['query']['sort']);_0x35f1c2[_0xa406('0x37')]=qs[_0xa406('0x2c')](_[_0xa406('0x38')](_0x1c5809[_0xa406('0x30')],_0x34da91[_0xa406('0x2c')]),_0x492ae3);if(_0x1c5809[_0xa406('0x30')]['filter']){_0x35f1c2['where']=_['merge'](_0x35f1c2[_0xa406('0x37')],{'$or':_[_0xa406('0x27')](_0x492ae3,function(_0x1d4f13){if(_0x1d4f13[_0xa406('0x2a')]!==_0xa406('0x39')){var _0x366c5f={};_0x366c5f[_0x1d4f13[_0xa406('0x25')]]={'$like':'%'+_0x1c5809[_0xa406('0x30')][_0xa406('0x3a')]+'%'};return _0x366c5f;}})});}_0x35f1c2=_[_0xa406('0x3b')]({},_0x35f1c2,_0x1c5809[_0xa406('0x3c')]);var _0x298132={'where':_0x35f1c2[_0xa406('0x37')]};return db[_0xa406('0x3d')][_0xa406('0x1d')](_0x298132)[_0xa406('0x3e')](function(_0x4f1119){_0x29d8ac[_0xa406('0x1d')]=_0x4f1119;if(_0x1c5809[_0xa406('0x30')][_0xa406('0x3f')]){_0x35f1c2[_0xa406('0x40')]=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0x35f1c2);})['then'](function(_0x280d2f){_0x29d8ac['rows']=_0x280d2f;return _0x29d8ac;})[_0xa406('0x3e')](respondWithFilteredResult(_0x2a344a,_0x35f1c2))[_0xa406('0x41')](handleError(_0x2a344a,null));};exports['show']=function(_0x551f40,_0x33d458){var _0x18a7cd={'raw':!![],'where':{'id':_0x551f40[_0xa406('0x42')]['id']}},_0x56e40a={};_0x56e40a[_0xa406('0x32')]=_[_0xa406('0x2b')](db['Dynamics365Field'][_0xa406('0x28')]);_0x56e40a[_0xa406('0x30')]=_['keys'](_0x551f40[_0xa406('0x30')]);_0x56e40a[_0xa406('0x2c')]=_[_0xa406('0x2d')](_0x56e40a[_0xa406('0x32')],_0x56e40a[_0xa406('0x30')]);_0x18a7cd[_0xa406('0x2e')]=_[_0xa406('0x2d')](_0x56e40a[_0xa406('0x32')],qs['fields'](_0x551f40[_0xa406('0x30')][_0xa406('0x2f')]));_0x18a7cd[_0xa406('0x2e')]=_0x18a7cd[_0xa406('0x2e')][_0xa406('0x31')]?_0x18a7cd['attributes']:_0x56e40a[_0xa406('0x32')];if(_0x551f40[_0xa406('0x30')][_0xa406('0x3f')]){_0x18a7cd[_0xa406('0x40')]=[{'all':!![]}];}_0x18a7cd=_['merge']({},_0x18a7cd,_0x551f40[_0xa406('0x3c')]);return db['Dynamics365Field'][_0xa406('0x43')](_0x18a7cd)[_0xa406('0x3e')](handleEntityNotFound(_0x33d458,null))[_0xa406('0x3e')](respondWithResult(_0x33d458,null))[_0xa406('0x41')](handleError(_0x33d458,null));};exports[_0xa406('0x44')]=function(_0x1226eb,_0x3eb602){return db[_0xa406('0x3d')]['create'](_0x1226eb[_0xa406('0x45')],{})[_0xa406('0x3e')](respondWithResult(_0x3eb602,0xc9))[_0xa406('0x41')](handleError(_0x3eb602,null));};exports[_0xa406('0x22')]=function(_0x128cd2,_0x14bcad){if(_0x128cd2[_0xa406('0x45')]['id']){delete _0x128cd2[_0xa406('0x45')]['id'];}return db['Dynamics365Field'][_0xa406('0x43')]({'where':{'id':_0x128cd2[_0xa406('0x42')]['id']}})[_0xa406('0x3e')](handleEntityNotFound(_0x14bcad,null))[_0xa406('0x3e')](saveUpdates(_0x128cd2['body'],null))[_0xa406('0x3e')](respondWithResult(_0x14bcad,null))[_0xa406('0x41')](handleError(_0x14bcad,null));};exports['destroy']=function(_0x4c818b,_0x3d1b8c){return db[_0xa406('0x3d')][_0xa406('0x43')]({'where':{'id':_0x4c818b[_0xa406('0x42')]['id']}})[_0xa406('0x3e')](handleEntityNotFound(_0x3d1b8c,null))[_0xa406('0x3e')](removeEntity(_0x3d1b8c,null))[_0xa406('0x41')](handleError(_0x3d1b8c,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index a2f38ec..c0d01e5 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 _0x671a=['rimraf','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x4ed4d2,_0x47acf7){var _0x15ae2e=function(_0x3199f0){while(--_0x3199f0){_0x4ed4d2['push'](_0x4ed4d2['shift']());}};_0x15ae2e(++_0x47acf7);}(_0x671a,0x81));var _0xa671=function(_0x21d2a6,_0x44c6cc){_0x21d2a6=_0x21d2a6-0x0;var _0x3a5b9f=_0x671a[_0x21d2a6];return _0x3a5b9f;};'use strict';var _=require(_0xa671('0x0'));var util=require(_0xa671('0x1'));var logger=require(_0xa671('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa671('0x3'));var rp=require(_0xa671('0x4'));var fs=require('fs');var path=require(_0xa671('0x5'));var rimraf=require(_0xa671('0x6'));var config=require('../../config/environment');var attributes=require(_0xa671('0x7'));module[_0xa671('0x8')]=function(_0x15d9e6,_0x5039e8){return _0x15d9e6[_0xa671('0x9')](_0xa671('0xa'),attributes,{'tableName':_0xa671('0xb'),'paranoid':![],'indexes':[{'name':_0xa671('0xc'),'fields':[_0xa671('0xd'),_0xa671('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x79c1=['path','rimraf','../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise'];(function(_0x33d820,_0x153a07){var _0x48d623=function(_0x16d76d){while(--_0x16d76d){_0x33d820['push'](_0x33d820['shift']());}};_0x48d623(++_0x153a07);}(_0x79c1,0xea));var _0x179c=function(_0x32c8aa,_0x3d0d7e){_0x32c8aa=_0x32c8aa-0x0;var _0x5ad8dc=_0x79c1[_0x32c8aa];return _0x5ad8dc;};'use strict';var _=require(_0x179c('0x0'));var util=require(_0x179c('0x1'));var logger=require('../../config/logger')(_0x179c('0x2'));var moment=require(_0x179c('0x3'));var BPromise=require(_0x179c('0x4'));var rp=require(_0x179c('0x5'));var fs=require('fs');var path=require(_0x179c('0x6'));var rimraf=require(_0x179c('0x7'));var config=require(_0x179c('0x8'));var attributes=require(_0x179c('0x9'));module['exports']=function(_0x4606e0,_0x1ece8d){return _0x4606e0[_0x179c('0xa')](_0x179c('0xb'),attributes,{'tableName':_0x179c('0xc'),'paranoid':![],'indexes':[{'name':_0x179c('0xd'),'fields':[_0x179c('0xe'),_0x179c('0xf')],'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 e37a94e..917274e 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 _0x7f05=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x10e847,_0x2922d3){var _0x2c466e=function(_0x53ef8d){while(--_0x53ef8d){_0x10e847['push'](_0x10e847['shift']());}};_0x2c466e(++_0x2922d3);}(_0x7f05,0x1cc));var _0x57f0=function(_0x37b821,_0x3e6ed9){_0x37b821=_0x37b821-0x0;var _0x401018=_0x7f05[_0x37b821];return _0x401018;};'use strict';var _=require(_0x57f0('0x0'));var util=require(_0x57f0('0x1'));var moment=require(_0x57f0('0x2'));var BPromise=require(_0x57f0('0x3'));var rs=require(_0x57f0('0x4'));var fs=require('fs');var Redis=require(_0x57f0('0x5'));var db=require(_0x57f0('0x6'))['db'];var utils=require(_0x57f0('0x7'));var logger=require(_0x57f0('0x8'))('rpc');var config=require(_0x57f0('0x9'));var jayson=require(_0x57f0('0xa'));var client=jayson[_0x57f0('0xb')][_0x57f0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1edb7f,_0x50a9aa,_0x820851){return new BPromise(function(_0x7d03b8,_0x3dc362){return client[_0x57f0('0xd')](_0x1edb7f,_0x820851)['then'](function(_0x427936){logger[_0x57f0('0xe')](_0x57f0('0xf'),_0x50a9aa,_0x57f0('0x10'));logger[_0x57f0('0x11')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x50a9aa,_0x57f0('0x10'),JSON[_0x57f0('0x12')](_0x427936));if(_0x427936[_0x57f0('0x13')]){if(_0x427936[_0x57f0('0x13')][_0x57f0('0x14')]===0x1f4){logger[_0x57f0('0x13')](_0x57f0('0xf'),_0x50a9aa,_0x427936[_0x57f0('0x13')][_0x57f0('0x15')]);return _0x3dc362(_0x427936[_0x57f0('0x13')]['message']);}logger[_0x57f0('0x13')](_0x57f0('0xf'),_0x50a9aa,_0x427936['error']['message']);return _0x7d03b8(_0x427936[_0x57f0('0x13')]['message']);}else{logger[_0x57f0('0xe')](_0x57f0('0xf'),_0x50a9aa,_0x57f0('0x10'));_0x7d03b8(_0x427936[_0x57f0('0x16')][_0x57f0('0x15')]);}})[_0x57f0('0x17')](function(_0x54bd05){logger['error'](_0x57f0('0xf'),_0x50a9aa,_0x54bd05);_0x3dc362(_0x54bd05);});});} \ No newline at end of file +var _0xa581=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','request','info','debug','request\x20sent','stringify','error','code','Dynamics365Field,\x20%s,\x20%s'];(function(_0x9bd2d4,_0x4deb9b){var _0x4da5fc=function(_0x49a971){while(--_0x49a971){_0x9bd2d4['push'](_0x9bd2d4['shift']());}};_0x4da5fc(++_0x4deb9b);}(_0xa581,0x7b));var _0x1a58=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa581[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1a58('0x0'));var util=require('util');var moment=require(_0x1a58('0x1'));var BPromise=require(_0x1a58('0x2'));var rs=require(_0x1a58('0x3'));var fs=require('fs');var Redis=require(_0x1a58('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a58('0x5'));var logger=require('../../config/logger')(_0x1a58('0x6'));var config=require('../../config/environment');var jayson=require(_0x1a58('0x7'));var client=jayson[_0x1a58('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b3c0f,_0x3ff9fb,_0x5f18ad){return new BPromise(function(_0x34713,_0x335bf6){return client[_0x1a58('0x9')](_0x5b3c0f,_0x5f18ad)['then'](function(_0x280485){logger[_0x1a58('0xa')]('Dynamics365Field,\x20%s,\x20%s',_0x3ff9fb,'request\x20sent');logger[_0x1a58('0xb')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x3ff9fb,_0x1a58('0xc'),JSON[_0x1a58('0xd')](_0x280485));if(_0x280485[_0x1a58('0xe')]){if(_0x280485[_0x1a58('0xe')][_0x1a58('0xf')]===0x1f4){logger[_0x1a58('0xe')](_0x1a58('0x10'),_0x3ff9fb,_0x280485[_0x1a58('0xe')][_0x1a58('0x11')]);return _0x335bf6(_0x280485[_0x1a58('0xe')][_0x1a58('0x11')]);}logger[_0x1a58('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x3ff9fb,_0x280485['error'][_0x1a58('0x11')]);return _0x34713(_0x280485[_0x1a58('0xe')][_0x1a58('0x11')]);}else{logger[_0x1a58('0xa')](_0x1a58('0x10'),_0x3ff9fb,'request\x20sent');_0x34713(_0x280485[_0x1a58('0x12')][_0x1a58('0x11')]);}})[_0x1a58('0x13')](function(_0x53140e){logger['error'](_0x1a58('0x10'),_0x3ff9fb,_0x53140e);_0x335bf6(_0x53140e);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index af998f7..cc6d6e4 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 _0xb169=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','delete','destroy','multer','util'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0xb169,0x132));var _0x9b16=function(_0x28be72,_0x2b83af){_0x28be72=_0x28be72-0x0;var _0x46c5da=_0xb169[_0x28be72];return _0x46c5da;};'use strict';var multer=require(_0x9b16('0x0'));var util=require(_0x9b16('0x1'));var path=require(_0x9b16('0x2'));var timeout=require(_0x9b16('0x3'));var express=require(_0x9b16('0x4'));var router=express[_0x9b16('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9b16('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9b16('0x7'));var controller=require(_0x9b16('0x8'));router[_0x9b16('0x9')]('/',auth[_0x9b16('0xa')](),controller[_0x9b16('0xb')]);router[_0x9b16('0x9')](_0x9b16('0xc'),auth[_0x9b16('0xa')](),controller[_0x9b16('0xd')]);router['get']('/:id/configurations',auth['isAuthenticated'](),controller[_0x9b16('0xe')]);router[_0x9b16('0x9')](_0x9b16('0xf'),auth[_0x9b16('0xa')](),controller[_0x9b16('0x10')]);router[_0x9b16('0x11')]('/',auth[_0x9b16('0xa')](),controller['create']);router[_0x9b16('0x11')]('/:id/configurations',auth[_0x9b16('0xa')](),controller[_0x9b16('0x12')]);router[_0x9b16('0x13')](_0x9b16('0xc'),auth[_0x9b16('0xa')](),controller['update']);router[_0x9b16('0x14')](_0x9b16('0xc'),auth['isAuthenticated'](),controller[_0x9b16('0x15')]);module['exports']=router; \ No newline at end of file +var _0xfe05=['post','/:id/configurations','addConfiguration','put','/:id','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','index','get','isAuthenticated','getConfigurations','/:id/fields','getFields','create'];(function(_0x42808b,_0xd65671){var _0xb1c527=function(_0x36330d){while(--_0x36330d){_0x42808b['push'](_0x42808b['shift']());}};_0xb1c527(++_0xd65671);}(_0xfe05,0xb7));var _0x5fe0=function(_0x1606c9,_0xa13cd){_0x1606c9=_0x1606c9-0x0;var _0x4e0fdd=_0xfe05[_0x1606c9];return _0x4e0fdd;};'use strict';var multer=require(_0x5fe0('0x0'));var util=require(_0x5fe0('0x1'));var path=require(_0x5fe0('0x2'));var timeout=require(_0x5fe0('0x3'));var express=require('express');var router=express[_0x5fe0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5fe0('0x5'));var interaction=require(_0x5fe0('0x6'));var config=require('../../config/environment');var controller=require(_0x5fe0('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x5fe0('0x8')]);router[_0x5fe0('0x9')]('/:id',auth[_0x5fe0('0xa')](),controller['show']);router[_0x5fe0('0x9')]('/:id/configurations',auth[_0x5fe0('0xa')](),controller[_0x5fe0('0xb')]);router['get'](_0x5fe0('0xc'),auth[_0x5fe0('0xa')](),controller[_0x5fe0('0xd')]);router['post']('/',auth[_0x5fe0('0xa')](),controller[_0x5fe0('0xe')]);router[_0x5fe0('0xf')](_0x5fe0('0x10'),auth['isAuthenticated'](),controller[_0x5fe0('0x11')]);router[_0x5fe0('0x12')](_0x5fe0('0x13'),auth[_0x5fe0('0xa')](),controller['update']);router[_0x5fe0('0x14')](_0x5fe0('0x13'),auth[_0x5fe0('0xa')](),controller[_0x5fe0('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 0f41042..3c9deb4 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 _0x2272=['sequelize','exports','STRING','remoteUri'];(function(_0x1a9e78,_0x180720){var _0x113e06=function(_0x229c64){while(--_0x229c64){_0x1a9e78['push'](_0x1a9e78['shift']());}};_0x113e06(++_0x180720);}(_0x2272,0xd8));var _0x2227=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2272[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x2227('0x0'));module[_0x2227('0x1')]={'name':{'type':Sequelize[_0x2227('0x2')]},'description':{'type':Sequelize[_0x2227('0x2')]},'username':{'type':Sequelize[_0x2227('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x2227('0x2')]},'remoteUri':{'type':Sequelize[_0x2227('0x2')],'unique':_0x2227('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x781d=['sequelize','exports','STRING','username','remoteUri'];(function(_0x54ea7a,_0x19df9b){var _0x65a10d=function(_0x1bf936){while(--_0x1bf936){_0x54ea7a['push'](_0x54ea7a['shift']());}};_0x65a10d(++_0x19df9b);}(_0x781d,0x14a));var _0xd781=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x781d[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require(_0xd781('0x0'));module[_0xd781('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd781('0x2')],'unique':_0xd781('0x3')},'apiKey':{'type':Sequelize[_0xd781('0x2')]},'remoteUri':{'type':Sequelize[_0xd781('0x2')],'unique':_0xd781('0x4')},'serverUrl':{'type':Sequelize[_0xd781('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 1a14519..ae24b72 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 _0x58d6=['description','priority','group','source','ticket_type','includes','default','custom_text','label','choices','capitalize','test','stringify','Wrong\x20credentials','statusCode','rimraf','zip-dir','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','FreshdeskAccount','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','getConfigurations','findOne','FreshdeskConfiguration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','requester','subject'];(function(_0x38f273,_0x48b691){var _0x71a6a9=function(_0x16a90f){while(--_0x16a90f){_0x38f273['push'](_0x38f273['shift']());}};_0x71a6a9(++_0x48b691);}(_0x58d6,0x1d3));var _0x658d=function(_0x439d59,_0x11ccdf){_0x439d59=_0x439d59-0x0;var _0x3670c7=_0x58d6[_0x439d59];return _0x3670c7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x658d('0x0'));var zipdir=require(_0x658d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x658d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x658d('0x3'));var util=require(_0x658d('0x4'));var path=require(_0x658d('0x5'));var sox=require(_0x658d('0x6'));var csv=require('to-csv');var ejs=require(_0x658d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x658d('0x8'));var squel=require(_0x658d('0x9'));var crypto=require(_0x658d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x658d('0xb'));var toCsv=require(_0x658d('0xc'));var querystring=require(_0x658d('0xd'));var Papa=require('papaparse');var Redis=require(_0x658d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x658d('0xf'));var as=require(_0x658d('0x10'));var hardwareService=require(_0x658d('0x11'));var logger=require('../../config/logger')(_0x658d('0x12'));var utils=require(_0x658d('0x13'));var config=require(_0x658d('0x14'));var licenseUtil=require(_0x658d('0x15'));var db=require(_0x658d('0x16'))['db'];var integrations=require(_0x658d('0x17'));function respondWithStatusCode(_0x9efc8c,_0x51295b){_0x51295b=_0x51295b||0xcc;return function(_0x2134dd){if(_0x2134dd){return _0x9efc8c[_0x658d('0x18')](_0x51295b);}return _0x9efc8c[_0x658d('0x19')](_0x51295b)[_0x658d('0x1a')]();};}function respondWithResult(_0x43de3d,_0x28a2d0){_0x28a2d0=_0x28a2d0||0xc8;return function(_0x4aebaa){if(_0x4aebaa){return _0x43de3d[_0x658d('0x19')](_0x28a2d0)[_0x658d('0x1b')](_0x4aebaa);}};}function respondWithFilteredResult(_0x17b20f,_0x284431){return function(_0x42aae9){if(_0x42aae9){var _0x2d8968=typeof _0x284431['offset']===_0x658d('0x1c')&&typeof _0x284431[_0x658d('0x1d')]===_0x658d('0x1c');var _0x61cfa6=_0x42aae9[_0x658d('0x1e')];var _0x25769e=_0x2d8968?0x0:_0x284431[_0x658d('0x1f')];var _0x3cdc74=_0x2d8968?_0x42aae9[_0x658d('0x1e')]:_0x284431['offset']+_0x284431['limit'];var _0x247ff7;if(_0x3cdc74>=_0x61cfa6){_0x3cdc74=_0x61cfa6;_0x247ff7=0xc8;}else{_0x247ff7=0xce;}_0x17b20f[_0x658d('0x19')](_0x247ff7);return _0x17b20f[_0x658d('0x20')](_0x658d('0x21'),_0x25769e+'-'+_0x3cdc74+'/'+_0x61cfa6)[_0x658d('0x1b')](_0x42aae9);}return null;};}function patchUpdates(_0x1c0271){return function(_0x13a9a6){try{jsonpatch[_0x658d('0x22')](_0x13a9a6,_0x1c0271,!![]);}catch(_0x3b4a1f){return BPromise['reject'](_0x3b4a1f);}return _0x13a9a6['save']();};}function saveUpdates(_0x408996,_0x3ac068){return function(_0x5bb5cc){if(_0x5bb5cc){return _0x5bb5cc[_0x658d('0x23')](_0x408996)[_0x658d('0x24')](function(_0x3e95f5){return _0x3e95f5;});}return null;};}function removeEntity(_0x56dd20,_0x4f9418){return function(_0x246acd){if(_0x246acd){return _0x246acd[_0x658d('0x25')]()['then'](function(){_0x56dd20[_0x658d('0x19')](0xcc)[_0x658d('0x1a')]();});}};}function handleEntityNotFound(_0x5445b8,_0x2088bd){return function(_0x17e5b8){if(!_0x17e5b8){_0x5445b8[_0x658d('0x18')](0x194);}return _0x17e5b8;};}function handleError(_0x4a6a9c,_0x3e2759){_0x3e2759=_0x3e2759||0x1f4;return function(_0x12107d){logger[_0x658d('0x26')](_0x12107d[_0x658d('0x27')]);if(_0x12107d[_0x658d('0x28')]){delete _0x12107d[_0x658d('0x28')];}_0x4a6a9c[_0x658d('0x19')](_0x3e2759)[_0x658d('0x29')](_0x12107d);};}exports[_0x658d('0x2a')]=function(_0x27cccb,_0x38cd62){var _0x323042={},_0x4c5176={},_0x2c5afb={'count':0x0,'rows':[]};var _0x29fb2e=_['map'](db[_0x658d('0x2b')][_0x658d('0x2c')],function(_0x17db1a){return{'name':_0x17db1a[_0x658d('0x2d')],'type':_0x17db1a[_0x658d('0x2e')][_0x658d('0x2f')]};});_0x4c5176[_0x658d('0x30')]=_[_0x658d('0x31')](_0x29fb2e,_0x658d('0x28'));_0x4c5176['query']=_[_0x658d('0x32')](_0x27cccb['query']);_0x4c5176[_0x658d('0x33')]=_[_0x658d('0x34')](_0x4c5176[_0x658d('0x30')],_0x4c5176[_0x658d('0x35')]);_0x323042[_0x658d('0x36')]=_[_0x658d('0x34')](_0x4c5176[_0x658d('0x30')],qs[_0x658d('0x37')](_0x27cccb[_0x658d('0x35')][_0x658d('0x37')]));_0x323042[_0x658d('0x36')]=_0x323042[_0x658d('0x36')][_0x658d('0x38')]?_0x323042[_0x658d('0x36')]:_0x4c5176[_0x658d('0x30')];if(!_0x27cccb[_0x658d('0x35')]['hasOwnProperty']('nolimit')){_0x323042[_0x658d('0x1d')]=qs['limit'](_0x27cccb[_0x658d('0x35')][_0x658d('0x1d')]);_0x323042[_0x658d('0x1f')]=qs[_0x658d('0x1f')](_0x27cccb[_0x658d('0x35')][_0x658d('0x1f')]);}_0x323042[_0x658d('0x39')]=qs[_0x658d('0x3a')](_0x27cccb[_0x658d('0x35')]['sort']);_0x323042['where']=qs[_0x658d('0x33')](_[_0x658d('0x3b')](_0x27cccb[_0x658d('0x35')],_0x4c5176[_0x658d('0x33')]),_0x29fb2e);if(_0x27cccb[_0x658d('0x35')][_0x658d('0x3c')]){_0x323042[_0x658d('0x3d')]=_[_0x658d('0x3e')](_0x323042[_0x658d('0x3d')],{'$or':_[_0x658d('0x31')](_0x29fb2e,function(_0x14f084){if(_0x14f084['type']!==_0x658d('0x3f')){var _0x2ac68c={};_0x2ac68c[_0x14f084[_0x658d('0x28')]]={'$like':'%'+_0x27cccb[_0x658d('0x35')][_0x658d('0x3c')]+'%'};return _0x2ac68c;}})});}_0x323042=_[_0x658d('0x3e')]({},_0x323042,_0x27cccb[_0x658d('0x40')]);var _0x40d9e2={'where':_0x323042[_0x658d('0x3d')]};return db['FreshdeskAccount'][_0x658d('0x1e')](_0x40d9e2)[_0x658d('0x24')](function(_0x1ce3f4){_0x2c5afb[_0x658d('0x1e')]=_0x1ce3f4;if(_0x27cccb[_0x658d('0x35')][_0x658d('0x41')]){_0x323042[_0x658d('0x42')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x658d('0x43')](_0x323042);})[_0x658d('0x24')](function(_0x285283){_0x2c5afb[_0x658d('0x44')]=_0x285283;return _0x2c5afb;})[_0x658d('0x24')](respondWithFilteredResult(_0x38cd62,_0x323042))['catch'](handleError(_0x38cd62,null));};exports[_0x658d('0x45')]=function(_0x5be04f,_0x47971b){var _0xce7485={'raw':![],'where':{'id':_0x5be04f[_0x658d('0x46')]['id']}},_0x3b894d={};_0x3b894d['model']=_[_0x658d('0x32')](db['FreshdeskAccount'][_0x658d('0x2c')]);_0x3b894d[_0x658d('0x35')]=_[_0x658d('0x32')](_0x5be04f['query']);_0x3b894d[_0x658d('0x33')]=_['intersection'](_0x3b894d[_0x658d('0x30')],_0x3b894d[_0x658d('0x35')]);_0xce7485[_0x658d('0x36')]=_[_0x658d('0x34')](_0x3b894d['model'],qs[_0x658d('0x37')](_0x5be04f['query'][_0x658d('0x37')]));_0xce7485[_0x658d('0x36')]=_0xce7485['attributes']['length']?_0xce7485[_0x658d('0x36')]:_0x3b894d[_0x658d('0x30')];if(_0x5be04f['query'][_0x658d('0x41')]){_0xce7485[_0x658d('0x42')]=[{'all':!![]}];}_0xce7485=_[_0x658d('0x3e')]({},_0xce7485,_0x5be04f[_0x658d('0x40')]);return db['FreshdeskAccount']['find'](_0xce7485)[_0x658d('0x24')](handleEntityNotFound(_0x47971b,null))[_0x658d('0x24')](respondWithResult(_0x47971b,null))[_0x658d('0x47')](handleError(_0x47971b,null));};exports[_0x658d('0x48')]=function(_0x39ae6a,_0xf0067){return db['FreshdeskAccount']['create'](_0x39ae6a[_0x658d('0x49')],{})[_0x658d('0x24')](respondWithResult(_0xf0067,0xc9))['catch'](handleError(_0xf0067,null));};exports[_0x658d('0x23')]=function(_0x3e4fc1,_0x341107){if(_0x3e4fc1[_0x658d('0x49')]['id']){delete _0x3e4fc1['body']['id'];}return db['FreshdeskAccount'][_0x658d('0x4a')]({'where':{'id':_0x3e4fc1[_0x658d('0x46')]['id']}})[_0x658d('0x24')](handleEntityNotFound(_0x341107,null))[_0x658d('0x24')](saveUpdates(_0x3e4fc1[_0x658d('0x49')],null))[_0x658d('0x24')](respondWithResult(_0x341107,null))[_0x658d('0x47')](handleError(_0x341107,null));};exports[_0x658d('0x25')]=function(_0x54d0b0,_0x1b30b8){return db['FreshdeskAccount'][_0x658d('0x4a')]({'where':{'id':_0x54d0b0[_0x658d('0x46')]['id']}})[_0x658d('0x24')](handleEntityNotFound(_0x1b30b8,null))[_0x658d('0x24')](removeEntity(_0x1b30b8,null))[_0x658d('0x47')](handleError(_0x1b30b8,null));};exports[_0x658d('0x4b')]=function(_0x55f81d,_0x8afddd,_0x1ddc49){var _0x3393cf={};var _0x253dd0={};var _0x47b889;var _0x5ec0d0;return db[_0x658d('0x2b')][_0x658d('0x4c')]({'where':{'id':_0x55f81d['params']['id']}})[_0x658d('0x24')](handleEntityNotFound(_0x8afddd,null))['then'](function(_0x49106b){if(_0x49106b){_0x47b889=_0x49106b;_0x253dd0[_0x658d('0x30')]=_[_0x658d('0x32')](db[_0x658d('0x4d')][_0x658d('0x2c')]);_0x253dd0[_0x658d('0x35')]=_[_0x658d('0x32')](_0x55f81d[_0x658d('0x35')]);_0x253dd0[_0x658d('0x33')]=_[_0x658d('0x34')](_0x253dd0[_0x658d('0x30')],_0x253dd0[_0x658d('0x35')]);_0x3393cf[_0x658d('0x36')]=_[_0x658d('0x34')](_0x253dd0[_0x658d('0x30')],qs[_0x658d('0x37')](_0x55f81d[_0x658d('0x35')][_0x658d('0x37')]));_0x3393cf[_0x658d('0x36')]=_0x3393cf[_0x658d('0x36')][_0x658d('0x38')]?_0x3393cf[_0x658d('0x36')]:_0x253dd0[_0x658d('0x30')];_0x3393cf[_0x658d('0x39')]=qs[_0x658d('0x3a')](_0x55f81d[_0x658d('0x35')]['sort']);_0x3393cf['where']=qs[_0x658d('0x33')](_[_0x658d('0x3b')](_0x55f81d['query'],_0x253dd0[_0x658d('0x33')]));if(_0x55f81d['query'][_0x658d('0x3c')]){_0x3393cf[_0x658d('0x3d')]=_['merge'](_0x3393cf['where'],{'$or':_[_0x658d('0x31')](_0x3393cf[_0x658d('0x36')],function(_0x10bf70){var _0x59f528={};_0x59f528[_0x10bf70]={'$like':'%'+_0x55f81d[_0x658d('0x35')][_0x658d('0x3c')]+'%'};return _0x59f528;})});}_0x3393cf=_[_0x658d('0x3e')]({},_0x3393cf,_0x55f81d['options']);return _0x47b889[_0x658d('0x4b')](_0x3393cf);}})[_0x658d('0x24')](function(_0x579ee2){if(_0x579ee2){_0x5ec0d0=_0x579ee2[_0x658d('0x38')];if(!_0x55f81d[_0x658d('0x35')]['hasOwnProperty'](_0x658d('0x4e'))){_0x3393cf['limit']=qs[_0x658d('0x1d')](_0x55f81d[_0x658d('0x35')][_0x658d('0x1d')]);_0x3393cf[_0x658d('0x1f')]=qs[_0x658d('0x1f')](_0x55f81d['query'][_0x658d('0x1f')]);}return _0x47b889[_0x658d('0x4b')](_0x3393cf);}})[_0x658d('0x24')](function(_0x4715e0){if(_0x4715e0){return _0x4715e0?{'count':_0x5ec0d0,'rows':_0x4715e0}:null;}})[_0x658d('0x24')](respondWithResult(_0x8afddd,null))[_0x658d('0x47')](handleError(_0x8afddd,null));};exports[_0x658d('0x4f')]=function(_0x530c10,_0x4d0656,_0x56d08a){if(_0x530c10[_0x658d('0x49')]['id']){delete _0x530c10[_0x658d('0x49')]['id'];}return db[_0x658d('0x2b')][_0x658d('0x4c')]({'where':{'id':_0x530c10[_0x658d('0x46')]['id']}})[_0x658d('0x24')](handleEntityNotFound(_0x4d0656,null))[_0x658d('0x24')](function(_0x1b15af){if(_0x1b15af){_0x530c10[_0x658d('0x49')][_0x658d('0x50')]=_0x1b15af['id'];_0x530c10[_0x658d('0x49')][_0x658d('0x51')]=integrations[_0x658d('0x52')](_0x530c10[_0x658d('0x49')][_0x658d('0x53')],_0x530c10['body'][_0x658d('0x2e')]);_0x530c10[_0x658d('0x49')][_0x658d('0x54')]=integrations['getDescriptions'](_0x530c10[_0x658d('0x49')][_0x658d('0x53')],_0x530c10[_0x658d('0x49')][_0x658d('0x2e')]);return db[_0x658d('0x4d')][_0x658d('0x48')](_0x530c10[_0x658d('0x49')],{'include':[{'model':db[_0x658d('0x55')],'as':'Subjects'},{'model':db['FreshdeskField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x4d0656,null))[_0x658d('0x47')](handleError(_0x4d0656,null));};exports[_0x658d('0x56')]=function(_0x2b5295,_0x440711,_0x30905b){var _0x3b1d41='';return db[_0x658d('0x2b')][_0x658d('0x4c')]({'where':{'id':_0x2b5295[_0x658d('0x46')]['id']},'attributes':['id',_0x658d('0x57'),_0x658d('0x58')]})['then'](handleEntityNotFound(_0x440711,null))[_0x658d('0x24')](function(_0x1c661d){if(_0x1c661d){_0x3b1d41=_0x1c661d[_0x658d('0x57')];var _0x85c666=_0x3b1d41[_0x658d('0x59')](-0x1);if(_0x85c666==='/'){_0x3b1d41=_0x3b1d41[_0x658d('0x5a')](0x0,_0x3b1d41['lastIndexOf'](_0x85c666));}return rp({'method':'GET','uri':util[_0x658d('0x5b')](_0x658d('0x5c'),_0x3b1d41,_0x658d('0x5d')),'headers':{'Authorization':util[_0x658d('0x5b')](_0x658d('0x5e'),new Buffer(util['format'](_0x658d('0x5f'),_0x1c661d[_0x658d('0x58')]))['toString']('base64'))},'json':!![]});}})[_0x658d('0x24')](function(_0x828d77){if(_0x828d77){var _0x149eec=[_0x658d('0x60'),_0x658d('0x61'),'agent',_0x658d('0x62'),_0x658d('0x19'),_0x658d('0x63'),_0x658d('0x64'),_0x658d('0x65'),_0x658d('0x66'),_0x658d('0x64'),'company'];_['remove'](_0x828d77,function(_0x3cc340){return _0x149eec[_0x658d('0x67')](_0x3cc340[_0x658d('0x28')])||!_0x3cc340[_0x658d('0x68')]&&_0x3cc340[_0x658d('0x2e')]!==_0x658d('0x69')&&_0x3cc340[_0x658d('0x2e')]!=='custom_dropdown';});return{'count':_0x828d77[_0x658d('0x38')],'rows':_['map'](_0x828d77,function(_0x6267b9){return{'id':_0x6267b9[_0x658d('0x28')],'name':_0x6267b9[_0x658d('0x6a')],'custom':!_0x6267b9[_0x658d('0x68')],'options':_0x6267b9[_0x658d('0x6b')]?_[_0x658d('0x31')](_0x6267b9[_0x658d('0x6b')],function(_0x935e9a){return{'name':_[_0x658d('0x6c')](_0x935e9a),'value':_0x935e9a};}):[]};})};}})['then'](respondWithResult(_0x440711,null))[_0x658d('0x47')](function(_0x56e484){var _0x4b152f=_0x2b5295[_0x658d('0x35')][_0x658d('0x6d')]?0x1f4:_0x56e484['statusCode']||0x1f4;logger[_0x658d('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0x658d('0x56'),_0x4b152f,JSON[_0x658d('0x6e')](_0x56e484));delete _0x56e484[_0x658d('0x28')];if(_0x4b152f===0x191){_0x4b152f=0x190;}_0x440711[_0x658d('0x19')](_0x4b152f)[_0x658d('0x29')](_0x2b5295[_0x658d('0x35')][_0x658d('0x6d')]?{'message':_0x658d('0x6f'),'statusCode':_0x56e484[_0x658d('0x70')]}:_0x56e484);});}; \ No newline at end of file +var _0xd64b=['end','json','offset','limit','undefined','count','Content-Range','apply','update','then','stack','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','name','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','rows','catch','show','params','keys','includeAll','include','merge','options','find','create','body','destroy','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','format','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','description','priority','group','source','includes','default','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status'];(function(_0x1a3a02,_0x90bb8b){var _0x11add6=function(_0x205350){while(--_0x205350){_0x1a3a02['push'](_0x1a3a02['shift']());}};_0x11add6(++_0x90bb8b);}(_0xd64b,0xc1));var _0xbd64=function(_0x283cf6,_0x14e096){_0x283cf6=_0x283cf6-0x0;var _0x4b40e5=_0xd64b[_0x283cf6];return _0x4b40e5;};'use strict';var emlformat=require(_0xbd64('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd64('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd64('0x2'));var moment=require(_0xbd64('0x3'));var BPromise=require(_0xbd64('0x4'));var Mustache=require(_0xbd64('0x5'));var util=require(_0xbd64('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd64('0x7'));var _=require(_0xbd64('0x8'));var squel=require(_0xbd64('0x9'));var crypto=require(_0xbd64('0xa'));var jsforce=require(_0xbd64('0xb'));var deskjs=require(_0xbd64('0xc'));var toCsv=require(_0xbd64('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbd64('0xe'));var authService=require(_0xbd64('0xf'));var qs=require(_0xbd64('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd64('0x11'));var logger=require(_0xbd64('0x12'))(_0xbd64('0x13'));var utils=require(_0xbd64('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xbd64('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbd64('0x16'));function respondWithStatusCode(_0x2729d8,_0x3a941c){_0x3a941c=_0x3a941c||0xcc;return function(_0x2183e2){if(_0x2183e2){return _0x2729d8[_0xbd64('0x17')](_0x3a941c);}return _0x2729d8[_0xbd64('0x18')](_0x3a941c)[_0xbd64('0x19')]();};}function respondWithResult(_0x269e2f,_0x2b5808){_0x2b5808=_0x2b5808||0xc8;return function(_0x4ae471){if(_0x4ae471){return _0x269e2f[_0xbd64('0x18')](_0x2b5808)[_0xbd64('0x1a')](_0x4ae471);}};}function respondWithFilteredResult(_0x3ff550,_0x32fd34){return function(_0x29fc16){if(_0x29fc16){var _0x49a914=typeof _0x32fd34[_0xbd64('0x1b')]==='undefined'&&typeof _0x32fd34[_0xbd64('0x1c')]===_0xbd64('0x1d');var _0x3aef70=_0x29fc16[_0xbd64('0x1e')];var _0x17d015=_0x49a914?0x0:_0x32fd34[_0xbd64('0x1b')];var _0xa5491d=_0x49a914?_0x29fc16[_0xbd64('0x1e')]:_0x32fd34['offset']+_0x32fd34[_0xbd64('0x1c')];var _0x1f618b;if(_0xa5491d>=_0x3aef70){_0xa5491d=_0x3aef70;_0x1f618b=0xc8;}else{_0x1f618b=0xce;}_0x3ff550['status'](_0x1f618b);return _0x3ff550['set'](_0xbd64('0x1f'),_0x17d015+'-'+_0xa5491d+'/'+_0x3aef70)[_0xbd64('0x1a')](_0x29fc16);}return null;};}function patchUpdates(_0x196d21){return function(_0x39e2eb){try{jsonpatch[_0xbd64('0x20')](_0x39e2eb,_0x196d21,!![]);}catch(_0x816e00){return BPromise['reject'](_0x816e00);}return _0x39e2eb['save']();};}function saveUpdates(_0x6038f,_0x41f2f){return function(_0x12f67b){if(_0x12f67b){return _0x12f67b[_0xbd64('0x21')](_0x6038f)['then'](function(_0x51d118){return _0x51d118;});}return null;};}function removeEntity(_0x28497c,_0x4afaff){return function(_0x46ab38){if(_0x46ab38){return _0x46ab38['destroy']()[_0xbd64('0x22')](function(){_0x28497c[_0xbd64('0x18')](0xcc)[_0xbd64('0x19')]();});}};}function handleEntityNotFound(_0x2d0993,_0x5ae417){return function(_0x9d0fb8){if(!_0x9d0fb8){_0x2d0993[_0xbd64('0x17')](0x194);}return _0x9d0fb8;};}function handleError(_0x13f527,_0x2a44d0){_0x2a44d0=_0x2a44d0||0x1f4;return function(_0x4d1563){logger['error'](_0x4d1563[_0xbd64('0x23')]);if(_0x4d1563['name']){delete _0x4d1563['name'];}_0x13f527[_0xbd64('0x18')](_0x2a44d0)['send'](_0x4d1563);};}exports[_0xbd64('0x24')]=function(_0x5300e8,_0x28199c){var _0x5d8c35={},_0x1db9f3={},_0x3c0eaf={'count':0x0,'rows':[]};var _0x3be63a=_[_0xbd64('0x25')](db[_0xbd64('0x26')][_0xbd64('0x27')],function(_0x4ed44a){return{'name':_0x4ed44a[_0xbd64('0x28')],'type':_0x4ed44a[_0xbd64('0x29')][_0xbd64('0x2a')]};});_0x1db9f3[_0xbd64('0x2b')]=_[_0xbd64('0x25')](_0x3be63a,_0xbd64('0x2c'));_0x1db9f3['query']=_['keys'](_0x5300e8[_0xbd64('0x2d')]);_0x1db9f3['filters']=_[_0xbd64('0x2e')](_0x1db9f3[_0xbd64('0x2b')],_0x1db9f3['query']);_0x5d8c35['attributes']=_[_0xbd64('0x2e')](_0x1db9f3['model'],qs['fields'](_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x2f')]));_0x5d8c35[_0xbd64('0x30')]=_0x5d8c35['attributes'][_0xbd64('0x31')]?_0x5d8c35['attributes']:_0x1db9f3[_0xbd64('0x2b')];if(!_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x32')](_0xbd64('0x33'))){_0x5d8c35[_0xbd64('0x1c')]=qs[_0xbd64('0x1c')](_0x5300e8['query']['limit']);_0x5d8c35[_0xbd64('0x1b')]=qs[_0xbd64('0x1b')](_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x1b')]);}_0x5d8c35[_0xbd64('0x34')]=qs[_0xbd64('0x35')](_0x5300e8['query']['sort']);_0x5d8c35[_0xbd64('0x36')]=qs[_0xbd64('0x37')](_[_0xbd64('0x38')](_0x5300e8['query'],_0x1db9f3['filters']),_0x3be63a);if(_0x5300e8[_0xbd64('0x2d')]['filter']){_0x5d8c35[_0xbd64('0x36')]=_['merge'](_0x5d8c35[_0xbd64('0x36')],{'$or':_[_0xbd64('0x25')](_0x3be63a,function(_0x550221){if(_0x550221[_0xbd64('0x29')]!=='VIRTUAL'){var _0x534091={};_0x534091[_0x550221[_0xbd64('0x2c')]]={'$like':'%'+_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x39')]+'%'};return _0x534091;}})});}_0x5d8c35=_['merge']({},_0x5d8c35,_0x5300e8['options']);var _0x5d6bcf={'where':_0x5d8c35[_0xbd64('0x36')]};return db[_0xbd64('0x26')]['count'](_0x5d6bcf)[_0xbd64('0x22')](function(_0x34b19a){_0x3c0eaf[_0xbd64('0x1e')]=_0x34b19a;if(_0x5300e8[_0xbd64('0x2d')]['includeAll']){_0x5d8c35['include']=[{'all':!![]}];}return db[_0xbd64('0x26')]['findAll'](_0x5d8c35);})['then'](function(_0x231fa6){_0x3c0eaf[_0xbd64('0x3a')]=_0x231fa6;return _0x3c0eaf;})[_0xbd64('0x22')](respondWithFilteredResult(_0x28199c,_0x5d8c35))[_0xbd64('0x3b')](handleError(_0x28199c,null));};exports[_0xbd64('0x3c')]=function(_0x3155b3,_0x247775){var _0x762380={'raw':![],'where':{'id':_0x3155b3[_0xbd64('0x3d')]['id']}},_0x4870fd={};_0x4870fd[_0xbd64('0x2b')]=_['keys'](db[_0xbd64('0x26')][_0xbd64('0x27')]);_0x4870fd[_0xbd64('0x2d')]=_[_0xbd64('0x3e')](_0x3155b3[_0xbd64('0x2d')]);_0x4870fd[_0xbd64('0x37')]=_[_0xbd64('0x2e')](_0x4870fd['model'],_0x4870fd[_0xbd64('0x2d')]);_0x762380['attributes']=_[_0xbd64('0x2e')](_0x4870fd['model'],qs[_0xbd64('0x2f')](_0x3155b3[_0xbd64('0x2d')][_0xbd64('0x2f')]));_0x762380['attributes']=_0x762380[_0xbd64('0x30')]['length']?_0x762380['attributes']:_0x4870fd['model'];if(_0x3155b3[_0xbd64('0x2d')][_0xbd64('0x3f')]){_0x762380[_0xbd64('0x40')]=[{'all':!![]}];}_0x762380=_[_0xbd64('0x41')]({},_0x762380,_0x3155b3[_0xbd64('0x42')]);return db[_0xbd64('0x26')][_0xbd64('0x43')](_0x762380)['then'](handleEntityNotFound(_0x247775,null))[_0xbd64('0x22')](respondWithResult(_0x247775,null))[_0xbd64('0x3b')](handleError(_0x247775,null));};exports[_0xbd64('0x44')]=function(_0x4e5efe,_0x105bee){return db[_0xbd64('0x26')][_0xbd64('0x44')](_0x4e5efe[_0xbd64('0x45')],{})[_0xbd64('0x22')](respondWithResult(_0x105bee,0xc9))['catch'](handleError(_0x105bee,null));};exports[_0xbd64('0x21')]=function(_0x1a9ec8,_0x2a8011){if(_0x1a9ec8[_0xbd64('0x45')]['id']){delete _0x1a9ec8['body']['id'];}return db['FreshdeskAccount'][_0xbd64('0x43')]({'where':{'id':_0x1a9ec8[_0xbd64('0x3d')]['id']}})[_0xbd64('0x22')](handleEntityNotFound(_0x2a8011,null))[_0xbd64('0x22')](saveUpdates(_0x1a9ec8[_0xbd64('0x45')],null))[_0xbd64('0x22')](respondWithResult(_0x2a8011,null))[_0xbd64('0x3b')](handleError(_0x2a8011,null));};exports[_0xbd64('0x46')]=function(_0x460158,_0x2709b2){return db[_0xbd64('0x26')][_0xbd64('0x43')]({'where':{'id':_0x460158[_0xbd64('0x3d')]['id']}})[_0xbd64('0x22')](handleEntityNotFound(_0x2709b2,null))[_0xbd64('0x22')](removeEntity(_0x2709b2,null))['catch'](handleError(_0x2709b2,null));};exports[_0xbd64('0x47')]=function(_0x4952db,_0x5ede67,_0x552c95){var _0x4aa662={};var _0xced0ca={};var _0x2f56df;var _0x5480f5;return db[_0xbd64('0x26')][_0xbd64('0x48')]({'where':{'id':_0x4952db[_0xbd64('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5ede67,null))[_0xbd64('0x22')](function(_0x371bad){if(_0x371bad){_0x2f56df=_0x371bad;_0xced0ca[_0xbd64('0x2b')]=_[_0xbd64('0x3e')](db[_0xbd64('0x49')][_0xbd64('0x27')]);_0xced0ca['query']=_['keys'](_0x4952db['query']);_0xced0ca[_0xbd64('0x37')]=_[_0xbd64('0x2e')](_0xced0ca[_0xbd64('0x2b')],_0xced0ca[_0xbd64('0x2d')]);_0x4aa662['attributes']=_[_0xbd64('0x2e')](_0xced0ca[_0xbd64('0x2b')],qs[_0xbd64('0x2f')](_0x4952db[_0xbd64('0x2d')][_0xbd64('0x2f')]));_0x4aa662[_0xbd64('0x30')]=_0x4aa662['attributes'][_0xbd64('0x31')]?_0x4aa662[_0xbd64('0x30')]:_0xced0ca[_0xbd64('0x2b')];_0x4aa662[_0xbd64('0x34')]=qs[_0xbd64('0x35')](_0x4952db[_0xbd64('0x2d')][_0xbd64('0x35')]);_0x4aa662[_0xbd64('0x36')]=qs[_0xbd64('0x37')](_[_0xbd64('0x38')](_0x4952db[_0xbd64('0x2d')],_0xced0ca[_0xbd64('0x37')]));if(_0x4952db['query']['filter']){_0x4aa662[_0xbd64('0x36')]=_[_0xbd64('0x41')](_0x4aa662['where'],{'$or':_['map'](_0x4aa662[_0xbd64('0x30')],function(_0x12bc56){var _0x49051a={};_0x49051a[_0x12bc56]={'$like':'%'+_0x4952db[_0xbd64('0x2d')][_0xbd64('0x39')]+'%'};return _0x49051a;})});}_0x4aa662=_[_0xbd64('0x41')]({},_0x4aa662,_0x4952db[_0xbd64('0x42')]);return _0x2f56df[_0xbd64('0x47')](_0x4aa662);}})[_0xbd64('0x22')](function(_0x2d788){if(_0x2d788){_0x5480f5=_0x2d788[_0xbd64('0x31')];if(!_0x4952db[_0xbd64('0x2d')]['hasOwnProperty'](_0xbd64('0x33'))){_0x4aa662[_0xbd64('0x1c')]=qs[_0xbd64('0x1c')](_0x4952db['query'][_0xbd64('0x1c')]);_0x4aa662[_0xbd64('0x1b')]=qs['offset'](_0x4952db[_0xbd64('0x2d')][_0xbd64('0x1b')]);}return _0x2f56df[_0xbd64('0x47')](_0x4aa662);}})[_0xbd64('0x22')](function(_0x3615bc){if(_0x3615bc){return _0x3615bc?{'count':_0x5480f5,'rows':_0x3615bc}:null;}})[_0xbd64('0x22')](respondWithResult(_0x5ede67,null))['catch'](handleError(_0x5ede67,null));};exports[_0xbd64('0x4a')]=function(_0x1f3bd0,_0xc57eb1,_0x28d899){if(_0x1f3bd0['body']['id']){delete _0x1f3bd0[_0xbd64('0x45')]['id'];}return db[_0xbd64('0x26')]['findOne']({'where':{'id':_0x1f3bd0[_0xbd64('0x3d')]['id']}})['then'](handleEntityNotFound(_0xc57eb1,null))[_0xbd64('0x22')](function(_0x10e269){if(_0x10e269){_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x4b')]=_0x10e269['id'];_0x1f3bd0['body'][_0xbd64('0x4c')]=integrations[_0xbd64('0x4d')](_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x4e')],_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x29')]);_0x1f3bd0['body']['Descriptions']=integrations['getDescriptions'](_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x4e')],_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x29')]);return db[_0xbd64('0x49')][_0xbd64('0x44')](_0x1f3bd0['body'],{'include':[{'model':db[_0xbd64('0x4f')],'as':_0xbd64('0x4c')},{'model':db[_0xbd64('0x4f')],'as':_0xbd64('0x50')}]});}return null;})[_0xbd64('0x22')](respondWithResult(_0xc57eb1,null))[_0xbd64('0x3b')](handleError(_0xc57eb1,null));};exports[_0xbd64('0x51')]=function(_0x3d7e47,_0x301f42,_0x18e724){var _0x32e611='';return db[_0xbd64('0x26')]['findOne']({'where':{'id':_0x3d7e47['params']['id']},'attributes':['id',_0xbd64('0x52'),_0xbd64('0x53')]})[_0xbd64('0x22')](handleEntityNotFound(_0x301f42,null))['then'](function(_0x9b99b3){if(_0x9b99b3){_0x32e611=_0x9b99b3['remoteUri'];var _0x18bad6=_0x32e611[_0xbd64('0x54')](-0x1);if(_0x18bad6==='/'){_0x32e611=_0x32e611[_0xbd64('0x55')](0x0,_0x32e611[_0xbd64('0x56')](_0x18bad6));}return rp({'method':'GET','uri':util[_0xbd64('0x57')]('%s/%s',_0x32e611,_0xbd64('0x58')),'headers':{'Authorization':util[_0xbd64('0x57')](_0xbd64('0x59'),new Buffer(util[_0xbd64('0x57')](_0xbd64('0x5a'),_0x9b99b3['apiKey']))[_0xbd64('0x5b')](_0xbd64('0x5c')))},'json':!![]});}})['then'](function(_0x2b95a0){if(_0x2b95a0){var _0x16c9f7=[_0xbd64('0x5d'),_0xbd64('0x5e'),'agent',_0xbd64('0x5f'),'status',_0xbd64('0x60'),_0xbd64('0x61'),_0xbd64('0x62'),'ticket_type','group','company'];_['remove'](_0x2b95a0,function(_0x3cdf64){return _0x16c9f7[_0xbd64('0x63')](_0x3cdf64[_0xbd64('0x2c')])||!_0x3cdf64[_0xbd64('0x64')]&&_0x3cdf64[_0xbd64('0x29')]!=='custom_text'&&_0x3cdf64[_0xbd64('0x29')]!==_0xbd64('0x65');});return{'count':_0x2b95a0[_0xbd64('0x31')],'rows':_[_0xbd64('0x25')](_0x2b95a0,function(_0x23b455){return{'id':_0x23b455['name'],'name':_0x23b455[_0xbd64('0x66')],'custom':!_0x23b455[_0xbd64('0x64')],'options':_0x23b455[_0xbd64('0x67')]?_[_0xbd64('0x25')](_0x23b455['choices'],function(_0x58957a){return{'name':_[_0xbd64('0x68')](_0x58957a),'value':_0x58957a};}):[]};})};}})[_0xbd64('0x22')](respondWithResult(_0x301f42,null))[_0xbd64('0x3b')](function(_0x2c8932){var _0x18b0f0=_0x3d7e47[_0xbd64('0x2d')][_0xbd64('0x69')]?0x1f4:_0x2c8932[_0xbd64('0x6a')]||0x1f4;logger['error'](_0xbd64('0x6b'),'getFields',_0x18b0f0,JSON[_0xbd64('0x6c')](_0x2c8932));delete _0x2c8932[_0xbd64('0x2c')];if(_0x18b0f0===0x191){_0x18b0f0=0x190;}_0x301f42[_0xbd64('0x18')](_0x18b0f0)['send'](_0x3d7e47[_0xbd64('0x2d')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x2c8932[_0xbd64('0x6a')]}:_0x2c8932);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 6e0a39f..fd73843 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 _0xc2b7=['../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x288ca8,_0x21f49b){var _0x1129b6=function(_0x2da22b){while(--_0x2da22b){_0x288ca8['push'](_0x288ca8['shift']());}};_0x1129b6(++_0x21f49b);}(_0xc2b7,0xdf));var _0x7c2b=function(_0x5806c3,_0x5105d8){_0x5806c3=_0x5806c3-0x0;var _0x48ac77=_0xc2b7[_0x5806c3];return _0x48ac77;};'use strict';var _=require(_0x7c2b('0x0'));var util=require(_0x7c2b('0x1'));var logger=require(_0x7c2b('0x2'))(_0x7c2b('0x3'));var moment=require(_0x7c2b('0x4'));var BPromise=require('bluebird');var rp=require(_0x7c2b('0x5'));var fs=require('fs');var path=require(_0x7c2b('0x6'));var rimraf=require('rimraf');var config=require(_0x7c2b('0x7'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x7c2b('0x8')]=function(_0x355166,_0x1e2244){return _0x355166[_0x7c2b('0x9')]('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x801d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger'];(function(_0x58a1f2,_0x4ef14c){var _0x557457=function(_0x4fc8ff){while(--_0x4fc8ff){_0x58a1f2['push'](_0x58a1f2['shift']());}};_0x557457(++_0x4ef14c);}(_0x801d,0xa6));var _0xd801=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x801d[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0xd801('0x0'));var util=require(_0xd801('0x1'));var logger=require(_0xd801('0x2'))(_0xd801('0x3'));var moment=require(_0xd801('0x4'));var BPromise=require(_0xd801('0x5'));var rp=require(_0xd801('0x6'));var fs=require('fs');var path=require(_0xd801('0x7'));var rimraf=require(_0xd801('0x8'));var config=require(_0xd801('0x9'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0xd801('0xa'));module[_0xd801('0xb')]=function(_0xb254ec,_0x43e8bc){return _0xb254ec[_0xd801('0xc')]('FreshdeskAccount',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 dd17c0c..1ea7cd1 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 _0xea31=['debug','find','ShowFreshdeskAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xea31,0x123));var _0x1ea3=function(_0x3e2ab7,_0x1d5b1b){_0x3e2ab7=_0x3e2ab7-0x0;var _0x47c3de=_0xea31[_0x3e2ab7];return _0x47c3de;};'use strict';var _=require(_0x1ea3('0x0'));var util=require(_0x1ea3('0x1'));var moment=require('moment');var BPromise=require(_0x1ea3('0x2'));var rs=require(_0x1ea3('0x3'));var fs=require('fs');var Redis=require(_0x1ea3('0x4'));var db=require(_0x1ea3('0x5'))['db'];var utils=require(_0x1ea3('0x6'));var logger=require(_0x1ea3('0x7'))(_0x1ea3('0x8'));var config=require('../../config/environment');var jayson=require(_0x1ea3('0x9'));var client=jayson[_0x1ea3('0xa')][_0x1ea3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x583e20,_0x54f18f,_0x4100d6){return new BPromise(function(_0x2ee845,_0x20027b){return client['request'](_0x583e20,_0x4100d6)[_0x1ea3('0xc')](function(_0x3c361d){logger[_0x1ea3('0xd')](_0x1ea3('0xe'),_0x54f18f,_0x1ea3('0xf'));logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x54f18f,_0x1ea3('0xf'),JSON[_0x1ea3('0x10')](_0x3c361d));if(_0x3c361d[_0x1ea3('0x11')]){if(_0x3c361d[_0x1ea3('0x11')][_0x1ea3('0x12')]===0x1f4){logger[_0x1ea3('0x11')](_0x1ea3('0xe'),_0x54f18f,_0x3c361d['error'][_0x1ea3('0x13')]);return _0x20027b(_0x3c361d[_0x1ea3('0x11')]['message']);}logger[_0x1ea3('0x11')](_0x1ea3('0xe'),_0x54f18f,_0x3c361d[_0x1ea3('0x11')][_0x1ea3('0x13')]);return _0x2ee845(_0x3c361d[_0x1ea3('0x11')][_0x1ea3('0x13')]);}else{logger[_0x1ea3('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x54f18f,_0x1ea3('0xf'));_0x2ee845(_0x3c361d[_0x1ea3('0x14')]['message']);}})[_0x1ea3('0x15')](function(_0x4b4368){logger['error'](_0x1ea3('0xe'),_0x54f18f,_0x4b4368);_0x20027b(_0x4b4368);});});}exports[_0x1ea3('0x16')]=function(_0x44dbb4){var _0x42d2c4=this;return new Promise(function(_0x231364,_0x231631){return db[_0x1ea3('0x17')][_0x1ea3('0x18')]({'raw':_0x44dbb4[_0x1ea3('0x19')]?_0x44dbb4[_0x1ea3('0x19')][_0x1ea3('0x1a')]===undefined?!![]:![]:!![],'where':_0x44dbb4[_0x1ea3('0x19')]?_0x44dbb4[_0x1ea3('0x19')][_0x1ea3('0x1b')]||null:null,'attributes':_0x44dbb4[_0x1ea3('0x19')]?_0x44dbb4['options'][_0x1ea3('0x1c')]||null:null,'limit':_0x44dbb4[_0x1ea3('0x19')]?_0x44dbb4[_0x1ea3('0x19')][_0x1ea3('0x1d')]||null:null,'include':_0x44dbb4[_0x1ea3('0x19')]?_0x44dbb4[_0x1ea3('0x19')][_0x1ea3('0x1e')]?_[_0x1ea3('0x1f')](_0x44dbb4[_0x1ea3('0x19')][_0x1ea3('0x1e')],function(_0x2c9070){return{'model':db[_0x2c9070['model']],'as':_0x2c9070['as'],'attributes':_0x2c9070['attributes'],'include':_0x2c9070['include']?_[_0x1ea3('0x1f')](_0x2c9070[_0x1ea3('0x1e')],function(_0x2acd87){return{'model':db[_0x2acd87[_0x1ea3('0x20')]],'as':_0x2acd87['as'],'attributes':_0x2acd87[_0x1ea3('0x1c')],'include':_0x2acd87[_0x1ea3('0x1e')]?_[_0x1ea3('0x1f')](_0x2acd87[_0x1ea3('0x1e')],function(_0x283dfa){return{'model':db[_0x283dfa[_0x1ea3('0x20')]],'as':_0x283dfa['as'],'attributes':_0x283dfa[_0x1ea3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1ea3('0xc')](function(_0x22d272){logger[_0x1ea3('0xd')]('GetFreshdeskAccount',_0x44dbb4);logger[_0x1ea3('0x21')]('GetFreshdeskAccount',_0x44dbb4,JSON[_0x1ea3('0x10')](_0x22d272));_0x231364(_0x22d272);})[_0x1ea3('0x15')](function(_0x156d50){logger[_0x1ea3('0x11')](_0x1ea3('0x16'),_0x156d50[_0x1ea3('0x13')],_0x44dbb4);_0x231631(_0x42d2c4[_0x1ea3('0x11')](0x1f4,_0x156d50[_0x1ea3('0x13')]));});});};exports['ShowFreshdeskAccount']=function(_0x5c9ffd){var _0x205a6e=this;return new Promise(function(_0x52f92d,_0x17b923){return db[_0x1ea3('0x17')][_0x1ea3('0x22')]({'raw':_0x5c9ffd[_0x1ea3('0x19')]?_0x5c9ffd['options']['raw']===undefined?!![]:![]:!![],'where':_0x5c9ffd['options']?_0x5c9ffd[_0x1ea3('0x19')][_0x1ea3('0x1b')]||null:null,'attributes':_0x5c9ffd['options']?_0x5c9ffd[_0x1ea3('0x19')][_0x1ea3('0x1c')]||null:null,'include':_0x5c9ffd[_0x1ea3('0x19')]?_0x5c9ffd['options']['include']?_[_0x1ea3('0x1f')](_0x5c9ffd[_0x1ea3('0x19')][_0x1ea3('0x1e')],function(_0x188e9e){return{'model':db[_0x188e9e[_0x1ea3('0x20')]],'as':_0x188e9e['as'],'attributes':_0x188e9e['attributes'],'include':_0x188e9e[_0x1ea3('0x1e')]?_[_0x1ea3('0x1f')](_0x188e9e[_0x1ea3('0x1e')],function(_0x1fc6c){return{'model':db[_0x1fc6c['model']],'as':_0x1fc6c['as'],'attributes':_0x1fc6c[_0x1ea3('0x1c')],'include':_0x1fc6c['include']?_['map'](_0x1fc6c[_0x1ea3('0x1e')],function(_0x38e6fa){return{'model':db[_0x38e6fa[_0x1ea3('0x20')]],'as':_0x38e6fa['as'],'attributes':_0x38e6fa['attributes']};}):[]};}):[]};}):[]:[]})[_0x1ea3('0xc')](function(_0x38b869){logger['info']('ShowFreshdeskAccount',_0x5c9ffd);logger[_0x1ea3('0x21')](_0x1ea3('0x23'),_0x5c9ffd,JSON[_0x1ea3('0x10')](_0x38b869));_0x52f92d(_0x38b869);})[_0x1ea3('0x15')](function(_0x372253){logger[_0x1ea3('0x11')](_0x1ea3('0x23'),_0x372253[_0x1ea3('0x13')],_0x5c9ffd);_0x17b923(_0x205a6e[_0x1ea3('0x11')](0x1f4,_0x372253['message']));});});}; \ No newline at end of file +var _0x5966=['code','message','catch','GetFreshdeskAccount','FreshdeskAccount','options','raw','where','attributes','include','map','model','then','ShowFreshdeskAccount','find','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x616fb8,_0x177e11){var _0x739e20=function(_0xfe27e9){while(--_0xfe27e9){_0x616fb8['push'](_0x616fb8['shift']());}};_0x739e20(++_0x177e11);}(_0x5966,0x97));var _0x6596=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x5966[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x6596('0x0'));var util=require(_0x6596('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6596('0x2'));var db=require(_0x6596('0x3'))['db'];var utils=require(_0x6596('0x4'));var logger=require(_0x6596('0x5'))(_0x6596('0x6'));var config=require(_0x6596('0x7'));var jayson=require(_0x6596('0x8'));var client=jayson[_0x6596('0x9')][_0x6596('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56d2f8,_0x51ef04,_0x5c5a94){return new BPromise(function(_0x1227fb,_0x2125ca){return client[_0x6596('0xb')](_0x56d2f8,_0x5c5a94)['then'](function(_0x37c46b){logger[_0x6596('0xc')](_0x6596('0xd'),_0x51ef04,_0x6596('0xe'));logger[_0x6596('0xf')](_0x6596('0x10'),_0x51ef04,_0x6596('0xe'),JSON[_0x6596('0x11')](_0x37c46b));if(_0x37c46b[_0x6596('0x12')]){if(_0x37c46b[_0x6596('0x12')][_0x6596('0x13')]===0x1f4){logger['error'](_0x6596('0xd'),_0x51ef04,_0x37c46b[_0x6596('0x12')][_0x6596('0x14')]);return _0x2125ca(_0x37c46b[_0x6596('0x12')]['message']);}logger[_0x6596('0x12')](_0x6596('0xd'),_0x51ef04,_0x37c46b['error'][_0x6596('0x14')]);return _0x1227fb(_0x37c46b[_0x6596('0x12')][_0x6596('0x14')]);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x51ef04,_0x6596('0xe'));_0x1227fb(_0x37c46b['result'][_0x6596('0x14')]);}})[_0x6596('0x15')](function(_0x14bf86){logger[_0x6596('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x51ef04,_0x14bf86);_0x2125ca(_0x14bf86);});});}exports[_0x6596('0x16')]=function(_0x198ada){var _0x294853=this;return new Promise(function(_0x1b8c54,_0x59b827){return db[_0x6596('0x17')]['findAll']({'raw':_0x198ada[_0x6596('0x18')]?_0x198ada['options'][_0x6596('0x19')]===undefined?!![]:![]:!![],'where':_0x198ada['options']?_0x198ada['options'][_0x6596('0x1a')]||null:null,'attributes':_0x198ada['options']?_0x198ada[_0x6596('0x18')][_0x6596('0x1b')]||null:null,'limit':_0x198ada[_0x6596('0x18')]?_0x198ada[_0x6596('0x18')]['limit']||null:null,'include':_0x198ada[_0x6596('0x18')]?_0x198ada[_0x6596('0x18')][_0x6596('0x1c')]?_['map'](_0x198ada[_0x6596('0x18')][_0x6596('0x1c')],function(_0x36f506){return{'model':db[_0x36f506['model']],'as':_0x36f506['as'],'attributes':_0x36f506[_0x6596('0x1b')],'include':_0x36f506[_0x6596('0x1c')]?_[_0x6596('0x1d')](_0x36f506['include'],function(_0x549e7f){return{'model':db[_0x549e7f[_0x6596('0x1e')]],'as':_0x549e7f['as'],'attributes':_0x549e7f[_0x6596('0x1b')],'include':_0x549e7f['include']?_[_0x6596('0x1d')](_0x549e7f[_0x6596('0x1c')],function(_0x348f49){return{'model':db[_0x348f49[_0x6596('0x1e')]],'as':_0x348f49['as'],'attributes':_0x348f49[_0x6596('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6596('0x1f')](function(_0x1cf75a){logger[_0x6596('0xc')](_0x6596('0x16'),_0x198ada);logger[_0x6596('0xf')](_0x6596('0x16'),_0x198ada,JSON[_0x6596('0x11')](_0x1cf75a));_0x1b8c54(_0x1cf75a);})[_0x6596('0x15')](function(_0xaff0fc){logger[_0x6596('0x12')]('GetFreshdeskAccount',_0xaff0fc[_0x6596('0x14')],_0x198ada);_0x59b827(_0x294853['error'](0x1f4,_0xaff0fc[_0x6596('0x14')]));});});};exports[_0x6596('0x20')]=function(_0x2796c3){var _0x67b005=this;return new Promise(function(_0x1962d4,_0x58cf58){return db[_0x6596('0x17')][_0x6596('0x21')]({'raw':_0x2796c3[_0x6596('0x18')]?_0x2796c3['options'][_0x6596('0x19')]===undefined?!![]:![]:!![],'where':_0x2796c3['options']?_0x2796c3['options'][_0x6596('0x1a')]||null:null,'attributes':_0x2796c3[_0x6596('0x18')]?_0x2796c3[_0x6596('0x18')]['attributes']||null:null,'include':_0x2796c3[_0x6596('0x18')]?_0x2796c3['options'][_0x6596('0x1c')]?_[_0x6596('0x1d')](_0x2796c3['options'][_0x6596('0x1c')],function(_0x4ca740){return{'model':db[_0x4ca740[_0x6596('0x1e')]],'as':_0x4ca740['as'],'attributes':_0x4ca740[_0x6596('0x1b')],'include':_0x4ca740[_0x6596('0x1c')]?_[_0x6596('0x1d')](_0x4ca740[_0x6596('0x1c')],function(_0x1c0fff){return{'model':db[_0x1c0fff[_0x6596('0x1e')]],'as':_0x1c0fff['as'],'attributes':_0x1c0fff['attributes'],'include':_0x1c0fff[_0x6596('0x1c')]?_['map'](_0x1c0fff[_0x6596('0x1c')],function(_0x14372c){return{'model':db[_0x14372c['model']],'as':_0x14372c['as'],'attributes':_0x14372c[_0x6596('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x509dd8){logger[_0x6596('0xc')]('ShowFreshdeskAccount',_0x2796c3);logger[_0x6596('0xf')](_0x6596('0x20'),_0x2796c3,JSON['stringify'](_0x509dd8));_0x1962d4(_0x509dd8);})['catch'](function(_0x604df3){logger['error']('ShowFreshdeskAccount',_0x604df3[_0x6596('0x14')],_0x2796c3);_0x58cf58(_0x67b005['error'](0x1f4,_0x604df3[_0x6596('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 90eca4b..1ba9b23 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 _0x9518=['create','setTags','put','/:id','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/fields','/:id/descriptions','/:id/tags','post'];(function(_0x3cbf28,_0x4eb22c){var _0x550d32=function(_0xa5bfae){while(--_0xa5bfae){_0x3cbf28['push'](_0x3cbf28['shift']());}};_0x550d32(++_0x4eb22c);}(_0x9518,0x1a5));var _0x8951=function(_0x5e848d,_0x1dbd20){_0x5e848d=_0x5e848d-0x0;var _0x3785e5=_0x9518[_0x5e848d];return _0x3785e5;};'use strict';var multer=require(_0x8951('0x0'));var util=require(_0x8951('0x1'));var path=require(_0x8951('0x2'));var timeout=require('connect-timeout');var express=require(_0x8951('0x3'));var router=express[_0x8951('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8951('0x5'));var interaction=require(_0x8951('0x6'));var config=require(_0x8951('0x7'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x8951('0x8')]('/',auth[_0x8951('0x9')](),controller[_0x8951('0xa')]);router['get']('/:id',auth[_0x8951('0x9')](),controller[_0x8951('0xb')]);router[_0x8951('0x8')](_0x8951('0xc'),auth[_0x8951('0x9')](),controller['getFields']);router[_0x8951('0x8')]('/:id/subjects',auth[_0x8951('0x9')](),controller['getSubjects']);router[_0x8951('0x8')](_0x8951('0xd'),auth[_0x8951('0x9')](),controller['getDescriptions']);router['get'](_0x8951('0xe'),auth['isAuthenticated'](),controller['getTags']);router[_0x8951('0xf')]('/',auth[_0x8951('0x9')](),controller[_0x8951('0x10')]);router['post'](_0x8951('0xe'),auth[_0x8951('0x9')](),controller[_0x8951('0x11')]);router[_0x8951('0x12')](_0x8951('0x13'),auth[_0x8951('0x9')](),controller[_0x8951('0x14')]);router['delete']('/:id',auth[_0x8951('0x9')](),controller[_0x8951('0x15')]);module[_0x8951('0x16')]=router; \ No newline at end of file +var _0x3f8e=['exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','get','/:id/tags','getTags','post','create','delete','destroy'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x3f8e,0xc1));var _0xe3f8=function(_0x1ffd41,_0x5e7f36){_0x1ffd41=_0x1ffd41-0x0;var _0x2ba0eb=_0x3f8e[_0x1ffd41];return _0x2ba0eb;};'use strict';var multer=require('multer');var util=require(_0xe3f8('0x0'));var path=require('path');var timeout=require(_0xe3f8('0x1'));var express=require(_0xe3f8('0x2'));var router=express['Router']();var fs_extra=require(_0xe3f8('0x3'));var auth=require(_0xe3f8('0x4'));var interaction=require(_0xe3f8('0x5'));var config=require(_0xe3f8('0x6'));var controller=require(_0xe3f8('0x7'));router['get']('/',auth[_0xe3f8('0x8')](),controller[_0xe3f8('0x9')]);router['get'](_0xe3f8('0xa'),auth[_0xe3f8('0x8')](),controller['show']);router['get'](_0xe3f8('0xb'),auth[_0xe3f8('0x8')](),controller[_0xe3f8('0xc')]);router['get'](_0xe3f8('0xd'),auth[_0xe3f8('0x8')](),controller['getSubjects']);router['get'](_0xe3f8('0xe'),auth[_0xe3f8('0x8')](),controller[_0xe3f8('0xf')]);router[_0xe3f8('0x10')](_0xe3f8('0x11'),auth[_0xe3f8('0x8')](),controller[_0xe3f8('0x12')]);router[_0xe3f8('0x13')]('/',auth[_0xe3f8('0x8')](),controller[_0xe3f8('0x14')]);router['post'](_0xe3f8('0x11'),auth[_0xe3f8('0x8')](),controller['setTags']);router['put'](_0xe3f8('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xe3f8('0x15')](_0xe3f8('0xa'),auth[_0xe3f8('0x8')](),controller[_0xe3f8('0x16')]);module[_0xe3f8('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 46ab5a9..282fcec 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 _0x8721=['STRING','sequelize','exports'];(function(_0x2cc21c,_0x4ceefa){var _0x59e4ea=function(_0x4e86d6){while(--_0x4e86d6){_0x2cc21c['push'](_0x2cc21c['shift']());}};_0x59e4ea(++_0x4ceefa);}(_0x8721,0x166));var _0x1872=function(_0x541ea6,_0x51cab6){_0x541ea6=_0x541ea6-0x0;var _0x3c3e84=_0x8721[_0x541ea6];return _0x3c3e84;};'use strict';var Sequelize=require(_0x1872('0x0'));module[_0x1872('0x1')]={'name':{'type':Sequelize[_0x1872('0x2')]},'description':{'type':Sequelize[_0x1872('0x2')]}}; \ No newline at end of file +var _0xc0c0=['sequelize','exports','STRING'];(function(_0x52c42a,_0x24fa3b){var _0x41d97e=function(_0x2d09e7){while(--_0x2d09e7){_0x52c42a['push'](_0x52c42a['shift']());}};_0x41d97e(++_0x24fa3b);}(_0xc0c0,0x129));var _0x0c0c=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xc0c0[_0x4fbfd9];return _0x31dc94;};'use strict';var Sequelize=require(_0x0c0c('0x0'));module[_0x0c0c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0c0c('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 6f92519..dd9cf8c 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 _0xa059=['ejs','fs-extra','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','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','options','then','include','findAll','rows','catch','create','body','params','find','findOne','FreshdeskField','pick','getFields','getSubjects','getDescriptions','Tag','getTags','setTags','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x4dcf75,_0x12dbfa){var _0x38ea00=function(_0x3b4342){while(--_0x3b4342){_0x4dcf75['push'](_0x4dcf75['shift']());}};_0x38ea00(++_0x12dbfa);}(_0xa059,0x1aa));var _0x9a05=function(_0x204849,_0x155080){_0x204849=_0x204849-0x0;var _0x51d3ce=_0xa059[_0x204849];return _0x51d3ce;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9a05('0x0'));var rp=require(_0x9a05('0x1'));var moment=require(_0x9a05('0x2'));var BPromise=require(_0x9a05('0x3'));var Mustache=require(_0x9a05('0x4'));var util=require(_0x9a05('0x5'));var path=require(_0x9a05('0x6'));var sox=require(_0x9a05('0x7'));var csv=require(_0x9a05('0x8'));var ejs=require(_0x9a05('0x9'));var fs=require('fs');var fs_extra=require(_0x9a05('0xa'));var _=require('lodash');var squel=require(_0x9a05('0xb'));var crypto=require(_0x9a05('0xc'));var jsforce=require(_0x9a05('0xd'));var deskjs=require(_0x9a05('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9a05('0xf'));var Papa=require(_0x9a05('0x10'));var Redis=require(_0x9a05('0x11'));var authService=require(_0x9a05('0x12'));var qs=require(_0x9a05('0x13'));var as=require(_0x9a05('0x14'));var hardwareService=require(_0x9a05('0x15'));var logger=require('../../config/logger')(_0x9a05('0x16'));var utils=require(_0x9a05('0x17'));var config=require(_0x9a05('0x18'));var licenseUtil=require(_0x9a05('0x19'));var db=require(_0x9a05('0x1a'))['db'];function respondWithStatusCode(_0x54d27e,_0x1252e1){_0x1252e1=_0x1252e1||0xcc;return function(_0x2d0503){if(_0x2d0503){return _0x54d27e[_0x9a05('0x1b')](_0x1252e1);}return _0x54d27e[_0x9a05('0x1c')](_0x1252e1)[_0x9a05('0x1d')]();};}function respondWithResult(_0x1ca811,_0x221b54){_0x221b54=_0x221b54||0xc8;return function(_0x8cf6c4){if(_0x8cf6c4){return _0x1ca811[_0x9a05('0x1c')](_0x221b54)[_0x9a05('0x1e')](_0x8cf6c4);}};}function respondWithFilteredResult(_0x2141e5,_0x5e1d12){return function(_0x527f69){if(_0x527f69){var _0x19435b=typeof _0x5e1d12[_0x9a05('0x1f')]===_0x9a05('0x20')&&typeof _0x5e1d12['limit']==='undefined';var _0x3ce8e0=_0x527f69['count'];var _0x30c2d8=_0x19435b?0x0:_0x5e1d12['offset'];var _0x126f6e=_0x19435b?_0x527f69[_0x9a05('0x21')]:_0x5e1d12[_0x9a05('0x1f')]+_0x5e1d12['limit'];var _0x300e68;if(_0x126f6e>=_0x3ce8e0){_0x126f6e=_0x3ce8e0;_0x300e68=0xc8;}else{_0x300e68=0xce;}_0x2141e5[_0x9a05('0x1c')](_0x300e68);return _0x2141e5[_0x9a05('0x22')](_0x9a05('0x23'),_0x30c2d8+'-'+_0x126f6e+'/'+_0x3ce8e0)[_0x9a05('0x1e')](_0x527f69);}return null;};}function patchUpdates(_0x25e790){return function(_0x280c7e){try{jsonpatch[_0x9a05('0x24')](_0x280c7e,_0x25e790,!![]);}catch(_0x5bb2ec){return BPromise[_0x9a05('0x25')](_0x5bb2ec);}return _0x280c7e[_0x9a05('0x26')]();};}function saveUpdates(_0x3ce277,_0x28bf36){return function(_0x1c0ffe){if(_0x1c0ffe){return _0x1c0ffe[_0x9a05('0x27')](_0x3ce277)['then'](function(_0x3f852b){return _0x3f852b;});}return null;};}function removeEntity(_0x373a30,_0x2965ce){return function(_0x19e174){if(_0x19e174){return _0x19e174[_0x9a05('0x28')]()['then'](function(){_0x373a30[_0x9a05('0x1c')](0xcc)[_0x9a05('0x1d')]();});}};}function handleEntityNotFound(_0x4102e8,_0x651848){return function(_0x38d353){if(!_0x38d353){_0x4102e8[_0x9a05('0x1b')](0x194);}return _0x38d353;};}function handleError(_0x2b16cd,_0x287141){_0x287141=_0x287141||0x1f4;return function(_0x310412){logger[_0x9a05('0x29')](_0x310412[_0x9a05('0x2a')]);if(_0x310412['name']){delete _0x310412[_0x9a05('0x2b')];}_0x2b16cd[_0x9a05('0x1c')](_0x287141)[_0x9a05('0x2c')](_0x310412);};}exports[_0x9a05('0x2d')]=function(_0xf1fe7,_0x2ff42c){var _0x68b597={},_0x2e031c={},_0x585575={'count':0x0,'rows':[]};var _0x362f45=_['map'](db[_0x9a05('0x2e')][_0x9a05('0x2f')],function(_0x40bfb7){return{'name':_0x40bfb7[_0x9a05('0x30')],'type':_0x40bfb7[_0x9a05('0x31')][_0x9a05('0x32')]};});_0x2e031c[_0x9a05('0x33')]=_[_0x9a05('0x34')](_0x362f45,_0x9a05('0x2b'));_0x2e031c['query']=_[_0x9a05('0x35')](_0xf1fe7[_0x9a05('0x36')]);_0x2e031c[_0x9a05('0x37')]=_[_0x9a05('0x38')](_0x2e031c[_0x9a05('0x33')],_0x2e031c['query']);_0x68b597[_0x9a05('0x39')]=_[_0x9a05('0x38')](_0x2e031c[_0x9a05('0x33')],qs[_0x9a05('0x3a')](_0xf1fe7[_0x9a05('0x36')][_0x9a05('0x3a')]));_0x68b597[_0x9a05('0x39')]=_0x68b597[_0x9a05('0x39')][_0x9a05('0x3b')]?_0x68b597[_0x9a05('0x39')]:_0x2e031c[_0x9a05('0x33')];if(!_0xf1fe7[_0x9a05('0x36')][_0x9a05('0x3c')](_0x9a05('0x3d'))){_0x68b597['limit']=qs[_0x9a05('0x3e')](_0xf1fe7[_0x9a05('0x36')][_0x9a05('0x3e')]);_0x68b597[_0x9a05('0x1f')]=qs['offset'](_0xf1fe7[_0x9a05('0x36')][_0x9a05('0x1f')]);}_0x68b597[_0x9a05('0x3f')]=qs[_0x9a05('0x40')](_0xf1fe7['query'][_0x9a05('0x40')]);_0x68b597[_0x9a05('0x41')]=qs[_0x9a05('0x37')](_['pick'](_0xf1fe7[_0x9a05('0x36')],_0x2e031c[_0x9a05('0x37')]),_0x362f45);if(_0xf1fe7[_0x9a05('0x36')][_0x9a05('0x42')]){_0x68b597['where']=_[_0x9a05('0x43')](_0x68b597['where'],{'$or':_['map'](_0x362f45,function(_0x352164){if(_0x352164[_0x9a05('0x31')]!=='VIRTUAL'){var _0x375e3c={};_0x375e3c[_0x352164[_0x9a05('0x2b')]]={'$like':'%'+_0xf1fe7[_0x9a05('0x36')][_0x9a05('0x42')]+'%'};return _0x375e3c;}})});}_0x68b597=_[_0x9a05('0x43')]({},_0x68b597,_0xf1fe7[_0x9a05('0x44')]);var _0x562d52={'where':_0x68b597['where']};return db[_0x9a05('0x2e')][_0x9a05('0x21')](_0x562d52)[_0x9a05('0x45')](function(_0x3094b4){_0x585575['count']=_0x3094b4;if(_0xf1fe7[_0x9a05('0x36')]['includeAll']){_0x68b597[_0x9a05('0x46')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x9a05('0x47')](_0x68b597);})[_0x9a05('0x45')](function(_0x4ceeb0){_0x585575[_0x9a05('0x48')]=_0x4ceeb0;return _0x585575;})[_0x9a05('0x45')](respondWithFilteredResult(_0x2ff42c,_0x68b597))['catch'](handleError(_0x2ff42c,null));};exports['show']=function(_0x1c638b,_0x51e19d){var _0x5eaab8={'raw':![],'where':{'id':_0x1c638b['params']['id']}},_0x268a94={};_0x268a94[_0x9a05('0x33')]=_['keys'](db['FreshdeskConfiguration'][_0x9a05('0x2f')]);_0x268a94[_0x9a05('0x36')]=_[_0x9a05('0x35')](_0x1c638b[_0x9a05('0x36')]);_0x268a94[_0x9a05('0x37')]=_[_0x9a05('0x38')](_0x268a94[_0x9a05('0x33')],_0x268a94[_0x9a05('0x36')]);_0x5eaab8[_0x9a05('0x39')]=_['intersection'](_0x268a94[_0x9a05('0x33')],qs[_0x9a05('0x3a')](_0x1c638b[_0x9a05('0x36')][_0x9a05('0x3a')]));_0x5eaab8[_0x9a05('0x39')]=_0x5eaab8[_0x9a05('0x39')][_0x9a05('0x3b')]?_0x5eaab8[_0x9a05('0x39')]:_0x268a94[_0x9a05('0x33')];if(_0x1c638b[_0x9a05('0x36')]['includeAll']){_0x5eaab8[_0x9a05('0x46')]=[{'all':!![]}];}_0x5eaab8=_[_0x9a05('0x43')]({},_0x5eaab8,_0x1c638b[_0x9a05('0x44')]);return db[_0x9a05('0x2e')]['find'](_0x5eaab8)['then'](handleEntityNotFound(_0x51e19d,null))[_0x9a05('0x45')](respondWithResult(_0x51e19d,null))[_0x9a05('0x49')](handleError(_0x51e19d,null));};exports['create']=function(_0x8a128b,_0x3a57e5){return db[_0x9a05('0x2e')][_0x9a05('0x4a')](_0x8a128b['body'],{})[_0x9a05('0x45')](respondWithResult(_0x3a57e5,0xc9))['catch'](handleError(_0x3a57e5,null));};exports['update']=function(_0x568fdb,_0x4e0ca2){if(_0x568fdb[_0x9a05('0x4b')]['id']){delete _0x568fdb[_0x9a05('0x4b')]['id'];}return db[_0x9a05('0x2e')]['find']({'where':{'id':_0x568fdb[_0x9a05('0x4c')]['id']}})[_0x9a05('0x45')](handleEntityNotFound(_0x4e0ca2,null))[_0x9a05('0x45')](saveUpdates(_0x568fdb[_0x9a05('0x4b')],null))[_0x9a05('0x45')](respondWithResult(_0x4e0ca2,null))['catch'](handleError(_0x4e0ca2,null));};exports[_0x9a05('0x28')]=function(_0xa29a11,_0x443cc4){return db['FreshdeskConfiguration'][_0x9a05('0x4d')]({'where':{'id':_0xa29a11['params']['id']}})[_0x9a05('0x45')](handleEntityNotFound(_0x443cc4,null))['then'](removeEntity(_0x443cc4,null))[_0x9a05('0x49')](handleError(_0x443cc4,null));};exports['getFields']=function(_0x132cfd,_0x1b62b6,_0x2a0517){var _0x180128={};var _0x25d31c={};var _0x413767;var _0x3f4322;return db[_0x9a05('0x2e')][_0x9a05('0x4e')]({'where':{'id':_0x132cfd['params']['id']}})['then'](handleEntityNotFound(_0x1b62b6,null))[_0x9a05('0x45')](function(_0x187e6b){if(_0x187e6b){_0x413767=_0x187e6b;_0x25d31c['model']=_[_0x9a05('0x35')](db[_0x9a05('0x4f')][_0x9a05('0x2f')]);_0x25d31c[_0x9a05('0x36')]=_[_0x9a05('0x35')](_0x132cfd['query']);_0x25d31c['filters']=_[_0x9a05('0x38')](_0x25d31c['model'],_0x25d31c[_0x9a05('0x36')]);_0x180128[_0x9a05('0x39')]=_[_0x9a05('0x38')](_0x25d31c[_0x9a05('0x33')],qs[_0x9a05('0x3a')](_0x132cfd[_0x9a05('0x36')][_0x9a05('0x3a')]));_0x180128[_0x9a05('0x39')]=_0x180128[_0x9a05('0x39')][_0x9a05('0x3b')]?_0x180128[_0x9a05('0x39')]:_0x25d31c['model'];_0x180128[_0x9a05('0x3f')]=qs[_0x9a05('0x40')](_0x132cfd['query'][_0x9a05('0x40')]);_0x180128[_0x9a05('0x41')]=qs[_0x9a05('0x37')](_[_0x9a05('0x50')](_0x132cfd[_0x9a05('0x36')],_0x25d31c['filters']));if(_0x132cfd[_0x9a05('0x36')][_0x9a05('0x42')]){_0x180128[_0x9a05('0x41')]=_[_0x9a05('0x43')](_0x180128[_0x9a05('0x41')],{'$or':_[_0x9a05('0x34')](_0x180128[_0x9a05('0x39')],function(_0x5b01c7){var _0x42e1a0={};_0x42e1a0[_0x5b01c7]={'$like':'%'+_0x132cfd[_0x9a05('0x36')][_0x9a05('0x42')]+'%'};return _0x42e1a0;})});}_0x180128=_['merge']({},_0x180128,_0x132cfd[_0x9a05('0x44')]);return _0x413767[_0x9a05('0x51')](_0x180128);}})[_0x9a05('0x45')](function(_0x37659a){if(_0x37659a){_0x3f4322=_0x37659a[_0x9a05('0x3b')];if(!_0x132cfd['query'][_0x9a05('0x3c')]('nolimit')){_0x180128['limit']=qs['limit'](_0x132cfd[_0x9a05('0x36')]['limit']);_0x180128[_0x9a05('0x1f')]=qs['offset'](_0x132cfd[_0x9a05('0x36')][_0x9a05('0x1f')]);}return _0x413767[_0x9a05('0x51')](_0x180128);}})[_0x9a05('0x45')](function(_0x55a821){if(_0x55a821){return _0x55a821?{'count':_0x3f4322,'rows':_0x55a821}:null;}})[_0x9a05('0x45')](respondWithResult(_0x1b62b6,null))[_0x9a05('0x49')](handleError(_0x1b62b6,null));};exports[_0x9a05('0x52')]=function(_0x5954aa,_0x421b6b,_0x5d71db){var _0x21af12={};var _0x1ea3cb={};var _0x278a2f;var _0x346eea;return db['FreshdeskConfiguration'][_0x9a05('0x4e')]({'where':{'id':_0x5954aa[_0x9a05('0x4c')]['id']}})['then'](handleEntityNotFound(_0x421b6b,null))[_0x9a05('0x45')](function(_0x363efb){if(_0x363efb){_0x278a2f=_0x363efb;_0x1ea3cb[_0x9a05('0x33')]=_[_0x9a05('0x35')](db['FreshdeskField'][_0x9a05('0x2f')]);_0x1ea3cb[_0x9a05('0x36')]=_[_0x9a05('0x35')](_0x5954aa[_0x9a05('0x36')]);_0x1ea3cb[_0x9a05('0x37')]=_[_0x9a05('0x38')](_0x1ea3cb[_0x9a05('0x33')],_0x1ea3cb['query']);_0x21af12[_0x9a05('0x39')]=_['intersection'](_0x1ea3cb['model'],qs[_0x9a05('0x3a')](_0x5954aa[_0x9a05('0x36')][_0x9a05('0x3a')]));_0x21af12[_0x9a05('0x39')]=_0x21af12[_0x9a05('0x39')][_0x9a05('0x3b')]?_0x21af12['attributes']:_0x1ea3cb[_0x9a05('0x33')];_0x21af12['order']=qs['sort'](_0x5954aa[_0x9a05('0x36')][_0x9a05('0x40')]);_0x21af12[_0x9a05('0x41')]=qs[_0x9a05('0x37')](_[_0x9a05('0x50')](_0x5954aa[_0x9a05('0x36')],_0x1ea3cb['filters']));if(_0x5954aa[_0x9a05('0x36')][_0x9a05('0x42')]){_0x21af12[_0x9a05('0x41')]=_[_0x9a05('0x43')](_0x21af12[_0x9a05('0x41')],{'$or':_['map'](_0x21af12[_0x9a05('0x39')],function(_0x3b4cd7){var _0x538261={};_0x538261[_0x3b4cd7]={'$like':'%'+_0x5954aa[_0x9a05('0x36')]['filter']+'%'};return _0x538261;})});}_0x21af12=_['merge']({},_0x21af12,_0x5954aa[_0x9a05('0x44')]);return _0x278a2f['getSubjects'](_0x21af12);}})[_0x9a05('0x45')](function(_0x3bf22b){if(_0x3bf22b){_0x346eea=_0x3bf22b[_0x9a05('0x3b')];if(!_0x5954aa[_0x9a05('0x36')][_0x9a05('0x3c')](_0x9a05('0x3d'))){_0x21af12[_0x9a05('0x3e')]=qs['limit'](_0x5954aa[_0x9a05('0x36')][_0x9a05('0x3e')]);_0x21af12[_0x9a05('0x1f')]=qs[_0x9a05('0x1f')](_0x5954aa[_0x9a05('0x36')][_0x9a05('0x1f')]);}return _0x278a2f[_0x9a05('0x52')](_0x21af12);}})['then'](function(_0x2fd144){if(_0x2fd144){return _0x2fd144?{'count':_0x346eea,'rows':_0x2fd144}:null;}})[_0x9a05('0x45')](respondWithResult(_0x421b6b,null))[_0x9a05('0x49')](handleError(_0x421b6b,null));};exports[_0x9a05('0x53')]=function(_0x50caf2,_0xe5fda3,_0x3f8bbc){var _0x112bb3={};var _0x2c78fb={};var _0x1ebb2a;var _0x5010a8;return db[_0x9a05('0x2e')][_0x9a05('0x4e')]({'where':{'id':_0x50caf2[_0x9a05('0x4c')]['id']}})['then'](handleEntityNotFound(_0xe5fda3,null))[_0x9a05('0x45')](function(_0x1b7ff8){if(_0x1b7ff8){_0x1ebb2a=_0x1b7ff8;_0x2c78fb[_0x9a05('0x33')]=_['keys'](db[_0x9a05('0x4f')][_0x9a05('0x2f')]);_0x2c78fb[_0x9a05('0x36')]=_[_0x9a05('0x35')](_0x50caf2[_0x9a05('0x36')]);_0x2c78fb[_0x9a05('0x37')]=_[_0x9a05('0x38')](_0x2c78fb[_0x9a05('0x33')],_0x2c78fb[_0x9a05('0x36')]);_0x112bb3[_0x9a05('0x39')]=_[_0x9a05('0x38')](_0x2c78fb[_0x9a05('0x33')],qs[_0x9a05('0x3a')](_0x50caf2['query'][_0x9a05('0x3a')]));_0x112bb3[_0x9a05('0x39')]=_0x112bb3[_0x9a05('0x39')][_0x9a05('0x3b')]?_0x112bb3[_0x9a05('0x39')]:_0x2c78fb[_0x9a05('0x33')];_0x112bb3[_0x9a05('0x3f')]=qs[_0x9a05('0x40')](_0x50caf2[_0x9a05('0x36')][_0x9a05('0x40')]);_0x112bb3[_0x9a05('0x41')]=qs['filters'](_[_0x9a05('0x50')](_0x50caf2[_0x9a05('0x36')],_0x2c78fb[_0x9a05('0x37')]));if(_0x50caf2['query'][_0x9a05('0x42')]){_0x112bb3[_0x9a05('0x41')]=_[_0x9a05('0x43')](_0x112bb3['where'],{'$or':_['map'](_0x112bb3['attributes'],function(_0x180909){var _0x5a166b={};_0x5a166b[_0x180909]={'$like':'%'+_0x50caf2[_0x9a05('0x36')]['filter']+'%'};return _0x5a166b;})});}_0x112bb3=_['merge']({},_0x112bb3,_0x50caf2[_0x9a05('0x44')]);return _0x1ebb2a[_0x9a05('0x53')](_0x112bb3);}})[_0x9a05('0x45')](function(_0x2c1f45){if(_0x2c1f45){_0x5010a8=_0x2c1f45[_0x9a05('0x3b')];if(!_0x50caf2[_0x9a05('0x36')][_0x9a05('0x3c')](_0x9a05('0x3d'))){_0x112bb3[_0x9a05('0x3e')]=qs[_0x9a05('0x3e')](_0x50caf2[_0x9a05('0x36')][_0x9a05('0x3e')]);_0x112bb3[_0x9a05('0x1f')]=qs[_0x9a05('0x1f')](_0x50caf2[_0x9a05('0x36')][_0x9a05('0x1f')]);}return _0x1ebb2a[_0x9a05('0x53')](_0x112bb3);}})[_0x9a05('0x45')](function(_0x414595){if(_0x414595){return _0x414595?{'count':_0x5010a8,'rows':_0x414595}:null;}})[_0x9a05('0x45')](respondWithResult(_0xe5fda3,null))['catch'](handleError(_0xe5fda3,null));};exports['getTags']=function(_0xd075e3,_0x47012f,_0x34cacc){var _0x506697={};var _0xac8f22={};var _0x4485d0;var _0x2257d9;return db[_0x9a05('0x2e')]['findOne']({'where':{'id':_0xd075e3[_0x9a05('0x4c')]['id']}})[_0x9a05('0x45')](handleEntityNotFound(_0x47012f,null))[_0x9a05('0x45')](function(_0x1baa0f){if(_0x1baa0f){_0x4485d0=_0x1baa0f;_0xac8f22[_0x9a05('0x33')]=_[_0x9a05('0x35')](db[_0x9a05('0x54')]['rawAttributes']);_0xac8f22[_0x9a05('0x36')]=_[_0x9a05('0x35')](_0xd075e3['query']);_0xac8f22[_0x9a05('0x37')]=_[_0x9a05('0x38')](_0xac8f22[_0x9a05('0x33')],_0xac8f22[_0x9a05('0x36')]);_0x506697[_0x9a05('0x39')]=_['intersection'](_0xac8f22[_0x9a05('0x33')],qs[_0x9a05('0x3a')](_0xd075e3[_0x9a05('0x36')][_0x9a05('0x3a')]));_0x506697[_0x9a05('0x39')]=_0x506697[_0x9a05('0x39')][_0x9a05('0x3b')]?_0x506697[_0x9a05('0x39')]:_0xac8f22[_0x9a05('0x33')];_0x506697[_0x9a05('0x3f')]=qs[_0x9a05('0x40')](_0xd075e3[_0x9a05('0x36')][_0x9a05('0x40')]);_0x506697[_0x9a05('0x41')]=qs[_0x9a05('0x37')](_[_0x9a05('0x50')](_0xd075e3['query'],_0xac8f22[_0x9a05('0x37')]));if(_0xd075e3[_0x9a05('0x36')][_0x9a05('0x42')]){_0x506697['where']=_[_0x9a05('0x43')](_0x506697['where'],{'$or':_['map'](_0x506697[_0x9a05('0x39')],function(_0x3e06fe){var _0x5ee2d3={};_0x5ee2d3[_0x3e06fe]={'$like':'%'+_0xd075e3[_0x9a05('0x36')][_0x9a05('0x42')]+'%'};return _0x5ee2d3;})});}_0x506697=_[_0x9a05('0x43')]({},_0x506697,_0xd075e3[_0x9a05('0x44')]);return _0x4485d0[_0x9a05('0x55')](_0x506697);}})[_0x9a05('0x45')](function(_0x4b660d){if(_0x4b660d){_0x2257d9=_0x4b660d[_0x9a05('0x3b')];if(!_0xd075e3[_0x9a05('0x36')][_0x9a05('0x3c')](_0x9a05('0x3d'))){_0x506697[_0x9a05('0x3e')]=qs['limit'](_0xd075e3[_0x9a05('0x36')][_0x9a05('0x3e')]);_0x506697['offset']=qs[_0x9a05('0x1f')](_0xd075e3['query']['offset']);}return _0x4485d0['getTags'](_0x506697);}})[_0x9a05('0x45')](function(_0x2b0c66){if(_0x2b0c66){return _0x2b0c66?{'count':_0x2257d9,'rows':_0x2b0c66}:null;}})[_0x9a05('0x45')](respondWithResult(_0x47012f,null))[_0x9a05('0x49')](handleError(_0x47012f,null));};exports[_0x9a05('0x56')]=function(_0x19bd98,_0x9ed3cc,_0x1c5b75){if(_0x19bd98[_0x9a05('0x4b')]['id']){delete _0x19bd98[_0x9a05('0x4b')]['id'];}return db['FreshdeskConfiguration'][_0x9a05('0x4e')]({'where':{'id':_0x19bd98[_0x9a05('0x4c')]['id']}})[_0x9a05('0x45')](handleEntityNotFound(_0x9ed3cc,null))[_0x9a05('0x45')](function(_0x66b479){if(_0x66b479){return _0x66b479[_0x9a05('0x56')](_0x19bd98[_0x9a05('0x4b')]['ids']||[]);}return null;})[_0x9a05('0x45')](respondWithResult(_0x9ed3cc,null))[_0x9a05('0x49')](handleError(_0x9ed3cc,null));}; \ No newline at end of file +var _0x4183=['keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','rawAttributes','include','find','create','body','getFields','findOne','FreshdeskField','getDescriptions','getTags','Tag','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','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','end','json','undefined','offset','count','limit','Content-Range','reject','save','update','then','sendStatus','error','name','send','index','FreshdeskConfiguration','key','map','query'];(function(_0x167eb8,_0x490047){var _0x332e1b=function(_0x2702b7){while(--_0x2702b7){_0x167eb8['push'](_0x167eb8['shift']());}};_0x332e1b(++_0x490047);}(_0x4183,0x1ac));var _0x3418=function(_0x4611d0,_0x2046e8){_0x4611d0=_0x4611d0-0x0;var _0x5c7481=_0x4183[_0x4611d0];return _0x5c7481;};'use strict';var emlformat=require(_0x3418('0x0'));var rimraf=require(_0x3418('0x1'));var zipdir=require(_0x3418('0x2'));var jsonpatch=require(_0x3418('0x3'));var rp=require(_0x3418('0x4'));var moment=require(_0x3418('0x5'));var BPromise=require(_0x3418('0x6'));var Mustache=require(_0x3418('0x7'));var util=require(_0x3418('0x8'));var path=require('path');var sox=require(_0x3418('0x9'));var csv=require(_0x3418('0xa'));var ejs=require(_0x3418('0xb'));var fs=require('fs');var fs_extra=require(_0x3418('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3418('0xa'));var querystring=require(_0x3418('0xd'));var Papa=require(_0x3418('0xe'));var Redis=require(_0x3418('0xf'));var authService=require(_0x3418('0x10'));var qs=require(_0x3418('0x11'));var as=require(_0x3418('0x12'));var hardwareService=require(_0x3418('0x13'));var logger=require(_0x3418('0x14'))(_0x3418('0x15'));var utils=require(_0x3418('0x16'));var config=require(_0x3418('0x17'));var licenseUtil=require(_0x3418('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe122fd,_0x4f86c9){_0x4f86c9=_0x4f86c9||0xcc;return function(_0x1772a2){if(_0x1772a2){return _0xe122fd['sendStatus'](_0x4f86c9);}return _0xe122fd[_0x3418('0x19')](_0x4f86c9)[_0x3418('0x1a')]();};}function respondWithResult(_0x3f8365,_0x154637){_0x154637=_0x154637||0xc8;return function(_0x10d650){if(_0x10d650){return _0x3f8365[_0x3418('0x19')](_0x154637)[_0x3418('0x1b')](_0x10d650);}};}function respondWithFilteredResult(_0x18df85,_0x165239){return function(_0x30052f){if(_0x30052f){var _0x19488f=typeof _0x165239['offset']===_0x3418('0x1c')&&typeof _0x165239['limit']===_0x3418('0x1c');var _0x2d63d5=_0x30052f['count'];var _0x5c796b=_0x19488f?0x0:_0x165239[_0x3418('0x1d')];var _0x32273b=_0x19488f?_0x30052f[_0x3418('0x1e')]:_0x165239[_0x3418('0x1d')]+_0x165239[_0x3418('0x1f')];var _0x53c774;if(_0x32273b>=_0x2d63d5){_0x32273b=_0x2d63d5;_0x53c774=0xc8;}else{_0x53c774=0xce;}_0x18df85[_0x3418('0x19')](_0x53c774);return _0x18df85['set'](_0x3418('0x20'),_0x5c796b+'-'+_0x32273b+'/'+_0x2d63d5)[_0x3418('0x1b')](_0x30052f);}return null;};}function patchUpdates(_0xcd2ae9){return function(_0x554767){try{jsonpatch['apply'](_0x554767,_0xcd2ae9,!![]);}catch(_0x164a80){return BPromise[_0x3418('0x21')](_0x164a80);}return _0x554767[_0x3418('0x22')]();};}function saveUpdates(_0x5cc78d,_0xf4d566){return function(_0x4d62d2){if(_0x4d62d2){return _0x4d62d2[_0x3418('0x23')](_0x5cc78d)[_0x3418('0x24')](function(_0x1edd9d){return _0x1edd9d;});}return null;};}function removeEntity(_0x16455a,_0x2c3908){return function(_0xcef199){if(_0xcef199){return _0xcef199['destroy']()[_0x3418('0x24')](function(){_0x16455a[_0x3418('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa7679,_0x53e032){return function(_0x31ca80){if(!_0x31ca80){_0xa7679[_0x3418('0x25')](0x194);}return _0x31ca80;};}function handleError(_0x2040b0,_0x2617ca){_0x2617ca=_0x2617ca||0x1f4;return function(_0x3df359){logger[_0x3418('0x26')](_0x3df359['stack']);if(_0x3df359[_0x3418('0x27')]){delete _0x3df359[_0x3418('0x27')];}_0x2040b0[_0x3418('0x19')](_0x2617ca)[_0x3418('0x28')](_0x3df359);};}exports[_0x3418('0x29')]=function(_0x2f2730,_0x381cb9){var _0x1bd43e={},_0x3448dd={},_0x1abe9e={'count':0x0,'rows':[]};var _0x595db2=_['map'](db[_0x3418('0x2a')]['rawAttributes'],function(_0x1b06f7){return{'name':_0x1b06f7['fieldName'],'type':_0x1b06f7['type'][_0x3418('0x2b')]};});_0x3448dd['model']=_[_0x3418('0x2c')](_0x595db2,_0x3418('0x27'));_0x3448dd[_0x3418('0x2d')]=_[_0x3418('0x2e')](_0x2f2730[_0x3418('0x2d')]);_0x3448dd[_0x3418('0x2f')]=_[_0x3418('0x30')](_0x3448dd[_0x3418('0x31')],_0x3448dd[_0x3418('0x2d')]);_0x1bd43e[_0x3418('0x32')]=_[_0x3418('0x30')](_0x3448dd[_0x3418('0x31')],qs[_0x3418('0x33')](_0x2f2730[_0x3418('0x2d')][_0x3418('0x33')]));_0x1bd43e[_0x3418('0x32')]=_0x1bd43e[_0x3418('0x32')][_0x3418('0x34')]?_0x1bd43e[_0x3418('0x32')]:_0x3448dd[_0x3418('0x31')];if(!_0x2f2730[_0x3418('0x2d')][_0x3418('0x35')](_0x3418('0x36'))){_0x1bd43e['limit']=qs[_0x3418('0x1f')](_0x2f2730[_0x3418('0x2d')][_0x3418('0x1f')]);_0x1bd43e[_0x3418('0x1d')]=qs[_0x3418('0x1d')](_0x2f2730[_0x3418('0x2d')][_0x3418('0x1d')]);}_0x1bd43e[_0x3418('0x37')]=qs[_0x3418('0x38')](_0x2f2730['query']['sort']);_0x1bd43e[_0x3418('0x39')]=qs['filters'](_[_0x3418('0x3a')](_0x2f2730[_0x3418('0x2d')],_0x3448dd['filters']),_0x595db2);if(_0x2f2730[_0x3418('0x2d')][_0x3418('0x3b')]){_0x1bd43e[_0x3418('0x39')]=_[_0x3418('0x3c')](_0x1bd43e[_0x3418('0x39')],{'$or':_[_0x3418('0x2c')](_0x595db2,function(_0x47e925){if(_0x47e925['type']!==_0x3418('0x3d')){var _0x35a3ae={};_0x35a3ae[_0x47e925[_0x3418('0x27')]]={'$like':'%'+_0x2f2730[_0x3418('0x2d')][_0x3418('0x3b')]+'%'};return _0x35a3ae;}})});}_0x1bd43e=_[_0x3418('0x3c')]({},_0x1bd43e,_0x2f2730[_0x3418('0x3e')]);var _0x42ddf7={'where':_0x1bd43e['where']};return db[_0x3418('0x2a')][_0x3418('0x1e')](_0x42ddf7)['then'](function(_0x282d0d){_0x1abe9e[_0x3418('0x1e')]=_0x282d0d;if(_0x2f2730[_0x3418('0x2d')][_0x3418('0x3f')]){_0x1bd43e['include']=[{'all':!![]}];}return db[_0x3418('0x2a')]['findAll'](_0x1bd43e);})[_0x3418('0x24')](function(_0xf473c){_0x1abe9e[_0x3418('0x40')]=_0xf473c;return _0x1abe9e;})[_0x3418('0x24')](respondWithFilteredResult(_0x381cb9,_0x1bd43e))[_0x3418('0x41')](handleError(_0x381cb9,null));};exports[_0x3418('0x42')]=function(_0x36c99a,_0xae2766){var _0x316fea={'raw':![],'where':{'id':_0x36c99a[_0x3418('0x43')]['id']}},_0x27eac9={};_0x27eac9[_0x3418('0x31')]=_[_0x3418('0x2e')](db[_0x3418('0x2a')][_0x3418('0x44')]);_0x27eac9[_0x3418('0x2d')]=_[_0x3418('0x2e')](_0x36c99a[_0x3418('0x2d')]);_0x27eac9[_0x3418('0x2f')]=_[_0x3418('0x30')](_0x27eac9['model'],_0x27eac9[_0x3418('0x2d')]);_0x316fea['attributes']=_['intersection'](_0x27eac9[_0x3418('0x31')],qs[_0x3418('0x33')](_0x36c99a[_0x3418('0x2d')][_0x3418('0x33')]));_0x316fea[_0x3418('0x32')]=_0x316fea[_0x3418('0x32')][_0x3418('0x34')]?_0x316fea['attributes']:_0x27eac9[_0x3418('0x31')];if(_0x36c99a[_0x3418('0x2d')][_0x3418('0x3f')]){_0x316fea[_0x3418('0x45')]=[{'all':!![]}];}_0x316fea=_[_0x3418('0x3c')]({},_0x316fea,_0x36c99a[_0x3418('0x3e')]);return db[_0x3418('0x2a')][_0x3418('0x46')](_0x316fea)['then'](handleEntityNotFound(_0xae2766,null))[_0x3418('0x24')](respondWithResult(_0xae2766,null))[_0x3418('0x41')](handleError(_0xae2766,null));};exports['create']=function(_0x4fe599,_0x9aef4f){return db['FreshdeskConfiguration'][_0x3418('0x47')](_0x4fe599[_0x3418('0x48')],{})['then'](respondWithResult(_0x9aef4f,0xc9))['catch'](handleError(_0x9aef4f,null));};exports[_0x3418('0x23')]=function(_0x4033c4,_0xda959c){if(_0x4033c4[_0x3418('0x48')]['id']){delete _0x4033c4[_0x3418('0x48')]['id'];}return db[_0x3418('0x2a')]['find']({'where':{'id':_0x4033c4['params']['id']}})[_0x3418('0x24')](handleEntityNotFound(_0xda959c,null))[_0x3418('0x24')](saveUpdates(_0x4033c4[_0x3418('0x48')],null))[_0x3418('0x24')](respondWithResult(_0xda959c,null))[_0x3418('0x41')](handleError(_0xda959c,null));};exports['destroy']=function(_0x6aa8b5,_0x1267c2){return db[_0x3418('0x2a')][_0x3418('0x46')]({'where':{'id':_0x6aa8b5[_0x3418('0x43')]['id']}})[_0x3418('0x24')](handleEntityNotFound(_0x1267c2,null))[_0x3418('0x24')](removeEntity(_0x1267c2,null))[_0x3418('0x41')](handleError(_0x1267c2,null));};exports[_0x3418('0x49')]=function(_0x1ad5a8,_0x107c00,_0x1ba142){var _0x4e8e99={};var _0x1d3ecf={};var _0x466793;var _0x4ae89a;return db[_0x3418('0x2a')]['findOne']({'where':{'id':_0x1ad5a8[_0x3418('0x43')]['id']}})[_0x3418('0x24')](handleEntityNotFound(_0x107c00,null))['then'](function(_0x3a435d){if(_0x3a435d){_0x466793=_0x3a435d;_0x1d3ecf['model']=_[_0x3418('0x2e')](db['FreshdeskField']['rawAttributes']);_0x1d3ecf[_0x3418('0x2d')]=_[_0x3418('0x2e')](_0x1ad5a8['query']);_0x1d3ecf[_0x3418('0x2f')]=_[_0x3418('0x30')](_0x1d3ecf[_0x3418('0x31')],_0x1d3ecf[_0x3418('0x2d')]);_0x4e8e99[_0x3418('0x32')]=_[_0x3418('0x30')](_0x1d3ecf[_0x3418('0x31')],qs[_0x3418('0x33')](_0x1ad5a8[_0x3418('0x2d')][_0x3418('0x33')]));_0x4e8e99[_0x3418('0x32')]=_0x4e8e99[_0x3418('0x32')]['length']?_0x4e8e99[_0x3418('0x32')]:_0x1d3ecf['model'];_0x4e8e99[_0x3418('0x37')]=qs[_0x3418('0x38')](_0x1ad5a8['query'][_0x3418('0x38')]);_0x4e8e99[_0x3418('0x39')]=qs[_0x3418('0x2f')](_[_0x3418('0x3a')](_0x1ad5a8[_0x3418('0x2d')],_0x1d3ecf[_0x3418('0x2f')]));if(_0x1ad5a8[_0x3418('0x2d')][_0x3418('0x3b')]){_0x4e8e99[_0x3418('0x39')]=_[_0x3418('0x3c')](_0x4e8e99['where'],{'$or':_['map'](_0x4e8e99[_0x3418('0x32')],function(_0x6c6b7b){var _0x1af10b={};_0x1af10b[_0x6c6b7b]={'$like':'%'+_0x1ad5a8[_0x3418('0x2d')][_0x3418('0x3b')]+'%'};return _0x1af10b;})});}_0x4e8e99=_[_0x3418('0x3c')]({},_0x4e8e99,_0x1ad5a8[_0x3418('0x3e')]);return _0x466793[_0x3418('0x49')](_0x4e8e99);}})[_0x3418('0x24')](function(_0x161527){if(_0x161527){_0x4ae89a=_0x161527[_0x3418('0x34')];if(!_0x1ad5a8[_0x3418('0x2d')][_0x3418('0x35')](_0x3418('0x36'))){_0x4e8e99[_0x3418('0x1f')]=qs[_0x3418('0x1f')](_0x1ad5a8[_0x3418('0x2d')][_0x3418('0x1f')]);_0x4e8e99[_0x3418('0x1d')]=qs[_0x3418('0x1d')](_0x1ad5a8[_0x3418('0x2d')][_0x3418('0x1d')]);}return _0x466793[_0x3418('0x49')](_0x4e8e99);}})[_0x3418('0x24')](function(_0x9f726d){if(_0x9f726d){return _0x9f726d?{'count':_0x4ae89a,'rows':_0x9f726d}:null;}})['then'](respondWithResult(_0x107c00,null))[_0x3418('0x41')](handleError(_0x107c00,null));};exports['getSubjects']=function(_0x4de7b6,_0x364234,_0x3c43c4){var _0xba19fe={};var _0x29dda5={};var _0x5502a7;var _0x66a958;return db[_0x3418('0x2a')][_0x3418('0x4a')]({'where':{'id':_0x4de7b6[_0x3418('0x43')]['id']}})[_0x3418('0x24')](handleEntityNotFound(_0x364234,null))['then'](function(_0x3e0e25){if(_0x3e0e25){_0x5502a7=_0x3e0e25;_0x29dda5[_0x3418('0x31')]=_[_0x3418('0x2e')](db[_0x3418('0x4b')][_0x3418('0x44')]);_0x29dda5[_0x3418('0x2d')]=_['keys'](_0x4de7b6[_0x3418('0x2d')]);_0x29dda5['filters']=_[_0x3418('0x30')](_0x29dda5[_0x3418('0x31')],_0x29dda5['query']);_0xba19fe[_0x3418('0x32')]=_[_0x3418('0x30')](_0x29dda5['model'],qs[_0x3418('0x33')](_0x4de7b6[_0x3418('0x2d')][_0x3418('0x33')]));_0xba19fe['attributes']=_0xba19fe[_0x3418('0x32')][_0x3418('0x34')]?_0xba19fe['attributes']:_0x29dda5['model'];_0xba19fe[_0x3418('0x37')]=qs[_0x3418('0x38')](_0x4de7b6[_0x3418('0x2d')][_0x3418('0x38')]);_0xba19fe[_0x3418('0x39')]=qs[_0x3418('0x2f')](_[_0x3418('0x3a')](_0x4de7b6['query'],_0x29dda5[_0x3418('0x2f')]));if(_0x4de7b6[_0x3418('0x2d')][_0x3418('0x3b')]){_0xba19fe[_0x3418('0x39')]=_['merge'](_0xba19fe[_0x3418('0x39')],{'$or':_[_0x3418('0x2c')](_0xba19fe[_0x3418('0x32')],function(_0x383445){var _0x4893ff={};_0x4893ff[_0x383445]={'$like':'%'+_0x4de7b6[_0x3418('0x2d')]['filter']+'%'};return _0x4893ff;})});}_0xba19fe=_[_0x3418('0x3c')]({},_0xba19fe,_0x4de7b6['options']);return _0x5502a7['getSubjects'](_0xba19fe);}})[_0x3418('0x24')](function(_0x472633){if(_0x472633){_0x66a958=_0x472633[_0x3418('0x34')];if(!_0x4de7b6[_0x3418('0x2d')][_0x3418('0x35')](_0x3418('0x36'))){_0xba19fe['limit']=qs[_0x3418('0x1f')](_0x4de7b6[_0x3418('0x2d')][_0x3418('0x1f')]);_0xba19fe[_0x3418('0x1d')]=qs[_0x3418('0x1d')](_0x4de7b6[_0x3418('0x2d')][_0x3418('0x1d')]);}return _0x5502a7['getSubjects'](_0xba19fe);}})[_0x3418('0x24')](function(_0x4d43bd){if(_0x4d43bd){return _0x4d43bd?{'count':_0x66a958,'rows':_0x4d43bd}:null;}})['then'](respondWithResult(_0x364234,null))['catch'](handleError(_0x364234,null));};exports[_0x3418('0x4c')]=function(_0xf67f42,_0x4a7b7e,_0x186d1e){var _0x2a3b85={};var _0x4eeb73={};var _0x59c933;var _0x3293fa;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0xf67f42[_0x3418('0x43')]['id']}})[_0x3418('0x24')](handleEntityNotFound(_0x4a7b7e,null))[_0x3418('0x24')](function(_0x23a87c){if(_0x23a87c){_0x59c933=_0x23a87c;_0x4eeb73['model']=_['keys'](db[_0x3418('0x4b')]['rawAttributes']);_0x4eeb73[_0x3418('0x2d')]=_[_0x3418('0x2e')](_0xf67f42['query']);_0x4eeb73[_0x3418('0x2f')]=_[_0x3418('0x30')](_0x4eeb73['model'],_0x4eeb73[_0x3418('0x2d')]);_0x2a3b85[_0x3418('0x32')]=_[_0x3418('0x30')](_0x4eeb73[_0x3418('0x31')],qs[_0x3418('0x33')](_0xf67f42[_0x3418('0x2d')][_0x3418('0x33')]));_0x2a3b85[_0x3418('0x32')]=_0x2a3b85[_0x3418('0x32')][_0x3418('0x34')]?_0x2a3b85['attributes']:_0x4eeb73[_0x3418('0x31')];_0x2a3b85[_0x3418('0x37')]=qs[_0x3418('0x38')](_0xf67f42[_0x3418('0x2d')][_0x3418('0x38')]);_0x2a3b85['where']=qs['filters'](_[_0x3418('0x3a')](_0xf67f42[_0x3418('0x2d')],_0x4eeb73[_0x3418('0x2f')]));if(_0xf67f42['query']['filter']){_0x2a3b85[_0x3418('0x39')]=_[_0x3418('0x3c')](_0x2a3b85[_0x3418('0x39')],{'$or':_[_0x3418('0x2c')](_0x2a3b85[_0x3418('0x32')],function(_0x481586){var _0x44b241={};_0x44b241[_0x481586]={'$like':'%'+_0xf67f42[_0x3418('0x2d')]['filter']+'%'};return _0x44b241;})});}_0x2a3b85=_[_0x3418('0x3c')]({},_0x2a3b85,_0xf67f42['options']);return _0x59c933[_0x3418('0x4c')](_0x2a3b85);}})[_0x3418('0x24')](function(_0x108c6e){if(_0x108c6e){_0x3293fa=_0x108c6e[_0x3418('0x34')];if(!_0xf67f42[_0x3418('0x2d')][_0x3418('0x35')](_0x3418('0x36'))){_0x2a3b85[_0x3418('0x1f')]=qs[_0x3418('0x1f')](_0xf67f42[_0x3418('0x2d')][_0x3418('0x1f')]);_0x2a3b85['offset']=qs[_0x3418('0x1d')](_0xf67f42[_0x3418('0x2d')][_0x3418('0x1d')]);}return _0x59c933[_0x3418('0x4c')](_0x2a3b85);}})[_0x3418('0x24')](function(_0x1047d9){if(_0x1047d9){return _0x1047d9?{'count':_0x3293fa,'rows':_0x1047d9}:null;}})['then'](respondWithResult(_0x4a7b7e,null))[_0x3418('0x41')](handleError(_0x4a7b7e,null));};exports[_0x3418('0x4d')]=function(_0x2a3c62,_0x4d1401,_0x11353d){var _0x144ee9={};var _0x2f143c={};var _0x232d06;var _0x1fffb8;return db[_0x3418('0x2a')][_0x3418('0x4a')]({'where':{'id':_0x2a3c62[_0x3418('0x43')]['id']}})['then'](handleEntityNotFound(_0x4d1401,null))[_0x3418('0x24')](function(_0x302b11){if(_0x302b11){_0x232d06=_0x302b11;_0x2f143c[_0x3418('0x31')]=_[_0x3418('0x2e')](db[_0x3418('0x4e')][_0x3418('0x44')]);_0x2f143c[_0x3418('0x2d')]=_[_0x3418('0x2e')](_0x2a3c62[_0x3418('0x2d')]);_0x2f143c[_0x3418('0x2f')]=_[_0x3418('0x30')](_0x2f143c[_0x3418('0x31')],_0x2f143c[_0x3418('0x2d')]);_0x144ee9[_0x3418('0x32')]=_[_0x3418('0x30')](_0x2f143c[_0x3418('0x31')],qs[_0x3418('0x33')](_0x2a3c62[_0x3418('0x2d')]['fields']));_0x144ee9[_0x3418('0x32')]=_0x144ee9[_0x3418('0x32')]['length']?_0x144ee9[_0x3418('0x32')]:_0x2f143c[_0x3418('0x31')];_0x144ee9[_0x3418('0x37')]=qs[_0x3418('0x38')](_0x2a3c62[_0x3418('0x2d')][_0x3418('0x38')]);_0x144ee9[_0x3418('0x39')]=qs[_0x3418('0x2f')](_[_0x3418('0x3a')](_0x2a3c62[_0x3418('0x2d')],_0x2f143c[_0x3418('0x2f')]));if(_0x2a3c62[_0x3418('0x2d')][_0x3418('0x3b')]){_0x144ee9[_0x3418('0x39')]=_['merge'](_0x144ee9[_0x3418('0x39')],{'$or':_[_0x3418('0x2c')](_0x144ee9[_0x3418('0x32')],function(_0x1dabca){var _0x11420a={};_0x11420a[_0x1dabca]={'$like':'%'+_0x2a3c62['query'][_0x3418('0x3b')]+'%'};return _0x11420a;})});}_0x144ee9=_['merge']({},_0x144ee9,_0x2a3c62[_0x3418('0x3e')]);return _0x232d06[_0x3418('0x4d')](_0x144ee9);}})[_0x3418('0x24')](function(_0x58caa9){if(_0x58caa9){_0x1fffb8=_0x58caa9[_0x3418('0x34')];if(!_0x2a3c62[_0x3418('0x2d')][_0x3418('0x35')](_0x3418('0x36'))){_0x144ee9[_0x3418('0x1f')]=qs['limit'](_0x2a3c62['query'][_0x3418('0x1f')]);_0x144ee9[_0x3418('0x1d')]=qs[_0x3418('0x1d')](_0x2a3c62['query'][_0x3418('0x1d')]);}return _0x232d06[_0x3418('0x4d')](_0x144ee9);}})[_0x3418('0x24')](function(_0x14ee49){if(_0x14ee49){return _0x14ee49?{'count':_0x1fffb8,'rows':_0x14ee49}:null;}})[_0x3418('0x24')](respondWithResult(_0x4d1401,null))[_0x3418('0x41')](handleError(_0x4d1401,null));};exports['setTags']=function(_0x212e0a,_0x5ea7d2,_0x2fc905){if(_0x212e0a['body']['id']){delete _0x212e0a[_0x3418('0x48')]['id'];}return db['FreshdeskConfiguration'][_0x3418('0x4a')]({'where':{'id':_0x212e0a[_0x3418('0x43')]['id']}})[_0x3418('0x24')](handleEntityNotFound(_0x5ea7d2,null))['then'](function(_0x7e5b5e){if(_0x7e5b5e){return _0x7e5b5e['setTags'](_0x212e0a[_0x3418('0x48')]['ids']||[]);}return null;})[_0x3418('0x24')](respondWithResult(_0x5ea7d2,null))[_0x3418('0x41')](handleError(_0x5ea7d2,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index d4d45c2..a6935f6 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 _0xbb6f=['moment','bluebird','path','rimraf','../../config/environment','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger'];(function(_0x540773,_0x43253b){var _0x113dba=function(_0x12f3d4){while(--_0x12f3d4){_0x540773['push'](_0x540773['shift']());}};_0x113dba(++_0x43253b);}(_0xbb6f,0x1b5));var _0xfbb6=function(_0x590e57,_0xfb1a4c){_0x590e57=_0x590e57-0x0;var _0x34ef3f=_0xbb6f[_0x590e57];return _0x34ef3f;};'use strict';var _=require(_0xfbb6('0x0'));var util=require(_0xfbb6('0x1'));var logger=require(_0xfbb6('0x2'))('api');var moment=require(_0xfbb6('0x3'));var BPromise=require(_0xfbb6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfbb6('0x5'));var rimraf=require(_0xfbb6('0x6'));var config=require(_0xfbb6('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x432ace,_0x160ad7){return _0x432ace[_0xfbb6('0x8')](_0xfbb6('0x9'),attributes,{'tableName':_0xfbb6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x454d=['../../config/logger','bluebird','path','rimraf','../../config/environment','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','util'];(function(_0x35ec86,_0x1c34d3){var _0x1721b5=function(_0x1192fd){while(--_0x1192fd){_0x35ec86['push'](_0x35ec86['shift']());}};_0x1721b5(++_0x1c34d3);}(_0x454d,0xef));var _0xd454=function(_0x11dc39,_0x491115){_0x11dc39=_0x11dc39-0x0;var _0x457277=_0x454d[_0x11dc39];return _0x457277;};'use strict';var _=require('lodash');var util=require(_0xd454('0x0'));var logger=require(_0xd454('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd454('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd454('0x3'));var rimraf=require(_0xd454('0x4'));var config=require(_0xd454('0x5'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0xd454('0x6')]=function(_0x42a4b1,_0x483c86){return _0x42a4b1[_0xd454('0x7')](_0xd454('0x8'),attributes,{'tableName':_0xd454('0x9'),'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 c4f12ef..06ed4e0 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 _0x0f5c=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x5247f3,_0x2bf6d3){var _0x463954=function(_0x1bd3e3){while(--_0x1bd3e3){_0x5247f3['push'](_0x5247f3['shift']());}};_0x463954(++_0x2bf6d3);}(_0x0f5c,0x163));var _0xc0f5=function(_0x2f1172,_0x5f5b26){_0x2f1172=_0x2f1172-0x0;var _0x58e374=_0x0f5c[_0x2f1172];return _0x58e374;};'use strict';var _=require(_0xc0f5('0x0'));var util=require(_0xc0f5('0x1'));var moment=require(_0xc0f5('0x2'));var BPromise=require(_0xc0f5('0x3'));var rs=require(_0xc0f5('0x4'));var fs=require('fs');var Redis=require(_0xc0f5('0x5'));var db=require(_0xc0f5('0x6'))['db'];var utils=require(_0xc0f5('0x7'));var logger=require(_0xc0f5('0x8'))(_0xc0f5('0x9'));var config=require(_0xc0f5('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xc0f5('0xb')][_0xc0f5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1845d8,_0x3e0332,_0x4b9822){return new BPromise(function(_0x4a5299,_0x46cdd1){return client[_0xc0f5('0xd')](_0x1845d8,_0x4b9822)[_0xc0f5('0xe')](function(_0x1a7059){logger[_0xc0f5('0xf')](_0xc0f5('0x10'),_0x3e0332,_0xc0f5('0x11'));logger[_0xc0f5('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x3e0332,_0xc0f5('0x11'),JSON[_0xc0f5('0x13')](_0x1a7059));if(_0x1a7059[_0xc0f5('0x14')]){if(_0x1a7059[_0xc0f5('0x14')][_0xc0f5('0x15')]===0x1f4){logger[_0xc0f5('0x14')](_0xc0f5('0x10'),_0x3e0332,_0x1a7059['error'][_0xc0f5('0x16')]);return _0x46cdd1(_0x1a7059['error'][_0xc0f5('0x16')]);}logger['error'](_0xc0f5('0x10'),_0x3e0332,_0x1a7059[_0xc0f5('0x14')][_0xc0f5('0x16')]);return _0x4a5299(_0x1a7059[_0xc0f5('0x14')][_0xc0f5('0x16')]);}else{logger[_0xc0f5('0xf')](_0xc0f5('0x10'),_0x3e0332,_0xc0f5('0x11'));_0x4a5299(_0x1a7059[_0xc0f5('0x17')][_0xc0f5('0x16')]);}})[_0xc0f5('0x18')](function(_0x2df22e){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x3e0332,_0x2df22e);_0x46cdd1(_0x2df22e);});});} \ No newline at end of file +var _0x04f6=['error','message','catch','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x208aa4,_0x5cfa46){var _0xa8d8ee=function(_0x104f2c){while(--_0x104f2c){_0x208aa4['push'](_0x208aa4['shift']());}};_0xa8d8ee(++_0x5cfa46);}(_0x04f6,0x111));var _0x604f=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x04f6[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x604f('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x604f('0x1'));var db=require(_0x604f('0x2'))['db'];var utils=require(_0x604f('0x3'));var logger=require('../../config/logger')(_0x604f('0x4'));var config=require(_0x604f('0x5'));var jayson=require(_0x604f('0x6'));var client=jayson[_0x604f('0x7')][_0x604f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x635a7,_0x3b5a52,_0x3b9b61){return new BPromise(function(_0x3d75a5,_0x4784e5){return client['request'](_0x635a7,_0x3b9b61)[_0x604f('0x9')](function(_0x26479c){logger[_0x604f('0xa')](_0x604f('0xb'),_0x3b5a52,'request\x20sent');logger[_0x604f('0xc')](_0x604f('0xd'),_0x3b5a52,_0x604f('0xe'),JSON['stringify'](_0x26479c));if(_0x26479c['error']){if(_0x26479c[_0x604f('0xf')]['code']===0x1f4){logger[_0x604f('0xf')](_0x604f('0xb'),_0x3b5a52,_0x26479c[_0x604f('0xf')][_0x604f('0x10')]);return _0x4784e5(_0x26479c[_0x604f('0xf')]['message']);}logger[_0x604f('0xf')](_0x604f('0xb'),_0x3b5a52,_0x26479c['error']['message']);return _0x3d75a5(_0x26479c[_0x604f('0xf')][_0x604f('0x10')]);}else{logger['info'](_0x604f('0xb'),_0x3b5a52,_0x604f('0xe'));_0x3d75a5(_0x26479c['result']['message']);}})[_0x604f('0x11')](function(_0x17d9d4){logger['error'](_0x604f('0xb'),_0x3b5a52,_0x17d9d4);_0x4784e5(_0x17d9d4);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 19856bc..f15b1ff 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 _0x7705=['../../components/auth/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x104112,_0x1c0497){var _0x1c55a6=function(_0x1df724){while(--_0x1df724){_0x104112['push'](_0x104112['shift']());}};_0x1c55a6(++_0x1c0497);}(_0x7705,0xd2));var _0x5770=function(_0x48fd10,_0x30a0d8){_0x48fd10=_0x48fd10-0x0;var _0x5610d6=_0x7705[_0x48fd10];return _0x5610d6;};'use strict';var multer=require(_0x5770('0x0'));var util=require(_0x5770('0x1'));var path=require(_0x5770('0x2'));var timeout=require(_0x5770('0x3'));var express=require(_0x5770('0x4'));var router=express[_0x5770('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5770('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5770('0x7'));router[_0x5770('0x8')]('/',auth[_0x5770('0x9')](),controller[_0x5770('0xa')]);router[_0x5770('0x8')](_0x5770('0xb'),auth['isAuthenticated'](),controller[_0x5770('0xc')]);router[_0x5770('0xd')]('/',auth['isAuthenticated'](),controller[_0x5770('0xe')]);router[_0x5770('0xf')](_0x5770('0xb'),auth[_0x5770('0x9')](),controller[_0x5770('0x10')]);router['delete']('/:id',auth[_0x5770('0x9')](),controller['destroy']);module[_0x5770('0x11')]=router; \ No newline at end of file +var _0x9e87=['show','post','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','isAuthenticated','index','get','/:id'];(function(_0x2e0bfa,_0x35ded8){var _0x479a71=function(_0x4eb4ae){while(--_0x4eb4ae){_0x2e0bfa['push'](_0x2e0bfa['shift']());}};_0x479a71(++_0x35ded8);}(_0x9e87,0x195));var _0x79e8=function(_0x78699f,_0x9b5e13){_0x78699f=_0x78699f-0x0;var _0x26bfc7=_0x9e87[_0x78699f];return _0x26bfc7;};'use strict';var multer=require(_0x79e8('0x0'));var util=require(_0x79e8('0x1'));var path=require(_0x79e8('0x2'));var timeout=require(_0x79e8('0x3'));var express=require(_0x79e8('0x4'));var router=express[_0x79e8('0x5')]();var fs_extra=require(_0x79e8('0x6'));var auth=require(_0x79e8('0x7'));var interaction=require(_0x79e8('0x8'));var config=require(_0x79e8('0x9'));var controller=require(_0x79e8('0xa'));router['get']('/',auth[_0x79e8('0xb')](),controller[_0x79e8('0xc')]);router[_0x79e8('0xd')](_0x79e8('0xe'),auth['isAuthenticated'](),controller[_0x79e8('0xf')]);router[_0x79e8('0x10')]('/',auth[_0x79e8('0xb')](),controller['create']);router[_0x79e8('0x11')](_0x79e8('0xe'),auth[_0x79e8('0xb')](),controller[_0x79e8('0x12')]);router[_0x79e8('0x13')](_0x79e8('0xe'),auth[_0x79e8('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 4f48881..c70b262 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 _0xbc6c=['keyValue','string','STRING','ENUM','sequelize','variable','customVariable'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0xbc6c,0xac));var _0xcbc6=function(_0x15ef69,_0x146e0b){_0x15ef69=_0x15ef69-0x0;var _0x44cf3b=_0xbc6c[_0x15ef69];return _0x44cf3b;};'use strict';var Sequelize=require(_0xcbc6('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0xcbc6('0x1'),_0xcbc6('0x2'),_0xcbc6('0x3'),'picklist'),'defaultValue':_0xcbc6('0x4')},'content':{'type':Sequelize[_0xcbc6('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xcbc6('0x6')]('string',_0xcbc6('0x1'),'customVariable')},'keyContent':{'type':Sequelize[_0xcbc6('0x5')]},'idField':{'type':Sequelize[_0xcbc6('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcbc6('0x5')]}}; \ No newline at end of file +var _0x548d=['ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','exports'];(function(_0x1daa13,_0x28a05f){var _0x39097d=function(_0x550364){while(--_0x550364){_0x1daa13['push'](_0x1daa13['shift']());}};_0x39097d(++_0x28a05f);}(_0x548d,0x1e8));var _0xd548=function(_0x35d8be,_0x530a24){_0x35d8be=_0x35d8be-0x0;var _0x25ec32=_0x548d[_0x35d8be];return _0x25ec32;};'use strict';var Sequelize=require(_0xd548('0x0'));module[_0xd548('0x1')]={'type':{'type':Sequelize[_0xd548('0x2')](_0xd548('0x3'),_0xd548('0x4'),'customVariable',_0xd548('0x5'),_0xd548('0x6')),'defaultValue':_0xd548('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xd548('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xd548('0x3'),_0xd548('0x4'),_0xd548('0x8'))},'keyContent':{'type':Sequelize[_0xd548('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd548('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index cbf574b..1bc85c8 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 _0x6e6c=['set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','to-csv','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/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6e6c[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0xc6e6('0x0'));var rimraf=require(_0xc6e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc6e6('0x2'));var rp=require(_0xc6e6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc6e6('0x4'));var util=require('util');var path=require(_0xc6e6('0x5'));var sox=require('sox');var csv=require(_0xc6e6('0x6'));var ejs=require(_0xc6e6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc6e6('0x8'));var squel=require(_0xc6e6('0x9'));var crypto=require('crypto');var jsforce=require(_0xc6e6('0xa'));var deskjs=require(_0xc6e6('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc6e6('0xc'));var Papa=require('papaparse');var Redis=require(_0xc6e6('0xd'));var authService=require(_0xc6e6('0xe'));var qs=require(_0xc6e6('0xf'));var as=require(_0xc6e6('0x10'));var hardwareService=require(_0xc6e6('0x11'));var logger=require(_0xc6e6('0x12'))(_0xc6e6('0x13'));var utils=require(_0xc6e6('0x14'));var config=require(_0xc6e6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc6e6('0x16'))['db'];function respondWithStatusCode(_0x525d60,_0x3a30ce){_0x3a30ce=_0x3a30ce||0xcc;return function(_0x314d0f){if(_0x314d0f){return _0x525d60[_0xc6e6('0x17')](_0x3a30ce);}return _0x525d60[_0xc6e6('0x18')](_0x3a30ce)['end']();};}function respondWithResult(_0x149ac6,_0x2bfe7d){_0x2bfe7d=_0x2bfe7d||0xc8;return function(_0x13be73){if(_0x13be73){return _0x149ac6[_0xc6e6('0x18')](_0x2bfe7d)[_0xc6e6('0x19')](_0x13be73);}};}function respondWithFilteredResult(_0x4cdf15,_0x413cf8){return function(_0x178b34){if(_0x178b34){var _0x569474=typeof _0x413cf8[_0xc6e6('0x1a')]===_0xc6e6('0x1b')&&typeof _0x413cf8[_0xc6e6('0x1c')]==='undefined';var _0x51fd7c=_0x178b34['count'];var _0x3a1ccc=_0x569474?0x0:_0x413cf8['offset'];var _0x46e58f=_0x569474?_0x178b34[_0xc6e6('0x1d')]:_0x413cf8[_0xc6e6('0x1a')]+_0x413cf8[_0xc6e6('0x1c')];var _0x19e1e4;if(_0x46e58f>=_0x51fd7c){_0x46e58f=_0x51fd7c;_0x19e1e4=0xc8;}else{_0x19e1e4=0xce;}_0x4cdf15[_0xc6e6('0x18')](_0x19e1e4);return _0x4cdf15[_0xc6e6('0x1e')](_0xc6e6('0x1f'),_0x3a1ccc+'-'+_0x46e58f+'/'+_0x51fd7c)[_0xc6e6('0x19')](_0x178b34);}return null;};}function patchUpdates(_0x3d734d){return function(_0x4a36b6){try{jsonpatch[_0xc6e6('0x20')](_0x4a36b6,_0x3d734d,!![]);}catch(_0x4ad70e){return BPromise[_0xc6e6('0x21')](_0x4ad70e);}return _0x4a36b6[_0xc6e6('0x22')]();};}function saveUpdates(_0x2be6fc,_0x2f69f1){return function(_0x4f1d68){if(_0x4f1d68){return _0x4f1d68[_0xc6e6('0x23')](_0x2be6fc)[_0xc6e6('0x24')](function(_0x3a96df){return _0x3a96df;});}return null;};}function removeEntity(_0x36ebfa,_0x107561){return function(_0x4c35ae){if(_0x4c35ae){return _0x4c35ae[_0xc6e6('0x25')]()['then'](function(){_0x36ebfa[_0xc6e6('0x18')](0xcc)[_0xc6e6('0x26')]();});}};}function handleEntityNotFound(_0x2e5e0e,_0x64e1dc){return function(_0x53a1bf){if(!_0x53a1bf){_0x2e5e0e[_0xc6e6('0x17')](0x194);}return _0x53a1bf;};}function handleError(_0x5a5e47,_0x28577b){_0x28577b=_0x28577b||0x1f4;return function(_0x534745){logger[_0xc6e6('0x27')](_0x534745[_0xc6e6('0x28')]);if(_0x534745[_0xc6e6('0x29')]){delete _0x534745[_0xc6e6('0x29')];}_0x5a5e47[_0xc6e6('0x18')](_0x28577b)['send'](_0x534745);};}exports[_0xc6e6('0x2a')]=function(_0x1501bd,_0x166313){var _0x1af05c={},_0x4d1284={},_0x34ae96={'count':0x0,'rows':[]};var _0x50b735=_[_0xc6e6('0x2b')](db[_0xc6e6('0x2c')][_0xc6e6('0x2d')],function(_0xc578b3){return{'name':_0xc578b3[_0xc6e6('0x2e')],'type':_0xc578b3[_0xc6e6('0x2f')][_0xc6e6('0x30')]};});_0x4d1284[_0xc6e6('0x31')]=_[_0xc6e6('0x2b')](_0x50b735,_0xc6e6('0x29'));_0x4d1284[_0xc6e6('0x32')]=_[_0xc6e6('0x33')](_0x1501bd[_0xc6e6('0x32')]);_0x4d1284[_0xc6e6('0x34')]=_[_0xc6e6('0x35')](_0x4d1284[_0xc6e6('0x31')],_0x4d1284[_0xc6e6('0x32')]);_0x1af05c['attributes']=_[_0xc6e6('0x35')](_0x4d1284[_0xc6e6('0x31')],qs['fields'](_0x1501bd['query'][_0xc6e6('0x36')]));_0x1af05c[_0xc6e6('0x37')]=_0x1af05c[_0xc6e6('0x37')][_0xc6e6('0x38')]?_0x1af05c[_0xc6e6('0x37')]:_0x4d1284[_0xc6e6('0x31')];if(!_0x1501bd['query'][_0xc6e6('0x39')](_0xc6e6('0x3a'))){_0x1af05c[_0xc6e6('0x1c')]=qs['limit'](_0x1501bd['query'][_0xc6e6('0x1c')]);_0x1af05c[_0xc6e6('0x1a')]=qs[_0xc6e6('0x1a')](_0x1501bd[_0xc6e6('0x32')]['offset']);}_0x1af05c['order']=qs[_0xc6e6('0x3b')](_0x1501bd['query'][_0xc6e6('0x3b')]);_0x1af05c['where']=qs[_0xc6e6('0x34')](_[_0xc6e6('0x3c')](_0x1501bd[_0xc6e6('0x32')],_0x4d1284[_0xc6e6('0x34')]),_0x50b735);if(_0x1501bd['query']['filter']){_0x1af05c[_0xc6e6('0x3d')]=_[_0xc6e6('0x3e')](_0x1af05c[_0xc6e6('0x3d')],{'$or':_[_0xc6e6('0x2b')](_0x50b735,function(_0x4bb732){if(_0x4bb732['type']!==_0xc6e6('0x3f')){var _0x1326c7={};_0x1326c7[_0x4bb732[_0xc6e6('0x29')]]={'$like':'%'+_0x1501bd[_0xc6e6('0x32')]['filter']+'%'};return _0x1326c7;}})});}_0x1af05c=_[_0xc6e6('0x3e')]({},_0x1af05c,_0x1501bd[_0xc6e6('0x40')]);var _0x5ddab4={'where':_0x1af05c['where']};return db[_0xc6e6('0x2c')]['count'](_0x5ddab4)[_0xc6e6('0x24')](function(_0x3817fc){_0x34ae96['count']=_0x3817fc;if(_0x1501bd[_0xc6e6('0x32')]['includeAll']){_0x1af05c[_0xc6e6('0x41')]=[{'all':!![]}];}return db['FreshdeskField'][_0xc6e6('0x42')](_0x1af05c);})[_0xc6e6('0x24')](function(_0x247076){_0x34ae96[_0xc6e6('0x43')]=_0x247076;return _0x34ae96;})[_0xc6e6('0x24')](respondWithFilteredResult(_0x166313,_0x1af05c))[_0xc6e6('0x44')](handleError(_0x166313,null));};exports[_0xc6e6('0x45')]=function(_0x69766,_0x5ecf6c){var _0x5722db={'raw':!![],'where':{'id':_0x69766[_0xc6e6('0x46')]['id']}},_0x3e3da6={};_0x3e3da6[_0xc6e6('0x31')]=_[_0xc6e6('0x33')](db['FreshdeskField'][_0xc6e6('0x2d')]);_0x3e3da6[_0xc6e6('0x32')]=_[_0xc6e6('0x33')](_0x69766[_0xc6e6('0x32')]);_0x3e3da6['filters']=_[_0xc6e6('0x35')](_0x3e3da6[_0xc6e6('0x31')],_0x3e3da6[_0xc6e6('0x32')]);_0x5722db[_0xc6e6('0x37')]=_[_0xc6e6('0x35')](_0x3e3da6['model'],qs[_0xc6e6('0x36')](_0x69766['query'][_0xc6e6('0x36')]));_0x5722db['attributes']=_0x5722db[_0xc6e6('0x37')][_0xc6e6('0x38')]?_0x5722db[_0xc6e6('0x37')]:_0x3e3da6[_0xc6e6('0x31')];if(_0x69766[_0xc6e6('0x32')][_0xc6e6('0x47')]){_0x5722db[_0xc6e6('0x41')]=[{'all':!![]}];}_0x5722db=_[_0xc6e6('0x3e')]({},_0x5722db,_0x69766['options']);return db[_0xc6e6('0x2c')][_0xc6e6('0x48')](_0x5722db)[_0xc6e6('0x24')](handleEntityNotFound(_0x5ecf6c,null))['then'](respondWithResult(_0x5ecf6c,null))[_0xc6e6('0x44')](handleError(_0x5ecf6c,null));};exports[_0xc6e6('0x49')]=function(_0x38ecc3,_0x42ed90){return db[_0xc6e6('0x2c')][_0xc6e6('0x49')](_0x38ecc3[_0xc6e6('0x4a')],{})[_0xc6e6('0x24')](respondWithResult(_0x42ed90,0xc9))[_0xc6e6('0x44')](handleError(_0x42ed90,null));};exports[_0xc6e6('0x23')]=function(_0x3bfe85,_0x470167){if(_0x3bfe85[_0xc6e6('0x4a')]['id']){delete _0x3bfe85[_0xc6e6('0x4a')]['id'];}return db['FreshdeskField'][_0xc6e6('0x48')]({'where':{'id':_0x3bfe85['params']['id']}})[_0xc6e6('0x24')](handleEntityNotFound(_0x470167,null))[_0xc6e6('0x24')](saveUpdates(_0x3bfe85['body'],null))['then'](respondWithResult(_0x470167,null))['catch'](handleError(_0x470167,null));};exports['destroy']=function(_0x531dca,_0x3edc16){return db[_0xc6e6('0x2c')][_0xc6e6('0x48')]({'where':{'id':_0x531dca[_0xc6e6('0x46')]['id']}})[_0xc6e6('0x24')](handleEntityNotFound(_0x3edc16,null))['then'](removeEntity(_0x3edc16,null))['catch'](handleError(_0x3edc16,null));}; \ No newline at end of file +var _0xde2c=['../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','set','Content-Range','save','update','destroy','error','name','send','index','map','FreshdeskField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','then','show','find','create','body','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x408d22,_0x53eef9){var _0x58effd=function(_0x4ab8ee){while(--_0x4ab8ee){_0x408d22['push'](_0x408d22['shift']());}};_0x58effd(++_0x53eef9);}(_0xde2c,0x7f));var _0xcde2=function(_0x152449,_0x49f41d){_0x152449=_0x152449-0x0;var _0x5b58b2=_0xde2c[_0x152449];return _0x5b58b2;};'use strict';var emlformat=require(_0xcde2('0x0'));var rimraf=require(_0xcde2('0x1'));var zipdir=require(_0xcde2('0x2'));var jsonpatch=require(_0xcde2('0x3'));var rp=require(_0xcde2('0x4'));var moment=require(_0xcde2('0x5'));var BPromise=require(_0xcde2('0x6'));var Mustache=require(_0xcde2('0x7'));var util=require('util');var path=require(_0xcde2('0x8'));var sox=require(_0xcde2('0x9'));var csv=require(_0xcde2('0xa'));var ejs=require(_0xcde2('0xb'));var fs=require('fs');var fs_extra=require(_0xcde2('0xc'));var _=require('lodash');var squel=require(_0xcde2('0xd'));var crypto=require(_0xcde2('0xe'));var jsforce=require(_0xcde2('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcde2('0x10'));var Papa=require(_0xcde2('0x11'));var Redis=require('ioredis');var authService=require(_0xcde2('0x12'));var qs=require(_0xcde2('0x13'));var as=require(_0xcde2('0x14'));var hardwareService=require(_0xcde2('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xcde2('0x16'));var config=require(_0xcde2('0x17'));var licenseUtil=require(_0xcde2('0x18'));var db=require(_0xcde2('0x19'))['db'];function respondWithStatusCode(_0x932b90,_0x1ea4bb){_0x1ea4bb=_0x1ea4bb||0xcc;return function(_0x599294){if(_0x599294){return _0x932b90[_0xcde2('0x1a')](_0x1ea4bb);}return _0x932b90['status'](_0x1ea4bb)[_0xcde2('0x1b')]();};}function respondWithResult(_0x4f0ac9,_0x4b0e0e){_0x4b0e0e=_0x4b0e0e||0xc8;return function(_0x34e079){if(_0x34e079){return _0x4f0ac9[_0xcde2('0x1c')](_0x4b0e0e)[_0xcde2('0x1d')](_0x34e079);}};}function respondWithFilteredResult(_0x19b54b,_0x11665c){return function(_0x5312c7){if(_0x5312c7){var _0x39b023=typeof _0x11665c['offset']===_0xcde2('0x1e')&&typeof _0x11665c[_0xcde2('0x1f')]===_0xcde2('0x1e');var _0x1f1858=_0x5312c7['count'];var _0x4fd5aa=_0x39b023?0x0:_0x11665c['offset'];var _0x2b4468=_0x39b023?_0x5312c7['count']:_0x11665c[_0xcde2('0x20')]+_0x11665c[_0xcde2('0x1f')];var _0x252372;if(_0x2b4468>=_0x1f1858){_0x2b4468=_0x1f1858;_0x252372=0xc8;}else{_0x252372=0xce;}_0x19b54b['status'](_0x252372);return _0x19b54b[_0xcde2('0x21')](_0xcde2('0x22'),_0x4fd5aa+'-'+_0x2b4468+'/'+_0x1f1858)[_0xcde2('0x1d')](_0x5312c7);}return null;};}function patchUpdates(_0x3c1d7e){return function(_0x43df7a){try{jsonpatch['apply'](_0x43df7a,_0x3c1d7e,!![]);}catch(_0x4bce90){return BPromise['reject'](_0x4bce90);}return _0x43df7a[_0xcde2('0x23')]();};}function saveUpdates(_0x3e5170,_0x2c9562){return function(_0x4063d4){if(_0x4063d4){return _0x4063d4[_0xcde2('0x24')](_0x3e5170)['then'](function(_0x1104b8){return _0x1104b8;});}return null;};}function removeEntity(_0x52368b,_0x280d8c){return function(_0xb2123c){if(_0xb2123c){return _0xb2123c[_0xcde2('0x25')]()['then'](function(){_0x52368b['status'](0xcc)[_0xcde2('0x1b')]();});}};}function handleEntityNotFound(_0x207a12,_0x3e8aaf){return function(_0x217ec9){if(!_0x217ec9){_0x207a12[_0xcde2('0x1a')](0x194);}return _0x217ec9;};}function handleError(_0x5a5b92,_0x2d1d17){_0x2d1d17=_0x2d1d17||0x1f4;return function(_0x45275a){logger[_0xcde2('0x26')](_0x45275a['stack']);if(_0x45275a[_0xcde2('0x27')]){delete _0x45275a[_0xcde2('0x27')];}_0x5a5b92[_0xcde2('0x1c')](_0x2d1d17)[_0xcde2('0x28')](_0x45275a);};}exports[_0xcde2('0x29')]=function(_0x5b2b7,_0x40b12c){var _0x3e492f={},_0x5bf1e6={},_0x3c3c01={'count':0x0,'rows':[]};var _0x4a0826=_[_0xcde2('0x2a')](db[_0xcde2('0x2b')][_0xcde2('0x2c')],function(_0x49cb58){return{'name':_0x49cb58[_0xcde2('0x2d')],'type':_0x49cb58[_0xcde2('0x2e')]['key']};});_0x5bf1e6[_0xcde2('0x2f')]=_[_0xcde2('0x2a')](_0x4a0826,_0xcde2('0x27'));_0x5bf1e6[_0xcde2('0x30')]=_[_0xcde2('0x31')](_0x5b2b7[_0xcde2('0x30')]);_0x5bf1e6[_0xcde2('0x32')]=_[_0xcde2('0x33')](_0x5bf1e6['model'],_0x5bf1e6[_0xcde2('0x30')]);_0x3e492f[_0xcde2('0x34')]=_[_0xcde2('0x33')](_0x5bf1e6[_0xcde2('0x2f')],qs['fields'](_0x5b2b7[_0xcde2('0x30')][_0xcde2('0x35')]));_0x3e492f[_0xcde2('0x34')]=_0x3e492f[_0xcde2('0x34')]['length']?_0x3e492f[_0xcde2('0x34')]:_0x5bf1e6[_0xcde2('0x2f')];if(!_0x5b2b7[_0xcde2('0x30')][_0xcde2('0x36')]('nolimit')){_0x3e492f[_0xcde2('0x1f')]=qs[_0xcde2('0x1f')](_0x5b2b7[_0xcde2('0x30')][_0xcde2('0x1f')]);_0x3e492f[_0xcde2('0x20')]=qs['offset'](_0x5b2b7[_0xcde2('0x30')][_0xcde2('0x20')]);}_0x3e492f[_0xcde2('0x37')]=qs[_0xcde2('0x38')](_0x5b2b7['query']['sort']);_0x3e492f[_0xcde2('0x39')]=qs[_0xcde2('0x32')](_[_0xcde2('0x3a')](_0x5b2b7[_0xcde2('0x30')],_0x5bf1e6[_0xcde2('0x32')]),_0x4a0826);if(_0x5b2b7[_0xcde2('0x30')][_0xcde2('0x3b')]){_0x3e492f[_0xcde2('0x39')]=_[_0xcde2('0x3c')](_0x3e492f['where'],{'$or':_[_0xcde2('0x2a')](_0x4a0826,function(_0x766279){if(_0x766279[_0xcde2('0x2e')]!==_0xcde2('0x3d')){var _0x2a73df={};_0x2a73df[_0x766279['name']]={'$like':'%'+_0x5b2b7['query'][_0xcde2('0x3b')]+'%'};return _0x2a73df;}})});}_0x3e492f=_[_0xcde2('0x3c')]({},_0x3e492f,_0x5b2b7[_0xcde2('0x3e')]);var _0x383899={'where':_0x3e492f[_0xcde2('0x39')]};return db[_0xcde2('0x2b')]['count'](_0x383899)['then'](function(_0x5160c2){_0x3c3c01[_0xcde2('0x3f')]=_0x5160c2;if(_0x5b2b7[_0xcde2('0x30')][_0xcde2('0x40')]){_0x3e492f[_0xcde2('0x41')]=[{'all':!![]}];}return db[_0xcde2('0x2b')][_0xcde2('0x42')](_0x3e492f);})[_0xcde2('0x43')](function(_0x49b862){_0x3c3c01['rows']=_0x49b862;return _0x3c3c01;})[_0xcde2('0x43')](respondWithFilteredResult(_0x40b12c,_0x3e492f))['catch'](handleError(_0x40b12c,null));};exports[_0xcde2('0x44')]=function(_0x4fc7bf,_0x1126b2){var _0x3239a0={'raw':!![],'where':{'id':_0x4fc7bf['params']['id']}},_0x2cf372={};_0x2cf372[_0xcde2('0x2f')]=_['keys'](db[_0xcde2('0x2b')][_0xcde2('0x2c')]);_0x2cf372[_0xcde2('0x30')]=_[_0xcde2('0x31')](_0x4fc7bf[_0xcde2('0x30')]);_0x2cf372[_0xcde2('0x32')]=_['intersection'](_0x2cf372['model'],_0x2cf372[_0xcde2('0x30')]);_0x3239a0['attributes']=_['intersection'](_0x2cf372[_0xcde2('0x2f')],qs['fields'](_0x4fc7bf[_0xcde2('0x30')][_0xcde2('0x35')]));_0x3239a0['attributes']=_0x3239a0[_0xcde2('0x34')]['length']?_0x3239a0['attributes']:_0x2cf372[_0xcde2('0x2f')];if(_0x4fc7bf[_0xcde2('0x30')]['includeAll']){_0x3239a0[_0xcde2('0x41')]=[{'all':!![]}];}_0x3239a0=_['merge']({},_0x3239a0,_0x4fc7bf[_0xcde2('0x3e')]);return db[_0xcde2('0x2b')][_0xcde2('0x45')](_0x3239a0)[_0xcde2('0x43')](handleEntityNotFound(_0x1126b2,null))[_0xcde2('0x43')](respondWithResult(_0x1126b2,null))['catch'](handleError(_0x1126b2,null));};exports[_0xcde2('0x46')]=function(_0x3e4fc0,_0x40d14b){return db[_0xcde2('0x2b')]['create'](_0x3e4fc0['body'],{})[_0xcde2('0x43')](respondWithResult(_0x40d14b,0xc9))['catch'](handleError(_0x40d14b,null));};exports[_0xcde2('0x24')]=function(_0x3e9e79,_0x381bd4){if(_0x3e9e79[_0xcde2('0x47')]['id']){delete _0x3e9e79[_0xcde2('0x47')]['id'];}return db[_0xcde2('0x2b')]['find']({'where':{'id':_0x3e9e79[_0xcde2('0x48')]['id']}})['then'](handleEntityNotFound(_0x381bd4,null))[_0xcde2('0x43')](saveUpdates(_0x3e9e79['body'],null))[_0xcde2('0x43')](respondWithResult(_0x381bd4,null))[_0xcde2('0x49')](handleError(_0x381bd4,null));};exports[_0xcde2('0x25')]=function(_0x16cddb,_0x446cf0){return db[_0xcde2('0x2b')]['find']({'where':{'id':_0x16cddb[_0xcde2('0x48')]['id']}})['then'](handleEntityNotFound(_0x446cf0,null))[_0xcde2('0x43')](removeEntity(_0x446cf0,null))[_0xcde2('0x49')](handleError(_0x446cf0,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 3fcae3e..bf0aa8e 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 _0x659d=['path','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','util','../../config/logger','moment','request-promise'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x659d,0x64));var _0xd659=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x659d[_0x6cf19c];return _0xce14f3;};'use strict';var _=require('lodash');var util=require(_0xd659('0x0'));var logger=require(_0xd659('0x1'))('api');var moment=require(_0xd659('0x2'));var BPromise=require('bluebird');var rp=require(_0xd659('0x3'));var fs=require('fs');var path=require(_0xd659('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd659('0x5'));module[_0xd659('0x6')]=function(_0x1a63c2,_0x3ab055){return _0x1a63c2[_0xd659('0x7')](_0xd659('0x8'),attributes,{'tableName':_0xd659('0x9'),'paranoid':![],'indexes':[{'name':_0xd659('0xa'),'fields':[_0xd659('0xb'),_0xd659('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb223=['freshdesk_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields'];(function(_0x2f443e,_0x423c28){var _0x1def60=function(_0x11f64f){while(--_0x11f64f){_0x2f443e['push'](_0x2f443e['shift']());}};_0x1def60(++_0x423c28);}(_0xb223,0x157));var _0x3b22=function(_0x78bdbc,_0x193a0b){_0x78bdbc=_0x78bdbc-0x0;var _0xa63334=_0xb223[_0x78bdbc];return _0xa63334;};'use strict';var _=require(_0x3b22('0x0'));var util=require(_0x3b22('0x1'));var logger=require('../../config/logger')(_0x3b22('0x2'));var moment=require(_0x3b22('0x3'));var BPromise=require(_0x3b22('0x4'));var rp=require(_0x3b22('0x5'));var fs=require('fs');var path=require(_0x3b22('0x6'));var rimraf=require(_0x3b22('0x7'));var config=require(_0x3b22('0x8'));var attributes=require(_0x3b22('0x9'));module[_0x3b22('0xa')]=function(_0xcf32b9,_0x58096f){return _0xcf32b9[_0x3b22('0xb')](_0x3b22('0xc'),attributes,{'tableName':_0x3b22('0xd'),'paranoid':![],'indexes':[{'name':_0x3b22('0xe'),'fields':[_0x3b22('0xf'),_0x3b22('0x10')],'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 d33d2cb..f48848a 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 _0x253c=['../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3fda35,_0x9f0225){var _0x41c7c6=function(_0x4183ae){while(--_0x4183ae){_0x3fda35['push'](_0x3fda35['shift']());}};_0x41c7c6(++_0x9f0225);}(_0x253c,0xb0));var _0xc253=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0x253c[_0x580647];return _0x5f0792;};'use strict';var _=require(_0xc253('0x0'));var util=require(_0xc253('0x1'));var moment=require('moment');var BPromise=require(_0xc253('0x2'));var rs=require(_0xc253('0x3'));var fs=require('fs');var Redis=require(_0xc253('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc253('0x5'));var logger=require(_0xc253('0x6'))(_0xc253('0x7'));var config=require(_0xc253('0x8'));var jayson=require(_0xc253('0x9'));var client=jayson[_0xc253('0xa')][_0xc253('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5610dd,_0x549326,_0xc76718){return new BPromise(function(_0x3e0c2e,_0x4c5115){return client[_0xc253('0xc')](_0x5610dd,_0xc76718)[_0xc253('0xd')](function(_0x3e5b64){logger[_0xc253('0xe')](_0xc253('0xf'),_0x549326,_0xc253('0x10'));logger[_0xc253('0x11')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x549326,'request\x20sent',JSON[_0xc253('0x12')](_0x3e5b64));if(_0x3e5b64[_0xc253('0x13')]){if(_0x3e5b64[_0xc253('0x13')][_0xc253('0x14')]===0x1f4){logger[_0xc253('0x13')](_0xc253('0xf'),_0x549326,_0x3e5b64[_0xc253('0x13')][_0xc253('0x15')]);return _0x4c5115(_0x3e5b64[_0xc253('0x13')][_0xc253('0x15')]);}logger[_0xc253('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x549326,_0x3e5b64[_0xc253('0x13')][_0xc253('0x15')]);return _0x3e0c2e(_0x3e5b64[_0xc253('0x13')][_0xc253('0x15')]);}else{logger[_0xc253('0xe')](_0xc253('0xf'),_0x549326,_0xc253('0x10'));_0x3e0c2e(_0x3e5b64['result'][_0xc253('0x15')]);}})[_0xc253('0x16')](function(_0x563bb7){logger[_0xc253('0x13')](_0xc253('0xf'),_0x549326,_0x563bb7);_0x4c5115(_0x563bb7);});});} \ No newline at end of file +var _0x3a8d=['stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s'];(function(_0x8bb4c1,_0x2d6e53){var _0x67a6e1=function(_0x1155e5){while(--_0x1155e5){_0x8bb4c1['push'](_0x8bb4c1['shift']());}};_0x67a6e1(++_0x2d6e53);}(_0x3a8d,0xec));var _0xd3a8=function(_0x553a87,_0x1d621f){_0x553a87=_0x553a87-0x0;var _0x12d1e6=_0x3a8d[_0x553a87];return _0x12d1e6;};'use strict';var _=require('lodash');var util=require(_0xd3a8('0x0'));var moment=require(_0xd3a8('0x1'));var BPromise=require(_0xd3a8('0x2'));var rs=require(_0xd3a8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd3a8('0x4'));var logger=require(_0xd3a8('0x5'))(_0xd3a8('0x6'));var config=require(_0xd3a8('0x7'));var jayson=require(_0xd3a8('0x8'));var client=jayson[_0xd3a8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1fa46a,_0x58aac5,_0x46170f){return new BPromise(function(_0x24d22c,_0x3d3db7){return client[_0xd3a8('0xa')](_0x1fa46a,_0x46170f)[_0xd3a8('0xb')](function(_0x58c4d7){logger[_0xd3a8('0xc')](_0xd3a8('0xd'),_0x58aac5,_0xd3a8('0xe'));logger[_0xd3a8('0xf')](_0xd3a8('0x10'),_0x58aac5,_0xd3a8('0xe'),JSON[_0xd3a8('0x11')](_0x58c4d7));if(_0x58c4d7[_0xd3a8('0x12')]){if(_0x58c4d7[_0xd3a8('0x12')][_0xd3a8('0x13')]===0x1f4){logger[_0xd3a8('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x58aac5,_0x58c4d7[_0xd3a8('0x12')]['message']);return _0x3d3db7(_0x58c4d7[_0xd3a8('0x12')][_0xd3a8('0x14')]);}logger['error'](_0xd3a8('0xd'),_0x58aac5,_0x58c4d7['error'][_0xd3a8('0x14')]);return _0x24d22c(_0x58c4d7['error'][_0xd3a8('0x14')]);}else{logger[_0xd3a8('0xc')](_0xd3a8('0xd'),_0x58aac5,'request\x20sent');_0x24d22c(_0x58c4d7[_0xd3a8('0x15')][_0xd3a8('0x14')]);}})[_0xd3a8('0x16')](function(_0x538d9e){logger[_0xd3a8('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x58aac5,_0x538d9e);_0x3d3db7(_0x538d9e);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 88abdcd..79f0499 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 _0xd64b=['update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/:id','isAuthenticated','show','/:id/configurations','/:id/fields','post','create','put'];(function(_0x285fff,_0x4fb54f){var _0x44e78f=function(_0x1b64c8){while(--_0x1b64c8){_0x285fff['push'](_0x285fff['shift']());}};_0x44e78f(++_0x4fb54f);}(_0xd64b,0xc1));var _0xbd64=function(_0x16ef9c,_0x55568f){_0x16ef9c=_0x16ef9c-0x0;var _0x38ad91=_0xd64b[_0x16ef9c];return _0x38ad91;};'use strict';var multer=require(_0xbd64('0x0'));var util=require('util');var path=require(_0xbd64('0x1'));var timeout=require('connect-timeout');var express=require(_0xbd64('0x2'));var router=express[_0xbd64('0x3')]();var fs_extra=require(_0xbd64('0x4'));var auth=require(_0xbd64('0x5'));var interaction=require(_0xbd64('0x6'));var config=require('../../config/environment');var controller=require('./intFreshsalesAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xbd64('0x7')]);router[_0xbd64('0x8')](_0xbd64('0x9'),auth[_0xbd64('0xa')](),controller[_0xbd64('0xb')]);router[_0xbd64('0x8')](_0xbd64('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xbd64('0x8')](_0xbd64('0xd'),auth[_0xbd64('0xa')](),controller['getFields']);router[_0xbd64('0xe')]('/',auth[_0xbd64('0xa')](),controller[_0xbd64('0xf')]);router[_0xbd64('0xe')]('/:id/configurations',auth[_0xbd64('0xa')](),controller['addConfiguration']);router[_0xbd64('0x10')](_0xbd64('0x9'),auth[_0xbd64('0xa')](),controller[_0xbd64('0x11')]);router[_0xbd64('0x12')](_0xbd64('0x9'),auth[_0xbd64('0xa')](),controller[_0xbd64('0x13')]);module[_0xbd64('0x14')]=router; \ No newline at end of file +var _0x1d2d=['multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','exports'];(function(_0x2b18e6,_0x4ff8ef){var _0x5d41bd=function(_0x412466){while(--_0x412466){_0x2b18e6['push'](_0x2b18e6['shift']());}};_0x5d41bd(++_0x4ff8ef);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x5a245c,_0x1d869b){_0x5a245c=_0x5a245c-0x0;var _0x2931e1=_0x1d2d[_0x5a245c];return _0x2931e1;};'use strict';var multer=require(_0xd1d2('0x0'));var util=require(_0xd1d2('0x1'));var path=require(_0xd1d2('0x2'));var timeout=require(_0xd1d2('0x3'));var express=require(_0xd1d2('0x4'));var router=express['Router']();var fs_extra=require(_0xd1d2('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd1d2('0x6'));var controller=require(_0xd1d2('0x7'));router[_0xd1d2('0x8')]('/',auth[_0xd1d2('0x9')](),controller[_0xd1d2('0xa')]);router[_0xd1d2('0x8')]('/:id',auth[_0xd1d2('0x9')](),controller[_0xd1d2('0xb')]);router[_0xd1d2('0x8')](_0xd1d2('0xc'),auth[_0xd1d2('0x9')](),controller[_0xd1d2('0xd')]);router[_0xd1d2('0x8')](_0xd1d2('0xe'),auth[_0xd1d2('0x9')](),controller[_0xd1d2('0xf')]);router[_0xd1d2('0x10')]('/',auth[_0xd1d2('0x9')](),controller[_0xd1d2('0x11')]);router['post'](_0xd1d2('0xc'),auth[_0xd1d2('0x9')](),controller[_0xd1d2('0x12')]);router[_0xd1d2('0x13')](_0xd1d2('0x14'),auth[_0xd1d2('0x9')](),controller[_0xd1d2('0x15')]);router[_0xd1d2('0x16')](_0xd1d2('0x14'),auth[_0xd1d2('0x9')](),controller['destroy']);module[_0xd1d2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 6994050..c7b86fd 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 _0x6a95=['exports','STRING','username','sequelize'];(function(_0x4cdbb2,_0x7c8b5a){var _0x2f6dba=function(_0x21ac2d){while(--_0x21ac2d){_0x4cdbb2['push'](_0x4cdbb2['shift']());}};_0x2f6dba(++_0x7c8b5a);}(_0x6a95,0x1db));var _0x56a9=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x6a95[_0x411add];return _0x238242;};'use strict';var Sequelize=require(_0x56a9('0x0'));module[_0x56a9('0x1')]={'name':{'type':Sequelize[_0x56a9('0x2')]},'description':{'type':Sequelize[_0x56a9('0x2')]},'username':{'type':Sequelize[_0x56a9('0x2')],'unique':_0x56a9('0x3')},'apiKey':{'type':Sequelize[_0x56a9('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x56a9('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x5f2f=['exports','STRING','username','sequelize'];(function(_0x279f56,_0x392730){var _0x27bf1e=function(_0x536f39){while(--_0x536f39){_0x279f56['push'](_0x279f56['shift']());}};_0x27bf1e(++_0x392730);}(_0x5f2f,0x73));var _0xf5f2=function(_0x52969d,_0x91226d){_0x52969d=_0x52969d-0x0;var _0x4970fe=_0x5f2f[_0x52969d];return _0x4970fe;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'name':{'type':Sequelize[_0xf5f2('0x2')]},'description':{'type':Sequelize[_0xf5f2('0x2')]},'username':{'type':Sequelize[_0xf5f2('0x2')],'unique':_0xf5f2('0x3')},'apiKey':{'type':Sequelize[_0xf5f2('0x2')]},'remoteUri':{'type':Sequelize[_0xf5f2('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 3be9ea6..14d2b08 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 _0x3e80=['error','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','update','then','destroy','stack','map','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','name','includeAll','include','FreshsalesAccount','findAll','rows','catch','show','params','length','options','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','FreshsalesField','getFields','remoteUri','apiKey','username','slice','substring','lastIndexOf','GET','format','%s%s','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','test'];(function(_0x43461f,_0x15ed32){var _0x102d6a=function(_0xc4911c){while(--_0xc4911c){_0x43461f['push'](_0x43461f['shift']());}};_0x102d6a(++_0x15ed32);}(_0x3e80,0x141));var _0x03e8=function(_0x33a694,_0x9b6640){_0x33a694=_0x33a694-0x0;var _0x41ff01=_0x3e80[_0x33a694];return _0x41ff01;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x03e8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x03e8('0x1'));var rp=require(_0x03e8('0x2'));var moment=require(_0x03e8('0x3'));var BPromise=require(_0x03e8('0x4'));var Mustache=require(_0x03e8('0x5'));var util=require(_0x03e8('0x6'));var path=require('path');var sox=require(_0x03e8('0x7'));var csv=require(_0x03e8('0x8'));var ejs=require(_0x03e8('0x9'));var fs=require('fs');var fs_extra=require(_0x03e8('0xa'));var _=require('lodash');var squel=require(_0x03e8('0xb'));var crypto=require(_0x03e8('0xc'));var jsforce=require(_0x03e8('0xd'));var deskjs=require(_0x03e8('0xe'));var toCsv=require(_0x03e8('0x8'));var querystring=require(_0x03e8('0xf'));var Papa=require('papaparse');var Redis=require(_0x03e8('0x10'));var authService=require(_0x03e8('0x11'));var qs=require(_0x03e8('0x12'));var as=require(_0x03e8('0x13'));var hardwareService=require(_0x03e8('0x14'));var logger=require(_0x03e8('0x15'))(_0x03e8('0x16'));var utils=require(_0x03e8('0x17'));var config=require(_0x03e8('0x18'));var licenseUtil=require(_0x03e8('0x19'));var db=require(_0x03e8('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x53190a,_0x5e1161){_0x5e1161=_0x5e1161||0xcc;return function(_0x58dca8){if(_0x58dca8){return _0x53190a[_0x03e8('0x1b')](_0x5e1161);}return _0x53190a[_0x03e8('0x1c')](_0x5e1161)[_0x03e8('0x1d')]();};}function respondWithResult(_0x16ab0e,_0x494898){_0x494898=_0x494898||0xc8;return function(_0x537a1f){if(_0x537a1f){return _0x16ab0e[_0x03e8('0x1c')](_0x494898)[_0x03e8('0x1e')](_0x537a1f);}};}function respondWithFilteredResult(_0xd4ecc2,_0x46a340){return function(_0x247616){if(_0x247616){var _0x447e03=typeof _0x46a340['offset']===_0x03e8('0x1f')&&typeof _0x46a340[_0x03e8('0x20')]===_0x03e8('0x1f');var _0x29a7ca=_0x247616[_0x03e8('0x21')];var _0x2ef6f6=_0x447e03?0x0:_0x46a340[_0x03e8('0x22')];var _0x4a0890=_0x447e03?_0x247616[_0x03e8('0x21')]:_0x46a340[_0x03e8('0x22')]+_0x46a340[_0x03e8('0x20')];var _0x2e30d8;if(_0x4a0890>=_0x29a7ca){_0x4a0890=_0x29a7ca;_0x2e30d8=0xc8;}else{_0x2e30d8=0xce;}_0xd4ecc2[_0x03e8('0x1c')](_0x2e30d8);return _0xd4ecc2[_0x03e8('0x23')]('Content-Range',_0x2ef6f6+'-'+_0x4a0890+'/'+_0x29a7ca)[_0x03e8('0x1e')](_0x247616);}return null;};}function patchUpdates(_0x77e2a3){return function(_0x4d609e){try{jsonpatch[_0x03e8('0x24')](_0x4d609e,_0x77e2a3,!![]);}catch(_0x500faa){return BPromise['reject'](_0x500faa);}return _0x4d609e['save']();};}function saveUpdates(_0x2a9f90,_0xd486b1){return function(_0x124146){if(_0x124146){return _0x124146[_0x03e8('0x25')](_0x2a9f90)[_0x03e8('0x26')](function(_0x3d219c){return _0x3d219c;});}return null;};}function removeEntity(_0x22ad5d,_0x400e0a){return function(_0x2abdf2){if(_0x2abdf2){return _0x2abdf2[_0x03e8('0x27')]()[_0x03e8('0x26')](function(){_0x22ad5d[_0x03e8('0x1c')](0xcc)[_0x03e8('0x1d')]();});}};}function handleEntityNotFound(_0x36d064,_0x204f6e){return function(_0xdba4aa){if(!_0xdba4aa){_0x36d064[_0x03e8('0x1b')](0x194);}return _0xdba4aa;};}function handleError(_0x2332c7,_0x403f94){_0x403f94=_0x403f94||0x1f4;return function(_0x34fa83){logger['error'](_0x34fa83[_0x03e8('0x28')]);if(_0x34fa83['name']){delete _0x34fa83['name'];}_0x2332c7[_0x03e8('0x1c')](_0x403f94)['send'](_0x34fa83);};}exports['index']=function(_0x5dfb4f,_0x34f93f){var _0xd6174e={},_0x45c8c6={},_0x90d506={'count':0x0,'rows':[]};var _0x49a591=_[_0x03e8('0x29')](db['FreshsalesAccount'][_0x03e8('0x2a')],function(_0x5bc470){return{'name':_0x5bc470[_0x03e8('0x2b')],'type':_0x5bc470['type'][_0x03e8('0x2c')]};});_0x45c8c6[_0x03e8('0x2d')]=_['map'](_0x49a591,'name');_0x45c8c6['query']=_[_0x03e8('0x2e')](_0x5dfb4f[_0x03e8('0x2f')]);_0x45c8c6['filters']=_['intersection'](_0x45c8c6['model'],_0x45c8c6[_0x03e8('0x2f')]);_0xd6174e['attributes']=_[_0x03e8('0x30')](_0x45c8c6[_0x03e8('0x2d')],qs[_0x03e8('0x31')](_0x5dfb4f[_0x03e8('0x2f')][_0x03e8('0x31')]));_0xd6174e[_0x03e8('0x32')]=_0xd6174e[_0x03e8('0x32')]['length']?_0xd6174e[_0x03e8('0x32')]:_0x45c8c6[_0x03e8('0x2d')];if(!_0x5dfb4f[_0x03e8('0x2f')][_0x03e8('0x33')](_0x03e8('0x34'))){_0xd6174e['limit']=qs['limit'](_0x5dfb4f[_0x03e8('0x2f')][_0x03e8('0x20')]);_0xd6174e[_0x03e8('0x22')]=qs[_0x03e8('0x22')](_0x5dfb4f[_0x03e8('0x2f')][_0x03e8('0x22')]);}_0xd6174e[_0x03e8('0x35')]=qs[_0x03e8('0x36')](_0x5dfb4f[_0x03e8('0x2f')][_0x03e8('0x36')]);_0xd6174e[_0x03e8('0x37')]=qs[_0x03e8('0x38')](_[_0x03e8('0x39')](_0x5dfb4f[_0x03e8('0x2f')],_0x45c8c6['filters']),_0x49a591);if(_0x5dfb4f['query'][_0x03e8('0x3a')]){_0xd6174e[_0x03e8('0x37')]=_[_0x03e8('0x3b')](_0xd6174e[_0x03e8('0x37')],{'$or':_['map'](_0x49a591,function(_0x63722){if(_0x63722['type']!==_0x03e8('0x3c')){var _0x400125={};_0x400125[_0x63722[_0x03e8('0x3d')]]={'$like':'%'+_0x5dfb4f[_0x03e8('0x2f')][_0x03e8('0x3a')]+'%'};return _0x400125;}})});}_0xd6174e=_[_0x03e8('0x3b')]({},_0xd6174e,_0x5dfb4f['options']);var _0x3ca958={'where':_0xd6174e['where']};return db['FreshsalesAccount']['count'](_0x3ca958)[_0x03e8('0x26')](function(_0x268010){_0x90d506[_0x03e8('0x21')]=_0x268010;if(_0x5dfb4f[_0x03e8('0x2f')][_0x03e8('0x3e')]){_0xd6174e[_0x03e8('0x3f')]=[{'all':!![]}];}return db[_0x03e8('0x40')][_0x03e8('0x41')](_0xd6174e);})['then'](function(_0x2f1c4e){_0x90d506[_0x03e8('0x42')]=_0x2f1c4e;return _0x90d506;})[_0x03e8('0x26')](respondWithFilteredResult(_0x34f93f,_0xd6174e))[_0x03e8('0x43')](handleError(_0x34f93f,null));};exports[_0x03e8('0x44')]=function(_0x191ea7,_0x351f25){var _0x2f6d38={'raw':![],'where':{'id':_0x191ea7[_0x03e8('0x45')]['id']}},_0x444cbd={};_0x444cbd[_0x03e8('0x2d')]=_[_0x03e8('0x2e')](db[_0x03e8('0x40')][_0x03e8('0x2a')]);_0x444cbd[_0x03e8('0x2f')]=_[_0x03e8('0x2e')](_0x191ea7['query']);_0x444cbd[_0x03e8('0x38')]=_[_0x03e8('0x30')](_0x444cbd[_0x03e8('0x2d')],_0x444cbd[_0x03e8('0x2f')]);_0x2f6d38['attributes']=_[_0x03e8('0x30')](_0x444cbd[_0x03e8('0x2d')],qs[_0x03e8('0x31')](_0x191ea7[_0x03e8('0x2f')][_0x03e8('0x31')]));_0x2f6d38[_0x03e8('0x32')]=_0x2f6d38[_0x03e8('0x32')][_0x03e8('0x46')]?_0x2f6d38['attributes']:_0x444cbd['model'];if(_0x191ea7[_0x03e8('0x2f')][_0x03e8('0x3e')]){_0x2f6d38[_0x03e8('0x3f')]=[{'all':!![]}];}_0x2f6d38=_['merge']({},_0x2f6d38,_0x191ea7[_0x03e8('0x47')]);return db[_0x03e8('0x40')][_0x03e8('0x48')](_0x2f6d38)[_0x03e8('0x26')](handleEntityNotFound(_0x351f25,null))[_0x03e8('0x26')](respondWithResult(_0x351f25,null))['catch'](handleError(_0x351f25,null));};exports['create']=function(_0x5f1c23,_0x4f1bac){return db['FreshsalesAccount'][_0x03e8('0x49')](_0x5f1c23[_0x03e8('0x4a')],{})[_0x03e8('0x26')](respondWithResult(_0x4f1bac,0xc9))[_0x03e8('0x43')](handleError(_0x4f1bac,null));};exports['update']=function(_0x52721b,_0x3cca3b){if(_0x52721b[_0x03e8('0x4a')]['id']){delete _0x52721b[_0x03e8('0x4a')]['id'];}return db[_0x03e8('0x40')][_0x03e8('0x48')]({'where':{'id':_0x52721b[_0x03e8('0x45')]['id']}})[_0x03e8('0x26')](handleEntityNotFound(_0x3cca3b,null))[_0x03e8('0x26')](saveUpdates(_0x52721b['body'],null))['then'](respondWithResult(_0x3cca3b,null))['catch'](handleError(_0x3cca3b,null));};exports[_0x03e8('0x27')]=function(_0x55ef06,_0x2810e6){return db[_0x03e8('0x40')][_0x03e8('0x48')]({'where':{'id':_0x55ef06[_0x03e8('0x45')]['id']}})[_0x03e8('0x26')](handleEntityNotFound(_0x2810e6,null))[_0x03e8('0x26')](removeEntity(_0x2810e6,null))[_0x03e8('0x43')](handleError(_0x2810e6,null));};exports[_0x03e8('0x4b')]=function(_0x34e598,_0x143511,_0x19f4b3){var _0x59e784={};var _0x1d427f={};var _0x557e03;var _0x434840;return db[_0x03e8('0x40')][_0x03e8('0x4c')]({'where':{'id':_0x34e598[_0x03e8('0x45')]['id']}})[_0x03e8('0x26')](handleEntityNotFound(_0x143511,null))[_0x03e8('0x26')](function(_0x184421){if(_0x184421){_0x557e03=_0x184421;_0x1d427f['model']=_[_0x03e8('0x2e')](db[_0x03e8('0x4d')]['rawAttributes']);_0x1d427f[_0x03e8('0x2f')]=_[_0x03e8('0x2e')](_0x34e598['query']);_0x1d427f[_0x03e8('0x38')]=_[_0x03e8('0x30')](_0x1d427f[_0x03e8('0x2d')],_0x1d427f[_0x03e8('0x2f')]);_0x59e784[_0x03e8('0x32')]=_[_0x03e8('0x30')](_0x1d427f['model'],qs[_0x03e8('0x31')](_0x34e598[_0x03e8('0x2f')][_0x03e8('0x31')]));_0x59e784[_0x03e8('0x32')]=_0x59e784[_0x03e8('0x32')][_0x03e8('0x46')]?_0x59e784[_0x03e8('0x32')]:_0x1d427f[_0x03e8('0x2d')];_0x59e784[_0x03e8('0x35')]=qs[_0x03e8('0x36')](_0x34e598[_0x03e8('0x2f')][_0x03e8('0x36')]);_0x59e784['where']=qs[_0x03e8('0x38')](_[_0x03e8('0x39')](_0x34e598[_0x03e8('0x2f')],_0x1d427f['filters']));if(_0x34e598[_0x03e8('0x2f')]['filter']){_0x59e784[_0x03e8('0x37')]=_['merge'](_0x59e784[_0x03e8('0x37')],{'$or':_[_0x03e8('0x29')](_0x59e784[_0x03e8('0x32')],function(_0x4874d2){var _0x2dd086={};_0x2dd086[_0x4874d2]={'$like':'%'+_0x34e598[_0x03e8('0x2f')][_0x03e8('0x3a')]+'%'};return _0x2dd086;})});}_0x59e784=_[_0x03e8('0x3b')]({},_0x59e784,_0x34e598[_0x03e8('0x47')]);return _0x557e03['getConfigurations'](_0x59e784);}})[_0x03e8('0x26')](function(_0xe0ced3){if(_0xe0ced3){_0x434840=_0xe0ced3[_0x03e8('0x46')];if(!_0x34e598[_0x03e8('0x2f')][_0x03e8('0x33')]('nolimit')){_0x59e784['limit']=qs['limit'](_0x34e598[_0x03e8('0x2f')][_0x03e8('0x20')]);_0x59e784['offset']=qs[_0x03e8('0x22')](_0x34e598[_0x03e8('0x2f')][_0x03e8('0x22')]);}return _0x557e03[_0x03e8('0x4b')](_0x59e784);}})['then'](function(_0x35161c){if(_0x35161c){return _0x35161c?{'count':_0x434840,'rows':_0x35161c}:null;}})['then'](respondWithResult(_0x143511,null))[_0x03e8('0x43')](handleError(_0x143511,null));};exports[_0x03e8('0x4e')]=function(_0x536998,_0x1ce9a5,_0x6dd567){if(_0x536998[_0x03e8('0x4a')]['id']){delete _0x536998['body']['id'];}return db[_0x03e8('0x40')]['findOne']({'where':{'id':_0x536998[_0x03e8('0x45')]['id']}})[_0x03e8('0x26')](handleEntityNotFound(_0x1ce9a5,null))[_0x03e8('0x26')](function(_0x33a0fe){if(_0x33a0fe){_0x536998['body'][_0x03e8('0x4f')]=_0x33a0fe['id'];_0x536998[_0x03e8('0x4a')][_0x03e8('0x50')]=integrations[_0x03e8('0x51')](_0x536998[_0x03e8('0x4a')][_0x03e8('0x52')],_0x536998[_0x03e8('0x4a')]['type']);_0x536998[_0x03e8('0x4a')][_0x03e8('0x53')]=integrations['getDescriptions'](_0x536998[_0x03e8('0x4a')]['channel'],_0x536998['body']['type']);return db['FreshsalesConfiguration'][_0x03e8('0x49')](_0x536998['body'],{'include':[{'model':db[_0x03e8('0x54')],'as':_0x03e8('0x50')},{'model':db[_0x03e8('0x54')],'as':_0x03e8('0x53')}]});}return null;})['then'](respondWithResult(_0x1ce9a5,null))[_0x03e8('0x43')](handleError(_0x1ce9a5,null));};exports[_0x03e8('0x55')]=function(_0x339fe3,_0x514d85,_0x4a98cc){var _0x3a29cf='';var _0x304942='';return db[_0x03e8('0x40')][_0x03e8('0x4c')]({'where':{'id':_0x339fe3['params']['id']},'attributes':['id','username',_0x03e8('0x56'),_0x03e8('0x57')]})[_0x03e8('0x26')](handleEntityNotFound(_0x514d85,null))[_0x03e8('0x26')](function(_0x395f3d){if(_0x395f3d){_0x304942=_0x395f3d[_0x03e8('0x58')];_0x3a29cf=_0x395f3d[_0x03e8('0x56')];var _0x315016=_0x395f3d['remoteUri'][_0x03e8('0x59')](-0x1);if(_0x315016==='/'){_0x3a29cf=_0x3a29cf[_0x03e8('0x5a')](0x0,_0x3a29cf[_0x03e8('0x5b')](_0x315016));}return rp({'method':_0x03e8('0x5c'),'uri':util[_0x03e8('0x5d')](_0x03e8('0x5e'),_0x3a29cf,'/api/selector/owners'),'headers':{'Authorization':_0x03e8('0x5f')+_0x395f3d[_0x03e8('0x57')]},'json':!![]});}})[_0x03e8('0x26')](function(_0x59e678){if(_0x59e678){var _0x46c328=_0x59e678[_0x03e8('0x60')];var _0x5a3f4f=![];var _0x226d27=null;for(_0x226d27=0x0;_0x226d27<_0x46c328[_0x03e8('0x46')];_0x226d27++){if(_0x46c328[_0x226d27]['email']===_0x304942){_0x5a3f4f=!![];}}if(_0x5a3f4f){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x03e8('0x61')});}}})[_0x03e8('0x26')](respondWithResult(_0x514d85,null))[_0x03e8('0x43')](function(_0x22afdb){var _0x2e5987=_0x339fe3[_0x03e8('0x2f')][_0x03e8('0x62')]?0x1f4:_0x22afdb['statusCode']||0x1f4;logger[_0x03e8('0x63')](_0x03e8('0x64'),_0x03e8('0x55'),_0x2e5987,JSON[_0x03e8('0x65')](_0x22afdb));delete _0x22afdb['name'];if(_0x2e5987===0x191){_0x2e5987=0x190;}_0x514d85[_0x03e8('0x1c')](_0x2e5987)[_0x03e8('0x66')](_0x339fe3[_0x03e8('0x2f')][_0x03e8('0x62')]?{'message':_0x03e8('0x67'),'statusCode':_0x22afdb[_0x03e8('0x68')]}:_0x22afdb);});}; \ No newline at end of file +var _0xb56d=['Subjects','getFields','remoteUri','apiKey','username','slice','substring','lastIndexOf','format','%s%s','users','Requested\x20Resource\x20not\x20Found','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','limit','undefined','count','Content-Range','apply','then','destroy','end','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','includeAll','include','findAll','rows','catch','show','params','options','create','update','body','find','getConfigurations','findOne','FreshsalesConfiguration','pick','AccountId','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField'];(function(_0x3de04d,_0x322289){var _0x32a6b9=function(_0x2b5ee9){while(--_0x2b5ee9){_0x3de04d['push'](_0x3de04d['shift']());}};_0x32a6b9(++_0x322289);}(_0xb56d,0x75));var _0xdb56=function(_0x227027,_0x423ef5){_0x227027=_0x227027-0x0;var _0x121bf5=_0xb56d[_0x227027];return _0x121bf5;};'use strict';var emlformat=require(_0xdb56('0x0'));var rimraf=require(_0xdb56('0x1'));var zipdir=require(_0xdb56('0x2'));var jsonpatch=require(_0xdb56('0x3'));var rp=require(_0xdb56('0x4'));var moment=require('moment');var BPromise=require(_0xdb56('0x5'));var Mustache=require('mustache');var util=require(_0xdb56('0x6'));var path=require(_0xdb56('0x7'));var sox=require(_0xdb56('0x8'));var csv=require(_0xdb56('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdb56('0xa'));var squel=require(_0xdb56('0xb'));var crypto=require('crypto');var jsforce=require(_0xdb56('0xc'));var deskjs=require(_0xdb56('0xd'));var toCsv=require(_0xdb56('0x9'));var querystring=require('querystring');var Papa=require(_0xdb56('0xe'));var Redis=require(_0xdb56('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xdb56('0x10'));var as=require(_0xdb56('0x11'));var hardwareService=require(_0xdb56('0x12'));var logger=require(_0xdb56('0x13'))('api');var utils=require(_0xdb56('0x14'));var config=require(_0xdb56('0x15'));var licenseUtil=require(_0xdb56('0x16'));var db=require(_0xdb56('0x17'))['db'];var integrations=require(_0xdb56('0x18'));function respondWithStatusCode(_0xae9a2a,_0x18cce6){_0x18cce6=_0x18cce6||0xcc;return function(_0xb5a17e){if(_0xb5a17e){return _0xae9a2a['sendStatus'](_0x18cce6);}return _0xae9a2a[_0xdb56('0x19')](_0x18cce6)['end']();};}function respondWithResult(_0xee5e2a,_0x5828b4){_0x5828b4=_0x5828b4||0xc8;return function(_0x2d5335){if(_0x2d5335){return _0xee5e2a['status'](_0x5828b4)[_0xdb56('0x1a')](_0x2d5335);}};}function respondWithFilteredResult(_0x305f53,_0x1b29c7){return function(_0x1b2054){if(_0x1b2054){var _0x4aba9d=typeof _0x1b29c7[_0xdb56('0x1b')]==='undefined'&&typeof _0x1b29c7[_0xdb56('0x1c')]===_0xdb56('0x1d');var _0x448860=_0x1b2054[_0xdb56('0x1e')];var _0x12f03d=_0x4aba9d?0x0:_0x1b29c7[_0xdb56('0x1b')];var _0xa3649f=_0x4aba9d?_0x1b2054[_0xdb56('0x1e')]:_0x1b29c7['offset']+_0x1b29c7[_0xdb56('0x1c')];var _0x3d9240;if(_0xa3649f>=_0x448860){_0xa3649f=_0x448860;_0x3d9240=0xc8;}else{_0x3d9240=0xce;}_0x305f53[_0xdb56('0x19')](_0x3d9240);return _0x305f53['set'](_0xdb56('0x1f'),_0x12f03d+'-'+_0xa3649f+'/'+_0x448860)[_0xdb56('0x1a')](_0x1b2054);}return null;};}function patchUpdates(_0x14ef5f){return function(_0x1e1ab6){try{jsonpatch[_0xdb56('0x20')](_0x1e1ab6,_0x14ef5f,!![]);}catch(_0x3b4865){return BPromise['reject'](_0x3b4865);}return _0x1e1ab6['save']();};}function saveUpdates(_0x3a2b7b,_0x4347b4){return function(_0xcaff29){if(_0xcaff29){return _0xcaff29['update'](_0x3a2b7b)[_0xdb56('0x21')](function(_0x4613da){return _0x4613da;});}return null;};}function removeEntity(_0x947bd7,_0x5e3a15){return function(_0x22ecc4){if(_0x22ecc4){return _0x22ecc4[_0xdb56('0x22')]()[_0xdb56('0x21')](function(){_0x947bd7[_0xdb56('0x19')](0xcc)[_0xdb56('0x23')]();});}};}function handleEntityNotFound(_0xc4a300,_0x313417){return function(_0x56aebb){if(!_0x56aebb){_0xc4a300['sendStatus'](0x194);}return _0x56aebb;};}function handleError(_0x3202d8,_0x487c80){_0x487c80=_0x487c80||0x1f4;return function(_0x3957e2){logger['error'](_0x3957e2['stack']);if(_0x3957e2['name']){delete _0x3957e2[_0xdb56('0x24')];}_0x3202d8['status'](_0x487c80)[_0xdb56('0x25')](_0x3957e2);};}exports[_0xdb56('0x26')]=function(_0x12a49a,_0xf6bd75){var _0xfd5073={},_0x346727={},_0x42d30e={'count':0x0,'rows':[]};var _0x210c10=_[_0xdb56('0x27')](db[_0xdb56('0x28')][_0xdb56('0x29')],function(_0x3c8234){return{'name':_0x3c8234[_0xdb56('0x2a')],'type':_0x3c8234[_0xdb56('0x2b')]['key']};});_0x346727[_0xdb56('0x2c')]=_[_0xdb56('0x27')](_0x210c10,_0xdb56('0x24'));_0x346727[_0xdb56('0x2d')]=_[_0xdb56('0x2e')](_0x12a49a[_0xdb56('0x2d')]);_0x346727[_0xdb56('0x2f')]=_['intersection'](_0x346727[_0xdb56('0x2c')],_0x346727[_0xdb56('0x2d')]);_0xfd5073[_0xdb56('0x30')]=_[_0xdb56('0x31')](_0x346727[_0xdb56('0x2c')],qs[_0xdb56('0x32')](_0x12a49a[_0xdb56('0x2d')][_0xdb56('0x32')]));_0xfd5073[_0xdb56('0x30')]=_0xfd5073[_0xdb56('0x30')][_0xdb56('0x33')]?_0xfd5073['attributes']:_0x346727[_0xdb56('0x2c')];if(!_0x12a49a['query'][_0xdb56('0x34')](_0xdb56('0x35'))){_0xfd5073[_0xdb56('0x1c')]=qs[_0xdb56('0x1c')](_0x12a49a[_0xdb56('0x2d')][_0xdb56('0x1c')]);_0xfd5073['offset']=qs[_0xdb56('0x1b')](_0x12a49a[_0xdb56('0x2d')]['offset']);}_0xfd5073[_0xdb56('0x36')]=qs['sort'](_0x12a49a['query'][_0xdb56('0x37')]);_0xfd5073['where']=qs[_0xdb56('0x2f')](_['pick'](_0x12a49a[_0xdb56('0x2d')],_0x346727[_0xdb56('0x2f')]),_0x210c10);if(_0x12a49a['query'][_0xdb56('0x38')]){_0xfd5073[_0xdb56('0x39')]=_[_0xdb56('0x3a')](_0xfd5073[_0xdb56('0x39')],{'$or':_['map'](_0x210c10,function(_0x2c67ad){if(_0x2c67ad[_0xdb56('0x2b')]!=='VIRTUAL'){var _0x32b0f5={};_0x32b0f5[_0x2c67ad[_0xdb56('0x24')]]={'$like':'%'+_0x12a49a['query'][_0xdb56('0x38')]+'%'};return _0x32b0f5;}})});}_0xfd5073=_['merge']({},_0xfd5073,_0x12a49a['options']);var _0x5ad5f1={'where':_0xfd5073['where']};return db[_0xdb56('0x28')][_0xdb56('0x1e')](_0x5ad5f1)[_0xdb56('0x21')](function(_0x5e70c5){_0x42d30e[_0xdb56('0x1e')]=_0x5e70c5;if(_0x12a49a[_0xdb56('0x2d')][_0xdb56('0x3b')]){_0xfd5073[_0xdb56('0x3c')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0xdb56('0x3d')](_0xfd5073);})['then'](function(_0x358231){_0x42d30e[_0xdb56('0x3e')]=_0x358231;return _0x42d30e;})['then'](respondWithFilteredResult(_0xf6bd75,_0xfd5073))[_0xdb56('0x3f')](handleError(_0xf6bd75,null));};exports[_0xdb56('0x40')]=function(_0x21232e,_0x2362e3){var _0x168355={'raw':![],'where':{'id':_0x21232e[_0xdb56('0x41')]['id']}},_0x1a32f3={};_0x1a32f3[_0xdb56('0x2c')]=_[_0xdb56('0x2e')](db[_0xdb56('0x28')][_0xdb56('0x29')]);_0x1a32f3['query']=_['keys'](_0x21232e['query']);_0x1a32f3[_0xdb56('0x2f')]=_[_0xdb56('0x31')](_0x1a32f3['model'],_0x1a32f3['query']);_0x168355[_0xdb56('0x30')]=_[_0xdb56('0x31')](_0x1a32f3[_0xdb56('0x2c')],qs[_0xdb56('0x32')](_0x21232e[_0xdb56('0x2d')]['fields']));_0x168355[_0xdb56('0x30')]=_0x168355[_0xdb56('0x30')][_0xdb56('0x33')]?_0x168355['attributes']:_0x1a32f3[_0xdb56('0x2c')];if(_0x21232e['query'][_0xdb56('0x3b')]){_0x168355['include']=[{'all':!![]}];}_0x168355=_[_0xdb56('0x3a')]({},_0x168355,_0x21232e[_0xdb56('0x42')]);return db['FreshsalesAccount']['find'](_0x168355)[_0xdb56('0x21')](handleEntityNotFound(_0x2362e3,null))[_0xdb56('0x21')](respondWithResult(_0x2362e3,null))[_0xdb56('0x3f')](handleError(_0x2362e3,null));};exports[_0xdb56('0x43')]=function(_0x2f4f76,_0x325804){return db[_0xdb56('0x28')]['create'](_0x2f4f76['body'],{})[_0xdb56('0x21')](respondWithResult(_0x325804,0xc9))[_0xdb56('0x3f')](handleError(_0x325804,null));};exports[_0xdb56('0x44')]=function(_0x491f00,_0x37c3b6){if(_0x491f00[_0xdb56('0x45')]['id']){delete _0x491f00[_0xdb56('0x45')]['id'];}return db[_0xdb56('0x28')]['find']({'where':{'id':_0x491f00[_0xdb56('0x41')]['id']}})[_0xdb56('0x21')](handleEntityNotFound(_0x37c3b6,null))[_0xdb56('0x21')](saveUpdates(_0x491f00['body'],null))[_0xdb56('0x21')](respondWithResult(_0x37c3b6,null))[_0xdb56('0x3f')](handleError(_0x37c3b6,null));};exports[_0xdb56('0x22')]=function(_0x3ae216,_0x1754df){return db[_0xdb56('0x28')][_0xdb56('0x46')]({'where':{'id':_0x3ae216['params']['id']}})[_0xdb56('0x21')](handleEntityNotFound(_0x1754df,null))[_0xdb56('0x21')](removeEntity(_0x1754df,null))[_0xdb56('0x3f')](handleError(_0x1754df,null));};exports[_0xdb56('0x47')]=function(_0x3fba0b,_0x5befc1,_0x101cd9){var _0x539cc1={};var _0x498227={};var _0x2e0a93;var _0x366703;return db[_0xdb56('0x28')][_0xdb56('0x48')]({'where':{'id':_0x3fba0b['params']['id']}})[_0xdb56('0x21')](handleEntityNotFound(_0x5befc1,null))[_0xdb56('0x21')](function(_0x494489){if(_0x494489){_0x2e0a93=_0x494489;_0x498227[_0xdb56('0x2c')]=_[_0xdb56('0x2e')](db[_0xdb56('0x49')][_0xdb56('0x29')]);_0x498227[_0xdb56('0x2d')]=_[_0xdb56('0x2e')](_0x3fba0b['query']);_0x498227[_0xdb56('0x2f')]=_[_0xdb56('0x31')](_0x498227['model'],_0x498227['query']);_0x539cc1['attributes']=_[_0xdb56('0x31')](_0x498227[_0xdb56('0x2c')],qs[_0xdb56('0x32')](_0x3fba0b[_0xdb56('0x2d')][_0xdb56('0x32')]));_0x539cc1[_0xdb56('0x30')]=_0x539cc1[_0xdb56('0x30')][_0xdb56('0x33')]?_0x539cc1[_0xdb56('0x30')]:_0x498227['model'];_0x539cc1[_0xdb56('0x36')]=qs[_0xdb56('0x37')](_0x3fba0b[_0xdb56('0x2d')][_0xdb56('0x37')]);_0x539cc1[_0xdb56('0x39')]=qs[_0xdb56('0x2f')](_[_0xdb56('0x4a')](_0x3fba0b[_0xdb56('0x2d')],_0x498227[_0xdb56('0x2f')]));if(_0x3fba0b[_0xdb56('0x2d')]['filter']){_0x539cc1['where']=_[_0xdb56('0x3a')](_0x539cc1[_0xdb56('0x39')],{'$or':_[_0xdb56('0x27')](_0x539cc1[_0xdb56('0x30')],function(_0x543bc6){var _0x5728b6={};_0x5728b6[_0x543bc6]={'$like':'%'+_0x3fba0b['query'][_0xdb56('0x38')]+'%'};return _0x5728b6;})});}_0x539cc1=_[_0xdb56('0x3a')]({},_0x539cc1,_0x3fba0b[_0xdb56('0x42')]);return _0x2e0a93[_0xdb56('0x47')](_0x539cc1);}})[_0xdb56('0x21')](function(_0x7050c9){if(_0x7050c9){_0x366703=_0x7050c9[_0xdb56('0x33')];if(!_0x3fba0b[_0xdb56('0x2d')]['hasOwnProperty'](_0xdb56('0x35'))){_0x539cc1[_0xdb56('0x1c')]=qs[_0xdb56('0x1c')](_0x3fba0b[_0xdb56('0x2d')]['limit']);_0x539cc1[_0xdb56('0x1b')]=qs['offset'](_0x3fba0b['query'][_0xdb56('0x1b')]);}return _0x2e0a93[_0xdb56('0x47')](_0x539cc1);}})['then'](function(_0x402d85){if(_0x402d85){return _0x402d85?{'count':_0x366703,'rows':_0x402d85}:null;}})[_0xdb56('0x21')](respondWithResult(_0x5befc1,null))[_0xdb56('0x3f')](handleError(_0x5befc1,null));};exports['addConfiguration']=function(_0x3157fd,_0x557490,_0x48f355){if(_0x3157fd[_0xdb56('0x45')]['id']){delete _0x3157fd['body']['id'];}return db['FreshsalesAccount'][_0xdb56('0x48')]({'where':{'id':_0x3157fd[_0xdb56('0x41')]['id']}})[_0xdb56('0x21')](handleEntityNotFound(_0x557490,null))[_0xdb56('0x21')](function(_0x181595){if(_0x181595){_0x3157fd[_0xdb56('0x45')][_0xdb56('0x4b')]=_0x181595['id'];_0x3157fd[_0xdb56('0x45')]['Subjects']=integrations[_0xdb56('0x4c')](_0x3157fd[_0xdb56('0x45')][_0xdb56('0x4d')],_0x3157fd['body'][_0xdb56('0x2b')]);_0x3157fd[_0xdb56('0x45')][_0xdb56('0x4e')]=integrations[_0xdb56('0x4f')](_0x3157fd[_0xdb56('0x45')][_0xdb56('0x4d')],_0x3157fd[_0xdb56('0x45')]['type']);return db['FreshsalesConfiguration'][_0xdb56('0x43')](_0x3157fd[_0xdb56('0x45')],{'include':[{'model':db[_0xdb56('0x50')],'as':_0xdb56('0x51')},{'model':db['FreshsalesField'],'as':_0xdb56('0x4e')}]});}return null;})['then'](respondWithResult(_0x557490,null))[_0xdb56('0x3f')](handleError(_0x557490,null));};exports[_0xdb56('0x52')]=function(_0x287354,_0x4bd801,_0x4087dc){var _0x73513f='';var _0x20e80e='';return db[_0xdb56('0x28')][_0xdb56('0x48')]({'where':{'id':_0x287354[_0xdb56('0x41')]['id']},'attributes':['id','username',_0xdb56('0x53'),_0xdb56('0x54')]})['then'](handleEntityNotFound(_0x4bd801,null))[_0xdb56('0x21')](function(_0x18c8d0){if(_0x18c8d0){_0x20e80e=_0x18c8d0[_0xdb56('0x55')];_0x73513f=_0x18c8d0[_0xdb56('0x53')];var _0x2c94cf=_0x18c8d0[_0xdb56('0x53')][_0xdb56('0x56')](-0x1);if(_0x2c94cf==='/'){_0x73513f=_0x73513f[_0xdb56('0x57')](0x0,_0x73513f[_0xdb56('0x58')](_0x2c94cf));}return rp({'method':'GET','uri':util[_0xdb56('0x59')](_0xdb56('0x5a'),_0x73513f,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0x18c8d0[_0xdb56('0x54')]},'json':!![]});}})[_0xdb56('0x21')](function(_0x34fbf2){if(_0x34fbf2){var _0x1e1aee=_0x34fbf2[_0xdb56('0x5b')];var _0x2c1352=![];var _0xb59a45=null;for(_0xb59a45=0x0;_0xb59a45<_0x1e1aee['length'];_0xb59a45++){if(_0x1e1aee[_0xb59a45]['email']===_0x20e80e){_0x2c1352=!![];}}if(_0x2c1352){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xdb56('0x5c')});}}})[_0xdb56('0x21')](respondWithResult(_0x4bd801,null))[_0xdb56('0x3f')](function(_0x1246d7){var _0x3b7323=_0x287354[_0xdb56('0x2d')]['test']?0x1f4:_0x1246d7['statusCode']||0x1f4;logger[_0xdb56('0x5d')](_0xdb56('0x5e'),_0xdb56('0x52'),_0x3b7323,JSON[_0xdb56('0x5f')](_0x1246d7));delete _0x1246d7[_0xdb56('0x24')];if(_0x3b7323===0x191){_0x3b7323=0x190;}_0x4bd801[_0xdb56('0x19')](_0x3b7323)[_0xdb56('0x25')](_0x287354['query'][_0xdb56('0x60')]?{'message':_0xdb56('0x61'),'statusCode':_0x1246d7[_0xdb56('0x62')]}:_0x1246d7);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index db739da..f23391d 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 _0x8f9d=['exports','define','FreshsalesAccount','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x8f9d,0x93));var _0xd8f9=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x8f9d[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xd8f9('0x0'));var util=require('util');var logger=require(_0xd8f9('0x1'))('api');var moment=require(_0xd8f9('0x2'));var BPromise=require(_0xd8f9('0x3'));var rp=require(_0xd8f9('0x4'));var fs=require('fs');var path=require(_0xd8f9('0x5'));var rimraf=require(_0xd8f9('0x6'));var config=require(_0xd8f9('0x7'));var attributes=require(_0xd8f9('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xd8f9('0x9')]=function(_0x24dd1e,_0x25d417){return _0x24dd1e[_0xd8f9('0xa')](_0xd8f9('0xb'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','FreshsalesAccount','int_freshsales_accounts'];(function(_0x247384,_0xf7a348){var _0x41734e=function(_0x4d7406){while(--_0x4d7406){_0x247384['push'](_0x247384['shift']());}};_0x41734e(++_0xf7a348);}(_0x1261,0x144));var _0x1126=function(_0x571339,_0x5bcafb){_0x571339=_0x571339-0x0;var _0x5af8a6=_0x1261[_0x571339];return _0x5af8a6;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x40ba58,_0x907180){return _0x40ba58['define'](_0x1126('0xa'),attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index f0b0753..43c7fd9 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 _0xafb9=['ShowFreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','limit','map','attributes','include','model','debug'];(function(_0x6f661b,_0x328728){var _0x512a7f=function(_0x226a6d){while(--_0x226a6d){_0x6f661b['push'](_0x6f661b['shift']());}};_0x512a7f(++_0x328728);}(_0xafb9,0x68));var _0x9afb=function(_0x55229d,_0x11083){_0x55229d=_0x55229d-0x0;var _0x576e8f=_0xafb9[_0x55229d];return _0x576e8f;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var moment=require(_0x9afb('0x2'));var BPromise=require(_0x9afb('0x3'));var rs=require(_0x9afb('0x4'));var fs=require('fs');var Redis=require(_0x9afb('0x5'));var db=require(_0x9afb('0x6'))['db'];var utils=require(_0x9afb('0x7'));var logger=require(_0x9afb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9afb('0x9'));var client=jayson['client'][_0x9afb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x548b24,_0x556880,_0x4c0e9d){return new BPromise(function(_0x1edf77,_0x20b8c1){return client['request'](_0x548b24,_0x4c0e9d)[_0x9afb('0xb')](function(_0x3e0264){logger[_0x9afb('0xc')](_0x9afb('0xd'),_0x556880,_0x9afb('0xe'));logger['debug']('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x556880,_0x9afb('0xe'),JSON[_0x9afb('0xf')](_0x3e0264));if(_0x3e0264[_0x9afb('0x10')]){if(_0x3e0264[_0x9afb('0x10')][_0x9afb('0x11')]===0x1f4){logger[_0x9afb('0x10')](_0x9afb('0xd'),_0x556880,_0x3e0264[_0x9afb('0x10')][_0x9afb('0x12')]);return _0x20b8c1(_0x3e0264[_0x9afb('0x10')]['message']);}logger[_0x9afb('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x556880,_0x3e0264['error'][_0x9afb('0x12')]);return _0x1edf77(_0x3e0264[_0x9afb('0x10')][_0x9afb('0x12')]);}else{logger[_0x9afb('0xc')](_0x9afb('0xd'),_0x556880,_0x9afb('0xe'));_0x1edf77(_0x3e0264[_0x9afb('0x13')]['message']);}})[_0x9afb('0x14')](function(_0x2145c2){logger[_0x9afb('0x10')](_0x9afb('0xd'),_0x556880,_0x2145c2);_0x20b8c1(_0x2145c2);});});}exports[_0x9afb('0x15')]=function(_0x508433){var _0x201ff4=this;return new Promise(function(_0x50a7e4,_0x3fdb34){return db[_0x9afb('0x16')]['findAll']({'raw':_0x508433['options']?_0x508433[_0x9afb('0x17')][_0x9afb('0x18')]===undefined?!![]:![]:!![],'where':_0x508433[_0x9afb('0x17')]?_0x508433[_0x9afb('0x17')][_0x9afb('0x19')]||null:null,'attributes':_0x508433['options']?_0x508433[_0x9afb('0x17')]['attributes']||null:null,'limit':_0x508433['options']?_0x508433[_0x9afb('0x17')][_0x9afb('0x1a')]||null:null,'include':_0x508433[_0x9afb('0x17')]?_0x508433[_0x9afb('0x17')]['include']?_[_0x9afb('0x1b')](_0x508433[_0x9afb('0x17')]['include'],function(_0x571bd9){return{'model':db[_0x571bd9['model']],'as':_0x571bd9['as'],'attributes':_0x571bd9[_0x9afb('0x1c')],'include':_0x571bd9['include']?_[_0x9afb('0x1b')](_0x571bd9[_0x9afb('0x1d')],function(_0x50a919){return{'model':db[_0x50a919[_0x9afb('0x1e')]],'as':_0x50a919['as'],'attributes':_0x50a919[_0x9afb('0x1c')],'include':_0x50a919[_0x9afb('0x1d')]?_[_0x9afb('0x1b')](_0x50a919['include'],function(_0x348255){return{'model':db[_0x348255['model']],'as':_0x348255['as'],'attributes':_0x348255[_0x9afb('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5692fa){logger[_0x9afb('0xc')](_0x9afb('0x15'),_0x508433);logger[_0x9afb('0x1f')](_0x9afb('0x15'),_0x508433,JSON[_0x9afb('0xf')](_0x5692fa));_0x50a7e4(_0x5692fa);})[_0x9afb('0x14')](function(_0x46673d){logger['error']('GetFreshsalesAccount',_0x46673d[_0x9afb('0x12')],_0x508433);_0x3fdb34(_0x201ff4[_0x9afb('0x10')](0x1f4,_0x46673d['message']));});});};exports[_0x9afb('0x20')]=function(_0x2f388c){var _0x5560bd=this;return new Promise(function(_0x1b9f18,_0xc220e9){return db[_0x9afb('0x16')][_0x9afb('0x21')]({'raw':_0x2f388c[_0x9afb('0x17')]?_0x2f388c[_0x9afb('0x17')][_0x9afb('0x18')]===undefined?!![]:![]:!![],'where':_0x2f388c[_0x9afb('0x17')]?_0x2f388c['options']['where']||null:null,'attributes':_0x2f388c[_0x9afb('0x17')]?_0x2f388c[_0x9afb('0x17')][_0x9afb('0x1c')]||null:null,'include':_0x2f388c[_0x9afb('0x17')]?_0x2f388c[_0x9afb('0x17')][_0x9afb('0x1d')]?_[_0x9afb('0x1b')](_0x2f388c['options']['include'],function(_0x67d63a){return{'model':db[_0x67d63a[_0x9afb('0x1e')]],'as':_0x67d63a['as'],'attributes':_0x67d63a['attributes'],'include':_0x67d63a[_0x9afb('0x1d')]?_['map'](_0x67d63a[_0x9afb('0x1d')],function(_0xc59d55){return{'model':db[_0xc59d55['model']],'as':_0xc59d55['as'],'attributes':_0xc59d55[_0x9afb('0x1c')],'include':_0xc59d55['include']?_[_0x9afb('0x1b')](_0xc59d55[_0x9afb('0x1d')],function(_0x45c57f){return{'model':db[_0x45c57f[_0x9afb('0x1e')]],'as':_0x45c57f['as'],'attributes':_0x45c57f[_0x9afb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9afb('0xb')](function(_0x19227f){logger[_0x9afb('0xc')]('ShowFreshsalesAccount',_0x2f388c);logger[_0x9afb('0x1f')]('ShowFreshsalesAccount',_0x2f388c,JSON[_0x9afb('0xf')](_0x19227f));_0x1b9f18(_0x19227f);})[_0x9afb('0x14')](function(_0x3c5231){logger[_0x9afb('0x10')](_0x9afb('0x20'),_0x3c5231[_0x9afb('0x12')],_0x2f388c);_0xc220e9(_0x5560bd[_0x9afb('0x10')](0x1f4,_0x3c5231[_0x9afb('0x12')]));});});}; \ 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(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x273fd1,_0x388bbe){_0x273fd1=_0x273fd1-0x0;var _0x5d3dbf=_0x0a6b[_0x273fd1];return _0x5d3dbf;};'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 d86386e..06edc79 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 _0xc782=['put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/subjects','getSubjects','getDescriptions','getFields','create'];(function(_0x323419,_0x2a6172){var _0x4c0be7=function(_0x5ae2df){while(--_0x5ae2df){_0x323419['push'](_0x323419['shift']());}};_0x4c0be7(++_0x2a6172);}(_0xc782,0xb8));var _0x2c78=function(_0x140357,_0x6670bd){_0x140357=_0x140357-0x0;var _0x4fdf00=_0xc782[_0x140357];return _0x4fdf00;};'use strict';var multer=require(_0x2c78('0x0'));var util=require('util');var path=require(_0x2c78('0x1'));var timeout=require(_0x2c78('0x2'));var express=require(_0x2c78('0x3'));var router=express[_0x2c78('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2c78('0x5'));var config=require(_0x2c78('0x6'));var controller=require('./intFreshsalesConfiguration.controller');router['get']('/',auth[_0x2c78('0x7')](),controller['index']);router[_0x2c78('0x8')](_0x2c78('0x9'),auth[_0x2c78('0x7')](),controller[_0x2c78('0xa')]);router['get'](_0x2c78('0xb'),auth[_0x2c78('0x7')](),controller[_0x2c78('0xc')]);router[_0x2c78('0x8')]('/:id/descriptions',auth[_0x2c78('0x7')](),controller[_0x2c78('0xd')]);router[_0x2c78('0x8')]('/:id/fields',auth[_0x2c78('0x7')](),controller[_0x2c78('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2c78('0xf')]);router[_0x2c78('0x10')](_0x2c78('0x9'),auth[_0x2c78('0x7')](),controller[_0x2c78('0x11')]);router[_0x2c78('0x12')](_0x2c78('0x9'),auth[_0x2c78('0x7')](),controller['destroy']);module[_0x2c78('0x13')]=router; \ No newline at end of file +var _0x9f5a=['index','get','isAuthenticated','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','post','create','put','update','delete','/:id','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesConfiguration.controller'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x9f5a,0x100));var _0xa9f5=function(_0x2fa385,_0x79d0d){_0x2fa385=_0x2fa385-0x0;var _0x97ff30=_0x9f5a[_0x2fa385];return _0x97ff30;};'use strict';var multer=require(_0xa9f5('0x0'));var util=require(_0xa9f5('0x1'));var path=require('path');var timeout=require(_0xa9f5('0x2'));var express=require(_0xa9f5('0x3'));var router=express['Router']();var fs_extra=require(_0xa9f5('0x4'));var auth=require(_0xa9f5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa9f5('0x6'));var controller=require(_0xa9f5('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xa9f5('0x8')]);router[_0xa9f5('0x9')]('/:id',auth[_0xa9f5('0xa')](),controller[_0xa9f5('0xb')]);router[_0xa9f5('0x9')](_0xa9f5('0xc'),auth[_0xa9f5('0xa')](),controller[_0xa9f5('0xd')]);router[_0xa9f5('0x9')](_0xa9f5('0xe'),auth['isAuthenticated'](),controller[_0xa9f5('0xf')]);router[_0xa9f5('0x9')](_0xa9f5('0x10'),auth[_0xa9f5('0xa')](),controller['getFields']);router[_0xa9f5('0x11')]('/',auth[_0xa9f5('0xa')](),controller[_0xa9f5('0x12')]);router[_0xa9f5('0x13')]('/:id',auth[_0xa9f5('0xa')](),controller[_0xa9f5('0x14')]);router[_0xa9f5('0x15')](_0xa9f5('0x16'),auth[_0xa9f5('0xa')](),controller[_0xa9f5('0x17')]);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 3d32d01..73403fd 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 _0xde94=['sequelize','exports','STRING'];(function(_0x5c1f37,_0x48366d){var _0x520655=function(_0x28f8af){while(--_0x28f8af){_0x5c1f37['push'](_0x5c1f37['shift']());}};_0x520655(++_0x48366d);}(_0xde94,0xb4));var _0x4de9=function(_0x5ae2a8,_0x45ff39){_0x5ae2a8=_0x5ae2a8-0x0;var _0x5173b8=_0xde94[_0x5ae2a8];return _0x5173b8;};'use strict';var Sequelize=require(_0x4de9('0x0'));module[_0x4de9('0x1')]={'name':{'type':Sequelize[_0x4de9('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd9ce=['sequelize','STRING'];(function(_0x12ddb2,_0x5ad61e){var _0x10b6dd=function(_0x47dd27){while(--_0x47dd27){_0x12ddb2['push'](_0x12ddb2['shift']());}};_0x10b6dd(++_0x5ad61e);}(_0xd9ce,0x1c6));var _0xed9c=function(_0x5dc9f5,_0x5362c7){_0x5dc9f5=_0x5dc9f5-0x0;var _0x4faea5=_0xd9ce[_0x5dc9f5];return _0x4faea5;};'use strict';var Sequelize=require(_0xed9c('0x0'));module['exports']={'name':{'type':Sequelize[_0xed9c('0x1')]},'description':{'type':Sequelize[_0xed9c('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 9e796d3..8f8eece 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 _0x6aa8=['path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','find','create','body','params','getSubjects','findOne','FreshsalesField','order','getDescriptions','getFields','rimraf','fast-json-patch','moment','mustache','util'];(function(_0x1b5426,_0x4645fd){var _0x5a3142=function(_0x590a0b){while(--_0x590a0b){_0x1b5426['push'](_0x1b5426['shift']());}};_0x5a3142(++_0x4645fd);}(_0x6aa8,0x9b));var _0x86aa=function(_0x52bdda,_0x503ff2){_0x52bdda=_0x52bdda-0x0;var _0x25dc08=_0x6aa8[_0x52bdda];return _0x25dc08;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86aa('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x86aa('0x1'));var rp=require('request-promise');var moment=require(_0x86aa('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x86aa('0x3'));var util=require(_0x86aa('0x4'));var path=require(_0x86aa('0x5'));var sox=require(_0x86aa('0x6'));var csv=require(_0x86aa('0x7'));var ejs=require(_0x86aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x86aa('0x9'));var squel=require(_0x86aa('0xa'));var crypto=require(_0x86aa('0xb'));var jsforce=require(_0x86aa('0xc'));var deskjs=require(_0x86aa('0xd'));var toCsv=require('to-csv');var querystring=require(_0x86aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x86aa('0xf'));var authService=require(_0x86aa('0x10'));var qs=require(_0x86aa('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x86aa('0x12'));var utils=require(_0x86aa('0x13'));var config=require(_0x86aa('0x14'));var licenseUtil=require(_0x86aa('0x15'));var db=require(_0x86aa('0x16'))['db'];function respondWithStatusCode(_0x40e0e2,_0x161c47){_0x161c47=_0x161c47||0xcc;return function(_0x26c41a){if(_0x26c41a){return _0x40e0e2[_0x86aa('0x17')](_0x161c47);}return _0x40e0e2['status'](_0x161c47)[_0x86aa('0x18')]();};}function respondWithResult(_0x184543,_0x136fa2){_0x136fa2=_0x136fa2||0xc8;return function(_0x31c75c){if(_0x31c75c){return _0x184543[_0x86aa('0x19')](_0x136fa2)[_0x86aa('0x1a')](_0x31c75c);}};}function respondWithFilteredResult(_0x1d631f,_0x3d0b5f){return function(_0x471033){if(_0x471033){var _0x2555c9=typeof _0x3d0b5f[_0x86aa('0x1b')]===_0x86aa('0x1c')&&typeof _0x3d0b5f[_0x86aa('0x1d')]===_0x86aa('0x1c');var _0x3c82cf=_0x471033['count'];var _0x1d90f2=_0x2555c9?0x0:_0x3d0b5f[_0x86aa('0x1b')];var _0x1dbc25=_0x2555c9?_0x471033[_0x86aa('0x1e')]:_0x3d0b5f['offset']+_0x3d0b5f['limit'];var _0x3a7c6f;if(_0x1dbc25>=_0x3c82cf){_0x1dbc25=_0x3c82cf;_0x3a7c6f=0xc8;}else{_0x3a7c6f=0xce;}_0x1d631f[_0x86aa('0x19')](_0x3a7c6f);return _0x1d631f[_0x86aa('0x1f')](_0x86aa('0x20'),_0x1d90f2+'-'+_0x1dbc25+'/'+_0x3c82cf)[_0x86aa('0x1a')](_0x471033);}return null;};}function patchUpdates(_0x2cc3c5){return function(_0x1952a6){try{jsonpatch[_0x86aa('0x21')](_0x1952a6,_0x2cc3c5,!![]);}catch(_0xe2ce25){return BPromise[_0x86aa('0x22')](_0xe2ce25);}return _0x1952a6['save']();};}function saveUpdates(_0x4c4518,_0x336ab1){return function(_0x29ca09){if(_0x29ca09){return _0x29ca09[_0x86aa('0x23')](_0x4c4518)['then'](function(_0x1094ce){return _0x1094ce;});}return null;};}function removeEntity(_0x125d12,_0x5ee98e){return function(_0x129323){if(_0x129323){return _0x129323[_0x86aa('0x24')]()[_0x86aa('0x25')](function(){_0x125d12[_0x86aa('0x19')](0xcc)[_0x86aa('0x18')]();});}};}function handleEntityNotFound(_0x30df8c,_0x4f0452){return function(_0x8f2437){if(!_0x8f2437){_0x30df8c[_0x86aa('0x17')](0x194);}return _0x8f2437;};}function handleError(_0x945afd,_0x287aec){_0x287aec=_0x287aec||0x1f4;return function(_0x2c9ccd){logger[_0x86aa('0x26')](_0x2c9ccd[_0x86aa('0x27')]);if(_0x2c9ccd[_0x86aa('0x28')]){delete _0x2c9ccd['name'];}_0x945afd[_0x86aa('0x19')](_0x287aec)['send'](_0x2c9ccd);};}exports[_0x86aa('0x29')]=function(_0x145c13,_0x329f46){var _0x9a5b7f={},_0x54aa14={},_0x1d3c28={'count':0x0,'rows':[]};var _0x537728=_[_0x86aa('0x2a')](db[_0x86aa('0x2b')][_0x86aa('0x2c')],function(_0x949760){return{'name':_0x949760[_0x86aa('0x2d')],'type':_0x949760[_0x86aa('0x2e')][_0x86aa('0x2f')]};});_0x54aa14[_0x86aa('0x30')]=_['map'](_0x537728,_0x86aa('0x28'));_0x54aa14['query']=_['keys'](_0x145c13[_0x86aa('0x31')]);_0x54aa14['filters']=_['intersection'](_0x54aa14[_0x86aa('0x30')],_0x54aa14[_0x86aa('0x31')]);_0x9a5b7f[_0x86aa('0x32')]=_[_0x86aa('0x33')](_0x54aa14[_0x86aa('0x30')],qs[_0x86aa('0x34')](_0x145c13[_0x86aa('0x31')][_0x86aa('0x34')]));_0x9a5b7f[_0x86aa('0x32')]=_0x9a5b7f[_0x86aa('0x32')][_0x86aa('0x35')]?_0x9a5b7f[_0x86aa('0x32')]:_0x54aa14[_0x86aa('0x30')];if(!_0x145c13['query'][_0x86aa('0x36')](_0x86aa('0x37'))){_0x9a5b7f[_0x86aa('0x1d')]=qs['limit'](_0x145c13[_0x86aa('0x31')][_0x86aa('0x1d')]);_0x9a5b7f[_0x86aa('0x1b')]=qs['offset'](_0x145c13[_0x86aa('0x31')][_0x86aa('0x1b')]);}_0x9a5b7f['order']=qs[_0x86aa('0x38')](_0x145c13['query'][_0x86aa('0x38')]);_0x9a5b7f[_0x86aa('0x39')]=qs[_0x86aa('0x3a')](_[_0x86aa('0x3b')](_0x145c13[_0x86aa('0x31')],_0x54aa14[_0x86aa('0x3a')]),_0x537728);if(_0x145c13['query'][_0x86aa('0x3c')]){_0x9a5b7f['where']=_[_0x86aa('0x3d')](_0x9a5b7f[_0x86aa('0x39')],{'$or':_[_0x86aa('0x2a')](_0x537728,function(_0x31ae43){if(_0x31ae43['type']!==_0x86aa('0x3e')){var _0x1c107e={};_0x1c107e[_0x31ae43[_0x86aa('0x28')]]={'$like':'%'+_0x145c13[_0x86aa('0x31')][_0x86aa('0x3c')]+'%'};return _0x1c107e;}})});}_0x9a5b7f=_[_0x86aa('0x3d')]({},_0x9a5b7f,_0x145c13[_0x86aa('0x3f')]);var _0x3122a9={'where':_0x9a5b7f[_0x86aa('0x39')]};return db[_0x86aa('0x2b')][_0x86aa('0x1e')](_0x3122a9)['then'](function(_0x2b3c98){_0x1d3c28[_0x86aa('0x1e')]=_0x2b3c98;if(_0x145c13[_0x86aa('0x31')]['includeAll']){_0x9a5b7f[_0x86aa('0x40')]=[{'all':!![]}];}return db[_0x86aa('0x2b')][_0x86aa('0x41')](_0x9a5b7f);})[_0x86aa('0x25')](function(_0x153835){_0x1d3c28[_0x86aa('0x42')]=_0x153835;return _0x1d3c28;})['then'](respondWithFilteredResult(_0x329f46,_0x9a5b7f))[_0x86aa('0x43')](handleError(_0x329f46,null));};exports[_0x86aa('0x44')]=function(_0x3e92e8,_0x1cad27){var _0x489dc2={'raw':![],'where':{'id':_0x3e92e8['params']['id']}},_0x27c511={};_0x27c511['model']=_['keys'](db[_0x86aa('0x2b')][_0x86aa('0x2c')]);_0x27c511['query']=_[_0x86aa('0x45')](_0x3e92e8[_0x86aa('0x31')]);_0x27c511[_0x86aa('0x3a')]=_[_0x86aa('0x33')](_0x27c511[_0x86aa('0x30')],_0x27c511['query']);_0x489dc2[_0x86aa('0x32')]=_[_0x86aa('0x33')](_0x27c511[_0x86aa('0x30')],qs[_0x86aa('0x34')](_0x3e92e8[_0x86aa('0x31')]['fields']));_0x489dc2['attributes']=_0x489dc2[_0x86aa('0x32')]['length']?_0x489dc2['attributes']:_0x27c511['model'];if(_0x3e92e8[_0x86aa('0x31')]['includeAll']){_0x489dc2[_0x86aa('0x40')]=[{'all':!![]}];}_0x489dc2=_[_0x86aa('0x3d')]({},_0x489dc2,_0x3e92e8[_0x86aa('0x3f')]);return db['FreshsalesConfiguration'][_0x86aa('0x46')](_0x489dc2)['then'](handleEntityNotFound(_0x1cad27,null))[_0x86aa('0x25')](respondWithResult(_0x1cad27,null))['catch'](handleError(_0x1cad27,null));};exports[_0x86aa('0x47')]=function(_0x26059b,_0x5828d1){return db[_0x86aa('0x2b')]['create'](_0x26059b[_0x86aa('0x48')],{})[_0x86aa('0x25')](respondWithResult(_0x5828d1,0xc9))[_0x86aa('0x43')](handleError(_0x5828d1,null));};exports[_0x86aa('0x23')]=function(_0x48dfb3,_0x1aa95b){if(_0x48dfb3[_0x86aa('0x48')]['id']){delete _0x48dfb3[_0x86aa('0x48')]['id'];}return db[_0x86aa('0x2b')][_0x86aa('0x46')]({'where':{'id':_0x48dfb3['params']['id']}})['then'](handleEntityNotFound(_0x1aa95b,null))[_0x86aa('0x25')](saveUpdates(_0x48dfb3[_0x86aa('0x48')],null))[_0x86aa('0x25')](respondWithResult(_0x1aa95b,null))[_0x86aa('0x43')](handleError(_0x1aa95b,null));};exports[_0x86aa('0x24')]=function(_0x2a4108,_0x4f9d48){return db[_0x86aa('0x2b')][_0x86aa('0x46')]({'where':{'id':_0x2a4108[_0x86aa('0x49')]['id']}})[_0x86aa('0x25')](handleEntityNotFound(_0x4f9d48,null))['then'](removeEntity(_0x4f9d48,null))[_0x86aa('0x43')](handleError(_0x4f9d48,null));};exports[_0x86aa('0x4a')]=function(_0x4ea555,_0xafd072,_0x1b10f4){var _0x1fef6d={};var _0x4db96d={};var _0x3254c1;var _0x1e7d51;return db[_0x86aa('0x2b')][_0x86aa('0x4b')]({'where':{'id':_0x4ea555[_0x86aa('0x49')]['id']}})[_0x86aa('0x25')](handleEntityNotFound(_0xafd072,null))['then'](function(_0xd4a544){if(_0xd4a544){_0x3254c1=_0xd4a544;_0x4db96d[_0x86aa('0x30')]=_['keys'](db[_0x86aa('0x4c')]['rawAttributes']);_0x4db96d['query']=_[_0x86aa('0x45')](_0x4ea555[_0x86aa('0x31')]);_0x4db96d[_0x86aa('0x3a')]=_[_0x86aa('0x33')](_0x4db96d[_0x86aa('0x30')],_0x4db96d['query']);_0x1fef6d[_0x86aa('0x32')]=_['intersection'](_0x4db96d[_0x86aa('0x30')],qs[_0x86aa('0x34')](_0x4ea555['query'][_0x86aa('0x34')]));_0x1fef6d[_0x86aa('0x32')]=_0x1fef6d[_0x86aa('0x32')][_0x86aa('0x35')]?_0x1fef6d[_0x86aa('0x32')]:_0x4db96d[_0x86aa('0x30')];_0x1fef6d[_0x86aa('0x4d')]=qs[_0x86aa('0x38')](_0x4ea555['query'][_0x86aa('0x38')]);_0x1fef6d[_0x86aa('0x39')]=qs[_0x86aa('0x3a')](_[_0x86aa('0x3b')](_0x4ea555['query'],_0x4db96d[_0x86aa('0x3a')]));if(_0x4ea555[_0x86aa('0x31')][_0x86aa('0x3c')]){_0x1fef6d[_0x86aa('0x39')]=_['merge'](_0x1fef6d[_0x86aa('0x39')],{'$or':_[_0x86aa('0x2a')](_0x1fef6d[_0x86aa('0x32')],function(_0x93985f){var _0x2879d5={};_0x2879d5[_0x93985f]={'$like':'%'+_0x4ea555[_0x86aa('0x31')]['filter']+'%'};return _0x2879d5;})});}_0x1fef6d=_['merge']({},_0x1fef6d,_0x4ea555[_0x86aa('0x3f')]);return _0x3254c1[_0x86aa('0x4a')](_0x1fef6d);}})['then'](function(_0x1b4233){if(_0x1b4233){_0x1e7d51=_0x1b4233[_0x86aa('0x35')];if(!_0x4ea555['query'][_0x86aa('0x36')]('nolimit')){_0x1fef6d['limit']=qs[_0x86aa('0x1d')](_0x4ea555['query'][_0x86aa('0x1d')]);_0x1fef6d[_0x86aa('0x1b')]=qs[_0x86aa('0x1b')](_0x4ea555['query']['offset']);}return _0x3254c1[_0x86aa('0x4a')](_0x1fef6d);}})['then'](function(_0x3f1c33){if(_0x3f1c33){return _0x3f1c33?{'count':_0x1e7d51,'rows':_0x3f1c33}:null;}})[_0x86aa('0x25')](respondWithResult(_0xafd072,null))[_0x86aa('0x43')](handleError(_0xafd072,null));};exports[_0x86aa('0x4e')]=function(_0x21ab18,_0x283442,_0x172a6a){var _0x49bc5f={};var _0x1b8a11={};var _0x32f2b6;var _0x333337;return db[_0x86aa('0x2b')][_0x86aa('0x4b')]({'where':{'id':_0x21ab18['params']['id']}})[_0x86aa('0x25')](handleEntityNotFound(_0x283442,null))[_0x86aa('0x25')](function(_0x4cec1f){if(_0x4cec1f){_0x32f2b6=_0x4cec1f;_0x1b8a11[_0x86aa('0x30')]=_[_0x86aa('0x45')](db['FreshsalesField'][_0x86aa('0x2c')]);_0x1b8a11[_0x86aa('0x31')]=_[_0x86aa('0x45')](_0x21ab18[_0x86aa('0x31')]);_0x1b8a11[_0x86aa('0x3a')]=_[_0x86aa('0x33')](_0x1b8a11['model'],_0x1b8a11['query']);_0x49bc5f[_0x86aa('0x32')]=_[_0x86aa('0x33')](_0x1b8a11[_0x86aa('0x30')],qs['fields'](_0x21ab18[_0x86aa('0x31')]['fields']));_0x49bc5f[_0x86aa('0x32')]=_0x49bc5f[_0x86aa('0x32')][_0x86aa('0x35')]?_0x49bc5f[_0x86aa('0x32')]:_0x1b8a11[_0x86aa('0x30')];_0x49bc5f[_0x86aa('0x4d')]=qs[_0x86aa('0x38')](_0x21ab18['query']['sort']);_0x49bc5f[_0x86aa('0x39')]=qs['filters'](_[_0x86aa('0x3b')](_0x21ab18[_0x86aa('0x31')],_0x1b8a11[_0x86aa('0x3a')]));if(_0x21ab18['query'][_0x86aa('0x3c')]){_0x49bc5f[_0x86aa('0x39')]=_['merge'](_0x49bc5f[_0x86aa('0x39')],{'$or':_[_0x86aa('0x2a')](_0x49bc5f[_0x86aa('0x32')],function(_0x36a8ff){var _0x594375={};_0x594375[_0x36a8ff]={'$like':'%'+_0x21ab18['query'][_0x86aa('0x3c')]+'%'};return _0x594375;})});}_0x49bc5f=_[_0x86aa('0x3d')]({},_0x49bc5f,_0x21ab18[_0x86aa('0x3f')]);return _0x32f2b6[_0x86aa('0x4e')](_0x49bc5f);}})[_0x86aa('0x25')](function(_0x48bb37){if(_0x48bb37){_0x333337=_0x48bb37['length'];if(!_0x21ab18[_0x86aa('0x31')][_0x86aa('0x36')](_0x86aa('0x37'))){_0x49bc5f[_0x86aa('0x1d')]=qs[_0x86aa('0x1d')](_0x21ab18['query'][_0x86aa('0x1d')]);_0x49bc5f['offset']=qs[_0x86aa('0x1b')](_0x21ab18[_0x86aa('0x31')][_0x86aa('0x1b')]);}return _0x32f2b6['getDescriptions'](_0x49bc5f);}})[_0x86aa('0x25')](function(_0x130932){if(_0x130932){return _0x130932?{'count':_0x333337,'rows':_0x130932}:null;}})[_0x86aa('0x25')](respondWithResult(_0x283442,null))[_0x86aa('0x43')](handleError(_0x283442,null));};exports[_0x86aa('0x4f')]=function(_0xfba600,_0x35ee6b,_0x30b4db){var _0x20ab0a={};var _0x7d4110={};var _0x61720d;var _0x55d775;return db[_0x86aa('0x2b')][_0x86aa('0x4b')]({'where':{'id':_0xfba600[_0x86aa('0x49')]['id']}})['then'](handleEntityNotFound(_0x35ee6b,null))['then'](function(_0x444f89){if(_0x444f89){_0x61720d=_0x444f89;_0x7d4110[_0x86aa('0x30')]=_['keys'](db[_0x86aa('0x4c')]['rawAttributes']);_0x7d4110[_0x86aa('0x31')]=_[_0x86aa('0x45')](_0xfba600[_0x86aa('0x31')]);_0x7d4110[_0x86aa('0x3a')]=_['intersection'](_0x7d4110['model'],_0x7d4110['query']);_0x20ab0a['attributes']=_[_0x86aa('0x33')](_0x7d4110[_0x86aa('0x30')],qs['fields'](_0xfba600[_0x86aa('0x31')]['fields']));_0x20ab0a[_0x86aa('0x32')]=_0x20ab0a[_0x86aa('0x32')]['length']?_0x20ab0a['attributes']:_0x7d4110[_0x86aa('0x30')];_0x20ab0a['order']=qs['sort'](_0xfba600['query'][_0x86aa('0x38')]);_0x20ab0a[_0x86aa('0x39')]=qs[_0x86aa('0x3a')](_[_0x86aa('0x3b')](_0xfba600[_0x86aa('0x31')],_0x7d4110['filters']));if(_0xfba600['query'][_0x86aa('0x3c')]){_0x20ab0a[_0x86aa('0x39')]=_['merge'](_0x20ab0a[_0x86aa('0x39')],{'$or':_['map'](_0x20ab0a[_0x86aa('0x32')],function(_0xecdded){var _0x1fdae4={};_0x1fdae4[_0xecdded]={'$like':'%'+_0xfba600[_0x86aa('0x31')][_0x86aa('0x3c')]+'%'};return _0x1fdae4;})});}_0x20ab0a=_['merge']({},_0x20ab0a,_0xfba600[_0x86aa('0x3f')]);return _0x61720d[_0x86aa('0x4f')](_0x20ab0a);}})['then'](function(_0x22bb74){if(_0x22bb74){_0x55d775=_0x22bb74[_0x86aa('0x35')];if(!_0xfba600['query'][_0x86aa('0x36')](_0x86aa('0x37'))){_0x20ab0a[_0x86aa('0x1d')]=qs['limit'](_0xfba600[_0x86aa('0x31')][_0x86aa('0x1d')]);_0x20ab0a[_0x86aa('0x1b')]=qs[_0x86aa('0x1b')](_0xfba600[_0x86aa('0x31')][_0x86aa('0x1b')]);}return _0x61720d[_0x86aa('0x4f')](_0x20ab0a);}})[_0x86aa('0x25')](function(_0x4ee599){if(_0x4ee599){return _0x4ee599?{'count':_0x55d775,'rows':_0x4ee599}:null;}})[_0x86aa('0x25')](respondWithResult(_0x35ee6b,null))[_0x86aa('0x43')](handleError(_0x35ee6b,null));}; \ No newline at end of file +var _0xe382=['params','includeAll','options','find','create','body','findOne','FreshsalesField','pick','getSubjects','getDescriptions','getFields','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','include','findAll','catch','show'];(function(_0x2b33e8,_0x2e01fe){var _0x1e9cce=function(_0x2d4e95){while(--_0x2d4e95){_0x2b33e8['push'](_0x2b33e8['shift']());}};_0x1e9cce(++_0x2e01fe);}(_0xe382,0x150));var _0x2e38=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0xe382[_0x38eb23];return _0x48506a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2e38('0x0'));var zipdir=require(_0x2e38('0x1'));var jsonpatch=require(_0x2e38('0x2'));var rp=require(_0x2e38('0x3'));var moment=require(_0x2e38('0x4'));var BPromise=require(_0x2e38('0x5'));var Mustache=require(_0x2e38('0x6'));var util=require(_0x2e38('0x7'));var path=require(_0x2e38('0x8'));var sox=require('sox');var csv=require(_0x2e38('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2e38('0xa'));var _=require('lodash');var squel=require(_0x2e38('0xb'));var crypto=require(_0x2e38('0xc'));var jsforce=require(_0x2e38('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2e38('0x9'));var querystring=require(_0x2e38('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2e38('0xf'));var qs=require(_0x2e38('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2e38('0x11'));var logger=require(_0x2e38('0x12'))(_0x2e38('0x13'));var utils=require(_0x2e38('0x14'));var config=require(_0x2e38('0x15'));var licenseUtil=require(_0x2e38('0x16'));var db=require(_0x2e38('0x17'))['db'];function respondWithStatusCode(_0x419a15,_0x1c1059){_0x1c1059=_0x1c1059||0xcc;return function(_0x3dc39a){if(_0x3dc39a){return _0x419a15[_0x2e38('0x18')](_0x1c1059);}return _0x419a15[_0x2e38('0x19')](_0x1c1059)[_0x2e38('0x1a')]();};}function respondWithResult(_0x50ccdf,_0x48fc8f){_0x48fc8f=_0x48fc8f||0xc8;return function(_0x249cfe){if(_0x249cfe){return _0x50ccdf[_0x2e38('0x19')](_0x48fc8f)[_0x2e38('0x1b')](_0x249cfe);}};}function respondWithFilteredResult(_0x43929a,_0x24ae13){return function(_0x2637cb){if(_0x2637cb){var _0x1ada4d=typeof _0x24ae13[_0x2e38('0x1c')]===_0x2e38('0x1d')&&typeof _0x24ae13['limit']===_0x2e38('0x1d');var _0x50f811=_0x2637cb[_0x2e38('0x1e')];var _0x26779e=_0x1ada4d?0x0:_0x24ae13['offset'];var _0x339fbc=_0x1ada4d?_0x2637cb[_0x2e38('0x1e')]:_0x24ae13['offset']+_0x24ae13[_0x2e38('0x1f')];var _0x5297d4;if(_0x339fbc>=_0x50f811){_0x339fbc=_0x50f811;_0x5297d4=0xc8;}else{_0x5297d4=0xce;}_0x43929a['status'](_0x5297d4);return _0x43929a[_0x2e38('0x20')](_0x2e38('0x21'),_0x26779e+'-'+_0x339fbc+'/'+_0x50f811)[_0x2e38('0x1b')](_0x2637cb);}return null;};}function patchUpdates(_0x275a0c){return function(_0x4b4a25){try{jsonpatch[_0x2e38('0x22')](_0x4b4a25,_0x275a0c,!![]);}catch(_0x102b35){return BPromise[_0x2e38('0x23')](_0x102b35);}return _0x4b4a25[_0x2e38('0x24')]();};}function saveUpdates(_0x55fa6d,_0x2ba2a3){return function(_0x411748){if(_0x411748){return _0x411748[_0x2e38('0x25')](_0x55fa6d)[_0x2e38('0x26')](function(_0x12b0ad){return _0x12b0ad;});}return null;};}function removeEntity(_0x113e7f,_0x46ac7c){return function(_0x289b69){if(_0x289b69){return _0x289b69[_0x2e38('0x27')]()[_0x2e38('0x26')](function(){_0x113e7f[_0x2e38('0x19')](0xcc)[_0x2e38('0x1a')]();});}};}function handleEntityNotFound(_0x3a40e6,_0x4fba9f){return function(_0x2753c1){if(!_0x2753c1){_0x3a40e6[_0x2e38('0x18')](0x194);}return _0x2753c1;};}function handleError(_0x5df514,_0x129391){_0x129391=_0x129391||0x1f4;return function(_0x285faf){logger['error'](_0x285faf[_0x2e38('0x28')]);if(_0x285faf['name']){delete _0x285faf[_0x2e38('0x29')];}_0x5df514['status'](_0x129391)[_0x2e38('0x2a')](_0x285faf);};}exports[_0x2e38('0x2b')]=function(_0xcd7e2a,_0x3a583e){var _0x52ea4f={},_0x55b0c5={},_0xb7608c={'count':0x0,'rows':[]};var _0x5e397f=_[_0x2e38('0x2c')](db[_0x2e38('0x2d')][_0x2e38('0x2e')],function(_0x36e611){return{'name':_0x36e611[_0x2e38('0x2f')],'type':_0x36e611[_0x2e38('0x30')]['key']};});_0x55b0c5[_0x2e38('0x31')]=_[_0x2e38('0x2c')](_0x5e397f,'name');_0x55b0c5[_0x2e38('0x32')]=_[_0x2e38('0x33')](_0xcd7e2a[_0x2e38('0x32')]);_0x55b0c5['filters']=_[_0x2e38('0x34')](_0x55b0c5[_0x2e38('0x31')],_0x55b0c5[_0x2e38('0x32')]);_0x52ea4f[_0x2e38('0x35')]=_[_0x2e38('0x34')](_0x55b0c5[_0x2e38('0x31')],qs[_0x2e38('0x36')](_0xcd7e2a[_0x2e38('0x32')]['fields']));_0x52ea4f[_0x2e38('0x35')]=_0x52ea4f['attributes'][_0x2e38('0x37')]?_0x52ea4f[_0x2e38('0x35')]:_0x55b0c5[_0x2e38('0x31')];if(!_0xcd7e2a[_0x2e38('0x32')][_0x2e38('0x38')](_0x2e38('0x39'))){_0x52ea4f[_0x2e38('0x1f')]=qs[_0x2e38('0x1f')](_0xcd7e2a[_0x2e38('0x32')][_0x2e38('0x1f')]);_0x52ea4f[_0x2e38('0x1c')]=qs['offset'](_0xcd7e2a[_0x2e38('0x32')][_0x2e38('0x1c')]);}_0x52ea4f[_0x2e38('0x3a')]=qs[_0x2e38('0x3b')](_0xcd7e2a[_0x2e38('0x32')][_0x2e38('0x3b')]);_0x52ea4f[_0x2e38('0x3c')]=qs[_0x2e38('0x3d')](_['pick'](_0xcd7e2a[_0x2e38('0x32')],_0x55b0c5[_0x2e38('0x3d')]),_0x5e397f);if(_0xcd7e2a[_0x2e38('0x32')][_0x2e38('0x3e')]){_0x52ea4f[_0x2e38('0x3c')]=_[_0x2e38('0x3f')](_0x52ea4f[_0x2e38('0x3c')],{'$or':_[_0x2e38('0x2c')](_0x5e397f,function(_0x149b8c){if(_0x149b8c[_0x2e38('0x30')]!==_0x2e38('0x40')){var _0x42b1d4={};_0x42b1d4[_0x149b8c[_0x2e38('0x29')]]={'$like':'%'+_0xcd7e2a[_0x2e38('0x32')]['filter']+'%'};return _0x42b1d4;}})});}_0x52ea4f=_[_0x2e38('0x3f')]({},_0x52ea4f,_0xcd7e2a['options']);var _0x39b71a={'where':_0x52ea4f[_0x2e38('0x3c')]};return db['FreshsalesConfiguration'][_0x2e38('0x1e')](_0x39b71a)[_0x2e38('0x26')](function(_0x7ad3ae){_0xb7608c[_0x2e38('0x1e')]=_0x7ad3ae;if(_0xcd7e2a['query']['includeAll']){_0x52ea4f[_0x2e38('0x41')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x2e38('0x42')](_0x52ea4f);})['then'](function(_0x4dfdf0){_0xb7608c['rows']=_0x4dfdf0;return _0xb7608c;})['then'](respondWithFilteredResult(_0x3a583e,_0x52ea4f))[_0x2e38('0x43')](handleError(_0x3a583e,null));};exports[_0x2e38('0x44')]=function(_0x29446a,_0x5e4ebe){var _0x9f6c03={'raw':![],'where':{'id':_0x29446a[_0x2e38('0x45')]['id']}},_0x184184={};_0x184184[_0x2e38('0x31')]=_[_0x2e38('0x33')](db[_0x2e38('0x2d')][_0x2e38('0x2e')]);_0x184184[_0x2e38('0x32')]=_[_0x2e38('0x33')](_0x29446a[_0x2e38('0x32')]);_0x184184[_0x2e38('0x3d')]=_['intersection'](_0x184184[_0x2e38('0x31')],_0x184184['query']);_0x9f6c03[_0x2e38('0x35')]=_['intersection'](_0x184184[_0x2e38('0x31')],qs[_0x2e38('0x36')](_0x29446a[_0x2e38('0x32')][_0x2e38('0x36')]));_0x9f6c03[_0x2e38('0x35')]=_0x9f6c03[_0x2e38('0x35')][_0x2e38('0x37')]?_0x9f6c03[_0x2e38('0x35')]:_0x184184['model'];if(_0x29446a[_0x2e38('0x32')][_0x2e38('0x46')]){_0x9f6c03[_0x2e38('0x41')]=[{'all':!![]}];}_0x9f6c03=_[_0x2e38('0x3f')]({},_0x9f6c03,_0x29446a[_0x2e38('0x47')]);return db[_0x2e38('0x2d')][_0x2e38('0x48')](_0x9f6c03)[_0x2e38('0x26')](handleEntityNotFound(_0x5e4ebe,null))[_0x2e38('0x26')](respondWithResult(_0x5e4ebe,null))[_0x2e38('0x43')](handleError(_0x5e4ebe,null));};exports['create']=function(_0x56bd4d,_0x2642b8){return db[_0x2e38('0x2d')][_0x2e38('0x49')](_0x56bd4d['body'],{})[_0x2e38('0x26')](respondWithResult(_0x2642b8,0xc9))['catch'](handleError(_0x2642b8,null));};exports['update']=function(_0xeae80,_0x133c85){if(_0xeae80[_0x2e38('0x4a')]['id']){delete _0xeae80['body']['id'];}return db[_0x2e38('0x2d')][_0x2e38('0x48')]({'where':{'id':_0xeae80[_0x2e38('0x45')]['id']}})['then'](handleEntityNotFound(_0x133c85,null))[_0x2e38('0x26')](saveUpdates(_0xeae80[_0x2e38('0x4a')],null))['then'](respondWithResult(_0x133c85,null))[_0x2e38('0x43')](handleError(_0x133c85,null));};exports[_0x2e38('0x27')]=function(_0x26fcb3,_0x1aa656){return db[_0x2e38('0x2d')]['find']({'where':{'id':_0x26fcb3[_0x2e38('0x45')]['id']}})[_0x2e38('0x26')](handleEntityNotFound(_0x1aa656,null))[_0x2e38('0x26')](removeEntity(_0x1aa656,null))[_0x2e38('0x43')](handleError(_0x1aa656,null));};exports['getSubjects']=function(_0x2cf516,_0x382b6b,_0x23dbf9){var _0x5dd787={};var _0x1c7d8b={};var _0x1450be;var _0x15619b;return db[_0x2e38('0x2d')][_0x2e38('0x4b')]({'where':{'id':_0x2cf516['params']['id']}})[_0x2e38('0x26')](handleEntityNotFound(_0x382b6b,null))[_0x2e38('0x26')](function(_0x4d113f){if(_0x4d113f){_0x1450be=_0x4d113f;_0x1c7d8b['model']=_[_0x2e38('0x33')](db[_0x2e38('0x4c')][_0x2e38('0x2e')]);_0x1c7d8b[_0x2e38('0x32')]=_[_0x2e38('0x33')](_0x2cf516[_0x2e38('0x32')]);_0x1c7d8b[_0x2e38('0x3d')]=_[_0x2e38('0x34')](_0x1c7d8b[_0x2e38('0x31')],_0x1c7d8b[_0x2e38('0x32')]);_0x5dd787['attributes']=_['intersection'](_0x1c7d8b[_0x2e38('0x31')],qs['fields'](_0x2cf516['query'][_0x2e38('0x36')]));_0x5dd787[_0x2e38('0x35')]=_0x5dd787[_0x2e38('0x35')][_0x2e38('0x37')]?_0x5dd787[_0x2e38('0x35')]:_0x1c7d8b['model'];_0x5dd787[_0x2e38('0x3a')]=qs[_0x2e38('0x3b')](_0x2cf516[_0x2e38('0x32')][_0x2e38('0x3b')]);_0x5dd787[_0x2e38('0x3c')]=qs[_0x2e38('0x3d')](_[_0x2e38('0x4d')](_0x2cf516[_0x2e38('0x32')],_0x1c7d8b[_0x2e38('0x3d')]));if(_0x2cf516[_0x2e38('0x32')]['filter']){_0x5dd787[_0x2e38('0x3c')]=_[_0x2e38('0x3f')](_0x5dd787[_0x2e38('0x3c')],{'$or':_['map'](_0x5dd787[_0x2e38('0x35')],function(_0x296f48){var _0x4503ef={};_0x4503ef[_0x296f48]={'$like':'%'+_0x2cf516[_0x2e38('0x32')][_0x2e38('0x3e')]+'%'};return _0x4503ef;})});}_0x5dd787=_[_0x2e38('0x3f')]({},_0x5dd787,_0x2cf516['options']);return _0x1450be[_0x2e38('0x4e')](_0x5dd787);}})['then'](function(_0x4d966d){if(_0x4d966d){_0x15619b=_0x4d966d['length'];if(!_0x2cf516[_0x2e38('0x32')][_0x2e38('0x38')]('nolimit')){_0x5dd787['limit']=qs[_0x2e38('0x1f')](_0x2cf516[_0x2e38('0x32')][_0x2e38('0x1f')]);_0x5dd787[_0x2e38('0x1c')]=qs[_0x2e38('0x1c')](_0x2cf516[_0x2e38('0x32')]['offset']);}return _0x1450be[_0x2e38('0x4e')](_0x5dd787);}})[_0x2e38('0x26')](function(_0x596f9e){if(_0x596f9e){return _0x596f9e?{'count':_0x15619b,'rows':_0x596f9e}:null;}})[_0x2e38('0x26')](respondWithResult(_0x382b6b,null))['catch'](handleError(_0x382b6b,null));};exports[_0x2e38('0x4f')]=function(_0x4a6cd8,_0x239792,_0x43a918){var _0x3d57a5={};var _0x1cc20b={};var _0x1c2745;var _0x4e1ac2;return db[_0x2e38('0x2d')][_0x2e38('0x4b')]({'where':{'id':_0x4a6cd8[_0x2e38('0x45')]['id']}})[_0x2e38('0x26')](handleEntityNotFound(_0x239792,null))['then'](function(_0x325b91){if(_0x325b91){_0x1c2745=_0x325b91;_0x1cc20b[_0x2e38('0x31')]=_['keys'](db[_0x2e38('0x4c')]['rawAttributes']);_0x1cc20b['query']=_[_0x2e38('0x33')](_0x4a6cd8[_0x2e38('0x32')]);_0x1cc20b['filters']=_['intersection'](_0x1cc20b['model'],_0x1cc20b[_0x2e38('0x32')]);_0x3d57a5[_0x2e38('0x35')]=_[_0x2e38('0x34')](_0x1cc20b['model'],qs[_0x2e38('0x36')](_0x4a6cd8[_0x2e38('0x32')][_0x2e38('0x36')]));_0x3d57a5['attributes']=_0x3d57a5[_0x2e38('0x35')][_0x2e38('0x37')]?_0x3d57a5[_0x2e38('0x35')]:_0x1cc20b[_0x2e38('0x31')];_0x3d57a5[_0x2e38('0x3a')]=qs[_0x2e38('0x3b')](_0x4a6cd8[_0x2e38('0x32')][_0x2e38('0x3b')]);_0x3d57a5[_0x2e38('0x3c')]=qs[_0x2e38('0x3d')](_['pick'](_0x4a6cd8[_0x2e38('0x32')],_0x1cc20b[_0x2e38('0x3d')]));if(_0x4a6cd8[_0x2e38('0x32')]['filter']){_0x3d57a5['where']=_['merge'](_0x3d57a5[_0x2e38('0x3c')],{'$or':_[_0x2e38('0x2c')](_0x3d57a5[_0x2e38('0x35')],function(_0x1da5f6){var _0x285cb2={};_0x285cb2[_0x1da5f6]={'$like':'%'+_0x4a6cd8[_0x2e38('0x32')][_0x2e38('0x3e')]+'%'};return _0x285cb2;})});}_0x3d57a5=_['merge']({},_0x3d57a5,_0x4a6cd8[_0x2e38('0x47')]);return _0x1c2745[_0x2e38('0x4f')](_0x3d57a5);}})['then'](function(_0x6cf77a){if(_0x6cf77a){_0x4e1ac2=_0x6cf77a[_0x2e38('0x37')];if(!_0x4a6cd8['query']['hasOwnProperty'](_0x2e38('0x39'))){_0x3d57a5['limit']=qs[_0x2e38('0x1f')](_0x4a6cd8[_0x2e38('0x32')][_0x2e38('0x1f')]);_0x3d57a5[_0x2e38('0x1c')]=qs['offset'](_0x4a6cd8[_0x2e38('0x32')][_0x2e38('0x1c')]);}return _0x1c2745['getDescriptions'](_0x3d57a5);}})[_0x2e38('0x26')](function(_0x257fba){if(_0x257fba){return _0x257fba?{'count':_0x4e1ac2,'rows':_0x257fba}:null;}})[_0x2e38('0x26')](respondWithResult(_0x239792,null))[_0x2e38('0x43')](handleError(_0x239792,null));};exports[_0x2e38('0x50')]=function(_0x227013,_0x484414,_0x1baa69){var _0x5a6fe4={};var _0x214405={};var _0x2a75ee;var _0x362542;return db[_0x2e38('0x2d')]['findOne']({'where':{'id':_0x227013[_0x2e38('0x45')]['id']}})['then'](handleEntityNotFound(_0x484414,null))['then'](function(_0x4ca0d2){if(_0x4ca0d2){_0x2a75ee=_0x4ca0d2;_0x214405[_0x2e38('0x31')]=_[_0x2e38('0x33')](db[_0x2e38('0x4c')]['rawAttributes']);_0x214405[_0x2e38('0x32')]=_[_0x2e38('0x33')](_0x227013['query']);_0x214405['filters']=_['intersection'](_0x214405[_0x2e38('0x31')],_0x214405[_0x2e38('0x32')]);_0x5a6fe4['attributes']=_['intersection'](_0x214405[_0x2e38('0x31')],qs[_0x2e38('0x36')](_0x227013[_0x2e38('0x32')][_0x2e38('0x36')]));_0x5a6fe4[_0x2e38('0x35')]=_0x5a6fe4[_0x2e38('0x35')][_0x2e38('0x37')]?_0x5a6fe4[_0x2e38('0x35')]:_0x214405[_0x2e38('0x31')];_0x5a6fe4[_0x2e38('0x3a')]=qs['sort'](_0x227013[_0x2e38('0x32')][_0x2e38('0x3b')]);_0x5a6fe4[_0x2e38('0x3c')]=qs[_0x2e38('0x3d')](_[_0x2e38('0x4d')](_0x227013['query'],_0x214405[_0x2e38('0x3d')]));if(_0x227013[_0x2e38('0x32')][_0x2e38('0x3e')]){_0x5a6fe4[_0x2e38('0x3c')]=_[_0x2e38('0x3f')](_0x5a6fe4['where'],{'$or':_[_0x2e38('0x2c')](_0x5a6fe4[_0x2e38('0x35')],function(_0x24675d){var _0x5631d8={};_0x5631d8[_0x24675d]={'$like':'%'+_0x227013['query'][_0x2e38('0x3e')]+'%'};return _0x5631d8;})});}_0x5a6fe4=_[_0x2e38('0x3f')]({},_0x5a6fe4,_0x227013[_0x2e38('0x47')]);return _0x2a75ee[_0x2e38('0x50')](_0x5a6fe4);}})['then'](function(_0x8e95fb){if(_0x8e95fb){_0x362542=_0x8e95fb[_0x2e38('0x37')];if(!_0x227013['query'][_0x2e38('0x38')]('nolimit')){_0x5a6fe4[_0x2e38('0x1f')]=qs[_0x2e38('0x1f')](_0x227013[_0x2e38('0x32')][_0x2e38('0x1f')]);_0x5a6fe4['offset']=qs['offset'](_0x227013[_0x2e38('0x32')][_0x2e38('0x1c')]);}return _0x2a75ee[_0x2e38('0x50')](_0x5a6fe4);}})[_0x2e38('0x26')](function(_0xc9e809){if(_0xc9e809){return _0xc9e809?{'count':_0x362542,'rows':_0xc9e809}:null;}})[_0x2e38('0x26')](respondWithResult(_0x484414,null))[_0x2e38('0x43')](handleError(_0x484414,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index db5f63e..df6d431 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 _0x37e8=['define','int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intFreshsalesConfiguration.attributes'];(function(_0x2df42a,_0x3a8708){var _0x562297=function(_0x320e84){while(--_0x320e84){_0x2df42a['push'](_0x2df42a['shift']());}};_0x562297(++_0x3a8708);}(_0x37e8,0x13a));var _0x837e=function(_0x3442a2,_0x3076af){_0x3442a2=_0x3442a2-0x0;var _0x3fd1e5=_0x37e8[_0x3442a2];return _0x3fd1e5;};'use strict';var _=require(_0x837e('0x0'));var util=require(_0x837e('0x1'));var logger=require(_0x837e('0x2'))(_0x837e('0x3'));var moment=require(_0x837e('0x4'));var BPromise=require(_0x837e('0x5'));var rp=require(_0x837e('0x6'));var fs=require('fs');var path=require(_0x837e('0x7'));var rimraf=require(_0x837e('0x8'));var config=require('../../config/environment');var attributes=require(_0x837e('0x9'));module['exports']=function(_0x39f9f0,_0x3a3faa){return _0x39f9f0[_0x837e('0xa')]('FreshsalesConfiguration',attributes,{'tableName':_0x837e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4dac=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger'];(function(_0x2464a,_0x1905f3){var _0xda20df=function(_0x4b551a){while(--_0x4b551a){_0x2464a['push'](_0x2464a['shift']());}};_0xda20df(++_0x1905f3);}(_0x4dac,0x19d));var _0xc4da=function(_0x2d4c59,_0xc7dea0){_0x2d4c59=_0x2d4c59-0x0;var _0x134b9b=_0x4dac[_0x2d4c59];return _0x134b9b;};'use strict';var _=require(_0xc4da('0x0'));var util=require(_0xc4da('0x1'));var logger=require(_0xc4da('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc4da('0x3'));var rp=require(_0xc4da('0x4'));var fs=require('fs');var path=require(_0xc4da('0x5'));var rimraf=require(_0xc4da('0x6'));var config=require(_0xc4da('0x7'));var attributes=require(_0xc4da('0x8'));module[_0xc4da('0x9')]=function(_0x35d2ba,_0x276a5c){return _0x35d2ba[_0xc4da('0xa')](_0xc4da('0xb'),attributes,{'tableName':_0xc4da('0xc'),'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 22579e8..98858a6 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 _0x5ca3=['http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x21f982,_0xf9da7a){var _0x5bf49a=function(_0x3831bc){while(--_0x3831bc){_0x21f982['push'](_0x21f982['shift']());}};_0x5bf49a(++_0xf9da7a);}(_0x5ca3,0x1f0));var _0x35ca=function(_0x27842c,_0x324fcb){_0x27842c=_0x27842c-0x0;var _0x493de8=_0x5ca3[_0x27842c];return _0x493de8;};'use strict';var _=require(_0x35ca('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x35ca('0x1'));var fs=require('fs');var Redis=require(_0x35ca('0x2'));var db=require(_0x35ca('0x3'))['db'];var utils=require(_0x35ca('0x4'));var logger=require(_0x35ca('0x5'))(_0x35ca('0x6'));var config=require(_0x35ca('0x7'));var jayson=require(_0x35ca('0x8'));var client=jayson[_0x35ca('0x9')][_0x35ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f4437,_0x46961a,_0x579534){return new BPromise(function(_0x23fa59,_0x171719){return client[_0x35ca('0xb')](_0x1f4437,_0x579534)[_0x35ca('0xc')](function(_0x5b80c3){logger[_0x35ca('0xd')](_0x35ca('0xe'),_0x46961a,'request\x20sent');logger[_0x35ca('0xf')](_0x35ca('0x10'),_0x46961a,_0x35ca('0x11'),JSON[_0x35ca('0x12')](_0x5b80c3));if(_0x5b80c3['error']){if(_0x5b80c3['error']['code']===0x1f4){logger[_0x35ca('0x13')](_0x35ca('0xe'),_0x46961a,_0x5b80c3['error']['message']);return _0x171719(_0x5b80c3['error'][_0x35ca('0x14')]);}logger[_0x35ca('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x46961a,_0x5b80c3[_0x35ca('0x13')]['message']);return _0x23fa59(_0x5b80c3[_0x35ca('0x13')][_0x35ca('0x14')]);}else{logger['info'](_0x35ca('0xe'),_0x46961a,_0x35ca('0x11'));_0x23fa59(_0x5b80c3['result'][_0x35ca('0x14')]);}})[_0x35ca('0x15')](function(_0x1898d2){logger['error'](_0x35ca('0xe'),_0x46961a,_0x1898d2);_0x171719(_0x1898d2);});});} \ No newline at end of file +var _0x5f0f=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0xad57ee,_0x2823a6){var _0x3eaea9=function(_0x185650){while(--_0x185650){_0xad57ee['push'](_0xad57ee['shift']());}};_0x3eaea9(++_0x2823a6);}(_0x5f0f,0xbe));var _0xf5f0=function(_0x23a398,_0x544648){_0x23a398=_0x23a398-0x0;var _0x5077de=_0x5f0f[_0x23a398];return _0x5077de;};'use strict';var _=require(_0xf5f0('0x0'));var util=require('util');var moment=require(_0xf5f0('0x1'));var BPromise=require(_0xf5f0('0x2'));var rs=require(_0xf5f0('0x3'));var fs=require('fs');var Redis=require(_0xf5f0('0x4'));var db=require(_0xf5f0('0x5'))['db'];var utils=require(_0xf5f0('0x6'));var logger=require(_0xf5f0('0x7'))('rpc');var config=require(_0xf5f0('0x8'));var jayson=require(_0xf5f0('0x9'));var client=jayson[_0xf5f0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2da6eb,_0x1a1f50,_0x1ca695){return new BPromise(function(_0x5c9ecc,_0x281197){return client[_0xf5f0('0xb')](_0x2da6eb,_0x1ca695)['then'](function(_0x5efc2f){logger['info'](_0xf5f0('0xc'),_0x1a1f50,_0xf5f0('0xd'));logger[_0xf5f0('0xe')](_0xf5f0('0xf'),_0x1a1f50,_0xf5f0('0xd'),JSON['stringify'](_0x5efc2f));if(_0x5efc2f[_0xf5f0('0x10')]){if(_0x5efc2f['error'][_0xf5f0('0x11')]===0x1f4){logger[_0xf5f0('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1a1f50,_0x5efc2f[_0xf5f0('0x10')][_0xf5f0('0x12')]);return _0x281197(_0x5efc2f[_0xf5f0('0x10')]['message']);}logger[_0xf5f0('0x10')](_0xf5f0('0xc'),_0x1a1f50,_0x5efc2f['error'][_0xf5f0('0x12')]);return _0x5c9ecc(_0x5efc2f['error'][_0xf5f0('0x12')]);}else{logger['info'](_0xf5f0('0xc'),_0x1a1f50,_0xf5f0('0xd'));_0x5c9ecc(_0x5efc2f[_0xf5f0('0x13')][_0xf5f0('0x12')]);}})[_0xf5f0('0x14')](function(_0xea778d){logger[_0xf5f0('0x10')](_0xf5f0('0xc'),_0x1a1f50,_0xea778d);_0x281197(_0xea778d);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 24f87fd..053a356 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 _0x6fad=['../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','index','get','/:id','show','create','put','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x2f8964,_0x2e16d3){var _0x2d6a6b=function(_0x25e2b2){while(--_0x25e2b2){_0x2f8964['push'](_0x2f8964['shift']());}};_0x2d6a6b(++_0x2e16d3);}(_0x6fad,0x174));var _0xd6fa=function(_0x20a573,_0x3328b4){_0x20a573=_0x20a573-0x0;var _0x399adf=_0x6fad[_0x20a573];return _0x399adf;};'use strict';var multer=require(_0xd6fa('0x0'));var util=require(_0xd6fa('0x1'));var path=require(_0xd6fa('0x2'));var timeout=require(_0xd6fa('0x3'));var express=require('express');var router=express[_0xd6fa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd6fa('0x5'));var interaction=require(_0xd6fa('0x6'));var config=require(_0xd6fa('0x7'));var controller=require(_0xd6fa('0x8'));router['get']('/',auth[_0xd6fa('0x9')](),controller[_0xd6fa('0xa')]);router[_0xd6fa('0xb')](_0xd6fa('0xc'),auth['isAuthenticated'](),controller[_0xd6fa('0xd')]);router['post']('/',auth[_0xd6fa('0x9')](),controller[_0xd6fa('0xe')]);router[_0xd6fa('0xf')](_0xd6fa('0xc'),auth[_0xd6fa('0x9')](),controller['update']);router['delete'](_0xd6fa('0xc'),auth[_0xd6fa('0x9')](),controller[_0xd6fa('0x10')]);module[_0xd6fa('0x11')]=router; \ No newline at end of file +var _0xa2ab=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','index','get','show','post','put','/:id','update','delete','destroy','exports','multer'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xa2ab,0xa7));var _0xba2a=function(_0x355dd1,_0x23770b){_0x355dd1=_0x355dd1-0x0;var _0x3110f1=_0xa2ab[_0x355dd1];return _0x3110f1;};'use strict';var multer=require(_0xba2a('0x0'));var util=require(_0xba2a('0x1'));var path=require(_0xba2a('0x2'));var timeout=require('connect-timeout');var express=require(_0xba2a('0x3'));var router=express[_0xba2a('0x4')]();var fs_extra=require(_0xba2a('0x5'));var auth=require(_0xba2a('0x6'));var interaction=require(_0xba2a('0x7'));var config=require(_0xba2a('0x8'));var controller=require(_0xba2a('0x9'));router['get']('/',auth[_0xba2a('0xa')](),controller[_0xba2a('0xb')]);router[_0xba2a('0xc')]('/:id',auth[_0xba2a('0xa')](),controller[_0xba2a('0xd')]);router[_0xba2a('0xe')]('/',auth[_0xba2a('0xa')](),controller['create']);router[_0xba2a('0xf')](_0xba2a('0x10'),auth[_0xba2a('0xa')](),controller[_0xba2a('0x11')]);router[_0xba2a('0x12')]('/:id',auth[_0xba2a('0xa')](),controller[_0xba2a('0x13')]);module[_0xba2a('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index c02edf7..2decc7b 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 _0xcbae=['variable','customVariable','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xcbae,0x1eb));var _0xecba=function(_0x2c564a,_0xae4170){_0x2c564a=_0x2c564a-0x0;var _0x71e8d=_0xcbae[_0x2c564a];return _0x71e8d;};'use strict';var Sequelize=require(_0xecba('0x0'));module[_0xecba('0x1')]={'type':{'type':Sequelize[_0xecba('0x2')](_0xecba('0x3'),_0xecba('0x4'),_0xecba('0x5'),'keyValue',_0xecba('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xecba('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xecba('0x2')](_0xecba('0x3'),_0xecba('0x4'),_0xecba('0x5'))},'keyContent':{'type':Sequelize[_0xecba('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xecba('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2449=['string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2449,0x114));var _0x9244=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2449[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9244('0x0'));module[_0x9244('0x1')]={'type':{'type':Sequelize[_0x9244('0x2')](_0x9244('0x3'),_0x9244('0x4'),_0x9244('0x5'),'keyValue',_0x9244('0x6')),'defaultValue':_0x9244('0x3')},'content':{'type':Sequelize[_0x9244('0x7')]},'key':{'type':Sequelize[_0x9244('0x7')]},'keyType':{'type':Sequelize[_0x9244('0x2')](_0x9244('0x3'),_0x9244('0x4'),_0x9244('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9244('0x7')]},'customField':{'type':Sequelize[_0x9244('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index ee5cbec..261f4f8 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 _0x1dfa=['fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','save','update','destroy','then','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','intersection','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0xc98246,_0x515e55){var _0x47d341=function(_0x252663){while(--_0x252663){_0xc98246['push'](_0xc98246['shift']());}};_0x47d341(++_0x515e55);}(_0x1dfa,0x124));var _0xa1df=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x1dfa[_0x34bc30];return _0x5706de;};'use strict';var emlformat=require(_0xa1df('0x0'));var rimraf=require(_0xa1df('0x1'));var zipdir=require(_0xa1df('0x2'));var jsonpatch=require(_0xa1df('0x3'));var rp=require('request-promise');var moment=require(_0xa1df('0x4'));var BPromise=require(_0xa1df('0x5'));var Mustache=require(_0xa1df('0x6'));var util=require(_0xa1df('0x7'));var path=require(_0xa1df('0x8'));var sox=require(_0xa1df('0x9'));var csv=require(_0xa1df('0xa'));var ejs=require(_0xa1df('0xb'));var fs=require('fs');var fs_extra=require(_0xa1df('0xc'));var _=require('lodash');var squel=require(_0xa1df('0xd'));var crypto=require(_0xa1df('0xe'));var jsforce=require(_0xa1df('0xf'));var deskjs=require(_0xa1df('0x10'));var toCsv=require(_0xa1df('0xa'));var querystring=require(_0xa1df('0x11'));var Papa=require(_0xa1df('0x12'));var Redis=require(_0xa1df('0x13'));var authService=require(_0xa1df('0x14'));var qs=require(_0xa1df('0x15'));var as=require(_0xa1df('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa1df('0x17'))(_0xa1df('0x18'));var utils=require('../../config/utils');var config=require(_0xa1df('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa1df('0x1a'))['db'];function respondWithStatusCode(_0x28e98a,_0xf24869){_0xf24869=_0xf24869||0xcc;return function(_0x8ef9ed){if(_0x8ef9ed){return _0x28e98a[_0xa1df('0x1b')](_0xf24869);}return _0x28e98a[_0xa1df('0x1c')](_0xf24869)[_0xa1df('0x1d')]();};}function respondWithResult(_0x455d6b,_0x5d3c2b){_0x5d3c2b=_0x5d3c2b||0xc8;return function(_0x1713cd){if(_0x1713cd){return _0x455d6b['status'](_0x5d3c2b)[_0xa1df('0x1e')](_0x1713cd);}};}function respondWithFilteredResult(_0x3921dd,_0x7b76b4){return function(_0x48397d){if(_0x48397d){var _0x3b1ee2=typeof _0x7b76b4[_0xa1df('0x1f')]===_0xa1df('0x20')&&typeof _0x7b76b4[_0xa1df('0x21')]===_0xa1df('0x20');var _0x37ce66=_0x48397d['count'];var _0x35b8bc=_0x3b1ee2?0x0:_0x7b76b4[_0xa1df('0x1f')];var _0x36009e=_0x3b1ee2?_0x48397d['count']:_0x7b76b4[_0xa1df('0x1f')]+_0x7b76b4['limit'];var _0x24a0b8;if(_0x36009e>=_0x37ce66){_0x36009e=_0x37ce66;_0x24a0b8=0xc8;}else{_0x24a0b8=0xce;}_0x3921dd[_0xa1df('0x1c')](_0x24a0b8);return _0x3921dd['set'](_0xa1df('0x22'),_0x35b8bc+'-'+_0x36009e+'/'+_0x37ce66)[_0xa1df('0x1e')](_0x48397d);}return null;};}function patchUpdates(_0x15fb8d){return function(_0x35db0d){try{jsonpatch['apply'](_0x35db0d,_0x15fb8d,!![]);}catch(_0x137847){return BPromise['reject'](_0x137847);}return _0x35db0d[_0xa1df('0x23')]();};}function saveUpdates(_0x55a8e9,_0x2c2944){return function(_0x11ee1c){if(_0x11ee1c){return _0x11ee1c[_0xa1df('0x24')](_0x55a8e9)['then'](function(_0x142738){return _0x142738;});}return null;};}function removeEntity(_0xf80251,_0x2fef6a){return function(_0x43da60){if(_0x43da60){return _0x43da60[_0xa1df('0x25')]()[_0xa1df('0x26')](function(){_0xf80251[_0xa1df('0x1c')](0xcc)[_0xa1df('0x1d')]();});}};}function handleEntityNotFound(_0x3273de,_0x2e136e){return function(_0x437e4b){if(!_0x437e4b){_0x3273de[_0xa1df('0x1b')](0x194);}return _0x437e4b;};}function handleError(_0x274f32,_0x274f3e){_0x274f3e=_0x274f3e||0x1f4;return function(_0x4d69b7){logger[_0xa1df('0x27')](_0x4d69b7[_0xa1df('0x28')]);if(_0x4d69b7[_0xa1df('0x29')]){delete _0x4d69b7[_0xa1df('0x29')];}_0x274f32[_0xa1df('0x1c')](_0x274f3e)[_0xa1df('0x2a')](_0x4d69b7);};}exports[_0xa1df('0x2b')]=function(_0x32c7ff,_0x4fc94e){var _0x47f105={},_0x2a2a59={},_0x15b209={'count':0x0,'rows':[]};var _0x71da69=_[_0xa1df('0x2c')](db[_0xa1df('0x2d')][_0xa1df('0x2e')],function(_0x111799){return{'name':_0x111799[_0xa1df('0x2f')],'type':_0x111799[_0xa1df('0x30')][_0xa1df('0x31')]};});_0x2a2a59[_0xa1df('0x32')]=_[_0xa1df('0x2c')](_0x71da69,'name');_0x2a2a59[_0xa1df('0x33')]=_[_0xa1df('0x34')](_0x32c7ff[_0xa1df('0x33')]);_0x2a2a59[_0xa1df('0x35')]=_['intersection'](_0x2a2a59[_0xa1df('0x32')],_0x2a2a59[_0xa1df('0x33')]);_0x47f105[_0xa1df('0x36')]=_['intersection'](_0x2a2a59[_0xa1df('0x32')],qs[_0xa1df('0x37')](_0x32c7ff['query'][_0xa1df('0x37')]));_0x47f105['attributes']=_0x47f105['attributes']['length']?_0x47f105[_0xa1df('0x36')]:_0x2a2a59[_0xa1df('0x32')];if(!_0x32c7ff[_0xa1df('0x33')][_0xa1df('0x38')](_0xa1df('0x39'))){_0x47f105[_0xa1df('0x21')]=qs['limit'](_0x32c7ff[_0xa1df('0x33')][_0xa1df('0x21')]);_0x47f105['offset']=qs[_0xa1df('0x1f')](_0x32c7ff[_0xa1df('0x33')][_0xa1df('0x1f')]);}_0x47f105['order']=qs[_0xa1df('0x3a')](_0x32c7ff['query'][_0xa1df('0x3a')]);_0x47f105[_0xa1df('0x3b')]=qs[_0xa1df('0x35')](_[_0xa1df('0x3c')](_0x32c7ff[_0xa1df('0x33')],_0x2a2a59[_0xa1df('0x35')]),_0x71da69);if(_0x32c7ff[_0xa1df('0x33')][_0xa1df('0x3d')]){_0x47f105[_0xa1df('0x3b')]=_['merge'](_0x47f105[_0xa1df('0x3b')],{'$or':_[_0xa1df('0x2c')](_0x71da69,function(_0x57887f){if(_0x57887f[_0xa1df('0x30')]!==_0xa1df('0x3e')){var _0x255109={};_0x255109[_0x57887f[_0xa1df('0x29')]]={'$like':'%'+_0x32c7ff['query'][_0xa1df('0x3d')]+'%'};return _0x255109;}})});}_0x47f105=_['merge']({},_0x47f105,_0x32c7ff[_0xa1df('0x3f')]);var _0x44c9d3={'where':_0x47f105['where']};return db['FreshsalesField'][_0xa1df('0x40')](_0x44c9d3)[_0xa1df('0x26')](function(_0x17bed7){_0x15b209[_0xa1df('0x40')]=_0x17bed7;if(_0x32c7ff['query'][_0xa1df('0x41')]){_0x47f105[_0xa1df('0x42')]=[{'all':!![]}];}return db[_0xa1df('0x2d')][_0xa1df('0x43')](_0x47f105);})[_0xa1df('0x26')](function(_0xb7c391){_0x15b209['rows']=_0xb7c391;return _0x15b209;})[_0xa1df('0x26')](respondWithFilteredResult(_0x4fc94e,_0x47f105))[_0xa1df('0x44')](handleError(_0x4fc94e,null));};exports[_0xa1df('0x45')]=function(_0x4c3a14,_0x26d8a7){var _0x3ca8e6={'raw':!![],'where':{'id':_0x4c3a14[_0xa1df('0x46')]['id']}},_0x340d01={};_0x340d01[_0xa1df('0x32')]=_[_0xa1df('0x34')](db[_0xa1df('0x2d')]['rawAttributes']);_0x340d01[_0xa1df('0x33')]=_[_0xa1df('0x34')](_0x4c3a14['query']);_0x340d01['filters']=_['intersection'](_0x340d01[_0xa1df('0x32')],_0x340d01[_0xa1df('0x33')]);_0x3ca8e6[_0xa1df('0x36')]=_[_0xa1df('0x47')](_0x340d01[_0xa1df('0x32')],qs[_0xa1df('0x37')](_0x4c3a14[_0xa1df('0x33')][_0xa1df('0x37')]));_0x3ca8e6[_0xa1df('0x36')]=_0x3ca8e6[_0xa1df('0x36')][_0xa1df('0x48')]?_0x3ca8e6[_0xa1df('0x36')]:_0x340d01[_0xa1df('0x32')];if(_0x4c3a14[_0xa1df('0x33')][_0xa1df('0x41')]){_0x3ca8e6[_0xa1df('0x42')]=[{'all':!![]}];}_0x3ca8e6=_['merge']({},_0x3ca8e6,_0x4c3a14['options']);return db['FreshsalesField'][_0xa1df('0x49')](_0x3ca8e6)[_0xa1df('0x26')](handleEntityNotFound(_0x26d8a7,null))[_0xa1df('0x26')](respondWithResult(_0x26d8a7,null))[_0xa1df('0x44')](handleError(_0x26d8a7,null));};exports['create']=function(_0x3525ba,_0x1e2065){return db[_0xa1df('0x2d')][_0xa1df('0x4a')](_0x3525ba[_0xa1df('0x4b')],{})[_0xa1df('0x26')](respondWithResult(_0x1e2065,0xc9))[_0xa1df('0x44')](handleError(_0x1e2065,null));};exports[_0xa1df('0x24')]=function(_0xf9a836,_0x241a81){if(_0xf9a836['body']['id']){delete _0xf9a836['body']['id'];}return db[_0xa1df('0x2d')]['find']({'where':{'id':_0xf9a836[_0xa1df('0x46')]['id']}})[_0xa1df('0x26')](handleEntityNotFound(_0x241a81,null))[_0xa1df('0x26')](saveUpdates(_0xf9a836[_0xa1df('0x4b')],null))[_0xa1df('0x26')](respondWithResult(_0x241a81,null))[_0xa1df('0x44')](handleError(_0x241a81,null));};exports[_0xa1df('0x25')]=function(_0x18a6ce,_0xe97c1){return db[_0xa1df('0x2d')][_0xa1df('0x49')]({'where':{'id':_0x18a6ce[_0xa1df('0x46')]['id']}})[_0xa1df('0x26')](handleEntityNotFound(_0xe97c1,null))[_0xa1df('0x26')](removeEntity(_0xe97c1,null))[_0xa1df('0x44')](handleError(_0xe97c1,null));}; \ No newline at end of file +var _0x995f=['../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','FreshsalesField','then','includeAll','include','findAll','rows','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x4032bc,_0x13bac6){var _0xef97b=function(_0x416ab2){while(--_0x416ab2){_0x4032bc['push'](_0x4032bc['shift']());}};_0xef97b(++_0x13bac6);}(_0x995f,0x1a8));var _0xf995=function(_0x337293,_0x2a571d){_0x337293=_0x337293-0x0;var _0x2f7075=_0x995f[_0x337293];return _0x2f7075;};'use strict';var emlformat=require(_0xf995('0x0'));var rimraf=require(_0xf995('0x1'));var zipdir=require(_0xf995('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf995('0x3'));var moment=require(_0xf995('0x4'));var BPromise=require(_0xf995('0x5'));var Mustache=require('mustache');var util=require(_0xf995('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xf995('0x7'));var ejs=require(_0xf995('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf995('0x9'));var squel=require('squel');var crypto=require(_0xf995('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf995('0xb'));var toCsv=require(_0xf995('0x7'));var querystring=require(_0xf995('0xc'));var Papa=require(_0xf995('0xd'));var Redis=require('ioredis');var authService=require(_0xf995('0xe'));var qs=require(_0xf995('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf995('0x10'));var logger=require(_0xf995('0x11'))(_0xf995('0x12'));var utils=require(_0xf995('0x13'));var config=require(_0xf995('0x14'));var licenseUtil=require(_0xf995('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x387db5,_0x35bc3d){_0x35bc3d=_0x35bc3d||0xcc;return function(_0x5ea169){if(_0x5ea169){return _0x387db5[_0xf995('0x16')](_0x35bc3d);}return _0x387db5[_0xf995('0x17')](_0x35bc3d)[_0xf995('0x18')]();};}function respondWithResult(_0x53b669,_0x31cff9){_0x31cff9=_0x31cff9||0xc8;return function(_0x55c89c){if(_0x55c89c){return _0x53b669[_0xf995('0x17')](_0x31cff9)[_0xf995('0x19')](_0x55c89c);}};}function respondWithFilteredResult(_0x42de7a,_0x426d0d){return function(_0x39b659){if(_0x39b659){var _0x2098a8=typeof _0x426d0d[_0xf995('0x1a')]===_0xf995('0x1b')&&typeof _0x426d0d[_0xf995('0x1c')]==='undefined';var _0x3a66e5=_0x39b659[_0xf995('0x1d')];var _0x44a9c6=_0x2098a8?0x0:_0x426d0d[_0xf995('0x1a')];var _0x330da9=_0x2098a8?_0x39b659[_0xf995('0x1d')]:_0x426d0d[_0xf995('0x1a')]+_0x426d0d['limit'];var _0x4ffee4;if(_0x330da9>=_0x3a66e5){_0x330da9=_0x3a66e5;_0x4ffee4=0xc8;}else{_0x4ffee4=0xce;}_0x42de7a[_0xf995('0x17')](_0x4ffee4);return _0x42de7a['set'](_0xf995('0x1e'),_0x44a9c6+'-'+_0x330da9+'/'+_0x3a66e5)[_0xf995('0x19')](_0x39b659);}return null;};}function patchUpdates(_0x4b6b51){return function(_0x4ad073){try{jsonpatch[_0xf995('0x1f')](_0x4ad073,_0x4b6b51,!![]);}catch(_0x26e943){return BPromise[_0xf995('0x20')](_0x26e943);}return _0x4ad073['save']();};}function saveUpdates(_0x33fa7d,_0x116024){return function(_0x547e41){if(_0x547e41){return _0x547e41[_0xf995('0x21')](_0x33fa7d)['then'](function(_0x367117){return _0x367117;});}return null;};}function removeEntity(_0x470c88,_0x4369a2){return function(_0x15d0b9){if(_0x15d0b9){return _0x15d0b9[_0xf995('0x22')]()['then'](function(){_0x470c88['status'](0xcc)[_0xf995('0x18')]();});}};}function handleEntityNotFound(_0x3db28a,_0x2c49ad){return function(_0x4387a6){if(!_0x4387a6){_0x3db28a[_0xf995('0x16')](0x194);}return _0x4387a6;};}function handleError(_0x2ec813,_0x1dbe48){_0x1dbe48=_0x1dbe48||0x1f4;return function(_0x52a1be){logger[_0xf995('0x23')](_0x52a1be[_0xf995('0x24')]);if(_0x52a1be['name']){delete _0x52a1be[_0xf995('0x25')];}_0x2ec813['status'](_0x1dbe48)[_0xf995('0x26')](_0x52a1be);};}exports[_0xf995('0x27')]=function(_0x3e6930,_0x5b60fd){var _0x5339d7={},_0x5d1002={},_0x46ad8e={'count':0x0,'rows':[]};var _0x32ab24=_[_0xf995('0x28')](db['FreshsalesField'][_0xf995('0x29')],function(_0x44bc8d){return{'name':_0x44bc8d[_0xf995('0x2a')],'type':_0x44bc8d[_0xf995('0x2b')][_0xf995('0x2c')]};});_0x5d1002['model']=_['map'](_0x32ab24,_0xf995('0x25'));_0x5d1002[_0xf995('0x2d')]=_[_0xf995('0x2e')](_0x3e6930[_0xf995('0x2d')]);_0x5d1002[_0xf995('0x2f')]=_[_0xf995('0x30')](_0x5d1002[_0xf995('0x31')],_0x5d1002[_0xf995('0x2d')]);_0x5339d7['attributes']=_[_0xf995('0x30')](_0x5d1002[_0xf995('0x31')],qs[_0xf995('0x32')](_0x3e6930[_0xf995('0x2d')][_0xf995('0x32')]));_0x5339d7[_0xf995('0x33')]=_0x5339d7[_0xf995('0x33')][_0xf995('0x34')]?_0x5339d7[_0xf995('0x33')]:_0x5d1002[_0xf995('0x31')];if(!_0x3e6930['query'][_0xf995('0x35')](_0xf995('0x36'))){_0x5339d7[_0xf995('0x1c')]=qs['limit'](_0x3e6930['query'][_0xf995('0x1c')]);_0x5339d7[_0xf995('0x1a')]=qs[_0xf995('0x1a')](_0x3e6930['query'][_0xf995('0x1a')]);}_0x5339d7[_0xf995('0x37')]=qs[_0xf995('0x38')](_0x3e6930[_0xf995('0x2d')]['sort']);_0x5339d7['where']=qs[_0xf995('0x2f')](_['pick'](_0x3e6930[_0xf995('0x2d')],_0x5d1002['filters']),_0x32ab24);if(_0x3e6930[_0xf995('0x2d')][_0xf995('0x39')]){_0x5339d7[_0xf995('0x3a')]=_[_0xf995('0x3b')](_0x5339d7[_0xf995('0x3a')],{'$or':_['map'](_0x32ab24,function(_0x2cc8f9){if(_0x2cc8f9[_0xf995('0x2b')]!==_0xf995('0x3c')){var _0xb2b834={};_0xb2b834[_0x2cc8f9['name']]={'$like':'%'+_0x3e6930['query'][_0xf995('0x39')]+'%'};return _0xb2b834;}})});}_0x5339d7=_[_0xf995('0x3b')]({},_0x5339d7,_0x3e6930[_0xf995('0x3d')]);var _0x59470d={'where':_0x5339d7[_0xf995('0x3a')]};return db[_0xf995('0x3e')][_0xf995('0x1d')](_0x59470d)[_0xf995('0x3f')](function(_0x293c04){_0x46ad8e[_0xf995('0x1d')]=_0x293c04;if(_0x3e6930[_0xf995('0x2d')][_0xf995('0x40')]){_0x5339d7[_0xf995('0x41')]=[{'all':!![]}];}return db['FreshsalesField'][_0xf995('0x42')](_0x5339d7);})[_0xf995('0x3f')](function(_0x30bf05){_0x46ad8e[_0xf995('0x43')]=_0x30bf05;return _0x46ad8e;})[_0xf995('0x3f')](respondWithFilteredResult(_0x5b60fd,_0x5339d7))['catch'](handleError(_0x5b60fd,null));};exports[_0xf995('0x44')]=function(_0x253ef4,_0x21306a){var _0x1c2f89={'raw':!![],'where':{'id':_0x253ef4[_0xf995('0x45')]['id']}},_0x40f76f={};_0x40f76f[_0xf995('0x31')]=_[_0xf995('0x2e')](db[_0xf995('0x3e')][_0xf995('0x29')]);_0x40f76f['query']=_[_0xf995('0x2e')](_0x253ef4['query']);_0x40f76f[_0xf995('0x2f')]=_[_0xf995('0x30')](_0x40f76f[_0xf995('0x31')],_0x40f76f[_0xf995('0x2d')]);_0x1c2f89[_0xf995('0x33')]=_[_0xf995('0x30')](_0x40f76f[_0xf995('0x31')],qs[_0xf995('0x32')](_0x253ef4[_0xf995('0x2d')]['fields']));_0x1c2f89['attributes']=_0x1c2f89[_0xf995('0x33')][_0xf995('0x34')]?_0x1c2f89['attributes']:_0x40f76f[_0xf995('0x31')];if(_0x253ef4[_0xf995('0x2d')][_0xf995('0x40')]){_0x1c2f89[_0xf995('0x41')]=[{'all':!![]}];}_0x1c2f89=_[_0xf995('0x3b')]({},_0x1c2f89,_0x253ef4['options']);return db['FreshsalesField'][_0xf995('0x46')](_0x1c2f89)[_0xf995('0x3f')](handleEntityNotFound(_0x21306a,null))[_0xf995('0x3f')](respondWithResult(_0x21306a,null))[_0xf995('0x47')](handleError(_0x21306a,null));};exports[_0xf995('0x48')]=function(_0x379640,_0x469928){return db[_0xf995('0x3e')][_0xf995('0x48')](_0x379640[_0xf995('0x49')],{})['then'](respondWithResult(_0x469928,0xc9))[_0xf995('0x47')](handleError(_0x469928,null));};exports[_0xf995('0x21')]=function(_0x1fb753,_0x4421fe){if(_0x1fb753[_0xf995('0x49')]['id']){delete _0x1fb753[_0xf995('0x49')]['id'];}return db['FreshsalesField']['find']({'where':{'id':_0x1fb753[_0xf995('0x45')]['id']}})[_0xf995('0x3f')](handleEntityNotFound(_0x4421fe,null))[_0xf995('0x3f')](saveUpdates(_0x1fb753[_0xf995('0x49')],null))['then'](respondWithResult(_0x4421fe,null))['catch'](handleError(_0x4421fe,null));};exports[_0xf995('0x22')]=function(_0x292df9,_0x1cb806){return db[_0xf995('0x3e')][_0xf995('0x46')]({'where':{'id':_0x292df9[_0xf995('0x45')]['id']}})[_0xf995('0x3f')](handleEntityNotFound(_0x1cb806,null))[_0xf995('0x3f')](removeEntity(_0x1cb806,null))[_0xf995('0x47')](handleError(_0x1cb806,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 070e2fb..87be0bb 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 _0x72fa=['../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','FieldId','lodash','util','api','moment','bluebird','rimraf'];(function(_0x4e4061,_0x26503b){var _0x371dbd=function(_0x31a31f){while(--_0x31a31f){_0x4e4061['push'](_0x4e4061['shift']());}};_0x371dbd(++_0x26503b);}(_0x72fa,0x78));var _0xa72f=function(_0x48b4a1,_0x3c2bf4){_0x48b4a1=_0x48b4a1-0x0;var _0x2df379=_0x72fa[_0x48b4a1];return _0x2df379;};'use strict';var _=require(_0xa72f('0x0'));var util=require(_0xa72f('0x1'));var logger=require('../../config/logger')(_0xa72f('0x2'));var moment=require(_0xa72f('0x3'));var BPromise=require(_0xa72f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa72f('0x5'));var config=require(_0xa72f('0x6'));var attributes=require(_0xa72f('0x7'));module[_0xa72f('0x8')]=function(_0x649c2d,_0x411f02){return _0x649c2d[_0xa72f('0x9')](_0xa72f('0xa'),attributes,{'tableName':_0xa72f('0xb'),'paranoid':![],'indexes':[{'name':_0xa72f('0xc'),'fields':['idField',_0xa72f('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x881e=['rimraf','../../config/environment','./intFreshsalesField.attributes','FreshsalesField','int_freshsales_fields','freshsales_unique_index','../../config/logger','api','bluebird','path'];(function(_0x24cb9f,_0x38c86b){var _0x5828c3=function(_0x580745){while(--_0x580745){_0x24cb9f['push'](_0x24cb9f['shift']());}};_0x5828c3(++_0x38c86b);}(_0x881e,0x146));var _0xe881=function(_0xa9dc19,_0x48b11e){_0xa9dc19=_0xa9dc19-0x0;var _0xd4ae11=_0x881e[_0xa9dc19];return _0xd4ae11;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe881('0x0'))(_0xe881('0x1'));var moment=require('moment');var BPromise=require(_0xe881('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe881('0x3'));var rimraf=require(_0xe881('0x4'));var config=require(_0xe881('0x5'));var attributes=require(_0xe881('0x6'));module['exports']=function(_0x1d9bc0,_0xa4fe06){return _0x1d9bc0['define'](_0xe881('0x7'),attributes,{'tableName':_0xe881('0x8'),'paranoid':![],'indexes':[{'name':_0xe881('0x9'),'fields':['idField','FieldId'],'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 57de5f8..f907ef4 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 _0x46ed=['FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x46ed,0x168));var _0xd46e=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x46ed[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var moment=require('moment');var BPromise=require(_0xd46e('0x2'));var rs=require(_0xd46e('0x3'));var fs=require('fs');var Redis=require(_0xd46e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd46e('0x5'));var logger=require(_0xd46e('0x6'))('rpc');var config=require(_0xd46e('0x7'));var jayson=require(_0xd46e('0x8'));var client=jayson[_0xd46e('0x9')][_0xd46e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45e680,_0x855f24,_0x437ea0){return new BPromise(function(_0x144687,_0x31259b){return client[_0xd46e('0xb')](_0x45e680,_0x437ea0)[_0xd46e('0xc')](function(_0x59c88d){logger[_0xd46e('0xd')](_0xd46e('0xe'),_0x855f24,'request\x20sent');logger[_0xd46e('0xf')](_0xd46e('0x10'),_0x855f24,_0xd46e('0x11'),JSON[_0xd46e('0x12')](_0x59c88d));if(_0x59c88d[_0xd46e('0x13')]){if(_0x59c88d[_0xd46e('0x13')]['code']===0x1f4){logger[_0xd46e('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x855f24,_0x59c88d['error'][_0xd46e('0x14')]);return _0x31259b(_0x59c88d[_0xd46e('0x13')]['message']);}logger['error'](_0xd46e('0xe'),_0x855f24,_0x59c88d[_0xd46e('0x13')][_0xd46e('0x14')]);return _0x144687(_0x59c88d[_0xd46e('0x13')]['message']);}else{logger[_0xd46e('0xd')](_0xd46e('0xe'),_0x855f24,_0xd46e('0x11'));_0x144687(_0x59c88d[_0xd46e('0x15')][_0xd46e('0x14')]);}})['catch'](function(_0x1d50a5){logger[_0xd46e('0x13')](_0xd46e('0xe'),_0x855f24,_0x1d50a5);_0x31259b(_0x1d50a5);});});} \ No newline at end of file +var _0xdbf5=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesField,\x20%s,\x20%s','debug','stringify','code','error','message','request\x20sent','result','catch'];(function(_0x48e8cb,_0x153076){var _0x452d7d=function(_0x3e51f8){while(--_0x3e51f8){_0x48e8cb['push'](_0x48e8cb['shift']());}};_0x452d7d(++_0x153076);}(_0xdbf5,0x18c));var _0x5dbf=function(_0xf46e1b,_0x578683){_0xf46e1b=_0xf46e1b-0x0;var _0x3c80f3=_0xdbf5[_0xf46e1b];return _0x3c80f3;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5dbf('0x1'));var fs=require('fs');var Redis=require(_0x5dbf('0x2'));var db=require(_0x5dbf('0x3'))['db'];var utils=require(_0x5dbf('0x4'));var logger=require(_0x5dbf('0x5'))(_0x5dbf('0x6'));var config=require(_0x5dbf('0x7'));var jayson=require(_0x5dbf('0x8'));var client=jayson[_0x5dbf('0x9')][_0x5dbf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x209b7d,_0x88128e,_0x93e657){return new BPromise(function(_0x52b039,_0x134810){return client['request'](_0x209b7d,_0x93e657)[_0x5dbf('0xb')](function(_0x3bec50){logger[_0x5dbf('0xc')](_0x5dbf('0xd'),_0x88128e,'request\x20sent');logger[_0x5dbf('0xe')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x88128e,'request\x20sent',JSON[_0x5dbf('0xf')](_0x3bec50));if(_0x3bec50['error']){if(_0x3bec50['error'][_0x5dbf('0x10')]===0x1f4){logger['error'](_0x5dbf('0xd'),_0x88128e,_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);return _0x134810(_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);}logger['error']('FreshsalesField,\x20%s,\x20%s',_0x88128e,_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);return _0x52b039(_0x3bec50['error'][_0x5dbf('0x12')]);}else{logger[_0x5dbf('0xc')](_0x5dbf('0xd'),_0x88128e,_0x5dbf('0x13'));_0x52b039(_0x3bec50[_0x5dbf('0x14')][_0x5dbf('0x12')]);}})[_0x5dbf('0x15')](function(_0x50ef1d){logger['error'](_0x5dbf('0xd'),_0x88128e,_0x50ef1d);_0x134810(_0x50ef1d);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index c25525f..5036719 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(_0xf106eb,_0x5735e6){var _0x2ca234=function(_0x2b1a0e){while(--_0x2b1a0e){_0xf106eb['push'](_0xf106eb['shift']());}};_0x2ca234(++_0x5735e6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x6b0982,_0x309be6){var _0x47b059=function(_0x2d3f25){while(--_0x2d3f25){_0x6b0982['push'](_0x6b0982['shift']());}};_0x47b059(++_0x309be6);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 7332316..f2c45f8 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 _0x99d1=['integrationTab','newTab','sequelize','STRING','username','ENUM'];(function(_0x441196,_0x4cefd1){var _0x13e3ec=function(_0x1745a0){while(--_0x1745a0){_0x441196['push'](_0x441196['shift']());}};_0x13e3ec(++_0x4cefd1);}(_0x99d1,0x104));var _0x199d=function(_0x1c2c05,_0x328aea){_0x1c2c05=_0x1c2c05-0x0;var _0x3c2768=_0x99d1[_0x1c2c05];return _0x3c2768;};'use strict';var Sequelize=require(_0x199d('0x0'));module['exports']={'name':{'type':Sequelize[_0x199d('0x1')]},'description':{'type':Sequelize[_0x199d('0x1')]},'username':{'type':Sequelize[_0x199d('0x1')],'unique':_0x199d('0x2')},'remoteUri':{'type':Sequelize[_0x199d('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x199d('0x1')]},'clientSecret':{'type':Sequelize[_0x199d('0x1')]},'securityToken':{'type':Sequelize[_0x199d('0x1')]},'serverUrl':{'type':Sequelize[_0x199d('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x199d('0x3')](_0x199d('0x4'),_0x199d('0x5')),'defaultValue':_0x199d('0x4')}}; \ No newline at end of file +var _0x1c3d=['exports','STRING','username','ENUM','integrationTab'];(function(_0x55d76f,_0x3ec4e8){var _0x27f726=function(_0x5ccf34){while(--_0x5ccf34){_0x55d76f['push'](_0x55d76f['shift']());}};_0x27f726(++_0x3ec4e8);}(_0x1c3d,0x1b8));var _0xd1c3=function(_0x167281,_0x1cbdcf){_0x167281=_0x167281-0x0;var _0x175151=_0x1c3d[_0x167281];return _0x175151;};'use strict';var Sequelize=require('sequelize');module[_0xd1c3('0x0')]={'name':{'type':Sequelize[_0xd1c3('0x1')]},'description':{'type':Sequelize[_0xd1c3('0x1')]},'username':{'type':Sequelize[_0xd1c3('0x1')],'unique':_0xd1c3('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xd1c3('0x1')]},'clientSecret':{'type':Sequelize[_0xd1c3('0x1')]},'securityToken':{'type':Sequelize[_0xd1c3('0x1')]},'serverUrl':{'type':Sequelize[_0xd1c3('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xd1c3('0x3')](_0xd1c3('0x4'),'newTab'),'defaultValue':_0xd1c3('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index fe21051..0ad8880 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 _0x2e02=['textarea','phone','remove','includes','custom','picklistValues','label','value','True','False','false','getFields,\x20%s,\x20%s,\x20%s','stringify','test','statusCode','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','includeAll','findAll','rows','catch','length','include','find','create','body','params','getConfigurations','order','options','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','type','getDescriptions','SalesforceConfiguration','SalesforceField','Descriptions','getFields','findOne','remoteUri','clientSecret','username','securityToken','slice','substring','lastIndexOf','Connection','clientId','concat','isNil','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','string','picklist','boolean','email'];(function(_0x1bd23d,_0x1f339c){var _0x2733d4=function(_0x13798d){while(--_0x13798d){_0x1bd23d['push'](_0x1bd23d['shift']());}};_0x2733d4(++_0x1f339c);}(_0x2e02,0x101));var _0x22e0=function(_0x3a7272,_0x5f0cae){_0x3a7272=_0x3a7272-0x0;var _0x2483d5=_0x2e02[_0x3a7272];return _0x2483d5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x22e0('0x0'));var zipdir=require(_0x22e0('0x1'));var jsonpatch=require(_0x22e0('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x22e0('0x3'));var Mustache=require(_0x22e0('0x4'));var util=require(_0x22e0('0x5'));var path=require(_0x22e0('0x6'));var sox=require(_0x22e0('0x7'));var csv=require(_0x22e0('0x8'));var ejs=require(_0x22e0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x22e0('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x22e0('0xb'));var toCsv=require('to-csv');var querystring=require(_0x22e0('0xc'));var Papa=require(_0x22e0('0xd'));var Redis=require(_0x22e0('0xe'));var authService=require(_0x22e0('0xf'));var qs=require(_0x22e0('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x22e0('0x11'));var logger=require(_0x22e0('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x22e0('0x13'));var licenseUtil=require(_0x22e0('0x14'));var db=require(_0x22e0('0x15'))['db'];var integrations=require(_0x22e0('0x16'));function respondWithStatusCode(_0x586999,_0x222245){_0x222245=_0x222245||0xcc;return function(_0x3d25da){if(_0x3d25da){return _0x586999[_0x22e0('0x17')](_0x222245);}return _0x586999['status'](_0x222245)[_0x22e0('0x18')]();};}function respondWithResult(_0x2d5410,_0x40d315){_0x40d315=_0x40d315||0xc8;return function(_0x57f86b){if(_0x57f86b){return _0x2d5410[_0x22e0('0x19')](_0x40d315)[_0x22e0('0x1a')](_0x57f86b);}};}function respondWithFilteredResult(_0x5d2506,_0x2c6235){return function(_0x514f06){if(_0x514f06){var _0x4b9f9e=typeof _0x2c6235['offset']===_0x22e0('0x1b')&&typeof _0x2c6235['limit']===_0x22e0('0x1b');var _0x295aaa=_0x514f06[_0x22e0('0x1c')];var _0x7f5dee=_0x4b9f9e?0x0:_0x2c6235[_0x22e0('0x1d')];var _0x1afe70=_0x4b9f9e?_0x514f06[_0x22e0('0x1c')]:_0x2c6235['offset']+_0x2c6235[_0x22e0('0x1e')];var _0x23263f;if(_0x1afe70>=_0x295aaa){_0x1afe70=_0x295aaa;_0x23263f=0xc8;}else{_0x23263f=0xce;}_0x5d2506[_0x22e0('0x19')](_0x23263f);return _0x5d2506['set'](_0x22e0('0x1f'),_0x7f5dee+'-'+_0x1afe70+'/'+_0x295aaa)[_0x22e0('0x1a')](_0x514f06);}return null;};}function patchUpdates(_0x42ada1){return function(_0xa6d83f){try{jsonpatch[_0x22e0('0x20')](_0xa6d83f,_0x42ada1,!![]);}catch(_0x18beda){return BPromise[_0x22e0('0x21')](_0x18beda);}return _0xa6d83f[_0x22e0('0x22')]();};}function saveUpdates(_0x58b8b1,_0x254564){return function(_0x1e0569){if(_0x1e0569){return _0x1e0569[_0x22e0('0x23')](_0x58b8b1)[_0x22e0('0x24')](function(_0x10347d){return _0x10347d;});}return null;};}function removeEntity(_0xa070a6,_0xd48038){return function(_0x1dac7c){if(_0x1dac7c){return _0x1dac7c['destroy']()[_0x22e0('0x24')](function(){_0xa070a6['status'](0xcc)[_0x22e0('0x18')]();});}};}function handleEntityNotFound(_0x4ede64,_0x4de5b6){return function(_0x4023ec){if(!_0x4023ec){_0x4ede64['sendStatus'](0x194);}return _0x4023ec;};}function handleError(_0x35c51f,_0x4cec3f){_0x4cec3f=_0x4cec3f||0x1f4;return function(_0x468b40){logger['error'](_0x468b40[_0x22e0('0x25')]);if(_0x468b40[_0x22e0('0x26')]){delete _0x468b40[_0x22e0('0x26')];}_0x35c51f[_0x22e0('0x19')](_0x4cec3f)[_0x22e0('0x27')](_0x468b40);};}exports[_0x22e0('0x28')]=function(_0xedcc58,_0x3c70d1){var _0x37d685={},_0xbaf965={},_0x1ea88a={'count':0x0,'rows':[]};var _0x2ed19f=_[_0x22e0('0x29')](db[_0x22e0('0x2a')][_0x22e0('0x2b')],function(_0x3d0ea7){return{'name':_0x3d0ea7[_0x22e0('0x2c')],'type':_0x3d0ea7['type'][_0x22e0('0x2d')]};});_0xbaf965['model']=_[_0x22e0('0x29')](_0x2ed19f,_0x22e0('0x26'));_0xbaf965[_0x22e0('0x2e')]=_[_0x22e0('0x2f')](_0xedcc58['query']);_0xbaf965[_0x22e0('0x30')]=_[_0x22e0('0x31')](_0xbaf965[_0x22e0('0x32')],_0xbaf965['query']);_0x37d685[_0x22e0('0x33')]=_[_0x22e0('0x31')](_0xbaf965['model'],qs[_0x22e0('0x34')](_0xedcc58[_0x22e0('0x2e')][_0x22e0('0x34')]));_0x37d685[_0x22e0('0x33')]=_0x37d685[_0x22e0('0x33')]['length']?_0x37d685['attributes']:_0xbaf965[_0x22e0('0x32')];if(!_0xedcc58[_0x22e0('0x2e')][_0x22e0('0x35')]('nolimit')){_0x37d685['limit']=qs[_0x22e0('0x1e')](_0xedcc58['query'][_0x22e0('0x1e')]);_0x37d685[_0x22e0('0x1d')]=qs[_0x22e0('0x1d')](_0xedcc58['query'][_0x22e0('0x1d')]);}_0x37d685['order']=qs[_0x22e0('0x36')](_0xedcc58['query'][_0x22e0('0x36')]);_0x37d685[_0x22e0('0x37')]=qs[_0x22e0('0x30')](_[_0x22e0('0x38')](_0xedcc58[_0x22e0('0x2e')],_0xbaf965[_0x22e0('0x30')]),_0x2ed19f);if(_0xedcc58[_0x22e0('0x2e')][_0x22e0('0x39')]){_0x37d685[_0x22e0('0x37')]=_['merge'](_0x37d685[_0x22e0('0x37')],{'$or':_[_0x22e0('0x29')](_0x2ed19f,function(_0x250fdb){if(_0x250fdb['type']!==_0x22e0('0x3a')){var _0x54d6ed={};_0x54d6ed[_0x250fdb[_0x22e0('0x26')]]={'$like':'%'+_0xedcc58[_0x22e0('0x2e')][_0x22e0('0x39')]+'%'};return _0x54d6ed;}})});}_0x37d685=_[_0x22e0('0x3b')]({},_0x37d685,_0xedcc58['options']);var _0x510f83={'where':_0x37d685[_0x22e0('0x37')]};return db['SalesforceAccount'][_0x22e0('0x1c')](_0x510f83)['then'](function(_0x26f32b){_0x1ea88a[_0x22e0('0x1c')]=_0x26f32b;if(_0xedcc58[_0x22e0('0x2e')][_0x22e0('0x3c')]){_0x37d685['include']=[{'all':!![]}];}return db[_0x22e0('0x2a')][_0x22e0('0x3d')](_0x37d685);})[_0x22e0('0x24')](function(_0xc639ff){_0x1ea88a[_0x22e0('0x3e')]=_0xc639ff;return _0x1ea88a;})['then'](respondWithFilteredResult(_0x3c70d1,_0x37d685))[_0x22e0('0x3f')](handleError(_0x3c70d1,null));};exports['show']=function(_0xfe10c4,_0x38c475){var _0x144a36={'raw':![],'where':{'id':_0xfe10c4['params']['id']}},_0x38d4e6={};_0x38d4e6[_0x22e0('0x32')]=_[_0x22e0('0x2f')](db[_0x22e0('0x2a')][_0x22e0('0x2b')]);_0x38d4e6[_0x22e0('0x2e')]=_[_0x22e0('0x2f')](_0xfe10c4[_0x22e0('0x2e')]);_0x38d4e6[_0x22e0('0x30')]=_[_0x22e0('0x31')](_0x38d4e6[_0x22e0('0x32')],_0x38d4e6['query']);_0x144a36[_0x22e0('0x33')]=_[_0x22e0('0x31')](_0x38d4e6[_0x22e0('0x32')],qs['fields'](_0xfe10c4[_0x22e0('0x2e')][_0x22e0('0x34')]));_0x144a36[_0x22e0('0x33')]=_0x144a36['attributes'][_0x22e0('0x40')]?_0x144a36[_0x22e0('0x33')]:_0x38d4e6[_0x22e0('0x32')];if(_0xfe10c4[_0x22e0('0x2e')][_0x22e0('0x3c')]){_0x144a36[_0x22e0('0x41')]=[{'all':!![]}];}_0x144a36=_[_0x22e0('0x3b')]({},_0x144a36,_0xfe10c4['options']);return db[_0x22e0('0x2a')][_0x22e0('0x42')](_0x144a36)[_0x22e0('0x24')](handleEntityNotFound(_0x38c475,null))[_0x22e0('0x24')](respondWithResult(_0x38c475,null))[_0x22e0('0x3f')](handleError(_0x38c475,null));};exports[_0x22e0('0x43')]=function(_0x41a1c2,_0x384a54){return db[_0x22e0('0x2a')][_0x22e0('0x43')](_0x41a1c2['body'],{})['then'](respondWithResult(_0x384a54,0xc9))[_0x22e0('0x3f')](handleError(_0x384a54,null));};exports[_0x22e0('0x23')]=function(_0x13e722,_0x4d1f2c){if(_0x13e722[_0x22e0('0x44')]['id']){delete _0x13e722[_0x22e0('0x44')]['id'];}return db[_0x22e0('0x2a')][_0x22e0('0x42')]({'where':{'id':_0x13e722['params']['id']}})['then'](handleEntityNotFound(_0x4d1f2c,null))['then'](saveUpdates(_0x13e722[_0x22e0('0x44')],null))[_0x22e0('0x24')](respondWithResult(_0x4d1f2c,null))['catch'](handleError(_0x4d1f2c,null));};exports['destroy']=function(_0x28a0a0,_0x47ecd1){return db[_0x22e0('0x2a')][_0x22e0('0x42')]({'where':{'id':_0x28a0a0[_0x22e0('0x45')]['id']}})['then'](handleEntityNotFound(_0x47ecd1,null))['then'](removeEntity(_0x47ecd1,null))[_0x22e0('0x3f')](handleError(_0x47ecd1,null));};exports[_0x22e0('0x46')]=function(_0x372e8,_0xe51d5d,_0x161f49){var _0x21bc4a={};var _0x2949c4={};var _0x22069d;var _0xe64930;return db['SalesforceAccount']['findOne']({'where':{'id':_0x372e8[_0x22e0('0x45')]['id']}})[_0x22e0('0x24')](handleEntityNotFound(_0xe51d5d,null))[_0x22e0('0x24')](function(_0xfdd9e0){if(_0xfdd9e0){_0x22069d=_0xfdd9e0;_0x2949c4[_0x22e0('0x32')]=_[_0x22e0('0x2f')](db['SalesforceConfiguration'][_0x22e0('0x2b')]);_0x2949c4[_0x22e0('0x2e')]=_[_0x22e0('0x2f')](_0x372e8[_0x22e0('0x2e')]);_0x2949c4[_0x22e0('0x30')]=_['intersection'](_0x2949c4[_0x22e0('0x32')],_0x2949c4[_0x22e0('0x2e')]);_0x21bc4a['attributes']=_['intersection'](_0x2949c4[_0x22e0('0x32')],qs[_0x22e0('0x34')](_0x372e8['query']['fields']));_0x21bc4a['attributes']=_0x21bc4a[_0x22e0('0x33')][_0x22e0('0x40')]?_0x21bc4a[_0x22e0('0x33')]:_0x2949c4[_0x22e0('0x32')];_0x21bc4a[_0x22e0('0x47')]=qs[_0x22e0('0x36')](_0x372e8['query'][_0x22e0('0x36')]);_0x21bc4a[_0x22e0('0x37')]=qs['filters'](_[_0x22e0('0x38')](_0x372e8[_0x22e0('0x2e')],_0x2949c4[_0x22e0('0x30')]));if(_0x372e8[_0x22e0('0x2e')][_0x22e0('0x39')]){_0x21bc4a[_0x22e0('0x37')]=_[_0x22e0('0x3b')](_0x21bc4a[_0x22e0('0x37')],{'$or':_['map'](_0x21bc4a[_0x22e0('0x33')],function(_0x1c7606){var _0x3878d9={};_0x3878d9[_0x1c7606]={'$like':'%'+_0x372e8['query']['filter']+'%'};return _0x3878d9;})});}_0x21bc4a=_[_0x22e0('0x3b')]({},_0x21bc4a,_0x372e8[_0x22e0('0x48')]);return _0x22069d[_0x22e0('0x46')](_0x21bc4a);}})[_0x22e0('0x24')](function(_0x34b993){if(_0x34b993){_0xe64930=_0x34b993[_0x22e0('0x40')];if(!_0x372e8[_0x22e0('0x2e')][_0x22e0('0x35')](_0x22e0('0x49'))){_0x21bc4a[_0x22e0('0x1e')]=qs[_0x22e0('0x1e')](_0x372e8[_0x22e0('0x2e')][_0x22e0('0x1e')]);_0x21bc4a[_0x22e0('0x1d')]=qs[_0x22e0('0x1d')](_0x372e8[_0x22e0('0x2e')][_0x22e0('0x1d')]);}return _0x22069d[_0x22e0('0x46')](_0x21bc4a);}})[_0x22e0('0x24')](function(_0x52abab){if(_0x52abab){return _0x52abab?{'count':_0xe64930,'rows':_0x52abab}:null;}})[_0x22e0('0x24')](respondWithResult(_0xe51d5d,null))['catch'](handleError(_0xe51d5d,null));};exports[_0x22e0('0x4a')]=function(_0xd451a1,_0x30f4a9,_0x507fe1){if(_0xd451a1[_0x22e0('0x44')]['id']){delete _0xd451a1[_0x22e0('0x44')]['id'];}return db[_0x22e0('0x2a')]['findOne']({'where':{'id':_0xd451a1[_0x22e0('0x45')]['id']}})[_0x22e0('0x24')](handleEntityNotFound(_0x30f4a9,null))[_0x22e0('0x24')](function(_0x5bfe94){if(_0x5bfe94){_0xd451a1[_0x22e0('0x44')][_0x22e0('0x4b')]=_0x5bfe94['id'];_0xd451a1[_0x22e0('0x44')][_0x22e0('0x4c')]=integrations[_0x22e0('0x4d')](_0xd451a1['body'][_0x22e0('0x4e')],_0xd451a1[_0x22e0('0x44')][_0x22e0('0x4f')]);_0xd451a1[_0x22e0('0x44')]['Descriptions']=integrations[_0x22e0('0x50')](_0xd451a1[_0x22e0('0x44')][_0x22e0('0x4e')],_0xd451a1['body'][_0x22e0('0x4f')]);return db[_0x22e0('0x51')][_0x22e0('0x43')](_0xd451a1[_0x22e0('0x44')],{'include':[{'model':db[_0x22e0('0x52')],'as':_0x22e0('0x4c')},{'model':db['SalesforceField'],'as':_0x22e0('0x53')}]});}return null;})[_0x22e0('0x24')](respondWithResult(_0x30f4a9,null))[_0x22e0('0x3f')](handleError(_0x30f4a9,null));};exports[_0x22e0('0x54')]=function(_0x5f2244,_0x385b2c,_0x1ca00d){var _0x12c646;var _0x32a880='';var _0x33e7b0='Task';return db[_0x22e0('0x2a')][_0x22e0('0x55')]({'where':{'id':_0x5f2244[_0x22e0('0x45')]['id']},'attributes':['id',_0x22e0('0x56'),'clientId',_0x22e0('0x57'),_0x22e0('0x58'),'password',_0x22e0('0x59')]})['then'](handleEntityNotFound(_0x385b2c,null))['then'](function(_0x569452){if(_0x569452){_0x32a880=_0x569452[_0x22e0('0x56')];var _0x1cccde=_0x32a880[_0x22e0('0x5a')](-0x1);if(_0x1cccde==='/'){_0x32a880=_0x32a880[_0x22e0('0x5b')](0x0,_0x32a880[_0x22e0('0x5c')](_0x1cccde));}_0x12c646=new jsforce[(_0x22e0('0x5d'))]({'oauth2':{'loginUrl':_0x32a880,'clientId':_0x569452[_0x22e0('0x5e')],'clientSecret':_0x569452[_0x22e0('0x57')]}});return _0x12c646['login'](_0x569452[_0x22e0('0x58')],_0x569452['password'][_0x22e0('0x5f')](_0x569452['securityToken']));}})[_0x22e0('0x24')](function(_0x3fed00){if(_0x3fed00){if(!_[_0x22e0('0x60')](_0x5f2244[_0x22e0('0x2e')][_0x22e0('0x61')])){_0x33e7b0=_0x5f2244[_0x22e0('0x2e')][_0x22e0('0x61')];}return _0x12c646[_0x22e0('0x62')](_0x33e7b0)['describe']();}})[_0x22e0('0x24')](function(_0x71e1a5){var _0x2efda9=[_0x22e0('0x63'),_0x22e0('0x64'),_0x22e0('0x65'),'IsRecurrence','Subject','Description'];var _0x4a7f9f=[_0x22e0('0x66'),'int',_0x22e0('0x67'),_0x22e0('0x68'),_0x22e0('0x69'),_0x22e0('0x6a'),_0x22e0('0x6b')];if(_0x71e1a5){_[_0x22e0('0x6c')](_0x71e1a5[_0x22e0('0x34')],function(_0x59b01b){return _0x2efda9[_0x22e0('0x6d')](_0x59b01b[_0x22e0('0x26')])||!_0x4a7f9f[_0x22e0('0x6d')](_0x59b01b[_0x22e0('0x4f')]);});return{'count':_0x71e1a5[_0x22e0('0x34')][_0x22e0('0x40')],'rows':_[_0x22e0('0x29')](_0x71e1a5[_0x22e0('0x34')],function(_0xe0fd7b){return{'id':_0xe0fd7b[_0x22e0('0x26')],'name':_0xe0fd7b['label'],'custom':_0xe0fd7b[_0x22e0('0x6e')],'options':_0xe0fd7b[_0x22e0('0x6f')][_0x22e0('0x40')]>0x0?_[_0x22e0('0x29')](_0xe0fd7b['picklistValues'],function(_0x2cb11d){return{'name':_0x2cb11d[_0x22e0('0x70')],'value':_0x2cb11d[_0x22e0('0x71')]};}):_0xe0fd7b[_0x22e0('0x4f')]==_0x22e0('0x68')?[{'name':_0x22e0('0x72'),'value':'true'},{'name':_0x22e0('0x73'),'value':_0x22e0('0x74')}]:[]};})};}})['then'](respondWithResult(_0x385b2c,null))[_0x22e0('0x3f')](function(_0x52f3c9){var _0x279491=_0x5f2244[_0x22e0('0x2e')]['test']?0x1f4:_0x52f3c9['statusCode']||0x1f4;logger['error'](_0x22e0('0x75'),'getFields',_0x279491,JSON[_0x22e0('0x76')](_0x52f3c9));delete _0x52f3c9[_0x22e0('0x26')];if(_0x279491===0x191){_0x279491=0x190;}_0x385b2c[_0x22e0('0x19')](_0x279491)[_0x22e0('0x27')](_0x5f2244[_0x22e0('0x2e')][_0x22e0('0x77')]?{'message':'Wrong\x20credentials','statusCode':_0x52f3c9[_0x22e0('0x78')]}:_0x52f3c9);});}; \ No newline at end of file +var _0x3164=['isNil','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','boolean','textarea','phone','includes','label','value','True','true','False','false','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../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','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','key','model','keys','filters','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceConfiguration','SalesforceField','getFields','Task','remoteUri','clientSecret','username','password','securityToken','lastIndexOf','clientId'];(function(_0x45cea1,_0x45db40){var _0xda8ddd=function(_0x43062d){while(--_0x43062d){_0x45cea1['push'](_0x45cea1['shift']());}};_0xda8ddd(++_0x45db40);}(_0x3164,0x10f));var _0x4316=function(_0x44bf66,_0xe56e4d){_0x44bf66=_0x44bf66-0x0;var _0x207832=_0x3164[_0x44bf66];return _0x207832;};'use strict';var emlformat=require(_0x4316('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4316('0x1'));var jsonpatch=require(_0x4316('0x2'));var rp=require(_0x4316('0x3'));var moment=require('moment');var BPromise=require(_0x4316('0x4'));var Mustache=require(_0x4316('0x5'));var util=require('util');var path=require(_0x4316('0x6'));var sox=require(_0x4316('0x7'));var csv=require('to-csv');var ejs=require(_0x4316('0x8'));var fs=require('fs');var fs_extra=require(_0x4316('0x9'));var _=require(_0x4316('0xa'));var squel=require(_0x4316('0xb'));var crypto=require(_0x4316('0xc'));var jsforce=require(_0x4316('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4316('0xe'));var Redis=require(_0x4316('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4316('0x10'));var as=require(_0x4316('0x11'));var hardwareService=require(_0x4316('0x12'));var logger=require(_0x4316('0x13'))(_0x4316('0x14'));var utils=require(_0x4316('0x15'));var config=require(_0x4316('0x16'));var licenseUtil=require(_0x4316('0x17'));var db=require(_0x4316('0x18'))['db'];var integrations=require(_0x4316('0x19'));function respondWithStatusCode(_0x3f62ee,_0x41ba20){_0x41ba20=_0x41ba20||0xcc;return function(_0x3653e3){if(_0x3653e3){return _0x3f62ee[_0x4316('0x1a')](_0x41ba20);}return _0x3f62ee[_0x4316('0x1b')](_0x41ba20)[_0x4316('0x1c')]();};}function respondWithResult(_0x3c43fa,_0x1af722){_0x1af722=_0x1af722||0xc8;return function(_0x2b4a68){if(_0x2b4a68){return _0x3c43fa['status'](_0x1af722)[_0x4316('0x1d')](_0x2b4a68);}};}function respondWithFilteredResult(_0x14b613,_0x49abdd){return function(_0x5df3c8){if(_0x5df3c8){var _0xfeb381=typeof _0x49abdd[_0x4316('0x1e')]==='undefined'&&typeof _0x49abdd[_0x4316('0x1f')]===_0x4316('0x20');var _0x31ae7d=_0x5df3c8[_0x4316('0x21')];var _0x1aec2b=_0xfeb381?0x0:_0x49abdd[_0x4316('0x1e')];var _0x178c1e=_0xfeb381?_0x5df3c8[_0x4316('0x21')]:_0x49abdd['offset']+_0x49abdd[_0x4316('0x1f')];var _0x2fe753;if(_0x178c1e>=_0x31ae7d){_0x178c1e=_0x31ae7d;_0x2fe753=0xc8;}else{_0x2fe753=0xce;}_0x14b613[_0x4316('0x1b')](_0x2fe753);return _0x14b613[_0x4316('0x22')](_0x4316('0x23'),_0x1aec2b+'-'+_0x178c1e+'/'+_0x31ae7d)[_0x4316('0x1d')](_0x5df3c8);}return null;};}function patchUpdates(_0x59c8cb){return function(_0x5798ab){try{jsonpatch[_0x4316('0x24')](_0x5798ab,_0x59c8cb,!![]);}catch(_0x20943c){return BPromise[_0x4316('0x25')](_0x20943c);}return _0x5798ab[_0x4316('0x26')]();};}function saveUpdates(_0x2c0793,_0x45e11b){return function(_0x43ca53){if(_0x43ca53){return _0x43ca53[_0x4316('0x27')](_0x2c0793)[_0x4316('0x28')](function(_0xb25f){return _0xb25f;});}return null;};}function removeEntity(_0x1db632,_0x101eba){return function(_0x326083){if(_0x326083){return _0x326083['destroy']()[_0x4316('0x28')](function(){_0x1db632['status'](0xcc)[_0x4316('0x1c')]();});}};}function handleEntityNotFound(_0xe66a4c,_0xf410e9){return function(_0x457400){if(!_0x457400){_0xe66a4c[_0x4316('0x1a')](0x194);}return _0x457400;};}function handleError(_0x19937c,_0x29e792){_0x29e792=_0x29e792||0x1f4;return function(_0x1d3d0e){logger['error'](_0x1d3d0e[_0x4316('0x29')]);if(_0x1d3d0e[_0x4316('0x2a')]){delete _0x1d3d0e[_0x4316('0x2a')];}_0x19937c[_0x4316('0x1b')](_0x29e792)[_0x4316('0x2b')](_0x1d3d0e);};}exports[_0x4316('0x2c')]=function(_0x54c888,_0x5715fb){var _0x50a7df={},_0x152898={},_0x53f64b={'count':0x0,'rows':[]};var _0x5a77c5=_[_0x4316('0x2d')](db[_0x4316('0x2e')][_0x4316('0x2f')],function(_0x26c094){return{'name':_0x26c094[_0x4316('0x30')],'type':_0x26c094['type'][_0x4316('0x31')]};});_0x152898[_0x4316('0x32')]=_[_0x4316('0x2d')](_0x5a77c5,_0x4316('0x2a'));_0x152898['query']=_[_0x4316('0x33')](_0x54c888['query']);_0x152898[_0x4316('0x34')]=_['intersection'](_0x152898[_0x4316('0x32')],_0x152898[_0x4316('0x35')]);_0x50a7df[_0x4316('0x36')]=_['intersection'](_0x152898[_0x4316('0x32')],qs[_0x4316('0x37')](_0x54c888[_0x4316('0x35')][_0x4316('0x37')]));_0x50a7df[_0x4316('0x36')]=_0x50a7df[_0x4316('0x36')][_0x4316('0x38')]?_0x50a7df['attributes']:_0x152898[_0x4316('0x32')];if(!_0x54c888[_0x4316('0x35')][_0x4316('0x39')]('nolimit')){_0x50a7df[_0x4316('0x1f')]=qs[_0x4316('0x1f')](_0x54c888[_0x4316('0x35')][_0x4316('0x1f')]);_0x50a7df[_0x4316('0x1e')]=qs[_0x4316('0x1e')](_0x54c888['query']['offset']);}_0x50a7df[_0x4316('0x3a')]=qs['sort'](_0x54c888[_0x4316('0x35')][_0x4316('0x3b')]);_0x50a7df[_0x4316('0x3c')]=qs[_0x4316('0x34')](_[_0x4316('0x3d')](_0x54c888['query'],_0x152898[_0x4316('0x34')]),_0x5a77c5);if(_0x54c888[_0x4316('0x35')][_0x4316('0x3e')]){_0x50a7df['where']=_['merge'](_0x50a7df[_0x4316('0x3c')],{'$or':_[_0x4316('0x2d')](_0x5a77c5,function(_0x59803f){if(_0x59803f[_0x4316('0x3f')]!==_0x4316('0x40')){var _0x5d8869={};_0x5d8869[_0x59803f[_0x4316('0x2a')]]={'$like':'%'+_0x54c888['query'][_0x4316('0x3e')]+'%'};return _0x5d8869;}})});}_0x50a7df=_[_0x4316('0x41')]({},_0x50a7df,_0x54c888[_0x4316('0x42')]);var _0x1d75bf={'where':_0x50a7df[_0x4316('0x3c')]};return db[_0x4316('0x2e')]['count'](_0x1d75bf)[_0x4316('0x28')](function(_0x291ec0){_0x53f64b[_0x4316('0x21')]=_0x291ec0;if(_0x54c888['query'][_0x4316('0x43')]){_0x50a7df[_0x4316('0x44')]=[{'all':!![]}];}return db[_0x4316('0x2e')][_0x4316('0x45')](_0x50a7df);})[_0x4316('0x28')](function(_0x3aa40e){_0x53f64b[_0x4316('0x46')]=_0x3aa40e;return _0x53f64b;})[_0x4316('0x28')](respondWithFilteredResult(_0x5715fb,_0x50a7df))[_0x4316('0x47')](handleError(_0x5715fb,null));};exports[_0x4316('0x48')]=function(_0x140776,_0x3ba016){var _0x2d6aee={'raw':![],'where':{'id':_0x140776[_0x4316('0x49')]['id']}},_0x20b67e={};_0x20b67e[_0x4316('0x32')]=_[_0x4316('0x33')](db[_0x4316('0x2e')][_0x4316('0x2f')]);_0x20b67e[_0x4316('0x35')]=_[_0x4316('0x33')](_0x140776[_0x4316('0x35')]);_0x20b67e[_0x4316('0x34')]=_[_0x4316('0x4a')](_0x20b67e[_0x4316('0x32')],_0x20b67e[_0x4316('0x35')]);_0x2d6aee['attributes']=_[_0x4316('0x4a')](_0x20b67e[_0x4316('0x32')],qs[_0x4316('0x37')](_0x140776['query']['fields']));_0x2d6aee[_0x4316('0x36')]=_0x2d6aee[_0x4316('0x36')][_0x4316('0x38')]?_0x2d6aee[_0x4316('0x36')]:_0x20b67e[_0x4316('0x32')];if(_0x140776[_0x4316('0x35')]['includeAll']){_0x2d6aee[_0x4316('0x44')]=[{'all':!![]}];}_0x2d6aee=_[_0x4316('0x41')]({},_0x2d6aee,_0x140776[_0x4316('0x42')]);return db[_0x4316('0x2e')][_0x4316('0x4b')](_0x2d6aee)['then'](handleEntityNotFound(_0x3ba016,null))['then'](respondWithResult(_0x3ba016,null))[_0x4316('0x47')](handleError(_0x3ba016,null));};exports['create']=function(_0x154b9f,_0x31eef2){return db[_0x4316('0x2e')][_0x4316('0x4c')](_0x154b9f[_0x4316('0x4d')],{})[_0x4316('0x28')](respondWithResult(_0x31eef2,0xc9))[_0x4316('0x47')](handleError(_0x31eef2,null));};exports['update']=function(_0x32b72b,_0x2cd9d6){if(_0x32b72b[_0x4316('0x4d')]['id']){delete _0x32b72b['body']['id'];}return db[_0x4316('0x2e')][_0x4316('0x4b')]({'where':{'id':_0x32b72b[_0x4316('0x49')]['id']}})['then'](handleEntityNotFound(_0x2cd9d6,null))[_0x4316('0x28')](saveUpdates(_0x32b72b['body'],null))[_0x4316('0x28')](respondWithResult(_0x2cd9d6,null))[_0x4316('0x47')](handleError(_0x2cd9d6,null));};exports['destroy']=function(_0x4fddb6,_0x13b642){return db['SalesforceAccount']['find']({'where':{'id':_0x4fddb6['params']['id']}})[_0x4316('0x28')](handleEntityNotFound(_0x13b642,null))[_0x4316('0x28')](removeEntity(_0x13b642,null))[_0x4316('0x47')](handleError(_0x13b642,null));};exports[_0x4316('0x4e')]=function(_0x4d131c,_0x2d6a2f,_0x44607a){var _0x4e42f0={};var _0x2f6be9={};var _0xaedc2f;var _0x394f30;return db[_0x4316('0x2e')]['findOne']({'where':{'id':_0x4d131c[_0x4316('0x49')]['id']}})['then'](handleEntityNotFound(_0x2d6a2f,null))[_0x4316('0x28')](function(_0x515b4c){if(_0x515b4c){_0xaedc2f=_0x515b4c;_0x2f6be9[_0x4316('0x32')]=_[_0x4316('0x33')](db['SalesforceConfiguration'][_0x4316('0x2f')]);_0x2f6be9[_0x4316('0x35')]=_[_0x4316('0x33')](_0x4d131c[_0x4316('0x35')]);_0x2f6be9[_0x4316('0x34')]=_['intersection'](_0x2f6be9[_0x4316('0x32')],_0x2f6be9[_0x4316('0x35')]);_0x4e42f0[_0x4316('0x36')]=_[_0x4316('0x4a')](_0x2f6be9[_0x4316('0x32')],qs[_0x4316('0x37')](_0x4d131c[_0x4316('0x35')][_0x4316('0x37')]));_0x4e42f0['attributes']=_0x4e42f0[_0x4316('0x36')][_0x4316('0x38')]?_0x4e42f0[_0x4316('0x36')]:_0x2f6be9[_0x4316('0x32')];_0x4e42f0[_0x4316('0x3a')]=qs[_0x4316('0x3b')](_0x4d131c[_0x4316('0x35')][_0x4316('0x3b')]);_0x4e42f0['where']=qs[_0x4316('0x34')](_[_0x4316('0x3d')](_0x4d131c[_0x4316('0x35')],_0x2f6be9['filters']));if(_0x4d131c[_0x4316('0x35')][_0x4316('0x3e')]){_0x4e42f0[_0x4316('0x3c')]=_['merge'](_0x4e42f0[_0x4316('0x3c')],{'$or':_[_0x4316('0x2d')](_0x4e42f0[_0x4316('0x36')],function(_0x23de84){var _0x3141c8={};_0x3141c8[_0x23de84]={'$like':'%'+_0x4d131c['query']['filter']+'%'};return _0x3141c8;})});}_0x4e42f0=_[_0x4316('0x41')]({},_0x4e42f0,_0x4d131c[_0x4316('0x42')]);return _0xaedc2f[_0x4316('0x4e')](_0x4e42f0);}})[_0x4316('0x28')](function(_0x4877be){if(_0x4877be){_0x394f30=_0x4877be[_0x4316('0x38')];if(!_0x4d131c[_0x4316('0x35')][_0x4316('0x39')]('nolimit')){_0x4e42f0[_0x4316('0x1f')]=qs[_0x4316('0x1f')](_0x4d131c['query']['limit']);_0x4e42f0[_0x4316('0x1e')]=qs[_0x4316('0x1e')](_0x4d131c[_0x4316('0x35')][_0x4316('0x1e')]);}return _0xaedc2f[_0x4316('0x4e')](_0x4e42f0);}})[_0x4316('0x28')](function(_0x39e88a){if(_0x39e88a){return _0x39e88a?{'count':_0x394f30,'rows':_0x39e88a}:null;}})['then'](respondWithResult(_0x2d6a2f,null))[_0x4316('0x47')](handleError(_0x2d6a2f,null));};exports[_0x4316('0x4f')]=function(_0x5da4df,_0x93cf33,_0xef61d8){if(_0x5da4df[_0x4316('0x4d')]['id']){delete _0x5da4df[_0x4316('0x4d')]['id'];}return db[_0x4316('0x2e')][_0x4316('0x50')]({'where':{'id':_0x5da4df['params']['id']}})['then'](handleEntityNotFound(_0x93cf33,null))[_0x4316('0x28')](function(_0x740011){if(_0x740011){_0x5da4df[_0x4316('0x4d')][_0x4316('0x51')]=_0x740011['id'];_0x5da4df[_0x4316('0x4d')][_0x4316('0x52')]=integrations[_0x4316('0x53')](_0x5da4df['body'][_0x4316('0x54')],_0x5da4df[_0x4316('0x4d')][_0x4316('0x3f')]);_0x5da4df[_0x4316('0x4d')][_0x4316('0x55')]=integrations[_0x4316('0x56')](_0x5da4df['body'][_0x4316('0x54')],_0x5da4df[_0x4316('0x4d')][_0x4316('0x3f')]);return db[_0x4316('0x57')][_0x4316('0x4c')](_0x5da4df[_0x4316('0x4d')],{'include':[{'model':db[_0x4316('0x58')],'as':_0x4316('0x52')},{'model':db[_0x4316('0x58')],'as':_0x4316('0x55')}]});}return null;})['then'](respondWithResult(_0x93cf33,null))[_0x4316('0x47')](handleError(_0x93cf33,null));};exports[_0x4316('0x59')]=function(_0x488350,_0x291f02,_0x306cc8){var _0x5bee36;var _0x246efb='';var _0x2f246e=_0x4316('0x5a');return db[_0x4316('0x2e')][_0x4316('0x50')]({'where':{'id':_0x488350['params']['id']},'attributes':['id',_0x4316('0x5b'),'clientId',_0x4316('0x5c'),_0x4316('0x5d'),_0x4316('0x5e'),_0x4316('0x5f')]})[_0x4316('0x28')](handleEntityNotFound(_0x291f02,null))['then'](function(_0x4ee181){if(_0x4ee181){_0x246efb=_0x4ee181[_0x4316('0x5b')];var _0x35913e=_0x246efb['slice'](-0x1);if(_0x35913e==='/'){_0x246efb=_0x246efb['substring'](0x0,_0x246efb[_0x4316('0x60')](_0x35913e));}_0x5bee36=new jsforce['Connection']({'oauth2':{'loginUrl':_0x246efb,'clientId':_0x4ee181[_0x4316('0x61')],'clientSecret':_0x4ee181[_0x4316('0x5c')]}});return _0x5bee36['login'](_0x4ee181['username'],_0x4ee181['password']['concat'](_0x4ee181[_0x4316('0x5f')]));}})[_0x4316('0x28')](function(_0x52e2cb){if(_0x52e2cb){if(!_[_0x4316('0x62')](_0x488350[_0x4316('0x35')]['ticketType'])){_0x2f246e=_0x488350['query']['ticketType'];}return _0x5bee36[_0x4316('0x63')](_0x2f246e)[_0x4316('0x64')]();}})['then'](function(_0x536a85){var _0x2dd827=[_0x4316('0x65'),_0x4316('0x66'),_0x4316('0x67'),_0x4316('0x68'),_0x4316('0x69'),_0x4316('0x6a')];var _0x5d1dca=[_0x4316('0x6b'),_0x4316('0x6c'),'picklist',_0x4316('0x6d'),'email',_0x4316('0x6e'),_0x4316('0x6f')];if(_0x536a85){_['remove'](_0x536a85[_0x4316('0x37')],function(_0x4303d9){return _0x2dd827[_0x4316('0x70')](_0x4303d9[_0x4316('0x2a')])||!_0x5d1dca[_0x4316('0x70')](_0x4303d9[_0x4316('0x3f')]);});return{'count':_0x536a85[_0x4316('0x37')][_0x4316('0x38')],'rows':_[_0x4316('0x2d')](_0x536a85['fields'],function(_0xa02e53){return{'id':_0xa02e53[_0x4316('0x2a')],'name':_0xa02e53[_0x4316('0x71')],'custom':_0xa02e53['custom'],'options':_0xa02e53['picklistValues'][_0x4316('0x38')]>0x0?_['map'](_0xa02e53['picklistValues'],function(_0x4e38aa){return{'name':_0x4e38aa[_0x4316('0x71')],'value':_0x4e38aa[_0x4316('0x72')]};}):_0xa02e53[_0x4316('0x3f')]==_0x4316('0x6d')?[{'name':_0x4316('0x73'),'value':_0x4316('0x74')},{'name':_0x4316('0x75'),'value':_0x4316('0x76')}]:[]};})};}})[_0x4316('0x28')](respondWithResult(_0x291f02,null))[_0x4316('0x47')](function(_0x5996dd){var _0x19b07e=_0x488350['query'][_0x4316('0x77')]?0x1f4:_0x5996dd[_0x4316('0x78')]||0x1f4;logger[_0x4316('0x79')](_0x4316('0x7a'),_0x4316('0x59'),_0x19b07e,JSON['stringify'](_0x5996dd));delete _0x5996dd['name'];if(_0x19b07e===0x191){_0x19b07e=0x190;}_0x291f02[_0x4316('0x1b')](_0x19b07e)[_0x4316('0x2b')](_0x488350[_0x4316('0x35')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x5996dd[_0x4316('0x78')]}:_0x5996dd);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 0e69438..432d8fd 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 _0xb581=['./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xb581,0x71));var _0x1b58=function(_0x316ab8,_0x48b71f){_0x316ab8=_0x316ab8-0x0;var _0x4f37bf=_0xb581[_0x316ab8];return _0x4f37bf;};'use strict';var _=require(_0x1b58('0x0'));var util=require('util');var logger=require(_0x1b58('0x1'))(_0x1b58('0x2'));var moment=require(_0x1b58('0x3'));var BPromise=require(_0x1b58('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b58('0x5'));var rimraf=require('rimraf');var config=require(_0x1b58('0x6'));var attributes=require(_0x1b58('0x7'));var integrations=require(_0x1b58('0x8'));module['exports']=function(_0x5af6f9,_0x27e8f7){return _0x5af6f9[_0x1b58('0x9')](_0x1b58('0xa'),attributes,{'tableName':_0x1b58('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc89e=['path','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','util','../../config/logger','api','moment','request-promise'];(function(_0x256f5d,_0x170f8c){var _0x5b332f=function(_0x38c3a6){while(--_0x38c3a6){_0x256f5d['push'](_0x256f5d['shift']());}};_0x5b332f(++_0x170f8c);}(_0xc89e,0x10c));var _0xec89=function(_0x589144,_0x417fcc){_0x589144=_0x589144-0x0;var _0x28658f=_0xc89e[_0x589144];return _0x28658f;};'use strict';var _=require('lodash');var util=require(_0xec89('0x0'));var logger=require(_0xec89('0x1'))(_0xec89('0x2'));var moment=require(_0xec89('0x3'));var BPromise=require('bluebird');var rp=require(_0xec89('0x4'));var fs=require('fs');var path=require(_0xec89('0x5'));var rimraf=require(_0xec89('0x6'));var config=require('../../config/environment');var attributes=require(_0xec89('0x7'));var integrations=require(_0xec89('0x8'));module[_0xec89('0x9')]=function(_0x25cc08,_0x3c7332){return _0x25cc08[_0xec89('0xa')](_0xec89('0xb'),attributes,{'tableName':_0xec89('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 497554a..db14724 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 _0x79d0=['catch','GetSalesforceAccount','SalesforceAccount','findAll','options','where','attributes','include','map','ShowSalesforceAccount','find','raw','model','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x57ef87,_0x429e45){var _0x230a41=function(_0x1f1bf5){while(--_0x1f1bf5){_0x57ef87['push'](_0x57ef87['shift']());}};_0x230a41(++_0x429e45);}(_0x79d0,0xb2));var _0x079d=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x79d0[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x079d('0x0'));var util=require('util');var moment=require(_0x079d('0x1'));var BPromise=require(_0x079d('0x2'));var rs=require(_0x079d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x079d('0x4'));var logger=require('../../config/logger')(_0x079d('0x5'));var config=require(_0x079d('0x6'));var jayson=require(_0x079d('0x7'));var client=jayson[_0x079d('0x8')][_0x079d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x533302,_0x237860,_0x51d07e){return new BPromise(function(_0x4ee976,_0x42d5bf){return client['request'](_0x533302,_0x51d07e)[_0x079d('0xa')](function(_0x504606){logger[_0x079d('0xb')](_0x079d('0xc'),_0x237860,_0x079d('0xd'));logger[_0x079d('0xe')](_0x079d('0xf'),_0x237860,_0x079d('0xd'),JSON[_0x079d('0x10')](_0x504606));if(_0x504606[_0x079d('0x11')]){if(_0x504606[_0x079d('0x11')][_0x079d('0x12')]===0x1f4){logger[_0x079d('0x11')](_0x079d('0xc'),_0x237860,_0x504606[_0x079d('0x11')][_0x079d('0x13')]);return _0x42d5bf(_0x504606['error'][_0x079d('0x13')]);}logger['error'](_0x079d('0xc'),_0x237860,_0x504606['error'][_0x079d('0x13')]);return _0x4ee976(_0x504606[_0x079d('0x11')][_0x079d('0x13')]);}else{logger['info'](_0x079d('0xc'),_0x237860,_0x079d('0xd'));_0x4ee976(_0x504606['result']['message']);}})[_0x079d('0x14')](function(_0x58974d){logger['error'](_0x079d('0xc'),_0x237860,_0x58974d);_0x42d5bf(_0x58974d);});});}exports[_0x079d('0x15')]=function(_0x5305d9){var _0x3c2fdb=this;return new Promise(function(_0x1b7547,_0x59a2c4){return db[_0x079d('0x16')][_0x079d('0x17')]({'raw':_0x5305d9[_0x079d('0x18')]?_0x5305d9['options']['raw']===undefined?!![]:![]:!![],'where':_0x5305d9[_0x079d('0x18')]?_0x5305d9['options'][_0x079d('0x19')]||null:null,'attributes':_0x5305d9['options']?_0x5305d9['options'][_0x079d('0x1a')]||null:null,'limit':_0x5305d9[_0x079d('0x18')]?_0x5305d9[_0x079d('0x18')]['limit']||null:null,'include':_0x5305d9['options']?_0x5305d9[_0x079d('0x18')]['include']?_['map'](_0x5305d9[_0x079d('0x18')][_0x079d('0x1b')],function(_0x57107d){return{'model':db[_0x57107d['model']],'as':_0x57107d['as'],'attributes':_0x57107d['attributes'],'include':_0x57107d[_0x079d('0x1b')]?_[_0x079d('0x1c')](_0x57107d[_0x079d('0x1b')],function(_0xac73fb){return{'model':db[_0xac73fb['model']],'as':_0xac73fb['as'],'attributes':_0xac73fb['attributes'],'include':_0xac73fb[_0x079d('0x1b')]?_['map'](_0xac73fb[_0x079d('0x1b')],function(_0x281517){return{'model':db[_0x281517['model']],'as':_0x281517['as'],'attributes':_0x281517[_0x079d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x079d('0xa')](function(_0x31fc21){logger[_0x079d('0xb')](_0x079d('0x15'),_0x5305d9);logger['debug'](_0x079d('0x15'),_0x5305d9,JSON[_0x079d('0x10')](_0x31fc21));_0x1b7547(_0x31fc21);})[_0x079d('0x14')](function(_0x436706){logger[_0x079d('0x11')](_0x079d('0x15'),_0x436706[_0x079d('0x13')],_0x5305d9);_0x59a2c4(_0x3c2fdb[_0x079d('0x11')](0x1f4,_0x436706[_0x079d('0x13')]));});});};exports[_0x079d('0x1d')]=function(_0x5d8587){var _0x5d8012=this;return new Promise(function(_0x4ab78f,_0x2fa75d){return db[_0x079d('0x16')][_0x079d('0x1e')]({'raw':_0x5d8587[_0x079d('0x18')]?_0x5d8587[_0x079d('0x18')][_0x079d('0x1f')]===undefined?!![]:![]:!![],'where':_0x5d8587[_0x079d('0x18')]?_0x5d8587[_0x079d('0x18')][_0x079d('0x19')]||null:null,'attributes':_0x5d8587[_0x079d('0x18')]?_0x5d8587[_0x079d('0x18')][_0x079d('0x1a')]||null:null,'include':_0x5d8587[_0x079d('0x18')]?_0x5d8587[_0x079d('0x18')][_0x079d('0x1b')]?_[_0x079d('0x1c')](_0x5d8587[_0x079d('0x18')][_0x079d('0x1b')],function(_0x28826c){return{'model':db[_0x28826c[_0x079d('0x20')]],'as':_0x28826c['as'],'attributes':_0x28826c[_0x079d('0x1a')],'include':_0x28826c['include']?_[_0x079d('0x1c')](_0x28826c[_0x079d('0x1b')],function(_0x29e96b){return{'model':db[_0x29e96b[_0x079d('0x20')]],'as':_0x29e96b['as'],'attributes':_0x29e96b[_0x079d('0x1a')],'include':_0x29e96b['include']?_[_0x079d('0x1c')](_0x29e96b[_0x079d('0x1b')],function(_0x23c004){return{'model':db[_0x23c004[_0x079d('0x20')]],'as':_0x23c004['as'],'attributes':_0x23c004['attributes']};}):[]};}):[]};}):[]:[]})[_0x079d('0xa')](function(_0x3c7b89){logger[_0x079d('0xb')](_0x079d('0x1d'),_0x5d8587);logger[_0x079d('0xe')](_0x079d('0x1d'),_0x5d8587,JSON[_0x079d('0x10')](_0x3c7b89));_0x4ab78f(_0x3c7b89);})[_0x079d('0x14')](function(_0x2dfa98){logger['error'](_0x079d('0x1d'),_0x2dfa98[_0x079d('0x13')],_0x5d8587);_0x2fa75d(_0x5d8012[_0x079d('0x11')](0x1f4,_0x2dfa98[_0x079d('0x13')]));});});}; \ No newline at end of file +var _0x109f=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','debug','request\x20sent','error','code','SalesforceAccount,\x20%s,\x20%s','message','info','result','catch','SalesforceAccount','findAll','options','where','map','include','model','attributes','GetSalesforceAccount','ShowSalesforceAccount','find','raw','stringify','lodash','util','moment'];(function(_0x29a948,_0x4f523a){var _0x42849e=function(_0x49293c){while(--_0x49293c){_0x29a948['push'](_0x29a948['shift']());}};_0x42849e(++_0x4f523a);}(_0x109f,0x115));var _0xf109=function(_0x575c25,_0x56800c){_0x575c25=_0x575c25-0x0;var _0x4df2ec=_0x109f[_0x575c25];return _0x4df2ec;};'use strict';var _=require(_0xf109('0x0'));var util=require(_0xf109('0x1'));var moment=require(_0xf109('0x2'));var BPromise=require(_0xf109('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf109('0x4'));var db=require(_0xf109('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf109('0x6'))(_0xf109('0x7'));var config=require(_0xf109('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf109('0x9')][_0xf109('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ccb81,_0x4e7d71,_0x2d870d){return new BPromise(function(_0x337d90,_0x1a2e97){return client[_0xf109('0xb')](_0x2ccb81,_0x2d870d)[_0xf109('0xc')](function(_0x38bccc){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x4e7d71,'request\x20sent');logger[_0xf109('0xd')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x4e7d71,_0xf109('0xe'),JSON['stringify'](_0x38bccc));if(_0x38bccc[_0xf109('0xf')]){if(_0x38bccc[_0xf109('0xf')][_0xf109('0x10')]===0x1f4){logger[_0xf109('0xf')](_0xf109('0x11'),_0x4e7d71,_0x38bccc[_0xf109('0xf')]['message']);return _0x1a2e97(_0x38bccc['error'][_0xf109('0x12')]);}logger[_0xf109('0xf')](_0xf109('0x11'),_0x4e7d71,_0x38bccc[_0xf109('0xf')][_0xf109('0x12')]);return _0x337d90(_0x38bccc[_0xf109('0xf')][_0xf109('0x12')]);}else{logger[_0xf109('0x13')](_0xf109('0x11'),_0x4e7d71,_0xf109('0xe'));_0x337d90(_0x38bccc[_0xf109('0x14')][_0xf109('0x12')]);}})[_0xf109('0x15')](function(_0x5d4057){logger[_0xf109('0xf')](_0xf109('0x11'),_0x4e7d71,_0x5d4057);_0x1a2e97(_0x5d4057);});});}exports['GetSalesforceAccount']=function(_0x5c8db2){var _0x21691c=this;return new Promise(function(_0x5b4fc3,_0x32e39b){return db[_0xf109('0x16')][_0xf109('0x17')]({'raw':_0x5c8db2[_0xf109('0x18')]?_0x5c8db2[_0xf109('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5c8db2[_0xf109('0x18')]?_0x5c8db2[_0xf109('0x18')][_0xf109('0x19')]||null:null,'attributes':_0x5c8db2[_0xf109('0x18')]?_0x5c8db2[_0xf109('0x18')]['attributes']||null:null,'limit':_0x5c8db2[_0xf109('0x18')]?_0x5c8db2[_0xf109('0x18')]['limit']||null:null,'include':_0x5c8db2[_0xf109('0x18')]?_0x5c8db2[_0xf109('0x18')]['include']?_[_0xf109('0x1a')](_0x5c8db2[_0xf109('0x18')][_0xf109('0x1b')],function(_0xf3124){return{'model':db[_0xf3124[_0xf109('0x1c')]],'as':_0xf3124['as'],'attributes':_0xf3124[_0xf109('0x1d')],'include':_0xf3124['include']?_[_0xf109('0x1a')](_0xf3124[_0xf109('0x1b')],function(_0x5471ab){return{'model':db[_0x5471ab[_0xf109('0x1c')]],'as':_0x5471ab['as'],'attributes':_0x5471ab[_0xf109('0x1d')],'include':_0x5471ab[_0xf109('0x1b')]?_[_0xf109('0x1a')](_0x5471ab[_0xf109('0x1b')],function(_0x439a4d){return{'model':db[_0x439a4d[_0xf109('0x1c')]],'as':_0x439a4d['as'],'attributes':_0x439a4d[_0xf109('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf109('0xc')](function(_0x1316d3){logger['info'](_0xf109('0x1e'),_0x5c8db2);logger[_0xf109('0xd')](_0xf109('0x1e'),_0x5c8db2,JSON['stringify'](_0x1316d3));_0x5b4fc3(_0x1316d3);})[_0xf109('0x15')](function(_0x234a9d){logger[_0xf109('0xf')]('GetSalesforceAccount',_0x234a9d['message'],_0x5c8db2);_0x32e39b(_0x21691c['error'](0x1f4,_0x234a9d[_0xf109('0x12')]));});});};exports[_0xf109('0x1f')]=function(_0x418508){var _0x2e1dee=this;return new Promise(function(_0x5b89dc,_0x5c8314){return db['SalesforceAccount'][_0xf109('0x20')]({'raw':_0x418508['options']?_0x418508[_0xf109('0x18')][_0xf109('0x21')]===undefined?!![]:![]:!![],'where':_0x418508[_0xf109('0x18')]?_0x418508[_0xf109('0x18')]['where']||null:null,'attributes':_0x418508[_0xf109('0x18')]?_0x418508[_0xf109('0x18')][_0xf109('0x1d')]||null:null,'include':_0x418508['options']?_0x418508['options'][_0xf109('0x1b')]?_['map'](_0x418508[_0xf109('0x18')]['include'],function(_0x4747ad){return{'model':db[_0x4747ad['model']],'as':_0x4747ad['as'],'attributes':_0x4747ad[_0xf109('0x1d')],'include':_0x4747ad[_0xf109('0x1b')]?_[_0xf109('0x1a')](_0x4747ad[_0xf109('0x1b')],function(_0x23c588){return{'model':db[_0x23c588[_0xf109('0x1c')]],'as':_0x23c588['as'],'attributes':_0x23c588[_0xf109('0x1d')],'include':_0x23c588[_0xf109('0x1b')]?_[_0xf109('0x1a')](_0x23c588[_0xf109('0x1b')],function(_0x2899ae){return{'model':db[_0x2899ae['model']],'as':_0x2899ae['as'],'attributes':_0x2899ae[_0xf109('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x10314d){logger['info']('ShowSalesforceAccount',_0x418508);logger[_0xf109('0xd')]('ShowSalesforceAccount',_0x418508,JSON[_0xf109('0x22')](_0x10314d));_0x5b89dc(_0x10314d);})[_0xf109('0x15')](function(_0x195bbd){logger[_0xf109('0xf')](_0xf109('0x1f'),_0x195bbd[_0xf109('0x12')],_0x418508);_0x5c8314(_0x2e1dee[_0xf109('0xf')](0x1f4,_0x195bbd[_0xf109('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index fcde7e3..0d96059 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 _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x296046,_0x48802b){var _0x569a32=function(_0x599e3d){while(--_0x599e3d){_0x296046['push'](_0x296046['shift']());}};_0x569a32(++_0x48802b);}(_0x2ef3,0xba));var _0x32ef=function(_0x5dd0be,_0x51492b){_0x5dd0be=_0x5dd0be-0x0;var _0x580df8=_0x2ef3[_0x5dd0be];return _0x580df8;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=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(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xdb28,0x106));var _0x8db2=function(_0x313b62,_0x4c7284){_0x313b62=_0x313b62-0x0;var _0x244e3c=_0xdb28[_0x313b62];return _0x244e3c;};'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 aa23a70..daa8c03 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 _0x135e=['ENUM','Case','Task','contact','account_contact_lead','account','contact_lead','nothing','lead','exports','STRING'];(function(_0x2d9442,_0x76446b){var _0x49a1de=function(_0x31ea2c){while(--_0x31ea2c){_0x2d9442['push'](_0x2d9442['shift']());}};_0x49a1de(++_0x76446b);}(_0x135e,0x15e));var _0xe135=function(_0x180b15,_0x2a16e6){_0x180b15=_0x180b15-0x0;var _0x2c7fc5=_0x135e[_0x180b15];return _0x2c7fc5;};'use strict';var Sequelize=require('sequelize');module[_0xe135('0x0')]={'name':{'type':Sequelize[_0xe135('0x1')]},'description':{'type':Sequelize[_0xe135('0x1')]},'ticketType':{'type':Sequelize[_0xe135('0x2')]('Task',_0xe135('0x3')),'defaultValue':_0xe135('0x4')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0xe135('0x5'),'lead',_0xe135('0x6'),_0xe135('0x7')),'defaultValue':_0xe135('0x8')},'moduleCreate':{'type':Sequelize['ENUM'](_0xe135('0x9'),_0xe135('0x5'),'lead',_0xe135('0x7')),'defaultValue':_0xe135('0xa')},'leadId':{'type':Sequelize[_0xe135('0x1')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0xe135('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xe135('0x1')]}}; \ No newline at end of file +var _0x871a=['contact_lead','nothing','contact','sequelize','STRING','ENUM','Case','Task','lead','account_contact_lead'];(function(_0x256306,_0x561eea){var _0x52f090=function(_0x368114){while(--_0x368114){_0x256306['push'](_0x256306['shift']());}};_0x52f090(++_0x561eea);}(_0x871a,0x7b));var _0xa871=function(_0x448774,_0x45ddc7){_0x448774=_0x448774-0x0;var _0x46b2f6=_0x871a[_0x448774];return _0x46b2f6;};'use strict';var Sequelize=require(_0xa871('0x0'));module['exports']={'name':{'type':Sequelize[_0xa871('0x1')]},'description':{'type':Sequelize[_0xa871('0x1')]},'ticketType':{'type':Sequelize[_0xa871('0x2')]('Task',_0xa871('0x3')),'defaultValue':_0xa871('0x4')},'moduleSearch':{'type':Sequelize[_0xa871('0x2')]('contact_lead','contact',_0xa871('0x5'),_0xa871('0x6'),'account'),'defaultValue':_0xa871('0x7')},'moduleCreate':{'type':Sequelize[_0xa871('0x2')](_0xa871('0x8'),_0xa871('0x9'),_0xa871('0x5'),'account'),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0xa871('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xa871('0x1')]},'additionalSearchContact':{'type':Sequelize[_0xa871('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xa871('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index fea20ec..21b74ce 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 _0xd08a=['count','offset','json','reject','save','update','then','destroy','error','name','send','index','map','SalesforceConfiguration','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','body','getFields','findOne','SalesforceField','length','pick','hasOwnProperty','getSubjects','nolimit','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','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','end','status','undefined','limit'];(function(_0x56f24c,_0x2958aa){var _0x43e59b=function(_0x17e319){while(--_0x17e319){_0x56f24c['push'](_0x56f24c['shift']());}};_0x43e59b(++_0x2958aa);}(_0xd08a,0x83));var _0xad08=function(_0x50f98e,_0x3bd1ad){_0x50f98e=_0x50f98e-0x0;var _0x111ac0=_0xd08a[_0x50f98e];return _0x111ac0;};'use strict';var emlformat=require(_0xad08('0x0'));var rimraf=require(_0xad08('0x1'));var zipdir=require(_0xad08('0x2'));var jsonpatch=require(_0xad08('0x3'));var rp=require('request-promise');var moment=require(_0xad08('0x4'));var BPromise=require(_0xad08('0x5'));var Mustache=require(_0xad08('0x6'));var util=require(_0xad08('0x7'));var path=require(_0xad08('0x8'));var sox=require('sox');var csv=require(_0xad08('0x9'));var ejs=require(_0xad08('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xad08('0xb'));var squel=require(_0xad08('0xc'));var crypto=require(_0xad08('0xd'));var jsforce=require(_0xad08('0xe'));var deskjs=require(_0xad08('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xad08('0x10'));var Redis=require(_0xad08('0x11'));var authService=require(_0xad08('0x12'));var qs=require(_0xad08('0x13'));var as=require(_0xad08('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xad08('0x15'))(_0xad08('0x16'));var utils=require('../../config/utils');var config=require(_0xad08('0x17'));var licenseUtil=require(_0xad08('0x18'));var db=require(_0xad08('0x19'))['db'];function respondWithStatusCode(_0x24c0fc,_0x33283b){_0x33283b=_0x33283b||0xcc;return function(_0x436a18){if(_0x436a18){return _0x24c0fc[_0xad08('0x1a')](_0x33283b);}return _0x24c0fc['status'](_0x33283b)[_0xad08('0x1b')]();};}function respondWithResult(_0x1ad227,_0x20dcbf){_0x20dcbf=_0x20dcbf||0xc8;return function(_0x295ca3){if(_0x295ca3){return _0x1ad227[_0xad08('0x1c')](_0x20dcbf)['json'](_0x295ca3);}};}function respondWithFilteredResult(_0x3a03d6,_0x2fde8c){return function(_0x25c48c){if(_0x25c48c){var _0x42965a=typeof _0x2fde8c['offset']===_0xad08('0x1d')&&typeof _0x2fde8c[_0xad08('0x1e')]===_0xad08('0x1d');var _0x2a4fef=_0x25c48c[_0xad08('0x1f')];var _0x12469c=_0x42965a?0x0:_0x2fde8c[_0xad08('0x20')];var _0x3b63b2=_0x42965a?_0x25c48c[_0xad08('0x1f')]:_0x2fde8c[_0xad08('0x20')]+_0x2fde8c[_0xad08('0x1e')];var _0x436cc7;if(_0x3b63b2>=_0x2a4fef){_0x3b63b2=_0x2a4fef;_0x436cc7=0xc8;}else{_0x436cc7=0xce;}_0x3a03d6[_0xad08('0x1c')](_0x436cc7);return _0x3a03d6['set']('Content-Range',_0x12469c+'-'+_0x3b63b2+'/'+_0x2a4fef)[_0xad08('0x21')](_0x25c48c);}return null;};}function patchUpdates(_0x20f864){return function(_0x46fe7b){try{jsonpatch['apply'](_0x46fe7b,_0x20f864,!![]);}catch(_0x5bec1e){return BPromise[_0xad08('0x22')](_0x5bec1e);}return _0x46fe7b[_0xad08('0x23')]();};}function saveUpdates(_0x3c830b,_0x2d8951){return function(_0x364de1){if(_0x364de1){return _0x364de1[_0xad08('0x24')](_0x3c830b)[_0xad08('0x25')](function(_0x9a5b32){return _0x9a5b32;});}return null;};}function removeEntity(_0x3263ce,_0x84831e){return function(_0x2b0cf3){if(_0x2b0cf3){return _0x2b0cf3[_0xad08('0x26')]()['then'](function(){_0x3263ce['status'](0xcc)[_0xad08('0x1b')]();});}};}function handleEntityNotFound(_0x5ee782,_0x77a04e){return function(_0x44b877){if(!_0x44b877){_0x5ee782[_0xad08('0x1a')](0x194);}return _0x44b877;};}function handleError(_0x2fd8e6,_0x524ee6){_0x524ee6=_0x524ee6||0x1f4;return function(_0xc68df8){logger[_0xad08('0x27')](_0xc68df8['stack']);if(_0xc68df8[_0xad08('0x28')]){delete _0xc68df8['name'];}_0x2fd8e6['status'](_0x524ee6)[_0xad08('0x29')](_0xc68df8);};}exports[_0xad08('0x2a')]=function(_0x5e09f5,_0x549f5f){var _0x5e715c={},_0x5a7443={},_0xfe45bc={'count':0x0,'rows':[]};var _0x39a4b7=_[_0xad08('0x2b')](db[_0xad08('0x2c')]['rawAttributes'],function(_0x33f7a7){return{'name':_0x33f7a7[_0xad08('0x2d')],'type':_0x33f7a7[_0xad08('0x2e')][_0xad08('0x2f')]};});_0x5a7443['model']=_[_0xad08('0x2b')](_0x39a4b7,'name');_0x5a7443[_0xad08('0x30')]=_[_0xad08('0x31')](_0x5e09f5[_0xad08('0x30')]);_0x5a7443[_0xad08('0x32')]=_[_0xad08('0x33')](_0x5a7443[_0xad08('0x34')],_0x5a7443[_0xad08('0x30')]);_0x5e715c[_0xad08('0x35')]=_[_0xad08('0x33')](_0x5a7443[_0xad08('0x34')],qs[_0xad08('0x36')](_0x5e09f5[_0xad08('0x30')][_0xad08('0x36')]));_0x5e715c[_0xad08('0x35')]=_0x5e715c[_0xad08('0x35')]['length']?_0x5e715c['attributes']:_0x5a7443[_0xad08('0x34')];if(!_0x5e09f5[_0xad08('0x30')]['hasOwnProperty']('nolimit')){_0x5e715c[_0xad08('0x1e')]=qs[_0xad08('0x1e')](_0x5e09f5[_0xad08('0x30')][_0xad08('0x1e')]);_0x5e715c['offset']=qs[_0xad08('0x20')](_0x5e09f5['query']['offset']);}_0x5e715c[_0xad08('0x37')]=qs[_0xad08('0x38')](_0x5e09f5['query'][_0xad08('0x38')]);_0x5e715c[_0xad08('0x39')]=qs[_0xad08('0x32')](_['pick'](_0x5e09f5['query'],_0x5a7443[_0xad08('0x32')]),_0x39a4b7);if(_0x5e09f5[_0xad08('0x30')][_0xad08('0x3a')]){_0x5e715c[_0xad08('0x39')]=_[_0xad08('0x3b')](_0x5e715c[_0xad08('0x39')],{'$or':_[_0xad08('0x2b')](_0x39a4b7,function(_0xce5457){if(_0xce5457[_0xad08('0x2e')]!==_0xad08('0x3c')){var _0x4063c7={};_0x4063c7[_0xce5457['name']]={'$like':'%'+_0x5e09f5['query'][_0xad08('0x3a')]+'%'};return _0x4063c7;}})});}_0x5e715c=_[_0xad08('0x3b')]({},_0x5e715c,_0x5e09f5[_0xad08('0x3d')]);var _0x88bc81={'where':_0x5e715c['where']};return db[_0xad08('0x2c')][_0xad08('0x1f')](_0x88bc81)['then'](function(_0x468e16){_0xfe45bc['count']=_0x468e16;if(_0x5e09f5[_0xad08('0x30')]['includeAll']){_0x5e715c[_0xad08('0x3e')]=[{'all':!![]}];}return db[_0xad08('0x2c')][_0xad08('0x3f')](_0x5e715c);})[_0xad08('0x25')](function(_0x45824c){_0xfe45bc['rows']=_0x45824c;return _0xfe45bc;})['then'](respondWithFilteredResult(_0x549f5f,_0x5e715c))[_0xad08('0x40')](handleError(_0x549f5f,null));};exports[_0xad08('0x41')]=function(_0x2fb9dc,_0x48ce4b){var _0x381e2d={'raw':![],'where':{'id':_0x2fb9dc[_0xad08('0x42')]['id']}},_0x3d3663={};_0x3d3663['model']=_[_0xad08('0x31')](db['SalesforceConfiguration'][_0xad08('0x43')]);_0x3d3663[_0xad08('0x30')]=_[_0xad08('0x31')](_0x2fb9dc[_0xad08('0x30')]);_0x3d3663[_0xad08('0x32')]=_[_0xad08('0x33')](_0x3d3663[_0xad08('0x34')],_0x3d3663['query']);_0x381e2d[_0xad08('0x35')]=_[_0xad08('0x33')](_0x3d3663[_0xad08('0x34')],qs[_0xad08('0x36')](_0x2fb9dc[_0xad08('0x30')]['fields']));_0x381e2d['attributes']=_0x381e2d[_0xad08('0x35')]['length']?_0x381e2d['attributes']:_0x3d3663[_0xad08('0x34')];if(_0x2fb9dc[_0xad08('0x30')][_0xad08('0x44')]){_0x381e2d['include']=[{'all':!![]}];}_0x381e2d=_[_0xad08('0x3b')]({},_0x381e2d,_0x2fb9dc[_0xad08('0x3d')]);return db['SalesforceConfiguration'][_0xad08('0x45')](_0x381e2d)[_0xad08('0x25')](handleEntityNotFound(_0x48ce4b,null))[_0xad08('0x25')](respondWithResult(_0x48ce4b,null))[_0xad08('0x40')](handleError(_0x48ce4b,null));};exports[_0xad08('0x46')]=function(_0x210a0c,_0x32495e){return db[_0xad08('0x2c')][_0xad08('0x46')](_0x210a0c['body'],{})['then'](respondWithResult(_0x32495e,0xc9))[_0xad08('0x40')](handleError(_0x32495e,null));};exports['update']=function(_0x1c38d6,_0x47ec4e){if(_0x1c38d6[_0xad08('0x47')]['id']){delete _0x1c38d6[_0xad08('0x47')]['id'];}return db[_0xad08('0x2c')][_0xad08('0x45')]({'where':{'id':_0x1c38d6['params']['id']}})[_0xad08('0x25')](handleEntityNotFound(_0x47ec4e,null))[_0xad08('0x25')](saveUpdates(_0x1c38d6[_0xad08('0x47')],null))[_0xad08('0x25')](respondWithResult(_0x47ec4e,null))[_0xad08('0x40')](handleError(_0x47ec4e,null));};exports[_0xad08('0x26')]=function(_0x43d022,_0x3e55b8){return db['SalesforceConfiguration'][_0xad08('0x45')]({'where':{'id':_0x43d022['params']['id']}})[_0xad08('0x25')](handleEntityNotFound(_0x3e55b8,null))[_0xad08('0x25')](removeEntity(_0x3e55b8,null))[_0xad08('0x40')](handleError(_0x3e55b8,null));};exports[_0xad08('0x48')]=function(_0x197cd5,_0x3c13cc,_0x44f3bb){var _0x518f3d={};var _0x114aae={};var _0x3dff91;var _0x269a99;return db[_0xad08('0x2c')][_0xad08('0x49')]({'where':{'id':_0x197cd5[_0xad08('0x42')]['id']}})[_0xad08('0x25')](handleEntityNotFound(_0x3c13cc,null))[_0xad08('0x25')](function(_0xc149ed){if(_0xc149ed){_0x3dff91=_0xc149ed;_0x114aae[_0xad08('0x34')]=_['keys'](db[_0xad08('0x4a')][_0xad08('0x43')]);_0x114aae[_0xad08('0x30')]=_[_0xad08('0x31')](_0x197cd5[_0xad08('0x30')]);_0x114aae['filters']=_[_0xad08('0x33')](_0x114aae[_0xad08('0x34')],_0x114aae[_0xad08('0x30')]);_0x518f3d[_0xad08('0x35')]=_['intersection'](_0x114aae[_0xad08('0x34')],qs[_0xad08('0x36')](_0x197cd5[_0xad08('0x30')][_0xad08('0x36')]));_0x518f3d['attributes']=_0x518f3d['attributes'][_0xad08('0x4b')]?_0x518f3d[_0xad08('0x35')]:_0x114aae[_0xad08('0x34')];_0x518f3d[_0xad08('0x37')]=qs['sort'](_0x197cd5[_0xad08('0x30')]['sort']);_0x518f3d[_0xad08('0x39')]=qs[_0xad08('0x32')](_[_0xad08('0x4c')](_0x197cd5[_0xad08('0x30')],_0x114aae[_0xad08('0x32')]));if(_0x197cd5[_0xad08('0x30')][_0xad08('0x3a')]){_0x518f3d[_0xad08('0x39')]=_[_0xad08('0x3b')](_0x518f3d[_0xad08('0x39')],{'$or':_[_0xad08('0x2b')](_0x518f3d[_0xad08('0x35')],function(_0x3ca37b){var _0x4849fc={};_0x4849fc[_0x3ca37b]={'$like':'%'+_0x197cd5[_0xad08('0x30')][_0xad08('0x3a')]+'%'};return _0x4849fc;})});}_0x518f3d=_[_0xad08('0x3b')]({},_0x518f3d,_0x197cd5['options']);return _0x3dff91[_0xad08('0x48')](_0x518f3d);}})['then'](function(_0x14b43b){if(_0x14b43b){_0x269a99=_0x14b43b[_0xad08('0x4b')];if(!_0x197cd5[_0xad08('0x30')][_0xad08('0x4d')]('nolimit')){_0x518f3d[_0xad08('0x1e')]=qs[_0xad08('0x1e')](_0x197cd5[_0xad08('0x30')]['limit']);_0x518f3d[_0xad08('0x20')]=qs[_0xad08('0x20')](_0x197cd5[_0xad08('0x30')][_0xad08('0x20')]);}return _0x3dff91[_0xad08('0x48')](_0x518f3d);}})[_0xad08('0x25')](function(_0x151e1d){if(_0x151e1d){return _0x151e1d?{'count':_0x269a99,'rows':_0x151e1d}:null;}})[_0xad08('0x25')](respondWithResult(_0x3c13cc,null))[_0xad08('0x40')](handleError(_0x3c13cc,null));};exports[_0xad08('0x4e')]=function(_0x1dba09,_0x2aee96,_0x1c4927){var _0x442a7f={};var _0x410fb6={};var _0x298113;var _0x1a73f9;return db[_0xad08('0x2c')][_0xad08('0x49')]({'where':{'id':_0x1dba09[_0xad08('0x42')]['id']}})['then'](handleEntityNotFound(_0x2aee96,null))[_0xad08('0x25')](function(_0x5f09cb){if(_0x5f09cb){_0x298113=_0x5f09cb;_0x410fb6[_0xad08('0x34')]=_[_0xad08('0x31')](db[_0xad08('0x4a')][_0xad08('0x43')]);_0x410fb6[_0xad08('0x30')]=_[_0xad08('0x31')](_0x1dba09[_0xad08('0x30')]);_0x410fb6[_0xad08('0x32')]=_[_0xad08('0x33')](_0x410fb6['model'],_0x410fb6[_0xad08('0x30')]);_0x442a7f['attributes']=_[_0xad08('0x33')](_0x410fb6[_0xad08('0x34')],qs[_0xad08('0x36')](_0x1dba09[_0xad08('0x30')][_0xad08('0x36')]));_0x442a7f['attributes']=_0x442a7f[_0xad08('0x35')]['length']?_0x442a7f['attributes']:_0x410fb6[_0xad08('0x34')];_0x442a7f['order']=qs[_0xad08('0x38')](_0x1dba09[_0xad08('0x30')][_0xad08('0x38')]);_0x442a7f['where']=qs[_0xad08('0x32')](_[_0xad08('0x4c')](_0x1dba09['query'],_0x410fb6[_0xad08('0x32')]));if(_0x1dba09[_0xad08('0x30')][_0xad08('0x3a')]){_0x442a7f[_0xad08('0x39')]=_['merge'](_0x442a7f[_0xad08('0x39')],{'$or':_[_0xad08('0x2b')](_0x442a7f['attributes'],function(_0x544e14){var _0x12cc83={};_0x12cc83[_0x544e14]={'$like':'%'+_0x1dba09[_0xad08('0x30')]['filter']+'%'};return _0x12cc83;})});}_0x442a7f=_['merge']({},_0x442a7f,_0x1dba09[_0xad08('0x3d')]);return _0x298113[_0xad08('0x4e')](_0x442a7f);}})[_0xad08('0x25')](function(_0x16f7d8){if(_0x16f7d8){_0x1a73f9=_0x16f7d8[_0xad08('0x4b')];if(!_0x1dba09[_0xad08('0x30')][_0xad08('0x4d')](_0xad08('0x4f'))){_0x442a7f[_0xad08('0x1e')]=qs[_0xad08('0x1e')](_0x1dba09['query']['limit']);_0x442a7f['offset']=qs['offset'](_0x1dba09[_0xad08('0x30')][_0xad08('0x20')]);}return _0x298113[_0xad08('0x4e')](_0x442a7f);}})['then'](function(_0x3f251e){if(_0x3f251e){return _0x3f251e?{'count':_0x1a73f9,'rows':_0x3f251e}:null;}})[_0xad08('0x25')](respondWithResult(_0x2aee96,null))['catch'](handleError(_0x2aee96,null));};exports['getDescriptions']=function(_0x42507e,_0x34994d,_0x49a090){var _0x402e83={};var _0x7af95c={};var _0x3e0bab;var _0x58fcf1;return db['SalesforceConfiguration'][_0xad08('0x49')]({'where':{'id':_0x42507e[_0xad08('0x42')]['id']}})[_0xad08('0x25')](handleEntityNotFound(_0x34994d,null))[_0xad08('0x25')](function(_0x203404){if(_0x203404){_0x3e0bab=_0x203404;_0x7af95c[_0xad08('0x34')]=_[_0xad08('0x31')](db[_0xad08('0x4a')][_0xad08('0x43')]);_0x7af95c[_0xad08('0x30')]=_[_0xad08('0x31')](_0x42507e[_0xad08('0x30')]);_0x7af95c[_0xad08('0x32')]=_[_0xad08('0x33')](_0x7af95c['model'],_0x7af95c[_0xad08('0x30')]);_0x402e83[_0xad08('0x35')]=_['intersection'](_0x7af95c[_0xad08('0x34')],qs[_0xad08('0x36')](_0x42507e['query'][_0xad08('0x36')]));_0x402e83[_0xad08('0x35')]=_0x402e83[_0xad08('0x35')][_0xad08('0x4b')]?_0x402e83['attributes']:_0x7af95c[_0xad08('0x34')];_0x402e83['order']=qs[_0xad08('0x38')](_0x42507e[_0xad08('0x30')][_0xad08('0x38')]);_0x402e83[_0xad08('0x39')]=qs[_0xad08('0x32')](_['pick'](_0x42507e['query'],_0x7af95c['filters']));if(_0x42507e[_0xad08('0x30')][_0xad08('0x3a')]){_0x402e83[_0xad08('0x39')]=_[_0xad08('0x3b')](_0x402e83[_0xad08('0x39')],{'$or':_[_0xad08('0x2b')](_0x402e83['attributes'],function(_0x3e7270){var _0x311f94={};_0x311f94[_0x3e7270]={'$like':'%'+_0x42507e[_0xad08('0x30')][_0xad08('0x3a')]+'%'};return _0x311f94;})});}_0x402e83=_[_0xad08('0x3b')]({},_0x402e83,_0x42507e['options']);return _0x3e0bab[_0xad08('0x50')](_0x402e83);}})[_0xad08('0x25')](function(_0x5d2a93){if(_0x5d2a93){_0x58fcf1=_0x5d2a93['length'];if(!_0x42507e[_0xad08('0x30')]['hasOwnProperty'](_0xad08('0x4f'))){_0x402e83[_0xad08('0x1e')]=qs[_0xad08('0x1e')](_0x42507e[_0xad08('0x30')][_0xad08('0x1e')]);_0x402e83[_0xad08('0x20')]=qs['offset'](_0x42507e[_0xad08('0x30')][_0xad08('0x20')]);}return _0x3e0bab[_0xad08('0x50')](_0x402e83);}})['then'](function(_0x385f37){if(_0x385f37){return _0x385f37?{'count':_0x58fcf1,'rows':_0x385f37}:null;}})[_0xad08('0x25')](respondWithResult(_0x34994d,null))[_0xad08('0x40')](handleError(_0x34994d,null));}; \ No newline at end of file +var _0x7408=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','error','stack','name','send','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','includeAll','create','body','find','params','destroy','getFields','SalesforceField','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','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','api','../../config/utils'];(function(_0x259d17,_0x220710){var _0x407535=function(_0x49bc38){while(--_0x49bc38){_0x259d17['push'](_0x259d17['shift']());}};_0x407535(++_0x220710);}(_0x7408,0x8d));var _0x8740=function(_0x54defc,_0x627178){_0x54defc=_0x54defc-0x0;var _0x1955d3=_0x7408[_0x54defc];return _0x1955d3;};'use strict';var emlformat=require(_0x8740('0x0'));var rimraf=require(_0x8740('0x1'));var zipdir=require(_0x8740('0x2'));var jsonpatch=require(_0x8740('0x3'));var rp=require(_0x8740('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8740('0x5'));var path=require('path');var sox=require(_0x8740('0x6'));var csv=require(_0x8740('0x7'));var ejs=require(_0x8740('0x8'));var fs=require('fs');var fs_extra=require(_0x8740('0x9'));var _=require(_0x8740('0xa'));var squel=require(_0x8740('0xb'));var crypto=require(_0x8740('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8740('0xd'));var toCsv=require(_0x8740('0x7'));var querystring=require(_0x8740('0xe'));var Papa=require(_0x8740('0xf'));var Redis=require(_0x8740('0x10'));var authService=require(_0x8740('0x11'));var qs=require(_0x8740('0x12'));var as=require(_0x8740('0x13'));var hardwareService=require(_0x8740('0x14'));var logger=require('../../config/logger')(_0x8740('0x15'));var utils=require(_0x8740('0x16'));var config=require(_0x8740('0x17'));var licenseUtil=require(_0x8740('0x18'));var db=require(_0x8740('0x19'))['db'];function respondWithStatusCode(_0x4244c5,_0x16973a){_0x16973a=_0x16973a||0xcc;return function(_0x2ea7de){if(_0x2ea7de){return _0x4244c5[_0x8740('0x1a')](_0x16973a);}return _0x4244c5[_0x8740('0x1b')](_0x16973a)[_0x8740('0x1c')]();};}function respondWithResult(_0x1eace6,_0x576707){_0x576707=_0x576707||0xc8;return function(_0x108d8f){if(_0x108d8f){return _0x1eace6['status'](_0x576707)[_0x8740('0x1d')](_0x108d8f);}};}function respondWithFilteredResult(_0x4136d3,_0x4a1829){return function(_0x5a5451){if(_0x5a5451){var _0x32c1b1=typeof _0x4a1829[_0x8740('0x1e')]===_0x8740('0x1f')&&typeof _0x4a1829['limit']===_0x8740('0x1f');var _0x913be9=_0x5a5451[_0x8740('0x20')];var _0x5e6223=_0x32c1b1?0x0:_0x4a1829[_0x8740('0x1e')];var _0x4a42f6=_0x32c1b1?_0x5a5451['count']:_0x4a1829[_0x8740('0x1e')]+_0x4a1829[_0x8740('0x21')];var _0x326fca;if(_0x4a42f6>=_0x913be9){_0x4a42f6=_0x913be9;_0x326fca=0xc8;}else{_0x326fca=0xce;}_0x4136d3[_0x8740('0x1b')](_0x326fca);return _0x4136d3[_0x8740('0x22')]('Content-Range',_0x5e6223+'-'+_0x4a42f6+'/'+_0x913be9)[_0x8740('0x1d')](_0x5a5451);}return null;};}function patchUpdates(_0x9f7e8e){return function(_0x3e9346){try{jsonpatch[_0x8740('0x23')](_0x3e9346,_0x9f7e8e,!![]);}catch(_0x524d92){return BPromise[_0x8740('0x24')](_0x524d92);}return _0x3e9346['save']();};}function saveUpdates(_0x5f0962,_0x5a9dad){return function(_0x2c2edc){if(_0x2c2edc){return _0x2c2edc[_0x8740('0x25')](_0x5f0962)[_0x8740('0x26')](function(_0x2bc45a){return _0x2bc45a;});}return null;};}function removeEntity(_0xad4c56,_0x2884fb){return function(_0x4b2d49){if(_0x4b2d49){return _0x4b2d49['destroy']()[_0x8740('0x26')](function(){_0xad4c56['status'](0xcc)[_0x8740('0x1c')]();});}};}function handleEntityNotFound(_0x30617f,_0x7bc0da){return function(_0x59a3e7){if(!_0x59a3e7){_0x30617f[_0x8740('0x1a')](0x194);}return _0x59a3e7;};}function handleError(_0x170fb2,_0x445a3c){_0x445a3c=_0x445a3c||0x1f4;return function(_0x16299e){logger[_0x8740('0x27')](_0x16299e[_0x8740('0x28')]);if(_0x16299e[_0x8740('0x29')]){delete _0x16299e[_0x8740('0x29')];}_0x170fb2[_0x8740('0x1b')](_0x445a3c)[_0x8740('0x2a')](_0x16299e);};}exports['index']=function(_0x9dc523,_0x7b51d1){var _0x383936={},_0x1aba31={},_0xfbfe26={'count':0x0,'rows':[]};var _0x4ce6df=_[_0x8740('0x2b')](db[_0x8740('0x2c')][_0x8740('0x2d')],function(_0x4bcda6){return{'name':_0x4bcda6[_0x8740('0x2e')],'type':_0x4bcda6[_0x8740('0x2f')][_0x8740('0x30')]};});_0x1aba31[_0x8740('0x31')]=_[_0x8740('0x2b')](_0x4ce6df,_0x8740('0x29'));_0x1aba31['query']=_[_0x8740('0x32')](_0x9dc523[_0x8740('0x33')]);_0x1aba31[_0x8740('0x34')]=_[_0x8740('0x35')](_0x1aba31['model'],_0x1aba31['query']);_0x383936[_0x8740('0x36')]=_[_0x8740('0x35')](_0x1aba31[_0x8740('0x31')],qs[_0x8740('0x37')](_0x9dc523[_0x8740('0x33')]['fields']));_0x383936[_0x8740('0x36')]=_0x383936[_0x8740('0x36')][_0x8740('0x38')]?_0x383936[_0x8740('0x36')]:_0x1aba31[_0x8740('0x31')];if(!_0x9dc523[_0x8740('0x33')][_0x8740('0x39')](_0x8740('0x3a'))){_0x383936['limit']=qs[_0x8740('0x21')](_0x9dc523['query'][_0x8740('0x21')]);_0x383936['offset']=qs[_0x8740('0x1e')](_0x9dc523[_0x8740('0x33')][_0x8740('0x1e')]);}_0x383936[_0x8740('0x3b')]=qs[_0x8740('0x3c')](_0x9dc523[_0x8740('0x33')][_0x8740('0x3c')]);_0x383936[_0x8740('0x3d')]=qs[_0x8740('0x34')](_[_0x8740('0x3e')](_0x9dc523[_0x8740('0x33')],_0x1aba31[_0x8740('0x34')]),_0x4ce6df);if(_0x9dc523[_0x8740('0x33')][_0x8740('0x3f')]){_0x383936['where']=_[_0x8740('0x40')](_0x383936[_0x8740('0x3d')],{'$or':_[_0x8740('0x2b')](_0x4ce6df,function(_0x5f2cd2){if(_0x5f2cd2[_0x8740('0x2f')]!==_0x8740('0x41')){var _0x4ad438={};_0x4ad438[_0x5f2cd2[_0x8740('0x29')]]={'$like':'%'+_0x9dc523['query'][_0x8740('0x3f')]+'%'};return _0x4ad438;}})});}_0x383936=_['merge']({},_0x383936,_0x9dc523[_0x8740('0x42')]);var _0x21fbd4={'where':_0x383936[_0x8740('0x3d')]};return db[_0x8740('0x2c')][_0x8740('0x20')](_0x21fbd4)[_0x8740('0x26')](function(_0x1d2dbe){_0xfbfe26[_0x8740('0x20')]=_0x1d2dbe;if(_0x9dc523[_0x8740('0x33')]['includeAll']){_0x383936['include']=[{'all':!![]}];}return db[_0x8740('0x2c')][_0x8740('0x43')](_0x383936);})['then'](function(_0x3ab1f9){_0xfbfe26[_0x8740('0x44')]=_0x3ab1f9;return _0xfbfe26;})[_0x8740('0x26')](respondWithFilteredResult(_0x7b51d1,_0x383936))[_0x8740('0x45')](handleError(_0x7b51d1,null));};exports[_0x8740('0x46')]=function(_0x37cd28,_0x560c33){var _0x44608d={'raw':![],'where':{'id':_0x37cd28['params']['id']}},_0x1ed661={};_0x1ed661['model']=_[_0x8740('0x32')](db[_0x8740('0x2c')][_0x8740('0x2d')]);_0x1ed661[_0x8740('0x33')]=_[_0x8740('0x32')](_0x37cd28[_0x8740('0x33')]);_0x1ed661[_0x8740('0x34')]=_[_0x8740('0x35')](_0x1ed661[_0x8740('0x31')],_0x1ed661[_0x8740('0x33')]);_0x44608d[_0x8740('0x36')]=_[_0x8740('0x35')](_0x1ed661[_0x8740('0x31')],qs[_0x8740('0x37')](_0x37cd28[_0x8740('0x33')]['fields']));_0x44608d['attributes']=_0x44608d['attributes'][_0x8740('0x38')]?_0x44608d[_0x8740('0x36')]:_0x1ed661[_0x8740('0x31')];if(_0x37cd28[_0x8740('0x33')][_0x8740('0x47')]){_0x44608d['include']=[{'all':!![]}];}_0x44608d=_['merge']({},_0x44608d,_0x37cd28[_0x8740('0x42')]);return db[_0x8740('0x2c')]['find'](_0x44608d)['then'](handleEntityNotFound(_0x560c33,null))[_0x8740('0x26')](respondWithResult(_0x560c33,null))[_0x8740('0x45')](handleError(_0x560c33,null));};exports[_0x8740('0x48')]=function(_0x306324,_0x160fc1){return db[_0x8740('0x2c')][_0x8740('0x48')](_0x306324['body'],{})['then'](respondWithResult(_0x160fc1,0xc9))[_0x8740('0x45')](handleError(_0x160fc1,null));};exports['update']=function(_0xd96937,_0x3d4860){if(_0xd96937['body']['id']){delete _0xd96937[_0x8740('0x49')]['id'];}return db[_0x8740('0x2c')][_0x8740('0x4a')]({'where':{'id':_0xd96937[_0x8740('0x4b')]['id']}})[_0x8740('0x26')](handleEntityNotFound(_0x3d4860,null))[_0x8740('0x26')](saveUpdates(_0xd96937['body'],null))[_0x8740('0x26')](respondWithResult(_0x3d4860,null))[_0x8740('0x45')](handleError(_0x3d4860,null));};exports[_0x8740('0x4c')]=function(_0x1d9456,_0x1a831d){return db[_0x8740('0x2c')]['find']({'where':{'id':_0x1d9456[_0x8740('0x4b')]['id']}})[_0x8740('0x26')](handleEntityNotFound(_0x1a831d,null))[_0x8740('0x26')](removeEntity(_0x1a831d,null))[_0x8740('0x45')](handleError(_0x1a831d,null));};exports[_0x8740('0x4d')]=function(_0x13473d,_0x5d3802,_0x4e55bb){var _0x76acb6={};var _0x4e3fb3={};var _0x3d94ce;var _0x31c0a0;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x13473d['params']['id']}})[_0x8740('0x26')](handleEntityNotFound(_0x5d3802,null))['then'](function(_0x4bf6fa){if(_0x4bf6fa){_0x3d94ce=_0x4bf6fa;_0x4e3fb3[_0x8740('0x31')]=_[_0x8740('0x32')](db[_0x8740('0x4e')][_0x8740('0x2d')]);_0x4e3fb3['query']=_[_0x8740('0x32')](_0x13473d[_0x8740('0x33')]);_0x4e3fb3[_0x8740('0x34')]=_[_0x8740('0x35')](_0x4e3fb3[_0x8740('0x31')],_0x4e3fb3[_0x8740('0x33')]);_0x76acb6[_0x8740('0x36')]=_[_0x8740('0x35')](_0x4e3fb3[_0x8740('0x31')],qs['fields'](_0x13473d['query'][_0x8740('0x37')]));_0x76acb6[_0x8740('0x36')]=_0x76acb6[_0x8740('0x36')][_0x8740('0x38')]?_0x76acb6['attributes']:_0x4e3fb3[_0x8740('0x31')];_0x76acb6[_0x8740('0x3b')]=qs['sort'](_0x13473d[_0x8740('0x33')][_0x8740('0x3c')]);_0x76acb6[_0x8740('0x3d')]=qs[_0x8740('0x34')](_[_0x8740('0x3e')](_0x13473d[_0x8740('0x33')],_0x4e3fb3[_0x8740('0x34')]));if(_0x13473d['query'][_0x8740('0x3f')]){_0x76acb6['where']=_[_0x8740('0x40')](_0x76acb6['where'],{'$or':_[_0x8740('0x2b')](_0x76acb6[_0x8740('0x36')],function(_0x441cac){var _0x5d3bde={};_0x5d3bde[_0x441cac]={'$like':'%'+_0x13473d[_0x8740('0x33')][_0x8740('0x3f')]+'%'};return _0x5d3bde;})});}_0x76acb6=_[_0x8740('0x40')]({},_0x76acb6,_0x13473d['options']);return _0x3d94ce[_0x8740('0x4d')](_0x76acb6);}})['then'](function(_0x1b54ee){if(_0x1b54ee){_0x31c0a0=_0x1b54ee['length'];if(!_0x13473d[_0x8740('0x33')][_0x8740('0x39')](_0x8740('0x3a'))){_0x76acb6[_0x8740('0x21')]=qs['limit'](_0x13473d[_0x8740('0x33')][_0x8740('0x21')]);_0x76acb6[_0x8740('0x1e')]=qs[_0x8740('0x1e')](_0x13473d[_0x8740('0x33')][_0x8740('0x1e')]);}return _0x3d94ce[_0x8740('0x4d')](_0x76acb6);}})[_0x8740('0x26')](function(_0x18569b){if(_0x18569b){return _0x18569b?{'count':_0x31c0a0,'rows':_0x18569b}:null;}})[_0x8740('0x26')](respondWithResult(_0x5d3802,null))['catch'](handleError(_0x5d3802,null));};exports[_0x8740('0x4f')]=function(_0x2172db,_0x5da6af,_0x3d9cec){var _0x177a3b={};var _0x43223a={};var _0x2dbd97;var _0x5c2d6f;return db[_0x8740('0x2c')][_0x8740('0x50')]({'where':{'id':_0x2172db[_0x8740('0x4b')]['id']}})[_0x8740('0x26')](handleEntityNotFound(_0x5da6af,null))[_0x8740('0x26')](function(_0x3e261b){if(_0x3e261b){_0x2dbd97=_0x3e261b;_0x43223a[_0x8740('0x31')]=_[_0x8740('0x32')](db[_0x8740('0x4e')][_0x8740('0x2d')]);_0x43223a[_0x8740('0x33')]=_[_0x8740('0x32')](_0x2172db[_0x8740('0x33')]);_0x43223a[_0x8740('0x34')]=_[_0x8740('0x35')](_0x43223a[_0x8740('0x31')],_0x43223a[_0x8740('0x33')]);_0x177a3b[_0x8740('0x36')]=_['intersection'](_0x43223a[_0x8740('0x31')],qs['fields'](_0x2172db[_0x8740('0x33')]['fields']));_0x177a3b[_0x8740('0x36')]=_0x177a3b[_0x8740('0x36')][_0x8740('0x38')]?_0x177a3b[_0x8740('0x36')]:_0x43223a[_0x8740('0x31')];_0x177a3b['order']=qs[_0x8740('0x3c')](_0x2172db[_0x8740('0x33')][_0x8740('0x3c')]);_0x177a3b[_0x8740('0x3d')]=qs['filters'](_[_0x8740('0x3e')](_0x2172db['query'],_0x43223a[_0x8740('0x34')]));if(_0x2172db[_0x8740('0x33')][_0x8740('0x3f')]){_0x177a3b[_0x8740('0x3d')]=_[_0x8740('0x40')](_0x177a3b['where'],{'$or':_[_0x8740('0x2b')](_0x177a3b[_0x8740('0x36')],function(_0x325dc0){var _0x54b0dd={};_0x54b0dd[_0x325dc0]={'$like':'%'+_0x2172db[_0x8740('0x33')][_0x8740('0x3f')]+'%'};return _0x54b0dd;})});}_0x177a3b=_[_0x8740('0x40')]({},_0x177a3b,_0x2172db[_0x8740('0x42')]);return _0x2dbd97[_0x8740('0x4f')](_0x177a3b);}})[_0x8740('0x26')](function(_0x4ca5e9){if(_0x4ca5e9){_0x5c2d6f=_0x4ca5e9[_0x8740('0x38')];if(!_0x2172db['query']['hasOwnProperty'](_0x8740('0x3a'))){_0x177a3b[_0x8740('0x21')]=qs[_0x8740('0x21')](_0x2172db[_0x8740('0x33')]['limit']);_0x177a3b['offset']=qs[_0x8740('0x1e')](_0x2172db[_0x8740('0x33')][_0x8740('0x1e')]);}return _0x2dbd97[_0x8740('0x4f')](_0x177a3b);}})[_0x8740('0x26')](function(_0x8fe66b){if(_0x8fe66b){return _0x8fe66b?{'count':_0x5c2d6f,'rows':_0x8fe66b}:null;}})[_0x8740('0x26')](respondWithResult(_0x5da6af,null))['catch'](handleError(_0x5da6af,null));};exports['getDescriptions']=function(_0x2ee4bd,_0x6eae70,_0xe1006c){var _0x22df73={};var _0x2bfaf0={};var _0x430a8b;var _0x332e10;return db[_0x8740('0x2c')]['findOne']({'where':{'id':_0x2ee4bd[_0x8740('0x4b')]['id']}})['then'](handleEntityNotFound(_0x6eae70,null))[_0x8740('0x26')](function(_0x16eb71){if(_0x16eb71){_0x430a8b=_0x16eb71;_0x2bfaf0['model']=_[_0x8740('0x32')](db[_0x8740('0x4e')][_0x8740('0x2d')]);_0x2bfaf0[_0x8740('0x33')]=_[_0x8740('0x32')](_0x2ee4bd['query']);_0x2bfaf0[_0x8740('0x34')]=_[_0x8740('0x35')](_0x2bfaf0['model'],_0x2bfaf0[_0x8740('0x33')]);_0x22df73[_0x8740('0x36')]=_[_0x8740('0x35')](_0x2bfaf0[_0x8740('0x31')],qs['fields'](_0x2ee4bd[_0x8740('0x33')][_0x8740('0x37')]));_0x22df73[_0x8740('0x36')]=_0x22df73[_0x8740('0x36')][_0x8740('0x38')]?_0x22df73[_0x8740('0x36')]:_0x2bfaf0['model'];_0x22df73[_0x8740('0x3b')]=qs[_0x8740('0x3c')](_0x2ee4bd[_0x8740('0x33')][_0x8740('0x3c')]);_0x22df73[_0x8740('0x3d')]=qs[_0x8740('0x34')](_[_0x8740('0x3e')](_0x2ee4bd['query'],_0x2bfaf0[_0x8740('0x34')]));if(_0x2ee4bd[_0x8740('0x33')]['filter']){_0x22df73[_0x8740('0x3d')]=_['merge'](_0x22df73['where'],{'$or':_[_0x8740('0x2b')](_0x22df73[_0x8740('0x36')],function(_0xc3c2f9){var _0x5acf71={};_0x5acf71[_0xc3c2f9]={'$like':'%'+_0x2ee4bd[_0x8740('0x33')][_0x8740('0x3f')]+'%'};return _0x5acf71;})});}_0x22df73=_[_0x8740('0x40')]({},_0x22df73,_0x2ee4bd[_0x8740('0x42')]);return _0x430a8b['getDescriptions'](_0x22df73);}})[_0x8740('0x26')](function(_0xa299c5){if(_0xa299c5){_0x332e10=_0xa299c5['length'];if(!_0x2ee4bd[_0x8740('0x33')]['hasOwnProperty'](_0x8740('0x3a'))){_0x22df73['limit']=qs[_0x8740('0x21')](_0x2ee4bd[_0x8740('0x33')][_0x8740('0x21')]);_0x22df73[_0x8740('0x1e')]=qs['offset'](_0x2ee4bd['query']['offset']);}return _0x430a8b[_0x8740('0x51')](_0x22df73);}})['then'](function(_0x36f913){if(_0x36f913){return _0x36f913?{'count':_0x332e10,'rows':_0x36f913}:null;}})[_0x8740('0x26')](respondWithResult(_0x6eae70,null))[_0x8740('0x45')](handleError(_0x6eae70,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 7c7bda3..7e6fecd 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 _0x7251=['int_salesforce_configurations','../../config/logger','moment','bluebird','../../config/environment','define'];(function(_0x2a903a,_0x4ce677){var _0xd44f20=function(_0x1cbc82){while(--_0x1cbc82){_0x2a903a['push'](_0x2a903a['shift']());}};_0xd44f20(++_0x4ce677);}(_0x7251,0x181));var _0x1725=function(_0x1ef147,_0x347c47){_0x1ef147=_0x1ef147-0x0;var _0x348c0f=_0x7251[_0x1ef147];return _0x348c0f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1725('0x0'))('api');var moment=require(_0x1725('0x1'));var BPromise=require(_0x1725('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1725('0x3'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x294d8c,_0x42c406){return _0x294d8c[_0x1725('0x4')]('SalesforceConfiguration',attributes,{'tableName':_0x1725('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdac8=['api','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','SalesforceConfiguration','../../config/logger'];(function(_0x15afbe,_0xe70dd8){var _0x219832=function(_0x313800){while(--_0x313800){_0x15afbe['push'](_0x15afbe['shift']());}};_0x219832(++_0xe70dd8);}(_0xdac8,0x1ef));var _0x8dac=function(_0x1d86d7,_0x339449){_0x1d86d7=_0x1d86d7-0x0;var _0x1ea968=_0xdac8[_0x1d86d7];return _0x1ea968;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8dac('0x0'))(_0x8dac('0x1'));var moment=require('moment');var BPromise=require(_0x8dac('0x2'));var rp=require(_0x8dac('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8dac('0x4'));var config=require(_0x8dac('0x5'));var attributes=require(_0x8dac('0x6'));module['exports']=function(_0x1f5509,_0x1ab934){return _0x1f5509['define'](_0x8dac('0x7'),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 5a58689..a7b73b4 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 _0x2fa9=['request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s'];(function(_0x52aa05,_0x2130e3){var _0x279d66=function(_0x4c3ce0){while(--_0x4c3ce0){_0x52aa05['push'](_0x52aa05['shift']());}};_0x279d66(++_0x2130e3);}(_0x2fa9,0x1aa));var _0x92fa=function(_0x520a4e,_0x169421){_0x520a4e=_0x520a4e-0x0;var _0x5ea5d5=_0x2fa9[_0x520a4e];return _0x5ea5d5;};'use strict';var _=require('lodash');var util=require(_0x92fa('0x0'));var moment=require(_0x92fa('0x1'));var BPromise=require(_0x92fa('0x2'));var rs=require(_0x92fa('0x3'));var fs=require('fs');var Redis=require(_0x92fa('0x4'));var db=require(_0x92fa('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x92fa('0x6'))('rpc');var config=require(_0x92fa('0x7'));var jayson=require(_0x92fa('0x8'));var client=jayson[_0x92fa('0x9')][_0x92fa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40a28d,_0x2fddb1,_0x4c95f3){return new BPromise(function(_0x44642c,_0x9dbd86){return client[_0x92fa('0xb')](_0x40a28d,_0x4c95f3)['then'](function(_0x960008){logger[_0x92fa('0xc')](_0x92fa('0xd'),_0x2fddb1,_0x92fa('0xe'));logger[_0x92fa('0xf')](_0x92fa('0x10'),_0x2fddb1,'request\x20sent',JSON['stringify'](_0x960008));if(_0x960008[_0x92fa('0x11')]){if(_0x960008[_0x92fa('0x11')][_0x92fa('0x12')]===0x1f4){logger['error'](_0x92fa('0xd'),_0x2fddb1,_0x960008[_0x92fa('0x11')][_0x92fa('0x13')]);return _0x9dbd86(_0x960008['error'][_0x92fa('0x13')]);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x2fddb1,_0x960008[_0x92fa('0x11')][_0x92fa('0x13')]);return _0x44642c(_0x960008[_0x92fa('0x11')][_0x92fa('0x13')]);}else{logger[_0x92fa('0xc')](_0x92fa('0xd'),_0x2fddb1,_0x92fa('0xe'));_0x44642c(_0x960008[_0x92fa('0x14')][_0x92fa('0x13')]);}})[_0x92fa('0x15')](function(_0x9bded0){logger[_0x92fa('0x11')](_0x92fa('0xd'),_0x2fddb1,_0x9bded0);_0x9dbd86(_0x9bded0);});});} \ No newline at end of file +var _0x8727=['code','error','SalesforceConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x2dc367,_0x591c8a){var _0x14845a=function(_0xaef88b){while(--_0xaef88b){_0x2dc367['push'](_0x2dc367['shift']());}};_0x14845a(++_0x591c8a);}(_0x8727,0x147));var _0x7872=function(_0xdc43a4,_0x36fdd0){_0xdc43a4=_0xdc43a4-0x0;var _0x4cc4d3=_0x8727[_0xdc43a4];return _0x4cc4d3;};'use strict';var _=require(_0x7872('0x0'));var util=require(_0x7872('0x1'));var moment=require(_0x7872('0x2'));var BPromise=require(_0x7872('0x3'));var rs=require(_0x7872('0x4'));var fs=require('fs');var Redis=require(_0x7872('0x5'));var db=require(_0x7872('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7872('0x7'))(_0x7872('0x8'));var config=require(_0x7872('0x9'));var jayson=require(_0x7872('0xa'));var client=jayson[_0x7872('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xae230,_0x10ecc1,_0x19f219){return new BPromise(function(_0x2faeab,_0x5ed5a3){return client[_0x7872('0xc')](_0xae230,_0x19f219)[_0x7872('0xd')](function(_0xebc50){logger[_0x7872('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x10ecc1,_0x7872('0xf'));logger[_0x7872('0x10')](_0x7872('0x11'),_0x10ecc1,'request\x20sent',JSON['stringify'](_0xebc50));if(_0xebc50['error']){if(_0xebc50['error'][_0x7872('0x12')]===0x1f4){logger[_0x7872('0x13')](_0x7872('0x14'),_0x10ecc1,_0xebc50[_0x7872('0x13')][_0x7872('0x15')]);return _0x5ed5a3(_0xebc50['error'][_0x7872('0x15')]);}logger[_0x7872('0x13')](_0x7872('0x14'),_0x10ecc1,_0xebc50[_0x7872('0x13')][_0x7872('0x15')]);return _0x2faeab(_0xebc50['error'][_0x7872('0x15')]);}else{logger[_0x7872('0xe')](_0x7872('0x14'),_0x10ecc1,'request\x20sent');_0x2faeab(_0xebc50[_0x7872('0x16')][_0x7872('0x15')]);}})['catch'](function(_0x4014be){logger[_0x7872('0x13')](_0x7872('0x14'),_0x10ecc1,_0x4014be);_0x5ed5a3(_0x4014be);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 842248f..4cddc00 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 _0xf249=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','index','isAuthenticated','show','put','/:id','update','delete','destroy','exports'];(function(_0x511d5c,_0x4d44a0){var _0x128d3b=function(_0x271de6){while(--_0x271de6){_0x511d5c['push'](_0x511d5c['shift']());}};_0x128d3b(++_0x4d44a0);}(_0xf249,0x1c8));var _0x9f24=function(_0x41d734,_0x4102f6){_0x41d734=_0x41d734-0x0;var _0x11fdff=_0xf249[_0x41d734];return _0x11fdff;};'use strict';var multer=require('multer');var util=require(_0x9f24('0x0'));var path=require(_0x9f24('0x1'));var timeout=require(_0x9f24('0x2'));var express=require('express');var router=express[_0x9f24('0x3')]();var fs_extra=require(_0x9f24('0x4'));var auth=require(_0x9f24('0x5'));var interaction=require(_0x9f24('0x6'));var config=require(_0x9f24('0x7'));var controller=require(_0x9f24('0x8'));router[_0x9f24('0x9')]('/',auth['isAuthenticated'](),controller[_0x9f24('0xa')]);router[_0x9f24('0x9')]('/:id',auth[_0x9f24('0xb')](),controller[_0x9f24('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x9f24('0xd')](_0x9f24('0xe'),auth[_0x9f24('0xb')](),controller[_0x9f24('0xf')]);router[_0x9f24('0x10')]('/:id',auth[_0x9f24('0xb')](),controller[_0x9f24('0x11')]);module[_0x9f24('0x12')]=router; \ No newline at end of file +var _0xe96a=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','destroy','exports','multer'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xe96a,0x1cb));var _0xae96=function(_0x4a9beb,_0x159482){_0x4a9beb=_0x4a9beb-0x0;var _0x2d4c58=_0xe96a[_0x4a9beb];return _0x2d4c58;};'use strict';var multer=require(_0xae96('0x0'));var util=require(_0xae96('0x1'));var path=require(_0xae96('0x2'));var timeout=require('connect-timeout');var express=require(_0xae96('0x3'));var router=express[_0xae96('0x4')]();var fs_extra=require(_0xae96('0x5'));var auth=require(_0xae96('0x6'));var interaction=require(_0xae96('0x7'));var config=require('../../config/environment');var controller=require(_0xae96('0x8'));router['get']('/',auth[_0xae96('0x9')](),controller[_0xae96('0xa')]);router[_0xae96('0xb')](_0xae96('0xc'),auth[_0xae96('0x9')](),controller[_0xae96('0xd')]);router[_0xae96('0xe')]('/',auth[_0xae96('0x9')](),controller[_0xae96('0xf')]);router[_0xae96('0x10')]('/:id',auth[_0xae96('0x9')](),controller[_0xae96('0x11')]);router['delete']('/:id',auth[_0xae96('0x9')](),controller[_0xae96('0x12')]);module[_0xae96('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 09f6975..a05fe93 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 _0x5f67=['ENUM','variable','customVariable','keyValue','picklist','string','STRING','sequelize'];(function(_0x30d356,_0x327d64){var _0x368d09=function(_0x3e9a17){while(--_0x3e9a17){_0x30d356['push'](_0x30d356['shift']());}};_0x368d09(++_0x327d64);}(_0x5f67,0x197));var _0x75f6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f67[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x75f6('0x0'));module['exports']={'type':{'type':Sequelize[_0x75f6('0x1')]('string',_0x75f6('0x2'),_0x75f6('0x3'),_0x75f6('0x4'),_0x75f6('0x5')),'defaultValue':_0x75f6('0x6')},'content':{'type':Sequelize[_0x75f6('0x7')]},'key':{'type':Sequelize[_0x75f6('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x75f6('0x6'),_0x75f6('0x2'),_0x75f6('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x75f6('0x7')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0bf8=['string','variable','keyValue','STRING','customVariable','exports','ENUM'];(function(_0x502e2c,_0x28722b){var _0xb7947c=function(_0x5aa360){while(--_0x5aa360){_0x502e2c['push'](_0x502e2c['shift']());}};_0xb7947c(++_0x28722b);}(_0x0bf8,0x194));var _0x80bf=function(_0x5b2e7f,_0x4cf29a){_0x5b2e7f=_0x5b2e7f-0x0;var _0x6d6f90=_0x0bf8[_0x5b2e7f];return _0x6d6f90;};'use strict';var Sequelize=require('sequelize');module[_0x80bf('0x0')]={'type':{'type':Sequelize[_0x80bf('0x1')](_0x80bf('0x2'),_0x80bf('0x3'),'customVariable',_0x80bf('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x80bf('0x5')]},'keyType':{'type':Sequelize[_0x80bf('0x1')](_0x80bf('0x2'),_0x80bf('0x3'),_0x80bf('0x6'))},'keyContent':{'type':Sequelize[_0x80bf('0x5')]},'idField':{'type':Sequelize[_0x80bf('0x5')]},'variableName':{'type':Sequelize[_0x80bf('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 3ff1fdc..df5ea64 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 _0x2ec9=['then','stack','name','index','SalesforceField','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','filters','pick','filter','where','merge','map','type','VIRTUAL','options','includeAll','findAll','rows','catch','length','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','offset','undefined','count','limit','status','set','json','apply','reject','save','update'];(function(_0x3ab193,_0x51dc97){var _0x285833=function(_0x193e57){while(--_0x193e57){_0x3ab193['push'](_0x3ab193['shift']());}};_0x285833(++_0x51dc97);}(_0x2ec9,0x1e0));var _0x92ec=function(_0x428f80,_0x307620){_0x428f80=_0x428f80-0x0;var _0x2f4273=_0x2ec9[_0x428f80];return _0x2f4273;};'use strict';var emlformat=require(_0x92ec('0x0'));var rimraf=require(_0x92ec('0x1'));var zipdir=require(_0x92ec('0x2'));var jsonpatch=require(_0x92ec('0x3'));var rp=require(_0x92ec('0x4'));var moment=require(_0x92ec('0x5'));var BPromise=require(_0x92ec('0x6'));var Mustache=require(_0x92ec('0x7'));var util=require(_0x92ec('0x8'));var path=require('path');var sox=require(_0x92ec('0x9'));var csv=require('to-csv');var ejs=require(_0x92ec('0xa'));var fs=require('fs');var fs_extra=require(_0x92ec('0xb'));var _=require(_0x92ec('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x92ec('0xd'));var toCsv=require(_0x92ec('0xe'));var querystring=require('querystring');var Papa=require(_0x92ec('0xf'));var Redis=require(_0x92ec('0x10'));var authService=require(_0x92ec('0x11'));var qs=require(_0x92ec('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x92ec('0x13'));var logger=require(_0x92ec('0x14'))(_0x92ec('0x15'));var utils=require(_0x92ec('0x16'));var config=require(_0x92ec('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x92ec('0x18'))['db'];function respondWithStatusCode(_0x49ca08,_0x1f52c5){_0x1f52c5=_0x1f52c5||0xcc;return function(_0x1f1fd4){if(_0x1f1fd4){return _0x49ca08[_0x92ec('0x19')](_0x1f52c5);}return _0x49ca08['status'](_0x1f52c5)[_0x92ec('0x1a')]();};}function respondWithResult(_0x1c2353,_0x5425bc){_0x5425bc=_0x5425bc||0xc8;return function(_0x1ec64e){if(_0x1ec64e){return _0x1c2353['status'](_0x5425bc)['json'](_0x1ec64e);}};}function respondWithFilteredResult(_0x11f6b5,_0xcd7f05){return function(_0x24d050){if(_0x24d050){var _0x30a436=typeof _0xcd7f05[_0x92ec('0x1b')]===_0x92ec('0x1c')&&typeof _0xcd7f05['limit']===_0x92ec('0x1c');var _0x238d22=_0x24d050[_0x92ec('0x1d')];var _0x4315af=_0x30a436?0x0:_0xcd7f05[_0x92ec('0x1b')];var _0x6f97a1=_0x30a436?_0x24d050[_0x92ec('0x1d')]:_0xcd7f05[_0x92ec('0x1b')]+_0xcd7f05[_0x92ec('0x1e')];var _0x5d0fee;if(_0x6f97a1>=_0x238d22){_0x6f97a1=_0x238d22;_0x5d0fee=0xc8;}else{_0x5d0fee=0xce;}_0x11f6b5[_0x92ec('0x1f')](_0x5d0fee);return _0x11f6b5[_0x92ec('0x20')]('Content-Range',_0x4315af+'-'+_0x6f97a1+'/'+_0x238d22)[_0x92ec('0x21')](_0x24d050);}return null;};}function patchUpdates(_0x229c42){return function(_0x1edf9a){try{jsonpatch[_0x92ec('0x22')](_0x1edf9a,_0x229c42,!![]);}catch(_0xfa74b){return BPromise[_0x92ec('0x23')](_0xfa74b);}return _0x1edf9a[_0x92ec('0x24')]();};}function saveUpdates(_0x198a1c,_0x368c15){return function(_0x433097){if(_0x433097){return _0x433097[_0x92ec('0x25')](_0x198a1c)['then'](function(_0x132386){return _0x132386;});}return null;};}function removeEntity(_0x8ad4bd,_0x476b6f){return function(_0x1fc911){if(_0x1fc911){return _0x1fc911['destroy']()[_0x92ec('0x26')](function(){_0x8ad4bd[_0x92ec('0x1f')](0xcc)[_0x92ec('0x1a')]();});}};}function handleEntityNotFound(_0x3b259d,_0x559095){return function(_0x2bfca4){if(!_0x2bfca4){_0x3b259d[_0x92ec('0x19')](0x194);}return _0x2bfca4;};}function handleError(_0x2540f4,_0x4e2979){_0x4e2979=_0x4e2979||0x1f4;return function(_0x5b5648){logger['error'](_0x5b5648[_0x92ec('0x27')]);if(_0x5b5648[_0x92ec('0x28')]){delete _0x5b5648[_0x92ec('0x28')];}_0x2540f4[_0x92ec('0x1f')](_0x4e2979)['send'](_0x5b5648);};}exports[_0x92ec('0x29')]=function(_0x5af3d3,_0x21f9c9){var _0x8ec26b={},_0x3b5c30={},_0x21e443={'count':0x0,'rows':[]};var _0x10045f=_['map'](db[_0x92ec('0x2a')][_0x92ec('0x2b')],function(_0x1de440){return{'name':_0x1de440[_0x92ec('0x2c')],'type':_0x1de440['type'][_0x92ec('0x2d')]};});_0x3b5c30[_0x92ec('0x2e')]=_['map'](_0x10045f,_0x92ec('0x28'));_0x3b5c30[_0x92ec('0x2f')]=_[_0x92ec('0x30')](_0x5af3d3['query']);_0x3b5c30['filters']=_[_0x92ec('0x31')](_0x3b5c30[_0x92ec('0x2e')],_0x3b5c30[_0x92ec('0x2f')]);_0x8ec26b[_0x92ec('0x32')]=_[_0x92ec('0x31')](_0x3b5c30[_0x92ec('0x2e')],qs[_0x92ec('0x33')](_0x5af3d3[_0x92ec('0x2f')][_0x92ec('0x33')]));_0x8ec26b[_0x92ec('0x32')]=_0x8ec26b[_0x92ec('0x32')]['length']?_0x8ec26b['attributes']:_0x3b5c30[_0x92ec('0x2e')];if(!_0x5af3d3['query']['hasOwnProperty'](_0x92ec('0x34'))){_0x8ec26b[_0x92ec('0x1e')]=qs[_0x92ec('0x1e')](_0x5af3d3[_0x92ec('0x2f')][_0x92ec('0x1e')]);_0x8ec26b[_0x92ec('0x1b')]=qs[_0x92ec('0x1b')](_0x5af3d3[_0x92ec('0x2f')]['offset']);}_0x8ec26b[_0x92ec('0x35')]=qs[_0x92ec('0x36')](_0x5af3d3['query'][_0x92ec('0x36')]);_0x8ec26b['where']=qs[_0x92ec('0x37')](_[_0x92ec('0x38')](_0x5af3d3[_0x92ec('0x2f')],_0x3b5c30[_0x92ec('0x37')]),_0x10045f);if(_0x5af3d3['query'][_0x92ec('0x39')]){_0x8ec26b[_0x92ec('0x3a')]=_[_0x92ec('0x3b')](_0x8ec26b[_0x92ec('0x3a')],{'$or':_[_0x92ec('0x3c')](_0x10045f,function(_0x124d63){if(_0x124d63[_0x92ec('0x3d')]!==_0x92ec('0x3e')){var _0x17c493={};_0x17c493[_0x124d63[_0x92ec('0x28')]]={'$like':'%'+_0x5af3d3[_0x92ec('0x2f')]['filter']+'%'};return _0x17c493;}})});}_0x8ec26b=_['merge']({},_0x8ec26b,_0x5af3d3[_0x92ec('0x3f')]);var _0x9d239f={'where':_0x8ec26b['where']};return db[_0x92ec('0x2a')][_0x92ec('0x1d')](_0x9d239f)[_0x92ec('0x26')](function(_0x5afd07){_0x21e443[_0x92ec('0x1d')]=_0x5afd07;if(_0x5af3d3[_0x92ec('0x2f')][_0x92ec('0x40')]){_0x8ec26b['include']=[{'all':!![]}];}return db[_0x92ec('0x2a')][_0x92ec('0x41')](_0x8ec26b);})['then'](function(_0x1fc7b8){_0x21e443[_0x92ec('0x42')]=_0x1fc7b8;return _0x21e443;})[_0x92ec('0x26')](respondWithFilteredResult(_0x21f9c9,_0x8ec26b))[_0x92ec('0x43')](handleError(_0x21f9c9,null));};exports['show']=function(_0x46ce7e,_0x512365){var _0x643229={'raw':!![],'where':{'id':_0x46ce7e['params']['id']}},_0x31726b={};_0x31726b[_0x92ec('0x2e')]=_['keys'](db[_0x92ec('0x2a')][_0x92ec('0x2b')]);_0x31726b['query']=_[_0x92ec('0x30')](_0x46ce7e['query']);_0x31726b[_0x92ec('0x37')]=_[_0x92ec('0x31')](_0x31726b['model'],_0x31726b[_0x92ec('0x2f')]);_0x643229['attributes']=_[_0x92ec('0x31')](_0x31726b['model'],qs[_0x92ec('0x33')](_0x46ce7e[_0x92ec('0x2f')][_0x92ec('0x33')]));_0x643229['attributes']=_0x643229[_0x92ec('0x32')][_0x92ec('0x44')]?_0x643229[_0x92ec('0x32')]:_0x31726b[_0x92ec('0x2e')];if(_0x46ce7e[_0x92ec('0x2f')]['includeAll']){_0x643229['include']=[{'all':!![]}];}_0x643229=_[_0x92ec('0x3b')]({},_0x643229,_0x46ce7e[_0x92ec('0x3f')]);return db[_0x92ec('0x2a')][_0x92ec('0x45')](_0x643229)[_0x92ec('0x26')](handleEntityNotFound(_0x512365,null))[_0x92ec('0x26')](respondWithResult(_0x512365,null))[_0x92ec('0x43')](handleError(_0x512365,null));};exports[_0x92ec('0x46')]=function(_0x921971,_0x3607b0){return db[_0x92ec('0x2a')]['create'](_0x921971[_0x92ec('0x47')],{})[_0x92ec('0x26')](respondWithResult(_0x3607b0,0xc9))['catch'](handleError(_0x3607b0,null));};exports[_0x92ec('0x25')]=function(_0x8c6d7b,_0x3b48cf){if(_0x8c6d7b[_0x92ec('0x47')]['id']){delete _0x8c6d7b[_0x92ec('0x47')]['id'];}return db[_0x92ec('0x2a')][_0x92ec('0x45')]({'where':{'id':_0x8c6d7b[_0x92ec('0x48')]['id']}})[_0x92ec('0x26')](handleEntityNotFound(_0x3b48cf,null))[_0x92ec('0x26')](saveUpdates(_0x8c6d7b['body'],null))[_0x92ec('0x26')](respondWithResult(_0x3b48cf,null))[_0x92ec('0x43')](handleError(_0x3b48cf,null));};exports[_0x92ec('0x49')]=function(_0x4457e9,_0x5cf811){return db['SalesforceField'][_0x92ec('0x45')]({'where':{'id':_0x4457e9[_0x92ec('0x48')]['id']}})[_0x92ec('0x26')](handleEntityNotFound(_0x5cf811,null))[_0x92ec('0x26')](removeEntity(_0x5cf811,null))[_0x92ec('0x43')](handleError(_0x5cf811,null));}; \ No newline at end of file +var _0x7b39=['fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','stack','name','index','map','SalesforceField','rawAttributes'];(function(_0x359f73,_0x3e91f7){var _0x57fcc6=function(_0x29783e){while(--_0x29783e){_0x359f73['push'](_0x359f73['shift']());}};_0x57fcc6(++_0x3e91f7);}(_0x7b39,0xaa));var _0x97b3=function(_0x15f236,_0x59a12b){_0x15f236=_0x15f236-0x0;var _0x3645c0=_0x7b39[_0x15f236];return _0x3645c0;};'use strict';var emlformat=require(_0x97b3('0x0'));var rimraf=require(_0x97b3('0x1'));var zipdir=require(_0x97b3('0x2'));var jsonpatch=require(_0x97b3('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x97b3('0x4'));var Mustache=require(_0x97b3('0x5'));var util=require('util');var path=require(_0x97b3('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x97b3('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x97b3('0x8'));var squel=require(_0x97b3('0x9'));var crypto=require('crypto');var jsforce=require(_0x97b3('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x97b3('0xb'));var querystring=require(_0x97b3('0xc'));var Papa=require(_0x97b3('0xd'));var Redis=require(_0x97b3('0xe'));var authService=require(_0x97b3('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x97b3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x97b3('0x11'))(_0x97b3('0x12'));var utils=require(_0x97b3('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x97b3('0x14'));var db=require(_0x97b3('0x15'))['db'];function respondWithStatusCode(_0x317c9b,_0x382bca){_0x382bca=_0x382bca||0xcc;return function(_0xa59b0e){if(_0xa59b0e){return _0x317c9b[_0x97b3('0x16')](_0x382bca);}return _0x317c9b[_0x97b3('0x17')](_0x382bca)[_0x97b3('0x18')]();};}function respondWithResult(_0x850b9a,_0x78cf74){_0x78cf74=_0x78cf74||0xc8;return function(_0x339252){if(_0x339252){return _0x850b9a[_0x97b3('0x17')](_0x78cf74)[_0x97b3('0x19')](_0x339252);}};}function respondWithFilteredResult(_0x2ce13f,_0x21abc3){return function(_0x18dbff){if(_0x18dbff){var _0x5f293b=typeof _0x21abc3['offset']===_0x97b3('0x1a')&&typeof _0x21abc3[_0x97b3('0x1b')]===_0x97b3('0x1a');var _0x190ba7=_0x18dbff[_0x97b3('0x1c')];var _0x4a7fda=_0x5f293b?0x0:_0x21abc3[_0x97b3('0x1d')];var _0x38a4ec=_0x5f293b?_0x18dbff[_0x97b3('0x1c')]:_0x21abc3[_0x97b3('0x1d')]+_0x21abc3[_0x97b3('0x1b')];var _0x7bd85f;if(_0x38a4ec>=_0x190ba7){_0x38a4ec=_0x190ba7;_0x7bd85f=0xc8;}else{_0x7bd85f=0xce;}_0x2ce13f['status'](_0x7bd85f);return _0x2ce13f[_0x97b3('0x1e')]('Content-Range',_0x4a7fda+'-'+_0x38a4ec+'/'+_0x190ba7)[_0x97b3('0x19')](_0x18dbff);}return null;};}function patchUpdates(_0x4d9338){return function(_0x41c88c){try{jsonpatch[_0x97b3('0x1f')](_0x41c88c,_0x4d9338,!![]);}catch(_0x5e0353){return BPromise[_0x97b3('0x20')](_0x5e0353);}return _0x41c88c[_0x97b3('0x21')]();};}function saveUpdates(_0x550b27,_0x345cdb){return function(_0x423d79){if(_0x423d79){return _0x423d79[_0x97b3('0x22')](_0x550b27)[_0x97b3('0x23')](function(_0x47ad4e){return _0x47ad4e;});}return null;};}function removeEntity(_0x19941f,_0x538df8){return function(_0x2afd66){if(_0x2afd66){return _0x2afd66[_0x97b3('0x24')]()['then'](function(){_0x19941f[_0x97b3('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x168dc9,_0x3ad327){return function(_0x1a19bb){if(!_0x1a19bb){_0x168dc9[_0x97b3('0x16')](0x194);}return _0x1a19bb;};}function handleError(_0x18ec1d,_0x24183a){_0x24183a=_0x24183a||0x1f4;return function(_0x39e279){logger['error'](_0x39e279[_0x97b3('0x25')]);if(_0x39e279[_0x97b3('0x26')]){delete _0x39e279['name'];}_0x18ec1d[_0x97b3('0x17')](_0x24183a)['send'](_0x39e279);};}exports[_0x97b3('0x27')]=function(_0x57b750,_0x283054){var _0x158f08={},_0xa026b5={},_0x2c1a49={'count':0x0,'rows':[]};var _0x1ee330=_[_0x97b3('0x28')](db[_0x97b3('0x29')][_0x97b3('0x2a')],function(_0x55dc88){return{'name':_0x55dc88[_0x97b3('0x2b')],'type':_0x55dc88[_0x97b3('0x2c')][_0x97b3('0x2d')]};});_0xa026b5[_0x97b3('0x2e')]=_[_0x97b3('0x28')](_0x1ee330,_0x97b3('0x26'));_0xa026b5[_0x97b3('0x2f')]=_[_0x97b3('0x30')](_0x57b750[_0x97b3('0x2f')]);_0xa026b5[_0x97b3('0x31')]=_[_0x97b3('0x32')](_0xa026b5['model'],_0xa026b5[_0x97b3('0x2f')]);_0x158f08[_0x97b3('0x33')]=_['intersection'](_0xa026b5['model'],qs[_0x97b3('0x34')](_0x57b750[_0x97b3('0x2f')][_0x97b3('0x34')]));_0x158f08['attributes']=_0x158f08['attributes'][_0x97b3('0x35')]?_0x158f08['attributes']:_0xa026b5[_0x97b3('0x2e')];if(!_0x57b750['query'][_0x97b3('0x36')](_0x97b3('0x37'))){_0x158f08['limit']=qs['limit'](_0x57b750['query']['limit']);_0x158f08[_0x97b3('0x1d')]=qs[_0x97b3('0x1d')](_0x57b750[_0x97b3('0x2f')][_0x97b3('0x1d')]);}_0x158f08[_0x97b3('0x38')]=qs['sort'](_0x57b750[_0x97b3('0x2f')]['sort']);_0x158f08[_0x97b3('0x39')]=qs[_0x97b3('0x31')](_['pick'](_0x57b750[_0x97b3('0x2f')],_0xa026b5[_0x97b3('0x31')]),_0x1ee330);if(_0x57b750[_0x97b3('0x2f')]['filter']){_0x158f08[_0x97b3('0x39')]=_[_0x97b3('0x3a')](_0x158f08[_0x97b3('0x39')],{'$or':_[_0x97b3('0x28')](_0x1ee330,function(_0x43749b){if(_0x43749b['type']!==_0x97b3('0x3b')){var _0x1f6294={};_0x1f6294[_0x43749b[_0x97b3('0x26')]]={'$like':'%'+_0x57b750[_0x97b3('0x2f')]['filter']+'%'};return _0x1f6294;}})});}_0x158f08=_['merge']({},_0x158f08,_0x57b750['options']);var _0x3e1805={'where':_0x158f08[_0x97b3('0x39')]};return db['SalesforceField'][_0x97b3('0x1c')](_0x3e1805)[_0x97b3('0x23')](function(_0x2750ac){_0x2c1a49[_0x97b3('0x1c')]=_0x2750ac;if(_0x57b750[_0x97b3('0x2f')][_0x97b3('0x3c')]){_0x158f08[_0x97b3('0x3d')]=[{'all':!![]}];}return db[_0x97b3('0x29')][_0x97b3('0x3e')](_0x158f08);})['then'](function(_0x2f68b4){_0x2c1a49[_0x97b3('0x3f')]=_0x2f68b4;return _0x2c1a49;})[_0x97b3('0x23')](respondWithFilteredResult(_0x283054,_0x158f08))['catch'](handleError(_0x283054,null));};exports[_0x97b3('0x40')]=function(_0x31d0e2,_0x24e1df){var _0x37f274={'raw':!![],'where':{'id':_0x31d0e2[_0x97b3('0x41')]['id']}},_0x3074fa={};_0x3074fa['model']=_[_0x97b3('0x30')](db[_0x97b3('0x29')]['rawAttributes']);_0x3074fa[_0x97b3('0x2f')]=_[_0x97b3('0x30')](_0x31d0e2['query']);_0x3074fa['filters']=_[_0x97b3('0x32')](_0x3074fa[_0x97b3('0x2e')],_0x3074fa['query']);_0x37f274[_0x97b3('0x33')]=_[_0x97b3('0x32')](_0x3074fa[_0x97b3('0x2e')],qs['fields'](_0x31d0e2[_0x97b3('0x2f')][_0x97b3('0x34')]));_0x37f274[_0x97b3('0x33')]=_0x37f274[_0x97b3('0x33')][_0x97b3('0x35')]?_0x37f274[_0x97b3('0x33')]:_0x3074fa[_0x97b3('0x2e')];if(_0x31d0e2[_0x97b3('0x2f')][_0x97b3('0x3c')]){_0x37f274[_0x97b3('0x3d')]=[{'all':!![]}];}_0x37f274=_[_0x97b3('0x3a')]({},_0x37f274,_0x31d0e2[_0x97b3('0x42')]);return db[_0x97b3('0x29')][_0x97b3('0x43')](_0x37f274)[_0x97b3('0x23')](handleEntityNotFound(_0x24e1df,null))[_0x97b3('0x23')](respondWithResult(_0x24e1df,null))[_0x97b3('0x44')](handleError(_0x24e1df,null));};exports[_0x97b3('0x45')]=function(_0x4ad0bb,_0x4f630b){return db[_0x97b3('0x29')]['create'](_0x4ad0bb[_0x97b3('0x46')],{})[_0x97b3('0x23')](respondWithResult(_0x4f630b,0xc9))[_0x97b3('0x44')](handleError(_0x4f630b,null));};exports[_0x97b3('0x22')]=function(_0x5232c3,_0x375073){if(_0x5232c3[_0x97b3('0x46')]['id']){delete _0x5232c3[_0x97b3('0x46')]['id'];}return db[_0x97b3('0x29')]['find']({'where':{'id':_0x5232c3[_0x97b3('0x41')]['id']}})[_0x97b3('0x23')](handleEntityNotFound(_0x375073,null))[_0x97b3('0x23')](saveUpdates(_0x5232c3['body'],null))['then'](respondWithResult(_0x375073,null))[_0x97b3('0x44')](handleError(_0x375073,null));};exports[_0x97b3('0x24')]=function(_0x2a6913,_0x4d3ee6){return db['SalesforceField'][_0x97b3('0x43')]({'where':{'id':_0x2a6913[_0x97b3('0x41')]['id']}})['then'](handleEntityNotFound(_0x4d3ee6,null))['then'](removeEntity(_0x4d3ee6,null))[_0x97b3('0x44')](handleError(_0x4d3ee6,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 9738da2..1469e7c 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 _0x6791=['path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','int_salesforce_fields','idField','FieldId','lodash','../../config/logger','api','moment','bluebird'];(function(_0x20598e,_0x559fa9){var _0x484c79=function(_0x286be0){while(--_0x286be0){_0x20598e['push'](_0x20598e['shift']());}};_0x484c79(++_0x559fa9);}(_0x6791,0xcd));var _0x1679=function(_0x205655,_0x575792){_0x205655=_0x205655-0x0;var _0x23be40=_0x6791[_0x205655];return _0x23be40;};'use strict';var _=require(_0x1679('0x0'));var util=require('util');var logger=require(_0x1679('0x1'))(_0x1679('0x2'));var moment=require(_0x1679('0x3'));var BPromise=require(_0x1679('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1679('0x5'));var rimraf=require(_0x1679('0x6'));var config=require(_0x1679('0x7'));var attributes=require(_0x1679('0x8'));module[_0x1679('0x9')]=function(_0x3d4bd3,_0x1e4dca){return _0x3d4bd3[_0x1679('0xa')]('SalesforceField',attributes,{'tableName':_0x1679('0xb'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x1679('0xc'),_0x1679('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2f2f=['define','int_salesforce_fields','salesforce_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceField.attributes','exports'];(function(_0x539bde,_0x14b7db){var _0x1718d4=function(_0x1d35e0){while(--_0x1d35e0){_0x539bde['push'](_0x539bde['shift']());}};_0x1718d4(++_0x14b7db);}(_0x2f2f,0x66));var _0xf2f2=function(_0x454e4e,_0x5abc05){_0x454e4e=_0x454e4e-0x0;var _0x22a5f7=_0x2f2f[_0x454e4e];return _0x22a5f7;};'use strict';var _=require(_0xf2f2('0x0'));var util=require(_0xf2f2('0x1'));var logger=require(_0xf2f2('0x2'))(_0xf2f2('0x3'));var moment=require('moment');var BPromise=require(_0xf2f2('0x4'));var rp=require(_0xf2f2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf2f2('0x6'));var config=require(_0xf2f2('0x7'));var attributes=require(_0xf2f2('0x8'));module[_0xf2f2('0x9')]=function(_0x5e01b1,_0xe98d21){return _0x5e01b1[_0xf2f2('0xa')]('SalesforceField',attributes,{'tableName':_0xf2f2('0xb'),'paranoid':![],'indexes':[{'name':_0xf2f2('0xc'),'fields':[_0xf2f2('0xd'),'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 51bb4ff..1cc0746 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 _0x7250=['code','message','SalesforceField,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','client','http','then','info','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xdd670d,_0x43f804){var _0x52f7db=function(_0x4c2b3d){while(--_0x4c2b3d){_0xdd670d['push'](_0xdd670d['shift']());}};_0x52f7db(++_0x43f804);}(_0x7250,0xcb));var _0x0725=function(_0x5994aa,_0x5bde6b){_0x5994aa=_0x5994aa-0x0;var _0x5da7c4=_0x7250[_0x5994aa];return _0x5da7c4;};'use strict';var _=require(_0x0725('0x0'));var util=require(_0x0725('0x1'));var moment=require(_0x0725('0x2'));var BPromise=require(_0x0725('0x3'));var rs=require(_0x0725('0x4'));var fs=require('fs');var Redis=require(_0x0725('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0725('0x6'));var logger=require('../../config/logger')(_0x0725('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0725('0x8')][_0x0725('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d0e96,_0x4724ac,_0x58f689){return new BPromise(function(_0x4dba4b,_0x2d6e1a){return client['request'](_0x1d0e96,_0x58f689)[_0x0725('0xa')](function(_0x2d3d49){logger[_0x0725('0xb')]('SalesforceField,\x20%s,\x20%s',_0x4724ac,'request\x20sent');logger[_0x0725('0xc')](_0x0725('0xd'),_0x4724ac,_0x0725('0xe'),JSON[_0x0725('0xf')](_0x2d3d49));if(_0x2d3d49[_0x0725('0x10')]){if(_0x2d3d49[_0x0725('0x10')][_0x0725('0x11')]===0x1f4){logger[_0x0725('0x10')]('SalesforceField,\x20%s,\x20%s',_0x4724ac,_0x2d3d49[_0x0725('0x10')]['message']);return _0x2d6e1a(_0x2d3d49[_0x0725('0x10')][_0x0725('0x12')]);}logger[_0x0725('0x10')]('SalesforceField,\x20%s,\x20%s',_0x4724ac,_0x2d3d49['error'][_0x0725('0x12')]);return _0x4dba4b(_0x2d3d49[_0x0725('0x10')][_0x0725('0x12')]);}else{logger[_0x0725('0xb')](_0x0725('0x13'),_0x4724ac,_0x0725('0xe'));_0x4dba4b(_0x2d3d49[_0x0725('0x14')][_0x0725('0x12')]);}})[_0x0725('0x15')](function(_0x4e4f87){logger[_0x0725('0x10')](_0x0725('0x13'),_0x4724ac,_0x4e4f87);_0x2d6e1a(_0x4e4f87);});});} \ No newline at end of file +var _0x842f=['request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','SalesforceField,\x20%s,\x20%s,\x20%s'];(function(_0x2d7314,_0x21f24d){var _0x349b1a=function(_0x23e318){while(--_0x23e318){_0x2d7314['push'](_0x2d7314['shift']());}};_0x349b1a(++_0x21f24d);}(_0x842f,0x10e));var _0xf842=function(_0x4e7012,_0x5d5f73){_0x4e7012=_0x4e7012-0x0;var _0xcd56d5=_0x842f[_0x4e7012];return _0xcd56d5;};'use strict';var _=require('lodash');var util=require(_0xf842('0x0'));var moment=require(_0xf842('0x1'));var BPromise=require(_0xf842('0x2'));var rs=require(_0xf842('0x3'));var fs=require('fs');var Redis=require(_0xf842('0x4'));var db=require(_0xf842('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf842('0x6'))(_0xf842('0x7'));var config=require(_0xf842('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf842('0x9')][_0xf842('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20deb6,_0x558a59,_0x238056){return new BPromise(function(_0x2dd487,_0x4df90a){return client[_0xf842('0xb')](_0x20deb6,_0x238056)[_0xf842('0xc')](function(_0x3ea153){logger[_0xf842('0xd')](_0xf842('0xe'),_0x558a59,'request\x20sent');logger['debug'](_0xf842('0xf'),_0x558a59,_0xf842('0x10'),JSON[_0xf842('0x11')](_0x3ea153));if(_0x3ea153[_0xf842('0x12')]){if(_0x3ea153[_0xf842('0x12')]['code']===0x1f4){logger['error'](_0xf842('0xe'),_0x558a59,_0x3ea153[_0xf842('0x12')][_0xf842('0x13')]);return _0x4df90a(_0x3ea153[_0xf842('0x12')][_0xf842('0x13')]);}logger['error'](_0xf842('0xe'),_0x558a59,_0x3ea153[_0xf842('0x12')]['message']);return _0x2dd487(_0x3ea153[_0xf842('0x12')][_0xf842('0x13')]);}else{logger[_0xf842('0xd')](_0xf842('0xe'),_0x558a59,'request\x20sent');_0x2dd487(_0x3ea153[_0xf842('0x14')][_0xf842('0x13')]);}})[_0xf842('0x15')](function(_0x966042){logger[_0xf842('0x12')](_0xf842('0xe'),_0x558a59,_0x966042);_0x4df90a(_0x966042);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 02bf266..1439184 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 _0x1599=['util','connect-timeout','Router','../../components/auth/service','./intServicenowAccount.controller','get','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','update','delete','exports','multer'];(function(_0x303ecc,_0x953d55){var _0x4c1201=function(_0x393abb){while(--_0x393abb){_0x303ecc['push'](_0x303ecc['shift']());}};_0x4c1201(++_0x953d55);}(_0x1599,0xaa));var _0x9159=function(_0x2fb794,_0x35e74d){_0x2fb794=_0x2fb794-0x0;var _0x3d6fe1=_0x1599[_0x2fb794];return _0x3d6fe1;};'use strict';var multer=require(_0x9159('0x0'));var util=require(_0x9159('0x1'));var path=require('path');var timeout=require(_0x9159('0x2'));var express=require('express');var router=express[_0x9159('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9159('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9159('0x5'));router[_0x9159('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x9159('0x7'),auth[_0x9159('0x8')](),controller[_0x9159('0x9')]);router[_0x9159('0x6')]('/:id/configurations',auth[_0x9159('0x8')](),controller[_0x9159('0xa')]);router[_0x9159('0x6')](_0x9159('0xb'),auth['isAuthenticated'](),controller[_0x9159('0xc')]);router[_0x9159('0xd')]('/',auth['isAuthenticated'](),controller[_0x9159('0xe')]);router[_0x9159('0xd')](_0x9159('0xf'),auth['isAuthenticated'](),controller['addConfiguration']);router['put']('/:id',auth[_0x9159('0x8')](),controller[_0x9159('0x10')]);router[_0x9159('0x11')](_0x9159('0x7'),auth[_0x9159('0x8')](),controller['destroy']);module[_0x9159('0x12')]=router; \ No newline at end of file +var _0xd3d1=['./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd3d1,0x172));var _0x1d3d=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xd3d1[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1d3d('0x2'));var router=express[_0x1d3d('0x3')]();var fs_extra=require(_0x1d3d('0x4'));var auth=require(_0x1d3d('0x5'));var interaction=require(_0x1d3d('0x6'));var config=require(_0x1d3d('0x7'));var controller=require(_0x1d3d('0x8'));router[_0x1d3d('0x9')]('/',auth[_0x1d3d('0xa')](),controller[_0x1d3d('0xb')]);router[_0x1d3d('0x9')](_0x1d3d('0xc'),auth[_0x1d3d('0xa')](),controller[_0x1d3d('0xd')]);router[_0x1d3d('0x9')](_0x1d3d('0xe'),auth[_0x1d3d('0xa')](),controller['getConfigurations']);router[_0x1d3d('0x9')](_0x1d3d('0xf'),auth[_0x1d3d('0xa')](),controller[_0x1d3d('0x10')]);router[_0x1d3d('0x11')]('/',auth[_0x1d3d('0xa')](),controller[_0x1d3d('0x12')]);router[_0x1d3d('0x11')](_0x1d3d('0xe'),auth[_0x1d3d('0xa')](),controller[_0x1d3d('0x13')]);router['put'](_0x1d3d('0xc'),auth[_0x1d3d('0xa')](),controller['update']);router['delete'](_0x1d3d('0xc'),auth[_0x1d3d('0xa')](),controller[_0x1d3d('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 498ec55..fbf7371 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 _0xec2e=['remoteUri','sequelize','exports','STRING','username'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xec2e,0xf1));var _0xeec2=function(_0x2052dd,_0x617a93){_0x2052dd=_0x2052dd-0x0;var _0x2873e9=_0xec2e[_0x2052dd];return _0x2873e9;};'use strict';var Sequelize=require(_0xeec2('0x0'));module[_0xeec2('0x1')]={'name':{'type':Sequelize[_0xeec2('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xeec2('0x2')],'unique':_0xeec2('0x3')},'password':{'type':Sequelize[_0xeec2('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xeec2('0x2')],'unique':_0xeec2('0x4')},'serverUrl':{'type':Sequelize[_0xeec2('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x7322=['STRING','username','remoteUri','sequelize','exports'];(function(_0x25b870,_0x1291a5){var _0x5f7597=function(_0x48206c){while(--_0x48206c){_0x25b870['push'](_0x25b870['shift']());}};_0x5f7597(++_0x1291a5);}(_0x7322,0x12f));var _0x2732=function(_0x3f4f3b,_0x2d7be2){_0x3f4f3b=_0x3f4f3b-0x0;var _0xfc6f02=_0x7322[_0x3f4f3b];return _0xfc6f02;};'use strict';var Sequelize=require(_0x2732('0x0'));module[_0x2732('0x1')]={'name':{'type':Sequelize[_0x2732('0x2')]},'description':{'type':Sequelize[_0x2732('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x2732('0x3')},'password':{'type':Sequelize[_0x2732('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2732('0x2')],'unique':_0x2732('0x4')},'serverUrl':{'type':Sequelize[_0x2732('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 51824cf..9644f4d 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 _0xc880=['Descriptions','getDescriptions','ServicenowField','getFields','made_sla','knowledge','subcategory','close_code','incident_state','severity','category','parent','sys_updated_on','hold_reason','resolved_by','sys_updated_by','opened_by','user_input','sys_domain','sys_created_by','calendar_stc','closed_at','cmdb_ci','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','group_list','caller_id','approval_set','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','description','calendar_duration','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','urgency','company','reassignment_count','activity_due','comments','sla_due','approval','comments_and_work_notes','reopen_count','sys_tags','escalation','correlation_id','username','password','email','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/table/','GET','result','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','push','all','log','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','concat','test','statusCode','Wrong\x20credentials','boolean','True','False','false','inactive','value','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','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','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','merge','where','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','create','body','destroy','findOne','ServicenowConfiguration','getConfigurations','AccountId','Subjects','getSubjects','channel'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc880,0x1bc));var _0x0c88=function(_0x3983ef,_0x5365ee){_0x3983ef=_0x3983ef-0x0;var _0x190f3c=_0xc880[_0x3983ef];return _0x190f3c;};'use strict';var emlformat=require(_0x0c88('0x0'));var rimraf=require(_0x0c88('0x1'));var zipdir=require(_0x0c88('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0c88('0x3'));var moment=require('moment');var BPromise=require(_0x0c88('0x4'));var Mustache=require(_0x0c88('0x5'));var util=require('util');var path=require('path');var sox=require(_0x0c88('0x6'));var csv=require(_0x0c88('0x7'));var ejs=require(_0x0c88('0x8'));var fs=require('fs');var fs_extra=require(_0x0c88('0x9'));var _=require(_0x0c88('0xa'));var squel=require(_0x0c88('0xb'));var crypto=require(_0x0c88('0xc'));var jsforce=require(_0x0c88('0xd'));var deskjs=require(_0x0c88('0xe'));var toCsv=require(_0x0c88('0x7'));var querystring=require('querystring');var Papa=require(_0x0c88('0xf'));var Redis=require(_0x0c88('0x10'));var authService=require(_0x0c88('0x11'));var qs=require(_0x0c88('0x12'));var as=require(_0x0c88('0x13'));var hardwareService=require(_0x0c88('0x14'));var logger=require(_0x0c88('0x15'))(_0x0c88('0x16'));var utils=require('../../config/utils');var config=require(_0x0c88('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5bd9de,_0x374cd1){_0x374cd1=_0x374cd1||0xcc;return function(_0x24efba){if(_0x24efba){return _0x5bd9de[_0x0c88('0x18')](_0x374cd1);}return _0x5bd9de[_0x0c88('0x19')](_0x374cd1)[_0x0c88('0x1a')]();};}function respondWithResult(_0x566f64,_0x461e13){_0x461e13=_0x461e13||0xc8;return function(_0x1a683d){if(_0x1a683d){return _0x566f64[_0x0c88('0x19')](_0x461e13)[_0x0c88('0x1b')](_0x1a683d);}};}function respondWithFilteredResult(_0x580e6d,_0x22ee59){return function(_0x22c268){if(_0x22c268){var _0x492db6=typeof _0x22ee59[_0x0c88('0x1c')]===_0x0c88('0x1d')&&typeof _0x22ee59[_0x0c88('0x1e')]===_0x0c88('0x1d');var _0x40637e=_0x22c268[_0x0c88('0x1f')];var _0xc5586a=_0x492db6?0x0:_0x22ee59[_0x0c88('0x1c')];var _0xb34423=_0x492db6?_0x22c268['count']:_0x22ee59[_0x0c88('0x1c')]+_0x22ee59[_0x0c88('0x1e')];var _0x5ca168;if(_0xb34423>=_0x40637e){_0xb34423=_0x40637e;_0x5ca168=0xc8;}else{_0x5ca168=0xce;}_0x580e6d[_0x0c88('0x19')](_0x5ca168);return _0x580e6d['set'](_0x0c88('0x20'),_0xc5586a+'-'+_0xb34423+'/'+_0x40637e)['json'](_0x22c268);}return null;};}function patchUpdates(_0x4724ee){return function(_0xd5049c){try{jsonpatch['apply'](_0xd5049c,_0x4724ee,!![]);}catch(_0x4345b6){return BPromise['reject'](_0x4345b6);}return _0xd5049c[_0x0c88('0x21')]();};}function saveUpdates(_0x53bac8,_0x14d5fc){return function(_0x1cf315){if(_0x1cf315){return _0x1cf315[_0x0c88('0x22')](_0x53bac8)['then'](function(_0x21030e){return _0x21030e;});}return null;};}function removeEntity(_0x59fdbf,_0x53ca15){return function(_0x1d9af3){if(_0x1d9af3){return _0x1d9af3['destroy']()[_0x0c88('0x23')](function(){_0x59fdbf[_0x0c88('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1da49e,_0x19f148){return function(_0x51afa6){if(!_0x51afa6){_0x1da49e[_0x0c88('0x18')](0x194);}return _0x51afa6;};}function handleError(_0x4bf7cd,_0x274e7a){_0x274e7a=_0x274e7a||0x1f4;return function(_0x4db24c){logger[_0x0c88('0x24')](_0x4db24c[_0x0c88('0x25')]);if(_0x4db24c[_0x0c88('0x26')]){delete _0x4db24c[_0x0c88('0x26')];}_0x4bf7cd[_0x0c88('0x19')](_0x274e7a)[_0x0c88('0x27')](_0x4db24c);};}exports[_0x0c88('0x28')]=function(_0x1776fc,_0x4ceaaf){var _0x2fffbd={},_0x476cc5={},_0x104a33={'count':0x0,'rows':[]};var _0x5a13c3=_[_0x0c88('0x29')](db[_0x0c88('0x2a')][_0x0c88('0x2b')],function(_0x4d5a8c){return{'name':_0x4d5a8c['fieldName'],'type':_0x4d5a8c['type'][_0x0c88('0x2c')]};});_0x476cc5[_0x0c88('0x2d')]=_[_0x0c88('0x29')](_0x5a13c3,_0x0c88('0x26'));_0x476cc5[_0x0c88('0x2e')]=_[_0x0c88('0x2f')](_0x1776fc['query']);_0x476cc5['filters']=_['intersection'](_0x476cc5['model'],_0x476cc5[_0x0c88('0x2e')]);_0x2fffbd[_0x0c88('0x30')]=_[_0x0c88('0x31')](_0x476cc5['model'],qs[_0x0c88('0x32')](_0x1776fc[_0x0c88('0x2e')][_0x0c88('0x32')]));_0x2fffbd[_0x0c88('0x30')]=_0x2fffbd[_0x0c88('0x30')][_0x0c88('0x33')]?_0x2fffbd['attributes']:_0x476cc5['model'];if(!_0x1776fc[_0x0c88('0x2e')][_0x0c88('0x34')](_0x0c88('0x35'))){_0x2fffbd[_0x0c88('0x1e')]=qs[_0x0c88('0x1e')](_0x1776fc['query']['limit']);_0x2fffbd['offset']=qs[_0x0c88('0x1c')](_0x1776fc[_0x0c88('0x2e')]['offset']);}_0x2fffbd[_0x0c88('0x36')]=qs[_0x0c88('0x37')](_0x1776fc[_0x0c88('0x2e')]['sort']);_0x2fffbd['where']=qs['filters'](_[_0x0c88('0x38')](_0x1776fc[_0x0c88('0x2e')],_0x476cc5[_0x0c88('0x39')]),_0x5a13c3);if(_0x1776fc[_0x0c88('0x2e')][_0x0c88('0x3a')]){_0x2fffbd['where']=_[_0x0c88('0x3b')](_0x2fffbd[_0x0c88('0x3c')],{'$or':_['map'](_0x5a13c3,function(_0x5cc627){if(_0x5cc627[_0x0c88('0x3d')]!==_0x0c88('0x3e')){var _0x3a3548={};_0x3a3548[_0x5cc627['name']]={'$like':'%'+_0x1776fc[_0x0c88('0x2e')]['filter']+'%'};return _0x3a3548;}})});}_0x2fffbd=_[_0x0c88('0x3b')]({},_0x2fffbd,_0x1776fc[_0x0c88('0x3f')]);var _0x5c258f={'where':_0x2fffbd[_0x0c88('0x3c')]};return db['ServicenowAccount']['count'](_0x5c258f)['then'](function(_0x489fa0){_0x104a33[_0x0c88('0x1f')]=_0x489fa0;if(_0x1776fc['query'][_0x0c88('0x40')]){_0x2fffbd['include']=[{'all':!![]}];}return db['ServicenowAccount'][_0x0c88('0x41')](_0x2fffbd);})[_0x0c88('0x23')](function(_0x99f8ac){_0x104a33[_0x0c88('0x42')]=_0x99f8ac;return _0x104a33;})[_0x0c88('0x23')](respondWithFilteredResult(_0x4ceaaf,_0x2fffbd))[_0x0c88('0x43')](handleError(_0x4ceaaf,null));};exports[_0x0c88('0x44')]=function(_0x1ce972,_0x56eacf){var _0x16626b={'raw':![],'where':{'id':_0x1ce972[_0x0c88('0x45')]['id']}},_0xc791aa={};_0xc791aa[_0x0c88('0x2d')]=_[_0x0c88('0x2f')](db['ServicenowAccount'][_0x0c88('0x2b')]);_0xc791aa[_0x0c88('0x2e')]=_[_0x0c88('0x2f')](_0x1ce972['query']);_0xc791aa['filters']=_[_0x0c88('0x31')](_0xc791aa['model'],_0xc791aa[_0x0c88('0x2e')]);_0x16626b['attributes']=_['intersection'](_0xc791aa[_0x0c88('0x2d')],qs['fields'](_0x1ce972[_0x0c88('0x2e')][_0x0c88('0x32')]));_0x16626b['attributes']=_0x16626b[_0x0c88('0x30')][_0x0c88('0x33')]?_0x16626b[_0x0c88('0x30')]:_0xc791aa[_0x0c88('0x2d')];if(_0x1ce972[_0x0c88('0x2e')][_0x0c88('0x40')]){_0x16626b['include']=[{'all':!![]}];}_0x16626b=_[_0x0c88('0x3b')]({},_0x16626b,_0x1ce972[_0x0c88('0x3f')]);return db[_0x0c88('0x2a')][_0x0c88('0x46')](_0x16626b)[_0x0c88('0x23')](handleEntityNotFound(_0x56eacf,null))[_0x0c88('0x23')](respondWithResult(_0x56eacf,null))[_0x0c88('0x43')](handleError(_0x56eacf,null));};exports[_0x0c88('0x47')]=function(_0x142bac,_0x591c22){return db[_0x0c88('0x2a')][_0x0c88('0x47')](_0x142bac['body'],{})[_0x0c88('0x23')](respondWithResult(_0x591c22,0xc9))['catch'](handleError(_0x591c22,null));};exports[_0x0c88('0x22')]=function(_0x545001,_0x3d9ff7){if(_0x545001[_0x0c88('0x48')]['id']){delete _0x545001['body']['id'];}return db[_0x0c88('0x2a')][_0x0c88('0x46')]({'where':{'id':_0x545001[_0x0c88('0x45')]['id']}})[_0x0c88('0x23')](handleEntityNotFound(_0x3d9ff7,null))['then'](saveUpdates(_0x545001['body'],null))['then'](respondWithResult(_0x3d9ff7,null))[_0x0c88('0x43')](handleError(_0x3d9ff7,null));};exports[_0x0c88('0x49')]=function(_0x6f7467,_0x331959){return db['ServicenowAccount'][_0x0c88('0x46')]({'where':{'id':_0x6f7467[_0x0c88('0x45')]['id']}})[_0x0c88('0x23')](handleEntityNotFound(_0x331959,null))[_0x0c88('0x23')](removeEntity(_0x331959,null))['catch'](handleError(_0x331959,null));};exports['getConfigurations']=function(_0x5c29f8,_0x556bc5,_0x468844){var _0x11e5ce={};var _0x52e2f2={};var _0x268c2d;var _0x57b5f9;return db[_0x0c88('0x2a')][_0x0c88('0x4a')]({'where':{'id':_0x5c29f8['params']['id']}})[_0x0c88('0x23')](handleEntityNotFound(_0x556bc5,null))['then'](function(_0x3c40d6){if(_0x3c40d6){_0x268c2d=_0x3c40d6;_0x52e2f2[_0x0c88('0x2d')]=_[_0x0c88('0x2f')](db[_0x0c88('0x4b')][_0x0c88('0x2b')]);_0x52e2f2['query']=_['keys'](_0x5c29f8[_0x0c88('0x2e')]);_0x52e2f2['filters']=_[_0x0c88('0x31')](_0x52e2f2[_0x0c88('0x2d')],_0x52e2f2[_0x0c88('0x2e')]);_0x11e5ce[_0x0c88('0x30')]=_[_0x0c88('0x31')](_0x52e2f2[_0x0c88('0x2d')],qs[_0x0c88('0x32')](_0x5c29f8['query'][_0x0c88('0x32')]));_0x11e5ce[_0x0c88('0x30')]=_0x11e5ce[_0x0c88('0x30')][_0x0c88('0x33')]?_0x11e5ce['attributes']:_0x52e2f2[_0x0c88('0x2d')];_0x11e5ce[_0x0c88('0x36')]=qs[_0x0c88('0x37')](_0x5c29f8[_0x0c88('0x2e')][_0x0c88('0x37')]);_0x11e5ce[_0x0c88('0x3c')]=qs[_0x0c88('0x39')](_[_0x0c88('0x38')](_0x5c29f8['query'],_0x52e2f2[_0x0c88('0x39')]));if(_0x5c29f8[_0x0c88('0x2e')][_0x0c88('0x3a')]){_0x11e5ce[_0x0c88('0x3c')]=_[_0x0c88('0x3b')](_0x11e5ce['where'],{'$or':_[_0x0c88('0x29')](_0x11e5ce['attributes'],function(_0x47a563){var _0x4a0bb8={};_0x4a0bb8[_0x47a563]={'$like':'%'+_0x5c29f8[_0x0c88('0x2e')][_0x0c88('0x3a')]+'%'};return _0x4a0bb8;})});}_0x11e5ce=_[_0x0c88('0x3b')]({},_0x11e5ce,_0x5c29f8['options']);return _0x268c2d[_0x0c88('0x4c')](_0x11e5ce);}})[_0x0c88('0x23')](function(_0x4e746a){if(_0x4e746a){_0x57b5f9=_0x4e746a[_0x0c88('0x33')];if(!_0x5c29f8[_0x0c88('0x2e')][_0x0c88('0x34')](_0x0c88('0x35'))){_0x11e5ce['limit']=qs[_0x0c88('0x1e')](_0x5c29f8[_0x0c88('0x2e')][_0x0c88('0x1e')]);_0x11e5ce[_0x0c88('0x1c')]=qs[_0x0c88('0x1c')](_0x5c29f8[_0x0c88('0x2e')]['offset']);}return _0x268c2d[_0x0c88('0x4c')](_0x11e5ce);}})[_0x0c88('0x23')](function(_0x51f77d){if(_0x51f77d){return _0x51f77d?{'count':_0x57b5f9,'rows':_0x51f77d}:null;}})[_0x0c88('0x23')](respondWithResult(_0x556bc5,null))[_0x0c88('0x43')](handleError(_0x556bc5,null));};exports['addConfiguration']=function(_0x51fcb1,_0x16cb43,_0x8afd57){if(_0x51fcb1['body']['id']){delete _0x51fcb1[_0x0c88('0x48')]['id'];}return db[_0x0c88('0x2a')]['findOne']({'where':{'id':_0x51fcb1[_0x0c88('0x45')]['id']}})[_0x0c88('0x23')](handleEntityNotFound(_0x16cb43,null))[_0x0c88('0x23')](function(_0x5149cd){if(_0x5149cd){_0x51fcb1[_0x0c88('0x48')][_0x0c88('0x4d')]=_0x5149cd['id'];_0x51fcb1[_0x0c88('0x48')][_0x0c88('0x4e')]=integrations[_0x0c88('0x4f')](_0x51fcb1['body'][_0x0c88('0x50')],_0x51fcb1['body'][_0x0c88('0x3d')]);_0x51fcb1[_0x0c88('0x48')][_0x0c88('0x51')]=integrations[_0x0c88('0x52')](_0x51fcb1['body'][_0x0c88('0x50')],_0x51fcb1['body'][_0x0c88('0x3d')]);return db[_0x0c88('0x4b')][_0x0c88('0x47')](_0x51fcb1['body'],{'include':[{'model':db[_0x0c88('0x53')],'as':_0x0c88('0x4e')},{'model':db[_0x0c88('0x53')],'as':_0x0c88('0x51')}]});}return null;})[_0x0c88('0x23')](respondWithResult(_0x16cb43,null))[_0x0c88('0x43')](handleError(_0x16cb43,null));};exports[_0x0c88('0x54')]=function(_0x46e738,_0x3ae63,_0x312165){var _0xe09244=[_0x0c88('0x55'),'hold_reason',_0x0c88('0x56'),_0x0c88('0x57'),_0x0c88('0x58'),'notify',_0x0c88('0x59'),_0x0c88('0x5a'),_0x0c88('0x5b')];var _0x59aa56=[_0x0c88('0x5c'),_0x0c88('0x55'),'caused_by','watch_list','upon_reject',_0x0c88('0x5d'),'child_incidents',_0x0c88('0x5e'),'approval_history','number',_0x0c88('0x5f'),_0x0c88('0x60'),_0x0c88('0x61'),_0x0c88('0x62'),'sys_created_on',_0x0c88('0x63'),'state',_0x0c88('0x64'),_0x0c88('0x56'),'order',_0x0c88('0x65'),_0x0c88('0x66'),_0x0c88('0x67'),'delivery_plan',_0x0c88('0x68'),_0x0c88('0x69'),_0x0c88('0x6a'),_0x0c88('0x6b'),_0x0c88('0x6c'),_0x0c88('0x6d'),_0x0c88('0x6e'),_0x0c88('0x6f'),_0x0c88('0x70'),_0x0c88('0x71'),'business_duration',_0x0c88('0x72'),'work_end','reopened_time','resolved_at',_0x0c88('0x73'),_0x0c88('0x74'),_0x0c88('0x57'),'work_notes','short_description','close_code',_0x0c88('0x75'),_0x0c88('0x76'),_0x0c88('0x77'),_0x0c88('0x78'),'business_stc',_0x0c88('0x79'),_0x0c88('0x7a'),_0x0c88('0x7b'),'notify','sys_class_name',_0x0c88('0x7c'),_0x0c88('0x7d'),_0x0c88('0x7e'),'parent_incident',_0x0c88('0x7f'),_0x0c88('0x80'),_0x0c88('0x81'),_0x0c88('0x59'),_0x0c88('0x82'),'problem_id',_0x0c88('0x83'),_0x0c88('0x84'),_0x0c88('0x85'),'assigned_to',_0x0c88('0x5a'),_0x0c88('0x86'),_0x0c88('0x87'),_0x0c88('0x88'),_0x0c88('0x89'),'due_date','sys_mod_count',_0x0c88('0x8a'),_0x0c88('0x8b'),_0x0c88('0x8c'),'upon_approval',_0x0c88('0x8d'),'location',_0x0c88('0x5b')];var _0x1a01d0='';var _0x1ca1b4='';var _0x50246b=[];var _0x417d4b='';var _0xd4b683='';var _0x2c823b=[];var _0x42cc13='';var _0x50d9d9='';var _0x4e74d8={};var _0x1221ff='';return db[_0x0c88('0x2a')]['findOne']({'where':{'id':_0x46e738[_0x0c88('0x45')]['id']},'attributes':['id',_0x0c88('0x8e'),_0x0c88('0x8f'),_0x0c88('0x90'),_0x0c88('0x91'),_0x0c88('0x92')]})[_0x0c88('0x23')](handleEntityNotFound(_0x3ae63,null))[_0x0c88('0x23')](function(_0x35c9ff){if(_0x35c9ff){_0x1221ff=_0x35c9ff[_0x0c88('0x91')];var _0x44362a=_0x1221ff[_0x0c88('0x93')](-0x1);if(_0x44362a==='/'){_0x1221ff=_0x1221ff['substring'](0x0,_0x1221ff[_0x0c88('0x94')](_0x44362a));}_0x50d9d9=util[_0x0c88('0x95')]('%s/api/now/doc/table/schema/',_0x1221ff);_0x42cc13=util[_0x0c88('0x95')](_0x0c88('0x96'),_0x1221ff);_0x4e74d8={'user':_0x35c9ff[_0x0c88('0x8e')],'pass':_0x35c9ff['password']};var _0x5bcc9a={'method':_0x0c88('0x97'),'uri':_0x50d9d9+'incident?sysparm_display_value=all','auth':_0x4e74d8,'json':!![]};return rp(_0x5bcc9a);}})['then'](function(_0x4f7d9c){if(_0x4f7d9c['result'][_0x0c88('0x33')]>0x0){_0x1a01d0=_0x4f7d9c[_0x0c88('0x98')];}console['log'](_0x0c88('0x99'),_0x1a01d0);_0x2c823b=[];_0x1ca1b4=Object[_0x0c88('0x9a')]([],_0x1a01d0);_[_0x0c88('0x9b')](_0x1ca1b4,function(_0xb05186){return!_0xe09244[_0x0c88('0x9c')](_0xb05186[_0x0c88('0x26')]);});_0x1ca1b4[_0x0c88('0x9d')](function(_0x5ce4d2){var _0x23bb19=createFieldObject(_0x42cc13,_0x4e74d8,_0x5ce4d2[_0x0c88('0x9e')],_0x5ce4d2[_0x0c88('0x26')],_0x5ce4d2['label'],![]);_0x2c823b[_0x0c88('0x9f')](_0x23bb19);});return Promise[_0x0c88('0xa0')](_0x2c823b);})[_0x0c88('0x23')](function(_0x1361b3){_0x50246b=_0x1361b3;_0x417d4b=Object[_0x0c88('0x9a')]([],_0x1a01d0);console[_0x0c88('0xa1')](_0x0c88('0xa2'),_0x1a01d0);_[_0x0c88('0x9b')](_0x417d4b,function(_0xcb8ca4){return _0x59aa56['includes'](_0xcb8ca4[_0x0c88('0x26')]);});console['log'](_0x0c88('0xa3'),_0x417d4b);_0x2c823b=[];_0x417d4b['forEach'](function(_0x5ec122){var _0x48face=createFieldObject(_0x42cc13,_0x4e74d8,_0x5ec122[_0x0c88('0x9e')],_0x5ec122[_0x0c88('0x26')],_0x5ec122[_0x0c88('0xa4')],!![]);_0x2c823b['push'](_0x48face);});return Promise['all'](_0x2c823b);})[_0x0c88('0x23')](function(_0x531860){_0xd4b683=_0x531860;var _0x4d71d5=_0x50246b[_0x0c88('0xa5')](_0xd4b683);return{'count':_0x4d71d5[_0x0c88('0x33')],'rows':_0x4d71d5};})[_0x0c88('0x23')](respondWithResult(_0x3ae63,null))['catch'](function(_0x113e3a){console[_0x0c88('0xa1')]('ServiceNow\x20error:\x20'+_0x113e3a);var _0x58cac0=_0x46e738[_0x0c88('0x2e')][_0x0c88('0xa6')]?0x1f4:_0x113e3a[_0x0c88('0xa7')]||0x1f4;logger[_0x0c88('0x24')](_0x113e3a[_0x0c88('0x25')]);delete _0x113e3a[_0x0c88('0x26')];if(_0x58cac0===0x191){_0x58cac0=0x190;}_0x3ae63['status'](_0x58cac0)[_0x0c88('0x27')](_0x46e738[_0x0c88('0x2e')][_0x0c88('0xa6')]?{'message':_0x0c88('0xa8'),'statusCode':_0x113e3a[_0x0c88('0xa7')]}:_0x113e3a);});};function createFieldObject(_0x22cf36,_0x3fb4d0,_0x881917,_0x7f762b,_0x607898,_0x194b78){return new Promise(function(_0x3bba9b,_0xf9a83e){var _0x32da51={'id':_0x7f762b,'name':_0x607898,'custom':_0x194b78};if(_0x881917===_0x0c88('0xa9')){_0x32da51[_0x0c88('0x3f')]=[{'name':_0x0c88('0xaa'),'value':'true'},{'name':_0x0c88('0xab'),'value':_0x0c88('0xac')}];_0x3bba9b(_0x32da51);}else{var _0x24d341={'method':_0x0c88('0x97'),'uri':_0x22cf36+'sys_choice?sysparm_query=name=incident^element='+_0x7f762b,'auth':_0x3fb4d0,'json':!![]};return rp(_0x24d341)[_0x0c88('0x23')](function(_0xbd78f1){var _0x7eb7b7=[];if(_0xbd78f1[_0x0c88('0x98')][_0x0c88('0x33')]>0x0){_0xbd78f1['result'][_0x0c88('0x9d')](function(_0xaf0123){if(_0xaf0123[_0x0c88('0xad')]===_0x0c88('0xac')){var _0x1cd056={'name':_0xaf0123[_0x0c88('0xa4')],'value':_0xaf0123[_0x0c88('0xae')]};_0x7eb7b7[_0x0c88('0x9f')](_0x1cd056);}});}_0x32da51['options']=_0x7eb7b7;if(_0x32da51[_0x0c88('0x3f')][_0x0c88('0x33')]>0x0){_0x3bba9b(_0x32da51);}else{if(_0x194b78==![]){_0x3bba9b();}else{_0x3bba9b(_0x32da51);}}});}});} \ No newline at end of file +var _0x130b=['findAll','catch','show','params','keys','rawAttributes','length','find','create','body','destroy','getConfigurations','findOne','ServicenowConfiguration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ServicenowField','getFields','hold_reason','subcategory','close_code','incident_state','severity','parent','made_sla','caused_by','watch_list','upon_reject','child_incidents','approval_history','number','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','knowledge','calendar_stc','closed_at','cmdb_ci','active','work_notes_list','sys_domain_path','rfc','expected_start','business_duration','group_list','reopened_time','approval_set','work_notes','short_description','correlation_display','additional_assignee_list','calendar_duration','notify','close_notes','sys_id','contact_type','urgency','problem_id','company','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','sys_tags','escalation','upon_approval','location','category','username','password','email','remoteUri','slice','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','includes','forEach','push','all','log','TCL:\x20_object','internalType','label','concat','ServiceNow\x20error:\x20','test','statusCode','send','Wrong\x20credentials','boolean','True','false','inactive','value','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','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','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','error','stack','name','map','model','query','filters','intersection','attributes','fields','order','sort','pick','filter','merge','where','type','VIRTUAL','options','ServicenowAccount','includeAll','include'];(function(_0x4269c8,_0xd07196){var _0x2e6901=function(_0x10cd8e){while(--_0x10cd8e){_0x4269c8['push'](_0x4269c8['shift']());}};_0x2e6901(++_0xd07196);}(_0x130b,0x11d));var _0xb130=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x130b[_0x3e5086];return _0xfeb102;};'use strict';var emlformat=require(_0xb130('0x0'));var rimraf=require(_0xb130('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb130('0x2'));var BPromise=require(_0xb130('0x3'));var Mustache=require('mustache');var util=require(_0xb130('0x4'));var path=require(_0xb130('0x5'));var sox=require(_0xb130('0x6'));var csv=require(_0xb130('0x7'));var ejs=require(_0xb130('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb130('0x9'));var deskjs=require(_0xb130('0xa'));var toCsv=require(_0xb130('0x7'));var querystring=require('querystring');var Papa=require(_0xb130('0xb'));var Redis=require(_0xb130('0xc'));var authService=require(_0xb130('0xd'));var qs=require(_0xb130('0xe'));var as=require(_0xb130('0xf'));var hardwareService=require(_0xb130('0x10'));var logger=require(_0xb130('0x11'))(_0xb130('0x12'));var utils=require(_0xb130('0x13'));var config=require(_0xb130('0x14'));var licenseUtil=require(_0xb130('0x15'));var db=require(_0xb130('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2b1120,_0x2f8f71){_0x2f8f71=_0x2f8f71||0xcc;return function(_0x18e8f3){if(_0x18e8f3){return _0x2b1120[_0xb130('0x17')](_0x2f8f71);}return _0x2b1120['status'](_0x2f8f71)['end']();};}function respondWithResult(_0x16816b,_0x4b63df){_0x4b63df=_0x4b63df||0xc8;return function(_0x2c2987){if(_0x2c2987){return _0x16816b[_0xb130('0x18')](_0x4b63df)[_0xb130('0x19')](_0x2c2987);}};}function respondWithFilteredResult(_0x502244,_0x278dc3){return function(_0x1bf9f1){if(_0x1bf9f1){var _0x5335ff=typeof _0x278dc3[_0xb130('0x1a')]===_0xb130('0x1b')&&typeof _0x278dc3[_0xb130('0x1c')]===_0xb130('0x1b');var _0x22fe54=_0x1bf9f1['count'];var _0x498ab4=_0x5335ff?0x0:_0x278dc3['offset'];var _0x75bf64=_0x5335ff?_0x1bf9f1[_0xb130('0x1d')]:_0x278dc3[_0xb130('0x1a')]+_0x278dc3['limit'];var _0x4b4117;if(_0x75bf64>=_0x22fe54){_0x75bf64=_0x22fe54;_0x4b4117=0xc8;}else{_0x4b4117=0xce;}_0x502244[_0xb130('0x18')](_0x4b4117);return _0x502244['set'](_0xb130('0x1e'),_0x498ab4+'-'+_0x75bf64+'/'+_0x22fe54)['json'](_0x1bf9f1);}return null;};}function patchUpdates(_0x3b866b){return function(_0x5c9e60){try{jsonpatch['apply'](_0x5c9e60,_0x3b866b,!![]);}catch(_0x480e9b){return BPromise[_0xb130('0x1f')](_0x480e9b);}return _0x5c9e60[_0xb130('0x20')]();};}function saveUpdates(_0x3f9c58,_0x5bfcee){return function(_0xb8b2fa){if(_0xb8b2fa){return _0xb8b2fa[_0xb130('0x21')](_0x3f9c58)[_0xb130('0x22')](function(_0x4b9842){return _0x4b9842;});}return null;};}function removeEntity(_0x41e0db,_0x27c8e1){return function(_0x29582c){if(_0x29582c){return _0x29582c['destroy']()[_0xb130('0x22')](function(){_0x41e0db[_0xb130('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xaa77c,_0x42b2dc){return function(_0x54e5d4){if(!_0x54e5d4){_0xaa77c[_0xb130('0x17')](0x194);}return _0x54e5d4;};}function handleError(_0x55ccd9,_0x558c00){_0x558c00=_0x558c00||0x1f4;return function(_0x55ecec){logger[_0xb130('0x23')](_0x55ecec[_0xb130('0x24')]);if(_0x55ecec[_0xb130('0x25')]){delete _0x55ecec[_0xb130('0x25')];}_0x55ccd9[_0xb130('0x18')](_0x558c00)['send'](_0x55ecec);};}exports['index']=function(_0xa60cbc,_0x1bc445){var _0x1ea545={},_0x2b13d2={},_0x25aa41={'count':0x0,'rows':[]};var _0xe76e9=_[_0xb130('0x26')](db['ServicenowAccount']['rawAttributes'],function(_0x2514db){return{'name':_0x2514db['fieldName'],'type':_0x2514db['type']['key']};});_0x2b13d2[_0xb130('0x27')]=_[_0xb130('0x26')](_0xe76e9,_0xb130('0x25'));_0x2b13d2[_0xb130('0x28')]=_['keys'](_0xa60cbc[_0xb130('0x28')]);_0x2b13d2[_0xb130('0x29')]=_[_0xb130('0x2a')](_0x2b13d2['model'],_0x2b13d2['query']);_0x1ea545[_0xb130('0x2b')]=_[_0xb130('0x2a')](_0x2b13d2[_0xb130('0x27')],qs['fields'](_0xa60cbc[_0xb130('0x28')][_0xb130('0x2c')]));_0x1ea545[_0xb130('0x2b')]=_0x1ea545[_0xb130('0x2b')]['length']?_0x1ea545[_0xb130('0x2b')]:_0x2b13d2[_0xb130('0x27')];if(!_0xa60cbc['query']['hasOwnProperty']('nolimit')){_0x1ea545[_0xb130('0x1c')]=qs[_0xb130('0x1c')](_0xa60cbc[_0xb130('0x28')]['limit']);_0x1ea545[_0xb130('0x1a')]=qs[_0xb130('0x1a')](_0xa60cbc[_0xb130('0x28')]['offset']);}_0x1ea545[_0xb130('0x2d')]=qs[_0xb130('0x2e')](_0xa60cbc['query'][_0xb130('0x2e')]);_0x1ea545['where']=qs[_0xb130('0x29')](_[_0xb130('0x2f')](_0xa60cbc[_0xb130('0x28')],_0x2b13d2[_0xb130('0x29')]),_0xe76e9);if(_0xa60cbc[_0xb130('0x28')][_0xb130('0x30')]){_0x1ea545['where']=_[_0xb130('0x31')](_0x1ea545[_0xb130('0x32')],{'$or':_['map'](_0xe76e9,function(_0x1619fb){if(_0x1619fb[_0xb130('0x33')]!==_0xb130('0x34')){var _0x495cd4={};_0x495cd4[_0x1619fb[_0xb130('0x25')]]={'$like':'%'+_0xa60cbc[_0xb130('0x28')]['filter']+'%'};return _0x495cd4;}})});}_0x1ea545=_['merge']({},_0x1ea545,_0xa60cbc[_0xb130('0x35')]);var _0x36727a={'where':_0x1ea545[_0xb130('0x32')]};return db[_0xb130('0x36')]['count'](_0x36727a)[_0xb130('0x22')](function(_0x3d7851){_0x25aa41['count']=_0x3d7851;if(_0xa60cbc['query'][_0xb130('0x37')]){_0x1ea545[_0xb130('0x38')]=[{'all':!![]}];}return db['ServicenowAccount'][_0xb130('0x39')](_0x1ea545);})[_0xb130('0x22')](function(_0x324c1b){_0x25aa41['rows']=_0x324c1b;return _0x25aa41;})[_0xb130('0x22')](respondWithFilteredResult(_0x1bc445,_0x1ea545))[_0xb130('0x3a')](handleError(_0x1bc445,null));};exports[_0xb130('0x3b')]=function(_0x43e493,_0x18fc60){var _0x21927f={'raw':![],'where':{'id':_0x43e493[_0xb130('0x3c')]['id']}},_0x33f439={};_0x33f439[_0xb130('0x27')]=_[_0xb130('0x3d')](db['ServicenowAccount'][_0xb130('0x3e')]);_0x33f439[_0xb130('0x28')]=_[_0xb130('0x3d')](_0x43e493[_0xb130('0x28')]);_0x33f439[_0xb130('0x29')]=_['intersection'](_0x33f439[_0xb130('0x27')],_0x33f439[_0xb130('0x28')]);_0x21927f[_0xb130('0x2b')]=_[_0xb130('0x2a')](_0x33f439[_0xb130('0x27')],qs[_0xb130('0x2c')](_0x43e493['query']['fields']));_0x21927f['attributes']=_0x21927f['attributes'][_0xb130('0x3f')]?_0x21927f[_0xb130('0x2b')]:_0x33f439[_0xb130('0x27')];if(_0x43e493[_0xb130('0x28')][_0xb130('0x37')]){_0x21927f['include']=[{'all':!![]}];}_0x21927f=_['merge']({},_0x21927f,_0x43e493[_0xb130('0x35')]);return db['ServicenowAccount'][_0xb130('0x40')](_0x21927f)['then'](handleEntityNotFound(_0x18fc60,null))[_0xb130('0x22')](respondWithResult(_0x18fc60,null))[_0xb130('0x3a')](handleError(_0x18fc60,null));};exports[_0xb130('0x41')]=function(_0x4c4140,_0x37cb4f){return db[_0xb130('0x36')][_0xb130('0x41')](_0x4c4140[_0xb130('0x42')],{})[_0xb130('0x22')](respondWithResult(_0x37cb4f,0xc9))['catch'](handleError(_0x37cb4f,null));};exports[_0xb130('0x21')]=function(_0x578c4f,_0x31cdd5){if(_0x578c4f[_0xb130('0x42')]['id']){delete _0x578c4f[_0xb130('0x42')]['id'];}return db[_0xb130('0x36')][_0xb130('0x40')]({'where':{'id':_0x578c4f[_0xb130('0x3c')]['id']}})[_0xb130('0x22')](handleEntityNotFound(_0x31cdd5,null))[_0xb130('0x22')](saveUpdates(_0x578c4f[_0xb130('0x42')],null))['then'](respondWithResult(_0x31cdd5,null))[_0xb130('0x3a')](handleError(_0x31cdd5,null));};exports[_0xb130('0x43')]=function(_0x20765f,_0x491620){return db[_0xb130('0x36')][_0xb130('0x40')]({'where':{'id':_0x20765f[_0xb130('0x3c')]['id']}})[_0xb130('0x22')](handleEntityNotFound(_0x491620,null))[_0xb130('0x22')](removeEntity(_0x491620,null))['catch'](handleError(_0x491620,null));};exports[_0xb130('0x44')]=function(_0x2c7efa,_0x2102e8,_0x28cbfe){var _0x99083e={};var _0x45be64={};var _0x36ce5c;var _0x46a9a0;return db[_0xb130('0x36')][_0xb130('0x45')]({'where':{'id':_0x2c7efa[_0xb130('0x3c')]['id']}})[_0xb130('0x22')](handleEntityNotFound(_0x2102e8,null))[_0xb130('0x22')](function(_0xd05949){if(_0xd05949){_0x36ce5c=_0xd05949;_0x45be64['model']=_[_0xb130('0x3d')](db[_0xb130('0x46')][_0xb130('0x3e')]);_0x45be64[_0xb130('0x28')]=_[_0xb130('0x3d')](_0x2c7efa['query']);_0x45be64[_0xb130('0x29')]=_['intersection'](_0x45be64[_0xb130('0x27')],_0x45be64[_0xb130('0x28')]);_0x99083e[_0xb130('0x2b')]=_[_0xb130('0x2a')](_0x45be64[_0xb130('0x27')],qs[_0xb130('0x2c')](_0x2c7efa[_0xb130('0x28')]['fields']));_0x99083e['attributes']=_0x99083e[_0xb130('0x2b')][_0xb130('0x3f')]?_0x99083e[_0xb130('0x2b')]:_0x45be64['model'];_0x99083e['order']=qs[_0xb130('0x2e')](_0x2c7efa[_0xb130('0x28')]['sort']);_0x99083e['where']=qs[_0xb130('0x29')](_['pick'](_0x2c7efa[_0xb130('0x28')],_0x45be64[_0xb130('0x29')]));if(_0x2c7efa[_0xb130('0x28')][_0xb130('0x30')]){_0x99083e['where']=_['merge'](_0x99083e[_0xb130('0x32')],{'$or':_[_0xb130('0x26')](_0x99083e[_0xb130('0x2b')],function(_0x55e8a3){var _0x5ef5a2={};_0x5ef5a2[_0x55e8a3]={'$like':'%'+_0x2c7efa[_0xb130('0x28')][_0xb130('0x30')]+'%'};return _0x5ef5a2;})});}_0x99083e=_[_0xb130('0x31')]({},_0x99083e,_0x2c7efa[_0xb130('0x35')]);return _0x36ce5c[_0xb130('0x44')](_0x99083e);}})['then'](function(_0x2ee349){if(_0x2ee349){_0x46a9a0=_0x2ee349[_0xb130('0x3f')];if(!_0x2c7efa[_0xb130('0x28')]['hasOwnProperty'](_0xb130('0x47'))){_0x99083e['limit']=qs[_0xb130('0x1c')](_0x2c7efa[_0xb130('0x28')][_0xb130('0x1c')]);_0x99083e[_0xb130('0x1a')]=qs['offset'](_0x2c7efa[_0xb130('0x28')][_0xb130('0x1a')]);}return _0x36ce5c[_0xb130('0x44')](_0x99083e);}})[_0xb130('0x22')](function(_0x647af3){if(_0x647af3){return _0x647af3?{'count':_0x46a9a0,'rows':_0x647af3}:null;}})[_0xb130('0x22')](respondWithResult(_0x2102e8,null))[_0xb130('0x3a')](handleError(_0x2102e8,null));};exports[_0xb130('0x48')]=function(_0x42cbbc,_0xceeec3,_0x1b372e){if(_0x42cbbc[_0xb130('0x42')]['id']){delete _0x42cbbc['body']['id'];}return db[_0xb130('0x36')][_0xb130('0x45')]({'where':{'id':_0x42cbbc[_0xb130('0x3c')]['id']}})[_0xb130('0x22')](handleEntityNotFound(_0xceeec3,null))[_0xb130('0x22')](function(_0x53f287){if(_0x53f287){_0x42cbbc['body'][_0xb130('0x49')]=_0x53f287['id'];_0x42cbbc[_0xb130('0x42')][_0xb130('0x4a')]=integrations[_0xb130('0x4b')](_0x42cbbc[_0xb130('0x42')][_0xb130('0x4c')],_0x42cbbc['body']['type']);_0x42cbbc[_0xb130('0x42')][_0xb130('0x4d')]=integrations['getDescriptions'](_0x42cbbc['body'][_0xb130('0x4c')],_0x42cbbc[_0xb130('0x42')][_0xb130('0x33')]);return db[_0xb130('0x46')]['create'](_0x42cbbc['body'],{'include':[{'model':db[_0xb130('0x4e')],'as':_0xb130('0x4a')},{'model':db[_0xb130('0x4e')],'as':_0xb130('0x4d')}]});}return null;})[_0xb130('0x22')](respondWithResult(_0xceeec3,null))[_0xb130('0x3a')](handleError(_0xceeec3,null));};exports[_0xb130('0x4f')]=function(_0x1dbe4c,_0x2c35b0,_0xa6ad51){var _0x27ce88=['made_sla',_0xb130('0x50'),'knowledge',_0xb130('0x51'),_0xb130('0x52'),'notify',_0xb130('0x53'),_0xb130('0x54'),'category'];var _0x52782d=[_0xb130('0x55'),_0xb130('0x56'),_0xb130('0x57'),_0xb130('0x58'),_0xb130('0x59'),'sys_updated_on',_0xb130('0x5a'),'hold_reason',_0xb130('0x5b'),_0xb130('0x5c'),'resolved_by',_0xb130('0x5d'),_0xb130('0x5e'),_0xb130('0x5f'),_0xb130('0x60'),_0xb130('0x61'),_0xb130('0x62'),'sys_created_by',_0xb130('0x63'),'order',_0xb130('0x64'),_0xb130('0x65'),_0xb130('0x66'),'delivery_plan','impact',_0xb130('0x67'),_0xb130('0x68'),'business_service','priority',_0xb130('0x69'),_0xb130('0x6a'),'time_worked',_0xb130('0x6b'),'opened_at',_0xb130('0x6c'),_0xb130('0x6d'),'work_end',_0xb130('0x6e'),'resolved_at','caller_id',_0xb130('0x6f'),_0xb130('0x51'),_0xb130('0x70'),_0xb130('0x71'),'close_code',_0xb130('0x72'),'delivery_task','work_start','assignment_group','business_stc',_0xb130('0x73'),'description',_0xb130('0x74'),_0xb130('0x75'),'sys_class_name',_0xb130('0x76'),'closed_by','follow_up','parent_incident',_0xb130('0x77'),_0xb130('0x78'),'reopened_by','incident_state',_0xb130('0x79'),_0xb130('0x7a'),_0xb130('0x7b'),'reassignment_count',_0xb130('0x7c'),_0xb130('0x7d'),_0xb130('0x54'),_0xb130('0x7e'),_0xb130('0x7f'),_0xb130('0x80'),_0xb130('0x81'),_0xb130('0x82'),_0xb130('0x83'),'reopen_count',_0xb130('0x84'),_0xb130('0x85'),_0xb130('0x86'),'correlation_id',_0xb130('0x87'),_0xb130('0x88')];var _0x593c63='';var _0x1f92a9='';var _0x2c1705=[];var _0x1b1946='';var _0x717129='';var _0x1aa313=[];var _0x14f166='';var _0x129475='';var _0x1dc7dc={};var _0x2b6a6b='';return db[_0xb130('0x36')][_0xb130('0x45')]({'where':{'id':_0x1dbe4c['params']['id']},'attributes':['id',_0xb130('0x89'),_0xb130('0x8a'),_0xb130('0x8b'),_0xb130('0x8c'),'serverUrl']})['then'](handleEntityNotFound(_0x2c35b0,null))[_0xb130('0x22')](function(_0x1ef280){if(_0x1ef280){_0x2b6a6b=_0x1ef280['remoteUri'];var _0x211907=_0x2b6a6b[_0xb130('0x8d')](-0x1);if(_0x211907==='/'){_0x2b6a6b=_0x2b6a6b[_0xb130('0x8e')](0x0,_0x2b6a6b['lastIndexOf'](_0x211907));}_0x129475=util[_0xb130('0x8f')](_0xb130('0x90'),_0x2b6a6b);_0x14f166=util[_0xb130('0x8f')](_0xb130('0x91'),_0x2b6a6b);_0x1dc7dc={'user':_0x1ef280['username'],'pass':_0x1ef280[_0xb130('0x8a')]};var _0x40d66a={'method':_0xb130('0x92'),'uri':_0x129475+_0xb130('0x93'),'auth':_0x1dc7dc,'json':!![]};return rp(_0x40d66a);}})[_0xb130('0x22')](function(_0x2bef15){if(_0x2bef15[_0xb130('0x94')][_0xb130('0x3f')]>0x0){_0x593c63=_0x2bef15[_0xb130('0x94')];}console['log'](_0xb130('0x95'),_0x593c63);_0x1aa313=[];_0x1f92a9=Object[_0xb130('0x96')]([],_0x593c63);_[_0xb130('0x97')](_0x1f92a9,function(_0x235245){return!_0x27ce88[_0xb130('0x98')](_0x235245[_0xb130('0x25')]);});_0x1f92a9[_0xb130('0x99')](function(_0x3334dc){var _0x217c5c=createFieldObject(_0x14f166,_0x1dc7dc,_0x3334dc['internalType'],_0x3334dc[_0xb130('0x25')],_0x3334dc['label'],![]);_0x1aa313[_0xb130('0x9a')](_0x217c5c);});return Promise[_0xb130('0x9b')](_0x1aa313);})['then'](function(_0x121c13){_0x2c1705=_0x121c13;_0x1b1946=Object[_0xb130('0x96')]([],_0x593c63);console[_0xb130('0x9c')](_0xb130('0x9d'),_0x593c63);_[_0xb130('0x97')](_0x1b1946,function(_0x3c9978){return _0x52782d['includes'](_0x3c9978[_0xb130('0x25')]);});console[_0xb130('0x9c')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x1b1946);_0x1aa313=[];_0x1b1946[_0xb130('0x99')](function(_0x1ff4e0){var _0x55a0a1=createFieldObject(_0x14f166,_0x1dc7dc,_0x1ff4e0[_0xb130('0x9e')],_0x1ff4e0[_0xb130('0x25')],_0x1ff4e0[_0xb130('0x9f')],!![]);_0x1aa313[_0xb130('0x9a')](_0x55a0a1);});return Promise[_0xb130('0x9b')](_0x1aa313);})['then'](function(_0x2f0048){_0x717129=_0x2f0048;var _0x40ec96=_0x2c1705[_0xb130('0xa0')](_0x717129);return{'count':_0x40ec96['length'],'rows':_0x40ec96};})[_0xb130('0x22')](respondWithResult(_0x2c35b0,null))[_0xb130('0x3a')](function(_0x1aac95){console['log'](_0xb130('0xa1')+_0x1aac95);var _0x527095=_0x1dbe4c[_0xb130('0x28')][_0xb130('0xa2')]?0x1f4:_0x1aac95[_0xb130('0xa3')]||0x1f4;logger[_0xb130('0x23')](_0x1aac95[_0xb130('0x24')]);delete _0x1aac95[_0xb130('0x25')];if(_0x527095===0x191){_0x527095=0x190;}_0x2c35b0[_0xb130('0x18')](_0x527095)[_0xb130('0xa4')](_0x1dbe4c[_0xb130('0x28')][_0xb130('0xa2')]?{'message':_0xb130('0xa5'),'statusCode':_0x1aac95['statusCode']}:_0x1aac95);});};function createFieldObject(_0x5e2594,_0x1bf78e,_0x220ecc,_0x10b099,_0x5b8b23,_0x5482ba){return new Promise(function(_0x292703,_0x19438e){var _0x398bd5={'id':_0x10b099,'name':_0x5b8b23,'custom':_0x5482ba};if(_0x220ecc===_0xb130('0xa6')){_0x398bd5['options']=[{'name':_0xb130('0xa7'),'value':'true'},{'name':'False','value':_0xb130('0xa8')}];_0x292703(_0x398bd5);}else{var _0x3d7647={'method':_0xb130('0x92'),'uri':_0x5e2594+'sys_choice?sysparm_query=name=incident^element='+_0x10b099,'auth':_0x1bf78e,'json':!![]};return rp(_0x3d7647)[_0xb130('0x22')](function(_0x5ee951){var _0x59ad72=[];if(_0x5ee951['result']['length']>0x0){_0x5ee951[_0xb130('0x94')]['forEach'](function(_0x4022da){if(_0x4022da[_0xb130('0xa9')]===_0xb130('0xa8')){var _0x53e716={'name':_0x4022da['label'],'value':_0x4022da[_0xb130('0xaa')]};_0x59ad72[_0xb130('0x9a')](_0x53e716);}});}_0x398bd5[_0xb130('0x35')]=_0x59ad72;if(_0x398bd5['options']['length']>0x0){_0x292703(_0x398bd5);}else{if(_0x5482ba==![]){_0x292703();}else{_0x292703(_0x398bd5);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index b2bd362..d9c8e28 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 _0xb138=['int_servicenow_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','exports','define','ServicenowAccount'];(function(_0x4bc263,_0x39ce66){var _0x4a3ca3=function(_0x56a9f8){while(--_0x56a9f8){_0x4bc263['push'](_0x4bc263['shift']());}};_0x4a3ca3(++_0x39ce66);}(_0xb138,0x1dd));var _0x8b13=function(_0x126d74,_0x2e352b){_0x126d74=_0x126d74-0x0;var _0x4e6736=_0xb138[_0x126d74];return _0x4e6736;};'use strict';var _=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var logger=require(_0x8b13('0x2'))(_0x8b13('0x3'));var moment=require(_0x8b13('0x4'));var BPromise=require(_0x8b13('0x5'));var rp=require(_0x8b13('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var attributes=require(_0x8b13('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x8b13('0xa')]=function(_0x13f7bd,_0x5d51b1){return _0x13f7bd[_0x8b13('0xb')](_0x8b13('0xc'),attributes,{'tableName':_0x8b13('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeda8=['path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','lodash','util','api','moment','bluebird','request-promise'];(function(_0x328db0,_0x19d1fa){var _0x4f6d29=function(_0x549b66){while(--_0x549b66){_0x328db0['push'](_0x328db0['shift']());}};_0x4f6d29(++_0x19d1fa);}(_0xeda8,0x104));var _0x8eda=function(_0x950cbc,_0x5a91e2){_0x950cbc=_0x950cbc-0x0;var _0x1168bb=_0xeda8[_0x950cbc];return _0x1168bb;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var logger=require('../../config/logger')(_0x8eda('0x2'));var moment=require(_0x8eda('0x3'));var BPromise=require(_0x8eda('0x4'));var rp=require(_0x8eda('0x5'));var fs=require('fs');var path=require(_0x8eda('0x6'));var rimraf=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var attributes=require(_0x8eda('0x9'));var integrations=require(_0x8eda('0xa'));module[_0x8eda('0xb')]=function(_0x349361,_0x32abe8){return _0x349361['define'](_0x8eda('0xc'),attributes,{'tableName':_0x8eda('0xd'),'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 4493198..2c4c2c1 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 _0x60a1=['catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','include','model','attributes','map','debug','stringify','ShowServicenowAccount','find','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x3987a1,_0x447793){var _0xe2596e=function(_0x546925){while(--_0x546925){_0x3987a1['push'](_0x3987a1['shift']());}};_0xe2596e(++_0x447793);}(_0x60a1,0xb9));var _0x160a=function(_0x55a901,_0x43610f){_0x55a901=_0x55a901-0x0;var _0x1b7b56=_0x60a1[_0x55a901];return _0x1b7b56;};'use strict';var _=require(_0x160a('0x0'));var util=require('util');var moment=require(_0x160a('0x1'));var BPromise=require('bluebird');var rs=require(_0x160a('0x2'));var fs=require('fs');var Redis=require(_0x160a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x160a('0x4'));var logger=require(_0x160a('0x5'))(_0x160a('0x6'));var config=require(_0x160a('0x7'));var jayson=require(_0x160a('0x8'));var client=jayson[_0x160a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5291fb,_0x36a128,_0x179f0f){return new BPromise(function(_0x229b01,_0x295c1e){return client[_0x160a('0xa')](_0x5291fb,_0x179f0f)[_0x160a('0xb')](function(_0x3a2ce8){logger[_0x160a('0xc')](_0x160a('0xd'),_0x36a128,_0x160a('0xe'));logger['debug'](_0x160a('0xf'),_0x36a128,_0x160a('0xe'),JSON['stringify'](_0x3a2ce8));if(_0x3a2ce8['error']){if(_0x3a2ce8[_0x160a('0x10')][_0x160a('0x11')]===0x1f4){logger['error'](_0x160a('0xd'),_0x36a128,_0x3a2ce8[_0x160a('0x10')][_0x160a('0x12')]);return _0x295c1e(_0x3a2ce8[_0x160a('0x10')][_0x160a('0x12')]);}logger[_0x160a('0x10')](_0x160a('0xd'),_0x36a128,_0x3a2ce8[_0x160a('0x10')]['message']);return _0x229b01(_0x3a2ce8[_0x160a('0x10')]['message']);}else{logger['info'](_0x160a('0xd'),_0x36a128,_0x160a('0xe'));_0x229b01(_0x3a2ce8['result'][_0x160a('0x12')]);}})[_0x160a('0x13')](function(_0x40acdf){logger[_0x160a('0x10')](_0x160a('0xd'),_0x36a128,_0x40acdf);_0x295c1e(_0x40acdf);});});}exports[_0x160a('0x14')]=function(_0x14b713){var _0x206ebe=this;return new Promise(function(_0x47de9a,_0x3dbdc7){return db[_0x160a('0x15')][_0x160a('0x16')]({'raw':_0x14b713[_0x160a('0x17')]?_0x14b713[_0x160a('0x17')][_0x160a('0x18')]===undefined?!![]:![]:!![],'where':_0x14b713[_0x160a('0x17')]?_0x14b713['options'][_0x160a('0x19')]||null:null,'attributes':_0x14b713[_0x160a('0x17')]?_0x14b713['options']['attributes']||null:null,'limit':_0x14b713[_0x160a('0x17')]?_0x14b713[_0x160a('0x17')]['limit']||null:null,'include':_0x14b713[_0x160a('0x17')]?_0x14b713[_0x160a('0x17')]['include']?_['map'](_0x14b713[_0x160a('0x17')][_0x160a('0x1a')],function(_0x54d698){return{'model':db[_0x54d698[_0x160a('0x1b')]],'as':_0x54d698['as'],'attributes':_0x54d698[_0x160a('0x1c')],'include':_0x54d698[_0x160a('0x1a')]?_[_0x160a('0x1d')](_0x54d698[_0x160a('0x1a')],function(_0x1ad551){return{'model':db[_0x1ad551[_0x160a('0x1b')]],'as':_0x1ad551['as'],'attributes':_0x1ad551[_0x160a('0x1c')],'include':_0x1ad551[_0x160a('0x1a')]?_['map'](_0x1ad551[_0x160a('0x1a')],function(_0x2e12b9){return{'model':db[_0x2e12b9['model']],'as':_0x2e12b9['as'],'attributes':_0x2e12b9[_0x160a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x160a('0xb')](function(_0x3beafe){logger[_0x160a('0xc')]('GetServicenowAccount',_0x14b713);logger[_0x160a('0x1e')](_0x160a('0x14'),_0x14b713,JSON[_0x160a('0x1f')](_0x3beafe));_0x47de9a(_0x3beafe);})[_0x160a('0x13')](function(_0x4a2af9){logger['error'](_0x160a('0x14'),_0x4a2af9['message'],_0x14b713);_0x3dbdc7(_0x206ebe['error'](0x1f4,_0x4a2af9[_0x160a('0x12')]));});});};exports[_0x160a('0x20')]=function(_0x32b5d5){var _0x2738ba=this;return new Promise(function(_0x52b7a1,_0x546291){return db[_0x160a('0x15')][_0x160a('0x21')]({'raw':_0x32b5d5[_0x160a('0x17')]?_0x32b5d5['options']['raw']===undefined?!![]:![]:!![],'where':_0x32b5d5[_0x160a('0x17')]?_0x32b5d5['options'][_0x160a('0x19')]||null:null,'attributes':_0x32b5d5['options']?_0x32b5d5[_0x160a('0x17')][_0x160a('0x1c')]||null:null,'include':_0x32b5d5[_0x160a('0x17')]?_0x32b5d5[_0x160a('0x17')][_0x160a('0x1a')]?_[_0x160a('0x1d')](_0x32b5d5['options'][_0x160a('0x1a')],function(_0x5ad62c){return{'model':db[_0x5ad62c[_0x160a('0x1b')]],'as':_0x5ad62c['as'],'attributes':_0x5ad62c['attributes'],'include':_0x5ad62c[_0x160a('0x1a')]?_[_0x160a('0x1d')](_0x5ad62c[_0x160a('0x1a')],function(_0x921cef){return{'model':db[_0x921cef['model']],'as':_0x921cef['as'],'attributes':_0x921cef['attributes'],'include':_0x921cef[_0x160a('0x1a')]?_[_0x160a('0x1d')](_0x921cef[_0x160a('0x1a')],function(_0x41716e){return{'model':db[_0x41716e[_0x160a('0x1b')]],'as':_0x41716e['as'],'attributes':_0x41716e[_0x160a('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x20a9b5){logger[_0x160a('0xc')](_0x160a('0x20'),_0x32b5d5);logger[_0x160a('0x1e')](_0x160a('0x20'),_0x32b5d5,JSON[_0x160a('0x1f')](_0x20a9b5));_0x52b7a1(_0x20a9b5);})[_0x160a('0x13')](function(_0x182567){logger[_0x160a('0x10')]('ShowServicenowAccount',_0x182567[_0x160a('0x12')],_0x32b5d5);_0x546291(_0x2738ba['error'](0x1f4,_0x182567[_0x160a('0x12')]));});});}; \ No newline at end of file +var _0xd7ea=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','GetServicenowAccount','findAll','options','where','limit','include','map','model','ShowServicenowAccount','ServicenowAccount','find','raw','attributes','lodash','bluebird','randomstring'];(function(_0x4343e4,_0x4a4316){var _0x5ab5ad=function(_0x5a4e17){while(--_0x5a4e17){_0x4343e4['push'](_0x4343e4['shift']());}};_0x5ab5ad(++_0x4a4316);}(_0xd7ea,0x173));var _0xad7e=function(_0x3fb7d8,_0x38df95){_0x3fb7d8=_0x3fb7d8-0x0;var _0x3f09b5=_0xd7ea[_0x3fb7d8];return _0x3f09b5;};'use strict';var _=require(_0xad7e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xad7e('0x1'));var rs=require(_0xad7e('0x2'));var fs=require('fs');var Redis=require(_0xad7e('0x3'));var db=require(_0xad7e('0x4'))['db'];var utils=require(_0xad7e('0x5'));var logger=require(_0xad7e('0x6'))(_0xad7e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xad7e('0x8')][_0xad7e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49f1ec,_0x542829,_0x2ef83e){return new BPromise(function(_0x2acb75,_0x56dd44){return client[_0xad7e('0xa')](_0x49f1ec,_0x2ef83e)[_0xad7e('0xb')](function(_0x4fe452){logger[_0xad7e('0xc')](_0xad7e('0xd'),_0x542829,'request\x20sent');logger[_0xad7e('0xe')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x542829,_0xad7e('0xf'),JSON[_0xad7e('0x10')](_0x4fe452));if(_0x4fe452['error']){if(_0x4fe452[_0xad7e('0x11')]['code']===0x1f4){logger[_0xad7e('0x11')](_0xad7e('0xd'),_0x542829,_0x4fe452[_0xad7e('0x11')][_0xad7e('0x12')]);return _0x56dd44(_0x4fe452[_0xad7e('0x11')]['message']);}logger[_0xad7e('0x11')](_0xad7e('0xd'),_0x542829,_0x4fe452['error'][_0xad7e('0x12')]);return _0x2acb75(_0x4fe452[_0xad7e('0x11')][_0xad7e('0x12')]);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x542829,_0xad7e('0xf'));_0x2acb75(_0x4fe452[_0xad7e('0x13')][_0xad7e('0x12')]);}})[_0xad7e('0x14')](function(_0x2ef2a3){logger['error'](_0xad7e('0xd'),_0x542829,_0x2ef2a3);_0x56dd44(_0x2ef2a3);});});}exports[_0xad7e('0x15')]=function(_0x202c6a){var _0x1959b5=this;return new Promise(function(_0x20ad9f,_0x4ccd03){return db['ServicenowAccount'][_0xad7e('0x16')]({'raw':_0x202c6a[_0xad7e('0x17')]?_0x202c6a[_0xad7e('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x202c6a[_0xad7e('0x17')]?_0x202c6a['options'][_0xad7e('0x18')]||null:null,'attributes':_0x202c6a['options']?_0x202c6a[_0xad7e('0x17')]['attributes']||null:null,'limit':_0x202c6a[_0xad7e('0x17')]?_0x202c6a[_0xad7e('0x17')][_0xad7e('0x19')]||null:null,'include':_0x202c6a['options']?_0x202c6a[_0xad7e('0x17')][_0xad7e('0x1a')]?_[_0xad7e('0x1b')](_0x202c6a[_0xad7e('0x17')]['include'],function(_0x5c027c){return{'model':db[_0x5c027c['model']],'as':_0x5c027c['as'],'attributes':_0x5c027c['attributes'],'include':_0x5c027c[_0xad7e('0x1a')]?_[_0xad7e('0x1b')](_0x5c027c[_0xad7e('0x1a')],function(_0x4a8575){return{'model':db[_0x4a8575[_0xad7e('0x1c')]],'as':_0x4a8575['as'],'attributes':_0x4a8575['attributes'],'include':_0x4a8575[_0xad7e('0x1a')]?_['map'](_0x4a8575['include'],function(_0x2b7147){return{'model':db[_0x2b7147['model']],'as':_0x2b7147['as'],'attributes':_0x2b7147['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x52267b){logger[_0xad7e('0xc')](_0xad7e('0x15'),_0x202c6a);logger[_0xad7e('0xe')]('GetServicenowAccount',_0x202c6a,JSON[_0xad7e('0x10')](_0x52267b));_0x20ad9f(_0x52267b);})[_0xad7e('0x14')](function(_0x10e7cc){logger[_0xad7e('0x11')](_0xad7e('0x15'),_0x10e7cc['message'],_0x202c6a);_0x4ccd03(_0x1959b5['error'](0x1f4,_0x10e7cc['message']));});});};exports[_0xad7e('0x1d')]=function(_0x5abc67){var _0x5aa9bc=this;return new Promise(function(_0x3b80d7,_0x154504){return db[_0xad7e('0x1e')][_0xad7e('0x1f')]({'raw':_0x5abc67['options']?_0x5abc67[_0xad7e('0x17')][_0xad7e('0x20')]===undefined?!![]:![]:!![],'where':_0x5abc67[_0xad7e('0x17')]?_0x5abc67[_0xad7e('0x17')][_0xad7e('0x18')]||null:null,'attributes':_0x5abc67[_0xad7e('0x17')]?_0x5abc67[_0xad7e('0x17')]['attributes']||null:null,'include':_0x5abc67['options']?_0x5abc67[_0xad7e('0x17')][_0xad7e('0x1a')]?_[_0xad7e('0x1b')](_0x5abc67[_0xad7e('0x17')][_0xad7e('0x1a')],function(_0x324677){return{'model':db[_0x324677[_0xad7e('0x1c')]],'as':_0x324677['as'],'attributes':_0x324677[_0xad7e('0x21')],'include':_0x324677[_0xad7e('0x1a')]?_[_0xad7e('0x1b')](_0x324677[_0xad7e('0x1a')],function(_0x2f3751){return{'model':db[_0x2f3751[_0xad7e('0x1c')]],'as':_0x2f3751['as'],'attributes':_0x2f3751['attributes'],'include':_0x2f3751['include']?_[_0xad7e('0x1b')](_0x2f3751[_0xad7e('0x1a')],function(_0x7e5f4){return{'model':db[_0x7e5f4[_0xad7e('0x1c')]],'as':_0x7e5f4['as'],'attributes':_0x7e5f4[_0xad7e('0x21')]};}):[]};}):[]};}):[]:[]})[_0xad7e('0xb')](function(_0x10ebb9){logger['info'](_0xad7e('0x1d'),_0x5abc67);logger[_0xad7e('0xe')]('ShowServicenowAccount',_0x5abc67,JSON[_0xad7e('0x10')](_0x10ebb9));_0x3b80d7(_0x10ebb9);})['catch'](function(_0x138795){logger['error'](_0xad7e('0x1d'),_0x138795[_0xad7e('0x12')],_0x5abc67);_0x154504(_0x5aa9bc[_0xad7e('0x11')](0x1f4,_0x138795[_0xad7e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index b8ba746..b5601e3 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 _0xce47=['fs-extra','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0xfe635a,_0x136411){var _0x17b439=function(_0x4550d4){while(--_0x4550d4){_0xfe635a['push'](_0xfe635a['shift']());}};_0x17b439(++_0x136411);}(_0xce47,0x7c));var _0x7ce4=function(_0x72e9c6,_0x5266c4){_0x72e9c6=_0x72e9c6-0x0;var _0xbadae6=_0xce47[_0x72e9c6];return _0xbadae6;};'use strict';var multer=require(_0x7ce4('0x0'));var util=require(_0x7ce4('0x1'));var path=require(_0x7ce4('0x2'));var timeout=require(_0x7ce4('0x3'));var express=require(_0x7ce4('0x4'));var router=express[_0x7ce4('0x5')]();var fs_extra=require(_0x7ce4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7ce4('0x7'));var config=require(_0x7ce4('0x8'));var controller=require(_0x7ce4('0x9'));router['get']('/',auth[_0x7ce4('0xa')](),controller[_0x7ce4('0xb')]);router[_0x7ce4('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x7ce4('0xd')]);router[_0x7ce4('0xc')](_0x7ce4('0xe'),auth[_0x7ce4('0xa')](),controller[_0x7ce4('0xf')]);router[_0x7ce4('0xc')](_0x7ce4('0x10'),auth[_0x7ce4('0xa')](),controller[_0x7ce4('0x11')]);router['get'](_0x7ce4('0x12'),auth[_0x7ce4('0xa')](),controller[_0x7ce4('0x13')]);router[_0x7ce4('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7ce4('0x15')](_0x7ce4('0x16'),auth[_0x7ce4('0xa')](),controller[_0x7ce4('0x17')]);router['delete'](_0x7ce4('0x16'),auth[_0x7ce4('0xa')](),controller[_0x7ce4('0x18')]);module[_0x7ce4('0x19')]=router; \ No newline at end of file +var _0x974b=['put','/:id','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x1ca9c7,_0x435bbb){var _0x36500a=function(_0x151f7f){while(--_0x151f7f){_0x1ca9c7['push'](_0x1ca9c7['shift']());}};_0x36500a(++_0x435bbb);}(_0x974b,0x1e5));var _0xb974=function(_0xb02766,_0xa37d90){_0xb02766=_0xb02766-0x0;var _0x560e6c=_0x974b[_0xb02766];return _0x560e6c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb974('0x0'));var timeout=require(_0xb974('0x1'));var express=require(_0xb974('0x2'));var router=express[_0xb974('0x3')]();var fs_extra=require(_0xb974('0x4'));var auth=require(_0xb974('0x5'));var interaction=require(_0xb974('0x6'));var config=require(_0xb974('0x7'));var controller=require('./intServicenowConfiguration.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xb974('0x8')]);router[_0xb974('0x9')]('/:id',auth[_0xb974('0xa')](),controller[_0xb974('0xb')]);router[_0xb974('0x9')](_0xb974('0xc'),auth[_0xb974('0xa')](),controller['getFields']);router['get'](_0xb974('0xd'),auth['isAuthenticated'](),controller[_0xb974('0xe')]);router[_0xb974('0x9')](_0xb974('0xf'),auth[_0xb974('0xa')](),controller[_0xb974('0x10')]);router[_0xb974('0x11')]('/',auth[_0xb974('0xa')](),controller[_0xb974('0x12')]);router[_0xb974('0x13')](_0xb974('0x14'),auth[_0xb974('0xa')](),controller[_0xb974('0x15')]);router[_0xb974('0x16')](_0xb974('0x14'),auth[_0xb974('0xa')](),controller[_0xb974('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index fdf1039..192d03e 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 _0x0bfc=['sequelize','STRING'];(function(_0x57574f,_0x18173d){var _0x43181e=function(_0x3c74b9){while(--_0x3c74b9){_0x57574f['push'](_0x57574f['shift']());}};_0x43181e(++_0x18173d);}(_0x0bfc,0x8e));var _0xc0bf=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x0bfc[_0x5783f4];return _0x28e380;};'use strict';var Sequelize=require(_0xc0bf('0x0'));module['exports']={'name':{'type':Sequelize[_0xc0bf('0x1')]},'description':{'type':Sequelize[_0xc0bf('0x1')]}}; \ No newline at end of file +var _0x8092=['sequelize','exports','STRING'];(function(_0xecd01b,_0x35a6b1){var _0x473b85=function(_0x552f6a){while(--_0x552f6a){_0xecd01b['push'](_0xecd01b['shift']());}};_0x473b85(++_0x35a6b1);}(_0x8092,0x1b3));var _0x2809=function(_0x5e57cd,_0x486ece){_0x5e57cd=_0x5e57cd-0x0;var _0x3a96b2=_0x8092[_0x5e57cd];return _0x3a96b2;};'use strict';var Sequelize=require(_0x2809('0x0'));module[_0x2809('0x1')]={'name':{'type':Sequelize[_0x2809('0x2')]},'description':{'type':Sequelize[_0x2809('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 14d2ff7..42dbecd 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 _0x192e=['body','find','getFields','findOne','options','getSubjects','ServicenowField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','offset','count','set','Content-Range','apply','reject','save','then','name','send','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','catch','show','params','include','create','update'];(function(_0x334f61,_0x20cd4c){var _0x307da4=function(_0x516e0d){while(--_0x516e0d){_0x334f61['push'](_0x334f61['shift']());}};_0x307da4(++_0x20cd4c);}(_0x192e,0x150));var _0xe192=function(_0x4c9ffc,_0x13a899){_0x4c9ffc=_0x4c9ffc-0x0;var _0x2cd7e3=_0x192e[_0x4c9ffc];return _0x2cd7e3;};'use strict';var emlformat=require(_0xe192('0x0'));var rimraf=require(_0xe192('0x1'));var zipdir=require(_0xe192('0x2'));var jsonpatch=require(_0xe192('0x3'));var rp=require('request-promise');var moment=require(_0xe192('0x4'));var BPromise=require(_0xe192('0x5'));var Mustache=require(_0xe192('0x6'));var util=require(_0xe192('0x7'));var path=require('path');var sox=require(_0xe192('0x8'));var csv=require(_0xe192('0x9'));var ejs=require(_0xe192('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe192('0xb'));var squel=require(_0xe192('0xc'));var crypto=require(_0xe192('0xd'));var jsforce=require(_0xe192('0xe'));var deskjs=require(_0xe192('0xf'));var toCsv=require(_0xe192('0x9'));var querystring=require(_0xe192('0x10'));var Papa=require(_0xe192('0x11'));var Redis=require(_0xe192('0x12'));var authService=require(_0xe192('0x13'));var qs=require(_0xe192('0x14'));var as=require(_0xe192('0x15'));var hardwareService=require(_0xe192('0x16'));var logger=require(_0xe192('0x17'))(_0xe192('0x18'));var utils=require(_0xe192('0x19'));var config=require(_0xe192('0x1a'));var licenseUtil=require(_0xe192('0x1b'));var db=require(_0xe192('0x1c'))['db'];function respondWithStatusCode(_0x34d29d,_0x258950){_0x258950=_0x258950||0xcc;return function(_0x3fb60b){if(_0x3fb60b){return _0x34d29d[_0xe192('0x1d')](_0x258950);}return _0x34d29d[_0xe192('0x1e')](_0x258950)[_0xe192('0x1f')]();};}function respondWithResult(_0x590971,_0x12fd29){_0x12fd29=_0x12fd29||0xc8;return function(_0x272ba4){if(_0x272ba4){return _0x590971['status'](_0x12fd29)[_0xe192('0x20')](_0x272ba4);}};}function respondWithFilteredResult(_0x813bcf,_0x25ee5b){return function(_0x3c2505){if(_0x3c2505){var _0x1d42c5=typeof _0x25ee5b['offset']==='undefined'&&typeof _0x25ee5b[_0xe192('0x21')]==='undefined';var _0x593ecb=_0x3c2505['count'];var _0x219e60=_0x1d42c5?0x0:_0x25ee5b[_0xe192('0x22')];var _0x29b06d=_0x1d42c5?_0x3c2505[_0xe192('0x23')]:_0x25ee5b[_0xe192('0x22')]+_0x25ee5b[_0xe192('0x21')];var _0xa41d96;if(_0x29b06d>=_0x593ecb){_0x29b06d=_0x593ecb;_0xa41d96=0xc8;}else{_0xa41d96=0xce;}_0x813bcf[_0xe192('0x1e')](_0xa41d96);return _0x813bcf[_0xe192('0x24')](_0xe192('0x25'),_0x219e60+'-'+_0x29b06d+'/'+_0x593ecb)[_0xe192('0x20')](_0x3c2505);}return null;};}function patchUpdates(_0xb7016){return function(_0x5188c9){try{jsonpatch[_0xe192('0x26')](_0x5188c9,_0xb7016,!![]);}catch(_0x137868){return BPromise[_0xe192('0x27')](_0x137868);}return _0x5188c9[_0xe192('0x28')]();};}function saveUpdates(_0x36e72e,_0x14b890){return function(_0x25b1ba){if(_0x25b1ba){return _0x25b1ba['update'](_0x36e72e)[_0xe192('0x29')](function(_0x176667){return _0x176667;});}return null;};}function removeEntity(_0x20be70,_0x56a305){return function(_0xf81597){if(_0xf81597){return _0xf81597['destroy']()[_0xe192('0x29')](function(){_0x20be70[_0xe192('0x1e')](0xcc)[_0xe192('0x1f')]();});}};}function handleEntityNotFound(_0x7ad52f,_0x3744bf){return function(_0x15f0a7){if(!_0x15f0a7){_0x7ad52f['sendStatus'](0x194);}return _0x15f0a7;};}function handleError(_0x5ad33,_0x3cbca5){_0x3cbca5=_0x3cbca5||0x1f4;return function(_0x4cc0dd){logger['error'](_0x4cc0dd['stack']);if(_0x4cc0dd['name']){delete _0x4cc0dd[_0xe192('0x2a')];}_0x5ad33[_0xe192('0x1e')](_0x3cbca5)[_0xe192('0x2b')](_0x4cc0dd);};}exports['index']=function(_0x5b5add,_0x35c7a2){var _0x30d32f={},_0x4ddc9d={},_0x522449={'count':0x0,'rows':[]};var _0x359dea=_[_0xe192('0x2c')](db[_0xe192('0x2d')][_0xe192('0x2e')],function(_0x5ca829){return{'name':_0x5ca829[_0xe192('0x2f')],'type':_0x5ca829[_0xe192('0x30')][_0xe192('0x31')]};});_0x4ddc9d[_0xe192('0x32')]=_[_0xe192('0x2c')](_0x359dea,'name');_0x4ddc9d[_0xe192('0x33')]=_[_0xe192('0x34')](_0x5b5add[_0xe192('0x33')]);_0x4ddc9d[_0xe192('0x35')]=_[_0xe192('0x36')](_0x4ddc9d['model'],_0x4ddc9d[_0xe192('0x33')]);_0x30d32f[_0xe192('0x37')]=_['intersection'](_0x4ddc9d['model'],qs['fields'](_0x5b5add[_0xe192('0x33')][_0xe192('0x38')]));_0x30d32f['attributes']=_0x30d32f[_0xe192('0x37')][_0xe192('0x39')]?_0x30d32f[_0xe192('0x37')]:_0x4ddc9d[_0xe192('0x32')];if(!_0x5b5add[_0xe192('0x33')][_0xe192('0x3a')](_0xe192('0x3b'))){_0x30d32f[_0xe192('0x21')]=qs[_0xe192('0x21')](_0x5b5add['query']['limit']);_0x30d32f[_0xe192('0x22')]=qs[_0xe192('0x22')](_0x5b5add[_0xe192('0x33')]['offset']);}_0x30d32f[_0xe192('0x3c')]=qs[_0xe192('0x3d')](_0x5b5add['query'][_0xe192('0x3d')]);_0x30d32f[_0xe192('0x3e')]=qs[_0xe192('0x35')](_[_0xe192('0x3f')](_0x5b5add[_0xe192('0x33')],_0x4ddc9d[_0xe192('0x35')]),_0x359dea);if(_0x5b5add[_0xe192('0x33')][_0xe192('0x40')]){_0x30d32f['where']=_[_0xe192('0x41')](_0x30d32f['where'],{'$or':_[_0xe192('0x2c')](_0x359dea,function(_0x4cd402){if(_0x4cd402['type']!==_0xe192('0x42')){var _0x3c24a3={};_0x3c24a3[_0x4cd402['name']]={'$like':'%'+_0x5b5add[_0xe192('0x33')][_0xe192('0x40')]+'%'};return _0x3c24a3;}})});}_0x30d32f=_[_0xe192('0x41')]({},_0x30d32f,_0x5b5add['options']);var _0x1d33ec={'where':_0x30d32f[_0xe192('0x3e')]};return db[_0xe192('0x2d')][_0xe192('0x23')](_0x1d33ec)[_0xe192('0x29')](function(_0xd6afb7){_0x522449[_0xe192('0x23')]=_0xd6afb7;if(_0x5b5add['query']['includeAll']){_0x30d32f['include']=[{'all':!![]}];}return db[_0xe192('0x2d')][_0xe192('0x43')](_0x30d32f);})[_0xe192('0x29')](function(_0x2dbb4a){_0x522449['rows']=_0x2dbb4a;return _0x522449;})[_0xe192('0x29')](respondWithFilteredResult(_0x35c7a2,_0x30d32f))[_0xe192('0x44')](handleError(_0x35c7a2,null));};exports[_0xe192('0x45')]=function(_0x3f0b62,_0x3a2cbb){var _0x5055d0={'raw':![],'where':{'id':_0x3f0b62[_0xe192('0x46')]['id']}},_0x4b85b5={};_0x4b85b5['model']=_['keys'](db[_0xe192('0x2d')][_0xe192('0x2e')]);_0x4b85b5[_0xe192('0x33')]=_[_0xe192('0x34')](_0x3f0b62[_0xe192('0x33')]);_0x4b85b5[_0xe192('0x35')]=_['intersection'](_0x4b85b5[_0xe192('0x32')],_0x4b85b5['query']);_0x5055d0[_0xe192('0x37')]=_['intersection'](_0x4b85b5[_0xe192('0x32')],qs[_0xe192('0x38')](_0x3f0b62['query']['fields']));_0x5055d0[_0xe192('0x37')]=_0x5055d0['attributes']['length']?_0x5055d0[_0xe192('0x37')]:_0x4b85b5[_0xe192('0x32')];if(_0x3f0b62[_0xe192('0x33')]['includeAll']){_0x5055d0[_0xe192('0x47')]=[{'all':!![]}];}_0x5055d0=_[_0xe192('0x41')]({},_0x5055d0,_0x3f0b62['options']);return db[_0xe192('0x2d')]['find'](_0x5055d0)['then'](handleEntityNotFound(_0x3a2cbb,null))[_0xe192('0x29')](respondWithResult(_0x3a2cbb,null))[_0xe192('0x44')](handleError(_0x3a2cbb,null));};exports[_0xe192('0x48')]=function(_0x1407b3,_0x281b25){return db[_0xe192('0x2d')][_0xe192('0x48')](_0x1407b3['body'],{})[_0xe192('0x29')](respondWithResult(_0x281b25,0xc9))[_0xe192('0x44')](handleError(_0x281b25,null));};exports[_0xe192('0x49')]=function(_0x49c116,_0x5c6f22){if(_0x49c116[_0xe192('0x4a')]['id']){delete _0x49c116[_0xe192('0x4a')]['id'];}return db[_0xe192('0x2d')][_0xe192('0x4b')]({'where':{'id':_0x49c116[_0xe192('0x46')]['id']}})['then'](handleEntityNotFound(_0x5c6f22,null))[_0xe192('0x29')](saveUpdates(_0x49c116['body'],null))['then'](respondWithResult(_0x5c6f22,null))[_0xe192('0x44')](handleError(_0x5c6f22,null));};exports['destroy']=function(_0x51a090,_0x4e5f3e){return db['ServicenowConfiguration']['find']({'where':{'id':_0x51a090[_0xe192('0x46')]['id']}})['then'](handleEntityNotFound(_0x4e5f3e,null))[_0xe192('0x29')](removeEntity(_0x4e5f3e,null))['catch'](handleError(_0x4e5f3e,null));};exports[_0xe192('0x4c')]=function(_0x15ff68,_0x44b8d9,_0x53add7){var _0x1a2a40={};var _0x5b0715={};var _0x4d7eab;var _0x340c5d;return db['ServicenowConfiguration'][_0xe192('0x4d')]({'where':{'id':_0x15ff68[_0xe192('0x46')]['id']}})['then'](handleEntityNotFound(_0x44b8d9,null))[_0xe192('0x29')](function(_0x1795ec){if(_0x1795ec){_0x4d7eab=_0x1795ec;_0x5b0715[_0xe192('0x32')]=_['keys'](db['ServicenowField'][_0xe192('0x2e')]);_0x5b0715[_0xe192('0x33')]=_['keys'](_0x15ff68[_0xe192('0x33')]);_0x5b0715[_0xe192('0x35')]=_[_0xe192('0x36')](_0x5b0715[_0xe192('0x32')],_0x5b0715[_0xe192('0x33')]);_0x1a2a40[_0xe192('0x37')]=_[_0xe192('0x36')](_0x5b0715[_0xe192('0x32')],qs[_0xe192('0x38')](_0x15ff68[_0xe192('0x33')][_0xe192('0x38')]));_0x1a2a40[_0xe192('0x37')]=_0x1a2a40[_0xe192('0x37')][_0xe192('0x39')]?_0x1a2a40[_0xe192('0x37')]:_0x5b0715['model'];_0x1a2a40[_0xe192('0x3c')]=qs[_0xe192('0x3d')](_0x15ff68[_0xe192('0x33')][_0xe192('0x3d')]);_0x1a2a40[_0xe192('0x3e')]=qs[_0xe192('0x35')](_[_0xe192('0x3f')](_0x15ff68[_0xe192('0x33')],_0x5b0715[_0xe192('0x35')]));if(_0x15ff68[_0xe192('0x33')][_0xe192('0x40')]){_0x1a2a40['where']=_[_0xe192('0x41')](_0x1a2a40['where'],{'$or':_[_0xe192('0x2c')](_0x1a2a40[_0xe192('0x37')],function(_0xb6b562){var _0x1c319c={};_0x1c319c[_0xb6b562]={'$like':'%'+_0x15ff68[_0xe192('0x33')][_0xe192('0x40')]+'%'};return _0x1c319c;})});}_0x1a2a40=_[_0xe192('0x41')]({},_0x1a2a40,_0x15ff68[_0xe192('0x4e')]);return _0x4d7eab[_0xe192('0x4c')](_0x1a2a40);}})[_0xe192('0x29')](function(_0x350fef){if(_0x350fef){_0x340c5d=_0x350fef[_0xe192('0x39')];if(!_0x15ff68[_0xe192('0x33')][_0xe192('0x3a')](_0xe192('0x3b'))){_0x1a2a40[_0xe192('0x21')]=qs[_0xe192('0x21')](_0x15ff68[_0xe192('0x33')][_0xe192('0x21')]);_0x1a2a40['offset']=qs[_0xe192('0x22')](_0x15ff68[_0xe192('0x33')][_0xe192('0x22')]);}return _0x4d7eab[_0xe192('0x4c')](_0x1a2a40);}})[_0xe192('0x29')](function(_0x3c9945){if(_0x3c9945){return _0x3c9945?{'count':_0x340c5d,'rows':_0x3c9945}:null;}})[_0xe192('0x29')](respondWithResult(_0x44b8d9,null))[_0xe192('0x44')](handleError(_0x44b8d9,null));};exports[_0xe192('0x4f')]=function(_0x267dc6,_0x458c5e,_0x4e6bf5){var _0x19e2dd={};var _0x397364={};var _0xa33903;var _0x2e9303;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x267dc6[_0xe192('0x46')]['id']}})['then'](handleEntityNotFound(_0x458c5e,null))[_0xe192('0x29')](function(_0x65a809){if(_0x65a809){_0xa33903=_0x65a809;_0x397364[_0xe192('0x32')]=_[_0xe192('0x34')](db[_0xe192('0x50')]['rawAttributes']);_0x397364[_0xe192('0x33')]=_[_0xe192('0x34')](_0x267dc6[_0xe192('0x33')]);_0x397364['filters']=_[_0xe192('0x36')](_0x397364['model'],_0x397364[_0xe192('0x33')]);_0x19e2dd['attributes']=_[_0xe192('0x36')](_0x397364['model'],qs[_0xe192('0x38')](_0x267dc6[_0xe192('0x33')][_0xe192('0x38')]));_0x19e2dd[_0xe192('0x37')]=_0x19e2dd[_0xe192('0x37')][_0xe192('0x39')]?_0x19e2dd['attributes']:_0x397364[_0xe192('0x32')];_0x19e2dd[_0xe192('0x3c')]=qs[_0xe192('0x3d')](_0x267dc6['query']['sort']);_0x19e2dd[_0xe192('0x3e')]=qs[_0xe192('0x35')](_[_0xe192('0x3f')](_0x267dc6['query'],_0x397364['filters']));if(_0x267dc6[_0xe192('0x33')][_0xe192('0x40')]){_0x19e2dd['where']=_[_0xe192('0x41')](_0x19e2dd[_0xe192('0x3e')],{'$or':_[_0xe192('0x2c')](_0x19e2dd['attributes'],function(_0x6db049){var _0x53bfd5={};_0x53bfd5[_0x6db049]={'$like':'%'+_0x267dc6[_0xe192('0x33')][_0xe192('0x40')]+'%'};return _0x53bfd5;})});}_0x19e2dd=_['merge']({},_0x19e2dd,_0x267dc6[_0xe192('0x4e')]);return _0xa33903[_0xe192('0x4f')](_0x19e2dd);}})[_0xe192('0x29')](function(_0xcc6ec5){if(_0xcc6ec5){_0x2e9303=_0xcc6ec5[_0xe192('0x39')];if(!_0x267dc6[_0xe192('0x33')]['hasOwnProperty'](_0xe192('0x3b'))){_0x19e2dd[_0xe192('0x21')]=qs[_0xe192('0x21')](_0x267dc6[_0xe192('0x33')][_0xe192('0x21')]);_0x19e2dd[_0xe192('0x22')]=qs[_0xe192('0x22')](_0x267dc6[_0xe192('0x33')][_0xe192('0x22')]);}return _0xa33903[_0xe192('0x4f')](_0x19e2dd);}})['then'](function(_0xd0dcde){if(_0xd0dcde){return _0xd0dcde?{'count':_0x2e9303,'rows':_0xd0dcde}:null;}})['then'](respondWithResult(_0x458c5e,null))[_0xe192('0x44')](handleError(_0x458c5e,null));};exports['getDescriptions']=function(_0xa40511,_0x1cb9ef,_0x15ccdb){var _0x57a694={};var _0x1cae74={};var _0x1930a5;var _0x40d6ee;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0xa40511[_0xe192('0x46')]['id']}})[_0xe192('0x29')](handleEntityNotFound(_0x1cb9ef,null))[_0xe192('0x29')](function(_0x4c9594){if(_0x4c9594){_0x1930a5=_0x4c9594;_0x1cae74[_0xe192('0x32')]=_[_0xe192('0x34')](db['ServicenowField'][_0xe192('0x2e')]);_0x1cae74[_0xe192('0x33')]=_['keys'](_0xa40511['query']);_0x1cae74['filters']=_[_0xe192('0x36')](_0x1cae74[_0xe192('0x32')],_0x1cae74['query']);_0x57a694[_0xe192('0x37')]=_[_0xe192('0x36')](_0x1cae74[_0xe192('0x32')],qs['fields'](_0xa40511[_0xe192('0x33')][_0xe192('0x38')]));_0x57a694[_0xe192('0x37')]=_0x57a694[_0xe192('0x37')][_0xe192('0x39')]?_0x57a694[_0xe192('0x37')]:_0x1cae74[_0xe192('0x32')];_0x57a694[_0xe192('0x3c')]=qs[_0xe192('0x3d')](_0xa40511[_0xe192('0x33')][_0xe192('0x3d')]);_0x57a694[_0xe192('0x3e')]=qs[_0xe192('0x35')](_[_0xe192('0x3f')](_0xa40511['query'],_0x1cae74[_0xe192('0x35')]));if(_0xa40511['query'][_0xe192('0x40')]){_0x57a694['where']=_[_0xe192('0x41')](_0x57a694[_0xe192('0x3e')],{'$or':_[_0xe192('0x2c')](_0x57a694[_0xe192('0x37')],function(_0x18699d){var _0x13b720={};_0x13b720[_0x18699d]={'$like':'%'+_0xa40511['query'][_0xe192('0x40')]+'%'};return _0x13b720;})});}_0x57a694=_[_0xe192('0x41')]({},_0x57a694,_0xa40511[_0xe192('0x4e')]);return _0x1930a5[_0xe192('0x51')](_0x57a694);}})[_0xe192('0x29')](function(_0x34fcac){if(_0x34fcac){_0x40d6ee=_0x34fcac[_0xe192('0x39')];if(!_0xa40511[_0xe192('0x33')]['hasOwnProperty']('nolimit')){_0x57a694[_0xe192('0x21')]=qs[_0xe192('0x21')](_0xa40511[_0xe192('0x33')][_0xe192('0x21')]);_0x57a694['offset']=qs[_0xe192('0x22')](_0xa40511[_0xe192('0x33')]['offset']);}return _0x1930a5[_0xe192('0x51')](_0x57a694);}})[_0xe192('0x29')](function(_0x36ab7c){if(_0x36ab7c){return _0x36ab7c?{'count':_0x40d6ee,'rows':_0x36ab7c}:null;}})[_0xe192('0x29')](respondWithResult(_0x1cb9ef,null))['catch'](handleError(_0x1cb9ef,null));}; \ No newline at end of file +var _0xd254=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','getFields','findOne','getSubjects','ServicenowField','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','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/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','then','error','name','send','index','map','ServicenowConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x312b06,_0x5ad05e){var _0x54dd60=function(_0x837599){while(--_0x837599){_0x312b06['push'](_0x312b06['shift']());}};_0x54dd60(++_0x5ad05e);}(_0xd254,0x6d));var _0x4d25=function(_0x49d7b3,_0x2755b2){_0x49d7b3=_0x49d7b3-0x0;var _0x184323=_0xd254[_0x49d7b3];return _0x184323;};'use strict';var emlformat=require(_0x4d25('0x0'));var rimraf=require(_0x4d25('0x1'));var zipdir=require(_0x4d25('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4d25('0x3'));var moment=require(_0x4d25('0x4'));var BPromise=require(_0x4d25('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4d25('0x6'));var sox=require(_0x4d25('0x7'));var csv=require(_0x4d25('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4d25('0x9'));var _=require(_0x4d25('0xa'));var squel=require(_0x4d25('0xb'));var crypto=require(_0x4d25('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4d25('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4d25('0xe'));var Redis=require(_0x4d25('0xf'));var authService=require(_0x4d25('0x10'));var qs=require(_0x4d25('0x11'));var as=require(_0x4d25('0x12'));var hardwareService=require(_0x4d25('0x13'));var logger=require(_0x4d25('0x14'))(_0x4d25('0x15'));var utils=require('../../config/utils');var config=require(_0x4d25('0x16'));var licenseUtil=require(_0x4d25('0x17'));var db=require(_0x4d25('0x18'))['db'];function respondWithStatusCode(_0x5e04cc,_0x4bb5ef){_0x4bb5ef=_0x4bb5ef||0xcc;return function(_0x1a1f22){if(_0x1a1f22){return _0x5e04cc[_0x4d25('0x19')](_0x4bb5ef);}return _0x5e04cc['status'](_0x4bb5ef)[_0x4d25('0x1a')]();};}function respondWithResult(_0x1dad2d,_0x55085a){_0x55085a=_0x55085a||0xc8;return function(_0x3ec07c){if(_0x3ec07c){return _0x1dad2d['status'](_0x55085a)[_0x4d25('0x1b')](_0x3ec07c);}};}function respondWithFilteredResult(_0x140707,_0x5db1d2){return function(_0x61f1dd){if(_0x61f1dd){var _0x50c320=typeof _0x5db1d2[_0x4d25('0x1c')]===_0x4d25('0x1d')&&typeof _0x5db1d2[_0x4d25('0x1e')]===_0x4d25('0x1d');var _0x4e2e4e=_0x61f1dd[_0x4d25('0x1f')];var _0x29020a=_0x50c320?0x0:_0x5db1d2[_0x4d25('0x1c')];var _0x32e191=_0x50c320?_0x61f1dd[_0x4d25('0x1f')]:_0x5db1d2['offset']+_0x5db1d2[_0x4d25('0x1e')];var _0x68a46e;if(_0x32e191>=_0x4e2e4e){_0x32e191=_0x4e2e4e;_0x68a46e=0xc8;}else{_0x68a46e=0xce;}_0x140707[_0x4d25('0x20')](_0x68a46e);return _0x140707[_0x4d25('0x21')](_0x4d25('0x22'),_0x29020a+'-'+_0x32e191+'/'+_0x4e2e4e)[_0x4d25('0x1b')](_0x61f1dd);}return null;};}function patchUpdates(_0x128534){return function(_0x172408){try{jsonpatch['apply'](_0x172408,_0x128534,!![]);}catch(_0x3558cb){return BPromise[_0x4d25('0x23')](_0x3558cb);}return _0x172408[_0x4d25('0x24')]();};}function saveUpdates(_0x5497d1,_0x4d3d8e){return function(_0xf1caf4){if(_0xf1caf4){return _0xf1caf4['update'](_0x5497d1)[_0x4d25('0x25')](function(_0x405e2f){return _0x405e2f;});}return null;};}function removeEntity(_0x3607b0,_0x19c549){return function(_0x5e1946){if(_0x5e1946){return _0x5e1946['destroy']()['then'](function(){_0x3607b0['status'](0xcc)[_0x4d25('0x1a')]();});}};}function handleEntityNotFound(_0x1487ce,_0x5ec841){return function(_0x1f8a5c){if(!_0x1f8a5c){_0x1487ce[_0x4d25('0x19')](0x194);}return _0x1f8a5c;};}function handleError(_0x433b53,_0x1e0a86){_0x1e0a86=_0x1e0a86||0x1f4;return function(_0x589ea8){logger[_0x4d25('0x26')](_0x589ea8['stack']);if(_0x589ea8[_0x4d25('0x27')]){delete _0x589ea8[_0x4d25('0x27')];}_0x433b53[_0x4d25('0x20')](_0x1e0a86)[_0x4d25('0x28')](_0x589ea8);};}exports[_0x4d25('0x29')]=function(_0x14d67b,_0x18f847){var _0x44ccaf={},_0x127198={},_0x1ad7d3={'count':0x0,'rows':[]};var _0x17e789=_[_0x4d25('0x2a')](db[_0x4d25('0x2b')][_0x4d25('0x2c')],function(_0x2ee6d1){return{'name':_0x2ee6d1['fieldName'],'type':_0x2ee6d1[_0x4d25('0x2d')][_0x4d25('0x2e')]};});_0x127198[_0x4d25('0x2f')]=_[_0x4d25('0x2a')](_0x17e789,_0x4d25('0x27'));_0x127198[_0x4d25('0x30')]=_[_0x4d25('0x31')](_0x14d67b[_0x4d25('0x30')]);_0x127198[_0x4d25('0x32')]=_[_0x4d25('0x33')](_0x127198[_0x4d25('0x2f')],_0x127198[_0x4d25('0x30')]);_0x44ccaf[_0x4d25('0x34')]=_[_0x4d25('0x33')](_0x127198['model'],qs[_0x4d25('0x35')](_0x14d67b[_0x4d25('0x30')][_0x4d25('0x35')]));_0x44ccaf[_0x4d25('0x34')]=_0x44ccaf['attributes'][_0x4d25('0x36')]?_0x44ccaf['attributes']:_0x127198[_0x4d25('0x2f')];if(!_0x14d67b[_0x4d25('0x30')][_0x4d25('0x37')](_0x4d25('0x38'))){_0x44ccaf['limit']=qs[_0x4d25('0x1e')](_0x14d67b[_0x4d25('0x30')]['limit']);_0x44ccaf[_0x4d25('0x1c')]=qs[_0x4d25('0x1c')](_0x14d67b[_0x4d25('0x30')][_0x4d25('0x1c')]);}_0x44ccaf[_0x4d25('0x39')]=qs[_0x4d25('0x3a')](_0x14d67b[_0x4d25('0x30')]['sort']);_0x44ccaf[_0x4d25('0x3b')]=qs[_0x4d25('0x32')](_[_0x4d25('0x3c')](_0x14d67b['query'],_0x127198['filters']),_0x17e789);if(_0x14d67b['query'][_0x4d25('0x3d')]){_0x44ccaf[_0x4d25('0x3b')]=_['merge'](_0x44ccaf[_0x4d25('0x3b')],{'$or':_['map'](_0x17e789,function(_0x53def0){if(_0x53def0[_0x4d25('0x2d')]!==_0x4d25('0x3e')){var _0x29cd69={};_0x29cd69[_0x53def0[_0x4d25('0x27')]]={'$like':'%'+_0x14d67b['query'][_0x4d25('0x3d')]+'%'};return _0x29cd69;}})});}_0x44ccaf=_[_0x4d25('0x3f')]({},_0x44ccaf,_0x14d67b[_0x4d25('0x40')]);var _0x56d364={'where':_0x44ccaf[_0x4d25('0x3b')]};return db[_0x4d25('0x2b')][_0x4d25('0x1f')](_0x56d364)[_0x4d25('0x25')](function(_0x3c858c){_0x1ad7d3['count']=_0x3c858c;if(_0x14d67b[_0x4d25('0x30')][_0x4d25('0x41')]){_0x44ccaf[_0x4d25('0x42')]=[{'all':!![]}];}return db[_0x4d25('0x2b')][_0x4d25('0x43')](_0x44ccaf);})[_0x4d25('0x25')](function(_0x1a85be){_0x1ad7d3[_0x4d25('0x44')]=_0x1a85be;return _0x1ad7d3;})[_0x4d25('0x25')](respondWithFilteredResult(_0x18f847,_0x44ccaf))[_0x4d25('0x45')](handleError(_0x18f847,null));};exports[_0x4d25('0x46')]=function(_0xd1659a,_0x1ec880){var _0x17281c={'raw':![],'where':{'id':_0xd1659a[_0x4d25('0x47')]['id']}},_0xb9b89e={};_0xb9b89e[_0x4d25('0x2f')]=_[_0x4d25('0x31')](db[_0x4d25('0x2b')][_0x4d25('0x2c')]);_0xb9b89e[_0x4d25('0x30')]=_[_0x4d25('0x31')](_0xd1659a[_0x4d25('0x30')]);_0xb9b89e[_0x4d25('0x32')]=_[_0x4d25('0x33')](_0xb9b89e[_0x4d25('0x2f')],_0xb9b89e[_0x4d25('0x30')]);_0x17281c[_0x4d25('0x34')]=_[_0x4d25('0x33')](_0xb9b89e[_0x4d25('0x2f')],qs[_0x4d25('0x35')](_0xd1659a[_0x4d25('0x30')]['fields']));_0x17281c['attributes']=_0x17281c[_0x4d25('0x34')][_0x4d25('0x36')]?_0x17281c[_0x4d25('0x34')]:_0xb9b89e[_0x4d25('0x2f')];if(_0xd1659a[_0x4d25('0x30')][_0x4d25('0x41')]){_0x17281c[_0x4d25('0x42')]=[{'all':!![]}];}_0x17281c=_[_0x4d25('0x3f')]({},_0x17281c,_0xd1659a[_0x4d25('0x40')]);return db[_0x4d25('0x2b')][_0x4d25('0x48')](_0x17281c)[_0x4d25('0x25')](handleEntityNotFound(_0x1ec880,null))[_0x4d25('0x25')](respondWithResult(_0x1ec880,null))['catch'](handleError(_0x1ec880,null));};exports[_0x4d25('0x49')]=function(_0x4397df,_0x2893e7){return db[_0x4d25('0x2b')][_0x4d25('0x49')](_0x4397df[_0x4d25('0x4a')],{})['then'](respondWithResult(_0x2893e7,0xc9))['catch'](handleError(_0x2893e7,null));};exports[_0x4d25('0x4b')]=function(_0x37981a,_0x10cab3){if(_0x37981a[_0x4d25('0x4a')]['id']){delete _0x37981a[_0x4d25('0x4a')]['id'];}return db[_0x4d25('0x2b')]['find']({'where':{'id':_0x37981a[_0x4d25('0x47')]['id']}})['then'](handleEntityNotFound(_0x10cab3,null))[_0x4d25('0x25')](saveUpdates(_0x37981a[_0x4d25('0x4a')],null))['then'](respondWithResult(_0x10cab3,null))[_0x4d25('0x45')](handleError(_0x10cab3,null));};exports['destroy']=function(_0x1cca13,_0x4e424b){return db['ServicenowConfiguration']['find']({'where':{'id':_0x1cca13[_0x4d25('0x47')]['id']}})[_0x4d25('0x25')](handleEntityNotFound(_0x4e424b,null))[_0x4d25('0x25')](removeEntity(_0x4e424b,null))['catch'](handleError(_0x4e424b,null));};exports[_0x4d25('0x4c')]=function(_0x56137d,_0x505aef,_0x19beca){var _0x397090={};var _0x924fb1={};var _0x16ccd4;var _0x397940;return db[_0x4d25('0x2b')][_0x4d25('0x4d')]({'where':{'id':_0x56137d['params']['id']}})[_0x4d25('0x25')](handleEntityNotFound(_0x505aef,null))[_0x4d25('0x25')](function(_0x3d8a81){if(_0x3d8a81){_0x16ccd4=_0x3d8a81;_0x924fb1[_0x4d25('0x2f')]=_[_0x4d25('0x31')](db['ServicenowField'][_0x4d25('0x2c')]);_0x924fb1[_0x4d25('0x30')]=_[_0x4d25('0x31')](_0x56137d[_0x4d25('0x30')]);_0x924fb1[_0x4d25('0x32')]=_[_0x4d25('0x33')](_0x924fb1['model'],_0x924fb1['query']);_0x397090[_0x4d25('0x34')]=_[_0x4d25('0x33')](_0x924fb1[_0x4d25('0x2f')],qs[_0x4d25('0x35')](_0x56137d[_0x4d25('0x30')][_0x4d25('0x35')]));_0x397090[_0x4d25('0x34')]=_0x397090[_0x4d25('0x34')][_0x4d25('0x36')]?_0x397090[_0x4d25('0x34')]:_0x924fb1[_0x4d25('0x2f')];_0x397090[_0x4d25('0x39')]=qs[_0x4d25('0x3a')](_0x56137d[_0x4d25('0x30')][_0x4d25('0x3a')]);_0x397090['where']=qs[_0x4d25('0x32')](_[_0x4d25('0x3c')](_0x56137d[_0x4d25('0x30')],_0x924fb1['filters']));if(_0x56137d['query'][_0x4d25('0x3d')]){_0x397090[_0x4d25('0x3b')]=_['merge'](_0x397090[_0x4d25('0x3b')],{'$or':_[_0x4d25('0x2a')](_0x397090[_0x4d25('0x34')],function(_0x56f82a){var _0x331d27={};_0x331d27[_0x56f82a]={'$like':'%'+_0x56137d[_0x4d25('0x30')]['filter']+'%'};return _0x331d27;})});}_0x397090=_[_0x4d25('0x3f')]({},_0x397090,_0x56137d['options']);return _0x16ccd4[_0x4d25('0x4c')](_0x397090);}})['then'](function(_0x53be1b){if(_0x53be1b){_0x397940=_0x53be1b[_0x4d25('0x36')];if(!_0x56137d[_0x4d25('0x30')][_0x4d25('0x37')](_0x4d25('0x38'))){_0x397090[_0x4d25('0x1e')]=qs[_0x4d25('0x1e')](_0x56137d[_0x4d25('0x30')][_0x4d25('0x1e')]);_0x397090[_0x4d25('0x1c')]=qs[_0x4d25('0x1c')](_0x56137d['query'][_0x4d25('0x1c')]);}return _0x16ccd4[_0x4d25('0x4c')](_0x397090);}})[_0x4d25('0x25')](function(_0x3a5caa){if(_0x3a5caa){return _0x3a5caa?{'count':_0x397940,'rows':_0x3a5caa}:null;}})['then'](respondWithResult(_0x505aef,null))[_0x4d25('0x45')](handleError(_0x505aef,null));};exports[_0x4d25('0x4e')]=function(_0x18310d,_0x1a3f4c,_0x4fee60){var _0x5313e5={};var _0x69ed76={};var _0xe2647;var _0xea141a;return db[_0x4d25('0x2b')]['findOne']({'where':{'id':_0x18310d[_0x4d25('0x47')]['id']}})[_0x4d25('0x25')](handleEntityNotFound(_0x1a3f4c,null))[_0x4d25('0x25')](function(_0x1aa65b){if(_0x1aa65b){_0xe2647=_0x1aa65b;_0x69ed76[_0x4d25('0x2f')]=_['keys'](db[_0x4d25('0x4f')][_0x4d25('0x2c')]);_0x69ed76['query']=_[_0x4d25('0x31')](_0x18310d['query']);_0x69ed76[_0x4d25('0x32')]=_[_0x4d25('0x33')](_0x69ed76[_0x4d25('0x2f')],_0x69ed76[_0x4d25('0x30')]);_0x5313e5[_0x4d25('0x34')]=_[_0x4d25('0x33')](_0x69ed76[_0x4d25('0x2f')],qs[_0x4d25('0x35')](_0x18310d[_0x4d25('0x30')][_0x4d25('0x35')]));_0x5313e5[_0x4d25('0x34')]=_0x5313e5[_0x4d25('0x34')]['length']?_0x5313e5[_0x4d25('0x34')]:_0x69ed76[_0x4d25('0x2f')];_0x5313e5[_0x4d25('0x39')]=qs[_0x4d25('0x3a')](_0x18310d['query'][_0x4d25('0x3a')]);_0x5313e5[_0x4d25('0x3b')]=qs[_0x4d25('0x32')](_[_0x4d25('0x3c')](_0x18310d['query'],_0x69ed76[_0x4d25('0x32')]));if(_0x18310d[_0x4d25('0x30')][_0x4d25('0x3d')]){_0x5313e5[_0x4d25('0x3b')]=_[_0x4d25('0x3f')](_0x5313e5[_0x4d25('0x3b')],{'$or':_[_0x4d25('0x2a')](_0x5313e5['attributes'],function(_0x5f4679){var _0x59788d={};_0x59788d[_0x5f4679]={'$like':'%'+_0x18310d[_0x4d25('0x30')][_0x4d25('0x3d')]+'%'};return _0x59788d;})});}_0x5313e5=_[_0x4d25('0x3f')]({},_0x5313e5,_0x18310d[_0x4d25('0x40')]);return _0xe2647[_0x4d25('0x4e')](_0x5313e5);}})[_0x4d25('0x25')](function(_0x3c9e39){if(_0x3c9e39){_0xea141a=_0x3c9e39[_0x4d25('0x36')];if(!_0x18310d['query'][_0x4d25('0x37')](_0x4d25('0x38'))){_0x5313e5[_0x4d25('0x1e')]=qs[_0x4d25('0x1e')](_0x18310d[_0x4d25('0x30')]['limit']);_0x5313e5[_0x4d25('0x1c')]=qs['offset'](_0x18310d['query'][_0x4d25('0x1c')]);}return _0xe2647['getSubjects'](_0x5313e5);}})[_0x4d25('0x25')](function(_0x25c96e){if(_0x25c96e){return _0x25c96e?{'count':_0xea141a,'rows':_0x25c96e}:null;}})[_0x4d25('0x25')](respondWithResult(_0x1a3f4c,null))[_0x4d25('0x45')](handleError(_0x1a3f4c,null));};exports[_0x4d25('0x50')]=function(_0xe24e85,_0xc7f2e5,_0x3466ed){var _0x2d448a={};var _0x48fc28={};var _0x5d9114;var _0x3a983a;return db[_0x4d25('0x2b')]['findOne']({'where':{'id':_0xe24e85[_0x4d25('0x47')]['id']}})[_0x4d25('0x25')](handleEntityNotFound(_0xc7f2e5,null))[_0x4d25('0x25')](function(_0x16c891){if(_0x16c891){_0x5d9114=_0x16c891;_0x48fc28['model']=_['keys'](db[_0x4d25('0x4f')]['rawAttributes']);_0x48fc28[_0x4d25('0x30')]=_[_0x4d25('0x31')](_0xe24e85['query']);_0x48fc28[_0x4d25('0x32')]=_['intersection'](_0x48fc28[_0x4d25('0x2f')],_0x48fc28[_0x4d25('0x30')]);_0x2d448a[_0x4d25('0x34')]=_[_0x4d25('0x33')](_0x48fc28[_0x4d25('0x2f')],qs['fields'](_0xe24e85[_0x4d25('0x30')]['fields']));_0x2d448a['attributes']=_0x2d448a[_0x4d25('0x34')][_0x4d25('0x36')]?_0x2d448a[_0x4d25('0x34')]:_0x48fc28[_0x4d25('0x2f')];_0x2d448a['order']=qs[_0x4d25('0x3a')](_0xe24e85[_0x4d25('0x30')][_0x4d25('0x3a')]);_0x2d448a['where']=qs[_0x4d25('0x32')](_[_0x4d25('0x3c')](_0xe24e85[_0x4d25('0x30')],_0x48fc28[_0x4d25('0x32')]));if(_0xe24e85[_0x4d25('0x30')]['filter']){_0x2d448a[_0x4d25('0x3b')]=_[_0x4d25('0x3f')](_0x2d448a[_0x4d25('0x3b')],{'$or':_['map'](_0x2d448a[_0x4d25('0x34')],function(_0xf3a26d){var _0x2f1207={};_0x2f1207[_0xf3a26d]={'$like':'%'+_0xe24e85['query'][_0x4d25('0x3d')]+'%'};return _0x2f1207;})});}_0x2d448a=_[_0x4d25('0x3f')]({},_0x2d448a,_0xe24e85['options']);return _0x5d9114['getDescriptions'](_0x2d448a);}})['then'](function(_0x2bf803){if(_0x2bf803){_0x3a983a=_0x2bf803[_0x4d25('0x36')];if(!_0xe24e85[_0x4d25('0x30')][_0x4d25('0x37')](_0x4d25('0x38'))){_0x2d448a['limit']=qs[_0x4d25('0x1e')](_0xe24e85['query']['limit']);_0x2d448a['offset']=qs['offset'](_0xe24e85[_0x4d25('0x30')]['offset']);}return _0x5d9114[_0x4d25('0x50')](_0x2d448a);}})[_0x4d25('0x25')](function(_0xc57840){if(_0xc57840){return _0xc57840?{'count':_0x3a983a,'rows':_0xc57840}:null;}})[_0x4d25('0x25')](respondWithResult(_0xc7f2e5,null))['catch'](handleError(_0xc7f2e5,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 85c4194..bebafd6 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 _0x0c19=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x0c19,0xf5));var _0x90c1=function(_0x45f1d2,_0x2cd945){_0x45f1d2=_0x45f1d2-0x0;var _0x42cc6e=_0x0c19[_0x45f1d2];return _0x42cc6e;};'use strict';var _=require(_0x90c1('0x0'));var util=require(_0x90c1('0x1'));var logger=require(_0x90c1('0x2'))(_0x90c1('0x3'));var moment=require(_0x90c1('0x4'));var BPromise=require(_0x90c1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x90c1('0x6'));var rimraf=require(_0x90c1('0x7'));var config=require(_0x90c1('0x8'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x90c1('0x9')]=function(_0xb605b6,_0x5434a1){return _0xb605b6[_0x90c1('0xa')](_0x90c1('0xb'),attributes,{'tableName':_0x90c1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaebd=['moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','lodash','../../config/logger','api'];(function(_0x5a4e5f,_0x4d97bd){var _0x5cddff=function(_0x2a5a73){while(--_0x2a5a73){_0x5a4e5f['push'](_0x5a4e5f['shift']());}};_0x5cddff(++_0x4d97bd);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x43592c,_0x270707){_0x43592c=_0x43592c-0x0;var _0x18dca2=_0xaebd[_0x43592c];return _0x18dca2;};'use strict';var _=require(_0xdaeb('0x0'));var util=require('util');var logger=require(_0xdaeb('0x1'))(_0xdaeb('0x2'));var moment=require(_0xdaeb('0x3'));var BPromise=require(_0xdaeb('0x4'));var rp=require(_0xdaeb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdaeb('0x6'));var config=require(_0xdaeb('0x7'));var attributes=require(_0xdaeb('0x8'));module[_0xdaeb('0x9')]=function(_0xee94f9,_0x4b7255){return _0xee94f9[_0xdaeb('0xa')](_0xdaeb('0xb'),attributes,{'tableName':'int_servicenow_configurations','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 d3bb648..7bf2fdd 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 _0x0348=['ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x46d030,_0x26db8d){var _0x53fbab=function(_0x52cc63){while(--_0x52cc63){_0x46d030['push'](_0x46d030['shift']());}};_0x53fbab(++_0x26db8d);}(_0x0348,0x1e9));var _0x8034=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0x0348[_0xbeb808];return _0x5d6909;};'use strict';var _=require('lodash');var util=require(_0x8034('0x0'));var moment=require('moment');var BPromise=require(_0x8034('0x1'));var rs=require(_0x8034('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8034('0x3'))['db'];var utils=require(_0x8034('0x4'));var logger=require(_0x8034('0x5'))(_0x8034('0x6'));var config=require(_0x8034('0x7'));var jayson=require(_0x8034('0x8'));var client=jayson[_0x8034('0x9')][_0x8034('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5dfb10,_0x317fac,_0x1b9897){return new BPromise(function(_0x308814,_0x3ffa94){return client[_0x8034('0xb')](_0x5dfb10,_0x1b9897)[_0x8034('0xc')](function(_0x1ed3a9){logger[_0x8034('0xd')](_0x8034('0xe'),_0x317fac,_0x8034('0xf'));logger[_0x8034('0x10')](_0x8034('0x11'),_0x317fac,'request\x20sent',JSON[_0x8034('0x12')](_0x1ed3a9));if(_0x1ed3a9['error']){if(_0x1ed3a9[_0x8034('0x13')]['code']===0x1f4){logger[_0x8034('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x317fac,_0x1ed3a9['error'][_0x8034('0x14')]);return _0x3ffa94(_0x1ed3a9[_0x8034('0x13')][_0x8034('0x14')]);}logger['error'](_0x8034('0xe'),_0x317fac,_0x1ed3a9['error'][_0x8034('0x14')]);return _0x308814(_0x1ed3a9['error'][_0x8034('0x14')]);}else{logger[_0x8034('0xd')](_0x8034('0xe'),_0x317fac,_0x8034('0xf'));_0x308814(_0x1ed3a9['result']['message']);}})[_0x8034('0x15')](function(_0x40f002){logger[_0x8034('0x13')](_0x8034('0xe'),_0x317fac,_0x40f002);_0x3ffa94(_0x40f002);});});} \ No newline at end of file +var _0xde61=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x39d152,_0x59fb41){var _0x2d9fba=function(_0x3d4f28){while(--_0x3d4f28){_0x39d152['push'](_0x39d152['shift']());}};_0x2d9fba(++_0x59fb41);}(_0xde61,0x1cf));var _0x1de6=function(_0xe79212,_0x37f1b9){_0xe79212=_0xe79212-0x0;var _0x508219=_0xde61[_0xe79212];return _0x508219;};'use strict';var _=require(_0x1de6('0x0'));var util=require(_0x1de6('0x1'));var moment=require(_0x1de6('0x2'));var BPromise=require(_0x1de6('0x3'));var rs=require(_0x1de6('0x4'));var fs=require('fs');var Redis=require(_0x1de6('0x5'));var db=require(_0x1de6('0x6'))['db'];var utils=require(_0x1de6('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x1de6('0x8'));var jayson=require(_0x1de6('0x9'));var client=jayson[_0x1de6('0xa')][_0x1de6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f9474,_0x1fe533,_0x1a012b){return new BPromise(function(_0xb40ddb,_0x4436fb){return client[_0x1de6('0xc')](_0x1f9474,_0x1a012b)['then'](function(_0x281452){logger[_0x1de6('0xd')](_0x1de6('0xe'),_0x1fe533,'request\x20sent');logger['debug'](_0x1de6('0xf'),_0x1fe533,_0x1de6('0x10'),JSON[_0x1de6('0x11')](_0x281452));if(_0x281452[_0x1de6('0x12')]){if(_0x281452[_0x1de6('0x12')][_0x1de6('0x13')]===0x1f4){logger[_0x1de6('0x12')](_0x1de6('0xe'),_0x1fe533,_0x281452['error'][_0x1de6('0x14')]);return _0x4436fb(_0x281452[_0x1de6('0x12')][_0x1de6('0x14')]);}logger[_0x1de6('0x12')](_0x1de6('0xe'),_0x1fe533,_0x281452[_0x1de6('0x12')]['message']);return _0xb40ddb(_0x281452[_0x1de6('0x12')]['message']);}else{logger['info'](_0x1de6('0xe'),_0x1fe533,_0x1de6('0x10'));_0xb40ddb(_0x281452[_0x1de6('0x15')][_0x1de6('0x14')]);}})[_0x1de6('0x16')](function(_0x3b9b87){logger[_0x1de6('0x12')](_0x1de6('0xe'),_0x1fe533,_0x3b9b87);_0x4436fb(_0x3b9b87);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index c94dea8..6388a80 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 _0x6434=['put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./intServicenowField.controller','get','isAuthenticated','/:id','show','post','create'];(function(_0x44aae1,_0x4d2d0e){var _0x2b3bc2=function(_0x13b7b0){while(--_0x13b7b0){_0x44aae1['push'](_0x44aae1['shift']());}};_0x2b3bc2(++_0x4d2d0e);}(_0x6434,0x1c6));var _0x4643=function(_0xba0086,_0x1772ce){_0xba0086=_0xba0086-0x0;var _0x55cfd8=_0x6434[_0xba0086];return _0x55cfd8;};'use strict';var multer=require(_0x4643('0x0'));var util=require(_0x4643('0x1'));var path=require(_0x4643('0x2'));var timeout=require(_0x4643('0x3'));var express=require(_0x4643('0x4'));var router=express[_0x4643('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4643('0x6'));var config=require('../../config/environment');var controller=require(_0x4643('0x7'));router[_0x4643('0x8')]('/',auth[_0x4643('0x9')](),controller['index']);router['get'](_0x4643('0xa'),auth[_0x4643('0x9')](),controller[_0x4643('0xb')]);router[_0x4643('0xc')]('/',auth[_0x4643('0x9')](),controller[_0x4643('0xd')]);router[_0x4643('0xe')]('/:id',auth[_0x4643('0x9')](),controller[_0x4643('0xf')]);router[_0x4643('0x10')]('/:id',auth[_0x4643('0x9')](),controller[_0x4643('0x11')]);module['exports']=router; \ No newline at end of file +var _0xfcb6=['exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intServicenowField.controller','isAuthenticated','get','/:id','post','create','update','delete','destroy'];(function(_0x399319,_0x281986){var _0x2561cc=function(_0x167d6c){while(--_0x167d6c){_0x399319['push'](_0x399319['shift']());}};_0x2561cc(++_0x281986);}(_0xfcb6,0x1a1));var _0x6fcb=function(_0x49d19d,_0x245cf5){_0x49d19d=_0x49d19d-0x0;var _0x4ebef1=_0xfcb6[_0x49d19d];return _0x4ebef1;};'use strict';var multer=require('multer');var util=require(_0x6fcb('0x0'));var path=require('path');var timeout=require(_0x6fcb('0x1'));var express=require(_0x6fcb('0x2'));var router=express[_0x6fcb('0x3')]();var fs_extra=require(_0x6fcb('0x4'));var auth=require(_0x6fcb('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6fcb('0x6'));router['get']('/',auth[_0x6fcb('0x7')](),controller['index']);router[_0x6fcb('0x8')](_0x6fcb('0x9'),auth[_0x6fcb('0x7')](),controller['show']);router[_0x6fcb('0xa')]('/',auth[_0x6fcb('0x7')](),controller[_0x6fcb('0xb')]);router['put'](_0x6fcb('0x9'),auth[_0x6fcb('0x7')](),controller[_0x6fcb('0xc')]);router[_0x6fcb('0xd')](_0x6fcb('0x9'),auth[_0x6fcb('0x7')](),controller[_0x6fcb('0xe')]);module[_0x6fcb('0xf')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 30ef244..1012c14 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 _0x111a=['sequelize','exports','string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN'];(function(_0x533dea,_0x17e106){var _0x20c12d=function(_0x150db2){while(--_0x150db2){_0x533dea['push'](_0x533dea['shift']());}};_0x20c12d(++_0x17e106);}(_0x111a,0x14a));var _0xa111=function(_0x45de8c,_0x2fabc2){_0x45de8c=_0x45de8c-0x0;var _0x39b84b=_0x111a[_0x45de8c];return _0x39b84b;};'use strict';var Sequelize=require(_0xa111('0x0'));module[_0xa111('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa111('0x2'),_0xa111('0x3'),_0xa111('0x4'),_0xa111('0x5'),_0xa111('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xa111('0x7')]},'key':{'type':Sequelize[_0xa111('0x7')]},'keyType':{'type':Sequelize[_0xa111('0x8')](_0xa111('0x2'),_0xa111('0x3'),_0xa111('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xa111('0x7')]},'customField':{'type':Sequelize[_0xa111('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa111('0x7')]}}; \ No newline at end of file +var _0x4f11=['sequelize','exports','string','variable','customVariable','picklist','STRING','ENUM','BOOLEAN'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0x4f11,0x1a7));var _0x14f1=function(_0x2f1a76,_0x518ec9){_0x2f1a76=_0x2f1a76-0x0;var _0x1bd43f=_0x4f11[_0x2f1a76];return _0x1bd43f;};'use strict';var Sequelize=require(_0x14f1('0x0'));module[_0x14f1('0x1')]={'type':{'type':Sequelize['ENUM'](_0x14f1('0x2'),_0x14f1('0x3'),_0x14f1('0x4'),'keyValue',_0x14f1('0x5')),'defaultValue':_0x14f1('0x2')},'content':{'type':Sequelize[_0x14f1('0x6')]},'key':{'type':Sequelize[_0x14f1('0x6')]},'keyType':{'type':Sequelize[_0x14f1('0x7')]('string',_0x14f1('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x14f1('0x6')]},'idField':{'type':Sequelize[_0x14f1('0x6')]},'nameField':{'type':Sequelize[_0x14f1('0x6')]},'customField':{'type':Sequelize[_0x14f1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x14f1('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 6ef7cf6..e460625 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 _0x2e17=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','sendStatus','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','sort','filters','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','update','rimraf','zip-dir','fast-json-patch','mustache','path','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x17e74a,_0x26b6c1){var _0x3dd6c5=function(_0xf5b493){while(--_0xf5b493){_0x17e74a['push'](_0x17e74a['shift']());}};_0x3dd6c5(++_0x26b6c1);}(_0x2e17,0x84));var _0x72e1=function(_0x52085a,_0x3717ca){_0x52085a=_0x52085a-0x0;var _0x5afc1a=_0x2e17[_0x52085a];return _0x5afc1a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x72e1('0x0'));var zipdir=require(_0x72e1('0x1'));var jsonpatch=require(_0x72e1('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x72e1('0x3'));var util=require('util');var path=require(_0x72e1('0x4'));var sox=require('sox');var csv=require(_0x72e1('0x5'));var ejs=require(_0x72e1('0x6'));var fs=require('fs');var fs_extra=require(_0x72e1('0x7'));var _=require('lodash');var squel=require(_0x72e1('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x72e1('0x9'));var toCsv=require(_0x72e1('0x5'));var querystring=require(_0x72e1('0xa'));var Papa=require(_0x72e1('0xb'));var Redis=require(_0x72e1('0xc'));var authService=require(_0x72e1('0xd'));var qs=require(_0x72e1('0xe'));var as=require(_0x72e1('0xf'));var hardwareService=require(_0x72e1('0x10'));var logger=require(_0x72e1('0x11'))(_0x72e1('0x12'));var utils=require(_0x72e1('0x13'));var config=require(_0x72e1('0x14'));var licenseUtil=require(_0x72e1('0x15'));var db=require(_0x72e1('0x16'))['db'];function respondWithStatusCode(_0x5ddb75,_0x5a11d2){_0x5a11d2=_0x5a11d2||0xcc;return function(_0x1eef15){if(_0x1eef15){return _0x5ddb75['sendStatus'](_0x5a11d2);}return _0x5ddb75['status'](_0x5a11d2)[_0x72e1('0x17')]();};}function respondWithResult(_0x252fc2,_0x146f30){_0x146f30=_0x146f30||0xc8;return function(_0x335128){if(_0x335128){return _0x252fc2[_0x72e1('0x18')](_0x146f30)[_0x72e1('0x19')](_0x335128);}};}function respondWithFilteredResult(_0x5b5e7d,_0xb2c8cb){return function(_0x182354){if(_0x182354){var _0xa5c3d1=typeof _0xb2c8cb['offset']===_0x72e1('0x1a')&&typeof _0xb2c8cb[_0x72e1('0x1b')]==='undefined';var _0x4642d1=_0x182354[_0x72e1('0x1c')];var _0x50522a=_0xa5c3d1?0x0:_0xb2c8cb[_0x72e1('0x1d')];var _0x409fd6=_0xa5c3d1?_0x182354[_0x72e1('0x1c')]:_0xb2c8cb[_0x72e1('0x1d')]+_0xb2c8cb[_0x72e1('0x1b')];var _0x250a96;if(_0x409fd6>=_0x4642d1){_0x409fd6=_0x4642d1;_0x250a96=0xc8;}else{_0x250a96=0xce;}_0x5b5e7d[_0x72e1('0x18')](_0x250a96);return _0x5b5e7d[_0x72e1('0x1e')](_0x72e1('0x1f'),_0x50522a+'-'+_0x409fd6+'/'+_0x4642d1)['json'](_0x182354);}return null;};}function patchUpdates(_0x171126){return function(_0xb309e6){try{jsonpatch[_0x72e1('0x20')](_0xb309e6,_0x171126,!![]);}catch(_0x337333){return BPromise[_0x72e1('0x21')](_0x337333);}return _0xb309e6['save']();};}function saveUpdates(_0x439009,_0x230192){return function(_0x20c124){if(_0x20c124){return _0x20c124['update'](_0x439009)[_0x72e1('0x22')](function(_0x44dfc4){return _0x44dfc4;});}return null;};}function removeEntity(_0x200ac3,_0x4384bf){return function(_0x2fc8c2){if(_0x2fc8c2){return _0x2fc8c2[_0x72e1('0x23')]()[_0x72e1('0x22')](function(){_0x200ac3['status'](0xcc)[_0x72e1('0x17')]();});}};}function handleEntityNotFound(_0xf5887e,_0x5c99b1){return function(_0x4c9375){if(!_0x4c9375){_0xf5887e[_0x72e1('0x24')](0x194);}return _0x4c9375;};}function handleError(_0x12aca1,_0x37f1df){_0x37f1df=_0x37f1df||0x1f4;return function(_0x3de14b){logger[_0x72e1('0x25')](_0x3de14b[_0x72e1('0x26')]);if(_0x3de14b[_0x72e1('0x27')]){delete _0x3de14b['name'];}_0x12aca1['status'](_0x37f1df)[_0x72e1('0x28')](_0x3de14b);};}exports[_0x72e1('0x29')]=function(_0x4064b4,_0x442ec2){var _0x23f4d0={},_0x4a11d0={},_0x3c084b={'count':0x0,'rows':[]};var _0x6582d=_[_0x72e1('0x2a')](db[_0x72e1('0x2b')][_0x72e1('0x2c')],function(_0x27f955){return{'name':_0x27f955[_0x72e1('0x2d')],'type':_0x27f955[_0x72e1('0x2e')][_0x72e1('0x2f')]};});_0x4a11d0[_0x72e1('0x30')]=_[_0x72e1('0x2a')](_0x6582d,_0x72e1('0x27'));_0x4a11d0['query']=_[_0x72e1('0x31')](_0x4064b4[_0x72e1('0x32')]);_0x4a11d0['filters']=_[_0x72e1('0x33')](_0x4a11d0[_0x72e1('0x30')],_0x4a11d0[_0x72e1('0x32')]);_0x23f4d0[_0x72e1('0x34')]=_['intersection'](_0x4a11d0['model'],qs[_0x72e1('0x35')](_0x4064b4[_0x72e1('0x32')][_0x72e1('0x35')]));_0x23f4d0['attributes']=_0x23f4d0[_0x72e1('0x34')][_0x72e1('0x36')]?_0x23f4d0['attributes']:_0x4a11d0[_0x72e1('0x30')];if(!_0x4064b4[_0x72e1('0x32')]['hasOwnProperty']('nolimit')){_0x23f4d0[_0x72e1('0x1b')]=qs[_0x72e1('0x1b')](_0x4064b4[_0x72e1('0x32')]['limit']);_0x23f4d0['offset']=qs['offset'](_0x4064b4['query'][_0x72e1('0x1d')]);}_0x23f4d0['order']=qs[_0x72e1('0x37')](_0x4064b4[_0x72e1('0x32')]['sort']);_0x23f4d0['where']=qs[_0x72e1('0x38')](_[_0x72e1('0x39')](_0x4064b4[_0x72e1('0x32')],_0x4a11d0[_0x72e1('0x38')]),_0x6582d);if(_0x4064b4[_0x72e1('0x32')]['filter']){_0x23f4d0[_0x72e1('0x3a')]=_[_0x72e1('0x3b')](_0x23f4d0['where'],{'$or':_[_0x72e1('0x2a')](_0x6582d,function(_0x2417ae){if(_0x2417ae[_0x72e1('0x2e')]!==_0x72e1('0x3c')){var _0x31091c={};_0x31091c[_0x2417ae[_0x72e1('0x27')]]={'$like':'%'+_0x4064b4[_0x72e1('0x32')][_0x72e1('0x3d')]+'%'};return _0x31091c;}})});}_0x23f4d0=_[_0x72e1('0x3b')]({},_0x23f4d0,_0x4064b4[_0x72e1('0x3e')]);var _0x112974={'where':_0x23f4d0['where']};return db['ServicenowField']['count'](_0x112974)[_0x72e1('0x22')](function(_0x235114){_0x3c084b[_0x72e1('0x1c')]=_0x235114;if(_0x4064b4[_0x72e1('0x32')]['includeAll']){_0x23f4d0[_0x72e1('0x3f')]=[{'all':!![]}];}return db[_0x72e1('0x2b')][_0x72e1('0x40')](_0x23f4d0);})['then'](function(_0x55ad58){_0x3c084b[_0x72e1('0x41')]=_0x55ad58;return _0x3c084b;})[_0x72e1('0x22')](respondWithFilteredResult(_0x442ec2,_0x23f4d0))[_0x72e1('0x42')](handleError(_0x442ec2,null));};exports[_0x72e1('0x43')]=function(_0x56cde9,_0x1ba87a){var _0x394914={'raw':!![],'where':{'id':_0x56cde9[_0x72e1('0x44')]['id']}},_0x3f3bfc={};_0x3f3bfc[_0x72e1('0x30')]=_[_0x72e1('0x31')](db[_0x72e1('0x2b')]['rawAttributes']);_0x3f3bfc[_0x72e1('0x32')]=_[_0x72e1('0x31')](_0x56cde9['query']);_0x3f3bfc[_0x72e1('0x38')]=_[_0x72e1('0x33')](_0x3f3bfc['model'],_0x3f3bfc['query']);_0x394914['attributes']=_[_0x72e1('0x33')](_0x3f3bfc[_0x72e1('0x30')],qs[_0x72e1('0x35')](_0x56cde9[_0x72e1('0x32')][_0x72e1('0x35')]));_0x394914[_0x72e1('0x34')]=_0x394914[_0x72e1('0x34')]['length']?_0x394914['attributes']:_0x3f3bfc[_0x72e1('0x30')];if(_0x56cde9['query'][_0x72e1('0x45')]){_0x394914[_0x72e1('0x3f')]=[{'all':!![]}];}_0x394914=_['merge']({},_0x394914,_0x56cde9[_0x72e1('0x3e')]);return db[_0x72e1('0x2b')][_0x72e1('0x46')](_0x394914)[_0x72e1('0x22')](handleEntityNotFound(_0x1ba87a,null))[_0x72e1('0x22')](respondWithResult(_0x1ba87a,null))[_0x72e1('0x42')](handleError(_0x1ba87a,null));};exports[_0x72e1('0x47')]=function(_0x1c1ad2,_0x1a5fbc){return db['ServicenowField']['create'](_0x1c1ad2[_0x72e1('0x48')],{})['then'](respondWithResult(_0x1a5fbc,0xc9))[_0x72e1('0x42')](handleError(_0x1a5fbc,null));};exports[_0x72e1('0x49')]=function(_0x404f10,_0x2adad7){if(_0x404f10[_0x72e1('0x48')]['id']){delete _0x404f10[_0x72e1('0x48')]['id'];}return db['ServicenowField'][_0x72e1('0x46')]({'where':{'id':_0x404f10[_0x72e1('0x44')]['id']}})[_0x72e1('0x22')](handleEntityNotFound(_0x2adad7,null))[_0x72e1('0x22')](saveUpdates(_0x404f10[_0x72e1('0x48')],null))[_0x72e1('0x22')](respondWithResult(_0x2adad7,null))[_0x72e1('0x42')](handleError(_0x2adad7,null));};exports[_0x72e1('0x23')]=function(_0xf0fb11,_0x117d9f){return db[_0x72e1('0x2b')][_0x72e1('0x46')]({'where':{'id':_0xf0fb11[_0x72e1('0x44')]['id']}})[_0x72e1('0x22')](handleEntityNotFound(_0x117d9f,null))[_0x72e1('0x22')](removeEntity(_0x117d9f,null))[_0x72e1('0x42')](handleError(_0x117d9f,null));}; \ No newline at end of file +var _0xf90e=['sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0x33ec76,_0x2e1a70){var _0x504e07=function(_0x26fc5f){while(--_0x26fc5f){_0x33ec76['push'](_0x33ec76['shift']());}};_0x504e07(++_0x2e1a70);}(_0xf90e,0x14d));var _0xef90=function(_0x31978a,_0x4d5869){_0x31978a=_0x31978a-0x0;var _0x21d825=_0xf90e[_0x31978a];return _0x21d825;};'use strict';var emlformat=require(_0xef90('0x0'));var rimraf=require(_0xef90('0x1'));var zipdir=require(_0xef90('0x2'));var jsonpatch=require(_0xef90('0x3'));var rp=require(_0xef90('0x4'));var moment=require(_0xef90('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xef90('0x6'));var util=require(_0xef90('0x7'));var path=require(_0xef90('0x8'));var sox=require(_0xef90('0x9'));var csv=require(_0xef90('0xa'));var ejs=require(_0xef90('0xb'));var fs=require('fs');var fs_extra=require(_0xef90('0xc'));var _=require(_0xef90('0xd'));var squel=require(_0xef90('0xe'));var crypto=require(_0xef90('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xef90('0xa'));var querystring=require(_0xef90('0x10'));var Papa=require(_0xef90('0x11'));var Redis=require(_0xef90('0x12'));var authService=require(_0xef90('0x13'));var qs=require(_0xef90('0x14'));var as=require(_0xef90('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xef90('0x16'));var utils=require(_0xef90('0x17'));var config=require(_0xef90('0x18'));var licenseUtil=require(_0xef90('0x19'));var db=require(_0xef90('0x1a'))['db'];function respondWithStatusCode(_0x42985f,_0x301118){_0x301118=_0x301118||0xcc;return function(_0x512ece){if(_0x512ece){return _0x42985f['sendStatus'](_0x301118);}return _0x42985f['status'](_0x301118)[_0xef90('0x1b')]();};}function respondWithResult(_0x4921d1,_0x2269be){_0x2269be=_0x2269be||0xc8;return function(_0x1f6ef4){if(_0x1f6ef4){return _0x4921d1[_0xef90('0x1c')](_0x2269be)[_0xef90('0x1d')](_0x1f6ef4);}};}function respondWithFilteredResult(_0x4e58b9,_0x202de1){return function(_0x137456){if(_0x137456){var _0x4c3134=typeof _0x202de1['offset']===_0xef90('0x1e')&&typeof _0x202de1[_0xef90('0x1f')]===_0xef90('0x1e');var _0x1b51c5=_0x137456[_0xef90('0x20')];var _0x53750c=_0x4c3134?0x0:_0x202de1[_0xef90('0x21')];var _0x43474e=_0x4c3134?_0x137456[_0xef90('0x20')]:_0x202de1['offset']+_0x202de1['limit'];var _0x124f72;if(_0x43474e>=_0x1b51c5){_0x43474e=_0x1b51c5;_0x124f72=0xc8;}else{_0x124f72=0xce;}_0x4e58b9[_0xef90('0x1c')](_0x124f72);return _0x4e58b9[_0xef90('0x22')](_0xef90('0x23'),_0x53750c+'-'+_0x43474e+'/'+_0x1b51c5)['json'](_0x137456);}return null;};}function patchUpdates(_0x32cc31){return function(_0x52b412){try{jsonpatch['apply'](_0x52b412,_0x32cc31,!![]);}catch(_0x1ff229){return BPromise[_0xef90('0x24')](_0x1ff229);}return _0x52b412['save']();};}function saveUpdates(_0x4421c8,_0x21907a){return function(_0x162a95){if(_0x162a95){return _0x162a95[_0xef90('0x25')](_0x4421c8)[_0xef90('0x26')](function(_0x159288){return _0x159288;});}return null;};}function removeEntity(_0x4f1448,_0x3e031c){return function(_0x47ad08){if(_0x47ad08){return _0x47ad08[_0xef90('0x27')]()[_0xef90('0x26')](function(){_0x4f1448['status'](0xcc)[_0xef90('0x1b')]();});}};}function handleEntityNotFound(_0x3b9248,_0x13b42f){return function(_0x3454fc){if(!_0x3454fc){_0x3b9248[_0xef90('0x28')](0x194);}return _0x3454fc;};}function handleError(_0x4777ed,_0x1e37b9){_0x1e37b9=_0x1e37b9||0x1f4;return function(_0x349cb9){logger[_0xef90('0x29')](_0x349cb9[_0xef90('0x2a')]);if(_0x349cb9[_0xef90('0x2b')]){delete _0x349cb9[_0xef90('0x2b')];}_0x4777ed[_0xef90('0x1c')](_0x1e37b9)[_0xef90('0x2c')](_0x349cb9);};}exports[_0xef90('0x2d')]=function(_0x1074a3,_0x6f6ba9){var _0x16b638={},_0x514ec0={},_0x5cd1e5={'count':0x0,'rows':[]};var _0x372757=_[_0xef90('0x2e')](db[_0xef90('0x2f')][_0xef90('0x30')],function(_0x3fd00b){return{'name':_0x3fd00b[_0xef90('0x31')],'type':_0x3fd00b[_0xef90('0x32')][_0xef90('0x33')]};});_0x514ec0[_0xef90('0x34')]=_[_0xef90('0x2e')](_0x372757,_0xef90('0x2b'));_0x514ec0['query']=_[_0xef90('0x35')](_0x1074a3[_0xef90('0x36')]);_0x514ec0[_0xef90('0x37')]=_[_0xef90('0x38')](_0x514ec0[_0xef90('0x34')],_0x514ec0[_0xef90('0x36')]);_0x16b638[_0xef90('0x39')]=_[_0xef90('0x38')](_0x514ec0[_0xef90('0x34')],qs[_0xef90('0x3a')](_0x1074a3[_0xef90('0x36')][_0xef90('0x3a')]));_0x16b638[_0xef90('0x39')]=_0x16b638[_0xef90('0x39')]['length']?_0x16b638[_0xef90('0x39')]:_0x514ec0[_0xef90('0x34')];if(!_0x1074a3[_0xef90('0x36')][_0xef90('0x3b')](_0xef90('0x3c'))){_0x16b638[_0xef90('0x1f')]=qs[_0xef90('0x1f')](_0x1074a3[_0xef90('0x36')][_0xef90('0x1f')]);_0x16b638['offset']=qs[_0xef90('0x21')](_0x1074a3[_0xef90('0x36')]['offset']);}_0x16b638[_0xef90('0x3d')]=qs[_0xef90('0x3e')](_0x1074a3[_0xef90('0x36')][_0xef90('0x3e')]);_0x16b638[_0xef90('0x3f')]=qs[_0xef90('0x37')](_['pick'](_0x1074a3[_0xef90('0x36')],_0x514ec0['filters']),_0x372757);if(_0x1074a3[_0xef90('0x36')][_0xef90('0x40')]){_0x16b638[_0xef90('0x3f')]=_[_0xef90('0x41')](_0x16b638[_0xef90('0x3f')],{'$or':_[_0xef90('0x2e')](_0x372757,function(_0x1d68bb){if(_0x1d68bb[_0xef90('0x32')]!==_0xef90('0x42')){var _0x4e0588={};_0x4e0588[_0x1d68bb[_0xef90('0x2b')]]={'$like':'%'+_0x1074a3[_0xef90('0x36')][_0xef90('0x40')]+'%'};return _0x4e0588;}})});}_0x16b638=_[_0xef90('0x41')]({},_0x16b638,_0x1074a3[_0xef90('0x43')]);var _0x31e043={'where':_0x16b638[_0xef90('0x3f')]};return db[_0xef90('0x2f')][_0xef90('0x20')](_0x31e043)[_0xef90('0x26')](function(_0x2b5c27){_0x5cd1e5[_0xef90('0x20')]=_0x2b5c27;if(_0x1074a3[_0xef90('0x36')][_0xef90('0x44')]){_0x16b638[_0xef90('0x45')]=[{'all':!![]}];}return db[_0xef90('0x2f')][_0xef90('0x46')](_0x16b638);})[_0xef90('0x26')](function(_0x841653){_0x5cd1e5[_0xef90('0x47')]=_0x841653;return _0x5cd1e5;})['then'](respondWithFilteredResult(_0x6f6ba9,_0x16b638))[_0xef90('0x48')](handleError(_0x6f6ba9,null));};exports[_0xef90('0x49')]=function(_0x1c0b96,_0x2b9b66){var _0x45976d={'raw':!![],'where':{'id':_0x1c0b96[_0xef90('0x4a')]['id']}},_0x55d43e={};_0x55d43e[_0xef90('0x34')]=_[_0xef90('0x35')](db['ServicenowField'][_0xef90('0x30')]);_0x55d43e[_0xef90('0x36')]=_[_0xef90('0x35')](_0x1c0b96[_0xef90('0x36')]);_0x55d43e[_0xef90('0x37')]=_[_0xef90('0x38')](_0x55d43e[_0xef90('0x34')],_0x55d43e[_0xef90('0x36')]);_0x45976d[_0xef90('0x39')]=_[_0xef90('0x38')](_0x55d43e['model'],qs['fields'](_0x1c0b96[_0xef90('0x36')][_0xef90('0x3a')]));_0x45976d[_0xef90('0x39')]=_0x45976d[_0xef90('0x39')][_0xef90('0x4b')]?_0x45976d['attributes']:_0x55d43e[_0xef90('0x34')];if(_0x1c0b96[_0xef90('0x36')][_0xef90('0x44')]){_0x45976d[_0xef90('0x45')]=[{'all':!![]}];}_0x45976d=_[_0xef90('0x41')]({},_0x45976d,_0x1c0b96[_0xef90('0x43')]);return db[_0xef90('0x2f')][_0xef90('0x4c')](_0x45976d)[_0xef90('0x26')](handleEntityNotFound(_0x2b9b66,null))['then'](respondWithResult(_0x2b9b66,null))['catch'](handleError(_0x2b9b66,null));};exports['create']=function(_0x40aeb5,_0x302dba){return db[_0xef90('0x2f')][_0xef90('0x4d')](_0x40aeb5[_0xef90('0x4e')],{})[_0xef90('0x26')](respondWithResult(_0x302dba,0xc9))['catch'](handleError(_0x302dba,null));};exports[_0xef90('0x25')]=function(_0x30d721,_0x20afc){if(_0x30d721[_0xef90('0x4e')]['id']){delete _0x30d721[_0xef90('0x4e')]['id'];}return db[_0xef90('0x2f')][_0xef90('0x4c')]({'where':{'id':_0x30d721[_0xef90('0x4a')]['id']}})[_0xef90('0x26')](handleEntityNotFound(_0x20afc,null))[_0xef90('0x26')](saveUpdates(_0x30d721[_0xef90('0x4e')],null))['then'](respondWithResult(_0x20afc,null))[_0xef90('0x48')](handleError(_0x20afc,null));};exports[_0xef90('0x27')]=function(_0x3a7f35,_0x13277e){return db[_0xef90('0x2f')][_0xef90('0x4c')]({'where':{'id':_0x3a7f35[_0xef90('0x4a')]['id']}})[_0xef90('0x26')](handleEntityNotFound(_0x13277e,null))[_0xef90('0x26')](removeEntity(_0x13277e,null))[_0xef90('0x48')](handleError(_0x13277e,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index e4580ca..aac89ee 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 _0xdeb3=['bluebird','path','rimraf','../../config/environment','./intServicenowField.attributes','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','lodash','util','../../config/logger','api'];(function(_0x23e731,_0x41793d){var _0x36b9b1=function(_0x6b1916){while(--_0x6b1916){_0x23e731['push'](_0x23e731['shift']());}};_0x36b9b1(++_0x41793d);}(_0xdeb3,0x19c));var _0x3deb=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xdeb3[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x3deb('0x0'));var util=require(_0x3deb('0x1'));var logger=require(_0x3deb('0x2'))(_0x3deb('0x3'));var moment=require('moment');var BPromise=require(_0x3deb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3deb('0x5'));var rimraf=require(_0x3deb('0x6'));var config=require(_0x3deb('0x7'));var attributes=require(_0x3deb('0x8'));module['exports']=function(_0x5848d9,_0x57bb72){return _0x5848d9['define'](_0x3deb('0x9'),attributes,{'tableName':_0x3deb('0xa'),'paranoid':![],'indexes':[{'name':_0x3deb('0xb'),'fields':[_0x3deb('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc752=['FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','servicenow_unique_index'];(function(_0x3f18f8,_0x50664c){var _0x7481d4=function(_0x4883b0){while(--_0x4883b0){_0x3f18f8['push'](_0x3f18f8['shift']());}};_0x7481d4(++_0x50664c);}(_0xc752,0xd3));var _0x2c75=function(_0x2519fc,_0x3b9b29){_0x2519fc=_0x2519fc-0x0;var _0x34444e=_0xc752[_0x2519fc];return _0x34444e;};'use strict';var _=require(_0x2c75('0x0'));var util=require(_0x2c75('0x1'));var logger=require(_0x2c75('0x2'))(_0x2c75('0x3'));var moment=require(_0x2c75('0x4'));var BPromise=require('bluebird');var rp=require(_0x2c75('0x5'));var fs=require('fs');var path=require(_0x2c75('0x6'));var rimraf=require(_0x2c75('0x7'));var config=require(_0x2c75('0x8'));var attributes=require(_0x2c75('0x9'));module[_0x2c75('0xa')]=function(_0x4b57a7,_0x33995c){return _0x4b57a7[_0x2c75('0xb')](_0x2c75('0xc'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x2c75('0xd'),'fields':['idField',_0x2c75('0xe')],'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 1012b76..e2ac9b4 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 _0xa9e0=['http','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\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(_0x462877,_0x463d08){var _0x4851c7=function(_0x58d783){while(--_0x58d783){_0x462877['push'](_0x462877['shift']());}};_0x4851c7(++_0x463d08);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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 _0x9ffd=['ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x4f12a2,_0x6366b2){var _0x4ccacc=function(_0x181232){while(--_0x181232){_0x4f12a2['push'](_0x4f12a2['shift']());}};_0x4ccacc(++_0x6366b2);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x166601,_0x345c08){_0x166601=_0x166601-0x0;var _0x7695d9=_0x9ffd[_0x166601];return _0x7695d9;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 9179eb5..8024e54 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(_0x410153,_0xec9c6f){var _0x1d7ed6=function(_0x1555d8){while(--_0x1555d8){_0x410153['push'](_0x410153['shift']());}};_0x1d7ed6(++_0xec9c6f);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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(_0x557d4c,_0x379e05){var _0x3ce199=function(_0x276eca){while(--_0x276eca){_0x557d4c['push'](_0x557d4c['shift']());}};_0x3ce199(++_0x379e05);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 4e62479..e397b30 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(_0x385124,_0x5ce5b3){var _0x2829b8=function(_0x404faf){while(--_0x404faf){_0x385124['push'](_0x385124['shift']());}};_0x2829b8(++_0x5ce5b3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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(_0x18b208,_0x4d9912){var _0x2d5e80=function(_0x181b66){while(--_0x181b66){_0x18b208['push'](_0x18b208['shift']());}};_0x2d5e80(++_0x4d9912);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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 5cefaae..a247b7f 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 _0x67b6=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','SugarcrmAccount','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','include','create','body','params','findOne','SugarcrmConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','username','password','remoteUri','slice','substring','lastIndexOf','format','%s%s','/service/v4_1/rest.php','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','POST','get_module_fields','module_fields','remove','includes','label','endsWith','values','value','statusCode','stringify','send','test','Wrong\x20credentials','rimraf','moment','bluebird','mustache','path','ejs','lodash','squel','crypto'];(function(_0x24bb0f,_0x1959cd){var _0x3c248c=function(_0x4472ed){while(--_0x4472ed){_0x24bb0f['push'](_0x24bb0f['shift']());}};_0x3c248c(++_0x1959cd);}(_0x67b6,0x1d7));var _0x667b=function(_0x388c20,_0xb6f171){_0x388c20=_0x388c20-0x0;var _0x4a5c39=_0x67b6[_0x388c20];return _0x4a5c39;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x667b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x667b('0x1'));var BPromise=require(_0x667b('0x2'));var Mustache=require(_0x667b('0x3'));var util=require('util');var path=require(_0x667b('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x667b('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x667b('0x6'));var squel=require(_0x667b('0x7'));var crypto=require(_0x667b('0x8'));var jsforce=require(_0x667b('0x9'));var deskjs=require(_0x667b('0xa'));var toCsv=require('to-csv');var querystring=require(_0x667b('0xb'));var Papa=require('papaparse');var Redis=require(_0x667b('0xc'));var authService=require(_0x667b('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x667b('0xe'));var hardwareService=require(_0x667b('0xf'));var logger=require(_0x667b('0x10'))(_0x667b('0x11'));var utils=require(_0x667b('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x667b('0x13'));var db=require(_0x667b('0x14'))['db'];var integrations=require(_0x667b('0x15'));function respondWithStatusCode(_0x3c0055,_0x317cbd){_0x317cbd=_0x317cbd||0xcc;return function(_0x5b8ee7){if(_0x5b8ee7){return _0x3c0055[_0x667b('0x16')](_0x317cbd);}return _0x3c0055[_0x667b('0x17')](_0x317cbd)[_0x667b('0x18')]();};}function respondWithResult(_0x54de21,_0x1e31bc){_0x1e31bc=_0x1e31bc||0xc8;return function(_0x4e8b30){if(_0x4e8b30){return _0x54de21[_0x667b('0x17')](_0x1e31bc)[_0x667b('0x19')](_0x4e8b30);}};}function respondWithFilteredResult(_0x3d4ef3,_0x5c0865){return function(_0x35b63d){if(_0x35b63d){var _0x3750e2=typeof _0x5c0865[_0x667b('0x1a')]===_0x667b('0x1b')&&typeof _0x5c0865[_0x667b('0x1c')]===_0x667b('0x1b');var _0x54e27b=_0x35b63d[_0x667b('0x1d')];var _0x37b008=_0x3750e2?0x0:_0x5c0865[_0x667b('0x1a')];var _0x50a9f7=_0x3750e2?_0x35b63d[_0x667b('0x1d')]:_0x5c0865['offset']+_0x5c0865['limit'];var _0xf99fe9;if(_0x50a9f7>=_0x54e27b){_0x50a9f7=_0x54e27b;_0xf99fe9=0xc8;}else{_0xf99fe9=0xce;}_0x3d4ef3[_0x667b('0x17')](_0xf99fe9);return _0x3d4ef3[_0x667b('0x1e')](_0x667b('0x1f'),_0x37b008+'-'+_0x50a9f7+'/'+_0x54e27b)['json'](_0x35b63d);}return null;};}function patchUpdates(_0x3e1485){return function(_0x5364d9){try{jsonpatch[_0x667b('0x20')](_0x5364d9,_0x3e1485,!![]);}catch(_0x45e18c){return BPromise[_0x667b('0x21')](_0x45e18c);}return _0x5364d9[_0x667b('0x22')]();};}function saveUpdates(_0x539fd2,_0x4650a2){return function(_0x5c18aa){if(_0x5c18aa){return _0x5c18aa[_0x667b('0x23')](_0x539fd2)[_0x667b('0x24')](function(_0xf18471){return _0xf18471;});}return null;};}function removeEntity(_0x283f83,_0x711d65){return function(_0x2438e9){if(_0x2438e9){return _0x2438e9[_0x667b('0x25')]()['then'](function(){_0x283f83['status'](0xcc)[_0x667b('0x18')]();});}};}function handleEntityNotFound(_0xc2f34c,_0x238eea){return function(_0x4cb74b){if(!_0x4cb74b){_0xc2f34c[_0x667b('0x16')](0x194);}return _0x4cb74b;};}function handleError(_0x205817,_0x436711){_0x436711=_0x436711||0x1f4;return function(_0x51b898){logger[_0x667b('0x26')](_0x51b898[_0x667b('0x27')]);if(_0x51b898['name']){delete _0x51b898[_0x667b('0x28')];}_0x205817[_0x667b('0x17')](_0x436711)['send'](_0x51b898);};}exports[_0x667b('0x29')]=function(_0x5ee04a,_0xe7f3ef){var _0x101c9a={},_0x1b801d={},_0x2bc39b={'count':0x0,'rows':[]};var _0x396403=_[_0x667b('0x2a')](db[_0x667b('0x2b')][_0x667b('0x2c')],function(_0x3df634){return{'name':_0x3df634['fieldName'],'type':_0x3df634[_0x667b('0x2d')][_0x667b('0x2e')]};});_0x1b801d[_0x667b('0x2f')]=_[_0x667b('0x2a')](_0x396403,_0x667b('0x28'));_0x1b801d[_0x667b('0x30')]=_[_0x667b('0x31')](_0x5ee04a[_0x667b('0x30')]);_0x1b801d[_0x667b('0x32')]=_['intersection'](_0x1b801d[_0x667b('0x2f')],_0x1b801d[_0x667b('0x30')]);_0x101c9a[_0x667b('0x33')]=_[_0x667b('0x34')](_0x1b801d['model'],qs['fields'](_0x5ee04a[_0x667b('0x30')][_0x667b('0x35')]));_0x101c9a[_0x667b('0x33')]=_0x101c9a[_0x667b('0x33')][_0x667b('0x36')]?_0x101c9a[_0x667b('0x33')]:_0x1b801d[_0x667b('0x2f')];if(!_0x5ee04a[_0x667b('0x30')][_0x667b('0x37')](_0x667b('0x38'))){_0x101c9a[_0x667b('0x1c')]=qs['limit'](_0x5ee04a[_0x667b('0x30')]['limit']);_0x101c9a['offset']=qs[_0x667b('0x1a')](_0x5ee04a['query'][_0x667b('0x1a')]);}_0x101c9a[_0x667b('0x39')]=qs['sort'](_0x5ee04a[_0x667b('0x30')][_0x667b('0x3a')]);_0x101c9a['where']=qs[_0x667b('0x32')](_[_0x667b('0x3b')](_0x5ee04a[_0x667b('0x30')],_0x1b801d[_0x667b('0x32')]),_0x396403);if(_0x5ee04a[_0x667b('0x30')][_0x667b('0x3c')]){_0x101c9a[_0x667b('0x3d')]=_[_0x667b('0x3e')](_0x101c9a['where'],{'$or':_[_0x667b('0x2a')](_0x396403,function(_0x22ae91){if(_0x22ae91[_0x667b('0x2d')]!==_0x667b('0x3f')){var _0x579d31={};_0x579d31[_0x22ae91[_0x667b('0x28')]]={'$like':'%'+_0x5ee04a[_0x667b('0x30')]['filter']+'%'};return _0x579d31;}})});}_0x101c9a=_[_0x667b('0x3e')]({},_0x101c9a,_0x5ee04a[_0x667b('0x40')]);var _0x52e0c5={'where':_0x101c9a[_0x667b('0x3d')]};return db[_0x667b('0x2b')][_0x667b('0x1d')](_0x52e0c5)['then'](function(_0x192f9f){_0x2bc39b['count']=_0x192f9f;if(_0x5ee04a[_0x667b('0x30')][_0x667b('0x41')]){_0x101c9a['include']=[{'all':!![]}];}return db['SugarcrmAccount'][_0x667b('0x42')](_0x101c9a);})[_0x667b('0x24')](function(_0x260d95){_0x2bc39b['rows']=_0x260d95;return _0x2bc39b;})['then'](respondWithFilteredResult(_0xe7f3ef,_0x101c9a))[_0x667b('0x43')](handleError(_0xe7f3ef,null));};exports[_0x667b('0x44')]=function(_0x19b4f0,_0x26dd6d){var _0x310f3c={'raw':![],'where':{'id':_0x19b4f0['params']['id']}},_0x2eb53b={};_0x2eb53b['model']=_[_0x667b('0x31')](db[_0x667b('0x2b')][_0x667b('0x2c')]);_0x2eb53b[_0x667b('0x30')]=_[_0x667b('0x31')](_0x19b4f0[_0x667b('0x30')]);_0x2eb53b[_0x667b('0x32')]=_[_0x667b('0x34')](_0x2eb53b[_0x667b('0x2f')],_0x2eb53b['query']);_0x310f3c['attributes']=_['intersection'](_0x2eb53b[_0x667b('0x2f')],qs[_0x667b('0x35')](_0x19b4f0['query'][_0x667b('0x35')]));_0x310f3c[_0x667b('0x33')]=_0x310f3c[_0x667b('0x33')][_0x667b('0x36')]?_0x310f3c[_0x667b('0x33')]:_0x2eb53b['model'];if(_0x19b4f0['query'][_0x667b('0x41')]){_0x310f3c[_0x667b('0x45')]=[{'all':!![]}];}_0x310f3c=_['merge']({},_0x310f3c,_0x19b4f0[_0x667b('0x40')]);return db[_0x667b('0x2b')]['find'](_0x310f3c)[_0x667b('0x24')](handleEntityNotFound(_0x26dd6d,null))[_0x667b('0x24')](respondWithResult(_0x26dd6d,null))['catch'](handleError(_0x26dd6d,null));};exports['create']=function(_0x2bded9,_0x3e146c){return db[_0x667b('0x2b')][_0x667b('0x46')](_0x2bded9[_0x667b('0x47')],{})['then'](respondWithResult(_0x3e146c,0xc9))[_0x667b('0x43')](handleError(_0x3e146c,null));};exports[_0x667b('0x23')]=function(_0x334675,_0x595bc7){if(_0x334675[_0x667b('0x47')]['id']){delete _0x334675[_0x667b('0x47')]['id'];}return db[_0x667b('0x2b')]['find']({'where':{'id':_0x334675[_0x667b('0x48')]['id']}})['then'](handleEntityNotFound(_0x595bc7,null))[_0x667b('0x24')](saveUpdates(_0x334675[_0x667b('0x47')],null))[_0x667b('0x24')](respondWithResult(_0x595bc7,null))[_0x667b('0x43')](handleError(_0x595bc7,null));};exports['destroy']=function(_0x599bce,_0x40415a){return db['SugarcrmAccount']['find']({'where':{'id':_0x599bce[_0x667b('0x48')]['id']}})[_0x667b('0x24')](handleEntityNotFound(_0x40415a,null))[_0x667b('0x24')](removeEntity(_0x40415a,null))[_0x667b('0x43')](handleError(_0x40415a,null));};exports['getConfigurations']=function(_0x32b8cc,_0xbed35c,_0x46505d){var _0x3745de={};var _0x3c5f5a={};var _0x1675c1;var _0x4c09b0;return db['SugarcrmAccount'][_0x667b('0x49')]({'where':{'id':_0x32b8cc[_0x667b('0x48')]['id']}})['then'](handleEntityNotFound(_0xbed35c,null))['then'](function(_0x91358a){if(_0x91358a){_0x1675c1=_0x91358a;_0x3c5f5a[_0x667b('0x2f')]=_['keys'](db[_0x667b('0x4a')]['rawAttributes']);_0x3c5f5a['query']=_[_0x667b('0x31')](_0x32b8cc[_0x667b('0x30')]);_0x3c5f5a[_0x667b('0x32')]=_[_0x667b('0x34')](_0x3c5f5a['model'],_0x3c5f5a[_0x667b('0x30')]);_0x3745de['attributes']=_['intersection'](_0x3c5f5a[_0x667b('0x2f')],qs[_0x667b('0x35')](_0x32b8cc[_0x667b('0x30')][_0x667b('0x35')]));_0x3745de['attributes']=_0x3745de[_0x667b('0x33')][_0x667b('0x36')]?_0x3745de[_0x667b('0x33')]:_0x3c5f5a[_0x667b('0x2f')];_0x3745de['order']=qs['sort'](_0x32b8cc[_0x667b('0x30')][_0x667b('0x3a')]);_0x3745de[_0x667b('0x3d')]=qs[_0x667b('0x32')](_[_0x667b('0x3b')](_0x32b8cc[_0x667b('0x30')],_0x3c5f5a[_0x667b('0x32')]));if(_0x32b8cc['query']['filter']){_0x3745de[_0x667b('0x3d')]=_[_0x667b('0x3e')](_0x3745de[_0x667b('0x3d')],{'$or':_[_0x667b('0x2a')](_0x3745de[_0x667b('0x33')],function(_0x462288){var _0x33bfba={};_0x33bfba[_0x462288]={'$like':'%'+_0x32b8cc[_0x667b('0x30')]['filter']+'%'};return _0x33bfba;})});}_0x3745de=_[_0x667b('0x3e')]({},_0x3745de,_0x32b8cc[_0x667b('0x40')]);return _0x1675c1[_0x667b('0x4b')](_0x3745de);}})[_0x667b('0x24')](function(_0x55ef0b){if(_0x55ef0b){_0x4c09b0=_0x55ef0b[_0x667b('0x36')];if(!_0x32b8cc[_0x667b('0x30')]['hasOwnProperty'](_0x667b('0x38'))){_0x3745de['limit']=qs[_0x667b('0x1c')](_0x32b8cc[_0x667b('0x30')][_0x667b('0x1c')]);_0x3745de['offset']=qs[_0x667b('0x1a')](_0x32b8cc[_0x667b('0x30')][_0x667b('0x1a')]);}return _0x1675c1[_0x667b('0x4b')](_0x3745de);}})[_0x667b('0x24')](function(_0x5de882){if(_0x5de882){return _0x5de882?{'count':_0x4c09b0,'rows':_0x5de882}:null;}})[_0x667b('0x24')](respondWithResult(_0xbed35c,null))[_0x667b('0x43')](handleError(_0xbed35c,null));};exports[_0x667b('0x4c')]=function(_0x1465ff,_0x5f04bd,_0x347605){if(_0x1465ff['body']['id']){delete _0x1465ff[_0x667b('0x47')]['id'];}return db['SugarcrmAccount'][_0x667b('0x49')]({'where':{'id':_0x1465ff[_0x667b('0x48')]['id']}})[_0x667b('0x24')](handleEntityNotFound(_0x5f04bd,null))[_0x667b('0x24')](function(_0x4eaa4d){if(_0x4eaa4d){_0x1465ff[_0x667b('0x47')][_0x667b('0x4d')]=_0x4eaa4d['id'];_0x1465ff[_0x667b('0x47')][_0x667b('0x4e')]=integrations[_0x667b('0x4f')](_0x1465ff[_0x667b('0x47')][_0x667b('0x50')],_0x1465ff[_0x667b('0x47')][_0x667b('0x2d')]);_0x1465ff['body'][_0x667b('0x51')]=integrations[_0x667b('0x52')](_0x1465ff[_0x667b('0x47')][_0x667b('0x50')],_0x1465ff[_0x667b('0x47')][_0x667b('0x2d')]);return db[_0x667b('0x4a')][_0x667b('0x46')](_0x1465ff[_0x667b('0x47')],{'include':[{'model':db[_0x667b('0x53')],'as':_0x667b('0x4e')},{'model':db[_0x667b('0x53')],'as':'Descriptions'}]});}return null;})[_0x667b('0x24')](respondWithResult(_0x5f04bd,null))[_0x667b('0x43')](handleError(_0x5f04bd,null));};exports[_0x667b('0x54')]=function(_0x19243c,_0x34f774,_0x1ed602){var _0x58010f='';var _0x3c4091=['id','name',_0x667b('0x55'),_0x667b('0x56'),_0x667b('0x57'),_0x667b('0x58'),_0x667b('0x59'),_0x667b('0x5a'),_0x667b('0x5b'),'parent_type','parent_name','direction'];return db[_0x667b('0x2b')]['findOne']({'where':{'id':_0x19243c['params']['id']},'attributes':['id',_0x667b('0x5c'),_0x667b('0x5d'),_0x667b('0x5e')]})['then'](handleEntityNotFound(_0x34f774,null))['then'](function(_0x47106f){if(_0x47106f){_0x58010f=_0x47106f[_0x667b('0x5e')];var _0xdedaae=_0x58010f[_0x667b('0x5f')](-0x1);if(_0xdedaae==='/'){_0x58010f=_0x58010f[_0x667b('0x60')](0x0,_0x58010f[_0x667b('0x61')](_0xdedaae));}return rp({'method':'POST','uri':util[_0x667b('0x62')](_0x667b('0x63'),_0x58010f,_0x667b('0x64')),'json':!![],'form':{'method':_0x667b('0x65'),'input_type':_0x667b('0x66'),'response_type':_0x667b('0x66'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x47106f[_0x667b('0x5c')],'password':_0x47106f[_0x667b('0x5d')],'encryption':_0x667b('0x67')},'application':_0x667b('0x68')})}});}})[_0x667b('0x24')](function(_0x28fcbf){if(_0x28fcbf&&_0x28fcbf[_0x667b('0x28')]!==_0x667b('0x69')&&_0x28fcbf[_0x667b('0x28')]!=='Password\x20Expired'){return rp({'method':_0x667b('0x6a'),'uri':util[_0x667b('0x62')](_0x667b('0x63'),_0x58010f,_0x667b('0x64')),'json':!![],'form':{'method':_0x667b('0x6b'),'input_type':'JSON','response_type':_0x667b('0x66'),'rest_data':JSON['stringify']({'session':_0x28fcbf['id'],'module_name':'Calls'})}})['then'](function(_0x226150){if(_0x226150){var _0x633f53=_['values'](_0x226150[_0x667b('0x6c')]);_[_0x667b('0x6d')](_0x633f53,function(_0x7da1b8){return _0x3c4091[_0x667b('0x6e')](_0x7da1b8['name']);});return{'count':_0x633f53[_0x667b('0x36')],'rows':_['map'](_0x633f53,function(_0x315d79){return{'id':_0x315d79['name'],'name':_0x315d79[_0x667b('0x6f')],'custom':_[_0x667b('0x70')](_0x315d79[_0x667b('0x28')],'_c')?!![]:![],'options':_0x315d79[_0x667b('0x40')]?_['map'](_[_0x667b('0x71')](_0x315d79[_0x667b('0x40')]),function(_0x121c87){return{'name':_0x121c87[_0x667b('0x72')],'value':_0x121c87['name']};}):[]};})};}})['then'](respondWithResult(_0x34f774,null))[_0x667b('0x43')](function(_0x2176ab){var _0x15d1b5=_0x19243c[_0x667b('0x30')]['test']?0x1f4:_0x2176ab[_0x667b('0x73')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x667b('0x54'),_0x15d1b5,JSON[_0x667b('0x74')](_0x2176ab));delete _0x2176ab[_0x667b('0x28')];if(_0x15d1b5===0x191){_0x15d1b5=0x190;}_0x34f774[_0x667b('0x17')](_0x15d1b5)[_0x667b('0x75')](_0x19243c[_0x667b('0x30')][_0x667b('0x76')]?{'message':_0x667b('0x77'),'statusCode':_0x2176ab[_0x667b('0x73')]}:_0x2176ab);});}else{var _0x2349cd=0x1f4;_0x34f774[_0x667b('0x17')](_0x2349cd)[_0x667b('0x75')]({'message':_0x667b('0x77'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x6a6a=['error','name','send','map','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SugarcrmAccount','findAll','rows','catch','show','params','includeAll','create','body','find','getConfigurations','findOne','addConfiguration','AccountId','Subjects','channel','type','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_minutes','parent_id','parent_type','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','login','JSON','stringify','PLAIN','Password\x20Expired','/service/v4_1/rest.php','Calls','values','remove','includes','label','endsWith','value','statusCode','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then'];(function(_0x3c8afe,_0x11a0b3){var _0x24c9f9=function(_0x32eec8){while(--_0x32eec8){_0x3c8afe['push'](_0x3c8afe['shift']());}};_0x24c9f9(++_0x11a0b3);}(_0x6a6a,0xc3));var _0xa6a6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6a6a[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xa6a6('0x0'));var rimraf=require(_0xa6a6('0x1'));var zipdir=require(_0xa6a6('0x2'));var jsonpatch=require(_0xa6a6('0x3'));var rp=require(_0xa6a6('0x4'));var moment=require(_0xa6a6('0x5'));var BPromise=require(_0xa6a6('0x6'));var Mustache=require('mustache');var util=require(_0xa6a6('0x7'));var path=require(_0xa6a6('0x8'));var sox=require(_0xa6a6('0x9'));var csv=require('to-csv');var ejs=require(_0xa6a6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa6a6('0xb'));var crypto=require(_0xa6a6('0xc'));var jsforce=require(_0xa6a6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa6a6('0xe'));var querystring=require(_0xa6a6('0xf'));var Papa=require('papaparse');var Redis=require(_0xa6a6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa6a6('0x11'));var as=require(_0xa6a6('0x12'));var hardwareService=require(_0xa6a6('0x13'));var logger=require(_0xa6a6('0x14'))(_0xa6a6('0x15'));var utils=require(_0xa6a6('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa6a6('0x17'))['db'];var integrations=require(_0xa6a6('0x18'));function respondWithStatusCode(_0x27c21d,_0x2eb451){_0x2eb451=_0x2eb451||0xcc;return function(_0x25e498){if(_0x25e498){return _0x27c21d[_0xa6a6('0x19')](_0x2eb451);}return _0x27c21d[_0xa6a6('0x1a')](_0x2eb451)[_0xa6a6('0x1b')]();};}function respondWithResult(_0x3f8d59,_0x5a2846){_0x5a2846=_0x5a2846||0xc8;return function(_0x3beac5){if(_0x3beac5){return _0x3f8d59[_0xa6a6('0x1a')](_0x5a2846)[_0xa6a6('0x1c')](_0x3beac5);}};}function respondWithFilteredResult(_0x4014aa,_0x4f81b8){return function(_0x397c7c){if(_0x397c7c){var _0xfa8bed=typeof _0x4f81b8[_0xa6a6('0x1d')]===_0xa6a6('0x1e')&&typeof _0x4f81b8[_0xa6a6('0x1f')]===_0xa6a6('0x1e');var _0x47cf20=_0x397c7c[_0xa6a6('0x20')];var _0x205c1a=_0xfa8bed?0x0:_0x4f81b8[_0xa6a6('0x1d')];var _0x3cb8bc=_0xfa8bed?_0x397c7c[_0xa6a6('0x20')]:_0x4f81b8[_0xa6a6('0x1d')]+_0x4f81b8[_0xa6a6('0x1f')];var _0x48667e;if(_0x3cb8bc>=_0x47cf20){_0x3cb8bc=_0x47cf20;_0x48667e=0xc8;}else{_0x48667e=0xce;}_0x4014aa[_0xa6a6('0x1a')](_0x48667e);return _0x4014aa[_0xa6a6('0x21')](_0xa6a6('0x22'),_0x205c1a+'-'+_0x3cb8bc+'/'+_0x47cf20)[_0xa6a6('0x1c')](_0x397c7c);}return null;};}function patchUpdates(_0x241683){return function(_0x14fc71){try{jsonpatch['apply'](_0x14fc71,_0x241683,!![]);}catch(_0x897f2f){return BPromise[_0xa6a6('0x23')](_0x897f2f);}return _0x14fc71['save']();};}function saveUpdates(_0x4b937b,_0x1a8453){return function(_0x42dd4e){if(_0x42dd4e){return _0x42dd4e[_0xa6a6('0x24')](_0x4b937b)['then'](function(_0x4f01aa){return _0x4f01aa;});}return null;};}function removeEntity(_0x3ebab9,_0xb7c72){return function(_0xdfc0b2){if(_0xdfc0b2){return _0xdfc0b2[_0xa6a6('0x25')]()[_0xa6a6('0x26')](function(){_0x3ebab9[_0xa6a6('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5119f8,_0x745ab8){return function(_0x5ce78f){if(!_0x5ce78f){_0x5119f8[_0xa6a6('0x19')](0x194);}return _0x5ce78f;};}function handleError(_0x351ef5,_0x38a76d){_0x38a76d=_0x38a76d||0x1f4;return function(_0x5567fe){logger[_0xa6a6('0x27')](_0x5567fe['stack']);if(_0x5567fe[_0xa6a6('0x28')]){delete _0x5567fe[_0xa6a6('0x28')];}_0x351ef5[_0xa6a6('0x1a')](_0x38a76d)[_0xa6a6('0x29')](_0x5567fe);};}exports['index']=function(_0x139cd7,_0x276012){var _0x7e7e09={},_0x424ba5={},_0xe18368={'count':0x0,'rows':[]};var _0x36534e=_[_0xa6a6('0x2a')](db['SugarcrmAccount'][_0xa6a6('0x2b')],function(_0x1ea8c5){return{'name':_0x1ea8c5['fieldName'],'type':_0x1ea8c5['type']['key']};});_0x424ba5['model']=_[_0xa6a6('0x2a')](_0x36534e,'name');_0x424ba5['query']=_[_0xa6a6('0x2c')](_0x139cd7[_0xa6a6('0x2d')]);_0x424ba5[_0xa6a6('0x2e')]=_[_0xa6a6('0x2f')](_0x424ba5[_0xa6a6('0x30')],_0x424ba5[_0xa6a6('0x2d')]);_0x7e7e09[_0xa6a6('0x31')]=_[_0xa6a6('0x2f')](_0x424ba5[_0xa6a6('0x30')],qs[_0xa6a6('0x32')](_0x139cd7[_0xa6a6('0x2d')][_0xa6a6('0x32')]));_0x7e7e09[_0xa6a6('0x31')]=_0x7e7e09[_0xa6a6('0x31')][_0xa6a6('0x33')]?_0x7e7e09[_0xa6a6('0x31')]:_0x424ba5[_0xa6a6('0x30')];if(!_0x139cd7[_0xa6a6('0x2d')][_0xa6a6('0x34')](_0xa6a6('0x35'))){_0x7e7e09[_0xa6a6('0x1f')]=qs['limit'](_0x139cd7['query'][_0xa6a6('0x1f')]);_0x7e7e09['offset']=qs['offset'](_0x139cd7[_0xa6a6('0x2d')][_0xa6a6('0x1d')]);}_0x7e7e09[_0xa6a6('0x36')]=qs[_0xa6a6('0x37')](_0x139cd7['query']['sort']);_0x7e7e09[_0xa6a6('0x38')]=qs[_0xa6a6('0x2e')](_[_0xa6a6('0x39')](_0x139cd7[_0xa6a6('0x2d')],_0x424ba5[_0xa6a6('0x2e')]),_0x36534e);if(_0x139cd7['query'][_0xa6a6('0x3a')]){_0x7e7e09[_0xa6a6('0x38')]=_[_0xa6a6('0x3b')](_0x7e7e09['where'],{'$or':_[_0xa6a6('0x2a')](_0x36534e,function(_0x570012){if(_0x570012['type']!==_0xa6a6('0x3c')){var _0x59fd73={};_0x59fd73[_0x570012['name']]={'$like':'%'+_0x139cd7[_0xa6a6('0x2d')]['filter']+'%'};return _0x59fd73;}})});}_0x7e7e09=_['merge']({},_0x7e7e09,_0x139cd7[_0xa6a6('0x3d')]);var _0x21e292={'where':_0x7e7e09[_0xa6a6('0x38')]};return db['SugarcrmAccount'][_0xa6a6('0x20')](_0x21e292)[_0xa6a6('0x26')](function(_0x2927a4){_0xe18368['count']=_0x2927a4;if(_0x139cd7['query']['includeAll']){_0x7e7e09['include']=[{'all':!![]}];}return db[_0xa6a6('0x3e')][_0xa6a6('0x3f')](_0x7e7e09);})[_0xa6a6('0x26')](function(_0x326e8f){_0xe18368[_0xa6a6('0x40')]=_0x326e8f;return _0xe18368;})[_0xa6a6('0x26')](respondWithFilteredResult(_0x276012,_0x7e7e09))[_0xa6a6('0x41')](handleError(_0x276012,null));};exports[_0xa6a6('0x42')]=function(_0x16d3f2,_0x17cf8d){var _0x154138={'raw':![],'where':{'id':_0x16d3f2[_0xa6a6('0x43')]['id']}},_0xc6a96c={};_0xc6a96c[_0xa6a6('0x30')]=_[_0xa6a6('0x2c')](db[_0xa6a6('0x3e')][_0xa6a6('0x2b')]);_0xc6a96c['query']=_['keys'](_0x16d3f2[_0xa6a6('0x2d')]);_0xc6a96c[_0xa6a6('0x2e')]=_['intersection'](_0xc6a96c[_0xa6a6('0x30')],_0xc6a96c[_0xa6a6('0x2d')]);_0x154138[_0xa6a6('0x31')]=_[_0xa6a6('0x2f')](_0xc6a96c[_0xa6a6('0x30')],qs[_0xa6a6('0x32')](_0x16d3f2[_0xa6a6('0x2d')]['fields']));_0x154138[_0xa6a6('0x31')]=_0x154138[_0xa6a6('0x31')][_0xa6a6('0x33')]?_0x154138[_0xa6a6('0x31')]:_0xc6a96c[_0xa6a6('0x30')];if(_0x16d3f2['query'][_0xa6a6('0x44')]){_0x154138['include']=[{'all':!![]}];}_0x154138=_['merge']({},_0x154138,_0x16d3f2[_0xa6a6('0x3d')]);return db[_0xa6a6('0x3e')]['find'](_0x154138)[_0xa6a6('0x26')](handleEntityNotFound(_0x17cf8d,null))[_0xa6a6('0x26')](respondWithResult(_0x17cf8d,null))[_0xa6a6('0x41')](handleError(_0x17cf8d,null));};exports[_0xa6a6('0x45')]=function(_0x2eb0cb,_0x4c13fd){return db[_0xa6a6('0x3e')][_0xa6a6('0x45')](_0x2eb0cb[_0xa6a6('0x46')],{})[_0xa6a6('0x26')](respondWithResult(_0x4c13fd,0xc9))[_0xa6a6('0x41')](handleError(_0x4c13fd,null));};exports['update']=function(_0x3f5380,_0x129c51){if(_0x3f5380[_0xa6a6('0x46')]['id']){delete _0x3f5380[_0xa6a6('0x46')]['id'];}return db[_0xa6a6('0x3e')][_0xa6a6('0x47')]({'where':{'id':_0x3f5380[_0xa6a6('0x43')]['id']}})['then'](handleEntityNotFound(_0x129c51,null))[_0xa6a6('0x26')](saveUpdates(_0x3f5380[_0xa6a6('0x46')],null))[_0xa6a6('0x26')](respondWithResult(_0x129c51,null))[_0xa6a6('0x41')](handleError(_0x129c51,null));};exports[_0xa6a6('0x25')]=function(_0x5bd02d,_0x3d720c){return db[_0xa6a6('0x3e')]['find']({'where':{'id':_0x5bd02d[_0xa6a6('0x43')]['id']}})[_0xa6a6('0x26')](handleEntityNotFound(_0x3d720c,null))[_0xa6a6('0x26')](removeEntity(_0x3d720c,null))['catch'](handleError(_0x3d720c,null));};exports[_0xa6a6('0x48')]=function(_0x5d77ce,_0x243ae1,_0x4a755e){var _0x5a9318={};var _0x268b84={};var _0x2d9a00;var _0x2e8204;return db[_0xa6a6('0x3e')][_0xa6a6('0x49')]({'where':{'id':_0x5d77ce[_0xa6a6('0x43')]['id']}})[_0xa6a6('0x26')](handleEntityNotFound(_0x243ae1,null))[_0xa6a6('0x26')](function(_0x80c9f8){if(_0x80c9f8){_0x2d9a00=_0x80c9f8;_0x268b84[_0xa6a6('0x30')]=_['keys'](db['SugarcrmConfiguration']['rawAttributes']);_0x268b84[_0xa6a6('0x2d')]=_[_0xa6a6('0x2c')](_0x5d77ce['query']);_0x268b84['filters']=_[_0xa6a6('0x2f')](_0x268b84[_0xa6a6('0x30')],_0x268b84[_0xa6a6('0x2d')]);_0x5a9318[_0xa6a6('0x31')]=_['intersection'](_0x268b84[_0xa6a6('0x30')],qs[_0xa6a6('0x32')](_0x5d77ce[_0xa6a6('0x2d')][_0xa6a6('0x32')]));_0x5a9318['attributes']=_0x5a9318[_0xa6a6('0x31')][_0xa6a6('0x33')]?_0x5a9318[_0xa6a6('0x31')]:_0x268b84[_0xa6a6('0x30')];_0x5a9318[_0xa6a6('0x36')]=qs[_0xa6a6('0x37')](_0x5d77ce[_0xa6a6('0x2d')][_0xa6a6('0x37')]);_0x5a9318[_0xa6a6('0x38')]=qs[_0xa6a6('0x2e')](_[_0xa6a6('0x39')](_0x5d77ce['query'],_0x268b84[_0xa6a6('0x2e')]));if(_0x5d77ce['query'][_0xa6a6('0x3a')]){_0x5a9318[_0xa6a6('0x38')]=_[_0xa6a6('0x3b')](_0x5a9318[_0xa6a6('0x38')],{'$or':_[_0xa6a6('0x2a')](_0x5a9318[_0xa6a6('0x31')],function(_0x461a51){var _0x5b5e9b={};_0x5b5e9b[_0x461a51]={'$like':'%'+_0x5d77ce[_0xa6a6('0x2d')][_0xa6a6('0x3a')]+'%'};return _0x5b5e9b;})});}_0x5a9318=_['merge']({},_0x5a9318,_0x5d77ce[_0xa6a6('0x3d')]);return _0x2d9a00[_0xa6a6('0x48')](_0x5a9318);}})[_0xa6a6('0x26')](function(_0x18047b){if(_0x18047b){_0x2e8204=_0x18047b['length'];if(!_0x5d77ce[_0xa6a6('0x2d')]['hasOwnProperty']('nolimit')){_0x5a9318[_0xa6a6('0x1f')]=qs[_0xa6a6('0x1f')](_0x5d77ce[_0xa6a6('0x2d')][_0xa6a6('0x1f')]);_0x5a9318[_0xa6a6('0x1d')]=qs[_0xa6a6('0x1d')](_0x5d77ce[_0xa6a6('0x2d')][_0xa6a6('0x1d')]);}return _0x2d9a00[_0xa6a6('0x48')](_0x5a9318);}})[_0xa6a6('0x26')](function(_0x3bc674){if(_0x3bc674){return _0x3bc674?{'count':_0x2e8204,'rows':_0x3bc674}:null;}})[_0xa6a6('0x26')](respondWithResult(_0x243ae1,null))[_0xa6a6('0x41')](handleError(_0x243ae1,null));};exports[_0xa6a6('0x4a')]=function(_0x43b080,_0x255097,_0x39e6c4){if(_0x43b080[_0xa6a6('0x46')]['id']){delete _0x43b080['body']['id'];}return db['SugarcrmAccount'][_0xa6a6('0x49')]({'where':{'id':_0x43b080[_0xa6a6('0x43')]['id']}})['then'](handleEntityNotFound(_0x255097,null))[_0xa6a6('0x26')](function(_0x4e67ea){if(_0x4e67ea){_0x43b080[_0xa6a6('0x46')][_0xa6a6('0x4b')]=_0x4e67ea['id'];_0x43b080['body'][_0xa6a6('0x4c')]=integrations['getSubjects'](_0x43b080[_0xa6a6('0x46')][_0xa6a6('0x4d')],_0x43b080[_0xa6a6('0x46')][_0xa6a6('0x4e')]);_0x43b080[_0xa6a6('0x46')][_0xa6a6('0x4f')]=integrations[_0xa6a6('0x50')](_0x43b080[_0xa6a6('0x46')]['channel'],_0x43b080[_0xa6a6('0x46')][_0xa6a6('0x4e')]);return db[_0xa6a6('0x51')][_0xa6a6('0x45')](_0x43b080[_0xa6a6('0x46')],{'include':[{'model':db[_0xa6a6('0x52')],'as':'Subjects'},{'model':db['SugarcrmField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x255097,null))[_0xa6a6('0x41')](handleError(_0x255097,null));};exports[_0xa6a6('0x53')]=function(_0x427241,_0x26fd09,_0x5a40bd){var _0xd14d4c='';var _0x42d223=['id',_0xa6a6('0x28'),_0xa6a6('0x54'),_0xa6a6('0x55'),_0xa6a6('0x56'),_0xa6a6('0x57'),'duration_hours',_0xa6a6('0x58'),_0xa6a6('0x59'),_0xa6a6('0x5a'),'parent_name',_0xa6a6('0x5b')];return db[_0xa6a6('0x3e')]['findOne']({'where':{'id':_0x427241[_0xa6a6('0x43')]['id']},'attributes':['id',_0xa6a6('0x5c'),_0xa6a6('0x5d'),_0xa6a6('0x5e')]})[_0xa6a6('0x26')](handleEntityNotFound(_0x26fd09,null))[_0xa6a6('0x26')](function(_0x1c41e6){if(_0x1c41e6){_0xd14d4c=_0x1c41e6['remoteUri'];var _0x3a33d1=_0xd14d4c[_0xa6a6('0x5f')](-0x1);if(_0x3a33d1==='/'){_0xd14d4c=_0xd14d4c[_0xa6a6('0x60')](0x0,_0xd14d4c[_0xa6a6('0x61')](_0x3a33d1));}return rp({'method':_0xa6a6('0x62'),'uri':util[_0xa6a6('0x63')](_0xa6a6('0x64'),_0xd14d4c,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xa6a6('0x65'),'input_type':_0xa6a6('0x66'),'response_type':'JSON','rest_data':JSON[_0xa6a6('0x67')]({'user_auth':{'user_name':_0x1c41e6[_0xa6a6('0x5c')],'password':_0x1c41e6[_0xa6a6('0x5d')],'encryption':_0xa6a6('0x68')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xa6a6('0x26')](function(_0x4930e4){if(_0x4930e4&&_0x4930e4['name']!=='Invalid\x20Login'&&_0x4930e4['name']!==_0xa6a6('0x69')){return rp({'method':_0xa6a6('0x62'),'uri':util[_0xa6a6('0x63')](_0xa6a6('0x64'),_0xd14d4c,_0xa6a6('0x6a')),'json':!![],'form':{'method':'get_module_fields','input_type':_0xa6a6('0x66'),'response_type':_0xa6a6('0x66'),'rest_data':JSON[_0xa6a6('0x67')]({'session':_0x4930e4['id'],'module_name':_0xa6a6('0x6b')})}})['then'](function(_0x4f31d2){if(_0x4f31d2){var _0x3ace7a=_[_0xa6a6('0x6c')](_0x4f31d2['module_fields']);_[_0xa6a6('0x6d')](_0x3ace7a,function(_0x3193b9){return _0x42d223[_0xa6a6('0x6e')](_0x3193b9['name']);});return{'count':_0x3ace7a[_0xa6a6('0x33')],'rows':_[_0xa6a6('0x2a')](_0x3ace7a,function(_0x7365d8){return{'id':_0x7365d8[_0xa6a6('0x28')],'name':_0x7365d8[_0xa6a6('0x6f')],'custom':_[_0xa6a6('0x70')](_0x7365d8[_0xa6a6('0x28')],'_c')?!![]:![],'options':_0x7365d8['options']?_[_0xa6a6('0x2a')](_[_0xa6a6('0x6c')](_0x7365d8[_0xa6a6('0x3d')]),function(_0x208b98){return{'name':_0x208b98[_0xa6a6('0x71')],'value':_0x208b98[_0xa6a6('0x28')]};}):[]};})};}})[_0xa6a6('0x26')](respondWithResult(_0x26fd09,null))[_0xa6a6('0x41')](function(_0x51b2f2){var _0x380c95=_0x427241[_0xa6a6('0x2d')]['test']?0x1f4:_0x51b2f2[_0xa6a6('0x72')]||0x1f4;logger[_0xa6a6('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0xa6a6('0x53'),_0x380c95,JSON[_0xa6a6('0x67')](_0x51b2f2));delete _0x51b2f2[_0xa6a6('0x28')];if(_0x380c95===0x191){_0x380c95=0x190;}_0x26fd09[_0xa6a6('0x1a')](_0x380c95)[_0xa6a6('0x29')](_0x427241['query'][_0xa6a6('0x73')]?{'message':_0xa6a6('0x74'),'statusCode':_0x51b2f2[_0xa6a6('0x72')]}:_0x51b2f2);});}else{var _0x28e0a9=0x1f4;_0x26fd09[_0xa6a6('0x1a')](_0x28e0a9)[_0xa6a6('0x29')]({'message':_0xa6a6('0x74'),'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 1e53cfc..ba848ee 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 _0x3562=['define','int_sugarcrm_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3562,0x9e));var _0x2356=function(_0x529059,_0x294a33){_0x529059=_0x529059-0x0;var _0x156bc2=_0x3562[_0x529059];return _0x156bc2;};'use strict';var _=require(_0x2356('0x0'));var util=require(_0x2356('0x1'));var logger=require('../../config/logger')(_0x2356('0x2'));var moment=require(_0x2356('0x3'));var BPromise=require(_0x2356('0x4'));var rp=require(_0x2356('0x5'));var fs=require('fs');var path=require(_0x2356('0x6'));var rimraf=require(_0x2356('0x7'));var config=require(_0x2356('0x8'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x2356('0x9'));module[_0x2356('0xa')]=function(_0x3dc8bb,_0x3a9ada){return _0x3dc8bb[_0x2356('0xb')]('SugarcrmAccount',attributes,{'tableName':_0x2356('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae6c=['define','SugarcrmAccount','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','exports'];(function(_0x2b4f10,_0x4f92fa){var _0x1b0fcb=function(_0x477fd3){while(--_0x477fd3){_0x2b4f10['push'](_0x2b4f10['shift']());}};_0x1b0fcb(++_0x4f92fa);}(_0xae6c,0x7a));var _0xcae6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xae6c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xcae6('0x0'));var util=require('util');var logger=require(_0xcae6('0x1'))(_0xcae6('0x2'));var moment=require(_0xcae6('0x3'));var BPromise=require(_0xcae6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcae6('0x5'));var rimraf=require('rimraf');var config=require(_0xcae6('0x6'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xcae6('0x7')]=function(_0x54ec58,_0x32337b){return _0x54ec58[_0xcae6('0x8')](_0xcae6('0x9'),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 916fd19..9ef36d4 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 _0x940c=['code','error','message','catch','SugarcrmAccount','findAll','options','raw','attributes','limit','include','map','model','then','GetSugarcrmAccount','ShowSugarcrmAccount','find','where','lodash','util','moment','bluebird','ioredis','../../config/utils','jayson/promise','client','http','info','SugarcrmAccount,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x39f5b,_0x224393){var _0x29c795=function(_0x16284b){while(--_0x16284b){_0x39f5b['push'](_0x39f5b['shift']());}};_0x29c795(++_0x224393);}(_0x940c,0x167));var _0xc940=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x940c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc940('0x0'));var util=require(_0xc940('0x1'));var moment=require(_0xc940('0x2'));var BPromise=require(_0xc940('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc940('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc940('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc940('0x6'));var client=jayson[_0xc940('0x7')][_0xc940('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x52dc69,_0x51a74a,_0x2825d3){return new BPromise(function(_0x34d81e,_0xc25dc5){return client['request'](_0x52dc69,_0x2825d3)['then'](function(_0x8481ab){logger[_0xc940('0x9')](_0xc940('0xa'),_0x51a74a,'request\x20sent');logger[_0xc940('0xb')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x51a74a,_0xc940('0xc'),JSON['stringify'](_0x8481ab));if(_0x8481ab['error']){if(_0x8481ab['error'][_0xc940('0xd')]===0x1f4){logger[_0xc940('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0x51a74a,_0x8481ab[_0xc940('0xe')]['message']);return _0xc25dc5(_0x8481ab['error']['message']);}logger[_0xc940('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0x51a74a,_0x8481ab[_0xc940('0xe')][_0xc940('0xf')]);return _0x34d81e(_0x8481ab[_0xc940('0xe')][_0xc940('0xf')]);}else{logger[_0xc940('0x9')](_0xc940('0xa'),_0x51a74a,'request\x20sent');_0x34d81e(_0x8481ab['result']['message']);}})[_0xc940('0x10')](function(_0x35ef9c){logger[_0xc940('0xe')](_0xc940('0xa'),_0x51a74a,_0x35ef9c);_0xc25dc5(_0x35ef9c);});});}exports['GetSugarcrmAccount']=function(_0x30bc08){var _0x4e5f18=this;return new Promise(function(_0x133dd5,_0x3f17b8){return db[_0xc940('0x11')][_0xc940('0x12')]({'raw':_0x30bc08[_0xc940('0x13')]?_0x30bc08[_0xc940('0x13')][_0xc940('0x14')]===undefined?!![]:![]:!![],'where':_0x30bc08['options']?_0x30bc08['options']['where']||null:null,'attributes':_0x30bc08[_0xc940('0x13')]?_0x30bc08[_0xc940('0x13')][_0xc940('0x15')]||null:null,'limit':_0x30bc08[_0xc940('0x13')]?_0x30bc08[_0xc940('0x13')][_0xc940('0x16')]||null:null,'include':_0x30bc08[_0xc940('0x13')]?_0x30bc08[_0xc940('0x13')][_0xc940('0x17')]?_[_0xc940('0x18')](_0x30bc08['options'][_0xc940('0x17')],function(_0x18d80b){return{'model':db[_0x18d80b[_0xc940('0x19')]],'as':_0x18d80b['as'],'attributes':_0x18d80b[_0xc940('0x15')],'include':_0x18d80b[_0xc940('0x17')]?_[_0xc940('0x18')](_0x18d80b[_0xc940('0x17')],function(_0x163046){return{'model':db[_0x163046[_0xc940('0x19')]],'as':_0x163046['as'],'attributes':_0x163046['attributes'],'include':_0x163046[_0xc940('0x17')]?_[_0xc940('0x18')](_0x163046['include'],function(_0x806a95){return{'model':db[_0x806a95[_0xc940('0x19')]],'as':_0x806a95['as'],'attributes':_0x806a95['attributes']};}):[]};}):[]};}):[]:[]})[_0xc940('0x1a')](function(_0xd32298){logger['info'](_0xc940('0x1b'),_0x30bc08);logger[_0xc940('0xb')](_0xc940('0x1b'),_0x30bc08,JSON['stringify'](_0xd32298));_0x133dd5(_0xd32298);})[_0xc940('0x10')](function(_0x18c60a){logger['error'](_0xc940('0x1b'),_0x18c60a[_0xc940('0xf')],_0x30bc08);_0x3f17b8(_0x4e5f18[_0xc940('0xe')](0x1f4,_0x18c60a[_0xc940('0xf')]));});});};exports[_0xc940('0x1c')]=function(_0x7ed1e1){var _0x443ccd=this;return new Promise(function(_0x3bddea,_0x58705b){return db[_0xc940('0x11')][_0xc940('0x1d')]({'raw':_0x7ed1e1[_0xc940('0x13')]?_0x7ed1e1['options'][_0xc940('0x14')]===undefined?!![]:![]:!![],'where':_0x7ed1e1[_0xc940('0x13')]?_0x7ed1e1[_0xc940('0x13')][_0xc940('0x1e')]||null:null,'attributes':_0x7ed1e1[_0xc940('0x13')]?_0x7ed1e1[_0xc940('0x13')][_0xc940('0x15')]||null:null,'include':_0x7ed1e1[_0xc940('0x13')]?_0x7ed1e1['options'][_0xc940('0x17')]?_[_0xc940('0x18')](_0x7ed1e1[_0xc940('0x13')][_0xc940('0x17')],function(_0x5ac5be){return{'model':db[_0x5ac5be[_0xc940('0x19')]],'as':_0x5ac5be['as'],'attributes':_0x5ac5be['attributes'],'include':_0x5ac5be[_0xc940('0x17')]?_[_0xc940('0x18')](_0x5ac5be[_0xc940('0x17')],function(_0x260b74){return{'model':db[_0x260b74[_0xc940('0x19')]],'as':_0x260b74['as'],'attributes':_0x260b74[_0xc940('0x15')],'include':_0x260b74[_0xc940('0x17')]?_[_0xc940('0x18')](_0x260b74[_0xc940('0x17')],function(_0x1f312e){return{'model':db[_0x1f312e['model']],'as':_0x1f312e['as'],'attributes':_0x1f312e['attributes']};}):[]};}):[]};}):[]:[]})[_0xc940('0x1a')](function(_0x5740f5){logger[_0xc940('0x9')](_0xc940('0x1c'),_0x7ed1e1);logger[_0xc940('0xb')](_0xc940('0x1c'),_0x7ed1e1,JSON['stringify'](_0x5740f5));_0x3bddea(_0x5740f5);})['catch'](function(_0x57a1c8){logger[_0xc940('0xe')](_0xc940('0x1c'),_0x57a1c8['message'],_0x7ed1e1);_0x58705b(_0x443ccd[_0xc940('0xe')](0x1f4,_0x57a1c8[_0xc940('0xf')]));});});}; \ No newline at end of file +var _0x631e=['result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','map','include','model','then','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x3c98ad,_0x2912bb){var _0x468c11=function(_0x543c38){while(--_0x543c38){_0x3c98ad['push'](_0x3c98ad['shift']());}};_0x468c11(++_0x2912bb);}(_0x631e,0x9f));var _0xe631=function(_0x4b8241,_0x1ccd07){_0x4b8241=_0x4b8241-0x0;var _0x530cb4=_0x631e[_0x4b8241];return _0x530cb4;};'use strict';var _=require(_0xe631('0x0'));var util=require(_0xe631('0x1'));var moment=require(_0xe631('0x2'));var BPromise=require(_0xe631('0x3'));var rs=require(_0xe631('0x4'));var fs=require('fs');var Redis=require(_0xe631('0x5'));var db=require(_0xe631('0x6'))['db'];var utils=require(_0xe631('0x7'));var logger=require('../../config/logger')(_0xe631('0x8'));var config=require('../../config/environment');var jayson=require(_0xe631('0x9'));var client=jayson[_0xe631('0xa')][_0xe631('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x563fcc,_0x39565c,_0x3ddf2a){return new BPromise(function(_0x47d2e4,_0x33298f){return client[_0xe631('0xc')](_0x563fcc,_0x3ddf2a)['then'](function(_0x386ab6){logger[_0xe631('0xd')](_0xe631('0xe'),_0x39565c,_0xe631('0xf'));logger[_0xe631('0x10')](_0xe631('0x11'),_0x39565c,_0xe631('0xf'),JSON[_0xe631('0x12')](_0x386ab6));if(_0x386ab6[_0xe631('0x13')]){if(_0x386ab6['error']['code']===0x1f4){logger[_0xe631('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x39565c,_0x386ab6['error']['message']);return _0x33298f(_0x386ab6[_0xe631('0x13')][_0xe631('0x14')]);}logger[_0xe631('0x13')](_0xe631('0xe'),_0x39565c,_0x386ab6[_0xe631('0x13')][_0xe631('0x14')]);return _0x47d2e4(_0x386ab6['error'][_0xe631('0x14')]);}else{logger[_0xe631('0xd')](_0xe631('0xe'),_0x39565c,'request\x20sent');_0x47d2e4(_0x386ab6[_0xe631('0x15')]['message']);}})[_0xe631('0x16')](function(_0x31c533){logger[_0xe631('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x39565c,_0x31c533);_0x33298f(_0x31c533);});});}exports[_0xe631('0x17')]=function(_0x34381d){var _0x256b8a=this;return new Promise(function(_0x4e9c7c,_0x1ad422){return db[_0xe631('0x18')][_0xe631('0x19')]({'raw':_0x34381d[_0xe631('0x1a')]?_0x34381d[_0xe631('0x1a')][_0xe631('0x1b')]===undefined?!![]:![]:!![],'where':_0x34381d['options']?_0x34381d[_0xe631('0x1a')][_0xe631('0x1c')]||null:null,'attributes':_0x34381d[_0xe631('0x1a')]?_0x34381d[_0xe631('0x1a')][_0xe631('0x1d')]||null:null,'limit':_0x34381d[_0xe631('0x1a')]?_0x34381d['options'][_0xe631('0x1e')]||null:null,'include':_0x34381d['options']?_0x34381d[_0xe631('0x1a')]['include']?_[_0xe631('0x1f')](_0x34381d[_0xe631('0x1a')][_0xe631('0x20')],function(_0x473527){return{'model':db[_0x473527[_0xe631('0x21')]],'as':_0x473527['as'],'attributes':_0x473527[_0xe631('0x1d')],'include':_0x473527[_0xe631('0x20')]?_[_0xe631('0x1f')](_0x473527['include'],function(_0x289c69){return{'model':db[_0x289c69[_0xe631('0x21')]],'as':_0x289c69['as'],'attributes':_0x289c69[_0xe631('0x1d')],'include':_0x289c69['include']?_[_0xe631('0x1f')](_0x289c69['include'],function(_0x4288ee){return{'model':db[_0x4288ee[_0xe631('0x21')]],'as':_0x4288ee['as'],'attributes':_0x4288ee[_0xe631('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11bad6){logger[_0xe631('0xd')]('GetSugarcrmAccount',_0x34381d);logger[_0xe631('0x10')](_0xe631('0x17'),_0x34381d,JSON['stringify'](_0x11bad6));_0x4e9c7c(_0x11bad6);})[_0xe631('0x16')](function(_0x46606b){logger[_0xe631('0x13')](_0xe631('0x17'),_0x46606b[_0xe631('0x14')],_0x34381d);_0x1ad422(_0x256b8a[_0xe631('0x13')](0x1f4,_0x46606b[_0xe631('0x14')]));});});};exports['ShowSugarcrmAccount']=function(_0x5c24f6){var _0x4e7df3=this;return new Promise(function(_0x26d999,_0xcc6be9){return db[_0xe631('0x18')]['find']({'raw':_0x5c24f6[_0xe631('0x1a')]?_0x5c24f6[_0xe631('0x1a')][_0xe631('0x1b')]===undefined?!![]:![]:!![],'where':_0x5c24f6[_0xe631('0x1a')]?_0x5c24f6[_0xe631('0x1a')][_0xe631('0x1c')]||null:null,'attributes':_0x5c24f6[_0xe631('0x1a')]?_0x5c24f6[_0xe631('0x1a')][_0xe631('0x1d')]||null:null,'include':_0x5c24f6[_0xe631('0x1a')]?_0x5c24f6['options'][_0xe631('0x20')]?_[_0xe631('0x1f')](_0x5c24f6[_0xe631('0x1a')]['include'],function(_0x34890d){return{'model':db[_0x34890d['model']],'as':_0x34890d['as'],'attributes':_0x34890d['attributes'],'include':_0x34890d['include']?_['map'](_0x34890d[_0xe631('0x20')],function(_0x4a56cc){return{'model':db[_0x4a56cc['model']],'as':_0x4a56cc['as'],'attributes':_0x4a56cc[_0xe631('0x1d')],'include':_0x4a56cc[_0xe631('0x20')]?_[_0xe631('0x1f')](_0x4a56cc['include'],function(_0x1f2a01){return{'model':db[_0x1f2a01[_0xe631('0x21')]],'as':_0x1f2a01['as'],'attributes':_0x1f2a01[_0xe631('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe631('0x22')](function(_0x5e0889){logger[_0xe631('0xd')](_0xe631('0x23'),_0x5c24f6);logger[_0xe631('0x10')](_0xe631('0x23'),_0x5c24f6,JSON[_0xe631('0x12')](_0x5e0889));_0x26d999(_0x5e0889);})['catch'](function(_0x2a1543){logger[_0xe631('0x13')](_0xe631('0x23'),_0x2a1543[_0xe631('0x14')],_0x5c24f6);_0xcc6be9(_0x4e7df3[_0xe631('0x13')](0x1f4,_0x2a1543[_0xe631('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index d1d91bb..78fa8da 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 _0xa87a=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','index','get','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','multer','util','path','express','Router','fs-extra'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa87a,0xfe));var _0xaa87=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa87a[_0x4b7b62];return _0x2280df;};'use strict';var multer=require(_0xaa87('0x0'));var util=require(_0xaa87('0x1'));var path=require(_0xaa87('0x2'));var timeout=require('connect-timeout');var express=require(_0xaa87('0x3'));var router=express[_0xaa87('0x4')]();var fs_extra=require(_0xaa87('0x5'));var auth=require(_0xaa87('0x6'));var interaction=require(_0xaa87('0x7'));var config=require(_0xaa87('0x8'));var controller=require(_0xaa87('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xaa87('0xa')]);router[_0xaa87('0xb')](_0xaa87('0xc'),auth['isAuthenticated'](),controller[_0xaa87('0xd')]);router[_0xaa87('0xb')](_0xaa87('0xe'),auth[_0xaa87('0xf')](),controller[_0xaa87('0x10')]);router['get'](_0xaa87('0x11'),auth[_0xaa87('0xf')](),controller[_0xaa87('0x12')]);router[_0xaa87('0xb')](_0xaa87('0x13'),auth[_0xaa87('0xf')](),controller[_0xaa87('0x14')]);router[_0xaa87('0x15')]('/',auth[_0xaa87('0xf')](),controller[_0xaa87('0x16')]);router[_0xaa87('0x17')]('/:id',auth[_0xaa87('0xf')](),controller[_0xaa87('0x18')]);router[_0xaa87('0x19')](_0xaa87('0xc'),auth[_0xaa87('0xf')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3f1c=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x3f1c,0x193));var _0xc3f1=function(_0x3fdae9,_0x5d41f7){_0x3fdae9=_0x3fdae9-0x0;var _0x551ff9=_0x3f1c[_0x3fdae9];return _0x551ff9;};'use strict';var multer=require(_0xc3f1('0x0'));var util=require(_0xc3f1('0x1'));var path=require(_0xc3f1('0x2'));var timeout=require(_0xc3f1('0x3'));var express=require(_0xc3f1('0x4'));var router=express[_0xc3f1('0x5')]();var fs_extra=require(_0xc3f1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc3f1('0x7'));var config=require('../../config/environment');var controller=require(_0xc3f1('0x8'));router[_0xc3f1('0x9')]('/',auth[_0xc3f1('0xa')](),controller['index']);router[_0xc3f1('0x9')](_0xc3f1('0xb'),auth[_0xc3f1('0xa')](),controller[_0xc3f1('0xc')]);router[_0xc3f1('0x9')](_0xc3f1('0xd'),auth['isAuthenticated'](),controller[_0xc3f1('0xe')]);router['get'](_0xc3f1('0xf'),auth[_0xc3f1('0xa')](),controller[_0xc3f1('0x10')]);router[_0xc3f1('0x9')](_0xc3f1('0x11'),auth[_0xc3f1('0xa')](),controller[_0xc3f1('0x12')]);router[_0xc3f1('0x13')]('/',auth[_0xc3f1('0xa')](),controller['create']);router[_0xc3f1('0x14')](_0xc3f1('0xb'),auth[_0xc3f1('0xa')](),controller[_0xc3f1('0x15')]);router[_0xc3f1('0x16')](_0xc3f1('0xb'),auth[_0xc3f1('0xa')](),controller[_0xc3f1('0x17')]);module[_0xc3f1('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 c24f490..96131c1 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 _0x12a8=['sequelize','exports','STRING'];(function(_0x3ea70c,_0x3c97a2){var _0x164ae2=function(_0x4d8bbf){while(--_0x4d8bbf){_0x3ea70c['push'](_0x3ea70c['shift']());}};_0x164ae2(++_0x3c97a2);}(_0x12a8,0x159));var _0x812a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x12a8[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x812a('0x0'));module[_0x812a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x812a('0x2')]}}; \ No newline at end of file +var _0x4a87=['sequelize','exports','STRING'];(function(_0x91cf10,_0x2bb015){var _0x3f6788=function(_0x5d9246){while(--_0x5d9246){_0x91cf10['push'](_0x91cf10['shift']());}};_0x3f6788(++_0x2bb015);}(_0x4a87,0xe4));var _0x74a8=function(_0x9f4631,_0x1e8618){_0x9f4631=_0x9f4631-0x0;var _0x2b6faa=_0x4a87[_0x9f4631];return _0x2b6faa;};'use strict';var Sequelize=require(_0x74a8('0x0'));module[_0x74a8('0x1')]={'name':{'type':Sequelize[_0x74a8('0x2')]},'description':{'type':Sequelize[_0x74a8('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 683e935..5f2031a 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 _0xcb6c=['options','findAll','rows','catch','show','params','keys','fields','includeAll','include','find','create','body','getFields','findOne','getSubjects','SugarcrmField','getDescriptions','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','type','key','model','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','VIRTUAL'];(function(_0x13d9a7,_0x4ba8c7){var _0x11b69c=function(_0x1f12bc){while(--_0x1f12bc){_0x13d9a7['push'](_0x13d9a7['shift']());}};_0x11b69c(++_0x4ba8c7);}(_0xcb6c,0xb0));var _0xccb6=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xcb6c[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xccb6('0x0'));var zipdir=require(_0xccb6('0x1'));var jsonpatch=require(_0xccb6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xccb6('0x3'));var Mustache=require('mustache');var util=require(_0xccb6('0x4'));var path=require(_0xccb6('0x5'));var sox=require(_0xccb6('0x6'));var csv=require(_0xccb6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xccb6('0x8'));var _=require('lodash');var squel=require(_0xccb6('0x9'));var crypto=require('crypto');var jsforce=require(_0xccb6('0xa'));var deskjs=require(_0xccb6('0xb'));var toCsv=require(_0xccb6('0x7'));var querystring=require(_0xccb6('0xc'));var Papa=require(_0xccb6('0xd'));var Redis=require('ioredis');var authService=require(_0xccb6('0xe'));var qs=require(_0xccb6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xccb6('0x10'));var logger=require(_0xccb6('0x11'))(_0xccb6('0x12'));var utils=require('../../config/utils');var config=require(_0xccb6('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xccb6('0x14'))['db'];function respondWithStatusCode(_0x5a5284,_0x6fb5b0){_0x6fb5b0=_0x6fb5b0||0xcc;return function(_0x505508){if(_0x505508){return _0x5a5284['sendStatus'](_0x6fb5b0);}return _0x5a5284[_0xccb6('0x15')](_0x6fb5b0)[_0xccb6('0x16')]();};}function respondWithResult(_0x593c6a,_0x3c7ee4){_0x3c7ee4=_0x3c7ee4||0xc8;return function(_0x332382){if(_0x332382){return _0x593c6a[_0xccb6('0x15')](_0x3c7ee4)[_0xccb6('0x17')](_0x332382);}};}function respondWithFilteredResult(_0x4f43b6,_0x344ca8){return function(_0x2041eb){if(_0x2041eb){var _0x15cdde=typeof _0x344ca8['offset']===_0xccb6('0x18')&&typeof _0x344ca8['limit']===_0xccb6('0x18');var _0x4928a8=_0x2041eb[_0xccb6('0x19')];var _0x4c98d3=_0x15cdde?0x0:_0x344ca8['offset'];var _0x3d6419=_0x15cdde?_0x2041eb[_0xccb6('0x19')]:_0x344ca8[_0xccb6('0x1a')]+_0x344ca8['limit'];var _0x34a6c3;if(_0x3d6419>=_0x4928a8){_0x3d6419=_0x4928a8;_0x34a6c3=0xc8;}else{_0x34a6c3=0xce;}_0x4f43b6[_0xccb6('0x15')](_0x34a6c3);return _0x4f43b6[_0xccb6('0x1b')](_0xccb6('0x1c'),_0x4c98d3+'-'+_0x3d6419+'/'+_0x4928a8)['json'](_0x2041eb);}return null;};}function patchUpdates(_0xab4d18){return function(_0x5913e2){try{jsonpatch['apply'](_0x5913e2,_0xab4d18,!![]);}catch(_0x363eeb){return BPromise[_0xccb6('0x1d')](_0x363eeb);}return _0x5913e2[_0xccb6('0x1e')]();};}function saveUpdates(_0x3340b6,_0x680a36){return function(_0x219a2e){if(_0x219a2e){return _0x219a2e[_0xccb6('0x1f')](_0x3340b6)[_0xccb6('0x20')](function(_0x324676){return _0x324676;});}return null;};}function removeEntity(_0x549feb,_0x5b371b){return function(_0x28eadd){if(_0x28eadd){return _0x28eadd[_0xccb6('0x21')]()[_0xccb6('0x20')](function(){_0x549feb[_0xccb6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xec08ba,_0x120541){return function(_0x31fed1){if(!_0x31fed1){_0xec08ba[_0xccb6('0x22')](0x194);}return _0x31fed1;};}function handleError(_0x3c18e9,_0x10fa63){_0x10fa63=_0x10fa63||0x1f4;return function(_0x1ac555){logger[_0xccb6('0x23')](_0x1ac555[_0xccb6('0x24')]);if(_0x1ac555[_0xccb6('0x25')]){delete _0x1ac555['name'];}_0x3c18e9['status'](_0x10fa63)[_0xccb6('0x26')](_0x1ac555);};}exports[_0xccb6('0x27')]=function(_0x2f26dc,_0x21b08b){var _0x3226a8={},_0x51c97c={},_0x3d99fe={'count':0x0,'rows':[]};var _0x41299d=_[_0xccb6('0x28')](db[_0xccb6('0x29')][_0xccb6('0x2a')],function(_0x471b8d){return{'name':_0x471b8d['fieldName'],'type':_0x471b8d[_0xccb6('0x2b')][_0xccb6('0x2c')]};});_0x51c97c[_0xccb6('0x2d')]=_[_0xccb6('0x28')](_0x41299d,'name');_0x51c97c['query']=_['keys'](_0x2f26dc[_0xccb6('0x2e')]);_0x51c97c[_0xccb6('0x2f')]=_['intersection'](_0x51c97c[_0xccb6('0x2d')],_0x51c97c[_0xccb6('0x2e')]);_0x3226a8[_0xccb6('0x30')]=_[_0xccb6('0x31')](_0x51c97c[_0xccb6('0x2d')],qs['fields'](_0x2f26dc[_0xccb6('0x2e')]['fields']));_0x3226a8[_0xccb6('0x30')]=_0x3226a8['attributes'][_0xccb6('0x32')]?_0x3226a8[_0xccb6('0x30')]:_0x51c97c[_0xccb6('0x2d')];if(!_0x2f26dc[_0xccb6('0x2e')][_0xccb6('0x33')](_0xccb6('0x34'))){_0x3226a8['limit']=qs[_0xccb6('0x35')](_0x2f26dc[_0xccb6('0x2e')][_0xccb6('0x35')]);_0x3226a8['offset']=qs[_0xccb6('0x1a')](_0x2f26dc['query'][_0xccb6('0x1a')]);}_0x3226a8[_0xccb6('0x36')]=qs[_0xccb6('0x37')](_0x2f26dc[_0xccb6('0x2e')]['sort']);_0x3226a8['where']=qs['filters'](_[_0xccb6('0x38')](_0x2f26dc['query'],_0x51c97c[_0xccb6('0x2f')]),_0x41299d);if(_0x2f26dc['query'][_0xccb6('0x39')]){_0x3226a8['where']=_[_0xccb6('0x3a')](_0x3226a8[_0xccb6('0x3b')],{'$or':_[_0xccb6('0x28')](_0x41299d,function(_0x1e3d21){if(_0x1e3d21[_0xccb6('0x2b')]!==_0xccb6('0x3c')){var _0x5c8cf3={};_0x5c8cf3[_0x1e3d21[_0xccb6('0x25')]]={'$like':'%'+_0x2f26dc[_0xccb6('0x2e')]['filter']+'%'};return _0x5c8cf3;}})});}_0x3226a8=_[_0xccb6('0x3a')]({},_0x3226a8,_0x2f26dc[_0xccb6('0x3d')]);var _0x2045ba={'where':_0x3226a8['where']};return db['SugarcrmConfiguration'][_0xccb6('0x19')](_0x2045ba)[_0xccb6('0x20')](function(_0xff88f){_0x3d99fe['count']=_0xff88f;if(_0x2f26dc[_0xccb6('0x2e')]['includeAll']){_0x3226a8['include']=[{'all':!![]}];}return db[_0xccb6('0x29')][_0xccb6('0x3e')](_0x3226a8);})[_0xccb6('0x20')](function(_0x429595){_0x3d99fe[_0xccb6('0x3f')]=_0x429595;return _0x3d99fe;})[_0xccb6('0x20')](respondWithFilteredResult(_0x21b08b,_0x3226a8))[_0xccb6('0x40')](handleError(_0x21b08b,null));};exports[_0xccb6('0x41')]=function(_0x2a0303,_0x5b970a){var _0x13f46d={'raw':![],'where':{'id':_0x2a0303[_0xccb6('0x42')]['id']}},_0x71661e={};_0x71661e['model']=_[_0xccb6('0x43')](db[_0xccb6('0x29')][_0xccb6('0x2a')]);_0x71661e[_0xccb6('0x2e')]=_[_0xccb6('0x43')](_0x2a0303[_0xccb6('0x2e')]);_0x71661e[_0xccb6('0x2f')]=_['intersection'](_0x71661e[_0xccb6('0x2d')],_0x71661e['query']);_0x13f46d[_0xccb6('0x30')]=_['intersection'](_0x71661e[_0xccb6('0x2d')],qs[_0xccb6('0x44')](_0x2a0303['query'][_0xccb6('0x44')]));_0x13f46d[_0xccb6('0x30')]=_0x13f46d['attributes'][_0xccb6('0x32')]?_0x13f46d[_0xccb6('0x30')]:_0x71661e[_0xccb6('0x2d')];if(_0x2a0303[_0xccb6('0x2e')][_0xccb6('0x45')]){_0x13f46d[_0xccb6('0x46')]=[{'all':!![]}];}_0x13f46d=_[_0xccb6('0x3a')]({},_0x13f46d,_0x2a0303['options']);return db['SugarcrmConfiguration'][_0xccb6('0x47')](_0x13f46d)[_0xccb6('0x20')](handleEntityNotFound(_0x5b970a,null))[_0xccb6('0x20')](respondWithResult(_0x5b970a,null))['catch'](handleError(_0x5b970a,null));};exports[_0xccb6('0x48')]=function(_0x2c2718,_0x1dd775){return db[_0xccb6('0x29')][_0xccb6('0x48')](_0x2c2718[_0xccb6('0x49')],{})[_0xccb6('0x20')](respondWithResult(_0x1dd775,0xc9))['catch'](handleError(_0x1dd775,null));};exports[_0xccb6('0x1f')]=function(_0x1a6558,_0x5e2829){if(_0x1a6558['body']['id']){delete _0x1a6558[_0xccb6('0x49')]['id'];}return db['SugarcrmConfiguration'][_0xccb6('0x47')]({'where':{'id':_0x1a6558[_0xccb6('0x42')]['id']}})['then'](handleEntityNotFound(_0x5e2829,null))['then'](saveUpdates(_0x1a6558[_0xccb6('0x49')],null))[_0xccb6('0x20')](respondWithResult(_0x5e2829,null))[_0xccb6('0x40')](handleError(_0x5e2829,null));};exports[_0xccb6('0x21')]=function(_0x5a5d19,_0x316765){return db[_0xccb6('0x29')][_0xccb6('0x47')]({'where':{'id':_0x5a5d19['params']['id']}})[_0xccb6('0x20')](handleEntityNotFound(_0x316765,null))['then'](removeEntity(_0x316765,null))[_0xccb6('0x40')](handleError(_0x316765,null));};exports[_0xccb6('0x4a')]=function(_0xe7b905,_0x438039,_0x261cf6){var _0x3461b5={};var _0x3b7e34={};var _0x623882;var _0x5be8f1;return db['SugarcrmConfiguration'][_0xccb6('0x4b')]({'where':{'id':_0xe7b905[_0xccb6('0x42')]['id']}})[_0xccb6('0x20')](handleEntityNotFound(_0x438039,null))['then'](function(_0x3926de){if(_0x3926de){_0x623882=_0x3926de;_0x3b7e34['model']=_[_0xccb6('0x43')](db['SugarcrmField'][_0xccb6('0x2a')]);_0x3b7e34[_0xccb6('0x2e')]=_[_0xccb6('0x43')](_0xe7b905['query']);_0x3b7e34['filters']=_[_0xccb6('0x31')](_0x3b7e34[_0xccb6('0x2d')],_0x3b7e34[_0xccb6('0x2e')]);_0x3461b5[_0xccb6('0x30')]=_['intersection'](_0x3b7e34[_0xccb6('0x2d')],qs[_0xccb6('0x44')](_0xe7b905['query'][_0xccb6('0x44')]));_0x3461b5[_0xccb6('0x30')]=_0x3461b5[_0xccb6('0x30')][_0xccb6('0x32')]?_0x3461b5[_0xccb6('0x30')]:_0x3b7e34[_0xccb6('0x2d')];_0x3461b5['order']=qs[_0xccb6('0x37')](_0xe7b905[_0xccb6('0x2e')][_0xccb6('0x37')]);_0x3461b5['where']=qs[_0xccb6('0x2f')](_['pick'](_0xe7b905['query'],_0x3b7e34['filters']));if(_0xe7b905[_0xccb6('0x2e')]['filter']){_0x3461b5['where']=_[_0xccb6('0x3a')](_0x3461b5['where'],{'$or':_[_0xccb6('0x28')](_0x3461b5[_0xccb6('0x30')],function(_0x154f67){var _0x16195f={};_0x16195f[_0x154f67]={'$like':'%'+_0xe7b905[_0xccb6('0x2e')][_0xccb6('0x39')]+'%'};return _0x16195f;})});}_0x3461b5=_['merge']({},_0x3461b5,_0xe7b905[_0xccb6('0x3d')]);return _0x623882[_0xccb6('0x4a')](_0x3461b5);}})['then'](function(_0x4adda2){if(_0x4adda2){_0x5be8f1=_0x4adda2['length'];if(!_0xe7b905[_0xccb6('0x2e')][_0xccb6('0x33')](_0xccb6('0x34'))){_0x3461b5[_0xccb6('0x35')]=qs[_0xccb6('0x35')](_0xe7b905[_0xccb6('0x2e')][_0xccb6('0x35')]);_0x3461b5[_0xccb6('0x1a')]=qs[_0xccb6('0x1a')](_0xe7b905[_0xccb6('0x2e')][_0xccb6('0x1a')]);}return _0x623882['getFields'](_0x3461b5);}})[_0xccb6('0x20')](function(_0x3ef817){if(_0x3ef817){return _0x3ef817?{'count':_0x5be8f1,'rows':_0x3ef817}:null;}})[_0xccb6('0x20')](respondWithResult(_0x438039,null))[_0xccb6('0x40')](handleError(_0x438039,null));};exports[_0xccb6('0x4c')]=function(_0x493fec,_0x122e78,_0x146e70){var _0x5722f9={};var _0xd39d58={};var _0x53a19b;var _0x351cc0;return db['SugarcrmConfiguration'][_0xccb6('0x4b')]({'where':{'id':_0x493fec[_0xccb6('0x42')]['id']}})[_0xccb6('0x20')](handleEntityNotFound(_0x122e78,null))[_0xccb6('0x20')](function(_0x33d77f){if(_0x33d77f){_0x53a19b=_0x33d77f;_0xd39d58[_0xccb6('0x2d')]=_[_0xccb6('0x43')](db[_0xccb6('0x4d')][_0xccb6('0x2a')]);_0xd39d58[_0xccb6('0x2e')]=_['keys'](_0x493fec[_0xccb6('0x2e')]);_0xd39d58[_0xccb6('0x2f')]=_[_0xccb6('0x31')](_0xd39d58[_0xccb6('0x2d')],_0xd39d58[_0xccb6('0x2e')]);_0x5722f9['attributes']=_['intersection'](_0xd39d58[_0xccb6('0x2d')],qs['fields'](_0x493fec[_0xccb6('0x2e')][_0xccb6('0x44')]));_0x5722f9[_0xccb6('0x30')]=_0x5722f9[_0xccb6('0x30')][_0xccb6('0x32')]?_0x5722f9[_0xccb6('0x30')]:_0xd39d58[_0xccb6('0x2d')];_0x5722f9[_0xccb6('0x36')]=qs['sort'](_0x493fec[_0xccb6('0x2e')]['sort']);_0x5722f9[_0xccb6('0x3b')]=qs[_0xccb6('0x2f')](_[_0xccb6('0x38')](_0x493fec[_0xccb6('0x2e')],_0xd39d58[_0xccb6('0x2f')]));if(_0x493fec[_0xccb6('0x2e')][_0xccb6('0x39')]){_0x5722f9[_0xccb6('0x3b')]=_[_0xccb6('0x3a')](_0x5722f9[_0xccb6('0x3b')],{'$or':_['map'](_0x5722f9[_0xccb6('0x30')],function(_0x5c778b){var _0x56c151={};_0x56c151[_0x5c778b]={'$like':'%'+_0x493fec[_0xccb6('0x2e')][_0xccb6('0x39')]+'%'};return _0x56c151;})});}_0x5722f9=_[_0xccb6('0x3a')]({},_0x5722f9,_0x493fec[_0xccb6('0x3d')]);return _0x53a19b[_0xccb6('0x4c')](_0x5722f9);}})[_0xccb6('0x20')](function(_0x2d8533){if(_0x2d8533){_0x351cc0=_0x2d8533['length'];if(!_0x493fec[_0xccb6('0x2e')][_0xccb6('0x33')](_0xccb6('0x34'))){_0x5722f9[_0xccb6('0x35')]=qs[_0xccb6('0x35')](_0x493fec[_0xccb6('0x2e')][_0xccb6('0x35')]);_0x5722f9[_0xccb6('0x1a')]=qs[_0xccb6('0x1a')](_0x493fec[_0xccb6('0x2e')][_0xccb6('0x1a')]);}return _0x53a19b[_0xccb6('0x4c')](_0x5722f9);}})['then'](function(_0x495d90){if(_0x495d90){return _0x495d90?{'count':_0x351cc0,'rows':_0x495d90}:null;}})[_0xccb6('0x20')](respondWithResult(_0x122e78,null))[_0xccb6('0x40')](handleError(_0x122e78,null));};exports[_0xccb6('0x4e')]=function(_0x4925fe,_0x341bb9,_0x58e321){var _0x1ef25e={};var _0x21aeba={};var _0x26681d;var _0x59b88d;return db['SugarcrmConfiguration'][_0xccb6('0x4b')]({'where':{'id':_0x4925fe[_0xccb6('0x42')]['id']}})[_0xccb6('0x20')](handleEntityNotFound(_0x341bb9,null))[_0xccb6('0x20')](function(_0x6022b4){if(_0x6022b4){_0x26681d=_0x6022b4;_0x21aeba[_0xccb6('0x2d')]=_[_0xccb6('0x43')](db[_0xccb6('0x4d')][_0xccb6('0x2a')]);_0x21aeba[_0xccb6('0x2e')]=_[_0xccb6('0x43')](_0x4925fe[_0xccb6('0x2e')]);_0x21aeba[_0xccb6('0x2f')]=_['intersection'](_0x21aeba['model'],_0x21aeba['query']);_0x1ef25e['attributes']=_[_0xccb6('0x31')](_0x21aeba[_0xccb6('0x2d')],qs[_0xccb6('0x44')](_0x4925fe[_0xccb6('0x2e')][_0xccb6('0x44')]));_0x1ef25e[_0xccb6('0x30')]=_0x1ef25e[_0xccb6('0x30')][_0xccb6('0x32')]?_0x1ef25e['attributes']:_0x21aeba['model'];_0x1ef25e[_0xccb6('0x36')]=qs[_0xccb6('0x37')](_0x4925fe[_0xccb6('0x2e')][_0xccb6('0x37')]);_0x1ef25e[_0xccb6('0x3b')]=qs[_0xccb6('0x2f')](_['pick'](_0x4925fe['query'],_0x21aeba['filters']));if(_0x4925fe[_0xccb6('0x2e')]['filter']){_0x1ef25e[_0xccb6('0x3b')]=_[_0xccb6('0x3a')](_0x1ef25e[_0xccb6('0x3b')],{'$or':_[_0xccb6('0x28')](_0x1ef25e[_0xccb6('0x30')],function(_0x3ca33b){var _0x1390a0={};_0x1390a0[_0x3ca33b]={'$like':'%'+_0x4925fe[_0xccb6('0x2e')]['filter']+'%'};return _0x1390a0;})});}_0x1ef25e=_[_0xccb6('0x3a')]({},_0x1ef25e,_0x4925fe['options']);return _0x26681d['getDescriptions'](_0x1ef25e);}})['then'](function(_0x53fda6){if(_0x53fda6){_0x59b88d=_0x53fda6[_0xccb6('0x32')];if(!_0x4925fe['query'][_0xccb6('0x33')]('nolimit')){_0x1ef25e[_0xccb6('0x35')]=qs[_0xccb6('0x35')](_0x4925fe[_0xccb6('0x2e')][_0xccb6('0x35')]);_0x1ef25e[_0xccb6('0x1a')]=qs[_0xccb6('0x1a')](_0x4925fe['query'][_0xccb6('0x1a')]);}return _0x26681d[_0xccb6('0x4e')](_0x1ef25e);}})[_0xccb6('0x20')](function(_0x4a2f17){if(_0x4a2f17){return _0x4a2f17?{'count':_0x59b88d,'rows':_0x4a2f17}:null;}})[_0xccb6('0x20')](respondWithResult(_0x341bb9,null))[_0xccb6('0x40')](handleError(_0x341bb9,null));}; \ No newline at end of file +var _0xb50e=['moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','apply','reject','save','update','then','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','SugarcrmConfiguration','findAll','catch','show','keys','include','find','create','body','params','destroy','getFields','SugarcrmField','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','request-promise'];(function(_0x1b7547,_0x56d61c){var _0x2a4c21=function(_0x4c5cf8){while(--_0x4c5cf8){_0x1b7547['push'](_0x1b7547['shift']());}};_0x2a4c21(++_0x56d61c);}(_0xb50e,0x178));var _0xeb50=function(_0x35f969,_0x2c03bd){_0x35f969=_0x35f969-0x0;var _0x373c46=_0xb50e[_0x35f969];return _0x373c46;};'use strict';var emlformat=require(_0xeb50('0x0'));var rimraf=require(_0xeb50('0x1'));var zipdir=require(_0xeb50('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeb50('0x3'));var moment=require(_0xeb50('0x4'));var BPromise=require(_0xeb50('0x5'));var Mustache=require(_0xeb50('0x6'));var util=require(_0xeb50('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xeb50('0x8'));var ejs=require(_0xeb50('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb50('0xa'));var squel=require(_0xeb50('0xb'));var crypto=require('crypto');var jsforce=require(_0xeb50('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xeb50('0x8'));var querystring=require('querystring');var Papa=require(_0xeb50('0xd'));var Redis=require(_0xeb50('0xe'));var authService=require(_0xeb50('0xf'));var qs=require(_0xeb50('0x10'));var as=require(_0xeb50('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xeb50('0x12'));var utils=require('../../config/utils');var config=require(_0xeb50('0x13'));var licenseUtil=require(_0xeb50('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x361015,_0x2e5770){_0x2e5770=_0x2e5770||0xcc;return function(_0x3ce60e){if(_0x3ce60e){return _0x361015[_0xeb50('0x15')](_0x2e5770);}return _0x361015[_0xeb50('0x16')](_0x2e5770)['end']();};}function respondWithResult(_0xd30af8,_0x46ebbf){_0x46ebbf=_0x46ebbf||0xc8;return function(_0x1d6b5d){if(_0x1d6b5d){return _0xd30af8[_0xeb50('0x16')](_0x46ebbf)['json'](_0x1d6b5d);}};}function respondWithFilteredResult(_0x5ee6d3,_0x34acc6){return function(_0x354eca){if(_0x354eca){var _0x564c3e=typeof _0x34acc6[_0xeb50('0x17')]===_0xeb50('0x18')&&typeof _0x34acc6[_0xeb50('0x19')]==='undefined';var _0x262af6=_0x354eca['count'];var _0x527983=_0x564c3e?0x0:_0x34acc6[_0xeb50('0x17')];var _0x3099f0=_0x564c3e?_0x354eca[_0xeb50('0x1a')]:_0x34acc6['offset']+_0x34acc6[_0xeb50('0x19')];var _0x2878d1;if(_0x3099f0>=_0x262af6){_0x3099f0=_0x262af6;_0x2878d1=0xc8;}else{_0x2878d1=0xce;}_0x5ee6d3[_0xeb50('0x16')](_0x2878d1);return _0x5ee6d3['set']('Content-Range',_0x527983+'-'+_0x3099f0+'/'+_0x262af6)['json'](_0x354eca);}return null;};}function patchUpdates(_0x2f7f52){return function(_0x584dfb){try{jsonpatch[_0xeb50('0x1b')](_0x584dfb,_0x2f7f52,!![]);}catch(_0x199fcf){return BPromise[_0xeb50('0x1c')](_0x199fcf);}return _0x584dfb[_0xeb50('0x1d')]();};}function saveUpdates(_0x2abd53,_0x40f16b){return function(_0x237543){if(_0x237543){return _0x237543[_0xeb50('0x1e')](_0x2abd53)['then'](function(_0x1ea1b4){return _0x1ea1b4;});}return null;};}function removeEntity(_0x50978f,_0x5c4881){return function(_0x3b1c7b){if(_0x3b1c7b){return _0x3b1c7b['destroy']()[_0xeb50('0x1f')](function(){_0x50978f[_0xeb50('0x16')](0xcc)[_0xeb50('0x20')]();});}};}function handleEntityNotFound(_0x93ec24,_0x3dbace){return function(_0x140ffd){if(!_0x140ffd){_0x93ec24[_0xeb50('0x15')](0x194);}return _0x140ffd;};}function handleError(_0x21729b,_0x234025){_0x234025=_0x234025||0x1f4;return function(_0xff3a61){logger[_0xeb50('0x21')](_0xff3a61[_0xeb50('0x22')]);if(_0xff3a61[_0xeb50('0x23')]){delete _0xff3a61[_0xeb50('0x23')];}_0x21729b[_0xeb50('0x16')](_0x234025)[_0xeb50('0x24')](_0xff3a61);};}exports[_0xeb50('0x25')]=function(_0x1d8835,_0xea7b40){var _0x5cedb7={},_0xea6af={},_0x2e07d1={'count':0x0,'rows':[]};var _0x440225=_[_0xeb50('0x26')](db['SugarcrmConfiguration'][_0xeb50('0x27')],function(_0x4f1411){return{'name':_0x4f1411['fieldName'],'type':_0x4f1411[_0xeb50('0x28')][_0xeb50('0x29')]};});_0xea6af[_0xeb50('0x2a')]=_[_0xeb50('0x26')](_0x440225,_0xeb50('0x23'));_0xea6af[_0xeb50('0x2b')]=_['keys'](_0x1d8835[_0xeb50('0x2b')]);_0xea6af['filters']=_[_0xeb50('0x2c')](_0xea6af[_0xeb50('0x2a')],_0xea6af[_0xeb50('0x2b')]);_0x5cedb7[_0xeb50('0x2d')]=_[_0xeb50('0x2c')](_0xea6af[_0xeb50('0x2a')],qs[_0xeb50('0x2e')](_0x1d8835[_0xeb50('0x2b')][_0xeb50('0x2e')]));_0x5cedb7[_0xeb50('0x2d')]=_0x5cedb7[_0xeb50('0x2d')][_0xeb50('0x2f')]?_0x5cedb7[_0xeb50('0x2d')]:_0xea6af[_0xeb50('0x2a')];if(!_0x1d8835[_0xeb50('0x2b')][_0xeb50('0x30')](_0xeb50('0x31'))){_0x5cedb7[_0xeb50('0x19')]=qs['limit'](_0x1d8835[_0xeb50('0x2b')][_0xeb50('0x19')]);_0x5cedb7['offset']=qs[_0xeb50('0x17')](_0x1d8835[_0xeb50('0x2b')]['offset']);}_0x5cedb7[_0xeb50('0x32')]=qs[_0xeb50('0x33')](_0x1d8835[_0xeb50('0x2b')][_0xeb50('0x33')]);_0x5cedb7['where']=qs[_0xeb50('0x34')](_[_0xeb50('0x35')](_0x1d8835[_0xeb50('0x2b')],_0xea6af[_0xeb50('0x34')]),_0x440225);if(_0x1d8835[_0xeb50('0x2b')][_0xeb50('0x36')]){_0x5cedb7[_0xeb50('0x37')]=_[_0xeb50('0x38')](_0x5cedb7[_0xeb50('0x37')],{'$or':_['map'](_0x440225,function(_0x453d9f){if(_0x453d9f['type']!==_0xeb50('0x39')){var _0x10afbb={};_0x10afbb[_0x453d9f[_0xeb50('0x23')]]={'$like':'%'+_0x1d8835[_0xeb50('0x2b')][_0xeb50('0x36')]+'%'};return _0x10afbb;}})});}_0x5cedb7=_['merge']({},_0x5cedb7,_0x1d8835[_0xeb50('0x3a')]);var _0x261ac2={'where':_0x5cedb7['where']};return db['SugarcrmConfiguration'][_0xeb50('0x1a')](_0x261ac2)['then'](function(_0x3e5593){_0x2e07d1['count']=_0x3e5593;if(_0x1d8835[_0xeb50('0x2b')][_0xeb50('0x3b')]){_0x5cedb7['include']=[{'all':!![]}];}return db[_0xeb50('0x3c')][_0xeb50('0x3d')](_0x5cedb7);})[_0xeb50('0x1f')](function(_0x2435f){_0x2e07d1['rows']=_0x2435f;return _0x2e07d1;})[_0xeb50('0x1f')](respondWithFilteredResult(_0xea7b40,_0x5cedb7))[_0xeb50('0x3e')](handleError(_0xea7b40,null));};exports[_0xeb50('0x3f')]=function(_0x21153a,_0x54e4d5){var _0x88a5e6={'raw':![],'where':{'id':_0x21153a['params']['id']}},_0xbabdb4={};_0xbabdb4['model']=_['keys'](db[_0xeb50('0x3c')][_0xeb50('0x27')]);_0xbabdb4['query']=_[_0xeb50('0x40')](_0x21153a[_0xeb50('0x2b')]);_0xbabdb4[_0xeb50('0x34')]=_[_0xeb50('0x2c')](_0xbabdb4[_0xeb50('0x2a')],_0xbabdb4[_0xeb50('0x2b')]);_0x88a5e6[_0xeb50('0x2d')]=_['intersection'](_0xbabdb4[_0xeb50('0x2a')],qs[_0xeb50('0x2e')](_0x21153a[_0xeb50('0x2b')]['fields']));_0x88a5e6[_0xeb50('0x2d')]=_0x88a5e6[_0xeb50('0x2d')][_0xeb50('0x2f')]?_0x88a5e6[_0xeb50('0x2d')]:_0xbabdb4['model'];if(_0x21153a[_0xeb50('0x2b')][_0xeb50('0x3b')]){_0x88a5e6[_0xeb50('0x41')]=[{'all':!![]}];}_0x88a5e6=_['merge']({},_0x88a5e6,_0x21153a[_0xeb50('0x3a')]);return db[_0xeb50('0x3c')][_0xeb50('0x42')](_0x88a5e6)['then'](handleEntityNotFound(_0x54e4d5,null))['then'](respondWithResult(_0x54e4d5,null))[_0xeb50('0x3e')](handleError(_0x54e4d5,null));};exports['create']=function(_0x409af0,_0x10a58e){return db[_0xeb50('0x3c')][_0xeb50('0x43')](_0x409af0[_0xeb50('0x44')],{})[_0xeb50('0x1f')](respondWithResult(_0x10a58e,0xc9))[_0xeb50('0x3e')](handleError(_0x10a58e,null));};exports[_0xeb50('0x1e')]=function(_0x27355f,_0x595f33){if(_0x27355f['body']['id']){delete _0x27355f[_0xeb50('0x44')]['id'];}return db[_0xeb50('0x3c')]['find']({'where':{'id':_0x27355f[_0xeb50('0x45')]['id']}})[_0xeb50('0x1f')](handleEntityNotFound(_0x595f33,null))[_0xeb50('0x1f')](saveUpdates(_0x27355f['body'],null))['then'](respondWithResult(_0x595f33,null))[_0xeb50('0x3e')](handleError(_0x595f33,null));};exports[_0xeb50('0x46')]=function(_0x386ba8,_0x4436a7){return db[_0xeb50('0x3c')][_0xeb50('0x42')]({'where':{'id':_0x386ba8[_0xeb50('0x45')]['id']}})[_0xeb50('0x1f')](handleEntityNotFound(_0x4436a7,null))[_0xeb50('0x1f')](removeEntity(_0x4436a7,null))[_0xeb50('0x3e')](handleError(_0x4436a7,null));};exports[_0xeb50('0x47')]=function(_0x2889e8,_0x1200d5,_0x4e8d5d){var _0x61e91d={};var _0x1cb547={};var _0x1441af;var _0x4cb2e2;return db[_0xeb50('0x3c')]['findOne']({'where':{'id':_0x2889e8[_0xeb50('0x45')]['id']}})[_0xeb50('0x1f')](handleEntityNotFound(_0x1200d5,null))['then'](function(_0x401271){if(_0x401271){_0x1441af=_0x401271;_0x1cb547['model']=_['keys'](db[_0xeb50('0x48')][_0xeb50('0x27')]);_0x1cb547[_0xeb50('0x2b')]=_['keys'](_0x2889e8[_0xeb50('0x2b')]);_0x1cb547[_0xeb50('0x34')]=_['intersection'](_0x1cb547[_0xeb50('0x2a')],_0x1cb547[_0xeb50('0x2b')]);_0x61e91d[_0xeb50('0x2d')]=_[_0xeb50('0x2c')](_0x1cb547[_0xeb50('0x2a')],qs[_0xeb50('0x2e')](_0x2889e8[_0xeb50('0x2b')][_0xeb50('0x2e')]));_0x61e91d[_0xeb50('0x2d')]=_0x61e91d[_0xeb50('0x2d')][_0xeb50('0x2f')]?_0x61e91d[_0xeb50('0x2d')]:_0x1cb547[_0xeb50('0x2a')];_0x61e91d[_0xeb50('0x32')]=qs[_0xeb50('0x33')](_0x2889e8['query'][_0xeb50('0x33')]);_0x61e91d[_0xeb50('0x37')]=qs[_0xeb50('0x34')](_[_0xeb50('0x35')](_0x2889e8[_0xeb50('0x2b')],_0x1cb547[_0xeb50('0x34')]));if(_0x2889e8[_0xeb50('0x2b')][_0xeb50('0x36')]){_0x61e91d[_0xeb50('0x37')]=_[_0xeb50('0x38')](_0x61e91d[_0xeb50('0x37')],{'$or':_['map'](_0x61e91d[_0xeb50('0x2d')],function(_0x204422){var _0x4dff5c={};_0x4dff5c[_0x204422]={'$like':'%'+_0x2889e8['query']['filter']+'%'};return _0x4dff5c;})});}_0x61e91d=_[_0xeb50('0x38')]({},_0x61e91d,_0x2889e8[_0xeb50('0x3a')]);return _0x1441af[_0xeb50('0x47')](_0x61e91d);}})[_0xeb50('0x1f')](function(_0xee42ad){if(_0xee42ad){_0x4cb2e2=_0xee42ad[_0xeb50('0x2f')];if(!_0x2889e8['query'][_0xeb50('0x30')](_0xeb50('0x31'))){_0x61e91d[_0xeb50('0x19')]=qs[_0xeb50('0x19')](_0x2889e8[_0xeb50('0x2b')][_0xeb50('0x19')]);_0x61e91d[_0xeb50('0x17')]=qs[_0xeb50('0x17')](_0x2889e8[_0xeb50('0x2b')][_0xeb50('0x17')]);}return _0x1441af['getFields'](_0x61e91d);}})[_0xeb50('0x1f')](function(_0x3c7a94){if(_0x3c7a94){return _0x3c7a94?{'count':_0x4cb2e2,'rows':_0x3c7a94}:null;}})[_0xeb50('0x1f')](respondWithResult(_0x1200d5,null))[_0xeb50('0x3e')](handleError(_0x1200d5,null));};exports[_0xeb50('0x49')]=function(_0x1442af,_0x109ee3,_0x401ad0){var _0x1aa627={};var _0x4ccb51={};var _0x1fa641;var _0x20e61f;return db[_0xeb50('0x3c')][_0xeb50('0x4a')]({'where':{'id':_0x1442af['params']['id']}})[_0xeb50('0x1f')](handleEntityNotFound(_0x109ee3,null))[_0xeb50('0x1f')](function(_0x26e6d0){if(_0x26e6d0){_0x1fa641=_0x26e6d0;_0x4ccb51[_0xeb50('0x2a')]=_[_0xeb50('0x40')](db['SugarcrmField'][_0xeb50('0x27')]);_0x4ccb51['query']=_[_0xeb50('0x40')](_0x1442af[_0xeb50('0x2b')]);_0x4ccb51[_0xeb50('0x34')]=_[_0xeb50('0x2c')](_0x4ccb51[_0xeb50('0x2a')],_0x4ccb51['query']);_0x1aa627[_0xeb50('0x2d')]=_[_0xeb50('0x2c')](_0x4ccb51[_0xeb50('0x2a')],qs[_0xeb50('0x2e')](_0x1442af['query'][_0xeb50('0x2e')]));_0x1aa627[_0xeb50('0x2d')]=_0x1aa627[_0xeb50('0x2d')][_0xeb50('0x2f')]?_0x1aa627['attributes']:_0x4ccb51[_0xeb50('0x2a')];_0x1aa627[_0xeb50('0x32')]=qs[_0xeb50('0x33')](_0x1442af['query']['sort']);_0x1aa627['where']=qs[_0xeb50('0x34')](_[_0xeb50('0x35')](_0x1442af[_0xeb50('0x2b')],_0x4ccb51[_0xeb50('0x34')]));if(_0x1442af[_0xeb50('0x2b')][_0xeb50('0x36')]){_0x1aa627[_0xeb50('0x37')]=_['merge'](_0x1aa627[_0xeb50('0x37')],{'$or':_['map'](_0x1aa627['attributes'],function(_0x5891de){var _0x301e91={};_0x301e91[_0x5891de]={'$like':'%'+_0x1442af[_0xeb50('0x2b')][_0xeb50('0x36')]+'%'};return _0x301e91;})});}_0x1aa627=_[_0xeb50('0x38')]({},_0x1aa627,_0x1442af[_0xeb50('0x3a')]);return _0x1fa641['getSubjects'](_0x1aa627);}})[_0xeb50('0x1f')](function(_0x2c4cc4){if(_0x2c4cc4){_0x20e61f=_0x2c4cc4[_0xeb50('0x2f')];if(!_0x1442af['query'][_0xeb50('0x30')](_0xeb50('0x31'))){_0x1aa627[_0xeb50('0x19')]=qs['limit'](_0x1442af['query']['limit']);_0x1aa627[_0xeb50('0x17')]=qs[_0xeb50('0x17')](_0x1442af[_0xeb50('0x2b')]['offset']);}return _0x1fa641['getSubjects'](_0x1aa627);}})['then'](function(_0x45a06){if(_0x45a06){return _0x45a06?{'count':_0x20e61f,'rows':_0x45a06}:null;}})[_0xeb50('0x1f')](respondWithResult(_0x109ee3,null))[_0xeb50('0x3e')](handleError(_0x109ee3,null));};exports['getDescriptions']=function(_0x35cf6d,_0x169470,_0x139358){var _0x595d54={};var _0x2d39f0={};var _0x329e68;var _0x37b6b7;return db[_0xeb50('0x3c')][_0xeb50('0x4a')]({'where':{'id':_0x35cf6d[_0xeb50('0x45')]['id']}})[_0xeb50('0x1f')](handleEntityNotFound(_0x169470,null))[_0xeb50('0x1f')](function(_0x1c7e41){if(_0x1c7e41){_0x329e68=_0x1c7e41;_0x2d39f0[_0xeb50('0x2a')]=_[_0xeb50('0x40')](db['SugarcrmField'][_0xeb50('0x27')]);_0x2d39f0[_0xeb50('0x2b')]=_['keys'](_0x35cf6d['query']);_0x2d39f0[_0xeb50('0x34')]=_[_0xeb50('0x2c')](_0x2d39f0[_0xeb50('0x2a')],_0x2d39f0['query']);_0x595d54[_0xeb50('0x2d')]=_['intersection'](_0x2d39f0[_0xeb50('0x2a')],qs[_0xeb50('0x2e')](_0x35cf6d['query'][_0xeb50('0x2e')]));_0x595d54['attributes']=_0x595d54[_0xeb50('0x2d')][_0xeb50('0x2f')]?_0x595d54[_0xeb50('0x2d')]:_0x2d39f0[_0xeb50('0x2a')];_0x595d54[_0xeb50('0x32')]=qs['sort'](_0x35cf6d[_0xeb50('0x2b')]['sort']);_0x595d54['where']=qs[_0xeb50('0x34')](_[_0xeb50('0x35')](_0x35cf6d['query'],_0x2d39f0[_0xeb50('0x34')]));if(_0x35cf6d[_0xeb50('0x2b')][_0xeb50('0x36')]){_0x595d54['where']=_[_0xeb50('0x38')](_0x595d54['where'],{'$or':_[_0xeb50('0x26')](_0x595d54[_0xeb50('0x2d')],function(_0x3340da){var _0x4204a8={};_0x4204a8[_0x3340da]={'$like':'%'+_0x35cf6d[_0xeb50('0x2b')][_0xeb50('0x36')]+'%'};return _0x4204a8;})});}_0x595d54=_[_0xeb50('0x38')]({},_0x595d54,_0x35cf6d[_0xeb50('0x3a')]);return _0x329e68[_0xeb50('0x4b')](_0x595d54);}})[_0xeb50('0x1f')](function(_0x28a55a){if(_0x28a55a){_0x37b6b7=_0x28a55a[_0xeb50('0x2f')];if(!_0x35cf6d['query']['hasOwnProperty'](_0xeb50('0x31'))){_0x595d54[_0xeb50('0x19')]=qs[_0xeb50('0x19')](_0x35cf6d[_0xeb50('0x2b')][_0xeb50('0x19')]);_0x595d54[_0xeb50('0x17')]=qs['offset'](_0x35cf6d[_0xeb50('0x2b')][_0xeb50('0x17')]);}return _0x329e68[_0xeb50('0x4b')](_0x595d54);}})[_0xeb50('0x1f')](function(_0x1c86b4){if(_0x1c86b4){return _0x1c86b4?{'count':_0x37b6b7,'rows':_0x1c86b4}:null;}})['then'](respondWithResult(_0x169470,null))[_0xeb50('0x3e')](handleError(_0x169470,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 14ea122..65bd8a8 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 _0x105e=['../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x7f8862,_0x3eb772){var _0x42f06b=function(_0x30b5e4){while(--_0x30b5e4){_0x7f8862['push'](_0x7f8862['shift']());}};_0x42f06b(++_0x3eb772);}(_0x105e,0x92));var _0xe105=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x105e[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xe105('0x0'));var util=require(_0xe105('0x1'));var logger=require(_0xe105('0x2'))(_0xe105('0x3'));var moment=require('moment');var BPromise=require(_0xe105('0x4'));var rp=require(_0xe105('0x5'));var fs=require('fs');var path=require(_0xe105('0x6'));var rimraf=require(_0xe105('0x7'));var config=require(_0xe105('0x8'));var attributes=require(_0xe105('0x9'));module[_0xe105('0xa')]=function(_0x43885b,_0x10e0d8){return _0x43885b[_0xe105('0xb')](_0xe105('0xc'),attributes,{'tableName':_0xe105('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1bec=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','int_sugarcrm_configurations'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x1bec,0x186));var _0xc1be=function(_0xdae8e6,_0x34854a){_0xdae8e6=_0xdae8e6-0x0;var _0x24c7a7=_0x1bec[_0xdae8e6];return _0x24c7a7;};'use strict';var _=require(_0xc1be('0x0'));var util=require(_0xc1be('0x1'));var logger=require(_0xc1be('0x2'))(_0xc1be('0x3'));var moment=require(_0xc1be('0x4'));var BPromise=require(_0xc1be('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc1be('0x6'));var rimraf=require(_0xc1be('0x7'));var config=require(_0xc1be('0x8'));var attributes=require(_0xc1be('0x9'));module['exports']=function(_0x22a988,_0xc75e0f){return _0x22a988[_0xc1be('0xa')](_0xc1be('0xb'),attributes,{'tableName':_0xc1be('0xc'),'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 2931275..3f9f55c 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 _0x6c7f=['client','http','request','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0xe1fb31,_0x3339bd){var _0x18504f=function(_0x1219ab){while(--_0x1219ab){_0xe1fb31['push'](_0xe1fb31['shift']());}};_0x18504f(++_0x3339bd);}(_0x6c7f,0xdc));var _0xf6c7=function(_0x5052f4,_0x34b7f4){_0x5052f4=_0x5052f4-0x0;var _0x255591=_0x6c7f[_0x5052f4];return _0x255591;};'use strict';var _=require(_0xf6c7('0x0'));var util=require(_0xf6c7('0x1'));var moment=require('moment');var BPromise=require(_0xf6c7('0x2'));var rs=require(_0xf6c7('0x3'));var fs=require('fs');var Redis=require(_0xf6c7('0x4'));var db=require(_0xf6c7('0x5'))['db'];var utils=require(_0xf6c7('0x6'));var logger=require('../../config/logger')(_0xf6c7('0x7'));var config=require(_0xf6c7('0x8'));var jayson=require(_0xf6c7('0x9'));var client=jayson[_0xf6c7('0xa')][_0xf6c7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28dcfd,_0xf33fb8,_0xccda99){return new BPromise(function(_0x3332f2,_0x140191){return client[_0xf6c7('0xc')](_0x28dcfd,_0xccda99)['then'](function(_0x8d0cdc){logger[_0xf6c7('0xd')](_0xf6c7('0xe'),_0xf33fb8,_0xf6c7('0xf'));logger['debug'](_0xf6c7('0x10'),_0xf33fb8,'request\x20sent',JSON[_0xf6c7('0x11')](_0x8d0cdc));if(_0x8d0cdc['error']){if(_0x8d0cdc[_0xf6c7('0x12')][_0xf6c7('0x13')]===0x1f4){logger[_0xf6c7('0x12')](_0xf6c7('0xe'),_0xf33fb8,_0x8d0cdc[_0xf6c7('0x12')][_0xf6c7('0x14')]);return _0x140191(_0x8d0cdc['error'][_0xf6c7('0x14')]);}logger['error'](_0xf6c7('0xe'),_0xf33fb8,_0x8d0cdc[_0xf6c7('0x12')][_0xf6c7('0x14')]);return _0x3332f2(_0x8d0cdc['error'][_0xf6c7('0x14')]);}else{logger['info'](_0xf6c7('0xe'),_0xf33fb8,'request\x20sent');_0x3332f2(_0x8d0cdc[_0xf6c7('0x15')]['message']);}})[_0xf6c7('0x16')](function(_0x20c868){logger['error'](_0xf6c7('0xe'),_0xf33fb8,_0x20c868);_0x140191(_0x20c868);});});} \ No newline at end of file +var _0xf119=['then','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request'];(function(_0x2ab203,_0x2318a1){var _0x105cb1=function(_0x183b47){while(--_0x183b47){_0x2ab203['push'](_0x2ab203['shift']());}};_0x105cb1(++_0x2318a1);}(_0xf119,0x1d0));var _0x9f11=function(_0x2db3a8,_0x4e55a1){_0x2db3a8=_0x2db3a8-0x0;var _0x2f881a=_0xf119[_0x2db3a8];return _0x2f881a;};'use strict';var _=require(_0x9f11('0x0'));var util=require('util');var moment=require(_0x9f11('0x1'));var BPromise=require('bluebird');var rs=require(_0x9f11('0x2'));var fs=require('fs');var Redis=require(_0x9f11('0x3'));var db=require(_0x9f11('0x4'))['db'];var utils=require(_0x9f11('0x5'));var logger=require(_0x9f11('0x6'))(_0x9f11('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9f11('0x8')][_0x9f11('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcebd95,_0x5d6710,_0x5dfd06){return new BPromise(function(_0x4b0f18,_0x5bcade){return client[_0x9f11('0xa')](_0xcebd95,_0x5dfd06)[_0x9f11('0xb')](function(_0x471ccd){logger['info'](_0x9f11('0xc'),_0x5d6710,'request\x20sent');logger['debug'](_0x9f11('0xd'),_0x5d6710,'request\x20sent',JSON[_0x9f11('0xe')](_0x471ccd));if(_0x471ccd[_0x9f11('0xf')]){if(_0x471ccd[_0x9f11('0xf')][_0x9f11('0x10')]===0x1f4){logger[_0x9f11('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x5d6710,_0x471ccd[_0x9f11('0xf')][_0x9f11('0x11')]);return _0x5bcade(_0x471ccd[_0x9f11('0xf')][_0x9f11('0x11')]);}logger['error'](_0x9f11('0xc'),_0x5d6710,_0x471ccd['error']['message']);return _0x4b0f18(_0x471ccd[_0x9f11('0xf')][_0x9f11('0x11')]);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x5d6710,'request\x20sent');_0x4b0f18(_0x471ccd['result'][_0x9f11('0x11')]);}})[_0x9f11('0x12')](function(_0x3f267d){logger[_0x9f11('0xf')](_0x9f11('0xc'),_0x5d6710,_0x3f267d);_0x5bcade(_0x3f267d);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index aa10ef9..0cef40b 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 _0x4dcc=['util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','multer'];(function(_0x22093a,_0xa7acf1){var _0x2f4989=function(_0x5bf12b){while(--_0x5bf12b){_0x22093a['push'](_0x22093a['shift']());}};_0x2f4989(++_0xa7acf1);}(_0x4dcc,0x71));var _0xc4dc=function(_0x56aa6c,_0x360d1c){_0x56aa6c=_0x56aa6c-0x0;var _0x580b72=_0x4dcc[_0x56aa6c];return _0x580b72;};'use strict';var multer=require(_0xc4dc('0x0'));var util=require(_0xc4dc('0x1'));var path=require('path');var timeout=require(_0xc4dc('0x2'));var express=require(_0xc4dc('0x3'));var router=express['Router']();var fs_extra=require(_0xc4dc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc4dc('0x5'));var config=require(_0xc4dc('0x6'));var controller=require(_0xc4dc('0x7'));router[_0xc4dc('0x8')]('/',auth[_0xc4dc('0x9')](),controller[_0xc4dc('0xa')]);router[_0xc4dc('0x8')]('/:id',auth[_0xc4dc('0x9')](),controller[_0xc4dc('0xb')]);router[_0xc4dc('0xc')]('/',auth[_0xc4dc('0x9')](),controller[_0xc4dc('0xd')]);router[_0xc4dc('0xe')](_0xc4dc('0xf'),auth[_0xc4dc('0x9')](),controller[_0xc4dc('0x10')]);router[_0xc4dc('0x11')](_0xc4dc('0xf'),auth[_0xc4dc('0x9')](),controller[_0xc4dc('0x12')]);module['exports']=router; \ No newline at end of file +var _0x3d31=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','put','delete','/:id','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x240a6c,_0x204289){var _0x6f469b=function(_0x2f000b){while(--_0x2f000b){_0x240a6c['push'](_0x240a6c['shift']());}};_0x6f469b(++_0x204289);}(_0x3d31,0x107));var _0x13d3=function(_0x14b51d,_0x41ef6a){_0x14b51d=_0x14b51d-0x0;var _0x4e8f21=_0x3d31[_0x14b51d];return _0x4e8f21;};'use strict';var multer=require(_0x13d3('0x0'));var util=require(_0x13d3('0x1'));var path=require(_0x13d3('0x2'));var timeout=require(_0x13d3('0x3'));var express=require(_0x13d3('0x4'));var router=express[_0x13d3('0x5')]();var fs_extra=require(_0x13d3('0x6'));var auth=require(_0x13d3('0x7'));var interaction=require(_0x13d3('0x8'));var config=require(_0x13d3('0x9'));var controller=require('./intSugarcrmField.controller');router[_0x13d3('0xa')]('/',auth[_0x13d3('0xb')](),controller[_0x13d3('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x13d3('0xd')]);router[_0x13d3('0xe')]('/',auth[_0x13d3('0xb')](),controller['create']);router[_0x13d3('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x13d3('0x10')](_0x13d3('0x11'),auth[_0x13d3('0xb')](),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 804b0bd..12053d1 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 _0x30de=['STRING','BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x30de,0x13d));var _0xe30d=function(_0xa64fa,_0x5a12ee){_0xa64fa=_0xa64fa-0x0;var _0x236713=_0x30de[_0xa64fa];return _0x236713;};'use strict';var Sequelize=require('sequelize');module[_0xe30d('0x0')]={'type':{'type':Sequelize[_0xe30d('0x1')](_0xe30d('0x2'),_0xe30d('0x3'),_0xe30d('0x4'),_0xe30d('0x5'),_0xe30d('0x6')),'defaultValue':_0xe30d('0x2')},'content':{'type':Sequelize[_0xe30d('0x7')]},'key':{'type':Sequelize[_0xe30d('0x7')]},'keyType':{'type':Sequelize[_0xe30d('0x1')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0xe30d('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xe30d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe30d('0x7')]}}; \ No newline at end of file +var _0x358d=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','ENUM'];(function(_0x1f596d,_0x4d3ad7){var _0x264b60=function(_0x244138){while(--_0x244138){_0x1f596d['push'](_0x1f596d['shift']());}};_0x264b60(++_0x4d3ad7);}(_0x358d,0xe7));var _0xd358=function(_0x291728,_0x5f4842){_0x291728=_0x291728-0x0;var _0x10444c=_0x358d[_0x291728];return _0x10444c;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xd358('0x0')](_0xd358('0x1'),_0xd358('0x2'),_0xd358('0x3'),_0xd358('0x4'),_0xd358('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xd358('0x6')]},'key':{'type':Sequelize[_0xd358('0x6')]},'keyType':{'type':Sequelize[_0xd358('0x0')]('string',_0xd358('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xd358('0x6')]},'idField':{'type':Sequelize[_0xd358('0x6')]},'nameField':{'type':Sequelize[_0xd358('0x6')]},'customField':{'type':Sequelize[_0xd358('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index c00aef2..96b3078 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 _0xdfef=['crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','SugarcrmField','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','findAll','rows','catch','show','params','keys','find','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x2d1d94,_0x110543){var _0x52d3c5=function(_0x5b2c25){while(--_0x5b2c25){_0x2d1d94['push'](_0x2d1d94['shift']());}};_0x52d3c5(++_0x110543);}(_0xdfef,0x19d));var _0xfdfe=function(_0x37d8dd,_0x4f3e0a){_0x37d8dd=_0x37d8dd-0x0;var _0x55a338=_0xdfef[_0x37d8dd];return _0x55a338;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfdfe('0x0'));var zipdir=require(_0xfdfe('0x1'));var jsonpatch=require(_0xfdfe('0x2'));var rp=require('request-promise');var moment=require(_0xfdfe('0x3'));var BPromise=require(_0xfdfe('0x4'));var Mustache=require(_0xfdfe('0x5'));var util=require(_0xfdfe('0x6'));var path=require(_0xfdfe('0x7'));var sox=require(_0xfdfe('0x8'));var csv=require(_0xfdfe('0x9'));var ejs=require(_0xfdfe('0xa'));var fs=require('fs');var fs_extra=require(_0xfdfe('0xb'));var _=require(_0xfdfe('0xc'));var squel=require('squel');var crypto=require(_0xfdfe('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xfdfe('0xe'));var toCsv=require(_0xfdfe('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfdfe('0xf'));var authService=require(_0xfdfe('0x10'));var qs=require(_0xfdfe('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfdfe('0x12'));var logger=require('../../config/logger')(_0xfdfe('0x13'));var utils=require(_0xfdfe('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xfdfe('0x15'));var db=require(_0xfdfe('0x16'))['db'];function respondWithStatusCode(_0x326fe7,_0x4ee9d0){_0x4ee9d0=_0x4ee9d0||0xcc;return function(_0x3b5b0){if(_0x3b5b0){return _0x326fe7[_0xfdfe('0x17')](_0x4ee9d0);}return _0x326fe7[_0xfdfe('0x18')](_0x4ee9d0)[_0xfdfe('0x19')]();};}function respondWithResult(_0x429d36,_0x5b3606){_0x5b3606=_0x5b3606||0xc8;return function(_0x16010a){if(_0x16010a){return _0x429d36['status'](_0x5b3606)[_0xfdfe('0x1a')](_0x16010a);}};}function respondWithFilteredResult(_0x27013c,_0x4260bb){return function(_0x3f8f3c){if(_0x3f8f3c){var _0x4cab26=typeof _0x4260bb[_0xfdfe('0x1b')]===_0xfdfe('0x1c')&&typeof _0x4260bb[_0xfdfe('0x1d')]===_0xfdfe('0x1c');var _0x4d4f80=_0x3f8f3c['count'];var _0x529215=_0x4cab26?0x0:_0x4260bb[_0xfdfe('0x1b')];var _0xb12135=_0x4cab26?_0x3f8f3c[_0xfdfe('0x1e')]:_0x4260bb[_0xfdfe('0x1b')]+_0x4260bb[_0xfdfe('0x1d')];var _0x30042c;if(_0xb12135>=_0x4d4f80){_0xb12135=_0x4d4f80;_0x30042c=0xc8;}else{_0x30042c=0xce;}_0x27013c[_0xfdfe('0x18')](_0x30042c);return _0x27013c[_0xfdfe('0x1f')](_0xfdfe('0x20'),_0x529215+'-'+_0xb12135+'/'+_0x4d4f80)['json'](_0x3f8f3c);}return null;};}function patchUpdates(_0x34a872){return function(_0xcf82a1){try{jsonpatch[_0xfdfe('0x21')](_0xcf82a1,_0x34a872,!![]);}catch(_0x1e2ec5){return BPromise['reject'](_0x1e2ec5);}return _0xcf82a1[_0xfdfe('0x22')]();};}function saveUpdates(_0x6671ff,_0x3648dc){return function(_0x2f9906){if(_0x2f9906){return _0x2f9906[_0xfdfe('0x23')](_0x6671ff)[_0xfdfe('0x24')](function(_0x364a9f){return _0x364a9f;});}return null;};}function removeEntity(_0x4d732c,_0x558a6e){return function(_0x11c365){if(_0x11c365){return _0x11c365[_0xfdfe('0x25')]()[_0xfdfe('0x24')](function(){_0x4d732c[_0xfdfe('0x18')](0xcc)[_0xfdfe('0x19')]();});}};}function handleEntityNotFound(_0x534b96,_0x3cbe53){return function(_0x54372d){if(!_0x54372d){_0x534b96['sendStatus'](0x194);}return _0x54372d;};}function handleError(_0x50eb84,_0xa4e44a){_0xa4e44a=_0xa4e44a||0x1f4;return function(_0x48874c){logger['error'](_0x48874c[_0xfdfe('0x26')]);if(_0x48874c[_0xfdfe('0x27')]){delete _0x48874c['name'];}_0x50eb84[_0xfdfe('0x18')](_0xa4e44a)[_0xfdfe('0x28')](_0x48874c);};}exports['index']=function(_0x1c3b4e,_0x3ae54d){var _0x352651={},_0x2fbc6f={},_0x58475a={'count':0x0,'rows':[]};var _0x444585=_['map'](db[_0xfdfe('0x29')][_0xfdfe('0x2a')],function(_0x403f89){return{'name':_0x403f89[_0xfdfe('0x2b')],'type':_0x403f89[_0xfdfe('0x2c')]['key']};});_0x2fbc6f[_0xfdfe('0x2d')]=_[_0xfdfe('0x2e')](_0x444585,_0xfdfe('0x27'));_0x2fbc6f[_0xfdfe('0x2f')]=_['keys'](_0x1c3b4e[_0xfdfe('0x2f')]);_0x2fbc6f[_0xfdfe('0x30')]=_[_0xfdfe('0x31')](_0x2fbc6f[_0xfdfe('0x2d')],_0x2fbc6f[_0xfdfe('0x2f')]);_0x352651[_0xfdfe('0x32')]=_[_0xfdfe('0x31')](_0x2fbc6f['model'],qs[_0xfdfe('0x33')](_0x1c3b4e[_0xfdfe('0x2f')][_0xfdfe('0x33')]));_0x352651[_0xfdfe('0x32')]=_0x352651[_0xfdfe('0x32')][_0xfdfe('0x34')]?_0x352651['attributes']:_0x2fbc6f[_0xfdfe('0x2d')];if(!_0x1c3b4e[_0xfdfe('0x2f')][_0xfdfe('0x35')](_0xfdfe('0x36'))){_0x352651[_0xfdfe('0x1d')]=qs[_0xfdfe('0x1d')](_0x1c3b4e[_0xfdfe('0x2f')]['limit']);_0x352651[_0xfdfe('0x1b')]=qs['offset'](_0x1c3b4e[_0xfdfe('0x2f')][_0xfdfe('0x1b')]);}_0x352651['order']=qs[_0xfdfe('0x37')](_0x1c3b4e[_0xfdfe('0x2f')][_0xfdfe('0x37')]);_0x352651[_0xfdfe('0x38')]=qs[_0xfdfe('0x30')](_[_0xfdfe('0x39')](_0x1c3b4e[_0xfdfe('0x2f')],_0x2fbc6f[_0xfdfe('0x30')]),_0x444585);if(_0x1c3b4e[_0xfdfe('0x2f')]['filter']){_0x352651[_0xfdfe('0x38')]=_['merge'](_0x352651['where'],{'$or':_[_0xfdfe('0x2e')](_0x444585,function(_0x3fc56a){if(_0x3fc56a[_0xfdfe('0x2c')]!==_0xfdfe('0x3a')){var _0x54f418={};_0x54f418[_0x3fc56a[_0xfdfe('0x27')]]={'$like':'%'+_0x1c3b4e[_0xfdfe('0x2f')][_0xfdfe('0x3b')]+'%'};return _0x54f418;}})});}_0x352651=_[_0xfdfe('0x3c')]({},_0x352651,_0x1c3b4e[_0xfdfe('0x3d')]);var _0x598a52={'where':_0x352651[_0xfdfe('0x38')]};return db[_0xfdfe('0x29')][_0xfdfe('0x1e')](_0x598a52)[_0xfdfe('0x24')](function(_0x3e19da){_0x58475a[_0xfdfe('0x1e')]=_0x3e19da;if(_0x1c3b4e[_0xfdfe('0x2f')]['includeAll']){_0x352651['include']=[{'all':!![]}];}return db[_0xfdfe('0x29')][_0xfdfe('0x3e')](_0x352651);})[_0xfdfe('0x24')](function(_0x4f11a4){_0x58475a[_0xfdfe('0x3f')]=_0x4f11a4;return _0x58475a;})[_0xfdfe('0x24')](respondWithFilteredResult(_0x3ae54d,_0x352651))[_0xfdfe('0x40')](handleError(_0x3ae54d,null));};exports[_0xfdfe('0x41')]=function(_0x33d9db,_0xfa553f){var _0x591db4={'raw':!![],'where':{'id':_0x33d9db[_0xfdfe('0x42')]['id']}},_0x11a439={};_0x11a439[_0xfdfe('0x2d')]=_[_0xfdfe('0x43')](db[_0xfdfe('0x29')][_0xfdfe('0x2a')]);_0x11a439[_0xfdfe('0x2f')]=_[_0xfdfe('0x43')](_0x33d9db['query']);_0x11a439[_0xfdfe('0x30')]=_[_0xfdfe('0x31')](_0x11a439[_0xfdfe('0x2d')],_0x11a439[_0xfdfe('0x2f')]);_0x591db4[_0xfdfe('0x32')]=_['intersection'](_0x11a439[_0xfdfe('0x2d')],qs[_0xfdfe('0x33')](_0x33d9db[_0xfdfe('0x2f')][_0xfdfe('0x33')]));_0x591db4[_0xfdfe('0x32')]=_0x591db4[_0xfdfe('0x32')][_0xfdfe('0x34')]?_0x591db4[_0xfdfe('0x32')]:_0x11a439[_0xfdfe('0x2d')];if(_0x33d9db[_0xfdfe('0x2f')]['includeAll']){_0x591db4['include']=[{'all':!![]}];}_0x591db4=_[_0xfdfe('0x3c')]({},_0x591db4,_0x33d9db[_0xfdfe('0x3d')]);return db[_0xfdfe('0x29')][_0xfdfe('0x44')](_0x591db4)[_0xfdfe('0x24')](handleEntityNotFound(_0xfa553f,null))[_0xfdfe('0x24')](respondWithResult(_0xfa553f,null))[_0xfdfe('0x40')](handleError(_0xfa553f,null));};exports[_0xfdfe('0x45')]=function(_0x2837b2,_0x53dcf5){return db['SugarcrmField'][_0xfdfe('0x45')](_0x2837b2[_0xfdfe('0x46')],{})[_0xfdfe('0x24')](respondWithResult(_0x53dcf5,0xc9))[_0xfdfe('0x40')](handleError(_0x53dcf5,null));};exports[_0xfdfe('0x23')]=function(_0x54e4ea,_0x2d5a79){if(_0x54e4ea[_0xfdfe('0x46')]['id']){delete _0x54e4ea['body']['id'];}return db[_0xfdfe('0x29')][_0xfdfe('0x44')]({'where':{'id':_0x54e4ea[_0xfdfe('0x42')]['id']}})['then'](handleEntityNotFound(_0x2d5a79,null))['then'](saveUpdates(_0x54e4ea['body'],null))[_0xfdfe('0x24')](respondWithResult(_0x2d5a79,null))[_0xfdfe('0x40')](handleError(_0x2d5a79,null));};exports[_0xfdfe('0x25')]=function(_0x185f4e,_0x25e4c3){return db[_0xfdfe('0x29')][_0xfdfe('0x44')]({'where':{'id':_0x185f4e[_0xfdfe('0x42')]['id']}})[_0xfdfe('0x24')](handleEntityNotFound(_0x25e4c3,null))[_0xfdfe('0x24')](removeEntity(_0x25e4c3,null))[_0xfdfe('0x40')](handleError(_0x25e4c3,null));}; \ No newline at end of file +var _0x1a06=['count','offset','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','fields','length','attributes','sort','where','pick','filter','merge','options','includeAll','include','SugarcrmField','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','end','status','json','limit'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x1a06,0x6a));var _0x61a0=function(_0x202433,_0x248e64){_0x202433=_0x202433-0x0;var _0xc7522=_0x1a06[_0x202433];return _0xc7522;};'use strict';var emlformat=require(_0x61a0('0x0'));var rimraf=require(_0x61a0('0x1'));var zipdir=require(_0x61a0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x61a0('0x3'));var BPromise=require(_0x61a0('0x4'));var Mustache=require(_0x61a0('0x5'));var util=require('util');var path=require(_0x61a0('0x6'));var sox=require(_0x61a0('0x7'));var csv=require(_0x61a0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x61a0('0x9'));var _=require(_0x61a0('0xa'));var squel=require(_0x61a0('0xb'));var crypto=require('crypto');var jsforce=require(_0x61a0('0xc'));var deskjs=require(_0x61a0('0xd'));var toCsv=require(_0x61a0('0x8'));var querystring=require(_0x61a0('0xe'));var Papa=require('papaparse');var Redis=require(_0x61a0('0xf'));var authService=require(_0x61a0('0x10'));var qs=require(_0x61a0('0x11'));var as=require(_0x61a0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x61a0('0x13'))('api');var utils=require(_0x61a0('0x14'));var config=require(_0x61a0('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd0077f,_0x34779e){_0x34779e=_0x34779e||0xcc;return function(_0x5041fd){if(_0x5041fd){return _0xd0077f['sendStatus'](_0x34779e);}return _0xd0077f['status'](_0x34779e)[_0x61a0('0x16')]();};}function respondWithResult(_0x24e041,_0x5cc645){_0x5cc645=_0x5cc645||0xc8;return function(_0x3d011a){if(_0x3d011a){return _0x24e041[_0x61a0('0x17')](_0x5cc645)[_0x61a0('0x18')](_0x3d011a);}};}function respondWithFilteredResult(_0x1be829,_0x506e29){return function(_0x5bd673){if(_0x5bd673){var _0x20f547=typeof _0x506e29['offset']==='undefined'&&typeof _0x506e29[_0x61a0('0x19')]==='undefined';var _0x379776=_0x5bd673[_0x61a0('0x1a')];var _0x23f61c=_0x20f547?0x0:_0x506e29['offset'];var _0x2608b0=_0x20f547?_0x5bd673[_0x61a0('0x1a')]:_0x506e29[_0x61a0('0x1b')]+_0x506e29[_0x61a0('0x19')];var _0x1122ae;if(_0x2608b0>=_0x379776){_0x2608b0=_0x379776;_0x1122ae=0xc8;}else{_0x1122ae=0xce;}_0x1be829[_0x61a0('0x17')](_0x1122ae);return _0x1be829['set']('Content-Range',_0x23f61c+'-'+_0x2608b0+'/'+_0x379776)[_0x61a0('0x18')](_0x5bd673);}return null;};}function patchUpdates(_0x28f8db){return function(_0x98e11){try{jsonpatch[_0x61a0('0x1c')](_0x98e11,_0x28f8db,!![]);}catch(_0x25eaaf){return BPromise['reject'](_0x25eaaf);}return _0x98e11[_0x61a0('0x1d')]();};}function saveUpdates(_0x18b53e,_0x4d480e){return function(_0x241e86){if(_0x241e86){return _0x241e86[_0x61a0('0x1e')](_0x18b53e)[_0x61a0('0x1f')](function(_0x17726c){return _0x17726c;});}return null;};}function removeEntity(_0x1a4425,_0x35c361){return function(_0xb05558){if(_0xb05558){return _0xb05558[_0x61a0('0x20')]()['then'](function(){_0x1a4425[_0x61a0('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c7055,_0x297ae8){return function(_0x53f811){if(!_0x53f811){_0x3c7055[_0x61a0('0x21')](0x194);}return _0x53f811;};}function handleError(_0x19afb4,_0x2d9241){_0x2d9241=_0x2d9241||0x1f4;return function(_0x254348){logger[_0x61a0('0x22')](_0x254348[_0x61a0('0x23')]);if(_0x254348['name']){delete _0x254348[_0x61a0('0x24')];}_0x19afb4[_0x61a0('0x17')](_0x2d9241)[_0x61a0('0x25')](_0x254348);};}exports[_0x61a0('0x26')]=function(_0x39e677,_0x3c51d5){var _0x1d67ed={},_0x469e8a={},_0xbd5e1b={'count':0x0,'rows':[]};var _0x754846=_[_0x61a0('0x27')](db['SugarcrmField'][_0x61a0('0x28')],function(_0x3e1465){return{'name':_0x3e1465['fieldName'],'type':_0x3e1465[_0x61a0('0x29')][_0x61a0('0x2a')]};});_0x469e8a[_0x61a0('0x2b')]=_[_0x61a0('0x27')](_0x754846,_0x61a0('0x24'));_0x469e8a[_0x61a0('0x2c')]=_[_0x61a0('0x2d')](_0x39e677['query']);_0x469e8a[_0x61a0('0x2e')]=_['intersection'](_0x469e8a[_0x61a0('0x2b')],_0x469e8a[_0x61a0('0x2c')]);_0x1d67ed['attributes']=_['intersection'](_0x469e8a['model'],qs[_0x61a0('0x2f')](_0x39e677[_0x61a0('0x2c')][_0x61a0('0x2f')]));_0x1d67ed['attributes']=_0x1d67ed['attributes'][_0x61a0('0x30')]?_0x1d67ed[_0x61a0('0x31')]:_0x469e8a['model'];if(!_0x39e677[_0x61a0('0x2c')]['hasOwnProperty']('nolimit')){_0x1d67ed['limit']=qs['limit'](_0x39e677[_0x61a0('0x2c')]['limit']);_0x1d67ed[_0x61a0('0x1b')]=qs[_0x61a0('0x1b')](_0x39e677[_0x61a0('0x2c')]['offset']);}_0x1d67ed['order']=qs[_0x61a0('0x32')](_0x39e677['query'][_0x61a0('0x32')]);_0x1d67ed[_0x61a0('0x33')]=qs[_0x61a0('0x2e')](_[_0x61a0('0x34')](_0x39e677[_0x61a0('0x2c')],_0x469e8a[_0x61a0('0x2e')]),_0x754846);if(_0x39e677[_0x61a0('0x2c')][_0x61a0('0x35')]){_0x1d67ed[_0x61a0('0x33')]=_[_0x61a0('0x36')](_0x1d67ed[_0x61a0('0x33')],{'$or':_[_0x61a0('0x27')](_0x754846,function(_0x565993){if(_0x565993['type']!=='VIRTUAL'){var _0x3c4f81={};_0x3c4f81[_0x565993[_0x61a0('0x24')]]={'$like':'%'+_0x39e677['query'][_0x61a0('0x35')]+'%'};return _0x3c4f81;}})});}_0x1d67ed=_[_0x61a0('0x36')]({},_0x1d67ed,_0x39e677[_0x61a0('0x37')]);var _0x528547={'where':_0x1d67ed['where']};return db['SugarcrmField'][_0x61a0('0x1a')](_0x528547)[_0x61a0('0x1f')](function(_0x989158){_0xbd5e1b[_0x61a0('0x1a')]=_0x989158;if(_0x39e677[_0x61a0('0x2c')][_0x61a0('0x38')]){_0x1d67ed[_0x61a0('0x39')]=[{'all':!![]}];}return db[_0x61a0('0x3a')]['findAll'](_0x1d67ed);})[_0x61a0('0x1f')](function(_0x4a2b3b){_0xbd5e1b[_0x61a0('0x3b')]=_0x4a2b3b;return _0xbd5e1b;})[_0x61a0('0x1f')](respondWithFilteredResult(_0x3c51d5,_0x1d67ed))[_0x61a0('0x3c')](handleError(_0x3c51d5,null));};exports[_0x61a0('0x3d')]=function(_0x3b642d,_0x11ac75){var _0x4fa712={'raw':!![],'where':{'id':_0x3b642d[_0x61a0('0x3e')]['id']}},_0x41ebe0={};_0x41ebe0['model']=_[_0x61a0('0x2d')](db[_0x61a0('0x3a')][_0x61a0('0x28')]);_0x41ebe0[_0x61a0('0x2c')]=_[_0x61a0('0x2d')](_0x3b642d[_0x61a0('0x2c')]);_0x41ebe0['filters']=_['intersection'](_0x41ebe0[_0x61a0('0x2b')],_0x41ebe0['query']);_0x4fa712['attributes']=_['intersection'](_0x41ebe0[_0x61a0('0x2b')],qs[_0x61a0('0x2f')](_0x3b642d[_0x61a0('0x2c')][_0x61a0('0x2f')]));_0x4fa712['attributes']=_0x4fa712[_0x61a0('0x31')]['length']?_0x4fa712[_0x61a0('0x31')]:_0x41ebe0[_0x61a0('0x2b')];if(_0x3b642d[_0x61a0('0x2c')][_0x61a0('0x38')]){_0x4fa712[_0x61a0('0x39')]=[{'all':!![]}];}_0x4fa712=_[_0x61a0('0x36')]({},_0x4fa712,_0x3b642d[_0x61a0('0x37')]);return db['SugarcrmField'][_0x61a0('0x3f')](_0x4fa712)[_0x61a0('0x1f')](handleEntityNotFound(_0x11ac75,null))['then'](respondWithResult(_0x11ac75,null))['catch'](handleError(_0x11ac75,null));};exports[_0x61a0('0x40')]=function(_0x3c5286,_0x175704){return db[_0x61a0('0x3a')][_0x61a0('0x40')](_0x3c5286['body'],{})[_0x61a0('0x1f')](respondWithResult(_0x175704,0xc9))[_0x61a0('0x3c')](handleError(_0x175704,null));};exports[_0x61a0('0x1e')]=function(_0x323f19,_0x5c3cbc){if(_0x323f19[_0x61a0('0x41')]['id']){delete _0x323f19[_0x61a0('0x41')]['id'];}return db[_0x61a0('0x3a')][_0x61a0('0x3f')]({'where':{'id':_0x323f19['params']['id']}})[_0x61a0('0x1f')](handleEntityNotFound(_0x5c3cbc,null))['then'](saveUpdates(_0x323f19['body'],null))[_0x61a0('0x1f')](respondWithResult(_0x5c3cbc,null))['catch'](handleError(_0x5c3cbc,null));};exports[_0x61a0('0x20')]=function(_0x5565c1,_0x3e9ed3){return db['SugarcrmField'][_0x61a0('0x3f')]({'where':{'id':_0x5565c1['params']['id']}})[_0x61a0('0x1f')](handleEntityNotFound(_0x3e9ed3,null))[_0x61a0('0x1f')](removeEntity(_0x3e9ed3,null))[_0x61a0('0x3c')](handleError(_0x3e9ed3,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 399f912..7a19e73 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 _0x3e7b=['path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x435049,_0x3897d8){var _0x1e3380=function(_0x2ab913){while(--_0x2ab913){_0x435049['push'](_0x435049['shift']());}};_0x1e3380(++_0x3897d8);}(_0x3e7b,0x77));var _0xb3e7=function(_0x3a9258,_0x346083){_0x3a9258=_0x3a9258-0x0;var _0x1b3c2f=_0x3e7b[_0x3a9258];return _0x1b3c2f;};'use strict';var _=require(_0xb3e7('0x0'));var util=require(_0xb3e7('0x1'));var logger=require(_0xb3e7('0x2'))(_0xb3e7('0x3'));var moment=require(_0xb3e7('0x4'));var BPromise=require(_0xb3e7('0x5'));var rp=require(_0xb3e7('0x6'));var fs=require('fs');var path=require(_0xb3e7('0x7'));var rimraf=require(_0xb3e7('0x8'));var config=require(_0xb3e7('0x9'));var attributes=require(_0xb3e7('0xa'));module[_0xb3e7('0xb')]=function(_0x28adeb,_0xfc3130){return _0x28adeb[_0xb3e7('0xc')](_0xb3e7('0xd'),attributes,{'tableName':_0xb3e7('0xe'),'paranoid':![],'indexes':[{'name':_0xb3e7('0xf'),'fields':[_0xb3e7('0x10'),_0xb3e7('0x11')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xefdd=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','idField','lodash'];(function(_0x3be2ae,_0x18e6cf){var _0x39fff1=function(_0x3ad8fd){while(--_0x3ad8fd){_0x3be2ae['push'](_0x3be2ae['shift']());}};_0x39fff1(++_0x18e6cf);}(_0xefdd,0x167));var _0xdefd=function(_0x1f350e,_0x2e0069){_0x1f350e=_0x1f350e-0x0;var _0x131263=_0xefdd[_0x1f350e];return _0x131263;};'use strict';var _=require(_0xdefd('0x0'));var util=require(_0xdefd('0x1'));var logger=require(_0xdefd('0x2'))(_0xdefd('0x3'));var moment=require(_0xdefd('0x4'));var BPromise=require(_0xdefd('0x5'));var rp=require(_0xdefd('0x6'));var fs=require('fs');var path=require(_0xdefd('0x7'));var rimraf=require('rimraf');var config=require(_0xdefd('0x8'));var attributes=require(_0xdefd('0x9'));module[_0xdefd('0xa')]=function(_0x5aee8b,_0x7e0b6f){return _0x5aee8b[_0xdefd('0xb')](_0xdefd('0xc'),attributes,{'tableName':_0xdefd('0xd'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0xdefd('0xe'),'FieldId'],'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 3566b08..8949078 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 _0x50c7=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x57d7f7,_0x335c81){var _0x1a6800=function(_0x251345){while(--_0x251345){_0x57d7f7['push'](_0x57d7f7['shift']());}};_0x1a6800(++_0x335c81);}(_0x50c7,0x1a4));var _0x750c=function(_0x26bef9,_0x2e4325){_0x26bef9=_0x26bef9-0x0;var _0x2a6e46=_0x50c7[_0x26bef9];return _0x2a6e46;};'use strict';var _=require(_0x750c('0x0'));var util=require(_0x750c('0x1'));var moment=require('moment');var BPromise=require(_0x750c('0x2'));var rs=require(_0x750c('0x3'));var fs=require('fs');var Redis=require(_0x750c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x750c('0x5'));var logger=require('../../config/logger')(_0x750c('0x6'));var config=require('../../config/environment');var jayson=require(_0x750c('0x7'));var client=jayson[_0x750c('0x8')][_0x750c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ab94d,_0x33df28,_0xd6251b){return new BPromise(function(_0x3e6daa,_0x5bb7a3){return client[_0x750c('0xa')](_0x3ab94d,_0xd6251b)[_0x750c('0xb')](function(_0x11b1cf){logger[_0x750c('0xc')](_0x750c('0xd'),_0x33df28,_0x750c('0xe'));logger[_0x750c('0xf')](_0x750c('0x10'),_0x33df28,'request\x20sent',JSON['stringify'](_0x11b1cf));if(_0x11b1cf[_0x750c('0x11')]){if(_0x11b1cf[_0x750c('0x11')][_0x750c('0x12')]===0x1f4){logger[_0x750c('0x11')](_0x750c('0xd'),_0x33df28,_0x11b1cf[_0x750c('0x11')][_0x750c('0x13')]);return _0x5bb7a3(_0x11b1cf[_0x750c('0x11')]['message']);}logger[_0x750c('0x11')](_0x750c('0xd'),_0x33df28,_0x11b1cf[_0x750c('0x11')][_0x750c('0x13')]);return _0x3e6daa(_0x11b1cf['error'][_0x750c('0x13')]);}else{logger[_0x750c('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x33df28,_0x750c('0xe'));_0x3e6daa(_0x11b1cf[_0x750c('0x14')][_0x750c('0x13')]);}})[_0x750c('0x15')](function(_0x7873fa){logger[_0x750c('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x33df28,_0x7873fa);_0x5bb7a3(_0x7873fa);});});} \ No newline at end of file +var _0x41d1=['SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x158b25,_0x2d3453){var _0x3a8bd8=function(_0x4ef65b){while(--_0x4ef65b){_0x158b25['push'](_0x158b25['shift']());}};_0x3a8bd8(++_0x2d3453);}(_0x41d1,0x93));var _0x141d=function(_0x3ba9ec,_0x49c244){_0x3ba9ec=_0x3ba9ec-0x0;var _0x39f681=_0x41d1[_0x3ba9ec];return _0x39f681;};'use strict';var _=require(_0x141d('0x0'));var util=require(_0x141d('0x1'));var moment=require(_0x141d('0x2'));var BPromise=require(_0x141d('0x3'));var rs=require(_0x141d('0x4'));var fs=require('fs');var Redis=require(_0x141d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x141d('0x6'))('rpc');var config=require(_0x141d('0x7'));var jayson=require(_0x141d('0x8'));var client=jayson['client'][_0x141d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4674ca,_0x1ec9c9,_0x51ac50){return new BPromise(function(_0x5320e0,_0x5428f5){return client[_0x141d('0xa')](_0x4674ca,_0x51ac50)[_0x141d('0xb')](function(_0x342da9){logger[_0x141d('0xc')](_0x141d('0xd'),_0x1ec9c9,_0x141d('0xe'));logger['debug'](_0x141d('0xf'),_0x1ec9c9,'request\x20sent',JSON['stringify'](_0x342da9));if(_0x342da9[_0x141d('0x10')]){if(_0x342da9[_0x141d('0x10')][_0x141d('0x11')]===0x1f4){logger[_0x141d('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x1ec9c9,_0x342da9[_0x141d('0x10')][_0x141d('0x12')]);return _0x5428f5(_0x342da9[_0x141d('0x10')][_0x141d('0x12')]);}logger[_0x141d('0x10')](_0x141d('0xd'),_0x1ec9c9,_0x342da9[_0x141d('0x10')][_0x141d('0x12')]);return _0x5320e0(_0x342da9['error'][_0x141d('0x12')]);}else{logger[_0x141d('0xc')](_0x141d('0xd'),_0x1ec9c9,_0x141d('0xe'));_0x5320e0(_0x342da9['result'][_0x141d('0x12')]);}})[_0x141d('0x13')](function(_0x560370){logger['error'](_0x141d('0xd'),_0x1ec9c9,_0x560370);_0x5428f5(_0x560370);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 1d08eb5..4221d8c 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 _0x6737=['addConfiguration','put','/:id','update','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','get','getConfigurations','/:id/fields','getFields','create','/:id/configurations'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x6737,0xe2));var _0x7673=function(_0x3c4cba,_0x1c5d0c){_0x3c4cba=_0x3c4cba-0x0;var _0x1f06e7=_0x6737[_0x3c4cba];return _0x1f06e7;};'use strict';var multer=require('multer');var util=require(_0x7673('0x0'));var path=require(_0x7673('0x1'));var timeout=require('connect-timeout');var express=require(_0x7673('0x2'));var router=express[_0x7673('0x3')]();var fs_extra=require(_0x7673('0x4'));var auth=require(_0x7673('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7673('0x6'));var controller=require(_0x7673('0x7'));router['get']('/',auth[_0x7673('0x8')](),controller[_0x7673('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x7673('0xa')]('/:id/configurations',auth[_0x7673('0x8')](),controller[_0x7673('0xb')]);router['get'](_0x7673('0xc'),auth[_0x7673('0x8')](),controller[_0x7673('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7673('0xe')]);router['post'](_0x7673('0xf'),auth[_0x7673('0x8')](),controller[_0x7673('0x10')]);router[_0x7673('0x11')](_0x7673('0x12'),auth[_0x7673('0x8')](),controller[_0x7673('0x13')]);router[_0x7673('0x14')](_0x7673('0x12'),auth[_0x7673('0x8')](),controller['destroy']);module[_0x7673('0x15')]=router; \ No newline at end of file +var _0x0a62=['Router','fs-extra','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','create','post','/:id/configurations','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x1e2c04,_0x7d2021){var _0x1b596f=function(_0x2ae1a2){while(--_0x2ae1a2){_0x1e2c04['push'](_0x1e2c04['shift']());}};_0x1b596f(++_0x7d2021);}(_0x0a62,0x119));var _0x20a6=function(_0x85cb49,_0x50a08a){_0x85cb49=_0x85cb49-0x0;var _0x52f463=_0x0a62[_0x85cb49];return _0x52f463;};'use strict';var multer=require(_0x20a6('0x0'));var util=require(_0x20a6('0x1'));var path=require(_0x20a6('0x2'));var timeout=require(_0x20a6('0x3'));var express=require(_0x20a6('0x4'));var router=express[_0x20a6('0x5')]();var fs_extra=require(_0x20a6('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x20a6('0x7'));var controller=require(_0x20a6('0x8'));router['get']('/',auth[_0x20a6('0x9')](),controller[_0x20a6('0xa')]);router[_0x20a6('0xb')](_0x20a6('0xc'),auth[_0x20a6('0x9')](),controller[_0x20a6('0xd')]);router['get']('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0x20a6('0xb')](_0x20a6('0xe'),auth[_0x20a6('0x9')](),controller[_0x20a6('0xf')]);router['post']('/',auth[_0x20a6('0x9')](),controller[_0x20a6('0x10')]);router[_0x20a6('0x11')](_0x20a6('0x12'),auth[_0x20a6('0x9')](),controller['addConfiguration']);router['put'](_0x20a6('0xc'),auth[_0x20a6('0x9')](),controller[_0x20a6('0x13')]);router[_0x20a6('0x14')](_0x20a6('0xc'),auth[_0x20a6('0x9')](),controller[_0x20a6('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 5ebd786..dfb9e22 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 _0xc06a=['HelpDesk','STRING'];(function(_0x907c3d,_0x1e8850){var _0x16684c=function(_0x1ee01b){while(--_0x1ee01b){_0x907c3d['push'](_0x907c3d['shift']());}};_0x16684c(++_0x1e8850);}(_0xc06a,0x15d));var _0xac06=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xc06a[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xac06('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xac06('0x0')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xac06('0x1')},'remoteUri':{'type':Sequelize[_0xac06('0x0')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xac06('0x0')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xf1c9=['exports','STRING','HelpDesk','sequelize'];(function(_0x3e5de0,_0x1942a4){var _0x6a1dfb=function(_0x59f260){while(--_0x59f260){_0x3e5de0['push'](_0x3e5de0['shift']());}};_0x6a1dfb(++_0x1942a4);}(_0xf1c9,0xf3));var _0x9f1c=function(_0x1effe5,_0x508d5d){_0x1effe5=_0x1effe5-0x0;var _0x5aaae4=_0xf1c9[_0x1effe5];return _0x5aaae4;};'use strict';var Sequelize=require(_0x9f1c('0x0'));module[_0x9f1c('0x1')]={'name':{'type':Sequelize[_0x9f1c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9f1c('0x2')]},'username':{'type':Sequelize[_0x9f1c('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9f1c('0x3')},'remoteUri':{'type':Sequelize[_0x9f1c('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x9f1c('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 676f041..8f76c23 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 _0x9c7e=['save','update','then','stack','map','VtigerAccount','rawAttributes','key','name','keys','filters','intersection','model','fields','query','attributes','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','getConfigurations','findOne','VtigerConfiguration','pick','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','VtigerField','Subjects','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','result','describe','sessionName','reference','owner','remove','includes','editable','false','startsWith','cf_','picklistValues','label','value','log','vTiger\x20error:\x20','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','set','Content-Range','reject'];(function(_0x4c86fa,_0x5a08c9){var _0xc78c19=function(_0x4d5bf8){while(--_0x4d5bf8){_0x4c86fa['push'](_0x4c86fa['shift']());}};_0xc78c19(++_0x5a08c9);}(_0x9c7e,0x1c0));var _0xe9c7=function(_0xeae989,_0x3f1ba0){_0xeae989=_0xeae989-0x0;var _0x5c35a7=_0x9c7e[_0xeae989];return _0x5c35a7;};'use strict';var emlformat=require(_0xe9c7('0x0'));var rimraf=require(_0xe9c7('0x1'));var zipdir=require(_0xe9c7('0x2'));var jsonpatch=require(_0xe9c7('0x3'));var rp=require(_0xe9c7('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe9c7('0x5'));var path=require(_0xe9c7('0x6'));var sox=require('sox');var csv=require(_0xe9c7('0x7'));var ejs=require(_0xe9c7('0x8'));var fs=require('fs');var fs_extra=require(_0xe9c7('0x9'));var _=require(_0xe9c7('0xa'));var squel=require('squel');var crypto=require(_0xe9c7('0xb'));var jsforce=require(_0xe9c7('0xc'));var deskjs=require(_0xe9c7('0xd'));var toCsv=require(_0xe9c7('0x7'));var querystring=require('querystring');var Papa=require(_0xe9c7('0xe'));var Redis=require('ioredis');var authService=require(_0xe9c7('0xf'));var qs=require(_0xe9c7('0x10'));var as=require(_0xe9c7('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe9c7('0x12'))(_0xe9c7('0x13'));var utils=require('../../config/utils');var config=require(_0xe9c7('0x14'));var licenseUtil=require(_0xe9c7('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xe9c7('0x16'));function respondWithStatusCode(_0x4f08b1,_0x18c325){_0x18c325=_0x18c325||0xcc;return function(_0xa5453e){if(_0xa5453e){return _0x4f08b1[_0xe9c7('0x17')](_0x18c325);}return _0x4f08b1[_0xe9c7('0x18')](_0x18c325)[_0xe9c7('0x19')]();};}function respondWithResult(_0x16341d,_0x103af0){_0x103af0=_0x103af0||0xc8;return function(_0x638f71){if(_0x638f71){return _0x16341d[_0xe9c7('0x18')](_0x103af0)['json'](_0x638f71);}};}function respondWithFilteredResult(_0x1be3e3,_0x172124){return function(_0x4a90d0){if(_0x4a90d0){var _0x3140c2=typeof _0x172124[_0xe9c7('0x1a')]===_0xe9c7('0x1b')&&typeof _0x172124[_0xe9c7('0x1c')]===_0xe9c7('0x1b');var _0x3e88f1=_0x4a90d0['count'];var _0x5d0331=_0x3140c2?0x0:_0x172124[_0xe9c7('0x1a')];var _0x530a1a=_0x3140c2?_0x4a90d0['count']:_0x172124[_0xe9c7('0x1a')]+_0x172124[_0xe9c7('0x1c')];var _0x67b836;if(_0x530a1a>=_0x3e88f1){_0x530a1a=_0x3e88f1;_0x67b836=0xc8;}else{_0x67b836=0xce;}_0x1be3e3[_0xe9c7('0x18')](_0x67b836);return _0x1be3e3[_0xe9c7('0x1d')](_0xe9c7('0x1e'),_0x5d0331+'-'+_0x530a1a+'/'+_0x3e88f1)['json'](_0x4a90d0);}return null;};}function patchUpdates(_0x1510da){return function(_0x259628){try{jsonpatch['apply'](_0x259628,_0x1510da,!![]);}catch(_0x27af52){return BPromise[_0xe9c7('0x1f')](_0x27af52);}return _0x259628[_0xe9c7('0x20')]();};}function saveUpdates(_0x3aeecf,_0x316349){return function(_0x44be19){if(_0x44be19){return _0x44be19[_0xe9c7('0x21')](_0x3aeecf)[_0xe9c7('0x22')](function(_0x197080){return _0x197080;});}return null;};}function removeEntity(_0x3460c7,_0x4161ba){return function(_0x33afbd){if(_0x33afbd){return _0x33afbd['destroy']()[_0xe9c7('0x22')](function(){_0x3460c7['status'](0xcc)[_0xe9c7('0x19')]();});}};}function handleEntityNotFound(_0x1f14d8,_0x2fdeb3){return function(_0x4ff201){if(!_0x4ff201){_0x1f14d8[_0xe9c7('0x17')](0x194);}return _0x4ff201;};}function handleError(_0x5b0b17,_0x3b6c96){_0x3b6c96=_0x3b6c96||0x1f4;return function(_0x4fe719){logger['error'](_0x4fe719[_0xe9c7('0x23')]);if(_0x4fe719['name']){delete _0x4fe719['name'];}_0x5b0b17[_0xe9c7('0x18')](_0x3b6c96)['send'](_0x4fe719);};}exports['index']=function(_0x5171b1,_0x5eccc1){var _0x2889c9={},_0x29228d={},_0x461564={'count':0x0,'rows':[]};var _0x11fec9=_[_0xe9c7('0x24')](db[_0xe9c7('0x25')][_0xe9c7('0x26')],function(_0x59695e){return{'name':_0x59695e['fieldName'],'type':_0x59695e['type'][_0xe9c7('0x27')]};});_0x29228d['model']=_[_0xe9c7('0x24')](_0x11fec9,_0xe9c7('0x28'));_0x29228d['query']=_[_0xe9c7('0x29')](_0x5171b1['query']);_0x29228d[_0xe9c7('0x2a')]=_[_0xe9c7('0x2b')](_0x29228d[_0xe9c7('0x2c')],_0x29228d['query']);_0x2889c9['attributes']=_[_0xe9c7('0x2b')](_0x29228d[_0xe9c7('0x2c')],qs[_0xe9c7('0x2d')](_0x5171b1[_0xe9c7('0x2e')]['fields']));_0x2889c9[_0xe9c7('0x2f')]=_0x2889c9[_0xe9c7('0x2f')][_0xe9c7('0x30')]?_0x2889c9[_0xe9c7('0x2f')]:_0x29228d[_0xe9c7('0x2c')];if(!_0x5171b1[_0xe9c7('0x2e')]['hasOwnProperty'](_0xe9c7('0x31'))){_0x2889c9[_0xe9c7('0x1c')]=qs[_0xe9c7('0x1c')](_0x5171b1[_0xe9c7('0x2e')][_0xe9c7('0x1c')]);_0x2889c9[_0xe9c7('0x1a')]=qs[_0xe9c7('0x1a')](_0x5171b1[_0xe9c7('0x2e')][_0xe9c7('0x1a')]);}_0x2889c9[_0xe9c7('0x32')]=qs[_0xe9c7('0x33')](_0x5171b1['query'][_0xe9c7('0x33')]);_0x2889c9[_0xe9c7('0x34')]=qs[_0xe9c7('0x2a')](_['pick'](_0x5171b1[_0xe9c7('0x2e')],_0x29228d['filters']),_0x11fec9);if(_0x5171b1[_0xe9c7('0x2e')][_0xe9c7('0x35')]){_0x2889c9[_0xe9c7('0x34')]=_[_0xe9c7('0x36')](_0x2889c9[_0xe9c7('0x34')],{'$or':_['map'](_0x11fec9,function(_0x2aa262){if(_0x2aa262[_0xe9c7('0x37')]!==_0xe9c7('0x38')){var _0x10b437={};_0x10b437[_0x2aa262[_0xe9c7('0x28')]]={'$like':'%'+_0x5171b1[_0xe9c7('0x2e')]['filter']+'%'};return _0x10b437;}})});}_0x2889c9=_[_0xe9c7('0x36')]({},_0x2889c9,_0x5171b1[_0xe9c7('0x39')]);var _0x3224d1={'where':_0x2889c9[_0xe9c7('0x34')]};return db[_0xe9c7('0x25')][_0xe9c7('0x3a')](_0x3224d1)[_0xe9c7('0x22')](function(_0x1df2fc){_0x461564[_0xe9c7('0x3a')]=_0x1df2fc;if(_0x5171b1[_0xe9c7('0x2e')][_0xe9c7('0x3b')]){_0x2889c9[_0xe9c7('0x3c')]=[{'all':!![]}];}return db['VtigerAccount'][_0xe9c7('0x3d')](_0x2889c9);})[_0xe9c7('0x22')](function(_0x493f76){_0x461564[_0xe9c7('0x3e')]=_0x493f76;return _0x461564;})[_0xe9c7('0x22')](respondWithFilteredResult(_0x5eccc1,_0x2889c9))[_0xe9c7('0x3f')](handleError(_0x5eccc1,null));};exports['show']=function(_0x3c8398,_0x5e1ae1){var _0x4ef2a7={'raw':![],'where':{'id':_0x3c8398[_0xe9c7('0x40')]['id']}},_0x1df6ba={};_0x1df6ba[_0xe9c7('0x2c')]=_[_0xe9c7('0x29')](db[_0xe9c7('0x25')][_0xe9c7('0x26')]);_0x1df6ba[_0xe9c7('0x2e')]=_['keys'](_0x3c8398[_0xe9c7('0x2e')]);_0x1df6ba[_0xe9c7('0x2a')]=_['intersection'](_0x1df6ba[_0xe9c7('0x2c')],_0x1df6ba['query']);_0x4ef2a7[_0xe9c7('0x2f')]=_['intersection'](_0x1df6ba['model'],qs[_0xe9c7('0x2d')](_0x3c8398[_0xe9c7('0x2e')][_0xe9c7('0x2d')]));_0x4ef2a7[_0xe9c7('0x2f')]=_0x4ef2a7[_0xe9c7('0x2f')]['length']?_0x4ef2a7[_0xe9c7('0x2f')]:_0x1df6ba['model'];if(_0x3c8398[_0xe9c7('0x2e')][_0xe9c7('0x3b')]){_0x4ef2a7['include']=[{'all':!![]}];}_0x4ef2a7=_[_0xe9c7('0x36')]({},_0x4ef2a7,_0x3c8398[_0xe9c7('0x39')]);return db[_0xe9c7('0x25')][_0xe9c7('0x41')](_0x4ef2a7)[_0xe9c7('0x22')](handleEntityNotFound(_0x5e1ae1,null))['then'](respondWithResult(_0x5e1ae1,null))[_0xe9c7('0x3f')](handleError(_0x5e1ae1,null));};exports[_0xe9c7('0x42')]=function(_0x1a6ca9,_0x582a5d){return db['VtigerAccount'][_0xe9c7('0x42')](_0x1a6ca9[_0xe9c7('0x43')],{})[_0xe9c7('0x22')](respondWithResult(_0x582a5d,0xc9))[_0xe9c7('0x3f')](handleError(_0x582a5d,null));};exports['update']=function(_0x29d9e5,_0x172cf7){if(_0x29d9e5['body']['id']){delete _0x29d9e5[_0xe9c7('0x43')]['id'];}return db[_0xe9c7('0x25')]['find']({'where':{'id':_0x29d9e5['params']['id']}})[_0xe9c7('0x22')](handleEntityNotFound(_0x172cf7,null))[_0xe9c7('0x22')](saveUpdates(_0x29d9e5[_0xe9c7('0x43')],null))[_0xe9c7('0x22')](respondWithResult(_0x172cf7,null))[_0xe9c7('0x3f')](handleError(_0x172cf7,null));};exports[_0xe9c7('0x44')]=function(_0x677f26,_0x48f838){return db[_0xe9c7('0x25')][_0xe9c7('0x41')]({'where':{'id':_0x677f26[_0xe9c7('0x40')]['id']}})[_0xe9c7('0x22')](handleEntityNotFound(_0x48f838,null))[_0xe9c7('0x22')](removeEntity(_0x48f838,null))['catch'](handleError(_0x48f838,null));};exports[_0xe9c7('0x45')]=function(_0x567ef0,_0x35afca,_0x405c2d){var _0xf14ad7={};var _0x38159d={};var _0x8d00de;var _0x598a9e;return db['VtigerAccount'][_0xe9c7('0x46')]({'where':{'id':_0x567ef0[_0xe9c7('0x40')]['id']}})[_0xe9c7('0x22')](handleEntityNotFound(_0x35afca,null))[_0xe9c7('0x22')](function(_0x216bd3){if(_0x216bd3){_0x8d00de=_0x216bd3;_0x38159d[_0xe9c7('0x2c')]=_[_0xe9c7('0x29')](db[_0xe9c7('0x47')][_0xe9c7('0x26')]);_0x38159d[_0xe9c7('0x2e')]=_[_0xe9c7('0x29')](_0x567ef0[_0xe9c7('0x2e')]);_0x38159d['filters']=_[_0xe9c7('0x2b')](_0x38159d[_0xe9c7('0x2c')],_0x38159d['query']);_0xf14ad7[_0xe9c7('0x2f')]=_[_0xe9c7('0x2b')](_0x38159d[_0xe9c7('0x2c')],qs[_0xe9c7('0x2d')](_0x567ef0[_0xe9c7('0x2e')][_0xe9c7('0x2d')]));_0xf14ad7[_0xe9c7('0x2f')]=_0xf14ad7['attributes'][_0xe9c7('0x30')]?_0xf14ad7[_0xe9c7('0x2f')]:_0x38159d[_0xe9c7('0x2c')];_0xf14ad7['order']=qs[_0xe9c7('0x33')](_0x567ef0['query']['sort']);_0xf14ad7['where']=qs[_0xe9c7('0x2a')](_[_0xe9c7('0x48')](_0x567ef0['query'],_0x38159d[_0xe9c7('0x2a')]));if(_0x567ef0[_0xe9c7('0x2e')][_0xe9c7('0x35')]){_0xf14ad7[_0xe9c7('0x34')]=_[_0xe9c7('0x36')](_0xf14ad7[_0xe9c7('0x34')],{'$or':_['map'](_0xf14ad7[_0xe9c7('0x2f')],function(_0x296a7f){var _0x3bd89b={};_0x3bd89b[_0x296a7f]={'$like':'%'+_0x567ef0[_0xe9c7('0x2e')]['filter']+'%'};return _0x3bd89b;})});}_0xf14ad7=_[_0xe9c7('0x36')]({},_0xf14ad7,_0x567ef0[_0xe9c7('0x39')]);return _0x8d00de[_0xe9c7('0x45')](_0xf14ad7);}})[_0xe9c7('0x22')](function(_0x5bf568){if(_0x5bf568){_0x598a9e=_0x5bf568[_0xe9c7('0x30')];if(!_0x567ef0[_0xe9c7('0x2e')][_0xe9c7('0x49')]('nolimit')){_0xf14ad7[_0xe9c7('0x1c')]=qs['limit'](_0x567ef0['query']['limit']);_0xf14ad7['offset']=qs[_0xe9c7('0x1a')](_0x567ef0[_0xe9c7('0x2e')][_0xe9c7('0x1a')]);}return _0x8d00de[_0xe9c7('0x45')](_0xf14ad7);}})['then'](function(_0x50a76d){if(_0x50a76d){return _0x50a76d?{'count':_0x598a9e,'rows':_0x50a76d}:null;}})[_0xe9c7('0x22')](respondWithResult(_0x35afca,null))[_0xe9c7('0x3f')](handleError(_0x35afca,null));};exports[_0xe9c7('0x4a')]=function(_0x595842,_0xf43c71,_0x4f5c48){if(_0x595842[_0xe9c7('0x43')]['id']){delete _0x595842[_0xe9c7('0x43')]['id'];}return db[_0xe9c7('0x25')]['findOne']({'where':{'id':_0x595842[_0xe9c7('0x40')]['id']}})[_0xe9c7('0x22')](handleEntityNotFound(_0xf43c71,null))[_0xe9c7('0x22')](function(_0x32733c){if(_0x32733c){_0x595842[_0xe9c7('0x43')][_0xe9c7('0x4b')]=_0x32733c['id'];_0x595842[_0xe9c7('0x43')]['Subjects']=integrations[_0xe9c7('0x4c')](_0x595842['body'][_0xe9c7('0x4d')],_0x595842[_0xe9c7('0x43')][_0xe9c7('0x37')]);_0x595842['body'][_0xe9c7('0x4e')]=integrations[_0xe9c7('0x4f')](_0x595842[_0xe9c7('0x43')][_0xe9c7('0x4d')],_0x595842[_0xe9c7('0x43')][_0xe9c7('0x37')]);return db[_0xe9c7('0x47')][_0xe9c7('0x42')](_0x595842[_0xe9c7('0x43')],{'include':[{'model':db[_0xe9c7('0x50')],'as':_0xe9c7('0x51')},{'model':db[_0xe9c7('0x50')],'as':_0xe9c7('0x4e')}]});}return null;})['then'](respondWithResult(_0xf43c71,null))[_0xe9c7('0x3f')](handleError(_0xf43c71,null));};var md5=require(_0xe9c7('0x52'));exports[_0xe9c7('0x53')]=function(_0x253a7e,_0x170e62,_0xbcff25){var _0xd492cf=null;var _0x3da1fd=null;var _0x245df5=null;var _0xd3b09e=null;var _0x5ac2a5='';return db[_0xe9c7('0x25')][_0xe9c7('0x46')]({'where':{'id':_0x253a7e['params']['id']},'attributes':['id',_0xe9c7('0x28'),_0xe9c7('0x54'),_0xe9c7('0x55'),_0xe9c7('0x56'),_0xe9c7('0x57'),_0xe9c7('0x58'),_0xe9c7('0x59')]})[_0xe9c7('0x22')](handleEntityNotFound(_0x170e62,null))[_0xe9c7('0x22')](function(_0x6776f7){if(_0x6776f7){_0xd492cf=_0x6776f7[_0xe9c7('0x54')];_0x3da1fd=_0x6776f7[_0xe9c7('0x59')];_0x245df5=_0x6776f7[_0xe9c7('0x56')];_0x5ac2a5=_0x6776f7[_0xe9c7('0x57')];var _0x4e9c97=_0x5ac2a5['slice'](-0x1);if(_0x4e9c97==='/'){_0x5ac2a5=_0x5ac2a5[_0xe9c7('0x5a')](0x0,_0x5ac2a5[_0xe9c7('0x5b')](_0x4e9c97));}_0xd3b09e=util[_0xe9c7('0x5c')](_0xe9c7('0x5d'),_0x5ac2a5);var _0x1e7233={'method':_0xe9c7('0x5e'),'uri':_0xd3b09e,'qs':{'operation':_0xe9c7('0x5f'),'username':_0x6776f7[_0xe9c7('0x54')]},'json':!![]};return rp(_0x1e7233);}})[_0xe9c7('0x22')](function(_0x82a84d){if(_0x82a84d[_0xe9c7('0x60')]){var _0x4ac685={'method':_0xe9c7('0x61'),'uri':_0xd3b09e,'form':{'operation':'login','username':_0xd492cf,'accessKey':md5(_0x82a84d[_0xe9c7('0x62')]['token']+_0x3da1fd)},'json':!![]};return rp(_0x4ac685);}})[_0xe9c7('0x22')](function(_0x14869b){if(_0x14869b['success']){var _0x59a728={'method':'GET','uri':_0xd3b09e,'qs':{'operation':_0xe9c7('0x63'),'username':_0xd492cf,'sessionName':_0x14869b[_0xe9c7('0x62')][_0xe9c7('0x64')],'elementType':_0x245df5},'json':!![]};return rp(_0x59a728);}})[_0xe9c7('0x22')](function(_0x1109b5){if(_0x1109b5[_0xe9c7('0x60')]){var _0x41af2a=['autogenerated',_0xe9c7('0x65'),_0xe9c7('0x66')];_[_0xe9c7('0x67')](_0x1109b5[_0xe9c7('0x62')][_0xe9c7('0x2d')],function(_0x3f789a){return _0x41af2a[_0xe9c7('0x68')](_0x3f789a[_0xe9c7('0x37')][_0xe9c7('0x28')]);});_[_0xe9c7('0x67')](_0x1109b5[_0xe9c7('0x62')]['fields'],function(_0x3e5771){return _0x3e5771[_0xe9c7('0x69')]===_0xe9c7('0x6a');});return{'count':_0x1109b5[_0xe9c7('0x62')][_0xe9c7('0x2d')][_0xe9c7('0x30')],'rows':_['map'](_0x1109b5[_0xe9c7('0x62')][_0xe9c7('0x2d')],function(_0x279164){return{'id':_0x279164[_0xe9c7('0x28')],'name':_0x279164['label'],'custom':_[_0xe9c7('0x6b')](_0x279164[_0xe9c7('0x28')],_0xe9c7('0x6c'))?!![]:![],'options':_0x279164['type'][_0xe9c7('0x28')]==='picklist'&&_0x279164[_0xe9c7('0x37')][_0xe9c7('0x6d')][_0xe9c7('0x30')]>0x0?_[_0xe9c7('0x24')](_0x279164['type'][_0xe9c7('0x6d')],function(_0x49df95){return{'name':_0x49df95[_0xe9c7('0x6e')],'value':_0x49df95[_0xe9c7('0x6f')]};}):[]};})};}})[_0xe9c7('0x22')](respondWithResult(_0x170e62,null))[_0xe9c7('0x3f')](function(_0xa6d165){console[_0xe9c7('0x70')](_0xe9c7('0x71')+_0xa6d165);var _0x5e40a7=_0x253a7e[_0xe9c7('0x2e')][_0xe9c7('0x72')]?0x1f4:_0xa6d165[_0xe9c7('0x73')]||0x1f4;logger[_0xe9c7('0x74')](_0xe9c7('0x75'),_0xe9c7('0x53'),_0x5e40a7,JSON[_0xe9c7('0x76')](_0xa6d165));delete _0xa6d165[_0xe9c7('0x28')];if(_0x5e40a7===0x191){_0x5e40a7=0x190;}_0x170e62[_0xe9c7('0x18')](_0x5e40a7)[_0xe9c7('0x77')](_0x253a7e[_0xe9c7('0x2e')][_0xe9c7('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0xa6d165[_0xe9c7('0x73')]}:_0xa6d165);});}; \ No newline at end of file +var _0xd34b=['body','destroy','getConfigurations','findOne','VtigerConfiguration','order','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','substring','lastIndexOf','%s/webservice.php','GET','getchallenge','success','POST','login','token','result','sessionName','autogenerated','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','nolimit','sort','where','filters','pick','filter','merge','type','options','then','VtigerAccount','findAll','catch','show','params','includeAll','find','create'];(function(_0x52e42b,_0x1fb85b){var _0x34e29a=function(_0x330762){while(--_0x330762){_0x52e42b['push'](_0x52e42b['shift']());}};_0x34e29a(++_0x1fb85b);}(_0xd34b,0xad));var _0xbd34=function(_0x45a98f,_0x306005){_0x45a98f=_0x45a98f-0x0;var _0x557328=_0xd34b[_0x45a98f];return _0x557328;};'use strict';var emlformat=require(_0xbd34('0x0'));var rimraf=require(_0xbd34('0x1'));var zipdir=require(_0xbd34('0x2'));var jsonpatch=require(_0xbd34('0x3'));var rp=require(_0xbd34('0x4'));var moment=require(_0xbd34('0x5'));var BPromise=require(_0xbd34('0x6'));var Mustache=require(_0xbd34('0x7'));var util=require(_0xbd34('0x8'));var path=require(_0xbd34('0x9'));var sox=require(_0xbd34('0xa'));var csv=require(_0xbd34('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd34('0xc'));var _=require(_0xbd34('0xd'));var squel=require(_0xbd34('0xe'));var crypto=require(_0xbd34('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xbd34('0x10'));var toCsv=require('to-csv');var querystring=require(_0xbd34('0x11'));var Papa=require(_0xbd34('0x12'));var Redis=require(_0xbd34('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xbd34('0x14'));var as=require(_0xbd34('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd34('0x16'))('api');var utils=require(_0xbd34('0x17'));var config=require(_0xbd34('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xbd34('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1c8a8e,_0x5cff8a){_0x5cff8a=_0x5cff8a||0xcc;return function(_0x58b1f5){if(_0x58b1f5){return _0x1c8a8e[_0xbd34('0x1a')](_0x5cff8a);}return _0x1c8a8e[_0xbd34('0x1b')](_0x5cff8a)[_0xbd34('0x1c')]();};}function respondWithResult(_0x431413,_0x3d3bfb){_0x3d3bfb=_0x3d3bfb||0xc8;return function(_0x4712bb){if(_0x4712bb){return _0x431413[_0xbd34('0x1b')](_0x3d3bfb)['json'](_0x4712bb);}};}function respondWithFilteredResult(_0x582089,_0xa0513c){return function(_0xe8469b){if(_0xe8469b){var _0x3b6e69=typeof _0xa0513c[_0xbd34('0x1d')]==='undefined'&&typeof _0xa0513c[_0xbd34('0x1e')]===_0xbd34('0x1f');var _0x43174b=_0xe8469b['count'];var _0x10b578=_0x3b6e69?0x0:_0xa0513c['offset'];var _0x2b1b76=_0x3b6e69?_0xe8469b[_0xbd34('0x20')]:_0xa0513c[_0xbd34('0x1d')]+_0xa0513c[_0xbd34('0x1e')];var _0xdceb2d;if(_0x2b1b76>=_0x43174b){_0x2b1b76=_0x43174b;_0xdceb2d=0xc8;}else{_0xdceb2d=0xce;}_0x582089[_0xbd34('0x1b')](_0xdceb2d);return _0x582089[_0xbd34('0x21')](_0xbd34('0x22'),_0x10b578+'-'+_0x2b1b76+'/'+_0x43174b)['json'](_0xe8469b);}return null;};}function patchUpdates(_0x3e95d2){return function(_0x16182e){try{jsonpatch[_0xbd34('0x23')](_0x16182e,_0x3e95d2,!![]);}catch(_0x288153){return BPromise['reject'](_0x288153);}return _0x16182e['save']();};}function saveUpdates(_0x5e5c7c,_0x586f12){return function(_0x5a4878){if(_0x5a4878){return _0x5a4878['update'](_0x5e5c7c)['then'](function(_0xeaf94e){return _0xeaf94e;});}return null;};}function removeEntity(_0x1aa5a8,_0x54f783){return function(_0xcaf440){if(_0xcaf440){return _0xcaf440['destroy']()['then'](function(){_0x1aa5a8['status'](0xcc)[_0xbd34('0x1c')]();});}};}function handleEntityNotFound(_0x4f44eb,_0x2a3877){return function(_0xb39e93){if(!_0xb39e93){_0x4f44eb[_0xbd34('0x1a')](0x194);}return _0xb39e93;};}function handleError(_0x3d220d,_0x199fbc){_0x199fbc=_0x199fbc||0x1f4;return function(_0x15399b){logger[_0xbd34('0x24')](_0x15399b[_0xbd34('0x25')]);if(_0x15399b['name']){delete _0x15399b[_0xbd34('0x26')];}_0x3d220d[_0xbd34('0x1b')](_0x199fbc)[_0xbd34('0x27')](_0x15399b);};}exports[_0xbd34('0x28')]=function(_0x2a0f3,_0x5a03bf){var _0x1c44e4={},_0x2111f3={},_0x2cf821={'count':0x0,'rows':[]};var _0x1a7639=_[_0xbd34('0x29')](db['VtigerAccount'][_0xbd34('0x2a')],function(_0x10126a){return{'name':_0x10126a['fieldName'],'type':_0x10126a['type'][_0xbd34('0x2b')]};});_0x2111f3[_0xbd34('0x2c')]=_['map'](_0x1a7639,_0xbd34('0x26'));_0x2111f3[_0xbd34('0x2d')]=_[_0xbd34('0x2e')](_0x2a0f3['query']);_0x2111f3['filters']=_[_0xbd34('0x2f')](_0x2111f3[_0xbd34('0x2c')],_0x2111f3['query']);_0x1c44e4['attributes']=_[_0xbd34('0x2f')](_0x2111f3[_0xbd34('0x2c')],qs[_0xbd34('0x30')](_0x2a0f3['query']['fields']));_0x1c44e4[_0xbd34('0x31')]=_0x1c44e4[_0xbd34('0x31')][_0xbd34('0x32')]?_0x1c44e4[_0xbd34('0x31')]:_0x2111f3[_0xbd34('0x2c')];if(!_0x2a0f3[_0xbd34('0x2d')]['hasOwnProperty'](_0xbd34('0x33'))){_0x1c44e4[_0xbd34('0x1e')]=qs[_0xbd34('0x1e')](_0x2a0f3[_0xbd34('0x2d')][_0xbd34('0x1e')]);_0x1c44e4[_0xbd34('0x1d')]=qs[_0xbd34('0x1d')](_0x2a0f3[_0xbd34('0x2d')][_0xbd34('0x1d')]);}_0x1c44e4['order']=qs[_0xbd34('0x34')](_0x2a0f3[_0xbd34('0x2d')][_0xbd34('0x34')]);_0x1c44e4[_0xbd34('0x35')]=qs[_0xbd34('0x36')](_[_0xbd34('0x37')](_0x2a0f3[_0xbd34('0x2d')],_0x2111f3[_0xbd34('0x36')]),_0x1a7639);if(_0x2a0f3[_0xbd34('0x2d')][_0xbd34('0x38')]){_0x1c44e4[_0xbd34('0x35')]=_[_0xbd34('0x39')](_0x1c44e4['where'],{'$or':_['map'](_0x1a7639,function(_0x4edb64){if(_0x4edb64[_0xbd34('0x3a')]!=='VIRTUAL'){var _0x5d3dbf={};_0x5d3dbf[_0x4edb64[_0xbd34('0x26')]]={'$like':'%'+_0x2a0f3[_0xbd34('0x2d')][_0xbd34('0x38')]+'%'};return _0x5d3dbf;}})});}_0x1c44e4=_['merge']({},_0x1c44e4,_0x2a0f3[_0xbd34('0x3b')]);var _0x47fbd9={'where':_0x1c44e4[_0xbd34('0x35')]};return db['VtigerAccount'][_0xbd34('0x20')](_0x47fbd9)[_0xbd34('0x3c')](function(_0x11c117){_0x2cf821['count']=_0x11c117;if(_0x2a0f3['query']['includeAll']){_0x1c44e4['include']=[{'all':!![]}];}return db[_0xbd34('0x3d')][_0xbd34('0x3e')](_0x1c44e4);})['then'](function(_0x32b6f3){_0x2cf821['rows']=_0x32b6f3;return _0x2cf821;})[_0xbd34('0x3c')](respondWithFilteredResult(_0x5a03bf,_0x1c44e4))[_0xbd34('0x3f')](handleError(_0x5a03bf,null));};exports[_0xbd34('0x40')]=function(_0x2d4253,_0x2592c3){var _0x56186a={'raw':![],'where':{'id':_0x2d4253[_0xbd34('0x41')]['id']}},_0xc961ba={};_0xc961ba[_0xbd34('0x2c')]=_['keys'](db[_0xbd34('0x3d')]['rawAttributes']);_0xc961ba[_0xbd34('0x2d')]=_[_0xbd34('0x2e')](_0x2d4253['query']);_0xc961ba['filters']=_['intersection'](_0xc961ba[_0xbd34('0x2c')],_0xc961ba[_0xbd34('0x2d')]);_0x56186a[_0xbd34('0x31')]=_[_0xbd34('0x2f')](_0xc961ba['model'],qs['fields'](_0x2d4253[_0xbd34('0x2d')]['fields']));_0x56186a[_0xbd34('0x31')]=_0x56186a[_0xbd34('0x31')][_0xbd34('0x32')]?_0x56186a[_0xbd34('0x31')]:_0xc961ba[_0xbd34('0x2c')];if(_0x2d4253[_0xbd34('0x2d')][_0xbd34('0x42')]){_0x56186a['include']=[{'all':!![]}];}_0x56186a=_[_0xbd34('0x39')]({},_0x56186a,_0x2d4253[_0xbd34('0x3b')]);return db[_0xbd34('0x3d')][_0xbd34('0x43')](_0x56186a)[_0xbd34('0x3c')](handleEntityNotFound(_0x2592c3,null))[_0xbd34('0x3c')](respondWithResult(_0x2592c3,null))['catch'](handleError(_0x2592c3,null));};exports[_0xbd34('0x44')]=function(_0x1ae5ee,_0x482ac1){return db[_0xbd34('0x3d')][_0xbd34('0x44')](_0x1ae5ee[_0xbd34('0x45')],{})[_0xbd34('0x3c')](respondWithResult(_0x482ac1,0xc9))[_0xbd34('0x3f')](handleError(_0x482ac1,null));};exports['update']=function(_0x51b27a,_0x49bfaf){if(_0x51b27a['body']['id']){delete _0x51b27a[_0xbd34('0x45')]['id'];}return db[_0xbd34('0x3d')]['find']({'where':{'id':_0x51b27a[_0xbd34('0x41')]['id']}})[_0xbd34('0x3c')](handleEntityNotFound(_0x49bfaf,null))['then'](saveUpdates(_0x51b27a[_0xbd34('0x45')],null))[_0xbd34('0x3c')](respondWithResult(_0x49bfaf,null))['catch'](handleError(_0x49bfaf,null));};exports[_0xbd34('0x46')]=function(_0xeaae1a,_0x34c62e){return db[_0xbd34('0x3d')][_0xbd34('0x43')]({'where':{'id':_0xeaae1a[_0xbd34('0x41')]['id']}})[_0xbd34('0x3c')](handleEntityNotFound(_0x34c62e,null))[_0xbd34('0x3c')](removeEntity(_0x34c62e,null))[_0xbd34('0x3f')](handleError(_0x34c62e,null));};exports[_0xbd34('0x47')]=function(_0x3f957f,_0x38d2fb,_0x59f3c){var _0x351776={};var _0x331805={};var _0x182071;var _0x149aaa;return db['VtigerAccount'][_0xbd34('0x48')]({'where':{'id':_0x3f957f[_0xbd34('0x41')]['id']}})['then'](handleEntityNotFound(_0x38d2fb,null))[_0xbd34('0x3c')](function(_0x5df6d0){if(_0x5df6d0){_0x182071=_0x5df6d0;_0x331805['model']=_['keys'](db[_0xbd34('0x49')][_0xbd34('0x2a')]);_0x331805['query']=_[_0xbd34('0x2e')](_0x3f957f[_0xbd34('0x2d')]);_0x331805[_0xbd34('0x36')]=_[_0xbd34('0x2f')](_0x331805['model'],_0x331805['query']);_0x351776['attributes']=_['intersection'](_0x331805[_0xbd34('0x2c')],qs[_0xbd34('0x30')](_0x3f957f[_0xbd34('0x2d')][_0xbd34('0x30')]));_0x351776[_0xbd34('0x31')]=_0x351776['attributes']['length']?_0x351776[_0xbd34('0x31')]:_0x331805['model'];_0x351776[_0xbd34('0x4a')]=qs['sort'](_0x3f957f[_0xbd34('0x2d')]['sort']);_0x351776[_0xbd34('0x35')]=qs['filters'](_[_0xbd34('0x37')](_0x3f957f[_0xbd34('0x2d')],_0x331805['filters']));if(_0x3f957f[_0xbd34('0x2d')][_0xbd34('0x38')]){_0x351776[_0xbd34('0x35')]=_[_0xbd34('0x39')](_0x351776[_0xbd34('0x35')],{'$or':_['map'](_0x351776[_0xbd34('0x31')],function(_0x1b9dfd){var _0x4a1204={};_0x4a1204[_0x1b9dfd]={'$like':'%'+_0x3f957f['query'][_0xbd34('0x38')]+'%'};return _0x4a1204;})});}_0x351776=_[_0xbd34('0x39')]({},_0x351776,_0x3f957f[_0xbd34('0x3b')]);return _0x182071[_0xbd34('0x47')](_0x351776);}})['then'](function(_0x1d972b){if(_0x1d972b){_0x149aaa=_0x1d972b[_0xbd34('0x32')];if(!_0x3f957f[_0xbd34('0x2d')][_0xbd34('0x4b')](_0xbd34('0x33'))){_0x351776[_0xbd34('0x1e')]=qs[_0xbd34('0x1e')](_0x3f957f[_0xbd34('0x2d')][_0xbd34('0x1e')]);_0x351776[_0xbd34('0x1d')]=qs[_0xbd34('0x1d')](_0x3f957f[_0xbd34('0x2d')]['offset']);}return _0x182071[_0xbd34('0x47')](_0x351776);}})['then'](function(_0x5a9ad7){if(_0x5a9ad7){return _0x5a9ad7?{'count':_0x149aaa,'rows':_0x5a9ad7}:null;}})[_0xbd34('0x3c')](respondWithResult(_0x38d2fb,null))[_0xbd34('0x3f')](handleError(_0x38d2fb,null));};exports[_0xbd34('0x4c')]=function(_0x4730ac,_0x1fd9db,_0x1308b4){if(_0x4730ac[_0xbd34('0x45')]['id']){delete _0x4730ac[_0xbd34('0x45')]['id'];}return db['VtigerAccount'][_0xbd34('0x48')]({'where':{'id':_0x4730ac['params']['id']}})[_0xbd34('0x3c')](handleEntityNotFound(_0x1fd9db,null))[_0xbd34('0x3c')](function(_0x4f39ea){if(_0x4f39ea){_0x4730ac['body'][_0xbd34('0x4d')]=_0x4f39ea['id'];_0x4730ac[_0xbd34('0x45')][_0xbd34('0x4e')]=integrations[_0xbd34('0x4f')](_0x4730ac['body'][_0xbd34('0x50')],_0x4730ac[_0xbd34('0x45')]['type']);_0x4730ac[_0xbd34('0x45')][_0xbd34('0x51')]=integrations[_0xbd34('0x52')](_0x4730ac[_0xbd34('0x45')][_0xbd34('0x50')],_0x4730ac[_0xbd34('0x45')][_0xbd34('0x3a')]);return db[_0xbd34('0x49')]['create'](_0x4730ac['body'],{'include':[{'model':db[_0xbd34('0x53')],'as':_0xbd34('0x4e')},{'model':db[_0xbd34('0x53')],'as':_0xbd34('0x51')}]});}return null;})[_0xbd34('0x3c')](respondWithResult(_0x1fd9db,null))['catch'](handleError(_0x1fd9db,null));};var md5=require(_0xbd34('0x54'));exports[_0xbd34('0x55')]=function(_0x154098,_0x42b718,_0x2fae32){var _0x5d562b=null;var _0x2a549b=null;var _0x5318d5=null;var _0x3785f5=null;var _0x21ae67='';return db['VtigerAccount'][_0xbd34('0x48')]({'where':{'id':_0x154098[_0xbd34('0x41')]['id']},'attributes':['id',_0xbd34('0x26'),_0xbd34('0x56'),_0xbd34('0x57'),_0xbd34('0x58'),_0xbd34('0x59'),_0xbd34('0x5a'),_0xbd34('0x5b')]})[_0xbd34('0x3c')](handleEntityNotFound(_0x42b718,null))[_0xbd34('0x3c')](function(_0x274aa6){if(_0x274aa6){_0x5d562b=_0x274aa6[_0xbd34('0x56')];_0x2a549b=_0x274aa6[_0xbd34('0x5b')];_0x5318d5=_0x274aa6[_0xbd34('0x58')];_0x21ae67=_0x274aa6[_0xbd34('0x59')];var _0x6e8ec3=_0x21ae67['slice'](-0x1);if(_0x6e8ec3==='/'){_0x21ae67=_0x21ae67[_0xbd34('0x5c')](0x0,_0x21ae67[_0xbd34('0x5d')](_0x6e8ec3));}_0x3785f5=util['format'](_0xbd34('0x5e'),_0x21ae67);var _0x7929e8={'method':_0xbd34('0x5f'),'uri':_0x3785f5,'qs':{'operation':_0xbd34('0x60'),'username':_0x274aa6[_0xbd34('0x56')]},'json':!![]};return rp(_0x7929e8);}})['then'](function(_0x56051e){if(_0x56051e[_0xbd34('0x61')]){var _0x4367f7={'method':_0xbd34('0x62'),'uri':_0x3785f5,'form':{'operation':_0xbd34('0x63'),'username':_0x5d562b,'accessKey':md5(_0x56051e['result'][_0xbd34('0x64')]+_0x2a549b)},'json':!![]};return rp(_0x4367f7);}})[_0xbd34('0x3c')](function(_0x32fd8d){if(_0x32fd8d['success']){var _0x48104={'method':'GET','uri':_0x3785f5,'qs':{'operation':'describe','username':_0x5d562b,'sessionName':_0x32fd8d[_0xbd34('0x65')][_0xbd34('0x66')],'elementType':_0x5318d5},'json':!![]};return rp(_0x48104);}})['then'](function(_0x4166bc){if(_0x4166bc[_0xbd34('0x61')]){var _0xc271cd=[_0xbd34('0x67'),_0xbd34('0x68'),_0xbd34('0x69')];_[_0xbd34('0x6a')](_0x4166bc[_0xbd34('0x65')][_0xbd34('0x30')],function(_0x5b0875){return _0xc271cd[_0xbd34('0x6b')](_0x5b0875[_0xbd34('0x3a')][_0xbd34('0x26')]);});_['remove'](_0x4166bc[_0xbd34('0x65')][_0xbd34('0x30')],function(_0x4cc980){return _0x4cc980[_0xbd34('0x6c')]===_0xbd34('0x6d');});return{'count':_0x4166bc[_0xbd34('0x65')][_0xbd34('0x30')][_0xbd34('0x32')],'rows':_['map'](_0x4166bc[_0xbd34('0x65')][_0xbd34('0x30')],function(_0x926516){return{'id':_0x926516[_0xbd34('0x26')],'name':_0x926516[_0xbd34('0x6e')],'custom':_[_0xbd34('0x6f')](_0x926516[_0xbd34('0x26')],_0xbd34('0x70'))?!![]:![],'options':_0x926516['type'][_0xbd34('0x26')]===_0xbd34('0x71')&&_0x926516[_0xbd34('0x3a')][_0xbd34('0x72')][_0xbd34('0x32')]>0x0?_[_0xbd34('0x29')](_0x926516[_0xbd34('0x3a')][_0xbd34('0x72')],function(_0x318a56){return{'name':_0x318a56[_0xbd34('0x6e')],'value':_0x318a56[_0xbd34('0x73')]};}):[]};})};}})['then'](respondWithResult(_0x42b718,null))[_0xbd34('0x3f')](function(_0x5b749a){console[_0xbd34('0x74')]('vTiger\x20error:\x20'+_0x5b749a);var _0x353e8b=_0x154098[_0xbd34('0x2d')][_0xbd34('0x75')]?0x1f4:_0x5b749a[_0xbd34('0x76')]||0x1f4;logger[_0xbd34('0x24')](_0xbd34('0x77'),'getFields',_0x353e8b,JSON['stringify'](_0x5b749a));delete _0x5b749a['name'];if(_0x353e8b===0x191){_0x353e8b=0x190;}_0x42b718['status'](_0x353e8b)[_0xbd34('0x27')](_0x154098[_0xbd34('0x2d')][_0xbd34('0x75')]?{'message':_0xbd34('0x78'),'statusCode':_0x5b749a['statusCode']}:_0x5b749a);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 62beffa..e7e80c0 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 _0xecab=['rimraf','../../config/environment','../../components/integrations/configuration','define','VtigerAccount','int_vtiger_accounts','lodash','moment','bluebird','path'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xecab,0x114));var _0xbeca=function(_0x4b83ec,_0x4bdc65){_0x4b83ec=_0x4b83ec-0x0;var _0x28de28=_0xecab[_0x4b83ec];return _0x28de28;};'use strict';var _=require(_0xbeca('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xbeca('0x1'));var BPromise=require(_0xbeca('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbeca('0x3'));var rimraf=require(_0xbeca('0x4'));var config=require(_0xbeca('0x5'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0xbeca('0x6'));module['exports']=function(_0x4320c7,_0x721037){return _0x4320c7[_0xbeca('0x7')](_0xbeca('0x8'),attributes,{'tableName':_0xbeca('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x50ce=['define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x41b306,_0x46347f){var _0x1039a4=function(_0x2534bd){while(--_0x2534bd){_0x41b306['push'](_0x41b306['shift']());}};_0x1039a4(++_0x46347f);}(_0x50ce,0x189));var _0xe50c=function(_0x385c76,_0xb97335){_0x385c76=_0x385c76-0x0;var _0x5c8367=_0x50ce[_0x385c76];return _0x5c8367;};'use strict';var _=require(_0xe50c('0x0'));var util=require(_0xe50c('0x1'));var logger=require(_0xe50c('0x2'))('api');var moment=require(_0xe50c('0x3'));var BPromise=require(_0xe50c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe50c('0x5'));var rimraf=require('rimraf');var config=require(_0xe50c('0x6'));var attributes=require(_0xe50c('0x7'));var integrations=require(_0xe50c('0x8'));module[_0xe50c('0x9')]=function(_0x57ad3f,_0x3dc366){return _0x57ad3f[_0xe50c('0xa')](_0xe50c('0xb'),attributes,{'tableName':_0xe50c('0xc'),'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 1686aba..d915ade 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 _0x04b8=['jayson/promise','http','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetVtigerAccount','VtigerAccount','findAll','options','where','attributes','limit','map','model','include','debug','catch','ShowVtigerAccount','find','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x154d1e,_0x1f705a){var _0x17568e=function(_0x2da0bb){while(--_0x2da0bb){_0x154d1e['push'](_0x154d1e['shift']());}};_0x17568e(++_0x1f705a);}(_0x04b8,0x159));var _0x804b=function(_0x2d6404,_0x3f57a7){_0x2d6404=_0x2d6404-0x0;var _0x468b09=_0x04b8[_0x2d6404];return _0x468b09;};'use strict';var _=require('lodash');var util=require(_0x804b('0x0'));var moment=require('moment');var BPromise=require(_0x804b('0x1'));var rs=require(_0x804b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x804b('0x3'))['db'];var utils=require(_0x804b('0x4'));var logger=require('../../config/logger')(_0x804b('0x5'));var config=require(_0x804b('0x6'));var jayson=require(_0x804b('0x7'));var client=jayson['client'][_0x804b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c5404,_0x476262,_0x50826d){return new BPromise(function(_0x27e950,_0x1071b4){return client['request'](_0x3c5404,_0x50826d)[_0x804b('0x9')](function(_0x336325){logger[_0x804b('0xa')](_0x804b('0xb'),_0x476262,_0x804b('0xc'));logger['debug'](_0x804b('0xd'),_0x476262,_0x804b('0xc'),JSON[_0x804b('0xe')](_0x336325));if(_0x336325[_0x804b('0xf')]){if(_0x336325[_0x804b('0xf')][_0x804b('0x10')]===0x1f4){logger['error'](_0x804b('0xb'),_0x476262,_0x336325['error'][_0x804b('0x11')]);return _0x1071b4(_0x336325[_0x804b('0xf')][_0x804b('0x11')]);}logger[_0x804b('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x476262,_0x336325[_0x804b('0xf')][_0x804b('0x11')]);return _0x27e950(_0x336325[_0x804b('0xf')][_0x804b('0x11')]);}else{logger['info'](_0x804b('0xb'),_0x476262,_0x804b('0xc'));_0x27e950(_0x336325['result'][_0x804b('0x11')]);}})['catch'](function(_0x2c90b9){logger[_0x804b('0xf')](_0x804b('0xb'),_0x476262,_0x2c90b9);_0x1071b4(_0x2c90b9);});});}exports[_0x804b('0x12')]=function(_0x3a05c0){var _0x5a0a82=this;return new Promise(function(_0x871d6c,_0x50b4fe){return db[_0x804b('0x13')][_0x804b('0x14')]({'raw':_0x3a05c0[_0x804b('0x15')]?_0x3a05c0[_0x804b('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x3a05c0[_0x804b('0x15')]?_0x3a05c0[_0x804b('0x15')][_0x804b('0x16')]||null:null,'attributes':_0x3a05c0[_0x804b('0x15')]?_0x3a05c0[_0x804b('0x15')][_0x804b('0x17')]||null:null,'limit':_0x3a05c0[_0x804b('0x15')]?_0x3a05c0[_0x804b('0x15')][_0x804b('0x18')]||null:null,'include':_0x3a05c0[_0x804b('0x15')]?_0x3a05c0[_0x804b('0x15')]['include']?_[_0x804b('0x19')](_0x3a05c0[_0x804b('0x15')]['include'],function(_0x44a921){return{'model':db[_0x44a921[_0x804b('0x1a')]],'as':_0x44a921['as'],'attributes':_0x44a921[_0x804b('0x17')],'include':_0x44a921[_0x804b('0x1b')]?_[_0x804b('0x19')](_0x44a921['include'],function(_0x2de812){return{'model':db[_0x2de812[_0x804b('0x1a')]],'as':_0x2de812['as'],'attributes':_0x2de812['attributes'],'include':_0x2de812[_0x804b('0x1b')]?_[_0x804b('0x19')](_0x2de812[_0x804b('0x1b')],function(_0x27d5ec){return{'model':db[_0x27d5ec[_0x804b('0x1a')]],'as':_0x27d5ec['as'],'attributes':_0x27d5ec['attributes']};}):[]};}):[]};}):[]:[]})[_0x804b('0x9')](function(_0x22f822){logger[_0x804b('0xa')](_0x804b('0x12'),_0x3a05c0);logger[_0x804b('0x1c')]('GetVtigerAccount',_0x3a05c0,JSON[_0x804b('0xe')](_0x22f822));_0x871d6c(_0x22f822);})[_0x804b('0x1d')](function(_0x410871){logger['error'](_0x804b('0x12'),_0x410871[_0x804b('0x11')],_0x3a05c0);_0x50b4fe(_0x5a0a82[_0x804b('0xf')](0x1f4,_0x410871['message']));});});};exports[_0x804b('0x1e')]=function(_0x471c04){var _0x5e8f85=this;return new Promise(function(_0x391376,_0x37dd3e){return db[_0x804b('0x13')][_0x804b('0x1f')]({'raw':_0x471c04[_0x804b('0x15')]?_0x471c04[_0x804b('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x471c04[_0x804b('0x15')]?_0x471c04[_0x804b('0x15')][_0x804b('0x16')]||null:null,'attributes':_0x471c04[_0x804b('0x15')]?_0x471c04[_0x804b('0x15')][_0x804b('0x17')]||null:null,'include':_0x471c04[_0x804b('0x15')]?_0x471c04[_0x804b('0x15')][_0x804b('0x1b')]?_[_0x804b('0x19')](_0x471c04[_0x804b('0x15')][_0x804b('0x1b')],function(_0x34d5d0){return{'model':db[_0x34d5d0[_0x804b('0x1a')]],'as':_0x34d5d0['as'],'attributes':_0x34d5d0[_0x804b('0x17')],'include':_0x34d5d0[_0x804b('0x1b')]?_[_0x804b('0x19')](_0x34d5d0[_0x804b('0x1b')],function(_0xf47023){return{'model':db[_0xf47023[_0x804b('0x1a')]],'as':_0xf47023['as'],'attributes':_0xf47023[_0x804b('0x17')],'include':_0xf47023[_0x804b('0x1b')]?_[_0x804b('0x19')](_0xf47023[_0x804b('0x1b')],function(_0x35150b){return{'model':db[_0x35150b['model']],'as':_0x35150b['as'],'attributes':_0x35150b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3da331){logger[_0x804b('0xa')](_0x804b('0x1e'),_0x471c04);logger['debug']('ShowVtigerAccount',_0x471c04,JSON['stringify'](_0x3da331));_0x391376(_0x3da331);})[_0x804b('0x1d')](function(_0x1aaa47){logger[_0x804b('0xf')](_0x804b('0x1e'),_0x1aaa47[_0x804b('0x11')],_0x471c04);_0x37dd3e(_0x5e8f85[_0x804b('0xf')](0x1f4,_0x1aaa47[_0x804b('0x11')]));});});}; \ No newline at end of file +var _0xae60=['result','catch','GetVtigerAccount','VtigerAccount','findAll','options','where','attributes','include','map','model','raw','ShowVtigerAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x1dbf4f,_0x33aede){var _0x2a565b=function(_0x2bd619){while(--_0x2bd619){_0x1dbf4f['push'](_0x1dbf4f['shift']());}};_0x2a565b(++_0x33aede);}(_0xae60,0x1c7));var _0x0ae6=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xae60[_0x4b7895];return _0x264180;};'use strict';var _=require(_0x0ae6('0x0'));var util=require(_0x0ae6('0x1'));var moment=require(_0x0ae6('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ae6('0x3'));var fs=require('fs');var Redis=require(_0x0ae6('0x4'));var db=require(_0x0ae6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ae6('0x6'))(_0x0ae6('0x7'));var config=require('../../config/environment');var jayson=require(_0x0ae6('0x8'));var client=jayson[_0x0ae6('0x9')][_0x0ae6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46fed4,_0xbb596c,_0x447a1d){return new BPromise(function(_0x120910,_0x1b5e80){return client['request'](_0x46fed4,_0x447a1d)[_0x0ae6('0xb')](function(_0x36a5e0){logger[_0x0ae6('0xc')](_0x0ae6('0xd'),_0xbb596c,'request\x20sent');logger[_0x0ae6('0xe')](_0x0ae6('0xf'),_0xbb596c,_0x0ae6('0x10'),JSON[_0x0ae6('0x11')](_0x36a5e0));if(_0x36a5e0[_0x0ae6('0x12')]){if(_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x13')]===0x1f4){logger[_0x0ae6('0x12')](_0x0ae6('0xd'),_0xbb596c,_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);return _0x1b5e80(_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);}logger[_0x0ae6('0x12')]('VtigerAccount,\x20%s,\x20%s',_0xbb596c,_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);return _0x120910(_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);}else{logger[_0x0ae6('0xc')](_0x0ae6('0xd'),_0xbb596c,_0x0ae6('0x10'));_0x120910(_0x36a5e0[_0x0ae6('0x15')][_0x0ae6('0x14')]);}})[_0x0ae6('0x16')](function(_0x8a4c9a){logger[_0x0ae6('0x12')](_0x0ae6('0xd'),_0xbb596c,_0x8a4c9a);_0x1b5e80(_0x8a4c9a);});});}exports[_0x0ae6('0x17')]=function(_0xda4f01){var _0x3f5c41=this;return new Promise(function(_0x2fdf25,_0x1735ba){return db[_0x0ae6('0x18')][_0x0ae6('0x19')]({'raw':_0xda4f01[_0x0ae6('0x1a')]?_0xda4f01[_0x0ae6('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xda4f01[_0x0ae6('0x1a')]?_0xda4f01[_0x0ae6('0x1a')][_0x0ae6('0x1b')]||null:null,'attributes':_0xda4f01[_0x0ae6('0x1a')]?_0xda4f01[_0x0ae6('0x1a')][_0x0ae6('0x1c')]||null:null,'limit':_0xda4f01[_0x0ae6('0x1a')]?_0xda4f01[_0x0ae6('0x1a')]['limit']||null:null,'include':_0xda4f01[_0x0ae6('0x1a')]?_0xda4f01[_0x0ae6('0x1a')][_0x0ae6('0x1d')]?_[_0x0ae6('0x1e')](_0xda4f01[_0x0ae6('0x1a')]['include'],function(_0x296a9d){return{'model':db[_0x296a9d[_0x0ae6('0x1f')]],'as':_0x296a9d['as'],'attributes':_0x296a9d[_0x0ae6('0x1c')],'include':_0x296a9d[_0x0ae6('0x1d')]?_[_0x0ae6('0x1e')](_0x296a9d[_0x0ae6('0x1d')],function(_0x5b86fe){return{'model':db[_0x5b86fe[_0x0ae6('0x1f')]],'as':_0x5b86fe['as'],'attributes':_0x5b86fe[_0x0ae6('0x1c')],'include':_0x5b86fe['include']?_['map'](_0x5b86fe[_0x0ae6('0x1d')],function(_0x3255a7){return{'model':db[_0x3255a7[_0x0ae6('0x1f')]],'as':_0x3255a7['as'],'attributes':_0x3255a7['attributes']};}):[]};}):[]};}):[]:[]})[_0x0ae6('0xb')](function(_0xb68cbe){logger[_0x0ae6('0xc')]('GetVtigerAccount',_0xda4f01);logger[_0x0ae6('0xe')](_0x0ae6('0x17'),_0xda4f01,JSON[_0x0ae6('0x11')](_0xb68cbe));_0x2fdf25(_0xb68cbe);})[_0x0ae6('0x16')](function(_0x14eed5){logger[_0x0ae6('0x12')]('GetVtigerAccount',_0x14eed5['message'],_0xda4f01);_0x1735ba(_0x3f5c41[_0x0ae6('0x12')](0x1f4,_0x14eed5[_0x0ae6('0x14')]));});});};exports['ShowVtigerAccount']=function(_0x4a06f1){var _0x1ca059=this;return new Promise(function(_0x278577,_0x714c6d){return db[_0x0ae6('0x18')]['find']({'raw':_0x4a06f1[_0x0ae6('0x1a')]?_0x4a06f1[_0x0ae6('0x1a')][_0x0ae6('0x20')]===undefined?!![]:![]:!![],'where':_0x4a06f1['options']?_0x4a06f1[_0x0ae6('0x1a')][_0x0ae6('0x1b')]||null:null,'attributes':_0x4a06f1[_0x0ae6('0x1a')]?_0x4a06f1[_0x0ae6('0x1a')][_0x0ae6('0x1c')]||null:null,'include':_0x4a06f1[_0x0ae6('0x1a')]?_0x4a06f1[_0x0ae6('0x1a')][_0x0ae6('0x1d')]?_[_0x0ae6('0x1e')](_0x4a06f1[_0x0ae6('0x1a')]['include'],function(_0x2410bd){return{'model':db[_0x2410bd[_0x0ae6('0x1f')]],'as':_0x2410bd['as'],'attributes':_0x2410bd['attributes'],'include':_0x2410bd[_0x0ae6('0x1d')]?_[_0x0ae6('0x1e')](_0x2410bd[_0x0ae6('0x1d')],function(_0x5b9662){return{'model':db[_0x5b9662[_0x0ae6('0x1f')]],'as':_0x5b9662['as'],'attributes':_0x5b9662['attributes'],'include':_0x5b9662['include']?_[_0x0ae6('0x1e')](_0x5b9662[_0x0ae6('0x1d')],function(_0x18fc19){return{'model':db[_0x18fc19[_0x0ae6('0x1f')]],'as':_0x18fc19['as'],'attributes':_0x18fc19[_0x0ae6('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x584dc8){logger[_0x0ae6('0xc')]('ShowVtigerAccount',_0x4a06f1);logger[_0x0ae6('0xe')]('ShowVtigerAccount',_0x4a06f1,JSON[_0x0ae6('0x11')](_0x584dc8));_0x278577(_0x584dc8);})['catch'](function(_0x7998e3){logger[_0x0ae6('0x12')](_0x0ae6('0x21'),_0x7998e3[_0x0ae6('0x14')],_0x4a06f1);_0x714c6d(_0x1ca059['error'](0x1f4,_0x7998e3['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 1f2e721..bd52c8a 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 _0x8783=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','update','delete','destroy','exports'];(function(_0x2e3d82,_0xe22211){var _0x282928=function(_0x409a7e){while(--_0x409a7e){_0x2e3d82['push'](_0x2e3d82['shift']());}};_0x282928(++_0xe22211);}(_0x8783,0x104));var _0x3878=function(_0x3ef583,_0x372563){_0x3ef583=_0x3ef583-0x0;var _0x29c012=_0x8783[_0x3ef583];return _0x29c012;};'use strict';var multer=require(_0x3878('0x0'));var util=require(_0x3878('0x1'));var path=require(_0x3878('0x2'));var timeout=require(_0x3878('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3878('0x4'));var interaction=require(_0x3878('0x5'));var config=require('../../config/environment');var controller=require('./intVtigerConfiguration.controller');router[_0x3878('0x6')]('/',auth[_0x3878('0x7')](),controller[_0x3878('0x8')]);router[_0x3878('0x6')](_0x3878('0x9'),auth[_0x3878('0x7')](),controller['show']);router[_0x3878('0x6')](_0x3878('0xa'),auth['isAuthenticated'](),controller[_0x3878('0xb')]);router[_0x3878('0x6')](_0x3878('0xc'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x3878('0x6')](_0x3878('0xd'),auth['isAuthenticated'](),controller[_0x3878('0xe')]);router[_0x3878('0xf')]('/',auth[_0x3878('0x7')](),controller['create']);router['put'](_0x3878('0x9'),auth[_0x3878('0x7')](),controller[_0x3878('0x10')]);router[_0x3878('0x11')](_0x3878('0x9'),auth['isAuthenticated'](),controller[_0x3878('0x12')]);module[_0x3878('0x13')]=router; \ No newline at end of file +var _0xb3ba=['destroy','exports','multer','util','connect-timeout','express','Router','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','/:id','show','get','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put'];(function(_0x2656b5,_0x5de18c){var _0xa9ceae=function(_0x412bec){while(--_0x412bec){_0x2656b5['push'](_0x2656b5['shift']());}};_0xa9ceae(++_0x5de18c);}(_0xb3ba,0xb6));var _0xab3b=function(_0x3d9626,_0x13d5ce){_0x3d9626=_0x3d9626-0x0;var _0x1a976b=_0xb3ba[_0x3d9626];return _0x1a976b;};'use strict';var multer=require(_0xab3b('0x0'));var util=require(_0xab3b('0x1'));var path=require('path');var timeout=require(_0xab3b('0x2'));var express=require(_0xab3b('0x3'));var router=express[_0xab3b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xab3b('0x5'));var controller=require(_0xab3b('0x6'));router['get']('/',auth[_0xab3b('0x7')](),controller['index']);router['get'](_0xab3b('0x8'),auth['isAuthenticated'](),controller[_0xab3b('0x9')]);router[_0xab3b('0xa')]('/:id/fields',auth[_0xab3b('0x7')](),controller['getFields']);router[_0xab3b('0xa')](_0xab3b('0xb'),auth[_0xab3b('0x7')](),controller[_0xab3b('0xc')]);router[_0xab3b('0xa')](_0xab3b('0xd'),auth['isAuthenticated'](),controller[_0xab3b('0xe')]);router[_0xab3b('0xf')]('/',auth[_0xab3b('0x7')](),controller[_0xab3b('0x10')]);router[_0xab3b('0x11')]('/:id',auth[_0xab3b('0x7')](),controller['update']);router['delete'](_0xab3b('0x8'),auth[_0xab3b('0x7')](),controller[_0xab3b('0x12')]);module[_0xab3b('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 203fce9..19b6181 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 _0x7dee=['STRING','exports'];(function(_0x2ac71a,_0x1d2a02){var _0x3ee904=function(_0x5c902a){while(--_0x5c902a){_0x2ac71a['push'](_0x2ac71a['shift']());}};_0x3ee904(++_0x1d2a02);}(_0x7dee,0x187));var _0xe7de=function(_0x5ee41b,_0x2cc36a){_0x5ee41b=_0x5ee41b-0x0;var _0x558361=_0x7dee[_0x5ee41b];return _0x558361;};'use strict';var Sequelize=require('sequelize');module[_0xe7de('0x0')]={'name':{'type':Sequelize[_0xe7de('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x325c=['sequelize','exports','STRING'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x325c,0x75));var _0xc325=function(_0x46376c,_0x562f7a){_0x46376c=_0x46376c-0x0;var _0x538ac4=_0x325c[_0x46376c];return _0x538ac4;};'use strict';var Sequelize=require(_0xc325('0x0'));module[_0xc325('0x1')]={'name':{'type':Sequelize[_0xc325('0x2')]},'description':{'type':Sequelize[_0xc325('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 18868b9..9f750e7 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 _0xbb1e=['../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','name','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','VtigerField','pick','getFields','hasOwnProperty','getSubjects','getDescriptions','findOne','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xbb1e,0x90));var _0xebb1=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbb1e[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xebb1('0x0'));var zipdir=require(_0xebb1('0x1'));var jsonpatch=require(_0xebb1('0x2'));var rp=require(_0xebb1('0x3'));var moment=require('moment');var BPromise=require(_0xebb1('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xebb1('0x5'));var sox=require(_0xebb1('0x6'));var csv=require(_0xebb1('0x7'));var ejs=require(_0xebb1('0x8'));var fs=require('fs');var fs_extra=require(_0xebb1('0x9'));var _=require(_0xebb1('0xa'));var squel=require(_0xebb1('0xb'));var crypto=require(_0xebb1('0xc'));var jsforce=require(_0xebb1('0xd'));var deskjs=require(_0xebb1('0xe'));var toCsv=require('to-csv');var querystring=require(_0xebb1('0xf'));var Papa=require(_0xebb1('0x10'));var Redis=require(_0xebb1('0x11'));var authService=require(_0xebb1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xebb1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xebb1('0x14'))('api');var utils=require(_0xebb1('0x15'));var config=require(_0xebb1('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xebb1('0x17'))['db'];function respondWithStatusCode(_0x28b55d,_0x538e5c){_0x538e5c=_0x538e5c||0xcc;return function(_0x59a0af){if(_0x59a0af){return _0x28b55d['sendStatus'](_0x538e5c);}return _0x28b55d['status'](_0x538e5c)['end']();};}function respondWithResult(_0x574baa,_0x55485b){_0x55485b=_0x55485b||0xc8;return function(_0x5dc49c){if(_0x5dc49c){return _0x574baa[_0xebb1('0x18')](_0x55485b)[_0xebb1('0x19')](_0x5dc49c);}};}function respondWithFilteredResult(_0x6e2518,_0x2e31db){return function(_0x34c82e){if(_0x34c82e){var _0x437a5e=typeof _0x2e31db[_0xebb1('0x1a')]===_0xebb1('0x1b')&&typeof _0x2e31db[_0xebb1('0x1c')]===_0xebb1('0x1b');var _0x5d6f19=_0x34c82e[_0xebb1('0x1d')];var _0x48edb8=_0x437a5e?0x0:_0x2e31db[_0xebb1('0x1a')];var _0x12d769=_0x437a5e?_0x34c82e[_0xebb1('0x1d')]:_0x2e31db[_0xebb1('0x1a')]+_0x2e31db[_0xebb1('0x1c')];var _0x7cff00;if(_0x12d769>=_0x5d6f19){_0x12d769=_0x5d6f19;_0x7cff00=0xc8;}else{_0x7cff00=0xce;}_0x6e2518[_0xebb1('0x18')](_0x7cff00);return _0x6e2518[_0xebb1('0x1e')](_0xebb1('0x1f'),_0x48edb8+'-'+_0x12d769+'/'+_0x5d6f19)[_0xebb1('0x19')](_0x34c82e);}return null;};}function patchUpdates(_0xc9c86c){return function(_0x5e2f4e){try{jsonpatch[_0xebb1('0x20')](_0x5e2f4e,_0xc9c86c,!![]);}catch(_0x2cafe4){return BPromise[_0xebb1('0x21')](_0x2cafe4);}return _0x5e2f4e[_0xebb1('0x22')]();};}function saveUpdates(_0x48c898,_0x14238b){return function(_0x576cf1){if(_0x576cf1){return _0x576cf1[_0xebb1('0x23')](_0x48c898)[_0xebb1('0x24')](function(_0x5eb81a){return _0x5eb81a;});}return null;};}function removeEntity(_0x2f8ba0,_0x5dbb2b){return function(_0x338c5f){if(_0x338c5f){return _0x338c5f[_0xebb1('0x25')]()['then'](function(){_0x2f8ba0[_0xebb1('0x18')](0xcc)[_0xebb1('0x26')]();});}};}function handleEntityNotFound(_0x2ed097,_0x479439){return function(_0x4451e0){if(!_0x4451e0){_0x2ed097[_0xebb1('0x27')](0x194);}return _0x4451e0;};}function handleError(_0x542034,_0x32f2ae){_0x32f2ae=_0x32f2ae||0x1f4;return function(_0x147c0b){logger[_0xebb1('0x28')](_0x147c0b['stack']);if(_0x147c0b[_0xebb1('0x29')]){delete _0x147c0b[_0xebb1('0x29')];}_0x542034['status'](_0x32f2ae)['send'](_0x147c0b);};}exports[_0xebb1('0x2a')]=function(_0x58b878,_0x543c9a){var _0x2475fa={},_0x142991={},_0x1cb0ce={'count':0x0,'rows':[]};var _0x1e4562=_[_0xebb1('0x2b')](db[_0xebb1('0x2c')][_0xebb1('0x2d')],function(_0x45b7e0){return{'name':_0x45b7e0[_0xebb1('0x2e')],'type':_0x45b7e0[_0xebb1('0x2f')][_0xebb1('0x30')]};});_0x142991[_0xebb1('0x31')]=_[_0xebb1('0x2b')](_0x1e4562,_0xebb1('0x29'));_0x142991['query']=_[_0xebb1('0x32')](_0x58b878[_0xebb1('0x33')]);_0x142991['filters']=_[_0xebb1('0x34')](_0x142991['model'],_0x142991[_0xebb1('0x33')]);_0x2475fa[_0xebb1('0x35')]=_['intersection'](_0x142991[_0xebb1('0x31')],qs[_0xebb1('0x36')](_0x58b878[_0xebb1('0x33')][_0xebb1('0x36')]));_0x2475fa[_0xebb1('0x35')]=_0x2475fa[_0xebb1('0x35')][_0xebb1('0x37')]?_0x2475fa[_0xebb1('0x35')]:_0x142991['model'];if(!_0x58b878[_0xebb1('0x33')]['hasOwnProperty'](_0xebb1('0x38'))){_0x2475fa[_0xebb1('0x1c')]=qs[_0xebb1('0x1c')](_0x58b878[_0xebb1('0x33')][_0xebb1('0x1c')]);_0x2475fa['offset']=qs[_0xebb1('0x1a')](_0x58b878[_0xebb1('0x33')][_0xebb1('0x1a')]);}_0x2475fa[_0xebb1('0x39')]=qs[_0xebb1('0x3a')](_0x58b878[_0xebb1('0x33')][_0xebb1('0x3a')]);_0x2475fa[_0xebb1('0x3b')]=qs[_0xebb1('0x3c')](_['pick'](_0x58b878[_0xebb1('0x33')],_0x142991[_0xebb1('0x3c')]),_0x1e4562);if(_0x58b878[_0xebb1('0x33')][_0xebb1('0x3d')]){_0x2475fa[_0xebb1('0x3b')]=_[_0xebb1('0x3e')](_0x2475fa[_0xebb1('0x3b')],{'$or':_[_0xebb1('0x2b')](_0x1e4562,function(_0x18ef89){if(_0x18ef89[_0xebb1('0x2f')]!==_0xebb1('0x3f')){var _0x53d610={};_0x53d610[_0x18ef89[_0xebb1('0x29')]]={'$like':'%'+_0x58b878[_0xebb1('0x33')][_0xebb1('0x3d')]+'%'};return _0x53d610;}})});}_0x2475fa=_[_0xebb1('0x3e')]({},_0x2475fa,_0x58b878[_0xebb1('0x40')]);var _0x204d77={'where':_0x2475fa['where']};return db[_0xebb1('0x2c')][_0xebb1('0x1d')](_0x204d77)['then'](function(_0x296944){_0x1cb0ce['count']=_0x296944;if(_0x58b878['query']['includeAll']){_0x2475fa[_0xebb1('0x41')]=[{'all':!![]}];}return db[_0xebb1('0x2c')][_0xebb1('0x42')](_0x2475fa);})[_0xebb1('0x24')](function(_0x23f537){_0x1cb0ce[_0xebb1('0x43')]=_0x23f537;return _0x1cb0ce;})['then'](respondWithFilteredResult(_0x543c9a,_0x2475fa))[_0xebb1('0x44')](handleError(_0x543c9a,null));};exports[_0xebb1('0x45')]=function(_0x48ca50,_0x6f5fbb){var _0x2c9202={'raw':![],'where':{'id':_0x48ca50[_0xebb1('0x46')]['id']}},_0x108740={};_0x108740[_0xebb1('0x31')]=_[_0xebb1('0x32')](db[_0xebb1('0x2c')][_0xebb1('0x2d')]);_0x108740[_0xebb1('0x33')]=_[_0xebb1('0x32')](_0x48ca50['query']);_0x108740[_0xebb1('0x3c')]=_[_0xebb1('0x34')](_0x108740[_0xebb1('0x31')],_0x108740[_0xebb1('0x33')]);_0x2c9202[_0xebb1('0x35')]=_[_0xebb1('0x34')](_0x108740[_0xebb1('0x31')],qs[_0xebb1('0x36')](_0x48ca50[_0xebb1('0x33')][_0xebb1('0x36')]));_0x2c9202[_0xebb1('0x35')]=_0x2c9202[_0xebb1('0x35')][_0xebb1('0x37')]?_0x2c9202[_0xebb1('0x35')]:_0x108740[_0xebb1('0x31')];if(_0x48ca50[_0xebb1('0x33')][_0xebb1('0x47')]){_0x2c9202[_0xebb1('0x41')]=[{'all':!![]}];}_0x2c9202=_[_0xebb1('0x3e')]({},_0x2c9202,_0x48ca50['options']);return db[_0xebb1('0x2c')][_0xebb1('0x48')](_0x2c9202)[_0xebb1('0x24')](handleEntityNotFound(_0x6f5fbb,null))['then'](respondWithResult(_0x6f5fbb,null))['catch'](handleError(_0x6f5fbb,null));};exports[_0xebb1('0x49')]=function(_0x235423,_0x583f58){return db['VtigerConfiguration'][_0xebb1('0x49')](_0x235423['body'],{})['then'](respondWithResult(_0x583f58,0xc9))['catch'](handleError(_0x583f58,null));};exports['update']=function(_0x56dcaf,_0x2c8dbc){if(_0x56dcaf[_0xebb1('0x4a')]['id']){delete _0x56dcaf[_0xebb1('0x4a')]['id'];}return db[_0xebb1('0x2c')]['find']({'where':{'id':_0x56dcaf['params']['id']}})['then'](handleEntityNotFound(_0x2c8dbc,null))[_0xebb1('0x24')](saveUpdates(_0x56dcaf[_0xebb1('0x4a')],null))['then'](respondWithResult(_0x2c8dbc,null))[_0xebb1('0x44')](handleError(_0x2c8dbc,null));};exports['destroy']=function(_0x4303e2,_0x2da6ea){return db[_0xebb1('0x2c')]['find']({'where':{'id':_0x4303e2[_0xebb1('0x46')]['id']}})['then'](handleEntityNotFound(_0x2da6ea,null))[_0xebb1('0x24')](removeEntity(_0x2da6ea,null))['catch'](handleError(_0x2da6ea,null));};exports['getFields']=function(_0x4c100b,_0x211e02,_0x3f5e0f){var _0xa8ad4c={};var _0x55013c={};var _0x5948d1;var _0x18bf23;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x4c100b[_0xebb1('0x46')]['id']}})['then'](handleEntityNotFound(_0x211e02,null))[_0xebb1('0x24')](function(_0x4d41f7){if(_0x4d41f7){_0x5948d1=_0x4d41f7;_0x55013c['model']=_[_0xebb1('0x32')](db[_0xebb1('0x4b')][_0xebb1('0x2d')]);_0x55013c[_0xebb1('0x33')]=_[_0xebb1('0x32')](_0x4c100b[_0xebb1('0x33')]);_0x55013c[_0xebb1('0x3c')]=_[_0xebb1('0x34')](_0x55013c['model'],_0x55013c[_0xebb1('0x33')]);_0xa8ad4c[_0xebb1('0x35')]=_[_0xebb1('0x34')](_0x55013c['model'],qs['fields'](_0x4c100b[_0xebb1('0x33')][_0xebb1('0x36')]));_0xa8ad4c[_0xebb1('0x35')]=_0xa8ad4c['attributes']['length']?_0xa8ad4c[_0xebb1('0x35')]:_0x55013c[_0xebb1('0x31')];_0xa8ad4c[_0xebb1('0x39')]=qs[_0xebb1('0x3a')](_0x4c100b['query'][_0xebb1('0x3a')]);_0xa8ad4c[_0xebb1('0x3b')]=qs['filters'](_[_0xebb1('0x4c')](_0x4c100b[_0xebb1('0x33')],_0x55013c[_0xebb1('0x3c')]));if(_0x4c100b['query']['filter']){_0xa8ad4c['where']=_[_0xebb1('0x3e')](_0xa8ad4c[_0xebb1('0x3b')],{'$or':_[_0xebb1('0x2b')](_0xa8ad4c[_0xebb1('0x35')],function(_0x5b5fad){var _0x46172e={};_0x46172e[_0x5b5fad]={'$like':'%'+_0x4c100b['query'][_0xebb1('0x3d')]+'%'};return _0x46172e;})});}_0xa8ad4c=_['merge']({},_0xa8ad4c,_0x4c100b[_0xebb1('0x40')]);return _0x5948d1[_0xebb1('0x4d')](_0xa8ad4c);}})['then'](function(_0x20eede){if(_0x20eede){_0x18bf23=_0x20eede[_0xebb1('0x37')];if(!_0x4c100b[_0xebb1('0x33')][_0xebb1('0x4e')](_0xebb1('0x38'))){_0xa8ad4c[_0xebb1('0x1c')]=qs['limit'](_0x4c100b[_0xebb1('0x33')][_0xebb1('0x1c')]);_0xa8ad4c[_0xebb1('0x1a')]=qs[_0xebb1('0x1a')](_0x4c100b['query']['offset']);}return _0x5948d1[_0xebb1('0x4d')](_0xa8ad4c);}})[_0xebb1('0x24')](function(_0x16daca){if(_0x16daca){return _0x16daca?{'count':_0x18bf23,'rows':_0x16daca}:null;}})['then'](respondWithResult(_0x211e02,null))[_0xebb1('0x44')](handleError(_0x211e02,null));};exports[_0xebb1('0x4f')]=function(_0x2eead3,_0x2b80c7,_0x528a95){var _0x2d4d78={};var _0x5aa061={};var _0xd7b399;var _0x4f9f6d;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x2eead3[_0xebb1('0x46')]['id']}})[_0xebb1('0x24')](handleEntityNotFound(_0x2b80c7,null))['then'](function(_0xdd89aa){if(_0xdd89aa){_0xd7b399=_0xdd89aa;_0x5aa061[_0xebb1('0x31')]=_[_0xebb1('0x32')](db['VtigerField'][_0xebb1('0x2d')]);_0x5aa061[_0xebb1('0x33')]=_[_0xebb1('0x32')](_0x2eead3[_0xebb1('0x33')]);_0x5aa061['filters']=_[_0xebb1('0x34')](_0x5aa061['model'],_0x5aa061[_0xebb1('0x33')]);_0x2d4d78[_0xebb1('0x35')]=_[_0xebb1('0x34')](_0x5aa061[_0xebb1('0x31')],qs[_0xebb1('0x36')](_0x2eead3[_0xebb1('0x33')][_0xebb1('0x36')]));_0x2d4d78[_0xebb1('0x35')]=_0x2d4d78[_0xebb1('0x35')][_0xebb1('0x37')]?_0x2d4d78['attributes']:_0x5aa061[_0xebb1('0x31')];_0x2d4d78['order']=qs[_0xebb1('0x3a')](_0x2eead3[_0xebb1('0x33')][_0xebb1('0x3a')]);_0x2d4d78[_0xebb1('0x3b')]=qs[_0xebb1('0x3c')](_[_0xebb1('0x4c')](_0x2eead3[_0xebb1('0x33')],_0x5aa061[_0xebb1('0x3c')]));if(_0x2eead3['query'][_0xebb1('0x3d')]){_0x2d4d78['where']=_[_0xebb1('0x3e')](_0x2d4d78['where'],{'$or':_[_0xebb1('0x2b')](_0x2d4d78['attributes'],function(_0xd937b5){var _0x52214b={};_0x52214b[_0xd937b5]={'$like':'%'+_0x2eead3['query']['filter']+'%'};return _0x52214b;})});}_0x2d4d78=_[_0xebb1('0x3e')]({},_0x2d4d78,_0x2eead3[_0xebb1('0x40')]);return _0xd7b399[_0xebb1('0x4f')](_0x2d4d78);}})[_0xebb1('0x24')](function(_0x1529ae){if(_0x1529ae){_0x4f9f6d=_0x1529ae['length'];if(!_0x2eead3[_0xebb1('0x33')][_0xebb1('0x4e')](_0xebb1('0x38'))){_0x2d4d78[_0xebb1('0x1c')]=qs[_0xebb1('0x1c')](_0x2eead3['query'][_0xebb1('0x1c')]);_0x2d4d78[_0xebb1('0x1a')]=qs[_0xebb1('0x1a')](_0x2eead3[_0xebb1('0x33')][_0xebb1('0x1a')]);}return _0xd7b399[_0xebb1('0x4f')](_0x2d4d78);}})['then'](function(_0x2f2f91){if(_0x2f2f91){return _0x2f2f91?{'count':_0x4f9f6d,'rows':_0x2f2f91}:null;}})[_0xebb1('0x24')](respondWithResult(_0x2b80c7,null))[_0xebb1('0x44')](handleError(_0x2b80c7,null));};exports[_0xebb1('0x50')]=function(_0x3226d2,_0x46b35d,_0x17334b){var _0x13be4f={};var _0x289e26={};var _0x2be1e6;var _0x224e19;return db[_0xebb1('0x2c')][_0xebb1('0x51')]({'where':{'id':_0x3226d2[_0xebb1('0x46')]['id']}})[_0xebb1('0x24')](handleEntityNotFound(_0x46b35d,null))[_0xebb1('0x24')](function(_0x54e004){if(_0x54e004){_0x2be1e6=_0x54e004;_0x289e26[_0xebb1('0x31')]=_[_0xebb1('0x32')](db[_0xebb1('0x4b')][_0xebb1('0x2d')]);_0x289e26['query']=_['keys'](_0x3226d2[_0xebb1('0x33')]);_0x289e26['filters']=_[_0xebb1('0x34')](_0x289e26['model'],_0x289e26[_0xebb1('0x33')]);_0x13be4f['attributes']=_[_0xebb1('0x34')](_0x289e26['model'],qs['fields'](_0x3226d2[_0xebb1('0x33')][_0xebb1('0x36')]));_0x13be4f[_0xebb1('0x35')]=_0x13be4f[_0xebb1('0x35')][_0xebb1('0x37')]?_0x13be4f[_0xebb1('0x35')]:_0x289e26['model'];_0x13be4f[_0xebb1('0x39')]=qs['sort'](_0x3226d2[_0xebb1('0x33')][_0xebb1('0x3a')]);_0x13be4f['where']=qs[_0xebb1('0x3c')](_['pick'](_0x3226d2[_0xebb1('0x33')],_0x289e26[_0xebb1('0x3c')]));if(_0x3226d2[_0xebb1('0x33')][_0xebb1('0x3d')]){_0x13be4f[_0xebb1('0x3b')]=_[_0xebb1('0x3e')](_0x13be4f[_0xebb1('0x3b')],{'$or':_[_0xebb1('0x2b')](_0x13be4f[_0xebb1('0x35')],function(_0x1b87d1){var _0x5ec8b7={};_0x5ec8b7[_0x1b87d1]={'$like':'%'+_0x3226d2[_0xebb1('0x33')][_0xebb1('0x3d')]+'%'};return _0x5ec8b7;})});}_0x13be4f=_[_0xebb1('0x3e')]({},_0x13be4f,_0x3226d2[_0xebb1('0x40')]);return _0x2be1e6[_0xebb1('0x50')](_0x13be4f);}})[_0xebb1('0x24')](function(_0x38e0b9){if(_0x38e0b9){_0x224e19=_0x38e0b9[_0xebb1('0x37')];if(!_0x3226d2[_0xebb1('0x33')]['hasOwnProperty']('nolimit')){_0x13be4f['limit']=qs[_0xebb1('0x1c')](_0x3226d2['query']['limit']);_0x13be4f[_0xebb1('0x1a')]=qs[_0xebb1('0x1a')](_0x3226d2[_0xebb1('0x33')]['offset']);}return _0x2be1e6[_0xebb1('0x50')](_0x13be4f);}})[_0xebb1('0x24')](function(_0xc2a24a){if(_0xc2a24a){return _0xc2a24a?{'count':_0x224e19,'rows':_0xc2a24a}:null;}})[_0xebb1('0x24')](respondWithResult(_0x46b35d,null))['catch'](handleError(_0x46b35d,null));}; \ No newline at end of file +var _0x88fa=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','VtigerField','getSubjects','findOne','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','apply','reject','save','then','sendStatus','name','send','map','VtigerConfiguration','rawAttributes','type','query','keys','filters','model'];(function(_0x492535,_0x46524a){var _0x256620=function(_0x3015f8){while(--_0x3015f8){_0x492535['push'](_0x492535['shift']());}};_0x256620(++_0x46524a);}(_0x88fa,0x1d3));var _0xa88f=function(_0x5e1854,_0x48fb60){_0x5e1854=_0x5e1854-0x0;var _0x50eaee=_0x88fa[_0x5e1854];return _0x50eaee;};'use strict';var emlformat=require(_0xa88f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa88f('0x1'));var jsonpatch=require(_0xa88f('0x2'));var rp=require(_0xa88f('0x3'));var moment=require(_0xa88f('0x4'));var BPromise=require(_0xa88f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa88f('0x6'));var sox=require(_0xa88f('0x7'));var csv=require(_0xa88f('0x8'));var ejs=require(_0xa88f('0x9'));var fs=require('fs');var fs_extra=require(_0xa88f('0xa'));var _=require('lodash');var squel=require(_0xa88f('0xb'));var crypto=require(_0xa88f('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa88f('0x8'));var querystring=require(_0xa88f('0xd'));var Papa=require(_0xa88f('0xe'));var Redis=require(_0xa88f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa88f('0x10'));var as=require(_0xa88f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa88f('0x12'))('api');var utils=require(_0xa88f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa88f('0x14'));var db=require(_0xa88f('0x15'))['db'];function respondWithStatusCode(_0xf27659,_0x25e7a7){_0x25e7a7=_0x25e7a7||0xcc;return function(_0x34d842){if(_0x34d842){return _0xf27659['sendStatus'](_0x25e7a7);}return _0xf27659[_0xa88f('0x16')](_0x25e7a7)[_0xa88f('0x17')]();};}function respondWithResult(_0x3b8d2c,_0x1ac913){_0x1ac913=_0x1ac913||0xc8;return function(_0x23bea){if(_0x23bea){return _0x3b8d2c[_0xa88f('0x16')](_0x1ac913)['json'](_0x23bea);}};}function respondWithFilteredResult(_0x16c656,_0x2e4b7f){return function(_0x3ffa25){if(_0x3ffa25){var _0x5dac52=typeof _0x2e4b7f[_0xa88f('0x18')]===_0xa88f('0x19')&&typeof _0x2e4b7f['limit']===_0xa88f('0x19');var _0x23f774=_0x3ffa25[_0xa88f('0x1a')];var _0x3ca1df=_0x5dac52?0x0:_0x2e4b7f[_0xa88f('0x18')];var _0x33a044=_0x5dac52?_0x3ffa25[_0xa88f('0x1a')]:_0x2e4b7f['offset']+_0x2e4b7f[_0xa88f('0x1b')];var _0x4bc4eb;if(_0x33a044>=_0x23f774){_0x33a044=_0x23f774;_0x4bc4eb=0xc8;}else{_0x4bc4eb=0xce;}_0x16c656[_0xa88f('0x16')](_0x4bc4eb);return _0x16c656[_0xa88f('0x1c')]('Content-Range',_0x3ca1df+'-'+_0x33a044+'/'+_0x23f774)['json'](_0x3ffa25);}return null;};}function patchUpdates(_0x1e8030){return function(_0x10b3e8){try{jsonpatch[_0xa88f('0x1d')](_0x10b3e8,_0x1e8030,!![]);}catch(_0x420055){return BPromise[_0xa88f('0x1e')](_0x420055);}return _0x10b3e8[_0xa88f('0x1f')]();};}function saveUpdates(_0x2b2278,_0x4f4b70){return function(_0x260083){if(_0x260083){return _0x260083['update'](_0x2b2278)['then'](function(_0x11b3c9){return _0x11b3c9;});}return null;};}function removeEntity(_0x4328a2,_0x1d6cf3){return function(_0x37cdf0){if(_0x37cdf0){return _0x37cdf0['destroy']()[_0xa88f('0x20')](function(){_0x4328a2[_0xa88f('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c9328,_0x460938){return function(_0xc09174){if(!_0xc09174){_0x3c9328[_0xa88f('0x21')](0x194);}return _0xc09174;};}function handleError(_0x1e02b9,_0x365596){_0x365596=_0x365596||0x1f4;return function(_0x207392){logger['error'](_0x207392['stack']);if(_0x207392[_0xa88f('0x22')]){delete _0x207392[_0xa88f('0x22')];}_0x1e02b9[_0xa88f('0x16')](_0x365596)[_0xa88f('0x23')](_0x207392);};}exports['index']=function(_0x1d87be,_0x50cae7){var _0x120e08={},_0x122e88={},_0x4c67dd={'count':0x0,'rows':[]};var _0x4ee8c3=_[_0xa88f('0x24')](db[_0xa88f('0x25')][_0xa88f('0x26')],function(_0x26655b){return{'name':_0x26655b['fieldName'],'type':_0x26655b[_0xa88f('0x27')]['key']};});_0x122e88['model']=_['map'](_0x4ee8c3,_0xa88f('0x22'));_0x122e88[_0xa88f('0x28')]=_[_0xa88f('0x29')](_0x1d87be[_0xa88f('0x28')]);_0x122e88[_0xa88f('0x2a')]=_['intersection'](_0x122e88[_0xa88f('0x2b')],_0x122e88[_0xa88f('0x28')]);_0x120e08['attributes']=_[_0xa88f('0x2c')](_0x122e88[_0xa88f('0x2b')],qs[_0xa88f('0x2d')](_0x1d87be['query'][_0xa88f('0x2d')]));_0x120e08[_0xa88f('0x2e')]=_0x120e08[_0xa88f('0x2e')][_0xa88f('0x2f')]?_0x120e08['attributes']:_0x122e88[_0xa88f('0x2b')];if(!_0x1d87be[_0xa88f('0x28')][_0xa88f('0x30')](_0xa88f('0x31'))){_0x120e08[_0xa88f('0x1b')]=qs[_0xa88f('0x1b')](_0x1d87be[_0xa88f('0x28')][_0xa88f('0x1b')]);_0x120e08['offset']=qs['offset'](_0x1d87be['query'][_0xa88f('0x18')]);}_0x120e08[_0xa88f('0x32')]=qs['sort'](_0x1d87be[_0xa88f('0x28')][_0xa88f('0x33')]);_0x120e08['where']=qs[_0xa88f('0x2a')](_[_0xa88f('0x34')](_0x1d87be[_0xa88f('0x28')],_0x122e88['filters']),_0x4ee8c3);if(_0x1d87be[_0xa88f('0x28')]['filter']){_0x120e08[_0xa88f('0x35')]=_[_0xa88f('0x36')](_0x120e08['where'],{'$or':_['map'](_0x4ee8c3,function(_0x37603c){if(_0x37603c['type']!==_0xa88f('0x37')){var _0x5af9ae={};_0x5af9ae[_0x37603c[_0xa88f('0x22')]]={'$like':'%'+_0x1d87be[_0xa88f('0x28')][_0xa88f('0x38')]+'%'};return _0x5af9ae;}})});}_0x120e08=_[_0xa88f('0x36')]({},_0x120e08,_0x1d87be[_0xa88f('0x39')]);var _0xe7aabb={'where':_0x120e08[_0xa88f('0x35')]};return db[_0xa88f('0x25')]['count'](_0xe7aabb)[_0xa88f('0x20')](function(_0xc67e2b){_0x4c67dd[_0xa88f('0x1a')]=_0xc67e2b;if(_0x1d87be[_0xa88f('0x28')][_0xa88f('0x3a')]){_0x120e08[_0xa88f('0x3b')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0xa88f('0x3c')](_0x120e08);})[_0xa88f('0x20')](function(_0x4813b4){_0x4c67dd[_0xa88f('0x3d')]=_0x4813b4;return _0x4c67dd;})[_0xa88f('0x20')](respondWithFilteredResult(_0x50cae7,_0x120e08))[_0xa88f('0x3e')](handleError(_0x50cae7,null));};exports[_0xa88f('0x3f')]=function(_0x142502,_0x3ea56a){var _0x425a87={'raw':![],'where':{'id':_0x142502[_0xa88f('0x40')]['id']}},_0x2b2d4d={};_0x2b2d4d['model']=_['keys'](db[_0xa88f('0x25')][_0xa88f('0x26')]);_0x2b2d4d[_0xa88f('0x28')]=_[_0xa88f('0x29')](_0x142502[_0xa88f('0x28')]);_0x2b2d4d[_0xa88f('0x2a')]=_[_0xa88f('0x2c')](_0x2b2d4d['model'],_0x2b2d4d[_0xa88f('0x28')]);_0x425a87[_0xa88f('0x2e')]=_['intersection'](_0x2b2d4d['model'],qs[_0xa88f('0x2d')](_0x142502[_0xa88f('0x28')][_0xa88f('0x2d')]));_0x425a87[_0xa88f('0x2e')]=_0x425a87[_0xa88f('0x2e')][_0xa88f('0x2f')]?_0x425a87[_0xa88f('0x2e')]:_0x2b2d4d[_0xa88f('0x2b')];if(_0x142502[_0xa88f('0x28')][_0xa88f('0x3a')]){_0x425a87[_0xa88f('0x3b')]=[{'all':!![]}];}_0x425a87=_[_0xa88f('0x36')]({},_0x425a87,_0x142502['options']);return db['VtigerConfiguration'][_0xa88f('0x41')](_0x425a87)[_0xa88f('0x20')](handleEntityNotFound(_0x3ea56a,null))[_0xa88f('0x20')](respondWithResult(_0x3ea56a,null))[_0xa88f('0x3e')](handleError(_0x3ea56a,null));};exports[_0xa88f('0x42')]=function(_0x3c557f,_0x423fb7){return db[_0xa88f('0x25')][_0xa88f('0x42')](_0x3c557f['body'],{})[_0xa88f('0x20')](respondWithResult(_0x423fb7,0xc9))['catch'](handleError(_0x423fb7,null));};exports['update']=function(_0x392b19,_0x3c662b){if(_0x392b19[_0xa88f('0x43')]['id']){delete _0x392b19[_0xa88f('0x43')]['id'];}return db[_0xa88f('0x25')]['find']({'where':{'id':_0x392b19[_0xa88f('0x40')]['id']}})['then'](handleEntityNotFound(_0x3c662b,null))[_0xa88f('0x20')](saveUpdates(_0x392b19[_0xa88f('0x43')],null))['then'](respondWithResult(_0x3c662b,null))['catch'](handleError(_0x3c662b,null));};exports['destroy']=function(_0x37f233,_0x50587b){return db[_0xa88f('0x25')]['find']({'where':{'id':_0x37f233[_0xa88f('0x40')]['id']}})['then'](handleEntityNotFound(_0x50587b,null))[_0xa88f('0x20')](removeEntity(_0x50587b,null))['catch'](handleError(_0x50587b,null));};exports[_0xa88f('0x44')]=function(_0x20d8f9,_0x2f21bb,_0xa92166){var _0x3ee616={};var _0x4a8cd4={};var _0x249ed9;var _0x429ee4;return db[_0xa88f('0x25')]['findOne']({'where':{'id':_0x20d8f9[_0xa88f('0x40')]['id']}})['then'](handleEntityNotFound(_0x2f21bb,null))['then'](function(_0x47c1e9){if(_0x47c1e9){_0x249ed9=_0x47c1e9;_0x4a8cd4[_0xa88f('0x2b')]=_[_0xa88f('0x29')](db[_0xa88f('0x45')][_0xa88f('0x26')]);_0x4a8cd4[_0xa88f('0x28')]=_[_0xa88f('0x29')](_0x20d8f9[_0xa88f('0x28')]);_0x4a8cd4[_0xa88f('0x2a')]=_[_0xa88f('0x2c')](_0x4a8cd4['model'],_0x4a8cd4[_0xa88f('0x28')]);_0x3ee616['attributes']=_[_0xa88f('0x2c')](_0x4a8cd4['model'],qs[_0xa88f('0x2d')](_0x20d8f9[_0xa88f('0x28')]['fields']));_0x3ee616[_0xa88f('0x2e')]=_0x3ee616[_0xa88f('0x2e')][_0xa88f('0x2f')]?_0x3ee616[_0xa88f('0x2e')]:_0x4a8cd4[_0xa88f('0x2b')];_0x3ee616[_0xa88f('0x32')]=qs[_0xa88f('0x33')](_0x20d8f9[_0xa88f('0x28')]['sort']);_0x3ee616['where']=qs['filters'](_[_0xa88f('0x34')](_0x20d8f9['query'],_0x4a8cd4[_0xa88f('0x2a')]));if(_0x20d8f9[_0xa88f('0x28')][_0xa88f('0x38')]){_0x3ee616[_0xa88f('0x35')]=_[_0xa88f('0x36')](_0x3ee616[_0xa88f('0x35')],{'$or':_[_0xa88f('0x24')](_0x3ee616['attributes'],function(_0x246d6e){var _0x4ab13d={};_0x4ab13d[_0x246d6e]={'$like':'%'+_0x20d8f9[_0xa88f('0x28')][_0xa88f('0x38')]+'%'};return _0x4ab13d;})});}_0x3ee616=_[_0xa88f('0x36')]({},_0x3ee616,_0x20d8f9[_0xa88f('0x39')]);return _0x249ed9[_0xa88f('0x44')](_0x3ee616);}})[_0xa88f('0x20')](function(_0x582e53){if(_0x582e53){_0x429ee4=_0x582e53[_0xa88f('0x2f')];if(!_0x20d8f9[_0xa88f('0x28')][_0xa88f('0x30')](_0xa88f('0x31'))){_0x3ee616['limit']=qs[_0xa88f('0x1b')](_0x20d8f9[_0xa88f('0x28')][_0xa88f('0x1b')]);_0x3ee616[_0xa88f('0x18')]=qs['offset'](_0x20d8f9[_0xa88f('0x28')][_0xa88f('0x18')]);}return _0x249ed9['getFields'](_0x3ee616);}})[_0xa88f('0x20')](function(_0x5a0c8c){if(_0x5a0c8c){return _0x5a0c8c?{'count':_0x429ee4,'rows':_0x5a0c8c}:null;}})[_0xa88f('0x20')](respondWithResult(_0x2f21bb,null))['catch'](handleError(_0x2f21bb,null));};exports[_0xa88f('0x46')]=function(_0x100429,_0x15ac59,_0x16293a){var _0x29a9a5={};var _0x4742a7={};var _0x4c6b79;var _0x515fff;return db[_0xa88f('0x25')][_0xa88f('0x47')]({'where':{'id':_0x100429[_0xa88f('0x40')]['id']}})[_0xa88f('0x20')](handleEntityNotFound(_0x15ac59,null))[_0xa88f('0x20')](function(_0x91d269){if(_0x91d269){_0x4c6b79=_0x91d269;_0x4742a7[_0xa88f('0x2b')]=_['keys'](db['VtigerField']['rawAttributes']);_0x4742a7['query']=_[_0xa88f('0x29')](_0x100429[_0xa88f('0x28')]);_0x4742a7[_0xa88f('0x2a')]=_[_0xa88f('0x2c')](_0x4742a7[_0xa88f('0x2b')],_0x4742a7[_0xa88f('0x28')]);_0x29a9a5[_0xa88f('0x2e')]=_[_0xa88f('0x2c')](_0x4742a7[_0xa88f('0x2b')],qs['fields'](_0x100429[_0xa88f('0x28')][_0xa88f('0x2d')]));_0x29a9a5[_0xa88f('0x2e')]=_0x29a9a5[_0xa88f('0x2e')][_0xa88f('0x2f')]?_0x29a9a5[_0xa88f('0x2e')]:_0x4742a7['model'];_0x29a9a5['order']=qs[_0xa88f('0x33')](_0x100429[_0xa88f('0x28')]['sort']);_0x29a9a5[_0xa88f('0x35')]=qs[_0xa88f('0x2a')](_[_0xa88f('0x34')](_0x100429[_0xa88f('0x28')],_0x4742a7[_0xa88f('0x2a')]));if(_0x100429[_0xa88f('0x28')][_0xa88f('0x38')]){_0x29a9a5['where']=_[_0xa88f('0x36')](_0x29a9a5[_0xa88f('0x35')],{'$or':_[_0xa88f('0x24')](_0x29a9a5[_0xa88f('0x2e')],function(_0xb55e5c){var _0x2eaf08={};_0x2eaf08[_0xb55e5c]={'$like':'%'+_0x100429['query'][_0xa88f('0x38')]+'%'};return _0x2eaf08;})});}_0x29a9a5=_['merge']({},_0x29a9a5,_0x100429[_0xa88f('0x39')]);return _0x4c6b79[_0xa88f('0x46')](_0x29a9a5);}})['then'](function(_0x4814c8){if(_0x4814c8){_0x515fff=_0x4814c8['length'];if(!_0x100429[_0xa88f('0x28')][_0xa88f('0x30')]('nolimit')){_0x29a9a5['limit']=qs[_0xa88f('0x1b')](_0x100429[_0xa88f('0x28')][_0xa88f('0x1b')]);_0x29a9a5[_0xa88f('0x18')]=qs[_0xa88f('0x18')](_0x100429[_0xa88f('0x28')][_0xa88f('0x18')]);}return _0x4c6b79['getSubjects'](_0x29a9a5);}})['then'](function(_0xf49ee8){if(_0xf49ee8){return _0xf49ee8?{'count':_0x515fff,'rows':_0xf49ee8}:null;}})[_0xa88f('0x20')](respondWithResult(_0x15ac59,null))['catch'](handleError(_0x15ac59,null));};exports[_0xa88f('0x48')]=function(_0x2b2663,_0x1b3399,_0x333b06){var _0x44c872={};var _0x4bbcb5={};var _0x32ed1d;var _0x1e5af5;return db[_0xa88f('0x25')]['findOne']({'where':{'id':_0x2b2663[_0xa88f('0x40')]['id']}})[_0xa88f('0x20')](handleEntityNotFound(_0x1b3399,null))[_0xa88f('0x20')](function(_0x465f15){if(_0x465f15){_0x32ed1d=_0x465f15;_0x4bbcb5[_0xa88f('0x2b')]=_[_0xa88f('0x29')](db['VtigerField'][_0xa88f('0x26')]);_0x4bbcb5['query']=_['keys'](_0x2b2663['query']);_0x4bbcb5['filters']=_[_0xa88f('0x2c')](_0x4bbcb5[_0xa88f('0x2b')],_0x4bbcb5[_0xa88f('0x28')]);_0x44c872['attributes']=_[_0xa88f('0x2c')](_0x4bbcb5[_0xa88f('0x2b')],qs['fields'](_0x2b2663[_0xa88f('0x28')][_0xa88f('0x2d')]));_0x44c872['attributes']=_0x44c872[_0xa88f('0x2e')][_0xa88f('0x2f')]?_0x44c872[_0xa88f('0x2e')]:_0x4bbcb5[_0xa88f('0x2b')];_0x44c872[_0xa88f('0x32')]=qs[_0xa88f('0x33')](_0x2b2663['query']['sort']);_0x44c872[_0xa88f('0x35')]=qs[_0xa88f('0x2a')](_[_0xa88f('0x34')](_0x2b2663[_0xa88f('0x28')],_0x4bbcb5['filters']));if(_0x2b2663[_0xa88f('0x28')][_0xa88f('0x38')]){_0x44c872[_0xa88f('0x35')]=_['merge'](_0x44c872['where'],{'$or':_[_0xa88f('0x24')](_0x44c872[_0xa88f('0x2e')],function(_0x644860){var _0x479cdf={};_0x479cdf[_0x644860]={'$like':'%'+_0x2b2663['query'][_0xa88f('0x38')]+'%'};return _0x479cdf;})});}_0x44c872=_[_0xa88f('0x36')]({},_0x44c872,_0x2b2663[_0xa88f('0x39')]);return _0x32ed1d[_0xa88f('0x48')](_0x44c872);}})['then'](function(_0x4c5837){if(_0x4c5837){_0x1e5af5=_0x4c5837[_0xa88f('0x2f')];if(!_0x2b2663[_0xa88f('0x28')]['hasOwnProperty']('nolimit')){_0x44c872['limit']=qs['limit'](_0x2b2663[_0xa88f('0x28')]['limit']);_0x44c872[_0xa88f('0x18')]=qs[_0xa88f('0x18')](_0x2b2663[_0xa88f('0x28')][_0xa88f('0x18')]);}return _0x32ed1d['getDescriptions'](_0x44c872);}})[_0xa88f('0x20')](function(_0x4e524b){if(_0x4e524b){return _0x4e524b?{'count':_0x1e5af5,'rows':_0x4e524b}:null;}})[_0xa88f('0x20')](respondWithResult(_0x1b3399,null))[_0xa88f('0x3e')](handleError(_0x1b3399,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 5fbd77c..faee856 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 _0x7a03=['request-promise','path','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger','api','bluebird'];(function(_0xf34895,_0x21fb70){var _0x143f44=function(_0x2e7730){while(--_0x2e7730){_0xf34895['push'](_0xf34895['shift']());}};_0x143f44(++_0x21fb70);}(_0x7a03,0x164));var _0x37a0=function(_0x21f73d,_0x363409){_0x21f73d=_0x21f73d-0x0;var _0x124782=_0x7a03[_0x21f73d];return _0x124782;};'use strict';var _=require('lodash');var util=require(_0x37a0('0x0'));var logger=require(_0x37a0('0x1'))(_0x37a0('0x2'));var moment=require('moment');var BPromise=require(_0x37a0('0x3'));var rp=require(_0x37a0('0x4'));var fs=require('fs');var path=require(_0x37a0('0x5'));var rimraf=require('rimraf');var config=require(_0x37a0('0x6'));var attributes=require(_0x37a0('0x7'));module[_0x37a0('0x8')]=function(_0x199c1e,_0x5b59e7){return _0x199c1e[_0x37a0('0x9')](_0x37a0('0xa'),attributes,{'tableName':_0x37a0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e02=['rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5dff79,_0x203a31){var _0x23e687=function(_0x53e811){while(--_0x53e811){_0x5dff79['push'](_0x5dff79['shift']());}};_0x23e687(++_0x203a31);}(_0x4e02,0xb0));var _0x24e0=function(_0x57d370,_0x3ed0f6){_0x57d370=_0x57d370-0x0;var _0x550fd2=_0x4e02[_0x57d370];return _0x550fd2;};'use strict';var _=require(_0x24e0('0x0'));var util=require('util');var logger=require(_0x24e0('0x1'))('api');var moment=require(_0x24e0('0x2'));var BPromise=require(_0x24e0('0x3'));var rp=require(_0x24e0('0x4'));var fs=require('fs');var path=require(_0x24e0('0x5'));var rimraf=require(_0x24e0('0x6'));var config=require(_0x24e0('0x7'));var attributes=require(_0x24e0('0x8'));module[_0x24e0('0x9')]=function(_0x16dd05,_0x533246){return _0x16dd05[_0x24e0('0xa')](_0x24e0('0xb'),attributes,{'tableName':_0x24e0('0xc'),'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 f3e25f8..c438ea0 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 _0xdd57=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x4dcfe9,_0x4ab78f){var _0x36ea38=function(_0x7d8610){while(--_0x7d8610){_0x4dcfe9['push'](_0x4dcfe9['shift']());}};_0x36ea38(++_0x4ab78f);}(_0xdd57,0x1a2));var _0x7dd5=function(_0x2a0183,_0x3fc93c){_0x2a0183=_0x2a0183-0x0;var _0x158c3a=_0xdd57[_0x2a0183];return _0x158c3a;};'use strict';var _=require('lodash');var util=require(_0x7dd5('0x0'));var moment=require(_0x7dd5('0x1'));var BPromise=require(_0x7dd5('0x2'));var rs=require(_0x7dd5('0x3'));var fs=require('fs');var Redis=require(_0x7dd5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7dd5('0x5'));var logger=require(_0x7dd5('0x6'))('rpc');var config=require(_0x7dd5('0x7'));var jayson=require(_0x7dd5('0x8'));var client=jayson[_0x7dd5('0x9')][_0x7dd5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b846f,_0x3db95a,_0x45c262){return new BPromise(function(_0x190419,_0x15c93f){return client['request'](_0x4b846f,_0x45c262)[_0x7dd5('0xb')](function(_0x1b6ee2){logger[_0x7dd5('0xc')](_0x7dd5('0xd'),_0x3db95a,_0x7dd5('0xe'));logger[_0x7dd5('0xf')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x3db95a,'request\x20sent',JSON['stringify'](_0x1b6ee2));if(_0x1b6ee2[_0x7dd5('0x10')]){if(_0x1b6ee2['error'][_0x7dd5('0x11')]===0x1f4){logger[_0x7dd5('0x10')](_0x7dd5('0xd'),_0x3db95a,_0x1b6ee2['error'][_0x7dd5('0x12')]);return _0x15c93f(_0x1b6ee2[_0x7dd5('0x10')]['message']);}logger[_0x7dd5('0x10')](_0x7dd5('0xd'),_0x3db95a,_0x1b6ee2['error'][_0x7dd5('0x12')]);return _0x190419(_0x1b6ee2[_0x7dd5('0x10')][_0x7dd5('0x12')]);}else{logger['info'](_0x7dd5('0xd'),_0x3db95a,_0x7dd5('0xe'));_0x190419(_0x1b6ee2['result']['message']);}})['catch'](function(_0x4f0db1){logger[_0x7dd5('0x10')](_0x7dd5('0xd'),_0x3db95a,_0x4f0db1);_0x15c93f(_0x4f0db1);});});} \ No newline at end of file +var _0x7e5f=['code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x104e21,_0x2ea86f){var _0x605b37=function(_0x580fce){while(--_0x580fce){_0x104e21['push'](_0x104e21['shift']());}};_0x605b37(++_0x2ea86f);}(_0x7e5f,0x1bc));var _0xf7e5=function(_0x1c0f41,_0x26d95d){_0x1c0f41=_0x1c0f41-0x0;var _0x369a9f=_0x7e5f[_0x1c0f41];return _0x369a9f;};'use strict';var _=require(_0xf7e5('0x0'));var util=require(_0xf7e5('0x1'));var moment=require(_0xf7e5('0x2'));var BPromise=require('bluebird');var rs=require(_0xf7e5('0x3'));var fs=require('fs');var Redis=require(_0xf7e5('0x4'));var db=require(_0xf7e5('0x5'))['db'];var utils=require(_0xf7e5('0x6'));var logger=require(_0xf7e5('0x7'))(_0xf7e5('0x8'));var config=require(_0xf7e5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf7e5('0xa')][_0xf7e5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bc951,_0x3a166e,_0x1d402e){return new BPromise(function(_0x501f23,_0x4c785a){return client[_0xf7e5('0xc')](_0x3bc951,_0x1d402e)['then'](function(_0x3aad9c){logger[_0xf7e5('0xd')](_0xf7e5('0xe'),_0x3a166e,_0xf7e5('0xf'));logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x3a166e,_0xf7e5('0xf'),JSON[_0xf7e5('0x10')](_0x3aad9c));if(_0x3aad9c[_0xf7e5('0x11')]){if(_0x3aad9c[_0xf7e5('0x11')][_0xf7e5('0x12')]===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x3a166e,_0x3aad9c[_0xf7e5('0x11')]['message']);return _0x4c785a(_0x3aad9c['error']['message']);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x3a166e,_0x3aad9c['error'][_0xf7e5('0x13')]);return _0x501f23(_0x3aad9c[_0xf7e5('0x11')]['message']);}else{logger[_0xf7e5('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0x3a166e,_0xf7e5('0xf'));_0x501f23(_0x3aad9c['result']['message']);}})[_0xf7e5('0x14')](function(_0x1c19c6){logger[_0xf7e5('0x11')](_0xf7e5('0xe'),_0x3a166e,_0x1c19c6);_0x4c785a(_0x1c19c6);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 981ec8e..08fb5b7 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 _0x3603=['./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment'];(function(_0x39d7ca,_0x4b30cc){var _0xf38800=function(_0x2879c1){while(--_0x2879c1){_0x39d7ca['push'](_0x39d7ca['shift']());}};_0xf38800(++_0x4b30cc);}(_0x3603,0x12a));var _0x3360=function(_0x48c10a,_0x1ecf7e){_0x48c10a=_0x48c10a-0x0;var _0xe9d84b=_0x3603[_0x48c10a];return _0xe9d84b;};'use strict';var multer=require('multer');var util=require(_0x3360('0x0'));var path=require(_0x3360('0x1'));var timeout=require(_0x3360('0x2'));var express=require(_0x3360('0x3'));var router=express[_0x3360('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3360('0x5'));var controller=require(_0x3360('0x6'));router[_0x3360('0x7')]('/',auth[_0x3360('0x8')](),controller[_0x3360('0x9')]);router[_0x3360('0x7')](_0x3360('0xa'),auth[_0x3360('0x8')](),controller[_0x3360('0xb')]);router[_0x3360('0xc')]('/',auth[_0x3360('0x8')](),controller[_0x3360('0xd')]);router[_0x3360('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x3360('0xf')]);router[_0x3360('0x10')]('/:id',auth[_0x3360('0x8')](),controller[_0x3360('0x11')]);module[_0x3360('0x12')]=router; \ No newline at end of file +var _0x3508=['get','/:id','post','isAuthenticated','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xb579f7,_0xdcfbee){var _0x2f552b=function(_0xf190b7){while(--_0xf190b7){_0xb579f7['push'](_0xb579f7['shift']());}};_0x2f552b(++_0xdcfbee);}(_0x3508,0x105));var _0x8350=function(_0x10e30a,_0x5481f0){_0x10e30a=_0x10e30a-0x0;var _0x3bc997=_0x3508[_0x10e30a];return _0x3bc997;};'use strict';var multer=require(_0x8350('0x0'));var util=require(_0x8350('0x1'));var path=require(_0x8350('0x2'));var timeout=require(_0x8350('0x3'));var express=require(_0x8350('0x4'));var router=express[_0x8350('0x5')]();var fs_extra=require(_0x8350('0x6'));var auth=require(_0x8350('0x7'));var interaction=require(_0x8350('0x8'));var config=require('../../config/environment');var controller=require('./intVtigerField.controller');router[_0x8350('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8350('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x8350('0xb')]('/',auth[_0x8350('0xc')](),controller[_0x8350('0xd')]);router[_0x8350('0xe')](_0x8350('0xa'),auth['isAuthenticated'](),controller[_0x8350('0xf')]);router[_0x8350('0x10')](_0x8350('0xa'),auth[_0x8350('0xc')](),controller[_0x8350('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 065d7a8..c361562 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 _0xa883=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports'];(function(_0x51e2a3,_0x14a30e){var _0xc5ff3e=function(_0x49ce7e){while(--_0x49ce7e){_0x51e2a3['push'](_0x51e2a3['shift']());}};_0xc5ff3e(++_0x14a30e);}(_0xa883,0x139));var _0x3a88=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa883[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3a88('0x0'));module[_0x3a88('0x1')]={'type':{'type':Sequelize[_0x3a88('0x2')](_0x3a88('0x3'),_0x3a88('0x4'),_0x3a88('0x5'),_0x3a88('0x6'),_0x3a88('0x7')),'defaultValue':_0x3a88('0x3')},'content':{'type':Sequelize[_0x3a88('0x8')]},'key':{'type':Sequelize[_0x3a88('0x8')]},'keyType':{'type':Sequelize[_0x3a88('0x2')](_0x3a88('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x3a88('0x8')]},'idField':{'type':Sequelize[_0x3a88('0x8')]},'nameField':{'type':Sequelize[_0x3a88('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3a88('0x8')]}}; \ No newline at end of file +var _0xcd3d=['STRING','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x2589b5,_0x5c46ee){var _0x288b61=function(_0x4714b4){while(--_0x4714b4){_0x2589b5['push'](_0x2589b5['shift']());}};_0x288b61(++_0x5c46ee);}(_0xcd3d,0xf4));var _0xdcd3=function(_0x3130fb,_0x43c819){_0x3130fb=_0x3130fb-0x0;var _0x4b2c7f=_0xcd3d[_0x3130fb];return _0x4b2c7f;};'use strict';var Sequelize=require(_0xdcd3('0x0'));module[_0xdcd3('0x1')]={'type':{'type':Sequelize[_0xdcd3('0x2')](_0xdcd3('0x3'),_0xdcd3('0x4'),_0xdcd3('0x5'),_0xdcd3('0x6'),_0xdcd3('0x7')),'defaultValue':_0xdcd3('0x3')},'content':{'type':Sequelize[_0xdcd3('0x8')]},'key':{'type':Sequelize[_0xdcd3('0x8')]},'keyType':{'type':Sequelize['ENUM']('string',_0xdcd3('0x4'),_0xdcd3('0x5'))},'keyContent':{'type':Sequelize[_0xdcd3('0x8')]},'idField':{'type':Sequelize[_0xdcd3('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 78fe01a..db9bb0f 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 _0xc759=['filters','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','catch','show','params','keys','create','body','destroy','find','zip-dir','fast-json-patch','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','error','stack','name','send','VtigerField','rawAttributes','fieldName','type','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0xc52820,_0x1767a7){var _0x20a922=function(_0x1715b5){while(--_0x1715b5){_0xc52820['push'](_0xc52820['shift']());}};_0x20a922(++_0x1767a7);}(_0xc759,0x125));var _0x9c75=function(_0x4c7a97,_0x592e3a){_0x4c7a97=_0x4c7a97-0x0;var _0x3ea667=_0xc759[_0x4c7a97];return _0x3ea667;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9c75('0x0'));var jsonpatch=require(_0x9c75('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9c75('0x2'));var Mustache=require('mustache');var util=require(_0x9c75('0x3'));var path=require('path');var sox=require(_0x9c75('0x4'));var csv=require(_0x9c75('0x5'));var ejs=require(_0x9c75('0x6'));var fs=require('fs');var fs_extra=require(_0x9c75('0x7'));var _=require(_0x9c75('0x8'));var squel=require('squel');var crypto=require(_0x9c75('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9c75('0x5'));var querystring=require(_0x9c75('0xa'));var Papa=require('papaparse');var Redis=require(_0x9c75('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x9c75('0xc'));var as=require(_0x9c75('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9c75('0xe'))(_0x9c75('0xf'));var utils=require(_0x9c75('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x9c75('0x11'));var db=require(_0x9c75('0x12'))['db'];function respondWithStatusCode(_0x202ebd,_0x7f970a){_0x7f970a=_0x7f970a||0xcc;return function(_0x1cb76a){if(_0x1cb76a){return _0x202ebd[_0x9c75('0x13')](_0x7f970a);}return _0x202ebd[_0x9c75('0x14')](_0x7f970a)[_0x9c75('0x15')]();};}function respondWithResult(_0x3f5f46,_0x44aab4){_0x44aab4=_0x44aab4||0xc8;return function(_0x4271ef){if(_0x4271ef){return _0x3f5f46['status'](_0x44aab4)[_0x9c75('0x16')](_0x4271ef);}};}function respondWithFilteredResult(_0x427cda,_0x2fd2e0){return function(_0x236742){if(_0x236742){var _0x371fda=typeof _0x2fd2e0[_0x9c75('0x17')]==='undefined'&&typeof _0x2fd2e0[_0x9c75('0x18')]===_0x9c75('0x19');var _0x2451e3=_0x236742[_0x9c75('0x1a')];var _0x3470f3=_0x371fda?0x0:_0x2fd2e0[_0x9c75('0x17')];var _0x4727c5=_0x371fda?_0x236742['count']:_0x2fd2e0[_0x9c75('0x17')]+_0x2fd2e0[_0x9c75('0x18')];var _0x21c485;if(_0x4727c5>=_0x2451e3){_0x4727c5=_0x2451e3;_0x21c485=0xc8;}else{_0x21c485=0xce;}_0x427cda[_0x9c75('0x14')](_0x21c485);return _0x427cda[_0x9c75('0x1b')](_0x9c75('0x1c'),_0x3470f3+'-'+_0x4727c5+'/'+_0x2451e3)[_0x9c75('0x16')](_0x236742);}return null;};}function patchUpdates(_0x216a8b){return function(_0x1ad978){try{jsonpatch[_0x9c75('0x1d')](_0x1ad978,_0x216a8b,!![]);}catch(_0x348b94){return BPromise['reject'](_0x348b94);}return _0x1ad978[_0x9c75('0x1e')]();};}function saveUpdates(_0x3b5096,_0x1dec9f){return function(_0x2dae65){if(_0x2dae65){return _0x2dae65[_0x9c75('0x1f')](_0x3b5096)[_0x9c75('0x20')](function(_0x683f2){return _0x683f2;});}return null;};}function removeEntity(_0x59e39e,_0x2f49d0){return function(_0x5e4f62){if(_0x5e4f62){return _0x5e4f62['destroy']()[_0x9c75('0x20')](function(){_0x59e39e[_0x9c75('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f5dca,_0x50b009){return function(_0x529091){if(!_0x529091){_0x4f5dca[_0x9c75('0x13')](0x194);}return _0x529091;};}function handleError(_0x1a3c17,_0x4daec8){_0x4daec8=_0x4daec8||0x1f4;return function(_0x473d72){logger[_0x9c75('0x21')](_0x473d72[_0x9c75('0x22')]);if(_0x473d72[_0x9c75('0x23')]){delete _0x473d72['name'];}_0x1a3c17['status'](_0x4daec8)[_0x9c75('0x24')](_0x473d72);};}exports['index']=function(_0x8282f6,_0x7a0c8b){var _0x4f7b55={},_0x17e599={},_0x329e2d={'count':0x0,'rows':[]};var _0x45d2bc=_['map'](db[_0x9c75('0x25')][_0x9c75('0x26')],function(_0x5a9878){return{'name':_0x5a9878[_0x9c75('0x27')],'type':_0x5a9878[_0x9c75('0x28')]['key']};});_0x17e599['model']=_['map'](_0x45d2bc,_0x9c75('0x23'));_0x17e599['query']=_['keys'](_0x8282f6[_0x9c75('0x29')]);_0x17e599['filters']=_[_0x9c75('0x2a')](_0x17e599[_0x9c75('0x2b')],_0x17e599['query']);_0x4f7b55[_0x9c75('0x2c')]=_['intersection'](_0x17e599[_0x9c75('0x2b')],qs[_0x9c75('0x2d')](_0x8282f6[_0x9c75('0x29')]['fields']));_0x4f7b55[_0x9c75('0x2c')]=_0x4f7b55[_0x9c75('0x2c')][_0x9c75('0x2e')]?_0x4f7b55[_0x9c75('0x2c')]:_0x17e599[_0x9c75('0x2b')];if(!_0x8282f6[_0x9c75('0x29')][_0x9c75('0x2f')](_0x9c75('0x30'))){_0x4f7b55[_0x9c75('0x18')]=qs[_0x9c75('0x18')](_0x8282f6[_0x9c75('0x29')][_0x9c75('0x18')]);_0x4f7b55['offset']=qs['offset'](_0x8282f6[_0x9c75('0x29')][_0x9c75('0x17')]);}_0x4f7b55[_0x9c75('0x31')]=qs[_0x9c75('0x32')](_0x8282f6[_0x9c75('0x29')]['sort']);_0x4f7b55[_0x9c75('0x33')]=qs[_0x9c75('0x34')](_[_0x9c75('0x35')](_0x8282f6[_0x9c75('0x29')],_0x17e599['filters']),_0x45d2bc);if(_0x8282f6['query'][_0x9c75('0x36')]){_0x4f7b55['where']=_[_0x9c75('0x37')](_0x4f7b55['where'],{'$or':_[_0x9c75('0x38')](_0x45d2bc,function(_0x54b3be){if(_0x54b3be[_0x9c75('0x28')]!==_0x9c75('0x39')){var _0x76fe49={};_0x76fe49[_0x54b3be[_0x9c75('0x23')]]={'$like':'%'+_0x8282f6['query'][_0x9c75('0x36')]+'%'};return _0x76fe49;}})});}_0x4f7b55=_[_0x9c75('0x37')]({},_0x4f7b55,_0x8282f6[_0x9c75('0x3a')]);var _0x537134={'where':_0x4f7b55[_0x9c75('0x33')]};return db[_0x9c75('0x25')][_0x9c75('0x1a')](_0x537134)[_0x9c75('0x20')](function(_0x53ee80){_0x329e2d[_0x9c75('0x1a')]=_0x53ee80;if(_0x8282f6['query'][_0x9c75('0x3b')]){_0x4f7b55['include']=[{'all':!![]}];}return db[_0x9c75('0x25')][_0x9c75('0x3c')](_0x4f7b55);})[_0x9c75('0x20')](function(_0x23f2cb){_0x329e2d['rows']=_0x23f2cb;return _0x329e2d;})[_0x9c75('0x20')](respondWithFilteredResult(_0x7a0c8b,_0x4f7b55))[_0x9c75('0x3d')](handleError(_0x7a0c8b,null));};exports[_0x9c75('0x3e')]=function(_0x541245,_0x569e30){var _0x39d993={'raw':!![],'where':{'id':_0x541245[_0x9c75('0x3f')]['id']}},_0x29d616={};_0x29d616['model']=_[_0x9c75('0x40')](db['VtigerField']['rawAttributes']);_0x29d616[_0x9c75('0x29')]=_[_0x9c75('0x40')](_0x541245[_0x9c75('0x29')]);_0x29d616[_0x9c75('0x34')]=_[_0x9c75('0x2a')](_0x29d616[_0x9c75('0x2b')],_0x29d616[_0x9c75('0x29')]);_0x39d993['attributes']=_[_0x9c75('0x2a')](_0x29d616[_0x9c75('0x2b')],qs[_0x9c75('0x2d')](_0x541245[_0x9c75('0x29')][_0x9c75('0x2d')]));_0x39d993[_0x9c75('0x2c')]=_0x39d993[_0x9c75('0x2c')]['length']?_0x39d993[_0x9c75('0x2c')]:_0x29d616['model'];if(_0x541245['query'][_0x9c75('0x3b')]){_0x39d993['include']=[{'all':!![]}];}_0x39d993=_['merge']({},_0x39d993,_0x541245[_0x9c75('0x3a')]);return db[_0x9c75('0x25')]['find'](_0x39d993)[_0x9c75('0x20')](handleEntityNotFound(_0x569e30,null))[_0x9c75('0x20')](respondWithResult(_0x569e30,null))[_0x9c75('0x3d')](handleError(_0x569e30,null));};exports[_0x9c75('0x41')]=function(_0x99dd2e,_0x40a293){return db['VtigerField'][_0x9c75('0x41')](_0x99dd2e[_0x9c75('0x42')],{})[_0x9c75('0x20')](respondWithResult(_0x40a293,0xc9))[_0x9c75('0x3d')](handleError(_0x40a293,null));};exports[_0x9c75('0x1f')]=function(_0xef628e,_0x519a27){if(_0xef628e['body']['id']){delete _0xef628e[_0x9c75('0x42')]['id'];}return db[_0x9c75('0x25')]['find']({'where':{'id':_0xef628e[_0x9c75('0x3f')]['id']}})[_0x9c75('0x20')](handleEntityNotFound(_0x519a27,null))[_0x9c75('0x20')](saveUpdates(_0xef628e['body'],null))[_0x9c75('0x20')](respondWithResult(_0x519a27,null))[_0x9c75('0x3d')](handleError(_0x519a27,null));};exports[_0x9c75('0x43')]=function(_0x27a301,_0x2cf097){return db['VtigerField'][_0x9c75('0x44')]({'where':{'id':_0x27a301['params']['id']}})[_0x9c75('0x20')](handleEntityNotFound(_0x2cf097,null))[_0x9c75('0x20')](removeEntity(_0x2cf097,null))[_0x9c75('0x3d')](handleError(_0x2cf097,null));}; \ No newline at end of file +var _0x0c5c=['order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','VtigerField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit'];(function(_0x3fbb4d,_0x34ea9b){var _0x70c3f8=function(_0x1bfe54){while(--_0x1bfe54){_0x3fbb4d['push'](_0x3fbb4d['shift']());}};_0x70c3f8(++_0x34ea9b);}(_0x0c5c,0x13d));var _0xc0c5=function(_0x1546f0,_0x1d2b57){_0x1546f0=_0x1546f0-0x0;var _0x1c2887=_0x0c5c[_0x1546f0];return _0x1c2887;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc0c5('0x0'));var zipdir=require(_0xc0c5('0x1'));var jsonpatch=require(_0xc0c5('0x2'));var rp=require('request-promise');var moment=require(_0xc0c5('0x3'));var BPromise=require(_0xc0c5('0x4'));var Mustache=require(_0xc0c5('0x5'));var util=require(_0xc0c5('0x6'));var path=require(_0xc0c5('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc0c5('0x8'));var fs=require('fs');var fs_extra=require(_0xc0c5('0x9'));var _=require(_0xc0c5('0xa'));var squel=require(_0xc0c5('0xb'));var crypto=require(_0xc0c5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc0c5('0xd'));var toCsv=require(_0xc0c5('0xe'));var querystring=require(_0xc0c5('0xf'));var Papa=require(_0xc0c5('0x10'));var Redis=require(_0xc0c5('0x11'));var authService=require(_0xc0c5('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc0c5('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xc0c5('0x14'));var config=require(_0xc0c5('0x15'));var licenseUtil=require(_0xc0c5('0x16'));var db=require(_0xc0c5('0x17'))['db'];function respondWithStatusCode(_0x76f164,_0x4d409f){_0x4d409f=_0x4d409f||0xcc;return function(_0x4127ff){if(_0x4127ff){return _0x76f164['sendStatus'](_0x4d409f);}return _0x76f164[_0xc0c5('0x18')](_0x4d409f)[_0xc0c5('0x19')]();};}function respondWithResult(_0x2a021e,_0xc3f36b){_0xc3f36b=_0xc3f36b||0xc8;return function(_0x3b34ba){if(_0x3b34ba){return _0x2a021e[_0xc0c5('0x18')](_0xc3f36b)[_0xc0c5('0x1a')](_0x3b34ba);}};}function respondWithFilteredResult(_0x190414,_0x53b9a3){return function(_0x1f7f11){if(_0x1f7f11){var _0x23f8f5=typeof _0x53b9a3[_0xc0c5('0x1b')]===_0xc0c5('0x1c')&&typeof _0x53b9a3[_0xc0c5('0x1d')]===_0xc0c5('0x1c');var _0x3dc11e=_0x1f7f11[_0xc0c5('0x1e')];var _0x395062=_0x23f8f5?0x0:_0x53b9a3['offset'];var _0xc2df78=_0x23f8f5?_0x1f7f11[_0xc0c5('0x1e')]:_0x53b9a3[_0xc0c5('0x1b')]+_0x53b9a3[_0xc0c5('0x1d')];var _0xa24b6d;if(_0xc2df78>=_0x3dc11e){_0xc2df78=_0x3dc11e;_0xa24b6d=0xc8;}else{_0xa24b6d=0xce;}_0x190414[_0xc0c5('0x18')](_0xa24b6d);return _0x190414[_0xc0c5('0x1f')]('Content-Range',_0x395062+'-'+_0xc2df78+'/'+_0x3dc11e)['json'](_0x1f7f11);}return null;};}function patchUpdates(_0x3571dd){return function(_0xf79cda){try{jsonpatch[_0xc0c5('0x20')](_0xf79cda,_0x3571dd,!![]);}catch(_0x1627c5){return BPromise[_0xc0c5('0x21')](_0x1627c5);}return _0xf79cda[_0xc0c5('0x22')]();};}function saveUpdates(_0x1d9790,_0x31daf8){return function(_0x3c806b){if(_0x3c806b){return _0x3c806b[_0xc0c5('0x23')](_0x1d9790)[_0xc0c5('0x24')](function(_0x29ff29){return _0x29ff29;});}return null;};}function removeEntity(_0x113bb3,_0x1484f7){return function(_0x441ac6){if(_0x441ac6){return _0x441ac6[_0xc0c5('0x25')]()['then'](function(){_0x113bb3[_0xc0c5('0x18')](0xcc)[_0xc0c5('0x19')]();});}};}function handleEntityNotFound(_0xac747b,_0x5826ad){return function(_0x252acf){if(!_0x252acf){_0xac747b[_0xc0c5('0x26')](0x194);}return _0x252acf;};}function handleError(_0x16bcb0,_0x520308){_0x520308=_0x520308||0x1f4;return function(_0x28e7eb){logger[_0xc0c5('0x27')](_0x28e7eb[_0xc0c5('0x28')]);if(_0x28e7eb[_0xc0c5('0x29')]){delete _0x28e7eb[_0xc0c5('0x29')];}_0x16bcb0[_0xc0c5('0x18')](_0x520308)[_0xc0c5('0x2a')](_0x28e7eb);};}exports['index']=function(_0x556e03,_0x1d100d){var _0x270883={},_0x3195b0={},_0x1d926b={'count':0x0,'rows':[]};var _0x13cc94=_[_0xc0c5('0x2b')](db[_0xc0c5('0x2c')][_0xc0c5('0x2d')],function(_0x5a7500){return{'name':_0x5a7500[_0xc0c5('0x2e')],'type':_0x5a7500[_0xc0c5('0x2f')][_0xc0c5('0x30')]};});_0x3195b0[_0xc0c5('0x31')]=_[_0xc0c5('0x2b')](_0x13cc94,_0xc0c5('0x29'));_0x3195b0[_0xc0c5('0x32')]=_[_0xc0c5('0x33')](_0x556e03[_0xc0c5('0x32')]);_0x3195b0[_0xc0c5('0x34')]=_['intersection'](_0x3195b0['model'],_0x3195b0[_0xc0c5('0x32')]);_0x270883[_0xc0c5('0x35')]=_[_0xc0c5('0x36')](_0x3195b0['model'],qs['fields'](_0x556e03[_0xc0c5('0x32')][_0xc0c5('0x37')]));_0x270883[_0xc0c5('0x35')]=_0x270883[_0xc0c5('0x35')][_0xc0c5('0x38')]?_0x270883['attributes']:_0x3195b0[_0xc0c5('0x31')];if(!_0x556e03['query']['hasOwnProperty'](_0xc0c5('0x39'))){_0x270883[_0xc0c5('0x1d')]=qs[_0xc0c5('0x1d')](_0x556e03[_0xc0c5('0x32')]['limit']);_0x270883[_0xc0c5('0x1b')]=qs[_0xc0c5('0x1b')](_0x556e03[_0xc0c5('0x32')]['offset']);}_0x270883[_0xc0c5('0x3a')]=qs[_0xc0c5('0x3b')](_0x556e03[_0xc0c5('0x32')]['sort']);_0x270883[_0xc0c5('0x3c')]=qs[_0xc0c5('0x34')](_['pick'](_0x556e03['query'],_0x3195b0[_0xc0c5('0x34')]),_0x13cc94);if(_0x556e03[_0xc0c5('0x32')][_0xc0c5('0x3d')]){_0x270883[_0xc0c5('0x3c')]=_[_0xc0c5('0x3e')](_0x270883[_0xc0c5('0x3c')],{'$or':_[_0xc0c5('0x2b')](_0x13cc94,function(_0x59eff2){if(_0x59eff2['type']!==_0xc0c5('0x3f')){var _0x53372d={};_0x53372d[_0x59eff2[_0xc0c5('0x29')]]={'$like':'%'+_0x556e03['query'][_0xc0c5('0x3d')]+'%'};return _0x53372d;}})});}_0x270883=_[_0xc0c5('0x3e')]({},_0x270883,_0x556e03['options']);var _0x4ccb19={'where':_0x270883['where']};return db[_0xc0c5('0x2c')][_0xc0c5('0x1e')](_0x4ccb19)['then'](function(_0x831106){_0x1d926b['count']=_0x831106;if(_0x556e03['query'][_0xc0c5('0x40')]){_0x270883[_0xc0c5('0x41')]=[{'all':!![]}];}return db[_0xc0c5('0x2c')][_0xc0c5('0x42')](_0x270883);})['then'](function(_0x305375){_0x1d926b[_0xc0c5('0x43')]=_0x305375;return _0x1d926b;})['then'](respondWithFilteredResult(_0x1d100d,_0x270883))[_0xc0c5('0x44')](handleError(_0x1d100d,null));};exports[_0xc0c5('0x45')]=function(_0x4b4048,_0x15e2a3){var _0x4f498d={'raw':!![],'where':{'id':_0x4b4048['params']['id']}},_0x158d7c={};_0x158d7c['model']=_['keys'](db['VtigerField'][_0xc0c5('0x2d')]);_0x158d7c[_0xc0c5('0x32')]=_['keys'](_0x4b4048[_0xc0c5('0x32')]);_0x158d7c[_0xc0c5('0x34')]=_[_0xc0c5('0x36')](_0x158d7c[_0xc0c5('0x31')],_0x158d7c[_0xc0c5('0x32')]);_0x4f498d[_0xc0c5('0x35')]=_[_0xc0c5('0x36')](_0x158d7c['model'],qs[_0xc0c5('0x37')](_0x4b4048[_0xc0c5('0x32')][_0xc0c5('0x37')]));_0x4f498d['attributes']=_0x4f498d[_0xc0c5('0x35')][_0xc0c5('0x38')]?_0x4f498d[_0xc0c5('0x35')]:_0x158d7c[_0xc0c5('0x31')];if(_0x4b4048[_0xc0c5('0x32')][_0xc0c5('0x40')]){_0x4f498d['include']=[{'all':!![]}];}_0x4f498d=_[_0xc0c5('0x3e')]({},_0x4f498d,_0x4b4048[_0xc0c5('0x46')]);return db[_0xc0c5('0x2c')][_0xc0c5('0x47')](_0x4f498d)[_0xc0c5('0x24')](handleEntityNotFound(_0x15e2a3,null))[_0xc0c5('0x24')](respondWithResult(_0x15e2a3,null))['catch'](handleError(_0x15e2a3,null));};exports[_0xc0c5('0x48')]=function(_0x2d275c,_0x2ff373){return db[_0xc0c5('0x2c')][_0xc0c5('0x48')](_0x2d275c[_0xc0c5('0x49')],{})[_0xc0c5('0x24')](respondWithResult(_0x2ff373,0xc9))[_0xc0c5('0x44')](handleError(_0x2ff373,null));};exports[_0xc0c5('0x23')]=function(_0x548e95,_0x2170c1){if(_0x548e95[_0xc0c5('0x49')]['id']){delete _0x548e95['body']['id'];}return db['VtigerField']['find']({'where':{'id':_0x548e95[_0xc0c5('0x4a')]['id']}})[_0xc0c5('0x24')](handleEntityNotFound(_0x2170c1,null))[_0xc0c5('0x24')](saveUpdates(_0x548e95['body'],null))['then'](respondWithResult(_0x2170c1,null))[_0xc0c5('0x44')](handleError(_0x2170c1,null));};exports['destroy']=function(_0x24a0c8,_0x45c3a3){return db['VtigerField'][_0xc0c5('0x47')]({'where':{'id':_0x24a0c8[_0xc0c5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x45c3a3,null))[_0xc0c5('0x24')](removeEntity(_0x45c3a3,null))[_0xc0c5('0x44')](handleError(_0x45c3a3,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 48e1a99..560bbf6 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 _0x67f2=['api','moment','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x67f2,0xd0));var _0x267f=function(_0x98fa3d,_0x1b08aa){_0x98fa3d=_0x98fa3d-0x0;var _0x5aa4f0=_0x67f2[_0x98fa3d];return _0x5aa4f0;};'use strict';var _=require(_0x267f('0x0'));var util=require(_0x267f('0x1'));var logger=require('../../config/logger')(_0x267f('0x2'));var moment=require(_0x267f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x267f('0x4'));var rimraf=require(_0x267f('0x5'));var config=require(_0x267f('0x6'));var attributes=require(_0x267f('0x7'));module[_0x267f('0x8')]=function(_0x19bd9b,_0x3880b2){return _0x19bd9b[_0x267f('0x9')](_0x267f('0xa'),attributes,{'tableName':_0x267f('0xb'),'paranoid':![],'indexes':[{'name':_0x267f('0xc'),'fields':[_0x267f('0xd'),_0x267f('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9073=['./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x38b0a0,_0x35053b){var _0x424020=function(_0x226583){while(--_0x226583){_0x38b0a0['push'](_0x38b0a0['shift']());}};_0x424020(++_0x35053b);}(_0x9073,0x77));var _0x3907=function(_0x389aff,_0x16144e){_0x389aff=_0x389aff-0x0;var _0x33d2fc=_0x9073[_0x389aff];return _0x33d2fc;};'use strict';var _=require('lodash');var util=require(_0x3907('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3907('0x1'));var BPromise=require(_0x3907('0x2'));var rp=require(_0x3907('0x3'));var fs=require('fs');var path=require(_0x3907('0x4'));var rimraf=require(_0x3907('0x5'));var config=require(_0x3907('0x6'));var attributes=require(_0x3907('0x7'));module[_0x3907('0x8')]=function(_0x2c83ea,_0x561b2b){return _0x2c83ea[_0x3907('0x9')](_0x3907('0xa'),attributes,{'tableName':_0x3907('0xb'),'paranoid':![],'indexes':[{'name':_0x3907('0xc'),'fields':[_0x3907('0xd'),'FieldId'],'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 7b5a9fc..76c0ca4 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 _0xa9de=['stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','VtigerField,\x20%s,\x20%s','debug'];(function(_0x12d9e6,_0x339ebd){var _0x315b5e=function(_0x2b1928){while(--_0x2b1928){_0x12d9e6['push'](_0x12d9e6['shift']());}};_0x315b5e(++_0x339ebd);}(_0xa9de,0x99));var _0xea9d=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9de[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0xea9d('0x0'));var util=require(_0xea9d('0x1'));var moment=require(_0xea9d('0x2'));var BPromise=require(_0xea9d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea9d('0x4'));var db=require(_0xea9d('0x5'))['db'];var utils=require(_0xea9d('0x6'));var logger=require(_0xea9d('0x7'))(_0xea9d('0x8'));var config=require(_0xea9d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xea9d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a1b1d,_0x927407,_0x4299d2){return new BPromise(function(_0xbbacc1,_0x1c4d2d){return client[_0xea9d('0xb')](_0x5a1b1d,_0x4299d2)[_0xea9d('0xc')](function(_0x11d292){logger['info'](_0xea9d('0xd'),_0x927407,'request\x20sent');logger[_0xea9d('0xe')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x927407,'request\x20sent',JSON[_0xea9d('0xf')](_0x11d292));if(_0x11d292[_0xea9d('0x10')]){if(_0x11d292['error'][_0xea9d('0x11')]===0x1f4){logger[_0xea9d('0x10')](_0xea9d('0xd'),_0x927407,_0x11d292['error'][_0xea9d('0x12')]);return _0x1c4d2d(_0x11d292['error']['message']);}logger[_0xea9d('0x10')](_0xea9d('0xd'),_0x927407,_0x11d292[_0xea9d('0x10')][_0xea9d('0x12')]);return _0xbbacc1(_0x11d292['error'][_0xea9d('0x12')]);}else{logger['info'](_0xea9d('0xd'),_0x927407,_0xea9d('0x13'));_0xbbacc1(_0x11d292['result'][_0xea9d('0x12')]);}})[_0xea9d('0x14')](function(_0x2ca2ad){logger['error'](_0xea9d('0xd'),_0x927407,_0x2ca2ad);_0x1c4d2d(_0x2ca2ad);});});} \ No newline at end of file +var _0x8b10=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8b10,0x1df));var _0x08b1=function(_0x40b438,_0x778ef1){_0x40b438=_0x40b438-0x0;var _0x593440=_0x8b10[_0x40b438];return _0x593440;};'use strict';var _=require(_0x08b1('0x0'));var util=require('util');var moment=require(_0x08b1('0x1'));var BPromise=require(_0x08b1('0x2'));var rs=require(_0x08b1('0x3'));var fs=require('fs');var Redis=require(_0x08b1('0x4'));var db=require(_0x08b1('0x5'))['db'];var utils=require(_0x08b1('0x6'));var logger=require('../../config/logger')(_0x08b1('0x7'));var config=require('../../config/environment');var jayson=require(_0x08b1('0x8'));var client=jayson[_0x08b1('0x9')][_0x08b1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a6389,_0x487981,_0x5e18a5){return new BPromise(function(_0x4a65a2,_0x5acffe){return client[_0x08b1('0xb')](_0x1a6389,_0x5e18a5)['then'](function(_0x42d05f){logger[_0x08b1('0xc')]('VtigerField,\x20%s,\x20%s',_0x487981,_0x08b1('0xd'));logger['debug'](_0x08b1('0xe'),_0x487981,_0x08b1('0xd'),JSON[_0x08b1('0xf')](_0x42d05f));if(_0x42d05f[_0x08b1('0x10')]){if(_0x42d05f[_0x08b1('0x10')][_0x08b1('0x11')]===0x1f4){logger[_0x08b1('0x10')](_0x08b1('0x12'),_0x487981,_0x42d05f[_0x08b1('0x10')]['message']);return _0x5acffe(_0x42d05f[_0x08b1('0x10')][_0x08b1('0x13')]);}logger['error'](_0x08b1('0x12'),_0x487981,_0x42d05f[_0x08b1('0x10')][_0x08b1('0x13')]);return _0x4a65a2(_0x42d05f[_0x08b1('0x10')][_0x08b1('0x13')]);}else{logger[_0x08b1('0xc')](_0x08b1('0x12'),_0x487981,_0x08b1('0xd'));_0x4a65a2(_0x42d05f[_0x08b1('0x14')][_0x08b1('0x13')]);}})[_0x08b1('0x15')](function(_0x212e17){logger[_0x08b1('0x10')](_0x08b1('0x12'),_0x487981,_0x212e17);_0x5acffe(_0x212e17);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 18ae14f..613d132 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 _0xe863=['addConfiguration','destroy','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe863,0x1cb));var _0x3e86=function(_0x4e2a84,_0x5b69a8){_0x4e2a84=_0x4e2a84-0x0;var _0x1ab18a=_0xe863[_0x4e2a84];return _0x1ab18a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3e86('0x0'));var express=require('express');var router=express[_0x3e86('0x1')]();var fs_extra=require(_0x3e86('0x2'));var auth=require(_0x3e86('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x3e86('0x4'));var controller=require(_0x3e86('0x5'));router[_0x3e86('0x6')]('/',auth[_0x3e86('0x7')](),controller[_0x3e86('0x8')]);router[_0x3e86('0x6')](_0x3e86('0x9'),auth[_0x3e86('0x7')](),controller['show']);router[_0x3e86('0x6')](_0x3e86('0xa'),auth['isAuthenticated'](),controller[_0x3e86('0xb')]);router['get'](_0x3e86('0xc'),auth['isAuthenticated'](),controller[_0x3e86('0xd')]);router['post']('/',auth[_0x3e86('0x7')](),controller[_0x3e86('0xe')]);router[_0x3e86('0xf')]('/:id/configurations',auth[_0x3e86('0x7')](),controller[_0x3e86('0x10')]);router['put'](_0x3e86('0x9'),auth[_0x3e86('0x7')](),controller['update']);router['delete'](_0x3e86('0x9'),auth[_0x3e86('0x7')](),controller[_0x3e86('0x11')]);module[_0x3e86('0x12')]=router; \ No newline at end of file +var _0xf7ee=['addConfiguration','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','getConfigurations','/:id/fields','create','/:id/configurations'];(function(_0x336376,_0xe4b28d){var _0x1d2a8e=function(_0x3afe68){while(--_0x3afe68){_0x336376['push'](_0x336376['shift']());}};_0x1d2a8e(++_0xe4b28d);}(_0xf7ee,0x83));var _0xef7e=function(_0x45e94d,_0x1fb9d0){_0x45e94d=_0x45e94d-0x0;var _0x31209d=_0xf7ee[_0x45e94d];return _0x31209d;};'use strict';var multer=require(_0xef7e('0x0'));var util=require('util');var path=require(_0xef7e('0x1'));var timeout=require(_0xef7e('0x2'));var express=require(_0xef7e('0x3'));var router=express[_0xef7e('0x4')]();var fs_extra=require(_0xef7e('0x5'));var auth=require(_0xef7e('0x6'));var interaction=require(_0xef7e('0x7'));var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router[_0xef7e('0x8')]('/',auth[_0xef7e('0x9')](),controller[_0xef7e('0xa')]);router['get'](_0xef7e('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xef7e('0x8')]('/:id/configurations',auth[_0xef7e('0x9')](),controller[_0xef7e('0xc')]);router['get'](_0xef7e('0xd'),auth[_0xef7e('0x9')](),controller['getFields']);router['post']('/',auth[_0xef7e('0x9')](),controller[_0xef7e('0xe')]);router['post'](_0xef7e('0xf'),auth[_0xef7e('0x9')](),controller[_0xef7e('0x10')]);router[_0xef7e('0x11')](_0xef7e('0xb'),auth[_0xef7e('0x9')](),controller['update']);router[_0xef7e('0x12')](_0xef7e('0xb'),auth['isAuthenticated'](),controller[_0xef7e('0x13')]);module[_0xef7e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index b7ee004..61ab64b 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 _0xb2ad=['ENUM','password','token','integrationTab','newTab','exports','STRING','username','remoteUri'];(function(_0x35c2e4,_0x32e397){var _0x11ec1e=function(_0x257cfd){while(--_0x257cfd){_0x35c2e4['push'](_0x35c2e4['shift']());}};_0x11ec1e(++_0x32e397);}(_0xb2ad,0x16d));var _0xdb2a=function(_0x205147,_0x4399ec){_0x205147=_0x205147-0x0;var _0x4f8e73=_0xb2ad[_0x205147];return _0x4f8e73;};'use strict';var Sequelize=require('sequelize');module[_0xdb2a('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdb2a('0x1')]},'username':{'type':Sequelize[_0xdb2a('0x1')],'unique':_0xdb2a('0x2')},'password':{'type':Sequelize[_0xdb2a('0x1')]},'token':{'type':Sequelize[_0xdb2a('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xdb2a('0x3')},'authType':{'type':Sequelize[_0xdb2a('0x4')](_0xdb2a('0x5'),_0xdb2a('0x6')),'defaultValue':_0xdb2a('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xdb2a('0x7'),_0xdb2a('0x8')),'defaultValue':_0xdb2a('0x7')}}; \ No newline at end of file +var _0x3d49=['integrationTab','exports','STRING','remoteUri','ENUM','password'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x3d49,0x151));var _0x93d4=function(_0x188a93,_0xaf57db){_0x188a93=_0x188a93-0x0;var _0x23b40d=_0x3d49[_0x188a93];return _0x23b40d;};'use strict';var Sequelize=require('sequelize');module[_0x93d4('0x0')]={'name':{'type':Sequelize[_0x93d4('0x1')]},'description':{'type':Sequelize[_0x93d4('0x1')]},'username':{'type':Sequelize[_0x93d4('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x93d4('0x1')]},'token':{'type':Sequelize[_0x93d4('0x1')]},'remoteUri':{'type':Sequelize[_0x93d4('0x1')],'unique':_0x93d4('0x2')},'authType':{'type':Sequelize[_0x93d4('0x3')](_0x93d4('0x4'),'token'),'defaultValue':'password'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab','newTab'),'defaultValue':_0x93d4('0x5')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 9355bf2..613be35 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 _0x9354=['Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','authType','remoteUri','slice','GET','format','%s/%s','ticket_fields','password','headers','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','ValidationError','subject','description','group','assignee','includes','position','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','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/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','ZendeskAccount','rawAttributes','type','key','keys','query','filters','attributes','model','fields','nolimit','order','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','intersection','length','find','create','body','getConfigurations','findOne','ZendeskConfiguration','hasOwnProperty','addConfiguration','AccountId'];(function(_0x173113,_0x316a7c){var _0x3bea89=function(_0xd33ac1){while(--_0xd33ac1){_0x173113['push'](_0x173113['shift']());}};_0x3bea89(++_0x316a7c);}(_0x9354,0x96));var _0x4935=function(_0x59e862,_0x477bf2){_0x59e862=_0x59e862-0x0;var _0x1a25ee=_0x9354[_0x59e862];return _0x1a25ee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4935('0x0'));var zipdir=require(_0x4935('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4935('0x2'));var moment=require(_0x4935('0x3'));var BPromise=require(_0x4935('0x4'));var Mustache=require(_0x4935('0x5'));var util=require('util');var path=require(_0x4935('0x6'));var sox=require(_0x4935('0x7'));var csv=require(_0x4935('0x8'));var ejs=require(_0x4935('0x9'));var fs=require('fs');var fs_extra=require(_0x4935('0xa'));var _=require(_0x4935('0xb'));var squel=require(_0x4935('0xc'));var crypto=require(_0x4935('0xd'));var jsforce=require(_0x4935('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4935('0x8'));var querystring=require('querystring');var Papa=require(_0x4935('0xf'));var Redis=require(_0x4935('0x10'));var authService=require(_0x4935('0x11'));var qs=require(_0x4935('0x12'));var as=require(_0x4935('0x13'));var hardwareService=require(_0x4935('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x4935('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4935('0x16'))['db'];var integrations=require(_0x4935('0x17'));function respondWithStatusCode(_0x3bb388,_0x1c6c22){_0x1c6c22=_0x1c6c22||0xcc;return function(_0x3b246a){if(_0x3b246a){return _0x3bb388[_0x4935('0x18')](_0x1c6c22);}return _0x3bb388[_0x4935('0x19')](_0x1c6c22)[_0x4935('0x1a')]();};}function respondWithResult(_0x57549f,_0x237e28){_0x237e28=_0x237e28||0xc8;return function(_0x1ce1ba){if(_0x1ce1ba){return _0x57549f[_0x4935('0x19')](_0x237e28)[_0x4935('0x1b')](_0x1ce1ba);}};}function respondWithFilteredResult(_0x3652c4,_0x24cc99){return function(_0x395a43){if(_0x395a43){var _0x57d7ed=typeof _0x24cc99[_0x4935('0x1c')]===_0x4935('0x1d')&&typeof _0x24cc99[_0x4935('0x1e')]===_0x4935('0x1d');var _0x1f0e81=_0x395a43[_0x4935('0x1f')];var _0x4ebc63=_0x57d7ed?0x0:_0x24cc99[_0x4935('0x1c')];var _0x145277=_0x57d7ed?_0x395a43['count']:_0x24cc99[_0x4935('0x1c')]+_0x24cc99[_0x4935('0x1e')];var _0x1e7e38;if(_0x145277>=_0x1f0e81){_0x145277=_0x1f0e81;_0x1e7e38=0xc8;}else{_0x1e7e38=0xce;}_0x3652c4['status'](_0x1e7e38);return _0x3652c4['set'](_0x4935('0x20'),_0x4ebc63+'-'+_0x145277+'/'+_0x1f0e81)[_0x4935('0x1b')](_0x395a43);}return null;};}function patchUpdates(_0x1ae059){return function(_0x388422){try{jsonpatch[_0x4935('0x21')](_0x388422,_0x1ae059,!![]);}catch(_0x16ab7c){return BPromise[_0x4935('0x22')](_0x16ab7c);}return _0x388422[_0x4935('0x23')]();};}function saveUpdates(_0x58b2f3,_0x2f520a){return function(_0x320d81){if(_0x320d81){return _0x320d81[_0x4935('0x24')](_0x58b2f3)[_0x4935('0x25')](function(_0x52c65a){return _0x52c65a;});}return null;};}function removeEntity(_0x53530f,_0x4dc1f5){return function(_0x36e76a){if(_0x36e76a){return _0x36e76a[_0x4935('0x26')]()[_0x4935('0x25')](function(){_0x53530f[_0x4935('0x19')](0xcc)[_0x4935('0x1a')]();});}};}function handleEntityNotFound(_0x1c37ba,_0x3784f9){return function(_0x1d53a7){if(!_0x1d53a7){_0x1c37ba[_0x4935('0x18')](0x194);}return _0x1d53a7;};}function handleError(_0xf4abb2,_0x1d08b5){_0x1d08b5=_0x1d08b5||0x1f4;return function(_0x39d07b){logger[_0x4935('0x27')](_0x39d07b[_0x4935('0x28')]);if(_0x39d07b[_0x4935('0x29')]){delete _0x39d07b['name'];}_0xf4abb2['status'](_0x1d08b5)['send'](_0x39d07b);};}exports[_0x4935('0x2a')]=function(_0x76ea7d,_0x4f1163){var _0x3f0707={},_0x20755a={},_0x24a3b6={'count':0x0,'rows':[]};var _0x9fe9f6=_[_0x4935('0x2b')](db[_0x4935('0x2c')][_0x4935('0x2d')],function(_0x2fe6da){return{'name':_0x2fe6da['fieldName'],'type':_0x2fe6da[_0x4935('0x2e')][_0x4935('0x2f')]};});_0x20755a['model']=_['map'](_0x9fe9f6,_0x4935('0x29'));_0x20755a['query']=_[_0x4935('0x30')](_0x76ea7d[_0x4935('0x31')]);_0x20755a[_0x4935('0x32')]=_['intersection'](_0x20755a['model'],_0x20755a[_0x4935('0x31')]);_0x3f0707[_0x4935('0x33')]=_['intersection'](_0x20755a[_0x4935('0x34')],qs[_0x4935('0x35')](_0x76ea7d[_0x4935('0x31')][_0x4935('0x35')]));_0x3f0707[_0x4935('0x33')]=_0x3f0707['attributes']['length']?_0x3f0707[_0x4935('0x33')]:_0x20755a[_0x4935('0x34')];if(!_0x76ea7d['query']['hasOwnProperty'](_0x4935('0x36'))){_0x3f0707['limit']=qs[_0x4935('0x1e')](_0x76ea7d[_0x4935('0x31')][_0x4935('0x1e')]);_0x3f0707[_0x4935('0x1c')]=qs[_0x4935('0x1c')](_0x76ea7d[_0x4935('0x31')]['offset']);}_0x3f0707[_0x4935('0x37')]=qs['sort'](_0x76ea7d[_0x4935('0x31')]['sort']);_0x3f0707[_0x4935('0x38')]=qs['filters'](_[_0x4935('0x39')](_0x76ea7d[_0x4935('0x31')],_0x20755a[_0x4935('0x32')]),_0x9fe9f6);if(_0x76ea7d[_0x4935('0x31')][_0x4935('0x3a')]){_0x3f0707[_0x4935('0x38')]=_[_0x4935('0x3b')](_0x3f0707['where'],{'$or':_['map'](_0x9fe9f6,function(_0x2efc45){if(_0x2efc45['type']!=='VIRTUAL'){var _0x1552b2={};_0x1552b2[_0x2efc45['name']]={'$like':'%'+_0x76ea7d[_0x4935('0x31')][_0x4935('0x3a')]+'%'};return _0x1552b2;}})});}_0x3f0707=_[_0x4935('0x3b')]({},_0x3f0707,_0x76ea7d[_0x4935('0x3c')]);var _0xb366e6={'where':_0x3f0707['where']};return db['ZendeskAccount'][_0x4935('0x1f')](_0xb366e6)[_0x4935('0x25')](function(_0x28f545){_0x24a3b6[_0x4935('0x1f')]=_0x28f545;if(_0x76ea7d[_0x4935('0x31')][_0x4935('0x3d')]){_0x3f0707[_0x4935('0x3e')]=[{'all':!![]}];}return db[_0x4935('0x2c')]['findAll'](_0x3f0707);})['then'](function(_0x213230){_0x24a3b6[_0x4935('0x3f')]=_0x213230;return _0x24a3b6;})['then'](respondWithFilteredResult(_0x4f1163,_0x3f0707))[_0x4935('0x40')](handleError(_0x4f1163,null));};exports[_0x4935('0x41')]=function(_0x4706eb,_0xe5c9f5){var _0x52ab0c={'raw':![],'where':{'id':_0x4706eb[_0x4935('0x42')]['id']}},_0x542689={};_0x542689[_0x4935('0x34')]=_['keys'](db[_0x4935('0x2c')][_0x4935('0x2d')]);_0x542689[_0x4935('0x31')]=_['keys'](_0x4706eb[_0x4935('0x31')]);_0x542689[_0x4935('0x32')]=_[_0x4935('0x43')](_0x542689[_0x4935('0x34')],_0x542689[_0x4935('0x31')]);_0x52ab0c[_0x4935('0x33')]=_[_0x4935('0x43')](_0x542689[_0x4935('0x34')],qs[_0x4935('0x35')](_0x4706eb[_0x4935('0x31')][_0x4935('0x35')]));_0x52ab0c[_0x4935('0x33')]=_0x52ab0c[_0x4935('0x33')][_0x4935('0x44')]?_0x52ab0c[_0x4935('0x33')]:_0x542689[_0x4935('0x34')];if(_0x4706eb[_0x4935('0x31')][_0x4935('0x3d')]){_0x52ab0c['include']=[{'all':!![]}];}_0x52ab0c=_[_0x4935('0x3b')]({},_0x52ab0c,_0x4706eb['options']);return db[_0x4935('0x2c')][_0x4935('0x45')](_0x52ab0c)[_0x4935('0x25')](handleEntityNotFound(_0xe5c9f5,null))[_0x4935('0x25')](respondWithResult(_0xe5c9f5,null))['catch'](handleError(_0xe5c9f5,null));};exports[_0x4935('0x46')]=function(_0x9c8bad,_0x2b34d5){return db[_0x4935('0x2c')][_0x4935('0x46')](_0x9c8bad[_0x4935('0x47')],{})[_0x4935('0x25')](respondWithResult(_0x2b34d5,0xc9))[_0x4935('0x40')](handleError(_0x2b34d5,null));};exports[_0x4935('0x24')]=function(_0x392cba,_0x5d48dd){if(_0x392cba[_0x4935('0x47')]['id']){delete _0x392cba[_0x4935('0x47')]['id'];}return db['ZendeskAccount'][_0x4935('0x45')]({'where':{'id':_0x392cba[_0x4935('0x42')]['id']}})[_0x4935('0x25')](handleEntityNotFound(_0x5d48dd,null))[_0x4935('0x25')](saveUpdates(_0x392cba[_0x4935('0x47')],null))[_0x4935('0x25')](respondWithResult(_0x5d48dd,null))[_0x4935('0x40')](handleError(_0x5d48dd,null));};exports[_0x4935('0x26')]=function(_0x4b9c70,_0x57d0d9){return db['ZendeskAccount']['find']({'where':{'id':_0x4b9c70[_0x4935('0x42')]['id']}})[_0x4935('0x25')](handleEntityNotFound(_0x57d0d9,null))[_0x4935('0x25')](removeEntity(_0x57d0d9,null))[_0x4935('0x40')](handleError(_0x57d0d9,null));};exports[_0x4935('0x48')]=function(_0x487cf3,_0x32e004,_0x4a88db){var _0x2cc0c1={};var _0x345454={};var _0x377ff4;var _0x8196b4;return db[_0x4935('0x2c')][_0x4935('0x49')]({'where':{'id':_0x487cf3[_0x4935('0x42')]['id']}})[_0x4935('0x25')](handleEntityNotFound(_0x32e004,null))['then'](function(_0x24b83b){if(_0x24b83b){_0x377ff4=_0x24b83b;_0x345454['model']=_[_0x4935('0x30')](db[_0x4935('0x4a')]['rawAttributes']);_0x345454[_0x4935('0x31')]=_['keys'](_0x487cf3['query']);_0x345454['filters']=_[_0x4935('0x43')](_0x345454[_0x4935('0x34')],_0x345454[_0x4935('0x31')]);_0x2cc0c1[_0x4935('0x33')]=_[_0x4935('0x43')](_0x345454['model'],qs['fields'](_0x487cf3[_0x4935('0x31')][_0x4935('0x35')]));_0x2cc0c1[_0x4935('0x33')]=_0x2cc0c1['attributes'][_0x4935('0x44')]?_0x2cc0c1[_0x4935('0x33')]:_0x345454[_0x4935('0x34')];_0x2cc0c1[_0x4935('0x37')]=qs['sort'](_0x487cf3[_0x4935('0x31')]['sort']);_0x2cc0c1['where']=qs['filters'](_[_0x4935('0x39')](_0x487cf3[_0x4935('0x31')],_0x345454['filters']));if(_0x487cf3[_0x4935('0x31')][_0x4935('0x3a')]){_0x2cc0c1['where']=_[_0x4935('0x3b')](_0x2cc0c1[_0x4935('0x38')],{'$or':_[_0x4935('0x2b')](_0x2cc0c1[_0x4935('0x33')],function(_0x42ff64){var _0x2d21f0={};_0x2d21f0[_0x42ff64]={'$like':'%'+_0x487cf3[_0x4935('0x31')]['filter']+'%'};return _0x2d21f0;})});}_0x2cc0c1=_[_0x4935('0x3b')]({},_0x2cc0c1,_0x487cf3['options']);return _0x377ff4['getConfigurations'](_0x2cc0c1);}})[_0x4935('0x25')](function(_0xc3fb8f){if(_0xc3fb8f){_0x8196b4=_0xc3fb8f['length'];if(!_0x487cf3['query'][_0x4935('0x4b')](_0x4935('0x36'))){_0x2cc0c1[_0x4935('0x1e')]=qs['limit'](_0x487cf3[_0x4935('0x31')]['limit']);_0x2cc0c1[_0x4935('0x1c')]=qs[_0x4935('0x1c')](_0x487cf3[_0x4935('0x31')][_0x4935('0x1c')]);}return _0x377ff4[_0x4935('0x48')](_0x2cc0c1);}})['then'](function(_0x1eb15d){if(_0x1eb15d){return _0x1eb15d?{'count':_0x8196b4,'rows':_0x1eb15d}:null;}})[_0x4935('0x25')](respondWithResult(_0x32e004,null))['catch'](handleError(_0x32e004,null));};exports[_0x4935('0x4c')]=function(_0x2ae5ee,_0x283b75,_0x2046b2){if(_0x2ae5ee[_0x4935('0x47')]['id']){delete _0x2ae5ee[_0x4935('0x47')]['id'];}return db[_0x4935('0x2c')][_0x4935('0x49')]({'where':{'id':_0x2ae5ee[_0x4935('0x42')]['id']}})[_0x4935('0x25')](handleEntityNotFound(_0x283b75,null))[_0x4935('0x25')](function(_0x5d4435){if(_0x5d4435){_0x2ae5ee[_0x4935('0x47')][_0x4935('0x4d')]=_0x5d4435['id'];_0x2ae5ee[_0x4935('0x47')][_0x4935('0x4e')]=integrations[_0x4935('0x4f')](_0x2ae5ee[_0x4935('0x47')][_0x4935('0x50')],_0x2ae5ee[_0x4935('0x47')][_0x4935('0x2e')]);_0x2ae5ee[_0x4935('0x47')][_0x4935('0x51')]=integrations[_0x4935('0x52')](_0x2ae5ee[_0x4935('0x47')]['channel'],_0x2ae5ee['body'][_0x4935('0x2e')]);return db[_0x4935('0x4a')]['create'](_0x2ae5ee[_0x4935('0x47')],{'include':[{'model':db[_0x4935('0x53')],'as':'Subjects'},{'model':db['ZendeskField'],'as':_0x4935('0x51')}]});}return null;})[_0x4935('0x25')](respondWithResult(_0x283b75,null))[_0x4935('0x40')](handleError(_0x283b75,null));};exports[_0x4935('0x54')]=function(_0x105e38,_0x5a612b,_0x404b2c){var _0x1f5e21='';return db[_0x4935('0x2c')][_0x4935('0x49')]({'where':{'id':_0x105e38['params']['id']},'attributes':['id',_0x4935('0x55'),'password','token',_0x4935('0x56'),_0x4935('0x57')]})['then'](handleEntityNotFound(_0x5a612b,null))[_0x4935('0x25')](function(_0x22d594){if(_0x22d594){_0x1f5e21=_0x22d594[_0x4935('0x57')];var _0x4c1b82=_0x1f5e21[_0x4935('0x58')](-0x1);if(_0x4c1b82==='/'){_0x1f5e21=_0x1f5e21['substring'](0x0,_0x1f5e21['lastIndexOf'](_0x4c1b82));}var _0x190186={'method':_0x4935('0x59'),'uri':util[_0x4935('0x5a')](_0x4935('0x5b'),_0x1f5e21,_0x4935('0x5c')),'json':!![]};switch(_0x22d594[_0x4935('0x56')]){case _0x4935('0x5d'):_0x190186[_0x4935('0x5e')]={'Authorization':util['format'](_0x4935('0x5f'),new Buffer(util[_0x4935('0x5a')](_0x4935('0x60'),_0x22d594['username'],_0x22d594['password']))[_0x4935('0x61')](_0x4935('0x62')))};break;case'token':_0x190186[_0x4935('0x5e')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x4935('0x5a')](_0x4935('0x63'),_0x22d594[_0x4935('0x55')],_0x22d594['token']))['toString'](_0x4935('0x62')))};break;default:throw new db['Sequelize'][(_0x4935('0x64'))]('Unknown\x20authentication\x20type');}return rp(_0x190186);}})[_0x4935('0x25')](function(_0x91b821){if(_0x91b821){var _0xa5c497=[_0x4935('0x65'),_0x4935('0x66'),_0x4935('0x67'),_0x4935('0x68')];_['remove'](_0x91b821[_0x4935('0x5c')],function(_0x493392){return _0xa5c497[_0x4935('0x69')](_0x493392[_0x4935('0x2e')]);});return{'count':_0x91b821['ticket_fields'][_0x4935('0x44')],'rows':_['map'](_0x91b821[_0x4935('0x5c')],function(_0x402963){return{'id':_0x402963['id'],'name':_0x402963['position']>0x7?_0x402963['title']:_0x402963['type'],'custom':_0x402963[_0x4935('0x6a')]>0x7?!![]:![],'options':_0x402963['system_field_options']?_0x402963['system_field_options']:_0x402963[_0x4935('0x6b')]?_0x402963['custom_field_options']:[]};})};}})[_0x4935('0x25')](respondWithResult(_0x5a612b,null))['catch'](function(_0x497246){var _0x5c5978=_0x105e38[_0x4935('0x31')]['test']?0x1f4:_0x497246[_0x4935('0x6c')]||0x1f4;logger[_0x4935('0x27')](_0x4935('0x6d'),_0x4935('0x54'),_0x5c5978,JSON[_0x4935('0x6e')](_0x497246));delete _0x497246['name'];if(_0x5c5978===0x191){_0x5c5978=0x190;}_0x5a612b[_0x4935('0x19')](_0x5c5978)[_0x4935('0x6f')](_0x105e38['query'][_0x4935('0x70')]?{'message':_0x4935('0x71'),'statusCode':_0x497246['statusCode']}:_0x497246);});}; \ No newline at end of file +var _0xb574=['slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','authType','headers','Basic\x20%s','toString','base64','token','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','remove','includes','position','title','system_field_options','custom_field_options','statusCode','stringify','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','ZendeskAccount','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','nolimit','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','includeAll','include','findAll','rows','show','find','catch','create','body','params','getConfigurations','ZendeskConfiguration','options','length','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','password','remoteUri'];(function(_0x20ec6b,_0x5df25c){var _0x5e3b4c=function(_0x34f83b){while(--_0x34f83b){_0x20ec6b['push'](_0x20ec6b['shift']());}};_0x5e3b4c(++_0x5df25c);}(_0xb574,0x106));var _0x4b57=function(_0x4886f5,_0x167acb){_0x4886f5=_0x4886f5-0x0;var _0x15562d=_0xb574[_0x4886f5];return _0x15562d;};'use strict';var emlformat=require(_0x4b57('0x0'));var rimraf=require(_0x4b57('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4b57('0x2'));var rp=require(_0x4b57('0x3'));var moment=require('moment');var BPromise=require(_0x4b57('0x4'));var Mustache=require(_0x4b57('0x5'));var util=require(_0x4b57('0x6'));var path=require(_0x4b57('0x7'));var sox=require(_0x4b57('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b57('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4b57('0xa'));var toCsv=require(_0x4b57('0xb'));var querystring=require(_0x4b57('0xc'));var Papa=require(_0x4b57('0xd'));var Redis=require(_0x4b57('0xe'));var authService=require(_0x4b57('0xf'));var qs=require(_0x4b57('0x10'));var as=require(_0x4b57('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b57('0x12'))(_0x4b57('0x13'));var utils=require(_0x4b57('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4b57('0x15'))['db'];var integrations=require(_0x4b57('0x16'));function respondWithStatusCode(_0x43d066,_0xf8a6fc){_0xf8a6fc=_0xf8a6fc||0xcc;return function(_0x607276){if(_0x607276){return _0x43d066[_0x4b57('0x17')](_0xf8a6fc);}return _0x43d066[_0x4b57('0x18')](_0xf8a6fc)[_0x4b57('0x19')]();};}function respondWithResult(_0x31cced,_0x4e15be){_0x4e15be=_0x4e15be||0xc8;return function(_0x4a58dc){if(_0x4a58dc){return _0x31cced[_0x4b57('0x18')](_0x4e15be)[_0x4b57('0x1a')](_0x4a58dc);}};}function respondWithFilteredResult(_0x10b9ff,_0x58d6bd){return function(_0x284640){if(_0x284640){var _0x48bd13=typeof _0x58d6bd[_0x4b57('0x1b')]===_0x4b57('0x1c')&&typeof _0x58d6bd[_0x4b57('0x1d')]===_0x4b57('0x1c');var _0x20cf5e=_0x284640[_0x4b57('0x1e')];var _0x4ede42=_0x48bd13?0x0:_0x58d6bd[_0x4b57('0x1b')];var _0x1a0b72=_0x48bd13?_0x284640[_0x4b57('0x1e')]:_0x58d6bd[_0x4b57('0x1b')]+_0x58d6bd['limit'];var _0xb62450;if(_0x1a0b72>=_0x20cf5e){_0x1a0b72=_0x20cf5e;_0xb62450=0xc8;}else{_0xb62450=0xce;}_0x10b9ff[_0x4b57('0x18')](_0xb62450);return _0x10b9ff[_0x4b57('0x1f')](_0x4b57('0x20'),_0x4ede42+'-'+_0x1a0b72+'/'+_0x20cf5e)[_0x4b57('0x1a')](_0x284640);}return null;};}function patchUpdates(_0x4454c8){return function(_0x4f407d){try{jsonpatch[_0x4b57('0x21')](_0x4f407d,_0x4454c8,!![]);}catch(_0x131fed){return BPromise[_0x4b57('0x22')](_0x131fed);}return _0x4f407d['save']();};}function saveUpdates(_0x380554,_0x4a34b2){return function(_0x286c7d){if(_0x286c7d){return _0x286c7d[_0x4b57('0x23')](_0x380554)['then'](function(_0x271361){return _0x271361;});}return null;};}function removeEntity(_0x368c5f,_0x4d07c9){return function(_0x3e7b96){if(_0x3e7b96){return _0x3e7b96[_0x4b57('0x24')]()[_0x4b57('0x25')](function(){_0x368c5f[_0x4b57('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x156962,_0x51d0c3){return function(_0x131dab){if(!_0x131dab){_0x156962['sendStatus'](0x194);}return _0x131dab;};}function handleError(_0x36ceb1,_0x2dc9d8){_0x2dc9d8=_0x2dc9d8||0x1f4;return function(_0x4af2c8){logger[_0x4b57('0x26')](_0x4af2c8[_0x4b57('0x27')]);if(_0x4af2c8[_0x4b57('0x28')]){delete _0x4af2c8['name'];}_0x36ceb1['status'](_0x2dc9d8)[_0x4b57('0x29')](_0x4af2c8);};}exports['index']=function(_0x1ea0cb,_0x458f70){var _0x874cf7={},_0x3af22f={},_0x249461={'count':0x0,'rows':[]};var _0x2c20d2=_['map'](db[_0x4b57('0x2a')][_0x4b57('0x2b')],function(_0x68be27){return{'name':_0x68be27[_0x4b57('0x2c')],'type':_0x68be27['type'][_0x4b57('0x2d')]};});_0x3af22f[_0x4b57('0x2e')]=_['map'](_0x2c20d2,_0x4b57('0x28'));_0x3af22f[_0x4b57('0x2f')]=_[_0x4b57('0x30')](_0x1ea0cb[_0x4b57('0x2f')]);_0x3af22f['filters']=_['intersection'](_0x3af22f['model'],_0x3af22f[_0x4b57('0x2f')]);_0x874cf7[_0x4b57('0x31')]=_[_0x4b57('0x32')](_0x3af22f[_0x4b57('0x2e')],qs[_0x4b57('0x33')](_0x1ea0cb['query'][_0x4b57('0x33')]));_0x874cf7[_0x4b57('0x31')]=_0x874cf7[_0x4b57('0x31')]['length']?_0x874cf7[_0x4b57('0x31')]:_0x3af22f[_0x4b57('0x2e')];if(!_0x1ea0cb[_0x4b57('0x2f')]['hasOwnProperty'](_0x4b57('0x34'))){_0x874cf7[_0x4b57('0x1d')]=qs['limit'](_0x1ea0cb[_0x4b57('0x2f')][_0x4b57('0x1d')]);_0x874cf7[_0x4b57('0x1b')]=qs[_0x4b57('0x1b')](_0x1ea0cb[_0x4b57('0x2f')][_0x4b57('0x1b')]);}_0x874cf7['order']=qs[_0x4b57('0x35')](_0x1ea0cb[_0x4b57('0x2f')][_0x4b57('0x35')]);_0x874cf7[_0x4b57('0x36')]=qs[_0x4b57('0x37')](_[_0x4b57('0x38')](_0x1ea0cb[_0x4b57('0x2f')],_0x3af22f['filters']),_0x2c20d2);if(_0x1ea0cb['query'][_0x4b57('0x39')]){_0x874cf7[_0x4b57('0x36')]=_[_0x4b57('0x3a')](_0x874cf7['where'],{'$or':_[_0x4b57('0x3b')](_0x2c20d2,function(_0x1a3c3a){if(_0x1a3c3a[_0x4b57('0x3c')]!==_0x4b57('0x3d')){var _0x5487cc={};_0x5487cc[_0x1a3c3a[_0x4b57('0x28')]]={'$like':'%'+_0x1ea0cb[_0x4b57('0x2f')][_0x4b57('0x39')]+'%'};return _0x5487cc;}})});}_0x874cf7=_[_0x4b57('0x3a')]({},_0x874cf7,_0x1ea0cb['options']);var _0x5766a6={'where':_0x874cf7['where']};return db[_0x4b57('0x2a')][_0x4b57('0x1e')](_0x5766a6)[_0x4b57('0x25')](function(_0x2e23d3){_0x249461['count']=_0x2e23d3;if(_0x1ea0cb[_0x4b57('0x2f')][_0x4b57('0x3e')]){_0x874cf7[_0x4b57('0x3f')]=[{'all':!![]}];}return db[_0x4b57('0x2a')][_0x4b57('0x40')](_0x874cf7);})[_0x4b57('0x25')](function(_0x2d5a0c){_0x249461[_0x4b57('0x41')]=_0x2d5a0c;return _0x249461;})[_0x4b57('0x25')](respondWithFilteredResult(_0x458f70,_0x874cf7))['catch'](handleError(_0x458f70,null));};exports[_0x4b57('0x42')]=function(_0x3685fd,_0x3c5095){var _0x5b2f50={'raw':![],'where':{'id':_0x3685fd['params']['id']}},_0x44f988={};_0x44f988[_0x4b57('0x2e')]=_[_0x4b57('0x30')](db[_0x4b57('0x2a')][_0x4b57('0x2b')]);_0x44f988[_0x4b57('0x2f')]=_[_0x4b57('0x30')](_0x3685fd[_0x4b57('0x2f')]);_0x44f988[_0x4b57('0x37')]=_[_0x4b57('0x32')](_0x44f988[_0x4b57('0x2e')],_0x44f988[_0x4b57('0x2f')]);_0x5b2f50[_0x4b57('0x31')]=_[_0x4b57('0x32')](_0x44f988['model'],qs['fields'](_0x3685fd[_0x4b57('0x2f')][_0x4b57('0x33')]));_0x5b2f50[_0x4b57('0x31')]=_0x5b2f50[_0x4b57('0x31')]['length']?_0x5b2f50[_0x4b57('0x31')]:_0x44f988[_0x4b57('0x2e')];if(_0x3685fd['query'][_0x4b57('0x3e')]){_0x5b2f50['include']=[{'all':!![]}];}_0x5b2f50=_[_0x4b57('0x3a')]({},_0x5b2f50,_0x3685fd['options']);return db['ZendeskAccount'][_0x4b57('0x43')](_0x5b2f50)[_0x4b57('0x25')](handleEntityNotFound(_0x3c5095,null))['then'](respondWithResult(_0x3c5095,null))[_0x4b57('0x44')](handleError(_0x3c5095,null));};exports[_0x4b57('0x45')]=function(_0x2732ff,_0x1cf1f3){return db[_0x4b57('0x2a')][_0x4b57('0x45')](_0x2732ff['body'],{})[_0x4b57('0x25')](respondWithResult(_0x1cf1f3,0xc9))[_0x4b57('0x44')](handleError(_0x1cf1f3,null));};exports['update']=function(_0xd529fb,_0x23e852){if(_0xd529fb[_0x4b57('0x46')]['id']){delete _0xd529fb['body']['id'];}return db[_0x4b57('0x2a')]['find']({'where':{'id':_0xd529fb[_0x4b57('0x47')]['id']}})[_0x4b57('0x25')](handleEntityNotFound(_0x23e852,null))[_0x4b57('0x25')](saveUpdates(_0xd529fb[_0x4b57('0x46')],null))[_0x4b57('0x25')](respondWithResult(_0x23e852,null))[_0x4b57('0x44')](handleError(_0x23e852,null));};exports[_0x4b57('0x24')]=function(_0x3ec6ba,_0x5ab120){return db[_0x4b57('0x2a')][_0x4b57('0x43')]({'where':{'id':_0x3ec6ba[_0x4b57('0x47')]['id']}})['then'](handleEntityNotFound(_0x5ab120,null))[_0x4b57('0x25')](removeEntity(_0x5ab120,null))[_0x4b57('0x44')](handleError(_0x5ab120,null));};exports[_0x4b57('0x48')]=function(_0x488bea,_0x1579d1,_0x3d2336){var _0x343cec={};var _0xb56bf0={};var _0x44494f;var _0xb7c37c;return db[_0x4b57('0x2a')]['findOne']({'where':{'id':_0x488bea['params']['id']}})[_0x4b57('0x25')](handleEntityNotFound(_0x1579d1,null))[_0x4b57('0x25')](function(_0x3b4cbf){if(_0x3b4cbf){_0x44494f=_0x3b4cbf;_0xb56bf0[_0x4b57('0x2e')]=_['keys'](db[_0x4b57('0x49')][_0x4b57('0x2b')]);_0xb56bf0[_0x4b57('0x2f')]=_[_0x4b57('0x30')](_0x488bea['query']);_0xb56bf0['filters']=_[_0x4b57('0x32')](_0xb56bf0[_0x4b57('0x2e')],_0xb56bf0['query']);_0x343cec['attributes']=_[_0x4b57('0x32')](_0xb56bf0['model'],qs[_0x4b57('0x33')](_0x488bea[_0x4b57('0x2f')][_0x4b57('0x33')]));_0x343cec[_0x4b57('0x31')]=_0x343cec[_0x4b57('0x31')]['length']?_0x343cec['attributes']:_0xb56bf0['model'];_0x343cec['order']=qs[_0x4b57('0x35')](_0x488bea[_0x4b57('0x2f')]['sort']);_0x343cec[_0x4b57('0x36')]=qs[_0x4b57('0x37')](_[_0x4b57('0x38')](_0x488bea[_0x4b57('0x2f')],_0xb56bf0[_0x4b57('0x37')]));if(_0x488bea[_0x4b57('0x2f')][_0x4b57('0x39')]){_0x343cec[_0x4b57('0x36')]=_[_0x4b57('0x3a')](_0x343cec['where'],{'$or':_[_0x4b57('0x3b')](_0x343cec['attributes'],function(_0x10bd32){var _0x2f684b={};_0x2f684b[_0x10bd32]={'$like':'%'+_0x488bea['query'][_0x4b57('0x39')]+'%'};return _0x2f684b;})});}_0x343cec=_[_0x4b57('0x3a')]({},_0x343cec,_0x488bea[_0x4b57('0x4a')]);return _0x44494f[_0x4b57('0x48')](_0x343cec);}})[_0x4b57('0x25')](function(_0xc24706){if(_0xc24706){_0xb7c37c=_0xc24706[_0x4b57('0x4b')];if(!_0x488bea[_0x4b57('0x2f')][_0x4b57('0x4c')](_0x4b57('0x34'))){_0x343cec[_0x4b57('0x1d')]=qs[_0x4b57('0x1d')](_0x488bea['query'][_0x4b57('0x1d')]);_0x343cec[_0x4b57('0x1b')]=qs['offset'](_0x488bea[_0x4b57('0x2f')]['offset']);}return _0x44494f['getConfigurations'](_0x343cec);}})['then'](function(_0x1004ac){if(_0x1004ac){return _0x1004ac?{'count':_0xb7c37c,'rows':_0x1004ac}:null;}})['then'](respondWithResult(_0x1579d1,null))[_0x4b57('0x44')](handleError(_0x1579d1,null));};exports[_0x4b57('0x4d')]=function(_0x5e093a,_0x4cc278,_0x264c9f){if(_0x5e093a[_0x4b57('0x46')]['id']){delete _0x5e093a[_0x4b57('0x46')]['id'];}return db['ZendeskAccount'][_0x4b57('0x4e')]({'where':{'id':_0x5e093a[_0x4b57('0x47')]['id']}})['then'](handleEntityNotFound(_0x4cc278,null))[_0x4b57('0x25')](function(_0x119933){if(_0x119933){_0x5e093a['body'][_0x4b57('0x4f')]=_0x119933['id'];_0x5e093a[_0x4b57('0x46')][_0x4b57('0x50')]=integrations[_0x4b57('0x51')](_0x5e093a[_0x4b57('0x46')][_0x4b57('0x52')],_0x5e093a[_0x4b57('0x46')]['type']);_0x5e093a['body'][_0x4b57('0x53')]=integrations[_0x4b57('0x54')](_0x5e093a['body']['channel'],_0x5e093a[_0x4b57('0x46')][_0x4b57('0x3c')]);return db['ZendeskConfiguration']['create'](_0x5e093a['body'],{'include':[{'model':db[_0x4b57('0x55')],'as':_0x4b57('0x50')},{'model':db[_0x4b57('0x55')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x4cc278,null))['catch'](handleError(_0x4cc278,null));};exports[_0x4b57('0x56')]=function(_0x59cd7c,_0x40cabe,_0x502313){var _0x13c680='';return db[_0x4b57('0x2a')][_0x4b57('0x4e')]({'where':{'id':_0x59cd7c[_0x4b57('0x47')]['id']},'attributes':['id','username',_0x4b57('0x57'),'token','authType',_0x4b57('0x58')]})[_0x4b57('0x25')](handleEntityNotFound(_0x40cabe,null))['then'](function(_0xf54f38){if(_0xf54f38){_0x13c680=_0xf54f38[_0x4b57('0x58')];var _0x355b5b=_0x13c680[_0x4b57('0x59')](-0x1);if(_0x355b5b==='/'){_0x13c680=_0x13c680[_0x4b57('0x5a')](0x0,_0x13c680[_0x4b57('0x5b')](_0x355b5b));}var _0x57e9eb={'method':_0x4b57('0x5c'),'uri':util[_0x4b57('0x5d')](_0x4b57('0x5e'),_0x13c680,_0x4b57('0x5f')),'json':!![]};switch(_0xf54f38[_0x4b57('0x60')]){case'password':_0x57e9eb[_0x4b57('0x61')]={'Authorization':util[_0x4b57('0x5d')](_0x4b57('0x62'),new Buffer(util[_0x4b57('0x5d')]('%s:%s',_0xf54f38['username'],_0xf54f38[_0x4b57('0x57')]))[_0x4b57('0x63')](_0x4b57('0x64')))};break;case'token':_0x57e9eb[_0x4b57('0x61')]={'Authorization':util['format'](_0x4b57('0x62'),new Buffer(util[_0x4b57('0x5d')]('%s/token:%s',_0xf54f38['username'],_0xf54f38[_0x4b57('0x65')]))['toString'](_0x4b57('0x64')))};break;default:throw new db[(_0x4b57('0x66'))][(_0x4b57('0x67'))](_0x4b57('0x68'));}return rp(_0x57e9eb);}})[_0x4b57('0x25')](function(_0x489f3c){if(_0x489f3c){var _0x137532=[_0x4b57('0x69'),_0x4b57('0x6a'),'group','assignee'];_[_0x4b57('0x6b')](_0x489f3c[_0x4b57('0x5f')],function(_0x540a0a){return _0x137532[_0x4b57('0x6c')](_0x540a0a[_0x4b57('0x3c')]);});return{'count':_0x489f3c['ticket_fields'][_0x4b57('0x4b')],'rows':_[_0x4b57('0x3b')](_0x489f3c['ticket_fields'],function(_0xdef470){return{'id':_0xdef470['id'],'name':_0xdef470[_0x4b57('0x6d')]>0x7?_0xdef470[_0x4b57('0x6e')]:_0xdef470['type'],'custom':_0xdef470[_0x4b57('0x6d')]>0x7?!![]:![],'options':_0xdef470[_0x4b57('0x6f')]?_0xdef470[_0x4b57('0x6f')]:_0xdef470[_0x4b57('0x70')]?_0xdef470[_0x4b57('0x70')]:[]};})};}})[_0x4b57('0x25')](respondWithResult(_0x40cabe,null))[_0x4b57('0x44')](function(_0x4e4bbd){var _0x183b8c=_0x59cd7c[_0x4b57('0x2f')]['test']?0x1f4:_0x4e4bbd[_0x4b57('0x71')]||0x1f4;logger[_0x4b57('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0x4b57('0x56'),_0x183b8c,JSON[_0x4b57('0x72')](_0x4e4bbd));delete _0x4e4bbd[_0x4b57('0x28')];if(_0x183b8c===0x191){_0x183b8c=0x190;}_0x40cabe[_0x4b57('0x18')](_0x183b8c)[_0x4b57('0x29')](_0x59cd7c[_0x4b57('0x2f')][_0x4b57('0x73')]?{'message':_0x4b57('0x74'),'statusCode':_0x4e4bbd[_0x4b57('0x71')]}:_0x4e4bbd);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 76a117b..918def2 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 _0xf698=['bluebird','request-promise','rimraf','../../components/integrations/configuration','int_zendesk_accounts','lodash','util','api','moment'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xf698,0x152));var _0x8f69=function(_0x2ddfd9,_0x5877d0){_0x2ddfd9=_0x2ddfd9-0x0;var _0x2668f0=_0xf698[_0x2ddfd9];return _0x2668f0;};'use strict';var _=require(_0x8f69('0x0'));var util=require(_0x8f69('0x1'));var logger=require('../../config/logger')(_0x8f69('0x2'));var moment=require(_0x8f69('0x3'));var BPromise=require(_0x8f69('0x4'));var rp=require(_0x8f69('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8f69('0x6'));var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x8f69('0x7'));module['exports']=function(_0x49cce9,_0xc838b4){return _0x49cce9['define']('ZendeskAccount',attributes,{'tableName':_0x8f69('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe1f5=['bluebird','request-promise','path','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','lodash','util','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe1f5,0x1ec));var _0x5e1f=function(_0x1915df,_0x29d17e){_0x1915df=_0x1915df-0x0;var _0x52df2d=_0xe1f5[_0x1915df];return _0x52df2d;};'use strict';var _=require(_0x5e1f('0x0'));var util=require(_0x5e1f('0x1'));var logger=require('../../config/logger')(_0x5e1f('0x2'));var moment=require('moment');var BPromise=require(_0x5e1f('0x3'));var rp=require(_0x5e1f('0x4'));var fs=require('fs');var path=require(_0x5e1f('0x5'));var rimraf=require(_0x5e1f('0x6'));var config=require('../../config/environment');var attributes=require(_0x5e1f('0x7'));var integrations=require(_0x5e1f('0x8'));module[_0x5e1f('0x9')]=function(_0x22b521,_0x2e87a5){return _0x22b521[_0x5e1f('0xa')]('ZendeskAccount',attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 596233b..14343f4 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 _0xb27f=['../../config/environment','jayson/promise','client','http','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','GetZendeskAccount','catch','ShowZendeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x1b8fdd,_0x1463b8){var _0xa71c7e=function(_0x216694){while(--_0x216694){_0x1b8fdd['push'](_0x1b8fdd['shift']());}};_0xa71c7e(++_0x1463b8);}(_0xb27f,0x67));var _0xfb27=function(_0x32fca6,_0x64e615){_0x32fca6=_0x32fca6-0x0;var _0x4ffd3d=_0xb27f[_0x32fca6];return _0x4ffd3d;};'use strict';var _=require(_0xfb27('0x0'));var util=require(_0xfb27('0x1'));var moment=require(_0xfb27('0x2'));var BPromise=require(_0xfb27('0x3'));var rs=require(_0xfb27('0x4'));var fs=require('fs');var Redis=require(_0xfb27('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfb27('0x6'));var logger=require(_0xfb27('0x7'))('rpc');var config=require(_0xfb27('0x8'));var jayson=require(_0xfb27('0x9'));var client=jayson[_0xfb27('0xa')][_0xfb27('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x106cb1,_0x178a5a,_0x530352){return new BPromise(function(_0x5ff9be,_0x4d7281){return client['request'](_0x106cb1,_0x530352)[_0xfb27('0xc')](function(_0x442e87){logger['info'](_0xfb27('0xd'),_0x178a5a,_0xfb27('0xe'));logger['debug'](_0xfb27('0xf'),_0x178a5a,_0xfb27('0xe'),JSON[_0xfb27('0x10')](_0x442e87));if(_0x442e87[_0xfb27('0x11')]){if(_0x442e87[_0xfb27('0x11')][_0xfb27('0x12')]===0x1f4){logger[_0xfb27('0x11')](_0xfb27('0xd'),_0x178a5a,_0x442e87['error']['message']);return _0x4d7281(_0x442e87[_0xfb27('0x11')][_0xfb27('0x13')]);}logger[_0xfb27('0x11')](_0xfb27('0xd'),_0x178a5a,_0x442e87[_0xfb27('0x11')]['message']);return _0x5ff9be(_0x442e87[_0xfb27('0x11')][_0xfb27('0x13')]);}else{logger[_0xfb27('0x14')](_0xfb27('0xd'),_0x178a5a,_0xfb27('0xe'));_0x5ff9be(_0x442e87[_0xfb27('0x15')]['message']);}})['catch'](function(_0x2546e0){logger[_0xfb27('0x11')](_0xfb27('0xd'),_0x178a5a,_0x2546e0);_0x4d7281(_0x2546e0);});});}exports['GetZendeskAccount']=function(_0x31fe39){var _0x5b93d8=this;return new Promise(function(_0x6274d7,_0xdcabac){return db[_0xfb27('0x16')][_0xfb27('0x17')]({'raw':_0x31fe39[_0xfb27('0x18')]?_0x31fe39[_0xfb27('0x18')][_0xfb27('0x19')]===undefined?!![]:![]:!![],'where':_0x31fe39[_0xfb27('0x18')]?_0x31fe39[_0xfb27('0x18')][_0xfb27('0x1a')]||null:null,'attributes':_0x31fe39[_0xfb27('0x18')]?_0x31fe39[_0xfb27('0x18')][_0xfb27('0x1b')]||null:null,'limit':_0x31fe39['options']?_0x31fe39[_0xfb27('0x18')][_0xfb27('0x1c')]||null:null,'include':_0x31fe39['options']?_0x31fe39['options'][_0xfb27('0x1d')]?_[_0xfb27('0x1e')](_0x31fe39[_0xfb27('0x18')][_0xfb27('0x1d')],function(_0xac56a){return{'model':db[_0xac56a[_0xfb27('0x1f')]],'as':_0xac56a['as'],'attributes':_0xac56a['attributes'],'include':_0xac56a[_0xfb27('0x1d')]?_[_0xfb27('0x1e')](_0xac56a[_0xfb27('0x1d')],function(_0x5b732c){return{'model':db[_0x5b732c['model']],'as':_0x5b732c['as'],'attributes':_0x5b732c[_0xfb27('0x1b')],'include':_0x5b732c[_0xfb27('0x1d')]?_[_0xfb27('0x1e')](_0x5b732c[_0xfb27('0x1d')],function(_0x4720ed){return{'model':db[_0x4720ed['model']],'as':_0x4720ed['as'],'attributes':_0x4720ed[_0xfb27('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xfb27('0xc')](function(_0x1ab0c8){logger[_0xfb27('0x14')]('GetZendeskAccount',_0x31fe39);logger[_0xfb27('0x20')](_0xfb27('0x21'),_0x31fe39,JSON[_0xfb27('0x10')](_0x1ab0c8));_0x6274d7(_0x1ab0c8);})[_0xfb27('0x22')](function(_0x50f4c5){logger[_0xfb27('0x11')](_0xfb27('0x21'),_0x50f4c5[_0xfb27('0x13')],_0x31fe39);_0xdcabac(_0x5b93d8['error'](0x1f4,_0x50f4c5['message']));});});};exports[_0xfb27('0x23')]=function(_0x5d930f){var _0x5359c2=this;return new Promise(function(_0x4839d8,_0x49d7ee){return db[_0xfb27('0x16')][_0xfb27('0x24')]({'raw':_0x5d930f['options']?_0x5d930f[_0xfb27('0x18')][_0xfb27('0x19')]===undefined?!![]:![]:!![],'where':_0x5d930f[_0xfb27('0x18')]?_0x5d930f[_0xfb27('0x18')][_0xfb27('0x1a')]||null:null,'attributes':_0x5d930f[_0xfb27('0x18')]?_0x5d930f['options'][_0xfb27('0x1b')]||null:null,'include':_0x5d930f[_0xfb27('0x18')]?_0x5d930f[_0xfb27('0x18')][_0xfb27('0x1d')]?_[_0xfb27('0x1e')](_0x5d930f[_0xfb27('0x18')][_0xfb27('0x1d')],function(_0x3f2163){return{'model':db[_0x3f2163[_0xfb27('0x1f')]],'as':_0x3f2163['as'],'attributes':_0x3f2163[_0xfb27('0x1b')],'include':_0x3f2163[_0xfb27('0x1d')]?_[_0xfb27('0x1e')](_0x3f2163[_0xfb27('0x1d')],function(_0x613754){return{'model':db[_0x613754[_0xfb27('0x1f')]],'as':_0x613754['as'],'attributes':_0x613754[_0xfb27('0x1b')],'include':_0x613754[_0xfb27('0x1d')]?_[_0xfb27('0x1e')](_0x613754[_0xfb27('0x1d')],function(_0x2a4c65){return{'model':db[_0x2a4c65[_0xfb27('0x1f')]],'as':_0x2a4c65['as'],'attributes':_0x2a4c65[_0xfb27('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xfb27('0xc')](function(_0x1ddf78){logger[_0xfb27('0x14')]('ShowZendeskAccount',_0x5d930f);logger[_0xfb27('0x20')](_0xfb27('0x23'),_0x5d930f,JSON['stringify'](_0x1ddf78));_0x4839d8(_0x1ddf78);})[_0xfb27('0x22')](function(_0x4efbd4){logger[_0xfb27('0x11')]('ShowZendeskAccount',_0x4efbd4[_0xfb27('0x13')],_0x5d930f);_0x49d7ee(_0x5359c2[_0xfb27('0x11')](0x1f4,_0x4efbd4[_0xfb27('0x13')]));});});}; \ No newline at end of file +var _0x1b31=['debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetZendeskAccount','ZendeskAccount','findAll','raw','options','where','attributes','limit','include','map','ShowZendeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x3a6e4b,_0x118cd9){var _0x36572d=function(_0x2a53cf){while(--_0x2a53cf){_0x3a6e4b['push'](_0x3a6e4b['shift']());}};_0x36572d(++_0x118cd9);}(_0x1b31,0x7e));var _0x11b3=function(_0x49259d,_0x19c3a2){_0x49259d=_0x49259d-0x0;var _0x45d0bf=_0x1b31[_0x49259d];return _0x45d0bf;};'use strict';var _=require(_0x11b3('0x0'));var util=require(_0x11b3('0x1'));var moment=require(_0x11b3('0x2'));var BPromise=require(_0x11b3('0x3'));var rs=require(_0x11b3('0x4'));var fs=require('fs');var Redis=require(_0x11b3('0x5'));var db=require(_0x11b3('0x6'))['db'];var utils=require(_0x11b3('0x7'));var logger=require(_0x11b3('0x8'))('rpc');var config=require(_0x11b3('0x9'));var jayson=require(_0x11b3('0xa'));var client=jayson[_0x11b3('0xb')][_0x11b3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x25a144,_0x447bdf,_0x4eae9a){return new BPromise(function(_0x197e87,_0x4d8ccc){return client[_0x11b3('0xd')](_0x25a144,_0x4eae9a)[_0x11b3('0xe')](function(_0x566a38){logger[_0x11b3('0xf')](_0x11b3('0x10'),_0x447bdf,_0x11b3('0x11'));logger[_0x11b3('0x12')](_0x11b3('0x13'),_0x447bdf,_0x11b3('0x11'),JSON[_0x11b3('0x14')](_0x566a38));if(_0x566a38[_0x11b3('0x15')]){if(_0x566a38[_0x11b3('0x15')]['code']===0x1f4){logger[_0x11b3('0x15')]('ZendeskAccount,\x20%s,\x20%s',_0x447bdf,_0x566a38[_0x11b3('0x15')][_0x11b3('0x16')]);return _0x4d8ccc(_0x566a38[_0x11b3('0x15')][_0x11b3('0x16')]);}logger[_0x11b3('0x15')]('ZendeskAccount,\x20%s,\x20%s',_0x447bdf,_0x566a38[_0x11b3('0x15')]['message']);return _0x197e87(_0x566a38[_0x11b3('0x15')]['message']);}else{logger[_0x11b3('0xf')](_0x11b3('0x10'),_0x447bdf,_0x11b3('0x11'));_0x197e87(_0x566a38['result'][_0x11b3('0x16')]);}})[_0x11b3('0x17')](function(_0x4cd619){logger['error'](_0x11b3('0x10'),_0x447bdf,_0x4cd619);_0x4d8ccc(_0x4cd619);});});}exports[_0x11b3('0x18')]=function(_0x51ecd8){var _0x29ac14=this;return new Promise(function(_0x28b16d,_0x3a5f5b){return db[_0x11b3('0x19')][_0x11b3('0x1a')]({'raw':_0x51ecd8['options']?_0x51ecd8['options'][_0x11b3('0x1b')]===undefined?!![]:![]:!![],'where':_0x51ecd8[_0x11b3('0x1c')]?_0x51ecd8['options'][_0x11b3('0x1d')]||null:null,'attributes':_0x51ecd8[_0x11b3('0x1c')]?_0x51ecd8[_0x11b3('0x1c')][_0x11b3('0x1e')]||null:null,'limit':_0x51ecd8[_0x11b3('0x1c')]?_0x51ecd8[_0x11b3('0x1c')][_0x11b3('0x1f')]||null:null,'include':_0x51ecd8[_0x11b3('0x1c')]?_0x51ecd8['options'][_0x11b3('0x20')]?_['map'](_0x51ecd8['options'][_0x11b3('0x20')],function(_0x5e6271){return{'model':db[_0x5e6271['model']],'as':_0x5e6271['as'],'attributes':_0x5e6271[_0x11b3('0x1e')],'include':_0x5e6271[_0x11b3('0x20')]?_[_0x11b3('0x21')](_0x5e6271['include'],function(_0x37a68c){return{'model':db[_0x37a68c['model']],'as':_0x37a68c['as'],'attributes':_0x37a68c[_0x11b3('0x1e')],'include':_0x37a68c[_0x11b3('0x20')]?_[_0x11b3('0x21')](_0x37a68c[_0x11b3('0x20')],function(_0x5e3b71){return{'model':db[_0x5e3b71['model']],'as':_0x5e3b71['as'],'attributes':_0x5e3b71['attributes']};}):[]};}):[]};}):[]:[]})[_0x11b3('0xe')](function(_0x5de012){logger[_0x11b3('0xf')]('GetZendeskAccount',_0x51ecd8);logger[_0x11b3('0x12')](_0x11b3('0x18'),_0x51ecd8,JSON[_0x11b3('0x14')](_0x5de012));_0x28b16d(_0x5de012);})[_0x11b3('0x17')](function(_0x2f1ac6){logger[_0x11b3('0x15')](_0x11b3('0x18'),_0x2f1ac6[_0x11b3('0x16')],_0x51ecd8);_0x3a5f5b(_0x29ac14[_0x11b3('0x15')](0x1f4,_0x2f1ac6['message']));});});};exports[_0x11b3('0x22')]=function(_0x41a8e9){var _0x1766dc=this;return new Promise(function(_0x23e098,_0x172e61){return db[_0x11b3('0x19')][_0x11b3('0x23')]({'raw':_0x41a8e9[_0x11b3('0x1c')]?_0x41a8e9[_0x11b3('0x1c')][_0x11b3('0x1b')]===undefined?!![]:![]:!![],'where':_0x41a8e9[_0x11b3('0x1c')]?_0x41a8e9[_0x11b3('0x1c')][_0x11b3('0x1d')]||null:null,'attributes':_0x41a8e9[_0x11b3('0x1c')]?_0x41a8e9[_0x11b3('0x1c')][_0x11b3('0x1e')]||null:null,'include':_0x41a8e9[_0x11b3('0x1c')]?_0x41a8e9['options'][_0x11b3('0x20')]?_[_0x11b3('0x21')](_0x41a8e9['options'][_0x11b3('0x20')],function(_0x1a979a){return{'model':db[_0x1a979a['model']],'as':_0x1a979a['as'],'attributes':_0x1a979a[_0x11b3('0x1e')],'include':_0x1a979a[_0x11b3('0x20')]?_[_0x11b3('0x21')](_0x1a979a['include'],function(_0x38df74){return{'model':db[_0x38df74['model']],'as':_0x38df74['as'],'attributes':_0x38df74[_0x11b3('0x1e')],'include':_0x38df74[_0x11b3('0x20')]?_['map'](_0x38df74['include'],function(_0x52aba9){return{'model':db[_0x52aba9['model']],'as':_0x52aba9['as'],'attributes':_0x52aba9[_0x11b3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x11b3('0xe')](function(_0x2bb3e4){logger[_0x11b3('0xf')](_0x11b3('0x22'),_0x41a8e9);logger[_0x11b3('0x12')](_0x11b3('0x22'),_0x41a8e9,JSON[_0x11b3('0x14')](_0x2bb3e4));_0x23e098(_0x2bb3e4);})['catch'](function(_0x1215e7){logger['error']('ShowZendeskAccount',_0x1215e7['message'],_0x41a8e9);_0x172e61(_0x1766dc[_0x11b3('0x15')](0x1f4,_0x1215e7[_0x11b3('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 51d3300..36e27f9 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 _0x0bb5=['put','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags'];(function(_0xc01695,_0x503a33){var _0x523c1f=function(_0x34d1f8){while(--_0x34d1f8){_0xc01695['push'](_0xc01695['shift']());}};_0x523c1f(++_0x503a33);}(_0x0bb5,0x148));var _0x50bb=function(_0x3aca70,_0x22cc90){_0x3aca70=_0x3aca70-0x0;var _0x2f431d=_0x0bb5[_0x3aca70];return _0x2f431d;};'use strict';var multer=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50bb('0x2'));var router=express[_0x50bb('0x3')]();var fs_extra=require(_0x50bb('0x4'));var auth=require(_0x50bb('0x5'));var interaction=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var controller=require(_0x50bb('0x8'));router[_0x50bb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x50bb('0x9')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0xc')]);router['get']('/:id/fields',auth[_0x50bb('0xb')](),controller[_0x50bb('0xd')]);router[_0x50bb('0x9')](_0x50bb('0xe'),auth['isAuthenticated'](),controller[_0x50bb('0xf')]);router[_0x50bb('0x9')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x11')]);router[_0x50bb('0x9')](_0x50bb('0x12'),auth['isAuthenticated'](),controller[_0x50bb('0x13')]);router['post']('/',auth[_0x50bb('0xb')](),controller[_0x50bb('0x14')]);router[_0x50bb('0x15')]('/:id/tags',auth[_0x50bb('0xb')](),controller[_0x50bb('0x16')]);router[_0x50bb('0x17')]('/:id',auth[_0x50bb('0xb')](),controller['update']);router[_0x50bb('0x18')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x19')]);module[_0x50bb('0x1a')]=router; \ No newline at end of file +var _0xbdb7=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','index','get','show','getFields','/:id/subjects','isAuthenticated','getSubjects','/:id/descriptions','getTags','/:id/tags','update','delete','/:id'];(function(_0x5ce15c,_0x19c917){var _0x36e4f5=function(_0x50fa90){while(--_0x50fa90){_0x5ce15c['push'](_0x5ce15c['shift']());}};_0x36e4f5(++_0x19c917);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x2baca1,_0x2f3557){_0x2baca1=_0x2baca1-0x0;var _0x9aa62a=_0xbdb7[_0x2baca1];return _0x9aa62a;};'use strict';var multer=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var path=require(_0x7bdb('0x2'));var timeout=require(_0x7bdb('0x3'));var express=require(_0x7bdb('0x4'));var router=express[_0x7bdb('0x5')]();var fs_extra=require(_0x7bdb('0x6'));var auth=require(_0x7bdb('0x7'));var interaction=require(_0x7bdb('0x8'));var config=require('../../config/environment');var controller=require(_0x7bdb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7bdb('0xa')]);router[_0x7bdb('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0xc')]);router[_0x7bdb('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0x7bdb('0xd')]);router[_0x7bdb('0xb')](_0x7bdb('0xe'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x10')]);router[_0x7bdb('0xb')](_0x7bdb('0x11'),auth[_0x7bdb('0xf')](),controller['getDescriptions']);router['get']('/:id/tags',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x12')]);router['post']('/',auth[_0x7bdb('0xf')](),controller['create']);router['post'](_0x7bdb('0x13'),auth[_0x7bdb('0xf')](),controller['setTags']);router['put']('/:id',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x14')]);router[_0x7bdb('0x15')](_0x7bdb('0x16'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x17')]);module[_0x7bdb('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 9efdc49..645a9e9 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 _0x6874=['sequelize','STRING'];(function(_0x4704fc,_0x1f93c8){var _0x316e4b=function(_0x558a39){while(--_0x558a39){_0x4704fc['push'](_0x4704fc['shift']());}};_0x316e4b(++_0x1f93c8);}(_0x6874,0xca));var _0x4687=function(_0x543460,_0x2c3426){_0x543460=_0x543460-0x0;var _0x1a8fc9=_0x6874[_0x543460];return _0x1a8fc9;};'use strict';var Sequelize=require(_0x4687('0x0'));module['exports']={'name':{'type':Sequelize[_0x4687('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfd12=['exports','STRING','sequelize'];(function(_0x42d2af,_0x3961b5){var _0x1d6d63=function(_0x10833e){while(--_0x10833e){_0x42d2af['push'](_0x42d2af['shift']());}};_0x1d6d63(++_0x3961b5);}(_0xfd12,0x176));var _0x2fd1=function(_0x48999d,_0x1e02cb){_0x48999d=_0x48999d-0x0;var _0x1ad0d1=_0xfd12[_0x48999d];return _0x1ad0d1;};'use strict';var Sequelize=require(_0x2fd1('0x0'));module[_0x2fd1('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2fd1('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index f8cd17c..d47af84 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 _0x82e1=['model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','create','body','catch','findOne','ZendeskField','length','order','getFields','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','limit','undefined','count','offset','set','json','apply','reject','update','then','destroy','end','error','name','send','map','ZendeskConfiguration','fieldName','type','key','query','intersection'];(function(_0x25fe32,_0x4c294c){var _0x4e8aa7=function(_0x11b3f1){while(--_0x11b3f1){_0x25fe32['push'](_0x25fe32['shift']());}};_0x4e8aa7(++_0x4c294c);}(_0x82e1,0xcb));var _0x182e=function(_0x39f9f2,_0x37fc06){_0x39f9f2=_0x39f9f2-0x0;var _0x3febf8=_0x82e1[_0x39f9f2];return _0x3febf8;};'use strict';var emlformat=require(_0x182e('0x0'));var rimraf=require(_0x182e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x182e('0x2'));var rp=require(_0x182e('0x3'));var moment=require(_0x182e('0x4'));var BPromise=require(_0x182e('0x5'));var Mustache=require(_0x182e('0x6'));var util=require(_0x182e('0x7'));var path=require('path');var sox=require(_0x182e('0x8'));var csv=require(_0x182e('0x9'));var ejs=require(_0x182e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x182e('0xb'));var squel=require(_0x182e('0xc'));var crypto=require(_0x182e('0xd'));var jsforce=require(_0x182e('0xe'));var deskjs=require(_0x182e('0xf'));var toCsv=require(_0x182e('0x9'));var querystring=require('querystring');var Papa=require(_0x182e('0x10'));var Redis=require('ioredis');var authService=require(_0x182e('0x11'));var qs=require(_0x182e('0x12'));var as=require(_0x182e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x182e('0x14'))('api');var utils=require(_0x182e('0x15'));var config=require(_0x182e('0x16'));var licenseUtil=require(_0x182e('0x17'));var db=require(_0x182e('0x18'))['db'];function respondWithStatusCode(_0x5e70c9,_0x15a9d5){_0x15a9d5=_0x15a9d5||0xcc;return function(_0xc1c61c){if(_0xc1c61c){return _0x5e70c9[_0x182e('0x19')](_0x15a9d5);}return _0x5e70c9[_0x182e('0x1a')](_0x15a9d5)['end']();};}function respondWithResult(_0x1b1bf0,_0x53bb5e){_0x53bb5e=_0x53bb5e||0xc8;return function(_0x2c2b59){if(_0x2c2b59){return _0x1b1bf0[_0x182e('0x1a')](_0x53bb5e)['json'](_0x2c2b59);}};}function respondWithFilteredResult(_0xd1b5e1,_0x238c72){return function(_0xeecf74){if(_0xeecf74){var _0x505cea=typeof _0x238c72['offset']==='undefined'&&typeof _0x238c72[_0x182e('0x1b')]===_0x182e('0x1c');var _0x2a951b=_0xeecf74[_0x182e('0x1d')];var _0x174c81=_0x505cea?0x0:_0x238c72[_0x182e('0x1e')];var _0x45508c=_0x505cea?_0xeecf74[_0x182e('0x1d')]:_0x238c72[_0x182e('0x1e')]+_0x238c72['limit'];var _0x11f356;if(_0x45508c>=_0x2a951b){_0x45508c=_0x2a951b;_0x11f356=0xc8;}else{_0x11f356=0xce;}_0xd1b5e1[_0x182e('0x1a')](_0x11f356);return _0xd1b5e1[_0x182e('0x1f')]('Content-Range',_0x174c81+'-'+_0x45508c+'/'+_0x2a951b)[_0x182e('0x20')](_0xeecf74);}return null;};}function patchUpdates(_0x5735c3){return function(_0x121b8e){try{jsonpatch[_0x182e('0x21')](_0x121b8e,_0x5735c3,!![]);}catch(_0x5bfeeb){return BPromise[_0x182e('0x22')](_0x5bfeeb);}return _0x121b8e['save']();};}function saveUpdates(_0x36b5d1,_0x140522){return function(_0x135b5e){if(_0x135b5e){return _0x135b5e[_0x182e('0x23')](_0x36b5d1)[_0x182e('0x24')](function(_0x2ad5ac){return _0x2ad5ac;});}return null;};}function removeEntity(_0x2bb511,_0x47bfb6){return function(_0x444b6e){if(_0x444b6e){return _0x444b6e[_0x182e('0x25')]()['then'](function(){_0x2bb511[_0x182e('0x1a')](0xcc)[_0x182e('0x26')]();});}};}function handleEntityNotFound(_0x4838da,_0x32e1a2){return function(_0x5c96ec){if(!_0x5c96ec){_0x4838da[_0x182e('0x19')](0x194);}return _0x5c96ec;};}function handleError(_0x15145c,_0x36e9f1){_0x36e9f1=_0x36e9f1||0x1f4;return function(_0x5a4945){logger[_0x182e('0x27')](_0x5a4945['stack']);if(_0x5a4945[_0x182e('0x28')]){delete _0x5a4945[_0x182e('0x28')];}_0x15145c[_0x182e('0x1a')](_0x36e9f1)[_0x182e('0x29')](_0x5a4945);};}exports['index']=function(_0x171928,_0x103f15){var _0x7ce94a={},_0x48e36c={},_0x5e5c17={'count':0x0,'rows':[]};var _0x3f456f=_[_0x182e('0x2a')](db[_0x182e('0x2b')]['rawAttributes'],function(_0x17ad65){return{'name':_0x17ad65[_0x182e('0x2c')],'type':_0x17ad65[_0x182e('0x2d')][_0x182e('0x2e')]};});_0x48e36c['model']=_[_0x182e('0x2a')](_0x3f456f,_0x182e('0x28'));_0x48e36c[_0x182e('0x2f')]=_['keys'](_0x171928['query']);_0x48e36c['filters']=_[_0x182e('0x30')](_0x48e36c[_0x182e('0x31')],_0x48e36c[_0x182e('0x2f')]);_0x7ce94a[_0x182e('0x32')]=_['intersection'](_0x48e36c[_0x182e('0x31')],qs['fields'](_0x171928[_0x182e('0x2f')][_0x182e('0x33')]));_0x7ce94a[_0x182e('0x32')]=_0x7ce94a[_0x182e('0x32')]['length']?_0x7ce94a[_0x182e('0x32')]:_0x48e36c[_0x182e('0x31')];if(!_0x171928['query'][_0x182e('0x34')](_0x182e('0x35'))){_0x7ce94a[_0x182e('0x1b')]=qs[_0x182e('0x1b')](_0x171928[_0x182e('0x2f')][_0x182e('0x1b')]);_0x7ce94a[_0x182e('0x1e')]=qs['offset'](_0x171928[_0x182e('0x2f')][_0x182e('0x1e')]);}_0x7ce94a['order']=qs['sort'](_0x171928[_0x182e('0x2f')][_0x182e('0x36')]);_0x7ce94a[_0x182e('0x37')]=qs['filters'](_[_0x182e('0x38')](_0x171928[_0x182e('0x2f')],_0x48e36c[_0x182e('0x39')]),_0x3f456f);if(_0x171928[_0x182e('0x2f')][_0x182e('0x3a')]){_0x7ce94a[_0x182e('0x37')]=_[_0x182e('0x3b')](_0x7ce94a[_0x182e('0x37')],{'$or':_[_0x182e('0x2a')](_0x3f456f,function(_0x24e770){if(_0x24e770['type']!==_0x182e('0x3c')){var _0x3e1fa1={};_0x3e1fa1[_0x24e770['name']]={'$like':'%'+_0x171928['query'][_0x182e('0x3a')]+'%'};return _0x3e1fa1;}})});}_0x7ce94a=_[_0x182e('0x3b')]({},_0x7ce94a,_0x171928[_0x182e('0x3d')]);var _0x3f5c4f={'where':_0x7ce94a['where']};return db[_0x182e('0x2b')][_0x182e('0x1d')](_0x3f5c4f)[_0x182e('0x24')](function(_0x57298e){_0x5e5c17['count']=_0x57298e;if(_0x171928[_0x182e('0x2f')]['includeAll']){_0x7ce94a[_0x182e('0x3e')]=[{'all':!![]}];}return db[_0x182e('0x2b')][_0x182e('0x3f')](_0x7ce94a);})['then'](function(_0x4db3bc){_0x5e5c17[_0x182e('0x40')]=_0x4db3bc;return _0x5e5c17;})[_0x182e('0x24')](respondWithFilteredResult(_0x103f15,_0x7ce94a))['catch'](handleError(_0x103f15,null));};exports[_0x182e('0x41')]=function(_0x3baca7,_0x1355ad){var _0x52310b={'raw':![],'where':{'id':_0x3baca7[_0x182e('0x42')]['id']}},_0x448edb={};_0x448edb[_0x182e('0x31')]=_[_0x182e('0x43')](db[_0x182e('0x2b')][_0x182e('0x44')]);_0x448edb[_0x182e('0x2f')]=_[_0x182e('0x43')](_0x3baca7[_0x182e('0x2f')]);_0x448edb['filters']=_[_0x182e('0x30')](_0x448edb['model'],_0x448edb[_0x182e('0x2f')]);_0x52310b[_0x182e('0x32')]=_['intersection'](_0x448edb[_0x182e('0x31')],qs[_0x182e('0x33')](_0x3baca7[_0x182e('0x2f')][_0x182e('0x33')]));_0x52310b[_0x182e('0x32')]=_0x52310b[_0x182e('0x32')]['length']?_0x52310b[_0x182e('0x32')]:_0x448edb['model'];if(_0x3baca7['query'][_0x182e('0x45')]){_0x52310b[_0x182e('0x3e')]=[{'all':!![]}];}_0x52310b=_[_0x182e('0x3b')]({},_0x52310b,_0x3baca7['options']);return db[_0x182e('0x2b')][_0x182e('0x46')](_0x52310b)[_0x182e('0x24')](handleEntityNotFound(_0x1355ad,null))[_0x182e('0x24')](respondWithResult(_0x1355ad,null))['catch'](handleError(_0x1355ad,null));};exports[_0x182e('0x47')]=function(_0x1647c4,_0x16a09a){return db['ZendeskConfiguration']['create'](_0x1647c4[_0x182e('0x48')],{})['then'](respondWithResult(_0x16a09a,0xc9))['catch'](handleError(_0x16a09a,null));};exports[_0x182e('0x23')]=function(_0x2066ce,_0x215496){if(_0x2066ce['body']['id']){delete _0x2066ce[_0x182e('0x48')]['id'];}return db[_0x182e('0x2b')]['find']({'where':{'id':_0x2066ce[_0x182e('0x42')]['id']}})[_0x182e('0x24')](handleEntityNotFound(_0x215496,null))['then'](saveUpdates(_0x2066ce[_0x182e('0x48')],null))[_0x182e('0x24')](respondWithResult(_0x215496,null))['catch'](handleError(_0x215496,null));};exports[_0x182e('0x25')]=function(_0x786088,_0x2451e7){return db[_0x182e('0x2b')][_0x182e('0x46')]({'where':{'id':_0x786088[_0x182e('0x42')]['id']}})[_0x182e('0x24')](handleEntityNotFound(_0x2451e7,null))[_0x182e('0x24')](removeEntity(_0x2451e7,null))[_0x182e('0x49')](handleError(_0x2451e7,null));};exports['getFields']=function(_0x6fbadb,_0x33be50,_0x197681){var _0x9de4dc={};var _0x34aabd={};var _0x4be7a9;var _0x30defa;return db[_0x182e('0x2b')][_0x182e('0x4a')]({'where':{'id':_0x6fbadb[_0x182e('0x42')]['id']}})[_0x182e('0x24')](handleEntityNotFound(_0x33be50,null))[_0x182e('0x24')](function(_0x66d3c1){if(_0x66d3c1){_0x4be7a9=_0x66d3c1;_0x34aabd[_0x182e('0x31')]=_[_0x182e('0x43')](db[_0x182e('0x4b')][_0x182e('0x44')]);_0x34aabd[_0x182e('0x2f')]=_[_0x182e('0x43')](_0x6fbadb[_0x182e('0x2f')]);_0x34aabd['filters']=_[_0x182e('0x30')](_0x34aabd[_0x182e('0x31')],_0x34aabd[_0x182e('0x2f')]);_0x9de4dc['attributes']=_[_0x182e('0x30')](_0x34aabd[_0x182e('0x31')],qs[_0x182e('0x33')](_0x6fbadb[_0x182e('0x2f')]['fields']));_0x9de4dc[_0x182e('0x32')]=_0x9de4dc[_0x182e('0x32')][_0x182e('0x4c')]?_0x9de4dc['attributes']:_0x34aabd[_0x182e('0x31')];_0x9de4dc[_0x182e('0x4d')]=qs[_0x182e('0x36')](_0x6fbadb[_0x182e('0x2f')][_0x182e('0x36')]);_0x9de4dc[_0x182e('0x37')]=qs[_0x182e('0x39')](_[_0x182e('0x38')](_0x6fbadb[_0x182e('0x2f')],_0x34aabd['filters']));if(_0x6fbadb[_0x182e('0x2f')]['filter']){_0x9de4dc[_0x182e('0x37')]=_['merge'](_0x9de4dc[_0x182e('0x37')],{'$or':_[_0x182e('0x2a')](_0x9de4dc[_0x182e('0x32')],function(_0x41df17){var _0x42c9a6={};_0x42c9a6[_0x41df17]={'$like':'%'+_0x6fbadb[_0x182e('0x2f')][_0x182e('0x3a')]+'%'};return _0x42c9a6;})});}_0x9de4dc=_[_0x182e('0x3b')]({},_0x9de4dc,_0x6fbadb['options']);return _0x4be7a9[_0x182e('0x4e')](_0x9de4dc);}})['then'](function(_0x5d0cb8){if(_0x5d0cb8){_0x30defa=_0x5d0cb8['length'];if(!_0x6fbadb['query'][_0x182e('0x34')]('nolimit')){_0x9de4dc['limit']=qs['limit'](_0x6fbadb[_0x182e('0x2f')][_0x182e('0x1b')]);_0x9de4dc['offset']=qs[_0x182e('0x1e')](_0x6fbadb['query']['offset']);}return _0x4be7a9['getFields'](_0x9de4dc);}})['then'](function(_0x5d78af){if(_0x5d78af){return _0x5d78af?{'count':_0x30defa,'rows':_0x5d78af}:null;}})[_0x182e('0x24')](respondWithResult(_0x33be50,null))[_0x182e('0x49')](handleError(_0x33be50,null));};exports[_0x182e('0x4f')]=function(_0x14ff5e,_0x5d0c7a,_0x3dca9f){var _0x5d62a4={};var _0x49a6b6={};var _0x419952;var _0x4836b0;return db[_0x182e('0x2b')][_0x182e('0x4a')]({'where':{'id':_0x14ff5e[_0x182e('0x42')]['id']}})[_0x182e('0x24')](handleEntityNotFound(_0x5d0c7a,null))[_0x182e('0x24')](function(_0x35bf6b){if(_0x35bf6b){_0x419952=_0x35bf6b;_0x49a6b6[_0x182e('0x31')]=_['keys'](db[_0x182e('0x4b')][_0x182e('0x44')]);_0x49a6b6[_0x182e('0x2f')]=_[_0x182e('0x43')](_0x14ff5e['query']);_0x49a6b6[_0x182e('0x39')]=_['intersection'](_0x49a6b6[_0x182e('0x31')],_0x49a6b6[_0x182e('0x2f')]);_0x5d62a4['attributes']=_['intersection'](_0x49a6b6[_0x182e('0x31')],qs[_0x182e('0x33')](_0x14ff5e[_0x182e('0x2f')][_0x182e('0x33')]));_0x5d62a4[_0x182e('0x32')]=_0x5d62a4[_0x182e('0x32')][_0x182e('0x4c')]?_0x5d62a4[_0x182e('0x32')]:_0x49a6b6[_0x182e('0x31')];_0x5d62a4[_0x182e('0x4d')]=qs[_0x182e('0x36')](_0x14ff5e[_0x182e('0x2f')][_0x182e('0x36')]);_0x5d62a4[_0x182e('0x37')]=qs[_0x182e('0x39')](_[_0x182e('0x38')](_0x14ff5e[_0x182e('0x2f')],_0x49a6b6[_0x182e('0x39')]));if(_0x14ff5e[_0x182e('0x2f')][_0x182e('0x3a')]){_0x5d62a4[_0x182e('0x37')]=_[_0x182e('0x3b')](_0x5d62a4[_0x182e('0x37')],{'$or':_[_0x182e('0x2a')](_0x5d62a4['attributes'],function(_0x5d00d0){var _0x5ceae0={};_0x5ceae0[_0x5d00d0]={'$like':'%'+_0x14ff5e[_0x182e('0x2f')][_0x182e('0x3a')]+'%'};return _0x5ceae0;})});}_0x5d62a4=_[_0x182e('0x3b')]({},_0x5d62a4,_0x14ff5e[_0x182e('0x3d')]);return _0x419952[_0x182e('0x4f')](_0x5d62a4);}})[_0x182e('0x24')](function(_0x1f8e10){if(_0x1f8e10){_0x4836b0=_0x1f8e10[_0x182e('0x4c')];if(!_0x14ff5e[_0x182e('0x2f')][_0x182e('0x34')](_0x182e('0x35'))){_0x5d62a4[_0x182e('0x1b')]=qs[_0x182e('0x1b')](_0x14ff5e[_0x182e('0x2f')][_0x182e('0x1b')]);_0x5d62a4[_0x182e('0x1e')]=qs[_0x182e('0x1e')](_0x14ff5e[_0x182e('0x2f')]['offset']);}return _0x419952[_0x182e('0x4f')](_0x5d62a4);}})['then'](function(_0x4baa51){if(_0x4baa51){return _0x4baa51?{'count':_0x4836b0,'rows':_0x4baa51}:null;}})['then'](respondWithResult(_0x5d0c7a,null))[_0x182e('0x49')](handleError(_0x5d0c7a,null));};exports[_0x182e('0x50')]=function(_0x276c35,_0x332217,_0x240887){var _0x46db36={};var _0x476589={};var _0x2a099f;var _0x53e759;return db[_0x182e('0x2b')][_0x182e('0x4a')]({'where':{'id':_0x276c35[_0x182e('0x42')]['id']}})[_0x182e('0x24')](handleEntityNotFound(_0x332217,null))[_0x182e('0x24')](function(_0x358134){if(_0x358134){_0x2a099f=_0x358134;_0x476589['model']=_['keys'](db[_0x182e('0x4b')]['rawAttributes']);_0x476589[_0x182e('0x2f')]=_[_0x182e('0x43')](_0x276c35[_0x182e('0x2f')]);_0x476589[_0x182e('0x39')]=_[_0x182e('0x30')](_0x476589[_0x182e('0x31')],_0x476589['query']);_0x46db36[_0x182e('0x32')]=_[_0x182e('0x30')](_0x476589['model'],qs['fields'](_0x276c35[_0x182e('0x2f')]['fields']));_0x46db36[_0x182e('0x32')]=_0x46db36[_0x182e('0x32')]['length']?_0x46db36[_0x182e('0x32')]:_0x476589[_0x182e('0x31')];_0x46db36[_0x182e('0x4d')]=qs[_0x182e('0x36')](_0x276c35['query'][_0x182e('0x36')]);_0x46db36[_0x182e('0x37')]=qs[_0x182e('0x39')](_[_0x182e('0x38')](_0x276c35[_0x182e('0x2f')],_0x476589[_0x182e('0x39')]));if(_0x276c35[_0x182e('0x2f')][_0x182e('0x3a')]){_0x46db36['where']=_[_0x182e('0x3b')](_0x46db36[_0x182e('0x37')],{'$or':_[_0x182e('0x2a')](_0x46db36[_0x182e('0x32')],function(_0x3cde8e){var _0x480f7b={};_0x480f7b[_0x3cde8e]={'$like':'%'+_0x276c35[_0x182e('0x2f')][_0x182e('0x3a')]+'%'};return _0x480f7b;})});}_0x46db36=_['merge']({},_0x46db36,_0x276c35[_0x182e('0x3d')]);return _0x2a099f['getDescriptions'](_0x46db36);}})[_0x182e('0x24')](function(_0x19b666){if(_0x19b666){_0x53e759=_0x19b666['length'];if(!_0x276c35[_0x182e('0x2f')]['hasOwnProperty'](_0x182e('0x35'))){_0x46db36[_0x182e('0x1b')]=qs[_0x182e('0x1b')](_0x276c35['query'][_0x182e('0x1b')]);_0x46db36[_0x182e('0x1e')]=qs['offset'](_0x276c35[_0x182e('0x2f')][_0x182e('0x1e')]);}return _0x2a099f[_0x182e('0x50')](_0x46db36);}})[_0x182e('0x24')](function(_0x2e4687){if(_0x2e4687){return _0x2e4687?{'count':_0x53e759,'rows':_0x2e4687}:null;}})[_0x182e('0x24')](respondWithResult(_0x332217,null))['catch'](handleError(_0x332217,null));};exports[_0x182e('0x51')]=function(_0x503be6,_0x1f0835,_0x206df1){var _0x285a5b={};var _0x148091={};var _0x5eab8f;var _0x4146b8;return db[_0x182e('0x2b')][_0x182e('0x4a')]({'where':{'id':_0x503be6['params']['id']}})[_0x182e('0x24')](handleEntityNotFound(_0x1f0835,null))['then'](function(_0x284b46){if(_0x284b46){_0x5eab8f=_0x284b46;_0x148091[_0x182e('0x31')]=_[_0x182e('0x43')](db['Tag'][_0x182e('0x44')]);_0x148091[_0x182e('0x2f')]=_[_0x182e('0x43')](_0x503be6['query']);_0x148091[_0x182e('0x39')]=_[_0x182e('0x30')](_0x148091['model'],_0x148091[_0x182e('0x2f')]);_0x285a5b['attributes']=_[_0x182e('0x30')](_0x148091[_0x182e('0x31')],qs['fields'](_0x503be6[_0x182e('0x2f')][_0x182e('0x33')]));_0x285a5b['attributes']=_0x285a5b['attributes'][_0x182e('0x4c')]?_0x285a5b['attributes']:_0x148091[_0x182e('0x31')];_0x285a5b[_0x182e('0x4d')]=qs[_0x182e('0x36')](_0x503be6[_0x182e('0x2f')]['sort']);_0x285a5b[_0x182e('0x37')]=qs[_0x182e('0x39')](_[_0x182e('0x38')](_0x503be6[_0x182e('0x2f')],_0x148091[_0x182e('0x39')]));if(_0x503be6[_0x182e('0x2f')][_0x182e('0x3a')]){_0x285a5b[_0x182e('0x37')]=_['merge'](_0x285a5b[_0x182e('0x37')],{'$or':_[_0x182e('0x2a')](_0x285a5b[_0x182e('0x32')],function(_0x1814c2){var _0x96e21f={};_0x96e21f[_0x1814c2]={'$like':'%'+_0x503be6[_0x182e('0x2f')][_0x182e('0x3a')]+'%'};return _0x96e21f;})});}_0x285a5b=_[_0x182e('0x3b')]({},_0x285a5b,_0x503be6['options']);return _0x5eab8f[_0x182e('0x51')](_0x285a5b);}})[_0x182e('0x24')](function(_0x5785d7){if(_0x5785d7){_0x4146b8=_0x5785d7[_0x182e('0x4c')];if(!_0x503be6['query'][_0x182e('0x34')](_0x182e('0x35'))){_0x285a5b[_0x182e('0x1b')]=qs[_0x182e('0x1b')](_0x503be6[_0x182e('0x2f')][_0x182e('0x1b')]);_0x285a5b[_0x182e('0x1e')]=qs[_0x182e('0x1e')](_0x503be6[_0x182e('0x2f')][_0x182e('0x1e')]);}return _0x5eab8f['getTags'](_0x285a5b);}})[_0x182e('0x24')](function(_0x53f2e9){if(_0x53f2e9){return _0x53f2e9?{'count':_0x4146b8,'rows':_0x53f2e9}:null;}})[_0x182e('0x24')](respondWithResult(_0x1f0835,null))[_0x182e('0x49')](handleError(_0x1f0835,null));};exports[_0x182e('0x52')]=function(_0x12ae28,_0x53d221,_0x56bb1b){if(_0x12ae28[_0x182e('0x48')]['id']){delete _0x12ae28[_0x182e('0x48')]['id'];}return db['ZendeskConfiguration'][_0x182e('0x4a')]({'where':{'id':_0x12ae28[_0x182e('0x42')]['id']}})['then'](handleEntityNotFound(_0x53d221,null))[_0x182e('0x24')](function(_0x5128df){if(_0x5128df){return _0x5128df[_0x182e('0x52')](_0x12ae28[_0x182e('0x48')][_0x182e('0x53')]||[]);}return null;})[_0x182e('0x24')](respondWithResult(_0x53d221,null))[_0x182e('0x49')](handleError(_0x53d221,null));}; \ No newline at end of file +var _0x3c45=['status','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','then','error','stack','name','index','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','ZendeskConfiguration','findAll','catch','show','keys','rawAttributes','create','body','update','destroy','find','findOne','ZendeskField','map','getFields','getSubjects','params','getDescriptions','getTags','setTags','ids','eml-format','request-promise','moment','util','ejs','fs-extra','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end'];(function(_0x1d42a3,_0xd49411){var _0x534b00=function(_0xd9f03a){while(--_0xd9f03a){_0x1d42a3['push'](_0x1d42a3['shift']());}};_0x534b00(++_0xd49411);}(_0x3c45,0x87));var _0x53c4=function(_0x1327f7,_0x574202){_0x1327f7=_0x1327f7-0x0;var _0xa7a00c=_0x3c45[_0x1327f7];return _0xa7a00c;};'use strict';var emlformat=require(_0x53c4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x53c4('0x1'));var moment=require(_0x53c4('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x53c4('0x3'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x53c4('0x4'));var fs=require('fs');var fs_extra=require(_0x53c4('0x5'));var _=require('lodash');var squel=require(_0x53c4('0x6'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x53c4('0x7'));var toCsv=require(_0x53c4('0x8'));var querystring=require(_0x53c4('0x9'));var Papa=require(_0x53c4('0xa'));var Redis=require(_0x53c4('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x53c4('0xc'));var as=require(_0x53c4('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x53c4('0xe'));var config=require(_0x53c4('0xf'));var licenseUtil=require('../../config/license/util');var db=require(_0x53c4('0x10'))['db'];function respondWithStatusCode(_0x12843f,_0x13135a){_0x13135a=_0x13135a||0xcc;return function(_0x272ebd){if(_0x272ebd){return _0x12843f[_0x53c4('0x11')](_0x13135a);}return _0x12843f['status'](_0x13135a)[_0x53c4('0x12')]();};}function respondWithResult(_0xa73bab,_0x3bfd84){_0x3bfd84=_0x3bfd84||0xc8;return function(_0x5e5a1e){if(_0x5e5a1e){return _0xa73bab[_0x53c4('0x13')](_0x3bfd84)[_0x53c4('0x14')](_0x5e5a1e);}};}function respondWithFilteredResult(_0x4db7a1,_0x1ddfbd){return function(_0x49d46a){if(_0x49d46a){var _0x35cd2e=typeof _0x1ddfbd['offset']===_0x53c4('0x15')&&typeof _0x1ddfbd['limit']==='undefined';var _0x47f329=_0x49d46a['count'];var _0x5682fd=_0x35cd2e?0x0:_0x1ddfbd[_0x53c4('0x16')];var _0xe9a767=_0x35cd2e?_0x49d46a[_0x53c4('0x17')]:_0x1ddfbd[_0x53c4('0x16')]+_0x1ddfbd[_0x53c4('0x18')];var _0x4d26e8;if(_0xe9a767>=_0x47f329){_0xe9a767=_0x47f329;_0x4d26e8=0xc8;}else{_0x4d26e8=0xce;}_0x4db7a1[_0x53c4('0x13')](_0x4d26e8);return _0x4db7a1[_0x53c4('0x19')](_0x53c4('0x1a'),_0x5682fd+'-'+_0xe9a767+'/'+_0x47f329)[_0x53c4('0x14')](_0x49d46a);}return null;};}function patchUpdates(_0x4da0e2){return function(_0x90c75c){try{jsonpatch[_0x53c4('0x1b')](_0x90c75c,_0x4da0e2,!![]);}catch(_0x185b6d){return BPromise[_0x53c4('0x1c')](_0x185b6d);}return _0x90c75c[_0x53c4('0x1d')]();};}function saveUpdates(_0x7f0898,_0x5e7fb5){return function(_0x3128e6){if(_0x3128e6){return _0x3128e6['update'](_0x7f0898)[_0x53c4('0x1e')](function(_0x13464d){return _0x13464d;});}return null;};}function removeEntity(_0x36cf6c,_0x1974ba){return function(_0x194ffe){if(_0x194ffe){return _0x194ffe['destroy']()['then'](function(){_0x36cf6c[_0x53c4('0x13')](0xcc)[_0x53c4('0x12')]();});}};}function handleEntityNotFound(_0x968119,_0x1e65ae){return function(_0x54bcc5){if(!_0x54bcc5){_0x968119['sendStatus'](0x194);}return _0x54bcc5;};}function handleError(_0x33fef8,_0x40e677){_0x40e677=_0x40e677||0x1f4;return function(_0x3ef9b4){logger[_0x53c4('0x1f')](_0x3ef9b4[_0x53c4('0x20')]);if(_0x3ef9b4['name']){delete _0x3ef9b4[_0x53c4('0x21')];}_0x33fef8[_0x53c4('0x13')](_0x40e677)['send'](_0x3ef9b4);};}exports[_0x53c4('0x22')]=function(_0x3a6aba,_0x54b6c8){var _0x11677e={},_0x57c890={},_0x187ef3={'count':0x0,'rows':[]};var _0x3ffdb5=_['map'](db['ZendeskConfiguration']['rawAttributes'],function(_0x2787ce){return{'name':_0x2787ce['fieldName'],'type':_0x2787ce['type'][_0x53c4('0x23')]};});_0x57c890[_0x53c4('0x24')]=_['map'](_0x3ffdb5,_0x53c4('0x21'));_0x57c890[_0x53c4('0x25')]=_['keys'](_0x3a6aba[_0x53c4('0x25')]);_0x57c890[_0x53c4('0x26')]=_[_0x53c4('0x27')](_0x57c890[_0x53c4('0x24')],_0x57c890['query']);_0x11677e[_0x53c4('0x28')]=_[_0x53c4('0x27')](_0x57c890['model'],qs[_0x53c4('0x29')](_0x3a6aba[_0x53c4('0x25')][_0x53c4('0x29')]));_0x11677e[_0x53c4('0x28')]=_0x11677e[_0x53c4('0x28')][_0x53c4('0x2a')]?_0x11677e[_0x53c4('0x28')]:_0x57c890['model'];if(!_0x3a6aba['query'][_0x53c4('0x2b')](_0x53c4('0x2c'))){_0x11677e[_0x53c4('0x18')]=qs[_0x53c4('0x18')](_0x3a6aba['query'][_0x53c4('0x18')]);_0x11677e[_0x53c4('0x16')]=qs[_0x53c4('0x16')](_0x3a6aba[_0x53c4('0x25')][_0x53c4('0x16')]);}_0x11677e[_0x53c4('0x2d')]=qs[_0x53c4('0x2e')](_0x3a6aba[_0x53c4('0x25')][_0x53c4('0x2e')]);_0x11677e[_0x53c4('0x2f')]=qs['filters'](_[_0x53c4('0x30')](_0x3a6aba['query'],_0x57c890[_0x53c4('0x26')]),_0x3ffdb5);if(_0x3a6aba[_0x53c4('0x25')][_0x53c4('0x31')]){_0x11677e[_0x53c4('0x2f')]=_[_0x53c4('0x32')](_0x11677e[_0x53c4('0x2f')],{'$or':_['map'](_0x3ffdb5,function(_0x140144){if(_0x140144[_0x53c4('0x33')]!==_0x53c4('0x34')){var _0x5124ea={};_0x5124ea[_0x140144[_0x53c4('0x21')]]={'$like':'%'+_0x3a6aba[_0x53c4('0x25')]['filter']+'%'};return _0x5124ea;}})});}_0x11677e=_['merge']({},_0x11677e,_0x3a6aba[_0x53c4('0x35')]);var _0x149f15={'where':_0x11677e[_0x53c4('0x2f')]};return db['ZendeskConfiguration']['count'](_0x149f15)[_0x53c4('0x1e')](function(_0x507b24){_0x187ef3[_0x53c4('0x17')]=_0x507b24;if(_0x3a6aba['query'][_0x53c4('0x36')]){_0x11677e[_0x53c4('0x37')]=[{'all':!![]}];}return db[_0x53c4('0x38')][_0x53c4('0x39')](_0x11677e);})['then'](function(_0x38824c){_0x187ef3['rows']=_0x38824c;return _0x187ef3;})[_0x53c4('0x1e')](respondWithFilteredResult(_0x54b6c8,_0x11677e))[_0x53c4('0x3a')](handleError(_0x54b6c8,null));};exports[_0x53c4('0x3b')]=function(_0x303dee,_0x2451e4){var _0x4be649={'raw':![],'where':{'id':_0x303dee['params']['id']}},_0x2da159={};_0x2da159['model']=_[_0x53c4('0x3c')](db['ZendeskConfiguration'][_0x53c4('0x3d')]);_0x2da159[_0x53c4('0x25')]=_[_0x53c4('0x3c')](_0x303dee[_0x53c4('0x25')]);_0x2da159['filters']=_[_0x53c4('0x27')](_0x2da159[_0x53c4('0x24')],_0x2da159[_0x53c4('0x25')]);_0x4be649[_0x53c4('0x28')]=_[_0x53c4('0x27')](_0x2da159['model'],qs[_0x53c4('0x29')](_0x303dee['query'][_0x53c4('0x29')]));_0x4be649['attributes']=_0x4be649[_0x53c4('0x28')][_0x53c4('0x2a')]?_0x4be649[_0x53c4('0x28')]:_0x2da159['model'];if(_0x303dee[_0x53c4('0x25')][_0x53c4('0x36')]){_0x4be649['include']=[{'all':!![]}];}_0x4be649=_[_0x53c4('0x32')]({},_0x4be649,_0x303dee[_0x53c4('0x35')]);return db[_0x53c4('0x38')]['find'](_0x4be649)[_0x53c4('0x1e')](handleEntityNotFound(_0x2451e4,null))[_0x53c4('0x1e')](respondWithResult(_0x2451e4,null))[_0x53c4('0x3a')](handleError(_0x2451e4,null));};exports['create']=function(_0x129378,_0x59ae4a){return db[_0x53c4('0x38')][_0x53c4('0x3e')](_0x129378[_0x53c4('0x3f')],{})['then'](respondWithResult(_0x59ae4a,0xc9))[_0x53c4('0x3a')](handleError(_0x59ae4a,null));};exports[_0x53c4('0x40')]=function(_0x120125,_0x47c3cd){if(_0x120125[_0x53c4('0x3f')]['id']){delete _0x120125['body']['id'];}return db['ZendeskConfiguration']['find']({'where':{'id':_0x120125['params']['id']}})[_0x53c4('0x1e')](handleEntityNotFound(_0x47c3cd,null))['then'](saveUpdates(_0x120125[_0x53c4('0x3f')],null))[_0x53c4('0x1e')](respondWithResult(_0x47c3cd,null))[_0x53c4('0x3a')](handleError(_0x47c3cd,null));};exports[_0x53c4('0x41')]=function(_0x8c7b0f,_0x3e057d){return db[_0x53c4('0x38')][_0x53c4('0x42')]({'where':{'id':_0x8c7b0f['params']['id']}})[_0x53c4('0x1e')](handleEntityNotFound(_0x3e057d,null))[_0x53c4('0x1e')](removeEntity(_0x3e057d,null))[_0x53c4('0x3a')](handleError(_0x3e057d,null));};exports['getFields']=function(_0x5710e8,_0x17c79f,_0x3c4925){var _0x1dd68a={};var _0x5872e0={};var _0x4da207;var _0x5ac39e;return db[_0x53c4('0x38')][_0x53c4('0x43')]({'where':{'id':_0x5710e8['params']['id']}})[_0x53c4('0x1e')](handleEntityNotFound(_0x17c79f,null))[_0x53c4('0x1e')](function(_0xd22ede){if(_0xd22ede){_0x4da207=_0xd22ede;_0x5872e0['model']=_['keys'](db[_0x53c4('0x44')][_0x53c4('0x3d')]);_0x5872e0[_0x53c4('0x25')]=_[_0x53c4('0x3c')](_0x5710e8['query']);_0x5872e0['filters']=_[_0x53c4('0x27')](_0x5872e0[_0x53c4('0x24')],_0x5872e0['query']);_0x1dd68a[_0x53c4('0x28')]=_[_0x53c4('0x27')](_0x5872e0[_0x53c4('0x24')],qs[_0x53c4('0x29')](_0x5710e8[_0x53c4('0x25')][_0x53c4('0x29')]));_0x1dd68a['attributes']=_0x1dd68a[_0x53c4('0x28')]['length']?_0x1dd68a[_0x53c4('0x28')]:_0x5872e0['model'];_0x1dd68a[_0x53c4('0x2d')]=qs[_0x53c4('0x2e')](_0x5710e8['query'][_0x53c4('0x2e')]);_0x1dd68a[_0x53c4('0x2f')]=qs[_0x53c4('0x26')](_[_0x53c4('0x30')](_0x5710e8[_0x53c4('0x25')],_0x5872e0[_0x53c4('0x26')]));if(_0x5710e8[_0x53c4('0x25')][_0x53c4('0x31')]){_0x1dd68a[_0x53c4('0x2f')]=_[_0x53c4('0x32')](_0x1dd68a[_0x53c4('0x2f')],{'$or':_[_0x53c4('0x45')](_0x1dd68a[_0x53c4('0x28')],function(_0xe01354){var _0x2f4d6e={};_0x2f4d6e[_0xe01354]={'$like':'%'+_0x5710e8[_0x53c4('0x25')]['filter']+'%'};return _0x2f4d6e;})});}_0x1dd68a=_['merge']({},_0x1dd68a,_0x5710e8[_0x53c4('0x35')]);return _0x4da207[_0x53c4('0x46')](_0x1dd68a);}})[_0x53c4('0x1e')](function(_0x50d739){if(_0x50d739){_0x5ac39e=_0x50d739['length'];if(!_0x5710e8['query']['hasOwnProperty'](_0x53c4('0x2c'))){_0x1dd68a[_0x53c4('0x18')]=qs['limit'](_0x5710e8[_0x53c4('0x25')]['limit']);_0x1dd68a[_0x53c4('0x16')]=qs[_0x53c4('0x16')](_0x5710e8['query'][_0x53c4('0x16')]);}return _0x4da207['getFields'](_0x1dd68a);}})[_0x53c4('0x1e')](function(_0x594dde){if(_0x594dde){return _0x594dde?{'count':_0x5ac39e,'rows':_0x594dde}:null;}})[_0x53c4('0x1e')](respondWithResult(_0x17c79f,null))[_0x53c4('0x3a')](handleError(_0x17c79f,null));};exports[_0x53c4('0x47')]=function(_0x69a1ff,_0x1627a8,_0x1bfc75){var _0x32a98b={};var _0x3fe796={};var _0x4d0346;var _0x42b692;return db[_0x53c4('0x38')]['findOne']({'where':{'id':_0x69a1ff[_0x53c4('0x48')]['id']}})['then'](handleEntityNotFound(_0x1627a8,null))[_0x53c4('0x1e')](function(_0x189fef){if(_0x189fef){_0x4d0346=_0x189fef;_0x3fe796['model']=_[_0x53c4('0x3c')](db[_0x53c4('0x44')]['rawAttributes']);_0x3fe796[_0x53c4('0x25')]=_[_0x53c4('0x3c')](_0x69a1ff['query']);_0x3fe796[_0x53c4('0x26')]=_['intersection'](_0x3fe796[_0x53c4('0x24')],_0x3fe796['query']);_0x32a98b[_0x53c4('0x28')]=_[_0x53c4('0x27')](_0x3fe796[_0x53c4('0x24')],qs[_0x53c4('0x29')](_0x69a1ff[_0x53c4('0x25')][_0x53c4('0x29')]));_0x32a98b[_0x53c4('0x28')]=_0x32a98b[_0x53c4('0x28')][_0x53c4('0x2a')]?_0x32a98b[_0x53c4('0x28')]:_0x3fe796[_0x53c4('0x24')];_0x32a98b['order']=qs[_0x53c4('0x2e')](_0x69a1ff['query'][_0x53c4('0x2e')]);_0x32a98b[_0x53c4('0x2f')]=qs[_0x53c4('0x26')](_[_0x53c4('0x30')](_0x69a1ff[_0x53c4('0x25')],_0x3fe796[_0x53c4('0x26')]));if(_0x69a1ff['query'][_0x53c4('0x31')]){_0x32a98b['where']=_[_0x53c4('0x32')](_0x32a98b[_0x53c4('0x2f')],{'$or':_[_0x53c4('0x45')](_0x32a98b[_0x53c4('0x28')],function(_0x47781c){var _0x528528={};_0x528528[_0x47781c]={'$like':'%'+_0x69a1ff['query'][_0x53c4('0x31')]+'%'};return _0x528528;})});}_0x32a98b=_[_0x53c4('0x32')]({},_0x32a98b,_0x69a1ff[_0x53c4('0x35')]);return _0x4d0346['getSubjects'](_0x32a98b);}})['then'](function(_0x17d198){if(_0x17d198){_0x42b692=_0x17d198[_0x53c4('0x2a')];if(!_0x69a1ff[_0x53c4('0x25')][_0x53c4('0x2b')]('nolimit')){_0x32a98b[_0x53c4('0x18')]=qs['limit'](_0x69a1ff[_0x53c4('0x25')][_0x53c4('0x18')]);_0x32a98b['offset']=qs[_0x53c4('0x16')](_0x69a1ff[_0x53c4('0x25')][_0x53c4('0x16')]);}return _0x4d0346[_0x53c4('0x47')](_0x32a98b);}})['then'](function(_0x17fee3){if(_0x17fee3){return _0x17fee3?{'count':_0x42b692,'rows':_0x17fee3}:null;}})[_0x53c4('0x1e')](respondWithResult(_0x1627a8,null))[_0x53c4('0x3a')](handleError(_0x1627a8,null));};exports[_0x53c4('0x49')]=function(_0x277228,_0xea6d3c,_0x1787b4){var _0x377009={};var _0xba374f={};var _0x38576e;var _0x5e62ec;return db[_0x53c4('0x38')][_0x53c4('0x43')]({'where':{'id':_0x277228[_0x53c4('0x48')]['id']}})['then'](handleEntityNotFound(_0xea6d3c,null))[_0x53c4('0x1e')](function(_0x319673){if(_0x319673){_0x38576e=_0x319673;_0xba374f[_0x53c4('0x24')]=_[_0x53c4('0x3c')](db[_0x53c4('0x44')][_0x53c4('0x3d')]);_0xba374f[_0x53c4('0x25')]=_[_0x53c4('0x3c')](_0x277228[_0x53c4('0x25')]);_0xba374f[_0x53c4('0x26')]=_[_0x53c4('0x27')](_0xba374f[_0x53c4('0x24')],_0xba374f[_0x53c4('0x25')]);_0x377009['attributes']=_['intersection'](_0xba374f[_0x53c4('0x24')],qs['fields'](_0x277228[_0x53c4('0x25')]['fields']));_0x377009[_0x53c4('0x28')]=_0x377009[_0x53c4('0x28')][_0x53c4('0x2a')]?_0x377009['attributes']:_0xba374f['model'];_0x377009[_0x53c4('0x2d')]=qs[_0x53c4('0x2e')](_0x277228['query'][_0x53c4('0x2e')]);_0x377009['where']=qs[_0x53c4('0x26')](_[_0x53c4('0x30')](_0x277228[_0x53c4('0x25')],_0xba374f['filters']));if(_0x277228[_0x53c4('0x25')][_0x53c4('0x31')]){_0x377009[_0x53c4('0x2f')]=_[_0x53c4('0x32')](_0x377009['where'],{'$or':_['map'](_0x377009[_0x53c4('0x28')],function(_0x51728f){var _0x5dab55={};_0x5dab55[_0x51728f]={'$like':'%'+_0x277228[_0x53c4('0x25')]['filter']+'%'};return _0x5dab55;})});}_0x377009=_[_0x53c4('0x32')]({},_0x377009,_0x277228[_0x53c4('0x35')]);return _0x38576e[_0x53c4('0x49')](_0x377009);}})[_0x53c4('0x1e')](function(_0x1b62df){if(_0x1b62df){_0x5e62ec=_0x1b62df[_0x53c4('0x2a')];if(!_0x277228[_0x53c4('0x25')][_0x53c4('0x2b')]('nolimit')){_0x377009[_0x53c4('0x18')]=qs[_0x53c4('0x18')](_0x277228['query'][_0x53c4('0x18')]);_0x377009['offset']=qs[_0x53c4('0x16')](_0x277228['query'][_0x53c4('0x16')]);}return _0x38576e['getDescriptions'](_0x377009);}})[_0x53c4('0x1e')](function(_0xa5bc65){if(_0xa5bc65){return _0xa5bc65?{'count':_0x5e62ec,'rows':_0xa5bc65}:null;}})[_0x53c4('0x1e')](respondWithResult(_0xea6d3c,null))['catch'](handleError(_0xea6d3c,null));};exports['getTags']=function(_0x516181,_0x1863fa,_0x5e77d2){var _0x15f84d={};var _0x3b03e1={};var _0x4d6ddb;var _0x24b73b;return db['ZendeskConfiguration'][_0x53c4('0x43')]({'where':{'id':_0x516181[_0x53c4('0x48')]['id']}})['then'](handleEntityNotFound(_0x1863fa,null))[_0x53c4('0x1e')](function(_0x204f5e){if(_0x204f5e){_0x4d6ddb=_0x204f5e;_0x3b03e1[_0x53c4('0x24')]=_[_0x53c4('0x3c')](db['Tag']['rawAttributes']);_0x3b03e1['query']=_[_0x53c4('0x3c')](_0x516181[_0x53c4('0x25')]);_0x3b03e1['filters']=_[_0x53c4('0x27')](_0x3b03e1['model'],_0x3b03e1[_0x53c4('0x25')]);_0x15f84d[_0x53c4('0x28')]=_['intersection'](_0x3b03e1[_0x53c4('0x24')],qs['fields'](_0x516181[_0x53c4('0x25')]['fields']));_0x15f84d[_0x53c4('0x28')]=_0x15f84d[_0x53c4('0x28')][_0x53c4('0x2a')]?_0x15f84d['attributes']:_0x3b03e1['model'];_0x15f84d[_0x53c4('0x2d')]=qs[_0x53c4('0x2e')](_0x516181[_0x53c4('0x25')][_0x53c4('0x2e')]);_0x15f84d[_0x53c4('0x2f')]=qs[_0x53c4('0x26')](_[_0x53c4('0x30')](_0x516181[_0x53c4('0x25')],_0x3b03e1['filters']));if(_0x516181['query'][_0x53c4('0x31')]){_0x15f84d[_0x53c4('0x2f')]=_[_0x53c4('0x32')](_0x15f84d['where'],{'$or':_[_0x53c4('0x45')](_0x15f84d['attributes'],function(_0xdcde23){var _0x3ddb30={};_0x3ddb30[_0xdcde23]={'$like':'%'+_0x516181[_0x53c4('0x25')]['filter']+'%'};return _0x3ddb30;})});}_0x15f84d=_[_0x53c4('0x32')]({},_0x15f84d,_0x516181[_0x53c4('0x35')]);return _0x4d6ddb[_0x53c4('0x4a')](_0x15f84d);}})[_0x53c4('0x1e')](function(_0x3cfb1f){if(_0x3cfb1f){_0x24b73b=_0x3cfb1f[_0x53c4('0x2a')];if(!_0x516181[_0x53c4('0x25')][_0x53c4('0x2b')](_0x53c4('0x2c'))){_0x15f84d[_0x53c4('0x18')]=qs['limit'](_0x516181[_0x53c4('0x25')][_0x53c4('0x18')]);_0x15f84d[_0x53c4('0x16')]=qs['offset'](_0x516181[_0x53c4('0x25')]['offset']);}return _0x4d6ddb[_0x53c4('0x4a')](_0x15f84d);}})[_0x53c4('0x1e')](function(_0x13bc42){if(_0x13bc42){return _0x13bc42?{'count':_0x24b73b,'rows':_0x13bc42}:null;}})[_0x53c4('0x1e')](respondWithResult(_0x1863fa,null))[_0x53c4('0x3a')](handleError(_0x1863fa,null));};exports[_0x53c4('0x4b')]=function(_0x13647f,_0x3b4144,_0x459e04){if(_0x13647f[_0x53c4('0x3f')]['id']){delete _0x13647f['body']['id'];}return db[_0x53c4('0x38')][_0x53c4('0x43')]({'where':{'id':_0x13647f[_0x53c4('0x48')]['id']}})[_0x53c4('0x1e')](handleEntityNotFound(_0x3b4144,null))['then'](function(_0xc1f980){if(_0xc1f980){return _0xc1f980[_0x53c4('0x4b')](_0x13647f['body'][_0x53c4('0x4c')]||[]);}return null;})[_0x53c4('0x1e')](respondWithResult(_0x3b4144,null))[_0x53c4('0x3a')](handleError(_0x3b4144,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 4af3abb..f4332fa 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 _0x97c1=['define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','api','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes'];(function(_0x32ad82,_0x38d242){var _0x231792=function(_0x514b5a){while(--_0x514b5a){_0x32ad82['push'](_0x32ad82['shift']());}};_0x231792(++_0x38d242);}(_0x97c1,0xdf));var _0x197c=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x97c1[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x197c('0x0'));var util=require(_0x197c('0x1'));var logger=require('../../config/logger')(_0x197c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x197c('0x3'));var fs=require('fs');var path=require(_0x197c('0x4'));var rimraf=require(_0x197c('0x5'));var config=require(_0x197c('0x6'));var attributes=require(_0x197c('0x7'));module['exports']=function(_0x5cbff6,_0x1cb6e1){return _0x5cbff6[_0x197c('0x8')](_0x197c('0x9'),attributes,{'tableName':_0x197c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1eba=['define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports'];(function(_0x326db1,_0x125e34){var _0x1bebe5=function(_0x11a115){while(--_0x11a115){_0x326db1['push'](_0x326db1['shift']());}};_0x1bebe5(++_0x125e34);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x4a6cf8,_0x5534ef){_0x4a6cf8=_0x4a6cf8-0x0;var _0x22205e=_0x1eba[_0x4a6cf8];return _0x22205e;};'use strict';var _=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var logger=require(_0xa1eb('0x2'))(_0xa1eb('0x3'));var moment=require(_0xa1eb('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1eb('0x5'));var rimraf=require(_0xa1eb('0x6'));var config=require(_0xa1eb('0x7'));var attributes=require(_0xa1eb('0x8'));module[_0xa1eb('0x9')]=function(_0x2933d0,_0x1d0d67){return _0x2933d0[_0xa1eb('0xa')](_0xa1eb('0xb'),attributes,{'tableName':_0xa1eb('0xc'),'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 4f83067..4394cd9 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 _0x0ba2=['message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x18f396,_0x174d17){var _0x3ba532=function(_0x2bc92f){while(--_0x2bc92f){_0x18f396['push'](_0x18f396['shift']());}};_0x3ba532(++_0x174d17);}(_0x0ba2,0xaa));var _0x20ba=function(_0x193676,_0x5dfa88){_0x193676=_0x193676-0x0;var _0x421902=_0x0ba2[_0x193676];return _0x421902;};'use strict';var _=require(_0x20ba('0x0'));var util=require(_0x20ba('0x1'));var moment=require(_0x20ba('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x20ba('0x3'));var db=require(_0x20ba('0x4'))['db'];var utils=require(_0x20ba('0x5'));var logger=require(_0x20ba('0x6'))(_0x20ba('0x7'));var config=require(_0x20ba('0x8'));var jayson=require(_0x20ba('0x9'));var client=jayson[_0x20ba('0xa')][_0x20ba('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9ace66,_0xfb6ea2,_0x3592c0){return new BPromise(function(_0x4e8483,_0x15fa69){return client[_0x20ba('0xc')](_0x9ace66,_0x3592c0)[_0x20ba('0xd')](function(_0x438a50){logger[_0x20ba('0xe')](_0x20ba('0xf'),_0xfb6ea2,_0x20ba('0x10'));logger[_0x20ba('0x11')](_0x20ba('0x12'),_0xfb6ea2,_0x20ba('0x10'),JSON[_0x20ba('0x13')](_0x438a50));if(_0x438a50[_0x20ba('0x14')]){if(_0x438a50[_0x20ba('0x14')][_0x20ba('0x15')]===0x1f4){logger['error'](_0x20ba('0xf'),_0xfb6ea2,_0x438a50['error'][_0x20ba('0x16')]);return _0x15fa69(_0x438a50[_0x20ba('0x14')][_0x20ba('0x16')]);}logger[_0x20ba('0x14')](_0x20ba('0xf'),_0xfb6ea2,_0x438a50[_0x20ba('0x14')]['message']);return _0x4e8483(_0x438a50[_0x20ba('0x14')]['message']);}else{logger[_0x20ba('0xe')](_0x20ba('0xf'),_0xfb6ea2,_0x20ba('0x10'));_0x4e8483(_0x438a50['result'][_0x20ba('0x16')]);}})[_0x20ba('0x17')](function(_0x3bbd8a){logger[_0x20ba('0x14')](_0x20ba('0xf'),_0xfb6ea2,_0x3bbd8a);_0x15fa69(_0x3bbd8a);});});} \ No newline at end of file +var _0x80e6=['info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x35a3da,_0x286c6a){var _0x568a40=function(_0x4afc63){while(--_0x4afc63){_0x35a3da['push'](_0x35a3da['shift']());}};_0x568a40(++_0x286c6a);}(_0x80e6,0x87));var _0x680e=function(_0xc1da01,_0x1cf39d){_0xc1da01=_0xc1da01-0x0;var _0x48e3e7=_0x80e6[_0xc1da01];return _0x48e3e7;};'use strict';var _=require(_0x680e('0x0'));var util=require('util');var moment=require(_0x680e('0x1'));var BPromise=require(_0x680e('0x2'));var rs=require(_0x680e('0x3'));var fs=require('fs');var Redis=require(_0x680e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x680e('0x5'));var logger=require(_0x680e('0x6'))(_0x680e('0x7'));var config=require(_0x680e('0x8'));var jayson=require(_0x680e('0x9'));var client=jayson['client'][_0x680e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b7fb1,_0x2bf7e3,_0x4f5274){return new BPromise(function(_0x5758a7,_0x3f968e){return client['request'](_0x2b7fb1,_0x4f5274)[_0x680e('0xb')](function(_0x1b9ce3){logger[_0x680e('0xc')](_0x680e('0xd'),_0x2bf7e3,_0x680e('0xe'));logger[_0x680e('0xf')](_0x680e('0x10'),_0x2bf7e3,_0x680e('0xe'),JSON[_0x680e('0x11')](_0x1b9ce3));if(_0x1b9ce3[_0x680e('0x12')]){if(_0x1b9ce3[_0x680e('0x12')]['code']===0x1f4){logger[_0x680e('0x12')](_0x680e('0xd'),_0x2bf7e3,_0x1b9ce3['error'][_0x680e('0x13')]);return _0x3f968e(_0x1b9ce3[_0x680e('0x12')][_0x680e('0x13')]);}logger[_0x680e('0x12')](_0x680e('0xd'),_0x2bf7e3,_0x1b9ce3[_0x680e('0x12')][_0x680e('0x13')]);return _0x5758a7(_0x1b9ce3[_0x680e('0x12')][_0x680e('0x13')]);}else{logger[_0x680e('0xc')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2bf7e3,_0x680e('0xe'));_0x5758a7(_0x1b9ce3['result'][_0x680e('0x13')]);}})[_0x680e('0x14')](function(_0x1d6147){logger['error'](_0x680e('0xd'),_0x2bf7e3,_0x1d6147);_0x3f968e(_0x1d6147);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index f86b443..1b9904b 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 _0xc576=['create','update','delete','/:id','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show'];(function(_0x479047,_0x590b99){var _0x35f005=function(_0x1c6c4a){while(--_0x1c6c4a){_0x479047['push'](_0x479047['shift']());}};_0x35f005(++_0x590b99);}(_0xc576,0xde));var _0x6c57=function(_0x65d12e,_0x4b0a30){_0x65d12e=_0x65d12e-0x0;var _0x4274e0=_0xc576[_0x65d12e];return _0x4274e0;};'use strict';var multer=require(_0x6c57('0x0'));var util=require(_0x6c57('0x1'));var path=require(_0x6c57('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6c57('0x3')]();var fs_extra=require(_0x6c57('0x4'));var auth=require(_0x6c57('0x5'));var interaction=require(_0x6c57('0x6'));var config=require(_0x6c57('0x7'));var controller=require('./intZendeskField.controller');router['get']('/',auth[_0x6c57('0x8')](),controller[_0x6c57('0x9')]);router[_0x6c57('0xa')]('/:id',auth[_0x6c57('0x8')](),controller[_0x6c57('0xb')]);router['post']('/',auth[_0x6c57('0x8')](),controller[_0x6c57('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x6c57('0xd')]);router[_0x6c57('0xe')](_0x6c57('0xf'),auth[_0x6c57('0x8')](),controller[_0x6c57('0x10')]);module[_0x6c57('0x11')]=router; \ No newline at end of file +var _0x73eb=['isAuthenticated','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','index','/:id'];(function(_0x207e0f,_0x13b5dd){var _0x1fcac2=function(_0x4e2929){while(--_0x4e2929){_0x207e0f['push'](_0x207e0f['shift']());}};_0x1fcac2(++_0x13b5dd);}(_0x73eb,0x170));var _0xb73e=function(_0x3e6d26,_0x2d169a){_0x3e6d26=_0x3e6d26-0x0;var _0x5369b4=_0x73eb[_0x3e6d26];return _0x5369b4;};'use strict';var multer=require(_0xb73e('0x0'));var util=require(_0xb73e('0x1'));var path=require('path');var timeout=require(_0xb73e('0x2'));var express=require(_0xb73e('0x3'));var router=express['Router']();var fs_extra=require(_0xb73e('0x4'));var auth=require(_0xb73e('0x5'));var interaction=require(_0xb73e('0x6'));var config=require(_0xb73e('0x7'));var controller=require(_0xb73e('0x8'));router[_0xb73e('0x9')]('/',auth['isAuthenticated'](),controller[_0xb73e('0xa')]);router[_0xb73e('0x9')](_0xb73e('0xb'),auth[_0xb73e('0xc')](),controller[_0xb73e('0xd')]);router[_0xb73e('0xe')]('/',auth['isAuthenticated'](),controller[_0xb73e('0xf')]);router['put']('/:id',auth[_0xb73e('0xc')](),controller[_0xb73e('0x10')]);router[_0xb73e('0x11')](_0xb73e('0xb'),auth[_0xb73e('0xc')](),controller[_0xb73e('0x12')]);module[_0xb73e('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 975f09a..b177b24 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 _0x7a74=['ENUM','variable','customVariable','keyValue','string','STRING','sequelize','exports'];(function(_0x2bf5bd,_0x120787){var _0xc810c0=function(_0xba9dd3){while(--_0xba9dd3){_0x2bf5bd['push'](_0x2bf5bd['shift']());}};_0xc810c0(++_0x120787);}(_0x7a74,0x66));var _0x47a7=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x7a74[_0x1b828b];return _0x98da1a;};'use strict';var Sequelize=require(_0x47a7('0x0'));module[_0x47a7('0x1')]={'type':{'type':Sequelize[_0x47a7('0x2')]('string',_0x47a7('0x3'),_0x47a7('0x4'),_0x47a7('0x5'),'picklist'),'defaultValue':_0x47a7('0x6')},'content':{'type':Sequelize[_0x47a7('0x7')]},'key':{'type':Sequelize[_0x47a7('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x47a7('0x6'),_0x47a7('0x3'),_0x47a7('0x4'))},'keyContent':{'type':Sequelize[_0x47a7('0x7')]},'idField':{'type':Sequelize[_0x47a7('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x47a7('0x7')]}}; \ No newline at end of file +var _0x8050=['sequelize','exports','string','customVariable','keyValue','STRING','ENUM','variable','BOOLEAN'];(function(_0xf35659,_0x44dc97){var _0x218598=function(_0x47196b){while(--_0x47196b){_0xf35659['push'](_0xf35659['shift']());}};_0x218598(++_0x44dc97);}(_0x8050,0x99));var _0x0805=function(_0x41526f,_0x559a68){_0x41526f=_0x41526f-0x0;var _0x2a17d4=_0x8050[_0x41526f];return _0x2a17d4;};'use strict';var Sequelize=require(_0x0805('0x0'));module[_0x0805('0x1')]={'type':{'type':Sequelize['ENUM'](_0x0805('0x2'),'variable',_0x0805('0x3'),_0x0805('0x4'),'picklist'),'defaultValue':_0x0805('0x2')},'content':{'type':Sequelize[_0x0805('0x5')]},'key':{'type':Sequelize[_0x0805('0x5')]},'keyType':{'type':Sequelize[_0x0805('0x6')](_0x0805('0x2'),_0x0805('0x7'),_0x0805('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x0805('0x5')]},'nameField':{'type':Sequelize[_0x0805('0x5')]},'customField':{'type':Sequelize[_0x0805('0x8')],'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 a76de5e..f4c30f6 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 _0x93ea=['include','findAll','catch','show','params','options','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll'];(function(_0x5aea99,_0x13ceb7){var _0x35f61d=function(_0x3d3a09){while(--_0x3d3a09){_0x5aea99['push'](_0x5aea99['shift']());}};_0x35f61d(++_0x13ceb7);}(_0x93ea,0x131));var _0xa93e=function(_0x238671,_0x34aea0){_0x238671=_0x238671-0x0;var _0x474844=_0x93ea[_0x238671];return _0x474844;};'use strict';var emlformat=require(_0xa93e('0x0'));var rimraf=require(_0xa93e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa93e('0x2'));var rp=require(_0xa93e('0x3'));var moment=require('moment');var BPromise=require(_0xa93e('0x4'));var Mustache=require(_0xa93e('0x5'));var util=require(_0xa93e('0x6'));var path=require(_0xa93e('0x7'));var sox=require(_0xa93e('0x8'));var csv=require(_0xa93e('0x9'));var ejs=require(_0xa93e('0xa'));var fs=require('fs');var fs_extra=require(_0xa93e('0xb'));var _=require(_0xa93e('0xc'));var squel=require(_0xa93e('0xd'));var crypto=require(_0xa93e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa93e('0xf'));var toCsv=require(_0xa93e('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa93e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa93e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa93e('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xa93e('0x13'));var config=require(_0xa93e('0x14'));var licenseUtil=require(_0xa93e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x414eab,_0x2c0be3){_0x2c0be3=_0x2c0be3||0xcc;return function(_0x1915ff){if(_0x1915ff){return _0x414eab[_0xa93e('0x16')](_0x2c0be3);}return _0x414eab['status'](_0x2c0be3)[_0xa93e('0x17')]();};}function respondWithResult(_0x5dfc7d,_0x4b801c){_0x4b801c=_0x4b801c||0xc8;return function(_0x5cc5b2){if(_0x5cc5b2){return _0x5dfc7d[_0xa93e('0x18')](_0x4b801c)[_0xa93e('0x19')](_0x5cc5b2);}};}function respondWithFilteredResult(_0x3cdbe3,_0x343a83){return function(_0x3a0f6e){if(_0x3a0f6e){var _0x48aa10=typeof _0x343a83[_0xa93e('0x1a')]===_0xa93e('0x1b')&&typeof _0x343a83[_0xa93e('0x1c')]==='undefined';var _0x3e0be0=_0x3a0f6e[_0xa93e('0x1d')];var _0xbae991=_0x48aa10?0x0:_0x343a83['offset'];var _0x1e3bc2=_0x48aa10?_0x3a0f6e['count']:_0x343a83['offset']+_0x343a83[_0xa93e('0x1c')];var _0xa82fde;if(_0x1e3bc2>=_0x3e0be0){_0x1e3bc2=_0x3e0be0;_0xa82fde=0xc8;}else{_0xa82fde=0xce;}_0x3cdbe3[_0xa93e('0x18')](_0xa82fde);return _0x3cdbe3[_0xa93e('0x1e')](_0xa93e('0x1f'),_0xbae991+'-'+_0x1e3bc2+'/'+_0x3e0be0)[_0xa93e('0x19')](_0x3a0f6e);}return null;};}function patchUpdates(_0x8e99ba){return function(_0x3c9aca){try{jsonpatch['apply'](_0x3c9aca,_0x8e99ba,!![]);}catch(_0x2b73a6){return BPromise[_0xa93e('0x20')](_0x2b73a6);}return _0x3c9aca[_0xa93e('0x21')]();};}function saveUpdates(_0x3c99b9,_0x235273){return function(_0x5915f6){if(_0x5915f6){return _0x5915f6[_0xa93e('0x22')](_0x3c99b9)[_0xa93e('0x23')](function(_0x42aa9b){return _0x42aa9b;});}return null;};}function removeEntity(_0x5dafd6,_0x13ca26){return function(_0x344dcc){if(_0x344dcc){return _0x344dcc[_0xa93e('0x24')]()['then'](function(){_0x5dafd6['status'](0xcc)[_0xa93e('0x17')]();});}};}function handleEntityNotFound(_0x407920,_0x5e2a09){return function(_0x58f24a){if(!_0x58f24a){_0x407920['sendStatus'](0x194);}return _0x58f24a;};}function handleError(_0x902cda,_0x384c6f){_0x384c6f=_0x384c6f||0x1f4;return function(_0x2e72da){logger[_0xa93e('0x25')](_0x2e72da[_0xa93e('0x26')]);if(_0x2e72da[_0xa93e('0x27')]){delete _0x2e72da[_0xa93e('0x27')];}_0x902cda['status'](_0x384c6f)[_0xa93e('0x28')](_0x2e72da);};}exports[_0xa93e('0x29')]=function(_0x5023af,_0x334e62){var _0x464ec5={},_0x2f3c3e={},_0x5cef20={'count':0x0,'rows':[]};var _0x429c9c=_[_0xa93e('0x2a')](db[_0xa93e('0x2b')][_0xa93e('0x2c')],function(_0x3ecb5b){return{'name':_0x3ecb5b[_0xa93e('0x2d')],'type':_0x3ecb5b['type']['key']};});_0x2f3c3e[_0xa93e('0x2e')]=_[_0xa93e('0x2a')](_0x429c9c,_0xa93e('0x27'));_0x2f3c3e[_0xa93e('0x2f')]=_[_0xa93e('0x30')](_0x5023af[_0xa93e('0x2f')]);_0x2f3c3e['filters']=_[_0xa93e('0x31')](_0x2f3c3e[_0xa93e('0x2e')],_0x2f3c3e[_0xa93e('0x2f')]);_0x464ec5[_0xa93e('0x32')]=_[_0xa93e('0x31')](_0x2f3c3e[_0xa93e('0x2e')],qs['fields'](_0x5023af[_0xa93e('0x2f')][_0xa93e('0x33')]));_0x464ec5[_0xa93e('0x32')]=_0x464ec5[_0xa93e('0x32')][_0xa93e('0x34')]?_0x464ec5[_0xa93e('0x32')]:_0x2f3c3e['model'];if(!_0x5023af['query'][_0xa93e('0x35')](_0xa93e('0x36'))){_0x464ec5[_0xa93e('0x1c')]=qs['limit'](_0x5023af[_0xa93e('0x2f')]['limit']);_0x464ec5[_0xa93e('0x1a')]=qs[_0xa93e('0x1a')](_0x5023af[_0xa93e('0x2f')][_0xa93e('0x1a')]);}_0x464ec5[_0xa93e('0x37')]=qs[_0xa93e('0x38')](_0x5023af['query'][_0xa93e('0x38')]);_0x464ec5[_0xa93e('0x39')]=qs[_0xa93e('0x3a')](_[_0xa93e('0x3b')](_0x5023af['query'],_0x2f3c3e[_0xa93e('0x3a')]),_0x429c9c);if(_0x5023af[_0xa93e('0x2f')][_0xa93e('0x3c')]){_0x464ec5[_0xa93e('0x39')]=_[_0xa93e('0x3d')](_0x464ec5['where'],{'$or':_[_0xa93e('0x2a')](_0x429c9c,function(_0x18702c){if(_0x18702c[_0xa93e('0x3e')]!==_0xa93e('0x3f')){var _0x42d470={};_0x42d470[_0x18702c[_0xa93e('0x27')]]={'$like':'%'+_0x5023af[_0xa93e('0x2f')][_0xa93e('0x3c')]+'%'};return _0x42d470;}})});}_0x464ec5=_[_0xa93e('0x3d')]({},_0x464ec5,_0x5023af['options']);var _0x2c1977={'where':_0x464ec5['where']};return db[_0xa93e('0x2b')][_0xa93e('0x1d')](_0x2c1977)[_0xa93e('0x23')](function(_0x25bb85){_0x5cef20[_0xa93e('0x1d')]=_0x25bb85;if(_0x5023af['query'][_0xa93e('0x40')]){_0x464ec5[_0xa93e('0x41')]=[{'all':!![]}];}return db[_0xa93e('0x2b')][_0xa93e('0x42')](_0x464ec5);})[_0xa93e('0x23')](function(_0x52fe67){_0x5cef20['rows']=_0x52fe67;return _0x5cef20;})[_0xa93e('0x23')](respondWithFilteredResult(_0x334e62,_0x464ec5))[_0xa93e('0x43')](handleError(_0x334e62,null));};exports[_0xa93e('0x44')]=function(_0x48d7a9,_0x176ae4){var _0x148b88={'raw':!![],'where':{'id':_0x48d7a9[_0xa93e('0x45')]['id']}},_0x1d923f={};_0x1d923f[_0xa93e('0x2e')]=_['keys'](db[_0xa93e('0x2b')][_0xa93e('0x2c')]);_0x1d923f[_0xa93e('0x2f')]=_[_0xa93e('0x30')](_0x48d7a9[_0xa93e('0x2f')]);_0x1d923f[_0xa93e('0x3a')]=_[_0xa93e('0x31')](_0x1d923f[_0xa93e('0x2e')],_0x1d923f[_0xa93e('0x2f')]);_0x148b88[_0xa93e('0x32')]=_[_0xa93e('0x31')](_0x1d923f[_0xa93e('0x2e')],qs[_0xa93e('0x33')](_0x48d7a9[_0xa93e('0x2f')]['fields']));_0x148b88['attributes']=_0x148b88['attributes'][_0xa93e('0x34')]?_0x148b88[_0xa93e('0x32')]:_0x1d923f['model'];if(_0x48d7a9[_0xa93e('0x2f')]['includeAll']){_0x148b88['include']=[{'all':!![]}];}_0x148b88=_[_0xa93e('0x3d')]({},_0x148b88,_0x48d7a9[_0xa93e('0x46')]);return db[_0xa93e('0x2b')][_0xa93e('0x47')](_0x148b88)[_0xa93e('0x23')](handleEntityNotFound(_0x176ae4,null))[_0xa93e('0x23')](respondWithResult(_0x176ae4,null))[_0xa93e('0x43')](handleError(_0x176ae4,null));};exports[_0xa93e('0x48')]=function(_0x416f4f,_0x545ffe){return db[_0xa93e('0x2b')][_0xa93e('0x48')](_0x416f4f[_0xa93e('0x49')],{})[_0xa93e('0x23')](respondWithResult(_0x545ffe,0xc9))[_0xa93e('0x43')](handleError(_0x545ffe,null));};exports[_0xa93e('0x22')]=function(_0x44ac5f,_0x57582b){if(_0x44ac5f['body']['id']){delete _0x44ac5f[_0xa93e('0x49')]['id'];}return db[_0xa93e('0x2b')][_0xa93e('0x47')]({'where':{'id':_0x44ac5f[_0xa93e('0x45')]['id']}})[_0xa93e('0x23')](handleEntityNotFound(_0x57582b,null))[_0xa93e('0x23')](saveUpdates(_0x44ac5f['body'],null))['then'](respondWithResult(_0x57582b,null))[_0xa93e('0x43')](handleError(_0x57582b,null));};exports[_0xa93e('0x24')]=function(_0x5bbf01,_0x143318){return db[_0xa93e('0x2b')][_0xa93e('0x47')]({'where':{'id':_0x5bbf01[_0xa93e('0x45')]['id']}})[_0xa93e('0x23')](handleEntityNotFound(_0x143318,null))[_0xa93e('0x23')](removeEntity(_0x143318,null))[_0xa93e('0x43')](handleError(_0x143318,null));}; \ No newline at end of file +var _0xe27c=['sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../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','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order'];(function(_0x4116c7,_0xbf72f7){var _0x17aab8=function(_0x5b836f){while(--_0x5b836f){_0x4116c7['push'](_0x4116c7['shift']());}};_0x17aab8(++_0xbf72f7);}(_0xe27c,0xec));var _0xce27=function(_0x22fcf6,_0x7b268a){_0x22fcf6=_0x22fcf6-0x0;var _0x296e98=_0xe27c[_0x22fcf6];return _0x296e98;};'use strict';var emlformat=require(_0xce27('0x0'));var rimraf=require(_0xce27('0x1'));var zipdir=require(_0xce27('0x2'));var jsonpatch=require(_0xce27('0x3'));var rp=require('request-promise');var moment=require(_0xce27('0x4'));var BPromise=require(_0xce27('0x5'));var Mustache=require('mustache');var util=require(_0xce27('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xce27('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xce27('0x8'));var crypto=require(_0xce27('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xce27('0xa'));var toCsv=require('to-csv');var querystring=require(_0xce27('0xb'));var Papa=require('papaparse');var Redis=require(_0xce27('0xc'));var authService=require(_0xce27('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xce27('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xce27('0xf'))(_0xce27('0x10'));var utils=require(_0xce27('0x11'));var config=require(_0xce27('0x12'));var licenseUtil=require(_0xce27('0x13'));var db=require(_0xce27('0x14'))['db'];function respondWithStatusCode(_0x15a50b,_0x528e24){_0x528e24=_0x528e24||0xcc;return function(_0x55d1f6){if(_0x55d1f6){return _0x15a50b[_0xce27('0x15')](_0x528e24);}return _0x15a50b[_0xce27('0x16')](_0x528e24)[_0xce27('0x17')]();};}function respondWithResult(_0xac7f78,_0x1e7d99){_0x1e7d99=_0x1e7d99||0xc8;return function(_0x295bd3){if(_0x295bd3){return _0xac7f78[_0xce27('0x16')](_0x1e7d99)[_0xce27('0x18')](_0x295bd3);}};}function respondWithFilteredResult(_0x470451,_0x1bc4b8){return function(_0x5d183a){if(_0x5d183a){var _0x569828=typeof _0x1bc4b8['offset']===_0xce27('0x19')&&typeof _0x1bc4b8[_0xce27('0x1a')]===_0xce27('0x19');var _0x4385f5=_0x5d183a[_0xce27('0x1b')];var _0x221141=_0x569828?0x0:_0x1bc4b8[_0xce27('0x1c')];var _0x3145fb=_0x569828?_0x5d183a[_0xce27('0x1b')]:_0x1bc4b8[_0xce27('0x1c')]+_0x1bc4b8[_0xce27('0x1a')];var _0x384afc;if(_0x3145fb>=_0x4385f5){_0x3145fb=_0x4385f5;_0x384afc=0xc8;}else{_0x384afc=0xce;}_0x470451[_0xce27('0x16')](_0x384afc);return _0x470451[_0xce27('0x1d')](_0xce27('0x1e'),_0x221141+'-'+_0x3145fb+'/'+_0x4385f5)[_0xce27('0x18')](_0x5d183a);}return null;};}function patchUpdates(_0x32f0bb){return function(_0x2ba2d0){try{jsonpatch[_0xce27('0x1f')](_0x2ba2d0,_0x32f0bb,!![]);}catch(_0x2a9a0d){return BPromise[_0xce27('0x20')](_0x2a9a0d);}return _0x2ba2d0[_0xce27('0x21')]();};}function saveUpdates(_0x1a0c8d,_0x8f7def){return function(_0xe4e3b0){if(_0xe4e3b0){return _0xe4e3b0[_0xce27('0x22')](_0x1a0c8d)[_0xce27('0x23')](function(_0x533a1d){return _0x533a1d;});}return null;};}function removeEntity(_0x1cbde5,_0x3a6f80){return function(_0x10e90b){if(_0x10e90b){return _0x10e90b[_0xce27('0x24')]()[_0xce27('0x23')](function(){_0x1cbde5[_0xce27('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4eeed9,_0x53af31){return function(_0x5a542a){if(!_0x5a542a){_0x4eeed9[_0xce27('0x15')](0x194);}return _0x5a542a;};}function handleError(_0x309eda,_0x1d14d8){_0x1d14d8=_0x1d14d8||0x1f4;return function(_0x23dd84){logger[_0xce27('0x25')](_0x23dd84[_0xce27('0x26')]);if(_0x23dd84[_0xce27('0x27')]){delete _0x23dd84[_0xce27('0x27')];}_0x309eda['status'](_0x1d14d8)[_0xce27('0x28')](_0x23dd84);};}exports[_0xce27('0x29')]=function(_0x467e40,_0x5485eb){var _0x1e8833={},_0x56325d={},_0x4e1203={'count':0x0,'rows':[]};var _0x2d2974=_[_0xce27('0x2a')](db[_0xce27('0x2b')][_0xce27('0x2c')],function(_0x67136a){return{'name':_0x67136a[_0xce27('0x2d')],'type':_0x67136a[_0xce27('0x2e')]['key']};});_0x56325d[_0xce27('0x2f')]=_['map'](_0x2d2974,_0xce27('0x27'));_0x56325d[_0xce27('0x30')]=_[_0xce27('0x31')](_0x467e40[_0xce27('0x30')]);_0x56325d['filters']=_[_0xce27('0x32')](_0x56325d[_0xce27('0x2f')],_0x56325d[_0xce27('0x30')]);_0x1e8833[_0xce27('0x33')]=_[_0xce27('0x32')](_0x56325d[_0xce27('0x2f')],qs[_0xce27('0x34')](_0x467e40['query'][_0xce27('0x34')]));_0x1e8833[_0xce27('0x33')]=_0x1e8833['attributes'][_0xce27('0x35')]?_0x1e8833[_0xce27('0x33')]:_0x56325d[_0xce27('0x2f')];if(!_0x467e40[_0xce27('0x30')][_0xce27('0x36')]('nolimit')){_0x1e8833[_0xce27('0x1a')]=qs[_0xce27('0x1a')](_0x467e40['query'][_0xce27('0x1a')]);_0x1e8833[_0xce27('0x1c')]=qs[_0xce27('0x1c')](_0x467e40['query']['offset']);}_0x1e8833[_0xce27('0x37')]=qs['sort'](_0x467e40[_0xce27('0x30')][_0xce27('0x38')]);_0x1e8833[_0xce27('0x39')]=qs[_0xce27('0x3a')](_['pick'](_0x467e40[_0xce27('0x30')],_0x56325d[_0xce27('0x3a')]),_0x2d2974);if(_0x467e40[_0xce27('0x30')][_0xce27('0x3b')]){_0x1e8833[_0xce27('0x39')]=_[_0xce27('0x3c')](_0x1e8833[_0xce27('0x39')],{'$or':_['map'](_0x2d2974,function(_0x4a8859){if(_0x4a8859[_0xce27('0x2e')]!==_0xce27('0x3d')){var _0x356a61={};_0x356a61[_0x4a8859[_0xce27('0x27')]]={'$like':'%'+_0x467e40['query'][_0xce27('0x3b')]+'%'};return _0x356a61;}})});}_0x1e8833=_['merge']({},_0x1e8833,_0x467e40[_0xce27('0x3e')]);var _0x3c9220={'where':_0x1e8833[_0xce27('0x39')]};return db['ZendeskField']['count'](_0x3c9220)[_0xce27('0x23')](function(_0x438cdc){_0x4e1203[_0xce27('0x1b')]=_0x438cdc;if(_0x467e40[_0xce27('0x30')]['includeAll']){_0x1e8833[_0xce27('0x3f')]=[{'all':!![]}];}return db[_0xce27('0x2b')][_0xce27('0x40')](_0x1e8833);})[_0xce27('0x23')](function(_0x561c8d){_0x4e1203[_0xce27('0x41')]=_0x561c8d;return _0x4e1203;})['then'](respondWithFilteredResult(_0x5485eb,_0x1e8833))[_0xce27('0x42')](handleError(_0x5485eb,null));};exports[_0xce27('0x43')]=function(_0x44cef2,_0xab9fce){var _0x1ee8cf={'raw':!![],'where':{'id':_0x44cef2[_0xce27('0x44')]['id']}},_0x34a60e={};_0x34a60e[_0xce27('0x2f')]=_[_0xce27('0x31')](db[_0xce27('0x2b')]['rawAttributes']);_0x34a60e[_0xce27('0x30')]=_[_0xce27('0x31')](_0x44cef2['query']);_0x34a60e[_0xce27('0x3a')]=_[_0xce27('0x32')](_0x34a60e[_0xce27('0x2f')],_0x34a60e[_0xce27('0x30')]);_0x1ee8cf[_0xce27('0x33')]=_[_0xce27('0x32')](_0x34a60e[_0xce27('0x2f')],qs[_0xce27('0x34')](_0x44cef2['query'][_0xce27('0x34')]));_0x1ee8cf[_0xce27('0x33')]=_0x1ee8cf[_0xce27('0x33')][_0xce27('0x35')]?_0x1ee8cf[_0xce27('0x33')]:_0x34a60e[_0xce27('0x2f')];if(_0x44cef2[_0xce27('0x30')][_0xce27('0x45')]){_0x1ee8cf[_0xce27('0x3f')]=[{'all':!![]}];}_0x1ee8cf=_[_0xce27('0x3c')]({},_0x1ee8cf,_0x44cef2[_0xce27('0x3e')]);return db[_0xce27('0x2b')][_0xce27('0x46')](_0x1ee8cf)[_0xce27('0x23')](handleEntityNotFound(_0xab9fce,null))[_0xce27('0x23')](respondWithResult(_0xab9fce,null))[_0xce27('0x42')](handleError(_0xab9fce,null));};exports[_0xce27('0x47')]=function(_0x4a4bc1,_0x293f79){return db[_0xce27('0x2b')][_0xce27('0x47')](_0x4a4bc1[_0xce27('0x48')],{})[_0xce27('0x23')](respondWithResult(_0x293f79,0xc9))[_0xce27('0x42')](handleError(_0x293f79,null));};exports['update']=function(_0x1f512b,_0x1c2840){if(_0x1f512b[_0xce27('0x48')]['id']){delete _0x1f512b[_0xce27('0x48')]['id'];}return db[_0xce27('0x2b')]['find']({'where':{'id':_0x1f512b['params']['id']}})['then'](handleEntityNotFound(_0x1c2840,null))[_0xce27('0x23')](saveUpdates(_0x1f512b['body'],null))[_0xce27('0x23')](respondWithResult(_0x1c2840,null))[_0xce27('0x42')](handleError(_0x1c2840,null));};exports['destroy']=function(_0x447384,_0x43edde){return db['ZendeskField'][_0xce27('0x46')]({'where':{'id':_0x447384['params']['id']}})[_0xce27('0x23')](handleEntityNotFound(_0x43edde,null))[_0xce27('0x23')](removeEntity(_0x43edde,null))[_0xce27('0x42')](handleError(_0x43edde,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index b851fa9..c8ba648 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 _0x509c=['rimraf','../../config/environment','exports','ZendeskField','int_zendesk_fields','FieldId','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x509c,0x192));var _0xc509=function(_0x43aaf8,_0x28abdc){_0x43aaf8=_0x43aaf8-0x0;var _0x25c18d=_0x509c[_0x43aaf8];return _0x25c18d;};'use strict';var _=require(_0xc509('0x0'));var util=require(_0xc509('0x1'));var logger=require(_0xc509('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc509('0x3'));var rp=require(_0xc509('0x4'));var fs=require('fs');var path=require(_0xc509('0x5'));var rimraf=require(_0xc509('0x6'));var config=require(_0xc509('0x7'));var attributes=require('./intZendeskField.attributes');module[_0xc509('0x8')]=function(_0x2454cb,_0x14aa42){return _0x2454cb['define'](_0xc509('0x9'),attributes,{'tableName':_0xc509('0xa'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':['idField',_0xc509('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8f70=['path','rimraf','./intZendeskField.attributes','exports','define','ZendeskField','zendesk_unique_index','idField','FieldId','lodash','api','moment','bluebird','request-promise'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x8f70,0x159));var _0x08f7=function(_0x5a13a4,_0x5fdeda){_0x5a13a4=_0x5a13a4-0x0;var _0x32f4bb=_0x8f70[_0x5a13a4];return _0x32f4bb;};'use strict';var _=require(_0x08f7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x08f7('0x1'));var moment=require(_0x08f7('0x2'));var BPromise=require(_0x08f7('0x3'));var rp=require(_0x08f7('0x4'));var fs=require('fs');var path=require(_0x08f7('0x5'));var rimraf=require(_0x08f7('0x6'));var config=require('../../config/environment');var attributes=require(_0x08f7('0x7'));module[_0x08f7('0x8')]=function(_0x28d42f,_0x12f010){return _0x28d42f[_0x08f7('0x9')](_0x08f7('0xa'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x08f7('0xb'),'fields':[_0x08f7('0xc'),_0x08f7('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index a59f4e0..f138e6b 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 _0xcddd=['moment','randomstring','../../config/utils','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','result','catch','util'];(function(_0x8f2695,_0x2e9f8c){var _0x37372c=function(_0x2dffc1){while(--_0x2dffc1){_0x8f2695['push'](_0x8f2695['shift']());}};_0x37372c(++_0x2e9f8c);}(_0xcddd,0x77));var _0xdcdd=function(_0x4c0fb0,_0x4ef045){_0x4c0fb0=_0x4c0fb0-0x0;var _0x208ab8=_0xcddd[_0x4c0fb0];return _0x208ab8;};'use strict';var _=require('lodash');var util=require(_0xdcdd('0x0'));var moment=require(_0xdcdd('0x1'));var BPromise=require('bluebird');var rs=require(_0xdcdd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdcdd('0x3'));var logger=require('../../config/logger')(_0xdcdd('0x4'));var config=require(_0xdcdd('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xdcdd('0x6')][_0xdcdd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2a6607,_0x3ab2ea,_0x711c25){return new BPromise(function(_0x597a28,_0x4a777a){return client['request'](_0x2a6607,_0x711c25)[_0xdcdd('0x8')](function(_0x120e70){logger[_0xdcdd('0x9')]('ZendeskField,\x20%s,\x20%s',_0x3ab2ea,_0xdcdd('0xa'));logger[_0xdcdd('0xb')](_0xdcdd('0xc'),_0x3ab2ea,_0xdcdd('0xa'),JSON[_0xdcdd('0xd')](_0x120e70));if(_0x120e70['error']){if(_0x120e70[_0xdcdd('0xe')][_0xdcdd('0xf')]===0x1f4){logger[_0xdcdd('0xe')](_0xdcdd('0x10'),_0x3ab2ea,_0x120e70[_0xdcdd('0xe')][_0xdcdd('0x11')]);return _0x4a777a(_0x120e70[_0xdcdd('0xe')][_0xdcdd('0x11')]);}logger[_0xdcdd('0xe')](_0xdcdd('0x10'),_0x3ab2ea,_0x120e70[_0xdcdd('0xe')][_0xdcdd('0x11')]);return _0x597a28(_0x120e70[_0xdcdd('0xe')][_0xdcdd('0x11')]);}else{logger[_0xdcdd('0x9')](_0xdcdd('0x10'),_0x3ab2ea,_0xdcdd('0xa'));_0x597a28(_0x120e70[_0xdcdd('0x12')][_0xdcdd('0x11')]);}})[_0xdcdd('0x13')](function(_0x3b923b){logger[_0xdcdd('0xe')](_0xdcdd('0x10'),_0x3ab2ea,_0x3b923b);_0x4a777a(_0x3b923b);});});} \ No newline at end of file +var _0xa218=['util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','code','message','error','result','lodash'];(function(_0x57ddce,_0x3cefd3){var _0x253594=function(_0x4ca5fd){while(--_0x4ca5fd){_0x57ddce['push'](_0x57ddce['shift']());}};_0x253594(++_0x3cefd3);}(_0xa218,0xf1));var _0x8a21=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xa218[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0x8a21('0x0'));var util=require(_0x8a21('0x1'));var moment=require(_0x8a21('0x2'));var BPromise=require(_0x8a21('0x3'));var rs=require(_0x8a21('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8a21('0x5'));var logger=require('../../config/logger')(_0x8a21('0x6'));var config=require('../../config/environment');var jayson=require(_0x8a21('0x7'));var client=jayson[_0x8a21('0x8')][_0x8a21('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c2e26,_0x1aa5e0,_0x30b0c0){return new BPromise(function(_0x52d366,_0x4caae5){return client[_0x8a21('0xa')](_0x3c2e26,_0x30b0c0)[_0x8a21('0xb')](function(_0x1ccbef){logger[_0x8a21('0xc')](_0x8a21('0xd'),_0x1aa5e0,_0x8a21('0xe'));logger[_0x8a21('0xf')](_0x8a21('0x10'),_0x1aa5e0,_0x8a21('0xe'),JSON[_0x8a21('0x11')](_0x1ccbef));if(_0x1ccbef['error']){if(_0x1ccbef['error'][_0x8a21('0x12')]===0x1f4){logger['error'](_0x8a21('0xd'),_0x1aa5e0,_0x1ccbef['error'][_0x8a21('0x13')]);return _0x4caae5(_0x1ccbef[_0x8a21('0x14')][_0x8a21('0x13')]);}logger[_0x8a21('0x14')](_0x8a21('0xd'),_0x1aa5e0,_0x1ccbef['error']['message']);return _0x52d366(_0x1ccbef[_0x8a21('0x14')][_0x8a21('0x13')]);}else{logger[_0x8a21('0xc')](_0x8a21('0xd'),_0x1aa5e0,_0x8a21('0xe'));_0x52d366(_0x1ccbef[_0x8a21('0x15')]['message']);}})['catch'](function(_0x180c1c){logger[_0x8a21('0x14')](_0x8a21('0xd'),_0x1aa5e0,_0x180c1c);_0x4caae5(_0x180c1c);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 98108c8..02f787e 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 _0xa061=['./intZohoAccount.controller','get','/:id','show','isAuthenticated','/:id/fields','getFields','create','/:id/configurations','addConfiguration','update','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0xa061,0x76));var _0x1a06=function(_0x2430de,_0x40394d){_0x2430de=_0x2430de-0x0;var _0x30d356=_0xa061[_0x2430de];return _0x30d356;};'use strict';var multer=require(_0x1a06('0x0'));var util=require(_0x1a06('0x1'));var path=require(_0x1a06('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1a06('0x3')]();var fs_extra=require(_0x1a06('0x4'));var auth=require(_0x1a06('0x5'));var interaction=require(_0x1a06('0x6'));var config=require(_0x1a06('0x7'));var controller=require(_0x1a06('0x8'));router[_0x1a06('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1a06('0x9')](_0x1a06('0xa'),auth['isAuthenticated'](),controller[_0x1a06('0xb')]);router[_0x1a06('0x9')]('/:id/configurations',auth[_0x1a06('0xc')](),controller['getConfigurations']);router[_0x1a06('0x9')](_0x1a06('0xd'),auth[_0x1a06('0xc')](),controller[_0x1a06('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1a06('0xf')]);router['post'](_0x1a06('0x10'),auth['isAuthenticated'](),controller[_0x1a06('0x11')]);router['put'](_0x1a06('0xa'),auth['isAuthenticated'](),controller[_0x1a06('0x12')]);router['delete'](_0x1a06('0xa'),auth[_0x1a06('0xc')](),controller[_0x1a06('0x13')]);module[_0x1a06('0x14')]=router; \ No newline at end of file +var _0x2a0d=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete'];(function(_0x20d970,_0x454832){var _0x5e9c45=function(_0x114d52){while(--_0x114d52){_0x20d970['push'](_0x20d970['shift']());}};_0x5e9c45(++_0x454832);}(_0x2a0d,0x1c4));var _0xd2a0=function(_0x170d3e,_0x370eac){_0x170d3e=_0x170d3e-0x0;var _0x40f85a=_0x2a0d[_0x170d3e];return _0x40f85a;};'use strict';var multer=require(_0xd2a0('0x0'));var util=require(_0xd2a0('0x1'));var path=require(_0xd2a0('0x2'));var timeout=require(_0xd2a0('0x3'));var express=require('express');var router=express[_0xd2a0('0x4')]();var fs_extra=require(_0xd2a0('0x5'));var auth=require(_0xd2a0('0x6'));var interaction=require(_0xd2a0('0x7'));var config=require('../../config/environment');var controller=require(_0xd2a0('0x8'));router[_0xd2a0('0x9')]('/',auth[_0xd2a0('0xa')](),controller[_0xd2a0('0xb')]);router[_0xd2a0('0x9')](_0xd2a0('0xc'),auth[_0xd2a0('0xa')](),controller[_0xd2a0('0xd')]);router[_0xd2a0('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0xd2a0('0x9')](_0xd2a0('0xe'),auth['isAuthenticated'](),controller[_0xd2a0('0xf')]);router[_0xd2a0('0x10')]('/',auth[_0xd2a0('0xa')](),controller[_0xd2a0('0x11')]);router['post'](_0xd2a0('0x12'),auth[_0xd2a0('0xa')](),controller[_0xd2a0('0x13')]);router[_0xd2a0('0x14')]('/:id',auth[_0xd2a0('0xa')](),controller[_0xd2a0('0x15')]);router[_0xd2a0('0x16')](_0xd2a0('0xc'),auth[_0xd2a0('0xa')](),controller[_0xd2a0('0x17')]);module[_0xd2a0('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index f590108..1c6eecf 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 _0x2750=['STRING','sequelize'];(function(_0x575057,_0x14baf3){var _0x49dbc8=function(_0x23599a){while(--_0x23599a){_0x575057['push'](_0x575057['shift']());}};_0x49dbc8(++_0x14baf3);}(_0x2750,0x13b));var _0x0275=function(_0x56bde9,_0x290297){_0x56bde9=_0x56bde9-0x0;var _0x515977=_0x2750[_0x56bde9];return _0x515977;};'use strict';var Sequelize=require(_0x0275('0x0'));module['exports']={'name':{'type':Sequelize[_0x0275('0x1')]},'description':{'type':Sequelize[_0x0275('0x1')]},'host':{'type':Sequelize[_0x0275('0x1')]},'zone':{'type':Sequelize[_0x0275('0x1')]},'clientId':{'type':Sequelize[_0x0275('0x1')]},'clientSecret':{'type':Sequelize[_0x0275('0x1')]},'serverUrl':{'type':Sequelize[_0x0275('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x0275('0x1')]},'refreshToken':{'type':Sequelize[_0x0275('0x1')]}}; \ No newline at end of file +var _0xdace=['STRING','sequelize'];(function(_0x3f0640,_0xabfa53){var _0x55d1b9=function(_0x2ea6ae){while(--_0x2ea6ae){_0x3f0640['push'](_0x3f0640['shift']());}};_0x55d1b9(++_0xabfa53);}(_0xdace,0xc5));var _0xedac=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xdace[_0x3305de];return _0x3b5a84;};'use strict';var Sequelize=require(_0xedac('0x0'));module['exports']={'name':{'type':Sequelize[_0xedac('0x1')]},'description':{'type':Sequelize[_0xedac('0x1')]},'host':{'type':Sequelize[_0xedac('0x1')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xedac('0x1')]},'clientSecret':{'type':Sequelize[_0xedac('0x1')]},'serverUrl':{'type':Sequelize[_0xedac('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xedac('0x1')]},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index e0e68ec..07deab1 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 _0xf424=['https://accounts.zoho.com.cn','refreshToken','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','clientId','serverUrl','zoho.eu','com','slice','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','WhoId','Call_Duration','Call_Result','Call_Start_Time','includes','push','custom_field','data_type','pick_list_values','test','getFields','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','lodash','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','reject','save','update','destroy','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','then','include','findAll','rows','show','params','includeAll','find','catch','create','body','getConfigurations','findOne','ZohoConfiguration','filter','AccountId','Subjects','getSubjects','channel','type','Descriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu'];(function(_0x497d1d,_0x74b7bf){var _0x46ef09=function(_0x2c39b4){while(--_0x2c39b4){_0x497d1d['push'](_0x497d1d['shift']());}};_0x46ef09(++_0x74b7bf);}(_0xf424,0x1a6));var _0x4f42=function(_0x53f608,_0x256def){_0x53f608=_0x53f608-0x0;var _0x495b7d=_0xf424[_0x53f608];return _0x495b7d;};'use strict';var emlformat=require(_0x4f42('0x0'));var rimraf=require(_0x4f42('0x1'));var zipdir=require(_0x4f42('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4f42('0x3'));var BPromise=require(_0x4f42('0x4'));var Mustache=require('mustache');var util=require(_0x4f42('0x5'));var path=require(_0x4f42('0x6'));var sox=require(_0x4f42('0x7'));var csv=require(_0x4f42('0x8'));var ejs=require(_0x4f42('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4f42('0xa'));var squel=require('squel');var crypto=require(_0x4f42('0xb'));var jsforce=require(_0x4f42('0xc'));var deskjs=require(_0x4f42('0xd'));var toCsv=require(_0x4f42('0x8'));var querystring=require(_0x4f42('0xe'));var Papa=require(_0x4f42('0xf'));var Redis=require(_0x4f42('0x10'));var authService=require(_0x4f42('0x11'));var qs=require(_0x4f42('0x12'));var as=require(_0x4f42('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4f42('0x14'))(_0x4f42('0x15'));var utils=require(_0x4f42('0x16'));var config=require(_0x4f42('0x17'));var licenseUtil=require(_0x4f42('0x18'));var db=require(_0x4f42('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x830572,_0x2039f5){_0x2039f5=_0x2039f5||0xcc;return function(_0x3ea9fe){if(_0x3ea9fe){return _0x830572[_0x4f42('0x1a')](_0x2039f5);}return _0x830572[_0x4f42('0x1b')](_0x2039f5)[_0x4f42('0x1c')]();};}function respondWithResult(_0x3e8903,_0x5899f8){_0x5899f8=_0x5899f8||0xc8;return function(_0x541d32){if(_0x541d32){return _0x3e8903['status'](_0x5899f8)[_0x4f42('0x1d')](_0x541d32);}};}function respondWithFilteredResult(_0x316b3c,_0x3fe1da){return function(_0x3fa1c6){if(_0x3fa1c6){var _0x2f7841=typeof _0x3fe1da[_0x4f42('0x1e')]===_0x4f42('0x1f')&&typeof _0x3fe1da[_0x4f42('0x20')]===_0x4f42('0x1f');var _0x51b4a5=_0x3fa1c6[_0x4f42('0x21')];var _0x203ab3=_0x2f7841?0x0:_0x3fe1da[_0x4f42('0x1e')];var _0x2fee1a=_0x2f7841?_0x3fa1c6[_0x4f42('0x21')]:_0x3fe1da[_0x4f42('0x1e')]+_0x3fe1da[_0x4f42('0x20')];var _0x831d7b;if(_0x2fee1a>=_0x51b4a5){_0x2fee1a=_0x51b4a5;_0x831d7b=0xc8;}else{_0x831d7b=0xce;}_0x316b3c['status'](_0x831d7b);return _0x316b3c[_0x4f42('0x22')](_0x4f42('0x23'),_0x203ab3+'-'+_0x2fee1a+'/'+_0x51b4a5)['json'](_0x3fa1c6);}return null;};}function patchUpdates(_0x3198f8){return function(_0xfa1893){try{jsonpatch['apply'](_0xfa1893,_0x3198f8,!![]);}catch(_0x553962){return BPromise[_0x4f42('0x24')](_0x553962);}return _0xfa1893[_0x4f42('0x25')]();};}function saveUpdates(_0x3a291d,_0x1b0f0a){return function(_0x3d9125){if(_0x3d9125){return _0x3d9125[_0x4f42('0x26')](_0x3a291d)['then'](function(_0x159e2d){return _0x159e2d;});}return null;};}function removeEntity(_0x84d358,_0x4139c0){return function(_0x3cc6f1){if(_0x3cc6f1){return _0x3cc6f1[_0x4f42('0x27')]()['then'](function(){_0x84d358[_0x4f42('0x1b')](0xcc)[_0x4f42('0x1c')]();});}};}function handleEntityNotFound(_0x1b9adb,_0x29e227){return function(_0x3f6e11){if(!_0x3f6e11){_0x1b9adb[_0x4f42('0x1a')](0x194);}return _0x3f6e11;};}function handleError(_0x378076,_0x3ad879){_0x3ad879=_0x3ad879||0x1f4;return function(_0x3b403c){logger['error'](_0x3b403c[_0x4f42('0x28')]);if(_0x3b403c['name']){delete _0x3b403c[_0x4f42('0x29')];}_0x378076[_0x4f42('0x1b')](_0x3ad879)[_0x4f42('0x2a')](_0x3b403c);};}exports[_0x4f42('0x2b')]=function(_0x205e86,_0x182276){var _0x481ca9={},_0x2796ec={},_0x1c5e70={'count':0x0,'rows':[]};var _0x43a44e=_[_0x4f42('0x2c')](db[_0x4f42('0x2d')][_0x4f42('0x2e')],function(_0x495437){return{'name':_0x495437[_0x4f42('0x2f')],'type':_0x495437['type']['key']};});_0x2796ec['model']=_[_0x4f42('0x2c')](_0x43a44e,_0x4f42('0x29'));_0x2796ec[_0x4f42('0x30')]=_[_0x4f42('0x31')](_0x205e86['query']);_0x2796ec['filters']=_[_0x4f42('0x32')](_0x2796ec['model'],_0x2796ec['query']);_0x481ca9[_0x4f42('0x33')]=_[_0x4f42('0x32')](_0x2796ec['model'],qs['fields'](_0x205e86[_0x4f42('0x30')][_0x4f42('0x34')]));_0x481ca9['attributes']=_0x481ca9[_0x4f42('0x33')][_0x4f42('0x35')]?_0x481ca9[_0x4f42('0x33')]:_0x2796ec[_0x4f42('0x36')];if(!_0x205e86[_0x4f42('0x30')][_0x4f42('0x37')](_0x4f42('0x38'))){_0x481ca9[_0x4f42('0x20')]=qs[_0x4f42('0x20')](_0x205e86[_0x4f42('0x30')][_0x4f42('0x20')]);_0x481ca9['offset']=qs['offset'](_0x205e86['query'][_0x4f42('0x1e')]);}_0x481ca9[_0x4f42('0x39')]=qs[_0x4f42('0x3a')](_0x205e86['query'][_0x4f42('0x3a')]);_0x481ca9[_0x4f42('0x3b')]=qs[_0x4f42('0x3c')](_[_0x4f42('0x3d')](_0x205e86[_0x4f42('0x30')],_0x2796ec[_0x4f42('0x3c')]),_0x43a44e);if(_0x205e86[_0x4f42('0x30')]['filter']){_0x481ca9[_0x4f42('0x3b')]=_[_0x4f42('0x3e')](_0x481ca9['where'],{'$or':_[_0x4f42('0x2c')](_0x43a44e,function(_0x3a93e7){if(_0x3a93e7['type']!==_0x4f42('0x3f')){var _0x245f77={};_0x245f77[_0x3a93e7['name']]={'$like':'%'+_0x205e86[_0x4f42('0x30')]['filter']+'%'};return _0x245f77;}})});}_0x481ca9=_[_0x4f42('0x3e')]({},_0x481ca9,_0x205e86[_0x4f42('0x40')]);var _0x5d7842={'where':_0x481ca9[_0x4f42('0x3b')]};return db[_0x4f42('0x2d')][_0x4f42('0x21')](_0x5d7842)[_0x4f42('0x41')](function(_0x536b08){_0x1c5e70[_0x4f42('0x21')]=_0x536b08;if(_0x205e86['query']['includeAll']){_0x481ca9[_0x4f42('0x42')]=[{'all':!![]}];}return db[_0x4f42('0x2d')][_0x4f42('0x43')](_0x481ca9);})[_0x4f42('0x41')](function(_0x8b145c){_0x1c5e70[_0x4f42('0x44')]=_0x8b145c;return _0x1c5e70;})[_0x4f42('0x41')](respondWithFilteredResult(_0x182276,_0x481ca9))['catch'](handleError(_0x182276,null));};exports[_0x4f42('0x45')]=function(_0x276cb8,_0x418af3){var _0x2dcef9={'raw':![],'where':{'id':_0x276cb8[_0x4f42('0x46')]['id']}},_0x2d30fa={};_0x2d30fa['model']=_[_0x4f42('0x31')](db[_0x4f42('0x2d')][_0x4f42('0x2e')]);_0x2d30fa[_0x4f42('0x30')]=_[_0x4f42('0x31')](_0x276cb8[_0x4f42('0x30')]);_0x2d30fa[_0x4f42('0x3c')]=_[_0x4f42('0x32')](_0x2d30fa[_0x4f42('0x36')],_0x2d30fa[_0x4f42('0x30')]);_0x2dcef9[_0x4f42('0x33')]=_[_0x4f42('0x32')](_0x2d30fa[_0x4f42('0x36')],qs[_0x4f42('0x34')](_0x276cb8['query'][_0x4f42('0x34')]));_0x2dcef9[_0x4f42('0x33')]=_0x2dcef9['attributes'][_0x4f42('0x35')]?_0x2dcef9[_0x4f42('0x33')]:_0x2d30fa['model'];if(_0x276cb8[_0x4f42('0x30')][_0x4f42('0x47')]){_0x2dcef9[_0x4f42('0x42')]=[{'all':!![]}];}_0x2dcef9=_['merge']({},_0x2dcef9,_0x276cb8[_0x4f42('0x40')]);return db['ZohoAccount'][_0x4f42('0x48')](_0x2dcef9)[_0x4f42('0x41')](handleEntityNotFound(_0x418af3,null))[_0x4f42('0x41')](respondWithResult(_0x418af3,null))[_0x4f42('0x49')](handleError(_0x418af3,null));};exports[_0x4f42('0x4a')]=function(_0x31432b,_0x1bd898){return db['ZohoAccount']['create'](_0x31432b[_0x4f42('0x4b')],{})['then'](respondWithResult(_0x1bd898,0xc9))[_0x4f42('0x49')](handleError(_0x1bd898,null));};exports[_0x4f42('0x26')]=function(_0x247596,_0x483dd5){if(_0x247596[_0x4f42('0x4b')]['id']){delete _0x247596[_0x4f42('0x4b')]['id'];}return db[_0x4f42('0x2d')]['find']({'where':{'id':_0x247596[_0x4f42('0x46')]['id']}})['then'](handleEntityNotFound(_0x483dd5,null))['then'](saveUpdates(_0x247596[_0x4f42('0x4b')],null))[_0x4f42('0x41')](respondWithResult(_0x483dd5,null))[_0x4f42('0x49')](handleError(_0x483dd5,null));};exports[_0x4f42('0x27')]=function(_0x356a77,_0x39ab8f){return db[_0x4f42('0x2d')][_0x4f42('0x48')]({'where':{'id':_0x356a77[_0x4f42('0x46')]['id']}})[_0x4f42('0x41')](handleEntityNotFound(_0x39ab8f,null))[_0x4f42('0x41')](removeEntity(_0x39ab8f,null))[_0x4f42('0x49')](handleError(_0x39ab8f,null));};exports[_0x4f42('0x4c')]=function(_0x30fc32,_0xe51c2d,_0x5c8722){var _0x42ea17={};var _0x8c6d55={};var _0x3cfcdd;var _0x1da003;return db[_0x4f42('0x2d')][_0x4f42('0x4d')]({'where':{'id':_0x30fc32[_0x4f42('0x46')]['id']}})[_0x4f42('0x41')](handleEntityNotFound(_0xe51c2d,null))[_0x4f42('0x41')](function(_0x27559b){if(_0x27559b){_0x3cfcdd=_0x27559b;_0x8c6d55['model']=_[_0x4f42('0x31')](db[_0x4f42('0x4e')][_0x4f42('0x2e')]);_0x8c6d55['query']=_[_0x4f42('0x31')](_0x30fc32[_0x4f42('0x30')]);_0x8c6d55[_0x4f42('0x3c')]=_[_0x4f42('0x32')](_0x8c6d55[_0x4f42('0x36')],_0x8c6d55[_0x4f42('0x30')]);_0x42ea17[_0x4f42('0x33')]=_[_0x4f42('0x32')](_0x8c6d55['model'],qs[_0x4f42('0x34')](_0x30fc32[_0x4f42('0x30')]['fields']));_0x42ea17[_0x4f42('0x33')]=_0x42ea17[_0x4f42('0x33')][_0x4f42('0x35')]?_0x42ea17[_0x4f42('0x33')]:_0x8c6d55[_0x4f42('0x36')];_0x42ea17[_0x4f42('0x39')]=qs[_0x4f42('0x3a')](_0x30fc32['query'][_0x4f42('0x3a')]);_0x42ea17['where']=qs[_0x4f42('0x3c')](_[_0x4f42('0x3d')](_0x30fc32['query'],_0x8c6d55[_0x4f42('0x3c')]));if(_0x30fc32[_0x4f42('0x30')][_0x4f42('0x4f')]){_0x42ea17[_0x4f42('0x3b')]=_['merge'](_0x42ea17[_0x4f42('0x3b')],{'$or':_[_0x4f42('0x2c')](_0x42ea17['attributes'],function(_0x3fd0c3){var _0x281716={};_0x281716[_0x3fd0c3]={'$like':'%'+_0x30fc32[_0x4f42('0x30')][_0x4f42('0x4f')]+'%'};return _0x281716;})});}_0x42ea17=_[_0x4f42('0x3e')]({},_0x42ea17,_0x30fc32['options']);return _0x3cfcdd[_0x4f42('0x4c')](_0x42ea17);}})[_0x4f42('0x41')](function(_0xd5b0a3){if(_0xd5b0a3){_0x1da003=_0xd5b0a3[_0x4f42('0x35')];if(!_0x30fc32['query'][_0x4f42('0x37')]('nolimit')){_0x42ea17['limit']=qs[_0x4f42('0x20')](_0x30fc32[_0x4f42('0x30')][_0x4f42('0x20')]);_0x42ea17[_0x4f42('0x1e')]=qs[_0x4f42('0x1e')](_0x30fc32[_0x4f42('0x30')][_0x4f42('0x1e')]);}return _0x3cfcdd['getConfigurations'](_0x42ea17);}})[_0x4f42('0x41')](function(_0x21702c){if(_0x21702c){return _0x21702c?{'count':_0x1da003,'rows':_0x21702c}:null;}})['then'](respondWithResult(_0xe51c2d,null))[_0x4f42('0x49')](handleError(_0xe51c2d,null));};exports['addConfiguration']=function(_0x2306da,_0x4e9716,_0x1ea4b6){if(_0x2306da[_0x4f42('0x4b')]['id']){delete _0x2306da[_0x4f42('0x4b')]['id'];}return db['ZohoAccount']['findOne']({'where':{'id':_0x2306da[_0x4f42('0x46')]['id']}})[_0x4f42('0x41')](handleEntityNotFound(_0x4e9716,null))[_0x4f42('0x41')](function(_0x25b02e){if(_0x25b02e){_0x2306da[_0x4f42('0x4b')][_0x4f42('0x50')]=_0x25b02e['id'];_0x2306da[_0x4f42('0x4b')][_0x4f42('0x51')]=integrations[_0x4f42('0x52')](_0x2306da['body'][_0x4f42('0x53')],_0x2306da['body'][_0x4f42('0x54')]);_0x2306da[_0x4f42('0x4b')][_0x4f42('0x55')]=integrations['getDescriptions'](_0x2306da[_0x4f42('0x4b')][_0x4f42('0x53')],_0x2306da[_0x4f42('0x4b')][_0x4f42('0x54')]);return db[_0x4f42('0x4e')]['create'](_0x2306da['body'],{'include':[{'model':db['ZohoField'],'as':_0x4f42('0x51')},{'model':db[_0x4f42('0x56')],'as':'Descriptions'}]});}return null;})[_0x4f42('0x41')](respondWithResult(_0x4e9716,null))[_0x4f42('0x49')](handleError(_0x4e9716,null));};function getAccessToken(_0x13769c){return new Promise(function(_0xe5e63e,_0x143195){var _0x4988d3;switch(_0x13769c['zone']){case'US':_0x4988d3=_0x4f42('0x57');break;case'AU':_0x4988d3=_0x4f42('0x58');break;case'EU':_0x4988d3=_0x4f42('0x59');break;case'IN':_0x4988d3='https://accounts.zoho.in';break;case'CN':_0x4988d3=_0x4f42('0x5a');break;default:_0x4988d3='https://accounts.zoho.eu';break;}var _0x5ac626={'method':'POST','uri':_0x4988d3+'/oauth/v2/token','qs':{'refresh_token':_0x13769c[_0x4f42('0x5b')],'client_id':_0x13769c['clientId'],'client_secret':_0x13769c[_0x4f42('0x5c')],'grant_type':_0x4f42('0x5d')},'json':!![]};return rp(_0x5ac626)[_0x4f42('0x41')](function(_0x4be861){if(_0x4be861[_0x4f42('0x5e')]){_0xe5e63e(_0x4be861[_0x4f42('0x5e')]);}else{_0x143195(_0x4f42('0x5f'));}})[_0x4f42('0x49')](function(_0xb41c59){_0x143195(_0xb41c59);});});}exports['getFields']=function(_0x8406a8,_0x127e7e,_0x1d6d46){var _0x2f454d,_0x411dee,_0x33f895,_0x391dfb,_0x24c44f;return db[_0x4f42('0x2d')]['findOne']({'where':{'id':_0x8406a8['params']['id']},'attributes':['id',_0x4f42('0x60'),'zone',_0x4f42('0x61'),_0x4f42('0x5c'),_0x4f42('0x62'),'code',_0x4f42('0x5b')]})['then'](handleEntityNotFound(_0x127e7e,null))[_0x4f42('0x41')](function(_0x4ed726){_0x24c44f=_0x4ed726;_0x2f454d=_0x24c44f[_0x4f42('0x60')];_0x411dee=_0x2f454d===_0x4f42('0x63')?'eu':_0x4f42('0x64');_0x33f895=_0x24c44f[_0x4f42('0x62')];var _0x41d349=_0x33f895[_0x4f42('0x65')](-0x1);if(_0x41d349==='/'||_0x41d349==='\x5c'||_0x41d349===':'){_0x33f895=_0x33f895['substring'](0x0,_0x33f895[_0x4f42('0x66')](_0x41d349));}if(!_0x24c44f['refreshToken']){throw new Error(_0x4f42('0x67'));}return getAccessToken(_0x24c44f);})[_0x4f42('0x41')](function(_0x33de35){if(_0x33de35){return rp({'method':_0x4f42('0x68'),'uri':util[_0x4f42('0x69')](_0x4f42('0x6a'),_0x411dee),'qs':{'module':_0x4f42('0x6b')},'headers':{'Authorization':_0x4f42('0x6c')+_0x33de35},'json':!![]});}})[_0x4f42('0x41')](function(_0x4bc89a){if(_0x4bc89a){if(_0x4bc89a['response']&&_0x4bc89a[_0x4f42('0x6d')][_0x4f42('0x6e')]){throw new Error(_0x4bc89a[_0x4f42('0x6d')][_0x4f42('0x6e')][_0x4f42('0x6f')]);}var _0x32739a=[];var _0x2eb7bc=[];var _0x2a58af=[_0x4f42('0x70'),_0x4f42('0x71'),'Description',_0x4f42('0x72'),_0x4f42('0x73'),_0x4f42('0x74'),_0x4f42('0x75'),'Call_Type'];_0x2eb7bc=_['remove'](_0x4bc89a['fields'],function(_0x107190){return _0x2a58af[_0x4f42('0x76')](_0x107190['api_name']);});for(var _0x4a9cde=0x0;_0x4a9cde<_0x2eb7bc['length'];_0x4a9cde++){if(_0x2eb7bc[_0x4a9cde]['system_mandatory']===![]){_0x32739a[_0x4f42('0x77')]({'id':_0x2eb7bc[_0x4a9cde]['id'],'name':_0x2eb7bc[_0x4a9cde]['display_label'],'custom':_0x2eb7bc[_0x4a9cde][_0x4f42('0x78')],'options':_0x2eb7bc[_0x4a9cde][_0x4f42('0x79')]==='picklist'&&_0x2eb7bc[_0x4a9cde][_0x4f42('0x7a')][_0x4f42('0x35')]>-0x1?_['map'](_0x2eb7bc[_0x4a9cde]['pick_list_values'],function(_0x47a72f){return{'name':_0x47a72f,'value':_0x47a72f};}):[]});}}return{'count':_0x32739a[_0x4f42('0x35')],'rows':_0x32739a};}else{return{'count':0x0,'rows':[]};}})[_0x4f42('0x41')](respondWithResult(_0x127e7e,null))[_0x4f42('0x49')](function(_0x2a080a){var _0x2bb3df=_0x8406a8[_0x4f42('0x30')][_0x4f42('0x7b')]?0x1f4:_0x2a080a['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x4f42('0x7c'),_0x2bb3df,JSON[_0x4f42('0x7d')](_0x2a080a));delete _0x2a080a[_0x4f42('0x29')];if(_0x2bb3df===0x191){_0x2bb3df=0x190;}_0x127e7e[_0x4f42('0x1b')](_0x2bb3df)[_0x4f42('0x2a')](_0x8406a8[_0x4f42('0x30')][_0x4f42('0x7b')]?{'message':_0x4f42('0x7e'),'statusCode':_0x2a080a[_0x4f42('0x7f')]}:_0x2a080a);});}; \ No newline at end of file +var _0xe35c=['filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','getConfigurations','findOne','nolimit','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','https://accounts.zoho.com.cn','/oauth/v2/token','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientId','code','com','serverUrl','slice','substring','refreshToken','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','system_mandatory','display_label','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','sendStatus','error','stack','name','send','map','ZohoAccount','fieldName','type','key','model','query','keys'];(function(_0x3a492f,_0x21d491){var _0x33bd0f=function(_0x3d5c12){while(--_0x3d5c12){_0x3a492f['push'](_0x3a492f['shift']());}};_0x33bd0f(++_0x21d491);}(_0xe35c,0xd5));var _0xce35=function(_0x398b3d,_0x2f497e){_0x398b3d=_0x398b3d-0x0;var _0x20b1cf=_0xe35c[_0x398b3d];return _0x20b1cf;};'use strict';var emlformat=require(_0xce35('0x0'));var rimraf=require(_0xce35('0x1'));var zipdir=require(_0xce35('0x2'));var jsonpatch=require(_0xce35('0x3'));var rp=require(_0xce35('0x4'));var moment=require(_0xce35('0x5'));var BPromise=require(_0xce35('0x6'));var Mustache=require('mustache');var util=require(_0xce35('0x7'));var path=require(_0xce35('0x8'));var sox=require(_0xce35('0x9'));var csv=require(_0xce35('0xa'));var ejs=require(_0xce35('0xb'));var fs=require('fs');var fs_extra=require(_0xce35('0xc'));var _=require(_0xce35('0xd'));var squel=require(_0xce35('0xe'));var crypto=require(_0xce35('0xf'));var jsforce=require(_0xce35('0x10'));var deskjs=require(_0xce35('0x11'));var toCsv=require(_0xce35('0xa'));var querystring=require(_0xce35('0x12'));var Papa=require(_0xce35('0x13'));var Redis=require(_0xce35('0x14'));var authService=require(_0xce35('0x15'));var qs=require(_0xce35('0x16'));var as=require(_0xce35('0x17'));var hardwareService=require(_0xce35('0x18'));var logger=require(_0xce35('0x19'))('api');var utils=require(_0xce35('0x1a'));var config=require(_0xce35('0x1b'));var licenseUtil=require(_0xce35('0x1c'));var db=require(_0xce35('0x1d'))['db'];var integrations=require(_0xce35('0x1e'));function respondWithStatusCode(_0x12d871,_0x3fd0cf){_0x3fd0cf=_0x3fd0cf||0xcc;return function(_0x4d330c){if(_0x4d330c){return _0x12d871['sendStatus'](_0x3fd0cf);}return _0x12d871[_0xce35('0x1f')](_0x3fd0cf)[_0xce35('0x20')]();};}function respondWithResult(_0x245a7e,_0x1fd7ce){_0x1fd7ce=_0x1fd7ce||0xc8;return function(_0x31503d){if(_0x31503d){return _0x245a7e['status'](_0x1fd7ce)[_0xce35('0x21')](_0x31503d);}};}function respondWithFilteredResult(_0x37e143,_0x594c67){return function(_0x2e4057){if(_0x2e4057){var _0x57523b=typeof _0x594c67[_0xce35('0x22')]===_0xce35('0x23')&&typeof _0x594c67[_0xce35('0x24')]===_0xce35('0x23');var _0x588327=_0x2e4057[_0xce35('0x25')];var _0xba2fe8=_0x57523b?0x0:_0x594c67[_0xce35('0x22')];var _0xee75d=_0x57523b?_0x2e4057[_0xce35('0x25')]:_0x594c67[_0xce35('0x22')]+_0x594c67[_0xce35('0x24')];var _0x46daa3;if(_0xee75d>=_0x588327){_0xee75d=_0x588327;_0x46daa3=0xc8;}else{_0x46daa3=0xce;}_0x37e143['status'](_0x46daa3);return _0x37e143[_0xce35('0x26')]('Content-Range',_0xba2fe8+'-'+_0xee75d+'/'+_0x588327)['json'](_0x2e4057);}return null;};}function patchUpdates(_0x5b537d){return function(_0x35dc1a){try{jsonpatch['apply'](_0x35dc1a,_0x5b537d,!![]);}catch(_0x1ef81f){return BPromise[_0xce35('0x27')](_0x1ef81f);}return _0x35dc1a[_0xce35('0x28')]();};}function saveUpdates(_0x326176,_0x5af2e5){return function(_0x26f903){if(_0x26f903){return _0x26f903[_0xce35('0x29')](_0x326176)['then'](function(_0x1d6f0a){return _0x1d6f0a;});}return null;};}function removeEntity(_0x57ca2f,_0x5367a0){return function(_0x138c24){if(_0x138c24){return _0x138c24[_0xce35('0x2a')]()[_0xce35('0x2b')](function(){_0x57ca2f[_0xce35('0x1f')](0xcc)[_0xce35('0x20')]();});}};}function handleEntityNotFound(_0x5e0a1b,_0x26caab){return function(_0x54fccd){if(!_0x54fccd){_0x5e0a1b[_0xce35('0x2c')](0x194);}return _0x54fccd;};}function handleError(_0x27e617,_0x44fa94){_0x44fa94=_0x44fa94||0x1f4;return function(_0x2ac50c){logger[_0xce35('0x2d')](_0x2ac50c[_0xce35('0x2e')]);if(_0x2ac50c[_0xce35('0x2f')]){delete _0x2ac50c[_0xce35('0x2f')];}_0x27e617[_0xce35('0x1f')](_0x44fa94)[_0xce35('0x30')](_0x2ac50c);};}exports['index']=function(_0x2bfb24,_0x43dda7){var _0x47ceee={},_0x5f2111={},_0x129aa5={'count':0x0,'rows':[]};var _0x4aa760=_[_0xce35('0x31')](db[_0xce35('0x32')]['rawAttributes'],function(_0x16b371){return{'name':_0x16b371[_0xce35('0x33')],'type':_0x16b371[_0xce35('0x34')][_0xce35('0x35')]};});_0x5f2111[_0xce35('0x36')]=_[_0xce35('0x31')](_0x4aa760,_0xce35('0x2f'));_0x5f2111[_0xce35('0x37')]=_[_0xce35('0x38')](_0x2bfb24[_0xce35('0x37')]);_0x5f2111[_0xce35('0x39')]=_[_0xce35('0x3a')](_0x5f2111[_0xce35('0x36')],_0x5f2111[_0xce35('0x37')]);_0x47ceee[_0xce35('0x3b')]=_[_0xce35('0x3a')](_0x5f2111[_0xce35('0x36')],qs[_0xce35('0x3c')](_0x2bfb24[_0xce35('0x37')]['fields']));_0x47ceee[_0xce35('0x3b')]=_0x47ceee[_0xce35('0x3b')][_0xce35('0x3d')]?_0x47ceee[_0xce35('0x3b')]:_0x5f2111[_0xce35('0x36')];if(!_0x2bfb24['query']['hasOwnProperty']('nolimit')){_0x47ceee[_0xce35('0x24')]=qs['limit'](_0x2bfb24[_0xce35('0x37')][_0xce35('0x24')]);_0x47ceee['offset']=qs[_0xce35('0x22')](_0x2bfb24['query'][_0xce35('0x22')]);}_0x47ceee[_0xce35('0x3e')]=qs[_0xce35('0x3f')](_0x2bfb24[_0xce35('0x37')][_0xce35('0x3f')]);_0x47ceee['where']=qs['filters'](_[_0xce35('0x40')](_0x2bfb24[_0xce35('0x37')],_0x5f2111[_0xce35('0x39')]),_0x4aa760);if(_0x2bfb24['query'][_0xce35('0x41')]){_0x47ceee[_0xce35('0x42')]=_[_0xce35('0x43')](_0x47ceee[_0xce35('0x42')],{'$or':_['map'](_0x4aa760,function(_0x12cb31){if(_0x12cb31['type']!=='VIRTUAL'){var _0x5e2476={};_0x5e2476[_0x12cb31[_0xce35('0x2f')]]={'$like':'%'+_0x2bfb24[_0xce35('0x37')][_0xce35('0x41')]+'%'};return _0x5e2476;}})});}_0x47ceee=_['merge']({},_0x47ceee,_0x2bfb24[_0xce35('0x44')]);var _0x45fce6={'where':_0x47ceee[_0xce35('0x42')]};return db['ZohoAccount'][_0xce35('0x25')](_0x45fce6)[_0xce35('0x2b')](function(_0xa3dcd){_0x129aa5[_0xce35('0x25')]=_0xa3dcd;if(_0x2bfb24['query'][_0xce35('0x45')]){_0x47ceee[_0xce35('0x46')]=[{'all':!![]}];}return db[_0xce35('0x32')][_0xce35('0x47')](_0x47ceee);})[_0xce35('0x2b')](function(_0x57bdea){_0x129aa5[_0xce35('0x48')]=_0x57bdea;return _0x129aa5;})['then'](respondWithFilteredResult(_0x43dda7,_0x47ceee))[_0xce35('0x49')](handleError(_0x43dda7,null));};exports[_0xce35('0x4a')]=function(_0x46a3f6,_0x3ec65d){var _0x4e40c2={'raw':![],'where':{'id':_0x46a3f6['params']['id']}},_0x3c3850={};_0x3c3850[_0xce35('0x36')]=_[_0xce35('0x38')](db[_0xce35('0x32')][_0xce35('0x4b')]);_0x3c3850['query']=_[_0xce35('0x38')](_0x46a3f6[_0xce35('0x37')]);_0x3c3850[_0xce35('0x39')]=_[_0xce35('0x3a')](_0x3c3850[_0xce35('0x36')],_0x3c3850['query']);_0x4e40c2[_0xce35('0x3b')]=_[_0xce35('0x3a')](_0x3c3850['model'],qs[_0xce35('0x3c')](_0x46a3f6[_0xce35('0x37')][_0xce35('0x3c')]));_0x4e40c2[_0xce35('0x3b')]=_0x4e40c2['attributes']['length']?_0x4e40c2[_0xce35('0x3b')]:_0x3c3850[_0xce35('0x36')];if(_0x46a3f6[_0xce35('0x37')][_0xce35('0x45')]){_0x4e40c2[_0xce35('0x46')]=[{'all':!![]}];}_0x4e40c2=_[_0xce35('0x43')]({},_0x4e40c2,_0x46a3f6['options']);return db[_0xce35('0x32')][_0xce35('0x4c')](_0x4e40c2)[_0xce35('0x2b')](handleEntityNotFound(_0x3ec65d,null))[_0xce35('0x2b')](respondWithResult(_0x3ec65d,null))[_0xce35('0x49')](handleError(_0x3ec65d,null));};exports[_0xce35('0x4d')]=function(_0x53e85d,_0x3494bc){return db[_0xce35('0x32')][_0xce35('0x4d')](_0x53e85d[_0xce35('0x4e')],{})[_0xce35('0x2b')](respondWithResult(_0x3494bc,0xc9))['catch'](handleError(_0x3494bc,null));};exports[_0xce35('0x29')]=function(_0x56bbcc,_0x23ff5b){if(_0x56bbcc[_0xce35('0x4e')]['id']){delete _0x56bbcc[_0xce35('0x4e')]['id'];}return db['ZohoAccount']['find']({'where':{'id':_0x56bbcc[_0xce35('0x4f')]['id']}})[_0xce35('0x2b')](handleEntityNotFound(_0x23ff5b,null))['then'](saveUpdates(_0x56bbcc[_0xce35('0x4e')],null))[_0xce35('0x2b')](respondWithResult(_0x23ff5b,null))[_0xce35('0x49')](handleError(_0x23ff5b,null));};exports[_0xce35('0x2a')]=function(_0x356812,_0x1c2b7e){return db[_0xce35('0x32')][_0xce35('0x4c')]({'where':{'id':_0x356812[_0xce35('0x4f')]['id']}})[_0xce35('0x2b')](handleEntityNotFound(_0x1c2b7e,null))['then'](removeEntity(_0x1c2b7e,null))[_0xce35('0x49')](handleError(_0x1c2b7e,null));};exports[_0xce35('0x50')]=function(_0x5b9f68,_0xe17f25,_0x36cb89){var _0xc8bb04={};var _0x1780be={};var _0xa371ef;var _0x2ca00c;return db[_0xce35('0x32')][_0xce35('0x51')]({'where':{'id':_0x5b9f68[_0xce35('0x4f')]['id']}})[_0xce35('0x2b')](handleEntityNotFound(_0xe17f25,null))[_0xce35('0x2b')](function(_0x3adb3c){if(_0x3adb3c){_0xa371ef=_0x3adb3c;_0x1780be[_0xce35('0x36')]=_[_0xce35('0x38')](db['ZohoConfiguration']['rawAttributes']);_0x1780be[_0xce35('0x37')]=_[_0xce35('0x38')](_0x5b9f68[_0xce35('0x37')]);_0x1780be[_0xce35('0x39')]=_[_0xce35('0x3a')](_0x1780be[_0xce35('0x36')],_0x1780be['query']);_0xc8bb04[_0xce35('0x3b')]=_['intersection'](_0x1780be[_0xce35('0x36')],qs[_0xce35('0x3c')](_0x5b9f68[_0xce35('0x37')][_0xce35('0x3c')]));_0xc8bb04[_0xce35('0x3b')]=_0xc8bb04[_0xce35('0x3b')][_0xce35('0x3d')]?_0xc8bb04[_0xce35('0x3b')]:_0x1780be[_0xce35('0x36')];_0xc8bb04[_0xce35('0x3e')]=qs['sort'](_0x5b9f68['query']['sort']);_0xc8bb04[_0xce35('0x42')]=qs['filters'](_[_0xce35('0x40')](_0x5b9f68[_0xce35('0x37')],_0x1780be['filters']));if(_0x5b9f68[_0xce35('0x37')][_0xce35('0x41')]){_0xc8bb04['where']=_[_0xce35('0x43')](_0xc8bb04[_0xce35('0x42')],{'$or':_['map'](_0xc8bb04[_0xce35('0x3b')],function(_0x318377){var _0x4a74ec={};_0x4a74ec[_0x318377]={'$like':'%'+_0x5b9f68[_0xce35('0x37')]['filter']+'%'};return _0x4a74ec;})});}_0xc8bb04=_[_0xce35('0x43')]({},_0xc8bb04,_0x5b9f68['options']);return _0xa371ef[_0xce35('0x50')](_0xc8bb04);}})[_0xce35('0x2b')](function(_0x26f9d3){if(_0x26f9d3){_0x2ca00c=_0x26f9d3[_0xce35('0x3d')];if(!_0x5b9f68[_0xce35('0x37')]['hasOwnProperty'](_0xce35('0x52'))){_0xc8bb04['limit']=qs[_0xce35('0x24')](_0x5b9f68[_0xce35('0x37')][_0xce35('0x24')]);_0xc8bb04['offset']=qs[_0xce35('0x22')](_0x5b9f68[_0xce35('0x37')][_0xce35('0x22')]);}return _0xa371ef[_0xce35('0x50')](_0xc8bb04);}})[_0xce35('0x2b')](function(_0x2b6c3b){if(_0x2b6c3b){return _0x2b6c3b?{'count':_0x2ca00c,'rows':_0x2b6c3b}:null;}})[_0xce35('0x2b')](respondWithResult(_0xe17f25,null))[_0xce35('0x49')](handleError(_0xe17f25,null));};exports[_0xce35('0x53')]=function(_0x4a69fe,_0x3d67b3,_0xe29cb2){if(_0x4a69fe[_0xce35('0x4e')]['id']){delete _0x4a69fe[_0xce35('0x4e')]['id'];}return db[_0xce35('0x32')][_0xce35('0x51')]({'where':{'id':_0x4a69fe['params']['id']}})[_0xce35('0x2b')](handleEntityNotFound(_0x3d67b3,null))[_0xce35('0x2b')](function(_0x3c4223){if(_0x3c4223){_0x4a69fe['body'][_0xce35('0x54')]=_0x3c4223['id'];_0x4a69fe['body'][_0xce35('0x55')]=integrations[_0xce35('0x56')](_0x4a69fe[_0xce35('0x4e')][_0xce35('0x57')],_0x4a69fe[_0xce35('0x4e')][_0xce35('0x34')]);_0x4a69fe[_0xce35('0x4e')][_0xce35('0x58')]=integrations[_0xce35('0x59')](_0x4a69fe[_0xce35('0x4e')][_0xce35('0x57')],_0x4a69fe['body'][_0xce35('0x34')]);return db[_0xce35('0x5a')]['create'](_0x4a69fe['body'],{'include':[{'model':db[_0xce35('0x5b')],'as':'Subjects'},{'model':db['ZohoField'],'as':_0xce35('0x58')}]});}return null;})[_0xce35('0x2b')](respondWithResult(_0x3d67b3,null))['catch'](handleError(_0x3d67b3,null));};function getAccessToken(_0x59b83b){return new Promise(function(_0x24f0ed,_0x4aac50){var _0x311cca;switch(_0x59b83b[_0xce35('0x5c')]){case'US':_0x311cca=_0xce35('0x5d');break;case'AU':_0x311cca=_0xce35('0x5e');break;case'EU':_0x311cca=_0xce35('0x5f');break;case'IN':_0x311cca=_0xce35('0x60');break;case'CN':_0x311cca=_0xce35('0x61');break;default:_0x311cca=_0xce35('0x5f');break;}var _0x3ed0c9={'method':'POST','uri':_0x311cca+_0xce35('0x62'),'qs':{'refresh_token':_0x59b83b['refreshToken'],'client_id':_0x59b83b['clientId'],'client_secret':_0x59b83b[_0xce35('0x63')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x3ed0c9)[_0xce35('0x2b')](function(_0xaacb09){if(_0xaacb09[_0xce35('0x64')]){_0x24f0ed(_0xaacb09[_0xce35('0x64')]);}else{_0x4aac50(_0xce35('0x65'));}})[_0xce35('0x49')](function(_0x20fcc8){_0x4aac50(_0x20fcc8);});});}exports[_0xce35('0x66')]=function(_0x284c12,_0x8661f0,_0x57f526){var _0x27641b,_0x44f5b6,_0x9f2175,_0x20d7a1,_0x2c2317;return db[_0xce35('0x32')][_0xce35('0x51')]({'where':{'id':_0x284c12[_0xce35('0x4f')]['id']},'attributes':['id',_0xce35('0x67'),'zone',_0xce35('0x68'),_0xce35('0x63'),'serverUrl',_0xce35('0x69'),'refreshToken']})[_0xce35('0x2b')](handleEntityNotFound(_0x8661f0,null))[_0xce35('0x2b')](function(_0x35141a){_0x2c2317=_0x35141a;_0x27641b=_0x2c2317['host'];_0x44f5b6=_0x27641b==='zoho.eu'?'eu':_0xce35('0x6a');_0x9f2175=_0x2c2317[_0xce35('0x6b')];var _0x206998=_0x9f2175[_0xce35('0x6c')](-0x1);if(_0x206998==='/'||_0x206998==='\x5c'||_0x206998===':'){_0x9f2175=_0x9f2175[_0xce35('0x6d')](0x0,_0x9f2175['lastIndexOf'](_0x206998));}if(!_0x2c2317[_0xce35('0x6e')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x2c2317);})[_0xce35('0x2b')](function(_0x832c35){if(_0x832c35){return rp({'method':_0xce35('0x6f'),'uri':util[_0xce35('0x70')](_0xce35('0x71'),_0x44f5b6),'qs':{'module':_0xce35('0x72')},'headers':{'Authorization':_0xce35('0x73')+_0x832c35},'json':!![]});}})['then'](function(_0x102661){if(_0x102661){if(_0x102661[_0xce35('0x74')]&&_0x102661['response'][_0xce35('0x2d')]){throw new Error(_0x102661['response']['error'][_0xce35('0x75')]);}var _0x4349c6=[];var _0x5a7a13=[];var _0x2bc78b=['Owner','Subject',_0xce35('0x76'),_0xce35('0x77'),_0xce35('0x78'),_0xce35('0x79'),_0xce35('0x7a'),_0xce35('0x7b')];_0x5a7a13=_[_0xce35('0x7c')](_0x102661[_0xce35('0x3c')],function(_0x4ff80f){return _0x2bc78b[_0xce35('0x7d')](_0x4ff80f['api_name']);});for(var _0x3ece6a=0x0;_0x3ece6a<_0x5a7a13[_0xce35('0x3d')];_0x3ece6a++){if(_0x5a7a13[_0x3ece6a][_0xce35('0x7e')]===![]){_0x4349c6['push']({'id':_0x5a7a13[_0x3ece6a]['id'],'name':_0x5a7a13[_0x3ece6a][_0xce35('0x7f')],'custom':_0x5a7a13[_0x3ece6a]['custom_field'],'options':_0x5a7a13[_0x3ece6a][_0xce35('0x80')]===_0xce35('0x81')&&_0x5a7a13[_0x3ece6a][_0xce35('0x82')][_0xce35('0x3d')]>-0x1?_[_0xce35('0x31')](_0x5a7a13[_0x3ece6a][_0xce35('0x82')],function(_0x354fd1){return{'name':_0x354fd1,'value':_0x354fd1};}):[]});}}return{'count':_0x4349c6[_0xce35('0x3d')],'rows':_0x4349c6};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x8661f0,null))['catch'](function(_0x5b255b){var _0x4f2a64=_0x284c12[_0xce35('0x37')][_0xce35('0x83')]?0x1f4:_0x5b255b[_0xce35('0x84')]||0x1f4;logger['error'](_0xce35('0x85'),_0xce35('0x66'),_0x4f2a64,JSON[_0xce35('0x86')](_0x5b255b));delete _0x5b255b[_0xce35('0x2f')];if(_0x4f2a64===0x191){_0x4f2a64=0x190;}_0x8661f0[_0xce35('0x1f')](_0x4f2a64)[_0xce35('0x30')](_0x284c12[_0xce35('0x37')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x5b255b[_0xce35('0x84')]}:_0x5b255b);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index f2318e4..1ee32eb 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 _0xad00=['then','refresh_token','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','zone','host','parse','info','error','util','../../config/logger','api','moment','request-promise','rimraf','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','clientId','clientSecret','serverUrl','slice','substring','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','code','application/x-www-form-urlencoded'];(function(_0x29f9af,_0x4f3d10){var _0x56e4a8=function(_0x2e2554){while(--_0x2e2554){_0x29f9af['push'](_0x29f9af['shift']());}};_0x56e4a8(++_0x4f3d10);}(_0xad00,0xb6));var _0x0ad0=function(_0x427352,_0x1bce61){_0x427352=_0x427352-0x0;var _0x23e0e6=_0xad00[_0x427352];return _0x23e0e6;};'use strict';var _=require('lodash');var util=require(_0x0ad0('0x0'));var logger=require(_0x0ad0('0x1'))(_0x0ad0('0x2'));var moment=require(_0x0ad0('0x3'));var BPromise=require('bluebird');var rp=require(_0x0ad0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ad0('0x5'));var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x0ad0('0x6'));module[_0x0ad0('0x7')]=function(_0x3f8ae8,_0x1a0839){return _0x3f8ae8[_0x0ad0('0x8')](_0x0ad0('0x9'),attributes,{'tableName':_0x0ad0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2df8cb,_0x266d5d,_0x424c96){if(_0x2df8cb[_0x0ad0('0xb')]('zone')||_0x2df8cb[_0x0ad0('0xb')]('serverUrl')||_0x2df8cb[_0x0ad0('0xb')](_0x0ad0('0xc'))||_0x2df8cb[_0x0ad0('0xb')](_0x0ad0('0xd'))||_0x2df8cb['changed']('code')||_0x2df8cb[_0x0ad0('0xb')]('host')){var _0x2f0001,_0x4044b4;_0x2f0001=_0x2df8cb[_0x0ad0('0xe')];var _0x5328ac=_0x2f0001[_0x0ad0('0xf')](-0x1);if(_0x5328ac==='/'||_0x5328ac==='\x5c'||_0x5328ac===':'){_0x2f0001=_0x2f0001[_0x0ad0('0x10')](0x0,_0x2f0001[_0x0ad0('0x11')](_0x5328ac));}switch(_0x2df8cb['zone']){case'US':_0x4044b4=_0x0ad0('0x12');break;case'AU':_0x4044b4=_0x0ad0('0x13');break;case'IN':_0x4044b4=_0x0ad0('0x14');break;case'CN':_0x4044b4=_0x0ad0('0x15');break;default:_0x4044b4=_0x0ad0('0x16');break;}var _0x2efeaa={'method':_0x0ad0('0x17'),'uri':_0x4044b4+_0x0ad0('0x18'),'form':{'grant_type':_0x0ad0('0x19'),'client_id':_0x2df8cb[_0x0ad0('0xc')],'client_secret':_0x2df8cb[_0x0ad0('0xd')],'redirect_uri':_0x2df8cb[_0x0ad0('0xe')],'code':_0x2df8cb[_0x0ad0('0x1a')]},'headers':{'Content-Type':_0x0ad0('0x1b')}};return rp(_0x2efeaa)[_0x0ad0('0x1c')](function(_0x16f899){var _0x225302=JSON['parse'](_0x16f899);if(_0x225302[_0x0ad0('0x1d')]){_0x2df8cb[_0x0ad0('0x1e')]=_0x225302[_0x0ad0('0x1d')];logger['info'](util[_0x0ad0('0x1f')](_0x0ad0('0x20'),_0x2df8cb[_0x0ad0('0x21')],_0x2df8cb['id']));}else{logger['error'](util['format'](_0x0ad0('0x22'),_0x2df8cb[_0x0ad0('0x21')],_0x2df8cb['id']),util[_0x0ad0('0x23')](_0x225302,{'showHidden':![],'depth':null}));}return _0x424c96(null,_0x266d5d);})[_0x0ad0('0x24')](function(_0x47e012){logger['error'](util[_0x0ad0('0x1f')](_0x0ad0('0x22'),_0x2df8cb['name'],_0x2df8cb['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x424c96(_0x47e012);});}else{return _0x424c96(null,_0x266d5d);}},'beforeUpdate':function(_0x1f874d,_0x18783a,_0x1759f3){if(_0x1f874d[_0x0ad0('0xb')](_0x0ad0('0x25'))||_0x1f874d[_0x0ad0('0xb')](_0x0ad0('0xe'))||_0x1f874d[_0x0ad0('0xb')](_0x0ad0('0xc'))||_0x1f874d[_0x0ad0('0xb')]('clientSecret')||_0x1f874d[_0x0ad0('0xb')](_0x0ad0('0x1a'))||_0x1f874d[_0x0ad0('0xb')](_0x0ad0('0x26'))){var _0x3fa376,_0xf7b665;_0x3fa376=_0x1f874d['serverUrl'];var _0x56b229=_0x3fa376[_0x0ad0('0xf')](-0x1);if(_0x56b229==='/'||_0x56b229==='\x5c'||_0x56b229===':'){_0x3fa376=_0x3fa376[_0x0ad0('0x10')](0x0,_0x3fa376['lastIndexOf'](_0x56b229));}switch(_0x1f874d[_0x0ad0('0x25')]){case'US':_0xf7b665=_0x0ad0('0x12');break;case'AU':_0xf7b665=_0x0ad0('0x13');break;case'IN':_0xf7b665=_0x0ad0('0x14');break;case'CN':_0xf7b665=_0x0ad0('0x15');break;default:_0xf7b665=_0x0ad0('0x16');break;}var _0x359ec3={'method':_0x0ad0('0x17'),'uri':_0xf7b665+_0x0ad0('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x1f874d[_0x0ad0('0xc')],'client_secret':_0x1f874d[_0x0ad0('0xd')],'redirect_uri':_0x1f874d[_0x0ad0('0xe')],'code':_0x1f874d['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x359ec3)['then'](function(_0x169761){var _0x48286b=JSON[_0x0ad0('0x27')](_0x169761);if(_0x48286b[_0x0ad0('0x1d')]){_0x1f874d[_0x0ad0('0x1e')]=_0x48286b[_0x0ad0('0x1d')];logger[_0x0ad0('0x28')](util[_0x0ad0('0x1f')](_0x0ad0('0x20'),_0x1f874d['name'],_0x1f874d['id']));}else{logger[_0x0ad0('0x29')](util['format'](_0x0ad0('0x22'),_0x1f874d[_0x0ad0('0x21')],_0x1f874d['id']),util[_0x0ad0('0x23')](_0x48286b,{'showHidden':![],'depth':null}));}return _0x1759f3(null,_0x18783a);})['catch'](function(_0x340524){logger[_0x0ad0('0x29')](util[_0x0ad0('0x1f')](_0x0ad0('0x22'),_0x1f874d[_0x0ad0('0x21')],_0x1f874d['id']),util[_0x0ad0('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x1759f3(_0x340524);});}else{return _0x1759f3(null,_0x18783a);}}}});}; \ No newline at end of file +var _0x4137=['code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','parse','refresh_token','refreshToken','info','format','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','https://accounts.zoho.eu','authorization_code','then','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','api','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x4137,0xfb));var _0x7413=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x4137[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var logger=require('../../config/logger')(_0x7413('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7413('0x3'));var config=require(_0x7413('0x4'));var attributes=require(_0x7413('0x5'));var integrations=require(_0x7413('0x6'));module['exports']=function(_0x426ac5,_0xfe8c22){return _0x426ac5[_0x7413('0x7')](_0x7413('0x8'),attributes,{'tableName':_0x7413('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1baaa5,_0x47856d,_0x6412b0){if(_0x1baaa5[_0x7413('0xa')](_0x7413('0xb'))||_0x1baaa5[_0x7413('0xa')](_0x7413('0xc'))||_0x1baaa5[_0x7413('0xa')](_0x7413('0xd'))||_0x1baaa5[_0x7413('0xa')](_0x7413('0xe'))||_0x1baaa5[_0x7413('0xa')](_0x7413('0xf'))||_0x1baaa5['changed'](_0x7413('0x10'))){var _0x6bf102,_0x514e01;_0x6bf102=_0x1baaa5[_0x7413('0xc')];var _0x2ce1b7=_0x6bf102[_0x7413('0x11')](-0x1);if(_0x2ce1b7==='/'||_0x2ce1b7==='\x5c'||_0x2ce1b7===':'){_0x6bf102=_0x6bf102[_0x7413('0x12')](0x0,_0x6bf102[_0x7413('0x13')](_0x2ce1b7));}switch(_0x1baaa5[_0x7413('0xb')]){case'US':_0x514e01=_0x7413('0x14');break;case'AU':_0x514e01='https://accounts.zoho.com.au';break;case'IN':_0x514e01=_0x7413('0x15');break;case'CN':_0x514e01=_0x7413('0x16');break;default:_0x514e01='https://accounts.zoho.eu';break;}var _0x210ae1={'method':_0x7413('0x17'),'uri':_0x514e01+_0x7413('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x1baaa5['clientId'],'client_secret':_0x1baaa5[_0x7413('0xe')],'redirect_uri':_0x1baaa5[_0x7413('0xc')],'code':_0x1baaa5[_0x7413('0xf')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x210ae1)['then'](function(_0x90fc43){var _0x4eaa84=JSON[_0x7413('0x19')](_0x90fc43);if(_0x4eaa84[_0x7413('0x1a')]){_0x1baaa5[_0x7413('0x1b')]=_0x4eaa84['refresh_token'];logger[_0x7413('0x1c')](util[_0x7413('0x1d')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1baaa5[_0x7413('0x1e')],_0x1baaa5['id']));}else{logger[_0x7413('0x1f')](util[_0x7413('0x1d')](_0x7413('0x20'),_0x1baaa5[_0x7413('0x1e')],_0x1baaa5['id']),util['inspect'](_0x4eaa84,{'showHidden':![],'depth':null}));}return _0x6412b0(null,_0x47856d);})['catch'](function(_0x1edf05){logger['error'](util['format'](_0x7413('0x20'),_0x1baaa5[_0x7413('0x1e')],_0x1baaa5['id']),util[_0x7413('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x6412b0(_0x1edf05);});}else{return _0x6412b0(null,_0x47856d);}},'beforeUpdate':function(_0x10a95d,_0x2c83f9,_0x9a8268){if(_0x10a95d[_0x7413('0xa')](_0x7413('0xb'))||_0x10a95d['changed'](_0x7413('0xc'))||_0x10a95d[_0x7413('0xa')](_0x7413('0xd'))||_0x10a95d['changed'](_0x7413('0xe'))||_0x10a95d['changed'](_0x7413('0xf'))||_0x10a95d[_0x7413('0xa')](_0x7413('0x10'))){var _0x5019be,_0x42651;_0x5019be=_0x10a95d[_0x7413('0xc')];var _0x545b95=_0x5019be[_0x7413('0x11')](-0x1);if(_0x545b95==='/'||_0x545b95==='\x5c'||_0x545b95===':'){_0x5019be=_0x5019be[_0x7413('0x12')](0x0,_0x5019be[_0x7413('0x13')](_0x545b95));}switch(_0x10a95d[_0x7413('0xb')]){case'US':_0x42651=_0x7413('0x14');break;case'AU':_0x42651='https://accounts.zoho.com.au';break;case'IN':_0x42651=_0x7413('0x15');break;case'CN':_0x42651=_0x7413('0x16');break;default:_0x42651=_0x7413('0x22');break;}var _0x3225ae={'method':'POST','uri':_0x42651+_0x7413('0x18'),'form':{'grant_type':_0x7413('0x23'),'client_id':_0x10a95d[_0x7413('0xd')],'client_secret':_0x10a95d[_0x7413('0xe')],'redirect_uri':_0x10a95d[_0x7413('0xc')],'code':_0x10a95d[_0x7413('0xf')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x3225ae)[_0x7413('0x24')](function(_0x51364b){var _0x4baee5=JSON['parse'](_0x51364b);if(_0x4baee5[_0x7413('0x1a')]){_0x10a95d['refreshToken']=_0x4baee5[_0x7413('0x1a')];logger[_0x7413('0x1c')](util[_0x7413('0x1d')](_0x7413('0x25'),_0x10a95d['name'],_0x10a95d['id']));}else{logger['error'](util['format'](_0x7413('0x20'),_0x10a95d['name'],_0x10a95d['id']),util[_0x7413('0x21')](_0x4baee5,{'showHidden':![],'depth':null}));}return _0x9a8268(null,_0x2c83f9);})['catch'](function(_0x5a8262){logger[_0x7413('0x1f')](util[_0x7413('0x1d')](_0x7413('0x20'),_0x10a95d[_0x7413('0x1e')],_0x10a95d['id']),util[_0x7413('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x9a8268(_0x5a8262);});}else{return _0x9a8268(null,_0x2c83f9);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 73f831a..92b0066 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 _0x9e2e=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetZohoAccount','findAll','options','where','attributes','include','map','model','info','debug','ShowZohoAccount','ZohoAccount','find','lodash','util','moment'];(function(_0x3fd0bc,_0xbae0c0){var _0x19259d=function(_0x156157){while(--_0x156157){_0x3fd0bc['push'](_0x3fd0bc['shift']());}};_0x19259d(++_0xbae0c0);}(_0x9e2e,0xd6));var _0xe9e2=function(_0x243af6,_0x1bfae8){_0x243af6=_0x243af6-0x0;var _0xf9b8e3=_0x9e2e[_0x243af6];return _0xf9b8e3;};'use strict';var _=require(_0xe9e2('0x0'));var util=require(_0xe9e2('0x1'));var moment=require(_0xe9e2('0x2'));var BPromise=require('bluebird');var rs=require(_0xe9e2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9e2('0x4'));var logger=require(_0xe9e2('0x5'))(_0xe9e2('0x6'));var config=require(_0xe9e2('0x7'));var jayson=require(_0xe9e2('0x8'));var client=jayson[_0xe9e2('0x9')][_0xe9e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ca0aa,_0x118600,_0x4f1ef7){return new BPromise(function(_0x2bec58,_0x1ade12){return client['request'](_0x5ca0aa,_0x4f1ef7)[_0xe9e2('0xb')](function(_0x48882a){logger['info'](_0xe9e2('0xc'),_0x118600,_0xe9e2('0xd'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x118600,_0xe9e2('0xd'),JSON[_0xe9e2('0xe')](_0x48882a));if(_0x48882a[_0xe9e2('0xf')]){if(_0x48882a[_0xe9e2('0xf')]['code']===0x1f4){logger['error'](_0xe9e2('0xc'),_0x118600,_0x48882a[_0xe9e2('0xf')][_0xe9e2('0x10')]);return _0x1ade12(_0x48882a[_0xe9e2('0xf')][_0xe9e2('0x10')]);}logger[_0xe9e2('0xf')](_0xe9e2('0xc'),_0x118600,_0x48882a[_0xe9e2('0xf')][_0xe9e2('0x10')]);return _0x2bec58(_0x48882a[_0xe9e2('0xf')]['message']);}else{logger['info'](_0xe9e2('0xc'),_0x118600,'request\x20sent');_0x2bec58(_0x48882a['result'][_0xe9e2('0x10')]);}})[_0xe9e2('0x11')](function(_0x3550ce){logger[_0xe9e2('0xf')](_0xe9e2('0xc'),_0x118600,_0x3550ce);_0x1ade12(_0x3550ce);});});}exports[_0xe9e2('0x12')]=function(_0x5f3fc8){var _0xdf6f78=this;return new Promise(function(_0x2094fc,_0x3b6637){return db['ZohoAccount'][_0xe9e2('0x13')]({'raw':_0x5f3fc8[_0xe9e2('0x14')]?_0x5f3fc8[_0xe9e2('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x5f3fc8[_0xe9e2('0x14')]?_0x5f3fc8[_0xe9e2('0x14')][_0xe9e2('0x15')]||null:null,'attributes':_0x5f3fc8['options']?_0x5f3fc8[_0xe9e2('0x14')][_0xe9e2('0x16')]||null:null,'limit':_0x5f3fc8[_0xe9e2('0x14')]?_0x5f3fc8[_0xe9e2('0x14')]['limit']||null:null,'include':_0x5f3fc8[_0xe9e2('0x14')]?_0x5f3fc8[_0xe9e2('0x14')][_0xe9e2('0x17')]?_[_0xe9e2('0x18')](_0x5f3fc8[_0xe9e2('0x14')][_0xe9e2('0x17')],function(_0x26ce3d){return{'model':db[_0x26ce3d[_0xe9e2('0x19')]],'as':_0x26ce3d['as'],'attributes':_0x26ce3d[_0xe9e2('0x16')],'include':_0x26ce3d[_0xe9e2('0x17')]?_[_0xe9e2('0x18')](_0x26ce3d[_0xe9e2('0x17')],function(_0x2a3d69){return{'model':db[_0x2a3d69[_0xe9e2('0x19')]],'as':_0x2a3d69['as'],'attributes':_0x2a3d69[_0xe9e2('0x16')],'include':_0x2a3d69[_0xe9e2('0x17')]?_[_0xe9e2('0x18')](_0x2a3d69['include'],function(_0x43445d){return{'model':db[_0x43445d[_0xe9e2('0x19')]],'as':_0x43445d['as'],'attributes':_0x43445d[_0xe9e2('0x16')]};}):[]};}):[]};}):[]:[]})[_0xe9e2('0xb')](function(_0x57254c){logger[_0xe9e2('0x1a')](_0xe9e2('0x12'),_0x5f3fc8);logger[_0xe9e2('0x1b')](_0xe9e2('0x12'),_0x5f3fc8,JSON[_0xe9e2('0xe')](_0x57254c));_0x2094fc(_0x57254c);})['catch'](function(_0x4cf43f){logger[_0xe9e2('0xf')](_0xe9e2('0x12'),_0x4cf43f[_0xe9e2('0x10')],_0x5f3fc8);_0x3b6637(_0xdf6f78[_0xe9e2('0xf')](0x1f4,_0x4cf43f[_0xe9e2('0x10')]));});});};exports[_0xe9e2('0x1c')]=function(_0x5da7b3){var _0x29d238=this;return new Promise(function(_0x546961,_0x227b7e){return db[_0xe9e2('0x1d')][_0xe9e2('0x1e')]({'raw':_0x5da7b3[_0xe9e2('0x14')]?_0x5da7b3[_0xe9e2('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x5da7b3['options']?_0x5da7b3[_0xe9e2('0x14')][_0xe9e2('0x15')]||null:null,'attributes':_0x5da7b3['options']?_0x5da7b3[_0xe9e2('0x14')][_0xe9e2('0x16')]||null:null,'include':_0x5da7b3[_0xe9e2('0x14')]?_0x5da7b3['options'][_0xe9e2('0x17')]?_[_0xe9e2('0x18')](_0x5da7b3[_0xe9e2('0x14')][_0xe9e2('0x17')],function(_0x573038){return{'model':db[_0x573038[_0xe9e2('0x19')]],'as':_0x573038['as'],'attributes':_0x573038[_0xe9e2('0x16')],'include':_0x573038[_0xe9e2('0x17')]?_['map'](_0x573038['include'],function(_0x3f66ab){return{'model':db[_0x3f66ab[_0xe9e2('0x19')]],'as':_0x3f66ab['as'],'attributes':_0x3f66ab[_0xe9e2('0x16')],'include':_0x3f66ab[_0xe9e2('0x17')]?_[_0xe9e2('0x18')](_0x3f66ab[_0xe9e2('0x17')],function(_0x2fa4aa){return{'model':db[_0x2fa4aa['model']],'as':_0x2fa4aa['as'],'attributes':_0x2fa4aa['attributes']};}):[]};}):[]};}):[]:[]})[_0xe9e2('0xb')](function(_0x4b3184){logger[_0xe9e2('0x1a')](_0xe9e2('0x1c'),_0x5da7b3);logger['debug'](_0xe9e2('0x1c'),_0x5da7b3,JSON[_0xe9e2('0xe')](_0x4b3184));_0x546961(_0x4b3184);})['catch'](function(_0x13a916){logger[_0xe9e2('0xf')]('ShowZohoAccount',_0x13a916['message'],_0x5da7b3);_0x227b7e(_0x29d238[_0xe9e2('0xf')](0x1f4,_0x13a916[_0xe9e2('0x10')]));});});}; \ No newline at end of file +var _0x751c=['debug','GetZohoAccount','find','raw','where','ShowZohoAccount','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ZohoAccount','findAll','options','attributes','limit','include','map','model'];(function(_0x34c06f,_0x96c6fe){var _0x548244=function(_0x2cbca5){while(--_0x2cbca5){_0x34c06f['push'](_0x34c06f['shift']());}};_0x548244(++_0x96c6fe);}(_0x751c,0x69));var _0xc751=function(_0x1f902a,_0x196916){_0x1f902a=_0x1f902a-0x0;var _0xd58990=_0x751c[_0x1f902a];return _0xd58990;};'use strict';var _=require(_0xc751('0x0'));var util=require(_0xc751('0x1'));var moment=require(_0xc751('0x2'));var BPromise=require('bluebird');var rs=require(_0xc751('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc751('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc751('0x5'))(_0xc751('0x6'));var config=require(_0xc751('0x7'));var jayson=require(_0xc751('0x8'));var client=jayson[_0xc751('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12d079,_0x2df8c6,_0x527cf9){return new BPromise(function(_0x363b18,_0x1c6e7d){return client['request'](_0x12d079,_0x527cf9)[_0xc751('0xa')](function(_0xec967e){logger[_0xc751('0xb')](_0xc751('0xc'),_0x2df8c6,_0xc751('0xd'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x2df8c6,'request\x20sent',JSON[_0xc751('0xe')](_0xec967e));if(_0xec967e['error']){if(_0xec967e[_0xc751('0xf')]['code']===0x1f4){logger[_0xc751('0xf')](_0xc751('0xc'),_0x2df8c6,_0xec967e[_0xc751('0xf')]['message']);return _0x1c6e7d(_0xec967e[_0xc751('0xf')]['message']);}logger[_0xc751('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x2df8c6,_0xec967e[_0xc751('0xf')][_0xc751('0x10')]);return _0x363b18(_0xec967e[_0xc751('0xf')][_0xc751('0x10')]);}else{logger[_0xc751('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x2df8c6,_0xc751('0xd'));_0x363b18(_0xec967e[_0xc751('0x11')][_0xc751('0x10')]);}})[_0xc751('0x12')](function(_0x246d4a){logger[_0xc751('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x2df8c6,_0x246d4a);_0x1c6e7d(_0x246d4a);});});}exports['GetZohoAccount']=function(_0x6884e0){var _0x3c71fc=this;return new Promise(function(_0x1e98f1,_0x5ccb7e){return db[_0xc751('0x13')][_0xc751('0x14')]({'raw':_0x6884e0['options']?_0x6884e0[_0xc751('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x6884e0['options']?_0x6884e0[_0xc751('0x15')]['where']||null:null,'attributes':_0x6884e0[_0xc751('0x15')]?_0x6884e0['options'][_0xc751('0x16')]||null:null,'limit':_0x6884e0[_0xc751('0x15')]?_0x6884e0[_0xc751('0x15')][_0xc751('0x17')]||null:null,'include':_0x6884e0[_0xc751('0x15')]?_0x6884e0[_0xc751('0x15')][_0xc751('0x18')]?_[_0xc751('0x19')](_0x6884e0[_0xc751('0x15')][_0xc751('0x18')],function(_0x4df4a4){return{'model':db[_0x4df4a4['model']],'as':_0x4df4a4['as'],'attributes':_0x4df4a4[_0xc751('0x16')],'include':_0x4df4a4['include']?_['map'](_0x4df4a4['include'],function(_0x3210a4){return{'model':db[_0x3210a4[_0xc751('0x1a')]],'as':_0x3210a4['as'],'attributes':_0x3210a4[_0xc751('0x16')],'include':_0x3210a4['include']?_[_0xc751('0x19')](_0x3210a4[_0xc751('0x18')],function(_0x2f64b9){return{'model':db[_0x2f64b9[_0xc751('0x1a')]],'as':_0x2f64b9['as'],'attributes':_0x2f64b9['attributes']};}):[]};}):[]};}):[]:[]})[_0xc751('0xa')](function(_0x2fe70c){logger['info']('GetZohoAccount',_0x6884e0);logger[_0xc751('0x1b')](_0xc751('0x1c'),_0x6884e0,JSON[_0xc751('0xe')](_0x2fe70c));_0x1e98f1(_0x2fe70c);})[_0xc751('0x12')](function(_0xbf05e){logger[_0xc751('0xf')](_0xc751('0x1c'),_0xbf05e[_0xc751('0x10')],_0x6884e0);_0x5ccb7e(_0x3c71fc[_0xc751('0xf')](0x1f4,_0xbf05e[_0xc751('0x10')]));});});};exports['ShowZohoAccount']=function(_0x1c5bee){var _0x45146d=this;return new Promise(function(_0x14a807,_0xeefcb6){return db[_0xc751('0x13')][_0xc751('0x1d')]({'raw':_0x1c5bee['options']?_0x1c5bee[_0xc751('0x15')][_0xc751('0x1e')]===undefined?!![]:![]:!![],'where':_0x1c5bee['options']?_0x1c5bee[_0xc751('0x15')][_0xc751('0x1f')]||null:null,'attributes':_0x1c5bee[_0xc751('0x15')]?_0x1c5bee[_0xc751('0x15')]['attributes']||null:null,'include':_0x1c5bee['options']?_0x1c5bee[_0xc751('0x15')][_0xc751('0x18')]?_['map'](_0x1c5bee[_0xc751('0x15')][_0xc751('0x18')],function(_0x3dd41e){return{'model':db[_0x3dd41e[_0xc751('0x1a')]],'as':_0x3dd41e['as'],'attributes':_0x3dd41e[_0xc751('0x16')],'include':_0x3dd41e[_0xc751('0x18')]?_[_0xc751('0x19')](_0x3dd41e[_0xc751('0x18')],function(_0x8ac8b5){return{'model':db[_0x8ac8b5[_0xc751('0x1a')]],'as':_0x8ac8b5['as'],'attributes':_0x8ac8b5['attributes'],'include':_0x8ac8b5[_0xc751('0x18')]?_['map'](_0x8ac8b5[_0xc751('0x18')],function(_0x24577c){return{'model':db[_0x24577c[_0xc751('0x1a')]],'as':_0x24577c['as'],'attributes':_0x24577c[_0xc751('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x552078){logger[_0xc751('0xb')]('ShowZohoAccount',_0x1c5bee);logger[_0xc751('0x1b')]('ShowZohoAccount',_0x1c5bee,JSON[_0xc751('0xe')](_0x552078));_0x14a807(_0x552078);})[_0xc751('0x12')](function(_0x284d55){logger[_0xc751('0xf')](_0xc751('0x20'),_0x284d55['message'],_0x1c5bee);_0xeefcb6(_0x45146d[_0xc751('0xf')](0x1f4,_0x284d55['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 6552254..f0b710a 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 _0x323e=['getDescriptions','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','/:id','isAuthenticated','getFields','/:id/subjects','getSubjects'];(function(_0x18546c,_0x4daf94){var _0x46ef43=function(_0x559377){while(--_0x559377){_0x18546c['push'](_0x18546c['shift']());}};_0x46ef43(++_0x4daf94);}(_0x323e,0x166));var _0xe323=function(_0x17403d,_0x37c6f9){_0x17403d=_0x17403d-0x0;var _0x1b130b=_0x323e[_0x17403d];return _0x1b130b;};'use strict';var multer=require(_0xe323('0x0'));var util=require(_0xe323('0x1'));var path=require(_0xe323('0x2'));var timeout=require('connect-timeout');var express=require(_0xe323('0x3'));var router=express[_0xe323('0x4')]();var fs_extra=require(_0xe323('0x5'));var auth=require(_0xe323('0x6'));var interaction=require(_0xe323('0x7'));var config=require(_0xe323('0x8'));var controller=require(_0xe323('0x9'));router[_0xe323('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xe323('0xb'),auth[_0xe323('0xc')](),controller['show']);router[_0xe323('0xa')]('/:id/fields',auth[_0xe323('0xc')](),controller[_0xe323('0xd')]);router[_0xe323('0xa')](_0xe323('0xe'),auth[_0xe323('0xc')](),controller[_0xe323('0xf')]);router[_0xe323('0xa')]('/:id/descriptions',auth[_0xe323('0xc')](),controller[_0xe323('0x10')]);router['post']('/',auth[_0xe323('0xc')](),controller[_0xe323('0x11')]);router[_0xe323('0x12')](_0xe323('0xb'),auth['isAuthenticated'](),controller[_0xe323('0x13')]);router[_0xe323('0x14')](_0xe323('0xb'),auth[_0xe323('0xc')](),controller[_0xe323('0x15')]);module['exports']=router; \ No newline at end of file +var _0x19d0=['getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects'];(function(_0x34ac62,_0x40b444){var _0x250ef2=function(_0x126070){while(--_0x126070){_0x34ac62['push'](_0x34ac62['shift']());}};_0x250ef2(++_0x40b444);}(_0x19d0,0x111));var _0x019d=function(_0x178243,_0x32c0de){_0x178243=_0x178243-0x0;var _0x4cd611=_0x19d0[_0x178243];return _0x4cd611;};'use strict';var multer=require(_0x019d('0x0'));var util=require(_0x019d('0x1'));var path=require(_0x019d('0x2'));var timeout=require('connect-timeout');var express=require(_0x019d('0x3'));var router=express[_0x019d('0x4')]();var fs_extra=require(_0x019d('0x5'));var auth=require(_0x019d('0x6'));var interaction=require(_0x019d('0x7'));var config=require('../../config/environment');var controller=require('./intZohoConfiguration.controller');router[_0x019d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x019d('0x8')](_0x019d('0x9'),auth[_0x019d('0xa')](),controller[_0x019d('0xb')]);router['get'](_0x019d('0xc'),auth[_0x019d('0xa')](),controller[_0x019d('0xd')]);router[_0x019d('0x8')](_0x019d('0xe'),auth[_0x019d('0xa')](),controller[_0x019d('0xf')]);router[_0x019d('0x8')](_0x019d('0x10'),auth[_0x019d('0xa')](),controller[_0x019d('0x11')]);router['post']('/',auth[_0x019d('0xa')](),controller[_0x019d('0x12')]);router[_0x019d('0x13')](_0x019d('0x9'),auth[_0x019d('0xa')](),controller[_0x019d('0x14')]);router[_0x019d('0x15')]('/:id',auth[_0x019d('0xa')](),controller[_0x019d('0x16')]);module[_0x019d('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 86dc0f5..ec1685e 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 _0x3b2e=['sequelize','exports','STRING','lead','contact','ENUM'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3b2e,0xf6));var _0xe3b2=function(_0xc0213d,_0x4a3b1d){_0xc0213d=_0xc0213d-0x0;var _0x1a93c4=_0x3b2e[_0xc0213d];return _0x1a93c4;};'use strict';var Sequelize=require(_0xe3b2('0x0'));module[_0xe3b2('0x1')]={'name':{'type':Sequelize[_0xe3b2('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0xe3b2('0x3'),_0xe3b2('0x4'),'nothing'),'defaultValue':_0xe3b2('0x3')},'moduleSearch':{'type':Sequelize[_0xe3b2('0x5')]('contact_lead',_0xe3b2('0x4'),'lead'),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xe3b2('0x2')]}}; \ No newline at end of file +var _0x5d66=['STRING','ENUM','lead','contact','nothing','contact_lead','sequelize','exports'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x5d66,0x126));var _0x65d6=function(_0x5bdfcd,_0x1ed0e3){_0x5bdfcd=_0x5bdfcd-0x0;var _0x3e627a=_0x5d66[_0x5bdfcd];return _0x3e627a;};'use strict';var Sequelize=require(_0x65d6('0x0'));module[_0x65d6('0x1')]={'name':{'type':Sequelize[_0x65d6('0x2')]},'moduleCreate':{'type':Sequelize[_0x65d6('0x3')](_0x65d6('0x4'),_0x65d6('0x5'),_0x65d6('0x6')),'defaultValue':_0x65d6('0x4')},'moduleSearch':{'type':Sequelize[_0x65d6('0x3')](_0x65d6('0x7'),_0x65d6('0x5'),_0x65d6('0x4')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x65d6('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 11393f6..b0cbb51 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 _0x295d=['options','find','create','body','getFields','findOne','ZohoField','length','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params'];(function(_0x30c348,_0x5876c6){var _0x31eb99=function(_0x158271){while(--_0x158271){_0x30c348['push'](_0x30c348['shift']());}};_0x31eb99(++_0x5876c6);}(_0x295d,0xac));var _0xd295=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x295d[_0x47b58b];return _0x46bebe;};'use strict';var emlformat=require(_0xd295('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd295('0x1'));var jsonpatch=require(_0xd295('0x2'));var rp=require(_0xd295('0x3'));var moment=require(_0xd295('0x4'));var BPromise=require(_0xd295('0x5'));var Mustache=require('mustache');var util=require(_0xd295('0x6'));var path=require(_0xd295('0x7'));var sox=require(_0xd295('0x8'));var csv=require(_0xd295('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd295('0xa'));var _=require(_0xd295('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd295('0xc'));var deskjs=require(_0xd295('0xd'));var toCsv=require(_0xd295('0x9'));var querystring=require(_0xd295('0xe'));var Papa=require('papaparse');var Redis=require(_0xd295('0xf'));var authService=require(_0xd295('0x10'));var qs=require(_0xd295('0x11'));var as=require(_0xd295('0x12'));var hardwareService=require(_0xd295('0x13'));var logger=require(_0xd295('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xd295('0x15'));var licenseUtil=require(_0xd295('0x16'));var db=require(_0xd295('0x17'))['db'];function respondWithStatusCode(_0x336c8a,_0x9fde87){_0x9fde87=_0x9fde87||0xcc;return function(_0x1ee32b){if(_0x1ee32b){return _0x336c8a['sendStatus'](_0x9fde87);}return _0x336c8a[_0xd295('0x18')](_0x9fde87)['end']();};}function respondWithResult(_0x4839e9,_0xca0df9){_0xca0df9=_0xca0df9||0xc8;return function(_0x1185e9){if(_0x1185e9){return _0x4839e9[_0xd295('0x18')](_0xca0df9)[_0xd295('0x19')](_0x1185e9);}};}function respondWithFilteredResult(_0x257ebd,_0x3eb106){return function(_0x1ec337){if(_0x1ec337){var _0x44fde4=typeof _0x3eb106['offset']===_0xd295('0x1a')&&typeof _0x3eb106['limit']===_0xd295('0x1a');var _0x1ab462=_0x1ec337[_0xd295('0x1b')];var _0x12bba9=_0x44fde4?0x0:_0x3eb106[_0xd295('0x1c')];var _0x5863d6=_0x44fde4?_0x1ec337['count']:_0x3eb106[_0xd295('0x1c')]+_0x3eb106[_0xd295('0x1d')];var _0x757c36;if(_0x5863d6>=_0x1ab462){_0x5863d6=_0x1ab462;_0x757c36=0xc8;}else{_0x757c36=0xce;}_0x257ebd[_0xd295('0x18')](_0x757c36);return _0x257ebd[_0xd295('0x1e')](_0xd295('0x1f'),_0x12bba9+'-'+_0x5863d6+'/'+_0x1ab462)[_0xd295('0x19')](_0x1ec337);}return null;};}function patchUpdates(_0x53ffb4){return function(_0x48ed80){try{jsonpatch[_0xd295('0x20')](_0x48ed80,_0x53ffb4,!![]);}catch(_0x3e2b89){return BPromise[_0xd295('0x21')](_0x3e2b89);}return _0x48ed80[_0xd295('0x22')]();};}function saveUpdates(_0x2237ab,_0x3d0a50){return function(_0x392eb5){if(_0x392eb5){return _0x392eb5['update'](_0x2237ab)[_0xd295('0x23')](function(_0x4dba51){return _0x4dba51;});}return null;};}function removeEntity(_0x379af6,_0x1a8547){return function(_0xb56007){if(_0xb56007){return _0xb56007[_0xd295('0x24')]()[_0xd295('0x23')](function(){_0x379af6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xbd680a,_0x5a9247){return function(_0x4e598d){if(!_0x4e598d){_0xbd680a[_0xd295('0x25')](0x194);}return _0x4e598d;};}function handleError(_0x5d35bc,_0x3d5808){_0x3d5808=_0x3d5808||0x1f4;return function(_0x23de51){logger[_0xd295('0x26')](_0x23de51[_0xd295('0x27')]);if(_0x23de51[_0xd295('0x28')]){delete _0x23de51[_0xd295('0x28')];}_0x5d35bc['status'](_0x3d5808)['send'](_0x23de51);};}exports[_0xd295('0x29')]=function(_0x4bb267,_0x375fe0){var _0x1ab961={},_0x31649a={},_0x22955e={'count':0x0,'rows':[]};var _0x464d23=_[_0xd295('0x2a')](db[_0xd295('0x2b')][_0xd295('0x2c')],function(_0x19ffb7){return{'name':_0x19ffb7[_0xd295('0x2d')],'type':_0x19ffb7[_0xd295('0x2e')][_0xd295('0x2f')]};});_0x31649a[_0xd295('0x30')]=_[_0xd295('0x2a')](_0x464d23,_0xd295('0x28'));_0x31649a[_0xd295('0x31')]=_[_0xd295('0x32')](_0x4bb267[_0xd295('0x31')]);_0x31649a[_0xd295('0x33')]=_['intersection'](_0x31649a[_0xd295('0x30')],_0x31649a[_0xd295('0x31')]);_0x1ab961[_0xd295('0x34')]=_[_0xd295('0x35')](_0x31649a[_0xd295('0x30')],qs[_0xd295('0x36')](_0x4bb267['query'][_0xd295('0x36')]));_0x1ab961[_0xd295('0x34')]=_0x1ab961[_0xd295('0x34')]['length']?_0x1ab961[_0xd295('0x34')]:_0x31649a['model'];if(!_0x4bb267[_0xd295('0x31')][_0xd295('0x37')](_0xd295('0x38'))){_0x1ab961[_0xd295('0x1d')]=qs['limit'](_0x4bb267['query'][_0xd295('0x1d')]);_0x1ab961[_0xd295('0x1c')]=qs[_0xd295('0x1c')](_0x4bb267[_0xd295('0x31')][_0xd295('0x1c')]);}_0x1ab961[_0xd295('0x39')]=qs[_0xd295('0x3a')](_0x4bb267[_0xd295('0x31')][_0xd295('0x3a')]);_0x1ab961['where']=qs[_0xd295('0x33')](_[_0xd295('0x3b')](_0x4bb267[_0xd295('0x31')],_0x31649a[_0xd295('0x33')]),_0x464d23);if(_0x4bb267[_0xd295('0x31')][_0xd295('0x3c')]){_0x1ab961[_0xd295('0x3d')]=_[_0xd295('0x3e')](_0x1ab961[_0xd295('0x3d')],{'$or':_[_0xd295('0x2a')](_0x464d23,function(_0x41090a){if(_0x41090a[_0xd295('0x2e')]!==_0xd295('0x3f')){var _0x545c47={};_0x545c47[_0x41090a[_0xd295('0x28')]]={'$like':'%'+_0x4bb267[_0xd295('0x31')][_0xd295('0x3c')]+'%'};return _0x545c47;}})});}_0x1ab961=_[_0xd295('0x3e')]({},_0x1ab961,_0x4bb267['options']);var _0x4741f0={'where':_0x1ab961[_0xd295('0x3d')]};return db[_0xd295('0x2b')][_0xd295('0x1b')](_0x4741f0)[_0xd295('0x23')](function(_0x3b700b){_0x22955e[_0xd295('0x1b')]=_0x3b700b;if(_0x4bb267[_0xd295('0x31')][_0xd295('0x40')]){_0x1ab961[_0xd295('0x41')]=[{'all':!![]}];}return db[_0xd295('0x2b')][_0xd295('0x42')](_0x1ab961);})[_0xd295('0x23')](function(_0x3731be){_0x22955e[_0xd295('0x43')]=_0x3731be;return _0x22955e;})[_0xd295('0x23')](respondWithFilteredResult(_0x375fe0,_0x1ab961))[_0xd295('0x44')](handleError(_0x375fe0,null));};exports[_0xd295('0x45')]=function(_0x1371f2,_0x3e41d1){var _0x561e5b={'raw':![],'where':{'id':_0x1371f2[_0xd295('0x46')]['id']}},_0x2df02d={};_0x2df02d[_0xd295('0x30')]=_[_0xd295('0x32')](db[_0xd295('0x2b')]['rawAttributes']);_0x2df02d[_0xd295('0x31')]=_[_0xd295('0x32')](_0x1371f2[_0xd295('0x31')]);_0x2df02d['filters']=_[_0xd295('0x35')](_0x2df02d['model'],_0x2df02d['query']);_0x561e5b[_0xd295('0x34')]=_[_0xd295('0x35')](_0x2df02d[_0xd295('0x30')],qs[_0xd295('0x36')](_0x1371f2[_0xd295('0x31')]['fields']));_0x561e5b[_0xd295('0x34')]=_0x561e5b[_0xd295('0x34')]['length']?_0x561e5b[_0xd295('0x34')]:_0x2df02d[_0xd295('0x30')];if(_0x1371f2[_0xd295('0x31')][_0xd295('0x40')]){_0x561e5b['include']=[{'all':!![]}];}_0x561e5b=_[_0xd295('0x3e')]({},_0x561e5b,_0x1371f2[_0xd295('0x47')]);return db[_0xd295('0x2b')][_0xd295('0x48')](_0x561e5b)[_0xd295('0x23')](handleEntityNotFound(_0x3e41d1,null))[_0xd295('0x23')](respondWithResult(_0x3e41d1,null))[_0xd295('0x44')](handleError(_0x3e41d1,null));};exports[_0xd295('0x49')]=function(_0x3dda0d,_0x252f6e){return db[_0xd295('0x2b')][_0xd295('0x49')](_0x3dda0d['body'],{})[_0xd295('0x23')](respondWithResult(_0x252f6e,0xc9))[_0xd295('0x44')](handleError(_0x252f6e,null));};exports['update']=function(_0x5b14d4,_0x1e875a){if(_0x5b14d4[_0xd295('0x4a')]['id']){delete _0x5b14d4[_0xd295('0x4a')]['id'];}return db[_0xd295('0x2b')][_0xd295('0x48')]({'where':{'id':_0x5b14d4[_0xd295('0x46')]['id']}})[_0xd295('0x23')](handleEntityNotFound(_0x1e875a,null))[_0xd295('0x23')](saveUpdates(_0x5b14d4['body'],null))[_0xd295('0x23')](respondWithResult(_0x1e875a,null))[_0xd295('0x44')](handleError(_0x1e875a,null));};exports['destroy']=function(_0x4e4c24,_0x587213){return db['ZohoConfiguration'][_0xd295('0x48')]({'where':{'id':_0x4e4c24[_0xd295('0x46')]['id']}})['then'](handleEntityNotFound(_0x587213,null))['then'](removeEntity(_0x587213,null))[_0xd295('0x44')](handleError(_0x587213,null));};exports[_0xd295('0x4b')]=function(_0x5a1870,_0x1faf54,_0x3238c7){var _0x1c0ac7={};var _0x393a6d={};var _0x3e94c1;var _0x44b457;return db[_0xd295('0x2b')][_0xd295('0x4c')]({'where':{'id':_0x5a1870[_0xd295('0x46')]['id']}})[_0xd295('0x23')](handleEntityNotFound(_0x1faf54,null))[_0xd295('0x23')](function(_0x326d3d){if(_0x326d3d){_0x3e94c1=_0x326d3d;_0x393a6d['model']=_[_0xd295('0x32')](db[_0xd295('0x4d')][_0xd295('0x2c')]);_0x393a6d[_0xd295('0x31')]=_[_0xd295('0x32')](_0x5a1870[_0xd295('0x31')]);_0x393a6d['filters']=_[_0xd295('0x35')](_0x393a6d[_0xd295('0x30')],_0x393a6d[_0xd295('0x31')]);_0x1c0ac7['attributes']=_['intersection'](_0x393a6d[_0xd295('0x30')],qs['fields'](_0x5a1870[_0xd295('0x31')][_0xd295('0x36')]));_0x1c0ac7[_0xd295('0x34')]=_0x1c0ac7[_0xd295('0x34')][_0xd295('0x4e')]?_0x1c0ac7['attributes']:_0x393a6d['model'];_0x1c0ac7[_0xd295('0x39')]=qs['sort'](_0x5a1870['query']['sort']);_0x1c0ac7[_0xd295('0x3d')]=qs['filters'](_[_0xd295('0x3b')](_0x5a1870['query'],_0x393a6d[_0xd295('0x33')]));if(_0x5a1870[_0xd295('0x31')]['filter']){_0x1c0ac7['where']=_['merge'](_0x1c0ac7[_0xd295('0x3d')],{'$or':_['map'](_0x1c0ac7['attributes'],function(_0xdfe210){var _0x174195={};_0x174195[_0xdfe210]={'$like':'%'+_0x5a1870[_0xd295('0x31')]['filter']+'%'};return _0x174195;})});}_0x1c0ac7=_[_0xd295('0x3e')]({},_0x1c0ac7,_0x5a1870[_0xd295('0x47')]);return _0x3e94c1[_0xd295('0x4b')](_0x1c0ac7);}})[_0xd295('0x23')](function(_0xfa6f70){if(_0xfa6f70){_0x44b457=_0xfa6f70[_0xd295('0x4e')];if(!_0x5a1870[_0xd295('0x31')]['hasOwnProperty'](_0xd295('0x38'))){_0x1c0ac7[_0xd295('0x1d')]=qs[_0xd295('0x1d')](_0x5a1870[_0xd295('0x31')][_0xd295('0x1d')]);_0x1c0ac7['offset']=qs[_0xd295('0x1c')](_0x5a1870['query']['offset']);}return _0x3e94c1[_0xd295('0x4b')](_0x1c0ac7);}})[_0xd295('0x23')](function(_0x2965c3){if(_0x2965c3){return _0x2965c3?{'count':_0x44b457,'rows':_0x2965c3}:null;}})[_0xd295('0x23')](respondWithResult(_0x1faf54,null))['catch'](handleError(_0x1faf54,null));};exports[_0xd295('0x4f')]=function(_0x223eec,_0x4093d6,_0x4bbd9d){var _0x10ff4c={};var _0x1a4a48={};var _0x4d04f7;var _0x4f620b;return db[_0xd295('0x2b')]['findOne']({'where':{'id':_0x223eec[_0xd295('0x46')]['id']}})[_0xd295('0x23')](handleEntityNotFound(_0x4093d6,null))[_0xd295('0x23')](function(_0xd416c4){if(_0xd416c4){_0x4d04f7=_0xd416c4;_0x1a4a48['model']=_[_0xd295('0x32')](db[_0xd295('0x4d')][_0xd295('0x2c')]);_0x1a4a48[_0xd295('0x31')]=_[_0xd295('0x32')](_0x223eec[_0xd295('0x31')]);_0x1a4a48[_0xd295('0x33')]=_['intersection'](_0x1a4a48[_0xd295('0x30')],_0x1a4a48['query']);_0x10ff4c[_0xd295('0x34')]=_[_0xd295('0x35')](_0x1a4a48[_0xd295('0x30')],qs['fields'](_0x223eec[_0xd295('0x31')]['fields']));_0x10ff4c['attributes']=_0x10ff4c[_0xd295('0x34')][_0xd295('0x4e')]?_0x10ff4c[_0xd295('0x34')]:_0x1a4a48[_0xd295('0x30')];_0x10ff4c[_0xd295('0x39')]=qs[_0xd295('0x3a')](_0x223eec['query']['sort']);_0x10ff4c[_0xd295('0x3d')]=qs[_0xd295('0x33')](_[_0xd295('0x3b')](_0x223eec[_0xd295('0x31')],_0x1a4a48[_0xd295('0x33')]));if(_0x223eec['query']['filter']){_0x10ff4c['where']=_['merge'](_0x10ff4c['where'],{'$or':_[_0xd295('0x2a')](_0x10ff4c[_0xd295('0x34')],function(_0x18db17){var _0x668403={};_0x668403[_0x18db17]={'$like':'%'+_0x223eec['query'][_0xd295('0x3c')]+'%'};return _0x668403;})});}_0x10ff4c=_[_0xd295('0x3e')]({},_0x10ff4c,_0x223eec[_0xd295('0x47')]);return _0x4d04f7[_0xd295('0x4f')](_0x10ff4c);}})[_0xd295('0x23')](function(_0x4b3392){if(_0x4b3392){_0x4f620b=_0x4b3392[_0xd295('0x4e')];if(!_0x223eec['query'][_0xd295('0x37')](_0xd295('0x38'))){_0x10ff4c[_0xd295('0x1d')]=qs[_0xd295('0x1d')](_0x223eec[_0xd295('0x31')]['limit']);_0x10ff4c[_0xd295('0x1c')]=qs[_0xd295('0x1c')](_0x223eec[_0xd295('0x31')][_0xd295('0x1c')]);}return _0x4d04f7[_0xd295('0x4f')](_0x10ff4c);}})[_0xd295('0x23')](function(_0x3f71b8){if(_0x3f71b8){return _0x3f71b8?{'count':_0x4f620b,'rows':_0x3f71b8}:null;}})[_0xd295('0x23')](respondWithResult(_0x4093d6,null))['catch'](handleError(_0x4093d6,null));};exports['getDescriptions']=function(_0x59c884,_0x1dde70,_0x27ee4e){var _0x1ffd4b={};var _0x225bea={};var _0x37ce69;var _0x72c2dc;return db[_0xd295('0x2b')][_0xd295('0x4c')]({'where':{'id':_0x59c884[_0xd295('0x46')]['id']}})[_0xd295('0x23')](handleEntityNotFound(_0x1dde70,null))['then'](function(_0xd99ae0){if(_0xd99ae0){_0x37ce69=_0xd99ae0;_0x225bea[_0xd295('0x30')]=_['keys'](db[_0xd295('0x4d')][_0xd295('0x2c')]);_0x225bea['query']=_[_0xd295('0x32')](_0x59c884['query']);_0x225bea['filters']=_[_0xd295('0x35')](_0x225bea[_0xd295('0x30')],_0x225bea[_0xd295('0x31')]);_0x1ffd4b[_0xd295('0x34')]=_[_0xd295('0x35')](_0x225bea[_0xd295('0x30')],qs[_0xd295('0x36')](_0x59c884[_0xd295('0x31')][_0xd295('0x36')]));_0x1ffd4b[_0xd295('0x34')]=_0x1ffd4b['attributes']['length']?_0x1ffd4b[_0xd295('0x34')]:_0x225bea['model'];_0x1ffd4b[_0xd295('0x39')]=qs[_0xd295('0x3a')](_0x59c884[_0xd295('0x31')][_0xd295('0x3a')]);_0x1ffd4b['where']=qs['filters'](_['pick'](_0x59c884['query'],_0x225bea['filters']));if(_0x59c884[_0xd295('0x31')][_0xd295('0x3c')]){_0x1ffd4b[_0xd295('0x3d')]=_[_0xd295('0x3e')](_0x1ffd4b[_0xd295('0x3d')],{'$or':_[_0xd295('0x2a')](_0x1ffd4b['attributes'],function(_0xd7604d){var _0x49fdd={};_0x49fdd[_0xd7604d]={'$like':'%'+_0x59c884[_0xd295('0x31')]['filter']+'%'};return _0x49fdd;})});}_0x1ffd4b=_['merge']({},_0x1ffd4b,_0x59c884[_0xd295('0x47')]);return _0x37ce69['getDescriptions'](_0x1ffd4b);}})[_0xd295('0x23')](function(_0xe56ab){if(_0xe56ab){_0x72c2dc=_0xe56ab[_0xd295('0x4e')];if(!_0x59c884[_0xd295('0x31')][_0xd295('0x37')](_0xd295('0x38'))){_0x1ffd4b[_0xd295('0x1d')]=qs[_0xd295('0x1d')](_0x59c884['query'][_0xd295('0x1d')]);_0x1ffd4b[_0xd295('0x1c')]=qs[_0xd295('0x1c')](_0x59c884['query']['offset']);}return _0x37ce69[_0xd295('0x50')](_0x1ffd4b);}})[_0xd295('0x23')](function(_0x1239c9){if(_0x1239c9){return _0x1239c9?{'count':_0x72c2dc,'rows':_0x1239c9}:null;}})[_0xd295('0x23')](respondWithResult(_0x1dde70,null))[_0xd295('0x44')](handleError(_0x1dde70,null));}; \ No newline at end of file +var _0xefc5=['rows','catch','show','params','ZohoConfiguration','options','find','create','body','getFields','findOne','ZohoField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include'];(function(_0x45953b,_0x4b3e6f){var _0x18524d=function(_0x42f41d){while(--_0x42f41d){_0x45953b['push'](_0x45953b['shift']());}};_0x18524d(++_0x4b3e6f);}(_0xefc5,0x1e8));var _0x5efc=function(_0x1e1020,_0xd64a27){_0x1e1020=_0x1e1020-0x0;var _0x464719=_0xefc5[_0x1e1020];return _0x464719;};'use strict';var emlformat=require(_0x5efc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5efc('0x1'));var jsonpatch=require(_0x5efc('0x2'));var rp=require(_0x5efc('0x3'));var moment=require(_0x5efc('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5efc('0x5'));var path=require(_0x5efc('0x6'));var sox=require(_0x5efc('0x7'));var csv=require(_0x5efc('0x8'));var ejs=require(_0x5efc('0x9'));var fs=require('fs');var fs_extra=require(_0x5efc('0xa'));var _=require('lodash');var squel=require(_0x5efc('0xb'));var crypto=require(_0x5efc('0xc'));var jsforce=require(_0x5efc('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5efc('0x8'));var querystring=require(_0x5efc('0xe'));var Papa=require(_0x5efc('0xf'));var Redis=require(_0x5efc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5efc('0x11'));var as=require(_0x5efc('0x12'));var hardwareService=require(_0x5efc('0x13'));var logger=require(_0x5efc('0x14'))(_0x5efc('0x15'));var utils=require('../../config/utils');var config=require(_0x5efc('0x16'));var licenseUtil=require(_0x5efc('0x17'));var db=require(_0x5efc('0x18'))['db'];function respondWithStatusCode(_0xd4c796,_0x27e53c){_0x27e53c=_0x27e53c||0xcc;return function(_0x54062c){if(_0x54062c){return _0xd4c796[_0x5efc('0x19')](_0x27e53c);}return _0xd4c796[_0x5efc('0x1a')](_0x27e53c)['end']();};}function respondWithResult(_0xafb14a,_0x26bf3a){_0x26bf3a=_0x26bf3a||0xc8;return function(_0x3b2f59){if(_0x3b2f59){return _0xafb14a['status'](_0x26bf3a)[_0x5efc('0x1b')](_0x3b2f59);}};}function respondWithFilteredResult(_0x7fb3a2,_0x183ce3){return function(_0x34e8ea){if(_0x34e8ea){var _0x5eaa7a=typeof _0x183ce3[_0x5efc('0x1c')]===_0x5efc('0x1d')&&typeof _0x183ce3[_0x5efc('0x1e')]===_0x5efc('0x1d');var _0x1a2b4f=_0x34e8ea[_0x5efc('0x1f')];var _0x794c80=_0x5eaa7a?0x0:_0x183ce3[_0x5efc('0x1c')];var _0x5f56d2=_0x5eaa7a?_0x34e8ea[_0x5efc('0x1f')]:_0x183ce3[_0x5efc('0x1c')]+_0x183ce3['limit'];var _0xc9b9b2;if(_0x5f56d2>=_0x1a2b4f){_0x5f56d2=_0x1a2b4f;_0xc9b9b2=0xc8;}else{_0xc9b9b2=0xce;}_0x7fb3a2['status'](_0xc9b9b2);return _0x7fb3a2[_0x5efc('0x20')](_0x5efc('0x21'),_0x794c80+'-'+_0x5f56d2+'/'+_0x1a2b4f)['json'](_0x34e8ea);}return null;};}function patchUpdates(_0x599ae0){return function(_0x835058){try{jsonpatch[_0x5efc('0x22')](_0x835058,_0x599ae0,!![]);}catch(_0x52a45a){return BPromise[_0x5efc('0x23')](_0x52a45a);}return _0x835058[_0x5efc('0x24')]();};}function saveUpdates(_0x4d66fc,_0xa36c54){return function(_0x38a062){if(_0x38a062){return _0x38a062[_0x5efc('0x25')](_0x4d66fc)[_0x5efc('0x26')](function(_0x4b189e){return _0x4b189e;});}return null;};}function removeEntity(_0xd38f13,_0x3b90b8){return function(_0x52addc){if(_0x52addc){return _0x52addc['destroy']()[_0x5efc('0x26')](function(){_0xd38f13['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x444915,_0x1fbb98){return function(_0x4e21a1){if(!_0x4e21a1){_0x444915[_0x5efc('0x19')](0x194);}return _0x4e21a1;};}function handleError(_0x309ea0,_0x1f2f08){_0x1f2f08=_0x1f2f08||0x1f4;return function(_0x315b23){logger['error'](_0x315b23[_0x5efc('0x27')]);if(_0x315b23[_0x5efc('0x28')]){delete _0x315b23['name'];}_0x309ea0[_0x5efc('0x1a')](_0x1f2f08)['send'](_0x315b23);};}exports[_0x5efc('0x29')]=function(_0x5ad1f8,_0x24fdbc){var _0x3b4976={},_0x244688={},_0x263dbb={'count':0x0,'rows':[]};var _0x249662=_[_0x5efc('0x2a')](db['ZohoConfiguration'][_0x5efc('0x2b')],function(_0x5ab329){return{'name':_0x5ab329[_0x5efc('0x2c')],'type':_0x5ab329[_0x5efc('0x2d')]['key']};});_0x244688[_0x5efc('0x2e')]=_['map'](_0x249662,_0x5efc('0x28'));_0x244688[_0x5efc('0x2f')]=_[_0x5efc('0x30')](_0x5ad1f8['query']);_0x244688['filters']=_[_0x5efc('0x31')](_0x244688[_0x5efc('0x2e')],_0x244688[_0x5efc('0x2f')]);_0x3b4976[_0x5efc('0x32')]=_['intersection'](_0x244688['model'],qs[_0x5efc('0x33')](_0x5ad1f8[_0x5efc('0x2f')]['fields']));_0x3b4976[_0x5efc('0x32')]=_0x3b4976[_0x5efc('0x32')][_0x5efc('0x34')]?_0x3b4976[_0x5efc('0x32')]:_0x244688[_0x5efc('0x2e')];if(!_0x5ad1f8[_0x5efc('0x2f')][_0x5efc('0x35')](_0x5efc('0x36'))){_0x3b4976['limit']=qs[_0x5efc('0x1e')](_0x5ad1f8[_0x5efc('0x2f')][_0x5efc('0x1e')]);_0x3b4976[_0x5efc('0x1c')]=qs['offset'](_0x5ad1f8[_0x5efc('0x2f')]['offset']);}_0x3b4976[_0x5efc('0x37')]=qs[_0x5efc('0x38')](_0x5ad1f8[_0x5efc('0x2f')][_0x5efc('0x38')]);_0x3b4976[_0x5efc('0x39')]=qs[_0x5efc('0x3a')](_[_0x5efc('0x3b')](_0x5ad1f8[_0x5efc('0x2f')],_0x244688[_0x5efc('0x3a')]),_0x249662);if(_0x5ad1f8[_0x5efc('0x2f')][_0x5efc('0x3c')]){_0x3b4976[_0x5efc('0x39')]=_[_0x5efc('0x3d')](_0x3b4976[_0x5efc('0x39')],{'$or':_[_0x5efc('0x2a')](_0x249662,function(_0x407a24){if(_0x407a24[_0x5efc('0x2d')]!==_0x5efc('0x3e')){var _0xb553b6={};_0xb553b6[_0x407a24['name']]={'$like':'%'+_0x5ad1f8[_0x5efc('0x2f')][_0x5efc('0x3c')]+'%'};return _0xb553b6;}})});}_0x3b4976=_['merge']({},_0x3b4976,_0x5ad1f8['options']);var _0x3a50a2={'where':_0x3b4976[_0x5efc('0x39')]};return db['ZohoConfiguration'][_0x5efc('0x1f')](_0x3a50a2)['then'](function(_0x3507cf){_0x263dbb[_0x5efc('0x1f')]=_0x3507cf;if(_0x5ad1f8['query'][_0x5efc('0x3f')]){_0x3b4976[_0x5efc('0x40')]=[{'all':!![]}];}return db['ZohoConfiguration']['findAll'](_0x3b4976);})[_0x5efc('0x26')](function(_0x4bff37){_0x263dbb[_0x5efc('0x41')]=_0x4bff37;return _0x263dbb;})[_0x5efc('0x26')](respondWithFilteredResult(_0x24fdbc,_0x3b4976))[_0x5efc('0x42')](handleError(_0x24fdbc,null));};exports[_0x5efc('0x43')]=function(_0x2141af,_0x50b897){var _0x2e8259={'raw':![],'where':{'id':_0x2141af[_0x5efc('0x44')]['id']}},_0x1ede95={};_0x1ede95[_0x5efc('0x2e')]=_['keys'](db[_0x5efc('0x45')]['rawAttributes']);_0x1ede95['query']=_[_0x5efc('0x30')](_0x2141af[_0x5efc('0x2f')]);_0x1ede95[_0x5efc('0x3a')]=_[_0x5efc('0x31')](_0x1ede95[_0x5efc('0x2e')],_0x1ede95[_0x5efc('0x2f')]);_0x2e8259[_0x5efc('0x32')]=_[_0x5efc('0x31')](_0x1ede95[_0x5efc('0x2e')],qs[_0x5efc('0x33')](_0x2141af[_0x5efc('0x2f')]['fields']));_0x2e8259[_0x5efc('0x32')]=_0x2e8259['attributes']['length']?_0x2e8259[_0x5efc('0x32')]:_0x1ede95[_0x5efc('0x2e')];if(_0x2141af['query'][_0x5efc('0x3f')]){_0x2e8259[_0x5efc('0x40')]=[{'all':!![]}];}_0x2e8259=_[_0x5efc('0x3d')]({},_0x2e8259,_0x2141af[_0x5efc('0x46')]);return db['ZohoConfiguration'][_0x5efc('0x47')](_0x2e8259)['then'](handleEntityNotFound(_0x50b897,null))[_0x5efc('0x26')](respondWithResult(_0x50b897,null))[_0x5efc('0x42')](handleError(_0x50b897,null));};exports[_0x5efc('0x48')]=function(_0xac0e5a,_0x590c11){return db[_0x5efc('0x45')][_0x5efc('0x48')](_0xac0e5a[_0x5efc('0x49')],{})[_0x5efc('0x26')](respondWithResult(_0x590c11,0xc9))['catch'](handleError(_0x590c11,null));};exports[_0x5efc('0x25')]=function(_0x4c37df,_0x11d620){if(_0x4c37df[_0x5efc('0x49')]['id']){delete _0x4c37df[_0x5efc('0x49')]['id'];}return db[_0x5efc('0x45')][_0x5efc('0x47')]({'where':{'id':_0x4c37df[_0x5efc('0x44')]['id']}})[_0x5efc('0x26')](handleEntityNotFound(_0x11d620,null))[_0x5efc('0x26')](saveUpdates(_0x4c37df['body'],null))[_0x5efc('0x26')](respondWithResult(_0x11d620,null))[_0x5efc('0x42')](handleError(_0x11d620,null));};exports['destroy']=function(_0x5ea0ab,_0x9b6150){return db[_0x5efc('0x45')][_0x5efc('0x47')]({'where':{'id':_0x5ea0ab[_0x5efc('0x44')]['id']}})['then'](handleEntityNotFound(_0x9b6150,null))['then'](removeEntity(_0x9b6150,null))[_0x5efc('0x42')](handleError(_0x9b6150,null));};exports[_0x5efc('0x4a')]=function(_0x525f5b,_0x8839e8,_0x856ecf){var _0x4776bb={};var _0x54c742={};var _0x4269e6;var _0x4f3f0c;return db[_0x5efc('0x45')][_0x5efc('0x4b')]({'where':{'id':_0x525f5b[_0x5efc('0x44')]['id']}})[_0x5efc('0x26')](handleEntityNotFound(_0x8839e8,null))[_0x5efc('0x26')](function(_0x3899f0){if(_0x3899f0){_0x4269e6=_0x3899f0;_0x54c742['model']=_[_0x5efc('0x30')](db[_0x5efc('0x4c')][_0x5efc('0x2b')]);_0x54c742[_0x5efc('0x2f')]=_[_0x5efc('0x30')](_0x525f5b[_0x5efc('0x2f')]);_0x54c742[_0x5efc('0x3a')]=_[_0x5efc('0x31')](_0x54c742['model'],_0x54c742[_0x5efc('0x2f')]);_0x4776bb[_0x5efc('0x32')]=_['intersection'](_0x54c742[_0x5efc('0x2e')],qs['fields'](_0x525f5b[_0x5efc('0x2f')][_0x5efc('0x33')]));_0x4776bb[_0x5efc('0x32')]=_0x4776bb[_0x5efc('0x32')]['length']?_0x4776bb[_0x5efc('0x32')]:_0x54c742[_0x5efc('0x2e')];_0x4776bb['order']=qs[_0x5efc('0x38')](_0x525f5b[_0x5efc('0x2f')][_0x5efc('0x38')]);_0x4776bb[_0x5efc('0x39')]=qs[_0x5efc('0x3a')](_['pick'](_0x525f5b[_0x5efc('0x2f')],_0x54c742['filters']));if(_0x525f5b['query']['filter']){_0x4776bb[_0x5efc('0x39')]=_[_0x5efc('0x3d')](_0x4776bb[_0x5efc('0x39')],{'$or':_['map'](_0x4776bb[_0x5efc('0x32')],function(_0x28ef83){var _0x94658f={};_0x94658f[_0x28ef83]={'$like':'%'+_0x525f5b[_0x5efc('0x2f')][_0x5efc('0x3c')]+'%'};return _0x94658f;})});}_0x4776bb=_[_0x5efc('0x3d')]({},_0x4776bb,_0x525f5b['options']);return _0x4269e6['getFields'](_0x4776bb);}})[_0x5efc('0x26')](function(_0x32a2d0){if(_0x32a2d0){_0x4f3f0c=_0x32a2d0['length'];if(!_0x525f5b[_0x5efc('0x2f')][_0x5efc('0x35')](_0x5efc('0x36'))){_0x4776bb[_0x5efc('0x1e')]=qs[_0x5efc('0x1e')](_0x525f5b[_0x5efc('0x2f')][_0x5efc('0x1e')]);_0x4776bb[_0x5efc('0x1c')]=qs['offset'](_0x525f5b['query']['offset']);}return _0x4269e6[_0x5efc('0x4a')](_0x4776bb);}})[_0x5efc('0x26')](function(_0x1a20ec){if(_0x1a20ec){return _0x1a20ec?{'count':_0x4f3f0c,'rows':_0x1a20ec}:null;}})[_0x5efc('0x26')](respondWithResult(_0x8839e8,null))['catch'](handleError(_0x8839e8,null));};exports[_0x5efc('0x4d')]=function(_0x2b5211,_0x1ff861,_0x234a20){var _0x591f60={};var _0x2bfbd8={};var _0x538ae7;var _0x9be2b9;return db[_0x5efc('0x45')][_0x5efc('0x4b')]({'where':{'id':_0x2b5211[_0x5efc('0x44')]['id']}})[_0x5efc('0x26')](handleEntityNotFound(_0x1ff861,null))['then'](function(_0x3bf1cd){if(_0x3bf1cd){_0x538ae7=_0x3bf1cd;_0x2bfbd8[_0x5efc('0x2e')]=_['keys'](db[_0x5efc('0x4c')][_0x5efc('0x2b')]);_0x2bfbd8[_0x5efc('0x2f')]=_[_0x5efc('0x30')](_0x2b5211[_0x5efc('0x2f')]);_0x2bfbd8['filters']=_[_0x5efc('0x31')](_0x2bfbd8[_0x5efc('0x2e')],_0x2bfbd8['query']);_0x591f60['attributes']=_[_0x5efc('0x31')](_0x2bfbd8[_0x5efc('0x2e')],qs['fields'](_0x2b5211[_0x5efc('0x2f')][_0x5efc('0x33')]));_0x591f60['attributes']=_0x591f60[_0x5efc('0x32')][_0x5efc('0x34')]?_0x591f60[_0x5efc('0x32')]:_0x2bfbd8[_0x5efc('0x2e')];_0x591f60[_0x5efc('0x37')]=qs[_0x5efc('0x38')](_0x2b5211[_0x5efc('0x2f')][_0x5efc('0x38')]);_0x591f60[_0x5efc('0x39')]=qs['filters'](_[_0x5efc('0x3b')](_0x2b5211[_0x5efc('0x2f')],_0x2bfbd8[_0x5efc('0x3a')]));if(_0x2b5211[_0x5efc('0x2f')][_0x5efc('0x3c')]){_0x591f60[_0x5efc('0x39')]=_[_0x5efc('0x3d')](_0x591f60[_0x5efc('0x39')],{'$or':_['map'](_0x591f60[_0x5efc('0x32')],function(_0x57d0f8){var _0x783cc9={};_0x783cc9[_0x57d0f8]={'$like':'%'+_0x2b5211[_0x5efc('0x2f')][_0x5efc('0x3c')]+'%'};return _0x783cc9;})});}_0x591f60=_['merge']({},_0x591f60,_0x2b5211[_0x5efc('0x46')]);return _0x538ae7[_0x5efc('0x4d')](_0x591f60);}})['then'](function(_0x5f1dff){if(_0x5f1dff){_0x9be2b9=_0x5f1dff[_0x5efc('0x34')];if(!_0x2b5211[_0x5efc('0x2f')][_0x5efc('0x35')]('nolimit')){_0x591f60[_0x5efc('0x1e')]=qs[_0x5efc('0x1e')](_0x2b5211[_0x5efc('0x2f')][_0x5efc('0x1e')]);_0x591f60[_0x5efc('0x1c')]=qs[_0x5efc('0x1c')](_0x2b5211[_0x5efc('0x2f')][_0x5efc('0x1c')]);}return _0x538ae7[_0x5efc('0x4d')](_0x591f60);}})[_0x5efc('0x26')](function(_0x5ced36){if(_0x5ced36){return _0x5ced36?{'count':_0x9be2b9,'rows':_0x5ced36}:null;}})['then'](respondWithResult(_0x1ff861,null))[_0x5efc('0x42')](handleError(_0x1ff861,null));};exports[_0x5efc('0x4e')]=function(_0x103bfd,_0x35e80e,_0x50c1fc){var _0x2ede17={};var _0x40c5ba={};var _0x2db16d;var _0x2e32c6;return db['ZohoConfiguration'][_0x5efc('0x4b')]({'where':{'id':_0x103bfd[_0x5efc('0x44')]['id']}})[_0x5efc('0x26')](handleEntityNotFound(_0x35e80e,null))[_0x5efc('0x26')](function(_0x2a9d56){if(_0x2a9d56){_0x2db16d=_0x2a9d56;_0x40c5ba[_0x5efc('0x2e')]=_[_0x5efc('0x30')](db['ZohoField'][_0x5efc('0x2b')]);_0x40c5ba['query']=_[_0x5efc('0x30')](_0x103bfd[_0x5efc('0x2f')]);_0x40c5ba[_0x5efc('0x3a')]=_[_0x5efc('0x31')](_0x40c5ba[_0x5efc('0x2e')],_0x40c5ba[_0x5efc('0x2f')]);_0x2ede17['attributes']=_[_0x5efc('0x31')](_0x40c5ba['model'],qs[_0x5efc('0x33')](_0x103bfd['query'][_0x5efc('0x33')]));_0x2ede17['attributes']=_0x2ede17['attributes'][_0x5efc('0x34')]?_0x2ede17[_0x5efc('0x32')]:_0x40c5ba['model'];_0x2ede17[_0x5efc('0x37')]=qs[_0x5efc('0x38')](_0x103bfd[_0x5efc('0x2f')]['sort']);_0x2ede17[_0x5efc('0x39')]=qs['filters'](_[_0x5efc('0x3b')](_0x103bfd[_0x5efc('0x2f')],_0x40c5ba[_0x5efc('0x3a')]));if(_0x103bfd[_0x5efc('0x2f')][_0x5efc('0x3c')]){_0x2ede17[_0x5efc('0x39')]=_['merge'](_0x2ede17[_0x5efc('0x39')],{'$or':_[_0x5efc('0x2a')](_0x2ede17[_0x5efc('0x32')],function(_0x6b54bd){var _0x315b09={};_0x315b09[_0x6b54bd]={'$like':'%'+_0x103bfd[_0x5efc('0x2f')][_0x5efc('0x3c')]+'%'};return _0x315b09;})});}_0x2ede17=_[_0x5efc('0x3d')]({},_0x2ede17,_0x103bfd[_0x5efc('0x46')]);return _0x2db16d[_0x5efc('0x4e')](_0x2ede17);}})[_0x5efc('0x26')](function(_0x39f767){if(_0x39f767){_0x2e32c6=_0x39f767[_0x5efc('0x34')];if(!_0x103bfd[_0x5efc('0x2f')]['hasOwnProperty'](_0x5efc('0x36'))){_0x2ede17[_0x5efc('0x1e')]=qs[_0x5efc('0x1e')](_0x103bfd[_0x5efc('0x2f')]['limit']);_0x2ede17['offset']=qs[_0x5efc('0x1c')](_0x103bfd[_0x5efc('0x2f')][_0x5efc('0x1c')]);}return _0x2db16d[_0x5efc('0x4e')](_0x2ede17);}})[_0x5efc('0x26')](function(_0xe7f030){if(_0xe7f030){return _0xe7f030?{'count':_0x2e32c6,'rows':_0xe7f030}:null;}})[_0x5efc('0x26')](respondWithResult(_0x35e80e,null))[_0x5efc('0x42')](handleError(_0x35e80e,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 2d8d62e..df12516 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 _0xf1a3=['path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xf1a3,0x78));var _0x3f1a=function(_0x4e697a,_0x56a14b){_0x4e697a=_0x4e697a-0x0;var _0x88850c=_0xf1a3[_0x4e697a];return _0x88850c;};'use strict';var _=require(_0x3f1a('0x0'));var util=require(_0x3f1a('0x1'));var logger=require(_0x3f1a('0x2'))(_0x3f1a('0x3'));var moment=require(_0x3f1a('0x4'));var BPromise=require('bluebird');var rp=require(_0x3f1a('0x5'));var fs=require('fs');var path=require(_0x3f1a('0x6'));var rimraf=require(_0x3f1a('0x7'));var config=require(_0x3f1a('0x8'));var attributes=require(_0x3f1a('0x9'));module[_0x3f1a('0xa')]=function(_0x4017a9,_0x5748e4){return _0x4017a9[_0x3f1a('0xb')](_0x3f1a('0xc'),attributes,{'tableName':_0x3f1a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x68c5=['../../config/environment','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x68c5,0x12f));var _0x568c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x68c5[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x568c('0x0'));var util=require(_0x568c('0x1'));var logger=require(_0x568c('0x2'))(_0x568c('0x3'));var moment=require(_0x568c('0x4'));var BPromise=require(_0x568c('0x5'));var rp=require(_0x568c('0x6'));var fs=require('fs');var path=require(_0x568c('0x7'));var rimraf=require(_0x568c('0x8'));var config=require(_0x568c('0x9'));var attributes=require('./intZohoConfiguration.attributes');module['exports']=function(_0x445371,_0x11fc14){return _0x445371['define'](_0x568c('0xa'),attributes,{'tableName':_0x568c('0xb'),'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 54a901b..d01b959 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 _0x1de8=['util','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash'];(function(_0x22ffbf,_0x16f31e){var _0x360c17=function(_0x40807f){while(--_0x40807f){_0x22ffbf['push'](_0x22ffbf['shift']());}};_0x360c17(++_0x16f31e);}(_0x1de8,0x1f3));var _0x81de=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0x1de8[_0x1a8f86];return _0x20d876;};'use strict';var _=require(_0x81de('0x0'));var util=require(_0x81de('0x1'));var moment=require('moment');var BPromise=require(_0x81de('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x81de('0x3'));var db=require(_0x81de('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x81de('0x5'));var config=require('../../config/environment');var jayson=require(_0x81de('0x6'));var client=jayson[_0x81de('0x7')][_0x81de('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x32346a,_0x1a35a2,_0x278b5d){return new BPromise(function(_0x25d4a3,_0x1a604f){return client['request'](_0x32346a,_0x278b5d)[_0x81de('0x9')](function(_0x3a020b){logger[_0x81de('0xa')](_0x81de('0xb'),_0x1a35a2,'request\x20sent');logger[_0x81de('0xc')](_0x81de('0xd'),_0x1a35a2,_0x81de('0xe'),JSON['stringify'](_0x3a020b));if(_0x3a020b[_0x81de('0xf')]){if(_0x3a020b[_0x81de('0xf')][_0x81de('0x10')]===0x1f4){logger[_0x81de('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x1a35a2,_0x3a020b[_0x81de('0xf')][_0x81de('0x11')]);return _0x1a604f(_0x3a020b[_0x81de('0xf')][_0x81de('0x11')]);}logger[_0x81de('0xf')](_0x81de('0xb'),_0x1a35a2,_0x3a020b[_0x81de('0xf')][_0x81de('0x11')]);return _0x25d4a3(_0x3a020b['error'][_0x81de('0x11')]);}else{logger[_0x81de('0xa')]('ZohoConfiguration,\x20%s,\x20%s',_0x1a35a2,_0x81de('0xe'));_0x25d4a3(_0x3a020b[_0x81de('0x12')][_0x81de('0x11')]);}})[_0x81de('0x13')](function(_0x28aa34){logger[_0x81de('0xf')](_0x81de('0xb'),_0x1a35a2,_0x28aa34);_0x1a604f(_0x28aa34);});});} \ No newline at end of file +var _0xccab=['ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x536fa5,_0x27e839){var _0x582b8d=function(_0x24f256){while(--_0x24f256){_0x536fa5['push'](_0x536fa5['shift']());}};_0x582b8d(++_0x27e839);}(_0xccab,0x13d));var _0xbcca=function(_0x1f36d3,_0x584a30){_0x1f36d3=_0x1f36d3-0x0;var _0x8030a8=_0xccab[_0x1f36d3];return _0x8030a8;};'use strict';var _=require(_0xbcca('0x0'));var util=require(_0xbcca('0x1'));var moment=require('moment');var BPromise=require(_0xbcca('0x2'));var rs=require(_0xbcca('0x3'));var fs=require('fs');var Redis=require(_0xbcca('0x4'));var db=require(_0xbcca('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbcca('0x6'))(_0xbcca('0x7'));var config=require('../../config/environment');var jayson=require(_0xbcca('0x8'));var client=jayson[_0xbcca('0x9')][_0xbcca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x482401,_0x1eaf2f,_0x1c862d){return new BPromise(function(_0x5f304e,_0x28c76c){return client[_0xbcca('0xb')](_0x482401,_0x1c862d)[_0xbcca('0xc')](function(_0x153efa){logger['info'](_0xbcca('0xd'),_0x1eaf2f,_0xbcca('0xe'));logger[_0xbcca('0xf')](_0xbcca('0x10'),_0x1eaf2f,'request\x20sent',JSON[_0xbcca('0x11')](_0x153efa));if(_0x153efa[_0xbcca('0x12')]){if(_0x153efa[_0xbcca('0x12')]['code']===0x1f4){logger[_0xbcca('0x12')](_0xbcca('0xd'),_0x1eaf2f,_0x153efa[_0xbcca('0x12')]['message']);return _0x28c76c(_0x153efa[_0xbcca('0x12')][_0xbcca('0x13')]);}logger[_0xbcca('0x12')](_0xbcca('0xd'),_0x1eaf2f,_0x153efa[_0xbcca('0x12')][_0xbcca('0x13')]);return _0x5f304e(_0x153efa[_0xbcca('0x12')][_0xbcca('0x13')]);}else{logger[_0xbcca('0x14')](_0xbcca('0xd'),_0x1eaf2f,_0xbcca('0xe'));_0x5f304e(_0x153efa[_0xbcca('0x15')]['message']);}})['catch'](function(_0x514797){logger[_0xbcca('0x12')](_0xbcca('0xd'),_0x1eaf2f,_0x514797);_0x28c76c(_0x514797);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 6df34db..be31631 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 _0x9183=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','/:id','post','create','put','update','delete','exports','multer','path','connect-timeout'];(function(_0x103d14,_0x12e1a7){var _0x4d8531=function(_0x102b59){while(--_0x102b59){_0x103d14['push'](_0x103d14['shift']());}};_0x4d8531(++_0x12e1a7);}(_0x9183,0x7b));var _0x3918=function(_0x2f373b,_0x4a6e33){_0x2f373b=_0x2f373b-0x0;var _0x4ffa27=_0x9183[_0x2f373b];return _0x4ffa27;};'use strict';var multer=require(_0x3918('0x0'));var util=require('util');var path=require(_0x3918('0x1'));var timeout=require(_0x3918('0x2'));var express=require('express');var router=express[_0x3918('0x3')]();var fs_extra=require(_0x3918('0x4'));var auth=require(_0x3918('0x5'));var interaction=require(_0x3918('0x6'));var config=require(_0x3918('0x7'));var controller=require(_0x3918('0x8'));router[_0x3918('0x9')]('/',auth[_0x3918('0xa')](),controller['index']);router[_0x3918('0x9')](_0x3918('0xb'),auth[_0x3918('0xa')](),controller['show']);router[_0x3918('0xc')]('/',auth[_0x3918('0xa')](),controller[_0x3918('0xd')]);router[_0x3918('0xe')](_0x3918('0xb'),auth['isAuthenticated'](),controller[_0x3918('0xf')]);router[_0x3918('0x10')](_0x3918('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x3918('0x11')]=router; \ No newline at end of file +var _0xfc36=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','index','/:id','show','isAuthenticated','create','put','delete','destroy','util','path'];(function(_0x320272,_0x28d387){var _0xb204e9=function(_0x169e74){while(--_0x169e74){_0x320272['push'](_0x320272['shift']());}};_0xb204e9(++_0x28d387);}(_0xfc36,0x130));var _0x6fc3=function(_0x117a07,_0x4ff9d7){_0x117a07=_0x117a07-0x0;var _0x161d7c=_0xfc36[_0x117a07];return _0x161d7c;};'use strict';var multer=require('multer');var util=require(_0x6fc3('0x0'));var path=require(_0x6fc3('0x1'));var timeout=require('connect-timeout');var express=require(_0x6fc3('0x2'));var router=express[_0x6fc3('0x3')]();var fs_extra=require(_0x6fc3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6fc3('0x5'));var config=require(_0x6fc3('0x6'));var controller=require(_0x6fc3('0x7'));router[_0x6fc3('0x8')]('/',auth['isAuthenticated'](),controller[_0x6fc3('0x9')]);router[_0x6fc3('0x8')](_0x6fc3('0xa'),auth['isAuthenticated'](),controller[_0x6fc3('0xb')]);router['post']('/',auth[_0x6fc3('0xc')](),controller[_0x6fc3('0xd')]);router[_0x6fc3('0xe')](_0x6fc3('0xa'),auth[_0x6fc3('0xc')](),controller['update']);router[_0x6fc3('0xf')]('/:id',auth[_0x6fc3('0xc')](),controller[_0x6fc3('0x10')]);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 85b4536..a70033e 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 _0xddc4=['picklist','string','STRING','variable','BOOLEAN','sequelize','exports','ENUM','customVariable','keyValue'];(function(_0x37f789,_0x5d88e0){var _0x31c19f=function(_0x690e36){while(--_0x690e36){_0x37f789['push'](_0x37f789['shift']());}};_0x31c19f(++_0x5d88e0);}(_0xddc4,0x1db));var _0x4ddc=function(_0x3e0ae5,_0x19f4f6){_0x3e0ae5=_0x3e0ae5-0x0;var _0x3bc9c6=_0xddc4[_0x3e0ae5];return _0x3bc9c6;};'use strict';var Sequelize=require(_0x4ddc('0x0'));module[_0x4ddc('0x1')]={'type':{'type':Sequelize[_0x4ddc('0x2')]('string','variable',_0x4ddc('0x3'),_0x4ddc('0x4'),_0x4ddc('0x5')),'defaultValue':_0x4ddc('0x6')},'content':{'type':Sequelize[_0x4ddc('0x7')]},'key':{'type':Sequelize[_0x4ddc('0x7')]},'keyType':{'type':Sequelize[_0x4ddc('0x2')](_0x4ddc('0x6'),_0x4ddc('0x8'),_0x4ddc('0x3'))},'keyContent':{'type':Sequelize[_0x4ddc('0x7')]},'idField':{'type':Sequelize[_0x4ddc('0x7')]},'nameField':{'type':Sequelize[_0x4ddc('0x7')]},'customField':{'type':Sequelize[_0x4ddc('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4ddc('0x7')]}}; \ No newline at end of file +var _0x29c0=['picklist','string','STRING','ENUM','sequelize','variable','customVariable'];(function(_0x5632bf,_0x4f5c8d){var _0x41e9dd=function(_0x52344b){while(--_0x52344b){_0x5632bf['push'](_0x5632bf['shift']());}};_0x41e9dd(++_0x4f5c8d);}(_0x29c0,0x1e0));var _0x029c=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x29c0[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require(_0x029c('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x029c('0x1'),_0x029c('0x2'),'keyValue',_0x029c('0x3')),'defaultValue':_0x029c('0x4')},'content':{'type':Sequelize[_0x029c('0x5')]},'key':{'type':Sequelize[_0x029c('0x5')]},'keyType':{'type':Sequelize[_0x029c('0x6')](_0x029c('0x4'),_0x029c('0x1'),_0x029c('0x2'))},'keyContent':{'type':Sequelize[_0x029c('0x5')]},'idField':{'type':Sequelize[_0x029c('0x5')]},'nameField':{'type':Sequelize[_0x029c('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x029c('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 73938d0..7e43de5 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 _0x1d95=['intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','type','VIRTUAL','merge','options','ZohoField','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters'];(function(_0xb247e3,_0x1319d1){var _0x57fb7b=function(_0x23d2bb){while(--_0x23d2bb){_0xb247e3['push'](_0xb247e3['shift']());}};_0x57fb7b(++_0x1319d1);}(_0x1d95,0x19b));var _0x51d9=function(_0x6c6f2,_0x23a16b){_0x6c6f2=_0x6c6f2-0x0;var _0x230710=_0x1d95[_0x6c6f2];return _0x230710;};'use strict';var emlformat=require(_0x51d9('0x0'));var rimraf=require(_0x51d9('0x1'));var zipdir=require(_0x51d9('0x2'));var jsonpatch=require(_0x51d9('0x3'));var rp=require(_0x51d9('0x4'));var moment=require(_0x51d9('0x5'));var BPromise=require(_0x51d9('0x6'));var Mustache=require(_0x51d9('0x7'));var util=require('util');var path=require(_0x51d9('0x8'));var sox=require(_0x51d9('0x9'));var csv=require(_0x51d9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x51d9('0xb'));var squel=require(_0x51d9('0xc'));var crypto=require(_0x51d9('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x51d9('0xa'));var querystring=require(_0x51d9('0xe'));var Papa=require(_0x51d9('0xf'));var Redis=require(_0x51d9('0x10'));var authService=require(_0x51d9('0x11'));var qs=require(_0x51d9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x51d9('0x13'));var logger=require(_0x51d9('0x14'))('api');var utils=require(_0x51d9('0x15'));var config=require(_0x51d9('0x16'));var licenseUtil=require(_0x51d9('0x17'));var db=require(_0x51d9('0x18'))['db'];function respondWithStatusCode(_0x164393,_0x1f7b3d){_0x1f7b3d=_0x1f7b3d||0xcc;return function(_0x5ca20c){if(_0x5ca20c){return _0x164393[_0x51d9('0x19')](_0x1f7b3d);}return _0x164393[_0x51d9('0x1a')](_0x1f7b3d)[_0x51d9('0x1b')]();};}function respondWithResult(_0xe4dde7,_0x455798){_0x455798=_0x455798||0xc8;return function(_0x3d6401){if(_0x3d6401){return _0xe4dde7[_0x51d9('0x1a')](_0x455798)[_0x51d9('0x1c')](_0x3d6401);}};}function respondWithFilteredResult(_0x17e4a2,_0x2b5a0e){return function(_0x21148d){if(_0x21148d){var _0x4141b3=typeof _0x2b5a0e[_0x51d9('0x1d')]===_0x51d9('0x1e')&&typeof _0x2b5a0e[_0x51d9('0x1f')]===_0x51d9('0x1e');var _0x44d438=_0x21148d[_0x51d9('0x20')];var _0x275761=_0x4141b3?0x0:_0x2b5a0e[_0x51d9('0x1d')];var _0x541086=_0x4141b3?_0x21148d[_0x51d9('0x20')]:_0x2b5a0e[_0x51d9('0x1d')]+_0x2b5a0e[_0x51d9('0x1f')];var _0x49daa9;if(_0x541086>=_0x44d438){_0x541086=_0x44d438;_0x49daa9=0xc8;}else{_0x49daa9=0xce;}_0x17e4a2[_0x51d9('0x1a')](_0x49daa9);return _0x17e4a2[_0x51d9('0x21')](_0x51d9('0x22'),_0x275761+'-'+_0x541086+'/'+_0x44d438)['json'](_0x21148d);}return null;};}function patchUpdates(_0x260564){return function(_0x389522){try{jsonpatch[_0x51d9('0x23')](_0x389522,_0x260564,!![]);}catch(_0x2c96a2){return BPromise['reject'](_0x2c96a2);}return _0x389522[_0x51d9('0x24')]();};}function saveUpdates(_0x392795,_0x4db77f){return function(_0x4c2166){if(_0x4c2166){return _0x4c2166[_0x51d9('0x25')](_0x392795)['then'](function(_0x70620a){return _0x70620a;});}return null;};}function removeEntity(_0x1e782b,_0x613db5){return function(_0x42ce10){if(_0x42ce10){return _0x42ce10['destroy']()[_0x51d9('0x26')](function(){_0x1e782b[_0x51d9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39f90c,_0xf19c6d){return function(_0x324cae){if(!_0x324cae){_0x39f90c[_0x51d9('0x19')](0x194);}return _0x324cae;};}function handleError(_0xec79e,_0x2a1f94){_0x2a1f94=_0x2a1f94||0x1f4;return function(_0x318b92){logger[_0x51d9('0x27')](_0x318b92[_0x51d9('0x28')]);if(_0x318b92[_0x51d9('0x29')]){delete _0x318b92[_0x51d9('0x29')];}_0xec79e[_0x51d9('0x1a')](_0x2a1f94)[_0x51d9('0x2a')](_0x318b92);};}exports[_0x51d9('0x2b')]=function(_0x446a67,_0x22a93c){var _0x4a59c7={},_0x1e15bb={},_0x54df36={'count':0x0,'rows':[]};var _0x19d980=_[_0x51d9('0x2c')](db['ZohoField'][_0x51d9('0x2d')],function(_0x2345a3){return{'name':_0x2345a3[_0x51d9('0x2e')],'type':_0x2345a3['type'][_0x51d9('0x2f')]};});_0x1e15bb['model']=_['map'](_0x19d980,_0x51d9('0x29'));_0x1e15bb[_0x51d9('0x30')]=_[_0x51d9('0x31')](_0x446a67[_0x51d9('0x30')]);_0x1e15bb[_0x51d9('0x32')]=_[_0x51d9('0x33')](_0x1e15bb[_0x51d9('0x34')],_0x1e15bb['query']);_0x4a59c7[_0x51d9('0x35')]=_[_0x51d9('0x33')](_0x1e15bb['model'],qs[_0x51d9('0x36')](_0x446a67[_0x51d9('0x30')]['fields']));_0x4a59c7[_0x51d9('0x35')]=_0x4a59c7[_0x51d9('0x35')]['length']?_0x4a59c7[_0x51d9('0x35')]:_0x1e15bb[_0x51d9('0x34')];if(!_0x446a67['query'][_0x51d9('0x37')](_0x51d9('0x38'))){_0x4a59c7[_0x51d9('0x1f')]=qs[_0x51d9('0x1f')](_0x446a67[_0x51d9('0x30')]['limit']);_0x4a59c7[_0x51d9('0x1d')]=qs[_0x51d9('0x1d')](_0x446a67[_0x51d9('0x30')][_0x51d9('0x1d')]);}_0x4a59c7[_0x51d9('0x39')]=qs[_0x51d9('0x3a')](_0x446a67['query'][_0x51d9('0x3a')]);_0x4a59c7['where']=qs['filters'](_[_0x51d9('0x3b')](_0x446a67['query'],_0x1e15bb[_0x51d9('0x32')]),_0x19d980);if(_0x446a67['query'][_0x51d9('0x3c')]){_0x4a59c7['where']=_['merge'](_0x4a59c7['where'],{'$or':_[_0x51d9('0x2c')](_0x19d980,function(_0x4f7f91){if(_0x4f7f91[_0x51d9('0x3d')]!==_0x51d9('0x3e')){var _0x324f70={};_0x324f70[_0x4f7f91[_0x51d9('0x29')]]={'$like':'%'+_0x446a67[_0x51d9('0x30')][_0x51d9('0x3c')]+'%'};return _0x324f70;}})});}_0x4a59c7=_[_0x51d9('0x3f')]({},_0x4a59c7,_0x446a67[_0x51d9('0x40')]);var _0xe7e7dd={'where':_0x4a59c7['where']};return db[_0x51d9('0x41')][_0x51d9('0x20')](_0xe7e7dd)[_0x51d9('0x26')](function(_0x50d82a){_0x54df36[_0x51d9('0x20')]=_0x50d82a;if(_0x446a67[_0x51d9('0x30')]['includeAll']){_0x4a59c7[_0x51d9('0x42')]=[{'all':!![]}];}return db[_0x51d9('0x41')][_0x51d9('0x43')](_0x4a59c7);})['then'](function(_0x4b1d62){_0x54df36[_0x51d9('0x44')]=_0x4b1d62;return _0x54df36;})[_0x51d9('0x26')](respondWithFilteredResult(_0x22a93c,_0x4a59c7))[_0x51d9('0x45')](handleError(_0x22a93c,null));};exports[_0x51d9('0x46')]=function(_0x23ff5b,_0x143753){var _0x25e06d={'raw':!![],'where':{'id':_0x23ff5b[_0x51d9('0x47')]['id']}},_0x58ff07={};_0x58ff07[_0x51d9('0x34')]=_[_0x51d9('0x31')](db[_0x51d9('0x41')][_0x51d9('0x2d')]);_0x58ff07[_0x51d9('0x30')]=_[_0x51d9('0x31')](_0x23ff5b[_0x51d9('0x30')]);_0x58ff07[_0x51d9('0x32')]=_[_0x51d9('0x33')](_0x58ff07[_0x51d9('0x34')],_0x58ff07['query']);_0x25e06d['attributes']=_['intersection'](_0x58ff07['model'],qs[_0x51d9('0x36')](_0x23ff5b[_0x51d9('0x30')]['fields']));_0x25e06d[_0x51d9('0x35')]=_0x25e06d[_0x51d9('0x35')]['length']?_0x25e06d[_0x51d9('0x35')]:_0x58ff07[_0x51d9('0x34')];if(_0x23ff5b[_0x51d9('0x30')][_0x51d9('0x48')]){_0x25e06d[_0x51d9('0x42')]=[{'all':!![]}];}_0x25e06d=_[_0x51d9('0x3f')]({},_0x25e06d,_0x23ff5b[_0x51d9('0x40')]);return db[_0x51d9('0x41')][_0x51d9('0x49')](_0x25e06d)[_0x51d9('0x26')](handleEntityNotFound(_0x143753,null))['then'](respondWithResult(_0x143753,null))[_0x51d9('0x45')](handleError(_0x143753,null));};exports[_0x51d9('0x4a')]=function(_0x31a894,_0x1a7bac){return db[_0x51d9('0x41')][_0x51d9('0x4a')](_0x31a894[_0x51d9('0x4b')],{})[_0x51d9('0x26')](respondWithResult(_0x1a7bac,0xc9))[_0x51d9('0x45')](handleError(_0x1a7bac,null));};exports[_0x51d9('0x25')]=function(_0x550d9d,_0x122b7d){if(_0x550d9d[_0x51d9('0x4b')]['id']){delete _0x550d9d['body']['id'];}return db[_0x51d9('0x41')][_0x51d9('0x49')]({'where':{'id':_0x550d9d[_0x51d9('0x47')]['id']}})['then'](handleEntityNotFound(_0x122b7d,null))[_0x51d9('0x26')](saveUpdates(_0x550d9d[_0x51d9('0x4b')],null))[_0x51d9('0x26')](respondWithResult(_0x122b7d,null))[_0x51d9('0x45')](handleError(_0x122b7d,null));};exports[_0x51d9('0x4c')]=function(_0x555198,_0x32cef1){return db[_0x51d9('0x41')][_0x51d9('0x49')]({'where':{'id':_0x555198['params']['id']}})[_0x51d9('0x26')](handleEntityNotFound(_0x32cef1,null))[_0x51d9('0x26')](removeEntity(_0x32cef1,null))[_0x51d9('0x45')](handleError(_0x32cef1,null));}; \ No newline at end of file +var _0x20cc=['pick','filter','merge','map','VIRTUAL','ZohoField','includeAll','findAll','catch','show','params','fields','include','options','find','create','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','end','error','stack','name','index','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x5c9317,_0x38bba4){var _0x50ccb4=function(_0x467423){while(--_0x467423){_0x5c9317['push'](_0x5c9317['shift']());}};_0x50ccb4(++_0x38bba4);}(_0x20cc,0x196));var _0xc20c=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x20cc[_0x2b7764];return _0x848dcb;};'use strict';var emlformat=require(_0xc20c('0x0'));var rimraf=require(_0xc20c('0x1'));var zipdir=require(_0xc20c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc20c('0x3'));var moment=require(_0xc20c('0x4'));var BPromise=require(_0xc20c('0x5'));var Mustache=require(_0xc20c('0x6'));var util=require(_0xc20c('0x7'));var path=require(_0xc20c('0x8'));var sox=require(_0xc20c('0x9'));var csv=require(_0xc20c('0xa'));var ejs=require(_0xc20c('0xb'));var fs=require('fs');var fs_extra=require(_0xc20c('0xc'));var _=require(_0xc20c('0xd'));var squel=require(_0xc20c('0xe'));var crypto=require('crypto');var jsforce=require(_0xc20c('0xf'));var deskjs=require(_0xc20c('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc20c('0x11'));var Papa=require(_0xc20c('0x12'));var Redis=require('ioredis');var authService=require(_0xc20c('0x13'));var qs=require(_0xc20c('0x14'));var as=require(_0xc20c('0x15'));var hardwareService=require(_0xc20c('0x16'));var logger=require(_0xc20c('0x17'))('api');var utils=require(_0xc20c('0x18'));var config=require(_0xc20c('0x19'));var licenseUtil=require(_0xc20c('0x1a'));var db=require(_0xc20c('0x1b'))['db'];function respondWithStatusCode(_0xde552,_0x474fe5){_0x474fe5=_0x474fe5||0xcc;return function(_0xb7b6d6){if(_0xb7b6d6){return _0xde552[_0xc20c('0x1c')](_0x474fe5);}return _0xde552[_0xc20c('0x1d')](_0x474fe5)['end']();};}function respondWithResult(_0x155c0b,_0x57b37c){_0x57b37c=_0x57b37c||0xc8;return function(_0x25c8c5){if(_0x25c8c5){return _0x155c0b[_0xc20c('0x1d')](_0x57b37c)[_0xc20c('0x1e')](_0x25c8c5);}};}function respondWithFilteredResult(_0x74ceee,_0xc41e74){return function(_0x1649c2){if(_0x1649c2){var _0x325dd0=typeof _0xc41e74[_0xc20c('0x1f')]===_0xc20c('0x20')&&typeof _0xc41e74[_0xc20c('0x21')]==='undefined';var _0x3d7a41=_0x1649c2[_0xc20c('0x22')];var _0x4893a9=_0x325dd0?0x0:_0xc41e74[_0xc20c('0x1f')];var _0x31e740=_0x325dd0?_0x1649c2['count']:_0xc41e74['offset']+_0xc41e74[_0xc20c('0x21')];var _0x4aa423;if(_0x31e740>=_0x3d7a41){_0x31e740=_0x3d7a41;_0x4aa423=0xc8;}else{_0x4aa423=0xce;}_0x74ceee['status'](_0x4aa423);return _0x74ceee[_0xc20c('0x23')]('Content-Range',_0x4893a9+'-'+_0x31e740+'/'+_0x3d7a41)[_0xc20c('0x1e')](_0x1649c2);}return null;};}function patchUpdates(_0x450394){return function(_0x243a59){try{jsonpatch['apply'](_0x243a59,_0x450394,!![]);}catch(_0x277718){return BPromise[_0xc20c('0x24')](_0x277718);}return _0x243a59[_0xc20c('0x25')]();};}function saveUpdates(_0x4021fc,_0x19f685){return function(_0x4ec035){if(_0x4ec035){return _0x4ec035[_0xc20c('0x26')](_0x4021fc)[_0xc20c('0x27')](function(_0x2e0506){return _0x2e0506;});}return null;};}function removeEntity(_0x140adf,_0x4f46bb){return function(_0x6a9e5b){if(_0x6a9e5b){return _0x6a9e5b[_0xc20c('0x28')]()[_0xc20c('0x27')](function(){_0x140adf['status'](0xcc)[_0xc20c('0x29')]();});}};}function handleEntityNotFound(_0x145b68,_0x55c66a){return function(_0x39386e){if(!_0x39386e){_0x145b68['sendStatus'](0x194);}return _0x39386e;};}function handleError(_0x29bd16,_0xa55d11){_0xa55d11=_0xa55d11||0x1f4;return function(_0x22f124){logger[_0xc20c('0x2a')](_0x22f124[_0xc20c('0x2b')]);if(_0x22f124[_0xc20c('0x2c')]){delete _0x22f124['name'];}_0x29bd16[_0xc20c('0x1d')](_0xa55d11)['send'](_0x22f124);};}exports[_0xc20c('0x2d')]=function(_0x4b3943,_0x2b35ca){var _0x30a50b={},_0xac2aea={},_0x2c7a01={'count':0x0,'rows':[]};var _0x14951e=_['map'](db['ZohoField'][_0xc20c('0x2e')],function(_0x4e3045){return{'name':_0x4e3045[_0xc20c('0x2f')],'type':_0x4e3045[_0xc20c('0x30')][_0xc20c('0x31')]};});_0xac2aea[_0xc20c('0x32')]=_['map'](_0x14951e,'name');_0xac2aea['query']=_[_0xc20c('0x33')](_0x4b3943[_0xc20c('0x34')]);_0xac2aea['filters']=_[_0xc20c('0x35')](_0xac2aea[_0xc20c('0x32')],_0xac2aea['query']);_0x30a50b[_0xc20c('0x36')]=_[_0xc20c('0x35')](_0xac2aea['model'],qs['fields'](_0x4b3943['query']['fields']));_0x30a50b[_0xc20c('0x36')]=_0x30a50b[_0xc20c('0x36')][_0xc20c('0x37')]?_0x30a50b[_0xc20c('0x36')]:_0xac2aea[_0xc20c('0x32')];if(!_0x4b3943['query'][_0xc20c('0x38')](_0xc20c('0x39'))){_0x30a50b['limit']=qs[_0xc20c('0x21')](_0x4b3943['query']['limit']);_0x30a50b[_0xc20c('0x1f')]=qs[_0xc20c('0x1f')](_0x4b3943[_0xc20c('0x34')][_0xc20c('0x1f')]);}_0x30a50b[_0xc20c('0x3a')]=qs['sort'](_0x4b3943[_0xc20c('0x34')][_0xc20c('0x3b')]);_0x30a50b[_0xc20c('0x3c')]=qs[_0xc20c('0x3d')](_[_0xc20c('0x3e')](_0x4b3943[_0xc20c('0x34')],_0xac2aea[_0xc20c('0x3d')]),_0x14951e);if(_0x4b3943[_0xc20c('0x34')][_0xc20c('0x3f')]){_0x30a50b[_0xc20c('0x3c')]=_[_0xc20c('0x40')](_0x30a50b['where'],{'$or':_[_0xc20c('0x41')](_0x14951e,function(_0x140e89){if(_0x140e89[_0xc20c('0x30')]!==_0xc20c('0x42')){var _0x9225cb={};_0x9225cb[_0x140e89[_0xc20c('0x2c')]]={'$like':'%'+_0x4b3943['query'][_0xc20c('0x3f')]+'%'};return _0x9225cb;}})});}_0x30a50b=_[_0xc20c('0x40')]({},_0x30a50b,_0x4b3943['options']);var _0x1c2612={'where':_0x30a50b[_0xc20c('0x3c')]};return db[_0xc20c('0x43')][_0xc20c('0x22')](_0x1c2612)[_0xc20c('0x27')](function(_0x410d74){_0x2c7a01[_0xc20c('0x22')]=_0x410d74;if(_0x4b3943[_0xc20c('0x34')][_0xc20c('0x44')]){_0x30a50b['include']=[{'all':!![]}];}return db[_0xc20c('0x43')][_0xc20c('0x45')](_0x30a50b);})['then'](function(_0x498ece){_0x2c7a01['rows']=_0x498ece;return _0x2c7a01;})[_0xc20c('0x27')](respondWithFilteredResult(_0x2b35ca,_0x30a50b))[_0xc20c('0x46')](handleError(_0x2b35ca,null));};exports[_0xc20c('0x47')]=function(_0x29cf08,_0x5dac84){var _0x139d72={'raw':!![],'where':{'id':_0x29cf08[_0xc20c('0x48')]['id']}},_0xff3839={};_0xff3839[_0xc20c('0x32')]=_[_0xc20c('0x33')](db[_0xc20c('0x43')]['rawAttributes']);_0xff3839[_0xc20c('0x34')]=_['keys'](_0x29cf08[_0xc20c('0x34')]);_0xff3839['filters']=_[_0xc20c('0x35')](_0xff3839['model'],_0xff3839[_0xc20c('0x34')]);_0x139d72['attributes']=_[_0xc20c('0x35')](_0xff3839['model'],qs[_0xc20c('0x49')](_0x29cf08[_0xc20c('0x34')][_0xc20c('0x49')]));_0x139d72[_0xc20c('0x36')]=_0x139d72[_0xc20c('0x36')][_0xc20c('0x37')]?_0x139d72[_0xc20c('0x36')]:_0xff3839['model'];if(_0x29cf08['query'][_0xc20c('0x44')]){_0x139d72[_0xc20c('0x4a')]=[{'all':!![]}];}_0x139d72=_[_0xc20c('0x40')]({},_0x139d72,_0x29cf08[_0xc20c('0x4b')]);return db[_0xc20c('0x43')][_0xc20c('0x4c')](_0x139d72)['then'](handleEntityNotFound(_0x5dac84,null))[_0xc20c('0x27')](respondWithResult(_0x5dac84,null))[_0xc20c('0x46')](handleError(_0x5dac84,null));};exports[_0xc20c('0x4d')]=function(_0x468381,_0x5ee635){return db[_0xc20c('0x43')][_0xc20c('0x4d')](_0x468381['body'],{})[_0xc20c('0x27')](respondWithResult(_0x5ee635,0xc9))[_0xc20c('0x46')](handleError(_0x5ee635,null));};exports[_0xc20c('0x26')]=function(_0x35df8f,_0x24ece1){if(_0x35df8f['body']['id']){delete _0x35df8f['body']['id'];}return db['ZohoField']['find']({'where':{'id':_0x35df8f[_0xc20c('0x48')]['id']}})[_0xc20c('0x27')](handleEntityNotFound(_0x24ece1,null))[_0xc20c('0x27')](saveUpdates(_0x35df8f['body'],null))[_0xc20c('0x27')](respondWithResult(_0x24ece1,null))[_0xc20c('0x46')](handleError(_0x24ece1,null));};exports[_0xc20c('0x28')]=function(_0x157380,_0x511ffa){return db[_0xc20c('0x43')]['find']({'where':{'id':_0x157380['params']['id']}})[_0xc20c('0x27')](handleEntityNotFound(_0x511ffa,null))[_0xc20c('0x27')](removeEntity(_0x511ffa,null))['catch'](handleError(_0x511ffa,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index f7d871b..8aad836 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 _0xcaf2=['rimraf','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x562f90,_0x48e40a){var _0x410445=function(_0x407f6e){while(--_0x407f6e){_0x562f90['push'](_0x562f90['shift']());}};_0x410445(++_0x48e40a);}(_0xcaf2,0x8a));var _0x2caf=function(_0x4ca6ab,_0x29bc6c){_0x4ca6ab=_0x4ca6ab-0x0;var _0x516678=_0xcaf2[_0x4ca6ab];return _0x516678;};'use strict';var _=require(_0x2caf('0x0'));var util=require('util');var logger=require(_0x2caf('0x1'))(_0x2caf('0x2'));var moment=require('moment');var BPromise=require(_0x2caf('0x3'));var rp=require(_0x2caf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2caf('0x5'));var config=require('../../config/environment');var attributes=require(_0x2caf('0x6'));module[_0x2caf('0x7')]=function(_0x249a4b,_0x599ce7){return _0x249a4b[_0x2caf('0x8')](_0x2caf('0x9'),attributes,{'tableName':_0x2caf('0xa'),'paranoid':![],'indexes':[{'name':_0x2caf('0xb'),'fields':['idField',_0x2caf('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5496=['moment','request-promise','rimraf','../../config/environment','./intZohoField.attributes','define','int_zoho_fields','zoho_unique_index','idField','lodash','util','../../config/logger','api'];(function(_0x2dc5b7,_0x3837ba){var _0x4edb5b=function(_0x3ed644){while(--_0x3ed644){_0x2dc5b7['push'](_0x2dc5b7['shift']());}};_0x4edb5b(++_0x3837ba);}(_0x5496,0x175));var _0x6549=function(_0x38f03d,_0x45acf7){_0x38f03d=_0x38f03d-0x0;var _0x33e2e6=_0x5496[_0x38f03d];return _0x33e2e6;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var logger=require(_0x6549('0x2'))(_0x6549('0x3'));var moment=require(_0x6549('0x4'));var BPromise=require('bluebird');var rp=require(_0x6549('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var attributes=require(_0x6549('0x8'));module['exports']=function(_0x5a4658,_0x43cb17){return _0x5a4658[_0x6549('0x9')]('ZohoField',attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[{'name':_0x6549('0xb'),'fields':[_0x6549('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 0f44940..59afb51 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 _0x2a6c=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x35561d,_0x59a5cf){var _0x2ccc5b=function(_0x6d37d2){while(--_0x6d37d2){_0x35561d['push'](_0x35561d['shift']());}};_0x2ccc5b(++_0x59a5cf);}(_0x2a6c,0x1f4));var _0xc2a6=function(_0xb67f82,_0x4836cf){_0xb67f82=_0xb67f82-0x0;var _0x394089=_0x2a6c[_0xb67f82];return _0x394089;};'use strict';var _=require(_0xc2a6('0x0'));var util=require(_0xc2a6('0x1'));var moment=require(_0xc2a6('0x2'));var BPromise=require(_0xc2a6('0x3'));var rs=require(_0xc2a6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc2a6('0x5'))['db'];var utils=require(_0xc2a6('0x6'));var logger=require(_0xc2a6('0x7'))('rpc');var config=require(_0xc2a6('0x8'));var jayson=require(_0xc2a6('0x9'));var client=jayson[_0xc2a6('0xa')][_0xc2a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x280dcd,_0x5b972d,_0x530e7b){return new BPromise(function(_0xb48960,_0x474bd8){return client[_0xc2a6('0xc')](_0x280dcd,_0x530e7b)['then'](function(_0x4918c6){logger[_0xc2a6('0xd')](_0xc2a6('0xe'),_0x5b972d,_0xc2a6('0xf'));logger[_0xc2a6('0x10')](_0xc2a6('0x11'),_0x5b972d,_0xc2a6('0xf'),JSON[_0xc2a6('0x12')](_0x4918c6));if(_0x4918c6[_0xc2a6('0x13')]){if(_0x4918c6[_0xc2a6('0x13')][_0xc2a6('0x14')]===0x1f4){logger['error'](_0xc2a6('0xe'),_0x5b972d,_0x4918c6[_0xc2a6('0x13')][_0xc2a6('0x15')]);return _0x474bd8(_0x4918c6[_0xc2a6('0x13')][_0xc2a6('0x15')]);}logger[_0xc2a6('0x13')]('ZohoField,\x20%s,\x20%s',_0x5b972d,_0x4918c6[_0xc2a6('0x13')][_0xc2a6('0x15')]);return _0xb48960(_0x4918c6[_0xc2a6('0x13')][_0xc2a6('0x15')]);}else{logger[_0xc2a6('0xd')](_0xc2a6('0xe'),_0x5b972d,'request\x20sent');_0xb48960(_0x4918c6[_0xc2a6('0x16')][_0xc2a6('0x15')]);}})[_0xc2a6('0x17')](function(_0x438909){logger['error'](_0xc2a6('0xe'),_0x5b972d,_0x438909);_0x474bd8(_0x438909);});});} \ No newline at end of file +var _0x8027=['result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x24ebd0,_0x5a83f8){var _0x333eea=function(_0x4c2398){while(--_0x4c2398){_0x24ebd0['push'](_0x24ebd0['shift']());}};_0x333eea(++_0x5a83f8);}(_0x8027,0x1e5));var _0x7802=function(_0x3b0598,_0x15100f){_0x3b0598=_0x3b0598-0x0;var _0x5e2198=_0x8027[_0x3b0598];return _0x5e2198;};'use strict';var _=require(_0x7802('0x0'));var util=require('util');var moment=require(_0x7802('0x1'));var BPromise=require('bluebird');var rs=require(_0x7802('0x2'));var fs=require('fs');var Redis=require(_0x7802('0x3'));var db=require(_0x7802('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7802('0x5'))(_0x7802('0x6'));var config=require(_0x7802('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7802('0x8')][_0x7802('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2459de,_0x9c6d69,_0x43a411){return new BPromise(function(_0x415d1a,_0x62c603){return client['request'](_0x2459de,_0x43a411)[_0x7802('0xa')](function(_0x1b7592){logger[_0x7802('0xb')](_0x7802('0xc'),_0x9c6d69,_0x7802('0xd'));logger[_0x7802('0xe')](_0x7802('0xf'),_0x9c6d69,_0x7802('0xd'),JSON['stringify'](_0x1b7592));if(_0x1b7592[_0x7802('0x10')]){if(_0x1b7592[_0x7802('0x10')][_0x7802('0x11')]===0x1f4){logger[_0x7802('0x10')](_0x7802('0xc'),_0x9c6d69,_0x1b7592[_0x7802('0x10')]['message']);return _0x62c603(_0x1b7592[_0x7802('0x10')]['message']);}logger['error'](_0x7802('0xc'),_0x9c6d69,_0x1b7592[_0x7802('0x10')][_0x7802('0x12')]);return _0x415d1a(_0x1b7592[_0x7802('0x10')]['message']);}else{logger['info']('ZohoField,\x20%s,\x20%s',_0x9c6d69,_0x7802('0xd'));_0x415d1a(_0x1b7592[_0x7802('0x13')][_0x7802('0x12')]);}})[_0x7802('0x14')](function(_0x3903a6){logger[_0x7802('0x10')](_0x7802('0xc'),_0x9c6d69,_0x3903a6);_0x62c603(_0x3903a6);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 5e49081..545a10e 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x552ef3,_0x48a862){var _0x55d051=function(_0x496474){while(--_0x496474){_0x552ef3['push'](_0x552ef3['shift']());}};_0x55d051(++_0x48a862);}(_0x70e0,0x17b));var _0x070e=function(_0x51ea45,_0x994a21){_0x51ea45=_0x51ea45-0x0;var _0x218fe5=_0x70e0[_0x51ea45];return _0x218fe5;};'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(_0x583826,_0x1d353d){var _0x5b3c41=function(_0x24ff05){while(--_0x24ff05){_0x583826['push'](_0x583826['shift']());}};_0x5b3c41(++_0x1d353d);}(_0xedd9,0xfc));var _0x9edd=function(_0x457a50,_0x241546){_0x457a50=_0x457a50-0x0;var _0x399553=_0xedd9[_0x457a50];return _0x399553;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index ebc5866..dab17b8 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 _0x92e8=['app.js','INTEGER','state','sequelize','exports','STRING','unique_name_and_version'];(function(_0x34db85,_0x47e090){var _0x445496=function(_0x86fba6){while(--_0x86fba6){_0x34db85['push'](_0x34db85['shift']());}};_0x445496(++_0x47e090);}(_0x92e8,0x81));var _0x892e=function(_0x18daeb,_0x1b8ff3){_0x18daeb=_0x18daeb-0x0;var _0x425a30=_0x92e8[_0x18daeb];return _0x425a30;};'use strict';var Sequelize=require(_0x892e('0x0'));module[_0x892e('0x1')]={'name':{'type':Sequelize[_0x892e('0x2')],'allowNull':![],'unique':_0x892e('0x3')},'version':{'type':Sequelize[_0x892e('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x892e('0x2')],'defaultValue':_0x892e('0x4')},'filename':{'type':Sequelize[_0x892e('0x2')]},'path':{'type':Sequelize[_0x892e('0x2')]},'type':{'type':Sequelize[_0x892e('0x2')]},'size':{'type':Sequelize[_0x892e('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x892e('0x2')]},'logo':{'type':Sequelize[_0x892e('0x2')]},'state':{'type':Sequelize[_0x892e('0x2')],'unique':_0x892e('0x6')},'description':{'type':Sequelize[_0x892e('0x2')]},'title':{'type':Sequelize[_0x892e('0x2')]},'remoteUri':{'type':Sequelize[_0x892e('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0xd909=['state','exports','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN'];(function(_0x546c92,_0x165c9f){var _0x55ca41=function(_0x23f5b5){while(--_0x23f5b5){_0x546c92['push'](_0x546c92['shift']());}};_0x55ca41(++_0x165c9f);}(_0xd909,0x1c1));var _0x9d90=function(_0x1e39e7,_0x2021d7){_0x1e39e7=_0x1e39e7-0x0;var _0x53153d=_0xd909[_0x1e39e7];return _0x53153d;};'use strict';var Sequelize=require('sequelize');module[_0x9d90('0x0')]={'name':{'type':Sequelize[_0x9d90('0x1')],'allowNull':![],'unique':_0x9d90('0x2')},'version':{'type':Sequelize[_0x9d90('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x9d90('0x1')],'defaultValue':_0x9d90('0x3')},'filename':{'type':Sequelize[_0x9d90('0x1')]},'path':{'type':Sequelize[_0x9d90('0x1')]},'type':{'type':Sequelize[_0x9d90('0x1')]},'size':{'type':Sequelize[_0x9d90('0x4')]},'active':{'type':Sequelize[_0x9d90('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x9d90('0x1')]},'state':{'type':Sequelize[_0x9d90('0x1')],'unique':_0x9d90('0x6')},'description':{'type':Sequelize[_0x9d90('0x1')]},'title':{'type':Sequelize[_0x9d90('0x1')]},'remoteUri':{'type':Sequelize[_0x9d90('0x1')]},'link':{'type':Sequelize[_0x9d90('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 772874b..3240039 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 _0xfdbd=['findAll','rows','show','length','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','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','end','json','offset','undefined','count','limit','set','reject','save','update','destroy','then','error','stack','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0x23dc90,_0x58fa51){var _0x4957d8=function(_0xe5f233){while(--_0xe5f233){_0x23dc90['push'](_0x23dc90['shift']());}};_0x4957d8(++_0x58fa51);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x1116ac,_0xcbe059){_0x1116ac=_0x1116ac-0x0;var _0x3e806b=_0xfdbd[_0x1116ac];return _0x3e806b;};'use strict';var emlformat=require(_0xdfdb('0x0'));var rimraf=require(_0xdfdb('0x1'));var zipdir=require(_0xdfdb('0x2'));var jsonpatch=require(_0xdfdb('0x3'));var rp=require(_0xdfdb('0x4'));var moment=require(_0xdfdb('0x5'));var BPromise=require(_0xdfdb('0x6'));var Mustache=require(_0xdfdb('0x7'));var util=require(_0xdfdb('0x8'));var path=require('path');var sox=require(_0xdfdb('0x9'));var csv=require('to-csv');var ejs=require(_0xdfdb('0xa'));var fs=require('fs');var fs_extra=require(_0xdfdb('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdfdb('0xc'));var deskjs=require(_0xdfdb('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdfdb('0xe'));var Papa=require(_0xdfdb('0xf'));var Redis=require(_0xdfdb('0x10'));var authService=require(_0xdfdb('0x11'));var qs=require(_0xdfdb('0x12'));var as=require(_0xdfdb('0x13'));var hardwareService=require(_0xdfdb('0x14'));var logger=require('../../config/logger')(_0xdfdb('0x15'));var utils=require(_0xdfdb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdfdb('0x17'));var db=require(_0xdfdb('0x18'))['db'];function respondWithStatusCode(_0x2bee3b,_0x1918c1){_0x1918c1=_0x1918c1||0xcc;return function(_0x2a95f1){if(_0x2a95f1){return _0x2bee3b[_0xdfdb('0x19')](_0x1918c1);}return _0x2bee3b[_0xdfdb('0x1a')](_0x1918c1)[_0xdfdb('0x1b')]();};}function respondWithResult(_0x51162f,_0x48a66a){_0x48a66a=_0x48a66a||0xc8;return function(_0x2c44dc){if(_0x2c44dc){return _0x51162f['status'](_0x48a66a)[_0xdfdb('0x1c')](_0x2c44dc);}};}function respondWithFilteredResult(_0x9f3039,_0x11a56a){return function(_0x40bc8a){if(_0x40bc8a){var _0x3bfd81=typeof _0x11a56a[_0xdfdb('0x1d')]==='undefined'&&typeof _0x11a56a['limit']===_0xdfdb('0x1e');var _0x8b9193=_0x40bc8a[_0xdfdb('0x1f')];var _0x55ab5a=_0x3bfd81?0x0:_0x11a56a[_0xdfdb('0x1d')];var _0xb677b1=_0x3bfd81?_0x40bc8a[_0xdfdb('0x1f')]:_0x11a56a[_0xdfdb('0x1d')]+_0x11a56a[_0xdfdb('0x20')];var _0x2294de;if(_0xb677b1>=_0x8b9193){_0xb677b1=_0x8b9193;_0x2294de=0xc8;}else{_0x2294de=0xce;}_0x9f3039[_0xdfdb('0x1a')](_0x2294de);return _0x9f3039[_0xdfdb('0x21')]('Content-Range',_0x55ab5a+'-'+_0xb677b1+'/'+_0x8b9193)[_0xdfdb('0x1c')](_0x40bc8a);}return null;};}function patchUpdates(_0xb7417c){return function(_0x172c63){try{jsonpatch['apply'](_0x172c63,_0xb7417c,!![]);}catch(_0x377112){return BPromise[_0xdfdb('0x22')](_0x377112);}return _0x172c63[_0xdfdb('0x23')]();};}function saveUpdates(_0x4d55e5,_0x280e53){return function(_0x789bd2){if(_0x789bd2){return _0x789bd2[_0xdfdb('0x24')](_0x4d55e5)['then'](function(_0x2a80c1){return _0x2a80c1;});}return null;};}function removeEntity(_0x526057,_0x2db1c1){return function(_0x145350){if(_0x145350){return _0x145350[_0xdfdb('0x25')]()[_0xdfdb('0x26')](function(){_0x526057['status'](0xcc)[_0xdfdb('0x1b')]();});}};}function handleEntityNotFound(_0x4363d8,_0x956843){return function(_0x400663){if(!_0x400663){_0x4363d8[_0xdfdb('0x19')](0x194);}return _0x400663;};}function handleError(_0x305954,_0x57d24f){_0x57d24f=_0x57d24f||0x1f4;return function(_0xec4d22){logger[_0xdfdb('0x27')](_0xec4d22[_0xdfdb('0x28')]);if(_0xec4d22['name']){delete _0xec4d22[_0xdfdb('0x29')];}_0x305954['status'](_0x57d24f)[_0xdfdb('0x2a')](_0xec4d22);};}exports[_0xdfdb('0x2b')]=function(_0x19c36f,_0x513fa0){var _0x5bc174={},_0x1c8ca8={},_0xc56435={'count':0x0,'rows':[]};var _0xedbb91=_[_0xdfdb('0x2c')](db[_0xdfdb('0x2d')][_0xdfdb('0x2e')],function(_0x5a9fc4){return{'name':_0x5a9fc4[_0xdfdb('0x2f')],'type':_0x5a9fc4[_0xdfdb('0x30')][_0xdfdb('0x31')]};});_0x1c8ca8[_0xdfdb('0x32')]=_[_0xdfdb('0x2c')](_0xedbb91,_0xdfdb('0x29'));_0x1c8ca8[_0xdfdb('0x33')]=_[_0xdfdb('0x34')](_0x19c36f[_0xdfdb('0x33')]);_0x1c8ca8[_0xdfdb('0x35')]=_[_0xdfdb('0x36')](_0x1c8ca8['model'],_0x1c8ca8['query']);_0x5bc174[_0xdfdb('0x37')]=_['intersection'](_0x1c8ca8[_0xdfdb('0x32')],qs[_0xdfdb('0x38')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x38')]));_0x5bc174['attributes']=_0x5bc174[_0xdfdb('0x37')]['length']?_0x5bc174[_0xdfdb('0x37')]:_0x1c8ca8[_0xdfdb('0x32')];if(!_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x39')](_0xdfdb('0x3a'))){_0x5bc174[_0xdfdb('0x20')]=qs['limit'](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x20')]);_0x5bc174['offset']=qs[_0xdfdb('0x1d')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x1d')]);}_0x5bc174[_0xdfdb('0x3b')]=qs[_0xdfdb('0x3c')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3c')]);_0x5bc174[_0xdfdb('0x3d')]=qs[_0xdfdb('0x35')](_[_0xdfdb('0x3e')](_0x19c36f[_0xdfdb('0x33')],_0x1c8ca8['filters']),_0xedbb91);if(_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3f')]){_0x5bc174[_0xdfdb('0x3d')]=_[_0xdfdb('0x40')](_0x5bc174[_0xdfdb('0x3d')],{'$or':_[_0xdfdb('0x2c')](_0xedbb91,function(_0x3ec73a){if(_0x3ec73a[_0xdfdb('0x30')]!=='VIRTUAL'){var _0x55d707={};_0x55d707[_0x3ec73a[_0xdfdb('0x29')]]={'$like':'%'+_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3f')]+'%'};return _0x55d707;}})});}_0x5bc174=_[_0xdfdb('0x40')]({},_0x5bc174,_0x19c36f[_0xdfdb('0x41')]);var _0x300884={'where':_0x5bc174[_0xdfdb('0x3d')]};return db[_0xdfdb('0x2d')][_0xdfdb('0x1f')](_0x300884)['then'](function(_0x175f57){_0xc56435[_0xdfdb('0x1f')]=_0x175f57;if(_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x42')]){_0x5bc174[_0xdfdb('0x43')]=[{'all':!![]}];}return db['Integration'][_0xdfdb('0x44')](_0x5bc174);})[_0xdfdb('0x26')](function(_0x3e9f88){_0xc56435[_0xdfdb('0x45')]=_0x3e9f88;return _0xc56435;})[_0xdfdb('0x26')](respondWithFilteredResult(_0x513fa0,_0x5bc174))['catch'](handleError(_0x513fa0,null));};exports[_0xdfdb('0x46')]=function(_0xd2f8bd,_0xf0482a){var _0x5b4381={'raw':![],'where':{'id':_0xd2f8bd['params']['id']}},_0x2b5139={};_0x2b5139[_0xdfdb('0x32')]=_['keys'](db[_0xdfdb('0x2d')][_0xdfdb('0x2e')]);_0x2b5139['query']=_[_0xdfdb('0x34')](_0xd2f8bd['query']);_0x2b5139[_0xdfdb('0x35')]=_[_0xdfdb('0x36')](_0x2b5139[_0xdfdb('0x32')],_0x2b5139[_0xdfdb('0x33')]);_0x5b4381[_0xdfdb('0x37')]=_['intersection'](_0x2b5139['model'],qs[_0xdfdb('0x38')](_0xd2f8bd[_0xdfdb('0x33')]['fields']));_0x5b4381[_0xdfdb('0x37')]=_0x5b4381['attributes'][_0xdfdb('0x47')]?_0x5b4381[_0xdfdb('0x37')]:_0x2b5139[_0xdfdb('0x32')];if(_0xd2f8bd[_0xdfdb('0x33')][_0xdfdb('0x42')]){_0x5b4381[_0xdfdb('0x43')]=[{'all':!![]}];}_0x5b4381=_[_0xdfdb('0x40')]({},_0x5b4381,_0xd2f8bd[_0xdfdb('0x41')]);return db[_0xdfdb('0x2d')][_0xdfdb('0x48')](_0x5b4381)[_0xdfdb('0x26')](handleEntityNotFound(_0xf0482a,null))[_0xdfdb('0x26')](respondWithResult(_0xf0482a,null))[_0xdfdb('0x49')](handleError(_0xf0482a,null));};exports[_0xdfdb('0x4a')]=function(_0x1c08fb,_0x273477){return db['Integration']['create'](_0x1c08fb[_0xdfdb('0x4b')],{})[_0xdfdb('0x26')](respondWithResult(_0x273477,0xc9))[_0xdfdb('0x49')](handleError(_0x273477,null));};exports['update']=function(_0x36149e,_0x4d4c90){if(_0x36149e[_0xdfdb('0x4b')]['id']){delete _0x36149e[_0xdfdb('0x4b')]['id'];}return db['Integration'][_0xdfdb('0x48')]({'where':{'id':_0x36149e[_0xdfdb('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4d4c90,null))[_0xdfdb('0x26')](saveUpdates(_0x36149e[_0xdfdb('0x4b')],null))[_0xdfdb('0x26')](respondWithResult(_0x4d4c90,null))[_0xdfdb('0x49')](handleError(_0x4d4c90,null));};exports[_0xdfdb('0x25')]=function(_0x10b490,_0x17dfdb){return db[_0xdfdb('0x2d')][_0xdfdb('0x48')]({'where':{'id':_0x10b490['params']['id']}})[_0xdfdb('0x26')](handleEntityNotFound(_0x17dfdb,null))['then'](removeEntity(_0x17dfdb,null))[_0xdfdb('0x49')](handleError(_0x17dfdb,null));}; \ No newline at end of file +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(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x524e,0x15e));var _0xe524=function(_0x1f7008,_0xe9e1b4){_0x1f7008=_0x1f7008-0x0;var _0x4299e3=_0x524e[_0x1f7008];return _0x4299e3;};'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 diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 491be22..1ff2cb1 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 _0x1d85=['rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations','lodash','util','moment','bluebird'];(function(_0x517e07,_0x3f4c92){var _0x20c36a=function(_0xdea90){while(--_0xdea90){_0x517e07['push'](_0x517e07['shift']());}};_0x20c36a(++_0x3f4c92);}(_0x1d85,0xee));var _0x51d8=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x1d85[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x51d8('0x0'));var util=require(_0x51d8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x51d8('0x2'));var BPromise=require(_0x51d8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x51d8('0x4'));var config=require(_0x51d8('0x5'));var attributes=require(_0x51d8('0x6'));module[_0x51d8('0x7')]=function(_0x12f2fc,_0x1c12bb){return _0x12f2fc[_0x51d8('0x8')](_0x51d8('0x9'),attributes,{'tableName':_0x51d8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b43=['request-promise','path','../../config/environment','./integration.attributes','exports','Integration','integrations','lodash','util','../../config/logger','api','moment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8b43,0x10f));var _0x38b4=function(_0x7c9f67,_0x58f50b){_0x7c9f67=_0x7c9f67-0x0;var _0x30f9cd=_0x8b43[_0x7c9f67];return _0x30f9cd;};'use strict';var _=require(_0x38b4('0x0'));var util=require(_0x38b4('0x1'));var logger=require(_0x38b4('0x2'))(_0x38b4('0x3'));var moment=require(_0x38b4('0x4'));var BPromise=require('bluebird');var rp=require(_0x38b4('0x5'));var fs=require('fs');var path=require(_0x38b4('0x6'));var rimraf=require('rimraf');var config=require(_0x38b4('0x7'));var attributes=require(_0x38b4('0x8'));module[_0x38b4('0x9')]=function(_0x537d8b,_0x25b816){return _0x537d8b['define'](_0x38b4('0xa'),attributes,{'tableName':_0x38b4('0xb'),'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 7a7f660..24308bd 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','Integration,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x3bbf0b,_0xc03f09){var _0x20b0a5=function(_0x2d2081){while(--_0x2d2081){_0x3bbf0b['push'](_0x3bbf0b['shift']());}};_0x20b0a5(++_0xc03f09);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4d180c,_0x45c68e){_0x4d180c=_0x4d180c-0x0;var _0x49b57e=_0x5f2f[_0x4d180c];return _0x49b57e;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('Integration,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x178856,_0x41f045){var _0x3c7fe7=function(_0x4d9ce4){while(--_0x4d9ce4){_0x178856['push'](_0x178856['shift']());}};_0x3c7fe7(++_0x41f045);}(_0xadb5,0xad));var _0x5adb=function(_0x142434,_0x4f6777){_0x142434=_0x142434-0x0;var _0x5d9efa=_0xadb5[_0x142434];return _0x5d9efa;};'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']('Integration,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 24cd610..938de9f 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 _0x7880=['Router','fs-extra','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x4e68e7,_0x52fa85){var _0x19bf3c=function(_0x23a269){while(--_0x23a269){_0x4e68e7['push'](_0x4e68e7['shift']());}};_0x19bf3c(++_0x52fa85);}(_0x7880,0x1f4));var _0x0788=function(_0x416d75,_0x2c8e81){_0x416d75=_0x416d75-0x0;var _0x10af66=_0x7880[_0x416d75];return _0x10af66;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var fs_extra=require(_0x0788('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var controller=require(_0x0788('0x8'));router[_0x0788('0x9')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0xb')]);router[_0x0788('0x9')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0xd')]);router['get'](_0x0788('0xe'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router['post']('/',auth[_0x0788('0xa')](),controller[_0x0788('0x10')]);router[_0x0788('0x11')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller['update']);router[_0x0788('0x12')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller[_0x0788('0x13')]);module[_0x0788('0x14')]=router; \ No newline at end of file +var _0x187d=['/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./integrationReport.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x221808,_0x4e6ee5){var _0x26c697=function(_0x18e6df){while(--_0x18e6df){_0x221808['push'](_0x221808['shift']());}};_0x26c697(++_0x4e6ee5);}(_0x187d,0x93));var _0xd187=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x187d[_0x36dfbd];return _0x4ecad9;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var fs_extra=require(_0xd187('0x5'));var auth=require(_0xd187('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd187('0x7'));var controller=require(_0xd187('0x8'));router['get']('/',auth[_0xd187('0x9')](),controller[_0xd187('0xa')]);router[_0xd187('0xb')](_0xd187('0xc'),auth[_0xd187('0x9')](),controller[_0xd187('0xd')]);router[_0xd187('0xb')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0xf')]);router[_0xd187('0x10')]('/',auth[_0xd187('0x9')](),controller[_0xd187('0x11')]);router[_0xd187('0x12')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0x13')]);router[_0xd187('0x14')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0x15')]);module[_0xd187('0x16')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 9ee72fd..4eeac5d 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 _0xd3d7=['BOOLEAN','TEXT','ENUM','SENT','FAILED','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x135b3d,_0x2b645a){var _0x1fbad2=function(_0x30bb14){while(--_0x30bb14){_0x135b3d['push'](_0x135b3d['shift']());}};_0x1fbad2(++_0x2b645a);}(_0xd3d7,0x7d));var _0x7d3d=function(_0x47e763,_0x34bb6e){_0x47e763=_0x47e763-0x0;var _0x3a9cb0=_0xd3d7[_0x47e763];return _0x3a9cb0;};'use strict';var Sequelize=require(_0x7d3d('0x0'));module[_0x7d3d('0x1')]={'integration':{'type':Sequelize[_0x7d3d('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x7d3d('0x2')]},'ticketId':{'type':Sequelize[_0x7d3d('0x2')]},'integrationId':{'type':Sequelize[_0x7d3d('0x3')]},'contacts':{'type':Sequelize[_0x7d3d('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x7d3d('0x2')]},'calleridname':{'type':Sequelize[_0x7d3d('0x2')]},'queue':{'type':Sequelize[_0x7d3d('0x2')]},'interface':{'type':Sequelize[_0x7d3d('0x2')]},'membername':{'type':Sequelize[_0x7d3d('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x7d3d('0x4')]},'holdtime':{'type':Sequelize[_0x7d3d('0x3')]},'agentcomplete':{'type':Sequelize[_0x7d3d('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x7d3d('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x7d3d('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7d3d('0x3')]},'reason':{'type':Sequelize[_0x7d3d('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x7d3d('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x7d3d('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x7d3d('0x2')]},'channel':{'type':Sequelize[_0x7d3d('0x2')]},'channelstate':{'type':Sequelize[_0x7d3d('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x7d3d('0x2')]},'connectedlinename':{'type':Sequelize[_0x7d3d('0x2')]},'language':{'type':Sequelize[_0x7d3d('0x2')]},'accountcode':{'type':Sequelize[_0x7d3d('0x2')]},'context':{'type':Sequelize[_0x7d3d('0x2')]},'exten':{'type':Sequelize[_0x7d3d('0x2')]},'priority':{'type':Sequelize[_0x7d3d('0x2')]},'destchannel':{'type':Sequelize[_0x7d3d('0x2')]},'destchannelstate':{'type':Sequelize[_0x7d3d('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x7d3d('0x2')]},'destcalleridnum':{'type':Sequelize[_0x7d3d('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x7d3d('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x7d3d('0x2')]},'destaccountcode':{'type':Sequelize[_0x7d3d('0x2')]},'destcontext':{'type':Sequelize[_0x7d3d('0x2')]},'destexten':{'type':Sequelize[_0x7d3d('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x7d3d('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x7d3d('0x2')]},'from':{'type':Sequelize[_0x7d3d('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x7d3d('0x2')]},'attachment':{'type':Sequelize[_0x7d3d('0x6')]},'html':{'type':Sequelize[_0x7d3d('0x6')]},'text':{'type':Sequelize[_0x7d3d('0x6')]},'status':{'type':Sequelize[_0x7d3d('0x7')](_0x7d3d('0x8'),'SENDING','RECEIVED',_0x7d3d('0x9'))},'url':{'type':Sequelize[_0x7d3d('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x7d3d('0x2')]},'projectId':{'type':Sequelize[_0x7d3d('0x3')]}}; \ No newline at end of file +var _0x677c=['FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','SENDING'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x677c,0x105));var _0xc677=function(_0x1b7edd,_0x4d074f){_0x1b7edd=_0x1b7edd-0x0;var _0x44679d=_0x677c[_0x1b7edd];return _0x44679d;};'use strict';var Sequelize=require(_0xc677('0x0'));module[_0xc677('0x1')]={'integration':{'type':Sequelize[_0xc677('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0xc677('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xc677('0x3')]},'contacts':{'type':Sequelize[_0xc677('0x2')]},'uniqueid':{'type':Sequelize[_0xc677('0x2')]},'calleridnum':{'type':Sequelize[_0xc677('0x2')]},'calleridname':{'type':Sequelize[_0xc677('0x2')]},'queue':{'type':Sequelize[_0xc677('0x2')]},'interface':{'type':Sequelize[_0xc677('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xc677('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xc677('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xc677('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xc677('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xc677('0x3')]},'reason':{'type':Sequelize[_0xc677('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xc677('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xc677('0x4')]},'agentdump':{'type':Sequelize[_0xc677('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xc677('0x4')]},'lastevent':{'type':Sequelize[_0xc677('0x2')]},'channel':{'type':Sequelize[_0xc677('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xc677('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc677('0x2')]},'connectedlinename':{'type':Sequelize[_0xc677('0x2')]},'language':{'type':Sequelize[_0xc677('0x2')]},'accountcode':{'type':Sequelize[_0xc677('0x2')]},'context':{'type':Sequelize[_0xc677('0x2')]},'exten':{'type':Sequelize[_0xc677('0x2')]},'priority':{'type':Sequelize[_0xc677('0x2')]},'destchannel':{'type':Sequelize[_0xc677('0x2')]},'destchannelstate':{'type':Sequelize[_0xc677('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xc677('0x2')]},'destcalleridname':{'type':Sequelize[_0xc677('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc677('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xc677('0x2')]},'destlanguage':{'type':Sequelize[_0xc677('0x2')]},'destaccountcode':{'type':Sequelize[_0xc677('0x2')]},'destcontext':{'type':Sequelize[_0xc677('0x2')]},'destexten':{'type':Sequelize[_0xc677('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xc677('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xc677('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0xc677('0x6')]},'html':{'type':Sequelize[_0xc677('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize['ENUM'](_0xc677('0x7'),_0xc677('0x8'),'RECEIVED',_0xc677('0x9'))},'url':{'type':Sequelize[_0xc677('0x2')]},'app':{'type':Sequelize[_0xc677('0x2')]},'appdata':{'type':Sequelize[_0xc677('0x2')]},'projectId':{'type':Sequelize[_0xc677('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 748c4bb..663bcb0 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 _0x6227=['fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','map','VIRTUAL','filter','options','IntegrationReport','then','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','describe','eml-format','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','count','offset','reject','save','update','destroy','sendStatus','error','name','index','rawAttributes'];(function(_0xfa716b,_0x1fa236){var _0xe946ab=function(_0x495c2e){while(--_0x495c2e){_0xfa716b['push'](_0xfa716b['shift']());}};_0xe946ab(++_0x1fa236);}(_0x6227,0xae));var _0x7622=function(_0x297eee,_0x211a03){_0x297eee=_0x297eee-0x0;var _0x17c4af=_0x6227[_0x297eee];return _0x17c4af;};'use strict';var emlformat=require(_0x7622('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7622('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7622('0x2'));var BPromise=require(_0x7622('0x3'));var Mustache=require(_0x7622('0x4'));var util=require(_0x7622('0x5'));var path=require(_0x7622('0x6'));var sox=require('sox');var csv=require(_0x7622('0x7'));var ejs=require(_0x7622('0x8'));var fs=require('fs');var fs_extra=require(_0x7622('0x9'));var _=require(_0x7622('0xa'));var squel=require(_0x7622('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7622('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7622('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7622('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7622('0xf'));var logger=require(_0x7622('0x10'))(_0x7622('0x11'));var utils=require(_0x7622('0x12'));var config=require(_0x7622('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x7622('0x14'))['db'];function respondWithStatusCode(_0x1ae895,_0x557918){_0x557918=_0x557918||0xcc;return function(_0x16a9f9){if(_0x16a9f9){return _0x1ae895['sendStatus'](_0x557918);}return _0x1ae895[_0x7622('0x15')](_0x557918)[_0x7622('0x16')]();};}function respondWithResult(_0x1b27f1,_0x3ca6db){_0x3ca6db=_0x3ca6db||0xc8;return function(_0x5c580d){if(_0x5c580d){return _0x1b27f1[_0x7622('0x15')](_0x3ca6db)[_0x7622('0x17')](_0x5c580d);}};}function respondWithFilteredResult(_0x644b3,_0x325889){return function(_0xf314cd){if(_0xf314cd){var _0x2689b9=typeof _0x325889['offset']==='undefined'&&typeof _0x325889[_0x7622('0x18')]==='undefined';var _0x2401d3=_0xf314cd[_0x7622('0x19')];var _0xb50d0c=_0x2689b9?0x0:_0x325889[_0x7622('0x1a')];var _0xde94bb=_0x2689b9?_0xf314cd[_0x7622('0x19')]:_0x325889[_0x7622('0x1a')]+_0x325889[_0x7622('0x18')];var _0x470973;if(_0xde94bb>=_0x2401d3){_0xde94bb=_0x2401d3;_0x470973=0xc8;}else{_0x470973=0xce;}_0x644b3[_0x7622('0x15')](_0x470973);return _0x644b3['set']('Content-Range',_0xb50d0c+'-'+_0xde94bb+'/'+_0x2401d3)[_0x7622('0x17')](_0xf314cd);}return null;};}function patchUpdates(_0x125cbd){return function(_0x43ca0a){try{jsonpatch['apply'](_0x43ca0a,_0x125cbd,!![]);}catch(_0x394c05){return BPromise[_0x7622('0x1b')](_0x394c05);}return _0x43ca0a[_0x7622('0x1c')]();};}function saveUpdates(_0x3ca3fb,_0x2aabb3){return function(_0x8dac2c){if(_0x8dac2c){return _0x8dac2c[_0x7622('0x1d')](_0x3ca3fb)['then'](function(_0x2e5407){return _0x2e5407;});}return null;};}function removeEntity(_0x3ec5d7,_0x135148){return function(_0xc49358){if(_0xc49358){return _0xc49358[_0x7622('0x1e')]()['then'](function(){_0x3ec5d7['status'](0xcc)[_0x7622('0x16')]();});}};}function handleEntityNotFound(_0x3110da,_0x345816){return function(_0x4aec7e){if(!_0x4aec7e){_0x3110da[_0x7622('0x1f')](0x194);}return _0x4aec7e;};}function handleError(_0xfedf01,_0x4b583f){_0x4b583f=_0x4b583f||0x1f4;return function(_0xf6c9dd){logger[_0x7622('0x20')](_0xf6c9dd['stack']);if(_0xf6c9dd[_0x7622('0x21')]){delete _0xf6c9dd['name'];}_0xfedf01[_0x7622('0x15')](_0x4b583f)['send'](_0xf6c9dd);};}exports[_0x7622('0x22')]=function(_0x3e6bd8,_0x11c99d){var _0x3a526d={},_0x3e9638={},_0x20dbb5={'count':0x0,'rows':[]};var _0x3bb2f0=_['map'](db['IntegrationReport'][_0x7622('0x23')],function(_0x3c7dd0){return{'name':_0x3c7dd0[_0x7622('0x24')],'type':_0x3c7dd0[_0x7622('0x25')][_0x7622('0x26')]};});_0x3e9638[_0x7622('0x27')]=_['map'](_0x3bb2f0,_0x7622('0x21'));_0x3e9638[_0x7622('0x28')]=_[_0x7622('0x29')](_0x3e6bd8['query']);_0x3e9638[_0x7622('0x2a')]=_[_0x7622('0x2b')](_0x3e9638[_0x7622('0x27')],_0x3e9638[_0x7622('0x28')]);_0x3a526d[_0x7622('0x2c')]=_[_0x7622('0x2b')](_0x3e9638[_0x7622('0x27')],qs[_0x7622('0x2d')](_0x3e6bd8[_0x7622('0x28')][_0x7622('0x2d')]));_0x3a526d[_0x7622('0x2c')]=_0x3a526d[_0x7622('0x2c')]['length']?_0x3a526d[_0x7622('0x2c')]:_0x3e9638['model'];if(!_0x3e6bd8['query'][_0x7622('0x2e')]('nolimit')){_0x3a526d[_0x7622('0x18')]=qs[_0x7622('0x18')](_0x3e6bd8[_0x7622('0x28')][_0x7622('0x18')]);_0x3a526d[_0x7622('0x1a')]=qs['offset'](_0x3e6bd8[_0x7622('0x28')]['offset']);}_0x3a526d[_0x7622('0x2f')]=qs[_0x7622('0x30')](_0x3e6bd8[_0x7622('0x28')][_0x7622('0x30')]);_0x3a526d[_0x7622('0x31')]=qs[_0x7622('0x2a')](_[_0x7622('0x32')](_0x3e6bd8[_0x7622('0x28')],_0x3e9638[_0x7622('0x2a')]),_0x3bb2f0);if(_0x3e6bd8[_0x7622('0x28')]['filter']){_0x3a526d[_0x7622('0x31')]=_[_0x7622('0x33')](_0x3a526d[_0x7622('0x31')],{'$or':_[_0x7622('0x34')](_0x3bb2f0,function(_0x1d27a1){if(_0x1d27a1[_0x7622('0x25')]!==_0x7622('0x35')){var _0x2a195c={};_0x2a195c[_0x1d27a1[_0x7622('0x21')]]={'$like':'%'+_0x3e6bd8['query'][_0x7622('0x36')]+'%'};return _0x2a195c;}})});}_0x3a526d=_[_0x7622('0x33')]({},_0x3a526d,_0x3e6bd8[_0x7622('0x37')]);var _0x409935={'where':_0x3a526d['where']};return db[_0x7622('0x38')][_0x7622('0x19')](_0x409935)[_0x7622('0x39')](function(_0x1cb4f){_0x20dbb5['count']=_0x1cb4f;if(_0x3e6bd8[_0x7622('0x28')][_0x7622('0x3a')]){_0x3a526d['include']=[{'all':!![]}];}return db['IntegrationReport'][_0x7622('0x3b')](_0x3a526d);})[_0x7622('0x39')](function(_0x326999){_0x20dbb5[_0x7622('0x3c')]=_0x326999;return _0x20dbb5;})[_0x7622('0x39')](respondWithFilteredResult(_0x11c99d,_0x3a526d))[_0x7622('0x3d')](handleError(_0x11c99d,null));};exports[_0x7622('0x3e')]=function(_0x1e4fc0,_0x23835c){var _0x27ef57={'raw':![],'where':{'id':_0x1e4fc0[_0x7622('0x3f')]['id']}},_0x2f2e12={};_0x2f2e12[_0x7622('0x27')]=_[_0x7622('0x29')](db[_0x7622('0x38')]['rawAttributes']);_0x2f2e12[_0x7622('0x28')]=_[_0x7622('0x29')](_0x1e4fc0[_0x7622('0x28')]);_0x2f2e12[_0x7622('0x2a')]=_[_0x7622('0x2b')](_0x2f2e12[_0x7622('0x27')],_0x2f2e12[_0x7622('0x28')]);_0x27ef57[_0x7622('0x2c')]=_[_0x7622('0x2b')](_0x2f2e12[_0x7622('0x27')],qs[_0x7622('0x2d')](_0x1e4fc0[_0x7622('0x28')][_0x7622('0x2d')]));_0x27ef57[_0x7622('0x2c')]=_0x27ef57[_0x7622('0x2c')][_0x7622('0x40')]?_0x27ef57['attributes']:_0x2f2e12[_0x7622('0x27')];if(_0x1e4fc0[_0x7622('0x28')][_0x7622('0x3a')]){_0x27ef57[_0x7622('0x41')]=[{'all':!![]}];}_0x27ef57=_[_0x7622('0x33')]({},_0x27ef57,_0x1e4fc0['options']);return db[_0x7622('0x38')][_0x7622('0x42')](_0x27ef57)[_0x7622('0x39')](handleEntityNotFound(_0x23835c,null))[_0x7622('0x39')](respondWithResult(_0x23835c,null))['catch'](handleError(_0x23835c,null));};exports['create']=function(_0x17adb2,_0xea3c11){return db[_0x7622('0x38')][_0x7622('0x43')](_0x17adb2[_0x7622('0x44')],{})['then'](respondWithResult(_0xea3c11,0xc9))[_0x7622('0x3d')](handleError(_0xea3c11,null));};exports[_0x7622('0x1d')]=function(_0x49f184,_0x273d3b){if(_0x49f184[_0x7622('0x44')]['id']){delete _0x49f184[_0x7622('0x44')]['id'];}return db[_0x7622('0x38')]['find']({'where':{'id':_0x49f184['params']['id']}})[_0x7622('0x39')](handleEntityNotFound(_0x273d3b,null))['then'](saveUpdates(_0x49f184[_0x7622('0x44')],null))[_0x7622('0x39')](respondWithResult(_0x273d3b,null))[_0x7622('0x3d')](handleError(_0x273d3b,null));};exports[_0x7622('0x1e')]=function(_0x236ff7,_0x323a27){return db[_0x7622('0x38')][_0x7622('0x42')]({'where':{'id':_0x236ff7[_0x7622('0x3f')]['id']}})[_0x7622('0x39')](handleEntityNotFound(_0x323a27,null))['then'](removeEntity(_0x323a27,null))[_0x7622('0x3d')](handleError(_0x323a27,null));};exports['describe']=function(_0x4efeb6,_0x3a9a04){return db['IntegrationReport'][_0x7622('0x45')]()[_0x7622('0x39')](respondWithResult(_0x3a9a04,null))[_0x7622('0x3d')](handleError(_0x3a9a04,null));}; \ No newline at end of file +var _0x9cdf=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','name','send','IntegrationReport','fieldName','type','map','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','describe','eml-format','rimraf','moment','mustache','path'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x9cdf,0x1b1));var _0xf9cd=function(_0x3018a7,_0x387464){_0x3018a7=_0x3018a7-0x0;var _0x5696fa=_0x9cdf[_0x3018a7];return _0x5696fa;};'use strict';var emlformat=require(_0xf9cd('0x0'));var rimraf=require(_0xf9cd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf9cd('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xf9cd('0x3'));var util=require('util');var path=require(_0xf9cd('0x4'));var sox=require(_0xf9cd('0x5'));var csv=require(_0xf9cd('0x6'));var ejs=require(_0xf9cd('0x7'));var fs=require('fs');var fs_extra=require(_0xf9cd('0x8'));var _=require(_0xf9cd('0x9'));var squel=require(_0xf9cd('0xa'));var crypto=require(_0xf9cd('0xb'));var jsforce=require(_0xf9cd('0xc'));var deskjs=require(_0xf9cd('0xd'));var toCsv=require(_0xf9cd('0x6'));var querystring=require(_0xf9cd('0xe'));var Papa=require('papaparse');var Redis=require(_0xf9cd('0xf'));var authService=require(_0xf9cd('0x10'));var qs=require(_0xf9cd('0x11'));var as=require(_0xf9cd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf9cd('0x13'))(_0xf9cd('0x14'));var utils=require(_0xf9cd('0x15'));var config=require(_0xf9cd('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf9cd('0x17'))['db'];function respondWithStatusCode(_0x10596c,_0x52db24){_0x52db24=_0x52db24||0xcc;return function(_0x51baae){if(_0x51baae){return _0x10596c[_0xf9cd('0x18')](_0x52db24);}return _0x10596c[_0xf9cd('0x19')](_0x52db24)[_0xf9cd('0x1a')]();};}function respondWithResult(_0x27f71f,_0x1e764a){_0x1e764a=_0x1e764a||0xc8;return function(_0x14e90e){if(_0x14e90e){return _0x27f71f[_0xf9cd('0x19')](_0x1e764a)[_0xf9cd('0x1b')](_0x14e90e);}};}function respondWithFilteredResult(_0x3363c1,_0x5295b6){return function(_0x4d7dc1){if(_0x4d7dc1){var _0x55ed1b=typeof _0x5295b6[_0xf9cd('0x1c')]===_0xf9cd('0x1d')&&typeof _0x5295b6[_0xf9cd('0x1e')]===_0xf9cd('0x1d');var _0xe2108a=_0x4d7dc1[_0xf9cd('0x1f')];var _0x59cef1=_0x55ed1b?0x0:_0x5295b6['offset'];var _0x4beb6a=_0x55ed1b?_0x4d7dc1[_0xf9cd('0x1f')]:_0x5295b6['offset']+_0x5295b6['limit'];var _0x4b5adb;if(_0x4beb6a>=_0xe2108a){_0x4beb6a=_0xe2108a;_0x4b5adb=0xc8;}else{_0x4b5adb=0xce;}_0x3363c1[_0xf9cd('0x19')](_0x4b5adb);return _0x3363c1[_0xf9cd('0x20')](_0xf9cd('0x21'),_0x59cef1+'-'+_0x4beb6a+'/'+_0xe2108a)[_0xf9cd('0x1b')](_0x4d7dc1);}return null;};}function patchUpdates(_0x212eb6){return function(_0x4e8838){try{jsonpatch['apply'](_0x4e8838,_0x212eb6,!![]);}catch(_0x2e0136){return BPromise[_0xf9cd('0x22')](_0x2e0136);}return _0x4e8838[_0xf9cd('0x23')]();};}function saveUpdates(_0x3ffa12,_0x4b1983){return function(_0x37e8af){if(_0x37e8af){return _0x37e8af['update'](_0x3ffa12)[_0xf9cd('0x24')](function(_0x934251){return _0x934251;});}return null;};}function removeEntity(_0x580631,_0x499d2d){return function(_0x5c4ec7){if(_0x5c4ec7){return _0x5c4ec7[_0xf9cd('0x25')]()[_0xf9cd('0x24')](function(){_0x580631[_0xf9cd('0x19')](0xcc)[_0xf9cd('0x1a')]();});}};}function handleEntityNotFound(_0x368537,_0x468dd5){return function(_0x405b4e){if(!_0x405b4e){_0x368537['sendStatus'](0x194);}return _0x405b4e;};}function handleError(_0x14894e,_0x546575){_0x546575=_0x546575||0x1f4;return function(_0x2db5b5){logger[_0xf9cd('0x26')](_0x2db5b5['stack']);if(_0x2db5b5[_0xf9cd('0x27')]){delete _0x2db5b5[_0xf9cd('0x27')];}_0x14894e['status'](_0x546575)[_0xf9cd('0x28')](_0x2db5b5);};}exports['index']=function(_0x30cee3,_0x237fd4){var _0x51d01c={},_0x4bb0a5={},_0x31e001={'count':0x0,'rows':[]};var _0x25914a=_['map'](db[_0xf9cd('0x29')]['rawAttributes'],function(_0x2a459c){return{'name':_0x2a459c[_0xf9cd('0x2a')],'type':_0x2a459c[_0xf9cd('0x2b')]['key']};});_0x4bb0a5['model']=_[_0xf9cd('0x2c')](_0x25914a,_0xf9cd('0x27'));_0x4bb0a5['query']=_[_0xf9cd('0x2d')](_0x30cee3[_0xf9cd('0x2e')]);_0x4bb0a5[_0xf9cd('0x2f')]=_[_0xf9cd('0x30')](_0x4bb0a5[_0xf9cd('0x31')],_0x4bb0a5[_0xf9cd('0x2e')]);_0x51d01c[_0xf9cd('0x32')]=_[_0xf9cd('0x30')](_0x4bb0a5[_0xf9cd('0x31')],qs[_0xf9cd('0x33')](_0x30cee3[_0xf9cd('0x2e')]['fields']));_0x51d01c[_0xf9cd('0x32')]=_0x51d01c[_0xf9cd('0x32')]['length']?_0x51d01c[_0xf9cd('0x32')]:_0x4bb0a5[_0xf9cd('0x31')];if(!_0x30cee3[_0xf9cd('0x2e')][_0xf9cd('0x34')]('nolimit')){_0x51d01c['limit']=qs[_0xf9cd('0x1e')](_0x30cee3[_0xf9cd('0x2e')]['limit']);_0x51d01c[_0xf9cd('0x1c')]=qs[_0xf9cd('0x1c')](_0x30cee3[_0xf9cd('0x2e')][_0xf9cd('0x1c')]);}_0x51d01c[_0xf9cd('0x35')]=qs[_0xf9cd('0x36')](_0x30cee3[_0xf9cd('0x2e')][_0xf9cd('0x36')]);_0x51d01c['where']=qs[_0xf9cd('0x2f')](_[_0xf9cd('0x37')](_0x30cee3['query'],_0x4bb0a5[_0xf9cd('0x2f')]),_0x25914a);if(_0x30cee3[_0xf9cd('0x2e')][_0xf9cd('0x38')]){_0x51d01c[_0xf9cd('0x39')]=_['merge'](_0x51d01c[_0xf9cd('0x39')],{'$or':_[_0xf9cd('0x2c')](_0x25914a,function(_0x40fdf9){if(_0x40fdf9['type']!==_0xf9cd('0x3a')){var _0x413f1e={};_0x413f1e[_0x40fdf9[_0xf9cd('0x27')]]={'$like':'%'+_0x30cee3[_0xf9cd('0x2e')][_0xf9cd('0x38')]+'%'};return _0x413f1e;}})});}_0x51d01c=_[_0xf9cd('0x3b')]({},_0x51d01c,_0x30cee3[_0xf9cd('0x3c')]);var _0x45fbe9={'where':_0x51d01c['where']};return db[_0xf9cd('0x29')][_0xf9cd('0x1f')](_0x45fbe9)[_0xf9cd('0x24')](function(_0x100740){_0x31e001['count']=_0x100740;if(_0x30cee3[_0xf9cd('0x2e')][_0xf9cd('0x3d')]){_0x51d01c['include']=[{'all':!![]}];}return db[_0xf9cd('0x29')][_0xf9cd('0x3e')](_0x51d01c);})[_0xf9cd('0x24')](function(_0x333736){_0x31e001[_0xf9cd('0x3f')]=_0x333736;return _0x31e001;})[_0xf9cd('0x24')](respondWithFilteredResult(_0x237fd4,_0x51d01c))[_0xf9cd('0x40')](handleError(_0x237fd4,null));};exports[_0xf9cd('0x41')]=function(_0x4272b6,_0xeed9f5){var _0x573dae={'raw':![],'where':{'id':_0x4272b6[_0xf9cd('0x42')]['id']}},_0x4655dd={};_0x4655dd[_0xf9cd('0x31')]=_['keys'](db[_0xf9cd('0x29')]['rawAttributes']);_0x4655dd['query']=_[_0xf9cd('0x2d')](_0x4272b6['query']);_0x4655dd[_0xf9cd('0x2f')]=_[_0xf9cd('0x30')](_0x4655dd['model'],_0x4655dd[_0xf9cd('0x2e')]);_0x573dae[_0xf9cd('0x32')]=_[_0xf9cd('0x30')](_0x4655dd['model'],qs[_0xf9cd('0x33')](_0x4272b6['query'][_0xf9cd('0x33')]));_0x573dae[_0xf9cd('0x32')]=_0x573dae['attributes']['length']?_0x573dae[_0xf9cd('0x32')]:_0x4655dd['model'];if(_0x4272b6[_0xf9cd('0x2e')][_0xf9cd('0x3d')]){_0x573dae[_0xf9cd('0x43')]=[{'all':!![]}];}_0x573dae=_['merge']({},_0x573dae,_0x4272b6[_0xf9cd('0x3c')]);return db[_0xf9cd('0x29')][_0xf9cd('0x44')](_0x573dae)[_0xf9cd('0x24')](handleEntityNotFound(_0xeed9f5,null))[_0xf9cd('0x24')](respondWithResult(_0xeed9f5,null))[_0xf9cd('0x40')](handleError(_0xeed9f5,null));};exports[_0xf9cd('0x45')]=function(_0x4c869a,_0x81d511){return db[_0xf9cd('0x29')][_0xf9cd('0x45')](_0x4c869a[_0xf9cd('0x46')],{})['then'](respondWithResult(_0x81d511,0xc9))[_0xf9cd('0x40')](handleError(_0x81d511,null));};exports[_0xf9cd('0x47')]=function(_0x59ac83,_0x459eff){if(_0x59ac83['body']['id']){delete _0x59ac83[_0xf9cd('0x46')]['id'];}return db[_0xf9cd('0x29')][_0xf9cd('0x44')]({'where':{'id':_0x59ac83[_0xf9cd('0x42')]['id']}})[_0xf9cd('0x24')](handleEntityNotFound(_0x459eff,null))[_0xf9cd('0x24')](saveUpdates(_0x59ac83[_0xf9cd('0x46')],null))['then'](respondWithResult(_0x459eff,null))[_0xf9cd('0x40')](handleError(_0x459eff,null));};exports['destroy']=function(_0x13e43d,_0x52714e){return db[_0xf9cd('0x29')][_0xf9cd('0x44')]({'where':{'id':_0x13e43d[_0xf9cd('0x42')]['id']}})[_0xf9cd('0x24')](handleEntityNotFound(_0x52714e,null))['then'](removeEntity(_0x52714e,null))[_0xf9cd('0x40')](handleError(_0x52714e,null));};exports[_0xf9cd('0x48')]=function(_0xd2c06d,_0x504d22){return db[_0xf9cd('0x29')][_0xf9cd('0x48')]()[_0xf9cd('0x24')](respondWithResult(_0x504d22,null))[_0xf9cd('0x40')](handleError(_0x504d22,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 5b48358..6cf10e4 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 _0xd785=['moment','bluebird','request-promise','path','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd785,0xc4));var _0x5d78=function(_0x350343,_0x256f69){_0x350343=_0x350343-0x0;var _0x9afc1c=_0xd785[_0x350343];return _0x9afc1c;};'use strict';var _=require('lodash');var util=require(_0x5d78('0x0'));var logger=require(_0x5d78('0x1'))('api');var moment=require(_0x5d78('0x2'));var BPromise=require(_0x5d78('0x3'));var rp=require(_0x5d78('0x4'));var fs=require('fs');var path=require(_0x5d78('0x5'));var rimraf=require('rimraf');var config=require(_0x5d78('0x6'));var attributes=require(_0x5d78('0x7'));module[_0x5d78('0x8')]=function(_0x1e710b,_0x28a36c){return _0x1e710b[_0x5d78('0x9')](_0x5d78('0xa'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff42=['rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','request-promise'];(function(_0x10dbab,_0x2e8174){var _0x408bfe=function(_0x4bca15){while(--_0x4bca15){_0x10dbab['push'](_0x10dbab['shift']());}};_0x408bfe(++_0x2e8174);}(_0xff42,0x11b));var _0x2ff4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xff42[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2ff4('0x0'));var util=require(_0x2ff4('0x1'));var logger=require(_0x2ff4('0x2'))(_0x2ff4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2ff4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2ff4('0x5'));var config=require(_0x2ff4('0x6'));var attributes=require(_0x2ff4('0x7'));module[_0x2ff4('0x8')]=function(_0x993595,_0x2dc4c4){return _0x993595[_0x2ff4('0x9')](_0x2ff4('0xa'),attributes,{'tableName':_0x2ff4('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 bb4c0a7..3c23258 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(_0x52c1f6,_0x4eda0b){var _0x4df981=function(_0x71aa7){while(--_0x71aa7){_0x52c1f6['push'](_0x52c1f6['shift']());}};_0x4df981(++_0x4eda0b);}(_0x2ef3,0xba));var _0x32ef=function(_0x22d9a4,_0x4eb6ca){_0x22d9a4=_0x22d9a4-0x0;var _0x395fea=_0x2ef3[_0x22d9a4];return _0x395fea;};'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 _0x2675=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis'];(function(_0xb9ea17,_0x337c5e){var _0x2749a8=function(_0x2a69bf){while(--_0x2a69bf){_0xb9ea17['push'](_0xb9ea17['shift']());}};_0x2749a8(++_0x337c5e);}(_0x2675,0x75));var _0x5267=function(_0x31593b,_0xfe387a){_0x31593b=_0x31593b-0x0;var _0x43887d=_0x2675[_0x31593b];return _0x43887d;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5267('0x1'));var fs=require('fs');var Redis=require(_0x5267('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5267('0x3'));var logger=require(_0x5267('0x4'))('rpc');var config=require(_0x5267('0x5'));var jayson=require(_0x5267('0x6'));var client=jayson[_0x5267('0x7')][_0x5267('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20f065,_0xc56cd5,_0x527c16){return new BPromise(function(_0x9e0a27,_0x46bfdf){return client['request'](_0x20f065,_0x527c16)[_0x5267('0x9')](function(_0x5d6645){logger[_0x5267('0xa')](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));logger['debug'](_0x5267('0xd'),_0xc56cd5,'request\x20sent',JSON[_0x5267('0xe')](_0x5d6645));if(_0x5d6645['error']){if(_0x5d6645[_0x5267('0xf')][_0x5267('0x10')]===0x1f4){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x46bfdf(_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);}logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x9e0a27(_0x5d6645[_0x5267('0xf')]['message']);}else{logger['info'](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));_0x9e0a27(_0x5d6645[_0x5267('0x12')][_0x5267('0x11')]);}})[_0x5267('0x13')](function(_0x27e5c6){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x27e5c6);_0x46bfdf(_0x27e5c6);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 1c78f9a..a72e4d8 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 _0xed1f=['/:id/sub_intervals','getIntervals','/:id/sub_intervals/create_many','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show'];(function(_0x1efb2e,_0x282243){var _0x278a67=function(_0x21e862){while(--_0x21e862){_0x1efb2e['push'](_0x1efb2e['shift']());}};_0x278a67(++_0x282243);}(_0xed1f,0x170));var _0xfed1=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0xed1f[_0x25d386];return _0x857f4a;};'use strict';var multer=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfed1('0x2'));var router=express['Router']();var fs_extra=require(_0xfed1('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfed1('0x4'));var config=require(_0xfed1('0x5'));var controller=require(_0xfed1('0x6'));router[_0xfed1('0x7')]('/',auth[_0xfed1('0x8')](),controller[_0xfed1('0x9')]);router[_0xfed1('0x7')](_0xfed1('0xa'),auth[_0xfed1('0x8')](),controller[_0xfed1('0xb')]);router['get'](_0xfed1('0xc'),auth[_0xfed1('0x8')](),controller[_0xfed1('0xd')]);router['post']('/',auth[_0xfed1('0x8')](),controller['create']);router['post'](_0xfed1('0xc'),auth[_0xfed1('0x8')](),controller['addInterval']);router['post'](_0xfed1('0xe'),auth[_0xfed1('0x8')](),controller['addIntervals']);router[_0xfed1('0xf')]('/:id',auth[_0xfed1('0x8')](),controller[_0xfed1('0x10')]);router[_0xfed1('0x11')](_0xfed1('0xa'),auth['isAuthenticated'](),controller[_0xfed1('0x12')]);module[_0xfed1('0x13')]=router; \ No newline at end of file +var _0x6a83=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','post','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','put','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x2f2cb8,_0x417d38){var _0x5a7add=function(_0xc1da1d){while(--_0xc1da1d){_0x2f2cb8['push'](_0x2f2cb8['shift']());}};_0x5a7add(++_0x417d38);}(_0x6a83,0xd2));var _0x36a8=function(_0x59f44d,_0x4d23ea){_0x59f44d=_0x59f44d-0x0;var _0x48bc8e=_0x6a83[_0x59f44d];return _0x48bc8e;};'use strict';var multer=require(_0x36a8('0x0'));var util=require(_0x36a8('0x1'));var path=require(_0x36a8('0x2'));var timeout=require(_0x36a8('0x3'));var express=require(_0x36a8('0x4'));var router=express[_0x36a8('0x5')]();var fs_extra=require(_0x36a8('0x6'));var auth=require(_0x36a8('0x7'));var interaction=require(_0x36a8('0x8'));var config=require(_0x36a8('0x9'));var controller=require(_0x36a8('0xa'));router[_0x36a8('0xb')]('/',auth[_0x36a8('0xc')](),controller[_0x36a8('0xd')]);router[_0x36a8('0xb')](_0x36a8('0xe'),auth[_0x36a8('0xc')](),controller[_0x36a8('0xf')]);router[_0x36a8('0xb')]('/:id/sub_intervals',auth[_0x36a8('0xc')](),controller['getIntervals']);router[_0x36a8('0x10')]('/',auth[_0x36a8('0xc')](),controller['create']);router[_0x36a8('0x10')](_0x36a8('0x11'),auth['isAuthenticated'](),controller[_0x36a8('0x12')]);router[_0x36a8('0x10')](_0x36a8('0x13'),auth[_0x36a8('0xc')](),controller[_0x36a8('0x14')]);router[_0x36a8('0x15')](_0x36a8('0xe'),auth[_0x36a8('0xc')](),controller['update']);router[_0x36a8('0x16')](_0x36a8('0xe'),auth[_0x36a8('0xc')](),controller[_0x36a8('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 1408dfa..26253c7 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 _0x4a7d=['sequelize','exports','STRING'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x4a7d,0x1bc));var _0xd4a7=function(_0x2ce74e,_0x212202){_0x2ce74e=_0x2ce74e-0x0;var _0x55f7a2=_0x4a7d[_0x2ce74e];return _0x55f7a2;};'use strict';var Sequelize=require(_0xd4a7('0x0'));module[_0xd4a7('0x1')]={'name':{'type':Sequelize[_0xd4a7('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xd4a7('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xad88=['STRING','sequelize'];(function(_0x22d394,_0x4ee5b3){var _0x49fb53=function(_0x23de9b){while(--_0x23de9b){_0x22d394['push'](_0x22d394['shift']());}};_0x49fb53(++_0x4ee5b3);}(_0xad88,0x1bb));var _0x8ad8=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xad88[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require(_0x8ad8('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8ad8('0x1')]},'interval':{'type':Sequelize[_0x8ad8('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index f83f1a1..e28f289 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 _0x4fd3=['moment','bluebird','mustache','path','sox','to-csv','ejs','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','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','then','get','Intervals','UserProfileResource','error','stack','name','send','map','Interval','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','getIntervals','findOne','hasOwnProperty','addIntervals','transaction','IntervalId','bulkCreate','eml-format','rimraf','zip-dir','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4fd3,0x174));var _0x34fd=function(_0x9bcc0b,_0x120f6c){_0x9bcc0b=_0x9bcc0b-0x0;var _0x195399=_0x4fd3[_0x9bcc0b];return _0x195399;};'use strict';var emlformat=require(_0x34fd('0x0'));var rimraf=require(_0x34fd('0x1'));var zipdir=require(_0x34fd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x34fd('0x3'));var moment=require(_0x34fd('0x4'));var BPromise=require(_0x34fd('0x5'));var Mustache=require(_0x34fd('0x6'));var util=require('util');var path=require(_0x34fd('0x7'));var sox=require(_0x34fd('0x8'));var csv=require(_0x34fd('0x9'));var ejs=require(_0x34fd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x34fd('0xb'));var squel=require('squel');var crypto=require(_0x34fd('0xc'));var jsforce=require(_0x34fd('0xd'));var deskjs=require(_0x34fd('0xe'));var toCsv=require(_0x34fd('0x9'));var querystring=require(_0x34fd('0xf'));var Papa=require(_0x34fd('0x10'));var Redis=require(_0x34fd('0x11'));var authService=require(_0x34fd('0x12'));var qs=require(_0x34fd('0x13'));var as=require(_0x34fd('0x14'));var hardwareService=require(_0x34fd('0x15'));var logger=require(_0x34fd('0x16'))('api');var utils=require(_0x34fd('0x17'));var config=require(_0x34fd('0x18'));var licenseUtil=require(_0x34fd('0x19'));var db=require(_0x34fd('0x1a'))['db'];var extensions=require(_0x34fd('0x1b'));function respondWithStatusCode(_0x1efd13,_0x21a55a){_0x21a55a=_0x21a55a||0xcc;return function(_0x42ab6f){if(_0x42ab6f){return _0x1efd13[_0x34fd('0x1c')](_0x21a55a);}return _0x1efd13[_0x34fd('0x1d')](_0x21a55a)[_0x34fd('0x1e')]();};}function respondWithResult(_0x57d4d0,_0x531e0e){_0x531e0e=_0x531e0e||0xc8;return function(_0x418e3d){if(_0x418e3d){return _0x57d4d0[_0x34fd('0x1d')](_0x531e0e)[_0x34fd('0x1f')](_0x418e3d);}};}function respondWithFilteredResult(_0x1ed604,_0x4adf0b){return function(_0x22b6de){if(_0x22b6de){var _0x45e29f=typeof _0x4adf0b['offset']===_0x34fd('0x20')&&typeof _0x4adf0b[_0x34fd('0x21')]==='undefined';var _0x2f6500=_0x22b6de[_0x34fd('0x22')];var _0xa4765=_0x45e29f?0x0:_0x4adf0b[_0x34fd('0x23')];var _0x518d25=_0x45e29f?_0x22b6de[_0x34fd('0x22')]:_0x4adf0b[_0x34fd('0x23')]+_0x4adf0b[_0x34fd('0x21')];var _0x68c985;if(_0x518d25>=_0x2f6500){_0x518d25=_0x2f6500;_0x68c985=0xc8;}else{_0x68c985=0xce;}_0x1ed604[_0x34fd('0x1d')](_0x68c985);return _0x1ed604[_0x34fd('0x24')](_0x34fd('0x25'),_0xa4765+'-'+_0x518d25+'/'+_0x2f6500)[_0x34fd('0x1f')](_0x22b6de);}return null;};}function patchUpdates(_0x54a745){return function(_0x506c30){try{jsonpatch[_0x34fd('0x26')](_0x506c30,_0x54a745,!![]);}catch(_0x46226d){return BPromise[_0x34fd('0x27')](_0x46226d);}return _0x506c30['save']();};}function saveUpdates(_0x33b2aa,_0x2b2561){return function(_0x5418e7){if(_0x5418e7){return _0x5418e7[_0x34fd('0x28')](_0x33b2aa)['then'](function(_0x348fb6){return _0x348fb6;});}return null;};}function removeEntity(_0x35d317,_0x211749){return function(_0xab79){if(_0xab79){return _0xab79[_0x34fd('0x29')]()[_0x34fd('0x2a')](function(){var _0x1fb576=_0xab79[_0x34fd('0x2b')]({'plain':!![]});var _0x13bc08=_0x34fd('0x2c');return db[_0x34fd('0x2d')][_0x34fd('0x29')]({'where':{'type':_0x13bc08,'resourceId':_0x1fb576['id']}})[_0x34fd('0x2a')](function(){return _0xab79;});})[_0x34fd('0x2a')](function(){_0x35d317[_0x34fd('0x1d')](0xcc)[_0x34fd('0x1e')]();});}};}function handleEntityNotFound(_0x784f3f,_0x248c30){return function(_0x4b0f64){if(!_0x4b0f64){_0x784f3f[_0x34fd('0x1c')](0x194);}return _0x4b0f64;};}function handleError(_0x4cc73f,_0x3056a3){_0x3056a3=_0x3056a3||0x1f4;return function(_0x572c78){logger[_0x34fd('0x2e')](_0x572c78[_0x34fd('0x2f')]);if(_0x572c78[_0x34fd('0x30')]){delete _0x572c78[_0x34fd('0x30')];}_0x4cc73f['status'](_0x3056a3)[_0x34fd('0x31')](_0x572c78);};}exports['index']=function(_0x158928,_0x515905){var _0x4075e3={},_0x2a6feb={},_0x4cf1cd={'count':0x0,'rows':[]};var _0x1ea896=_[_0x34fd('0x32')](db[_0x34fd('0x33')][_0x34fd('0x34')],function(_0x3e9d09){return{'name':_0x3e9d09[_0x34fd('0x35')],'type':_0x3e9d09['type'][_0x34fd('0x36')]};});_0x2a6feb['model']=_[_0x34fd('0x32')](_0x1ea896,_0x34fd('0x30'));_0x2a6feb[_0x34fd('0x37')]=_[_0x34fd('0x38')](_0x158928['query']);_0x2a6feb[_0x34fd('0x39')]=_[_0x34fd('0x3a')](_0x2a6feb['model'],_0x2a6feb['query']);_0x4075e3[_0x34fd('0x3b')]=_[_0x34fd('0x3a')](_0x2a6feb[_0x34fd('0x3c')],qs[_0x34fd('0x3d')](_0x158928[_0x34fd('0x37')]['fields']));_0x4075e3['attributes']=_0x4075e3['attributes'][_0x34fd('0x3e')]?_0x4075e3[_0x34fd('0x3b')]:_0x2a6feb[_0x34fd('0x3c')];if(!_0x158928[_0x34fd('0x37')]['hasOwnProperty']('nolimit')){_0x4075e3[_0x34fd('0x21')]=qs[_0x34fd('0x21')](_0x158928[_0x34fd('0x37')][_0x34fd('0x21')]);_0x4075e3[_0x34fd('0x23')]=qs[_0x34fd('0x23')](_0x158928[_0x34fd('0x37')][_0x34fd('0x23')]);}_0x4075e3['order']=qs['sort'](_0x158928[_0x34fd('0x37')][_0x34fd('0x3f')]);_0x4075e3[_0x34fd('0x40')]=qs[_0x34fd('0x39')](_[_0x34fd('0x41')](_0x158928['query'],_0x2a6feb[_0x34fd('0x39')]),_0x1ea896);if(_0x158928[_0x34fd('0x37')]['filter']){_0x4075e3[_0x34fd('0x40')]=_[_0x34fd('0x42')](_0x4075e3[_0x34fd('0x40')],{'$or':_['map'](_0x1ea896,function(_0x3510ff){if(_0x3510ff[_0x34fd('0x43')]!==_0x34fd('0x44')){var _0x53c46e={};_0x53c46e[_0x3510ff[_0x34fd('0x30')]]={'$like':'%'+_0x158928[_0x34fd('0x37')][_0x34fd('0x45')]+'%'};return _0x53c46e;}})});}_0x4075e3=_[_0x34fd('0x42')]({},_0x4075e3,_0x158928[_0x34fd('0x46')]);var _0x5d57fd={'where':_0x4075e3[_0x34fd('0x40')]};return db[_0x34fd('0x33')]['count'](_0x5d57fd)['then'](function(_0x52c37c){_0x4cf1cd[_0x34fd('0x22')]=_0x52c37c;if(_0x158928[_0x34fd('0x37')][_0x34fd('0x47')]){_0x4075e3[_0x34fd('0x48')]=[{'all':!![]}];}return db[_0x34fd('0x33')][_0x34fd('0x49')](_0x4075e3);})[_0x34fd('0x2a')](function(_0x312b54){_0x4cf1cd[_0x34fd('0x4a')]=_0x312b54;return _0x4cf1cd;})[_0x34fd('0x2a')](respondWithFilteredResult(_0x515905,_0x4075e3))[_0x34fd('0x4b')](handleError(_0x515905,null));};exports[_0x34fd('0x4c')]=function(_0x254863,_0x3dcd33){var _0x1ff8de={'raw':!![],'where':{'id':_0x254863[_0x34fd('0x4d')]['id']}},_0x4758b0={};_0x4758b0[_0x34fd('0x3c')]=_['keys'](db[_0x34fd('0x33')][_0x34fd('0x34')]);_0x4758b0[_0x34fd('0x37')]=_[_0x34fd('0x38')](_0x254863[_0x34fd('0x37')]);_0x4758b0[_0x34fd('0x39')]=_[_0x34fd('0x3a')](_0x4758b0[_0x34fd('0x3c')],_0x4758b0['query']);_0x1ff8de['attributes']=_[_0x34fd('0x3a')](_0x4758b0[_0x34fd('0x3c')],qs[_0x34fd('0x3d')](_0x254863[_0x34fd('0x37')]['fields']));_0x1ff8de[_0x34fd('0x3b')]=_0x1ff8de[_0x34fd('0x3b')][_0x34fd('0x3e')]?_0x1ff8de['attributes']:_0x4758b0[_0x34fd('0x3c')];if(_0x254863[_0x34fd('0x37')][_0x34fd('0x47')]){_0x1ff8de[_0x34fd('0x48')]=[{'all':!![]}];}_0x1ff8de=_['merge']({},_0x1ff8de,_0x254863[_0x34fd('0x46')]);return db[_0x34fd('0x33')][_0x34fd('0x4e')](_0x1ff8de)['then'](handleEntityNotFound(_0x3dcd33,null))[_0x34fd('0x2a')](respondWithResult(_0x3dcd33,null))[_0x34fd('0x4b')](handleError(_0x3dcd33,null));};exports['create']=function(_0x39f3fe,_0x16a4c8){return db[_0x34fd('0x33')]['create'](_0x39f3fe['body'],{})[_0x34fd('0x2a')](function(_0x5d6d75){var _0x3a1da6=_0x39f3fe['user'][_0x34fd('0x2b')]({'plain':!![]});if(!_0x3a1da6)throw new Error(_0x34fd('0x4f'));if(_0x3a1da6['role']===_0x34fd('0x50')){var _0x149533=_0x5d6d75[_0x34fd('0x2b')]({'plain':!![]});var _0x4ce90e=_0x34fd('0x2c');return db[_0x34fd('0x51')][_0x34fd('0x4e')]({'where':{'name':_0x4ce90e,'userProfileId':_0x3a1da6[_0x34fd('0x52')]},'raw':!![]})[_0x34fd('0x2a')](function(_0x65b096){if(_0x65b096&&_0x65b096['autoAssociation']===0x0){return db[_0x34fd('0x2d')][_0x34fd('0x53')]({'name':_0x149533['name'],'resourceId':_0x149533['id'],'type':_0x65b096[_0x34fd('0x30')],'sectionId':_0x65b096['id']},{})['then'](function(){return _0x5d6d75;});}else{return _0x5d6d75;}})[_0x34fd('0x4b')](function(_0x5117a7){logger['error'](_0x34fd('0x54'),_0x5117a7);throw _0x5117a7;});}return _0x5d6d75;})['then'](respondWithResult(_0x16a4c8,0xc9))[_0x34fd('0x4b')](handleError(_0x16a4c8,null));};exports[_0x34fd('0x28')]=function(_0x424dcc,_0x106684){if(_0x424dcc[_0x34fd('0x55')]['id']){delete _0x424dcc[_0x34fd('0x55')]['id'];}return db['Interval']['find']({'where':{'id':_0x424dcc['params']['id']}})[_0x34fd('0x2a')](handleEntityNotFound(_0x106684,null))[_0x34fd('0x2a')](saveUpdates(_0x424dcc['body'],null))['then'](respondWithResult(_0x106684,null))[_0x34fd('0x4b')](handleError(_0x106684,null));};exports[_0x34fd('0x29')]=function(_0x2a1c3a,_0xc54a92){return db[_0x34fd('0x33')][_0x34fd('0x4e')]({'where':{'id':_0x2a1c3a['params']['id']}})[_0x34fd('0x2a')](handleEntityNotFound(_0xc54a92,null))[_0x34fd('0x2a')](removeEntity(_0xc54a92,null))['catch'](handleError(_0xc54a92,null));};exports[_0x34fd('0x56')]=function(_0x1cbfa1,_0x529b4d,_0x1c3fc0){if(_0x1cbfa1[_0x34fd('0x55')]['id']){delete _0x1cbfa1[_0x34fd('0x55')]['id'];}return db['Interval']['find']({'where':{'id':_0x1cbfa1['params']['id']}})[_0x34fd('0x2a')](handleEntityNotFound(_0x529b4d,null))['then'](function(_0x530154){if(_0x530154){_0x1cbfa1[_0x34fd('0x55')]['IntervalId']=_0x530154['id'];return db[_0x34fd('0x33')]['create'](_0x1cbfa1['body']);}})[_0x34fd('0x2a')](respondWithResult(_0x529b4d,null))['catch'](handleError(_0x529b4d,null));};exports[_0x34fd('0x57')]=function(_0x12191f,_0x3d2590,_0x407598){var _0x3236b9={};var _0xae1687={};var _0x578efb;var _0x34a2d3;return db[_0x34fd('0x33')][_0x34fd('0x58')]({'where':{'id':_0x12191f['params']['id']}})[_0x34fd('0x2a')](handleEntityNotFound(_0x3d2590,null))['then'](function(_0x2a2f62){if(_0x2a2f62){_0x578efb=_0x2a2f62;_0xae1687[_0x34fd('0x3c')]=_['keys'](db[_0x34fd('0x33')][_0x34fd('0x34')]);_0xae1687[_0x34fd('0x37')]=_[_0x34fd('0x38')](_0x12191f[_0x34fd('0x37')]);_0xae1687['filters']=_[_0x34fd('0x3a')](_0xae1687[_0x34fd('0x3c')],_0xae1687[_0x34fd('0x37')]);_0x3236b9['attributes']=_[_0x34fd('0x3a')](_0xae1687[_0x34fd('0x3c')],qs['fields'](_0x12191f[_0x34fd('0x37')][_0x34fd('0x3d')]));_0x3236b9[_0x34fd('0x3b')]=_0x3236b9[_0x34fd('0x3b')]['length']?_0x3236b9[_0x34fd('0x3b')]:_0xae1687[_0x34fd('0x3c')];_0x3236b9['order']=qs[_0x34fd('0x3f')](_0x12191f[_0x34fd('0x37')]['sort']);_0x3236b9[_0x34fd('0x40')]=qs[_0x34fd('0x39')](_[_0x34fd('0x41')](_0x12191f[_0x34fd('0x37')],_0xae1687[_0x34fd('0x39')]));if(_0x12191f[_0x34fd('0x37')][_0x34fd('0x45')]){_0x3236b9['where']=_['merge'](_0x3236b9[_0x34fd('0x40')],{'$or':_[_0x34fd('0x32')](_0x3236b9[_0x34fd('0x3b')],function(_0x12ff30){var _0x234d3f={};_0x234d3f[_0x12ff30]={'$like':'%'+_0x12191f['query']['filter']+'%'};return _0x234d3f;})});}_0x3236b9=_['merge']({},_0x3236b9,_0x12191f[_0x34fd('0x46')]);return _0x578efb[_0x34fd('0x57')](_0x3236b9);}})['then'](function(_0x35fcc1){if(_0x35fcc1){_0x34a2d3=_0x35fcc1[_0x34fd('0x3e')];if(!_0x12191f[_0x34fd('0x37')][_0x34fd('0x59')]('nolimit')){_0x3236b9['limit']=qs[_0x34fd('0x21')](_0x12191f[_0x34fd('0x37')]['limit']);_0x3236b9[_0x34fd('0x23')]=qs[_0x34fd('0x23')](_0x12191f[_0x34fd('0x37')][_0x34fd('0x23')]);}return _0x578efb[_0x34fd('0x57')](_0x3236b9);}})[_0x34fd('0x2a')](function(_0x30ca2){if(_0x30ca2){return _0x30ca2?{'count':_0x34a2d3,'rows':_0x30ca2}:null;}})[_0x34fd('0x2a')](respondWithResult(_0x3d2590,null))['catch'](handleError(_0x3d2590,null));};exports[_0x34fd('0x5a')]=function(_0x5e457c,_0x3e3d72,_0x2c0f1c){return db['Interval'][_0x34fd('0x58')]({'where':{'id':_0x5e457c['params']['id']}})['then'](handleEntityNotFound(_0x3e3d72,null))[_0x34fd('0x2a')](function(_0x53383f){if(_0x53383f){return db['sequelize'][_0x34fd('0x5b')](function(_0x4b74a5){return db[_0x34fd('0x33')][_0x34fd('0x29')]({'where':{'IntervalId':_0x5e457c['params']['id']},'transaction':_0x4b74a5})[_0x34fd('0x2a')](function(_0x44f9b1){var _0x5b8b47=_[_0x34fd('0x32')](_0x5e457c[_0x34fd('0x55')],function(_0x15c43c){delete _0x15c43c['id'];_0x15c43c[_0x34fd('0x5c')]=_0x5e457c[_0x34fd('0x4d')]['id'];return _0x15c43c;});return db[_0x34fd('0x33')][_0x34fd('0x5d')](_0x5b8b47,{'transaction':_0x4b74a5});});})[_0x34fd('0x2a')](function(){return db['Interval']['findAll']({'where':{'IntervalId':_0x5e457c[_0x34fd('0x4d')]['id']}});});}})[_0x34fd('0x2a')](respondWithResult(_0x3e3d72,null))['catch'](handleError(_0x3e3d72,null));}; \ No newline at end of file +var _0x4a00=['model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','Interval','includeAll','include','findAll','rows','show','params','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','body','addInterval','IntervalId','getIntervals','hasOwnProperty','addIntervals','findOne','sequelize','transaction','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','limit','count','offset','set','Content-Range','json','apply','reject','update','then','Intervals','UserProfileResource','destroy','error','stack','name','send','map','rawAttributes','fieldName','type'];(function(_0x5a98ac,_0x5b783c){var _0x59c9cf=function(_0x4e5656){while(--_0x4e5656){_0x5a98ac['push'](_0x5a98ac['shift']());}};_0x59c9cf(++_0x5b783c);}(_0x4a00,0x129));var _0x04a0=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4a00[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0x04a0('0x0'));var rimraf=require(_0x04a0('0x1'));var zipdir=require(_0x04a0('0x2'));var jsonpatch=require(_0x04a0('0x3'));var rp=require(_0x04a0('0x4'));var moment=require(_0x04a0('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x04a0('0x6'));var sox=require(_0x04a0('0x7'));var csv=require(_0x04a0('0x8'));var ejs=require(_0x04a0('0x9'));var fs=require('fs');var fs_extra=require(_0x04a0('0xa'));var _=require(_0x04a0('0xb'));var squel=require(_0x04a0('0xc'));var crypto=require('crypto');var jsforce=require(_0x04a0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x04a0('0x8'));var querystring=require(_0x04a0('0xe'));var Papa=require('papaparse');var Redis=require(_0x04a0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x04a0('0x10'));var as=require(_0x04a0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x04a0('0x12'));var utils=require(_0x04a0('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x04a0('0x14'));var db=require(_0x04a0('0x15'))['db'];var extensions=require(_0x04a0('0x16'));function respondWithStatusCode(_0x2bd8d3,_0x40c626){_0x40c626=_0x40c626||0xcc;return function(_0x4b38cb){if(_0x4b38cb){return _0x2bd8d3[_0x04a0('0x17')](_0x40c626);}return _0x2bd8d3[_0x04a0('0x18')](_0x40c626)[_0x04a0('0x19')]();};}function respondWithResult(_0x4e8845,_0x1f7c4b){_0x1f7c4b=_0x1f7c4b||0xc8;return function(_0x4f7f9e){if(_0x4f7f9e){return _0x4e8845[_0x04a0('0x18')](_0x1f7c4b)['json'](_0x4f7f9e);}};}function respondWithFilteredResult(_0x12fece,_0x1f8705){return function(_0x53f9d0){if(_0x53f9d0){var _0x3a9eb7=typeof _0x1f8705['offset']==='undefined'&&typeof _0x1f8705[_0x04a0('0x1a')]==='undefined';var _0x2f200c=_0x53f9d0[_0x04a0('0x1b')];var _0x3d3b18=_0x3a9eb7?0x0:_0x1f8705[_0x04a0('0x1c')];var _0x2a2493=_0x3a9eb7?_0x53f9d0[_0x04a0('0x1b')]:_0x1f8705['offset']+_0x1f8705['limit'];var _0x2febfb;if(_0x2a2493>=_0x2f200c){_0x2a2493=_0x2f200c;_0x2febfb=0xc8;}else{_0x2febfb=0xce;}_0x12fece[_0x04a0('0x18')](_0x2febfb);return _0x12fece[_0x04a0('0x1d')](_0x04a0('0x1e'),_0x3d3b18+'-'+_0x2a2493+'/'+_0x2f200c)[_0x04a0('0x1f')](_0x53f9d0);}return null;};}function patchUpdates(_0x387026){return function(_0x4e30b3){try{jsonpatch[_0x04a0('0x20')](_0x4e30b3,_0x387026,!![]);}catch(_0x55cee1){return BPromise[_0x04a0('0x21')](_0x55cee1);}return _0x4e30b3['save']();};}function saveUpdates(_0x30f42f,_0x3fbac2){return function(_0x193f98){if(_0x193f98){return _0x193f98[_0x04a0('0x22')](_0x30f42f)[_0x04a0('0x23')](function(_0x1c5966){return _0x1c5966;});}return null;};}function removeEntity(_0x42fde6,_0x5a01ce){return function(_0x2e2f9b){if(_0x2e2f9b){return _0x2e2f9b['destroy']()[_0x04a0('0x23')](function(){var _0x533ade=_0x2e2f9b['get']({'plain':!![]});var _0x2427bd=_0x04a0('0x24');return db[_0x04a0('0x25')][_0x04a0('0x26')]({'where':{'type':_0x2427bd,'resourceId':_0x533ade['id']}})[_0x04a0('0x23')](function(){return _0x2e2f9b;});})[_0x04a0('0x23')](function(){_0x42fde6[_0x04a0('0x18')](0xcc)[_0x04a0('0x19')]();});}};}function handleEntityNotFound(_0x462960,_0x1c1a6e){return function(_0x936eaf){if(!_0x936eaf){_0x462960[_0x04a0('0x17')](0x194);}return _0x936eaf;};}function handleError(_0x1fb78d,_0x51e9fb){_0x51e9fb=_0x51e9fb||0x1f4;return function(_0x5df185){logger[_0x04a0('0x27')](_0x5df185[_0x04a0('0x28')]);if(_0x5df185['name']){delete _0x5df185[_0x04a0('0x29')];}_0x1fb78d['status'](_0x51e9fb)[_0x04a0('0x2a')](_0x5df185);};}exports['index']=function(_0x4ff0e8,_0x2fe92a){var _0x25f6ab={},_0x25652b={},_0xcfe11e={'count':0x0,'rows':[]};var _0x2e35d7=_[_0x04a0('0x2b')](db['Interval'][_0x04a0('0x2c')],function(_0x345b16){return{'name':_0x345b16[_0x04a0('0x2d')],'type':_0x345b16[_0x04a0('0x2e')]['key']};});_0x25652b[_0x04a0('0x2f')]=_[_0x04a0('0x2b')](_0x2e35d7,_0x04a0('0x29'));_0x25652b[_0x04a0('0x30')]=_[_0x04a0('0x31')](_0x4ff0e8[_0x04a0('0x30')]);_0x25652b[_0x04a0('0x32')]=_[_0x04a0('0x33')](_0x25652b['model'],_0x25652b[_0x04a0('0x30')]);_0x25f6ab['attributes']=_['intersection'](_0x25652b[_0x04a0('0x2f')],qs[_0x04a0('0x34')](_0x4ff0e8[_0x04a0('0x30')][_0x04a0('0x34')]));_0x25f6ab[_0x04a0('0x35')]=_0x25f6ab[_0x04a0('0x35')][_0x04a0('0x36')]?_0x25f6ab['attributes']:_0x25652b['model'];if(!_0x4ff0e8[_0x04a0('0x30')]['hasOwnProperty'](_0x04a0('0x37'))){_0x25f6ab[_0x04a0('0x1a')]=qs[_0x04a0('0x1a')](_0x4ff0e8[_0x04a0('0x30')][_0x04a0('0x1a')]);_0x25f6ab['offset']=qs['offset'](_0x4ff0e8['query'][_0x04a0('0x1c')]);}_0x25f6ab[_0x04a0('0x38')]=qs[_0x04a0('0x39')](_0x4ff0e8[_0x04a0('0x30')][_0x04a0('0x39')]);_0x25f6ab[_0x04a0('0x3a')]=qs['filters'](_[_0x04a0('0x3b')](_0x4ff0e8['query'],_0x25652b['filters']),_0x2e35d7);if(_0x4ff0e8[_0x04a0('0x30')][_0x04a0('0x3c')]){_0x25f6ab[_0x04a0('0x3a')]=_[_0x04a0('0x3d')](_0x25f6ab[_0x04a0('0x3a')],{'$or':_[_0x04a0('0x2b')](_0x2e35d7,function(_0x487fe3){if(_0x487fe3[_0x04a0('0x2e')]!=='VIRTUAL'){var _0x128e4f={};_0x128e4f[_0x487fe3['name']]={'$like':'%'+_0x4ff0e8[_0x04a0('0x30')][_0x04a0('0x3c')]+'%'};return _0x128e4f;}})});}_0x25f6ab=_[_0x04a0('0x3d')]({},_0x25f6ab,_0x4ff0e8[_0x04a0('0x3e')]);var _0x2de8a4={'where':_0x25f6ab['where']};return db[_0x04a0('0x3f')]['count'](_0x2de8a4)['then'](function(_0x1e2a8f){_0xcfe11e['count']=_0x1e2a8f;if(_0x4ff0e8['query'][_0x04a0('0x40')]){_0x25f6ab[_0x04a0('0x41')]=[{'all':!![]}];}return db['Interval'][_0x04a0('0x42')](_0x25f6ab);})[_0x04a0('0x23')](function(_0x1884a0){_0xcfe11e[_0x04a0('0x43')]=_0x1884a0;return _0xcfe11e;})['then'](respondWithFilteredResult(_0x2fe92a,_0x25f6ab))['catch'](handleError(_0x2fe92a,null));};exports[_0x04a0('0x44')]=function(_0x17c416,_0x4270fc){var _0x31e9a8={'raw':!![],'where':{'id':_0x17c416[_0x04a0('0x45')]['id']}},_0x32e4ab={};_0x32e4ab[_0x04a0('0x2f')]=_['keys'](db[_0x04a0('0x3f')][_0x04a0('0x2c')]);_0x32e4ab['query']=_['keys'](_0x17c416[_0x04a0('0x30')]);_0x32e4ab[_0x04a0('0x32')]=_[_0x04a0('0x33')](_0x32e4ab[_0x04a0('0x2f')],_0x32e4ab[_0x04a0('0x30')]);_0x31e9a8['attributes']=_[_0x04a0('0x33')](_0x32e4ab[_0x04a0('0x2f')],qs[_0x04a0('0x34')](_0x17c416[_0x04a0('0x30')][_0x04a0('0x34')]));_0x31e9a8[_0x04a0('0x35')]=_0x31e9a8[_0x04a0('0x35')]['length']?_0x31e9a8[_0x04a0('0x35')]:_0x32e4ab[_0x04a0('0x2f')];if(_0x17c416[_0x04a0('0x30')][_0x04a0('0x40')]){_0x31e9a8['include']=[{'all':!![]}];}_0x31e9a8=_[_0x04a0('0x3d')]({},_0x31e9a8,_0x17c416[_0x04a0('0x3e')]);return db['Interval'][_0x04a0('0x46')](_0x31e9a8)[_0x04a0('0x23')](handleEntityNotFound(_0x4270fc,null))[_0x04a0('0x23')](respondWithResult(_0x4270fc,null))[_0x04a0('0x47')](handleError(_0x4270fc,null));};exports[_0x04a0('0x48')]=function(_0x407d3c,_0x454090){return db['Interval'][_0x04a0('0x48')](_0x407d3c['body'],{})[_0x04a0('0x23')](function(_0x39f088){var _0x403f80=_0x407d3c[_0x04a0('0x49')]['get']({'plain':!![]});if(!_0x403f80)throw new Error(_0x04a0('0x4a'));if(_0x403f80['role']===_0x04a0('0x49')){var _0x2439eb=_0x39f088[_0x04a0('0x4b')]({'plain':!![]});var _0x8d9909='Intervals';return db[_0x04a0('0x4c')]['find']({'where':{'name':_0x8d9909,'userProfileId':_0x403f80['userProfileId']},'raw':!![]})[_0x04a0('0x23')](function(_0x402346){if(_0x402346&&_0x402346['autoAssociation']===0x0){return db[_0x04a0('0x25')][_0x04a0('0x48')]({'name':_0x2439eb[_0x04a0('0x29')],'resourceId':_0x2439eb['id'],'type':_0x402346['name'],'sectionId':_0x402346['id']},{})[_0x04a0('0x23')](function(){return _0x39f088;});}else{return _0x39f088;}})[_0x04a0('0x47')](function(_0x566c0b){logger[_0x04a0('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x566c0b);throw _0x566c0b;});}return _0x39f088;})[_0x04a0('0x23')](respondWithResult(_0x454090,0xc9))[_0x04a0('0x47')](handleError(_0x454090,null));};exports[_0x04a0('0x22')]=function(_0x101363,_0xad1ce5){if(_0x101363[_0x04a0('0x4d')]['id']){delete _0x101363['body']['id'];}return db[_0x04a0('0x3f')][_0x04a0('0x46')]({'where':{'id':_0x101363[_0x04a0('0x45')]['id']}})[_0x04a0('0x23')](handleEntityNotFound(_0xad1ce5,null))[_0x04a0('0x23')](saveUpdates(_0x101363[_0x04a0('0x4d')],null))[_0x04a0('0x23')](respondWithResult(_0xad1ce5,null))[_0x04a0('0x47')](handleError(_0xad1ce5,null));};exports[_0x04a0('0x26')]=function(_0x38d55a,_0x328482){return db[_0x04a0('0x3f')]['find']({'where':{'id':_0x38d55a[_0x04a0('0x45')]['id']}})['then'](handleEntityNotFound(_0x328482,null))[_0x04a0('0x23')](removeEntity(_0x328482,null))['catch'](handleError(_0x328482,null));};exports[_0x04a0('0x4e')]=function(_0x8469bc,_0x434309,_0x5f1a6b){if(_0x8469bc[_0x04a0('0x4d')]['id']){delete _0x8469bc[_0x04a0('0x4d')]['id'];}return db[_0x04a0('0x3f')][_0x04a0('0x46')]({'where':{'id':_0x8469bc['params']['id']}})[_0x04a0('0x23')](handleEntityNotFound(_0x434309,null))[_0x04a0('0x23')](function(_0x8b9e2f){if(_0x8b9e2f){_0x8469bc[_0x04a0('0x4d')][_0x04a0('0x4f')]=_0x8b9e2f['id'];return db['Interval']['create'](_0x8469bc['body']);}})[_0x04a0('0x23')](respondWithResult(_0x434309,null))[_0x04a0('0x47')](handleError(_0x434309,null));};exports[_0x04a0('0x50')]=function(_0x13038d,_0x4344c9,_0x1e7cba){var _0x4e9850={};var _0x445ebd={};var _0x12e647;var _0x1f3392;return db[_0x04a0('0x3f')]['findOne']({'where':{'id':_0x13038d['params']['id']}})[_0x04a0('0x23')](handleEntityNotFound(_0x4344c9,null))[_0x04a0('0x23')](function(_0x1954e5){if(_0x1954e5){_0x12e647=_0x1954e5;_0x445ebd[_0x04a0('0x2f')]=_[_0x04a0('0x31')](db[_0x04a0('0x3f')][_0x04a0('0x2c')]);_0x445ebd[_0x04a0('0x30')]=_[_0x04a0('0x31')](_0x13038d[_0x04a0('0x30')]);_0x445ebd['filters']=_[_0x04a0('0x33')](_0x445ebd[_0x04a0('0x2f')],_0x445ebd['query']);_0x4e9850[_0x04a0('0x35')]=_['intersection'](_0x445ebd[_0x04a0('0x2f')],qs['fields'](_0x13038d[_0x04a0('0x30')][_0x04a0('0x34')]));_0x4e9850[_0x04a0('0x35')]=_0x4e9850['attributes'][_0x04a0('0x36')]?_0x4e9850[_0x04a0('0x35')]:_0x445ebd[_0x04a0('0x2f')];_0x4e9850[_0x04a0('0x38')]=qs['sort'](_0x13038d[_0x04a0('0x30')][_0x04a0('0x39')]);_0x4e9850[_0x04a0('0x3a')]=qs[_0x04a0('0x32')](_[_0x04a0('0x3b')](_0x13038d[_0x04a0('0x30')],_0x445ebd[_0x04a0('0x32')]));if(_0x13038d[_0x04a0('0x30')]['filter']){_0x4e9850['where']=_['merge'](_0x4e9850[_0x04a0('0x3a')],{'$or':_[_0x04a0('0x2b')](_0x4e9850['attributes'],function(_0x5ed349){var _0x43244c={};_0x43244c[_0x5ed349]={'$like':'%'+_0x13038d[_0x04a0('0x30')]['filter']+'%'};return _0x43244c;})});}_0x4e9850=_[_0x04a0('0x3d')]({},_0x4e9850,_0x13038d[_0x04a0('0x3e')]);return _0x12e647[_0x04a0('0x50')](_0x4e9850);}})['then'](function(_0x3aa0b5){if(_0x3aa0b5){_0x1f3392=_0x3aa0b5['length'];if(!_0x13038d['query'][_0x04a0('0x51')](_0x04a0('0x37'))){_0x4e9850[_0x04a0('0x1a')]=qs['limit'](_0x13038d[_0x04a0('0x30')][_0x04a0('0x1a')]);_0x4e9850['offset']=qs[_0x04a0('0x1c')](_0x13038d['query'][_0x04a0('0x1c')]);}return _0x12e647[_0x04a0('0x50')](_0x4e9850);}})[_0x04a0('0x23')](function(_0x2ef599){if(_0x2ef599){return _0x2ef599?{'count':_0x1f3392,'rows':_0x2ef599}:null;}})[_0x04a0('0x23')](respondWithResult(_0x4344c9,null))[_0x04a0('0x47')](handleError(_0x4344c9,null));};exports[_0x04a0('0x52')]=function(_0x45fcee,_0x178b22,_0x546c03){return db['Interval'][_0x04a0('0x53')]({'where':{'id':_0x45fcee[_0x04a0('0x45')]['id']}})['then'](handleEntityNotFound(_0x178b22,null))['then'](function(_0x465292){if(_0x465292){return db[_0x04a0('0x54')][_0x04a0('0x55')](function(_0x307685){return db[_0x04a0('0x3f')][_0x04a0('0x26')]({'where':{'IntervalId':_0x45fcee['params']['id']},'transaction':_0x307685})[_0x04a0('0x23')](function(_0xb3b48b){var _0x24f682=_[_0x04a0('0x2b')](_0x45fcee[_0x04a0('0x4d')],function(_0x41d8d4){delete _0x41d8d4['id'];_0x41d8d4[_0x04a0('0x4f')]=_0x45fcee[_0x04a0('0x45')]['id'];return _0x41d8d4;});return db[_0x04a0('0x3f')]['bulkCreate'](_0x24f682,{'transaction':_0x307685});});})['then'](function(){return db[_0x04a0('0x3f')]['findAll']({'where':{'IntervalId':_0x45fcee[_0x04a0('0x45')]['id']}});});}})['then'](respondWithResult(_0x178b22,null))[_0x04a0('0x47')](handleError(_0x178b22,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 0f20213..1fcd109 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 _0x30cd=['util','api','bluebird','request-promise','path','./interval.attributes','../../components/extensions/rewrite','define','Interval','rewrite'];(function(_0x1d845f,_0x59b33a){var _0x423cfc=function(_0x342fa0){while(--_0x342fa0){_0x1d845f['push'](_0x1d845f['shift']());}};_0x423cfc(++_0x59b33a);}(_0x30cd,0x186));var _0xd30c=function(_0x352c0d,_0x2557c2){_0x352c0d=_0x352c0d-0x0;var _0x134912=_0x30cd[_0x352c0d];return _0x134912;};'use strict';var _=require('lodash');var util=require(_0xd30c('0x0'));var logger=require('../../config/logger')(_0xd30c('0x1'));var moment=require('moment');var BPromise=require(_0xd30c('0x2'));var rp=require(_0xd30c('0x3'));var fs=require('fs');var path=require(_0xd30c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd30c('0x5'));var extensions=require(_0xd30c('0x6'));module['exports']=function(_0x1359ff,_0x5e6cc8){return _0x1359ff[_0xd30c('0x7')](_0xd30c('0x8'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x34a976,_0x2eafbf){extensions[_0xd30c('0x9')](_0x1359ff,_0x34a976);},'afterBulkCreate':function(_0x9f6c0b,_0x944809,_0x5bd308){_0x5bd308();extensions[_0xd30c('0x9')](_0x1359ff,_0x9f6c0b[0x0]);},'afterUpdate':function(_0x2e246f,_0x2ebc25){extensions[_0xd30c('0x9')](_0x1359ff,_0x2e246f);},'afterDestroy':function(_0x70929d,_0x441442){extensions[_0xd30c('0x9')](_0x1359ff,_0x70929d);}}});}; \ No newline at end of file +var _0x172c=['../../config/environment','./interval.attributes','../../components/extensions/rewrite','Interval','tools_intervals','rewrite','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x4e7551,_0x398ee5){var _0x2c2ae8=function(_0x31f000){while(--_0x31f000){_0x4e7551['push'](_0x4e7551['shift']());}};_0x2c2ae8(++_0x398ee5);}(_0x172c,0x95));var _0xc172=function(_0x15b380,_0x1a3c5f){_0x15b380=_0x15b380-0x0;var _0x232c5c=_0x172c[_0x15b380];return _0x232c5c;};'use strict';var _=require(_0xc172('0x0'));var util=require('util');var logger=require(_0xc172('0x1'))('api');var moment=require(_0xc172('0x2'));var BPromise=require(_0xc172('0x3'));var rp=require(_0xc172('0x4'));var fs=require('fs');var path=require(_0xc172('0x5'));var rimraf=require(_0xc172('0x6'));var config=require(_0xc172('0x7'));var attributes=require(_0xc172('0x8'));var extensions=require(_0xc172('0x9'));module['exports']=function(_0x4d5c1b,_0x1634f6){return _0x4d5c1b['define'](_0xc172('0xa'),attributes,{'tableName':_0xc172('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4b67c5,_0x50c1cf){extensions['rewrite'](_0x4d5c1b,_0x4b67c5);},'afterBulkCreate':function(_0x5de4f2,_0xa8ff73,_0x1e7678){_0x1e7678();extensions['rewrite'](_0x4d5c1b,_0x5de4f2[0x0]);},'afterUpdate':function(_0x245302,_0x16c585){extensions[_0xc172('0xc')](_0x4d5c1b,_0x245302);},'afterDestroy':function(_0x242337,_0x7cc741){extensions['rewrite'](_0x4d5c1b,_0x242337);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 17d7710..a6dd9af 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 _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x3a3c17,_0x5b7b7e){var _0xd07f21=function(_0xeaad44){while(--_0xeaad44){_0x3a3c17['push'](_0x3a3c17['shift']());}};_0xd07f21(++_0x5b7b7e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x4e0a03,_0x5eb6b0){var _0x2478fc=function(_0x59afcc){while(--_0x59afcc){_0x4e0a03['push'](_0x4e0a03['shift']());}};_0x2478fc(++_0x5eb6b0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 383fa53..54036e7 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 _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x27a3d8,_0x3574fe){var _0x461902=function(_0x5032f3){while(--_0x5032f3){_0x27a3d8['push'](_0x27a3d8['shift']());}};_0x461902(++_0x3574fe);}(_0xadb5,0xad));var _0x5adb=function(_0x184274,_0x12bb31){_0x184274=_0x184274-0x0;var _0x26d731=_0xadb5[_0x184274];return _0x26d731;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file +var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x3a4434,_0x4f3ad3){var _0x36108d=function(_0x36cdfc){while(--_0x36cdfc){_0x3a4434['push'](_0x3a4434['shift']());}};_0x36108d(++_0x4f3ad3);}(_0xadb5,0xad));var _0x5adb=function(_0x40796f,_0xd3af5c){_0x40796f=_0x40796f-0x0;var _0x507535=_0xadb5[_0x40796f];return _0x507535;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 573febd..1a5e4ad 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 _0xcd75=['customfield_11502','customfield_11503','customfield_11504','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','status','statusCode','json','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','https','../../config/logger','api','summary','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken'];(function(_0x148ceb,_0x7869c7){var _0x5f1e36=function(_0x424f12){while(--_0x424f12){_0x148ceb['push'](_0x148ceb['shift']());}};_0x5f1e36(++_0x7869c7);}(_0xcd75,0xf3));var _0x5cd7=function(_0xba90d6,_0x20f195){_0xba90d6=_0xba90d6-0x0;var _0x57ad36=_0xcd75[_0xba90d6];return _0x57ad36;};'use strict';var BPromise=require(_0x5cd7('0x0'));var https=require(_0x5cd7('0x1'));var logger=require(_0x5cd7('0x2'))(_0x5cd7('0x3'));var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0x1eef33,_0x328e36){var _0x1c22ff={'fields':{'project':{'key':_0x1eef33['key']||'MOTGUI'},'summary':(_0x1eef33[_0x5cd7('0x4')]||'Report')+_0x5cd7('0x5')+_0x1eef33['ip'],'description':_0x1eef33[_0x5cd7('0x6')]||JSON[_0x5cd7('0x7')](_0x1eef33),'issuetype':{'name':_0x1eef33[_0x5cd7('0x8')]||_0x5cd7('0x9')}}};_0x1c22ff[_0x5cd7('0xa')][_0x5cd7('0xb')]=_0x1eef33[_0x5cd7('0xc')];_0x1c22ff[_0x5cd7('0xa')][_0x5cd7('0xd')]=_0x1eef33[_0x5cd7('0xe')];_0x1c22ff[_0x5cd7('0xa')][_0x5cd7('0xf')]=_0x1eef33['newToken'];_0x1c22ff['fields'][_0x5cd7('0x10')]=_0x1eef33['name'];_0x1c22ff[_0x5cd7('0xa')][_0x5cd7('0x11')]=_0x1eef33['reason'];_0x1c22ff[_0x5cd7('0xa')][_0x5cd7('0x12')]=_0x1eef33['ip'];var _0x3a40fd={'host':_0x5cd7('0x13'),'port':0x1bb,'path':_0x5cd7('0x14'),'method':_0x5cd7('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x5cd7('0x16'),'Authorization':_0x5cd7('0x17')+new Buffer(USERNAME+':'+PASSWORD)[_0x5cd7('0x18')](_0x5cd7('0x19'))}};var _0x3269f9=JSON[_0x5cd7('0x7')](_0x1c22ff);var _0x308ff9=https[_0x5cd7('0x1a')](_0x3a40fd,function(_0x4247a6){_0x4247a6[_0x5cd7('0x1b')](_0x5cd7('0x1c'));var _0x2b7e38='';_0x4247a6['on'](_0x5cd7('0x1d'),function(_0x2304cf){_0x2b7e38+=_0x2304cf;});_0x4247a6['on']('end',function(){if(_0x328e36){return _0x328e36[_0x5cd7('0x1e')](_0x4247a6[_0x5cd7('0x1f')])[_0x5cd7('0x20')](JSON['parse'](_0x2b7e38));}});});_0x308ff9['on']('error',function(_0x4c79d5){if(_0x328e36){return _0x328e36['status'](0x1f4)[_0x5cd7('0x20')]({'errors':[{'message':_0x5cd7('0x21'),'type':_0x5cd7('0x22')}]});}});_0x308ff9[_0x5cd7('0x23')](_0x3269f9);_0x308ff9['end']();}exports[_0x5cd7('0x24')]=openIssue;exports[_0x5cd7('0x25')]=function(_0x5a29a9,_0x88a24c){_0x5a29a9[_0x5cd7('0x26')]['ip']=_0x5a29a9[_0x5cd7('0x27')]['x-forwarded-for']||_0x5a29a9[_0x5cd7('0x28')][_0x5cd7('0x29')]||_0x5a29a9[_0x5cd7('0x2a')]['remoteAddress']||_0x5a29a9['connection'][_0x5cd7('0x2a')][_0x5cd7('0x29')];return openIssue(_0x5a29a9[_0x5cd7('0x26')],_0x88a24c);}; \ No newline at end of file +var _0x86fb=['socket','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','stringify','request','setEncoding','status','statusCode','json','parse','error','api.jira','write','end','openIssue','body','headers','x-forwarded-for','connection','remoteAddress'];(function(_0x24b245,_0x1b3508){var _0x56f828=function(_0x21752a){while(--_0x21752a){_0x24b245['push'](_0x24b245['shift']());}};_0x56f828(++_0x1b3508);}(_0x86fb,0x1e1));var _0xb86f=function(_0x51a6c2,_0x4ee8a3){_0x51a6c2=_0x51a6c2-0x0;var _0xa73f3=_0x86fb[_0x51a6c2];return _0xa73f3;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require(_0xb86f('0x0'))(_0xb86f('0x1'));var USERNAME=_0xb86f('0x2');var PASSWORD=_0xb86f('0x3');function openIssue(_0xa5124d,_0x4c8089){var _0xf42064={'fields':{'project':{'key':_0xa5124d[_0xb86f('0x4')]||_0xb86f('0x5')},'summary':(_0xa5124d[_0xb86f('0x6')]||_0xb86f('0x7'))+_0xb86f('0x8')+_0xa5124d['ip'],'description':_0xa5124d['description']||JSON['stringify'](_0xa5124d),'issuetype':{'name':_0xa5124d[_0xb86f('0x9')]||_0xb86f('0xa')}}};_0xf42064[_0xb86f('0xb')][_0xb86f('0xc')]=_0xa5124d[_0xb86f('0xd')];_0xf42064[_0xb86f('0xb')][_0xb86f('0xe')]=_0xa5124d[_0xb86f('0xf')];_0xf42064[_0xb86f('0xb')][_0xb86f('0x10')]=_0xa5124d[_0xb86f('0x11')];_0xf42064[_0xb86f('0xb')][_0xb86f('0x12')]=_0xa5124d[_0xb86f('0x13')];_0xf42064[_0xb86f('0xb')][_0xb86f('0x14')]=_0xa5124d[_0xb86f('0x15')];_0xf42064['fields'][_0xb86f('0x16')]=_0xa5124d['ip'];var _0xe85408={'host':_0xb86f('0x17'),'port':0x1bb,'path':_0xb86f('0x18'),'method':_0xb86f('0x19'),'timeout':0x4e20,'headers':{'Content-Type':_0xb86f('0x1a'),'Authorization':_0xb86f('0x1b')+new Buffer(USERNAME+':'+PASSWORD)[_0xb86f('0x1c')](_0xb86f('0x1d'))}};var _0xcc686d=JSON[_0xb86f('0x1e')](_0xf42064);var _0x5b7fbb=https[_0xb86f('0x1f')](_0xe85408,function(_0x4e3cde){_0x4e3cde[_0xb86f('0x20')]('utf8');var _0x3770b6='';_0x4e3cde['on']('data',function(_0x4e0c14){_0x3770b6+=_0x4e0c14;});_0x4e3cde['on']('end',function(){if(_0x4c8089){return _0x4c8089[_0xb86f('0x21')](_0x4e3cde[_0xb86f('0x22')])[_0xb86f('0x23')](JSON[_0xb86f('0x24')](_0x3770b6));}});});_0x5b7fbb['on'](_0xb86f('0x25'),function(_0x360e67){if(_0x4c8089){return _0x4c8089[_0xb86f('0x21')](0x1f4)[_0xb86f('0x23')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xb86f('0x26')}]});}});_0x5b7fbb[_0xb86f('0x27')](_0xcc686d);_0x5b7fbb[_0xb86f('0x28')]();}exports[_0xb86f('0x29')]=openIssue;exports['send']=function(_0x353456,_0x1d1a95){_0x353456[_0xb86f('0x2a')]['ip']=_0x353456[_0xb86f('0x2b')][_0xb86f('0x2c')]||_0x353456[_0xb86f('0x2d')][_0xb86f('0x2e')]||_0x353456[_0xb86f('0x2f')][_0xb86f('0x2e')]||_0x353456[_0xb86f('0x2d')][_0xb86f('0x2f')][_0xb86f('0x2e')];return openIssue(_0x353456[_0xb86f('0x2a')],_0x1d1a95);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index d7823f6..d2629a0 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 _0x6c76=['express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','multer','util','path'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x6c76,0x184));var _0x66c7=function(_0x3df60c,_0x573229){_0x3df60c=_0x3df60c-0x0;var _0x50202b=_0x6c76[_0x3df60c];return _0x50202b;};'use strict';var multer=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var path=require(_0x66c7('0x2'));var timeout=require('connect-timeout');var express=require(_0x66c7('0x3'));var router=express[_0x66c7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x66c7('0x5'));var config=require(_0x66c7('0x6'));var controller=require('./jscriptyAnswerReport.controller');router[_0x66c7('0x7')]('/',auth[_0x66c7('0x8')](),controller['index']);router[_0x66c7('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x66c7('0x9')]);router[_0x66c7('0x7')](_0x66c7('0xa'),auth['isAuthenticated'](),controller[_0x66c7('0xb')]);router[_0x66c7('0xc')]('/',auth[_0x66c7('0x8')](),controller[_0x66c7('0xd')]);router['put'](_0x66c7('0xa'),auth[_0x66c7('0x8')](),controller[_0x66c7('0xe')]);router[_0x66c7('0xf')](_0x66c7('0xa'),auth[_0x66c7('0x8')](),controller[_0x66c7('0x10')]);module['exports']=router; \ No newline at end of file +var _0xcb91=['get','index','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller'];(function(_0x3e01c9,_0x47d2f2){var _0x5304bb=function(_0x35ec62){while(--_0x35ec62){_0x3e01c9['push'](_0x3e01c9['shift']());}};_0x5304bb(++_0x47d2f2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x374ada,_0x27b3a5){_0x374ada=_0x374ada-0x0;var _0x449ed8=_0xcb91[_0x374ada];return _0x449ed8;};'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');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0xe')](_0x1cb9('0xb'),auth['isAuthenticated'](),controller[_0x1cb9('0xf')]);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index a93f9a1..2488368 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(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x7a54,0x106));var _0x47a5=function(_0x59ea4f,_0x233092){_0x59ea4f=_0x59ea4f-0x0;var _0x520a08=_0x7a54[_0x59ea4f];return _0x520a08;};'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(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x7a54,0x106));var _0x47a5=function(_0x403a90,_0x4c92db){_0x403a90=_0x403a90-0x0;var _0x2d84a8=_0x7a54[_0x403a90];return _0x2d84a8;};'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 0250fb2..fa59055 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 _0x24ca=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','destroy','then','error','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','name','merge','options','includeAll','include','findAll','show','params','length','find','catch','create','update','body','describe','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x4c1388,_0x46bbe5){var _0x6a1068=function(_0x3ee1a2){while(--_0x3ee1a2){_0x4c1388['push'](_0x4c1388['shift']());}};_0x6a1068(++_0x46bbe5);}(_0x24ca,0x8c));var _0xa24c=function(_0x4b4d43,_0x1590f7){_0x4b4d43=_0x4b4d43-0x0;var _0x5706ba=_0x24ca[_0x4b4d43];return _0x5706ba;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa24c('0x1'));var rp=require('request-promise');var moment=require(_0xa24c('0x2'));var BPromise=require(_0xa24c('0x3'));var Mustache=require(_0xa24c('0x4'));var util=require('util');var path=require(_0xa24c('0x5'));var sox=require(_0xa24c('0x6'));var csv=require(_0xa24c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa24c('0x8'));var crypto=require(_0xa24c('0x9'));var jsforce=require(_0xa24c('0xa'));var deskjs=require(_0xa24c('0xb'));var toCsv=require(_0xa24c('0x7'));var querystring=require(_0xa24c('0xc'));var Papa=require('papaparse');var Redis=require(_0xa24c('0xd'));var authService=require(_0xa24c('0xe'));var qs=require(_0xa24c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa24c('0x10'))(_0xa24c('0x11'));var utils=require(_0xa24c('0x12'));var config=require(_0xa24c('0x13'));var licenseUtil=require(_0xa24c('0x14'));var db=require(_0xa24c('0x15'))['db'];function respondWithStatusCode(_0x566313,_0x5bb631){_0x5bb631=_0x5bb631||0xcc;return function(_0x4907f6){if(_0x4907f6){return _0x566313[_0xa24c('0x16')](_0x5bb631);}return _0x566313[_0xa24c('0x17')](_0x5bb631)[_0xa24c('0x18')]();};}function respondWithResult(_0x9fe9e3,_0x4351a8){_0x4351a8=_0x4351a8||0xc8;return function(_0x4971af){if(_0x4971af){return _0x9fe9e3[_0xa24c('0x17')](_0x4351a8)['json'](_0x4971af);}};}function respondWithFilteredResult(_0x493bcb,_0x588acf){return function(_0x2e8dc9){if(_0x2e8dc9){var _0x2a4270=typeof _0x588acf[_0xa24c('0x19')]===_0xa24c('0x1a')&&typeof _0x588acf[_0xa24c('0x1b')]===_0xa24c('0x1a');var _0x2197da=_0x2e8dc9[_0xa24c('0x1c')];var _0x14f0aa=_0x2a4270?0x0:_0x588acf[_0xa24c('0x19')];var _0x1970fc=_0x2a4270?_0x2e8dc9[_0xa24c('0x1c')]:_0x588acf[_0xa24c('0x19')]+_0x588acf[_0xa24c('0x1b')];var _0x5276b6;if(_0x1970fc>=_0x2197da){_0x1970fc=_0x2197da;_0x5276b6=0xc8;}else{_0x5276b6=0xce;}_0x493bcb[_0xa24c('0x17')](_0x5276b6);return _0x493bcb['set'](_0xa24c('0x1d'),_0x14f0aa+'-'+_0x1970fc+'/'+_0x2197da)[_0xa24c('0x1e')](_0x2e8dc9);}return null;};}function patchUpdates(_0x8c3949){return function(_0x37e20e){try{jsonpatch[_0xa24c('0x1f')](_0x37e20e,_0x8c3949,!![]);}catch(_0x416dea){return BPromise[_0xa24c('0x20')](_0x416dea);}return _0x37e20e[_0xa24c('0x21')]();};}function saveUpdates(_0xba710,_0x2ec5ad){return function(_0x2b471a){if(_0x2b471a){return _0x2b471a['update'](_0xba710)['then'](function(_0x10fa25){return _0x10fa25;});}return null;};}function removeEntity(_0xdd32a8,_0x316a68){return function(_0x1a04ff){if(_0x1a04ff){return _0x1a04ff[_0xa24c('0x22')]()[_0xa24c('0x23')](function(){_0xdd32a8[_0xa24c('0x17')](0xcc)[_0xa24c('0x18')]();});}};}function handleEntityNotFound(_0x304d6c,_0x4dc3dc){return function(_0x2290e1){if(!_0x2290e1){_0x304d6c['sendStatus'](0x194);}return _0x2290e1;};}function handleError(_0x1f347b,_0x256fbc){_0x256fbc=_0x256fbc||0x1f4;return function(_0x471421){logger[_0xa24c('0x24')](_0x471421['stack']);if(_0x471421['name']){delete _0x471421['name'];}_0x1f347b['status'](_0x256fbc)[_0xa24c('0x25')](_0x471421);};}exports[_0xa24c('0x26')]=function(_0xab6197,_0x1cdee4){var _0x37cbd3={},_0x5361d4={},_0x5c8113={'count':0x0,'rows':[]};var _0x33c208=_[_0xa24c('0x27')](db[_0xa24c('0x28')][_0xa24c('0x29')],function(_0x4566dc){return{'name':_0x4566dc[_0xa24c('0x2a')],'type':_0x4566dc[_0xa24c('0x2b')][_0xa24c('0x2c')]};});_0x5361d4[_0xa24c('0x2d')]=_[_0xa24c('0x27')](_0x33c208,'name');_0x5361d4[_0xa24c('0x2e')]=_[_0xa24c('0x2f')](_0xab6197['query']);_0x5361d4[_0xa24c('0x30')]=_[_0xa24c('0x31')](_0x5361d4[_0xa24c('0x2d')],_0x5361d4[_0xa24c('0x2e')]);_0x37cbd3[_0xa24c('0x32')]=_[_0xa24c('0x31')](_0x5361d4[_0xa24c('0x2d')],qs[_0xa24c('0x33')](_0xab6197[_0xa24c('0x2e')][_0xa24c('0x33')]));_0x37cbd3['attributes']=_0x37cbd3['attributes']['length']?_0x37cbd3[_0xa24c('0x32')]:_0x5361d4['model'];if(!_0xab6197[_0xa24c('0x2e')][_0xa24c('0x34')](_0xa24c('0x35'))){_0x37cbd3['limit']=qs[_0xa24c('0x1b')](_0xab6197[_0xa24c('0x2e')][_0xa24c('0x1b')]);_0x37cbd3['offset']=qs[_0xa24c('0x19')](_0xab6197[_0xa24c('0x2e')]['offset']);}_0x37cbd3[_0xa24c('0x36')]=qs[_0xa24c('0x37')](_0xab6197[_0xa24c('0x2e')]['sort']);_0x37cbd3[_0xa24c('0x38')]=qs[_0xa24c('0x30')](_[_0xa24c('0x39')](_0xab6197[_0xa24c('0x2e')],_0x5361d4[_0xa24c('0x30')]),_0x33c208);if(_0xab6197['query'][_0xa24c('0x3a')]){_0x37cbd3[_0xa24c('0x38')]=_['merge'](_0x37cbd3[_0xa24c('0x38')],{'$or':_[_0xa24c('0x27')](_0x33c208,function(_0x2417d9){if(_0x2417d9['type']!=='VIRTUAL'){var _0x1f7535={};_0x1f7535[_0x2417d9[_0xa24c('0x3b')]]={'$like':'%'+_0xab6197[_0xa24c('0x2e')][_0xa24c('0x3a')]+'%'};return _0x1f7535;}})});}_0x37cbd3=_[_0xa24c('0x3c')]({},_0x37cbd3,_0xab6197[_0xa24c('0x3d')]);var _0x54ea40={'where':_0x37cbd3[_0xa24c('0x38')]};return db[_0xa24c('0x28')][_0xa24c('0x1c')](_0x54ea40)[_0xa24c('0x23')](function(_0x5f3cd4){_0x5c8113[_0xa24c('0x1c')]=_0x5f3cd4;if(_0xab6197[_0xa24c('0x2e')][_0xa24c('0x3e')]){_0x37cbd3[_0xa24c('0x3f')]=[{'all':!![]}];}return db[_0xa24c('0x28')][_0xa24c('0x40')](_0x37cbd3);})[_0xa24c('0x23')](function(_0x54939b){_0x5c8113['rows']=_0x54939b;return _0x5c8113;})[_0xa24c('0x23')](respondWithFilteredResult(_0x1cdee4,_0x37cbd3))['catch'](handleError(_0x1cdee4,null));};exports[_0xa24c('0x41')]=function(_0x4fae76,_0x32e151){var _0x214627={'raw':!![],'where':{'id':_0x4fae76[_0xa24c('0x42')]['id']}},_0x37372d={};_0x37372d[_0xa24c('0x2d')]=_[_0xa24c('0x2f')](db[_0xa24c('0x28')][_0xa24c('0x29')]);_0x37372d[_0xa24c('0x2e')]=_[_0xa24c('0x2f')](_0x4fae76[_0xa24c('0x2e')]);_0x37372d[_0xa24c('0x30')]=_[_0xa24c('0x31')](_0x37372d[_0xa24c('0x2d')],_0x37372d[_0xa24c('0x2e')]);_0x214627[_0xa24c('0x32')]=_['intersection'](_0x37372d[_0xa24c('0x2d')],qs[_0xa24c('0x33')](_0x4fae76[_0xa24c('0x2e')]['fields']));_0x214627[_0xa24c('0x32')]=_0x214627[_0xa24c('0x32')][_0xa24c('0x43')]?_0x214627[_0xa24c('0x32')]:_0x37372d['model'];if(_0x4fae76[_0xa24c('0x2e')][_0xa24c('0x3e')]){_0x214627[_0xa24c('0x3f')]=[{'all':!![]}];}_0x214627=_[_0xa24c('0x3c')]({},_0x214627,_0x4fae76[_0xa24c('0x3d')]);return db[_0xa24c('0x28')][_0xa24c('0x44')](_0x214627)[_0xa24c('0x23')](handleEntityNotFound(_0x32e151,null))[_0xa24c('0x23')](respondWithResult(_0x32e151,null))[_0xa24c('0x45')](handleError(_0x32e151,null));};exports[_0xa24c('0x46')]=function(_0xeac74f,_0x261c41){return db['JscriptyAnswerReport'][_0xa24c('0x46')](_0xeac74f['body'],{})[_0xa24c('0x23')](respondWithResult(_0x261c41,0xc9))[_0xa24c('0x45')](handleError(_0x261c41,null));};exports[_0xa24c('0x47')]=function(_0x1641b8,_0xd4761e){if(_0x1641b8[_0xa24c('0x48')]['id']){delete _0x1641b8[_0xa24c('0x48')]['id'];}return db[_0xa24c('0x28')][_0xa24c('0x44')]({'where':{'id':_0x1641b8[_0xa24c('0x42')]['id']}})[_0xa24c('0x23')](handleEntityNotFound(_0xd4761e,null))[_0xa24c('0x23')](saveUpdates(_0x1641b8[_0xa24c('0x48')],null))['then'](respondWithResult(_0xd4761e,null))[_0xa24c('0x45')](handleError(_0xd4761e,null));};exports[_0xa24c('0x22')]=function(_0x3875fb,_0x456181){return db['JscriptyAnswerReport'][_0xa24c('0x44')]({'where':{'id':_0x3875fb[_0xa24c('0x42')]['id']}})[_0xa24c('0x23')](handleEntityNotFound(_0x456181,null))['then'](removeEntity(_0x456181,null))['catch'](handleError(_0x456181,null));};exports[_0xa24c('0x49')]=function(_0x1c8980,_0x4992ee){return db[_0xa24c('0x28')][_0xa24c('0x49')]()['then'](respondWithResult(_0x4992ee,null))[_0xa24c('0x45')](handleError(_0x4992ee,null));}; \ No newline at end of file +var _0xc03e=['../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','rows','catch','params','find','create','body','describe','eml-format','fast-json-patch','moment','mustache','util','path','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','api','../../config/utils','../../config/license/util'];(function(_0x5e53a9,_0xda41a7){var _0x365362=function(_0x3e81e7){while(--_0x3e81e7){_0x5e53a9['push'](_0x5e53a9['shift']());}};_0x365362(++_0xda41a7);}(_0xc03e,0x15a));var _0xec03=function(_0x168127,_0x59cea1){_0x168127=_0x168127-0x0;var _0x4c99ad=_0xc03e[_0x168127];return _0x4c99ad;};'use strict';var emlformat=require(_0xec03('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xec03('0x1'));var rp=require('request-promise');var moment=require(_0xec03('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xec03('0x3'));var util=require(_0xec03('0x4'));var path=require(_0xec03('0x5'));var sox=require(_0xec03('0x6'));var csv=require(_0xec03('0x7'));var ejs=require(_0xec03('0x8'));var fs=require('fs');var fs_extra=require(_0xec03('0x9'));var _=require(_0xec03('0xa'));var squel=require(_0xec03('0xb'));var crypto=require('crypto');var jsforce=require(_0xec03('0xc'));var deskjs=require(_0xec03('0xd'));var toCsv=require(_0xec03('0x7'));var querystring=require(_0xec03('0xe'));var Papa=require('papaparse');var Redis=require(_0xec03('0xf'));var authService=require(_0xec03('0x10'));var qs=require(_0xec03('0x11'));var as=require(_0xec03('0x12'));var hardwareService=require(_0xec03('0x13'));var logger=require(_0xec03('0x14'))(_0xec03('0x15'));var utils=require(_0xec03('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xec03('0x17'));var db=require(_0xec03('0x18'))['db'];function respondWithStatusCode(_0x398720,_0x2f65a1){_0x2f65a1=_0x2f65a1||0xcc;return function(_0x9908ef){if(_0x9908ef){return _0x398720[_0xec03('0x19')](_0x2f65a1);}return _0x398720[_0xec03('0x1a')](_0x2f65a1)[_0xec03('0x1b')]();};}function respondWithResult(_0x4ba43a,_0x555447){_0x555447=_0x555447||0xc8;return function(_0x5ca0e2){if(_0x5ca0e2){return _0x4ba43a[_0xec03('0x1a')](_0x555447)[_0xec03('0x1c')](_0x5ca0e2);}};}function respondWithFilteredResult(_0x3501ab,_0x515680){return function(_0x28bb4f){if(_0x28bb4f){var _0xbe85e6=typeof _0x515680[_0xec03('0x1d')]===_0xec03('0x1e')&&typeof _0x515680['limit']===_0xec03('0x1e');var _0x52f6ae=_0x28bb4f[_0xec03('0x1f')];var _0x5e8ae2=_0xbe85e6?0x0:_0x515680[_0xec03('0x1d')];var _0x5b3e04=_0xbe85e6?_0x28bb4f['count']:_0x515680[_0xec03('0x1d')]+_0x515680[_0xec03('0x20')];var _0xefa268;if(_0x5b3e04>=_0x52f6ae){_0x5b3e04=_0x52f6ae;_0xefa268=0xc8;}else{_0xefa268=0xce;}_0x3501ab[_0xec03('0x1a')](_0xefa268);return _0x3501ab['set'](_0xec03('0x21'),_0x5e8ae2+'-'+_0x5b3e04+'/'+_0x52f6ae)['json'](_0x28bb4f);}return null;};}function patchUpdates(_0x16ade3){return function(_0x253910){try{jsonpatch[_0xec03('0x22')](_0x253910,_0x16ade3,!![]);}catch(_0x33a167){return BPromise[_0xec03('0x23')](_0x33a167);}return _0x253910[_0xec03('0x24')]();};}function saveUpdates(_0x3a44df,_0x3b6ddf){return function(_0x5df6cc){if(_0x5df6cc){return _0x5df6cc[_0xec03('0x25')](_0x3a44df)[_0xec03('0x26')](function(_0xa16d53){return _0xa16d53;});}return null;};}function removeEntity(_0x76b813,_0x33de1e){return function(_0x15ef87){if(_0x15ef87){return _0x15ef87['destroy']()[_0xec03('0x26')](function(){_0x76b813[_0xec03('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bfcf6,_0xa5b580){return function(_0x26875e){if(!_0x26875e){_0x2bfcf6[_0xec03('0x19')](0x194);}return _0x26875e;};}function handleError(_0x1c6870,_0x581322){_0x581322=_0x581322||0x1f4;return function(_0x73cc4f){logger[_0xec03('0x27')](_0x73cc4f[_0xec03('0x28')]);if(_0x73cc4f[_0xec03('0x29')]){delete _0x73cc4f[_0xec03('0x29')];}_0x1c6870['status'](_0x581322)[_0xec03('0x2a')](_0x73cc4f);};}exports[_0xec03('0x2b')]=function(_0x49f9ab,_0x530251){var _0x2063ba={},_0x12b5c9={},_0x35a9eb={'count':0x0,'rows':[]};var _0x872f98=_[_0xec03('0x2c')](db[_0xec03('0x2d')][_0xec03('0x2e')],function(_0x28753c){return{'name':_0x28753c['fieldName'],'type':_0x28753c[_0xec03('0x2f')][_0xec03('0x30')]};});_0x12b5c9[_0xec03('0x31')]=_[_0xec03('0x2c')](_0x872f98,_0xec03('0x29'));_0x12b5c9[_0xec03('0x32')]=_[_0xec03('0x33')](_0x49f9ab[_0xec03('0x32')]);_0x12b5c9[_0xec03('0x34')]=_['intersection'](_0x12b5c9['model'],_0x12b5c9['query']);_0x2063ba[_0xec03('0x35')]=_[_0xec03('0x36')](_0x12b5c9[_0xec03('0x31')],qs[_0xec03('0x37')](_0x49f9ab['query']['fields']));_0x2063ba['attributes']=_0x2063ba['attributes'][_0xec03('0x38')]?_0x2063ba[_0xec03('0x35')]:_0x12b5c9[_0xec03('0x31')];if(!_0x49f9ab[_0xec03('0x32')][_0xec03('0x39')](_0xec03('0x3a'))){_0x2063ba[_0xec03('0x20')]=qs[_0xec03('0x20')](_0x49f9ab[_0xec03('0x32')][_0xec03('0x20')]);_0x2063ba[_0xec03('0x1d')]=qs[_0xec03('0x1d')](_0x49f9ab['query'][_0xec03('0x1d')]);}_0x2063ba[_0xec03('0x3b')]=qs[_0xec03('0x3c')](_0x49f9ab['query'][_0xec03('0x3c')]);_0x2063ba[_0xec03('0x3d')]=qs[_0xec03('0x34')](_[_0xec03('0x3e')](_0x49f9ab[_0xec03('0x32')],_0x12b5c9[_0xec03('0x34')]),_0x872f98);if(_0x49f9ab[_0xec03('0x32')][_0xec03('0x3f')]){_0x2063ba[_0xec03('0x3d')]=_[_0xec03('0x40')](_0x2063ba[_0xec03('0x3d')],{'$or':_['map'](_0x872f98,function(_0x25286a){if(_0x25286a[_0xec03('0x2f')]!==_0xec03('0x41')){var _0x3d6d70={};_0x3d6d70[_0x25286a[_0xec03('0x29')]]={'$like':'%'+_0x49f9ab[_0xec03('0x32')][_0xec03('0x3f')]+'%'};return _0x3d6d70;}})});}_0x2063ba=_[_0xec03('0x40')]({},_0x2063ba,_0x49f9ab['options']);var _0x454e91={'where':_0x2063ba['where']};return db['JscriptyAnswerReport'][_0xec03('0x1f')](_0x454e91)['then'](function(_0x548b81){_0x35a9eb[_0xec03('0x1f')]=_0x548b81;if(_0x49f9ab[_0xec03('0x32')]['includeAll']){_0x2063ba[_0xec03('0x42')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x2063ba);})['then'](function(_0x494fec){_0x35a9eb[_0xec03('0x43')]=_0x494fec;return _0x35a9eb;})[_0xec03('0x26')](respondWithFilteredResult(_0x530251,_0x2063ba))[_0xec03('0x44')](handleError(_0x530251,null));};exports['show']=function(_0x1b1aea,_0x3f2522){var _0xe03df3={'raw':!![],'where':{'id':_0x1b1aea[_0xec03('0x45')]['id']}},_0x14a429={};_0x14a429[_0xec03('0x31')]=_[_0xec03('0x33')](db[_0xec03('0x2d')][_0xec03('0x2e')]);_0x14a429['query']=_[_0xec03('0x33')](_0x1b1aea[_0xec03('0x32')]);_0x14a429[_0xec03('0x34')]=_[_0xec03('0x36')](_0x14a429['model'],_0x14a429[_0xec03('0x32')]);_0xe03df3[_0xec03('0x35')]=_[_0xec03('0x36')](_0x14a429[_0xec03('0x31')],qs[_0xec03('0x37')](_0x1b1aea[_0xec03('0x32')]['fields']));_0xe03df3['attributes']=_0xe03df3[_0xec03('0x35')][_0xec03('0x38')]?_0xe03df3[_0xec03('0x35')]:_0x14a429[_0xec03('0x31')];if(_0x1b1aea[_0xec03('0x32')]['includeAll']){_0xe03df3['include']=[{'all':!![]}];}_0xe03df3=_[_0xec03('0x40')]({},_0xe03df3,_0x1b1aea['options']);return db[_0xec03('0x2d')][_0xec03('0x46')](_0xe03df3)[_0xec03('0x26')](handleEntityNotFound(_0x3f2522,null))[_0xec03('0x26')](respondWithResult(_0x3f2522,null))['catch'](handleError(_0x3f2522,null));};exports[_0xec03('0x47')]=function(_0x14a61c,_0x3c7e18){return db[_0xec03('0x2d')]['create'](_0x14a61c[_0xec03('0x48')],{})['then'](respondWithResult(_0x3c7e18,0xc9))[_0xec03('0x44')](handleError(_0x3c7e18,null));};exports[_0xec03('0x25')]=function(_0xdb9a99,_0x1c6b87){if(_0xdb9a99[_0xec03('0x48')]['id']){delete _0xdb9a99[_0xec03('0x48')]['id'];}return db[_0xec03('0x2d')]['find']({'where':{'id':_0xdb9a99[_0xec03('0x45')]['id']}})[_0xec03('0x26')](handleEntityNotFound(_0x1c6b87,null))[_0xec03('0x26')](saveUpdates(_0xdb9a99[_0xec03('0x48')],null))['then'](respondWithResult(_0x1c6b87,null))[_0xec03('0x44')](handleError(_0x1c6b87,null));};exports['destroy']=function(_0xe0e874,_0x3825f9){return db[_0xec03('0x2d')][_0xec03('0x46')]({'where':{'id':_0xe0e874['params']['id']}})[_0xec03('0x26')](handleEntityNotFound(_0x3825f9,null))[_0xec03('0x26')](removeEntity(_0x3825f9,null))[_0xec03('0x44')](handleError(_0x3825f9,null));};exports[_0xec03('0x49')]=function(_0x32a5af,_0x5b1339){return db[_0xec03('0x2d')][_0xec03('0x49')]()[_0xec03('0x26')](respondWithResult(_0x5b1339,null))['catch'](handleError(_0x5b1339,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 9410e9e..0938404 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 _0x29a9=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers'];(function(_0x16db8b,_0xca7d28){var _0x5ba017=function(_0x35b933){while(--_0x35b933){_0x16db8b['push'](_0x16db8b['shift']());}};_0x5ba017(++_0xca7d28);}(_0x29a9,0x1d4));var _0x929a=function(_0x2e78e9,_0x42957c){_0x2e78e9=_0x2e78e9-0x0;var _0x35aad4=_0x29a9[_0x2e78e9];return _0x35aad4;};'use strict';var _=require(_0x929a('0x0'));var util=require(_0x929a('0x1'));var logger=require(_0x929a('0x2'))('api');var moment=require(_0x929a('0x3'));var BPromise=require(_0x929a('0x4'));var rp=require(_0x929a('0x5'));var fs=require('fs');var path=require(_0x929a('0x6'));var rimraf=require('rimraf');var config=require(_0x929a('0x7'));var attributes=require(_0x929a('0x8'));module[_0x929a('0x9')]=function(_0x4c5b86,_0xb698dd){return _0x4c5b86[_0x929a('0xa')](_0x929a('0xb'),attributes,{'tableName':_0x929a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd4ae=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','util','api'];(function(_0x27e811,_0x20137c){var _0x1627fa=function(_0x4498ca){while(--_0x4498ca){_0x27e811['push'](_0x27e811['shift']());}};_0x1627fa(++_0x20137c);}(_0xd4ae,0xf5));var _0xed4a=function(_0x5a4b16,_0x294bb1){_0x5a4b16=_0x5a4b16-0x0;var _0x5236dc=_0xd4ae[_0x5a4b16];return _0x5236dc;};'use strict';var _=require('lodash');var util=require(_0xed4a('0x0'));var logger=require('../../config/logger')(_0xed4a('0x1'));var moment=require(_0xed4a('0x2'));var BPromise=require(_0xed4a('0x3'));var rp=require(_0xed4a('0x4'));var fs=require('fs');var path=require(_0xed4a('0x5'));var rimraf=require(_0xed4a('0x6'));var config=require(_0xed4a('0x7'));var attributes=require(_0xed4a('0x8'));module[_0xed4a('0x9')]=function(_0x544205,_0x4c87df){return _0x544205[_0xed4a('0xa')](_0xed4a('0xb'),attributes,{'tableName':_0xed4a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index b375e28..f6ee7f1 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 _0x5a83=['then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','code','message','error','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x7d3039,_0x63151b){var _0x24031e=function(_0xe3939e){while(--_0xe3939e){_0x7d3039['push'](_0x7d3039['shift']());}};_0x24031e(++_0x63151b);}(_0x5a83,0x8d));var _0x35a8=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x5a83[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x35a8('0x0'));var util=require(_0x35a8('0x1'));var moment=require(_0x35a8('0x2'));var BPromise=require(_0x35a8('0x3'));var rs=require(_0x35a8('0x4'));var fs=require('fs');var Redis=require(_0x35a8('0x5'));var db=require(_0x35a8('0x6'))['db'];var utils=require(_0x35a8('0x7'));var logger=require(_0x35a8('0x8'))(_0x35a8('0x9'));var config=require(_0x35a8('0xa'));var jayson=require(_0x35a8('0xb'));var client=jayson[_0x35a8('0xc')][_0x35a8('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3f52f8,_0x4f8dc7,_0x4e4ab3){return new BPromise(function(_0x415cd7,_0x542f6c){return client[_0x35a8('0xe')](_0x3f52f8,_0x4e4ab3)[_0x35a8('0xf')](function(_0x2da7da){logger[_0x35a8('0x10')](_0x35a8('0x11'),_0x4f8dc7,_0x35a8('0x12'));logger[_0x35a8('0x13')](_0x35a8('0x14'),_0x4f8dc7,_0x35a8('0x12'),JSON['stringify'](_0x2da7da));if(_0x2da7da['error']){if(_0x2da7da['error'][_0x35a8('0x15')]===0x1f4){logger['error'](_0x35a8('0x11'),_0x4f8dc7,_0x2da7da['error'][_0x35a8('0x16')]);return _0x542f6c(_0x2da7da[_0x35a8('0x17')]['message']);}logger['error'](_0x35a8('0x11'),_0x4f8dc7,_0x2da7da[_0x35a8('0x17')][_0x35a8('0x16')]);return _0x415cd7(_0x2da7da[_0x35a8('0x17')][_0x35a8('0x16')]);}else{logger[_0x35a8('0x10')](_0x35a8('0x11'),_0x4f8dc7,_0x35a8('0x12'));_0x415cd7(_0x2da7da[_0x35a8('0x18')][_0x35a8('0x16')]);}})[_0x35a8('0x19')](function(_0xa29350){logger['error'](_0x35a8('0x11'),_0x4f8dc7,_0xa29350);_0x542f6c(_0xa29350);});});} \ No newline at end of file +var _0x642d=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyAnswerReport,\x20%s,\x20%s','result','catch','lodash'];(function(_0x31e584,_0x4d9f7f){var _0x5686d0=function(_0x1f9e99){while(--_0x1f9e99){_0x31e584['push'](_0x31e584['shift']());}};_0x5686d0(++_0x4d9f7f);}(_0x642d,0x185));var _0xd642=function(_0x3e18cd,_0x4740b7){_0x3e18cd=_0x3e18cd-0x0;var _0x528b57=_0x642d[_0x3e18cd];return _0x528b57;};'use strict';var _=require(_0xd642('0x0'));var util=require(_0xd642('0x1'));var moment=require(_0xd642('0x2'));var BPromise=require(_0xd642('0x3'));var rs=require(_0xd642('0x4'));var fs=require('fs');var Redis=require(_0xd642('0x5'));var db=require(_0xd642('0x6'))['db'];var utils=require(_0xd642('0x7'));var logger=require(_0xd642('0x8'))(_0xd642('0x9'));var config=require(_0xd642('0xa'));var jayson=require(_0xd642('0xb'));var client=jayson[_0xd642('0xc')][_0xd642('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x270c40,_0xedfb06,_0x4bfe43){return new BPromise(function(_0x40be6e,_0x2949f2){return client['request'](_0x270c40,_0x4bfe43)[_0xd642('0xe')](function(_0x27f697){logger[_0xd642('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0xedfb06,_0xd642('0x10'));logger[_0xd642('0x11')](_0xd642('0x12'),_0xedfb06,_0xd642('0x10'),JSON[_0xd642('0x13')](_0x27f697));if(_0x27f697[_0xd642('0x14')]){if(_0x27f697[_0xd642('0x14')][_0xd642('0x15')]===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0xedfb06,_0x27f697['error'][_0xd642('0x16')]);return _0x2949f2(_0x27f697[_0xd642('0x14')][_0xd642('0x16')]);}logger[_0xd642('0x14')](_0xd642('0x17'),_0xedfb06,_0x27f697['error']['message']);return _0x40be6e(_0x27f697[_0xd642('0x14')][_0xd642('0x16')]);}else{logger[_0xd642('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0xedfb06,_0xd642('0x10'));_0x40be6e(_0x27f697[_0xd642('0x18')][_0xd642('0x16')]);}})[_0xd642('0x19')](function(_0x13867f){logger[_0xd642('0x14')](_0xd642('0x17'),_0xedfb06,_0x13867f);_0x2949f2(_0x13867f);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 0cb5438..70d8780 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 _0xb333=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','get','/:id','getSessions','/:id/answers','getAnswers','/:id/summary','getSummary','post','create','/:id/clone','clone','put','update','delete','destroy','multer'];(function(_0x1beeac,_0xfe10cc){var _0x12dcb9=function(_0x1ba4b4){while(--_0x1ba4b4){_0x1beeac['push'](_0x1beeac['shift']());}};_0x12dcb9(++_0xfe10cc);}(_0xb333,0x1f3));var _0x3b33=function(_0x303748,_0x4774fb){_0x303748=_0x303748-0x0;var _0x3a5700=_0xb333[_0x303748];return _0x3a5700;};'use strict';var multer=require(_0x3b33('0x0'));var util=require(_0x3b33('0x1'));var path=require(_0x3b33('0x2'));var timeout=require(_0x3b33('0x3'));var express=require('express');var router=express[_0x3b33('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3b33('0x5'));var interaction=require(_0x3b33('0x6'));var config=require(_0x3b33('0x7'));var controller=require(_0x3b33('0x8'));router['get']('/',auth[_0x3b33('0x9')](),controller['index']);router[_0x3b33('0xa')](_0x3b33('0xb'),auth[_0x3b33('0x9')](),controller['show']);router[_0x3b33('0xa')]('/:id/sessions',auth[_0x3b33('0x9')](),controller[_0x3b33('0xc')]);router[_0x3b33('0xa')](_0x3b33('0xd'),auth[_0x3b33('0x9')](),controller[_0x3b33('0xe')]);router[_0x3b33('0xa')](_0x3b33('0xf'),auth[_0x3b33('0x9')](),timeout('30s'),controller[_0x3b33('0x10')]);router[_0x3b33('0x11')]('/',auth['isAuthenticated'](),controller[_0x3b33('0x12')]);router['post'](_0x3b33('0x13'),auth['isAuthenticated'](),controller[_0x3b33('0x14')]);router[_0x3b33('0x15')](_0x3b33('0xb'),auth[_0x3b33('0x9')](),controller[_0x3b33('0x16')]);router[_0x3b33('0x17')]('/:id',auth[_0x3b33('0x9')](),controller[_0x3b33('0x18')]);module['exports']=router; \ No newline at end of file +var _0xd733=['show','getSessions','/:id/answers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put','update','delete','destroy','exports','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id'];(function(_0x2bfd5f,_0x2e742d){var _0x301b5a=function(_0x8db987){while(--_0x8db987){_0x2bfd5f['push'](_0x2bfd5f['shift']());}};_0x301b5a(++_0x2e742d);}(_0xd733,0xdf));var _0x3d73=function(_0x1d39f6,_0x146f4a){_0x1d39f6=_0x1d39f6-0x0;var _0x3dbd7a=_0xd733[_0x1d39f6];return _0x3dbd7a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3d73('0x0'));var timeout=require(_0x3d73('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3d73('0x2'));var auth=require(_0x3d73('0x3'));var interaction=require(_0x3d73('0x4'));var config=require(_0x3d73('0x5'));var controller=require(_0x3d73('0x6'));router[_0x3d73('0x7')]('/',auth[_0x3d73('0x8')](),controller[_0x3d73('0x9')]);router['get'](_0x3d73('0xa'),auth['isAuthenticated'](),controller[_0x3d73('0xb')]);router[_0x3d73('0x7')]('/:id/sessions',auth['isAuthenticated'](),controller[_0x3d73('0xc')]);router[_0x3d73('0x7')](_0x3d73('0xd'),auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x3d73('0xe'),auth[_0x3d73('0x8')](),timeout(_0x3d73('0xf')),controller[_0x3d73('0x10')]);router[_0x3d73('0x11')]('/',auth[_0x3d73('0x8')](),controller[_0x3d73('0x12')]);router[_0x3d73('0x11')](_0x3d73('0x13'),auth['isAuthenticated'](),controller[_0x3d73('0x14')]);router[_0x3d73('0x15')](_0x3d73('0xa'),auth[_0x3d73('0x8')](),controller[_0x3d73('0x16')]);router[_0x3d73('0x17')](_0x3d73('0xa'),auth[_0x3d73('0x8')](),controller[_0x3d73('0x18')]);module[_0x3d73('0x19')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 514af2f..a92c49d 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 _0x249c=['long','isObjectLike','setDataValue','isString','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','exports','STRING','name','TEXT'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x249c,0x18a));var _0xc249=function(_0x27d8bc,_0x19e010){_0x27d8bc=_0x27d8bc-0x0;var _0x4b04cb=_0x249c[_0x27d8bc];return _0x4b04cb;};'use strict';var Sequelize=require(_0xc249('0x0'));var _=require(_0xc249('0x1'));var util=require('util');module[_0xc249('0x2')]={'name':{'type':Sequelize[_0xc249('0x3')],'unique':_0xc249('0x4')},'description':{'type':Sequelize[_0xc249('0x3')]},'formData':{'type':Sequelize[_0xc249('0x5')](_0xc249('0x6')),'set':function(_0x3e78ef){if(_[_0xc249('0x7')](_0x3e78ef)){this[_0xc249('0x8')]('formData',JSON['stringify'](_0x3e78ef));}else if(_[_0xc249('0x9')](_0x3e78ef)){this[_0xc249('0x8')](_0xc249('0xa'),_0x3e78ef);}else{this[_0xc249('0x8')](_0xc249('0xa'),util[_0xc249('0xb')](_0xc249('0xc'),this[_0xc249('0xd')](_0xc249('0x4'))||'',this[_0xc249('0xd')](_0xc249('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xc249('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xc249('0xf')],'defaultValue':![]}}; \ No newline at end of file +var _0x9e43=['lodash','util','exports','STRING','name','long','formData','stringify','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize'];(function(_0x219ed8,_0x6218dd){var _0x221f90=function(_0x1a63c7){while(--_0x1a63c7){_0x219ed8['push'](_0x219ed8['shift']());}};_0x221f90(++_0x6218dd);}(_0x9e43,0x1ef));var _0x39e4=function(_0x2e7c96,_0x27804d){_0x2e7c96=_0x2e7c96-0x0;var _0x36008e=_0x9e43[_0x2e7c96];return _0x36008e;};'use strict';var Sequelize=require(_0x39e4('0x0'));var _=require(_0x39e4('0x1'));var util=require(_0x39e4('0x2'));module[_0x39e4('0x3')]={'name':{'type':Sequelize[_0x39e4('0x4')],'unique':_0x39e4('0x5')},'description':{'type':Sequelize[_0x39e4('0x4')]},'formData':{'type':Sequelize['TEXT'](_0x39e4('0x6')),'set':function(_0x2f077b){if(_['isObjectLike'](_0x2f077b)){this['setDataValue'](_0x39e4('0x7'),JSON[_0x39e4('0x8')](_0x2f077b));}else if(_[_0x39e4('0x9')](_0x2f077b)){this[_0x39e4('0xa')](_0x39e4('0x7'),_0x2f077b);}else{this['setDataValue'](_0x39e4('0x7'),util[_0x39e4('0xb')](_0x39e4('0xc'),this[_0x39e4('0xd')](_0x39e4('0x5'))||'',this[_0x39e4('0xd')](_0x39e4('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x39e4('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x39e4('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 643332b..fd28bbf 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 _0x5732=['api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','destroy','get','UserProfileResource','then','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','type','includeAll','include','catch','show','params','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','UserProfileSection','autoAssociation','clone','omit','createdAt','updatedAt','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','JscriptySessionReport','hasOwnProperty','findAll','getAnswers','findOne','ProjectId','JscriptyAnswerReport','rows','number','fromCharCode','indexOf','toString','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','answer','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3f00db,_0x19e867){var _0x52128b=function(_0x48dfc5){while(--_0x48dfc5){_0x3f00db['push'](_0x3f00db['shift']());}};_0x52128b(++_0x19e867);}(_0x5732,0xdc));var _0x2573=function(_0x2496df,_0x420311){_0x2496df=_0x2496df-0x0;var _0x3c7267=_0x5732[_0x2496df];return _0x3c7267;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2573('0x0'));var zipdir=require(_0x2573('0x1'));var jsonpatch=require(_0x2573('0x2'));var rp=require('request-promise');var moment=require(_0x2573('0x3'));var BPromise=require(_0x2573('0x4'));var Mustache=require(_0x2573('0x5'));var util=require(_0x2573('0x6'));var path=require(_0x2573('0x7'));var sox=require(_0x2573('0x8'));var csv=require(_0x2573('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2573('0xa'));var crypto=require(_0x2573('0xb'));var jsforce=require(_0x2573('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2573('0xd'));var Papa=require('papaparse');var Redis=require(_0x2573('0xe'));var authService=require(_0x2573('0xf'));var qs=require(_0x2573('0x10'));var as=require(_0x2573('0x11'));var hardwareService=require(_0x2573('0x12'));var logger=require(_0x2573('0x13'))(_0x2573('0x14'));var utils=require(_0x2573('0x15'));var config=require(_0x2573('0x16'));var licenseUtil=require(_0x2573('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32ac79,_0x52e272){_0x52e272=_0x52e272||0xcc;return function(_0x3372db){if(_0x3372db){return _0x32ac79[_0x2573('0x18')](_0x52e272);}return _0x32ac79['status'](_0x52e272)[_0x2573('0x19')]();};}function respondWithResult(_0x33a127,_0x5bd077){_0x5bd077=_0x5bd077||0xc8;return function(_0x734b07){if(_0x734b07){return _0x33a127[_0x2573('0x1a')](_0x5bd077)[_0x2573('0x1b')](_0x734b07);}};}function respondWithFilteredResult(_0x472f97,_0x5e3ee2){return function(_0x530f01){if(_0x530f01){var _0x382a3d=typeof _0x5e3ee2['offset']===_0x2573('0x1c')&&typeof _0x5e3ee2[_0x2573('0x1d')]==='undefined';var _0x4a5f6f=_0x530f01[_0x2573('0x1e')];var _0xb9e0c5=_0x382a3d?0x0:_0x5e3ee2[_0x2573('0x1f')];var _0x4838da=_0x382a3d?_0x530f01[_0x2573('0x1e')]:_0x5e3ee2[_0x2573('0x1f')]+_0x5e3ee2[_0x2573('0x1d')];var _0x4089b8;if(_0x4838da>=_0x4a5f6f){_0x4838da=_0x4a5f6f;_0x4089b8=0xc8;}else{_0x4089b8=0xce;}_0x472f97[_0x2573('0x1a')](_0x4089b8);return _0x472f97[_0x2573('0x20')](_0x2573('0x21'),_0xb9e0c5+'-'+_0x4838da+'/'+_0x4a5f6f)['json'](_0x530f01);}return null;};}function patchUpdates(_0x46bde2){return function(_0x408db6){try{jsonpatch[_0x2573('0x22')](_0x408db6,_0x46bde2,!![]);}catch(_0x48a4bc){return BPromise['reject'](_0x48a4bc);}return _0x408db6['save']();};}function saveUpdates(_0x713772,_0x23d838){return function(_0x11e47c){if(_0x11e47c){return _0x11e47c[_0x2573('0x23')](_0x713772)['then'](function(_0x13f67d){return _0x13f67d;});}return null;};}function removeEntity(_0x17adc1,_0x360c1b){return function(_0x2e3b22){if(_0x2e3b22){return _0x2e3b22[_0x2573('0x24')]()['then'](function(){var _0x22b43d=_0x2e3b22[_0x2573('0x25')]({'plain':!![]});var _0x30dda3='Projects';return db[_0x2573('0x26')][_0x2573('0x24')]({'where':{'type':_0x30dda3,'resourceId':_0x22b43d['id']}})[_0x2573('0x27')](function(){return _0x2e3b22;});})[_0x2573('0x27')](function(){_0x17adc1[_0x2573('0x1a')](0xcc)[_0x2573('0x19')]();});}};}function handleEntityNotFound(_0x2a9a2b,_0x4512e2){return function(_0x31e57e){if(!_0x31e57e){_0x2a9a2b['sendStatus'](0x194);}return _0x31e57e;};}function handleError(_0x7e68a3,_0x2d03f9){_0x2d03f9=_0x2d03f9||0x1f4;return function(_0x437c32){logger[_0x2573('0x28')](_0x437c32[_0x2573('0x29')]);if(_0x437c32[_0x2573('0x2a')]){delete _0x437c32[_0x2573('0x2a')];}_0x7e68a3['status'](_0x2d03f9)[_0x2573('0x2b')](_0x437c32);};}exports[_0x2573('0x2c')]=function(_0x249902,_0x1182af){var _0x237aa8={},_0x4b28f1={},_0x219ee6={'count':0x0,'rows':[]};var _0x5c1912=_[_0x2573('0x2d')](db[_0x2573('0x2e')][_0x2573('0x2f')],function(_0x255508){return{'name':_0x255508[_0x2573('0x30')],'type':_0x255508['type']['key']};});_0x4b28f1[_0x2573('0x31')]=_[_0x2573('0x2d')](_0x5c1912,_0x2573('0x2a'));_0x4b28f1['query']=_[_0x2573('0x32')](_0x249902[_0x2573('0x33')]);_0x4b28f1[_0x2573('0x34')]=_[_0x2573('0x35')](_0x4b28f1[_0x2573('0x31')],_0x4b28f1[_0x2573('0x33')]);_0x237aa8[_0x2573('0x36')]=_['intersection'](_0x4b28f1[_0x2573('0x31')],qs[_0x2573('0x37')](_0x249902['query'][_0x2573('0x37')]));_0x237aa8[_0x2573('0x36')]=_0x237aa8[_0x2573('0x36')][_0x2573('0x38')]?_0x237aa8[_0x2573('0x36')]:_0x4b28f1[_0x2573('0x31')];if(!_0x249902[_0x2573('0x33')]['hasOwnProperty'](_0x2573('0x39'))){_0x237aa8['limit']=qs['limit'](_0x249902[_0x2573('0x33')][_0x2573('0x1d')]);_0x237aa8[_0x2573('0x1f')]=qs[_0x2573('0x1f')](_0x249902[_0x2573('0x33')][_0x2573('0x1f')]);}_0x237aa8[_0x2573('0x3a')]=qs['sort'](_0x249902[_0x2573('0x33')][_0x2573('0x3b')]);_0x237aa8['where']=qs[_0x2573('0x34')](_[_0x2573('0x3c')](_0x249902[_0x2573('0x33')],_0x4b28f1[_0x2573('0x34')]),_0x5c1912);if(_0x249902[_0x2573('0x33')][_0x2573('0x3d')]){_0x237aa8[_0x2573('0x3e')]=_['merge'](_0x237aa8[_0x2573('0x3e')],{'$or':_[_0x2573('0x2d')](_0x5c1912,function(_0x1bf255){if(_0x1bf255[_0x2573('0x3f')]!=='VIRTUAL'){var _0xb59ca7={};_0xb59ca7[_0x1bf255[_0x2573('0x2a')]]={'$like':'%'+_0x249902[_0x2573('0x33')][_0x2573('0x3d')]+'%'};return _0xb59ca7;}})});}_0x237aa8=_['merge']({},_0x237aa8,_0x249902['options']);var _0x38f710={'where':_0x237aa8[_0x2573('0x3e')]};return db[_0x2573('0x2e')][_0x2573('0x1e')](_0x38f710)[_0x2573('0x27')](function(_0x4e9448){_0x219ee6[_0x2573('0x1e')]=_0x4e9448;if(_0x249902['query'][_0x2573('0x40')]){_0x237aa8[_0x2573('0x41')]=[{'all':!![]}];}return db[_0x2573('0x2e')]['findAll'](_0x237aa8);})[_0x2573('0x27')](function(_0x1e0985){_0x219ee6['rows']=_0x1e0985;return _0x219ee6;})[_0x2573('0x27')](respondWithFilteredResult(_0x1182af,_0x237aa8))[_0x2573('0x42')](handleError(_0x1182af,null));};exports[_0x2573('0x43')]=function(_0x19e6a8,_0x1ca1b5){var _0x607307={'raw':![],'where':{'id':_0x19e6a8[_0x2573('0x44')]['id']}},_0x4344fd={};_0x4344fd[_0x2573('0x31')]=_[_0x2573('0x32')](db[_0x2573('0x2e')][_0x2573('0x2f')]);_0x4344fd[_0x2573('0x33')]=_[_0x2573('0x32')](_0x19e6a8[_0x2573('0x33')]);_0x4344fd[_0x2573('0x34')]=_['intersection'](_0x4344fd[_0x2573('0x31')],_0x4344fd[_0x2573('0x33')]);_0x607307[_0x2573('0x36')]=_[_0x2573('0x35')](_0x4344fd[_0x2573('0x31')],qs['fields'](_0x19e6a8['query'][_0x2573('0x37')]));_0x607307[_0x2573('0x36')]=_0x607307[_0x2573('0x36')][_0x2573('0x38')]?_0x607307[_0x2573('0x36')]:_0x4344fd['model'];if(_0x19e6a8[_0x2573('0x33')][_0x2573('0x40')]){_0x607307[_0x2573('0x41')]=[{'all':!![]}];}_0x607307=_[_0x2573('0x45')]({},_0x607307,_0x19e6a8[_0x2573('0x46')]);return db['JscriptyProject'][_0x2573('0x47')](_0x607307)[_0x2573('0x27')](handleEntityNotFound(_0x1ca1b5,null))[_0x2573('0x27')](respondWithResult(_0x1ca1b5,null))[_0x2573('0x42')](handleError(_0x1ca1b5,null));};exports[_0x2573('0x48')]=function(_0x16110a,_0x3a3a35){return db['JscriptyProject'][_0x2573('0x48')](_0x16110a[_0x2573('0x49')],{})[_0x2573('0x27')](function(_0x45d4e3){var _0x219c87=_0x16110a['user']['get']({'plain':!![]});if(!_0x219c87)throw new Error(_0x2573('0x4a'));if(_0x219c87[_0x2573('0x4b')]==='user'){var _0xc485f4=_0x45d4e3[_0x2573('0x25')]({'plain':!![]});var _0x32033c=_0x2573('0x4c');return db[_0x2573('0x4d')][_0x2573('0x47')]({'where':{'name':_0x32033c,'userProfileId':_0x219c87['userProfileId']},'raw':!![]})['then'](function(_0x1903e9){if(_0x1903e9&&_0x1903e9[_0x2573('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0xc485f4[_0x2573('0x2a')],'resourceId':_0xc485f4['id'],'type':_0x1903e9[_0x2573('0x2a')],'sectionId':_0x1903e9['id']},{})[_0x2573('0x27')](function(){return _0x45d4e3;});}else{return _0x45d4e3;}})['catch'](function(_0x3e1efd){logger[_0x2573('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e1efd);throw _0x3e1efd;});}return _0x45d4e3;})[_0x2573('0x27')](respondWithResult(_0x3a3a35,0xc9))[_0x2573('0x42')](handleError(_0x3a3a35,null));};exports[_0x2573('0x4f')]=function(_0x400864,_0x3a29f3){var _0x14b1e3={'where':{'id':_0x400864[_0x2573('0x44')]['id']}},_0x5394fb={};_0x5394fb['model']=_[_0x2573('0x32')](db[_0x2573('0x2e')]['rawAttributes']);_0x14b1e3[_0x2573('0x36')]=_[_0x2573('0x35')](_0x5394fb[_0x2573('0x31')],qs[_0x2573('0x37')](_0x400864['query'][_0x2573('0x37')]));_0x14b1e3[_0x2573('0x36')]=_0x14b1e3[_0x2573('0x36')][_0x2573('0x38')]?_0x14b1e3[_0x2573('0x36')]:_0x5394fb[_0x2573('0x31')];if(_0x400864['query'][_0x2573('0x40')]){_0x14b1e3['include']=[{'all':!![]}];}_0x14b1e3=_[_0x2573('0x45')]({},_0x14b1e3,_0x400864[_0x2573('0x46')]);return db[_0x2573('0x2e')][_0x2573('0x47')](_0x14b1e3)['then'](handleEntityNotFound(_0x3a29f3,null))[_0x2573('0x27')](function(_0x56a361){if(_0x56a361){var _0x58394b=_0x56a361[_0x2573('0x25')]({'plain':!![]});_0x58394b=qs[_0x2573('0x50')](_0x58394b,['id',_0x2573('0x51'),_0x2573('0x52')]);_0x400864[_0x2573('0x49')]=_['omit'](_0x400864[_0x2573('0x49')],['id',_0x2573('0x51'),_0x2573('0x52')]);return db['JscriptyProject'][_0x2573('0x48')](_['merge'](_0x58394b,_0x400864[_0x2573('0x49')]),{'include':_0x400864[_0x2573('0x33')][_0x2573('0x40')]?[{'all':!![]}]:undefined})[_0x2573('0x27')](function(_0x3a9f99){var _0xafe283=_0x400864[_0x2573('0x53')][_0x2573('0x25')]({'plain':!![]});if(!_0xafe283)throw new Error(_0x2573('0x4a'));if(_0xafe283['role']===_0x2573('0x53')){var _0x4e4508=_0x3a9f99[_0x2573('0x25')]({'plain':!![]});var _0x3500f8=_0x2573('0x4c');return db[_0x2573('0x4d')][_0x2573('0x47')]({'where':{'name':_0x3500f8,'userProfileId':_0xafe283[_0x2573('0x54')]},'raw':!![]})[_0x2573('0x27')](function(_0xb8cba6){if(_0xb8cba6&&_0xb8cba6[_0x2573('0x4e')]===0x0){return db[_0x2573('0x26')][_0x2573('0x48')]({'name':_0x4e4508[_0x2573('0x2a')],'resourceId':_0x4e4508['id'],'type':_0xb8cba6['name'],'sectionId':_0xb8cba6['id']},{})[_0x2573('0x27')](function(){return _0x3a9f99;});}else{return _0x3a9f99;}})[_0x2573('0x42')](function(_0x22af69){logger[_0x2573('0x28')](_0x2573('0x55'),_0x22af69);throw _0x22af69;});}return _0x3a9f99;});}})[_0x2573('0x27')](respondWithResult(_0x3a29f3,0xc9))[_0x2573('0x42')](handleError(_0x3a29f3,null));};exports[_0x2573('0x23')]=function(_0x3415ac,_0x4c9f92){if(_0x3415ac[_0x2573('0x49')]['id']){delete _0x3415ac['body']['id'];}return db['JscriptyProject'][_0x2573('0x47')]({'where':{'id':_0x3415ac[_0x2573('0x44')]['id']}})[_0x2573('0x27')](handleEntityNotFound(_0x4c9f92,null))[_0x2573('0x27')](saveUpdates(_0x3415ac['body'],null))[_0x2573('0x27')](respondWithResult(_0x4c9f92,null))[_0x2573('0x42')](handleError(_0x4c9f92,null));};exports[_0x2573('0x24')]=function(_0x43f346,_0x16d003){return db[_0x2573('0x2e')][_0x2573('0x47')]({'where':{'id':_0x43f346[_0x2573('0x44')]['id']}})['then'](handleEntityNotFound(_0x16d003,null))[_0x2573('0x27')](removeEntity(_0x16d003,null))[_0x2573('0x42')](handleError(_0x16d003,null));};exports[_0x2573('0x56')]=function(_0x129d5d,_0x1f1aaf,_0x5a5423){var _0x38bf68={'raw':!![],'where':{}};var _0x3f296d={};var _0x1810b3={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x129d5d['params']['id']}})[_0x2573('0x27')](handleEntityNotFound(_0x1f1aaf,null))[_0x2573('0x27')](function(_0x4feff7){if(_0x4feff7){_0x3f296d[_0x2573('0x31')]=_[_0x2573('0x32')](db[_0x2573('0x57')][_0x2573('0x2f')]);_0x3f296d[_0x2573('0x33')]=_['keys'](_0x129d5d['query']);_0x3f296d[_0x2573('0x34')]=_[_0x2573('0x35')](_0x3f296d[_0x2573('0x31')],_0x3f296d[_0x2573('0x33')]);_0x38bf68[_0x2573('0x36')]=_[_0x2573('0x35')](_0x3f296d[_0x2573('0x31')],qs[_0x2573('0x37')](_0x129d5d[_0x2573('0x33')]['fields']));_0x38bf68[_0x2573('0x36')]=_0x38bf68['attributes'][_0x2573('0x38')]?_0x38bf68[_0x2573('0x36')]:_0x3f296d[_0x2573('0x31')];if(!_0x129d5d[_0x2573('0x33')][_0x2573('0x58')](_0x2573('0x39'))){_0x38bf68[_0x2573('0x1d')]=qs[_0x2573('0x1d')](_0x129d5d[_0x2573('0x33')][_0x2573('0x1d')]);_0x38bf68[_0x2573('0x1f')]=qs[_0x2573('0x1f')](_0x129d5d[_0x2573('0x33')][_0x2573('0x1f')]);}_0x38bf68[_0x2573('0x3a')]=qs[_0x2573('0x3b')](_0x129d5d[_0x2573('0x33')][_0x2573('0x3b')]);_0x38bf68[_0x2573('0x3e')]=qs[_0x2573('0x34')](_[_0x2573('0x3c')](_0x129d5d[_0x2573('0x33')],_0x3f296d[_0x2573('0x34')]));_0x38bf68[_0x2573('0x3e')]['ProjectId']=_0x4feff7['id'];if(_0x129d5d['query'][_0x2573('0x3d')]){_0x38bf68[_0x2573('0x3e')]=_[_0x2573('0x45')](_0x38bf68[_0x2573('0x3e')],{'$or':_[_0x2573('0x2d')](_0x38bf68['attributes'],function(_0x206f2b){var _0x5b1ae1={};_0x5b1ae1[_0x206f2b]={'$like':'%'+_0x129d5d[_0x2573('0x33')][_0x2573('0x3d')]+'%'};return _0x5b1ae1;})});}_0x38bf68=_[_0x2573('0x45')]({},_0x38bf68,_0x129d5d[_0x2573('0x46')]);return db[_0x2573('0x57')][_0x2573('0x1e')]({'where':_0x38bf68['where']})[_0x2573('0x27')](function(_0x507533){_0x1810b3[_0x2573('0x1e')]=_0x507533;if(_0x129d5d['query'][_0x2573('0x40')]){_0x38bf68[_0x2573('0x41')]=[{'all':!![]}];}return db[_0x2573('0x57')][_0x2573('0x59')](_0x38bf68);})[_0x2573('0x27')](function(_0x306c6f){_0x1810b3['rows']=_0x306c6f;return _0x1810b3;});}})[_0x2573('0x27')](respondWithFilteredResult(_0x1f1aaf,_0x38bf68))['catch'](handleError(_0x1f1aaf,null));};exports[_0x2573('0x5a')]=function(_0x2d8330,_0x5be73d,_0x550d5b){var _0x2db31d={'raw':!![],'where':{}};var _0x4326b0={};var _0x490f70={'count':0x0,'rows':[]};return db[_0x2573('0x2e')][_0x2573('0x5b')]({'where':{'id':_0x2d8330[_0x2573('0x44')]['id']}})[_0x2573('0x27')](handleEntityNotFound(_0x5be73d,null))['then'](function(_0x4b800d){if(_0x4b800d){_0x4326b0[_0x2573('0x31')]=_[_0x2573('0x32')](db['JscriptyAnswerReport'][_0x2573('0x2f')]);_0x4326b0['query']=_[_0x2573('0x32')](_0x2d8330[_0x2573('0x33')]);_0x4326b0[_0x2573('0x34')]=_[_0x2573('0x35')](_0x4326b0[_0x2573('0x31')],_0x4326b0['query']);_0x2db31d['attributes']=_[_0x2573('0x35')](_0x4326b0['model'],qs[_0x2573('0x37')](_0x2d8330[_0x2573('0x33')][_0x2573('0x37')]));_0x2db31d['attributes']=_0x2db31d[_0x2573('0x36')][_0x2573('0x38')]?_0x2db31d[_0x2573('0x36')]:_0x4326b0['model'];if(!_0x2d8330[_0x2573('0x33')][_0x2573('0x58')](_0x2573('0x39'))){_0x2db31d[_0x2573('0x1d')]=qs[_0x2573('0x1d')](_0x2d8330[_0x2573('0x33')]['limit']);_0x2db31d[_0x2573('0x1f')]=qs[_0x2573('0x1f')](_0x2d8330[_0x2573('0x33')]['offset']);}_0x2db31d['order']=qs[_0x2573('0x3b')](_0x2d8330['query'][_0x2573('0x3b')]);_0x2db31d[_0x2573('0x3e')]=qs['filters'](_['pick'](_0x2d8330[_0x2573('0x33')],_0x4326b0[_0x2573('0x34')]));_0x2db31d[_0x2573('0x3e')][_0x2573('0x5c')]=_0x4b800d['id'];if(_0x2d8330[_0x2573('0x33')][_0x2573('0x3d')]){_0x2db31d[_0x2573('0x3e')]=_[_0x2573('0x45')](_0x2db31d[_0x2573('0x3e')],{'$or':_[_0x2573('0x2d')](_0x2db31d[_0x2573('0x36')],function(_0x179d33){var _0x4998eb={};_0x4998eb[_0x179d33]={'$like':'%'+_0x2d8330[_0x2573('0x33')][_0x2573('0x3d')]+'%'};return _0x4998eb;})});}_0x2db31d=_[_0x2573('0x45')]({},_0x2db31d,_0x2d8330['options']);return db[_0x2573('0x5d')][_0x2573('0x1e')]({'where':_0x2db31d['where']})[_0x2573('0x27')](function(_0x2103ae){_0x490f70[_0x2573('0x1e')]=_0x2103ae;if(_0x2d8330[_0x2573('0x33')][_0x2573('0x40')]){_0x2db31d[_0x2573('0x41')]=[{'all':!![]}];}return db[_0x2573('0x5d')][_0x2573('0x59')](_0x2db31d);})['then'](function(_0x32175f){_0x490f70[_0x2573('0x5e')]=_0x32175f;return _0x490f70;});}})[_0x2573('0x27')](respondWithFilteredResult(_0x5be73d,_0x2db31d))[_0x2573('0x42')](handleError(_0x5be73d,null));};function char(_0x299db7){return _0x2573('0x5f')===typeof _0x299db7?String[_0x2573('0x60')][_0x2573('0x22')](null,arguments):_0x299db7;}function needsEncapsulation(_0xea61b7){return!!_0xea61b7&&(_0xea61b7['toString']()[_0x2573('0x61')](char(0xd))>=0x0||_0xea61b7[_0x2573('0x62')]()[_0x2573('0x61')](char(0xa))>=0x0||_0xea61b7[_0x2573('0x62')]()['indexOf'](char(0x2c))>=0x0||_0xea61b7['toString']()[_0x2573('0x61')](char(0x22))>=0x0);}function encapsulate(_0x2b92a1){var _0xd98719=char(0x22),_0x2055e0='\x5c'+char(0x22),_0x2053b4=_0x2b92a1[_0x2573('0x62')]()[_0x2573('0x63')](new RegExp(_0xd98719,'g'),_0x2055e0);return _0xd98719+_0x2053b4+_0xd98719;}exports[_0x2573('0x64')]=function(_0x1bba2f,_0x493cca,_0xcc64c0){var _0x5b36fa,_0x1f74fb;var _0x4c723e={'where':{'ProjectId':_0x1bba2f['params']['id']}};if(_0x1bba2f[_0x2573('0x33')][_0x2573('0x65')]){_0x4c723e[_0x2573('0x3e')][_0x2573('0x66')]=JSON[_0x2573('0x67')](_0x1bba2f[_0x2573('0x33')][_0x2573('0x65')]);}return db[_0x2573('0x57')][_0x2573('0x59')](_0x4c723e)[_0x2573('0x27')](handleEntityNotFound(_0x493cca,null))[_0x2573('0x27')](function(_0x76a203){if(_0x76a203){_0x5b36fa=_0x76a203;return db[_0x2573('0x68')][_0x2573('0x59')]({'where':{'SessionId':{'$in':_[_0x2573('0x2d')](_0x5b36fa,'id')},'ProjectId':_0x1bba2f['params']['id']},'order':_0x2573('0x69')});}})[_0x2573('0x27')](handleEntityNotFound(_0x493cca,null))['then'](function(_0x55502a){if(_0x55502a){_0x1f74fb=_0x55502a;var _0x35ed1c={};for(var _0x32f382=0x0,_0x2d3ea6=_0x1f74fb[_0x2573('0x38')];_0x32f382<_0x2d3ea6;_0x32f382++){if(!_0x35ed1c[_0x2573('0x58')](_0x1f74fb[_0x32f382][_0x2573('0x6a')])){_0x35ed1c[_0x1f74fb[_0x32f382][_0x2573('0x6a')]]=needsEncapsulation(_0x1f74fb[_0x32f382][_0x2573('0x6b')])?encapsulate(_0x1f74fb[_0x32f382][_0x2573('0x6b')]):_0x1f74fb[_0x32f382]['question'];}}var _0x24b9e1=[],_0x3810d2={};for(var _0x453b4b=0x0,_0x4249ad=_0x5b36fa[_0x2573('0x38')];_0x453b4b<_0x4249ad;_0x453b4b++){_0x3810d2={'ProjectId':_0x1bba2f[_0x2573('0x44')]['id'],'SessionId':_0x5b36fa[_0x453b4b]['id'],'StartTime':moment(_0x5b36fa[_0x453b4b]['starttime'])[_0x2573('0x6c')](_0x2573('0x6d'))};for(var _0x1f08b8=0x0,_0xa97003=_0x1f74fb[_0x2573('0x38')];_0x1f08b8<_0xa97003;_0x1f08b8++){if(_0x1f74fb[_0x1f08b8]['SessionId']==_0x5b36fa[_0x453b4b]['id']&&_0x35ed1c[_0x2573('0x58')](_0x1f74fb[_0x1f08b8]['questionId'])){_0x3810d2[_0x35ed1c[_0x1f74fb[_0x1f08b8][_0x2573('0x6a')]]]=_0x1f74fb[_0x1f08b8][_0x2573('0x6e')];}}for(var _0x5199a9 in _0x35ed1c){if(!_0x3810d2[_0x2573('0x58')](_0x35ed1c[_0x5199a9])){_0x3810d2[_0x35ed1c[_0x5199a9]]=null;}}_0x24b9e1['push'](_0x3810d2);}return _0x24b9e1;}})[_0x2573('0x27')](function(_0x552186){if(!_['isEmpty'](_0x552186)){var _0x3bab7d=toCsv(_0x552186);var _0x2eb3d5=Date[_0x2573('0x6f')]();fs[_0x2573('0x70')](util[_0x2573('0x6c')](_0x2573('0x71'),_0x1bba2f[_0x2573('0x44')]['id'],_0x2eb3d5),_0x3bab7d);_0x493cca[_0x2573('0x72')](_0x2573('0x73'),_0x2573('0x74')+util[_0x2573('0x6c')]('Jscripty_Project_%d_Summary_%s.csv',_0x1bba2f[_0x2573('0x44')]['id'],_0x2eb3d5));_0x493cca['setHeader'](_0x2573('0x75'),_0x2573('0x76'));return _0x493cca[_0x2573('0x77')](util['format'](_0x2573('0x71'),_0x1bba2f[_0x2573('0x44')]['id'],_0x2eb3d5));}else{return _0x493cca['sendStatus'](0xcc);}})[_0x2573('0x42')](handleError(_0x493cca,null));}; \ No newline at end of file +var _0x3d45=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','get','Projects','UserProfileResource','name','send','index','map','JscriptyProject','rawAttributes','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filters','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','body','createdAt','userProfileId','getSessions','JscriptySessionReport','order','pick','ProjectId','getAnswers','findOne','JscriptyAnswerReport','number','fromCharCode','apply','toString','indexOf','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','SessionId','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','format','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','lodash','squel'];(function(_0x48f454,_0x55c38d){var _0x52f127=function(_0x2b5ad0){while(--_0x2b5ad0){_0x48f454['push'](_0x48f454['shift']());}};_0x52f127(++_0x55c38d);}(_0x3d45,0x1d2));var _0x53d4=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x3d45[_0x56482c];return _0x5aae7a;};'use strict';var emlformat=require(_0x53d4('0x0'));var rimraf=require(_0x53d4('0x1'));var zipdir=require(_0x53d4('0x2'));var jsonpatch=require(_0x53d4('0x3'));var rp=require(_0x53d4('0x4'));var moment=require('moment');var BPromise=require(_0x53d4('0x5'));var Mustache=require(_0x53d4('0x6'));var util=require('util');var path=require(_0x53d4('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(_0x53d4('0x8'));var squel=require(_0x53d4('0x9'));var crypto=require(_0x53d4('0xa'));var jsforce=require(_0x53d4('0xb'));var deskjs=require(_0x53d4('0xc'));var toCsv=require('to-csv');var querystring=require(_0x53d4('0xd'));var Papa=require(_0x53d4('0xe'));var Redis=require(_0x53d4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x53d4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x53d4('0x11'));var logger=require(_0x53d4('0x12'))(_0x53d4('0x13'));var utils=require(_0x53d4('0x14'));var config=require(_0x53d4('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x53d4('0x16'))['db'];function respondWithStatusCode(_0x11afa8,_0x445c6e){_0x445c6e=_0x445c6e||0xcc;return function(_0x4cd884){if(_0x4cd884){return _0x11afa8[_0x53d4('0x17')](_0x445c6e);}return _0x11afa8[_0x53d4('0x18')](_0x445c6e)['end']();};}function respondWithResult(_0x256409,_0x4999ac){_0x4999ac=_0x4999ac||0xc8;return function(_0x39e990){if(_0x39e990){return _0x256409[_0x53d4('0x18')](_0x4999ac)[_0x53d4('0x19')](_0x39e990);}};}function respondWithFilteredResult(_0x500d03,_0x136478){return function(_0x121bcb){if(_0x121bcb){var _0x1b2e0b=typeof _0x136478[_0x53d4('0x1a')]===_0x53d4('0x1b')&&typeof _0x136478['limit']===_0x53d4('0x1b');var _0x11a0fc=_0x121bcb['count'];var _0x5e5cbf=_0x1b2e0b?0x0:_0x136478[_0x53d4('0x1a')];var _0xfdde54=_0x1b2e0b?_0x121bcb[_0x53d4('0x1c')]:_0x136478['offset']+_0x136478[_0x53d4('0x1d')];var _0x463d8f;if(_0xfdde54>=_0x11a0fc){_0xfdde54=_0x11a0fc;_0x463d8f=0xc8;}else{_0x463d8f=0xce;}_0x500d03[_0x53d4('0x18')](_0x463d8f);return _0x500d03[_0x53d4('0x1e')](_0x53d4('0x1f'),_0x5e5cbf+'-'+_0xfdde54+'/'+_0x11a0fc)[_0x53d4('0x19')](_0x121bcb);}return null;};}function patchUpdates(_0x25ed73){return function(_0x3c3005){try{jsonpatch['apply'](_0x3c3005,_0x25ed73,!![]);}catch(_0x57dfd0){return BPromise['reject'](_0x57dfd0);}return _0x3c3005[_0x53d4('0x20')]();};}function saveUpdates(_0x557c63,_0x87fabf){return function(_0x3c8618){if(_0x3c8618){return _0x3c8618[_0x53d4('0x21')](_0x557c63)[_0x53d4('0x22')](function(_0x1de622){return _0x1de622;});}return null;};}function removeEntity(_0x1fb85f,_0x1c281d){return function(_0x3a2ff4){if(_0x3a2ff4){return _0x3a2ff4[_0x53d4('0x23')]()[_0x53d4('0x22')](function(){var _0x3b2b2e=_0x3a2ff4[_0x53d4('0x24')]({'plain':!![]});var _0x100d71=_0x53d4('0x25');return db[_0x53d4('0x26')][_0x53d4('0x23')]({'where':{'type':_0x100d71,'resourceId':_0x3b2b2e['id']}})[_0x53d4('0x22')](function(){return _0x3a2ff4;});})[_0x53d4('0x22')](function(){_0x1fb85f[_0x53d4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f7946,_0x11540f){return function(_0x2a7259){if(!_0x2a7259){_0x4f7946[_0x53d4('0x17')](0x194);}return _0x2a7259;};}function handleError(_0x48536d,_0x3e466c){_0x3e466c=_0x3e466c||0x1f4;return function(_0x445cc3){logger['error'](_0x445cc3['stack']);if(_0x445cc3['name']){delete _0x445cc3[_0x53d4('0x27')];}_0x48536d[_0x53d4('0x18')](_0x3e466c)[_0x53d4('0x28')](_0x445cc3);};}exports[_0x53d4('0x29')]=function(_0x26e9f9,_0x547eb9){var _0x19d00c={},_0x5a3d55={},_0xd46306={'count':0x0,'rows':[]};var _0x2801e7=_[_0x53d4('0x2a')](db[_0x53d4('0x2b')][_0x53d4('0x2c')],function(_0x1c7621){return{'name':_0x1c7621['fieldName'],'type':_0x1c7621['type'][_0x53d4('0x2d')]};});_0x5a3d55['model']=_['map'](_0x2801e7,_0x53d4('0x27'));_0x5a3d55[_0x53d4('0x2e')]=_[_0x53d4('0x2f')](_0x26e9f9[_0x53d4('0x2e')]);_0x5a3d55['filters']=_['intersection'](_0x5a3d55[_0x53d4('0x30')],_0x5a3d55[_0x53d4('0x2e')]);_0x19d00c[_0x53d4('0x31')]=_[_0x53d4('0x32')](_0x5a3d55[_0x53d4('0x30')],qs[_0x53d4('0x33')](_0x26e9f9[_0x53d4('0x2e')][_0x53d4('0x33')]));_0x19d00c[_0x53d4('0x31')]=_0x19d00c[_0x53d4('0x31')][_0x53d4('0x34')]?_0x19d00c[_0x53d4('0x31')]:_0x5a3d55[_0x53d4('0x30')];if(!_0x26e9f9['query'][_0x53d4('0x35')](_0x53d4('0x36'))){_0x19d00c[_0x53d4('0x1d')]=qs[_0x53d4('0x1d')](_0x26e9f9[_0x53d4('0x2e')][_0x53d4('0x1d')]);_0x19d00c[_0x53d4('0x1a')]=qs[_0x53d4('0x1a')](_0x26e9f9[_0x53d4('0x2e')][_0x53d4('0x1a')]);}_0x19d00c['order']=qs['sort'](_0x26e9f9[_0x53d4('0x2e')][_0x53d4('0x37')]);_0x19d00c['where']=qs[_0x53d4('0x38')](_['pick'](_0x26e9f9[_0x53d4('0x2e')],_0x5a3d55['filters']),_0x2801e7);if(_0x26e9f9[_0x53d4('0x2e')][_0x53d4('0x39')]){_0x19d00c[_0x53d4('0x3a')]=_[_0x53d4('0x3b')](_0x19d00c[_0x53d4('0x3a')],{'$or':_['map'](_0x2801e7,function(_0x1e24a2){if(_0x1e24a2[_0x53d4('0x3c')]!==_0x53d4('0x3d')){var _0x5d14a3={};_0x5d14a3[_0x1e24a2[_0x53d4('0x27')]]={'$like':'%'+_0x26e9f9[_0x53d4('0x2e')][_0x53d4('0x39')]+'%'};return _0x5d14a3;}})});}_0x19d00c=_['merge']({},_0x19d00c,_0x26e9f9[_0x53d4('0x3e')]);var _0x7aacb2={'where':_0x19d00c[_0x53d4('0x3a')]};return db['JscriptyProject']['count'](_0x7aacb2)[_0x53d4('0x22')](function(_0x34c46e){_0xd46306[_0x53d4('0x1c')]=_0x34c46e;if(_0x26e9f9[_0x53d4('0x2e')][_0x53d4('0x3f')]){_0x19d00c['include']=[{'all':!![]}];}return db['JscriptyProject'][_0x53d4('0x40')](_0x19d00c);})[_0x53d4('0x22')](function(_0x407fc2){_0xd46306[_0x53d4('0x41')]=_0x407fc2;return _0xd46306;})[_0x53d4('0x22')](respondWithFilteredResult(_0x547eb9,_0x19d00c))['catch'](handleError(_0x547eb9,null));};exports[_0x53d4('0x42')]=function(_0x26ada0,_0x25c915){var _0x260b84={'raw':![],'where':{'id':_0x26ada0[_0x53d4('0x43')]['id']}},_0x52bd62={};_0x52bd62[_0x53d4('0x30')]=_[_0x53d4('0x2f')](db['JscriptyProject'][_0x53d4('0x2c')]);_0x52bd62[_0x53d4('0x2e')]=_[_0x53d4('0x2f')](_0x26ada0[_0x53d4('0x2e')]);_0x52bd62[_0x53d4('0x38')]=_[_0x53d4('0x32')](_0x52bd62[_0x53d4('0x30')],_0x52bd62[_0x53d4('0x2e')]);_0x260b84[_0x53d4('0x31')]=_[_0x53d4('0x32')](_0x52bd62[_0x53d4('0x30')],qs[_0x53d4('0x33')](_0x26ada0['query'][_0x53d4('0x33')]));_0x260b84[_0x53d4('0x31')]=_0x260b84['attributes'][_0x53d4('0x34')]?_0x260b84[_0x53d4('0x31')]:_0x52bd62[_0x53d4('0x30')];if(_0x26ada0['query'][_0x53d4('0x3f')]){_0x260b84[_0x53d4('0x44')]=[{'all':!![]}];}_0x260b84=_[_0x53d4('0x3b')]({},_0x260b84,_0x26ada0[_0x53d4('0x3e')]);return db[_0x53d4('0x2b')][_0x53d4('0x45')](_0x260b84)['then'](handleEntityNotFound(_0x25c915,null))[_0x53d4('0x22')](respondWithResult(_0x25c915,null))[_0x53d4('0x46')](handleError(_0x25c915,null));};exports['create']=function(_0x42395f,_0x5d379a){return db[_0x53d4('0x2b')][_0x53d4('0x47')](_0x42395f['body'],{})[_0x53d4('0x22')](function(_0x207603){var _0x34924d=_0x42395f[_0x53d4('0x48')][_0x53d4('0x24')]({'plain':!![]});if(!_0x34924d)throw new Error(_0x53d4('0x49'));if(_0x34924d[_0x53d4('0x4a')]===_0x53d4('0x48')){var _0x1457ce=_0x207603[_0x53d4('0x24')]({'plain':!![]});var _0x2c7f8d=_0x53d4('0x25');return db[_0x53d4('0x4b')][_0x53d4('0x45')]({'where':{'name':_0x2c7f8d,'userProfileId':_0x34924d['userProfileId']},'raw':!![]})[_0x53d4('0x22')](function(_0x23f3d2){if(_0x23f3d2&&_0x23f3d2[_0x53d4('0x4c')]===0x0){return db[_0x53d4('0x26')]['create']({'name':_0x1457ce[_0x53d4('0x27')],'resourceId':_0x1457ce['id'],'type':_0x23f3d2[_0x53d4('0x27')],'sectionId':_0x23f3d2['id']},{})[_0x53d4('0x22')](function(){return _0x207603;});}else{return _0x207603;}})[_0x53d4('0x46')](function(_0x5f5533){logger[_0x53d4('0x4d')](_0x53d4('0x4e'),_0x5f5533);throw _0x5f5533;});}return _0x207603;})[_0x53d4('0x22')](respondWithResult(_0x5d379a,0xc9))[_0x53d4('0x46')](handleError(_0x5d379a,null));};exports[_0x53d4('0x4f')]=function(_0x44c07e,_0x508eba){var _0x111db5={'where':{'id':_0x44c07e[_0x53d4('0x43')]['id']}},_0x19b147={};_0x19b147['model']=_['keys'](db['JscriptyProject'][_0x53d4('0x2c')]);_0x111db5[_0x53d4('0x31')]=_[_0x53d4('0x32')](_0x19b147[_0x53d4('0x30')],qs[_0x53d4('0x33')](_0x44c07e[_0x53d4('0x2e')]['fields']));_0x111db5['attributes']=_0x111db5[_0x53d4('0x31')][_0x53d4('0x34')]?_0x111db5[_0x53d4('0x31')]:_0x19b147[_0x53d4('0x30')];if(_0x44c07e['query'][_0x53d4('0x3f')]){_0x111db5[_0x53d4('0x44')]=[{'all':!![]}];}_0x111db5=_['merge']({},_0x111db5,_0x44c07e[_0x53d4('0x3e')]);return db[_0x53d4('0x2b')]['find'](_0x111db5)[_0x53d4('0x22')](handleEntityNotFound(_0x508eba,null))[_0x53d4('0x22')](function(_0x39aaae){if(_0x39aaae){var _0x21a169=_0x39aaae[_0x53d4('0x24')]({'plain':!![]});_0x21a169=qs[_0x53d4('0x50')](_0x21a169,['id','createdAt',_0x53d4('0x51')]);_0x44c07e['body']=_[_0x53d4('0x50')](_0x44c07e[_0x53d4('0x52')],['id',_0x53d4('0x53'),_0x53d4('0x51')]);return db[_0x53d4('0x2b')][_0x53d4('0x47')](_[_0x53d4('0x3b')](_0x21a169,_0x44c07e['body']),{'include':_0x44c07e[_0x53d4('0x2e')][_0x53d4('0x3f')]?[{'all':!![]}]:undefined})[_0x53d4('0x22')](function(_0x568585){var _0x15c627=_0x44c07e['user'][_0x53d4('0x24')]({'plain':!![]});if(!_0x15c627)throw new Error(_0x53d4('0x49'));if(_0x15c627[_0x53d4('0x4a')]===_0x53d4('0x48')){var _0x179cca=_0x568585[_0x53d4('0x24')]({'plain':!![]});var _0x4b62e2='Projects';return db[_0x53d4('0x4b')]['find']({'where':{'name':_0x4b62e2,'userProfileId':_0x15c627[_0x53d4('0x54')]},'raw':!![]})[_0x53d4('0x22')](function(_0xee1573){if(_0xee1573&&_0xee1573[_0x53d4('0x4c')]===0x0){return db[_0x53d4('0x26')][_0x53d4('0x47')]({'name':_0x179cca['name'],'resourceId':_0x179cca['id'],'type':_0xee1573[_0x53d4('0x27')],'sectionId':_0xee1573['id']},{})[_0x53d4('0x22')](function(){return _0x568585;});}else{return _0x568585;}})[_0x53d4('0x46')](function(_0x4efcaa){logger[_0x53d4('0x4d')](_0x53d4('0x4e'),_0x4efcaa);throw _0x4efcaa;});}return _0x568585;});}})['then'](respondWithResult(_0x508eba,0xc9))[_0x53d4('0x46')](handleError(_0x508eba,null));};exports['update']=function(_0x1c626e,_0x58ec9d){if(_0x1c626e[_0x53d4('0x52')]['id']){delete _0x1c626e['body']['id'];}return db[_0x53d4('0x2b')][_0x53d4('0x45')]({'where':{'id':_0x1c626e['params']['id']}})[_0x53d4('0x22')](handleEntityNotFound(_0x58ec9d,null))[_0x53d4('0x22')](saveUpdates(_0x1c626e[_0x53d4('0x52')],null))[_0x53d4('0x22')](respondWithResult(_0x58ec9d,null))[_0x53d4('0x46')](handleError(_0x58ec9d,null));};exports[_0x53d4('0x23')]=function(_0x12a06c,_0x331c5e){return db[_0x53d4('0x2b')][_0x53d4('0x45')]({'where':{'id':_0x12a06c[_0x53d4('0x43')]['id']}})[_0x53d4('0x22')](handleEntityNotFound(_0x331c5e,null))['then'](removeEntity(_0x331c5e,null))['catch'](handleError(_0x331c5e,null));};exports[_0x53d4('0x55')]=function(_0x428f74,_0x312001,_0x3e58ec){var _0x2f6f62={'raw':!![],'where':{}};var _0x5c7dfa={};var _0x44cdf6={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x428f74[_0x53d4('0x43')]['id']}})[_0x53d4('0x22')](handleEntityNotFound(_0x312001,null))[_0x53d4('0x22')](function(_0x4f8550){if(_0x4f8550){_0x5c7dfa[_0x53d4('0x30')]=_['keys'](db[_0x53d4('0x56')][_0x53d4('0x2c')]);_0x5c7dfa[_0x53d4('0x2e')]=_[_0x53d4('0x2f')](_0x428f74[_0x53d4('0x2e')]);_0x5c7dfa['filters']=_['intersection'](_0x5c7dfa['model'],_0x5c7dfa[_0x53d4('0x2e')]);_0x2f6f62[_0x53d4('0x31')]=_['intersection'](_0x5c7dfa[_0x53d4('0x30')],qs['fields'](_0x428f74[_0x53d4('0x2e')][_0x53d4('0x33')]));_0x2f6f62['attributes']=_0x2f6f62[_0x53d4('0x31')][_0x53d4('0x34')]?_0x2f6f62[_0x53d4('0x31')]:_0x5c7dfa[_0x53d4('0x30')];if(!_0x428f74[_0x53d4('0x2e')][_0x53d4('0x35')]('nolimit')){_0x2f6f62[_0x53d4('0x1d')]=qs[_0x53d4('0x1d')](_0x428f74[_0x53d4('0x2e')][_0x53d4('0x1d')]);_0x2f6f62[_0x53d4('0x1a')]=qs[_0x53d4('0x1a')](_0x428f74[_0x53d4('0x2e')][_0x53d4('0x1a')]);}_0x2f6f62[_0x53d4('0x57')]=qs['sort'](_0x428f74[_0x53d4('0x2e')][_0x53d4('0x37')]);_0x2f6f62[_0x53d4('0x3a')]=qs[_0x53d4('0x38')](_[_0x53d4('0x58')](_0x428f74['query'],_0x5c7dfa[_0x53d4('0x38')]));_0x2f6f62[_0x53d4('0x3a')][_0x53d4('0x59')]=_0x4f8550['id'];if(_0x428f74[_0x53d4('0x2e')][_0x53d4('0x39')]){_0x2f6f62['where']=_[_0x53d4('0x3b')](_0x2f6f62[_0x53d4('0x3a')],{'$or':_[_0x53d4('0x2a')](_0x2f6f62[_0x53d4('0x31')],function(_0x1b2566){var _0x41d07a={};_0x41d07a[_0x1b2566]={'$like':'%'+_0x428f74[_0x53d4('0x2e')][_0x53d4('0x39')]+'%'};return _0x41d07a;})});}_0x2f6f62=_[_0x53d4('0x3b')]({},_0x2f6f62,_0x428f74['options']);return db[_0x53d4('0x56')][_0x53d4('0x1c')]({'where':_0x2f6f62[_0x53d4('0x3a')]})[_0x53d4('0x22')](function(_0x3a548c){_0x44cdf6[_0x53d4('0x1c')]=_0x3a548c;if(_0x428f74[_0x53d4('0x2e')][_0x53d4('0x3f')]){_0x2f6f62[_0x53d4('0x44')]=[{'all':!![]}];}return db[_0x53d4('0x56')][_0x53d4('0x40')](_0x2f6f62);})[_0x53d4('0x22')](function(_0x47f64a){_0x44cdf6['rows']=_0x47f64a;return _0x44cdf6;});}})[_0x53d4('0x22')](respondWithFilteredResult(_0x312001,_0x2f6f62))[_0x53d4('0x46')](handleError(_0x312001,null));};exports[_0x53d4('0x5a')]=function(_0x5605f5,_0xd8ab1d,_0x81d7b6){var _0xa94ecd={'raw':!![],'where':{}};var _0x1807ab={};var _0x59bf7a={'count':0x0,'rows':[]};return db[_0x53d4('0x2b')][_0x53d4('0x5b')]({'where':{'id':_0x5605f5[_0x53d4('0x43')]['id']}})['then'](handleEntityNotFound(_0xd8ab1d,null))[_0x53d4('0x22')](function(_0x4a8e53){if(_0x4a8e53){_0x1807ab[_0x53d4('0x30')]=_['keys'](db[_0x53d4('0x5c')][_0x53d4('0x2c')]);_0x1807ab[_0x53d4('0x2e')]=_[_0x53d4('0x2f')](_0x5605f5['query']);_0x1807ab[_0x53d4('0x38')]=_['intersection'](_0x1807ab[_0x53d4('0x30')],_0x1807ab['query']);_0xa94ecd[_0x53d4('0x31')]=_['intersection'](_0x1807ab['model'],qs[_0x53d4('0x33')](_0x5605f5[_0x53d4('0x2e')][_0x53d4('0x33')]));_0xa94ecd[_0x53d4('0x31')]=_0xa94ecd[_0x53d4('0x31')][_0x53d4('0x34')]?_0xa94ecd[_0x53d4('0x31')]:_0x1807ab[_0x53d4('0x30')];if(!_0x5605f5['query'][_0x53d4('0x35')](_0x53d4('0x36'))){_0xa94ecd[_0x53d4('0x1d')]=qs[_0x53d4('0x1d')](_0x5605f5[_0x53d4('0x2e')]['limit']);_0xa94ecd[_0x53d4('0x1a')]=qs['offset'](_0x5605f5[_0x53d4('0x2e')][_0x53d4('0x1a')]);}_0xa94ecd['order']=qs[_0x53d4('0x37')](_0x5605f5[_0x53d4('0x2e')][_0x53d4('0x37')]);_0xa94ecd['where']=qs[_0x53d4('0x38')](_[_0x53d4('0x58')](_0x5605f5[_0x53d4('0x2e')],_0x1807ab['filters']));_0xa94ecd['where'][_0x53d4('0x59')]=_0x4a8e53['id'];if(_0x5605f5['query'][_0x53d4('0x39')]){_0xa94ecd['where']=_['merge'](_0xa94ecd['where'],{'$or':_['map'](_0xa94ecd[_0x53d4('0x31')],function(_0x1e19af){var _0x327539={};_0x327539[_0x1e19af]={'$like':'%'+_0x5605f5[_0x53d4('0x2e')][_0x53d4('0x39')]+'%'};return _0x327539;})});}_0xa94ecd=_[_0x53d4('0x3b')]({},_0xa94ecd,_0x5605f5[_0x53d4('0x3e')]);return db[_0x53d4('0x5c')][_0x53d4('0x1c')]({'where':_0xa94ecd[_0x53d4('0x3a')]})['then'](function(_0x1db3c6){_0x59bf7a[_0x53d4('0x1c')]=_0x1db3c6;if(_0x5605f5[_0x53d4('0x2e')][_0x53d4('0x3f')]){_0xa94ecd['include']=[{'all':!![]}];}return db[_0x53d4('0x5c')][_0x53d4('0x40')](_0xa94ecd);})[_0x53d4('0x22')](function(_0x583a4d){_0x59bf7a['rows']=_0x583a4d;return _0x59bf7a;});}})[_0x53d4('0x22')](respondWithFilteredResult(_0xd8ab1d,_0xa94ecd))[_0x53d4('0x46')](handleError(_0xd8ab1d,null));};function char(_0x5350a4){return _0x53d4('0x5d')===typeof _0x5350a4?String[_0x53d4('0x5e')][_0x53d4('0x5f')](null,arguments):_0x5350a4;}function needsEncapsulation(_0x1db2f5){return!!_0x1db2f5&&(_0x1db2f5[_0x53d4('0x60')]()[_0x53d4('0x61')](char(0xd))>=0x0||_0x1db2f5['toString']()['indexOf'](char(0xa))>=0x0||_0x1db2f5[_0x53d4('0x60')]()[_0x53d4('0x61')](char(0x2c))>=0x0||_0x1db2f5[_0x53d4('0x60')]()[_0x53d4('0x61')](char(0x22))>=0x0);}function encapsulate(_0x168e3c){var _0x4da253=char(0x22),_0x5049d1='\x5c'+char(0x22),_0x4f9d00=_0x168e3c[_0x53d4('0x60')]()['replace'](new RegExp(_0x4da253,'g'),_0x5049d1);return _0x4da253+_0x4f9d00+_0x4da253;}exports[_0x53d4('0x62')]=function(_0xc34f1f,_0x50dacb,_0x3b7d6f){var _0x14d14c,_0x3f8dd7;var _0x429389={'where':{'ProjectId':_0xc34f1f[_0x53d4('0x43')]['id']}};if(_0xc34f1f[_0x53d4('0x2e')][_0x53d4('0x63')]){_0x429389[_0x53d4('0x3a')][_0x53d4('0x64')]=JSON[_0x53d4('0x65')](_0xc34f1f[_0x53d4('0x2e')][_0x53d4('0x63')]);}return db[_0x53d4('0x56')][_0x53d4('0x40')](_0x429389)[_0x53d4('0x22')](handleEntityNotFound(_0x50dacb,null))[_0x53d4('0x22')](function(_0x156f4f){if(_0x156f4f){_0x14d14c=_0x156f4f;return db[_0x53d4('0x66')][_0x53d4('0x40')]({'where':{'SessionId':{'$in':_[_0x53d4('0x2a')](_0x14d14c,'id')},'ProjectId':_0xc34f1f[_0x53d4('0x43')]['id']},'order':_0x53d4('0x67')});}})[_0x53d4('0x22')](handleEntityNotFound(_0x50dacb,null))[_0x53d4('0x22')](function(_0x349e8e){if(_0x349e8e){_0x3f8dd7=_0x349e8e;var _0x304bbd={};for(var _0x5b689c=0x0,_0x49a9b4=_0x3f8dd7['length'];_0x5b689c<_0x49a9b4;_0x5b689c++){if(!_0x304bbd[_0x53d4('0x35')](_0x3f8dd7[_0x5b689c][_0x53d4('0x68')])){_0x304bbd[_0x3f8dd7[_0x5b689c][_0x53d4('0x68')]]=needsEncapsulation(_0x3f8dd7[_0x5b689c][_0x53d4('0x69')])?encapsulate(_0x3f8dd7[_0x5b689c][_0x53d4('0x69')]):_0x3f8dd7[_0x5b689c]['question'];}}var _0x719b52=[],_0x1ae506={};for(var _0x4bcc92=0x0,_0x4e46ff=_0x14d14c[_0x53d4('0x34')];_0x4bcc92<_0x4e46ff;_0x4bcc92++){_0x1ae506={'ProjectId':_0xc34f1f[_0x53d4('0x43')]['id'],'SessionId':_0x14d14c[_0x4bcc92]['id'],'StartTime':moment(_0x14d14c[_0x4bcc92][_0x53d4('0x64')])['format']('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x5f66ff=0x0,_0x53984b=_0x3f8dd7[_0x53d4('0x34')];_0x5f66ff<_0x53984b;_0x5f66ff++){if(_0x3f8dd7[_0x5f66ff][_0x53d4('0x6a')]==_0x14d14c[_0x4bcc92]['id']&&_0x304bbd[_0x53d4('0x35')](_0x3f8dd7[_0x5f66ff][_0x53d4('0x68')])){_0x1ae506[_0x304bbd[_0x3f8dd7[_0x5f66ff][_0x53d4('0x68')]]]=_0x3f8dd7[_0x5f66ff]['answer'];}}for(var _0x233fca in _0x304bbd){if(!_0x1ae506[_0x53d4('0x35')](_0x304bbd[_0x233fca])){_0x1ae506[_0x304bbd[_0x233fca]]=null;}}_0x719b52[_0x53d4('0x6b')](_0x1ae506);}return _0x719b52;}})[_0x53d4('0x22')](function(_0x5b33a0){if(!_[_0x53d4('0x6c')](_0x5b33a0)){var _0xee12cc=toCsv(_0x5b33a0);var _0x2f09b3=Date[_0x53d4('0x6d')]();fs[_0x53d4('0x6e')](util['format'](_0x53d4('0x6f'),_0xc34f1f[_0x53d4('0x43')]['id'],_0x2f09b3),_0xee12cc);_0x50dacb['setHeader'](_0x53d4('0x70'),_0x53d4('0x71')+util[_0x53d4('0x72')](_0x53d4('0x73'),_0xc34f1f[_0x53d4('0x43')]['id'],_0x2f09b3));_0x50dacb[_0x53d4('0x74')](_0x53d4('0x75'),_0x53d4('0x76'));return _0x50dacb['download'](util[_0x53d4('0x72')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0xc34f1f[_0x53d4('0x43')]['id'],_0x2f09b3));}else{return _0x50dacb[_0x53d4('0x17')](0xcc);}})['catch'](handleError(_0x50dacb,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 5108312..0ae2e3e 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 _0x1ef3=['path','rimraf','./jscriptyProject.attributes','exports','define','JscriptyProject','lodash','util','api','moment','bluebird'];(function(_0x1fd978,_0x234802){var _0x57c589=function(_0x471561){while(--_0x471561){_0x1fd978['push'](_0x1fd978['shift']());}};_0x57c589(++_0x234802);}(_0x1ef3,0x69));var _0x31ef=function(_0x19ccee,_0x19ebc6){_0x19ccee=_0x19ccee-0x0;var _0x5d3ffc=_0x1ef3[_0x19ccee];return _0x5d3ffc;};'use strict';var _=require(_0x31ef('0x0'));var util=require(_0x31ef('0x1'));var logger=require('../../config/logger')(_0x31ef('0x2'));var moment=require(_0x31ef('0x3'));var BPromise=require(_0x31ef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x31ef('0x5'));var rimraf=require(_0x31ef('0x6'));var config=require('../../config/environment');var attributes=require(_0x31ef('0x7'));module[_0x31ef('0x8')]=function(_0x81db4,_0x454b60){return _0x81db4[_0x31ef('0x9')](_0x31ef('0xa'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46fc=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','JscriptyProject','jscripty_projects','lodash'];(function(_0x4b5813,_0x5769de){var _0x423465=function(_0x18071f){while(--_0x18071f){_0x4b5813['push'](_0x4b5813['shift']());}};_0x423465(++_0x5769de);}(_0x46fc,0x103));var _0xc46f=function(_0x10fa4b,_0x15d598){_0x10fa4b=_0x10fa4b-0x0;var _0x29f8cd=_0x46fc[_0x10fa4b];return _0x29f8cd;};'use strict';var _=require(_0xc46f('0x0'));var util=require(_0xc46f('0x1'));var logger=require(_0xc46f('0x2'))(_0xc46f('0x3'));var moment=require(_0xc46f('0x4'));var BPromise=require(_0xc46f('0x5'));var rp=require(_0xc46f('0x6'));var fs=require('fs');var path=require(_0xc46f('0x7'));var rimraf=require(_0xc46f('0x8'));var config=require('../../config/environment');var attributes=require('./jscriptyProject.attributes');module[_0xc46f('0x9')]=function(_0x176c6f,_0x30ca8d){return _0x176c6f[_0xc46f('0xa')](_0xc46f('0xb'),attributes,{'tableName':_0xc46f('0xc'),'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 e263db6..e00462b 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 _0xbdb7=['request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','JscriptyProject,\x20%s,\x20%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x42184d,_0x264f92){_0x42184d=_0x42184d-0x0;var _0x144722=_0xbdb7[_0x42184d];return _0x144722;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});} \ No newline at end of file +var _0xda3f=['rpc','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0xda3f,0xec));var _0xfda3=function(_0x1227b6,_0x57b21a){_0x1227b6=_0x1227b6-0x0;var _0x5b7950=_0xda3f[_0x1227b6];return _0x5b7950;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index c17459f..1c2e450 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 _0x36ae=['put','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get','index','describe','/:id','isAuthenticated','show','post','create'];(function(_0x4a7e98,_0x250137){var _0x27d10d=function(_0x378768){while(--_0x378768){_0x4a7e98['push'](_0x4a7e98['shift']());}};_0x27d10d(++_0x250137);}(_0x36ae,0x1d0));var _0xe36a=function(_0x5eef05,_0x1be989){_0x5eef05=_0x5eef05-0x0;var _0x56d4b8=_0x36ae[_0x5eef05];return _0x56d4b8;};'use strict';var multer=require(_0xe36a('0x0'));var util=require(_0xe36a('0x1'));var path=require(_0xe36a('0x2'));var timeout=require('connect-timeout');var express=require(_0xe36a('0x3'));var router=express[_0xe36a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe36a('0x5'));var interaction=require(_0xe36a('0x6'));var config=require('../../config/environment');var controller=require(_0xe36a('0x7'));router[_0xe36a('0x8')]('/',auth['isAuthenticated'](),controller[_0xe36a('0x9')]);router[_0xe36a('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xe36a('0xa')]);router[_0xe36a('0x8')](_0xe36a('0xb'),auth[_0xe36a('0xc')](),controller[_0xe36a('0xd')]);router[_0xe36a('0xe')]('/',auth[_0xe36a('0xc')](),controller[_0xe36a('0xf')]);router[_0xe36a('0x10')](_0xe36a('0xb'),auth[_0xe36a('0xc')](),controller[_0xe36a('0x11')]);router[_0xe36a('0x12')](_0xe36a('0xb'),auth[_0xe36a('0xc')](),controller['destroy']);module[_0xe36a('0x13')]=router; \ No newline at end of file +var _0xbaaf=['../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get','index','/describe','isAuthenticated','/:id','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x527fba,_0x51af72){var _0x546244=function(_0xef4ef1){while(--_0xef4ef1){_0x527fba['push'](_0x527fba['shift']());}};_0x546244(++_0x51af72);}(_0xbaaf,0x1c2));var _0xfbaa=function(_0x33f43f,_0x47a9c8){_0x33f43f=_0x33f43f-0x0;var _0x5cc8ff=_0xbaaf[_0x33f43f];return _0x5cc8ff;};'use strict';var multer=require(_0xfbaa('0x0'));var util=require(_0xfbaa('0x1'));var path=require('path');var timeout=require(_0xfbaa('0x2'));var express=require(_0xfbaa('0x3'));var router=express[_0xfbaa('0x4')]();var fs_extra=require(_0xfbaa('0x5'));var auth=require(_0xfbaa('0x6'));var interaction=require(_0xfbaa('0x7'));var config=require('../../config/environment');var controller=require(_0xfbaa('0x8'));router[_0xfbaa('0x9')]('/',auth['isAuthenticated'](),controller[_0xfbaa('0xa')]);router['get'](_0xfbaa('0xb'),auth[_0xfbaa('0xc')](),controller['describe']);router[_0xfbaa('0x9')](_0xfbaa('0xd'),auth[_0xfbaa('0xc')](),controller['show']);router['post']('/',auth[_0xfbaa('0xc')](),controller['create']);router[_0xfbaa('0xe')](_0xfbaa('0xd'),auth[_0xfbaa('0xc')](),controller[_0xfbaa('0xf')]);router[_0xfbaa('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xfbaa('0x11')]);module[_0xfbaa('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 4f7c63c..013c6a3 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(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x7a54,0x106));var _0x47a5=function(_0x24445e,_0x211e3f){_0x24445e=_0x24445e-0x0;var _0x15472f=_0x7a54[_0x24445e];return _0x15472f;};'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(_0x2df8c1,_0x420d37){_0x2df8c1=_0x2df8c1-0x0;var _0x3ca702=_0x7a54[_0x2df8c1];return _0x3ca702;};'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 1a9eaee..3ddffa5 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 _0x853a=['where','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','create','body','update','params','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','reject','save','then','destroy','error','name','index','map','JscriptyQuestionReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter'];(function(_0x545688,_0x424992){var _0x4f7b4c=function(_0x234901){while(--_0x234901){_0x545688['push'](_0x545688['shift']());}};_0x4f7b4c(++_0x424992);}(_0x853a,0x1d8));var _0xa853=function(_0x166f43,_0x3bc8cb){_0x166f43=_0x166f43-0x0;var _0x43ae50=_0x853a[_0x166f43];return _0x43ae50;};'use strict';var emlformat=require(_0xa853('0x0'));var rimraf=require(_0xa853('0x1'));var zipdir=require(_0xa853('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa853('0x3'));var moment=require(_0xa853('0x4'));var BPromise=require(_0xa853('0x5'));var Mustache=require(_0xa853('0x6'));var util=require(_0xa853('0x7'));var path=require(_0xa853('0x8'));var sox=require(_0xa853('0x9'));var csv=require(_0xa853('0xa'));var ejs=require(_0xa853('0xb'));var fs=require('fs');var fs_extra=require(_0xa853('0xc'));var _=require(_0xa853('0xd'));var squel=require(_0xa853('0xe'));var crypto=require(_0xa853('0xf'));var jsforce=require(_0xa853('0x10'));var deskjs=require(_0xa853('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa853('0x12'));var authService=require(_0xa853('0x13'));var qs=require(_0xa853('0x14'));var as=require(_0xa853('0x15'));var hardwareService=require(_0xa853('0x16'));var logger=require(_0xa853('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xa853('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa853('0x19'))['db'];function respondWithStatusCode(_0x5839a7,_0x1e2351){_0x1e2351=_0x1e2351||0xcc;return function(_0x23c98d){if(_0x23c98d){return _0x5839a7[_0xa853('0x1a')](_0x1e2351);}return _0x5839a7['status'](_0x1e2351)[_0xa853('0x1b')]();};}function respondWithResult(_0x5ad8ba,_0x27a400){_0x27a400=_0x27a400||0xc8;return function(_0x22dd9d){if(_0x22dd9d){return _0x5ad8ba['status'](_0x27a400)['json'](_0x22dd9d);}};}function respondWithFilteredResult(_0x565457,_0x29c1dd){return function(_0x3fe566){if(_0x3fe566){var _0x59d17b=typeof _0x29c1dd[_0xa853('0x1c')]===_0xa853('0x1d')&&typeof _0x29c1dd[_0xa853('0x1e')]==='undefined';var _0x22093c=_0x3fe566[_0xa853('0x1f')];var _0x263b27=_0x59d17b?0x0:_0x29c1dd[_0xa853('0x1c')];var _0x530cd3=_0x59d17b?_0x3fe566[_0xa853('0x1f')]:_0x29c1dd['offset']+_0x29c1dd[_0xa853('0x1e')];var _0x18b98b;if(_0x530cd3>=_0x22093c){_0x530cd3=_0x22093c;_0x18b98b=0xc8;}else{_0x18b98b=0xce;}_0x565457[_0xa853('0x20')](_0x18b98b);return _0x565457[_0xa853('0x21')](_0xa853('0x22'),_0x263b27+'-'+_0x530cd3+'/'+_0x22093c)['json'](_0x3fe566);}return null;};}function patchUpdates(_0x99c718){return function(_0x5d2987){try{jsonpatch['apply'](_0x5d2987,_0x99c718,!![]);}catch(_0xc516c8){return BPromise[_0xa853('0x23')](_0xc516c8);}return _0x5d2987[_0xa853('0x24')]();};}function saveUpdates(_0x8761e3,_0x498ad5){return function(_0xcfe701){if(_0xcfe701){return _0xcfe701['update'](_0x8761e3)[_0xa853('0x25')](function(_0x1f7c71){return _0x1f7c71;});}return null;};}function removeEntity(_0x9b09e3,_0x212fb7){return function(_0x18a950){if(_0x18a950){return _0x18a950[_0xa853('0x26')]()[_0xa853('0x25')](function(){_0x9b09e3[_0xa853('0x20')](0xcc)[_0xa853('0x1b')]();});}};}function handleEntityNotFound(_0x553395,_0x2886c1){return function(_0x4c59b3){if(!_0x4c59b3){_0x553395[_0xa853('0x1a')](0x194);}return _0x4c59b3;};}function handleError(_0x5a1d8d,_0x53cc0b){_0x53cc0b=_0x53cc0b||0x1f4;return function(_0x52c492){logger[_0xa853('0x27')](_0x52c492['stack']);if(_0x52c492[_0xa853('0x28')]){delete _0x52c492[_0xa853('0x28')];}_0x5a1d8d[_0xa853('0x20')](_0x53cc0b)['send'](_0x52c492);};}exports[_0xa853('0x29')]=function(_0x2fcf73,_0x5567f8){var _0x573a79={},_0x50033c={},_0x5c2752={'count':0x0,'rows':[]};var _0x4c7f08=_[_0xa853('0x2a')](db[_0xa853('0x2b')][_0xa853('0x2c')],function(_0x1c615f){return{'name':_0x1c615f[_0xa853('0x2d')],'type':_0x1c615f['type'][_0xa853('0x2e')]};});_0x50033c[_0xa853('0x2f')]=_[_0xa853('0x2a')](_0x4c7f08,'name');_0x50033c[_0xa853('0x30')]=_[_0xa853('0x31')](_0x2fcf73['query']);_0x50033c[_0xa853('0x32')]=_['intersection'](_0x50033c[_0xa853('0x2f')],_0x50033c[_0xa853('0x30')]);_0x573a79[_0xa853('0x33')]=_[_0xa853('0x34')](_0x50033c[_0xa853('0x2f')],qs['fields'](_0x2fcf73[_0xa853('0x30')][_0xa853('0x35')]));_0x573a79['attributes']=_0x573a79[_0xa853('0x33')][_0xa853('0x36')]?_0x573a79['attributes']:_0x50033c[_0xa853('0x2f')];if(!_0x2fcf73[_0xa853('0x30')][_0xa853('0x37')](_0xa853('0x38'))){_0x573a79['limit']=qs[_0xa853('0x1e')](_0x2fcf73[_0xa853('0x30')][_0xa853('0x1e')]);_0x573a79[_0xa853('0x1c')]=qs[_0xa853('0x1c')](_0x2fcf73[_0xa853('0x30')][_0xa853('0x1c')]);}_0x573a79[_0xa853('0x39')]=qs['sort'](_0x2fcf73[_0xa853('0x30')][_0xa853('0x3a')]);_0x573a79['where']=qs['filters'](_['pick'](_0x2fcf73[_0xa853('0x30')],_0x50033c[_0xa853('0x32')]),_0x4c7f08);if(_0x2fcf73['query'][_0xa853('0x3b')]){_0x573a79[_0xa853('0x3c')]=_[_0xa853('0x3d')](_0x573a79[_0xa853('0x3c')],{'$or':_[_0xa853('0x2a')](_0x4c7f08,function(_0x34ab04){if(_0x34ab04[_0xa853('0x3e')]!==_0xa853('0x3f')){var _0x4b5c16={};_0x4b5c16[_0x34ab04[_0xa853('0x28')]]={'$like':'%'+_0x2fcf73[_0xa853('0x30')][_0xa853('0x3b')]+'%'};return _0x4b5c16;}})});}_0x573a79=_[_0xa853('0x3d')]({},_0x573a79,_0x2fcf73[_0xa853('0x40')]);var _0x2735e2={'where':_0x573a79[_0xa853('0x3c')]};return db[_0xa853('0x2b')][_0xa853('0x1f')](_0x2735e2)[_0xa853('0x25')](function(_0x3c08ab){_0x5c2752[_0xa853('0x1f')]=_0x3c08ab;if(_0x2fcf73[_0xa853('0x30')][_0xa853('0x41')]){_0x573a79[_0xa853('0x42')]=[{'all':!![]}];}return db[_0xa853('0x2b')]['findAll'](_0x573a79);})[_0xa853('0x25')](function(_0x3bf63f){_0x5c2752[_0xa853('0x43')]=_0x3bf63f;return _0x5c2752;})[_0xa853('0x25')](respondWithFilteredResult(_0x5567f8,_0x573a79))[_0xa853('0x44')](handleError(_0x5567f8,null));};exports[_0xa853('0x45')]=function(_0x1e408c,_0x5b404f){var _0x2a6486={'raw':!![],'where':{'id':_0x1e408c['params']['id']}},_0x51024e={};_0x51024e[_0xa853('0x2f')]=_['keys'](db[_0xa853('0x2b')][_0xa853('0x2c')]);_0x51024e[_0xa853('0x30')]=_[_0xa853('0x31')](_0x1e408c[_0xa853('0x30')]);_0x51024e[_0xa853('0x32')]=_[_0xa853('0x34')](_0x51024e[_0xa853('0x2f')],_0x51024e[_0xa853('0x30')]);_0x2a6486[_0xa853('0x33')]=_[_0xa853('0x34')](_0x51024e[_0xa853('0x2f')],qs[_0xa853('0x35')](_0x1e408c['query'][_0xa853('0x35')]));_0x2a6486[_0xa853('0x33')]=_0x2a6486[_0xa853('0x33')][_0xa853('0x36')]?_0x2a6486[_0xa853('0x33')]:_0x51024e[_0xa853('0x2f')];if(_0x1e408c[_0xa853('0x30')][_0xa853('0x41')]){_0x2a6486[_0xa853('0x42')]=[{'all':!![]}];}_0x2a6486=_['merge']({},_0x2a6486,_0x1e408c['options']);return db[_0xa853('0x2b')]['find'](_0x2a6486)[_0xa853('0x25')](handleEntityNotFound(_0x5b404f,null))[_0xa853('0x25')](respondWithResult(_0x5b404f,null))[_0xa853('0x44')](handleError(_0x5b404f,null));};exports[_0xa853('0x46')]=function(_0x5065f8,_0x205b38){return db['JscriptyQuestionReport'][_0xa853('0x46')](_0x5065f8[_0xa853('0x47')],{})[_0xa853('0x25')](respondWithResult(_0x205b38,0xc9))[_0xa853('0x44')](handleError(_0x205b38,null));};exports[_0xa853('0x48')]=function(_0x18256b,_0xf4c50d){if(_0x18256b[_0xa853('0x47')]['id']){delete _0x18256b['body']['id'];}return db[_0xa853('0x2b')]['find']({'where':{'id':_0x18256b[_0xa853('0x49')]['id']}})[_0xa853('0x25')](handleEntityNotFound(_0xf4c50d,null))['then'](saveUpdates(_0x18256b[_0xa853('0x47')],null))[_0xa853('0x25')](respondWithResult(_0xf4c50d,null))[_0xa853('0x44')](handleError(_0xf4c50d,null));};exports['destroy']=function(_0x59bc2c,_0x186273){return db[_0xa853('0x2b')][_0xa853('0x4a')]({'where':{'id':_0x59bc2c['params']['id']}})['then'](handleEntityNotFound(_0x186273,null))[_0xa853('0x25')](removeEntity(_0x186273,null))['catch'](handleError(_0x186273,null));};exports[_0xa853('0x4b')]=function(_0x7467a3,_0x49e6ed){return db[_0xa853('0x2b')][_0xa853('0x4b')]()[_0xa853('0x25')](respondWithResult(_0x49e6ed,null))[_0xa853('0x44')](handleError(_0x49e6ed,null));}; \ No newline at end of file +var _0x3f76=['include','findAll','rows','catch','show','params','intersection','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','set','Content-Range','json','apply','reject','update','then','end','stack','name','index','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','count','includeAll'];(function(_0x43a37c,_0x25a567){var _0x5d1d40=function(_0x3ec673){while(--_0x3ec673){_0x43a37c['push'](_0x43a37c['shift']());}};_0x5d1d40(++_0x25a567);}(_0x3f76,0xa1));var _0x63f7=function(_0x267286,_0x465441){_0x267286=_0x267286-0x0;var _0x3e2542=_0x3f76[_0x267286];return _0x3e2542;};'use strict';var emlformat=require(_0x63f7('0x0'));var rimraf=require(_0x63f7('0x1'));var zipdir=require(_0x63f7('0x2'));var jsonpatch=require(_0x63f7('0x3'));var rp=require(_0x63f7('0x4'));var moment=require(_0x63f7('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x63f7('0x6'));var sox=require(_0x63f7('0x7'));var csv=require(_0x63f7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x63f7('0x9'));var _=require(_0x63f7('0xa'));var squel=require(_0x63f7('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x63f7('0xc'));var toCsv=require('to-csv');var querystring=require(_0x63f7('0xd'));var Papa=require(_0x63f7('0xe'));var Redis=require('ioredis');var authService=require(_0x63f7('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x63f7('0x10'));var hardwareService=require(_0x63f7('0x11'));var logger=require(_0x63f7('0x12'))(_0x63f7('0x13'));var utils=require(_0x63f7('0x14'));var config=require(_0x63f7('0x15'));var licenseUtil=require(_0x63f7('0x16'));var db=require(_0x63f7('0x17'))['db'];function respondWithStatusCode(_0x137f21,_0x4c7197){_0x4c7197=_0x4c7197||0xcc;return function(_0xda4146){if(_0xda4146){return _0x137f21[_0x63f7('0x18')](_0x4c7197);}return _0x137f21[_0x63f7('0x19')](_0x4c7197)['end']();};}function respondWithResult(_0x3a311d,_0x58babf){_0x58babf=_0x58babf||0xc8;return function(_0x345519){if(_0x345519){return _0x3a311d[_0x63f7('0x19')](_0x58babf)['json'](_0x345519);}};}function respondWithFilteredResult(_0x24a57c,_0x993b8d){return function(_0x646f6e){if(_0x646f6e){var _0x32833c=typeof _0x993b8d[_0x63f7('0x1a')]===_0x63f7('0x1b')&&typeof _0x993b8d[_0x63f7('0x1c')]==='undefined';var _0x41a69e=_0x646f6e['count'];var _0x4e852b=_0x32833c?0x0:_0x993b8d['offset'];var _0x9bbc31=_0x32833c?_0x646f6e['count']:_0x993b8d[_0x63f7('0x1a')]+_0x993b8d[_0x63f7('0x1c')];var _0x32adc;if(_0x9bbc31>=_0x41a69e){_0x9bbc31=_0x41a69e;_0x32adc=0xc8;}else{_0x32adc=0xce;}_0x24a57c[_0x63f7('0x19')](_0x32adc);return _0x24a57c[_0x63f7('0x1d')](_0x63f7('0x1e'),_0x4e852b+'-'+_0x9bbc31+'/'+_0x41a69e)[_0x63f7('0x1f')](_0x646f6e);}return null;};}function patchUpdates(_0x2d432e){return function(_0x2f0292){try{jsonpatch[_0x63f7('0x20')](_0x2f0292,_0x2d432e,!![]);}catch(_0x34e28a){return BPromise[_0x63f7('0x21')](_0x34e28a);}return _0x2f0292['save']();};}function saveUpdates(_0x6e77b5,_0x5490f5){return function(_0x55fdf0){if(_0x55fdf0){return _0x55fdf0[_0x63f7('0x22')](_0x6e77b5)['then'](function(_0x4e880c){return _0x4e880c;});}return null;};}function removeEntity(_0x108f96,_0x1f8a91){return function(_0x3494f2){if(_0x3494f2){return _0x3494f2['destroy']()[_0x63f7('0x23')](function(){_0x108f96[_0x63f7('0x19')](0xcc)[_0x63f7('0x24')]();});}};}function handleEntityNotFound(_0x2b947a,_0x338565){return function(_0x140ec3){if(!_0x140ec3){_0x2b947a[_0x63f7('0x18')](0x194);}return _0x140ec3;};}function handleError(_0x56a6ce,_0x1da9fe){_0x1da9fe=_0x1da9fe||0x1f4;return function(_0x465f24){logger['error'](_0x465f24[_0x63f7('0x25')]);if(_0x465f24[_0x63f7('0x26')]){delete _0x465f24[_0x63f7('0x26')];}_0x56a6ce['status'](_0x1da9fe)['send'](_0x465f24);};}exports[_0x63f7('0x27')]=function(_0x21ed5e,_0x175237){var _0x289427={},_0x5c2bf4={},_0x4b5447={'count':0x0,'rows':[]};var _0x403791=_['map'](db[_0x63f7('0x28')][_0x63f7('0x29')],function(_0x38aeb3){return{'name':_0x38aeb3[_0x63f7('0x2a')],'type':_0x38aeb3[_0x63f7('0x2b')][_0x63f7('0x2c')]};});_0x5c2bf4[_0x63f7('0x2d')]=_[_0x63f7('0x2e')](_0x403791,_0x63f7('0x26'));_0x5c2bf4[_0x63f7('0x2f')]=_[_0x63f7('0x30')](_0x21ed5e['query']);_0x5c2bf4[_0x63f7('0x31')]=_['intersection'](_0x5c2bf4[_0x63f7('0x2d')],_0x5c2bf4[_0x63f7('0x2f')]);_0x289427[_0x63f7('0x32')]=_['intersection'](_0x5c2bf4[_0x63f7('0x2d')],qs[_0x63f7('0x33')](_0x21ed5e[_0x63f7('0x2f')]['fields']));_0x289427[_0x63f7('0x32')]=_0x289427[_0x63f7('0x32')][_0x63f7('0x34')]?_0x289427['attributes']:_0x5c2bf4[_0x63f7('0x2d')];if(!_0x21ed5e[_0x63f7('0x2f')][_0x63f7('0x35')](_0x63f7('0x36'))){_0x289427['limit']=qs[_0x63f7('0x1c')](_0x21ed5e['query'][_0x63f7('0x1c')]);_0x289427[_0x63f7('0x1a')]=qs['offset'](_0x21ed5e[_0x63f7('0x2f')]['offset']);}_0x289427[_0x63f7('0x37')]=qs[_0x63f7('0x38')](_0x21ed5e['query'][_0x63f7('0x38')]);_0x289427[_0x63f7('0x39')]=qs['filters'](_[_0x63f7('0x3a')](_0x21ed5e[_0x63f7('0x2f')],_0x5c2bf4[_0x63f7('0x31')]),_0x403791);if(_0x21ed5e[_0x63f7('0x2f')]['filter']){_0x289427[_0x63f7('0x39')]=_[_0x63f7('0x3b')](_0x289427[_0x63f7('0x39')],{'$or':_[_0x63f7('0x2e')](_0x403791,function(_0x51b668){if(_0x51b668['type']!==_0x63f7('0x3c')){var _0x1aad5f={};_0x1aad5f[_0x51b668[_0x63f7('0x26')]]={'$like':'%'+_0x21ed5e[_0x63f7('0x2f')][_0x63f7('0x3d')]+'%'};return _0x1aad5f;}})});}_0x289427=_[_0x63f7('0x3b')]({},_0x289427,_0x21ed5e['options']);var _0x3df944={'where':_0x289427[_0x63f7('0x39')]};return db[_0x63f7('0x28')]['count'](_0x3df944)[_0x63f7('0x23')](function(_0x45423f){_0x4b5447[_0x63f7('0x3e')]=_0x45423f;if(_0x21ed5e[_0x63f7('0x2f')][_0x63f7('0x3f')]){_0x289427[_0x63f7('0x40')]=[{'all':!![]}];}return db[_0x63f7('0x28')][_0x63f7('0x41')](_0x289427);})[_0x63f7('0x23')](function(_0x4ef016){_0x4b5447[_0x63f7('0x42')]=_0x4ef016;return _0x4b5447;})['then'](respondWithFilteredResult(_0x175237,_0x289427))[_0x63f7('0x43')](handleError(_0x175237,null));};exports[_0x63f7('0x44')]=function(_0x1fa779,_0x2b6a90){var _0x43a021={'raw':!![],'where':{'id':_0x1fa779[_0x63f7('0x45')]['id']}},_0x22890c={};_0x22890c[_0x63f7('0x2d')]=_[_0x63f7('0x30')](db[_0x63f7('0x28')][_0x63f7('0x29')]);_0x22890c[_0x63f7('0x2f')]=_['keys'](_0x1fa779['query']);_0x22890c[_0x63f7('0x31')]=_[_0x63f7('0x46')](_0x22890c[_0x63f7('0x2d')],_0x22890c[_0x63f7('0x2f')]);_0x43a021[_0x63f7('0x32')]=_[_0x63f7('0x46')](_0x22890c[_0x63f7('0x2d')],qs[_0x63f7('0x33')](_0x1fa779['query'][_0x63f7('0x33')]));_0x43a021['attributes']=_0x43a021['attributes'][_0x63f7('0x34')]?_0x43a021[_0x63f7('0x32')]:_0x22890c[_0x63f7('0x2d')];if(_0x1fa779[_0x63f7('0x2f')][_0x63f7('0x3f')]){_0x43a021[_0x63f7('0x40')]=[{'all':!![]}];}_0x43a021=_[_0x63f7('0x3b')]({},_0x43a021,_0x1fa779['options']);return db['JscriptyQuestionReport'][_0x63f7('0x47')](_0x43a021)[_0x63f7('0x23')](handleEntityNotFound(_0x2b6a90,null))['then'](respondWithResult(_0x2b6a90,null))[_0x63f7('0x43')](handleError(_0x2b6a90,null));};exports[_0x63f7('0x48')]=function(_0x2ed47d,_0x289e50){return db[_0x63f7('0x28')][_0x63f7('0x48')](_0x2ed47d[_0x63f7('0x49')],{})[_0x63f7('0x23')](respondWithResult(_0x289e50,0xc9))[_0x63f7('0x43')](handleError(_0x289e50,null));};exports[_0x63f7('0x22')]=function(_0x239e0e,_0x4da1d0){if(_0x239e0e['body']['id']){delete _0x239e0e[_0x63f7('0x49')]['id'];}return db[_0x63f7('0x28')][_0x63f7('0x47')]({'where':{'id':_0x239e0e[_0x63f7('0x45')]['id']}})[_0x63f7('0x23')](handleEntityNotFound(_0x4da1d0,null))[_0x63f7('0x23')](saveUpdates(_0x239e0e[_0x63f7('0x49')],null))['then'](respondWithResult(_0x4da1d0,null))[_0x63f7('0x43')](handleError(_0x4da1d0,null));};exports[_0x63f7('0x4a')]=function(_0x3920d5,_0x246ada){return db[_0x63f7('0x28')][_0x63f7('0x47')]({'where':{'id':_0x3920d5[_0x63f7('0x45')]['id']}})[_0x63f7('0x23')](handleEntityNotFound(_0x246ada,null))[_0x63f7('0x23')](removeEntity(_0x246ada,null))[_0x63f7('0x43')](handleError(_0x246ada,null));};exports['describe']=function(_0x3b253c,_0x359fa2){return db[_0x63f7('0x28')]['describe']()[_0x63f7('0x23')](respondWithResult(_0x359fa2,null))['catch'](handleError(_0x359fa2,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 214bb1d..01b495c 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 _0xd146=['JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./jscriptyQuestionReport.attributes','exports','define'];(function(_0x4990d5,_0xe2c486){var _0x275e25=function(_0x4de73e){while(--_0x4de73e){_0x4990d5['push'](_0x4990d5['shift']());}};_0x275e25(++_0xe2c486);}(_0xd146,0x1d6));var _0x6d14=function(_0x4e6c22,_0x53e287){_0x4e6c22=_0x4e6c22-0x0;var _0x612a71=_0xd146[_0x4e6c22];return _0x612a71;};'use strict';var _=require(_0x6d14('0x0'));var util=require(_0x6d14('0x1'));var logger=require(_0x6d14('0x2'))(_0x6d14('0x3'));var moment=require('moment');var BPromise=require(_0x6d14('0x4'));var rp=require(_0x6d14('0x5'));var fs=require('fs');var path=require(_0x6d14('0x6'));var rimraf=require(_0x6d14('0x7'));var config=require('../../config/environment');var attributes=require(_0x6d14('0x8'));module[_0x6d14('0x9')]=function(_0x4eca09,_0x111221){return _0x4eca09[_0x6d14('0xa')](_0x6d14('0xb'),attributes,{'tableName':_0x6d14('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x339d=['./jscriptyQuestionReport.attributes','exports','JscriptyQuestionReport','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x339d,0x1d7));var _0xd339=function(_0x7791d5,_0xdab65f){_0x7791d5=_0x7791d5-0x0;var _0x5ce288=_0x339d[_0x7791d5];return _0x5ce288;};'use strict';var _=require(_0xd339('0x0'));var util=require('util');var logger=require(_0xd339('0x1'))(_0xd339('0x2'));var moment=require(_0xd339('0x3'));var BPromise=require(_0xd339('0x4'));var rp=require(_0xd339('0x5'));var fs=require('fs');var path=require(_0xd339('0x6'));var rimraf=require(_0xd339('0x7'));var config=require(_0xd339('0x8'));var attributes=require(_0xd339('0x9'));module[_0xd339('0xa')]=function(_0x2a845f,_0x52544d){return _0x2a845f['define'](_0xd339('0xb'),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 713c62a..f315688 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 _0xedc0=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','error','code','message','JscriptyQuestionReport,\x20%s,\x20%s','catch','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x385122,_0x1235ff){var _0x7a38f=function(_0x1500c3){while(--_0x1500c3){_0x385122['push'](_0x385122['shift']());}};_0x7a38f(++_0x1235ff);}(_0xedc0,0x163));var _0x0edc=function(_0x5f08a6,_0x400121){_0x5f08a6=_0x5f08a6-0x0;var _0x5d0641=_0xedc0[_0x5f08a6];return _0x5d0641;};'use strict';var _=require('lodash');var util=require(_0x0edc('0x0'));var moment=require(_0x0edc('0x1'));var BPromise=require(_0x0edc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0edc('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0edc('0x4'));var logger=require(_0x0edc('0x5'))('rpc');var config=require(_0x0edc('0x6'));var jayson=require(_0x0edc('0x7'));var client=jayson[_0x0edc('0x8')][_0x0edc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a182d,_0x168219,_0x2e16d7){return new BPromise(function(_0x4a98fc,_0x5804d9){return client[_0x0edc('0xa')](_0x1a182d,_0x2e16d7)[_0x0edc('0xb')](function(_0x547b29){logger[_0x0edc('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x168219,'request\x20sent');logger[_0x0edc('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x168219,_0x0edc('0xe'),JSON['stringify'](_0x547b29));if(_0x547b29[_0x0edc('0xf')]){if(_0x547b29[_0x0edc('0xf')][_0x0edc('0x10')]===0x1f4){logger[_0x0edc('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x168219,_0x547b29['error'][_0x0edc('0x11')]);return _0x5804d9(_0x547b29[_0x0edc('0xf')][_0x0edc('0x11')]);}logger[_0x0edc('0xf')](_0x0edc('0x12'),_0x168219,_0x547b29[_0x0edc('0xf')][_0x0edc('0x11')]);return _0x4a98fc(_0x547b29[_0x0edc('0xf')][_0x0edc('0x11')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x168219,'request\x20sent');_0x4a98fc(_0x547b29['result'][_0x0edc('0x11')]);}})[_0x0edc('0x13')](function(_0x39e2b2){logger[_0x0edc('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x168219,_0x39e2b2);_0x5804d9(_0x39e2b2);});});} \ No newline at end of file +var _0x04c4=['request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1ad7fc,_0x444145){var _0x3bb433=function(_0x1e27ef){while(--_0x1e27ef){_0x1ad7fc['push'](_0x1ad7fc['shift']());}};_0x3bb433(++_0x444145);}(_0x04c4,0x68));var _0x404c=function(_0x454165,_0x1f3e74){_0x454165=_0x454165-0x0;var _0x56db53=_0x04c4[_0x454165];return _0x56db53;};'use strict';var _=require(_0x404c('0x0'));var util=require('util');var moment=require(_0x404c('0x1'));var BPromise=require('bluebird');var rs=require(_0x404c('0x2'));var fs=require('fs');var Redis=require(_0x404c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x404c('0x4'));var logger=require(_0x404c('0x5'))(_0x404c('0x6'));var config=require(_0x404c('0x7'));var jayson=require(_0x404c('0x8'));var client=jayson[_0x404c('0x9')][_0x404c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x75d2da,_0x10b14c,_0x61fbea){return new BPromise(function(_0x152931,_0x4aa7f8){return client[_0x404c('0xb')](_0x75d2da,_0x61fbea)[_0x404c('0xc')](function(_0x2058e8){logger[_0x404c('0xd')](_0x404c('0xe'),_0x10b14c,_0x404c('0xf'));logger[_0x404c('0x10')](_0x404c('0x11'),_0x10b14c,_0x404c('0xf'),JSON['stringify'](_0x2058e8));if(_0x2058e8['error']){if(_0x2058e8[_0x404c('0x12')][_0x404c('0x13')]===0x1f4){logger['error'](_0x404c('0xe'),_0x10b14c,_0x2058e8['error'][_0x404c('0x14')]);return _0x4aa7f8(_0x2058e8[_0x404c('0x12')][_0x404c('0x14')]);}logger['error'](_0x404c('0xe'),_0x10b14c,_0x2058e8[_0x404c('0x12')][_0x404c('0x14')]);return _0x152931(_0x2058e8[_0x404c('0x12')][_0x404c('0x14')]);}else{logger['info'](_0x404c('0xe'),_0x10b14c,_0x404c('0xf'));_0x152931(_0x2058e8[_0x404c('0x15')]['message']);}})[_0x404c('0x16')](function(_0x17b363){logger[_0x404c('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x10b14c,_0x17b363);_0x4aa7f8(_0x17b363);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index a5d6970..af739b7 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 _0x8132=['../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/questions','getQuestions','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x287098,_0x11e7dd){var _0x1547a0=function(_0x39fe2b){while(--_0x39fe2b){_0x287098['push'](_0x287098['shift']());}};_0x1547a0(++_0x11e7dd);}(_0x8132,0x124));var _0x2813=function(_0x2bf251,_0x3d236a){_0x2bf251=_0x2bf251-0x0;var _0x56ceb2=_0x8132[_0x2bf251];return _0x56ceb2;};'use strict';var multer=require(_0x2813('0x0'));var util=require(_0x2813('0x1'));var path=require(_0x2813('0x2'));var timeout=require(_0x2813('0x3'));var express=require(_0x2813('0x4'));var router=express['Router']();var fs_extra=require(_0x2813('0x5'));var auth=require(_0x2813('0x6'));var interaction=require(_0x2813('0x7'));var config=require(_0x2813('0x8'));var controller=require(_0x2813('0x9'));router[_0x2813('0xa')]('/',auth[_0x2813('0xb')](),controller[_0x2813('0xc')]);router['get'](_0x2813('0xd'),auth[_0x2813('0xb')](),controller[_0x2813('0xe')]);router['get'](_0x2813('0xf'),auth[_0x2813('0xb')](),controller[_0x2813('0x10')]);router[_0x2813('0xa')](_0x2813('0x11'),auth[_0x2813('0xb')](),controller[_0x2813('0x12')]);router[_0x2813('0x13')]('/',auth[_0x2813('0xb')](),controller[_0x2813('0x14')]);router[_0x2813('0x15')](_0x2813('0xf'),auth[_0x2813('0xb')](),controller[_0x2813('0x16')]);router[_0x2813('0x17')](_0x2813('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x2813('0x18')]=router; \ No newline at end of file +var _0x41b1=['show','/:id/questions','getQuestions','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','/describe','/:id'];(function(_0x3fee90,_0x106177){var _0x3f014c=function(_0x191e90){while(--_0x191e90){_0x3fee90['push'](_0x3fee90['shift']());}};_0x3f014c(++_0x106177);}(_0x41b1,0x16f));var _0x141b=function(_0x404eed,_0x5390c5){_0x404eed=_0x404eed-0x0;var _0xd45887=_0x41b1[_0x404eed];return _0xd45887;};'use strict';var multer=require(_0x141b('0x0'));var util=require(_0x141b('0x1'));var path=require('path');var timeout=require(_0x141b('0x2'));var express=require(_0x141b('0x3'));var router=express[_0x141b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x141b('0x5'));var controller=require(_0x141b('0x6'));router[_0x141b('0x7')]('/',auth[_0x141b('0x8')](),controller['index']);router[_0x141b('0x7')](_0x141b('0x9'),auth[_0x141b('0x8')](),controller['describe']);router[_0x141b('0x7')](_0x141b('0xa'),auth[_0x141b('0x8')](),controller[_0x141b('0xb')]);router[_0x141b('0x7')](_0x141b('0xc'),auth['isAuthenticated'](),controller[_0x141b('0xd')]);router[_0x141b('0xe')]('/',auth[_0x141b('0x8')](),controller[_0x141b('0xf')]);router[_0x141b('0x10')](_0x141b('0xa'),auth[_0x141b('0x8')](),controller[_0x141b('0x11')]);router[_0x141b('0x12')](_0x141b('0xa'),auth[_0x141b('0x8')](),controller[_0x141b('0x13')]);module[_0x141b('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index b227a19..f33c726 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 _0x14ec=['STRING','moment','exports','DATE','setDataValue','starttime','format'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x14ec,0x127));var _0xc14e=function(_0x103fe9,_0x54de0c){_0x103fe9=_0x103fe9-0x0;var _0x230bae=_0x14ec[_0x103fe9];return _0x230bae;};'use strict';var moment=require(_0xc14e('0x0'));var Sequelize=require('sequelize');module[_0xc14e('0x1')]={'starttime':{'type':Sequelize[_0xc14e('0x2')],'set':function(_0x3b7af9){this[_0xc14e('0x3')](_0xc14e('0x4'),_0x3b7af9);this[_0xc14e('0x3')]('endtime',moment()[_0xc14e('0x5')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xc14e('0x6')]},'projectname':{'type':Sequelize[_0xc14e('0x6')]},'queue':{'type':Sequelize[_0xc14e('0x6')]},'uniqueid':{'type':Sequelize[_0xc14e('0x6')]},'calleridname':{'type':Sequelize[_0xc14e('0x6')]},'calleridnum':{'type':Sequelize[_0xc14e('0x6')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x9d9c=['BOOLEAN','moment','DATE','setDataValue','endtime','format','STRING'];(function(_0x5b30d8,_0xc6a96f){var _0x13786c=function(_0x269615){while(--_0x269615){_0x5b30d8['push'](_0x5b30d8['shift']());}};_0x13786c(++_0xc6a96f);}(_0x9d9c,0x189));var _0xc9d9=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x9d9c[_0x710815];return _0x5b3b89;};'use strict';var moment=require(_0xc9d9('0x0'));var Sequelize=require('sequelize');module['exports']={'starttime':{'type':Sequelize[_0xc9d9('0x1')],'set':function(_0x38a8b5){this[_0xc9d9('0x2')]('starttime',_0x38a8b5);this['setDataValue'](_0xc9d9('0x3'),moment()[_0xc9d9('0x4')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xc9d9('0x1')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xc9d9('0x5')]},'queue':{'type':Sequelize[_0xc9d9('0x5')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xc9d9('0x5')]},'calleridnum':{'type':Sequelize[_0xc9d9('0x5')]},'completed':{'type':Sequelize[_0xc9d9('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 5b0daa4..4dd2f20 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 _0xf6a4=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','JscriptySessionReport','rawAttributes','keys','query','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','includeAll','include','rows','catch','show','params','fields','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','options','findAll','eml-format','zip-dir','fast-json-patch'];(function(_0x5382fe,_0x9b02a){var _0x2c0146=function(_0x9c63f8){while(--_0x9c63f8){_0x5382fe['push'](_0x5382fe['shift']());}};_0x2c0146(++_0x9b02a);}(_0xf6a4,0x141));var _0x4f6a=function(_0x5cca6b,_0x1fac54){_0x5cca6b=_0x5cca6b-0x0;var _0xdaecf6=_0xf6a4[_0x5cca6b];return _0xdaecf6;};'use strict';var emlformat=require(_0x4f6a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4f6a('0x1'));var jsonpatch=require(_0x4f6a('0x2'));var rp=require(_0x4f6a('0x3'));var moment=require(_0x4f6a('0x4'));var BPromise=require(_0x4f6a('0x5'));var Mustache=require(_0x4f6a('0x6'));var util=require(_0x4f6a('0x7'));var path=require(_0x4f6a('0x8'));var sox=require(_0x4f6a('0x9'));var csv=require(_0x4f6a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4f6a('0xb'));var squel=require(_0x4f6a('0xc'));var crypto=require(_0x4f6a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4f6a('0xe'));var toCsv=require(_0x4f6a('0xa'));var querystring=require('querystring');var Papa=require(_0x4f6a('0xf'));var Redis=require(_0x4f6a('0x10'));var authService=require(_0x4f6a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4f6a('0x12'));var hardwareService=require(_0x4f6a('0x13'));var logger=require('../../config/logger')(_0x4f6a('0x14'));var utils=require(_0x4f6a('0x15'));var config=require(_0x4f6a('0x16'));var licenseUtil=require(_0x4f6a('0x17'));var db=require(_0x4f6a('0x18'))['db'];function respondWithStatusCode(_0x19ff9f,_0x2c28a2){_0x2c28a2=_0x2c28a2||0xcc;return function(_0x15e609){if(_0x15e609){return _0x19ff9f[_0x4f6a('0x19')](_0x2c28a2);}return _0x19ff9f['status'](_0x2c28a2)[_0x4f6a('0x1a')]();};}function respondWithResult(_0x5248ac,_0x4e76fb){_0x4e76fb=_0x4e76fb||0xc8;return function(_0x3b6c65){if(_0x3b6c65){return _0x5248ac[_0x4f6a('0x1b')](_0x4e76fb)[_0x4f6a('0x1c')](_0x3b6c65);}};}function respondWithFilteredResult(_0x11fce7,_0x1e446a){return function(_0x500e3c){if(_0x500e3c){var _0x26447b=typeof _0x1e446a[_0x4f6a('0x1d')]===_0x4f6a('0x1e')&&typeof _0x1e446a[_0x4f6a('0x1f')]==='undefined';var _0x4e12e2=_0x500e3c[_0x4f6a('0x20')];var _0x52e5a3=_0x26447b?0x0:_0x1e446a[_0x4f6a('0x1d')];var _0x45a09b=_0x26447b?_0x500e3c[_0x4f6a('0x20')]:_0x1e446a['offset']+_0x1e446a[_0x4f6a('0x1f')];var _0x51976a;if(_0x45a09b>=_0x4e12e2){_0x45a09b=_0x4e12e2;_0x51976a=0xc8;}else{_0x51976a=0xce;}_0x11fce7['status'](_0x51976a);return _0x11fce7[_0x4f6a('0x21')](_0x4f6a('0x22'),_0x52e5a3+'-'+_0x45a09b+'/'+_0x4e12e2)[_0x4f6a('0x1c')](_0x500e3c);}return null;};}function patchUpdates(_0x23a257){return function(_0x2f645a){try{jsonpatch[_0x4f6a('0x23')](_0x2f645a,_0x23a257,!![]);}catch(_0x171742){return BPromise[_0x4f6a('0x24')](_0x171742);}return _0x2f645a[_0x4f6a('0x25')]();};}function saveUpdates(_0x428f72,_0x290e7f){return function(_0x1676bb){if(_0x1676bb){return _0x1676bb[_0x4f6a('0x26')](_0x428f72)[_0x4f6a('0x27')](function(_0x190481){return _0x190481;});}return null;};}function removeEntity(_0x152780,_0x20da62){return function(_0x4c78a5){if(_0x4c78a5){return _0x4c78a5[_0x4f6a('0x28')]()[_0x4f6a('0x27')](function(){_0x152780[_0x4f6a('0x1b')](0xcc)[_0x4f6a('0x1a')]();});}};}function handleEntityNotFound(_0x442eab,_0x1e0ab0){return function(_0x310482){if(!_0x310482){_0x442eab[_0x4f6a('0x19')](0x194);}return _0x310482;};}function handleError(_0x4f8615,_0x5ba02d){_0x5ba02d=_0x5ba02d||0x1f4;return function(_0x169676){logger[_0x4f6a('0x29')](_0x169676['stack']);if(_0x169676[_0x4f6a('0x2a')]){delete _0x169676[_0x4f6a('0x2a')];}_0x4f8615['status'](_0x5ba02d)[_0x4f6a('0x2b')](_0x169676);};}exports[_0x4f6a('0x2c')]=function(_0x5cca90,_0x58b199){var _0x11944e={},_0x2a09ce={},_0x44ecec={'count':0x0,'rows':[]};var _0x210800=_[_0x4f6a('0x2d')](db[_0x4f6a('0x2e')][_0x4f6a('0x2f')],function(_0xf55956){return{'name':_0xf55956['fieldName'],'type':_0xf55956['type']['key']};});_0x2a09ce['model']=_[_0x4f6a('0x2d')](_0x210800,_0x4f6a('0x2a'));_0x2a09ce['query']=_[_0x4f6a('0x30')](_0x5cca90[_0x4f6a('0x31')]);_0x2a09ce[_0x4f6a('0x32')]=_['intersection'](_0x2a09ce[_0x4f6a('0x33')],_0x2a09ce['query']);_0x11944e[_0x4f6a('0x34')]=_[_0x4f6a('0x35')](_0x2a09ce[_0x4f6a('0x33')],qs['fields'](_0x5cca90[_0x4f6a('0x31')]['fields']));_0x11944e[_0x4f6a('0x34')]=_0x11944e['attributes'][_0x4f6a('0x36')]?_0x11944e['attributes']:_0x2a09ce['model'];if(!_0x5cca90[_0x4f6a('0x31')][_0x4f6a('0x37')](_0x4f6a('0x38'))){_0x11944e[_0x4f6a('0x1f')]=qs[_0x4f6a('0x1f')](_0x5cca90['query']['limit']);_0x11944e[_0x4f6a('0x1d')]=qs[_0x4f6a('0x1d')](_0x5cca90[_0x4f6a('0x31')][_0x4f6a('0x1d')]);}_0x11944e[_0x4f6a('0x39')]=qs['sort'](_0x5cca90[_0x4f6a('0x31')][_0x4f6a('0x3a')]);_0x11944e[_0x4f6a('0x3b')]=qs[_0x4f6a('0x32')](_[_0x4f6a('0x3c')](_0x5cca90[_0x4f6a('0x31')],_0x2a09ce[_0x4f6a('0x32')]),_0x210800);if(_0x5cca90[_0x4f6a('0x31')][_0x4f6a('0x3d')]){_0x11944e[_0x4f6a('0x3b')]=_[_0x4f6a('0x3e')](_0x11944e[_0x4f6a('0x3b')],{'$or':_[_0x4f6a('0x2d')](_0x210800,function(_0xaaa1ce){if(_0xaaa1ce[_0x4f6a('0x3f')]!=='VIRTUAL'){var _0x6a609f={};_0x6a609f[_0xaaa1ce[_0x4f6a('0x2a')]]={'$like':'%'+_0x5cca90[_0x4f6a('0x31')][_0x4f6a('0x3d')]+'%'};return _0x6a609f;}})});}_0x11944e=_[_0x4f6a('0x3e')]({},_0x11944e,_0x5cca90['options']);var _0x56cec1={'where':_0x11944e[_0x4f6a('0x3b')]};return db[_0x4f6a('0x2e')][_0x4f6a('0x20')](_0x56cec1)[_0x4f6a('0x27')](function(_0x35ed5c){_0x44ecec[_0x4f6a('0x20')]=_0x35ed5c;if(_0x5cca90[_0x4f6a('0x31')][_0x4f6a('0x40')]){_0x11944e[_0x4f6a('0x41')]=[{'all':!![]}];}return db[_0x4f6a('0x2e')]['findAll'](_0x11944e);})['then'](function(_0x33ce6b){_0x44ecec[_0x4f6a('0x42')]=_0x33ce6b;return _0x44ecec;})['then'](respondWithFilteredResult(_0x58b199,_0x11944e))[_0x4f6a('0x43')](handleError(_0x58b199,null));};exports[_0x4f6a('0x44')]=function(_0x3d1cba,_0x45f5e8){var _0x3995e7={'raw':!![],'where':{'id':_0x3d1cba[_0x4f6a('0x45')]['id']}},_0x3608d3={};_0x3608d3[_0x4f6a('0x33')]=_['keys'](db['JscriptySessionReport'][_0x4f6a('0x2f')]);_0x3608d3[_0x4f6a('0x31')]=_[_0x4f6a('0x30')](_0x3d1cba[_0x4f6a('0x31')]);_0x3608d3[_0x4f6a('0x32')]=_[_0x4f6a('0x35')](_0x3608d3[_0x4f6a('0x33')],_0x3608d3[_0x4f6a('0x31')]);_0x3995e7[_0x4f6a('0x34')]=_[_0x4f6a('0x35')](_0x3608d3[_0x4f6a('0x33')],qs[_0x4f6a('0x46')](_0x3d1cba[_0x4f6a('0x31')][_0x4f6a('0x46')]));_0x3995e7['attributes']=_0x3995e7[_0x4f6a('0x34')][_0x4f6a('0x36')]?_0x3995e7['attributes']:_0x3608d3[_0x4f6a('0x33')];if(_0x3d1cba[_0x4f6a('0x31')]['includeAll']){_0x3995e7[_0x4f6a('0x41')]=[{'all':!![]}];}_0x3995e7=_[_0x4f6a('0x3e')]({},_0x3995e7,_0x3d1cba['options']);return db[_0x4f6a('0x2e')][_0x4f6a('0x47')](_0x3995e7)['then'](handleEntityNotFound(_0x45f5e8,null))[_0x4f6a('0x27')](respondWithResult(_0x45f5e8,null))[_0x4f6a('0x43')](handleError(_0x45f5e8,null));};exports['create']=function(_0x4c58b9,_0xd0e4cb){return db[_0x4f6a('0x2e')][_0x4f6a('0x48')](_0x4c58b9[_0x4f6a('0x49')],{})[_0x4f6a('0x27')](respondWithResult(_0xd0e4cb,0xc9))[_0x4f6a('0x43')](handleError(_0xd0e4cb,null));};exports[_0x4f6a('0x26')]=function(_0x3bae75,_0x40a809){if(_0x3bae75['body']['id']){delete _0x3bae75['body']['id'];}return db['JscriptySessionReport'][_0x4f6a('0x47')]({'where':{'id':_0x3bae75[_0x4f6a('0x45')]['id']}})[_0x4f6a('0x27')](handleEntityNotFound(_0x40a809,null))[_0x4f6a('0x27')](saveUpdates(_0x3bae75[_0x4f6a('0x49')],null))[_0x4f6a('0x27')](respondWithResult(_0x40a809,null))[_0x4f6a('0x43')](handleError(_0x40a809,null));};exports['destroy']=function(_0x1d2ff1,_0x4e4594){return db[_0x4f6a('0x2e')][_0x4f6a('0x47')]({'where':{'id':_0x1d2ff1[_0x4f6a('0x45')]['id']}})[_0x4f6a('0x27')](handleEntityNotFound(_0x4e4594,null))[_0x4f6a('0x27')](removeEntity(_0x4e4594,null))[_0x4f6a('0x43')](handleError(_0x4e4594,null));};exports[_0x4f6a('0x4a')]=function(_0x3d63e0,_0x42903f){return db['JscriptySessionReport']['describe']()['then'](respondWithResult(_0x42903f,null))['catch'](handleError(_0x42903f,null));};exports[_0x4f6a('0x4b')]=function(_0x5e02ac,_0x9520a7,_0x1ba6c7){var _0x32e591={'raw':!![],'where':{}};var _0x498177={};var _0x1ee4c0={'count':0x0,'rows':[]};return db[_0x4f6a('0x2e')][_0x4f6a('0x4c')]({'where':{'id':_0x5e02ac[_0x4f6a('0x45')]['id']}})['then'](handleEntityNotFound(_0x9520a7,null))[_0x4f6a('0x27')](function(_0x5c959a){if(_0x5c959a){_0x498177['model']=_[_0x4f6a('0x30')](db[_0x4f6a('0x4d')][_0x4f6a('0x2f')]);_0x498177[_0x4f6a('0x31')]=_[_0x4f6a('0x30')](_0x5e02ac[_0x4f6a('0x31')]);_0x498177['filters']=_[_0x4f6a('0x35')](_0x498177[_0x4f6a('0x33')],_0x498177['query']);_0x32e591[_0x4f6a('0x34')]=_[_0x4f6a('0x35')](_0x498177['model'],qs[_0x4f6a('0x46')](_0x5e02ac[_0x4f6a('0x31')][_0x4f6a('0x46')]));_0x32e591[_0x4f6a('0x34')]=_0x32e591[_0x4f6a('0x34')]['length']?_0x32e591[_0x4f6a('0x34')]:_0x498177[_0x4f6a('0x33')];if(!_0x5e02ac['query'][_0x4f6a('0x37')]('nolimit')){_0x32e591[_0x4f6a('0x1f')]=qs[_0x4f6a('0x1f')](_0x5e02ac[_0x4f6a('0x31')][_0x4f6a('0x1f')]);_0x32e591[_0x4f6a('0x1d')]=qs[_0x4f6a('0x1d')](_0x5e02ac[_0x4f6a('0x31')][_0x4f6a('0x1d')]);}_0x32e591['order']=qs['sort'](_0x5e02ac['query'][_0x4f6a('0x3a')]);_0x32e591[_0x4f6a('0x3b')]=qs['filters'](_[_0x4f6a('0x3c')](_0x5e02ac['query'],_0x498177['filters']));_0x32e591[_0x4f6a('0x3b')][_0x4f6a('0x4e')]=_0x5c959a['id'];if(_0x5e02ac['query'][_0x4f6a('0x3d')]){_0x32e591[_0x4f6a('0x3b')]=_[_0x4f6a('0x3e')](_0x32e591[_0x4f6a('0x3b')],{'$or':_['map'](_0x32e591[_0x4f6a('0x34')],function(_0x8421b0){var _0x254b0d={};_0x254b0d[_0x8421b0]={'$like':'%'+_0x5e02ac[_0x4f6a('0x31')][_0x4f6a('0x3d')]+'%'};return _0x254b0d;})});}_0x32e591=_[_0x4f6a('0x3e')]({},_0x32e591,_0x5e02ac[_0x4f6a('0x4f')]);return db[_0x4f6a('0x4d')]['count']({'where':_0x32e591[_0x4f6a('0x3b')]})[_0x4f6a('0x27')](function(_0x3d32a1){_0x1ee4c0[_0x4f6a('0x20')]=_0x3d32a1;if(_0x5e02ac[_0x4f6a('0x31')]['includeAll']){_0x32e591['include']=[{'all':!![]}];}return db[_0x4f6a('0x4d')][_0x4f6a('0x50')](_0x32e591);})['then'](function(_0x37da4f){_0x1ee4c0['rows']=_0x37da4f;return _0x1ee4c0;});}})['then'](respondWithFilteredResult(_0x9520a7,_0x32e591))[_0x4f6a('0x43')](handleError(_0x9520a7,null));}; \ No newline at end of file +var _0x5450=['then','destroy','error','stack','name','JscriptySessionReport','rawAttributes','fieldName','type','key','model','map','query','keys','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','catch','params','intersection','options','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','nolimit','SessionId','rows','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','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','json','save','update'];(function(_0x7697b9,_0x4468b4){var _0x8dec85=function(_0x5c4a3f){while(--_0x5c4a3f){_0x7697b9['push'](_0x7697b9['shift']());}};_0x8dec85(++_0x4468b4);}(_0x5450,0x166));var _0x0545=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x5450[_0x56482c];return _0x5aae7a;};'use strict';var emlformat=require(_0x0545('0x0'));var rimraf=require(_0x0545('0x1'));var zipdir=require(_0x0545('0x2'));var jsonpatch=require(_0x0545('0x3'));var rp=require('request-promise');var moment=require(_0x0545('0x4'));var BPromise=require(_0x0545('0x5'));var Mustache=require(_0x0545('0x6'));var util=require(_0x0545('0x7'));var path=require(_0x0545('0x8'));var sox=require(_0x0545('0x9'));var csv=require(_0x0545('0xa'));var ejs=require(_0x0545('0xb'));var fs=require('fs');var fs_extra=require(_0x0545('0xc'));var _=require('lodash');var squel=require(_0x0545('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0545('0xe'));var toCsv=require(_0x0545('0xa'));var querystring=require('querystring');var Papa=require(_0x0545('0xf'));var Redis=require(_0x0545('0x10'));var authService=require(_0x0545('0x11'));var qs=require(_0x0545('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0545('0x13'));var logger=require(_0x0545('0x14'))(_0x0545('0x15'));var utils=require(_0x0545('0x16'));var config=require(_0x0545('0x17'));var licenseUtil=require(_0x0545('0x18'));var db=require(_0x0545('0x19'))['db'];function respondWithStatusCode(_0x371af6,_0x1d94bc){_0x1d94bc=_0x1d94bc||0xcc;return function(_0x1cbaeb){if(_0x1cbaeb){return _0x371af6[_0x0545('0x1a')](_0x1d94bc);}return _0x371af6[_0x0545('0x1b')](_0x1d94bc)[_0x0545('0x1c')]();};}function respondWithResult(_0x9720b6,_0x4fcdfd){_0x4fcdfd=_0x4fcdfd||0xc8;return function(_0x2f1fe1){if(_0x2f1fe1){return _0x9720b6[_0x0545('0x1b')](_0x4fcdfd)['json'](_0x2f1fe1);}};}function respondWithFilteredResult(_0x1a87df,_0x50b9de){return function(_0x13f990){if(_0x13f990){var _0x11e794=typeof _0x50b9de[_0x0545('0x1d')]===_0x0545('0x1e')&&typeof _0x50b9de[_0x0545('0x1f')]===_0x0545('0x1e');var _0x14eefc=_0x13f990[_0x0545('0x20')];var _0x4b3bf8=_0x11e794?0x0:_0x50b9de['offset'];var _0xd06f57=_0x11e794?_0x13f990['count']:_0x50b9de[_0x0545('0x1d')]+_0x50b9de[_0x0545('0x1f')];var _0x58b681;if(_0xd06f57>=_0x14eefc){_0xd06f57=_0x14eefc;_0x58b681=0xc8;}else{_0x58b681=0xce;}_0x1a87df['status'](_0x58b681);return _0x1a87df[_0x0545('0x21')]('Content-Range',_0x4b3bf8+'-'+_0xd06f57+'/'+_0x14eefc)[_0x0545('0x22')](_0x13f990);}return null;};}function patchUpdates(_0x599b11){return function(_0x5d00a2){try{jsonpatch['apply'](_0x5d00a2,_0x599b11,!![]);}catch(_0xd160e9){return BPromise['reject'](_0xd160e9);}return _0x5d00a2[_0x0545('0x23')]();};}function saveUpdates(_0x2672fb,_0x545aa7){return function(_0x37a18f){if(_0x37a18f){return _0x37a18f[_0x0545('0x24')](_0x2672fb)[_0x0545('0x25')](function(_0x49e43a){return _0x49e43a;});}return null;};}function removeEntity(_0x531384,_0x479f16){return function(_0x219d9e){if(_0x219d9e){return _0x219d9e[_0x0545('0x26')]()[_0x0545('0x25')](function(){_0x531384[_0x0545('0x1b')](0xcc)[_0x0545('0x1c')]();});}};}function handleEntityNotFound(_0x34f12a,_0x4f08ea){return function(_0x4338b4){if(!_0x4338b4){_0x34f12a['sendStatus'](0x194);}return _0x4338b4;};}function handleError(_0x4f3acf,_0xecd2c8){_0xecd2c8=_0xecd2c8||0x1f4;return function(_0x541ad2){logger[_0x0545('0x27')](_0x541ad2[_0x0545('0x28')]);if(_0x541ad2['name']){delete _0x541ad2[_0x0545('0x29')];}_0x4f3acf['status'](_0xecd2c8)['send'](_0x541ad2);};}exports['index']=function(_0x1bb8e0,_0x2d3e49){var _0x3115ae={},_0x1d6134={},_0x16157c={'count':0x0,'rows':[]};var _0x58dfe7=_['map'](db[_0x0545('0x2a')][_0x0545('0x2b')],function(_0x2fc144){return{'name':_0x2fc144[_0x0545('0x2c')],'type':_0x2fc144[_0x0545('0x2d')][_0x0545('0x2e')]};});_0x1d6134[_0x0545('0x2f')]=_[_0x0545('0x30')](_0x58dfe7,_0x0545('0x29'));_0x1d6134[_0x0545('0x31')]=_[_0x0545('0x32')](_0x1bb8e0['query']);_0x1d6134['filters']=_['intersection'](_0x1d6134[_0x0545('0x2f')],_0x1d6134['query']);_0x3115ae['attributes']=_['intersection'](_0x1d6134['model'],qs[_0x0545('0x33')](_0x1bb8e0[_0x0545('0x31')][_0x0545('0x33')]));_0x3115ae[_0x0545('0x34')]=_0x3115ae[_0x0545('0x34')][_0x0545('0x35')]?_0x3115ae[_0x0545('0x34')]:_0x1d6134[_0x0545('0x2f')];if(!_0x1bb8e0[_0x0545('0x31')][_0x0545('0x36')]('nolimit')){_0x3115ae[_0x0545('0x1f')]=qs[_0x0545('0x1f')](_0x1bb8e0[_0x0545('0x31')]['limit']);_0x3115ae[_0x0545('0x1d')]=qs[_0x0545('0x1d')](_0x1bb8e0[_0x0545('0x31')]['offset']);}_0x3115ae[_0x0545('0x37')]=qs[_0x0545('0x38')](_0x1bb8e0['query'][_0x0545('0x38')]);_0x3115ae[_0x0545('0x39')]=qs[_0x0545('0x3a')](_[_0x0545('0x3b')](_0x1bb8e0[_0x0545('0x31')],_0x1d6134['filters']),_0x58dfe7);if(_0x1bb8e0[_0x0545('0x31')][_0x0545('0x3c')]){_0x3115ae['where']=_[_0x0545('0x3d')](_0x3115ae[_0x0545('0x39')],{'$or':_[_0x0545('0x30')](_0x58dfe7,function(_0x1603a3){if(_0x1603a3[_0x0545('0x2d')]!=='VIRTUAL'){var _0x4ebbbf={};_0x4ebbbf[_0x1603a3['name']]={'$like':'%'+_0x1bb8e0['query']['filter']+'%'};return _0x4ebbbf;}})});}_0x3115ae=_[_0x0545('0x3d')]({},_0x3115ae,_0x1bb8e0['options']);var _0x39d0b5={'where':_0x3115ae[_0x0545('0x39')]};return db[_0x0545('0x2a')][_0x0545('0x20')](_0x39d0b5)[_0x0545('0x25')](function(_0xfd4f47){_0x16157c[_0x0545('0x20')]=_0xfd4f47;if(_0x1bb8e0[_0x0545('0x31')][_0x0545('0x3e')]){_0x3115ae[_0x0545('0x3f')]=[{'all':!![]}];}return db[_0x0545('0x2a')][_0x0545('0x40')](_0x3115ae);})['then'](function(_0x96aad0){_0x16157c['rows']=_0x96aad0;return _0x16157c;})[_0x0545('0x25')](respondWithFilteredResult(_0x2d3e49,_0x3115ae))[_0x0545('0x41')](handleError(_0x2d3e49,null));};exports['show']=function(_0x478454,_0x45e35f){var _0x64a5dd={'raw':!![],'where':{'id':_0x478454[_0x0545('0x42')]['id']}},_0x14b810={};_0x14b810['model']=_[_0x0545('0x32')](db[_0x0545('0x2a')][_0x0545('0x2b')]);_0x14b810[_0x0545('0x31')]=_[_0x0545('0x32')](_0x478454['query']);_0x14b810[_0x0545('0x3a')]=_[_0x0545('0x43')](_0x14b810[_0x0545('0x2f')],_0x14b810[_0x0545('0x31')]);_0x64a5dd[_0x0545('0x34')]=_['intersection'](_0x14b810[_0x0545('0x2f')],qs[_0x0545('0x33')](_0x478454['query'][_0x0545('0x33')]));_0x64a5dd['attributes']=_0x64a5dd[_0x0545('0x34')]['length']?_0x64a5dd[_0x0545('0x34')]:_0x14b810[_0x0545('0x2f')];if(_0x478454['query'][_0x0545('0x3e')]){_0x64a5dd['include']=[{'all':!![]}];}_0x64a5dd=_[_0x0545('0x3d')]({},_0x64a5dd,_0x478454[_0x0545('0x44')]);return db[_0x0545('0x2a')][_0x0545('0x45')](_0x64a5dd)[_0x0545('0x25')](handleEntityNotFound(_0x45e35f,null))[_0x0545('0x25')](respondWithResult(_0x45e35f,null))[_0x0545('0x41')](handleError(_0x45e35f,null));};exports['create']=function(_0x14f546,_0x4e1940){return db['JscriptySessionReport'][_0x0545('0x46')](_0x14f546[_0x0545('0x47')],{})['then'](respondWithResult(_0x4e1940,0xc9))[_0x0545('0x41')](handleError(_0x4e1940,null));};exports['update']=function(_0x22ee30,_0x248b5d){if(_0x22ee30[_0x0545('0x47')]['id']){delete _0x22ee30[_0x0545('0x47')]['id'];}return db[_0x0545('0x2a')][_0x0545('0x45')]({'where':{'id':_0x22ee30['params']['id']}})[_0x0545('0x25')](handleEntityNotFound(_0x248b5d,null))[_0x0545('0x25')](saveUpdates(_0x22ee30['body'],null))[_0x0545('0x25')](respondWithResult(_0x248b5d,null))[_0x0545('0x41')](handleError(_0x248b5d,null));};exports[_0x0545('0x26')]=function(_0x2f449a,_0x5b7d02){return db[_0x0545('0x2a')][_0x0545('0x45')]({'where':{'id':_0x2f449a[_0x0545('0x42')]['id']}})['then'](handleEntityNotFound(_0x5b7d02,null))[_0x0545('0x25')](removeEntity(_0x5b7d02,null))[_0x0545('0x41')](handleError(_0x5b7d02,null));};exports[_0x0545('0x48')]=function(_0x13dfe0,_0x5632a2){return db['JscriptySessionReport']['describe']()[_0x0545('0x25')](respondWithResult(_0x5632a2,null))[_0x0545('0x41')](handleError(_0x5632a2,null));};exports[_0x0545('0x49')]=function(_0x4b9f75,_0x1175ed,_0x5d9e87){var _0x11962c={'raw':!![],'where':{}};var _0x5a0897={};var _0x12cc35={'count':0x0,'rows':[]};return db[_0x0545('0x2a')][_0x0545('0x4a')]({'where':{'id':_0x4b9f75[_0x0545('0x42')]['id']}})['then'](handleEntityNotFound(_0x1175ed,null))['then'](function(_0x47f31f){if(_0x47f31f){_0x5a0897[_0x0545('0x2f')]=_['keys'](db[_0x0545('0x4b')][_0x0545('0x2b')]);_0x5a0897[_0x0545('0x31')]=_[_0x0545('0x32')](_0x4b9f75['query']);_0x5a0897[_0x0545('0x3a')]=_[_0x0545('0x43')](_0x5a0897[_0x0545('0x2f')],_0x5a0897[_0x0545('0x31')]);_0x11962c['attributes']=_[_0x0545('0x43')](_0x5a0897[_0x0545('0x2f')],qs['fields'](_0x4b9f75[_0x0545('0x31')]['fields']));_0x11962c[_0x0545('0x34')]=_0x11962c[_0x0545('0x34')]['length']?_0x11962c['attributes']:_0x5a0897['model'];if(!_0x4b9f75[_0x0545('0x31')][_0x0545('0x36')](_0x0545('0x4c'))){_0x11962c[_0x0545('0x1f')]=qs[_0x0545('0x1f')](_0x4b9f75[_0x0545('0x31')][_0x0545('0x1f')]);_0x11962c['offset']=qs[_0x0545('0x1d')](_0x4b9f75['query'][_0x0545('0x1d')]);}_0x11962c['order']=qs[_0x0545('0x38')](_0x4b9f75['query'][_0x0545('0x38')]);_0x11962c['where']=qs['filters'](_[_0x0545('0x3b')](_0x4b9f75['query'],_0x5a0897[_0x0545('0x3a')]));_0x11962c[_0x0545('0x39')][_0x0545('0x4d')]=_0x47f31f['id'];if(_0x4b9f75['query'][_0x0545('0x3c')]){_0x11962c[_0x0545('0x39')]=_[_0x0545('0x3d')](_0x11962c[_0x0545('0x39')],{'$or':_['map'](_0x11962c['attributes'],function(_0x3f97fd){var _0x468396={};_0x468396[_0x3f97fd]={'$like':'%'+_0x4b9f75[_0x0545('0x31')][_0x0545('0x3c')]+'%'};return _0x468396;})});}_0x11962c=_[_0x0545('0x3d')]({},_0x11962c,_0x4b9f75[_0x0545('0x44')]);return db[_0x0545('0x4b')][_0x0545('0x20')]({'where':_0x11962c[_0x0545('0x39')]})['then'](function(_0xbc645a){_0x12cc35[_0x0545('0x20')]=_0xbc645a;if(_0x4b9f75['query'][_0x0545('0x3e')]){_0x11962c['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x0545('0x40')](_0x11962c);})['then'](function(_0x69c4e1){_0x12cc35[_0x0545('0x4e')]=_0x69c4e1;return _0x12cc35;});}})[_0x0545('0x25')](respondWithFilteredResult(_0x1175ed,_0x11962c))[_0x0545('0x41')](handleError(_0x1175ed,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 01f2a09..a060fd1 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 _0x90b1=['define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x33bb6b,_0x4212c3){var _0x5150a4=function(_0x4d113d){while(--_0x4d113d){_0x33bb6b['push'](_0x33bb6b['shift']());}};_0x5150a4(++_0x4212c3);}(_0x90b1,0x1bb));var _0x190b=function(_0x12efa0,_0x579590){_0x12efa0=_0x12efa0-0x0;var _0x158c02=_0x90b1[_0x12efa0];return _0x158c02;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var logger=require(_0x190b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x190b('0x3'));var rp=require(_0x190b('0x4'));var fs=require('fs');var path=require(_0x190b('0x5'));var rimraf=require(_0x190b('0x6'));var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module['exports']=function(_0x5da9c1,_0x27ff8c){return _0x5da9c1[_0x190b('0x7')](_0x190b('0x8'),attributes,{'tableName':_0x190b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeda8=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','report_jscripty_sessions'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xeda8,0x104));var _0x8eda=function(_0x5a2cc4,_0x46eee2){_0x5a2cc4=_0x5a2cc4-0x0;var _0x5eab90=_0xeda8[_0x5a2cc4];return _0x5eab90;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var logger=require('../../config/logger')(_0x8eda('0x2'));var moment=require(_0x8eda('0x3'));var BPromise=require(_0x8eda('0x4'));var rp=require(_0x8eda('0x5'));var fs=require('fs');var path=require(_0x8eda('0x6'));var rimraf=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var attributes=require(_0x8eda('0x9'));module[_0x8eda('0xa')]=function(_0x1f3556,_0x349361){return _0x1f3556[_0x8eda('0xb')]('JscriptySessionReport',attributes,{'tableName':_0x8eda('0xc'),'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 169da58..e2b40f7 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 _0x6050=['JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','then'];(function(_0x4d0fa4,_0x4d649f){var _0x4ddcd6=function(_0x3c6582){while(--_0x3c6582){_0x4d0fa4['push'](_0x4d0fa4['shift']());}};_0x4ddcd6(++_0x4d649f);}(_0x6050,0x196));var _0x0605=function(_0x23f72e,_0xf9807f){_0x23f72e=_0x23f72e-0x0;var _0x9024cc=_0x6050[_0x23f72e];return _0x9024cc;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var moment=require(_0x0605('0x2'));var BPromise=require(_0x0605('0x3'));var rs=require(_0x0605('0x4'));var fs=require('fs');var Redis=require(_0x0605('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0605('0x6'));var logger=require(_0x0605('0x7'))(_0x0605('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0605('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x578623,_0x58f7d2,_0x5660ad){return new BPromise(function(_0x1629bf,_0x11b8b5){return client[_0x0605('0xa')](_0x578623,_0x5660ad)[_0x0605('0xb')](function(_0x44fdd3){logger['info'](_0x0605('0xc'),_0x58f7d2,_0x0605('0xd'));logger[_0x0605('0xe')](_0x0605('0xf'),_0x58f7d2,_0x0605('0xd'),JSON[_0x0605('0x10')](_0x44fdd3));if(_0x44fdd3[_0x0605('0x11')]){if(_0x44fdd3[_0x0605('0x11')][_0x0605('0x12')]===0x1f4){logger[_0x0605('0x11')](_0x0605('0xc'),_0x58f7d2,_0x44fdd3[_0x0605('0x11')][_0x0605('0x13')]);return _0x11b8b5(_0x44fdd3[_0x0605('0x11')][_0x0605('0x13')]);}logger[_0x0605('0x11')](_0x0605('0xc'),_0x58f7d2,_0x44fdd3[_0x0605('0x11')][_0x0605('0x13')]);return _0x1629bf(_0x44fdd3['error'][_0x0605('0x13')]);}else{logger[_0x0605('0x14')](_0x0605('0xc'),_0x58f7d2,'request\x20sent');_0x1629bf(_0x44fdd3['result'][_0x0605('0x13')]);}})[_0x0605('0x15')](function(_0xa83443){logger[_0x0605('0x11')](_0x0605('0xc'),_0x58f7d2,_0xa83443);_0x11b8b5(_0xa83443);});});} \ No newline at end of file +var _0x47c5=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x2ab76b,_0x176579){var _0x201126=function(_0x11d8c8){while(--_0x11d8c8){_0x2ab76b['push'](_0x2ab76b['shift']());}};_0x201126(++_0x176579);}(_0x47c5,0x165));var _0x547c=function(_0x35e289,_0x5cca85){_0x35e289=_0x35e289-0x0;var _0x22eb84=_0x47c5[_0x35e289];return _0x22eb84;};'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')]('JscriptySessionReport,\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')]('JscriptySessionReport,\x20%s,\x20%s',_0x381f2e,_0x39498d);_0x4ef079(_0x39498d);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 96f6f77..c2e5fb4 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 _0x05de=['../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','update','downloadLogFile','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x20776f,_0x2bb2b9){var _0xa97cb1=function(_0x483c73){while(--_0x483c73){_0x20776f['push'](_0x20776f['shift']());}};_0xa97cb1(++_0x2bb2b9);}(_0x05de,0x1a9));var _0xe05d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x05de[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xe05d('0x0'));var util=require(_0xe05d('0x1'));var path=require(_0xe05d('0x2'));var timeout=require('connect-timeout');var express=require(_0xe05d('0x3'));var router=express[_0xe05d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe05d('0x5'));var interaction=require(_0xe05d('0x6'));var config=require(_0xe05d('0x7'));var controller=require(_0xe05d('0x8'));router[_0xe05d('0x9')]('/',controller[_0xe05d('0xa')]);router[_0xe05d('0xb')](_0xe05d('0xc'),auth[_0xe05d('0xd')](),controller[_0xe05d('0xe')]);router[_0xe05d('0x9')]('/download_log_file',auth[_0xe05d('0xd')](),controller[_0xe05d('0xf')]);module['exports']=router; \ No newline at end of file +var _0xd941=['get','index','put','/:id','isAuthenticated','update','/download_log_file','downloadLogFile','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller'];(function(_0x49f2fa,_0x165c6a){var _0x3f7308=function(_0x44c3d6){while(--_0x44c3d6){_0x49f2fa['push'](_0x49f2fa['shift']());}};_0x3f7308(++_0x165c6a);}(_0xd941,0x125));var _0x1d94=function(_0x2f62aa,_0x108e95){_0x2f62aa=_0x2f62aa-0x0;var _0x1a341f=_0xd941[_0x2f62aa];return _0x1a341f;};'use strict';var multer=require(_0x1d94('0x0'));var util=require(_0x1d94('0x1'));var path=require(_0x1d94('0x2'));var timeout=require(_0x1d94('0x3'));var express=require(_0x1d94('0x4'));var router=express[_0x1d94('0x5')]();var fs_extra=require(_0x1d94('0x6'));var auth=require(_0x1d94('0x7'));var interaction=require(_0x1d94('0x8'));var config=require(_0x1d94('0x9'));var controller=require(_0x1d94('0xa'));router[_0x1d94('0xb')]('/',controller[_0x1d94('0xc')]);router[_0x1d94('0xd')](_0x1d94('0xe'),auth[_0x1d94('0xf')](),controller[_0x1d94('0x10')]);router[_0x1d94('0xb')](_0x1d94('0x11'),auth[_0x1d94('0xf')](),controller[_0x1d94('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 84a834a..8886fb6 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 _0xc162=['TEXT','STRING','INTEGER','sequelize','exports'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0xc162,0xc1));var _0x2c16=function(_0x14a37b,_0x269528){_0x14a37b=_0x14a37b-0x0;var _0x4868cd=_0xc162[_0x14a37b];return _0x4868cd;};'use strict';var Sequelize=require(_0x2c16('0x0'));module[_0x2c16('0x1')]={'license':{'type':Sequelize[_0x2c16('0x2')]},'data1':{'type':Sequelize[_0x2c16('0x3')]},'data2':{'type':Sequelize[_0x2c16('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x2c16('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0247=['INTEGER','sequelize','exports','STRING'];(function(_0x18593c,_0x448b00){var _0x4f7799=function(_0x16515a){while(--_0x16515a){_0x18593c['push'](_0x18593c['shift']());}};_0x4f7799(++_0x448b00);}(_0x0247,0xc1));var _0x7024=function(_0x304ebc,_0x5733ed){_0x304ebc=_0x304ebc-0x0;var _0x456934=_0x0247[_0x304ebc];return _0x456934;};'use strict';var Sequelize=require(_0x7024('0x0'));module[_0x7024('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x7024('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x7024('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 713d7bc..19ee4ff 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 _0xb1d8=['text/plain','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','index','keys','License','query','model','attributes','intersection','fields','length','merge','options','catch','body','find','get','checkLicense','key','demo','downloadLogFile','license-info.log','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename='];(function(_0x2828d5,_0x3e6aa9){var _0xa351bd=function(_0x59364b){while(--_0x59364b){_0x2828d5['push'](_0x2828d5['shift']());}};_0xa351bd(++_0x3e6aa9);}(_0xb1d8,0x1a0));var _0x8b1d=function(_0x3ff137,_0x114de7){_0x3ff137=_0x3ff137-0x0;var _0x129ac5=_0xb1d8[_0x3ff137];return _0x129ac5;};'use strict';var emlformat=require(_0x8b1d('0x0'));var rimraf=require(_0x8b1d('0x1'));var zipdir=require(_0x8b1d('0x2'));var jsonpatch=require(_0x8b1d('0x3'));var rp=require(_0x8b1d('0x4'));var moment=require(_0x8b1d('0x5'));var BPromise=require(_0x8b1d('0x6'));var Mustache=require(_0x8b1d('0x7'));var util=require('util');var path=require('path');var sox=require(_0x8b1d('0x8'));var csv=require(_0x8b1d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b1d('0xa'));var _=require(_0x8b1d('0xb'));var squel=require(_0x8b1d('0xc'));var crypto=require(_0x8b1d('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8b1d('0x9'));var querystring=require(_0x8b1d('0xe'));var Papa=require(_0x8b1d('0xf'));var Redis=require(_0x8b1d('0x10'));var authService=require(_0x8b1d('0x11'));var qs=require(_0x8b1d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8b1d('0x13'));var logger=require('../../config/logger')(_0x8b1d('0x14'));var utils=require(_0x8b1d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8b1d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x229523,_0x1c48c1){_0x1c48c1=_0x1c48c1||0xcc;return function(_0x2672b8){if(_0x2672b8){return _0x229523[_0x8b1d('0x17')](_0x1c48c1);}return _0x229523[_0x8b1d('0x18')](_0x1c48c1)[_0x8b1d('0x19')]();};}function respondWithResult(_0x5b14f1,_0x411511){_0x411511=_0x411511||0xc8;return function(_0x5ec361){if(_0x5ec361){return _0x5b14f1[_0x8b1d('0x18')](_0x411511)[_0x8b1d('0x1a')](_0x5ec361);}};}function respondWithFilteredResult(_0x3c6838,_0x374b13){return function(_0x1753cc){if(_0x1753cc){var _0x3f5ec4=typeof _0x374b13[_0x8b1d('0x1b')]===_0x8b1d('0x1c')&&typeof _0x374b13[_0x8b1d('0x1d')]===_0x8b1d('0x1c');var _0x8df386=_0x1753cc[_0x8b1d('0x1e')];var _0x12b066=_0x3f5ec4?0x0:_0x374b13[_0x8b1d('0x1b')];var _0x5dc28a=_0x3f5ec4?_0x1753cc[_0x8b1d('0x1e')]:_0x374b13['offset']+_0x374b13[_0x8b1d('0x1d')];var _0x4c0709;if(_0x5dc28a>=_0x8df386){_0x5dc28a=_0x8df386;_0x4c0709=0xc8;}else{_0x4c0709=0xce;}_0x3c6838[_0x8b1d('0x18')](_0x4c0709);return _0x3c6838[_0x8b1d('0x1f')](_0x8b1d('0x20'),_0x12b066+'-'+_0x5dc28a+'/'+_0x8df386)[_0x8b1d('0x1a')](_0x1753cc);}return null;};}function patchUpdates(_0x1a40b3){return function(_0x445242){try{jsonpatch[_0x8b1d('0x21')](_0x445242,_0x1a40b3,!![]);}catch(_0x145fee){return BPromise[_0x8b1d('0x22')](_0x145fee);}return _0x445242[_0x8b1d('0x23')]();};}function saveUpdates(_0x23dd01,_0x9baf74){return function(_0x3525c1){if(_0x3525c1){return _0x3525c1[_0x8b1d('0x24')](_0x23dd01)[_0x8b1d('0x25')](function(_0x5bca89){return _0x5bca89;});}return null;};}function removeEntity(_0x354105,_0x4e1a61){return function(_0x4b31b7){if(_0x4b31b7){return _0x4b31b7['destroy']()[_0x8b1d('0x25')](function(){_0x354105[_0x8b1d('0x18')](0xcc)[_0x8b1d('0x19')]();});}};}function handleEntityNotFound(_0x260b54,_0x2e6d78){return function(_0x25f141){if(!_0x25f141){_0x260b54['sendStatus'](0x194);}return _0x25f141;};}function handleError(_0x10688d,_0x2021c8){_0x2021c8=_0x2021c8||0x1f4;return function(_0x368523){logger[_0x8b1d('0x26')](_0x368523['stack']);if(_0x368523[_0x8b1d('0x27')]){delete _0x368523[_0x8b1d('0x27')];}_0x10688d[_0x8b1d('0x18')](_0x2021c8)[_0x8b1d('0x28')](_0x368523);};}var utilLicense=require('../../config/license/util');exports[_0x8b1d('0x29')]=function(_0x206e3f,_0x3dc974){var _0x1bfa9d={'raw':!![],'where':{'id':0x1}},_0x37017d={};_0x37017d['model']=_[_0x8b1d('0x2a')](db[_0x8b1d('0x2b')]['rawAttributes']);_0x37017d['query']=_[_0x8b1d('0x2a')](_0x206e3f[_0x8b1d('0x2c')]);_0x37017d['filters']=_['intersection'](_0x37017d[_0x8b1d('0x2d')],_0x37017d[_0x8b1d('0x2c')]);_0x1bfa9d[_0x8b1d('0x2e')]=_[_0x8b1d('0x2f')](_0x37017d['model'],qs[_0x8b1d('0x30')](_0x206e3f['query'][_0x8b1d('0x30')]));_0x1bfa9d['attributes']=_0x1bfa9d[_0x8b1d('0x2e')][_0x8b1d('0x31')]?_0x1bfa9d[_0x8b1d('0x2e')]:_0x37017d[_0x8b1d('0x2d')];_0x1bfa9d=_[_0x8b1d('0x32')]({},_0x1bfa9d,_0x206e3f[_0x8b1d('0x33')]);return utilLicense['getLicense'](_0x1bfa9d)['then'](respondWithResult(_0x3dc974,null))[_0x8b1d('0x34')](handleError(_0x3dc974,null));};exports[_0x8b1d('0x24')]=function(_0x3a993b,_0xc992d){if(_0x3a993b[_0x8b1d('0x35')]['id']){delete _0x3a993b[_0x8b1d('0x35')]['id'];}return db['License'][_0x8b1d('0x36')]({'where':{'id':_0x3a993b['params']['id']}})[_0x8b1d('0x25')](handleEntityNotFound(_0xc992d,null))[_0x8b1d('0x25')](function(_0x265ed9){var _0x568173=_0x265ed9[_0x8b1d('0x37')]({'plain':!![]});return utilLicense[_0x8b1d('0x38')](_0x568173,_0x3a993b['body'][_0x8b1d('0x39')]);})[_0x8b1d('0x25')](function(_0x5dc14d){if(!_0x5dc14d[_0x8b1d('0x3a')]){return saveUpdates(_0x3a993b['body'],null);}return _0x5dc14d;})[_0x8b1d('0x25')](respondWithResult(_0xc992d,null))[_0x8b1d('0x34')](handleError(_0xc992d,null));};exports[_0x8b1d('0x3b')]=function(_0x2ed936,_0x421395){var _0x2b8bf3=_0x8b1d('0x3c');var _0x548e96=path['join'](_0x8b1d('0x3d'),_0x8b1d('0x3e'),_0x8b1d('0x3f'),_0x2b8bf3);_0x421395[_0x8b1d('0x40')](_0x8b1d('0x41'),_0x8b1d('0x42')+_0x2b8bf3);_0x421395['set']('Content-Type',_0x8b1d('0x43'));_0x421395[_0x8b1d('0x44')](_0x548e96);}; \ No newline at end of file +var _0x46b6=['body','params','get','checkLicense','key','downloadLogFile','license-info.log','join','/var','log','setHeader','Content-disposition','attachment;\x20filename=','text/plain','download','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','fields','attributes','merge','options','getLicense','catch'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x46b6,0x1eb));var _0x646b=function(_0x21eff4,_0x55316b){_0x21eff4=_0x21eff4-0x0;var _0x11749c=_0x46b6[_0x21eff4];return _0x11749c;};'use strict';var emlformat=require(_0x646b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x646b('0x1'));var jsonpatch=require(_0x646b('0x2'));var rp=require(_0x646b('0x3'));var moment=require(_0x646b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x646b('0x5'));var util=require('util');var path=require(_0x646b('0x6'));var sox=require(_0x646b('0x7'));var csv=require(_0x646b('0x8'));var ejs=require(_0x646b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x646b('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x646b('0xb'));var deskjs=require(_0x646b('0xc'));var toCsv=require(_0x646b('0x8'));var querystring=require(_0x646b('0xd'));var Papa=require(_0x646b('0xe'));var Redis=require(_0x646b('0xf'));var authService=require(_0x646b('0x10'));var qs=require(_0x646b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x646b('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x646b('0x13'));var licenseUtil=require(_0x646b('0x14'));var db=require(_0x646b('0x15'))['db'];function respondWithStatusCode(_0x5ec340,_0x529a60){_0x529a60=_0x529a60||0xcc;return function(_0x1d6f41){if(_0x1d6f41){return _0x5ec340['sendStatus'](_0x529a60);}return _0x5ec340[_0x646b('0x16')](_0x529a60)['end']();};}function respondWithResult(_0x5a2d8a,_0x4d89b1){_0x4d89b1=_0x4d89b1||0xc8;return function(_0x392ffd){if(_0x392ffd){return _0x5a2d8a['status'](_0x4d89b1)[_0x646b('0x17')](_0x392ffd);}};}function respondWithFilteredResult(_0x2f5d3f,_0x2bba03){return function(_0x1a7239){if(_0x1a7239){var _0x5458e5=typeof _0x2bba03['offset']===_0x646b('0x18')&&typeof _0x2bba03[_0x646b('0x19')]==='undefined';var _0x5c1561=_0x1a7239[_0x646b('0x1a')];var _0x2ec678=_0x5458e5?0x0:_0x2bba03[_0x646b('0x1b')];var _0x4ad889=_0x5458e5?_0x1a7239[_0x646b('0x1a')]:_0x2bba03[_0x646b('0x1b')]+_0x2bba03[_0x646b('0x19')];var _0x3a01d2;if(_0x4ad889>=_0x5c1561){_0x4ad889=_0x5c1561;_0x3a01d2=0xc8;}else{_0x3a01d2=0xce;}_0x2f5d3f[_0x646b('0x16')](_0x3a01d2);return _0x2f5d3f['set'](_0x646b('0x1c'),_0x2ec678+'-'+_0x4ad889+'/'+_0x5c1561)[_0x646b('0x17')](_0x1a7239);}return null;};}function patchUpdates(_0x29ce17){return function(_0x42e998){try{jsonpatch[_0x646b('0x1d')](_0x42e998,_0x29ce17,!![]);}catch(_0x2d0d7f){return BPromise[_0x646b('0x1e')](_0x2d0d7f);}return _0x42e998[_0x646b('0x1f')]();};}function saveUpdates(_0x4c9932,_0x485399){return function(_0x3c4db3){if(_0x3c4db3){return _0x3c4db3[_0x646b('0x20')](_0x4c9932)['then'](function(_0x15dddb){return _0x15dddb;});}return null;};}function removeEntity(_0x305bba,_0xaa2618){return function(_0x528177){if(_0x528177){return _0x528177['destroy']()[_0x646b('0x21')](function(){_0x305bba[_0x646b('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x504726,_0x506876){return function(_0x4dd81b){if(!_0x4dd81b){_0x504726[_0x646b('0x22')](0x194);}return _0x4dd81b;};}function handleError(_0x234776,_0x349888){_0x349888=_0x349888||0x1f4;return function(_0x6c60fb){logger[_0x646b('0x23')](_0x6c60fb[_0x646b('0x24')]);if(_0x6c60fb['name']){delete _0x6c60fb[_0x646b('0x25')];}_0x234776['status'](_0x349888)[_0x646b('0x26')](_0x6c60fb);};}var utilLicense=require('../../config/license/util');exports[_0x646b('0x27')]=function(_0x104da4,_0x2e104d){var _0x4de315={'raw':!![],'where':{'id':0x1}},_0x3b14b8={};_0x3b14b8[_0x646b('0x28')]=_[_0x646b('0x29')](db[_0x646b('0x2a')][_0x646b('0x2b')]);_0x3b14b8[_0x646b('0x2c')]=_[_0x646b('0x29')](_0x104da4[_0x646b('0x2c')]);_0x3b14b8[_0x646b('0x2d')]=_[_0x646b('0x2e')](_0x3b14b8[_0x646b('0x28')],_0x3b14b8[_0x646b('0x2c')]);_0x4de315['attributes']=_[_0x646b('0x2e')](_0x3b14b8['model'],qs['fields'](_0x104da4[_0x646b('0x2c')][_0x646b('0x2f')]));_0x4de315[_0x646b('0x30')]=_0x4de315[_0x646b('0x30')]['length']?_0x4de315[_0x646b('0x30')]:_0x3b14b8[_0x646b('0x28')];_0x4de315=_[_0x646b('0x31')]({},_0x4de315,_0x104da4[_0x646b('0x32')]);return utilLicense[_0x646b('0x33')](_0x4de315)[_0x646b('0x21')](respondWithResult(_0x2e104d,null))[_0x646b('0x34')](handleError(_0x2e104d,null));};exports[_0x646b('0x20')]=function(_0x2d6b9f,_0x3f14e5){if(_0x2d6b9f['body']['id']){delete _0x2d6b9f[_0x646b('0x35')]['id'];}return db[_0x646b('0x2a')]['find']({'where':{'id':_0x2d6b9f[_0x646b('0x36')]['id']}})['then'](handleEntityNotFound(_0x3f14e5,null))[_0x646b('0x21')](function(_0x3277e8){var _0x352133=_0x3277e8[_0x646b('0x37')]({'plain':!![]});return utilLicense[_0x646b('0x38')](_0x352133,_0x2d6b9f[_0x646b('0x35')][_0x646b('0x39')]);})[_0x646b('0x21')](function(_0x48d296){if(!_0x48d296['demo']){return saveUpdates(_0x2d6b9f[_0x646b('0x35')],null);}return _0x48d296;})[_0x646b('0x21')](respondWithResult(_0x3f14e5,null))[_0x646b('0x34')](handleError(_0x3f14e5,null));};exports[_0x646b('0x3a')]=function(_0xd518a0,_0x5b0609){var _0x2e669=_0x646b('0x3b');var _0x2d5eb6=path[_0x646b('0x3c')](_0x646b('0x3d'),_0x646b('0x3e'),'xcally',_0x2e669);_0x5b0609[_0x646b('0x3f')](_0x646b('0x40'),_0x646b('0x41')+_0x2e669);_0x5b0609['set']('Content-Type',_0x646b('0x42'));_0x5b0609[_0x646b('0x43')](_0x2d5eb6);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 163d64c..d933baa 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 _0xbd36=['moment','bluebird','path','rimraf','../../config/environment','exports','define','license','lodash','util','../../config/logger','api'];(function(_0x4dbcd6,_0x34326c){var _0x541e55=function(_0x59eb00){while(--_0x59eb00){_0x4dbcd6['push'](_0x4dbcd6['shift']());}};_0x541e55(++_0x34326c);}(_0xbd36,0x164));var _0x6bd3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbd36[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6bd3('0x0'));var util=require(_0x6bd3('0x1'));var logger=require(_0x6bd3('0x2'))(_0x6bd3('0x3'));var moment=require(_0x6bd3('0x4'));var BPromise=require(_0x6bd3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6bd3('0x6'));var rimraf=require(_0x6bd3('0x7'));var config=require(_0x6bd3('0x8'));var attributes=require('./license.attributes');module[_0x6bd3('0x9')]=function(_0x46e60a,_0x189565){return _0x46e60a[_0x6bd3('0xa')]('License',attributes,{'tableName':_0x6bd3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4f2=['rimraf','../../config/environment','./license.attributes','exports','license','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0xbdfc22,_0x4b57cb){var _0x582683=function(_0x5e6dca){while(--_0x5e6dca){_0xbdfc22['push'](_0xbdfc22['shift']());}};_0x582683(++_0x4b57cb);}(_0xc4f2,0x131));var _0x2c4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4f2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2c4f('0x0'));var util=require(_0x2c4f('0x1'));var logger=require(_0x2c4f('0x2'))(_0x2c4f('0x3'));var moment=require('moment');var BPromise=require(_0x2c4f('0x4'));var rp=require(_0x2c4f('0x5'));var fs=require('fs');var path=require(_0x2c4f('0x6'));var rimraf=require(_0x2c4f('0x7'));var config=require(_0x2c4f('0x8'));var attributes=require(_0x2c4f('0x9'));module[_0x2c4f('0xa')]=function(_0x46e826,_0x1e1143){return _0x46e826['define']('License',attributes,{'tableName':_0x2c4f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 1a53da0..a11f991 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 _0x29ed=['request','License,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x52d850,_0x593995){var _0x48c05a=function(_0x3414b7){while(--_0x3414b7){_0x52d850['push'](_0x52d850['shift']());}};_0x48c05a(++_0x593995);}(_0x29ed,0x1c3));var _0xd29e=function(_0x18c526,_0x415da0){_0x18c526=_0x18c526-0x0;var _0x105132=_0x29ed[_0x18c526];return _0x105132;};'use strict';var _=require('lodash');var util=require(_0xd29e('0x0'));var moment=require(_0xd29e('0x1'));var BPromise=require('bluebird');var rs=require(_0xd29e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd29e('0x3'))['db'];var utils=require(_0xd29e('0x4'));var logger=require(_0xd29e('0x5'))(_0xd29e('0x6'));var config=require(_0xd29e('0x7'));var jayson=require(_0xd29e('0x8'));var client=jayson[_0xd29e('0x9')][_0xd29e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49bd68,_0x14961f,_0x1db45f){return new BPromise(function(_0x2f48db,_0x63954a){return client[_0xd29e('0xb')](_0x49bd68,_0x1db45f)['then'](function(_0x3a4522){logger['info'](_0xd29e('0xc'),_0x14961f,_0xd29e('0xd'));logger[_0xd29e('0xe')]('License,\x20%s,\x20%s,\x20%s',_0x14961f,_0xd29e('0xd'),JSON[_0xd29e('0xf')](_0x3a4522));if(_0x3a4522[_0xd29e('0x10')]){if(_0x3a4522[_0xd29e('0x10')]['code']===0x1f4){logger[_0xd29e('0x10')](_0xd29e('0xc'),_0x14961f,_0x3a4522[_0xd29e('0x10')][_0xd29e('0x11')]);return _0x63954a(_0x3a4522[_0xd29e('0x10')][_0xd29e('0x11')]);}logger[_0xd29e('0x10')](_0xd29e('0xc'),_0x14961f,_0x3a4522[_0xd29e('0x10')][_0xd29e('0x11')]);return _0x2f48db(_0x3a4522['error'][_0xd29e('0x11')]);}else{logger[_0xd29e('0x12')](_0xd29e('0xc'),_0x14961f,_0xd29e('0xd'));_0x2f48db(_0x3a4522[_0xd29e('0x13')][_0xd29e('0x11')]);}})[_0xd29e('0x14')](function(_0x28efac){logger['error'](_0xd29e('0xc'),_0x14961f,_0x28efac);_0x63954a(_0x28efac);});});} \ No newline at end of file +var _0x67c1=['request\x20sent','error','code','License,\x20%s,\x20%s','message','result','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','info','debug','License,\x20%s,\x20%s,\x20%s'];(function(_0x40ceb7,_0x3d2f08){var _0x5afd5c=function(_0x401058){while(--_0x401058){_0x40ceb7['push'](_0x40ceb7['shift']());}};_0x5afd5c(++_0x3d2f08);}(_0x67c1,0x1e2));var _0x167c=function(_0x15d203,_0x5b93ba){_0x15d203=_0x15d203-0x0;var _0x350cf6=_0x67c1[_0x15d203];return _0x350cf6;};'use strict';var _=require(_0x167c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x167c('0x1'));var rs=require(_0x167c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x167c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x167c('0x4'))(_0x167c('0x5'));var config=require(_0x167c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x167c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1226cf,_0x56c385,_0x249b7b){return new BPromise(function(_0x1eec23,_0x31248d){return client['request'](_0x1226cf,_0x249b7b)['then'](function(_0x27505b){logger[_0x167c('0x8')]('License,\x20%s,\x20%s',_0x56c385,'request\x20sent');logger[_0x167c('0x9')](_0x167c('0xa'),_0x56c385,_0x167c('0xb'),JSON['stringify'](_0x27505b));if(_0x27505b[_0x167c('0xc')]){if(_0x27505b[_0x167c('0xc')][_0x167c('0xd')]===0x1f4){logger[_0x167c('0xc')](_0x167c('0xe'),_0x56c385,_0x27505b[_0x167c('0xc')][_0x167c('0xf')]);return _0x31248d(_0x27505b[_0x167c('0xc')]['message']);}logger[_0x167c('0xc')](_0x167c('0xe'),_0x56c385,_0x27505b[_0x167c('0xc')][_0x167c('0xf')]);return _0x1eec23(_0x27505b[_0x167c('0xc')]['message']);}else{logger['info'](_0x167c('0xe'),_0x56c385,'request\x20sent');_0x1eec23(_0x27505b[_0x167c('0x10')][_0x167c('0xf')]);}})['catch'](function(_0x5c6bc8){logger[_0x167c('0xc')](_0x167c('0xe'),_0x56c385,_0x5c6bc8);_0x31248d(_0x5c6bc8);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 4f32232..fcdb4f0 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 _0x648b=['getInteractions','getApplications','/:id/messages','getMessages','post','create','addImap','/:id/out_servers','addSmtp','addInteraction','/:id/applications','addApplications','send','/:id/users','addAgents','update','delete','removeDispositions','removeAnswers','/:id/in_servers','removeImap','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','isAuthenticated','index','/describe','/:id','show','get','/:id/dispositions','/:id/canned_answers','getAnswers','getImap','getSmtp','/:id/interactions'];(function(_0x2d1ba9,_0x5bc025){var _0x1c1ed4=function(_0x7a6307){while(--_0x7a6307){_0x2d1ba9['push'](_0x2d1ba9['shift']());}};_0x1c1ed4(++_0x5bc025);}(_0x648b,0x14b));var _0xb648=function(_0x189324,_0x53ab40){_0x189324=_0x189324-0x0;var _0x4e036d=_0x648b[_0x189324];return _0x4e036d;};'use strict';var multer=require('multer');var util=require(_0xb648('0x0'));var path=require(_0xb648('0x1'));var timeout=require(_0xb648('0x2'));var express=require(_0xb648('0x3'));var router=express[_0xb648('0x4')]();var fs_extra=require(_0xb648('0x5'));var auth=require(_0xb648('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb648('0x7'));var controller=require(_0xb648('0x8'));router['get']('/',auth[_0xb648('0x9')](),controller[_0xb648('0xa')]);router['get'](_0xb648('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xb648('0xc'),auth[_0xb648('0x9')](),controller[_0xb648('0xd')]);router[_0xb648('0xe')](_0xb648('0xf'),auth['isAuthenticated'](),controller['getDispositions']);router['get'](_0xb648('0x10'),auth[_0xb648('0x9')](),controller[_0xb648('0x11')]);router[_0xb648('0xe')]('/:id/in_servers',auth[_0xb648('0x9')](),controller[_0xb648('0x12')]);router['get']('/:id/out_servers',auth[_0xb648('0x9')](),controller[_0xb648('0x13')]);router['get'](_0xb648('0x14'),auth[_0xb648('0x9')](),controller[_0xb648('0x15')]);router['get']('/:id/applications',auth[_0xb648('0x9')](),controller[_0xb648('0x16')]);router['get'](_0xb648('0x17'),auth[_0xb648('0x9')](),controller[_0xb648('0x18')]);router[_0xb648('0xe')]('/:id/verify',auth['isAuthenticated'](),controller['verifySmtp']);router['get']('/:id/users',auth[_0xb648('0x9')](),controller['getAgents']);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0xb648('0x19')](_0xb648('0x10'),auth[_0xb648('0x9')](),controller['addAnswer']);router[_0xb648('0x19')]('/',auth[_0xb648('0x9')](),controller[_0xb648('0x1a')]);router[_0xb648('0x19')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0xb648('0x1b')]);router[_0xb648('0x19')](_0xb648('0x1c'),auth[_0xb648('0x9')](),controller[_0xb648('0x1d')]);router[_0xb648('0x19')]('/:id/interactions',auth[_0xb648('0x9')](),controller[_0xb648('0x1e')]);router[_0xb648('0x19')](_0xb648('0x1f'),auth[_0xb648('0x9')](),controller[_0xb648('0x20')]);router[_0xb648('0x19')]('/:id/send',auth[_0xb648('0x9')](),controller[_0xb648('0x21')]);router[_0xb648('0x19')](_0xb648('0x22'),auth[_0xb648('0x9')](),controller[_0xb648('0x23')]);router['put'](_0xb648('0xc'),auth['isAuthenticated'](),controller[_0xb648('0x24')]);router[_0xb648('0x25')](_0xb648('0xf'),auth[_0xb648('0x9')](),controller[_0xb648('0x26')]);router['delete']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xb648('0x27')]);router[_0xb648('0x25')](_0xb648('0x28'),auth[_0xb648('0x9')](),controller[_0xb648('0x29')]);router['delete']('/:id/out_servers',auth[_0xb648('0x9')](),controller['removeSmtp']);router[_0xb648('0x25')]('/:id',auth[_0xb648('0x9')](),controller['destroy']);router['delete'](_0xb648('0x22'),auth[_0xb648('0x9')](),controller[_0xb648('0x2a')]);module[_0xb648('0x2b')]=router; \ No newline at end of file +var _0x0cc4=['isAuthenticated','show','/:id/dispositions','getDispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','/:id/interactions','/:id/applications','/:id/messages','getMessages','verifySmtp','/:id/users','getAgents','post','/:id/canned_answers','addAnswer','create','addImap','addSmtp','addInteraction','/:id/send','send','addAgents','update','delete','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','index'];(function(_0x2709b0,_0x11120a){var _0x417bb8=function(_0x174f1a){while(--_0x174f1a){_0x2709b0['push'](_0x2709b0['shift']());}};_0x417bb8(++_0x11120a);}(_0x0cc4,0x123));var _0x40cc=function(_0x4934aa,_0x55d2a3){_0x4934aa=_0x4934aa-0x0;var _0x59dd38=_0x0cc4[_0x4934aa];return _0x59dd38;};'use strict';var multer=require('multer');var util=require(_0x40cc('0x0'));var path=require(_0x40cc('0x1'));var timeout=require(_0x40cc('0x2'));var express=require('express');var router=express[_0x40cc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x40cc('0x4'));var interaction=require(_0x40cc('0x5'));var config=require(_0x40cc('0x6'));var controller=require(_0x40cc('0x7'));router[_0x40cc('0x8')]('/',auth['isAuthenticated'](),controller[_0x40cc('0x9')]);router[_0x40cc('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x40cc('0x8')]('/:id',auth[_0x40cc('0xa')](),controller[_0x40cc('0xb')]);router[_0x40cc('0x8')](_0x40cc('0xc'),auth['isAuthenticated'](),controller[_0x40cc('0xd')]);router[_0x40cc('0x8')]('/:id/canned_answers',auth[_0x40cc('0xa')](),controller[_0x40cc('0xe')]);router[_0x40cc('0x8')](_0x40cc('0xf'),auth['isAuthenticated'](),controller[_0x40cc('0x10')]);router['get'](_0x40cc('0x11'),auth[_0x40cc('0xa')](),controller['getSmtp']);router[_0x40cc('0x8')](_0x40cc('0x12'),auth[_0x40cc('0xa')](),controller['getInteractions']);router[_0x40cc('0x8')](_0x40cc('0x13'),auth[_0x40cc('0xa')](),controller['getApplications']);router[_0x40cc('0x8')](_0x40cc('0x14'),auth[_0x40cc('0xa')](),controller[_0x40cc('0x15')]);router[_0x40cc('0x8')]('/:id/verify',auth[_0x40cc('0xa')](),controller[_0x40cc('0x16')]);router['get'](_0x40cc('0x17'),auth[_0x40cc('0xa')](),controller[_0x40cc('0x18')]);router[_0x40cc('0x19')](_0x40cc('0xc'),auth[_0x40cc('0xa')](),controller['addDisposition']);router['post'](_0x40cc('0x1a'),auth[_0x40cc('0xa')](),controller[_0x40cc('0x1b')]);router[_0x40cc('0x19')]('/',auth[_0x40cc('0xa')](),controller[_0x40cc('0x1c')]);router[_0x40cc('0x19')](_0x40cc('0xf'),auth['isAuthenticated'](),controller[_0x40cc('0x1d')]);router[_0x40cc('0x19')](_0x40cc('0x11'),auth['isAuthenticated'](),controller[_0x40cc('0x1e')]);router[_0x40cc('0x19')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x40cc('0x1f')]);router[_0x40cc('0x19')]('/:id/applications',auth[_0x40cc('0xa')](),controller['addApplications']);router[_0x40cc('0x19')](_0x40cc('0x20'),auth[_0x40cc('0xa')](),controller[_0x40cc('0x21')]);router[_0x40cc('0x19')](_0x40cc('0x17'),auth[_0x40cc('0xa')](),controller[_0x40cc('0x22')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x40cc('0x23')]);router[_0x40cc('0x24')](_0x40cc('0xc'),auth[_0x40cc('0xa')](),controller['removeDispositions']);router['delete'](_0x40cc('0x1a'),auth[_0x40cc('0xa')](),controller[_0x40cc('0x25')]);router[_0x40cc('0x24')](_0x40cc('0xf'),auth[_0x40cc('0xa')](),controller[_0x40cc('0x26')]);router[_0x40cc('0x24')](_0x40cc('0x11'),auth[_0x40cc('0xa')](),controller[_0x40cc('0x27')]);router[_0x40cc('0x24')]('/:id',auth[_0x40cc('0xa')](),controller[_0x40cc('0x28')]);router[_0x40cc('0x24')](_0x40cc('0x17'),auth['isAuthenticated'](),controller[_0x40cc('0x29')]);module[_0x40cc('0x2a')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index f4f8e72..52cce72 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 _0x627d=['mandatoryDisposition','ENUM','gmail','hotmail','yahoo','outlook365','custom','getDataValue','provider','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x1e3ef7,_0x581f03){var _0x2ee539=function(_0xcbc517){while(--_0xcbc517){_0x1e3ef7['push'](_0x1e3ef7['shift']());}};_0x2ee539(++_0x581f03);}(_0x627d,0x159));var _0xd627=function(_0x487c28,_0x2e163f){_0x487c28=_0x487c28-0x0;var _0x3c9441=_0x627d[_0x487c28];return _0x3c9441;};'use strict';var Sequelize=require(_0xd627('0x0'));module[_0xd627('0x1')]={'description':{'type':Sequelize[_0xd627('0x2')]},'name':{'type':Sequelize[_0xd627('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xd627('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xd627('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xd627('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xd627('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xd627('0x4')]},'markAsUnread':{'type':Sequelize[_0xd627('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xd627('0x2')],'allowNull':![],'defaultValue':_0xd627('0x5')},'fontSize':{'type':Sequelize[_0xd627('0x6')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xd627('0x4')],'defaultValue':function(){return _0xd627('0x7');}},'notificationSound':{'type':Sequelize[_0xd627('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd627('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd627('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd627('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd627('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd627('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xd627('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xd627('0x3')],'defaultValue':![],'comment':_0xd627('0x9'),'set':function(_0x5b4573){if(!_0x5b4573)this[_0xd627('0xa')](_0xd627('0xb'),null);this[_0xd627('0xa')](_0xd627('0xc'),_0x5b4573);}},'provider':{'type':Sequelize[_0xd627('0xd')](_0xd627('0xe'),_0xd627('0xf'),_0xd627('0x10'),_0xd627('0x11')),'defaultValue':null,'get':function(){if(!this['getDataValue']('provider'))return _0xd627('0x12');return this[_0xd627('0x13')]('provider');},'set':function(_0x2cabb8){if(_0x2cabb8===_0xd627('0x12'))_0x2cabb8=null;return this[_0xd627('0xa')](_0xd627('0x14'),_0x2cabb8);}}}; \ No newline at end of file +var _0x4009=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','outlook365','getDataValue','provider','custom','sequelize','exports','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}}'];(function(_0x3e87f6,_0x4f9368){var _0x5b6ea4=function(_0x4d1d16){while(--_0x4d1d16){_0x3e87f6['push'](_0x3e87f6['shift']());}};_0x5b6ea4(++_0x4f9368);}(_0x4009,0x139));var _0x9400=function(_0x367252,_0x4e1f72){_0x367252=_0x367252-0x0;var _0xad36d1=_0x4009[_0x367252];return _0xad36d1;};'use strict';var Sequelize=require(_0x9400('0x0'));module[_0x9400('0x1')]={'description':{'type':Sequelize[_0x9400('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x9400('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x9400('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x9400('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x9400('0x4')]},'markAsUnread':{'type':Sequelize[_0x9400('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x9400('0x2')],'allowNull':![],'defaultValue':_0x9400('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x9400('0x4')],'defaultValue':function(){return _0x9400('0x6');}},'notificationSound':{'type':Sequelize[_0x9400('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9400('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9400('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9400('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9400('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9400('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x9400('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x9400('0x3')],'defaultValue':![],'comment':_0x9400('0x9'),'set':function(_0x464e19){if(!_0x464e19)this[_0x9400('0xa')](_0x9400('0xb'),null);this[_0x9400('0xa')](_0x9400('0xc'),_0x464e19);}},'provider':{'type':Sequelize[_0x9400('0xd')](_0x9400('0xe'),_0x9400('0xf'),'yahoo',_0x9400('0x10')),'defaultValue':null,'get':function(){if(!this[_0x9400('0x11')](_0x9400('0x12')))return _0x9400('0x13');return this[_0x9400('0x11')]('provider');},'set':function(_0x36bbdf){if(_0x36bbdf===_0x9400('0x13'))_0x36bbdf=null;return this[_0x9400('0xa')](_0x9400('0x12'),_0x36bbdf);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index ded63a5..940ae3c 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 _0xc91d=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','Contact','User','Owner','internal','Tag','color','tag','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','priority','stack','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmContact','Contacts','updatedAt','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','from','%s\x20<%s>','attachments','join','root','basename','getSmtpOptions','List','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','VerifySmtp','verifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','bluebird','util','path','lodash','juice','../../components/parsers/qs','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','count','limit','set','Content-Range','update','destroy','get','MailAccounts','UserProfileResource','name','send','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','Unknown\x20email\x20service\x20provider','gmail','smtp-mail.outlook.com','smtp.office365.com','user','password','pass','modernAuthentication','CloudProviderId','port','host','secure','service','authentication','username','Imap','index','MailServerIn','MailServerOut','Smtp','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','offset','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','params','Pause','length','includeAll','include','find','body','provider','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','hasOwnProperty','nolimit','order','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','email','ListId','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0xc91d,0x10b));var _0xdc91=function(_0x3e89ef,_0x5a5fef){_0x3e89ef=_0x3e89ef-0x0;var _0x588597=_0xc91d[_0x3e89ef];return _0x588597;};'use strict';var moment=require('moment');var BPromise=require(_0xdc91('0x0'));var util=require(_0xdc91('0x1'));var path=require(_0xdc91('0x2'));var _=require(_0xdc91('0x3'));var juice=require(_0xdc91('0x4'));var Redis=require('ioredis');var qs=require(_0xdc91('0x5'));var logger=require(_0xdc91('0x6'))('api');var config=require(_0xdc91('0x7'));var db=require('../../mysqldb')['db'];config[_0xdc91('0x8')]=_[_0xdc91('0x9')](config[_0xdc91('0x8')],{'host':_0xdc91('0xa'),'port':0x18eb});var socket=require(_0xdc91('0xb'))(new Redis(config[_0xdc91('0x8')]));require(_0xdc91('0xc'))[_0xdc91('0xd')](socket);var jayson=require(_0xdc91('0xe'));var client=jayson[_0xdc91('0xf')]['http']({'port':0x232b});function respondWithRpcPromise(_0x25c3da,_0x2a0c2f,_0x3afec0,_0x4dc682){return new BPromise(function(_0x5e4fb8,_0x123d82){var _0x201438=_0x4dc682||client;return _0x201438[_0xdc91('0x10')](_0x25c3da,_0x3afec0)[_0xdc91('0x11')](function(_0x321f61){logger['info'](_0xdc91('0x12'),_0x2a0c2f,_0xdc91('0x13'));logger[_0xdc91('0x14')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x2a0c2f,_0xdc91('0x13'),JSON[_0xdc91('0x15')](_0x321f61));if(_0x321f61[_0xdc91('0x16')]){if(_0x321f61[_0xdc91('0x16')][_0xdc91('0x17')]===0x1f4){logger[_0xdc91('0x16')](_0xdc91('0x12'),_0x2a0c2f,_0x321f61[_0xdc91('0x16')][_0xdc91('0x18')]);return _0x123d82(_0x321f61['error']['message']);}logger[_0xdc91('0x16')](_0xdc91('0x12'),_0x2a0c2f,_0x321f61[_0xdc91('0x16')][_0xdc91('0x18')]);return _0x5e4fb8(_0x321f61[_0xdc91('0x16')][_0xdc91('0x18')]);}else{logger['info'](_0xdc91('0x12'),_0x2a0c2f,_0xdc91('0x13'));_0x5e4fb8(_0x321f61[_0xdc91('0x19')][_0xdc91('0x18')]);}})[_0xdc91('0x1a')](function(_0x2e8844){logger[_0xdc91('0x16')](_0xdc91('0x12'),_0x2a0c2f,_0x2e8844);_0x123d82(_0x2e8844);});});}function respondWithStatusCode(_0x1c802e,_0x264966){_0x264966=_0x264966||0xcc;return function(_0x55e348){if(_0x55e348){return _0x1c802e[_0xdc91('0x1b')](_0x264966);}return _0x1c802e[_0xdc91('0x1c')](_0x264966)[_0xdc91('0x1d')]();};}function respondWithResult(_0x28660c,_0x275777){_0x275777=_0x275777||0xc8;return function(_0x436cb8){if(_0x436cb8){return _0x28660c['status'](_0x275777)[_0xdc91('0x1e')](_0x436cb8);}};}function respondWithFilteredResult(_0xff599b,_0x41ccac){return function(_0xf871db){if(_0xf871db){var _0x11fc34=typeof _0x41ccac['offset']===_0xdc91('0x1f')&&typeof _0x41ccac['limit']===_0xdc91('0x1f');var _0x5827f5=_0xf871db[_0xdc91('0x20')];var _0x8f20d3=_0x11fc34?0x0:_0x41ccac['offset'];var _0x271d24=_0x11fc34?_0xf871db['count']:_0x41ccac['offset']+_0x41ccac[_0xdc91('0x21')];var _0x2ab61f;if(_0x271d24>=_0x5827f5){_0x271d24=_0x5827f5;_0x2ab61f=0xc8;}else{_0x2ab61f=0xce;}_0xff599b[_0xdc91('0x1c')](_0x2ab61f);return _0xff599b[_0xdc91('0x22')](_0xdc91('0x23'),_0x8f20d3+'-'+_0x271d24+'/'+_0x5827f5)['json'](_0xf871db);}return null;};}function saveUpdates(_0x20f82a){return function(_0x2c0764){if(_0x2c0764){return _0x2c0764[_0xdc91('0x24')](_0x20f82a)[_0xdc91('0x11')](function(_0x5b47d0){return _0x5b47d0;});}return null;};}function removeEntity(_0x57ccdc){return function(_0x3414e4){if(_0x3414e4){return _0x3414e4[_0xdc91('0x25')]()[_0xdc91('0x11')](function(){var _0x225358=_0x3414e4[_0xdc91('0x26')]({'plain':!![]});var _0x176302=_0xdc91('0x27');return db[_0xdc91('0x28')]['destroy']({'where':{'type':_0x176302,'resourceId':_0x225358['id']}})['then'](function(){return _0x3414e4;});})[_0xdc91('0x11')](function(){_0x57ccdc[_0xdc91('0x1c')](0xcc)[_0xdc91('0x1d')]();});}};}function handleEntityNotFound(_0x33b7ad){return function(_0x3e8d83){if(!_0x3e8d83){_0x33b7ad[_0xdc91('0x1b')](0x194);}return _0x3e8d83;};}function handleError(_0x4a85fd,_0x1162e1){_0x1162e1=_0x1162e1||0x1f4;return function(_0x5ee59b){logger[_0xdc91('0x16')](_0x5ee59b['stack']);if(_0x5ee59b[_0xdc91('0x29')]){delete _0x5ee59b[_0xdc91('0x29')];}_0x4a85fd[_0xdc91('0x1c')](_0x1162e1)[_0xdc91('0x2a')](_0x5ee59b);};}function getImapHost(_0x2db8b1){switch(_0x2db8b1){case'gmail':return _0xdc91('0x2b');case _0xdc91('0x2c'):return _0xdc91('0x2d');case _0xdc91('0x2e'):return _0xdc91('0x2f');case _0xdc91('0x30'):return'outlook.office365.com';}throw new Error(_0xdc91('0x31'),_0x2db8b1);}function getSmtpHost(_0x160ced){switch(_0x160ced){case _0xdc91('0x32'):return'smtp.gmail.com';case _0xdc91('0x2c'):return'smtp.mail.yahoo.com';case _0xdc91('0x2e'):return _0xdc91('0x33');case _0xdc91('0x30'):return _0xdc91('0x34');}throw new Error('Unknown\x20email\x20service\x20provider',_0x160ced);}function getAuthenticationOptions(_0x21a8fc,_0x7501b1){var _0xf74649={};var _0x146d8b={};if(_0x21a8fc){_0xf74649[_0xdc91('0x35')]=_0x146d8b[_0xdc91('0x35')]=_0x7501b1['username'];_0xf74649[_0xdc91('0x36')]=_0x146d8b[_0xdc91('0x37')]=_0x7501b1[_0xdc91('0x36')];if(_0x7501b1[_0xdc91('0x38')]){_0xf74649[_0xdc91('0x38')]=_0x146d8b[_0xdc91('0x38')]=!![];_0xf74649['CloudProviderId']=_0x146d8b['CloudProviderId']=_0x7501b1[_0xdc91('0x39')];_0xf74649[_0xdc91('0x36')]=_0x146d8b[_0xdc91('0x37')]=null;}else{_0xf74649['CloudProviderId']=_0x146d8b['CloudProviderId']=null;}_0xf74649['host']=getImapHost(_0x21a8fc);_0xf74649[_0xdc91('0x3a')]=0x3e1;_0x146d8b[_0xdc91('0x3b')]=getSmtpHost(_0x21a8fc);_0x146d8b[_0xdc91('0x3a')]=0x24b;_0x146d8b[_0xdc91('0x3c')]=![];_0xf74649['service']=_0x146d8b[_0xdc91('0x3d')]=null;}else{if(_0x7501b1[_0xdc91('0x3e')]){_0xf74649[_0xdc91('0x35')]=_0x146d8b[_0xdc91('0x35')]=_0x7501b1[_0xdc91('0x3f')];_0xf74649[_0xdc91('0x36')]=_0x146d8b[_0xdc91('0x37')]=_0x7501b1['password'];}else{_0xf74649[_0xdc91('0x3e')]=_0x146d8b[_0xdc91('0x3e')]=![];_0xf74649[_0xdc91('0x35')]=_0x146d8b[_0xdc91('0x35')]=null;_0xf74649[_0xdc91('0x36')]=_0x146d8b[_0xdc91('0x37')]=null;}_0xf74649[_0xdc91('0x3b')]=_0x7501b1['Imap']['host'];_0xf74649['port']=_0x7501b1[_0xdc91('0x40')][_0xdc91('0x3a')];_0x146d8b['host']=_0x7501b1['Smtp'][_0xdc91('0x3b')];_0x146d8b[_0xdc91('0x3a')]=_0x7501b1['Smtp'][_0xdc91('0x3a')];}return{'Imap':_0xf74649,'Smtp':_0x146d8b};}exports[_0xdc91('0x41')]=function(_0x3ad62b,_0x5daf9d){var _0x360a06={'include':[{'model':db[_0xdc91('0x42')],'as':_0xdc91('0x40')},{'model':db[_0xdc91('0x43')],'as':_0xdc91('0x44')},{'model':db['Pause'],'as':_0xdc91('0x45')}]},_0xa206cd={},_0x14eb4d={'count':0x0,'rows':[]};var _0x5f2d6=_['map'](db[_0xdc91('0x46')][_0xdc91('0x47')],function(_0x393ebe){return{'name':_0x393ebe[_0xdc91('0x48')],'type':_0x393ebe[_0xdc91('0x49')][_0xdc91('0x4a')]};});_0xa206cd[_0xdc91('0x4b')]=_[_0xdc91('0x4c')](_0x5f2d6,_0xdc91('0x29'));_0xa206cd[_0xdc91('0x4d')]=_[_0xdc91('0x4e')](_0x3ad62b['query']);_0xa206cd[_0xdc91('0x4f')]=_['intersection'](_0xa206cd[_0xdc91('0x4b')],_0xa206cd['query']);_0x360a06[_0xdc91('0x50')]=_[_0xdc91('0x51')](_0xa206cd['model'],qs[_0xdc91('0x52')](_0x3ad62b[_0xdc91('0x4d')][_0xdc91('0x52')]));_0x360a06[_0xdc91('0x50')]=_0x360a06[_0xdc91('0x50')]['length']?_0x360a06[_0xdc91('0x50')]:_0xa206cd[_0xdc91('0x4b')];if(!_0x3ad62b[_0xdc91('0x4d')]['hasOwnProperty']('nolimit')){_0x360a06[_0xdc91('0x21')]=qs[_0xdc91('0x21')](_0x3ad62b[_0xdc91('0x4d')][_0xdc91('0x21')]);_0x360a06[_0xdc91('0x53')]=qs['offset'](_0x3ad62b[_0xdc91('0x4d')][_0xdc91('0x53')]);}_0x360a06['order']=qs[_0xdc91('0x54')](_0x3ad62b[_0xdc91('0x4d')]['sort']);_0x360a06[_0xdc91('0x55')]=qs[_0xdc91('0x4f')](_[_0xdc91('0x56')](_0x3ad62b[_0xdc91('0x4d')],_0xa206cd[_0xdc91('0x4f')]),_0x5f2d6);if(_0x3ad62b[_0xdc91('0x4d')][_0xdc91('0x57')]){_0x360a06[_0xdc91('0x55')]=_[_0xdc91('0x58')](_0x360a06[_0xdc91('0x55')],{'$or':_[_0xdc91('0x4c')](_0x5f2d6,function(_0x1dfaa0){if(_0x1dfaa0[_0xdc91('0x49')]!==_0xdc91('0x59')){var _0x2cc586={};_0x2cc586[_0x1dfaa0[_0xdc91('0x29')]]={'$like':'%'+_0x3ad62b[_0xdc91('0x4d')]['filter']+'%'};return _0x2cc586;}})});}_0x360a06=_['merge']({},_0x360a06,_0x3ad62b[_0xdc91('0x5a')]);var _0x1be947={'where':_0x360a06['where']};return db[_0xdc91('0x46')]['count'](_0x1be947)[_0xdc91('0x11')](function(_0x5aaf67){_0x14eb4d[_0xdc91('0x20')]=_0x5aaf67;if(_0x3ad62b[_0xdc91('0x4d')]['includeAll']){_0x360a06['include']=[{'all':!![]}];}return db[_0xdc91('0x46')][_0xdc91('0x5b')](_0x360a06);})[_0xdc91('0x11')](function(_0x1a2b52){_0x14eb4d[_0xdc91('0x5c')]=_0x1a2b52;return _0x14eb4d;})['then'](respondWithFilteredResult(_0x5daf9d,_0x360a06))[_0xdc91('0x1a')](handleError(_0x5daf9d,null));};exports['show']=function(_0x577aa5,_0xa8a520){var _0x6aaf50={'raw':![],'where':{'id':_0x577aa5[_0xdc91('0x5d')]['id']},'include':[{'model':db[_0xdc91('0x42')],'as':_0xdc91('0x40')},{'model':db[_0xdc91('0x43')],'as':_0xdc91('0x44')},{'model':db[_0xdc91('0x5e')],'as':_0xdc91('0x45')}]},_0x1c2bc2={};_0x1c2bc2['model']=_[_0xdc91('0x4e')](db['MailAccount'][_0xdc91('0x47')]);_0x1c2bc2[_0xdc91('0x4d')]=_[_0xdc91('0x4e')](_0x577aa5[_0xdc91('0x4d')]);_0x1c2bc2['filters']=_[_0xdc91('0x51')](_0x1c2bc2[_0xdc91('0x4b')],_0x1c2bc2['query']);_0x6aaf50[_0xdc91('0x50')]=_['intersection'](_0x1c2bc2[_0xdc91('0x4b')],qs[_0xdc91('0x52')](_0x577aa5['query'][_0xdc91('0x52')]));_0x6aaf50[_0xdc91('0x50')]=_0x6aaf50[_0xdc91('0x50')][_0xdc91('0x5f')]?_0x6aaf50[_0xdc91('0x50')]:_0x1c2bc2[_0xdc91('0x4b')];if(_0x577aa5[_0xdc91('0x4d')][_0xdc91('0x60')]){_0x6aaf50[_0xdc91('0x61')]=[{'all':!![]}];}_0x6aaf50=_['merge']({},_0x6aaf50,_0x577aa5[_0xdc91('0x5a')]);return db[_0xdc91('0x46')][_0xdc91('0x62')](_0x6aaf50)[_0xdc91('0x11')](handleEntityNotFound(_0xa8a520,null))[_0xdc91('0x11')](respondWithResult(_0xa8a520,null))[_0xdc91('0x1a')](handleError(_0xa8a520,null));};exports[_0xdc91('0x24')]=function(_0x7ce33c,_0x4cbcce){if(_0x7ce33c[_0xdc91('0x63')]['id']){delete _0x7ce33c[_0xdc91('0x63')]['id'];}var _0x5b3b93=_0x7ce33c[_0xdc91('0x63')]['provider']==='custom'?null:_0x7ce33c[_0xdc91('0x63')][_0xdc91('0x64')];var _0x21b8f8=_0x7ce33c[_0xdc91('0x63')][_0xdc91('0x40')]||{};var _0xb471f8=_0x7ce33c[_0xdc91('0x63')][_0xdc91('0x44')]||{};if(_0x5b3b93){_0x21b8f8[_0xdc91('0x3b')]=getImapHost(_0x5b3b93);_0x21b8f8[_0xdc91('0x3a')]=0x3e1;_0xb471f8[_0xdc91('0x3b')]=getSmtpHost(_0x5b3b93);_0xb471f8['port']=0x24b;_0xb471f8[_0xdc91('0x3c')]=![];}if(_0xb471f8['modernAuthentication']){_0xb471f8[_0xdc91('0x3c')]=![];}else{_0xb471f8[_0xdc91('0x39')]=null;}if(!_0x21b8f8[_0xdc91('0x38')])_0x21b8f8[_0xdc91('0x39')]=null;_0x7ce33c['body'][_0xdc91('0x40')]=_0x21b8f8;_0x7ce33c[_0xdc91('0x63')][_0xdc91('0x44')]=_0xb471f8;return db['MailAccount'][_0xdc91('0x62')]({'where':{'id':_0x7ce33c[_0xdc91('0x5d')]['id']},'include':[{'model':db[_0xdc91('0x42')],'as':_0xdc91('0x40')},{'model':db[_0xdc91('0x43')],'as':_0xdc91('0x44')},{'model':db[_0xdc91('0x5e')],'as':_0xdc91('0x45')}]})[_0xdc91('0x11')](handleEntityNotFound(_0x4cbcce,null))['then'](function(_0x57c437){if(!_0x57c437)throw new Error(_0xdc91('0x65'));if(_0x57c437[_0xdc91('0x3d')])delete _0x7ce33c[_0xdc91('0x63')][_0xdc91('0x40')];return _0x57c437;})[_0xdc91('0x11')](saveUpdates(_0x7ce33c[_0xdc91('0x63')],null))[_0xdc91('0x11')](function(_0x4e14ea){if(!_0x7ce33c[_0xdc91('0x63')][_0xdc91('0x40')])return _0x4e14ea;return db[_0xdc91('0x42')][_0xdc91('0x24')](_0x7ce33c[_0xdc91('0x63')][_0xdc91('0x40')],{'where':{'MailAccountId':_0x4e14ea['id']}})['then'](function(){return _0x4e14ea;});})['then'](function(_0x561d4a){if(!_0x7ce33c[_0xdc91('0x63')][_0xdc91('0x44')])return _0x561d4a;return db[_0xdc91('0x43')][_0xdc91('0x24')](_0x7ce33c['body'][_0xdc91('0x44')],{'where':{'MailAccountId':_0x561d4a['id']}})[_0xdc91('0x11')](function(){return _0x561d4a;});})[_0xdc91('0x11')](respondWithResult(_0x4cbcce,null))[_0xdc91('0x1a')](handleError(_0x4cbcce,null));};exports[_0xdc91('0x66')]=function(_0x2cecce,_0x1d0a25){return db[_0xdc91('0x46')][_0xdc91('0x66')]()[_0xdc91('0x11')](respondWithResult(_0x1d0a25,null))[_0xdc91('0x1a')](handleError(_0x1d0a25,null));};exports[_0xdc91('0x67')]=function(_0x50ca06,_0x13dcdc){if(_0x50ca06[_0xdc91('0x63')]['id']){delete _0x50ca06['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x50ca06[_0xdc91('0x5d')]['id']}})[_0xdc91('0x11')](handleEntityNotFound(_0x13dcdc,null))['then'](function(_0x8b5a14){if(_0x8b5a14){_0x50ca06[_0xdc91('0x63')][_0xdc91('0x68')]=_0x8b5a14['id'];return db[_0xdc91('0x69')][_0xdc91('0x6a')](_0x50ca06['body']);}})[_0xdc91('0x11')](respondWithResult(_0x13dcdc,null))[_0xdc91('0x1a')](handleError(_0x13dcdc,null));};exports[_0xdc91('0x6b')]=function(_0x2a15a1,_0x244df8){var _0x44c3ed={'raw':![],'where':{}};var _0x45949e={};var _0x3522c2={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x2a15a1[_0xdc91('0x5d')]['id']}})[_0xdc91('0x11')](handleEntityNotFound(_0x244df8,null))[_0xdc91('0x11')](function(_0x1c7ca4){if(_0x1c7ca4){_0x45949e[_0xdc91('0x4b')]=_[_0xdc91('0x4e')](db[_0xdc91('0x69')]['rawAttributes']);_0x45949e['query']=_[_0xdc91('0x4e')](_0x2a15a1[_0xdc91('0x4d')]);_0x45949e[_0xdc91('0x4f')]=_[_0xdc91('0x51')](_0x45949e[_0xdc91('0x4b')],_0x45949e['query']);_0x44c3ed[_0xdc91('0x50')]=_[_0xdc91('0x51')](_0x45949e[_0xdc91('0x4b')],qs[_0xdc91('0x52')](_0x2a15a1['query']['fields']));_0x44c3ed['attributes']=_0x44c3ed[_0xdc91('0x50')][_0xdc91('0x5f')]?_0x44c3ed[_0xdc91('0x50')]:_0x45949e[_0xdc91('0x4b')];if(!_0x2a15a1[_0xdc91('0x4d')][_0xdc91('0x6c')](_0xdc91('0x6d'))){_0x44c3ed[_0xdc91('0x21')]=qs[_0xdc91('0x21')](_0x2a15a1['query']['limit']);_0x44c3ed['offset']=qs[_0xdc91('0x53')](_0x2a15a1['query']['offset']);}_0x44c3ed[_0xdc91('0x6e')]=qs[_0xdc91('0x54')](_0x2a15a1[_0xdc91('0x4d')][_0xdc91('0x54')]);_0x44c3ed['where']=qs[_0xdc91('0x4f')](_[_0xdc91('0x56')](_0x2a15a1[_0xdc91('0x4d')],_0x45949e[_0xdc91('0x4f')]));_0x44c3ed[_0xdc91('0x55')][_0xdc91('0x68')]=_0x1c7ca4['id'];if(_0x2a15a1[_0xdc91('0x4d')][_0xdc91('0x57')]){_0x44c3ed['where']=_[_0xdc91('0x58')](_0x44c3ed[_0xdc91('0x55')],{'$or':_['map'](_0x44c3ed[_0xdc91('0x50')],function(_0x2735e){var _0xbcd66f={};_0xbcd66f[_0x2735e]={'$like':'%'+_0x2a15a1[_0xdc91('0x4d')][_0xdc91('0x57')]+'%'};return _0xbcd66f;})});}_0x44c3ed=_[_0xdc91('0x58')]({},_0x44c3ed,_0x2a15a1[_0xdc91('0x5a')]);return db['Disposition'][_0xdc91('0x20')]({'where':_0x44c3ed['where']})['then'](function(_0x4df6fa){_0x3522c2[_0xdc91('0x20')]=_0x4df6fa;if(_0x2a15a1[_0xdc91('0x4d')][_0xdc91('0x60')]){_0x44c3ed[_0xdc91('0x61')]=[{'all':!![]}];}return db[_0xdc91('0x69')][_0xdc91('0x5b')](_0x44c3ed);})[_0xdc91('0x11')](function(_0x496952){_0x3522c2[_0xdc91('0x5c')]=_0x496952;return _0x3522c2;});}})[_0xdc91('0x11')](respondWithFilteredResult(_0x244df8,_0x44c3ed))[_0xdc91('0x1a')](handleError(_0x244df8,null));};exports[_0xdc91('0x6f')]=function(_0x281ad7,_0x37e6f3){return db[_0xdc91('0x46')][_0xdc91('0x62')]({'where':{'id':_0x281ad7['params']['id']}})[_0xdc91('0x11')](handleEntityNotFound(_0x37e6f3,null))[_0xdc91('0x11')](function(_0x3fb721){if(_0x3fb721){return _0x3fb721[_0xdc91('0x6f')](_0x281ad7[_0xdc91('0x4d')][_0xdc91('0x70')]);}})[_0xdc91('0x11')](respondWithStatusCode(_0x37e6f3,null))[_0xdc91('0x1a')](handleError(_0x37e6f3,null));};exports[_0xdc91('0x71')]=function(_0x4db1a9,_0x3431bc){if(_0x4db1a9[_0xdc91('0x63')]['id']){delete _0x4db1a9[_0xdc91('0x63')]['id'];}return db['MailAccount'][_0xdc91('0x62')]({'where':{'id':_0x4db1a9[_0xdc91('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3431bc,null))[_0xdc91('0x11')](function(_0x1978ba){if(_0x1978ba){_0x4db1a9[_0xdc91('0x63')][_0xdc91('0x68')]=_0x1978ba['id'];return db['CannedAnswer'][_0xdc91('0x6a')](_0x4db1a9[_0xdc91('0x63')]);}})[_0xdc91('0x11')](respondWithResult(_0x3431bc,null))[_0xdc91('0x1a')](handleError(_0x3431bc,null));};exports[_0xdc91('0x72')]=function(_0x94e2f6,_0x49efcc){var _0x5ae5b3={'raw':![],'where':{}};var _0x401f3d={};var _0x3c0f62={'count':0x0,'rows':[]};return db['MailAccount'][_0xdc91('0x73')]({'where':{'id':_0x94e2f6[_0xdc91('0x5d')]['id']}})['then'](handleEntityNotFound(_0x49efcc,null))['then'](function(_0x7affd6){if(_0x7affd6){_0x401f3d['model']=_['keys'](db[_0xdc91('0x74')][_0xdc91('0x47')]);_0x401f3d[_0xdc91('0x4d')]=_[_0xdc91('0x4e')](_0x94e2f6['query']);_0x401f3d['filters']=_[_0xdc91('0x51')](_0x401f3d['model'],_0x401f3d[_0xdc91('0x4d')]);_0x5ae5b3[_0xdc91('0x50')]=_[_0xdc91('0x51')](_0x401f3d[_0xdc91('0x4b')],qs[_0xdc91('0x52')](_0x94e2f6[_0xdc91('0x4d')][_0xdc91('0x52')]));_0x5ae5b3[_0xdc91('0x50')]=_0x5ae5b3[_0xdc91('0x50')][_0xdc91('0x5f')]?_0x5ae5b3['attributes']:_0x401f3d[_0xdc91('0x4b')];if(!_0x94e2f6['query'][_0xdc91('0x6c')](_0xdc91('0x6d'))){_0x5ae5b3[_0xdc91('0x21')]=qs[_0xdc91('0x21')](_0x94e2f6[_0xdc91('0x4d')]['limit']);_0x5ae5b3[_0xdc91('0x53')]=qs['offset'](_0x94e2f6[_0xdc91('0x4d')][_0xdc91('0x53')]);}_0x5ae5b3[_0xdc91('0x6e')]=qs['sort'](_0x94e2f6['query'][_0xdc91('0x54')]);_0x5ae5b3[_0xdc91('0x55')]=qs['filters'](_['pick'](_0x94e2f6[_0xdc91('0x4d')],_0x401f3d['filters']));_0x5ae5b3[_0xdc91('0x55')][_0xdc91('0x68')]=_0x7affd6['id'];if(_0x94e2f6[_0xdc91('0x4d')][_0xdc91('0x57')]){_0x5ae5b3[_0xdc91('0x55')]=_[_0xdc91('0x58')](_0x5ae5b3[_0xdc91('0x55')],{'$or':_[_0xdc91('0x4c')](_0x5ae5b3[_0xdc91('0x50')],function(_0x4c7c02){var _0x1ca71a={};_0x1ca71a[_0x4c7c02]={'$like':'%'+_0x94e2f6[_0xdc91('0x4d')]['filter']+'%'};return _0x1ca71a;})});}_0x5ae5b3=_[_0xdc91('0x58')]({},_0x5ae5b3,_0x94e2f6[_0xdc91('0x5a')]);return db['CannedAnswer'][_0xdc91('0x20')]({'where':_0x5ae5b3[_0xdc91('0x55')]})[_0xdc91('0x11')](function(_0x3482c6){_0x3c0f62['count']=_0x3482c6;if(_0x94e2f6[_0xdc91('0x4d')]['includeAll']){_0x5ae5b3[_0xdc91('0x61')]=[{'all':!![]}];}return db['CannedAnswer'][_0xdc91('0x5b')](_0x5ae5b3);})[_0xdc91('0x11')](function(_0x4fb1c1){_0x3c0f62[_0xdc91('0x5c')]=_0x4fb1c1;return _0x3c0f62;});}})[_0xdc91('0x11')](respondWithFilteredResult(_0x49efcc,_0x5ae5b3))[_0xdc91('0x1a')](handleError(_0x49efcc,null));};exports[_0xdc91('0x75')]=function(_0x2c4b0d,_0x12e64c){return db[_0xdc91('0x46')][_0xdc91('0x62')]({'where':{'id':_0x2c4b0d[_0xdc91('0x5d')]['id']}})['then'](handleEntityNotFound(_0x12e64c,null))[_0xdc91('0x11')](function(_0x5d35c1){if(_0x5d35c1){return _0x5d35c1[_0xdc91('0x75')](_0x2c4b0d['query'][_0xdc91('0x70')]);}})[_0xdc91('0x11')](respondWithStatusCode(_0x12e64c,null))[_0xdc91('0x1a')](handleError(_0x12e64c,null));};exports[_0xdc91('0x6a')]=function(_0x491bd4,_0x5bb1e8){var _0x7ead3b={'name':_0x491bd4[_0xdc91('0x63')][_0xdc91('0x29')],'key':_0x491bd4['body'][_0xdc91('0x4a')],'provider':_0x491bd4[_0xdc91('0x63')][_0xdc91('0x64')]==='custom'?null:_0x491bd4[_0xdc91('0x63')][_0xdc91('0x64')],'email':_0x491bd4[_0xdc91('0x63')][_0xdc91('0x76')],'ListId':_0x491bd4[_0xdc91('0x63')][_0xdc91('0x77')],'active':!_['isNil'](_0x491bd4[_0xdc91('0x63')][_0xdc91('0x78')])?_0x491bd4[_0xdc91('0x63')]['active']:!![],'description':_0x491bd4['body'][_0xdc91('0x79')]||null};var _0x24eb25=getAuthenticationOptions(_0x7ead3b[_0xdc91('0x64')],_0x491bd4['body']);_0x7ead3b[_0xdc91('0x40')]=_0x24eb25['Imap'];_0x7ead3b[_0xdc91('0x44')]=_0x24eb25[_0xdc91('0x44')];return db[_0xdc91('0x46')][_0xdc91('0x6a')](_0x7ead3b,{'include':[{'model':db[_0xdc91('0x43')],'as':_0xdc91('0x44')},{'model':db[_0xdc91('0x42')],'as':'Imap'}]})[_0xdc91('0x11')](function(_0x3d01d7){var _0x2b0f4c=_0x491bd4[_0xdc91('0x35')]['get']({'plain':!![]});if(!_0x2b0f4c)throw new Error(_0xdc91('0x7a'));if(_0x2b0f4c[_0xdc91('0x7b')]===_0xdc91('0x35')){var _0x5762f0=_0x3d01d7[_0xdc91('0x26')]({'plain':!![]});return db[_0xdc91('0x7c')][_0xdc91('0x62')]({'where':{'name':_0xdc91('0x27'),'userProfileId':_0x2b0f4c[_0xdc91('0x7d')]},'raw':!![]})[_0xdc91('0x11')](function(_0x24a12e){if(_0x24a12e&&_0x24a12e[_0xdc91('0x7e')]===0x0){return db[_0xdc91('0x28')][_0xdc91('0x6a')]({'name':_0x5762f0[_0xdc91('0x29')],'resourceId':_0x5762f0['id'],'type':_0x24a12e[_0xdc91('0x29')],'sectionId':_0x24a12e['id']},{})['then'](function(){return _0x3d01d7;});}else{return _0x3d01d7;}})['catch'](function(_0x58be52){logger[_0xdc91('0x16')](_0xdc91('0x7f'),_0x58be52);throw _0x58be52;});}return _0x3d01d7;})['then'](respondWithResult(_0x5bb1e8,0xc9))['catch'](handleError(_0x5bb1e8,null));};exports[_0xdc91('0x80')]=function(_0x1660f4,_0x909a8e){return db['MailAccount']['findOne']({'where':{'id':_0x1660f4[_0xdc91('0x5d')]['id']}})[_0xdc91('0x11')](handleEntityNotFound(_0x909a8e,null))[_0xdc91('0x11')](function(_0x1760b8){if(_0x1760b8){return _0x1760b8[_0xdc91('0x80')]();}return null;})['then'](respondWithResult(_0x909a8e,null))[_0xdc91('0x1a')](handleError(_0x909a8e,null));};exports[_0xdc91('0x81')]=function(_0x1a0596,_0x4de63a){if(_0x1a0596[_0xdc91('0x63')]['id']){delete _0x1a0596[_0xdc91('0x63')]['id'];}return db[_0xdc91('0x46')][_0xdc91('0x62')]({'where':{'id':_0x1a0596[_0xdc91('0x5d')]['id']}})[_0xdc91('0x11')](handleEntityNotFound(_0x4de63a,null))[_0xdc91('0x11')](function(_0x53312c){if(_0x53312c){_0x1a0596[_0xdc91('0x63')][_0xdc91('0x68')]=_0x53312c['id'];return db['MailServerIn'][_0xdc91('0x6a')](_0x1a0596[_0xdc91('0x63')]);}})[_0xdc91('0x11')](respondWithResult(_0x4de63a,null))[_0xdc91('0x1a')](handleError(_0x4de63a,null));};exports[_0xdc91('0x82')]=function(_0x28e814,_0x30b2f1){return db[_0xdc91('0x46')]['findOne']({'where':{'id':_0x28e814['params']['id']}})['then'](handleEntityNotFound(_0x30b2f1,null))[_0xdc91('0x11')](function(_0x11c44e){if(_0x11c44e){return _0x11c44e[_0xdc91('0x83')](null);}return null;})[_0xdc91('0x11')](respondWithStatusCode(_0x30b2f1,null))['catch'](handleError(_0x30b2f1,null));};exports[_0xdc91('0x84')]=function(_0x4987e4,_0x663982){return db[_0xdc91('0x46')]['findOne']({'where':{'id':_0x4987e4[_0xdc91('0x5d')]['id']}})[_0xdc91('0x11')](handleEntityNotFound(_0x663982,null))[_0xdc91('0x11')](function(_0x3a5cb5){if(_0x3a5cb5){return _0x3a5cb5['getSmtp']();}return null;})['then'](respondWithResult(_0x663982,null))[_0xdc91('0x1a')](handleError(_0x663982,null));};exports[_0xdc91('0x85')]=function(_0x363c38,_0x155740){if(_0x363c38[_0xdc91('0x63')]['id']){delete _0x363c38[_0xdc91('0x63')]['id'];}return db[_0xdc91('0x46')][_0xdc91('0x62')]({'where':{'id':_0x363c38[_0xdc91('0x5d')]['id']}})['then'](handleEntityNotFound(_0x155740,null))['then'](function(_0x1eead8){if(_0x1eead8){_0x363c38[_0xdc91('0x63')][_0xdc91('0x68')]=_0x1eead8['id'];return db[_0xdc91('0x43')][_0xdc91('0x6a')](_0x363c38[_0xdc91('0x63')]);}})[_0xdc91('0x11')](respondWithResult(_0x155740,null))[_0xdc91('0x1a')](handleError(_0x155740,null));};exports[_0xdc91('0x86')]=function(_0x554bbd,_0xf97c00){return db['MailAccount'][_0xdc91('0x73')]({'where':{'id':_0x554bbd['params']['id']}})['then'](handleEntityNotFound(_0xf97c00,null))[_0xdc91('0x11')](function(_0x492c60){if(_0x492c60){return _0x492c60[_0xdc91('0x87')](null);}return null;})[_0xdc91('0x11')](respondWithStatusCode(_0xf97c00,null))['catch'](handleError(_0xf97c00,null));};exports[_0xdc91('0x88')]=function(_0x5ef138,_0x422b88){return db[_0xdc91('0x89')][_0xdc91('0x62')]({'where':{'id':_0x5ef138[_0xdc91('0x5d')]['id']}})['then'](handleEntityNotFound(_0x422b88,null))[_0xdc91('0x11')](function(_0x1d1dfe){if(_0x1d1dfe){return _0x1d1dfe['addInteraction'](_0x5ef138[_0xdc91('0x63')][_0xdc91('0x70')],_[_0xdc91('0x8a')](_0x5ef138[_0xdc91('0x63')],[_0xdc91('0x70'),'id'])||{});}})[_0xdc91('0x11')](respondWithResult(_0x422b88,null))[_0xdc91('0x1a')](handleError(_0x422b88,null));};exports['getInteractions']=function(_0x196288,_0x106ef7){var _0x430994={'raw':![],'where':{}};var _0xbee965={};var _0x2dda47={'count':0x0,'rows':[]};return db[_0xdc91('0x46')][_0xdc91('0x73')]({'where':{'id':_0x196288[_0xdc91('0x5d')]['id']}})[_0xdc91('0x11')](handleEntityNotFound(_0x106ef7,null))[_0xdc91('0x11')](function(_0x2b5f52){if(_0x2b5f52){_0xbee965['model']=_[_0xdc91('0x4e')](db[_0xdc91('0x89')][_0xdc91('0x47')]);_0xbee965[_0xdc91('0x4d')]=_[_0xdc91('0x4e')](_0x196288[_0xdc91('0x4d')]);_0xbee965[_0xdc91('0x4f')]=_[_0xdc91('0x51')](_0xbee965[_0xdc91('0x4b')],_0xbee965[_0xdc91('0x4d')]);_0x430994[_0xdc91('0x50')]=_['intersection'](_0xbee965['model'],qs[_0xdc91('0x52')](_0x196288[_0xdc91('0x4d')][_0xdc91('0x52')]));_0x430994[_0xdc91('0x50')]=_0x430994[_0xdc91('0x50')]['length']?_0x430994[_0xdc91('0x50')]:_0xbee965[_0xdc91('0x4b')];if(!_0x196288[_0xdc91('0x4d')]['hasOwnProperty'](_0xdc91('0x6d'))){_0x430994[_0xdc91('0x21')]=qs[_0xdc91('0x21')](_0x196288[_0xdc91('0x4d')][_0xdc91('0x21')]);_0x430994[_0xdc91('0x53')]=qs[_0xdc91('0x53')](_0x196288['query'][_0xdc91('0x53')]);}_0x430994['order']=qs[_0xdc91('0x54')](_0x196288[_0xdc91('0x4d')][_0xdc91('0x54')]);_0x430994[_0xdc91('0x55')]=qs[_0xdc91('0x4f')](_['pick'](_0x196288['query'],_0xbee965[_0xdc91('0x4f')]));_0x430994[_0xdc91('0x55')]['MailAccountId']=_0x2b5f52['id'];if(_0x196288[_0xdc91('0x4d')][_0xdc91('0x57')]){_0x430994[_0xdc91('0x55')]=_['merge'](_0x430994[_0xdc91('0x55')],{'$or':_[_0xdc91('0x4c')](_0x430994['attributes'],function(_0x5edb1d){var _0x8ede08={};_0x8ede08[_0x5edb1d]={'$like':'%'+_0x196288[_0xdc91('0x4d')][_0xdc91('0x57')]+'%'};return _0x8ede08;})});}_0x430994=_[_0xdc91('0x58')]({},_0x430994,_0x196288[_0xdc91('0x5a')]);return db[_0xdc91('0x89')][_0xdc91('0x20')]({'where':_0x430994[_0xdc91('0x55')]})[_0xdc91('0x11')](function(_0x573cc4){_0x2dda47['count']=_0x573cc4;if(_0x196288[_0xdc91('0x4d')][_0xdc91('0x60')]){_0x430994[_0xdc91('0x61')]=[{'model':db['CmContact'],'as':_0xdc91('0x8b'),'required':![]},{'model':db[_0xdc91('0x8c')],'as':_0xdc91('0x8d'),'attributes':[_0xdc91('0x29'),'fullname',_0xdc91('0x8e')],'required':![]},{'model':db[_0xdc91('0x8f')],'as':'Tags','attributes':['id',_0xdc91('0x29'),_0xdc91('0x90')],'where':_0x196288['query'][_0xdc91('0x91')]?{'id':_0x196288[_0xdc91('0x4d')]['tag']}:undefined,'required':_0x196288[_0xdc91('0x4d')][_0xdc91('0x91')]?!![]:![]}];}return db['MailInteraction']['findAll'](_0x430994);})[_0xdc91('0x11')](function(_0x44cda9){_0x2dda47[_0xdc91('0x5c')]=_0x44cda9;return _0x2dda47;});}})[_0xdc91('0x11')](respondWithFilteredResult(_0x106ef7,_0x430994))['catch'](handleError(_0x106ef7,null));};exports['addApplications']=function addApplications(_0x1817d4,_0x4ba55e){var _0x3d7aed=_0x1817d4['params']['id'];var _0x11f755=_0x1817d4[_0xdc91('0x63')];var _0x411356=0xc8;var _0x1db186=null;return db['sequelize'][_0xdc91('0x92')]({'isolationLevel':db[_0xdc91('0x93')][_0xdc91('0x94')][_0xdc91('0x95')][_0xdc91('0x96')]},function(_0xb405ad){return db[_0xdc91('0x46')][_0xdc91('0x73')]({'where':{'id':_0x3d7aed},'transaction':_0xb405ad})['then'](function(_0x4548f7){if(_0x4548f7){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0x3d7aed},'transaction':_0xb405ad})[_0xdc91('0x11')](function(){var _0x1fb3ee=_[_0xdc91('0x4c')](_0x11f755,function(_0x72ddd4){_0x72ddd4[_0xdc91('0x68')]=_0x3d7aed;return _0x72ddd4;});return db[_0xdc91('0x97')]['bulkCreate'](_0x1fb3ee,{'transaction':_0xb405ad});});}else{_0x411356=0x194;_0x1db186=[];}});})[_0xdc91('0x11')](function(){if(_0x411356!==0x194){return db[_0xdc91('0x97')][_0xdc91('0x98')]({'where':{'MailAccountId':_0x3d7aed},'order':_0xdc91('0x99')})['then'](function(_0x299258){_0x1db186=_0x299258;});}})['catch'](function(_0x5ea1b){_0x411356=0x1f4;logger['error'](_0x5ea1b[_0xdc91('0x9a')]);if(_0x5ea1b[_0xdc91('0x29')]){delete _0x5ea1b[_0xdc91('0x29')];}_0x1db186=_0x5ea1b;})['finally'](function(){if(_0x1db186===null){_0x4ba55e['sendStatus'](_0x411356);}else{if(_0x411356===0x1f4){_0x4ba55e[_0xdc91('0x1c')](_0x411356)['send'](_0x1db186);}else{_0x4ba55e[_0xdc91('0x1c')](_0x411356)[_0xdc91('0x1e')](_0x1db186);}}});};exports[_0xdc91('0x9b')]=function(_0x4eb9c9,_0x48cad2){var _0x1d4397={};var _0x5b712a={};var _0x3b95b2;var _0x122beb;return db['MailAccount'][_0xdc91('0x73')]({'where':{'id':_0x4eb9c9[_0xdc91('0x5d')]['id']}})[_0xdc91('0x11')](handleEntityNotFound(_0x48cad2,null))[_0xdc91('0x11')](function(_0x4e49cf){if(_0x4e49cf){_0x3b95b2=_0x4e49cf;_0x5b712a[_0xdc91('0x4b')]=_[_0xdc91('0x4e')](db[_0xdc91('0x97')][_0xdc91('0x47')]);_0x5b712a[_0xdc91('0x4d')]=_[_0xdc91('0x4e')](_0x4eb9c9['query']);_0x5b712a[_0xdc91('0x4f')]=_[_0xdc91('0x51')](_0x5b712a['model'],_0x5b712a[_0xdc91('0x4d')]);_0x1d4397[_0xdc91('0x50')]=_[_0xdc91('0x51')](_0x5b712a['model'],qs[_0xdc91('0x52')](_0x4eb9c9[_0xdc91('0x4d')]['fields']));_0x1d4397[_0xdc91('0x50')]=_0x1d4397[_0xdc91('0x50')][_0xdc91('0x5f')]?_0x1d4397[_0xdc91('0x50')]:_0x5b712a[_0xdc91('0x4b')];_0x1d4397[_0xdc91('0x6e')]=qs['sort'](_0x4eb9c9[_0xdc91('0x4d')][_0xdc91('0x54')]);_0x1d4397[_0xdc91('0x55')]=qs[_0xdc91('0x4f')](_[_0xdc91('0x56')](_0x4eb9c9[_0xdc91('0x4d')],_0x5b712a[_0xdc91('0x4f')]));if(_0x4eb9c9['query'][_0xdc91('0x57')]){_0x1d4397['where']=_[_0xdc91('0x58')](_0x1d4397[_0xdc91('0x55')],{'$or':_[_0xdc91('0x4c')](_0x1d4397['attributes'],function(_0x12aecb){var _0x55bb58={};_0x55bb58[_0x12aecb]={'$like':'%'+_0x4eb9c9[_0xdc91('0x4d')][_0xdc91('0x57')]+'%'};return _0x55bb58;})});}_0x1d4397=_['merge']({},_0x1d4397,_0x4eb9c9[_0xdc91('0x5a')]);return _0x3b95b2[_0xdc91('0x9b')](_0x1d4397);}})[_0xdc91('0x11')](function(_0x1b3422){if(_0x1b3422){_0x122beb=_0x1b3422[_0xdc91('0x5f')];if(!_0x4eb9c9[_0xdc91('0x4d')][_0xdc91('0x6c')](_0xdc91('0x6d'))){_0x1d4397[_0xdc91('0x21')]=qs[_0xdc91('0x21')](_0x4eb9c9['query'][_0xdc91('0x21')]);_0x1d4397[_0xdc91('0x53')]=qs['offset'](_0x4eb9c9[_0xdc91('0x4d')][_0xdc91('0x53')]);}return _0x3b95b2['getApplications'](_0x1d4397);}})[_0xdc91('0x11')](function(_0x52f7d2){if(_0x52f7d2){return _0x52f7d2?{'count':_0x122beb,'rows':_0x52f7d2}:null;}})['then'](respondWithResult(_0x48cad2,null))[_0xdc91('0x1a')](handleError(_0x48cad2,null));};exports[_0xdc91('0x9c')]=function(_0xe4ed3c,_0x46b173){var _0x536de0={'raw':!![],'where':{}};var _0x48e661={};var _0x304c21={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0xe4ed3c['params']['id']}})[_0xdc91('0x11')](handleEntityNotFound(_0x46b173,null))[_0xdc91('0x11')](function(_0x5b68b6){if(_0x5b68b6){_0x48e661['model']=_[_0xdc91('0x4e')](db[_0xdc91('0x9d')][_0xdc91('0x47')]);_0x48e661[_0xdc91('0x4d')]=_['keys'](_0xe4ed3c['query']);_0x48e661[_0xdc91('0x4f')]=_['intersection'](_0x48e661[_0xdc91('0x4b')],_0x48e661['query']);_0x536de0[_0xdc91('0x50')]=_[_0xdc91('0x51')](_0x48e661[_0xdc91('0x4b')],qs[_0xdc91('0x52')](_0xe4ed3c['query'][_0xdc91('0x52')]));_0x536de0[_0xdc91('0x50')]=_0x536de0[_0xdc91('0x50')][_0xdc91('0x5f')]?_0x536de0[_0xdc91('0x50')]:_0x48e661['model'];if(!_0xe4ed3c['query']['hasOwnProperty']('nolimit')){_0x536de0['limit']=qs[_0xdc91('0x21')](_0xe4ed3c[_0xdc91('0x4d')]['limit']);_0x536de0[_0xdc91('0x53')]=qs[_0xdc91('0x53')](_0xe4ed3c[_0xdc91('0x4d')]['offset']);}_0x536de0['order']=qs[_0xdc91('0x54')](_0xe4ed3c[_0xdc91('0x4d')][_0xdc91('0x54')]);_0x536de0[_0xdc91('0x55')]=qs[_0xdc91('0x4f')](_[_0xdc91('0x56')](_0xe4ed3c[_0xdc91('0x4d')],_0x48e661[_0xdc91('0x4f')]));_0x536de0[_0xdc91('0x55')][_0xdc91('0x68')]=_0x5b68b6['id'];if(_0xe4ed3c[_0xdc91('0x4d')][_0xdc91('0x57')]){_0x536de0[_0xdc91('0x55')]=_[_0xdc91('0x58')](_0x536de0[_0xdc91('0x55')],{'$or':_['map'](_0x536de0[_0xdc91('0x50')],function(_0x42e002){var _0x3869af={};_0x3869af[_0x42e002]={'$like':'%'+_0xe4ed3c['query'][_0xdc91('0x57')]+'%'};return _0x3869af;})});}if(_0xe4ed3c['query']['$gte']){var _0x18b144=_0xe4ed3c[_0xdc91('0x4d')][_0xdc91('0x9e')][_0xdc91('0x9f')](',');var _0x5981ee={};_0x5981ee[_0x18b144[0x0]]={'$gte':moment(_0x18b144[0x1])[_0xdc91('0xa0')](_0xdc91('0xa1'))};_0x536de0[_0xdc91('0x55')]=_[_0xdc91('0x58')](_0x536de0[_0xdc91('0x55')],_0x5981ee);}_0x536de0=_[_0xdc91('0x58')]({},_0x536de0,_0xe4ed3c[_0xdc91('0x5a')]);return db['MailMessage'][_0xdc91('0x20')]({'where':_0x536de0[_0xdc91('0x55')]})[_0xdc91('0x11')](function(_0x3e1d59){_0x304c21['count']=_0x3e1d59;if(_0xe4ed3c[_0xdc91('0x4d')][_0xdc91('0x60')]){_0x536de0['include']=[{'all':!![]}];}return db[_0xdc91('0x9d')][_0xdc91('0x5b')](_0x536de0);})['then'](function(_0x2b6d74){if(_0xe4ed3c['query'][_0xdc91('0xa2')]===_0xdc91('0xa3')){for(var _0x1e2e7f=0x0;_0x1e2e7f<_0x2b6d74[_0xdc91('0x5f')];_0x1e2e7f++){_0x2b6d74[_0x1e2e7f][_0xdc91('0x63')]=juice(_0x2b6d74[_0x1e2e7f]['body']);}}_0x304c21['rows']=_0x2b6d74;return _0x304c21;});}})[_0xdc91('0x11')](respondWithFilteredResult(_0x46b173,_0x536de0))[_0xdc91('0x1a')](handleError(_0x46b173,null));};exports['send']=function(_0x1123fb,_0xfea2e8){var _0x5e3bc1,_0x45d2dc={},_0x433c94;if(_0x1123fb[_0xdc91('0x63')]['to']){_0x433c94=_0x1123fb['body']['to']['split'](',')[0x0];}return db[_0xdc91('0x46')][_0xdc91('0x62')]({'where':{'id':_0x1123fb[_0xdc91('0x5d')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xdc91('0xa4')],'as':_0xdc91('0xa5'),'where':{'email':_0x433c94},'limit':0x1,'order':[[_0xdc91('0xa6'),'DESC']]}]},{'model':db[_0xdc91('0x43')],'as':_0xdc91('0x44'),'raw':!![],'include':[{'model':db[_0xdc91('0xa7')],'as':_0xdc91('0xa7'),'raw':!![]}]}]})[_0xdc91('0x11')](handleEntityNotFound(_0xfea2e8,null))[_0xdc91('0x11')](function(_0x4cfdd6){if(!_0x4cfdd6)return;_0x5e3bc1=_0x4cfdd6;if(!_0x4cfdd6[_0xdc91('0x44')])throw new Error(_0xdc91('0xa8'));if(_[_0xdc91('0xa9')](_0x1123fb['body'][_0xdc91('0xaa')])){_0x1123fb[_0xdc91('0x63')][_0xdc91('0xaa')]=util[_0xdc91('0xa0')](_0xdc91('0xab'),_0x4cfdd6[_0xdc91('0x29')],_0x4cfdd6[_0xdc91('0x76')]||_0x4cfdd6[_0xdc91('0x44')][_0xdc91('0x35')]);}if(_0x1123fb[_0xdc91('0x63')][_0xdc91('0xac')]&&_0x1123fb[_0xdc91('0x63')][_0xdc91('0xac')][_0xdc91('0x5f')]){for(var _0x4b6bc8=0x0;_0x4b6bc8<_0x1123fb[_0xdc91('0x63')][_0xdc91('0xac')]['length'];_0x4b6bc8+=0x1){_0x1123fb['body']['attachments'][_0x4b6bc8]={'filename':_0x1123fb['body'][_0xdc91('0xac')][_0x4b6bc8]['name'],'path':path[_0xdc91('0xad')](config[_0xdc91('0xae')],'server/files/attachments',_0x1123fb[_0xdc91('0x63')][_0xdc91('0xac')][_0x4b6bc8][_0xdc91('0xaf')])};}}var _0x2d4b34=_0x4cfdd6[_0xdc91('0xb0')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x2d4b34,'message':_0x1123fb['body']});})[_0xdc91('0x11')](function(_0x5ba377){if(!_0x5ba377)return;_0x45d2dc=_0x5ba377;if(!_0x5e3bc1[_0xdc91('0xb1')])throw new Error(_0xdc91('0xb2'));if(_0x5e3bc1['List'][_0xdc91('0xa5')][_0xdc91('0x5f')])return _0x5e3bc1['List'][_0xdc91('0xa5')][0x0];return db['CmContact'][_0xdc91('0x6a')](_['defaults'](_0x1123fb['body'],{'firstName':_0x1123fb[_0xdc91('0x63')]['to'],'email':_0x1123fb[_0xdc91('0x63')]['to'],'phone':_0x1123fb[_0xdc91('0x63')]['to'],'ListId':_0x5e3bc1['ListId']}));})[_0xdc91('0x11')](function(_0x478058){if(!_0x478058)return;var _0x3ba31d={'UserId':_0x1123fb['user']['id'],'ContactId':_0x478058['id'],'MailAccountId':_0x5e3bc1['id'],'inReplyTo':_0x45d2dc[_0xdc91('0xb3')],'to':_0x1123fb['body'][_0xdc91('0xaa')],'cc':_0x1123fb[_0xdc91('0x63')]['cc'],'subject':_0x1123fb[_0xdc91('0x63')][_0xdc91('0xb4')],'attach':_0x1123fb[_0xdc91('0x63')][_0xdc91('0xb5')],'firstMsgDirection':'out','lastMsgAt':moment()[_0xdc91('0xa0')](_0xdc91('0xa1')),'lastMsgDirection':_0xdc91('0xb6'),'Messages':[_[_0xdc91('0x58')](_0x1123fb[_0xdc91('0x63')],{'messageId':_0x45d2dc[_0xdc91('0xb3')],'sentAt':moment()['format'](_0xdc91('0xa1')),'read':!![],'MailAccountId':_0x5e3bc1['id'],'UserId':_0x1123fb[_0xdc91('0x35')]['id'],'ContactId':_0x478058['id']})]};if(_0x1123fb[_0xdc91('0x63')][_0xdc91('0xb7')]){_0x3ba31d=_[_0xdc91('0x58')](_0x3ba31d,_0x1123fb[_0xdc91('0x63')][_0xdc91('0xb7')]);}return db[_0xdc91('0x89')]['create'](_0x3ba31d,{'include':[{'model':db[_0xdc91('0x9d')],'as':_0xdc91('0xb8')}]});})[_0xdc91('0x11')](respondWithResult(_0xfea2e8,null))['catch'](handleError(_0xfea2e8,null));};exports['verifySmtp']=function(_0x387458,_0x4903d3){return db['MailAccount'][_0xdc91('0x62')]({'where':{'id':_0x387458[_0xdc91('0x5d')]['id']},'include':[{'model':db[_0xdc91('0x43')],'as':_0xdc91('0x44'),'raw':!![],'include':[{'model':db[_0xdc91('0xa7')],'as':_0xdc91('0xa7'),'raw':!![]}]}]})[_0xdc91('0x11')](handleEntityNotFound(_0x4903d3,null))[_0xdc91('0x11')](function(_0x419bc8){if(!_0x419bc8['Smtp'])return;var _0x494edf=_0x419bc8[_0xdc91('0xb0')]();return respondWithRpcPromise(_0xdc91('0xb9'),_0xdc91('0xba'),{'account':_0x494edf});})[_0xdc91('0x11')](respondWithResult(_0x4903d3,null))[_0xdc91('0x1a')](handleError(_0x4903d3,null));};exports[_0xdc91('0x25')]=function(_0x2632cd,_0x4f544e){return db[_0xdc91('0x46')][_0xdc91('0x62')]({'where':{'id':_0x2632cd[_0xdc91('0x5d')]['id']}})[_0xdc91('0x11')](handleEntityNotFound(_0x4f544e,null))[_0xdc91('0x11')](function(_0x1c1c64){if(_0x1c1c64&&_0x1c1c64[_0xdc91('0x3d')]){throw new db['Sequelize'][(_0xdc91('0xbb'))](_0xdc91('0xbc'));}return _0x1c1c64;})[_0xdc91('0x11')](removeEntity(_0x4f544e,null))[_0xdc91('0x1a')](handleError(_0x4f544e,null));};exports[_0xdc91('0xbd')]=function(_0xbe79a2,_0x43d014){return db[_0xdc91('0x46')][_0xdc91('0x62')]({'where':{'id':_0xbe79a2['params']['id']}})[_0xdc91('0x11')](handleEntityNotFound(_0x43d014,null))[_0xdc91('0x11')](function(_0x261bd5){if(_0x261bd5){return _0x261bd5[_0xdc91('0xbd')](_0xbe79a2[_0xdc91('0x63')][_0xdc91('0x70')],_[_0xdc91('0x8a')](_0xbe79a2[_0xdc91('0x63')],[_0xdc91('0x70'),'id'])||{})['spread'](function(_0x592170){for(var _0x529541=0x0;_0x529541<_0xbe79a2[_0xdc91('0x63')][_0xdc91('0x70')][_0xdc91('0x5f')];_0x529541+=0x1){socket[_0xdc91('0xbe')](_0xdc91('0xbf'),{'UserId':Number(_0xbe79a2[_0xdc91('0x63')][_0xdc91('0x70')][_0x529541]),'MailAccountId':Number(_0xbe79a2[_0xdc91('0x5d')]['id'])});}return _0x592170;});}})[_0xdc91('0x11')](respondWithResult(_0x43d014,null))[_0xdc91('0x1a')](handleError(_0x43d014,null));};exports['removeAgents']=function(_0x1c8285,_0x1a463f){return db[_0xdc91('0x46')][_0xdc91('0x62')]({'where':{'id':_0x1c8285['params']['id']}})['then'](handleEntityNotFound(_0x1a463f,null))[_0xdc91('0x11')](function(_0xe7e5fe){if(_0xe7e5fe){return _0xe7e5fe[_0xdc91('0xc0')](_0x1c8285['query']['ids'])['then'](function(){if(_[_0xdc91('0xc1')](_0x1c8285[_0xdc91('0x4d')][_0xdc91('0x70')])){for(var _0x4a10e7=0x0;_0x4a10e7<_0x1c8285[_0xdc91('0x4d')][_0xdc91('0x70')][_0xdc91('0x5f')];_0x4a10e7+=0x1){socket[_0xdc91('0xbe')](_0xdc91('0xc2'),{'UserId':Number(_0x1c8285[_0xdc91('0x4d')][_0xdc91('0x70')][_0x4a10e7]),'MailAccountId':Number(_0x1c8285[_0xdc91('0x5d')]['id'])});}}else{socket[_0xdc91('0xbe')]('userMailAccount:remove',{'UserId':Number(_0x1c8285[_0xdc91('0x4d')][_0xdc91('0x70')]),'MailAccountId':Number(_0x1c8285[_0xdc91('0x5d')]['id'])});}});}})['then'](respondWithStatusCode(_0x1a463f,null))[_0xdc91('0x1a')](handleError(_0x1a463f,null));};exports['getAgents']=function(_0x1768cb,_0x5abd14){var _0x6c7bf1={};var _0x4fb454={};var _0x5d632b;var _0x1cbb0a;return db[_0xdc91('0x46')][_0xdc91('0x73')]({'where':{'id':_0x1768cb[_0xdc91('0x5d')]['id']}})[_0xdc91('0x11')](handleEntityNotFound(_0x5abd14,null))[_0xdc91('0x11')](function(_0x3457d5){if(_0x3457d5){_0x5d632b=_0x3457d5;_0x4fb454['model']=_[_0xdc91('0x4e')](db['User'][_0xdc91('0x47')]);_0x4fb454['query']=_[_0xdc91('0x4e')](_0x1768cb[_0xdc91('0x4d')]);_0x4fb454[_0xdc91('0x4f')]=_[_0xdc91('0x51')](_0x4fb454[_0xdc91('0x4b')],_0x4fb454[_0xdc91('0x4d')]);_0x6c7bf1[_0xdc91('0x50')]=_[_0xdc91('0x51')](_0x4fb454[_0xdc91('0x4b')],qs[_0xdc91('0x52')](_0x1768cb[_0xdc91('0x4d')][_0xdc91('0x52')]));_0x6c7bf1['attributes']=_0x6c7bf1[_0xdc91('0x50')][_0xdc91('0x5f')]?_0x6c7bf1[_0xdc91('0x50')]:_0x4fb454['model'];_0x6c7bf1['order']=qs['sort'](_0x1768cb[_0xdc91('0x4d')][_0xdc91('0x54')]);_0x6c7bf1['where']=qs[_0xdc91('0x4f')](_['pick'](_0x1768cb[_0xdc91('0x4d')],_0x4fb454[_0xdc91('0x4f')]));if(_0x1768cb['query'][_0xdc91('0x57')]){_0x6c7bf1[_0xdc91('0x55')]=_[_0xdc91('0x58')](_0x6c7bf1[_0xdc91('0x55')],{'$or':_[_0xdc91('0x4c')](_0x6c7bf1[_0xdc91('0x50')],function(_0x54870a){var _0x4ca9d2={};_0x4ca9d2[_0x54870a]={'$like':'%'+_0x1768cb['query']['filter']+'%'};return _0x4ca9d2;})});}_0x6c7bf1=_['merge']({},_0x6c7bf1,_0x1768cb['options']);return _0x5d632b[_0xdc91('0xc3')](_0x6c7bf1);}})[_0xdc91('0x11')](function(_0x3381e8){if(_0x3381e8){_0x1cbb0a=_0x3381e8[_0xdc91('0x5f')];if(!_0x1768cb[_0xdc91('0x4d')][_0xdc91('0x6c')](_0xdc91('0x6d'))){_0x6c7bf1['limit']=qs['limit'](_0x1768cb['query'][_0xdc91('0x21')]);_0x6c7bf1[_0xdc91('0x53')]=qs['offset'](_0x1768cb[_0xdc91('0x4d')][_0xdc91('0x53')]);}return _0x5d632b[_0xdc91('0xc3')](_0x6c7bf1);}})[_0xdc91('0x11')](function(_0x3dd032){if(_0x3dd032){return _0x3dd032?{'count':_0x1cbb0a,'rows':_0x3dd032}:null;}})[_0xdc91('0x11')](respondWithResult(_0x5abd14,null))['catch'](handleError(_0x5abd14,null));}; \ No newline at end of file +var _0xa9d6=['query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','options','include','show','MailServerIn','includeAll','provider','custom','body','find','params','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','findOne','Disposition','order','filter','rows','removeDispositions','addAnswer','CannedAnswer','findAll','removeAnswers','ids','create','email','ListId','isNil','active','description','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','User','Owner','fullname','internal','Tags','color','tag','addApplications','sequelize','Transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','CmList','List','CmContact','updatedAt','DESC','CloudProvider','from','%s\x20<%s>','attachments','join','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','Contacts','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','removeAgents','userMailAccount:remove','moment','bluebird','lodash','juice','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailAccount.socket','request','then','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','update','destroy','get','MailAccounts','UserProfileResource','stack','name','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','port','host','secure','service','Imap','Smtp','index','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','key'];(function(_0x3e6432,_0x38edf1){var _0x33956e=function(_0x3a65ba){while(--_0x3a65ba){_0x3e6432['push'](_0x3e6432['shift']());}};_0x33956e(++_0x38edf1);}(_0xa9d6,0x72));var _0x6a9d=function(_0xa85d7c,_0x8958ab){_0xa85d7c=_0xa85d7c-0x0;var _0x5429ae=_0xa9d6[_0xa85d7c];return _0x5429ae;};'use strict';var moment=require(_0x6a9d('0x0'));var BPromise=require(_0x6a9d('0x1'));var util=require('util');var path=require('path');var _=require(_0x6a9d('0x2'));var juice=require(_0x6a9d('0x3'));var Redis=require(_0x6a9d('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x6a9d('0x5'))(_0x6a9d('0x6'));var config=require(_0x6a9d('0x7'));var db=require(_0x6a9d('0x8'))['db'];config[_0x6a9d('0x9')]=_[_0x6a9d('0xa')](config[_0x6a9d('0x9')],{'host':_0x6a9d('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6a9d('0x9')]));require(_0x6a9d('0xc'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});function respondWithRpcPromise(_0x45dfb5,_0xd29f63,_0x39d803,_0x3944e6){return new BPromise(function(_0xeb7f69,_0xf3c244){var _0x385453=_0x3944e6||client;return _0x385453[_0x6a9d('0xd')](_0x45dfb5,_0x39d803)[_0x6a9d('0xe')](function(_0x4d5004){logger[_0x6a9d('0xf')]('MailAccount,\x20%s,\x20%s',_0xd29f63,_0x6a9d('0x10'));logger['debug'](_0x6a9d('0x11'),_0xd29f63,_0x6a9d('0x10'),JSON['stringify'](_0x4d5004));if(_0x4d5004['error']){if(_0x4d5004[_0x6a9d('0x12')][_0x6a9d('0x13')]===0x1f4){logger['error'](_0x6a9d('0x14'),_0xd29f63,_0x4d5004[_0x6a9d('0x12')]['message']);return _0xf3c244(_0x4d5004[_0x6a9d('0x12')][_0x6a9d('0x15')]);}logger[_0x6a9d('0x12')](_0x6a9d('0x14'),_0xd29f63,_0x4d5004[_0x6a9d('0x12')]['message']);return _0xeb7f69(_0x4d5004[_0x6a9d('0x12')]['message']);}else{logger['info'](_0x6a9d('0x14'),_0xd29f63,_0x6a9d('0x10'));_0xeb7f69(_0x4d5004[_0x6a9d('0x16')]['message']);}})[_0x6a9d('0x17')](function(_0x410b02){logger[_0x6a9d('0x12')](_0x6a9d('0x14'),_0xd29f63,_0x410b02);_0xf3c244(_0x410b02);});});}function respondWithStatusCode(_0x4c451f,_0x122313){_0x122313=_0x122313||0xcc;return function(_0x4038cc){if(_0x4038cc){return _0x4c451f[_0x6a9d('0x18')](_0x122313);}return _0x4c451f['status'](_0x122313)[_0x6a9d('0x19')]();};}function respondWithResult(_0x4a16db,_0x51d184){_0x51d184=_0x51d184||0xc8;return function(_0x3cfcf3){if(_0x3cfcf3){return _0x4a16db[_0x6a9d('0x1a')](_0x51d184)[_0x6a9d('0x1b')](_0x3cfcf3);}};}function respondWithFilteredResult(_0x2ecfc5,_0x3615b3){return function(_0x5caf55){if(_0x5caf55){var _0x2c36e5=typeof _0x3615b3[_0x6a9d('0x1c')]===_0x6a9d('0x1d')&&typeof _0x3615b3[_0x6a9d('0x1e')]===_0x6a9d('0x1d');var _0x5d1808=_0x5caf55['count'];var _0x4cf32a=_0x2c36e5?0x0:_0x3615b3['offset'];var _0x125576=_0x2c36e5?_0x5caf55[_0x6a9d('0x1f')]:_0x3615b3[_0x6a9d('0x1c')]+_0x3615b3[_0x6a9d('0x1e')];var _0x2bdca8;if(_0x125576>=_0x5d1808){_0x125576=_0x5d1808;_0x2bdca8=0xc8;}else{_0x2bdca8=0xce;}_0x2ecfc5[_0x6a9d('0x1a')](_0x2bdca8);return _0x2ecfc5[_0x6a9d('0x20')]('Content-Range',_0x4cf32a+'-'+_0x125576+'/'+_0x5d1808)[_0x6a9d('0x1b')](_0x5caf55);}return null;};}function saveUpdates(_0x44d5e3){return function(_0x2ba7d5){if(_0x2ba7d5){return _0x2ba7d5[_0x6a9d('0x21')](_0x44d5e3)[_0x6a9d('0xe')](function(_0x33473e){return _0x33473e;});}return null;};}function removeEntity(_0x2e8d6f){return function(_0x31413d){if(_0x31413d){return _0x31413d[_0x6a9d('0x22')]()[_0x6a9d('0xe')](function(){var _0x4056cb=_0x31413d[_0x6a9d('0x23')]({'plain':!![]});var _0x27877c=_0x6a9d('0x24');return db[_0x6a9d('0x25')][_0x6a9d('0x22')]({'where':{'type':_0x27877c,'resourceId':_0x4056cb['id']}})['then'](function(){return _0x31413d;});})[_0x6a9d('0xe')](function(){_0x2e8d6f['status'](0xcc)[_0x6a9d('0x19')]();});}};}function handleEntityNotFound(_0x3b5eb4){return function(_0xe45d73){if(!_0xe45d73){_0x3b5eb4['sendStatus'](0x194);}return _0xe45d73;};}function handleError(_0x3b4a13,_0x47814d){_0x47814d=_0x47814d||0x1f4;return function(_0x5d3948){logger['error'](_0x5d3948[_0x6a9d('0x26')]);if(_0x5d3948[_0x6a9d('0x27')]){delete _0x5d3948[_0x6a9d('0x27')];}_0x3b4a13['status'](_0x47814d)[_0x6a9d('0x28')](_0x5d3948);};}function getImapHost(_0x32f908){switch(_0x32f908){case _0x6a9d('0x29'):return _0x6a9d('0x2a');case _0x6a9d('0x2b'):return _0x6a9d('0x2c');case _0x6a9d('0x2d'):return _0x6a9d('0x2e');case _0x6a9d('0x2f'):return _0x6a9d('0x30');}throw new Error(_0x6a9d('0x31'),_0x32f908);}function getSmtpHost(_0x183702){switch(_0x183702){case _0x6a9d('0x29'):return _0x6a9d('0x32');case _0x6a9d('0x2b'):return _0x6a9d('0x33');case _0x6a9d('0x2d'):return _0x6a9d('0x34');case _0x6a9d('0x2f'):return _0x6a9d('0x35');}throw new Error(_0x6a9d('0x31'),_0x183702);}function getAuthenticationOptions(_0x1e3c01,_0x26acf7){var _0x46077e={};var _0x2d706b={};if(_0x1e3c01){_0x46077e[_0x6a9d('0x36')]=_0x2d706b['user']=_0x26acf7[_0x6a9d('0x37')];_0x46077e[_0x6a9d('0x38')]=_0x2d706b[_0x6a9d('0x39')]=_0x26acf7[_0x6a9d('0x38')];if(_0x26acf7['modernAuthentication']){_0x46077e[_0x6a9d('0x3a')]=_0x2d706b['modernAuthentication']=!![];_0x46077e['CloudProviderId']=_0x2d706b['CloudProviderId']=_0x26acf7[_0x6a9d('0x3b')];_0x46077e[_0x6a9d('0x38')]=_0x2d706b[_0x6a9d('0x39')]=null;}else{_0x46077e[_0x6a9d('0x3b')]=_0x2d706b[_0x6a9d('0x3b')]=null;}_0x46077e['host']=getImapHost(_0x1e3c01);_0x46077e[_0x6a9d('0x3c')]=0x3e1;_0x2d706b[_0x6a9d('0x3d')]=getSmtpHost(_0x1e3c01);_0x2d706b['port']=0x24b;_0x2d706b[_0x6a9d('0x3e')]=![];_0x46077e[_0x6a9d('0x3f')]=_0x2d706b[_0x6a9d('0x3f')]=null;}else{if(_0x26acf7['authentication']){_0x46077e[_0x6a9d('0x36')]=_0x2d706b['user']=_0x26acf7[_0x6a9d('0x37')];_0x46077e[_0x6a9d('0x38')]=_0x2d706b[_0x6a9d('0x39')]=_0x26acf7[_0x6a9d('0x38')];}else{_0x46077e['authentication']=_0x2d706b['authentication']=![];_0x46077e[_0x6a9d('0x36')]=_0x2d706b['user']=null;_0x46077e[_0x6a9d('0x38')]=_0x2d706b[_0x6a9d('0x39')]=null;}_0x46077e['host']=_0x26acf7[_0x6a9d('0x40')][_0x6a9d('0x3d')];_0x46077e[_0x6a9d('0x3c')]=_0x26acf7['Imap'][_0x6a9d('0x3c')];_0x2d706b[_0x6a9d('0x3d')]=_0x26acf7[_0x6a9d('0x41')][_0x6a9d('0x3d')];_0x2d706b[_0x6a9d('0x3c')]=_0x26acf7[_0x6a9d('0x41')]['port'];}return{'Imap':_0x46077e,'Smtp':_0x2d706b};}exports[_0x6a9d('0x42')]=function(_0x135bc3,_0xfd9eb6){var _0x5c2f71={'include':[{'model':db['MailServerIn'],'as':_0x6a9d('0x40')},{'model':db[_0x6a9d('0x43')],'as':_0x6a9d('0x41')},{'model':db[_0x6a9d('0x44')],'as':_0x6a9d('0x45')}]},_0x2d7e21={},_0x5d6a5c={'count':0x0,'rows':[]};var _0x336d34=_[_0x6a9d('0x46')](db[_0x6a9d('0x47')][_0x6a9d('0x48')],function(_0x1fea8b){return{'name':_0x1fea8b[_0x6a9d('0x49')],'type':_0x1fea8b['type'][_0x6a9d('0x4a')]};});_0x2d7e21['model']=_[_0x6a9d('0x46')](_0x336d34,_0x6a9d('0x27'));_0x2d7e21[_0x6a9d('0x4b')]=_[_0x6a9d('0x4c')](_0x135bc3[_0x6a9d('0x4b')]);_0x2d7e21[_0x6a9d('0x4d')]=_[_0x6a9d('0x4e')](_0x2d7e21[_0x6a9d('0x4f')],_0x2d7e21[_0x6a9d('0x4b')]);_0x5c2f71[_0x6a9d('0x50')]=_[_0x6a9d('0x4e')](_0x2d7e21[_0x6a9d('0x4f')],qs['fields'](_0x135bc3['query'][_0x6a9d('0x51')]));_0x5c2f71[_0x6a9d('0x50')]=_0x5c2f71['attributes'][_0x6a9d('0x52')]?_0x5c2f71[_0x6a9d('0x50')]:_0x2d7e21['model'];if(!_0x135bc3[_0x6a9d('0x4b')][_0x6a9d('0x53')](_0x6a9d('0x54'))){_0x5c2f71[_0x6a9d('0x1e')]=qs[_0x6a9d('0x1e')](_0x135bc3[_0x6a9d('0x4b')][_0x6a9d('0x1e')]);_0x5c2f71[_0x6a9d('0x1c')]=qs[_0x6a9d('0x1c')](_0x135bc3[_0x6a9d('0x4b')]['offset']);}_0x5c2f71['order']=qs['sort'](_0x135bc3[_0x6a9d('0x4b')][_0x6a9d('0x55')]);_0x5c2f71[_0x6a9d('0x56')]=qs[_0x6a9d('0x4d')](_[_0x6a9d('0x57')](_0x135bc3[_0x6a9d('0x4b')],_0x2d7e21[_0x6a9d('0x4d')]),_0x336d34);if(_0x135bc3[_0x6a9d('0x4b')]['filter']){_0x5c2f71[_0x6a9d('0x56')]=_[_0x6a9d('0x58')](_0x5c2f71[_0x6a9d('0x56')],{'$or':_[_0x6a9d('0x46')](_0x336d34,function(_0x1ab1ce){if(_0x1ab1ce[_0x6a9d('0x59')]!==_0x6a9d('0x5a')){var _0x2de54b={};_0x2de54b[_0x1ab1ce['name']]={'$like':'%'+_0x135bc3[_0x6a9d('0x4b')]['filter']+'%'};return _0x2de54b;}})});}_0x5c2f71=_[_0x6a9d('0x58')]({},_0x5c2f71,_0x135bc3[_0x6a9d('0x5b')]);var _0x557a84={'where':_0x5c2f71[_0x6a9d('0x56')]};return db['MailAccount'][_0x6a9d('0x1f')](_0x557a84)[_0x6a9d('0xe')](function(_0x28200a){_0x5d6a5c[_0x6a9d('0x1f')]=_0x28200a;if(_0x135bc3[_0x6a9d('0x4b')]['includeAll']){_0x5c2f71[_0x6a9d('0x5c')]=[{'all':!![]}];}return db[_0x6a9d('0x47')]['findAll'](_0x5c2f71);})[_0x6a9d('0xe')](function(_0x179d3a){_0x5d6a5c['rows']=_0x179d3a;return _0x5d6a5c;})[_0x6a9d('0xe')](respondWithFilteredResult(_0xfd9eb6,_0x5c2f71))[_0x6a9d('0x17')](handleError(_0xfd9eb6,null));};exports[_0x6a9d('0x5d')]=function(_0x3f502e,_0x42a798){var _0x46073a={'raw':![],'where':{'id':_0x3f502e['params']['id']},'include':[{'model':db[_0x6a9d('0x5e')],'as':_0x6a9d('0x40')},{'model':db[_0x6a9d('0x43')],'as':_0x6a9d('0x41')},{'model':db[_0x6a9d('0x44')],'as':_0x6a9d('0x45')}]},_0x237317={};_0x237317['model']=_[_0x6a9d('0x4c')](db[_0x6a9d('0x47')][_0x6a9d('0x48')]);_0x237317['query']=_[_0x6a9d('0x4c')](_0x3f502e['query']);_0x237317[_0x6a9d('0x4d')]=_[_0x6a9d('0x4e')](_0x237317[_0x6a9d('0x4f')],_0x237317[_0x6a9d('0x4b')]);_0x46073a[_0x6a9d('0x50')]=_[_0x6a9d('0x4e')](_0x237317['model'],qs[_0x6a9d('0x51')](_0x3f502e[_0x6a9d('0x4b')][_0x6a9d('0x51')]));_0x46073a[_0x6a9d('0x50')]=_0x46073a[_0x6a9d('0x50')][_0x6a9d('0x52')]?_0x46073a[_0x6a9d('0x50')]:_0x237317['model'];if(_0x3f502e[_0x6a9d('0x4b')][_0x6a9d('0x5f')]){_0x46073a[_0x6a9d('0x5c')]=[{'all':!![]}];}_0x46073a=_[_0x6a9d('0x58')]({},_0x46073a,_0x3f502e[_0x6a9d('0x5b')]);return db[_0x6a9d('0x47')]['find'](_0x46073a)['then'](handleEntityNotFound(_0x42a798,null))[_0x6a9d('0xe')](respondWithResult(_0x42a798,null))['catch'](handleError(_0x42a798,null));};exports[_0x6a9d('0x21')]=function(_0x328b26,_0x597db9){if(_0x328b26['body']['id']){delete _0x328b26['body']['id'];}var _0x2928d3=_0x328b26['body'][_0x6a9d('0x60')]===_0x6a9d('0x61')?null:_0x328b26[_0x6a9d('0x62')][_0x6a9d('0x60')];var _0x5e233d=_0x328b26[_0x6a9d('0x62')][_0x6a9d('0x40')]||{};var _0xf74570=_0x328b26[_0x6a9d('0x62')][_0x6a9d('0x41')]||{};if(_0x2928d3){_0x5e233d[_0x6a9d('0x3d')]=getImapHost(_0x2928d3);_0x5e233d[_0x6a9d('0x3c')]=0x3e1;_0xf74570[_0x6a9d('0x3d')]=getSmtpHost(_0x2928d3);_0xf74570[_0x6a9d('0x3c')]=0x24b;_0xf74570[_0x6a9d('0x3e')]=![];}if(_0xf74570[_0x6a9d('0x3a')]){_0xf74570['secure']=![];}else{_0xf74570['CloudProviderId']=null;}if(!_0x5e233d[_0x6a9d('0x3a')])_0x5e233d['CloudProviderId']=null;_0x328b26['body'][_0x6a9d('0x40')]=_0x5e233d;_0x328b26[_0x6a9d('0x62')][_0x6a9d('0x41')]=_0xf74570;return db['MailAccount'][_0x6a9d('0x63')]({'where':{'id':_0x328b26[_0x6a9d('0x64')]['id']},'include':[{'model':db[_0x6a9d('0x5e')],'as':_0x6a9d('0x40')},{'model':db[_0x6a9d('0x43')],'as':_0x6a9d('0x41')},{'model':db[_0x6a9d('0x44')],'as':_0x6a9d('0x45')}]})[_0x6a9d('0xe')](handleEntityNotFound(_0x597db9,null))['then'](function(_0x7a172c){if(!_0x7a172c)throw new Error(_0x6a9d('0x65'));if(_0x7a172c[_0x6a9d('0x3f')])delete _0x328b26[_0x6a9d('0x62')]['Imap'];return _0x7a172c;})[_0x6a9d('0xe')](saveUpdates(_0x328b26['body'],null))['then'](function(_0x300034){if(!_0x328b26[_0x6a9d('0x62')][_0x6a9d('0x40')])return _0x300034;return db[_0x6a9d('0x5e')]['update'](_0x328b26[_0x6a9d('0x62')][_0x6a9d('0x40')],{'where':{'MailAccountId':_0x300034['id']}})['then'](function(){return _0x300034;});})[_0x6a9d('0xe')](function(_0x1f987d){if(!_0x328b26[_0x6a9d('0x62')]['Smtp'])return _0x1f987d;return db[_0x6a9d('0x43')][_0x6a9d('0x21')](_0x328b26[_0x6a9d('0x62')][_0x6a9d('0x41')],{'where':{'MailAccountId':_0x1f987d['id']}})[_0x6a9d('0xe')](function(){return _0x1f987d;});})[_0x6a9d('0xe')](respondWithResult(_0x597db9,null))[_0x6a9d('0x17')](handleError(_0x597db9,null));};exports['describe']=function(_0x112d80,_0x441b02){return db[_0x6a9d('0x47')][_0x6a9d('0x66')]()['then'](respondWithResult(_0x441b02,null))[_0x6a9d('0x17')](handleError(_0x441b02,null));};exports[_0x6a9d('0x67')]=function(_0x5dcac0,_0x15c59f){if(_0x5dcac0[_0x6a9d('0x62')]['id']){delete _0x5dcac0[_0x6a9d('0x62')]['id'];}return db[_0x6a9d('0x47')][_0x6a9d('0x63')]({'where':{'id':_0x5dcac0[_0x6a9d('0x64')]['id']}})[_0x6a9d('0xe')](handleEntityNotFound(_0x15c59f,null))[_0x6a9d('0xe')](function(_0x24a24b){if(_0x24a24b){_0x5dcac0[_0x6a9d('0x62')][_0x6a9d('0x68')]=_0x24a24b['id'];return db['Disposition']['create'](_0x5dcac0[_0x6a9d('0x62')]);}})[_0x6a9d('0xe')](respondWithResult(_0x15c59f,null))['catch'](handleError(_0x15c59f,null));};exports['getDispositions']=function(_0x59e0c5,_0x9af8b5){var _0x20a8c6={'raw':![],'where':{}};var _0x2f7ed0={};var _0x4f8a55={'count':0x0,'rows':[]};return db[_0x6a9d('0x47')][_0x6a9d('0x69')]({'where':{'id':_0x59e0c5[_0x6a9d('0x64')]['id']}})[_0x6a9d('0xe')](handleEntityNotFound(_0x9af8b5,null))['then'](function(_0x156f28){if(_0x156f28){_0x2f7ed0[_0x6a9d('0x4f')]=_[_0x6a9d('0x4c')](db[_0x6a9d('0x6a')][_0x6a9d('0x48')]);_0x2f7ed0['query']=_[_0x6a9d('0x4c')](_0x59e0c5[_0x6a9d('0x4b')]);_0x2f7ed0[_0x6a9d('0x4d')]=_[_0x6a9d('0x4e')](_0x2f7ed0['model'],_0x2f7ed0[_0x6a9d('0x4b')]);_0x20a8c6[_0x6a9d('0x50')]=_[_0x6a9d('0x4e')](_0x2f7ed0[_0x6a9d('0x4f')],qs[_0x6a9d('0x51')](_0x59e0c5[_0x6a9d('0x4b')][_0x6a9d('0x51')]));_0x20a8c6[_0x6a9d('0x50')]=_0x20a8c6['attributes']['length']?_0x20a8c6[_0x6a9d('0x50')]:_0x2f7ed0[_0x6a9d('0x4f')];if(!_0x59e0c5[_0x6a9d('0x4b')][_0x6a9d('0x53')](_0x6a9d('0x54'))){_0x20a8c6[_0x6a9d('0x1e')]=qs[_0x6a9d('0x1e')](_0x59e0c5[_0x6a9d('0x4b')]['limit']);_0x20a8c6[_0x6a9d('0x1c')]=qs[_0x6a9d('0x1c')](_0x59e0c5[_0x6a9d('0x4b')]['offset']);}_0x20a8c6[_0x6a9d('0x6b')]=qs[_0x6a9d('0x55')](_0x59e0c5[_0x6a9d('0x4b')][_0x6a9d('0x55')]);_0x20a8c6[_0x6a9d('0x56')]=qs['filters'](_[_0x6a9d('0x57')](_0x59e0c5[_0x6a9d('0x4b')],_0x2f7ed0[_0x6a9d('0x4d')]));_0x20a8c6[_0x6a9d('0x56')][_0x6a9d('0x68')]=_0x156f28['id'];if(_0x59e0c5[_0x6a9d('0x4b')][_0x6a9d('0x6c')]){_0x20a8c6[_0x6a9d('0x56')]=_[_0x6a9d('0x58')](_0x20a8c6['where'],{'$or':_[_0x6a9d('0x46')](_0x20a8c6[_0x6a9d('0x50')],function(_0xa76a10){var _0xaba52b={};_0xaba52b[_0xa76a10]={'$like':'%'+_0x59e0c5[_0x6a9d('0x4b')][_0x6a9d('0x6c')]+'%'};return _0xaba52b;})});}_0x20a8c6=_[_0x6a9d('0x58')]({},_0x20a8c6,_0x59e0c5[_0x6a9d('0x5b')]);return db[_0x6a9d('0x6a')][_0x6a9d('0x1f')]({'where':_0x20a8c6[_0x6a9d('0x56')]})[_0x6a9d('0xe')](function(_0x41a03a){_0x4f8a55[_0x6a9d('0x1f')]=_0x41a03a;if(_0x59e0c5['query'][_0x6a9d('0x5f')]){_0x20a8c6[_0x6a9d('0x5c')]=[{'all':!![]}];}return db[_0x6a9d('0x6a')]['findAll'](_0x20a8c6);})['then'](function(_0x134c64){_0x4f8a55[_0x6a9d('0x6d')]=_0x134c64;return _0x4f8a55;});}})[_0x6a9d('0xe')](respondWithFilteredResult(_0x9af8b5,_0x20a8c6))['catch'](handleError(_0x9af8b5,null));};exports[_0x6a9d('0x6e')]=function(_0x41fa05,_0x1b56b6){return db[_0x6a9d('0x47')]['find']({'where':{'id':_0x41fa05[_0x6a9d('0x64')]['id']}})['then'](handleEntityNotFound(_0x1b56b6,null))[_0x6a9d('0xe')](function(_0x5531e2){if(_0x5531e2){return _0x5531e2['removeDispositions'](_0x41fa05['query']['ids']);}})['then'](respondWithStatusCode(_0x1b56b6,null))[_0x6a9d('0x17')](handleError(_0x1b56b6,null));};exports[_0x6a9d('0x6f')]=function(_0x4a5c0a,_0x2186b7){if(_0x4a5c0a[_0x6a9d('0x62')]['id']){delete _0x4a5c0a['body']['id'];}return db[_0x6a9d('0x47')][_0x6a9d('0x63')]({'where':{'id':_0x4a5c0a[_0x6a9d('0x64')]['id']}})[_0x6a9d('0xe')](handleEntityNotFound(_0x2186b7,null))[_0x6a9d('0xe')](function(_0x29df61){if(_0x29df61){_0x4a5c0a[_0x6a9d('0x62')]['MailAccountId']=_0x29df61['id'];return db[_0x6a9d('0x70')]['create'](_0x4a5c0a[_0x6a9d('0x62')]);}})[_0x6a9d('0xe')](respondWithResult(_0x2186b7,null))[_0x6a9d('0x17')](handleError(_0x2186b7,null));};exports['getAnswers']=function(_0x5d2ac3,_0x152615){var _0x3ef6ce={'raw':![],'where':{}};var _0x49f836={};var _0x473724={'count':0x0,'rows':[]};return db[_0x6a9d('0x47')][_0x6a9d('0x69')]({'where':{'id':_0x5d2ac3[_0x6a9d('0x64')]['id']}})[_0x6a9d('0xe')](handleEntityNotFound(_0x152615,null))[_0x6a9d('0xe')](function(_0x35a9c2){if(_0x35a9c2){_0x49f836[_0x6a9d('0x4f')]=_[_0x6a9d('0x4c')](db[_0x6a9d('0x70')][_0x6a9d('0x48')]);_0x49f836['query']=_[_0x6a9d('0x4c')](_0x5d2ac3[_0x6a9d('0x4b')]);_0x49f836['filters']=_[_0x6a9d('0x4e')](_0x49f836['model'],_0x49f836[_0x6a9d('0x4b')]);_0x3ef6ce[_0x6a9d('0x50')]=_[_0x6a9d('0x4e')](_0x49f836[_0x6a9d('0x4f')],qs[_0x6a9d('0x51')](_0x5d2ac3[_0x6a9d('0x4b')][_0x6a9d('0x51')]));_0x3ef6ce['attributes']=_0x3ef6ce[_0x6a9d('0x50')][_0x6a9d('0x52')]?_0x3ef6ce[_0x6a9d('0x50')]:_0x49f836[_0x6a9d('0x4f')];if(!_0x5d2ac3[_0x6a9d('0x4b')][_0x6a9d('0x53')](_0x6a9d('0x54'))){_0x3ef6ce[_0x6a9d('0x1e')]=qs[_0x6a9d('0x1e')](_0x5d2ac3[_0x6a9d('0x4b')]['limit']);_0x3ef6ce[_0x6a9d('0x1c')]=qs[_0x6a9d('0x1c')](_0x5d2ac3[_0x6a9d('0x4b')][_0x6a9d('0x1c')]);}_0x3ef6ce[_0x6a9d('0x6b')]=qs[_0x6a9d('0x55')](_0x5d2ac3[_0x6a9d('0x4b')][_0x6a9d('0x55')]);_0x3ef6ce[_0x6a9d('0x56')]=qs[_0x6a9d('0x4d')](_[_0x6a9d('0x57')](_0x5d2ac3[_0x6a9d('0x4b')],_0x49f836[_0x6a9d('0x4d')]));_0x3ef6ce[_0x6a9d('0x56')][_0x6a9d('0x68')]=_0x35a9c2['id'];if(_0x5d2ac3[_0x6a9d('0x4b')][_0x6a9d('0x6c')]){_0x3ef6ce[_0x6a9d('0x56')]=_['merge'](_0x3ef6ce[_0x6a9d('0x56')],{'$or':_['map'](_0x3ef6ce[_0x6a9d('0x50')],function(_0x30a0f7){var _0x36c569={};_0x36c569[_0x30a0f7]={'$like':'%'+_0x5d2ac3['query'][_0x6a9d('0x6c')]+'%'};return _0x36c569;})});}_0x3ef6ce=_[_0x6a9d('0x58')]({},_0x3ef6ce,_0x5d2ac3['options']);return db['CannedAnswer'][_0x6a9d('0x1f')]({'where':_0x3ef6ce['where']})[_0x6a9d('0xe')](function(_0x295e2d){_0x473724['count']=_0x295e2d;if(_0x5d2ac3[_0x6a9d('0x4b')]['includeAll']){_0x3ef6ce[_0x6a9d('0x5c')]=[{'all':!![]}];}return db[_0x6a9d('0x70')][_0x6a9d('0x71')](_0x3ef6ce);})[_0x6a9d('0xe')](function(_0x31dc16){_0x473724[_0x6a9d('0x6d')]=_0x31dc16;return _0x473724;});}})[_0x6a9d('0xe')](respondWithFilteredResult(_0x152615,_0x3ef6ce))[_0x6a9d('0x17')](handleError(_0x152615,null));};exports[_0x6a9d('0x72')]=function(_0x5bc442,_0x5a1fb7){return db[_0x6a9d('0x47')][_0x6a9d('0x63')]({'where':{'id':_0x5bc442[_0x6a9d('0x64')]['id']}})['then'](handleEntityNotFound(_0x5a1fb7,null))[_0x6a9d('0xe')](function(_0x78736f){if(_0x78736f){return _0x78736f[_0x6a9d('0x72')](_0x5bc442[_0x6a9d('0x4b')][_0x6a9d('0x73')]);}})[_0x6a9d('0xe')](respondWithStatusCode(_0x5a1fb7,null))[_0x6a9d('0x17')](handleError(_0x5a1fb7,null));};exports[_0x6a9d('0x74')]=function(_0x559b8f,_0x5d828a){var _0x2a5e93={'name':_0x559b8f[_0x6a9d('0x62')]['name'],'key':_0x559b8f[_0x6a9d('0x62')][_0x6a9d('0x4a')],'provider':_0x559b8f['body'][_0x6a9d('0x60')]==='custom'?null:_0x559b8f[_0x6a9d('0x62')][_0x6a9d('0x60')],'email':_0x559b8f['body'][_0x6a9d('0x75')],'ListId':_0x559b8f[_0x6a9d('0x62')][_0x6a9d('0x76')],'active':!_[_0x6a9d('0x77')](_0x559b8f['body'][_0x6a9d('0x78')])?_0x559b8f['body'][_0x6a9d('0x78')]:!![],'description':_0x559b8f[_0x6a9d('0x62')][_0x6a9d('0x79')]||null};var _0x27b650=getAuthenticationOptions(_0x2a5e93['provider'],_0x559b8f[_0x6a9d('0x62')]);_0x2a5e93[_0x6a9d('0x40')]=_0x27b650[_0x6a9d('0x40')];_0x2a5e93[_0x6a9d('0x41')]=_0x27b650[_0x6a9d('0x41')];return db[_0x6a9d('0x47')]['create'](_0x2a5e93,{'include':[{'model':db[_0x6a9d('0x43')],'as':_0x6a9d('0x41')},{'model':db['MailServerIn'],'as':_0x6a9d('0x40')}]})[_0x6a9d('0xe')](function(_0x705c9d){var _0x29343a=_0x559b8f[_0x6a9d('0x36')][_0x6a9d('0x23')]({'plain':!![]});if(!_0x29343a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29343a['role']==='user'){var _0x4d6b75=_0x705c9d[_0x6a9d('0x23')]({'plain':!![]});return db['UserProfileSection'][_0x6a9d('0x63')]({'where':{'name':'MailAccounts','userProfileId':_0x29343a[_0x6a9d('0x7a')]},'raw':!![]})[_0x6a9d('0xe')](function(_0xbf62eb){if(_0xbf62eb&&_0xbf62eb['autoAssociation']===0x0){return db[_0x6a9d('0x25')][_0x6a9d('0x74')]({'name':_0x4d6b75['name'],'resourceId':_0x4d6b75['id'],'type':_0xbf62eb[_0x6a9d('0x27')],'sectionId':_0xbf62eb['id']},{})[_0x6a9d('0xe')](function(){return _0x705c9d;});}else{return _0x705c9d;}})[_0x6a9d('0x17')](function(_0x5cc95a){logger['error'](_0x6a9d('0x7b'),_0x5cc95a);throw _0x5cc95a;});}return _0x705c9d;})['then'](respondWithResult(_0x5d828a,0xc9))[_0x6a9d('0x17')](handleError(_0x5d828a,null));};exports[_0x6a9d('0x7c')]=function(_0x14a79a,_0x10323e){return db[_0x6a9d('0x47')][_0x6a9d('0x69')]({'where':{'id':_0x14a79a[_0x6a9d('0x64')]['id']}})[_0x6a9d('0xe')](handleEntityNotFound(_0x10323e,null))[_0x6a9d('0xe')](function(_0x1162f9){if(_0x1162f9){return _0x1162f9[_0x6a9d('0x7c')]();}return null;})[_0x6a9d('0xe')](respondWithResult(_0x10323e,null))[_0x6a9d('0x17')](handleError(_0x10323e,null));};exports[_0x6a9d('0x7d')]=function(_0x333edb,_0x2abcaf){if(_0x333edb[_0x6a9d('0x62')]['id']){delete _0x333edb[_0x6a9d('0x62')]['id'];}return db[_0x6a9d('0x47')][_0x6a9d('0x63')]({'where':{'id':_0x333edb[_0x6a9d('0x64')]['id']}})[_0x6a9d('0xe')](handleEntityNotFound(_0x2abcaf,null))[_0x6a9d('0xe')](function(_0x474425){if(_0x474425){_0x333edb[_0x6a9d('0x62')][_0x6a9d('0x68')]=_0x474425['id'];return db['MailServerIn']['create'](_0x333edb[_0x6a9d('0x62')]);}})[_0x6a9d('0xe')](respondWithResult(_0x2abcaf,null))[_0x6a9d('0x17')](handleError(_0x2abcaf,null));};exports[_0x6a9d('0x7e')]=function(_0x5e9bde,_0xd0d97c){return db[_0x6a9d('0x47')][_0x6a9d('0x69')]({'where':{'id':_0x5e9bde['params']['id']}})[_0x6a9d('0xe')](handleEntityNotFound(_0xd0d97c,null))['then'](function(_0x3e9146){if(_0x3e9146){return _0x3e9146[_0x6a9d('0x7f')](null);}return null;})[_0x6a9d('0xe')](respondWithStatusCode(_0xd0d97c,null))[_0x6a9d('0x17')](handleError(_0xd0d97c,null));};exports[_0x6a9d('0x80')]=function(_0x259da7,_0x26b334){return db[_0x6a9d('0x47')][_0x6a9d('0x69')]({'where':{'id':_0x259da7[_0x6a9d('0x64')]['id']}})[_0x6a9d('0xe')](handleEntityNotFound(_0x26b334,null))['then'](function(_0x365639){if(_0x365639){return _0x365639[_0x6a9d('0x80')]();}return null;})['then'](respondWithResult(_0x26b334,null))[_0x6a9d('0x17')](handleError(_0x26b334,null));};exports[_0x6a9d('0x81')]=function(_0x3afd37,_0x2812a0){if(_0x3afd37['body']['id']){delete _0x3afd37[_0x6a9d('0x62')]['id'];}return db[_0x6a9d('0x47')]['find']({'where':{'id':_0x3afd37[_0x6a9d('0x64')]['id']}})[_0x6a9d('0xe')](handleEntityNotFound(_0x2812a0,null))[_0x6a9d('0xe')](function(_0x236fc9){if(_0x236fc9){_0x3afd37[_0x6a9d('0x62')]['MailAccountId']=_0x236fc9['id'];return db[_0x6a9d('0x43')][_0x6a9d('0x74')](_0x3afd37[_0x6a9d('0x62')]);}})[_0x6a9d('0xe')](respondWithResult(_0x2812a0,null))[_0x6a9d('0x17')](handleError(_0x2812a0,null));};exports[_0x6a9d('0x82')]=function(_0x5d3ca2,_0x399566){return db[_0x6a9d('0x47')]['findOne']({'where':{'id':_0x5d3ca2['params']['id']}})[_0x6a9d('0xe')](handleEntityNotFound(_0x399566,null))[_0x6a9d('0xe')](function(_0x536095){if(_0x536095){return _0x536095[_0x6a9d('0x83')](null);}return null;})[_0x6a9d('0xe')](respondWithStatusCode(_0x399566,null))[_0x6a9d('0x17')](handleError(_0x399566,null));};exports[_0x6a9d('0x84')]=function(_0x422fdb,_0x42d003){return db[_0x6a9d('0x85')][_0x6a9d('0x63')]({'where':{'id':_0x422fdb['params']['id']}})[_0x6a9d('0xe')](handleEntityNotFound(_0x42d003,null))['then'](function(_0x5dd1c8){if(_0x5dd1c8){return _0x5dd1c8[_0x6a9d('0x84')](_0x422fdb[_0x6a9d('0x62')][_0x6a9d('0x73')],_[_0x6a9d('0x86')](_0x422fdb[_0x6a9d('0x62')],[_0x6a9d('0x73'),'id'])||{});}})['then'](respondWithResult(_0x42d003,null))[_0x6a9d('0x17')](handleError(_0x42d003,null));};exports['getInteractions']=function(_0x4be3d3,_0x3f2102){var _0x3cc829={'raw':![],'where':{}};var _0xccf9da={};var _0x1b4d0f={'count':0x0,'rows':[]};return db[_0x6a9d('0x47')]['findOne']({'where':{'id':_0x4be3d3[_0x6a9d('0x64')]['id']}})[_0x6a9d('0xe')](handleEntityNotFound(_0x3f2102,null))[_0x6a9d('0xe')](function(_0x10817c){if(_0x10817c){_0xccf9da[_0x6a9d('0x4f')]=_[_0x6a9d('0x4c')](db[_0x6a9d('0x85')][_0x6a9d('0x48')]);_0xccf9da[_0x6a9d('0x4b')]=_[_0x6a9d('0x4c')](_0x4be3d3[_0x6a9d('0x4b')]);_0xccf9da[_0x6a9d('0x4d')]=_[_0x6a9d('0x4e')](_0xccf9da[_0x6a9d('0x4f')],_0xccf9da[_0x6a9d('0x4b')]);_0x3cc829[_0x6a9d('0x50')]=_['intersection'](_0xccf9da[_0x6a9d('0x4f')],qs[_0x6a9d('0x51')](_0x4be3d3[_0x6a9d('0x4b')][_0x6a9d('0x51')]));_0x3cc829[_0x6a9d('0x50')]=_0x3cc829[_0x6a9d('0x50')][_0x6a9d('0x52')]?_0x3cc829[_0x6a9d('0x50')]:_0xccf9da['model'];if(!_0x4be3d3[_0x6a9d('0x4b')][_0x6a9d('0x53')](_0x6a9d('0x54'))){_0x3cc829[_0x6a9d('0x1e')]=qs[_0x6a9d('0x1e')](_0x4be3d3[_0x6a9d('0x4b')][_0x6a9d('0x1e')]);_0x3cc829['offset']=qs[_0x6a9d('0x1c')](_0x4be3d3[_0x6a9d('0x4b')][_0x6a9d('0x1c')]);}_0x3cc829[_0x6a9d('0x6b')]=qs['sort'](_0x4be3d3[_0x6a9d('0x4b')][_0x6a9d('0x55')]);_0x3cc829[_0x6a9d('0x56')]=qs[_0x6a9d('0x4d')](_['pick'](_0x4be3d3[_0x6a9d('0x4b')],_0xccf9da[_0x6a9d('0x4d')]));_0x3cc829[_0x6a9d('0x56')]['MailAccountId']=_0x10817c['id'];if(_0x4be3d3[_0x6a9d('0x4b')][_0x6a9d('0x6c')]){_0x3cc829[_0x6a9d('0x56')]=_[_0x6a9d('0x58')](_0x3cc829[_0x6a9d('0x56')],{'$or':_[_0x6a9d('0x46')](_0x3cc829[_0x6a9d('0x50')],function(_0x4b0925){var _0x4f9961={};_0x4f9961[_0x4b0925]={'$like':'%'+_0x4be3d3['query'][_0x6a9d('0x6c')]+'%'};return _0x4f9961;})});}_0x3cc829=_[_0x6a9d('0x58')]({},_0x3cc829,_0x4be3d3[_0x6a9d('0x5b')]);return db['MailInteraction'][_0x6a9d('0x1f')]({'where':_0x3cc829[_0x6a9d('0x56')]})[_0x6a9d('0xe')](function(_0xda9697){_0x1b4d0f[_0x6a9d('0x1f')]=_0xda9697;if(_0x4be3d3[_0x6a9d('0x4b')]['includeAll']){_0x3cc829[_0x6a9d('0x5c')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x6a9d('0x87')],'as':_0x6a9d('0x88'),'attributes':[_0x6a9d('0x27'),_0x6a9d('0x89'),_0x6a9d('0x8a')],'required':![]},{'model':db['Tag'],'as':_0x6a9d('0x8b'),'attributes':['id',_0x6a9d('0x27'),_0x6a9d('0x8c')],'where':_0x4be3d3[_0x6a9d('0x4b')][_0x6a9d('0x8d')]?{'id':_0x4be3d3['query'][_0x6a9d('0x8d')]}:undefined,'required':_0x4be3d3['query'][_0x6a9d('0x8d')]?!![]:![]}];}return db[_0x6a9d('0x85')][_0x6a9d('0x71')](_0x3cc829);})[_0x6a9d('0xe')](function(_0x425596){_0x1b4d0f[_0x6a9d('0x6d')]=_0x425596;return _0x1b4d0f;});}})[_0x6a9d('0xe')](respondWithFilteredResult(_0x3f2102,_0x3cc829))['catch'](handleError(_0x3f2102,null));};exports[_0x6a9d('0x8e')]=function addApplications(_0x446cb8,_0x2d9aaa){var _0x2e5198=_0x446cb8[_0x6a9d('0x64')]['id'];var _0x516f89=_0x446cb8[_0x6a9d('0x62')];var _0x1e078b=0xc8;var _0x21c1d6=null;return db[_0x6a9d('0x8f')]['transaction']({'isolationLevel':db[_0x6a9d('0x8f')][_0x6a9d('0x90')]['ISOLATION_LEVELS'][_0x6a9d('0x91')]},function(_0x49e2a6){return db[_0x6a9d('0x47')]['findOne']({'where':{'id':_0x2e5198},'transaction':_0x49e2a6})[_0x6a9d('0xe')](function(_0x238142){if(_0x238142){return db[_0x6a9d('0x92')]['destroy']({'where':{'MailAccountId':_0x2e5198},'transaction':_0x49e2a6})[_0x6a9d('0xe')](function(){var _0x3a6edd=_[_0x6a9d('0x46')](_0x516f89,function(_0x352093){_0x352093[_0x6a9d('0x68')]=_0x2e5198;return _0x352093;});return db[_0x6a9d('0x92')][_0x6a9d('0x93')](_0x3a6edd,{'transaction':_0x49e2a6});});}else{_0x1e078b=0x194;_0x21c1d6=[];}});})['then'](function(){if(_0x1e078b!==0x194){return db['MailApplication'][_0x6a9d('0x94')]({'where':{'MailAccountId':_0x2e5198},'order':_0x6a9d('0x95')})[_0x6a9d('0xe')](function(_0x32e3bb){_0x21c1d6=_0x32e3bb;});}})[_0x6a9d('0x17')](function(_0x44612e){_0x1e078b=0x1f4;logger['error'](_0x44612e[_0x6a9d('0x26')]);if(_0x44612e['name']){delete _0x44612e['name'];}_0x21c1d6=_0x44612e;})[_0x6a9d('0x96')](function(){if(_0x21c1d6===null){_0x2d9aaa['sendStatus'](_0x1e078b);}else{if(_0x1e078b===0x1f4){_0x2d9aaa[_0x6a9d('0x1a')](_0x1e078b)['send'](_0x21c1d6);}else{_0x2d9aaa['status'](_0x1e078b)[_0x6a9d('0x1b')](_0x21c1d6);}}});};exports[_0x6a9d('0x97')]=function(_0x48a923,_0x195e83){var _0x5e2529={};var _0x5dfaee={};var _0xc0efee;var _0x2a0a45;return db[_0x6a9d('0x47')][_0x6a9d('0x69')]({'where':{'id':_0x48a923[_0x6a9d('0x64')]['id']}})['then'](handleEntityNotFound(_0x195e83,null))['then'](function(_0x5acbd3){if(_0x5acbd3){_0xc0efee=_0x5acbd3;_0x5dfaee[_0x6a9d('0x4f')]=_[_0x6a9d('0x4c')](db[_0x6a9d('0x92')][_0x6a9d('0x48')]);_0x5dfaee[_0x6a9d('0x4b')]=_[_0x6a9d('0x4c')](_0x48a923[_0x6a9d('0x4b')]);_0x5dfaee[_0x6a9d('0x4d')]=_[_0x6a9d('0x4e')](_0x5dfaee[_0x6a9d('0x4f')],_0x5dfaee[_0x6a9d('0x4b')]);_0x5e2529['attributes']=_[_0x6a9d('0x4e')](_0x5dfaee['model'],qs[_0x6a9d('0x51')](_0x48a923[_0x6a9d('0x4b')][_0x6a9d('0x51')]));_0x5e2529[_0x6a9d('0x50')]=_0x5e2529[_0x6a9d('0x50')][_0x6a9d('0x52')]?_0x5e2529[_0x6a9d('0x50')]:_0x5dfaee['model'];_0x5e2529[_0x6a9d('0x6b')]=qs[_0x6a9d('0x55')](_0x48a923[_0x6a9d('0x4b')]['sort']);_0x5e2529['where']=qs[_0x6a9d('0x4d')](_[_0x6a9d('0x57')](_0x48a923[_0x6a9d('0x4b')],_0x5dfaee[_0x6a9d('0x4d')]));if(_0x48a923[_0x6a9d('0x4b')][_0x6a9d('0x6c')]){_0x5e2529['where']=_[_0x6a9d('0x58')](_0x5e2529[_0x6a9d('0x56')],{'$or':_[_0x6a9d('0x46')](_0x5e2529[_0x6a9d('0x50')],function(_0xaddd31){var _0x47de9f={};_0x47de9f[_0xaddd31]={'$like':'%'+_0x48a923[_0x6a9d('0x4b')]['filter']+'%'};return _0x47de9f;})});}_0x5e2529=_[_0x6a9d('0x58')]({},_0x5e2529,_0x48a923[_0x6a9d('0x5b')]);return _0xc0efee[_0x6a9d('0x97')](_0x5e2529);}})[_0x6a9d('0xe')](function(_0xd77b56){if(_0xd77b56){_0x2a0a45=_0xd77b56[_0x6a9d('0x52')];if(!_0x48a923[_0x6a9d('0x4b')][_0x6a9d('0x53')](_0x6a9d('0x54'))){_0x5e2529[_0x6a9d('0x1e')]=qs['limit'](_0x48a923[_0x6a9d('0x4b')][_0x6a9d('0x1e')]);_0x5e2529[_0x6a9d('0x1c')]=qs[_0x6a9d('0x1c')](_0x48a923[_0x6a9d('0x4b')]['offset']);}return _0xc0efee[_0x6a9d('0x97')](_0x5e2529);}})[_0x6a9d('0xe')](function(_0x539acf){if(_0x539acf){return _0x539acf?{'count':_0x2a0a45,'rows':_0x539acf}:null;}})[_0x6a9d('0xe')](respondWithResult(_0x195e83,null))[_0x6a9d('0x17')](handleError(_0x195e83,null));};exports[_0x6a9d('0x98')]=function(_0x1a8f50,_0x4219d5){var _0x3b379a={'raw':!![],'where':{}};var _0xd1432d={};var _0x1713f7={'count':0x0,'rows':[]};return db[_0x6a9d('0x47')][_0x6a9d('0x69')]({'where':{'id':_0x1a8f50[_0x6a9d('0x64')]['id']}})['then'](handleEntityNotFound(_0x4219d5,null))[_0x6a9d('0xe')](function(_0xa7c92f){if(_0xa7c92f){_0xd1432d['model']=_['keys'](db[_0x6a9d('0x99')][_0x6a9d('0x48')]);_0xd1432d['query']=_['keys'](_0x1a8f50[_0x6a9d('0x4b')]);_0xd1432d[_0x6a9d('0x4d')]=_[_0x6a9d('0x4e')](_0xd1432d[_0x6a9d('0x4f')],_0xd1432d['query']);_0x3b379a['attributes']=_['intersection'](_0xd1432d[_0x6a9d('0x4f')],qs['fields'](_0x1a8f50[_0x6a9d('0x4b')][_0x6a9d('0x51')]));_0x3b379a[_0x6a9d('0x50')]=_0x3b379a[_0x6a9d('0x50')][_0x6a9d('0x52')]?_0x3b379a[_0x6a9d('0x50')]:_0xd1432d[_0x6a9d('0x4f')];if(!_0x1a8f50[_0x6a9d('0x4b')][_0x6a9d('0x53')]('nolimit')){_0x3b379a['limit']=qs['limit'](_0x1a8f50['query'][_0x6a9d('0x1e')]);_0x3b379a['offset']=qs[_0x6a9d('0x1c')](_0x1a8f50['query'][_0x6a9d('0x1c')]);}_0x3b379a['order']=qs[_0x6a9d('0x55')](_0x1a8f50[_0x6a9d('0x4b')]['sort']);_0x3b379a[_0x6a9d('0x56')]=qs[_0x6a9d('0x4d')](_[_0x6a9d('0x57')](_0x1a8f50[_0x6a9d('0x4b')],_0xd1432d[_0x6a9d('0x4d')]));_0x3b379a[_0x6a9d('0x56')][_0x6a9d('0x68')]=_0xa7c92f['id'];if(_0x1a8f50[_0x6a9d('0x4b')][_0x6a9d('0x6c')]){_0x3b379a[_0x6a9d('0x56')]=_[_0x6a9d('0x58')](_0x3b379a['where'],{'$or':_[_0x6a9d('0x46')](_0x3b379a[_0x6a9d('0x50')],function(_0x1684a1){var _0x3d50a7={};_0x3d50a7[_0x1684a1]={'$like':'%'+_0x1a8f50[_0x6a9d('0x4b')][_0x6a9d('0x6c')]+'%'};return _0x3d50a7;})});}if(_0x1a8f50[_0x6a9d('0x4b')][_0x6a9d('0x9a')]){var _0x283dfe=_0x1a8f50[_0x6a9d('0x4b')][_0x6a9d('0x9a')][_0x6a9d('0x9b')](',');var _0x208e85={};_0x208e85[_0x283dfe[0x0]]={'$gte':moment(_0x283dfe[0x1])[_0x6a9d('0x9c')](_0x6a9d('0x9d'))};_0x3b379a[_0x6a9d('0x56')]=_[_0x6a9d('0x58')](_0x3b379a['where'],_0x208e85);}_0x3b379a=_[_0x6a9d('0x58')]({},_0x3b379a,_0x1a8f50[_0x6a9d('0x5b')]);return db[_0x6a9d('0x99')][_0x6a9d('0x1f')]({'where':_0x3b379a['where']})['then'](function(_0x2901f6){_0x1713f7[_0x6a9d('0x1f')]=_0x2901f6;if(_0x1a8f50[_0x6a9d('0x4b')][_0x6a9d('0x5f')]){_0x3b379a[_0x6a9d('0x5c')]=[{'all':!![]}];}return db[_0x6a9d('0x99')][_0x6a9d('0x71')](_0x3b379a);})[_0x6a9d('0xe')](function(_0x3fb0a2){if(_0x1a8f50[_0x6a9d('0x4b')][_0x6a9d('0x9e')]==='true'){for(var _0x5c6097=0x0;_0x5c6097<_0x3fb0a2[_0x6a9d('0x52')];_0x5c6097++){_0x3fb0a2[_0x5c6097]['body']=juice(_0x3fb0a2[_0x5c6097][_0x6a9d('0x62')]);}}_0x1713f7[_0x6a9d('0x6d')]=_0x3fb0a2;return _0x1713f7;});}})[_0x6a9d('0xe')](respondWithFilteredResult(_0x4219d5,_0x3b379a))[_0x6a9d('0x17')](handleError(_0x4219d5,null));};exports[_0x6a9d('0x28')]=function(_0x57d829,_0x163b86){var _0x3fa8f4,_0x561dae={},_0x44c15f;if(_0x57d829['body']['to']){_0x44c15f=_0x57d829[_0x6a9d('0x62')]['to'][_0x6a9d('0x9b')](',')[0x0];}return db['MailAccount'][_0x6a9d('0x63')]({'where':{'id':_0x57d829[_0x6a9d('0x64')]['id']},'include':[{'model':db[_0x6a9d('0x9f')],'as':_0x6a9d('0xa0'),'include':[{'model':db[_0x6a9d('0xa1')],'as':'Contacts','where':{'email':_0x44c15f},'limit':0x1,'order':[[_0x6a9d('0xa2'),_0x6a9d('0xa3')]]}]},{'model':db[_0x6a9d('0x43')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x6a9d('0xa4')],'as':_0x6a9d('0xa4'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x163b86,null))[_0x6a9d('0xe')](function(_0x110861){if(!_0x110861)return;_0x3fa8f4=_0x110861;if(!_0x110861[_0x6a9d('0x41')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_['isNil'](_0x57d829[_0x6a9d('0x62')][_0x6a9d('0xa5')])){_0x57d829['body'][_0x6a9d('0xa5')]=util[_0x6a9d('0x9c')](_0x6a9d('0xa6'),_0x110861[_0x6a9d('0x27')],_0x110861['email']||_0x110861[_0x6a9d('0x41')][_0x6a9d('0x36')]);}if(_0x57d829[_0x6a9d('0x62')][_0x6a9d('0xa7')]&&_0x57d829[_0x6a9d('0x62')][_0x6a9d('0xa7')]['length']){for(var _0x44c846=0x0;_0x44c846<_0x57d829[_0x6a9d('0x62')][_0x6a9d('0xa7')][_0x6a9d('0x52')];_0x44c846+=0x1){_0x57d829[_0x6a9d('0x62')][_0x6a9d('0xa7')][_0x44c846]={'filename':_0x57d829['body'][_0x6a9d('0xa7')][_0x44c846][_0x6a9d('0x27')],'path':path[_0x6a9d('0xa8')](config['root'],'server/files/attachments',_0x57d829['body'][_0x6a9d('0xa7')][_0x44c846][_0x6a9d('0xa9')])};}}var _0x85c02b=_0x110861[_0x6a9d('0xaa')]();return respondWithRpcPromise(_0x6a9d('0xab'),_0x6a9d('0xac'),{'account':_0x85c02b,'message':_0x57d829[_0x6a9d('0x62')]});})['then'](function(_0x1aba60){if(!_0x1aba60)return;_0x561dae=_0x1aba60;if(!_0x3fa8f4['List'])throw new Error(_0x6a9d('0xad'));if(_0x3fa8f4[_0x6a9d('0xa0')]['Contacts'][_0x6a9d('0x52')])return _0x3fa8f4[_0x6a9d('0xa0')][_0x6a9d('0xae')][0x0];return db[_0x6a9d('0xa1')]['create'](_['defaults'](_0x57d829[_0x6a9d('0x62')],{'firstName':_0x57d829[_0x6a9d('0x62')]['to'],'email':_0x57d829[_0x6a9d('0x62')]['to'],'phone':_0x57d829[_0x6a9d('0x62')]['to'],'ListId':_0x3fa8f4[_0x6a9d('0x76')]}));})[_0x6a9d('0xe')](function(_0x3c4acc){if(!_0x3c4acc)return;var _0x1a55d7={'UserId':_0x57d829[_0x6a9d('0x36')]['id'],'ContactId':_0x3c4acc['id'],'MailAccountId':_0x3fa8f4['id'],'inReplyTo':_0x561dae[_0x6a9d('0xaf')],'to':_0x57d829[_0x6a9d('0x62')]['from'],'cc':_0x57d829[_0x6a9d('0x62')]['cc'],'subject':_0x57d829['body'][_0x6a9d('0xb0')],'attach':_0x57d829[_0x6a9d('0x62')][_0x6a9d('0xb1')],'firstMsgDirection':_0x6a9d('0xb2'),'lastMsgAt':moment()[_0x6a9d('0x9c')](_0x6a9d('0x9d')),'lastMsgDirection':_0x6a9d('0xb2'),'Messages':[_[_0x6a9d('0x58')](_0x57d829['body'],{'messageId':_0x561dae[_0x6a9d('0xaf')],'sentAt':moment()[_0x6a9d('0x9c')](_0x6a9d('0x9d')),'read':!![],'MailAccountId':_0x3fa8f4['id'],'UserId':_0x57d829[_0x6a9d('0x36')]['id'],'ContactId':_0x3c4acc['id']})]};if(_0x57d829[_0x6a9d('0x62')][_0x6a9d('0xb3')]){_0x1a55d7=_[_0x6a9d('0x58')](_0x1a55d7,_0x57d829[_0x6a9d('0x62')][_0x6a9d('0xb3')]);}return db['MailInteraction'][_0x6a9d('0x74')](_0x1a55d7,{'include':[{'model':db[_0x6a9d('0x99')],'as':_0x6a9d('0xb4')}]});})[_0x6a9d('0xe')](respondWithResult(_0x163b86,null))[_0x6a9d('0x17')](handleError(_0x163b86,null));};exports[_0x6a9d('0xb5')]=function(_0x1524a1,_0x440cc9){return db[_0x6a9d('0x47')][_0x6a9d('0x63')]({'where':{'id':_0x1524a1[_0x6a9d('0x64')]['id']},'include':[{'model':db[_0x6a9d('0x43')],'as':_0x6a9d('0x41'),'raw':!![],'include':[{'model':db[_0x6a9d('0xa4')],'as':_0x6a9d('0xa4'),'raw':!![]}]}]})[_0x6a9d('0xe')](handleEntityNotFound(_0x440cc9,null))['then'](function(_0x238aa2){if(!_0x238aa2['Smtp'])return;var _0xd20b5c=_0x238aa2['getSmtpOptions']();return respondWithRpcPromise(_0x6a9d('0xb6'),'verifySmtp',{'account':_0xd20b5c});})[_0x6a9d('0xe')](respondWithResult(_0x440cc9,null))['catch'](handleError(_0x440cc9,null));};exports[_0x6a9d('0x22')]=function(_0x1d37c8,_0x444c4f){return db['MailAccount']['find']({'where':{'id':_0x1d37c8[_0x6a9d('0x64')]['id']}})[_0x6a9d('0xe')](handleEntityNotFound(_0x444c4f,null))['then'](function(_0x2e18d2){if(_0x2e18d2&&_0x2e18d2[_0x6a9d('0x3f')]){throw new db['Sequelize']['ValidationError'](_0x6a9d('0xb7'));}return _0x2e18d2;})[_0x6a9d('0xe')](removeEntity(_0x444c4f,null))['catch'](handleError(_0x444c4f,null));};exports[_0x6a9d('0xb8')]=function(_0x315330,_0x32add9){return db[_0x6a9d('0x47')][_0x6a9d('0x63')]({'where':{'id':_0x315330[_0x6a9d('0x64')]['id']}})[_0x6a9d('0xe')](handleEntityNotFound(_0x32add9,null))['then'](function(_0x5910f4){if(_0x5910f4){return _0x5910f4[_0x6a9d('0xb8')](_0x315330[_0x6a9d('0x62')][_0x6a9d('0x73')],_[_0x6a9d('0x86')](_0x315330['body'],['ids','id'])||{})[_0x6a9d('0xb9')](function(_0xc36dec){for(var _0x45c6d2=0x0;_0x45c6d2<_0x315330[_0x6a9d('0x62')]['ids'][_0x6a9d('0x52')];_0x45c6d2+=0x1){socket[_0x6a9d('0xba')]('userMailAccount:save',{'UserId':Number(_0x315330[_0x6a9d('0x62')]['ids'][_0x45c6d2]),'MailAccountId':Number(_0x315330[_0x6a9d('0x64')]['id'])});}return _0xc36dec;});}})[_0x6a9d('0xe')](respondWithResult(_0x32add9,null))[_0x6a9d('0x17')](handleError(_0x32add9,null));};exports['removeAgents']=function(_0x285a23,_0x232b5a){return db[_0x6a9d('0x47')][_0x6a9d('0x63')]({'where':{'id':_0x285a23['params']['id']}})[_0x6a9d('0xe')](handleEntityNotFound(_0x232b5a,null))[_0x6a9d('0xe')](function(_0x94078c){if(_0x94078c){return _0x94078c[_0x6a9d('0xbb')](_0x285a23[_0x6a9d('0x4b')][_0x6a9d('0x73')])[_0x6a9d('0xe')](function(){if(_['isArray'](_0x285a23[_0x6a9d('0x4b')][_0x6a9d('0x73')])){for(var _0x2422a5=0x0;_0x2422a5<_0x285a23['query'][_0x6a9d('0x73')][_0x6a9d('0x52')];_0x2422a5+=0x1){socket[_0x6a9d('0xba')](_0x6a9d('0xbc'),{'UserId':Number(_0x285a23['query'][_0x6a9d('0x73')][_0x2422a5]),'MailAccountId':Number(_0x285a23['params']['id'])});}}else{socket[_0x6a9d('0xba')]('userMailAccount:remove',{'UserId':Number(_0x285a23[_0x6a9d('0x4b')]['ids']),'MailAccountId':Number(_0x285a23[_0x6a9d('0x64')]['id'])});}});}})[_0x6a9d('0xe')](respondWithStatusCode(_0x232b5a,null))[_0x6a9d('0x17')](handleError(_0x232b5a,null));};exports['getAgents']=function(_0x58f84d,_0x5c5a62){var _0x353d70={};var _0x521093={};var _0x340ca8;var _0x5c6d2c;return db[_0x6a9d('0x47')]['findOne']({'where':{'id':_0x58f84d[_0x6a9d('0x64')]['id']}})[_0x6a9d('0xe')](handleEntityNotFound(_0x5c5a62,null))[_0x6a9d('0xe')](function(_0x10caf5){if(_0x10caf5){_0x340ca8=_0x10caf5;_0x521093['model']=_[_0x6a9d('0x4c')](db[_0x6a9d('0x87')][_0x6a9d('0x48')]);_0x521093[_0x6a9d('0x4b')]=_[_0x6a9d('0x4c')](_0x58f84d[_0x6a9d('0x4b')]);_0x521093['filters']=_[_0x6a9d('0x4e')](_0x521093[_0x6a9d('0x4f')],_0x521093['query']);_0x353d70['attributes']=_[_0x6a9d('0x4e')](_0x521093['model'],qs['fields'](_0x58f84d[_0x6a9d('0x4b')][_0x6a9d('0x51')]));_0x353d70[_0x6a9d('0x50')]=_0x353d70[_0x6a9d('0x50')]['length']?_0x353d70[_0x6a9d('0x50')]:_0x521093['model'];_0x353d70['order']=qs[_0x6a9d('0x55')](_0x58f84d[_0x6a9d('0x4b')][_0x6a9d('0x55')]);_0x353d70[_0x6a9d('0x56')]=qs[_0x6a9d('0x4d')](_['pick'](_0x58f84d[_0x6a9d('0x4b')],_0x521093[_0x6a9d('0x4d')]));if(_0x58f84d['query'][_0x6a9d('0x6c')]){_0x353d70['where']=_[_0x6a9d('0x58')](_0x353d70['where'],{'$or':_[_0x6a9d('0x46')](_0x353d70['attributes'],function(_0x54d18f){var _0x5a3454={};_0x5a3454[_0x54d18f]={'$like':'%'+_0x58f84d[_0x6a9d('0x4b')][_0x6a9d('0x6c')]+'%'};return _0x5a3454;})});}_0x353d70=_['merge']({},_0x353d70,_0x58f84d[_0x6a9d('0x5b')]);return _0x340ca8['getAgents'](_0x353d70);}})[_0x6a9d('0xe')](function(_0x497ea2){if(_0x497ea2){_0x5c6d2c=_0x497ea2[_0x6a9d('0x52')];if(!_0x58f84d[_0x6a9d('0x4b')]['hasOwnProperty'](_0x6a9d('0x54'))){_0x353d70['limit']=qs[_0x6a9d('0x1e')](_0x58f84d['query']['limit']);_0x353d70[_0x6a9d('0x1c')]=qs[_0x6a9d('0x1c')](_0x58f84d['query']['offset']);}return _0x340ca8['getAgents'](_0x353d70);}})[_0x6a9d('0xe')](function(_0x38bc5d){if(_0x38bc5d){return _0x38bc5d?{'count':_0x5c6d2c,'rows':_0x38bc5d}:null;}})[_0x6a9d('0xe')](respondWithResult(_0x5c5a62,null))[_0x6a9d('0x17')](handleError(_0x5c5a62,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 52fef2f..221d332 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 _0xf970=['hasOwnProperty','hook','exports','events','MailAccount','setMaxListeners','save','update','remove','emit'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0xf970,0x1d9));var _0x0f97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf970[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x0f97('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x0f97('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x0f97('0x2')](0x0);var events={'afterCreate':_0x0f97('0x3'),'afterUpdate':_0x0f97('0x4'),'afterDestroy':_0x0f97('0x5')};function emitEvent(_0x25e484){return function(_0x439149,_0x4ab74d,_0xc822e8){MailAccountEvents[_0x0f97('0x6')](_0x25e484+':'+_0x439149['id'],_0x439149);MailAccountEvents[_0x0f97('0x6')](_0x25e484,_0x439149);_0xc822e8(null);};}for(var e in events){if(events[_0x0f97('0x7')](e)){var event=events[e];MailAccount[_0x0f97('0x8')](e,emitEvent(event));}}module[_0x0f97('0x9')]=MailAccountEvents; \ No newline at end of file +var _0x3157=['events','../../mysqldb','MailAccount','setMaxListeners','update','emit','hasOwnProperty','exports'];(function(_0x3df600,_0x5d1ff9){var _0x57ea05=function(_0x614115){while(--_0x614115){_0x3df600['push'](_0x3df600['shift']());}};_0x57ea05(++_0x5d1ff9);}(_0x3157,0x198));var _0x7315=function(_0x1dc670,_0x3e48bf){_0x1dc670=_0x1dc670-0x0;var _0x269320=_0x3157[_0x1dc670];return _0x269320;};'use strict';var EventEmitter=require(_0x7315('0x0'));var MailAccount=require(_0x7315('0x1'))['db'][_0x7315('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x7315('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7315('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1ba02f){return function(_0x413249,_0x5c3bca,_0x58d458){MailAccountEvents[_0x7315('0x5')](_0x1ba02f+':'+_0x413249['id'],_0x413249);MailAccountEvents[_0x7315('0x5')](_0x1ba02f,_0x413249);_0x58d458(null);};}for(var e in events){if(events[_0x7315('0x6')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x7315('0x7')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 17be824..a5b8a04 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 _0x190b=['./mailAccount.attributes','MailAccount','mail_accounts','custom','service','provider','Smtp','host','port','secure','authentication','modernAuthentication','CloudProvider','auth','OAuth2','user','pass'];(function(_0x3eda6f,_0x2eba0){var _0x35cb33=function(_0x13fc20){while(--_0x13fc20){_0x3eda6f['push'](_0x3eda6f['shift']());}};_0x35cb33(++_0x2eba0);}(_0x190b,0x165));var _0xb190=function(_0x198ad9,_0x163e75){_0x198ad9=_0x198ad9-0x0;var _0x23778e=_0x190b[_0x198ad9];return _0x23778e;};'use strict';var attributes=require(_0xb190('0x0'));module['exports']=function(_0x31ed20){return _0x31ed20['define'](_0xb190('0x1'),attributes,{'tableName':_0xb190('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3bed8a=this;var _0x1ebe86={'id':_0x3bed8a['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3bed8a['provider']!==_0xb190('0x3')){_0x1ebe86[_0xb190('0x4')]=_0x3bed8a[_0xb190('0x5')];}else{_0x1ebe86['host']=_0x3bed8a[_0xb190('0x6')][_0xb190('0x7')];_0x1ebe86['port']=_0x3bed8a[_0xb190('0x6')][_0xb190('0x8')];_0x1ebe86[_0xb190('0x9')]=_0x3bed8a['Smtp'][_0xb190('0x9')];}if(_0x3bed8a[_0xb190('0x6')][_0xb190('0xa')]){if(_0x3bed8a[_0xb190('0x6')][_0xb190('0xb')]){if(!_0x3bed8a[_0xb190('0x6')][_0xb190('0xc')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x1ebe86[_0xb190('0xd')]={'type':_0xb190('0xe'),'user':_0x3bed8a[_0xb190('0x6')]['user'],'accessToken':_0x3bed8a['Smtp']['CloudProvider']['data5']};}else{_0x1ebe86[_0xb190('0xd')]={'user':_0x3bed8a[_0xb190('0x6')][_0xb190('0xf')],'pass':_0x3bed8a[_0xb190('0x6')][_0xb190('0x10')]};}}return _0x1ebe86;}}});}; \ No newline at end of file +var _0xf500=['user','CloudProvider','data5','auth','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','service','host','Smtp','secure','authentication','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2'];(function(_0x5ae176,_0x5bd0f9){var _0x1ecd16=function(_0x7f308f){while(--_0x7f308f){_0x5ae176['push'](_0x5ae176['shift']());}};_0x1ecd16(++_0x5bd0f9);}(_0xf500,0x112));var _0x0f50=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0xf500[_0xfa634c];return _0x73e478;};'use strict';var attributes=require(_0x0f50('0x0'));module[_0x0f50('0x1')]=function(_0x1f6402){return _0x1f6402[_0x0f50('0x2')](_0x0f50('0x3'),attributes,{'tableName':_0x0f50('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x14a174=this;var _0x2a14a6={'id':_0x14a174['id'],'tls':{'rejectUnauthorized':![]}};if(_0x14a174[_0x0f50('0x5')]!=='custom'){_0x2a14a6[_0x0f50('0x6')]=_0x14a174[_0x0f50('0x5')];}else{_0x2a14a6[_0x0f50('0x7')]=_0x14a174[_0x0f50('0x8')][_0x0f50('0x7')];_0x2a14a6['port']=_0x14a174[_0x0f50('0x8')]['port'];_0x2a14a6[_0x0f50('0x9')]=_0x14a174[_0x0f50('0x8')][_0x0f50('0x9')];}if(_0x14a174[_0x0f50('0x8')][_0x0f50('0xa')]){if(_0x14a174[_0x0f50('0x8')][_0x0f50('0xb')]){if(!_0x14a174['Smtp']['CloudProvider'])throw new Error(_0x0f50('0xc'));_0x2a14a6['auth']={'type':_0x0f50('0xd'),'user':_0x14a174['Smtp'][_0x0f50('0xe')],'accessToken':_0x14a174[_0x0f50('0x8')][_0x0f50('0xf')][_0x0f50('0x10')]};}else{_0x2a14a6[_0x0f50('0x11')]={'user':_0x14a174[_0x0f50('0x8')][_0x0f50('0xe')],'pass':_0x14a174[_0x0f50('0x8')]['pass']};}}return _0x2a14a6;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 36e6ea4..54f2540 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 _0x4137=['Smtp','CloudProvider','get','omit','Applications','applications','priority','asc','push','length','Contacts','create','contact','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Contact\x20not\x20found','spread','update','interaction','created','MailMessage','originTo','originCc','bcc','originChannel','ChatOfflineMessageId','Attachment','Attachments','User','name','UserId','*,*,*,*','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','request\x20sent','debug','stringify','error','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowMailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','mail','difference','keys','CmContact','createdAt','CompanyId','ListId','body','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','CmList','List','DESC','MailServerOut'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x4137,0xf8));var _0x7413=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x4137[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x7413('0x0'));var moment=require(_0x7413('0x1'));var BPromise=require(_0x7413('0x2'));var rs=require(_0x7413('0x3'));var Redis=require(_0x7413('0x4'));var db=require(_0x7413('0x5'))['db'];var logger=require(_0x7413('0x6'))(_0x7413('0x7'));var config=require(_0x7413('0x8'));var jayson=require(_0x7413('0x9'));var client=jayson[_0x7413('0xa')][_0x7413('0xb')]({'port':0x232c});config['redis']=_[_0x7413('0xc')](config[_0x7413('0xd')],{'host':_0x7413('0xe'),'port':0x18eb});var socket=require(_0x7413('0xf'))(new Redis(config['redis']));require(_0x7413('0x10'))[_0x7413('0x11')](socket);function respondWithRpcPromise(_0x4e320b,_0x422bf5,_0x2f4b54){return new BPromise(function(_0x50fde0,_0x29f124){return client[_0x7413('0x12')](_0x4e320b,_0x2f4b54)[_0x7413('0x13')](function(_0x3e026b){logger[_0x7413('0x14')]('MailAccount,\x20%s,\x20%s',_0x422bf5,_0x7413('0x15'));logger[_0x7413('0x16')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x422bf5,_0x7413('0x15'),JSON[_0x7413('0x17')](_0x3e026b));if(_0x3e026b[_0x7413('0x18')]){if(_0x3e026b['error']['code']===0x1f4){logger['error'](_0x7413('0x19'),_0x422bf5,_0x3e026b[_0x7413('0x18')]['message']);return _0x29f124(_0x3e026b[_0x7413('0x18')][_0x7413('0x1a')]);}logger['error'](_0x7413('0x19'),_0x422bf5,_0x3e026b['error']['message']);return _0x50fde0(_0x3e026b[_0x7413('0x18')]['message']);}else{logger[_0x7413('0x14')]('MailAccount,\x20%s,\x20%s',_0x422bf5,_0x7413('0x15'));_0x50fde0(_0x3e026b[_0x7413('0x1b')][_0x7413('0x1a')]);}})[_0x7413('0x1c')](function(_0x2a3417){logger[_0x7413('0x18')]('MailAccount,\x20%s,\x20%s',_0x422bf5,_0x2a3417);_0x29f124(_0x2a3417);});});}exports[_0x7413('0x1d')]=function(_0x17c062){var _0x11f8a1=this;return new Promise(function(_0xfe5b8c,_0x5bee15){return db[_0x7413('0x1e')][_0x7413('0x1f')]({'raw':_0x17c062[_0x7413('0x20')]?_0x17c062[_0x7413('0x20')][_0x7413('0x21')]===undefined?!![]:![]:!![],'where':_0x17c062[_0x7413('0x20')]?_0x17c062[_0x7413('0x20')][_0x7413('0x22')]||null:null,'attributes':_0x17c062['options']?_0x17c062['options'][_0x7413('0x23')]||null:null,'limit':_0x17c062['options']?_0x17c062[_0x7413('0x20')][_0x7413('0x24')]||null:null,'include':_0x17c062[_0x7413('0x20')]?_0x17c062[_0x7413('0x20')][_0x7413('0x25')]?_[_0x7413('0x26')](_0x17c062[_0x7413('0x20')][_0x7413('0x25')],function(_0x1d455b){return{'model':db[_0x1d455b['model']],'as':_0x1d455b['as'],'attributes':_0x1d455b['attributes'],'include':_0x1d455b[_0x7413('0x25')]?_['map'](_0x1d455b[_0x7413('0x25')],function(_0x71cbb4){return{'model':db[_0x71cbb4[_0x7413('0x27')]],'as':_0x71cbb4['as'],'attributes':_0x71cbb4['attributes'],'include':_0x71cbb4[_0x7413('0x25')]?_[_0x7413('0x26')](_0x71cbb4[_0x7413('0x25')],function(_0x4843fd){return{'model':db[_0x4843fd[_0x7413('0x27')]],'as':_0x4843fd['as'],'attributes':_0x4843fd[_0x7413('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24dce7){logger['info'](_0x7413('0x1d'),_0x17c062);logger[_0x7413('0x16')](_0x7413('0x1d'),_0x17c062,JSON[_0x7413('0x17')](_0x24dce7));_0xfe5b8c(_0x24dce7);})[_0x7413('0x1c')](function(_0x2004ea){logger['error'](_0x7413('0x1d'),_0x2004ea[_0x7413('0x1a')],_0x17c062);_0x5bee15(_0x11f8a1[_0x7413('0x18')](0x1f4,_0x2004ea[_0x7413('0x1a')]));});});};exports[_0x7413('0x28')]=function(_0x256395){var _0x185cfe=this;return new Promise(function(_0x5b4426,_0xd763f9){return db[_0x7413('0x1e')][_0x7413('0x29')]({'raw':_0x256395[_0x7413('0x20')]?_0x256395[_0x7413('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x256395[_0x7413('0x20')]?_0x256395['options'][_0x7413('0x22')]||null:null,'attributes':_0x256395[_0x7413('0x20')]?_0x256395[_0x7413('0x20')]['attributes']||null:null,'include':_0x256395[_0x7413('0x20')]?_0x256395['options'][_0x7413('0x25')]?_[_0x7413('0x26')](_0x256395['options']['include'],function(_0x440bfe){return{'model':db[_0x440bfe[_0x7413('0x27')]],'as':_0x440bfe['as'],'attributes':_0x440bfe[_0x7413('0x23')],'include':_0x440bfe['include']?_['map'](_0x440bfe[_0x7413('0x25')],function(_0x5a92ab){return{'model':db[_0x5a92ab['model']],'as':_0x5a92ab['as'],'attributes':_0x5a92ab[_0x7413('0x23')],'include':_0x5a92ab['include']?_[_0x7413('0x26')](_0x5a92ab[_0x7413('0x25')],function(_0xf34b21){return{'model':db[_0xf34b21[_0x7413('0x27')]],'as':_0xf34b21['as'],'attributes':_0xf34b21[_0x7413('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa58bd2){if(_0x256395[_0x7413('0x20')][_0x7413('0x2a')]===!![])_0xa58bd2[_0x7413('0x2b')](_0x7413('0x2c'),_0xa58bd2[_0x7413('0x2d')]());logger[_0x7413('0x14')](_0x7413('0x28'),_0x256395);logger[_0x7413('0x16')](_0x7413('0x28'),_0x256395,JSON[_0x7413('0x17')](_0xa58bd2));_0x5b4426(_0xa58bd2);})[_0x7413('0x1c')](function(_0x5a9791){logger[_0x7413('0x18')]('ShowMailAccount',_0x5a9791['message'],_0x256395);_0xd763f9(_0x185cfe['error'](0x1f4,_0x5a9791['message']));});});};exports['NotifyMailAccount']=function(_0x44af7d){var _0x4c1770=this;return new Promise(function(_0x535e49,_0x5dc077){var _0x4d0008={'body':_0x44af7d['body'],'channel':_0x7413('0x2e')};var _0x32f1e8=_[_0x7413('0x2f')](_[_0x7413('0x30')](db[_0x7413('0x31')]['rawAttributes']),[_0x7413('0x32'),'updatedAt',_0x7413('0x33'),_0x7413('0x34')]);var _0xa063d1=![];if(_0x44af7d[_0x7413('0x35')]['id']){delete _0x44af7d[_0x7413('0x35')]['id'];}if(_[_0x7413('0x36')](_0x44af7d[_0x7413('0x35')][_0x7413('0x37')])){return _0x5dc077(_0x4c1770[_0x7413('0x18')](0x1f4,_0x7413('0x38')));}if(_[_0x7413('0x36')](_0x44af7d[_0x7413('0x35')][_0x7413('0x35')])||_0x44af7d['body'][_0x7413('0x35')]===''){return _0x5dc077(_0x4c1770[_0x7413('0x18')](0x1f4,_0x7413('0x39')));}if(_[_0x7413('0x36')](_0x44af7d[_0x7413('0x35')][_0x7413('0x3a')])){return _0x5dc077(_0x4c1770[_0x7413('0x18')](0x1f4,_0x7413('0x3b')+_0x32f1e8));}if(!_[_0x7413('0x3c')](_0x32f1e8,_0x44af7d[_0x7413('0x35')][_0x7413('0x3a')])){return _0x5dc077(_0x4c1770['error'](0x1f4,_0x7413('0x3d')+_0x32f1e8));}var _0x52a088={};_0x52a088[_0x44af7d[_0x7413('0x35')][_0x7413('0x3a')]]=_0x44af7d[_0x7413('0x35')][_0x7413('0x37')];return db[_0x7413('0x1e')][_0x7413('0x29')]({'where':{'id':_0x44af7d[_0x7413('0x3e')]['id']},'include':[{'model':db[_0x7413('0x3f')],'as':_0x7413('0x40'),'include':[{'model':db[_0x7413('0x31')],'as':'Contacts','where':_0x52a088,'limit':0x1,'order':[['updatedAt',_0x7413('0x41')]]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db[_0x7413('0x42')],'as':_0x7413('0x43'),'include':[{'model':db['CloudProvider'],'as':_0x7413('0x44')}]}]})['then'](function(_0x562bae){if(_0x562bae&&_0x562bae[_0x7413('0x40')]){var _0x5f263e=_0x562bae[_0x7413('0x45')]({'plain':!![]});_0x4d0008[_0x7413('0x3e')]=_[_0x7413('0x46')](_0x5f263e,[_0x7413('0x47'),_0x7413('0x40')]);_0x4d0008[_0x7413('0x3e')][_0x7413('0x2c')]=_0x562bae[_0x7413('0x2d')]();_0x4d0008[_0x7413('0x48')]=_0x5f263e[_0x7413('0x47')];_0x4d0008['list']=_0x5f263e[_0x7413('0x40')];_0x4d0008['applications']=_['orderBy'](_0x4d0008['applications'],[_0x7413('0x49')],[_0x7413('0x4a')]);if(_0x4d0008[_0x7413('0x3e')]&&_0x4d0008[_0x7413('0x3e')]['autoclose']){_0x4d0008['applications'][_0x7413('0x4b')]({'id':0x0,'priority':_0x4d0008['applications'][_0x7413('0x4c')]+0x1,'app':'close','appdata':'autoclose','interval':'*,*,*,*'});}if(_0x4d0008['account']['Applications']){delete _0x4d0008[_0x7413('0x3e')][_0x7413('0x47')];}if(_0x4d0008[_0x7413('0x3e')][_0x7413('0x40')]){delete _0x4d0008[_0x7413('0x3e')]['List'];}if(_0x5f263e[_0x7413('0x40')][_0x7413('0x4d')][_0x7413('0x4c')]){return _0x5f263e['List'][_0x7413('0x4d')][0x0];}var _0x5c3324=_['defaults'](_0x44af7d[_0x7413('0x35')],{'firstName':_0x44af7d[_0x7413('0x35')][_0x7413('0x37')],'ListId':_0x5f263e[_0x7413('0x34')]});_0x5c3324[_0x44af7d[_0x7413('0x35')][_0x7413('0x3a')]]=_0x44af7d['body'][_0x7413('0x37')];return db['CmContact'][_0x7413('0x4e')](_0x5c3324);}else{throw new Error('List\x20not\x20found');}})[_0x7413('0x13')](function(_0x4d4faa){_0x4d0008[_0x7413('0x4f')]=_0x4d4faa;if(_0x4d4faa){if(!_0x44af7d[_0x7413('0x35')]['message'][_0x7413('0x50')]){_0x44af7d['body'][_0x7413('0x1a')][_0x7413('0x50')]=rs['generate']()+'\x20'+_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['from'];}var _0x3ce34c={'ContactId':_0x4d4faa['id'],'MailAccountId':_0x44af7d[_0x7413('0x3e')]['id'],'inReplyTo':_0x44af7d['body'][_0x7413('0x1a')][_0x7413('0x50')],'to':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x37')],'cc':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['cc'],'subject':_0x44af7d[_0x7413('0x35')]['message'][_0x7413('0x51')],'attach':_0x44af7d['body'][_0x7413('0x1a')][_0x7413('0x52')],'lastMsgAt':moment()[_0x7413('0x53')](_0x7413('0x54')),'lastMsgDirection':'in'};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0x44af7d['account']['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':[_0x7413('0x50')],'where':{'messageId':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['inReplyTo']}}]})[_0x7413('0x13')](function(_0xb7dd83){if(_0xb7dd83){return[_0xb7dd83,![]];}return db[_0x7413('0x55')][_0x7413('0x4e')](_0x3ce34c)[_0x7413('0x13')](function(_0x3db284){return[_0x3db284,!![]];});});}else{throw new Error(_0x7413('0x56'));}})[_0x7413('0x57')](function(_0x1ec131,_0x47512d){if(_0x1ec131){_0xa063d1=_0x47512d;if(!_0x47512d){return _0x1ec131[_0x7413('0x58')]({'inReplyTo':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['messageId'],'to':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['from'],'cc':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['cc'],'subject':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x51')],'attach':_0x1ec131[_0x7413('0x52')]?_0x1ec131['attach']:_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['attach'],'substatus':null,'substatusAt':moment()[_0x7413('0x53')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format'](_0x7413('0x54')),'lastMsgDirection':'in'});}else{return _0x1ec131;}}})[_0x7413('0x13')](function(_0x167c6b){_0x4d0008[_0x7413('0x59')]=_0x167c6b[_0x7413('0x45')]({'plain':!![]});_0x4d0008[_0x7413('0x59')][_0x7413('0x5a')]=_0xa063d1;return db[_0x7413('0x5b')]['create']({'body':_0x44af7d[_0x7413('0x35')]['body'],'MailAccountId':_0x44af7d[_0x7413('0x3e')]['id'],'MailInteractionId':_0x167c6b['id'],'direction':'in','ContactId':_0x4d0008[_0x7413('0x4f')]['id'],'messageId':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x50')],'from':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x37')],'to':_0x44af7d[_0x7413('0x35')]['message']['to'],'cc':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['cc'],'subject':_0x44af7d['body'][_0x7413('0x1a')][_0x7413('0x51')],'attach':_0x44af7d['body'][_0x7413('0x1a')]['attach'],'Attachments':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['attachments'],'originTo':_0x44af7d['body'][_0x7413('0x1a')][_0x7413('0x5c')],'originCc':_0x44af7d[_0x7413('0x35')]['message'][_0x7413('0x5d')],'bcc':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x5e')],'ChatWebsiteId':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['ChatWebsiteId']||null,'originChannel':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x5f')]||'Email','ChatOfflineMessageId':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x60')]||null},{'include':[{'model':db[_0x7413('0x61')],'as':_0x7413('0x62')}]});})[_0x7413('0x13')](function(_0x46e9f8){_0x4d0008[_0x7413('0x1a')]=_0x46e9f8;if(_0x4d0008[_0x7413('0x59')]['UserId']){return db[_0x7413('0x63')][_0x7413('0x29')]({'attributes':['id',_0x7413('0x64')],'where':{'id':_0x4d0008[_0x7413('0x59')][_0x7413('0x65')]}})[_0x7413('0x13')](function(_0x4c9d1b){if(_0x4c9d1b){_0x4d0008[_0x7413('0x48')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4c9d1b[_0x7413('0x64')]+','+(_0x4d0008[_0x7413('0x3e')]['waitForTheAssignedAgent']||0xa),'interval':_0x7413('0x66')});}return respondWithRpcPromise(_0x7413('0x67'),_0x7413('0x68'),_0x4d0008);});}return respondWithRpcPromise(_0x7413('0x67'),_0x7413('0x68'),_0x4d0008);})[_0x7413('0x13')](function(_0x2d361c){_0x535e49(_0x2d361c);})[_0x7413('0x1c')](function(_0x5f4765){_0x5dc077(_0x4c1770[_0x7413('0x18')](0x1f4,_0x5f4765['message']));});});}; \ No newline at end of file +var _0xba34=['MailApplication','MailServerOut','Smtp','CloudProvider','get','omit','Applications','getSmtpOptions','list','applications','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','Contacts','from','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','MailInteraction','MailMessage','Messages','inReplyTo','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','GetMailAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowMailAccount','MailAccount','find','setDataValue','smtpOptions','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','DESC'];(function(_0x197daf,_0x401ca8){var _0x5f2659=function(_0x2dcfee){while(--_0x2dcfee){_0x197daf['push'](_0x197daf['shift']());}};_0x5f2659(++_0x401ca8);}(_0xba34,0x119));var _0x4ba3=function(_0x5e520a,_0x5ef9cb){_0x5e520a=_0x5e520a-0x0;var _0x10d7c6=_0xba34[_0x5e520a];return _0x10d7c6;};'use strict';var _=require(_0x4ba3('0x0'));var moment=require(_0x4ba3('0x1'));var BPromise=require(_0x4ba3('0x2'));var rs=require(_0x4ba3('0x3'));var Redis=require(_0x4ba3('0x4'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')('rpc');var config=require(_0x4ba3('0x5'));var jayson=require(_0x4ba3('0x6'));var client=jayson[_0x4ba3('0x7')][_0x4ba3('0x8')]({'port':0x232c});config[_0x4ba3('0x9')]=_[_0x4ba3('0xa')](config[_0x4ba3('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x4ba3('0xb'))(new Redis(config[_0x4ba3('0x9')]));require(_0x4ba3('0xc'))[_0x4ba3('0xd')](socket);function respondWithRpcPromise(_0x380d60,_0xcf1ec3,_0x292f58){return new BPromise(function(_0x3f653c,_0x2ed106){return client[_0x4ba3('0xe')](_0x380d60,_0x292f58)[_0x4ba3('0xf')](function(_0x51edab){logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0xcf1ec3,'request\x20sent');logger[_0x4ba3('0x12')]('MailAccount,\x20%s,\x20%s,\x20%s',_0xcf1ec3,_0x4ba3('0x13'),JSON['stringify'](_0x51edab));if(_0x51edab[_0x4ba3('0x14')]){if(_0x51edab[_0x4ba3('0x14')][_0x4ba3('0x15')]===0x1f4){logger[_0x4ba3('0x14')](_0x4ba3('0x11'),_0xcf1ec3,_0x51edab[_0x4ba3('0x14')][_0x4ba3('0x16')]);return _0x2ed106(_0x51edab[_0x4ba3('0x14')][_0x4ba3('0x16')]);}logger[_0x4ba3('0x14')](_0x4ba3('0x11'),_0xcf1ec3,_0x51edab[_0x4ba3('0x14')][_0x4ba3('0x16')]);return _0x3f653c(_0x51edab[_0x4ba3('0x14')][_0x4ba3('0x16')]);}else{logger[_0x4ba3('0x10')]('MailAccount,\x20%s,\x20%s',_0xcf1ec3,_0x4ba3('0x13'));_0x3f653c(_0x51edab[_0x4ba3('0x17')][_0x4ba3('0x16')]);}})[_0x4ba3('0x18')](function(_0x556290){logger[_0x4ba3('0x14')](_0x4ba3('0x11'),_0xcf1ec3,_0x556290);_0x2ed106(_0x556290);});});}exports[_0x4ba3('0x19')]=function(_0x1e2ce5){var _0x184332=this;return new Promise(function(_0x125944,_0x4b2791){return db['MailAccount'][_0x4ba3('0x1a')]({'raw':_0x1e2ce5['options']?_0x1e2ce5[_0x4ba3('0x1b')][_0x4ba3('0x1c')]===undefined?!![]:![]:!![],'where':_0x1e2ce5[_0x4ba3('0x1b')]?_0x1e2ce5[_0x4ba3('0x1b')][_0x4ba3('0x1d')]||null:null,'attributes':_0x1e2ce5[_0x4ba3('0x1b')]?_0x1e2ce5['options'][_0x4ba3('0x1e')]||null:null,'limit':_0x1e2ce5[_0x4ba3('0x1b')]?_0x1e2ce5['options'][_0x4ba3('0x1f')]||null:null,'include':_0x1e2ce5['options']?_0x1e2ce5[_0x4ba3('0x1b')][_0x4ba3('0x20')]?_[_0x4ba3('0x21')](_0x1e2ce5[_0x4ba3('0x1b')][_0x4ba3('0x20')],function(_0xe29a49){return{'model':db[_0xe29a49[_0x4ba3('0x22')]],'as':_0xe29a49['as'],'attributes':_0xe29a49[_0x4ba3('0x1e')],'include':_0xe29a49[_0x4ba3('0x20')]?_[_0x4ba3('0x21')](_0xe29a49['include'],function(_0x252f37){return{'model':db[_0x252f37[_0x4ba3('0x22')]],'as':_0x252f37['as'],'attributes':_0x252f37[_0x4ba3('0x1e')],'include':_0x252f37['include']?_[_0x4ba3('0x21')](_0x252f37[_0x4ba3('0x20')],function(_0x44d78c){return{'model':db[_0x44d78c['model']],'as':_0x44d78c['as'],'attributes':_0x44d78c[_0x4ba3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4ba3('0xf')](function(_0x34ecb4){logger[_0x4ba3('0x10')]('GetMailAccount',_0x1e2ce5);logger['debug'](_0x4ba3('0x19'),_0x1e2ce5,JSON[_0x4ba3('0x23')](_0x34ecb4));_0x125944(_0x34ecb4);})[_0x4ba3('0x18')](function(_0x19f039){logger[_0x4ba3('0x14')](_0x4ba3('0x19'),_0x19f039['message'],_0x1e2ce5);_0x4b2791(_0x184332[_0x4ba3('0x14')](0x1f4,_0x19f039[_0x4ba3('0x16')]));});});};exports[_0x4ba3('0x24')]=function(_0xbf95b3){var _0x2a6757=this;return new Promise(function(_0x1a7a2c,_0x457236){return db[_0x4ba3('0x25')][_0x4ba3('0x26')]({'raw':_0xbf95b3[_0x4ba3('0x1b')]?_0xbf95b3['options']['raw']===undefined?!![]:![]:!![],'where':_0xbf95b3['options']?_0xbf95b3[_0x4ba3('0x1b')][_0x4ba3('0x1d')]||null:null,'attributes':_0xbf95b3[_0x4ba3('0x1b')]?_0xbf95b3[_0x4ba3('0x1b')][_0x4ba3('0x1e')]||null:null,'include':_0xbf95b3[_0x4ba3('0x1b')]?_0xbf95b3[_0x4ba3('0x1b')][_0x4ba3('0x20')]?_[_0x4ba3('0x21')](_0xbf95b3[_0x4ba3('0x1b')][_0x4ba3('0x20')],function(_0x3439cb){return{'model':db[_0x3439cb['model']],'as':_0x3439cb['as'],'attributes':_0x3439cb[_0x4ba3('0x1e')],'include':_0x3439cb[_0x4ba3('0x20')]?_[_0x4ba3('0x21')](_0x3439cb['include'],function(_0x188f8c){return{'model':db[_0x188f8c['model']],'as':_0x188f8c['as'],'attributes':_0x188f8c[_0x4ba3('0x1e')],'include':_0x188f8c[_0x4ba3('0x20')]?_[_0x4ba3('0x21')](_0x188f8c[_0x4ba3('0x20')],function(_0xf892e1){return{'model':db[_0xf892e1[_0x4ba3('0x22')]],'as':_0xf892e1['as'],'attributes':_0xf892e1['attributes']};}):[]};}):[]};}):[]:[]})[_0x4ba3('0xf')](function(_0x3cf56c){if(_0xbf95b3[_0x4ba3('0x1b')]['smtp']===!![])_0x3cf56c[_0x4ba3('0x27')](_0x4ba3('0x28'),_0x3cf56c['getSmtpOptions']());logger[_0x4ba3('0x10')]('ShowMailAccount',_0xbf95b3);logger['debug'](_0x4ba3('0x24'),_0xbf95b3,JSON[_0x4ba3('0x23')](_0x3cf56c));_0x1a7a2c(_0x3cf56c);})[_0x4ba3('0x18')](function(_0x2b14e1){logger[_0x4ba3('0x14')]('ShowMailAccount',_0x2b14e1[_0x4ba3('0x16')],_0xbf95b3);_0x457236(_0x2a6757[_0x4ba3('0x14')](0x1f4,_0x2b14e1[_0x4ba3('0x16')]));});});};exports[_0x4ba3('0x29')]=function(_0xab7983){var _0x2acc92=this;return new Promise(function(_0x349af4,_0x2577be){var _0x553475={'body':_0xab7983[_0x4ba3('0x2a')],'channel':_0x4ba3('0x2b')};var _0x3cb07f=_[_0x4ba3('0x2c')](_[_0x4ba3('0x2d')](db[_0x4ba3('0x2e')][_0x4ba3('0x2f')]),[_0x4ba3('0x30'),_0x4ba3('0x31'),_0x4ba3('0x32'),_0x4ba3('0x33')]);var _0x1c58d2=![];if(_0xab7983[_0x4ba3('0x2a')]['id']){delete _0xab7983[_0x4ba3('0x2a')]['id'];}if(_['isNil'](_0xab7983['body']['from'])){return _0x2577be(_0x2acc92['error'](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x4ba3('0x34')](_0xab7983['body'][_0x4ba3('0x2a')])||_0xab7983['body'][_0x4ba3('0x2a')]===''){return _0x2577be(_0x2acc92[_0x4ba3('0x14')](0x1f4,_0x4ba3('0x35')));}if(_[_0x4ba3('0x34')](_0xab7983[_0x4ba3('0x2a')]['mapKey'])){return _0x2577be(_0x2acc92[_0x4ba3('0x14')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3cb07f));}if(!_[_0x4ba3('0x36')](_0x3cb07f,_0xab7983['body'][_0x4ba3('0x37')])){return _0x2577be(_0x2acc92[_0x4ba3('0x14')](0x1f4,_0x4ba3('0x38')+_0x3cb07f));}var _0x261a5e={};_0x261a5e[_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x37')]]=_0xab7983[_0x4ba3('0x2a')]['from'];return db[_0x4ba3('0x25')][_0x4ba3('0x26')]({'where':{'id':_0xab7983[_0x4ba3('0x39')]['id']},'include':[{'model':db[_0x4ba3('0x3a')],'as':_0x4ba3('0x3b'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x261a5e,'limit':0x1,'order':[[_0x4ba3('0x31'),_0x4ba3('0x3c')]]}]},{'model':db[_0x4ba3('0x3d')],'as':'Applications'},{'model':db[_0x4ba3('0x3e')],'as':_0x4ba3('0x3f'),'include':[{'model':db[_0x4ba3('0x40')],'as':'CloudProvider'}]}]})['then'](function(_0x34dc04){if(_0x34dc04&&_0x34dc04['List']){var _0x439acf=_0x34dc04[_0x4ba3('0x41')]({'plain':!![]});_0x553475[_0x4ba3('0x39')]=_[_0x4ba3('0x42')](_0x439acf,[_0x4ba3('0x43'),_0x4ba3('0x3b')]);_0x553475['account'][_0x4ba3('0x28')]=_0x34dc04[_0x4ba3('0x44')]();_0x553475['applications']=_0x439acf[_0x4ba3('0x43')];_0x553475[_0x4ba3('0x45')]=_0x439acf[_0x4ba3('0x3b')];_0x553475[_0x4ba3('0x46')]=_[_0x4ba3('0x47')](_0x553475['applications'],[_0x4ba3('0x48')],[_0x4ba3('0x49')]);if(_0x553475['account']&&_0x553475[_0x4ba3('0x39')][_0x4ba3('0x4a')]){_0x553475[_0x4ba3('0x46')][_0x4ba3('0x4b')]({'id':0x0,'priority':_0x553475[_0x4ba3('0x46')][_0x4ba3('0x4c')]+0x1,'app':_0x4ba3('0x4d'),'appdata':_0x4ba3('0x4a'),'interval':_0x4ba3('0x4e')});}if(_0x553475[_0x4ba3('0x39')][_0x4ba3('0x43')]){delete _0x553475[_0x4ba3('0x39')][_0x4ba3('0x43')];}if(_0x553475[_0x4ba3('0x39')][_0x4ba3('0x3b')]){delete _0x553475['account']['List'];}if(_0x439acf['List'][_0x4ba3('0x4f')][_0x4ba3('0x4c')]){return _0x439acf[_0x4ba3('0x3b')][_0x4ba3('0x4f')][0x0];}var _0x40af1d=_['defaults'](_0xab7983[_0x4ba3('0x2a')],{'firstName':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x50')],'ListId':_0x439acf[_0x4ba3('0x33')]});_0x40af1d[_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x37')]]=_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x50')];return db[_0x4ba3('0x2e')][_0x4ba3('0x51')](_0x40af1d);}else{throw new Error(_0x4ba3('0x52'));}})[_0x4ba3('0xf')](function(_0x317b9f){_0x553475[_0x4ba3('0x53')]=_0x317b9f;if(_0x317b9f){if(!_0xab7983['body'][_0x4ba3('0x16')][_0x4ba3('0x54')]){_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x54')]=rs[_0x4ba3('0x55')]()+'\x20'+_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')]['from'];}var _0x8ea419={'ContactId':_0x317b9f['id'],'MailAccountId':_0xab7983[_0x4ba3('0x39')]['id'],'inReplyTo':_0xab7983[_0x4ba3('0x2a')]['message'][_0x4ba3('0x54')],'to':_0xab7983['body'][_0x4ba3('0x16')][_0x4ba3('0x50')],'cc':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')]['cc'],'subject':_0xab7983[_0x4ba3('0x2a')]['message'][_0x4ba3('0x56')],'attach':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x57')],'lastMsgAt':moment()[_0x4ba3('0x58')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x4ba3('0x59')][_0x4ba3('0x26')]({'where':{'closed':![],'MailAccountId':_0xab7983[_0x4ba3('0x39')]['id']},'include':[{'model':db[_0x4ba3('0x5a')],'as':_0x4ba3('0x5b'),'attributes':[_0x4ba3('0x54')],'where':{'messageId':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x5c')]}}]})[_0x4ba3('0xf')](function(_0x1afc5e){if(_0x1afc5e){return[_0x1afc5e,![]];}return db['MailInteraction'][_0x4ba3('0x51')](_0x8ea419)[_0x4ba3('0xf')](function(_0x55c03c){return[_0x55c03c,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x4ba3('0x5d')](function(_0x296bf6,_0x5c7c2f){if(_0x296bf6){_0x1c58d2=_0x5c7c2f;if(!_0x5c7c2f){return _0x296bf6[_0x4ba3('0x5e')]({'inReplyTo':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')]['messageId'],'to':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x50')],'cc':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')]['cc'],'subject':_0xab7983[_0x4ba3('0x2a')]['message'][_0x4ba3('0x56')],'attach':_0x296bf6[_0x4ba3('0x57')]?_0x296bf6[_0x4ba3('0x57')]:_0xab7983['body'][_0x4ba3('0x16')][_0x4ba3('0x57')],'substatus':null,'substatusAt':moment()[_0x4ba3('0x58')](_0x4ba3('0x5f')),'lastMsgAt':moment()[_0x4ba3('0x58')](_0x4ba3('0x5f')),'lastMsgDirection':'in'});}else{return _0x296bf6;}}})[_0x4ba3('0xf')](function(_0x424477){_0x553475['interaction']=_0x424477['get']({'plain':!![]});_0x553475[_0x4ba3('0x60')]['created']=_0x1c58d2;return db[_0x4ba3('0x5a')][_0x4ba3('0x51')]({'body':_0xab7983[_0x4ba3('0x2a')]['body'],'MailAccountId':_0xab7983[_0x4ba3('0x39')]['id'],'MailInteractionId':_0x424477['id'],'direction':'in','ContactId':_0x553475[_0x4ba3('0x53')]['id'],'messageId':_0xab7983[_0x4ba3('0x2a')]['message'][_0x4ba3('0x54')],'from':_0xab7983['body'][_0x4ba3('0x16')][_0x4ba3('0x50')],'to':_0xab7983['body'][_0x4ba3('0x16')]['to'],'cc':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')]['cc'],'subject':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x56')],'attach':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x57')],'Attachments':_0xab7983['body'][_0x4ba3('0x16')][_0x4ba3('0x61')],'originTo':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x62')],'originCc':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x63')],'bcc':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x64')],'ChatWebsiteId':_0xab7983[_0x4ba3('0x2a')]['message'][_0x4ba3('0x65')]||null,'originChannel':_0xab7983[_0x4ba3('0x2a')]['message'][_0x4ba3('0x66')]||_0x4ba3('0x67'),'ChatOfflineMessageId':_0xab7983['body']['message'][_0x4ba3('0x68')]||null},{'include':[{'model':db[_0x4ba3('0x69')],'as':_0x4ba3('0x6a')}]});})[_0x4ba3('0xf')](function(_0x37b966){_0x553475[_0x4ba3('0x16')]=_0x37b966;if(_0x553475[_0x4ba3('0x60')][_0x4ba3('0x6b')]){return db['User'][_0x4ba3('0x26')]({'attributes':['id','name'],'where':{'id':_0x553475[_0x4ba3('0x60')][_0x4ba3('0x6b')]}})[_0x4ba3('0xf')](function(_0x3c3638){if(_0x3c3638){_0x553475[_0x4ba3('0x46')][_0x4ba3('0x6c')]({'id':0x0,'priority':0x0,'app':_0x4ba3('0x6d'),'appdata':_0x3c3638[_0x4ba3('0x6e')]+','+(_0x553475['account'][_0x4ba3('0x6f')]||0xa),'interval':_0x4ba3('0x4e')});}return respondWithRpcPromise(_0x4ba3('0x70'),'startRouting',_0x553475);});}return respondWithRpcPromise(_0x4ba3('0x70'),_0x4ba3('0x71'),_0x553475);})[_0x4ba3('0xf')](function(_0x39d428){_0x349af4(_0x39d428);})[_0x4ba3('0x18')](function(_0x2569bc){_0x2577be(_0x2acc92[_0x4ba3('0x14')](0x1f4,_0x2569bc['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index f7de7ad..f73e772 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 _0x20c9=['update','emit','removeListener','length','mailAccount:','./mailAccount.events','remove'];(function(_0x4016ce,_0x3995ae){var _0x31bde5=function(_0x358ea6){while(--_0x358ea6){_0x4016ce['push'](_0x4016ce['shift']());}};_0x31bde5(++_0x3995ae);}(_0x20c9,0x163));var _0x920c=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x20c9[_0x20589d];return _0x422de9;};'use strict';var MailAccountEvents=require(_0x920c('0x0'));var events=['save',_0x920c('0x1'),_0x920c('0x2')];function createListener(_0x57f058,_0x3da924){return function(_0x2a7930){_0x3da924[_0x920c('0x3')](_0x57f058,_0x2a7930);};}function removeListener(_0x4220f6,_0xb824e){return function(){MailAccountEvents[_0x920c('0x4')](_0x4220f6,_0xb824e);};}exports['register']=function(_0x17edcd){for(var _0x327891=0x0,_0x549568=events[_0x920c('0x5')];_0x327891<_0x549568;_0x327891++){var _0xfa8952=events[_0x327891];var _0x52a16b=createListener(_0x920c('0x6')+_0xfa8952,_0x17edcd);MailAccountEvents['on'](_0xfa8952,_0x52a16b);}}; \ No newline at end of file +var _0x6826=['update','emit','removeListener','register','length','./mailAccount.events','remove'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x6826,0x75));var _0x6682=function(_0x59dccc,_0x184c1c){_0x59dccc=_0x59dccc-0x0;var _0xc97bcb=_0x6826[_0x59dccc];return _0xc97bcb;};'use strict';var MailAccountEvents=require(_0x6682('0x0'));var events=['save',_0x6682('0x1'),_0x6682('0x2')];function createListener(_0x1cc116,_0x2158c2){return function(_0x21b39c){_0x2158c2[_0x6682('0x3')](_0x1cc116,_0x21b39c);};}function removeListener(_0x55c3b5,_0x5adb0b){return function(){MailAccountEvents[_0x6682('0x4')](_0x55c3b5,_0x5adb0b);};}exports[_0x6682('0x5')]=function(_0x45d511){for(var _0x4c20b5=0x0,_0x47bbf=events[_0x6682('0x6')];_0x4c20b5<_0x47bbf;_0x4c20b5++){var _0x8decb4=events[_0x4c20b5];var _0x1498b5=createListener('mailAccount:'+_0x8decb4,_0x45d511);MailAccountEvents['on'](_0x8decb4,_0x1498b5);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 2f6ff9b..bbdad48 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 _0xc845=['put','update','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','show'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xc845,0x1c7));var _0x5c84=function(_0x5b0ecf,_0x328594){_0x5b0ecf=_0x5b0ecf-0x0;var _0x596a80=_0xc845[_0x5b0ecf];return _0x596a80;};'use strict';var multer=require(_0x5c84('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5c84('0x1'));var express=require('express');var router=express[_0x5c84('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x5c84('0x3'));var interaction=require(_0x5c84('0x4'));var config=require(_0x5c84('0x5'));var controller=require(_0x5c84('0x6'));router['get'](_0x5c84('0x7'),auth[_0x5c84('0x8')](),controller[_0x5c84('0x9')]);router[_0x5c84('0xa')](_0x5c84('0x7'),auth[_0x5c84('0x8')](),controller[_0x5c84('0xb')]);router[_0x5c84('0xc')](_0x5c84('0x7'),auth[_0x5c84('0x8')](),controller[_0x5c84('0xd')]);module[_0x5c84('0xe')]=router; \ No newline at end of file +var _0xcebd=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','delete','destroy'];(function(_0x4db46b,_0xadcb1a){var _0x565be8=function(_0x5d2e50){while(--_0x5d2e50){_0x4db46b['push'](_0x4db46b['shift']());}};_0x565be8(++_0xadcb1a);}(_0xcebd,0x19f));var _0xdceb=function(_0x146f8d,_0x3277c1){_0x146f8d=_0x146f8d-0x0;var _0x5ad2df=_0xcebd[_0x146f8d];return _0x5ad2df;};'use strict';var multer=require(_0xdceb('0x0'));var util=require(_0xdceb('0x1'));var path=require('path');var timeout=require(_0xdceb('0x2'));var express=require(_0xdceb('0x3'));var router=express[_0xdceb('0x4')]();var fs_extra=require(_0xdceb('0x5'));var auth=require(_0xdceb('0x6'));var interaction=require(_0xdceb('0x7'));var config=require(_0xdceb('0x8'));var controller=require(_0xdceb('0x9'));router[_0xdceb('0xa')](_0xdceb('0xb'),auth[_0xdceb('0xc')](),controller[_0xdceb('0xd')]);router[_0xdceb('0xe')](_0xdceb('0xb'),auth[_0xdceb('0xc')](),controller['update']);router[_0xdceb('0xf')](_0xdceb('0xb'),auth['isAuthenticated'](),controller[_0xdceb('0x10')]);module[_0xdceb('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index cb58177..91af043 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 _0x70fd=['sequelize','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x5a641c,_0xe434c6){var _0x304fbf=function(_0x27de12){while(--_0x27de12){_0x5a641c['push'](_0x5a641c['shift']());}};_0x304fbf(++_0xe434c6);}(_0x70fd,0x17a));var _0xd70f=function(_0x41cd34,_0x32cd0c){_0x41cd34=_0x41cd34-0x0;var _0x1273e8=_0x70fd[_0x41cd34];return _0x1273e8;};'use strict';var Sequelize=require(_0xd70f('0x0'));module['exports']={'priority':{'type':Sequelize[_0xd70f('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xd70f('0x2')],'allowNull':![],'defaultValue':_0xd70f('0x3')},'appdata':{'type':Sequelize[_0xd70f('0x4')]()},'description':{'type':Sequelize[_0xd70f('0x2')]},'interval':{'type':Sequelize[_0xd70f('0x2')],'defaultValue':_0xd70f('0x5')}}; \ No newline at end of file +var _0xf2e3=['noop','sequelize','exports','INTEGER','STRING'];(function(_0x41abfa,_0x54b89a){var _0x17aaf7=function(_0x445bd0){while(--_0x445bd0){_0x41abfa['push'](_0x41abfa['shift']());}};_0x17aaf7(++_0x54b89a);}(_0xf2e3,0x173));var _0x3f2e=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0xf2e3[_0x47fd36];return _0x21a0fc;};'use strict';var Sequelize=require(_0x3f2e('0x0'));module[_0x3f2e('0x1')]={'priority':{'type':Sequelize[_0x3f2e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x3f2e('0x3')],'allowNull':![],'defaultValue':_0x3f2e('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x3f2e('0x3')]},'interval':{'type':Sequelize[_0x3f2e('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 6ea72d1..2b7d112 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 _0x54ef=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','show','params','model','rawAttributes','query','keys','filters','intersection','attributes','fields','length','merge','options','MailApplication','find','body','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x3f582b,_0xebfae6){var _0x2290db=function(_0x289f7f){while(--_0x289f7f){_0x3f582b['push'](_0x3f582b['shift']());}};_0x2290db(++_0xebfae6);}(_0x54ef,0x112));var _0xf54e=function(_0x4796b4,_0x75ce99){_0x4796b4=_0x4796b4-0x0;var _0x126e75=_0x54ef[_0x4796b4];return _0x126e75;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];function respondWithStatusCode(_0x4b0ee1,_0x4bd828){_0x4bd828=_0x4bd828||0xcc;return function(_0x15a9d4){if(_0x15a9d4){return _0x4b0ee1[_0xf54e('0x19')](_0x4bd828);}return _0x4b0ee1[_0xf54e('0x1a')](_0x4bd828)[_0xf54e('0x1b')]();};}function respondWithResult(_0x5644aa,_0x331732){_0x331732=_0x331732||0xc8;return function(_0x1bbeaa){if(_0x1bbeaa){return _0x5644aa[_0xf54e('0x1a')](_0x331732)[_0xf54e('0x1c')](_0x1bbeaa);}};}function respondWithFilteredResult(_0x56828e,_0x2366ee){return function(_0x389abc){if(_0x389abc){var _0x3eb415=typeof _0x2366ee['offset']==='undefined'&&typeof _0x2366ee[_0xf54e('0x1d')]===_0xf54e('0x1e');var _0x1c02e7=_0x389abc[_0xf54e('0x1f')];var _0x15cc48=_0x3eb415?0x0:_0x2366ee[_0xf54e('0x20')];var _0x2e27b6=_0x3eb415?_0x389abc[_0xf54e('0x1f')]:_0x2366ee[_0xf54e('0x20')]+_0x2366ee[_0xf54e('0x1d')];var _0x226c96;if(_0x2e27b6>=_0x1c02e7){_0x2e27b6=_0x1c02e7;_0x226c96=0xc8;}else{_0x226c96=0xce;}_0x56828e['status'](_0x226c96);return _0x56828e['set'](_0xf54e('0x21'),_0x15cc48+'-'+_0x2e27b6+'/'+_0x1c02e7)['json'](_0x389abc);}return null;};}function patchUpdates(_0x3e1556){return function(_0x1bfe99){try{jsonpatch[_0xf54e('0x22')](_0x1bfe99,_0x3e1556,!![]);}catch(_0x9903fc){return BPromise[_0xf54e('0x23')](_0x9903fc);}return _0x1bfe99[_0xf54e('0x24')]();};}function saveUpdates(_0x388aa0,_0x11985e){return function(_0x3c0169){if(_0x3c0169){return _0x3c0169[_0xf54e('0x25')](_0x388aa0)[_0xf54e('0x26')](function(_0x5b83df){return _0x5b83df;});}return null;};}function removeEntity(_0x6f6d29,_0x54f914){return function(_0x264a8f){if(_0x264a8f){return _0x264a8f[_0xf54e('0x27')]()[_0xf54e('0x26')](function(){_0x6f6d29[_0xf54e('0x1a')](0xcc)[_0xf54e('0x1b')]();});}};}function handleEntityNotFound(_0x160160,_0x1e08d1){return function(_0x43488d){if(!_0x43488d){_0x160160[_0xf54e('0x19')](0x194);}return _0x43488d;};}function handleError(_0x33457f,_0xf6cdd7){_0xf6cdd7=_0xf6cdd7||0x1f4;return function(_0x39c0ae){logger[_0xf54e('0x28')](_0x39c0ae['stack']);if(_0x39c0ae[_0xf54e('0x29')]){delete _0x39c0ae['name'];}_0x33457f[_0xf54e('0x1a')](_0xf6cdd7)['send'](_0x39c0ae);};}exports[_0xf54e('0x2a')]=function(_0x269f47,_0x21ba00){var _0xa13cd0={'raw':!![],'where':{'id':_0x269f47[_0xf54e('0x2b')]['id']}},_0x25b643={};_0x25b643[_0xf54e('0x2c')]=_['keys'](db['MailApplication'][_0xf54e('0x2d')]);_0x25b643[_0xf54e('0x2e')]=_[_0xf54e('0x2f')](_0x269f47[_0xf54e('0x2e')]);_0x25b643[_0xf54e('0x30')]=_[_0xf54e('0x31')](_0x25b643[_0xf54e('0x2c')],_0x25b643[_0xf54e('0x2e')]);_0xa13cd0[_0xf54e('0x32')]=_[_0xf54e('0x31')](_0x25b643['model'],qs['fields'](_0x269f47[_0xf54e('0x2e')][_0xf54e('0x33')]));_0xa13cd0['attributes']=_0xa13cd0[_0xf54e('0x32')][_0xf54e('0x34')]?_0xa13cd0[_0xf54e('0x32')]:_0x25b643[_0xf54e('0x2c')];if(_0x269f47['query']['includeAll']){_0xa13cd0['include']=[{'all':!![]}];}_0xa13cd0=_[_0xf54e('0x35')]({},_0xa13cd0,_0x269f47[_0xf54e('0x36')]);return db[_0xf54e('0x37')][_0xf54e('0x38')](_0xa13cd0)[_0xf54e('0x26')](handleEntityNotFound(_0x21ba00,null))[_0xf54e('0x26')](respondWithResult(_0x21ba00,null))['catch'](handleError(_0x21ba00,null));};exports['update']=function(_0x530cee,_0xc04e04){if(_0x530cee[_0xf54e('0x39')]['id']){delete _0x530cee['body']['id'];}return db['MailApplication'][_0xf54e('0x38')]({'where':{'id':_0x530cee[_0xf54e('0x2b')]['id']}})[_0xf54e('0x26')](handleEntityNotFound(_0xc04e04,null))['then'](saveUpdates(_0x530cee[_0xf54e('0x39')],null))[_0xf54e('0x26')](respondWithResult(_0xc04e04,null))['catch'](handleError(_0xc04e04,null));};exports[_0xf54e('0x27')]=function(_0x6e5bdf,_0x5af03){return db[_0xf54e('0x37')][_0xf54e('0x38')]({'where':{'id':_0x6e5bdf[_0xf54e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5af03,null))['then'](removeEntity(_0x5af03,null))[_0xf54e('0x3a')](handleError(_0x5af03,null));}; \ No newline at end of file +var _0xcb91=['send','show','params','keys','rawAttributes','query','intersection','attributes','fields','length','model','includeAll','include','merge','options','MailApplication','find','catch','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','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','then','destroy','error','stack','name'];(function(_0x5bb7e6,_0x1a7bb6){var _0x545a3c=function(_0x375109){while(--_0x375109){_0x5bb7e6['push'](_0x5bb7e6['shift']());}};_0x545a3c(++_0x1a7bb6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x37c07d,_0xdbdb5f){_0x37c07d=_0x37c07d-0x0;var _0x10dadc=_0xcb91[_0x37c07d];return _0x10dadc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cb9('0x0'));var jsonpatch=require(_0x1cb9('0x1'));var rp=require(_0x1cb9('0x2'));var moment=require(_0x1cb9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1cb9('0x4'));var util=require(_0x1cb9('0x5'));var path=require('path');var sox=require(_0x1cb9('0x6'));var csv=require(_0x1cb9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb9('0x8'));var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xc'));var authService=require(_0x1cb9('0xd'));var qs=require(_0x1cb9('0xe'));var as=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require('../../config/logger')(_0x1cb9('0x11'));var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var licenseUtil=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x5445e1,_0x5e3c19){_0x5e3c19=_0x5e3c19||0xcc;return function(_0x59dec3){if(_0x59dec3){return _0x5445e1[_0x1cb9('0x16')](_0x5e3c19);}return _0x5445e1[_0x1cb9('0x17')](_0x5e3c19)[_0x1cb9('0x18')]();};}function respondWithResult(_0x1c714f,_0x56884d){_0x56884d=_0x56884d||0xc8;return function(_0x397727){if(_0x397727){return _0x1c714f[_0x1cb9('0x17')](_0x56884d)[_0x1cb9('0x19')](_0x397727);}};}function respondWithFilteredResult(_0x8dfa55,_0x3e2d11){return function(_0x5806d8){if(_0x5806d8){var _0x5572cb=typeof _0x3e2d11[_0x1cb9('0x1a')]===_0x1cb9('0x1b')&&typeof _0x3e2d11[_0x1cb9('0x1c')]===_0x1cb9('0x1b');var _0x3e21e0=_0x5806d8[_0x1cb9('0x1d')];var _0x23d3a9=_0x5572cb?0x0:_0x3e2d11['offset'];var _0x479d43=_0x5572cb?_0x5806d8[_0x1cb9('0x1d')]:_0x3e2d11[_0x1cb9('0x1a')]+_0x3e2d11[_0x1cb9('0x1c')];var _0x31481a;if(_0x479d43>=_0x3e21e0){_0x479d43=_0x3e21e0;_0x31481a=0xc8;}else{_0x31481a=0xce;}_0x8dfa55[_0x1cb9('0x17')](_0x31481a);return _0x8dfa55[_0x1cb9('0x1e')](_0x1cb9('0x1f'),_0x23d3a9+'-'+_0x479d43+'/'+_0x3e21e0)['json'](_0x5806d8);}return null;};}function patchUpdates(_0x559bcc){return function(_0x1a5a72){try{jsonpatch['apply'](_0x1a5a72,_0x559bcc,!![]);}catch(_0x4750b1){return BPromise[_0x1cb9('0x20')](_0x4750b1);}return _0x1a5a72['save']();};}function saveUpdates(_0x599275,_0x2e3854){return function(_0x325637){if(_0x325637){return _0x325637[_0x1cb9('0x21')](_0x599275)[_0x1cb9('0x22')](function(_0x45b8d3){return _0x45b8d3;});}return null;};}function removeEntity(_0x27db16,_0x59ebea){return function(_0x55b232){if(_0x55b232){return _0x55b232[_0x1cb9('0x23')]()['then'](function(){_0x27db16[_0x1cb9('0x17')](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x69b4c8,_0x44d3c4){return function(_0x43a100){if(!_0x43a100){_0x69b4c8['sendStatus'](0x194);}return _0x43a100;};}function handleError(_0x195f16,_0x9df250){_0x9df250=_0x9df250||0x1f4;return function(_0x4c8d76){logger[_0x1cb9('0x24')](_0x4c8d76[_0x1cb9('0x25')]);if(_0x4c8d76[_0x1cb9('0x26')]){delete _0x4c8d76[_0x1cb9('0x26')];}_0x195f16[_0x1cb9('0x17')](_0x9df250)[_0x1cb9('0x27')](_0x4c8d76);};}exports[_0x1cb9('0x28')]=function(_0xb644b3,_0x41e5c2){var _0x9de64b={'raw':!![],'where':{'id':_0xb644b3[_0x1cb9('0x29')]['id']}},_0x48888d={};_0x48888d['model']=_[_0x1cb9('0x2a')](db['MailApplication'][_0x1cb9('0x2b')]);_0x48888d[_0x1cb9('0x2c')]=_[_0x1cb9('0x2a')](_0xb644b3[_0x1cb9('0x2c')]);_0x48888d['filters']=_[_0x1cb9('0x2d')](_0x48888d['model'],_0x48888d[_0x1cb9('0x2c')]);_0x9de64b[_0x1cb9('0x2e')]=_[_0x1cb9('0x2d')](_0x48888d['model'],qs[_0x1cb9('0x2f')](_0xb644b3['query'][_0x1cb9('0x2f')]));_0x9de64b['attributes']=_0x9de64b[_0x1cb9('0x2e')][_0x1cb9('0x30')]?_0x9de64b[_0x1cb9('0x2e')]:_0x48888d[_0x1cb9('0x31')];if(_0xb644b3['query'][_0x1cb9('0x32')]){_0x9de64b[_0x1cb9('0x33')]=[{'all':!![]}];}_0x9de64b=_[_0x1cb9('0x34')]({},_0x9de64b,_0xb644b3[_0x1cb9('0x35')]);return db[_0x1cb9('0x36')][_0x1cb9('0x37')](_0x9de64b)[_0x1cb9('0x22')](handleEntityNotFound(_0x41e5c2,null))[_0x1cb9('0x22')](respondWithResult(_0x41e5c2,null))[_0x1cb9('0x38')](handleError(_0x41e5c2,null));};exports[_0x1cb9('0x21')]=function(_0x294eec,_0x26b950){if(_0x294eec[_0x1cb9('0x39')]['id']){delete _0x294eec['body']['id'];}return db['MailApplication'][_0x1cb9('0x37')]({'where':{'id':_0x294eec[_0x1cb9('0x29')]['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x26b950,null))[_0x1cb9('0x22')](saveUpdates(_0x294eec[_0x1cb9('0x39')],null))[_0x1cb9('0x22')](respondWithResult(_0x26b950,null))[_0x1cb9('0x38')](handleError(_0x26b950,null));};exports[_0x1cb9('0x23')]=function(_0x4d3e39,_0x2aa59b){return db[_0x1cb9('0x36')][_0x1cb9('0x37')]({'where':{'id':_0x4d3e39['params']['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x2aa59b,null))['then'](removeEntity(_0x2aa59b,null))[_0x1cb9('0x38')](handleError(_0x2aa59b,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index d2ee100..e8d3bf5 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 _0x79bb=['lodash','api','moment','bluebird','request-promise','path','../../config/environment','./mailApplication.attributes','exports','MailApplication','utf8mb4','utf8mb4_unicode_ci'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x79bb,0xfc));var _0xb79b=function(_0x43a68c,_0x180570){_0x43a68c=_0x43a68c-0x0;var _0x85bdc1=_0x79bb[_0x43a68c];return _0x85bdc1;};'use strict';var _=require(_0xb79b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb79b('0x1'));var moment=require(_0xb79b('0x2'));var BPromise=require(_0xb79b('0x3'));var rp=require(_0xb79b('0x4'));var fs=require('fs');var path=require(_0xb79b('0x5'));var rimraf=require('rimraf');var config=require(_0xb79b('0x6'));var attributes=require(_0xb79b('0x7'));module[_0xb79b('0x8')]=function(_0x28fe10,_0x331631){return _0x28fe10['define'](_0xb79b('0x9'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb79b('0xa'),'collate':_0xb79b('0xb')});}; \ No newline at end of file +var _0x0d85=['mail_applications','utf8mb4_unicode_ci','api','moment','bluebird','request-promise','path','./mailApplication.attributes','exports','define'];(function(_0x103c41,_0x36c0b5){var _0x207214=function(_0x1cd206){while(--_0x1cd206){_0x103c41['push'](_0x103c41['shift']());}};_0x207214(++_0x36c0b5);}(_0x0d85,0x174));var _0x50d8=function(_0xd57a1d,_0x42c4cb){_0xd57a1d=_0xd57a1d-0x0;var _0x17163d=_0x0d85[_0xd57a1d];return _0x17163d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x50d8('0x0'));var moment=require(_0x50d8('0x1'));var BPromise=require(_0x50d8('0x2'));var rp=require(_0x50d8('0x3'));var fs=require('fs');var path=require(_0x50d8('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x50d8('0x5'));module[_0x50d8('0x6')]=function(_0x4c7288,_0x8f4035){return _0x4c7288[_0x50d8('0x7')]('MailApplication',attributes,{'tableName':_0x50d8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x50d8('0x9')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index c87472d..ad21c95 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 _0xbcae=['stringify','error','code','message','result','UpdateMailApplication','update','body','options','raw','where','attributes','limit','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent'];(function(_0xf579a3,_0x31b163){var _0x1b360=function(_0xf42a26){while(--_0xf42a26){_0xf579a3['push'](_0xf579a3['shift']());}};_0x1b360(++_0x31b163);}(_0xbcae,0xa9));var _0xebca=function(_0x1c8206,_0xcd6622){_0x1c8206=_0x1c8206-0x0;var _0x2f1619=_0xbcae[_0x1c8206];return _0x2f1619;};'use strict';var _=require(_0xebca('0x0'));var util=require(_0xebca('0x1'));var moment=require(_0xebca('0x2'));var BPromise=require(_0xebca('0x3'));var rs=require(_0xebca('0x4'));var fs=require('fs');var Redis=require(_0xebca('0x5'));var db=require(_0xebca('0x6'))['db'];var utils=require(_0xebca('0x7'));var logger=require(_0xebca('0x8'))(_0xebca('0x9'));var config=require('../../config/environment');var jayson=require(_0xebca('0xa'));var client=jayson[_0xebca('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x331ef7,_0x3781e0,_0x3830a6){return new BPromise(function(_0x49cea1,_0x27bf87){return client[_0xebca('0xc')](_0x331ef7,_0x3830a6)[_0xebca('0xd')](function(_0x1a371f){logger[_0xebca('0xe')](_0xebca('0xf'),_0x3781e0,'request\x20sent');logger['debug']('MailApplication,\x20%s,\x20%s,\x20%s',_0x3781e0,_0xebca('0x10'),JSON[_0xebca('0x11')](_0x1a371f));if(_0x1a371f[_0xebca('0x12')]){if(_0x1a371f[_0xebca('0x12')][_0xebca('0x13')]===0x1f4){logger['error'](_0xebca('0xf'),_0x3781e0,_0x1a371f[_0xebca('0x12')][_0xebca('0x14')]);return _0x27bf87(_0x1a371f[_0xebca('0x12')][_0xebca('0x14')]);}logger[_0xebca('0x12')](_0xebca('0xf'),_0x3781e0,_0x1a371f[_0xebca('0x12')]['message']);return _0x49cea1(_0x1a371f['error'][_0xebca('0x14')]);}else{logger['info'](_0xebca('0xf'),_0x3781e0,_0xebca('0x10'));_0x49cea1(_0x1a371f[_0xebca('0x15')][_0xebca('0x14')]);}})['catch'](function(_0x33f471){logger[_0xebca('0x12')](_0xebca('0xf'),_0x3781e0,_0x33f471);_0x27bf87(_0x33f471);});});}exports[_0xebca('0x16')]=function(_0x500855){var _0x3ee019=this;return new Promise(function(_0x12ed50,_0x23b411){return db['MailApplication'][_0xebca('0x17')](_0x500855[_0xebca('0x18')],{'raw':_0x500855['options']?_0x500855[_0xebca('0x19')][_0xebca('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x500855[_0xebca('0x19')]?_0x500855[_0xebca('0x19')][_0xebca('0x1b')]||null:null,'attributes':_0x500855[_0xebca('0x19')]?_0x500855[_0xebca('0x19')][_0xebca('0x1c')]||null:null,'limit':_0x500855[_0xebca('0x19')]?_0x500855[_0xebca('0x19')][_0xebca('0x1d')]||null:null})[_0xebca('0xd')](function(_0x46613b){logger[_0xebca('0xe')]('UpdateMailApplication',_0x500855);logger[_0xebca('0x1e')](_0xebca('0x16'),_0x500855,JSON[_0xebca('0x11')](_0x46613b));_0x12ed50(_0x46613b);})['catch'](function(_0x570fe6){logger[_0xebca('0x12')](_0xebca('0x16'),_0x570fe6['message'],_0x500855);_0x23b411(_0x3ee019[_0xebca('0x12')](0x1f4,_0x570fe6[_0xebca('0x14')]));});});}; \ No newline at end of file +var _0x5117=['request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailApplication','MailApplication','update','options','where','attributes','limit','debug','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4fde9a,_0x5d1eda){var _0x58f321=function(_0x278061){while(--_0x278061){_0x4fde9a['push'](_0x4fde9a['shift']());}};_0x58f321(++_0x5d1eda);}(_0x5117,0x188));var _0x7511=function(_0x2d89ce,_0x24d58d){_0x2d89ce=_0x2d89ce-0x0;var _0x3fad10=_0x5117[_0x2d89ce];return _0x3fad10;};'use strict';var _=require('lodash');var util=require(_0x7511('0x0'));var moment=require('moment');var BPromise=require(_0x7511('0x1'));var rs=require(_0x7511('0x2'));var fs=require('fs');var Redis=require(_0x7511('0x3'));var db=require(_0x7511('0x4'))['db'];var utils=require(_0x7511('0x5'));var logger=require('../../config/logger')(_0x7511('0x6'));var config=require(_0x7511('0x7'));var jayson=require(_0x7511('0x8'));var client=jayson[_0x7511('0x9')][_0x7511('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x385465,_0x36a07a,_0x922d81){return new BPromise(function(_0x5ddf6e,_0x26d79e){return client[_0x7511('0xb')](_0x385465,_0x922d81)[_0x7511('0xc')](function(_0x35324d){logger[_0x7511('0xd')](_0x7511('0xe'),_0x36a07a,_0x7511('0xf'));logger['debug'](_0x7511('0x10'),_0x36a07a,_0x7511('0xf'),JSON[_0x7511('0x11')](_0x35324d));if(_0x35324d['error']){if(_0x35324d[_0x7511('0x12')][_0x7511('0x13')]===0x1f4){logger[_0x7511('0x12')](_0x7511('0xe'),_0x36a07a,_0x35324d[_0x7511('0x12')][_0x7511('0x14')]);return _0x26d79e(_0x35324d[_0x7511('0x12')][_0x7511('0x14')]);}logger[_0x7511('0x12')](_0x7511('0xe'),_0x36a07a,_0x35324d['error'][_0x7511('0x14')]);return _0x5ddf6e(_0x35324d['error'][_0x7511('0x14')]);}else{logger[_0x7511('0xd')](_0x7511('0xe'),_0x36a07a,_0x7511('0xf'));_0x5ddf6e(_0x35324d[_0x7511('0x15')][_0x7511('0x14')]);}})[_0x7511('0x16')](function(_0x5b566d){logger[_0x7511('0x12')]('MailApplication,\x20%s,\x20%s',_0x36a07a,_0x5b566d);_0x26d79e(_0x5b566d);});});}exports[_0x7511('0x17')]=function(_0x6a7538){var _0x5001a6=this;return new Promise(function(_0x39e8c8,_0x5c3562){return db[_0x7511('0x18')][_0x7511('0x19')](_0x6a7538['body'],{'raw':_0x6a7538[_0x7511('0x1a')]?_0x6a7538[_0x7511('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6a7538['options']?_0x6a7538[_0x7511('0x1a')][_0x7511('0x1b')]||null:null,'attributes':_0x6a7538['options']?_0x6a7538[_0x7511('0x1a')][_0x7511('0x1c')]||null:null,'limit':_0x6a7538['options']?_0x6a7538['options'][_0x7511('0x1d')]||null:null})[_0x7511('0xc')](function(_0x51133b){logger['info'](_0x7511('0x17'),_0x6a7538);logger[_0x7511('0x1e')](_0x7511('0x17'),_0x6a7538,JSON[_0x7511('0x11')](_0x51133b));_0x39e8c8(_0x51133b);})[_0x7511('0x16')](function(_0x2f5eb6){logger['error'](_0x7511('0x17'),_0x2f5eb6[_0x7511('0x14')],_0x6a7538);_0x5c3562(_0x5001a6[_0x7511('0x12')](0x1f4,_0x2f5eb6[_0x7511('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 8191784..bdcbda2 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 _0x72c9=['mail','mailinteraction:addtags','addTags','mailinteraction:update','mailinteraction:destroy','destroy','delete','removeTags','exports','express','Router','../../components/auth/service','./mailInteraction.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','tracked'];(function(_0x3d8ca8,_0x1a9764){var _0x517e45=function(_0x641ad9){while(--_0x641ad9){_0x3d8ca8['push'](_0x3d8ca8['shift']());}};_0x517e45(++_0x1a9764);}(_0x72c9,0xe1));var _0x972c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x72c9[_0x14add3];return _0x4a174f;};'use strict';var express=require(_0x972c('0x0'));var router=express[_0x972c('0x1')]();var auth=require(_0x972c('0x2'));var interaction=require('../../components/interaction/service');var controller=require(_0x972c('0x3'));router[_0x972c('0x4')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x972c('0x5'),auth[_0x972c('0x6')](),controller[_0x972c('0x7')]);router[_0x972c('0x4')](_0x972c('0x8'),auth[_0x972c('0x6')](),controller[_0x972c('0x9')]);router[_0x972c('0x4')](_0x972c('0xa'),auth[_0x972c('0x6')](),controller[_0x972c('0xb')]);router[_0x972c('0x4')]('/:id/download',auth[_0x972c('0x6')](),controller[_0x972c('0xc')]);router[_0x972c('0xd')]('/',auth[_0x972c('0x6')](),controller[_0x972c('0xe')]);router[_0x972c('0xd')]('/:id/messages',auth['isAuthenticated'](),controller[_0x972c('0xf')]);router['post'](_0x972c('0x10'),auth[_0x972c('0x6')](),interaction[_0x972c('0x11')](_0x972c('0x12'),_0x972c('0x13')),controller[_0x972c('0x14')]);router['put'](_0x972c('0x8'),auth['isAuthenticated'](),interaction[_0x972c('0x11')](_0x972c('0x12'),_0x972c('0x15')),controller['update']);router['delete'](_0x972c('0x8'),auth[_0x972c('0x6')](),interaction[_0x972c('0x11')](_0x972c('0x12'),_0x972c('0x16')),controller[_0x972c('0x17')]);router[_0x972c('0x18')](_0x972c('0x10'),auth[_0x972c('0x6')](),controller[_0x972c('0x19')]);module[_0x972c('0x1a')]=router; \ No newline at end of file +var _0x7381=['download','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x7381,0xc5));var _0x1738=function(_0x4521e3,_0x10a8a4){_0x4521e3=_0x4521e3-0x0;var _0x46a272=_0x7381[_0x4521e3];return _0x46a272;};'use strict';var express=require('express');var router=express[_0x1738('0x0')]();var auth=require(_0x1738('0x1'));var interaction=require(_0x1738('0x2'));var controller=require(_0x1738('0x3'));router[_0x1738('0x4')]('/',auth[_0x1738('0x5')](),controller[_0x1738('0x6')]);router[_0x1738('0x4')](_0x1738('0x7'),auth[_0x1738('0x5')](),controller[_0x1738('0x8')]);router['get'](_0x1738('0x9'),auth[_0x1738('0x5')](),controller[_0x1738('0xa')]);router[_0x1738('0x4')](_0x1738('0xb'),auth[_0x1738('0x5')](),controller['getMessages']);router[_0x1738('0x4')](_0x1738('0xc'),auth[_0x1738('0x5')](),controller[_0x1738('0xd')]);router[_0x1738('0xe')]('/',auth[_0x1738('0x5')](),controller[_0x1738('0xf')]);router['post'](_0x1738('0xb'),auth['isAuthenticated'](),controller[_0x1738('0x10')]);router[_0x1738('0xe')](_0x1738('0x11'),auth[_0x1738('0x5')](),interaction[_0x1738('0x12')](_0x1738('0x13'),_0x1738('0x14')),controller[_0x1738('0x15')]);router[_0x1738('0x16')](_0x1738('0x9'),auth[_0x1738('0x5')](),interaction[_0x1738('0x12')]('mail',_0x1738('0x17')),controller[_0x1738('0x18')]);router[_0x1738('0x19')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x1738('0x13'),_0x1738('0x1a')),controller[_0x1738('0x1b')]);router[_0x1738('0x19')](_0x1738('0x11'),auth[_0x1738('0x5')](),controller[_0x1738('0x1c')]);module[_0x1738('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index ea4487f..9554134 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 _0x181c=['STRING','ENUM','out','sequelize','iconv','exports','BOOLEAN','DATE'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x181c,0x14b));var _0xc181=function(_0x2a3c4d,_0x9c6b37){_0x2a3c4d=_0x2a3c4d-0x0;var _0x55c390=_0x181c[_0x2a3c4d];return _0x55c390;};'use strict';var Sequelize=require(_0xc181('0x0'));var iconv=require(_0xc181('0x1'));module[_0xc181('0x2')]={'closed':{'type':Sequelize[_0xc181('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc181('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xc181('0x5')]},'thirdDisposition':{'type':Sequelize[_0xc181('0x5')]},'note':{'type':Sequelize[_0xc181('0x5')]},'inReplyTo':{'type':Sequelize[_0xc181('0x5')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0xc181('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xc181('0x4')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0xc181('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xc181('0x6')]('in',_0xc181('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc181('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xc181('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa5c0=['iconv','exports','DATE','STRING','TEXT','ENUM','out','sequelize'];(function(_0x3f3bff,_0x2cbf1f){var _0x472f29=function(_0x2d8ae4){while(--_0x2d8ae4){_0x3f3bff['push'](_0x3f3bff['shift']());}};_0x472f29(++_0x2cbf1f);}(_0xa5c0,0xbf));var _0x0a5c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5c0[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0a5c('0x0'));var iconv=require(_0x0a5c('0x1'));module[_0x0a5c('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0a5c('0x3')]},'disposition':{'type':Sequelize[_0x0a5c('0x4')]},'secondDisposition':{'type':Sequelize[_0x0a5c('0x4')]},'thirdDisposition':{'type':Sequelize[_0x0a5c('0x4')]},'note':{'type':Sequelize[_0x0a5c('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0x0a5c('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x0a5c('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x0a5c('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0a5c('0x6')]('in',_0x0a5c('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0a5c('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0a5c('0x6')]('in',_0x0a5c('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index a066a12..3b677f9 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 _0xc3a8=['existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','bluebird','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','json','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','mail','query','catch','params','model','MailInteraction','keys','filters','attributes','intersection','fields','length','includeAll','include','merge','create','body','find','describe','addMessage','ids','omit','getMessages','findOne','MailMessage','hasOwnProperty','nolimit','order','sort','pick','where','MailInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','inlineCss','true','rows','addTags','setTags','spread','Tag','color','mailInteractionTags:save','download','join','root','server','files','tmp','attachments','push','Attachment','Attachments','Messages','createdAt','get','each','from','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','bcc'];(function(_0x50b66d,_0x11c61c){var _0x41aa8e=function(_0x418a48){while(--_0x418a48){_0x50b66d['push'](_0x50b66d['shift']());}};_0x41aa8e(++_0x11c61c);}(_0xc3a8,0xe8));var _0x8c3a=function(_0x3e0600,_0x9bb3c9){_0x3e0600=_0x3e0600-0x0;var _0x5e1117=_0xc3a8[_0x3e0600];return _0x5e1117;};'use strict';var emlformat=require(_0x8c3a('0x0'));var rimraf=require(_0x8c3a('0x1'));var zipdir=require(_0x8c3a('0x2'));var moment=require('moment');var BPromise=require(_0x8c3a('0x3'));var util=require('util');var path=require(_0x8c3a('0x4'));var fs=require('fs');var _=require(_0x8c3a('0x5'));var juice=require(_0x8c3a('0x6'));var Redis=require(_0x8c3a('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0x8c3a('0x8'));var logger=require(_0x8c3a('0x9'))(_0x8c3a('0xa'));var config=require(_0x8c3a('0xb'));var db=require(_0x8c3a('0xc'))['db'];var htmlEntities=require(_0x8c3a('0xd'));config['redis']=_[_0x8c3a('0xe')](config[_0x8c3a('0xf')],{'host':_0x8c3a('0x10'),'port':0x18eb});var socket=require(_0x8c3a('0x11'))(new Redis(config[_0x8c3a('0xf')]));require('./mailInteraction.socket')[_0x8c3a('0x12')](socket);function respondWithStatusCode(_0xcef571,_0x5c0d35){_0x5c0d35=_0x5c0d35||0xcc;return function(_0x451726){if(_0x451726){return _0xcef571[_0x8c3a('0x13')](_0x5c0d35);}return _0xcef571[_0x8c3a('0x14')](_0x5c0d35)[_0x8c3a('0x15')]();};}function respondWithResult(_0x15edbb,_0x22ef05){_0x22ef05=_0x22ef05||0xc8;return function(_0x5eb124){if(_0x5eb124){return _0x15edbb[_0x8c3a('0x14')](_0x22ef05)['json'](_0x5eb124);}};}function respondWithFilteredResult(_0x5c7ed2,_0x3b228a){return function(_0x94752d){if(_0x94752d){var _0x271d3d=typeof _0x3b228a[_0x8c3a('0x16')]===_0x8c3a('0x17')&&typeof _0x3b228a[_0x8c3a('0x18')]===_0x8c3a('0x17');var _0x513e00=_0x94752d[_0x8c3a('0x19')];var _0x5be4ea=_0x271d3d?0x0:_0x3b228a[_0x8c3a('0x16')];var _0x1766b3=_0x271d3d?_0x94752d[_0x8c3a('0x19')]:_0x3b228a[_0x8c3a('0x16')]+_0x3b228a[_0x8c3a('0x18')];var _0x54fe05;if(_0x1766b3>=_0x513e00){_0x1766b3=_0x513e00;_0x54fe05=0xc8;}else{_0x54fe05=0xce;}_0x5c7ed2['status'](_0x54fe05);return _0x5c7ed2['set']('Content-Range',_0x5be4ea+'-'+_0x1766b3+'/'+_0x513e00)[_0x8c3a('0x1a')](_0x94752d);}return null;};}function saveUpdates(_0x39b0dc){return function(_0x8fd89e){if(_0x8fd89e){return _0x8fd89e[_0x8c3a('0x1b')](_0x39b0dc)[_0x8c3a('0x1c')](function(_0x2fdf5a){return _0x2fdf5a;});}return null;};}function removeEntity(_0x5155d0){return function(_0x261c43){if(_0x261c43){return _0x261c43[_0x8c3a('0x1d')]()['then'](function(){_0x5155d0[_0x8c3a('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3efbc4){return function(_0x1ed2c1){if(!_0x1ed2c1){_0x3efbc4[_0x8c3a('0x13')](0x194);}return _0x1ed2c1;};}function handleError(_0x58ca7a,_0x429ca6){_0x429ca6=_0x429ca6||0x1f4;return function(_0xb78cfc){logger[_0x8c3a('0x1e')](_0xb78cfc[_0x8c3a('0x1f')]);if(_0xb78cfc[_0x8c3a('0x20')]){delete _0xb78cfc[_0x8c3a('0x20')];}_0x58ca7a[_0x8c3a('0x14')](_0x429ca6)['send'](_0xb78cfc);};}exports[_0x8c3a('0x21')]=function(_0x5a6a42,_0x2b4833){var _0x59f2ee={};var _0xb9f4bf=_[_0x8c3a('0x22')](db['MailInteraction'][_0x8c3a('0x23')],function(_0x4a1c24){return{'name':_0x4a1c24[_0x8c3a('0x24')],'type':_0x4a1c24[_0x8c3a('0x25')][_0x8c3a('0x26')]};});_0x59f2ee=qs['getOptions'](_0xb9f4bf,_0x5a6a42);return interaction['findAll'](_0x8c3a('0x27'),_0x5a6a42[_0x8c3a('0x28')],_0x5a6a42['user'],_0x59f2ee,_0xb9f4bf)[_0x8c3a('0x1c')](respondWithFilteredResult(_0x2b4833,_0x59f2ee))[_0x8c3a('0x29')](handleError(_0x2b4833,null));};exports['show']=function(_0xd5353d,_0x31cad9){var _0x3d6fd5={'raw':![],'where':{'id':_0xd5353d[_0x8c3a('0x2a')]['id']}},_0x48d1f8={};_0x48d1f8[_0x8c3a('0x2b')]=_['keys'](db[_0x8c3a('0x2c')][_0x8c3a('0x23')]);_0x48d1f8['query']=_[_0x8c3a('0x2d')](_0xd5353d[_0x8c3a('0x28')]);_0x48d1f8[_0x8c3a('0x2e')]=_['intersection'](_0x48d1f8[_0x8c3a('0x2b')],_0x48d1f8[_0x8c3a('0x28')]);_0x3d6fd5[_0x8c3a('0x2f')]=_[_0x8c3a('0x30')](_0x48d1f8['model'],qs['fields'](_0xd5353d[_0x8c3a('0x28')][_0x8c3a('0x31')]));_0x3d6fd5[_0x8c3a('0x2f')]=_0x3d6fd5[_0x8c3a('0x2f')][_0x8c3a('0x32')]?_0x3d6fd5['attributes']:_0x48d1f8[_0x8c3a('0x2b')];if(_0xd5353d[_0x8c3a('0x28')][_0x8c3a('0x33')]){_0x3d6fd5[_0x8c3a('0x34')]=[{'all':!![]}];}_0x3d6fd5=_[_0x8c3a('0x35')]({},_0x3d6fd5,_0xd5353d['options']);return db[_0x8c3a('0x2c')]['find'](_0x3d6fd5)[_0x8c3a('0x1c')](handleEntityNotFound(_0x31cad9,null))['then'](respondWithResult(_0x31cad9,null))[_0x8c3a('0x29')](handleError(_0x31cad9,null));};exports['create']=function(_0x1f1e03,_0x60c293){return db[_0x8c3a('0x2c')][_0x8c3a('0x36')](_0x1f1e03['body'],{})[_0x8c3a('0x1c')](respondWithResult(_0x60c293,0xc9))[_0x8c3a('0x29')](handleError(_0x60c293,null));};exports[_0x8c3a('0x1b')]=function(_0x4970f0,_0x388984){if(_0x4970f0[_0x8c3a('0x37')]['id']){delete _0x4970f0[_0x8c3a('0x37')]['id'];}return db[_0x8c3a('0x2c')][_0x8c3a('0x38')]({'where':{'id':_0x4970f0[_0x8c3a('0x2a')]['id']}})[_0x8c3a('0x1c')](handleEntityNotFound(_0x388984,null))[_0x8c3a('0x1c')](saveUpdates(_0x4970f0[_0x8c3a('0x37')],null))[_0x8c3a('0x1c')](respondWithResult(_0x388984,null))[_0x8c3a('0x29')](handleError(_0x388984,null));};exports['destroy']=function(_0x35a172,_0x2d3e0a){return db[_0x8c3a('0x2c')]['find']({'where':{'id':_0x35a172[_0x8c3a('0x2a')]['id']}})['then'](handleEntityNotFound(_0x2d3e0a,null))[_0x8c3a('0x1c')](removeEntity(_0x2d3e0a,null))['catch'](handleError(_0x2d3e0a,null));};exports[_0x8c3a('0x39')]=function(_0x1e1b5e,_0x4abb7e){return db[_0x8c3a('0x2c')][_0x8c3a('0x39')]()[_0x8c3a('0x1c')](respondWithResult(_0x4abb7e,null))[_0x8c3a('0x29')](handleError(_0x4abb7e,null));};exports[_0x8c3a('0x3a')]=function(_0x5c38b9,_0x575014){return db['MailMessage'][_0x8c3a('0x38')]({'where':{'id':_0x5c38b9[_0x8c3a('0x2a')]['id']}})[_0x8c3a('0x1c')](handleEntityNotFound(_0x575014,null))[_0x8c3a('0x1c')](function(_0x4f9246){if(_0x4f9246){return _0x4f9246[_0x8c3a('0x3a')](_0x5c38b9['body'][_0x8c3a('0x3b')],_[_0x8c3a('0x3c')](_0x5c38b9[_0x8c3a('0x37')],['ids','id'])||{});}})[_0x8c3a('0x1c')](respondWithResult(_0x575014,null))[_0x8c3a('0x29')](handleError(_0x575014,null));};exports[_0x8c3a('0x3d')]=function(_0xe3776e,_0x1c441e){var _0x30b2c2={'raw':![],'where':{}};var _0x4d0137={};var _0x54732c={'count':0x0,'rows':[]};return db[_0x8c3a('0x2c')][_0x8c3a('0x3e')]({'where':{'id':_0xe3776e[_0x8c3a('0x2a')]['id']}})['then'](handleEntityNotFound(_0x1c441e,null))[_0x8c3a('0x1c')](function(_0x1877a2){if(_0x1877a2){_0x4d0137[_0x8c3a('0x2b')]=_['keys'](db[_0x8c3a('0x3f')][_0x8c3a('0x23')]);_0x4d0137[_0x8c3a('0x28')]=_[_0x8c3a('0x2d')](_0xe3776e['query']);_0x4d0137[_0x8c3a('0x2e')]=_[_0x8c3a('0x30')](_0x4d0137['model'],_0x4d0137[_0x8c3a('0x28')]);_0x30b2c2['attributes']=_['intersection'](_0x4d0137['model'],qs[_0x8c3a('0x31')](_0xe3776e[_0x8c3a('0x28')][_0x8c3a('0x31')]));_0x30b2c2[_0x8c3a('0x2f')]=_0x30b2c2[_0x8c3a('0x2f')][_0x8c3a('0x32')]?_0x30b2c2[_0x8c3a('0x2f')]:_0x4d0137[_0x8c3a('0x2b')];if(!_0xe3776e[_0x8c3a('0x28')][_0x8c3a('0x40')](_0x8c3a('0x41'))){_0x30b2c2['limit']=qs[_0x8c3a('0x18')](_0xe3776e[_0x8c3a('0x28')][_0x8c3a('0x18')]);_0x30b2c2[_0x8c3a('0x16')]=qs[_0x8c3a('0x16')](_0xe3776e[_0x8c3a('0x28')][_0x8c3a('0x16')]);}_0x30b2c2[_0x8c3a('0x42')]=qs[_0x8c3a('0x43')](_0xe3776e[_0x8c3a('0x28')][_0x8c3a('0x43')]);_0x30b2c2['where']=qs[_0x8c3a('0x2e')](_[_0x8c3a('0x44')](_0xe3776e[_0x8c3a('0x28')],_0x4d0137[_0x8c3a('0x2e')]));_0x30b2c2[_0x8c3a('0x45')][_0x8c3a('0x46')]=_0x1877a2['id'];if(_0xe3776e[_0x8c3a('0x28')][_0x8c3a('0x47')]){_0x30b2c2[_0x8c3a('0x45')]=_['merge'](_0x30b2c2[_0x8c3a('0x45')],{'$or':_[_0x8c3a('0x22')](_0x30b2c2[_0x8c3a('0x2f')],function(_0x339652){var _0x5d12fc={};_0x5d12fc[_0x339652]={'$like':'%'+_0xe3776e[_0x8c3a('0x28')]['filter']+'%'};return _0x5d12fc;})});}if(_0xe3776e['query'][_0x8c3a('0x48')]){var _0x255c2b=_0xe3776e['query'][_0x8c3a('0x48')][_0x8c3a('0x49')](',');var _0x4525b3={};_0x4525b3[_0x255c2b[0x0]]={'$gte':moment(_0x255c2b[0x1])[_0x8c3a('0x4a')](_0x8c3a('0x4b'))};_0x30b2c2[_0x8c3a('0x45')]=_[_0x8c3a('0x35')](_0x30b2c2[_0x8c3a('0x45')],_0x4525b3);}_0x30b2c2=_[_0x8c3a('0x35')]({},_0x30b2c2,_0xe3776e[_0x8c3a('0x4c')]);return db[_0x8c3a('0x3f')][_0x8c3a('0x19')]({'where':_0x30b2c2[_0x8c3a('0x45')]})[_0x8c3a('0x1c')](function(_0x25ea3b){_0x54732c['count']=_0x25ea3b;if(_0xe3776e[_0x8c3a('0x28')]['includeAll']){_0x30b2c2[_0x8c3a('0x34')]=[{'all':!![]}];}return db[_0x8c3a('0x3f')][_0x8c3a('0x4d')](_0x30b2c2);})['then'](function(_0x3e1a44){if(_0xe3776e[_0x8c3a('0x28')][_0x8c3a('0x4e')]===_0x8c3a('0x4f')){for(var _0x533b50=0x0;_0x533b50<_0x3e1a44['length'];_0x533b50++){_0x3e1a44[_0x533b50][_0x8c3a('0x37')]=juice(_0x3e1a44[_0x533b50][_0x8c3a('0x37')]);}}_0x54732c[_0x8c3a('0x50')]=_0x3e1a44;return _0x54732c;});}})['then'](respondWithFilteredResult(_0x1c441e,_0x30b2c2))[_0x8c3a('0x29')](handleError(_0x1c441e,null));};exports[_0x8c3a('0x51')]=function(_0x1258c8,_0x46e8ee){return db['MailInteraction'][_0x8c3a('0x38')]({'where':{'id':_0x1258c8[_0x8c3a('0x2a')]['id']}})[_0x8c3a('0x1c')](handleEntityNotFound(_0x46e8ee,null))[_0x8c3a('0x1c')](function(_0x3d38bf){if(_0x3d38bf){return _0x3d38bf[_0x8c3a('0x52')](_0x1258c8['body'][_0x8c3a('0x3b')],_[_0x8c3a('0x3c')](_0x1258c8['body'],[_0x8c3a('0x3b'),'id'])||{})[_0x8c3a('0x53')](function(){return db[_0x8c3a('0x54')][_0x8c3a('0x4d')]({'attributes':['id',_0x8c3a('0x20'),_0x8c3a('0x55')],'where':{'id':_0x1258c8[_0x8c3a('0x37')][_0x8c3a('0x3b')]}});})['then'](function(_0x336657){socket['emit'](_0x8c3a('0x56'),{'id':Number(_0x1258c8[_0x8c3a('0x2a')]['id']),'tags':_0x336657||[]});return{'id':Number(_0x1258c8[_0x8c3a('0x2a')]['id']),'tags':_0x336657||[]};});}})['then'](respondWithResult(_0x46e8ee,null))[_0x8c3a('0x29')](handleError(_0x46e8ee,null));};exports['removeTags']=function(_0x4c4ca5,_0x533c11){return db[_0x8c3a('0x2c')][_0x8c3a('0x38')]({'where':{'id':_0x4c4ca5[_0x8c3a('0x2a')]['id']}})['then'](handleEntityNotFound(_0x533c11,null))[_0x8c3a('0x1c')](function(_0x24f029){if(_0x24f029){return _0x24f029['removeTags'](_0x4c4ca5['query'][_0x8c3a('0x3b')]);}})[_0x8c3a('0x1c')](respondWithStatusCode(_0x533c11,null))[_0x8c3a('0x29')](handleError(_0x533c11,null));};exports[_0x8c3a('0x57')]=function(_0x1cd540,_0x3d0680){var _0x4ff0b7=moment()['unix']()['toString']();var _0x50722e=path[_0x8c3a('0x58')](config[_0x8c3a('0x59')],_0x8c3a('0x5a'),_0x8c3a('0x5b'),_0x8c3a('0x5c'));var _0xd31644=path[_0x8c3a('0x58')](config[_0x8c3a('0x59')],_0x8c3a('0x5a'),_0x8c3a('0x5b'),_0x8c3a('0x5d'));var _0x185ae7=path[_0x8c3a('0x58')](_0x50722e,_0x4ff0b7);var _0x4ea1c3=util[_0x8c3a('0x4a')]('transcript-%d-%s.zip',_0x1cd540['params']['id'],_0x4ff0b7);var _0x212abb=path['join'](_0x50722e,_0x4ea1c3);var _0x40dedc=[];if(_0x1cd540[_0x8c3a('0x28')][_0x8c3a('0x5d')]){_0x40dedc[_0x8c3a('0x5e')]({'model':db[_0x8c3a('0x5f')],'as':_0x8c3a('0x60'),'raw':!![]});}var _0x497acb=[{'model':db['MailMessage'],'as':_0x8c3a('0x61'),'attributes':['id','body','from','to','cc','bcc','subject',_0x8c3a('0x62')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x40dedc}];return db['MailInteraction'][_0x8c3a('0x38')]({'where':{'id':_0x1cd540[_0x8c3a('0x2a')]['id']},'include':_0x497acb})[_0x8c3a('0x1c')](handleEntityNotFound(_0x3d0680,null))[_0x8c3a('0x1c')](function(_0x7c385b){if(_0x7c385b&&_0x7c385b[_0x8c3a('0x61')]){var _0x2b73f4=_0x7c385b[_0x8c3a('0x63')]({'plain':!![]});fs['mkdirSync'](_0x185ae7);return BPromise[_0x8c3a('0x64')](_0x2b73f4['Messages'],function(_0x2d54d8,_0x3924a1){var _0x31a024={'from':_0x2d54d8[_0x8c3a('0x65')],'to':_0x2d54d8['to'],'subject':_0x2d54d8[_0x8c3a('0x66')],'html':htmlEntities['decode'](_0x2d54d8['body']),'headers':{'Date':moment(_0x2d54d8[_0x8c3a('0x62')])['format'](_0x8c3a('0x67'))},'attachments':[]};if(_0x2d54d8['cc']){_0x31a024[_0x8c3a('0x68')]['Cc']=_0x2d54d8['cc'];}if(_0x2d54d8['bcc']){_0x31a024[_0x8c3a('0x68')][_0x8c3a('0x69')]=_0x2d54d8[_0x8c3a('0x6a')];}return new BPromise(function(_0x5c5a5d,_0x1324e4){if(_0x2d54d8[_0x8c3a('0x60')]){for(var _0x317b0a=0x0;_0x317b0a<_0x2d54d8[_0x8c3a('0x60')]['length'];_0x317b0a++){var _0xceecaf=_0x2d54d8[_0x8c3a('0x60')][_0x317b0a];var _0x1c855d=path[_0x8c3a('0x58')](_0xd31644,_0xceecaf['basename']);if(fs[_0x8c3a('0x6b')](_0x1c855d)){_0x31a024[_0x8c3a('0x5d')][_0x8c3a('0x5e')]({'name':_0xceecaf[_0x8c3a('0x20')],'contentType':_0xceecaf[_0x8c3a('0x25')],'data':fs[_0x8c3a('0x6c')](_0x1c855d)});}}}emlformat[_0x8c3a('0x6d')](_0x31a024,function(_0x3ac7a9,_0x1b10b0){if(_0x3ac7a9)return _0x1324e4(_0x3ac7a9);fs[_0x8c3a('0x6e')](path[_0x8c3a('0x58')](_0x185ae7,util['format'](_0x8c3a('0x6f'),_0x3924a1)),_0x1b10b0);return _0x5c5a5d(_0x1b10b0);});});})[_0x8c3a('0x1c')](function(){return new BPromise(function(_0x444965,_0x3366b3){zipdir(_0x185ae7,{'saveTo':_0x212abb},function(_0x241b1a,_0x13d055){if(_0x241b1a)return _0x3366b3(_0x241b1a);return _0x444965(_0x13d055);});})[_0x8c3a('0x1c')](function(){return new BPromise(function(_0xe0cbcb,_0x38329c){rimraf(_0x185ae7,function(_0x183cf4){if(_0x183cf4)_0x38329c(_0x183cf4);return _0xe0cbcb();});});})[_0x8c3a('0x1c')](function(){return _0x3d0680[_0x8c3a('0x57')](_0x212abb,_0x4ea1c3,function(_0x578a4f){if(!_0x578a4f)fs[_0x8c3a('0x70')](_0x212abb);});});});}else{return _0x3d0680[_0x8c3a('0x13')](0xc8);}})[_0x8c3a('0x29')](handleError(_0x3d0680,null));}; \ No newline at end of file +var _0xb85a=['include','find','create','body','describe','addMessage','omit','ids','getMessages','findOne','MailMessage','hasOwnProperty','nolimit','order','sort','where','pick','MailInteractionId','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','inlineCss','true','length','addTags','setTags','spread','Tag','color','mailInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','push','Attachment','Attachments','Messages','bcc','createdAt','mkdirSync','each','from','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','attachments','readFileSync','build','message%d.eml','unlinkSync','rimraf','zip-dir','moment','bluebird','util','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','getOptions','findAll','query','user','catch','params','MailInteraction','keys','filters','intersection','attributes','model','fields','includeAll'];(function(_0x18b518,_0x22e1ff){var _0x1356c5=function(_0x511d60){while(--_0x511d60){_0x18b518['push'](_0x18b518['shift']());}};_0x1356c5(++_0x22e1ff);}(_0xb85a,0xb0));var _0xab85=function(_0x673ea4,_0x449076){_0x673ea4=_0x673ea4-0x0;var _0x3e5938=_0xb85a[_0x673ea4];return _0x3e5938;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab85('0x0'));var zipdir=require(_0xab85('0x1'));var moment=require(_0xab85('0x2'));var BPromise=require(_0xab85('0x3'));var util=require(_0xab85('0x4'));var path=require('path');var fs=require('fs');var _=require('lodash');var juice=require(_0xab85('0x5'));var Redis=require(_0xab85('0x6'));var interaction=require(_0xab85('0x7'));var qs=require(_0xab85('0x8'));var logger=require(_0xab85('0x9'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var htmlEntities=require(_0xab85('0xa'));config[_0xab85('0xb')]=_[_0xab85('0xc')](config[_0xab85('0xb')],{'host':_0xab85('0xd'),'port':0x18eb});var socket=require(_0xab85('0xe'))(new Redis(config[_0xab85('0xb')]));require(_0xab85('0xf'))['register'](socket);function respondWithStatusCode(_0x1a6019,_0x40bd96){_0x40bd96=_0x40bd96||0xcc;return function(_0x55ec9e){if(_0x55ec9e){return _0x1a6019[_0xab85('0x10')](_0x40bd96);}return _0x1a6019[_0xab85('0x11')](_0x40bd96)[_0xab85('0x12')]();};}function respondWithResult(_0x15e1a8,_0x20cf86){_0x20cf86=_0x20cf86||0xc8;return function(_0x4133d2){if(_0x4133d2){return _0x15e1a8['status'](_0x20cf86)[_0xab85('0x13')](_0x4133d2);}};}function respondWithFilteredResult(_0xe47ee0,_0x32271f){return function(_0x537a3e){if(_0x537a3e){var _0x349d44=typeof _0x32271f['offset']==='undefined'&&typeof _0x32271f[_0xab85('0x14')]===_0xab85('0x15');var _0x3e9719=_0x537a3e[_0xab85('0x16')];var _0x5b2018=_0x349d44?0x0:_0x32271f[_0xab85('0x17')];var _0x19cb09=_0x349d44?_0x537a3e[_0xab85('0x16')]:_0x32271f[_0xab85('0x17')]+_0x32271f['limit'];var _0x25ef05;if(_0x19cb09>=_0x3e9719){_0x19cb09=_0x3e9719;_0x25ef05=0xc8;}else{_0x25ef05=0xce;}_0xe47ee0[_0xab85('0x11')](_0x25ef05);return _0xe47ee0[_0xab85('0x18')](_0xab85('0x19'),_0x5b2018+'-'+_0x19cb09+'/'+_0x3e9719)['json'](_0x537a3e);}return null;};}function saveUpdates(_0x821be4){return function(_0x41192f){if(_0x41192f){return _0x41192f[_0xab85('0x1a')](_0x821be4)[_0xab85('0x1b')](function(_0x3d529a){return _0x3d529a;});}return null;};}function removeEntity(_0x4f2fa1){return function(_0x367862){if(_0x367862){return _0x367862[_0xab85('0x1c')]()['then'](function(){_0x4f2fa1[_0xab85('0x11')](0xcc)[_0xab85('0x12')]();});}};}function handleEntityNotFound(_0x1ad9f1){return function(_0x1e392d){if(!_0x1e392d){_0x1ad9f1[_0xab85('0x10')](0x194);}return _0x1e392d;};}function handleError(_0x442730,_0x163f76){_0x163f76=_0x163f76||0x1f4;return function(_0x3c2bc2){logger[_0xab85('0x1d')](_0x3c2bc2[_0xab85('0x1e')]);if(_0x3c2bc2[_0xab85('0x1f')]){delete _0x3c2bc2[_0xab85('0x1f')];}_0x442730[_0xab85('0x11')](_0x163f76)[_0xab85('0x20')](_0x3c2bc2);};}exports[_0xab85('0x21')]=function(_0x47bdcb,_0xbbd169){var _0xd6637c={};var _0x3e6d79=_[_0xab85('0x22')](db['MailInteraction'][_0xab85('0x23')],function(_0x40dfde){return{'name':_0x40dfde['fieldName'],'type':_0x40dfde[_0xab85('0x24')][_0xab85('0x25')]};});_0xd6637c=qs[_0xab85('0x26')](_0x3e6d79,_0x47bdcb);return interaction[_0xab85('0x27')]('mail',_0x47bdcb[_0xab85('0x28')],_0x47bdcb[_0xab85('0x29')],_0xd6637c,_0x3e6d79)[_0xab85('0x1b')](respondWithFilteredResult(_0xbbd169,_0xd6637c))[_0xab85('0x2a')](handleError(_0xbbd169,null));};exports['show']=function(_0x2c2582,_0x364cb7){var _0x317558={'raw':![],'where':{'id':_0x2c2582[_0xab85('0x2b')]['id']}},_0x5581de={};_0x5581de['model']=_['keys'](db[_0xab85('0x2c')][_0xab85('0x23')]);_0x5581de['query']=_[_0xab85('0x2d')](_0x2c2582[_0xab85('0x28')]);_0x5581de[_0xab85('0x2e')]=_[_0xab85('0x2f')](_0x5581de['model'],_0x5581de[_0xab85('0x28')]);_0x317558[_0xab85('0x30')]=_[_0xab85('0x2f')](_0x5581de[_0xab85('0x31')],qs[_0xab85('0x32')](_0x2c2582['query'][_0xab85('0x32')]));_0x317558['attributes']=_0x317558[_0xab85('0x30')]['length']?_0x317558[_0xab85('0x30')]:_0x5581de[_0xab85('0x31')];if(_0x2c2582[_0xab85('0x28')][_0xab85('0x33')]){_0x317558[_0xab85('0x34')]=[{'all':!![]}];}_0x317558=_['merge']({},_0x317558,_0x2c2582['options']);return db[_0xab85('0x2c')][_0xab85('0x35')](_0x317558)['then'](handleEntityNotFound(_0x364cb7,null))[_0xab85('0x1b')](respondWithResult(_0x364cb7,null))[_0xab85('0x2a')](handleError(_0x364cb7,null));};exports[_0xab85('0x36')]=function(_0x3f04c2,_0x5d3b1a){return db[_0xab85('0x2c')][_0xab85('0x36')](_0x3f04c2[_0xab85('0x37')],{})[_0xab85('0x1b')](respondWithResult(_0x5d3b1a,0xc9))[_0xab85('0x2a')](handleError(_0x5d3b1a,null));};exports['update']=function(_0x190ec9,_0x2aa391){if(_0x190ec9[_0xab85('0x37')]['id']){delete _0x190ec9[_0xab85('0x37')]['id'];}return db[_0xab85('0x2c')]['find']({'where':{'id':_0x190ec9[_0xab85('0x2b')]['id']}})[_0xab85('0x1b')](handleEntityNotFound(_0x2aa391,null))[_0xab85('0x1b')](saveUpdates(_0x190ec9['body'],null))[_0xab85('0x1b')](respondWithResult(_0x2aa391,null))[_0xab85('0x2a')](handleError(_0x2aa391,null));};exports[_0xab85('0x1c')]=function(_0x1917e5,_0x4f1257){return db[_0xab85('0x2c')][_0xab85('0x35')]({'where':{'id':_0x1917e5[_0xab85('0x2b')]['id']}})[_0xab85('0x1b')](handleEntityNotFound(_0x4f1257,null))[_0xab85('0x1b')](removeEntity(_0x4f1257,null))[_0xab85('0x2a')](handleError(_0x4f1257,null));};exports[_0xab85('0x38')]=function(_0x2ab2e9,_0x2efb0d){return db[_0xab85('0x2c')][_0xab85('0x38')]()[_0xab85('0x1b')](respondWithResult(_0x2efb0d,null))[_0xab85('0x2a')](handleError(_0x2efb0d,null));};exports[_0xab85('0x39')]=function(_0x47751f,_0x1bf271){return db['MailMessage']['find']({'where':{'id':_0x47751f[_0xab85('0x2b')]['id']}})[_0xab85('0x1b')](handleEntityNotFound(_0x1bf271,null))[_0xab85('0x1b')](function(_0x25682f){if(_0x25682f){return _0x25682f[_0xab85('0x39')](_0x47751f[_0xab85('0x37')]['ids'],_[_0xab85('0x3a')](_0x47751f[_0xab85('0x37')],[_0xab85('0x3b'),'id'])||{});}})[_0xab85('0x1b')](respondWithResult(_0x1bf271,null))['catch'](handleError(_0x1bf271,null));};exports[_0xab85('0x3c')]=function(_0x4bfb7c,_0x39a97d){var _0x47aef={'raw':![],'where':{}};var _0x14c5b4={};var _0x2a902e={'count':0x0,'rows':[]};return db['MailInteraction'][_0xab85('0x3d')]({'where':{'id':_0x4bfb7c['params']['id']}})[_0xab85('0x1b')](handleEntityNotFound(_0x39a97d,null))[_0xab85('0x1b')](function(_0x485a41){if(_0x485a41){_0x14c5b4[_0xab85('0x31')]=_[_0xab85('0x2d')](db[_0xab85('0x3e')][_0xab85('0x23')]);_0x14c5b4[_0xab85('0x28')]=_[_0xab85('0x2d')](_0x4bfb7c[_0xab85('0x28')]);_0x14c5b4[_0xab85('0x2e')]=_['intersection'](_0x14c5b4[_0xab85('0x31')],_0x14c5b4[_0xab85('0x28')]);_0x47aef[_0xab85('0x30')]=_[_0xab85('0x2f')](_0x14c5b4[_0xab85('0x31')],qs[_0xab85('0x32')](_0x4bfb7c[_0xab85('0x28')][_0xab85('0x32')]));_0x47aef[_0xab85('0x30')]=_0x47aef[_0xab85('0x30')]['length']?_0x47aef[_0xab85('0x30')]:_0x14c5b4[_0xab85('0x31')];if(!_0x4bfb7c[_0xab85('0x28')][_0xab85('0x3f')](_0xab85('0x40'))){_0x47aef['limit']=qs[_0xab85('0x14')](_0x4bfb7c[_0xab85('0x28')][_0xab85('0x14')]);_0x47aef[_0xab85('0x17')]=qs[_0xab85('0x17')](_0x4bfb7c[_0xab85('0x28')][_0xab85('0x17')]);}_0x47aef[_0xab85('0x41')]=qs['sort'](_0x4bfb7c['query'][_0xab85('0x42')]);_0x47aef[_0xab85('0x43')]=qs['filters'](_[_0xab85('0x44')](_0x4bfb7c['query'],_0x14c5b4[_0xab85('0x2e')]));_0x47aef[_0xab85('0x43')][_0xab85('0x45')]=_0x485a41['id'];if(_0x4bfb7c['query'][_0xab85('0x46')]){_0x47aef[_0xab85('0x43')]=_[_0xab85('0x47')](_0x47aef[_0xab85('0x43')],{'$or':_[_0xab85('0x22')](_0x47aef['attributes'],function(_0x334ce8){var _0x591bd4={};_0x591bd4[_0x334ce8]={'$like':'%'+_0x4bfb7c[_0xab85('0x28')][_0xab85('0x46')]+'%'};return _0x591bd4;})});}if(_0x4bfb7c['query'][_0xab85('0x48')]){var _0x5411cb=_0x4bfb7c[_0xab85('0x28')][_0xab85('0x48')][_0xab85('0x49')](',');var _0x5417b8={};_0x5417b8[_0x5411cb[0x0]]={'$gte':moment(_0x5411cb[0x1])[_0xab85('0x4a')](_0xab85('0x4b'))};_0x47aef[_0xab85('0x43')]=_[_0xab85('0x47')](_0x47aef[_0xab85('0x43')],_0x5417b8);}_0x47aef=_[_0xab85('0x47')]({},_0x47aef,_0x4bfb7c[_0xab85('0x4c')]);return db['MailMessage'][_0xab85('0x16')]({'where':_0x47aef[_0xab85('0x43')]})[_0xab85('0x1b')](function(_0x5e5a76){_0x2a902e[_0xab85('0x16')]=_0x5e5a76;if(_0x4bfb7c[_0xab85('0x28')][_0xab85('0x33')]){_0x47aef[_0xab85('0x34')]=[{'all':!![]}];}return db['MailMessage'][_0xab85('0x27')](_0x47aef);})['then'](function(_0x3dd365){if(_0x4bfb7c[_0xab85('0x28')][_0xab85('0x4d')]===_0xab85('0x4e')){for(var _0x135974=0x0;_0x135974<_0x3dd365[_0xab85('0x4f')];_0x135974++){_0x3dd365[_0x135974]['body']=juice(_0x3dd365[_0x135974]['body']);}}_0x2a902e['rows']=_0x3dd365;return _0x2a902e;});}})[_0xab85('0x1b')](respondWithFilteredResult(_0x39a97d,_0x47aef))[_0xab85('0x2a')](handleError(_0x39a97d,null));};exports[_0xab85('0x50')]=function(_0x2f961d,_0x4264d1){return db[_0xab85('0x2c')][_0xab85('0x35')]({'where':{'id':_0x2f961d[_0xab85('0x2b')]['id']}})[_0xab85('0x1b')](handleEntityNotFound(_0x4264d1,null))[_0xab85('0x1b')](function(_0x39b6f0){if(_0x39b6f0){return _0x39b6f0[_0xab85('0x51')](_0x2f961d[_0xab85('0x37')][_0xab85('0x3b')],_['omit'](_0x2f961d[_0xab85('0x37')],['ids','id'])||{})[_0xab85('0x52')](function(){return db[_0xab85('0x53')][_0xab85('0x27')]({'attributes':['id',_0xab85('0x1f'),_0xab85('0x54')],'where':{'id':_0x2f961d[_0xab85('0x37')][_0xab85('0x3b')]}});})['then'](function(_0x409192){socket['emit'](_0xab85('0x55'),{'id':Number(_0x2f961d[_0xab85('0x2b')]['id']),'tags':_0x409192||[]});return{'id':Number(_0x2f961d['params']['id']),'tags':_0x409192||[]};});}})['then'](respondWithResult(_0x4264d1,null))[_0xab85('0x2a')](handleError(_0x4264d1,null));};exports[_0xab85('0x56')]=function(_0x662972,_0x398ffa){return db[_0xab85('0x2c')][_0xab85('0x35')]({'where':{'id':_0x662972[_0xab85('0x2b')]['id']}})[_0xab85('0x1b')](handleEntityNotFound(_0x398ffa,null))[_0xab85('0x1b')](function(_0x3ac8ea){if(_0x3ac8ea){return _0x3ac8ea[_0xab85('0x56')](_0x662972[_0xab85('0x28')]['ids']);}})['then'](respondWithStatusCode(_0x398ffa,null))['catch'](handleError(_0x398ffa,null));};exports[_0xab85('0x57')]=function(_0x1fb21d,_0xb29d57){var _0x5ea0e8=moment()[_0xab85('0x58')]()[_0xab85('0x59')]();var _0x10a141=path[_0xab85('0x5a')](config[_0xab85('0x5b')],_0xab85('0x5c'),_0xab85('0x5d'),'tmp');var _0x5202a4=path[_0xab85('0x5a')](config[_0xab85('0x5b')],_0xab85('0x5c'),_0xab85('0x5d'),'attachments');var _0x157e2f=path[_0xab85('0x5a')](_0x10a141,_0x5ea0e8);var _0x3adb54=util[_0xab85('0x4a')]('transcript-%d-%s.zip',_0x1fb21d[_0xab85('0x2b')]['id'],_0x5ea0e8);var _0x11d139=path[_0xab85('0x5a')](_0x10a141,_0x3adb54);var _0x2329e6=[];if(_0x1fb21d['query']['attachments']){_0x2329e6[_0xab85('0x5e')]({'model':db[_0xab85('0x5f')],'as':_0xab85('0x60'),'raw':!![]});}var _0x4363cf=[{'model':db[_0xab85('0x3e')],'as':_0xab85('0x61'),'attributes':['id','body','from','to','cc',_0xab85('0x62'),'subject',_0xab85('0x63')],'where':{'secret':![]},'order':qs[_0xab85('0x42')]('id'),'include':_0x2329e6}];return db[_0xab85('0x2c')][_0xab85('0x35')]({'where':{'id':_0x1fb21d['params']['id']},'include':_0x4363cf})[_0xab85('0x1b')](handleEntityNotFound(_0xb29d57,null))[_0xab85('0x1b')](function(_0x11e47f){if(_0x11e47f&&_0x11e47f[_0xab85('0x61')]){var _0x11ca1e=_0x11e47f['get']({'plain':!![]});fs[_0xab85('0x64')](_0x157e2f);return BPromise[_0xab85('0x65')](_0x11ca1e[_0xab85('0x61')],function(_0x3ffa1b,_0x1aed0c){var _0x60fd={'from':_0x3ffa1b[_0xab85('0x66')],'to':_0x3ffa1b['to'],'subject':_0x3ffa1b[_0xab85('0x67')],'html':htmlEntities[_0xab85('0x68')](_0x3ffa1b[_0xab85('0x37')]),'headers':{'Date':moment(_0x3ffa1b['createdAt'])[_0xab85('0x4a')](_0xab85('0x69'))},'attachments':[]};if(_0x3ffa1b['cc']){_0x60fd[_0xab85('0x6a')]['Cc']=_0x3ffa1b['cc'];}if(_0x3ffa1b['bcc']){_0x60fd[_0xab85('0x6a')]['Bcc']=_0x3ffa1b[_0xab85('0x62')];}return new BPromise(function(_0x39cb56,_0x48a14b){if(_0x3ffa1b[_0xab85('0x60')]){for(var _0x1680b3=0x0;_0x1680b3<_0x3ffa1b[_0xab85('0x60')][_0xab85('0x4f')];_0x1680b3++){var _0x4e9f08=_0x3ffa1b['Attachments'][_0x1680b3];var _0x5baa8b=path['join'](_0x5202a4,_0x4e9f08[_0xab85('0x6b')]);if(fs[_0xab85('0x6c')](_0x5baa8b)){_0x60fd[_0xab85('0x6d')][_0xab85('0x5e')]({'name':_0x4e9f08['name'],'contentType':_0x4e9f08['type'],'data':fs[_0xab85('0x6e')](_0x5baa8b)});}}}emlformat[_0xab85('0x6f')](_0x60fd,function(_0xc943a9,_0x3e3c6e){if(_0xc943a9)return _0x48a14b(_0xc943a9);fs['writeFileSync'](path['join'](_0x157e2f,util['format'](_0xab85('0x70'),_0x1aed0c)),_0x3e3c6e);return _0x39cb56(_0x3e3c6e);});});})[_0xab85('0x1b')](function(){return new BPromise(function(_0x3b4441,_0x5be296){zipdir(_0x157e2f,{'saveTo':_0x11d139},function(_0x4baa86,_0x31659d){if(_0x4baa86)return _0x5be296(_0x4baa86);return _0x3b4441(_0x31659d);});})[_0xab85('0x1b')](function(){return new BPromise(function(_0xecdece,_0x1ff819){rimraf(_0x157e2f,function(_0x1c0d5a){if(_0x1c0d5a)_0x1ff819(_0x1c0d5a);return _0xecdece();});});})['then'](function(){return _0xb29d57[_0xab85('0x57')](_0x11d139,_0x3adb54,function(_0x352cb1){if(!_0x352cb1)fs[_0xab85('0x71')](_0x11d139);});});});}else{return _0xb29d57[_0xab85('0x10')](0xc8);}})[_0xab85('0x2a')](handleError(_0xb29d57,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 3f67e18..c1d2159 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 _0x1417=['getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','MailInteraction','MailMessage','remove'];(function(_0x23129b,_0x2d13ae){var _0x3b2fe9=function(_0x4cd6b7){while(--_0x4cd6b7){_0x23129b['push'](_0x23129b['shift']());}};_0x3b2fe9(++_0x2d13ae);}(_0x1417,0x17b));var _0x7141=function(_0x3b952a,_0x252725){_0x3b952a=_0x3b952a-0x0;var _0x2cc28d=_0x1417[_0x3b952a];return _0x2cc28d;};'use strict';var EventEmitter=require(_0x7141('0x0'));var MailInteraction=require(_0x7141('0x1'))['db'][_0x7141('0x2')];var MailMessage=require(_0x7141('0x1'))['db'][_0x7141('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7141('0x4')};function emitEvent(_0x425bb3){return function(_0x4581f4,_0x421f28,_0x281103){_0x4581f4[_0x7141('0x5')]({'attributes':['id'],'raw':!![]})[_0x7141('0x6')](function(_0x14484e){_0x4581f4[_0x7141('0x7')](_0x7141('0x8'),_0x14484e[_0x7141('0x9')](function(_0x16037b){return{'id':_0x16037b['id']};}));return MailMessage[_0x7141('0xa')]({'where':{'MailInteractionId':_0x4581f4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7141('0x6')](function(_0xafd5d7){_0x4581f4[_0x7141('0x7')]('unreadMessages',_0xafd5d7[_0x7141('0xb')]);MailInteractionEvents[_0x7141('0xc')](_0x425bb3+':'+_0x4581f4['id'],_0x4581f4);MailInteractionEvents[_0x7141('0xc')](_0x425bb3,_0x4581f4);_0x281103(null);})[_0x7141('0xd')](_0x281103(null));};}for(var e in events){if(events[_0x7141('0xe')](e)){var event=events[e];MailInteraction[_0x7141('0xf')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0x13a7=['remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','MailMessage','setMaxListeners','save'];(function(_0x347e60,_0x20e496){var _0xe306c5=function(_0x4f8240){while(--_0x4f8240){_0x347e60['push'](_0x347e60['shift']());}};_0xe306c5(++_0x20e496);}(_0x13a7,0x13e));var _0x713a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x13a7[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x713a('0x0'));var MailInteraction=require(_0x713a('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x713a('0x1'))['db'][_0x713a('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x713a('0x3')](0x0);var events={'afterCreate':_0x713a('0x4'),'afterUpdate':'update','afterDestroy':_0x713a('0x5')};function emitEvent(_0xe919c5){return function(_0x15cf28,_0x1e22f2,_0x3cc9ab){_0x15cf28[_0x713a('0x6')]({'attributes':['id'],'raw':!![]})[_0x713a('0x7')](function(_0x4ad1a0){_0x15cf28[_0x713a('0x8')](_0x713a('0x9'),_0x4ad1a0[_0x713a('0xa')](function(_0x4ccf50){return{'id':_0x4ccf50['id']};}));return MailMessage[_0x713a('0xb')]({'where':{'MailInteractionId':_0x15cf28['id'],'direction':'in','read':![]},'raw':!![]});})[_0x713a('0x7')](function(_0x2b1a00){_0x15cf28[_0x713a('0x8')]('unreadMessages',_0x2b1a00[_0x713a('0xc')]);MailInteractionEvents[_0x713a('0xd')](_0xe919c5+':'+_0x15cf28['id'],_0x15cf28);MailInteractionEvents[_0x713a('0xd')](_0xe919c5,_0x15cf28);_0x3cc9ab(null);})[_0x713a('0xe')](_0x3cc9ab(null));};}for(var e in events){if(events[_0x713a('0xf')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x713a('0x10')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index d2f46ee..09af342 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 _0x4b14=['lodash','../../config/logger','api','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatusAt','models','get','then','utf8mb4','utf8mb4_unicode_ci'];(function(_0x75cdb8,_0x2cd84b){var _0x34fd9f=function(_0x2decfd){while(--_0x2decfd){_0x75cdb8['push'](_0x75cdb8['shift']());}};_0x34fd9f(++_0x2cd84b);}(_0x4b14,0xa8));var _0x44b1=function(_0x5b6ac4,_0x5a1499){_0x5b6ac4=_0x5b6ac4-0x0;var _0x763bfe=_0x4b14[_0x5b6ac4];return _0x763bfe;};'use strict';var _=require(_0x44b1('0x0'));var util=require('util');var logger=require(_0x44b1('0x1'))(_0x44b1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x44b1('0x3'));var config=require(_0x44b1('0x4'));var attributes=require(_0x44b1('0x5'));module[_0x44b1('0x6')]=function(_0x4fb4a3,_0x55d2b1){return _0x4fb4a3[_0x44b1('0x7')](_0x44b1('0x8'),attributes,{'tableName':_0x44b1('0x9'),'paranoid':![],'indexes':[{'name':_0x44b1('0xa'),'fields':[_0x44b1('0xb'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x47d63e,_0x31371f,_0x31f597){if(_0x47d63e[_0x44b1('0xc')]){_0x47d63e['substatusAt']=moment()[_0x44b1('0xd')](_0x44b1('0xe'));}if(_0x47d63e[_0x44b1('0xf')]){_0x47d63e[_0x44b1('0x10')]=moment()[_0x44b1('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x31f597(null,_0x31371f);},'beforeUpdate':function(_0x578a8d,_0x45a295,_0x4530e9){if(_0x578a8d['changed'](_0x44b1('0xc'))){_0x578a8d['substatusAt']=_0x578a8d[_0x44b1('0xc')]?moment()[_0x44b1('0xd')](_0x44b1('0xe')):null;}if(_0x578a8d[_0x44b1('0x11')](_0x44b1('0xf'))){_0x578a8d[_0x44b1('0x10')]=moment()[_0x44b1('0xd')]('YYYY-MM-DD\x20HH:mm:ss');_0x578a8d['substatus']=null;_0x578a8d[_0x44b1('0x12')]=null;}_0x4530e9(null,_0x578a8d);},'afterUpdate':function(_0x40eced,_0x50a896,_0x46899d){var _0x3f0a62=_0x4fb4a3[_0x44b1('0x13')];var _0x1a4321=_0x40eced[_0x44b1('0x14')]({'plain':!![]});if(_0x1a4321[_0x44b1('0xf')]){return _0x3f0a62['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x1a4321['id']}})[_0x44b1('0x15')](function(){_0x46899d();})['catch'](function(_0x8b5b9a){_0x46899d(_0x8b5b9a);});}else{_0x46899d();}}},'charset':_0x44b1('0x16'),'collate':_0x44b1('0x17')});}; \ No newline at end of file +var _0xfd37=['utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','rimraf','exports','define','MailInteraction','subject','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','models','get','MailMessage','update','then','catch'];(function(_0x273fda,_0xf1d89f){var _0x4b72e2=function(_0x3c503e){while(--_0x3c503e){_0x273fda['push'](_0x273fda['shift']());}};_0x4b72e2(++_0xf1d89f);}(_0xfd37,0xb0));var _0x7fd3=function(_0x44e8c2,_0x3ca96d){_0x44e8c2=_0x44e8c2-0x0;var _0xafdf56=_0xfd37[_0x44e8c2];return _0xafdf56;};'use strict';var _=require('lodash');var util=require(_0x7fd3('0x0'));var logger=require(_0x7fd3('0x1'))(_0x7fd3('0x2'));var moment=require('moment');var BPromise=require(_0x7fd3('0x3'));var rp=require(_0x7fd3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7fd3('0x5'));var config=require('../../config/environment');var attributes=require('./mailInteraction.attributes');module[_0x7fd3('0x6')]=function(_0xf87458,_0x7a0e55){return _0xf87458[_0x7fd3('0x7')](_0x7fd3('0x8'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x7fd3('0x9'),'to'],'type':_0x7fd3('0xa')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5063a2,_0x17d468,_0x3df043){if(_0x5063a2[_0x7fd3('0xb')]){_0x5063a2[_0x7fd3('0xc')]=moment()['format'](_0x7fd3('0xd'));}if(_0x5063a2[_0x7fd3('0xe')]){_0x5063a2[_0x7fd3('0xf')]=moment()[_0x7fd3('0x10')](_0x7fd3('0xd'));}_0x3df043(null,_0x17d468);},'beforeUpdate':function(_0x3d68c2,_0x44c671,_0x5d75e2){if(_0x3d68c2[_0x7fd3('0x11')]('substatus')){_0x3d68c2[_0x7fd3('0xc')]=_0x3d68c2[_0x7fd3('0xb')]?moment()[_0x7fd3('0x10')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x3d68c2[_0x7fd3('0x11')]('closed')){_0x3d68c2['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3d68c2[_0x7fd3('0xb')]=null;_0x3d68c2[_0x7fd3('0xc')]=null;}_0x5d75e2(null,_0x3d68c2);},'afterUpdate':function(_0x37df82,_0xef9166,_0x474599){var _0x5e6044=_0xf87458[_0x7fd3('0x12')];var _0x1489b1=_0x37df82[_0x7fd3('0x13')]({'plain':!![]});if(_0x1489b1[_0x7fd3('0xe')]){return _0x5e6044[_0x7fd3('0x14')][_0x7fd3('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x1489b1['id']}})[_0x7fd3('0x16')](function(){_0x474599();})[_0x7fd3('0x17')](function(_0x2766f0){_0x474599(_0x2766f0);});}else{_0x474599();}}},'charset':'utf8mb4','collate':_0x7fd3('0x18')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 6353ac7..273f816 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 _0xf2e0=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','register','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','MailInteraction','body','options','raw','where','attributes','limit','UpdateMailInteraction','debug','AddTagsToMailInteraction','find','addTags','ids','spread','AddTags','lodash'];(function(_0x2c20fd,_0x2e71e2){var _0x3482d9=function(_0x254c7a){while(--_0x254c7a){_0x2c20fd['push'](_0x2c20fd['shift']());}};_0x3482d9(++_0x2e71e2);}(_0xf2e0,0xc7));var _0x0f2e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xf2e0[_0x187ee1];return _0x388160;};'use strict';var _=require(_0x0f2e('0x0'));var util=require(_0x0f2e('0x1'));var moment=require('moment');var BPromise=require(_0x0f2e('0x2'));var rs=require(_0x0f2e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f2e('0x4'))['db'];var utils=require(_0x0f2e('0x5'));var logger=require(_0x0f2e('0x6'))('rpc');var config=require(_0x0f2e('0x7'));var jayson=require(_0x0f2e('0x8'));var client=jayson[_0x0f2e('0x9')]['http']({'port':0x232a});config['redis']=_[_0x0f2e('0xa')](config['redis'],{'host':_0x0f2e('0xb'),'port':0x18eb});var socket=require(_0x0f2e('0xc'))(new Redis(config[_0x0f2e('0xd')]));require('./mailInteraction.socket')[_0x0f2e('0xe')](socket);function respondWithRpcPromise(_0x3ce553,_0x4492eb,_0x5e74a3){return new BPromise(function(_0x321f9e,_0x35c2cd){return client['request'](_0x3ce553,_0x5e74a3)[_0x0f2e('0xf')](function(_0x18b904){logger[_0x0f2e('0x10')](_0x0f2e('0x11'),_0x4492eb,_0x0f2e('0x12'));logger['debug']('MailInteraction,\x20%s,\x20%s,\x20%s',_0x4492eb,_0x0f2e('0x12'),JSON[_0x0f2e('0x13')](_0x18b904));if(_0x18b904[_0x0f2e('0x14')]){if(_0x18b904[_0x0f2e('0x14')][_0x0f2e('0x15')]===0x1f4){logger[_0x0f2e('0x14')](_0x0f2e('0x11'),_0x4492eb,_0x18b904[_0x0f2e('0x14')][_0x0f2e('0x16')]);return _0x35c2cd(_0x18b904[_0x0f2e('0x14')][_0x0f2e('0x16')]);}logger[_0x0f2e('0x14')](_0x0f2e('0x11'),_0x4492eb,_0x18b904[_0x0f2e('0x14')][_0x0f2e('0x16')]);return _0x321f9e(_0x18b904[_0x0f2e('0x14')][_0x0f2e('0x16')]);}else{logger[_0x0f2e('0x10')](_0x0f2e('0x11'),_0x4492eb,'request\x20sent');_0x321f9e(_0x18b904[_0x0f2e('0x17')][_0x0f2e('0x16')]);}})[_0x0f2e('0x18')](function(_0x553a87){logger[_0x0f2e('0x14')](_0x0f2e('0x11'),_0x4492eb,_0x553a87);_0x35c2cd(_0x553a87);});});}exports['UpdateMailInteraction']=function(_0x4dfad5){var _0x3d4ae5=this;return new Promise(function(_0x5734f1,_0xa5be54){return db[_0x0f2e('0x19')]['update'](_0x4dfad5[_0x0f2e('0x1a')],{'raw':_0x4dfad5[_0x0f2e('0x1b')]?_0x4dfad5[_0x0f2e('0x1b')][_0x0f2e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4dfad5[_0x0f2e('0x1b')]?_0x4dfad5[_0x0f2e('0x1b')][_0x0f2e('0x1d')]||null:null,'attributes':_0x4dfad5[_0x0f2e('0x1b')]?_0x4dfad5['options'][_0x0f2e('0x1e')]||null:null,'limit':_0x4dfad5[_0x0f2e('0x1b')]?_0x4dfad5[_0x0f2e('0x1b')][_0x0f2e('0x1f')]||null:null})['then'](function(_0x4c7a9e){logger[_0x0f2e('0x10')](_0x0f2e('0x20'),_0x4dfad5);logger[_0x0f2e('0x21')]('UpdateMailInteraction',_0x4dfad5,JSON['stringify'](_0x4c7a9e));_0x5734f1(_0x4c7a9e);})[_0x0f2e('0x18')](function(_0x48cd20){logger['error'](_0x0f2e('0x20'),_0x48cd20[_0x0f2e('0x16')],_0x4dfad5);_0xa5be54(_0x3d4ae5[_0x0f2e('0x14')](0x1f4,_0x48cd20[_0x0f2e('0x16')]));});});};exports[_0x0f2e('0x22')]=function(_0x4d73b0){return new Promise(function(_0x18eea3,_0x2e1256){return db[_0x0f2e('0x19')][_0x0f2e('0x23')]({'where':_0x4d73b0['options']?_0x4d73b0[_0x0f2e('0x1b')][_0x0f2e('0x1d')]||null:null})[_0x0f2e('0xf')](function(_0xe3c2d0){if(_0xe3c2d0){return _0xe3c2d0[_0x0f2e('0x24')](_0x4d73b0[_0x0f2e('0x1a')][_0x0f2e('0x25')],_['omit'](_0x4d73b0['body'],[_0x0f2e('0x25'),'id'])||{});}})[_0x0f2e('0x26')](function(_0xb8dc21){logger[_0x0f2e('0x10')](_0x0f2e('0x27'),_0x4d73b0);logger['debug'](_0x0f2e('0x27'),_0x4d73b0,JSON[_0x0f2e('0x13')](_0xb8dc21));_0x18eea3(_0xb8dc21);})[_0x0f2e('0x18')](function(_0x22a031){logger[_0x0f2e('0x14')](_0x0f2e('0x27'),_0x22a031[_0x0f2e('0x16')],_0x4d73b0);_0x2e1256(_this['error'](0x1f4,_0x22a031[_0x0f2e('0x16')]));});});}; \ No newline at end of file +var _0xbeb1=['MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','debug','stringify','AddTagsToMailInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0xbeb1,0x9b));var _0x1beb=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xbeb1[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x1beb('0x0'));var util=require(_0x1beb('0x1'));var moment=require(_0x1beb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1beb('0x3'));var db=require(_0x1beb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1beb('0x5'))(_0x1beb('0x6'));var config=require(_0x1beb('0x7'));var jayson=require(_0x1beb('0x8'));var client=jayson[_0x1beb('0x9')][_0x1beb('0xa')]({'port':0x232a});config[_0x1beb('0xb')]=_[_0x1beb('0xc')](config[_0x1beb('0xb')],{'host':_0x1beb('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1beb('0xb')]));require(_0x1beb('0xe'))[_0x1beb('0xf')](socket);function respondWithRpcPromise(_0x2e4509,_0x14f540,_0x3eff24){return new BPromise(function(_0x1c3690,_0x476c13){return client[_0x1beb('0x10')](_0x2e4509,_0x3eff24)[_0x1beb('0x11')](function(_0x368c01){logger[_0x1beb('0x12')](_0x1beb('0x13'),_0x14f540,_0x1beb('0x14'));logger['debug'](_0x1beb('0x15'),_0x14f540,'request\x20sent',JSON['stringify'](_0x368c01));if(_0x368c01[_0x1beb('0x16')]){if(_0x368c01[_0x1beb('0x16')][_0x1beb('0x17')]===0x1f4){logger[_0x1beb('0x16')]('MailInteraction,\x20%s,\x20%s',_0x14f540,_0x368c01[_0x1beb('0x16')][_0x1beb('0x18')]);return _0x476c13(_0x368c01[_0x1beb('0x16')][_0x1beb('0x18')]);}logger[_0x1beb('0x16')](_0x1beb('0x13'),_0x14f540,_0x368c01[_0x1beb('0x16')][_0x1beb('0x18')]);return _0x1c3690(_0x368c01['error'][_0x1beb('0x18')]);}else{logger[_0x1beb('0x12')](_0x1beb('0x13'),_0x14f540,'request\x20sent');_0x1c3690(_0x368c01[_0x1beb('0x19')][_0x1beb('0x18')]);}})[_0x1beb('0x1a')](function(_0x5c0b09){logger[_0x1beb('0x16')](_0x1beb('0x13'),_0x14f540,_0x5c0b09);_0x476c13(_0x5c0b09);});});}exports[_0x1beb('0x1b')]=function(_0xae2063){var _0x5f05e2=this;return new Promise(function(_0x2a24a8,_0x129f93){return db[_0x1beb('0x1c')][_0x1beb('0x1d')](_0xae2063[_0x1beb('0x1e')],{'raw':_0xae2063[_0x1beb('0x1f')]?_0xae2063[_0x1beb('0x1f')][_0x1beb('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xae2063[_0x1beb('0x1f')]?_0xae2063[_0x1beb('0x1f')][_0x1beb('0x21')]||null:null,'attributes':_0xae2063['options']?_0xae2063[_0x1beb('0x1f')][_0x1beb('0x22')]||null:null,'limit':_0xae2063[_0x1beb('0x1f')]?_0xae2063['options'][_0x1beb('0x23')]||null:null})[_0x1beb('0x11')](function(_0x57dacb){logger[_0x1beb('0x12')](_0x1beb('0x1b'),_0xae2063);logger[_0x1beb('0x24')]('UpdateMailInteraction',_0xae2063,JSON[_0x1beb('0x25')](_0x57dacb));_0x2a24a8(_0x57dacb);})['catch'](function(_0x2fabd7){logger['error'](_0x1beb('0x1b'),_0x2fabd7[_0x1beb('0x18')],_0xae2063);_0x129f93(_0x5f05e2[_0x1beb('0x16')](0x1f4,_0x2fabd7[_0x1beb('0x18')]));});});};exports[_0x1beb('0x26')]=function(_0xc13c42){return new Promise(function(_0x9cf4c9,_0x415ec3){return db[_0x1beb('0x1c')][_0x1beb('0x27')]({'where':_0xc13c42[_0x1beb('0x1f')]?_0xc13c42[_0x1beb('0x1f')][_0x1beb('0x21')]||null:null})[_0x1beb('0x11')](function(_0x3c9be9){if(_0x3c9be9){return _0x3c9be9[_0x1beb('0x28')](_0xc13c42[_0x1beb('0x1e')][_0x1beb('0x29')],_['omit'](_0xc13c42['body'],[_0x1beb('0x29'),'id'])||{});}})[_0x1beb('0x2a')](function(_0x119825){logger[_0x1beb('0x12')]('AddTags',_0xc13c42);logger[_0x1beb('0x24')](_0x1beb('0x2b'),_0xc13c42,JSON['stringify'](_0x119825));_0x9cf4c9(_0x119825);})[_0x1beb('0x1a')](function(_0x4ea90f){logger[_0x1beb('0x16')](_0x1beb('0x2b'),_0x4ea90f[_0x1beb('0x18')],_0xc13c42);_0x415ec3(_this[_0x1beb('0x16')](0x1f4,_0x4ea90f[_0x1beb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 9aba325..57fc6cf 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 _0x3bef=['length','./mailInteraction.events','save','remove','update','removeListener','register'];(function(_0x1fcf1b,_0x214549){var _0x5d2952=function(_0x3331b7){while(--_0x3331b7){_0x1fcf1b['push'](_0x1fcf1b['shift']());}};_0x5d2952(++_0x214549);}(_0x3bef,0xef));var _0xf3be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3bef[_0x3dd15e];return _0x231fd0;};'use strict';var MailInteractionEvents=require(_0xf3be('0x0'));var events=[_0xf3be('0x1'),_0xf3be('0x2'),_0xf3be('0x3')];function createListener(_0x33711c,_0x5cdeed){return function(_0x20c7b6){_0x5cdeed['emit'](_0x33711c,_0x20c7b6);};}function removeListener(_0x1707e6,_0x4e2066){return function(){MailInteractionEvents[_0xf3be('0x4')](_0x1707e6,_0x4e2066);};}exports[_0xf3be('0x5')]=function(_0x3f5f3a){for(var _0x4a6df8=0x0,_0x1d2161=events[_0xf3be('0x6')];_0x4a6df8<_0x1d2161;_0x4a6df8++){var _0x521b3f=events[_0x4a6df8];var _0x560e2a=createListener('mailInteraction:'+_0x521b3f,_0x3f5f3a);MailInteractionEvents['on'](_0x521b3f,_0x560e2a);}}; \ No newline at end of file +var _0xff0e=['save','update','emit','removeListener','register','length','./mailInteraction.events'];(function(_0x5730a1,_0x33226e){var _0x37b7ec=function(_0x1846ab){while(--_0x1846ab){_0x5730a1['push'](_0x5730a1['shift']());}};_0x37b7ec(++_0x33226e);}(_0xff0e,0x1db));var _0xeff0=function(_0x22fcad,_0x404cf0){_0x22fcad=_0x22fcad-0x0;var _0x3d30f0=_0xff0e[_0x22fcad];return _0x3d30f0;};'use strict';var MailInteractionEvents=require(_0xeff0('0x0'));var events=[_0xeff0('0x1'),'remove',_0xeff0('0x2')];function createListener(_0x5283be,_0x17d03d){return function(_0x1f1b2f){_0x17d03d[_0xeff0('0x3')](_0x5283be,_0x1f1b2f);};}function removeListener(_0x4009a3,_0xc70907){return function(){MailInteractionEvents[_0xeff0('0x4')](_0x4009a3,_0xc70907);};}exports[_0xeff0('0x5')]=function(_0x23a3cd){for(var _0x2ceb34=0x0,_0x29b52f=events[_0xeff0('0x6')];_0x2ceb34<_0x29b52f;_0x2ceb34++){var _0x46cc90=events[_0x2ceb34];var _0x2c7552=createListener('mailInteraction:'+_0x46cc90,_0x23a3cd);MailInteractionEvents['on'](_0x46cc90,_0x2c7552);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 19c9845..61b9c24 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 _0x977c=['delete','destroy','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','/describe','show','post','tracked','mailmessage:create','create','/:id','put','/:id/accept','accept'];(function(_0x479a82,_0x274a85){var _0x544ec7=function(_0x54009a){while(--_0x54009a){_0x479a82['push'](_0x479a82['shift']());}};_0x544ec7(++_0x274a85);}(_0x977c,0x1d0));var _0xc977=function(_0x2ef559,_0x5b7ba1){_0x2ef559=_0x2ef559-0x0;var _0x5e30fc=_0x977c[_0x2ef559];return _0x5e30fc;};'use strict';var multer=require('multer');var util=require(_0xc977('0x0'));var path=require(_0xc977('0x1'));var timeout=require(_0xc977('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc977('0x3'));var auth=require(_0xc977('0x4'));var interaction=require(_0xc977('0x5'));var config=require(_0xc977('0x6'));var controller=require(_0xc977('0x7'));router[_0xc977('0x8')]('/',auth[_0xc977('0x9')](),controller['index']);router[_0xc977('0x8')](_0xc977('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xc977('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xc977('0xb')]);router['get']('/:id/download',auth[_0xc977('0x9')](),controller['download']);router[_0xc977('0xc')]('/',auth[_0xc977('0x9')](),interaction[_0xc977('0xd')]('mail',_0xc977('0xe')),controller[_0xc977('0xf')]);router['put'](_0xc977('0x10'),auth[_0xc977('0x9')](),controller['update']);router[_0xc977('0x11')](_0xc977('0x12'),auth[_0xc977('0x9')](),controller[_0xc977('0x13')]);router[_0xc977('0x11')]('/:id/reject',auth[_0xc977('0x9')](),controller['reject']);router[_0xc977('0x14')](_0xc977('0x10'),auth[_0xc977('0x9')](),controller[_0xc977('0x15')]);module['exports']=router; \ No newline at end of file +var _0xfc61=['../../components/interaction/service','../../config/environment','./mailMessage.controller','index','get','/describe','isAuthenticated','describe','/:id','show','download','tracked','mail','mailmessage:create','update','put','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','../../components/auth/service'];(function(_0x1a82bc,_0x2edc75){var _0x32f1d9=function(_0x19fea5){while(--_0x19fea5){_0x1a82bc['push'](_0x1a82bc['shift']());}};_0x32f1d9(++_0x2edc75);}(_0xfc61,0x78));var _0x1fc6=function(_0x1dc65a,_0x53feb7){_0x1dc65a=_0x1dc65a-0x0;var _0x1da8ef=_0xfc61[_0x1dc65a];return _0x1da8ef;};'use strict';var multer=require(_0x1fc6('0x0'));var util=require(_0x1fc6('0x1'));var path=require(_0x1fc6('0x2'));var timeout=require(_0x1fc6('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1fc6('0x4'));var interaction=require(_0x1fc6('0x5'));var config=require(_0x1fc6('0x6'));var controller=require(_0x1fc6('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x1fc6('0x8')]);router[_0x1fc6('0x9')](_0x1fc6('0xa'),auth[_0x1fc6('0xb')](),controller[_0x1fc6('0xc')]);router['get'](_0x1fc6('0xd'),auth[_0x1fc6('0xb')](),controller[_0x1fc6('0xe')]);router[_0x1fc6('0x9')]('/:id/download',auth[_0x1fc6('0xb')](),controller[_0x1fc6('0xf')]);router['post']('/',auth[_0x1fc6('0xb')](),interaction[_0x1fc6('0x10')](_0x1fc6('0x11'),_0x1fc6('0x12')),controller['create']);router['put'](_0x1fc6('0xd'),auth[_0x1fc6('0xb')](),controller[_0x1fc6('0x13')]);router['put']('/:id/accept',auth[_0x1fc6('0xb')](),controller['accept']);router[_0x1fc6('0x14')](_0x1fc6('0x15'),auth[_0x1fc6('0xb')](),controller[_0x1fc6('0x16')]);router[_0x1fc6('0x17')](_0x1fc6('0xd'),auth[_0x1fc6('0xb')](),controller[_0x1fc6('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 0dcaf58..aa39e06 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 _0x8f67=['BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Email','lodash','TEXT','long','medium'];(function(_0x2b3338,_0x45846e){var _0x15fbc8=function(_0x3d5916){while(--_0x3d5916){_0x2b3338['push'](_0x2b3338['shift']());}};_0x15fbc8(++_0x45846e);}(_0x8f67,0x1bf));var _0x78f6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8f67[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var _=require(_0x78f6('0x0'));module['exports']={'body':{'type':Sequelize[_0x78f6('0x1')](_0x78f6('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x78f6('0x3'))},'read':{'type':Sequelize[_0x78f6('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x78f6('0x5')]('in','out'),'defaultValue':_0x78f6('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x78f6('0x7')](0x1fe)},'from':{'type':Sequelize[_0x78f6('0x7')]},'to':{'type':Sequelize[_0x78f6('0x1')](_0x78f6('0x2'))},'cc':{'type':Sequelize['TEXT'](_0x78f6('0x2'))},'bcc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0x78f6('0x1')]},'sentAt':{'type':Sequelize[_0x78f6('0x8')]},'attach':{'type':Sequelize[_0x78f6('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x78f6('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x78f6('0x8')]},'originTo':{'type':Sequelize[_0x78f6('0x1')](_0x78f6('0x2'))},'originCc':{'type':Sequelize[_0x78f6('0x1')](_0x78f6('0x2'))},'originChannel':{'type':Sequelize['ENUM'](_0x78f6('0xa'),'Chat'),'defaultValue':_0x78f6('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0x8c75=['ENUM','Chat','Email','sequelize','lodash','long','medium','out','STRING','TEXT','DATE','INTEGER','BOOLEAN'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x8c75,0x1b0));var _0x58c7=function(_0x228aa4,_0x5d1e3c){_0x228aa4=_0x228aa4-0x0;var _0x3e5448=_0x8c75[_0x228aa4];return _0x3e5448;};'use strict';var Sequelize=require(_0x58c7('0x0'));var _=require(_0x58c7('0x1'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x58c7('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x58c7('0x3'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x58c7('0x4')),'defaultValue':_0x58c7('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x58c7('0x5')](0x1fe)},'from':{'type':Sequelize[_0x58c7('0x5')]},'to':{'type':Sequelize[_0x58c7('0x6')](_0x58c7('0x2'))},'cc':{'type':Sequelize[_0x58c7('0x6')](_0x58c7('0x2'))},'bcc':{'type':Sequelize['TEXT'](_0x58c7('0x2'))},'subject':{'type':Sequelize[_0x58c7('0x6')]},'sentAt':{'type':Sequelize[_0x58c7('0x7')]},'attach':{'type':Sequelize[_0x58c7('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x58c7('0x9')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x58c7('0x6')](_0x58c7('0x2'))},'originCc':{'type':Sequelize['TEXT'](_0x58c7('0x2'))},'originChannel':{'type':Sequelize[_0x58c7('0xa')]('Email',_0x58c7('0xb')),'defaultValue':_0x58c7('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 5f4999c..37dc75d 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 _0x6fdf=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','include','rows','show','keys','includeAll','options','find','body','params','describe','create','direction','out','secret','split','findOne','List','CmContact','Contacts','CloudProvider','Smtp','getSmtpOptions','attachments','root','basename','defaults','ListId','List\x20not\x20found','SendMail','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','UserId','user','agent','get','MailInteraction','MailInteractionId','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','fromString','rejectmessage','download','unix','join','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','Bcc','Attachments','push','readFileSync','build','writeFileSync','eml-format','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','mail-interactions','../../config/environment','redis','localhost','socket.io-emitter','html-entities','./mailMessage.socket','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','end','sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes'];(function(_0x5ed58d,_0x13381b){var _0x38537d=function(_0x5b729e){while(--_0x5b729e){_0x5ed58d['push'](_0x5ed58d['shift']());}};_0x38537d(++_0x13381b);}(_0x6fdf,0x101));var _0xf6fd=function(_0x2fa278,_0x308912){_0x2fa278=_0x2fa278-0x0;var _0x32e4b=_0x6fdf[_0x2fa278];return _0x32e4b;};'use strict';var emlformat=require(_0xf6fd('0x0'));var moment=require(_0xf6fd('0x1'));var BPromise=require(_0xf6fd('0x2'));var util=require(_0xf6fd('0x3'));var path=require(_0xf6fd('0x4'));var fs=require('fs');var _=require(_0xf6fd('0x5'));var Redis=require(_0xf6fd('0x6'));var htmlToText=require(_0xf6fd('0x7'));var qs=require(_0xf6fd('0x8'));var logger=require(_0xf6fd('0x9'))('api');var interaction_log=require(_0xf6fd('0x9'))(_0xf6fd('0xa'));var config=require(_0xf6fd('0xb'));var db=require('../../mysqldb')['db'];config[_0xf6fd('0xc')]=_['defaults'](config[_0xf6fd('0xc')],{'host':_0xf6fd('0xd'),'port':0x18eb});var socket=require(_0xf6fd('0xe'))(new Redis(config['redis']));var htmlEntities=require(_0xf6fd('0xf'));require(_0xf6fd('0x10'))['register'](socket);var jayson=require(_0xf6fd('0x11'));var client=jayson[_0xf6fd('0x12')][_0xf6fd('0x13')]({'port':0x232c});var client9003=jayson['client']['http']({'port':0x232b});var client9002=jayson[_0xf6fd('0x12')][_0xf6fd('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x403b19,_0x3450ab,_0x462c1f,_0xfceb){return new BPromise(function(_0x397c5d,_0x442ebf){var _0x1fc947=_0xfceb||client;return _0x1fc947[_0xf6fd('0x14')](_0x403b19,_0x462c1f)[_0xf6fd('0x15')](function(_0x4ebda4){logger[_0xf6fd('0x16')](_0xf6fd('0x17'),_0x3450ab,_0xf6fd('0x18'));logger[_0xf6fd('0x19')](_0xf6fd('0x1a'),_0x3450ab,_0xf6fd('0x18'),JSON[_0xf6fd('0x1b')](_0x4ebda4));if(_0x4ebda4[_0xf6fd('0x1c')]){if(_0x4ebda4[_0xf6fd('0x1c')][_0xf6fd('0x1d')]===0x1f4){logger[_0xf6fd('0x1c')]('MailMessage,\x20%s,\x20%s',_0x3450ab,_0x4ebda4[_0xf6fd('0x1c')][_0xf6fd('0x1e')]);return _0x442ebf(_0x4ebda4[_0xf6fd('0x1c')][_0xf6fd('0x1e')]);}logger[_0xf6fd('0x1c')](_0xf6fd('0x17'),_0x3450ab,_0x4ebda4['error'][_0xf6fd('0x1e')]);return _0x397c5d(_0x4ebda4[_0xf6fd('0x1c')][_0xf6fd('0x1e')]);}else{logger[_0xf6fd('0x16')](_0xf6fd('0x17'),_0x3450ab,_0xf6fd('0x18'));_0x397c5d(_0x4ebda4[_0xf6fd('0x1f')][_0xf6fd('0x1e')]);}})[_0xf6fd('0x20')](function(_0x31a9b7){logger[_0xf6fd('0x1c')](_0xf6fd('0x17'),_0x3450ab,_0x31a9b7);_0x442ebf(_0x31a9b7);});});}function respondWithResult(_0x5a2de4,_0x44b82a){_0x44b82a=_0x44b82a||0xc8;return function(_0x428790){if(_0x428790){return _0x5a2de4[_0xf6fd('0x21')](_0x44b82a)[_0xf6fd('0x22')](_0x428790);}};}function respondWithFilteredResult(_0x196f7a,_0x20f90a){return function(_0x1cb094){if(_0x1cb094){var _0x24bf70=typeof _0x20f90a[_0xf6fd('0x23')]===_0xf6fd('0x24')&&typeof _0x20f90a[_0xf6fd('0x25')]===_0xf6fd('0x24');var _0x1bf173=_0x1cb094[_0xf6fd('0x26')];var _0x4d5be3=_0x24bf70?0x0:_0x20f90a[_0xf6fd('0x23')];var _0x499843=_0x24bf70?_0x1cb094['count']:_0x20f90a[_0xf6fd('0x23')]+_0x20f90a[_0xf6fd('0x25')];var _0x50016a;if(_0x499843>=_0x1bf173){_0x499843=_0x1bf173;_0x50016a=0xc8;}else{_0x50016a=0xce;}_0x196f7a[_0xf6fd('0x21')](_0x50016a);return _0x196f7a[_0xf6fd('0x27')](_0xf6fd('0x28'),_0x4d5be3+'-'+_0x499843+'/'+_0x1bf173)[_0xf6fd('0x22')](_0x1cb094);}return null;};}function saveUpdates(_0x28b03a){return function(_0x4ab341){if(_0x4ab341){return _0x4ab341[_0xf6fd('0x29')](_0x28b03a)[_0xf6fd('0x15')](function(_0x4d59f6){return _0x4d59f6;});}return null;};}function removeEntity(_0x2ab305){return function(_0x361843){if(_0x361843){return _0x361843['destroy']()['then'](function(){_0x2ab305[_0xf6fd('0x21')](0xcc)[_0xf6fd('0x2a')]();});}};}function handleEntityNotFound(_0x23bef7){return function(_0x352463){if(!_0x352463){_0x23bef7[_0xf6fd('0x2b')](0x194);}return _0x352463;};}function handleError(_0x5dafaa,_0x3859b7){_0x3859b7=_0x3859b7||0x1f4;return function(_0x41558a){logger['error'](_0x41558a[_0xf6fd('0x2c')]);if(_0x41558a[_0xf6fd('0x2d')]){delete _0x41558a['name'];}_0x5dafaa['status'](_0x3859b7)[_0xf6fd('0x2e')](_0x41558a);};}exports[_0xf6fd('0x2f')]=function(_0x497553,_0x40069c){var _0xdac244={},_0x1385f6={},_0x26c0b3={'count':0x0,'rows':[]};var _0x58e7a2=_[_0xf6fd('0x30')](db[_0xf6fd('0x31')][_0xf6fd('0x32')],function(_0x2b02fd){return{'name':_0x2b02fd[_0xf6fd('0x33')],'type':_0x2b02fd[_0xf6fd('0x34')][_0xf6fd('0x35')]};});_0x1385f6[_0xf6fd('0x36')]=_[_0xf6fd('0x30')](_0x58e7a2,'name');_0x1385f6[_0xf6fd('0x37')]=_['keys'](_0x497553[_0xf6fd('0x37')]);_0x1385f6[_0xf6fd('0x38')]=_[_0xf6fd('0x39')](_0x1385f6['model'],_0x1385f6[_0xf6fd('0x37')]);_0xdac244[_0xf6fd('0x3a')]=_[_0xf6fd('0x39')](_0x1385f6[_0xf6fd('0x36')],qs[_0xf6fd('0x3b')](_0x497553[_0xf6fd('0x37')][_0xf6fd('0x3b')]));_0xdac244[_0xf6fd('0x3a')]=_0xdac244[_0xf6fd('0x3a')][_0xf6fd('0x3c')]?_0xdac244[_0xf6fd('0x3a')]:_0x1385f6[_0xf6fd('0x36')];if(!_0x497553[_0xf6fd('0x37')][_0xf6fd('0x3d')](_0xf6fd('0x3e'))){_0xdac244[_0xf6fd('0x25')]=qs[_0xf6fd('0x25')](_0x497553[_0xf6fd('0x37')]['limit']);_0xdac244[_0xf6fd('0x23')]=qs['offset'](_0x497553['query']['offset']);}_0xdac244[_0xf6fd('0x3f')]=qs[_0xf6fd('0x40')](_0x497553[_0xf6fd('0x37')][_0xf6fd('0x40')]);_0xdac244[_0xf6fd('0x41')]=qs['filters'](_[_0xf6fd('0x42')](_0x497553[_0xf6fd('0x37')],_0x1385f6[_0xf6fd('0x38')]),_0x58e7a2);if(_0x497553['query'][_0xf6fd('0x43')]){_0xdac244[_0xf6fd('0x41')]=_['merge'](_0xdac244[_0xf6fd('0x41')],{'$or':_[_0xf6fd('0x30')](_0x58e7a2,function(_0xf170d3){if(_0xf170d3[_0xf6fd('0x34')]!==_0xf6fd('0x44')){var _0xa3c39d={};_0xa3c39d[_0xf170d3[_0xf6fd('0x2d')]]={'$like':'%'+_0x497553[_0xf6fd('0x37')][_0xf6fd('0x43')]+'%'};return _0xa3c39d;}})});}_0xdac244=_[_0xf6fd('0x45')]({},_0xdac244,_0x497553['options']);var _0x37b491={'where':_0xdac244[_0xf6fd('0x41')]};return db[_0xf6fd('0x31')][_0xf6fd('0x26')](_0x37b491)[_0xf6fd('0x15')](function(_0x290fb8){_0x26c0b3[_0xf6fd('0x26')]=_0x290fb8;if(_0x497553[_0xf6fd('0x37')]['includeAll']){_0xdac244[_0xf6fd('0x46')]=[{'all':!![]}];}return db[_0xf6fd('0x31')]['findAll'](_0xdac244);})['then'](function(_0x223ded){_0x26c0b3[_0xf6fd('0x47')]=_0x223ded;return _0x26c0b3;})[_0xf6fd('0x15')](respondWithFilteredResult(_0x40069c,_0xdac244))['catch'](handleError(_0x40069c,null));};exports[_0xf6fd('0x48')]=function(_0x1f9e91,_0x3652c1){var _0x8a8db1={'raw':!![],'where':{'id':_0x1f9e91['params']['id']}},_0x366c02={};_0x366c02[_0xf6fd('0x36')]=_[_0xf6fd('0x49')](db[_0xf6fd('0x31')][_0xf6fd('0x32')]);_0x366c02[_0xf6fd('0x37')]=_[_0xf6fd('0x49')](_0x1f9e91[_0xf6fd('0x37')]);_0x366c02['filters']=_[_0xf6fd('0x39')](_0x366c02[_0xf6fd('0x36')],_0x366c02[_0xf6fd('0x37')]);_0x8a8db1[_0xf6fd('0x3a')]=_[_0xf6fd('0x39')](_0x366c02[_0xf6fd('0x36')],qs[_0xf6fd('0x3b')](_0x1f9e91['query']['fields']));_0x8a8db1[_0xf6fd('0x3a')]=_0x8a8db1['attributes'][_0xf6fd('0x3c')]?_0x8a8db1[_0xf6fd('0x3a')]:_0x366c02['model'];if(_0x1f9e91['query'][_0xf6fd('0x4a')]){_0x8a8db1[_0xf6fd('0x46')]=[{'all':!![]}];}_0x8a8db1=_['merge']({},_0x8a8db1,_0x1f9e91[_0xf6fd('0x4b')]);return db['MailMessage'][_0xf6fd('0x4c')](_0x8a8db1)[_0xf6fd('0x15')](handleEntityNotFound(_0x3652c1,null))[_0xf6fd('0x15')](respondWithResult(_0x3652c1,null))[_0xf6fd('0x20')](handleError(_0x3652c1,null));};exports[_0xf6fd('0x29')]=function(_0x31b44d,_0x57479b){if(_0x31b44d[_0xf6fd('0x4d')]['id']){delete _0x31b44d['body']['id'];}return db[_0xf6fd('0x31')]['find']({'where':{'id':_0x31b44d['params']['id']}})[_0xf6fd('0x15')](handleEntityNotFound(_0x57479b,null))[_0xf6fd('0x15')](saveUpdates(_0x31b44d[_0xf6fd('0x4d')],null))[_0xf6fd('0x15')](respondWithResult(_0x57479b,null))[_0xf6fd('0x20')](handleError(_0x57479b,null));};exports['destroy']=function(_0xfb1f24,_0x4ed992){return db[_0xf6fd('0x31')][_0xf6fd('0x4c')]({'where':{'id':_0xfb1f24[_0xf6fd('0x4e')]['id']}})[_0xf6fd('0x15')](handleEntityNotFound(_0x4ed992,null))[_0xf6fd('0x15')](removeEntity(_0x4ed992,null))[_0xf6fd('0x20')](handleError(_0x4ed992,null));};exports[_0xf6fd('0x4f')]=function(_0x5818dd,_0x5cc0d3){return db[_0xf6fd('0x31')][_0xf6fd('0x4f')]()[_0xf6fd('0x15')](respondWithResult(_0x5cc0d3,null))[_0xf6fd('0x20')](handleError(_0x5cc0d3,null));};exports[_0xf6fd('0x50')]=function(_0x1714c3,_0x3d0367){return db[_0xf6fd('0x31')]['create'](_0x1714c3['body'])['then'](function(_0x5750c1){if(_0x5750c1){if(_0x5750c1[_0xf6fd('0x51')]===_0xf6fd('0x52')&&!_0x5750c1[_0xf6fd('0x53')]){var _0x2be26d,_0x420b39,_0x3f290c;if(_0x1714c3['body']['to']){_0x420b39=_0x1714c3[_0xf6fd('0x4d')]['to'][_0xf6fd('0x54')](',')[0x0];}return db['MailAccount'][_0xf6fd('0x55')]({'where':{'id':_0x5750c1['MailAccountId']},'include':[{'model':db['CmList'],'as':_0xf6fd('0x56'),'include':[{'model':db[_0xf6fd('0x57')],'as':_0xf6fd('0x58'),'where':{'email':_0x420b39},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0xf6fd('0x59')],'as':_0xf6fd('0x59'),'raw':!![]}]}]})[_0xf6fd('0x15')](function(_0xa67494){_0x2be26d=_0xa67494;if(!_0x2be26d||!_0x2be26d[_0xf6fd('0x5a')])return;var _0x261be4=_0x2be26d[_0xf6fd('0x5b')]();if(_0x1714c3[_0xf6fd('0x4d')][_0xf6fd('0x5c')]&&_0x1714c3[_0xf6fd('0x4d')][_0xf6fd('0x5c')]['length']){for(var _0x2dbf16=0x0;_0x2dbf16<_0x1714c3['body'][_0xf6fd('0x5c')]['length'];_0x2dbf16+=0x1){_0x1714c3[_0xf6fd('0x4d')]['attachments'][_0x2dbf16]={'filename':_0x1714c3[_0xf6fd('0x4d')][_0xf6fd('0x5c')][_0x2dbf16][_0xf6fd('0x2d')],'path':path['join'](config[_0xf6fd('0x5d')],'server/files/attachments',_0x1714c3['body']['attachments'][_0x2dbf16][_0xf6fd('0x5e')])};}}_0x3f290c={'account':_0x261be4,'message':_0x1714c3['body']};return;})['then'](function(){if(_0x2be26d[_0xf6fd('0x56')]){if(_0x2be26d[_0xf6fd('0x56')]['Contacts'][_0xf6fd('0x3c')]){return _0x2be26d[_0xf6fd('0x56')][_0xf6fd('0x58')][0x0];}else{return db['CmContact']['create'](_[_0xf6fd('0x5f')](_0x1714c3[_0xf6fd('0x4d')],{'firstName':_0x1714c3[_0xf6fd('0x4d')]['to'],'email':_0x1714c3[_0xf6fd('0x4d')]['to'],'phone':_0x1714c3[_0xf6fd('0x4d')]['to'],'ListId':_0x2be26d[_0xf6fd('0x60')]}));}}else{throw new Error(_0xf6fd('0x61'));}})[_0xf6fd('0x15')](function(){if(_0x3f290c){return respondWithRpcPromise(_0xf6fd('0x62'),'sendMail',_0x3f290c,client9003)[_0xf6fd('0x15')](function(_0x5a5150){return _0x5750c1[_0xf6fd('0x29')]({'read':!![],'messageId':_0x5a5150['messageId'],'sentAt':moment()[_0xf6fd('0x63')](_0xf6fd('0x64'))});})[_0xf6fd('0x20')](function(_0x174373){logger[_0xf6fd('0x1c')]('%s',JSON['stringify'](_0x174373));return _0x5750c1;});}return _0x5750c1;});}return _0x5750c1;}})[_0xf6fd('0x15')](respondWithResult(_0x3d0367,0xc9))[_0xf6fd('0x20')](handleError(_0x3d0367,null));};exports[_0xf6fd('0x65')]=function(_0x5e8444,_0x3135fd){var _0x3bae2e={'agent':{},'channel':_0xf6fd('0x66')};if(_0x5e8444[_0xf6fd('0x4d')]['id']){delete _0x5e8444[_0xf6fd('0x4d')]['id'];}_0x5e8444[_0xf6fd('0x4d')]['read']=!![];_0x5e8444['body']['readAt']=moment()[_0xf6fd('0x63')](_0xf6fd('0x64'));_0x5e8444[_0xf6fd('0x4d')][_0xf6fd('0x67')]=_0x5e8444[_0xf6fd('0x4d')][_0xf6fd('0x67')]||_0x5e8444[_0xf6fd('0x68')]['id'];_0x3bae2e[_0xf6fd('0x69')]['id']=_0x5e8444[_0xf6fd('0x4d')][_0xf6fd('0x67')];return db[_0xf6fd('0x31')]['find']({'where':{'id':_0x5e8444[_0xf6fd('0x4e')]['id'],'UserId':null}})[_0xf6fd('0x15')](handleEntityNotFound(_0x3135fd,null))[_0xf6fd('0x15')](saveUpdates(_0x5e8444[_0xf6fd('0x4d')],null))[_0xf6fd('0x15')](function(_0x5c5189){if(_0x5c5189){_0x3bae2e[_0xf6fd('0x1e')]=_0x5c5189[_0xf6fd('0x6a')]({'plain':!![]});return db[_0xf6fd('0x6b')][_0xf6fd('0x4c')]({'where':{'id':_0x5c5189[_0xf6fd('0x6c')]}});}return null;})[_0xf6fd('0x15')](handleEntityNotFound(_0x3135fd,null))[_0xf6fd('0x15')](function(_0x3adb4f){if(_0x3adb4f){return _0x3adb4f[_0xf6fd('0x29')]({'UserId':_0x5e8444[_0xf6fd('0x4d')][_0xf6fd('0x67')],'read1stAt':_['isNil'](_0x3adb4f['read1stAt'])?moment()['format'](_0xf6fd('0x64')):undefined});}return null;})['then'](function(_0x43e82c){if(_0x43e82c){_0x3bae2e['interaction']=_0x43e82c[_0xf6fd('0x6a')]({'plain':!![]});interaction_log[_0xf6fd('0x16')](_0xf6fd('0x6d'),_0x5e8444['user']['id'],_0x5e8444['user']['name'],_0x5e8444[_0xf6fd('0x68')]['role'],_0x3bae2e[_0xf6fd('0x6e')]['id'],_0x5e8444['body']?JSON[_0xf6fd('0x1b')](_0x5e8444[_0xf6fd('0x4d')]):_0xf6fd('0x6f'));return respondWithRpcPromise(_0xf6fd('0x70'),_0xf6fd('0x71'),_0x3bae2e);}return null;})[_0xf6fd('0x15')](function(_0x2db986){var _0x4ecab4=_0xf6fd('0x72')+_0x2db986[_0xf6fd('0x1e')][_0xf6fd('0x73')];return db[_0xf6fd('0x74')]['query'](_0x4ecab4,{'type':db[_0xf6fd('0x75')][_0xf6fd('0x76')][_0xf6fd('0x77')],'raw':!![]})[_0xf6fd('0x15')](function(_0x31d3a0){return _0x31d3a0;});})[_0xf6fd('0x15')](function(_0x16475b){if(_0x16475b){_0x3bae2e[_0xf6fd('0x1e')][_0xf6fd('0x78')]=_0x16475b[0x0];if(!_0x5e8444[_0xf6fd('0x4d')][_0xf6fd('0x67')])return;return db['User']['find']({'where':{'id':_0x5e8444[_0xf6fd('0x4d')]['UserId'],'role':_0xf6fd('0x69')},'attributes':['id','name',_0xf6fd('0x79'),_0xf6fd('0x7a'),_0xf6fd('0x7b')],'raw':!![]});}return null;})['then'](function(_0x55617e){if(!_0x55617e)return null;_0x3bae2e[_0xf6fd('0x1e')]['agent']=_0x55617e;return _0x3bae2e;})[_0xf6fd('0x15')](function(_0x2a9bb5){if(_0x2a9bb5){if(_0x5e8444['body'][_0xf6fd('0x7c')]){_0x3bae2e[_0xf6fd('0x1e')][_0xf6fd('0x7d')]=util[_0xf6fd('0x63')](_0xf6fd('0x7e'),_0x5e8444[_0xf6fd('0x68')][_0xf6fd('0x2d')]);_0x3bae2e[_0xf6fd('0x1e')][_0xf6fd('0x7f')]=_0x3bae2e['channel'];_0x3bae2e[_0xf6fd('0x1e')][_0xf6fd('0x80')]=_0x3bae2e[_0xf6fd('0x7f')];_0x3bae2e['message'][_0xf6fd('0x81')]=_0xf6fd('0x65');_0x3bae2e['message'][_0xf6fd('0x4d')]=htmlToText['fromString'](_0x3bae2e['message'][_0xf6fd('0x4d')]);return respondWithRpcPromise('EventManager',_0xf6fd('0x82'),{'event':_0xf6fd('0x83'),'message':_0x3bae2e[_0xf6fd('0x1e')]},client9002)[_0xf6fd('0x15')](function(){return _0x3bae2e;});}return _0x3bae2e;}return null;})[_0xf6fd('0x15')](respondWithResult(_0x3135fd,null))[_0xf6fd('0x20')](handleError(_0x3135fd,null));};exports[_0xf6fd('0x84')]=function(_0x58b772,_0x33237a){var _0x205878={'agent':{},'channel':_0xf6fd('0x66')};if(_0x58b772[_0xf6fd('0x4d')]['id']){delete _0x58b772['body']['id'];}_0x58b772[_0xf6fd('0x4d')][_0xf6fd('0x67')]=_0x58b772[_0xf6fd('0x4d')][_0xf6fd('0x67')]||_0x58b772['user']['id'];_0x205878['agent']['id']=_0x58b772[_0xf6fd('0x4d')][_0xf6fd('0x67')];return db[_0xf6fd('0x31')][_0xf6fd('0x4c')]({'where':{'id':_0x58b772['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x33237a,null))[_0xf6fd('0x15')](function(_0x3436fa){if(_0x3436fa){_0x205878['message']=_0x3436fa[_0xf6fd('0x6a')]({'plain':!![]});return db['MailInteraction'][_0xf6fd('0x4c')]({'where':{'id':_0x3436fa['MailInteractionId']}});}return null;})[_0xf6fd('0x15')](handleEntityNotFound(_0x33237a,null))[_0xf6fd('0x15')](function(_0xd54579){if(_0xd54579){_0x205878[_0xf6fd('0x6e')]=_0xd54579[_0xf6fd('0x6a')]({'plain':!![]});interaction_log[_0xf6fd('0x16')](_0xf6fd('0x85'),_0x58b772[_0xf6fd('0x68')]['id'],_0x58b772[_0xf6fd('0x68')][_0xf6fd('0x2d')],_0x58b772[_0xf6fd('0x68')][_0xf6fd('0x86')],_0x205878[_0xf6fd('0x6e')]['id'],_0x58b772['body']?JSON[_0xf6fd('0x1b')](_0x58b772[_0xf6fd('0x4d')]):'null');return respondWithRpcPromise(_0xf6fd('0x87'),_0xf6fd('0x88'),_0x205878);}return null;})[_0xf6fd('0x15')](function(_0x4441d8){var _0x1bc672='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4441d8['message'][_0xf6fd('0x73')];return db[_0xf6fd('0x74')]['query'](_0x1bc672,{'type':db[_0xf6fd('0x75')][_0xf6fd('0x76')][_0xf6fd('0x77')],'raw':!![]})[_0xf6fd('0x15')](function(_0x124986){return _0x124986;});})['then'](function(_0x4e3783){if(_0x4e3783){_0x205878[_0xf6fd('0x1e')]['contact']=_0x4e3783[0x0];if(!_0x58b772[_0xf6fd('0x4d')][_0xf6fd('0x67')])return;return db['User']['find']({'where':{'id':_0x58b772[_0xf6fd('0x4d')]['UserId'],'role':'agent'},'attributes':['id',_0xf6fd('0x2d'),_0xf6fd('0x79'),_0xf6fd('0x7a'),'internal'],'raw':!![]});}return null;})[_0xf6fd('0x15')](function(_0x3d703a){if(!_0x3d703a)return null;_0x205878['message'][_0xf6fd('0x69')]=_0x3d703a;return _0x205878;})[_0xf6fd('0x15')](function(_0x4fc589){if(_0x4fc589){_0x4fc589[_0xf6fd('0x1e')][_0xf6fd('0x7d')]=util['format'](_0xf6fd('0x7e'),_0x58b772[_0xf6fd('0x68')][_0xf6fd('0x2d')]);_0x4fc589[_0xf6fd('0x1e')]['channel']=_0x205878[_0xf6fd('0x7f')];_0x4fc589['message'][_0xf6fd('0x80')]=_0x205878[_0xf6fd('0x7f')];_0x4fc589[_0xf6fd('0x1e')][_0xf6fd('0x81')]='reject';_0x4fc589['message'][_0xf6fd('0x4d')]=htmlToText[_0xf6fd('0x89')](_0x205878['message'][_0xf6fd('0x4d')]);respondWithRpcPromise(_0xf6fd('0x82'),'EventManager',{'event':_0xf6fd('0x8a'),'message':_0x4fc589[_0xf6fd('0x1e')]},client9002);return _0x205878;}return null;})['then'](respondWithResult(_0x33237a,null))['catch'](handleError(_0x33237a,null));};exports[_0xf6fd('0x8b')]=function(_0x4381fa,_0x13433d){var _0x245c38=moment()[_0xf6fd('0x8c')]()['toString']();var _0x4a4c96=path[_0xf6fd('0x8d')](config[_0xf6fd('0x5d')],_0xf6fd('0x8e'),_0xf6fd('0x8f'),_0xf6fd('0x90'));var _0x27d9d4=path[_0xf6fd('0x8d')](config[_0xf6fd('0x5d')],'server',_0xf6fd('0x8f'),_0xf6fd('0x5c'));var _0x2b44f7=util[_0xf6fd('0x63')](_0xf6fd('0x91'),_0x245c38);return db[_0xf6fd('0x31')][_0xf6fd('0x4c')]({'where':{'id':_0x4381fa[_0xf6fd('0x4e')]['id']},'attributes':['id','body',_0xf6fd('0x92'),'to','cc',_0xf6fd('0x93'),_0xf6fd('0x94'),_0xf6fd('0x95')],'include':_0x4381fa[_0xf6fd('0x37')][_0xf6fd('0x5c')]?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})[_0xf6fd('0x15')](handleEntityNotFound(_0x13433d,null))[_0xf6fd('0x15')](function(_0x52a994){if(_0x52a994){var _0x54611b=_0x52a994;var _0x27170a={'from':_0x54611b[_0xf6fd('0x92')],'to':_0x54611b['to'],'subject':_0x54611b['subject'],'html':htmlEntities[_0xf6fd('0x96')](_0x54611b[_0xf6fd('0x4d')]),'headers':{'Date':moment(_0x54611b[_0xf6fd('0x95')])[_0xf6fd('0x63')](_0xf6fd('0x97'))},'attachments':[]};if(_0x52a994['cc']){_0x27170a['headers']['Cc']=_0x52a994['cc'];}if(_0x52a994[_0xf6fd('0x93')]){_0x27170a['headers'][_0xf6fd('0x98')]=_0x52a994[_0xf6fd('0x93')];}return new BPromise(function(_0x4c47f6,_0xf45f6e){if(_0x52a994[_0xf6fd('0x99')]){for(var _0x19affc=0x0;_0x19affc<_0x52a994[_0xf6fd('0x99')][_0xf6fd('0x3c')];_0x19affc++){var _0x438aaa=_0x52a994[_0xf6fd('0x99')][_0x19affc];var _0x7753c4=path['join'](_0x27d9d4,_0x438aaa[_0xf6fd('0x5e')]);if(fs['existsSync'](_0x7753c4)){_0x27170a[_0xf6fd('0x5c')][_0xf6fd('0x9a')]({'name':_0x438aaa[_0xf6fd('0x2d')],'contentType':_0x438aaa[_0xf6fd('0x34')],'data':fs[_0xf6fd('0x9b')](_0x7753c4)});}}}emlformat[_0xf6fd('0x9c')](_0x27170a,function(_0x4584c7,_0x5aea5e){if(_0x4584c7)return _0xf45f6e(_0x4584c7);fs[_0xf6fd('0x9d')](path[_0xf6fd('0x8d')](_0x4a4c96,_0x2b44f7),_0x5aea5e);return _0x4c47f6(_0x5aea5e);});});}})['then'](function(_0x1069b5){if(_0x1069b5){return _0x13433d['download'](path[_0xf6fd('0x8d')](_0x4a4c96,_0x2b44f7),_0x2b44f7,function(_0x2a144f){if(!_0x2a144f)fs['unlinkSync'](path['join'](_0x4a4c96,_0x2b44f7));});}})[_0xf6fd('0x20')](handleError(_0x13433d,null));}; \ No newline at end of file +var _0x705d=['null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','contact','User','email','internal','interface','format','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','RejectMessage','QueryTypes','SELECT','fullname','rejectmessage','download','unix','toString','server','files','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','writeFileSync','unlinkSync','eml-format','moment','bluebird','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','mail-interactions','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','http','client','then','info','MailMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','status','json','offset','undefined','count','limit','set','Content-Range','update','destroy','end','sendStatus','stack','name','send','map','MailMessage','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','merge','find','body','describe','create','out','secret','split','findOne','MailAccountId','CmList','List','Contacts','updatedAt','DESC','MailServerOut','CloudProvider','Smtp','getSmtpOptions','attachments','join','root','server/files/attachments','basename','CmContact','ListId','List\x20not\x20found','SendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','readAt','UserId','user','agent','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role'];(function(_0x4356c8,_0x5a863f){var _0x3bb35b=function(_0x1c9cf6){while(--_0x1c9cf6){_0x4356c8['push'](_0x4356c8['shift']());}};_0x3bb35b(++_0x5a863f);}(_0x705d,0x16d));var _0xd705=function(_0x587d35,_0x2ede6b){_0x587d35=_0x587d35-0x0;var _0x1af8f0=_0x705d[_0x587d35];return _0x1af8f0;};'use strict';var emlformat=require(_0xd705('0x0'));var moment=require(_0xd705('0x1'));var BPromise=require(_0xd705('0x2'));var util=require('util');var path=require(_0xd705('0x3'));var fs=require('fs');var _=require(_0xd705('0x4'));var Redis=require(_0xd705('0x5'));var htmlToText=require('html-to-text');var qs=require(_0xd705('0x6'));var logger=require('../../config/logger')('api');var interaction_log=require(_0xd705('0x7'))(_0xd705('0x8'));var config=require('../../config/environment');var db=require(_0xd705('0x9'))['db'];config['redis']=_[_0xd705('0xa')](config[_0xd705('0xb')],{'host':_0xd705('0xc'),'port':0x18eb});var socket=require(_0xd705('0xd'))(new Redis(config[_0xd705('0xb')]));var htmlEntities=require('html-entities');require(_0xd705('0xe'))[_0xd705('0xf')](socket);var jayson=require(_0xd705('0x10'));var client=jayson['client'][_0xd705('0x11')]({'port':0x232c});var client9003=jayson[_0xd705('0x12')][_0xd705('0x11')]({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x415775,_0x13b84f,_0x12a24b,_0x593308){return new BPromise(function(_0x785f19,_0x34a83c){var _0x1e0bcb=_0x593308||client;return _0x1e0bcb['request'](_0x415775,_0x12a24b)[_0xd705('0x13')](function(_0x54e01a){logger[_0xd705('0x14')](_0xd705('0x15'),_0x13b84f,'request\x20sent');logger[_0xd705('0x16')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x13b84f,_0xd705('0x17'),JSON[_0xd705('0x18')](_0x54e01a));if(_0x54e01a[_0xd705('0x19')]){if(_0x54e01a['error'][_0xd705('0x1a')]===0x1f4){logger[_0xd705('0x19')](_0xd705('0x15'),_0x13b84f,_0x54e01a[_0xd705('0x19')][_0xd705('0x1b')]);return _0x34a83c(_0x54e01a[_0xd705('0x19')][_0xd705('0x1b')]);}logger[_0xd705('0x19')](_0xd705('0x15'),_0x13b84f,_0x54e01a[_0xd705('0x19')][_0xd705('0x1b')]);return _0x785f19(_0x54e01a[_0xd705('0x19')][_0xd705('0x1b')]);}else{logger[_0xd705('0x14')](_0xd705('0x15'),_0x13b84f,_0xd705('0x17'));_0x785f19(_0x54e01a[_0xd705('0x1c')]['message']);}})[_0xd705('0x1d')](function(_0xe2abe9){logger[_0xd705('0x19')]('MailMessage,\x20%s,\x20%s',_0x13b84f,_0xe2abe9);_0x34a83c(_0xe2abe9);});});}function respondWithResult(_0x2e7d44,_0x68a43a){_0x68a43a=_0x68a43a||0xc8;return function(_0x2d96a6){if(_0x2d96a6){return _0x2e7d44[_0xd705('0x1e')](_0x68a43a)[_0xd705('0x1f')](_0x2d96a6);}};}function respondWithFilteredResult(_0x1dd337,_0x437212){return function(_0x423770){if(_0x423770){var _0x2d6271=typeof _0x437212[_0xd705('0x20')]===_0xd705('0x21')&&typeof _0x437212['limit']==='undefined';var _0x28a8c6=_0x423770['count'];var _0x64eac3=_0x2d6271?0x0:_0x437212[_0xd705('0x20')];var _0x4d93cf=_0x2d6271?_0x423770[_0xd705('0x22')]:_0x437212[_0xd705('0x20')]+_0x437212[_0xd705('0x23')];var _0x5e3041;if(_0x4d93cf>=_0x28a8c6){_0x4d93cf=_0x28a8c6;_0x5e3041=0xc8;}else{_0x5e3041=0xce;}_0x1dd337['status'](_0x5e3041);return _0x1dd337[_0xd705('0x24')](_0xd705('0x25'),_0x64eac3+'-'+_0x4d93cf+'/'+_0x28a8c6)[_0xd705('0x1f')](_0x423770);}return null;};}function saveUpdates(_0x11de04){return function(_0x1c3b96){if(_0x1c3b96){return _0x1c3b96[_0xd705('0x26')](_0x11de04)['then'](function(_0x246413){return _0x246413;});}return null;};}function removeEntity(_0x5c3fe6){return function(_0x2b7417){if(_0x2b7417){return _0x2b7417[_0xd705('0x27')]()[_0xd705('0x13')](function(){_0x5c3fe6[_0xd705('0x1e')](0xcc)[_0xd705('0x28')]();});}};}function handleEntityNotFound(_0xccfdec){return function(_0x4fac9a){if(!_0x4fac9a){_0xccfdec[_0xd705('0x29')](0x194);}return _0x4fac9a;};}function handleError(_0x2a172f,_0x5cde9f){_0x5cde9f=_0x5cde9f||0x1f4;return function(_0x408005){logger['error'](_0x408005[_0xd705('0x2a')]);if(_0x408005['name']){delete _0x408005[_0xd705('0x2b')];}_0x2a172f[_0xd705('0x1e')](_0x5cde9f)[_0xd705('0x2c')](_0x408005);};}exports['index']=function(_0x4b7191,_0xd8478f){var _0x16cb6b={},_0x501652={},_0x27c77e={'count':0x0,'rows':[]};var _0x102f6d=_[_0xd705('0x2d')](db[_0xd705('0x2e')][_0xd705('0x2f')],function(_0x3d52d3){return{'name':_0x3d52d3['fieldName'],'type':_0x3d52d3[_0xd705('0x30')][_0xd705('0x31')]};});_0x501652[_0xd705('0x32')]=_['map'](_0x102f6d,_0xd705('0x2b'));_0x501652[_0xd705('0x33')]=_[_0xd705('0x34')](_0x4b7191[_0xd705('0x33')]);_0x501652[_0xd705('0x35')]=_['intersection'](_0x501652[_0xd705('0x32')],_0x501652[_0xd705('0x33')]);_0x16cb6b[_0xd705('0x36')]=_[_0xd705('0x37')](_0x501652[_0xd705('0x32')],qs['fields'](_0x4b7191[_0xd705('0x33')][_0xd705('0x38')]));_0x16cb6b[_0xd705('0x36')]=_0x16cb6b[_0xd705('0x36')][_0xd705('0x39')]?_0x16cb6b[_0xd705('0x36')]:_0x501652[_0xd705('0x32')];if(!_0x4b7191[_0xd705('0x33')][_0xd705('0x3a')](_0xd705('0x3b'))){_0x16cb6b[_0xd705('0x23')]=qs['limit'](_0x4b7191[_0xd705('0x33')][_0xd705('0x23')]);_0x16cb6b[_0xd705('0x20')]=qs[_0xd705('0x20')](_0x4b7191['query'][_0xd705('0x20')]);}_0x16cb6b[_0xd705('0x3c')]=qs[_0xd705('0x3d')](_0x4b7191[_0xd705('0x33')][_0xd705('0x3d')]);_0x16cb6b[_0xd705('0x3e')]=qs[_0xd705('0x35')](_[_0xd705('0x3f')](_0x4b7191[_0xd705('0x33')],_0x501652[_0xd705('0x35')]),_0x102f6d);if(_0x4b7191[_0xd705('0x33')]['filter']){_0x16cb6b[_0xd705('0x3e')]=_['merge'](_0x16cb6b[_0xd705('0x3e')],{'$or':_['map'](_0x102f6d,function(_0x5d07c1){if(_0x5d07c1[_0xd705('0x30')]!==_0xd705('0x40')){var _0x237333={};_0x237333[_0x5d07c1[_0xd705('0x2b')]]={'$like':'%'+_0x4b7191['query'][_0xd705('0x41')]+'%'};return _0x237333;}})});}_0x16cb6b=_['merge']({},_0x16cb6b,_0x4b7191[_0xd705('0x42')]);var _0x5e8ad9={'where':_0x16cb6b[_0xd705('0x3e')]};return db[_0xd705('0x2e')]['count'](_0x5e8ad9)['then'](function(_0x210ab9){_0x27c77e[_0xd705('0x22')]=_0x210ab9;if(_0x4b7191[_0xd705('0x33')][_0xd705('0x43')]){_0x16cb6b[_0xd705('0x44')]=[{'all':!![]}];}return db[_0xd705('0x2e')][_0xd705('0x45')](_0x16cb6b);})['then'](function(_0x5904e6){_0x27c77e[_0xd705('0x46')]=_0x5904e6;return _0x27c77e;})[_0xd705('0x13')](respondWithFilteredResult(_0xd8478f,_0x16cb6b))[_0xd705('0x1d')](handleError(_0xd8478f,null));};exports[_0xd705('0x47')]=function(_0x1c6db3,_0x3f75ea){var _0x11cb42={'raw':!![],'where':{'id':_0x1c6db3[_0xd705('0x48')]['id']}},_0x553525={};_0x553525[_0xd705('0x32')]=_[_0xd705('0x34')](db[_0xd705('0x2e')]['rawAttributes']);_0x553525[_0xd705('0x33')]=_[_0xd705('0x34')](_0x1c6db3[_0xd705('0x33')]);_0x553525[_0xd705('0x35')]=_['intersection'](_0x553525[_0xd705('0x32')],_0x553525[_0xd705('0x33')]);_0x11cb42[_0xd705('0x36')]=_[_0xd705('0x37')](_0x553525[_0xd705('0x32')],qs['fields'](_0x1c6db3[_0xd705('0x33')][_0xd705('0x38')]));_0x11cb42['attributes']=_0x11cb42[_0xd705('0x36')][_0xd705('0x39')]?_0x11cb42[_0xd705('0x36')]:_0x553525[_0xd705('0x32')];if(_0x1c6db3[_0xd705('0x33')][_0xd705('0x43')]){_0x11cb42[_0xd705('0x44')]=[{'all':!![]}];}_0x11cb42=_[_0xd705('0x49')]({},_0x11cb42,_0x1c6db3[_0xd705('0x42')]);return db[_0xd705('0x2e')][_0xd705('0x4a')](_0x11cb42)[_0xd705('0x13')](handleEntityNotFound(_0x3f75ea,null))[_0xd705('0x13')](respondWithResult(_0x3f75ea,null))[_0xd705('0x1d')](handleError(_0x3f75ea,null));};exports[_0xd705('0x26')]=function(_0x4e9d87,_0x1aceed){if(_0x4e9d87[_0xd705('0x4b')]['id']){delete _0x4e9d87[_0xd705('0x4b')]['id'];}return db['MailMessage'][_0xd705('0x4a')]({'where':{'id':_0x4e9d87[_0xd705('0x48')]['id']}})[_0xd705('0x13')](handleEntityNotFound(_0x1aceed,null))[_0xd705('0x13')](saveUpdates(_0x4e9d87['body'],null))['then'](respondWithResult(_0x1aceed,null))[_0xd705('0x1d')](handleError(_0x1aceed,null));};exports[_0xd705('0x27')]=function(_0x314202,_0x1d4b39){return db[_0xd705('0x2e')]['find']({'where':{'id':_0x314202[_0xd705('0x48')]['id']}})[_0xd705('0x13')](handleEntityNotFound(_0x1d4b39,null))[_0xd705('0x13')](removeEntity(_0x1d4b39,null))[_0xd705('0x1d')](handleError(_0x1d4b39,null));};exports[_0xd705('0x4c')]=function(_0x373a0b,_0x20acde){return db[_0xd705('0x2e')]['describe']()[_0xd705('0x13')](respondWithResult(_0x20acde,null))[_0xd705('0x1d')](handleError(_0x20acde,null));};exports['create']=function(_0x313bce,_0x528a9a){return db[_0xd705('0x2e')][_0xd705('0x4d')](_0x313bce[_0xd705('0x4b')])[_0xd705('0x13')](function(_0x58e8ca){if(_0x58e8ca){if(_0x58e8ca['direction']===_0xd705('0x4e')&&!_0x58e8ca[_0xd705('0x4f')]){var _0x1b4fc0,_0x252168,_0x49a1da;if(_0x313bce[_0xd705('0x4b')]['to']){_0x252168=_0x313bce['body']['to'][_0xd705('0x50')](',')[0x0];}return db['MailAccount'][_0xd705('0x51')]({'where':{'id':_0x58e8ca[_0xd705('0x52')]},'include':[{'model':db[_0xd705('0x53')],'as':_0xd705('0x54'),'include':[{'model':db['CmContact'],'as':_0xd705('0x55'),'where':{'email':_0x252168},'limit':0x1,'order':[[_0xd705('0x56'),_0xd705('0x57')]]}]},{'model':db[_0xd705('0x58')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xd705('0x59')],'as':_0xd705('0x59'),'raw':!![]}]}]})['then'](function(_0x48da7b){_0x1b4fc0=_0x48da7b;if(!_0x1b4fc0||!_0x1b4fc0[_0xd705('0x5a')])return;var _0x2f9c7c=_0x1b4fc0[_0xd705('0x5b')]();if(_0x313bce[_0xd705('0x4b')][_0xd705('0x5c')]&&_0x313bce[_0xd705('0x4b')][_0xd705('0x5c')][_0xd705('0x39')]){for(var _0x3bbb97=0x0;_0x3bbb97<_0x313bce[_0xd705('0x4b')]['attachments'][_0xd705('0x39')];_0x3bbb97+=0x1){_0x313bce['body'][_0xd705('0x5c')][_0x3bbb97]={'filename':_0x313bce[_0xd705('0x4b')][_0xd705('0x5c')][_0x3bbb97]['name'],'path':path[_0xd705('0x5d')](config[_0xd705('0x5e')],_0xd705('0x5f'),_0x313bce[_0xd705('0x4b')][_0xd705('0x5c')][_0x3bbb97][_0xd705('0x60')])};}}_0x49a1da={'account':_0x2f9c7c,'message':_0x313bce[_0xd705('0x4b')]};return;})[_0xd705('0x13')](function(){if(_0x1b4fc0[_0xd705('0x54')]){if(_0x1b4fc0[_0xd705('0x54')][_0xd705('0x55')][_0xd705('0x39')]){return _0x1b4fc0[_0xd705('0x54')]['Contacts'][0x0];}else{return db[_0xd705('0x61')][_0xd705('0x4d')](_[_0xd705('0xa')](_0x313bce[_0xd705('0x4b')],{'firstName':_0x313bce[_0xd705('0x4b')]['to'],'email':_0x313bce['body']['to'],'phone':_0x313bce[_0xd705('0x4b')]['to'],'ListId':_0x1b4fc0[_0xd705('0x62')]}));}}else{throw new Error(_0xd705('0x63'));}})['then'](function(){if(_0x49a1da){return respondWithRpcPromise(_0xd705('0x64'),'sendMail',_0x49a1da,client9003)['then'](function(_0x583447){return _0x58e8ca[_0xd705('0x26')]({'read':!![],'messageId':_0x583447[_0xd705('0x65')],'sentAt':moment()['format'](_0xd705('0x66'))});})[_0xd705('0x1d')](function(_0x5defda){logger[_0xd705('0x19')]('%s',JSON[_0xd705('0x18')](_0x5defda));return _0x58e8ca;});}return _0x58e8ca;});}return _0x58e8ca;}})[_0xd705('0x13')](respondWithResult(_0x528a9a,0xc9))['catch'](handleError(_0x528a9a,null));};exports[_0xd705('0x67')]=function(_0x38e766,_0x624a90){var _0x1a6f6c={'agent':{},'channel':'mail'};if(_0x38e766['body']['id']){delete _0x38e766[_0xd705('0x4b')]['id'];}_0x38e766[_0xd705('0x4b')]['read']=!![];_0x38e766[_0xd705('0x4b')][_0xd705('0x68')]=moment()['format'](_0xd705('0x66'));_0x38e766[_0xd705('0x4b')]['UserId']=_0x38e766[_0xd705('0x4b')][_0xd705('0x69')]||_0x38e766[_0xd705('0x6a')]['id'];_0x1a6f6c[_0xd705('0x6b')]['id']=_0x38e766['body'][_0xd705('0x69')];return db[_0xd705('0x2e')][_0xd705('0x4a')]({'where':{'id':_0x38e766[_0xd705('0x48')]['id'],'UserId':null}})[_0xd705('0x13')](handleEntityNotFound(_0x624a90,null))['then'](saveUpdates(_0x38e766[_0xd705('0x4b')],null))[_0xd705('0x13')](function(_0x37d58d){if(_0x37d58d){_0x1a6f6c['message']=_0x37d58d[_0xd705('0x6c')]({'plain':!![]});return db[_0xd705('0x6d')][_0xd705('0x4a')]({'where':{'id':_0x37d58d[_0xd705('0x6e')]}});}return null;})[_0xd705('0x13')](handleEntityNotFound(_0x624a90,null))[_0xd705('0x13')](function(_0x8ec3bf){if(_0x8ec3bf){return _0x8ec3bf[_0xd705('0x26')]({'UserId':_0x38e766[_0xd705('0x4b')][_0xd705('0x69')],'read1stAt':_['isNil'](_0x8ec3bf[_0xd705('0x6f')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0xdaae0){if(_0xdaae0){_0x1a6f6c[_0xd705('0x70')]=_0xdaae0[_0xd705('0x6c')]({'plain':!![]});interaction_log[_0xd705('0x14')](_0xd705('0x71'),_0x38e766[_0xd705('0x6a')]['id'],_0x38e766[_0xd705('0x6a')][_0xd705('0x2b')],_0x38e766[_0xd705('0x6a')][_0xd705('0x72')],_0x1a6f6c[_0xd705('0x70')]['id'],_0x38e766[_0xd705('0x4b')]?JSON[_0xd705('0x18')](_0x38e766['body']):_0xd705('0x73'));return respondWithRpcPromise(_0xd705('0x74'),_0xd705('0x75'),_0x1a6f6c);}return null;})[_0xd705('0x13')](function(_0x4d0351){var _0x272cd1=_0xd705('0x76')+_0x4d0351[_0xd705('0x1b')]['ContactId'];return db[_0xd705('0x77')][_0xd705('0x33')](_0x272cd1,{'type':db[_0xd705('0x78')]['QueryTypes']['SELECT'],'raw':!![]})[_0xd705('0x13')](function(_0x40c3c9){return _0x40c3c9;});})[_0xd705('0x13')](function(_0x134552){if(_0x134552){_0x1a6f6c[_0xd705('0x1b')][_0xd705('0x79')]=_0x134552[0x0];if(!_0x38e766['body']['UserId'])return;return db[_0xd705('0x7a')][_0xd705('0x4a')]({'where':{'id':_0x38e766[_0xd705('0x4b')][_0xd705('0x69')],'role':_0xd705('0x6b')},'attributes':['id','name','fullname',_0xd705('0x7b'),_0xd705('0x7c')],'raw':!![]});}return null;})[_0xd705('0x13')](function(_0x5bfdce){if(!_0x5bfdce)return null;_0x1a6f6c['message'][_0xd705('0x6b')]=_0x5bfdce;return _0x1a6f6c;})[_0xd705('0x13')](function(_0x6586d1){if(_0x6586d1){if(_0x38e766['body']['manual']){_0x1a6f6c[_0xd705('0x1b')][_0xd705('0x7d')]=util[_0xd705('0x7e')](_0xd705('0x7f'),_0x38e766[_0xd705('0x6a')][_0xd705('0x2b')]);_0x1a6f6c['message'][_0xd705('0x80')]=_0x1a6f6c[_0xd705('0x80')];_0x1a6f6c[_0xd705('0x1b')][_0xd705('0x81')]=_0x1a6f6c[_0xd705('0x80')];_0x1a6f6c[_0xd705('0x1b')][_0xd705('0x82')]=_0xd705('0x67');_0x1a6f6c[_0xd705('0x1b')][_0xd705('0x4b')]=htmlToText[_0xd705('0x83')](_0x1a6f6c[_0xd705('0x1b')][_0xd705('0x4b')]);return respondWithRpcPromise(_0xd705('0x84'),_0xd705('0x84'),{'event':_0xd705('0x85'),'message':_0x1a6f6c['message']},client9002)[_0xd705('0x13')](function(){return _0x1a6f6c;});}return _0x1a6f6c;}return null;})[_0xd705('0x13')](respondWithResult(_0x624a90,null))['catch'](handleError(_0x624a90,null));};exports[_0xd705('0x86')]=function(_0x48d876,_0x29c946){var _0x2a2043={'agent':{},'channel':'mail'};if(_0x48d876[_0xd705('0x4b')]['id']){delete _0x48d876[_0xd705('0x4b')]['id'];}_0x48d876[_0xd705('0x4b')]['UserId']=_0x48d876['body'][_0xd705('0x69')]||_0x48d876[_0xd705('0x6a')]['id'];_0x2a2043[_0xd705('0x6b')]['id']=_0x48d876[_0xd705('0x4b')][_0xd705('0x69')];return db['MailMessage'][_0xd705('0x4a')]({'where':{'id':_0x48d876[_0xd705('0x48')]['id'],'UserId':null}})[_0xd705('0x13')](handleEntityNotFound(_0x29c946,null))[_0xd705('0x13')](function(_0x5d13bf){if(_0x5d13bf){_0x2a2043['message']=_0x5d13bf[_0xd705('0x6c')]({'plain':!![]});return db[_0xd705('0x6d')][_0xd705('0x4a')]({'where':{'id':_0x5d13bf['MailInteractionId']}});}return null;})[_0xd705('0x13')](handleEntityNotFound(_0x29c946,null))[_0xd705('0x13')](function(_0x564a66){if(_0x564a66){_0x2a2043[_0xd705('0x70')]=_0x564a66[_0xd705('0x6c')]({'plain':!![]});interaction_log[_0xd705('0x14')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x48d876[_0xd705('0x6a')]['id'],_0x48d876['user'][_0xd705('0x2b')],_0x48d876[_0xd705('0x6a')][_0xd705('0x72')],_0x2a2043['interaction']['id'],_0x48d876[_0xd705('0x4b')]?JSON[_0xd705('0x18')](_0x48d876[_0xd705('0x4b')]):'null');return respondWithRpcPromise(_0xd705('0x87'),'rejectMessage',_0x2a2043);}return null;})['then'](function(_0x25b59c){var _0x7ad8b1='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x25b59c[_0xd705('0x1b')]['ContactId'];return db['sequelize'][_0xd705('0x33')](_0x7ad8b1,{'type':db[_0xd705('0x78')][_0xd705('0x88')][_0xd705('0x89')],'raw':!![]})[_0xd705('0x13')](function(_0xc99e69){return _0xc99e69;});})[_0xd705('0x13')](function(_0x442b9a){if(_0x442b9a){_0x2a2043[_0xd705('0x1b')]['contact']=_0x442b9a[0x0];if(!_0x48d876['body'][_0xd705('0x69')])return;return db['User']['find']({'where':{'id':_0x48d876[_0xd705('0x4b')][_0xd705('0x69')],'role':_0xd705('0x6b')},'attributes':['id',_0xd705('0x2b'),_0xd705('0x8a'),_0xd705('0x7b'),_0xd705('0x7c')],'raw':!![]});}return null;})[_0xd705('0x13')](function(_0x230926){if(!_0x230926)return null;_0x2a2043['message'][_0xd705('0x6b')]=_0x230926;return _0x2a2043;})[_0xd705('0x13')](function(_0x170abd){if(_0x170abd){_0x170abd[_0xd705('0x1b')][_0xd705('0x7d')]=util[_0xd705('0x7e')](_0xd705('0x7f'),_0x48d876[_0xd705('0x6a')]['name']);_0x170abd[_0xd705('0x1b')][_0xd705('0x80')]=_0x2a2043[_0xd705('0x80')];_0x170abd[_0xd705('0x1b')][_0xd705('0x81')]=_0x2a2043['channel'];_0x170abd[_0xd705('0x1b')]['event']=_0xd705('0x86');_0x170abd['message']['body']=htmlToText[_0xd705('0x83')](_0x2a2043[_0xd705('0x1b')][_0xd705('0x4b')]);respondWithRpcPromise(_0xd705('0x84'),'EventManager',{'event':_0xd705('0x8b'),'message':_0x170abd[_0xd705('0x1b')]},client9002);return _0x2a2043;}return null;})[_0xd705('0x13')](respondWithResult(_0x29c946,null))[_0xd705('0x1d')](handleError(_0x29c946,null));};exports[_0xd705('0x8c')]=function(_0x4cf142,_0x34dc25){var _0x1182ae=moment()[_0xd705('0x8d')]()[_0xd705('0x8e')]();var _0x61ada2=path[_0xd705('0x5d')](config['root'],_0xd705('0x8f'),'files','tmp');var _0x211b06=path[_0xd705('0x5d')](config[_0xd705('0x5e')],'server',_0xd705('0x90'),'attachments');var _0x523b7e=util[_0xd705('0x7e')](_0xd705('0x91'),_0x1182ae);return db[_0xd705('0x2e')][_0xd705('0x4a')]({'where':{'id':_0x4cf142[_0xd705('0x48')]['id']},'attributes':['id',_0xd705('0x4b'),_0xd705('0x92'),'to','cc',_0xd705('0x93'),_0xd705('0x94'),_0xd705('0x95')],'include':_0x4cf142[_0xd705('0x33')][_0xd705('0x5c')]?[{'model':db[_0xd705('0x96')],'as':_0xd705('0x97')}]:undefined})['then'](handleEntityNotFound(_0x34dc25,null))[_0xd705('0x13')](function(_0x3cda86){if(_0x3cda86){var _0x490654=_0x3cda86;var _0x3cddd7={'from':_0x490654[_0xd705('0x92')],'to':_0x490654['to'],'subject':_0x490654[_0xd705('0x94')],'html':htmlEntities[_0xd705('0x98')](_0x490654[_0xd705('0x4b')]),'headers':{'Date':moment(_0x490654[_0xd705('0x95')])[_0xd705('0x7e')](_0xd705('0x99'))},'attachments':[]};if(_0x3cda86['cc']){_0x3cddd7[_0xd705('0x9a')]['Cc']=_0x3cda86['cc'];}if(_0x3cda86[_0xd705('0x93')]){_0x3cddd7[_0xd705('0x9a')][_0xd705('0x9b')]=_0x3cda86[_0xd705('0x93')];}return new BPromise(function(_0x9d412b,_0x5452df){if(_0x3cda86[_0xd705('0x97')]){for(var _0x2528f9=0x0;_0x2528f9<_0x3cda86[_0xd705('0x97')][_0xd705('0x39')];_0x2528f9++){var _0x1dd5f8=_0x3cda86[_0xd705('0x97')][_0x2528f9];var _0x4e931f=path[_0xd705('0x5d')](_0x211b06,_0x1dd5f8[_0xd705('0x60')]);if(fs[_0xd705('0x9c')](_0x4e931f)){_0x3cddd7[_0xd705('0x5c')][_0xd705('0x9d')]({'name':_0x1dd5f8[_0xd705('0x2b')],'contentType':_0x1dd5f8['type'],'data':fs['readFileSync'](_0x4e931f)});}}}emlformat['build'](_0x3cddd7,function(_0x9f62da,_0x135874){if(_0x9f62da)return _0x5452df(_0x9f62da);fs[_0xd705('0x9e')](path[_0xd705('0x5d')](_0x61ada2,_0x523b7e),_0x135874);return _0x9d412b(_0x135874);});});}})['then'](function(_0x3f64b6){if(_0x3f64b6){return _0x34dc25['download'](path[_0xd705('0x5d')](_0x61ada2,_0x523b7e),_0x523b7e,function(_0x4201d0){if(!_0x4201d0)fs[_0xd705('0x9f')](path[_0xd705('0x5d')](_0x61ada2,_0x523b7e));});}})[_0xd705('0x1d')](handleError(_0x34dc25,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 1eddb78..2aee4ba 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 _0xbb9b=['remove','emit','hasOwnProperty','hook','events','MailMessage','setMaxListeners','save','update'];(function(_0x2a05e4,_0x2a445a){var _0x5007d9=function(_0x2d1943){while(--_0x2d1943){_0x2a05e4['push'](_0x2a05e4['shift']());}};_0x5007d9(++_0x2a445a);}(_0xbb9b,0xca));var _0xbbb9=function(_0x3cdbe7,_0x3d6df1){_0x3cdbe7=_0x3cdbe7-0x0;var _0x38886e=_0xbb9b[_0x3cdbe7];return _0x38886e;};'use strict';var EventEmitter=require(_0xbbb9('0x0'));var MailMessage=require('../../mysqldb')['db'][_0xbbb9('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xbbb9('0x2')](0x0);var events={'afterCreate':_0xbbb9('0x3'),'afterUpdate':_0xbbb9('0x4'),'afterDestroy':_0xbbb9('0x5')};function emitEvent(_0x4975a6){return function(_0x308f67,_0xacac42,_0x4062a9){MailMessageEvents['emit'](_0x4975a6+':'+_0x308f67['id'],_0x308f67);MailMessageEvents[_0xbbb9('0x6')](_0x4975a6,_0x308f67);_0x4062a9(null);};}for(var e in events){if(events[_0xbbb9('0x7')](e)){var event=events[e];MailMessage[_0xbbb9('0x8')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0x4d05=['hook','exports','../../mysqldb','MailMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x4d05,0x119));var _0x54d0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4d05[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x54d0('0x0'))['db'][_0x54d0('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x54d0('0x2')](0x0);var events={'afterCreate':_0x54d0('0x3'),'afterUpdate':'update','afterDestroy':_0x54d0('0x4')};function emitEvent(_0x3fb25e){return function(_0x1d4275,_0x31d98e,_0xab443a){MailMessageEvents['emit'](_0x3fb25e+':'+_0x1d4275['id'],_0x1d4275);MailMessageEvents[_0x54d0('0x5')](_0x3fb25e,_0x1d4275);_0xab443a(null);};}for(var e in events){if(events[_0x54d0('0x6')](e)){var event=events[e];MailMessage[_0x54d0('0x7')](e,emitEvent(event));}}module[_0x54d0('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 7708449..9a65191 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 _0x4541=['moment','bluebird','request-promise','html-to-text','path','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','secret','isNil','MailInteraction','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x5c8803,_0x19744c){var _0x54ab23=function(_0x48571b){while(--_0x48571b){_0x5c8803['push'](_0x5c8803['shift']());}};_0x54ab23(++_0x19744c);}(_0x4541,0x188));var _0x1454=function(_0x1d5d78,_0x58bc96){_0x1d5d78=_0x1d5d78-0x0;var _0x5ec633=_0x4541[_0x1d5d78];return _0x5ec633;};'use strict';var _=require(_0x1454('0x0'));var util=require(_0x1454('0x1'));var logger=require(_0x1454('0x2'))(_0x1454('0x3'));var moment=require(_0x1454('0x4'));var BPromise=require(_0x1454('0x5'));var rp=require(_0x1454('0x6'));var htmlToText=require(_0x1454('0x7'));var fs=require('fs');var path=require(_0x1454('0x8'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailMessage.attributes');module['exports']=function(_0x318042,_0x787f18){return _0x318042[_0x1454('0x9')](_0x1454('0xa'),attributes,{'tableName':_0x1454('0xb'),'paranoid':![],'indexes':[{'name':_0x1454('0xc'),'fields':['messageId']},{'name':_0x1454('0xd'),'fields':[_0x1454('0xe'),_0x1454('0xf')],'type':_0x1454('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2ffa9e,_0xaca9e6,_0x4fd3d7){if(_0x2ffa9e[_0x1454('0x11')]){_0x2ffa9e[_0x1454('0xe')]=htmlToText[_0x1454('0x12')](_0x2ffa9e[_0x1454('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4fd3d7(null,_0xaca9e6);},'afterCreate':function(_0x47ed19,_0x25a371,_0x27070e){var _0x12b05f=_0x318042[_0x1454('0x13')];var _0x4405ad=_0x47ed19[_0x1454('0x14')]({'plain':!![]});if(_0x4405ad[_0x1454('0x15')][_0x1454('0x16')]()==='in'||_0x4405ad[_0x1454('0x15')][_0x1454('0x16')]()===_0x1454('0x17')&&!_0x4405ad[_0x1454('0x18')]&&!_[_0x1454('0x19')](_0x4405ad['UserId'])){_0x12b05f[_0x1454('0x1a')]['findOne']({'where':{'id':_0x4405ad['MailInteractionId']}})[_0x1454('0x1b')](function(_0x4e5777){if(_0x4e5777){_0x4e5777[_0x1454('0x1c')]({'lastMsgAt':_0x4405ad['createdAt'],'lastMsgDirection':_0x4405ad[_0x1454('0x15')][_0x1454('0x16')]()});}})[_0x1454('0x1d')](function(_0x1c0c8f){console[_0x1454('0x1e')](_0x1c0c8f);});}_0x27070e();}},'charset':_0x1454('0x1f'),'collate':_0x1454('0x20')});}; \ No newline at end of file +var _0x5126=['request-promise','html-to-text','path','rimraf','../../config/environment','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird'];(function(_0x1f18d8,_0x2fec4c){var _0x1eb7f3=function(_0x59adf1){while(--_0x59adf1){_0x1f18d8['push'](_0x1f18d8['shift']());}};_0x1eb7f3(++_0x2fec4c);}(_0x5126,0x67));var _0x6512=function(_0x1e9719,_0x440125){_0x1e9719=_0x1e9719-0x0;var _0x5a1fbc=_0x5126[_0x1e9719];return _0x5a1fbc;};'use strict';var _=require(_0x6512('0x0'));var util=require(_0x6512('0x1'));var logger=require(_0x6512('0x2'))(_0x6512('0x3'));var moment=require('moment');var BPromise=require(_0x6512('0x4'));var rp=require(_0x6512('0x5'));var htmlToText=require(_0x6512('0x6'));var fs=require('fs');var path=require(_0x6512('0x7'));var rimraf=require(_0x6512('0x8'));var config=require(_0x6512('0x9'));var attributes=require('./mailMessage.attributes');module[_0x6512('0xa')]=function(_0xb122f2,_0x35d3f9){return _0xb122f2[_0x6512('0xb')](_0x6512('0xc'),attributes,{'tableName':_0x6512('0xd'),'paranoid':![],'indexes':[{'name':_0x6512('0xe'),'fields':[_0x6512('0xe')]},{'name':_0x6512('0xf'),'fields':[_0x6512('0x10'),_0x6512('0x11')],'type':_0x6512('0x12')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x286efe,_0x18eafd,_0x206b39){if(_0x286efe[_0x6512('0x13')]){_0x286efe['plainBody']=htmlToText[_0x6512('0x14')](_0x286efe[_0x6512('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x206b39(null,_0x18eafd);},'afterCreate':function(_0x560e53,_0x144fc7,_0x4ee749){var _0x3a1559=_0xb122f2[_0x6512('0x15')];var _0x2498a1=_0x560e53[_0x6512('0x16')]({'plain':!![]});if(_0x2498a1[_0x6512('0x17')][_0x6512('0x18')]()==='in'||_0x2498a1[_0x6512('0x17')][_0x6512('0x18')]()===_0x6512('0x19')&&!_0x2498a1[_0x6512('0x1a')]&&!_[_0x6512('0x1b')](_0x2498a1[_0x6512('0x1c')])){_0x3a1559[_0x6512('0x1d')][_0x6512('0x1e')]({'where':{'id':_0x2498a1['MailInteractionId']}})['then'](function(_0x5b8ba8){if(_0x5b8ba8){_0x5b8ba8[_0x6512('0x1f')]({'lastMsgAt':_0x2498a1[_0x6512('0x20')],'lastMsgDirection':_0x2498a1[_0x6512('0x17')][_0x6512('0x18')]()});}})[_0x6512('0x21')](function(_0x17886b){console[_0x6512('0x22')](_0x17886b);});}_0x4ee749();}},'charset':'utf8mb4','collate':_0x6512('0x23')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 751003c..7d6c6ba 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 _0x0b0e=['message','result','MailMessage','create','body','options','CreateMailMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailMessage.socket','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s'];(function(_0x8b5d75,_0xb2db14){var _0x678101=function(_0x59e2fd){while(--_0x59e2fd){_0x8b5d75['push'](_0x8b5d75['shift']());}};_0x678101(++_0xb2db14);}(_0x0b0e,0x187));var _0xe0b0=function(_0x367361,_0x311488){_0x367361=_0x367361-0x0;var _0x195d2d=_0x0b0e[_0x367361];return _0x195d2d;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});config[_0xe0b0('0xc')]=_['defaults'](config['redis'],{'host':_0xe0b0('0xd'),'port':0x18eb});var socket=require(_0xe0b0('0xe'))(new Redis(config[_0xe0b0('0xc')]));require(_0xe0b0('0xf'))['register'](socket);function respondWithRpcPromise(_0x338e7c,_0x1dd3b8,_0x553d4f){return new BPromise(function(_0x1fef28,_0x2f32b6){return client['request'](_0x338e7c,_0x553d4f)[_0xe0b0('0x10')](function(_0x2cdad2){logger[_0xe0b0('0x11')]('MailMessage,\x20%s,\x20%s',_0x1dd3b8,_0xe0b0('0x12'));logger[_0xe0b0('0x13')](_0xe0b0('0x14'),_0x1dd3b8,_0xe0b0('0x12'),JSON[_0xe0b0('0x15')](_0x2cdad2));if(_0x2cdad2['error']){if(_0x2cdad2[_0xe0b0('0x16')][_0xe0b0('0x17')]===0x1f4){logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2[_0xe0b0('0x16')]['message']);return _0x2f32b6(_0x2cdad2[_0xe0b0('0x16')]['message']);}logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2['error'][_0xe0b0('0x19')]);return _0x1fef28(_0x2cdad2['error'][_0xe0b0('0x19')]);}else{logger[_0xe0b0('0x11')]('MailMessage,\x20%s,\x20%s',_0x1dd3b8,'request\x20sent');_0x1fef28(_0x2cdad2[_0xe0b0('0x1a')]['message']);}})['catch'](function(_0x4bce65){logger[_0xe0b0('0x16')]('MailMessage,\x20%s,\x20%s',_0x1dd3b8,_0x4bce65);_0x2f32b6(_0x4bce65);});});}exports['CreateMailMessage']=function(_0x10cde1){var _0x59dff5=this;return new Promise(function(_0x472286,_0x5dba2f){return db[_0xe0b0('0x1b')][_0xe0b0('0x1c')](_0x10cde1[_0xe0b0('0x1d')],{'raw':_0x10cde1[_0xe0b0('0x1e')]?_0x10cde1[_0xe0b0('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2fa820){logger['info'](_0xe0b0('0x1f'),_0x10cde1);logger[_0xe0b0('0x13')]('CreateMailMessage',_0x10cde1,JSON[_0xe0b0('0x15')](_0x2fa820));_0x472286(_0x2fa820);})['catch'](function(_0x2208d0){logger['error'](_0xe0b0('0x1f'),_0x2208d0['message'],_0x10cde1);_0x5dba2f(_0x59dff5[_0xe0b0('0x16')](0x1f4,_0x2208d0['message']));});});}; \ No newline at end of file +var _0x7d25=['client','redis','defaults','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateMailMessage','create','body','options','raw','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2c3f69,_0x479606){var _0x4e9d3a=function(_0x592b83){while(--_0x592b83){_0x2c3f69['push'](_0x2c3f69['shift']());}};_0x4e9d3a(++_0x479606);}(_0x7d25,0x8a));var _0x57d2=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x7d25[_0x45783c];return _0x1161da;};'use strict';var _=require('lodash');var util=require(_0x57d2('0x0'));var moment=require(_0x57d2('0x1'));var BPromise=require(_0x57d2('0x2'));var rs=require(_0x57d2('0x3'));var fs=require('fs');var Redis=require(_0x57d2('0x4'));var db=require(_0x57d2('0x5'))['db'];var utils=require(_0x57d2('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x57d2('0x7')]['http']({'port':0x232a});config[_0x57d2('0x8')]=_[_0x57d2('0x9')](config[_0x57d2('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x57d2('0x8')]));require('./mailMessage.socket')[_0x57d2('0xa')](socket);function respondWithRpcPromise(_0x5153c2,_0xa04872,_0x485438){return new BPromise(function(_0x429301,_0x1a86db){return client[_0x57d2('0xb')](_0x5153c2,_0x485438)[_0x57d2('0xc')](function(_0x2e8e12){logger[_0x57d2('0xd')](_0x57d2('0xe'),_0xa04872,_0x57d2('0xf'));logger[_0x57d2('0x10')](_0x57d2('0x11'),_0xa04872,_0x57d2('0xf'),JSON[_0x57d2('0x12')](_0x2e8e12));if(_0x2e8e12[_0x57d2('0x13')]){if(_0x2e8e12[_0x57d2('0x13')][_0x57d2('0x14')]===0x1f4){logger[_0x57d2('0x13')]('MailMessage,\x20%s,\x20%s',_0xa04872,_0x2e8e12['error'][_0x57d2('0x15')]);return _0x1a86db(_0x2e8e12[_0x57d2('0x13')]['message']);}logger[_0x57d2('0x13')](_0x57d2('0xe'),_0xa04872,_0x2e8e12['error'][_0x57d2('0x15')]);return _0x429301(_0x2e8e12['error'][_0x57d2('0x15')]);}else{logger['info'](_0x57d2('0xe'),_0xa04872,_0x57d2('0xf'));_0x429301(_0x2e8e12[_0x57d2('0x16')]['message']);}})['catch'](function(_0xbaeda8){logger[_0x57d2('0x13')](_0x57d2('0xe'),_0xa04872,_0xbaeda8);_0x1a86db(_0xbaeda8);});});}exports[_0x57d2('0x17')]=function(_0x5b1b9d){var _0x1cbe4a=this;return new Promise(function(_0xcf924f,_0x55191e){return db['MailMessage'][_0x57d2('0x18')](_0x5b1b9d[_0x57d2('0x19')],{'raw':_0x5b1b9d[_0x57d2('0x1a')]?_0x5b1b9d[_0x57d2('0x1a')][_0x57d2('0x1b')]===undefined?!![]:![]:!![]})[_0x57d2('0xc')](function(_0x32c7c8){logger[_0x57d2('0xd')](_0x57d2('0x17'),_0x5b1b9d);logger[_0x57d2('0x10')](_0x57d2('0x17'),_0x5b1b9d,JSON[_0x57d2('0x12')](_0x32c7c8));_0xcf924f(_0x32c7c8);})[_0x57d2('0x1c')](function(_0x473df2){logger['error'](_0x57d2('0x17'),_0x473df2[_0x57d2('0x15')],_0x5b1b9d);_0x55191e(_0x1cbe4a[_0x57d2('0x13')](0x1f4,_0x473df2[_0x57d2('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index d91de27..dc0bac0 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 _0x994b=['update','emit','register','mailMessage:'];(function(_0x15f3c0,_0x165a64){var _0x1adfe0=function(_0x212cfc){while(--_0x212cfc){_0x15f3c0['push'](_0x15f3c0['shift']());}};_0x1adfe0(++_0x165a64);}(_0x994b,0x198));var _0xb994=function(_0x4fe9cf,_0x2f047c){_0x4fe9cf=_0x4fe9cf-0x0;var _0xe20b02=_0x994b[_0x4fe9cf];return _0xe20b02;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save','remove',_0xb994('0x0')];function createListener(_0x452674,_0x5a7c8c){return function(_0x1c0dad){_0x5a7c8c[_0xb994('0x1')](_0x452674,_0x1c0dad);};}function removeListener(_0x206724,_0x3aff62){return function(){MailMessageEvents['removeListener'](_0x206724,_0x3aff62);};}exports[_0xb994('0x2')]=function(_0x5d2912){for(var _0x1df393=0x0,_0x3abdfc=events['length'];_0x1df393<_0x3abdfc;_0x1df393++){var _0x5e0dc0=events[_0x1df393];var _0x411122=createListener(_0xb994('0x3')+_0x5e0dc0,_0x5d2912);MailMessageEvents['on'](_0x5e0dc0,_0x411122);}}; \ No newline at end of file +var _0x3eec=['mailMessage:','./mailMessage.events','save','remove','update','emit','removeListener','length'];(function(_0x410cf8,_0x32616f){var _0x2846da=function(_0x20ea0e){while(--_0x20ea0e){_0x410cf8['push'](_0x410cf8['shift']());}};_0x2846da(++_0x32616f);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x3af9dd,_0x9da8fe){_0x3af9dd=_0x3af9dd-0x0;var _0x409f95=_0x3eec[_0x3af9dd];return _0x409f95;};'use strict';var MailMessageEvents=require(_0xc3ee('0x0'));var events=[_0xc3ee('0x1'),_0xc3ee('0x2'),_0xc3ee('0x3')];function createListener(_0x484ade,_0x223d08){return function(_0x280209){_0x223d08[_0xc3ee('0x4')](_0x484ade,_0x280209);};}function removeListener(_0x35b2fb,_0x25074b){return function(){MailMessageEvents[_0xc3ee('0x5')](_0x35b2fb,_0x25074b);};}exports['register']=function(_0x471de7){for(var _0xbd5b6=0x0,_0xea4318=events[_0xc3ee('0x6')];_0xbd5b6<_0xea4318;_0xbd5b6++){var _0x356374=events[_0xbd5b6];var _0x3d74c0=createListener(_0xc3ee('0x7')+_0x356374,_0x471de7);MailMessageEvents['on'](_0x356374,_0x3d74c0);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 68a6e83..3b76288 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 _0x7dee=['./mailQueue.controller','get','isAuthenticated','index','/describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','create','/:id/users','put','update','delete','destroy','removeTeams','removeAgents','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xd2fd27,_0x4a7de4){var _0x5ceb1f=function(_0x4c932f){while(--_0x4c932f){_0xd2fd27['push'](_0xd2fd27['shift']());}};_0x5ceb1f(++_0x4a7de4);}(_0x7dee,0x9c));var _0xe7de=function(_0x594eb0,_0x5b7bb3){_0x594eb0=_0x594eb0-0x0;var _0x31e608=_0x7dee[_0x594eb0];return _0x31e608;};'use strict';var multer=require('multer');var util=require(_0xe7de('0x0'));var path=require(_0xe7de('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe7de('0x2')]();var fs_extra=require(_0xe7de('0x3'));var auth=require(_0xe7de('0x4'));var interaction=require(_0xe7de('0x5'));var config=require('../../config/environment');var controller=require(_0xe7de('0x6'));router[_0xe7de('0x7')]('/',auth[_0xe7de('0x8')](),controller[_0xe7de('0x9')]);router[_0xe7de('0x7')](_0xe7de('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xe7de('0x7')](_0xe7de('0xb'),auth[_0xe7de('0x8')](),controller[_0xe7de('0xc')]);router[_0xe7de('0x7')]('/:id/members',auth[_0xe7de('0x8')](),controller[_0xe7de('0xd')]);router['get'](_0xe7de('0xe'),auth[_0xe7de('0x8')](),controller[_0xe7de('0xf')]);router['get']('/:id/users',auth[_0xe7de('0x8')](),controller[_0xe7de('0x10')]);router[_0xe7de('0x11')]('/',auth[_0xe7de('0x8')](),controller[_0xe7de('0x12')]);router['post'](_0xe7de('0xe'),auth[_0xe7de('0x8')](),controller['addTeams']);router['post'](_0xe7de('0x13'),auth[_0xe7de('0x8')](),controller['addAgents']);router[_0xe7de('0x14')](_0xe7de('0xb'),auth[_0xe7de('0x8')](),controller[_0xe7de('0x15')]);router[_0xe7de('0x16')](_0xe7de('0xb'),auth[_0xe7de('0x8')](),controller[_0xe7de('0x17')]);router['delete'](_0xe7de('0xe'),auth['isAuthenticated'](),controller[_0xe7de('0x18')]);router[_0xe7de('0x16')](_0xe7de('0x13'),auth[_0xe7de('0x8')](),controller[_0xe7de('0x19')]);module[_0xe7de('0x1a')]=router; \ No newline at end of file +var _0xea98=['delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','update','destroy'];(function(_0x3ac45c,_0x234181){var _0x5e9638=function(_0x3ddee0){while(--_0x3ddee0){_0x3ac45c['push'](_0x3ac45c['shift']());}};_0x5e9638(++_0x234181);}(_0xea98,0xed));var _0x8ea9=function(_0x2350dd,_0x53e293){_0x2350dd=_0x2350dd-0x0;var _0x5ca2db=_0xea98[_0x2350dd];return _0x5ca2db;};'use strict';var multer=require(_0x8ea9('0x0'));var util=require(_0x8ea9('0x1'));var path=require(_0x8ea9('0x2'));var timeout=require(_0x8ea9('0x3'));var express=require(_0x8ea9('0x4'));var router=express[_0x8ea9('0x5')]();var fs_extra=require(_0x8ea9('0x6'));var auth=require(_0x8ea9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea9('0x8'));var controller=require(_0x8ea9('0x9'));router[_0x8ea9('0xa')]('/',auth[_0x8ea9('0xb')](),controller['index']);router[_0x8ea9('0xa')](_0x8ea9('0xc'),auth[_0x8ea9('0xb')](),controller['describe']);router['get']('/:id',auth[_0x8ea9('0xb')](),controller[_0x8ea9('0xd')]);router['get'](_0x8ea9('0xe'),auth['isAuthenticated'](),controller[_0x8ea9('0xf')]);router['get'](_0x8ea9('0x10'),auth[_0x8ea9('0xb')](),controller['getTeams']);router[_0x8ea9('0xa')](_0x8ea9('0x11'),auth['isAuthenticated'](),controller[_0x8ea9('0x12')]);router[_0x8ea9('0x13')]('/',auth[_0x8ea9('0xb')](),controller[_0x8ea9('0x14')]);router['post']('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0x8ea9('0x13')](_0x8ea9('0x11'),auth['isAuthenticated'](),controller['addAgents']);router['put']('/:id',auth[_0x8ea9('0xb')](),controller[_0x8ea9('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8ea9('0x16')]);router[_0x8ea9('0x17')]('/:id/teams',auth[_0x8ea9('0xb')](),controller[_0x8ea9('0x18')]);router[_0x8ea9('0x17')](_0x8ea9('0x11'),auth['isAuthenticated'](),controller[_0x8ea9('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index ed4d374..78eec3f 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 _0xd991=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x2ce63e,_0x36c020){var _0x34ea3f=function(_0x5a6177){while(--_0x5a6177){_0x2ce63e['push'](_0x2ce63e['shift']());}};_0x34ea3f(++_0x36c020);}(_0xd991,0xd7));var _0x1d99=function(_0x149636,_0x3fee37){_0x149636=_0x149636-0x0;var _0x457f4a=_0xd991[_0x149636];return _0x457f4a;};'use strict';var Sequelize=require(_0x1d99('0x0'));module[_0x1d99('0x1')]={'name':{'type':Sequelize[_0x1d99('0x2')],'unique':_0x1d99('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1d99('0x2')]},'timeout':{'type':Sequelize[_0x1d99('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1d99('0x5')](_0x1d99('0x6'),_0x1d99('0x7'),_0x1d99('0x8'))}}; \ No newline at end of file +var _0x7432=['STRING','name','ENUM','rrmemory','roundrobin','sequelize','exports'];(function(_0x389f1b,_0x331a57){var _0x212167=function(_0x33cf46){while(--_0x33cf46){_0x389f1b['push'](_0x389f1b['shift']());}};_0x212167(++_0x331a57);}(_0x7432,0xe5));var _0x2743=function(_0x8ee598,_0x3d2099){_0x8ee598=_0x8ee598-0x0;var _0x4eb269=_0x7432[_0x8ee598];return _0x4eb269;};'use strict';var Sequelize=require(_0x2743('0x0'));module[_0x2743('0x1')]={'name':{'type':Sequelize[_0x2743('0x2')],'unique':_0x2743('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2743('0x4')](_0x2743('0x5'),'beepall',_0x2743('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index c0e1057..9170f07 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 _0xc064=['type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','params','fields','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','rawAttributes','nolimit','pick','MailQueueId','options','UserMailQueue','findAll','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','length','addTeams','ids','User','online','voicePause','interface','Agents','sequelize','each','forEach','emit','userMailQueue:save','removeTeams','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','QueryTypes','SELECT','TeamId','all','compact','value','transaction','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','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/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','error','stack','name','index','map','MailQueue','fieldName'];(function(_0x83da07,_0x9bdf2d){var _0x464601=function(_0x822164){while(--_0x822164){_0x83da07['push'](_0x83da07['shift']());}};_0x464601(++_0x9bdf2d);}(_0xc064,0x174));var _0x4c06=function(_0x2ec5bd,_0x1d282f){_0x2ec5bd=_0x2ec5bd-0x0;var _0x33cb29=_0xc064[_0x2ec5bd];return _0x33cb29;};'use strict';var emlformat=require(_0x4c06('0x0'));var rimraf=require(_0x4c06('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4c06('0x2'));var rp=require(_0x4c06('0x3'));var moment=require(_0x4c06('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4c06('0x5'));var util=require('util');var path=require(_0x4c06('0x6'));var sox=require('sox');var csv=require(_0x4c06('0x7'));var ejs=require(_0x4c06('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4c06('0x9'));var squel=require(_0x4c06('0xa'));var crypto=require(_0x4c06('0xb'));var jsforce=require(_0x4c06('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4c06('0xd'));var Papa=require(_0x4c06('0xe'));var Redis=require('ioredis');var authService=require(_0x4c06('0xf'));var qs=require(_0x4c06('0x10'));var as=require(_0x4c06('0x11'));var hardwareService=require(_0x4c06('0x12'));var logger=require(_0x4c06('0x13'))(_0x4c06('0x14'));var utils=require(_0x4c06('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4c06('0x16'));var db=require(_0x4c06('0x17'))['db'];config[_0x4c06('0x18')]=_[_0x4c06('0x19')](config['redis'],{'host':_0x4c06('0x1a'),'port':0x18eb});var socket=require(_0x4c06('0x1b'))(new Redis(config['redis']));require(_0x4c06('0x1c'))[_0x4c06('0x1d')](socket);function respondWithStatusCode(_0x19915e,_0x3e6b6e){_0x3e6b6e=_0x3e6b6e||0xcc;return function(_0x398917){if(_0x398917){return _0x19915e[_0x4c06('0x1e')](_0x3e6b6e);}return _0x19915e['status'](_0x3e6b6e)[_0x4c06('0x1f')]();};}function respondWithResult(_0x4e8b3e,_0xdff169){_0xdff169=_0xdff169||0xc8;return function(_0x2f0b5e){if(_0x2f0b5e){return _0x4e8b3e[_0x4c06('0x20')](_0xdff169)[_0x4c06('0x21')](_0x2f0b5e);}};}function respondWithFilteredResult(_0x491549,_0x246277){return function(_0x15f413){if(_0x15f413){var _0x3a29ec=typeof _0x246277[_0x4c06('0x22')]===_0x4c06('0x23')&&typeof _0x246277[_0x4c06('0x24')]===_0x4c06('0x23');var _0x18e7a8=_0x15f413[_0x4c06('0x25')];var _0x3e7b26=_0x3a29ec?0x0:_0x246277[_0x4c06('0x22')];var _0x5e5059=_0x3a29ec?_0x15f413[_0x4c06('0x25')]:_0x246277['offset']+_0x246277[_0x4c06('0x24')];var _0x4ac0a2;if(_0x5e5059>=_0x18e7a8){_0x5e5059=_0x18e7a8;_0x4ac0a2=0xc8;}else{_0x4ac0a2=0xce;}_0x491549['status'](_0x4ac0a2);return _0x491549[_0x4c06('0x26')](_0x4c06('0x27'),_0x3e7b26+'-'+_0x5e5059+'/'+_0x18e7a8)[_0x4c06('0x21')](_0x15f413);}return null;};}function patchUpdates(_0x57868f){return function(_0xfad6e4){try{jsonpatch[_0x4c06('0x28')](_0xfad6e4,_0x57868f,!![]);}catch(_0x3bb93a){return BPromise[_0x4c06('0x29')](_0x3bb93a);}return _0xfad6e4[_0x4c06('0x2a')]();};}function saveUpdates(_0x38e197,_0x7ec8b7){return function(_0x244c28){if(_0x244c28){return _0x244c28[_0x4c06('0x2b')](_0x38e197)[_0x4c06('0x2c')](function(_0x12ef17){return _0x12ef17;});}return null;};}function removeEntity(_0x3662b3,_0x5dbd62){return function(_0x5a63d6){if(_0x5a63d6){return _0x5a63d6[_0x4c06('0x2d')]()[_0x4c06('0x2c')](function(){var _0x48edd8=_0x5a63d6[_0x4c06('0x2e')]({'plain':!![]});var _0x459ad4='MailQueues';return db['UserProfileResource'][_0x4c06('0x2d')]({'where':{'type':_0x459ad4,'resourceId':_0x48edd8['id']}})['then'](function(){return _0x5a63d6;});})['then'](function(){_0x3662b3[_0x4c06('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x591f78,_0x101106){return function(_0x5ba9be){if(!_0x5ba9be){_0x591f78[_0x4c06('0x1e')](0x194);}return _0x5ba9be;};}function handleError(_0x2efc2c,_0x1df8f1){_0x1df8f1=_0x1df8f1||0x1f4;return function(_0x3c3c05){logger[_0x4c06('0x2f')](_0x3c3c05[_0x4c06('0x30')]);if(_0x3c3c05['name']){delete _0x3c3c05[_0x4c06('0x31')];}_0x2efc2c[_0x4c06('0x20')](_0x1df8f1)['send'](_0x3c3c05);};}exports[_0x4c06('0x32')]=function(_0x41ebdf,_0x1d9fdf){var _0x2fcfa5={},_0x327621={},_0xeef8b3={'count':0x0,'rows':[]};var _0x458ae8=_[_0x4c06('0x33')](db[_0x4c06('0x34')]['rawAttributes'],function(_0x3e9012){return{'name':_0x3e9012[_0x4c06('0x35')],'type':_0x3e9012[_0x4c06('0x36')][_0x4c06('0x37')]};});_0x327621[_0x4c06('0x38')]=_['map'](_0x458ae8,_0x4c06('0x31'));_0x327621[_0x4c06('0x39')]=_[_0x4c06('0x3a')](_0x41ebdf['query']);_0x327621[_0x4c06('0x3b')]=_[_0x4c06('0x3c')](_0x327621[_0x4c06('0x38')],_0x327621['query']);_0x2fcfa5['attributes']=_['intersection'](_0x327621[_0x4c06('0x38')],qs['fields'](_0x41ebdf[_0x4c06('0x39')]['fields']));_0x2fcfa5[_0x4c06('0x3d')]=_0x2fcfa5['attributes']['length']?_0x2fcfa5[_0x4c06('0x3d')]:_0x327621[_0x4c06('0x38')];if(!_0x41ebdf['query'][_0x4c06('0x3e')]('nolimit')){_0x2fcfa5['limit']=qs['limit'](_0x41ebdf[_0x4c06('0x39')][_0x4c06('0x24')]);_0x2fcfa5[_0x4c06('0x22')]=qs['offset'](_0x41ebdf['query'][_0x4c06('0x22')]);}_0x2fcfa5[_0x4c06('0x3f')]=qs['sort'](_0x41ebdf[_0x4c06('0x39')][_0x4c06('0x40')]);_0x2fcfa5[_0x4c06('0x41')]=qs['filters'](_['pick'](_0x41ebdf[_0x4c06('0x39')],_0x327621[_0x4c06('0x3b')]),_0x458ae8);if(_0x41ebdf[_0x4c06('0x39')]['filter']){_0x2fcfa5[_0x4c06('0x41')]=_[_0x4c06('0x42')](_0x2fcfa5[_0x4c06('0x41')],{'$or':_['map'](_0x458ae8,function(_0x122224){if(_0x122224['type']!==_0x4c06('0x43')){var _0x554564={};_0x554564[_0x122224[_0x4c06('0x31')]]={'$like':'%'+_0x41ebdf[_0x4c06('0x39')][_0x4c06('0x44')]+'%'};return _0x554564;}})});}_0x2fcfa5=_[_0x4c06('0x42')]({},_0x2fcfa5,_0x41ebdf['options']);var _0x24b102={'where':_0x2fcfa5['where']};return db[_0x4c06('0x34')][_0x4c06('0x25')](_0x24b102)[_0x4c06('0x2c')](function(_0x1c5c99){_0xeef8b3[_0x4c06('0x25')]=_0x1c5c99;if(_0x41ebdf[_0x4c06('0x39')][_0x4c06('0x45')]){_0x2fcfa5[_0x4c06('0x46')]=[{'all':!![]}];}return db['MailQueue']['findAll'](_0x2fcfa5);})['then'](function(_0x12cda5){_0xeef8b3[_0x4c06('0x47')]=_0x12cda5;return _0xeef8b3;})[_0x4c06('0x2c')](respondWithFilteredResult(_0x1d9fdf,_0x2fcfa5))[_0x4c06('0x48')](handleError(_0x1d9fdf,null));};exports[_0x4c06('0x49')]=function(_0x5a4394,_0x2bfc60){var _0x4be08b={'raw':!![],'where':{'id':_0x5a4394[_0x4c06('0x4a')]['id']}},_0x27e9bd={};_0x27e9bd[_0x4c06('0x38')]=_[_0x4c06('0x3a')](db['MailQueue']['rawAttributes']);_0x27e9bd[_0x4c06('0x39')]=_[_0x4c06('0x3a')](_0x5a4394[_0x4c06('0x39')]);_0x27e9bd[_0x4c06('0x3b')]=_['intersection'](_0x27e9bd[_0x4c06('0x38')],_0x27e9bd[_0x4c06('0x39')]);_0x4be08b[_0x4c06('0x3d')]=_[_0x4c06('0x3c')](_0x27e9bd[_0x4c06('0x38')],qs[_0x4c06('0x4b')](_0x5a4394[_0x4c06('0x39')]['fields']));_0x4be08b[_0x4c06('0x3d')]=_0x4be08b['attributes']['length']?_0x4be08b[_0x4c06('0x3d')]:_0x27e9bd[_0x4c06('0x38')];if(_0x5a4394['query'][_0x4c06('0x45')]){_0x4be08b['include']=[{'all':!![]}];}_0x4be08b=_[_0x4c06('0x42')]({},_0x4be08b,_0x5a4394['options']);return db[_0x4c06('0x34')]['find'](_0x4be08b)[_0x4c06('0x2c')](handleEntityNotFound(_0x2bfc60,null))[_0x4c06('0x2c')](respondWithResult(_0x2bfc60,null))[_0x4c06('0x48')](handleError(_0x2bfc60,null));};exports[_0x4c06('0x4c')]=function(_0x35be4b,_0x14775d){return db[_0x4c06('0x34')][_0x4c06('0x4c')](_0x35be4b['body'],{})[_0x4c06('0x2c')](function(_0x2e82e0){var _0x28b0f4=_0x35be4b['user'][_0x4c06('0x2e')]({'plain':!![]});if(!_0x28b0f4)throw new Error(_0x4c06('0x4d'));if(_0x28b0f4[_0x4c06('0x4e')]===_0x4c06('0x4f')){var _0x3a2c10=_0x2e82e0[_0x4c06('0x2e')]({'plain':!![]});var _0x9cac45='MailQueues';return db[_0x4c06('0x50')][_0x4c06('0x51')]({'where':{'name':_0x9cac45,'userProfileId':_0x28b0f4[_0x4c06('0x52')]},'raw':!![]})['then'](function(_0x3b45f9){if(_0x3b45f9&&_0x3b45f9[_0x4c06('0x53')]===0x0){return db[_0x4c06('0x54')][_0x4c06('0x4c')]({'name':_0x3a2c10['name'],'resourceId':_0x3a2c10['id'],'type':_0x3b45f9[_0x4c06('0x31')],'sectionId':_0x3b45f9['id']},{})[_0x4c06('0x2c')](function(){return _0x2e82e0;});}else{return _0x2e82e0;}})[_0x4c06('0x48')](function(_0x46787e){logger['error'](_0x4c06('0x55'),_0x46787e);throw _0x46787e;});}return _0x2e82e0;})[_0x4c06('0x2c')](respondWithResult(_0x14775d,0xc9))[_0x4c06('0x48')](handleError(_0x14775d,null));};exports[_0x4c06('0x2b')]=function(_0x3a62b6,_0x4718eb){if(_0x3a62b6[_0x4c06('0x56')]['id']){delete _0x3a62b6[_0x4c06('0x56')]['id'];}return db[_0x4c06('0x34')][_0x4c06('0x51')]({'where':{'id':_0x3a62b6[_0x4c06('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4718eb,null))[_0x4c06('0x2c')](saveUpdates(_0x3a62b6[_0x4c06('0x56')],null))[_0x4c06('0x2c')](respondWithResult(_0x4718eb,null))[_0x4c06('0x48')](handleError(_0x4718eb,null));};exports[_0x4c06('0x2d')]=function(_0x308281,_0x4f4ee9){return db['MailQueue']['find']({'where':{'id':_0x308281[_0x4c06('0x4a')]['id']}})[_0x4c06('0x2c')](handleEntityNotFound(_0x4f4ee9,null))['then'](removeEntity(_0x4f4ee9,null))[_0x4c06('0x48')](handleError(_0x4f4ee9,null));};exports[_0x4c06('0x57')]=function(_0x25d924,_0x5d0df1){return db[_0x4c06('0x34')]['describe']()[_0x4c06('0x2c')](respondWithResult(_0x5d0df1,null))[_0x4c06('0x48')](handleError(_0x5d0df1,null));};exports['getMembers']=function(_0x1cd340,_0x101e14,_0x2bd705){var _0x591d3b={'raw':!![],'where':{}},_0x36337b={},_0x272111;return db[_0x4c06('0x34')]['findOne']({'where':{'id':_0x1cd340[_0x4c06('0x4a')]['id']}})[_0x4c06('0x2c')](handleEntityNotFound(_0x101e14,null))['then'](function(_0x2704bb){if(_0x2704bb){_0x272111=_0x2704bb[_0x4c06('0x2e')]({'plain':!![]});_0x36337b[_0x4c06('0x38')]=_[_0x4c06('0x3a')](db['UserMailQueue'][_0x4c06('0x58')]);_0x36337b[_0x4c06('0x39')]=_['keys'](_0x1cd340[_0x4c06('0x39')]);_0x36337b[_0x4c06('0x3b')]=_['intersection'](_0x36337b[_0x4c06('0x38')],_0x36337b[_0x4c06('0x39')]);_0x591d3b['attributes']=_['intersection'](_0x36337b[_0x4c06('0x38')],qs[_0x4c06('0x4b')](_0x1cd340[_0x4c06('0x39')][_0x4c06('0x4b')]));_0x591d3b[_0x4c06('0x3d')]=_0x591d3b['attributes']['length']?_0x591d3b[_0x4c06('0x3d')]:_0x36337b[_0x4c06('0x38')];if(!_0x1cd340[_0x4c06('0x39')][_0x4c06('0x3e')](_0x4c06('0x59'))){_0x591d3b[_0x4c06('0x24')]=qs[_0x4c06('0x24')](_0x1cd340['query'][_0x4c06('0x24')]);_0x591d3b[_0x4c06('0x22')]=qs[_0x4c06('0x22')](_0x1cd340['query'][_0x4c06('0x22')]);}_0x591d3b[_0x4c06('0x3f')]=qs['sort'](_0x1cd340[_0x4c06('0x39')][_0x4c06('0x40')]);_0x591d3b[_0x4c06('0x41')]=qs['filters'](_[_0x4c06('0x5a')](_0x1cd340[_0x4c06('0x39')],_0x36337b[_0x4c06('0x3b')]));_0x591d3b['where'][_0x4c06('0x5b')]=_0x2704bb['id'];if(_0x1cd340[_0x4c06('0x39')][_0x4c06('0x44')]){_0x591d3b[_0x4c06('0x41')]=_['merge'](_0x591d3b[_0x4c06('0x41')],{'$or':_[_0x4c06('0x33')](_0x591d3b[_0x4c06('0x3d')],function(_0x3150f6){var _0x2ee3c1={};_0x2ee3c1[_0x3150f6]={'$like':'%'+_0x1cd340['query'][_0x4c06('0x44')]+'%'};return _0x2ee3c1;})});}_0x591d3b=_['merge']({},_0x591d3b,_0x1cd340[_0x4c06('0x5c')]);return db[_0x4c06('0x5d')][_0x4c06('0x5e')](_0x591d3b);}})[_0x4c06('0x2c')](function(_0xdf9af0){if(_0xdf9af0){return db['User'][_0x4c06('0x5f')]({'where':{'id':_[_0x4c06('0x33')](_0xdf9af0,_0x4c06('0x60')),'role':_0x4c06('0x61')},'attributes':['id',_0x4c06('0x31'),_0x4c06('0x62'),_0x4c06('0x63'),_0x4c06('0x64')]});}})[_0x4c06('0x2c')](function(_0x24932c){if(_0x24932c){return{'count':_0x24932c[_0x4c06('0x25')],'rows':_['map'](_0x24932c[_0x4c06('0x47')],function(_0xfe5550){return{'membername':_0xfe5550[_0x4c06('0x31')],'UserId':_0xfe5550['id'],'queue_name':_0x272111[_0x4c06('0x31')],'MailQueueId':_0x272111['id'],'interface':util[_0x4c06('0x65')](_0x4c06('0x66'),_0x4c06('0x67'),_0xfe5550[_0x4c06('0x31')]),'penalty':0x0,'paused':_0xfe5550[_0x4c06('0x62')],'createdAt':_0xfe5550['createdAt'],'updatedAt':_0xfe5550[_0x4c06('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4c06('0x2c')](respondWithFilteredResult(_0x101e14,_0x591d3b))[_0x4c06('0x48')](handleError(_0x101e14,null));};exports[_0x4c06('0x68')]=function(_0x4c243e,_0x54c626,_0x1d92c5){var _0x540869={};var _0x550367={};var _0x2b91dc;var _0x17dace;return db[_0x4c06('0x34')][_0x4c06('0x69')]({'where':{'id':_0x4c243e[_0x4c06('0x4a')]['id']}})[_0x4c06('0x2c')](handleEntityNotFound(_0x54c626,null))[_0x4c06('0x2c')](function(_0x15a8d4){if(_0x15a8d4){_0x2b91dc=_0x15a8d4;_0x550367[_0x4c06('0x38')]=_[_0x4c06('0x3a')](db[_0x4c06('0x6a')]['rawAttributes']);_0x550367[_0x4c06('0x39')]=_['keys'](_0x4c243e[_0x4c06('0x39')]);_0x550367['filters']=_[_0x4c06('0x3c')](_0x550367[_0x4c06('0x38')],_0x550367[_0x4c06('0x39')]);_0x540869[_0x4c06('0x3d')]=_[_0x4c06('0x3c')](_0x550367[_0x4c06('0x38')],qs[_0x4c06('0x4b')](_0x4c243e['query'][_0x4c06('0x4b')]));_0x540869[_0x4c06('0x3d')]=_0x540869['attributes']['length']?_0x540869[_0x4c06('0x3d')]:_0x550367[_0x4c06('0x38')];_0x540869[_0x4c06('0x3f')]=qs[_0x4c06('0x40')](_0x4c243e['query']['sort']);_0x540869[_0x4c06('0x41')]=qs[_0x4c06('0x3b')](_['pick'](_0x4c243e[_0x4c06('0x39')],_0x550367[_0x4c06('0x3b')]));if(_0x4c243e[_0x4c06('0x39')]['filter']){_0x540869[_0x4c06('0x41')]=_['merge'](_0x540869['where'],{'$or':_[_0x4c06('0x33')](_0x540869[_0x4c06('0x3d')],function(_0x17451d){var _0x34405a={};_0x34405a[_0x17451d]={'$like':'%'+_0x4c243e['query'][_0x4c06('0x44')]+'%'};return _0x34405a;})});}_0x540869=_[_0x4c06('0x42')]({},_0x540869,_0x4c243e[_0x4c06('0x5c')]);return _0x2b91dc[_0x4c06('0x68')](_0x540869);}})[_0x4c06('0x2c')](function(_0x3ba2e2){if(_0x3ba2e2){_0x17dace=_0x3ba2e2[_0x4c06('0x6b')];if(!_0x4c243e[_0x4c06('0x39')][_0x4c06('0x3e')](_0x4c06('0x59'))){_0x540869[_0x4c06('0x24')]=qs[_0x4c06('0x24')](_0x4c243e['query'][_0x4c06('0x24')]);_0x540869[_0x4c06('0x22')]=qs['offset'](_0x4c243e[_0x4c06('0x39')]['offset']);}return _0x2b91dc[_0x4c06('0x68')](_0x540869);}})[_0x4c06('0x2c')](function(_0x2edfbc){if(_0x2edfbc){return _0x2edfbc?{'count':_0x17dace,'rows':_0x2edfbc}:null;}})['then'](respondWithResult(_0x54c626,null))[_0x4c06('0x48')](handleError(_0x54c626,null));};exports[_0x4c06('0x6c')]=function(_0x319302,_0x519a74,_0xfb713d){var _0x4529f5=_0x319302['body'][_0x4c06('0x6d')];return db[_0x4c06('0x6a')]['findAll']({'where':{'id':_0x4529f5},'attributes':['id'],'include':[{'model':db[_0x4c06('0x6e')],'as':'Agents','attributes':['id','name',_0x4c06('0x6f'),_0x4c06('0x70'),_0x4c06('0x71')],'raw':!![]}]})[_0x4c06('0x2c')](function(_0x160d45){if(_0x160d45){var _0x3687e3=_['flatMap'](_0x160d45,function(_0x5dd95d){var _0x4953bf=_0x5dd95d['get']({'plain':!![]});return _0x4953bf[_0x4c06('0x72')];});return db[_0x4c06('0x34')]['find']({'where':{'id':_0x319302['params']['id']}})[_0x4c06('0x2c')](function(_0x1bc7b3){return db[_0x4c06('0x73')]['transaction'](function(_0x27ee9a){return _0x1bc7b3[_0x4c06('0x6c')](_0x4529f5,{'transaction':_0x27ee9a})[_0x4c06('0x2c')](function(){return BPromise[_0x4c06('0x74')](_0x3687e3,function(_0x20b463){return db['UserMailQueue']['findOrCreate']({'where':{'UserId':_0x20b463['id'],'MailQueueId':_0x319302[_0x4c06('0x4a')]['id']},'transaction':_0x27ee9a});});})['then'](function(){_0x3687e3[_0x4c06('0x75')](function(_0x24fbe4){socket[_0x4c06('0x76')](_0x4c06('0x77'),{'UserId':_0x24fbe4['id'],'MailQueueId':_0x1bc7b3['id']});});});});});}})['then'](respondWithStatusCode(_0x519a74,null))[_0x4c06('0x48')](handleError(_0x519a74,null));};exports[_0x4c06('0x78')]=function(_0xde61bc,_0x51c303,_0x4f2b18){return db['Team']['findAll']({'where':{'id':_0xde61bc[_0x4c06('0x39')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x51c303,null))[_0x4c06('0x2c')](function(_0x5cabd9){var _0x50166a=_['map'](_0x5cabd9,'id');var _0x19d3ef=[];var _0x4fb4dd=[];var _0x3551e5=squel['select']();_0x3551e5[_0x4c06('0x79')]('tq.TeamId')[_0x4c06('0x7a')]('team_has_mail_queues','tq')[_0x4c06('0x7b')](_0x4c06('0x7c'),'ut',_0x4c06('0x7d'))[_0x4c06('0x41')]('MailQueueId\x20=\x20?',_0xde61bc[_0x4c06('0x4a')]['id']);for(var _0x2f52d2=0x0;_0x2f52d2<_0x5cabd9['length'];_0x2f52d2+=0x1){let _0x2220ae=_0x5cabd9[_0x2f52d2];for(var _0x1f7e46=0x0;_0x1f7e46<_0x2220ae[_0x4c06('0x72')][_0x4c06('0x6b')];_0x1f7e46+=0x1){let _0x5e2805=_0x2220ae[_0x4c06('0x72')][_0x1f7e46];var _0x11547b=_0x3551e5[_0x4c06('0x7e')]();_0x11547b['where']('ut.UserId\x20=\x20?',_0x5e2805['id']);_0x4fb4dd[_0x4c06('0x7f')](db['sequelize'][_0x4c06('0x39')](_0x11547b['toString'](),{'type':db[_0x4c06('0x73')][_0x4c06('0x80')][_0x4c06('0x81')]})[_0x4c06('0x2c')](function(_0x2f0106){if(_0x2f0106[_0x4c06('0x6b')]===0x1){return _0x5e2805['id'];}else{var _0x33a012=_['every'](_[_0x4c06('0x33')](_0x2f0106,_0x4c06('0x82')),function(_0x47bb41){return _['includes'](_0x50166a,_0x47bb41);});if(_0x33a012){return _0x5e2805['id'];}}}));}}return BPromise[_0x4c06('0x83')](_0x4fb4dd)[_0x4c06('0x2c')](function(_0x1cb6da){_0x19d3ef=_(_0x19d3ef)['union'](_0x1cb6da)[_0x4c06('0x84')]()[_0x4c06('0x85')]();return db[_0x4c06('0x34')][_0x4c06('0x51')]({'where':{'id':_0xde61bc[_0x4c06('0x4a')]['id']}})[_0x4c06('0x2c')](function(_0xe71856){return db[_0x4c06('0x73')][_0x4c06('0x86')](function(_0x4abe6c){return _0xe71856[_0x4c06('0x78')](_0xde61bc[_0x4c06('0x39')][_0x4c06('0x6d')],{'transaction':_0x4abe6c})[_0x4c06('0x2c')](function(){if(!_['isEmpty'](_0x19d3ef)){return _0xe71856[_0x4c06('0x87')](_0x19d3ef,{'transaction':_0x4abe6c});}})['then'](function(){_0x19d3ef[_0x4c06('0x75')](function(_0x1d1050){socket[_0x4c06('0x76')](_0x4c06('0x88'),{'UserId':_0x1d1050,'MailQueueId':_0xe71856['id']});});});});});});})[_0x4c06('0x2c')](respondWithStatusCode(_0x51c303,null))[_0x4c06('0x48')](handleError(_0x51c303,null));};exports[_0x4c06('0x89')]=function(_0x2c4b48,_0x58e47f,_0x667b85){return db[_0x4c06('0x34')][_0x4c06('0x51')]({'where':{'id':_0x2c4b48[_0x4c06('0x4a')]['id']}})[_0x4c06('0x2c')](handleEntityNotFound(_0x58e47f,null))[_0x4c06('0x2c')](function(_0x20a3fa){if(_0x20a3fa){return _0x20a3fa['addAgents'](_0x2c4b48['body'][_0x4c06('0x6d')],_[_0x4c06('0x8a')](_0x2c4b48[_0x4c06('0x56')],[_0x4c06('0x6d'),'id'])||{})[_0x4c06('0x8b')](function(_0x267066){for(var _0x57fafd=0x0;_0x57fafd<_0x2c4b48[_0x4c06('0x56')][_0x4c06('0x6d')][_0x4c06('0x6b')];_0x57fafd+=0x1){socket['emit']('userMailQueue:save',{'UserId':Number(_0x2c4b48[_0x4c06('0x56')][_0x4c06('0x6d')][_0x57fafd]),'MailQueueId':Number(_0x2c4b48[_0x4c06('0x4a')]['id'])});}return _0x267066;});}})[_0x4c06('0x2c')](respondWithResult(_0x58e47f,null))[_0x4c06('0x48')](handleError(_0x58e47f,null));};exports['removeAgents']=function(_0x2450da,_0x39da0a,_0x229216){return db[_0x4c06('0x34')]['find']({'where':{'id':_0x2450da[_0x4c06('0x4a')]['id']}})[_0x4c06('0x2c')](handleEntityNotFound(_0x39da0a,null))[_0x4c06('0x2c')](function(_0x25b137){if(_0x25b137){return _0x25b137[_0x4c06('0x87')](_0x2450da[_0x4c06('0x39')][_0x4c06('0x6d')])[_0x4c06('0x2c')](function(){if(_[_0x4c06('0x8c')](_0x2450da[_0x4c06('0x39')]['ids'])){for(var _0x56c355=0x0;_0x56c355<_0x2450da['query']['ids'][_0x4c06('0x6b')];_0x56c355+=0x1){socket[_0x4c06('0x76')](_0x4c06('0x88'),{'UserId':Number(_0x2450da[_0x4c06('0x39')][_0x4c06('0x6d')][_0x56c355]),'MailQueueId':Number(_0x2450da[_0x4c06('0x4a')]['id'])});}}else{socket[_0x4c06('0x76')](_0x4c06('0x88'),{'UserId':Number(_0x2450da[_0x4c06('0x39')][_0x4c06('0x6d')]),'MailQueueId':Number(_0x2450da['params']['id'])});}});}})['then'](respondWithStatusCode(_0x39da0a,null))['catch'](handleError(_0x39da0a,null));};exports['getAgents']=function(_0x2b9653,_0x39fc7d,_0x1d896f){var _0x225919={};var _0x55bbb3={};var _0x233eaf;var _0x350ae2;return db[_0x4c06('0x34')][_0x4c06('0x69')]({'where':{'id':_0x2b9653[_0x4c06('0x4a')]['id']}})[_0x4c06('0x2c')](handleEntityNotFound(_0x39fc7d,null))['then'](function(_0x1c33e6){if(_0x1c33e6){_0x233eaf=_0x1c33e6;_0x55bbb3[_0x4c06('0x38')]=_['keys'](db['User'][_0x4c06('0x58')]);_0x55bbb3[_0x4c06('0x39')]=_[_0x4c06('0x3a')](_0x2b9653['query']);_0x55bbb3[_0x4c06('0x3b')]=_['intersection'](_0x55bbb3[_0x4c06('0x38')],_0x55bbb3[_0x4c06('0x39')]);_0x225919[_0x4c06('0x3d')]=_[_0x4c06('0x3c')](_0x55bbb3[_0x4c06('0x38')],qs[_0x4c06('0x4b')](_0x2b9653['query'][_0x4c06('0x4b')]));_0x225919[_0x4c06('0x3d')]=_0x225919[_0x4c06('0x3d')][_0x4c06('0x6b')]?_0x225919[_0x4c06('0x3d')]:_0x55bbb3['model'];_0x225919['order']=qs[_0x4c06('0x40')](_0x2b9653[_0x4c06('0x39')][_0x4c06('0x40')]);_0x225919[_0x4c06('0x41')]=qs[_0x4c06('0x3b')](_[_0x4c06('0x5a')](_0x2b9653[_0x4c06('0x39')],_0x55bbb3[_0x4c06('0x3b')]));if(_0x2b9653[_0x4c06('0x39')][_0x4c06('0x44')]){_0x225919[_0x4c06('0x41')]=_[_0x4c06('0x42')](_0x225919[_0x4c06('0x41')],{'$or':_[_0x4c06('0x33')](_0x225919[_0x4c06('0x3d')],function(_0x3d210f){var _0x36eee8={};_0x36eee8[_0x3d210f]={'$like':'%'+_0x2b9653[_0x4c06('0x39')]['filter']+'%'};return _0x36eee8;})});}_0x225919=_[_0x4c06('0x42')]({},_0x225919,_0x2b9653[_0x4c06('0x5c')]);return _0x233eaf[_0x4c06('0x8d')](_0x225919);}})['then'](function(_0x48abbf){if(_0x48abbf){_0x350ae2=_0x48abbf[_0x4c06('0x6b')];if(!_0x2b9653[_0x4c06('0x39')][_0x4c06('0x3e')](_0x4c06('0x59'))){_0x225919[_0x4c06('0x24')]=qs[_0x4c06('0x24')](_0x2b9653['query'][_0x4c06('0x24')]);_0x225919[_0x4c06('0x22')]=qs[_0x4c06('0x22')](_0x2b9653['query'][_0x4c06('0x22')]);}return _0x233eaf['getAgents'](_0x225919);}})[_0x4c06('0x2c')](function(_0x42f7c5){if(_0x42f7c5){return _0x42f7c5?{'count':_0x350ae2,'rows':_0x42f7c5}:null;}})[_0x4c06('0x2c')](respondWithResult(_0x39fc7d,null))['catch'](handleError(_0x39fc7d,null));}; \ No newline at end of file +var _0x5eec=['every','includes','all','union','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','isArray','getAgents','eml-format','zip-dir','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','sendStatus','error','stack','send','map','MailQueue','rawAttributes','fieldName','type','model','name','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','length','create','body','user','MailQueues','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','catch','describe','getMembers','findOne','UserMailQueue','User','UserId','agent','updatedAt','rows','format','%s/%s','mailPause','getTeams','ids','Team','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','tq.TeamId','team_has_mail_queues','join','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT'];(function(_0x51fa70,_0x50f589){var _0x422305=function(_0x9c6994){while(--_0x9c6994){_0x51fa70['push'](_0x51fa70['shift']());}};_0x422305(++_0x50f589);}(_0x5eec,0x11b));var _0xc5ee=function(_0xad3dd1,_0x1f09f3){_0xad3dd1=_0xad3dd1-0x0;var _0x30f74d=_0x5eec[_0xad3dd1];return _0x30f74d;};'use strict';var emlformat=require(_0xc5ee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc5ee('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc5ee('0x2'));var moment=require('moment');var BPromise=require(_0xc5ee('0x3'));var Mustache=require(_0xc5ee('0x4'));var util=require(_0xc5ee('0x5'));var path=require('path');var sox=require(_0xc5ee('0x6'));var csv=require('to-csv');var ejs=require(_0xc5ee('0x7'));var fs=require('fs');var fs_extra=require(_0xc5ee('0x8'));var _=require(_0xc5ee('0x9'));var squel=require('squel');var crypto=require(_0xc5ee('0xa'));var jsforce=require(_0xc5ee('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc5ee('0xc'));var querystring=require(_0xc5ee('0xd'));var Papa=require(_0xc5ee('0xe'));var Redis=require(_0xc5ee('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc5ee('0x10'));var as=require(_0xc5ee('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc5ee('0x12'))('api');var utils=require(_0xc5ee('0x13'));var config=require(_0xc5ee('0x14'));var licenseUtil=require(_0xc5ee('0x15'));var db=require(_0xc5ee('0x16'))['db'];config[_0xc5ee('0x17')]=_[_0xc5ee('0x18')](config[_0xc5ee('0x17')],{'host':_0xc5ee('0x19'),'port':0x18eb});var socket=require(_0xc5ee('0x1a'))(new Redis(config[_0xc5ee('0x17')]));require(_0xc5ee('0x1b'))[_0xc5ee('0x1c')](socket);function respondWithStatusCode(_0x40651a,_0x5125c0){_0x5125c0=_0x5125c0||0xcc;return function(_0xc34b9c){if(_0xc34b9c){return _0x40651a['sendStatus'](_0x5125c0);}return _0x40651a[_0xc5ee('0x1d')](_0x5125c0)[_0xc5ee('0x1e')]();};}function respondWithResult(_0x2e3c99,_0x2e97fa){_0x2e97fa=_0x2e97fa||0xc8;return function(_0x4d2de8){if(_0x4d2de8){return _0x2e3c99[_0xc5ee('0x1d')](_0x2e97fa)[_0xc5ee('0x1f')](_0x4d2de8);}};}function respondWithFilteredResult(_0x21d519,_0x4d2ae1){return function(_0x466387){if(_0x466387){var _0x363c16=typeof _0x4d2ae1[_0xc5ee('0x20')]===_0xc5ee('0x21')&&typeof _0x4d2ae1[_0xc5ee('0x22')]===_0xc5ee('0x21');var _0x511541=_0x466387['count'];var _0x251206=_0x363c16?0x0:_0x4d2ae1[_0xc5ee('0x20')];var _0x39f9a4=_0x363c16?_0x466387[_0xc5ee('0x23')]:_0x4d2ae1[_0xc5ee('0x20')]+_0x4d2ae1[_0xc5ee('0x22')];var _0x281aa8;if(_0x39f9a4>=_0x511541){_0x39f9a4=_0x511541;_0x281aa8=0xc8;}else{_0x281aa8=0xce;}_0x21d519[_0xc5ee('0x1d')](_0x281aa8);return _0x21d519[_0xc5ee('0x24')](_0xc5ee('0x25'),_0x251206+'-'+_0x39f9a4+'/'+_0x511541)[_0xc5ee('0x1f')](_0x466387);}return null;};}function patchUpdates(_0x4653ac){return function(_0x508fe3){try{jsonpatch[_0xc5ee('0x26')](_0x508fe3,_0x4653ac,!![]);}catch(_0xffc3e7){return BPromise[_0xc5ee('0x27')](_0xffc3e7);}return _0x508fe3[_0xc5ee('0x28')]();};}function saveUpdates(_0x4ca88e,_0x2bcdf7){return function(_0x525ca0){if(_0x525ca0){return _0x525ca0[_0xc5ee('0x29')](_0x4ca88e)[_0xc5ee('0x2a')](function(_0x59ae89){return _0x59ae89;});}return null;};}function removeEntity(_0x3d84ab,_0x259ecb){return function(_0x44c4c7){if(_0x44c4c7){return _0x44c4c7[_0xc5ee('0x2b')]()[_0xc5ee('0x2a')](function(){var _0x1a34a4=_0x44c4c7[_0xc5ee('0x2c')]({'plain':!![]});var _0x2823b2='MailQueues';return db['UserProfileResource'][_0xc5ee('0x2b')]({'where':{'type':_0x2823b2,'resourceId':_0x1a34a4['id']}})[_0xc5ee('0x2a')](function(){return _0x44c4c7;});})[_0xc5ee('0x2a')](function(){_0x3d84ab['status'](0xcc)[_0xc5ee('0x1e')]();});}};}function handleEntityNotFound(_0x8796af,_0x48c33e){return function(_0x5b4b94){if(!_0x5b4b94){_0x8796af[_0xc5ee('0x2d')](0x194);}return _0x5b4b94;};}function handleError(_0x2cc757,_0xfaf3da){_0xfaf3da=_0xfaf3da||0x1f4;return function(_0x5cdd07){logger[_0xc5ee('0x2e')](_0x5cdd07[_0xc5ee('0x2f')]);if(_0x5cdd07['name']){delete _0x5cdd07['name'];}_0x2cc757[_0xc5ee('0x1d')](_0xfaf3da)[_0xc5ee('0x30')](_0x5cdd07);};}exports['index']=function(_0x3575c2,_0x4f0d22){var _0x1cd188={},_0x123af4={},_0x2b5ba5={'count':0x0,'rows':[]};var _0xaa7901=_[_0xc5ee('0x31')](db[_0xc5ee('0x32')][_0xc5ee('0x33')],function(_0x1a21f){return{'name':_0x1a21f[_0xc5ee('0x34')],'type':_0x1a21f[_0xc5ee('0x35')]['key']};});_0x123af4[_0xc5ee('0x36')]=_[_0xc5ee('0x31')](_0xaa7901,_0xc5ee('0x37'));_0x123af4[_0xc5ee('0x38')]=_[_0xc5ee('0x39')](_0x3575c2[_0xc5ee('0x38')]);_0x123af4[_0xc5ee('0x3a')]=_['intersection'](_0x123af4[_0xc5ee('0x36')],_0x123af4[_0xc5ee('0x38')]);_0x1cd188[_0xc5ee('0x3b')]=_[_0xc5ee('0x3c')](_0x123af4['model'],qs[_0xc5ee('0x3d')](_0x3575c2[_0xc5ee('0x38')][_0xc5ee('0x3d')]));_0x1cd188['attributes']=_0x1cd188[_0xc5ee('0x3b')]['length']?_0x1cd188['attributes']:_0x123af4[_0xc5ee('0x36')];if(!_0x3575c2[_0xc5ee('0x38')][_0xc5ee('0x3e')](_0xc5ee('0x3f'))){_0x1cd188[_0xc5ee('0x22')]=qs[_0xc5ee('0x22')](_0x3575c2[_0xc5ee('0x38')][_0xc5ee('0x22')]);_0x1cd188['offset']=qs[_0xc5ee('0x20')](_0x3575c2[_0xc5ee('0x38')][_0xc5ee('0x20')]);}_0x1cd188[_0xc5ee('0x40')]=qs[_0xc5ee('0x41')](_0x3575c2[_0xc5ee('0x38')]['sort']);_0x1cd188[_0xc5ee('0x42')]=qs[_0xc5ee('0x3a')](_[_0xc5ee('0x43')](_0x3575c2[_0xc5ee('0x38')],_0x123af4[_0xc5ee('0x3a')]),_0xaa7901);if(_0x3575c2['query'][_0xc5ee('0x44')]){_0x1cd188[_0xc5ee('0x42')]=_[_0xc5ee('0x45')](_0x1cd188[_0xc5ee('0x42')],{'$or':_[_0xc5ee('0x31')](_0xaa7901,function(_0x1d47cd){if(_0x1d47cd[_0xc5ee('0x35')]!==_0xc5ee('0x46')){var _0x36e4d8={};_0x36e4d8[_0x1d47cd['name']]={'$like':'%'+_0x3575c2['query'][_0xc5ee('0x44')]+'%'};return _0x36e4d8;}})});}_0x1cd188=_[_0xc5ee('0x45')]({},_0x1cd188,_0x3575c2[_0xc5ee('0x47')]);var _0x5cd3b2={'where':_0x1cd188[_0xc5ee('0x42')]};return db[_0xc5ee('0x32')][_0xc5ee('0x23')](_0x5cd3b2)[_0xc5ee('0x2a')](function(_0x18d3a9){_0x2b5ba5[_0xc5ee('0x23')]=_0x18d3a9;if(_0x3575c2[_0xc5ee('0x38')][_0xc5ee('0x48')]){_0x1cd188[_0xc5ee('0x49')]=[{'all':!![]}];}return db['MailQueue'][_0xc5ee('0x4a')](_0x1cd188);})[_0xc5ee('0x2a')](function(_0x11f342){_0x2b5ba5['rows']=_0x11f342;return _0x2b5ba5;})[_0xc5ee('0x2a')](respondWithFilteredResult(_0x4f0d22,_0x1cd188))['catch'](handleError(_0x4f0d22,null));};exports[_0xc5ee('0x4b')]=function(_0x2ec547,_0x38b561){var _0x4a9fad={'raw':!![],'where':{'id':_0x2ec547[_0xc5ee('0x4c')]['id']}},_0x29365a={};_0x29365a[_0xc5ee('0x36')]=_[_0xc5ee('0x39')](db[_0xc5ee('0x32')][_0xc5ee('0x33')]);_0x29365a[_0xc5ee('0x38')]=_[_0xc5ee('0x39')](_0x2ec547['query']);_0x29365a[_0xc5ee('0x3a')]=_[_0xc5ee('0x3c')](_0x29365a['model'],_0x29365a[_0xc5ee('0x38')]);_0x4a9fad[_0xc5ee('0x3b')]=_[_0xc5ee('0x3c')](_0x29365a['model'],qs[_0xc5ee('0x3d')](_0x2ec547[_0xc5ee('0x38')][_0xc5ee('0x3d')]));_0x4a9fad['attributes']=_0x4a9fad[_0xc5ee('0x3b')][_0xc5ee('0x4d')]?_0x4a9fad['attributes']:_0x29365a[_0xc5ee('0x36')];if(_0x2ec547[_0xc5ee('0x38')][_0xc5ee('0x48')]){_0x4a9fad[_0xc5ee('0x49')]=[{'all':!![]}];}_0x4a9fad=_['merge']({},_0x4a9fad,_0x2ec547[_0xc5ee('0x47')]);return db[_0xc5ee('0x32')]['find'](_0x4a9fad)['then'](handleEntityNotFound(_0x38b561,null))[_0xc5ee('0x2a')](respondWithResult(_0x38b561,null))['catch'](handleError(_0x38b561,null));};exports[_0xc5ee('0x4e')]=function(_0x300bed,_0x45d980){return db[_0xc5ee('0x32')][_0xc5ee('0x4e')](_0x300bed[_0xc5ee('0x4f')],{})[_0xc5ee('0x2a')](function(_0x54736d){var _0xdbbf4a=_0x300bed[_0xc5ee('0x50')][_0xc5ee('0x2c')]({'plain':!![]});if(!_0xdbbf4a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xdbbf4a['role']===_0xc5ee('0x50')){var _0x5b1fd5=_0x54736d[_0xc5ee('0x2c')]({'plain':!![]});var _0x29369b=_0xc5ee('0x51');return db[_0xc5ee('0x52')][_0xc5ee('0x53')]({'where':{'name':_0x29369b,'userProfileId':_0xdbbf4a[_0xc5ee('0x54')]},'raw':!![]})[_0xc5ee('0x2a')](function(_0x4b9a8a){if(_0x4b9a8a&&_0x4b9a8a[_0xc5ee('0x55')]===0x0){return db[_0xc5ee('0x56')][_0xc5ee('0x4e')]({'name':_0x5b1fd5[_0xc5ee('0x37')],'resourceId':_0x5b1fd5['id'],'type':_0x4b9a8a[_0xc5ee('0x37')],'sectionId':_0x4b9a8a['id']},{})[_0xc5ee('0x2a')](function(){return _0x54736d;});}else{return _0x54736d;}})[_0xc5ee('0x57')](function(_0x4faa04){logger[_0xc5ee('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4faa04);throw _0x4faa04;});}return _0x54736d;})[_0xc5ee('0x2a')](respondWithResult(_0x45d980,0xc9))[_0xc5ee('0x57')](handleError(_0x45d980,null));};exports[_0xc5ee('0x29')]=function(_0x4f492d,_0x56c6c7){if(_0x4f492d[_0xc5ee('0x4f')]['id']){delete _0x4f492d[_0xc5ee('0x4f')]['id'];}return db[_0xc5ee('0x32')][_0xc5ee('0x53')]({'where':{'id':_0x4f492d[_0xc5ee('0x4c')]['id']}})[_0xc5ee('0x2a')](handleEntityNotFound(_0x56c6c7,null))['then'](saveUpdates(_0x4f492d[_0xc5ee('0x4f')],null))[_0xc5ee('0x2a')](respondWithResult(_0x56c6c7,null))['catch'](handleError(_0x56c6c7,null));};exports['destroy']=function(_0xc65c2d,_0x59e77a){return db['MailQueue']['find']({'where':{'id':_0xc65c2d[_0xc5ee('0x4c')]['id']}})[_0xc5ee('0x2a')](handleEntityNotFound(_0x59e77a,null))[_0xc5ee('0x2a')](removeEntity(_0x59e77a,null))[_0xc5ee('0x57')](handleError(_0x59e77a,null));};exports[_0xc5ee('0x58')]=function(_0x5abcce,_0x47070f){return db[_0xc5ee('0x32')]['describe']()[_0xc5ee('0x2a')](respondWithResult(_0x47070f,null))['catch'](handleError(_0x47070f,null));};exports[_0xc5ee('0x59')]=function(_0x1729bc,_0x4ab4c2,_0x12ed6d){var _0x3ddf3b={'raw':!![],'where':{}},_0x4cee2a={},_0x3bd1af;return db['MailQueue'][_0xc5ee('0x5a')]({'where':{'id':_0x1729bc[_0xc5ee('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4ab4c2,null))[_0xc5ee('0x2a')](function(_0x40218e){if(_0x40218e){_0x3bd1af=_0x40218e[_0xc5ee('0x2c')]({'plain':!![]});_0x4cee2a[_0xc5ee('0x36')]=_[_0xc5ee('0x39')](db[_0xc5ee('0x5b')]['rawAttributes']);_0x4cee2a[_0xc5ee('0x38')]=_[_0xc5ee('0x39')](_0x1729bc['query']);_0x4cee2a[_0xc5ee('0x3a')]=_['intersection'](_0x4cee2a[_0xc5ee('0x36')],_0x4cee2a[_0xc5ee('0x38')]);_0x3ddf3b['attributes']=_['intersection'](_0x4cee2a[_0xc5ee('0x36')],qs[_0xc5ee('0x3d')](_0x1729bc[_0xc5ee('0x38')][_0xc5ee('0x3d')]));_0x3ddf3b[_0xc5ee('0x3b')]=_0x3ddf3b[_0xc5ee('0x3b')][_0xc5ee('0x4d')]?_0x3ddf3b[_0xc5ee('0x3b')]:_0x4cee2a['model'];if(!_0x1729bc[_0xc5ee('0x38')][_0xc5ee('0x3e')]('nolimit')){_0x3ddf3b['limit']=qs['limit'](_0x1729bc[_0xc5ee('0x38')][_0xc5ee('0x22')]);_0x3ddf3b[_0xc5ee('0x20')]=qs[_0xc5ee('0x20')](_0x1729bc[_0xc5ee('0x38')][_0xc5ee('0x20')]);}_0x3ddf3b['order']=qs[_0xc5ee('0x41')](_0x1729bc['query'][_0xc5ee('0x41')]);_0x3ddf3b[_0xc5ee('0x42')]=qs[_0xc5ee('0x3a')](_['pick'](_0x1729bc[_0xc5ee('0x38')],_0x4cee2a[_0xc5ee('0x3a')]));_0x3ddf3b[_0xc5ee('0x42')]['MailQueueId']=_0x40218e['id'];if(_0x1729bc['query']['filter']){_0x3ddf3b[_0xc5ee('0x42')]=_[_0xc5ee('0x45')](_0x3ddf3b['where'],{'$or':_[_0xc5ee('0x31')](_0x3ddf3b[_0xc5ee('0x3b')],function(_0x3fb025){var _0x479065={};_0x479065[_0x3fb025]={'$like':'%'+_0x1729bc['query'][_0xc5ee('0x44')]+'%'};return _0x479065;})});}_0x3ddf3b=_[_0xc5ee('0x45')]({},_0x3ddf3b,_0x1729bc[_0xc5ee('0x47')]);return db[_0xc5ee('0x5b')][_0xc5ee('0x4a')](_0x3ddf3b);}})['then'](function(_0xbbfd55){if(_0xbbfd55){return db[_0xc5ee('0x5c')]['findAndCountAll']({'where':{'id':_['map'](_0xbbfd55,_0xc5ee('0x5d')),'role':_0xc5ee('0x5e')},'attributes':['id',_0xc5ee('0x37'),'mailPause',_0xc5ee('0x5f'),'createdAt']});}})['then'](function(_0x5436e0){if(_0x5436e0){return{'count':_0x5436e0['count'],'rows':_['map'](_0x5436e0[_0xc5ee('0x60')],function(_0x4b1ce9){return{'membername':_0x4b1ce9['name'],'UserId':_0x4b1ce9['id'],'queue_name':_0x3bd1af[_0xc5ee('0x37')],'MailQueueId':_0x3bd1af['id'],'interface':util[_0xc5ee('0x61')](_0xc5ee('0x62'),'SIP',_0x4b1ce9['name']),'penalty':0x0,'paused':_0x4b1ce9[_0xc5ee('0x63')],'createdAt':_0x4b1ce9['createdAt'],'updatedAt':_0x4b1ce9[_0xc5ee('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc5ee('0x2a')](respondWithFilteredResult(_0x4ab4c2,_0x3ddf3b))[_0xc5ee('0x57')](handleError(_0x4ab4c2,null));};exports['getTeams']=function(_0x1353b4,_0xa0f522,_0x582e28){var _0x431819={};var _0xb4340a={};var _0x539724;var _0x1a1666;return db['MailQueue'][_0xc5ee('0x5a')]({'where':{'id':_0x1353b4['params']['id']}})[_0xc5ee('0x2a')](handleEntityNotFound(_0xa0f522,null))[_0xc5ee('0x2a')](function(_0x130877){if(_0x130877){_0x539724=_0x130877;_0xb4340a['model']=_[_0xc5ee('0x39')](db['Team'][_0xc5ee('0x33')]);_0xb4340a[_0xc5ee('0x38')]=_[_0xc5ee('0x39')](_0x1353b4[_0xc5ee('0x38')]);_0xb4340a[_0xc5ee('0x3a')]=_[_0xc5ee('0x3c')](_0xb4340a[_0xc5ee('0x36')],_0xb4340a[_0xc5ee('0x38')]);_0x431819['attributes']=_[_0xc5ee('0x3c')](_0xb4340a[_0xc5ee('0x36')],qs['fields'](_0x1353b4[_0xc5ee('0x38')][_0xc5ee('0x3d')]));_0x431819[_0xc5ee('0x3b')]=_0x431819[_0xc5ee('0x3b')]['length']?_0x431819[_0xc5ee('0x3b')]:_0xb4340a[_0xc5ee('0x36')];_0x431819[_0xc5ee('0x40')]=qs['sort'](_0x1353b4[_0xc5ee('0x38')][_0xc5ee('0x41')]);_0x431819[_0xc5ee('0x42')]=qs[_0xc5ee('0x3a')](_[_0xc5ee('0x43')](_0x1353b4[_0xc5ee('0x38')],_0xb4340a[_0xc5ee('0x3a')]));if(_0x1353b4[_0xc5ee('0x38')]['filter']){_0x431819['where']=_[_0xc5ee('0x45')](_0x431819[_0xc5ee('0x42')],{'$or':_[_0xc5ee('0x31')](_0x431819[_0xc5ee('0x3b')],function(_0x49151c){var _0x110ef7={};_0x110ef7[_0x49151c]={'$like':'%'+_0x1353b4[_0xc5ee('0x38')][_0xc5ee('0x44')]+'%'};return _0x110ef7;})});}_0x431819=_[_0xc5ee('0x45')]({},_0x431819,_0x1353b4['options']);return _0x539724[_0xc5ee('0x64')](_0x431819);}})[_0xc5ee('0x2a')](function(_0x31a5d7){if(_0x31a5d7){_0x1a1666=_0x31a5d7[_0xc5ee('0x4d')];if(!_0x1353b4[_0xc5ee('0x38')][_0xc5ee('0x3e')](_0xc5ee('0x3f'))){_0x431819['limit']=qs[_0xc5ee('0x22')](_0x1353b4[_0xc5ee('0x38')]['limit']);_0x431819['offset']=qs['offset'](_0x1353b4['query'][_0xc5ee('0x20')]);}return _0x539724[_0xc5ee('0x64')](_0x431819);}})[_0xc5ee('0x2a')](function(_0x525acd){if(_0x525acd){return _0x525acd?{'count':_0x1a1666,'rows':_0x525acd}:null;}})['then'](respondWithResult(_0xa0f522,null))[_0xc5ee('0x57')](handleError(_0xa0f522,null));};exports['addTeams']=function(_0x2c5001,_0x258343,_0x438135){var _0x196f6b=_0x2c5001[_0xc5ee('0x4f')][_0xc5ee('0x65')];return db[_0xc5ee('0x66')][_0xc5ee('0x4a')]({'where':{'id':_0x196f6b},'attributes':['id'],'include':[{'model':db[_0xc5ee('0x5c')],'as':_0xc5ee('0x67'),'attributes':['id',_0xc5ee('0x37'),'online','voicePause','interface'],'raw':!![]}]})[_0xc5ee('0x2a')](function(_0x2121f1){if(_0x2121f1){var _0x45f36b=_['flatMap'](_0x2121f1,function(_0x41d136){var _0x14a641=_0x41d136['get']({'plain':!![]});return _0x14a641[_0xc5ee('0x67')];});return db[_0xc5ee('0x32')][_0xc5ee('0x53')]({'where':{'id':_0x2c5001['params']['id']}})[_0xc5ee('0x2a')](function(_0x490321){return db[_0xc5ee('0x68')][_0xc5ee('0x69')](function(_0x2d3a23){return _0x490321['addTeams'](_0x196f6b,{'transaction':_0x2d3a23})[_0xc5ee('0x2a')](function(){return BPromise[_0xc5ee('0x6a')](_0x45f36b,function(_0xf60dd1){return db[_0xc5ee('0x5b')][_0xc5ee('0x6b')]({'where':{'UserId':_0xf60dd1['id'],'MailQueueId':_0x2c5001[_0xc5ee('0x4c')]['id']},'transaction':_0x2d3a23});});})[_0xc5ee('0x2a')](function(){_0x45f36b[_0xc5ee('0x6c')](function(_0x5e9690){socket[_0xc5ee('0x6d')](_0xc5ee('0x6e'),{'UserId':_0x5e9690['id'],'MailQueueId':_0x490321['id']});});});});});}})[_0xc5ee('0x2a')](respondWithStatusCode(_0x258343,null))['catch'](handleError(_0x258343,null));};exports[_0xc5ee('0x6f')]=function(_0x401002,_0x94162d,_0x3d4631){return db['Team'][_0xc5ee('0x4a')]({'where':{'id':_0x401002[_0xc5ee('0x38')][_0xc5ee('0x65')]},'attributes':['id'],'include':[{'model':db[_0xc5ee('0x5c')],'as':_0xc5ee('0x67'),'attributes':['id'],'raw':!![]}]})[_0xc5ee('0x2a')](handleEntityNotFound(_0x94162d,null))[_0xc5ee('0x2a')](function(_0x41d58f){var _0x44a328=_['map'](_0x41d58f,'id');var _0x3ad855=[];var _0x30dd70=[];var _0x1353a1=squel[_0xc5ee('0x70')]();_0x1353a1['field'](_0xc5ee('0x71'))['from'](_0xc5ee('0x72'),'tq')[_0xc5ee('0x73')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc5ee('0x42')](_0xc5ee('0x74'),_0x401002[_0xc5ee('0x4c')]['id']);for(var _0x100da3=0x0;_0x100da3<_0x41d58f['length'];_0x100da3+=0x1){let _0xd2e31a=_0x41d58f[_0x100da3];for(var _0x38865f=0x0;_0x38865f<_0xd2e31a[_0xc5ee('0x67')][_0xc5ee('0x4d')];_0x38865f+=0x1){let _0x3020c0=_0xd2e31a[_0xc5ee('0x67')][_0x38865f];var _0x273136=_0x1353a1[_0xc5ee('0x75')]();_0x273136[_0xc5ee('0x42')](_0xc5ee('0x76'),_0x3020c0['id']);_0x30dd70[_0xc5ee('0x77')](db[_0xc5ee('0x68')][_0xc5ee('0x38')](_0x273136[_0xc5ee('0x78')](),{'type':db[_0xc5ee('0x68')]['QueryTypes'][_0xc5ee('0x79')]})[_0xc5ee('0x2a')](function(_0x444c54){if(_0x444c54[_0xc5ee('0x4d')]===0x1){return _0x3020c0['id'];}else{var _0xb68af6=_[_0xc5ee('0x7a')](_[_0xc5ee('0x31')](_0x444c54,'TeamId'),function(_0x514a33){return _[_0xc5ee('0x7b')](_0x44a328,_0x514a33);});if(_0xb68af6){return _0x3020c0['id'];}}}));}}return BPromise[_0xc5ee('0x7c')](_0x30dd70)[_0xc5ee('0x2a')](function(_0x4843a3){_0x3ad855=_(_0x3ad855)[_0xc5ee('0x7d')](_0x4843a3)[_0xc5ee('0x7e')]()[_0xc5ee('0x7f')]();return db[_0xc5ee('0x32')][_0xc5ee('0x53')]({'where':{'id':_0x401002[_0xc5ee('0x4c')]['id']}})[_0xc5ee('0x2a')](function(_0x53333d){return db[_0xc5ee('0x68')][_0xc5ee('0x69')](function(_0x1034ef){return _0x53333d['removeTeams'](_0x401002[_0xc5ee('0x38')][_0xc5ee('0x65')],{'transaction':_0x1034ef})['then'](function(){if(!_[_0xc5ee('0x80')](_0x3ad855)){return _0x53333d[_0xc5ee('0x81')](_0x3ad855,{'transaction':_0x1034ef});}})['then'](function(){_0x3ad855[_0xc5ee('0x6c')](function(_0x348205){socket[_0xc5ee('0x6d')](_0xc5ee('0x82'),{'UserId':_0x348205,'MailQueueId':_0x53333d['id']});});});});});});})['then'](respondWithStatusCode(_0x94162d,null))['catch'](handleError(_0x94162d,null));};exports[_0xc5ee('0x83')]=function(_0x1a5e86,_0x5bcb49,_0x25bbfe){return db['MailQueue'][_0xc5ee('0x53')]({'where':{'id':_0x1a5e86[_0xc5ee('0x4c')]['id']}})[_0xc5ee('0x2a')](handleEntityNotFound(_0x5bcb49,null))['then'](function(_0x34826a){if(_0x34826a){return _0x34826a['addAgents'](_0x1a5e86[_0xc5ee('0x4f')]['ids'],_[_0xc5ee('0x84')](_0x1a5e86[_0xc5ee('0x4f')],['ids','id'])||{})['spread'](function(_0x16e965){for(var _0x2d9c41=0x0;_0x2d9c41<_0x1a5e86[_0xc5ee('0x4f')]['ids']['length'];_0x2d9c41+=0x1){socket['emit']('userMailQueue:save',{'UserId':Number(_0x1a5e86[_0xc5ee('0x4f')][_0xc5ee('0x65')][_0x2d9c41]),'MailQueueId':Number(_0x1a5e86['params']['id'])});}return _0x16e965;});}})[_0xc5ee('0x2a')](respondWithResult(_0x5bcb49,null))[_0xc5ee('0x57')](handleError(_0x5bcb49,null));};exports[_0xc5ee('0x81')]=function(_0xf77e5d,_0x220743,_0x7f5ea7){return db['MailQueue'][_0xc5ee('0x53')]({'where':{'id':_0xf77e5d[_0xc5ee('0x4c')]['id']}})['then'](handleEntityNotFound(_0x220743,null))[_0xc5ee('0x2a')](function(_0x5bcd36){if(_0x5bcd36){return _0x5bcd36['removeAgents'](_0xf77e5d[_0xc5ee('0x38')][_0xc5ee('0x65')])[_0xc5ee('0x2a')](function(){if(_[_0xc5ee('0x85')](_0xf77e5d['query'][_0xc5ee('0x65')])){for(var _0x440465=0x0;_0x440465<_0xf77e5d[_0xc5ee('0x38')][_0xc5ee('0x65')]['length'];_0x440465+=0x1){socket[_0xc5ee('0x6d')](_0xc5ee('0x82'),{'UserId':Number(_0xf77e5d[_0xc5ee('0x38')]['ids'][_0x440465]),'MailQueueId':Number(_0xf77e5d[_0xc5ee('0x4c')]['id'])});}}else{socket[_0xc5ee('0x6d')](_0xc5ee('0x82'),{'UserId':Number(_0xf77e5d['query'][_0xc5ee('0x65')]),'MailQueueId':Number(_0xf77e5d[_0xc5ee('0x4c')]['id'])});}});}})[_0xc5ee('0x2a')](respondWithStatusCode(_0x220743,null))['catch'](handleError(_0x220743,null));};exports[_0xc5ee('0x86')]=function(_0x3570a3,_0x308a92,_0x4eddda){var _0x559278={};var _0x245eb7={};var _0x48aa27;var _0x5adb85;return db[_0xc5ee('0x32')][_0xc5ee('0x5a')]({'where':{'id':_0x3570a3[_0xc5ee('0x4c')]['id']}})[_0xc5ee('0x2a')](handleEntityNotFound(_0x308a92,null))[_0xc5ee('0x2a')](function(_0x49b097){if(_0x49b097){_0x48aa27=_0x49b097;_0x245eb7[_0xc5ee('0x36')]=_['keys'](db[_0xc5ee('0x5c')][_0xc5ee('0x33')]);_0x245eb7['query']=_[_0xc5ee('0x39')](_0x3570a3[_0xc5ee('0x38')]);_0x245eb7['filters']=_[_0xc5ee('0x3c')](_0x245eb7[_0xc5ee('0x36')],_0x245eb7[_0xc5ee('0x38')]);_0x559278[_0xc5ee('0x3b')]=_['intersection'](_0x245eb7[_0xc5ee('0x36')],qs[_0xc5ee('0x3d')](_0x3570a3[_0xc5ee('0x38')][_0xc5ee('0x3d')]));_0x559278['attributes']=_0x559278['attributes'][_0xc5ee('0x4d')]?_0x559278[_0xc5ee('0x3b')]:_0x245eb7['model'];_0x559278[_0xc5ee('0x40')]=qs[_0xc5ee('0x41')](_0x3570a3[_0xc5ee('0x38')]['sort']);_0x559278[_0xc5ee('0x42')]=qs[_0xc5ee('0x3a')](_[_0xc5ee('0x43')](_0x3570a3[_0xc5ee('0x38')],_0x245eb7[_0xc5ee('0x3a')]));if(_0x3570a3[_0xc5ee('0x38')][_0xc5ee('0x44')]){_0x559278[_0xc5ee('0x42')]=_[_0xc5ee('0x45')](_0x559278[_0xc5ee('0x42')],{'$or':_[_0xc5ee('0x31')](_0x559278[_0xc5ee('0x3b')],function(_0x3f9067){var _0x49d382={};_0x49d382[_0x3f9067]={'$like':'%'+_0x3570a3['query']['filter']+'%'};return _0x49d382;})});}_0x559278=_[_0xc5ee('0x45')]({},_0x559278,_0x3570a3['options']);return _0x48aa27['getAgents'](_0x559278);}})['then'](function(_0x251929){if(_0x251929){_0x5adb85=_0x251929[_0xc5ee('0x4d')];if(!_0x3570a3[_0xc5ee('0x38')][_0xc5ee('0x3e')](_0xc5ee('0x3f'))){_0x559278[_0xc5ee('0x22')]=qs['limit'](_0x3570a3[_0xc5ee('0x38')][_0xc5ee('0x22')]);_0x559278['offset']=qs[_0xc5ee('0x20')](_0x3570a3['query'][_0xc5ee('0x20')]);}return _0x48aa27[_0xc5ee('0x86')](_0x559278);}})[_0xc5ee('0x2a')](function(_0x48a5f2){if(_0x48a5f2){return _0x48a5f2?{'count':_0x5adb85,'rows':_0x48a5f2}:null;}})[_0xc5ee('0x2a')](respondWithResult(_0x308a92,null))[_0xc5ee('0x57')](handleError(_0x308a92,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 85ecd56..965256d 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 _0x651d=['exports','../../mysqldb','MailQueue','setMaxListeners','update','remove','emit'];(function(_0x5b90a5,_0x1ac005){var _0x25a1e7=function(_0x11fc88){while(--_0x11fc88){_0x5b90a5['push'](_0x5b90a5['shift']());}};_0x25a1e7(++_0x1ac005);}(_0x651d,0x127));var _0xd651=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0x651d[_0xef8146];return _0x5a6cb0;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xd651('0x0'))['db'][_0xd651('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xd651('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd651('0x3'),'afterDestroy':_0xd651('0x4')};function emitEvent(_0x5303e7){return function(_0x5e7020,_0x3cecb4,_0x2dee4f){MailQueueEvents[_0xd651('0x5')](_0x5303e7+':'+_0x5e7020['id'],_0x5e7020);MailQueueEvents[_0xd651('0x5')](_0x5303e7,_0x5e7020);_0x2dee4f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xd651('0x6')]=MailQueueEvents; \ No newline at end of file +var _0x10d7=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb','setMaxListeners'];(function(_0x237267,_0x46f3fc){var _0x43be1c=function(_0x584a85){while(--_0x584a85){_0x237267['push'](_0x237267['shift']());}};_0x43be1c(++_0x46f3fc);}(_0x10d7,0x1bd));var _0x710d=function(_0x4b176b,_0x13949d){_0x4b176b=_0x4b176b-0x0;var _0x48ded9=_0x10d7[_0x4b176b];return _0x48ded9;};'use strict';var EventEmitter=require(_0x710d('0x0'));var MailQueue=require(_0x710d('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x710d('0x2')](0x0);var events={'afterCreate':_0x710d('0x3'),'afterUpdate':_0x710d('0x4'),'afterDestroy':_0x710d('0x5')};function emitEvent(_0x3f25c3){return function(_0x50c907,_0x571469,_0x3e8a25){MailQueueEvents[_0x710d('0x6')](_0x3f25c3+':'+_0x50c907['id'],_0x50c907);MailQueueEvents[_0x710d('0x6')](_0x3f25c3,_0x50c907);_0x3e8a25(null);};}for(var e in events){if(events[_0x710d('0x7')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 94482ff..037222c 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 _0x412d=['../../config/environment','./mailQueue.attributes','exports','define','mail_queues','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x848469,_0x3e272b){var _0x46bd59=function(_0x7575b){while(--_0x7575b){_0x848469['push'](_0x848469['shift']());}};_0x46bd59(++_0x3e272b);}(_0x412d,0x1a9));var _0xd412=function(_0x48563f,_0x162c55){_0x48563f=_0x48563f-0x0;var _0x438981=_0x412d[_0x48563f];return _0x438981;};'use strict';var _=require('lodash');var util=require(_0xd412('0x0'));var logger=require(_0xd412('0x1'))(_0xd412('0x2'));var moment=require(_0xd412('0x3'));var BPromise=require(_0xd412('0x4'));var rp=require(_0xd412('0x5'));var fs=require('fs');var path=require(_0xd412('0x6'));var rimraf=require('rimraf');var config=require(_0xd412('0x7'));var attributes=require(_0xd412('0x8'));module[_0xd412('0x9')]=function(_0x4cb56f,_0x102761){return _0x4cb56f[_0xd412('0xa')]('MailQueue',attributes,{'tableName':_0xd412('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x624c=['bluebird','request-promise','rimraf','../../config/environment','./mailQueue.attributes','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment'];(function(_0x1dd44b,_0x121f72){var _0x42902d=function(_0x37cc46){while(--_0x37cc46){_0x1dd44b['push'](_0x1dd44b['shift']());}};_0x42902d(++_0x121f72);}(_0x624c,0x193));var _0xc624=function(_0xebaba9,_0x15a246){_0xebaba9=_0xebaba9-0x0;var _0xca52ea=_0x624c[_0xebaba9];return _0xca52ea;};'use strict';var _=require(_0xc624('0x0'));var util=require(_0xc624('0x1'));var logger=require(_0xc624('0x2'))(_0xc624('0x3'));var moment=require(_0xc624('0x4'));var BPromise=require(_0xc624('0x5'));var rp=require(_0xc624('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc624('0x7'));var config=require(_0xc624('0x8'));var attributes=require(_0xc624('0x9'));module['exports']=function(_0xf7b8e1,_0x7e99ef){return _0xf7b8e1['define'](_0xc624('0xa'),attributes,{'tableName':_0xc624('0xb'),'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 9f6fa33..2e3e7a6 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 _0x6a72=['socket.io-emitter','./mailQueue.socket','register','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','info','GetMailQueue','stringify','ShowMailQueue','find','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis'];(function(_0x360fee,_0x44dec7){var _0x15befb=function(_0x262c68){while(--_0x262c68){_0x360fee['push'](_0x360fee['shift']());}};_0x15befb(++_0x44dec7);}(_0x6a72,0x118));var _0x26a7=function(_0x23c651,_0x143982){_0x23c651=_0x23c651-0x0;var _0xbe7bdb=_0x6a72[_0x23c651];return _0xbe7bdb;};'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});config['redis']=_[_0x26a7('0xc')](config[_0x26a7('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x26a7('0xe'))(new Redis(config[_0x26a7('0xd')]));require(_0x26a7('0xf'))[_0x26a7('0x10')](socket);function respondWithRpcPromise(_0x4e62e1,_0x25cc63,_0x28115a){return new BPromise(function(_0x4a639f,_0x54fbdf){return client[_0x26a7('0x11')](_0x4e62e1,_0x28115a)[_0x26a7('0x12')](function(_0x3b242e){logger['info'](_0x26a7('0x13'),_0x25cc63,_0x26a7('0x14'));logger[_0x26a7('0x15')](_0x26a7('0x16'),_0x25cc63,_0x26a7('0x14'),JSON['stringify'](_0x3b242e));if(_0x3b242e[_0x26a7('0x17')]){if(_0x3b242e['error'][_0x26a7('0x18')]===0x1f4){logger[_0x26a7('0x17')](_0x26a7('0x13'),_0x25cc63,_0x3b242e[_0x26a7('0x17')][_0x26a7('0x19')]);return _0x54fbdf(_0x3b242e[_0x26a7('0x17')][_0x26a7('0x19')]);}logger[_0x26a7('0x17')](_0x26a7('0x13'),_0x25cc63,_0x3b242e[_0x26a7('0x17')][_0x26a7('0x19')]);return _0x4a639f(_0x3b242e[_0x26a7('0x17')][_0x26a7('0x19')]);}else{logger['info'](_0x26a7('0x13'),_0x25cc63,_0x26a7('0x14'));_0x4a639f(_0x3b242e[_0x26a7('0x1a')][_0x26a7('0x19')]);}})[_0x26a7('0x1b')](function(_0x151944){logger[_0x26a7('0x17')](_0x26a7('0x13'),_0x25cc63,_0x151944);_0x54fbdf(_0x151944);});});}exports['GetMailQueue']=function(_0x55fe28){var _0x3c5181=this;return new Promise(function(_0x3c457e,_0x463940){return db['MailQueue'][_0x26a7('0x1c')]({'raw':_0x55fe28[_0x26a7('0x1d')]?_0x55fe28[_0x26a7('0x1d')][_0x26a7('0x1e')]===undefined?!![]:![]:!![],'where':_0x55fe28[_0x26a7('0x1d')]?_0x55fe28[_0x26a7('0x1d')][_0x26a7('0x1f')]||null:null,'attributes':_0x55fe28['options']?_0x55fe28[_0x26a7('0x1d')][_0x26a7('0x20')]||null:null,'limit':_0x55fe28[_0x26a7('0x1d')]?_0x55fe28['options'][_0x26a7('0x21')]||null:null,'include':_0x55fe28['options']?_0x55fe28[_0x26a7('0x1d')][_0x26a7('0x22')]?_[_0x26a7('0x23')](_0x55fe28[_0x26a7('0x1d')][_0x26a7('0x22')],function(_0x109104){return{'model':db[_0x109104['model']],'as':_0x109104['as'],'attributes':_0x109104[_0x26a7('0x20')],'include':_0x109104[_0x26a7('0x22')]?_[_0x26a7('0x23')](_0x109104['include'],function(_0x2d9331){return{'model':db[_0x2d9331['model']],'as':_0x2d9331['as'],'attributes':_0x2d9331[_0x26a7('0x20')],'include':_0x2d9331[_0x26a7('0x22')]?_[_0x26a7('0x23')](_0x2d9331[_0x26a7('0x22')],function(_0x21733e){return{'model':db[_0x21733e[_0x26a7('0x24')]],'as':_0x21733e['as'],'attributes':_0x21733e[_0x26a7('0x20')]};}):[]};}):[]};}):[]:[]})[_0x26a7('0x12')](function(_0x5162d9){logger[_0x26a7('0x25')](_0x26a7('0x26'),_0x55fe28);logger[_0x26a7('0x15')](_0x26a7('0x26'),_0x55fe28,JSON[_0x26a7('0x27')](_0x5162d9));_0x3c457e(_0x5162d9);})['catch'](function(_0x4a10c2){logger[_0x26a7('0x17')]('GetMailQueue',_0x4a10c2[_0x26a7('0x19')],_0x55fe28);_0x463940(_0x3c5181[_0x26a7('0x17')](0x1f4,_0x4a10c2[_0x26a7('0x19')]));});});};exports[_0x26a7('0x28')]=function(_0x2d9279){var _0x3d2410=this;return new Promise(function(_0x216565,_0x5bd073){return db['MailQueue'][_0x26a7('0x29')]({'raw':_0x2d9279[_0x26a7('0x1d')]?_0x2d9279[_0x26a7('0x1d')][_0x26a7('0x1e')]===undefined?!![]:![]:!![],'where':_0x2d9279[_0x26a7('0x1d')]?_0x2d9279['options'][_0x26a7('0x1f')]||null:null,'attributes':_0x2d9279[_0x26a7('0x1d')]?_0x2d9279[_0x26a7('0x1d')]['attributes']||null:null,'include':_0x2d9279[_0x26a7('0x1d')]?_0x2d9279[_0x26a7('0x1d')][_0x26a7('0x22')]?_['map'](_0x2d9279[_0x26a7('0x1d')][_0x26a7('0x22')],function(_0x2a2814){return{'model':db[_0x2a2814[_0x26a7('0x24')]],'as':_0x2a2814['as'],'attributes':_0x2a2814[_0x26a7('0x20')],'include':_0x2a2814[_0x26a7('0x22')]?_['map'](_0x2a2814[_0x26a7('0x22')],function(_0x3b63d9){return{'model':db[_0x3b63d9['model']],'as':_0x3b63d9['as'],'attributes':_0x3b63d9[_0x26a7('0x20')],'include':_0x3b63d9['include']?_['map'](_0x3b63d9[_0x26a7('0x22')],function(_0x50d2ce){return{'model':db[_0x50d2ce[_0x26a7('0x24')]],'as':_0x50d2ce['as'],'attributes':_0x50d2ce[_0x26a7('0x20')]};}):[]};}):[]};}):[]:[]})[_0x26a7('0x12')](function(_0x266c48){logger[_0x26a7('0x25')]('ShowMailQueue',_0x2d9279);logger[_0x26a7('0x15')](_0x26a7('0x28'),_0x2d9279,JSON[_0x26a7('0x27')](_0x266c48));_0x216565(_0x266c48);})[_0x26a7('0x1b')](function(_0x537ea5){logger[_0x26a7('0x17')]('ShowMailQueue',_0x537ea5['message'],_0x2d9279);_0x5bd073(_0x3d2410['error'](0x1f4,_0x537ea5['message']));});});}; \ No newline at end of file +var _0x62ca=['attributes','limit','map','include','model','ShowMailQueue','find','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./mailQueue.socket','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where'];(function(_0x5275b8,_0x51e5dd){var _0x568a9b=function(_0x583a71){while(--_0x583a71){_0x5275b8['push'](_0x5275b8['shift']());}};_0x568a9b(++_0x51e5dd);}(_0x62ca,0x179));var _0xa62c=function(_0x2321de,_0x35a1b8){_0x2321de=_0x2321de-0x0;var _0x5979ee=_0x62ca[_0x2321de];return _0x5979ee;};'use strict';var _=require(_0xa62c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa62c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa62c('0x2'))['db'];var utils=require(_0xa62c('0x3'));var logger=require(_0xa62c('0x4'))('rpc');var config=require(_0xa62c('0x5'));var jayson=require(_0xa62c('0x6'));var client=jayson['client'][_0xa62c('0x7')]({'port':0x232a});config['redis']=_[_0xa62c('0x8')](config[_0xa62c('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xa62c('0xa'))(new Redis(config[_0xa62c('0x9')]));require(_0xa62c('0xb'))['register'](socket);function respondWithRpcPromise(_0x5a01af,_0x2434a8,_0x387b29){return new BPromise(function(_0x271449,_0x270d88){return client[_0xa62c('0xc')](_0x5a01af,_0x387b29)[_0xa62c('0xd')](function(_0x39a0fe){logger[_0xa62c('0xe')](_0xa62c('0xf'),_0x2434a8,_0xa62c('0x10'));logger[_0xa62c('0x11')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x2434a8,_0xa62c('0x10'),JSON[_0xa62c('0x12')](_0x39a0fe));if(_0x39a0fe[_0xa62c('0x13')]){if(_0x39a0fe[_0xa62c('0x13')][_0xa62c('0x14')]===0x1f4){logger['error'](_0xa62c('0xf'),_0x2434a8,_0x39a0fe[_0xa62c('0x13')]['message']);return _0x270d88(_0x39a0fe['error'][_0xa62c('0x15')]);}logger[_0xa62c('0x13')]('MailQueue,\x20%s,\x20%s',_0x2434a8,_0x39a0fe['error'][_0xa62c('0x15')]);return _0x271449(_0x39a0fe[_0xa62c('0x13')][_0xa62c('0x15')]);}else{logger['info']('MailQueue,\x20%s,\x20%s',_0x2434a8,_0xa62c('0x10'));_0x271449(_0x39a0fe[_0xa62c('0x16')][_0xa62c('0x15')]);}})[_0xa62c('0x17')](function(_0x327e03){logger[_0xa62c('0x13')]('MailQueue,\x20%s,\x20%s',_0x2434a8,_0x327e03);_0x270d88(_0x327e03);});});}exports[_0xa62c('0x18')]=function(_0x45d27a){var _0x351fe6=this;return new Promise(function(_0x3cc799,_0x43e3c5){return db[_0xa62c('0x19')][_0xa62c('0x1a')]({'raw':_0x45d27a[_0xa62c('0x1b')]?_0x45d27a[_0xa62c('0x1b')][_0xa62c('0x1c')]===undefined?!![]:![]:!![],'where':_0x45d27a[_0xa62c('0x1b')]?_0x45d27a[_0xa62c('0x1b')][_0xa62c('0x1d')]||null:null,'attributes':_0x45d27a[_0xa62c('0x1b')]?_0x45d27a['options'][_0xa62c('0x1e')]||null:null,'limit':_0x45d27a[_0xa62c('0x1b')]?_0x45d27a['options'][_0xa62c('0x1f')]||null:null,'include':_0x45d27a[_0xa62c('0x1b')]?_0x45d27a['options']['include']?_[_0xa62c('0x20')](_0x45d27a[_0xa62c('0x1b')][_0xa62c('0x21')],function(_0x4cd920){return{'model':db[_0x4cd920['model']],'as':_0x4cd920['as'],'attributes':_0x4cd920[_0xa62c('0x1e')],'include':_0x4cd920[_0xa62c('0x21')]?_[_0xa62c('0x20')](_0x4cd920['include'],function(_0x862215){return{'model':db[_0x862215[_0xa62c('0x22')]],'as':_0x862215['as'],'attributes':_0x862215['attributes'],'include':_0x862215[_0xa62c('0x21')]?_['map'](_0x862215['include'],function(_0x5aea67){return{'model':db[_0x5aea67[_0xa62c('0x22')]],'as':_0x5aea67['as'],'attributes':_0x5aea67[_0xa62c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa62c('0xd')](function(_0xd760b7){logger['info']('GetMailQueue',_0x45d27a);logger['debug'](_0xa62c('0x18'),_0x45d27a,JSON[_0xa62c('0x12')](_0xd760b7));_0x3cc799(_0xd760b7);})[_0xa62c('0x17')](function(_0x480b5a){logger[_0xa62c('0x13')]('GetMailQueue',_0x480b5a['message'],_0x45d27a);_0x43e3c5(_0x351fe6[_0xa62c('0x13')](0x1f4,_0x480b5a['message']));});});};exports[_0xa62c('0x23')]=function(_0x3acf29){var _0x73da97=this;return new Promise(function(_0x56dfbd,_0x5c9eef){return db['MailQueue'][_0xa62c('0x24')]({'raw':_0x3acf29[_0xa62c('0x1b')]?_0x3acf29[_0xa62c('0x1b')][_0xa62c('0x1c')]===undefined?!![]:![]:!![],'where':_0x3acf29[_0xa62c('0x1b')]?_0x3acf29[_0xa62c('0x1b')][_0xa62c('0x1d')]||null:null,'attributes':_0x3acf29[_0xa62c('0x1b')]?_0x3acf29[_0xa62c('0x1b')][_0xa62c('0x1e')]||null:null,'include':_0x3acf29[_0xa62c('0x1b')]?_0x3acf29[_0xa62c('0x1b')][_0xa62c('0x21')]?_['map'](_0x3acf29[_0xa62c('0x1b')][_0xa62c('0x21')],function(_0x1a2e85){return{'model':db[_0x1a2e85[_0xa62c('0x22')]],'as':_0x1a2e85['as'],'attributes':_0x1a2e85['attributes'],'include':_0x1a2e85[_0xa62c('0x21')]?_['map'](_0x1a2e85[_0xa62c('0x21')],function(_0x380cc1){return{'model':db[_0x380cc1['model']],'as':_0x380cc1['as'],'attributes':_0x380cc1['attributes'],'include':_0x380cc1['include']?_[_0xa62c('0x20')](_0x380cc1[_0xa62c('0x21')],function(_0x5877c7){return{'model':db[_0x5877c7[_0xa62c('0x22')]],'as':_0x5877c7['as'],'attributes':_0x5877c7[_0xa62c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa62c('0xd')](function(_0x206a11){logger[_0xa62c('0xe')](_0xa62c('0x23'),_0x3acf29);logger[_0xa62c('0x11')](_0xa62c('0x23'),_0x3acf29,JSON['stringify'](_0x206a11));_0x56dfbd(_0x206a11);})[_0xa62c('0x17')](function(_0x444aa3){logger[_0xa62c('0x13')](_0xa62c('0x23'),_0x444aa3[_0xa62c('0x15')],_0x3acf29);_0x5c9eef(_0x73da97['error'](0x1f4,_0x444aa3[_0xa62c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 360c1ae..3e56a55 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 _0x2ab7=['./mailQueue.events','save','remove','update','emit','removeListener','length'];(function(_0x34246b,_0x1d5f54){var _0x314402=function(_0x1d4c61){while(--_0x1d4c61){_0x34246b['push'](_0x34246b['shift']());}};_0x314402(++_0x1d5f54);}(_0x2ab7,0xe7));var _0x72ab=function(_0xa01eea,_0x12e531){_0xa01eea=_0xa01eea-0x0;var _0x47c05e=_0x2ab7[_0xa01eea];return _0x47c05e;};'use strict';var MailQueueEvents=require(_0x72ab('0x0'));var events=[_0x72ab('0x1'),_0x72ab('0x2'),_0x72ab('0x3')];function createListener(_0x3ed18f,_0x44d854){return function(_0x486a17){_0x44d854[_0x72ab('0x4')](_0x3ed18f,_0x486a17);};}function removeListener(_0x7ca33,_0x80b030){return function(){MailQueueEvents[_0x72ab('0x5')](_0x7ca33,_0x80b030);};}exports['register']=function(_0x58797){for(var _0x48d5e8=0x0,_0x54caaf=events[_0x72ab('0x6')];_0x48d5e8<_0x54caaf;_0x48d5e8++){var _0x2ed3b1=events[_0x48d5e8];var _0xbd73df=createListener('mailQueue:'+_0x2ed3b1,_0x58797);MailQueueEvents['on'](_0x2ed3b1,_0xbd73df);}}; \ No newline at end of file +var _0x2724=['save','update','emit','removeListener','register','length','mailQueue:'];(function(_0xedcab0,_0xf1d5af){var _0x63ee4=function(_0x131383){while(--_0x131383){_0xedcab0['push'](_0xedcab0['shift']());}};_0x63ee4(++_0xf1d5af);}(_0x2724,0xa8));var _0x4272=function(_0x243f0b,_0x283d3a){_0x243f0b=_0x243f0b-0x0;var _0x8bd140=_0x2724[_0x243f0b];return _0x8bd140;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x4272('0x0'),'remove',_0x4272('0x1')];function createListener(_0x5a4989,_0x35dcb3){return function(_0x534b3f){_0x35dcb3[_0x4272('0x2')](_0x5a4989,_0x534b3f);};}function removeListener(_0x39de3d,_0x33ea6e){return function(){MailQueueEvents[_0x4272('0x3')](_0x39de3d,_0x33ea6e);};}exports[_0x4272('0x4')]=function(_0xe34655){for(var _0x2590cf=0x0,_0x2ec740=events[_0x4272('0x5')];_0x2590cf<_0x2ec740;_0x2590cf++){var _0x504258=events[_0x2590cf];var _0x52e736=createListener(_0x4272('0x6')+_0x504258,_0xe34655);MailQueueEvents['on'](_0x504258,_0x52e736);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 4e9d24f..d610beb 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 _0xc02c=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','multer','path','connect-timeout'];(function(_0x54f3e8,_0x3ed493){var _0x267b37=function(_0x58247e){while(--_0x58247e){_0x54f3e8['push'](_0x54f3e8['shift']());}};_0x267b37(++_0x3ed493);}(_0xc02c,0x89));var _0xcc02=function(_0x2873a0,_0x347209){_0x2873a0=_0x2873a0-0x0;var _0x31903e=_0xc02c[_0x2873a0];return _0x31903e;};'use strict';var multer=require(_0xcc02('0x0'));var util=require('util');var path=require(_0xcc02('0x1'));var timeout=require(_0xcc02('0x2'));var express=require(_0xcc02('0x3'));var router=express['Router']();var fs_extra=require(_0xcc02('0x4'));var auth=require(_0xcc02('0x5'));var interaction=require(_0xcc02('0x6'));var config=require(_0xcc02('0x7'));var controller=require('./mailQueueReport.controller');router[_0xcc02('0x8')]('/',auth[_0xcc02('0x9')](),controller[_0xcc02('0xa')]);router[_0xcc02('0x8')](_0xcc02('0xb'),auth[_0xcc02('0x9')](),controller[_0xcc02('0xc')]);router[_0xcc02('0x8')](_0xcc02('0xd'),auth[_0xcc02('0x9')](),controller[_0xcc02('0xe')]);router[_0xcc02('0xf')]('/',auth[_0xcc02('0x9')](),controller['create']);router[_0xcc02('0x10')](_0xcc02('0xd'),auth[_0xcc02('0x9')](),controller[_0xcc02('0x11')]);router[_0xcc02('0x12')](_0xcc02('0xd'),auth[_0xcc02('0x9')](),controller[_0xcc02('0x13')]);module['exports']=router; \ No newline at end of file +var _0x81d8=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','index','/describe','isAuthenticated','describe','post','create'];(function(_0x185f18,_0x175f09){var _0x33e5bc=function(_0xdb5406){while(--_0xdb5406){_0x185f18['push'](_0x185f18['shift']());}};_0x33e5bc(++_0x175f09);}(_0x81d8,0xe1));var _0x881d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x81d8[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x881d('0x0'));var util=require(_0x881d('0x1'));var path=require(_0x881d('0x2'));var timeout=require(_0x881d('0x3'));var express=require(_0x881d('0x4'));var router=express[_0x881d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x881d('0x6'));var interaction=require(_0x881d('0x7'));var config=require(_0x881d('0x8'));var controller=require(_0x881d('0x9'));router[_0x881d('0xa')]('/',auth['isAuthenticated'](),controller[_0x881d('0xb')]);router['get'](_0x881d('0xc'),auth[_0x881d('0xd')](),controller[_0x881d('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x881d('0xf')]('/',auth['isAuthenticated'](),controller[_0x881d('0x10')]);router['put'](_0x881d('0x11'),auth['isAuthenticated'](),controller[_0x881d('0x12')]);router[_0x881d('0x13')](_0x881d('0x11'),auth['isAuthenticated'](),controller[_0x881d('0x14')]);module[_0x881d('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 076c4e8..a96c594 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 _0x7799=['DATE','sequelize','exports','STRING'];(function(_0x299dd2,_0x1532d3){var _0x43139b=function(_0x1e0837){while(--_0x1e0837){_0x299dd2['push'](_0x299dd2['shift']());}};_0x43139b(++_0x1532d3);}(_0x7799,0x191));var _0x9779=function(_0x285159,_0x434500){_0x285159=_0x285159-0x0;var _0x3ade27=_0x7799[_0x285159];return _0x3ade27;};'use strict';var moment=require('moment');var Sequelize=require(_0x9779('0x0'));module[_0x9779('0x1')]={'uniqueid':{'type':Sequelize[_0x9779('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x9779('0x3')]},'acceptAt':{'type':Sequelize[_0x9779('0x3')]},'exitAt':{'type':Sequelize[_0x9779('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x65e0=['moment','sequelize','exports','STRING','DATE'];(function(_0x2e8fdc,_0x30524d){var _0x346353=function(_0x49d123){while(--_0x49d123){_0x2e8fdc['push'](_0x2e8fdc['shift']());}};_0x346353(++_0x30524d);}(_0x65e0,0x96));var _0x065e=function(_0x204836,_0x34d172){_0x204836=_0x204836-0x0;var _0x335884=_0x65e0[_0x204836];return _0x335884;};'use strict';var moment=require(_0x065e('0x0'));var Sequelize=require(_0x065e('0x1'));module[_0x065e('0x2')]={'uniqueid':{'type':Sequelize[_0x065e('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x065e('0x4')]},'leaveAt':{'type':Sequelize[_0x065e('0x4')]},'acceptAt':{'type':Sequelize[_0x065e('0x4')]},'exitAt':{'type':Sequelize[_0x065e('0x4')]},'reason':{'type':Sequelize[_0x065e('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index f8025ec..e46bd36 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 _0xa6b0=['nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','keys','include','find','create','body','params','describe','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','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','undefined','limit','offset','count','set','Content-Range','apply','save','update','destroy','then','sendStatus','stack','name','index','map','MailQueueReport','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x59eed1,_0x4f21dd){_0x59eed1=_0x59eed1-0x0;var _0x537785=_0xa6b0[_0x59eed1];return _0x537785;};'use strict';var emlformat=require(_0x0a6b('0x0'));var rimraf=require(_0x0a6b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a6b('0x2'));var moment=require(_0x0a6b('0x3'));var BPromise=require(_0x0a6b('0x4'));var Mustache=require('mustache');var util=require(_0x0a6b('0x5'));var path=require(_0x0a6b('0x6'));var sox=require(_0x0a6b('0x7'));var csv=require(_0x0a6b('0x8'));var ejs=require(_0x0a6b('0x9'));var fs=require('fs');var fs_extra=require(_0x0a6b('0xa'));var _=require(_0x0a6b('0xb'));var squel=require(_0x0a6b('0xc'));var crypto=require(_0x0a6b('0xd'));var jsforce=require(_0x0a6b('0xe'));var deskjs=require(_0x0a6b('0xf'));var toCsv=require(_0x0a6b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0a6b('0x10'));var authService=require(_0x0a6b('0x11'));var qs=require(_0x0a6b('0x12'));var as=require(_0x0a6b('0x13'));var hardwareService=require(_0x0a6b('0x14'));var logger=require(_0x0a6b('0x15'))(_0x0a6b('0x16'));var utils=require(_0x0a6b('0x17'));var config=require(_0x0a6b('0x18'));var licenseUtil=require(_0x0a6b('0x19'));var db=require(_0x0a6b('0x1a'))['db'];function respondWithStatusCode(_0x890493,_0x244a7d){_0x244a7d=_0x244a7d||0xcc;return function(_0x3cd9a4){if(_0x3cd9a4){return _0x890493['sendStatus'](_0x244a7d);}return _0x890493['status'](_0x244a7d)[_0x0a6b('0x1b')]();};}function respondWithResult(_0x2f27d6,_0x2abc4e){_0x2abc4e=_0x2abc4e||0xc8;return function(_0x177e87){if(_0x177e87){return _0x2f27d6[_0x0a6b('0x1c')](_0x2abc4e)[_0x0a6b('0x1d')](_0x177e87);}};}function respondWithFilteredResult(_0x9bb98e,_0x19e84c){return function(_0x1205a3){if(_0x1205a3){var _0x9d7aba=typeof _0x19e84c['offset']===_0x0a6b('0x1e')&&typeof _0x19e84c[_0x0a6b('0x1f')]==='undefined';var _0x290f7f=_0x1205a3['count'];var _0xcb412=_0x9d7aba?0x0:_0x19e84c[_0x0a6b('0x20')];var _0x2cb10b=_0x9d7aba?_0x1205a3[_0x0a6b('0x21')]:_0x19e84c['offset']+_0x19e84c[_0x0a6b('0x1f')];var _0x296162;if(_0x2cb10b>=_0x290f7f){_0x2cb10b=_0x290f7f;_0x296162=0xc8;}else{_0x296162=0xce;}_0x9bb98e['status'](_0x296162);return _0x9bb98e[_0x0a6b('0x22')](_0x0a6b('0x23'),_0xcb412+'-'+_0x2cb10b+'/'+_0x290f7f)[_0x0a6b('0x1d')](_0x1205a3);}return null;};}function patchUpdates(_0x491936){return function(_0x3ae3f4){try{jsonpatch[_0x0a6b('0x24')](_0x3ae3f4,_0x491936,!![]);}catch(_0x4077c6){return BPromise['reject'](_0x4077c6);}return _0x3ae3f4[_0x0a6b('0x25')]();};}function saveUpdates(_0x531e4c,_0xe4c2b9){return function(_0x5e8206){if(_0x5e8206){return _0x5e8206[_0x0a6b('0x26')](_0x531e4c)['then'](function(_0x1e5065){return _0x1e5065;});}return null;};}function removeEntity(_0xdda188,_0x3d153f){return function(_0x5c77fb){if(_0x5c77fb){return _0x5c77fb[_0x0a6b('0x27')]()[_0x0a6b('0x28')](function(){_0xdda188[_0x0a6b('0x1c')](0xcc)[_0x0a6b('0x1b')]();});}};}function handleEntityNotFound(_0x3b12a2,_0x5b2229){return function(_0x3e6a1d){if(!_0x3e6a1d){_0x3b12a2[_0x0a6b('0x29')](0x194);}return _0x3e6a1d;};}function handleError(_0x19a653,_0x4ce9d4){_0x4ce9d4=_0x4ce9d4||0x1f4;return function(_0x3a9092){logger['error'](_0x3a9092[_0x0a6b('0x2a')]);if(_0x3a9092[_0x0a6b('0x2b')]){delete _0x3a9092[_0x0a6b('0x2b')];}_0x19a653['status'](_0x4ce9d4)['send'](_0x3a9092);};}exports[_0x0a6b('0x2c')]=function(_0xe01bba,_0x1aecc7){var _0x3d649e={},_0x1935a3={},_0x2bbcb1={'count':0x0,'rows':[]};var _0x486f0d=_[_0x0a6b('0x2d')](db[_0x0a6b('0x2e')]['rawAttributes'],function(_0x4744d1){return{'name':_0x4744d1['fieldName'],'type':_0x4744d1['type'][_0x0a6b('0x2f')]};});_0x1935a3[_0x0a6b('0x30')]=_[_0x0a6b('0x2d')](_0x486f0d,_0x0a6b('0x2b'));_0x1935a3[_0x0a6b('0x31')]=_['keys'](_0xe01bba['query']);_0x1935a3[_0x0a6b('0x32')]=_[_0x0a6b('0x33')](_0x1935a3[_0x0a6b('0x30')],_0x1935a3[_0x0a6b('0x31')]);_0x3d649e['attributes']=_[_0x0a6b('0x33')](_0x1935a3[_0x0a6b('0x30')],qs['fields'](_0xe01bba['query'][_0x0a6b('0x34')]));_0x3d649e[_0x0a6b('0x35')]=_0x3d649e['attributes'][_0x0a6b('0x36')]?_0x3d649e[_0x0a6b('0x35')]:_0x1935a3[_0x0a6b('0x30')];if(!_0xe01bba[_0x0a6b('0x31')][_0x0a6b('0x37')](_0x0a6b('0x38'))){_0x3d649e[_0x0a6b('0x1f')]=qs[_0x0a6b('0x1f')](_0xe01bba[_0x0a6b('0x31')][_0x0a6b('0x1f')]);_0x3d649e[_0x0a6b('0x20')]=qs[_0x0a6b('0x20')](_0xe01bba['query'][_0x0a6b('0x20')]);}_0x3d649e[_0x0a6b('0x39')]=qs['sort'](_0xe01bba[_0x0a6b('0x31')][_0x0a6b('0x3a')]);_0x3d649e[_0x0a6b('0x3b')]=qs[_0x0a6b('0x32')](_[_0x0a6b('0x3c')](_0xe01bba[_0x0a6b('0x31')],_0x1935a3[_0x0a6b('0x32')]),_0x486f0d);if(_0xe01bba[_0x0a6b('0x31')][_0x0a6b('0x3d')]){_0x3d649e['where']=_[_0x0a6b('0x3e')](_0x3d649e[_0x0a6b('0x3b')],{'$or':_[_0x0a6b('0x2d')](_0x486f0d,function(_0x2f7e4b){if(_0x2f7e4b[_0x0a6b('0x3f')]!==_0x0a6b('0x40')){var _0x25254d={};_0x25254d[_0x2f7e4b[_0x0a6b('0x2b')]]={'$like':'%'+_0xe01bba[_0x0a6b('0x31')]['filter']+'%'};return _0x25254d;}})});}_0x3d649e=_[_0x0a6b('0x3e')]({},_0x3d649e,_0xe01bba[_0x0a6b('0x41')]);var _0x3aa7d5={'where':_0x3d649e[_0x0a6b('0x3b')]};return db[_0x0a6b('0x2e')][_0x0a6b('0x21')](_0x3aa7d5)[_0x0a6b('0x28')](function(_0x127e20){_0x2bbcb1[_0x0a6b('0x21')]=_0x127e20;if(_0xe01bba['query'][_0x0a6b('0x42')]){_0x3d649e['include']=[{'all':!![]}];}return db['MailQueueReport'][_0x0a6b('0x43')](_0x3d649e);})['then'](function(_0x556a28){_0x2bbcb1[_0x0a6b('0x44')]=_0x556a28;return _0x2bbcb1;})[_0x0a6b('0x28')](respondWithFilteredResult(_0x1aecc7,_0x3d649e))[_0x0a6b('0x45')](handleError(_0x1aecc7,null));};exports['show']=function(_0x445a7b,_0x4d32bf){var _0x531f94={'raw':!![],'where':{'id':_0x445a7b['params']['id']}},_0x1114f1={};_0x1114f1[_0x0a6b('0x30')]=_['keys'](db[_0x0a6b('0x2e')]['rawAttributes']);_0x1114f1['query']=_[_0x0a6b('0x46')](_0x445a7b[_0x0a6b('0x31')]);_0x1114f1[_0x0a6b('0x32')]=_[_0x0a6b('0x33')](_0x1114f1['model'],_0x1114f1[_0x0a6b('0x31')]);_0x531f94[_0x0a6b('0x35')]=_[_0x0a6b('0x33')](_0x1114f1[_0x0a6b('0x30')],qs[_0x0a6b('0x34')](_0x445a7b[_0x0a6b('0x31')][_0x0a6b('0x34')]));_0x531f94['attributes']=_0x531f94[_0x0a6b('0x35')][_0x0a6b('0x36')]?_0x531f94[_0x0a6b('0x35')]:_0x1114f1[_0x0a6b('0x30')];if(_0x445a7b[_0x0a6b('0x31')][_0x0a6b('0x42')]){_0x531f94[_0x0a6b('0x47')]=[{'all':!![]}];}_0x531f94=_[_0x0a6b('0x3e')]({},_0x531f94,_0x445a7b[_0x0a6b('0x41')]);return db['MailQueueReport'][_0x0a6b('0x48')](_0x531f94)[_0x0a6b('0x28')](handleEntityNotFound(_0x4d32bf,null))[_0x0a6b('0x28')](respondWithResult(_0x4d32bf,null))[_0x0a6b('0x45')](handleError(_0x4d32bf,null));};exports[_0x0a6b('0x49')]=function(_0x638ba8,_0x8f1372){return db['MailQueueReport']['create'](_0x638ba8[_0x0a6b('0x4a')],{})[_0x0a6b('0x28')](respondWithResult(_0x8f1372,0xc9))[_0x0a6b('0x45')](handleError(_0x8f1372,null));};exports[_0x0a6b('0x26')]=function(_0x2ca82a,_0x446187){if(_0x2ca82a[_0x0a6b('0x4a')]['id']){delete _0x2ca82a[_0x0a6b('0x4a')]['id'];}return db[_0x0a6b('0x2e')]['find']({'where':{'id':_0x2ca82a[_0x0a6b('0x4b')]['id']}})[_0x0a6b('0x28')](handleEntityNotFound(_0x446187,null))[_0x0a6b('0x28')](saveUpdates(_0x2ca82a[_0x0a6b('0x4a')],null))[_0x0a6b('0x28')](respondWithResult(_0x446187,null))['catch'](handleError(_0x446187,null));};exports[_0x0a6b('0x27')]=function(_0x3fd0df,_0x3aa85f){return db[_0x0a6b('0x2e')][_0x0a6b('0x48')]({'where':{'id':_0x3fd0df[_0x0a6b('0x4b')]['id']}})[_0x0a6b('0x28')](handleEntityNotFound(_0x3aa85f,null))[_0x0a6b('0x28')](removeEntity(_0x3aa85f,null))[_0x0a6b('0x45')](handleError(_0x3aa85f,null));};exports[_0x0a6b('0x4c')]=function(_0x5d8a4f,_0x4c81a7){return db[_0x0a6b('0x2e')]['describe']()[_0x0a6b('0x28')](respondWithResult(_0x4c81a7,null))['catch'](handleError(_0x4c81a7,null));}; \ No newline at end of file +var _0x0295=['params','intersection','include','find','create','body','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','MailQueueReport','includeAll','rows','catch','show'];(function(_0x11d570,_0x59fa8f){var _0x14f446=function(_0x5c0de5){while(--_0x5c0de5){_0x11d570['push'](_0x11d570['shift']());}};_0x14f446(++_0x59fa8f);}(_0x0295,0x1f0));var _0x5029=function(_0xd16df9,_0x18db96){_0xd16df9=_0xd16df9-0x0;var _0x141b04=_0x0295[_0xd16df9];return _0x141b04;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}exports[_0x5029('0x25')]=function(_0x4a24b9,_0x32da06){var _0x251f99={},_0xe5313e={},_0x4b6f92={'count':0x0,'rows':[]};var _0x2cedf6=_[_0x5029('0x26')](db['MailQueueReport'][_0x5029('0x27')],function(_0x25032b){return{'name':_0x25032b[_0x5029('0x28')],'type':_0x25032b[_0x5029('0x29')][_0x5029('0x2a')]};});_0xe5313e[_0x5029('0x2b')]=_[_0x5029('0x26')](_0x2cedf6,_0x5029('0x23'));_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2d')](_0x4a24b9[_0x5029('0x2c')]);_0xe5313e[_0x5029('0x2e')]=_['intersection'](_0xe5313e[_0x5029('0x2b')],_0xe5313e['query']);_0x251f99[_0x5029('0x2f')]=_['intersection'](_0xe5313e['model'],qs[_0x5029('0x30')](_0x4a24b9[_0x5029('0x2c')][_0x5029('0x30')]));_0x251f99['attributes']=_0x251f99[_0x5029('0x2f')][_0x5029('0x31')]?_0x251f99[_0x5029('0x2f')]:_0xe5313e[_0x5029('0x2b')];if(!_0x4a24b9[_0x5029('0x2c')][_0x5029('0x32')](_0x5029('0x33'))){_0x251f99[_0x5029('0x1a')]=qs[_0x5029('0x1a')](_0x4a24b9['query'][_0x5029('0x1a')]);_0x251f99[_0x5029('0x18')]=qs[_0x5029('0x18')](_0x4a24b9[_0x5029('0x2c')]['offset']);}_0x251f99[_0x5029('0x34')]=qs[_0x5029('0x35')](_0x4a24b9[_0x5029('0x2c')]['sort']);_0x251f99['where']=qs[_0x5029('0x2e')](_[_0x5029('0x36')](_0x4a24b9['query'],_0xe5313e['filters']),_0x2cedf6);if(_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]){_0x251f99[_0x5029('0x38')]=_[_0x5029('0x39')](_0x251f99[_0x5029('0x38')],{'$or':_[_0x5029('0x26')](_0x2cedf6,function(_0x3cb84e){if(_0x3cb84e[_0x5029('0x29')]!==_0x5029('0x3a')){var _0x3effa4={};_0x3effa4[_0x3cb84e[_0x5029('0x23')]]={'$like':'%'+_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]+'%'};return _0x3effa4;}})});}_0x251f99=_[_0x5029('0x39')]({},_0x251f99,_0x4a24b9['options']);var _0x57c2b5={'where':_0x251f99[_0x5029('0x38')]};return db[_0x5029('0x3b')][_0x5029('0x1b')](_0x57c2b5)['then'](function(_0x32d8a3){_0x4b6f92[_0x5029('0x1b')]=_0x32d8a3;if(_0x4a24b9['query'][_0x5029('0x3c')]){_0x251f99['include']=[{'all':!![]}];}return db[_0x5029('0x3b')]['findAll'](_0x251f99);})[_0x5029('0x20')](function(_0x359838){_0x4b6f92[_0x5029('0x3d')]=_0x359838;return _0x4b6f92;})[_0x5029('0x20')](respondWithFilteredResult(_0x32da06,_0x251f99))[_0x5029('0x3e')](handleError(_0x32da06,null));};exports[_0x5029('0x3f')]=function(_0x4b2219,_0x1021ea){var _0x2ae047={'raw':!![],'where':{'id':_0x4b2219[_0x5029('0x40')]['id']}},_0x5a3e4d={};_0x5a3e4d[_0x5029('0x2b')]=_[_0x5029('0x2d')](db[_0x5029('0x3b')][_0x5029('0x27')]);_0x5a3e4d[_0x5029('0x2c')]=_['keys'](_0x4b2219[_0x5029('0x2c')]);_0x5a3e4d[_0x5029('0x2e')]=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],_0x5a3e4d[_0x5029('0x2c')]);_0x2ae047['attributes']=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x4b2219[_0x5029('0x2c')][_0x5029('0x30')]));_0x2ae047[_0x5029('0x2f')]=_0x2ae047[_0x5029('0x2f')][_0x5029('0x31')]?_0x2ae047[_0x5029('0x2f')]:_0x5a3e4d['model'];if(_0x4b2219[_0x5029('0x2c')][_0x5029('0x3c')]){_0x2ae047[_0x5029('0x42')]=[{'all':!![]}];}_0x2ae047=_[_0x5029('0x39')]({},_0x2ae047,_0x4b2219['options']);return db['MailQueueReport'][_0x5029('0x43')](_0x2ae047)[_0x5029('0x20')](handleEntityNotFound(_0x1021ea,null))[_0x5029('0x20')](respondWithResult(_0x1021ea,null))[_0x5029('0x3e')](handleError(_0x1021ea,null));};exports[_0x5029('0x44')]=function(_0x3dfc08,_0x2bb7fc){return db[_0x5029('0x3b')][_0x5029('0x44')](_0x3dfc08[_0x5029('0x45')],{})[_0x5029('0x20')](respondWithResult(_0x2bb7fc,0xc9))[_0x5029('0x3e')](handleError(_0x2bb7fc,null));};exports[_0x5029('0x1f')]=function(_0x18f1f5,_0x3168bd){if(_0x18f1f5[_0x5029('0x45')]['id']){delete _0x18f1f5[_0x5029('0x45')]['id'];}return db[_0x5029('0x3b')][_0x5029('0x43')]({'where':{'id':_0x18f1f5[_0x5029('0x40')]['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x3168bd,null))['then'](saveUpdates(_0x18f1f5[_0x5029('0x45')],null))['then'](respondWithResult(_0x3168bd,null))[_0x5029('0x3e')](handleError(_0x3168bd,null));};exports[_0x5029('0x21')]=function(_0x4d788a,_0x5343c6){return db[_0x5029('0x3b')]['find']({'where':{'id':_0x4d788a['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x5343c6,null))[_0x5029('0x20')](removeEntity(_0x5343c6,null))[_0x5029('0x3e')](handleError(_0x5343c6,null));};exports['describe']=function(_0x544fb3,_0x1510bb){return db[_0x5029('0x3b')]['describe']()[_0x5029('0x20')](respondWithResult(_0x1510bb,null))['catch'](handleError(_0x1510bb,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index c72619a..3e37764 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 _0xf40e=['./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','api','moment','request-promise','rimraf','../../config/environment'];(function(_0xebf1f2,_0x377a4f){var _0x836f9d=function(_0x299212){while(--_0x299212){_0xebf1f2['push'](_0xebf1f2['shift']());}};_0x836f9d(++_0x377a4f);}(_0xf40e,0x1be));var _0xef40=function(_0x2b01bd,_0xcb8e67){_0x2b01bd=_0x2b01bd-0x0;var _0x3e33b2=_0xf40e[_0x2b01bd];return _0x3e33b2;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xef40('0x0'));var moment=require(_0xef40('0x1'));var BPromise=require('bluebird');var rp=require(_0xef40('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xef40('0x3'));var config=require(_0xef40('0x4'));var attributes=require(_0xef40('0x5'));module[_0xef40('0x6')]=function(_0x183786,_0x5a628a){return _0x183786[_0xef40('0x7')](_0xef40('0x8'),attributes,{'tableName':_0xef40('0x9'),'paranoid':![],'indexes':[{'name':_0xef40('0xa'),'fields':[_0xef40('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9206=['report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','define','MailQueueReport'];(function(_0x204950,_0x22c2ca){var _0x2c1386=function(_0x6ec005){while(--_0x6ec005){_0x204950['push'](_0x204950['shift']());}};_0x2c1386(++_0x22c2ca);}(_0x9206,0x176));var _0x6920=function(_0x5827a3,_0x5049f3){_0x5827a3=_0x5827a3-0x0;var _0x1a763b=_0x9206[_0x5827a3];return _0x1a763b;};'use strict';var _=require(_0x6920('0x0'));var util=require(_0x6920('0x1'));var logger=require(_0x6920('0x2'))(_0x6920('0x3'));var moment=require(_0x6920('0x4'));var BPromise=require(_0x6920('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6920('0x6'));var config=require(_0x6920('0x7'));var attributes=require('./mailQueueReport.attributes');module['exports']=function(_0x41c8c4,_0x4d67d7){return _0x41c8c4[_0x6920('0x8')](_0x6920('0x9'),attributes,{'tableName':_0x6920('0xa'),'paranoid':![],'indexes':[{'name':_0x6920('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index aea5ee4..f8e57fe 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(_0x544db1,_0x3e54b8){var _0x176cea=function(_0x4111b9){while(--_0x4111b9){_0x544db1['push'](_0x544db1['shift']());}};_0x176cea(++_0x3e54b8);}(_0x7a54,0x106));var _0x47a5=function(_0x25f6ab,_0x2aaa60){_0x25f6ab=_0x25f6ab-0x0;var _0x24fa17=_0x7a54[_0x25f6ab];return _0x24fa17;};'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 _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x31b74c,_0x30f8cd){var _0x2b4f1c=function(_0x4d587d){while(--_0x4d587d){_0x31b74c['push'](_0x31b74c['shift']());}};_0x2b4f1c(++_0x30f8cd);}(_0x2ef3,0xba));var _0x32ef=function(_0x35c4a3,_0x2c8921){_0x35c4a3=_0x35c4a3-0x0;var _0x17936f=_0x2ef3[_0x35c4a3];return _0x17936f;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index cf2a333..dcfc675 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(_0x506654,_0x3432ef){var _0x334406=function(_0x363a10){while(--_0x363a10){_0x506654['push'](_0x506654['shift']());}};_0x334406(++_0x3432ef);}(_0xe706,0xa3));var _0x6e70=function(_0x5281ce,_0x210279){_0x5281ce=_0x5281ce-0x0;var _0x138d09=_0xe706[_0x5281ce];return _0x138d09;};'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(_0x1ae09e,_0xd9e291){var _0x532849=function(_0x142db9){while(--_0x142db9){_0x1ae09e['push'](_0x1ae09e['shift']());}};_0x532849(++_0xd9e291);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x386525,_0xefae6){_0x386525=_0x386525-0x0;var _0x14d015=_0xcb91[_0x386525];return _0x14d015;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index f1e3342..832b7f9 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 _0x37f0=['sequelize','STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x27226f,_0x41fe0f){var _0x5385c9=function(_0x1e00aa){while(--_0x1e00aa){_0x27226f['push'](_0x27226f['shift']());}};_0x5385c9(++_0x41fe0f);}(_0x37f0,0x118));var _0x037f=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x37f0[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require(_0x037f('0x0'));module['exports']={'description':{'type':Sequelize[_0x037f('0x1')]},'host':{'type':Sequelize[_0x037f('0x1')]},'authentication':{'type':Sequelize[_0x037f('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x037f('0x1')]},'port':{'type':Sequelize[_0x037f('0x3')]},'tls':{'type':Sequelize[_0x037f('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x037f('0x1')],'defaultValue':_0x037f('0x4')},'connTimeout':{'type':Sequelize[_0x037f('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x037f('0x3')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x037f('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x5a99=['BOOLEAN','INTEGER','INBOX','sequelize','exports','STRING'];(function(_0x35ca86,_0x5bc843){var _0x152305=function(_0x5395b8){while(--_0x5395b8){_0x35ca86['push'](_0x35ca86['shift']());}};_0x152305(++_0x5bc843);}(_0x5a99,0xc9));var _0x95a9=function(_0x716847,_0x18b829){_0x716847=_0x716847-0x0;var _0x1b59ee=_0x5a99[_0x716847];return _0x1b59ee;};'use strict';var Sequelize=require(_0x95a9('0x0'));module[_0x95a9('0x1')]={'description':{'type':Sequelize[_0x95a9('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x95a9('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x95a9('0x2')]},'password':{'type':Sequelize[_0x95a9('0x2')]},'port':{'type':Sequelize[_0x95a9('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x95a9('0x2')],'defaultValue':_0x95a9('0x5')},'connTimeout':{'type':Sequelize[_0x95a9('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x95a9('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x95a9('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 7b7705c..c48945d 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 _0x19d1=['MailServerIn','mail_servers_in','lodash','../../config/logger','moment','bluebird','./mailServerIn.attributes','define'];(function(_0x5ed03a,_0x59a0a7){var _0x44646b=function(_0xee62f1){while(--_0xee62f1){_0x5ed03a['push'](_0x5ed03a['shift']());}};_0x44646b(++_0x59a0a7);}(_0x19d1,0x1ba));var _0x119d=function(_0x4c8cbf,_0x3ef80b){_0x4c8cbf=_0x4c8cbf-0x0;var _0x243dac=_0x19d1[_0x4c8cbf];return _0x243dac;};'use strict';var _=require(_0x119d('0x0'));var util=require('util');var logger=require(_0x119d('0x1'))('api');var moment=require(_0x119d('0x2'));var BPromise=require(_0x119d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x119d('0x4'));module['exports']=function(_0x3453fc,_0x2d7931){return _0x3453fc[_0x119d('0x5')](_0x119d('0x6'),attributes,{'tableName':_0x119d('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x18be=['api','moment','request-promise','../../config/environment','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x18be,0x168));var _0xe18b=function(_0x7c9f1d,_0x4b7628){_0x7c9f1d=_0x7c9f1d-0x0;var _0x1b24bd=_0x18be[_0x7c9f1d];return _0x1b24bd;};'use strict';var _=require(_0xe18b('0x0'));var util=require(_0xe18b('0x1'));var logger=require(_0xe18b('0x2'))(_0xe18b('0x3'));var moment=require(_0xe18b('0x4'));var BPromise=require('bluebird');var rp=require(_0xe18b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe18b('0x6'));var attributes=require(_0xe18b('0x7'));module[_0xe18b('0x8')]=function(_0x1ffce9,_0xcceeec){return _0x1ffce9['define'](_0xe18b('0x9'),attributes,{'tableName':_0xe18b('0xa'),'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 e4c6c6f..80dd056 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 _0xc1d8=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','then','lodash','util'];(function(_0x178402,_0x373593){var _0x3ca836=function(_0xa8101b){while(--_0xa8101b){_0x178402['push'](_0x178402['shift']());}};_0x3ca836(++_0x373593);}(_0xc1d8,0xec));var _0x8c1d=function(_0x562749,_0x26975a){_0x562749=_0x562749-0x0;var _0x47ec36=_0xc1d8[_0x562749];return _0x47ec36;};'use strict';var _=require(_0x8c1d('0x0'));var util=require(_0x8c1d('0x1'));var moment=require('moment');var BPromise=require(_0x8c1d('0x2'));var rs=require(_0x8c1d('0x3'));var fs=require('fs');var Redis=require(_0x8c1d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8c1d('0x5'))(_0x8c1d('0x6'));var config=require(_0x8c1d('0x7'));var jayson=require(_0x8c1d('0x8'));var client=jayson[_0x8c1d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43953a,_0x2d1f1c,_0x3b032a){return new BPromise(function(_0x5edf0b,_0x8e5360){return client[_0x8c1d('0xa')](_0x43953a,_0x3b032a)['then'](function(_0x5d0c81){logger[_0x8c1d('0xb')](_0x8c1d('0xc'),_0x2d1f1c,'request\x20sent');logger[_0x8c1d('0xd')](_0x8c1d('0xe'),_0x2d1f1c,_0x8c1d('0xf'),JSON[_0x8c1d('0x10')](_0x5d0c81));if(_0x5d0c81['error']){if(_0x5d0c81['error'][_0x8c1d('0x11')]===0x1f4){logger['error'](_0x8c1d('0xc'),_0x2d1f1c,_0x5d0c81[_0x8c1d('0x12')]['message']);return _0x8e5360(_0x5d0c81['error'][_0x8c1d('0x13')]);}logger[_0x8c1d('0x12')](_0x8c1d('0xc'),_0x2d1f1c,_0x5d0c81[_0x8c1d('0x12')]['message']);return _0x5edf0b(_0x5d0c81[_0x8c1d('0x12')][_0x8c1d('0x13')]);}else{logger[_0x8c1d('0xb')]('MailServerIn,\x20%s,\x20%s',_0x2d1f1c,_0x8c1d('0xf'));_0x5edf0b(_0x5d0c81[_0x8c1d('0x14')][_0x8c1d('0x13')]);}})[_0x8c1d('0x15')](function(_0x2ae148){logger[_0x8c1d('0x12')](_0x8c1d('0xc'),_0x2d1f1c,_0x2ae148);_0x8e5360(_0x2ae148);});});}exports[_0x8c1d('0x16')]=function(_0x1e3b6b){var _0x46545c=this;return new Promise(function(_0xb40b6d,_0x4dc35f){return db[_0x8c1d('0x17')][_0x8c1d('0x18')]({'raw':_0x1e3b6b[_0x8c1d('0x19')]?_0x1e3b6b[_0x8c1d('0x19')][_0x8c1d('0x1a')]===undefined?!![]:![]:!![],'where':_0x1e3b6b['options']?_0x1e3b6b[_0x8c1d('0x19')][_0x8c1d('0x1b')]||null:null,'attributes':_0x1e3b6b[_0x8c1d('0x19')]?_0x1e3b6b[_0x8c1d('0x19')][_0x8c1d('0x1c')]||null:null,'limit':_0x1e3b6b[_0x8c1d('0x19')]?_0x1e3b6b[_0x8c1d('0x19')][_0x8c1d('0x1d')]||null:null,'include':_0x1e3b6b[_0x8c1d('0x19')]?_0x1e3b6b[_0x8c1d('0x19')][_0x8c1d('0x1e')]?_[_0x8c1d('0x1f')](_0x1e3b6b[_0x8c1d('0x19')][_0x8c1d('0x1e')],function(_0x1e636c){return{'model':db[_0x1e636c[_0x8c1d('0x20')]],'as':_0x1e636c['as'],'attributes':_0x1e636c[_0x8c1d('0x1c')],'include':_0x1e636c[_0x8c1d('0x1e')]?_[_0x8c1d('0x1f')](_0x1e636c[_0x8c1d('0x1e')],function(_0x42e46e){return{'model':db[_0x42e46e[_0x8c1d('0x20')]],'as':_0x42e46e['as'],'attributes':_0x42e46e[_0x8c1d('0x1c')],'include':_0x42e46e[_0x8c1d('0x1e')]?_['map'](_0x42e46e[_0x8c1d('0x1e')],function(_0x193245){return{'model':db[_0x193245[_0x8c1d('0x20')]],'as':_0x193245['as'],'attributes':_0x193245[_0x8c1d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8c1d('0x21')](function(_0x52f3f2){logger[_0x8c1d('0xb')](_0x8c1d('0x16'),_0x1e3b6b);logger[_0x8c1d('0xd')](_0x8c1d('0x16'),_0x1e3b6b,JSON[_0x8c1d('0x10')](_0x52f3f2));_0xb40b6d(_0x52f3f2);})['catch'](function(_0x52b042){logger[_0x8c1d('0x12')](_0x8c1d('0x16'),_0x52b042[_0x8c1d('0x13')],_0x1e3b6b);_0x4dc35f(_0x46545c[_0x8c1d('0x12')](0x1f4,_0x52b042[_0x8c1d('0x13')]));});});}; \ No newline at end of file +var _0x08fb=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailServerIn','MailServerIn','findAll','options','where','limit','map','model','include','attributes'];(function(_0x3ad5fe,_0x4b57bc){var _0x186865=function(_0x1faddc){while(--_0x1faddc){_0x3ad5fe['push'](_0x3ad5fe['shift']());}};_0x186865(++_0x4b57bc);}(_0x08fb,0x193));var _0xb08f=function(_0x26fb67,_0x57eb43){_0x26fb67=_0x26fb67-0x0;var _0x3981dc=_0x08fb[_0x26fb67];return _0x3981dc;};'use strict';var _=require(_0xb08f('0x0'));var util=require(_0xb08f('0x1'));var moment=require(_0xb08f('0x2'));var BPromise=require(_0xb08f('0x3'));var rs=require(_0xb08f('0x4'));var fs=require('fs');var Redis=require(_0xb08f('0x5'));var db=require(_0xb08f('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb08f('0x7'));var client=jayson['client'][_0xb08f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x34ac16,_0xe7c94c,_0x8d4497){return new BPromise(function(_0x3af748,_0x4135db){return client[_0xb08f('0x9')](_0x34ac16,_0x8d4497)[_0xb08f('0xa')](function(_0x5527b9){logger[_0xb08f('0xb')](_0xb08f('0xc'),_0xe7c94c,_0xb08f('0xd'));logger[_0xb08f('0xe')](_0xb08f('0xf'),_0xe7c94c,'request\x20sent',JSON[_0xb08f('0x10')](_0x5527b9));if(_0x5527b9[_0xb08f('0x11')]){if(_0x5527b9[_0xb08f('0x11')][_0xb08f('0x12')]===0x1f4){logger[_0xb08f('0x11')]('MailServerIn,\x20%s,\x20%s',_0xe7c94c,_0x5527b9[_0xb08f('0x11')]['message']);return _0x4135db(_0x5527b9[_0xb08f('0x11')][_0xb08f('0x13')]);}logger['error'](_0xb08f('0xc'),_0xe7c94c,_0x5527b9[_0xb08f('0x11')]['message']);return _0x3af748(_0x5527b9[_0xb08f('0x11')]['message']);}else{logger[_0xb08f('0xb')](_0xb08f('0xc'),_0xe7c94c,_0xb08f('0xd'));_0x3af748(_0x5527b9['result']['message']);}})[_0xb08f('0x14')](function(_0x4303ab){logger[_0xb08f('0x11')](_0xb08f('0xc'),_0xe7c94c,_0x4303ab);_0x4135db(_0x4303ab);});});}exports[_0xb08f('0x15')]=function(_0x2a09a1){var _0x889be5=this;return new Promise(function(_0x431779,_0x439e17){return db[_0xb08f('0x16')][_0xb08f('0x17')]({'raw':_0x2a09a1['options']?_0x2a09a1[_0xb08f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2a09a1[_0xb08f('0x18')]?_0x2a09a1['options'][_0xb08f('0x19')]||null:null,'attributes':_0x2a09a1[_0xb08f('0x18')]?_0x2a09a1[_0xb08f('0x18')]['attributes']||null:null,'limit':_0x2a09a1[_0xb08f('0x18')]?_0x2a09a1['options'][_0xb08f('0x1a')]||null:null,'include':_0x2a09a1['options']?_0x2a09a1['options']['include']?_[_0xb08f('0x1b')](_0x2a09a1['options']['include'],function(_0x574043){return{'model':db[_0x574043[_0xb08f('0x1c')]],'as':_0x574043['as'],'attributes':_0x574043['attributes'],'include':_0x574043[_0xb08f('0x1d')]?_['map'](_0x574043[_0xb08f('0x1d')],function(_0x5269e0){return{'model':db[_0x5269e0['model']],'as':_0x5269e0['as'],'attributes':_0x5269e0[_0xb08f('0x1e')],'include':_0x5269e0[_0xb08f('0x1d')]?_[_0xb08f('0x1b')](_0x5269e0[_0xb08f('0x1d')],function(_0x712fa0){return{'model':db[_0x712fa0[_0xb08f('0x1c')]],'as':_0x712fa0['as'],'attributes':_0x712fa0['attributes']};}):[]};}):[]};}):[]:[]})[_0xb08f('0xa')](function(_0x10e5ff){logger['info']('GetMailServerIn',_0x2a09a1);logger[_0xb08f('0xe')]('GetMailServerIn',_0x2a09a1,JSON[_0xb08f('0x10')](_0x10e5ff));_0x431779(_0x10e5ff);})[_0xb08f('0x14')](function(_0x32ab9a){logger[_0xb08f('0x11')](_0xb08f('0x15'),_0x32ab9a[_0xb08f('0x13')],_0x2a09a1);_0x439e17(_0x889be5['error'](0x1f4,_0x32ab9a[_0xb08f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 9cfec72..5b3c37f 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(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x7a54,0x106));var _0x47a5=function(_0x2d2330,_0x24d4d2){_0x2d2330=_0x2d2330-0x0;var _0x17f233=_0x7a54[_0x2d2330];return _0x17f233;};'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(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x7a54,0x106));var _0x47a5=function(_0x4b6426,_0x25aad1){_0x4b6426=_0x4b6426-0x0;var _0x4e44e9=_0x7a54[_0x4b6426];return _0x4e44e9;};'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 caa7868..15ef71b 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 _0x282b=['sequelize','exports','STRING','BOOLEAN'];(function(_0xb5a1c3,_0x107fba){var _0x11e544=function(_0x2ad2da){while(--_0x2ad2da){_0xb5a1c3['push'](_0xb5a1c3['shift']());}};_0x11e544(++_0x107fba);}(_0x282b,0xec));var _0xb282=function(_0x2741a6,_0x1ccdf0){_0x2741a6=_0x2741a6-0x0;var _0x2ee35c=_0x282b[_0x2741a6];return _0x2ee35c;};'use strict';var Sequelize=require(_0xb282('0x0'));module[_0xb282('0x1')]={'description':{'type':Sequelize[_0xb282('0x2')]},'host':{'type':Sequelize[_0xb282('0x2')]},'user':{'type':Sequelize[_0xb282('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0xb282('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xb282('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xb282('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xefda=['INTEGER','BOOLEAN','sequelize','STRING'];(function(_0x35e4a2,_0x49f61e){var _0x3f2f7c=function(_0x8abdfd){while(--_0x8abdfd){_0x35e4a2['push'](_0x35e4a2['shift']());}};_0x3f2f7c(++_0x49f61e);}(_0xefda,0x96));var _0xaefd=function(_0x21ffd4,_0x3cc9b5){_0x21ffd4=_0x21ffd4-0x0;var _0x180390=_0xefda[_0x21ffd4];return _0x180390;};'use strict';var Sequelize=require(_0xaefd('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xaefd('0x1')]},'user':{'type':Sequelize[_0xaefd('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xaefd('0x2')]},'secure':{'type':Sequelize[_0xaefd('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xaefd('0x1')]},'authentication':{'type':Sequelize[_0xaefd('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xaefd('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 069286f..5d056e0 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 _0xe862=['order','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','sendStatus','error','stack','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe862,0x18e));var _0x2e86=function(_0x172ad0,_0x3de128){_0x172ad0=_0x172ad0-0x0;var _0x4dbe61=_0xe862[_0x172ad0];return _0x4dbe61;};'use strict';var emlformat=require(_0x2e86('0x0'));var rimraf=require(_0x2e86('0x1'));var zipdir=require(_0x2e86('0x2'));var jsonpatch=require(_0x2e86('0x3'));var rp=require('request-promise');var moment=require(_0x2e86('0x4'));var BPromise=require(_0x2e86('0x5'));var Mustache=require(_0x2e86('0x6'));var util=require('util');var path=require(_0x2e86('0x7'));var sox=require(_0x2e86('0x8'));var csv=require(_0x2e86('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2e86('0xa'));var _=require(_0x2e86('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2e86('0xc'));var deskjs=require(_0x2e86('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2e86('0xe'));var Redis=require('ioredis');var authService=require(_0x2e86('0xf'));var qs=require(_0x2e86('0x10'));var as=require(_0x2e86('0x11'));var hardwareService=require(_0x2e86('0x12'));var logger=require(_0x2e86('0x13'))(_0x2e86('0x14'));var utils=require(_0x2e86('0x15'));var config=require(_0x2e86('0x16'));var licenseUtil=require(_0x2e86('0x17'));var db=require(_0x2e86('0x18'))['db'];function respondWithStatusCode(_0x291df8,_0x258888){_0x258888=_0x258888||0xcc;return function(_0x51bc67){if(_0x51bc67){return _0x291df8['sendStatus'](_0x258888);}return _0x291df8[_0x2e86('0x19')](_0x258888)[_0x2e86('0x1a')]();};}function respondWithResult(_0x38f118,_0x3c4864){_0x3c4864=_0x3c4864||0xc8;return function(_0x3bca84){if(_0x3bca84){return _0x38f118[_0x2e86('0x19')](_0x3c4864)[_0x2e86('0x1b')](_0x3bca84);}};}function respondWithFilteredResult(_0x533b79,_0x17d96a){return function(_0x22d8da){if(_0x22d8da){var _0x10adbb=typeof _0x17d96a[_0x2e86('0x1c')]===_0x2e86('0x1d')&&typeof _0x17d96a[_0x2e86('0x1e')]===_0x2e86('0x1d');var _0x345f34=_0x22d8da[_0x2e86('0x1f')];var _0x5b2ca7=_0x10adbb?0x0:_0x17d96a['offset'];var _0xb653c7=_0x10adbb?_0x22d8da[_0x2e86('0x1f')]:_0x17d96a[_0x2e86('0x1c')]+_0x17d96a[_0x2e86('0x1e')];var _0x2f20fe;if(_0xb653c7>=_0x345f34){_0xb653c7=_0x345f34;_0x2f20fe=0xc8;}else{_0x2f20fe=0xce;}_0x533b79['status'](_0x2f20fe);return _0x533b79[_0x2e86('0x20')](_0x2e86('0x21'),_0x5b2ca7+'-'+_0xb653c7+'/'+_0x345f34)['json'](_0x22d8da);}return null;};}function patchUpdates(_0x3d9202){return function(_0x172772){try{jsonpatch[_0x2e86('0x22')](_0x172772,_0x3d9202,!![]);}catch(_0x748492){return BPromise[_0x2e86('0x23')](_0x748492);}return _0x172772['save']();};}function saveUpdates(_0x17b284,_0x358240){return function(_0x5eb19b){if(_0x5eb19b){return _0x5eb19b['update'](_0x17b284)[_0x2e86('0x24')](function(_0x303958){return _0x303958;});}return null;};}function removeEntity(_0x169201,_0xc14e54){return function(_0x262302){if(_0x262302){return _0x262302['destroy']()['then'](function(){_0x169201[_0x2e86('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57149c,_0x4e75bd){return function(_0x3ea094){if(!_0x3ea094){_0x57149c[_0x2e86('0x25')](0x194);}return _0x3ea094;};}function handleError(_0x4e3781,_0x240354){_0x240354=_0x240354||0x1f4;return function(_0x1f455c){logger[_0x2e86('0x26')](_0x1f455c[_0x2e86('0x27')]);if(_0x1f455c[_0x2e86('0x28')]){delete _0x1f455c[_0x2e86('0x28')];}_0x4e3781['status'](_0x240354)[_0x2e86('0x29')](_0x1f455c);};}exports[_0x2e86('0x2a')]=function(_0x3ea80d,_0xfc6059){var _0xf99922={},_0x34ddea={},_0x3201d3={'count':0x0,'rows':[]};var _0x2a391d=_[_0x2e86('0x2b')](db[_0x2e86('0x2c')][_0x2e86('0x2d')],function(_0x36bc10){return{'name':_0x36bc10[_0x2e86('0x2e')],'type':_0x36bc10[_0x2e86('0x2f')][_0x2e86('0x30')]};});_0x34ddea[_0x2e86('0x31')]=_['map'](_0x2a391d,_0x2e86('0x28'));_0x34ddea['query']=_[_0x2e86('0x32')](_0x3ea80d['query']);_0x34ddea[_0x2e86('0x33')]=_[_0x2e86('0x34')](_0x34ddea[_0x2e86('0x31')],_0x34ddea[_0x2e86('0x35')]);_0xf99922[_0x2e86('0x36')]=_[_0x2e86('0x34')](_0x34ddea['model'],qs[_0x2e86('0x37')](_0x3ea80d[_0x2e86('0x35')]['fields']));_0xf99922[_0x2e86('0x36')]=_0xf99922['attributes'][_0x2e86('0x38')]?_0xf99922[_0x2e86('0x36')]:_0x34ddea['model'];if(!_0x3ea80d['query']['hasOwnProperty'](_0x2e86('0x39'))){_0xf99922['limit']=qs['limit'](_0x3ea80d[_0x2e86('0x35')]['limit']);_0xf99922[_0x2e86('0x1c')]=qs[_0x2e86('0x1c')](_0x3ea80d[_0x2e86('0x35')]['offset']);}_0xf99922[_0x2e86('0x3a')]=qs['sort'](_0x3ea80d[_0x2e86('0x35')]['sort']);_0xf99922[_0x2e86('0x3b')]=qs[_0x2e86('0x33')](_[_0x2e86('0x3c')](_0x3ea80d[_0x2e86('0x35')],_0x34ddea[_0x2e86('0x33')]),_0x2a391d);if(_0x3ea80d[_0x2e86('0x35')][_0x2e86('0x3d')]){_0xf99922[_0x2e86('0x3b')]=_['merge'](_0xf99922[_0x2e86('0x3b')],{'$or':_[_0x2e86('0x2b')](_0x2a391d,function(_0x327280){if(_0x327280[_0x2e86('0x2f')]!==_0x2e86('0x3e')){var _0x30cfff={};_0x30cfff[_0x327280[_0x2e86('0x28')]]={'$like':'%'+_0x3ea80d[_0x2e86('0x35')][_0x2e86('0x3d')]+'%'};return _0x30cfff;}})});}_0xf99922=_[_0x2e86('0x3f')]({},_0xf99922,_0x3ea80d[_0x2e86('0x40')]);var _0x16c74c={'where':_0xf99922[_0x2e86('0x3b')]};return db['MailServerOut']['count'](_0x16c74c)[_0x2e86('0x24')](function(_0x31a600){_0x3201d3['count']=_0x31a600;if(_0x3ea80d['query'][_0x2e86('0x41')]){_0xf99922[_0x2e86('0x42')]=[{'all':!![]}];}return db[_0x2e86('0x2c')][_0x2e86('0x43')](_0xf99922);})[_0x2e86('0x24')](function(_0x5a45b3){_0x3201d3[_0x2e86('0x44')]=_0x5a45b3;return _0x3201d3;})[_0x2e86('0x24')](respondWithFilteredResult(_0xfc6059,_0xf99922))[_0x2e86('0x45')](handleError(_0xfc6059,null));};exports[_0x2e86('0x46')]=function(_0x2123f6,_0x146d64){var _0x14cc0e={'raw':!![],'where':{'id':_0x2123f6[_0x2e86('0x47')]['id']}},_0x147b6d={};_0x147b6d[_0x2e86('0x31')]=_[_0x2e86('0x32')](db[_0x2e86('0x2c')][_0x2e86('0x2d')]);_0x147b6d[_0x2e86('0x35')]=_[_0x2e86('0x32')](_0x2123f6[_0x2e86('0x35')]);_0x147b6d[_0x2e86('0x33')]=_['intersection'](_0x147b6d['model'],_0x147b6d[_0x2e86('0x35')]);_0x14cc0e[_0x2e86('0x36')]=_[_0x2e86('0x34')](_0x147b6d[_0x2e86('0x31')],qs['fields'](_0x2123f6[_0x2e86('0x35')][_0x2e86('0x37')]));_0x14cc0e[_0x2e86('0x36')]=_0x14cc0e[_0x2e86('0x36')][_0x2e86('0x38')]?_0x14cc0e['attributes']:_0x147b6d['model'];if(_0x2123f6['query']['includeAll']){_0x14cc0e['include']=[{'all':!![]}];}_0x14cc0e=_[_0x2e86('0x3f')]({},_0x14cc0e,_0x2123f6[_0x2e86('0x40')]);return db[_0x2e86('0x2c')]['find'](_0x14cc0e)[_0x2e86('0x24')](handleEntityNotFound(_0x146d64,null))[_0x2e86('0x24')](respondWithResult(_0x146d64,null))[_0x2e86('0x45')](handleError(_0x146d64,null));};exports[_0x2e86('0x48')]=function(_0x4a69bc,_0x518e7f){return db['MailServerOut'][_0x2e86('0x48')](_0x4a69bc[_0x2e86('0x49')],{})['then'](respondWithResult(_0x518e7f,0xc9))[_0x2e86('0x45')](handleError(_0x518e7f,null));};exports[_0x2e86('0x4a')]=function(_0x361a03,_0x494dac){if(_0x361a03['body']['id']){delete _0x361a03[_0x2e86('0x49')]['id'];}return db['MailServerOut'][_0x2e86('0x4b')]({'where':{'id':_0x361a03[_0x2e86('0x47')]['id']}})[_0x2e86('0x24')](handleEntityNotFound(_0x494dac,null))[_0x2e86('0x24')](saveUpdates(_0x361a03[_0x2e86('0x49')],null))[_0x2e86('0x24')](respondWithResult(_0x494dac,null))[_0x2e86('0x45')](handleError(_0x494dac,null));};exports['destroy']=function(_0x353cbc,_0x1e411d){return db[_0x2e86('0x2c')][_0x2e86('0x4b')]({'where':{'id':_0x353cbc[_0x2e86('0x47')]['id']}})[_0x2e86('0x24')](handleEntityNotFound(_0x1e411d,null))[_0x2e86('0x24')](removeEntity(_0x1e411d,null))[_0x2e86('0x45')](handleError(_0x1e411d,null));}; \ No newline at end of file +var _0x60dd=['index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','where','merge','VIRTUAL','filter','options','includeAll','include','MailServerOut','rows','show','params','find','create','catch','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','send'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x60dd,0xb2));var _0xd60d=function(_0x4c7d19,_0x62fc3){_0x4c7d19=_0x4c7d19-0x0;var _0x419805=_0x60dd[_0x4c7d19];return _0x419805;};'use strict';var emlformat=require(_0xd60d('0x0'));var rimraf=require(_0xd60d('0x1'));var zipdir=require(_0xd60d('0x2'));var jsonpatch=require(_0xd60d('0x3'));var rp=require('request-promise');var moment=require(_0xd60d('0x4'));var BPromise=require(_0xd60d('0x5'));var Mustache=require('mustache');var util=require(_0xd60d('0x6'));var path=require(_0xd60d('0x7'));var sox=require(_0xd60d('0x8'));var csv=require(_0xd60d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd60d('0xa'));var _=require(_0xd60d('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd60d('0xc'));var deskjs=require(_0xd60d('0xd'));var toCsv=require(_0xd60d('0x9'));var querystring=require(_0xd60d('0xe'));var Papa=require(_0xd60d('0xf'));var Redis=require(_0xd60d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd60d('0x11'));var as=require(_0xd60d('0x12'));var hardwareService=require(_0xd60d('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xd60d('0x14'));var config=require(_0xd60d('0x15'));var licenseUtil=require(_0xd60d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ca4b2,_0x441800){_0x441800=_0x441800||0xcc;return function(_0x5ea453){if(_0x5ea453){return _0x5ca4b2['sendStatus'](_0x441800);}return _0x5ca4b2['status'](_0x441800)['end']();};}function respondWithResult(_0x225dd1,_0x266cdf){_0x266cdf=_0x266cdf||0xc8;return function(_0x2fe8e6){if(_0x2fe8e6){return _0x225dd1[_0xd60d('0x17')](_0x266cdf)[_0xd60d('0x18')](_0x2fe8e6);}};}function respondWithFilteredResult(_0x4141d2,_0x33edc0){return function(_0x5f3697){if(_0x5f3697){var _0x297f25=typeof _0x33edc0[_0xd60d('0x19')]===_0xd60d('0x1a')&&typeof _0x33edc0[_0xd60d('0x1b')]==='undefined';var _0x510eb5=_0x5f3697[_0xd60d('0x1c')];var _0x3ef1fd=_0x297f25?0x0:_0x33edc0['offset'];var _0x39f835=_0x297f25?_0x5f3697[_0xd60d('0x1c')]:_0x33edc0[_0xd60d('0x19')]+_0x33edc0['limit'];var _0x1e745d;if(_0x39f835>=_0x510eb5){_0x39f835=_0x510eb5;_0x1e745d=0xc8;}else{_0x1e745d=0xce;}_0x4141d2[_0xd60d('0x17')](_0x1e745d);return _0x4141d2['set'](_0xd60d('0x1d'),_0x3ef1fd+'-'+_0x39f835+'/'+_0x510eb5)[_0xd60d('0x18')](_0x5f3697);}return null;};}function patchUpdates(_0x18eab7){return function(_0x5696ae){try{jsonpatch[_0xd60d('0x1e')](_0x5696ae,_0x18eab7,!![]);}catch(_0x12f438){return BPromise[_0xd60d('0x1f')](_0x12f438);}return _0x5696ae[_0xd60d('0x20')]();};}function saveUpdates(_0x1b7639,_0x54160e){return function(_0xc514e8){if(_0xc514e8){return _0xc514e8[_0xd60d('0x21')](_0x1b7639)[_0xd60d('0x22')](function(_0x21692f){return _0x21692f;});}return null;};}function removeEntity(_0xa746b2,_0x6b5955){return function(_0x3271f4){if(_0x3271f4){return _0x3271f4['destroy']()[_0xd60d('0x22')](function(){_0xa746b2[_0xd60d('0x17')](0xcc)[_0xd60d('0x23')]();});}};}function handleEntityNotFound(_0x2d8af8,_0x5065c2){return function(_0x16d71a){if(!_0x16d71a){_0x2d8af8[_0xd60d('0x24')](0x194);}return _0x16d71a;};}function handleError(_0x50ffea,_0x307cb0){_0x307cb0=_0x307cb0||0x1f4;return function(_0x303c16){logger[_0xd60d('0x25')](_0x303c16[_0xd60d('0x26')]);if(_0x303c16[_0xd60d('0x27')]){delete _0x303c16['name'];}_0x50ffea[_0xd60d('0x17')](_0x307cb0)[_0xd60d('0x28')](_0x303c16);};}exports[_0xd60d('0x29')]=function(_0x1dc773,_0x549da8){var _0x36b289={},_0x468387={},_0x2b857b={'count':0x0,'rows':[]};var _0x49fa24=_[_0xd60d('0x2a')](db['MailServerOut'][_0xd60d('0x2b')],function(_0x2419c5){return{'name':_0x2419c5['fieldName'],'type':_0x2419c5[_0xd60d('0x2c')]['key']};});_0x468387[_0xd60d('0x2d')]=_[_0xd60d('0x2a')](_0x49fa24,_0xd60d('0x27'));_0x468387[_0xd60d('0x2e')]=_[_0xd60d('0x2f')](_0x1dc773[_0xd60d('0x2e')]);_0x468387[_0xd60d('0x30')]=_[_0xd60d('0x31')](_0x468387[_0xd60d('0x2d')],_0x468387[_0xd60d('0x2e')]);_0x36b289[_0xd60d('0x32')]=_[_0xd60d('0x31')](_0x468387[_0xd60d('0x2d')],qs[_0xd60d('0x33')](_0x1dc773['query'][_0xd60d('0x33')]));_0x36b289[_0xd60d('0x32')]=_0x36b289['attributes'][_0xd60d('0x34')]?_0x36b289[_0xd60d('0x32')]:_0x468387['model'];if(!_0x1dc773[_0xd60d('0x2e')][_0xd60d('0x35')](_0xd60d('0x36'))){_0x36b289['limit']=qs[_0xd60d('0x1b')](_0x1dc773[_0xd60d('0x2e')][_0xd60d('0x1b')]);_0x36b289[_0xd60d('0x19')]=qs['offset'](_0x1dc773[_0xd60d('0x2e')][_0xd60d('0x19')]);}_0x36b289[_0xd60d('0x37')]=qs['sort'](_0x1dc773[_0xd60d('0x2e')]['sort']);_0x36b289['where']=qs[_0xd60d('0x30')](_[_0xd60d('0x38')](_0x1dc773['query'],_0x468387[_0xd60d('0x30')]),_0x49fa24);if(_0x1dc773[_0xd60d('0x2e')]['filter']){_0x36b289[_0xd60d('0x39')]=_[_0xd60d('0x3a')](_0x36b289[_0xd60d('0x39')],{'$or':_[_0xd60d('0x2a')](_0x49fa24,function(_0x385fcc){if(_0x385fcc[_0xd60d('0x2c')]!==_0xd60d('0x3b')){var _0x2b14a4={};_0x2b14a4[_0x385fcc[_0xd60d('0x27')]]={'$like':'%'+_0x1dc773[_0xd60d('0x2e')][_0xd60d('0x3c')]+'%'};return _0x2b14a4;}})});}_0x36b289=_[_0xd60d('0x3a')]({},_0x36b289,_0x1dc773[_0xd60d('0x3d')]);var _0x4ffb44={'where':_0x36b289[_0xd60d('0x39')]};return db['MailServerOut'][_0xd60d('0x1c')](_0x4ffb44)[_0xd60d('0x22')](function(_0x4d74d6){_0x2b857b[_0xd60d('0x1c')]=_0x4d74d6;if(_0x1dc773['query'][_0xd60d('0x3e')]){_0x36b289[_0xd60d('0x3f')]=[{'all':!![]}];}return db[_0xd60d('0x40')]['findAll'](_0x36b289);})[_0xd60d('0x22')](function(_0x4a2dfe){_0x2b857b[_0xd60d('0x41')]=_0x4a2dfe;return _0x2b857b;})[_0xd60d('0x22')](respondWithFilteredResult(_0x549da8,_0x36b289))['catch'](handleError(_0x549da8,null));};exports[_0xd60d('0x42')]=function(_0x3fcc5b,_0x217223){var _0x60a624={'raw':!![],'where':{'id':_0x3fcc5b[_0xd60d('0x43')]['id']}},_0x59f08a={};_0x59f08a[_0xd60d('0x2d')]=_[_0xd60d('0x2f')](db[_0xd60d('0x40')][_0xd60d('0x2b')]);_0x59f08a[_0xd60d('0x2e')]=_[_0xd60d('0x2f')](_0x3fcc5b[_0xd60d('0x2e')]);_0x59f08a[_0xd60d('0x30')]=_['intersection'](_0x59f08a[_0xd60d('0x2d')],_0x59f08a['query']);_0x60a624[_0xd60d('0x32')]=_['intersection'](_0x59f08a['model'],qs[_0xd60d('0x33')](_0x3fcc5b[_0xd60d('0x2e')]['fields']));_0x60a624[_0xd60d('0x32')]=_0x60a624[_0xd60d('0x32')][_0xd60d('0x34')]?_0x60a624[_0xd60d('0x32')]:_0x59f08a[_0xd60d('0x2d')];if(_0x3fcc5b[_0xd60d('0x2e')]['includeAll']){_0x60a624['include']=[{'all':!![]}];}_0x60a624=_[_0xd60d('0x3a')]({},_0x60a624,_0x3fcc5b['options']);return db[_0xd60d('0x40')][_0xd60d('0x44')](_0x60a624)[_0xd60d('0x22')](handleEntityNotFound(_0x217223,null))[_0xd60d('0x22')](respondWithResult(_0x217223,null))['catch'](handleError(_0x217223,null));};exports[_0xd60d('0x45')]=function(_0x1ab2d2,_0x559d9f){return db[_0xd60d('0x40')][_0xd60d('0x45')](_0x1ab2d2['body'],{})[_0xd60d('0x22')](respondWithResult(_0x559d9f,0xc9))[_0xd60d('0x46')](handleError(_0x559d9f,null));};exports[_0xd60d('0x21')]=function(_0x3e69cc,_0x9a5b8){if(_0x3e69cc[_0xd60d('0x47')]['id']){delete _0x3e69cc[_0xd60d('0x47')]['id'];}return db[_0xd60d('0x40')][_0xd60d('0x44')]({'where':{'id':_0x3e69cc[_0xd60d('0x43')]['id']}})[_0xd60d('0x22')](handleEntityNotFound(_0x9a5b8,null))[_0xd60d('0x22')](saveUpdates(_0x3e69cc[_0xd60d('0x47')],null))[_0xd60d('0x22')](respondWithResult(_0x9a5b8,null))[_0xd60d('0x46')](handleError(_0x9a5b8,null));};exports[_0xd60d('0x48')]=function(_0x58ce09,_0x176cae){return db[_0xd60d('0x40')][_0xd60d('0x44')]({'where':{'id':_0x58ce09[_0xd60d('0x43')]['id']}})[_0xd60d('0x22')](handleEntityNotFound(_0x176cae,null))[_0xd60d('0x22')](removeEntity(_0x176cae,null))['catch'](handleError(_0x176cae,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 5d6b0c2..f2e4ec6 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 _0xafa5=['request-promise','path','./mailServerOut.attributes','exports','lodash','bluebird'];(function(_0x1e5719,_0x43d07e){var _0x5814c3=function(_0x552adc){while(--_0x552adc){_0x1e5719['push'](_0x1e5719['shift']());}};_0x5814c3(++_0x43d07e);}(_0xafa5,0x12a));var _0x5afa=function(_0x12bf08,_0x14a77a){_0x12bf08=_0x12bf08-0x0;var _0x97fc3b=_0xafa5[_0x12bf08];return _0x97fc3b;};'use strict';var _=require(_0x5afa('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x5afa('0x1'));var rp=require(_0x5afa('0x2'));var fs=require('fs');var path=require(_0x5afa('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5afa('0x4'));module[_0x5afa('0x5')]=function(_0x4a3b78,_0x3fd985){return _0x4a3b78['define']('MailServerOut',attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d02=['bluebird','request-promise','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','util','api','moment'];(function(_0x296737,_0x19c7dd){var _0x3726d2=function(_0x7d75b7){while(--_0x7d75b7){_0x296737['push'](_0x296737['shift']());}};_0x3726d2(++_0x19c7dd);}(_0x3d02,0x1b5));var _0x23d0=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x3d02[_0x4b7895];return _0x264180;};'use strict';var _=require('lodash');var util=require(_0x23d0('0x0'));var logger=require('../../config/logger')(_0x23d0('0x1'));var moment=require(_0x23d0('0x2'));var BPromise=require(_0x23d0('0x3'));var rp=require(_0x23d0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x23d0('0x5'));var attributes=require(_0x23d0('0x6'));module[_0x23d0('0x7')]=function(_0x40f247,_0x364807){return _0x40f247[_0x23d0('0x8')](_0x23d0('0x9'),attributes,{'tableName':_0x23d0('0xa'),'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 4624b5c..30dfa1e 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x16a6c2,_0x269dfd){var _0x127baa=function(_0x2d716a){while(--_0x2d716a){_0x16a6c2['push'](_0x16a6c2['shift']());}};_0x127baa(++_0x269dfd);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xc4aa[_0x1b2ff7];return _0x31656a;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x7bfeef,_0xbfc5c7){var _0x224408=function(_0x54b35c){while(--_0x54b35c){_0x7bfeef['push'](_0x7bfeef['shift']());}};_0x224408(++_0xbfc5c7);}(_0x5f2f,0x73));var _0xf5f2=function(_0x28a744,_0x13f9fe){_0x28a744=_0x28a744-0x0;var _0x303542=_0x5f2f[_0x28a744];return _0x303542;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 91c2197..480d088 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 _0x17f1=['Router','../../components/auth/service','../../config/environment','./mailSubstatus.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x68efe8,_0x11257e){var _0x1b23d2=function(_0x127a19){while(--_0x127a19){_0x68efe8['push'](_0x68efe8['shift']());}};_0x1b23d2(++_0x11257e);}(_0x17f1,0xb1));var _0x117f=function(_0x3c120e,_0x5094e9){_0x3c120e=_0x3c120e-0x0;var _0x21d514=_0x17f1[_0x3c120e];return _0x21d514;};'use strict';var multer=require(_0x117f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x117f('0x1'));var express=require(_0x117f('0x2'));var router=express[_0x117f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x117f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x117f('0x5'));var controller=require(_0x117f('0x6'));router[_0x117f('0x7')]('/',auth['isAuthenticated'](),controller[_0x117f('0x8')]);router[_0x117f('0x7')](_0x117f('0x9'),auth[_0x117f('0xa')](),controller[_0x117f('0xb')]);router['get'](_0x117f('0xc'),auth[_0x117f('0xa')](),controller[_0x117f('0xd')]);router['post']('/',auth[_0x117f('0xa')](),controller[_0x117f('0xe')]);router[_0x117f('0xf')]('/:id',auth[_0x117f('0xa')](),controller[_0x117f('0x10')]);router[_0x117f('0x11')](_0x117f('0xc'),auth[_0x117f('0xa')](),controller[_0x117f('0x12')]);module[_0x117f('0x13')]=router; \ No newline at end of file +var _0xed0a=['show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','isAuthenticated','index','/describe','/:id'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xed0a,0xf7));var _0xaed0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xed0a[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xaed0('0x0'));var util=require('util');var path=require(_0xaed0('0x1'));var timeout=require(_0xaed0('0x2'));var express=require(_0xaed0('0x3'));var router=express[_0xaed0('0x4')]();var fs_extra=require(_0xaed0('0x5'));var auth=require(_0xaed0('0x6'));var interaction=require(_0xaed0('0x7'));var config=require('../../config/environment');var controller=require(_0xaed0('0x8'));router['get']('/',auth[_0xaed0('0x9')](),controller[_0xaed0('0xa')]);router['get'](_0xaed0('0xb'),auth[_0xaed0('0x9')](),controller['describe']);router['get'](_0xaed0('0xc'),auth[_0xaed0('0x9')](),controller[_0xaed0('0xd')]);router[_0xaed0('0xe')]('/',auth[_0xaed0('0x9')](),controller[_0xaed0('0xf')]);router[_0xaed0('0x10')](_0xaed0('0xc'),auth[_0xaed0('0x9')](),controller[_0xaed0('0x11')]);router[_0xaed0('0x12')]('/:id',auth[_0xaed0('0x9')](),controller[_0xaed0('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index ecc17ab..80c6b0f 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 _0x446c=['STRING','name','sequelize','exports'];(function(_0x5c56e5,_0x4f54ae){var _0x55c91c=function(_0x587c35){while(--_0x587c35){_0x5c56e5['push'](_0x5c56e5['shift']());}};_0x55c91c(++_0x4f54ae);}(_0x446c,0x156));var _0xc446=function(_0x7a112,_0x2eb4a0){_0x7a112=_0x7a112-0x0;var _0x136dc5=_0x446c[_0x7a112];return _0x136dc5;};'use strict';var Sequelize=require(_0xc446('0x0'));module[_0xc446('0x1')]={'name':{'type':Sequelize[_0xc446('0x2')],'unique':_0xc446('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6b8f=['exports','name'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x42dbaa,_0x453e21){_0x42dbaa=_0x42dbaa-0x0;var _0x5c3a06=_0x6b8f[_0x42dbaa];return _0x5c3a06;};'use strict';var Sequelize=require('sequelize');module[_0xf6b8('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xf6b8('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 162b918..47b11f4 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 _0xf492=['body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','apply','reject','save','then','destroy','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','rows','catch','options','find','create','update'];(function(_0x45185e,_0x53a203){var _0x1b904c=function(_0x321cfc){while(--_0x321cfc){_0x45185e['push'](_0x45185e['shift']());}};_0x1b904c(++_0x53a203);}(_0xf492,0x189));var _0x2f49=function(_0x4aa09e,_0x2f3920){_0x4aa09e=_0x4aa09e-0x0;var _0x6195b3=_0xf492[_0x4aa09e];return _0x6195b3;};'use strict';var emlformat=require(_0x2f49('0x0'));var rimraf=require(_0x2f49('0x1'));var zipdir=require(_0x2f49('0x2'));var jsonpatch=require(_0x2f49('0x3'));var rp=require('request-promise');var moment=require(_0x2f49('0x4'));var BPromise=require(_0x2f49('0x5'));var Mustache=require(_0x2f49('0x6'));var util=require(_0x2f49('0x7'));var path=require('path');var sox=require(_0x2f49('0x8'));var csv=require(_0x2f49('0x9'));var ejs=require(_0x2f49('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f49('0xb'));var squel=require('squel');var crypto=require(_0x2f49('0xc'));var jsforce=require(_0x2f49('0xd'));var deskjs=require(_0x2f49('0xe'));var toCsv=require(_0x2f49('0x9'));var querystring=require(_0x2f49('0xf'));var Papa=require(_0x2f49('0x10'));var Redis=require(_0x2f49('0x11'));var authService=require(_0x2f49('0x12'));var qs=require(_0x2f49('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f49('0x14'))(_0x2f49('0x15'));var utils=require(_0x2f49('0x16'));var config=require(_0x2f49('0x17'));var licenseUtil=require(_0x2f49('0x18'));var db=require(_0x2f49('0x19'))['db'];function respondWithStatusCode(_0x585b70,_0x4fed38){_0x4fed38=_0x4fed38||0xcc;return function(_0x5490ab){if(_0x5490ab){return _0x585b70[_0x2f49('0x1a')](_0x4fed38);}return _0x585b70[_0x2f49('0x1b')](_0x4fed38)[_0x2f49('0x1c')]();};}function respondWithResult(_0x5695f3,_0x314853){_0x314853=_0x314853||0xc8;return function(_0x261a2c){if(_0x261a2c){return _0x5695f3['status'](_0x314853)['json'](_0x261a2c);}};}function respondWithFilteredResult(_0x39ce19,_0x1daeba){return function(_0x30d1af){if(_0x30d1af){var _0x155588=typeof _0x1daeba[_0x2f49('0x1d')]===_0x2f49('0x1e')&&typeof _0x1daeba['limit']==='undefined';var _0x14749d=_0x30d1af['count'];var _0x493120=_0x155588?0x0:_0x1daeba['offset'];var _0x3d9ab1=_0x155588?_0x30d1af[_0x2f49('0x1f')]:_0x1daeba['offset']+_0x1daeba[_0x2f49('0x20')];var _0x3afa9a;if(_0x3d9ab1>=_0x14749d){_0x3d9ab1=_0x14749d;_0x3afa9a=0xc8;}else{_0x3afa9a=0xce;}_0x39ce19[_0x2f49('0x1b')](_0x3afa9a);return _0x39ce19[_0x2f49('0x21')]('Content-Range',_0x493120+'-'+_0x3d9ab1+'/'+_0x14749d)['json'](_0x30d1af);}return null;};}function patchUpdates(_0x416927){return function(_0x1d5c94){try{jsonpatch[_0x2f49('0x22')](_0x1d5c94,_0x416927,!![]);}catch(_0x54aab7){return BPromise[_0x2f49('0x23')](_0x54aab7);}return _0x1d5c94[_0x2f49('0x24')]();};}function saveUpdates(_0x5b9a0c,_0x3a3525){return function(_0x4dc80a){if(_0x4dc80a){return _0x4dc80a['update'](_0x5b9a0c)[_0x2f49('0x25')](function(_0x5d7bee){return _0x5d7bee;});}return null;};}function removeEntity(_0x1ee337,_0x9a7bf0){return function(_0x3cd995){if(_0x3cd995){return _0x3cd995[_0x2f49('0x26')]()[_0x2f49('0x25')](function(){_0x1ee337[_0x2f49('0x1b')](0xcc)[_0x2f49('0x1c')]();});}};}function handleEntityNotFound(_0x5c1a88,_0x2ab490){return function(_0x22d9c2){if(!_0x22d9c2){_0x5c1a88[_0x2f49('0x1a')](0x194);}return _0x22d9c2;};}function handleError(_0x233bad,_0xc8543d){_0xc8543d=_0xc8543d||0x1f4;return function(_0x19351e){logger[_0x2f49('0x27')](_0x19351e[_0x2f49('0x28')]);if(_0x19351e['name']){delete _0x19351e[_0x2f49('0x29')];}_0x233bad[_0x2f49('0x1b')](_0xc8543d)[_0x2f49('0x2a')](_0x19351e);};}exports[_0x2f49('0x2b')]=function(_0x5eb1d9,_0x2692a0){var _0x45cb44={},_0x4cf19e={},_0x4ba4ad={'count':0x0,'rows':[]};var _0x4a0951=_[_0x2f49('0x2c')](db[_0x2f49('0x2d')][_0x2f49('0x2e')],function(_0x5a1592){return{'name':_0x5a1592[_0x2f49('0x2f')],'type':_0x5a1592[_0x2f49('0x30')][_0x2f49('0x31')]};});_0x4cf19e[_0x2f49('0x32')]=_[_0x2f49('0x2c')](_0x4a0951,'name');_0x4cf19e[_0x2f49('0x33')]=_[_0x2f49('0x34')](_0x5eb1d9[_0x2f49('0x33')]);_0x4cf19e[_0x2f49('0x35')]=_[_0x2f49('0x36')](_0x4cf19e[_0x2f49('0x32')],_0x4cf19e[_0x2f49('0x33')]);_0x45cb44[_0x2f49('0x37')]=_[_0x2f49('0x36')](_0x4cf19e['model'],qs[_0x2f49('0x38')](_0x5eb1d9[_0x2f49('0x33')]['fields']));_0x45cb44[_0x2f49('0x37')]=_0x45cb44[_0x2f49('0x37')][_0x2f49('0x39')]?_0x45cb44[_0x2f49('0x37')]:_0x4cf19e['model'];if(!_0x5eb1d9[_0x2f49('0x33')][_0x2f49('0x3a')](_0x2f49('0x3b'))){_0x45cb44[_0x2f49('0x20')]=qs['limit'](_0x5eb1d9[_0x2f49('0x33')][_0x2f49('0x20')]);_0x45cb44[_0x2f49('0x1d')]=qs[_0x2f49('0x1d')](_0x5eb1d9[_0x2f49('0x33')][_0x2f49('0x1d')]);}_0x45cb44[_0x2f49('0x3c')]=qs[_0x2f49('0x3d')](_0x5eb1d9[_0x2f49('0x33')][_0x2f49('0x3d')]);_0x45cb44[_0x2f49('0x3e')]=qs[_0x2f49('0x35')](_[_0x2f49('0x3f')](_0x5eb1d9[_0x2f49('0x33')],_0x4cf19e[_0x2f49('0x35')]),_0x4a0951);if(_0x5eb1d9[_0x2f49('0x33')]['filter']){_0x45cb44[_0x2f49('0x3e')]=_[_0x2f49('0x40')](_0x45cb44[_0x2f49('0x3e')],{'$or':_[_0x2f49('0x2c')](_0x4a0951,function(_0x1ed391){if(_0x1ed391['type']!=='VIRTUAL'){var _0x23b77d={};_0x23b77d[_0x1ed391[_0x2f49('0x29')]]={'$like':'%'+_0x5eb1d9[_0x2f49('0x33')][_0x2f49('0x41')]+'%'};return _0x23b77d;}})});}_0x45cb44=_['merge']({},_0x45cb44,_0x5eb1d9['options']);var _0x18716f={'where':_0x45cb44[_0x2f49('0x3e')]};return db[_0x2f49('0x2d')][_0x2f49('0x1f')](_0x18716f)['then'](function(_0xe5e74d){_0x4ba4ad[_0x2f49('0x1f')]=_0xe5e74d;if(_0x5eb1d9[_0x2f49('0x33')][_0x2f49('0x42')]){_0x45cb44[_0x2f49('0x43')]=[{'all':!![]}];}return db['MailSubstatus'][_0x2f49('0x44')](_0x45cb44);})[_0x2f49('0x25')](function(_0x192045){_0x4ba4ad[_0x2f49('0x45')]=_0x192045;return _0x4ba4ad;})[_0x2f49('0x25')](respondWithFilteredResult(_0x2692a0,_0x45cb44))[_0x2f49('0x46')](handleError(_0x2692a0,null));};exports['show']=function(_0x526576,_0x3a8f13){var _0x488054={'raw':!![],'where':{'id':_0x526576['params']['id']}},_0x2b4553={};_0x2b4553[_0x2f49('0x32')]=_[_0x2f49('0x34')](db[_0x2f49('0x2d')][_0x2f49('0x2e')]);_0x2b4553['query']=_[_0x2f49('0x34')](_0x526576[_0x2f49('0x33')]);_0x2b4553['filters']=_[_0x2f49('0x36')](_0x2b4553[_0x2f49('0x32')],_0x2b4553[_0x2f49('0x33')]);_0x488054[_0x2f49('0x37')]=_[_0x2f49('0x36')](_0x2b4553[_0x2f49('0x32')],qs[_0x2f49('0x38')](_0x526576[_0x2f49('0x33')][_0x2f49('0x38')]));_0x488054[_0x2f49('0x37')]=_0x488054['attributes']['length']?_0x488054[_0x2f49('0x37')]:_0x2b4553[_0x2f49('0x32')];if(_0x526576[_0x2f49('0x33')]['includeAll']){_0x488054[_0x2f49('0x43')]=[{'all':!![]}];}_0x488054=_['merge']({},_0x488054,_0x526576[_0x2f49('0x47')]);return db['MailSubstatus'][_0x2f49('0x48')](_0x488054)[_0x2f49('0x25')](handleEntityNotFound(_0x3a8f13,null))[_0x2f49('0x25')](respondWithResult(_0x3a8f13,null))[_0x2f49('0x46')](handleError(_0x3a8f13,null));};exports[_0x2f49('0x49')]=function(_0x14da30,_0x40b3df){return db['MailSubstatus']['create'](_0x14da30['body'],{})[_0x2f49('0x25')](respondWithResult(_0x40b3df,0xc9))[_0x2f49('0x46')](handleError(_0x40b3df,null));};exports[_0x2f49('0x4a')]=function(_0xe6629b,_0x3a8926){if(_0xe6629b['body']['id']){delete _0xe6629b[_0x2f49('0x4b')]['id'];}return db[_0x2f49('0x2d')]['find']({'where':{'id':_0xe6629b[_0x2f49('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3a8926,null))[_0x2f49('0x25')](saveUpdates(_0xe6629b[_0x2f49('0x4b')],null))['then'](respondWithResult(_0x3a8926,null))[_0x2f49('0x46')](handleError(_0x3a8926,null));};exports[_0x2f49('0x26')]=function(_0x339447,_0x2eb65a){return db[_0x2f49('0x2d')][_0x2f49('0x48')]({'where':{'id':_0x339447['params']['id']}})[_0x2f49('0x25')](handleEntityNotFound(_0x2eb65a,null))[_0x2f49('0x25')](removeEntity(_0x2eb65a,null))['catch'](handleError(_0x2eb65a,null));};exports[_0x2f49('0x4d')]=function(_0x4f9f26,_0x839f51){return db[_0x2f49('0x2d')][_0x2f49('0x4d')]()[_0x2f49('0x25')](respondWithResult(_0x839f51,null))['catch'](handleError(_0x839f51,null));}; \ No newline at end of file +var _0x8b1b=['Content-Range','reject','save','update','destroy','then','end','error','stack','send','index','map','rawAttributes','fieldName','type','name','keys','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','options','MailSubstatus','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','count','offset','limit'];(function(_0x3f9adb,_0x4ac876){var _0x4f0604=function(_0x3dbf33){while(--_0x3dbf33){_0x3f9adb['push'](_0x3f9adb['shift']());}};_0x4f0604(++_0x4ac876);}(_0x8b1b,0x19c));var _0xb8b1=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x8b1b[_0x2064e5];return _0x21a233;};'use strict';var emlformat=require(_0xb8b1('0x0'));var rimraf=require(_0xb8b1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb8b1('0x2'));var rp=require(_0xb8b1('0x3'));var moment=require(_0xb8b1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb8b1('0x5'));var util=require(_0xb8b1('0x6'));var path=require(_0xb8b1('0x7'));var sox=require('sox');var csv=require(_0xb8b1('0x8'));var ejs=require(_0xb8b1('0x9'));var fs=require('fs');var fs_extra=require(_0xb8b1('0xa'));var _=require(_0xb8b1('0xb'));var squel=require(_0xb8b1('0xc'));var crypto=require('crypto');var jsforce=require(_0xb8b1('0xd'));var deskjs=require(_0xb8b1('0xe'));var toCsv=require(_0xb8b1('0x8'));var querystring=require(_0xb8b1('0xf'));var Papa=require(_0xb8b1('0x10'));var Redis=require(_0xb8b1('0x11'));var authService=require(_0xb8b1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb8b1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb8b1('0x14'))(_0xb8b1('0x15'));var utils=require(_0xb8b1('0x16'));var config=require(_0xb8b1('0x17'));var licenseUtil=require(_0xb8b1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f9856,_0x938065){_0x938065=_0x938065||0xcc;return function(_0x3b0e0d){if(_0x3b0e0d){return _0x1f9856[_0xb8b1('0x19')](_0x938065);}return _0x1f9856[_0xb8b1('0x1a')](_0x938065)['end']();};}function respondWithResult(_0x33e4be,_0x387e42){_0x387e42=_0x387e42||0xc8;return function(_0x2ab124){if(_0x2ab124){return _0x33e4be[_0xb8b1('0x1a')](_0x387e42)[_0xb8b1('0x1b')](_0x2ab124);}};}function respondWithFilteredResult(_0x3ecc52,_0x5deb22){return function(_0x3986b4){if(_0x3986b4){var _0x5039e5=typeof _0x5deb22['offset']===_0xb8b1('0x1c')&&typeof _0x5deb22['limit']===_0xb8b1('0x1c');var _0x20ec7f=_0x3986b4[_0xb8b1('0x1d')];var _0x48e877=_0x5039e5?0x0:_0x5deb22['offset'];var _0x2d4e1c=_0x5039e5?_0x3986b4['count']:_0x5deb22[_0xb8b1('0x1e')]+_0x5deb22[_0xb8b1('0x1f')];var _0x1f81d0;if(_0x2d4e1c>=_0x20ec7f){_0x2d4e1c=_0x20ec7f;_0x1f81d0=0xc8;}else{_0x1f81d0=0xce;}_0x3ecc52[_0xb8b1('0x1a')](_0x1f81d0);return _0x3ecc52['set'](_0xb8b1('0x20'),_0x48e877+'-'+_0x2d4e1c+'/'+_0x20ec7f)[_0xb8b1('0x1b')](_0x3986b4);}return null;};}function patchUpdates(_0x2ebd65){return function(_0x35b038){try{jsonpatch['apply'](_0x35b038,_0x2ebd65,!![]);}catch(_0x58fba2){return BPromise[_0xb8b1('0x21')](_0x58fba2);}return _0x35b038[_0xb8b1('0x22')]();};}function saveUpdates(_0x4e8bbd,_0x4093b2){return function(_0x29258c){if(_0x29258c){return _0x29258c[_0xb8b1('0x23')](_0x4e8bbd)['then'](function(_0x30b33f){return _0x30b33f;});}return null;};}function removeEntity(_0x5b1541,_0x945c89){return function(_0x29df37){if(_0x29df37){return _0x29df37[_0xb8b1('0x24')]()[_0xb8b1('0x25')](function(){_0x5b1541[_0xb8b1('0x1a')](0xcc)[_0xb8b1('0x26')]();});}};}function handleEntityNotFound(_0x3f7983,_0x1c1e5f){return function(_0x499410){if(!_0x499410){_0x3f7983[_0xb8b1('0x19')](0x194);}return _0x499410;};}function handleError(_0x3d58c9,_0x56c75e){_0x56c75e=_0x56c75e||0x1f4;return function(_0x5a9708){logger[_0xb8b1('0x27')](_0x5a9708[_0xb8b1('0x28')]);if(_0x5a9708['name']){delete _0x5a9708['name'];}_0x3d58c9[_0xb8b1('0x1a')](_0x56c75e)[_0xb8b1('0x29')](_0x5a9708);};}exports[_0xb8b1('0x2a')]=function(_0x507652,_0x2238c6){var _0x1635e4={},_0x55f5d1={},_0x3cfb8b={'count':0x0,'rows':[]};var _0xfc4f26=_[_0xb8b1('0x2b')](db['MailSubstatus'][_0xb8b1('0x2c')],function(_0x22579e){return{'name':_0x22579e[_0xb8b1('0x2d')],'type':_0x22579e[_0xb8b1('0x2e')]['key']};});_0x55f5d1['model']=_[_0xb8b1('0x2b')](_0xfc4f26,_0xb8b1('0x2f'));_0x55f5d1['query']=_[_0xb8b1('0x30')](_0x507652['query']);_0x55f5d1['filters']=_['intersection'](_0x55f5d1[_0xb8b1('0x31')],_0x55f5d1[_0xb8b1('0x32')]);_0x1635e4['attributes']=_[_0xb8b1('0x33')](_0x55f5d1['model'],qs[_0xb8b1('0x34')](_0x507652[_0xb8b1('0x32')][_0xb8b1('0x34')]));_0x1635e4[_0xb8b1('0x35')]=_0x1635e4[_0xb8b1('0x35')][_0xb8b1('0x36')]?_0x1635e4[_0xb8b1('0x35')]:_0x55f5d1['model'];if(!_0x507652[_0xb8b1('0x32')][_0xb8b1('0x37')]('nolimit')){_0x1635e4[_0xb8b1('0x1f')]=qs[_0xb8b1('0x1f')](_0x507652[_0xb8b1('0x32')]['limit']);_0x1635e4[_0xb8b1('0x1e')]=qs[_0xb8b1('0x1e')](_0x507652[_0xb8b1('0x32')]['offset']);}_0x1635e4[_0xb8b1('0x38')]=qs['sort'](_0x507652[_0xb8b1('0x32')][_0xb8b1('0x39')]);_0x1635e4[_0xb8b1('0x3a')]=qs[_0xb8b1('0x3b')](_['pick'](_0x507652[_0xb8b1('0x32')],_0x55f5d1[_0xb8b1('0x3b')]),_0xfc4f26);if(_0x507652[_0xb8b1('0x32')][_0xb8b1('0x3c')]){_0x1635e4[_0xb8b1('0x3a')]=_[_0xb8b1('0x3d')](_0x1635e4['where'],{'$or':_[_0xb8b1('0x2b')](_0xfc4f26,function(_0x58ec5e){if(_0x58ec5e['type']!=='VIRTUAL'){var _0x1cce2e={};_0x1cce2e[_0x58ec5e['name']]={'$like':'%'+_0x507652[_0xb8b1('0x32')][_0xb8b1('0x3c')]+'%'};return _0x1cce2e;}})});}_0x1635e4=_[_0xb8b1('0x3d')]({},_0x1635e4,_0x507652[_0xb8b1('0x3e')]);var _0x52c0ad={'where':_0x1635e4[_0xb8b1('0x3a')]};return db[_0xb8b1('0x3f')][_0xb8b1('0x1d')](_0x52c0ad)[_0xb8b1('0x25')](function(_0x5d2ca1){_0x3cfb8b['count']=_0x5d2ca1;if(_0x507652['query'][_0xb8b1('0x40')]){_0x1635e4[_0xb8b1('0x41')]=[{'all':!![]}];}return db['MailSubstatus'][_0xb8b1('0x42')](_0x1635e4);})[_0xb8b1('0x25')](function(_0x2c0df6){_0x3cfb8b[_0xb8b1('0x43')]=_0x2c0df6;return _0x3cfb8b;})['then'](respondWithFilteredResult(_0x2238c6,_0x1635e4))[_0xb8b1('0x44')](handleError(_0x2238c6,null));};exports['show']=function(_0x2b63e2,_0x36d27a){var _0x1971ee={'raw':!![],'where':{'id':_0x2b63e2[_0xb8b1('0x45')]['id']}},_0x11f887={};_0x11f887['model']=_[_0xb8b1('0x30')](db['MailSubstatus']['rawAttributes']);_0x11f887[_0xb8b1('0x32')]=_[_0xb8b1('0x30')](_0x2b63e2[_0xb8b1('0x32')]);_0x11f887[_0xb8b1('0x3b')]=_[_0xb8b1('0x33')](_0x11f887['model'],_0x11f887['query']);_0x1971ee['attributes']=_[_0xb8b1('0x33')](_0x11f887[_0xb8b1('0x31')],qs[_0xb8b1('0x34')](_0x2b63e2[_0xb8b1('0x32')][_0xb8b1('0x34')]));_0x1971ee[_0xb8b1('0x35')]=_0x1971ee[_0xb8b1('0x35')][_0xb8b1('0x36')]?_0x1971ee[_0xb8b1('0x35')]:_0x11f887[_0xb8b1('0x31')];if(_0x2b63e2[_0xb8b1('0x32')][_0xb8b1('0x40')]){_0x1971ee['include']=[{'all':!![]}];}_0x1971ee=_[_0xb8b1('0x3d')]({},_0x1971ee,_0x2b63e2[_0xb8b1('0x3e')]);return db['MailSubstatus'][_0xb8b1('0x46')](_0x1971ee)[_0xb8b1('0x25')](handleEntityNotFound(_0x36d27a,null))[_0xb8b1('0x25')](respondWithResult(_0x36d27a,null))[_0xb8b1('0x44')](handleError(_0x36d27a,null));};exports[_0xb8b1('0x47')]=function(_0x484a99,_0x50b698){return db['MailSubstatus']['create'](_0x484a99['body'],{})[_0xb8b1('0x25')](respondWithResult(_0x50b698,0xc9))['catch'](handleError(_0x50b698,null));};exports[_0xb8b1('0x23')]=function(_0x42219b,_0x56d5ba){if(_0x42219b[_0xb8b1('0x48')]['id']){delete _0x42219b[_0xb8b1('0x48')]['id'];}return db['MailSubstatus'][_0xb8b1('0x46')]({'where':{'id':_0x42219b[_0xb8b1('0x45')]['id']}})[_0xb8b1('0x25')](handleEntityNotFound(_0x56d5ba,null))[_0xb8b1('0x25')](saveUpdates(_0x42219b['body'],null))[_0xb8b1('0x25')](respondWithResult(_0x56d5ba,null))[_0xb8b1('0x44')](handleError(_0x56d5ba,null));};exports[_0xb8b1('0x24')]=function(_0x27abe5,_0x59f64b){return db[_0xb8b1('0x3f')][_0xb8b1('0x46')]({'where':{'id':_0x27abe5[_0xb8b1('0x45')]['id']}})[_0xb8b1('0x25')](handleEntityNotFound(_0x59f64b,null))['then'](removeEntity(_0x59f64b,null))['catch'](handleError(_0x59f64b,null));};exports[_0xb8b1('0x49')]=function(_0x59c1ad,_0x367d3c){return db[_0xb8b1('0x3f')][_0xb8b1('0x49')]()[_0xb8b1('0x25')](respondWithResult(_0x367d3c,null))[_0xb8b1('0x44')](handleError(_0x367d3c,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 1e70347..e6e6d7a 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 _0xd69c=['setMaxListeners','update','emit','hasOwnProperty','exports','events','../../mysqldb','MailSubstatus'];(function(_0x16a7d8,_0x326d5c){var _0xa4b589=function(_0x17add5){while(--_0x17add5){_0x16a7d8['push'](_0x16a7d8['shift']());}};_0xa4b589(++_0x326d5c);}(_0xd69c,0x135));var _0xcd69=function(_0x3d9d2d,_0x5c09b8){_0x3d9d2d=_0x3d9d2d-0x0;var _0x5abd55=_0xd69c[_0x3d9d2d];return _0x5abd55;};'use strict';var EventEmitter=require(_0xcd69('0x0'));var MailSubstatus=require(_0xcd69('0x1'))['db'][_0xcd69('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xcd69('0x3')](0x0);var events={'afterUpdate':_0xcd69('0x4')};function emitEvent(_0x567016){return function(_0x215e27,_0x5d064f,_0x217d57){MailSubstatusEvents[_0xcd69('0x5')](_0x567016+':'+_0x215e27['id'],_0x215e27);MailSubstatusEvents[_0xcd69('0x5')](_0x567016,_0x215e27);_0x217d57(null);};}for(var e in events){if(events[_0xcd69('0x6')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0xcd69('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0x67cb=['setMaxListeners','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x53b3ed,_0xaac33e){var _0x24e1f7=function(_0x560591){while(--_0x560591){_0x53b3ed['push'](_0x53b3ed['shift']());}};_0x24e1f7(++_0xaac33e);}(_0x67cb,0x15c));var _0xb67c=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x67cb[_0x26462c];return _0x509a42;};'use strict';var EventEmitter=require(_0xb67c('0x0'));var MailSubstatus=require(_0xb67c('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xb67c('0x2')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x1f11c9){return function(_0x20748e,_0x3decfd,_0xc4c47f){MailSubstatusEvents[_0xb67c('0x3')](_0x1f11c9+':'+_0x20748e['id'],_0x20748e);MailSubstatusEvents[_0xb67c('0x3')](_0x1f11c9,_0x20748e);_0xc4c47f(null);};}for(var e in events){if(events[_0xb67c('0x4')](e)){var event=events[e];MailSubstatus[_0xb67c('0x5')](e,emitEvent(event));}}module[_0xb67c('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 641b01c..2ecf30a 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 _0x5eee=['then','catch','./mailSubstatus.attributes','exports','models','MailSubstatus','mail_substatuses','update','name','mailSubstatus','_previousDataValues'];(function(_0x2298f0,_0x3bbf4f){var _0x39b136=function(_0xc2cd6e){while(--_0xc2cd6e){_0x2298f0['push'](_0x2298f0['shift']());}};_0x39b136(++_0x3bbf4f);}(_0x5eee,0xb2));var _0xe5ee=function(_0x456c33,_0x29437b){_0x456c33=_0x456c33-0x0;var _0x53169d=_0x5eee[_0x456c33];return _0x53169d;};'use strict';var attributes=require(_0xe5ee('0x0'));module[_0xe5ee('0x1')]=function(_0x555fef){var _0x381ea1=_0x555fef[_0xe5ee('0x2')];return _0x555fef['define'](_0xe5ee('0x3'),attributes,{'tableName':_0xe5ee('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x3930f5,_0x5e2a6b,_0x1d174a){return _0x381ea1['Condition'][_0xe5ee('0x5')]({'value':_0x3930f5[_0xe5ee('0x6')]},{'where':{'field':_0xe5ee('0x7'),'value':_0x3930f5[_0xe5ee('0x8')][_0xe5ee('0x6')]}})[_0xe5ee('0x9')](function(){_0x1d174a();})[_0xe5ee('0xa')](function(_0x2064e7){_0x1d174a(_0x2064e7);});}}});}; \ No newline at end of file +var _0xaf67=['update','mailSubstatus','_previousDataValues','then','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses','Condition'];(function(_0x4dab14,_0x4bdfb5){var _0x371600=function(_0x25dd9e){while(--_0x25dd9e){_0x4dab14['push'](_0x4dab14['shift']());}};_0x371600(++_0x4bdfb5);}(_0xaf67,0x16f));var _0x7af6=function(_0x4cd3ef,_0xb6a3df){_0x4cd3ef=_0x4cd3ef-0x0;var _0x19411d=_0xaf67[_0x4cd3ef];return _0x19411d;};'use strict';var attributes=require(_0x7af6('0x0'));module[_0x7af6('0x1')]=function(_0x49b006){var _0x19b5f2=_0x49b006[_0x7af6('0x2')];return _0x49b006[_0x7af6('0x3')](_0x7af6('0x4'),attributes,{'tableName':_0x7af6('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x59df01,_0x282088,_0xc8aa19){return _0x19b5f2[_0x7af6('0x6')][_0x7af6('0x7')]({'value':_0x59df01['name']},{'where':{'field':_0x7af6('0x8'),'value':_0x59df01[_0x7af6('0x9')]['name']}})[_0x7af6('0xa')](function(){_0xc8aa19();})['catch'](function(_0xd362aa){_0xc8aa19(_0xd362aa);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 2fee957..649e33c 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 _0x104b=['jayson/promise','client','http','request','then','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','info','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3f8965,_0x3c80b9){var _0xcdf5c9=function(_0x57f205){while(--_0x57f205){_0x3f8965['push'](_0x3f8965['shift']());}};_0xcdf5c9(++_0x3c80b9);}(_0x104b,0x143));var _0xb104=function(_0x7f1b94,_0x6c3bb2){_0x7f1b94=_0x7f1b94-0x0;var _0x3d8f31=_0x104b[_0x7f1b94];return _0x3d8f31;};'use strict';var _=require('lodash');var util=require(_0xb104('0x0'));var moment=require(_0xb104('0x1'));var BPromise=require('bluebird');var rs=require(_0xb104('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb104('0x3'))['db'];var utils=require(_0xb104('0x4'));var logger=require(_0xb104('0x5'))(_0xb104('0x6'));var config=require('../../config/environment');var jayson=require(_0xb104('0x7'));var client=jayson[_0xb104('0x8')][_0xb104('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49fde1,_0x5cfea4,_0x5bef45){return new BPromise(function(_0x18c1fc,_0x3f6ff4){return client[_0xb104('0xa')](_0x49fde1,_0x5bef45)[_0xb104('0xb')](function(_0x56e8c3){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x5cfea4,_0xb104('0xc'));logger[_0xb104('0xd')](_0xb104('0xe'),_0x5cfea4,_0xb104('0xc'),JSON[_0xb104('0xf')](_0x56e8c3));if(_0x56e8c3[_0xb104('0x10')]){if(_0x56e8c3[_0xb104('0x10')][_0xb104('0x11')]===0x1f4){logger['error'](_0xb104('0x12'),_0x5cfea4,_0x56e8c3['error'][_0xb104('0x13')]);return _0x3f6ff4(_0x56e8c3[_0xb104('0x10')][_0xb104('0x13')]);}logger[_0xb104('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x5cfea4,_0x56e8c3['error'][_0xb104('0x13')]);return _0x18c1fc(_0x56e8c3['error'][_0xb104('0x13')]);}else{logger[_0xb104('0x14')](_0xb104('0x12'),_0x5cfea4,_0xb104('0xc'));_0x18c1fc(_0x56e8c3['result'][_0xb104('0x13')]);}})[_0xb104('0x15')](function(_0x2e742a){logger[_0xb104('0x10')](_0xb104('0x12'),_0x5cfea4,_0x2e742a);_0x3f6ff4(_0x2e742a);});});} \ No newline at end of file +var _0x0b81=['jayson/promise','client','http','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x580d7a,_0x1bf653){var _0x2e1a90=function(_0xd4fa5f){while(--_0xd4fa5f){_0x580d7a['push'](_0x580d7a['shift']());}};_0x2e1a90(++_0x1bf653);}(_0x0b81,0xbf));var _0x10b8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b81[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x10b8('0x0'));var moment=require('moment');var BPromise=require(_0x10b8('0x1'));var rs=require(_0x10b8('0x2'));var fs=require('fs');var Redis=require(_0x10b8('0x3'));var db=require(_0x10b8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x10b8('0x5'))(_0x10b8('0x6'));var config=require('../../config/environment');var jayson=require(_0x10b8('0x7'));var client=jayson[_0x10b8('0x8')][_0x10b8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1af58c,_0x1cbe96,_0x43087b){return new BPromise(function(_0x4344f2,_0xe2f3b8){return client['request'](_0x1af58c,_0x43087b)[_0x10b8('0xa')](function(_0x42fd19){logger[_0x10b8('0xb')](_0x10b8('0xc'),_0x1cbe96,_0x10b8('0xd'));logger[_0x10b8('0xe')](_0x10b8('0xf'),_0x1cbe96,_0x10b8('0xd'),JSON[_0x10b8('0x10')](_0x42fd19));if(_0x42fd19[_0x10b8('0x11')]){if(_0x42fd19[_0x10b8('0x11')][_0x10b8('0x12')]===0x1f4){logger[_0x10b8('0x11')](_0x10b8('0xc'),_0x1cbe96,_0x42fd19[_0x10b8('0x11')]['message']);return _0xe2f3b8(_0x42fd19[_0x10b8('0x11')][_0x10b8('0x13')]);}logger[_0x10b8('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x1cbe96,_0x42fd19[_0x10b8('0x11')][_0x10b8('0x13')]);return _0x4344f2(_0x42fd19['error'][_0x10b8('0x13')]);}else{logger['info']('MailSubstatus,\x20%s,\x20%s',_0x1cbe96,'request\x20sent');_0x4344f2(_0x42fd19[_0x10b8('0x14')]['message']);}})[_0x10b8('0x15')](function(_0x5a4e3d){logger[_0x10b8('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x1cbe96,_0x5a4e3d);_0xe2f3b8(_0x5a4e3d);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 08f4868..66a5d9b 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 _0x272b=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','index','get','isAuthenticated','describe','/:id','show','post','put','delete','destroy','exports','multer','util'];(function(_0x1d6968,_0x46ccfe){var _0x302baa=function(_0xef6f07){while(--_0xef6f07){_0x1d6968['push'](_0x1d6968['shift']());}};_0x302baa(++_0x46ccfe);}(_0x272b,0x139));var _0xb272=function(_0x1579be,_0x4f5834){_0x1579be=_0x1579be-0x0;var _0x4f4837=_0x272b[_0x1579be];return _0x4f4837;};'use strict';var multer=require(_0xb272('0x0'));var util=require(_0xb272('0x1'));var path=require(_0xb272('0x2'));var timeout=require(_0xb272('0x3'));var express=require(_0xb272('0x4'));var router=express[_0xb272('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb272('0x6'));var interaction=require(_0xb272('0x7'));var config=require(_0xb272('0x8'));var controller=require(_0xb272('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xb272('0xa')]);router[_0xb272('0xb')]('/describe',auth[_0xb272('0xc')](),controller[_0xb272('0xd')]);router[_0xb272('0xb')](_0xb272('0xe'),auth[_0xb272('0xc')](),controller[_0xb272('0xf')]);router[_0xb272('0x10')]('/',auth[_0xb272('0xc')](),controller['create']);router[_0xb272('0x11')](_0xb272('0xe'),auth[_0xb272('0xc')](),controller['update']);router[_0xb272('0x12')](_0xb272('0xe'),auth['isAuthenticated'](),controller[_0xb272('0x13')]);module[_0xb272('0x14')]=router; \ No newline at end of file +var _0x23b3=['index','/describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated'];(function(_0x505439,_0x5a4a50){var _0x54267a=function(_0x5e635f){while(--_0x5e635f){_0x505439['push'](_0x505439['shift']());}};_0x54267a(++_0x5a4a50);}(_0x23b3,0x130));var _0x323b=function(_0x3ce937,_0x568d7d){_0x3ce937=_0x3ce937-0x0;var _0x41d2fa=_0x23b3[_0x3ce937];return _0x41d2fa;};'use strict';var multer=require(_0x323b('0x0'));var util=require(_0x323b('0x1'));var path=require(_0x323b('0x2'));var timeout=require(_0x323b('0x3'));var express=require(_0x323b('0x4'));var router=express['Router']();var fs_extra=require(_0x323b('0x5'));var auth=require(_0x323b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x323b('0x7'));var controller=require(_0x323b('0x8'));router[_0x323b('0x9')]('/',auth[_0x323b('0xa')](),controller[_0x323b('0xb')]);router[_0x323b('0x9')](_0x323b('0xc'),auth[_0x323b('0xa')](),controller['describe']);router['get'](_0x323b('0xd'),auth['isAuthenticated'](),controller[_0x323b('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x323b('0xf')]);router[_0x323b('0x10')](_0x323b('0xd'),auth[_0x323b('0xa')](),controller[_0x323b('0x11')]);router[_0x323b('0x12')](_0x323b('0xd'),auth['isAuthenticated'](),controller[_0x323b('0x13')]);module[_0x323b('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 04fa978..5c5580f 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x120891,_0x415544){var _0x2c52b7=function(_0x35ca89){while(--_0x35ca89){_0x120891['push'](_0x120891['shift']());}};_0x2c52b7(++_0x415544);}(_0x008c,0x188));var _0xc008=function(_0x567534,_0x19334c){_0x567534=_0x567534-0x0;var _0x538292=_0x008c[_0x567534];return _0x538292;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x34c063,_0x11d3d7){var _0x2c63a3=function(_0x5983d0){while(--_0x5983d0){_0x34c063['push'](_0x34c063['shift']());}};_0x2c63a3(++_0x11d3d7);}(_0xb43b,0x1b2));var _0xbb43=function(_0x3bbce6,_0x5e0837){_0x3bbce6=_0x3bbce6-0x0;var _0x3d51c3=_0xb43b[_0x3bbce6];return _0x3d51c3;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 3d22b68..780a2e5 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 _0xb344=['status','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','error','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','MailTransferReport','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb344,0xc9));var _0x4b34=function(_0x125378,_0x243ad2){_0x125378=_0x125378-0x0;var _0x243ebc=_0xb344[_0x125378];return _0x243ebc;};'use strict';var emlformat=require(_0x4b34('0x0'));var rimraf=require(_0x4b34('0x1'));var zipdir=require(_0x4b34('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4b34('0x3'));var moment=require(_0x4b34('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4b34('0x5'));var path=require(_0x4b34('0x6'));var sox=require(_0x4b34('0x7'));var csv=require(_0x4b34('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b34('0x9'));var _=require(_0x4b34('0xa'));var squel=require(_0x4b34('0xb'));var crypto=require(_0x4b34('0xc'));var jsforce=require(_0x4b34('0xd'));var deskjs=require(_0x4b34('0xe'));var toCsv=require(_0x4b34('0x8'));var querystring=require(_0x4b34('0xf'));var Papa=require(_0x4b34('0x10'));var Redis=require(_0x4b34('0x11'));var authService=require(_0x4b34('0x12'));var qs=require(_0x4b34('0x13'));var as=require(_0x4b34('0x14'));var hardwareService=require(_0x4b34('0x15'));var logger=require(_0x4b34('0x16'))(_0x4b34('0x17'));var utils=require(_0x4b34('0x18'));var config=require(_0x4b34('0x19'));var licenseUtil=require(_0x4b34('0x1a'));var db=require(_0x4b34('0x1b'))['db'];function respondWithStatusCode(_0x59c906,_0x21090b){_0x21090b=_0x21090b||0xcc;return function(_0x6d2eb7){if(_0x6d2eb7){return _0x59c906[_0x4b34('0x1c')](_0x21090b);}return _0x59c906['status'](_0x21090b)[_0x4b34('0x1d')]();};}function respondWithResult(_0x42e3aa,_0x5d65d8){_0x5d65d8=_0x5d65d8||0xc8;return function(_0x47bc37){if(_0x47bc37){return _0x42e3aa[_0x4b34('0x1e')](_0x5d65d8)[_0x4b34('0x1f')](_0x47bc37);}};}function respondWithFilteredResult(_0x4dadbe,_0x580882){return function(_0xb42fe2){if(_0xb42fe2){var _0x1905c4=typeof _0x580882[_0x4b34('0x20')]===_0x4b34('0x21')&&typeof _0x580882[_0x4b34('0x22')]===_0x4b34('0x21');var _0x18fdb8=_0xb42fe2[_0x4b34('0x23')];var _0x39d9ca=_0x1905c4?0x0:_0x580882['offset'];var _0xc2a6e1=_0x1905c4?_0xb42fe2[_0x4b34('0x23')]:_0x580882[_0x4b34('0x20')]+_0x580882['limit'];var _0x4ea5fc;if(_0xc2a6e1>=_0x18fdb8){_0xc2a6e1=_0x18fdb8;_0x4ea5fc=0xc8;}else{_0x4ea5fc=0xce;}_0x4dadbe[_0x4b34('0x1e')](_0x4ea5fc);return _0x4dadbe[_0x4b34('0x24')](_0x4b34('0x25'),_0x39d9ca+'-'+_0xc2a6e1+'/'+_0x18fdb8)[_0x4b34('0x1f')](_0xb42fe2);}return null;};}function patchUpdates(_0x3d1048){return function(_0x54d120){try{jsonpatch[_0x4b34('0x26')](_0x54d120,_0x3d1048,!![]);}catch(_0x44801c){return BPromise['reject'](_0x44801c);}return _0x54d120['save']();};}function saveUpdates(_0x5893bf,_0x400384){return function(_0x55a550){if(_0x55a550){return _0x55a550['update'](_0x5893bf)[_0x4b34('0x27')](function(_0x3b2a65){return _0x3b2a65;});}return null;};}function removeEntity(_0x5ce0da,_0xeef891){return function(_0x4d34f3){if(_0x4d34f3){return _0x4d34f3[_0x4b34('0x28')]()[_0x4b34('0x27')](function(){_0x5ce0da['status'](0xcc)[_0x4b34('0x1d')]();});}};}function handleEntityNotFound(_0x2ff5cf,_0x2e542a){return function(_0x3529a4){if(!_0x3529a4){_0x2ff5cf['sendStatus'](0x194);}return _0x3529a4;};}function handleError(_0x34cb3f,_0x407c02){_0x407c02=_0x407c02||0x1f4;return function(_0x5a8d2e){logger[_0x4b34('0x29')](_0x5a8d2e[_0x4b34('0x2a')]);if(_0x5a8d2e['name']){delete _0x5a8d2e[_0x4b34('0x2b')];}_0x34cb3f[_0x4b34('0x1e')](_0x407c02)[_0x4b34('0x2c')](_0x5a8d2e);};}exports[_0x4b34('0x2d')]=function(_0x5224c3,_0x30da77){var _0x3da93f={},_0x23ccbf={},_0x1c4535={'count':0x0,'rows':[]};var _0x419b0f=_[_0x4b34('0x2e')](db['MailTransferReport']['rawAttributes'],function(_0x249bd4){return{'name':_0x249bd4[_0x4b34('0x2f')],'type':_0x249bd4[_0x4b34('0x30')]['key']};});_0x23ccbf[_0x4b34('0x31')]=_[_0x4b34('0x2e')](_0x419b0f,_0x4b34('0x2b'));_0x23ccbf[_0x4b34('0x32')]=_[_0x4b34('0x33')](_0x5224c3[_0x4b34('0x32')]);_0x23ccbf[_0x4b34('0x34')]=_[_0x4b34('0x35')](_0x23ccbf[_0x4b34('0x31')],_0x23ccbf[_0x4b34('0x32')]);_0x3da93f['attributes']=_[_0x4b34('0x35')](_0x23ccbf[_0x4b34('0x31')],qs[_0x4b34('0x36')](_0x5224c3[_0x4b34('0x32')][_0x4b34('0x36')]));_0x3da93f[_0x4b34('0x37')]=_0x3da93f['attributes'][_0x4b34('0x38')]?_0x3da93f[_0x4b34('0x37')]:_0x23ccbf['model'];if(!_0x5224c3[_0x4b34('0x32')]['hasOwnProperty'](_0x4b34('0x39'))){_0x3da93f[_0x4b34('0x22')]=qs[_0x4b34('0x22')](_0x5224c3[_0x4b34('0x32')][_0x4b34('0x22')]);_0x3da93f[_0x4b34('0x20')]=qs[_0x4b34('0x20')](_0x5224c3['query'][_0x4b34('0x20')]);}_0x3da93f[_0x4b34('0x3a')]=qs[_0x4b34('0x3b')](_0x5224c3['query']['sort']);_0x3da93f['where']=qs[_0x4b34('0x34')](_[_0x4b34('0x3c')](_0x5224c3[_0x4b34('0x32')],_0x23ccbf['filters']),_0x419b0f);if(_0x5224c3[_0x4b34('0x32')][_0x4b34('0x3d')]){_0x3da93f[_0x4b34('0x3e')]=_[_0x4b34('0x3f')](_0x3da93f[_0x4b34('0x3e')],{'$or':_[_0x4b34('0x2e')](_0x419b0f,function(_0x44615f){if(_0x44615f[_0x4b34('0x30')]!==_0x4b34('0x40')){var _0x3980c3={};_0x3980c3[_0x44615f['name']]={'$like':'%'+_0x5224c3[_0x4b34('0x32')][_0x4b34('0x3d')]+'%'};return _0x3980c3;}})});}_0x3da93f=_[_0x4b34('0x3f')]({},_0x3da93f,_0x5224c3['options']);var _0x300d40={'where':_0x3da93f['where']};return db[_0x4b34('0x41')]['count'](_0x300d40)['then'](function(_0x2d3f54){_0x1c4535[_0x4b34('0x23')]=_0x2d3f54;if(_0x5224c3[_0x4b34('0x32')]['includeAll']){_0x3da93f['include']=[{'all':!![]}];}return db[_0x4b34('0x41')]['findAll'](_0x3da93f);})[_0x4b34('0x27')](function(_0x53e4f7){_0x1c4535[_0x4b34('0x42')]=_0x53e4f7;return _0x1c4535;})['then'](respondWithFilteredResult(_0x30da77,_0x3da93f))[_0x4b34('0x43')](handleError(_0x30da77,null));};exports[_0x4b34('0x44')]=function(_0x434723,_0x2902f1){var _0x16b678={'raw':!![],'where':{'id':_0x434723[_0x4b34('0x45')]['id']}},_0xc448fe={};_0xc448fe[_0x4b34('0x31')]=_[_0x4b34('0x33')](db[_0x4b34('0x41')][_0x4b34('0x46')]);_0xc448fe[_0x4b34('0x32')]=_[_0x4b34('0x33')](_0x434723['query']);_0xc448fe[_0x4b34('0x34')]=_[_0x4b34('0x35')](_0xc448fe[_0x4b34('0x31')],_0xc448fe[_0x4b34('0x32')]);_0x16b678['attributes']=_[_0x4b34('0x35')](_0xc448fe['model'],qs[_0x4b34('0x36')](_0x434723[_0x4b34('0x32')][_0x4b34('0x36')]));_0x16b678[_0x4b34('0x37')]=_0x16b678[_0x4b34('0x37')][_0x4b34('0x38')]?_0x16b678[_0x4b34('0x37')]:_0xc448fe[_0x4b34('0x31')];if(_0x434723[_0x4b34('0x32')][_0x4b34('0x47')]){_0x16b678['include']=[{'all':!![]}];}_0x16b678=_[_0x4b34('0x3f')]({},_0x16b678,_0x434723[_0x4b34('0x48')]);return db[_0x4b34('0x41')][_0x4b34('0x49')](_0x16b678)[_0x4b34('0x27')](handleEntityNotFound(_0x2902f1,null))[_0x4b34('0x27')](respondWithResult(_0x2902f1,null))[_0x4b34('0x43')](handleError(_0x2902f1,null));};exports[_0x4b34('0x4a')]=function(_0x253b72,_0x5f197e){return db[_0x4b34('0x41')][_0x4b34('0x4a')](_0x253b72['body'],{})['then'](respondWithResult(_0x5f197e,0xc9))['catch'](handleError(_0x5f197e,null));};exports['update']=function(_0x2da247,_0x1dd9ba){if(_0x2da247[_0x4b34('0x4b')]['id']){delete _0x2da247[_0x4b34('0x4b')]['id'];}return db[_0x4b34('0x41')][_0x4b34('0x49')]({'where':{'id':_0x2da247[_0x4b34('0x45')]['id']}})['then'](handleEntityNotFound(_0x1dd9ba,null))['then'](saveUpdates(_0x2da247[_0x4b34('0x4b')],null))[_0x4b34('0x27')](respondWithResult(_0x1dd9ba,null))[_0x4b34('0x43')](handleError(_0x1dd9ba,null));};exports[_0x4b34('0x28')]=function(_0x4bc519,_0x5b5de9){return db[_0x4b34('0x41')]['find']({'where':{'id':_0x4bc519['params']['id']}})['then'](handleEntityNotFound(_0x5b5de9,null))[_0x4b34('0x27')](removeEntity(_0x5b5de9,null))[_0x4b34('0x43')](handleError(_0x5b5de9,null));};exports[_0x4b34('0x4c')]=function(_0x3aaced,_0x595715){return db['MailTransferReport'][_0x4b34('0x4c')]()['then'](respondWithResult(_0x595715,null))[_0x4b34('0x43')](handleError(_0x595715,null));}; \ No newline at end of file +var _0x7b78=['catch','show','params','keys','include','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','end','offset','limit','undefined','count','status','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows'];(function(_0x285800,_0x26765e){var _0x4b809e=function(_0x12c58b){while(--_0x12c58b){_0x285800['push'](_0x285800['shift']());}};_0x4b809e(++_0x26765e);}(_0x7b78,0xa1));var _0x87b7=function(_0x11ba2c,_0x170a18){_0x11ba2c=_0x11ba2c-0x0;var _0x4872a2=_0x7b78[_0x11ba2c];return _0x4872a2;};'use strict';var emlformat=require(_0x87b7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x87b7('0x1'));var jsonpatch=require(_0x87b7('0x2'));var rp=require(_0x87b7('0x3'));var moment=require(_0x87b7('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x87b7('0x5'));var path=require(_0x87b7('0x6'));var sox=require(_0x87b7('0x7'));var csv=require(_0x87b7('0x8'));var ejs=require(_0x87b7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x87b7('0xa'));var squel=require(_0x87b7('0xb'));var crypto=require(_0x87b7('0xc'));var jsforce=require(_0x87b7('0xd'));var deskjs=require(_0x87b7('0xe'));var toCsv=require('to-csv');var querystring=require(_0x87b7('0xf'));var Papa=require(_0x87b7('0x10'));var Redis=require('ioredis');var authService=require(_0x87b7('0x11'));var qs=require(_0x87b7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x87b7('0x13'));var utils=require(_0x87b7('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x87b7('0x15'))['db'];function respondWithStatusCode(_0x3e0602,_0x4077df){_0x4077df=_0x4077df||0xcc;return function(_0x2fbee5){if(_0x2fbee5){return _0x3e0602[_0x87b7('0x16')](_0x4077df);}return _0x3e0602['status'](_0x4077df)[_0x87b7('0x17')]();};}function respondWithResult(_0x2323ee,_0x5e988a){_0x5e988a=_0x5e988a||0xc8;return function(_0x1731c2){if(_0x1731c2){return _0x2323ee['status'](_0x5e988a)['json'](_0x1731c2);}};}function respondWithFilteredResult(_0x45d856,_0xc507fe){return function(_0x38ac97){if(_0x38ac97){var _0x131716=typeof _0xc507fe[_0x87b7('0x18')]==='undefined'&&typeof _0xc507fe[_0x87b7('0x19')]===_0x87b7('0x1a');var _0x450aac=_0x38ac97['count'];var _0x16c382=_0x131716?0x0:_0xc507fe[_0x87b7('0x18')];var _0x4398b2=_0x131716?_0x38ac97[_0x87b7('0x1b')]:_0xc507fe['offset']+_0xc507fe['limit'];var _0x54aff3;if(_0x4398b2>=_0x450aac){_0x4398b2=_0x450aac;_0x54aff3=0xc8;}else{_0x54aff3=0xce;}_0x45d856[_0x87b7('0x1c')](_0x54aff3);return _0x45d856[_0x87b7('0x1d')](_0x87b7('0x1e'),_0x16c382+'-'+_0x4398b2+'/'+_0x450aac)[_0x87b7('0x1f')](_0x38ac97);}return null;};}function patchUpdates(_0x163be5){return function(_0x13dbf1){try{jsonpatch[_0x87b7('0x20')](_0x13dbf1,_0x163be5,!![]);}catch(_0x5df017){return BPromise[_0x87b7('0x21')](_0x5df017);}return _0x13dbf1['save']();};}function saveUpdates(_0x4646c5,_0x5ebe4a){return function(_0x1cf5e2){if(_0x1cf5e2){return _0x1cf5e2[_0x87b7('0x22')](_0x4646c5)[_0x87b7('0x23')](function(_0x4964b3){return _0x4964b3;});}return null;};}function removeEntity(_0x43bef1,_0x228ffb){return function(_0x535268){if(_0x535268){return _0x535268[_0x87b7('0x24')]()[_0x87b7('0x23')](function(){_0x43bef1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x7e7775,_0x1c4423){return function(_0x2f2815){if(!_0x2f2815){_0x7e7775[_0x87b7('0x16')](0x194);}return _0x2f2815;};}function handleError(_0x48d26d,_0x23e692){_0x23e692=_0x23e692||0x1f4;return function(_0x26d590){logger[_0x87b7('0x25')](_0x26d590[_0x87b7('0x26')]);if(_0x26d590[_0x87b7('0x27')]){delete _0x26d590[_0x87b7('0x27')];}_0x48d26d['status'](_0x23e692)[_0x87b7('0x28')](_0x26d590);};}exports['index']=function(_0x2e5318,_0x455b2d){var _0x2a84f0={},_0xef671b={},_0x765b8={'count':0x0,'rows':[]};var _0x39a8c2=_[_0x87b7('0x29')](db[_0x87b7('0x2a')][_0x87b7('0x2b')],function(_0xae4824){return{'name':_0xae4824[_0x87b7('0x2c')],'type':_0xae4824[_0x87b7('0x2d')][_0x87b7('0x2e')]};});_0xef671b['model']=_['map'](_0x39a8c2,_0x87b7('0x27'));_0xef671b[_0x87b7('0x2f')]=_['keys'](_0x2e5318[_0x87b7('0x2f')]);_0xef671b[_0x87b7('0x30')]=_[_0x87b7('0x31')](_0xef671b['model'],_0xef671b['query']);_0x2a84f0['attributes']=_['intersection'](_0xef671b[_0x87b7('0x32')],qs['fields'](_0x2e5318[_0x87b7('0x2f')][_0x87b7('0x33')]));_0x2a84f0[_0x87b7('0x34')]=_0x2a84f0[_0x87b7('0x34')][_0x87b7('0x35')]?_0x2a84f0[_0x87b7('0x34')]:_0xef671b[_0x87b7('0x32')];if(!_0x2e5318[_0x87b7('0x2f')][_0x87b7('0x36')](_0x87b7('0x37'))){_0x2a84f0[_0x87b7('0x19')]=qs[_0x87b7('0x19')](_0x2e5318[_0x87b7('0x2f')]['limit']);_0x2a84f0[_0x87b7('0x18')]=qs['offset'](_0x2e5318['query'][_0x87b7('0x18')]);}_0x2a84f0[_0x87b7('0x38')]=qs['sort'](_0x2e5318[_0x87b7('0x2f')][_0x87b7('0x39')]);_0x2a84f0[_0x87b7('0x3a')]=qs[_0x87b7('0x30')](_[_0x87b7('0x3b')](_0x2e5318[_0x87b7('0x2f')],_0xef671b[_0x87b7('0x30')]),_0x39a8c2);if(_0x2e5318['query'][_0x87b7('0x3c')]){_0x2a84f0[_0x87b7('0x3a')]=_['merge'](_0x2a84f0[_0x87b7('0x3a')],{'$or':_[_0x87b7('0x29')](_0x39a8c2,function(_0x314b8a){if(_0x314b8a[_0x87b7('0x2d')]!==_0x87b7('0x3d')){var _0x5dc3e0={};_0x5dc3e0[_0x314b8a[_0x87b7('0x27')]]={'$like':'%'+_0x2e5318[_0x87b7('0x2f')][_0x87b7('0x3c')]+'%'};return _0x5dc3e0;}})});}_0x2a84f0=_[_0x87b7('0x3e')]({},_0x2a84f0,_0x2e5318[_0x87b7('0x3f')]);var _0x57571f={'where':_0x2a84f0['where']};return db[_0x87b7('0x2a')][_0x87b7('0x1b')](_0x57571f)[_0x87b7('0x23')](function(_0x582fc4){_0x765b8[_0x87b7('0x1b')]=_0x582fc4;if(_0x2e5318[_0x87b7('0x2f')][_0x87b7('0x40')]){_0x2a84f0['include']=[{'all':!![]}];}return db[_0x87b7('0x2a')][_0x87b7('0x41')](_0x2a84f0);})[_0x87b7('0x23')](function(_0x304e24){_0x765b8[_0x87b7('0x42')]=_0x304e24;return _0x765b8;})[_0x87b7('0x23')](respondWithFilteredResult(_0x455b2d,_0x2a84f0))[_0x87b7('0x43')](handleError(_0x455b2d,null));};exports[_0x87b7('0x44')]=function(_0x1dae7a,_0x3cfdb5){var _0x1eb2e1={'raw':!![],'where':{'id':_0x1dae7a[_0x87b7('0x45')]['id']}},_0xeaef68={};_0xeaef68['model']=_[_0x87b7('0x46')](db[_0x87b7('0x2a')]['rawAttributes']);_0xeaef68[_0x87b7('0x2f')]=_[_0x87b7('0x46')](_0x1dae7a[_0x87b7('0x2f')]);_0xeaef68[_0x87b7('0x30')]=_[_0x87b7('0x31')](_0xeaef68[_0x87b7('0x32')],_0xeaef68[_0x87b7('0x2f')]);_0x1eb2e1['attributes']=_[_0x87b7('0x31')](_0xeaef68[_0x87b7('0x32')],qs[_0x87b7('0x33')](_0x1dae7a['query']['fields']));_0x1eb2e1['attributes']=_0x1eb2e1[_0x87b7('0x34')][_0x87b7('0x35')]?_0x1eb2e1['attributes']:_0xeaef68[_0x87b7('0x32')];if(_0x1dae7a[_0x87b7('0x2f')][_0x87b7('0x40')]){_0x1eb2e1[_0x87b7('0x47')]=[{'all':!![]}];}_0x1eb2e1=_[_0x87b7('0x3e')]({},_0x1eb2e1,_0x1dae7a['options']);return db['MailTransferReport']['find'](_0x1eb2e1)[_0x87b7('0x23')](handleEntityNotFound(_0x3cfdb5,null))[_0x87b7('0x23')](respondWithResult(_0x3cfdb5,null))[_0x87b7('0x43')](handleError(_0x3cfdb5,null));};exports[_0x87b7('0x48')]=function(_0x158fc5,_0x481be7){return db[_0x87b7('0x2a')][_0x87b7('0x48')](_0x158fc5[_0x87b7('0x49')],{})['then'](respondWithResult(_0x481be7,0xc9))['catch'](handleError(_0x481be7,null));};exports[_0x87b7('0x22')]=function(_0x40407f,_0xe4337c){if(_0x40407f[_0x87b7('0x49')]['id']){delete _0x40407f[_0x87b7('0x49')]['id'];}return db[_0x87b7('0x2a')][_0x87b7('0x4a')]({'where':{'id':_0x40407f[_0x87b7('0x45')]['id']}})[_0x87b7('0x23')](handleEntityNotFound(_0xe4337c,null))[_0x87b7('0x23')](saveUpdates(_0x40407f[_0x87b7('0x49')],null))[_0x87b7('0x23')](respondWithResult(_0xe4337c,null))[_0x87b7('0x43')](handleError(_0xe4337c,null));};exports['destroy']=function(_0x1f8d28,_0x585a1f){return db[_0x87b7('0x2a')]['find']({'where':{'id':_0x1f8d28[_0x87b7('0x45')]['id']}})[_0x87b7('0x23')](handleEntityNotFound(_0x585a1f,null))[_0x87b7('0x23')](removeEntity(_0x585a1f,null))[_0x87b7('0x43')](handleError(_0x585a1f,null));};exports[_0x87b7('0x4b')]=function(_0x41545f,_0x399945){return db[_0x87b7('0x2a')][_0x87b7('0x4b')]()[_0x87b7('0x23')](respondWithResult(_0x399945,null))['catch'](handleError(_0x399945,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 06f8bc3..c865b92 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 _0xf767=['uniqueid','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer'];(function(_0x37c096,_0x3abf0f){var _0x29c4f3=function(_0x436e67){while(--_0x436e67){_0x37c096['push'](_0x37c096['shift']());}};_0x29c4f3(++_0x3abf0f);}(_0xf767,0x76));var _0x7f76=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xf767[_0xc6be3a];return _0x56a310;};'use strict';var _=require('lodash');var util=require(_0x7f76('0x0'));var logger=require(_0x7f76('0x1'))(_0x7f76('0x2'));var moment=require(_0x7f76('0x3'));var BPromise=require(_0x7f76('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f76('0x5'));var rimraf=require(_0x7f76('0x6'));var config=require(_0x7f76('0x7'));var attributes=require(_0x7f76('0x8'));module['exports']=function(_0x23c243,_0x2f2588){return _0x23c243[_0x7f76('0x9')](_0x7f76('0xa'),attributes,{'tableName':_0x7f76('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7f76('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x177e=['../../config/environment','define','report_mail_transfer','uniqueid','path','rimraf'];(function(_0xad0aaa,_0x4943c8){var _0x168b18=function(_0x6e6e35){while(--_0x6e6e35){_0xad0aaa['push'](_0xad0aaa['shift']());}};_0x168b18(++_0x4943c8);}(_0x177e,0xd0));var _0xe177=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x177e[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe177('0x0'));var rimraf=require(_0xe177('0x1'));var config=require(_0xe177('0x2'));var attributes=require('./mailTransferReport.attributes');module['exports']=function(_0x5b84fc,_0x1e2af3){return _0x5b84fc[_0xe177('0x3')]('MailTransferReport',attributes,{'tableName':_0xe177('0x4'),'paranoid':![],'indexes':[{'name':_0xe177('0x5'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index fdd0bbe..91e7c9f 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 _0x4316=['MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','http','request','then','info'];(function(_0x2b15ab,_0x32e3fb){var _0x5cf600=function(_0x4515b9){while(--_0x4515b9){_0x2b15ab['push'](_0x2b15ab['shift']());}};_0x5cf600(++_0x32e3fb);}(_0x4316,0x125));var _0x6431=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4316[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6431('0x0'));var util=require(_0x6431('0x1'));var moment=require(_0x6431('0x2'));var BPromise=require('bluebird');var rs=require(_0x6431('0x3'));var fs=require('fs');var Redis=require(_0x6431('0x4'));var db=require(_0x6431('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6431('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6431('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x373220,_0x476d02,_0x4b7861){return new BPromise(function(_0x30bc5c,_0x56ead7){return client[_0x6431('0x8')](_0x373220,_0x4b7861)[_0x6431('0x9')](function(_0x494dec){logger[_0x6431('0xa')](_0x6431('0xb'),_0x476d02,'request\x20sent');logger[_0x6431('0xc')](_0x6431('0xd'),_0x476d02,_0x6431('0xe'),JSON['stringify'](_0x494dec));if(_0x494dec[_0x6431('0xf')]){if(_0x494dec[_0x6431('0xf')][_0x6431('0x10')]===0x1f4){logger[_0x6431('0xf')](_0x6431('0xb'),_0x476d02,_0x494dec[_0x6431('0xf')][_0x6431('0x11')]);return _0x56ead7(_0x494dec['error'][_0x6431('0x11')]);}logger[_0x6431('0xf')](_0x6431('0xb'),_0x476d02,_0x494dec[_0x6431('0xf')]['message']);return _0x30bc5c(_0x494dec[_0x6431('0xf')][_0x6431('0x11')]);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x476d02,_0x6431('0xe'));_0x30bc5c(_0x494dec[_0x6431('0x12')][_0x6431('0x11')]);}})['catch'](function(_0x1ae02e){logger['error'](_0x6431('0xb'),_0x476d02,_0x1ae02e);_0x56ead7(_0x1ae02e);});});} \ No newline at end of file +var _0x9ee1=['request\x20sent','debug','stringify','error','code','message','MailTransferReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x672125,_0x38ba36){var _0x21074e=function(_0x15f426){while(--_0x15f426){_0x672125['push'](_0x672125['shift']());}};_0x21074e(++_0x38ba36);}(_0x9ee1,0x69));var _0x19ee=function(_0xc9c4a9,_0x349a6e){_0xc9c4a9=_0xc9c4a9-0x0;var _0x578179=_0x9ee1[_0xc9c4a9];return _0x578179;};'use strict';var _=require(_0x19ee('0x0'));var util=require(_0x19ee('0x1'));var moment=require(_0x19ee('0x2'));var BPromise=require(_0x19ee('0x3'));var rs=require(_0x19ee('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x19ee('0x5'));var logger=require(_0x19ee('0x6'))(_0x19ee('0x7'));var config=require(_0x19ee('0x8'));var jayson=require(_0x19ee('0x9'));var client=jayson[_0x19ee('0xa')][_0x19ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x179bc9,_0x561e68,_0x3cd7a6){return new BPromise(function(_0x100b56,_0x2d26ff){return client[_0x19ee('0xc')](_0x179bc9,_0x3cd7a6)[_0x19ee('0xd')](function(_0x424aab){logger[_0x19ee('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x561e68,_0x19ee('0xf'));logger[_0x19ee('0x10')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x561e68,'request\x20sent',JSON[_0x19ee('0x11')](_0x424aab));if(_0x424aab[_0x19ee('0x12')]){if(_0x424aab[_0x19ee('0x12')][_0x19ee('0x13')]===0x1f4){logger[_0x19ee('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x561e68,_0x424aab['error'][_0x19ee('0x14')]);return _0x2d26ff(_0x424aab[_0x19ee('0x12')]['message']);}logger[_0x19ee('0x12')](_0x19ee('0x15'),_0x561e68,_0x424aab[_0x19ee('0x12')][_0x19ee('0x14')]);return _0x100b56(_0x424aab[_0x19ee('0x12')][_0x19ee('0x14')]);}else{logger[_0x19ee('0xe')](_0x19ee('0x15'),_0x561e68,_0x19ee('0xf'));_0x100b56(_0x424aab[_0x19ee('0x16')][_0x19ee('0x14')]);}})[_0x19ee('0x17')](function(_0x1713e9){logger[_0x19ee('0x12')](_0x19ee('0x15'),_0x561e68,_0x1713e9);_0x2d26ff(_0x1713e9);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index aa95259..f0688f4 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 _0xe333=['put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create'];(function(_0x8ba19a,_0x1d2b2b){var _0x2bd8b4=function(_0xee823f){while(--_0xee823f){_0x8ba19a['push'](_0x8ba19a['shift']());}};_0x2bd8b4(++_0x1d2b2b);}(_0xe333,0x11d));var _0x3e33=function(_0x5e515c,_0x3319a7){_0x5e515c=_0x5e515c-0x0;var _0x4f3109=_0xe333[_0x5e515c];return _0x4f3109;};'use strict';var multer=require(_0x3e33('0x0'));var util=require(_0x3e33('0x1'));var path=require(_0x3e33('0x2'));var timeout=require('connect-timeout');var express=require(_0x3e33('0x3'));var router=express[_0x3e33('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3e33('0x5'));var config=require(_0x3e33('0x6'));var controller=require('./memberReport.controller');router[_0x3e33('0x7')]('/',auth[_0x3e33('0x8')](),controller['index']);router['get'](_0x3e33('0x9'),auth[_0x3e33('0x8')](),controller[_0x3e33('0xa')]);router[_0x3e33('0x7')](_0x3e33('0xb'),auth['isAuthenticated'](),controller[_0x3e33('0xc')]);router[_0x3e33('0xd')]('/',auth['isAuthenticated'](),controller[_0x3e33('0xe')]);router[_0x3e33('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3e33('0x10')]);router[_0x3e33('0x11')](_0x3e33('0xb'),auth[_0x3e33('0x8')](),controller[_0x3e33('0x12')]);module[_0x3e33('0x13')]=router; \ No newline at end of file +var _0xdb84=['describe','/:id','show','post','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x3239f5,_0x50e77c){var _0x3559c8=function(_0x4f9f83){while(--_0x4f9f83){_0x3239f5['push'](_0x3239f5['shift']());}};_0x3559c8(++_0x50e77c);}(_0xdb84,0x196));var _0x4db8=function(_0x5def29,_0x2aad51){_0x5def29=_0x5def29-0x0;var _0x17241a=_0xdb84[_0x5def29];return _0x17241a;};'use strict';var multer=require(_0x4db8('0x0'));var util=require(_0x4db8('0x1'));var path=require(_0x4db8('0x2'));var timeout=require(_0x4db8('0x3'));var express=require(_0x4db8('0x4'));var router=express[_0x4db8('0x5')]();var fs_extra=require(_0x4db8('0x6'));var auth=require(_0x4db8('0x7'));var interaction=require(_0x4db8('0x8'));var config=require(_0x4db8('0x9'));var controller=require('./memberReport.controller');router[_0x4db8('0xa')]('/',auth[_0x4db8('0xb')](),controller[_0x4db8('0xc')]);router['get'](_0x4db8('0xd'),auth[_0x4db8('0xb')](),controller[_0x4db8('0xe')]);router['get'](_0x4db8('0xf'),auth[_0x4db8('0xb')](),controller[_0x4db8('0x10')]);router[_0x4db8('0x11')]('/',auth[_0x4db8('0xb')](),controller['create']);router[_0x4db8('0x12')](_0x4db8('0xf'),auth[_0x4db8('0xb')](),controller[_0x4db8('0x13')]);router[_0x4db8('0x14')]('/:id',auth[_0x4db8('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 7c6b47e..e768573 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 _0x45e7=['duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue'];(function(_0x555e31,_0x140057){var _0x1a45e5=function(_0x260431){while(--_0x260431){_0x555e31['push'](_0x555e31['shift']());}};_0x1a45e5(++_0x140057);}(_0x45e7,0x175));var _0x745e=function(_0x5c9f56,_0x42c9ad){_0x5c9f56=_0x5c9f56-0x0;var _0x2a726b=_0x45e7[_0x5c9f56];return _0x2a726b;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x745e('0x0'));module['exports']={'channel':{'type':Sequelize[_0x745e('0x1')]},'membername':{'type':Sequelize[_0x745e('0x1')]},'interface':{'type':Sequelize[_0x745e('0x1')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x745e('0x2'),'comment':_0x745e('0x3')},'duration':{'type':Sequelize[_0x745e('0x4')]},'enterAt':{'type':Sequelize[_0x745e('0x5')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x156c73){var _0x3ebd9e=moment(_0x156c73);var _0x5112d4=moment(this[_0x745e('0x6')](_0x745e('0x7')));var _0x1c8aaf=_0x3ebd9e[_0x745e('0x8')](_0x5112d4,_0x745e('0x9'));this[_0x745e('0xa')]('exitAt',_0x156c73);this[_0x745e('0xa')](_0x745e('0xb'),_0x1c8aaf>=0x0?_0x1c8aaf:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x745e('0xc')},'data2':{'type':Sequelize[_0x745e('0x1')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x745e('0x1')],'comment':_0x745e('0xd')},'data4':{'type':Sequelize[_0x745e('0x1')],'comment':_0x745e('0xe')},'data5':{'type':Sequelize[_0x745e('0x1')],'comment':_0x745e('0xf')},'role':{'type':Sequelize[_0x745e('0x1')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x745e('0x1')]}}; \ No newline at end of file +var _0x586c=['LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','seconds','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','INTEGER','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE'];(function(_0x30c7a4,_0x40e9c1){var _0x37d1d7=function(_0x2bac2b){while(--_0x2bac2b){_0x30c7a4['push'](_0x30c7a4['shift']());}};_0x37d1d7(++_0x40e9c1);}(_0x586c,0x82));var _0xc586=function(_0x5a2299,_0x3e2922){_0x5a2299=_0x5a2299-0x0;var _0xedff0f=_0x586c[_0x5a2299];return _0xedff0f;};'use strict';var Sequelize=require(_0xc586('0x0'));var moment=require(_0xc586('0x1'));module[_0xc586('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xc586('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0xc586('0x4'),'comment':_0xc586('0x5')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xc586('0x6')]},'exitAt':{'type':Sequelize[_0xc586('0x6')],'set':function(_0xa07c48){var _0x481f36=moment(_0xa07c48);var _0x22d4e4=moment(this[_0xc586('0x7')]('enterAt'));var _0x5976d5=_0x481f36['diff'](_0x22d4e4,_0xc586('0x8'));this[_0xc586('0x9')]('exitAt',_0xa07c48);this[_0xc586('0x9')]('duration',_0x5976d5>=0x0?_0x5976d5:null);}},'data1':{'type':Sequelize[_0xc586('0x3')],'comment':_0xc586('0xa')},'data2':{'type':Sequelize[_0xc586('0x3')],'comment':_0xc586('0xb')},'data3':{'type':Sequelize[_0xc586('0x3')],'comment':_0xc586('0xc')},'data4':{'type':Sequelize[_0xc586('0x3')],'comment':_0xc586('0xd')},'data5':{'type':Sequelize[_0xc586('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0xc586('0x3')]},'internal':{'type':Sequelize[_0xc586('0xe')]},'uniqueid':{'type':Sequelize[_0xc586('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index eba7864..57826ea 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(_0x2c6bb4,_0x23fa55){var _0x24425b=function(_0x585ef0){while(--_0x585ef0){_0x2c6bb4['push'](_0x2c6bb4['shift']());}};_0x24425b(++_0x23fa55);}(_0x9c44,0x178));var _0x49c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9c44[_0x167cc1];return _0x10bc4b;};'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 _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x5f15df,_0x960bb7){var _0x388f8d=function(_0x38657b){while(--_0x38657b){_0x5f15df['push'](_0x5f15df['shift']());}};_0x388f8d(++_0x960bb7);}(_0x3e74,0x175));var _0x43e7=function(_0x2d2e30,_0x432ca8){_0x2d2e30=_0x2d2e30-0x0;var _0x3fd07a=_0x3e74[_0x2d2e30];return _0x3fd07a;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index f535b0c..bdc2385 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 _0x1d54=['report_member','membername_interface','membername','interface','lodash','../../config/logger','api','moment','bluebird','path','rimraf','./memberReport.attributes','exports','MemberReport'];(function(_0xc72f64,_0x1e8036){var _0x7d9683=function(_0x5a90ea){while(--_0x5a90ea){_0xc72f64['push'](_0xc72f64['shift']());}};_0x7d9683(++_0x1e8036);}(_0x1d54,0x100));var _0x41d5=function(_0x2f87cd,_0xcaf299){_0x2f87cd=_0x2f87cd-0x0;var _0x5d7eda=_0x1d54[_0x2f87cd];return _0x5d7eda;};'use strict';var _=require(_0x41d5('0x0'));var util=require('util');var logger=require(_0x41d5('0x1'))(_0x41d5('0x2'));var moment=require(_0x41d5('0x3'));var BPromise=require(_0x41d5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x41d5('0x5'));var rimraf=require(_0x41d5('0x6'));var config=require('../../config/environment');var attributes=require(_0x41d5('0x7'));module[_0x41d5('0x8')]=function(_0x9e48ad,_0x44442b){return _0x9e48ad['define'](_0x41d5('0x9'),attributes,{'tableName':_0x41d5('0xa'),'paranoid':![],'indexes':[{'name':_0x41d5('0xb'),'fields':[_0x41d5('0xc'),_0x41d5('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7d53=['bluebird','request-promise','path','../../config/environment','exports','define','MemberReport','membername_interface','interface','lodash','util','../../config/logger'];(function(_0x31e08b,_0x4006f5){var _0x4a2a9b=function(_0xb62094){while(--_0xb62094){_0x31e08b['push'](_0x31e08b['shift']());}};_0x4a2a9b(++_0x4006f5);}(_0x7d53,0x1b9));var _0x37d5=function(_0x4655b8,_0x3a83d3){_0x4655b8=_0x4655b8-0x0;var _0x1d2b49=_0x7d53[_0x4655b8];return _0x1d2b49;};'use strict';var _=require(_0x37d5('0x0'));var util=require(_0x37d5('0x1'));var logger=require(_0x37d5('0x2'))('api');var moment=require('moment');var BPromise=require(_0x37d5('0x3'));var rp=require(_0x37d5('0x4'));var fs=require('fs');var path=require(_0x37d5('0x5'));var rimraf=require('rimraf');var config=require(_0x37d5('0x6'));var attributes=require('./memberReport.attributes');module[_0x37d5('0x7')]=function(_0x52d44c,_0x54ed8f){return _0x52d44c[_0x37d5('0x8')](_0x37d5('0x9'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x37d5('0xa'),'fields':['membername',_0x37d5('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 01d0189..d602606 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 _0x5db2=['limit','include','map','model','attributes','then','CreateMemberReport','create','UpdateMemberReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where'];(function(_0x46af94,_0x5c3164){var _0x5e9b6e=function(_0x4922fc){while(--_0x4922fc){_0x46af94['push'](_0x46af94['shift']());}};_0x5e9b6e(++_0x5c3164);}(_0x5db2,0xf3));var _0x25db=function(_0x5948f1,_0x279b12){_0x5948f1=_0x5948f1-0x0;var _0x572225=_0x5db2[_0x5948f1];return _0x572225;};'use strict';var _=require(_0x25db('0x0'));var util=require(_0x25db('0x1'));var moment=require(_0x25db('0x2'));var BPromise=require('bluebird');var rs=require(_0x25db('0x3'));var fs=require('fs');var Redis=require(_0x25db('0x4'));var db=require(_0x25db('0x5'))['db'];var utils=require(_0x25db('0x6'));var logger=require(_0x25db('0x7'))(_0x25db('0x8'));var config=require(_0x25db('0x9'));var jayson=require(_0x25db('0xa'));var client=jayson[_0x25db('0xb')][_0x25db('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x497759,_0x3573fa,_0x310762){return new BPromise(function(_0x40f7eb,_0x2ad688){return client['request'](_0x497759,_0x310762)['then'](function(_0x2e6018){logger[_0x25db('0xd')](_0x25db('0xe'),_0x3573fa,_0x25db('0xf'));logger[_0x25db('0x10')](_0x25db('0x11'),_0x3573fa,_0x25db('0xf'),JSON[_0x25db('0x12')](_0x2e6018));if(_0x2e6018[_0x25db('0x13')]){if(_0x2e6018[_0x25db('0x13')][_0x25db('0x14')]===0x1f4){logger[_0x25db('0x13')]('MemberReport,\x20%s,\x20%s',_0x3573fa,_0x2e6018[_0x25db('0x13')][_0x25db('0x15')]);return _0x2ad688(_0x2e6018[_0x25db('0x13')]['message']);}logger[_0x25db('0x13')](_0x25db('0xe'),_0x3573fa,_0x2e6018[_0x25db('0x13')][_0x25db('0x15')]);return _0x40f7eb(_0x2e6018[_0x25db('0x13')][_0x25db('0x15')]);}else{logger[_0x25db('0xd')](_0x25db('0xe'),_0x3573fa,_0x25db('0xf'));_0x40f7eb(_0x2e6018[_0x25db('0x16')]['message']);}})[_0x25db('0x17')](function(_0x58fccf){logger['error'](_0x25db('0xe'),_0x3573fa,_0x58fccf);_0x2ad688(_0x58fccf);});});}exports[_0x25db('0x18')]=function(_0x2b018b){var _0x31399b=this;return new Promise(function(_0x187fbc,_0x134bc8){return db[_0x25db('0x19')][_0x25db('0x1a')]({'raw':_0x2b018b[_0x25db('0x1b')]?_0x2b018b[_0x25db('0x1b')][_0x25db('0x1c')]===undefined?!![]:![]:!![],'where':_0x2b018b[_0x25db('0x1b')]?_0x2b018b[_0x25db('0x1b')][_0x25db('0x1d')]||null:null,'attributes':_0x2b018b[_0x25db('0x1b')]?_0x2b018b['options']['attributes']||null:null,'limit':_0x2b018b['options']?_0x2b018b[_0x25db('0x1b')][_0x25db('0x1e')]||null:null,'include':_0x2b018b['options']?_0x2b018b[_0x25db('0x1b')][_0x25db('0x1f')]?_[_0x25db('0x20')](_0x2b018b[_0x25db('0x1b')]['include'],function(_0x3f9129){return{'model':db[_0x3f9129[_0x25db('0x21')]],'as':_0x3f9129['as'],'attributes':_0x3f9129[_0x25db('0x22')],'include':_0x3f9129[_0x25db('0x1f')]?_[_0x25db('0x20')](_0x3f9129[_0x25db('0x1f')],function(_0x367833){return{'model':db[_0x367833['model']],'as':_0x367833['as'],'attributes':_0x367833[_0x25db('0x22')],'include':_0x367833[_0x25db('0x1f')]?_['map'](_0x367833[_0x25db('0x1f')],function(_0x13d989){return{'model':db[_0x13d989[_0x25db('0x21')]],'as':_0x13d989['as'],'attributes':_0x13d989[_0x25db('0x22')]};}):[]};}):[]};}):[]:[]})[_0x25db('0x23')](function(_0x196f9d){logger[_0x25db('0xd')](_0x25db('0x18'),_0x2b018b);logger[_0x25db('0x10')]('GetMemberReport',_0x2b018b,JSON[_0x25db('0x12')](_0x196f9d));_0x187fbc(_0x196f9d);})['catch'](function(_0x33eb6c){logger[_0x25db('0x13')](_0x25db('0x18'),_0x33eb6c[_0x25db('0x15')],_0x2b018b);_0x134bc8(_0x31399b[_0x25db('0x13')](0x1f4,_0x33eb6c[_0x25db('0x15')]));});});};exports[_0x25db('0x24')]=function(_0x449529){var _0x510f03=this;return new Promise(function(_0x2e912a,_0x15c163){return db['MemberReport'][_0x25db('0x25')](_0x449529['body'],{'raw':_0x449529[_0x25db('0x1b')]?_0x449529[_0x25db('0x1b')][_0x25db('0x1c')]===undefined?!![]:![]:!![]})[_0x25db('0x23')](function(_0x180d26){logger[_0x25db('0xd')](_0x25db('0x24'),_0x449529);logger[_0x25db('0x10')](_0x25db('0x24'),_0x449529,JSON['stringify'](_0x180d26));_0x2e912a(_0x180d26);})[_0x25db('0x17')](function(_0x2b4a9c){logger[_0x25db('0x13')](_0x25db('0x24'),_0x2b4a9c['message'],_0x449529);_0x15c163(_0x510f03['error'](0x1f4,_0x2b4a9c[_0x25db('0x15')]));});});};exports[_0x25db('0x26')]=function(_0x21bbdd){var _0x234a5f=this;return new Promise(function(_0xc5b6d7,_0x1e9802){return db[_0x25db('0x19')]['update'](_0x21bbdd['body'],{'raw':_0x21bbdd[_0x25db('0x1b')]?_0x21bbdd[_0x25db('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21bbdd[_0x25db('0x1b')]?_0x21bbdd[_0x25db('0x1b')]['where']||null:null,'attributes':_0x21bbdd[_0x25db('0x1b')]?_0x21bbdd[_0x25db('0x1b')][_0x25db('0x22')]||null:null,'limit':_0x21bbdd[_0x25db('0x1b')]?_0x21bbdd[_0x25db('0x1b')][_0x25db('0x1e')]||null:null})[_0x25db('0x23')](function(_0x1b621e){logger[_0x25db('0xd')](_0x25db('0x26'),_0x21bbdd);logger[_0x25db('0x10')](_0x25db('0x26'),_0x21bbdd,JSON['stringify'](_0x1b621e));_0xc5b6d7(_0x1b621e);})[_0x25db('0x17')](function(_0x57612a){logger[_0x25db('0x13')](_0x25db('0x26'),_0x57612a[_0x25db('0x15')],_0x21bbdd);_0x1e9802(_0x234a5f[_0x25db('0x13')](0x1f4,_0x57612a[_0x25db('0x15')]));});});}; \ No newline at end of file +var _0x1298=['raw','options','where','attributes','limit','map','include','model','info','GetMemberReport','catch','CreateMemberReport','create','then','stringify','update','body','UpdateMemberReport','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','request\x20sent','debug','error','MemberReport,\x20%s,\x20%s','message','MemberReport','findAll'];(function(_0x2b0b72,_0x3b088c){var _0x1267b5=function(_0x38d105){while(--_0x38d105){_0x2b0b72['push'](_0x2b0b72['shift']());}};_0x1267b5(++_0x3b088c);}(_0x1298,0x19e));var _0x8129=function(_0x56a37f,_0x5c0340){_0x56a37f=_0x56a37f-0x0;var _0x15b6bb=_0x1298[_0x56a37f];return _0x15b6bb;};'use strict';var _=require('lodash');var util=require(_0x8129('0x0'));var moment=require('moment');var BPromise=require(_0x8129('0x1'));var rs=require(_0x8129('0x2'));var fs=require('fs');var Redis=require(_0x8129('0x3'));var db=require(_0x8129('0x4'))['db'];var utils=require(_0x8129('0x5'));var logger=require(_0x8129('0x6'))(_0x8129('0x7'));var config=require('../../config/environment');var jayson=require(_0x8129('0x8'));var client=jayson[_0x8129('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f0a40,_0x1cd6a6,_0x2d07d5){return new BPromise(function(_0x3ff6e0,_0x3d94f8){return client[_0x8129('0xa')](_0x4f0a40,_0x2d07d5)['then'](function(_0x5a0545){logger['info']('MemberReport,\x20%s,\x20%s',_0x1cd6a6,_0x8129('0xb'));logger[_0x8129('0xc')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x1cd6a6,_0x8129('0xb'),JSON['stringify'](_0x5a0545));if(_0x5a0545['error']){if(_0x5a0545[_0x8129('0xd')]['code']===0x1f4){logger['error'](_0x8129('0xe'),_0x1cd6a6,_0x5a0545[_0x8129('0xd')][_0x8129('0xf')]);return _0x3d94f8(_0x5a0545[_0x8129('0xd')][_0x8129('0xf')]);}logger[_0x8129('0xd')]('MemberReport,\x20%s,\x20%s',_0x1cd6a6,_0x5a0545['error'][_0x8129('0xf')]);return _0x3ff6e0(_0x5a0545['error'][_0x8129('0xf')]);}else{logger['info'](_0x8129('0xe'),_0x1cd6a6,_0x8129('0xb'));_0x3ff6e0(_0x5a0545['result'][_0x8129('0xf')]);}})['catch'](function(_0x3b15ac){logger[_0x8129('0xd')](_0x8129('0xe'),_0x1cd6a6,_0x3b15ac);_0x3d94f8(_0x3b15ac);});});}exports['GetMemberReport']=function(_0x17e742){var _0x1ec668=this;return new Promise(function(_0x21c6c2,_0x1a5940){return db[_0x8129('0x10')][_0x8129('0x11')]({'raw':_0x17e742['options']?_0x17e742['options'][_0x8129('0x12')]===undefined?!![]:![]:!![],'where':_0x17e742['options']?_0x17e742[_0x8129('0x13')][_0x8129('0x14')]||null:null,'attributes':_0x17e742[_0x8129('0x13')]?_0x17e742[_0x8129('0x13')][_0x8129('0x15')]||null:null,'limit':_0x17e742[_0x8129('0x13')]?_0x17e742[_0x8129('0x13')][_0x8129('0x16')]||null:null,'include':_0x17e742[_0x8129('0x13')]?_0x17e742[_0x8129('0x13')]['include']?_[_0x8129('0x17')](_0x17e742[_0x8129('0x13')][_0x8129('0x18')],function(_0x322f63){return{'model':db[_0x322f63['model']],'as':_0x322f63['as'],'attributes':_0x322f63[_0x8129('0x15')],'include':_0x322f63[_0x8129('0x18')]?_['map'](_0x322f63[_0x8129('0x18')],function(_0x58a641){return{'model':db[_0x58a641[_0x8129('0x19')]],'as':_0x58a641['as'],'attributes':_0x58a641[_0x8129('0x15')],'include':_0x58a641[_0x8129('0x18')]?_['map'](_0x58a641[_0x8129('0x18')],function(_0x3a37c0){return{'model':db[_0x3a37c0[_0x8129('0x19')]],'as':_0x3a37c0['as'],'attributes':_0x3a37c0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e4512){logger[_0x8129('0x1a')]('GetMemberReport',_0x17e742);logger[_0x8129('0xc')](_0x8129('0x1b'),_0x17e742,JSON['stringify'](_0x2e4512));_0x21c6c2(_0x2e4512);})[_0x8129('0x1c')](function(_0x1956ae){logger['error'](_0x8129('0x1b'),_0x1956ae[_0x8129('0xf')],_0x17e742);_0x1a5940(_0x1ec668[_0x8129('0xd')](0x1f4,_0x1956ae[_0x8129('0xf')]));});});};exports[_0x8129('0x1d')]=function(_0x1e48b8){var _0x3708e3=this;return new Promise(function(_0x403d04,_0x2a6f89){return db[_0x8129('0x10')][_0x8129('0x1e')](_0x1e48b8['body'],{'raw':_0x1e48b8['options']?_0x1e48b8[_0x8129('0x13')][_0x8129('0x12')]===undefined?!![]:![]:!![]})[_0x8129('0x1f')](function(_0x3d55d3){logger['info'](_0x8129('0x1d'),_0x1e48b8);logger[_0x8129('0xc')](_0x8129('0x1d'),_0x1e48b8,JSON[_0x8129('0x20')](_0x3d55d3));_0x403d04(_0x3d55d3);})[_0x8129('0x1c')](function(_0x4cbd50){logger['error'](_0x8129('0x1d'),_0x4cbd50[_0x8129('0xf')],_0x1e48b8);_0x2a6f89(_0x3708e3[_0x8129('0xd')](0x1f4,_0x4cbd50[_0x8129('0xf')]));});});};exports['UpdateMemberReport']=function(_0x54fd3c){var _0x1d0632=this;return new Promise(function(_0x4fadbc,_0x23d0d8){return db[_0x8129('0x10')][_0x8129('0x21')](_0x54fd3c[_0x8129('0x22')],{'raw':_0x54fd3c[_0x8129('0x13')]?_0x54fd3c[_0x8129('0x13')][_0x8129('0x12')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54fd3c[_0x8129('0x13')]?_0x54fd3c['options'][_0x8129('0x14')]||null:null,'attributes':_0x54fd3c[_0x8129('0x13')]?_0x54fd3c['options']['attributes']||null:null,'limit':_0x54fd3c['options']?_0x54fd3c[_0x8129('0x13')][_0x8129('0x16')]||null:null})[_0x8129('0x1f')](function(_0x55d7af){logger[_0x8129('0x1a')]('UpdateMemberReport',_0x54fd3c);logger[_0x8129('0xc')](_0x8129('0x23'),_0x54fd3c,JSON[_0x8129('0x20')](_0x55d7af));_0x4fadbc(_0x55d7af);})[_0x8129('0x1c')](function(_0x8ecd42){logger['error'](_0x8129('0x23'),_0x8ecd42[_0x8129('0xf')],_0x54fd3c);_0x23d0d8(_0x1d0632[_0x8129('0xd')](0x1f4,_0x8ecd42[_0x8129('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index ae12273..8f46b70 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 _0x243f=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./migration.controller','get','index'];(function(_0x3412e0,_0x5c4e4f){var _0x479b68=function(_0x23028d){while(--_0x23028d){_0x3412e0['push'](_0x3412e0['shift']());}};_0x479b68(++_0x5c4e4f);}(_0x243f,0x1eb));var _0xf243=function(_0x438434,_0x36f21f){_0x438434=_0x438434-0x0;var _0x3b97c9=_0x243f[_0x438434];return _0x3b97c9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf243('0x0'));var timeout=require(_0xf243('0x1'));var express=require(_0xf243('0x2'));var router=express[_0xf243('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf243('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf243('0x5'));var controller=require(_0xf243('0x6'));router[_0xf243('0x7')]('/',controller[_0xf243('0x8')]);module[_0xf243('0x9')]=router; \ No newline at end of file +var _0x8bbf=['./migration.controller','index','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2b3c9d,_0x1c8c0c){var _0x4b8037=function(_0x225327){while(--_0x225327){_0x2b3c9d['push'](_0x2b3c9d['shift']());}};_0x4b8037(++_0x1c8c0c);}(_0x8bbf,0x184));var _0xf8bb=function(_0x45f4a3,_0x509283){_0x45f4a3=_0x45f4a3-0x0;var _0x2d2bc1=_0x8bbf[_0x45f4a3];return _0x2d2bc1;};'use strict';var multer=require(_0xf8bb('0x0'));var util=require(_0xf8bb('0x1'));var path=require(_0xf8bb('0x2'));var timeout=require(_0xf8bb('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf8bb('0x4'));var auth=require(_0xf8bb('0x5'));var interaction=require(_0xf8bb('0x6'));var config=require(_0xf8bb('0x7'));var controller=require(_0xf8bb('0x8'));router['get']('/',controller[_0xf8bb('0x9')]);module[_0xf8bb('0xa')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 867c0d4..d5f720a 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 _0x8e71=['sequelize','exports','version'];(function(_0x2b4c1c,_0x5677e9){var _0x29296b=function(_0x4ab456){while(--_0x4ab456){_0x2b4c1c['push'](_0x2b4c1c['shift']());}};_0x29296b(++_0x5677e9);}(_0x8e71,0xcf));var _0x18e7=function(_0x3972dd,_0x298e3f){_0x3972dd=_0x3972dd-0x0;var _0x3a29c8=_0x8e71[_0x3972dd];return _0x3a29c8;};'use strict';var Sequelize=require(_0x18e7('0x0'));module[_0x18e7('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x18e7('0x2')}}; \ No newline at end of file +var _0x8e09=['version','sequelize','exports','STRING'];(function(_0x2132a3,_0x4639e9){var _0x21890c=function(_0x34b73d){while(--_0x34b73d){_0x2132a3['push'](_0x2132a3['shift']());}};_0x21890c(++_0x4639e9);}(_0x8e09,0x145));var _0x98e0=function(_0x15b399,_0x59db1a){_0x15b399=_0x15b399-0x0;var _0x199f2d=_0x8e09[_0x15b399];return _0x199f2d;};'use strict';var Sequelize=require(_0x98e0('0x0'));module[_0x98e0('0x1')]={'version':{'type':Sequelize[_0x98e0('0x2')],'unique':_0x98e0('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 2e61f74..902b508 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 _0xe581=['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','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Migration','includeAll','include','findAll','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','lodash','squel','crypto','desk.js','to-csv','querystring'];(function(_0x3f3f40,_0x4e745f){var _0x32c366=function(_0x343f6a){while(--_0x343f6a){_0x3f3f40['push'](_0x3f3f40['shift']());}};_0x32c366(++_0x4e745f);}(_0xe581,0x80));var _0x1e58=function(_0x4fb5dd,_0x199b08){_0x4fb5dd=_0x4fb5dd-0x0;var _0x4b5728=_0xe581[_0x4fb5dd];return _0x4b5728;};'use strict';var emlformat=require(_0x1e58('0x0'));var rimraf=require(_0x1e58('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1e58('0x2'));var rp=require(_0x1e58('0x3'));var moment=require(_0x1e58('0x4'));var BPromise=require(_0x1e58('0x5'));var Mustache=require(_0x1e58('0x6'));var util=require(_0x1e58('0x7'));var path=require('path');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(_0x1e58('0x8'));var squel=require(_0x1e58('0x9'));var crypto=require(_0x1e58('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1e58('0xb'));var toCsv=require(_0x1e58('0xc'));var querystring=require(_0x1e58('0xd'));var Papa=require('papaparse');var Redis=require(_0x1e58('0xe'));var authService=require(_0x1e58('0xf'));var qs=require(_0x1e58('0x10'));var as=require(_0x1e58('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e58('0x12'))(_0x1e58('0x13'));var utils=require(_0x1e58('0x14'));var config=require(_0x1e58('0x15'));var licenseUtil=require(_0x1e58('0x16'));var db=require(_0x1e58('0x17'))['db'];function respondWithStatusCode(_0x51a119,_0x10d9ab){_0x10d9ab=_0x10d9ab||0xcc;return function(_0x45de32){if(_0x45de32){return _0x51a119[_0x1e58('0x18')](_0x10d9ab);}return _0x51a119[_0x1e58('0x19')](_0x10d9ab)[_0x1e58('0x1a')]();};}function respondWithResult(_0x2346c7,_0x52a763){_0x52a763=_0x52a763||0xc8;return function(_0x5714bd){if(_0x5714bd){return _0x2346c7['status'](_0x52a763)[_0x1e58('0x1b')](_0x5714bd);}};}function respondWithFilteredResult(_0x3d01bc,_0x4e68dd){return function(_0x4b2427){if(_0x4b2427){var _0x39fb73=typeof _0x4e68dd['offset']===_0x1e58('0x1c')&&typeof _0x4e68dd[_0x1e58('0x1d')]==='undefined';var _0x1579c3=_0x4b2427[_0x1e58('0x1e')];var _0x80fa62=_0x39fb73?0x0:_0x4e68dd[_0x1e58('0x1f')];var _0x28b32b=_0x39fb73?_0x4b2427['count']:_0x4e68dd[_0x1e58('0x1f')]+_0x4e68dd[_0x1e58('0x1d')];var _0x1e312d;if(_0x28b32b>=_0x1579c3){_0x28b32b=_0x1579c3;_0x1e312d=0xc8;}else{_0x1e312d=0xce;}_0x3d01bc[_0x1e58('0x19')](_0x1e312d);return _0x3d01bc[_0x1e58('0x20')](_0x1e58('0x21'),_0x80fa62+'-'+_0x28b32b+'/'+_0x1579c3)['json'](_0x4b2427);}return null;};}function patchUpdates(_0x22ca8c){return function(_0x125c00){try{jsonpatch[_0x1e58('0x22')](_0x125c00,_0x22ca8c,!![]);}catch(_0x1ced90){return BPromise[_0x1e58('0x23')](_0x1ced90);}return _0x125c00[_0x1e58('0x24')]();};}function saveUpdates(_0x3525af,_0x1e6738){return function(_0x577201){if(_0x577201){return _0x577201['update'](_0x3525af)[_0x1e58('0x25')](function(_0x123ea1){return _0x123ea1;});}return null;};}function removeEntity(_0x86dddf,_0x559339){return function(_0x37a415){if(_0x37a415){return _0x37a415[_0x1e58('0x26')]()[_0x1e58('0x25')](function(){_0x86dddf['status'](0xcc)[_0x1e58('0x1a')]();});}};}function handleEntityNotFound(_0x1ff274,_0x523c28){return function(_0x5664a3){if(!_0x5664a3){_0x1ff274[_0x1e58('0x18')](0x194);}return _0x5664a3;};}function handleError(_0x1cd579,_0x662abe){_0x662abe=_0x662abe||0x1f4;return function(_0x4770ab){logger[_0x1e58('0x27')](_0x4770ab[_0x1e58('0x28')]);if(_0x4770ab['name']){delete _0x4770ab[_0x1e58('0x29')];}_0x1cd579[_0x1e58('0x19')](_0x662abe)[_0x1e58('0x2a')](_0x4770ab);};}exports[_0x1e58('0x2b')]=function(_0x4cb076,_0x1fa681){var _0x3e9af2={},_0x40478c={},_0x1720c0={'count':0x0,'rows':[]};var _0x228f5b=_[_0x1e58('0x2c')](db['Migration'][_0x1e58('0x2d')],function(_0x1fa2fc){return{'name':_0x1fa2fc[_0x1e58('0x2e')],'type':_0x1fa2fc[_0x1e58('0x2f')][_0x1e58('0x30')]};});_0x40478c[_0x1e58('0x31')]=_[_0x1e58('0x2c')](_0x228f5b,'name');_0x40478c[_0x1e58('0x32')]=_[_0x1e58('0x33')](_0x4cb076[_0x1e58('0x32')]);_0x40478c[_0x1e58('0x34')]=_['intersection'](_0x40478c[_0x1e58('0x31')],_0x40478c[_0x1e58('0x32')]);_0x3e9af2['attributes']=_['intersection'](_0x40478c[_0x1e58('0x31')],qs['fields'](_0x4cb076[_0x1e58('0x32')][_0x1e58('0x35')]));_0x3e9af2[_0x1e58('0x36')]=_0x3e9af2['attributes'][_0x1e58('0x37')]?_0x3e9af2[_0x1e58('0x36')]:_0x40478c[_0x1e58('0x31')];if(!_0x4cb076[_0x1e58('0x32')][_0x1e58('0x38')](_0x1e58('0x39'))){_0x3e9af2['limit']=qs[_0x1e58('0x1d')](_0x4cb076[_0x1e58('0x32')][_0x1e58('0x1d')]);_0x3e9af2[_0x1e58('0x1f')]=qs[_0x1e58('0x1f')](_0x4cb076['query']['offset']);}_0x3e9af2[_0x1e58('0x3a')]=qs[_0x1e58('0x3b')](_0x4cb076[_0x1e58('0x32')][_0x1e58('0x3b')]);_0x3e9af2[_0x1e58('0x3c')]=qs[_0x1e58('0x34')](_[_0x1e58('0x3d')](_0x4cb076[_0x1e58('0x32')],_0x40478c[_0x1e58('0x34')]),_0x228f5b);if(_0x4cb076['query'][_0x1e58('0x3e')]){_0x3e9af2[_0x1e58('0x3c')]=_[_0x1e58('0x3f')](_0x3e9af2[_0x1e58('0x3c')],{'$or':_[_0x1e58('0x2c')](_0x228f5b,function(_0x1503f3){if(_0x1503f3[_0x1e58('0x2f')]!==_0x1e58('0x40')){var _0x110e21={};_0x110e21[_0x1503f3[_0x1e58('0x29')]]={'$like':'%'+_0x4cb076['query'][_0x1e58('0x3e')]+'%'};return _0x110e21;}})});}_0x3e9af2=_[_0x1e58('0x3f')]({},_0x3e9af2,_0x4cb076[_0x1e58('0x41')]);var _0x2b76fd={'where':_0x3e9af2[_0x1e58('0x3c')]};return db[_0x1e58('0x42')][_0x1e58('0x1e')](_0x2b76fd)['then'](function(_0x2f120a){_0x1720c0[_0x1e58('0x1e')]=_0x2f120a;if(_0x4cb076[_0x1e58('0x32')][_0x1e58('0x43')]){_0x3e9af2[_0x1e58('0x44')]=[{'all':!![]}];}return db[_0x1e58('0x42')][_0x1e58('0x45')](_0x3e9af2);})[_0x1e58('0x25')](function(_0xd97da3){_0x1720c0['rows']=_0xd97da3;return _0x1720c0;})[_0x1e58('0x25')](respondWithFilteredResult(_0x1fa681,_0x3e9af2))[_0x1e58('0x46')](handleError(_0x1fa681,null));}; \ No newline at end of file +var _0x2944=['moment','bluebird','mustache','util','path','sox','ejs','fs-extra','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','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','pick','filter','where','VIRTUAL','merge','options','findAll','rows','catch','eml-format','zip-dir'];(function(_0x3ce2c4,_0x4544c1){var _0x4047c1=function(_0x3fece6){while(--_0x3fece6){_0x3ce2c4['push'](_0x3ce2c4['shift']());}};_0x4047c1(++_0x4544c1);}(_0x2944,0x88));var _0x4294=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x2944[_0x1a36a5];return _0x746243;};'use strict';var emlformat=require(_0x4294('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4294('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4294('0x2'));var BPromise=require(_0x4294('0x3'));var Mustache=require(_0x4294('0x4'));var util=require(_0x4294('0x5'));var path=require(_0x4294('0x6'));var sox=require(_0x4294('0x7'));var csv=require('to-csv');var ejs=require(_0x4294('0x8'));var fs=require('fs');var fs_extra=require(_0x4294('0x9'));var _=require('lodash');var squel=require(_0x4294('0xa'));var crypto=require(_0x4294('0xb'));var jsforce=require(_0x4294('0xc'));var deskjs=require(_0x4294('0xd'));var toCsv=require(_0x4294('0xe'));var querystring=require(_0x4294('0xf'));var Papa=require(_0x4294('0x10'));var Redis=require(_0x4294('0x11'));var authService=require(_0x4294('0x12'));var qs=require(_0x4294('0x13'));var as=require(_0x4294('0x14'));var hardwareService=require(_0x4294('0x15'));var logger=require('../../config/logger')(_0x4294('0x16'));var utils=require(_0x4294('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4294('0x18'));var db=require(_0x4294('0x19'))['db'];function respondWithStatusCode(_0x1b14b8,_0x32318a){_0x32318a=_0x32318a||0xcc;return function(_0x1ce829){if(_0x1ce829){return _0x1b14b8[_0x4294('0x1a')](_0x32318a);}return _0x1b14b8[_0x4294('0x1b')](_0x32318a)[_0x4294('0x1c')]();};}function respondWithResult(_0xf8207c,_0x30b1db){_0x30b1db=_0x30b1db||0xc8;return function(_0x11b767){if(_0x11b767){return _0xf8207c[_0x4294('0x1b')](_0x30b1db)[_0x4294('0x1d')](_0x11b767);}};}function respondWithFilteredResult(_0x133800,_0x1957ea){return function(_0x4f6d49){if(_0x4f6d49){var _0x39f4e9=typeof _0x1957ea['offset']==='undefined'&&typeof _0x1957ea[_0x4294('0x1e')]===_0x4294('0x1f');var _0xe19804=_0x4f6d49[_0x4294('0x20')];var _0x362d5e=_0x39f4e9?0x0:_0x1957ea[_0x4294('0x21')];var _0xa814ad=_0x39f4e9?_0x4f6d49[_0x4294('0x20')]:_0x1957ea[_0x4294('0x21')]+_0x1957ea[_0x4294('0x1e')];var _0x82a63d;if(_0xa814ad>=_0xe19804){_0xa814ad=_0xe19804;_0x82a63d=0xc8;}else{_0x82a63d=0xce;}_0x133800['status'](_0x82a63d);return _0x133800[_0x4294('0x22')](_0x4294('0x23'),_0x362d5e+'-'+_0xa814ad+'/'+_0xe19804)['json'](_0x4f6d49);}return null;};}function patchUpdates(_0x40df99){return function(_0x48a49c){try{jsonpatch[_0x4294('0x24')](_0x48a49c,_0x40df99,!![]);}catch(_0x3e9d43){return BPromise['reject'](_0x3e9d43);}return _0x48a49c[_0x4294('0x25')]();};}function saveUpdates(_0x45b4d2,_0x3e28ce){return function(_0x527e0d){if(_0x527e0d){return _0x527e0d[_0x4294('0x26')](_0x45b4d2)[_0x4294('0x27')](function(_0x24ce29){return _0x24ce29;});}return null;};}function removeEntity(_0x595457,_0x3968eb){return function(_0x5a862e){if(_0x5a862e){return _0x5a862e[_0x4294('0x28')]()[_0x4294('0x27')](function(){_0x595457[_0x4294('0x1b')](0xcc)[_0x4294('0x1c')]();});}};}function handleEntityNotFound(_0x35be8d,_0x3fe561){return function(_0xc1e24f){if(!_0xc1e24f){_0x35be8d[_0x4294('0x1a')](0x194);}return _0xc1e24f;};}function handleError(_0x160980,_0x4f9c0e){_0x4f9c0e=_0x4f9c0e||0x1f4;return function(_0x1dc23c){logger[_0x4294('0x29')](_0x1dc23c['stack']);if(_0x1dc23c[_0x4294('0x2a')]){delete _0x1dc23c[_0x4294('0x2a')];}_0x160980[_0x4294('0x1b')](_0x4f9c0e)[_0x4294('0x2b')](_0x1dc23c);};}exports[_0x4294('0x2c')]=function(_0x39ee01,_0x11fc44){var _0x4ee3c3={},_0x35290e={},_0x5ef520={'count':0x0,'rows':[]};var _0x223238=_[_0x4294('0x2d')](db['Migration'][_0x4294('0x2e')],function(_0x3a9afb){return{'name':_0x3a9afb[_0x4294('0x2f')],'type':_0x3a9afb[_0x4294('0x30')][_0x4294('0x31')]};});_0x35290e[_0x4294('0x32')]=_['map'](_0x223238,_0x4294('0x2a'));_0x35290e[_0x4294('0x33')]=_[_0x4294('0x34')](_0x39ee01[_0x4294('0x33')]);_0x35290e[_0x4294('0x35')]=_[_0x4294('0x36')](_0x35290e[_0x4294('0x32')],_0x35290e['query']);_0x4ee3c3['attributes']=_[_0x4294('0x36')](_0x35290e[_0x4294('0x32')],qs[_0x4294('0x37')](_0x39ee01['query'][_0x4294('0x37')]));_0x4ee3c3['attributes']=_0x4ee3c3[_0x4294('0x38')][_0x4294('0x39')]?_0x4ee3c3[_0x4294('0x38')]:_0x35290e['model'];if(!_0x39ee01['query'][_0x4294('0x3a')](_0x4294('0x3b'))){_0x4ee3c3[_0x4294('0x1e')]=qs[_0x4294('0x1e')](_0x39ee01[_0x4294('0x33')][_0x4294('0x1e')]);_0x4ee3c3[_0x4294('0x21')]=qs[_0x4294('0x21')](_0x39ee01[_0x4294('0x33')][_0x4294('0x21')]);}_0x4ee3c3['order']=qs['sort'](_0x39ee01[_0x4294('0x33')]['sort']);_0x4ee3c3['where']=qs[_0x4294('0x35')](_[_0x4294('0x3c')](_0x39ee01['query'],_0x35290e[_0x4294('0x35')]),_0x223238);if(_0x39ee01[_0x4294('0x33')][_0x4294('0x3d')]){_0x4ee3c3[_0x4294('0x3e')]=_['merge'](_0x4ee3c3['where'],{'$or':_[_0x4294('0x2d')](_0x223238,function(_0x421b1b){if(_0x421b1b[_0x4294('0x30')]!==_0x4294('0x3f')){var _0x212b76={};_0x212b76[_0x421b1b['name']]={'$like':'%'+_0x39ee01['query'][_0x4294('0x3d')]+'%'};return _0x212b76;}})});}_0x4ee3c3=_[_0x4294('0x40')]({},_0x4ee3c3,_0x39ee01[_0x4294('0x41')]);var _0x161c0f={'where':_0x4ee3c3['where']};return db['Migration']['count'](_0x161c0f)[_0x4294('0x27')](function(_0x33493f){_0x5ef520['count']=_0x33493f;if(_0x39ee01['query']['includeAll']){_0x4ee3c3['include']=[{'all':!![]}];}return db['Migration'][_0x4294('0x42')](_0x4ee3c3);})[_0x4294('0x27')](function(_0x20539b){_0x5ef520[_0x4294('0x43')]=_0x20539b;return _0x5ef520;})[_0x4294('0x27')](respondWithFilteredResult(_0x11fc44,_0x4ee3c3))[_0x4294('0x44')](handleError(_0x11fc44,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index bde20d0..529cea9 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 _0xbd49=['exports','define','Migration','migrations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./migration.attributes'];(function(_0x8ba08d,_0x5cc984){var _0x29622d=function(_0x534023){while(--_0x534023){_0x8ba08d['push'](_0x8ba08d['shift']());}};_0x29622d(++_0x5cc984);}(_0xbd49,0x1d8));var _0x9bd4=function(_0x89ec18,_0x267362){_0x89ec18=_0x89ec18-0x0;var _0x1623a1=_0xbd49[_0x89ec18];return _0x1623a1;};'use strict';var _=require(_0x9bd4('0x0'));var util=require(_0x9bd4('0x1'));var logger=require(_0x9bd4('0x2'))('api');var moment=require(_0x9bd4('0x3'));var BPromise=require(_0x9bd4('0x4'));var rp=require(_0x9bd4('0x5'));var fs=require('fs');var path=require(_0x9bd4('0x6'));var rimraf=require('rimraf');var config=require(_0x9bd4('0x7'));var attributes=require(_0x9bd4('0x8'));module[_0x9bd4('0x9')]=function(_0xffeac5,_0x6b3e90){return _0xffeac5[_0x9bd4('0xa')](_0x9bd4('0xb'),attributes,{'tableName':_0x9bd4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d3d=['Migration','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x1eb6c6,_0x1b562b){var _0x2d863d=function(_0x45024b){while(--_0x45024b){_0x1eb6c6['push'](_0x1eb6c6['shift']());}};_0x2d863d(++_0x1b562b);}(_0x0d3d,0x1b9));var _0xd0d3=function(_0x4e3491,_0x2b5c93){_0x4e3491=_0x4e3491-0x0;var _0x1ab44e=_0x0d3d[_0x4e3491];return _0x1ab44e;};'use strict';var _=require(_0xd0d3('0x0'));var util=require('util');var logger=require(_0xd0d3('0x1'))(_0xd0d3('0x2'));var moment=require(_0xd0d3('0x3'));var BPromise=require(_0xd0d3('0x4'));var rp=require(_0xd0d3('0x5'));var fs=require('fs');var path=require(_0xd0d3('0x6'));var rimraf=require(_0xd0d3('0x7'));var config=require(_0xd0d3('0x8'));var attributes=require('./migration.attributes');module['exports']=function(_0x5d2950,_0x5df4da){return _0x5d2950[_0xd0d3('0x9')](_0xd0d3('0xa'),attributes,{'tableName':'migrations','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 4309a4e..0e969d0 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 _0xad53=['then','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x49c8a0,_0x1a87dc){var _0x2a1b5a=function(_0x422f5a){while(--_0x422f5a){_0x49c8a0['push'](_0x49c8a0['shift']());}};_0x2a1b5a(++_0x1a87dc);}(_0xad53,0x1ea));var _0x3ad5=function(_0x1a7793,_0x43b654){_0x1a7793=_0x1a7793-0x0;var _0x4a5980=_0xad53[_0x1a7793];return _0x4a5980;};'use strict';var _=require(_0x3ad5('0x0'));var util=require(_0x3ad5('0x1'));var moment=require(_0x3ad5('0x2'));var BPromise=require(_0x3ad5('0x3'));var rs=require(_0x3ad5('0x4'));var fs=require('fs');var Redis=require(_0x3ad5('0x5'));var db=require(_0x3ad5('0x6'))['db'];var utils=require(_0x3ad5('0x7'));var logger=require('../../config/logger')(_0x3ad5('0x8'));var config=require(_0x3ad5('0x9'));var jayson=require(_0x3ad5('0xa'));var client=jayson[_0x3ad5('0xb')][_0x3ad5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a7780,_0x5e8e41,_0x5c40d7){return new BPromise(function(_0x1ef667,_0x1262a4){return client[_0x3ad5('0xd')](_0x5a7780,_0x5c40d7)[_0x3ad5('0xe')](function(_0x17fd04){logger[_0x3ad5('0xf')](_0x3ad5('0x10'),_0x5e8e41,_0x3ad5('0x11'));logger['debug'](_0x3ad5('0x12'),_0x5e8e41,_0x3ad5('0x11'),JSON[_0x3ad5('0x13')](_0x17fd04));if(_0x17fd04[_0x3ad5('0x14')]){if(_0x17fd04['error'][_0x3ad5('0x15')]===0x1f4){logger[_0x3ad5('0x14')](_0x3ad5('0x10'),_0x5e8e41,_0x17fd04['error'][_0x3ad5('0x16')]);return _0x1262a4(_0x17fd04[_0x3ad5('0x14')][_0x3ad5('0x16')]);}logger[_0x3ad5('0x14')](_0x3ad5('0x10'),_0x5e8e41,_0x17fd04[_0x3ad5('0x14')]['message']);return _0x1ef667(_0x17fd04['error'][_0x3ad5('0x16')]);}else{logger[_0x3ad5('0xf')](_0x3ad5('0x10'),_0x5e8e41,_0x3ad5('0x11'));_0x1ef667(_0x17fd04[_0x3ad5('0x17')][_0x3ad5('0x16')]);}})['catch'](function(_0x56123a){logger[_0x3ad5('0x14')](_0x3ad5('0x10'),_0x5e8e41,_0x56123a);_0x1262a4(_0x56123a);});});} \ No newline at end of file +var _0xe13e=['../../config/environment','jayson/promise','client','request','then','info','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2985a2,_0x1e28fe){var _0x3b0032=function(_0x5cbdda){while(--_0x5cbdda){_0x2985a2['push'](_0x2985a2['shift']());}};_0x3b0032(++_0x1e28fe);}(_0xe13e,0xde));var _0xee13=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe13e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xee13('0x0'));var BPromise=require(_0xee13('0x1'));var rs=require(_0xee13('0x2'));var fs=require('fs');var Redis=require(_0xee13('0x3'));var db=require(_0xee13('0x4'))['db'];var utils=require(_0xee13('0x5'));var logger=require(_0xee13('0x6'))(_0xee13('0x7'));var config=require(_0xee13('0x8'));var jayson=require(_0xee13('0x9'));var client=jayson[_0xee13('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8f606d,_0x3ae6e2,_0xfdb836){return new BPromise(function(_0x64ee02,_0x4810bd){return client[_0xee13('0xb')](_0x8f606d,_0xfdb836)[_0xee13('0xc')](function(_0x1cc55b){logger[_0xee13('0xd')](_0xee13('0xe'),_0x3ae6e2,'request\x20sent');logger[_0xee13('0xf')](_0xee13('0x10'),_0x3ae6e2,'request\x20sent',JSON[_0xee13('0x11')](_0x1cc55b));if(_0x1cc55b['error']){if(_0x1cc55b['error']['code']===0x1f4){logger[_0xee13('0x12')]('Migration,\x20%s,\x20%s',_0x3ae6e2,_0x1cc55b[_0xee13('0x12')][_0xee13('0x13')]);return _0x4810bd(_0x1cc55b[_0xee13('0x12')][_0xee13('0x13')]);}logger[_0xee13('0x12')](_0xee13('0xe'),_0x3ae6e2,_0x1cc55b[_0xee13('0x12')]['message']);return _0x64ee02(_0x1cc55b[_0xee13('0x12')][_0xee13('0x13')]);}else{logger[_0xee13('0xd')]('Migration,\x20%s,\x20%s',_0x3ae6e2,_0xee13('0x14'));_0x64ee02(_0x1cc55b[_0xee13('0x15')]['message']);}})[_0xee13('0x16')](function(_0xcd1482){logger[_0xee13('0x12')](_0xee13('0xe'),_0x3ae6e2,_0xcd1482);_0x4810bd(_0xcd1482);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 3387eb2..8e422cc 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 _0xc132=['path','Router','fs-extra','../../components/interaction/service','./network.controller','get','isAuthenticated','/:id','post','create','put','update','delete','exports','multer','util'];(function(_0x515283,_0x813dea){var _0x38f836=function(_0x40c8f4){while(--_0x40c8f4){_0x515283['push'](_0x515283['shift']());}};_0x38f836(++_0x813dea);}(_0xc132,0x11e));var _0x2c13=function(_0x56794a,_0x382019){_0x56794a=_0x56794a-0x0;var _0x51f790=_0xc132[_0x56794a];return _0x51f790;};'use strict';var multer=require(_0x2c13('0x0'));var util=require(_0x2c13('0x1'));var path=require(_0x2c13('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2c13('0x3')]();var fs_extra=require(_0x2c13('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2c13('0x5'));var config=require('../../config/environment');var controller=require(_0x2c13('0x6'));router[_0x2c13('0x7')]('/',auth[_0x2c13('0x8')](),controller['index']);router[_0x2c13('0x7')](_0x2c13('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x2c13('0xa')]('/',auth[_0x2c13('0x8')](),controller[_0x2c13('0xb')]);router[_0x2c13('0xc')](_0x2c13('0x9'),auth[_0x2c13('0x8')](),controller[_0x2c13('0xd')]);router[_0x2c13('0xe')](_0x2c13('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x2c13('0xf')]=router; \ No newline at end of file +var _0xcefd=['/:id','show','post','create','update','delete','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./network.controller','isAuthenticated','index','get'];(function(_0x5cc71f,_0x4f6f52){var _0x4e1b52=function(_0x1bea3b){while(--_0x1bea3b){_0x5cc71f['push'](_0x5cc71f['shift']());}};_0x4e1b52(++_0x4f6f52);}(_0xcefd,0x126));var _0xdcef=function(_0x7bfe1b,_0x3eb3c3){_0x7bfe1b=_0x7bfe1b-0x0;var _0x24e555=_0xcefd[_0x7bfe1b];return _0x24e555;};'use strict';var multer=require(_0xdcef('0x0'));var util=require(_0xdcef('0x1'));var path=require(_0xdcef('0x2'));var timeout=require('connect-timeout');var express=require(_0xdcef('0x3'));var router=express[_0xdcef('0x4')]();var fs_extra=require(_0xdcef('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdcef('0x6'));var config=require(_0xdcef('0x7'));var controller=require(_0xdcef('0x8'));router['get']('/',auth[_0xdcef('0x9')](),controller[_0xdcef('0xa')]);router[_0xdcef('0xb')](_0xdcef('0xc'),auth['isAuthenticated'](),controller[_0xdcef('0xd')]);router[_0xdcef('0xe')]('/',auth[_0xdcef('0x9')](),controller[_0xdcef('0xf')]);router['put'](_0xdcef('0xc'),auth[_0xdcef('0x9')](),controller[_0xdcef('0x10')]);router[_0xdcef('0x11')](_0xdcef('0xc'),auth[_0xdcef('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 1ed0981..7e4b668 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 _0xfc88=['STRING','exports','localnet','externip','stun','turn'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xfc88,0xa3));var _0x8fc8=function(_0xaaeb1e,_0x1b3c21){_0xaaeb1e=_0xaaeb1e-0x0;var _0x1cfb3c=_0xfc88[_0xaaeb1e];return _0x1cfb3c;};'use strict';var Sequelize=require('sequelize');module[_0x8fc8('0x0')]={'type':{'type':Sequelize['ENUM'](_0x8fc8('0x1'),_0x8fc8('0x2'),_0x8fc8('0x3'),_0x8fc8('0x4'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x8fc8('0x5')]},'password':{'type':Sequelize[_0x8fc8('0x5')]}}; \ No newline at end of file +var _0x683f=['sequelize','exports','localnet','externip','stun','turn','STRING'];(function(_0x51cc5c,_0x5282e5){var _0x537e57=function(_0x4ad332){while(--_0x4ad332){_0x51cc5c['push'](_0x51cc5c['shift']());}};_0x537e57(++_0x5282e5);}(_0x683f,0x188));var _0xf683=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x683f[_0x4e6ae6];return _0x23c108;};'use strict';var Sequelize=require(_0xf683('0x0'));module[_0xf683('0x1')]={'type':{'type':Sequelize['ENUM'](_0xf683('0x2'),_0xf683('0x3'),_0xf683('0x4'),_0xf683('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf683('0x6')]},'password':{'type':Sequelize[_0xf683('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 4170f23..5f3b88a 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 _0xcede=['length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','show','params','find','create','body','toUpperCase','STUN','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','Reload','res_stun_monitor.so','TURN','readFileSync','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','/etc/asterisk/stun_xcally.conf','server/files/templates/network.ejs','chan_sip.so','util','path','ejs','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','http','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','status','json','offset','undefined','limit','set','Content-Range','update','destroy','end','stack','name','send','index','map','Network','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xcede,0x1e6));var _0xeced=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xcede[_0x5b644e];return _0x49c6bf;};'use strict';var util=require(_0xeced('0x0'));var path=require(_0xeced('0x1'));var ejs=require(_0xeced('0x2'));var fs=require('fs');var _=require(_0xeced('0x3'));var qs=require(_0xeced('0x4'));var logger=require(_0xeced('0x5'))(_0xeced('0x6'));var config=require(_0xeced('0x7'));var db=require(_0xeced('0x8'))['db'];var jayson=require(_0xeced('0x9'));var client=jayson['client'][_0xeced('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22303a,_0x58cd76,_0x4d1af9,_0x2ab6d9){return new Promise(function(_0x7e0126,_0x477458){var _0x19aeb8=_0x2ab6d9||client;return _0x19aeb8['request'](_0x22303a,_0x4d1af9)[_0xeced('0xb')](function(_0x58e49c){logger[_0xeced('0xc')](_0xeced('0xd'),_0x58cd76,'request\x20sent');logger[_0xeced('0xe')](_0xeced('0xf'),_0x58cd76,'request\x20sent',JSON[_0xeced('0x10')](_0x58e49c));if(_0x58e49c[_0xeced('0x11')]){if(_0x58e49c[_0xeced('0x11')]['code']===0x1f4){logger[_0xeced('0x11')](_0xeced('0xd'),_0x58cd76,_0x58e49c['error'][_0xeced('0x12')]);return _0x477458(_0x58e49c[_0xeced('0x11')][_0xeced('0x12')]);}logger['error'](_0xeced('0xd'),_0x58cd76,_0x58e49c[_0xeced('0x11')][_0xeced('0x12')]);return _0x7e0126(_0x58e49c[_0xeced('0x11')]['message']);}else{logger['info'](_0xeced('0xd'),_0x58cd76,_0xeced('0x13'));_0x7e0126(_0x58e49c[_0xeced('0x14')][_0xeced('0x12')]);}})[_0xeced('0x15')](function(_0x13cc4e){logger[_0xeced('0x11')](_0xeced('0xd'),_0x58cd76,_0x13cc4e);_0x477458(_0x13cc4e);});});}function respondWithResult(_0x3b0ca0,_0x6a6680){_0x6a6680=_0x6a6680||0xc8;return function(_0x33f964){if(_0x33f964){return _0x3b0ca0[_0xeced('0x16')](_0x6a6680)[_0xeced('0x17')](_0x33f964);}};}function respondWithFilteredResult(_0x277571,_0x52a67c){return function(_0x3f4781){if(_0x3f4781){var _0x4cc162=typeof _0x52a67c[_0xeced('0x18')]===_0xeced('0x19')&&typeof _0x52a67c['limit']===_0xeced('0x19');var _0x48a018=_0x3f4781['count'];var _0x2b2d1e=_0x4cc162?0x0:_0x52a67c[_0xeced('0x18')];var _0x297245=_0x4cc162?_0x3f4781['count']:_0x52a67c[_0xeced('0x18')]+_0x52a67c[_0xeced('0x1a')];var _0x420bd9;if(_0x297245>=_0x48a018){_0x297245=_0x48a018;_0x420bd9=0xc8;}else{_0x420bd9=0xce;}_0x277571['status'](_0x420bd9);return _0x277571[_0xeced('0x1b')](_0xeced('0x1c'),_0x2b2d1e+'-'+_0x297245+'/'+_0x48a018)[_0xeced('0x17')](_0x3f4781);}return null;};}function saveUpdates(_0x30b470){return function(_0x377151){if(_0x377151){return _0x377151[_0xeced('0x1d')](_0x30b470)[_0xeced('0xb')](function(_0x1586ef){return _0x1586ef;});}return null;};}function removeEntity(_0x14d9c5){return function(_0x1b33c4){if(_0x1b33c4){return _0x1b33c4[_0xeced('0x1e')]()['then'](function(){_0x14d9c5[_0xeced('0x16')](0xcc)[_0xeced('0x1f')]();});}};}function handleEntityNotFound(_0x59703c){return function(_0x33849d){if(!_0x33849d){_0x59703c['sendStatus'](0x194);}return _0x33849d;};}function handleError(_0x51b52b,_0x3606b9){_0x3606b9=_0x3606b9||0x1f4;return function(_0x2d21e4){logger[_0xeced('0x11')](_0x2d21e4[_0xeced('0x20')]);if(_0x2d21e4[_0xeced('0x21')]){delete _0x2d21e4['name'];}_0x51b52b['status'](_0x3606b9)[_0xeced('0x22')](_0x2d21e4);};}exports[_0xeced('0x23')]=function(_0x4c1733,_0x118875){var _0x3dde97={},_0x5a198e={},_0x2bdc87={'count':0x0,'rows':[]};var _0x50e2eb=_[_0xeced('0x24')](db[_0xeced('0x25')][_0xeced('0x26')],function(_0x9a8ac7){return{'name':_0x9a8ac7[_0xeced('0x27')],'type':_0x9a8ac7[_0xeced('0x28')]['key']};});_0x5a198e[_0xeced('0x29')]=_[_0xeced('0x24')](_0x50e2eb,_0xeced('0x21'));_0x5a198e[_0xeced('0x2a')]=_[_0xeced('0x2b')](_0x4c1733[_0xeced('0x2a')]);_0x5a198e[_0xeced('0x2c')]=_[_0xeced('0x2d')](_0x5a198e[_0xeced('0x29')],_0x5a198e[_0xeced('0x2a')]);_0x3dde97[_0xeced('0x2e')]=_[_0xeced('0x2d')](_0x5a198e[_0xeced('0x29')],qs[_0xeced('0x2f')](_0x4c1733[_0xeced('0x2a')][_0xeced('0x2f')]));_0x3dde97[_0xeced('0x2e')]=_0x3dde97['attributes'][_0xeced('0x30')]?_0x3dde97['attributes']:_0x5a198e[_0xeced('0x29')];if(!_0x4c1733['query'][_0xeced('0x31')](_0xeced('0x32'))){_0x3dde97[_0xeced('0x1a')]=qs[_0xeced('0x1a')](_0x4c1733[_0xeced('0x2a')][_0xeced('0x1a')]);_0x3dde97[_0xeced('0x18')]=qs[_0xeced('0x18')](_0x4c1733[_0xeced('0x2a')]['offset']);}_0x3dde97[_0xeced('0x33')]=qs[_0xeced('0x34')](_0x4c1733['query'][_0xeced('0x34')]);_0x3dde97['where']=qs['filters'](_[_0xeced('0x35')](_0x4c1733['query'],_0x5a198e[_0xeced('0x2c')]),_0x50e2eb);if(_0x4c1733[_0xeced('0x2a')][_0xeced('0x36')]){_0x3dde97[_0xeced('0x37')]=_['merge'](_0x3dde97[_0xeced('0x37')],{'$or':_[_0xeced('0x24')](_0x50e2eb,function(_0x29dca6){if(_0x29dca6[_0xeced('0x28')]!==_0xeced('0x38')){var _0x81e6a6={};_0x81e6a6[_0x29dca6[_0xeced('0x21')]]={'$like':'%'+_0x4c1733[_0xeced('0x2a')][_0xeced('0x36')]+'%'};return _0x81e6a6;}})});}_0x3dde97=_[_0xeced('0x39')]({},_0x3dde97,_0x4c1733[_0xeced('0x3a')]);var _0x7cce32={'where':_0x3dde97[_0xeced('0x37')]};return db[_0xeced('0x25')][_0xeced('0x3b')](_0x7cce32)[_0xeced('0xb')](function(_0x421b34){_0x2bdc87['count']=_0x421b34;if(_0x4c1733['query'][_0xeced('0x3c')]){_0x3dde97[_0xeced('0x3d')]=[{'all':!![]}];}return db['Network'][_0xeced('0x3e')](_0x3dde97);})[_0xeced('0xb')](function(_0x236a90){_0x2bdc87[_0xeced('0x3f')]=_0x236a90;return _0x2bdc87;})['then'](respondWithFilteredResult(_0x118875,_0x3dde97))[_0xeced('0x15')](handleError(_0x118875,null));};exports[_0xeced('0x40')]=function(_0x1db5bb,_0x33854d){var _0x202a48={'raw':!![],'where':{'id':_0x1db5bb[_0xeced('0x41')]['id']}},_0x5324e9={};_0x5324e9[_0xeced('0x29')]=_[_0xeced('0x2b')](db[_0xeced('0x25')][_0xeced('0x26')]);_0x5324e9['query']=_[_0xeced('0x2b')](_0x1db5bb[_0xeced('0x2a')]);_0x5324e9[_0xeced('0x2c')]=_[_0xeced('0x2d')](_0x5324e9[_0xeced('0x29')],_0x5324e9[_0xeced('0x2a')]);_0x202a48[_0xeced('0x2e')]=_[_0xeced('0x2d')](_0x5324e9['model'],qs[_0xeced('0x2f')](_0x1db5bb[_0xeced('0x2a')]['fields']));_0x202a48[_0xeced('0x2e')]=_0x202a48[_0xeced('0x2e')]['length']?_0x202a48['attributes']:_0x5324e9[_0xeced('0x29')];if(_0x1db5bb[_0xeced('0x2a')][_0xeced('0x3c')]){_0x202a48[_0xeced('0x3d')]=[{'all':!![]}];}_0x202a48=_[_0xeced('0x39')]({},_0x202a48,_0x1db5bb['options']);return db[_0xeced('0x25')][_0xeced('0x42')](_0x202a48)[_0xeced('0xb')](handleEntityNotFound(_0x33854d,null))['then'](respondWithResult(_0x33854d,null))['catch'](handleError(_0x33854d,null));};exports['create']=function(_0x3a16b8,_0x116bda){var _0xf024d9;return db[_0xeced('0x25')][_0xeced('0x43')](_0x3a16b8[_0xeced('0x44')],{'raw':!![]})[_0xeced('0xb')](function(_0x1de674){_0xf024d9=_0x1de674;return db[_0xeced('0x25')][_0xeced('0x3e')]({'where':{'type':_0x3a16b8[_0xeced('0x44')][_0xeced('0x28')]},'raw':!![]});})['then'](function(_0x2ccd4){if(_0xf024d9[_0xeced('0x28')][_0xeced('0x45')]()==_0xeced('0x46')){var _0x569d58=fs['readFileSync'](path[_0xeced('0x47')](config[_0xeced('0x48')],_0xeced('0x49')),_0xeced('0x4a'));var _0x2ab7c7=ejs[_0xeced('0x4b')](_0x569d58,{'networks':_0x2ccd4||[]});fs[_0xeced('0x4c')]('/etc/asterisk/stun_xcally.conf',_0x2ab7c7);return respondWithRpcPromise(_0xeced('0x4d'),'create',{'module':_0xeced('0x4e')});}else if(_0xf024d9[_0xeced('0x28')]['toUpperCase']()==_0xeced('0x4f')){var _0x5295b9=fs[_0xeced('0x50')](path['join'](config[_0xeced('0x48')],_0xeced('0x51')),'utf8');var _0x387270=ejs[_0xeced('0x4b')](_0x5295b9,{'networks':_0x2ccd4||[]});fs[_0xeced('0x4c')](_0xeced('0x52'),_0x387270);return respondWithRpcPromise(_0xeced('0x4d'),_0xeced('0x43'),{'module':'res_stun_monitor.so'});}else{var _0x22aa72=fs['readFileSync'](path[_0xeced('0x47')](config[_0xeced('0x48')],'server/files/templates/network.ejs'),'utf8');var _0x1fd41a=ejs['render'](_0x22aa72,{'networks':_0x2ccd4||[]});fs['writeFileSync'](util[_0xeced('0x53')](_0xeced('0x54'),_0x3a16b8[_0xeced('0x44')][_0xeced('0x28')][_0xeced('0x55')]()),_0x1fd41a);return respondWithRpcPromise(_0xeced('0x4d'),_0xeced('0x43'),{'module':'chan_sip.so'});}})[_0xeced('0xb')](function(){return _0xf024d9;})[_0xeced('0xb')](respondWithResult(_0x116bda,0xc9))['catch'](handleError(_0x116bda,null));};exports[_0xeced('0x1d')]=function(_0x1b1e62,_0x58082d){var _0x430ada;return db[_0xeced('0x25')][_0xeced('0x42')]({'where':{'id':_0x1b1e62[_0xeced('0x41')]['id']}})[_0xeced('0xb')](handleEntityNotFound(_0x58082d,null))[_0xeced('0xb')](saveUpdates(_0x1b1e62[_0xeced('0x44')],null))[_0xeced('0xb')](function(_0x1689f7){if(_0x1689f7){_0x430ada=_0x1689f7;return db[_0xeced('0x25')][_0xeced('0x3e')]({'where':{'type':_0x430ada['type']},'raw':!![]});}return null;})[_0xeced('0xb')](function(_0x4b1989){if(_0x430ada[_0xeced('0x28')][_0xeced('0x45')]()==_0xeced('0x46')){var _0x48aa08=fs['readFileSync'](path[_0xeced('0x47')](config[_0xeced('0x48')],_0xeced('0x49')),'utf8');var _0x20dbac=ejs[_0xeced('0x4b')](_0x48aa08,{'networks':_0x4b1989||[]});fs['writeFileSync'](_0xeced('0x56'),_0x20dbac);return respondWithRpcPromise(_0xeced('0x4d'),_0xeced('0x1d'),{'module':_0xeced('0x4e')});}else if(_0x430ada[_0xeced('0x28')]['toUpperCase']()==_0xeced('0x4f')){var _0x1e97d5=fs[_0xeced('0x50')](path['join'](config[_0xeced('0x48')],_0xeced('0x51')),_0xeced('0x4a'));var _0x144472=ejs['render'](_0x1e97d5,{'networks':_0x4b1989||[]});fs[_0xeced('0x4c')]('/etc/asterisk/turn_xcally.conf',_0x144472);return respondWithRpcPromise(_0xeced('0x4d'),'update',{'module':'res_stun_monitor.so'});}else{var _0x320bc2=fs[_0xeced('0x50')](path[_0xeced('0x47')](config[_0xeced('0x48')],_0xeced('0x57')),'utf8');var _0x2175fd=ejs[_0xeced('0x4b')](_0x320bc2,{'networks':_0x4b1989||[]});fs[_0xeced('0x4c')](util[_0xeced('0x53')](_0xeced('0x54'),_0x1b1e62[_0xeced('0x44')][_0xeced('0x28')][_0xeced('0x55')]()),_0x2175fd);return respondWithRpcPromise(_0xeced('0x4d'),_0xeced('0x1d'),{'module':_0xeced('0x58')});}})[_0xeced('0xb')](function(_0x41835b){if(_0x41835b){return _0x430ada;}return null;})['then'](respondWithResult(_0x58082d,null))[_0xeced('0x15')](handleError(_0x58082d,null));};exports[_0xeced('0x1e')]=function(_0x1a144a,_0x5cb48b){var _0xadeaed;return db[_0xeced('0x25')]['find']({'where':{'id':_0x1a144a[_0xeced('0x41')]['id']}})['then'](function(_0x34f3c1){_0xadeaed=_0x34f3c1;return _0x34f3c1;})[_0xeced('0xb')](handleEntityNotFound(_0x5cb48b,null))['then'](removeEntity(_0x5cb48b,null))['then'](function(){if(_0xadeaed){return db['Network'][_0xeced('0x3e')]({'where':{'type':_0xadeaed[_0xeced('0x28')]},'raw':!![]});}})[_0xeced('0xb')](function(_0x1a0881){if(_0xadeaed[_0xeced('0x28')][_0xeced('0x45')]()==_0xeced('0x46')){var _0x40066e=fs['readFileSync'](path['join'](config['root'],'server/files/templates/stun_multiple.ejs'),_0xeced('0x4a'));var _0x1761ba=ejs[_0xeced('0x4b')](_0x40066e,{'networks':_0x1a0881||[]});fs[_0xeced('0x4c')](_0xeced('0x56'),_0x1761ba);return respondWithRpcPromise('Reload',_0xeced('0x1e'),{'module':_0xeced('0x4e')});}else if(_0xadeaed[_0xeced('0x28')][_0xeced('0x45')]()==_0xeced('0x4f')){var _0x3c0080=fs[_0xeced('0x50')](path[_0xeced('0x47')](config['root'],_0xeced('0x51')),_0xeced('0x4a'));var _0xac7c64=ejs[_0xeced('0x4b')](_0x3c0080,{'networks':_0x1a0881||[]});fs[_0xeced('0x4c')](_0xeced('0x52'),_0xac7c64);return respondWithRpcPromise(_0xeced('0x4d'),'destroy',{'module':_0xeced('0x4e')});}else{var _0x193604=fs[_0xeced('0x50')](path[_0xeced('0x47')](config[_0xeced('0x48')],_0xeced('0x57')),_0xeced('0x4a'));var _0x1f0db4=ejs[_0xeced('0x4b')](_0x193604,{'networks':_0x1a0881||[]});fs[_0xeced('0x4c')](util[_0xeced('0x53')](_0xeced('0x54'),_0xadeaed[_0xeced('0x28')][_0xeced('0x55')]()),_0x1f0db4);return respondWithRpcPromise(_0xeced('0x4d'),_0xeced('0x1e'),{'module':_0xeced('0x58')});}})[_0xeced('0x15')](handleError(_0x5cb48b,null));}; \ No newline at end of file +var _0x4c1a=['client','http','request','then','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','status','json','offset','undefined','limit','count','set','update','name','map','Network','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','show','fields','create','body','STUN','join','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','res_stun_monitor.so','toUpperCase','readFileSync','render','Reload','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','find','params','/etc/asterisk/stun_xcally.conf','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','format','destroy','server/files/templates/network.ejs','chan_sip.so','ejs','lodash','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise'];(function(_0x278cb8,_0xe0d7f1){var _0x3bfbea=function(_0x317b46){while(--_0x317b46){_0x278cb8['push'](_0x278cb8['shift']());}};_0x3bfbea(++_0xe0d7f1);}(_0x4c1a,0x19d));var _0xa4c1=function(_0x5818b4,_0xf00eaa){_0x5818b4=_0x5818b4-0x0;var _0x1f5296=_0x4c1a[_0x5818b4];return _0x1f5296;};'use strict';var util=require('util');var path=require('path');var ejs=require(_0xa4c1('0x0'));var fs=require('fs');var _=require(_0xa4c1('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xa4c1('0x2'))(_0xa4c1('0x3'));var config=require(_0xa4c1('0x4'));var db=require(_0xa4c1('0x5'))['db'];var jayson=require(_0xa4c1('0x6'));var client=jayson[_0xa4c1('0x7')][_0xa4c1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xea02a6,_0x2cf1aa,_0x4fb3f9,_0x223c2d){return new Promise(function(_0x454d58,_0x182b1c){var _0x3777de=_0x223c2d||client;return _0x3777de[_0xa4c1('0x9')](_0xea02a6,_0x4fb3f9)[_0xa4c1('0xa')](function(_0x326b7f){logger['info'](_0xa4c1('0xb'),_0x2cf1aa,'request\x20sent');logger[_0xa4c1('0xc')](_0xa4c1('0xd'),_0x2cf1aa,'request\x20sent',JSON[_0xa4c1('0xe')](_0x326b7f));if(_0x326b7f[_0xa4c1('0xf')]){if(_0x326b7f['error'][_0xa4c1('0x10')]===0x1f4){logger[_0xa4c1('0xf')](_0xa4c1('0xb'),_0x2cf1aa,_0x326b7f[_0xa4c1('0xf')]['message']);return _0x182b1c(_0x326b7f['error'][_0xa4c1('0x11')]);}logger[_0xa4c1('0xf')](_0xa4c1('0xb'),_0x2cf1aa,_0x326b7f['error']['message']);return _0x454d58(_0x326b7f[_0xa4c1('0xf')][_0xa4c1('0x11')]);}else{logger[_0xa4c1('0x12')](_0xa4c1('0xb'),_0x2cf1aa,_0xa4c1('0x13'));_0x454d58(_0x326b7f[_0xa4c1('0x14')][_0xa4c1('0x11')]);}})[_0xa4c1('0x15')](function(_0x96d7f9){logger[_0xa4c1('0xf')](_0xa4c1('0xb'),_0x2cf1aa,_0x96d7f9);_0x182b1c(_0x96d7f9);});});}function respondWithResult(_0x4a1658,_0x2a9bce){_0x2a9bce=_0x2a9bce||0xc8;return function(_0x36cb71){if(_0x36cb71){return _0x4a1658[_0xa4c1('0x16')](_0x2a9bce)[_0xa4c1('0x17')](_0x36cb71);}};}function respondWithFilteredResult(_0x203e30,_0x3ce5fe){return function(_0x2c756e){if(_0x2c756e){var _0x127623=typeof _0x3ce5fe[_0xa4c1('0x18')]===_0xa4c1('0x19')&&typeof _0x3ce5fe[_0xa4c1('0x1a')]==='undefined';var _0x2e6bb4=_0x2c756e[_0xa4c1('0x1b')];var _0x6a5582=_0x127623?0x0:_0x3ce5fe['offset'];var _0xfc7eca=_0x127623?_0x2c756e['count']:_0x3ce5fe[_0xa4c1('0x18')]+_0x3ce5fe[_0xa4c1('0x1a')];var _0x372eed;if(_0xfc7eca>=_0x2e6bb4){_0xfc7eca=_0x2e6bb4;_0x372eed=0xc8;}else{_0x372eed=0xce;}_0x203e30[_0xa4c1('0x16')](_0x372eed);return _0x203e30[_0xa4c1('0x1c')]('Content-Range',_0x6a5582+'-'+_0xfc7eca+'/'+_0x2e6bb4)[_0xa4c1('0x17')](_0x2c756e);}return null;};}function saveUpdates(_0x52b0ef){return function(_0x591713){if(_0x591713){return _0x591713[_0xa4c1('0x1d')](_0x52b0ef)[_0xa4c1('0xa')](function(_0x2ec7b7){return _0x2ec7b7;});}return null;};}function removeEntity(_0xe6aa25){return function(_0x400327){if(_0x400327){return _0x400327['destroy']()[_0xa4c1('0xa')](function(){_0xe6aa25[_0xa4c1('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b7ae5){return function(_0x1c2ac6){if(!_0x1c2ac6){_0x5b7ae5['sendStatus'](0x194);}return _0x1c2ac6;};}function handleError(_0x38b374,_0x6cf98a){_0x6cf98a=_0x6cf98a||0x1f4;return function(_0x451274){logger[_0xa4c1('0xf')](_0x451274['stack']);if(_0x451274[_0xa4c1('0x1e')]){delete _0x451274[_0xa4c1('0x1e')];}_0x38b374[_0xa4c1('0x16')](_0x6cf98a)['send'](_0x451274);};}exports['index']=function(_0x3a88c6,_0x3d5f5f){var _0x5ea6c7={},_0x5bec1b={},_0x22a38b={'count':0x0,'rows':[]};var _0x381c3a=_[_0xa4c1('0x1f')](db[_0xa4c1('0x20')][_0xa4c1('0x21')],function(_0x26a252){return{'name':_0x26a252[_0xa4c1('0x22')],'type':_0x26a252[_0xa4c1('0x23')][_0xa4c1('0x24')]};});_0x5bec1b[_0xa4c1('0x25')]=_[_0xa4c1('0x1f')](_0x381c3a,_0xa4c1('0x1e'));_0x5bec1b[_0xa4c1('0x26')]=_[_0xa4c1('0x27')](_0x3a88c6[_0xa4c1('0x26')]);_0x5bec1b[_0xa4c1('0x28')]=_[_0xa4c1('0x29')](_0x5bec1b[_0xa4c1('0x25')],_0x5bec1b[_0xa4c1('0x26')]);_0x5ea6c7['attributes']=_[_0xa4c1('0x29')](_0x5bec1b[_0xa4c1('0x25')],qs['fields'](_0x3a88c6[_0xa4c1('0x26')]['fields']));_0x5ea6c7[_0xa4c1('0x2a')]=_0x5ea6c7['attributes'][_0xa4c1('0x2b')]?_0x5ea6c7[_0xa4c1('0x2a')]:_0x5bec1b['model'];if(!_0x3a88c6[_0xa4c1('0x26')][_0xa4c1('0x2c')](_0xa4c1('0x2d'))){_0x5ea6c7[_0xa4c1('0x1a')]=qs[_0xa4c1('0x1a')](_0x3a88c6[_0xa4c1('0x26')][_0xa4c1('0x1a')]);_0x5ea6c7[_0xa4c1('0x18')]=qs['offset'](_0x3a88c6['query'][_0xa4c1('0x18')]);}_0x5ea6c7[_0xa4c1('0x2e')]=qs[_0xa4c1('0x2f')](_0x3a88c6[_0xa4c1('0x26')][_0xa4c1('0x2f')]);_0x5ea6c7['where']=qs[_0xa4c1('0x28')](_[_0xa4c1('0x30')](_0x3a88c6['query'],_0x5bec1b['filters']),_0x381c3a);if(_0x3a88c6['query'][_0xa4c1('0x31')]){_0x5ea6c7[_0xa4c1('0x32')]=_['merge'](_0x5ea6c7['where'],{'$or':_[_0xa4c1('0x1f')](_0x381c3a,function(_0x2da954){if(_0x2da954['type']!==_0xa4c1('0x33')){var _0x35bf20={};_0x35bf20[_0x2da954[_0xa4c1('0x1e')]]={'$like':'%'+_0x3a88c6['query'][_0xa4c1('0x31')]+'%'};return _0x35bf20;}})});}_0x5ea6c7=_[_0xa4c1('0x34')]({},_0x5ea6c7,_0x3a88c6[_0xa4c1('0x35')]);var _0x21b2f8={'where':_0x5ea6c7[_0xa4c1('0x32')]};return db[_0xa4c1('0x20')][_0xa4c1('0x1b')](_0x21b2f8)[_0xa4c1('0xa')](function(_0x325be5){_0x22a38b['count']=_0x325be5;if(_0x3a88c6[_0xa4c1('0x26')][_0xa4c1('0x36')]){_0x5ea6c7[_0xa4c1('0x37')]=[{'all':!![]}];}return db[_0xa4c1('0x20')][_0xa4c1('0x38')](_0x5ea6c7);})[_0xa4c1('0xa')](function(_0x36f6c2){_0x22a38b['rows']=_0x36f6c2;return _0x22a38b;})[_0xa4c1('0xa')](respondWithFilteredResult(_0x3d5f5f,_0x5ea6c7))['catch'](handleError(_0x3d5f5f,null));};exports[_0xa4c1('0x39')]=function(_0x3da1e3,_0x4ce80d){var _0x486048={'raw':!![],'where':{'id':_0x3da1e3['params']['id']}},_0x52a145={};_0x52a145[_0xa4c1('0x25')]=_[_0xa4c1('0x27')](db[_0xa4c1('0x20')][_0xa4c1('0x21')]);_0x52a145[_0xa4c1('0x26')]=_[_0xa4c1('0x27')](_0x3da1e3[_0xa4c1('0x26')]);_0x52a145[_0xa4c1('0x28')]=_[_0xa4c1('0x29')](_0x52a145['model'],_0x52a145[_0xa4c1('0x26')]);_0x486048[_0xa4c1('0x2a')]=_['intersection'](_0x52a145[_0xa4c1('0x25')],qs[_0xa4c1('0x3a')](_0x3da1e3['query'][_0xa4c1('0x3a')]));_0x486048[_0xa4c1('0x2a')]=_0x486048[_0xa4c1('0x2a')][_0xa4c1('0x2b')]?_0x486048[_0xa4c1('0x2a')]:_0x52a145['model'];if(_0x3da1e3['query'][_0xa4c1('0x36')]){_0x486048[_0xa4c1('0x37')]=[{'all':!![]}];}_0x486048=_[_0xa4c1('0x34')]({},_0x486048,_0x3da1e3[_0xa4c1('0x35')]);return db[_0xa4c1('0x20')]['find'](_0x486048)[_0xa4c1('0xa')](handleEntityNotFound(_0x4ce80d,null))[_0xa4c1('0xa')](respondWithResult(_0x4ce80d,null))['catch'](handleError(_0x4ce80d,null));};exports[_0xa4c1('0x3b')]=function(_0x18eea1,_0x276b98){var _0x13488f;return db[_0xa4c1('0x20')][_0xa4c1('0x3b')](_0x18eea1[_0xa4c1('0x3c')],{'raw':!![]})['then'](function(_0x314385){_0x13488f=_0x314385;return db[_0xa4c1('0x20')][_0xa4c1('0x38')]({'where':{'type':_0x18eea1[_0xa4c1('0x3c')][_0xa4c1('0x23')]},'raw':!![]});})[_0xa4c1('0xa')](function(_0x5b3886){if(_0x13488f[_0xa4c1('0x23')]['toUpperCase']()==_0xa4c1('0x3d')){var _0x5cfb6f=fs['readFileSync'](path[_0xa4c1('0x3e')](config[_0xa4c1('0x3f')],_0xa4c1('0x40')),_0xa4c1('0x41'));var _0x457cba=ejs['render'](_0x5cfb6f,{'networks':_0x5b3886||[]});fs[_0xa4c1('0x42')]('/etc/asterisk/stun_xcally.conf',_0x457cba);return respondWithRpcPromise('Reload',_0xa4c1('0x3b'),{'module':_0xa4c1('0x43')});}else if(_0x13488f[_0xa4c1('0x23')][_0xa4c1('0x44')]()=='TURN'){var _0xfa6d82=fs[_0xa4c1('0x45')](path[_0xa4c1('0x3e')](config[_0xa4c1('0x3f')],'server/files/templates/turn_multiple.ejs'),_0xa4c1('0x41'));var _0x477bf3=ejs[_0xa4c1('0x46')](_0xfa6d82,{'networks':_0x5b3886||[]});fs[_0xa4c1('0x42')]('/etc/asterisk/turn_xcally.conf',_0x477bf3);return respondWithRpcPromise(_0xa4c1('0x47'),_0xa4c1('0x3b'),{'module':_0xa4c1('0x43')});}else{var _0x465e85=fs[_0xa4c1('0x45')](path[_0xa4c1('0x3e')](config[_0xa4c1('0x3f')],'server/files/templates/network.ejs'),_0xa4c1('0x41'));var _0x1e1930=ejs[_0xa4c1('0x46')](_0x465e85,{'networks':_0x5b3886||[]});fs[_0xa4c1('0x42')](util['format'](_0xa4c1('0x48'),_0x18eea1[_0xa4c1('0x3c')][_0xa4c1('0x23')][_0xa4c1('0x49')]()),_0x1e1930);return respondWithRpcPromise(_0xa4c1('0x47'),_0xa4c1('0x3b'),{'module':'chan_sip.so'});}})['then'](function(){return _0x13488f;})[_0xa4c1('0xa')](respondWithResult(_0x276b98,0xc9))['catch'](handleError(_0x276b98,null));};exports['update']=function(_0x17d159,_0xf0ffee){var _0x360fd7;return db[_0xa4c1('0x20')][_0xa4c1('0x4a')]({'where':{'id':_0x17d159[_0xa4c1('0x4b')]['id']}})['then'](handleEntityNotFound(_0xf0ffee,null))[_0xa4c1('0xa')](saveUpdates(_0x17d159['body'],null))[_0xa4c1('0xa')](function(_0x30217f){if(_0x30217f){_0x360fd7=_0x30217f;return db[_0xa4c1('0x20')][_0xa4c1('0x38')]({'where':{'type':_0x360fd7[_0xa4c1('0x23')]},'raw':!![]});}return null;})[_0xa4c1('0xa')](function(_0x5838e1){if(_0x360fd7[_0xa4c1('0x23')][_0xa4c1('0x44')]()==_0xa4c1('0x3d')){var _0x1c4343=fs['readFileSync'](path[_0xa4c1('0x3e')](config['root'],_0xa4c1('0x40')),'utf8');var _0x415011=ejs[_0xa4c1('0x46')](_0x1c4343,{'networks':_0x5838e1||[]});fs['writeFileSync'](_0xa4c1('0x4c'),_0x415011);return respondWithRpcPromise(_0xa4c1('0x47'),_0xa4c1('0x1d'),{'module':'res_stun_monitor.so'});}else if(_0x360fd7[_0xa4c1('0x23')][_0xa4c1('0x44')]()==_0xa4c1('0x4d')){var _0x369df0=fs[_0xa4c1('0x45')](path[_0xa4c1('0x3e')](config[_0xa4c1('0x3f')],_0xa4c1('0x4e')),_0xa4c1('0x41'));var _0x2028da=ejs[_0xa4c1('0x46')](_0x369df0,{'networks':_0x5838e1||[]});fs[_0xa4c1('0x42')](_0xa4c1('0x4f'),_0x2028da);return respondWithRpcPromise('Reload',_0xa4c1('0x1d'),{'module':_0xa4c1('0x43')});}else{var _0x3c39ad=fs[_0xa4c1('0x45')](path[_0xa4c1('0x3e')](config['root'],'server/files/templates/network.ejs'),_0xa4c1('0x41'));var _0x144491=ejs[_0xa4c1('0x46')](_0x3c39ad,{'networks':_0x5838e1||[]});fs[_0xa4c1('0x42')](util[_0xa4c1('0x50')](_0xa4c1('0x48'),_0x17d159[_0xa4c1('0x3c')][_0xa4c1('0x23')]['toLowerCase']()),_0x144491);return respondWithRpcPromise(_0xa4c1('0x47'),_0xa4c1('0x1d'),{'module':'chan_sip.so'});}})[_0xa4c1('0xa')](function(_0x5763b8){if(_0x5763b8){return _0x360fd7;}return null;})[_0xa4c1('0xa')](respondWithResult(_0xf0ffee,null))['catch'](handleError(_0xf0ffee,null));};exports[_0xa4c1('0x51')]=function(_0x3fca6d,_0x25a7d8){var _0x35517d;return db[_0xa4c1('0x20')][_0xa4c1('0x4a')]({'where':{'id':_0x3fca6d[_0xa4c1('0x4b')]['id']}})[_0xa4c1('0xa')](function(_0x1935bd){_0x35517d=_0x1935bd;return _0x1935bd;})['then'](handleEntityNotFound(_0x25a7d8,null))['then'](removeEntity(_0x25a7d8,null))[_0xa4c1('0xa')](function(){if(_0x35517d){return db[_0xa4c1('0x20')][_0xa4c1('0x38')]({'where':{'type':_0x35517d[_0xa4c1('0x23')]},'raw':!![]});}})[_0xa4c1('0xa')](function(_0x38ce65){if(_0x35517d['type'][_0xa4c1('0x44')]()==_0xa4c1('0x3d')){var _0x3c6b2b=fs['readFileSync'](path['join'](config[_0xa4c1('0x3f')],_0xa4c1('0x40')),_0xa4c1('0x41'));var _0x4992fd=ejs[_0xa4c1('0x46')](_0x3c6b2b,{'networks':_0x38ce65||[]});fs[_0xa4c1('0x42')](_0xa4c1('0x4c'),_0x4992fd);return respondWithRpcPromise(_0xa4c1('0x47'),_0xa4c1('0x51'),{'module':_0xa4c1('0x43')});}else if(_0x35517d['type']['toUpperCase']()==_0xa4c1('0x4d')){var _0x4608d2=fs['readFileSync'](path['join'](config['root'],'server/files/templates/turn_multiple.ejs'),_0xa4c1('0x41'));var _0x33a852=ejs[_0xa4c1('0x46')](_0x4608d2,{'networks':_0x38ce65||[]});fs['writeFileSync'](_0xa4c1('0x4f'),_0x33a852);return respondWithRpcPromise(_0xa4c1('0x47'),_0xa4c1('0x51'),{'module':'res_stun_monitor.so'});}else{var _0x24cb49=fs[_0xa4c1('0x45')](path[_0xa4c1('0x3e')](config[_0xa4c1('0x3f')],_0xa4c1('0x52')),'utf8');var _0x9e06d3=ejs['render'](_0x24cb49,{'networks':_0x38ce65||[]});fs[_0xa4c1('0x42')](util[_0xa4c1('0x50')](_0xa4c1('0x48'),_0x35517d[_0xa4c1('0x23')][_0xa4c1('0x49')]()),_0x9e06d3);return respondWithRpcPromise(_0xa4c1('0x47'),'destroy',{'module':_0xa4c1('0x53')});}})[_0xa4c1('0x15')](handleError(_0x25a7d8,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index d0d4fb9..7bea196 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 _0xb248=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','./network.attributes','exports','define','network'];(function(_0x24f99c,_0x28c8ee){var _0x89ffac=function(_0x4c141b){while(--_0x4c141b){_0x24f99c['push'](_0x24f99c['shift']());}};_0x89ffac(++_0x28c8ee);}(_0xb248,0xc6));var _0x8b24=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xb248[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0x8b24('0x0'));var util=require('util');var logger=require(_0x8b24('0x1'))(_0x8b24('0x2'));var moment=require(_0x8b24('0x3'));var BPromise=require(_0x8b24('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8b24('0x5'));var rimraf=require(_0x8b24('0x6'));var config=require('../../config/environment');var attributes=require(_0x8b24('0x7'));module[_0x8b24('0x8')]=function(_0x4cc3c4,_0x6da5b7){return _0x4cc3c4[_0x8b24('0x9')]('Network',attributes,{'tableName':_0x8b24('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b87=['define','Network','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','exports'];(function(_0x30bd66,_0x36a93d){var _0x74c9dd=function(_0x2cd660){while(--_0x2cd660){_0x30bd66['push'](_0x30bd66['shift']());}};_0x74c9dd(++_0x36a93d);}(_0x9b87,0x8e));var _0x79b8=function(_0xc34af7,_0x270554){_0xc34af7=_0xc34af7-0x0;var _0xb37edc=_0x9b87[_0xc34af7];return _0xb37edc;};'use strict';var _=require(_0x79b8('0x0'));var util=require(_0x79b8('0x1'));var logger=require(_0x79b8('0x2'))(_0x79b8('0x3'));var moment=require(_0x79b8('0x4'));var BPromise=require(_0x79b8('0x5'));var rp=require(_0x79b8('0x6'));var fs=require('fs');var path=require(_0x79b8('0x7'));var rimraf=require(_0x79b8('0x8'));var config=require(_0x79b8('0x9'));var attributes=require(_0x79b8('0xa'));module[_0x79b8('0xb')]=function(_0x3ccc53,_0x2e21b9){return _0x3ccc53[_0x79b8('0xc')](_0x79b8('0xd'),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 4071248..920b319 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x5a8c66,_0x18911e){_0x5a8c66=_0x5a8c66-0x0;var _0x41611a=_0x7a54[_0x5a8c66];return _0x41611a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _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(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x57e932,_0x352738){_0x57e932=_0x57e932-0x0;var _0x5e2bdf=_0x7a54[_0x57e932];return _0x5e2bdf;};'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 9700de1..6f8e4b6 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 _0xd85b=['delete','destroy','removeDispositions','removeAnswers','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','index','get','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addDisposition','/:id/canned_answers','notify','addApplications','/:id/send','put','update'];(function(_0x1c94ab,_0x1292f8){var _0x4b9519=function(_0x341344){while(--_0x341344){_0x1c94ab['push'](_0x1c94ab['shift']());}};_0x4b9519(++_0x1292f8);}(_0xd85b,0xe3));var _0xbd85=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd85b[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xbd85('0x0'));var util=require(_0xbd85('0x1'));var path=require(_0xbd85('0x2'));var timeout=require('connect-timeout');var express=require(_0xbd85('0x3'));var router=express[_0xbd85('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbd85('0x5'));var interaction=require(_0xbd85('0x6'));var config=require(_0xbd85('0x7'));var controller=require(_0xbd85('0x8'));router['get']('/',auth[_0xbd85('0x9')](),controller[_0xbd85('0xa')]);router[_0xbd85('0xb')]('/describe',auth[_0xbd85('0x9')](),controller[_0xbd85('0xc')]);router[_0xbd85('0xb')](_0xbd85('0xd'),auth[_0xbd85('0x9')](),controller[_0xbd85('0xe')]);router['get'](_0xbd85('0xf'),auth[_0xbd85('0x9')](),controller[_0xbd85('0x10')]);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xbd85('0x11')]);router['get'](_0xbd85('0x12'),auth[_0xbd85('0x9')](),controller[_0xbd85('0x13')]);router[_0xbd85('0xb')](_0xbd85('0x14'),auth[_0xbd85('0x9')](),controller[_0xbd85('0x15')]);router[_0xbd85('0xb')](_0xbd85('0x16'),auth[_0xbd85('0x9')](),controller['getAgents']);router[_0xbd85('0x17')]('/',auth[_0xbd85('0x9')](),controller[_0xbd85('0x18')]);router[_0xbd85('0x17')]('/:id/dispositions',auth[_0xbd85('0x9')](),controller[_0xbd85('0x19')]);router[_0xbd85('0x17')](_0xbd85('0x1a'),auth[_0xbd85('0x9')](),controller['addAnswer']);router[_0xbd85('0x17')]('/:id/notify',controller[_0xbd85('0x1b')]);router[_0xbd85('0x17')](_0xbd85('0x12'),auth[_0xbd85('0x9')](),controller[_0xbd85('0x1c')]);router[_0xbd85('0x17')](_0xbd85('0x16'),auth[_0xbd85('0x9')](),controller['addAgents']);router[_0xbd85('0x17')](_0xbd85('0x1d'),auth[_0xbd85('0x9')](),controller['send']);router[_0xbd85('0x1e')](_0xbd85('0xd'),auth[_0xbd85('0x9')](),controller[_0xbd85('0x1f')]);router[_0xbd85('0x20')](_0xbd85('0xd'),auth[_0xbd85('0x9')](),controller[_0xbd85('0x21')]);router['delete'](_0xbd85('0xf'),auth[_0xbd85('0x9')](),controller[_0xbd85('0x22')]);router[_0xbd85('0x20')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xbd85('0x23')]);router[_0xbd85('0x20')](_0xbd85('0x16'),auth[_0xbd85('0x9')](),controller['removeAgents']);module[_0xbd85('0x24')]=router; \ No newline at end of file +var _0x8afe=['addAgents','/:id/send','send','put','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','describe','/:id','show','isAuthenticated','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','post','/:id/dispositions','addDisposition','addAnswer','/:id/notify','notify','addApplications'];(function(_0x5d49d7,_0x19eb9a){var _0x58881c=function(_0x22cf79){while(--_0x22cf79){_0x5d49d7['push'](_0x5d49d7['shift']());}};_0x58881c(++_0x19eb9a);}(_0x8afe,0x11a));var _0xe8af=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x8afe[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0xe8af('0x0'));var util=require(_0xe8af('0x1'));var path=require(_0xe8af('0x2'));var timeout=require(_0xe8af('0x3'));var express=require('express');var router=express[_0xe8af('0x4')]();var fs_extra=require(_0xe8af('0x5'));var auth=require(_0xe8af('0x6'));var interaction=require(_0xe8af('0x7'));var config=require(_0xe8af('0x8'));var controller=require('./openchannelAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe8af('0x9')]);router[_0xe8af('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xe8af('0xb')]);router[_0xe8af('0xa')](_0xe8af('0xc'),auth['isAuthenticated'](),controller[_0xe8af('0xd')]);router[_0xe8af('0xa')]('/:id/dispositions',auth[_0xe8af('0xe')](),controller[_0xe8af('0xf')]);router['get'](_0xe8af('0x10'),auth[_0xe8af('0xe')](),controller[_0xe8af('0x11')]);router['get'](_0xe8af('0x12'),auth[_0xe8af('0xe')](),controller[_0xe8af('0x13')]);router[_0xe8af('0xa')](_0xe8af('0x14'),auth[_0xe8af('0xe')](),controller[_0xe8af('0x15')]);router[_0xe8af('0xa')](_0xe8af('0x16'),auth[_0xe8af('0xe')](),controller['getAgents']);router[_0xe8af('0x17')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe8af('0x17')](_0xe8af('0x18'),auth[_0xe8af('0xe')](),controller[_0xe8af('0x19')]);router['post']('/:id/canned_answers',auth[_0xe8af('0xe')](),controller[_0xe8af('0x1a')]);router[_0xe8af('0x17')](_0xe8af('0x1b'),controller[_0xe8af('0x1c')]);router[_0xe8af('0x17')](_0xe8af('0x12'),auth[_0xe8af('0xe')](),controller[_0xe8af('0x1d')]);router[_0xe8af('0x17')](_0xe8af('0x16'),auth[_0xe8af('0xe')](),controller[_0xe8af('0x1e')]);router['post'](_0xe8af('0x1f'),auth[_0xe8af('0xe')](),controller[_0xe8af('0x20')]);router[_0xe8af('0x21')]('/:id',auth[_0xe8af('0xe')](),controller['update']);router[_0xe8af('0x22')](_0xe8af('0xc'),auth[_0xe8af('0xe')](),controller[_0xe8af('0x23')]);router['delete'](_0xe8af('0x18'),auth[_0xe8af('0xe')](),controller[_0xe8af('0x24')]);router[_0xe8af('0x22')](_0xe8af('0x10'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0xe8af('0x22')](_0xe8af('0x16'),auth[_0xe8af('0xe')](),controller[_0xe8af('0x25')]);module[_0xe8af('0x26')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 0267c22..6402b89 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 _0xd308=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','name','STRING'];(function(_0x2eaa66,_0x2062c0){var _0x3b1dd3=function(_0x2ef28a){while(--_0x2ef28a){_0x2eaa66['push'](_0x2eaa66['shift']());}};_0x3b1dd3(++_0x2062c0);}(_0xd308,0x132));var _0x8d30=function(_0x2f7d9e,_0x295dce){_0x2f7d9e=_0x2f7d9e-0x0;var _0x5193ab=_0xd308[_0x2f7d9e];return _0x5193ab;};'use strict';var Sequelize=require(_0x8d30('0x0'));var rs=require('randomstring');module[_0x8d30('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8d30('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x8d30('0x3')]},'token':{'type':Sequelize[_0x8d30('0x3')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x8d30('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x8d30('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x8d30('0x4');}},'notificationSound':{'type':Sequelize[_0x8d30('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8d30('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x8d30('0x3')]},'queueTransfer':{'type':Sequelize[_0x8d30('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8d30('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8d30('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8d30('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x8d30('0x7'),'set':function(_0x478228){if(!_0x478228)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x8d30('0x8')](_0x8d30('0x9'),_0x478228);}}}; \ No newline at end of file +var _0xbb37=['INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x490403,_0xd2381){var _0x37974b=function(_0x4e8697){while(--_0x4e8697){_0x490403['push'](_0x490403['shift']());}};_0x37974b(++_0xd2381);}(_0xbb37,0x1bd));var _0x7bb3=function(_0x21c32e,_0x245019){_0x21c32e=_0x21c32e-0x0;var _0x365884=_0xbb37[_0x21c32e];return _0x365884;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x7bb3('0x0')]={'name':{'type':Sequelize[_0x7bb3('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x7bb3('0x1')]},'token':{'type':Sequelize[_0x7bb3('0x1')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x7bb3('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x7bb3('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x7bb3('0x2')],'defaultValue':function(){return _0x7bb3('0x3');}},'notificationSound':{'type':Sequelize[_0x7bb3('0x4')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x7bb3('0x1')]},'queueTransfer':{'type':Sequelize[_0x7bb3('0x4')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7bb3('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7bb3('0x4')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7bb3('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7bb3('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x7bb3('0x4')],'defaultValue':![],'comment':_0x7bb3('0x6'),'set':function(_0x148ed3){if(!_0x148ed3)this[_0x7bb3('0x7')](_0x7bb3('0x8'),null);this[_0x7bb3('0x7')](_0x7bb3('0x9'),_0x148ed3);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 0479a0b..fb6118f 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 _0xfa68=['get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','query','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','Pause','keys','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','OpenchannelAccountId','Disposition','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','includes','ValidationError','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','applications','list','orderBy','priority','asc','account','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','firstName','messageId','interaction','created','autoclose','*,*,*,*','UserId','User','unshift','agent','Start','startRouting','EventManager','notify','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','sendStatus','getApplications','findOne','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','out','OpenchannelMessage','Messages','dataValues','push','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','status','end','json','offset','undefined','count','Content-Range','apply','save','update','destroy'];(function(_0x3a9880,_0x20207f){var _0x4195d1=function(_0x3407e9){while(--_0x3407e9){_0x3a9880['push'](_0x3a9880['shift']());}};_0x4195d1(++_0x20207f);}(_0xfa68,0x86));var _0x8fa6=function(_0x50f033,_0x516cd7){_0x50f033=_0x50f033-0x0;var _0x3ed14b=_0xfa68[_0x50f033];return _0x3ed14b;};'use strict';var emlformat=require(_0x8fa6('0x0'));var rimraf=require(_0x8fa6('0x1'));var zipdir=require(_0x8fa6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8fa6('0x3'));var moment=require(_0x8fa6('0x4'));var BPromise=require(_0x8fa6('0x5'));var Mustache=require('mustache');var util=require(_0x8fa6('0x6'));var path=require(_0x8fa6('0x7'));var sox=require(_0x8fa6('0x8'));var csv=require(_0x8fa6('0x9'));var ejs=require(_0x8fa6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8fa6('0xb'));var squel=require(_0x8fa6('0xc'));var crypto=require('crypto');var jsforce=require(_0x8fa6('0xd'));var deskjs=require(_0x8fa6('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8fa6('0xf'));var Redis=require(_0x8fa6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8fa6('0x11'));var as=require(_0x8fa6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8fa6('0x13'));var utils=require(_0x8fa6('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8fa6('0x15'));var db=require(_0x8fa6('0x16'))['db'];config['redis']=_[_0x8fa6('0x17')](config[_0x8fa6('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x8fa6('0x19'))(new Redis(config[_0x8fa6('0x18')]));require(_0x8fa6('0x1a'))[_0x8fa6('0x1b')](socket);var jayson=require(_0x8fa6('0x1c'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x8fa6('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1425a7,_0x22bb50,_0x31f6ff,_0x51eb50){return new BPromise(function(_0x210bfe,_0x44347f){var _0x300f68=_0x51eb50||client;return _0x300f68['request'](_0x1425a7,_0x31f6ff)[_0x8fa6('0x1e')](function(_0x2f7baf){logger[_0x8fa6('0x1f')](_0x8fa6('0x20'),_0x22bb50,'request\x20sent');logger[_0x8fa6('0x21')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x22bb50,_0x8fa6('0x22'),JSON[_0x8fa6('0x23')](_0x2f7baf));if(_0x2f7baf[_0x8fa6('0x24')]){if(_0x2f7baf[_0x8fa6('0x24')]['code']===0x1f4){logger[_0x8fa6('0x24')](_0x8fa6('0x20'),_0x22bb50,_0x2f7baf['error'][_0x8fa6('0x25')]);return _0x44347f(_0x2f7baf[_0x8fa6('0x24')][_0x8fa6('0x25')]);}logger['error'](_0x8fa6('0x20'),_0x22bb50,_0x2f7baf[_0x8fa6('0x24')][_0x8fa6('0x25')]);return _0x210bfe(_0x2f7baf['error']['message']);}else{logger['info'](_0x8fa6('0x20'),_0x22bb50,_0x8fa6('0x22'));_0x210bfe(_0x2f7baf['result']['message']);}})[_0x8fa6('0x26')](function(_0x3f86d8){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x22bb50,_0x3f86d8);_0x44347f(_0x3f86d8);});});}function respondWithStatusCode(_0x1e5bf0,_0x1914bc){_0x1914bc=_0x1914bc||0xcc;return function(_0x424546){if(_0x424546){return _0x1e5bf0['sendStatus'](_0x1914bc);}return _0x1e5bf0[_0x8fa6('0x27')](_0x1914bc)[_0x8fa6('0x28')]();};}function respondWithResult(_0x4bf08b,_0xb59c50){_0xb59c50=_0xb59c50||0xc8;return function(_0x154d67){if(_0x154d67){return _0x4bf08b['status'](_0xb59c50)[_0x8fa6('0x29')](_0x154d67);}};}function respondWithFilteredResult(_0x39cf7c,_0x4cdbdb){return function(_0x5e1a88){if(_0x5e1a88){var _0x23fdc9=typeof _0x4cdbdb[_0x8fa6('0x2a')]==='undefined'&&typeof _0x4cdbdb['limit']===_0x8fa6('0x2b');var _0x39bc49=_0x5e1a88[_0x8fa6('0x2c')];var _0x2fb52d=_0x23fdc9?0x0:_0x4cdbdb[_0x8fa6('0x2a')];var _0x29ea7b=_0x23fdc9?_0x5e1a88[_0x8fa6('0x2c')]:_0x4cdbdb[_0x8fa6('0x2a')]+_0x4cdbdb['limit'];var _0x4b6c54;if(_0x29ea7b>=_0x39bc49){_0x29ea7b=_0x39bc49;_0x4b6c54=0xc8;}else{_0x4b6c54=0xce;}_0x39cf7c[_0x8fa6('0x27')](_0x4b6c54);return _0x39cf7c['set'](_0x8fa6('0x2d'),_0x2fb52d+'-'+_0x29ea7b+'/'+_0x39bc49)[_0x8fa6('0x29')](_0x5e1a88);}return null;};}function patchUpdates(_0x1fbd65){return function(_0x50ed35){try{jsonpatch[_0x8fa6('0x2e')](_0x50ed35,_0x1fbd65,!![]);}catch(_0x2d8f16){return BPromise['reject'](_0x2d8f16);}return _0x50ed35[_0x8fa6('0x2f')]();};}function saveUpdates(_0x246f93,_0x304fed){return function(_0x3afb36){if(_0x3afb36){return _0x3afb36[_0x8fa6('0x30')](_0x246f93)[_0x8fa6('0x1e')](function(_0x365748){return _0x365748;});}return null;};}function removeEntity(_0x442f54,_0x133300){return function(_0x44d3b8){if(_0x44d3b8){return _0x44d3b8[_0x8fa6('0x31')]()[_0x8fa6('0x1e')](function(){var _0x4f86ae=_0x44d3b8[_0x8fa6('0x32')]({'plain':!![]});var _0x4777d4=_0x8fa6('0x33');return db[_0x8fa6('0x34')][_0x8fa6('0x31')]({'where':{'type':_0x4777d4,'resourceId':_0x4f86ae['id']}})[_0x8fa6('0x1e')](function(){return _0x44d3b8;});})[_0x8fa6('0x1e')](function(){_0x442f54['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd0a22c,_0x4f5e91){return function(_0x5e6781){if(!_0x5e6781){_0xd0a22c['sendStatus'](0x194);}return _0x5e6781;};}function handleError(_0x5087d3,_0x4dd6c3){_0x4dd6c3=_0x4dd6c3||0x1f4;return function(_0x55b311){logger[_0x8fa6('0x24')](_0x55b311[_0x8fa6('0x35')]);if(_0x55b311[_0x8fa6('0x36')]){delete _0x55b311['name'];}_0x5087d3['status'](_0x4dd6c3)[_0x8fa6('0x37')](_0x55b311);};}exports[_0x8fa6('0x38')]=function(_0x7044b4,_0x181b19){var _0x5c6428={'include':[{'model':db['Pause'],'as':_0x8fa6('0x39')}]},_0x420a1f={},_0x531c22={'count':0x0,'rows':[]};var _0x3c9985=_[_0x8fa6('0x3a')](db[_0x8fa6('0x3b')][_0x8fa6('0x3c')],function(_0x9b67c){return{'name':_0x9b67c[_0x8fa6('0x3d')],'type':_0x9b67c[_0x8fa6('0x3e')][_0x8fa6('0x3f')]};});_0x420a1f['model']=_[_0x8fa6('0x3a')](_0x3c9985,'name');_0x420a1f[_0x8fa6('0x40')]=_['keys'](_0x7044b4[_0x8fa6('0x40')]);_0x420a1f[_0x8fa6('0x41')]=_[_0x8fa6('0x42')](_0x420a1f['model'],_0x420a1f[_0x8fa6('0x40')]);_0x5c6428['attributes']=_[_0x8fa6('0x42')](_0x420a1f['model'],qs[_0x8fa6('0x43')](_0x7044b4[_0x8fa6('0x40')]['fields']));_0x5c6428[_0x8fa6('0x44')]=_0x5c6428[_0x8fa6('0x44')][_0x8fa6('0x45')]?_0x5c6428['attributes']:_0x420a1f[_0x8fa6('0x46')];if(!_0x7044b4[_0x8fa6('0x40')][_0x8fa6('0x47')](_0x8fa6('0x48'))){_0x5c6428[_0x8fa6('0x49')]=qs[_0x8fa6('0x49')](_0x7044b4[_0x8fa6('0x40')][_0x8fa6('0x49')]);_0x5c6428['offset']=qs[_0x8fa6('0x2a')](_0x7044b4[_0x8fa6('0x40')][_0x8fa6('0x2a')]);}_0x5c6428[_0x8fa6('0x4a')]=qs['sort'](_0x7044b4['query'][_0x8fa6('0x4b')]);_0x5c6428[_0x8fa6('0x4c')]=qs[_0x8fa6('0x41')](_[_0x8fa6('0x4d')](_0x7044b4[_0x8fa6('0x40')],_0x420a1f[_0x8fa6('0x41')]),_0x3c9985);if(_0x7044b4[_0x8fa6('0x40')][_0x8fa6('0x4e')]){_0x5c6428[_0x8fa6('0x4c')]=_[_0x8fa6('0x4f')](_0x5c6428[_0x8fa6('0x4c')],{'$or':_[_0x8fa6('0x3a')](_0x3c9985,function(_0x45b9f8){if(_0x45b9f8[_0x8fa6('0x3e')]!==_0x8fa6('0x50')){var _0x91878f={};_0x91878f[_0x45b9f8[_0x8fa6('0x36')]]={'$like':'%'+_0x7044b4['query'][_0x8fa6('0x4e')]+'%'};return _0x91878f;}})});}_0x5c6428=_[_0x8fa6('0x4f')]({},_0x5c6428,_0x7044b4['options']);var _0x414168={'where':_0x5c6428[_0x8fa6('0x4c')]};return db[_0x8fa6('0x3b')]['count'](_0x414168)['then'](function(_0x1d496b){_0x531c22['count']=_0x1d496b;if(_0x7044b4[_0x8fa6('0x40')][_0x8fa6('0x51')]){_0x5c6428[_0x8fa6('0x52')]=[{'all':!![]}];}return db[_0x8fa6('0x3b')][_0x8fa6('0x53')](_0x5c6428);})['then'](function(_0x1289ca){_0x531c22[_0x8fa6('0x54')]=_0x1289ca;return _0x531c22;})['then'](respondWithFilteredResult(_0x181b19,_0x5c6428))[_0x8fa6('0x26')](handleError(_0x181b19,null));};exports[_0x8fa6('0x55')]=function(_0x2291f2,_0xf99455){var _0x258956={'raw':![],'where':{'id':_0x2291f2['params']['id']},'include':[{'model':db[_0x8fa6('0x56')],'as':_0x8fa6('0x39')}]},_0x2ff245={};_0x2ff245[_0x8fa6('0x46')]=_[_0x8fa6('0x57')](db[_0x8fa6('0x3b')][_0x8fa6('0x3c')]);_0x2ff245[_0x8fa6('0x40')]=_[_0x8fa6('0x57')](_0x2291f2[_0x8fa6('0x40')]);_0x2ff245['filters']=_[_0x8fa6('0x42')](_0x2ff245[_0x8fa6('0x46')],_0x2ff245[_0x8fa6('0x40')]);_0x258956[_0x8fa6('0x44')]=_['intersection'](_0x2ff245[_0x8fa6('0x46')],qs[_0x8fa6('0x43')](_0x2291f2[_0x8fa6('0x40')][_0x8fa6('0x43')]));_0x258956[_0x8fa6('0x44')]=_0x258956[_0x8fa6('0x44')]['length']?_0x258956['attributes']:_0x2ff245[_0x8fa6('0x46')];if(_0x2291f2[_0x8fa6('0x40')][_0x8fa6('0x51')]){_0x258956[_0x8fa6('0x52')]=[{'all':!![]}];}_0x258956=_['merge']({},_0x258956,_0x2291f2[_0x8fa6('0x58')]);return db[_0x8fa6('0x3b')]['find'](_0x258956)[_0x8fa6('0x1e')](handleEntityNotFound(_0xf99455,null))[_0x8fa6('0x1e')](respondWithResult(_0xf99455,null))[_0x8fa6('0x26')](handleError(_0xf99455,null));};exports[_0x8fa6('0x59')]=function(_0x3015ff,_0x4b306f){return db[_0x8fa6('0x3b')]['create'](_0x3015ff[_0x8fa6('0x5a')],{})['then'](function(_0x2dae0d){var _0x41795a=_0x3015ff[_0x8fa6('0x5b')][_0x8fa6('0x32')]({'plain':!![]});if(!_0x41795a)throw new Error(_0x8fa6('0x5c'));if(_0x41795a[_0x8fa6('0x5d')]===_0x8fa6('0x5b')){var _0x503538=_0x2dae0d[_0x8fa6('0x32')]({'plain':!![]});var _0x389bfb=_0x8fa6('0x33');return db['UserProfileSection'][_0x8fa6('0x5e')]({'where':{'name':_0x389bfb,'userProfileId':_0x41795a[_0x8fa6('0x5f')]},'raw':!![]})['then'](function(_0x418532){if(_0x418532&&_0x418532[_0x8fa6('0x60')]===0x0){return db[_0x8fa6('0x34')][_0x8fa6('0x59')]({'name':_0x503538['name'],'resourceId':_0x503538['id'],'type':_0x418532[_0x8fa6('0x36')],'sectionId':_0x418532['id']},{})['then'](function(){return _0x2dae0d;});}else{return _0x2dae0d;}})[_0x8fa6('0x26')](function(_0x2d6f85){logger['error'](_0x8fa6('0x61'),_0x2d6f85);throw _0x2d6f85;});}return _0x2dae0d;})[_0x8fa6('0x1e')](respondWithResult(_0x4b306f,0xc9))[_0x8fa6('0x26')](handleError(_0x4b306f,null));};exports[_0x8fa6('0x30')]=function(_0x5a0a52,_0x287715){if(_0x5a0a52['body']['id']){delete _0x5a0a52[_0x8fa6('0x5a')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x5a0a52[_0x8fa6('0x62')]['id']},'include':[{'model':db[_0x8fa6('0x56')],'as':'mandatoryDispositionPause'}]})[_0x8fa6('0x1e')](handleEntityNotFound(_0x287715,null))[_0x8fa6('0x1e')](saveUpdates(_0x5a0a52[_0x8fa6('0x5a')],null))[_0x8fa6('0x1e')](respondWithResult(_0x287715,null))[_0x8fa6('0x26')](handleError(_0x287715,null));};exports[_0x8fa6('0x31')]=function(_0x544250,_0x558205){return db[_0x8fa6('0x3b')][_0x8fa6('0x5e')]({'where':{'id':_0x544250[_0x8fa6('0x62')]['id']}})[_0x8fa6('0x1e')](handleEntityNotFound(_0x558205,null))[_0x8fa6('0x1e')](removeEntity(_0x558205,null))['catch'](handleError(_0x558205,null));};exports[_0x8fa6('0x63')]=function(_0x3b987d,_0x5a8aa6){return db['OpenchannelAccount'][_0x8fa6('0x63')]()['then'](respondWithResult(_0x5a8aa6,null))[_0x8fa6('0x26')](handleError(_0x5a8aa6,null));};exports['addDisposition']=function(_0x36d85b,_0x232d84,_0x526d4e){if(_0x36d85b['body']['id']){delete _0x36d85b[_0x8fa6('0x5a')]['id'];}return db[_0x8fa6('0x3b')]['find']({'where':{'id':_0x36d85b[_0x8fa6('0x62')]['id']}})[_0x8fa6('0x1e')](handleEntityNotFound(_0x232d84,null))['then'](function(_0x1ca97d){if(_0x1ca97d){_0x36d85b[_0x8fa6('0x5a')][_0x8fa6('0x64')]=_0x1ca97d['id'];return db[_0x8fa6('0x65')]['create'](_0x36d85b['body']);}})[_0x8fa6('0x1e')](respondWithResult(_0x232d84,null))['catch'](handleError(_0x232d84,null));};exports['getDispositions']=function(_0x580910,_0x18d0c8,_0x30d4dd){var _0x408c4e={'raw':![],'where':{}};var _0x129ac7={};var _0x10b08e={'count':0x0,'rows':[]};return db[_0x8fa6('0x3b')]['findOne']({'where':{'id':_0x580910[_0x8fa6('0x62')]['id']}})[_0x8fa6('0x1e')](handleEntityNotFound(_0x18d0c8,null))['then'](function(_0x1d7bf9){if(_0x1d7bf9){_0x129ac7['model']=_[_0x8fa6('0x57')](db[_0x8fa6('0x65')][_0x8fa6('0x3c')]);_0x129ac7['query']=_[_0x8fa6('0x57')](_0x580910['query']);_0x129ac7[_0x8fa6('0x41')]=_['intersection'](_0x129ac7['model'],_0x129ac7[_0x8fa6('0x40')]);_0x408c4e['attributes']=_[_0x8fa6('0x42')](_0x129ac7[_0x8fa6('0x46')],qs['fields'](_0x580910[_0x8fa6('0x40')][_0x8fa6('0x43')]));_0x408c4e[_0x8fa6('0x44')]=_0x408c4e[_0x8fa6('0x44')][_0x8fa6('0x45')]?_0x408c4e[_0x8fa6('0x44')]:_0x129ac7['model'];if(!_0x580910[_0x8fa6('0x40')][_0x8fa6('0x47')](_0x8fa6('0x48'))){_0x408c4e[_0x8fa6('0x49')]=qs[_0x8fa6('0x49')](_0x580910['query'][_0x8fa6('0x49')]);_0x408c4e['offset']=qs[_0x8fa6('0x2a')](_0x580910[_0x8fa6('0x40')][_0x8fa6('0x2a')]);}_0x408c4e[_0x8fa6('0x4a')]=qs['sort'](_0x580910['query']['sort']);_0x408c4e[_0x8fa6('0x4c')]=qs[_0x8fa6('0x41')](_[_0x8fa6('0x4d')](_0x580910[_0x8fa6('0x40')],_0x129ac7[_0x8fa6('0x41')]));_0x408c4e[_0x8fa6('0x4c')][_0x8fa6('0x64')]=_0x1d7bf9['id'];if(_0x580910[_0x8fa6('0x40')][_0x8fa6('0x4e')]){_0x408c4e[_0x8fa6('0x4c')]=_[_0x8fa6('0x4f')](_0x408c4e[_0x8fa6('0x4c')],{'$or':_[_0x8fa6('0x3a')](_0x408c4e['attributes'],function(_0xdf64f3){var _0x1b4189={};_0x1b4189[_0xdf64f3]={'$like':'%'+_0x580910[_0x8fa6('0x40')][_0x8fa6('0x4e')]+'%'};return _0x1b4189;})});}_0x408c4e=_[_0x8fa6('0x4f')]({},_0x408c4e,_0x580910['options']);return db[_0x8fa6('0x65')][_0x8fa6('0x2c')]({'where':_0x408c4e[_0x8fa6('0x4c')]})[_0x8fa6('0x1e')](function(_0x5323ae){_0x10b08e[_0x8fa6('0x2c')]=_0x5323ae;if(_0x580910[_0x8fa6('0x40')][_0x8fa6('0x51')]){_0x408c4e[_0x8fa6('0x52')]=[{'all':!![]}];}return db[_0x8fa6('0x65')][_0x8fa6('0x53')](_0x408c4e);})[_0x8fa6('0x1e')](function(_0xf517fa){_0x10b08e[_0x8fa6('0x54')]=_0xf517fa;return _0x10b08e;});}})['then'](respondWithFilteredResult(_0x18d0c8,_0x408c4e))[_0x8fa6('0x26')](handleError(_0x18d0c8,null));};exports['removeDispositions']=function(_0x8b0197,_0xcf3a53,_0xba785f){return db['OpenchannelAccount'][_0x8fa6('0x5e')]({'where':{'id':_0x8b0197['params']['id']}})['then'](handleEntityNotFound(_0xcf3a53,null))[_0x8fa6('0x1e')](function(_0x4d50cd){if(_0x4d50cd){return _0x4d50cd[_0x8fa6('0x66')](_0x8b0197[_0x8fa6('0x40')]['ids']);}})[_0x8fa6('0x1e')](respondWithStatusCode(_0xcf3a53,null))[_0x8fa6('0x26')](handleError(_0xcf3a53,null));};exports[_0x8fa6('0x67')]=function(_0x56a63f,_0x354e2e,_0x478edc){if(_0x56a63f[_0x8fa6('0x5a')]['id']){delete _0x56a63f[_0x8fa6('0x5a')]['id'];}return db['OpenchannelAccount'][_0x8fa6('0x5e')]({'where':{'id':_0x56a63f[_0x8fa6('0x62')]['id']}})[_0x8fa6('0x1e')](handleEntityNotFound(_0x354e2e,null))[_0x8fa6('0x1e')](function(_0x19c593){if(_0x19c593){_0x56a63f[_0x8fa6('0x5a')][_0x8fa6('0x64')]=_0x19c593['id'];return db['CannedAnswer']['create'](_0x56a63f[_0x8fa6('0x5a')]);}})[_0x8fa6('0x1e')](respondWithResult(_0x354e2e,null))[_0x8fa6('0x26')](handleError(_0x354e2e,null));};exports['getAnswers']=function(_0x27ba58,_0x14fd8c,_0x39fca7){var _0x3b087a={'raw':![],'where':{}};var _0x33b16c={};var _0x53612f={'count':0x0,'rows':[]};return db[_0x8fa6('0x3b')]['findOne']({'where':{'id':_0x27ba58[_0x8fa6('0x62')]['id']}})[_0x8fa6('0x1e')](handleEntityNotFound(_0x14fd8c,null))[_0x8fa6('0x1e')](function(_0xb1b323){if(_0xb1b323){_0x33b16c['model']=_['keys'](db['CannedAnswer']['rawAttributes']);_0x33b16c[_0x8fa6('0x40')]=_['keys'](_0x27ba58[_0x8fa6('0x40')]);_0x33b16c[_0x8fa6('0x41')]=_[_0x8fa6('0x42')](_0x33b16c[_0x8fa6('0x46')],_0x33b16c[_0x8fa6('0x40')]);_0x3b087a[_0x8fa6('0x44')]=_[_0x8fa6('0x42')](_0x33b16c[_0x8fa6('0x46')],qs['fields'](_0x27ba58[_0x8fa6('0x40')]['fields']));_0x3b087a[_0x8fa6('0x44')]=_0x3b087a[_0x8fa6('0x44')][_0x8fa6('0x45')]?_0x3b087a[_0x8fa6('0x44')]:_0x33b16c[_0x8fa6('0x46')];if(!_0x27ba58[_0x8fa6('0x40')][_0x8fa6('0x47')]('nolimit')){_0x3b087a[_0x8fa6('0x49')]=qs['limit'](_0x27ba58[_0x8fa6('0x40')][_0x8fa6('0x49')]);_0x3b087a['offset']=qs[_0x8fa6('0x2a')](_0x27ba58[_0x8fa6('0x40')][_0x8fa6('0x2a')]);}_0x3b087a[_0x8fa6('0x4a')]=qs[_0x8fa6('0x4b')](_0x27ba58['query'][_0x8fa6('0x4b')]);_0x3b087a[_0x8fa6('0x4c')]=qs[_0x8fa6('0x41')](_[_0x8fa6('0x4d')](_0x27ba58['query'],_0x33b16c[_0x8fa6('0x41')]));_0x3b087a[_0x8fa6('0x4c')][_0x8fa6('0x64')]=_0xb1b323['id'];if(_0x27ba58[_0x8fa6('0x40')][_0x8fa6('0x4e')]){_0x3b087a['where']=_[_0x8fa6('0x4f')](_0x3b087a[_0x8fa6('0x4c')],{'$or':_[_0x8fa6('0x3a')](_0x3b087a['attributes'],function(_0x12cd3d){var _0x28aa3c={};_0x28aa3c[_0x12cd3d]={'$like':'%'+_0x27ba58['query'][_0x8fa6('0x4e')]+'%'};return _0x28aa3c;})});}_0x3b087a=_[_0x8fa6('0x4f')]({},_0x3b087a,_0x27ba58[_0x8fa6('0x58')]);return db[_0x8fa6('0x68')][_0x8fa6('0x2c')]({'where':_0x3b087a[_0x8fa6('0x4c')]})[_0x8fa6('0x1e')](function(_0x23ea38){_0x53612f[_0x8fa6('0x2c')]=_0x23ea38;if(_0x27ba58[_0x8fa6('0x40')]['includeAll']){_0x3b087a[_0x8fa6('0x52')]=[{'all':!![]}];}return db[_0x8fa6('0x68')][_0x8fa6('0x53')](_0x3b087a);})[_0x8fa6('0x1e')](function(_0x2eb786){_0x53612f[_0x8fa6('0x54')]=_0x2eb786;return _0x53612f;});}})[_0x8fa6('0x1e')](respondWithFilteredResult(_0x14fd8c,_0x3b087a))[_0x8fa6('0x26')](handleError(_0x14fd8c,null));};exports[_0x8fa6('0x69')]=function(_0x5cc31f,_0x172186,_0x34aeb5){return db[_0x8fa6('0x3b')][_0x8fa6('0x5e')]({'where':{'id':_0x5cc31f['params']['id']}})[_0x8fa6('0x1e')](handleEntityNotFound(_0x172186,null))[_0x8fa6('0x1e')](function(_0x18bced){if(_0x18bced){return _0x18bced[_0x8fa6('0x69')](_0x5cc31f['query'][_0x8fa6('0x6a')]);}})[_0x8fa6('0x1e')](respondWithStatusCode(_0x172186,null))[_0x8fa6('0x26')](handleError(_0x172186,null));};exports['notify']=function(_0x58fce6,_0x260017,_0x32883a){var _0x3f8357={'body':_0x58fce6['body'],'channel':'openchannel'};var _0x5bcf8f=[];var _0x3d7d55=[];var _0x1a0291={};var _0x283557=![];return db[_0x8fa6('0x6b')][_0x8fa6('0x63')]()[_0x8fa6('0x1e')](function(_0x14dff1){if(!_0x14dff1){throw new db[(_0x8fa6('0x6c'))]['ValidationError'](_0x8fa6('0x6d'));}_0x5bcf8f=_[_0x8fa6('0x6e')](_[_0x8fa6('0x57')](_0x14dff1),[_0x8fa6('0x6f'),_0x8fa6('0x70')]);_0x3d7d55=_['difference'](_[_0x8fa6('0x57')](_0x14dff1),[_0x8fa6('0x6f'),_0x8fa6('0x70'),_0x8fa6('0x71'),_0x8fa6('0x72')]);if(_0x58fce6[_0x8fa6('0x5a')]['id']){delete _0x58fce6['body']['id'];}if(_[_0x8fa6('0x73')](_0x58fce6[_0x8fa6('0x5a')][_0x8fa6('0x74')])){throw new db[(_0x8fa6('0x6c'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x58fce6[_0x8fa6('0x5a')][_0x8fa6('0x5a')])||_0x58fce6[_0x8fa6('0x5a')]['body']===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8fa6('0x73')](_0x58fce6[_0x8fa6('0x5a')]['mapKey'])){throw new db[(_0x8fa6('0x6c'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3d7d55);}if(!_[_0x8fa6('0x75')](_0x3d7d55,_0x58fce6[_0x8fa6('0x5a')]['mapKey'])){throw new db[(_0x8fa6('0x6c'))][(_0x8fa6('0x76'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3d7d55);}_0x1a0291[_0x58fce6['body']['mapKey']]=_0x58fce6[_0x8fa6('0x5a')]['from'];})[_0x8fa6('0x1e')](function(){return db[_0x8fa6('0x3b')][_0x8fa6('0x5e')]({'where':{'id':_0x58fce6[_0x8fa6('0x62')]['id']},'include':[{'model':db[_0x8fa6('0x77')],'as':_0x8fa6('0x78'),'include':[{'model':db[_0x8fa6('0x6b')],'as':_0x8fa6('0x79'),'where':_0x1a0291,'limit':0x1,'order':[[_0x8fa6('0x70'),_0x8fa6('0x7a')]]}]},{'model':db[_0x8fa6('0x7b')],'as':_0x8fa6('0x7c')}]});})[_0x8fa6('0x1e')](handleEntityNotFound(_0x260017,null))[_0x8fa6('0x1e')](function(_0x2441ed){if(_0x2441ed&&_0x2441ed[_0x8fa6('0x78')]){_0x3f8357['account']=_0x2441ed;_0x3f8357[_0x8fa6('0x7d')]=_0x2441ed['Applications'];_0x3f8357[_0x8fa6('0x7e')]=_0x2441ed[_0x8fa6('0x78')];_0x3f8357[_0x8fa6('0x7d')]=_[_0x8fa6('0x7f')](_0x3f8357[_0x8fa6('0x7d')],[_0x8fa6('0x80')],[_0x8fa6('0x81')]);if(_0x3f8357[_0x8fa6('0x82')][_0x8fa6('0x7c')]){delete _0x3f8357['account'][_0x8fa6('0x7c')];}if(_0x3f8357[_0x8fa6('0x82')]['List']&&_0x3f8357['account'][_0x8fa6('0x78')][_0x8fa6('0x79')]['length']){return _0x3f8357[_0x8fa6('0x82')]['List'][_0x8fa6('0x79')][0x0];}var _0x487027=_[_0x8fa6('0x17')](_0x58fce6[_0x8fa6('0x5a')],{'firstName':_0x58fce6[_0x8fa6('0x5a')][_0x8fa6('0x74')],'ListId':_0x2441ed['ListId']});_0x487027[_0x58fce6[_0x8fa6('0x5a')]['mapKey']]=_0x58fce6[_0x8fa6('0x5a')][_0x8fa6('0x74')];return db['CmContact'][_0x8fa6('0x59')](_0x487027,{'fields':_0x5bcf8f,'raw':!![]});}})[_0x8fa6('0x1e')](handleEntityNotFound(_0x260017,null))[_0x8fa6('0x1e')](function(_0x1bea8d){_0x3f8357['contact']=_0x1bea8d;if(_0x1bea8d){var _0x12de96={'ContactId':_0x1bea8d['id'],'OpenchannelAccountId':_0x58fce6['params']['id'],'from':(_0x1bea8d['firstName']||'')+'\x20'+(_0x1bea8d[_0x8fa6('0x83')]||'')};var _0x3a5456={'OpenchannelAccountId':_0x58fce6['params']['id'],'closed':![]};if(_0x58fce6['body'][_0x8fa6('0x84')]){_0x3a5456[_0x8fa6('0x84')]=_0x58fce6['body']['threadId'];return db[_0x8fa6('0x85')][_0x8fa6('0x5e')]({'where':_0x3a5456})['then'](function(_0x1251a8){if(_0x1251a8){return[_0x1251a8,![]];}_0x12de96[_0x8fa6('0x84')]=_0x58fce6['body'][_0x8fa6('0x84')];_0x12de96[_0x8fa6('0x86')]=_0x58fce6[_0x8fa6('0x5a')][_0x8fa6('0x86')];return db[_0x8fa6('0x85')][_0x8fa6('0x59')](_0x12de96)['then'](function(_0x110c17){return[_0x110c17,!![]];});});}else{_0x3a5456[_0x8fa6('0x84')]=null;}_0x3a5456[_0x8fa6('0x87')]=_0x1bea8d['id'];return db[_0x8fa6('0x85')][_0x8fa6('0x5e')]({'where':_0x3a5456})[_0x8fa6('0x1e')](function(_0x1978cf){if(_0x1978cf){return[_0x1978cf,![]];}return db[_0x8fa6('0x85')][_0x8fa6('0x59')](_0x12de96)[_0x8fa6('0x1e')](function(_0x1ec335){return[_0x1ec335,!![]];});});}})[_0x8fa6('0x88')](function(_0x5f01b7,_0x90aa05){if(_0x5f01b7){_0x283557=_0x90aa05;if(!_0x90aa05){var _0x2f750b={'from':(_0x3f8357[_0x8fa6('0x89')][_0x8fa6('0x8a')]||'')+'\x20'+(_0x3f8357[_0x8fa6('0x89')][_0x8fa6('0x83')]||'')};if(_0x58fce6[_0x8fa6('0x5a')]['threadId']&&_0x58fce6[_0x8fa6('0x5a')][_0x8fa6('0x8b')]&&_0x58fce6[_0x8fa6('0x5a')][_0x8fa6('0x84')]!=_0x58fce6[_0x8fa6('0x5a')][_0x8fa6('0x8b')]){_0x2f750b[_0x8fa6('0x84')]=_0x58fce6[_0x8fa6('0x5a')]['messageId'];}return _0x5f01b7[_0x8fa6('0x30')](_0x2f750b);}else{return _0x5f01b7;}}})['then'](function(_0x551c19){_0x3f8357[_0x8fa6('0x8c')]=_0x551c19['get']({'plain':!![]});_0x3f8357[_0x8fa6('0x8c')][_0x8fa6('0x8d')]=_0x283557;if(_0x3f8357[_0x8fa6('0x8c')]['created']){if(_0x3f8357['account'][_0x8fa6('0x8e')]){_0x3f8357[_0x8fa6('0x7d')]['push']({'id':0x0,'priority':_0x3f8357['applications'][_0x8fa6('0x45')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x8fa6('0x8f')});}}return db['OpenchannelMessage'][_0x8fa6('0x59')]({'body':_0x58fce6[_0x8fa6('0x5a')]['body'],'OpenchannelAccountId':_0x58fce6['params']['id'],'OpenchannelInteractionId':_0x551c19['id'],'direction':'in','ContactId':_0x3f8357['contact']['id'],'AttachmentId':_0x58fce6[_0x8fa6('0x5a')]['AttachmentId']});})[_0x8fa6('0x1e')](function(_0x2fe0a8){_0x3f8357[_0x8fa6('0x25')]=_0x2fe0a8;if(_0x3f8357[_0x8fa6('0x8c')][_0x8fa6('0x90')]){return db[_0x8fa6('0x91')]['find']({'attributes':['id',_0x8fa6('0x36')],'where':{'id':_0x3f8357[_0x8fa6('0x8c')][_0x8fa6('0x90')]}})[_0x8fa6('0x1e')](function(_0x29670b){if(_0x29670b){_0x3f8357[_0x8fa6('0x7d')][_0x8fa6('0x92')]({'id':0x0,'priority':0x0,'app':_0x8fa6('0x93'),'appdata':_0x29670b['name']+','+(_0x3f8357[_0x8fa6('0x82')]['waitForTheAssignedAgent']||0xa),'interval':_0x8fa6('0x8f')});_0x3f8357['forcedOwnership']=![];}return respondWithRpcPromise(_0x8fa6('0x94'),'startRouting',_0x3f8357);});}return respondWithRpcPromise(_0x8fa6('0x94'),_0x8fa6('0x95'),_0x3f8357);})[_0x8fa6('0x1e')](function(_0x166629){respondWithRpcPromise(_0x8fa6('0x96'),_0x8fa6('0x96'),{'event':_0x8fa6('0x97'),'message':_0x166629},client9002);return _0x166629;})['then'](respondWithResult(_0x260017,null))[_0x8fa6('0x26')](handleError(_0x260017,null));};exports[_0x8fa6('0x98')]=function(_0xdf963,_0x46c623){var _0x3426eb=_0xdf963[_0x8fa6('0x62')]['id'];var _0x2fc740=_0xdf963[_0x8fa6('0x5a')];var _0x2c685d=0xc8;var _0x533361=null;return db[_0x8fa6('0x99')][_0x8fa6('0x9a')]({'isolationLevel':db[_0x8fa6('0x99')][_0x8fa6('0x9b')][_0x8fa6('0x9c')][_0x8fa6('0x9d')]},function(_0x271793){return db[_0x8fa6('0x3b')]['findOne']({'where':{'id':_0x3426eb},'transaction':_0x271793})['then'](function(_0x404ecb){if(_0x404ecb){return db[_0x8fa6('0x7b')][_0x8fa6('0x31')]({'where':{'OpenchannelAccountId':_0x3426eb},'transaction':_0x271793})[_0x8fa6('0x1e')](function(){var _0xfe4fa6=_[_0x8fa6('0x3a')](_0x2fc740,function(_0x559598){_0x559598['OpenchannelAccountId']=_0x3426eb;return _0x559598;});return db['OpenchannelApplication'][_0x8fa6('0x9e')](_0xfe4fa6,{'transaction':_0x271793});});}else{_0x2c685d=0x194;_0x533361=[];}});})[_0x8fa6('0x1e')](function(){if(_0x2c685d!==0x194){return db['OpenchannelApplication'][_0x8fa6('0x9f')]({'where':{'OpenchannelAccountId':_0x3426eb},'order':_0x8fa6('0x80')})['then'](function(_0x191849){_0x533361=_0x191849;});}})[_0x8fa6('0x26')](function(_0x4a77c1){_0x2c685d=0x1f4;logger[_0x8fa6('0x24')](_0x4a77c1[_0x8fa6('0x35')]);if(_0x4a77c1[_0x8fa6('0x36')]){delete _0x4a77c1[_0x8fa6('0x36')];}_0x533361=_0x4a77c1;})['finally'](function(){if(_0x533361===null){_0x46c623[_0x8fa6('0xa0')](_0x2c685d);}else{if(_0x2c685d===0x1f4){_0x46c623[_0x8fa6('0x27')](_0x2c685d)[_0x8fa6('0x37')](_0x533361);}else{_0x46c623[_0x8fa6('0x27')](_0x2c685d)['json'](_0x533361);}}});};exports[_0x8fa6('0xa1')]=function(_0x551217,_0x88d929,_0x2c38ed){var _0x3f79dc={};var _0xa640ca={};var _0x2051e1;var _0x5449dc;return db[_0x8fa6('0x3b')][_0x8fa6('0xa2')]({'where':{'id':_0x551217[_0x8fa6('0x62')]['id']}})[_0x8fa6('0x1e')](handleEntityNotFound(_0x88d929,null))[_0x8fa6('0x1e')](function(_0x414845){if(_0x414845){_0x2051e1=_0x414845;_0xa640ca[_0x8fa6('0x46')]=_[_0x8fa6('0x57')](db[_0x8fa6('0x7b')]['rawAttributes']);_0xa640ca['query']=_[_0x8fa6('0x57')](_0x551217[_0x8fa6('0x40')]);_0xa640ca[_0x8fa6('0x41')]=_[_0x8fa6('0x42')](_0xa640ca[_0x8fa6('0x46')],_0xa640ca[_0x8fa6('0x40')]);_0x3f79dc[_0x8fa6('0x44')]=_['intersection'](_0xa640ca[_0x8fa6('0x46')],qs[_0x8fa6('0x43')](_0x551217['query']['fields']));_0x3f79dc[_0x8fa6('0x44')]=_0x3f79dc[_0x8fa6('0x44')][_0x8fa6('0x45')]?_0x3f79dc[_0x8fa6('0x44')]:_0xa640ca[_0x8fa6('0x46')];_0x3f79dc[_0x8fa6('0x4a')]=qs[_0x8fa6('0x4b')](_0x551217['query'][_0x8fa6('0x4b')]);_0x3f79dc[_0x8fa6('0x4c')]=qs[_0x8fa6('0x41')](_[_0x8fa6('0x4d')](_0x551217[_0x8fa6('0x40')],_0xa640ca[_0x8fa6('0x41')]));if(_0x551217['query'][_0x8fa6('0x4e')]){_0x3f79dc[_0x8fa6('0x4c')]=_[_0x8fa6('0x4f')](_0x3f79dc[_0x8fa6('0x4c')],{'$or':_[_0x8fa6('0x3a')](_0x3f79dc['attributes'],function(_0x192be1){var _0x5d086e={};_0x5d086e[_0x192be1]={'$like':'%'+_0x551217[_0x8fa6('0x40')][_0x8fa6('0x4e')]+'%'};return _0x5d086e;})});}_0x3f79dc=_[_0x8fa6('0x4f')]({},_0x3f79dc,_0x551217[_0x8fa6('0x58')]);return _0x2051e1[_0x8fa6('0xa1')](_0x3f79dc);}})['then'](function(_0x20b1e8){if(_0x20b1e8){_0x5449dc=_0x20b1e8[_0x8fa6('0x45')];if(!_0x551217[_0x8fa6('0x40')][_0x8fa6('0x47')]('nolimit')){_0x3f79dc[_0x8fa6('0x49')]=qs['limit'](_0x551217[_0x8fa6('0x40')][_0x8fa6('0x49')]);_0x3f79dc[_0x8fa6('0x2a')]=qs['offset'](_0x551217[_0x8fa6('0x40')]['offset']);}return _0x2051e1['getApplications'](_0x3f79dc);}})[_0x8fa6('0x1e')](function(_0x53c9de){if(_0x53c9de){return _0x53c9de?{'count':_0x5449dc,'rows':_0x53c9de}:null;}})[_0x8fa6('0x1e')](respondWithResult(_0x88d929,null))['catch'](handleError(_0x88d929,null));};exports[_0x8fa6('0xa3')]=function(_0x4ebc2b,_0xcc268,_0x1114af){var _0x260a9d={'raw':![],'where':{}};var _0x3585ba={};var _0x5e1c8e={'count':0x0,'rows':[]};return db[_0x8fa6('0x3b')][_0x8fa6('0xa2')]({'where':{'id':_0x4ebc2b['params']['id']}})[_0x8fa6('0x1e')](handleEntityNotFound(_0xcc268,null))[_0x8fa6('0x1e')](function(_0x29b9cf){if(_0x29b9cf){_0x3585ba[_0x8fa6('0x46')]=_[_0x8fa6('0x57')](db[_0x8fa6('0x85')][_0x8fa6('0x3c')]);_0x3585ba[_0x8fa6('0x40')]=_[_0x8fa6('0x57')](_0x4ebc2b[_0x8fa6('0x40')]);_0x3585ba[_0x8fa6('0x41')]=_[_0x8fa6('0x42')](_0x3585ba[_0x8fa6('0x46')],_0x3585ba[_0x8fa6('0x40')]);_0x260a9d[_0x8fa6('0x44')]=_[_0x8fa6('0x42')](_0x3585ba['model'],qs[_0x8fa6('0x43')](_0x4ebc2b[_0x8fa6('0x40')][_0x8fa6('0x43')]));_0x260a9d[_0x8fa6('0x44')]=_0x260a9d['attributes']['length']?_0x260a9d[_0x8fa6('0x44')]:_0x3585ba['model'];if(!_0x4ebc2b[_0x8fa6('0x40')][_0x8fa6('0x47')]('nolimit')){_0x260a9d[_0x8fa6('0x49')]=qs['limit'](_0x4ebc2b['query'][_0x8fa6('0x49')]);_0x260a9d['offset']=qs['offset'](_0x4ebc2b[_0x8fa6('0x40')][_0x8fa6('0x2a')]);}_0x260a9d['order']=qs[_0x8fa6('0x4b')](_0x4ebc2b['query'][_0x8fa6('0x4b')]);_0x260a9d[_0x8fa6('0x4c')]=qs['filters'](_[_0x8fa6('0x4d')](_0x4ebc2b[_0x8fa6('0x40')],_0x3585ba['filters']));_0x260a9d[_0x8fa6('0x4c')]['OpenchannelAccountId']=_0x29b9cf['id'];if(_0x4ebc2b[_0x8fa6('0x40')][_0x8fa6('0x4e')]){_0x260a9d[_0x8fa6('0x4c')]=_[_0x8fa6('0x4f')](_0x260a9d[_0x8fa6('0x4c')],{'$or':_[_0x8fa6('0x3a')](_0x260a9d[_0x8fa6('0x44')],function(_0x3169c8){var _0x1eb350={};_0x1eb350[_0x3169c8]={'$like':'%'+_0x4ebc2b[_0x8fa6('0x40')][_0x8fa6('0x4e')]+'%'};return _0x1eb350;})});}_0x260a9d=_[_0x8fa6('0x4f')]({},_0x260a9d,_0x4ebc2b['options']);return db[_0x8fa6('0x85')][_0x8fa6('0x2c')]({'where':_0x260a9d[_0x8fa6('0x4c')]})[_0x8fa6('0x1e')](function(_0x4c7e2c){_0x5e1c8e[_0x8fa6('0x2c')]=_0x4c7e2c;if(_0x4ebc2b['query']['includeAll']){_0x260a9d[_0x8fa6('0x52')]=[{'model':db[_0x8fa6('0x6b')],'as':_0x8fa6('0xa4'),'required':![]},{'model':db[_0x8fa6('0x91')],'as':_0x8fa6('0xa5'),'attributes':[_0x8fa6('0x36'),_0x8fa6('0xa6'),'internal'],'required':![]},{'model':db[_0x8fa6('0xa7')],'as':_0x8fa6('0xa8'),'attributes':['id','name',_0x8fa6('0xa9')],'where':_0x4ebc2b[_0x8fa6('0x40')][_0x8fa6('0xaa')]?{'id':_0x4ebc2b['query']['tag']}:undefined,'required':_0x4ebc2b[_0x8fa6('0x40')]['tag']?!![]:![]}];}return db['OpenchannelInteraction']['findAll'](_0x260a9d);})[_0x8fa6('0x1e')](function(_0x4d017a){_0x5e1c8e[_0x8fa6('0x54')]=_0x4d017a;return _0x5e1c8e;});}})[_0x8fa6('0x1e')](respondWithFilteredResult(_0xcc268,_0x260a9d))['catch'](handleError(_0xcc268,null));};exports['addAgents']=function(_0xe506c2,_0x4d5c37,_0x21d4d5){return db[_0x8fa6('0x3b')][_0x8fa6('0x5e')]({'where':{'id':_0xe506c2[_0x8fa6('0x62')]['id']}})[_0x8fa6('0x1e')](handleEntityNotFound(_0x4d5c37,null))[_0x8fa6('0x1e')](function(_0x137ca9){if(_0x137ca9){return _0x137ca9['addAgents'](_0xe506c2[_0x8fa6('0x5a')][_0x8fa6('0x6a')],_['omit'](_0xe506c2[_0x8fa6('0x5a')],[_0x8fa6('0x6a'),'id'])||{})['spread'](function(_0x51c26d){for(var _0x145ca5=0x0;_0x145ca5<_0xe506c2[_0x8fa6('0x5a')][_0x8fa6('0x6a')][_0x8fa6('0x45')];_0x145ca5+=0x1){socket[_0x8fa6('0xab')](_0x8fa6('0xac'),{'UserId':Number(_0xe506c2[_0x8fa6('0x5a')][_0x8fa6('0x6a')][_0x145ca5]),'OpenchannelAccountId':Number(_0xe506c2[_0x8fa6('0x62')]['id'])});}return _0x51c26d;});}})['then'](respondWithResult(_0x4d5c37,null))[_0x8fa6('0x26')](handleError(_0x4d5c37,null));};exports[_0x8fa6('0xad')]=function(_0x493184,_0x40743d,_0xc91c6a){return db[_0x8fa6('0x3b')][_0x8fa6('0x5e')]({'where':{'id':_0x493184[_0x8fa6('0x62')]['id']}})[_0x8fa6('0x1e')](handleEntityNotFound(_0x40743d,null))[_0x8fa6('0x1e')](function(_0x49271e){if(_0x49271e){return _0x49271e[_0x8fa6('0xad')](_0x493184['query'][_0x8fa6('0x6a')])['then'](function(){if(_[_0x8fa6('0xae')](_0x493184[_0x8fa6('0x40')][_0x8fa6('0x6a')])){for(var _0xab4c8b=0x0;_0xab4c8b<_0x493184[_0x8fa6('0x40')][_0x8fa6('0x6a')][_0x8fa6('0x45')];_0xab4c8b+=0x1){socket[_0x8fa6('0xab')](_0x8fa6('0xaf'),{'UserId':Number(_0x493184[_0x8fa6('0x40')][_0x8fa6('0x6a')][_0xab4c8b]),'OpenchannelAccountId':Number(_0x493184[_0x8fa6('0x62')]['id'])});}}else{socket[_0x8fa6('0xab')](_0x8fa6('0xaf'),{'UserId':Number(_0x493184['query']['ids']),'OpenchannelAccountId':Number(_0x493184[_0x8fa6('0x62')]['id'])});}});}})['then'](respondWithStatusCode(_0x40743d,null))[_0x8fa6('0x26')](handleError(_0x40743d,null));};exports[_0x8fa6('0xb0')]=function(_0x1ef281,_0xf5af38,_0x4f28b5){var _0x118f12={};var _0x518941={};var _0x15b0c0;var _0x913c3c;return db[_0x8fa6('0x3b')]['findOne']({'where':{'id':_0x1ef281[_0x8fa6('0x62')]['id']}})[_0x8fa6('0x1e')](handleEntityNotFound(_0xf5af38,null))['then'](function(_0x27289c){if(_0x27289c){_0x15b0c0=_0x27289c;_0x518941[_0x8fa6('0x46')]=_[_0x8fa6('0x57')](db[_0x8fa6('0x91')][_0x8fa6('0x3c')]);_0x518941[_0x8fa6('0x40')]=_['keys'](_0x1ef281[_0x8fa6('0x40')]);_0x518941[_0x8fa6('0x41')]=_['intersection'](_0x518941[_0x8fa6('0x46')],_0x518941[_0x8fa6('0x40')]);_0x118f12[_0x8fa6('0x44')]=_[_0x8fa6('0x42')](_0x518941[_0x8fa6('0x46')],qs['fields'](_0x1ef281[_0x8fa6('0x40')][_0x8fa6('0x43')]));_0x118f12['attributes']=_0x118f12[_0x8fa6('0x44')][_0x8fa6('0x45')]?_0x118f12[_0x8fa6('0x44')]:_0x518941[_0x8fa6('0x46')];_0x118f12[_0x8fa6('0x4a')]=qs[_0x8fa6('0x4b')](_0x1ef281['query'][_0x8fa6('0x4b')]);_0x118f12[_0x8fa6('0x4c')]=qs[_0x8fa6('0x41')](_[_0x8fa6('0x4d')](_0x1ef281[_0x8fa6('0x40')],_0x518941['filters']));if(_0x1ef281[_0x8fa6('0x40')][_0x8fa6('0x4e')]){_0x118f12[_0x8fa6('0x4c')]=_[_0x8fa6('0x4f')](_0x118f12[_0x8fa6('0x4c')],{'$or':_['map'](_0x118f12[_0x8fa6('0x44')],function(_0xbacf5a){var _0x284c0a={};_0x284c0a[_0xbacf5a]={'$like':'%'+_0x1ef281[_0x8fa6('0x40')][_0x8fa6('0x4e')]+'%'};return _0x284c0a;})});}_0x118f12=_[_0x8fa6('0x4f')]({},_0x118f12,_0x1ef281[_0x8fa6('0x58')]);return _0x15b0c0[_0x8fa6('0xb0')](_0x118f12);}})[_0x8fa6('0x1e')](function(_0x50351e){if(_0x50351e){_0x913c3c=_0x50351e[_0x8fa6('0x45')];if(!_0x1ef281[_0x8fa6('0x40')]['hasOwnProperty'](_0x8fa6('0x48'))){_0x118f12[_0x8fa6('0x49')]=qs[_0x8fa6('0x49')](_0x1ef281[_0x8fa6('0x40')]['limit']);_0x118f12[_0x8fa6('0x2a')]=qs['offset'](_0x1ef281['query'][_0x8fa6('0x2a')]);}return _0x15b0c0[_0x8fa6('0xb0')](_0x118f12);}})['then'](function(_0x2c7250){if(_0x2c7250){return _0x2c7250?{'count':_0x913c3c,'rows':_0x2c7250}:null;}})['then'](respondWithResult(_0xf5af38,null))[_0x8fa6('0x26')](handleError(_0xf5af38,null));};exports[_0x8fa6('0x37')]=function(_0x35807c,_0x49b60a,_0x70b4b6){var _0x5d86b1,_0x242ccf,_0x1505c5;if(_['isNil'](_0x35807c[_0x8fa6('0x5a')]['body'])||_0x35807c['body']['body']===''){throw new db[(_0x8fa6('0x6c'))][(_0x8fa6('0x76'))](_0x8fa6('0xb1'));}if(_['isNil'](_0x35807c[_0x8fa6('0x5a')]['to'])){}_0x5d86b1=_0x35807c['body']['to'];return db['OpenchannelAccount'][_0x8fa6('0xa2')]({'where':{'id':_0x35807c[_0x8fa6('0x62')]['id']}})['then'](handleEntityNotFound(_0x49b60a,null))[_0x8fa6('0x1e')](function(_0x10b036){if(_0x10b036){return db[_0x8fa6('0x3b')][_0x8fa6('0x5e')]({'where':{'id':_0x10b036['id']},'include':[{'model':db[_0x8fa6('0x77')],'as':_0x8fa6('0x78'),'include':[{'model':db[_0x8fa6('0x6b')],'as':'Contacts','where':{[_0x10b036[_0x8fa6('0xb2')]]:_0x5d86b1},'limit':0x1,'order':[[_0x8fa6('0x70'),_0x8fa6('0x7a')]]}]}]})[_0x8fa6('0x1e')](handleEntityNotFound(_0x49b60a,null))['then'](function(_0x1bb14b){if(_0x1bb14b&&_0x1bb14b[_0x8fa6('0x78')]){_0x242ccf=_0x1bb14b[_0x8fa6('0x32')]({'plain':!![]});if(_0x242ccf[_0x8fa6('0x78')]&&_0x242ccf['List'][_0x8fa6('0x79')][_0x8fa6('0x45')]){return _0x242ccf[_0x8fa6('0x78')][_0x8fa6('0x79')][0x0];}return db['CmContact'][_0x8fa6('0x59')](_[_0x8fa6('0x17')](_0x35807c[_0x8fa6('0x5a')],{'firstName':_0x5d86b1,[_0x1bb14b['mapKey']]:_0x5d86b1,'phone':_0x5d86b1,'ListId':_0x242ccf[_0x8fa6('0x72')]}));}})[_0x8fa6('0x1e')](handleEntityNotFound(_0x49b60a,null))[_0x8fa6('0x1e')](function(_0x30e82d){if(_0x30e82d){_0x1505c5=_0x30e82d;return db[_0x8fa6('0x85')][_0x8fa6('0x5e')]({'where':{'ContactId':_0x1505c5['id'],'closed':![],'OpenchannelAccountId':_0x242ccf['id']}})[_0x8fa6('0x1e')](function(_0x2a7ecd){if(_0x2a7ecd){return[_0x2a7ecd,![]];}return db['OpenchannelInteraction'][_0x8fa6('0x59')]({'UserId':_0x35807c[_0x8fa6('0x5b')]['id'],'ContactId':_0x1505c5['id'],'OpenchannelAccountId':_0x242ccf['id'],'lastMsgDirection':_0x8fa6('0xb3'),'firstMsgDirection':'out','Messages':[_[_0x8fa6('0x4f')](_0x35807c[_0x8fa6('0x5a')],{'read':![],'body':_0x35807c['body'][_0x8fa6('0x5a')],'OpenchannelAccountId':_0x242ccf['id'],'UserId':_0x35807c[_0x8fa6('0x5b')]['id'],'ContactId':_0x1505c5['id']})]},{'include':[{'model':db[_0x8fa6('0xb4')],'as':_0x8fa6('0xb5')}]})[_0x8fa6('0x1e')](function(_0x3df03d){return[_0x3df03d,!![]];});});}})[_0x8fa6('0x88')](function(_0x340010,_0x9e5318){if(_0x9e5318){return _0x340010;}return db[_0x8fa6('0xb4')][_0x8fa6('0x59')](_['merge'](_0x35807c[_0x8fa6('0x5a')],{'read':![],'body':_0x35807c[_0x8fa6('0x5a')][_0x8fa6('0x5a')],'OpenchannelAccountId':_0x242ccf['id'],'OpenchannelInteractionId':_0x340010['id'],'UserId':_0x35807c['user']['id'],'ContactId':_0x1505c5['id']}))[_0x8fa6('0x1e')](function(_0x43758d){_0x340010[_0x8fa6('0xb6')][_0x8fa6('0xb5')]=[];_0x340010[_0x8fa6('0xb6')][_0x8fa6('0xb5')][_0x8fa6('0xb7')](_0x43758d['dataValues']);return _0x340010;});});}})['then'](respondWithResult(_0x49b60a,null))[_0x8fa6('0x26')](handleError(_0x49b60a,null));}; \ No newline at end of file +var _0x6666=['filter','options','include','findAll','rows','show','Pause','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','params','OpenchannelAccountId','Disposition','findOne','order','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','notify','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','ListId','isNil','from','ValidationError','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','updatedAt','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','Contacts','contact','firstName','threadId','externalUrl','OpenchannelInteraction','ContactId','messageId','interaction','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','bulkCreate','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','defaults','out','Messages','spread','dataValues','eml-format','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','localhost','redis','./openchannelAccount.socket','jayson/promise','client','http','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','json','offset','limit','undefined','count','status','set','reject','save','update','get','OpenchannelAccounts','UserProfileResource','destroy','then','end','stack','name','send','index','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','query','sort','pick','merge','where','type','VIRTUAL'];(function(_0x4f85df,_0xe123ae){var _0xf067e4=function(_0x5cdb5b){while(--_0x5cdb5b){_0x4f85df['push'](_0x4f85df['shift']());}};_0xf067e4(++_0xe123ae);}(_0x6666,0x6e));var _0x6666=function(_0x445c98,_0x132bf7){_0x445c98=_0x445c98-0x0;var _0x2fe913=_0x6666[_0x445c98];return _0x2fe913;};'use strict';var emlformat=require(_0x6666('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6666('0x1'));var BPromise=require(_0x6666('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6666('0x3'));var sox=require(_0x6666('0x4'));var csv=require(_0x6666('0x5'));var ejs=require(_0x6666('0x6'));var fs=require('fs');var fs_extra=require(_0x6666('0x7'));var _=require(_0x6666('0x8'));var squel=require(_0x6666('0x9'));var crypto=require(_0x6666('0xa'));var jsforce=require(_0x6666('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6666('0x5'));var querystring=require(_0x6666('0xc'));var Papa=require(_0x6666('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6666('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6666('0xf'));var logger=require('../../config/logger')(_0x6666('0x10'));var utils=require('../../config/utils');var config=require(_0x6666('0x11'));var licenseUtil=require(_0x6666('0x12'));var db=require(_0x6666('0x13'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x6666('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6666('0x15')]));require(_0x6666('0x16'))['register'](socket);var jayson=require(_0x6666('0x17'));var client=jayson[_0x6666('0x18')][_0x6666('0x19')]({'port':0x232c});var client9002=jayson[_0x6666('0x18')][_0x6666('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x403ef1,_0x5ccfe0,_0x52762c,_0xf731ec){return new BPromise(function(_0x2fb265,_0x46a7ce){var _0x4c7f2d=_0xf731ec||client;return _0x4c7f2d[_0x6666('0x1a')](_0x403ef1,_0x52762c)['then'](function(_0x38331d){logger[_0x6666('0x1b')](_0x6666('0x1c'),_0x5ccfe0,_0x6666('0x1d'));logger[_0x6666('0x1e')](_0x6666('0x1f'),_0x5ccfe0,'request\x20sent',JSON['stringify'](_0x38331d));if(_0x38331d[_0x6666('0x20')]){if(_0x38331d['error'][_0x6666('0x21')]===0x1f4){logger[_0x6666('0x20')]('OpenchannelAccount,\x20%s,\x20%s',_0x5ccfe0,_0x38331d[_0x6666('0x20')][_0x6666('0x22')]);return _0x46a7ce(_0x38331d['error']['message']);}logger[_0x6666('0x20')](_0x6666('0x1c'),_0x5ccfe0,_0x38331d['error'][_0x6666('0x22')]);return _0x2fb265(_0x38331d[_0x6666('0x20')][_0x6666('0x22')]);}else{logger[_0x6666('0x1b')](_0x6666('0x1c'),_0x5ccfe0,_0x6666('0x1d'));_0x2fb265(_0x38331d[_0x6666('0x23')][_0x6666('0x22')]);}})[_0x6666('0x24')](function(_0x3d53b3){logger[_0x6666('0x20')](_0x6666('0x1c'),_0x5ccfe0,_0x3d53b3);_0x46a7ce(_0x3d53b3);});});}function respondWithStatusCode(_0xdc7770,_0x20ffb3){_0x20ffb3=_0x20ffb3||0xcc;return function(_0x1c20d6){if(_0x1c20d6){return _0xdc7770[_0x6666('0x25')](_0x20ffb3);}return _0xdc7770['status'](_0x20ffb3)['end']();};}function respondWithResult(_0x41fb17,_0xfd74d8){_0xfd74d8=_0xfd74d8||0xc8;return function(_0x415a51){if(_0x415a51){return _0x41fb17['status'](_0xfd74d8)[_0x6666('0x26')](_0x415a51);}};}function respondWithFilteredResult(_0x509dab,_0xe911f2){return function(_0x321b1f){if(_0x321b1f){var _0x3c7522=typeof _0xe911f2[_0x6666('0x27')]==='undefined'&&typeof _0xe911f2[_0x6666('0x28')]===_0x6666('0x29');var _0x2e928e=_0x321b1f['count'];var _0x41d53d=_0x3c7522?0x0:_0xe911f2['offset'];var _0x8aef6b=_0x3c7522?_0x321b1f[_0x6666('0x2a')]:_0xe911f2['offset']+_0xe911f2['limit'];var _0x1560fe;if(_0x8aef6b>=_0x2e928e){_0x8aef6b=_0x2e928e;_0x1560fe=0xc8;}else{_0x1560fe=0xce;}_0x509dab[_0x6666('0x2b')](_0x1560fe);return _0x509dab[_0x6666('0x2c')]('Content-Range',_0x41d53d+'-'+_0x8aef6b+'/'+_0x2e928e)[_0x6666('0x26')](_0x321b1f);}return null;};}function patchUpdates(_0xa9217f){return function(_0x58c079){try{jsonpatch['apply'](_0x58c079,_0xa9217f,!![]);}catch(_0x297ce3){return BPromise[_0x6666('0x2d')](_0x297ce3);}return _0x58c079[_0x6666('0x2e')]();};}function saveUpdates(_0x1bb72a,_0x295a7e){return function(_0x4535f2){if(_0x4535f2){return _0x4535f2[_0x6666('0x2f')](_0x1bb72a)['then'](function(_0x583cb2){return _0x583cb2;});}return null;};}function removeEntity(_0x33237a,_0x227be1){return function(_0x551568){if(_0x551568){return _0x551568['destroy']()['then'](function(){var _0x14532b=_0x551568[_0x6666('0x30')]({'plain':!![]});var _0x1309aa=_0x6666('0x31');return db[_0x6666('0x32')][_0x6666('0x33')]({'where':{'type':_0x1309aa,'resourceId':_0x14532b['id']}})[_0x6666('0x34')](function(){return _0x551568;});})[_0x6666('0x34')](function(){_0x33237a[_0x6666('0x2b')](0xcc)[_0x6666('0x35')]();});}};}function handleEntityNotFound(_0x2e4ed4,_0x3ea400){return function(_0x34f908){if(!_0x34f908){_0x2e4ed4['sendStatus'](0x194);}return _0x34f908;};}function handleError(_0x43bddd,_0x448631){_0x448631=_0x448631||0x1f4;return function(_0x1f99c4){logger['error'](_0x1f99c4[_0x6666('0x36')]);if(_0x1f99c4['name']){delete _0x1f99c4[_0x6666('0x37')];}_0x43bddd[_0x6666('0x2b')](_0x448631)[_0x6666('0x38')](_0x1f99c4);};}exports[_0x6666('0x39')]=function(_0xb16932,_0x3d8ca9){var _0x4d68f2={'include':[{'model':db['Pause'],'as':_0x6666('0x3a')}]},_0x39eda5={},_0x47f9b5={'count':0x0,'rows':[]};var _0x278399=_[_0x6666('0x3b')](db[_0x6666('0x3c')][_0x6666('0x3d')],function(_0x349884){return{'name':_0x349884['fieldName'],'type':_0x349884['type']['key']};});_0x39eda5['model']=_[_0x6666('0x3b')](_0x278399,_0x6666('0x37'));_0x39eda5['query']=_[_0x6666('0x3e')](_0xb16932['query']);_0x39eda5[_0x6666('0x3f')]=_['intersection'](_0x39eda5['model'],_0x39eda5['query']);_0x4d68f2[_0x6666('0x40')]=_[_0x6666('0x41')](_0x39eda5[_0x6666('0x42')],qs[_0x6666('0x43')](_0xb16932['query'][_0x6666('0x43')]));_0x4d68f2[_0x6666('0x40')]=_0x4d68f2[_0x6666('0x40')][_0x6666('0x44')]?_0x4d68f2['attributes']:_0x39eda5[_0x6666('0x42')];if(!_0xb16932['query'][_0x6666('0x45')](_0x6666('0x46'))){_0x4d68f2[_0x6666('0x28')]=qs[_0x6666('0x28')](_0xb16932[_0x6666('0x47')][_0x6666('0x28')]);_0x4d68f2[_0x6666('0x27')]=qs[_0x6666('0x27')](_0xb16932['query']['offset']);}_0x4d68f2['order']=qs[_0x6666('0x48')](_0xb16932[_0x6666('0x47')]['sort']);_0x4d68f2['where']=qs['filters'](_[_0x6666('0x49')](_0xb16932[_0x6666('0x47')],_0x39eda5[_0x6666('0x3f')]),_0x278399);if(_0xb16932[_0x6666('0x47')]['filter']){_0x4d68f2['where']=_[_0x6666('0x4a')](_0x4d68f2[_0x6666('0x4b')],{'$or':_[_0x6666('0x3b')](_0x278399,function(_0x2b057e){if(_0x2b057e[_0x6666('0x4c')]!==_0x6666('0x4d')){var _0x1e3b04={};_0x1e3b04[_0x2b057e[_0x6666('0x37')]]={'$like':'%'+_0xb16932[_0x6666('0x47')][_0x6666('0x4e')]+'%'};return _0x1e3b04;}})});}_0x4d68f2=_[_0x6666('0x4a')]({},_0x4d68f2,_0xb16932[_0x6666('0x4f')]);var _0x5988c1={'where':_0x4d68f2[_0x6666('0x4b')]};return db[_0x6666('0x3c')][_0x6666('0x2a')](_0x5988c1)[_0x6666('0x34')](function(_0xf066f3){_0x47f9b5['count']=_0xf066f3;if(_0xb16932[_0x6666('0x47')]['includeAll']){_0x4d68f2[_0x6666('0x50')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x6666('0x51')](_0x4d68f2);})[_0x6666('0x34')](function(_0x3de365){_0x47f9b5[_0x6666('0x52')]=_0x3de365;return _0x47f9b5;})[_0x6666('0x34')](respondWithFilteredResult(_0x3d8ca9,_0x4d68f2))['catch'](handleError(_0x3d8ca9,null));};exports[_0x6666('0x53')]=function(_0x1df08b,_0x241f3d){var _0x2907c3={'raw':![],'where':{'id':_0x1df08b['params']['id']},'include':[{'model':db[_0x6666('0x54')],'as':_0x6666('0x3a')}]},_0x4af047={};_0x4af047[_0x6666('0x42')]=_[_0x6666('0x3e')](db[_0x6666('0x3c')][_0x6666('0x3d')]);_0x4af047[_0x6666('0x47')]=_[_0x6666('0x3e')](_0x1df08b[_0x6666('0x47')]);_0x4af047[_0x6666('0x3f')]=_[_0x6666('0x41')](_0x4af047['model'],_0x4af047[_0x6666('0x47')]);_0x2907c3[_0x6666('0x40')]=_['intersection'](_0x4af047[_0x6666('0x42')],qs['fields'](_0x1df08b['query']['fields']));_0x2907c3[_0x6666('0x40')]=_0x2907c3[_0x6666('0x40')][_0x6666('0x44')]?_0x2907c3[_0x6666('0x40')]:_0x4af047['model'];if(_0x1df08b[_0x6666('0x47')][_0x6666('0x55')]){_0x2907c3[_0x6666('0x50')]=[{'all':!![]}];}_0x2907c3=_[_0x6666('0x4a')]({},_0x2907c3,_0x1df08b['options']);return db['OpenchannelAccount'][_0x6666('0x56')](_0x2907c3)[_0x6666('0x34')](handleEntityNotFound(_0x241f3d,null))[_0x6666('0x34')](respondWithResult(_0x241f3d,null))[_0x6666('0x24')](handleError(_0x241f3d,null));};exports[_0x6666('0x57')]=function(_0x3b0431,_0x2b03f9){return db['OpenchannelAccount']['create'](_0x3b0431['body'],{})[_0x6666('0x34')](function(_0x129dd0){var _0x2b0bde=_0x3b0431['user'][_0x6666('0x30')]({'plain':!![]});if(!_0x2b0bde)throw new Error(_0x6666('0x58'));if(_0x2b0bde[_0x6666('0x59')]===_0x6666('0x5a')){var _0x4b20c2=_0x129dd0[_0x6666('0x30')]({'plain':!![]});var _0x2fee26=_0x6666('0x31');return db[_0x6666('0x5b')][_0x6666('0x56')]({'where':{'name':_0x2fee26,'userProfileId':_0x2b0bde[_0x6666('0x5c')]},'raw':!![]})[_0x6666('0x34')](function(_0x2fc6e6){if(_0x2fc6e6&&_0x2fc6e6[_0x6666('0x5d')]===0x0){return db[_0x6666('0x32')][_0x6666('0x57')]({'name':_0x4b20c2[_0x6666('0x37')],'resourceId':_0x4b20c2['id'],'type':_0x2fc6e6[_0x6666('0x37')],'sectionId':_0x2fc6e6['id']},{})[_0x6666('0x34')](function(){return _0x129dd0;});}else{return _0x129dd0;}})[_0x6666('0x24')](function(_0x3a1cf3){logger[_0x6666('0x20')](_0x6666('0x5e'),_0x3a1cf3);throw _0x3a1cf3;});}return _0x129dd0;})[_0x6666('0x34')](respondWithResult(_0x2b03f9,0xc9))[_0x6666('0x24')](handleError(_0x2b03f9,null));};exports[_0x6666('0x2f')]=function(_0x564eae,_0x1d553c){if(_0x564eae[_0x6666('0x5f')]['id']){delete _0x564eae['body']['id'];}return db[_0x6666('0x3c')]['find']({'where':{'id':_0x564eae['params']['id']},'include':[{'model':db['Pause'],'as':_0x6666('0x3a')}]})[_0x6666('0x34')](handleEntityNotFound(_0x1d553c,null))[_0x6666('0x34')](saveUpdates(_0x564eae[_0x6666('0x5f')],null))[_0x6666('0x34')](respondWithResult(_0x1d553c,null))[_0x6666('0x24')](handleError(_0x1d553c,null));};exports[_0x6666('0x33')]=function(_0x197127,_0x28738f){return db[_0x6666('0x3c')]['find']({'where':{'id':_0x197127['params']['id']}})[_0x6666('0x34')](handleEntityNotFound(_0x28738f,null))['then'](removeEntity(_0x28738f,null))[_0x6666('0x24')](handleError(_0x28738f,null));};exports['describe']=function(_0x433fc7,_0x154171){return db[_0x6666('0x3c')][_0x6666('0x60')]()[_0x6666('0x34')](respondWithResult(_0x154171,null))['catch'](handleError(_0x154171,null));};exports[_0x6666('0x61')]=function(_0x1e42d1,_0x24a59b,_0x297ceb){if(_0x1e42d1[_0x6666('0x5f')]['id']){delete _0x1e42d1[_0x6666('0x5f')]['id'];}return db[_0x6666('0x3c')][_0x6666('0x56')]({'where':{'id':_0x1e42d1[_0x6666('0x62')]['id']}})[_0x6666('0x34')](handleEntityNotFound(_0x24a59b,null))[_0x6666('0x34')](function(_0x42c670){if(_0x42c670){_0x1e42d1['body'][_0x6666('0x63')]=_0x42c670['id'];return db[_0x6666('0x64')][_0x6666('0x57')](_0x1e42d1[_0x6666('0x5f')]);}})[_0x6666('0x34')](respondWithResult(_0x24a59b,null))['catch'](handleError(_0x24a59b,null));};exports['getDispositions']=function(_0x293fa3,_0x3c2563,_0x27a804){var _0x1dfee6={'raw':![],'where':{}};var _0x308948={};var _0xbc692e={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x6666('0x65')]({'where':{'id':_0x293fa3['params']['id']}})[_0x6666('0x34')](handleEntityNotFound(_0x3c2563,null))[_0x6666('0x34')](function(_0x371909){if(_0x371909){_0x308948[_0x6666('0x42')]=_[_0x6666('0x3e')](db[_0x6666('0x64')][_0x6666('0x3d')]);_0x308948[_0x6666('0x47')]=_['keys'](_0x293fa3[_0x6666('0x47')]);_0x308948[_0x6666('0x3f')]=_['intersection'](_0x308948[_0x6666('0x42')],_0x308948['query']);_0x1dfee6[_0x6666('0x40')]=_[_0x6666('0x41')](_0x308948[_0x6666('0x42')],qs[_0x6666('0x43')](_0x293fa3['query'][_0x6666('0x43')]));_0x1dfee6['attributes']=_0x1dfee6['attributes']['length']?_0x1dfee6[_0x6666('0x40')]:_0x308948['model'];if(!_0x293fa3[_0x6666('0x47')][_0x6666('0x45')](_0x6666('0x46'))){_0x1dfee6[_0x6666('0x28')]=qs[_0x6666('0x28')](_0x293fa3[_0x6666('0x47')][_0x6666('0x28')]);_0x1dfee6[_0x6666('0x27')]=qs[_0x6666('0x27')](_0x293fa3[_0x6666('0x47')]['offset']);}_0x1dfee6[_0x6666('0x66')]=qs['sort'](_0x293fa3[_0x6666('0x47')][_0x6666('0x48')]);_0x1dfee6[_0x6666('0x4b')]=qs[_0x6666('0x3f')](_[_0x6666('0x49')](_0x293fa3[_0x6666('0x47')],_0x308948[_0x6666('0x3f')]));_0x1dfee6[_0x6666('0x4b')][_0x6666('0x63')]=_0x371909['id'];if(_0x293fa3[_0x6666('0x47')][_0x6666('0x4e')]){_0x1dfee6[_0x6666('0x4b')]=_[_0x6666('0x4a')](_0x1dfee6[_0x6666('0x4b')],{'$or':_[_0x6666('0x3b')](_0x1dfee6[_0x6666('0x40')],function(_0x3f9f22){var _0x367f17={};_0x367f17[_0x3f9f22]={'$like':'%'+_0x293fa3[_0x6666('0x47')][_0x6666('0x4e')]+'%'};return _0x367f17;})});}_0x1dfee6=_['merge']({},_0x1dfee6,_0x293fa3[_0x6666('0x4f')]);return db[_0x6666('0x64')][_0x6666('0x2a')]({'where':_0x1dfee6[_0x6666('0x4b')]})[_0x6666('0x34')](function(_0x3b8e01){_0xbc692e[_0x6666('0x2a')]=_0x3b8e01;if(_0x293fa3[_0x6666('0x47')][_0x6666('0x55')]){_0x1dfee6[_0x6666('0x50')]=[{'all':!![]}];}return db[_0x6666('0x64')][_0x6666('0x51')](_0x1dfee6);})['then'](function(_0x2a5de0){_0xbc692e['rows']=_0x2a5de0;return _0xbc692e;});}})[_0x6666('0x34')](respondWithFilteredResult(_0x3c2563,_0x1dfee6))[_0x6666('0x24')](handleError(_0x3c2563,null));};exports[_0x6666('0x67')]=function(_0x5d0258,_0x41982e,_0x532527){return db['OpenchannelAccount']['find']({'where':{'id':_0x5d0258[_0x6666('0x62')]['id']}})[_0x6666('0x34')](handleEntityNotFound(_0x41982e,null))[_0x6666('0x34')](function(_0x4e8de0){if(_0x4e8de0){return _0x4e8de0[_0x6666('0x67')](_0x5d0258[_0x6666('0x47')][_0x6666('0x68')]);}})[_0x6666('0x34')](respondWithStatusCode(_0x41982e,null))[_0x6666('0x24')](handleError(_0x41982e,null));};exports[_0x6666('0x69')]=function(_0x429132,_0x19d89b,_0x586a6a){if(_0x429132[_0x6666('0x5f')]['id']){delete _0x429132['body']['id'];}return db[_0x6666('0x3c')][_0x6666('0x56')]({'where':{'id':_0x429132['params']['id']}})[_0x6666('0x34')](handleEntityNotFound(_0x19d89b,null))[_0x6666('0x34')](function(_0x16dfe9){if(_0x16dfe9){_0x429132[_0x6666('0x5f')][_0x6666('0x63')]=_0x16dfe9['id'];return db[_0x6666('0x6a')][_0x6666('0x57')](_0x429132[_0x6666('0x5f')]);}})['then'](respondWithResult(_0x19d89b,null))[_0x6666('0x24')](handleError(_0x19d89b,null));};exports['getAnswers']=function(_0x4b8afe,_0x538345,_0x8aadc6){var _0x54b540={'raw':![],'where':{}};var _0x4ab3af={};var _0x4ccfa1={'count':0x0,'rows':[]};return db[_0x6666('0x3c')][_0x6666('0x65')]({'where':{'id':_0x4b8afe[_0x6666('0x62')]['id']}})['then'](handleEntityNotFound(_0x538345,null))[_0x6666('0x34')](function(_0x16a5ba){if(_0x16a5ba){_0x4ab3af[_0x6666('0x42')]=_['keys'](db[_0x6666('0x6a')][_0x6666('0x3d')]);_0x4ab3af[_0x6666('0x47')]=_[_0x6666('0x3e')](_0x4b8afe[_0x6666('0x47')]);_0x4ab3af[_0x6666('0x3f')]=_[_0x6666('0x41')](_0x4ab3af[_0x6666('0x42')],_0x4ab3af[_0x6666('0x47')]);_0x54b540['attributes']=_[_0x6666('0x41')](_0x4ab3af[_0x6666('0x42')],qs[_0x6666('0x43')](_0x4b8afe[_0x6666('0x47')][_0x6666('0x43')]));_0x54b540[_0x6666('0x40')]=_0x54b540['attributes'][_0x6666('0x44')]?_0x54b540['attributes']:_0x4ab3af[_0x6666('0x42')];if(!_0x4b8afe[_0x6666('0x47')][_0x6666('0x45')](_0x6666('0x46'))){_0x54b540[_0x6666('0x28')]=qs[_0x6666('0x28')](_0x4b8afe[_0x6666('0x47')][_0x6666('0x28')]);_0x54b540['offset']=qs[_0x6666('0x27')](_0x4b8afe[_0x6666('0x47')]['offset']);}_0x54b540['order']=qs[_0x6666('0x48')](_0x4b8afe[_0x6666('0x47')][_0x6666('0x48')]);_0x54b540[_0x6666('0x4b')]=qs['filters'](_[_0x6666('0x49')](_0x4b8afe[_0x6666('0x47')],_0x4ab3af[_0x6666('0x3f')]));_0x54b540[_0x6666('0x4b')][_0x6666('0x63')]=_0x16a5ba['id'];if(_0x4b8afe[_0x6666('0x47')][_0x6666('0x4e')]){_0x54b540[_0x6666('0x4b')]=_[_0x6666('0x4a')](_0x54b540[_0x6666('0x4b')],{'$or':_[_0x6666('0x3b')](_0x54b540['attributes'],function(_0x463092){var _0x590359={};_0x590359[_0x463092]={'$like':'%'+_0x4b8afe[_0x6666('0x47')][_0x6666('0x4e')]+'%'};return _0x590359;})});}_0x54b540=_[_0x6666('0x4a')]({},_0x54b540,_0x4b8afe[_0x6666('0x4f')]);return db[_0x6666('0x6a')][_0x6666('0x2a')]({'where':_0x54b540[_0x6666('0x4b')]})[_0x6666('0x34')](function(_0x5929c8){_0x4ccfa1['count']=_0x5929c8;if(_0x4b8afe[_0x6666('0x47')][_0x6666('0x55')]){_0x54b540[_0x6666('0x50')]=[{'all':!![]}];}return db[_0x6666('0x6a')][_0x6666('0x51')](_0x54b540);})[_0x6666('0x34')](function(_0x5ec285){_0x4ccfa1[_0x6666('0x52')]=_0x5ec285;return _0x4ccfa1;});}})[_0x6666('0x34')](respondWithFilteredResult(_0x538345,_0x54b540))[_0x6666('0x24')](handleError(_0x538345,null));};exports[_0x6666('0x6b')]=function(_0x4abf7c,_0x352187,_0x484c3d){return db[_0x6666('0x3c')]['find']({'where':{'id':_0x4abf7c['params']['id']}})[_0x6666('0x34')](handleEntityNotFound(_0x352187,null))[_0x6666('0x34')](function(_0x189a57){if(_0x189a57){return _0x189a57[_0x6666('0x6b')](_0x4abf7c[_0x6666('0x47')]['ids']);}})[_0x6666('0x34')](respondWithStatusCode(_0x352187,null))[_0x6666('0x24')](handleError(_0x352187,null));};exports[_0x6666('0x6c')]=function(_0x5b4508,_0x5e0d23,_0x2d0d2e){var _0x3c5a9f={'body':_0x5b4508['body'],'channel':'openchannel'};var _0x34f4cd=[];var _0x2dc02a=[];var _0x14ce11={};var _0x52c8be=![];return db[_0x6666('0x6d')][_0x6666('0x60')]()[_0x6666('0x34')](function(_0x503a9c){if(!_0x503a9c){throw new db[(_0x6666('0x6e'))]['ValidationError'](_0x6666('0x6f'));}_0x34f4cd=_[_0x6666('0x70')](_[_0x6666('0x3e')](_0x503a9c),[_0x6666('0x71'),'updatedAt']);_0x2dc02a=_['difference'](_[_0x6666('0x3e')](_0x503a9c),[_0x6666('0x71'),'updatedAt','CompanyId',_0x6666('0x72')]);if(_0x5b4508[_0x6666('0x5f')]['id']){delete _0x5b4508[_0x6666('0x5f')]['id'];}if(_[_0x6666('0x73')](_0x5b4508[_0x6666('0x5f')][_0x6666('0x74')])){throw new db[(_0x6666('0x6e'))][(_0x6666('0x75'))]('from\x20is\x20mandatory');}if(_[_0x6666('0x73')](_0x5b4508[_0x6666('0x5f')][_0x6666('0x5f')])||_0x5b4508[_0x6666('0x5f')][_0x6666('0x5f')]===''){throw new db[(_0x6666('0x6e'))][(_0x6666('0x75'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x6666('0x73')](_0x5b4508[_0x6666('0x5f')][_0x6666('0x76')])){throw new db['Sequelize']['ValidationError'](_0x6666('0x77')+_0x2dc02a);}if(!_[_0x6666('0x78')](_0x2dc02a,_0x5b4508[_0x6666('0x5f')][_0x6666('0x76')])){throw new db[(_0x6666('0x6e'))][(_0x6666('0x75'))](_0x6666('0x79')+_0x2dc02a);}_0x14ce11[_0x5b4508[_0x6666('0x5f')]['mapKey']]=_0x5b4508[_0x6666('0x5f')][_0x6666('0x74')];})[_0x6666('0x34')](function(){return db[_0x6666('0x3c')][_0x6666('0x56')]({'where':{'id':_0x5b4508[_0x6666('0x62')]['id']},'include':[{'model':db[_0x6666('0x7a')],'as':_0x6666('0x7b'),'include':[{'model':db[_0x6666('0x6d')],'as':'Contacts','where':_0x14ce11,'limit':0x1,'order':[[_0x6666('0x7c'),_0x6666('0x7d')]]}]},{'model':db[_0x6666('0x7e')],'as':_0x6666('0x7f')}]});})['then'](handleEntityNotFound(_0x5e0d23,null))[_0x6666('0x34')](function(_0x529240){if(_0x529240&&_0x529240[_0x6666('0x7b')]){_0x3c5a9f[_0x6666('0x80')]=_0x529240;_0x3c5a9f[_0x6666('0x81')]=_0x529240['Applications'];_0x3c5a9f[_0x6666('0x82')]=_0x529240[_0x6666('0x7b')];_0x3c5a9f[_0x6666('0x81')]=_[_0x6666('0x83')](_0x3c5a9f['applications'],[_0x6666('0x84')],['asc']);if(_0x3c5a9f['account'][_0x6666('0x7f')]){delete _0x3c5a9f['account'][_0x6666('0x7f')];}if(_0x3c5a9f['account'][_0x6666('0x7b')]&&_0x3c5a9f[_0x6666('0x80')][_0x6666('0x7b')]['Contacts']['length']){return _0x3c5a9f[_0x6666('0x80')][_0x6666('0x7b')][_0x6666('0x85')][0x0];}var _0x146d2b=_['defaults'](_0x5b4508[_0x6666('0x5f')],{'firstName':_0x5b4508[_0x6666('0x5f')]['from'],'ListId':_0x529240['ListId']});_0x146d2b[_0x5b4508['body'][_0x6666('0x76')]]=_0x5b4508[_0x6666('0x5f')][_0x6666('0x74')];return db['CmContact'][_0x6666('0x57')](_0x146d2b,{'fields':_0x34f4cd,'raw':!![]});}})[_0x6666('0x34')](handleEntityNotFound(_0x5e0d23,null))[_0x6666('0x34')](function(_0x423360){_0x3c5a9f[_0x6666('0x86')]=_0x423360;if(_0x423360){var _0x439feb={'ContactId':_0x423360['id'],'OpenchannelAccountId':_0x5b4508[_0x6666('0x62')]['id'],'from':(_0x423360[_0x6666('0x87')]||'')+'\x20'+(_0x423360['lastName']||'')};var _0x1e8b94={'OpenchannelAccountId':_0x5b4508[_0x6666('0x62')]['id'],'closed':![]};if(_0x5b4508[_0x6666('0x5f')][_0x6666('0x88')]){_0x1e8b94[_0x6666('0x88')]=_0x5b4508['body'][_0x6666('0x88')];return db['OpenchannelInteraction']['find']({'where':_0x1e8b94})[_0x6666('0x34')](function(_0xc77f3e){if(_0xc77f3e){return[_0xc77f3e,![]];}_0x439feb[_0x6666('0x88')]=_0x5b4508['body'][_0x6666('0x88')];_0x439feb[_0x6666('0x89')]=_0x5b4508[_0x6666('0x5f')]['externalUrl'];return db[_0x6666('0x8a')][_0x6666('0x57')](_0x439feb)[_0x6666('0x34')](function(_0x3b5909){return[_0x3b5909,!![]];});});}else{_0x1e8b94['threadId']=null;}_0x1e8b94[_0x6666('0x8b')]=_0x423360['id'];return db[_0x6666('0x8a')][_0x6666('0x56')]({'where':_0x1e8b94})['then'](function(_0xc740b6){if(_0xc740b6){return[_0xc740b6,![]];}return db['OpenchannelInteraction'][_0x6666('0x57')](_0x439feb)[_0x6666('0x34')](function(_0x50e4af){return[_0x50e4af,!![]];});});}})['spread'](function(_0x254650,_0x4aba6a){if(_0x254650){_0x52c8be=_0x4aba6a;if(!_0x4aba6a){var _0x25465a={'from':(_0x3c5a9f[_0x6666('0x86')][_0x6666('0x87')]||'')+'\x20'+(_0x3c5a9f[_0x6666('0x86')]['lastName']||'')};if(_0x5b4508[_0x6666('0x5f')][_0x6666('0x88')]&&_0x5b4508[_0x6666('0x5f')][_0x6666('0x8c')]&&_0x5b4508[_0x6666('0x5f')][_0x6666('0x88')]!=_0x5b4508['body']['messageId']){_0x25465a[_0x6666('0x88')]=_0x5b4508[_0x6666('0x5f')][_0x6666('0x8c')];}return _0x254650[_0x6666('0x2f')](_0x25465a);}else{return _0x254650;}}})[_0x6666('0x34')](function(_0x66634f){_0x3c5a9f['interaction']=_0x66634f[_0x6666('0x30')]({'plain':!![]});_0x3c5a9f[_0x6666('0x8d')]['created']=_0x52c8be;if(_0x3c5a9f['interaction']['created']){if(_0x3c5a9f['account'][_0x6666('0x8e')]){_0x3c5a9f[_0x6666('0x81')][_0x6666('0x8f')]({'id':0x0,'priority':_0x3c5a9f[_0x6666('0x81')][_0x6666('0x44')]+0x1,'app':_0x6666('0x90'),'appdata':_0x6666('0x91'),'interval':_0x6666('0x92')});}}return db[_0x6666('0x93')][_0x6666('0x57')]({'body':_0x5b4508[_0x6666('0x5f')][_0x6666('0x5f')],'OpenchannelAccountId':_0x5b4508[_0x6666('0x62')]['id'],'OpenchannelInteractionId':_0x66634f['id'],'direction':'in','ContactId':_0x3c5a9f['contact']['id'],'AttachmentId':_0x5b4508['body'][_0x6666('0x94')]});})[_0x6666('0x34')](function(_0x20b346){_0x3c5a9f[_0x6666('0x22')]=_0x20b346;if(_0x3c5a9f[_0x6666('0x8d')][_0x6666('0x95')]){return db[_0x6666('0x96')][_0x6666('0x56')]({'attributes':['id',_0x6666('0x37')],'where':{'id':_0x3c5a9f[_0x6666('0x8d')][_0x6666('0x95')]}})[_0x6666('0x34')](function(_0x5b9c73){if(_0x5b9c73){_0x3c5a9f[_0x6666('0x81')][_0x6666('0x97')]({'id':0x0,'priority':0x0,'app':_0x6666('0x98'),'appdata':_0x5b9c73['name']+','+(_0x3c5a9f[_0x6666('0x80')][_0x6666('0x99')]||0xa),'interval':_0x6666('0x92')});_0x3c5a9f['forcedOwnership']=![];}return respondWithRpcPromise(_0x6666('0x9a'),_0x6666('0x9b'),_0x3c5a9f);});}return respondWithRpcPromise(_0x6666('0x9a'),'startRouting',_0x3c5a9f);})[_0x6666('0x34')](function(_0x8d53e){respondWithRpcPromise(_0x6666('0x9c'),_0x6666('0x9c'),{'event':_0x6666('0x6c'),'message':_0x8d53e},client9002);return _0x8d53e;})[_0x6666('0x34')](respondWithResult(_0x5e0d23,null))[_0x6666('0x24')](handleError(_0x5e0d23,null));};exports[_0x6666('0x9d')]=function(_0x196a55,_0x4e70b8){var _0x5be2d3=_0x196a55[_0x6666('0x62')]['id'];var _0x5bc461=_0x196a55[_0x6666('0x5f')];var _0x553d21=0xc8;var _0x1725bb=null;return db[_0x6666('0x9e')][_0x6666('0x9f')]({'isolationLevel':db[_0x6666('0x9e')][_0x6666('0xa0')]['ISOLATION_LEVELS'][_0x6666('0xa1')]},function(_0x3d36fe){return db[_0x6666('0x3c')][_0x6666('0x65')]({'where':{'id':_0x5be2d3},'transaction':_0x3d36fe})['then'](function(_0x34c503){if(_0x34c503){return db[_0x6666('0x7e')][_0x6666('0x33')]({'where':{'OpenchannelAccountId':_0x5be2d3},'transaction':_0x3d36fe})[_0x6666('0x34')](function(){var _0x3dd924=_['map'](_0x5bc461,function(_0x449222){_0x449222[_0x6666('0x63')]=_0x5be2d3;return _0x449222;});return db[_0x6666('0x7e')][_0x6666('0xa2')](_0x3dd924,{'transaction':_0x3d36fe});});}else{_0x553d21=0x194;_0x1725bb=[];}});})[_0x6666('0x34')](function(){if(_0x553d21!==0x194){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x5be2d3},'order':_0x6666('0x84')})['then'](function(_0x1ac5c8){_0x1725bb=_0x1ac5c8;});}})[_0x6666('0x24')](function(_0x451b56){_0x553d21=0x1f4;logger[_0x6666('0x20')](_0x451b56[_0x6666('0x36')]);if(_0x451b56[_0x6666('0x37')]){delete _0x451b56[_0x6666('0x37')];}_0x1725bb=_0x451b56;})[_0x6666('0xa3')](function(){if(_0x1725bb===null){_0x4e70b8[_0x6666('0x25')](_0x553d21);}else{if(_0x553d21===0x1f4){_0x4e70b8[_0x6666('0x2b')](_0x553d21)[_0x6666('0x38')](_0x1725bb);}else{_0x4e70b8[_0x6666('0x2b')](_0x553d21)[_0x6666('0x26')](_0x1725bb);}}});};exports[_0x6666('0xa4')]=function(_0x3ee702,_0x15cfdd,_0x5052e8){var _0x3e5eda={};var _0x16cd70={};var _0x5e26f2;var _0x788845;return db[_0x6666('0x3c')][_0x6666('0x65')]({'where':{'id':_0x3ee702[_0x6666('0x62')]['id']}})['then'](handleEntityNotFound(_0x15cfdd,null))['then'](function(_0x43d9b3){if(_0x43d9b3){_0x5e26f2=_0x43d9b3;_0x16cd70[_0x6666('0x42')]=_[_0x6666('0x3e')](db[_0x6666('0x7e')][_0x6666('0x3d')]);_0x16cd70[_0x6666('0x47')]=_['keys'](_0x3ee702[_0x6666('0x47')]);_0x16cd70[_0x6666('0x3f')]=_['intersection'](_0x16cd70[_0x6666('0x42')],_0x16cd70[_0x6666('0x47')]);_0x3e5eda[_0x6666('0x40')]=_[_0x6666('0x41')](_0x16cd70[_0x6666('0x42')],qs[_0x6666('0x43')](_0x3ee702['query'][_0x6666('0x43')]));_0x3e5eda['attributes']=_0x3e5eda[_0x6666('0x40')][_0x6666('0x44')]?_0x3e5eda['attributes']:_0x16cd70[_0x6666('0x42')];_0x3e5eda[_0x6666('0x66')]=qs[_0x6666('0x48')](_0x3ee702[_0x6666('0x47')][_0x6666('0x48')]);_0x3e5eda['where']=qs[_0x6666('0x3f')](_[_0x6666('0x49')](_0x3ee702[_0x6666('0x47')],_0x16cd70[_0x6666('0x3f')]));if(_0x3ee702[_0x6666('0x47')][_0x6666('0x4e')]){_0x3e5eda[_0x6666('0x4b')]=_[_0x6666('0x4a')](_0x3e5eda['where'],{'$or':_[_0x6666('0x3b')](_0x3e5eda['attributes'],function(_0x1dcf2d){var _0x1f6d39={};_0x1f6d39[_0x1dcf2d]={'$like':'%'+_0x3ee702['query'][_0x6666('0x4e')]+'%'};return _0x1f6d39;})});}_0x3e5eda=_[_0x6666('0x4a')]({},_0x3e5eda,_0x3ee702['options']);return _0x5e26f2[_0x6666('0xa4')](_0x3e5eda);}})[_0x6666('0x34')](function(_0x1ae0bf){if(_0x1ae0bf){_0x788845=_0x1ae0bf[_0x6666('0x44')];if(!_0x3ee702[_0x6666('0x47')][_0x6666('0x45')](_0x6666('0x46'))){_0x3e5eda['limit']=qs[_0x6666('0x28')](_0x3ee702['query'][_0x6666('0x28')]);_0x3e5eda[_0x6666('0x27')]=qs['offset'](_0x3ee702['query'][_0x6666('0x27')]);}return _0x5e26f2[_0x6666('0xa4')](_0x3e5eda);}})[_0x6666('0x34')](function(_0x5d0a0f){if(_0x5d0a0f){return _0x5d0a0f?{'count':_0x788845,'rows':_0x5d0a0f}:null;}})[_0x6666('0x34')](respondWithResult(_0x15cfdd,null))[_0x6666('0x24')](handleError(_0x15cfdd,null));};exports[_0x6666('0xa5')]=function(_0x3f4358,_0x52e21a,_0x133aa6){var _0x554c68={'raw':![],'where':{}};var _0x389879={};var _0x5679e4={'count':0x0,'rows':[]};return db[_0x6666('0x3c')][_0x6666('0x65')]({'where':{'id':_0x3f4358[_0x6666('0x62')]['id']}})[_0x6666('0x34')](handleEntityNotFound(_0x52e21a,null))[_0x6666('0x34')](function(_0x22da03){if(_0x22da03){_0x389879[_0x6666('0x42')]=_['keys'](db[_0x6666('0x8a')][_0x6666('0x3d')]);_0x389879[_0x6666('0x47')]=_['keys'](_0x3f4358['query']);_0x389879[_0x6666('0x3f')]=_[_0x6666('0x41')](_0x389879[_0x6666('0x42')],_0x389879[_0x6666('0x47')]);_0x554c68['attributes']=_[_0x6666('0x41')](_0x389879['model'],qs[_0x6666('0x43')](_0x3f4358[_0x6666('0x47')][_0x6666('0x43')]));_0x554c68['attributes']=_0x554c68[_0x6666('0x40')]['length']?_0x554c68[_0x6666('0x40')]:_0x389879[_0x6666('0x42')];if(!_0x3f4358[_0x6666('0x47')]['hasOwnProperty'](_0x6666('0x46'))){_0x554c68[_0x6666('0x28')]=qs[_0x6666('0x28')](_0x3f4358[_0x6666('0x47')][_0x6666('0x28')]);_0x554c68[_0x6666('0x27')]=qs[_0x6666('0x27')](_0x3f4358[_0x6666('0x47')][_0x6666('0x27')]);}_0x554c68['order']=qs[_0x6666('0x48')](_0x3f4358[_0x6666('0x47')][_0x6666('0x48')]);_0x554c68[_0x6666('0x4b')]=qs[_0x6666('0x3f')](_[_0x6666('0x49')](_0x3f4358[_0x6666('0x47')],_0x389879[_0x6666('0x3f')]));_0x554c68[_0x6666('0x4b')][_0x6666('0x63')]=_0x22da03['id'];if(_0x3f4358[_0x6666('0x47')][_0x6666('0x4e')]){_0x554c68[_0x6666('0x4b')]=_[_0x6666('0x4a')](_0x554c68[_0x6666('0x4b')],{'$or':_[_0x6666('0x3b')](_0x554c68[_0x6666('0x40')],function(_0x39e694){var _0x4d11c3={};_0x4d11c3[_0x39e694]={'$like':'%'+_0x3f4358[_0x6666('0x47')][_0x6666('0x4e')]+'%'};return _0x4d11c3;})});}_0x554c68=_[_0x6666('0x4a')]({},_0x554c68,_0x3f4358[_0x6666('0x4f')]);return db['OpenchannelInteraction'][_0x6666('0x2a')]({'where':_0x554c68['where']})[_0x6666('0x34')](function(_0xf5306d){_0x5679e4['count']=_0xf5306d;if(_0x3f4358[_0x6666('0x47')][_0x6666('0x55')]){_0x554c68[_0x6666('0x50')]=[{'model':db['CmContact'],'as':_0x6666('0xa6'),'required':![]},{'model':db[_0x6666('0x96')],'as':_0x6666('0xa7'),'attributes':['name',_0x6666('0xa8'),_0x6666('0xa9')],'required':![]},{'model':db[_0x6666('0xaa')],'as':_0x6666('0xab'),'attributes':['id',_0x6666('0x37'),_0x6666('0xac')],'where':_0x3f4358[_0x6666('0x47')][_0x6666('0xad')]?{'id':_0x3f4358['query']['tag']}:undefined,'required':_0x3f4358[_0x6666('0x47')]['tag']?!![]:![]}];}return db[_0x6666('0x8a')]['findAll'](_0x554c68);})[_0x6666('0x34')](function(_0x38161a){_0x5679e4[_0x6666('0x52')]=_0x38161a;return _0x5679e4;});}})[_0x6666('0x34')](respondWithFilteredResult(_0x52e21a,_0x554c68))[_0x6666('0x24')](handleError(_0x52e21a,null));};exports['addAgents']=function(_0x11e31e,_0x3e56ea,_0x37d824){return db['OpenchannelAccount']['find']({'where':{'id':_0x11e31e[_0x6666('0x62')]['id']}})['then'](handleEntityNotFound(_0x3e56ea,null))[_0x6666('0x34')](function(_0x34bcae){if(_0x34bcae){return _0x34bcae[_0x6666('0xae')](_0x11e31e[_0x6666('0x5f')][_0x6666('0x68')],_[_0x6666('0xaf')](_0x11e31e[_0x6666('0x5f')],[_0x6666('0x68'),'id'])||{})['spread'](function(_0x4f0c11){for(var _0x2dc7c1=0x0;_0x2dc7c1<_0x11e31e[_0x6666('0x5f')][_0x6666('0x68')]['length'];_0x2dc7c1+=0x1){socket[_0x6666('0xb0')](_0x6666('0xb1'),{'UserId':Number(_0x11e31e[_0x6666('0x5f')]['ids'][_0x2dc7c1]),'OpenchannelAccountId':Number(_0x11e31e['params']['id'])});}return _0x4f0c11;});}})[_0x6666('0x34')](respondWithResult(_0x3e56ea,null))['catch'](handleError(_0x3e56ea,null));};exports[_0x6666('0xb2')]=function(_0x47ce40,_0x496334,_0x557e55){return db['OpenchannelAccount'][_0x6666('0x56')]({'where':{'id':_0x47ce40[_0x6666('0x62')]['id']}})[_0x6666('0x34')](handleEntityNotFound(_0x496334,null))[_0x6666('0x34')](function(_0xcbb84f){if(_0xcbb84f){return _0xcbb84f['removeAgents'](_0x47ce40[_0x6666('0x47')][_0x6666('0x68')])[_0x6666('0x34')](function(){if(_[_0x6666('0xb3')](_0x47ce40['query'][_0x6666('0x68')])){for(var _0x15be86=0x0;_0x15be86<_0x47ce40[_0x6666('0x47')][_0x6666('0x68')][_0x6666('0x44')];_0x15be86+=0x1){socket[_0x6666('0xb0')](_0x6666('0xb4'),{'UserId':Number(_0x47ce40[_0x6666('0x47')][_0x6666('0x68')][_0x15be86]),'OpenchannelAccountId':Number(_0x47ce40[_0x6666('0x62')]['id'])});}}else{socket[_0x6666('0xb0')](_0x6666('0xb4'),{'UserId':Number(_0x47ce40[_0x6666('0x47')]['ids']),'OpenchannelAccountId':Number(_0x47ce40['params']['id'])});}});}})[_0x6666('0x34')](respondWithStatusCode(_0x496334,null))['catch'](handleError(_0x496334,null));};exports[_0x6666('0xb5')]=function(_0x327558,_0x3babfc,_0x32471a){var _0x4b2bfe={};var _0x480cc2={};var _0xf83b04;var _0x436a5c;return db[_0x6666('0x3c')]['findOne']({'where':{'id':_0x327558[_0x6666('0x62')]['id']}})['then'](handleEntityNotFound(_0x3babfc,null))['then'](function(_0x30230d){if(_0x30230d){_0xf83b04=_0x30230d;_0x480cc2[_0x6666('0x42')]=_['keys'](db['User'][_0x6666('0x3d')]);_0x480cc2[_0x6666('0x47')]=_[_0x6666('0x3e')](_0x327558[_0x6666('0x47')]);_0x480cc2[_0x6666('0x3f')]=_[_0x6666('0x41')](_0x480cc2[_0x6666('0x42')],_0x480cc2[_0x6666('0x47')]);_0x4b2bfe['attributes']=_[_0x6666('0x41')](_0x480cc2[_0x6666('0x42')],qs['fields'](_0x327558[_0x6666('0x47')][_0x6666('0x43')]));_0x4b2bfe[_0x6666('0x40')]=_0x4b2bfe[_0x6666('0x40')][_0x6666('0x44')]?_0x4b2bfe[_0x6666('0x40')]:_0x480cc2['model'];_0x4b2bfe[_0x6666('0x66')]=qs[_0x6666('0x48')](_0x327558[_0x6666('0x47')][_0x6666('0x48')]);_0x4b2bfe[_0x6666('0x4b')]=qs[_0x6666('0x3f')](_['pick'](_0x327558[_0x6666('0x47')],_0x480cc2[_0x6666('0x3f')]));if(_0x327558[_0x6666('0x47')]['filter']){_0x4b2bfe[_0x6666('0x4b')]=_[_0x6666('0x4a')](_0x4b2bfe[_0x6666('0x4b')],{'$or':_[_0x6666('0x3b')](_0x4b2bfe['attributes'],function(_0x3aaba4){var _0x404922={};_0x404922[_0x3aaba4]={'$like':'%'+_0x327558[_0x6666('0x47')][_0x6666('0x4e')]+'%'};return _0x404922;})});}_0x4b2bfe=_[_0x6666('0x4a')]({},_0x4b2bfe,_0x327558[_0x6666('0x4f')]);return _0xf83b04['getAgents'](_0x4b2bfe);}})['then'](function(_0x11c0c0){if(_0x11c0c0){_0x436a5c=_0x11c0c0[_0x6666('0x44')];if(!_0x327558[_0x6666('0x47')][_0x6666('0x45')](_0x6666('0x46'))){_0x4b2bfe['limit']=qs['limit'](_0x327558[_0x6666('0x47')][_0x6666('0x28')]);_0x4b2bfe[_0x6666('0x27')]=qs[_0x6666('0x27')](_0x327558[_0x6666('0x47')][_0x6666('0x27')]);}return _0xf83b04[_0x6666('0xb5')](_0x4b2bfe);}})[_0x6666('0x34')](function(_0x4d21fe){if(_0x4d21fe){return _0x4d21fe?{'count':_0x436a5c,'rows':_0x4d21fe}:null;}})[_0x6666('0x34')](respondWithResult(_0x3babfc,null))[_0x6666('0x24')](handleError(_0x3babfc,null));};exports['send']=function(_0x1db2ee,_0x1f5553,_0x51682b){var _0x177fbe,_0x1f6db5,_0x2c1088;if(_[_0x6666('0x73')](_0x1db2ee[_0x6666('0x5f')][_0x6666('0x5f')])||_0x1db2ee[_0x6666('0x5f')]['body']===''){throw new db['Sequelize'][(_0x6666('0x75'))](_0x6666('0xb6'));}if(_[_0x6666('0x73')](_0x1db2ee['body']['to'])){}_0x177fbe=_0x1db2ee['body']['to'];return db[_0x6666('0x3c')][_0x6666('0x65')]({'where':{'id':_0x1db2ee[_0x6666('0x62')]['id']}})[_0x6666('0x34')](handleEntityNotFound(_0x1f5553,null))[_0x6666('0x34')](function(_0x1caf75){if(_0x1caf75){return db['OpenchannelAccount'][_0x6666('0x56')]({'where':{'id':_0x1caf75['id']},'include':[{'model':db['CmList'],'as':_0x6666('0x7b'),'include':[{'model':db[_0x6666('0x6d')],'as':_0x6666('0x85'),'where':{[_0x1caf75[_0x6666('0x76')]]:_0x177fbe},'limit':0x1,'order':[['updatedAt',_0x6666('0x7d')]]}]}]})[_0x6666('0x34')](handleEntityNotFound(_0x1f5553,null))['then'](function(_0x547c0a){if(_0x547c0a&&_0x547c0a[_0x6666('0x7b')]){_0x1f6db5=_0x547c0a[_0x6666('0x30')]({'plain':!![]});if(_0x1f6db5[_0x6666('0x7b')]&&_0x1f6db5[_0x6666('0x7b')]['Contacts'][_0x6666('0x44')]){return _0x1f6db5['List'][_0x6666('0x85')][0x0];}return db[_0x6666('0x6d')][_0x6666('0x57')](_[_0x6666('0xb7')](_0x1db2ee['body'],{'firstName':_0x177fbe,[_0x547c0a[_0x6666('0x76')]]:_0x177fbe,'phone':_0x177fbe,'ListId':_0x1f6db5['ListId']}));}})[_0x6666('0x34')](handleEntityNotFound(_0x1f5553,null))['then'](function(_0x2f5681){if(_0x2f5681){_0x2c1088=_0x2f5681;return db[_0x6666('0x8a')]['find']({'where':{'ContactId':_0x2c1088['id'],'closed':![],'OpenchannelAccountId':_0x1f6db5['id']}})['then'](function(_0x5c7d28){if(_0x5c7d28){return[_0x5c7d28,![]];}return db['OpenchannelInteraction'][_0x6666('0x57')]({'UserId':_0x1db2ee[_0x6666('0x5a')]['id'],'ContactId':_0x2c1088['id'],'OpenchannelAccountId':_0x1f6db5['id'],'lastMsgDirection':_0x6666('0xb8'),'firstMsgDirection':_0x6666('0xb8'),'Messages':[_['merge'](_0x1db2ee[_0x6666('0x5f')],{'read':![],'body':_0x1db2ee[_0x6666('0x5f')][_0x6666('0x5f')],'OpenchannelAccountId':_0x1f6db5['id'],'UserId':_0x1db2ee[_0x6666('0x5a')]['id'],'ContactId':_0x2c1088['id']})]},{'include':[{'model':db[_0x6666('0x93')],'as':_0x6666('0xb9')}]})['then'](function(_0x4cc40d){return[_0x4cc40d,!![]];});});}})[_0x6666('0xba')](function(_0x270f6e,_0x3e5e16){if(_0x3e5e16){return _0x270f6e;}return db[_0x6666('0x93')]['create'](_[_0x6666('0x4a')](_0x1db2ee[_0x6666('0x5f')],{'read':![],'body':_0x1db2ee[_0x6666('0x5f')][_0x6666('0x5f')],'OpenchannelAccountId':_0x1f6db5['id'],'OpenchannelInteractionId':_0x270f6e['id'],'UserId':_0x1db2ee[_0x6666('0x5a')]['id'],'ContactId':_0x2c1088['id']}))['then'](function(_0x228270){_0x270f6e['dataValues'][_0x6666('0xb9')]=[];_0x270f6e[_0x6666('0xbb')][_0x6666('0xb9')][_0x6666('0x8f')](_0x228270['dataValues']);return _0x270f6e;});});}})[_0x6666('0x34')](respondWithResult(_0x1f5553,null))['catch'](handleError(_0x1f5553,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 5076a8f..2f52a31 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 _0x4ea3=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','update'];(function(_0x45b32c,_0x4a9986){var _0x5e7541=function(_0x175063){while(--_0x175063){_0x45b32c['push'](_0x45b32c['shift']());}};_0x5e7541(++_0x4a9986);}(_0x4ea3,0x70));var _0x34ea=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x4ea3[_0x6c993a];return _0x27f547;};'use strict';var EventEmitter=require(_0x34ea('0x0'));var OpenchannelAccount=require(_0x34ea('0x1'))['db'][_0x34ea('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x34ea('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x34ea('0x4'),'afterDestroy':'remove'};function emitEvent(_0x269d4c){return function(_0x571f1b,_0x5e5a84,_0x2ce955){OpenchannelAccountEvents[_0x34ea('0x5')](_0x269d4c+':'+_0x571f1b['id'],_0x571f1b);OpenchannelAccountEvents[_0x34ea('0x5')](_0x269d4c,_0x571f1b);_0x2ce955(null);};}for(var e in events){if(events[_0x34ea('0x6')](e)){var event=events[e];OpenchannelAccount[_0x34ea('0x7')](e,emitEvent(event));}}module[_0x34ea('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x13f6=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x24312e,_0x3b518e){var _0x308916=function(_0xfb3aa8){while(--_0xfb3aa8){_0x24312e['push'](_0x24312e['shift']());}};_0x308916(++_0x3b518e);}(_0x13f6,0x124));var _0x613f=function(_0x5ee57a,_0x18ef68){_0x5ee57a=_0x5ee57a-0x0;var _0x3c06ab=_0x13f6[_0x5ee57a];return _0x3c06ab;};'use strict';var EventEmitter=require(_0x613f('0x0'));var OpenchannelAccount=require(_0x613f('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x613f('0x2'),'afterUpdate':_0x613f('0x3'),'afterDestroy':_0x613f('0x4')};function emitEvent(_0x5414ff){return function(_0x179f6e,_0x1e01e3,_0x20af2f){OpenchannelAccountEvents['emit'](_0x5414ff+':'+_0x179f6e['id'],_0x179f6e);OpenchannelAccountEvents[_0x613f('0x5')](_0x5414ff,_0x179f6e);_0x20af2f(null);};}for(var e in events){if(events[_0x613f('0x6')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 19e1d6c..4784ca4 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(_0x450371,_0x109ee2){var _0x472410=function(_0x26494d){while(--_0x26494d){_0x450371['push'](_0x450371['shift']());}};_0x472410(++_0x109ee2);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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(_0x3e6e4a,_0x16f13d){var _0x2806ac=function(_0x34d782){while(--_0x34d782){_0x3e6e4a['push'](_0x3e6e4a['shift']());}};_0x2806ac(++_0x16f13d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 bb28625..6b3c2ed 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 _0xe1e3=['catch','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','request','then','info','stringify','code','error','OpenchannelAccount,\x20%s,\x20%s','message','request\x20sent','result'];(function(_0x24a91f,_0xf7934f){var _0x2d3c8b=function(_0x17e6ac){while(--_0x17e6ac){_0x24a91f['push'](_0x24a91f['shift']());}};_0x2d3c8b(++_0xf7934f);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x211dfb,_0x32ceb9){_0x211dfb=_0x211dfb-0x0;var _0x3a33b3=_0xe1e3[_0x211dfb];return _0x3a33b3;};'use strict';var _=require(_0x3e1e('0x0'));var util=require(_0x3e1e('0x1'));var moment=require('moment');var BPromise=require(_0x3e1e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e1e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3e1e('0x4'))(_0x3e1e('0x5'));var config=require(_0x3e1e('0x6'));var jayson=require(_0x3e1e('0x7'));var client=jayson[_0x3e1e('0x8')][_0x3e1e('0x9')]({'port':0x232a});config['redis']=_[_0x3e1e('0xa')](config[_0x3e1e('0xb')],{'host':_0x3e1e('0xc'),'port':0x18eb});var socket=require(_0x3e1e('0xd'))(new Redis(config[_0x3e1e('0xb')]));require(_0x3e1e('0xe'))['register'](socket);function respondWithRpcPromise(_0x5c4c25,_0x5060e8,_0x31d205){return new BPromise(function(_0x5b0df8,_0x349460){return client[_0x3e1e('0xf')](_0x5c4c25,_0x31d205)[_0x3e1e('0x10')](function(_0x594c59){logger[_0x3e1e('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x5060e8,'request\x20sent');logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5060e8,'request\x20sent',JSON[_0x3e1e('0x12')](_0x594c59));if(_0x594c59['error']){if(_0x594c59['error'][_0x3e1e('0x13')]===0x1f4){logger[_0x3e1e('0x14')](_0x3e1e('0x15'),_0x5060e8,_0x594c59['error']['message']);return _0x349460(_0x594c59[_0x3e1e('0x14')][_0x3e1e('0x16')]);}logger['error'](_0x3e1e('0x15'),_0x5060e8,_0x594c59[_0x3e1e('0x14')]['message']);return _0x5b0df8(_0x594c59[_0x3e1e('0x14')]['message']);}else{logger[_0x3e1e('0x11')](_0x3e1e('0x15'),_0x5060e8,_0x3e1e('0x17'));_0x5b0df8(_0x594c59[_0x3e1e('0x18')][_0x3e1e('0x16')]);}})[_0x3e1e('0x19')](function(_0x569f49){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x5060e8,_0x569f49);_0x349460(_0x569f49);});});} \ No newline at end of file +var _0x087b=['then','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request'];(function(_0x4ab080,_0x206c11){var _0x3e4b32=function(_0x3cdfb9){while(--_0x3cdfb9){_0x4ab080['push'](_0x4ab080['shift']());}};_0x3e4b32(++_0x206c11);}(_0x087b,0x11a));var _0xb087=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x087b[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb087('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb087('0x3'))['db'];var utils=require(_0xb087('0x4'));var logger=require(_0xb087('0x5'))(_0xb087('0x6'));var config=require(_0xb087('0x7'));var jayson=require(_0xb087('0x8'));var client=jayson[_0xb087('0x9')][_0xb087('0xa')]({'port':0x232a});config[_0xb087('0xb')]=_[_0xb087('0xc')](config[_0xb087('0xb')],{'host':_0xb087('0xd'),'port':0x18eb});var socket=require(_0xb087('0xe'))(new Redis(config[_0xb087('0xb')]));require(_0xb087('0xf'))[_0xb087('0x10')](socket);function respondWithRpcPromise(_0x379041,_0x583d25,_0x244abc){return new BPromise(function(_0x108451,_0x903a16){return client[_0xb087('0x11')](_0x379041,_0x244abc)[_0xb087('0x12')](function(_0x2f43e9){logger[_0xb087('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x583d25,_0xb087('0x14'));logger[_0xb087('0x15')](_0xb087('0x16'),_0x583d25,'request\x20sent',JSON[_0xb087('0x17')](_0x2f43e9));if(_0x2f43e9[_0xb087('0x18')]){if(_0x2f43e9[_0xb087('0x18')][_0xb087('0x19')]===0x1f4){logger[_0xb087('0x18')](_0xb087('0x1a'),_0x583d25,_0x2f43e9[_0xb087('0x18')][_0xb087('0x1b')]);return _0x903a16(_0x2f43e9[_0xb087('0x18')][_0xb087('0x1b')]);}logger['error'](_0xb087('0x1a'),_0x583d25,_0x2f43e9[_0xb087('0x18')]['message']);return _0x108451(_0x2f43e9[_0xb087('0x18')][_0xb087('0x1b')]);}else{logger[_0xb087('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x583d25,_0xb087('0x14'));_0x108451(_0x2f43e9[_0xb087('0x1c')][_0xb087('0x1b')]);}})[_0xb087('0x1d')](function(_0x4e333b){logger[_0xb087('0x18')](_0xb087('0x1a'),_0x583d25,_0x4e333b);_0x903a16(_0x4e333b);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 57a7212..d989cfe 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 _0xe7b9=['length','openchannelAccount:','./openchannelAccount.events','save','remove','register'];(function(_0x514c8f,_0x687151){var _0xf4b515=function(_0x5b5a45){while(--_0x5b5a45){_0x514c8f['push'](_0x514c8f['shift']());}};_0xf4b515(++_0x687151);}(_0xe7b9,0x170));var _0x9e7b=function(_0xce45ab,_0x1d9f4c){_0xce45ab=_0xce45ab-0x0;var _0x34420d=_0xe7b9[_0xce45ab];return _0x34420d;};'use strict';var OpenchannelAccountEvents=require(_0x9e7b('0x0'));var events=[_0x9e7b('0x1'),_0x9e7b('0x2'),'update'];function createListener(_0x4d18fe,_0x1de4b2){return function(_0x95234f){_0x1de4b2['emit'](_0x4d18fe,_0x95234f);};}function removeListener(_0x48b654,_0xc8f709){return function(){OpenchannelAccountEvents['removeListener'](_0x48b654,_0xc8f709);};}exports[_0x9e7b('0x3')]=function(_0x543b7e){for(var _0x4dda21=0x0,_0x1e2f86=events[_0x9e7b('0x4')];_0x4dda21<_0x1e2f86;_0x4dda21++){var _0x13a37d=events[_0x4dda21];var _0x5ed982=createListener(_0x9e7b('0x5')+_0x13a37d,_0x543b7e);OpenchannelAccountEvents['on'](_0x13a37d,_0x5ed982);}}; \ No newline at end of file +var _0x4198=['openchannelAccount:','./openchannelAccount.events','remove','update','emit','removeListener','register','length'];(function(_0x3b3c2f,_0x3dd331){var _0x434f87=function(_0x3f6169){while(--_0x3f6169){_0x3b3c2f['push'](_0x3b3c2f['shift']());}};_0x434f87(++_0x3dd331);}(_0x4198,0x69));var _0x8419=function(_0xd12fe1,_0x249571){_0xd12fe1=_0xd12fe1-0x0;var _0x52c142=_0x4198[_0xd12fe1];return _0x52c142;};'use strict';var OpenchannelAccountEvents=require(_0x8419('0x0'));var events=['save',_0x8419('0x1'),_0x8419('0x2')];function createListener(_0x29612a,_0x1e7a2f){return function(_0x182359){_0x1e7a2f[_0x8419('0x3')](_0x29612a,_0x182359);};}function removeListener(_0x1eaff0,_0xc19396){return function(){OpenchannelAccountEvents[_0x8419('0x4')](_0x1eaff0,_0xc19396);};}exports[_0x8419('0x5')]=function(_0x502e00){for(var _0x1f5bfe=0x0,_0x839abf=events[_0x8419('0x6')];_0x1f5bfe<_0x839abf;_0x1f5bfe++){var _0x2043cd=events[_0x1f5bfe];var _0x45c2b5=createListener(_0x8419('0x7')+_0x2043cd,_0x502e00);OpenchannelAccountEvents['on'](_0x2043cd,_0x45c2b5);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 8288963..04dba1f 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 _0x1051=['../../config/environment','./openchannelApplication.controller','isAuthenticated','index','/:id','show','create','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xad8953,_0x5cf8d9){var _0x223059=function(_0x570a52){while(--_0x570a52){_0xad8953['push'](_0xad8953['shift']());}};_0x223059(++_0x5cf8d9);}(_0x1051,0x1b3));var _0x1105=function(_0x8e8c9f,_0x3cbe0e){_0x8e8c9f=_0x8e8c9f-0x0;var _0x1d20cf=_0x1051[_0x8e8c9f];return _0x1d20cf;};'use strict';var multer=require(_0x1105('0x0'));var util=require('util');var path=require(_0x1105('0x1'));var timeout=require(_0x1105('0x2'));var express=require(_0x1105('0x3'));var router=express[_0x1105('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1105('0x5'));var interaction=require(_0x1105('0x6'));var config=require(_0x1105('0x7'));var controller=require(_0x1105('0x8'));router['get']('/',auth[_0x1105('0x9')](),controller[_0x1105('0xa')]);router['get'](_0x1105('0xb'),auth[_0x1105('0x9')](),controller[_0x1105('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1105('0xd')]);router['put'](_0x1105('0xb'),auth[_0x1105('0x9')](),controller[_0x1105('0xe')]);router[_0x1105('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1105('0x10')]=router; \ No newline at end of file +var _0x4b00=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show','post','create','update'];(function(_0x50cc81,_0x383b63){var _0x59574f=function(_0x142b1e){while(--_0x142b1e){_0x50cc81['push'](_0x50cc81['shift']());}};_0x59574f(++_0x383b63);}(_0x4b00,0x16a));var _0x04b0=function(_0x126a6e,_0x22bfff){_0x126a6e=_0x126a6e-0x0;var _0x1652f6=_0x4b00[_0x126a6e];return _0x1652f6;};'use strict';var multer=require(_0x04b0('0x0'));var util=require(_0x04b0('0x1'));var path=require(_0x04b0('0x2'));var timeout=require(_0x04b0('0x3'));var express=require(_0x04b0('0x4'));var router=express[_0x04b0('0x5')]();var fs_extra=require(_0x04b0('0x6'));var auth=require(_0x04b0('0x7'));var interaction=require(_0x04b0('0x8'));var config=require(_0x04b0('0x9'));var controller=require('./openchannelApplication.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x04b0('0xa')]);router[_0x04b0('0xb')](_0x04b0('0xc'),auth[_0x04b0('0xd')](),controller[_0x04b0('0xe')]);router[_0x04b0('0xf')]('/',auth['isAuthenticated'](),controller[_0x04b0('0x10')]);router['put']('/:id',auth[_0x04b0('0xd')](),controller[_0x04b0('0x11')]);router[_0x04b0('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x04b0('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index c95e3b8..5a9f161 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 _0x071f=['sequelize','exports','INTEGER','noop','TEXT','*,*,*,*'];(function(_0x278dd5,_0x4a208c){var _0x49c436=function(_0x1eb4a5){while(--_0x1eb4a5){_0x278dd5['push'](_0x278dd5['shift']());}};_0x49c436(++_0x4a208c);}(_0x071f,0x7e));var _0xf071=function(_0x5dcc8d,_0x5e5285){_0x5dcc8d=_0x5dcc8d-0x0;var _0x23392d=_0x071f[_0x5dcc8d];return _0x23392d;};'use strict';var Sequelize=require(_0xf071('0x0'));module[_0xf071('0x1')]={'priority':{'type':Sequelize[_0xf071('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf071('0x3')},'appdata':{'type':Sequelize[_0xf071('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf071('0x5')}}; \ No newline at end of file +var _0x1b3a=['INTEGER','STRING','noop','sequelize'];(function(_0x59b2a1,_0x1f631f){var _0x4908d1=function(_0x14c9b8){while(--_0x14c9b8){_0x59b2a1['push'](_0x59b2a1['shift']());}};_0x4908d1(++_0x1f631f);}(_0x1b3a,0x1ab));var _0xa1b3=function(_0x46aee2,_0x46b137){_0x46aee2=_0x46aee2-0x0;var _0x22ddf0=_0x1b3a[_0x46aee2];return _0x22ddf0;};'use strict';var Sequelize=require(_0xa1b3('0x0'));module['exports']={'priority':{'type':Sequelize[_0xa1b3('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa1b3('0x2')],'allowNull':![],'defaultValue':_0xa1b3('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xa1b3('0x2')]},'interval':{'type':Sequelize[_0xa1b3('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index aa639d4..0499c77 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 _0x83ea=['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','end','json','offset','undefined','limit','Content-Range','reject','save','then','destroy','sendStatus','error','name','send','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','length','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','count','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','update','eml-format','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','lodash','squel'];(function(_0x150fd1,_0x5b314b){var _0x52538a=function(_0x27886e){while(--_0x27886e){_0x150fd1['push'](_0x150fd1['shift']());}};_0x52538a(++_0x5b314b);}(_0x83ea,0x1a0));var _0xa83e=function(_0x407c60,_0x179afb){_0x407c60=_0x407c60-0x0;var _0x3bdef6=_0x83ea[_0x407c60];return _0x3bdef6;};'use strict';var emlformat=require(_0xa83e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa83e('0x1'));var jsonpatch=require(_0xa83e('0x2'));var rp=require('request-promise');var moment=require(_0xa83e('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa83e('0x4'));var path=require(_0xa83e('0x5'));var sox=require(_0xa83e('0x6'));var csv=require(_0xa83e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa83e('0x8'));var squel=require(_0xa83e('0x9'));var crypto=require('crypto');var jsforce=require(_0xa83e('0xa'));var deskjs=require(_0xa83e('0xb'));var toCsv=require(_0xa83e('0x7'));var querystring=require('querystring');var Papa=require(_0xa83e('0xc'));var Redis=require(_0xa83e('0xd'));var authService=require(_0xa83e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xa83e('0xf'));var hardwareService=require(_0xa83e('0x10'));var logger=require(_0xa83e('0x11'))(_0xa83e('0x12'));var utils=require(_0xa83e('0x13'));var config=require(_0xa83e('0x14'));var licenseUtil=require(_0xa83e('0x15'));var db=require(_0xa83e('0x16'))['db'];function respondWithStatusCode(_0x21f3c1,_0x428902){_0x428902=_0x428902||0xcc;return function(_0x379a52){if(_0x379a52){return _0x21f3c1['sendStatus'](_0x428902);}return _0x21f3c1[_0xa83e('0x17')](_0x428902)[_0xa83e('0x18')]();};}function respondWithResult(_0x4d3e87,_0x2007be){_0x2007be=_0x2007be||0xc8;return function(_0x4a34ac){if(_0x4a34ac){return _0x4d3e87[_0xa83e('0x17')](_0x2007be)[_0xa83e('0x19')](_0x4a34ac);}};}function respondWithFilteredResult(_0x5db479,_0x1ba39e){return function(_0x2749b6){if(_0x2749b6){var _0x559958=typeof _0x1ba39e[_0xa83e('0x1a')]===_0xa83e('0x1b')&&typeof _0x1ba39e[_0xa83e('0x1c')]===_0xa83e('0x1b');var _0x43fd57=_0x2749b6['count'];var _0x25a0d2=_0x559958?0x0:_0x1ba39e['offset'];var _0xebb6bd=_0x559958?_0x2749b6['count']:_0x1ba39e[_0xa83e('0x1a')]+_0x1ba39e[_0xa83e('0x1c')];var _0x1039e4;if(_0xebb6bd>=_0x43fd57){_0xebb6bd=_0x43fd57;_0x1039e4=0xc8;}else{_0x1039e4=0xce;}_0x5db479[_0xa83e('0x17')](_0x1039e4);return _0x5db479['set'](_0xa83e('0x1d'),_0x25a0d2+'-'+_0xebb6bd+'/'+_0x43fd57)[_0xa83e('0x19')](_0x2749b6);}return null;};}function patchUpdates(_0x3daccf){return function(_0x37e679){try{jsonpatch['apply'](_0x37e679,_0x3daccf,!![]);}catch(_0x4b045a){return BPromise[_0xa83e('0x1e')](_0x4b045a);}return _0x37e679[_0xa83e('0x1f')]();};}function saveUpdates(_0xcef4bc,_0x3173c6){return function(_0x569103){if(_0x569103){return _0x569103['update'](_0xcef4bc)[_0xa83e('0x20')](function(_0xf14584){return _0xf14584;});}return null;};}function removeEntity(_0x10b489,_0x5a26a0){return function(_0x5e00fd){if(_0x5e00fd){return _0x5e00fd[_0xa83e('0x21')]()[_0xa83e('0x20')](function(){_0x10b489[_0xa83e('0x17')](0xcc)[_0xa83e('0x18')]();});}};}function handleEntityNotFound(_0x3e768e,_0x3f21ac){return function(_0x3f8fc2){if(!_0x3f8fc2){_0x3e768e[_0xa83e('0x22')](0x194);}return _0x3f8fc2;};}function handleError(_0x2419fc,_0x113c18){_0x113c18=_0x113c18||0x1f4;return function(_0x572768){logger[_0xa83e('0x23')](_0x572768['stack']);if(_0x572768[_0xa83e('0x24')]){delete _0x572768['name'];}_0x2419fc[_0xa83e('0x17')](_0x113c18)[_0xa83e('0x25')](_0x572768);};}exports['index']=function(_0x8b5d98,_0x30868f){var _0x1bd32d={},_0x419f1c={},_0x33435e={'count':0x0,'rows':[]};var _0x2a2304=_[_0xa83e('0x26')](db[_0xa83e('0x27')][_0xa83e('0x28')],function(_0x4af3e4){return{'name':_0x4af3e4[_0xa83e('0x29')],'type':_0x4af3e4[_0xa83e('0x2a')][_0xa83e('0x2b')]};});_0x419f1c[_0xa83e('0x2c')]=_['map'](_0x2a2304,_0xa83e('0x24'));_0x419f1c['query']=_[_0xa83e('0x2d')](_0x8b5d98[_0xa83e('0x2e')]);_0x419f1c['filters']=_['intersection'](_0x419f1c[_0xa83e('0x2c')],_0x419f1c[_0xa83e('0x2e')]);_0x1bd32d[_0xa83e('0x2f')]=_[_0xa83e('0x30')](_0x419f1c[_0xa83e('0x2c')],qs['fields'](_0x8b5d98[_0xa83e('0x2e')]['fields']));_0x1bd32d['attributes']=_0x1bd32d[_0xa83e('0x2f')][_0xa83e('0x31')]?_0x1bd32d['attributes']:_0x419f1c[_0xa83e('0x2c')];if(!_0x8b5d98[_0xa83e('0x2e')]['hasOwnProperty'](_0xa83e('0x32'))){_0x1bd32d[_0xa83e('0x1c')]=qs['limit'](_0x8b5d98[_0xa83e('0x2e')][_0xa83e('0x1c')]);_0x1bd32d['offset']=qs[_0xa83e('0x1a')](_0x8b5d98['query'][_0xa83e('0x1a')]);}_0x1bd32d[_0xa83e('0x33')]=qs[_0xa83e('0x34')](_0x8b5d98['query'][_0xa83e('0x34')]);_0x1bd32d[_0xa83e('0x35')]=qs[_0xa83e('0x36')](_['pick'](_0x8b5d98[_0xa83e('0x2e')],_0x419f1c[_0xa83e('0x36')]),_0x2a2304);if(_0x8b5d98['query']['filter']){_0x1bd32d['where']=_[_0xa83e('0x37')](_0x1bd32d[_0xa83e('0x35')],{'$or':_['map'](_0x2a2304,function(_0x1dbf32){if(_0x1dbf32[_0xa83e('0x2a')]!==_0xa83e('0x38')){var _0x423f15={};_0x423f15[_0x1dbf32['name']]={'$like':'%'+_0x8b5d98[_0xa83e('0x2e')][_0xa83e('0x39')]+'%'};return _0x423f15;}})});}_0x1bd32d=_['merge']({},_0x1bd32d,_0x8b5d98['options']);var _0x4de035={'where':_0x1bd32d['where']};return db['OpenchannelApplication'][_0xa83e('0x3a')](_0x4de035)['then'](function(_0x5f13fb){_0x33435e[_0xa83e('0x3a')]=_0x5f13fb;if(_0x8b5d98['query'][_0xa83e('0x3b')]){_0x1bd32d[_0xa83e('0x3c')]=[{'all':!![]}];}return db[_0xa83e('0x27')][_0xa83e('0x3d')](_0x1bd32d);})[_0xa83e('0x20')](function(_0x410cab){_0x33435e[_0xa83e('0x3e')]=_0x410cab;return _0x33435e;})[_0xa83e('0x20')](respondWithFilteredResult(_0x30868f,_0x1bd32d))[_0xa83e('0x3f')](handleError(_0x30868f,null));};exports[_0xa83e('0x40')]=function(_0x1565d2,_0x475348){var _0x226f9b={'raw':!![],'where':{'id':_0x1565d2[_0xa83e('0x41')]['id']}},_0x259685={};_0x259685[_0xa83e('0x2c')]=_[_0xa83e('0x2d')](db[_0xa83e('0x27')][_0xa83e('0x28')]);_0x259685[_0xa83e('0x2e')]=_[_0xa83e('0x2d')](_0x1565d2[_0xa83e('0x2e')]);_0x259685[_0xa83e('0x36')]=_[_0xa83e('0x30')](_0x259685[_0xa83e('0x2c')],_0x259685['query']);_0x226f9b['attributes']=_['intersection'](_0x259685[_0xa83e('0x2c')],qs[_0xa83e('0x42')](_0x1565d2['query'][_0xa83e('0x42')]));_0x226f9b[_0xa83e('0x2f')]=_0x226f9b[_0xa83e('0x2f')][_0xa83e('0x31')]?_0x226f9b['attributes']:_0x259685[_0xa83e('0x2c')];if(_0x1565d2[_0xa83e('0x2e')][_0xa83e('0x3b')]){_0x226f9b[_0xa83e('0x3c')]=[{'all':!![]}];}_0x226f9b=_[_0xa83e('0x37')]({},_0x226f9b,_0x1565d2['options']);return db[_0xa83e('0x27')][_0xa83e('0x43')](_0x226f9b)[_0xa83e('0x20')](handleEntityNotFound(_0x475348,null))[_0xa83e('0x20')](respondWithResult(_0x475348,null))['catch'](handleError(_0x475348,null));};exports[_0xa83e('0x44')]=function(_0x49dbaf,_0x41b317){return db['OpenchannelApplication']['create'](_0x49dbaf[_0xa83e('0x45')],{})[_0xa83e('0x20')](respondWithResult(_0x41b317,0xc9))['catch'](handleError(_0x41b317,null));};exports[_0xa83e('0x46')]=function(_0x1ecdd4,_0x5d8f44){if(_0x1ecdd4[_0xa83e('0x45')]['id']){delete _0x1ecdd4[_0xa83e('0x45')]['id'];}return db['OpenchannelApplication'][_0xa83e('0x43')]({'where':{'id':_0x1ecdd4['params']['id']}})[_0xa83e('0x20')](handleEntityNotFound(_0x5d8f44,null))['then'](saveUpdates(_0x1ecdd4[_0xa83e('0x45')],null))[_0xa83e('0x20')](respondWithResult(_0x5d8f44,null))[_0xa83e('0x3f')](handleError(_0x5d8f44,null));};exports[_0xa83e('0x21')]=function(_0x7829b9,_0x3bb01b){return db[_0xa83e('0x27')][_0xa83e('0x43')]({'where':{'id':_0x7829b9['params']['id']}})[_0xa83e('0x20')](handleEntityNotFound(_0x3bb01b,null))[_0xa83e('0x20')](removeEntity(_0x3bb01b,null))[_0xa83e('0x3f')](handleError(_0x3bb01b,null));}; \ No newline at end of file +var _0xdd09=['hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','stack','name','index','map','OpenchannelApplication','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','length'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xdd09,0x1c3));var _0x9dd0=function(_0x4051f8,_0x2590ed){_0x4051f8=_0x4051f8-0x0;var _0x21d6dc=_0xdd09[_0x4051f8];return _0x21d6dc;};'use strict';var emlformat=require(_0x9dd0('0x0'));var rimraf=require(_0x9dd0('0x1'));var zipdir=require(_0x9dd0('0x2'));var jsonpatch=require(_0x9dd0('0x3'));var rp=require(_0x9dd0('0x4'));var moment=require('moment');var BPromise=require(_0x9dd0('0x5'));var Mustache=require(_0x9dd0('0x6'));var util=require(_0x9dd0('0x7'));var path=require(_0x9dd0('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9dd0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9dd0('0xa'));var crypto=require(_0x9dd0('0xb'));var jsforce=require(_0x9dd0('0xc'));var deskjs=require(_0x9dd0('0xd'));var toCsv=require(_0x9dd0('0xe'));var querystring=require(_0x9dd0('0xf'));var Papa=require('papaparse');var Redis=require(_0x9dd0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9dd0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9dd0('0x12'));var logger=require(_0x9dd0('0x13'))(_0x9dd0('0x14'));var utils=require(_0x9dd0('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9dd0('0x16'));var db=require(_0x9dd0('0x17'))['db'];function respondWithStatusCode(_0x354368,_0x578d04){_0x578d04=_0x578d04||0xcc;return function(_0x449308){if(_0x449308){return _0x354368[_0x9dd0('0x18')](_0x578d04);}return _0x354368['status'](_0x578d04)[_0x9dd0('0x19')]();};}function respondWithResult(_0xf183fd,_0x2fa027){_0x2fa027=_0x2fa027||0xc8;return function(_0x513918){if(_0x513918){return _0xf183fd[_0x9dd0('0x1a')](_0x2fa027)[_0x9dd0('0x1b')](_0x513918);}};}function respondWithFilteredResult(_0x1fd148,_0x58a9aa){return function(_0x38cbdd){if(_0x38cbdd){var _0x54137d=typeof _0x58a9aa[_0x9dd0('0x1c')]===_0x9dd0('0x1d')&&typeof _0x58a9aa[_0x9dd0('0x1e')]===_0x9dd0('0x1d');var _0x509f00=_0x38cbdd[_0x9dd0('0x1f')];var _0x1c3059=_0x54137d?0x0:_0x58a9aa['offset'];var _0x375caa=_0x54137d?_0x38cbdd[_0x9dd0('0x1f')]:_0x58a9aa[_0x9dd0('0x1c')]+_0x58a9aa['limit'];var _0x3edfc6;if(_0x375caa>=_0x509f00){_0x375caa=_0x509f00;_0x3edfc6=0xc8;}else{_0x3edfc6=0xce;}_0x1fd148[_0x9dd0('0x1a')](_0x3edfc6);return _0x1fd148[_0x9dd0('0x20')](_0x9dd0('0x21'),_0x1c3059+'-'+_0x375caa+'/'+_0x509f00)[_0x9dd0('0x1b')](_0x38cbdd);}return null;};}function patchUpdates(_0x1e2fa2){return function(_0x513748){try{jsonpatch['apply'](_0x513748,_0x1e2fa2,!![]);}catch(_0x29c0b2){return BPromise['reject'](_0x29c0b2);}return _0x513748[_0x9dd0('0x22')]();};}function saveUpdates(_0x56a2b7,_0x86ed19){return function(_0x3641a4){if(_0x3641a4){return _0x3641a4[_0x9dd0('0x23')](_0x56a2b7)[_0x9dd0('0x24')](function(_0x49d467){return _0x49d467;});}return null;};}function removeEntity(_0x553853,_0x56c81e){return function(_0x3e3345){if(_0x3e3345){return _0x3e3345[_0x9dd0('0x25')]()[_0x9dd0('0x24')](function(){_0x553853[_0x9dd0('0x1a')](0xcc)[_0x9dd0('0x19')]();});}};}function handleEntityNotFound(_0x58d08d,_0x1f47bc){return function(_0x26254a){if(!_0x26254a){_0x58d08d[_0x9dd0('0x18')](0x194);}return _0x26254a;};}function handleError(_0x1a69ca,_0x24501a){_0x24501a=_0x24501a||0x1f4;return function(_0x294a15){logger['error'](_0x294a15[_0x9dd0('0x26')]);if(_0x294a15['name']){delete _0x294a15[_0x9dd0('0x27')];}_0x1a69ca['status'](_0x24501a)['send'](_0x294a15);};}exports[_0x9dd0('0x28')]=function(_0x429bcb,_0x4c4790){var _0x281519={},_0x125f9e={},_0x1dd591={'count':0x0,'rows':[]};var _0xb8d1e=_[_0x9dd0('0x29')](db[_0x9dd0('0x2a')][_0x9dd0('0x2b')],function(_0xfa134d){return{'name':_0xfa134d['fieldName'],'type':_0xfa134d[_0x9dd0('0x2c')][_0x9dd0('0x2d')]};});_0x125f9e[_0x9dd0('0x2e')]=_[_0x9dd0('0x29')](_0xb8d1e,_0x9dd0('0x27'));_0x125f9e['query']=_[_0x9dd0('0x2f')](_0x429bcb[_0x9dd0('0x30')]);_0x125f9e[_0x9dd0('0x31')]=_[_0x9dd0('0x32')](_0x125f9e['model'],_0x125f9e[_0x9dd0('0x30')]);_0x281519[_0x9dd0('0x33')]=_[_0x9dd0('0x32')](_0x125f9e[_0x9dd0('0x2e')],qs['fields'](_0x429bcb[_0x9dd0('0x30')]['fields']));_0x281519['attributes']=_0x281519[_0x9dd0('0x33')][_0x9dd0('0x34')]?_0x281519[_0x9dd0('0x33')]:_0x125f9e[_0x9dd0('0x2e')];if(!_0x429bcb[_0x9dd0('0x30')][_0x9dd0('0x35')]('nolimit')){_0x281519[_0x9dd0('0x1e')]=qs[_0x9dd0('0x1e')](_0x429bcb[_0x9dd0('0x30')][_0x9dd0('0x1e')]);_0x281519['offset']=qs[_0x9dd0('0x1c')](_0x429bcb['query'][_0x9dd0('0x1c')]);}_0x281519[_0x9dd0('0x36')]=qs['sort'](_0x429bcb['query'][_0x9dd0('0x37')]);_0x281519[_0x9dd0('0x38')]=qs[_0x9dd0('0x31')](_[_0x9dd0('0x39')](_0x429bcb[_0x9dd0('0x30')],_0x125f9e[_0x9dd0('0x31')]),_0xb8d1e);if(_0x429bcb[_0x9dd0('0x30')][_0x9dd0('0x3a')]){_0x281519[_0x9dd0('0x38')]=_['merge'](_0x281519['where'],{'$or':_['map'](_0xb8d1e,function(_0x1392f1){if(_0x1392f1[_0x9dd0('0x2c')]!=='VIRTUAL'){var _0x511438={};_0x511438[_0x1392f1['name']]={'$like':'%'+_0x429bcb['query']['filter']+'%'};return _0x511438;}})});}_0x281519=_[_0x9dd0('0x3b')]({},_0x281519,_0x429bcb[_0x9dd0('0x3c')]);var _0x4173f9={'where':_0x281519['where']};return db[_0x9dd0('0x2a')][_0x9dd0('0x1f')](_0x4173f9)['then'](function(_0x3db32a){_0x1dd591[_0x9dd0('0x1f')]=_0x3db32a;if(_0x429bcb[_0x9dd0('0x30')][_0x9dd0('0x3d')]){_0x281519[_0x9dd0('0x3e')]=[{'all':!![]}];}return db[_0x9dd0('0x2a')][_0x9dd0('0x3f')](_0x281519);})['then'](function(_0x4b6594){_0x1dd591[_0x9dd0('0x40')]=_0x4b6594;return _0x1dd591;})[_0x9dd0('0x24')](respondWithFilteredResult(_0x4c4790,_0x281519))[_0x9dd0('0x41')](handleError(_0x4c4790,null));};exports[_0x9dd0('0x42')]=function(_0x356892,_0x5d3054){var _0x57548d={'raw':!![],'where':{'id':_0x356892[_0x9dd0('0x43')]['id']}},_0x46c05f={};_0x46c05f['model']=_[_0x9dd0('0x2f')](db[_0x9dd0('0x2a')][_0x9dd0('0x2b')]);_0x46c05f[_0x9dd0('0x30')]=_[_0x9dd0('0x2f')](_0x356892[_0x9dd0('0x30')]);_0x46c05f[_0x9dd0('0x31')]=_[_0x9dd0('0x32')](_0x46c05f[_0x9dd0('0x2e')],_0x46c05f[_0x9dd0('0x30')]);_0x57548d[_0x9dd0('0x33')]=_[_0x9dd0('0x32')](_0x46c05f[_0x9dd0('0x2e')],qs['fields'](_0x356892['query'][_0x9dd0('0x44')]));_0x57548d[_0x9dd0('0x33')]=_0x57548d[_0x9dd0('0x33')][_0x9dd0('0x34')]?_0x57548d['attributes']:_0x46c05f[_0x9dd0('0x2e')];if(_0x356892[_0x9dd0('0x30')][_0x9dd0('0x3d')]){_0x57548d[_0x9dd0('0x3e')]=[{'all':!![]}];}_0x57548d=_[_0x9dd0('0x3b')]({},_0x57548d,_0x356892[_0x9dd0('0x3c')]);return db[_0x9dd0('0x2a')][_0x9dd0('0x45')](_0x57548d)['then'](handleEntityNotFound(_0x5d3054,null))[_0x9dd0('0x24')](respondWithResult(_0x5d3054,null))[_0x9dd0('0x41')](handleError(_0x5d3054,null));};exports['create']=function(_0x5bf28b,_0x47d52c){return db[_0x9dd0('0x2a')][_0x9dd0('0x46')](_0x5bf28b[_0x9dd0('0x47')],{})[_0x9dd0('0x24')](respondWithResult(_0x47d52c,0xc9))[_0x9dd0('0x41')](handleError(_0x47d52c,null));};exports[_0x9dd0('0x23')]=function(_0xe75918,_0x31eeac){if(_0xe75918[_0x9dd0('0x47')]['id']){delete _0xe75918['body']['id'];}return db[_0x9dd0('0x2a')]['find']({'where':{'id':_0xe75918[_0x9dd0('0x43')]['id']}})['then'](handleEntityNotFound(_0x31eeac,null))[_0x9dd0('0x24')](saveUpdates(_0xe75918[_0x9dd0('0x47')],null))[_0x9dd0('0x24')](respondWithResult(_0x31eeac,null))['catch'](handleError(_0x31eeac,null));};exports[_0x9dd0('0x25')]=function(_0x5bd9ac,_0x3991c1){return db[_0x9dd0('0x2a')]['find']({'where':{'id':_0x5bd9ac[_0x9dd0('0x43')]['id']}})['then'](handleEntityNotFound(_0x3991c1,null))[_0x9dd0('0x24')](removeEntity(_0x3991c1,null))[_0x9dd0('0x41')](handleError(_0x3991c1,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index fc91c90..35f5789 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 _0xb6b0=['path','rimraf','../../config/environment','./openchannelApplication.attributes','define','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x25c1e1,_0x5f2be5){var _0x217801=function(_0x504953){while(--_0x504953){_0x25c1e1['push'](_0x25c1e1['shift']());}};_0x217801(++_0x5f2be5);}(_0xb6b0,0x119));var _0x0b6b=function(_0x4626a9,_0x2d7100){_0x4626a9=_0x4626a9-0x0;var _0x1f9d89=_0xb6b0[_0x4626a9];return _0x1f9d89;};'use strict';var _=require(_0x0b6b('0x0'));var util=require(_0x0b6b('0x1'));var logger=require(_0x0b6b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0b6b('0x3'));var rp=require(_0x0b6b('0x4'));var fs=require('fs');var path=require(_0x0b6b('0x5'));var rimraf=require(_0x0b6b('0x6'));var config=require(_0x0b6b('0x7'));var attributes=require(_0x0b6b('0x8'));module['exports']=function(_0x128afd,_0x123d4e){return _0x128afd[_0x0b6b('0x9')]('OpenchannelApplication',attributes,{'tableName':_0x0b6b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0b6b('0xb'),'collate':_0x0b6b('0xc')});}; \ No newline at end of file +var _0xba77=['define','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','request-promise','path','rimraf','./openchannelApplication.attributes','exports'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xba77,0x100));var _0x7ba7=function(_0x6182ff,_0x59d492){_0x6182ff=_0x6182ff-0x0;var _0x1cec22=_0xba77[_0x6182ff];return _0x1cec22;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7ba7('0x0'))(_0x7ba7('0x1'));var moment=require(_0x7ba7('0x2'));var BPromise=require('bluebird');var rp=require(_0x7ba7('0x3'));var fs=require('fs');var path=require(_0x7ba7('0x4'));var rimraf=require(_0x7ba7('0x5'));var config=require('../../config/environment');var attributes=require(_0x7ba7('0x6'));module[_0x7ba7('0x7')]=function(_0x115286,_0x9d74dd){return _0x115286[_0x7ba7('0x8')]('OpenchannelApplication',attributes,{'tableName':_0x7ba7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7ba7('0xa'),'collate':_0x7ba7('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 2545de6..edaf778 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 _0x05b0=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelApplication,\x20%s,\x20%s','result','OpenchannelApplication','update','body','options','raw','where','limit','UpdateOpenchannelApplication','catch'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x05b0,0x100));var _0x005b=function(_0x15a174,_0x66c258){_0x15a174=_0x15a174-0x0;var _0x255c9b=_0x05b0[_0x15a174];return _0x255c9b;};'use strict';var _=require('lodash');var util=require(_0x005b('0x0'));var moment=require(_0x005b('0x1'));var BPromise=require(_0x005b('0x2'));var rs=require(_0x005b('0x3'));var fs=require('fs');var Redis=require(_0x005b('0x4'));var db=require(_0x005b('0x5'))['db'];var utils=require(_0x005b('0x6'));var logger=require('../../config/logger')(_0x005b('0x7'));var config=require(_0x005b('0x8'));var jayson=require(_0x005b('0x9'));var client=jayson[_0x005b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a0b79,_0x7170fb,_0x35a755){return new BPromise(function(_0x444ca8,_0x2f0ff4){return client[_0x005b('0xb')](_0x1a0b79,_0x35a755)[_0x005b('0xc')](function(_0x49b004){logger[_0x005b('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x7170fb,_0x005b('0xe'));logger[_0x005b('0xf')](_0x005b('0x10'),_0x7170fb,'request\x20sent',JSON[_0x005b('0x11')](_0x49b004));if(_0x49b004[_0x005b('0x12')]){if(_0x49b004['error'][_0x005b('0x13')]===0x1f4){logger[_0x005b('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x7170fb,_0x49b004[_0x005b('0x12')][_0x005b('0x14')]);return _0x2f0ff4(_0x49b004['error']['message']);}logger['error'](_0x005b('0x15'),_0x7170fb,_0x49b004[_0x005b('0x12')]['message']);return _0x444ca8(_0x49b004['error'][_0x005b('0x14')]);}else{logger[_0x005b('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x7170fb,'request\x20sent');_0x444ca8(_0x49b004[_0x005b('0x16')]['message']);}})['catch'](function(_0xaecb81){logger['error'](_0x005b('0x15'),_0x7170fb,_0xaecb81);_0x2f0ff4(_0xaecb81);});});}exports['UpdateOpenchannelApplication']=function(_0x5c7f38){var _0xeaced7=this;return new Promise(function(_0x9976f1,_0x398c6d){return db[_0x005b('0x17')][_0x005b('0x18')](_0x5c7f38[_0x005b('0x19')],{'raw':_0x5c7f38[_0x005b('0x1a')]?_0x5c7f38[_0x005b('0x1a')][_0x005b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c7f38[_0x005b('0x1a')]?_0x5c7f38['options'][_0x005b('0x1c')]||null:null,'attributes':_0x5c7f38['options']?_0x5c7f38['options']['attributes']||null:null,'limit':_0x5c7f38[_0x005b('0x1a')]?_0x5c7f38[_0x005b('0x1a')][_0x005b('0x1d')]||null:null})[_0x005b('0xc')](function(_0x124630){logger[_0x005b('0xd')]('UpdateOpenchannelApplication',_0x5c7f38);logger[_0x005b('0xf')](_0x005b('0x1e'),_0x5c7f38,JSON['stringify'](_0x124630));_0x9976f1(_0x124630);})[_0x005b('0x1f')](function(_0x49ed77){logger[_0x005b('0x12')](_0x005b('0x1e'),_0x49ed77['message'],_0x5c7f38);_0x398c6d(_0xeaced7['error'](0x1f4,_0x49ed77['message']));});});}; \ No newline at end of file +var _0xf464=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x43bfee,_0x40678f){var _0x43c512=function(_0x10eded){while(--_0x10eded){_0x43bfee['push'](_0x43bfee['shift']());}};_0x43c512(++_0x40678f);}(_0xf464,0xeb));var _0x4f46=function(_0x37843f,_0x5c87e6){_0x37843f=_0x37843f-0x0;var _0x11b480=_0xf464[_0x37843f];return _0x11b480;};'use strict';var _=require(_0x4f46('0x0'));var util=require('util');var moment=require(_0x4f46('0x1'));var BPromise=require(_0x4f46('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f46('0x3'));var db=require(_0x4f46('0x4'))['db'];var utils=require(_0x4f46('0x5'));var logger=require(_0x4f46('0x6'))(_0x4f46('0x7'));var config=require(_0x4f46('0x8'));var jayson=require(_0x4f46('0x9'));var client=jayson['client'][_0x4f46('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1460a1,_0x5dadef,_0x1c9b9d){return new BPromise(function(_0xf0c6d0,_0x57f0c4){return client[_0x4f46('0xb')](_0x1460a1,_0x1c9b9d)[_0x4f46('0xc')](function(_0x2509b2){logger[_0x4f46('0xd')](_0x4f46('0xe'),_0x5dadef,_0x4f46('0xf'));logger['debug'](_0x4f46('0x10'),_0x5dadef,_0x4f46('0xf'),JSON[_0x4f46('0x11')](_0x2509b2));if(_0x2509b2[_0x4f46('0x12')]){if(_0x2509b2[_0x4f46('0x12')][_0x4f46('0x13')]===0x1f4){logger[_0x4f46('0x12')](_0x4f46('0xe'),_0x5dadef,_0x2509b2[_0x4f46('0x12')][_0x4f46('0x14')]);return _0x57f0c4(_0x2509b2[_0x4f46('0x12')]['message']);}logger[_0x4f46('0x12')](_0x4f46('0xe'),_0x5dadef,_0x2509b2['error'][_0x4f46('0x14')]);return _0xf0c6d0(_0x2509b2[_0x4f46('0x12')]['message']);}else{logger[_0x4f46('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x5dadef,'request\x20sent');_0xf0c6d0(_0x2509b2[_0x4f46('0x15')][_0x4f46('0x14')]);}})[_0x4f46('0x16')](function(_0x81432b){logger['error'](_0x4f46('0xe'),_0x5dadef,_0x81432b);_0x57f0c4(_0x81432b);});});}exports[_0x4f46('0x17')]=function(_0x19c9b8){var _0x234f27=this;return new Promise(function(_0x44aafb,_0x1bb12e){return db[_0x4f46('0x18')][_0x4f46('0x19')](_0x19c9b8['body'],{'raw':_0x19c9b8[_0x4f46('0x1a')]?_0x19c9b8['options'][_0x4f46('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19c9b8[_0x4f46('0x1a')]?_0x19c9b8[_0x4f46('0x1a')][_0x4f46('0x1c')]||null:null,'attributes':_0x19c9b8[_0x4f46('0x1a')]?_0x19c9b8[_0x4f46('0x1a')][_0x4f46('0x1d')]||null:null,'limit':_0x19c9b8[_0x4f46('0x1a')]?_0x19c9b8['options']['limit']||null:null})['then'](function(_0x5d57dd){logger[_0x4f46('0xd')](_0x4f46('0x17'),_0x19c9b8);logger['debug'](_0x4f46('0x17'),_0x19c9b8,JSON[_0x4f46('0x11')](_0x5d57dd));_0x44aafb(_0x5d57dd);})['catch'](function(_0x1dfe6e){logger[_0x4f46('0x12')](_0x4f46('0x17'),_0x1dfe6e[_0x4f46('0x14')],_0x19c9b8);_0x1bb12e(_0x234f27[_0x4f46('0x12')](0x1f4,_0x1dfe6e['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 7a61eb4..260c46e 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 _0x5615=['/:id','show','/:id/messages','getMessages','post','addMessage','/:id/tags','tracked','addTags','put','openchannel','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','delete','removeTags','exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x5615,0xa3));var _0x5561=function(_0x1e644e,_0x20f995){_0x1e644e=_0x1e644e-0x0;var _0x1dff84=_0x5615[_0x1e644e];return _0x1dff84;};'use strict';var multer=require(_0x5561('0x0'));var util=require('util');var path=require(_0x5561('0x1'));var timeout=require(_0x5561('0x2'));var express=require('express');var router=express[_0x5561('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5561('0x4'));var config=require(_0x5561('0x5'));var controller=require('./openchannelInteraction.controller');router['get']('/',auth[_0x5561('0x6')](),controller[_0x5561('0x7')]);router[_0x5561('0x8')](_0x5561('0x9'),auth[_0x5561('0x6')](),controller[_0x5561('0xa')]);router[_0x5561('0x8')](_0x5561('0xb'),auth['isAuthenticated'](),controller[_0x5561('0xc')]);router['get'](_0x5561('0xd'),auth[_0x5561('0x6')](),controller[_0x5561('0xe')]);router['get']('/:id/download',auth[_0x5561('0x6')](),controller['download']);router[_0x5561('0xf')]('/',auth[_0x5561('0x6')](),controller['create']);router[_0x5561('0xf')](_0x5561('0xd'),auth['isAuthenticated'](),controller[_0x5561('0x10')]);router['post'](_0x5561('0x11'),auth[_0x5561('0x6')](),interaction[_0x5561('0x12')]('openchannel','openchannelinteraction:addtags'),controller[_0x5561('0x13')]);router[_0x5561('0x14')](_0x5561('0xb'),auth[_0x5561('0x6')](),interaction[_0x5561('0x12')](_0x5561('0x15'),_0x5561('0x16')),controller[_0x5561('0x17')]);router['delete'](_0x5561('0xb'),auth[_0x5561('0x6')](),interaction[_0x5561('0x12')](_0x5561('0x15'),_0x5561('0x18')),controller[_0x5561('0x19')]);router[_0x5561('0x1a')](_0x5561('0x11'),auth['isAuthenticated'](),controller[_0x5561('0x1b')]);module[_0x5561('0x1c')]=router; \ No newline at end of file +var _0x337b=['/:id/messages','/:id/download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','destroy','removeTags','multer','util','path','connect-timeout','../../config/environment','./openchannelInteraction.controller','index','/describe','isAuthenticated','describe','/:id','get'];(function(_0x1324f1,_0x23c1dd){var _0x1e4e9c=function(_0x22bd5c){while(--_0x22bd5c){_0x1324f1['push'](_0x1324f1['shift']());}};_0x1e4e9c(++_0x23c1dd);}(_0x337b,0x102));var _0xb337=function(_0x4f7683,_0x233e4c){_0x4f7683=_0x4f7683-0x0;var _0x4a25d6=_0x337b[_0x4f7683];return _0x4a25d6;};'use strict';var multer=require(_0xb337('0x0'));var util=require(_0xb337('0x1'));var path=require(_0xb337('0x2'));var timeout=require(_0xb337('0x3'));var express=require('express');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(_0xb337('0x4'));var controller=require(_0xb337('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xb337('0x6')]);router['get'](_0xb337('0x7'),auth[_0xb337('0x8')](),controller[_0xb337('0x9')]);router['get'](_0xb337('0xa'),auth[_0xb337('0x8')](),controller['show']);router[_0xb337('0xb')](_0xb337('0xc'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0xb337('0xd'),auth[_0xb337('0x8')](),controller['download']);router[_0xb337('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb337('0xe')](_0xb337('0xc'),auth[_0xb337('0x8')](),controller[_0xb337('0xf')]);router[_0xb337('0xe')](_0xb337('0x10'),auth['isAuthenticated'](),interaction[_0xb337('0x11')](_0xb337('0x12'),_0xb337('0x13')),controller[_0xb337('0x14')]);router[_0xb337('0x15')](_0xb337('0xa'),auth[_0xb337('0x8')](),interaction[_0xb337('0x11')](_0xb337('0x12'),_0xb337('0x16')),controller[_0xb337('0x17')]);router[_0xb337('0x18')](_0xb337('0xa'),auth[_0xb337('0x8')](),interaction[_0xb337('0x11')](_0xb337('0x12'),'openchannelinteraction:destroy'),controller[_0xb337('0x19')]);router[_0xb337('0x18')](_0xb337('0x10'),auth['isAuthenticated'](),controller[_0xb337('0x1a')]);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 e954fee..146b9c6 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 _0x26bc=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x1ded8d,_0x41aca3){var _0x3b7385=function(_0x3395da){while(--_0x3395da){_0x1ded8d['push'](_0x1ded8d['shift']());}};_0x3b7385(++_0x41aca3);}(_0x26bc,0x162));var _0xc26b=function(_0x45e631,_0x59de4a){_0x45e631=_0x45e631-0x0;var _0x40a079=_0x26bc[_0x45e631];return _0x40a079;};'use strict';var Sequelize=require(_0xc26b('0x0'));module[_0xc26b('0x1')]={'closed':{'type':Sequelize[_0xc26b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc26b('0x3')]},'disposition':{'type':Sequelize[_0xc26b('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xc26b('0x4')]},'note':{'type':Sequelize[_0xc26b('0x4')]},'read1stAt':{'type':Sequelize[_0xc26b('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xc26b('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xc26b('0x5')]('in',_0xc26b('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xc26b('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xc26b('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xc26b('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xdb76=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x5ba232,_0x2d07cd){var _0x5f062d=function(_0x533cfc){while(--_0x533cfc){_0x5ba232['push'](_0x5ba232['shift']());}};_0x5f062d(++_0x2d07cd);}(_0xdb76,0x1be));var _0x6db7=function(_0x223531,_0x2c6052){_0x223531=_0x223531-0x0;var _0x1607a9=_0xdb76[_0x223531];return _0x1607a9;};'use strict';var Sequelize=require(_0x6db7('0x0'));module[_0x6db7('0x1')]={'closed':{'type':Sequelize[_0x6db7('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6db7('0x3')]},'disposition':{'type':Sequelize[_0x6db7('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x6db7('0x4')]},'note':{'type':Sequelize[_0x6db7('0x4')]},'read1stAt':{'type':Sequelize[_0x6db7('0x3')]},'threadId':{'type':Sequelize[_0x6db7('0x4')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x6db7('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x6db7('0x5')]('in',_0x6db7('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x6db7('0x5')]('in',_0x6db7('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x6db7('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 9bd29bd..a1fa601 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 _0x5aa8=['../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','error','stack','name','index','map','OpenchannelInteraction','rawAttributes','type','key','findAll','openchannel','query','catch','params','model','keys','filters','attributes','fields','length','includeAll','include','options','create','body','describe','addMessage','OpenchannelMessage','find','omit','findOne','intersection','hasOwnProperty','nolimit','order','sort','where','OpenchannelInteractionId','merge','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','setTags','ids','color','emit','removeTags','download','unix','join','root','server','files','tmp','attachments','User','fullname','CmContact','lastName','push','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','Account','get','Owner','N.A.','toString','closed','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','firstName','Contact','value','renderFile','transcript-','unlinkSync','rimraf','zip-dir','path','ejs','lodash','ioredis','../../components/parsers/qs'];(function(_0x51b077,_0x316674){var _0x222248=function(_0x107c79){while(--_0x107c79){_0x51b077['push'](_0x51b077['shift']());}};_0x222248(++_0x316674);}(_0x5aa8,0x155));var _0x85aa=function(_0x43e9c0,_0x478e73){_0x43e9c0=_0x43e9c0-0x0;var _0xc1abbf=_0x5aa8[_0x43e9c0];return _0xc1abbf;};'use strict';var rimraf=require(_0x85aa('0x0'));var zipdir=require(_0x85aa('0x1'));var moment=require('moment');var util=require('util');var path=require(_0x85aa('0x2'));var ejs=require(_0x85aa('0x3'));var fs=require('fs');var _=require(_0x85aa('0x4'));var Redis=require(_0x85aa('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0x85aa('0x6'));var pdf=require(_0x85aa('0x7'));var logger=require(_0x85aa('0x8'))(_0x85aa('0x9'));var config=require(_0x85aa('0xa'));var db=require(_0x85aa('0xb'))['db'];config[_0x85aa('0xc')]=_['defaults'](config[_0x85aa('0xc')],{'host':_0x85aa('0xd'),'port':0x18eb});var socket=require(_0x85aa('0xe'))(new Redis(config[_0x85aa('0xc')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x597abf,_0x3367d0){_0x3367d0=_0x3367d0||0xcc;return function(_0x3b7a7e){if(_0x3b7a7e){return _0x597abf[_0x85aa('0xf')](_0x3367d0);}return _0x597abf[_0x85aa('0x10')](_0x3367d0)[_0x85aa('0x11')]();};}function respondWithResult(_0x4b530a,_0x1ce748){_0x1ce748=_0x1ce748||0xc8;return function(_0x2b70f5){if(_0x2b70f5){return _0x4b530a[_0x85aa('0x10')](_0x1ce748)[_0x85aa('0x12')](_0x2b70f5);}};}function respondWithFilteredResult(_0x245bbf,_0x1d5e63){return function(_0x4d6825){if(_0x4d6825){var _0x54c2df=typeof _0x1d5e63[_0x85aa('0x13')]===_0x85aa('0x14')&&typeof _0x1d5e63['limit']===_0x85aa('0x14');var _0x1c5005=_0x4d6825[_0x85aa('0x15')];var _0x645802=_0x54c2df?0x0:_0x1d5e63[_0x85aa('0x13')];var _0x81e4eb=_0x54c2df?_0x4d6825[_0x85aa('0x15')]:_0x1d5e63[_0x85aa('0x13')]+_0x1d5e63[_0x85aa('0x16')];var _0x5a49a9;if(_0x81e4eb>=_0x1c5005){_0x81e4eb=_0x1c5005;_0x5a49a9=0xc8;}else{_0x5a49a9=0xce;}_0x245bbf[_0x85aa('0x10')](_0x5a49a9);return _0x245bbf[_0x85aa('0x17')](_0x85aa('0x18'),_0x645802+'-'+_0x81e4eb+'/'+_0x1c5005)[_0x85aa('0x12')](_0x4d6825);}return null;};}function saveUpdates(_0x4f4d4b){return function(_0x58c3ea){if(_0x58c3ea){return _0x58c3ea[_0x85aa('0x19')](_0x4f4d4b)[_0x85aa('0x1a')](function(_0x4b4bcc){return _0x4b4bcc;});}return null;};}function removeEntity(_0x148ed7){return function(_0x286052){if(_0x286052){return _0x286052[_0x85aa('0x1b')]()[_0x85aa('0x1a')](function(){_0x148ed7[_0x85aa('0x10')](0xcc)[_0x85aa('0x11')]();});}};}function handleEntityNotFound(_0x2ccec3){return function(_0x4ffa26){if(!_0x4ffa26){_0x2ccec3[_0x85aa('0xf')](0x194);}return _0x4ffa26;};}function handleError(_0x557cec,_0x2bdb1d){_0x2bdb1d=_0x2bdb1d||0x1f4;return function(_0x11e0c5){logger[_0x85aa('0x1c')](_0x11e0c5[_0x85aa('0x1d')]);if(_0x11e0c5['name']){delete _0x11e0c5[_0x85aa('0x1e')];}_0x557cec[_0x85aa('0x10')](_0x2bdb1d)['send'](_0x11e0c5);};}exports[_0x85aa('0x1f')]=function(_0x3df9bc,_0x1557f8){var _0x52bffa={};var _0x26b9d1=_[_0x85aa('0x20')](db[_0x85aa('0x21')][_0x85aa('0x22')],function(_0x43b352){return{'name':_0x43b352['fieldName'],'type':_0x43b352[_0x85aa('0x23')][_0x85aa('0x24')]};});_0x52bffa=qs['getOptions'](_0x26b9d1,_0x3df9bc);return interaction[_0x85aa('0x25')](_0x85aa('0x26'),_0x3df9bc[_0x85aa('0x27')],_0x3df9bc['user'],_0x52bffa,_0x26b9d1)['then'](respondWithFilteredResult(_0x1557f8,_0x52bffa))[_0x85aa('0x28')](handleError(_0x1557f8,null));};exports['show']=function(_0x481db7,_0x441ad9){var _0x10c6a1={};if(_0x481db7[_0x85aa('0x27')][_0x85aa('0x23')]&&_0x481db7[_0x85aa('0x27')][_0x85aa('0x23')]==='from'){_0x10c6a1['from']=_0x481db7[_0x85aa('0x29')]['id'];}else{_0x10c6a1['id']=_0x481db7['params']['id'];}var _0x3375f6={'raw':![],'where':_0x10c6a1},_0x4cf382={};_0x4cf382[_0x85aa('0x2a')]=_[_0x85aa('0x2b')](db[_0x85aa('0x21')]['rawAttributes']);_0x4cf382['query']=_[_0x85aa('0x2b')](_0x481db7[_0x85aa('0x27')]);_0x4cf382[_0x85aa('0x2c')]=_['intersection'](_0x4cf382[_0x85aa('0x2a')],_0x4cf382[_0x85aa('0x27')]);_0x3375f6[_0x85aa('0x2d')]=_['intersection'](_0x4cf382[_0x85aa('0x2a')],qs[_0x85aa('0x2e')](_0x481db7['query'][_0x85aa('0x2e')]));_0x3375f6['attributes']=_0x3375f6[_0x85aa('0x2d')][_0x85aa('0x2f')]?_0x3375f6[_0x85aa('0x2d')]:_0x4cf382[_0x85aa('0x2a')];if(_0x481db7[_0x85aa('0x27')][_0x85aa('0x30')]){_0x3375f6[_0x85aa('0x31')]=[{'all':!![]}];}_0x3375f6=_['merge']({},_0x3375f6,_0x481db7[_0x85aa('0x32')]);return db[_0x85aa('0x21')]['find'](_0x3375f6)[_0x85aa('0x1a')](handleEntityNotFound(_0x441ad9,null))[_0x85aa('0x1a')](respondWithResult(_0x441ad9,null))[_0x85aa('0x28')](handleError(_0x441ad9,null));};exports[_0x85aa('0x33')]=function(_0x3e2394,_0x4f8c17){return db[_0x85aa('0x21')][_0x85aa('0x33')](_0x3e2394[_0x85aa('0x34')],{})['then'](respondWithResult(_0x4f8c17,0xc9))['catch'](handleError(_0x4f8c17,null));};exports[_0x85aa('0x19')]=function(_0xab3530,_0xf21ba){if(_0xab3530[_0x85aa('0x34')]['id']){delete _0xab3530['body']['id'];}return db[_0x85aa('0x21')]['find']({'where':{'id':_0xab3530['params']['id']}})[_0x85aa('0x1a')](handleEntityNotFound(_0xf21ba,null))[_0x85aa('0x1a')](saveUpdates(_0xab3530[_0x85aa('0x34')],null))[_0x85aa('0x1a')](respondWithResult(_0xf21ba,null))['catch'](handleError(_0xf21ba,null));};exports[_0x85aa('0x1b')]=function(_0x483138,_0x1147cc){return db['OpenchannelInteraction']['find']({'where':{'id':_0x483138[_0x85aa('0x29')]['id']}})['then'](handleEntityNotFound(_0x1147cc,null))[_0x85aa('0x1a')](removeEntity(_0x1147cc,null))['catch'](handleError(_0x1147cc,null));};exports[_0x85aa('0x35')]=function(_0x6f6e7b,_0x5284de){return db[_0x85aa('0x21')][_0x85aa('0x35')]()['then'](respondWithResult(_0x5284de,null))['catch'](handleError(_0x5284de,null));};exports[_0x85aa('0x36')]=function(_0xec435f,_0x43ee4b){return db[_0x85aa('0x37')][_0x85aa('0x38')]({'where':{'id':_0xec435f[_0x85aa('0x29')]['id']}})[_0x85aa('0x1a')](handleEntityNotFound(_0x43ee4b,null))['then'](function(_0xc488d8){if(_0xc488d8){return _0xc488d8[_0x85aa('0x36')](_0xec435f[_0x85aa('0x34')]['ids'],_[_0x85aa('0x39')](_0xec435f[_0x85aa('0x34')],['ids','id'])||{});}})[_0x85aa('0x1a')](respondWithResult(_0x43ee4b,null))[_0x85aa('0x28')](handleError(_0x43ee4b,null));};exports['getMessages']=function(_0x298594,_0x461ee6){var _0x4847cf={'raw':![],'where':{}};var _0x21fc5f={};var _0x3f26c8={'count':0x0,'rows':[]};return db[_0x85aa('0x21')][_0x85aa('0x3a')]({'where':{'id':_0x298594['params']['id']}})[_0x85aa('0x1a')](handleEntityNotFound(_0x461ee6,null))[_0x85aa('0x1a')](function(_0x15ba35){if(_0x15ba35){_0x21fc5f['model']=_[_0x85aa('0x2b')](db[_0x85aa('0x37')][_0x85aa('0x22')]);_0x21fc5f['query']=_['keys'](_0x298594[_0x85aa('0x27')]);_0x21fc5f['filters']=_[_0x85aa('0x3b')](_0x21fc5f[_0x85aa('0x2a')],_0x21fc5f[_0x85aa('0x27')]);_0x4847cf['attributes']=_['intersection'](_0x21fc5f['model'],qs['fields'](_0x298594[_0x85aa('0x27')][_0x85aa('0x2e')]));_0x4847cf[_0x85aa('0x2d')]=_0x4847cf['attributes'][_0x85aa('0x2f')]?_0x4847cf[_0x85aa('0x2d')]:_0x21fc5f['model'];if(!_0x298594['query'][_0x85aa('0x3c')](_0x85aa('0x3d'))){_0x4847cf[_0x85aa('0x16')]=qs[_0x85aa('0x16')](_0x298594[_0x85aa('0x27')][_0x85aa('0x16')]);_0x4847cf[_0x85aa('0x13')]=qs[_0x85aa('0x13')](_0x298594['query'][_0x85aa('0x13')]);}_0x4847cf[_0x85aa('0x3e')]=qs[_0x85aa('0x3f')](_0x298594['query']['sort']);_0x4847cf[_0x85aa('0x40')]=qs[_0x85aa('0x2c')](_['pick'](_0x298594[_0x85aa('0x27')],_0x21fc5f[_0x85aa('0x2c')]));_0x4847cf[_0x85aa('0x40')][_0x85aa('0x41')]=_0x15ba35['id'];if(_0x298594[_0x85aa('0x27')]['filter']){_0x4847cf[_0x85aa('0x40')]=_[_0x85aa('0x42')](_0x4847cf['where'],{'$or':_[_0x85aa('0x20')](_0x4847cf[_0x85aa('0x2d')],function(_0x433016){var _0x119909={};_0x119909[_0x433016]={'$like':'%'+_0x298594[_0x85aa('0x27')][_0x85aa('0x43')]+'%'};return _0x119909;})});}if(_0x298594['query'][_0x85aa('0x44')]){var _0x14afe9=_0x298594[_0x85aa('0x27')][_0x85aa('0x44')][_0x85aa('0x45')](',');var _0x5aaf71={};_0x5aaf71[_0x14afe9[0x0]]={'$gte':moment(_0x14afe9[0x1])[_0x85aa('0x46')](_0x85aa('0x47'))};_0x4847cf['where']=_[_0x85aa('0x42')](_0x4847cf['where'],_0x5aaf71);}_0x4847cf=_[_0x85aa('0x42')]({},_0x4847cf,_0x298594[_0x85aa('0x32')]);return db['OpenchannelMessage']['count']({'where':_0x4847cf[_0x85aa('0x40')]})[_0x85aa('0x1a')](function(_0x192613){_0x3f26c8[_0x85aa('0x15')]=_0x192613;if(_0x298594[_0x85aa('0x27')][_0x85aa('0x30')]){_0x4847cf['include']=[{'all':!![]}];}return db[_0x85aa('0x37')][_0x85aa('0x25')](_0x4847cf);})[_0x85aa('0x1a')](function(_0x25dd96){_0x3f26c8['rows']=_0x25dd96;return _0x3f26c8;});}})[_0x85aa('0x1a')](respondWithFilteredResult(_0x461ee6,_0x4847cf))[_0x85aa('0x28')](handleError(_0x461ee6,null));};exports['addTags']=function(_0x5a0384,_0x5340a7){return db[_0x85aa('0x21')][_0x85aa('0x38')]({'where':{'id':_0x5a0384[_0x85aa('0x29')]['id']}})[_0x85aa('0x1a')](handleEntityNotFound(_0x5340a7,null))[_0x85aa('0x1a')](function(_0x50c1d){if(_0x50c1d){return _0x50c1d[_0x85aa('0x48')](_0x5a0384[_0x85aa('0x34')][_0x85aa('0x49')],_['omit'](_0x5a0384['body'],[_0x85aa('0x49'),'id'])||{})['spread'](function(){return db['Tag'][_0x85aa('0x25')]({'attributes':['id',_0x85aa('0x1e'),_0x85aa('0x4a')],'where':{'id':_0x5a0384[_0x85aa('0x34')]['ids']}});})[_0x85aa('0x1a')](function(_0x3cfb80){socket[_0x85aa('0x4b')]('openchannelInteractionTags:save',{'id':Number(_0x5a0384[_0x85aa('0x29')]['id']),'tags':_0x3cfb80||[]});return{'id':Number(_0x5a0384['params']['id']),'tags':_0x3cfb80||[]};});}})[_0x85aa('0x1a')](respondWithResult(_0x5340a7,null))[_0x85aa('0x28')](handleError(_0x5340a7,null));};exports['removeTags']=function(_0x10c9e7,_0x860bd6){return db[_0x85aa('0x21')][_0x85aa('0x38')]({'where':{'id':_0x10c9e7[_0x85aa('0x29')]['id']}})[_0x85aa('0x1a')](handleEntityNotFound(_0x860bd6,null))[_0x85aa('0x1a')](function(_0x52c554){if(_0x52c554){return _0x52c554[_0x85aa('0x4c')](_0x10c9e7[_0x85aa('0x27')]['ids']);}})[_0x85aa('0x1a')](respondWithStatusCode(_0x860bd6,null))['catch'](handleError(_0x860bd6,null));};exports[_0x85aa('0x4d')]=function(_0x3dd5a9,_0x264b49){var _0x11979a=moment()[_0x85aa('0x4e')]()['toString']();var _0x3d6a3b=path[_0x85aa('0x4f')](config[_0x85aa('0x50')],_0x85aa('0x51'),_0x85aa('0x52'),_0x85aa('0x53'));var _0x3bb03b=path[_0x85aa('0x4f')](config[_0x85aa('0x50')],'server',_0x85aa('0x52'),_0x85aa('0x54'));var _0x2dc7e2=path[_0x85aa('0x4f')](_0x3d6a3b,_0x11979a);var _0x2ec1da=util[_0x85aa('0x46')]('transcript-%d-%s.zip',_0x3dd5a9[_0x85aa('0x29')]['id'],_0x11979a);var _0x2dbbab=path[_0x85aa('0x4f')](_0x3d6a3b,_0x2ec1da);var _0x1ca5ec=[];_0x1ca5ec['push']({'model':db[_0x85aa('0x55')],'as':_0x85aa('0x55'),'attributes':['id',_0x85aa('0x56')],'raw':!![]});_0x1ca5ec['push']({'model':db[_0x85aa('0x57')],'as':'Contact','attributes':['id','firstName',_0x85aa('0x58')],'raw':!![]});if(_0x3dd5a9['query'][_0x85aa('0x54')]){_0x1ca5ec[_0x85aa('0x59')]({'model':db[_0x85aa('0x5a')],'as':_0x85aa('0x5a'),'raw':!![]});}var _0x4095aa=[{'model':db[_0x85aa('0x37')],'as':_0x85aa('0x5b'),'attributes':['id',_0x85aa('0x34'),_0x85aa('0x5c'),_0x85aa('0x5d'),_0x85aa('0x5e'),_0x85aa('0x5f')],'include':_0x1ca5ec}];_0x4095aa[_0x85aa('0x59')]({'model':db[_0x85aa('0x60')],'as':_0x85aa('0x61'),'attributes':['id',_0x85aa('0x1e')]});_0x4095aa[_0x85aa('0x59')]({'model':db[_0x85aa('0x55')],'as':'Owner','attributes':['id',_0x85aa('0x56')]});return db[_0x85aa('0x21')]['find']({'where':{'id':_0x3dd5a9[_0x85aa('0x29')]['id']},'include':_0x4095aa})['then'](handleEntityNotFound(_0x264b49,null))[_0x85aa('0x1a')](function(_0x508836){if(_0x508836){var _0x1fdfa1=_0x508836[_0x85aa('0x62')]({'plain':!![]});fs['mkdirSync'](_0x2dc7e2);var _0x13a32f={'channel':'Openchannel','account':_0x1fdfa1[_0x85aa('0x61')][_0x85aa('0x1e')],'agent':_0x1fdfa1[_0x85aa('0x63')]?_0x1fdfa1['Owner'][_0x85aa('0x56')]:_0x85aa('0x64'),'createdAt':moment(_0x1fdfa1[_0x85aa('0x5c')])[_0x85aa('0x46')]('YYYY-MM-DD\x20HH:mm:ss')[_0x85aa('0x65')](),'closedAt':_0x1fdfa1[_0x85aa('0x66')]?moment(_0x1fdfa1['closedAt'])[_0x85aa('0x46')]('YYYY-MM-DD\x20HH:mm:ss')[_0x85aa('0x65')]():'','disposition':_0x1fdfa1['disposition'],'visibility':_0x1fdfa1['threadId']?'Public':'Private','messages':_(_0x1fdfa1[_0x85aa('0x5b')])['filter']({'secret':![]})[_0x85aa('0x20')](function(_0xcee9de){if(_0xcee9de['Attachment']){var _0xa3d4a7=path['join'](_0x3bb03b,_0xcee9de[_0x85aa('0x5a')][_0x85aa('0x67')]);if(fs[_0x85aa('0x68')](_0xa3d4a7)){fs[_0x85aa('0x69')](_0xa3d4a7)[_0x85aa('0x6a')](fs[_0x85aa('0x6b')](path[_0x85aa('0x4f')](_0x2dc7e2,_0xcee9de[_0x85aa('0x5a')][_0x85aa('0x67')])));}}return{'date':moment(_0xcee9de['createdAt'])[_0x85aa('0x46')](_0x85aa('0x47'))[_0x85aa('0x65')](),'sender':_0xcee9de[_0x85aa('0x5d')]===_0x85aa('0x6c')?_0xcee9de[_0x85aa('0x55')]?_0xcee9de[_0x85aa('0x55')]['fullname']:_0x85aa('0x6d'):_0xcee9de['Contact'][_0x85aa('0x6e')]+(_0xcee9de[_0x85aa('0x6f')][_0x85aa('0x58')]?'\x20'+_0xcee9de[_0x85aa('0x6f')][_0x85aa('0x58')]:''),'body':_0xcee9de[_0x85aa('0x5a')]?_0xcee9de[_0x85aa('0x5a')]['basename']:_0xcee9de[_0x85aa('0x34')],'direction':_0xcee9de['direction']===_0x85aa('0x6c')?'A':'C','secret':_0xcee9de[_0x85aa('0x5e')],'read':_0xcee9de[_0x85aa('0x5f')],'attachment':_0xcee9de[_0x85aa('0x5a')]};})[_0x85aa('0x70')]()};return ejs[_0x85aa('0x71')](path[_0x85aa('0x4f')](config[_0x85aa('0x50')],_0x85aa('0x51'),'views','downloadInteraction.ejs'),{'interaction':_0x13a32f})[_0x85aa('0x1a')](function(_0x34fa2c){var _0x42f117=path[_0x85aa('0x4f')](_0x2dc7e2,_0x85aa('0x72')+_0x1fdfa1['id']+'-'+_0x11979a+'.pdf');var _0x5826ea={'path':_0x42f117,'channel':'Openchannel','interactionId':_0x1fdfa1['id']};return pdf['createPdfFromHTML'](_0x34fa2c,_0x5826ea);})[_0x85aa('0x1a')](function(){return new Promise(function(_0x17dda3,_0x2e65b5){zipdir(_0x2dc7e2,{'saveTo':_0x2dbbab},function(_0x310445,_0x3c41f6){if(_0x310445)return _0x2e65b5(_0x310445);return _0x17dda3(_0x3c41f6);});})['then'](function(){return new Promise(function(_0x218716,_0x336f74){rimraf(_0x2dc7e2,function(_0x5c6ab1){if(_0x5c6ab1)_0x336f74(_0x5c6ab1);return _0x218716();});});})[_0x85aa('0x1a')](function(){return _0x264b49[_0x85aa('0x4d')](_0x2dbbab,_0x2ec1da,function(_0x3dfec0){if(_0x3dfec0){logger[_0x85aa('0x1c')]('Unable\x20to\x20delete\x20zip\x20file',_0x3dfec0);}else{fs[_0x85aa('0x73')](_0x2dbbab);}});});});}else{return _0x264b49[_0x85aa('0xf')](0xc8);}})[_0x85aa('0x28')](handleError(_0x264b49,null));}; \ No newline at end of file +var _0x3fab=['keys','OpenchannelInteraction','intersection','model','attributes','fields','length','merge','find','create','body','destroy','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','filters','hasOwnProperty','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','include','rows','addTags','setTags','spread','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','User','fullname','push','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','format','closedAt','Public','Private','existsSync','createReadStream','createWriteStream','basename','System','out','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','sendStatus','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','status','end','json','limit','undefined','count','offset','set','Content-Range','then','error','stack','name','index','map','rawAttributes','fieldName','type','getOptions','findAll','openchannel','query','user','catch','show','from','params'];(function(_0x23a9b0,_0x48f680){var _0x555f45=function(_0x12a58a){while(--_0x12a58a){_0x23a9b0['push'](_0x23a9b0['shift']());}};_0x555f45(++_0x48f680);}(_0x3fab,0x1ef));var _0xb3fa=function(_0x1710e4,_0x593dd6){_0x1710e4=_0x1710e4-0x0;var _0x9aa2ac=_0x3fab[_0x1710e4];return _0x9aa2ac;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xb3fa('0x0'));var moment=require(_0xb3fa('0x1'));var util=require(_0xb3fa('0x2'));var path=require(_0xb3fa('0x3'));var ejs=require(_0xb3fa('0x4'));var fs=require('fs');var _=require(_0xb3fa('0x5'));var Redis=require(_0xb3fa('0x6'));var interaction=require(_0xb3fa('0x7'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0xb3fa('0x8'))(_0xb3fa('0x9'));var config=require(_0xb3fa('0xa'));var db=require(_0xb3fa('0xb'))['db'];config[_0xb3fa('0xc')]=_[_0xb3fa('0xd')](config[_0xb3fa('0xc')],{'host':_0xb3fa('0xe'),'port':0x18eb});var socket=require(_0xb3fa('0xf'))(new Redis(config[_0xb3fa('0xc')]));require(_0xb3fa('0x10'))[_0xb3fa('0x11')](socket);function respondWithStatusCode(_0x68fd76,_0x2d7a64){_0x2d7a64=_0x2d7a64||0xcc;return function(_0xd01d0b){if(_0xd01d0b){return _0x68fd76['sendStatus'](_0x2d7a64);}return _0x68fd76[_0xb3fa('0x12')](_0x2d7a64)[_0xb3fa('0x13')]();};}function respondWithResult(_0x57e1f1,_0x109879){_0x109879=_0x109879||0xc8;return function(_0x3a13b2){if(_0x3a13b2){return _0x57e1f1[_0xb3fa('0x12')](_0x109879)[_0xb3fa('0x14')](_0x3a13b2);}};}function respondWithFilteredResult(_0x38508,_0x2cb049){return function(_0x211532){if(_0x211532){var _0x21fb2c=typeof _0x2cb049['offset']==='undefined'&&typeof _0x2cb049[_0xb3fa('0x15')]===_0xb3fa('0x16');var _0x16af0e=_0x211532[_0xb3fa('0x17')];var _0x3de3f7=_0x21fb2c?0x0:_0x2cb049[_0xb3fa('0x18')];var _0x915891=_0x21fb2c?_0x211532[_0xb3fa('0x17')]:_0x2cb049[_0xb3fa('0x18')]+_0x2cb049[_0xb3fa('0x15')];var _0x22f674;if(_0x915891>=_0x16af0e){_0x915891=_0x16af0e;_0x22f674=0xc8;}else{_0x22f674=0xce;}_0x38508['status'](_0x22f674);return _0x38508[_0xb3fa('0x19')](_0xb3fa('0x1a'),_0x3de3f7+'-'+_0x915891+'/'+_0x16af0e)[_0xb3fa('0x14')](_0x211532);}return null;};}function saveUpdates(_0x363e98){return function(_0x3392c4){if(_0x3392c4){return _0x3392c4['update'](_0x363e98)[_0xb3fa('0x1b')](function(_0x2628eb){return _0x2628eb;});}return null;};}function removeEntity(_0x6280f7){return function(_0x5703e8){if(_0x5703e8){return _0x5703e8['destroy']()[_0xb3fa('0x1b')](function(){_0x6280f7['status'](0xcc)[_0xb3fa('0x13')]();});}};}function handleEntityNotFound(_0x1a788d){return function(_0x2f48ef){if(!_0x2f48ef){_0x1a788d['sendStatus'](0x194);}return _0x2f48ef;};}function handleError(_0x142b85,_0x580f6e){_0x580f6e=_0x580f6e||0x1f4;return function(_0x1b5c17){logger[_0xb3fa('0x1c')](_0x1b5c17[_0xb3fa('0x1d')]);if(_0x1b5c17[_0xb3fa('0x1e')]){delete _0x1b5c17[_0xb3fa('0x1e')];}_0x142b85[_0xb3fa('0x12')](_0x580f6e)['send'](_0x1b5c17);};}exports[_0xb3fa('0x1f')]=function(_0x57730e,_0x2eb28e){var _0x42d88a={};var _0x5a85ac=_[_0xb3fa('0x20')](db['OpenchannelInteraction'][_0xb3fa('0x21')],function(_0x413e4b){return{'name':_0x413e4b[_0xb3fa('0x22')],'type':_0x413e4b[_0xb3fa('0x23')]['key']};});_0x42d88a=qs[_0xb3fa('0x24')](_0x5a85ac,_0x57730e);return interaction[_0xb3fa('0x25')](_0xb3fa('0x26'),_0x57730e[_0xb3fa('0x27')],_0x57730e[_0xb3fa('0x28')],_0x42d88a,_0x5a85ac)[_0xb3fa('0x1b')](respondWithFilteredResult(_0x2eb28e,_0x42d88a))[_0xb3fa('0x29')](handleError(_0x2eb28e,null));};exports[_0xb3fa('0x2a')]=function(_0x345b49,_0x1cda21){var _0x1c0051={};if(_0x345b49[_0xb3fa('0x27')][_0xb3fa('0x23')]&&_0x345b49[_0xb3fa('0x27')][_0xb3fa('0x23')]===_0xb3fa('0x2b')){_0x1c0051[_0xb3fa('0x2b')]=_0x345b49[_0xb3fa('0x2c')]['id'];}else{_0x1c0051['id']=_0x345b49[_0xb3fa('0x2c')]['id'];}var _0x379cfe={'raw':![],'where':_0x1c0051},_0x2c8060={};_0x2c8060['model']=_[_0xb3fa('0x2d')](db[_0xb3fa('0x2e')][_0xb3fa('0x21')]);_0x2c8060[_0xb3fa('0x27')]=_[_0xb3fa('0x2d')](_0x345b49[_0xb3fa('0x27')]);_0x2c8060['filters']=_[_0xb3fa('0x2f')](_0x2c8060[_0xb3fa('0x30')],_0x2c8060[_0xb3fa('0x27')]);_0x379cfe[_0xb3fa('0x31')]=_[_0xb3fa('0x2f')](_0x2c8060['model'],qs[_0xb3fa('0x32')](_0x345b49['query']['fields']));_0x379cfe[_0xb3fa('0x31')]=_0x379cfe[_0xb3fa('0x31')][_0xb3fa('0x33')]?_0x379cfe[_0xb3fa('0x31')]:_0x2c8060[_0xb3fa('0x30')];if(_0x345b49[_0xb3fa('0x27')]['includeAll']){_0x379cfe['include']=[{'all':!![]}];}_0x379cfe=_[_0xb3fa('0x34')]({},_0x379cfe,_0x345b49['options']);return db[_0xb3fa('0x2e')][_0xb3fa('0x35')](_0x379cfe)[_0xb3fa('0x1b')](handleEntityNotFound(_0x1cda21,null))[_0xb3fa('0x1b')](respondWithResult(_0x1cda21,null))[_0xb3fa('0x29')](handleError(_0x1cda21,null));};exports['create']=function(_0x1fde16,_0xcab93){return db[_0xb3fa('0x2e')][_0xb3fa('0x36')](_0x1fde16[_0xb3fa('0x37')],{})[_0xb3fa('0x1b')](respondWithResult(_0xcab93,0xc9))[_0xb3fa('0x29')](handleError(_0xcab93,null));};exports['update']=function(_0x3ed8cb,_0xdab2d9){if(_0x3ed8cb['body']['id']){delete _0x3ed8cb['body']['id'];}return db['OpenchannelInteraction'][_0xb3fa('0x35')]({'where':{'id':_0x3ed8cb[_0xb3fa('0x2c')]['id']}})[_0xb3fa('0x1b')](handleEntityNotFound(_0xdab2d9,null))[_0xb3fa('0x1b')](saveUpdates(_0x3ed8cb[_0xb3fa('0x37')],null))['then'](respondWithResult(_0xdab2d9,null))[_0xb3fa('0x29')](handleError(_0xdab2d9,null));};exports[_0xb3fa('0x38')]=function(_0x1e513d,_0x1cbc8a){return db[_0xb3fa('0x2e')][_0xb3fa('0x35')]({'where':{'id':_0x1e513d['params']['id']}})['then'](handleEntityNotFound(_0x1cbc8a,null))[_0xb3fa('0x1b')](removeEntity(_0x1cbc8a,null))['catch'](handleError(_0x1cbc8a,null));};exports[_0xb3fa('0x39')]=function(_0x3476f4,_0x5da8e5){return db[_0xb3fa('0x2e')][_0xb3fa('0x39')]()['then'](respondWithResult(_0x5da8e5,null))[_0xb3fa('0x29')](handleError(_0x5da8e5,null));};exports[_0xb3fa('0x3a')]=function(_0x9e13c8,_0x5dc345){return db[_0xb3fa('0x3b')][_0xb3fa('0x35')]({'where':{'id':_0x9e13c8[_0xb3fa('0x2c')]['id']}})[_0xb3fa('0x1b')](handleEntityNotFound(_0x5dc345,null))[_0xb3fa('0x1b')](function(_0x2ab313){if(_0x2ab313){return _0x2ab313[_0xb3fa('0x3a')](_0x9e13c8[_0xb3fa('0x37')][_0xb3fa('0x3c')],_[_0xb3fa('0x3d')](_0x9e13c8[_0xb3fa('0x37')],['ids','id'])||{});}})['then'](respondWithResult(_0x5dc345,null))[_0xb3fa('0x29')](handleError(_0x5dc345,null));};exports[_0xb3fa('0x3e')]=function(_0x58e25d,_0x306dc3){var _0x2f35e1={'raw':![],'where':{}};var _0xfbad1a={};var _0x1b9551={'count':0x0,'rows':[]};return db[_0xb3fa('0x2e')][_0xb3fa('0x3f')]({'where':{'id':_0x58e25d[_0xb3fa('0x2c')]['id']}})['then'](handleEntityNotFound(_0x306dc3,null))[_0xb3fa('0x1b')](function(_0xbe452b){if(_0xbe452b){_0xfbad1a[_0xb3fa('0x30')]=_[_0xb3fa('0x2d')](db[_0xb3fa('0x3b')][_0xb3fa('0x21')]);_0xfbad1a[_0xb3fa('0x27')]=_[_0xb3fa('0x2d')](_0x58e25d['query']);_0xfbad1a[_0xb3fa('0x40')]=_[_0xb3fa('0x2f')](_0xfbad1a[_0xb3fa('0x30')],_0xfbad1a[_0xb3fa('0x27')]);_0x2f35e1['attributes']=_[_0xb3fa('0x2f')](_0xfbad1a[_0xb3fa('0x30')],qs['fields'](_0x58e25d[_0xb3fa('0x27')][_0xb3fa('0x32')]));_0x2f35e1[_0xb3fa('0x31')]=_0x2f35e1[_0xb3fa('0x31')][_0xb3fa('0x33')]?_0x2f35e1[_0xb3fa('0x31')]:_0xfbad1a[_0xb3fa('0x30')];if(!_0x58e25d['query'][_0xb3fa('0x41')](_0xb3fa('0x42'))){_0x2f35e1['limit']=qs['limit'](_0x58e25d[_0xb3fa('0x27')][_0xb3fa('0x15')]);_0x2f35e1[_0xb3fa('0x18')]=qs[_0xb3fa('0x18')](_0x58e25d[_0xb3fa('0x27')][_0xb3fa('0x18')]);}_0x2f35e1[_0xb3fa('0x43')]=qs[_0xb3fa('0x44')](_0x58e25d[_0xb3fa('0x27')][_0xb3fa('0x44')]);_0x2f35e1[_0xb3fa('0x45')]=qs[_0xb3fa('0x40')](_[_0xb3fa('0x46')](_0x58e25d[_0xb3fa('0x27')],_0xfbad1a['filters']));_0x2f35e1['where'][_0xb3fa('0x47')]=_0xbe452b['id'];if(_0x58e25d[_0xb3fa('0x27')]['filter']){_0x2f35e1[_0xb3fa('0x45')]=_['merge'](_0x2f35e1[_0xb3fa('0x45')],{'$or':_[_0xb3fa('0x20')](_0x2f35e1[_0xb3fa('0x31')],function(_0x5d5116){var _0x3ce32a={};_0x3ce32a[_0x5d5116]={'$like':'%'+_0x58e25d['query'][_0xb3fa('0x48')]+'%'};return _0x3ce32a;})});}if(_0x58e25d[_0xb3fa('0x27')][_0xb3fa('0x49')]){var _0x51d70a=_0x58e25d['query'][_0xb3fa('0x49')][_0xb3fa('0x4a')](',');var _0x36971c={};_0x36971c[_0x51d70a[0x0]]={'$gte':moment(_0x51d70a[0x1])['format'](_0xb3fa('0x4b'))};_0x2f35e1[_0xb3fa('0x45')]=_['merge'](_0x2f35e1[_0xb3fa('0x45')],_0x36971c);}_0x2f35e1=_[_0xb3fa('0x34')]({},_0x2f35e1,_0x58e25d[_0xb3fa('0x4c')]);return db[_0xb3fa('0x3b')][_0xb3fa('0x17')]({'where':_0x2f35e1[_0xb3fa('0x45')]})[_0xb3fa('0x1b')](function(_0x1a513e){_0x1b9551[_0xb3fa('0x17')]=_0x1a513e;if(_0x58e25d[_0xb3fa('0x27')][_0xb3fa('0x4d')]){_0x2f35e1[_0xb3fa('0x4e')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x2f35e1);})[_0xb3fa('0x1b')](function(_0x194fe0){_0x1b9551[_0xb3fa('0x4f')]=_0x194fe0;return _0x1b9551;});}})['then'](respondWithFilteredResult(_0x306dc3,_0x2f35e1))[_0xb3fa('0x29')](handleError(_0x306dc3,null));};exports[_0xb3fa('0x50')]=function(_0x2d1446,_0x37be7a){return db[_0xb3fa('0x2e')][_0xb3fa('0x35')]({'where':{'id':_0x2d1446['params']['id']}})[_0xb3fa('0x1b')](handleEntityNotFound(_0x37be7a,null))[_0xb3fa('0x1b')](function(_0x4cc8db){if(_0x4cc8db){return _0x4cc8db[_0xb3fa('0x51')](_0x2d1446[_0xb3fa('0x37')][_0xb3fa('0x3c')],_[_0xb3fa('0x3d')](_0x2d1446['body'],[_0xb3fa('0x3c'),'id'])||{})[_0xb3fa('0x52')](function(){return db['Tag']['findAll']({'attributes':['id',_0xb3fa('0x1e'),_0xb3fa('0x53')],'where':{'id':_0x2d1446['body'][_0xb3fa('0x3c')]}});})[_0xb3fa('0x1b')](function(_0x477af0){socket[_0xb3fa('0x54')](_0xb3fa('0x55'),{'id':Number(_0x2d1446[_0xb3fa('0x2c')]['id']),'tags':_0x477af0||[]});return{'id':Number(_0x2d1446[_0xb3fa('0x2c')]['id']),'tags':_0x477af0||[]};});}})[_0xb3fa('0x1b')](respondWithResult(_0x37be7a,null))[_0xb3fa('0x29')](handleError(_0x37be7a,null));};exports[_0xb3fa('0x56')]=function(_0x38ca34,_0x23d004){return db['OpenchannelInteraction'][_0xb3fa('0x35')]({'where':{'id':_0x38ca34[_0xb3fa('0x2c')]['id']}})['then'](handleEntityNotFound(_0x23d004,null))[_0xb3fa('0x1b')](function(_0x481d98){if(_0x481d98){return _0x481d98[_0xb3fa('0x56')](_0x38ca34[_0xb3fa('0x27')][_0xb3fa('0x3c')]);}})[_0xb3fa('0x1b')](respondWithStatusCode(_0x23d004,null))[_0xb3fa('0x29')](handleError(_0x23d004,null));};exports[_0xb3fa('0x57')]=function(_0x251a6e,_0x2d4fc3){var _0x184d0c=moment()[_0xb3fa('0x58')]()[_0xb3fa('0x59')]();var _0x5d1f34=path[_0xb3fa('0x5a')](config[_0xb3fa('0x5b')],'server',_0xb3fa('0x5c'),_0xb3fa('0x5d'));var _0x29d2a2=path['join'](config['root'],_0xb3fa('0x5e'),_0xb3fa('0x5c'),_0xb3fa('0x5f'));var _0x477c1e=path[_0xb3fa('0x5a')](_0x5d1f34,_0x184d0c);var _0x3fc217=util['format'](_0xb3fa('0x60'),_0x251a6e[_0xb3fa('0x2c')]['id'],_0x184d0c);var _0x3b1946=path[_0xb3fa('0x5a')](_0x5d1f34,_0x3fc217);var _0x25b9a5=[];_0x25b9a5['push']({'model':db[_0xb3fa('0x61')],'as':'User','attributes':['id',_0xb3fa('0x62')],'raw':!![]});_0x25b9a5[_0xb3fa('0x63')]({'model':db[_0xb3fa('0x64')],'as':_0xb3fa('0x65'),'attributes':['id',_0xb3fa('0x66'),_0xb3fa('0x67')],'raw':!![]});if(_0x251a6e[_0xb3fa('0x27')]['attachments']){_0x25b9a5[_0xb3fa('0x63')]({'model':db[_0xb3fa('0x68')],'as':_0xb3fa('0x68'),'raw':!![]});}var _0x423a68=[{'model':db[_0xb3fa('0x3b')],'as':_0xb3fa('0x69'),'attributes':['id',_0xb3fa('0x37'),_0xb3fa('0x6a'),_0xb3fa('0x6b'),_0xb3fa('0x6c'),_0xb3fa('0x6d')],'include':_0x25b9a5}];_0x423a68[_0xb3fa('0x63')]({'model':db[_0xb3fa('0x6e')],'as':_0xb3fa('0x6f'),'attributes':['id',_0xb3fa('0x1e')]});_0x423a68[_0xb3fa('0x63')]({'model':db[_0xb3fa('0x61')],'as':_0xb3fa('0x70'),'attributes':['id',_0xb3fa('0x62')]});return db['OpenchannelInteraction'][_0xb3fa('0x35')]({'where':{'id':_0x251a6e[_0xb3fa('0x2c')]['id']},'include':_0x423a68})[_0xb3fa('0x1b')](handleEntityNotFound(_0x2d4fc3,null))[_0xb3fa('0x1b')](function(_0x410f0b){if(_0x410f0b){var _0x5a78ee=_0x410f0b[_0xb3fa('0x71')]({'plain':!![]});fs[_0xb3fa('0x72')](_0x477c1e);var _0x42f906={'channel':_0xb3fa('0x73'),'account':_0x5a78ee[_0xb3fa('0x6f')]['name'],'agent':_0x5a78ee[_0xb3fa('0x70')]?_0x5a78ee['Owner']['fullname']:_0xb3fa('0x74'),'createdAt':moment(_0x5a78ee['createdAt'])[_0xb3fa('0x75')](_0xb3fa('0x4b'))[_0xb3fa('0x59')](),'closedAt':_0x5a78ee['closed']?moment(_0x5a78ee[_0xb3fa('0x76')])[_0xb3fa('0x75')]('YYYY-MM-DD\x20HH:mm:ss')[_0xb3fa('0x59')]():'','disposition':_0x5a78ee['disposition'],'visibility':_0x5a78ee['threadId']?_0xb3fa('0x77'):_0xb3fa('0x78'),'messages':_(_0x5a78ee[_0xb3fa('0x69')])[_0xb3fa('0x48')]({'secret':![]})['map'](function(_0x262fd3){if(_0x262fd3['Attachment']){var _0x40a89f=path[_0xb3fa('0x5a')](_0x29d2a2,_0x262fd3[_0xb3fa('0x68')]['basename']);if(fs[_0xb3fa('0x79')](_0x40a89f)){fs[_0xb3fa('0x7a')](_0x40a89f)['pipe'](fs[_0xb3fa('0x7b')](path[_0xb3fa('0x5a')](_0x477c1e,_0x262fd3[_0xb3fa('0x68')][_0xb3fa('0x7c')])));}}return{'date':moment(_0x262fd3[_0xb3fa('0x6a')])[_0xb3fa('0x75')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x262fd3['direction']==='out'?_0x262fd3[_0xb3fa('0x61')]?_0x262fd3['User']['fullname']:_0xb3fa('0x7d'):_0x262fd3[_0xb3fa('0x65')][_0xb3fa('0x66')]+(_0x262fd3[_0xb3fa('0x65')][_0xb3fa('0x67')]?'\x20'+_0x262fd3[_0xb3fa('0x65')][_0xb3fa('0x67')]:''),'body':_0x262fd3['Attachment']?_0x262fd3[_0xb3fa('0x68')][_0xb3fa('0x7c')]:_0x262fd3['body'],'direction':_0x262fd3[_0xb3fa('0x6b')]===_0xb3fa('0x7e')?'A':'C','secret':_0x262fd3[_0xb3fa('0x6c')],'read':_0x262fd3['read'],'attachment':_0x262fd3[_0xb3fa('0x68')]};})['value']()};return ejs[_0xb3fa('0x7f')](path[_0xb3fa('0x5a')](config['root'],'server',_0xb3fa('0x80'),_0xb3fa('0x81')),{'interaction':_0x42f906})[_0xb3fa('0x1b')](function(_0x5c5c0c){var _0x160317=path['join'](_0x477c1e,'transcript-'+_0x5a78ee['id']+'-'+_0x184d0c+_0xb3fa('0x82'));var _0x28bb60={'path':_0x160317,'channel':_0xb3fa('0x73'),'interactionId':_0x5a78ee['id']};return pdf[_0xb3fa('0x83')](_0x5c5c0c,_0x28bb60);})[_0xb3fa('0x1b')](function(){return new Promise(function(_0x2fab23,_0x1d8bf3){zipdir(_0x477c1e,{'saveTo':_0x3b1946},function(_0x3528d9,_0x482305){if(_0x3528d9)return _0x1d8bf3(_0x3528d9);return _0x2fab23(_0x482305);});})[_0xb3fa('0x1b')](function(){return new Promise(function(_0x4f4095,_0x43febe){rimraf(_0x477c1e,function(_0x3a61c6){if(_0x3a61c6)_0x43febe(_0x3a61c6);return _0x4f4095();});});})[_0xb3fa('0x1b')](function(){return _0x2d4fc3[_0xb3fa('0x57')](_0x3b1946,_0x3fc217,function(_0x25a34b){if(_0x25a34b){logger[_0xb3fa('0x1c')](_0xb3fa('0x84'),_0x25a34b);}else{fs[_0xb3fa('0x85')](_0x3b1946);}});});});}else{return _0x2d4fc3[_0xb3fa('0x86')](0xc8);}})['catch'](handleError(_0x2d4fc3,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index c8c80b4..05e8dae 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 _0xca03=['then','unreadMessages','emit','catch','hook','events','OpenchannelInteraction','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','setDataValue','findAll'];(function(_0x4d64c1,_0x507c31){var _0x517575=function(_0x2760a5){while(--_0x2760a5){_0x4d64c1['push'](_0x4d64c1['shift']());}};_0x517575(++_0x507c31);}(_0xca03,0xaa));var _0x3ca0=function(_0xf0e996,_0x4feb34){_0xf0e996=_0xf0e996-0x0;var _0xf712cc=_0xca03[_0xf0e996];return _0xf712cc;};'use strict';var EventEmitter=require(_0x3ca0('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x3ca0('0x1')];var OpenchannelMessage=require(_0x3ca0('0x2'))['db'][_0x3ca0('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x3ca0('0x4')](0x0);var events={'afterCreate':_0x3ca0('0x5'),'afterUpdate':_0x3ca0('0x6'),'afterDestroy':_0x3ca0('0x7')};function emitEvent(_0x3b5969){return function(_0x16bdcd,_0x2eafcf,_0x7d81d0){_0x16bdcd['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x4cf7b5){_0x16bdcd[_0x3ca0('0x8')]('Users',_0x4cf7b5['map'](function(_0x1772ae){return{'id':_0x1772ae['id']};}));return OpenchannelMessage[_0x3ca0('0x9')]({'where':{'OpenchannelInteractionId':_0x16bdcd['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3ca0('0xa')](function(_0x4caa9e){_0x16bdcd['setDataValue'](_0x3ca0('0xb'),_0x4caa9e['length']);OpenchannelInteractionEvents[_0x3ca0('0xc')](_0x3b5969+':'+_0x16bdcd['id'],_0x16bdcd);OpenchannelInteractionEvents[_0x3ca0('0xc')](_0x3b5969,_0x16bdcd);_0x7d81d0(null);})[_0x3ca0('0xd')](_0x7d81d0(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x3ca0('0xe')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0xa20c=['length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0x20de73,_0x2cbf6e){var _0x4d315c=function(_0x3df077){while(--_0x3df077){_0x20de73['push'](_0x20de73['shift']());}};_0x4d315c(++_0x2cbf6e);}(_0xa20c,0x141));var _0xca20=function(_0xf389d4,_0x1209ba){_0xf389d4=_0xf389d4-0x0;var _0x434d75=_0xa20c[_0xf389d4];return _0x434d75;};'use strict';var EventEmitter=require(_0xca20('0x0'));var OpenchannelInteraction=require(_0xca20('0x1'))['db'][_0xca20('0x2')];var OpenchannelMessage=require(_0xca20('0x1'))['db'][_0xca20('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xca20('0x4')](0x0);var events={'afterCreate':_0xca20('0x5'),'afterUpdate':_0xca20('0x6'),'afterDestroy':_0xca20('0x7')};function emitEvent(_0x4b736d){return function(_0x306e97,_0x26d3d6,_0x4d6d37){_0x306e97[_0xca20('0x8')]({'attributes':['id'],'raw':!![]})[_0xca20('0x9')](function(_0x305e9a){_0x306e97[_0xca20('0xa')](_0xca20('0xb'),_0x305e9a[_0xca20('0xc')](function(_0x1997c1){return{'id':_0x1997c1['id']};}));return OpenchannelMessage[_0xca20('0xd')]({'where':{'OpenchannelInteractionId':_0x306e97['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x460d64){_0x306e97[_0xca20('0xa')](_0xca20('0xe'),_0x460d64[_0xca20('0xf')]);OpenchannelInteractionEvents[_0xca20('0x10')](_0x4b736d+':'+_0x306e97['id'],_0x306e97);OpenchannelInteractionEvents[_0xca20('0x10')](_0x4b736d,_0x306e97);_0x4d6d37(null);})[_0xca20('0x11')](_0x4d6d37(null));};}for(var e in events){if(events[_0xca20('0x12')](e)){var event=events[e];OpenchannelInteraction[_0xca20('0x13')](e,emitEvent(event));}}module[_0xca20('0x14')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 9fb326e..ed50222 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 _0x9775=['YYYY-MM-DD\x20HH:mm:ss','util','moment','request-promise','../../config/environment','./openchannelInteraction.attributes','define','OpenchannelInteraction','openchannel_interactions','utf8mb4_unicode_ci','changed','closed','closedAt','format'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x9775,0x16d));var _0x5977=function(_0x1d9a77,_0x22ede7){_0x1d9a77=_0x1d9a77-0x0;var _0x2d27f5=_0x9775[_0x1d9a77];return _0x2d27f5;};'use strict';var _=require('lodash');var util=require(_0x5977('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x5977('0x1'));var BPromise=require('bluebird');var rp=require(_0x5977('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5977('0x3'));var attributes=require(_0x5977('0x4'));module['exports']=function(_0x30e178,_0x17e623){return _0x30e178[_0x5977('0x5')](_0x5977('0x6'),attributes,{'tableName':_0x5977('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5977('0x8'),'hooks':{'beforeUpdate':function(_0x2fc52a,_0x3fec64,_0x15dcd7){if(_0x2fc52a[_0x5977('0x9')](_0x5977('0xa'))){_0x2fc52a[_0x5977('0xb')]=moment()[_0x5977('0xc')](_0x5977('0xd'));}_0x15dcd7(null,_0x2fc52a);}}});}; \ No newline at end of file +var _0x3a41=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','define','openchannel_interactions','utf8mb4_unicode_ci','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api'];(function(_0x29952f,_0x3977f4){var _0x3180be=function(_0x42620a){while(--_0x42620a){_0x29952f['push'](_0x29952f['shift']());}};_0x3180be(++_0x3977f4);}(_0x3a41,0x151));var _0x13a4=function(_0x44714c,_0x2ac454){_0x44714c=_0x44714c-0x0;var _0x57d4d5=_0x3a41[_0x44714c];return _0x57d4d5;};'use strict';var _=require(_0x13a4('0x0'));var util=require('util');var logger=require(_0x13a4('0x1'))(_0x13a4('0x2'));var moment=require(_0x13a4('0x3'));var BPromise=require(_0x13a4('0x4'));var rp=require(_0x13a4('0x5'));var fs=require('fs');var path=require(_0x13a4('0x6'));var rimraf=require(_0x13a4('0x7'));var config=require(_0x13a4('0x8'));var attributes=require(_0x13a4('0x9'));module['exports']=function(_0x334def,_0x3d0c1f){return _0x334def[_0x13a4('0xa')]('OpenchannelInteraction',attributes,{'tableName':_0x13a4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x13a4('0xc'),'hooks':{'beforeUpdate':function(_0x2fb050,_0x3cd715,_0x419cd1){if(_0x2fb050[_0x13a4('0xd')](_0x13a4('0xe'))){_0x2fb050[_0x13a4('0xf')]=moment()['format'](_0x13a4('0x10'));}_0x419cd1(null,_0x2fb050);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 60aa315..3b006a6 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 _0x923f=['error','code','message','request\x20sent','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','then','find','ids','omit','AddTags','lodash','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','./openchannelInteraction.socket','register','OpenchannelInteraction,\x20%s,\x20%s','debug','stringify'];(function(_0x2425f2,_0x220e72){var _0x68dbf8=function(_0xb34345){while(--_0xb34345){_0x2425f2['push'](_0x2425f2['shift']());}};_0x68dbf8(++_0x220e72);}(_0x923f,0x1e8));var _0xf923=function(_0x5b04e5,_0x789fb1){_0x5b04e5=_0x5b04e5-0x0;var _0x51588d=_0x923f[_0x5b04e5];return _0x51588d;};'use strict';var _=require(_0xf923('0x0'));var util=require(_0xf923('0x1'));var moment=require('moment');var BPromise=require(_0xf923('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf923('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf923('0x4'));var logger=require('../../config/logger')(_0xf923('0x5'));var config=require(_0xf923('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf923('0x7')][_0xf923('0x8')]({'port':0x232a});config[_0xf923('0x9')]=_[_0xf923('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf923('0x9')]));require(_0xf923('0xb'))[_0xf923('0xc')](socket);function respondWithRpcPromise(_0x3adb72,_0x4e6b45,_0x5467e4){return new BPromise(function(_0x494e0e,_0x5caadd){return client['request'](_0x3adb72,_0x5467e4)['then'](function(_0x515e88){logger['info'](_0xf923('0xd'),_0x4e6b45,'request\x20sent');logger[_0xf923('0xe')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x4e6b45,'request\x20sent',JSON[_0xf923('0xf')](_0x515e88));if(_0x515e88['error']){if(_0x515e88[_0xf923('0x10')][_0xf923('0x11')]===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x4e6b45,_0x515e88[_0xf923('0x10')][_0xf923('0x12')]);return _0x5caadd(_0x515e88[_0xf923('0x10')][_0xf923('0x12')]);}logger[_0xf923('0x10')](_0xf923('0xd'),_0x4e6b45,_0x515e88[_0xf923('0x10')][_0xf923('0x12')]);return _0x494e0e(_0x515e88[_0xf923('0x10')][_0xf923('0x12')]);}else{logger['info'](_0xf923('0xd'),_0x4e6b45,_0xf923('0x13'));_0x494e0e(_0x515e88[_0xf923('0x14')][_0xf923('0x12')]);}})[_0xf923('0x15')](function(_0x227cf6){logger[_0xf923('0x10')]('OpenchannelInteraction,\x20%s,\x20%s',_0x4e6b45,_0x227cf6);_0x5caadd(_0x227cf6);});});}exports[_0xf923('0x16')]=function(_0x37c1ad){var _0x5de2f9=this;return new Promise(function(_0x374aa6,_0x510fe4){return db[_0xf923('0x17')][_0xf923('0x18')](_0x37c1ad[_0xf923('0x19')],{'raw':_0x37c1ad[_0xf923('0x1a')]?_0x37c1ad[_0xf923('0x1a')][_0xf923('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37c1ad[_0xf923('0x1a')]?_0x37c1ad['options'][_0xf923('0x1c')]||null:null,'attributes':_0x37c1ad[_0xf923('0x1a')]?_0x37c1ad['options'][_0xf923('0x1d')]||null:null,'limit':_0x37c1ad[_0xf923('0x1a')]?_0x37c1ad[_0xf923('0x1a')][_0xf923('0x1e')]||null:null})[_0xf923('0x1f')](function(_0x13b1d1){logger['info'](_0xf923('0x16'),_0x37c1ad);logger[_0xf923('0xe')](_0xf923('0x16'),_0x37c1ad,JSON['stringify'](_0x13b1d1));_0x374aa6(_0x13b1d1);})['catch'](function(_0x3c3d16){logger[_0xf923('0x10')](_0xf923('0x16'),_0x3c3d16[_0xf923('0x12')],_0x37c1ad);_0x510fe4(_0x5de2f9[_0xf923('0x10')](0x1f4,_0x3c3d16[_0xf923('0x12')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x26fa69){return new Promise(function(_0x2d0940,_0x505e37){return db[_0xf923('0x17')][_0xf923('0x20')]({'where':_0x26fa69['options']?_0x26fa69['options']['where']||null:null})[_0xf923('0x1f')](function(_0x3b7bc7){if(_0x3b7bc7){return _0x3b7bc7['addTags'](_0x26fa69[_0xf923('0x19')][_0xf923('0x21')],_[_0xf923('0x22')](_0x26fa69[_0xf923('0x19')],[_0xf923('0x21'),'id'])||{});}})['spread'](function(_0x4cac1a){logger['info'](_0xf923('0x23'),_0x26fa69);logger[_0xf923('0xe')](_0xf923('0x23'),_0x26fa69,JSON['stringify'](_0x4cac1a));_0x2d0940(_0x4cac1a);})['catch'](function(_0x501fd4){logger[_0xf923('0x10')](_0xf923('0x23'),_0x501fd4[_0xf923('0x12')],_0x26fa69);_0x505e37(_this['error'](0x1f4,_0x501fd4['message']));});});}; \ No newline at end of file +var _0xc240=['OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','limit','stringify','AddTagsToOpenchannelInteraction','find','where','addTags','omit','spread','AddTags','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelInteraction.socket','request','then','info'];(function(_0x422f79,_0x72581b){var _0x1bd470=function(_0x45efca){while(--_0x45efca){_0x422f79['push'](_0x422f79['shift']());}};_0x1bd470(++_0x72581b);}(_0xc240,0x137));var _0x0c24=function(_0x2e8582,_0x322a4d){_0x2e8582=_0x2e8582-0x0;var _0x4e02c7=_0xc240[_0x2e8582];return _0x4e02c7;};'use strict';var _=require('lodash');var util=require(_0x0c24('0x0'));var moment=require(_0x0c24('0x1'));var BPromise=require('bluebird');var rs=require(_0x0c24('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c24('0x3'))['db'];var utils=require(_0x0c24('0x4'));var logger=require('../../config/logger')(_0x0c24('0x5'));var config=require(_0x0c24('0x6'));var jayson=require(_0x0c24('0x7'));var client=jayson[_0x0c24('0x8')][_0x0c24('0x9')]({'port':0x232a});config[_0x0c24('0xa')]=_[_0x0c24('0xb')](config['redis'],{'host':_0x0c24('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0c24('0xa')]));require(_0x0c24('0xd'))['register'](socket);function respondWithRpcPromise(_0x20f717,_0x31fb91,_0x3352ac){return new BPromise(function(_0x5e3bfd,_0xa79e22){return client[_0x0c24('0xe')](_0x20f717,_0x3352ac)[_0x0c24('0xf')](function(_0x3b6c3b){logger[_0x0c24('0x10')](_0x0c24('0x11'),_0x31fb91,_0x0c24('0x12'));logger[_0x0c24('0x13')](_0x0c24('0x14'),_0x31fb91,'request\x20sent',JSON['stringify'](_0x3b6c3b));if(_0x3b6c3b[_0x0c24('0x15')]){if(_0x3b6c3b[_0x0c24('0x15')][_0x0c24('0x16')]===0x1f4){logger[_0x0c24('0x15')](_0x0c24('0x11'),_0x31fb91,_0x3b6c3b[_0x0c24('0x15')][_0x0c24('0x17')]);return _0xa79e22(_0x3b6c3b[_0x0c24('0x15')][_0x0c24('0x17')]);}logger[_0x0c24('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x31fb91,_0x3b6c3b[_0x0c24('0x15')]['message']);return _0x5e3bfd(_0x3b6c3b[_0x0c24('0x15')][_0x0c24('0x17')]);}else{logger[_0x0c24('0x10')](_0x0c24('0x11'),_0x31fb91,_0x0c24('0x12'));_0x5e3bfd(_0x3b6c3b[_0x0c24('0x18')][_0x0c24('0x17')]);}})[_0x0c24('0x19')](function(_0x4b279a){logger[_0x0c24('0x15')](_0x0c24('0x11'),_0x31fb91,_0x4b279a);_0xa79e22(_0x4b279a);});});}exports[_0x0c24('0x1a')]=function(_0x5a40cb){var _0x2b5cac=this;return new Promise(function(_0x5d455d,_0x41c658){return db[_0x0c24('0x1b')][_0x0c24('0x1c')](_0x5a40cb[_0x0c24('0x1d')],{'raw':_0x5a40cb['options']?_0x5a40cb[_0x0c24('0x1e')][_0x0c24('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a40cb['options']?_0x5a40cb['options']['where']||null:null,'attributes':_0x5a40cb[_0x0c24('0x1e')]?_0x5a40cb['options']['attributes']||null:null,'limit':_0x5a40cb[_0x0c24('0x1e')]?_0x5a40cb[_0x0c24('0x1e')][_0x0c24('0x20')]||null:null})['then'](function(_0x1565d4){logger[_0x0c24('0x10')](_0x0c24('0x1a'),_0x5a40cb);logger[_0x0c24('0x13')]('UpdateOpenchannelInteraction',_0x5a40cb,JSON[_0x0c24('0x21')](_0x1565d4));_0x5d455d(_0x1565d4);})['catch'](function(_0x1cecba){logger['error'](_0x0c24('0x1a'),_0x1cecba[_0x0c24('0x17')],_0x5a40cb);_0x41c658(_0x2b5cac[_0x0c24('0x15')](0x1f4,_0x1cecba['message']));});});};exports[_0x0c24('0x22')]=function(_0x2c599a){return new Promise(function(_0x4898c6,_0x54f108){return db['OpenchannelInteraction'][_0x0c24('0x23')]({'where':_0x2c599a[_0x0c24('0x1e')]?_0x2c599a[_0x0c24('0x1e')][_0x0c24('0x24')]||null:null})[_0x0c24('0xf')](function(_0x385da2){if(_0x385da2){return _0x385da2[_0x0c24('0x25')](_0x2c599a[_0x0c24('0x1d')]['ids'],_[_0x0c24('0x26')](_0x2c599a[_0x0c24('0x1d')],['ids','id'])||{});}})[_0x0c24('0x27')](function(_0x161468){logger[_0x0c24('0x10')](_0x0c24('0x28'),_0x2c599a);logger[_0x0c24('0x13')](_0x0c24('0x28'),_0x2c599a,JSON[_0x0c24('0x21')](_0x161468));_0x4898c6(_0x161468);})[_0x0c24('0x19')](function(_0x347fca){logger[_0x0c24('0x15')]('AddTags',_0x347fca['message'],_0x2c599a);_0x54f108(_this['error'](0x1f4,_0x347fca['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index e4380ed..88da251 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 _0x0a8d=['./openchannelInteraction.events','save','update','emit','length','openchannelInteraction:'];(function(_0x549feb,_0x544a55){var _0x30b9b6=function(_0x12b583){while(--_0x12b583){_0x549feb['push'](_0x549feb['shift']());}};_0x30b9b6(++_0x544a55);}(_0x0a8d,0xf0));var _0xd0a8=function(_0x1934c8,_0x420066){_0x1934c8=_0x1934c8-0x0;var _0x97322e=_0x0a8d[_0x1934c8];return _0x97322e;};'use strict';var OpenchannelInteractionEvents=require(_0xd0a8('0x0'));var events=[_0xd0a8('0x1'),'remove',_0xd0a8('0x2')];function createListener(_0x4b806b,_0x427da3){return function(_0x4acebb){_0x427da3[_0xd0a8('0x3')](_0x4b806b,_0x4acebb);};}function removeListener(_0x5553c,_0xee011a){return function(){OpenchannelInteractionEvents['removeListener'](_0x5553c,_0xee011a);};}exports['register']=function(_0x33464a){for(var _0x6cd6ff=0x0,_0x4e3a71=events[_0xd0a8('0x4')];_0x6cd6ff<_0x4e3a71;_0x6cd6ff++){var _0x5b38fe=events[_0x6cd6ff];var _0x4b97b5=createListener(_0xd0a8('0x5')+_0x5b38fe,_0x33464a);OpenchannelInteractionEvents['on'](_0x5b38fe,_0x4b97b5);}}; \ No newline at end of file +var _0x31eb=['save','remove','emit','removeListener','register','./openchannelInteraction.events'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x31eb,0xb9));var _0xb31e=function(_0x55e75b,_0x29c36f){_0x55e75b=_0x55e75b-0x0;var _0x40ef3c=_0x31eb[_0x55e75b];return _0x40ef3c;};'use strict';var OpenchannelInteractionEvents=require(_0xb31e('0x0'));var events=[_0xb31e('0x1'),_0xb31e('0x2'),'update'];function createListener(_0x4b318f,_0x6009b2){return function(_0x2d3797){_0x6009b2[_0xb31e('0x3')](_0x4b318f,_0x2d3797);};}function removeListener(_0x55c930,_0x33b217){return function(){OpenchannelInteractionEvents[_0xb31e('0x4')](_0x55c930,_0x33b217);};}exports[_0xb31e('0x5')]=function(_0x3de14d){for(var _0x52cb54=0x0,_0x21486a=events['length'];_0x52cb54<_0x21486a;_0x52cb54++){var _0x552aa6=events[_0x52cb54];var _0x49087e=createListener('openchannelInteraction:'+_0x552aa6,_0x3de14d);OpenchannelInteractionEvents['on'](_0x552aa6,_0x49087e);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index e7fdfd4..fab684d 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 _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70e0,0x17b));var _0x070e=function(_0x1785cc,_0x54ef46){_0x1785cc=_0x1785cc-0x0;var _0x3ce33d=_0x70e0[_0x1785cc];return _0x3ce33d;};'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');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file +var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0xf5c500,_0x139bc5){_0xf5c500=_0xf5c500-0x0;var _0x39733d=_0x70e0[_0xf5c500];return _0x39733d;};'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');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);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 2b939ae..058fd7b 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 _0x6a95=['ENUM','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x304b71,_0x281447){var _0x5ffef2=function(_0x32f55f){while(--_0x32f55f){_0x304b71['push'](_0x304b71['shift']());}};_0x5ffef2(++_0x281447);}(_0x6a95,0x1db));var _0x56a9=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x6a95[_0x12d033];return _0x3b4e80;};'use strict';var Sequelize=require(_0x56a9('0x0'));module[_0x56a9('0x1')]={'body':{'type':Sequelize[_0x56a9('0x2')](_0x56a9('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x56a9('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x56a9('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x56a9('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x56a9('0x6')]},'providerName':{'type':Sequelize[_0x56a9('0x7')]},'providerResponse':{'type':Sequelize[_0x56a9('0x2')]}}; \ No newline at end of file +var _0x9ccd=['TEXT','medium','ENUM','out','DATE','STRING','sequelize'];(function(_0x1034c4,_0x32aa2d){var _0x4fae5b=function(_0xef1637){while(--_0xef1637){_0x1034c4['push'](_0x1034c4['shift']());}};_0x4fae5b(++_0x32aa2d);}(_0x9ccd,0x1a3));var _0xd9cc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9ccd[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xd9cc('0x0'));module['exports']={'body':{'type':Sequelize[_0xd9cc('0x1')](_0xd9cc('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd9cc('0x3')]('in','out'),'defaultValue':_0xd9cc('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd9cc('0x5')]},'providerName':{'type':Sequelize[_0xd9cc('0x6')]},'providerResponse':{'type':Sequelize[_0xd9cc('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 537c911..1e54686 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 _0x2237=['options','find','create','body','params','describe','openchannel-interactions','accept','openchannel','read','readAt','format','UserId','user','agent','get','OpenchannelInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','fullname','email','internal','interface','channel','event','EventManager','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','contact','User','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','OpenchannelMessage','fieldName','key','map','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','include','findAll','rows','show','rawAttributes','includeAll'];(function(_0x4025f7,_0x3d5c13){var _0x32f0e6=function(_0x17e6d4){while(--_0x17e6d4){_0x4025f7['push'](_0x4025f7['shift']());}};_0x32f0e6(++_0x3d5c13);}(_0x2237,0x1b0));var _0x7223=function(_0x164986,_0xdc4ef0){_0x164986=_0x164986-0x0;var _0x4f2201=_0x2237[_0x164986];return _0x4f2201;};'use strict';var emlformat=require(_0x7223('0x0'));var rimraf=require(_0x7223('0x1'));var zipdir=require(_0x7223('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7223('0x3'));var moment=require(_0x7223('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7223('0x5'));var util=require(_0x7223('0x6'));var path=require(_0x7223('0x7'));var sox=require(_0x7223('0x8'));var csv=require(_0x7223('0x9'));var ejs=require(_0x7223('0xa'));var fs=require('fs');var fs_extra=require(_0x7223('0xb'));var _=require(_0x7223('0xc'));var squel=require(_0x7223('0xd'));var crypto=require(_0x7223('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7223('0x9'));var querystring=require('querystring');var Papa=require(_0x7223('0xf'));var Redis=require('ioredis');var authService=require(_0x7223('0x10'));var qs=require(_0x7223('0x11'));var as=require(_0x7223('0x12'));var hardwareService=require(_0x7223('0x13'));var logger=require(_0x7223('0x14'))('api');var utils=require(_0x7223('0x15'));var config=require(_0x7223('0x16'));var licenseUtil=require(_0x7223('0x17'));var db=require(_0x7223('0x18'))['db'];config[_0x7223('0x19')]=_[_0x7223('0x1a')](config[_0x7223('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x7223('0x1b'))(new Redis(config[_0x7223('0x19')]));require(_0x7223('0x1c'))['register'](socket);var jayson=require(_0x7223('0x1d'));var client=jayson[_0x7223('0x1e')][_0x7223('0x1f')]({'port':0x232c});var client9002=jayson[_0x7223('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ec250,_0x14ae63,_0x4a6591,_0x323bb2){return new BPromise(function(_0x5d66e2,_0x788326){var _0x2bf318=_0x323bb2||client;return _0x2bf318['request'](_0x2ec250,_0x4a6591)['then'](function(_0x5e1781){logger['info'](_0x7223('0x20'),_0x14ae63,'request\x20sent');logger[_0x7223('0x21')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x14ae63,_0x7223('0x22'),JSON[_0x7223('0x23')](_0x5e1781));if(_0x5e1781[_0x7223('0x24')]){if(_0x5e1781[_0x7223('0x24')][_0x7223('0x25')]===0x1f4){logger[_0x7223('0x24')](_0x7223('0x20'),_0x14ae63,_0x5e1781[_0x7223('0x24')][_0x7223('0x26')]);return _0x788326(_0x5e1781[_0x7223('0x24')][_0x7223('0x26')]);}logger[_0x7223('0x24')](_0x7223('0x20'),_0x14ae63,_0x5e1781[_0x7223('0x24')][_0x7223('0x26')]);return _0x5d66e2(_0x5e1781['error']['message']);}else{logger[_0x7223('0x27')](_0x7223('0x20'),_0x14ae63,'request\x20sent');_0x5d66e2(_0x5e1781[_0x7223('0x28')]['message']);}})[_0x7223('0x29')](function(_0x59e820){logger['error'](_0x7223('0x20'),_0x14ae63,_0x59e820);_0x788326(_0x59e820);});});}function respondWithStatusCode(_0x285610,_0xda9e08){_0xda9e08=_0xda9e08||0xcc;return function(_0x4d46bd){if(_0x4d46bd){return _0x285610[_0x7223('0x2a')](_0xda9e08);}return _0x285610[_0x7223('0x2b')](_0xda9e08)[_0x7223('0x2c')]();};}function respondWithResult(_0x32b9ec,_0x19f5d2){_0x19f5d2=_0x19f5d2||0xc8;return function(_0x45ba44){if(_0x45ba44){return _0x32b9ec['status'](_0x19f5d2)[_0x7223('0x2d')](_0x45ba44);}};}function respondWithFilteredResult(_0x32d541,_0x519c30){return function(_0x3d7aa7){if(_0x3d7aa7){var _0x199a15=typeof _0x519c30[_0x7223('0x2e')]===_0x7223('0x2f')&&typeof _0x519c30[_0x7223('0x30')]==='undefined';var _0x4b9473=_0x3d7aa7[_0x7223('0x31')];var _0x1e3380=_0x199a15?0x0:_0x519c30[_0x7223('0x2e')];var _0x1ab1ac=_0x199a15?_0x3d7aa7[_0x7223('0x31')]:_0x519c30[_0x7223('0x2e')]+_0x519c30[_0x7223('0x30')];var _0x49c957;if(_0x1ab1ac>=_0x4b9473){_0x1ab1ac=_0x4b9473;_0x49c957=0xc8;}else{_0x49c957=0xce;}_0x32d541['status'](_0x49c957);return _0x32d541[_0x7223('0x32')](_0x7223('0x33'),_0x1e3380+'-'+_0x1ab1ac+'/'+_0x4b9473)[_0x7223('0x2d')](_0x3d7aa7);}return null;};}function patchUpdates(_0x58aa9b){return function(_0x3aeaaa){try{jsonpatch['apply'](_0x3aeaaa,_0x58aa9b,!![]);}catch(_0x28134d){return BPromise[_0x7223('0x34')](_0x28134d);}return _0x3aeaaa[_0x7223('0x35')]();};}function saveUpdates(_0x14bc88,_0x15000b){return function(_0x248eca){if(_0x248eca){return _0x248eca[_0x7223('0x36')](_0x14bc88)[_0x7223('0x37')](function(_0x27b55c){return _0x27b55c;});}return null;};}function removeEntity(_0x177c19,_0x15453c){return function(_0x580b85){if(_0x580b85){return _0x580b85[_0x7223('0x38')]()[_0x7223('0x37')](function(){_0x177c19[_0x7223('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x743047,_0x14908b){return function(_0x250fc2){if(!_0x250fc2){_0x743047[_0x7223('0x2a')](0x194);}return _0x250fc2;};}function handleError(_0x51e665,_0x21b0c9){_0x21b0c9=_0x21b0c9||0x1f4;return function(_0x324c32){logger[_0x7223('0x24')](_0x324c32[_0x7223('0x39')]);if(_0x324c32[_0x7223('0x3a')]){delete _0x324c32['name'];}_0x51e665[_0x7223('0x2b')](_0x21b0c9)[_0x7223('0x3b')](_0x324c32);};}exports[_0x7223('0x3c')]=function(_0x2bb54e,_0x3222a6){var _0x21a7c9={},_0xbe7219={},_0x5093e5={'count':0x0,'rows':[]};var _0x467d7d=_['map'](db[_0x7223('0x3d')]['rawAttributes'],function(_0x3f3650){return{'name':_0x3f3650[_0x7223('0x3e')],'type':_0x3f3650['type'][_0x7223('0x3f')]};});_0xbe7219['model']=_[_0x7223('0x40')](_0x467d7d,_0x7223('0x3a'));_0xbe7219[_0x7223('0x41')]=_[_0x7223('0x42')](_0x2bb54e['query']);_0xbe7219[_0x7223('0x43')]=_[_0x7223('0x44')](_0xbe7219['model'],_0xbe7219[_0x7223('0x41')]);_0x21a7c9[_0x7223('0x45')]=_[_0x7223('0x44')](_0xbe7219[_0x7223('0x46')],qs[_0x7223('0x47')](_0x2bb54e[_0x7223('0x41')][_0x7223('0x47')]));_0x21a7c9['attributes']=_0x21a7c9['attributes']['length']?_0x21a7c9[_0x7223('0x45')]:_0xbe7219['model'];if(!_0x2bb54e[_0x7223('0x41')][_0x7223('0x48')](_0x7223('0x49'))){_0x21a7c9[_0x7223('0x30')]=qs[_0x7223('0x30')](_0x2bb54e[_0x7223('0x41')][_0x7223('0x30')]);_0x21a7c9[_0x7223('0x2e')]=qs[_0x7223('0x2e')](_0x2bb54e[_0x7223('0x41')][_0x7223('0x2e')]);}_0x21a7c9[_0x7223('0x4a')]=qs['sort'](_0x2bb54e['query'][_0x7223('0x4b')]);_0x21a7c9[_0x7223('0x4c')]=qs['filters'](_[_0x7223('0x4d')](_0x2bb54e['query'],_0xbe7219[_0x7223('0x43')]),_0x467d7d);if(_0x2bb54e['query'][_0x7223('0x4e')]){_0x21a7c9['where']=_[_0x7223('0x4f')](_0x21a7c9[_0x7223('0x4c')],{'$or':_[_0x7223('0x40')](_0x467d7d,function(_0x30fb89){if(_0x30fb89[_0x7223('0x50')]!==_0x7223('0x51')){var _0x198f5e={};_0x198f5e[_0x30fb89[_0x7223('0x3a')]]={'$like':'%'+_0x2bb54e[_0x7223('0x41')][_0x7223('0x4e')]+'%'};return _0x198f5e;}})});}_0x21a7c9=_[_0x7223('0x4f')]({},_0x21a7c9,_0x2bb54e['options']);var _0x5b7c07={'where':_0x21a7c9['where']};return db[_0x7223('0x3d')][_0x7223('0x31')](_0x5b7c07)[_0x7223('0x37')](function(_0x524459){_0x5093e5[_0x7223('0x31')]=_0x524459;if(_0x2bb54e[_0x7223('0x41')]['includeAll']){_0x21a7c9[_0x7223('0x52')]=[{'all':!![]}];}return db[_0x7223('0x3d')][_0x7223('0x53')](_0x21a7c9);})[_0x7223('0x37')](function(_0x45216d){_0x5093e5[_0x7223('0x54')]=_0x45216d;return _0x5093e5;})[_0x7223('0x37')](respondWithFilteredResult(_0x3222a6,_0x21a7c9))[_0x7223('0x29')](handleError(_0x3222a6,null));};exports[_0x7223('0x55')]=function(_0x372f75,_0x3cc216){var _0x263e38={'raw':!![],'where':{'id':_0x372f75['params']['id']}},_0x225f89={};_0x225f89[_0x7223('0x46')]=_['keys'](db[_0x7223('0x3d')][_0x7223('0x56')]);_0x225f89[_0x7223('0x41')]=_['keys'](_0x372f75['query']);_0x225f89['filters']=_['intersection'](_0x225f89['model'],_0x225f89['query']);_0x263e38[_0x7223('0x45')]=_[_0x7223('0x44')](_0x225f89['model'],qs[_0x7223('0x47')](_0x372f75['query']['fields']));_0x263e38['attributes']=_0x263e38[_0x7223('0x45')]['length']?_0x263e38[_0x7223('0x45')]:_0x225f89[_0x7223('0x46')];if(_0x372f75[_0x7223('0x41')][_0x7223('0x57')]){_0x263e38['include']=[{'all':!![]}];}_0x263e38=_['merge']({},_0x263e38,_0x372f75[_0x7223('0x58')]);return db['OpenchannelMessage'][_0x7223('0x59')](_0x263e38)['then'](handleEntityNotFound(_0x3cc216,null))[_0x7223('0x37')](respondWithResult(_0x3cc216,null))[_0x7223('0x29')](handleError(_0x3cc216,null));};exports['create']=function(_0x42c1ea,_0x4fede8){return db[_0x7223('0x3d')][_0x7223('0x5a')](_0x42c1ea[_0x7223('0x5b')],{})[_0x7223('0x37')](respondWithResult(_0x4fede8,0xc9))['catch'](handleError(_0x4fede8,null));};exports[_0x7223('0x36')]=function(_0x38ba53,_0x4343e3){if(_0x38ba53[_0x7223('0x5b')]['id']){delete _0x38ba53['body']['id'];}return db['OpenchannelMessage']['find']({'where':{'id':_0x38ba53['params']['id']}})[_0x7223('0x37')](handleEntityNotFound(_0x4343e3,null))[_0x7223('0x37')](saveUpdates(_0x38ba53[_0x7223('0x5b')],null))[_0x7223('0x37')](respondWithResult(_0x4343e3,null))['catch'](handleError(_0x4343e3,null));};exports[_0x7223('0x38')]=function(_0x4959c2,_0x1437e7){return db['OpenchannelMessage'][_0x7223('0x59')]({'where':{'id':_0x4959c2[_0x7223('0x5c')]['id']}})[_0x7223('0x37')](handleEntityNotFound(_0x1437e7,null))[_0x7223('0x37')](removeEntity(_0x1437e7,null))[_0x7223('0x29')](handleError(_0x1437e7,null));};exports[_0x7223('0x5d')]=function(_0x576eb7,_0x1d4be9){return db[_0x7223('0x3d')][_0x7223('0x5d')]()[_0x7223('0x37')](respondWithResult(_0x1d4be9,null))[_0x7223('0x29')](handleError(_0x1d4be9,null));};var interaction_log=require('../../config/logger')(_0x7223('0x5e'));exports[_0x7223('0x5f')]=function(_0x89ee9b,_0x5908f3,_0x9fc81d){var _0x524b10={'agent':{},'channel':_0x7223('0x60')};if(_0x89ee9b['body']['id']){delete _0x89ee9b[_0x7223('0x5b')]['id'];}_0x89ee9b[_0x7223('0x5b')][_0x7223('0x61')]=!![];_0x89ee9b[_0x7223('0x5b')][_0x7223('0x62')]=moment()[_0x7223('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x89ee9b[_0x7223('0x5b')][_0x7223('0x64')]=_0x89ee9b[_0x7223('0x5b')][_0x7223('0x64')]||_0x89ee9b[_0x7223('0x65')]['id'];_0x524b10[_0x7223('0x66')]['id']=_0x89ee9b[_0x7223('0x5b')][_0x7223('0x64')];return db['OpenchannelMessage']['find']({'where':{'id':_0x89ee9b[_0x7223('0x5c')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5908f3,null))[_0x7223('0x37')](saveUpdates(_0x89ee9b[_0x7223('0x5b')],null))['then'](function(_0x669ba5){if(_0x669ba5){_0x524b10[_0x7223('0x26')]=_0x669ba5[_0x7223('0x67')]({'plain':!![]});return db['OpenchannelInteraction'][_0x7223('0x59')]({'where':{'id':_0x669ba5[_0x7223('0x68')]}});}return null;})[_0x7223('0x37')](handleEntityNotFound(_0x5908f3,null))[_0x7223('0x37')](function(_0x4b0279){if(_0x4b0279){return _0x4b0279['update']({'UserId':_0x89ee9b['body'][_0x7223('0x64')],'read1stAt':_[_0x7223('0x69')](_0x4b0279[_0x7223('0x6a')])?moment()[_0x7223('0x63')](_0x7223('0x6b')):undefined});}return null;})[_0x7223('0x37')](function(_0x222e91){if(_0x222e91){_0x524b10[_0x7223('0x6c')]=_0x222e91[_0x7223('0x67')]({'plain':!![]});interaction_log[_0x7223('0x27')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x89ee9b[_0x7223('0x65')]['id'],_0x89ee9b['user'][_0x7223('0x3a')],_0x89ee9b[_0x7223('0x65')][_0x7223('0x6d')],_0x524b10[_0x7223('0x6c')]['id'],_0x89ee9b[_0x7223('0x5b')]?JSON[_0x7223('0x23')](_0x89ee9b[_0x7223('0x5b')]):'null');return respondWithRpcPromise(_0x7223('0x6e'),'acceptMessage',_0x524b10);}return null;})[_0x7223('0x37')](function(_0x37b5f4){var _0x194067=_0x7223('0x6f')+_0x37b5f4['message'][_0x7223('0x70')];return db[_0x7223('0x71')][_0x7223('0x41')](_0x194067,{'type':db['Sequelize'][_0x7223('0x72')][_0x7223('0x73')],'raw':!![]})['then'](function(_0x1b688d){return _0x1b688d;});})[_0x7223('0x37')](function(_0x1529a4){if(_0x1529a4){_0x524b10[_0x7223('0x26')]['contact']=_0x1529a4[0x0];if(!_0x89ee9b['body'][_0x7223('0x64')])return;return db['User'][_0x7223('0x59')]({'where':{'id':_0x89ee9b[_0x7223('0x5b')]['UserId'],'role':_0x7223('0x66')},'attributes':['id','name',_0x7223('0x74'),_0x7223('0x75'),_0x7223('0x76')],'raw':!![]});}return null;})[_0x7223('0x37')](function(_0x2d8bed){if(!_0x2d8bed)return null;_0x524b10[_0x7223('0x26')][_0x7223('0x66')]=_0x2d8bed;return _0x524b10;})[_0x7223('0x37')](function(_0xdb9d67){if(_0xdb9d67){if(_0x89ee9b[_0x7223('0x5b')]['manual']){_0x524b10[_0x7223('0x26')][_0x7223('0x77')]=util[_0x7223('0x63')]('SIP/%s',_0x89ee9b[_0x7223('0x65')][_0x7223('0x3a')]);_0x524b10[_0x7223('0x26')][_0x7223('0x78')]=_0x524b10[_0x7223('0x78')];_0x524b10[_0x7223('0x26')]['motionChannel']=_0x524b10[_0x7223('0x78')];_0x524b10[_0x7223('0x26')][_0x7223('0x79')]=_0x7223('0x5f');return respondWithRpcPromise(_0x7223('0x7a'),_0x7223('0x7a'),{'event':'acceptmessage','message':_0x524b10[_0x7223('0x26')]},client9002)[_0x7223('0x37')](function(){return _0x524b10;});}return _0x524b10;}return null;})[_0x7223('0x37')](respondWithResult(_0x5908f3,null))[_0x7223('0x29')](handleError(_0x5908f3,null));};var interaction_log=require('../../config/logger')(_0x7223('0x5e'));exports[_0x7223('0x34')]=function(_0x142fde,_0x29452a,_0x50cf7a){var _0x20cc39={'agent':{},'channel':_0x7223('0x60')};if(_0x142fde['body']['id']){delete _0x142fde[_0x7223('0x5b')]['id'];}_0x142fde[_0x7223('0x5b')][_0x7223('0x64')]=_0x142fde[_0x7223('0x5b')][_0x7223('0x64')]||_0x142fde[_0x7223('0x65')]['id'];_0x20cc39['agent']['id']=_0x142fde[_0x7223('0x5b')][_0x7223('0x64')];return db['OpenchannelMessage']['find']({'where':{'id':_0x142fde['params']['id'],'UserId':null}})[_0x7223('0x37')](handleEntityNotFound(_0x29452a,null))[_0x7223('0x37')](function(_0x4d3e17){if(_0x4d3e17){_0x20cc39['message']=_0x4d3e17[_0x7223('0x67')]({'plain':!![]});return db['OpenchannelInteraction'][_0x7223('0x59')]({'where':{'id':_0x4d3e17[_0x7223('0x68')]}});}return null;})[_0x7223('0x37')](handleEntityNotFound(_0x29452a,null))[_0x7223('0x37')](function(_0x3e8b5d){if(_0x3e8b5d){_0x20cc39[_0x7223('0x6c')]=_0x3e8b5d[_0x7223('0x67')]({'plain':!![]});interaction_log['info'](_0x7223('0x7b'),_0x142fde[_0x7223('0x65')]['id'],_0x142fde[_0x7223('0x65')]['name'],_0x142fde[_0x7223('0x65')][_0x7223('0x6d')],_0x20cc39[_0x7223('0x6c')]['id'],_0x142fde[_0x7223('0x5b')]?JSON[_0x7223('0x23')](_0x142fde['body']):'null');return respondWithRpcPromise(_0x7223('0x7c'),_0x7223('0x7d'),_0x20cc39);}return null;})[_0x7223('0x37')](function(_0x3359e0){var _0x5aecb2=_0x7223('0x6f')+_0x3359e0[_0x7223('0x26')][_0x7223('0x70')];return db[_0x7223('0x71')][_0x7223('0x41')](_0x5aecb2,{'type':db[_0x7223('0x7e')][_0x7223('0x72')][_0x7223('0x73')],'raw':!![]})['then'](function(_0x2ed482){return _0x2ed482;});})[_0x7223('0x37')](function(_0x59d7d5){if(_0x59d7d5){_0x20cc39[_0x7223('0x26')][_0x7223('0x7f')]=_0x59d7d5[0x0];if(!_0x142fde[_0x7223('0x5b')][_0x7223('0x64')])return;return db[_0x7223('0x80')][_0x7223('0x59')]({'where':{'id':_0x142fde[_0x7223('0x5b')][_0x7223('0x64')],'role':_0x7223('0x66')},'attributes':['id','name',_0x7223('0x74'),'email',_0x7223('0x76')],'raw':!![]});}return null;})[_0x7223('0x37')](function(_0x1f8fba){if(!_0x1f8fba)return null;_0x20cc39[_0x7223('0x26')][_0x7223('0x66')]=_0x1f8fba;return _0x20cc39;})[_0x7223('0x37')](function(_0x23199a){if(_0x23199a){_0x23199a['message'][_0x7223('0x77')]=util[_0x7223('0x63')]('SIP/%s',_0x142fde[_0x7223('0x65')][_0x7223('0x3a')]);_0x23199a[_0x7223('0x26')][_0x7223('0x78')]=_0x20cc39[_0x7223('0x78')];_0x23199a['message']['motionChannel']=_0x20cc39[_0x7223('0x78')];_0x23199a[_0x7223('0x26')]['event']=_0x7223('0x34');respondWithRpcPromise(_0x7223('0x7a'),_0x7223('0x7a'),{'event':_0x7223('0x81'),'message':_0x23199a['message']},client9002);return _0x20cc39;}return null;})[_0x7223('0x37')](respondWithResult(_0x29452a,null))[_0x7223('0x29')](handleError(_0x29452a,null));}; \ No newline at end of file +var _0xb201=['fullname','internal','manual','format','SIP/%s','channel','motionChannel','event','EventManager','agent','OpenchannelInteraction','RejectMessage','rejectMessage','contact','email','interface','rejectmessage','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','OpenchannelMessage','includeAll','include','findAll','rows','show','length','options','find','create','body','update','params','describe','openchannel-interactions','accept','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteractionId','isNil','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','User'];(function(_0x1096ce,_0x1b750f){var _0x1446fb=function(_0x24aa3a){while(--_0x24aa3a){_0x1096ce['push'](_0x1096ce['shift']());}};_0x1446fb(++_0x1b750f);}(_0xb201,0x117));var _0x1b20=function(_0x12baa4,_0x3a303f){_0x12baa4=_0x12baa4-0x0;var _0x3f2ede=_0xb201[_0x12baa4];return _0x3f2ede;};'use strict';var emlformat=require(_0x1b20('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1b20('0x1'));var jsonpatch=require(_0x1b20('0x2'));var rp=require('request-promise');var moment=require(_0x1b20('0x3'));var BPromise=require(_0x1b20('0x4'));var Mustache=require(_0x1b20('0x5'));var util=require('util');var path=require('path');var sox=require(_0x1b20('0x6'));var csv=require(_0x1b20('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b20('0x8'));var _=require('lodash');var squel=require(_0x1b20('0x9'));var crypto=require(_0x1b20('0xa'));var jsforce=require(_0x1b20('0xb'));var deskjs=require(_0x1b20('0xc'));var toCsv=require(_0x1b20('0x7'));var querystring=require('querystring');var Papa=require(_0x1b20('0xd'));var Redis=require(_0x1b20('0xe'));var authService=require(_0x1b20('0xf'));var qs=require(_0x1b20('0x10'));var as=require(_0x1b20('0x11'));var hardwareService=require(_0x1b20('0x12'));var logger=require(_0x1b20('0x13'))(_0x1b20('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1b20('0x15'));var db=require(_0x1b20('0x16'))['db'];config[_0x1b20('0x17')]=_['defaults'](config[_0x1b20('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x1b20('0x18'))(new Redis(config[_0x1b20('0x17')]));require(_0x1b20('0x19'))['register'](socket);var jayson=require(_0x1b20('0x1a'));var client=jayson[_0x1b20('0x1b')]['http']({'port':0x232c});var client9002=jayson['client'][_0x1b20('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x588dbe,_0x1a66e5,_0x57da22,_0x35aad0){return new BPromise(function(_0x2be1ed,_0x5c2f3a){var _0x527f42=_0x35aad0||client;return _0x527f42[_0x1b20('0x1d')](_0x588dbe,_0x57da22)['then'](function(_0x492615){logger[_0x1b20('0x1e')](_0x1b20('0x1f'),_0x1a66e5,_0x1b20('0x20'));logger[_0x1b20('0x21')](_0x1b20('0x22'),_0x1a66e5,_0x1b20('0x20'),JSON['stringify'](_0x492615));if(_0x492615[_0x1b20('0x23')]){if(_0x492615['error'][_0x1b20('0x24')]===0x1f4){logger['error'](_0x1b20('0x1f'),_0x1a66e5,_0x492615[_0x1b20('0x23')][_0x1b20('0x25')]);return _0x5c2f3a(_0x492615[_0x1b20('0x23')][_0x1b20('0x25')]);}logger[_0x1b20('0x23')](_0x1b20('0x1f'),_0x1a66e5,_0x492615['error'][_0x1b20('0x25')]);return _0x2be1ed(_0x492615[_0x1b20('0x23')][_0x1b20('0x25')]);}else{logger[_0x1b20('0x1e')](_0x1b20('0x1f'),_0x1a66e5,_0x1b20('0x20'));_0x2be1ed(_0x492615['result'][_0x1b20('0x25')]);}})[_0x1b20('0x26')](function(_0x5f51d2){logger[_0x1b20('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x1a66e5,_0x5f51d2);_0x5c2f3a(_0x5f51d2);});});}function respondWithStatusCode(_0x1f3a43,_0x1d6662){_0x1d6662=_0x1d6662||0xcc;return function(_0x36bfab){if(_0x36bfab){return _0x1f3a43[_0x1b20('0x27')](_0x1d6662);}return _0x1f3a43[_0x1b20('0x28')](_0x1d6662)[_0x1b20('0x29')]();};}function respondWithResult(_0x2092ed,_0x3d8a4e){_0x3d8a4e=_0x3d8a4e||0xc8;return function(_0x43de28){if(_0x43de28){return _0x2092ed['status'](_0x3d8a4e)[_0x1b20('0x2a')](_0x43de28);}};}function respondWithFilteredResult(_0xf2a587,_0x201698){return function(_0x5a48cc){if(_0x5a48cc){var _0x405bff=typeof _0x201698['offset']===_0x1b20('0x2b')&&typeof _0x201698[_0x1b20('0x2c')]===_0x1b20('0x2b');var _0x38edd3=_0x5a48cc[_0x1b20('0x2d')];var _0x2421be=_0x405bff?0x0:_0x201698[_0x1b20('0x2e')];var _0x3420cc=_0x405bff?_0x5a48cc[_0x1b20('0x2d')]:_0x201698[_0x1b20('0x2e')]+_0x201698[_0x1b20('0x2c')];var _0x1ebb19;if(_0x3420cc>=_0x38edd3){_0x3420cc=_0x38edd3;_0x1ebb19=0xc8;}else{_0x1ebb19=0xce;}_0xf2a587['status'](_0x1ebb19);return _0xf2a587[_0x1b20('0x2f')](_0x1b20('0x30'),_0x2421be+'-'+_0x3420cc+'/'+_0x38edd3)[_0x1b20('0x2a')](_0x5a48cc);}return null;};}function patchUpdates(_0x57b3e1){return function(_0x5c4be0){try{jsonpatch['apply'](_0x5c4be0,_0x57b3e1,!![]);}catch(_0x4971fa){return BPromise[_0x1b20('0x31')](_0x4971fa);}return _0x5c4be0[_0x1b20('0x32')]();};}function saveUpdates(_0x25b2b9,_0x52eb17){return function(_0x46c98e){if(_0x46c98e){return _0x46c98e['update'](_0x25b2b9)[_0x1b20('0x33')](function(_0x55bf8a){return _0x55bf8a;});}return null;};}function removeEntity(_0xd80c8,_0x1b1a9f){return function(_0x5cb267){if(_0x5cb267){return _0x5cb267['destroy']()[_0x1b20('0x33')](function(){_0xd80c8['status'](0xcc)[_0x1b20('0x29')]();});}};}function handleEntityNotFound(_0x37b4af,_0x46f258){return function(_0x2fe686){if(!_0x2fe686){_0x37b4af[_0x1b20('0x27')](0x194);}return _0x2fe686;};}function handleError(_0x4b54c7,_0x8a347c){_0x8a347c=_0x8a347c||0x1f4;return function(_0x1d175){logger['error'](_0x1d175[_0x1b20('0x34')]);if(_0x1d175[_0x1b20('0x35')]){delete _0x1d175[_0x1b20('0x35')];}_0x4b54c7['status'](_0x8a347c)['send'](_0x1d175);};}exports[_0x1b20('0x36')]=function(_0x6a7b6a,_0x448112){var _0x386f64={},_0x10c5d0={},_0x423df3={'count':0x0,'rows':[]};var _0x5755da=_[_0x1b20('0x37')](db['OpenchannelMessage'][_0x1b20('0x38')],function(_0x7be9b5){return{'name':_0x7be9b5['fieldName'],'type':_0x7be9b5[_0x1b20('0x39')][_0x1b20('0x3a')]};});_0x10c5d0[_0x1b20('0x3b')]=_[_0x1b20('0x37')](_0x5755da,'name');_0x10c5d0[_0x1b20('0x3c')]=_[_0x1b20('0x3d')](_0x6a7b6a[_0x1b20('0x3c')]);_0x10c5d0[_0x1b20('0x3e')]=_[_0x1b20('0x3f')](_0x10c5d0[_0x1b20('0x3b')],_0x10c5d0[_0x1b20('0x3c')]);_0x386f64['attributes']=_['intersection'](_0x10c5d0[_0x1b20('0x3b')],qs['fields'](_0x6a7b6a[_0x1b20('0x3c')][_0x1b20('0x40')]));_0x386f64['attributes']=_0x386f64[_0x1b20('0x41')]['length']?_0x386f64[_0x1b20('0x41')]:_0x10c5d0['model'];if(!_0x6a7b6a[_0x1b20('0x3c')][_0x1b20('0x42')](_0x1b20('0x43'))){_0x386f64['limit']=qs[_0x1b20('0x2c')](_0x6a7b6a['query'][_0x1b20('0x2c')]);_0x386f64[_0x1b20('0x2e')]=qs[_0x1b20('0x2e')](_0x6a7b6a[_0x1b20('0x3c')][_0x1b20('0x2e')]);}_0x386f64[_0x1b20('0x44')]=qs[_0x1b20('0x45')](_0x6a7b6a[_0x1b20('0x3c')][_0x1b20('0x45')]);_0x386f64[_0x1b20('0x46')]=qs['filters'](_[_0x1b20('0x47')](_0x6a7b6a[_0x1b20('0x3c')],_0x10c5d0[_0x1b20('0x3e')]),_0x5755da);if(_0x6a7b6a[_0x1b20('0x3c')][_0x1b20('0x48')]){_0x386f64[_0x1b20('0x46')]=_[_0x1b20('0x49')](_0x386f64['where'],{'$or':_[_0x1b20('0x37')](_0x5755da,function(_0x68966c){if(_0x68966c['type']!==_0x1b20('0x4a')){var _0x1fb5ed={};_0x1fb5ed[_0x68966c[_0x1b20('0x35')]]={'$like':'%'+_0x6a7b6a[_0x1b20('0x3c')][_0x1b20('0x48')]+'%'};return _0x1fb5ed;}})});}_0x386f64=_['merge']({},_0x386f64,_0x6a7b6a['options']);var _0x5b1d44={'where':_0x386f64['where']};return db[_0x1b20('0x4b')][_0x1b20('0x2d')](_0x5b1d44)['then'](function(_0x352793){_0x423df3[_0x1b20('0x2d')]=_0x352793;if(_0x6a7b6a[_0x1b20('0x3c')][_0x1b20('0x4c')]){_0x386f64[_0x1b20('0x4d')]=[{'all':!![]}];}return db[_0x1b20('0x4b')][_0x1b20('0x4e')](_0x386f64);})['then'](function(_0x2a36ac){_0x423df3[_0x1b20('0x4f')]=_0x2a36ac;return _0x423df3;})['then'](respondWithFilteredResult(_0x448112,_0x386f64))[_0x1b20('0x26')](handleError(_0x448112,null));};exports[_0x1b20('0x50')]=function(_0x416628,_0x882591){var _0x1ac4e9={'raw':!![],'where':{'id':_0x416628['params']['id']}},_0x2e7888={};_0x2e7888[_0x1b20('0x3b')]=_['keys'](db['OpenchannelMessage'][_0x1b20('0x38')]);_0x2e7888[_0x1b20('0x3c')]=_[_0x1b20('0x3d')](_0x416628[_0x1b20('0x3c')]);_0x2e7888[_0x1b20('0x3e')]=_[_0x1b20('0x3f')](_0x2e7888[_0x1b20('0x3b')],_0x2e7888['query']);_0x1ac4e9[_0x1b20('0x41')]=_[_0x1b20('0x3f')](_0x2e7888['model'],qs[_0x1b20('0x40')](_0x416628[_0x1b20('0x3c')][_0x1b20('0x40')]));_0x1ac4e9[_0x1b20('0x41')]=_0x1ac4e9[_0x1b20('0x41')][_0x1b20('0x51')]?_0x1ac4e9[_0x1b20('0x41')]:_0x2e7888['model'];if(_0x416628[_0x1b20('0x3c')]['includeAll']){_0x1ac4e9[_0x1b20('0x4d')]=[{'all':!![]}];}_0x1ac4e9=_[_0x1b20('0x49')]({},_0x1ac4e9,_0x416628[_0x1b20('0x52')]);return db[_0x1b20('0x4b')][_0x1b20('0x53')](_0x1ac4e9)['then'](handleEntityNotFound(_0x882591,null))['then'](respondWithResult(_0x882591,null))[_0x1b20('0x26')](handleError(_0x882591,null));};exports['create']=function(_0x6b45a0,_0x5af475){return db[_0x1b20('0x4b')][_0x1b20('0x54')](_0x6b45a0[_0x1b20('0x55')],{})[_0x1b20('0x33')](respondWithResult(_0x5af475,0xc9))[_0x1b20('0x26')](handleError(_0x5af475,null));};exports[_0x1b20('0x56')]=function(_0x231970,_0x36aece){if(_0x231970[_0x1b20('0x55')]['id']){delete _0x231970[_0x1b20('0x55')]['id'];}return db[_0x1b20('0x4b')]['find']({'where':{'id':_0x231970[_0x1b20('0x57')]['id']}})[_0x1b20('0x33')](handleEntityNotFound(_0x36aece,null))[_0x1b20('0x33')](saveUpdates(_0x231970[_0x1b20('0x55')],null))[_0x1b20('0x33')](respondWithResult(_0x36aece,null))[_0x1b20('0x26')](handleError(_0x36aece,null));};exports['destroy']=function(_0x5c66de,_0x18022f){return db[_0x1b20('0x4b')][_0x1b20('0x53')]({'where':{'id':_0x5c66de[_0x1b20('0x57')]['id']}})[_0x1b20('0x33')](handleEntityNotFound(_0x18022f,null))[_0x1b20('0x33')](removeEntity(_0x18022f,null))['catch'](handleError(_0x18022f,null));};exports[_0x1b20('0x58')]=function(_0x7e347a,_0x260df2){return db['OpenchannelMessage'][_0x1b20('0x58')]()['then'](respondWithResult(_0x260df2,null))[_0x1b20('0x26')](handleError(_0x260df2,null));};var interaction_log=require(_0x1b20('0x13'))(_0x1b20('0x59'));exports[_0x1b20('0x5a')]=function(_0x4251e6,_0x2bb594,_0x44f015){var _0x3df3bb={'agent':{},'channel':_0x1b20('0x5b')};if(_0x4251e6[_0x1b20('0x55')]['id']){delete _0x4251e6[_0x1b20('0x55')]['id'];}_0x4251e6['body'][_0x1b20('0x5c')]=!![];_0x4251e6['body'][_0x1b20('0x5d')]=moment()['format'](_0x1b20('0x5e'));_0x4251e6[_0x1b20('0x55')][_0x1b20('0x5f')]=_0x4251e6[_0x1b20('0x55')][_0x1b20('0x5f')]||_0x4251e6[_0x1b20('0x60')]['id'];_0x3df3bb['agent']['id']=_0x4251e6['body'][_0x1b20('0x5f')];return db['OpenchannelMessage']['find']({'where':{'id':_0x4251e6[_0x1b20('0x57')]['id'],'UserId':null}})[_0x1b20('0x33')](handleEntityNotFound(_0x2bb594,null))['then'](saveUpdates(_0x4251e6[_0x1b20('0x55')],null))[_0x1b20('0x33')](function(_0x40c732){if(_0x40c732){_0x3df3bb[_0x1b20('0x25')]=_0x40c732[_0x1b20('0x61')]({'plain':!![]});return db['OpenchannelInteraction'][_0x1b20('0x53')]({'where':{'id':_0x40c732[_0x1b20('0x62')]}});}return null;})[_0x1b20('0x33')](handleEntityNotFound(_0x2bb594,null))[_0x1b20('0x33')](function(_0x4d6729){if(_0x4d6729){return _0x4d6729[_0x1b20('0x56')]({'UserId':_0x4251e6[_0x1b20('0x55')]['UserId'],'read1stAt':_[_0x1b20('0x63')](_0x4d6729[_0x1b20('0x64')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x51b89b){if(_0x51b89b){_0x3df3bb['interaction']=_0x51b89b[_0x1b20('0x61')]({'plain':!![]});interaction_log[_0x1b20('0x1e')](_0x1b20('0x65'),_0x4251e6[_0x1b20('0x60')]['id'],_0x4251e6['user'][_0x1b20('0x35')],_0x4251e6[_0x1b20('0x60')][_0x1b20('0x66')],_0x3df3bb[_0x1b20('0x67')]['id'],_0x4251e6['body']?JSON[_0x1b20('0x68')](_0x4251e6['body']):_0x1b20('0x69'));return respondWithRpcPromise(_0x1b20('0x6a'),_0x1b20('0x6b'),_0x3df3bb);}return null;})[_0x1b20('0x33')](function(_0x2c6a5d){var _0x259a04=_0x1b20('0x6c')+_0x2c6a5d[_0x1b20('0x25')][_0x1b20('0x6d')];return db[_0x1b20('0x6e')][_0x1b20('0x3c')](_0x259a04,{'type':db[_0x1b20('0x6f')][_0x1b20('0x70')]['SELECT'],'raw':!![]})[_0x1b20('0x33')](function(_0x35300d){return _0x35300d;});})[_0x1b20('0x33')](function(_0x141119){if(_0x141119){_0x3df3bb[_0x1b20('0x25')]['contact']=_0x141119[0x0];if(!_0x4251e6[_0x1b20('0x55')][_0x1b20('0x5f')])return;return db[_0x1b20('0x71')][_0x1b20('0x53')]({'where':{'id':_0x4251e6[_0x1b20('0x55')][_0x1b20('0x5f')],'role':'agent'},'attributes':['id','name',_0x1b20('0x72'),'email',_0x1b20('0x73')],'raw':!![]});}return null;})[_0x1b20('0x33')](function(_0x4f8f59){if(!_0x4f8f59)return null;_0x3df3bb[_0x1b20('0x25')]['agent']=_0x4f8f59;return _0x3df3bb;})[_0x1b20('0x33')](function(_0x5b11f0){if(_0x5b11f0){if(_0x4251e6[_0x1b20('0x55')][_0x1b20('0x74')]){_0x3df3bb[_0x1b20('0x25')]['interface']=util[_0x1b20('0x75')](_0x1b20('0x76'),_0x4251e6[_0x1b20('0x60')]['name']);_0x3df3bb[_0x1b20('0x25')][_0x1b20('0x77')]=_0x3df3bb[_0x1b20('0x77')];_0x3df3bb[_0x1b20('0x25')][_0x1b20('0x78')]=_0x3df3bb['channel'];_0x3df3bb[_0x1b20('0x25')][_0x1b20('0x79')]='accept';return respondWithRpcPromise(_0x1b20('0x7a'),'EventManager',{'event':'acceptmessage','message':_0x3df3bb[_0x1b20('0x25')]},client9002)[_0x1b20('0x33')](function(){return _0x3df3bb;});}return _0x3df3bb;}return null;})[_0x1b20('0x33')](respondWithResult(_0x2bb594,null))[_0x1b20('0x26')](handleError(_0x2bb594,null));};var interaction_log=require(_0x1b20('0x13'))(_0x1b20('0x59'));exports[_0x1b20('0x31')]=function(_0x27b5ac,_0x282f68,_0x847f64){var _0x228d25={'agent':{},'channel':_0x1b20('0x5b')};if(_0x27b5ac[_0x1b20('0x55')]['id']){delete _0x27b5ac[_0x1b20('0x55')]['id'];}_0x27b5ac[_0x1b20('0x55')]['UserId']=_0x27b5ac[_0x1b20('0x55')][_0x1b20('0x5f')]||_0x27b5ac[_0x1b20('0x60')]['id'];_0x228d25[_0x1b20('0x7b')]['id']=_0x27b5ac[_0x1b20('0x55')][_0x1b20('0x5f')];return db[_0x1b20('0x4b')][_0x1b20('0x53')]({'where':{'id':_0x27b5ac['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x282f68,null))['then'](function(_0x3fc8d3){if(_0x3fc8d3){_0x228d25[_0x1b20('0x25')]=_0x3fc8d3['get']({'plain':!![]});return db[_0x1b20('0x7c')][_0x1b20('0x53')]({'where':{'id':_0x3fc8d3[_0x1b20('0x62')]}});}return null;})[_0x1b20('0x33')](handleEntityNotFound(_0x282f68,null))[_0x1b20('0x33')](function(_0x17a85c){if(_0x17a85c){_0x228d25[_0x1b20('0x67')]=_0x17a85c[_0x1b20('0x61')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x27b5ac[_0x1b20('0x60')]['id'],_0x27b5ac[_0x1b20('0x60')]['name'],_0x27b5ac['user'][_0x1b20('0x66')],_0x228d25[_0x1b20('0x67')]['id'],_0x27b5ac[_0x1b20('0x55')]?JSON[_0x1b20('0x68')](_0x27b5ac['body']):_0x1b20('0x69'));return respondWithRpcPromise(_0x1b20('0x7d'),_0x1b20('0x7e'),_0x228d25);}return null;})[_0x1b20('0x33')](function(_0x1167de){var _0x3646d0=_0x1b20('0x6c')+_0x1167de['message'][_0x1b20('0x6d')];return db[_0x1b20('0x6e')]['query'](_0x3646d0,{'type':db[_0x1b20('0x6f')][_0x1b20('0x70')]['SELECT'],'raw':!![]})[_0x1b20('0x33')](function(_0x4339f1){return _0x4339f1;});})[_0x1b20('0x33')](function(_0x5da8a7){if(_0x5da8a7){_0x228d25[_0x1b20('0x25')][_0x1b20('0x7f')]=_0x5da8a7[0x0];if(!_0x27b5ac[_0x1b20('0x55')][_0x1b20('0x5f')])return;return db[_0x1b20('0x71')]['find']({'where':{'id':_0x27b5ac['body']['UserId'],'role':_0x1b20('0x7b')},'attributes':['id',_0x1b20('0x35'),'fullname',_0x1b20('0x80'),_0x1b20('0x73')],'raw':!![]});}return null;})['then'](function(_0xab91d){if(!_0xab91d)return null;_0x228d25['message'][_0x1b20('0x7b')]=_0xab91d;return _0x228d25;})[_0x1b20('0x33')](function(_0x1b48e0){if(_0x1b48e0){_0x1b48e0['message'][_0x1b20('0x81')]=util[_0x1b20('0x75')](_0x1b20('0x76'),_0x27b5ac['user'][_0x1b20('0x35')]);_0x1b48e0[_0x1b20('0x25')]['channel']=_0x228d25[_0x1b20('0x77')];_0x1b48e0['message'][_0x1b20('0x78')]=_0x228d25[_0x1b20('0x77')];_0x1b48e0['message']['event']=_0x1b20('0x31');respondWithRpcPromise(_0x1b20('0x7a'),_0x1b20('0x7a'),{'event':_0x1b20('0x82'),'message':_0x1b48e0[_0x1b20('0x25')]},client9002);return _0x228d25;}return null;})[_0x1b20('0x33')](respondWithResult(_0x282f68,null))[_0x1b20('0x26')](handleError(_0x282f68,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 9f1e566..54a3319 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 _0xc665=['hook','exports','OpenchannelMessage','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xc665,0x16e));var _0x5c66=function(_0x1f6cbd,_0x1d755f){_0x1f6cbd=_0x1f6cbd-0x0;var _0x1c51f4=_0xc665[_0x1f6cbd];return _0x1c51f4;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db'][_0x5c66('0x0')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x5c66('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5c66('0x2'),'afterDestroy':'remove'};function emitEvent(_0x1e1009){return function(_0x182cd4,_0x473367,_0x370b98){OpenchannelMessageEvents[_0x5c66('0x3')](_0x1e1009+':'+_0x182cd4['id'],_0x182cd4);OpenchannelMessageEvents['emit'](_0x1e1009,_0x182cd4);_0x370b98(null);};}for(var e in events){if(events[_0x5c66('0x4')](e)){var event=events[e];OpenchannelMessage[_0x5c66('0x5')](e,emitEvent(event));}}module[_0x5c66('0x6')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x4265=['setMaxListeners','remove','emit','hasOwnProperty','hook','events','../../mysqldb','OpenchannelMessage'];(function(_0x45757e,_0x44b6d6){var _0x197e15=function(_0x30f624){while(--_0x30f624){_0x45757e['push'](_0x45757e['shift']());}};_0x197e15(++_0x44b6d6);}(_0x4265,0x16d));var _0x5426=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4265[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0x5426('0x0'));var OpenchannelMessage=require(_0x5426('0x1'))['db'][_0x5426('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x5426('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x5426('0x4')};function emitEvent(_0x1ce93d){return function(_0x2ca885,_0x27e571,_0x4697d5){OpenchannelMessageEvents[_0x5426('0x5')](_0x1ce93d+':'+_0x2ca885['id'],_0x2ca885);OpenchannelMessageEvents[_0x5426('0x5')](_0x1ce93d,_0x2ca885);_0x4697d5(null);};}for(var e in events){if(events[_0x5426('0x6')](e)){var event=events[e];OpenchannelMessage[_0x5426('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 08e23b8..aba57ee 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 _0x6fb7=['length','Interaction','Contact','POST','method','GET','body','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','catch','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./openchannelMessage.attributes','exports','define','openchannel_messages','fti_openchannel_messages','FULLTEXT','models','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','then','update','error','secret','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','keys','get','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format'];(function(_0x32fe02,_0x5ceb6c){var _0x593db1=function(_0x4ef7f9){while(--_0x4ef7f9){_0x32fe02['push'](_0x32fe02['shift']());}};_0x593db1(++_0x5ceb6c);}(_0x6fb7,0x182));var _0x76fb=function(_0x14be47,_0x1cf244){_0x14be47=_0x14be47-0x0;var _0x519221=_0x6fb7[_0x14be47];return _0x519221;};'use strict';var _=require(_0x76fb('0x0'));var util=require(_0x76fb('0x1'));var logger=require('../../config/logger')(_0x76fb('0x2'));var moment=require(_0x76fb('0x3'));var BPromise=require(_0x76fb('0x4'));var rp=require(_0x76fb('0x5'));var fs=require('fs');var path=require(_0x76fb('0x6'));var rimraf=require(_0x76fb('0x7'));var config=require('../../config/environment');var attributes=require(_0x76fb('0x8'));module[_0x76fb('0x9')]=function(_0x2b893b,_0xcdaa21){return _0x2b893b[_0x76fb('0xa')]('OpenchannelMessage',attributes,{'tableName':_0x76fb('0xb'),'paranoid':![],'indexes':[{'name':_0x76fb('0xc'),'fields':['body'],'type':_0x76fb('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x13639b,_0x55c69d,_0x32eecd){var _0x3549b4=_0x2b893b[_0x76fb('0xe')];var _0x3f487a=_0x13639b['get']({'plain':!![]});if(_0x3f487a[_0x76fb('0xf')][_0x76fb('0x10')]()==='in'||_0x3f487a[_0x76fb('0xf')]['toLowerCase']()===_0x76fb('0x11')&&!_0x3f487a['secret']&&!_[_0x76fb('0x12')](_0x3f487a[_0x76fb('0x13')])){_0x3549b4[_0x76fb('0x14')]['findOne']({'where':{'id':_0x3f487a['OpenchannelInteractionId']}})[_0x76fb('0x15')](function(_0x2c0ec6){if(_0x2c0ec6){_0x2c0ec6[_0x76fb('0x16')]({'lastMsgAt':_0x3f487a['createdAt'],'lastMsgDirection':_0x3f487a[_0x76fb('0xf')]['toLowerCase']()});}})['catch'](function(_0x2713e9){console[_0x76fb('0x17')](_0x2713e9);});}if(_0x3f487a[_0x76fb('0xf')]===_0x76fb('0x11')&&!_0x3f487a[_0x76fb('0x18')]){var _0x3e0332;_0x3549b4[_0x76fb('0x19')][_0x76fb('0x1a')]()[_0x76fb('0x15')](function(_0x363f3c){return _0x3549b4[_0x76fb('0x1b')][_0x76fb('0x1c')]({'where':{'id':_0x3f487a[_0x76fb('0x1d')]},'include':[{'model':_0x3549b4[_0x76fb('0x14')],'as':_0x76fb('0x1e'),'where':{'id':_0x3f487a[_0x76fb('0x1f')]},'limit':0x1,'include':[{'model':_0x3549b4[_0x76fb('0x19')],'as':'Contact','attributes':_[_0x76fb('0x20')](_0x363f3c)}]}]});})[_0x76fb('0x15')](function(_0x22558c){_0x3e0332=_0x22558c[_0x76fb('0x21')]({'plain':!![]});if(_0x3e0332&&_0x3e0332[_0x76fb('0x22')]){logger['info'](_0x76fb('0x23'),_0x76fb('0x24'),util[_0x76fb('0x25')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x3f487a['id'],_0x3e0332[_0x76fb('0x22')]));if(_0x3e0332[_0x76fb('0x1e')]&&_0x3e0332['Interactions'][_0x76fb('0x26')]){_0x3f487a[_0x76fb('0x27')]=_['omit'](_0x3e0332['Interactions'][0x0],_0x76fb('0x28'));_0x3f487a[_0x76fb('0x28')]=_0x3e0332[_0x76fb('0x1e')][0x0][_0x76fb('0x28')];}var _0x55c69d={'method':_0x76fb('0x29'),'uri':encodeURI(_0x3e0332[_0x76fb('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x55c69d[_0x76fb('0x2a')]){case _0x76fb('0x2b'):_0x55c69d['qs']=_0x3f487a;break;case _0x76fb('0x29'):_0x55c69d[_0x76fb('0x2c')]=_0x3f487a;break;}return rp(_0x55c69d)[_0x76fb('0x15')](function(_0x402acc){logger[_0x76fb('0x2d')](_0x76fb('0x23'),_0x76fb('0x24'),util[_0x76fb('0x25')](_0x76fb('0x2e'),_0x3f487a['id'],_0x3e0332['replyUri']));if(_0x402acc['body'][_0x76fb('0x2f')]&&_0x402acc['body'][_0x76fb('0x2f')]!=_0x3f487a[_0x76fb('0x27')][_0x76fb('0x2f')]){return _0x3549b4[_0x76fb('0x14')][_0x76fb('0x16')]({'threadId':_0x402acc[_0x76fb('0x2c')][_0x76fb('0x2f')]},{'where':{'id':_0x3f487a[_0x76fb('0x27')]['id']}});}else{return;}})[_0x76fb('0x15')](function(){return _0x13639b['update']({'read':!![]});})[_0x76fb('0x30')](function(_0x426868){logger[_0x76fb('0x17')](_0x76fb('0x23'),_0x76fb('0x24'),util[_0x76fb('0x31')](_0x426868,{'showHidden':![],'depth':null}));_0x32eecd();});}else{_0x32eecd();}})[_0x76fb('0x32')](function(){_0x32eecd();});}else{_0x32eecd();}}},'charset':_0x76fb('0x33'),'collate':_0x76fb('0x34')});}; \ No newline at end of file +var _0x46dc=['FULLTEXT','get','direction','toLowerCase','secret','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','update','createdAt','error','out','CmContact','find','OpenchannelAccountId','keys','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','Interactions','length','Interaction','omit','Contact','POST','Message\x20%d\x20forwarded\x20to\x20%s','threadId','catch','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelMessage.attributes','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body'];(function(_0x112c72,_0x5e32f1){var _0x1ef993=function(_0x295786){while(--_0x295786){_0x112c72['push'](_0x112c72['shift']());}};_0x1ef993(++_0x5e32f1);}(_0x46dc,0x18a));var _0xc46d=function(_0x1568ad,_0x5a041b){_0x1568ad=_0x1568ad-0x0;var _0x1cd0b6=_0x46dc[_0x1568ad];return _0x1cd0b6;};'use strict';var _=require(_0xc46d('0x0'));var util=require('util');var logger=require(_0xc46d('0x1'))(_0xc46d('0x2'));var moment=require(_0xc46d('0x3'));var BPromise=require(_0xc46d('0x4'));var rp=require(_0xc46d('0x5'));var fs=require('fs');var path=require(_0xc46d('0x6'));var rimraf=require(_0xc46d('0x7'));var config=require('../../config/environment');var attributes=require(_0xc46d('0x8'));module['exports']=function(_0x358a7a,_0x44c6ca){return _0x358a7a[_0xc46d('0x9')](_0xc46d('0xa'),attributes,{'tableName':_0xc46d('0xb'),'paranoid':![],'indexes':[{'name':_0xc46d('0xc'),'fields':[_0xc46d('0xd')],'type':_0xc46d('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x225f52,_0x4ba462,_0x3c969f){var _0x137918=_0x358a7a['models'];var _0x585a3a=_0x225f52[_0xc46d('0xf')]({'plain':!![]});if(_0x585a3a[_0xc46d('0x10')]['toLowerCase']()==='in'||_0x585a3a[_0xc46d('0x10')][_0xc46d('0x11')]()==='out'&&!_0x585a3a[_0xc46d('0x12')]&&!_[_0xc46d('0x13')](_0x585a3a[_0xc46d('0x14')])){_0x137918[_0xc46d('0x15')]['findOne']({'where':{'id':_0x585a3a[_0xc46d('0x16')]}})[_0xc46d('0x17')](function(_0x3b2256){if(_0x3b2256){_0x3b2256[_0xc46d('0x18')]({'lastMsgAt':_0x585a3a[_0xc46d('0x19')],'lastMsgDirection':_0x585a3a[_0xc46d('0x10')][_0xc46d('0x11')]()});}})['catch'](function(_0x66b948){console[_0xc46d('0x1a')](_0x66b948);});}if(_0x585a3a['direction']===_0xc46d('0x1b')&&!_0x585a3a[_0xc46d('0x12')]){var _0x55b721;_0x137918[_0xc46d('0x1c')]['describe']()[_0xc46d('0x17')](function(_0x5da4f0){return _0x137918['OpenchannelAccount'][_0xc46d('0x1d')]({'where':{'id':_0x585a3a[_0xc46d('0x1e')]},'include':[{'model':_0x137918[_0xc46d('0x15')],'as':'Interactions','where':{'id':_0x585a3a['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x137918[_0xc46d('0x1c')],'as':'Contact','attributes':_[_0xc46d('0x1f')](_0x5da4f0)}]}]});})['then'](function(_0x309e9d){_0x55b721=_0x309e9d['get']({'plain':!![]});if(_0x55b721&&_0x55b721['replyUri']){logger[_0xc46d('0x20')](_0xc46d('0x21'),_0xc46d('0x22'),util[_0xc46d('0x23')](_0xc46d('0x24'),_0x585a3a['id'],_0x55b721[_0xc46d('0x25')]));if(_0x55b721['Interactions']&&_0x55b721[_0xc46d('0x26')][_0xc46d('0x27')]){_0x585a3a[_0xc46d('0x28')]=_[_0xc46d('0x29')](_0x55b721[_0xc46d('0x26')][0x0],_0xc46d('0x2a'));_0x585a3a['Contact']=_0x55b721[_0xc46d('0x26')][0x0][_0xc46d('0x2a')];}var _0x4ba462={'method':_0xc46d('0x2b'),'uri':encodeURI(_0x55b721['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4ba462['method']){case'GET':_0x4ba462['qs']=_0x585a3a;break;case _0xc46d('0x2b'):_0x4ba462[_0xc46d('0xd')]=_0x585a3a;break;}return rp(_0x4ba462)[_0xc46d('0x17')](function(_0xceb822){logger[_0xc46d('0x20')](_0xc46d('0x21'),_0xc46d('0x22'),util['format'](_0xc46d('0x2c'),_0x585a3a['id'],_0x55b721['replyUri']));if(_0xceb822[_0xc46d('0xd')]['threadId']&&_0xceb822[_0xc46d('0xd')]['threadId']!=_0x585a3a['Interaction'][_0xc46d('0x2d')]){return _0x137918[_0xc46d('0x15')][_0xc46d('0x18')]({'threadId':_0xceb822['body'][_0xc46d('0x2d')]},{'where':{'id':_0x585a3a['Interaction']['id']}});}else{return;}})['then'](function(){return _0x225f52[_0xc46d('0x18')]({'read':!![]});})[_0xc46d('0x2e')](function(_0x36e260){logger[_0xc46d('0x1a')](_0xc46d('0x21'),_0xc46d('0x22'),util[_0xc46d('0x2f')](_0x36e260,{'showHidden':![],'depth':null}));_0x3c969f();});}else{_0x3c969f();}})[_0xc46d('0x30')](function(){_0x3c969f();});}else{_0x3c969f();}}},'charset':_0xc46d('0x31'),'collate':_0xc46d('0x32')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index ab92382..164b233 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(_0x884f98,_0x1cc641){var _0x29cc37=function(_0x54f4c9){while(--_0x54f4c9){_0x884f98['push'](_0x884f98['shift']());}};_0x29cc37(++_0x1cc641);}(_0x1261,0x144));var _0x1126=function(_0x10f6e8,_0x351db6){_0x10f6e8=_0x10f6e8-0x0;var _0x35bb3c=_0x1261[_0x10f6e8];return _0x35bb3c;};'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 _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x27e9dc,_0x4c0f8f){var _0x24d46a=function(_0x49f3a6){while(--_0x49f3a6){_0x27e9dc['push'](_0x27e9dc['shift']());}};_0x24d46a(++_0x4c0f8f);}(_0xadb5,0xad));var _0x5adb=function(_0x14cb35,_0x44d795){_0x14cb35=_0x14cb35-0x0;var _0x2e943e=_0xadb5[_0x14cb35];return _0x2e943e;};'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});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 03d3bfd..48f5f18 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 _0x9167=['register','length','openchannelMessage:','./openchannelMessage.events','save','update','emit','removeListener'];(function(_0x1b2422,_0x1e98d4){var _0x376573=function(_0x5db41b){while(--_0x5db41b){_0x1b2422['push'](_0x1b2422['shift']());}};_0x376573(++_0x1e98d4);}(_0x9167,0x16b));var _0x7916=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9167[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelMessageEvents=require(_0x7916('0x0'));var events=[_0x7916('0x1'),'remove',_0x7916('0x2')];function createListener(_0x122f25,_0x152271){return function(_0x3f1d25){_0x152271[_0x7916('0x3')](_0x122f25,_0x3f1d25);};}function removeListener(_0x17f3d4,_0x42c08f){return function(){OpenchannelMessageEvents[_0x7916('0x4')](_0x17f3d4,_0x42c08f);};}exports[_0x7916('0x5')]=function(_0x53c355){for(var _0x39421a=0x0,_0x409998=events[_0x7916('0x6')];_0x39421a<_0x409998;_0x39421a++){var _0x4fe65e=events[_0x39421a];var _0x11a5f7=createListener(_0x7916('0x7')+_0x4fe65e,_0x53c355);OpenchannelMessageEvents['on'](_0x4fe65e,_0x11a5f7);}}; \ No newline at end of file +var _0xa759=['length','./openchannelMessage.events','save','remove','update','register'];(function(_0x43f92e,_0x26229c){var _0x329ded=function(_0x52dd7a){while(--_0x52dd7a){_0x43f92e['push'](_0x43f92e['shift']());}};_0x329ded(++_0x26229c);}(_0xa759,0xb5));var _0x9a75=function(_0x2467b8,_0x584199){_0x2467b8=_0x2467b8-0x0;var _0x5d3095=_0xa759[_0x2467b8];return _0x5d3095;};'use strict';var OpenchannelMessageEvents=require(_0x9a75('0x0'));var events=[_0x9a75('0x1'),_0x9a75('0x2'),_0x9a75('0x3')];function createListener(_0x37802b,_0x5d7842){return function(_0x5de754){_0x5d7842['emit'](_0x37802b,_0x5de754);};}function removeListener(_0x4d92f7,_0x3424ad){return function(){OpenchannelMessageEvents['removeListener'](_0x4d92f7,_0x3424ad);};}exports[_0x9a75('0x4')]=function(_0x4a549b){for(var _0x112c02=0x0,_0x506377=events[_0x9a75('0x5')];_0x112c02<_0x506377;_0x112c02++){var _0x37c300=events[_0x112c02];var _0x40f003=createListener('openchannelMessage:'+_0x37c300,_0x4a549b);OpenchannelMessageEvents['on'](_0x37c300,_0x40f003);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index e4fa5b8..11aa3a7 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 _0x1cd4=['path','express','fs-extra','../../components/auth/service','./openchannelQueue.controller','index','get','isAuthenticated','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x1cd4,0x95));var _0x41cd=function(_0x115c14,_0x4be5a2){_0x115c14=_0x115c14-0x0;var _0x49be3a=_0x1cd4[_0x115c14];return _0x49be3a;};'use strict';var multer=require(_0x41cd('0x0'));var util=require('util');var path=require(_0x41cd('0x1'));var timeout=require('connect-timeout');var express=require(_0x41cd('0x2'));var router=express['Router']();var fs_extra=require(_0x41cd('0x3'));var auth=require(_0x41cd('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x41cd('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x41cd('0x6')]);router[_0x41cd('0x7')]('/describe',auth[_0x41cd('0x8')](),controller['describe']);router[_0x41cd('0x7')](_0x41cd('0x9'),auth[_0x41cd('0x8')](),controller[_0x41cd('0xa')]);router['get'](_0x41cd('0xb'),auth['isAuthenticated'](),controller['getMembers']);router['get'](_0x41cd('0xc'),auth[_0x41cd('0x8')](),controller[_0x41cd('0xd')]);router[_0x41cd('0x7')](_0x41cd('0xe'),auth[_0x41cd('0x8')](),controller['getAgents']);router[_0x41cd('0xf')]('/',auth[_0x41cd('0x8')](),controller[_0x41cd('0x10')]);router[_0x41cd('0xf')](_0x41cd('0xc'),auth[_0x41cd('0x8')](),controller[_0x41cd('0x11')]);router['post'](_0x41cd('0xe'),auth[_0x41cd('0x8')](),controller[_0x41cd('0x12')]);router['put']('/:id',auth[_0x41cd('0x8')](),controller[_0x41cd('0x13')]);router[_0x41cd('0x14')](_0x41cd('0x9'),auth[_0x41cd('0x8')](),controller[_0x41cd('0x15')]);router[_0x41cd('0x14')](_0x41cd('0xc'),auth['isAuthenticated'](),controller[_0x41cd('0x16')]);router[_0x41cd('0x14')]('/:id/users',auth[_0x41cd('0x8')](),controller[_0x41cd('0x17')]);module[_0x41cd('0x18')]=router; \ No newline at end of file +var _0x3dc1=['removeTeams','removeAgents','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','destroy'];(function(_0x45cda1,_0x539de5){var _0x9ad750=function(_0xad0fdb){while(--_0xad0fdb){_0x45cda1['push'](_0x45cda1['shift']());}};_0x9ad750(++_0x539de5);}(_0x3dc1,0x137));var _0x13dc=function(_0x25c247,_0x4984be){_0x25c247=_0x25c247-0x0;var _0x37b223=_0x3dc1[_0x25c247];return _0x37b223;};'use strict';var multer=require('multer');var util=require(_0x13dc('0x0'));var path=require(_0x13dc('0x1'));var timeout=require(_0x13dc('0x2'));var express=require('express');var router=express[_0x13dc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x13dc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x13dc('0x5'));var controller=require(_0x13dc('0x6'));router[_0x13dc('0x7')]('/',auth[_0x13dc('0x8')](),controller[_0x13dc('0x9')]);router[_0x13dc('0x7')](_0x13dc('0xa'),auth[_0x13dc('0x8')](),controller['describe']);router[_0x13dc('0x7')](_0x13dc('0xb'),auth['isAuthenticated'](),controller[_0x13dc('0xc')]);router['get'](_0x13dc('0xd'),auth[_0x13dc('0x8')](),controller[_0x13dc('0xe')]);router[_0x13dc('0x7')](_0x13dc('0xf'),auth[_0x13dc('0x8')](),controller[_0x13dc('0x10')]);router[_0x13dc('0x7')]('/:id/users',auth[_0x13dc('0x8')](),controller[_0x13dc('0x11')]);router[_0x13dc('0x12')]('/',auth['isAuthenticated'](),controller[_0x13dc('0x13')]);router[_0x13dc('0x12')](_0x13dc('0xf'),auth[_0x13dc('0x8')](),controller[_0x13dc('0x14')]);router[_0x13dc('0x12')](_0x13dc('0x15'),auth[_0x13dc('0x8')](),controller[_0x13dc('0x16')]);router[_0x13dc('0x17')](_0x13dc('0xb'),auth[_0x13dc('0x8')](),controller['update']);router['delete']('/:id',auth[_0x13dc('0x8')](),controller[_0x13dc('0x18')]);router['delete'](_0x13dc('0xf'),auth[_0x13dc('0x8')](),controller[_0x13dc('0x19')]);router['delete'](_0x13dc('0x15'),auth[_0x13dc('0x8')](),controller[_0x13dc('0x1a')]);module[_0x13dc('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 8c48d22..4e4044d 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 _0x27cb=['INTEGER','ENUM','rrmemory','beepall','roundrobin','exports','STRING','name'];(function(_0x160b9e,_0x4a0e7d){var _0xb43d33=function(_0xba89f5){while(--_0xba89f5){_0x160b9e['push'](_0x160b9e['shift']());}};_0xb43d33(++_0x4a0e7d);}(_0x27cb,0x175));var _0xb27c=function(_0x37d801,_0x4cd4a0){_0x37d801=_0x37d801-0x0;var _0x36396c=_0x27cb[_0x37d801];return _0x36396c;};'use strict';var Sequelize=require('sequelize');module[_0xb27c('0x0')]={'name':{'type':Sequelize[_0xb27c('0x1')],'unique':_0xb27c('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb27c('0x1')]},'timeout':{'type':Sequelize[_0xb27c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb27c('0x4')](_0xb27c('0x5'),_0xb27c('0x6'),_0xb27c('0x7'))}}; \ No newline at end of file +var _0xc751=['INTEGER','ENUM','roundrobin'];(function(_0x16a9e2,_0x4ddcb3){var _0x2e4d0b=function(_0x8cd253){while(--_0x8cd253){_0x16a9e2['push'](_0x16a9e2['shift']());}};_0x2e4d0b(++_0x4ddcb3);}(_0xc751,0x1a7));var _0x1c75=function(_0x1faf34,_0x5a96e7){_0x1faf34=_0x1faf34-0x0;var _0x294624=_0xc751[_0x1faf34];return _0x294624;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1c75('0x0')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1c75('0x1')]('rrmemory','beepall',_0x1c75('0x2'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 2cf16d5..0ec77d9 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 _0xb10f=['merge','where','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','hasOwnProperty','order','OpenchannelQueueId','UserOpenchannelQueue','findAndCountAll','UserId','agent','createdAt','updatedAt','getTeams','Team','pick','ids','User','Agents','online','voicePause','flatMap','addTeams','each','forEach','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','sequelize','toString','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','emit','addAgents','omit','spread','isArray','userOpenchannelQueue:remove','getAgents','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','OpenchannelQueues','UserProfileResource','error','stack','name','map','OpenchannelQueue','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','filter'];(function(_0x5c1617,_0x4e948b){var _0x2dd270=function(_0x540ab2){while(--_0x540ab2){_0x5c1617['push'](_0x5c1617['shift']());}};_0x2dd270(++_0x4e948b);}(_0xb10f,0x1da));var _0xfb10=function(_0x2bdcf9,_0x396fa9){_0x2bdcf9=_0x2bdcf9-0x0;var _0x1cd79a=_0xb10f[_0x2bdcf9];return _0x1cd79a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfb10('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfb10('0x1'));var moment=require(_0xfb10('0x2'));var BPromise=require(_0xfb10('0x3'));var Mustache=require(_0xfb10('0x4'));var util=require(_0xfb10('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xfb10('0x6'));var ejs=require(_0xfb10('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfb10('0x8'));var squel=require(_0xfb10('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfb10('0xa'));var toCsv=require(_0xfb10('0x6'));var querystring=require(_0xfb10('0xb'));var Papa=require(_0xfb10('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfb10('0xd'));var as=require(_0xfb10('0xe'));var hardwareService=require(_0xfb10('0xf'));var logger=require(_0xfb10('0x10'))(_0xfb10('0x11'));var utils=require('../../config/utils');var config=require(_0xfb10('0x12'));var licenseUtil=require(_0xfb10('0x13'));var db=require(_0xfb10('0x14'))['db'];config[_0xfb10('0x15')]=_[_0xfb10('0x16')](config[_0xfb10('0x15')],{'host':_0xfb10('0x17'),'port':0x18eb});var socket=require(_0xfb10('0x18'))(new Redis(config[_0xfb10('0x15')]));require(_0xfb10('0x19'))[_0xfb10('0x1a')](socket);function respondWithStatusCode(_0x2c6661,_0x2a90a6){_0x2a90a6=_0x2a90a6||0xcc;return function(_0x32b453){if(_0x32b453){return _0x2c6661[_0xfb10('0x1b')](_0x2a90a6);}return _0x2c6661[_0xfb10('0x1c')](_0x2a90a6)[_0xfb10('0x1d')]();};}function respondWithResult(_0x258fae,_0x3b2289){_0x3b2289=_0x3b2289||0xc8;return function(_0xec0857){if(_0xec0857){return _0x258fae[_0xfb10('0x1c')](_0x3b2289)[_0xfb10('0x1e')](_0xec0857);}};}function respondWithFilteredResult(_0x394df0,_0x5e48dd){return function(_0x2f41d2){if(_0x2f41d2){var _0x8612f5=typeof _0x5e48dd[_0xfb10('0x1f')]===_0xfb10('0x20')&&typeof _0x5e48dd[_0xfb10('0x21')]===_0xfb10('0x20');var _0x17651a=_0x2f41d2[_0xfb10('0x22')];var _0x2d1372=_0x8612f5?0x0:_0x5e48dd[_0xfb10('0x1f')];var _0x41ebe6=_0x8612f5?_0x2f41d2[_0xfb10('0x22')]:_0x5e48dd[_0xfb10('0x1f')]+_0x5e48dd['limit'];var _0x2bc984;if(_0x41ebe6>=_0x17651a){_0x41ebe6=_0x17651a;_0x2bc984=0xc8;}else{_0x2bc984=0xce;}_0x394df0[_0xfb10('0x1c')](_0x2bc984);return _0x394df0[_0xfb10('0x23')](_0xfb10('0x24'),_0x2d1372+'-'+_0x41ebe6+'/'+_0x17651a)['json'](_0x2f41d2);}return null;};}function patchUpdates(_0x40e59d){return function(_0x105ebe){try{jsonpatch['apply'](_0x105ebe,_0x40e59d,!![]);}catch(_0x4334a8){return BPromise[_0xfb10('0x25')](_0x4334a8);}return _0x105ebe[_0xfb10('0x26')]();};}function saveUpdates(_0x12ea6e,_0x1901bd){return function(_0x5f2ba4){if(_0x5f2ba4){return _0x5f2ba4[_0xfb10('0x27')](_0x12ea6e)[_0xfb10('0x28')](function(_0x4e0760){return _0x4e0760;});}return null;};}function removeEntity(_0x4aafa4,_0x4dad67){return function(_0x280783){if(_0x280783){return _0x280783[_0xfb10('0x29')]()[_0xfb10('0x28')](function(){var _0x5ed874=_0x280783['get']({'plain':!![]});var _0x1a0a92=_0xfb10('0x2a');return db[_0xfb10('0x2b')]['destroy']({'where':{'type':_0x1a0a92,'resourceId':_0x5ed874['id']}})[_0xfb10('0x28')](function(){return _0x280783;});})[_0xfb10('0x28')](function(){_0x4aafa4[_0xfb10('0x1c')](0xcc)[_0xfb10('0x1d')]();});}};}function handleEntityNotFound(_0x5ddcf6,_0x478812){return function(_0x47309c){if(!_0x47309c){_0x5ddcf6[_0xfb10('0x1b')](0x194);}return _0x47309c;};}function handleError(_0x5e5eae,_0x46bbc5){_0x46bbc5=_0x46bbc5||0x1f4;return function(_0x3e0ede){logger[_0xfb10('0x2c')](_0x3e0ede[_0xfb10('0x2d')]);if(_0x3e0ede[_0xfb10('0x2e')]){delete _0x3e0ede[_0xfb10('0x2e')];}_0x5e5eae[_0xfb10('0x1c')](_0x46bbc5)['send'](_0x3e0ede);};}exports['index']=function(_0x30c94f,_0x3bc257){var _0x2f7d09={},_0x3cbb8d={},_0x1bec42={'count':0x0,'rows':[]};var _0x414290=_[_0xfb10('0x2f')](db[_0xfb10('0x30')][_0xfb10('0x31')],function(_0x15f01a){return{'name':_0x15f01a['fieldName'],'type':_0x15f01a[_0xfb10('0x32')]['key']};});_0x3cbb8d[_0xfb10('0x33')]=_[_0xfb10('0x2f')](_0x414290,_0xfb10('0x2e'));_0x3cbb8d[_0xfb10('0x34')]=_[_0xfb10('0x35')](_0x30c94f[_0xfb10('0x34')]);_0x3cbb8d[_0xfb10('0x36')]=_[_0xfb10('0x37')](_0x3cbb8d[_0xfb10('0x33')],_0x3cbb8d[_0xfb10('0x34')]);_0x2f7d09[_0xfb10('0x38')]=_[_0xfb10('0x37')](_0x3cbb8d[_0xfb10('0x33')],qs[_0xfb10('0x39')](_0x30c94f[_0xfb10('0x34')][_0xfb10('0x39')]));_0x2f7d09[_0xfb10('0x38')]=_0x2f7d09[_0xfb10('0x38')][_0xfb10('0x3a')]?_0x2f7d09[_0xfb10('0x38')]:_0x3cbb8d[_0xfb10('0x33')];if(!_0x30c94f[_0xfb10('0x34')]['hasOwnProperty'](_0xfb10('0x3b'))){_0x2f7d09['limit']=qs['limit'](_0x30c94f[_0xfb10('0x34')][_0xfb10('0x21')]);_0x2f7d09[_0xfb10('0x1f')]=qs[_0xfb10('0x1f')](_0x30c94f[_0xfb10('0x34')][_0xfb10('0x1f')]);}_0x2f7d09['order']=qs[_0xfb10('0x3c')](_0x30c94f[_0xfb10('0x34')][_0xfb10('0x3c')]);_0x2f7d09['where']=qs['filters'](_['pick'](_0x30c94f[_0xfb10('0x34')],_0x3cbb8d[_0xfb10('0x36')]),_0x414290);if(_0x30c94f['query'][_0xfb10('0x3d')]){_0x2f7d09['where']=_[_0xfb10('0x3e')](_0x2f7d09[_0xfb10('0x3f')],{'$or':_[_0xfb10('0x2f')](_0x414290,function(_0x2ced25){if(_0x2ced25[_0xfb10('0x32')]!=='VIRTUAL'){var _0x2c2b9e={};_0x2c2b9e[_0x2ced25[_0xfb10('0x2e')]]={'$like':'%'+_0x30c94f[_0xfb10('0x34')]['filter']+'%'};return _0x2c2b9e;}})});}_0x2f7d09=_[_0xfb10('0x3e')]({},_0x2f7d09,_0x30c94f[_0xfb10('0x40')]);var _0x19106f={'where':_0x2f7d09[_0xfb10('0x3f')]};return db['OpenchannelQueue'][_0xfb10('0x22')](_0x19106f)['then'](function(_0x245f00){_0x1bec42[_0xfb10('0x22')]=_0x245f00;if(_0x30c94f[_0xfb10('0x34')][_0xfb10('0x41')]){_0x2f7d09[_0xfb10('0x42')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0xfb10('0x43')](_0x2f7d09);})[_0xfb10('0x28')](function(_0x400b7f){_0x1bec42[_0xfb10('0x44')]=_0x400b7f;return _0x1bec42;})[_0xfb10('0x28')](respondWithFilteredResult(_0x3bc257,_0x2f7d09))[_0xfb10('0x45')](handleError(_0x3bc257,null));};exports[_0xfb10('0x46')]=function(_0x33f839,_0x3d86a4){var _0x5cd654={'raw':!![],'where':{'id':_0x33f839[_0xfb10('0x47')]['id']}},_0x1f374a={};_0x1f374a['model']=_[_0xfb10('0x35')](db['OpenchannelQueue']['rawAttributes']);_0x1f374a[_0xfb10('0x34')]=_[_0xfb10('0x35')](_0x33f839[_0xfb10('0x34')]);_0x1f374a[_0xfb10('0x36')]=_['intersection'](_0x1f374a['model'],_0x1f374a['query']);_0x5cd654[_0xfb10('0x38')]=_['intersection'](_0x1f374a[_0xfb10('0x33')],qs[_0xfb10('0x39')](_0x33f839['query'][_0xfb10('0x39')]));_0x5cd654[_0xfb10('0x38')]=_0x5cd654[_0xfb10('0x38')][_0xfb10('0x3a')]?_0x5cd654[_0xfb10('0x38')]:_0x1f374a[_0xfb10('0x33')];if(_0x33f839[_0xfb10('0x34')][_0xfb10('0x41')]){_0x5cd654[_0xfb10('0x42')]=[{'all':!![]}];}_0x5cd654=_[_0xfb10('0x3e')]({},_0x5cd654,_0x33f839[_0xfb10('0x40')]);return db['OpenchannelQueue'][_0xfb10('0x48')](_0x5cd654)[_0xfb10('0x28')](handleEntityNotFound(_0x3d86a4,null))[_0xfb10('0x28')](respondWithResult(_0x3d86a4,null))[_0xfb10('0x45')](handleError(_0x3d86a4,null));};exports[_0xfb10('0x49')]=function(_0x26b3f0,_0x5cc1c2){return db['OpenchannelQueue'][_0xfb10('0x49')](_0x26b3f0[_0xfb10('0x4a')],{})[_0xfb10('0x28')](function(_0x8cf8fb){var _0x51df53=_0x26b3f0['user']['get']({'plain':!![]});if(!_0x51df53)throw new Error(_0xfb10('0x4b'));if(_0x51df53[_0xfb10('0x4c')]===_0xfb10('0x4d')){var _0x2bf84a=_0x8cf8fb[_0xfb10('0x4e')]({'plain':!![]});var _0x261ef2='OpenchannelQueues';return db[_0xfb10('0x4f')]['find']({'where':{'name':_0x261ef2,'userProfileId':_0x51df53['userProfileId']},'raw':!![]})[_0xfb10('0x28')](function(_0x50ee66){if(_0x50ee66&&_0x50ee66['autoAssociation']===0x0){return db[_0xfb10('0x2b')][_0xfb10('0x49')]({'name':_0x2bf84a[_0xfb10('0x2e')],'resourceId':_0x2bf84a['id'],'type':_0x50ee66[_0xfb10('0x2e')],'sectionId':_0x50ee66['id']},{})[_0xfb10('0x28')](function(){return _0x8cf8fb;});}else{return _0x8cf8fb;}})[_0xfb10('0x45')](function(_0x28ce1f){logger['error'](_0xfb10('0x50'),_0x28ce1f);throw _0x28ce1f;});}return _0x8cf8fb;})['then'](respondWithResult(_0x5cc1c2,0xc9))[_0xfb10('0x45')](handleError(_0x5cc1c2,null));};exports[_0xfb10('0x27')]=function(_0x19bf3b,_0x319794){if(_0x19bf3b['body']['id']){delete _0x19bf3b[_0xfb10('0x4a')]['id'];}return db['OpenchannelQueue'][_0xfb10('0x48')]({'where':{'id':_0x19bf3b[_0xfb10('0x47')]['id']}})[_0xfb10('0x28')](handleEntityNotFound(_0x319794,null))[_0xfb10('0x28')](saveUpdates(_0x19bf3b[_0xfb10('0x4a')],null))[_0xfb10('0x28')](respondWithResult(_0x319794,null))[_0xfb10('0x45')](handleError(_0x319794,null));};exports['destroy']=function(_0x36d465,_0x2d5a4c){return db[_0xfb10('0x30')][_0xfb10('0x48')]({'where':{'id':_0x36d465[_0xfb10('0x47')]['id']}})[_0xfb10('0x28')](handleEntityNotFound(_0x2d5a4c,null))[_0xfb10('0x28')](removeEntity(_0x2d5a4c,null))[_0xfb10('0x45')](handleError(_0x2d5a4c,null));};exports[_0xfb10('0x51')]=function(_0x4e7596,_0x591628){return db[_0xfb10('0x30')]['describe']()['then'](respondWithResult(_0x591628,null))[_0xfb10('0x45')](handleError(_0x591628,null));};exports[_0xfb10('0x52')]=function(_0x393b20,_0x55fdb9,_0x5bddaa){var _0x421a86={'raw':!![],'where':{}},_0x4ab3ad={},_0x1945d3;return db['OpenchannelQueue'][_0xfb10('0x53')]({'where':{'id':_0x393b20[_0xfb10('0x47')]['id']}})[_0xfb10('0x28')](handleEntityNotFound(_0x55fdb9,null))[_0xfb10('0x28')](function(_0x1a14e3){if(_0x1a14e3){_0x1945d3=_0x1a14e3['get']({'plain':!![]});_0x4ab3ad[_0xfb10('0x33')]=_[_0xfb10('0x35')](db['UserOpenchannelQueue'][_0xfb10('0x31')]);_0x4ab3ad[_0xfb10('0x34')]=_[_0xfb10('0x35')](_0x393b20[_0xfb10('0x34')]);_0x4ab3ad[_0xfb10('0x36')]=_[_0xfb10('0x37')](_0x4ab3ad[_0xfb10('0x33')],_0x4ab3ad['query']);_0x421a86[_0xfb10('0x38')]=_['intersection'](_0x4ab3ad[_0xfb10('0x33')],qs[_0xfb10('0x39')](_0x393b20['query'][_0xfb10('0x39')]));_0x421a86['attributes']=_0x421a86[_0xfb10('0x38')][_0xfb10('0x3a')]?_0x421a86[_0xfb10('0x38')]:_0x4ab3ad['model'];if(!_0x393b20['query'][_0xfb10('0x54')]('nolimit')){_0x421a86[_0xfb10('0x21')]=qs[_0xfb10('0x21')](_0x393b20[_0xfb10('0x34')][_0xfb10('0x21')]);_0x421a86[_0xfb10('0x1f')]=qs[_0xfb10('0x1f')](_0x393b20[_0xfb10('0x34')][_0xfb10('0x1f')]);}_0x421a86[_0xfb10('0x55')]=qs[_0xfb10('0x3c')](_0x393b20[_0xfb10('0x34')]['sort']);_0x421a86[_0xfb10('0x3f')]=qs[_0xfb10('0x36')](_['pick'](_0x393b20[_0xfb10('0x34')],_0x4ab3ad[_0xfb10('0x36')]));_0x421a86[_0xfb10('0x3f')][_0xfb10('0x56')]=_0x1a14e3['id'];if(_0x393b20[_0xfb10('0x34')][_0xfb10('0x3d')]){_0x421a86[_0xfb10('0x3f')]=_[_0xfb10('0x3e')](_0x421a86[_0xfb10('0x3f')],{'$or':_[_0xfb10('0x2f')](_0x421a86[_0xfb10('0x38')],function(_0x18fd5a){var _0x49fc37={};_0x49fc37[_0x18fd5a]={'$like':'%'+_0x393b20[_0xfb10('0x34')][_0xfb10('0x3d')]+'%'};return _0x49fc37;})});}_0x421a86=_[_0xfb10('0x3e')]({},_0x421a86,_0x393b20[_0xfb10('0x40')]);return db[_0xfb10('0x57')][_0xfb10('0x43')](_0x421a86);}})[_0xfb10('0x28')](function(_0x25eaae){if(_0x25eaae){return db['User'][_0xfb10('0x58')]({'where':{'id':_['map'](_0x25eaae,_0xfb10('0x59')),'role':_0xfb10('0x5a')},'attributes':['id',_0xfb10('0x2e'),'openchannelPause','updatedAt','createdAt']});}})[_0xfb10('0x28')](function(_0x4a4c23){if(_0x4a4c23){return{'count':_0x4a4c23[_0xfb10('0x22')],'rows':_[_0xfb10('0x2f')](_0x4a4c23[_0xfb10('0x44')],function(_0x2e3e93){return{'membername':_0x2e3e93[_0xfb10('0x2e')],'UserId':_0x2e3e93['id'],'queue_name':_0x1945d3[_0xfb10('0x2e')],'OpenchannelQueueId':_0x1945d3['id'],'interface':util['format']('%s/%s','SIP',_0x2e3e93[_0xfb10('0x2e')]),'penalty':0x0,'paused':_0x2e3e93['openchannelPause'],'createdAt':_0x2e3e93[_0xfb10('0x5b')],'updatedAt':_0x2e3e93[_0xfb10('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfb10('0x28')](respondWithFilteredResult(_0x55fdb9,_0x421a86))[_0xfb10('0x45')](handleError(_0x55fdb9,null));};exports[_0xfb10('0x5d')]=function(_0x3bc538,_0x4058b4,_0x4f7846){var _0xc93f56={};var _0x482309={};var _0x5768a1;var _0x668d32;return db['OpenchannelQueue'][_0xfb10('0x53')]({'where':{'id':_0x3bc538[_0xfb10('0x47')]['id']}})[_0xfb10('0x28')](handleEntityNotFound(_0x4058b4,null))[_0xfb10('0x28')](function(_0x5dceeb){if(_0x5dceeb){_0x5768a1=_0x5dceeb;_0x482309[_0xfb10('0x33')]=_[_0xfb10('0x35')](db[_0xfb10('0x5e')][_0xfb10('0x31')]);_0x482309['query']=_[_0xfb10('0x35')](_0x3bc538[_0xfb10('0x34')]);_0x482309['filters']=_[_0xfb10('0x37')](_0x482309[_0xfb10('0x33')],_0x482309['query']);_0xc93f56[_0xfb10('0x38')]=_[_0xfb10('0x37')](_0x482309['model'],qs['fields'](_0x3bc538[_0xfb10('0x34')][_0xfb10('0x39')]));_0xc93f56[_0xfb10('0x38')]=_0xc93f56[_0xfb10('0x38')][_0xfb10('0x3a')]?_0xc93f56[_0xfb10('0x38')]:_0x482309[_0xfb10('0x33')];_0xc93f56[_0xfb10('0x55')]=qs[_0xfb10('0x3c')](_0x3bc538['query'][_0xfb10('0x3c')]);_0xc93f56[_0xfb10('0x3f')]=qs[_0xfb10('0x36')](_[_0xfb10('0x5f')](_0x3bc538[_0xfb10('0x34')],_0x482309[_0xfb10('0x36')]));if(_0x3bc538[_0xfb10('0x34')][_0xfb10('0x3d')]){_0xc93f56[_0xfb10('0x3f')]=_['merge'](_0xc93f56[_0xfb10('0x3f')],{'$or':_[_0xfb10('0x2f')](_0xc93f56[_0xfb10('0x38')],function(_0x49b38f){var _0x4605fa={};_0x4605fa[_0x49b38f]={'$like':'%'+_0x3bc538[_0xfb10('0x34')][_0xfb10('0x3d')]+'%'};return _0x4605fa;})});}_0xc93f56=_[_0xfb10('0x3e')]({},_0xc93f56,_0x3bc538[_0xfb10('0x40')]);return _0x5768a1['getTeams'](_0xc93f56);}})['then'](function(_0x2f876f){if(_0x2f876f){_0x668d32=_0x2f876f[_0xfb10('0x3a')];if(!_0x3bc538['query']['hasOwnProperty'](_0xfb10('0x3b'))){_0xc93f56[_0xfb10('0x21')]=qs[_0xfb10('0x21')](_0x3bc538[_0xfb10('0x34')][_0xfb10('0x21')]);_0xc93f56['offset']=qs[_0xfb10('0x1f')](_0x3bc538[_0xfb10('0x34')]['offset']);}return _0x5768a1[_0xfb10('0x5d')](_0xc93f56);}})[_0xfb10('0x28')](function(_0x35149c){if(_0x35149c){return _0x35149c?{'count':_0x668d32,'rows':_0x35149c}:null;}})[_0xfb10('0x28')](respondWithResult(_0x4058b4,null))[_0xfb10('0x45')](handleError(_0x4058b4,null));};exports['addTeams']=function(_0x478bd3,_0x138c4d,_0x374931){var _0x1344f6=_0x478bd3[_0xfb10('0x4a')][_0xfb10('0x60')];return db[_0xfb10('0x5e')][_0xfb10('0x43')]({'where':{'id':_0x1344f6},'attributes':['id'],'include':[{'model':db[_0xfb10('0x61')],'as':_0xfb10('0x62'),'attributes':['id',_0xfb10('0x2e'),_0xfb10('0x63'),_0xfb10('0x64'),'interface'],'raw':!![]}]})['then'](function(_0x44daa8){if(_0x44daa8){var _0xff51c4=_[_0xfb10('0x65')](_0x44daa8,function(_0xf0f435){var _0x256c81=_0xf0f435['get']({'plain':!![]});return _0x256c81['Agents'];});return db[_0xfb10('0x30')][_0xfb10('0x48')]({'where':{'id':_0x478bd3[_0xfb10('0x47')]['id']}})[_0xfb10('0x28')](function(_0x39a3cb){return db['sequelize']['transaction'](function(_0x3a38a8){return _0x39a3cb[_0xfb10('0x66')](_0x1344f6,{'transaction':_0x3a38a8})[_0xfb10('0x28')](function(){return BPromise[_0xfb10('0x67')](_0xff51c4,function(_0x17286b){return db[_0xfb10('0x57')]['findOrCreate']({'where':{'UserId':_0x17286b['id'],'OpenchannelQueueId':_0x478bd3[_0xfb10('0x47')]['id']},'transaction':_0x3a38a8});});})[_0xfb10('0x28')](function(){_0xff51c4[_0xfb10('0x68')](function(_0x44bf8d){socket['emit'](_0xfb10('0x69'),{'UserId':_0x44bf8d['id'],'OpenchannelQueueId':_0x39a3cb['id']});});});});});}})[_0xfb10('0x28')](respondWithStatusCode(_0x138c4d,null))[_0xfb10('0x45')](handleError(_0x138c4d,null));};exports[_0xfb10('0x6a')]=function(_0xa0ef47,_0x302e31,_0x56442e){return db[_0xfb10('0x5e')][_0xfb10('0x43')]({'where':{'id':_0xa0ef47['query'][_0xfb10('0x60')]},'attributes':['id'],'include':[{'model':db[_0xfb10('0x61')],'as':_0xfb10('0x62'),'attributes':['id'],'raw':!![]}]})[_0xfb10('0x28')](handleEntityNotFound(_0x302e31,null))[_0xfb10('0x28')](function(_0x25a51e){var _0x5372b7=_[_0xfb10('0x2f')](_0x25a51e,'id');var _0x461e45=[];var _0xe947a=[];var _0x46bc14=squel[_0xfb10('0x6b')]();_0x46bc14[_0xfb10('0x6c')](_0xfb10('0x6d'))['from'](_0xfb10('0x6e'),'tq')[_0xfb10('0x6f')](_0xfb10('0x70'),'ut',_0xfb10('0x71'))['where']('OpenchannelQueueId\x20=\x20?',_0xa0ef47[_0xfb10('0x47')]['id']);for(var _0x120bb2=0x0;_0x120bb2<_0x25a51e[_0xfb10('0x3a')];_0x120bb2+=0x1){let _0x90838a=_0x25a51e[_0x120bb2];for(var _0x3836f7=0x0;_0x3836f7<_0x90838a[_0xfb10('0x62')][_0xfb10('0x3a')];_0x3836f7+=0x1){let _0x347184=_0x90838a[_0xfb10('0x62')][_0x3836f7];var _0x4dae36=_0x46bc14[_0xfb10('0x72')]();_0x4dae36[_0xfb10('0x3f')](_0xfb10('0x73'),_0x347184['id']);_0xe947a['push'](db[_0xfb10('0x74')][_0xfb10('0x34')](_0x4dae36[_0xfb10('0x75')](),{'type':db[_0xfb10('0x74')]['QueryTypes'][_0xfb10('0x76')]})[_0xfb10('0x28')](function(_0x108e7b){if(_0x108e7b['length']===0x1){return _0x347184['id'];}else{var _0x168c14=_[_0xfb10('0x77')](_[_0xfb10('0x2f')](_0x108e7b,_0xfb10('0x78')),function(_0x44966c){return _['includes'](_0x5372b7,_0x44966c);});if(_0x168c14){return _0x347184['id'];}}}));}}return BPromise[_0xfb10('0x79')](_0xe947a)[_0xfb10('0x28')](function(_0x282008){_0x461e45=_(_0x461e45)[_0xfb10('0x7a')](_0x282008)[_0xfb10('0x7b')]()[_0xfb10('0x7c')]();return db[_0xfb10('0x30')][_0xfb10('0x48')]({'where':{'id':_0xa0ef47[_0xfb10('0x47')]['id']}})[_0xfb10('0x28')](function(_0x2facee){return db[_0xfb10('0x74')]['transaction'](function(_0x4903b3){return _0x2facee[_0xfb10('0x6a')](_0xa0ef47[_0xfb10('0x34')][_0xfb10('0x60')],{'transaction':_0x4903b3})['then'](function(){if(!_[_0xfb10('0x7d')](_0x461e45)){return _0x2facee[_0xfb10('0x7e')](_0x461e45,{'transaction':_0x4903b3});}})[_0xfb10('0x28')](function(){_0x461e45['forEach'](function(_0x2fa00c){socket[_0xfb10('0x7f')]('userOpenchannelQueue:remove',{'UserId':_0x2fa00c,'OpenchannelQueueId':_0x2facee['id']});});});});});});})['then'](respondWithStatusCode(_0x302e31,null))[_0xfb10('0x45')](handleError(_0x302e31,null));};exports['addAgents']=function(_0x1f02de,_0x3690c4,_0x40f6dd){return db[_0xfb10('0x30')][_0xfb10('0x48')]({'where':{'id':_0x1f02de[_0xfb10('0x47')]['id']}})['then'](handleEntityNotFound(_0x3690c4,null))['then'](function(_0x29f361){if(_0x29f361){return _0x29f361[_0xfb10('0x80')](_0x1f02de[_0xfb10('0x4a')][_0xfb10('0x60')],_[_0xfb10('0x81')](_0x1f02de[_0xfb10('0x4a')],[_0xfb10('0x60'),'id'])||{})[_0xfb10('0x82')](function(_0x1eeb0a){for(var _0x13db14=0x0;_0x13db14<_0x1f02de[_0xfb10('0x4a')]['ids']['length'];_0x13db14+=0x1){socket[_0xfb10('0x7f')](_0xfb10('0x69'),{'UserId':Number(_0x1f02de['body']['ids'][_0x13db14]),'OpenchannelQueueId':Number(_0x1f02de[_0xfb10('0x47')]['id'])});}return _0x1eeb0a;});}})[_0xfb10('0x28')](respondWithResult(_0x3690c4,null))['catch'](handleError(_0x3690c4,null));};exports[_0xfb10('0x7e')]=function(_0x3ffcb6,_0x38cc37,_0x5965f7){return db[_0xfb10('0x30')][_0xfb10('0x48')]({'where':{'id':_0x3ffcb6[_0xfb10('0x47')]['id']}})['then'](handleEntityNotFound(_0x38cc37,null))[_0xfb10('0x28')](function(_0x3a30be){if(_0x3a30be){return _0x3a30be[_0xfb10('0x7e')](_0x3ffcb6[_0xfb10('0x34')][_0xfb10('0x60')])[_0xfb10('0x28')](function(){if(_[_0xfb10('0x83')](_0x3ffcb6[_0xfb10('0x34')][_0xfb10('0x60')])){for(var _0x4e48ea=0x0;_0x4e48ea<_0x3ffcb6[_0xfb10('0x34')][_0xfb10('0x60')]['length'];_0x4e48ea+=0x1){socket[_0xfb10('0x7f')](_0xfb10('0x84'),{'UserId':Number(_0x3ffcb6['query'][_0xfb10('0x60')][_0x4e48ea]),'OpenchannelQueueId':Number(_0x3ffcb6[_0xfb10('0x47')]['id'])});}}else{socket[_0xfb10('0x7f')](_0xfb10('0x84'),{'UserId':Number(_0x3ffcb6[_0xfb10('0x34')][_0xfb10('0x60')]),'OpenchannelQueueId':Number(_0x3ffcb6[_0xfb10('0x47')]['id'])});}});}})[_0xfb10('0x28')](respondWithStatusCode(_0x38cc37,null))[_0xfb10('0x45')](handleError(_0x38cc37,null));};exports[_0xfb10('0x85')]=function(_0x510404,_0x3be324,_0x534446){var _0x43c4a7={};var _0x1df1f5={};var _0x100a94;var _0x3666ac;return db[_0xfb10('0x30')][_0xfb10('0x53')]({'where':{'id':_0x510404[_0xfb10('0x47')]['id']}})[_0xfb10('0x28')](handleEntityNotFound(_0x3be324,null))['then'](function(_0x3ecc8e){if(_0x3ecc8e){_0x100a94=_0x3ecc8e;_0x1df1f5['model']=_[_0xfb10('0x35')](db[_0xfb10('0x61')][_0xfb10('0x31')]);_0x1df1f5[_0xfb10('0x34')]=_[_0xfb10('0x35')](_0x510404[_0xfb10('0x34')]);_0x1df1f5[_0xfb10('0x36')]=_[_0xfb10('0x37')](_0x1df1f5['model'],_0x1df1f5[_0xfb10('0x34')]);_0x43c4a7[_0xfb10('0x38')]=_['intersection'](_0x1df1f5['model'],qs[_0xfb10('0x39')](_0x510404['query']['fields']));_0x43c4a7['attributes']=_0x43c4a7['attributes'][_0xfb10('0x3a')]?_0x43c4a7[_0xfb10('0x38')]:_0x1df1f5['model'];_0x43c4a7[_0xfb10('0x55')]=qs['sort'](_0x510404[_0xfb10('0x34')][_0xfb10('0x3c')]);_0x43c4a7[_0xfb10('0x3f')]=qs[_0xfb10('0x36')](_[_0xfb10('0x5f')](_0x510404[_0xfb10('0x34')],_0x1df1f5[_0xfb10('0x36')]));if(_0x510404[_0xfb10('0x34')][_0xfb10('0x3d')]){_0x43c4a7['where']=_['merge'](_0x43c4a7[_0xfb10('0x3f')],{'$or':_[_0xfb10('0x2f')](_0x43c4a7[_0xfb10('0x38')],function(_0x295b0f){var _0x583b2e={};_0x583b2e[_0x295b0f]={'$like':'%'+_0x510404[_0xfb10('0x34')][_0xfb10('0x3d')]+'%'};return _0x583b2e;})});}_0x43c4a7=_['merge']({},_0x43c4a7,_0x510404[_0xfb10('0x40')]);return _0x100a94['getAgents'](_0x43c4a7);}})[_0xfb10('0x28')](function(_0x3796b7){if(_0x3796b7){_0x3666ac=_0x3796b7[_0xfb10('0x3a')];if(!_0x510404[_0xfb10('0x34')][_0xfb10('0x54')](_0xfb10('0x3b'))){_0x43c4a7['limit']=qs[_0xfb10('0x21')](_0x510404[_0xfb10('0x34')][_0xfb10('0x21')]);_0x43c4a7[_0xfb10('0x1f')]=qs[_0xfb10('0x1f')](_0x510404['query'][_0xfb10('0x1f')]);}return _0x100a94[_0xfb10('0x85')](_0x43c4a7);}})[_0xfb10('0x28')](function(_0x30aa3f){if(_0x30aa3f){return _0x30aa3f?{'count':_0x3666ac,'rows':_0x30aa3f}:null;}})['then'](respondWithResult(_0x3be324,null))[_0xfb10('0x45')](handleError(_0x3be324,null));}; \ No newline at end of file +var _0x667f=['role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserOpenchannelQueue','hasOwnProperty','order','OpenchannelQueueId','findAndCountAll','UserId','agent','openchannelPause','updatedAt','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','online','voicePause','interface','flatMap','Agents','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','ids','User','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','sequelize','toString','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','name','send','map','OpenchannelQueue','fieldName','type','key','query','keys','attributes','intersection','model','fields','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x58c09f,_0x1edbeb){var _0x14c9cb=function(_0x148489){while(--_0x148489){_0x58c09f['push'](_0x58c09f['shift']());}};_0x14c9cb(++_0x1edbeb);}(_0x667f,0xce));var _0xf667=function(_0x2dc8b5,_0x5b245b){_0x2dc8b5=_0x2dc8b5-0x0;var _0x148051=_0x667f[_0x2dc8b5];return _0x148051;};'use strict';var emlformat=require(_0xf667('0x0'));var rimraf=require(_0xf667('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf667('0x2'));var rp=require(_0xf667('0x3'));var moment=require(_0xf667('0x4'));var BPromise=require(_0xf667('0x5'));var Mustache=require('mustache');var util=require(_0xf667('0x6'));var path=require(_0xf667('0x7'));var sox=require(_0xf667('0x8'));var csv=require(_0xf667('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf667('0xa'));var _=require('lodash');var squel=require(_0xf667('0xb'));var crypto=require(_0xf667('0xc'));var jsforce=require(_0xf667('0xd'));var deskjs=require(_0xf667('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf667('0xf'));var Papa=require(_0xf667('0x10'));var Redis=require(_0xf667('0x11'));var authService=require(_0xf667('0x12'));var qs=require(_0xf667('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf667('0x14'));var logger=require('../../config/logger')(_0xf667('0x15'));var utils=require('../../config/utils');var config=require(_0xf667('0x16'));var licenseUtil=require(_0xf667('0x17'));var db=require(_0xf667('0x18'))['db'];config[_0xf667('0x19')]=_['defaults'](config[_0xf667('0x19')],{'host':_0xf667('0x1a'),'port':0x18eb});var socket=require(_0xf667('0x1b'))(new Redis(config[_0xf667('0x19')]));require(_0xf667('0x1c'))[_0xf667('0x1d')](socket);function respondWithStatusCode(_0x51156e,_0x35eaad){_0x35eaad=_0x35eaad||0xcc;return function(_0x41ba83){if(_0x41ba83){return _0x51156e[_0xf667('0x1e')](_0x35eaad);}return _0x51156e[_0xf667('0x1f')](_0x35eaad)[_0xf667('0x20')]();};}function respondWithResult(_0x2f4e47,_0x47452f){_0x47452f=_0x47452f||0xc8;return function(_0x20927a){if(_0x20927a){return _0x2f4e47['status'](_0x47452f)[_0xf667('0x21')](_0x20927a);}};}function respondWithFilteredResult(_0x5aa2c5,_0x873587){return function(_0x1de3a3){if(_0x1de3a3){var _0xe96380=typeof _0x873587['offset']===_0xf667('0x22')&&typeof _0x873587[_0xf667('0x23')]===_0xf667('0x22');var _0x18c9e7=_0x1de3a3['count'];var _0x212f0a=_0xe96380?0x0:_0x873587[_0xf667('0x24')];var _0x268d52=_0xe96380?_0x1de3a3[_0xf667('0x25')]:_0x873587[_0xf667('0x24')]+_0x873587[_0xf667('0x23')];var _0x25d6a8;if(_0x268d52>=_0x18c9e7){_0x268d52=_0x18c9e7;_0x25d6a8=0xc8;}else{_0x25d6a8=0xce;}_0x5aa2c5['status'](_0x25d6a8);return _0x5aa2c5[_0xf667('0x26')]('Content-Range',_0x212f0a+'-'+_0x268d52+'/'+_0x18c9e7)['json'](_0x1de3a3);}return null;};}function patchUpdates(_0x5e8137){return function(_0x5c02a9){try{jsonpatch[_0xf667('0x27')](_0x5c02a9,_0x5e8137,!![]);}catch(_0x2c3bef){return BPromise['reject'](_0x2c3bef);}return _0x5c02a9['save']();};}function saveUpdates(_0x1eb5bd,_0x2fb7d0){return function(_0x26237b){if(_0x26237b){return _0x26237b[_0xf667('0x28')](_0x1eb5bd)[_0xf667('0x29')](function(_0x354dc9){return _0x354dc9;});}return null;};}function removeEntity(_0x58784f,_0x5837b3){return function(_0x305e54){if(_0x305e54){return _0x305e54[_0xf667('0x2a')]()[_0xf667('0x29')](function(){var _0x217b96=_0x305e54[_0xf667('0x2b')]({'plain':!![]});var _0x430573=_0xf667('0x2c');return db[_0xf667('0x2d')][_0xf667('0x2a')]({'where':{'type':_0x430573,'resourceId':_0x217b96['id']}})[_0xf667('0x29')](function(){return _0x305e54;});})[_0xf667('0x29')](function(){_0x58784f[_0xf667('0x1f')](0xcc)[_0xf667('0x20')]();});}};}function handleEntityNotFound(_0x5046c9,_0x5c0263){return function(_0x1ff779){if(!_0x1ff779){_0x5046c9[_0xf667('0x1e')](0x194);}return _0x1ff779;};}function handleError(_0xebceed,_0x3ab585){_0x3ab585=_0x3ab585||0x1f4;return function(_0x5abccb){logger[_0xf667('0x2e')](_0x5abccb['stack']);if(_0x5abccb[_0xf667('0x2f')]){delete _0x5abccb[_0xf667('0x2f')];}_0xebceed[_0xf667('0x1f')](_0x3ab585)[_0xf667('0x30')](_0x5abccb);};}exports['index']=function(_0x5b7d69,_0x814d5a){var _0x52fade={},_0x29e118={},_0x3d7598={'count':0x0,'rows':[]};var _0xff51a8=_[_0xf667('0x31')](db[_0xf667('0x32')]['rawAttributes'],function(_0x501fa1){return{'name':_0x501fa1[_0xf667('0x33')],'type':_0x501fa1[_0xf667('0x34')][_0xf667('0x35')]};});_0x29e118['model']=_['map'](_0xff51a8,_0xf667('0x2f'));_0x29e118[_0xf667('0x36')]=_[_0xf667('0x37')](_0x5b7d69[_0xf667('0x36')]);_0x29e118['filters']=_['intersection'](_0x29e118['model'],_0x29e118[_0xf667('0x36')]);_0x52fade[_0xf667('0x38')]=_[_0xf667('0x39')](_0x29e118[_0xf667('0x3a')],qs[_0xf667('0x3b')](_0x5b7d69['query'][_0xf667('0x3b')]));_0x52fade[_0xf667('0x38')]=_0x52fade[_0xf667('0x38')]['length']?_0x52fade['attributes']:_0x29e118[_0xf667('0x3a')];if(!_0x5b7d69[_0xf667('0x36')]['hasOwnProperty'](_0xf667('0x3c'))){_0x52fade['limit']=qs[_0xf667('0x23')](_0x5b7d69['query'][_0xf667('0x23')]);_0x52fade[_0xf667('0x24')]=qs[_0xf667('0x24')](_0x5b7d69['query'][_0xf667('0x24')]);}_0x52fade['order']=qs[_0xf667('0x3d')](_0x5b7d69[_0xf667('0x36')]['sort']);_0x52fade[_0xf667('0x3e')]=qs[_0xf667('0x3f')](_[_0xf667('0x40')](_0x5b7d69[_0xf667('0x36')],_0x29e118['filters']),_0xff51a8);if(_0x5b7d69[_0xf667('0x36')][_0xf667('0x41')]){_0x52fade['where']=_['merge'](_0x52fade[_0xf667('0x3e')],{'$or':_['map'](_0xff51a8,function(_0x24a898){if(_0x24a898[_0xf667('0x34')]!==_0xf667('0x42')){var _0x192291={};_0x192291[_0x24a898[_0xf667('0x2f')]]={'$like':'%'+_0x5b7d69[_0xf667('0x36')][_0xf667('0x41')]+'%'};return _0x192291;}})});}_0x52fade=_[_0xf667('0x43')]({},_0x52fade,_0x5b7d69[_0xf667('0x44')]);var _0xabca77={'where':_0x52fade[_0xf667('0x3e')]};return db['OpenchannelQueue'][_0xf667('0x25')](_0xabca77)[_0xf667('0x29')](function(_0x17effa){_0x3d7598[_0xf667('0x25')]=_0x17effa;if(_0x5b7d69[_0xf667('0x36')][_0xf667('0x45')]){_0x52fade[_0xf667('0x46')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0xf667('0x47')](_0x52fade);})[_0xf667('0x29')](function(_0x5d7bfc){_0x3d7598[_0xf667('0x48')]=_0x5d7bfc;return _0x3d7598;})[_0xf667('0x29')](respondWithFilteredResult(_0x814d5a,_0x52fade))[_0xf667('0x49')](handleError(_0x814d5a,null));};exports['show']=function(_0x26509e,_0xe1df92){var _0x1633d1={'raw':!![],'where':{'id':_0x26509e[_0xf667('0x4a')]['id']}},_0x4a650c={};_0x4a650c[_0xf667('0x3a')]=_[_0xf667('0x37')](db['OpenchannelQueue'][_0xf667('0x4b')]);_0x4a650c['query']=_[_0xf667('0x37')](_0x26509e[_0xf667('0x36')]);_0x4a650c[_0xf667('0x3f')]=_[_0xf667('0x39')](_0x4a650c[_0xf667('0x3a')],_0x4a650c[_0xf667('0x36')]);_0x1633d1[_0xf667('0x38')]=_[_0xf667('0x39')](_0x4a650c[_0xf667('0x3a')],qs[_0xf667('0x3b')](_0x26509e['query'][_0xf667('0x3b')]));_0x1633d1[_0xf667('0x38')]=_0x1633d1['attributes'][_0xf667('0x4c')]?_0x1633d1[_0xf667('0x38')]:_0x4a650c[_0xf667('0x3a')];if(_0x26509e[_0xf667('0x36')]['includeAll']){_0x1633d1[_0xf667('0x46')]=[{'all':!![]}];}_0x1633d1=_[_0xf667('0x43')]({},_0x1633d1,_0x26509e[_0xf667('0x44')]);return db['OpenchannelQueue'][_0xf667('0x4d')](_0x1633d1)['then'](handleEntityNotFound(_0xe1df92,null))[_0xf667('0x29')](respondWithResult(_0xe1df92,null))['catch'](handleError(_0xe1df92,null));};exports[_0xf667('0x4e')]=function(_0x40085a,_0x701c69){return db[_0xf667('0x32')]['create'](_0x40085a[_0xf667('0x4f')],{})[_0xf667('0x29')](function(_0x58751f){var _0x558161=_0x40085a[_0xf667('0x50')][_0xf667('0x2b')]({'plain':!![]});if(!_0x558161)throw new Error(_0xf667('0x51'));if(_0x558161[_0xf667('0x52')]==='user'){var _0xac7099=_0x58751f['get']({'plain':!![]});var _0x28ea53='OpenchannelQueues';return db[_0xf667('0x53')][_0xf667('0x4d')]({'where':{'name':_0x28ea53,'userProfileId':_0x558161['userProfileId']},'raw':!![]})[_0xf667('0x29')](function(_0x24c673){if(_0x24c673&&_0x24c673['autoAssociation']===0x0){return db['UserProfileResource'][_0xf667('0x4e')]({'name':_0xac7099['name'],'resourceId':_0xac7099['id'],'type':_0x24c673[_0xf667('0x2f')],'sectionId':_0x24c673['id']},{})[_0xf667('0x29')](function(){return _0x58751f;});}else{return _0x58751f;}})['catch'](function(_0x17da06){logger[_0xf667('0x2e')](_0xf667('0x54'),_0x17da06);throw _0x17da06;});}return _0x58751f;})[_0xf667('0x29')](respondWithResult(_0x701c69,0xc9))['catch'](handleError(_0x701c69,null));};exports[_0xf667('0x28')]=function(_0x36d82a,_0x35d1c3){if(_0x36d82a[_0xf667('0x4f')]['id']){delete _0x36d82a[_0xf667('0x4f')]['id'];}return db[_0xf667('0x32')][_0xf667('0x4d')]({'where':{'id':_0x36d82a[_0xf667('0x4a')]['id']}})[_0xf667('0x29')](handleEntityNotFound(_0x35d1c3,null))[_0xf667('0x29')](saveUpdates(_0x36d82a['body'],null))[_0xf667('0x29')](respondWithResult(_0x35d1c3,null))[_0xf667('0x49')](handleError(_0x35d1c3,null));};exports[_0xf667('0x2a')]=function(_0x4a4a74,_0x1f8f3b){return db[_0xf667('0x32')][_0xf667('0x4d')]({'where':{'id':_0x4a4a74[_0xf667('0x4a')]['id']}})[_0xf667('0x29')](handleEntityNotFound(_0x1f8f3b,null))['then'](removeEntity(_0x1f8f3b,null))[_0xf667('0x49')](handleError(_0x1f8f3b,null));};exports[_0xf667('0x55')]=function(_0x26e93e,_0x14feeb){return db[_0xf667('0x32')]['describe']()[_0xf667('0x29')](respondWithResult(_0x14feeb,null))[_0xf667('0x49')](handleError(_0x14feeb,null));};exports['getMembers']=function(_0x3c82d3,_0x3e5026,_0x161c6c){var _0x48cdc8={'raw':!![],'where':{}},_0x364b60={},_0x166946;return db[_0xf667('0x32')]['findOne']({'where':{'id':_0x3c82d3[_0xf667('0x4a')]['id']}})[_0xf667('0x29')](handleEntityNotFound(_0x3e5026,null))[_0xf667('0x29')](function(_0x3264ff){if(_0x3264ff){_0x166946=_0x3264ff['get']({'plain':!![]});_0x364b60['model']=_[_0xf667('0x37')](db[_0xf667('0x56')][_0xf667('0x4b')]);_0x364b60[_0xf667('0x36')]=_[_0xf667('0x37')](_0x3c82d3['query']);_0x364b60[_0xf667('0x3f')]=_['intersection'](_0x364b60[_0xf667('0x3a')],_0x364b60[_0xf667('0x36')]);_0x48cdc8[_0xf667('0x38')]=_[_0xf667('0x39')](_0x364b60[_0xf667('0x3a')],qs[_0xf667('0x3b')](_0x3c82d3[_0xf667('0x36')][_0xf667('0x3b')]));_0x48cdc8[_0xf667('0x38')]=_0x48cdc8['attributes'][_0xf667('0x4c')]?_0x48cdc8[_0xf667('0x38')]:_0x364b60['model'];if(!_0x3c82d3[_0xf667('0x36')][_0xf667('0x57')](_0xf667('0x3c'))){_0x48cdc8['limit']=qs[_0xf667('0x23')](_0x3c82d3[_0xf667('0x36')][_0xf667('0x23')]);_0x48cdc8['offset']=qs[_0xf667('0x24')](_0x3c82d3['query'][_0xf667('0x24')]);}_0x48cdc8[_0xf667('0x58')]=qs[_0xf667('0x3d')](_0x3c82d3[_0xf667('0x36')][_0xf667('0x3d')]);_0x48cdc8['where']=qs[_0xf667('0x3f')](_['pick'](_0x3c82d3['query'],_0x364b60[_0xf667('0x3f')]));_0x48cdc8[_0xf667('0x3e')][_0xf667('0x59')]=_0x3264ff['id'];if(_0x3c82d3['query'][_0xf667('0x41')]){_0x48cdc8['where']=_['merge'](_0x48cdc8[_0xf667('0x3e')],{'$or':_[_0xf667('0x31')](_0x48cdc8[_0xf667('0x38')],function(_0x5394d7){var _0x4c62f1={};_0x4c62f1[_0x5394d7]={'$like':'%'+_0x3c82d3[_0xf667('0x36')][_0xf667('0x41')]+'%'};return _0x4c62f1;})});}_0x48cdc8=_[_0xf667('0x43')]({},_0x48cdc8,_0x3c82d3[_0xf667('0x44')]);return db[_0xf667('0x56')]['findAll'](_0x48cdc8);}})[_0xf667('0x29')](function(_0x47c876){if(_0x47c876){return db['User'][_0xf667('0x5a')]({'where':{'id':_['map'](_0x47c876,_0xf667('0x5b')),'role':_0xf667('0x5c')},'attributes':['id',_0xf667('0x2f'),_0xf667('0x5d'),_0xf667('0x5e'),'createdAt']});}})[_0xf667('0x29')](function(_0x20bdcb){if(_0x20bdcb){return{'count':_0x20bdcb[_0xf667('0x25')],'rows':_[_0xf667('0x31')](_0x20bdcb[_0xf667('0x48')],function(_0x1b327f){return{'membername':_0x1b327f['name'],'UserId':_0x1b327f['id'],'queue_name':_0x166946[_0xf667('0x2f')],'OpenchannelQueueId':_0x166946['id'],'interface':util[_0xf667('0x5f')](_0xf667('0x60'),_0xf667('0x61'),_0x1b327f['name']),'penalty':0x0,'paused':_0x1b327f['openchannelPause'],'createdAt':_0x1b327f['createdAt'],'updatedAt':_0x1b327f[_0xf667('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3e5026,_0x48cdc8))['catch'](handleError(_0x3e5026,null));};exports[_0xf667('0x62')]=function(_0x8f97c9,_0x153182,_0xb35d79){var _0x27ed0d={};var _0x8f0143={};var _0x27802a;var _0x4e14e4;return db[_0xf667('0x32')][_0xf667('0x63')]({'where':{'id':_0x8f97c9[_0xf667('0x4a')]['id']}})[_0xf667('0x29')](handleEntityNotFound(_0x153182,null))[_0xf667('0x29')](function(_0x28d6da){if(_0x28d6da){_0x27802a=_0x28d6da;_0x8f0143[_0xf667('0x3a')]=_[_0xf667('0x37')](db[_0xf667('0x64')][_0xf667('0x4b')]);_0x8f0143[_0xf667('0x36')]=_['keys'](_0x8f97c9[_0xf667('0x36')]);_0x8f0143[_0xf667('0x3f')]=_['intersection'](_0x8f0143[_0xf667('0x3a')],_0x8f0143[_0xf667('0x36')]);_0x27ed0d[_0xf667('0x38')]=_[_0xf667('0x39')](_0x8f0143[_0xf667('0x3a')],qs['fields'](_0x8f97c9[_0xf667('0x36')]['fields']));_0x27ed0d[_0xf667('0x38')]=_0x27ed0d[_0xf667('0x38')]['length']?_0x27ed0d[_0xf667('0x38')]:_0x8f0143[_0xf667('0x3a')];_0x27ed0d[_0xf667('0x58')]=qs[_0xf667('0x3d')](_0x8f97c9[_0xf667('0x36')]['sort']);_0x27ed0d[_0xf667('0x3e')]=qs[_0xf667('0x3f')](_[_0xf667('0x40')](_0x8f97c9[_0xf667('0x36')],_0x8f0143[_0xf667('0x3f')]));if(_0x8f97c9[_0xf667('0x36')]['filter']){_0x27ed0d[_0xf667('0x3e')]=_[_0xf667('0x43')](_0x27ed0d[_0xf667('0x3e')],{'$or':_[_0xf667('0x31')](_0x27ed0d['attributes'],function(_0x465e5a){var _0x51867a={};_0x51867a[_0x465e5a]={'$like':'%'+_0x8f97c9[_0xf667('0x36')][_0xf667('0x41')]+'%'};return _0x51867a;})});}_0x27ed0d=_[_0xf667('0x43')]({},_0x27ed0d,_0x8f97c9[_0xf667('0x44')]);return _0x27802a[_0xf667('0x62')](_0x27ed0d);}})[_0xf667('0x29')](function(_0x202865){if(_0x202865){_0x4e14e4=_0x202865[_0xf667('0x4c')];if(!_0x8f97c9['query'][_0xf667('0x57')](_0xf667('0x3c'))){_0x27ed0d[_0xf667('0x23')]=qs['limit'](_0x8f97c9['query'][_0xf667('0x23')]);_0x27ed0d['offset']=qs['offset'](_0x8f97c9['query'][_0xf667('0x24')]);}return _0x27802a[_0xf667('0x62')](_0x27ed0d);}})['then'](function(_0x4a53e8){if(_0x4a53e8){return _0x4a53e8?{'count':_0x4e14e4,'rows':_0x4a53e8}:null;}})[_0xf667('0x29')](respondWithResult(_0x153182,null))[_0xf667('0x49')](handleError(_0x153182,null));};exports[_0xf667('0x65')]=function(_0x10801f,_0x52bb1c,_0x134eac){var _0x1bb7e3=_0x10801f[_0xf667('0x4f')]['ids'];return db['Team'][_0xf667('0x47')]({'where':{'id':_0x1bb7e3},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xf667('0x2f'),_0xf667('0x66'),_0xf667('0x67'),_0xf667('0x68')],'raw':!![]}]})[_0xf667('0x29')](function(_0x54d85a){if(_0x54d85a){var _0x4e19cc=_[_0xf667('0x69')](_0x54d85a,function(_0x2aa76c){var _0x4a9355=_0x2aa76c[_0xf667('0x2b')]({'plain':!![]});return _0x4a9355[_0xf667('0x6a')];});return db['OpenchannelQueue'][_0xf667('0x4d')]({'where':{'id':_0x10801f['params']['id']}})[_0xf667('0x29')](function(_0x3aaaff){return db['sequelize']['transaction'](function(_0x407a69){return _0x3aaaff[_0xf667('0x65')](_0x1bb7e3,{'transaction':_0x407a69})[_0xf667('0x29')](function(){return BPromise[_0xf667('0x6b')](_0x4e19cc,function(_0x40b318){return db[_0xf667('0x56')][_0xf667('0x6c')]({'where':{'UserId':_0x40b318['id'],'OpenchannelQueueId':_0x10801f[_0xf667('0x4a')]['id']},'transaction':_0x407a69});});})['then'](function(){_0x4e19cc[_0xf667('0x6d')](function(_0x1465ff){socket[_0xf667('0x6e')](_0xf667('0x6f'),{'UserId':_0x1465ff['id'],'OpenchannelQueueId':_0x3aaaff['id']});});});});});}})[_0xf667('0x29')](respondWithStatusCode(_0x52bb1c,null))[_0xf667('0x49')](handleError(_0x52bb1c,null));};exports[_0xf667('0x70')]=function(_0x496185,_0x296cc1,_0x5abf42){return db['Team'][_0xf667('0x47')]({'where':{'id':_0x496185[_0xf667('0x36')][_0xf667('0x71')]},'attributes':['id'],'include':[{'model':db[_0xf667('0x72')],'as':_0xf667('0x6a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x296cc1,null))['then'](function(_0x27c0a8){var _0x8e0e2e=_[_0xf667('0x31')](_0x27c0a8,'id');var _0x50ffda=[];var _0x12c0e2=[];var _0x506ed4=squel[_0xf667('0x73')]();_0x506ed4[_0xf667('0x74')](_0xf667('0x75'))[_0xf667('0x76')](_0xf667('0x77'),'tq')[_0xf667('0x78')](_0xf667('0x79'),'ut',_0xf667('0x7a'))[_0xf667('0x3e')](_0xf667('0x7b'),_0x496185[_0xf667('0x4a')]['id']);for(var _0x480c8f=0x0;_0x480c8f<_0x27c0a8[_0xf667('0x4c')];_0x480c8f+=0x1){let _0x366f89=_0x27c0a8[_0x480c8f];for(var _0x20027f=0x0;_0x20027f<_0x366f89['Agents'][_0xf667('0x4c')];_0x20027f+=0x1){let _0x45396f=_0x366f89['Agents'][_0x20027f];var _0x1e509f=_0x506ed4[_0xf667('0x7c')]();_0x1e509f[_0xf667('0x3e')]('ut.UserId\x20=\x20?',_0x45396f['id']);_0x12c0e2[_0xf667('0x7d')](db[_0xf667('0x7e')][_0xf667('0x36')](_0x1e509f[_0xf667('0x7f')](),{'type':db[_0xf667('0x7e')]['QueryTypes']['SELECT']})[_0xf667('0x29')](function(_0xffe7a){if(_0xffe7a[_0xf667('0x4c')]===0x1){return _0x45396f['id'];}else{var _0x5274ea=_[_0xf667('0x80')](_[_0xf667('0x31')](_0xffe7a,_0xf667('0x81')),function(_0x1c542f){return _[_0xf667('0x82')](_0x8e0e2e,_0x1c542f);});if(_0x5274ea){return _0x45396f['id'];}}}));}}return BPromise[_0xf667('0x83')](_0x12c0e2)[_0xf667('0x29')](function(_0xd371cb){_0x50ffda=_(_0x50ffda)[_0xf667('0x84')](_0xd371cb)[_0xf667('0x85')]()[_0xf667('0x86')]();return db[_0xf667('0x32')][_0xf667('0x4d')]({'where':{'id':_0x496185[_0xf667('0x4a')]['id']}})[_0xf667('0x29')](function(_0xa62826){return db[_0xf667('0x7e')][_0xf667('0x87')](function(_0x4786f0){return _0xa62826[_0xf667('0x70')](_0x496185['query'][_0xf667('0x71')],{'transaction':_0x4786f0})[_0xf667('0x29')](function(){if(!_[_0xf667('0x88')](_0x50ffda)){return _0xa62826[_0xf667('0x89')](_0x50ffda,{'transaction':_0x4786f0});}})[_0xf667('0x29')](function(){_0x50ffda[_0xf667('0x6d')](function(_0x1e7f52){socket[_0xf667('0x6e')](_0xf667('0x8a'),{'UserId':_0x1e7f52,'OpenchannelQueueId':_0xa62826['id']});});});});});});})[_0xf667('0x29')](respondWithStatusCode(_0x296cc1,null))[_0xf667('0x49')](handleError(_0x296cc1,null));};exports[_0xf667('0x8b')]=function(_0x6434b1,_0x5874e7,_0x598a0e){return db[_0xf667('0x32')]['find']({'where':{'id':_0x6434b1[_0xf667('0x4a')]['id']}})[_0xf667('0x29')](handleEntityNotFound(_0x5874e7,null))[_0xf667('0x29')](function(_0xae0c0d){if(_0xae0c0d){return _0xae0c0d[_0xf667('0x8b')](_0x6434b1[_0xf667('0x4f')][_0xf667('0x71')],_[_0xf667('0x8c')](_0x6434b1[_0xf667('0x4f')],['ids','id'])||{})[_0xf667('0x8d')](function(_0x166ceb){for(var _0x478c2b=0x0;_0x478c2b<_0x6434b1[_0xf667('0x4f')]['ids']['length'];_0x478c2b+=0x1){socket['emit'](_0xf667('0x6f'),{'UserId':Number(_0x6434b1[_0xf667('0x4f')][_0xf667('0x71')][_0x478c2b]),'OpenchannelQueueId':Number(_0x6434b1[_0xf667('0x4a')]['id'])});}return _0x166ceb;});}})[_0xf667('0x29')](respondWithResult(_0x5874e7,null))['catch'](handleError(_0x5874e7,null));};exports[_0xf667('0x89')]=function(_0xb3a53,_0x50d1f3,_0x2c9b9b){return db[_0xf667('0x32')][_0xf667('0x4d')]({'where':{'id':_0xb3a53['params']['id']}})[_0xf667('0x29')](handleEntityNotFound(_0x50d1f3,null))[_0xf667('0x29')](function(_0x14b960){if(_0x14b960){return _0x14b960['removeAgents'](_0xb3a53['query'][_0xf667('0x71')])[_0xf667('0x29')](function(){if(_[_0xf667('0x8e')](_0xb3a53[_0xf667('0x36')]['ids'])){for(var _0x5e50bf=0x0;_0x5e50bf<_0xb3a53['query'][_0xf667('0x71')][_0xf667('0x4c')];_0x5e50bf+=0x1){socket[_0xf667('0x6e')](_0xf667('0x8a'),{'UserId':Number(_0xb3a53[_0xf667('0x36')]['ids'][_0x5e50bf]),'OpenchannelQueueId':Number(_0xb3a53[_0xf667('0x4a')]['id'])});}}else{socket[_0xf667('0x6e')]('userOpenchannelQueue:remove',{'UserId':Number(_0xb3a53[_0xf667('0x36')][_0xf667('0x71')]),'OpenchannelQueueId':Number(_0xb3a53['params']['id'])});}});}})['then'](respondWithStatusCode(_0x50d1f3,null))[_0xf667('0x49')](handleError(_0x50d1f3,null));};exports[_0xf667('0x8f')]=function(_0x3294f8,_0x1584bc,_0x307a1a){var _0x312427={};var _0x6227ed={};var _0x583b7e;var _0x2bf0c8;return db[_0xf667('0x32')][_0xf667('0x63')]({'where':{'id':_0x3294f8[_0xf667('0x4a')]['id']}})[_0xf667('0x29')](handleEntityNotFound(_0x1584bc,null))['then'](function(_0x3667d9){if(_0x3667d9){_0x583b7e=_0x3667d9;_0x6227ed['model']=_[_0xf667('0x37')](db[_0xf667('0x72')][_0xf667('0x4b')]);_0x6227ed[_0xf667('0x36')]=_[_0xf667('0x37')](_0x3294f8[_0xf667('0x36')]);_0x6227ed[_0xf667('0x3f')]=_['intersection'](_0x6227ed[_0xf667('0x3a')],_0x6227ed[_0xf667('0x36')]);_0x312427[_0xf667('0x38')]=_[_0xf667('0x39')](_0x6227ed['model'],qs[_0xf667('0x3b')](_0x3294f8['query']['fields']));_0x312427[_0xf667('0x38')]=_0x312427['attributes']['length']?_0x312427['attributes']:_0x6227ed['model'];_0x312427[_0xf667('0x58')]=qs[_0xf667('0x3d')](_0x3294f8['query'][_0xf667('0x3d')]);_0x312427[_0xf667('0x3e')]=qs['filters'](_[_0xf667('0x40')](_0x3294f8[_0xf667('0x36')],_0x6227ed['filters']));if(_0x3294f8['query'][_0xf667('0x41')]){_0x312427[_0xf667('0x3e')]=_[_0xf667('0x43')](_0x312427[_0xf667('0x3e')],{'$or':_[_0xf667('0x31')](_0x312427['attributes'],function(_0x465501){var _0x9b98bd={};_0x9b98bd[_0x465501]={'$like':'%'+_0x3294f8['query'][_0xf667('0x41')]+'%'};return _0x9b98bd;})});}_0x312427=_[_0xf667('0x43')]({},_0x312427,_0x3294f8['options']);return _0x583b7e[_0xf667('0x8f')](_0x312427);}})[_0xf667('0x29')](function(_0x2a7d1c){if(_0x2a7d1c){_0x2bf0c8=_0x2a7d1c[_0xf667('0x4c')];if(!_0x3294f8[_0xf667('0x36')][_0xf667('0x57')](_0xf667('0x3c'))){_0x312427[_0xf667('0x23')]=qs[_0xf667('0x23')](_0x3294f8[_0xf667('0x36')]['limit']);_0x312427[_0xf667('0x24')]=qs['offset'](_0x3294f8[_0xf667('0x36')][_0xf667('0x24')]);}return _0x583b7e[_0xf667('0x8f')](_0x312427);}})[_0xf667('0x29')](function(_0x556757){if(_0x556757){return _0x556757?{'count':_0x2bf0c8,'rows':_0x556757}:null;}})[_0xf667('0x29')](respondWithResult(_0x1584bc,null))[_0xf667('0x49')](handleError(_0x1584bc,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 5a481c4..81bb0fb 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 _0x28e3=['../../mysqldb','save','update','emit','hasOwnProperty'];(function(_0x30f2a4,_0x370f19){var _0x5865ff=function(_0x15996c){while(--_0x15996c){_0x30f2a4['push'](_0x30f2a4['shift']());}};_0x5865ff(++_0x370f19);}(_0x28e3,0x1e5));var _0x328e=function(_0x2c1dcd,_0x350452){_0x2c1dcd=_0x2c1dcd-0x0;var _0x158ce5=_0x28e3[_0x2c1dcd];return _0x158ce5;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x328e('0x0'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x328e('0x1'),'afterUpdate':_0x328e('0x2'),'afterDestroy':'remove'};function emitEvent(_0xca702a){return function(_0x36ce66,_0x3bbd04,_0x2282f8){OpenchannelQueueEvents[_0x328e('0x3')](_0xca702a+':'+_0x36ce66['id'],_0x36ce66);OpenchannelQueueEvents[_0x328e('0x3')](_0xca702a,_0x36ce66);_0x2282f8(null);};}for(var e in events){if(events[_0x328e('0x4')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0xbaa7=['exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x104a84,_0x285970){var _0x4973ff=function(_0x5064e7){while(--_0x5064e7){_0x104a84['push'](_0x104a84['shift']());}};_0x4973ff(++_0x285970);}(_0xbaa7,0x133));var _0x7baa=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xbaa7[_0x23e7c1];return _0x1add43;};'use strict';var EventEmitter=require(_0x7baa('0x0'));var OpenchannelQueue=require(_0x7baa('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7baa('0x2'),'afterUpdate':_0x7baa('0x3'),'afterDestroy':_0x7baa('0x4')};function emitEvent(_0x4ceeec){return function(_0xec342d,_0x2e338a,_0x5a69d6){OpenchannelQueueEvents[_0x7baa('0x5')](_0x4ceeec+':'+_0xec342d['id'],_0xec342d);OpenchannelQueueEvents[_0x7baa('0x5')](_0x4ceeec,_0xec342d);_0x5a69d6(null);};}for(var e in events){if(events[_0x7baa('0x6')](e)){var event=events[e];OpenchannelQueue[_0x7baa('0x7')](e,emitEvent(event));}}module[_0x7baa('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 33b99e8..8c3dcfe 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 _0xdba5=['request-promise','path','rimraf','../../config/environment','exports','openchannel_queues','lodash','util','../../config/logger','api'];(function(_0x32bfeb,_0x38110d){var _0x316d4c=function(_0x52e533){while(--_0x52e533){_0x32bfeb['push'](_0x32bfeb['shift']());}};_0x316d4c(++_0x38110d);}(_0xdba5,0xce));var _0x5dba=function(_0x3774c7,_0x361f2b){_0x3774c7=_0x3774c7-0x0;var _0x1db61e=_0xdba5[_0x3774c7];return _0x1db61e;};'use strict';var _=require(_0x5dba('0x0'));var util=require(_0x5dba('0x1'));var logger=require(_0x5dba('0x2'))(_0x5dba('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5dba('0x4'));var fs=require('fs');var path=require(_0x5dba('0x5'));var rimraf=require(_0x5dba('0x6'));var config=require(_0x5dba('0x7'));var attributes=require('./openchannelQueue.attributes');module[_0x5dba('0x8')]=function(_0x912ad,_0x5d1eee){return _0x912ad['define']('OpenchannelQueue',attributes,{'tableName':_0x5dba('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xca9c=['rimraf','../../config/environment','./openchannelQueue.attributes','OpenchannelQueue','openchannel_queues','util','../../config/logger','moment','bluebird','path'];(function(_0xa060e7,_0x15768f){var _0x15b6c5=function(_0x4420f4){while(--_0x4420f4){_0xa060e7['push'](_0xa060e7['shift']());}};_0x15b6c5(++_0x15768f);}(_0xca9c,0xcd));var _0xcca9=function(_0x29e619,_0x24044e){_0x29e619=_0x29e619-0x0;var _0x2ba225=_0xca9c[_0x29e619];return _0x2ba225;};'use strict';var _=require('lodash');var util=require(_0xcca9('0x0'));var logger=require(_0xcca9('0x1'))('api');var moment=require(_0xcca9('0x2'));var BPromise=require(_0xcca9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcca9('0x4'));var rimraf=require(_0xcca9('0x5'));var config=require(_0xcca9('0x6'));var attributes=require(_0xcca9('0x7'));module['exports']=function(_0x3b92ce,_0x595653){return _0x3b92ce['define'](_0xcca9('0x8'),attributes,{'tableName':_0xcca9('0x9'),'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 a94f912..da0f0ab 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 _0x9d26=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','register','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','include','map','model','ShowOpenchannelQueue','find'];(function(_0x860912,_0x280fab){var _0x4db5be=function(_0x316e3f){while(--_0x316e3f){_0x860912['push'](_0x860912['shift']());}};_0x4db5be(++_0x280fab);}(_0x9d26,0x1b0));var _0x69d2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9d26[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x69d2('0x0'));var BPromise=require(_0x69d2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x69d2('0x2'));var db=require(_0x69d2('0x3'))['db'];var utils=require(_0x69d2('0x4'));var logger=require(_0x69d2('0x5'))(_0x69d2('0x6'));var config=require(_0x69d2('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x69d2('0x8')]({'port':0x232a});config[_0x69d2('0x9')]=_[_0x69d2('0xa')](config[_0x69d2('0x9')],{'host':_0x69d2('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelQueue.socket')[_0x69d2('0xc')](socket);function respondWithRpcPromise(_0x347299,_0x409038,_0x575699){return new BPromise(function(_0x3fdee4,_0x1abb2c){return client['request'](_0x347299,_0x575699)[_0x69d2('0xd')](function(_0x7ce4ce){logger[_0x69d2('0xe')](_0x69d2('0xf'),_0x409038,_0x69d2('0x10'));logger[_0x69d2('0x11')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x409038,_0x69d2('0x10'),JSON[_0x69d2('0x12')](_0x7ce4ce));if(_0x7ce4ce[_0x69d2('0x13')]){if(_0x7ce4ce[_0x69d2('0x13')][_0x69d2('0x14')]===0x1f4){logger[_0x69d2('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x409038,_0x7ce4ce[_0x69d2('0x13')][_0x69d2('0x15')]);return _0x1abb2c(_0x7ce4ce[_0x69d2('0x13')][_0x69d2('0x15')]);}logger[_0x69d2('0x13')](_0x69d2('0xf'),_0x409038,_0x7ce4ce[_0x69d2('0x13')]['message']);return _0x3fdee4(_0x7ce4ce['error'][_0x69d2('0x15')]);}else{logger[_0x69d2('0xe')]('OpenchannelQueue,\x20%s,\x20%s',_0x409038,'request\x20sent');_0x3fdee4(_0x7ce4ce[_0x69d2('0x16')][_0x69d2('0x15')]);}})[_0x69d2('0x17')](function(_0x356c7e){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x409038,_0x356c7e);_0x1abb2c(_0x356c7e);});});}exports[_0x69d2('0x18')]=function(_0x3dee21){var _0x3fae74=this;return new Promise(function(_0x5e23bb,_0x27a4a1){return db[_0x69d2('0x19')][_0x69d2('0x1a')]({'raw':_0x3dee21[_0x69d2('0x1b')]?_0x3dee21[_0x69d2('0x1b')][_0x69d2('0x1c')]===undefined?!![]:![]:!![],'where':_0x3dee21[_0x69d2('0x1b')]?_0x3dee21[_0x69d2('0x1b')][_0x69d2('0x1d')]||null:null,'attributes':_0x3dee21[_0x69d2('0x1b')]?_0x3dee21['options'][_0x69d2('0x1e')]||null:null,'limit':_0x3dee21[_0x69d2('0x1b')]?_0x3dee21[_0x69d2('0x1b')]['limit']||null:null,'include':_0x3dee21[_0x69d2('0x1b')]?_0x3dee21[_0x69d2('0x1b')][_0x69d2('0x1f')]?_['map'](_0x3dee21['options'][_0x69d2('0x1f')],function(_0x2a1251){return{'model':db[_0x2a1251['model']],'as':_0x2a1251['as'],'attributes':_0x2a1251[_0x69d2('0x1e')],'include':_0x2a1251[_0x69d2('0x1f')]?_[_0x69d2('0x20')](_0x2a1251[_0x69d2('0x1f')],function(_0x22f08b){return{'model':db[_0x22f08b['model']],'as':_0x22f08b['as'],'attributes':_0x22f08b[_0x69d2('0x1e')],'include':_0x22f08b[_0x69d2('0x1f')]?_[_0x69d2('0x20')](_0x22f08b[_0x69d2('0x1f')],function(_0x30e967){return{'model':db[_0x30e967[_0x69d2('0x21')]],'as':_0x30e967['as'],'attributes':_0x30e967[_0x69d2('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x69d2('0xd')](function(_0x2943eb){logger[_0x69d2('0xe')](_0x69d2('0x18'),_0x3dee21);logger[_0x69d2('0x11')]('GetOpenchannelQueue',_0x3dee21,JSON[_0x69d2('0x12')](_0x2943eb));_0x5e23bb(_0x2943eb);})['catch'](function(_0x2de449){logger[_0x69d2('0x13')](_0x69d2('0x18'),_0x2de449[_0x69d2('0x15')],_0x3dee21);_0x27a4a1(_0x3fae74[_0x69d2('0x13')](0x1f4,_0x2de449[_0x69d2('0x15')]));});});};exports[_0x69d2('0x22')]=function(_0x4e16ab){var _0x26f248=this;return new Promise(function(_0x2d2ce7,_0x231296){return db[_0x69d2('0x19')][_0x69d2('0x23')]({'raw':_0x4e16ab['options']?_0x4e16ab[_0x69d2('0x1b')][_0x69d2('0x1c')]===undefined?!![]:![]:!![],'where':_0x4e16ab[_0x69d2('0x1b')]?_0x4e16ab[_0x69d2('0x1b')]['where']||null:null,'attributes':_0x4e16ab[_0x69d2('0x1b')]?_0x4e16ab[_0x69d2('0x1b')]['attributes']||null:null,'include':_0x4e16ab[_0x69d2('0x1b')]?_0x4e16ab[_0x69d2('0x1b')][_0x69d2('0x1f')]?_[_0x69d2('0x20')](_0x4e16ab['options'][_0x69d2('0x1f')],function(_0x3b273a){return{'model':db[_0x3b273a[_0x69d2('0x21')]],'as':_0x3b273a['as'],'attributes':_0x3b273a[_0x69d2('0x1e')],'include':_0x3b273a['include']?_[_0x69d2('0x20')](_0x3b273a['include'],function(_0x4853a7){return{'model':db[_0x4853a7[_0x69d2('0x21')]],'as':_0x4853a7['as'],'attributes':_0x4853a7[_0x69d2('0x1e')],'include':_0x4853a7[_0x69d2('0x1f')]?_[_0x69d2('0x20')](_0x4853a7[_0x69d2('0x1f')],function(_0x3b25a7){return{'model':db[_0x3b25a7['model']],'as':_0x3b25a7['as'],'attributes':_0x3b25a7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x53235e){logger[_0x69d2('0xe')]('ShowOpenchannelQueue',_0x4e16ab);logger[_0x69d2('0x11')](_0x69d2('0x22'),_0x4e16ab,JSON['stringify'](_0x53235e));_0x2d2ce7(_0x53235e);})['catch'](function(_0x1f1de4){logger[_0x69d2('0x13')](_0x69d2('0x22'),_0x1f1de4[_0x69d2('0x15')],_0x4e16ab);_0x231296(_0x26f248[_0x69d2('0x13')](0x1f4,_0x1f1de4[_0x69d2('0x15')]));});});}; \ No newline at end of file +var _0x6b79=['localhost','socket.io-emitter','./openchannelQueue.socket','request','then','info','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','OpenchannelQueue,\x20%s,\x20%s','result','catch','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetOpenchannelQueue','ShowOpenchannelQueue','debug','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x6b79,0x8d));var _0x96b7=function(_0x258fa2,_0x4cbb97){_0x258fa2=_0x258fa2-0x0;var _0x314057=_0x6b79[_0x258fa2];return _0x314057;};'use strict';var _=require(_0x96b7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x96b7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x96b7('0x2'));var db=require(_0x96b7('0x3'))['db'];var utils=require(_0x96b7('0x4'));var logger=require('../../config/logger')(_0x96b7('0x5'));var config=require(_0x96b7('0x6'));var jayson=require(_0x96b7('0x7'));var client=jayson[_0x96b7('0x8')]['http']({'port':0x232a});config[_0x96b7('0x9')]=_[_0x96b7('0xa')](config['redis'],{'host':_0x96b7('0xb'),'port':0x18eb});var socket=require(_0x96b7('0xc'))(new Redis(config[_0x96b7('0x9')]));require(_0x96b7('0xd'))['register'](socket);function respondWithRpcPromise(_0x3fe03b,_0x3796a7,_0x330e7b){return new BPromise(function(_0x4df1be,_0x581f27){return client[_0x96b7('0xe')](_0x3fe03b,_0x330e7b)[_0x96b7('0xf')](function(_0x55f63e){logger[_0x96b7('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x3796a7,_0x96b7('0x11'));logger['debug'](_0x96b7('0x12'),_0x3796a7,_0x96b7('0x11'),JSON['stringify'](_0x55f63e));if(_0x55f63e[_0x96b7('0x13')]){if(_0x55f63e[_0x96b7('0x13')][_0x96b7('0x14')]===0x1f4){logger[_0x96b7('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x3796a7,_0x55f63e['error']['message']);return _0x581f27(_0x55f63e[_0x96b7('0x13')][_0x96b7('0x15')]);}logger[_0x96b7('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x3796a7,_0x55f63e['error'][_0x96b7('0x15')]);return _0x4df1be(_0x55f63e['error'][_0x96b7('0x15')]);}else{logger[_0x96b7('0x10')](_0x96b7('0x16'),_0x3796a7,'request\x20sent');_0x4df1be(_0x55f63e[_0x96b7('0x17')][_0x96b7('0x15')]);}})[_0x96b7('0x18')](function(_0x13f636){logger['error'](_0x96b7('0x16'),_0x3796a7,_0x13f636);_0x581f27(_0x13f636);});});}exports['GetOpenchannelQueue']=function(_0x5ca5a0){var _0x4f6b39=this;return new Promise(function(_0x74905e,_0x2d489c){return db[_0x96b7('0x19')][_0x96b7('0x1a')]({'raw':_0x5ca5a0[_0x96b7('0x1b')]?_0x5ca5a0['options'][_0x96b7('0x1c')]===undefined?!![]:![]:!![],'where':_0x5ca5a0['options']?_0x5ca5a0[_0x96b7('0x1b')][_0x96b7('0x1d')]||null:null,'attributes':_0x5ca5a0['options']?_0x5ca5a0[_0x96b7('0x1b')][_0x96b7('0x1e')]||null:null,'limit':_0x5ca5a0[_0x96b7('0x1b')]?_0x5ca5a0[_0x96b7('0x1b')][_0x96b7('0x1f')]||null:null,'include':_0x5ca5a0[_0x96b7('0x1b')]?_0x5ca5a0['options'][_0x96b7('0x20')]?_[_0x96b7('0x21')](_0x5ca5a0['options']['include'],function(_0x1eda30){return{'model':db[_0x1eda30['model']],'as':_0x1eda30['as'],'attributes':_0x1eda30[_0x96b7('0x1e')],'include':_0x1eda30['include']?_[_0x96b7('0x21')](_0x1eda30['include'],function(_0x2f77ef){return{'model':db[_0x2f77ef[_0x96b7('0x22')]],'as':_0x2f77ef['as'],'attributes':_0x2f77ef[_0x96b7('0x1e')],'include':_0x2f77ef[_0x96b7('0x20')]?_[_0x96b7('0x21')](_0x2f77ef['include'],function(_0x227d56){return{'model':db[_0x227d56[_0x96b7('0x22')]],'as':_0x227d56['as'],'attributes':_0x227d56[_0x96b7('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x96b7('0xf')](function(_0x1b84c9){logger[_0x96b7('0x10')]('GetOpenchannelQueue',_0x5ca5a0);logger['debug'](_0x96b7('0x23'),_0x5ca5a0,JSON['stringify'](_0x1b84c9));_0x74905e(_0x1b84c9);})[_0x96b7('0x18')](function(_0x519ab3){logger[_0x96b7('0x13')]('GetOpenchannelQueue',_0x519ab3[_0x96b7('0x15')],_0x5ca5a0);_0x2d489c(_0x4f6b39['error'](0x1f4,_0x519ab3['message']));});});};exports['ShowOpenchannelQueue']=function(_0x43f069){var _0x5dc7af=this;return new Promise(function(_0x4daa19,_0x2a5036){return db[_0x96b7('0x19')]['find']({'raw':_0x43f069['options']?_0x43f069['options'][_0x96b7('0x1c')]===undefined?!![]:![]:!![],'where':_0x43f069['options']?_0x43f069[_0x96b7('0x1b')]['where']||null:null,'attributes':_0x43f069[_0x96b7('0x1b')]?_0x43f069[_0x96b7('0x1b')][_0x96b7('0x1e')]||null:null,'include':_0x43f069[_0x96b7('0x1b')]?_0x43f069['options']['include']?_[_0x96b7('0x21')](_0x43f069[_0x96b7('0x1b')]['include'],function(_0x3b1584){return{'model':db[_0x3b1584[_0x96b7('0x22')]],'as':_0x3b1584['as'],'attributes':_0x3b1584[_0x96b7('0x1e')],'include':_0x3b1584['include']?_[_0x96b7('0x21')](_0x3b1584['include'],function(_0x483a87){return{'model':db[_0x483a87['model']],'as':_0x483a87['as'],'attributes':_0x483a87['attributes'],'include':_0x483a87['include']?_[_0x96b7('0x21')](_0x483a87[_0x96b7('0x20')],function(_0x1485e8){return{'model':db[_0x1485e8[_0x96b7('0x22')]],'as':_0x1485e8['as'],'attributes':_0x1485e8[_0x96b7('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2bf551){logger['info'](_0x96b7('0x24'),_0x43f069);logger[_0x96b7('0x25')](_0x96b7('0x24'),_0x43f069,JSON['stringify'](_0x2bf551));_0x4daa19(_0x2bf551);})[_0x96b7('0x18')](function(_0x475b1e){logger['error'](_0x96b7('0x24'),_0x475b1e[_0x96b7('0x15')],_0x43f069);_0x2a5036(_0x5dc7af[_0x96b7('0x13')](0x1f4,_0x475b1e[_0x96b7('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 27594b6..dd39557 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 _0xad47=['update','emit','removeListener','register','openchannelQueue:','./openchannelQueue.events','save'];(function(_0x171fd5,_0x341d38){var _0x3a994f=function(_0x5390a4){while(--_0x5390a4){_0x171fd5['push'](_0x171fd5['shift']());}};_0x3a994f(++_0x341d38);}(_0xad47,0x108));var _0x7ad4=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0xad47[_0x220f3f];return _0x1f170e;};'use strict';var OpenchannelQueueEvents=require(_0x7ad4('0x0'));var events=[_0x7ad4('0x1'),'remove',_0x7ad4('0x2')];function createListener(_0x4462f0,_0x179101){return function(_0x232dca){_0x179101[_0x7ad4('0x3')](_0x4462f0,_0x232dca);};}function removeListener(_0x276db8,_0x40484b){return function(){OpenchannelQueueEvents[_0x7ad4('0x4')](_0x276db8,_0x40484b);};}exports[_0x7ad4('0x5')]=function(_0x35905b){for(var _0x3435d7=0x0,_0x5b5f71=events['length'];_0x3435d7<_0x5b5f71;_0x3435d7++){var _0x3a8c5d=events[_0x3435d7];var _0x501099=createListener(_0x7ad4('0x6')+_0x3a8c5d,_0x35905b);OpenchannelQueueEvents['on'](_0x3a8c5d,_0x501099);}}; \ No newline at end of file +var _0xeb1e=['save','remove','update','removeListener','register','./openchannelQueue.events'];(function(_0x5ef161,_0x27d16c){var _0x1c6e9e=function(_0x8fc2a6){while(--_0x8fc2a6){_0x5ef161['push'](_0x5ef161['shift']());}};_0x1c6e9e(++_0x27d16c);}(_0xeb1e,0xe3));var _0xeeb1=function(_0x3b3f2a,_0x1c0992){_0x3b3f2a=_0x3b3f2a-0x0;var _0x5f07a6=_0xeb1e[_0x3b3f2a];return _0x5f07a6;};'use strict';var OpenchannelQueueEvents=require(_0xeeb1('0x0'));var events=[_0xeeb1('0x1'),_0xeeb1('0x2'),_0xeeb1('0x3')];function createListener(_0x509f54,_0x32e3e6){return function(_0x654d80){_0x32e3e6['emit'](_0x509f54,_0x654d80);};}function removeListener(_0x5dc693,_0x5793c7){return function(){OpenchannelQueueEvents[_0xeeb1('0x4')](_0x5dc693,_0x5793c7);};}exports[_0xeeb1('0x5')]=function(_0x48f977){for(var _0x230fae=0x0,_0x5b21ea=events['length'];_0x230fae<_0x5b21ea;_0x230fae++){var _0xbcde39=events[_0x230fae];var _0x1e8859=createListener('openchannelQueue:'+_0xbcde39,_0x48f977);OpenchannelQueueEvents['on'](_0xbcde39,_0x1e8859);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 48ed021..80f040d 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 _0x6842=['./openchannelQueueReport.controller','isAuthenticated','index','/describe','get','/:id','post','create','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x21e069,_0x5e0e76){var _0x1d8360=function(_0x3917c8){while(--_0x3917c8){_0x21e069['push'](_0x21e069['shift']());}};_0x1d8360(++_0x5e0e76);}(_0x6842,0xf5));var _0x2684=function(_0x3b2de8,_0xb31cc0){_0x3b2de8=_0x3b2de8-0x0;var _0x120da7=_0x6842[_0x3b2de8];return _0x120da7;};'use strict';var multer=require(_0x2684('0x0'));var util=require(_0x2684('0x1'));var path=require(_0x2684('0x2'));var timeout=require(_0x2684('0x3'));var express=require('express');var router=express[_0x2684('0x4')]();var fs_extra=require(_0x2684('0x5'));var auth=require(_0x2684('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2684('0x7'));router['get']('/',auth[_0x2684('0x8')](),controller[_0x2684('0x9')]);router['get'](_0x2684('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x2684('0xb')](_0x2684('0xc'),auth[_0x2684('0x8')](),controller['show']);router[_0x2684('0xd')]('/',auth[_0x2684('0x8')](),controller[_0x2684('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x2684('0xf')]);router[_0x2684('0x10')](_0x2684('0xc'),auth[_0x2684('0x8')](),controller['destroy']);module[_0x2684('0x11')]=router; \ No newline at end of file +var _0x9fb9=['Router','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','express'];(function(_0x385beb,_0x47e000){var _0x592caa=function(_0x2e6ce8){while(--_0x2e6ce8){_0x385beb['push'](_0x385beb['shift']());}};_0x592caa(++_0x47e000);}(_0x9fb9,0x9c));var _0x99fb=function(_0x1f6871,_0x130ce9){_0x1f6871=_0x1f6871-0x0;var _0x46b04f=_0x9fb9[_0x1f6871];return _0x46b04f;};'use strict';var multer=require(_0x99fb('0x0'));var util=require(_0x99fb('0x1'));var path=require(_0x99fb('0x2'));var timeout=require('connect-timeout');var express=require(_0x99fb('0x3'));var router=express[_0x99fb('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x99fb('0x5'));var config=require(_0x99fb('0x6'));var controller=require(_0x99fb('0x7'));router[_0x99fb('0x8')]('/',auth[_0x99fb('0x9')](),controller['index']);router[_0x99fb('0x8')](_0x99fb('0xa'),auth[_0x99fb('0x9')](),controller[_0x99fb('0xb')]);router['get'](_0x99fb('0xc'),auth[_0x99fb('0x9')](),controller[_0x99fb('0xd')]);router[_0x99fb('0xe')]('/',auth[_0x99fb('0x9')](),controller[_0x99fb('0xf')]);router[_0x99fb('0x10')](_0x99fb('0xc'),auth[_0x99fb('0x9')](),controller[_0x99fb('0x11')]);router[_0x99fb('0x12')](_0x99fb('0xc'),auth[_0x99fb('0x9')](),controller[_0x99fb('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 3746722..8ef4edf 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 _0x0d53=['exports','DATE','moment','sequelize'];(function(_0x345dde,_0x586019){var _0x28f8e3=function(_0xa26541){while(--_0xa26541){_0x345dde['push'](_0x345dde['shift']());}};_0x28f8e3(++_0x586019);}(_0x0d53,0x10e));var _0x30d5=function(_0x34910f,_0x5f43a7){_0x34910f=_0x34910f-0x0;var _0x240d99=_0x0d53[_0x34910f];return _0x240d99;};'use strict';var moment=require(_0x30d5('0x0'));var Sequelize=require(_0x30d5('0x1'));module[_0x30d5('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x30d5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x30d5('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb647=['sequelize','exports','STRING','DATE','moment'];(function(_0x2c78c7,_0x311aad){var _0x578601=function(_0x557cff){while(--_0x557cff){_0x2c78c7['push'](_0x2c78c7['shift']());}};_0x578601(++_0x311aad);}(_0xb647,0xdb));var _0x7b64=function(_0x595158,_0x54de31){_0x595158=_0x595158-0x0;var _0x45cff7=_0xb647[_0x595158];return _0x45cff7;};'use strict';var moment=require(_0x7b64('0x0'));var Sequelize=require(_0x7b64('0x1'));module[_0x7b64('0x2')]={'uniqueid':{'type':Sequelize[_0x7b64('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x7b64('0x3')]},'joinAt':{'type':Sequelize[_0x7b64('0x4')]},'leaveAt':{'type':Sequelize[_0x7b64('0x4')]},'acceptAt':{'type':Sequelize[_0x7b64('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x7b64('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 6416b03..1df4d4f 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 _0x65ef=['jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','map','OpenchannelQueueReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','update','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x53ae7b,_0x506c1a){var _0x18212c=function(_0x3f1a56){while(--_0x3f1a56){_0x53ae7b['push'](_0x53ae7b['shift']());}};_0x18212c(++_0x506c1a);}(_0x65ef,0x1bc));var _0xf65e=function(_0x5478d2,_0x263a10){_0x5478d2=_0x5478d2-0x0;var _0x37ed95=_0x65ef[_0x5478d2];return _0x37ed95;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf65e('0x0'));var zipdir=require(_0xf65e('0x1'));var jsonpatch=require(_0xf65e('0x2'));var rp=require(_0xf65e('0x3'));var moment=require('moment');var BPromise=require(_0xf65e('0x4'));var Mustache=require(_0xf65e('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xf65e('0x6'));var ejs=require(_0xf65e('0x7'));var fs=require('fs');var fs_extra=require(_0xf65e('0x8'));var _=require(_0xf65e('0x9'));var squel=require(_0xf65e('0xa'));var crypto=require(_0xf65e('0xb'));var jsforce=require(_0xf65e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf65e('0xd'));var Papa=require(_0xf65e('0xe'));var Redis=require(_0xf65e('0xf'));var authService=require(_0xf65e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf65e('0x11'));var hardwareService=require(_0xf65e('0x12'));var logger=require(_0xf65e('0x13'))(_0xf65e('0x14'));var utils=require(_0xf65e('0x15'));var config=require(_0xf65e('0x16'));var licenseUtil=require(_0xf65e('0x17'));var db=require(_0xf65e('0x18'))['db'];function respondWithStatusCode(_0x444f05,_0x5a3e97){_0x5a3e97=_0x5a3e97||0xcc;return function(_0x2f51da){if(_0x2f51da){return _0x444f05['sendStatus'](_0x5a3e97);}return _0x444f05[_0xf65e('0x19')](_0x5a3e97)['end']();};}function respondWithResult(_0x1163ed,_0x504ea9){_0x504ea9=_0x504ea9||0xc8;return function(_0x44219e){if(_0x44219e){return _0x1163ed[_0xf65e('0x19')](_0x504ea9)['json'](_0x44219e);}};}function respondWithFilteredResult(_0x13a124,_0x5c6077){return function(_0x87e0bc){if(_0x87e0bc){var _0x592a5e=typeof _0x5c6077[_0xf65e('0x1a')]===_0xf65e('0x1b')&&typeof _0x5c6077[_0xf65e('0x1c')]===_0xf65e('0x1b');var _0x31d841=_0x87e0bc[_0xf65e('0x1d')];var _0x2438d9=_0x592a5e?0x0:_0x5c6077[_0xf65e('0x1a')];var _0x352e3e=_0x592a5e?_0x87e0bc[_0xf65e('0x1d')]:_0x5c6077[_0xf65e('0x1a')]+_0x5c6077['limit'];var _0x8a7c1e;if(_0x352e3e>=_0x31d841){_0x352e3e=_0x31d841;_0x8a7c1e=0xc8;}else{_0x8a7c1e=0xce;}_0x13a124[_0xf65e('0x19')](_0x8a7c1e);return _0x13a124[_0xf65e('0x1e')](_0xf65e('0x1f'),_0x2438d9+'-'+_0x352e3e+'/'+_0x31d841)['json'](_0x87e0bc);}return null;};}function patchUpdates(_0x43677e){return function(_0x34c92a){try{jsonpatch['apply'](_0x34c92a,_0x43677e,!![]);}catch(_0x5e4d6d){return BPromise[_0xf65e('0x20')](_0x5e4d6d);}return _0x34c92a[_0xf65e('0x21')]();};}function saveUpdates(_0x5ce121,_0x17c3ae){return function(_0x36cc35){if(_0x36cc35){return _0x36cc35['update'](_0x5ce121)[_0xf65e('0x22')](function(_0x11d760){return _0x11d760;});}return null;};}function removeEntity(_0xe98cb,_0xa1580d){return function(_0x5bf162){if(_0x5bf162){return _0x5bf162[_0xf65e('0x23')]()[_0xf65e('0x22')](function(){_0xe98cb[_0xf65e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1785bb,_0x302835){return function(_0x4202ed){if(!_0x4202ed){_0x1785bb[_0xf65e('0x24')](0x194);}return _0x4202ed;};}function handleError(_0x442b24,_0x6ab813){_0x6ab813=_0x6ab813||0x1f4;return function(_0x3f06d7){logger[_0xf65e('0x25')](_0x3f06d7[_0xf65e('0x26')]);if(_0x3f06d7[_0xf65e('0x27')]){delete _0x3f06d7[_0xf65e('0x27')];}_0x442b24['status'](_0x6ab813)['send'](_0x3f06d7);};}exports['index']=function(_0x1b2d69,_0x1a184a){var _0x2757e5={},_0x4af3d3={},_0x5b8785={'count':0x0,'rows':[]};var _0x27fc11=_[_0xf65e('0x28')](db[_0xf65e('0x29')][_0xf65e('0x2a')],function(_0x86847b){return{'name':_0x86847b[_0xf65e('0x2b')],'type':_0x86847b['type'][_0xf65e('0x2c')]};});_0x4af3d3[_0xf65e('0x2d')]=_[_0xf65e('0x28')](_0x27fc11,_0xf65e('0x27'));_0x4af3d3['query']=_[_0xf65e('0x2e')](_0x1b2d69[_0xf65e('0x2f')]);_0x4af3d3[_0xf65e('0x30')]=_[_0xf65e('0x31')](_0x4af3d3[_0xf65e('0x2d')],_0x4af3d3[_0xf65e('0x2f')]);_0x2757e5[_0xf65e('0x32')]=_[_0xf65e('0x31')](_0x4af3d3[_0xf65e('0x2d')],qs[_0xf65e('0x33')](_0x1b2d69['query'][_0xf65e('0x33')]));_0x2757e5['attributes']=_0x2757e5[_0xf65e('0x32')][_0xf65e('0x34')]?_0x2757e5[_0xf65e('0x32')]:_0x4af3d3[_0xf65e('0x2d')];if(!_0x1b2d69['query'][_0xf65e('0x35')](_0xf65e('0x36'))){_0x2757e5[_0xf65e('0x1c')]=qs[_0xf65e('0x1c')](_0x1b2d69[_0xf65e('0x2f')][_0xf65e('0x1c')]);_0x2757e5[_0xf65e('0x1a')]=qs[_0xf65e('0x1a')](_0x1b2d69['query'][_0xf65e('0x1a')]);}_0x2757e5[_0xf65e('0x37')]=qs[_0xf65e('0x38')](_0x1b2d69[_0xf65e('0x2f')][_0xf65e('0x38')]);_0x2757e5[_0xf65e('0x39')]=qs[_0xf65e('0x30')](_[_0xf65e('0x3a')](_0x1b2d69[_0xf65e('0x2f')],_0x4af3d3['filters']),_0x27fc11);if(_0x1b2d69[_0xf65e('0x2f')][_0xf65e('0x3b')]){_0x2757e5[_0xf65e('0x39')]=_[_0xf65e('0x3c')](_0x2757e5[_0xf65e('0x39')],{'$or':_['map'](_0x27fc11,function(_0x2ca591){if(_0x2ca591[_0xf65e('0x3d')]!==_0xf65e('0x3e')){var _0x4f8e42={};_0x4f8e42[_0x2ca591['name']]={'$like':'%'+_0x1b2d69[_0xf65e('0x2f')][_0xf65e('0x3b')]+'%'};return _0x4f8e42;}})});}_0x2757e5=_[_0xf65e('0x3c')]({},_0x2757e5,_0x1b2d69[_0xf65e('0x3f')]);var _0x97b73d={'where':_0x2757e5[_0xf65e('0x39')]};return db[_0xf65e('0x29')][_0xf65e('0x1d')](_0x97b73d)[_0xf65e('0x22')](function(_0x5538e1){_0x5b8785[_0xf65e('0x1d')]=_0x5538e1;if(_0x1b2d69[_0xf65e('0x2f')][_0xf65e('0x40')]){_0x2757e5[_0xf65e('0x41')]=[{'all':!![]}];}return db[_0xf65e('0x29')][_0xf65e('0x42')](_0x2757e5);})[_0xf65e('0x22')](function(_0xf0286d){_0x5b8785[_0xf65e('0x43')]=_0xf0286d;return _0x5b8785;})[_0xf65e('0x22')](respondWithFilteredResult(_0x1a184a,_0x2757e5))['catch'](handleError(_0x1a184a,null));};exports[_0xf65e('0x44')]=function(_0x4e710b,_0x477a7c){var _0x5159a7={'raw':!![],'where':{'id':_0x4e710b[_0xf65e('0x45')]['id']}},_0x733dca={};_0x733dca[_0xf65e('0x2d')]=_[_0xf65e('0x2e')](db[_0xf65e('0x29')]['rawAttributes']);_0x733dca[_0xf65e('0x2f')]=_['keys'](_0x4e710b[_0xf65e('0x2f')]);_0x733dca['filters']=_['intersection'](_0x733dca['model'],_0x733dca['query']);_0x5159a7[_0xf65e('0x32')]=_[_0xf65e('0x31')](_0x733dca[_0xf65e('0x2d')],qs[_0xf65e('0x33')](_0x4e710b[_0xf65e('0x2f')][_0xf65e('0x33')]));_0x5159a7[_0xf65e('0x32')]=_0x5159a7[_0xf65e('0x32')][_0xf65e('0x34')]?_0x5159a7[_0xf65e('0x32')]:_0x733dca[_0xf65e('0x2d')];if(_0x4e710b['query'][_0xf65e('0x40')]){_0x5159a7[_0xf65e('0x41')]=[{'all':!![]}];}_0x5159a7=_[_0xf65e('0x3c')]({},_0x5159a7,_0x4e710b[_0xf65e('0x3f')]);return db[_0xf65e('0x29')][_0xf65e('0x46')](_0x5159a7)[_0xf65e('0x22')](handleEntityNotFound(_0x477a7c,null))[_0xf65e('0x22')](respondWithResult(_0x477a7c,null))[_0xf65e('0x47')](handleError(_0x477a7c,null));};exports[_0xf65e('0x48')]=function(_0x4b25dc,_0x26dd82){return db[_0xf65e('0x29')][_0xf65e('0x48')](_0x4b25dc['body'],{})[_0xf65e('0x22')](respondWithResult(_0x26dd82,0xc9))[_0xf65e('0x47')](handleError(_0x26dd82,null));};exports[_0xf65e('0x49')]=function(_0x4ef892,_0x452777){if(_0x4ef892[_0xf65e('0x4a')]['id']){delete _0x4ef892['body']['id'];}return db[_0xf65e('0x29')]['find']({'where':{'id':_0x4ef892[_0xf65e('0x45')]['id']}})[_0xf65e('0x22')](handleEntityNotFound(_0x452777,null))[_0xf65e('0x22')](saveUpdates(_0x4ef892[_0xf65e('0x4a')],null))['then'](respondWithResult(_0x452777,null))[_0xf65e('0x47')](handleError(_0x452777,null));};exports[_0xf65e('0x23')]=function(_0x41f0a1,_0x3976ec){return db['OpenchannelQueueReport'][_0xf65e('0x46')]({'where':{'id':_0x41f0a1[_0xf65e('0x45')]['id']}})[_0xf65e('0x22')](handleEntityNotFound(_0x3976ec,null))['then'](removeEntity(_0x3976ec,null))['catch'](handleError(_0x3976ec,null));};exports[_0xf65e('0x4b')]=function(_0x537b64,_0x719e0e){return db[_0xf65e('0x29')]['describe']()[_0xf65e('0x22')](respondWithResult(_0x719e0e,null))[_0xf65e('0x47')](handleError(_0x719e0e,null));}; \ No newline at end of file +var _0x05a8=['VIRTUAL','options','include','findAll','catch','show','params','keys','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','end','json','offset','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge'];(function(_0x26e3b5,_0x3724ee){var _0x620ae4=function(_0x27f371){while(--_0x27f371){_0x26e3b5['push'](_0x26e3b5['shift']());}};_0x620ae4(++_0x3724ee);}(_0x05a8,0x12c));var _0x805a=function(_0x125d87,_0x29848b){_0x125d87=_0x125d87-0x0;var _0x57a9ba=_0x05a8[_0x125d87];return _0x57a9ba;};'use strict';var emlformat=require(_0x805a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x805a('0x1'));var jsonpatch=require(_0x805a('0x2'));var rp=require(_0x805a('0x3'));var moment=require(_0x805a('0x4'));var BPromise=require(_0x805a('0x5'));var Mustache=require(_0x805a('0x6'));var util=require('util');var path=require(_0x805a('0x7'));var sox=require(_0x805a('0x8'));var csv=require(_0x805a('0x9'));var ejs=require(_0x805a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x805a('0xb'));var crypto=require(_0x805a('0xc'));var jsforce=require(_0x805a('0xd'));var deskjs=require(_0x805a('0xe'));var toCsv=require(_0x805a('0x9'));var querystring=require(_0x805a('0xf'));var Papa=require('papaparse');var Redis=require(_0x805a('0x10'));var authService=require(_0x805a('0x11'));var qs=require(_0x805a('0x12'));var as=require(_0x805a('0x13'));var hardwareService=require(_0x805a('0x14'));var logger=require(_0x805a('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x805a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x447cde,_0x223518){_0x223518=_0x223518||0xcc;return function(_0x487253){if(_0x487253){return _0x447cde[_0x805a('0x17')](_0x223518);}return _0x447cde['status'](_0x223518)[_0x805a('0x18')]();};}function respondWithResult(_0x372f24,_0xccadfd){_0xccadfd=_0xccadfd||0xc8;return function(_0x528423){if(_0x528423){return _0x372f24['status'](_0xccadfd)[_0x805a('0x19')](_0x528423);}};}function respondWithFilteredResult(_0x565f37,_0x4dd63b){return function(_0x149290){if(_0x149290){var _0x3e5ced=typeof _0x4dd63b[_0x805a('0x1a')]==='undefined'&&typeof _0x4dd63b[_0x805a('0x1b')]==='undefined';var _0x125409=_0x149290[_0x805a('0x1c')];var _0x5d8fb0=_0x3e5ced?0x0:_0x4dd63b[_0x805a('0x1a')];var _0x43bb17=_0x3e5ced?_0x149290[_0x805a('0x1c')]:_0x4dd63b[_0x805a('0x1a')]+_0x4dd63b[_0x805a('0x1b')];var _0x3858eb;if(_0x43bb17>=_0x125409){_0x43bb17=_0x125409;_0x3858eb=0xc8;}else{_0x3858eb=0xce;}_0x565f37[_0x805a('0x1d')](_0x3858eb);return _0x565f37[_0x805a('0x1e')](_0x805a('0x1f'),_0x5d8fb0+'-'+_0x43bb17+'/'+_0x125409)[_0x805a('0x19')](_0x149290);}return null;};}function patchUpdates(_0x5e62f2){return function(_0x5a27b0){try{jsonpatch[_0x805a('0x20')](_0x5a27b0,_0x5e62f2,!![]);}catch(_0x11e301){return BPromise[_0x805a('0x21')](_0x11e301);}return _0x5a27b0['save']();};}function saveUpdates(_0x4ef013,_0x4567ef){return function(_0x1c9191){if(_0x1c9191){return _0x1c9191[_0x805a('0x22')](_0x4ef013)[_0x805a('0x23')](function(_0x5f62fe){return _0x5f62fe;});}return null;};}function removeEntity(_0x2a0920,_0x3545f5){return function(_0x50296c){if(_0x50296c){return _0x50296c[_0x805a('0x24')]()[_0x805a('0x23')](function(){_0x2a0920['status'](0xcc)[_0x805a('0x18')]();});}};}function handleEntityNotFound(_0x1a17ca,_0x41ba92){return function(_0x7a9474){if(!_0x7a9474){_0x1a17ca[_0x805a('0x17')](0x194);}return _0x7a9474;};}function handleError(_0x4106d6,_0xddd479){_0xddd479=_0xddd479||0x1f4;return function(_0x2ed11b){logger[_0x805a('0x25')](_0x2ed11b['stack']);if(_0x2ed11b[_0x805a('0x26')]){delete _0x2ed11b[_0x805a('0x26')];}_0x4106d6['status'](_0xddd479)[_0x805a('0x27')](_0x2ed11b);};}exports[_0x805a('0x28')]=function(_0x424698,_0x254020){var _0xe4b965={},_0x4140b3={},_0x93a06d={'count':0x0,'rows':[]};var _0x2ba641=_[_0x805a('0x29')](db[_0x805a('0x2a')][_0x805a('0x2b')],function(_0x19ea3f){return{'name':_0x19ea3f[_0x805a('0x2c')],'type':_0x19ea3f[_0x805a('0x2d')][_0x805a('0x2e')]};});_0x4140b3['model']=_[_0x805a('0x29')](_0x2ba641,_0x805a('0x26'));_0x4140b3['query']=_['keys'](_0x424698[_0x805a('0x2f')]);_0x4140b3[_0x805a('0x30')]=_[_0x805a('0x31')](_0x4140b3[_0x805a('0x32')],_0x4140b3[_0x805a('0x2f')]);_0xe4b965[_0x805a('0x33')]=_[_0x805a('0x31')](_0x4140b3[_0x805a('0x32')],qs[_0x805a('0x34')](_0x424698[_0x805a('0x2f')][_0x805a('0x34')]));_0xe4b965['attributes']=_0xe4b965['attributes'][_0x805a('0x35')]?_0xe4b965[_0x805a('0x33')]:_0x4140b3['model'];if(!_0x424698[_0x805a('0x2f')]['hasOwnProperty'](_0x805a('0x36'))){_0xe4b965[_0x805a('0x1b')]=qs['limit'](_0x424698['query'][_0x805a('0x1b')]);_0xe4b965[_0x805a('0x1a')]=qs[_0x805a('0x1a')](_0x424698[_0x805a('0x2f')][_0x805a('0x1a')]);}_0xe4b965[_0x805a('0x37')]=qs[_0x805a('0x38')](_0x424698[_0x805a('0x2f')][_0x805a('0x38')]);_0xe4b965[_0x805a('0x39')]=qs['filters'](_['pick'](_0x424698[_0x805a('0x2f')],_0x4140b3[_0x805a('0x30')]),_0x2ba641);if(_0x424698['query'][_0x805a('0x3a')]){_0xe4b965[_0x805a('0x39')]=_[_0x805a('0x3b')](_0xe4b965[_0x805a('0x39')],{'$or':_[_0x805a('0x29')](_0x2ba641,function(_0x2de600){if(_0x2de600[_0x805a('0x2d')]!==_0x805a('0x3c')){var _0x2b9292={};_0x2b9292[_0x2de600['name']]={'$like':'%'+_0x424698['query']['filter']+'%'};return _0x2b9292;}})});}_0xe4b965=_[_0x805a('0x3b')]({},_0xe4b965,_0x424698[_0x805a('0x3d')]);var _0x2c31a6={'where':_0xe4b965[_0x805a('0x39')]};return db[_0x805a('0x2a')]['count'](_0x2c31a6)[_0x805a('0x23')](function(_0x386b1e){_0x93a06d[_0x805a('0x1c')]=_0x386b1e;if(_0x424698[_0x805a('0x2f')]['includeAll']){_0xe4b965[_0x805a('0x3e')]=[{'all':!![]}];}return db[_0x805a('0x2a')][_0x805a('0x3f')](_0xe4b965);})[_0x805a('0x23')](function(_0x4b9367){_0x93a06d['rows']=_0x4b9367;return _0x93a06d;})[_0x805a('0x23')](respondWithFilteredResult(_0x254020,_0xe4b965))[_0x805a('0x40')](handleError(_0x254020,null));};exports[_0x805a('0x41')]=function(_0x1d166a,_0x45dff7){var _0x256882={'raw':!![],'where':{'id':_0x1d166a[_0x805a('0x42')]['id']}},_0x48e208={};_0x48e208[_0x805a('0x32')]=_[_0x805a('0x43')](db[_0x805a('0x2a')][_0x805a('0x2b')]);_0x48e208[_0x805a('0x2f')]=_[_0x805a('0x43')](_0x1d166a[_0x805a('0x2f')]);_0x48e208[_0x805a('0x30')]=_[_0x805a('0x31')](_0x48e208[_0x805a('0x32')],_0x48e208[_0x805a('0x2f')]);_0x256882[_0x805a('0x33')]=_[_0x805a('0x31')](_0x48e208[_0x805a('0x32')],qs[_0x805a('0x34')](_0x1d166a[_0x805a('0x2f')][_0x805a('0x34')]));_0x256882[_0x805a('0x33')]=_0x256882[_0x805a('0x33')][_0x805a('0x35')]?_0x256882[_0x805a('0x33')]:_0x48e208[_0x805a('0x32')];if(_0x1d166a[_0x805a('0x2f')]['includeAll']){_0x256882[_0x805a('0x3e')]=[{'all':!![]}];}_0x256882=_['merge']({},_0x256882,_0x1d166a[_0x805a('0x3d')]);return db[_0x805a('0x2a')]['find'](_0x256882)[_0x805a('0x23')](handleEntityNotFound(_0x45dff7,null))['then'](respondWithResult(_0x45dff7,null))['catch'](handleError(_0x45dff7,null));};exports[_0x805a('0x44')]=function(_0x139e17,_0x4c1b3f){return db[_0x805a('0x2a')][_0x805a('0x44')](_0x139e17[_0x805a('0x45')],{})['then'](respondWithResult(_0x4c1b3f,0xc9))[_0x805a('0x40')](handleError(_0x4c1b3f,null));};exports[_0x805a('0x22')]=function(_0x48c8b7,_0x31519a){if(_0x48c8b7[_0x805a('0x45')]['id']){delete _0x48c8b7[_0x805a('0x45')]['id'];}return db[_0x805a('0x2a')]['find']({'where':{'id':_0x48c8b7[_0x805a('0x42')]['id']}})[_0x805a('0x23')](handleEntityNotFound(_0x31519a,null))[_0x805a('0x23')](saveUpdates(_0x48c8b7[_0x805a('0x45')],null))[_0x805a('0x23')](respondWithResult(_0x31519a,null))['catch'](handleError(_0x31519a,null));};exports[_0x805a('0x24')]=function(_0x1566ba,_0x4db63b){return db[_0x805a('0x2a')][_0x805a('0x46')]({'where':{'id':_0x1566ba[_0x805a('0x42')]['id']}})[_0x805a('0x23')](handleEntityNotFound(_0x4db63b,null))[_0x805a('0x23')](removeEntity(_0x4db63b,null))['catch'](handleError(_0x4db63b,null));};exports[_0x805a('0x47')]=function(_0x1b178a,_0x5eb699){return db[_0x805a('0x2a')]['describe']()[_0x805a('0x23')](respondWithResult(_0x5eb699,null))[_0x805a('0x40')](handleError(_0x5eb699,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 4d6f420..7724b65 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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x2cc0b3,_0x120bf1){var _0x1667ef=function(_0x3abcb4){while(--_0x3abcb4){_0x2cc0b3['push'](_0x2cc0b3['shift']());}};_0x1667ef(++_0x120bf1);}(_0x814b,0x1a2));var _0xb814=function(_0x3c3e72,_0x3e1858){_0x3c3e72=_0x3c3e72-0x0;var _0x48a7e5=_0x814b[_0x3c3e72];return _0x48a7e5;};'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 +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x49e489,_0x5dfd72){var _0x410430=function(_0x33e7a9){while(--_0x33e7a9){_0x49e489['push'](_0x49e489['shift']());}};_0x410430(++_0x5dfd72);}(_0x326f,0xd1));var _0xf326=function(_0x196791,_0x4763d6){_0x196791=_0x196791-0x0;var _0x4fb220=_0x326f[_0x196791];return _0x4fb220;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index cc29b73..e34d30e 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 _0x02a7=['raw','UpdateOpenchannelQueueReport','OpenchannelQueueReport','where','attributes','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','create','body','options'];(function(_0x1c289a,_0x277fe7){var _0x28d68e=function(_0x2f8e98){while(--_0x2f8e98){_0x1c289a['push'](_0x1c289a['shift']());}};_0x28d68e(++_0x277fe7);}(_0x02a7,0x1a6));var _0x702a=function(_0x53bfb1,_0x58db63){_0x53bfb1=_0x53bfb1-0x0;var _0x14605e=_0x02a7[_0x53bfb1];return _0x14605e;};'use strict';var _=require('lodash');var util=require(_0x702a('0x0'));var moment=require(_0x702a('0x1'));var BPromise=require(_0x702a('0x2'));var rs=require(_0x702a('0x3'));var fs=require('fs');var Redis=require(_0x702a('0x4'));var db=require(_0x702a('0x5'))['db'];var utils=require(_0x702a('0x6'));var logger=require(_0x702a('0x7'))(_0x702a('0x8'));var config=require(_0x702a('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x702a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b6736,_0x27bfc7,_0x3f5ff8){return new BPromise(function(_0x51bf52,_0x562fdb){return client['request'](_0x4b6736,_0x3f5ff8)['then'](function(_0x3cb569){logger[_0x702a('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x27bfc7,_0x702a('0xc'));logger[_0x702a('0xd')](_0x702a('0xe'),_0x27bfc7,_0x702a('0xc'),JSON[_0x702a('0xf')](_0x3cb569));if(_0x3cb569[_0x702a('0x10')]){if(_0x3cb569[_0x702a('0x10')][_0x702a('0x11')]===0x1f4){logger['error'](_0x702a('0x12'),_0x27bfc7,_0x3cb569[_0x702a('0x10')][_0x702a('0x13')]);return _0x562fdb(_0x3cb569[_0x702a('0x10')]['message']);}logger[_0x702a('0x10')](_0x702a('0x12'),_0x27bfc7,_0x3cb569[_0x702a('0x10')][_0x702a('0x13')]);return _0x51bf52(_0x3cb569[_0x702a('0x10')]['message']);}else{logger[_0x702a('0xb')](_0x702a('0x12'),_0x27bfc7,_0x702a('0xc'));_0x51bf52(_0x3cb569[_0x702a('0x14')][_0x702a('0x13')]);}})[_0x702a('0x15')](function(_0x451881){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x27bfc7,_0x451881);_0x562fdb(_0x451881);});});}exports[_0x702a('0x16')]=function(_0x340dc2){var _0x2071ad=this;return new Promise(function(_0x3d1550,_0x1885eb){return db['OpenchannelQueueReport'][_0x702a('0x17')](_0x340dc2[_0x702a('0x18')],{'raw':_0x340dc2[_0x702a('0x19')]?_0x340dc2[_0x702a('0x19')][_0x702a('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x5b2998){logger['info'](_0x702a('0x16'),_0x340dc2);logger['debug'](_0x702a('0x16'),_0x340dc2,JSON[_0x702a('0xf')](_0x5b2998));_0x3d1550(_0x5b2998);})['catch'](function(_0x2ca064){logger[_0x702a('0x10')](_0x702a('0x16'),_0x2ca064[_0x702a('0x13')],_0x340dc2);_0x1885eb(_0x2071ad[_0x702a('0x10')](0x1f4,_0x2ca064['message']));});});};exports[_0x702a('0x1b')]=function(_0x544be5){var _0x5e6cce=this;return new Promise(function(_0x57d897,_0xa2be1d){return db[_0x702a('0x1c')]['update'](_0x544be5[_0x702a('0x18')],{'raw':_0x544be5[_0x702a('0x19')]?_0x544be5[_0x702a('0x19')][_0x702a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x544be5[_0x702a('0x19')]?_0x544be5[_0x702a('0x19')][_0x702a('0x1d')]||null:null,'attributes':_0x544be5[_0x702a('0x19')]?_0x544be5[_0x702a('0x19')][_0x702a('0x1e')]||null:null,'limit':_0x544be5['options']?_0x544be5[_0x702a('0x19')]['limit']||null:null})[_0x702a('0x1f')](function(_0x51867d){logger[_0x702a('0xb')](_0x702a('0x1b'),_0x544be5);logger[_0x702a('0xd')]('UpdateOpenchannelQueueReport',_0x544be5,JSON[_0x702a('0xf')](_0x51867d));_0x57d897(_0x51867d);})[_0x702a('0x15')](function(_0x26e1d1){logger['error'](_0x702a('0x1b'),_0x26e1d1['message'],_0x544be5);_0xa2be1d(_0x5e6cce[_0x702a('0x10')](0x1f4,_0x26e1d1[_0x702a('0x13')]));});});}; \ No newline at end of file +var _0x82d8=['client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','create','body','options','raw','CreateOpenchannelQueueReport','stringify','OpenchannelQueueReport','attributes','UpdateOpenchannelQueueReport','lodash','moment','ioredis','../../config/utils','../../config/environment','jayson/promise'];(function(_0x53b7ee,_0x4cdace){var _0x2ce0d7=function(_0x46d78b){while(--_0x46d78b){_0x53b7ee['push'](_0x53b7ee['shift']());}};_0x2ce0d7(++_0x4cdace);}(_0x82d8,0xff));var _0x882d=function(_0x1f6454,_0x2abf63){_0x1f6454=_0x1f6454-0x0;var _0x542441=_0x82d8[_0x1f6454];return _0x542441;};'use strict';var _=require(_0x882d('0x0'));var util=require('util');var moment=require(_0x882d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x882d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x882d('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x882d('0x4'));var jayson=require(_0x882d('0x5'));var client=jayson[_0x882d('0x6')][_0x882d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xb7539b,_0x3c8b67,_0x4067a9){return new BPromise(function(_0x4ea710,_0x4035ba){return client[_0x882d('0x8')](_0xb7539b,_0x4067a9)[_0x882d('0x9')](function(_0x4da4aa){logger[_0x882d('0xa')](_0x882d('0xb'),_0x3c8b67,'request\x20sent');logger[_0x882d('0xc')](_0x882d('0xd'),_0x3c8b67,_0x882d('0xe'),JSON['stringify'](_0x4da4aa));if(_0x4da4aa[_0x882d('0xf')]){if(_0x4da4aa[_0x882d('0xf')][_0x882d('0x10')]===0x1f4){logger[_0x882d('0xf')](_0x882d('0xb'),_0x3c8b67,_0x4da4aa[_0x882d('0xf')][_0x882d('0x11')]);return _0x4035ba(_0x4da4aa['error']['message']);}logger[_0x882d('0xf')](_0x882d('0xb'),_0x3c8b67,_0x4da4aa[_0x882d('0xf')][_0x882d('0x11')]);return _0x4ea710(_0x4da4aa[_0x882d('0xf')]['message']);}else{logger[_0x882d('0xa')](_0x882d('0xb'),_0x3c8b67,_0x882d('0xe'));_0x4ea710(_0x4da4aa[_0x882d('0x12')][_0x882d('0x11')]);}})[_0x882d('0x13')](function(_0x46cfcc){logger[_0x882d('0xf')](_0x882d('0xb'),_0x3c8b67,_0x46cfcc);_0x4035ba(_0x46cfcc);});});}exports['CreateOpenchannelQueueReport']=function(_0x556b9b){var _0x33556b=this;return new Promise(function(_0x59aaec,_0x3e4cf5){return db['OpenchannelQueueReport'][_0x882d('0x14')](_0x556b9b[_0x882d('0x15')],{'raw':_0x556b9b[_0x882d('0x16')]?_0x556b9b['options'][_0x882d('0x17')]===undefined?!![]:![]:!![]})[_0x882d('0x9')](function(_0x14d709){logger['info'](_0x882d('0x18'),_0x556b9b);logger[_0x882d('0xc')](_0x882d('0x18'),_0x556b9b,JSON[_0x882d('0x19')](_0x14d709));_0x59aaec(_0x14d709);})[_0x882d('0x13')](function(_0x1a4a84){logger[_0x882d('0xf')](_0x882d('0x18'),_0x1a4a84[_0x882d('0x11')],_0x556b9b);_0x3e4cf5(_0x33556b['error'](0x1f4,_0x1a4a84[_0x882d('0x11')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x17ce48){var _0xb58bce=this;return new Promise(function(_0x233294,_0x217742){return db[_0x882d('0x1a')]['update'](_0x17ce48[_0x882d('0x15')],{'raw':_0x17ce48['options']?_0x17ce48[_0x882d('0x16')][_0x882d('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17ce48['options']?_0x17ce48['options']['where']||null:null,'attributes':_0x17ce48['options']?_0x17ce48[_0x882d('0x16')][_0x882d('0x1b')]||null:null,'limit':_0x17ce48[_0x882d('0x16')]?_0x17ce48[_0x882d('0x16')]['limit']||null:null})[_0x882d('0x9')](function(_0x18ece4){logger[_0x882d('0xa')](_0x882d('0x1c'),_0x17ce48);logger[_0x882d('0xc')]('UpdateOpenchannelQueueReport',_0x17ce48,JSON['stringify'](_0x18ece4));_0x233294(_0x18ece4);})['catch'](function(_0x40fea6){logger[_0x882d('0xf')](_0x882d('0x1c'),_0x40fea6['message'],_0x17ce48);_0x217742(_0xb58bce[_0x882d('0xf')](0x1f4,_0x40fea6[_0x882d('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 3d78398..abb04f1 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 _0x91b4=['get','isAuthenticated','index','/describe','/:id','show','post','create','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller'];(function(_0x293646,_0x8c515b){var _0x3418db=function(_0x5b195d){while(--_0x5b195d){_0x293646['push'](_0x293646['shift']());}};_0x3418db(++_0x8c515b);}(_0x91b4,0x14c));var _0x491b=function(_0x390e44,_0x156eab){_0x390e44=_0x390e44-0x0;var _0x31fbc1=_0x91b4[_0x390e44];return _0x31fbc1;};'use strict';var multer=require(_0x491b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x491b('0x1'));var express=require(_0x491b('0x2'));var router=express[_0x491b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x491b('0x4'));var interaction=require(_0x491b('0x5'));var config=require(_0x491b('0x6'));var controller=require(_0x491b('0x7'));router[_0x491b('0x8')]('/',auth[_0x491b('0x9')](),controller[_0x491b('0xa')]);router[_0x491b('0x8')](_0x491b('0xb'),auth[_0x491b('0x9')](),controller['describe']);router[_0x491b('0x8')](_0x491b('0xc'),auth['isAuthenticated'](),controller[_0x491b('0xd')]);router[_0x491b('0xe')]('/',auth['isAuthenticated'](),controller[_0x491b('0xf')]);router['put'](_0x491b('0xc'),auth[_0x491b('0x9')](),controller['update']);router['delete'](_0x491b('0xc'),auth[_0x491b('0x9')](),controller['destroy']);module[_0x491b('0x10')]=router; \ No newline at end of file +var _0x06be=['./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x233ea5,_0x3883a7){var _0x558f56=function(_0x1af7fe){while(--_0x1af7fe){_0x233ea5['push'](_0x233ea5['shift']());}};_0x558f56(++_0x3883a7);}(_0x06be,0x11e));var _0xe06b=function(_0x2abade,_0x513c2d){_0x2abade=_0x2abade-0x0;var _0x3e30e7=_0x06be[_0x2abade];return _0x3e30e7;};'use strict';var multer=require('multer');var util=require(_0xe06b('0x0'));var path=require(_0xe06b('0x1'));var timeout=require(_0xe06b('0x2'));var express=require(_0xe06b('0x3'));var router=express[_0xe06b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe06b('0x5'));var interaction=require(_0xe06b('0x6'));var config=require(_0xe06b('0x7'));var controller=require(_0xe06b('0x8'));router[_0xe06b('0x9')]('/',auth[_0xe06b('0xa')](),controller[_0xe06b('0xb')]);router[_0xe06b('0x9')](_0xe06b('0xc'),auth[_0xe06b('0xa')](),controller['describe']);router[_0xe06b('0x9')](_0xe06b('0xd'),auth['isAuthenticated'](),controller[_0xe06b('0xe')]);router[_0xe06b('0xf')]('/',auth['isAuthenticated'](),controller[_0xe06b('0x10')]);router[_0xe06b('0x11')](_0xe06b('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xe06b('0x12')]('/:id',auth[_0xe06b('0xa')](),controller[_0xe06b('0x13')]);module[_0xe06b('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 74a0956..3c30181 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x56bc6f,_0x17f258){var _0x5e9998=function(_0x121674){while(--_0x121674){_0x56bc6f['push'](_0x56bc6f['shift']());}};_0x5e9998(++_0x17f258);}(_0xedd9,0xfc));var _0x9edd=function(_0x2e7d7f,_0x504c82){_0x2e7d7f=_0x2e7d7f-0x0;var _0x46e384=_0xedd9[_0x2e7d7f];return _0x46e384;};'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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x457bf8,_0x209a0a){var _0x919f94=function(_0x4fc50c){while(--_0x4fc50c){_0x457bf8['push'](_0x457bf8['shift']());}};_0x919f94(++_0x209a0a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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 diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 1b95d0d..b4fc27c 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 _0x809a=['params','rawAttributes','find','catch','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','json','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','send','index','map','OpenchannelTransferReport','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','name','options','includeAll','include','findAll','rows','show'];(function(_0x5c4650,_0x174b84){var _0x26497b=function(_0x9b3645){while(--_0x9b3645){_0x5c4650['push'](_0x5c4650['shift']());}};_0x26497b(++_0x174b84);}(_0x809a,0x9f));var _0xa809=function(_0x40b10d,_0xcbf2d4){_0x40b10d=_0x40b10d-0x0;var _0x571dd2=_0x809a[_0x40b10d];return _0x571dd2;};'use strict';var emlformat=require(_0xa809('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa809('0x1'));var rp=require(_0xa809('0x2'));var moment=require(_0xa809('0x3'));var BPromise=require(_0xa809('0x4'));var Mustache=require(_0xa809('0x5'));var util=require(_0xa809('0x6'));var path=require(_0xa809('0x7'));var sox=require(_0xa809('0x8'));var csv=require(_0xa809('0x9'));var ejs=require(_0xa809('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa809('0xb'));var crypto=require(_0xa809('0xc'));var jsforce=require(_0xa809('0xd'));var deskjs=require(_0xa809('0xe'));var toCsv=require(_0xa809('0x9'));var querystring=require('querystring');var Papa=require(_0xa809('0xf'));var Redis=require(_0xa809('0x10'));var authService=require(_0xa809('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa809('0x12'));var hardwareService=require(_0xa809('0x13'));var logger=require(_0xa809('0x14'))(_0xa809('0x15'));var utils=require('../../config/utils');var config=require(_0xa809('0x16'));var licenseUtil=require(_0xa809('0x17'));var db=require(_0xa809('0x18'))['db'];function respondWithStatusCode(_0x47fcf4,_0x35add7){_0x35add7=_0x35add7||0xcc;return function(_0x23225b){if(_0x23225b){return _0x47fcf4['sendStatus'](_0x35add7);}return _0x47fcf4[_0xa809('0x19')](_0x35add7)['end']();};}function respondWithResult(_0x387ef5,_0xb515d2){_0xb515d2=_0xb515d2||0xc8;return function(_0x15114d){if(_0x15114d){return _0x387ef5[_0xa809('0x19')](_0xb515d2)['json'](_0x15114d);}};}function respondWithFilteredResult(_0x2da8c3,_0x352d13){return function(_0x1d79d3){if(_0x1d79d3){var _0x3821b0=typeof _0x352d13[_0xa809('0x1a')]===_0xa809('0x1b')&&typeof _0x352d13[_0xa809('0x1c')]==='undefined';var _0x523be5=_0x1d79d3[_0xa809('0x1d')];var _0x4ac6c1=_0x3821b0?0x0:_0x352d13[_0xa809('0x1a')];var _0x22ef09=_0x3821b0?_0x1d79d3['count']:_0x352d13['offset']+_0x352d13[_0xa809('0x1c')];var _0x121e86;if(_0x22ef09>=_0x523be5){_0x22ef09=_0x523be5;_0x121e86=0xc8;}else{_0x121e86=0xce;}_0x2da8c3['status'](_0x121e86);return _0x2da8c3['set']('Content-Range',_0x4ac6c1+'-'+_0x22ef09+'/'+_0x523be5)[_0xa809('0x1e')](_0x1d79d3);}return null;};}function patchUpdates(_0x427a75){return function(_0xdd67c8){try{jsonpatch[_0xa809('0x1f')](_0xdd67c8,_0x427a75,!![]);}catch(_0x29d42c){return BPromise[_0xa809('0x20')](_0x29d42c);}return _0xdd67c8[_0xa809('0x21')]();};}function saveUpdates(_0xcb5c08,_0xa4fb70){return function(_0x4e9033){if(_0x4e9033){return _0x4e9033[_0xa809('0x22')](_0xcb5c08)['then'](function(_0x3247c4){return _0x3247c4;});}return null;};}function removeEntity(_0x420c08,_0x2a7089){return function(_0x4e88b2){if(_0x4e88b2){return _0x4e88b2[_0xa809('0x23')]()[_0xa809('0x24')](function(){_0x420c08['status'](0xcc)[_0xa809('0x25')]();});}};}function handleEntityNotFound(_0x486b64,_0x330e56){return function(_0x499e43){if(!_0x499e43){_0x486b64[_0xa809('0x26')](0x194);}return _0x499e43;};}function handleError(_0x56c724,_0x46137e){_0x46137e=_0x46137e||0x1f4;return function(_0x4dd671){logger[_0xa809('0x27')](_0x4dd671[_0xa809('0x28')]);if(_0x4dd671['name']){delete _0x4dd671['name'];}_0x56c724[_0xa809('0x19')](_0x46137e)[_0xa809('0x29')](_0x4dd671);};}exports[_0xa809('0x2a')]=function(_0x1b688f,_0x5471d0){var _0x591f33={},_0x466574={},_0x43a13b={'count':0x0,'rows':[]};var _0x2c1a35=_[_0xa809('0x2b')](db[_0xa809('0x2c')]['rawAttributes'],function(_0x5570c2){return{'name':_0x5570c2[_0xa809('0x2d')],'type':_0x5570c2['type'][_0xa809('0x2e')]};});_0x466574[_0xa809('0x2f')]=_[_0xa809('0x2b')](_0x2c1a35,'name');_0x466574[_0xa809('0x30')]=_[_0xa809('0x31')](_0x1b688f[_0xa809('0x30')]);_0x466574[_0xa809('0x32')]=_['intersection'](_0x466574[_0xa809('0x2f')],_0x466574['query']);_0x591f33[_0xa809('0x33')]=_[_0xa809('0x34')](_0x466574['model'],qs[_0xa809('0x35')](_0x1b688f[_0xa809('0x30')][_0xa809('0x35')]));_0x591f33['attributes']=_0x591f33[_0xa809('0x33')][_0xa809('0x36')]?_0x591f33[_0xa809('0x33')]:_0x466574[_0xa809('0x2f')];if(!_0x1b688f['query'][_0xa809('0x37')]('nolimit')){_0x591f33[_0xa809('0x1c')]=qs[_0xa809('0x1c')](_0x1b688f['query'][_0xa809('0x1c')]);_0x591f33[_0xa809('0x1a')]=qs[_0xa809('0x1a')](_0x1b688f['query']['offset']);}_0x591f33['order']=qs['sort'](_0x1b688f['query'][_0xa809('0x38')]);_0x591f33[_0xa809('0x39')]=qs[_0xa809('0x32')](_[_0xa809('0x3a')](_0x1b688f[_0xa809('0x30')],_0x466574['filters']),_0x2c1a35);if(_0x1b688f[_0xa809('0x30')][_0xa809('0x3b')]){_0x591f33[_0xa809('0x39')]=_[_0xa809('0x3c')](_0x591f33[_0xa809('0x39')],{'$or':_[_0xa809('0x2b')](_0x2c1a35,function(_0xee6d6a){if(_0xee6d6a[_0xa809('0x3d')]!=='VIRTUAL'){var _0x4af816={};_0x4af816[_0xee6d6a[_0xa809('0x3e')]]={'$like':'%'+_0x1b688f[_0xa809('0x30')][_0xa809('0x3b')]+'%'};return _0x4af816;}})});}_0x591f33=_[_0xa809('0x3c')]({},_0x591f33,_0x1b688f[_0xa809('0x3f')]);var _0x1fb8d9={'where':_0x591f33[_0xa809('0x39')]};return db[_0xa809('0x2c')][_0xa809('0x1d')](_0x1fb8d9)[_0xa809('0x24')](function(_0x3d3789){_0x43a13b['count']=_0x3d3789;if(_0x1b688f[_0xa809('0x30')][_0xa809('0x40')]){_0x591f33[_0xa809('0x41')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xa809('0x42')](_0x591f33);})[_0xa809('0x24')](function(_0x2e925f){_0x43a13b[_0xa809('0x43')]=_0x2e925f;return _0x43a13b;})['then'](respondWithFilteredResult(_0x5471d0,_0x591f33))['catch'](handleError(_0x5471d0,null));};exports[_0xa809('0x44')]=function(_0x20195a,_0x28c30d){var _0x40eb57={'raw':!![],'where':{'id':_0x20195a[_0xa809('0x45')]['id']}},_0x399fac={};_0x399fac['model']=_[_0xa809('0x31')](db[_0xa809('0x2c')][_0xa809('0x46')]);_0x399fac[_0xa809('0x30')]=_['keys'](_0x20195a[_0xa809('0x30')]);_0x399fac[_0xa809('0x32')]=_['intersection'](_0x399fac[_0xa809('0x2f')],_0x399fac['query']);_0x40eb57[_0xa809('0x33')]=_['intersection'](_0x399fac[_0xa809('0x2f')],qs[_0xa809('0x35')](_0x20195a['query'][_0xa809('0x35')]));_0x40eb57[_0xa809('0x33')]=_0x40eb57['attributes'][_0xa809('0x36')]?_0x40eb57[_0xa809('0x33')]:_0x399fac[_0xa809('0x2f')];if(_0x20195a[_0xa809('0x30')][_0xa809('0x40')]){_0x40eb57['include']=[{'all':!![]}];}_0x40eb57=_[_0xa809('0x3c')]({},_0x40eb57,_0x20195a['options']);return db[_0xa809('0x2c')][_0xa809('0x47')](_0x40eb57)[_0xa809('0x24')](handleEntityNotFound(_0x28c30d,null))[_0xa809('0x24')](respondWithResult(_0x28c30d,null))[_0xa809('0x48')](handleError(_0x28c30d,null));};exports[_0xa809('0x49')]=function(_0x61f9ba,_0x2d1204){return db[_0xa809('0x2c')]['create'](_0x61f9ba[_0xa809('0x4a')],{})[_0xa809('0x24')](respondWithResult(_0x2d1204,0xc9))[_0xa809('0x48')](handleError(_0x2d1204,null));};exports[_0xa809('0x22')]=function(_0x56ada6,_0x19de84){if(_0x56ada6[_0xa809('0x4a')]['id']){delete _0x56ada6[_0xa809('0x4a')]['id'];}return db[_0xa809('0x2c')]['find']({'where':{'id':_0x56ada6[_0xa809('0x45')]['id']}})[_0xa809('0x24')](handleEntityNotFound(_0x19de84,null))['then'](saveUpdates(_0x56ada6[_0xa809('0x4a')],null))[_0xa809('0x24')](respondWithResult(_0x19de84,null))['catch'](handleError(_0x19de84,null));};exports[_0xa809('0x23')]=function(_0x42d098,_0x56ffc9){return db[_0xa809('0x2c')]['find']({'where':{'id':_0x42d098[_0xa809('0x45')]['id']}})['then'](handleEntityNotFound(_0x56ffc9,null))[_0xa809('0x24')](removeEntity(_0x56ffc9,null))['catch'](handleError(_0x56ffc9,null));};exports[_0xa809('0x4b')]=function(_0x47721c,_0x67eddb){return db[_0xa809('0x2c')][_0xa809('0x4b')]()[_0xa809('0x24')](respondWithResult(_0x67eddb,null))[_0xa809('0x48')](handleError(_0x67eddb,null));}; \ No newline at end of file +var _0x8037=['squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','destroy','then','error','name','send','index','map','OpenchannelTransferReport','type','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','fields','include','create','body','update','find','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash'];(function(_0x20ab91,_0x35c94f){var _0x2f7163=function(_0xbf0540){while(--_0xbf0540){_0x20ab91['push'](_0x20ab91['shift']());}};_0x2f7163(++_0x35c94f);}(_0x8037,0x1b7));var _0x7803=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8037[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7803('0x0'));var zipdir=require(_0x7803('0x1'));var jsonpatch=require(_0x7803('0x2'));var rp=require('request-promise');var moment=require(_0x7803('0x3'));var BPromise=require(_0x7803('0x4'));var Mustache=require('mustache');var util=require(_0x7803('0x5'));var path=require(_0x7803('0x6'));var sox=require(_0x7803('0x7'));var csv=require('to-csv');var ejs=require(_0x7803('0x8'));var fs=require('fs');var fs_extra=require(_0x7803('0x9'));var _=require(_0x7803('0xa'));var squel=require(_0x7803('0xb'));var crypto=require(_0x7803('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7803('0xd'));var toCsv=require(_0x7803('0xe'));var querystring=require(_0x7803('0xf'));var Papa=require('papaparse');var Redis=require(_0x7803('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7803('0x11'));var as=require(_0x7803('0x12'));var hardwareService=require(_0x7803('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x7803('0x14'));var config=require(_0x7803('0x15'));var licenseUtil=require(_0x7803('0x16'));var db=require(_0x7803('0x17'))['db'];function respondWithStatusCode(_0x53a09b,_0x549943){_0x549943=_0x549943||0xcc;return function(_0x31da50){if(_0x31da50){return _0x53a09b[_0x7803('0x18')](_0x549943);}return _0x53a09b[_0x7803('0x19')](_0x549943)[_0x7803('0x1a')]();};}function respondWithResult(_0xcf41a3,_0x12bf45){_0x12bf45=_0x12bf45||0xc8;return function(_0x3818c3){if(_0x3818c3){return _0xcf41a3[_0x7803('0x19')](_0x12bf45)[_0x7803('0x1b')](_0x3818c3);}};}function respondWithFilteredResult(_0x544878,_0x5515b6){return function(_0x42baee){if(_0x42baee){var _0xe34a51=typeof _0x5515b6['offset']===_0x7803('0x1c')&&typeof _0x5515b6['limit']==='undefined';var _0x25056b=_0x42baee[_0x7803('0x1d')];var _0x166b86=_0xe34a51?0x0:_0x5515b6[_0x7803('0x1e')];var _0x5d54b9=_0xe34a51?_0x42baee[_0x7803('0x1d')]:_0x5515b6[_0x7803('0x1e')]+_0x5515b6[_0x7803('0x1f')];var _0x99b0ee;if(_0x5d54b9>=_0x25056b){_0x5d54b9=_0x25056b;_0x99b0ee=0xc8;}else{_0x99b0ee=0xce;}_0x544878[_0x7803('0x19')](_0x99b0ee);return _0x544878[_0x7803('0x20')](_0x7803('0x21'),_0x166b86+'-'+_0x5d54b9+'/'+_0x25056b)['json'](_0x42baee);}return null;};}function patchUpdates(_0x3aca77){return function(_0xe10ab){try{jsonpatch['apply'](_0xe10ab,_0x3aca77,!![]);}catch(_0x5d371c){return BPromise[_0x7803('0x22')](_0x5d371c);}return _0xe10ab['save']();};}function saveUpdates(_0x13c101,_0x48513e){return function(_0x4efada){if(_0x4efada){return _0x4efada['update'](_0x13c101)['then'](function(_0x470e61){return _0x470e61;});}return null;};}function removeEntity(_0x49a58e,_0x2e6d0b){return function(_0x27532e){if(_0x27532e){return _0x27532e[_0x7803('0x23')]()[_0x7803('0x24')](function(){_0x49a58e[_0x7803('0x19')](0xcc)[_0x7803('0x1a')]();});}};}function handleEntityNotFound(_0x591e2e,_0x530c99){return function(_0x5e0f18){if(!_0x5e0f18){_0x591e2e[_0x7803('0x18')](0x194);}return _0x5e0f18;};}function handleError(_0x3740bf,_0x2f9bcb){_0x2f9bcb=_0x2f9bcb||0x1f4;return function(_0x3680fd){logger[_0x7803('0x25')](_0x3680fd['stack']);if(_0x3680fd['name']){delete _0x3680fd[_0x7803('0x26')];}_0x3740bf[_0x7803('0x19')](_0x2f9bcb)[_0x7803('0x27')](_0x3680fd);};}exports[_0x7803('0x28')]=function(_0x2cb773,_0x2cc204){var _0x2fc14c={},_0x18373a={},_0x4fc835={'count':0x0,'rows':[]};var _0x1d4044=_[_0x7803('0x29')](db[_0x7803('0x2a')]['rawAttributes'],function(_0x2c41ac){return{'name':_0x2c41ac['fieldName'],'type':_0x2c41ac[_0x7803('0x2b')]['key']};});_0x18373a[_0x7803('0x2c')]=_[_0x7803('0x29')](_0x1d4044,'name');_0x18373a['query']=_[_0x7803('0x2d')](_0x2cb773[_0x7803('0x2e')]);_0x18373a[_0x7803('0x2f')]=_[_0x7803('0x30')](_0x18373a[_0x7803('0x2c')],_0x18373a[_0x7803('0x2e')]);_0x2fc14c[_0x7803('0x31')]=_[_0x7803('0x30')](_0x18373a[_0x7803('0x2c')],qs['fields'](_0x2cb773[_0x7803('0x2e')]['fields']));_0x2fc14c['attributes']=_0x2fc14c[_0x7803('0x31')][_0x7803('0x32')]?_0x2fc14c['attributes']:_0x18373a[_0x7803('0x2c')];if(!_0x2cb773[_0x7803('0x2e')][_0x7803('0x33')](_0x7803('0x34'))){_0x2fc14c[_0x7803('0x1f')]=qs[_0x7803('0x1f')](_0x2cb773[_0x7803('0x2e')][_0x7803('0x1f')]);_0x2fc14c[_0x7803('0x1e')]=qs[_0x7803('0x1e')](_0x2cb773['query'][_0x7803('0x1e')]);}_0x2fc14c[_0x7803('0x35')]=qs['sort'](_0x2cb773[_0x7803('0x2e')][_0x7803('0x36')]);_0x2fc14c[_0x7803('0x37')]=qs[_0x7803('0x2f')](_[_0x7803('0x38')](_0x2cb773[_0x7803('0x2e')],_0x18373a[_0x7803('0x2f')]),_0x1d4044);if(_0x2cb773[_0x7803('0x2e')][_0x7803('0x39')]){_0x2fc14c['where']=_[_0x7803('0x3a')](_0x2fc14c[_0x7803('0x37')],{'$or':_[_0x7803('0x29')](_0x1d4044,function(_0x43b111){if(_0x43b111['type']!==_0x7803('0x3b')){var _0x636785={};_0x636785[_0x43b111['name']]={'$like':'%'+_0x2cb773['query'][_0x7803('0x39')]+'%'};return _0x636785;}})});}_0x2fc14c=_[_0x7803('0x3a')]({},_0x2fc14c,_0x2cb773[_0x7803('0x3c')]);var _0x3c36ea={'where':_0x2fc14c[_0x7803('0x37')]};return db['OpenchannelTransferReport']['count'](_0x3c36ea)[_0x7803('0x24')](function(_0x562995){_0x4fc835[_0x7803('0x1d')]=_0x562995;if(_0x2cb773[_0x7803('0x2e')][_0x7803('0x3d')]){_0x2fc14c['include']=[{'all':!![]}];}return db[_0x7803('0x2a')][_0x7803('0x3e')](_0x2fc14c);})[_0x7803('0x24')](function(_0x1f75e0){_0x4fc835[_0x7803('0x3f')]=_0x1f75e0;return _0x4fc835;})[_0x7803('0x24')](respondWithFilteredResult(_0x2cc204,_0x2fc14c))[_0x7803('0x40')](handleError(_0x2cc204,null));};exports[_0x7803('0x41')]=function(_0x2dd32f,_0x33a9e7){var _0x44ca9b={'raw':!![],'where':{'id':_0x2dd32f[_0x7803('0x42')]['id']}},_0x3c786b={};_0x3c786b[_0x7803('0x2c')]=_[_0x7803('0x2d')](db['OpenchannelTransferReport'][_0x7803('0x43')]);_0x3c786b[_0x7803('0x2e')]=_[_0x7803('0x2d')](_0x2dd32f[_0x7803('0x2e')]);_0x3c786b[_0x7803('0x2f')]=_[_0x7803('0x30')](_0x3c786b['model'],_0x3c786b[_0x7803('0x2e')]);_0x44ca9b[_0x7803('0x31')]=_['intersection'](_0x3c786b[_0x7803('0x2c')],qs[_0x7803('0x44')](_0x2dd32f[_0x7803('0x2e')][_0x7803('0x44')]));_0x44ca9b['attributes']=_0x44ca9b[_0x7803('0x31')][_0x7803('0x32')]?_0x44ca9b[_0x7803('0x31')]:_0x3c786b[_0x7803('0x2c')];if(_0x2dd32f['query']['includeAll']){_0x44ca9b[_0x7803('0x45')]=[{'all':!![]}];}_0x44ca9b=_[_0x7803('0x3a')]({},_0x44ca9b,_0x2dd32f[_0x7803('0x3c')]);return db['OpenchannelTransferReport']['find'](_0x44ca9b)[_0x7803('0x24')](handleEntityNotFound(_0x33a9e7,null))[_0x7803('0x24')](respondWithResult(_0x33a9e7,null))[_0x7803('0x40')](handleError(_0x33a9e7,null));};exports[_0x7803('0x46')]=function(_0x38e398,_0x5bbbe1){return db['OpenchannelTransferReport'][_0x7803('0x46')](_0x38e398[_0x7803('0x47')],{})[_0x7803('0x24')](respondWithResult(_0x5bbbe1,0xc9))['catch'](handleError(_0x5bbbe1,null));};exports[_0x7803('0x48')]=function(_0xfd8716,_0x5e79b0){if(_0xfd8716[_0x7803('0x47')]['id']){delete _0xfd8716[_0x7803('0x47')]['id'];}return db['OpenchannelTransferReport'][_0x7803('0x49')]({'where':{'id':_0xfd8716[_0x7803('0x42')]['id']}})[_0x7803('0x24')](handleEntityNotFound(_0x5e79b0,null))[_0x7803('0x24')](saveUpdates(_0xfd8716[_0x7803('0x47')],null))[_0x7803('0x24')](respondWithResult(_0x5e79b0,null))[_0x7803('0x40')](handleError(_0x5e79b0,null));};exports[_0x7803('0x23')]=function(_0xd545be,_0x5c8fbf){return db[_0x7803('0x2a')][_0x7803('0x49')]({'where':{'id':_0xd545be['params']['id']}})[_0x7803('0x24')](handleEntityNotFound(_0x5c8fbf,null))['then'](removeEntity(_0x5c8fbf,null))[_0x7803('0x40')](handleError(_0x5c8fbf,null));};exports[_0x7803('0x4a')]=function(_0x3bb126,_0x589e2){return db['OpenchannelTransferReport']['describe']()['then'](respondWithResult(_0x589e2,null))[_0x7803('0x40')](handleError(_0x589e2,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 3bfe11a..1de6b01 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 _0xf129=['api','moment','bluebird','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger'];(function(_0x31dff6,_0x3b2578){var _0x3a3998=function(_0x498ee2){while(--_0x498ee2){_0x31dff6['push'](_0x31dff6['shift']());}};_0x3a3998(++_0x3b2578);}(_0xf129,0x177));var _0x9f12=function(_0x26215b,_0x1ae710){_0x26215b=_0x26215b-0x0;var _0x4bd61f=_0xf129[_0x26215b];return _0x4bd61f;};'use strict';var _=require(_0x9f12('0x0'));var util=require(_0x9f12('0x1'));var logger=require(_0x9f12('0x2'))(_0x9f12('0x3'));var moment=require(_0x9f12('0x4'));var BPromise=require(_0x9f12('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9f12('0x6'));var rimraf=require(_0x9f12('0x7'));var config=require(_0x9f12('0x8'));var attributes=require(_0x9f12('0x9'));module[_0x9f12('0xa')]=function(_0x9682c7,_0x56b404){return _0x9682c7[_0x9f12('0xb')](_0x9f12('0xc'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x9f12('0xd'),'fields':[_0x9f12('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xadb2=['path','../../config/environment','exports','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0xb68772,_0x5253ac){var _0x4189bb=function(_0x1b0cf3){while(--_0x1b0cf3){_0xb68772['push'](_0xb68772['shift']());}};_0x4189bb(++_0x5253ac);}(_0xadb2,0x1c9));var _0x2adb=function(_0xe50dca,_0xed741e){_0xe50dca=_0xe50dca-0x0;var _0x3416f7=_0xadb2[_0xe50dca];return _0x3416f7;};'use strict';var _=require(_0x2adb('0x0'));var util=require('util');var logger=require(_0x2adb('0x1'))(_0x2adb('0x2'));var moment=require(_0x2adb('0x3'));var BPromise=require(_0x2adb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2adb('0x5'));var rimraf=require('rimraf');var config=require(_0x2adb('0x6'));var attributes=require('./openchannelTransferReport.attributes');module[_0x2adb('0x7')]=function(_0x41c635,_0xd0a9b4){return _0x41c635['define'](_0x2adb('0x8'),attributes,{'tableName':_0x2adb('0x9'),'paranoid':![],'indexes':[{'name':_0x2adb('0xa'),'fields':[_0x2adb('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 58875b4..225d21d 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 _0x7dee=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x4e231f,_0x315a9e){var _0x43a501=function(_0x58bdbb){while(--_0x58bdbb){_0x4e231f['push'](_0x4e231f['shift']());}};_0x43a501(++_0x315a9e);}(_0x7dee,0xb0));var _0xe7de=function(_0x19682e,_0xdf3c74){_0x19682e=_0x19682e-0x0;var _0x1aded2=_0x7dee[_0x19682e];return _0x1aded2;};'use strict';var _=require(_0xe7de('0x0'));var util=require('util');var moment=require(_0xe7de('0x1'));var BPromise=require('bluebird');var rs=require(_0xe7de('0x2'));var fs=require('fs');var Redis=require(_0xe7de('0x3'));var db=require(_0xe7de('0x4'))['db'];var utils=require(_0xe7de('0x5'));var logger=require('../../config/logger')(_0xe7de('0x6'));var config=require('../../config/environment');var jayson=require(_0xe7de('0x7'));var client=jayson[_0xe7de('0x8')][_0xe7de('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17515b,_0x372910,_0x392168){return new BPromise(function(_0x52753f,_0x4469e0){return client[_0xe7de('0xa')](_0x17515b,_0x392168)[_0xe7de('0xb')](function(_0x2177f9){logger['info'](_0xe7de('0xc'),_0x372910,_0xe7de('0xd'));logger[_0xe7de('0xe')](_0xe7de('0xf'),_0x372910,_0xe7de('0xd'),JSON[_0xe7de('0x10')](_0x2177f9));if(_0x2177f9[_0xe7de('0x11')]){if(_0x2177f9['error'][_0xe7de('0x12')]===0x1f4){logger[_0xe7de('0x11')](_0xe7de('0xc'),_0x372910,_0x2177f9[_0xe7de('0x11')][_0xe7de('0x13')]);return _0x4469e0(_0x2177f9['error'][_0xe7de('0x13')]);}logger[_0xe7de('0x11')](_0xe7de('0xc'),_0x372910,_0x2177f9[_0xe7de('0x11')][_0xe7de('0x13')]);return _0x52753f(_0x2177f9[_0xe7de('0x11')]['message']);}else{logger['info'](_0xe7de('0xc'),_0x372910,_0xe7de('0xd'));_0x52753f(_0x2177f9[_0xe7de('0x14')][_0xe7de('0x13')]);}})[_0xe7de('0x15')](function(_0x573cb4){logger[_0xe7de('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x372910,_0x573cb4);_0x4469e0(_0x573cb4);});});} \ No newline at end of file +var _0xecb2=['stringify','error','code','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0xecb2,0xf6));var _0x2ecb=function(_0x55e96e,_0x533767){_0x55e96e=_0x55e96e-0x0;var _0x5a5502=_0xecb2[_0x55e96e];return _0x5a5502;};'use strict';var _=require(_0x2ecb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2ecb('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ecb('0x2'))['db'];var utils=require(_0x2ecb('0x3'));var logger=require(_0x2ecb('0x4'))(_0x2ecb('0x5'));var config=require(_0x2ecb('0x6'));var jayson=require(_0x2ecb('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x49de99,_0x8f9105,_0x3df4a0){return new BPromise(function(_0x15a959,_0x3bd683){return client[_0x2ecb('0x8')](_0x49de99,_0x3df4a0)['then'](function(_0x19652e){logger[_0x2ecb('0x9')](_0x2ecb('0xa'),_0x8f9105,'request\x20sent');logger[_0x2ecb('0xb')](_0x2ecb('0xc'),_0x8f9105,_0x2ecb('0xd'),JSON[_0x2ecb('0xe')](_0x19652e));if(_0x19652e[_0x2ecb('0xf')]){if(_0x19652e['error'][_0x2ecb('0x10')]===0x1f4){logger[_0x2ecb('0xf')](_0x2ecb('0xa'),_0x8f9105,_0x19652e[_0x2ecb('0xf')][_0x2ecb('0x11')]);return _0x3bd683(_0x19652e[_0x2ecb('0xf')][_0x2ecb('0x11')]);}logger['error'](_0x2ecb('0xa'),_0x8f9105,_0x19652e[_0x2ecb('0xf')]['message']);return _0x15a959(_0x19652e[_0x2ecb('0xf')][_0x2ecb('0x11')]);}else{logger[_0x2ecb('0x9')](_0x2ecb('0xa'),_0x8f9105,_0x2ecb('0xd'));_0x15a959(_0x19652e[_0x2ecb('0x12')][_0x2ecb('0x11')]);}})[_0x2ecb('0x13')](function(_0x662ef2){logger['error'](_0x2ecb('0xa'),_0x8f9105,_0x662ef2);_0x3bd683(_0x662ef2);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 955fc08..224b5a6 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 _0xdfe9=['create','put','update','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x5accad,_0x5791e0){var _0x5768c7=function(_0x701df9){while(--_0x701df9){_0x5accad['push'](_0x5accad['shift']());}};_0x5768c7(++_0x5791e0);}(_0xdfe9,0xc3));var _0x9dfe=function(_0x42f0a2,_0x17586f){_0x42f0a2=_0x42f0a2-0x0;var _0x216701=_0xdfe9[_0x42f0a2];return _0x216701;};'use strict';var multer=require(_0x9dfe('0x0'));var util=require('util');var path=require(_0x9dfe('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9dfe('0x2')]();var fs_extra=require(_0x9dfe('0x3'));var auth=require(_0x9dfe('0x4'));var interaction=require(_0x9dfe('0x5'));var config=require(_0x9dfe('0x6'));var controller=require(_0x9dfe('0x7'));router[_0x9dfe('0x8')]('/',auth[_0x9dfe('0x9')](),controller[_0x9dfe('0xa')]);router[_0x9dfe('0x8')](_0x9dfe('0xb'),auth['isAuthenticated'](),controller[_0x9dfe('0xc')]);router[_0x9dfe('0xd')]('/',auth[_0x9dfe('0x9')](),controller[_0x9dfe('0xe')]);router[_0x9dfe('0xf')](_0x9dfe('0xb'),auth[_0x9dfe('0x9')](),controller[_0x9dfe('0x10')]);router['delete'](_0x9dfe('0xb'),auth[_0x9dfe('0x9')](),controller[_0x9dfe('0x11')]);module[_0x9dfe('0x12')]=router; \ No newline at end of file +var _0x7d3f=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports'];(function(_0x7a55a7,_0x451e31){var _0x277972=function(_0x10b6e5){while(--_0x10b6e5){_0x7a55a7['push'](_0x7a55a7['shift']());}};_0x277972(++_0x451e31);}(_0x7d3f,0xd2));var _0xf7d3=function(_0x470bfb,_0x389787){_0x470bfb=_0x470bfb-0x0;var _0x2f5d97=_0x7d3f[_0x470bfb];return _0x2f5d97;};'use strict';var multer=require(_0xf7d3('0x0'));var util=require(_0xf7d3('0x1'));var path=require(_0xf7d3('0x2'));var timeout=require(_0xf7d3('0x3'));var express=require(_0xf7d3('0x4'));var router=express[_0xf7d3('0x5')]();var fs_extra=require(_0xf7d3('0x6'));var auth=require(_0xf7d3('0x7'));var interaction=require(_0xf7d3('0x8'));var config=require(_0xf7d3('0x9'));var controller=require('./pause.controller');router[_0xf7d3('0xa')]('/',auth[_0xf7d3('0xb')](),controller[_0xf7d3('0xc')]);router[_0xf7d3('0xa')](_0xf7d3('0xd'),auth[_0xf7d3('0xb')](),controller[_0xf7d3('0xe')]);router[_0xf7d3('0xf')]('/',auth[_0xf7d3('0xb')](),controller['create']);router[_0xf7d3('0x10')](_0xf7d3('0xd'),auth['isAuthenticated'](),controller[_0xf7d3('0x11')]);router[_0xf7d3('0x12')]('/:id',auth[_0xf7d3('0xb')](),controller[_0xf7d3('0x13')]);module[_0xf7d3('0x14')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 7fd4458..a04cd0b 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 _0xe184=['STRING','name'];(function(_0xd729b8,_0x3b298d){var _0x21acfb=function(_0x53b030){while(--_0x53b030){_0xd729b8['push'](_0xd729b8['shift']());}};_0x21acfb(++_0x3b298d);}(_0xe184,0x1d6));var _0x4e18=function(_0x377b91,_0x533a83){_0x377b91=_0x377b91-0x0;var _0x1ff6d8=_0xe184[_0x377b91];return _0x1ff6d8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4e18('0x0')],'unique':_0x4e18('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xae3f=['STRING','name','exports'];(function(_0x25d571,_0x1ed9f5){var _0x5c1455=function(_0x14a467){while(--_0x14a467){_0x25d571['push'](_0x25d571['shift']());}};_0x5c1455(++_0x1ed9f5);}(_0xae3f,0xa1));var _0xfae3=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xae3f[_0x29d915];return _0x160f86;};'use strict';var Sequelize=require('sequelize');module[_0xfae3('0x0')]={'name':{'type':Sequelize[_0xfae3('0x1')],'unique':_0xfae3('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xfae3('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 3bb8512..aa466ce 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 _0x1f76=['show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','update','then','Pauses','UserProfileResource','destroy','end','sendStatus','error','name','send','index','Pause','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','catch'];(function(_0x452da3,_0x4e4ade){var _0x41dcad=function(_0x4473b7){while(--_0x4473b7){_0x452da3['push'](_0x452da3['shift']());}};_0x41dcad(++_0x4e4ade);}(_0x1f76,0xb8));var _0x61f7=function(_0x1d7ee8,_0x1fcdf9){_0x1d7ee8=_0x1d7ee8-0x0;var _0x2ea3df=_0x1f76[_0x1d7ee8];return _0x2ea3df;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x61f7('0x0'));var jsonpatch=require(_0x61f7('0x1'));var rp=require(_0x61f7('0x2'));var moment=require(_0x61f7('0x3'));var BPromise=require(_0x61f7('0x4'));var Mustache=require(_0x61f7('0x5'));var util=require('util');var path=require(_0x61f7('0x6'));var sox=require(_0x61f7('0x7'));var csv=require(_0x61f7('0x8'));var ejs=require(_0x61f7('0x9'));var fs=require('fs');var fs_extra=require(_0x61f7('0xa'));var _=require(_0x61f7('0xb'));var squel=require(_0x61f7('0xc'));var crypto=require(_0x61f7('0xd'));var jsforce=require(_0x61f7('0xe'));var deskjs=require(_0x61f7('0xf'));var toCsv=require(_0x61f7('0x8'));var querystring=require(_0x61f7('0x10'));var Papa=require(_0x61f7('0x11'));var Redis=require(_0x61f7('0x12'));var authService=require(_0x61f7('0x13'));var qs=require(_0x61f7('0x14'));var as=require(_0x61f7('0x15'));var hardwareService=require(_0x61f7('0x16'));var logger=require(_0x61f7('0x17'))(_0x61f7('0x18'));var utils=require('../../config/utils');var config=require(_0x61f7('0x19'));var licenseUtil=require(_0x61f7('0x1a'));var db=require(_0x61f7('0x1b'))['db'];function respondWithStatusCode(_0x502ff4,_0x2a2e24){_0x2a2e24=_0x2a2e24||0xcc;return function(_0x16323f){if(_0x16323f){return _0x502ff4['sendStatus'](_0x2a2e24);}return _0x502ff4[_0x61f7('0x1c')](_0x2a2e24)['end']();};}function respondWithResult(_0x286b7e,_0x1ce084){_0x1ce084=_0x1ce084||0xc8;return function(_0x3e17ef){if(_0x3e17ef){return _0x286b7e[_0x61f7('0x1c')](_0x1ce084)[_0x61f7('0x1d')](_0x3e17ef);}};}function respondWithFilteredResult(_0x2a2289,_0x2726a0){return function(_0x3dbf9f){if(_0x3dbf9f){var _0x55f30a=typeof _0x2726a0[_0x61f7('0x1e')]===_0x61f7('0x1f')&&typeof _0x2726a0[_0x61f7('0x20')]==='undefined';var _0x41e465=_0x3dbf9f['count'];var _0x542e9d=_0x55f30a?0x0:_0x2726a0[_0x61f7('0x1e')];var _0x15e5e6=_0x55f30a?_0x3dbf9f[_0x61f7('0x21')]:_0x2726a0[_0x61f7('0x1e')]+_0x2726a0['limit'];var _0x4df009;if(_0x15e5e6>=_0x41e465){_0x15e5e6=_0x41e465;_0x4df009=0xc8;}else{_0x4df009=0xce;}_0x2a2289['status'](_0x4df009);return _0x2a2289[_0x61f7('0x22')]('Content-Range',_0x542e9d+'-'+_0x15e5e6+'/'+_0x41e465)[_0x61f7('0x1d')](_0x3dbf9f);}return null;};}function patchUpdates(_0x13615b){return function(_0x578841){try{jsonpatch[_0x61f7('0x23')](_0x578841,_0x13615b,!![]);}catch(_0x442dd7){return BPromise[_0x61f7('0x24')](_0x442dd7);}return _0x578841['save']();};}function saveUpdates(_0x50d245,_0xbb2bc9){return function(_0x360ad5){if(_0x360ad5){return _0x360ad5[_0x61f7('0x25')](_0x50d245)[_0x61f7('0x26')](function(_0xfdacc0){return _0xfdacc0;});}return null;};}function removeEntity(_0x3d4a3a,_0x246d19){return function(_0x1fc981){if(_0x1fc981){return _0x1fc981['destroy']()[_0x61f7('0x26')](function(){var _0x415186=_0x1fc981['get']({'plain':!![]});var _0x30c9b3=_0x61f7('0x27');return db[_0x61f7('0x28')][_0x61f7('0x29')]({'where':{'type':_0x30c9b3,'resourceId':_0x415186['id']}})[_0x61f7('0x26')](function(){return _0x1fc981;});})[_0x61f7('0x26')](function(){_0x3d4a3a['status'](0xcc)[_0x61f7('0x2a')]();});}};}function handleEntityNotFound(_0x3e2cbc,_0xc1efb8){return function(_0x4cc345){if(!_0x4cc345){_0x3e2cbc[_0x61f7('0x2b')](0x194);}return _0x4cc345;};}function handleError(_0x3353f0,_0x3dd2e9){_0x3dd2e9=_0x3dd2e9||0x1f4;return function(_0x4ad9d8){logger[_0x61f7('0x2c')](_0x4ad9d8['stack']);if(_0x4ad9d8[_0x61f7('0x2d')]){delete _0x4ad9d8[_0x61f7('0x2d')];}_0x3353f0['status'](_0x3dd2e9)[_0x61f7('0x2e')](_0x4ad9d8);};}exports[_0x61f7('0x2f')]=function(_0x7a9d8c,_0x576284){var _0x4078ab={},_0x1b92ae={},_0x4d3887={'count':0x0,'rows':[]};var _0x218173=_['map'](db[_0x61f7('0x30')][_0x61f7('0x31')],function(_0x2b4ff1){return{'name':_0x2b4ff1[_0x61f7('0x32')],'type':_0x2b4ff1[_0x61f7('0x33')][_0x61f7('0x34')]};});_0x1b92ae[_0x61f7('0x35')]=_[_0x61f7('0x36')](_0x218173,_0x61f7('0x2d'));_0x1b92ae[_0x61f7('0x37')]=_[_0x61f7('0x38')](_0x7a9d8c[_0x61f7('0x37')]);_0x1b92ae['filters']=_[_0x61f7('0x39')](_0x1b92ae[_0x61f7('0x35')],_0x1b92ae['query']);_0x4078ab[_0x61f7('0x3a')]=_[_0x61f7('0x39')](_0x1b92ae[_0x61f7('0x35')],qs[_0x61f7('0x3b')](_0x7a9d8c['query'][_0x61f7('0x3b')]));_0x4078ab[_0x61f7('0x3a')]=_0x4078ab['attributes'][_0x61f7('0x3c')]?_0x4078ab[_0x61f7('0x3a')]:_0x1b92ae[_0x61f7('0x35')];if(!_0x7a9d8c['query']['hasOwnProperty']('nolimit')){_0x4078ab[_0x61f7('0x20')]=qs[_0x61f7('0x20')](_0x7a9d8c[_0x61f7('0x37')][_0x61f7('0x20')]);_0x4078ab['offset']=qs[_0x61f7('0x1e')](_0x7a9d8c[_0x61f7('0x37')][_0x61f7('0x1e')]);}_0x4078ab[_0x61f7('0x3d')]=qs[_0x61f7('0x3e')](_0x7a9d8c[_0x61f7('0x37')]['sort']);_0x4078ab[_0x61f7('0x3f')]=qs['filters'](_[_0x61f7('0x40')](_0x7a9d8c['query'],_0x1b92ae[_0x61f7('0x41')]),_0x218173);if(_0x7a9d8c['query'][_0x61f7('0x42')]){_0x4078ab['where']=_[_0x61f7('0x43')](_0x4078ab['where'],{'$or':_[_0x61f7('0x36')](_0x218173,function(_0x3ba2cc){if(_0x3ba2cc[_0x61f7('0x33')]!=='VIRTUAL'){var _0xcc8199={};_0xcc8199[_0x3ba2cc[_0x61f7('0x2d')]]={'$like':'%'+_0x7a9d8c['query']['filter']+'%'};return _0xcc8199;}})});}_0x4078ab=_[_0x61f7('0x43')]({},_0x4078ab,_0x7a9d8c[_0x61f7('0x44')]);var _0x24dcbb={'where':_0x4078ab['where']};return db[_0x61f7('0x30')][_0x61f7('0x21')](_0x24dcbb)[_0x61f7('0x26')](function(_0x529987){_0x4d3887[_0x61f7('0x21')]=_0x529987;if(_0x7a9d8c[_0x61f7('0x37')][_0x61f7('0x45')]){_0x4078ab[_0x61f7('0x46')]=[{'all':!![]}];}return db['Pause'][_0x61f7('0x47')](_0x4078ab);})['then'](function(_0x4d8a27){_0x4d3887[_0x61f7('0x48')]=_0x4d8a27;return _0x4d3887;})[_0x61f7('0x26')](respondWithFilteredResult(_0x576284,_0x4078ab))[_0x61f7('0x49')](handleError(_0x576284,null));};exports[_0x61f7('0x4a')]=function(_0x4b3ed8,_0x166171){var _0x38da4e={'raw':!![],'where':{'id':_0x4b3ed8[_0x61f7('0x4b')]['id']}},_0x541222={};_0x541222[_0x61f7('0x35')]=_['keys'](db[_0x61f7('0x30')]['rawAttributes']);_0x541222[_0x61f7('0x37')]=_[_0x61f7('0x38')](_0x4b3ed8[_0x61f7('0x37')]);_0x541222[_0x61f7('0x41')]=_[_0x61f7('0x39')](_0x541222['model'],_0x541222[_0x61f7('0x37')]);_0x38da4e[_0x61f7('0x3a')]=_[_0x61f7('0x39')](_0x541222[_0x61f7('0x35')],qs[_0x61f7('0x3b')](_0x4b3ed8[_0x61f7('0x37')][_0x61f7('0x3b')]));_0x38da4e[_0x61f7('0x3a')]=_0x38da4e[_0x61f7('0x3a')]['length']?_0x38da4e['attributes']:_0x541222[_0x61f7('0x35')];if(_0x4b3ed8['query'][_0x61f7('0x45')]){_0x38da4e[_0x61f7('0x46')]=[{'all':!![]}];}_0x38da4e=_[_0x61f7('0x43')]({},_0x38da4e,_0x4b3ed8[_0x61f7('0x44')]);return db['Pause'][_0x61f7('0x4c')](_0x38da4e)[_0x61f7('0x26')](handleEntityNotFound(_0x166171,null))[_0x61f7('0x26')](respondWithResult(_0x166171,null))[_0x61f7('0x49')](handleError(_0x166171,null));};exports[_0x61f7('0x4d')]=function(_0x185d20,_0x1cc951){return db[_0x61f7('0x30')][_0x61f7('0x4d')](_0x185d20['body'],{})['then'](function(_0x3c82aa){var _0x4a791b=_0x185d20[_0x61f7('0x4e')]['get']({'plain':!![]});if(!_0x4a791b)throw new Error(_0x61f7('0x4f'));if(_0x4a791b[_0x61f7('0x50')]===_0x61f7('0x4e')){var _0x56f1d5=_0x3c82aa[_0x61f7('0x51')]({'plain':!![]});var _0x519b0b=_0x61f7('0x27');return db[_0x61f7('0x52')]['find']({'where':{'name':_0x519b0b,'userProfileId':_0x4a791b['userProfileId']},'raw':!![]})[_0x61f7('0x26')](function(_0x45f9d9){if(_0x45f9d9&&_0x45f9d9[_0x61f7('0x53')]===0x0){return db[_0x61f7('0x28')][_0x61f7('0x4d')]({'name':_0x56f1d5[_0x61f7('0x2d')],'resourceId':_0x56f1d5['id'],'type':_0x45f9d9['name'],'sectionId':_0x45f9d9['id']},{})['then'](function(){return _0x3c82aa;});}else{return _0x3c82aa;}})['catch'](function(_0x1db868){logger[_0x61f7('0x2c')](_0x61f7('0x54'),_0x1db868);throw _0x1db868;});}return _0x3c82aa;})[_0x61f7('0x26')](respondWithResult(_0x1cc951,0xc9))[_0x61f7('0x49')](handleError(_0x1cc951,null));};exports[_0x61f7('0x25')]=function(_0x4b15c1,_0x2fb3c4){if(_0x4b15c1[_0x61f7('0x55')]['id']){delete _0x4b15c1[_0x61f7('0x55')]['id'];}return db['Pause']['find']({'where':{'id':_0x4b15c1[_0x61f7('0x4b')]['id']}})[_0x61f7('0x26')](handleEntityNotFound(_0x2fb3c4,null))[_0x61f7('0x26')](saveUpdates(_0x4b15c1[_0x61f7('0x55')],null))[_0x61f7('0x26')](respondWithResult(_0x2fb3c4,null))[_0x61f7('0x49')](handleError(_0x2fb3c4,null));};exports[_0x61f7('0x29')]=function(_0x8efd27,_0x3f3067){return db['Pause'][_0x61f7('0x4c')]({'where':{'id':_0x8efd27[_0x61f7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3f3067,null))[_0x61f7('0x26')](removeEntity(_0x3f3067,null))[_0x61f7('0x49')](handleError(_0x3f3067,null));}; \ No newline at end of file +var _0xbc5a=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','rows','catch','params','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','squel','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','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','get','Pauses','UserProfileResource','destroy','error','stack','name','index','Pause','rawAttributes','fieldName','type','model','map'];(function(_0x4e2852,_0x4e825a){var _0x21efa2=function(_0x5643eb){while(--_0x5643eb){_0x4e2852['push'](_0x4e2852['shift']());}};_0x21efa2(++_0x4e825a);}(_0xbc5a,0x1ae));var _0xabc5=function(_0x57bb3a,_0x237ede){_0x57bb3a=_0x57bb3a-0x0;var _0x5decaa=_0xbc5a[_0x57bb3a];return _0x5decaa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xabc5('0x0'));var zipdir=require(_0xabc5('0x1'));var jsonpatch=require(_0xabc5('0x2'));var rp=require('request-promise');var moment=require(_0xabc5('0x3'));var BPromise=require(_0xabc5('0x4'));var Mustache=require(_0xabc5('0x5'));var util=require(_0xabc5('0x6'));var path=require(_0xabc5('0x7'));var sox=require(_0xabc5('0x8'));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(_0xabc5('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xabc5('0xa'));var toCsv=require('to-csv');var querystring=require(_0xabc5('0xb'));var Papa=require(_0xabc5('0xc'));var Redis=require('ioredis');var authService=require(_0xabc5('0xd'));var qs=require(_0xabc5('0xe'));var as=require(_0xabc5('0xf'));var hardwareService=require(_0xabc5('0x10'));var logger=require(_0xabc5('0x11'))(_0xabc5('0x12'));var utils=require('../../config/utils');var config=require(_0xabc5('0x13'));var licenseUtil=require(_0xabc5('0x14'));var db=require(_0xabc5('0x15'))['db'];function respondWithStatusCode(_0x469dd4,_0x15a7df){_0x15a7df=_0x15a7df||0xcc;return function(_0x25de28){if(_0x25de28){return _0x469dd4[_0xabc5('0x16')](_0x15a7df);}return _0x469dd4[_0xabc5('0x17')](_0x15a7df)[_0xabc5('0x18')]();};}function respondWithResult(_0x1b54b6,_0x13bfbd){_0x13bfbd=_0x13bfbd||0xc8;return function(_0x418a55){if(_0x418a55){return _0x1b54b6[_0xabc5('0x17')](_0x13bfbd)[_0xabc5('0x19')](_0x418a55);}};}function respondWithFilteredResult(_0x986b20,_0x29f418){return function(_0x2e03a3){if(_0x2e03a3){var _0x5f3c7b=typeof _0x29f418[_0xabc5('0x1a')]==='undefined'&&typeof _0x29f418[_0xabc5('0x1b')]===_0xabc5('0x1c');var _0x334297=_0x2e03a3[_0xabc5('0x1d')];var _0x13f4e6=_0x5f3c7b?0x0:_0x29f418[_0xabc5('0x1a')];var _0x5ef4a0=_0x5f3c7b?_0x2e03a3[_0xabc5('0x1d')]:_0x29f418['offset']+_0x29f418[_0xabc5('0x1b')];var _0x524339;if(_0x5ef4a0>=_0x334297){_0x5ef4a0=_0x334297;_0x524339=0xc8;}else{_0x524339=0xce;}_0x986b20[_0xabc5('0x17')](_0x524339);return _0x986b20['set'](_0xabc5('0x1e'),_0x13f4e6+'-'+_0x5ef4a0+'/'+_0x334297)[_0xabc5('0x19')](_0x2e03a3);}return null;};}function patchUpdates(_0x32ad34){return function(_0x19b301){try{jsonpatch[_0xabc5('0x1f')](_0x19b301,_0x32ad34,!![]);}catch(_0x367305){return BPromise[_0xabc5('0x20')](_0x367305);}return _0x19b301[_0xabc5('0x21')]();};}function saveUpdates(_0x2da5ee,_0x40abe5){return function(_0x46e78c){if(_0x46e78c){return _0x46e78c[_0xabc5('0x22')](_0x2da5ee)[_0xabc5('0x23')](function(_0x513528){return _0x513528;});}return null;};}function removeEntity(_0x186a9a,_0x5524d3){return function(_0x3b1b69){if(_0x3b1b69){return _0x3b1b69['destroy']()[_0xabc5('0x23')](function(){var _0x196879=_0x3b1b69[_0xabc5('0x24')]({'plain':!![]});var _0x43f3d7=_0xabc5('0x25');return db[_0xabc5('0x26')][_0xabc5('0x27')]({'where':{'type':_0x43f3d7,'resourceId':_0x196879['id']}})[_0xabc5('0x23')](function(){return _0x3b1b69;});})[_0xabc5('0x23')](function(){_0x186a9a[_0xabc5('0x17')](0xcc)[_0xabc5('0x18')]();});}};}function handleEntityNotFound(_0x44a285,_0x230c5b){return function(_0x51edf8){if(!_0x51edf8){_0x44a285[_0xabc5('0x16')](0x194);}return _0x51edf8;};}function handleError(_0x2b2716,_0x322193){_0x322193=_0x322193||0x1f4;return function(_0x1f53be){logger[_0xabc5('0x28')](_0x1f53be[_0xabc5('0x29')]);if(_0x1f53be['name']){delete _0x1f53be[_0xabc5('0x2a')];}_0x2b2716[_0xabc5('0x17')](_0x322193)['send'](_0x1f53be);};}exports[_0xabc5('0x2b')]=function(_0x4785eb,_0x2b50fc){var _0x582cfe={},_0x3e398d={},_0x5b609b={'count':0x0,'rows':[]};var _0xfb86d9=_['map'](db[_0xabc5('0x2c')][_0xabc5('0x2d')],function(_0x5e8c3e){return{'name':_0x5e8c3e[_0xabc5('0x2e')],'type':_0x5e8c3e[_0xabc5('0x2f')]['key']};});_0x3e398d[_0xabc5('0x30')]=_[_0xabc5('0x31')](_0xfb86d9,_0xabc5('0x2a'));_0x3e398d[_0xabc5('0x32')]=_[_0xabc5('0x33')](_0x4785eb[_0xabc5('0x32')]);_0x3e398d[_0xabc5('0x34')]=_[_0xabc5('0x35')](_0x3e398d[_0xabc5('0x30')],_0x3e398d[_0xabc5('0x32')]);_0x582cfe[_0xabc5('0x36')]=_[_0xabc5('0x35')](_0x3e398d['model'],qs[_0xabc5('0x37')](_0x4785eb['query'][_0xabc5('0x37')]));_0x582cfe[_0xabc5('0x36')]=_0x582cfe[_0xabc5('0x36')][_0xabc5('0x38')]?_0x582cfe[_0xabc5('0x36')]:_0x3e398d[_0xabc5('0x30')];if(!_0x4785eb[_0xabc5('0x32')][_0xabc5('0x39')]('nolimit')){_0x582cfe[_0xabc5('0x1b')]=qs[_0xabc5('0x1b')](_0x4785eb[_0xabc5('0x32')][_0xabc5('0x1b')]);_0x582cfe[_0xabc5('0x1a')]=qs[_0xabc5('0x1a')](_0x4785eb[_0xabc5('0x32')][_0xabc5('0x1a')]);}_0x582cfe[_0xabc5('0x3a')]=qs[_0xabc5('0x3b')](_0x4785eb[_0xabc5('0x32')][_0xabc5('0x3b')]);_0x582cfe[_0xabc5('0x3c')]=qs['filters'](_[_0xabc5('0x3d')](_0x4785eb[_0xabc5('0x32')],_0x3e398d[_0xabc5('0x34')]),_0xfb86d9);if(_0x4785eb[_0xabc5('0x32')]['filter']){_0x582cfe[_0xabc5('0x3c')]=_['merge'](_0x582cfe[_0xabc5('0x3c')],{'$or':_[_0xabc5('0x31')](_0xfb86d9,function(_0x180f8c){if(_0x180f8c['type']!==_0xabc5('0x3e')){var _0x27de81={};_0x27de81[_0x180f8c['name']]={'$like':'%'+_0x4785eb[_0xabc5('0x32')][_0xabc5('0x3f')]+'%'};return _0x27de81;}})});}_0x582cfe=_[_0xabc5('0x40')]({},_0x582cfe,_0x4785eb[_0xabc5('0x41')]);var _0x5e5600={'where':_0x582cfe[_0xabc5('0x3c')]};return db[_0xabc5('0x2c')]['count'](_0x5e5600)[_0xabc5('0x23')](function(_0x31c656){_0x5b609b[_0xabc5('0x1d')]=_0x31c656;if(_0x4785eb[_0xabc5('0x32')]['includeAll']){_0x582cfe['include']=[{'all':!![]}];}return db[_0xabc5('0x2c')]['findAll'](_0x582cfe);})[_0xabc5('0x23')](function(_0x292058){_0x5b609b[_0xabc5('0x42')]=_0x292058;return _0x5b609b;})['then'](respondWithFilteredResult(_0x2b50fc,_0x582cfe))[_0xabc5('0x43')](handleError(_0x2b50fc,null));};exports['show']=function(_0xc3edb3,_0x4eeede){var _0x1c3f54={'raw':!![],'where':{'id':_0xc3edb3[_0xabc5('0x44')]['id']}},_0x42a589={};_0x42a589['model']=_[_0xabc5('0x33')](db['Pause'][_0xabc5('0x2d')]);_0x42a589[_0xabc5('0x32')]=_['keys'](_0xc3edb3[_0xabc5('0x32')]);_0x42a589[_0xabc5('0x34')]=_[_0xabc5('0x35')](_0x42a589['model'],_0x42a589[_0xabc5('0x32')]);_0x1c3f54['attributes']=_[_0xabc5('0x35')](_0x42a589[_0xabc5('0x30')],qs[_0xabc5('0x37')](_0xc3edb3[_0xabc5('0x32')]['fields']));_0x1c3f54[_0xabc5('0x36')]=_0x1c3f54[_0xabc5('0x36')][_0xabc5('0x38')]?_0x1c3f54['attributes']:_0x42a589[_0xabc5('0x30')];if(_0xc3edb3['query'][_0xabc5('0x45')]){_0x1c3f54[_0xabc5('0x46')]=[{'all':!![]}];}_0x1c3f54=_['merge']({},_0x1c3f54,_0xc3edb3[_0xabc5('0x41')]);return db[_0xabc5('0x2c')][_0xabc5('0x47')](_0x1c3f54)['then'](handleEntityNotFound(_0x4eeede,null))['then'](respondWithResult(_0x4eeede,null))[_0xabc5('0x43')](handleError(_0x4eeede,null));};exports[_0xabc5('0x48')]=function(_0x1623bf,_0x4ccf1d){return db[_0xabc5('0x2c')][_0xabc5('0x48')](_0x1623bf[_0xabc5('0x49')],{})[_0xabc5('0x23')](function(_0x12ae27){var _0x36a4f0=_0x1623bf[_0xabc5('0x4a')]['get']({'plain':!![]});if(!_0x36a4f0)throw new Error(_0xabc5('0x4b'));if(_0x36a4f0['role']==='user'){var _0x30a3c4=_0x12ae27[_0xabc5('0x24')]({'plain':!![]});var _0x47ef5a=_0xabc5('0x25');return db[_0xabc5('0x4c')][_0xabc5('0x47')]({'where':{'name':_0x47ef5a,'userProfileId':_0x36a4f0[_0xabc5('0x4d')]},'raw':!![]})[_0xabc5('0x23')](function(_0x31ff53){if(_0x31ff53&&_0x31ff53[_0xabc5('0x4e')]===0x0){return db[_0xabc5('0x26')][_0xabc5('0x48')]({'name':_0x30a3c4[_0xabc5('0x2a')],'resourceId':_0x30a3c4['id'],'type':_0x31ff53['name'],'sectionId':_0x31ff53['id']},{})[_0xabc5('0x23')](function(){return _0x12ae27;});}else{return _0x12ae27;}})[_0xabc5('0x43')](function(_0x132799){logger['error'](_0xabc5('0x4f'),_0x132799);throw _0x132799;});}return _0x12ae27;})['then'](respondWithResult(_0x4ccf1d,0xc9))['catch'](handleError(_0x4ccf1d,null));};exports[_0xabc5('0x22')]=function(_0x55b1d9,_0x3425bb){if(_0x55b1d9[_0xabc5('0x49')]['id']){delete _0x55b1d9[_0xabc5('0x49')]['id'];}return db[_0xabc5('0x2c')][_0xabc5('0x47')]({'where':{'id':_0x55b1d9[_0xabc5('0x44')]['id']}})[_0xabc5('0x23')](handleEntityNotFound(_0x3425bb,null))[_0xabc5('0x23')](saveUpdates(_0x55b1d9['body'],null))['then'](respondWithResult(_0x3425bb,null))[_0xabc5('0x43')](handleError(_0x3425bb,null));};exports[_0xabc5('0x27')]=function(_0x36dcdd,_0x13d3d8){return db['Pause']['find']({'where':{'id':_0x36dcdd[_0xabc5('0x44')]['id']}})[_0xabc5('0x23')](handleEntityNotFound(_0x13d3d8,null))[_0xabc5('0x23')](removeEntity(_0x13d3d8,null))['catch'](handleError(_0x13d3d8,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index ca36507..c85d225 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 _0x53ec=['bluebird','path','../../config/environment','./pause.attributes','define','Pause','lodash','util','../../config/logger','api','moment'];(function(_0x398552,_0x1609a7){var _0x33ffa5=function(_0x18df8){while(--_0x18df8){_0x398552['push'](_0x398552['shift']());}};_0x33ffa5(++_0x1609a7);}(_0x53ec,0x192));var _0xc53e=function(_0x16bd44,_0x3c91ba){_0x16bd44=_0x16bd44-0x0;var _0x368a61=_0x53ec[_0x16bd44];return _0x368a61;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['tools_pauses','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x599d5b,_0x5a8fb3){var _0x37d6d3=function(_0x4178f2){while(--_0x4178f2){_0x599d5b['push'](_0x599d5b['shift']());}};_0x37d6d3(++_0x5a8fb3);}(_0x326f,0xd1));var _0xf326=function(_0x1edf32,_0x1246c7){_0x1edf32=_0x1edf32-0x0;var _0x291779=_0x326f[_0x1edf32];return _0x291779;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 063915a..515198c 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(_0x32db44,_0x4c355c){var _0x115357=function(_0x2e52b9){while(--_0x2e52b9){_0x32db44['push'](_0x32db44['shift']());}};_0x115357(++_0x4c355c);}(_0x7a54,0x106));var _0x47a5=function(_0x2f7cfa,_0x3b009b){_0x2f7cfa=_0x2f7cfa-0x0;var _0x220ecb=_0x7a54[_0x2f7cfa];return _0x220ecb;};'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 _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x24ac93,_0x5351d4){var _0xd0a4aa=function(_0x3652f7){while(--_0x3652f7){_0x24ac93['push'](_0x24ac93['shift']());}};_0xd0a4aa(++_0x5351d4);}(_0xb10b,0x12a));var _0xbb10=function(_0x1b857f,_0x286e31){_0x1b857f=_0x1b857f-0x0;var _0x5582e9=_0xb10b[_0x1b857f];return _0x5582e9;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 9d9cdc2..0e00d41 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 _0x8ce3=['update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','/webhook','webhookGet','get','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','extname','post','single','upload','put','/:id'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x8ce3,0xc3));var _0x38ce=function(_0x3284cd,_0x2e10a2){_0x3284cd=_0x3284cd-0x0;var _0xe92280=_0x8ce3[_0x3284cd];return _0xe92280;};'use strict';var multer=require(_0x38ce('0x0'));var util=require(_0x38ce('0x1'));var path=require('path');var timeout=require(_0x38ce('0x2'));var express=require(_0x38ce('0x3'));var router=express[_0x38ce('0x4')]();var fs_extra=require(_0x38ce('0x5'));var auth=require(_0x38ce('0x6'));var interaction=require(_0x38ce('0x7'));var config=require(_0x38ce('0x8'));var controller=require(_0x38ce('0x9'));router['get']('/',auth[_0x38ce('0xa')](),controller[_0x38ce('0xb')]);router['get'](_0x38ce('0xc'),controller[_0x38ce('0xd')]);router[_0x38ce('0xe')]('/:id',auth[_0x38ce('0xa')](),controller['show']);router[_0x38ce('0xe')]('/:id/download',auth[_0x38ce('0xa')](),controller[_0x38ce('0xf')]);var upload=multer({'storage':multer[_0x38ce('0x10')]({'destination':function(_0x2c0cab,_0x564332,_0x3603fa){_0x3603fa(null,path[_0x38ce('0x11')](config[_0x38ce('0x12')],_0x38ce('0x13')));},'filename':function(_0xe33aec,_0x42e234,_0x3ef662){_0x42e234[_0x38ce('0x14')]=_0x42e234[_0x38ce('0x14')][_0x38ce('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3ef662(null,util[_0x38ce('0x16')]('%s-%s%s',path['basename'](_0x42e234[_0x38ce('0x14')],path[_0x38ce('0x17')](_0x42e234[_0x38ce('0x14')])),Date['now'](),path[_0x38ce('0x17')](_0x42e234['originalname'])));}})});router[_0x38ce('0x18')]('/',upload[_0x38ce('0x19')]('file'),controller[_0x38ce('0x1a')]);router[_0x38ce('0x18')](_0x38ce('0xc'),controller['webhookPost']);router[_0x38ce('0x1b')](_0x38ce('0x1c'),auth[_0x38ce('0xa')](),controller[_0x38ce('0x1d')]);router[_0x38ce('0x1e')](_0x38ce('0x1c'),auth[_0x38ce('0xa')](),controller['delete']);module[_0x38ce('0x1f')]=router; \ No newline at end of file +var _0x3140=['../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','/:id/download','download','diskStorage','join','server/files/plugins','originalname','replace','%s-%s%s','basename','extname','now','single','file','upload','delete','multer','util','path','connect-timeout','fs-extra'];(function(_0x24f978,_0x2bf699){var _0x7a7347=function(_0x1a5e21){while(--_0x1a5e21){_0x24f978['push'](_0x24f978['shift']());}};_0x7a7347(++_0x2bf699);}(_0x3140,0xaf));var _0x0314=function(_0xf9a6cf,_0x11870e){_0xf9a6cf=_0xf9a6cf-0x0;var _0x59e2bc=_0x3140[_0xf9a6cf];return _0x59e2bc;};'use strict';var multer=require(_0x0314('0x0'));var util=require(_0x0314('0x1'));var path=require(_0x0314('0x2'));var timeout=require(_0x0314('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0314('0x4'));var auth=require(_0x0314('0x5'));var interaction=require(_0x0314('0x6'));var config=require(_0x0314('0x7'));var controller=require(_0x0314('0x8'));router[_0x0314('0x9')]('/',auth[_0x0314('0xa')](),controller[_0x0314('0xb')]);router[_0x0314('0x9')](_0x0314('0xc'),controller[_0x0314('0xd')]);router['get'](_0x0314('0xe'),auth[_0x0314('0xa')](),controller['show']);router['get'](_0x0314('0xf'),auth['isAuthenticated'](),controller[_0x0314('0x10')]);var upload=multer({'storage':multer[_0x0314('0x11')]({'destination':function(_0x3a7713,_0x376da9,_0x375416){_0x375416(null,path[_0x0314('0x12')](config['root'],_0x0314('0x13')));},'filename':function(_0x2bc151,_0xd85ddf,_0x4602ec){_0xd85ddf[_0x0314('0x14')]=_0xd85ddf[_0x0314('0x14')][_0x0314('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4602ec(null,util['format'](_0x0314('0x16'),path[_0x0314('0x17')](_0xd85ddf[_0x0314('0x14')],path[_0x0314('0x18')](_0xd85ddf[_0x0314('0x14')])),Date[_0x0314('0x19')](),path[_0x0314('0x18')](_0xd85ddf[_0x0314('0x14')])));}})});router['post']('/',upload[_0x0314('0x1a')](_0x0314('0x1b')),controller[_0x0314('0x1c')]);router['post'](_0x0314('0xc'),controller['webhookPost']);router['put'](_0x0314('0xe'),auth[_0x0314('0xa')](),controller['update']);router[_0x0314('0x1d')](_0x0314('0xe'),auth['isAuthenticated'](),controller[_0x0314('0x1d')]);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 1ec8516..42a0d70 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 _0x3fa4=['ENUM','adminOnly','agentOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','html','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN'];(function(_0x5a0948,_0x5591f2){var _0x4b58c0=function(_0xdeef38){while(--_0xdeef38){_0x5a0948['push'](_0x5a0948['shift']());}};_0x4b58c0(++_0x5591f2);}(_0x3fa4,0xf0));var _0x43fa=function(_0x1e0041,_0x2233d8){_0x1e0041=_0x1e0041-0x0;var _0x4fec2e=_0x3fa4[_0x1e0041];return _0x4fec2e;};'use strict';var Sequelize=require(_0x43fa('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x43fa('0x1'),_0x43fa('0x2'))},'description':{'type':Sequelize[_0x43fa('0x3')]},'version':{'type':Sequelize[_0x43fa('0x3')]},'path':{'type':Sequelize[_0x43fa('0x4')],'comment':_0x43fa('0x5')},'active':{'type':Sequelize[_0x43fa('0x6')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x43fa('0x7')](_0x43fa('0x8'),_0x43fa('0x9'),'always',_0x43fa('0xa')),'defaultValue':_0x43fa('0xb'),'comment':_0x43fa('0xc')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x43fa('0x4')]},'agentUrl':{'type':Sequelize[_0x43fa('0x4')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x30bb=['The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','agentOnly','never','sequelize','exports','STRING','html','script'];(function(_0x3eff34,_0x2fa66e){var _0x4bc1be=function(_0x30b8b){while(--_0x30b8b){_0x3eff34['push'](_0x3eff34['shift']());}};_0x4bc1be(++_0x2fa66e);}(_0x30bb,0x175));var _0xb30b=function(_0x3da582,_0x27c58a){_0x3da582=_0x3da582-0x0;var _0x5d6ee1=_0x30bb[_0x3da582];return _0x5d6ee1;};'use strict';var Sequelize=require(_0xb30b('0x0'));module[_0xb30b('0x1')]={'name':{'type':Sequelize[_0xb30b('0x2')]},'type':{'type':Sequelize['ENUM'](_0xb30b('0x3'),_0xb30b('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0xb30b('0x2')],'comment':_0xb30b('0x5')},'active':{'type':Sequelize[_0xb30b('0x6')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize['ENUM']('adminOnly',_0xb30b('0x7'),'always',_0xb30b('0x8')),'defaultValue':'always','comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0xb30b('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0xb30b('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xb30b('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index c70f71d..07cb31c 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 _0xe8c8=['content-type','endsWith','statusCode','webhookPost','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','register','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','Plugins','UserProfileResource','sendStatus','error','stack','send','map','Plugin','rawAttributes','fieldName','type','name','query','keys','attributes','intersection','fields','length','model','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','**/*','dirname','join','node_modules/**/*','attachments/**/*','finalize','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','version','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','script','scriptPath','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','%s%s','headers','content-length'];(function(_0x35c300,_0x284351){var _0x59e44b=function(_0x327e5c){while(--_0x327e5c){_0x35c300['push'](_0x35c300['shift']());}};_0x59e44b(++_0x284351);}(_0xe8c8,0xaf));var _0x8e8c=function(_0x14f336,_0x222093){_0x14f336=_0x14f336-0x0;var _0x11cc06=_0xe8c8[_0x14f336];return _0x11cc06;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8e8c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8e8c('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8e8c('0x2'));var Mustache=require('mustache');var util=require(_0x8e8c('0x3'));var path=require(_0x8e8c('0x4'));var sox=require(_0x8e8c('0x5'));var csv=require(_0x8e8c('0x6'));var ejs=require(_0x8e8c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8e8c('0x8'));var squel=require(_0x8e8c('0x9'));var crypto=require(_0x8e8c('0xa'));var jsforce=require(_0x8e8c('0xb'));var deskjs=require(_0x8e8c('0xc'));var toCsv=require(_0x8e8c('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var extract=require(_0x8e8c('0xd'));var rimraf=require(_0x8e8c('0x0'));var archiver=require('archiver');var Redis=require(_0x8e8c('0xe'));var authService=require(_0x8e8c('0xf'));var qs=require(_0x8e8c('0x10'));var as=require(_0x8e8c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8e8c('0x12'))(_0x8e8c('0x13'));var utils=require(_0x8e8c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8e8c('0x15'));var db=require(_0x8e8c('0x16'))['db'];config['redis']=_[_0x8e8c('0x17')](config['redis'],{'host':_0x8e8c('0x18'),'port':0x18eb});var socket=require(_0x8e8c('0x19'))(new Redis(config['redis']));require('./plugin.socket')[_0x8e8c('0x1a')](socket);function respondWithStatusCode(_0x52c340,_0x20ed11){_0x20ed11=_0x20ed11||0xcc;return function(_0xb17e32){if(_0xb17e32){return _0x52c340['sendStatus'](_0x20ed11);}return _0x52c340[_0x8e8c('0x1b')](_0x20ed11)[_0x8e8c('0x1c')]();};}function respondWithResult(_0x3f341c,_0x4049a3){_0x4049a3=_0x4049a3||0xc8;return function(_0x44ad69){if(_0x44ad69){return _0x3f341c['status'](_0x4049a3)[_0x8e8c('0x1d')](_0x44ad69);}};}function respondWithFilteredResult(_0x254821,_0x5b5486){return function(_0x4505f6){if(_0x4505f6){var _0x1081c9=typeof _0x5b5486['offset']===_0x8e8c('0x1e')&&typeof _0x5b5486[_0x8e8c('0x1f')]===_0x8e8c('0x1e');var _0x57765c=_0x4505f6[_0x8e8c('0x20')];var _0x20a8f0=_0x1081c9?0x0:_0x5b5486[_0x8e8c('0x21')];var _0x46c895=_0x1081c9?_0x4505f6['count']:_0x5b5486[_0x8e8c('0x21')]+_0x5b5486['limit'];var _0x24f92a;if(_0x46c895>=_0x57765c){_0x46c895=_0x57765c;_0x24f92a=0xc8;}else{_0x24f92a=0xce;}_0x254821[_0x8e8c('0x1b')](_0x24f92a);return _0x254821[_0x8e8c('0x22')](_0x8e8c('0x23'),_0x20a8f0+'-'+_0x46c895+'/'+_0x57765c)[_0x8e8c('0x1d')](_0x4505f6);}return null;};}function patchUpdates(_0x37bc28){return function(_0x5247aa){try{jsonpatch[_0x8e8c('0x24')](_0x5247aa,_0x37bc28,!![]);}catch(_0x2371bc){return BPromise[_0x8e8c('0x25')](_0x2371bc);}return _0x5247aa[_0x8e8c('0x26')]();};}function saveUpdates(_0x21382c,_0x571b65){return function(_0x5804aa){if(_0x5804aa){return _0x5804aa['update'](_0x21382c)[_0x8e8c('0x27')](function(_0x468fee){return _0x468fee;});}return null;};}function removeEntity(_0x404696,_0x388f3f){return function(_0x45164b){if(_0x45164b){return _0x45164b[_0x8e8c('0x28')]()[_0x8e8c('0x27')](function(){var _0x1bef7c=_0x45164b[_0x8e8c('0x29')]({'plain':!![]});var _0x5bd21d=_0x8e8c('0x2a');return db[_0x8e8c('0x2b')][_0x8e8c('0x28')]({'where':{'type':_0x5bd21d,'resourceId':_0x1bef7c['id']}})[_0x8e8c('0x27')](function(){return _0x45164b;});})[_0x8e8c('0x27')](function(){_0x404696[_0x8e8c('0x1b')](0xcc)[_0x8e8c('0x1c')]();});}};}function handleEntityNotFound(_0x4ef271,_0x56353b){return function(_0x325461){if(!_0x325461){_0x4ef271[_0x8e8c('0x2c')](0x194);}return _0x325461;};}function handleError(_0x22b693,_0x424d87){_0x424d87=_0x424d87||0x1f4;return function(_0x34bb86){logger[_0x8e8c('0x2d')](_0x34bb86[_0x8e8c('0x2e')]);if(_0x34bb86['name']){delete _0x34bb86['name'];}_0x22b693[_0x8e8c('0x1b')](_0x424d87)[_0x8e8c('0x2f')](_0x34bb86);};}exports['index']=function(_0x2a9a53,_0x385fa1){var _0x143c24={},_0x47daaa={},_0x56b11d={'count':0x0,'rows':[]};var _0x279e7b=_[_0x8e8c('0x30')](db[_0x8e8c('0x31')][_0x8e8c('0x32')],function(_0x1889ca){return{'name':_0x1889ca[_0x8e8c('0x33')],'type':_0x1889ca[_0x8e8c('0x34')]['key']};});_0x47daaa['model']=_[_0x8e8c('0x30')](_0x279e7b,_0x8e8c('0x35'));_0x47daaa[_0x8e8c('0x36')]=_[_0x8e8c('0x37')](_0x2a9a53[_0x8e8c('0x36')]);_0x47daaa['filters']=_['intersection'](_0x47daaa['model'],_0x47daaa['query']);_0x143c24[_0x8e8c('0x38')]=_[_0x8e8c('0x39')](_0x47daaa['model'],qs[_0x8e8c('0x3a')](_0x2a9a53[_0x8e8c('0x36')]['fields']));_0x143c24[_0x8e8c('0x38')]=_0x143c24[_0x8e8c('0x38')][_0x8e8c('0x3b')]?_0x143c24[_0x8e8c('0x38')]:_0x47daaa[_0x8e8c('0x3c')];if(!_0x2a9a53['query']['hasOwnProperty'](_0x8e8c('0x3d'))){_0x143c24[_0x8e8c('0x1f')]=qs[_0x8e8c('0x1f')](_0x2a9a53['query'][_0x8e8c('0x1f')]);_0x143c24[_0x8e8c('0x21')]=qs[_0x8e8c('0x21')](_0x2a9a53[_0x8e8c('0x36')][_0x8e8c('0x21')]);}_0x143c24[_0x8e8c('0x3e')]=qs[_0x8e8c('0x3f')](_0x2a9a53[_0x8e8c('0x36')]['sort']);_0x143c24[_0x8e8c('0x40')]=qs[_0x8e8c('0x41')](_[_0x8e8c('0x42')](_0x2a9a53['query'],_0x47daaa['filters']),_0x279e7b);if(_0x2a9a53[_0x8e8c('0x36')][_0x8e8c('0x43')]){_0x143c24['where']=_['merge'](_0x143c24[_0x8e8c('0x40')],{'$or':_[_0x8e8c('0x30')](_0x279e7b,function(_0x1b9505){if(_0x1b9505[_0x8e8c('0x34')]!==_0x8e8c('0x44')){var _0x108de3={};_0x108de3[_0x1b9505[_0x8e8c('0x35')]]={'$like':'%'+_0x2a9a53['query'][_0x8e8c('0x43')]+'%'};return _0x108de3;}})});}_0x143c24=_[_0x8e8c('0x45')]({},_0x143c24,_0x2a9a53['options']);var _0x31e31c={'where':_0x143c24[_0x8e8c('0x40')]};return db['Plugin'][_0x8e8c('0x20')](_0x31e31c)[_0x8e8c('0x27')](function(_0x4bfcb4){_0x56b11d['count']=_0x4bfcb4;if(_0x2a9a53[_0x8e8c('0x36')][_0x8e8c('0x46')]){_0x143c24[_0x8e8c('0x47')]=[{'all':!![]}];}return db[_0x8e8c('0x31')][_0x8e8c('0x48')](_0x143c24);})['then'](function(_0x5ed0fc){_0x56b11d[_0x8e8c('0x49')]=_0x5ed0fc;return _0x56b11d;})[_0x8e8c('0x27')](respondWithFilteredResult(_0x385fa1,_0x143c24))[_0x8e8c('0x4a')](handleError(_0x385fa1,null));};exports[_0x8e8c('0x4b')]=function(_0xb4a800,_0x4e8e1e){var _0x5d1d24={'raw':!![],'where':{'id':_0xb4a800[_0x8e8c('0x4c')]['id']}},_0x338432={};_0x338432[_0x8e8c('0x3c')]=_['keys'](db[_0x8e8c('0x31')]['rawAttributes']);_0x338432[_0x8e8c('0x36')]=_[_0x8e8c('0x37')](_0xb4a800[_0x8e8c('0x36')]);_0x338432['filters']=_[_0x8e8c('0x39')](_0x338432[_0x8e8c('0x3c')],_0x338432[_0x8e8c('0x36')]);_0x5d1d24[_0x8e8c('0x38')]=_['intersection'](_0x338432['model'],qs[_0x8e8c('0x3a')](_0xb4a800['query'][_0x8e8c('0x3a')]));_0x5d1d24[_0x8e8c('0x38')]=_0x5d1d24[_0x8e8c('0x38')][_0x8e8c('0x3b')]?_0x5d1d24[_0x8e8c('0x38')]:_0x338432[_0x8e8c('0x3c')];if(_0xb4a800[_0x8e8c('0x36')][_0x8e8c('0x46')]){_0x5d1d24['include']=[{'all':!![]}];}_0x5d1d24=_[_0x8e8c('0x45')]({},_0x5d1d24,_0xb4a800[_0x8e8c('0x4d')]);return db[_0x8e8c('0x31')]['find'](_0x5d1d24)[_0x8e8c('0x27')](handleEntityNotFound(_0x4e8e1e,null))[_0x8e8c('0x27')](respondWithResult(_0x4e8e1e,null))[_0x8e8c('0x4a')](handleError(_0x4e8e1e,null));};exports['download']=function(_0x441f83,_0x3739dd,_0x57d3a3){return db[_0x8e8c('0x31')][_0x8e8c('0x4e')]({'where':{'id':_0x441f83[_0x8e8c('0x4c')]['id']},'attributes':[_0x8e8c('0x35'),_0x8e8c('0x4')],'raw':!![]})[_0x8e8c('0x27')](handleEntityNotFound(_0x3739dd,null))[_0x8e8c('0x27')](function(_0x4b2362){if(_0x4b2362){var _0x456e12=path['join'](config[_0x8e8c('0x4f')],_0x8e8c('0x50'),util[_0x8e8c('0x51')](_0x8e8c('0x52'),path[_0x8e8c('0x53')](_0x4b2362[_0x8e8c('0x4')])));var _0x35a05a=fs[_0x8e8c('0x54')](_0x456e12);var _0x545ce2=archiver(_0x8e8c('0x55'),{'zlib':{'level':0x9}});_0x545ce2['on'](_0x8e8c('0x56'),function(_0x10d079){if(_0x10d079[_0x8e8c('0x57')]===_0x8e8c('0x58')){logger[_0x8e8c('0x2d')](_0x10d079);}else{throw new db['Sequelize'][(_0x8e8c('0x59'))](_0x8e8c('0x5a'));}});_0x545ce2['on'](_0x8e8c('0x2d'),function(_0x424a11){throw new db[(_0x8e8c('0x5b'))]['Error'](_0x8e8c('0x5a'));});_0x545ce2[_0x8e8c('0x5c')](_0x35a05a);_0x545ce2['glob'](_0x8e8c('0x5d'),{'cwd':path['join'](config[_0x8e8c('0x4f')],_0x8e8c('0x50'),path[_0x8e8c('0x5e')](_0x4b2362[_0x8e8c('0x4')])),'ignore':[path[_0x8e8c('0x5f')](path['basename'](_0x4b2362[_0x8e8c('0x4')]),_0x8e8c('0x60')),path[_0x8e8c('0x5f')](path['basename'](_0x4b2362['path']),_0x8e8c('0x61'))],'nodir':!![]})[_0x8e8c('0x62')]();_0x35a05a['on']('close',function(){if(!fs['existsSync'](_0x456e12)){throw new db[(_0x8e8c('0x5b'))][(_0x8e8c('0x59'))](_0x8e8c('0x63'));}return _0x3739dd[_0x8e8c('0x64')](_0x456e12,util['format'](_0x8e8c('0x52'),path[_0x8e8c('0x53')](_0x4b2362['path'])),function(_0x3ac2d9){if(_0x3ac2d9){throw new db[(_0x8e8c('0x5b'))][(_0x8e8c('0x59'))](_0x8e8c('0x65'));}fs['unlinkSync'](_0x456e12);logger[_0x8e8c('0x66')](_0x8e8c('0x67'));logger['info'](_0x8e8c('0x68'));});});}return null;})['catch'](handleError(_0x3739dd,null));};exports[_0x8e8c('0x69')]=function(_0x2b3ce3,_0x48442a,_0x3f1363){var _0x112cbb=path['basename'](_0x2b3ce3[_0x8e8c('0x6a')][_0x8e8c('0x6b')],path[_0x8e8c('0x6c')](_0x2b3ce3[_0x8e8c('0x6a')][_0x8e8c('0x6b')]));var _0x4179b0=path['join'](config[_0x8e8c('0x4f')],'server/files/plugins',_0x2b3ce3[_0x8e8c('0x6a')][_0x8e8c('0x6b')]);var _0x26db0b=path[_0x8e8c('0x5f')](config[_0x8e8c('0x4f')],'server/files/plugins',_0x112cbb);logger['info'](_0x8e8c('0x6d'),_0x4179b0);logger['info'](_0x8e8c('0x6e'),_0x26db0b);try{fs[_0x8e8c('0x6f')](_0x4179b0,parseInt(_0x8e8c('0x70'),0x8));extract(_0x4179b0,{'dir':_0x26db0b},function(_0xba5cf9){if(_0xba5cf9){logger[_0x8e8c('0x2d')](_0xba5cf9);handleError(_0xba5cf9,!![]);};var _0x153638=fs[_0x8e8c('0x71')](_0x26db0b);if(_0x153638['length']>0x1){removeReferences(_0x4179b0,_0x26db0b);logger[_0x8e8c('0x2d')](_0x8e8c('0x72'));return _0x3f1363(new Error(_0x8e8c('0x72')));}var _0x7ef384=fs['lstatSync'](path['join'](_0x26db0b,_0x153638[0x0]));if(_0x7ef384['isFile']()){removeReferences(_0x4179b0,_0x26db0b);logger[_0x8e8c('0x2d')](_0x8e8c('0x72'));return _0x3f1363(new Error(_0x8e8c('0x72')));}if(_0x7ef384[_0x8e8c('0x73')]()){var _0x1856ec=fs[_0x8e8c('0x71')](path[_0x8e8c('0x5f')](_0x26db0b,_0x153638[0x0]));if(_0x1856ec[_0x8e8c('0x3b')]===0x0){removeReferences(_0x4179b0,_0x26db0b);logger[_0x8e8c('0x2d')](_0x8e8c('0x72'));return _0x3f1363(new Error(_0x8e8c('0x72')));}var _0x1619c0=_0x1856ec[_0x8e8c('0x74')](function(_0x50458f){return _0x50458f===_0x8e8c('0x75');});if(!_0x1619c0){return _0x3f1363(new Error(_0x8e8c('0x76')));}var _0x18e82b=fs[_0x8e8c('0x77')](path[_0x8e8c('0x5f')](_0x26db0b,_0x153638[0x0],_0x8e8c('0x75')));var _0x53b2c6=JSON[_0x8e8c('0x78')](_0x18e82b);if('undefined'==typeof _0x53b2c6['name']){return _0x3f1363(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x8e8c('0x1e')==typeof _0x53b2c6[_0x8e8c('0x34')]){return _0x3f1363(new Error(_0x8e8c('0x79')));}if(_0x8e8c('0x1e')==typeof _0x53b2c6['version']){return _0x3f1363(new Error(_0x8e8c('0x7a')));}if(_0x8e8c('0x1e')==typeof _0x53b2c6[_0x8e8c('0x7b')]){return _0x3f1363(new Error(_0x8e8c('0x7c')));}if(_0x53b2c6[_0x8e8c('0x34')]===_0x8e8c('0x7d')){if(_0x8e8c('0x1e')==typeof _0x53b2c6[_0x8e8c('0x7b')][_0x8e8c('0x7e')]){return _0x3f1363(new Error(_0x8e8c('0x7f')));}if(_0x8e8c('0x1e')==typeof _0x53b2c6['parameters']['views'][_0x8e8c('0x80')]&&_0x8e8c('0x1e')==typeof _0x53b2c6[_0x8e8c('0x7b')][_0x8e8c('0x7e')][_0x8e8c('0x81')]){return _0x3f1363(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x53b2c6['type']==='script'){if(_0x8e8c('0x1e')==typeof _0x53b2c6[_0x8e8c('0x7b')]['scriptName']){return _0x3f1363(new Error(_0x8e8c('0x82')));}if(_0x8e8c('0x1e')==typeof _0x53b2c6['parameters']['scriptPath']){return _0x3f1363(new Error(_0x8e8c('0x83')));}}else{return _0x3f1363(new Error(_0x8e8c('0x84')));}var _0x115bf3=_0x53b2c6[_0x8e8c('0x35')];var _0x51c6d1=_0x53b2c6[_0x8e8c('0x85')];var _0xdb0d51=_0x53b2c6['type'];var _0x349f03=_0x53b2c6[_0x8e8c('0x86')]?_0x53b2c6['sidebar']:_0x8e8c('0x87');var _0x873baf=_0x53b2c6[_0x8e8c('0x88')]?_0x53b2c6['icon']:'icon-apps';var _0x23ff9b='';var _0x14f187='';var _0x31d791='';var _0x25f6ce='';var _0x4b4732=_0x53b2c6[_0x8e8c('0x89')];if(_0xdb0d51===_0x8e8c('0x7d')){if(_0x8e8c('0x1e')!=typeof _0x53b2c6['parameters'][_0x8e8c('0x7e')][_0x8e8c('0x80')]){var _0x9e688=_0x53b2c6[_0x8e8c('0x7b')]['views'][_0x8e8c('0x80')];if(!/^(f|ht)tps?:\/\//i[_0x8e8c('0x8a')](_0x9e688)){_0x23ff9b=path[_0x8e8c('0x5f')]('plugins',_0x112cbb,_0x153638[0x0],_0x9e688);}else{_0x23ff9b=_0x9e688;}}else{logger[_0x8e8c('0x66')]('Warning:\x20admin\x20view\x20not\x20specified');}if('undefined'!=typeof _0x53b2c6['parameters'][_0x8e8c('0x7e')][_0x8e8c('0x81')]){var _0x32848d=_0x53b2c6['parameters'][_0x8e8c('0x7e')][_0x8e8c('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x8e8c('0x8a')](_0x32848d)){_0x14f187=path[_0x8e8c('0x5f')](_0x8e8c('0x8b'),_0x112cbb,_0x153638[0x0],_0x32848d);}else{_0x14f187=_0x32848d;}}else{logger[_0x8e8c('0x66')](_0x8e8c('0x8c'));}}else if(_0xdb0d51===_0x8e8c('0x8d')){_0x31d791=_0x53b2c6[_0x8e8c('0x7b')]['scriptName'];_0x25f6ce=_0x53b2c6[_0x8e8c('0x7b')][_0x8e8c('0x8e')];if(_0x8e8c('0x1e')!=typeof _0x53b2c6[_0x8e8c('0x7b')][_0x8e8c('0x7e')]){if(_0x8e8c('0x1e')!=typeof _0x53b2c6['parameters']['views'][_0x8e8c('0x80')]){var _0x9e688=_0x53b2c6[_0x8e8c('0x7b')][_0x8e8c('0x7e')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x8e8c('0x8a')](_0x9e688)){_0x23ff9b=path[_0x8e8c('0x5f')](_0x8e8c('0x8b'),_0x112cbb,_0x153638[0x0],_0x9e688);}else{_0x23ff9b=_0x9e688;}}if('undefined'!=typeof _0x53b2c6[_0x8e8c('0x7b')][_0x8e8c('0x7e')]['agent']){var _0x32848d=_0x53b2c6[_0x8e8c('0x7b')][_0x8e8c('0x7e')][_0x8e8c('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x8e8c('0x8a')](_0x32848d)){_0x14f187=path[_0x8e8c('0x5f')]('plugins',_0x112cbb,_0x153638[0x0],_0x32848d);}else{_0x14f187=_0x32848d;}}}}var _0x2ab8be={'name':_0x115bf3,'description':_0x51c6d1,'path':path[_0x8e8c('0x5f')](_0x112cbb,_0x153638[0x0]),'type':_0xdb0d51,'sidebar':_0x349f03,'icon':_0x873baf,'adminUrl':_0x23ff9b,'agentUrl':_0x14f187,'scriptName':_0x31d791,'scriptPath':_0x25f6ce,'version':_0x4b4732};removeReferences(_0x4179b0,null);return db['Plugin'][_0x8e8c('0x8f')](_0x2ab8be)['then'](function(_0xbc0232){var _0x2f8ce2={'role':_0x2b3ce3[_0x8e8c('0x90')][_0x8e8c('0x91')],'userProfileId':_0x2b3ce3['body'][_0x8e8c('0x92')]};if(!_0x2f8ce2)throw new Error(_0x8e8c('0x93'));if(_0x2f8ce2['role']===_0x8e8c('0x94')){var _0x5ee2aa=_0xbc0232[_0x8e8c('0x29')]({'plain':!![]});return db[_0x8e8c('0x95')][_0x8e8c('0x4e')]({'where':{'name':_0x8e8c('0x2a'),'userProfileId':_0x2f8ce2[_0x8e8c('0x92')]},'raw':!![]})[_0x8e8c('0x27')](function(_0x2fbd3a){if(_0x2fbd3a&&_0x2fbd3a['autoAssociation']===0x0){return db[_0x8e8c('0x2b')]['create']({'name':_0x5ee2aa[_0x8e8c('0x35')],'resourceId':_0x5ee2aa['id'],'type':_0x2fbd3a[_0x8e8c('0x35')],'sectionId':_0x2fbd3a['id']},{})[_0x8e8c('0x27')](function(){return _0xbc0232;});}else{return _0xbc0232;}})[_0x8e8c('0x4a')](function(_0x47cddb){logger[_0x8e8c('0x2d')](_0x8e8c('0x96'),_0x47cddb);throw _0x47cddb;});}return _0xbc0232;})[_0x8e8c('0x27')](respondWithResult(_0x48442a,null))[_0x8e8c('0x4a')](handleError(_0x48442a,null));}});}catch(_0xf882a6){_0x48442a[_0x8e8c('0x1b')](0x1f4)[_0x8e8c('0x2f')](_0xf882a6);}};function removeReferences(_0x3f0278,_0x24d230){try{if(_0x3f0278){fs[_0x8e8c('0x97')](_0x3f0278);logger[_0x8e8c('0x66')](_0x8e8c('0x98'));}if(_0x24d230){rimraf(_0x24d230,function(){});logger['info'](_0x8e8c('0x99'));}}catch(_0x5d7f91){logger[_0x8e8c('0x2d')](_0x5d7f91);}}exports[_0x8e8c('0x9a')]=function(_0x5c9f13,_0x1d3d26,_0x1365d3){return db[_0x8e8c('0x31')]['find']({'where':{'id':_0x5c9f13[_0x8e8c('0x4c')]['id']}})[_0x8e8c('0x27')](handleEntityNotFound(_0x1d3d26,null))[_0x8e8c('0x27')](saveUpdates(_0x5c9f13[_0x8e8c('0x90')],null))[_0x8e8c('0x27')](respondWithResult(_0x1d3d26,null))[_0x8e8c('0x4a')](handleError(_0x1d3d26,null));};exports[_0x8e8c('0x9b')]=function(_0x4ef1ed,_0x30e6d0,_0x343a02){return db[_0x8e8c('0x31')][_0x8e8c('0x4e')]({'where':{'id':_0x4ef1ed[_0x8e8c('0x4c')]['id']}})[_0x8e8c('0x27')](function(_0x36b112){if(_0x36b112){return _0x36b112[_0x8e8c('0x28')]();}})['then'](function(_0x2d331f){rimraf(path['join'](config[_0x8e8c('0x4f')],_0x8e8c('0x50'),path[_0x8e8c('0x5e')](_0x2d331f[_0x8e8c('0x4')])),function(){});return _0x2d331f;})['then'](handleEntityNotFound(_0x30e6d0,null))['then'](respondWithStatusCode(_0x30e6d0,null))[_0x8e8c('0x4a')](handleError(_0x30e6d0,null));};exports[_0x8e8c('0x9c')]=function(_0x3ab074,_0x22ee09,_0x51314e){return BPromise[_0x8e8c('0x9d')]()['then'](function(){if(!_0x3ab074[_0x8e8c('0x36')][_0x8e8c('0x4')]){throw new Error(_0x8e8c('0x9e'));}if(!_0x3ab074[_0x8e8c('0x36')][_0x8e8c('0x9f')]){throw new Error(_0x8e8c('0xa0'));}var _0x5a1de9=_0x3ab074['query']['hostname']?_0x3ab074[_0x8e8c('0x36')][_0x8e8c('0xa1')]+':'+_0x3ab074[_0x8e8c('0x36')][_0x8e8c('0x9f')]:'http://localhost:'+_0x3ab074[_0x8e8c('0x36')][_0x8e8c('0x9f')];var _0x2d3d9c=_0x3ab074[_0x8e8c('0x36')]['json']?_0x3ab074['query']['json']:!![];var _0x91c63a=_0x3ab074[_0x8e8c('0x36')][_0x8e8c('0xa2')]?_0x3ab074[_0x8e8c('0x36')][_0x8e8c('0xa2')]:null;var _0x5f5d69={'method':_0x3ab074[_0x8e8c('0xa3')],'uri':util[_0x8e8c('0x51')](_0x8e8c('0xa4'),_0x5a1de9,_0x3ab074['query']['path']),'json':_0x2d3d9c,'resolveWithFullResponse':!![],'encoding':_0x91c63a,'qs':_0x3ab074[_0x8e8c('0x36')]};if(_0x3ab074[_0x8e8c('0xa5')]){_0x5f5d69[_0x8e8c('0xa5')]=_0x3ab074[_0x8e8c('0xa5')];if(_0x5f5d69[_0x8e8c('0xa5')][_0x8e8c('0xa6')]){delete _0x5f5d69['headers'][_0x8e8c('0xa6')];}}if(_0x5f5d69[_0x8e8c('0xa5')][_0x8e8c('0xa7')]){delete _0x5f5d69['headers'][_0x8e8c('0xa7')];}return rp(_0x5f5d69);})[_0x8e8c('0x27')](function(_0x27cd2c){if(_0x27cd2c){_0x22ee09[_0x8e8c('0x22')](_0x27cd2c[_0x8e8c('0xa5')]);logger[_0x8e8c('0x66')](_0x27cd2c['body']);if(_[_0x8e8c('0xa8')](_0x3ab074[_0x8e8c('0x36')][_0x8e8c('0x4')],_0x8e8c('0x64'))&&_0x27cd2c[_0x8e8c('0xa9')]==0x1f4){return _0x22ee09[_0x8e8c('0x2c')](_0x27cd2c[_0x8e8c('0xa9')]);}else{return _0x22ee09[_0x8e8c('0x1b')](_0x27cd2c[_0x8e8c('0xa9')])[_0x8e8c('0x2f')](_0x27cd2c[_0x8e8c('0x90')]);}}else{return _0x22ee09[_0x8e8c('0x2c')](0xc8);}})[_0x8e8c('0x4a')](handleError(_0x22ee09,null));};exports[_0x8e8c('0xaa')]=function(_0x27f081,_0xb486e0,_0x45b1c9){return BPromise[_0x8e8c('0x9d')]()[_0x8e8c('0x27')](function(){if(!_0x27f081['query'][_0x8e8c('0x4')]){throw new Error(_0x8e8c('0x9e'));}if(!_0x27f081[_0x8e8c('0x36')][_0x8e8c('0x9f')]){throw new Error(_0x8e8c('0xa0'));}var _0x3c5359=_0x27f081[_0x8e8c('0x36')]['hostname']?_0x27f081['query']['hostname']+':'+_0x27f081[_0x8e8c('0x36')][_0x8e8c('0x9f')]:'http://localhost:'+_0x27f081[_0x8e8c('0x36')]['port'];var _0x4126be=_0x27f081[_0x8e8c('0x36')][_0x8e8c('0x1d')]?_0x27f081['query'][_0x8e8c('0x1d')]:!![];var _0x16f735=_0x27f081['query']['encoding']?_0x27f081[_0x8e8c('0x36')][_0x8e8c('0xa2')]:null;var _0x17b2e4={'method':_0x27f081[_0x8e8c('0xa3')],'uri':util[_0x8e8c('0x51')](_0x8e8c('0xa4'),_0x3c5359,_0x27f081[_0x8e8c('0x36')][_0x8e8c('0x4')]),'json':_0x4126be,'resolveWithFullResponse':!![],'encoding':_0x16f735,'body':_0x27f081[_0x8e8c('0x90')]};if(_0x27f081[_0x8e8c('0xa5')]){_0x17b2e4[_0x8e8c('0xa5')]=_0x27f081[_0x8e8c('0xa5')];if(_0x17b2e4[_0x8e8c('0xa5')]['content-length']){delete _0x17b2e4[_0x8e8c('0xa5')]['content-length'];}}if(_0x17b2e4['headers'][_0x8e8c('0xa7')]){delete _0x17b2e4[_0x8e8c('0xa5')]['content-type'];}return rp(_0x17b2e4);})[_0x8e8c('0x27')](function(_0x3290e1){if(_0x3290e1){_0xb486e0[_0x8e8c('0x22')](_0x3290e1[_0x8e8c('0xa5')]);logger[_0x8e8c('0x66')](_0x3290e1['body']);return _0xb486e0[_0x8e8c('0x1b')](_0x3290e1[_0x8e8c('0xa9')])['send'](_0x3290e1['body']);}else{return _0xb486e0['sendStatus'](0xc8);}})[_0x8e8c('0x4a')](handleError(_0xb486e0,null));}; \ No newline at end of file +var _0x5307=['../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','json','undefined','offset','count','Content-Range','apply','update','then','destroy','get','Plugins','UserProfileResource','status','end','sendStatus','error','stack','name','send','index','Plugin','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','download','join','server/files/plugins','format','%s.zip','zip','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','root','node_modules/**/*','basename','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','file','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','some','Plugin\x20manifest\x20missing','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','html','views','Invalid\x20manifest:\x20views\x20missing','parameters','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','admin','plugins','test','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','body','role','userProfileId','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','%s%s','headers','content-type','set','endsWith','statusCode','webhookPost','method','content-length','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x320d18,_0x7a06d9){var _0x18166f=function(_0x15c016){while(--_0x15c016){_0x320d18['push'](_0x320d18['shift']());}};_0x18166f(++_0x7a06d9);}(_0x5307,0x142));var _0x7530=function(_0x4b0bdd,_0x198b08){_0x4b0bdd=_0x4b0bdd-0x0;var _0x2293c9=_0x5307[_0x4b0bdd];return _0x2293c9;};'use strict';var emlformat=require(_0x7530('0x0'));var rimraf=require(_0x7530('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7530('0x2'));var rp=require(_0x7530('0x3'));var moment=require('moment');var BPromise=require(_0x7530('0x4'));var Mustache=require(_0x7530('0x5'));var util=require(_0x7530('0x6'));var path=require(_0x7530('0x7'));var sox=require(_0x7530('0x8'));var csv=require('to-csv');var ejs=require(_0x7530('0x9'));var fs=require('fs');var fs_extra=require(_0x7530('0xa'));var _=require(_0x7530('0xb'));var squel=require(_0x7530('0xc'));var crypto=require(_0x7530('0xd'));var jsforce=require(_0x7530('0xe'));var deskjs=require(_0x7530('0xf'));var toCsv=require(_0x7530('0x10'));var querystring=require(_0x7530('0x11'));var Papa=require(_0x7530('0x12'));var extract=require(_0x7530('0x13'));var rimraf=require(_0x7530('0x1'));var archiver=require(_0x7530('0x14'));var Redis=require(_0x7530('0x15'));var authService=require(_0x7530('0x16'));var qs=require(_0x7530('0x17'));var as=require(_0x7530('0x18'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7530('0x19'));var utils=require(_0x7530('0x1a'));var config=require(_0x7530('0x1b'));var licenseUtil=require(_0x7530('0x1c'));var db=require(_0x7530('0x1d'))['db'];config[_0x7530('0x1e')]=_['defaults'](config[_0x7530('0x1e')],{'host':_0x7530('0x1f'),'port':0x18eb});var socket=require(_0x7530('0x20'))(new Redis(config[_0x7530('0x1e')]));require('./plugin.socket')['register'](socket);function respondWithStatusCode(_0x4ccdad,_0x513d15){_0x513d15=_0x513d15||0xcc;return function(_0x8c31f0){if(_0x8c31f0){return _0x4ccdad['sendStatus'](_0x513d15);}return _0x4ccdad['status'](_0x513d15)['end']();};}function respondWithResult(_0xfe8f7a,_0x399328){_0x399328=_0x399328||0xc8;return function(_0x478ad8){if(_0x478ad8){return _0xfe8f7a['status'](_0x399328)[_0x7530('0x21')](_0x478ad8);}};}function respondWithFilteredResult(_0x404eb4,_0x307235){return function(_0xedb9b5){if(_0xedb9b5){var _0x45b125=typeof _0x307235['offset']===_0x7530('0x22')&&typeof _0x307235['limit']==='undefined';var _0x4c00b6=_0xedb9b5['count'];var _0x5a4878=_0x45b125?0x0:_0x307235[_0x7530('0x23')];var _0x252aaf=_0x45b125?_0xedb9b5[_0x7530('0x24')]:_0x307235['offset']+_0x307235['limit'];var _0x4a2af2;if(_0x252aaf>=_0x4c00b6){_0x252aaf=_0x4c00b6;_0x4a2af2=0xc8;}else{_0x4a2af2=0xce;}_0x404eb4['status'](_0x4a2af2);return _0x404eb4['set'](_0x7530('0x25'),_0x5a4878+'-'+_0x252aaf+'/'+_0x4c00b6)[_0x7530('0x21')](_0xedb9b5);}return null;};}function patchUpdates(_0x30bc60){return function(_0x4d5cf9){try{jsonpatch[_0x7530('0x26')](_0x4d5cf9,_0x30bc60,!![]);}catch(_0x204887){return BPromise['reject'](_0x204887);}return _0x4d5cf9['save']();};}function saveUpdates(_0x2f40a5,_0x1d406a){return function(_0x3ce32c){if(_0x3ce32c){return _0x3ce32c[_0x7530('0x27')](_0x2f40a5)[_0x7530('0x28')](function(_0x1509dd){return _0x1509dd;});}return null;};}function removeEntity(_0xcfee59,_0x86321a){return function(_0x112665){if(_0x112665){return _0x112665[_0x7530('0x29')]()[_0x7530('0x28')](function(){var _0x4fae68=_0x112665[_0x7530('0x2a')]({'plain':!![]});var _0x5eda16=_0x7530('0x2b');return db[_0x7530('0x2c')][_0x7530('0x29')]({'where':{'type':_0x5eda16,'resourceId':_0x4fae68['id']}})[_0x7530('0x28')](function(){return _0x112665;});})[_0x7530('0x28')](function(){_0xcfee59[_0x7530('0x2d')](0xcc)[_0x7530('0x2e')]();});}};}function handleEntityNotFound(_0x2b797a,_0x7214e3){return function(_0x74c4da){if(!_0x74c4da){_0x2b797a[_0x7530('0x2f')](0x194);}return _0x74c4da;};}function handleError(_0x22824f,_0x3c46cc){_0x3c46cc=_0x3c46cc||0x1f4;return function(_0x1348d5){logger[_0x7530('0x30')](_0x1348d5[_0x7530('0x31')]);if(_0x1348d5[_0x7530('0x32')]){delete _0x1348d5['name'];}_0x22824f[_0x7530('0x2d')](_0x3c46cc)[_0x7530('0x33')](_0x1348d5);};}exports[_0x7530('0x34')]=function(_0x358cdc,_0x18e3e1){var _0x9189d3={},_0x50767a={},_0x12feec={'count':0x0,'rows':[]};var _0x24f61f=_['map'](db[_0x7530('0x35')][_0x7530('0x36')],function(_0x1e4037){return{'name':_0x1e4037[_0x7530('0x37')],'type':_0x1e4037[_0x7530('0x38')][_0x7530('0x39')]};});_0x50767a[_0x7530('0x3a')]=_['map'](_0x24f61f,_0x7530('0x32'));_0x50767a[_0x7530('0x3b')]=_[_0x7530('0x3c')](_0x358cdc[_0x7530('0x3b')]);_0x50767a['filters']=_[_0x7530('0x3d')](_0x50767a['model'],_0x50767a['query']);_0x9189d3['attributes']=_['intersection'](_0x50767a['model'],qs[_0x7530('0x3e')](_0x358cdc[_0x7530('0x3b')][_0x7530('0x3e')]));_0x9189d3[_0x7530('0x3f')]=_0x9189d3[_0x7530('0x3f')]['length']?_0x9189d3['attributes']:_0x50767a['model'];if(!_0x358cdc[_0x7530('0x3b')][_0x7530('0x40')]('nolimit')){_0x9189d3[_0x7530('0x41')]=qs[_0x7530('0x41')](_0x358cdc[_0x7530('0x3b')][_0x7530('0x41')]);_0x9189d3[_0x7530('0x23')]=qs[_0x7530('0x23')](_0x358cdc[_0x7530('0x3b')]['offset']);}_0x9189d3[_0x7530('0x42')]=qs[_0x7530('0x43')](_0x358cdc['query']['sort']);_0x9189d3[_0x7530('0x44')]=qs['filters'](_[_0x7530('0x45')](_0x358cdc[_0x7530('0x3b')],_0x50767a[_0x7530('0x46')]),_0x24f61f);if(_0x358cdc['query'][_0x7530('0x47')]){_0x9189d3[_0x7530('0x44')]=_[_0x7530('0x48')](_0x9189d3[_0x7530('0x44')],{'$or':_['map'](_0x24f61f,function(_0x145f76){if(_0x145f76[_0x7530('0x38')]!==_0x7530('0x49')){var _0x5d5548={};_0x5d5548[_0x145f76[_0x7530('0x32')]]={'$like':'%'+_0x358cdc['query'][_0x7530('0x47')]+'%'};return _0x5d5548;}})});}_0x9189d3=_['merge']({},_0x9189d3,_0x358cdc['options']);var _0x43cd13={'where':_0x9189d3['where']};return db[_0x7530('0x35')]['count'](_0x43cd13)[_0x7530('0x28')](function(_0x151760){_0x12feec[_0x7530('0x24')]=_0x151760;if(_0x358cdc['query'][_0x7530('0x4a')]){_0x9189d3[_0x7530('0x4b')]=[{'all':!![]}];}return db[_0x7530('0x35')][_0x7530('0x4c')](_0x9189d3);})['then'](function(_0xc16ad3){_0x12feec[_0x7530('0x4d')]=_0xc16ad3;return _0x12feec;})['then'](respondWithFilteredResult(_0x18e3e1,_0x9189d3))[_0x7530('0x4e')](handleError(_0x18e3e1,null));};exports[_0x7530('0x4f')]=function(_0x17d2d4,_0x41ec7b){var _0x5af210={'raw':!![],'where':{'id':_0x17d2d4[_0x7530('0x50')]['id']}},_0x3270fe={};_0x3270fe[_0x7530('0x3a')]=_['keys'](db['Plugin']['rawAttributes']);_0x3270fe[_0x7530('0x3b')]=_[_0x7530('0x3c')](_0x17d2d4[_0x7530('0x3b')]);_0x3270fe[_0x7530('0x46')]=_[_0x7530('0x3d')](_0x3270fe[_0x7530('0x3a')],_0x3270fe[_0x7530('0x3b')]);_0x5af210[_0x7530('0x3f')]=_['intersection'](_0x3270fe[_0x7530('0x3a')],qs[_0x7530('0x3e')](_0x17d2d4['query'][_0x7530('0x3e')]));_0x5af210['attributes']=_0x5af210['attributes'][_0x7530('0x51')]?_0x5af210[_0x7530('0x3f')]:_0x3270fe[_0x7530('0x3a')];if(_0x17d2d4[_0x7530('0x3b')][_0x7530('0x4a')]){_0x5af210[_0x7530('0x4b')]=[{'all':!![]}];}_0x5af210=_[_0x7530('0x48')]({},_0x5af210,_0x17d2d4[_0x7530('0x52')]);return db[_0x7530('0x35')][_0x7530('0x53')](_0x5af210)[_0x7530('0x28')](handleEntityNotFound(_0x41ec7b,null))['then'](respondWithResult(_0x41ec7b,null))['catch'](handleError(_0x41ec7b,null));};exports[_0x7530('0x54')]=function(_0x53e230,_0xff3a07,_0x19741f){return db[_0x7530('0x35')]['find']({'where':{'id':_0x53e230['params']['id']},'attributes':[_0x7530('0x32'),_0x7530('0x7')],'raw':!![]})[_0x7530('0x28')](handleEntityNotFound(_0xff3a07,null))['then'](function(_0x28e6ac){if(_0x28e6ac){var _0x1cce1f=path[_0x7530('0x55')](config['root'],_0x7530('0x56'),util[_0x7530('0x57')](_0x7530('0x58'),path['basename'](_0x28e6ac[_0x7530('0x7')])));var _0x178d23=fs['createWriteStream'](_0x1cce1f);var _0x4d994d=archiver(_0x7530('0x59'),{'zlib':{'level':0x9}});_0x4d994d['on'](_0x7530('0x5a'),function(_0x171a03){if(_0x171a03['code']===_0x7530('0x5b')){logger[_0x7530('0x30')](_0x171a03);}else{throw new db[(_0x7530('0x5c'))][(_0x7530('0x5d'))](_0x7530('0x5e'));}});_0x4d994d['on'](_0x7530('0x30'),function(_0xddabdf){throw new db[(_0x7530('0x5c'))][(_0x7530('0x5d'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x4d994d[_0x7530('0x5f')](_0x178d23);_0x4d994d[_0x7530('0x60')]('**/*',{'cwd':path[_0x7530('0x55')](config[_0x7530('0x61')],_0x7530('0x56'),path['dirname'](_0x28e6ac[_0x7530('0x7')])),'ignore':[path[_0x7530('0x55')](path['basename'](_0x28e6ac[_0x7530('0x7')]),_0x7530('0x62')),path[_0x7530('0x55')](path[_0x7530('0x63')](_0x28e6ac[_0x7530('0x7')]),_0x7530('0x64'))],'nodir':!![]})[_0x7530('0x65')]();_0x178d23['on'](_0x7530('0x66'),function(){if(!fs[_0x7530('0x67')](_0x1cce1f)){throw new db[(_0x7530('0x5c'))][(_0x7530('0x5d'))](_0x7530('0x68'));}return _0xff3a07[_0x7530('0x54')](_0x1cce1f,util['format'](_0x7530('0x58'),path['basename'](_0x28e6ac[_0x7530('0x7')])),function(_0x261eff){if(_0x261eff){throw new db[(_0x7530('0x5c'))][(_0x7530('0x5d'))](_0x7530('0x69'));}fs['unlinkSync'](_0x1cce1f);logger[_0x7530('0x6a')](_0x7530('0x6b'));logger[_0x7530('0x6a')]('Temporary\x20file\x20removed');});});}return null;})[_0x7530('0x4e')](handleError(_0xff3a07,null));};exports['upload']=function(_0x4acf7a,_0x2dba8c,_0x10345b){var _0x5d2aff=path[_0x7530('0x63')](_0x4acf7a[_0x7530('0x6c')]['filename'],path[_0x7530('0x6d')](_0x4acf7a[_0x7530('0x6c')]['filename']));var _0x40b23c=path[_0x7530('0x55')](config[_0x7530('0x61')],'server/files/plugins',_0x4acf7a['file']['filename']);var _0x374fe3=path[_0x7530('0x55')](config[_0x7530('0x61')],_0x7530('0x56'),_0x5d2aff);logger[_0x7530('0x6a')](_0x7530('0x6e'),_0x40b23c);logger[_0x7530('0x6a')](_0x7530('0x6f'),_0x374fe3);try{fs[_0x7530('0x70')](_0x40b23c,parseInt(_0x7530('0x71'),0x8));extract(_0x40b23c,{'dir':_0x374fe3},function(_0x3865d7){if(_0x3865d7){logger[_0x7530('0x30')](_0x3865d7);handleError(_0x3865d7,!![]);};var _0x1a1147=fs[_0x7530('0x72')](_0x374fe3);if(_0x1a1147['length']>0x1){removeReferences(_0x40b23c,_0x374fe3);logger[_0x7530('0x30')](_0x7530('0x73'));return _0x10345b(new Error('Invalid\x20plugin\x20structure'));}var _0x2c03e3=fs[_0x7530('0x74')](path[_0x7530('0x55')](_0x374fe3,_0x1a1147[0x0]));if(_0x2c03e3[_0x7530('0x75')]()){removeReferences(_0x40b23c,_0x374fe3);logger['error'](_0x7530('0x73'));return _0x10345b(new Error(_0x7530('0x73')));}if(_0x2c03e3['isDirectory']()){var _0x71d0bc=fs[_0x7530('0x72')](path[_0x7530('0x55')](_0x374fe3,_0x1a1147[0x0]));if(_0x71d0bc['length']===0x0){removeReferences(_0x40b23c,_0x374fe3);logger[_0x7530('0x30')](_0x7530('0x73'));return _0x10345b(new Error(_0x7530('0x73')));}var _0x4a3acd=_0x71d0bc[_0x7530('0x76')](function(_0x521f3f){return _0x521f3f==='manifest.json';});if(!_0x4a3acd){return _0x10345b(new Error(_0x7530('0x77')));}var _0x33ecae=fs['readFileSync'](path[_0x7530('0x55')](_0x374fe3,_0x1a1147[0x0],_0x7530('0x78')));var _0x4fe413=JSON[_0x7530('0x79')](_0x33ecae);if(_0x7530('0x22')==typeof _0x4fe413[_0x7530('0x32')]){return _0x10345b(new Error(_0x7530('0x7a')));}if(_0x7530('0x22')==typeof _0x4fe413[_0x7530('0x38')]){return _0x10345b(new Error('Invalid\x20manifest:\x20type\x20missing'));}if('undefined'==typeof _0x4fe413[_0x7530('0x7b')]){return _0x10345b(new Error(_0x7530('0x7c')));}if(_0x7530('0x22')==typeof _0x4fe413['parameters']){return _0x10345b(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x4fe413[_0x7530('0x38')]===_0x7530('0x7d')){if(_0x7530('0x22')==typeof _0x4fe413['parameters'][_0x7530('0x7e')]){return _0x10345b(new Error(_0x7530('0x7f')));}if(_0x7530('0x22')==typeof _0x4fe413[_0x7530('0x80')][_0x7530('0x7e')]['admin']&&_0x7530('0x22')==typeof _0x4fe413['parameters'][_0x7530('0x7e')][_0x7530('0x81')]){return _0x10345b(new Error(_0x7530('0x82')));}}else if(_0x4fe413[_0x7530('0x38')]===_0x7530('0x83')){if(_0x7530('0x22')==typeof _0x4fe413[_0x7530('0x80')]['scriptName']){return _0x10345b(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x7530('0x22')==typeof _0x4fe413[_0x7530('0x80')][_0x7530('0x84')]){return _0x10345b(new Error(_0x7530('0x85')));}}else{return _0x10345b(new Error(_0x7530('0x86')));}var _0x349889=_0x4fe413[_0x7530('0x32')];var _0x120080=_0x4fe413[_0x7530('0x87')];var _0x5ee016=_0x4fe413['type'];var _0x766415=_0x4fe413[_0x7530('0x88')]?_0x4fe413['sidebar']:_0x7530('0x89');var _0x543d54=_0x4fe413[_0x7530('0x8a')]?_0x4fe413[_0x7530('0x8a')]:_0x7530('0x8b');var _0x4841c7='';var _0xc5255a='';var _0x28a0b0='';var _0x36bd8c='';var _0x52ba45=_0x4fe413['version'];if(_0x5ee016==='html'){if(_0x7530('0x22')!=typeof _0x4fe413[_0x7530('0x80')][_0x7530('0x7e')][_0x7530('0x8c')]){var _0x43629e=_0x4fe413[_0x7530('0x80')][_0x7530('0x7e')][_0x7530('0x8c')];if(!/^(f|ht)tps?:\/\//i['test'](_0x43629e)){_0x4841c7=path[_0x7530('0x55')](_0x7530('0x8d'),_0x5d2aff,_0x1a1147[0x0],_0x43629e);}else{_0x4841c7=_0x43629e;}}else{logger[_0x7530('0x6a')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x7530('0x22')!=typeof _0x4fe413[_0x7530('0x80')][_0x7530('0x7e')][_0x7530('0x81')]){var _0xe3dc4a=_0x4fe413[_0x7530('0x80')]['views'][_0x7530('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x7530('0x8e')](_0xe3dc4a)){_0xc5255a=path[_0x7530('0x55')]('plugins',_0x5d2aff,_0x1a1147[0x0],_0xe3dc4a);}else{_0xc5255a=_0xe3dc4a;}}else{logger['info'](_0x7530('0x8f'));}}else if(_0x5ee016==='script'){_0x28a0b0=_0x4fe413[_0x7530('0x80')][_0x7530('0x90')];_0x36bd8c=_0x4fe413['parameters'][_0x7530('0x84')];if(_0x7530('0x22')!=typeof _0x4fe413[_0x7530('0x80')][_0x7530('0x7e')]){if(_0x7530('0x22')!=typeof _0x4fe413[_0x7530('0x80')][_0x7530('0x7e')][_0x7530('0x8c')]){var _0x43629e=_0x4fe413[_0x7530('0x80')][_0x7530('0x7e')][_0x7530('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0x7530('0x8e')](_0x43629e)){_0x4841c7=path['join']('plugins',_0x5d2aff,_0x1a1147[0x0],_0x43629e);}else{_0x4841c7=_0x43629e;}}if(_0x7530('0x22')!=typeof _0x4fe413[_0x7530('0x80')]['views'][_0x7530('0x81')]){var _0xe3dc4a=_0x4fe413[_0x7530('0x80')][_0x7530('0x7e')][_0x7530('0x81')];if(!/^(f|ht)tps?:\/\//i['test'](_0xe3dc4a)){_0xc5255a=path[_0x7530('0x55')](_0x7530('0x8d'),_0x5d2aff,_0x1a1147[0x0],_0xe3dc4a);}else{_0xc5255a=_0xe3dc4a;}}}}var _0x156aed={'name':_0x349889,'description':_0x120080,'path':path[_0x7530('0x55')](_0x5d2aff,_0x1a1147[0x0]),'type':_0x5ee016,'sidebar':_0x766415,'icon':_0x543d54,'adminUrl':_0x4841c7,'agentUrl':_0xc5255a,'scriptName':_0x28a0b0,'scriptPath':_0x36bd8c,'version':_0x52ba45};removeReferences(_0x40b23c,null);return db[_0x7530('0x35')][_0x7530('0x91')](_0x156aed)[_0x7530('0x28')](function(_0xdee7eb){var _0x42bc19={'role':_0x4acf7a[_0x7530('0x92')][_0x7530('0x93')],'userProfileId':_0x4acf7a[_0x7530('0x92')][_0x7530('0x94')]};if(!_0x42bc19)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x42bc19[_0x7530('0x93')]===_0x7530('0x95')){var _0x2aef5b=_0xdee7eb[_0x7530('0x2a')]({'plain':!![]});return db[_0x7530('0x96')]['find']({'where':{'name':_0x7530('0x2b'),'userProfileId':_0x42bc19[_0x7530('0x94')]},'raw':!![]})[_0x7530('0x28')](function(_0x1fa779){if(_0x1fa779&&_0x1fa779['autoAssociation']===0x0){return db[_0x7530('0x2c')][_0x7530('0x91')]({'name':_0x2aef5b[_0x7530('0x32')],'resourceId':_0x2aef5b['id'],'type':_0x1fa779[_0x7530('0x32')],'sectionId':_0x1fa779['id']},{})[_0x7530('0x28')](function(){return _0xdee7eb;});}else{return _0xdee7eb;}})['catch'](function(_0x33f163){logger[_0x7530('0x30')](_0x7530('0x97'),_0x33f163);throw _0x33f163;});}return _0xdee7eb;})['then'](respondWithResult(_0x2dba8c,null))[_0x7530('0x4e')](handleError(_0x2dba8c,null));}});}catch(_0x1edca0){_0x2dba8c[_0x7530('0x2d')](0x1f4)[_0x7530('0x33')](_0x1edca0);}};function removeReferences(_0x5c33f7,_0x287158){try{if(_0x5c33f7){fs[_0x7530('0x98')](_0x5c33f7);logger['info'](_0x7530('0x99'));}if(_0x287158){rimraf(_0x287158,function(){});logger['info'](_0x7530('0x9a'));}}catch(_0x22d5e4){logger[_0x7530('0x30')](_0x22d5e4);}}exports['update']=function(_0x487c74,_0xfea78e,_0x5e4a91){return db[_0x7530('0x35')][_0x7530('0x53')]({'where':{'id':_0x487c74['params']['id']}})['then'](handleEntityNotFound(_0xfea78e,null))['then'](saveUpdates(_0x487c74[_0x7530('0x92')],null))[_0x7530('0x28')](respondWithResult(_0xfea78e,null))['catch'](handleError(_0xfea78e,null));};exports[_0x7530('0x9b')]=function(_0x149709,_0x5bf83b,_0x56ac61){return db[_0x7530('0x35')][_0x7530('0x53')]({'where':{'id':_0x149709[_0x7530('0x50')]['id']}})[_0x7530('0x28')](function(_0x141957){if(_0x141957){return _0x141957['destroy']();}})['then'](function(_0x473d84){rimraf(path[_0x7530('0x55')](config[_0x7530('0x61')],_0x7530('0x56'),path[_0x7530('0x9c')](_0x473d84['path'])),function(){});return _0x473d84;})[_0x7530('0x28')](handleEntityNotFound(_0x5bf83b,null))[_0x7530('0x28')](respondWithStatusCode(_0x5bf83b,null))[_0x7530('0x4e')](handleError(_0x5bf83b,null));};exports[_0x7530('0x9d')]=function(_0x2ab9ce,_0x2d792e,_0x234557){return BPromise[_0x7530('0x9e')]()[_0x7530('0x28')](function(){if(!_0x2ab9ce[_0x7530('0x3b')][_0x7530('0x7')]){throw new Error(_0x7530('0x9f'));}if(!_0x2ab9ce['query']['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x24a2ad=_0x2ab9ce[_0x7530('0x3b')][_0x7530('0xa0')]?_0x2ab9ce['query'][_0x7530('0xa0')]+':'+_0x2ab9ce[_0x7530('0x3b')][_0x7530('0xa1')]:_0x7530('0xa2')+_0x2ab9ce[_0x7530('0x3b')][_0x7530('0xa1')];var _0x599117=_0x2ab9ce[_0x7530('0x3b')]['json']?_0x2ab9ce[_0x7530('0x3b')][_0x7530('0x21')]:!![];var _0x549a23=_0x2ab9ce['query'][_0x7530('0xa3')]?_0x2ab9ce[_0x7530('0x3b')][_0x7530('0xa3')]:null;var _0xc6e7ac={'method':_0x2ab9ce['method'],'uri':util[_0x7530('0x57')](_0x7530('0xa4'),_0x24a2ad,_0x2ab9ce[_0x7530('0x3b')][_0x7530('0x7')]),'json':_0x599117,'resolveWithFullResponse':!![],'encoding':_0x549a23,'qs':_0x2ab9ce[_0x7530('0x3b')]};if(_0x2ab9ce[_0x7530('0xa5')]){_0xc6e7ac[_0x7530('0xa5')]=_0x2ab9ce[_0x7530('0xa5')];if(_0xc6e7ac[_0x7530('0xa5')]['content-length']){delete _0xc6e7ac[_0x7530('0xa5')]['content-length'];}}if(_0xc6e7ac[_0x7530('0xa5')][_0x7530('0xa6')]){delete _0xc6e7ac[_0x7530('0xa5')][_0x7530('0xa6')];}return rp(_0xc6e7ac);})[_0x7530('0x28')](function(_0x357a79){if(_0x357a79){_0x2d792e[_0x7530('0xa7')](_0x357a79[_0x7530('0xa5')]);logger['info'](_0x357a79['body']);if(_[_0x7530('0xa8')](_0x2ab9ce[_0x7530('0x3b')][_0x7530('0x7')],'download')&&_0x357a79[_0x7530('0xa9')]==0x1f4){return _0x2d792e[_0x7530('0x2f')](_0x357a79['statusCode']);}else{return _0x2d792e[_0x7530('0x2d')](_0x357a79[_0x7530('0xa9')])[_0x7530('0x33')](_0x357a79['body']);}}else{return _0x2d792e[_0x7530('0x2f')](0xc8);}})[_0x7530('0x4e')](handleError(_0x2d792e,null));};exports[_0x7530('0xaa')]=function(_0x333741,_0x493946,_0x3a36ac){return BPromise[_0x7530('0x9e')]()[_0x7530('0x28')](function(){if(!_0x333741['query'][_0x7530('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x333741[_0x7530('0x3b')][_0x7530('0xa1')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x1a0138=_0x333741[_0x7530('0x3b')][_0x7530('0xa0')]?_0x333741[_0x7530('0x3b')]['hostname']+':'+_0x333741[_0x7530('0x3b')]['port']:_0x7530('0xa2')+_0x333741[_0x7530('0x3b')]['port'];var _0x3b43d6=_0x333741[_0x7530('0x3b')][_0x7530('0x21')]?_0x333741[_0x7530('0x3b')][_0x7530('0x21')]:!![];var _0x519437=_0x333741['query'][_0x7530('0xa3')]?_0x333741['query'][_0x7530('0xa3')]:null;var _0x47a945={'method':_0x333741[_0x7530('0xab')],'uri':util[_0x7530('0x57')]('%s%s',_0x1a0138,_0x333741['query'][_0x7530('0x7')]),'json':_0x3b43d6,'resolveWithFullResponse':!![],'encoding':_0x519437,'body':_0x333741[_0x7530('0x92')]};if(_0x333741[_0x7530('0xa5')]){_0x47a945[_0x7530('0xa5')]=_0x333741[_0x7530('0xa5')];if(_0x47a945[_0x7530('0xa5')]['content-length']){delete _0x47a945[_0x7530('0xa5')][_0x7530('0xac')];}}if(_0x47a945[_0x7530('0xa5')][_0x7530('0xa6')]){delete _0x47a945[_0x7530('0xa5')][_0x7530('0xa6')];}return rp(_0x47a945);})[_0x7530('0x28')](function(_0x2c9dec){if(_0x2c9dec){_0x493946[_0x7530('0xa7')](_0x2c9dec['headers']);logger[_0x7530('0x6a')](_0x2c9dec[_0x7530('0x92')]);return _0x493946[_0x7530('0x2d')](_0x2c9dec['statusCode'])['send'](_0x2c9dec[_0x7530('0x92')]);}else{return _0x493946[_0x7530('0x2f')](0xc8);}})[_0x7530('0x4e')](handleError(_0x493946,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 2729c4d..6b9710d 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 _0xdfa0=['exports','events','Plugin','setMaxListeners','update','remove','emit','hook'];(function(_0x57c4ff,_0x102e4e){var _0x21649c=function(_0x5a4fa9){while(--_0x5a4fa9){_0x57c4ff['push'](_0x57c4ff['shift']());}};_0x21649c(++_0x102e4e);}(_0xdfa0,0x69));var _0x0dfa=function(_0x17ca32,_0x758be9){_0x17ca32=_0x17ca32-0x0;var _0xf4fe04=_0xdfa0[_0x17ca32];return _0xf4fe04;};'use strict';var EventEmitter=require(_0x0dfa('0x0'));var Plugin=require('../../mysqldb')['db'][_0x0dfa('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x0dfa('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0dfa('0x3'),'afterDestroy':_0x0dfa('0x4')};function emitEvent(_0x3691a7){return function(_0x4dbbab,_0x373c4e,_0x50b91e){PluginEvents[_0x0dfa('0x5')](_0x3691a7+':'+_0x4dbbab['id'],_0x4dbbab);PluginEvents[_0x0dfa('0x5')](_0x3691a7,_0x4dbbab);_0x50b91e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x0dfa('0x6')](e,emitEvent(event));}}module[_0x0dfa('0x7')]=PluginEvents; \ No newline at end of file +var _0x0fcd=['hasOwnProperty','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit'];(function(_0x1ebb58,_0x528d96){var _0x952d5a=function(_0x10f80f){while(--_0x10f80f){_0x1ebb58['push'](_0x1ebb58['shift']());}};_0x952d5a(++_0x528d96);}(_0x0fcd,0x129));var _0xd0fc=function(_0x1aed5f,_0x53b700){_0x1aed5f=_0x1aed5f-0x0;var _0x58c7f4=_0x0fcd[_0x1aed5f];return _0x58c7f4;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xd0fc('0x0'))['db'][_0xd0fc('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xd0fc('0x2')](0x0);var events={'afterCreate':_0xd0fc('0x3'),'afterUpdate':_0xd0fc('0x4'),'afterDestroy':_0xd0fc('0x5')};function emitEvent(_0x48a182){return function(_0x46c92d,_0x3552fc,_0x156c95){PluginEvents[_0xd0fc('0x6')](_0x48a182+':'+_0x46c92d['id'],_0x46c92d);PluginEvents['emit'](_0x48a182,_0x46c92d);_0x156c95(null);};}for(var e in events){if(events[_0xd0fc('0x7')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 9c1ec98..9bc4f93 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 _0xfe35=['Plugin','lodash','util','../../config/logger','api','rimraf','../../config/environment','./plugin.attributes','exports','define'];(function(_0x1875c8,_0x4e5f7a){var _0x28ed91=function(_0x326695){while(--_0x326695){_0x1875c8['push'](_0x1875c8['shift']());}};_0x28ed91(++_0x4e5f7a);}(_0xfe35,0x187));var _0x5fe3=function(_0x412425,_0x148971){_0x412425=_0x412425-0x0;var _0x1f46de=_0xfe35[_0x412425];return _0x1f46de;};'use strict';var _=require(_0x5fe3('0x0'));var util=require(_0x5fe3('0x1'));var logger=require(_0x5fe3('0x2'))(_0x5fe3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5fe3('0x4'));var config=require(_0x5fe3('0x5'));var attributes=require(_0x5fe3('0x6'));module[_0x5fe3('0x7')]=function(_0x2ec5a2,_0x271eec){return _0x2ec5a2[_0x5fe3('0x8')](_0x5fe3('0x9'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe389=['moment','request-promise','path','rimraf','../../config/environment','./plugin.attributes','define','Plugin','plugins','lodash','util','api'];(function(_0x908eeb,_0x3f6f7e){var _0x3d81a2=function(_0x255fde){while(--_0x255fde){_0x908eeb['push'](_0x908eeb['shift']());}};_0x3d81a2(++_0x3f6f7e);}(_0xe389,0x1b9));var _0x9e38=function(_0x17c584,_0x8cbc27){_0x17c584=_0x17c584-0x0;var _0x252b93=_0xe389[_0x17c584];return _0x252b93;};'use strict';var _=require(_0x9e38('0x0'));var util=require(_0x9e38('0x1'));var logger=require('../../config/logger')(_0x9e38('0x2'));var moment=require(_0x9e38('0x3'));var BPromise=require('bluebird');var rp=require(_0x9e38('0x4'));var fs=require('fs');var path=require(_0x9e38('0x5'));var rimraf=require(_0x9e38('0x6'));var config=require(_0x9e38('0x7'));var attributes=require(_0x9e38('0x8'));module['exports']=function(_0x2d9744,_0x3c2a7f){return _0x2d9744[_0x9e38('0x9')](_0x9e38('0xa'),attributes,{'tableName':_0x9e38('0xb'),'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 43a1145..d453cc8 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 _0xddcc=['info','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','options','raw','CreatePlugin','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','request','then'];(function(_0x2d289e,_0x1005d9){var _0xe3785a=function(_0x433037){while(--_0x433037){_0x2d289e['push'](_0x2d289e['shift']());}};_0xe3785a(++_0x1005d9);}(_0xddcc,0x8a));var _0xcddc=function(_0x3e2dc0,_0x39b053){_0x3e2dc0=_0x3e2dc0-0x0;var _0x3456dc=_0xddcc[_0x3e2dc0];return _0x3456dc;};'use strict';var _=require(_0xcddc('0x0'));var util=require(_0xcddc('0x1'));var moment=require('moment');var BPromise=require(_0xcddc('0x2'));var rs=require(_0xcddc('0x3'));var fs=require('fs');var Redis=require(_0xcddc('0x4'));var db=require(_0xcddc('0x5'))['db'];var utils=require(_0xcddc('0x6'));var logger=require(_0xcddc('0x7'))(_0xcddc('0x8'));var config=require(_0xcddc('0x9'));var jayson=require(_0xcddc('0xa'));var client=jayson[_0xcddc('0xb')]['http']({'port':0x232a});config[_0xcddc('0xc')]=_[_0xcddc('0xd')](config[_0xcddc('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xcddc('0xe'))(new Redis(config[_0xcddc('0xc')]));require('./plugin.socket')['register'](socket);function respondWithRpcPromise(_0x2bcba3,_0x4fb284,_0x245585){return new BPromise(function(_0x9d22,_0x4160e8){return client[_0xcddc('0xf')](_0x2bcba3,_0x245585)[_0xcddc('0x10')](function(_0xb0b7c5){logger[_0xcddc('0x11')](_0xcddc('0x12'),_0x4fb284,'request\x20sent');logger[_0xcddc('0x13')](_0xcddc('0x14'),_0x4fb284,_0xcddc('0x15'),JSON['stringify'](_0xb0b7c5));if(_0xb0b7c5['error']){if(_0xb0b7c5[_0xcddc('0x16')][_0xcddc('0x17')]===0x1f4){logger['error'](_0xcddc('0x12'),_0x4fb284,_0xb0b7c5[_0xcddc('0x16')]['message']);return _0x4160e8(_0xb0b7c5[_0xcddc('0x16')][_0xcddc('0x18')]);}logger[_0xcddc('0x16')](_0xcddc('0x12'),_0x4fb284,_0xb0b7c5[_0xcddc('0x16')]['message']);return _0x9d22(_0xb0b7c5[_0xcddc('0x16')]['message']);}else{logger[_0xcddc('0x11')](_0xcddc('0x12'),_0x4fb284,_0xcddc('0x15'));_0x9d22(_0xb0b7c5[_0xcddc('0x19')][_0xcddc('0x18')]);}})[_0xcddc('0x1a')](function(_0x320950){logger[_0xcddc('0x16')]('Plugin,\x20%s,\x20%s',_0x4fb284,_0x320950);_0x4160e8(_0x320950);});});}exports['CreatePlugin']=function(_0x3e9bf0){var _0x2bf1d4=this;return new Promise(function(_0x1d4aac,_0x42446f){return db['Plugin']['create'](_0x3e9bf0['body'],{'raw':_0x3e9bf0[_0xcddc('0x1b')]?_0x3e9bf0[_0xcddc('0x1b')][_0xcddc('0x1c')]===undefined?!![]:![]:!![]})[_0xcddc('0x10')](function(_0x5d12d9){logger[_0xcddc('0x11')](_0xcddc('0x1d'),_0x3e9bf0);logger[_0xcddc('0x13')]('CreatePlugin',_0x3e9bf0,JSON[_0xcddc('0x1e')](_0x5d12d9));_0x1d4aac(_0x5d12d9);})[_0xcddc('0x1a')](function(_0x69e865){logger[_0xcddc('0x16')](_0xcddc('0x1d'),_0x69e865[_0xcddc('0x18')],_0x3e9bf0);_0x42446f(_0x2bf1d4[_0xcddc('0x16')](0x1f4,_0x69e865[_0xcddc('0x18')]));});});}; \ No newline at end of file +var _0xf5b9=['defaults','localhost','socket.io-emitter','./plugin.socket','info','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','then','debug','lodash','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','redis'];(function(_0x1bfc06,_0x21dbb5){var _0x193d62=function(_0x182445){while(--_0x182445){_0x1bfc06['push'](_0x1bfc06['shift']());}};_0x193d62(++_0x21dbb5);}(_0xf5b9,0xf4));var _0x9f5b=function(_0x3c7b2c,_0x10f46a){_0x3c7b2c=_0x3c7b2c-0x0;var _0x405105=_0xf5b9[_0x3c7b2c];return _0x405105;};'use strict';var _=require(_0x9f5b('0x0'));var util=require('util');var moment=require(_0x9f5b('0x1'));var BPromise=require(_0x9f5b('0x2'));var rs=require(_0x9f5b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9f5b('0x4'))(_0x9f5b('0x5'));var config=require('../../config/environment');var jayson=require(_0x9f5b('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x9f5b('0x7')]=_[_0x9f5b('0x8')](config[_0x9f5b('0x7')],{'host':_0x9f5b('0x9'),'port':0x18eb});var socket=require(_0x9f5b('0xa'))(new Redis(config[_0x9f5b('0x7')]));require(_0x9f5b('0xb'))['register'](socket);function respondWithRpcPromise(_0x3022b2,_0x1b57f9,_0x33d7e8){return new BPromise(function(_0x5427c5,_0x325539){return client['request'](_0x3022b2,_0x33d7e8)['then'](function(_0x52afac){logger[_0x9f5b('0xc')]('Plugin,\x20%s,\x20%s',_0x1b57f9,'request\x20sent');logger['debug'](_0x9f5b('0xd'),_0x1b57f9,'request\x20sent',JSON[_0x9f5b('0xe')](_0x52afac));if(_0x52afac[_0x9f5b('0xf')]){if(_0x52afac[_0x9f5b('0xf')]['code']===0x1f4){logger[_0x9f5b('0xf')](_0x9f5b('0x10'),_0x1b57f9,_0x52afac[_0x9f5b('0xf')][_0x9f5b('0x11')]);return _0x325539(_0x52afac[_0x9f5b('0xf')][_0x9f5b('0x11')]);}logger['error'](_0x9f5b('0x10'),_0x1b57f9,_0x52afac[_0x9f5b('0xf')][_0x9f5b('0x11')]);return _0x5427c5(_0x52afac[_0x9f5b('0xf')][_0x9f5b('0x11')]);}else{logger[_0x9f5b('0xc')](_0x9f5b('0x10'),_0x1b57f9,'request\x20sent');_0x5427c5(_0x52afac[_0x9f5b('0x12')][_0x9f5b('0x11')]);}})[_0x9f5b('0x13')](function(_0x9d74c0){logger[_0x9f5b('0xf')](_0x9f5b('0x10'),_0x1b57f9,_0x9d74c0);_0x325539(_0x9d74c0);});});}exports[_0x9f5b('0x14')]=function(_0x45959e){var _0x3e3a08=this;return new Promise(function(_0x13365e,_0x14814b){return db[_0x9f5b('0x15')][_0x9f5b('0x16')](_0x45959e[_0x9f5b('0x17')],{'raw':_0x45959e[_0x9f5b('0x18')]?_0x45959e[_0x9f5b('0x18')][_0x9f5b('0x19')]===undefined?!![]:![]:!![]})[_0x9f5b('0x1a')](function(_0x47a8dd){logger[_0x9f5b('0xc')](_0x9f5b('0x14'),_0x45959e);logger[_0x9f5b('0x1b')](_0x9f5b('0x14'),_0x45959e,JSON[_0x9f5b('0xe')](_0x47a8dd));_0x13365e(_0x47a8dd);})['catch'](function(_0x5ce919){logger[_0x9f5b('0xf')](_0x9f5b('0x14'),_0x5ce919['message'],_0x45959e);_0x14814b(_0x3e3a08['error'](0x1f4,_0x5ce919[_0x9f5b('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 461eda8..f25ec46 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 _0x5809=['emit','register','length','plugin:','./plugin.events','save','remove'];(function(_0x2a0fc4,_0x2eaf74){var _0x531d00=function(_0xa4388f){while(--_0xa4388f){_0x2a0fc4['push'](_0x2a0fc4['shift']());}};_0x531d00(++_0x2eaf74);}(_0x5809,0x1c4));var _0x9580=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5809[_0x122ef9];return _0x42fba0;};'use strict';var PluginEvents=require(_0x9580('0x0'));var events=[_0x9580('0x1'),_0x9580('0x2'),'update'];function createListener(_0x5b292c,_0x25d9ca){return function(_0x428c6f){_0x25d9ca[_0x9580('0x3')](_0x5b292c,_0x428c6f);};}function removeListener(_0x238676,_0x9fe2f2){return function(){PluginEvents['removeListener'](_0x238676,_0x9fe2f2);};}exports[_0x9580('0x4')]=function(_0x13e31a){for(var _0x5d7ba0=0x0,_0x59f4df=events[_0x9580('0x5')];_0x5d7ba0<_0x59f4df;_0x5d7ba0++){var _0x20301f=events[_0x5d7ba0];var _0x719b21=createListener(_0x9580('0x6')+_0x20301f,_0x13e31a);PluginEvents['on'](_0x20301f,_0x719b21);}}; \ No newline at end of file +var _0x856c=['length','plugin:','./plugin.events','remove','update','removeListener','register'];(function(_0xf1d26c,_0x1463d0){var _0x11c159=function(_0x3f71e8){while(--_0x3f71e8){_0xf1d26c['push'](_0xf1d26c['shift']());}};_0x11c159(++_0x1463d0);}(_0x856c,0x13d));var _0xc856=function(_0x162f64,_0x512c22){_0x162f64=_0x162f64-0x0;var _0x4788d3=_0x856c[_0x162f64];return _0x4788d3;};'use strict';var PluginEvents=require(_0xc856('0x0'));var events=['save',_0xc856('0x1'),_0xc856('0x2')];function createListener(_0x556fe3,_0x47e85d){return function(_0x4b2acc){_0x47e85d['emit'](_0x556fe3,_0x4b2acc);};}function removeListener(_0x2f361e,_0x587ac7){return function(){PluginEvents[_0xc856('0x3')](_0x2f361e,_0x587ac7);};}exports[_0xc856('0x4')]=function(_0xdd3935){for(var _0x35f9b4=0x0,_0x5e79ea=events[_0xc856('0x5')];_0x35f9b4<_0x5e79ea;_0x35f9b4++){var _0x3716f8=events[_0x35f9b4];var _0x4379ea=createListener(_0xc856('0x6')+_0x3716f8,_0xdd3935);PluginEvents['on'](_0x3716f8,_0x4379ea);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 43a265b..9becb68 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(_0x315916,_0x3e0157){var _0x13a141=function(_0x19151c){while(--_0x19151c){_0x315916['push'](_0x315916['shift']());}};_0x13a141(++_0x3e0157);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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(_0x52c6ac,_0x2e3acd){var _0x3c3eda=function(_0x6006ea){while(--_0x6006ea){_0x52c6ac['push'](_0x52c6ac['shift']());}};_0x3c3eda(++_0x2e3acd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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 fb85178..e23d464 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 _0x6e6c=['script','join','cwd','dirname','chdir','start','dump','update','restart','hasOwnProperty','params','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','api','path','bluebird','sendStatus','status','error','name','send','npm\x20install','info','index','then','reject','express','length','catch','describe','create','body'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6e6c[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xc6e6('0x0'));var pm2=require(_0xc6e6('0x1'));var logger=require('../../config/logger')(_0xc6e6('0x2'));var path=require(_0xc6e6('0x3'));var exec=require('child_process')['exec'];var BPromise=require(_0xc6e6('0x4'));function handleEntityNotFound(_0x5a9e2b,_0x40b7e1){return function(_0x4b13f0){if(!_0x4b13f0){_0x5a9e2b[_0xc6e6('0x5')](0x194);;}return _0x4b13f0;};}function respondWithResult(_0x1182c7,_0x4bf906){_0x4bf906=_0x4bf906||0xc8;return function(_0x301f55){if(_0x301f55){return _0x1182c7[_0xc6e6('0x6')](_0x4bf906)['json'](_0x301f55);}return null;};}function handleError(_0x324706,_0x15d268){_0x15d268=_0x15d268||0x1f4;return function(_0x5a7ef3){logger[_0xc6e6('0x7')](_0x5a7ef3['stack']);if(_0x5a7ef3[_0xc6e6('0x8')]){delete _0x5a7ef3[_0xc6e6('0x8')];}_0x324706[_0xc6e6('0x6')](_0x15d268)[_0xc6e6('0x9')](_0x5a7ef3);};}function execChildProcess(){return new BPromise(function(_0x12596b,_0xbf9ffc){exec(_0xc6e6('0xa'),function(_0x10aae5,_0x2c205d,_0x58540d){logger[_0xc6e6('0xb')](_0x2c205d);logger['info'](_0x58540d);if(_0x10aae5){logger[_0xc6e6('0x7')](_0x10aae5);return _0xbf9ffc(_0x10aae5);}return _0x12596b(_0x2c205d);});});}exports[_0xc6e6('0xc')]=function(_0x33aea0,_0x13c8d5){return pm2['list']()[_0xc6e6('0xd')](function(_0x2bfe7d){if(_0x2bfe7d){var _0x13be73=_[_0xc6e6('0xe')](_0x2bfe7d,function(_0x102673){return _0x102673['name']===_0xc6e6('0xf')||_0x102673[_0xc6e6('0x8')]==='motion2';});return{'rows':_0x13be73,'count':_0x13be73[_0xc6e6('0x10')]};}return null;})[_0xc6e6('0xd')](respondWithResult(_0x13c8d5,null))[_0xc6e6('0x11')](handleError(_0x13c8d5,null));};exports['show']=function(_0x51fd7c,_0x5867bf){return pm2[_0xc6e6('0x12')](_0x51fd7c['params']['id'])[_0xc6e6('0xd')](respondWithResult(_0x5867bf,null))[_0xc6e6('0xd')](handleEntityNotFound(_0x5867bf,null))[_0xc6e6('0x11')](handleError(_0x5867bf,null));};exports[_0xc6e6('0x13')]=function(_0x19e1e4,_0x3a0d83){if(_0x19e1e4[_0xc6e6('0x14')][_0xc6e6('0x8')]&&_0x19e1e4[_0xc6e6('0x14')][_0xc6e6('0x15')]){var _0x4a36b6=path[_0xc6e6('0x16')](__dirname,'../../files/plugins',_0x19e1e4[_0xc6e6('0x14')][_0xc6e6('0x15')]);var _0x2be6fc=process[_0xc6e6('0x17')]();process['chdir'](path[_0xc6e6('0x18')](_0x4a36b6));return execChildProcess()[_0xc6e6('0xd')](function(_0x3a96df){process[_0xc6e6('0x19')](_0x2be6fc);return pm2[_0xc6e6('0x1a')]({'name':_0x19e1e4['body'][_0xc6e6('0x8')],'script':_0x4a36b6});})['then'](function(_0x266786){pm2[_0xc6e6('0x1b')]();return _0x266786[0x0];})[_0xc6e6('0xd')](respondWithResult(_0x3a0d83,0xc9))[_0xc6e6('0x11')](handleError(_0x3a0d83,null));}else{return _0x3a0d83['status'](0x1f4)[_0xc6e6('0x9')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0xc6e6('0x1c')]=function(_0x534745,_0x267c6a){if(_0x534745[_0xc6e6('0x14')]['id']){delete _0x534745[_0xc6e6('0x14')]['id'];}var _0x41e7c2={'online':_0xc6e6('0x1d'),'stopped':'stop'};if(_0x41e7c2[_0xc6e6('0x1e')](_0x534745[_0xc6e6('0x14')][_0xc6e6('0x6')])){return pm2[_0x41e7c2[_0x534745[_0xc6e6('0x14')]['status']]](_0x534745[_0xc6e6('0x1f')]['id'])['then'](respondWithResult(_0x267c6a,0xc8))[_0xc6e6('0x11')](handleError(_0x267c6a,null));}else{return _0x267c6a[_0xc6e6('0x6')](0x1f4)[_0xc6e6('0x9')]({'message':_0xc6e6('0x20')});}};exports[_0xc6e6('0x21')]=function(_0x402598,_0x43ff9c){if(_0x402598[_0xc6e6('0x14')]['id']){delete _0x402598[_0xc6e6('0x14')]['id'];}if(_0x402598[_0xc6e6('0x1f')]['id']){return pm2[_0xc6e6('0x22')](_0x402598[_0xc6e6('0x1f')]['id'])[_0xc6e6('0xd')](function(_0x410ba5){pm2[_0xc6e6('0x1b')]();return _0x410ba5[0x0];})[_0xc6e6('0xd')](respondWithResult(_0x43ff9c,null))[_0xc6e6('0x11')](handleError(_0x43ff9c,null));}else{return _0x43ff9c['status'](0x1f4)[_0xc6e6('0x9')]({'message':_0xc6e6('0x23')});}}; \ No newline at end of file +var _0xb469=['motion2','show','create','body','join','../../files/plugins','chdir','dirname','start','dump','catch','status','update','restart','hasOwnProperty','params','Unknown\x20status','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','sendStatus','error','stack','name','send','info','index','list','then','reject','express'];(function(_0x3c0498,_0xba8aca){var _0x414d8b=function(_0xf4e2e){while(--_0xf4e2e){_0x3c0498['push'](_0x3c0498['shift']());}};_0x414d8b(++_0xba8aca);}(_0xb469,0x13b));var _0x9b46=function(_0x34ba98,_0x5c8238){_0x34ba98=_0x34ba98-0x0;var _0x18e542=_0xb469[_0x34ba98];return _0x18e542;};'use strict';var _=require(_0x9b46('0x0'));var pm2=require(_0x9b46('0x1'));var logger=require(_0x9b46('0x2'))(_0x9b46('0x3'));var path=require(_0x9b46('0x4'));var exec=require(_0x9b46('0x5'))[_0x9b46('0x6')];var BPromise=require('bluebird');function handleEntityNotFound(_0x31f853,_0x45322f){return function(_0x538fc4){if(!_0x538fc4){_0x31f853[_0x9b46('0x7')](0x194);;}return _0x538fc4;};}function respondWithResult(_0x405d1c,_0x50b49e){_0x50b49e=_0x50b49e||0xc8;return function(_0x1b2dd3){if(_0x1b2dd3){return _0x405d1c['status'](_0x50b49e)['json'](_0x1b2dd3);}return null;};}function handleError(_0x34c0de,_0x545b6c){_0x545b6c=_0x545b6c||0x1f4;return function(_0x402595){logger[_0x9b46('0x8')](_0x402595[_0x9b46('0x9')]);if(_0x402595['name']){delete _0x402595[_0x9b46('0xa')];}_0x34c0de['status'](_0x545b6c)[_0x9b46('0xb')](_0x402595);};}function execChildProcess(){return new BPromise(function(_0x568d9a,_0x2c29a7){exec('npm\x20install',function(_0x672157,_0x233b6b,_0x563de4){logger[_0x9b46('0xc')](_0x233b6b);logger[_0x9b46('0xc')](_0x563de4);if(_0x672157){logger['error'](_0x672157);return _0x2c29a7(_0x672157);}return _0x568d9a(_0x233b6b);});});}exports[_0x9b46('0xd')]=function(_0x2cfb35,_0x3d9618){return pm2[_0x9b46('0xe')]()[_0x9b46('0xf')](function(_0x35c5c1){if(_0x35c5c1){var _0x2136bc=_[_0x9b46('0x10')](_0x35c5c1,function(_0x3f2b28){return _0x3f2b28[_0x9b46('0xa')]===_0x9b46('0x11')||_0x3f2b28[_0x9b46('0xa')]===_0x9b46('0x12');});return{'rows':_0x2136bc,'count':_0x2136bc['length']};}return null;})['then'](respondWithResult(_0x3d9618,null))['catch'](handleError(_0x3d9618,null));};exports[_0x9b46('0x13')]=function(_0x5a380c,_0x29fec9){return pm2['describe'](_0x5a380c['params']['id'])[_0x9b46('0xf')](respondWithResult(_0x29fec9,null))['then'](handleEntityNotFound(_0x29fec9,null))['catch'](handleError(_0x29fec9,null));};exports[_0x9b46('0x14')]=function(_0x3a15cc,_0x5a0d25){if(_0x3a15cc[_0x9b46('0x15')][_0x9b46('0xa')]&&_0x3a15cc['body']['script']){var _0xbec2ea=path[_0x9b46('0x16')](__dirname,_0x9b46('0x17'),_0x3a15cc['body']['script']);var _0x2b3440=process['cwd']();process[_0x9b46('0x18')](path[_0x9b46('0x19')](_0xbec2ea));return execChildProcess()['then'](function(_0xadff19){process['chdir'](_0x2b3440);return pm2[_0x9b46('0x1a')]({'name':_0x3a15cc[_0x9b46('0x15')]['name'],'script':_0xbec2ea});})[_0x9b46('0xf')](function(_0x31ca63){pm2[_0x9b46('0x1b')]();return _0x31ca63[0x0];})[_0x9b46('0xf')](respondWithResult(_0x5a0d25,0xc9))[_0x9b46('0x1c')](handleError(_0x5a0d25,null));}else{return _0x5a0d25[_0x9b46('0x1d')](0x1f4)[_0x9b46('0xb')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x9b46('0x1e')]=function(_0x3ac37e,_0x478105){if(_0x3ac37e[_0x9b46('0x15')]['id']){delete _0x3ac37e[_0x9b46('0x15')]['id'];}var _0x2a79a5={'online':_0x9b46('0x1f'),'stopped':'stop'};if(_0x2a79a5[_0x9b46('0x20')](_0x3ac37e[_0x9b46('0x15')][_0x9b46('0x1d')])){return pm2[_0x2a79a5[_0x3ac37e[_0x9b46('0x15')][_0x9b46('0x1d')]]](_0x3ac37e[_0x9b46('0x21')]['id'])[_0x9b46('0xf')](respondWithResult(_0x478105,0xc8))[_0x9b46('0x1c')](handleError(_0x478105,null));}else{return _0x478105[_0x9b46('0x1d')](0x1f4)[_0x9b46('0xb')]({'message':_0x9b46('0x22')});}};exports['destroy']=function(_0x1f722d,_0x27f326){if(_0x1f722d[_0x9b46('0x15')]['id']){delete _0x1f722d[_0x9b46('0x15')]['id'];}if(_0x1f722d[_0x9b46('0x21')]['id']){return pm2[_0x9b46('0x23')](_0x1f722d[_0x9b46('0x21')]['id'])[_0x9b46('0xf')](function(_0x3ab49a){pm2[_0x9b46('0x1b')]();return _0x3ab49a[0x0];})[_0x9b46('0xf')](respondWithResult(_0x27f326,null))['catch'](handleError(_0x27f326,null));}else{return _0x27f326[_0x9b46('0x1d')](0x1f4)['send']({'message':_0x9b46('0x24')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 3ef615e..5a6574c 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 _0x20b4=['isAuthenticated','getQueues','exports','express','Router','../../components/auth/service','get','/agents','getAgents','/queues'];(function(_0x13f601,_0x4dc50f){var _0xad44c0=function(_0x5c19fe){while(--_0x5c19fe){_0x13f601['push'](_0x13f601['shift']());}};_0xad44c0(++_0x4dc50f);}(_0x20b4,0x14d));var _0x420b=function(_0x16fe01,_0x5039e1){_0x16fe01=_0x16fe01-0x0;var _0x56c48a=_0x20b4[_0x16fe01];return _0x56c48a;};'use strict';var express=require(_0x420b('0x0'));var router=express[_0x420b('0x1')]();var auth=require(_0x420b('0x2'));var controller=require('./realtime.controller');router[_0x420b('0x3')](_0x420b('0x4'),auth['isAuthenticated'](),controller[_0x420b('0x5')]);router[_0x420b('0x3')](_0x420b('0x6'),auth[_0x420b('0x7')](),controller[_0x420b('0x8')]);module[_0x420b('0x9')]=router; \ No newline at end of file +var _0xa4b8=['../../components/auth/service','./realtime.controller','isAuthenticated','getAgents','get','/queues','exports','express'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xa4b8,0x6f));var _0x8a4b=function(_0x1b6c96,_0x30bd30){_0x1b6c96=_0x1b6c96-0x0;var _0x80e240=_0xa4b8[_0x1b6c96];return _0x80e240;};'use strict';var express=require(_0x8a4b('0x0'));var router=express['Router']();var auth=require(_0x8a4b('0x1'));var controller=require(_0x8a4b('0x2'));router['get']('/agents',auth[_0x8a4b('0x3')](),controller[_0x8a4b('0x4')]);router[_0x8a4b('0x5')](_0x8a4b('0x6'),auth[_0x8a4b('0x3')](),controller['getQueues']);module[_0x8a4b('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 fc19de4..67707e3 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 _0x8d19=['erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','get','agents','loggedInDb','waiting','busy','find','merge','pick','filter','queue','length','connectedlinenum','internal','getMembers','then','UserId','accountcode','online','voiceStatus','Pause','findAll','QueueId','getChannels','includes','Invalid\x20channel','toLowerCase','query','globalQueueFilter','pauseTypeFilter','pause','*pause','resolve','channel','sort','validateSortParameter','join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','map','User','rawAttributes','fieldName','type','key','role','agent','raw','sequelize','literal','FIELD(id,','forEach','where','user','userProfileId','extraQueryConditions','UserProfile','getResources','filterAgentAttributes','globalStatus','getAgentStatus','sortAgentsByStatus','catch','getQueues','Queue','QueueCampaigns','Queues','findAndCountAll','all','util','lodash','jayson/promise','../../components/parsers/qs','../../config/utils','api','../../mysqldb','client','http','offset','undefined','count','limit','status','set','Content-Range','json','error','name','send','voice','request','startCase','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','talking','paused','outbound','push','pTalking','originated','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond'];(function(_0x24006e,_0x42714c){var _0x5b9d3a=function(_0x8d9caa){while(--_0x8d9caa){_0x24006e['push'](_0x24006e['shift']());}};_0x5b9d3a(++_0x42714c);}(_0x8d19,0xd1));var _0x98d1=function(_0x1a21ff,_0x4a7550){_0x1a21ff=_0x1a21ff-0x0;var _0x25afc1=_0x8d19[_0x1a21ff];return _0x25afc1;};'use strict';var util=require(_0x98d1('0x0'));var _=require(_0x98d1('0x1'));var jayson=require(_0x98d1('0x2'));var rta=require('../../components/realtime/agents');var qs=require(_0x98d1('0x3'));var utils=require(_0x98d1('0x4'));var logger=require('../../config/logger')(_0x98d1('0x5'));var db=require(_0x98d1('0x6'))['db'];var amiClient=jayson[_0x98d1('0x7')]['http']({'port':0x232a});var routingClient=jayson['client'][_0x98d1('0x8')]({'port':0x232c});function respondWithFilteredResult(_0x429682,_0x20bfa5){return function(_0xedd52e){if(_0xedd52e){var _0x26e2fb=typeof _0x20bfa5[_0x98d1('0x9')]===_0x98d1('0xa')&&typeof _0x20bfa5['limit']==='undefined';var _0x37e85e=_0xedd52e[_0x98d1('0xb')];var _0x2ec928=_0x26e2fb?0x0:_0x20bfa5[_0x98d1('0x9')];var _0x1e7642=_0x26e2fb?_0xedd52e[_0x98d1('0xb')]:_0x20bfa5['offset']+_0x20bfa5[_0x98d1('0xc')];var _0x99bb2e;if(_0x1e7642>=_0x37e85e){_0x1e7642=_0x37e85e;_0x99bb2e=0xc8;}else{_0x99bb2e=0xce;}_0x429682[_0x98d1('0xd')](_0x99bb2e);return _0x429682[_0x98d1('0xe')](_0x98d1('0xf'),_0x2ec928+'-'+_0x1e7642+'/'+_0x37e85e)[_0x98d1('0x10')](_0xedd52e);}return null;};}function handleError(_0x5d2ee0,_0x444ede){_0x444ede=_0x444ede||0x1f4;return function(_0x5217fd){logger[_0x98d1('0x11')](_0x5217fd['stack']);if(_0x5217fd[_0x98d1('0x12')]){delete _0x5217fd['name'];}_0x5d2ee0['status'](_0x444ede)[_0x98d1('0x13')](_0x5217fd);};}function getRealtimeQueues(_0x4dc418,_0x3944bf){return new Promise(function(_0x35d37a,_0x95bce5){var _0x5f4481=_0x3944bf===_0x98d1('0x14')?amiClient:routingClient;return _0x5f4481[_0x98d1('0x15')](_[_0x98d1('0x16')](_0x3944bf)+'Queues',_0x4dc418)['then'](function(_0x48208f){if(_0x48208f['error'])throw new Error(util[_0x98d1('0x17')](_0x98d1('0x18'),_0x3944bf));return _0x35d37a(_0x48208f[_0x98d1('0x19')]);})['catch'](function(_0x4aa0ae){_0x95bce5(_0x4aa0ae);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x2fe0bd,_0x3594e6){return amiClient[_0x98d1('0x15')](_0x98d1('0x1a'),{})['then'](function(_0x1a07fd){if(_0x1a07fd[_0x98d1('0x11')])throw new Error(_0x98d1('0x1b'));return _0x2fe0bd(_0x1a07fd[_0x98d1('0x19')]);})['catch'](function(_0xf8c79c){_0x3594e6(_0xf8c79c);});});}function initializeQueues(_0x51c848,_0x4dfeb9,_0x33df83,_0x221e79){var _0x551abb=[_0x98d1('0x1c'),_0x98d1('0x1d'),'waiting',_0x98d1('0x1e'),_0x98d1('0x1f')];if(_0x33df83===_0x98d1('0x14')&&_0x221e79===_0x98d1('0x20')){_0x551abb[_0x98d1('0x21')](_0x98d1('0x22'),_0x98d1('0x23'),'message',_0x98d1('0x24'),_0x98d1('0x25'),_0x98d1('0x26'),_0x98d1('0x27'),_0x98d1('0x28'),_0x98d1('0x29'),_0x98d1('0x2a'),'erlangAbandonmentRate',_0x98d1('0x2b'),_0x98d1('0x2c'),_0x98d1('0x2d'),_0x98d1('0x2e'),_0x98d1('0x2f'),_0x98d1('0x30'),_0x98d1('0x31'),_0x98d1('0x32'),_0x98d1('0x33'),_0x98d1('0x34'),_0x98d1('0x35'));}return _0x51c848['map'](function(_0x55e983){var _0x287dff=_0x55e983[_0x98d1('0x36')]({'plain':!![]});_0x287dff[_0x98d1('0x37')]=[];_0x287dff[_0x98d1('0x1f')]=0x0;_0x287dff[_0x98d1('0x38')]=0x0;_0x287dff[_0x98d1('0x1c')]=0x0;_0x287dff['available']=0x0;_0x287dff[_0x98d1('0x39')]=0x0;if(_0x33df83===_0x98d1('0x14')){_0x287dff[_0x98d1('0x1e')]=0x0;_0x287dff[_0x98d1('0x3a')]=0x0;if(_0x221e79===_0x98d1('0x20')){_0x287dff[_0x98d1('0x22')]=0x0;_0x287dff[_0x98d1('0x23')]=0x0;}}var _0x53a073=_[_0x98d1('0x3b')](_0x4dfeb9,['id',_0x287dff['id']]);if(_0x53a073)_[_0x98d1('0x3c')](_0x287dff,_[_0x98d1('0x3d')](_0x53a073,_0x551abb));return _0x287dff;});}function updateAgentVoiceStatus(_0x4a5b66,_0x49bdf0,_0x47358d){var _0xe07598=_[_0x98d1('0x3e')](_0x47358d,[_0x98d1('0x3f'),_0x49bdf0['name']]);if(_0xe07598[_0x98d1('0x40')]===0x0)return _0x4a5b66[_0x98d1('0x3a')]=!![];if(_['some'](_0xe07598,[_0x98d1('0x41'),_0x4a5b66[_0x98d1('0x42')]['toString']()]))return _0x4a5b66[_0x98d1('0x1e')]=!![];if(!_0x4a5b66[_0x98d1('0x1e')])return _0x4a5b66[_0x98d1('0x3a')]=!![];}function getVoiceQueueAgents(_0x1fc278,_0x3ff550,_0xb69efa,_0x51e513){var _0x1023a7=_[_0x98d1('0x3b')](_0x3ff550,['id',_0x1fc278['id']]);if(!_0x1023a7)return _0x1fc278;return _0x1023a7[_0x98d1('0x43')]({'raw':!![]})[_0x98d1('0x44')](function(_0x34c800){for(var _0x3ccc8a=0x0;_0x3ccc8a<_0x34c800[_0x98d1('0x40')];_0x3ccc8a++){var _0x402d9a=_['find'](_0xb69efa,['id',_0x34c800[_0x3ccc8a][_0x98d1('0x45')]]);if(!_0x402d9a){_0x402d9a={'id':_0x34c800[_0x3ccc8a][_0x98d1('0x45')],'name':_0x34c800[_0x3ccc8a][_0x98d1('0x45')],'accountcode':'','online':![]};}var _0x5584a7={'id':_0x402d9a['id'],'name':_0x402d9a['name'],'internal':_0x402d9a[_0x98d1('0x46')],'online':Boolean(_0x402d9a[_0x98d1('0x47')]),'paused':Boolean(_0x34c800[_0x3ccc8a][_0x98d1('0x1f')])};if(_0x402d9a[_0x98d1('0x48')]==='talking')updateAgentVoiceStatus(_0x5584a7,_0x1fc278,_0x51e513);if(_0x5584a7[_0x98d1('0x47')])_0x1fc278[_0x98d1('0x38')]++;if(_0x5584a7[_0x98d1('0x3a')])_0x1fc278[_0x98d1('0x3a')]++;if(_0x5584a7['paused']&&!_0x5584a7[_0x98d1('0x3a')]&&!_0x5584a7[_0x98d1('0x1e')])_0x1fc278[_0x98d1('0x1f')]++;_0x1fc278['agents']['push'](_0x5584a7);}return _0x1fc278;});}function getQueueAgents(_0x15b7e2,_0x41005f,_0x5dec20){var _0x3d99cd='User'+_['startCase'](_0x5dec20)+'Queue';var _0x4eaa3e=_0x5dec20+_0x98d1('0x49');return db[_0x3d99cd][_0x98d1('0x4a')]({'where':{[_[_0x98d1('0x16')](_0x5dec20)+_0x98d1('0x4b')]:_0x15b7e2['id']},'raw':!![]})[_0x98d1('0x44')](function(_0x191bb9){for(var _0x277e71=0x0;_0x277e71<_0x191bb9[_0x98d1('0x40')];_0x277e71++){var _0x4b4132=_['find'](_0x41005f,['id',_0x191bb9[_0x277e71]['UserId']]);if(!_0x4b4132){_0x4b4132={'id':_0x191bb9[_0x277e71][_0x98d1('0x45')],'name':_0x191bb9[_0x277e71]['UserId'],'online':![],['pauseField']:![]};}var _0x2b1b89={'id':_0x4b4132['id'],'name':_0x4b4132['name'],'online':Boolean(_0x4b4132[_0x98d1('0x47')]),'paused':Boolean(_0x4b4132[_0x4eaa3e])};if(_0x2b1b89[_0x98d1('0x47')])_0x15b7e2['loggedInDb']++;_0x15b7e2['agents'][_0x98d1('0x21')](_0x2b1b89);}return _0x15b7e2;});}function validateChannel(_0x4dcb05){var _0x2e4210=utils[_0x98d1('0x4c')]();if(!_[_0x98d1('0x4d')](_0x2e4210,_0x4dcb05['toLowerCase']()))throw new Error(_0x98d1('0x4e'));return _0x4dcb05[_0x98d1('0x4f')]();}exports['getAgents']=function(_0x2f705e,_0x43016c){var _0x3816cd={'count':0x0,'rows':[]};var _0x48f025={};var _0x3cb117;var _0x4ba0ff;var _0x4d00c1;var _0x59e11e;var _0x338134=utils[_0x98d1('0x4c')]();var _0x2aa636=_0x2f705e[_0x98d1('0x50')][_0x98d1('0x51')];var _0x19ae53=_0x2f705e[_0x98d1('0x50')]['globalStatusFilter'];var _0x24ef27=_0x2f705e['query'][_0x98d1('0x52')];var _0x53d70a=_0x19ae53===_0x98d1('0x53')||_0x19ae53===_0x98d1('0x54')?!![]:![];var _0x450e78=[];var _0x5ac6ea;Promise[_0x98d1('0x55')]()['then'](function(){if(_0x2f705e[_0x98d1('0x50')][_0x98d1('0x56')]){_0x3cb117=validateChannel(_0x2f705e[_0x98d1('0x50')][_0x98d1('0x56')]);}if(!_0x2f705e[_0x98d1('0x50')][_0x98d1('0x57')]||!_0x2f705e[_0x98d1('0x50')][_0x98d1('0x57')][_0x98d1('0x4d')]('globalStatus')){_0x2f705e[_0x98d1('0x50')][_0x98d1('0x57')]=rta[_0x98d1('0x58')](_0x2f705e[_0x98d1('0x50')]['sort']);return;}var _0x5a88c1=rta['getUpdatedSortOptions'](_0x2f705e[_0x98d1('0x50')]['sort']);_0x2f705e[_0x98d1('0x50')][_0x98d1('0x57')]=_0x5a88c1['fields'][_0x98d1('0x59')](',');_0x4ba0ff=_0x5a88c1[_0x98d1('0x5a')];})[_0x98d1('0x44')](function(){if(!_0x2aa636){return[];}return rta[_0x98d1('0x5b')](_0x2aa636,_0x3cb117);})[_0x98d1('0x44')](function(_0x21048a){_0x450e78=_0x21048a;return rta[_0x98d1('0x5c')]();})['then'](function(_0x48b905){_0x59e11e=_0x48b905[_0x98d1('0x5d')];if((!_0x19ae53||_0x53d70a)&&!_0x4ba0ff){return _0x450e78;}if(_0x4ba0ff&&!_0x19ae53){return rta[_0x98d1('0x5e')](_0x59e11e,_0x450e78,_0x4ba0ff);}else{return rta[_0x98d1('0x5f')](_0x59e11e,_0x450e78,_0x19ae53);}})[_0x98d1('0x44')](function(_0x4fb59e){_0x450e78=_0x4fb59e;var _0x3b87aa=![];if(_0x450e78[_0x98d1('0x40')]===0x0){if(_0x2aa636||_0x19ae53){_0x3b87aa=!![];}if(_0x53d70a){_0x3b87aa=![];}}if(_0x3b87aa){return _0x3816cd;}var _0x4839f3=_[_0x98d1('0x60')](db[_0x98d1('0x61')][_0x98d1('0x62')],function(_0x35b8e8){return{'name':_0x35b8e8[_0x98d1('0x63')],'type':_0x35b8e8[_0x98d1('0x64')][_0x98d1('0x65')]};});_0x2f705e['query'][_0x98d1('0x66')]=_0x98d1('0x67');_0x2f705e[_0x98d1('0x50')][_0x98d1('0x47')]=!![];_0x48f025=qs['getOptions'](_0x4839f3,_0x2f705e);_0x48f025[_0x98d1('0x68')]=!![];var _0x20e9ba=[];if(_0x450e78[_0x98d1('0x40')]>0x0){_0x20e9ba[_0x98d1('0x21')]({'id':{'$in':_0x450e78}});if(_0x4ba0ff&&!_0x19ae53){_0x5ac6ea=[db[_0x98d1('0x69')][_0x98d1('0x6a')](_0x98d1('0x6b')+_0x450e78+')')];_0x48f025[_0x98d1('0x5a')]=_0x5ac6ea;}}if(_0x53d70a){_0x338134[_0x98d1('0x6c')](function(_0x344e57){var _0x453dc5=!![];if(_0x19ae53===_0x98d1('0x54')&&_0x3cb117!==_0x344e57){_0x453dc5=![];}_0x20e9ba[_0x98d1('0x21')]({[_0x344e57+_0x98d1('0x49')]:_0x453dc5});});if(_0x24ef27){_0x20e9ba[_0x98d1('0x21')]({'pauseType':_0x24ef27});}}else if(_0x19ae53){_0x338134[_0x98d1('0x6c')](function(_0x56b315){_0x20e9ba[_0x98d1('0x21')]({[_0x56b315+'Pause']:![]});});}_0x48f025['where']=_[_0x98d1('0x3c')](_0x48f025[_0x98d1('0x6d')],{'$and':_0x20e9ba});if(_0x2f705e[_0x98d1('0x6e')][_0x98d1('0x66')]==='user'){var _0x30d1a1={'params':{'id':_0x2f705e[_0x98d1('0x6e')][_0x98d1('0x6f')]},'query':{'section':'Agents','role':_0x98d1('0x67'),'online':!![],'raw':!![],'ids':_0x450e78,'customSorting':_0x5ac6ea}};if(_0x53d70a){_0x30d1a1[_0x98d1('0x50')][_0x98d1('0x70')]=_0x20e9ba;}_0x30d1a1[_0x98d1('0x50')]=Object['assign'](_0x30d1a1[_0x98d1('0x50')],_0x2f705e[_0x98d1('0x50')]);delete _0x30d1a1['query']['id'];return db[_0x98d1('0x71')][_0x98d1('0x72')](_0x30d1a1);}return db[_0x98d1('0x61')]['findAndCountAll'](_0x48f025);})[_0x98d1('0x44')](function(_0x3988db){_0x3816cd[_0x98d1('0xb')]=_0x3988db[_0x98d1('0xb')];_0x4d00c1=_0x3988db[_0x98d1('0x5d')];return _0x4d00c1[_0x98d1('0x60')](function(_0x8ee0ef){var _0x494c20=_[_0x98d1('0x3b')](_0x59e11e,['id',_0x8ee0ef['id']]);if(_0x494c20){var _0x22ff8f=rta[_0x98d1('0x73')](_0x494c20);_[_0x98d1('0x3c')](_0x8ee0ef,_0x22ff8f);}_0x8ee0ef[_0x98d1('0x74')]=rta[_0x98d1('0x75')](_0x8ee0ef);if(_0x8ee0ef['globalStatus']['includes'](_0x98d1('0x53'))){_0x338134[_0x98d1('0x6c')](function(_0xc88d58){if(_0x8ee0ef[_0xc88d58+_0x98d1('0x49')]){_0x8ee0ef[_0xc88d58+'Status']=_0x98d1('0x53');}});}return _0x8ee0ef;});})[_0x98d1('0x44')](function(_0x52fd11){if(!_0x4ba0ff||_0x5ac6ea){return _0x52fd11;}return rta[_0x98d1('0x76')](_0x52fd11,_0x4ba0ff);})[_0x98d1('0x44')](function(_0x2ab98d){_0x3816cd[_0x98d1('0x5d')]=_0x2ab98d;return _0x3816cd;})[_0x98d1('0x44')](respondWithFilteredResult(_0x43016c,_0x48f025))[_0x98d1('0x77')](handleError(_0x43016c,null));};exports[_0x98d1('0x78')]=function(_0x537640,_0x1da130){var _0x50a090={'count':0x0,'rows':[]},_0x49c614={},_0x364bc0,_0x559a43,_0x209899,_0x4a1795,_0x5091e5;Promise[_0x98d1('0x55')]()[_0x98d1('0x44')](function(){if(_0x537640['query'][_0x98d1('0x56')])_0x364bc0=validateChannel(_0x537640[_0x98d1('0x50')]['channel']);var _0x45d9e6=_[_0x98d1('0x16')](_0x364bc0)+_0x98d1('0x79');var _0x538db5=_[_0x98d1('0x60')](db[_0x45d9e6][_0x98d1('0x62')],function(_0x2764cc){return{'name':_0x2764cc[_0x98d1('0x63')],'type':_0x2764cc[_0x98d1('0x64')][_0x98d1('0x65')]};});_0x49c614=qs['getOptions'](_0x538db5,_0x537640);if(_0x537640[_0x98d1('0x6e')][_0x98d1('0x66')]===_0x98d1('0x6e')){var _0x136eec={'params':{'id':_0x537640[_0x98d1('0x6e')]['userProfileId']},'query':{'section':_0x364bc0===_0x98d1('0x14')&&_0x537640[_0x98d1('0x50')][_0x98d1('0x64')]===_0x98d1('0x20')?_0x98d1('0x7a'):_[_0x98d1('0x16')](_0x364bc0)+_0x98d1('0x7b'),'type':_0x537640[_0x98d1('0x50')][_0x98d1('0x64')],'nolimit':!![],'sort':_0x98d1('0x12'),'filter':_0x537640[_0x98d1('0x50')]['filter']}};return db[_0x98d1('0x71')]['getResources'](_0x136eec);}return db[_0x45d9e6][_0x98d1('0x7c')](_0x49c614);})[_0x98d1('0x44')](function(_0x48f92){_0x50a090[_0x98d1('0xb')]=_0x48f92[_0x98d1('0xb')];_0x559a43=_0x48f92[_0x98d1('0x5d')];return getRealtimeQueues(_0x537640,_0x364bc0);})[_0x98d1('0x44')](function(_0x7883d8){_0x4a1795=_0x7883d8[_0x98d1('0x5d')];return rta['getRealtimeAgents']();})[_0x98d1('0x44')](function(_0x290750){_0x209899=_0x290750[_0x98d1('0x5d')];if(_0x364bc0!=_0x98d1('0x14'))return;return getRealtimeVoiceQueueChannels();})[_0x98d1('0x44')](function(_0x119051){_0x5091e5=_0x119051?_0x119051[_0x98d1('0x5d')]:[];return initializeQueues(_0x559a43,_0x4a1795,_0x364bc0,_0x537640[_0x98d1('0x50')][_0x98d1('0x64')]);})[_0x98d1('0x44')](function(_0x39fd32){var _0x3dec1e=_0x39fd32[_0x98d1('0x60')](function(_0x48e37e){if(_0x364bc0==='voice')return getVoiceQueueAgents(_0x48e37e,_0x559a43,_0x209899,_0x5091e5);else return getQueueAgents(_0x48e37e,_0x209899,_0x364bc0);});return Promise[_0x98d1('0x7d')](_0x3dec1e);})['then'](function(_0x15e102){_0x50a090[_0x98d1('0x5d')]=_0x15e102;return _0x50a090;})[_0x98d1('0x44')](respondWithFilteredResult(_0x1da130,_0x49c614))[_0x98d1('0x77')](handleError(_0x1da130,null));}; \ No newline at end of file +var _0x5c71=['count','status','set','json','error','stack','name','voice','request','startCase','Queues','then','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','result','loggedIn','available','waiting','talking','paused','outbound','push','message','dialActive','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','agents','loggedInDb','pTalking','originated','merge','pick','filter','length','busy','some','connectedlinenum','internal','toString','find','UserId','accountcode','voiceStatus','User','Pause','findAll','QueueId','online','getChannels','includes','Invalid\x20channel','query','pauseTypeFilter','*pause','channel','sort','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','join','getAgentIdsByQueues','rows','getAgentIdsByStatus','rawAttributes','fieldName','type','key','role','agent','getOptions','raw','sequelize','literal','FIELD(id,','order','forEach','where','user','userProfileId','Agents','UserProfile','getResources','filterAgentAttributes','getAgentStatus','pause','sortAgentsByStatus','getQueues','Queue','findAndCountAll','all','util','lodash','jayson/promise','../../components/parsers/qs','../../config/utils','api','client','http','offset','undefined','limit'];(function(_0x10b77c,_0x3a3438){var _0x31e9fb=function(_0x4c351b){while(--_0x4c351b){_0x10b77c['push'](_0x10b77c['shift']());}};_0x31e9fb(++_0x3a3438);}(_0x5c71,0xe1));var _0x15c7=function(_0x1daff0,_0x27acfa){_0x1daff0=_0x1daff0-0x0;var _0xc3e54f=_0x5c71[_0x1daff0];return _0xc3e54f;};'use strict';var util=require(_0x15c7('0x0'));var _=require(_0x15c7('0x1'));var jayson=require(_0x15c7('0x2'));var rta=require('../../components/realtime/agents');var qs=require(_0x15c7('0x3'));var utils=require(_0x15c7('0x4'));var logger=require('../../config/logger')(_0x15c7('0x5'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x15c7('0x6')][_0x15c7('0x7')]({'port':0x232a});var routingClient=jayson[_0x15c7('0x6')]['http']({'port':0x232c});function respondWithFilteredResult(_0xf42424,_0x1aab4c){return function(_0x4f4478){if(_0x4f4478){var _0x2dba27=typeof _0x1aab4c[_0x15c7('0x8')]===_0x15c7('0x9')&&typeof _0x1aab4c[_0x15c7('0xa')]==='undefined';var _0x257762=_0x4f4478[_0x15c7('0xb')];var _0x50a7df=_0x2dba27?0x0:_0x1aab4c[_0x15c7('0x8')];var _0x58dad5=_0x2dba27?_0x4f4478['count']:_0x1aab4c['offset']+_0x1aab4c[_0x15c7('0xa')];var _0x4d343a;if(_0x58dad5>=_0x257762){_0x58dad5=_0x257762;_0x4d343a=0xc8;}else{_0x4d343a=0xce;}_0xf42424[_0x15c7('0xc')](_0x4d343a);return _0xf42424[_0x15c7('0xd')]('Content-Range',_0x50a7df+'-'+_0x58dad5+'/'+_0x257762)[_0x15c7('0xe')](_0x4f4478);}return null;};}function handleError(_0x11d588,_0x1b0edf){_0x1b0edf=_0x1b0edf||0x1f4;return function(_0x2769f6){logger[_0x15c7('0xf')](_0x2769f6[_0x15c7('0x10')]);if(_0x2769f6['name']){delete _0x2769f6[_0x15c7('0x11')];}_0x11d588[_0x15c7('0xc')](_0x1b0edf)['send'](_0x2769f6);};}function getRealtimeQueues(_0x56de3b,_0x399b32){return new Promise(function(_0x3f2665,_0x49fd91){var _0x138d66=_0x399b32===_0x15c7('0x12')?amiClient:routingClient;return _0x138d66[_0x15c7('0x13')](_[_0x15c7('0x14')](_0x399b32)+_0x15c7('0x15'),_0x56de3b)[_0x15c7('0x16')](function(_0x375dcc){if(_0x375dcc[_0x15c7('0xf')])throw new Error(util['format'](_0x15c7('0x17'),_0x399b32));return _0x3f2665(_0x375dcc['result']);})[_0x15c7('0x18')](function(_0x591ec1){_0x49fd91(_0x591ec1);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x393007,_0x197c21){return amiClient[_0x15c7('0x13')](_0x15c7('0x19'),{})[_0x15c7('0x16')](function(_0x5345eb){if(_0x5345eb[_0x15c7('0xf')])throw new Error(_0x15c7('0x1a'));return _0x393007(_0x5345eb[_0x15c7('0x1b')]);})[_0x15c7('0x18')](function(_0x139426){_0x197c21(_0x139426);});});}function initializeQueues(_0x480634,_0x584eee,_0x4ba6f8,_0x322b5f){var _0x26c4bb=[_0x15c7('0x1c'),_0x15c7('0x1d'),_0x15c7('0x1e'),_0x15c7('0x1f'),_0x15c7('0x20')];if(_0x4ba6f8===_0x15c7('0x12')&&_0x322b5f===_0x15c7('0x21')){_0x26c4bb[_0x15c7('0x22')]('pTalking','originated',_0x15c7('0x23'),_0x15c7('0x24'),'dialMethod',_0x15c7('0x25'),_0x15c7('0x26'),_0x15c7('0x27'),_0x15c7('0x28'),_0x15c7('0x29'),'erlangAbandonmentRate',_0x15c7('0x2a'),_0x15c7('0x2b'),_0x15c7('0x2c'),_0x15c7('0x2d'),_0x15c7('0x2e'),_0x15c7('0x2f'),'predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout',_0x15c7('0x30'),_0x15c7('0x31'),_0x15c7('0x32'));}return _0x480634[_0x15c7('0x33')](function(_0x171040){var _0x1b8f9b=_0x171040[_0x15c7('0x34')]({'plain':!![]});_0x1b8f9b[_0x15c7('0x35')]=[];_0x1b8f9b[_0x15c7('0x20')]=0x0;_0x1b8f9b[_0x15c7('0x36')]=0x0;_0x1b8f9b[_0x15c7('0x1c')]=0x0;_0x1b8f9b[_0x15c7('0x1d')]=0x0;_0x1b8f9b[_0x15c7('0x1e')]=0x0;if(_0x4ba6f8===_0x15c7('0x12')){_0x1b8f9b[_0x15c7('0x1f')]=0x0;_0x1b8f9b['busy']=0x0;if(_0x322b5f==='outbound'){_0x1b8f9b[_0x15c7('0x37')]=0x0;_0x1b8f9b[_0x15c7('0x38')]=0x0;}}var _0x5efa51=_['find'](_0x584eee,['id',_0x1b8f9b['id']]);if(_0x5efa51)_[_0x15c7('0x39')](_0x1b8f9b,_[_0x15c7('0x3a')](_0x5efa51,_0x26c4bb));return _0x1b8f9b;});}function updateAgentVoiceStatus(_0x229647,_0x53a5e8,_0x2f52ae){var _0x5c2696=_[_0x15c7('0x3b')](_0x2f52ae,['queue',_0x53a5e8['name']]);if(_0x5c2696[_0x15c7('0x3c')]===0x0)return _0x229647[_0x15c7('0x3d')]=!![];if(_[_0x15c7('0x3e')](_0x5c2696,[_0x15c7('0x3f'),_0x229647[_0x15c7('0x40')][_0x15c7('0x41')]()]))return _0x229647[_0x15c7('0x1f')]=!![];if(!_0x229647['talking'])return _0x229647[_0x15c7('0x3d')]=!![];}function getVoiceQueueAgents(_0x376191,_0x20a11b,_0x339286,_0x51a811){var _0x261583=_[_0x15c7('0x42')](_0x20a11b,['id',_0x376191['id']]);if(!_0x261583)return _0x376191;return _0x261583['getMembers']({'raw':!![]})['then'](function(_0x125ae5){for(var _0x568c34=0x0;_0x568c34<_0x125ae5[_0x15c7('0x3c')];_0x568c34++){var _0x3a9a89=_['find'](_0x339286,['id',_0x125ae5[_0x568c34]['UserId']]);if(!_0x3a9a89){_0x3a9a89={'id':_0x125ae5[_0x568c34][_0x15c7('0x43')],'name':_0x125ae5[_0x568c34][_0x15c7('0x43')],'accountcode':'','online':![]};}var _0x4407e8={'id':_0x3a9a89['id'],'name':_0x3a9a89[_0x15c7('0x11')],'internal':_0x3a9a89[_0x15c7('0x44')],'online':Boolean(_0x3a9a89['online']),'paused':Boolean(_0x125ae5[_0x568c34][_0x15c7('0x20')])};if(_0x3a9a89[_0x15c7('0x45')]===_0x15c7('0x1f'))updateAgentVoiceStatus(_0x4407e8,_0x376191,_0x51a811);if(_0x4407e8['online'])_0x376191[_0x15c7('0x36')]++;if(_0x4407e8['busy'])_0x376191[_0x15c7('0x3d')]++;if(_0x4407e8[_0x15c7('0x20')]&&!_0x4407e8[_0x15c7('0x3d')]&&!_0x4407e8[_0x15c7('0x1f')])_0x376191['paused']++;_0x376191[_0x15c7('0x35')]['push'](_0x4407e8);}return _0x376191;});}function getQueueAgents(_0x265006,_0x5fc8e8,_0x572abc){var _0x40b260=_0x15c7('0x46')+_['startCase'](_0x572abc)+'Queue';var _0x4b2d76=_0x572abc+_0x15c7('0x47');return db[_0x40b260][_0x15c7('0x48')]({'where':{[_['startCase'](_0x572abc)+_0x15c7('0x49')]:_0x265006['id']},'raw':!![]})['then'](function(_0x134b6c){for(var _0x395657=0x0;_0x395657<_0x134b6c[_0x15c7('0x3c')];_0x395657++){var _0x9fb0c4=_[_0x15c7('0x42')](_0x5fc8e8,['id',_0x134b6c[_0x395657][_0x15c7('0x43')]]);if(!_0x9fb0c4){_0x9fb0c4={'id':_0x134b6c[_0x395657][_0x15c7('0x43')],'name':_0x134b6c[_0x395657]['UserId'],'online':![],['pauseField']:![]};}var _0x2831aa={'id':_0x9fb0c4['id'],'name':_0x9fb0c4[_0x15c7('0x11')],'online':Boolean(_0x9fb0c4[_0x15c7('0x4a')]),'paused':Boolean(_0x9fb0c4[_0x4b2d76])};if(_0x2831aa[_0x15c7('0x4a')])_0x265006[_0x15c7('0x36')]++;_0x265006['agents'][_0x15c7('0x22')](_0x2831aa);}return _0x265006;});}function validateChannel(_0x1325d9){var _0x42778=utils[_0x15c7('0x4b')]();if(!_[_0x15c7('0x4c')](_0x42778,_0x1325d9['toLowerCase']()))throw new Error(_0x15c7('0x4d'));return _0x1325d9['toLowerCase']();}exports['getAgents']=function(_0x52209a,_0x325162){var _0x457dc3={'count':0x0,'rows':[]};var _0x463e57={};var _0x9b81ff;var _0x9f938;var _0x4f6f1f;var _0x222903;var _0x19483f=utils[_0x15c7('0x4b')]();var _0x249bc1=_0x52209a['query']['globalQueueFilter'];var _0x3e5e15=_0x52209a[_0x15c7('0x4e')]['globalStatusFilter'];var _0x5d50f5=_0x52209a[_0x15c7('0x4e')][_0x15c7('0x4f')];var _0x58d70d=_0x3e5e15==='pause'||_0x3e5e15===_0x15c7('0x50')?!![]:![];var _0x2f51cd=[];var _0x17d58a;Promise['resolve']()[_0x15c7('0x16')](function(){if(_0x52209a['query'][_0x15c7('0x51')]){_0x9b81ff=validateChannel(_0x52209a[_0x15c7('0x4e')][_0x15c7('0x51')]);}if(!_0x52209a['query'][_0x15c7('0x52')]||!_0x52209a[_0x15c7('0x4e')][_0x15c7('0x52')][_0x15c7('0x4c')](_0x15c7('0x53'))){_0x52209a['query'][_0x15c7('0x52')]=rta[_0x15c7('0x54')](_0x52209a[_0x15c7('0x4e')][_0x15c7('0x52')]);return;}var _0x2c5a23=rta[_0x15c7('0x55')](_0x52209a['query'][_0x15c7('0x52')]);_0x52209a[_0x15c7('0x4e')][_0x15c7('0x52')]=_0x2c5a23[_0x15c7('0x56')][_0x15c7('0x57')](',');_0x9f938=_0x2c5a23['order'];})[_0x15c7('0x16')](function(){if(!_0x249bc1){return[];}return rta[_0x15c7('0x58')](_0x249bc1,_0x9b81ff);})[_0x15c7('0x16')](function(_0xb84846){_0x2f51cd=_0xb84846;return rta['getRealtimeAgents']();})[_0x15c7('0x16')](function(_0x50bbfc){_0x222903=_0x50bbfc[_0x15c7('0x59')];if((!_0x3e5e15||_0x58d70d)&&!_0x9f938){return _0x2f51cd;}if(_0x9f938&&!_0x3e5e15){return rta['getSortedAgentsIdsByStatus'](_0x222903,_0x2f51cd,_0x9f938);}else{return rta[_0x15c7('0x5a')](_0x222903,_0x2f51cd,_0x3e5e15);}})[_0x15c7('0x16')](function(_0x574349){_0x2f51cd=_0x574349;var _0x5cde91=![];if(_0x2f51cd[_0x15c7('0x3c')]===0x0){if(_0x249bc1||_0x3e5e15){_0x5cde91=!![];}if(_0x58d70d){_0x5cde91=![];}}if(_0x5cde91){return _0x457dc3;}var _0x19ff95=_[_0x15c7('0x33')](db[_0x15c7('0x46')][_0x15c7('0x5b')],function(_0xd6d3f3){return{'name':_0xd6d3f3[_0x15c7('0x5c')],'type':_0xd6d3f3[_0x15c7('0x5d')][_0x15c7('0x5e')]};});_0x52209a[_0x15c7('0x4e')][_0x15c7('0x5f')]=_0x15c7('0x60');_0x52209a[_0x15c7('0x4e')]['online']=!![];_0x463e57=qs[_0x15c7('0x61')](_0x19ff95,_0x52209a);_0x463e57[_0x15c7('0x62')]=!![];var _0x4f31d=[];if(_0x2f51cd['length']>0x0){_0x4f31d['push']({'id':{'$in':_0x2f51cd}});if(_0x9f938&&!_0x3e5e15){_0x17d58a=[db[_0x15c7('0x63')][_0x15c7('0x64')](_0x15c7('0x65')+_0x2f51cd+')')];_0x463e57[_0x15c7('0x66')]=_0x17d58a;}}if(_0x58d70d){_0x19483f[_0x15c7('0x67')](function(_0x38ad05){var _0x72d349=!![];if(_0x3e5e15===_0x15c7('0x50')&&_0x9b81ff!==_0x38ad05){_0x72d349=![];}_0x4f31d[_0x15c7('0x22')]({[_0x38ad05+_0x15c7('0x47')]:_0x72d349});});if(_0x5d50f5){_0x4f31d[_0x15c7('0x22')]({'pauseType':_0x5d50f5});}}else if(_0x3e5e15){_0x19483f[_0x15c7('0x67')](function(_0x4fb116){_0x4f31d[_0x15c7('0x22')]({[_0x4fb116+_0x15c7('0x47')]:![]});});}_0x463e57[_0x15c7('0x68')]=_['merge'](_0x463e57['where'],{'$and':_0x4f31d});if(_0x52209a[_0x15c7('0x69')]['role']===_0x15c7('0x69')){var _0x4976a7={'params':{'id':_0x52209a[_0x15c7('0x69')][_0x15c7('0x6a')]},'query':{'section':_0x15c7('0x6b'),'role':'agent','online':!![],'raw':!![],'ids':_0x2f51cd,'customSorting':_0x17d58a}};if(_0x58d70d){_0x4976a7[_0x15c7('0x4e')]['extraQueryConditions']=_0x4f31d;}_0x4976a7[_0x15c7('0x4e')]=Object['assign'](_0x4976a7[_0x15c7('0x4e')],_0x52209a[_0x15c7('0x4e')]);delete _0x4976a7['query']['id'];return db[_0x15c7('0x6c')][_0x15c7('0x6d')](_0x4976a7);}return db[_0x15c7('0x46')]['findAndCountAll'](_0x463e57);})['then'](function(_0x444402){_0x457dc3[_0x15c7('0xb')]=_0x444402[_0x15c7('0xb')];_0x4f6f1f=_0x444402[_0x15c7('0x59')];return _0x4f6f1f[_0x15c7('0x33')](function(_0x2ec3d7){var _0x36e64f=_[_0x15c7('0x42')](_0x222903,['id',_0x2ec3d7['id']]);if(_0x36e64f){var _0x36f6c3=rta[_0x15c7('0x6e')](_0x36e64f);_['merge'](_0x2ec3d7,_0x36f6c3);}_0x2ec3d7[_0x15c7('0x53')]=rta[_0x15c7('0x6f')](_0x2ec3d7);if(_0x2ec3d7[_0x15c7('0x53')]['includes'](_0x15c7('0x70'))){_0x19483f[_0x15c7('0x67')](function(_0x1c6ae4){if(_0x2ec3d7[_0x1c6ae4+_0x15c7('0x47')]){_0x2ec3d7[_0x1c6ae4+'Status']=_0x15c7('0x70');}});}return _0x2ec3d7;});})[_0x15c7('0x16')](function(_0x5cce11){if(!_0x9f938||_0x17d58a){return _0x5cce11;}return rta[_0x15c7('0x71')](_0x5cce11,_0x9f938);})[_0x15c7('0x16')](function(_0x18053c){_0x457dc3[_0x15c7('0x59')]=_0x18053c;return _0x457dc3;})[_0x15c7('0x16')](respondWithFilteredResult(_0x325162,_0x463e57))['catch'](handleError(_0x325162,null));};exports[_0x15c7('0x72')]=function(_0x216be2,_0x4ab688){var _0x4fb545={'count':0x0,'rows':[]},_0x51f80d={},_0x2c8028,_0x3f611f,_0x196e27,_0x595688,_0x33d85b;Promise['resolve']()[_0x15c7('0x16')](function(){if(_0x216be2[_0x15c7('0x4e')][_0x15c7('0x51')])_0x2c8028=validateChannel(_0x216be2['query'][_0x15c7('0x51')]);var _0x2a61cd=_['startCase'](_0x2c8028)+_0x15c7('0x73');var _0x510b64=_[_0x15c7('0x33')](db[_0x2a61cd][_0x15c7('0x5b')],function(_0x1c1073){return{'name':_0x1c1073[_0x15c7('0x5c')],'type':_0x1c1073['type'][_0x15c7('0x5e')]};});_0x51f80d=qs['getOptions'](_0x510b64,_0x216be2);if(_0x216be2['user'][_0x15c7('0x5f')]===_0x15c7('0x69')){var _0x21d09e={'params':{'id':_0x216be2['user'][_0x15c7('0x6a')]},'query':{'section':_0x2c8028===_0x15c7('0x12')&&_0x216be2[_0x15c7('0x4e')][_0x15c7('0x5d')]===_0x15c7('0x21')?'QueueCampaigns':_[_0x15c7('0x14')](_0x2c8028)+_0x15c7('0x15'),'type':_0x216be2[_0x15c7('0x4e')][_0x15c7('0x5d')],'nolimit':!![],'sort':_0x15c7('0x11'),'filter':_0x216be2[_0x15c7('0x4e')][_0x15c7('0x3b')]}};return db[_0x15c7('0x6c')][_0x15c7('0x6d')](_0x21d09e);}return db[_0x2a61cd][_0x15c7('0x74')](_0x51f80d);})[_0x15c7('0x16')](function(_0x53129b){_0x4fb545[_0x15c7('0xb')]=_0x53129b[_0x15c7('0xb')];_0x3f611f=_0x53129b[_0x15c7('0x59')];return getRealtimeQueues(_0x216be2,_0x2c8028);})[_0x15c7('0x16')](function(_0x14cf44){_0x595688=_0x14cf44[_0x15c7('0x59')];return rta['getRealtimeAgents']();})[_0x15c7('0x16')](function(_0x47fd5a){_0x196e27=_0x47fd5a[_0x15c7('0x59')];if(_0x2c8028!='voice')return;return getRealtimeVoiceQueueChannels();})[_0x15c7('0x16')](function(_0x355d06){_0x33d85b=_0x355d06?_0x355d06[_0x15c7('0x59')]:[];return initializeQueues(_0x3f611f,_0x595688,_0x2c8028,_0x216be2[_0x15c7('0x4e')]['type']);})[_0x15c7('0x16')](function(_0x515022){var _0xbdfa9e=_0x515022[_0x15c7('0x33')](function(_0x49e338){if(_0x2c8028==='voice')return getVoiceQueueAgents(_0x49e338,_0x3f611f,_0x196e27,_0x33d85b);else return getQueueAgents(_0x49e338,_0x196e27,_0x2c8028);});return Promise[_0x15c7('0x75')](_0xbdfa9e);})[_0x15c7('0x16')](function(_0x59c92a){_0x4fb545[_0x15c7('0x59')]=_0x59c92a;return _0x4fb545;})[_0x15c7('0x16')](respondWithFilteredResult(_0x4ab688,_0x51f80d))[_0x15c7('0x18')](handleError(_0x4ab688,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 8744d09..a762427 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xded12b,_0xecfb8e){var _0x572384=function(_0x128e11){while(--_0x128e11){_0xded12b['push'](_0xded12b['shift']());}};_0x572384(++_0xecfb8e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x3e0e11,_0x2b8f9a){var _0x3f1cb1=function(_0x29d899){while(--_0x29d899){_0x3e0e11['push'](_0x3e0e11['shift']());}};_0x3f1cb1(++_0x2b8f9a);}(_0xedd9,0xfc));var _0x9edd=function(_0x3cdda5,_0x5bc6cb){_0x3cdda5=_0x3cdda5-0x0;var _0x3e2576=_0xedd9[_0x3cdda5];return _0x3e2576;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 6d96ff2..c8e72ad 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 _0x37a7=['exports','STRING','DATE','sequelize'];(function(_0xff6ee4,_0x381143){var _0x5acb85=function(_0x3d49c4){while(--_0x3d49c4){_0xff6ee4['push'](_0xff6ee4['shift']());}};_0x5acb85(++_0x381143);}(_0x37a7,0x6f));var _0x737a=function(_0x309266,_0x2ef53b){_0x309266=_0x309266-0x0;var _0x31b440=_0x37a7[_0x309266];return _0x31b440;};'use strict';var Sequelize=require(_0x737a('0x0'));module[_0x737a('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x737a('0x2')]},'starttime':{'type':Sequelize[_0x737a('0x3')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x737a('0x2')]},'membername':{'type':Sequelize[_0x737a('0x2')]}}; \ No newline at end of file +var _0xdf70=['exports','INTEGER','DATE','STRING','sequelize'];(function(_0x31b53d,_0x24f792){var _0x1f6728=function(_0xcc8ba8){while(--_0xcc8ba8){_0x31b53d['push'](_0x31b53d['shift']());}};_0x1f6728(++_0x24f792);}(_0xdf70,0x86));var _0x0df7=function(_0x610a81,_0x34f514){_0x610a81=_0x610a81-0x0;var _0x53b967=_0xdf70[_0x610a81];return _0x53b967;};'use strict';var Sequelize=require(_0x0df7('0x0'));module[_0x0df7('0x1')]={'state':{'type':Sequelize[_0x0df7('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x0df7('0x3')]},'uniqueid':{'type':Sequelize[_0x0df7('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x0df7('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x0df7('0x4')]},'campaigntype':{'type':Sequelize[_0x0df7('0x4')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 221415a..fa08778 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 _0x02da=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','report_agent_preview','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x02da,0x103));var _0xa02d=function(_0x49500b,_0x5c53e5){_0x49500b=_0x49500b-0x0;var _0x5be5fa=_0x02da[_0x49500b];return _0x5be5fa;};'use strict';var _=require(_0xa02d('0x0'));var util=require('util');var logger=require(_0xa02d('0x1'))(_0xa02d('0x2'));var moment=require(_0xa02d('0x3'));var BPromise=require(_0xa02d('0x4'));var rp=require(_0xa02d('0x5'));var fs=require('fs');var path=require(_0xa02d('0x6'));var rimraf=require(_0xa02d('0x7'));var config=require(_0xa02d('0x8'));var attributes=require(_0xa02d('0x9'));module[_0xa02d('0xa')]=function(_0x242269,_0x576507){return _0x242269[_0xa02d('0xb')]('ReportAgentPreview',attributes,{'tableName':_0xa02d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2d6=['path','rimraf','../../config/environment','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x2a4fe2,_0x3ec53a){var _0x225c4a=function(_0x1eccfa){while(--_0x1eccfa){_0x2a4fe2['push'](_0x2a4fe2['shift']());}};_0x225c4a(++_0x3ec53a);}(_0xd2d6,0x96));var _0x6d2d=function(_0x3e0ad0,_0x503c0e){_0x3e0ad0=_0x3e0ad0-0x0;var _0x2556ce=_0xd2d6[_0x3e0ad0];return _0x2556ce;};'use strict';var _=require(_0x6d2d('0x0'));var util=require(_0x6d2d('0x1'));var logger=require(_0x6d2d('0x2'))(_0x6d2d('0x3'));var moment=require(_0x6d2d('0x4'));var BPromise=require('bluebird');var rp=require(_0x6d2d('0x5'));var fs=require('fs');var path=require(_0x6d2d('0x6'));var rimraf=require(_0x6d2d('0x7'));var config=require(_0x6d2d('0x8'));var attributes=require('./reportAgentPreview.attributes');module[_0x6d2d('0x9')]=function(_0x1de82c,_0x337cf7){return _0x1de82c[_0x6d2d('0xa')](_0x6d2d('0xb'),attributes,{'tableName':_0x6d2d('0xc'),'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 32b4704..d6ea669 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 _0xab13=['request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','options','raw','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http'];(function(_0x4ded16,_0x23fcbf){var _0x4a525a=function(_0x2c6b5e){while(--_0x2c6b5e){_0x4ded16['push'](_0x4ded16['shift']());}};_0x4a525a(++_0x23fcbf);}(_0xab13,0x66));var _0x3ab1=function(_0x299027,_0x5d2e4f){_0x299027=_0x299027-0x0;var _0x1bc622=_0xab13[_0x299027];return _0x1bc622;};'use strict';var _=require(_0x3ab1('0x0'));var util=require(_0x3ab1('0x1'));var moment=require(_0x3ab1('0x2'));var BPromise=require('bluebird');var rs=require(_0x3ab1('0x3'));var fs=require('fs');var Redis=require(_0x3ab1('0x4'));var db=require(_0x3ab1('0x5'))['db'];var utils=require(_0x3ab1('0x6'));var logger=require(_0x3ab1('0x7'))('rpc');var config=require(_0x3ab1('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3ab1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a2e9c,_0x1bb0d3,_0x4ec0a4){return new BPromise(function(_0x626d50,_0x347f4f){return client[_0x3ab1('0xa')](_0x4a2e9c,_0x4ec0a4)[_0x3ab1('0xb')](function(_0x871551){logger[_0x3ab1('0xc')](_0x3ab1('0xd'),_0x1bb0d3,_0x3ab1('0xe'));logger[_0x3ab1('0xf')](_0x3ab1('0x10'),_0x1bb0d3,'request\x20sent',JSON['stringify'](_0x871551));if(_0x871551[_0x3ab1('0x11')]){if(_0x871551[_0x3ab1('0x11')][_0x3ab1('0x12')]===0x1f4){logger[_0x3ab1('0x11')](_0x3ab1('0xd'),_0x1bb0d3,_0x871551[_0x3ab1('0x11')][_0x3ab1('0x13')]);return _0x347f4f(_0x871551['error'][_0x3ab1('0x13')]);}logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x1bb0d3,_0x871551['error']['message']);return _0x626d50(_0x871551[_0x3ab1('0x11')][_0x3ab1('0x13')]);}else{logger['info'](_0x3ab1('0xd'),_0x1bb0d3,_0x3ab1('0xe'));_0x626d50(_0x871551[_0x3ab1('0x14')][_0x3ab1('0x13')]);}})[_0x3ab1('0x15')](function(_0x27d543){logger[_0x3ab1('0x11')](_0x3ab1('0xd'),_0x1bb0d3,_0x27d543);_0x347f4f(_0x27d543);});});}exports[_0x3ab1('0x16')]=function(_0x269fcb){var _0x31a221=this;return new Promise(function(_0x2f8d7f,_0x1bef57){return db[_0x3ab1('0x17')][_0x3ab1('0x18')](_0x269fcb['body'],{'raw':_0x269fcb[_0x3ab1('0x19')]?_0x269fcb[_0x3ab1('0x19')][_0x3ab1('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x198f45){logger[_0x3ab1('0xc')](_0x3ab1('0x16'),_0x269fcb);logger[_0x3ab1('0xf')](_0x3ab1('0x16'),_0x269fcb,JSON[_0x3ab1('0x1b')](_0x198f45));_0x2f8d7f(_0x198f45);})[_0x3ab1('0x15')](function(_0x4efe22){logger[_0x3ab1('0x11')](_0x3ab1('0x16'),_0x4efe22['message'],_0x269fcb);_0x1bef57(_0x31a221[_0x3ab1('0x11')](0x1f4,_0x4efe22[_0x3ab1('0x13')]));});});}; \ No newline at end of file +var _0x562f=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateReportAgentPreview','ReportAgentPreview','create','options','raw','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x46aa6f,_0xf7b072){var _0x44759c=function(_0x97a501){while(--_0x97a501){_0x46aa6f['push'](_0x46aa6f['shift']());}};_0x44759c(++_0xf7b072);}(_0x562f,0x1d6));var _0xf562=function(_0x53d17e,_0xf979c9){_0x53d17e=_0x53d17e-0x0;var _0x35b0cc=_0x562f[_0x53d17e];return _0x35b0cc;};'use strict';var _=require(_0xf562('0x0'));var util=require(_0xf562('0x1'));var moment=require(_0xf562('0x2'));var BPromise=require(_0xf562('0x3'));var rs=require(_0xf562('0x4'));var fs=require('fs');var Redis=require(_0xf562('0x5'));var db=require(_0xf562('0x6'))['db'];var utils=require(_0xf562('0x7'));var logger=require(_0xf562('0x8'))('rpc');var config=require(_0xf562('0x9'));var jayson=require(_0xf562('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e9bc3,_0x4fb1e6,_0x1e556a){return new BPromise(function(_0x289ddd,_0x23601f){return client[_0xf562('0xb')](_0x3e9bc3,_0x1e556a)[_0xf562('0xc')](function(_0x23929f){logger[_0xf562('0xd')](_0xf562('0xe'),_0x4fb1e6,_0xf562('0xf'));logger[_0xf562('0x10')](_0xf562('0x11'),_0x4fb1e6,'request\x20sent',JSON[_0xf562('0x12')](_0x23929f));if(_0x23929f[_0xf562('0x13')]){if(_0x23929f[_0xf562('0x13')][_0xf562('0x14')]===0x1f4){logger[_0xf562('0x13')](_0xf562('0xe'),_0x4fb1e6,_0x23929f[_0xf562('0x13')]['message']);return _0x23601f(_0x23929f[_0xf562('0x13')]['message']);}logger[_0xf562('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x4fb1e6,_0x23929f[_0xf562('0x13')][_0xf562('0x15')]);return _0x289ddd(_0x23929f['error'][_0xf562('0x15')]);}else{logger[_0xf562('0xd')](_0xf562('0xe'),_0x4fb1e6,_0xf562('0xf'));_0x289ddd(_0x23929f[_0xf562('0x16')][_0xf562('0x15')]);}})['catch'](function(_0x589d03){logger[_0xf562('0x13')](_0xf562('0xe'),_0x4fb1e6,_0x589d03);_0x23601f(_0x589d03);});});}exports[_0xf562('0x17')]=function(_0x507804){var _0x574670=this;return new Promise(function(_0x4e8b3b,_0x293891){return db[_0xf562('0x18')][_0xf562('0x19')](_0x507804['body'],{'raw':_0x507804[_0xf562('0x1a')]?_0x507804[_0xf562('0x1a')][_0xf562('0x1b')]===undefined?!![]:![]:!![]})[_0xf562('0xc')](function(_0x4cc152){logger[_0xf562('0xd')](_0xf562('0x17'),_0x507804);logger[_0xf562('0x10')](_0xf562('0x17'),_0x507804,JSON[_0xf562('0x12')](_0x4cc152));_0x4e8b3b(_0x4cc152);})['catch'](function(_0x5a46d7){logger[_0xf562('0x13')](_0xf562('0x17'),_0x5a46d7[_0xf562('0x15')],_0x507804);_0x293891(_0x574670[_0xf562('0x13')](0x1f4,_0x5a46d7['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 26ecec9..b36eb26 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 _0x8f65=['/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','showMailQueues','post','/chat/queues/:id/notify','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','exports','multer','util','path','Router','../../components/auth/service','/voice/channels','isAuthenticated','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesChannel','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','outbound','/outbound/channels','outboundChannels','/agents','put','/agents/:id/capacity','agentCapacity','/telephones','/trunks','trunks','/campaigns','campaigns'];(function(_0x4d038a,_0x5755f3){var _0x37f39a=function(_0x496dac){while(--_0x496dac){_0x4d038a['push'](_0x4d038a['shift']());}};_0x37f39a(++_0x5755f3);}(_0x8f65,0x11b));var _0x58f6=function(_0x4ff44c,_0x2c3583){_0x4ff44c=_0x4ff44c-0x0;var _0x4e40ee=_0x8f65[_0x4ff44c];return _0x4e40ee;};'use strict';var multer=require(_0x58f6('0x0'));var util=require(_0x58f6('0x1'));var path=require(_0x58f6('0x2'));var express=require('express');var router=express[_0x58f6('0x3')]();var auth=require(_0x58f6('0x4'));var controller=require('./rpc.controller');router['get'](_0x58f6('0x5'),auth[_0x58f6('0x6')](),controller[_0x58f6('0x7')]);router[_0x58f6('0x8')](_0x58f6('0x9'),auth[_0x58f6('0x6')](),controller[_0x58f6('0xa')]);router[_0x58f6('0x8')](_0x58f6('0xb'),auth[_0x58f6('0x6')](),controller['voiceChannelStopMixMonitor']);router[_0x58f6('0x8')](_0x58f6('0xc'),auth[_0x58f6('0x6')](),controller[_0x58f6('0xd')]);router['get'](_0x58f6('0xe'),auth[_0x58f6('0x6')](),controller['chatQueues']);router[_0x58f6('0x8')](_0x58f6('0xf'),auth[_0x58f6('0x6')](),controller[_0x58f6('0x10')]);router[_0x58f6('0x8')](_0x58f6('0x11'),auth[_0x58f6('0x6')](),controller[_0x58f6('0x12')]);router[_0x58f6('0x8')](_0x58f6('0x13'),auth[_0x58f6('0x6')](),controller['openchannelQueues']);router[_0x58f6('0x8')](_0x58f6('0x14'),auth['isAuthenticated'](),controller[_0x58f6('0x15')]);router[_0x58f6('0x8')](_0x58f6('0x16'),auth[_0x58f6('0x6')](),controller[_0x58f6('0x17')]);router[_0x58f6('0x8')](_0x58f6('0x18'),auth[_0x58f6('0x6')](),controller[_0x58f6('0x19')]);router['get']('/voice/queues/preview/:id',auth[_0x58f6('0x6')](),controller['voiceQueuesPreview']);router[_0x58f6('0x8')]('/voice/queues/channels',auth[_0x58f6('0x6')](),controller['voiceQueuesChannels']);router['get']('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0x58f6('0x1a')]);router['get']('/voice/queues/channels/:uniqueid/hangup',auth[_0x58f6('0x6')](),controller[_0x58f6('0x1b')]);router[_0x58f6('0x8')](_0x58f6('0x1c'),auth[_0x58f6('0x6')](),controller[_0x58f6('0x1d')]);router[_0x58f6('0x8')](_0x58f6('0x1e'),auth[_0x58f6('0x6')](),controller[_0x58f6('0x1f')]);router['put'](_0x58f6('0x1e'),auth[_0x58f6('0x6')](),controller[_0x58f6('0x20')]);router[_0x58f6('0x8')]('/outbound',auth[_0x58f6('0x6')](),controller[_0x58f6('0x21')]);router[_0x58f6('0x8')](_0x58f6('0x22'),auth[_0x58f6('0x6')](),controller[_0x58f6('0x23')]);router[_0x58f6('0x8')](_0x58f6('0x24'),auth[_0x58f6('0x6')](),controller['agents']);router[_0x58f6('0x25')](_0x58f6('0x26'),auth[_0x58f6('0x6')](),controller[_0x58f6('0x27')]);router[_0x58f6('0x8')](_0x58f6('0x28'),auth[_0x58f6('0x6')](),controller['telephones']);router['get'](_0x58f6('0x29'),auth[_0x58f6('0x6')](),controller[_0x58f6('0x2a')]);router[_0x58f6('0x8')](_0x58f6('0x2b'),auth['isAuthenticated'](),controller[_0x58f6('0x2c')]);router['get'](_0x58f6('0x2d'),auth[_0x58f6('0x6')](),controller[_0x58f6('0x2e')]);router[_0x58f6('0x8')](_0x58f6('0x2f'),auth['isAuthenticated'](),controller[_0x58f6('0x30')]);router[_0x58f6('0x8')](_0x58f6('0x31'),auth['isAuthenticated'](),controller[_0x58f6('0x32')]);router[_0x58f6('0x8')](_0x58f6('0x33'),auth[_0x58f6('0x6')](),controller[_0x58f6('0x34')]);router[_0x58f6('0x8')](_0x58f6('0x35'),auth[_0x58f6('0x6')](),controller[_0x58f6('0x36')]);router[_0x58f6('0x8')]('/sms/queues/waitinginteractions',auth[_0x58f6('0x6')](),controller[_0x58f6('0x37')]);router['get'](_0x58f6('0x38'),auth[_0x58f6('0x6')](),controller[_0x58f6('0x39')]);router[_0x58f6('0x8')](_0x58f6('0x3a'),auth['isAuthenticated'](),controller[_0x58f6('0x3b')]);router['post'](_0x58f6('0x3c'),auth[_0x58f6('0x6')](),controller[_0x58f6('0x3d')]('mail'));router[_0x58f6('0x8')](_0x58f6('0x3e'),auth['isAuthenticated'](),controller[_0x58f6('0x3f')]);router[_0x58f6('0x40')](_0x58f6('0x41'),auth['isAuthenticated'](),controller[_0x58f6('0x3d')]('chat'));router[_0x58f6('0x8')]('/chat/queues/:id',auth['isAuthenticated'](),controller[_0x58f6('0x42')]);router[_0x58f6('0x40')](_0x58f6('0x43'),auth[_0x58f6('0x6')](),controller[_0x58f6('0x3d')](_0x58f6('0x44')));router[_0x58f6('0x8')](_0x58f6('0x45'),auth[_0x58f6('0x6')](),controller[_0x58f6('0x46')]);router[_0x58f6('0x40')]('/openchannel/queues/:id/notify',auth['isAuthenticated'](),controller[_0x58f6('0x3d')](_0x58f6('0x47')));router[_0x58f6('0x8')](_0x58f6('0x48'),auth[_0x58f6('0x6')](),controller[_0x58f6('0x49')]);router[_0x58f6('0x40')]('/sms/queues/:id/notify',auth[_0x58f6('0x6')](),controller[_0x58f6('0x3d')](_0x58f6('0x4a')));router['post'](_0x58f6('0x4b'),auth[_0x58f6('0x6')](),controller[_0x58f6('0x3d')](_0x58f6('0x4c')));router[_0x58f6('0x8')]('/sms/queues/:id',auth['isAuthenticated'](),controller[_0x58f6('0x4d')]);router[_0x58f6('0x8')](_0x58f6('0x4e'),auth[_0x58f6('0x6')](),controller[_0x58f6('0x4f')]);router[_0x58f6('0x40')](_0x58f6('0x50'),auth[_0x58f6('0x6')](),controller['agentNotify']);module[_0x58f6('0x51')]=router; \ No newline at end of file +var _0xb676=['/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','exports','multer','util','path','Router','../../components/auth/service','./rpc.controller','isAuthenticated','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','mailQueues','mailAccounts','/openchannel/queues','/sms/queues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','post','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify'];(function(_0x29e7eb,_0x31eafb){var _0x3815f1=function(_0x1b39a1){while(--_0x1b39a1){_0x29e7eb['push'](_0x29e7eb['shift']());}};_0x3815f1(++_0x31eafb);}(_0xb676,0x1f2));var _0x6b67=function(_0x59d0cc,_0xa7c52b){_0x59d0cc=_0x59d0cc-0x0;var _0x2ae79f=_0xb676[_0x59d0cc];return _0x2ae79f;};'use strict';var multer=require(_0x6b67('0x0'));var util=require(_0x6b67('0x1'));var path=require(_0x6b67('0x2'));var express=require('express');var router=express[_0x6b67('0x3')]();var auth=require(_0x6b67('0x4'));var controller=require(_0x6b67('0x5'));router['get']('/voice/channels',auth[_0x6b67('0x6')](),controller[_0x6b67('0x7')]);router[_0x6b67('0x8')](_0x6b67('0x9'),auth[_0x6b67('0x6')](),controller[_0x6b67('0xa')]);router[_0x6b67('0x8')](_0x6b67('0xb'),auth[_0x6b67('0x6')](),controller['voiceChannelStopMixMonitor']);router[_0x6b67('0x8')](_0x6b67('0xc'),auth['isAuthenticated'](),controller[_0x6b67('0xd')]);router[_0x6b67('0x8')](_0x6b67('0xe'),auth['isAuthenticated'](),controller[_0x6b67('0xf')]);router[_0x6b67('0x8')]('/mail/queues',auth[_0x6b67('0x6')](),controller[_0x6b67('0x10')]);router['get']('/mail/accounts',auth['isAuthenticated'](),controller[_0x6b67('0x11')]);router[_0x6b67('0x8')](_0x6b67('0x12'),auth[_0x6b67('0x6')](),controller['openchannelQueues']);router[_0x6b67('0x8')](_0x6b67('0x13'),auth[_0x6b67('0x6')](),controller['smsQueues']);router[_0x6b67('0x8')](_0x6b67('0x14'),auth[_0x6b67('0x6')](),controller[_0x6b67('0x15')]);router[_0x6b67('0x8')](_0x6b67('0x16'),auth[_0x6b67('0x6')](),controller[_0x6b67('0x17')]);router['get'](_0x6b67('0x18'),auth[_0x6b67('0x6')](),controller[_0x6b67('0x19')]);router[_0x6b67('0x8')](_0x6b67('0x1a'),auth[_0x6b67('0x6')](),controller['voiceQueuesChannels']);router['get'](_0x6b67('0x1b'),auth['isAuthenticated'](),controller['voiceQueuesChannel']);router['get'](_0x6b67('0x1c'),auth[_0x6b67('0x6')](),controller[_0x6b67('0x1d')]);router[_0x6b67('0x8')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x6b67('0x6')](),controller[_0x6b67('0x1e')]);router[_0x6b67('0x8')](_0x6b67('0x1f'),auth['isAuthenticated'](),controller['showVoiceQueues']);router['put']('/voice/queues/:id',auth[_0x6b67('0x6')](),controller[_0x6b67('0x20')]);router[_0x6b67('0x8')](_0x6b67('0x21'),auth[_0x6b67('0x6')](),controller[_0x6b67('0x22')]);router[_0x6b67('0x8')](_0x6b67('0x23'),auth[_0x6b67('0x6')](),controller[_0x6b67('0x24')]);router[_0x6b67('0x8')]('/agents',auth[_0x6b67('0x6')](),controller[_0x6b67('0x25')]);router[_0x6b67('0x26')](_0x6b67('0x27'),auth['isAuthenticated'](),controller[_0x6b67('0x28')]);router[_0x6b67('0x8')](_0x6b67('0x29'),auth['isAuthenticated'](),controller[_0x6b67('0x2a')]);router[_0x6b67('0x8')](_0x6b67('0x2b'),auth[_0x6b67('0x6')](),controller[_0x6b67('0x2c')]);router[_0x6b67('0x8')](_0x6b67('0x2d'),auth[_0x6b67('0x6')](),controller[_0x6b67('0x2e')]);router[_0x6b67('0x8')](_0x6b67('0x2f'),auth[_0x6b67('0x6')](),controller[_0x6b67('0x30')]);router[_0x6b67('0x8')](_0x6b67('0x31'),auth[_0x6b67('0x6')](),controller[_0x6b67('0x32')]);router[_0x6b67('0x8')](_0x6b67('0x33'),auth[_0x6b67('0x6')](),controller[_0x6b67('0x34')]);router[_0x6b67('0x8')](_0x6b67('0x35'),auth[_0x6b67('0x6')](),controller['openchannelQueuesWaitingInteractions']);router[_0x6b67('0x8')](_0x6b67('0x36'),auth[_0x6b67('0x6')](),controller[_0x6b67('0x37')]);router[_0x6b67('0x8')](_0x6b67('0x38'),auth['isAuthenticated'](),controller['smsQueuesWaitingInteractions']);router['get'](_0x6b67('0x39'),auth[_0x6b67('0x6')](),controller[_0x6b67('0x3a')]);router[_0x6b67('0x8')](_0x6b67('0x3b'),auth[_0x6b67('0x6')](),controller['faxQueuesWaitingInteractions']);router['post'](_0x6b67('0x3c'),auth[_0x6b67('0x6')](),controller[_0x6b67('0x3d')](_0x6b67('0x3e')));router[_0x6b67('0x8')](_0x6b67('0x3f'),auth['isAuthenticated'](),controller[_0x6b67('0x40')]);router[_0x6b67('0x41')]('/chat/queues/:id/notify',auth[_0x6b67('0x6')](),controller[_0x6b67('0x3d')](_0x6b67('0x42')));router[_0x6b67('0x8')](_0x6b67('0x43'),auth[_0x6b67('0x6')](),controller[_0x6b67('0x44')]);router[_0x6b67('0x41')](_0x6b67('0x45'),auth[_0x6b67('0x6')](),controller[_0x6b67('0x3d')](_0x6b67('0x46')));router['get'](_0x6b67('0x47'),auth['isAuthenticated'](),controller['showFaxQueues']);router[_0x6b67('0x41')](_0x6b67('0x48'),auth[_0x6b67('0x6')](),controller['queueNotify']('openchannel'));router['get'](_0x6b67('0x49'),auth['isAuthenticated'](),controller[_0x6b67('0x4a')]);router['post'](_0x6b67('0x4b'),auth[_0x6b67('0x6')](),controller[_0x6b67('0x3d')]('sms'));router[_0x6b67('0x41')](_0x6b67('0x4c'),auth[_0x6b67('0x6')](),controller['queueNotify'](_0x6b67('0x4d')));router[_0x6b67('0x8')](_0x6b67('0x4e'),auth[_0x6b67('0x6')](),controller[_0x6b67('0x4f')]);router['get']('/whatsapp/queues/:id',auth[_0x6b67('0x6')](),controller[_0x6b67('0x50')]);router['post']('/agents/:id/notify',auth[_0x6b67('0x6')](),controller['agentNotify']);module[_0x6b67('0x51')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 001ff9d..0ba97e8 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 _0x425d=['http','request','then','error','code','message','result','catch','status','sendStatus','stack','name','isNil','rows','find','query','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outboundChannels','agents','Agents','agentCapacity','body','interaction','user','MemberReport','length','format','updateAttributes','findOrCreate','INTERACTION','interface','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','Telephones','trunks','campaigns','Campaigns','ChatQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','Message','messageId','Interaction','\x20Message\x20not\x20found','MessageId','InteractionId','From','QueueId','TransferReport','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','User','update','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client'];(function(_0x5954e3,_0x29538a){var _0x1659c8=function(_0xbf3280){while(--_0xbf3280){_0x5954e3['push'](_0x5954e3['shift']());}};_0x1659c8(++_0x29538a);}(_0x425d,0x1e0));var _0xd425=function(_0x354bd6,_0x4a7c74){_0x354bd6=_0x354bd6-0x0;var _0x39bf52=_0x425d[_0x354bd6];return _0x39bf52;};'use strict';var BPromise=require(_0xd425('0x0'));var moment=require('moment');var _=require(_0xd425('0x1'));var util=require(_0xd425('0x2'));var db=require(_0xd425('0x3'))['db'];var logger=require(_0xd425('0x4'))(_0xd425('0x5'));var jayson=require(_0xd425('0x6'));var amiClient=jayson[_0xd425('0x7')]['http']({'port':0x232a});var mailClient=jayson[_0xd425('0x7')][_0xd425('0x8')]({'port':0x232b});var routingClient=jayson[_0xd425('0x7')][_0xd425('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x1d97d9,_0x1d2ed0,_0x50b061){return new BPromise(function(_0xb6ba8e,_0x374c3d){var _0x262b02=_0x50b061?_0x50b061:amiClient;return _0x262b02[_0xd425('0x9')](_0x1d97d9,_0x1d2ed0)[_0xd425('0xa')](function(_0x2beb20){if(_0x2beb20[_0xd425('0xb')]){if(_0x2beb20[_0xd425('0xb')][_0xd425('0xc')]===0x1f4){return _0x374c3d(_0x2beb20[_0xd425('0xb')][_0xd425('0xd')]);}return _0xb6ba8e(_0x2beb20[_0xd425('0xb')][_0xd425('0xd')]);}else{_0xb6ba8e(_0x2beb20[_0xd425('0xe')]);}})[_0xd425('0xf')](function(_0x2385a5){_0x374c3d(_0x2385a5);});});}function respondWithResult(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xc8;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x10')](_0x3cacf7)['json'](_0x3b5de8);}return _0x9bb611[_0xd425('0x11')](0x194);};}function handleError(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0x1f4;return function(_0x5d3d60){logger[_0xd425('0xb')](_0x5d3d60[_0xd425('0x12')]);if(_0x5d3d60[_0xd425('0x13')]){delete _0x5d3d60[_0xd425('0x13')];}_0x17a498[_0xd425('0x10')](_0x336dc3)['send'](_0x5d3d60);};}function findById(_0x278626){return function(_0x471267){if(!_[_0xd425('0x14')](_0x278626)&&!_[_0xd425('0x14')](_0x471267)&&!_['isNil'](_0x471267[_0xd425('0x15')])){return _[_0xd425('0x16')](_0x471267[_0xd425('0x15')],function(_0x1155bc){return _0x1155bc['id']==_0x278626;});}return null;};}exports['voiceChannels']=function(_0x58a0c1,_0x5debc3){return respondWithRpcPromise('VoiceChannels',_0x58a0c1[_0xd425('0x17')])[_0xd425('0xa')](respondWithResult(_0x5debc3,null))[_0xd425('0xf')](handleError(_0x5debc3,null));};exports['voiceChannelMixMonitor']=function(_0x355af0,_0x7e982e){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xd425('0x18')](_0x355af0[_0xd425('0x17')],_0x355af0[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x7e982e,null))[_0xd425('0xf')](handleError(_0x7e982e,null));};exports[_0xd425('0x1a')]=function(_0x2480a0,_0x3500bb){return respondWithRpcPromise(_0xd425('0x1b'),_[_0xd425('0x18')](_0x2480a0[_0xd425('0x17')],_0x2480a0[_0xd425('0x19')]))['then'](respondWithResult(_0x3500bb,null))[_0xd425('0xf')](handleError(_0x3500bb,null));};exports[_0xd425('0x1c')]=function(_0x398985,_0x1908a5){return respondWithRpcPromise(_0xd425('0x1d'),_0x398985[_0xd425('0x17')])[_0xd425('0xa')](respondWithResult(_0x1908a5,null))['catch'](handleError(_0x1908a5,null));};exports[_0xd425('0x1e')]=function(_0x177de2,_0x1d8861){return respondWithRpcPromise('VoiceQueues',_0x177de2[_0xd425('0x17')])[_0xd425('0xa')](findById(_0x177de2[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x1d8861,null))[_0xd425('0xf')](handleError(_0x1d8861,null));};exports[_0xd425('0x1f')]=function(_0x2fd17a,_0x37b63c){return respondWithRpcPromise(_0xd425('0x20'),_[_0xd425('0x18')](_0x2fd17a['body'],_0x2fd17a[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x37b63c,null))[_0xd425('0xf')](handleError(_0x37b63c,null));};exports[_0xd425('0x21')]=function(_0x3275b1,_0x1abf33){return respondWithRpcPromise(_0xd425('0x22'),_[_0xd425('0x18')](_0x3275b1[_0xd425('0x17')],_0x3275b1[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x1abf33,null))['catch'](handleError(_0x1abf33,null));};exports[_0xd425('0x23')]=function(_0x2a2a9b,_0x3120a4){return respondWithRpcPromise(_0xd425('0x24'),_0x2a2a9b[_0xd425('0x17')])['then'](respondWithResult(_0x3120a4,null))[_0xd425('0xf')](handleError(_0x3120a4,null));};exports[_0xd425('0x25')]=function(_0x4cfcd1,_0x574962){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xd425('0x18')](_0x4cfcd1[_0xd425('0x17')],_0x4cfcd1[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x574962,null))['catch'](handleError(_0x574962,null));};exports[_0xd425('0x26')]=function(_0x1d4414,_0x30a9dc){return respondWithRpcPromise(_0xd425('0x27'),_[_0xd425('0x18')](_0x1d4414[_0xd425('0x17')],_0x1d4414[_0xd425('0x19')]))['then'](respondWithResult(_0x30a9dc,null))[_0xd425('0xf')](handleError(_0x30a9dc,null));};exports['voiceQueuesChannelRedirect']=function(_0x22df81,_0x29cca9){return respondWithRpcPromise(_0xd425('0x28'),_['merge'](_0x22df81[_0xd425('0x17')],_0x22df81[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x29cca9,null))[_0xd425('0xf')](handleError(_0x29cca9,null));};exports['outbound']=function(_0x1d38fa,_0x3cf540){return respondWithRpcPromise('Outbound',_0x1d38fa['query'])['then'](respondWithResult(_0x3cf540,null))[_0xd425('0xf')](handleError(_0x3cf540,null));};exports[_0xd425('0x29')]=function(_0x1f30c1,_0x588688){return respondWithRpcPromise('OutboundChannels',_0x1f30c1['query'])[_0xd425('0xa')](respondWithResult(_0x588688,null))[_0xd425('0xf')](handleError(_0x588688,null));};exports[_0xd425('0x2a')]=function(_0x1d5017,_0xa9fd7c){var _0x14f3be;return respondWithRpcPromise(_0xd425('0x2b'),_0x1d5017['query'])[_0xd425('0xa')](function(_0x3c88a8){_0x14f3be=_0x3c88a8;return respondWithRpcPromise(_0xd425('0x2b'),_0x1d5017['query'],routingClient);})[_0xd425('0xa')](function(_0x2dffc7){return _[_0xd425('0x18')]({},_0x2dffc7,_0x14f3be);})['then'](respondWithResult(_0xa9fd7c,null))[_0xd425('0xf')](handleError(_0xa9fd7c,null));};exports[_0xd425('0x2c')]=function(_0x1c5ba6,_0x2d7a2f){if(_0x1c5ba6['body']&&_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')]&&_0x1c5ba6[_0xd425('0x2f')]&&_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x13')]){for(var _0x2f6bf7 in _0x1c5ba6[_0xd425('0x2d')]['interaction']){if(_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')]['hasOwnProperty'](_0x2f6bf7)){db[_0xd425('0x30')]['findAll']({'where':{'channel':_0x2f6bf7,'membername':_0x1c5ba6['user'][_0xd425('0x13')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x1c5ba6[_0xd425('0x2d')]['interaction'][_0x2f6bf7]&&_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')][_0x2f6bf7][_0xd425('0x31')]?{'$notIn':_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')][_0x2f6bf7]}:{'$ne':null}}})['then'](function(_0x2e4b21){var _0x5f3cfd=moment()[_0xd425('0x32')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x78ed9b=0x0,_0x16f61c=_0x2e4b21[_0xd425('0x31')];_0x78ed9b<_0x16f61c;_0x78ed9b+=0x1){_0x2e4b21[_0x78ed9b][_0xd425('0x33')]({'exitAt':_0x5f3cfd});}});for(var _0x624543=0x0;_0x624543<_0x1c5ba6['body'][_0xd425('0x2e')][_0x2f6bf7][_0xd425('0x31')];_0x624543+=0x1){db[_0xd425('0x30')][_0xd425('0x34')]({'where':{'channel':_0x2f6bf7,'membername':_0x1c5ba6[_0xd425('0x2f')]['name'],'type':_0xd425('0x35'),'uniqueid':_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')][_0x2f6bf7][_0x624543],'exitAt':null},'defaults':{'channel':_0x2f6bf7,'membername':_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x13')],'interface':_[_0xd425('0x14')](_0x1c5ba6['user'][_0xd425('0x36')])?util[_0xd425('0x32')]('SIP/%s',_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x13')]):_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x36')],'type':'INTERACTION','enterAt':moment()[_0xd425('0x32')](_0xd425('0x37')),'role':_0xd425('0x38'),'internal':_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x39')],'uniqueid':_0x1c5ba6['body']['interaction'][_0x2f6bf7][_0x624543]}});}}}}return respondWithRpcPromise(_0xd425('0x3a'),{'id':_0x1c5ba6['params']['id'],'capacity':_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x3b')]},routingClient)['then'](respondWithResult(_0x2d7a2f,null))[_0xd425('0xf')](handleError(_0x2d7a2f,null));};exports['telephones']=function(_0x48d5b8,_0x39f588){return respondWithRpcPromise(_0xd425('0x3c'),_0x48d5b8[_0xd425('0x17')])[_0xd425('0xa')](respondWithResult(_0x39f588,null))[_0xd425('0xf')](handleError(_0x39f588,null));};exports[_0xd425('0x3d')]=function(_0xeb3586,_0x4118fe){return respondWithRpcPromise('Trunks',_0xeb3586[_0xd425('0x17')])[_0xd425('0xa')](respondWithResult(_0x4118fe,null))[_0xd425('0xf')](handleError(_0x4118fe,null));};exports[_0xd425('0x3e')]=function(_0x7b1080,_0x1c80c2){return respondWithRpcPromise(_0xd425('0x3f'),_0x7b1080[_0xd425('0x17')])['then'](respondWithResult(_0x1c80c2,null))['catch'](handleError(_0x1c80c2,null));};exports['chatQueues']=function(_0x145e76,_0x2c5d01){return respondWithRpcPromise(_0xd425('0x40'),_0x145e76[_0xd425('0x17')],routingClient)['then'](respondWithResult(_0x2c5d01,null))['catch'](handleError(_0x2c5d01,null));};exports['showChatQueues']=function(_0x5e1294,_0x254b8b){return respondWithRpcPromise(_0xd425('0x40'),_0x5e1294['query'],routingClient)[_0xd425('0xa')](findById(_0x5e1294[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x254b8b,null))['catch'](handleError(_0x254b8b,null));};exports['mailQueues']=function(_0x599cb5,_0x49d75e){return respondWithRpcPromise('MailQueues',_0x599cb5['query'],routingClient)[_0xd425('0xa')](respondWithResult(_0x49d75e,null))[_0xd425('0xf')](handleError(_0x49d75e,null));};exports[_0xd425('0x41')]=function(_0x5b2323,_0x3395d8){return respondWithRpcPromise('MailQueues',_0x5b2323[_0xd425('0x17')],routingClient)[_0xd425('0xa')](findById(_0x5b2323[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x3395d8,null))[_0xd425('0xf')](handleError(_0x3395d8,null));};exports[_0xd425('0x42')]=function(_0xa21f7c,_0x3ca6a6){return respondWithRpcPromise(_0xd425('0x43'),_0xa21f7c['query'],mailClient)[_0xd425('0xa')](respondWithResult(_0x3ca6a6,null))[_0xd425('0xf')](handleError(_0x3ca6a6,null));};exports[_0xd425('0x44')]=function(_0xf22906,_0x5c4df8){return respondWithRpcPromise('OpenchannelQueues',_0xf22906[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x5c4df8,null))[_0xd425('0xf')](handleError(_0x5c4df8,null));};exports[_0xd425('0x45')]=function(_0x464ed1,_0x2e0f00){return respondWithRpcPromise(_0xd425('0x46'),_0x464ed1[_0xd425('0x17')],routingClient)[_0xd425('0xa')](findById(_0x464ed1[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x2e0f00,null))[_0xd425('0xf')](handleError(_0x2e0f00,null));};exports[_0xd425('0x47')]=function(_0x28979e,_0x5e72db){return respondWithRpcPromise(_0xd425('0x48'),_0x28979e[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x5e72db,null))['catch'](handleError(_0x5e72db,null));};exports['showSmsQueues']=function(_0x5ade1a,_0x403cb3){return respondWithRpcPromise(_0xd425('0x48'),_0x5ade1a[_0xd425('0x17')],routingClient)['then'](findById(_0x5ade1a[_0xd425('0x19')]['id']))['then'](respondWithResult(_0x403cb3,null))[_0xd425('0xf')](handleError(_0x403cb3,null));};exports[_0xd425('0x49')]=function(_0x21d26e,_0x5113fc){return respondWithRpcPromise(_0xd425('0x4a'),_0x21d26e[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x5113fc,null))[_0xd425('0xf')](handleError(_0x5113fc,null));};exports[_0xd425('0x4b')]=function(_0x43b1a9,_0x38a762){return respondWithRpcPromise(_0xd425('0x4a'),_0x43b1a9[_0xd425('0x17')],routingClient)[_0xd425('0xa')](findById(_0x43b1a9[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x38a762,null))[_0xd425('0xf')](handleError(_0x38a762,null));};exports[_0xd425('0x4c')]=function(_0x445f98,_0x443126){return respondWithRpcPromise(_0xd425('0x4d'),_0x445f98[_0xd425('0x17')],routingClient)['then'](respondWithResult(_0x443126,null))['catch'](handleError(_0x443126,null));};exports[_0xd425('0x4e')]=function(_0x5c333a,_0x135048){return respondWithRpcPromise(_0xd425('0x4d'),_0x5c333a[_0xd425('0x17')],routingClient)[_0xd425('0xa')](findById(_0x5c333a['params']['id']))[_0xd425('0xa')](respondWithResult(_0x135048,null))[_0xd425('0xf')](handleError(_0x135048,null));};exports[_0xd425('0x4f')]=function(_0x689332,_0x2536bd){return respondWithRpcPromise(_0xd425('0x50'),_0x689332['query'])['then'](respondWithResult(_0x2536bd,null))[_0xd425('0xf')](handleError(_0x2536bd,null));};exports[_0xd425('0x51')]=function(_0x5e76f5,_0x174081){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x5e76f5[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x174081,null))[_0xd425('0xf')](handleError(_0x174081,null));};exports[_0xd425('0x52')]=function(_0x376134,_0x2514fa){return respondWithRpcPromise(_0xd425('0x53'),_0x376134['query'],routingClient)[_0xd425('0xa')](respondWithResult(_0x2514fa,null))[_0xd425('0xf')](handleError(_0x2514fa,null));};exports[_0xd425('0x54')]=function(_0x233efa,_0xfcba08){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x233efa[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0xfcba08,null))['catch'](handleError(_0xfcba08,null));};exports[_0xd425('0x55')]=function(_0x4599b0,_0x48bed3){return respondWithRpcPromise(_0xd425('0x56'),_0x4599b0[_0xd425('0x17')],routingClient)[_0xd425('0xa')](function(_0xd923bb){if(_0x4599b0[_0xd425('0x17')]['type']!==undefined){var _0x454cce=_(_0xd923bb['rows'])[_0xd425('0x57')]([_0x4599b0[_0xd425('0x17')]['type'],_0x4599b0[_0xd425('0x19')]['id']])[_0xd425('0x58')](_0xd425('0x59'))[_0xd425('0x5a')]()['value']();return _0xd923bb['rows'][_0xd425('0x57')](function(_0x2312c1){return _0x454cce[_0xd425('0x5b')](_0x2312c1['queue_id'])>-0x1;});}else{return _0xd923bb[_0xd425('0x15')][_0xd425('0x57')](function(_0x5b932c){return _0x5b932c[_0xd425('0x59')]===parseInt(_0x4599b0['params']['id']);});}})[_0xd425('0xa')](respondWithResult(_0x48bed3,null))[_0xd425('0xf')](handleError(_0x48bed3,null));};exports[_0xd425('0x5c')]=function(_0x2493e7,_0x5750dc){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2493e7[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x5750dc,null))['catch'](handleError(_0x5750dc,null));};exports[_0xd425('0x5d')]=function(_0x389099,_0x51c9ad){return respondWithRpcPromise(_0xd425('0x5e'),_0x389099[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x51c9ad,null))[_0xd425('0xf')](handleError(_0x51c9ad,null));};exports[_0xd425('0x5f')]=function(_0xf251e6,_0x302066){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0xf251e6['query'],routingClient)[_0xd425('0xa')](respondWithResult(_0x302066,null))['catch'](handleError(_0x302066,null));};exports[_0xd425('0x60')]=function(_0x236030){return function(_0x58cad5,_0x244789){var _0x1c1c77,_0x5dac05;var _0x592c40=_[_0xd425('0x61')](_0x236030);var _0x242ed8=_0x236030===_0xd425('0x62')?_0xd425('0x63'):_0xd425('0x64');return db[_0x592c40+_0xd425('0x65')][_0xd425('0x66')]({'raw':!![],'where':{'id':_0x58cad5[_0xd425('0x19')]['id']}})['then'](function(_0x2cff42){if(_[_0xd425('0x14')](_0x2cff42)){throw new Error(_0x592c40+'\x20Queue\x20not\x20found');}_0x1c1c77=_0x2cff42;return db[_0x592c40+_0xd425('0x67')][_0xd425('0x66')]({'where':{'id':_0x58cad5[_0xd425('0x2d')][_0xd425('0x68')]},'include':[{'model':db[_0x592c40+_0xd425('0x69')],'as':_0xd425('0x69')},{'model':db[_0x592c40+_0x242ed8],'as':_0xd425('0x64')}]});})[_0xd425('0xa')](function(_0x334062){if(_[_0xd425('0x14')](_0x334062)){throw new Error(_0x592c40+_0xd425('0x6a'));}_0x5dac05=_0x334062;return _0x334062['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xd425('0xa')](function(){var _0x498e81={'uniqueid':_0x236030+'.'+_0x5dac05['id']+'.'+_0x5dac05['Interaction']['id'],'FromUserId':_0x58cad5[_0xd425('0x2f')]['id'],'type':'queue'};_0x498e81[_0x592c40+_0xd425('0x6b')]=_0x5dac05['id'];_0x498e81[_0x592c40+_0xd425('0x6c')]=_0x5dac05[_0xd425('0x69')]['id'];_0x498e81[_0xd425('0x6d')+_0x592c40+_0x242ed8+'Id']=_0x5dac05[_0xd425('0x64')]['id'];_0x498e81['To'+_0x592c40+_0xd425('0x6e')]=_0x1c1c77['id'];return db[_0x592c40+_0xd425('0x6f')]['create'](_0x498e81);})[_0xd425('0xa')](function(){return respondWithRpcPromise(_0xd425('0x70'),{'channel':_0x236030,'interaction':_0x5dac05[_0xd425('0x69')],'message':_0x5dac05,'account':_0x5dac05[_0xd425('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd425('0x71'),'appdata':_0x1c1c77['name']+','+(_0x5dac05[_0xd425('0x64')][_0xd425('0x72')]||0x12c),'interval':_0xd425('0x73')}]},routingClient);})[_0xd425('0xa')](respondWithResult(_0x244789,null))[_0xd425('0xf')](handleError(_0x244789,null));};};exports[_0xd425('0x74')]=function(_0x409612,_0x4147eb){var _0x433e5d,_0x334226;if(_[_0xd425('0x14')](_0x409612[_0xd425('0x2d')]['channel'])){throw new Error(_0xd425('0x75'));}var _0x5d8a47=_0x409612[_0xd425('0x2d')][_0xd425('0x76')];var _0x1c03d6=_[_0xd425('0x61')](_0x5d8a47);var _0xf06395=_0x5d8a47==='chat'?_0xd425('0x63'):_0xd425('0x64');return db[_0xd425('0x77')][_0xd425('0x66')]({'raw':!![],'where':{'id':_0x409612[_0xd425('0x19')]['id'],'role':_0xd425('0x38')}})[_0xd425('0xa')](function(_0x568a83){if(_[_0xd425('0x14')](_0x568a83)){throw new Error('Agent\x20not\x20found');}_0x433e5d=_0x568a83;return db[_0x1c03d6+_0xd425('0x67')][_0xd425('0x66')]({'where':{'id':_0x409612['body'][_0xd425('0x68')]},'include':[{'model':db[_0x1c03d6+_0xd425('0x69')],'as':'Interaction'},{'model':db[_0x1c03d6+_0xf06395],'as':_0xd425('0x64')}]});})[_0xd425('0xa')](function(_0xca2955){if(_[_0xd425('0x14')](_0xca2955)){throw new Error(_0x1c03d6+_0xd425('0x6a'));}_0x334226=_0xca2955;return _0xca2955[_0xd425('0x78')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x3f1a48={'uniqueid':_0x5d8a47+'.'+_0x334226['id']+'.'+_0x334226['Interaction']['id'],'FromUserId':_0x409612[_0xd425('0x2f')]['id'],'type':'queue','ToUserId':_0x433e5d['id']};_0x3f1a48[_0x1c03d6+_0xd425('0x6b')]=_0x334226['id'];_0x3f1a48[_0x1c03d6+_0xd425('0x6c')]=_0x334226[_0xd425('0x69')]['id'];_0x3f1a48[_0xd425('0x6d')+_0x1c03d6+_0xf06395+'Id']=_0x334226['Account']['id'];return db[_0x1c03d6+'TransferReport']['create'](_0x3f1a48);})['then'](function(){return respondWithRpcPromise(_0xd425('0x70'),{'channel':_0x5d8a47,'interaction':_0x334226['Interaction'],'message':_0x334226,'account':_0x334226[_0xd425('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd425('0x38'),'appdata':_0x433e5d[_0xd425('0x13')]+','+(_0x334226[_0xd425('0x64')][_0xd425('0x79')]||0x12c),'interval':_0xd425('0x73')}]},routingClient);})['then'](respondWithResult(_0x4147eb,null))[_0xd425('0xf')](handleError(_0x4147eb,null));}; \ No newline at end of file +var _0x5fc3=['openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','queue_id','uniq','value','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','Website','Account','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','chat','User','\x20Message\x20not\x20found','Start','agentTransferTimeout','bluebird','moment','util','../../mysqldb','../../config/logger','api','jayson/promise','http','client','request','then','error','code','message','result','catch','status','json','sendStatus','name','send','isNil','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','format','length','updateAttributes','MemberReport','findOrCreate','INTERACTION','interface','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions'];(function(_0x3f9d0a,_0x2d079c){var _0x2e5b31=function(_0x1b052d){while(--_0x1b052d){_0x3f9d0a['push'](_0x3f9d0a['shift']());}};_0x2e5b31(++_0x2d079c);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2eb3db,_0x4a32c0){_0x2eb3db=_0x2eb3db-0x0;var _0x358f33=_0x5fc3[_0x2eb3db];return _0x358f33;};'use strict';var BPromise=require(_0x35fc('0x0'));var moment=require(_0x35fc('0x1'));var _=require('lodash');var util=require(_0x35fc('0x2'));var db=require(_0x35fc('0x3'))['db'];var logger=require(_0x35fc('0x4'))(_0x35fc('0x5'));var jayson=require(_0x35fc('0x6'));var amiClient=jayson['client'][_0x35fc('0x7')]({'port':0x232a});var mailClient=jayson[_0x35fc('0x8')][_0x35fc('0x7')]({'port':0x232b});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){var _0x1e5f90=_0x16e153?_0x16e153:amiClient;return _0x1e5f90[_0x35fc('0x9')](_0x19a0d1,_0x508b32)[_0x35fc('0xa')](function(_0x2051ab){if(_0x2051ab['error']){if(_0x2051ab[_0x35fc('0xb')][_0x35fc('0xc')]===0x1f4){return _0xc72d93(_0x2051ab['error'][_0x35fc('0xd')]);}return _0x27524f(_0x2051ab[_0x35fc('0xb')]['message']);}else{_0x27524f(_0x2051ab[_0x35fc('0xe')]);}})[_0x35fc('0xf')](function(_0x5469f5){_0xc72d93(_0x5469f5);});});}function respondWithResult(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xc8;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x10')](_0x409357)[_0x35fc('0x11')](_0x5d462a);}return _0x4cbe74[_0x35fc('0x12')](0x194);};}function handleError(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0x1f4;return function(_0x5cfe94){logger['error'](_0x5cfe94['stack']);if(_0x5cfe94['name']){delete _0x5cfe94[_0x35fc('0x13')];}_0x29730f[_0x35fc('0x10')](_0x38d9f2)[_0x35fc('0x14')](_0x5cfe94);};}function findById(_0x154958){return function(_0x227a49){if(!_[_0x35fc('0x15')](_0x154958)&&!_['isNil'](_0x227a49)&&!_[_0x35fc('0x15')](_0x227a49[_0x35fc('0x16')])){return _['find'](_0x227a49[_0x35fc('0x16')],function(_0x363e47){return _0x363e47['id']==_0x154958;});}return null;};}exports[_0x35fc('0x17')]=function(_0x5f56c6,_0x1a86e9){return respondWithRpcPromise(_0x35fc('0x18'),_0x5f56c6[_0x35fc('0x19')])['then'](respondWithResult(_0x1a86e9,null))[_0x35fc('0xf')](handleError(_0x1a86e9,null));};exports[_0x35fc('0x1a')]=function(_0x3229d1,_0x251a1f){return respondWithRpcPromise(_0x35fc('0x1b'),_[_0x35fc('0x1c')](_0x3229d1[_0x35fc('0x19')],_0x3229d1[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x251a1f,null))[_0x35fc('0xf')](handleError(_0x251a1f,null));};exports['voiceChannelStopMixMonitor']=function(_0x323aee,_0xd5399f){return respondWithRpcPromise(_0x35fc('0x1e'),_[_0x35fc('0x1c')](_0x323aee[_0x35fc('0x19')],_0x323aee['params']))[_0x35fc('0xa')](respondWithResult(_0xd5399f,null))[_0x35fc('0xf')](handleError(_0xd5399f,null));};exports['voiceQueues']=function(_0x265324,_0x5a93df){return respondWithRpcPromise(_0x35fc('0x1f'),_0x265324['query'])[_0x35fc('0xa')](respondWithResult(_0x5a93df,null))['catch'](handleError(_0x5a93df,null));};exports[_0x35fc('0x20')]=function(_0xdfab9f,_0x5cb986){return respondWithRpcPromise('VoiceQueues',_0xdfab9f[_0x35fc('0x19')])['then'](findById(_0xdfab9f[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x5cb986,null))['catch'](handleError(_0x5cb986,null));};exports[_0x35fc('0x21')]=function(_0x645eac,_0x383837){return respondWithRpcPromise(_0x35fc('0x22'),_[_0x35fc('0x1c')](_0x645eac[_0x35fc('0x23')],_0x645eac[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x383837,null))['catch'](handleError(_0x383837,null));};exports[_0x35fc('0x24')]=function(_0x220931,_0x22af18){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x35fc('0x1c')](_0x220931[_0x35fc('0x19')],_0x220931[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x22af18,null))[_0x35fc('0xf')](handleError(_0x22af18,null));};exports[_0x35fc('0x25')]=function(_0x222ddb,_0x37b435){return respondWithRpcPromise(_0x35fc('0x26'),_0x222ddb[_0x35fc('0x19')])['then'](respondWithResult(_0x37b435,null))['catch'](handleError(_0x37b435,null));};exports[_0x35fc('0x27')]=function(_0x4af5fe,_0x37b394){return respondWithRpcPromise(_0x35fc('0x28'),_[_0x35fc('0x1c')](_0x4af5fe[_0x35fc('0x19')],_0x4af5fe[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x37b394,null))['catch'](handleError(_0x37b394,null));};exports[_0x35fc('0x29')]=function(_0x330a14,_0x46b9ef){return respondWithRpcPromise(_0x35fc('0x2a'),_[_0x35fc('0x1c')](_0x330a14[_0x35fc('0x19')],_0x330a14['params']))[_0x35fc('0xa')](respondWithResult(_0x46b9ef,null))[_0x35fc('0xf')](handleError(_0x46b9ef,null));};exports[_0x35fc('0x2b')]=function(_0x52f53d,_0x2c657d){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x35fc('0x1c')](_0x52f53d[_0x35fc('0x19')],_0x52f53d[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x2c657d,null))['catch'](handleError(_0x2c657d,null));};exports['outbound']=function(_0x59e4fb,_0x20f5fe){return respondWithRpcPromise('Outbound',_0x59e4fb[_0x35fc('0x19')])['then'](respondWithResult(_0x20f5fe,null))[_0x35fc('0xf')](handleError(_0x20f5fe,null));};exports[_0x35fc('0x2c')]=function(_0x2ca9ac,_0x22b724){return respondWithRpcPromise(_0x35fc('0x2d'),_0x2ca9ac[_0x35fc('0x19')])[_0x35fc('0xa')](respondWithResult(_0x22b724,null))['catch'](handleError(_0x22b724,null));};exports[_0x35fc('0x2e')]=function(_0x16087d,_0x4e0ce3){var _0x1feda5;return respondWithRpcPromise(_0x35fc('0x2f'),_0x16087d[_0x35fc('0x19')])[_0x35fc('0xa')](function(_0x813866){_0x1feda5=_0x813866;return respondWithRpcPromise(_0x35fc('0x2f'),_0x16087d['query'],routingClient);})[_0x35fc('0xa')](function(_0x267858){return _[_0x35fc('0x1c')]({},_0x267858,_0x1feda5);})['then'](respondWithResult(_0x4e0ce3,null))[_0x35fc('0xf')](handleError(_0x4e0ce3,null));};exports[_0x35fc('0x30')]=function(_0x596919,_0x237548){if(_0x596919[_0x35fc('0x23')]&&_0x596919[_0x35fc('0x23')][_0x35fc('0x31')]&&_0x596919[_0x35fc('0x32')]&&_0x596919[_0x35fc('0x32')][_0x35fc('0x13')]){for(var _0x3ec51f in _0x596919['body']['interaction']){if(_0x596919[_0x35fc('0x23')][_0x35fc('0x31')]['hasOwnProperty'](_0x3ec51f)){db['MemberReport']['findAll']({'where':{'channel':_0x3ec51f,'membername':_0x596919[_0x35fc('0x32')][_0x35fc('0x13')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f]&&_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f]['length']?{'$notIn':_0x596919['body']['interaction'][_0x3ec51f]}:{'$ne':null}}})['then'](function(_0x56bdb9){var _0xb26e3f=moment()[_0x35fc('0x33')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x119925=0x0,_0x56cf1f=_0x56bdb9[_0x35fc('0x34')];_0x119925<_0x56cf1f;_0x119925+=0x1){_0x56bdb9[_0x119925][_0x35fc('0x35')]({'exitAt':_0xb26e3f});}});for(var _0x350237=0x0;_0x350237<_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f]['length'];_0x350237+=0x1){db[_0x35fc('0x36')][_0x35fc('0x37')]({'where':{'channel':_0x3ec51f,'membername':_0x596919['user'][_0x35fc('0x13')],'type':_0x35fc('0x38'),'uniqueid':_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f][_0x350237],'exitAt':null},'defaults':{'channel':_0x3ec51f,'membername':_0x596919['user'][_0x35fc('0x13')],'interface':_['isNil'](_0x596919['user'][_0x35fc('0x39')])?util[_0x35fc('0x33')](_0x35fc('0x3a'),_0x596919[_0x35fc('0x32')][_0x35fc('0x13')]):_0x596919[_0x35fc('0x32')][_0x35fc('0x39')],'type':_0x35fc('0x38'),'enterAt':moment()['format'](_0x35fc('0x3b')),'role':_0x35fc('0x3c'),'internal':_0x596919[_0x35fc('0x32')][_0x35fc('0x3d')],'uniqueid':_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f][_0x350237]}});}}}}return respondWithRpcPromise(_0x35fc('0x3e'),{'id':_0x596919[_0x35fc('0x1d')]['id'],'capacity':_0x596919[_0x35fc('0x23')][_0x35fc('0x3f')]},routingClient)[_0x35fc('0xa')](respondWithResult(_0x237548,null))[_0x35fc('0xf')](handleError(_0x237548,null));};exports[_0x35fc('0x40')]=function(_0x3146e2,_0x59c666){return respondWithRpcPromise('Telephones',_0x3146e2[_0x35fc('0x19')])[_0x35fc('0xa')](respondWithResult(_0x59c666,null))[_0x35fc('0xf')](handleError(_0x59c666,null));};exports[_0x35fc('0x41')]=function(_0x3ee296,_0x3e6494){return respondWithRpcPromise('Trunks',_0x3ee296['query'])[_0x35fc('0xa')](respondWithResult(_0x3e6494,null))[_0x35fc('0xf')](handleError(_0x3e6494,null));};exports[_0x35fc('0x42')]=function(_0x38bc78,_0x5b2595){return respondWithRpcPromise(_0x35fc('0x43'),_0x38bc78[_0x35fc('0x19')])['then'](respondWithResult(_0x5b2595,null))[_0x35fc('0xf')](handleError(_0x5b2595,null));};exports[_0x35fc('0x44')]=function(_0x590faa,_0x3e12e4){return respondWithRpcPromise(_0x35fc('0x45'),_0x590faa[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x3e12e4,null))['catch'](handleError(_0x3e12e4,null));};exports['showChatQueues']=function(_0x502a15,_0x240338){return respondWithRpcPromise(_0x35fc('0x45'),_0x502a15['query'],routingClient)[_0x35fc('0xa')](findById(_0x502a15[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x240338,null))[_0x35fc('0xf')](handleError(_0x240338,null));};exports[_0x35fc('0x46')]=function(_0x538be0,_0x2d9d45){return respondWithRpcPromise(_0x35fc('0x47'),_0x538be0[_0x35fc('0x19')],routingClient)['then'](respondWithResult(_0x2d9d45,null))[_0x35fc('0xf')](handleError(_0x2d9d45,null));};exports[_0x35fc('0x48')]=function(_0x47fb1a,_0x35a676){return respondWithRpcPromise(_0x35fc('0x47'),_0x47fb1a[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](findById(_0x47fb1a[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x35a676,null))[_0x35fc('0xf')](handleError(_0x35a676,null));};exports[_0x35fc('0x49')]=function(_0x53a79d,_0x10a5b8){return respondWithRpcPromise(_0x35fc('0x4a'),_0x53a79d[_0x35fc('0x19')],mailClient)['then'](respondWithResult(_0x10a5b8,null))[_0x35fc('0xf')](handleError(_0x10a5b8,null));};exports['openchannelQueues']=function(_0x4ceacc,_0x5d4a39){return respondWithRpcPromise(_0x35fc('0x4b'),_0x4ceacc[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x5d4a39,null))[_0x35fc('0xf')](handleError(_0x5d4a39,null));};exports[_0x35fc('0x4c')]=function(_0x4bbea0,_0x579f5a){return respondWithRpcPromise('OpenchannelQueues',_0x4bbea0['query'],routingClient)['then'](findById(_0x4bbea0[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x579f5a,null))[_0x35fc('0xf')](handleError(_0x579f5a,null));};exports[_0x35fc('0x4d')]=function(_0x511e8b,_0x458eb8){return respondWithRpcPromise(_0x35fc('0x4e'),_0x511e8b[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x458eb8,null))[_0x35fc('0xf')](handleError(_0x458eb8,null));};exports[_0x35fc('0x4f')]=function(_0x27071b,_0x2127e0){return respondWithRpcPromise(_0x35fc('0x4e'),_0x27071b['query'],routingClient)[_0x35fc('0xa')](findById(_0x27071b['params']['id']))[_0x35fc('0xa')](respondWithResult(_0x2127e0,null))[_0x35fc('0xf')](handleError(_0x2127e0,null));};exports[_0x35fc('0x50')]=function(_0x2bc76c,_0x4bdde7){return respondWithRpcPromise(_0x35fc('0x51'),_0x2bc76c['query'],routingClient)['then'](respondWithResult(_0x4bdde7,null))['catch'](handleError(_0x4bdde7,null));};exports[_0x35fc('0x52')]=function(_0x5dfeb7,_0x3c9027){return respondWithRpcPromise('WhatsappQueues',_0x5dfeb7[_0x35fc('0x19')],routingClient)['then'](findById(_0x5dfeb7[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x3c9027,null))[_0x35fc('0xf')](handleError(_0x3c9027,null));};exports[_0x35fc('0x53')]=function(_0x5c2ec0,_0x3d0ecc){return respondWithRpcPromise(_0x35fc('0x54'),_0x5c2ec0[_0x35fc('0x19')],routingClient)['then'](respondWithResult(_0x3d0ecc,null))[_0x35fc('0xf')](handleError(_0x3d0ecc,null));};exports[_0x35fc('0x55')]=function(_0x37764b,_0x3c1b56){return respondWithRpcPromise(_0x35fc('0x54'),_0x37764b[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](findById(_0x37764b[_0x35fc('0x1d')]['id']))['then'](respondWithResult(_0x3c1b56,null))[_0x35fc('0xf')](handleError(_0x3c1b56,null));};exports[_0x35fc('0x56')]=function(_0x2600d2,_0x4a926d){return respondWithRpcPromise(_0x35fc('0x57'),_0x2600d2[_0x35fc('0x19')])['then'](respondWithResult(_0x4a926d,null))['catch'](handleError(_0x4a926d,null));};exports[_0x35fc('0x58')]=function(_0x4835c2,_0x223ad3){return respondWithRpcPromise(_0x35fc('0x59'),_0x4835c2[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x223ad3,null))[_0x35fc('0xf')](handleError(_0x223ad3,null));};exports[_0x35fc('0x5a')]=function(_0x13f602,_0x104b1d){return respondWithRpcPromise(_0x35fc('0x5b'),_0x13f602[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x104b1d,null))[_0x35fc('0xf')](handleError(_0x104b1d,null));};exports[_0x35fc('0x5c')]=function(_0x9f034e,_0x184f28){return respondWithRpcPromise(_0x35fc('0x5d'),_0x9f034e[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x184f28,null))[_0x35fc('0xf')](handleError(_0x184f28,null));};exports[_0x35fc('0x5e')]=function(_0x4ba1b0,_0x1797d0){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x4ba1b0[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](function(_0x2185ce){if(_0x4ba1b0[_0x35fc('0x19')][_0x35fc('0x5f')]!==undefined){var _0x3f56f4=_(_0x2185ce[_0x35fc('0x16')])[_0x35fc('0x60')]([_0x4ba1b0[_0x35fc('0x19')][_0x35fc('0x5f')],_0x4ba1b0[_0x35fc('0x1d')]['id']])['map'](_0x35fc('0x61'))[_0x35fc('0x62')]()[_0x35fc('0x63')]();return _0x2185ce[_0x35fc('0x16')][_0x35fc('0x60')](function(_0x41a6de){return _0x3f56f4['indexOf'](_0x41a6de[_0x35fc('0x61')])>-0x1;});}else{return _0x2185ce[_0x35fc('0x16')][_0x35fc('0x60')](function(_0x23206d){return _0x23206d[_0x35fc('0x61')]===parseInt(_0x4ba1b0[_0x35fc('0x1d')]['id']);});}})[_0x35fc('0xa')](respondWithResult(_0x1797d0,null))[_0x35fc('0xf')](handleError(_0x1797d0,null));};exports[_0x35fc('0x64')]=function(_0x5f23d8,_0x28f02b){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x5f23d8[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x28f02b,null))['catch'](handleError(_0x28f02b,null));};exports[_0x35fc('0x65')]=function(_0x41002a,_0xcaa49){return respondWithRpcPromise(_0x35fc('0x66'),_0x41002a[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0xcaa49,null))[_0x35fc('0xf')](handleError(_0xcaa49,null));};exports[_0x35fc('0x67')]=function(_0x25ee61,_0x5806bf){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x25ee61['query'],routingClient)['then'](respondWithResult(_0x5806bf,null))[_0x35fc('0xf')](handleError(_0x5806bf,null));};exports[_0x35fc('0x68')]=function(_0x8fc410){return function(_0x1f5cbc,_0x35ef53){var _0x4f535a,_0x226fdf;var _0x19682e=_[_0x35fc('0x69')](_0x8fc410);var _0x169ea2=_0x8fc410==='chat'?_0x35fc('0x6a'):_0x35fc('0x6b');return db[_0x19682e+_0x35fc('0x6c')]['findOne']({'raw':!![],'where':{'id':_0x1f5cbc[_0x35fc('0x1d')]['id']}})[_0x35fc('0xa')](function(_0x319033){if(_[_0x35fc('0x15')](_0x319033)){throw new Error(_0x19682e+_0x35fc('0x6d'));}_0x4f535a=_0x319033;return db[_0x19682e+_0x35fc('0x6e')][_0x35fc('0x6f')]({'where':{'id':_0x1f5cbc[_0x35fc('0x23')]['messageId']},'include':[{'model':db[_0x19682e+_0x35fc('0x70')],'as':_0x35fc('0x70')},{'model':db[_0x19682e+_0x169ea2],'as':_0x35fc('0x6b')}]});})[_0x35fc('0xa')](function(_0x221c5b){if(_[_0x35fc('0x15')](_0x221c5b)){throw new Error(_0x19682e+'\x20Message\x20not\x20found');}_0x226fdf=_0x221c5b;return _0x221c5b[_0x35fc('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x4855ee={'uniqueid':_0x8fc410+'.'+_0x226fdf['id']+'.'+_0x226fdf[_0x35fc('0x70')]['id'],'FromUserId':_0x1f5cbc['user']['id'],'type':_0x35fc('0x72')};_0x4855ee[_0x19682e+_0x35fc('0x73')]=_0x226fdf['id'];_0x4855ee[_0x19682e+_0x35fc('0x74')]=_0x226fdf['Interaction']['id'];_0x4855ee[_0x35fc('0x75')+_0x19682e+_0x169ea2+'Id']=_0x226fdf[_0x35fc('0x6b')]['id'];_0x4855ee['To'+_0x19682e+_0x35fc('0x76')]=_0x4f535a['id'];return db[_0x19682e+_0x35fc('0x77')][_0x35fc('0x78')](_0x4855ee);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x8fc410,'interaction':_0x226fdf['Interaction'],'message':_0x226fdf,'account':_0x226fdf[_0x35fc('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x4f535a[_0x35fc('0x13')]+','+(_0x226fdf[_0x35fc('0x6b')][_0x35fc('0x79')]||0x12c),'interval':_0x35fc('0x7a')}]},routingClient);})['then'](respondWithResult(_0x35ef53,null))[_0x35fc('0xf')](handleError(_0x35ef53,null));};};exports[_0x35fc('0x7b')]=function(_0x312827,_0x47c507){var _0x128286,_0x175cc7;if(_[_0x35fc('0x15')](_0x312827['body']['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x32b9e1=_0x312827[_0x35fc('0x23')][_0x35fc('0x7c')];var _0x3858a9=_['capitalize'](_0x32b9e1);var _0x3ead4e=_0x32b9e1===_0x35fc('0x7d')?'Website':'Account';return db[_0x35fc('0x7e')][_0x35fc('0x6f')]({'raw':!![],'where':{'id':_0x312827[_0x35fc('0x1d')]['id'],'role':'agent'}})['then'](function(_0x134e60){if(_[_0x35fc('0x15')](_0x134e60)){throw new Error('Agent\x20not\x20found');}_0x128286=_0x134e60;return db[_0x3858a9+_0x35fc('0x6e')][_0x35fc('0x6f')]({'where':{'id':_0x312827[_0x35fc('0x23')]['messageId']},'include':[{'model':db[_0x3858a9+_0x35fc('0x70')],'as':_0x35fc('0x70')},{'model':db[_0x3858a9+_0x3ead4e],'as':_0x35fc('0x6b')}]});})[_0x35fc('0xa')](function(_0x4fd676){if(_[_0x35fc('0x15')](_0x4fd676)){throw new Error(_0x3858a9+_0x35fc('0x7f'));}_0x175cc7=_0x4fd676;return _0x4fd676[_0x35fc('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x96dfc={'uniqueid':_0x32b9e1+'.'+_0x175cc7['id']+'.'+_0x175cc7[_0x35fc('0x70')]['id'],'FromUserId':_0x312827[_0x35fc('0x32')]['id'],'type':'queue','ToUserId':_0x128286['id']};_0x96dfc[_0x3858a9+_0x35fc('0x73')]=_0x175cc7['id'];_0x96dfc[_0x3858a9+_0x35fc('0x74')]=_0x175cc7['Interaction']['id'];_0x96dfc[_0x35fc('0x75')+_0x3858a9+_0x3ead4e+'Id']=_0x175cc7[_0x35fc('0x6b')]['id'];return db[_0x3858a9+_0x35fc('0x77')][_0x35fc('0x78')](_0x96dfc);})[_0x35fc('0xa')](function(){return respondWithRpcPromise(_0x35fc('0x80'),{'channel':_0x32b9e1,'interaction':_0x175cc7[_0x35fc('0x70')],'message':_0x175cc7,'account':_0x175cc7[_0x35fc('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x35fc('0x3c'),'appdata':_0x128286['name']+','+(_0x175cc7[_0x35fc('0x6b')][_0x35fc('0x81')]||0x12c),'interval':_0x35fc('0x7a')}]},routingClient);})[_0x35fc('0xa')](respondWithResult(_0x47c507,null))['catch'](handleError(_0x47c507,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 992d290..126e286 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 _0x2ba0=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./schedule.controller','get','index','/:id','isAuthenticated','show','/:id/run','post','create','put','update','destroy','exports','multer','util','path'];(function(_0x522278,_0x3ddfbd){var _0x3253dc=function(_0x4bdfda){while(--_0x4bdfda){_0x522278['push'](_0x522278['shift']());}};_0x3253dc(++_0x3ddfbd);}(_0x2ba0,0x7b));var _0x02ba=function(_0x23397a,_0x3e3d3a){_0x23397a=_0x23397a-0x0;var _0x523b59=_0x2ba0[_0x23397a];return _0x523b59;};'use strict';var multer=require(_0x02ba('0x0'));var util=require(_0x02ba('0x1'));var path=require(_0x02ba('0x2'));var timeout=require(_0x02ba('0x3'));var express=require(_0x02ba('0x4'));var router=express[_0x02ba('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x02ba('0x6'));var config=require(_0x02ba('0x7'));var controller=require(_0x02ba('0x8'));router[_0x02ba('0x9')]('/',auth['isAuthenticated'](),controller[_0x02ba('0xa')]);router[_0x02ba('0x9')](_0x02ba('0xb'),auth[_0x02ba('0xc')](),controller[_0x02ba('0xd')]);router[_0x02ba('0x9')](_0x02ba('0xe'),auth[_0x02ba('0xc')](),controller['run']);router[_0x02ba('0xf')]('/',auth[_0x02ba('0xc')](),controller[_0x02ba('0x10')]);router[_0x02ba('0x11')](_0x02ba('0xb'),auth['isAuthenticated'](),controller[_0x02ba('0x12')]);router['delete'](_0x02ba('0xb'),auth[_0x02ba('0xc')](),controller[_0x02ba('0x13')]);module[_0x02ba('0x14')]=router; \ No newline at end of file +var _0xc8e2=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer'];(function(_0x2d7ed7,_0x27d3e1){var _0x13f48f=function(_0x1b07b1){while(--_0x1b07b1){_0x2d7ed7['push'](_0x2d7ed7['shift']());}};_0x13f48f(++_0x27d3e1);}(_0xc8e2,0x71));var _0x2c8e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc8e2[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x2c8e('0x0'));var util=require('util');var path=require(_0x2c8e('0x1'));var timeout=require(_0x2c8e('0x2'));var express=require('express');var router=express[_0x2c8e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2c8e('0x4'));var interaction=require(_0x2c8e('0x5'));var config=require(_0x2c8e('0x6'));var controller=require(_0x2c8e('0x7'));router[_0x2c8e('0x8')]('/',auth[_0x2c8e('0x9')](),controller[_0x2c8e('0xa')]);router[_0x2c8e('0x8')](_0x2c8e('0xb'),auth['isAuthenticated'](),controller[_0x2c8e('0xc')]);router[_0x2c8e('0x8')]('/:id/run',auth[_0x2c8e('0x9')](),controller['run']);router[_0x2c8e('0xd')]('/',auth[_0x2c8e('0x9')](),controller[_0x2c8e('0xe')]);router[_0x2c8e('0xf')](_0x2c8e('0xb'),auth[_0x2c8e('0x9')](),controller[_0x2c8e('0x10')]);router[_0x2c8e('0x11')](_0x2c8e('0xb'),auth[_0x2c8e('0x9')](),controller['destroy']);module[_0x2c8e('0x12')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 125bd09..f796bff 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 _0xaba0=['INTEGER','ENUM','years','quarters','months','weeks','days','csv','pdf','xlsx','custom','BOOLEAN','TEXT','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE'];(function(_0xc0bc67,_0x27d55){var _0x315957=function(_0x46ba9f){while(--_0x46ba9f){_0xc0bc67['push'](_0xc0bc67['shift']());}};_0x315957(++_0x27d55);}(_0xaba0,0xd3));var _0x0aba=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xaba0[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x0aba('0x0'));module[_0x0aba('0x1')]={'name':{'type':Sequelize[_0x0aba('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x0aba('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x0aba('0x2')],'allowNull':![],'defaultValue':_0x0aba('0x3')},'startAt':{'type':Sequelize[_0x0aba('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x0aba('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x0aba('0x6')](_0x0aba('0x7'),_0x0aba('0x8'),_0x0aba('0x9'),_0x0aba('0xa'),_0x0aba('0xb'),'hours','minutes'),'allowNull':![],'defaultValue':_0x0aba('0xb')},'output':{'type':Sequelize['ENUM'](_0x0aba('0xc'),_0x0aba('0xd'),_0x0aba('0xe')),'allowNull':![],'defaultValue':_0x0aba('0xc')},'type':{'type':Sequelize[_0x0aba('0x6')](_0x0aba('0xf'),'default'),'allowNull':![],'defaultValue':_0x0aba('0xf')},'sendMail':{'type':Sequelize[_0x0aba('0x10')],'defaultValue':![]},'email':{'type':Sequelize[_0x0aba('0x2')]},'cc':{'type':Sequelize[_0x0aba('0x11')]},'bcc':{'type':Sequelize[_0x0aba('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x0aba('0x10')],'defaultValue':!![]}}; \ No newline at end of file +var _0xdb7c=['STRING','BOOLEAN','DATE','ENUM','years','months','hours','minutes','days','csv','pdf','xlsx','custom','default','TEXT','sequelize','exports'];(function(_0x36ed46,_0x3a764c){var _0x1d06c9=function(_0x318ee4){while(--_0x318ee4){_0x36ed46['push'](_0x36ed46['shift']());}};_0x1d06c9(++_0x3a764c);}(_0xdb7c,0x163));var _0xcdb7=function(_0x32f9ca,_0x2fa8bc){_0x32f9ca=_0x32f9ca-0x0;var _0x52e083=_0xdb7c[_0x32f9ca];return _0x52e083;};'use strict';var Sequelize=require(_0xcdb7('0x0'));module[_0xcdb7('0x1')]={'name':{'type':Sequelize[_0xcdb7('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xcdb7('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xcdb7('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xcdb7('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xcdb7('0x5')](_0xcdb7('0x6'),'quarters',_0xcdb7('0x7'),'weeks','days',_0xcdb7('0x8'),_0xcdb7('0x9')),'allowNull':![],'defaultValue':_0xcdb7('0xa')},'output':{'type':Sequelize[_0xcdb7('0x5')](_0xcdb7('0xb'),_0xcdb7('0xc'),_0xcdb7('0xd')),'allowNull':![],'defaultValue':_0xcdb7('0xb')},'type':{'type':Sequelize[_0xcdb7('0x5')](_0xcdb7('0xe'),_0xcdb7('0xf')),'allowNull':![],'defaultValue':_0xcdb7('0xe')},'sendMail':{'type':Sequelize[_0xcdb7('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xcdb7('0x10')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 79f75ef..182d54c 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 _0xe641=['UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','util','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','end','error','stack','name','send','map','Schedule','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','rows','catch','show','params','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','UserProfileSection','find','userProfileId','autoAssociation'];(function(_0x2cd831,_0x335b79){var _0x6e5f05=function(_0x45dace){while(--_0x45dace){_0x2cd831['push'](_0x2cd831['shift']());}};_0x6e5f05(++_0x335b79);}(_0xe641,0xb0));var _0x1e64=function(_0x24ddaf,_0x3b81b5){_0x24ddaf=_0x24ddaf-0x0;var _0x19d849=_0xe641[_0x24ddaf];return _0x19d849;};'use strict';var emlformat=require(_0x1e64('0x0'));var rimraf=require(_0x1e64('0x1'));var zipdir=require(_0x1e64('0x2'));var jsonpatch=require(_0x1e64('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1e64('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1e64('0x5'));var fs=require('fs');var fs_extra=require(_0x1e64('0x6'));var _=require('lodash');var squel=require(_0x1e64('0x7'));var crypto=require(_0x1e64('0x8'));var jsforce=require(_0x1e64('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x1e64('0xa'));var querystring=require(_0x1e64('0xb'));var Papa=require(_0x1e64('0xc'));var Redis=require(_0x1e64('0xd'));var authService=require(_0x1e64('0xe'));var qs=require(_0x1e64('0xf'));var as=require(_0x1e64('0x10'));var hardwareService=require(_0x1e64('0x11'));var logger=require(_0x1e64('0x12'))(_0x1e64('0x13'));var utils=require(_0x1e64('0x14'));var config=require(_0x1e64('0x15'));var licenseUtil=require(_0x1e64('0x16'));var db=require(_0x1e64('0x17'))['db'];function respondWithStatusCode(_0x13136b,_0x72fa93){_0x72fa93=_0x72fa93||0xcc;return function(_0x582217){if(_0x582217){return _0x13136b[_0x1e64('0x18')](_0x72fa93);}return _0x13136b[_0x1e64('0x19')](_0x72fa93)['end']();};}function respondWithResult(_0x1e9014,_0x15f26e){_0x15f26e=_0x15f26e||0xc8;return function(_0x206d13){if(_0x206d13){return _0x1e9014[_0x1e64('0x19')](_0x15f26e)[_0x1e64('0x1a')](_0x206d13);}};}function respondWithFilteredResult(_0x230a5b,_0x831b94){return function(_0x18d03d){if(_0x18d03d){var _0x24d5f1=typeof _0x831b94['offset']===_0x1e64('0x1b')&&typeof _0x831b94['limit']==='undefined';var _0x29d0ce=_0x18d03d[_0x1e64('0x1c')];var _0x24ab8e=_0x24d5f1?0x0:_0x831b94[_0x1e64('0x1d')];var _0xd19476=_0x24d5f1?_0x18d03d[_0x1e64('0x1c')]:_0x831b94[_0x1e64('0x1d')]+_0x831b94['limit'];var _0x32c9b6;if(_0xd19476>=_0x29d0ce){_0xd19476=_0x29d0ce;_0x32c9b6=0xc8;}else{_0x32c9b6=0xce;}_0x230a5b['status'](_0x32c9b6);return _0x230a5b[_0x1e64('0x1e')](_0x1e64('0x1f'),_0x24ab8e+'-'+_0xd19476+'/'+_0x29d0ce)['json'](_0x18d03d);}return null;};}function patchUpdates(_0x3a996a){return function(_0x3c674e){try{jsonpatch[_0x1e64('0x20')](_0x3c674e,_0x3a996a,!![]);}catch(_0x119315){return BPromise[_0x1e64('0x21')](_0x119315);}return _0x3c674e['save']();};}function saveUpdates(_0xb705cf,_0x3b3d49){return function(_0x4d342b){if(_0x4d342b){return _0x4d342b[_0x1e64('0x22')](_0xb705cf)[_0x1e64('0x23')](function(_0x42bc02){return _0x42bc02;});}return null;};}function removeEntity(_0x1b24f6,_0x9407e1){return function(_0x55ee30){if(_0x55ee30){return _0x55ee30[_0x1e64('0x24')]()[_0x1e64('0x23')](function(){var _0x3ee6a2=_0x55ee30[_0x1e64('0x25')]({'plain':!![]});var _0x493401='Scheduler';return db['UserProfileResource']['destroy']({'where':{'type':_0x493401,'resourceId':_0x3ee6a2['id']}})[_0x1e64('0x23')](function(){return _0x55ee30;});})[_0x1e64('0x23')](function(){_0x1b24f6['status'](0xcc)[_0x1e64('0x26')]();});}};}function handleEntityNotFound(_0x567b99,_0x4a54c5){return function(_0x5830a1){if(!_0x5830a1){_0x567b99['sendStatus'](0x194);}return _0x5830a1;};}function handleError(_0x585e92,_0x26213b){_0x26213b=_0x26213b||0x1f4;return function(_0x2bd805){logger[_0x1e64('0x27')](_0x2bd805[_0x1e64('0x28')]);if(_0x2bd805[_0x1e64('0x29')]){delete _0x2bd805['name'];}_0x585e92['status'](_0x26213b)[_0x1e64('0x2a')](_0x2bd805);};}exports['index']=function(_0x2b01cf,_0x35f94b){var _0x1b3474={},_0xbdccbb={},_0x263ea0={'count':0x0,'rows':[]};var _0x5c7eab=_[_0x1e64('0x2b')](db[_0x1e64('0x2c')][_0x1e64('0x2d')],function(_0x16c20d){return{'name':_0x16c20d[_0x1e64('0x2e')],'type':_0x16c20d[_0x1e64('0x2f')][_0x1e64('0x30')]};});_0xbdccbb[_0x1e64('0x31')]=_['map'](_0x5c7eab,_0x1e64('0x29'));_0xbdccbb['query']=_[_0x1e64('0x32')](_0x2b01cf[_0x1e64('0x33')]);_0xbdccbb[_0x1e64('0x34')]=_[_0x1e64('0x35')](_0xbdccbb[_0x1e64('0x31')],_0xbdccbb[_0x1e64('0x33')]);_0x1b3474[_0x1e64('0x36')]=_[_0x1e64('0x35')](_0xbdccbb['model'],qs[_0x1e64('0x37')](_0x2b01cf[_0x1e64('0x33')][_0x1e64('0x37')]));_0x1b3474[_0x1e64('0x36')]=_0x1b3474[_0x1e64('0x36')][_0x1e64('0x38')]?_0x1b3474[_0x1e64('0x36')]:_0xbdccbb['model'];if(!_0x2b01cf[_0x1e64('0x33')][_0x1e64('0x39')](_0x1e64('0x3a'))){_0x1b3474[_0x1e64('0x3b')]=qs[_0x1e64('0x3b')](_0x2b01cf[_0x1e64('0x33')]['limit']);_0x1b3474['offset']=qs[_0x1e64('0x1d')](_0x2b01cf['query']['offset']);}_0x1b3474[_0x1e64('0x3c')]=qs[_0x1e64('0x3d')](_0x2b01cf['query']['sort']);_0x1b3474[_0x1e64('0x3e')]=qs['filters'](_[_0x1e64('0x3f')](_0x2b01cf['query'],_0xbdccbb[_0x1e64('0x34')]),_0x5c7eab);if(_0x2b01cf[_0x1e64('0x33')]['filter']){_0x1b3474['where']=_[_0x1e64('0x40')](_0x1b3474[_0x1e64('0x3e')],{'$or':_[_0x1e64('0x2b')](_0x5c7eab,function(_0x3b19d1){if(_0x3b19d1['type']!==_0x1e64('0x41')){var _0x275852={};_0x275852[_0x3b19d1[_0x1e64('0x29')]]={'$like':'%'+_0x2b01cf['query']['filter']+'%'};return _0x275852;}})});}_0x1b3474=_['merge']({},_0x1b3474,_0x2b01cf[_0x1e64('0x42')]);var _0x4a3b58={'where':_0x1b3474[_0x1e64('0x3e')]};return db['Schedule'][_0x1e64('0x1c')](_0x4a3b58)[_0x1e64('0x23')](function(_0x592462){_0x263ea0[_0x1e64('0x1c')]=_0x592462;if(_0x2b01cf[_0x1e64('0x33')]['includeAll']){_0x1b3474['include']=[{'all':!![]}];}return db[_0x1e64('0x2c')]['findAll'](_0x1b3474);})[_0x1e64('0x23')](function(_0x2f24c9){_0x263ea0[_0x1e64('0x43')]=_0x2f24c9;return _0x263ea0;})['then'](respondWithFilteredResult(_0x35f94b,_0x1b3474))[_0x1e64('0x44')](handleError(_0x35f94b,null));};exports[_0x1e64('0x45')]=function(_0x540196,_0x9e31a9){var _0x308880={'raw':![],'where':{'id':_0x540196[_0x1e64('0x46')]['id']}},_0x121566={};_0x121566[_0x1e64('0x31')]=_[_0x1e64('0x32')](db['Schedule'][_0x1e64('0x2d')]);_0x121566[_0x1e64('0x33')]=_[_0x1e64('0x32')](_0x540196['query']);_0x121566['filters']=_['intersection'](_0x121566[_0x1e64('0x31')],_0x121566[_0x1e64('0x33')]);_0x308880[_0x1e64('0x36')]=_[_0x1e64('0x35')](_0x121566[_0x1e64('0x31')],qs[_0x1e64('0x37')](_0x540196[_0x1e64('0x33')][_0x1e64('0x37')]));_0x308880['attributes']=_0x308880[_0x1e64('0x36')]['length']?_0x308880[_0x1e64('0x36')]:_0x121566[_0x1e64('0x31')];if(_0x540196[_0x1e64('0x33')][_0x1e64('0x47')]){_0x308880['include']=[{'all':!![]}];}_0x308880=_[_0x1e64('0x40')]({},_0x308880,_0x540196[_0x1e64('0x42')]);return db[_0x1e64('0x2c')]['find'](_0x308880)[_0x1e64('0x23')](handleEntityNotFound(_0x9e31a9,null))[_0x1e64('0x23')](respondWithResult(_0x9e31a9,null))[_0x1e64('0x44')](handleError(_0x9e31a9,null));};exports['create']=function(_0x1c4111,_0x28cff2){return db[_0x1e64('0x2c')][_0x1e64('0x48')](_0x1c4111[_0x1e64('0x49')],{})[_0x1e64('0x23')](function(_0x5746e5){var _0x49aac0=_0x1c4111[_0x1e64('0x4a')]['get']({'plain':!![]});if(!_0x49aac0)throw new Error(_0x1e64('0x4b'));if(_0x49aac0[_0x1e64('0x4c')]==='user'){var _0x2b0f9e=_0x5746e5['get']({'plain':!![]});var _0x1d81db=_0x1e64('0x4d');return db[_0x1e64('0x4e')][_0x1e64('0x4f')]({'where':{'name':_0x1d81db,'userProfileId':_0x49aac0[_0x1e64('0x50')]},'raw':!![]})[_0x1e64('0x23')](function(_0x5f1ac6){if(_0x5f1ac6&&_0x5f1ac6[_0x1e64('0x51')]===0x0){return db[_0x1e64('0x52')][_0x1e64('0x48')]({'name':_0x2b0f9e[_0x1e64('0x29')],'resourceId':_0x2b0f9e['id'],'type':_0x5f1ac6[_0x1e64('0x29')],'sectionId':_0x5f1ac6['id']},{})[_0x1e64('0x23')](function(){return _0x5746e5;});}else{return _0x5746e5;}})[_0x1e64('0x44')](function(_0x504aa7){logger['error'](_0x1e64('0x53'),_0x504aa7);throw _0x504aa7;});}return _0x5746e5;})[_0x1e64('0x23')](respondWithResult(_0x28cff2,0xc9))[_0x1e64('0x44')](handleError(_0x28cff2,null));};exports[_0x1e64('0x22')]=function(_0x325d05,_0x47e8b1){if(_0x325d05['body']['id']){delete _0x325d05[_0x1e64('0x49')]['id'];}return db[_0x1e64('0x2c')]['find']({'where':{'id':_0x325d05['params']['id']}})[_0x1e64('0x23')](handleEntityNotFound(_0x47e8b1,null))['then'](saveUpdates(_0x325d05[_0x1e64('0x49')],null))[_0x1e64('0x23')](respondWithResult(_0x47e8b1,null))[_0x1e64('0x44')](handleError(_0x47e8b1,null));};exports['destroy']=function(_0x49a29c,_0x3b30d7){return db['Schedule'][_0x1e64('0x4f')]({'where':{'id':_0x49a29c[_0x1e64('0x46')]['id']}})[_0x1e64('0x23')](handleEntityNotFound(_0x3b30d7,null))[_0x1e64('0x23')](removeEntity(_0x3b30d7,null))[_0x1e64('0x44')](handleError(_0x3b30d7,null));};exports[_0x1e64('0x54')]=function(_0x4f1290,_0x178e33,_0x792233){var _0x1cb9c8=require(_0x1e64('0x55'));return db['Schedule'][_0x1e64('0x4f')]({'where':{'id':_0x4f1290[_0x1e64('0x46')]['id']},'raw':!![]})[_0x1e64('0x23')](handleEntityNotFound(_0x178e33,null))['then'](function(){_0x1cb9c8[_0x1e64('0x54')](_0x4f1290['params']['id']);})[_0x1e64('0x23')](respondWithStatusCode(_0x178e33,null))['catch'](handleError(_0x178e33,null));}; \ No newline at end of file +var _0x6413=['rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filter','where','merge','includeAll','include','findAll','rows','params','length','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','run','../../config/schedule','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','get','Scheduler','UserProfileResource','error','stack','name','send','index','map','Schedule'];(function(_0x45d003,_0x40f78a){var _0x331760=function(_0x47466f){while(--_0x47466f){_0x45d003['push'](_0x45d003['shift']());}};_0x331760(++_0x40f78a);}(_0x6413,0x164));var _0x3641=function(_0x5e5393,_0x5e83e6){_0x5e5393=_0x5e5393-0x0;var _0x56cc23=_0x6413[_0x5e5393];return _0x56cc23;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3641('0x0'));var zipdir=require(_0x3641('0x1'));var jsonpatch=require(_0x3641('0x2'));var rp=require(_0x3641('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3641('0x4'));var path=require('path');var sox=require(_0x3641('0x5'));var csv=require(_0x3641('0x6'));var ejs=require(_0x3641('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3641('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3641('0x9'));var deskjs=require(_0x3641('0xa'));var toCsv=require(_0x3641('0x6'));var querystring=require(_0x3641('0xb'));var Papa=require(_0x3641('0xc'));var Redis=require('ioredis');var authService=require(_0x3641('0xd'));var qs=require(_0x3641('0xe'));var as=require(_0x3641('0xf'));var hardwareService=require(_0x3641('0x10'));var logger=require(_0x3641('0x11'))('api');var utils=require(_0x3641('0x12'));var config=require(_0x3641('0x13'));var licenseUtil=require(_0x3641('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1156ad,_0x5a10e1){_0x5a10e1=_0x5a10e1||0xcc;return function(_0x1cbbc1){if(_0x1cbbc1){return _0x1156ad[_0x3641('0x15')](_0x5a10e1);}return _0x1156ad[_0x3641('0x16')](_0x5a10e1)[_0x3641('0x17')]();};}function respondWithResult(_0x3d2459,_0x4bded5){_0x4bded5=_0x4bded5||0xc8;return function(_0x1eb1a5){if(_0x1eb1a5){return _0x3d2459[_0x3641('0x16')](_0x4bded5)[_0x3641('0x18')](_0x1eb1a5);}};}function respondWithFilteredResult(_0x2070b6,_0x313178){return function(_0x286978){if(_0x286978){var _0x255f4e=typeof _0x313178[_0x3641('0x19')]===_0x3641('0x1a')&&typeof _0x313178[_0x3641('0x1b')]==='undefined';var _0x3791e9=_0x286978[_0x3641('0x1c')];var _0x57ae41=_0x255f4e?0x0:_0x313178['offset'];var _0x49d663=_0x255f4e?_0x286978[_0x3641('0x1c')]:_0x313178[_0x3641('0x19')]+_0x313178[_0x3641('0x1b')];var _0x2efec4;if(_0x49d663>=_0x3791e9){_0x49d663=_0x3791e9;_0x2efec4=0xc8;}else{_0x2efec4=0xce;}_0x2070b6['status'](_0x2efec4);return _0x2070b6[_0x3641('0x1d')](_0x3641('0x1e'),_0x57ae41+'-'+_0x49d663+'/'+_0x3791e9)[_0x3641('0x18')](_0x286978);}return null;};}function patchUpdates(_0x41822b){return function(_0x528abe){try{jsonpatch['apply'](_0x528abe,_0x41822b,!![]);}catch(_0xbdf08){return BPromise[_0x3641('0x1f')](_0xbdf08);}return _0x528abe['save']();};}function saveUpdates(_0x6fa5d9,_0x3316b3){return function(_0x5452d0){if(_0x5452d0){return _0x5452d0['update'](_0x6fa5d9)[_0x3641('0x20')](function(_0x4ae7a5){return _0x4ae7a5;});}return null;};}function removeEntity(_0x3e54a6,_0x430472){return function(_0x4db696){if(_0x4db696){return _0x4db696[_0x3641('0x21')]()[_0x3641('0x20')](function(){var _0x25c875=_0x4db696[_0x3641('0x22')]({'plain':!![]});var _0x200d4a=_0x3641('0x23');return db[_0x3641('0x24')][_0x3641('0x21')]({'where':{'type':_0x200d4a,'resourceId':_0x25c875['id']}})[_0x3641('0x20')](function(){return _0x4db696;});})[_0x3641('0x20')](function(){_0x3e54a6[_0x3641('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a842a,_0x4a5143){return function(_0x259f7f){if(!_0x259f7f){_0x1a842a[_0x3641('0x15')](0x194);}return _0x259f7f;};}function handleError(_0x1c2bf4,_0x5d56b9){_0x5d56b9=_0x5d56b9||0x1f4;return function(_0x49eefa){logger[_0x3641('0x25')](_0x49eefa[_0x3641('0x26')]);if(_0x49eefa[_0x3641('0x27')]){delete _0x49eefa[_0x3641('0x27')];}_0x1c2bf4[_0x3641('0x16')](_0x5d56b9)[_0x3641('0x28')](_0x49eefa);};}exports[_0x3641('0x29')]=function(_0x238c24,_0x28acbb){var _0x3b1406={},_0x53a7fe={},_0x2d76c0={'count':0x0,'rows':[]};var _0x2dd1d0=_[_0x3641('0x2a')](db[_0x3641('0x2b')][_0x3641('0x2c')],function(_0x10e92c){return{'name':_0x10e92c['fieldName'],'type':_0x10e92c[_0x3641('0x2d')][_0x3641('0x2e')]};});_0x53a7fe[_0x3641('0x2f')]=_[_0x3641('0x2a')](_0x2dd1d0,_0x3641('0x27'));_0x53a7fe['query']=_[_0x3641('0x30')](_0x238c24[_0x3641('0x31')]);_0x53a7fe[_0x3641('0x32')]=_[_0x3641('0x33')](_0x53a7fe[_0x3641('0x2f')],_0x53a7fe[_0x3641('0x31')]);_0x3b1406[_0x3641('0x34')]=_[_0x3641('0x33')](_0x53a7fe[_0x3641('0x2f')],qs[_0x3641('0x35')](_0x238c24[_0x3641('0x31')][_0x3641('0x35')]));_0x3b1406['attributes']=_0x3b1406[_0x3641('0x34')]['length']?_0x3b1406[_0x3641('0x34')]:_0x53a7fe[_0x3641('0x2f')];if(!_0x238c24['query'][_0x3641('0x36')](_0x3641('0x37'))){_0x3b1406[_0x3641('0x1b')]=qs[_0x3641('0x1b')](_0x238c24[_0x3641('0x31')]['limit']);_0x3b1406['offset']=qs[_0x3641('0x19')](_0x238c24[_0x3641('0x31')][_0x3641('0x19')]);}_0x3b1406['order']=qs[_0x3641('0x38')](_0x238c24[_0x3641('0x31')][_0x3641('0x38')]);_0x3b1406['where']=qs[_0x3641('0x32')](_['pick'](_0x238c24[_0x3641('0x31')],_0x53a7fe[_0x3641('0x32')]),_0x2dd1d0);if(_0x238c24[_0x3641('0x31')][_0x3641('0x39')]){_0x3b1406[_0x3641('0x3a')]=_[_0x3641('0x3b')](_0x3b1406[_0x3641('0x3a')],{'$or':_['map'](_0x2dd1d0,function(_0x1f379d){if(_0x1f379d[_0x3641('0x2d')]!=='VIRTUAL'){var _0xf4d9a6={};_0xf4d9a6[_0x1f379d[_0x3641('0x27')]]={'$like':'%'+_0x238c24[_0x3641('0x31')][_0x3641('0x39')]+'%'};return _0xf4d9a6;}})});}_0x3b1406=_[_0x3641('0x3b')]({},_0x3b1406,_0x238c24['options']);var _0x43f4dc={'where':_0x3b1406[_0x3641('0x3a')]};return db[_0x3641('0x2b')][_0x3641('0x1c')](_0x43f4dc)[_0x3641('0x20')](function(_0x41f790){_0x2d76c0[_0x3641('0x1c')]=_0x41f790;if(_0x238c24[_0x3641('0x31')][_0x3641('0x3c')]){_0x3b1406[_0x3641('0x3d')]=[{'all':!![]}];}return db[_0x3641('0x2b')][_0x3641('0x3e')](_0x3b1406);})['then'](function(_0x55da84){_0x2d76c0[_0x3641('0x3f')]=_0x55da84;return _0x2d76c0;})['then'](respondWithFilteredResult(_0x28acbb,_0x3b1406))['catch'](handleError(_0x28acbb,null));};exports['show']=function(_0x38be6c,_0x594080){var _0x52fcf3={'raw':![],'where':{'id':_0x38be6c[_0x3641('0x40')]['id']}},_0x12a760={};_0x12a760['model']=_[_0x3641('0x30')](db['Schedule'][_0x3641('0x2c')]);_0x12a760[_0x3641('0x31')]=_[_0x3641('0x30')](_0x38be6c[_0x3641('0x31')]);_0x12a760['filters']=_[_0x3641('0x33')](_0x12a760[_0x3641('0x2f')],_0x12a760[_0x3641('0x31')]);_0x52fcf3[_0x3641('0x34')]=_[_0x3641('0x33')](_0x12a760[_0x3641('0x2f')],qs[_0x3641('0x35')](_0x38be6c[_0x3641('0x31')][_0x3641('0x35')]));_0x52fcf3[_0x3641('0x34')]=_0x52fcf3[_0x3641('0x34')][_0x3641('0x41')]?_0x52fcf3[_0x3641('0x34')]:_0x12a760[_0x3641('0x2f')];if(_0x38be6c['query'][_0x3641('0x3c')]){_0x52fcf3['include']=[{'all':!![]}];}_0x52fcf3=_[_0x3641('0x3b')]({},_0x52fcf3,_0x38be6c[_0x3641('0x42')]);return db['Schedule'][_0x3641('0x43')](_0x52fcf3)['then'](handleEntityNotFound(_0x594080,null))[_0x3641('0x20')](respondWithResult(_0x594080,null))['catch'](handleError(_0x594080,null));};exports['create']=function(_0x5f477a,_0x4f0b89){return db[_0x3641('0x2b')][_0x3641('0x44')](_0x5f477a[_0x3641('0x45')],{})[_0x3641('0x20')](function(_0x3f6fef){var _0x539892=_0x5f477a[_0x3641('0x46')][_0x3641('0x22')]({'plain':!![]});if(!_0x539892)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x539892[_0x3641('0x47')]===_0x3641('0x46')){var _0x664100=_0x3f6fef[_0x3641('0x22')]({'plain':!![]});var _0x218106=_0x3641('0x23');return db[_0x3641('0x48')][_0x3641('0x43')]({'where':{'name':_0x218106,'userProfileId':_0x539892[_0x3641('0x49')]},'raw':!![]})[_0x3641('0x20')](function(_0x51964e){if(_0x51964e&&_0x51964e[_0x3641('0x4a')]===0x0){return db[_0x3641('0x24')]['create']({'name':_0x664100[_0x3641('0x27')],'resourceId':_0x664100['id'],'type':_0x51964e['name'],'sectionId':_0x51964e['id']},{})[_0x3641('0x20')](function(){return _0x3f6fef;});}else{return _0x3f6fef;}})[_0x3641('0x4b')](function(_0x39b2a1){logger[_0x3641('0x25')](_0x3641('0x4c'),_0x39b2a1);throw _0x39b2a1;});}return _0x3f6fef;})[_0x3641('0x20')](respondWithResult(_0x4f0b89,0xc9))['catch'](handleError(_0x4f0b89,null));};exports[_0x3641('0x4d')]=function(_0x106aca,_0x2871e5){if(_0x106aca['body']['id']){delete _0x106aca[_0x3641('0x45')]['id'];}return db[_0x3641('0x2b')][_0x3641('0x43')]({'where':{'id':_0x106aca['params']['id']}})[_0x3641('0x20')](handleEntityNotFound(_0x2871e5,null))[_0x3641('0x20')](saveUpdates(_0x106aca[_0x3641('0x45')],null))[_0x3641('0x20')](respondWithResult(_0x2871e5,null))['catch'](handleError(_0x2871e5,null));};exports[_0x3641('0x21')]=function(_0x2023f5,_0x4884ed){return db[_0x3641('0x2b')][_0x3641('0x43')]({'where':{'id':_0x2023f5[_0x3641('0x40')]['id']}})[_0x3641('0x20')](handleEntityNotFound(_0x4884ed,null))[_0x3641('0x20')](removeEntity(_0x4884ed,null))[_0x3641('0x4b')](handleError(_0x4884ed,null));};exports[_0x3641('0x4e')]=function(_0x1afdad,_0x21c089,_0x289b8a){var _0x34914f=require(_0x3641('0x4f'));return db[_0x3641('0x2b')][_0x3641('0x43')]({'where':{'id':_0x1afdad[_0x3641('0x40')]['id']},'raw':!![]})[_0x3641('0x20')](handleEntityNotFound(_0x21c089,null))['then'](function(){_0x34914f[_0x3641('0x4e')](_0x1afdad[_0x3641('0x40')]['id']);})['then'](respondWithStatusCode(_0x21c089,null))[_0x3641('0x4b')](handleError(_0x21c089,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 8633d3f..4bf616f 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 _0x3247=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./schedule.attributes','exports','define','Schedule'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x3247,0x198));var _0x7324=function(_0x60b82d,_0x3d40ed){_0x60b82d=_0x60b82d-0x0;var _0x14792d=_0x3247[_0x60b82d];return _0x14792d;};'use strict';var _=require(_0x7324('0x0'));var util=require(_0x7324('0x1'));var logger=require('../../config/logger')(_0x7324('0x2'));var moment=require(_0x7324('0x3'));var BPromise=require(_0x7324('0x4'));var rp=require(_0x7324('0x5'));var fs=require('fs');var path=require(_0x7324('0x6'));var rimraf=require('rimraf');var config=require(_0x7324('0x7'));var attributes=require(_0x7324('0x8'));module[_0x7324('0x9')]=function(_0x10d468,_0x51908e){return _0x10d468[_0x7324('0xa')](_0x7324('0xb'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd66f=['Schedule','tools_schedules','lodash','util','../../config/logger','api','moment','path','rimraf','exports','define'];(function(_0x561143,_0x445a7e){var _0x33a062=function(_0x497ac2){while(--_0x497ac2){_0x561143['push'](_0x561143['shift']());}};_0x33a062(++_0x445a7e);}(_0xd66f,0x9c));var _0xfd66=function(_0x32b54b,_0x3a2566){_0x32b54b=_0x32b54b-0x0;var _0x199f12=_0xd66f[_0x32b54b];return _0x199f12;};'use strict';var _=require(_0xfd66('0x0'));var util=require(_0xfd66('0x1'));var logger=require(_0xfd66('0x2'))(_0xfd66('0x3'));var moment=require(_0xfd66('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd66('0x5'));var rimraf=require(_0xfd66('0x6'));var config=require('../../config/environment');var attributes=require('./schedule.attributes');module[_0xfd66('0x7')]=function(_0x485f6d,_0x1d4b7a){return _0x485f6d[_0xfd66('0x8')](_0xfd66('0x9'),attributes,{'tableName':_0xfd66('0xa'),'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 9a9ba6b..9feabc4 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 _0x9d40=['debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','rpc','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent'];(function(_0xfb0c3e,_0x296c35){var _0xaf0a2=function(_0x40d2cd){while(--_0x40d2cd){_0xfb0c3e['push'](_0xfb0c3e['shift']());}};_0xaf0a2(++_0x296c35);}(_0x9d40,0x1eb));var _0x09d4=function(_0x20da3d,_0x43cc86){_0x20da3d=_0x20da3d-0x0;var _0x45a037=_0x9d40[_0x20da3d];return _0x45a037;};'use strict';var _=require(_0x09d4('0x0'));var util=require('util');var moment=require(_0x09d4('0x1'));var BPromise=require(_0x09d4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x09d4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x09d4('0x4'));var logger=require('../../config/logger')(_0x09d4('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x09d4('0x6')][_0x09d4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5dbc03,_0x4c87ca,_0x3fb299){return new BPromise(function(_0x2c7113,_0x123063){return client[_0x09d4('0x8')](_0x5dbc03,_0x3fb299)[_0x09d4('0x9')](function(_0xf5ab7d){logger[_0x09d4('0xa')](_0x09d4('0xb'),_0x4c87ca,_0x09d4('0xc'));logger[_0x09d4('0xd')](_0x09d4('0xe'),_0x4c87ca,_0x09d4('0xc'),JSON[_0x09d4('0xf')](_0xf5ab7d));if(_0xf5ab7d[_0x09d4('0x10')]){if(_0xf5ab7d[_0x09d4('0x10')][_0x09d4('0x11')]===0x1f4){logger[_0x09d4('0x10')](_0x09d4('0xb'),_0x4c87ca,_0xf5ab7d[_0x09d4('0x10')][_0x09d4('0x12')]);return _0x123063(_0xf5ab7d[_0x09d4('0x10')][_0x09d4('0x12')]);}logger['error'](_0x09d4('0xb'),_0x4c87ca,_0xf5ab7d[_0x09d4('0x10')][_0x09d4('0x12')]);return _0x2c7113(_0xf5ab7d[_0x09d4('0x10')][_0x09d4('0x12')]);}else{logger['info'](_0x09d4('0xb'),_0x4c87ca,_0x09d4('0xc'));_0x2c7113(_0xf5ab7d[_0x09d4('0x13')][_0x09d4('0x12')]);}})[_0x09d4('0x14')](function(_0x3c1562){logger[_0x09d4('0x10')](_0x09d4('0xb'),_0x4c87ca,_0x3c1562);_0x123063(_0x3c1562);});});} \ No newline at end of file +var _0xa868=['message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x20b73f,_0x59bc48){var _0x4664a7=function(_0x5e1a93){while(--_0x5e1a93){_0x20b73f['push'](_0x20b73f['shift']());}};_0x4664a7(++_0x59bc48);}(_0xa868,0x13d));var _0x8a86=function(_0x45fb76,_0x35fd5d){_0x45fb76=_0x45fb76-0x0;var _0x338556=_0xa868[_0x45fb76];return _0x338556;};'use strict';var _=require(_0x8a86('0x0'));var util=require(_0x8a86('0x1'));var moment=require(_0x8a86('0x2'));var BPromise=require(_0x8a86('0x3'));var rs=require(_0x8a86('0x4'));var fs=require('fs');var Redis=require(_0x8a86('0x5'));var db=require(_0x8a86('0x6'))['db'];var utils=require(_0x8a86('0x7'));var logger=require(_0x8a86('0x8'))('rpc');var config=require(_0x8a86('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8a86('0xa')][_0x8a86('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x51357b,_0xfc219b,_0x43b162){return new BPromise(function(_0x5d995d,_0x5a27b0){return client[_0x8a86('0xc')](_0x51357b,_0x43b162)['then'](function(_0x19358c){logger['info'](_0x8a86('0xd'),_0xfc219b,'request\x20sent');logger[_0x8a86('0xe')](_0x8a86('0xf'),_0xfc219b,'request\x20sent',JSON[_0x8a86('0x10')](_0x19358c));if(_0x19358c[_0x8a86('0x11')]){if(_0x19358c[_0x8a86('0x11')][_0x8a86('0x12')]===0x1f4){logger['error'](_0x8a86('0xd'),_0xfc219b,_0x19358c[_0x8a86('0x11')][_0x8a86('0x13')]);return _0x5a27b0(_0x19358c['error'][_0x8a86('0x13')]);}logger[_0x8a86('0x11')]('Schedule,\x20%s,\x20%s',_0xfc219b,_0x19358c['error'][_0x8a86('0x13')]);return _0x5d995d(_0x19358c[_0x8a86('0x11')][_0x8a86('0x13')]);}else{logger[_0x8a86('0x14')](_0x8a86('0xd'),_0xfc219b,_0x8a86('0x15'));_0x5d995d(_0x19358c[_0x8a86('0x16')][_0x8a86('0x13')]);}})[_0x8a86('0x17')](function(_0x34b98a){logger[_0x8a86('0x11')]('Schedule,\x20%s,\x20%s',_0xfc219b,_0x34b98a);_0x5a27b0(_0x34b98a);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 61114e4..f700b22 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 _0xfe31=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','download','post','create','put','delete','/:id','destroy','exports','multer','util','express'];(function(_0x451e1c,_0x3243ae){var _0x4cc2e3=function(_0x12f6fa){while(--_0x12f6fa){_0x451e1c['push'](_0x451e1c['shift']());}};_0x4cc2e3(++_0x3243ae);}(_0xfe31,0xf9));var _0x1fe3=function(_0x5b48a9,_0x577cee){_0x5b48a9=_0x5b48a9-0x0;var _0x1f07a9=_0xfe31[_0x5b48a9];return _0x1f07a9;};'use strict';var multer=require(_0x1fe3('0x0'));var util=require(_0x1fe3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1fe3('0x2'));var router=express[_0x1fe3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1fe3('0x4'));var interaction=require(_0x1fe3('0x5'));var config=require(_0x1fe3('0x6'));var controller=require(_0x1fe3('0x7'));router[_0x1fe3('0x8')]('/',auth[_0x1fe3('0x9')](),controller[_0x1fe3('0xa')]);router[_0x1fe3('0x8')](_0x1fe3('0xb'),auth['isAuthenticated'](),controller[_0x1fe3('0xc')]);router[_0x1fe3('0x8')]('/:id',auth[_0x1fe3('0x9')](),controller['show']);router[_0x1fe3('0x8')]('/:id/download',auth[_0x1fe3('0x9')](),controller[_0x1fe3('0xd')]);router[_0x1fe3('0xe')]('/',auth[_0x1fe3('0x9')](),controller[_0x1fe3('0xf')]);router[_0x1fe3('0x10')]('/:id',auth[_0x1fe3('0x9')](),controller['update']);router[_0x1fe3('0x11')](_0x1fe3('0x12'),auth['isAuthenticated'](),controller[_0x1fe3('0x13')]);module[_0x1fe3('0x14')]=router; \ No newline at end of file +var _0x184e=['../../components/auth/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra'];(function(_0x389c43,_0x3abfb2){var _0x57cd7d=function(_0x3315a6){while(--_0x3315a6){_0x389c43['push'](_0x389c43['shift']());}};_0x57cd7d(++_0x3abfb2);}(_0x184e,0xc1));var _0xe184=function(_0x28fe94,_0x120b9b){_0x28fe94=_0x28fe94-0x0;var _0x3560da=_0x184e[_0x28fe94];return _0x3560da;};'use strict';var multer=require(_0xe184('0x0'));var util=require('util');var path=require(_0xe184('0x1'));var timeout=require(_0xe184('0x2'));var express=require('express');var router=express[_0xe184('0x3')]();var fs_extra=require(_0xe184('0x4'));var auth=require(_0xe184('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe184('0x6'));var controller=require(_0xe184('0x7'));router[_0xe184('0x8')]('/',auth[_0xe184('0x9')](),controller[_0xe184('0xa')]);router[_0xe184('0x8')](_0xe184('0xb'),auth[_0xe184('0x9')](),controller[_0xe184('0xc')]);router[_0xe184('0x8')](_0xe184('0xd'),auth[_0xe184('0x9')](),controller['show']);router[_0xe184('0x8')](_0xe184('0xe'),auth[_0xe184('0x9')](),controller[_0xe184('0xf')]);router['post']('/',auth[_0xe184('0x9')](),controller[_0xe184('0x10')]);router[_0xe184('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xe184('0x12')]);router[_0xe184('0x13')]('/:id',auth[_0xe184('0x9')](),controller[_0xe184('0x14')]);module[_0xe184('0x15')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 499507e..427b27c 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 _0xb1ad=['../../config/environment','exports','VIRTUAL','value','extname','getDataValue','STRING','replace','setDataValue','INTEGER','startedAt','subtract','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','closedAt','createdAt','updatedAt','sequelize','moment','path'];(function(_0x57afca,_0x55aee9){var _0x8b70f5=function(_0x2a33a8){while(--_0x2a33a8){_0x57afca['push'](_0x57afca['shift']());}};_0x8b70f5(++_0x55aee9);}(_0xb1ad,0x184));var _0xdb1a=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xb1ad[_0x433a86];return _0x23000c;};'use strict';var Sequelize=require(_0xdb1a('0x0'));var moment=require(_0xdb1a('0x1'));var path=require(_0xdb1a('0x2'));var config=require(_0xdb1a('0x3'));module[_0xdb1a('0x4')]={'format':{'type':Sequelize[_0xdb1a('0x5')],'get':function(){return this['getDataValue'](_0xdb1a('0x6'))?path[_0xdb1a('0x7')](this[_0xdb1a('0x8')](_0xdb1a('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xdb1a('0x9')]},'channel':{'type':Sequelize[_0xdb1a('0x9')]},'value':{'type':Sequelize[_0xdb1a('0x9')],'set':function(_0x12b8c5){var _0x2712fe=_0x12b8c5[_0xdb1a('0xa')](/\\/g,'/');this[_0xdb1a('0xb')](_0xdb1a('0x6'),_0x2712fe);}},'rating':{'type':Sequelize[_0xdb1a('0xc')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xdb1a('0xc')],'set':function(_0x122af8){this['setDataValue'](_0xdb1a('0xd'),moment()[_0xdb1a('0xe')](_0x122af8,'ms'));this['setDataValue']('closedAt',moment());this['setDataValue'](_0xdb1a('0xf'),_0x122af8);}},'startedAt':{'type':Sequelize[_0xdb1a('0x10')],'get':function(){return moment(this[_0xdb1a('0x8')](_0xdb1a('0xd')))[_0xdb1a('0x11')](_0xdb1a('0x12'))[_0xdb1a('0x13')]();}},'closedAt':{'type':Sequelize[_0xdb1a('0x10')],'get':function(){return moment(this[_0xdb1a('0x8')](_0xdb1a('0x14')))[_0xdb1a('0x11')](_0xdb1a('0x12'))[_0xdb1a('0x13')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xdb1a('0x8')](_0xdb1a('0x15')))[_0xdb1a('0x11')]('MM-DD-YYYY\x20HH:mm')[_0xdb1a('0x13')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xdb1a('0x8')](_0xdb1a('0x16')))[_0xdb1a('0x11')]('MM-DD-YYYY\x20HH:mm')[_0xdb1a('0x13')]();}}}; \ No newline at end of file +var _0x23bb=['updatedAt','sequelize','../../config/environment','exports','VIRTUAL','value','extname','getDataValue','STRING','setDataValue','INTEGER','subtract','duration','DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','toString','closedAt','createdAt'];(function(_0x23d0a1,_0x5011a){var _0x1ef866=function(_0x5103d4){while(--_0x5103d4){_0x23d0a1['push'](_0x23d0a1['shift']());}};_0x1ef866(++_0x5011a);}(_0x23bb,0x79));var _0xb23b=function(_0x3cca7a,_0x109a23){_0x3cca7a=_0x3cca7a-0x0;var _0x34e717=_0x23bb[_0x3cca7a];return _0x34e717;};'use strict';var Sequelize=require(_0xb23b('0x0'));var moment=require('moment');var path=require('path');var config=require(_0xb23b('0x1'));module[_0xb23b('0x2')]={'format':{'type':Sequelize[_0xb23b('0x3')],'get':function(){return this['getDataValue'](_0xb23b('0x4'))?path[_0xb23b('0x5')](this[_0xb23b('0x6')]('value')):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xb23b('0x7')],'set':function(_0x4c5626){var _0x4a2873=_0x4c5626['replace'](/\\/g,'/');this[_0xb23b('0x8')]('value',_0x4a2873);}},'rating':{'type':Sequelize[_0xb23b('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x23270c){this[_0xb23b('0x8')]('startedAt',moment()[_0xb23b('0xa')](_0x23270c,'ms'));this[_0xb23b('0x8')]('closedAt',moment());this[_0xb23b('0x8')](_0xb23b('0xb'),_0x23270c);}},'startedAt':{'type':Sequelize[_0xb23b('0xc')],'get':function(){return moment(this['getDataValue'](_0xb23b('0xd')))[_0xb23b('0xe')](_0xb23b('0xf'))[_0xb23b('0x10')]();}},'closedAt':{'type':Sequelize[_0xb23b('0xc')],'get':function(){return moment(this[_0xb23b('0x6')](_0xb23b('0x11')))[_0xb23b('0xe')](_0xb23b('0xf'))[_0xb23b('0x10')]();}},'createdAt':{'type':Sequelize[_0xb23b('0xc')],'get':function(){return moment(this[_0xb23b('0x6')](_0xb23b('0x12')))[_0xb23b('0xe')](_0xb23b('0xf'))[_0xb23b('0x10')]();}},'updatedAt':{'type':Sequelize[_0xb23b('0xc')],'get':function(){return moment(this['getDataValue'](_0xb23b('0x13')))[_0xb23b('0xe')](_0xb23b('0xf'))[_0xb23b('0x10')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 17653a8..c22170d 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 _0xb458=['differenceBy','format','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','filter','options','ScreenRecording','includeAll','rows','catch','show','params','include','create','body','createdAt','closedAt','find','describe','download','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model'];(function(_0x2db0b9,_0x47c3a1){var _0x47f23b=function(_0x5aa83f){while(--_0x5aa83f){_0x2db0b9['push'](_0x2db0b9['shift']());}};_0x47f23b(++_0x47c3a1);}(_0xb458,0x103));var _0x8b45=function(_0x1fd6d8,_0x5c991a){_0x1fd6d8=_0x1fd6d8-0x0;var _0x78176a=_0xb458[_0x1fd6d8];return _0x78176a;};'use strict';var emlformat=require(_0x8b45('0x0'));var rimraf=require(_0x8b45('0x1'));var zipdir=require(_0x8b45('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8b45('0x3'));var BPromise=require(_0x8b45('0x4'));var Mustache=require(_0x8b45('0x5'));var util=require(_0x8b45('0x6'));var path=require('path');var sox=require(_0x8b45('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b45('0x8'));var _=require(_0x8b45('0x9'));var squel=require(_0x8b45('0xa'));var crypto=require(_0x8b45('0xb'));var jsforce=require(_0x8b45('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8b45('0xd'));var querystring=require(_0x8b45('0xe'));var Papa=require(_0x8b45('0xf'));var Redis=require(_0x8b45('0x10'));var authService=require(_0x8b45('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8b45('0x12'));var hardwareService=require(_0x8b45('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8b45('0x14'));var db=require(_0x8b45('0x15'))['db'];function respondWithStatusCode(_0x37c220,_0x52c4db){_0x52c4db=_0x52c4db||0xcc;return function(_0x30d38c){if(_0x30d38c){return _0x37c220[_0x8b45('0x16')](_0x52c4db);}return _0x37c220[_0x8b45('0x17')](_0x52c4db)[_0x8b45('0x18')]();};}function respondWithResult(_0x32babc,_0x2ad2ae){_0x2ad2ae=_0x2ad2ae||0xc8;return function(_0x5f0b20){if(_0x5f0b20){return _0x32babc['status'](_0x2ad2ae)[_0x8b45('0x19')](_0x5f0b20);}};}function respondWithFilteredResult(_0x23f1dd,_0x445170){return function(_0x39c1d1){if(_0x39c1d1){var _0x4781d7=typeof _0x445170[_0x8b45('0x1a')]===_0x8b45('0x1b')&&typeof _0x445170[_0x8b45('0x1c')]===_0x8b45('0x1b');var _0x391d1e=_0x39c1d1[_0x8b45('0x1d')];var _0x21d5b2=_0x4781d7?0x0:_0x445170[_0x8b45('0x1a')];var _0x43ffb7=_0x4781d7?_0x39c1d1[_0x8b45('0x1d')]:_0x445170[_0x8b45('0x1a')]+_0x445170[_0x8b45('0x1c')];var _0x309e23;if(_0x43ffb7>=_0x391d1e){_0x43ffb7=_0x391d1e;_0x309e23=0xc8;}else{_0x309e23=0xce;}_0x23f1dd['status'](_0x309e23);return _0x23f1dd[_0x8b45('0x1e')](_0x8b45('0x1f'),_0x21d5b2+'-'+_0x43ffb7+'/'+_0x391d1e)[_0x8b45('0x19')](_0x39c1d1);}return null;};}function patchUpdates(_0x46e21a){return function(_0x3e1438){try{jsonpatch[_0x8b45('0x20')](_0x3e1438,_0x46e21a,!![]);}catch(_0x2f4f1c){return BPromise[_0x8b45('0x21')](_0x2f4f1c);}return _0x3e1438['save']();};}function saveUpdates(_0x52f93f,_0x41154a){return function(_0x580e17){if(_0x580e17){return _0x580e17[_0x8b45('0x22')](_0x52f93f)[_0x8b45('0x23')](function(_0x30f405){return _0x30f405;});}return null;};}function removeEntity(_0x45e2db,_0x165570){return function(_0x2b8526){if(_0x2b8526){return _0x2b8526[_0x8b45('0x24')]()['then'](function(){_0x45e2db['status'](0xcc)[_0x8b45('0x18')]();});}};}function handleEntityNotFound(_0x2c2c06,_0x500044){return function(_0x5723a2){if(!_0x5723a2){_0x2c2c06[_0x8b45('0x16')](0x194);}return _0x5723a2;};}function handleError(_0x32f6f0,_0x2ca2d9){_0x2ca2d9=_0x2ca2d9||0x1f4;return function(_0x2f37bc){logger['error'](_0x2f37bc[_0x8b45('0x25')]);if(_0x2f37bc[_0x8b45('0x26')]){delete _0x2f37bc[_0x8b45('0x26')];}_0x32f6f0[_0x8b45('0x17')](_0x2ca2d9)[_0x8b45('0x27')](_0x2f37bc);};}exports[_0x8b45('0x28')]=function(_0x461017,_0x234f62){var _0x1733a7={},_0xf21bd1={},_0x339c73={'count':0x0,'rows':[]};var _0x1ba2d4=_[_0x8b45('0x29')](db['ScreenRecording'][_0x8b45('0x2a')],function(_0x36db96){return{'name':_0x36db96[_0x8b45('0x2b')],'type':_0x36db96[_0x8b45('0x2c')][_0x8b45('0x2d')]};});_0xf21bd1[_0x8b45('0x2e')]=_[_0x8b45('0x2f')](_[_0x8b45('0x29')](_0x1ba2d4,'name'),[_0x8b45('0x30')]);_0xf21bd1[_0x8b45('0x31')]=_[_0x8b45('0x32')](_0x461017[_0x8b45('0x31')]);_0xf21bd1[_0x8b45('0x33')]=_['intersection'](_0xf21bd1[_0x8b45('0x2e')],_0xf21bd1['query']);_0x1733a7['attributes']=_[_0x8b45('0x34')](_0xf21bd1[_0x8b45('0x2e')],qs[_0x8b45('0x35')](_0x461017[_0x8b45('0x31')][_0x8b45('0x35')]));_0x1733a7[_0x8b45('0x36')]=_0x1733a7['attributes'][_0x8b45('0x37')]?_0x1733a7[_0x8b45('0x36')]:_0xf21bd1[_0x8b45('0x2e')];if(!_0x461017[_0x8b45('0x31')]['hasOwnProperty'](_0x8b45('0x38'))){_0x1733a7[_0x8b45('0x1c')]=qs[_0x8b45('0x1c')](_0x461017['query'][_0x8b45('0x1c')]);_0x1733a7[_0x8b45('0x1a')]=qs[_0x8b45('0x1a')](_0x461017['query'][_0x8b45('0x1a')]);}_0x1733a7[_0x8b45('0x39')]=qs[_0x8b45('0x3a')](_0x461017[_0x8b45('0x31')]['sort']);_0x1733a7[_0x8b45('0x3b')]=qs[_0x8b45('0x33')](_[_0x8b45('0x3c')](_0x461017[_0x8b45('0x31')],_0xf21bd1[_0x8b45('0x33')]),_0x1ba2d4);if(_0x461017[_0x8b45('0x31')]['filter']){_0x1733a7['where']=_[_0x8b45('0x3d')](_0x1733a7[_0x8b45('0x3b')],{'$or':_[_0x8b45('0x29')](_0x1ba2d4,function(_0x12d4b2){if(_0x12d4b2[_0x8b45('0x2c')]!=='VIRTUAL'){var _0x120068={};_0x120068[_0x12d4b2['name']]={'$like':'%'+_0x461017[_0x8b45('0x31')][_0x8b45('0x3e')]+'%'};return _0x120068;}})});}_0x1733a7=_[_0x8b45('0x3d')]({},_0x1733a7,_0x461017[_0x8b45('0x3f')]);var _0x254f17={'where':_0x1733a7[_0x8b45('0x3b')]};return db[_0x8b45('0x40')][_0x8b45('0x1d')](_0x254f17)[_0x8b45('0x23')](function(_0x2ca00e){_0x339c73[_0x8b45('0x1d')]=_0x2ca00e;if(_0x461017['query'][_0x8b45('0x41')]){_0x1733a7['include']=[{'all':!![]}];}return db[_0x8b45('0x40')]['findAll'](_0x1733a7);})[_0x8b45('0x23')](function(_0x224c45){_0x339c73[_0x8b45('0x42')]=_0x224c45;return _0x339c73;})[_0x8b45('0x23')](respondWithFilteredResult(_0x234f62,_0x1733a7))[_0x8b45('0x43')](handleError(_0x234f62,null));};exports[_0x8b45('0x44')]=function(_0x58e663,_0x6fbca4){var _0x5916c7={'raw':![],'where':{'id':_0x58e663[_0x8b45('0x45')]['id']}},_0x4c56c8={};_0x4c56c8[_0x8b45('0x2e')]=_[_0x8b45('0x32')](db['ScreenRecording'][_0x8b45('0x2a')]);_0x4c56c8['query']=_[_0x8b45('0x32')](_0x58e663[_0x8b45('0x31')]);_0x4c56c8[_0x8b45('0x33')]=_[_0x8b45('0x34')](_0x4c56c8[_0x8b45('0x2e')],_0x4c56c8[_0x8b45('0x31')]);_0x5916c7['attributes']=_[_0x8b45('0x34')](_0x4c56c8[_0x8b45('0x2e')],qs[_0x8b45('0x35')](_0x58e663[_0x8b45('0x31')][_0x8b45('0x35')]));_0x5916c7[_0x8b45('0x36')]=_0x5916c7[_0x8b45('0x36')][_0x8b45('0x37')]?_0x5916c7[_0x8b45('0x36')]:_0x4c56c8[_0x8b45('0x2e')];if(_0x58e663[_0x8b45('0x31')][_0x8b45('0x41')]){_0x5916c7[_0x8b45('0x46')]=[{'all':!![]}];}_0x5916c7=_[_0x8b45('0x3d')]({},_0x5916c7,_0x58e663[_0x8b45('0x3f')]);return db[_0x8b45('0x40')]['find'](_0x5916c7)['then'](handleEntityNotFound(_0x6fbca4,null))['then'](respondWithResult(_0x6fbca4,null))[_0x8b45('0x43')](handleError(_0x6fbca4,null));};exports[_0x8b45('0x47')]=function(_0x3a1621,_0x473530){return db[_0x8b45('0x40')][_0x8b45('0x47')](_0x3a1621[_0x8b45('0x48')],{})[_0x8b45('0x23')](respondWithResult(_0x473530,0xc9))['catch'](handleError(_0x473530,null));};exports[_0x8b45('0x22')]=function(_0x5d5be2,_0x23b5c6){if(_0x5d5be2[_0x8b45('0x48')]['id']){delete _0x5d5be2[_0x8b45('0x48')]['id'];}delete _0x5d5be2[_0x8b45('0x48')]['duration'];delete _0x5d5be2[_0x8b45('0x48')][_0x8b45('0x49')];delete _0x5d5be2['body'][_0x8b45('0x4a')];delete _0x5d5be2[_0x8b45('0x48')]['value'];return db[_0x8b45('0x40')][_0x8b45('0x4b')]({'where':{'id':_0x5d5be2[_0x8b45('0x45')]['id']}})[_0x8b45('0x23')](handleEntityNotFound(_0x23b5c6,null))[_0x8b45('0x23')](saveUpdates(_0x5d5be2[_0x8b45('0x48')],null))['then'](respondWithResult(_0x23b5c6,null))['catch'](handleError(_0x23b5c6,null));};exports[_0x8b45('0x4c')]=function(_0x2a2e59,_0x2d5b31){return db['ScreenRecording'][_0x8b45('0x4c')]()[_0x8b45('0x23')](respondWithResult(_0x2d5b31,null))[_0x8b45('0x43')](handleError(_0x2d5b31,null));};exports[_0x8b45('0x4d')]=function(_0x2d6b66,_0x597402,_0x34c05d){var _0xa92a05=require('../../components/encryptor');var _0x422da0=![];var _0x4c3f38={};if(_0x2d6b66[_0x8b45('0x31')][_0x8b45('0x2c')]&&_0x2d6b66[_0x8b45('0x31')][_0x8b45('0x2c')]==='uniqueid'){_0x4c3f38[_0x8b45('0x4e')]=_0x2d6b66[_0x8b45('0x45')]['id'];}else{_0x4c3f38['id']=_0x2d6b66[_0x8b45('0x45')]['id'];}return db[_0x8b45('0x40')][_0x8b45('0x4b')]({'where':_0x4c3f38,'attributes':['id',_0x8b45('0x4f')],'raw':!![]})[_0x8b45('0x23')](handleEntityNotFound(_0x597402,null))[_0x8b45('0x23')](function(_0x446fe5){if(_0x446fe5){var _0x5ba878=path[_0x8b45('0x50')](config[_0x8b45('0x51')],_0x8b45('0x52'),_0x446fe5[_0x8b45('0x4f')]);var _0x1851c2=util['format'](_0x8b45('0x53'),_0x5ba878);if(fs[_0x8b45('0x54')](_0x1851c2)){_0x422da0=!![];return _0xa92a05[_0x8b45('0x55')](_0x1851c2,_0x5ba878,config['secrets'][_0x8b45('0x56')])[_0x8b45('0x23')](function(){return _0x446fe5;});}return _0x446fe5;}})[_0x8b45('0x23')](function(_0x9eacc1){if(_0x9eacc1){var _0x5795ca=path[_0x8b45('0x50')](config[_0x8b45('0x51')],_0x8b45('0x52'),_0x9eacc1[_0x8b45('0x4f')]);if(!fs['existsSync'](_0x5795ca)){throw new db[(_0x8b45('0x57'))][(_0x8b45('0x58'))](_0x8b45('0x59'));}if(_0x9eacc1[_0x8b45('0x5a')]){return _0x597402[_0x8b45('0x4d')](_0x5795ca,_0x9eacc1['filename']+path[_0x8b45('0x5b')](_0x5795ca),function(){if(_0x422da0){fs['unlink'](_0x5795ca);}});}else{return _0x597402[_0x8b45('0x4d')](_0x5795ca,function(_0x2f7ab0){if(_0x422da0){fs[_0x8b45('0x5c')](_0x5795ca);}});}}})[_0x8b45('0x43')](function(_0x6a77bd){if(_0x6a77bd[_0x8b45('0x5d')]==='ScreenRecording\x20not\x20found'){_0x597402['status'](0x194)[_0x8b45('0x27')](_0x8b45('0x5e'));}else{return handleError(_0x597402,null);}});};exports['destroy']=function(_0x461c83,_0x239330){return db[_0x8b45('0x40')]['find']({'where':{'id':_0x461c83['params']['id']}})[_0x8b45('0x23')](function(_0x8e5a41){if(_['isNil'](_0x8e5a41)){throw new ReferenceError(_0x8b45('0x5f'));}return _0x8e5a41;})['then'](function(_0xf1ab37){var _0x560c51=path['join'](config[_0x8b45('0x51')],_0x8b45('0x52'),_0xf1ab37['value']);logger[_0x8b45('0x60')](_0x8b45('0x61'),_0x560c51);if(!_[_0x8b45('0x62')](_0xf1ab37[_0x8b45('0x4f')])&&fs[_0x8b45('0x54')](_0x560c51)){logger['info'](_0x8b45('0x63')+_0x560c51+_0x8b45('0x64'));fs[_0x8b45('0x65')](_0x560c51);}_0x560c51=_0x560c51+'.cypher';if(!_['isNil'](_0xf1ab37[_0x8b45('0x4f')])&&fs['existsSync'](_0x560c51)){logger[_0x8b45('0x60')]('File:\x20\x22'+_0x560c51+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x560c51);}return _0xf1ab37;})[_0x8b45('0x23')](function(_0x4df581){if(!_0x4df581)throw new InternalError();return _0x4df581[_0x8b45('0x24')]();})[_0x8b45('0x23')](function(){_0x239330['status'](0xcc)[_0x8b45('0x18')]();})[_0x8b45('0x43')](handleError(_0x239330,null));}; \ No newline at end of file +var _0x7da7=['stack','name','send','index','map','ScreenRecording','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','filter','includeAll','findAll','rows','show','params','rawAttributes','options','find','create','body','duration','createdAt','value','catch','describe','download','../../components/encryptor','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','recording','join','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','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/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','json','apply','reject','update','then','destroy','end','error'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7da7,0x10d));var _0x77da=function(_0x3f6e26,_0x811a34){_0x3f6e26=_0x3f6e26-0x0;var _0x474345=_0x7da7[_0x3f6e26];return _0x474345;};'use strict';var emlformat=require(_0x77da('0x0'));var rimraf=require(_0x77da('0x1'));var zipdir=require(_0x77da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x77da('0x3'));var BPromise=require(_0x77da('0x4'));var Mustache=require('mustache');var util=require(_0x77da('0x5'));var path=require(_0x77da('0x6'));var sox=require('sox');var csv=require(_0x77da('0x7'));var ejs=require(_0x77da('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x7'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var Redis=require(_0x77da('0xe'));var authService=require(_0x77da('0xf'));var qs=require(_0x77da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77da('0x11'));var logger=require(_0x77da('0x12'))(_0x77da('0x13'));var utils=require(_0x77da('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x77da('0x15'));var db=require(_0x77da('0x16'))['db'];function respondWithStatusCode(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xcc;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0x17')](_0x5d6e2f);}return _0x2acc65[_0x77da('0x18')](_0x5d6e2f)['end']();};}function respondWithResult(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0xc8;return function(_0x355719){if(_0x355719){return _0x3b0ff2[_0x77da('0x18')](_0x369df0)['json'](_0x355719);}};}function respondWithFilteredResult(_0x2172d0,_0x4e130c){return function(_0x29cd7b){if(_0x29cd7b){var _0x366443=typeof _0x4e130c[_0x77da('0x19')]===_0x77da('0x1a')&&typeof _0x4e130c['limit']==='undefined';var _0x514016=_0x29cd7b['count'];var _0x103e46=_0x366443?0x0:_0x4e130c[_0x77da('0x19')];var _0x289887=_0x366443?_0x29cd7b[_0x77da('0x1b')]:_0x4e130c[_0x77da('0x19')]+_0x4e130c[_0x77da('0x1c')];var _0x1d325c;if(_0x289887>=_0x514016){_0x289887=_0x514016;_0x1d325c=0xc8;}else{_0x1d325c=0xce;}_0x2172d0[_0x77da('0x18')](_0x1d325c);return _0x2172d0['set']('Content-Range',_0x103e46+'-'+_0x289887+'/'+_0x514016)[_0x77da('0x1d')](_0x29cd7b);}return null;};}function patchUpdates(_0x4d1512){return function(_0x507979){try{jsonpatch[_0x77da('0x1e')](_0x507979,_0x4d1512,!![]);}catch(_0x304a2b){return BPromise[_0x77da('0x1f')](_0x304a2b);}return _0x507979['save']();};}function saveUpdates(_0x58270c,_0x3e6cfe){return function(_0x58f6c1){if(_0x58f6c1){return _0x58f6c1[_0x77da('0x20')](_0x58270c)[_0x77da('0x21')](function(_0xc52f0e){return _0xc52f0e;});}return null;};}function removeEntity(_0x27b6c7,_0x10399a){return function(_0x270318){if(_0x270318){return _0x270318[_0x77da('0x22')]()['then'](function(){_0x27b6c7['status'](0xcc)[_0x77da('0x23')]();});}};}function handleEntityNotFound(_0x2d009f,_0x835167){return function(_0xbd06b7){if(!_0xbd06b7){_0x2d009f['sendStatus'](0x194);}return _0xbd06b7;};}function handleError(_0x42240b,_0x167240){_0x167240=_0x167240||0x1f4;return function(_0x470c9f){logger[_0x77da('0x24')](_0x470c9f[_0x77da('0x25')]);if(_0x470c9f['name']){delete _0x470c9f[_0x77da('0x26')];}_0x42240b[_0x77da('0x18')](_0x167240)[_0x77da('0x27')](_0x470c9f);};}exports[_0x77da('0x28')]=function(_0x496ecd,_0x5b4638){var _0x4d395a={},_0x2258e9={},_0x30456a={'count':0x0,'rows':[]};var _0x410d09=_[_0x77da('0x29')](db[_0x77da('0x2a')]['rawAttributes'],function(_0x350b4e){return{'name':_0x350b4e[_0x77da('0x2b')],'type':_0x350b4e[_0x77da('0x2c')][_0x77da('0x2d')]};});_0x2258e9[_0x77da('0x2e')]=_[_0x77da('0x2f')](_['map'](_0x410d09,_0x77da('0x26')),[_0x77da('0x30')]);_0x2258e9[_0x77da('0x31')]=_[_0x77da('0x32')](_0x496ecd[_0x77da('0x31')]);_0x2258e9[_0x77da('0x33')]=_[_0x77da('0x34')](_0x2258e9[_0x77da('0x2e')],_0x2258e9['query']);_0x4d395a['attributes']=_[_0x77da('0x34')](_0x2258e9[_0x77da('0x2e')],qs['fields'](_0x496ecd[_0x77da('0x31')][_0x77da('0x35')]));_0x4d395a[_0x77da('0x36')]=_0x4d395a[_0x77da('0x36')][_0x77da('0x37')]?_0x4d395a[_0x77da('0x36')]:_0x2258e9[_0x77da('0x2e')];if(!_0x496ecd['query'][_0x77da('0x38')]('nolimit')){_0x4d395a['limit']=qs['limit'](_0x496ecd[_0x77da('0x31')]['limit']);_0x4d395a[_0x77da('0x19')]=qs[_0x77da('0x19')](_0x496ecd[_0x77da('0x31')][_0x77da('0x19')]);}_0x4d395a[_0x77da('0x39')]=qs[_0x77da('0x3a')](_0x496ecd[_0x77da('0x31')]['sort']);_0x4d395a[_0x77da('0x3b')]=qs[_0x77da('0x33')](_[_0x77da('0x3c')](_0x496ecd[_0x77da('0x31')],_0x2258e9[_0x77da('0x33')]),_0x410d09);if(_0x496ecd[_0x77da('0x31')]['filter']){_0x4d395a[_0x77da('0x3b')]=_[_0x77da('0x3d')](_0x4d395a[_0x77da('0x3b')],{'$or':_['map'](_0x410d09,function(_0xc5f0b8){if(_0xc5f0b8['type']!=='VIRTUAL'){var _0x599e21={};_0x599e21[_0xc5f0b8['name']]={'$like':'%'+_0x496ecd[_0x77da('0x31')][_0x77da('0x3e')]+'%'};return _0x599e21;}})});}_0x4d395a=_[_0x77da('0x3d')]({},_0x4d395a,_0x496ecd['options']);var _0x21d337={'where':_0x4d395a['where']};return db[_0x77da('0x2a')]['count'](_0x21d337)[_0x77da('0x21')](function(_0xa19b50){_0x30456a[_0x77da('0x1b')]=_0xa19b50;if(_0x496ecd[_0x77da('0x31')][_0x77da('0x3f')]){_0x4d395a['include']=[{'all':!![]}];}return db[_0x77da('0x2a')][_0x77da('0x40')](_0x4d395a);})[_0x77da('0x21')](function(_0x2f14f4){_0x30456a[_0x77da('0x41')]=_0x2f14f4;return _0x30456a;})[_0x77da('0x21')](respondWithFilteredResult(_0x5b4638,_0x4d395a))['catch'](handleError(_0x5b4638,null));};exports[_0x77da('0x42')]=function(_0x2f0495,_0x21de41){var _0x2dfeca={'raw':![],'where':{'id':_0x2f0495[_0x77da('0x43')]['id']}},_0x7d11f9={};_0x7d11f9['model']=_[_0x77da('0x32')](db['ScreenRecording'][_0x77da('0x44')]);_0x7d11f9[_0x77da('0x31')]=_[_0x77da('0x32')](_0x2f0495['query']);_0x7d11f9[_0x77da('0x33')]=_[_0x77da('0x34')](_0x7d11f9[_0x77da('0x2e')],_0x7d11f9[_0x77da('0x31')]);_0x2dfeca[_0x77da('0x36')]=_[_0x77da('0x34')](_0x7d11f9[_0x77da('0x2e')],qs[_0x77da('0x35')](_0x2f0495[_0x77da('0x31')]['fields']));_0x2dfeca[_0x77da('0x36')]=_0x2dfeca[_0x77da('0x36')][_0x77da('0x37')]?_0x2dfeca[_0x77da('0x36')]:_0x7d11f9[_0x77da('0x2e')];if(_0x2f0495[_0x77da('0x31')]['includeAll']){_0x2dfeca['include']=[{'all':!![]}];}_0x2dfeca=_[_0x77da('0x3d')]({},_0x2dfeca,_0x2f0495[_0x77da('0x45')]);return db[_0x77da('0x2a')][_0x77da('0x46')](_0x2dfeca)[_0x77da('0x21')](handleEntityNotFound(_0x21de41,null))[_0x77da('0x21')](respondWithResult(_0x21de41,null))['catch'](handleError(_0x21de41,null));};exports[_0x77da('0x47')]=function(_0x357ee4,_0x332f80){return db[_0x77da('0x2a')]['create'](_0x357ee4[_0x77da('0x48')],{})['then'](respondWithResult(_0x332f80,0xc9))['catch'](handleError(_0x332f80,null));};exports[_0x77da('0x20')]=function(_0x176f01,_0x143a68){if(_0x176f01[_0x77da('0x48')]['id']){delete _0x176f01['body']['id'];}delete _0x176f01[_0x77da('0x48')][_0x77da('0x49')];delete _0x176f01['body'][_0x77da('0x4a')];delete _0x176f01[_0x77da('0x48')]['closedAt'];delete _0x176f01[_0x77da('0x48')][_0x77da('0x4b')];return db[_0x77da('0x2a')][_0x77da('0x46')]({'where':{'id':_0x176f01[_0x77da('0x43')]['id']}})[_0x77da('0x21')](handleEntityNotFound(_0x143a68,null))[_0x77da('0x21')](saveUpdates(_0x176f01[_0x77da('0x48')],null))[_0x77da('0x21')](respondWithResult(_0x143a68,null))[_0x77da('0x4c')](handleError(_0x143a68,null));};exports['describe']=function(_0x3d04a3,_0x513017){return db[_0x77da('0x2a')][_0x77da('0x4d')]()[_0x77da('0x21')](respondWithResult(_0x513017,null))[_0x77da('0x4c')](handleError(_0x513017,null));};exports[_0x77da('0x4e')]=function(_0x8b377d,_0x3a78d2,_0x4c271d){var _0x17ed71=require(_0x77da('0x4f'));var _0x1a7115=![];var _0x353be9={};if(_0x8b377d['query'][_0x77da('0x2c')]&&_0x8b377d[_0x77da('0x31')][_0x77da('0x2c')]==='uniqueid'){_0x353be9['uniqueid']=_0x8b377d[_0x77da('0x43')]['id'];}else{_0x353be9['id']=_0x8b377d[_0x77da('0x43')]['id'];}return db[_0x77da('0x2a')][_0x77da('0x46')]({'where':_0x353be9,'attributes':['id',_0x77da('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x3a78d2,null))['then'](function(_0x365e91){if(_0x365e91){var _0x36f161=path['join'](config[_0x77da('0x50')],_0x77da('0x51'),_0x365e91[_0x77da('0x4b')]);var _0x4b1515=util[_0x77da('0x30')](_0x77da('0x52'),_0x36f161);if(fs['existsSync'](_0x4b1515)){_0x1a7115=!![];return _0x17ed71[_0x77da('0x53')](_0x4b1515,_0x36f161,config[_0x77da('0x54')][_0x77da('0x55')])[_0x77da('0x21')](function(){return _0x365e91;});}return _0x365e91;}})[_0x77da('0x21')](function(_0x99ac27){if(_0x99ac27){var _0x1dc4ab=path[_0x77da('0x56')](config[_0x77da('0x50')],'server/files/screen_recordings',_0x99ac27[_0x77da('0x4b')]);if(!fs[_0x77da('0x57')](_0x1dc4ab)){throw new db[(_0x77da('0x58'))][(_0x77da('0x59'))](_0x77da('0x5a'));}if(_0x99ac27[_0x77da('0x5b')]){return _0x3a78d2['download'](_0x1dc4ab,_0x99ac27[_0x77da('0x5b')]+path[_0x77da('0x5c')](_0x1dc4ab),function(){if(_0x1a7115){fs[_0x77da('0x5d')](_0x1dc4ab);}});}else{return _0x3a78d2['download'](_0x1dc4ab,function(_0x3e5dd9){if(_0x1a7115){fs[_0x77da('0x5d')](_0x1dc4ab);}});}}})[_0x77da('0x4c')](function(_0x8592c7){if(_0x8592c7[_0x77da('0x5e')]===_0x77da('0x5a')){_0x3a78d2[_0x77da('0x18')](0x194)['send'](_0x77da('0x5f'));}else{return handleError(_0x3a78d2,null);}});};exports['destroy']=function(_0x211310,_0x1922ab){return db[_0x77da('0x2a')]['find']({'where':{'id':_0x211310[_0x77da('0x43')]['id']}})[_0x77da('0x21')](function(_0x282481){if(_[_0x77da('0x60')](_0x282481)){throw new ReferenceError('Entity\x20not\x20found');}return _0x282481;})['then'](function(_0x571b1b){var _0x6b74fd=path[_0x77da('0x56')](config[_0x77da('0x50')],_0x77da('0x51'),_0x571b1b[_0x77da('0x4b')]);logger[_0x77da('0x61')](_0x77da('0x62'),_0x6b74fd);if(!_[_0x77da('0x60')](_0x571b1b[_0x77da('0x4b')])&&fs[_0x77da('0x57')](_0x6b74fd)){logger['info'](_0x77da('0x63')+_0x6b74fd+_0x77da('0x64'));fs['unlinkSync'](_0x6b74fd);}_0x6b74fd=_0x6b74fd+'.cypher';if(!_[_0x77da('0x60')](_0x571b1b['value'])&&fs[_0x77da('0x57')](_0x6b74fd)){logger[_0x77da('0x61')](_0x77da('0x63')+_0x6b74fd+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x77da('0x65')](_0x6b74fd);}return _0x571b1b;})[_0x77da('0x21')](function(_0x27fc45){if(!_0x27fc45)throw new InternalError();return _0x27fc45[_0x77da('0x22')]();})[_0x77da('0x21')](function(){_0x1922ab['status'](0xcc)[_0x77da('0x23')]();})[_0x77da('0x4c')](handleError(_0x1922ab,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 3a751ac..ff5f13a 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 _0x16db=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','screen_recordings','interactionid','lodash'];(function(_0x3bcdef,_0x38fd54){var _0x2f6c23=function(_0x450c81){while(--_0x450c81){_0x3bcdef['push'](_0x3bcdef['shift']());}};_0x2f6c23(++_0x38fd54);}(_0x16db,0x1e0));var _0xb16d=function(_0x512490,_0x474d3d){_0x512490=_0x512490-0x0;var _0x4cf8e4=_0x16db[_0x512490];return _0x4cf8e4;};'use strict';var _=require(_0xb16d('0x0'));var util=require(_0xb16d('0x1'));var logger=require(_0xb16d('0x2'))(_0xb16d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb16d('0x4'));var fs=require('fs');var path=require(_0xb16d('0x5'));var rimraf=require(_0xb16d('0x6'));var config=require(_0xb16d('0x7'));var attributes=require(_0xb16d('0x8'));module[_0xb16d('0x9')]=function(_0x5df0a5,_0x2d8949){return _0x5df0a5[_0xb16d('0xa')]('ScreenRecording',attributes,{'tableName':_0xb16d('0xb'),'paranoid':![],'indexes':[{'name':_0xb16d('0xc'),'fields':[_0xb16d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8490=['moment','bluebird','path','rimraf','./screenRecording.attributes','exports','ScreenRecording','screen_recordings','interactionid','lodash','../../config/logger','api'];(function(_0x35d111,_0x3a6e61){var _0x47e7d2=function(_0x4ea6a9){while(--_0x4ea6a9){_0x35d111['push'](_0x35d111['shift']());}};_0x47e7d2(++_0x3a6e61);}(_0x8490,0xf9));var _0x0849=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x8490[_0x344a3f];return _0x264712;};'use strict';var _=require(_0x0849('0x0'));var util=require('util');var logger=require(_0x0849('0x1'))(_0x0849('0x2'));var moment=require(_0x0849('0x3'));var BPromise=require(_0x0849('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0849('0x5'));var rimraf=require(_0x0849('0x6'));var config=require('../../config/environment');var attributes=require(_0x0849('0x7'));module[_0x0849('0x8')]=function(_0x2f485a,_0x5b5764){return _0x2f485a['define'](_0x0849('0x9'),attributes,{'tableName':_0x0849('0xa'),'paranoid':![],'indexes':[{'name':_0x0849('0xb'),'fields':[_0x0849('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 8b4b5df..52b2b16 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 _0x12aa=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x8dc04d,_0xaa7559){var _0x2f5f28=function(_0xdd2d1d){while(--_0xdd2d1d){_0x8dc04d['push'](_0x8dc04d['shift']());}};_0x2f5f28(++_0xaa7559);}(_0x12aa,0x126));var _0xa12a=function(_0x75c6dc,_0x340564){_0x75c6dc=_0x75c6dc-0x0;var _0x292035=_0x12aa[_0x75c6dc];return _0x292035;};'use strict';var _=require(_0xa12a('0x0'));var util=require('util');var moment=require(_0xa12a('0x1'));var BPromise=require(_0xa12a('0x2'));var rs=require(_0xa12a('0x3'));var fs=require('fs');var Redis=require(_0xa12a('0x4'));var db=require(_0xa12a('0x5'))['db'];var utils=require(_0xa12a('0x6'));var logger=require(_0xa12a('0x7'))(_0xa12a('0x8'));var config=require(_0xa12a('0x9'));var jayson=require(_0xa12a('0xa'));var client=jayson['client'][_0xa12a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc923e8,_0xd6ad8c,_0x2d123d){return new BPromise(function(_0x4f8c84,_0x3208f4){return client[_0xa12a('0xc')](_0xc923e8,_0x2d123d)[_0xa12a('0xd')](function(_0x1ab0cf){logger['info'](_0xa12a('0xe'),_0xd6ad8c,_0xa12a('0xf'));logger[_0xa12a('0x10')](_0xa12a('0x11'),_0xd6ad8c,_0xa12a('0xf'),JSON[_0xa12a('0x12')](_0x1ab0cf));if(_0x1ab0cf['error']){if(_0x1ab0cf[_0xa12a('0x13')][_0xa12a('0x14')]===0x1f4){logger[_0xa12a('0x13')]('ScreenRecording,\x20%s,\x20%s',_0xd6ad8c,_0x1ab0cf['error'][_0xa12a('0x15')]);return _0x3208f4(_0x1ab0cf['error'][_0xa12a('0x15')]);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0xd6ad8c,_0x1ab0cf[_0xa12a('0x13')][_0xa12a('0x15')]);return _0x4f8c84(_0x1ab0cf[_0xa12a('0x13')]['message']);}else{logger[_0xa12a('0x16')]('ScreenRecording,\x20%s,\x20%s',_0xd6ad8c,'request\x20sent');_0x4f8c84(_0x1ab0cf['result'][_0xa12a('0x15')]);}})['catch'](function(_0x3bfdd5){logger['error'](_0xa12a('0xe'),_0xd6ad8c,_0x3bfdd5);_0x3208f4(_0x3bfdd5);});});} \ No newline at end of file +var _0x59f1=['../../config/environment','client','http','request','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x1c2d28,_0x1e4edb){var _0x534e34=function(_0x41f7eb){while(--_0x41f7eb){_0x1c2d28['push'](_0x1c2d28['shift']());}};_0x534e34(++_0x1e4edb);}(_0x59f1,0x101));var _0x159f=function(_0x270ea4,_0x27a6ff){_0x270ea4=_0x270ea4-0x0;var _0x1f850c=_0x59f1[_0x270ea4];return _0x1f850c;};'use strict';var _=require(_0x159f('0x0'));var util=require(_0x159f('0x1'));var moment=require(_0x159f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x159f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x159f('0x4'));var logger=require(_0x159f('0x5'))(_0x159f('0x6'));var config=require(_0x159f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x159f('0x8')][_0x159f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x454063,_0x3665eb,_0x2b8c35){return new BPromise(function(_0x58df1e,_0x5a8bdc){return client[_0x159f('0xa')](_0x454063,_0x2b8c35)['then'](function(_0x49ca5d){logger[_0x159f('0xb')](_0x159f('0xc'),_0x3665eb,_0x159f('0xd'));logger[_0x159f('0xe')](_0x159f('0xf'),_0x3665eb,_0x159f('0xd'),JSON[_0x159f('0x10')](_0x49ca5d));if(_0x49ca5d[_0x159f('0x11')]){if(_0x49ca5d[_0x159f('0x11')][_0x159f('0x12')]===0x1f4){logger['error'](_0x159f('0xc'),_0x3665eb,_0x49ca5d[_0x159f('0x11')][_0x159f('0x13')]);return _0x5a8bdc(_0x49ca5d['error'][_0x159f('0x13')]);}logger[_0x159f('0x11')](_0x159f('0xc'),_0x3665eb,_0x49ca5d[_0x159f('0x11')]['message']);return _0x58df1e(_0x49ca5d[_0x159f('0x11')][_0x159f('0x13')]);}else{logger[_0x159f('0xb')](_0x159f('0xc'),_0x3665eb,_0x159f('0xd'));_0x58df1e(_0x49ca5d[_0x159f('0x14')]['message']);}})[_0x159f('0x15')](function(_0x48835b){logger['error'](_0x159f('0xc'),_0x3665eb,_0x48835b);_0x5a8bdc(_0x48835b);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 73e0852..0cbda03 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 _0x0c37=['format','logo','extname','post','single','file','addLogo','diskStorage','join','root','server/files/images/logos/','%s%s','originalname','addLogoLogin','preferred','/:id/preferred','addPreferred','favicon','put','/:id','update','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','getDate','show','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','getPreferred'];(function(_0x122ae9,_0x5092de){var _0x26fd52=function(_0x26b758){while(--_0x26b758){_0x122ae9['push'](_0x122ae9['shift']());}};_0x26fd52(++_0x5092de);}(_0x0c37,0x111));var _0x70c3=function(_0x5c2935,_0x57a86e){_0x5c2935=_0x5c2935-0x0;var _0x29fd1d=_0x0c37[_0x5c2935];return _0x29fd1d;};'use strict';var multer=require(_0x70c3('0x0'));var util=require(_0x70c3('0x1'));var path=require(_0x70c3('0x2'));var timeout=require('connect-timeout');var express=require(_0x70c3('0x3'));var router=express[_0x70c3('0x4')]();var fs_extra=require(_0x70c3('0x5'));var auth=require(_0x70c3('0x6'));var interaction=require(_0x70c3('0x7'));var config=require(_0x70c3('0x8'));var controller=require(_0x70c3('0x9'));router[_0x70c3('0xa')]('/',auth[_0x70c3('0xb')](),controller[_0x70c3('0xc')]);router['get']('/now',controller[_0x70c3('0xd')]);router[_0x70c3('0xa')]('/:id',controller[_0x70c3('0xe')]);router['get'](_0x70c3('0xf'),controller['getLogo']);router['get'](_0x70c3('0x10'),controller[_0x70c3('0x11')]);router[_0x70c3('0xa')](_0x70c3('0x12'),controller[_0x70c3('0x13')]);router[_0x70c3('0xa')]('/:id/preferred',controller[_0x70c3('0x14')]);router[_0x70c3('0xa')]('/:id/favicon',controller['getFavicon']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2a4ff7,_0x13d620,_0x14f4bc){_0x14f4bc(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x3e9b64,_0x450e36,_0x20a897){_0x20a897(null,util[_0x70c3('0x15')]('%s%s',_0x70c3('0x16'),path[_0x70c3('0x17')](_0x450e36['originalname'])));}})});router[_0x70c3('0x18')](_0x70c3('0xf'),upload[_0x70c3('0x19')](_0x70c3('0x1a')),controller[_0x70c3('0x1b')]);var upload=multer({'storage':multer[_0x70c3('0x1c')]({'destination':function(_0x416333,_0x57a1c7,_0x27e5f7){_0x27e5f7(null,path[_0x70c3('0x1d')](config[_0x70c3('0x1e')],_0x70c3('0x1f')));},'filename':function(_0x485fd3,_0x213068,_0xfcfe4b){_0xfcfe4b(null,util[_0x70c3('0x15')](_0x70c3('0x20'),'logologin',path[_0x70c3('0x17')](_0x213068[_0x70c3('0x21')])));}})});router[_0x70c3('0x18')](_0x70c3('0x10'),upload[_0x70c3('0x19')](_0x70c3('0x1a')),controller[_0x70c3('0x22')]);var upload=multer({'storage':multer[_0x70c3('0x1c')]({'destination':function(_0x2b7526,_0x4566c5,_0x376779){_0x376779(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x314675,_0x44919f,_0x594791){_0x594791(null,util[_0x70c3('0x15')](_0x70c3('0x20'),_0x70c3('0x23'),path[_0x70c3('0x17')](_0x44919f['originalname'])));}})});router[_0x70c3('0x18')](_0x70c3('0x24'),upload[_0x70c3('0x19')](_0x70c3('0x1a')),controller[_0x70c3('0x25')]);var upload=multer({'storage':multer[_0x70c3('0x1c')]({'destination':function(_0x210409,_0x219122,_0x1e8117){_0x1e8117(null,path['join'](config['root'],_0x70c3('0x1f')));},'filename':function(_0x5965c2,_0x4a15b2,_0x4d781e){_0x4d781e(null,util[_0x70c3('0x15')](_0x70c3('0x20'),_0x70c3('0x26'),path[_0x70c3('0x17')](_0x4a15b2[_0x70c3('0x21')])));}})});router[_0x70c3('0x18')]('/:id/favicon',upload[_0x70c3('0x19')](_0x70c3('0x1a')),controller['addFavicon']);router[_0x70c3('0x27')](_0x70c3('0x28'),auth[_0x70c3('0xb')](),controller[_0x70c3('0x29')]);module['exports']=router; \ No newline at end of file +var _0xebb9=['getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','getPreferred','/:id/favicon','diskStorage','join','server/files/images/logos/','format','%s%s','logo','originalname','post','single','addLogo','logologin','extname','root','preferred','file','addPreferred','favicon','addFavicon','put','update','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo'];(function(_0x3c0ddb,_0x558df3){var _0x2e38d7=function(_0x1ca705){while(--_0x1ca705){_0x3c0ddb['push'](_0x3c0ddb['shift']());}};_0x2e38d7(++_0x558df3);}(_0xebb9,0x9d));var _0x9ebb=function(_0x2c1a27,_0x4cd2d9){_0x2c1a27=_0x2c1a27-0x0;var _0x58a7f7=_0xebb9[_0x2c1a27];return _0x58a7f7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9ebb('0x0'));var timeout=require('connect-timeout');var express=require(_0x9ebb('0x1'));var router=express[_0x9ebb('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x9ebb('0x3'));var interaction=require(_0x9ebb('0x4'));var config=require(_0x9ebb('0x5'));var controller=require(_0x9ebb('0x6'));router[_0x9ebb('0x7')]('/',auth[_0x9ebb('0x8')](),controller[_0x9ebb('0x9')]);router['get'](_0x9ebb('0xa'),controller[_0x9ebb('0xb')]);router[_0x9ebb('0x7')](_0x9ebb('0xc'),controller[_0x9ebb('0xd')]);router[_0x9ebb('0x7')](_0x9ebb('0xe'),controller[_0x9ebb('0xf')]);router[_0x9ebb('0x7')](_0x9ebb('0x10'),controller[_0x9ebb('0x11')]);router[_0x9ebb('0x7')](_0x9ebb('0x12'),controller['gdpr']);router[_0x9ebb('0x7')](_0x9ebb('0x13'),controller[_0x9ebb('0x14')]);router[_0x9ebb('0x7')](_0x9ebb('0x15'),controller['getFavicon']);var upload=multer({'storage':multer[_0x9ebb('0x16')]({'destination':function(_0x2e4190,_0x124c30,_0x4a170a){_0x4a170a(null,path[_0x9ebb('0x17')](config['root'],_0x9ebb('0x18')));},'filename':function(_0x561597,_0xa5ac84,_0x5e9ab8){_0x5e9ab8(null,util[_0x9ebb('0x19')](_0x9ebb('0x1a'),_0x9ebb('0x1b'),path['extname'](_0xa5ac84[_0x9ebb('0x1c')])));}})});router[_0x9ebb('0x1d')]('/:id/logo',upload[_0x9ebb('0x1e')]('file'),controller[_0x9ebb('0x1f')]);var upload=multer({'storage':multer[_0x9ebb('0x16')]({'destination':function(_0x5d46b8,_0x4163e0,_0x54acd3){_0x54acd3(null,path[_0x9ebb('0x17')](config['root'],_0x9ebb('0x18')));},'filename':function(_0x37c2b8,_0x518e31,_0x642eff){_0x642eff(null,util[_0x9ebb('0x19')](_0x9ebb('0x1a'),_0x9ebb('0x20'),path[_0x9ebb('0x21')](_0x518e31[_0x9ebb('0x1c')])));}})});router[_0x9ebb('0x1d')]('/:id/logo_login',upload['single']('file'),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x9ebb('0x16')]({'destination':function(_0xa27229,_0x49a61f,_0x8ac163){_0x8ac163(null,path[_0x9ebb('0x17')](config[_0x9ebb('0x22')],_0x9ebb('0x18')));},'filename':function(_0x4d4fe9,_0x3d8c07,_0x51f283){_0x51f283(null,util[_0x9ebb('0x19')]('%s%s',_0x9ebb('0x23'),path[_0x9ebb('0x21')](_0x3d8c07[_0x9ebb('0x1c')])));}})});router[_0x9ebb('0x1d')]('/:id/preferred',upload['single'](_0x9ebb('0x24')),controller[_0x9ebb('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1521c7,_0x4c2a3d,_0x361945){_0x361945(null,path[_0x9ebb('0x17')](config[_0x9ebb('0x22')],_0x9ebb('0x18')));},'filename':function(_0x3b61b7,_0x5910b9,_0x958c6b){_0x958c6b(null,util[_0x9ebb('0x19')]('%s%s',_0x9ebb('0x26'),path[_0x9ebb('0x21')](_0x5910b9['originalname'])));}})});router['post'](_0x9ebb('0x15'),upload[_0x9ebb('0x1e')](_0x9ebb('0x24')),controller[_0x9ebb('0x27')]);router[_0x9ebb('0x28')](_0x9ebb('0xc'),auth['isAuthenticated'](),controller[_0x9ebb('0x29')]);module[_0x9ebb('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 629044a..e2f04b1 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 _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x34340d,_0x149c91){var _0x21c72c=function(_0x48cf01){while(--_0x48cf01){_0x34340d['push'](_0x34340d['shift']());}};_0x21c72c(++_0x149c91);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x7fc629,_0x2b1b7c){var _0x5e395d=function(_0x18bc8d){while(--_0x18bc8d){_0x7fc629['push'](_0x7fc629['shift']());}};_0x5e395d(++_0x2b1b7c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 2cb0877..f26093e 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 _0xba0b=['ValidationError','getLogoLogin','server/files/images/logos','default_loginLogo.svg','\x20not\x20found','download','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','custom','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','name','send','map','rawAttributes','fieldName','type','key','keys','filters','model','query','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','Setting','show','params','intersection','includeAll','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','Sequelize'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0xba0b,0x110));var _0xbba0=function(_0x561876,_0x47c415){_0x561876=_0x561876-0x0;var _0x261b6e=_0xba0b[_0x561876];return _0x261b6e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbba0('0x0'));var rp=require(_0xbba0('0x1'));var moment=require(_0xbba0('0x2'));var BPromise=require(_0xbba0('0x3'));var Mustache=require('mustache');var util=require(_0xbba0('0x4'));var path=require(_0xbba0('0x5'));var sox=require(_0xbba0('0x6'));var csv=require(_0xbba0('0x7'));var ejs=require(_0xbba0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbba0('0x9'));var squel=require(_0xbba0('0xa'));var crypto=require(_0xbba0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xbba0('0xc'));var toCsv=require(_0xbba0('0x7'));var querystring=require(_0xbba0('0xd'));var Papa=require(_0xbba0('0xe'));var Redis=require(_0xbba0('0xf'));var authService=require(_0xbba0('0x10'));var qs=require(_0xbba0('0x11'));var as=require(_0xbba0('0x12'));var hardwareService=require(_0xbba0('0x13'));var logger=require(_0xbba0('0x14'))('api');var utils=require(_0xbba0('0x15'));var config=require(_0xbba0('0x16'));var licenseUtil=require(_0xbba0('0x17'));var db=require(_0xbba0('0x18'))['db'];var jayson=require(_0xbba0('0x19'));var client=jayson[_0xbba0('0x1a')][_0xbba0('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x4ead37,_0x211e23,_0x471c96,_0x35b772){return new BPromise(function(_0x1adde6,_0x9f5953){var _0x4d3570=_0x35b772||client;return _0x4d3570['request'](_0x4ead37,_0x471c96)[_0xbba0('0x1c')](function(_0x5be445){logger[_0xbba0('0x1d')]('Setting,\x20%s,\x20%s',_0x211e23,_0xbba0('0x1e'));logger[_0xbba0('0x1f')](_0xbba0('0x20'),_0x211e23,_0xbba0('0x1e'),JSON[_0xbba0('0x21')](_0x5be445));if(_0x5be445[_0xbba0('0x22')]){if(_0x5be445[_0xbba0('0x22')][_0xbba0('0x23')]===0x1f4){logger[_0xbba0('0x22')](_0xbba0('0x24'),_0x211e23,_0x5be445['error'][_0xbba0('0x25')]);return _0x9f5953(_0x5be445[_0xbba0('0x22')][_0xbba0('0x25')]);}logger['error'](_0xbba0('0x24'),_0x211e23,_0x5be445[_0xbba0('0x22')][_0xbba0('0x25')]);return _0x1adde6(_0x5be445[_0xbba0('0x22')]['message']);}else{logger[_0xbba0('0x1d')](_0xbba0('0x24'),_0x211e23,'request\x20sent');_0x1adde6(_0x5be445[_0xbba0('0x26')][_0xbba0('0x25')]);}})[_0xbba0('0x27')](function(_0x83dad7){logger[_0xbba0('0x22')](_0xbba0('0x24'),_0x211e23,_0x83dad7);_0x9f5953(_0x83dad7);});});}function respondWithStatusCode(_0x5f1a55,_0x5f05c3){_0x5f05c3=_0x5f05c3||0xcc;return function(_0x4496fa){if(_0x4496fa){return _0x5f1a55[_0xbba0('0x28')](_0x5f05c3);}return _0x5f1a55[_0xbba0('0x29')](_0x5f05c3)[_0xbba0('0x2a')]();};}function respondWithResult(_0x55a4d8,_0x5033cb){_0x5033cb=_0x5033cb||0xc8;return function(_0xa805e6){if(_0xa805e6){return _0x55a4d8['status'](_0x5033cb)[_0xbba0('0x2b')](_0xa805e6);}};}function respondWithFilteredResult(_0x381a9f,_0x4b637e){return function(_0x56e9a4){if(_0x56e9a4){var _0x2981ce=typeof _0x4b637e[_0xbba0('0x2c')]===_0xbba0('0x2d')&&typeof _0x4b637e[_0xbba0('0x2e')]===_0xbba0('0x2d');var _0x2f605c=_0x56e9a4[_0xbba0('0x2f')];var _0xd9bb34=_0x2981ce?0x0:_0x4b637e[_0xbba0('0x2c')];var _0x5c0b82=_0x2981ce?_0x56e9a4[_0xbba0('0x2f')]:_0x4b637e[_0xbba0('0x2c')]+_0x4b637e[_0xbba0('0x2e')];var _0x5e77c1;if(_0x5c0b82>=_0x2f605c){_0x5c0b82=_0x2f605c;_0x5e77c1=0xc8;}else{_0x5e77c1=0xce;}_0x381a9f[_0xbba0('0x29')](_0x5e77c1);return _0x381a9f[_0xbba0('0x30')](_0xbba0('0x31'),_0xd9bb34+'-'+_0x5c0b82+'/'+_0x2f605c)['json'](_0x56e9a4);}return null;};}function patchUpdates(_0x8c200){return function(_0x2a586a){try{jsonpatch[_0xbba0('0x32')](_0x2a586a,_0x8c200,!![]);}catch(_0x198b48){return BPromise[_0xbba0('0x33')](_0x198b48);}return _0x2a586a[_0xbba0('0x34')]();};}function saveUpdates(_0x507fb0,_0x39f528){return function(_0x13eee3){if(_0x13eee3){return _0x13eee3[_0xbba0('0x35')](_0x507fb0)[_0xbba0('0x1c')](function(_0x1c0cdd){return _0x1c0cdd;});}return null;};}function removeEntity(_0x39a9e8,_0x2ed26c){return function(_0x10362f){if(_0x10362f){return _0x10362f[_0xbba0('0x36')]()['then'](function(){_0x39a9e8['status'](0xcc)[_0xbba0('0x2a')]();});}};}function handleEntityNotFound(_0x44b562,_0x3da47c){return function(_0xd14516){if(!_0xd14516){_0x44b562[_0xbba0('0x28')](0x194);}return _0xd14516;};}function handleError(_0x3a43f4,_0x22fe8c){_0x22fe8c=_0x22fe8c||0x1f4;return function(_0x213948){logger[_0xbba0('0x22')](_0x213948['stack']);if(_0x213948['name']){delete _0x213948[_0xbba0('0x37')];}_0x3a43f4[_0xbba0('0x29')](_0x22fe8c)[_0xbba0('0x38')](_0x213948);};}exports['index']=function(_0x5dd177,_0x7e6d30){var _0x2538e7={},_0x1df5c3={},_0xc881cb={'count':0x0,'rows':[]};var _0xf61ef=_[_0xbba0('0x39')](db['Setting'][_0xbba0('0x3a')],function(_0x275758){return{'name':_0x275758[_0xbba0('0x3b')],'type':_0x275758[_0xbba0('0x3c')][_0xbba0('0x3d')]};});_0x1df5c3['model']=_[_0xbba0('0x39')](_0xf61ef,_0xbba0('0x37'));_0x1df5c3['query']=_[_0xbba0('0x3e')](_0x5dd177['query']);_0x1df5c3[_0xbba0('0x3f')]=_['intersection'](_0x1df5c3[_0xbba0('0x40')],_0x1df5c3[_0xbba0('0x41')]);_0x2538e7['attributes']=_['intersection'](_0x1df5c3[_0xbba0('0x40')],qs[_0xbba0('0x42')](_0x5dd177[_0xbba0('0x41')][_0xbba0('0x42')]));_0x2538e7['attributes']=_0x2538e7[_0xbba0('0x43')][_0xbba0('0x44')]?_0x2538e7[_0xbba0('0x43')]:_0x1df5c3['model'];if(!_0x5dd177['query'][_0xbba0('0x45')]('nolimit')){_0x2538e7[_0xbba0('0x2e')]=qs[_0xbba0('0x2e')](_0x5dd177['query']['limit']);_0x2538e7[_0xbba0('0x2c')]=qs[_0xbba0('0x2c')](_0x5dd177['query'][_0xbba0('0x2c')]);}_0x2538e7['order']=qs['sort'](_0x5dd177[_0xbba0('0x41')][_0xbba0('0x46')]);_0x2538e7[_0xbba0('0x47')]=qs[_0xbba0('0x3f')](_[_0xbba0('0x48')](_0x5dd177[_0xbba0('0x41')],_0x1df5c3[_0xbba0('0x3f')]),_0xf61ef);if(_0x5dd177[_0xbba0('0x41')][_0xbba0('0x49')]){_0x2538e7[_0xbba0('0x47')]=_[_0xbba0('0x4a')](_0x2538e7[_0xbba0('0x47')],{'$or':_[_0xbba0('0x39')](_0xf61ef,function(_0x38e4a4){if(_0x38e4a4[_0xbba0('0x3c')]!==_0xbba0('0x4b')){var _0x485167={};_0x485167[_0x38e4a4['name']]={'$like':'%'+_0x5dd177[_0xbba0('0x41')][_0xbba0('0x49')]+'%'};return _0x485167;}})});}_0x2538e7=_[_0xbba0('0x4a')]({},_0x2538e7,_0x5dd177[_0xbba0('0x4c')]);var _0x5d8989={'where':_0x2538e7['where']};return db['Setting'][_0xbba0('0x2f')](_0x5d8989)[_0xbba0('0x1c')](function(_0x46555e){_0xc881cb[_0xbba0('0x2f')]=_0x46555e;if(_0x5dd177[_0xbba0('0x41')]['includeAll']){_0x2538e7[_0xbba0('0x4d')]=[{'all':!![]}];}return db[_0xbba0('0x4e')]['findAll'](_0x2538e7);})[_0xbba0('0x1c')](function(_0x14dff0){_0xc881cb['rows']=_0x14dff0;return _0xc881cb;})['then'](respondWithFilteredResult(_0x7e6d30,_0x2538e7))['catch'](handleError(_0x7e6d30,null));};exports[_0xbba0('0x4f')]=function(_0x4841e6,_0x5a9b85){var _0x208931={'raw':![],'where':{'id':_0x4841e6[_0xbba0('0x50')]['id']}},_0x40a07d={};_0x40a07d[_0xbba0('0x40')]=_[_0xbba0('0x3e')](db[_0xbba0('0x4e')][_0xbba0('0x3a')]);_0x40a07d[_0xbba0('0x41')]=_[_0xbba0('0x3e')](_0x4841e6['query']);_0x40a07d[_0xbba0('0x3f')]=_[_0xbba0('0x51')](_0x40a07d[_0xbba0('0x40')],_0x40a07d[_0xbba0('0x41')]);_0x208931[_0xbba0('0x43')]=_[_0xbba0('0x51')](_0x40a07d[_0xbba0('0x40')],qs[_0xbba0('0x42')](_0x4841e6[_0xbba0('0x41')]['fields']));_0x208931[_0xbba0('0x43')]=_0x208931['attributes']['length']?_0x208931[_0xbba0('0x43')]:_0x40a07d[_0xbba0('0x40')];if(_0x4841e6['query'][_0xbba0('0x52')]){_0x208931[_0xbba0('0x4d')]=[{'all':!![]}];}_0x208931=_[_0xbba0('0x4a')]({},_0x208931,_0x4841e6[_0xbba0('0x4c')]);return db['Setting'][_0xbba0('0x53')](_0x208931)[_0xbba0('0x1c')](handleEntityNotFound(_0x5a9b85,null))[_0xbba0('0x1c')](respondWithResult(_0x5a9b85,null))[_0xbba0('0x27')](handleError(_0x5a9b85,null));};exports['update']=function(_0x38f0ae,_0x2a96ff){if(_0x38f0ae['body']['id']){delete _0x38f0ae[_0xbba0('0x54')]['id'];}return db['Setting'][_0xbba0('0x53')]({'where':{'id':_0x38f0ae[_0xbba0('0x50')]['id']}})[_0xbba0('0x1c')](handleEntityNotFound(_0x2a96ff,null))[_0xbba0('0x1c')](saveUpdates(_0x38f0ae[_0xbba0('0x54')],null))[_0xbba0('0x1c')](respondWithResult(_0x2a96ff,null))[_0xbba0('0x27')](handleError(_0x2a96ff,null));};exports[_0xbba0('0x55')]=function(_0x2ddc25,_0x51c0f8,_0xead49d){if(_0x2ddc25[_0xbba0('0x56')]&&_0x2ddc25['file'][_0xbba0('0x57')]){_0x2ddc25[_0xbba0('0x54')][_0xbba0('0x58')]=_0x2ddc25[_0xbba0('0x56')][_0xbba0('0x57')];}return db[_0xbba0('0x4e')]['find']({'where':{'id':_0x2ddc25[_0xbba0('0x50')]['id']}})[_0xbba0('0x1c')](handleEntityNotFound(_0x51c0f8,null))[_0xbba0('0x1c')](saveUpdates(_0x2ddc25[_0xbba0('0x54')],null))[_0xbba0('0x1c')](respondWithResult(_0x51c0f8,null))[_0xbba0('0x27')](handleError(_0x51c0f8,null));};exports[_0xbba0('0x59')]=function(_0x5901ae,_0x1cf7e0,_0x1cc421){if(_0x5901ae[_0xbba0('0x56')]&&_0x5901ae[_0xbba0('0x56')][_0xbba0('0x57')]){_0x5901ae[_0xbba0('0x54')][_0xbba0('0x5a')]=_0x5901ae[_0xbba0('0x56')]['filename'];}return db[_0xbba0('0x4e')]['find']({'where':{'id':_0x5901ae[_0xbba0('0x50')]['id']}})[_0xbba0('0x1c')](handleEntityNotFound(_0x1cf7e0,null))[_0xbba0('0x1c')](saveUpdates(_0x5901ae[_0xbba0('0x54')],null))[_0xbba0('0x1c')](respondWithResult(_0x1cf7e0,null))[_0xbba0('0x27')](handleError(_0x1cf7e0,null));};var utilLicense=require(_0xbba0('0x17'));exports['getLogo']=function(_0x4c2d5c,_0x4f8ee1,_0x19a65f){var _0x597a23='server/files/images/logos';var _0x1a892c={'custom':![]};return utilLicense[_0xbba0('0x5b')]()[_0xbba0('0x1c')](function(_0x390b96){if(_0x390b96){_0x1a892c=_0x390b96;}return db[_0xbba0('0x4e')]['find']({'where':{'id':_0x4c2d5c[_0xbba0('0x50')]['id']},'attributes':['logo','loginLogo',_0xbba0('0x5c'),_0xbba0('0x5d'),_0xbba0('0x5e'),_0xbba0('0x5f'),_0xbba0('0x60'),_0xbba0('0x61')],'raw':!![]});})[_0xbba0('0x1c')](handleEntityNotFound(_0x4f8ee1,null))[_0xbba0('0x1c')](function(_0x5cc766){if(_0x5cc766){var _0x536f86=_0x5cc766[_0xbba0('0x58')]&&fs[_0xbba0('0x62')](path[_0xbba0('0x63')](config[_0xbba0('0x64')],_0x597a23,_[_0xbba0('0x65')](_0x5cc766[_0xbba0('0x58')])))?path[_0xbba0('0x63')](config[_0xbba0('0x64')],_0x597a23,_[_0xbba0('0x65')](_0x5cc766[_0xbba0('0x58')])):path[_0xbba0('0x63')](config[_0xbba0('0x64')],_0x597a23,_[_0xbba0('0x65')](_0xbba0('0x66')));var _0x1a69e5=_0xbba0('0x67')+_[_0xbba0('0x68')](_0xbba0('0x58'));if(_0x5cc766[_0x1a69e5]||!_0x1a892c['custom']){_0x536f86=path['join'](config[_0xbba0('0x64')],_0x597a23,_[_0xbba0('0x65')](_0xbba0('0x66')));}if(!fs[_0xbba0('0x62')](_0x536f86)){throw new db[(_0xbba0('0x69'))][(_0xbba0('0x6a'))](_[_0xbba0('0x68')](_0xbba0('0x58'))+'\x20not\x20found');}return _0x4f8ee1['download'](_0x536f86);}})[_0xbba0('0x27')](handleError(_0x4f8ee1,null));};var utilLicense=require(_0xbba0('0x17'));exports[_0xbba0('0x6b')]=function(_0x76f4ff,_0x25354d,_0x4b2b47){var _0x1ff926=_0xbba0('0x6c');var _0x273b9f={'custom':![]};return utilLicense[_0xbba0('0x5b')]()['then'](function(_0x108348){if(_0x108348){_0x273b9f=_0x108348;}return db[_0xbba0('0x4e')][_0xbba0('0x53')]({'where':{'id':_0x76f4ff[_0xbba0('0x50')]['id']},'attributes':[_0xbba0('0x58'),_0xbba0('0x5a'),_0xbba0('0x5c'),_0xbba0('0x5d'),_0xbba0('0x5e'),_0xbba0('0x5f'),_0xbba0('0x60'),_0xbba0('0x61')],'raw':!![]});})['then'](handleEntityNotFound(_0x25354d,null))[_0xbba0('0x1c')](function(_0x4ae8f7){if(_0x4ae8f7){var _0x3a836f=_0x4ae8f7[_0xbba0('0x5a')]&&fs[_0xbba0('0x62')](path[_0xbba0('0x63')](config[_0xbba0('0x64')],_0x1ff926,_['toLower'](_0x4ae8f7[_0xbba0('0x5a')])))?path[_0xbba0('0x63')](config[_0xbba0('0x64')],_0x1ff926,_[_0xbba0('0x65')](_0x4ae8f7[_0xbba0('0x5a')])):path[_0xbba0('0x63')](config[_0xbba0('0x64')],_0x1ff926,_['toLower'](_0xbba0('0x6d')));var _0x5707eb='default'+_[_0xbba0('0x68')]('loginLogo');if(_0x4ae8f7[_0x5707eb]||!_0x273b9f['custom']){_0x3a836f=path[_0xbba0('0x63')](config[_0xbba0('0x64')],_0x1ff926,_[_0xbba0('0x65')]('default_loginLogo.svg'));}if(!fs[_0xbba0('0x62')](_0x3a836f)){throw new db[(_0xbba0('0x69'))][(_0xbba0('0x6a'))](_[_0xbba0('0x68')](_0xbba0('0x5a'))+_0xbba0('0x6e'));}return _0x25354d[_0xbba0('0x6f')](_0x3a836f);}})['catch'](handleError(_0x25354d,null));};exports[_0xbba0('0x70')]=function(_0xfe140c,_0xc1207a){return db[_0xbba0('0x4e')][_0xbba0('0x53')]({'where':{'id':_0xfe140c[_0xbba0('0x50')]['id']},'attributes':[_0xbba0('0x71')]})[_0xbba0('0x1c')](respondWithResult(_0xc1207a,null))[_0xbba0('0x27')](handleError(_0xc1207a,null));};exports[_0xbba0('0x72')]=function(_0x3351c0,_0x443c8c,_0x46cc7e){if(_0x3351c0[_0xbba0('0x56')]&&_0x3351c0['file'][_0xbba0('0x57')]){_0x3351c0[_0xbba0('0x54')][_0xbba0('0x5c')]=_0x3351c0['file'][_0xbba0('0x57')];}return db[_0xbba0('0x4e')][_0xbba0('0x53')]({'where':{'id':_0x3351c0[_0xbba0('0x50')]['id']}})[_0xbba0('0x1c')](handleEntityNotFound(_0x443c8c,null))[_0xbba0('0x1c')](saveUpdates(_0x3351c0[_0xbba0('0x54')],null))['then'](respondWithResult(_0x443c8c,null))[_0xbba0('0x27')](handleError(_0x443c8c,null));};var utilLicense=require(_0xbba0('0x17'));exports[_0xbba0('0x73')]=function(_0x153790,_0xc08ffc,_0x41efb3){var _0x46cb36=_0xbba0('0x6c');var _0x5437e3={'custom':![]};return utilLicense[_0xbba0('0x5b')]()[_0xbba0('0x1c')](function(_0x5dfa5d){if(_0x5dfa5d){_0x5437e3=_0x5dfa5d;}return db[_0xbba0('0x4e')][_0xbba0('0x53')]({'where':{'id':_0x153790[_0xbba0('0x50')]['id']},'attributes':[_0xbba0('0x58'),_0xbba0('0x5a'),_0xbba0('0x5c'),_0xbba0('0x5d'),'defaultLogo',_0xbba0('0x5f'),_0xbba0('0x60'),_0xbba0('0x61')],'raw':!![]});})[_0xbba0('0x1c')](handleEntityNotFound(_0xc08ffc,null))[_0xbba0('0x1c')](function(_0x4fc5e1){if(_0x4fc5e1){var _0x17301c=_0x4fc5e1[_0xbba0('0x5c')]&&fs[_0xbba0('0x62')](path[_0xbba0('0x63')](config[_0xbba0('0x64')],_0x46cb36,_[_0xbba0('0x65')](_0x4fc5e1['preferred'])))?path[_0xbba0('0x63')](config[_0xbba0('0x64')],_0x46cb36,_[_0xbba0('0x65')](_0x4fc5e1[_0xbba0('0x5c')])):path[_0xbba0('0x63')](config[_0xbba0('0x64')],_0x46cb36,_[_0xbba0('0x65')](_0xbba0('0x74')));var _0x224433=_0xbba0('0x67')+_[_0xbba0('0x68')]('preferred');if(_0x4fc5e1[_0x224433]||!_0x5437e3['custom']||!_0x5437e3[_0xbba0('0x5c')]){_0x17301c=path['join'](config[_0xbba0('0x64')],_0x46cb36,_[_0xbba0('0x65')](_0xbba0('0x74')));}if(!fs[_0xbba0('0x62')](_0x17301c)){throw new db[(_0xbba0('0x69'))][(_0xbba0('0x6a'))](_['upperFirst'](_0xbba0('0x5c'))+'\x20not\x20found');}return _0xc08ffc[_0xbba0('0x6f')](_0x17301c);}})[_0xbba0('0x27')](handleError(_0xc08ffc,null));};exports[_0xbba0('0x75')]=function(_0x356a28,_0x1ea2cf,_0x25a058){if(_0x356a28[_0xbba0('0x56')]&&_0x356a28[_0xbba0('0x56')][_0xbba0('0x57')]){_0x356a28[_0xbba0('0x54')][_0xbba0('0x5d')]=_0x356a28[_0xbba0('0x56')][_0xbba0('0x57')];}return db['Setting'][_0xbba0('0x53')]({'where':{'id':_0x356a28[_0xbba0('0x50')]['id']}})[_0xbba0('0x1c')](handleEntityNotFound(_0x1ea2cf,null))[_0xbba0('0x1c')](saveUpdates(_0x356a28['body'],null))[_0xbba0('0x1c')](respondWithResult(_0x1ea2cf,null))['catch'](handleError(_0x1ea2cf,null));};var utilLicense=require(_0xbba0('0x17'));exports[_0xbba0('0x76')]=function(_0x306d5a,_0x4a6a62,_0x1a2ff8){var _0x201c01=_0xbba0('0x6c');var _0x1c6c89={'custom':![]};return utilLicense[_0xbba0('0x5b')]()['then'](function(_0xd2c21c){if(_0xd2c21c){_0x1c6c89=_0xd2c21c;}return db[_0xbba0('0x4e')][_0xbba0('0x53')]({'where':{'id':_0x306d5a[_0xbba0('0x50')]['id']},'attributes':[_0xbba0('0x58'),_0xbba0('0x5a'),_0xbba0('0x5c'),_0xbba0('0x5d'),_0xbba0('0x5e'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xbba0('0x1c')](handleEntityNotFound(_0x4a6a62,null))[_0xbba0('0x1c')](function(_0x27a122){if(_0x27a122){var _0x397d4e=_0x27a122[_0xbba0('0x5d')]&&fs[_0xbba0('0x62')](path[_0xbba0('0x63')](config[_0xbba0('0x64')],_0x201c01,_['toLower'](_0x27a122[_0xbba0('0x5d')])))?path[_0xbba0('0x63')](config[_0xbba0('0x64')],_0x201c01,_[_0xbba0('0x65')](_0x27a122['favicon'])):path[_0xbba0('0x63')](config[_0xbba0('0x64')],_0x201c01,_[_0xbba0('0x65')](_0xbba0('0x77')));var _0x34c67c='default'+_[_0xbba0('0x68')](_0xbba0('0x5d'));if(_0x27a122[_0x34c67c]||!_0x1c6c89[_0xbba0('0x78')]){_0x397d4e=path[_0xbba0('0x63')](config['root'],_0x201c01,_[_0xbba0('0x65')]('default_favicon.ico'));}if(!fs[_0xbba0('0x62')](_0x397d4e)){throw new db[(_0xbba0('0x69'))]['ValidationError'](_[_0xbba0('0x68')](_0xbba0('0x5d'))+_0xbba0('0x6e'));}return _0x4a6a62[_0xbba0('0x6f')](_0x397d4e);}})['catch'](handleError(_0x4a6a62,null));};exports[_0xbba0('0x79')]=function(_0x430abc,_0x5a1a7d){var _0x296833={'offset':moment()[_0xbba0('0x7a')]()};_0x296833[_0xbba0('0x7b')]=moment()['utcOffset'](_0x296833[_0xbba0('0x2c')])[_0xbba0('0x7c')](_0xbba0('0x7d'));return _0x5a1a7d[_0xbba0('0x29')](0xc8)[_0xbba0('0x38')](_0x296833);}; \ No newline at end of file +var _0x3f11=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','rows','show','keys','options','find','body','addLogo','file','filename','logo','params','getLogo','server/files/images/logos','getLicense','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','root','toLower','join','default_logo.svg','default','upperFirst','custom','ValidationError','\x20not\x20found','download','loginLogo','favicon','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','Sequelize','getFavicon','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x484671,_0x35bc7e){var _0xdf3c2a=function(_0x40bab8){while(--_0x40bab8){_0x484671['push'](_0x484671['shift']());}};_0xdf3c2a(++_0x35bc7e);}(_0x3f11,0x6c));var _0x13f1=function(_0x26bb21,_0x4d8161){_0x26bb21=_0x26bb21-0x0;var _0x3b86d8=_0x3f11[_0x26bb21];return _0x3b86d8;};'use strict';var emlformat=require(_0x13f1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x13f1('0x1'));var moment=require(_0x13f1('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x13f1('0x3'));var util=require('util');var path=require(_0x13f1('0x4'));var sox=require(_0x13f1('0x5'));var csv=require(_0x13f1('0x6'));var ejs=require(_0x13f1('0x7'));var fs=require('fs');var fs_extra=require(_0x13f1('0x8'));var _=require(_0x13f1('0x9'));var squel=require(_0x13f1('0xa'));var crypto=require(_0x13f1('0xb'));var jsforce=require(_0x13f1('0xc'));var deskjs=require(_0x13f1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x13f1('0xe'));var Papa=require(_0x13f1('0xf'));var Redis=require(_0x13f1('0x10'));var authService=require(_0x13f1('0x11'));var qs=require(_0x13f1('0x12'));var as=require(_0x13f1('0x13'));var hardwareService=require(_0x13f1('0x14'));var logger=require(_0x13f1('0x15'))(_0x13f1('0x16'));var utils=require(_0x13f1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x13f1('0x18'));var db=require(_0x13f1('0x19'))['db'];var jayson=require(_0x13f1('0x1a'));var client=jayson[_0x13f1('0x1b')][_0x13f1('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x423ab0,_0x119fbf,_0x5a0c77,_0xf993f){return new BPromise(function(_0x41dd04,_0x116294){var _0x3f0d8a=_0xf993f||client;return _0x3f0d8a[_0x13f1('0x1d')](_0x423ab0,_0x5a0c77)['then'](function(_0x42d1c1){logger[_0x13f1('0x1e')](_0x13f1('0x1f'),_0x119fbf,'request\x20sent');logger[_0x13f1('0x20')](_0x13f1('0x21'),_0x119fbf,_0x13f1('0x22'),JSON[_0x13f1('0x23')](_0x42d1c1));if(_0x42d1c1[_0x13f1('0x24')]){if(_0x42d1c1['error'][_0x13f1('0x25')]===0x1f4){logger[_0x13f1('0x24')](_0x13f1('0x1f'),_0x119fbf,_0x42d1c1['error'][_0x13f1('0x26')]);return _0x116294(_0x42d1c1[_0x13f1('0x24')][_0x13f1('0x26')]);}logger[_0x13f1('0x24')](_0x13f1('0x1f'),_0x119fbf,_0x42d1c1['error'][_0x13f1('0x26')]);return _0x41dd04(_0x42d1c1[_0x13f1('0x24')][_0x13f1('0x26')]);}else{logger['info'](_0x13f1('0x1f'),_0x119fbf,'request\x20sent');_0x41dd04(_0x42d1c1[_0x13f1('0x27')]['message']);}})[_0x13f1('0x28')](function(_0x52d05b){logger[_0x13f1('0x24')](_0x13f1('0x1f'),_0x119fbf,_0x52d05b);_0x116294(_0x52d05b);});});}function respondWithStatusCode(_0x39a03e,_0xc00d40){_0xc00d40=_0xc00d40||0xcc;return function(_0x487b5c){if(_0x487b5c){return _0x39a03e[_0x13f1('0x29')](_0xc00d40);}return _0x39a03e[_0x13f1('0x2a')](_0xc00d40)[_0x13f1('0x2b')]();};}function respondWithResult(_0x39feb3,_0x54afeb){_0x54afeb=_0x54afeb||0xc8;return function(_0x1ba85e){if(_0x1ba85e){return _0x39feb3[_0x13f1('0x2a')](_0x54afeb)['json'](_0x1ba85e);}};}function respondWithFilteredResult(_0x4b7bdf,_0x5e7ffa){return function(_0x45bc10){if(_0x45bc10){var _0x395f99=typeof _0x5e7ffa['offset']===_0x13f1('0x2c')&&typeof _0x5e7ffa[_0x13f1('0x2d')]==='undefined';var _0x296772=_0x45bc10[_0x13f1('0x2e')];var _0x23891a=_0x395f99?0x0:_0x5e7ffa[_0x13f1('0x2f')];var _0x3cb005=_0x395f99?_0x45bc10[_0x13f1('0x2e')]:_0x5e7ffa[_0x13f1('0x2f')]+_0x5e7ffa[_0x13f1('0x2d')];var _0x576773;if(_0x3cb005>=_0x296772){_0x3cb005=_0x296772;_0x576773=0xc8;}else{_0x576773=0xce;}_0x4b7bdf[_0x13f1('0x2a')](_0x576773);return _0x4b7bdf[_0x13f1('0x30')](_0x13f1('0x31'),_0x23891a+'-'+_0x3cb005+'/'+_0x296772)[_0x13f1('0x32')](_0x45bc10);}return null;};}function patchUpdates(_0xcfd607){return function(_0x2a4da6){try{jsonpatch[_0x13f1('0x33')](_0x2a4da6,_0xcfd607,!![]);}catch(_0x52a000){return BPromise['reject'](_0x52a000);}return _0x2a4da6[_0x13f1('0x34')]();};}function saveUpdates(_0x56a1b9,_0x47d644){return function(_0x3f247f){if(_0x3f247f){return _0x3f247f[_0x13f1('0x35')](_0x56a1b9)[_0x13f1('0x36')](function(_0x1a1707){return _0x1a1707;});}return null;};}function removeEntity(_0x3255d3,_0x4312ca){return function(_0x1fde07){if(_0x1fde07){return _0x1fde07['destroy']()[_0x13f1('0x36')](function(){_0x3255d3[_0x13f1('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29229a,_0x35e601){return function(_0x551ebd){if(!_0x551ebd){_0x29229a[_0x13f1('0x29')](0x194);}return _0x551ebd;};}function handleError(_0x34aa08,_0x4ab199){_0x4ab199=_0x4ab199||0x1f4;return function(_0x19a970){logger[_0x13f1('0x24')](_0x19a970[_0x13f1('0x37')]);if(_0x19a970[_0x13f1('0x38')]){delete _0x19a970['name'];}_0x34aa08[_0x13f1('0x2a')](_0x4ab199)[_0x13f1('0x39')](_0x19a970);};}exports[_0x13f1('0x3a')]=function(_0x3baa61,_0x4548b4){var _0x3d51b2={},_0x112ccf={},_0x30cf36={'count':0x0,'rows':[]};var _0x1a9f12=_[_0x13f1('0x3b')](db[_0x13f1('0x3c')][_0x13f1('0x3d')],function(_0x1c883a){return{'name':_0x1c883a[_0x13f1('0x3e')],'type':_0x1c883a[_0x13f1('0x3f')][_0x13f1('0x40')]};});_0x112ccf[_0x13f1('0x41')]=_[_0x13f1('0x3b')](_0x1a9f12,'name');_0x112ccf[_0x13f1('0x42')]=_['keys'](_0x3baa61[_0x13f1('0x42')]);_0x112ccf[_0x13f1('0x43')]=_[_0x13f1('0x44')](_0x112ccf[_0x13f1('0x41')],_0x112ccf[_0x13f1('0x42')]);_0x3d51b2[_0x13f1('0x45')]=_['intersection'](_0x112ccf[_0x13f1('0x41')],qs[_0x13f1('0x46')](_0x3baa61[_0x13f1('0x42')][_0x13f1('0x46')]));_0x3d51b2['attributes']=_0x3d51b2[_0x13f1('0x45')][_0x13f1('0x47')]?_0x3d51b2[_0x13f1('0x45')]:_0x112ccf[_0x13f1('0x41')];if(!_0x3baa61[_0x13f1('0x42')][_0x13f1('0x48')](_0x13f1('0x49'))){_0x3d51b2[_0x13f1('0x2d')]=qs[_0x13f1('0x2d')](_0x3baa61['query']['limit']);_0x3d51b2[_0x13f1('0x2f')]=qs[_0x13f1('0x2f')](_0x3baa61[_0x13f1('0x42')][_0x13f1('0x2f')]);}_0x3d51b2[_0x13f1('0x4a')]=qs[_0x13f1('0x4b')](_0x3baa61['query']['sort']);_0x3d51b2[_0x13f1('0x4c')]=qs['filters'](_[_0x13f1('0x4d')](_0x3baa61[_0x13f1('0x42')],_0x112ccf[_0x13f1('0x43')]),_0x1a9f12);if(_0x3baa61[_0x13f1('0x42')][_0x13f1('0x4e')]){_0x3d51b2['where']=_['merge'](_0x3d51b2[_0x13f1('0x4c')],{'$or':_[_0x13f1('0x3b')](_0x1a9f12,function(_0x1a7696){if(_0x1a7696[_0x13f1('0x3f')]!==_0x13f1('0x4f')){var _0x1d35cb={};_0x1d35cb[_0x1a7696[_0x13f1('0x38')]]={'$like':'%'+_0x3baa61['query']['filter']+'%'};return _0x1d35cb;}})});}_0x3d51b2=_[_0x13f1('0x50')]({},_0x3d51b2,_0x3baa61['options']);var _0x363575={'where':_0x3d51b2['where']};return db[_0x13f1('0x3c')][_0x13f1('0x2e')](_0x363575)[_0x13f1('0x36')](function(_0x438eb4){_0x30cf36['count']=_0x438eb4;if(_0x3baa61[_0x13f1('0x42')]['includeAll']){_0x3d51b2[_0x13f1('0x51')]=[{'all':!![]}];}return db['Setting'][_0x13f1('0x52')](_0x3d51b2);})[_0x13f1('0x36')](function(_0x5d991e){_0x30cf36[_0x13f1('0x53')]=_0x5d991e;return _0x30cf36;})['then'](respondWithFilteredResult(_0x4548b4,_0x3d51b2))[_0x13f1('0x28')](handleError(_0x4548b4,null));};exports[_0x13f1('0x54')]=function(_0x35e97e,_0x5987f8){var _0x2c4c3e={'raw':![],'where':{'id':_0x35e97e['params']['id']}},_0x2d42ce={};_0x2d42ce[_0x13f1('0x41')]=_[_0x13f1('0x55')](db[_0x13f1('0x3c')][_0x13f1('0x3d')]);_0x2d42ce[_0x13f1('0x42')]=_['keys'](_0x35e97e['query']);_0x2d42ce[_0x13f1('0x43')]=_[_0x13f1('0x44')](_0x2d42ce[_0x13f1('0x41')],_0x2d42ce[_0x13f1('0x42')]);_0x2c4c3e[_0x13f1('0x45')]=_[_0x13f1('0x44')](_0x2d42ce[_0x13f1('0x41')],qs[_0x13f1('0x46')](_0x35e97e['query'][_0x13f1('0x46')]));_0x2c4c3e[_0x13f1('0x45')]=_0x2c4c3e[_0x13f1('0x45')][_0x13f1('0x47')]?_0x2c4c3e[_0x13f1('0x45')]:_0x2d42ce[_0x13f1('0x41')];if(_0x35e97e[_0x13f1('0x42')]['includeAll']){_0x2c4c3e[_0x13f1('0x51')]=[{'all':!![]}];}_0x2c4c3e=_[_0x13f1('0x50')]({},_0x2c4c3e,_0x35e97e[_0x13f1('0x56')]);return db[_0x13f1('0x3c')][_0x13f1('0x57')](_0x2c4c3e)[_0x13f1('0x36')](handleEntityNotFound(_0x5987f8,null))[_0x13f1('0x36')](respondWithResult(_0x5987f8,null))[_0x13f1('0x28')](handleError(_0x5987f8,null));};exports[_0x13f1('0x35')]=function(_0x2ae431,_0x155ce2){if(_0x2ae431['body']['id']){delete _0x2ae431[_0x13f1('0x58')]['id'];}return db['Setting'][_0x13f1('0x57')]({'where':{'id':_0x2ae431['params']['id']}})[_0x13f1('0x36')](handleEntityNotFound(_0x155ce2,null))[_0x13f1('0x36')](saveUpdates(_0x2ae431['body'],null))[_0x13f1('0x36')](respondWithResult(_0x155ce2,null))[_0x13f1('0x28')](handleError(_0x155ce2,null));};exports[_0x13f1('0x59')]=function(_0x1aa872,_0x241a2a,_0x52026e){if(_0x1aa872[_0x13f1('0x5a')]&&_0x1aa872[_0x13f1('0x5a')][_0x13f1('0x5b')]){_0x1aa872[_0x13f1('0x58')][_0x13f1('0x5c')]=_0x1aa872[_0x13f1('0x5a')][_0x13f1('0x5b')];}return db[_0x13f1('0x3c')][_0x13f1('0x57')]({'where':{'id':_0x1aa872[_0x13f1('0x5d')]['id']}})[_0x13f1('0x36')](handleEntityNotFound(_0x241a2a,null))[_0x13f1('0x36')](saveUpdates(_0x1aa872[_0x13f1('0x58')],null))[_0x13f1('0x36')](respondWithResult(_0x241a2a,null))[_0x13f1('0x28')](handleError(_0x241a2a,null));};exports['addLogoLogin']=function(_0x38223f,_0x9d7811,_0x549017){if(_0x38223f[_0x13f1('0x5a')]&&_0x38223f['file'][_0x13f1('0x5b')]){_0x38223f['body']['loginLogo']=_0x38223f[_0x13f1('0x5a')][_0x13f1('0x5b')];}return db[_0x13f1('0x3c')][_0x13f1('0x57')]({'where':{'id':_0x38223f[_0x13f1('0x5d')]['id']}})['then'](handleEntityNotFound(_0x9d7811,null))[_0x13f1('0x36')](saveUpdates(_0x38223f[_0x13f1('0x58')],null))[_0x13f1('0x36')](respondWithResult(_0x9d7811,null))[_0x13f1('0x28')](handleError(_0x9d7811,null));};var utilLicense=require('../../config/license/util');exports[_0x13f1('0x5e')]=function(_0x2813e9,_0x4656f4,_0x42cb00){var _0x227356=_0x13f1('0x5f');var _0xc184b5={'custom':![]};return utilLicense[_0x13f1('0x60')]()[_0x13f1('0x36')](function(_0x9aed8a){if(_0x9aed8a){_0xc184b5=_0x9aed8a;}return db[_0x13f1('0x3c')][_0x13f1('0x57')]({'where':{'id':_0x2813e9['params']['id']},'attributes':[_0x13f1('0x5c'),'loginLogo',_0x13f1('0x61'),'favicon',_0x13f1('0x62'),_0x13f1('0x63'),_0x13f1('0x64'),_0x13f1('0x65')],'raw':!![]});})[_0x13f1('0x36')](handleEntityNotFound(_0x4656f4,null))[_0x13f1('0x36')](function(_0x5e7de6){if(_0x5e7de6){var _0x2ba916=_0x5e7de6['logo']&&fs[_0x13f1('0x66')](path['join'](config[_0x13f1('0x67')],_0x227356,_[_0x13f1('0x68')](_0x5e7de6[_0x13f1('0x5c')])))?path[_0x13f1('0x69')](config[_0x13f1('0x67')],_0x227356,_[_0x13f1('0x68')](_0x5e7de6[_0x13f1('0x5c')])):path[_0x13f1('0x69')](config['root'],_0x227356,_[_0x13f1('0x68')](_0x13f1('0x6a')));var _0x35ccf4=_0x13f1('0x6b')+_[_0x13f1('0x6c')](_0x13f1('0x5c'));if(_0x5e7de6[_0x35ccf4]||!_0xc184b5[_0x13f1('0x6d')]){_0x2ba916=path[_0x13f1('0x69')](config[_0x13f1('0x67')],_0x227356,_[_0x13f1('0x68')]('default_logo.svg'));}if(!fs[_0x13f1('0x66')](_0x2ba916)){throw new db['Sequelize'][(_0x13f1('0x6e'))](_[_0x13f1('0x6c')]('logo')+_0x13f1('0x6f'));}return _0x4656f4[_0x13f1('0x70')](_0x2ba916);}})[_0x13f1('0x28')](handleError(_0x4656f4,null));};var utilLicense=require('../../config/license/util');exports['getLogoLogin']=function(_0x38c179,_0x39a3be,_0x1579d6){var _0x4b02af='server/files/images/logos';var _0x252f68={'custom':![]};return utilLicense[_0x13f1('0x60')]()['then'](function(_0x35ac39){if(_0x35ac39){_0x252f68=_0x35ac39;}return db['Setting'][_0x13f1('0x57')]({'where':{'id':_0x38c179[_0x13f1('0x5d')]['id']},'attributes':[_0x13f1('0x5c'),_0x13f1('0x71'),_0x13f1('0x61'),_0x13f1('0x72'),_0x13f1('0x62'),_0x13f1('0x63'),_0x13f1('0x64'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x39a3be,null))[_0x13f1('0x36')](function(_0x24bc4f){if(_0x24bc4f){var _0x503260=_0x24bc4f[_0x13f1('0x71')]&&fs[_0x13f1('0x66')](path[_0x13f1('0x69')](config['root'],_0x4b02af,_[_0x13f1('0x68')](_0x24bc4f['loginLogo'])))?path[_0x13f1('0x69')](config['root'],_0x4b02af,_[_0x13f1('0x68')](_0x24bc4f[_0x13f1('0x71')])):path[_0x13f1('0x69')](config[_0x13f1('0x67')],_0x4b02af,_[_0x13f1('0x68')](_0x13f1('0x73')));var _0x2788ea=_0x13f1('0x6b')+_['upperFirst'](_0x13f1('0x71'));if(_0x24bc4f[_0x2788ea]||!_0x252f68[_0x13f1('0x6d')]){_0x503260=path[_0x13f1('0x69')](config[_0x13f1('0x67')],_0x4b02af,_[_0x13f1('0x68')]('default_loginLogo.svg'));}if(!fs[_0x13f1('0x66')](_0x503260)){throw new db['Sequelize'][(_0x13f1('0x6e'))](_[_0x13f1('0x6c')]('loginLogo')+_0x13f1('0x6f'));}return _0x39a3be[_0x13f1('0x70')](_0x503260);}})[_0x13f1('0x28')](handleError(_0x39a3be,null));};exports[_0x13f1('0x74')]=function(_0xe10c81,_0xe003dc){return db['Setting'][_0x13f1('0x57')]({'where':{'id':_0xe10c81[_0x13f1('0x5d')]['id']},'attributes':[_0x13f1('0x75')]})[_0x13f1('0x36')](respondWithResult(_0xe003dc,null))['catch'](handleError(_0xe003dc,null));};exports[_0x13f1('0x76')]=function(_0x18b787,_0x2d0740,_0x1076a1){if(_0x18b787[_0x13f1('0x5a')]&&_0x18b787['file'][_0x13f1('0x5b')]){_0x18b787[_0x13f1('0x58')][_0x13f1('0x61')]=_0x18b787[_0x13f1('0x5a')][_0x13f1('0x5b')];}return db[_0x13f1('0x3c')][_0x13f1('0x57')]({'where':{'id':_0x18b787[_0x13f1('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2d0740,null))[_0x13f1('0x36')](saveUpdates(_0x18b787[_0x13f1('0x58')],null))[_0x13f1('0x36')](respondWithResult(_0x2d0740,null))['catch'](handleError(_0x2d0740,null));};var utilLicense=require(_0x13f1('0x18'));exports[_0x13f1('0x77')]=function(_0x3bcc28,_0x37d378,_0xa3421b){var _0x271c06=_0x13f1('0x5f');var _0x1d1cf0={'custom':![]};return utilLicense[_0x13f1('0x60')]()[_0x13f1('0x36')](function(_0x269e97){if(_0x269e97){_0x1d1cf0=_0x269e97;}return db[_0x13f1('0x3c')]['find']({'where':{'id':_0x3bcc28['params']['id']},'attributes':['logo',_0x13f1('0x71'),_0x13f1('0x61'),_0x13f1('0x72'),'defaultLogo',_0x13f1('0x63'),'defaultPreferred',_0x13f1('0x65')],'raw':!![]});})[_0x13f1('0x36')](handleEntityNotFound(_0x37d378,null))[_0x13f1('0x36')](function(_0xdd635e){if(_0xdd635e){var _0x413eb6=_0xdd635e[_0x13f1('0x61')]&&fs[_0x13f1('0x66')](path[_0x13f1('0x69')](config[_0x13f1('0x67')],_0x271c06,_[_0x13f1('0x68')](_0xdd635e[_0x13f1('0x61')])))?path[_0x13f1('0x69')](config[_0x13f1('0x67')],_0x271c06,_['toLower'](_0xdd635e[_0x13f1('0x61')])):path[_0x13f1('0x69')](config[_0x13f1('0x67')],_0x271c06,_[_0x13f1('0x68')](_0x13f1('0x78')));var _0x34f58a='default'+_[_0x13f1('0x6c')](_0x13f1('0x61'));if(_0xdd635e[_0x34f58a]||!_0x1d1cf0[_0x13f1('0x6d')]||!_0x1d1cf0['preferred']){_0x413eb6=path[_0x13f1('0x69')](config[_0x13f1('0x67')],_0x271c06,_[_0x13f1('0x68')](_0x13f1('0x78')));}if(!fs[_0x13f1('0x66')](_0x413eb6)){throw new db[(_0x13f1('0x79'))][(_0x13f1('0x6e'))](_[_0x13f1('0x6c')](_0x13f1('0x61'))+_0x13f1('0x6f'));}return _0x37d378[_0x13f1('0x70')](_0x413eb6);}})['catch'](handleError(_0x37d378,null));};exports['addFavicon']=function(_0x10d838,_0x37c6fe,_0x585f87){if(_0x10d838['file']&&_0x10d838['file']['filename']){_0x10d838[_0x13f1('0x58')][_0x13f1('0x72')]=_0x10d838[_0x13f1('0x5a')][_0x13f1('0x5b')];}return db[_0x13f1('0x3c')]['find']({'where':{'id':_0x10d838[_0x13f1('0x5d')]['id']}})[_0x13f1('0x36')](handleEntityNotFound(_0x37c6fe,null))[_0x13f1('0x36')](saveUpdates(_0x10d838[_0x13f1('0x58')],null))[_0x13f1('0x36')](respondWithResult(_0x37c6fe,null))[_0x13f1('0x28')](handleError(_0x37c6fe,null));};var utilLicense=require(_0x13f1('0x18'));exports[_0x13f1('0x7a')]=function(_0x135cca,_0x3f6212,_0x3ead46){var _0x37bb25=_0x13f1('0x5f');var _0x1690d2={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x591e8e){if(_0x591e8e){_0x1690d2=_0x591e8e;}return db[_0x13f1('0x3c')][_0x13f1('0x57')]({'where':{'id':_0x135cca[_0x13f1('0x5d')]['id']},'attributes':['logo','loginLogo',_0x13f1('0x61'),'favicon',_0x13f1('0x62'),_0x13f1('0x63'),_0x13f1('0x64'),'defaultFavicon'],'raw':!![]});})[_0x13f1('0x36')](handleEntityNotFound(_0x3f6212,null))[_0x13f1('0x36')](function(_0xec8f73){if(_0xec8f73){var _0x30dfc7=_0xec8f73[_0x13f1('0x72')]&&fs[_0x13f1('0x66')](path[_0x13f1('0x69')](config[_0x13f1('0x67')],_0x37bb25,_[_0x13f1('0x68')](_0xec8f73['favicon'])))?path[_0x13f1('0x69')](config['root'],_0x37bb25,_[_0x13f1('0x68')](_0xec8f73[_0x13f1('0x72')])):path[_0x13f1('0x69')](config[_0x13f1('0x67')],_0x37bb25,_[_0x13f1('0x68')]('default_favicon.ico'));var _0x5dec68=_0x13f1('0x6b')+_[_0x13f1('0x6c')](_0x13f1('0x72'));if(_0xec8f73[_0x5dec68]||!_0x1690d2[_0x13f1('0x6d')]){_0x30dfc7=path[_0x13f1('0x69')](config[_0x13f1('0x67')],_0x37bb25,_[_0x13f1('0x68')]('default_favicon.ico'));}if(!fs[_0x13f1('0x66')](_0x30dfc7)){throw new db[(_0x13f1('0x79'))][(_0x13f1('0x6e'))](_['upperFirst'](_0x13f1('0x72'))+_0x13f1('0x6f'));}return _0x3f6212[_0x13f1('0x70')](_0x30dfc7);}})[_0x13f1('0x28')](handleError(_0x3f6212,null));};exports[_0x13f1('0x7b')]=function(_0x49880c,_0x4f1d20){var _0xc31eb={'offset':moment()[_0x13f1('0x7c')]()};_0xc31eb['now']=moment()[_0x13f1('0x7c')](_0xc31eb[_0x13f1('0x2f')])[_0x13f1('0x7d')](_0x13f1('0x7e'));return _0x4f1d20['status'](0xc8)['send'](_0xc31eb);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 7f6df41..186b354 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 _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x54bac5,_0x8d3a16){var _0xc15971=function(_0x254653){while(--_0x254653){_0x54bac5['push'](_0x54bac5['shift']());}};_0xc15971(++_0x8d3a16);}(_0x7217,0x19e));var _0x7721=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x7217[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x11be43,_0x59f937){var _0x534c5d=function(_0x554bcf){while(--_0x554bcf){_0x11be43['push'](_0x11be43['shift']());}};_0x534c5d(++_0x59f937);}(_0xedd9,0xfc));var _0x9edd=function(_0xf4f635,_0x3cb042){_0xf4f635=_0xf4f635-0x0;var _0x19df53=_0xedd9[_0xf4f635];return _0x19df53;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 0644c7d..b390ceb 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 _0x0d17=['catch','Setting','find','options','where','include','model','attributes','map','then','ShowSetting','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result'];(function(_0x5f13a8,_0xeda63b){var _0x50daa1=function(_0x1c1345){while(--_0x1c1345){_0x5f13a8['push'](_0x5f13a8['shift']());}};_0x50daa1(++_0xeda63b);}(_0x0d17,0x17f));var _0x70d1=function(_0x116316,_0x48f672){_0x116316=_0x116316-0x0;var _0x5c6b61=_0x0d17[_0x116316];return _0x5c6b61;};'use strict';var _=require(_0x70d1('0x0'));var util=require(_0x70d1('0x1'));var moment=require('moment');var BPromise=require(_0x70d1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x70d1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x70d1('0x4'));var logger=require(_0x70d1('0x5'))('rpc');var config=require(_0x70d1('0x6'));var jayson=require(_0x70d1('0x7'));var client=jayson['client'][_0x70d1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x504124,_0xf1c8d2,_0x592df2){return new BPromise(function(_0x1a8b80,_0x58b1db){return client[_0x70d1('0x9')](_0x504124,_0x592df2)['then'](function(_0x5a2089){logger[_0x70d1('0xa')]('Setting,\x20%s,\x20%s',_0xf1c8d2,_0x70d1('0xb'));logger[_0x70d1('0xc')](_0x70d1('0xd'),_0xf1c8d2,_0x70d1('0xb'),JSON[_0x70d1('0xe')](_0x5a2089));if(_0x5a2089[_0x70d1('0xf')]){if(_0x5a2089['error'][_0x70d1('0x10')]===0x1f4){logger[_0x70d1('0xf')](_0x70d1('0x11'),_0xf1c8d2,_0x5a2089[_0x70d1('0xf')][_0x70d1('0x12')]);return _0x58b1db(_0x5a2089[_0x70d1('0xf')][_0x70d1('0x12')]);}logger[_0x70d1('0xf')](_0x70d1('0x11'),_0xf1c8d2,_0x5a2089['error'][_0x70d1('0x12')]);return _0x1a8b80(_0x5a2089[_0x70d1('0xf')][_0x70d1('0x12')]);}else{logger[_0x70d1('0xa')](_0x70d1('0x11'),_0xf1c8d2,'request\x20sent');_0x1a8b80(_0x5a2089[_0x70d1('0x13')]['message']);}})[_0x70d1('0x14')](function(_0x4d0513){logger[_0x70d1('0xf')]('Setting,\x20%s,\x20%s',_0xf1c8d2,_0x4d0513);_0x58b1db(_0x4d0513);});});}exports['ShowSetting']=function(_0x4124e1){var _0x57ca76=this;return new Promise(function(_0x43ff6b,_0x310fbc){return db[_0x70d1('0x15')][_0x70d1('0x16')]({'raw':_0x4124e1[_0x70d1('0x17')]?_0x4124e1[_0x70d1('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4124e1[_0x70d1('0x17')]?_0x4124e1['options'][_0x70d1('0x18')]||null:null,'attributes':_0x4124e1[_0x70d1('0x17')]?_0x4124e1['options']['attributes']||null:null,'include':_0x4124e1[_0x70d1('0x17')]?_0x4124e1[_0x70d1('0x17')][_0x70d1('0x19')]?_['map'](_0x4124e1[_0x70d1('0x17')][_0x70d1('0x19')],function(_0x5a7880){return{'model':db[_0x5a7880[_0x70d1('0x1a')]],'as':_0x5a7880['as'],'attributes':_0x5a7880[_0x70d1('0x1b')],'include':_0x5a7880[_0x70d1('0x19')]?_[_0x70d1('0x1c')](_0x5a7880[_0x70d1('0x19')],function(_0x3143ee){return{'model':db[_0x3143ee[_0x70d1('0x1a')]],'as':_0x3143ee['as'],'attributes':_0x3143ee[_0x70d1('0x1b')],'include':_0x3143ee[_0x70d1('0x19')]?_[_0x70d1('0x1c')](_0x3143ee['include'],function(_0x58d852){return{'model':db[_0x58d852['model']],'as':_0x58d852['as'],'attributes':_0x58d852[_0x70d1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x70d1('0x1d')](function(_0x80ad1c){logger[_0x70d1('0xa')]('ShowSetting',_0x4124e1);logger[_0x70d1('0xc')](_0x70d1('0x1e'),_0x4124e1,JSON[_0x70d1('0xe')](_0x80ad1c));_0x43ff6b(_0x80ad1c);})[_0x70d1('0x14')](function(_0x230e35){logger[_0x70d1('0xf')](_0x70d1('0x1e'),_0x230e35[_0x70d1('0x12')],_0x4124e1);_0x310fbc(_0x57ca76[_0x70d1('0xf')](0x1f4,_0x230e35[_0x70d1('0x12')]));});});}; \ No newline at end of file +var _0x4a2d=['include','map','model','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','ShowSetting','Setting','options','raw','attributes'];(function(_0x59cda9,_0x47d4c4){var _0x26c18f=function(_0x4cff5f){while(--_0x4cff5f){_0x59cda9['push'](_0x59cda9['shift']());}};_0x26c18f(++_0x47d4c4);}(_0x4a2d,0xab));var _0xd4a2=function(_0x28611e,_0x586726){_0x28611e=_0x28611e-0x0;var _0x530f69=_0x4a2d[_0x28611e];return _0x530f69;};'use strict';var _=require(_0xd4a2('0x0'));var util=require('util');var moment=require(_0xd4a2('0x1'));var BPromise=require(_0xd4a2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4a2('0x3'))['db'];var utils=require(_0xd4a2('0x4'));var logger=require(_0xd4a2('0x5'))('rpc');var config=require(_0xd4a2('0x6'));var jayson=require(_0xd4a2('0x7'));var client=jayson['client'][_0xd4a2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x27fa56,_0x18412f,_0x1dfe5e){return new BPromise(function(_0x3d025a,_0x44d329){return client['request'](_0x27fa56,_0x1dfe5e)[_0xd4a2('0x9')](function(_0x4350ad){logger['info'](_0xd4a2('0xa'),_0x18412f,_0xd4a2('0xb'));logger[_0xd4a2('0xc')](_0xd4a2('0xd'),_0x18412f,'request\x20sent',JSON[_0xd4a2('0xe')](_0x4350ad));if(_0x4350ad[_0xd4a2('0xf')]){if(_0x4350ad['error']['code']===0x1f4){logger['error'](_0xd4a2('0xa'),_0x18412f,_0x4350ad['error'][_0xd4a2('0x10')]);return _0x44d329(_0x4350ad['error'][_0xd4a2('0x10')]);}logger[_0xd4a2('0xf')](_0xd4a2('0xa'),_0x18412f,_0x4350ad[_0xd4a2('0xf')][_0xd4a2('0x10')]);return _0x3d025a(_0x4350ad[_0xd4a2('0xf')][_0xd4a2('0x10')]);}else{logger[_0xd4a2('0x11')](_0xd4a2('0xa'),_0x18412f,_0xd4a2('0xb'));_0x3d025a(_0x4350ad[_0xd4a2('0x12')][_0xd4a2('0x10')]);}})[_0xd4a2('0x13')](function(_0x515359){logger['error']('Setting,\x20%s,\x20%s',_0x18412f,_0x515359);_0x44d329(_0x515359);});});}exports[_0xd4a2('0x14')]=function(_0x273032){var _0x18482a=this;return new Promise(function(_0xbe6d35,_0x1f7db1){return db[_0xd4a2('0x15')]['find']({'raw':_0x273032[_0xd4a2('0x16')]?_0x273032[_0xd4a2('0x16')][_0xd4a2('0x17')]===undefined?!![]:![]:!![],'where':_0x273032['options']?_0x273032[_0xd4a2('0x16')]['where']||null:null,'attributes':_0x273032[_0xd4a2('0x16')]?_0x273032[_0xd4a2('0x16')][_0xd4a2('0x18')]||null:null,'include':_0x273032[_0xd4a2('0x16')]?_0x273032[_0xd4a2('0x16')][_0xd4a2('0x19')]?_[_0xd4a2('0x1a')](_0x273032['options']['include'],function(_0x4d90b9){return{'model':db[_0x4d90b9[_0xd4a2('0x1b')]],'as':_0x4d90b9['as'],'attributes':_0x4d90b9['attributes'],'include':_0x4d90b9[_0xd4a2('0x19')]?_[_0xd4a2('0x1a')](_0x4d90b9['include'],function(_0x574523){return{'model':db[_0x574523['model']],'as':_0x574523['as'],'attributes':_0x574523['attributes'],'include':_0x574523['include']?_[_0xd4a2('0x1a')](_0x574523['include'],function(_0x3cbadf){return{'model':db[_0x3cbadf[_0xd4a2('0x1b')]],'as':_0x3cbadf['as'],'attributes':_0x3cbadf[_0xd4a2('0x18')]};}):[]};}):[]};}):[]:[]})[_0xd4a2('0x9')](function(_0x1af937){logger[_0xd4a2('0x11')](_0xd4a2('0x14'),_0x273032);logger[_0xd4a2('0xc')](_0xd4a2('0x14'),_0x273032,JSON[_0xd4a2('0xe')](_0x1af937));_0xbe6d35(_0x1af937);})[_0xd4a2('0x13')](function(_0x131e5d){logger[_0xd4a2('0xf')](_0xd4a2('0x14'),_0x131e5d['message'],_0x273032);_0x1f7db1(_0x18482a[_0xd4a2('0xf')](0x1f4,_0x131e5d[_0xd4a2('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index d5cfabf..aee9cb6 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 _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x39ded1,_0xaee436){var _0x2e248e=function(_0x193df3){while(--_0x193df3){_0x39ded1['push'](_0x39ded1['shift']());}};_0x2e248e(++_0xaee436);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file +var _0x8ef6=['addApplications','/:id/send','send','status','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','addAnswer','notify'];(function(_0x35e023,_0x334d8e){var _0x4fc0a7=function(_0xc515d5){while(--_0xc515d5){_0x35e023['push'](_0x35e023['shift']());}};_0x4fc0a7(++_0x334d8e);}(_0x8ef6,0xf2));var _0x68ef=function(_0xa812cb,_0x572e83){_0xa812cb=_0xa812cb-0x0;var _0xf758b8=_0x8ef6[_0xa812cb];return _0xf758b8;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['describe']);router[_0x68ef('0xa')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xa')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0xa')](_0x68ef('0x11'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router['get'](_0x68ef('0x13'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);router[_0x68ef('0xa')](_0x68ef('0x15'),auth[_0x68ef('0xc')](),controller['getInteractions']);router[_0x68ef('0xa')](_0x68ef('0x16'),controller[_0x68ef('0x17')]);router['get'](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x19')]);router['post']('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1a')]);router[_0x68ef('0x1b')](_0x68ef('0xf'),auth['isAuthenticated'](),controller[_0x68ef('0x1c')]);router['post']('/:id/canned_answers',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1d')]);router['post']('/:id/notify',controller[_0x68ef('0x1e')]);router[_0x68ef('0x1b')](_0x68ef('0x13'),auth['isAuthenticated'](),controller[_0x68ef('0x1f')]);router[_0x68ef('0x1b')](_0x68ef('0x20'),auth['isAuthenticated'](),controller[_0x68ef('0x21')]);router[_0x68ef('0x1b')]('/:id/status',controller[_0x68ef('0x22')]);router[_0x68ef('0x1b')](_0x68ef('0x18'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x23')]);router[_0x68ef('0x24')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x25')]);router[_0x68ef('0x24')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller['removeDispositions']);router[_0x68ef('0x24')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x68ef('0x24')](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x26')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index f451bfa..3be90be 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 _0x47d3=['clickatell','bandwidth','csc','infobip','intelepeer','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','name','STRING','generate','ENUM','twilio','skebby','connectel','plivo'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x47d3,0xe8));var _0x347d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x47d3[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x347d('0x0'));module[_0x347d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x347d('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x347d('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x347d('0x3')],'defaultValue':function(){return rs[_0x347d('0x4')]();}},'phone':{'type':Sequelize[_0x347d('0x3')]},'type':{'type':Sequelize[_0x347d('0x5')](_0x347d('0x6'),_0x347d('0x7'),_0x347d('0x8'),'clicksend',_0x347d('0x9'),_0x347d('0xa'),_0x347d('0xb'),_0x347d('0xc'),_0x347d('0xd'),_0x347d('0xe'))},'accountSid':{'type':Sequelize[_0x347d('0x3')]},'authId':{'type':Sequelize[_0x347d('0x3')]},'authToken':{'type':Sequelize[_0x347d('0x3')]},'smsMethod':{'type':Sequelize[_0x347d('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x347d('0x3')]},'password':{'type':Sequelize[_0x347d('0x3')]},'apiKey':{'type':Sequelize[_0x347d('0x3')]},'applicationId':{'type':Sequelize[_0x347d('0x3')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x347d('0x3')]},'deliveryReport':{'type':Sequelize[_0x347d('0xf')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x347d('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x347d('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x347d('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x347d('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x347d('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x347d('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x347d('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x347d('0x10')],'comment':_0x347d('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x347d('0xf')],'defaultValue':![],'comment':_0x347d('0x12'),'set':function(_0x120164){if(!_0x120164)this[_0x347d('0x13')](_0x347d('0x14'),null);this['setDataValue'](_0x347d('0x15'),_0x120164);}}}; \ No newline at end of file +var _0xcb79=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','exports','STRING','name','generate','ENUM','twilio','skebby','connectel','plivo','clickatell','bandwidth','csc','infobip','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER'];(function(_0x2c5567,_0x5d5f30){var _0x313e98=function(_0x3c2a14){while(--_0x3c2a14){_0x2c5567['push'](_0x2c5567['shift']());}};_0x313e98(++_0x5d5f30);}(_0xcb79,0xf3));var _0x9cb7=function(_0x3b8aef,_0x2dd77c){_0x3b8aef=_0x3b8aef-0x0;var _0x13109f=_0xcb79[_0x3b8aef];return _0x13109f;};'use strict';var Sequelize=require(_0x9cb7('0x0'));var rs=require('randomstring');module[_0x9cb7('0x1')]={'name':{'type':Sequelize[_0x9cb7('0x2')],'unique':_0x9cb7('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x9cb7('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x9cb7('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x9cb7('0x2')],'defaultValue':function(){return rs[_0x9cb7('0x4')]();}},'phone':{'type':Sequelize[_0x9cb7('0x2')]},'type':{'type':Sequelize[_0x9cb7('0x5')](_0x9cb7('0x6'),_0x9cb7('0x7'),_0x9cb7('0x8'),'clicksend',_0x9cb7('0x9'),_0x9cb7('0xa'),_0x9cb7('0xb'),_0x9cb7('0xc'),_0x9cb7('0xd'),'intelepeer')},'accountSid':{'type':Sequelize[_0x9cb7('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x9cb7('0x2')]},'smsMethod':{'type':Sequelize[_0x9cb7('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x9cb7('0x2')]},'password':{'type':Sequelize[_0x9cb7('0x2')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0x9cb7('0x2')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x9cb7('0x2')]},'deliveryReport':{'type':Sequelize[_0x9cb7('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x9cb7('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9cb7('0xf');}},'notificationSound':{'type':Sequelize[_0x9cb7('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9cb7('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9cb7('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9cb7('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9cb7('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x9cb7('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x9cb7('0xe')],'defaultValue':![],'comment':_0x9cb7('0x12'),'set':function(_0x1b467e){if(!_0x1b467e)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x9cb7('0x13')]('mandatoryDisposition',_0x1b467e);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 39f3e6d..5f9c0a4 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 _0xeeef=['Applications','orderBy','priority','asc','account','CmContact','describe','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','MessageSid','skebby','sender','text','connectel','clicksend','messageId','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','list','omit','Contacts','defaults','SmsInteraction','spread','interaction','created','autoclose','push','applications','unmanaged','*,*,*,*','SmsMessage','AttachmentId','UserId','User','unshift','agent','startRouting','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','send','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','DELIVERED','redif','update','groupName','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','bandwidth','message-delivered','ACCEPTD','statusGet','message-id','state','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','redis','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','destroy','get','SmsAccounts','UserProfileResource','stack','name','index','Pause','map','SmsAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','show','include','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','create','params','addDisposition','SmsAccountId','getDispositions','findOne','Disposition','nolimit','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','sms','SmsApplication'];(function(_0x3655e5,_0x469eae){var _0x37dfac=function(_0x4378d2){while(--_0x4378d2){_0x3655e5['push'](_0x3655e5['shift']());}};_0x37dfac(++_0x469eae);}(_0xeeef,0x153));var _0xfeee=function(_0xa0479,_0x249bc4){_0xa0479=_0xa0479-0x0;var _0xab02b=_0xeeef[_0xa0479];return _0xab02b;};'use strict';var emlformat=require(_0xfeee('0x0'));var rimraf=require(_0xfeee('0x1'));var zipdir=require(_0xfeee('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfeee('0x3'));var moment=require('moment');var BPromise=require(_0xfeee('0x4'));var Mustache=require(_0xfeee('0x5'));var util=require('util');var path=require(_0xfeee('0x6'));var sox=require(_0xfeee('0x7'));var csv=require(_0xfeee('0x8'));var ejs=require(_0xfeee('0x9'));var fs=require('fs');var fs_extra=require(_0xfeee('0xa'));var _=require(_0xfeee('0xb'));var squel=require(_0xfeee('0xc'));var crypto=require(_0xfeee('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xfeee('0xe'));var toCsv=require(_0xfeee('0x8'));var querystring=require(_0xfeee('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfeee('0x10'));var as=require(_0xfeee('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfeee('0x12'))('api');var utils=require(_0xfeee('0x13'));var config=require(_0xfeee('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xfeee('0x15')]=_['defaults'](config[_0xfeee('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xfeee('0x16'))(new Redis(config[_0xfeee('0x15')]));require(_0xfeee('0x17'))[_0xfeee('0x18')](socket);var jayson=require(_0xfeee('0x19'));var client=jayson[_0xfeee('0x1a')][_0xfeee('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0xbb8b66,_0x35ae14,_0x1a7d77,_0x53168c){return new BPromise(function(_0x2ef5c1,_0x33c5d4){var _0x3fd71e=_0x53168c||client;return _0x3fd71e['request'](_0xbb8b66,_0x1a7d77)[_0xfeee('0x1c')](function(_0x3fc92e){logger[_0xfeee('0x1d')](_0xfeee('0x1e'),_0x35ae14,_0xfeee('0x1f'));logger[_0xfeee('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x35ae14,_0xfeee('0x1f'),JSON[_0xfeee('0x21')](_0x3fc92e));if(_0x3fc92e[_0xfeee('0x22')]){if(_0x3fc92e[_0xfeee('0x22')][_0xfeee('0x23')]===0x1f4){logger[_0xfeee('0x22')](_0xfeee('0x1e'),_0x35ae14,_0x3fc92e['error'][_0xfeee('0x24')]);return _0x33c5d4(_0x3fc92e['error'][_0xfeee('0x24')]);}logger[_0xfeee('0x22')](_0xfeee('0x1e'),_0x35ae14,_0x3fc92e[_0xfeee('0x22')][_0xfeee('0x24')]);return _0x2ef5c1(_0x3fc92e[_0xfeee('0x22')][_0xfeee('0x24')]);}else{logger['info'](_0xfeee('0x1e'),_0x35ae14,'request\x20sent');_0x2ef5c1(_0x3fc92e['result']['message']);}})[_0xfeee('0x25')](function(_0x4b28e0){logger['error'](_0xfeee('0x1e'),_0x35ae14,_0x4b28e0);_0x33c5d4(_0x4b28e0);});});}function respondWithStatusCode(_0x156f07,_0x56f19b){_0x56f19b=_0x56f19b||0xcc;return function(_0x3ab3f2){if(_0x3ab3f2){return _0x156f07[_0xfeee('0x26')](_0x56f19b);}return _0x156f07[_0xfeee('0x27')](_0x56f19b)[_0xfeee('0x28')]();};}function respondWithResult(_0x394411,_0x26f6ed){_0x26f6ed=_0x26f6ed||0xc8;return function(_0x3718da){if(_0x3718da){return _0x394411[_0xfeee('0x27')](_0x26f6ed)[_0xfeee('0x29')](_0x3718da);}};}function respondWithFilteredResult(_0x1ecaa5,_0x55d176){return function(_0xf5bc58){if(_0xf5bc58){var _0x361238=typeof _0x55d176[_0xfeee('0x2a')]===_0xfeee('0x2b')&&typeof _0x55d176[_0xfeee('0x2c')]===_0xfeee('0x2b');var _0xdc56b8=_0xf5bc58[_0xfeee('0x2d')];var _0xe00a3e=_0x361238?0x0:_0x55d176[_0xfeee('0x2a')];var _0x1cb3d5=_0x361238?_0xf5bc58[_0xfeee('0x2d')]:_0x55d176[_0xfeee('0x2a')]+_0x55d176[_0xfeee('0x2c')];var _0x38e5b2;if(_0x1cb3d5>=_0xdc56b8){_0x1cb3d5=_0xdc56b8;_0x38e5b2=0xc8;}else{_0x38e5b2=0xce;}_0x1ecaa5[_0xfeee('0x27')](_0x38e5b2);return _0x1ecaa5['set'](_0xfeee('0x2e'),_0xe00a3e+'-'+_0x1cb3d5+'/'+_0xdc56b8)[_0xfeee('0x29')](_0xf5bc58);}return null;};}function patchUpdates(_0x1bf682){return function(_0xd38818){try{jsonpatch['apply'](_0xd38818,_0x1bf682,!![]);}catch(_0x94c46b){return BPromise[_0xfeee('0x2f')](_0x94c46b);}return _0xd38818[_0xfeee('0x30')]();};}function saveUpdates(_0x186510,_0x5c0235){return function(_0x3314c6){if(_0x3314c6){return _0x3314c6['update'](_0x186510)[_0xfeee('0x1c')](function(_0x4e6853){return _0x4e6853;});}return null;};}function removeEntity(_0x4f4b5b,_0x30f7bd){return function(_0x21f2aa){if(_0x21f2aa){return _0x21f2aa[_0xfeee('0x31')]()[_0xfeee('0x1c')](function(){var _0x202aa9=_0x21f2aa[_0xfeee('0x32')]({'plain':!![]});var _0x27b5c3=_0xfeee('0x33');return db[_0xfeee('0x34')]['destroy']({'where':{'type':_0x27b5c3,'resourceId':_0x202aa9['id']}})[_0xfeee('0x1c')](function(){return _0x21f2aa;});})[_0xfeee('0x1c')](function(){_0x4f4b5b[_0xfeee('0x27')](0xcc)[_0xfeee('0x28')]();});}};}function handleEntityNotFound(_0x4a7461,_0xbba80b){return function(_0x2b9a4f){if(!_0x2b9a4f){_0x4a7461['sendStatus'](0x194);}return _0x2b9a4f;};}function handleError(_0x2c96e5,_0x1c0611){_0x1c0611=_0x1c0611||0x1f4;return function(_0x188dc9){logger[_0xfeee('0x22')](_0x188dc9[_0xfeee('0x35')]);if(_0x188dc9[_0xfeee('0x36')]){delete _0x188dc9[_0xfeee('0x36')];}_0x2c96e5[_0xfeee('0x27')](_0x1c0611)['send'](_0x188dc9);};}exports[_0xfeee('0x37')]=function(_0x4a7e06,_0x48fa1f){var _0x50c9f2={'include':[{'model':db[_0xfeee('0x38')],'as':'mandatoryDispositionPause'}]},_0x2932ea={},_0x4be44d={'count':0x0,'rows':[]};var _0x2efe38=_[_0xfeee('0x39')](db[_0xfeee('0x3a')][_0xfeee('0x3b')],function(_0x3d5c69){return{'name':_0x3d5c69[_0xfeee('0x3c')],'type':_0x3d5c69['type'][_0xfeee('0x3d')]};});_0x2932ea[_0xfeee('0x3e')]=_[_0xfeee('0x39')](_0x2efe38,'name');_0x2932ea[_0xfeee('0x3f')]=_[_0xfeee('0x40')](_0x4a7e06[_0xfeee('0x3f')]);_0x2932ea[_0xfeee('0x41')]=_[_0xfeee('0x42')](_0x2932ea[_0xfeee('0x3e')],_0x2932ea['query']);_0x50c9f2['attributes']=_[_0xfeee('0x42')](_0x2932ea[_0xfeee('0x3e')],qs[_0xfeee('0x43')](_0x4a7e06[_0xfeee('0x3f')]['fields']));_0x50c9f2[_0xfeee('0x44')]=_0x50c9f2[_0xfeee('0x44')][_0xfeee('0x45')]?_0x50c9f2[_0xfeee('0x44')]:_0x2932ea[_0xfeee('0x3e')];if(!_0x4a7e06[_0xfeee('0x3f')][_0xfeee('0x46')]('nolimit')){_0x50c9f2[_0xfeee('0x2c')]=qs[_0xfeee('0x2c')](_0x4a7e06[_0xfeee('0x3f')][_0xfeee('0x2c')]);_0x50c9f2[_0xfeee('0x2a')]=qs[_0xfeee('0x2a')](_0x4a7e06['query'][_0xfeee('0x2a')]);}_0x50c9f2[_0xfeee('0x47')]=qs[_0xfeee('0x48')](_0x4a7e06[_0xfeee('0x3f')][_0xfeee('0x48')]);_0x50c9f2[_0xfeee('0x49')]=qs[_0xfeee('0x41')](_[_0xfeee('0x4a')](_0x4a7e06['query'],_0x2932ea[_0xfeee('0x41')]),_0x2efe38);if(_0x4a7e06[_0xfeee('0x3f')][_0xfeee('0x4b')]){_0x50c9f2[_0xfeee('0x49')]=_['merge'](_0x50c9f2[_0xfeee('0x49')],{'$or':_[_0xfeee('0x39')](_0x2efe38,function(_0x114ab7){if(_0x114ab7[_0xfeee('0x4c')]!==_0xfeee('0x4d')){var _0x19edba={};_0x19edba[_0x114ab7[_0xfeee('0x36')]]={'$like':'%'+_0x4a7e06[_0xfeee('0x3f')][_0xfeee('0x4b')]+'%'};return _0x19edba;}})});}_0x50c9f2=_[_0xfeee('0x4e')]({},_0x50c9f2,_0x4a7e06[_0xfeee('0x4f')]);var _0x45ce5f={'where':_0x50c9f2['where']};return db[_0xfeee('0x3a')][_0xfeee('0x2d')](_0x45ce5f)[_0xfeee('0x1c')](function(_0x32e4c2){_0x4be44d[_0xfeee('0x2d')]=_0x32e4c2;if(_0x4a7e06[_0xfeee('0x3f')][_0xfeee('0x50')]){_0x50c9f2['include']=[{'all':!![]}];}return db[_0xfeee('0x3a')][_0xfeee('0x51')](_0x50c9f2);})[_0xfeee('0x1c')](function(_0x4a4103){_0x4be44d[_0xfeee('0x52')]=_0x4a4103;return _0x4be44d;})[_0xfeee('0x1c')](respondWithFilteredResult(_0x48fa1f,_0x50c9f2))[_0xfeee('0x25')](handleError(_0x48fa1f,null));};exports[_0xfeee('0x53')]=function(_0x37b7ea,_0x16d46b){var _0x313fdb={'raw':![],'where':{'id':_0x37b7ea['params']['id']},'include':[{'model':db[_0xfeee('0x38')],'as':'mandatoryDispositionPause'}]},_0x6640b6={};_0x6640b6[_0xfeee('0x3e')]=_['keys'](db[_0xfeee('0x3a')][_0xfeee('0x3b')]);_0x6640b6[_0xfeee('0x3f')]=_['keys'](_0x37b7ea[_0xfeee('0x3f')]);_0x6640b6[_0xfeee('0x41')]=_[_0xfeee('0x42')](_0x6640b6[_0xfeee('0x3e')],_0x6640b6[_0xfeee('0x3f')]);_0x313fdb['attributes']=_['intersection'](_0x6640b6['model'],qs[_0xfeee('0x43')](_0x37b7ea[_0xfeee('0x3f')]['fields']));_0x313fdb[_0xfeee('0x44')]=_0x313fdb[_0xfeee('0x44')][_0xfeee('0x45')]?_0x313fdb[_0xfeee('0x44')]:_0x6640b6[_0xfeee('0x3e')];if(_0x37b7ea[_0xfeee('0x3f')][_0xfeee('0x50')]){_0x313fdb[_0xfeee('0x54')]=[{'all':!![]}];}_0x313fdb=_[_0xfeee('0x4e')]({},_0x313fdb,_0x37b7ea[_0xfeee('0x4f')]);return db[_0xfeee('0x3a')][_0xfeee('0x55')](_0x313fdb)[_0xfeee('0x1c')](handleEntityNotFound(_0x16d46b,null))[_0xfeee('0x1c')](respondWithResult(_0x16d46b,null))['catch'](handleError(_0x16d46b,null));};exports['create']=function(_0x17e34d,_0x322e78){return db['SmsAccount']['create'](_0x17e34d[_0xfeee('0x56')],{})['then'](function(_0x25df61){var _0x3db6b3=_0x17e34d['user'][_0xfeee('0x32')]({'plain':!![]});if(!_0x3db6b3)throw new Error(_0xfeee('0x57'));if(_0x3db6b3[_0xfeee('0x58')]===_0xfeee('0x59')){var _0x530417=_0x25df61['get']({'plain':!![]});var _0x50c706=_0xfeee('0x33');return db[_0xfeee('0x5a')][_0xfeee('0x55')]({'where':{'name':_0x50c706,'userProfileId':_0x3db6b3[_0xfeee('0x5b')]},'raw':!![]})[_0xfeee('0x1c')](function(_0x1583b3){if(_0x1583b3&&_0x1583b3['autoAssociation']===0x0){return db[_0xfeee('0x34')][_0xfeee('0x5c')]({'name':_0x530417[_0xfeee('0x36')],'resourceId':_0x530417['id'],'type':_0x1583b3[_0xfeee('0x36')],'sectionId':_0x1583b3['id']},{})[_0xfeee('0x1c')](function(){return _0x25df61;});}else{return _0x25df61;}})['catch'](function(_0x1b199b){logger[_0xfeee('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b199b);throw _0x1b199b;});}return _0x25df61;})[_0xfeee('0x1c')](respondWithResult(_0x322e78,0xc9))[_0xfeee('0x25')](handleError(_0x322e78,null));};exports['update']=function(_0x447a30,_0xb5978){if(_0x447a30[_0xfeee('0x56')]['id']){delete _0x447a30[_0xfeee('0x56')]['id'];}return db[_0xfeee('0x3a')][_0xfeee('0x55')]({'where':{'id':_0x447a30[_0xfeee('0x5d')]['id']},'include':[{'model':db[_0xfeee('0x38')],'as':'mandatoryDispositionPause'}]})[_0xfeee('0x1c')](handleEntityNotFound(_0xb5978,null))['then'](saveUpdates(_0x447a30[_0xfeee('0x56')],null))['then'](respondWithResult(_0xb5978,null))[_0xfeee('0x25')](handleError(_0xb5978,null));};exports[_0xfeee('0x31')]=function(_0x6edd99,_0x47c9b9){return db['SmsAccount']['find']({'where':{'id':_0x6edd99['params']['id']}})[_0xfeee('0x1c')](handleEntityNotFound(_0x47c9b9,null))[_0xfeee('0x1c')](removeEntity(_0x47c9b9,null))['catch'](handleError(_0x47c9b9,null));};exports['describe']=function(_0x418e9a,_0x269d0f){return db['SmsAccount']['describe']()[_0xfeee('0x1c')](respondWithResult(_0x269d0f,null))[_0xfeee('0x25')](handleError(_0x269d0f,null));};exports[_0xfeee('0x5e')]=function(_0x2a5212,_0x356177,_0x253055){if(_0x2a5212[_0xfeee('0x56')]['id']){delete _0x2a5212[_0xfeee('0x56')]['id'];}return db[_0xfeee('0x3a')]['find']({'where':{'id':_0x2a5212[_0xfeee('0x5d')]['id']}})[_0xfeee('0x1c')](handleEntityNotFound(_0x356177,null))[_0xfeee('0x1c')](function(_0x27c047){if(_0x27c047){_0x2a5212['body'][_0xfeee('0x5f')]=_0x27c047['id'];return db['Disposition'][_0xfeee('0x5c')](_0x2a5212[_0xfeee('0x56')]);}})[_0xfeee('0x1c')](respondWithResult(_0x356177,null))[_0xfeee('0x25')](handleError(_0x356177,null));};exports[_0xfeee('0x60')]=function(_0x17cd6f,_0x53fd5d,_0x33eef6){var _0xd85039={'raw':![],'where':{}};var _0x2db988={};var _0x1735f1={'count':0x0,'rows':[]};return db[_0xfeee('0x3a')][_0xfeee('0x61')]({'where':{'id':_0x17cd6f[_0xfeee('0x5d')]['id']}})[_0xfeee('0x1c')](handleEntityNotFound(_0x53fd5d,null))[_0xfeee('0x1c')](function(_0x24d4cd){if(_0x24d4cd){_0x2db988[_0xfeee('0x3e')]=_[_0xfeee('0x40')](db[_0xfeee('0x62')][_0xfeee('0x3b')]);_0x2db988[_0xfeee('0x3f')]=_[_0xfeee('0x40')](_0x17cd6f['query']);_0x2db988[_0xfeee('0x41')]=_[_0xfeee('0x42')](_0x2db988[_0xfeee('0x3e')],_0x2db988[_0xfeee('0x3f')]);_0xd85039['attributes']=_['intersection'](_0x2db988[_0xfeee('0x3e')],qs[_0xfeee('0x43')](_0x17cd6f['query'][_0xfeee('0x43')]));_0xd85039[_0xfeee('0x44')]=_0xd85039[_0xfeee('0x44')]['length']?_0xd85039[_0xfeee('0x44')]:_0x2db988[_0xfeee('0x3e')];if(!_0x17cd6f[_0xfeee('0x3f')][_0xfeee('0x46')](_0xfeee('0x63'))){_0xd85039[_0xfeee('0x2c')]=qs['limit'](_0x17cd6f[_0xfeee('0x3f')][_0xfeee('0x2c')]);_0xd85039[_0xfeee('0x2a')]=qs[_0xfeee('0x2a')](_0x17cd6f['query'][_0xfeee('0x2a')]);}_0xd85039[_0xfeee('0x47')]=qs['sort'](_0x17cd6f[_0xfeee('0x3f')][_0xfeee('0x48')]);_0xd85039[_0xfeee('0x49')]=qs['filters'](_[_0xfeee('0x4a')](_0x17cd6f[_0xfeee('0x3f')],_0x2db988[_0xfeee('0x41')]));_0xd85039['where'][_0xfeee('0x5f')]=_0x24d4cd['id'];if(_0x17cd6f['query'][_0xfeee('0x4b')]){_0xd85039[_0xfeee('0x49')]=_['merge'](_0xd85039[_0xfeee('0x49')],{'$or':_[_0xfeee('0x39')](_0xd85039[_0xfeee('0x44')],function(_0x117b0c){var _0x4dab6a={};_0x4dab6a[_0x117b0c]={'$like':'%'+_0x17cd6f[_0xfeee('0x3f')][_0xfeee('0x4b')]+'%'};return _0x4dab6a;})});}_0xd85039=_[_0xfeee('0x4e')]({},_0xd85039,_0x17cd6f[_0xfeee('0x4f')]);return db[_0xfeee('0x62')][_0xfeee('0x2d')]({'where':_0xd85039[_0xfeee('0x49')]})['then'](function(_0x49d9ff){_0x1735f1[_0xfeee('0x2d')]=_0x49d9ff;if(_0x17cd6f[_0xfeee('0x3f')][_0xfeee('0x50')]){_0xd85039['include']=[{'all':!![]}];}return db[_0xfeee('0x62')]['findAll'](_0xd85039);})[_0xfeee('0x1c')](function(_0xdf8302){_0x1735f1[_0xfeee('0x52')]=_0xdf8302;return _0x1735f1;});}})[_0xfeee('0x1c')](respondWithFilteredResult(_0x53fd5d,_0xd85039))[_0xfeee('0x25')](handleError(_0x53fd5d,null));};exports[_0xfeee('0x64')]=function(_0x2f35b5,_0x15d7b7,_0xdd0a0d){return db[_0xfeee('0x3a')][_0xfeee('0x55')]({'where':{'id':_0x2f35b5[_0xfeee('0x5d')]['id']}})['then'](handleEntityNotFound(_0x15d7b7,null))['then'](function(_0xdd133b){if(_0xdd133b){return _0xdd133b[_0xfeee('0x64')](_0x2f35b5[_0xfeee('0x3f')][_0xfeee('0x65')]);}})[_0xfeee('0x1c')](respondWithStatusCode(_0x15d7b7,null))['catch'](handleError(_0x15d7b7,null));};exports[_0xfeee('0x66')]=function(_0x31fc55,_0x305b5c,_0x1a49b2){if(_0x31fc55[_0xfeee('0x56')]['id']){delete _0x31fc55[_0xfeee('0x56')]['id'];}return db[_0xfeee('0x3a')][_0xfeee('0x55')]({'where':{'id':_0x31fc55[_0xfeee('0x5d')]['id']}})[_0xfeee('0x1c')](handleEntityNotFound(_0x305b5c,null))[_0xfeee('0x1c')](function(_0x5a0a02){if(_0x5a0a02){_0x31fc55[_0xfeee('0x56')]['SmsAccountId']=_0x5a0a02['id'];return db['CannedAnswer'][_0xfeee('0x5c')](_0x31fc55[_0xfeee('0x56')]);}})[_0xfeee('0x1c')](respondWithResult(_0x305b5c,null))['catch'](handleError(_0x305b5c,null));};exports[_0xfeee('0x67')]=function(_0x48d53d,_0x3842ec,_0x13965a){var _0x57e127={'raw':![],'where':{}};var _0x5eeed5={};var _0x43c446={'count':0x0,'rows':[]};return db[_0xfeee('0x3a')][_0xfeee('0x61')]({'where':{'id':_0x48d53d['params']['id']}})['then'](handleEntityNotFound(_0x3842ec,null))[_0xfeee('0x1c')](function(_0x2a6e78){if(_0x2a6e78){_0x5eeed5[_0xfeee('0x3e')]=_[_0xfeee('0x40')](db[_0xfeee('0x68')]['rawAttributes']);_0x5eeed5[_0xfeee('0x3f')]=_[_0xfeee('0x40')](_0x48d53d['query']);_0x5eeed5[_0xfeee('0x41')]=_[_0xfeee('0x42')](_0x5eeed5['model'],_0x5eeed5['query']);_0x57e127[_0xfeee('0x44')]=_['intersection'](_0x5eeed5['model'],qs[_0xfeee('0x43')](_0x48d53d[_0xfeee('0x3f')][_0xfeee('0x43')]));_0x57e127['attributes']=_0x57e127['attributes'][_0xfeee('0x45')]?_0x57e127[_0xfeee('0x44')]:_0x5eeed5['model'];if(!_0x48d53d[_0xfeee('0x3f')][_0xfeee('0x46')](_0xfeee('0x63'))){_0x57e127[_0xfeee('0x2c')]=qs[_0xfeee('0x2c')](_0x48d53d[_0xfeee('0x3f')]['limit']);_0x57e127[_0xfeee('0x2a')]=qs[_0xfeee('0x2a')](_0x48d53d[_0xfeee('0x3f')][_0xfeee('0x2a')]);}_0x57e127[_0xfeee('0x47')]=qs[_0xfeee('0x48')](_0x48d53d['query'][_0xfeee('0x48')]);_0x57e127['where']=qs[_0xfeee('0x41')](_[_0xfeee('0x4a')](_0x48d53d[_0xfeee('0x3f')],_0x5eeed5['filters']));_0x57e127['where']['SmsAccountId']=_0x2a6e78['id'];if(_0x48d53d[_0xfeee('0x3f')]['filter']){_0x57e127[_0xfeee('0x49')]=_[_0xfeee('0x4e')](_0x57e127[_0xfeee('0x49')],{'$or':_['map'](_0x57e127[_0xfeee('0x44')],function(_0x188b7e){var _0x43d6e9={};_0x43d6e9[_0x188b7e]={'$like':'%'+_0x48d53d[_0xfeee('0x3f')][_0xfeee('0x4b')]+'%'};return _0x43d6e9;})});}_0x57e127=_['merge']({},_0x57e127,_0x48d53d['options']);return db[_0xfeee('0x68')][_0xfeee('0x2d')]({'where':_0x57e127[_0xfeee('0x49')]})[_0xfeee('0x1c')](function(_0x274fcd){_0x43c446[_0xfeee('0x2d')]=_0x274fcd;if(_0x48d53d['query'][_0xfeee('0x50')]){_0x57e127[_0xfeee('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0xfeee('0x51')](_0x57e127);})[_0xfeee('0x1c')](function(_0x12007a){_0x43c446[_0xfeee('0x52')]=_0x12007a;return _0x43c446;});}})['then'](respondWithFilteredResult(_0x3842ec,_0x57e127))[_0xfeee('0x25')](handleError(_0x3842ec,null));};exports[_0xfeee('0x69')]=function(_0x12a9e0,_0x12c76d,_0x3f46e0){return db[_0xfeee('0x3a')][_0xfeee('0x55')]({'where':{'id':_0x12a9e0[_0xfeee('0x5d')]['id']}})[_0xfeee('0x1c')](handleEntityNotFound(_0x12c76d,null))[_0xfeee('0x1c')](function(_0x48ef28){if(_0x48ef28){return _0x48ef28[_0xfeee('0x69')](_0x12a9e0[_0xfeee('0x3f')][_0xfeee('0x65')]);}})[_0xfeee('0x1c')](respondWithStatusCode(_0x12c76d,null))[_0xfeee('0x25')](handleError(_0x12c76d,null));};exports[_0xfeee('0x6a')]=function(_0x5e957c,_0x1cbc19,_0x3ec114){var _0x9ef470={'channel':_0xfeee('0x6b')};var _0x5c95e7=[];var _0x2c86d7=[];var _0x362a61={};return db['SmsAccount'][_0xfeee('0x55')]({'where':{'id':_0x5e957c[_0xfeee('0x5d')]['id']},'include':[{'model':db[_0xfeee('0x6c')],'as':_0xfeee('0x6d')}]})[_0xfeee('0x1c')](handleEntityNotFound(_0x1cbc19,null))[_0xfeee('0x1c')](function(_0x422a63){_0x9ef470['account']=_0x422a63;_0x9ef470['applications']=_[_0xfeee('0x6e')](_0x422a63['Applications'],[_0xfeee('0x6f')],[_0xfeee('0x70')]);if(_0x9ef470['account'][_0xfeee('0x6d')]){delete _0x9ef470[_0xfeee('0x71')][_0xfeee('0x6d')];}return db[_0xfeee('0x72')][_0xfeee('0x73')]();})[_0xfeee('0x1c')](function(_0x4459d0){if(!_0x4459d0){throw new db['Sequelize'][(_0xfeee('0x74'))](_0xfeee('0x75'));}_0x5c95e7=_[_0xfeee('0x76')](_['keys'](_0x4459d0),[_0xfeee('0x77'),_0xfeee('0x78')]);_0x2c86d7=_['difference'](_['keys'](_0x4459d0),[_0xfeee('0x77'),_0xfeee('0x78'),_0xfeee('0x79'),_0xfeee('0x7a')]);_0x9ef470[_0xfeee('0x56')]={'mapKey':_0xfeee('0x7b')};if(_0x9ef470[_0xfeee('0x71')][_0xfeee('0x4c')]){switch(_0x9ef470[_0xfeee('0x71')]['type']){case _0xfeee('0x7c'):_0x9ef470['body'][_0xfeee('0x7d')]=_0x5e957c[_0xfeee('0x56')][_0xfeee('0x7e')];_0x9ef470[_0xfeee('0x56')][_0xfeee('0x56')]=_0x5e957c[_0xfeee('0x56')][_0xfeee('0x7f')];_0x9ef470[_0xfeee('0x56')]['messageId']=_0x5e957c[_0xfeee('0x56')][_0xfeee('0x80')];break;case _0xfeee('0x81'):_0x9ef470[_0xfeee('0x56')][_0xfeee('0x7d')]='+'+_0x5e957c[_0xfeee('0x56')][_0xfeee('0x82')];_0x9ef470[_0xfeee('0x56')][_0xfeee('0x56')]=_0x5e957c[_0xfeee('0x56')][_0xfeee('0x83')];break;case _0xfeee('0x84'):_0x9ef470[_0xfeee('0x56')][_0xfeee('0x7d')]=_0x5e957c[_0xfeee('0x56')][_0xfeee('0x7d')];_0x9ef470[_0xfeee('0x56')]['body']=_0x5e957c[_0xfeee('0x56')][_0xfeee('0x24')];break;case _0xfeee('0x85'):_0x9ef470[_0xfeee('0x56')][_0xfeee('0x7d')]=_0x5e957c[_0xfeee('0x56')][_0xfeee('0x7d')];_0x9ef470['body'][_0xfeee('0x56')]=_0x5e957c[_0xfeee('0x56')]['body'];_0x9ef470[_0xfeee('0x56')][_0xfeee('0x86')]=_0x5e957c[_0xfeee('0x56')][_0xfeee('0x87')];break;case _0xfeee('0x88'):_0x9ef470[_0xfeee('0x56')]['from']=_0x5e957c[_0xfeee('0x56')][_0xfeee('0x7e')];_0x9ef470['body'][_0xfeee('0x56')]=_0x5e957c[_0xfeee('0x56')][_0xfeee('0x89')];_0x9ef470['body'][_0xfeee('0x86')]=_0x5e957c[_0xfeee('0x56')][_0xfeee('0x8a')];break;case _0xfeee('0x8b'):_0x9ef470[_0xfeee('0x56')][_0xfeee('0x7d')]='+'+_0x5e957c[_0xfeee('0x56')][_0xfeee('0x8c')][0x0][_0xfeee('0x7d')];_0x9ef470[_0xfeee('0x56')][_0xfeee('0x56')]=_0x5e957c[_0xfeee('0x56')][_0xfeee('0x8c')][0x0]['text'];_0x9ef470['body'][_0xfeee('0x86')]=_0x5e957c[_0xfeee('0x56')][_0xfeee('0x8c')][0x0]['messageId'];break;case _0xfeee('0x8d'):_0x9ef470[_0xfeee('0x56')][_0xfeee('0x7d')]=_0x5e957c[_0xfeee('0x56')][_0xfeee('0x8e')];_0x9ef470[_0xfeee('0x56')][_0xfeee('0x56')]=_0x5e957c[_0xfeee('0x56')][_0xfeee('0x8f')][_0xfeee('0x24')];break;case _0xfeee('0x90'):_0x9ef470['body']['from']=_0x5e957c[_0xfeee('0x56')][_0xfeee('0x91')];_0x9ef470[_0xfeee('0x56')][_0xfeee('0x56')]=_0x5e957c[_0xfeee('0x56')][_0xfeee('0x83')];_0x9ef470['body']['messageId']=_0x5e957c[_0xfeee('0x56')][_0xfeee('0x92')];break;case'bandwidth':_0x9ef470[_0xfeee('0x56')][_0xfeee('0x86')]=_0x5e957c[_0xfeee('0x56')][0x0][_0xfeee('0x24')]['id'];_0x9ef470[_0xfeee('0x56')][_0xfeee('0x7d')]=_0x5e957c[_0xfeee('0x56')][0x0]['message'][_0xfeee('0x7d')];_0x9ef470[_0xfeee('0x56')][_0xfeee('0x56')]=_0x5e957c[_0xfeee('0x56')][0x0][_0xfeee('0x24')][_0xfeee('0x83')];break;case _0xfeee('0x93'):_0x9ef470[_0xfeee('0x56')][_0xfeee('0x7d')]=_0x5e957c[_0xfeee('0x56')]['from'];_0x9ef470[_0xfeee('0x56')][_0xfeee('0x56')]=_0x5e957c[_0xfeee('0x56')]['message'];_0x9ef470[_0xfeee('0x56')][_0xfeee('0x86')]=_0x5e957c[_0xfeee('0x56')]['refid'];break;}}if(_0x9ef470[_0xfeee('0x56')]['id']){delete _0x9ef470[_0xfeee('0x56')]['id'];}if(_[_0xfeee('0x94')](_0x9ef470[_0xfeee('0x56')][_0xfeee('0x7d')])){throw new db[(_0xfeee('0x95'))][(_0xfeee('0x74'))](_0xfeee('0x96'));}if(_[_0xfeee('0x94')](_0x9ef470['body'][_0xfeee('0x56')])||_0x9ef470[_0xfeee('0x56')][_0xfeee('0x56')]===''){throw new db[(_0xfeee('0x95'))]['ValidationError'](_0xfeee('0x97'));}if(_[_0xfeee('0x94')](_0x9ef470['body'][_0xfeee('0x98')])){throw new db[(_0xfeee('0x95'))]['ValidationError'](_0xfeee('0x99')+_0x2c86d7);}if(!_['includes'](_0x2c86d7,_0x9ef470[_0xfeee('0x56')][_0xfeee('0x98')])){throw new db[(_0xfeee('0x95'))][(_0xfeee('0x74'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2c86d7);}_0x362a61[_0x9ef470[_0xfeee('0x56')][_0xfeee('0x98')]]=_0x9ef470[_0xfeee('0x56')][_0xfeee('0x7d')];return db[_0xfeee('0x9a')]['find']({'where':{'id':_0x9ef470[_0xfeee('0x71')][_0xfeee('0x7a')]},'include':[{'model':db[_0xfeee('0x72')],'as':'Contacts','where':_0x362a61,'limit':0x1,'order':[[_0xfeee('0x78'),'DESC']]}]});})['then'](handleEntityNotFound(_0x1cbc19,null))['then'](function(_0x5c1566){if(_0x5c1566){_0x9ef470[_0xfeee('0x9b')]=_[_0xfeee('0x9c')](_0x5c1566,[_0xfeee('0x9d')]);if(_0x5c1566[_0xfeee('0x9d')][_0xfeee('0x45')]){return _0x5c1566[_0xfeee('0x9d')][0x0];}var _0x487564=_[_0xfeee('0x9e')](_0x9ef470[_0xfeee('0x56')],{'firstName':_0x9ef470[_0xfeee('0x56')][_0xfeee('0x7d')],'ListId':_0x5c1566['id']});_0x487564[_0x9ef470[_0xfeee('0x56')]['mapKey']]=_0x9ef470[_0xfeee('0x56')][_0xfeee('0x7d')];return db['CmContact'][_0xfeee('0x5c')](_0x487564,{'fields':_0x5c95e7,'raw':!![]});}})['then'](handleEntityNotFound(_0x1cbc19,null))[_0xfeee('0x1c')](function(_0x4f798d){if(_0x4f798d){_0x9ef470['contact']=_0x4f798d;var _0x519dc2={'ContactId':_0x4f798d['id'],'phone':_0x9ef470[_0xfeee('0x56')]['from'],'SmsAccountId':_0x5e957c[_0xfeee('0x5d')]['id']};var _0x9c349c={'ContactId':_0x4f798d['id'],'SmsAccountId':_0x5e957c[_0xfeee('0x5d')]['id'],'closed':![]};return db[_0xfeee('0x9f')]['find']({'where':_0x9c349c})['then'](function(_0x44357e){if(_0x44357e){return[_0x44357e,![]];}return db['SmsInteraction'][_0xfeee('0x5c')](_0x519dc2)[_0xfeee('0x1c')](function(_0x10e258){return[_0x10e258,!![]];});});}})[_0xfeee('0xa0')](function(_0x1362c5,_0x45606f){_0x9ef470[_0xfeee('0xa1')]=_0x1362c5['get']({'plain':!![]});_0x9ef470[_0xfeee('0xa1')][_0xfeee('0xa2')]=![];if(_0x45606f){if(_0x9ef470[_0xfeee('0x71')][_0xfeee('0xa3')]){_0x9ef470['applications'][_0xfeee('0xa4')]({'id':0x0,'priority':_0x9ef470[_0xfeee('0xa5')][_0xfeee('0x45')]+0x1,'app':'close','appdata':_0xfeee('0xa6'),'interval':_0xfeee('0xa7')});}_0x9ef470[_0xfeee('0xa1')][_0xfeee('0xa2')]=!![];}return db[_0xfeee('0xa8')][_0xfeee('0x5c')]({'phone':_0x9ef470[_0xfeee('0x56')]['from'],'messageId':_0x9ef470[_0xfeee('0x56')][_0xfeee('0x86')],'body':_0x9ef470[_0xfeee('0x56')][_0xfeee('0x56')],'SmsAccountId':_0x5e957c[_0xfeee('0x5d')]['id'],'SmsInteractionId':_0x1362c5['id'],'direction':'in','ContactId':_0x1362c5['ContactId'],'AttachmentId':_0x9ef470[_0xfeee('0x56')][_0xfeee('0xa9')]});})['then'](function(_0x90cef1){_0x9ef470[_0xfeee('0x24')]=_0x90cef1;if(_0x9ef470[_0xfeee('0xa1')][_0xfeee('0xaa')]){return db[_0xfeee('0xab')][_0xfeee('0x55')]({'attributes':['id',_0xfeee('0x36')],'where':{'id':_0x9ef470['interaction']['UserId']}})[_0xfeee('0x1c')](function(_0xc3a2de){if(_0xc3a2de){_0x9ef470[_0xfeee('0xa5')][_0xfeee('0xac')]({'id':0x0,'priority':0x0,'app':_0xfeee('0xad'),'appdata':_0xc3a2de[_0xfeee('0x36')]+','+(_0x9ef470[_0xfeee('0x71')]['waitForTheAssignedAgent']||0xa),'interval':_0xfeee('0xa7')});}return respondWithRpcPromise('Start',_0xfeee('0xae'),_0x9ef470);});}return respondWithRpcPromise('Start',_0xfeee('0xae'),_0x9ef470);})[_0xfeee('0x1c')](function(_0x36b763){if(_0x36b763){var _0x194fa6=0xc8;var _0x46901e='receiveMessage';logger[_0xfeee('0x1d')](_0xfeee('0xaf'),_0x46901e,_0x194fa6,_0xfeee('0xb0'));logger[_0xfeee('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x46901e,_0x194fa6,'entity\x20found',JSON['stringify'](_0x36b763));if(_0x9ef470['account'][_0xfeee('0x4c')]==='twilio'){return _0x1cbc19[_0xfeee('0x27')](_0x194fa6)['set'](_0xfeee('0xb1'),'text/xml')['send']('\x0a');}else{return _0x1cbc19[_0xfeee('0x27')](_0x194fa6)[_0xfeee('0x29')](_0x36b763);}}})[_0xfeee('0x25')](handleError(_0x1cbc19,null));};exports[_0xfeee('0xb2')]=function(_0x3b7e60,_0x2a5168){var _0x2dbd02=_0x3b7e60[_0xfeee('0x5d')]['id'];var _0x168e97=_0x3b7e60[_0xfeee('0x56')];var _0x1a8fa4=0xc8;var _0x4f5d81=null;return db[_0xfeee('0xb3')][_0xfeee('0xb4')]({'isolationLevel':db[_0xfeee('0xb3')][_0xfeee('0xb5')][_0xfeee('0xb6')][_0xfeee('0xb7')]},function(_0x18f38b){return db[_0xfeee('0x3a')][_0xfeee('0x61')]({'where':{'id':_0x2dbd02},'transaction':_0x18f38b})[_0xfeee('0x1c')](function(_0x4be77c){if(_0x4be77c){return db[_0xfeee('0x6c')][_0xfeee('0x31')]({'where':{'SmsAccountId':_0x2dbd02},'transaction':_0x18f38b})[_0xfeee('0x1c')](function(){var _0x1a6aed=_[_0xfeee('0x39')](_0x168e97,function(_0x204461){_0x204461[_0xfeee('0x5f')]=_0x2dbd02;return _0x204461;});return db[_0xfeee('0x6c')]['bulkCreate'](_0x1a6aed,{'transaction':_0x18f38b});});}else{_0x1a8fa4=0x194;_0x4f5d81=[];}});})['then'](function(){if(_0x1a8fa4!==0x194){return db[_0xfeee('0x6c')]['findAndCountAll']({'where':{'SmsAccountId':_0x2dbd02},'order':'priority'})[_0xfeee('0x1c')](function(_0x24faa2){_0x4f5d81=_0x24faa2;});}})['catch'](function(_0x3cc36a){_0x1a8fa4=0x1f4;logger[_0xfeee('0x22')](_0x3cc36a[_0xfeee('0x35')]);if(_0x3cc36a['name']){delete _0x3cc36a['name'];}_0x4f5d81=_0x3cc36a;})[_0xfeee('0xb8')](function(){if(_0x4f5d81===null){_0x2a5168[_0xfeee('0x26')](_0x1a8fa4);}else{if(_0x1a8fa4===0x1f4){_0x2a5168['status'](_0x1a8fa4)['send'](_0x4f5d81);}else{_0x2a5168[_0xfeee('0x27')](_0x1a8fa4)[_0xfeee('0x29')](_0x4f5d81);}}});};exports[_0xfeee('0xb9')]=function(_0x19163e,_0x4dd461,_0x1af17c){var _0x9f1c88={};var _0x64d9d7={};var _0x191290;var _0x4eaf05;return db[_0xfeee('0x3a')]['findOne']({'where':{'id':_0x19163e[_0xfeee('0x5d')]['id']}})[_0xfeee('0x1c')](handleEntityNotFound(_0x4dd461,null))[_0xfeee('0x1c')](function(_0x241d67){if(_0x241d67){_0x191290=_0x241d67;_0x64d9d7[_0xfeee('0x3e')]=_[_0xfeee('0x40')](db['SmsApplication'][_0xfeee('0x3b')]);_0x64d9d7[_0xfeee('0x3f')]=_['keys'](_0x19163e[_0xfeee('0x3f')]);_0x64d9d7['filters']=_['intersection'](_0x64d9d7[_0xfeee('0x3e')],_0x64d9d7[_0xfeee('0x3f')]);_0x9f1c88['attributes']=_[_0xfeee('0x42')](_0x64d9d7[_0xfeee('0x3e')],qs['fields'](_0x19163e[_0xfeee('0x3f')][_0xfeee('0x43')]));_0x9f1c88[_0xfeee('0x44')]=_0x9f1c88[_0xfeee('0x44')]['length']?_0x9f1c88[_0xfeee('0x44')]:_0x64d9d7[_0xfeee('0x3e')];_0x9f1c88[_0xfeee('0x47')]=qs[_0xfeee('0x48')](_0x19163e['query'][_0xfeee('0x48')]);_0x9f1c88[_0xfeee('0x49')]=qs['filters'](_[_0xfeee('0x4a')](_0x19163e['query'],_0x64d9d7[_0xfeee('0x41')]));if(_0x19163e[_0xfeee('0x3f')][_0xfeee('0x4b')]){_0x9f1c88[_0xfeee('0x49')]=_[_0xfeee('0x4e')](_0x9f1c88['where'],{'$or':_['map'](_0x9f1c88[_0xfeee('0x44')],function(_0x115310){var _0x3fc4f2={};_0x3fc4f2[_0x115310]={'$like':'%'+_0x19163e['query'][_0xfeee('0x4b')]+'%'};return _0x3fc4f2;})});}_0x9f1c88=_[_0xfeee('0x4e')]({},_0x9f1c88,_0x19163e['options']);return _0x191290[_0xfeee('0xb9')](_0x9f1c88);}})['then'](function(_0x3bfb29){if(_0x3bfb29){_0x4eaf05=_0x3bfb29[_0xfeee('0x45')];if(!_0x19163e['query'][_0xfeee('0x46')](_0xfeee('0x63'))){_0x9f1c88['limit']=qs[_0xfeee('0x2c')](_0x19163e[_0xfeee('0x3f')][_0xfeee('0x2c')]);_0x9f1c88[_0xfeee('0x2a')]=qs[_0xfeee('0x2a')](_0x19163e[_0xfeee('0x3f')][_0xfeee('0x2a')]);}return _0x191290['getApplications'](_0x9f1c88);}})[_0xfeee('0x1c')](function(_0x336078){if(_0x336078){return _0x336078?{'count':_0x4eaf05,'rows':_0x336078}:null;}})['then'](respondWithResult(_0x4dd461,null))[_0xfeee('0x25')](handleError(_0x4dd461,null));};exports[_0xfeee('0xba')]=function(_0x5ad3e9,_0x155ff0,_0xf0cebd){var _0x33cc5d={'raw':![],'where':{}};var _0x3d8078={};var _0x505929={'count':0x0,'rows':[]};return db[_0xfeee('0x3a')][_0xfeee('0x61')]({'where':{'id':_0x5ad3e9[_0xfeee('0x5d')]['id']}})['then'](handleEntityNotFound(_0x155ff0,null))['then'](function(_0x5e2333){if(_0x5e2333){_0x3d8078['model']=_[_0xfeee('0x40')](db[_0xfeee('0x9f')][_0xfeee('0x3b')]);_0x3d8078[_0xfeee('0x3f')]=_[_0xfeee('0x40')](_0x5ad3e9[_0xfeee('0x3f')]);_0x3d8078['filters']=_[_0xfeee('0x42')](_0x3d8078['model'],_0x3d8078[_0xfeee('0x3f')]);_0x33cc5d[_0xfeee('0x44')]=_['intersection'](_0x3d8078[_0xfeee('0x3e')],qs[_0xfeee('0x43')](_0x5ad3e9['query'][_0xfeee('0x43')]));_0x33cc5d[_0xfeee('0x44')]=_0x33cc5d[_0xfeee('0x44')][_0xfeee('0x45')]?_0x33cc5d[_0xfeee('0x44')]:_0x3d8078[_0xfeee('0x3e')];if(!_0x5ad3e9[_0xfeee('0x3f')][_0xfeee('0x46')]('nolimit')){_0x33cc5d[_0xfeee('0x2c')]=qs[_0xfeee('0x2c')](_0x5ad3e9['query']['limit']);_0x33cc5d[_0xfeee('0x2a')]=qs[_0xfeee('0x2a')](_0x5ad3e9[_0xfeee('0x3f')]['offset']);}_0x33cc5d[_0xfeee('0x47')]=qs[_0xfeee('0x48')](_0x5ad3e9[_0xfeee('0x3f')]['sort']);_0x33cc5d[_0xfeee('0x49')]=qs[_0xfeee('0x41')](_[_0xfeee('0x4a')](_0x5ad3e9[_0xfeee('0x3f')],_0x3d8078[_0xfeee('0x41')]));_0x33cc5d[_0xfeee('0x49')]['SmsAccountId']=_0x5e2333['id'];if(_0x5ad3e9['query'][_0xfeee('0x4b')]){_0x33cc5d['where']=_[_0xfeee('0x4e')](_0x33cc5d[_0xfeee('0x49')],{'$or':_['map'](_0x33cc5d[_0xfeee('0x44')],function(_0x2aaff0){var _0xe70f5d={};_0xe70f5d[_0x2aaff0]={'$like':'%'+_0x5ad3e9[_0xfeee('0x3f')][_0xfeee('0x4b')]+'%'};return _0xe70f5d;})});}_0x33cc5d=_[_0xfeee('0x4e')]({},_0x33cc5d,_0x5ad3e9['options']);return db[_0xfeee('0x9f')][_0xfeee('0x2d')]({'where':_0x33cc5d[_0xfeee('0x49')]})['then'](function(_0x5f5a51){_0x505929[_0xfeee('0x2d')]=_0x5f5a51;if(_0x5ad3e9[_0xfeee('0x3f')][_0xfeee('0x50')]){_0x33cc5d[_0xfeee('0x54')]=[{'model':db['CmContact'],'as':_0xfeee('0xbb'),'required':![]},{'model':db[_0xfeee('0xab')],'as':_0xfeee('0xbc'),'attributes':[_0xfeee('0x36'),_0xfeee('0xbd'),_0xfeee('0xbe')],'required':![]},{'model':db['Tag'],'as':_0xfeee('0xbf'),'attributes':['id','name',_0xfeee('0xc0')],'where':_0x5ad3e9[_0xfeee('0x3f')][_0xfeee('0xc1')]?{'id':_0x5ad3e9[_0xfeee('0x3f')][_0xfeee('0xc1')]}:undefined,'required':_0x5ad3e9[_0xfeee('0x3f')][_0xfeee('0xc1')]?!![]:![]}];}return db[_0xfeee('0x9f')]['findAll'](_0x33cc5d);})[_0xfeee('0x1c')](function(_0x355c72){_0x505929['rows']=_0x355c72;return _0x505929;});}})[_0xfeee('0x1c')](respondWithFilteredResult(_0x155ff0,_0x33cc5d))[_0xfeee('0x25')](handleError(_0x155ff0,null));};exports[_0xfeee('0xc2')]=function(_0x10fdc1,_0x140510,_0x375ef8){var _0x523418,_0x15e826,_0xa04539;if(_[_0xfeee('0x94')](_0x10fdc1[_0xfeee('0x56')][_0xfeee('0x56')])||_0x10fdc1[_0xfeee('0x56')]['body']===''){throw new db['Sequelize'][(_0xfeee('0x74'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xfeee('0x94')](_0x10fdc1[_0xfeee('0x56')]['to'])){throw new db['Sequelize']['ValidationError'](_0xfeee('0xc3'));}_0x523418=_0x10fdc1[_0xfeee('0x56')]['to'];return db['SmsAccount'][_0xfeee('0x55')]({'where':{'id':_0x10fdc1[_0xfeee('0x5d')]['id']},'include':[{'model':db['CmList'],'as':_0xfeee('0xc4'),'include':[{'model':db['CmContact'],'as':_0xfeee('0x9d'),'where':{'mobile':_0x523418},'limit':0x1,'order':[[_0xfeee('0x78'),_0xfeee('0xc5')]]}]}]})[_0xfeee('0x1c')](handleEntityNotFound(_0x140510,null))[_0xfeee('0x1c')](function(_0x482d4c){if(_0x482d4c&&_0x482d4c[_0xfeee('0xc4')]){_0x15e826=_0x482d4c[_0xfeee('0x32')]({'plain':!![]});if(_0x15e826['List']&&_0x15e826[_0xfeee('0xc4')][_0xfeee('0x9d')][_0xfeee('0x45')]){return _0x15e826[_0xfeee('0xc4')][_0xfeee('0x9d')][0x0];}return db[_0xfeee('0x72')][_0xfeee('0x5c')](_[_0xfeee('0x9e')](_0x10fdc1[_0xfeee('0x56')],{'firstName':_0x523418,'mobile':_0x523418,'phone':_0x523418,'ListId':_0x15e826[_0xfeee('0x7a')]}));}})['then'](handleEntityNotFound(_0x140510,null))[_0xfeee('0x1c')](function(_0x262932){if(_0x262932){_0xa04539=_0x262932;return db[_0xfeee('0x9f')][_0xfeee('0x55')]({'where':{'ContactId':_0xa04539['id'],'closed':![],'SmsAccountId':_0x15e826['id']}})[_0xfeee('0x1c')](function(_0x1f5264){if(_0x1f5264){return[_0x1f5264,![]];}return db[_0xfeee('0x9f')][_0xfeee('0x5c')]({'UserId':_0x10fdc1[_0xfeee('0x59')]['id'],'ContactId':_0xa04539['id'],'SmsAccountId':_0x15e826['id'],'phone':_0x523418,'firstMsgDirection':_0xfeee('0xc6'),'Messages':[_['merge'](_0x10fdc1['body'],{'read':![],'body':_0x10fdc1[_0xfeee('0x56')][_0xfeee('0x56')],'phone':_0x523418,'SmsAccountId':_0x15e826['id'],'UserId':_0x10fdc1[_0xfeee('0x59')]['id'],'ContactId':_0xa04539['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xfeee('0xc7')}]})['then'](function(_0x512f54){return[_0x512f54,!![]];});});}})[_0xfeee('0xa0')](function(_0x53dd3a,_0x1728b0){if(_0x1728b0){return _0x53dd3a;}return db[_0xfeee('0xa8')][_0xfeee('0x5c')](_[_0xfeee('0x4e')](_0x10fdc1['body'],{'read':![],'body':_0x10fdc1['body'][_0xfeee('0x56')],'phone':_0x523418,'SmsAccountId':_0x15e826['id'],'SmsInteractionId':_0x53dd3a['id'],'UserId':_0x10fdc1[_0xfeee('0x59')]['id'],'ContactId':_0xa04539['id']}))[_0xfeee('0x1c')](function(_0xa39842){_0x53dd3a[_0xfeee('0xc8')][_0xfeee('0xc7')]=[];_0x53dd3a[_0xfeee('0xc8')]['Messages']['push'](_0xa39842['dataValues']);return _0x53dd3a;});})[_0xfeee('0x1c')](respondWithResult(_0x140510,null))[_0xfeee('0x25')](handleError(_0x140510,null));};exports[_0xfeee('0x27')]=function(_0x272c9e,_0x1a17d9,_0x52189b){if(_0x272c9e[_0xfeee('0x56')]['id']){delete _0x272c9e[_0xfeee('0x56')]['id'];}var _0x57f9b0,_0x471ed6,_0x351be4;return db[_0xfeee('0x3a')][_0xfeee('0x55')]({'where':{'id':_0x272c9e[_0xfeee('0x5d')]['id']}})[_0xfeee('0x1c')](handleEntityNotFound(_0x1a17d9,null))[_0xfeee('0x1c')](function(_0x1b6efe){if(_0x1b6efe){_0x351be4=_0x1b6efe;logger[_0xfeee('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfeee('0x27'),_0xfeee('0xc9'),_0x1b6efe[_0xfeee('0x4c')],util[_0xfeee('0xca')](_0x272c9e[_0xfeee('0x56')],{'showHidden':![],'depth':null}));switch(_0x1b6efe['type']){case _0xfeee('0x81'):if(_0x272c9e[_0xfeee('0x56')][_0xfeee('0xcb')]&&_0x272c9e[_0xfeee('0x56')][_0xfeee('0x27')]){_0x471ed6=_0x272c9e[_0xfeee('0x56')][_0xfeee('0x27')];return db[_0xfeee('0xa8')][_0xfeee('0x55')]({'where':{'messageId':_0x272c9e['body'][_0xfeee('0xcb')]}});}break;case _0xfeee('0x84'):if(_0x272c9e[_0xfeee('0x56')][_0xfeee('0xcc')]&&_0x272c9e[_0xfeee('0x56')][_0xfeee('0xcd')]){_0x471ed6=_0x272c9e[_0xfeee('0x56')][_0xfeee('0xcd')];return db[_0xfeee('0xa8')]['find']({'where':{'messageId':_0x272c9e[_0xfeee('0x56')][_0xfeee('0xcc')]}});}break;case'clicksend':if(_0x272c9e[_0xfeee('0x56')]['message_id']&&_0x272c9e[_0xfeee('0x56')]['status_code']){_0x471ed6=_0x272c9e[_0xfeee('0x56')][_0xfeee('0xce')];return db[_0xfeee('0xa8')][_0xfeee('0x55')]({'where':{'messageId':_0x272c9e[_0xfeee('0x56')][_0xfeee('0x87')]}});}break;case _0xfeee('0x8b'):var _0x5790f6=_0x272c9e[_0xfeee('0x56')]['results'][0x0];if(_0x5790f6[_0xfeee('0x86')]&&_0x5790f6[_0xfeee('0x27')]['groupName']===_0xfeee('0xcf')){_0x471ed6=_0x5790f6[_0xfeee('0x27')]['groupName'];return db[_0xfeee('0xa8')]['find']({'where':{'messageId':_0x5790f6[_0xfeee('0x86')]}});}break;case _0xfeee('0x90'):if(_0x272c9e[_0xfeee('0x56')][_0xfeee('0x86')]&&_0x272c9e[_0xfeee('0x56')][_0xfeee('0x27')]){_0x471ed6=_0x272c9e[_0xfeee('0x56')]['status'];return db[_0xfeee('0xa8')][_0xfeee('0x55')]({'where':{'messageId':_0x272c9e[_0xfeee('0x56')]['messageId']}});}break;case'bandwidth':if(_0x272c9e[_0xfeee('0x56')][0x0][_0xfeee('0x24')]['id']){_0x471ed6=_0x272c9e[_0xfeee('0x56')][0x0][_0xfeee('0x4c')];return db['SmsMessage'][_0xfeee('0x55')]({'where':{'messageId':_0x272c9e['body'][0x0]['message']['id']}});}break;case _0xfeee('0x93'):if(_0x272c9e['body']['redif']&&_0x272c9e[_0xfeee('0x56')]['status']){_0x471ed6=_0x272c9e['body']['status'];return db[_0xfeee('0xa8')]['find']({'where':{'messageId':_0x272c9e[_0xfeee('0x56')][_0xfeee('0xd0')]}});}break;}}})[_0xfeee('0x1c')](handleEntityNotFound(_0x1a17d9,null))[_0xfeee('0x1c')](function(_0x17dae0){if(_0x17dae0){_0x57f9b0=_0x17dae0;switch(_0x351be4[_0xfeee('0x4c')]){case'skebby':if(_0x471ed6==='DELIVERED'){return _0x57f9b0[_0xfeee('0xd1')]({'read':!![]});}else{logger[_0xfeee('0x22')](_0xfeee('0xaf'),_0xfeee('0x27'),_0xfeee('0x81'),util[_0xfeee('0xca')](_0x272c9e['body'],{'showHidden':![],'depth':null}));}break;case _0xfeee('0x84'):if(_0x471ed6==='1'){return _0x57f9b0[_0xfeee('0xd1')]({'read':!![]});}else{logger[_0xfeee('0x22')](_0xfeee('0xaf'),_0xfeee('0x27'),'skebby',util[_0xfeee('0xca')](_0x272c9e[_0xfeee('0x56')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x272c9e[_0xfeee('0x56')]['error_code']&&_0x471ed6>=0xc8&&_0x471ed6<=0xce){return _0x57f9b0[_0xfeee('0xd1')]({'read':!![]});}else{logger['error'](_0xfeee('0xaf'),_0xfeee('0x27'),_0xfeee('0x85'),util[_0xfeee('0xca')](_0x272c9e[_0xfeee('0x56')],{'showHidden':![],'depth':null}));}break;case _0xfeee('0x8b'):var _0x29a11f=_0x272c9e[_0xfeee('0x56')][_0xfeee('0x8c')][0x0];if(_0x29a11f[_0xfeee('0x27')][_0xfeee('0xd2')]==='DELIVERED'){return _0x57f9b0[_0xfeee('0xd1')]({'read':!![]});}else{logger[_0xfeee('0x22')](_0xfeee('0xaf'),_0xfeee('0x27'),_0xfeee('0x8b'),util[_0xfeee('0xca')](_0x272c9e[_0xfeee('0x56')],{'showHidden':![],'depth':null}));}break;case _0xfeee('0x90'):if(_0x471ed6==_0xfeee('0xd3')||_0x471ed6==_0xfeee('0xd4')){return _0x57f9b0[_0xfeee('0xd1')]({'read':!![]});}else{logger[_0xfeee('0x22')](_0xfeee('0xaf'),_0xfeee('0x27'),'clickatell',util[_0xfeee('0xca')](_0x272c9e[_0xfeee('0x56')],{'showHidden':![],'depth':null}));}break;case _0xfeee('0xd5'):if(_0x471ed6==_0xfeee('0xd6')){return _0x57f9b0[_0xfeee('0xd1')]({'read':!![]});}else{logger[_0xfeee('0x22')](_0xfeee('0xaf'),_0xfeee('0x27'),_0xfeee('0xd5'),util[_0xfeee('0xca')](_0x272c9e['body'],{'showHidden':![],'depth':null}));}break;case _0xfeee('0x93'):if(_0x471ed6==='DELIVRD'||_0x471ed6===_0xfeee('0xd7')){return _0x57f9b0['update']({'read':!![]});}else{logger['error'](_0xfeee('0xaf'),_0xfeee('0x27'),_0xfeee('0x93'),util[_0xfeee('0xca')](_0x272c9e['body'],{'showHidden':![],'depth':null}));}break;}return _0x57f9b0;}})['then'](respondWithResult(_0x1a17d9,null))[_0xfeee('0x25')](handleError(_0x1a17d9,null));};exports[_0xfeee('0xd8')]=function(_0x3c54be,_0x515c58,_0x1ef4da){var _0x4bc041,_0x1a9fc7,_0x4040b7;return db[_0xfeee('0x3a')]['find']({'where':{'id':_0x3c54be['params']['id']}})[_0xfeee('0x1c')](handleEntityNotFound(_0x515c58,null))[_0xfeee('0x1c')](function(_0x797562){if(_0x797562){_0x4040b7=_0x797562;logger[_0xfeee('0x20')](_0xfeee('0xaf'),_0xfeee('0x27'),_0xfeee('0xc9'),_0x797562[_0xfeee('0x4c')],util['inspect'](_0x3c54be[_0xfeee('0x3f')],{'showHidden':![],'depth':null}));switch(_0x797562[_0xfeee('0x4c')]){case _0xfeee('0x8d'):if(_0x3c54be[_0xfeee('0x3f')][_0xfeee('0xd9')]&&_0x3c54be[_0xfeee('0x3f')]['state']){_0x1a9fc7=_0x3c54be[_0xfeee('0x3f')][_0xfeee('0xda')];return db[_0xfeee('0xa8')][_0xfeee('0x55')]({'where':{'messageId':_0x3c54be[_0xfeee('0x3f')][_0xfeee('0xd9')]}});}break;}}})['then'](handleEntityNotFound(_0x515c58,null))['then'](function(_0x42339b){if(_0x42339b){_0x4bc041=_0x42339b;switch(_0x4040b7['type']){case _0xfeee('0x8d'):if(_0x1a9fc7==='2'||_0x1a9fc7==='6'){return _0x4bc041['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfeee('0x27'),_0xfeee('0x8d'),util[_0xfeee('0xca')](_0x3c54be[_0xfeee('0x3f')],{'showHidden':![],'depth':null}));};break;}return _0x4bc041;}})[_0xfeee('0x1c')](respondWithResult(_0x515c58,null))[_0xfeee('0x25')](handleError(_0x515c58,null));};exports['addAgents']=function(_0xe97dce,_0x1330c9,_0x2e7ebc){return db[_0xfeee('0x3a')]['find']({'where':{'id':_0xe97dce[_0xfeee('0x5d')]['id']}})[_0xfeee('0x1c')](handleEntityNotFound(_0x1330c9,null))[_0xfeee('0x1c')](function(_0x31c39d){if(_0x31c39d){return _0x31c39d['addAgents'](_0xe97dce[_0xfeee('0x56')][_0xfeee('0x65')],_[_0xfeee('0x9c')](_0xe97dce[_0xfeee('0x56')],[_0xfeee('0x65'),'id'])||{})[_0xfeee('0xa0')](function(_0x4859e9){for(var _0x376d15=0x0;_0x376d15<_0xe97dce[_0xfeee('0x56')]['ids'][_0xfeee('0x45')];_0x376d15+=0x1){socket[_0xfeee('0xdb')](_0xfeee('0xdc'),{'UserId':Number(_0xe97dce[_0xfeee('0x56')]['ids'][_0x376d15]),'SmsAccountId':Number(_0xe97dce['params']['id'])});}return _0x4859e9;});}})[_0xfeee('0x1c')](respondWithResult(_0x1330c9,null))[_0xfeee('0x25')](handleError(_0x1330c9,null));};exports[_0xfeee('0xdd')]=function(_0xad879a,_0xdf63a8,_0x56b3fa){return db[_0xfeee('0x3a')]['find']({'where':{'id':_0xad879a[_0xfeee('0x5d')]['id']}})[_0xfeee('0x1c')](handleEntityNotFound(_0xdf63a8,null))[_0xfeee('0x1c')](function(_0x10f771){if(_0x10f771){return _0x10f771[_0xfeee('0xdd')](_0xad879a['query'][_0xfeee('0x65')])['then'](function(){if(_['isArray'](_0xad879a[_0xfeee('0x3f')][_0xfeee('0x65')])){for(var _0x5f3580=0x0;_0x5f3580<_0xad879a[_0xfeee('0x3f')][_0xfeee('0x65')]['length'];_0x5f3580+=0x1){socket[_0xfeee('0xdb')](_0xfeee('0xde'),{'UserId':Number(_0xad879a['query'][_0xfeee('0x65')][_0x5f3580]),'SmsAccountId':Number(_0xad879a[_0xfeee('0x5d')]['id'])});}}else{socket[_0xfeee('0xdb')](_0xfeee('0xde'),{'UserId':Number(_0xad879a[_0xfeee('0x3f')][_0xfeee('0x65')]),'SmsAccountId':Number(_0xad879a[_0xfeee('0x5d')]['id'])});}});}})[_0xfeee('0x1c')](respondWithStatusCode(_0xdf63a8,null))[_0xfeee('0x25')](handleError(_0xdf63a8,null));};exports[_0xfeee('0xdf')]=function(_0x5c497c,_0x4a3f62,_0x28fa58){var _0x257993={};var _0x4e4fbe={};var _0xec1890;var _0x1ecea4;return db[_0xfeee('0x3a')]['findOne']({'where':{'id':_0x5c497c['params']['id']}})[_0xfeee('0x1c')](handleEntityNotFound(_0x4a3f62,null))[_0xfeee('0x1c')](function(_0x3292f2){if(_0x3292f2){_0xec1890=_0x3292f2;_0x4e4fbe[_0xfeee('0x3e')]=_[_0xfeee('0x40')](db[_0xfeee('0xab')][_0xfeee('0x3b')]);_0x4e4fbe[_0xfeee('0x3f')]=_[_0xfeee('0x40')](_0x5c497c[_0xfeee('0x3f')]);_0x4e4fbe[_0xfeee('0x41')]=_['intersection'](_0x4e4fbe['model'],_0x4e4fbe['query']);_0x257993[_0xfeee('0x44')]=_[_0xfeee('0x42')](_0x4e4fbe[_0xfeee('0x3e')],qs[_0xfeee('0x43')](_0x5c497c[_0xfeee('0x3f')][_0xfeee('0x43')]));_0x257993['attributes']=_0x257993[_0xfeee('0x44')][_0xfeee('0x45')]?_0x257993[_0xfeee('0x44')]:_0x4e4fbe[_0xfeee('0x3e')];_0x257993['order']=qs[_0xfeee('0x48')](_0x5c497c['query'][_0xfeee('0x48')]);_0x257993[_0xfeee('0x49')]=qs[_0xfeee('0x41')](_['pick'](_0x5c497c[_0xfeee('0x3f')],_0x4e4fbe['filters']));if(_0x5c497c[_0xfeee('0x3f')][_0xfeee('0x4b')]){_0x257993[_0xfeee('0x49')]=_['merge'](_0x257993[_0xfeee('0x49')],{'$or':_[_0xfeee('0x39')](_0x257993[_0xfeee('0x44')],function(_0x22ce4e){var _0x417f8e={};_0x417f8e[_0x22ce4e]={'$like':'%'+_0x5c497c['query'][_0xfeee('0x4b')]+'%'};return _0x417f8e;})});}_0x257993=_[_0xfeee('0x4e')]({},_0x257993,_0x5c497c[_0xfeee('0x4f')]);return _0xec1890[_0xfeee('0xdf')](_0x257993);}})[_0xfeee('0x1c')](function(_0xe2265a){if(_0xe2265a){_0x1ecea4=_0xe2265a[_0xfeee('0x45')];if(!_0x5c497c['query']['hasOwnProperty'](_0xfeee('0x63'))){_0x257993['limit']=qs[_0xfeee('0x2c')](_0x5c497c[_0xfeee('0x3f')]['limit']);_0x257993['offset']=qs[_0xfeee('0x2a')](_0x5c497c[_0xfeee('0x3f')][_0xfeee('0x2a')]);}return _0xec1890[_0xfeee('0xdf')](_0x257993);}})[_0xfeee('0x1c')](function(_0x258d8f){if(_0x258d8f){return _0x258d8f?{'count':_0x1ecea4,'rows':_0x258d8f}:null;}})[_0xfeee('0x1c')](respondWithResult(_0x4a3f62,null))[_0xfeee('0x25')](handleError(_0x4a3f62,null));}; \ No newline at end of file +var _0xf7da=['segmentedMessage','clickatell','text','bandwidth','intelepeer','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','ListId','Contacts','DESC','omit','contact','SmsInteraction','interaction','autoclose','unmanaged','created','SmsMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','twilio','Content-Type','send','\x0a','addApplications','sequelize','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','order','Contact','Owner','fullname','internal','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','defaults','out','Messages','spread','dataValues','push','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','connectel','requestid','statusInt','status_code','DELIVERED','groupName','redif','error_code','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','./smsAccount.socket','jayson/promise','client','http','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','then','destroy','SmsAccounts','UserProfileResource','stack','name','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','SmsAccount','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','create','getDispositions','Disposition','SmsAccountId','removeDispositions','ids','CannedAnswer','findOne','options','sms','SmsApplication','Applications','applications','orderBy','priority','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','Body','messageId','MessageSid','skebby','sender','clicksend','message_id','plivo','infobip','results','csc'];(function(_0x4d8b5a,_0x538927){var _0x3d54e7=function(_0x217fcf){while(--_0x217fcf){_0x4d8b5a['push'](_0x4d8b5a['shift']());}};_0x3d54e7(++_0x538927);}(_0xf7da,0x135));var _0xaf7d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf7da[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaf7d('0x0'));var zipdir=require(_0xaf7d('0x1'));var jsonpatch=require(_0xaf7d('0x2'));var rp=require(_0xaf7d('0x3'));var moment=require(_0xaf7d('0x4'));var BPromise=require(_0xaf7d('0x5'));var Mustache=require(_0xaf7d('0x6'));var util=require('util');var path=require('path');var sox=require(_0xaf7d('0x7'));var csv=require(_0xaf7d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaf7d('0x9'));var _=require(_0xaf7d('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xaf7d('0xb'));var deskjs=require(_0xaf7d('0xc'));var toCsv=require(_0xaf7d('0x8'));var querystring=require(_0xaf7d('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xaf7d('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xaf7d('0xf'));var hardwareService=require(_0xaf7d('0x10'));var logger=require(_0xaf7d('0x11'))(_0xaf7d('0x12'));var utils=require(_0xaf7d('0x13'));var config=require(_0xaf7d('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xaf7d('0x15'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xaf7d('0x16'))(new Redis(config['redis']));require(_0xaf7d('0x17'))['register'](socket);var jayson=require(_0xaf7d('0x18'));var client=jayson[_0xaf7d('0x19')][_0xaf7d('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0x3e7723,_0x2f9b87,_0xe9ac9b,_0x883361){return new BPromise(function(_0x2e8079,_0x34b7b2){var _0xeeaba8=_0x883361||client;return _0xeeaba8['request'](_0x3e7723,_0xe9ac9b)['then'](function(_0x42daec){logger[_0xaf7d('0x1b')]('SmsAccount,\x20%s,\x20%s',_0x2f9b87,_0xaf7d('0x1c'));logger[_0xaf7d('0x1d')](_0xaf7d('0x1e'),_0x2f9b87,'request\x20sent',JSON['stringify'](_0x42daec));if(_0x42daec[_0xaf7d('0x1f')]){if(_0x42daec['error'][_0xaf7d('0x20')]===0x1f4){logger[_0xaf7d('0x1f')](_0xaf7d('0x21'),_0x2f9b87,_0x42daec['error'][_0xaf7d('0x22')]);return _0x34b7b2(_0x42daec[_0xaf7d('0x1f')][_0xaf7d('0x22')]);}logger['error'](_0xaf7d('0x21'),_0x2f9b87,_0x42daec['error'][_0xaf7d('0x22')]);return _0x2e8079(_0x42daec[_0xaf7d('0x1f')]['message']);}else{logger[_0xaf7d('0x1b')](_0xaf7d('0x21'),_0x2f9b87,_0xaf7d('0x1c'));_0x2e8079(_0x42daec[_0xaf7d('0x23')][_0xaf7d('0x22')]);}})[_0xaf7d('0x24')](function(_0x6f04c4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x2f9b87,_0x6f04c4);_0x34b7b2(_0x6f04c4);});});}function respondWithStatusCode(_0x4f629d,_0x251628){_0x251628=_0x251628||0xcc;return function(_0x77ddee){if(_0x77ddee){return _0x4f629d[_0xaf7d('0x25')](_0x251628);}return _0x4f629d[_0xaf7d('0x26')](_0x251628)[_0xaf7d('0x27')]();};}function respondWithResult(_0xc2f457,_0x195326){_0x195326=_0x195326||0xc8;return function(_0x4790aa){if(_0x4790aa){return _0xc2f457[_0xaf7d('0x26')](_0x195326)[_0xaf7d('0x28')](_0x4790aa);}};}function respondWithFilteredResult(_0x4dcb62,_0x34e695){return function(_0x22ee9e){if(_0x22ee9e){var _0x107323=typeof _0x34e695['offset']===_0xaf7d('0x29')&&typeof _0x34e695[_0xaf7d('0x2a')]===_0xaf7d('0x29');var _0x54fcd8=_0x22ee9e[_0xaf7d('0x2b')];var _0x2697a4=_0x107323?0x0:_0x34e695['offset'];var _0x23d339=_0x107323?_0x22ee9e[_0xaf7d('0x2b')]:_0x34e695[_0xaf7d('0x2c')]+_0x34e695[_0xaf7d('0x2a')];var _0x331a25;if(_0x23d339>=_0x54fcd8){_0x23d339=_0x54fcd8;_0x331a25=0xc8;}else{_0x331a25=0xce;}_0x4dcb62[_0xaf7d('0x26')](_0x331a25);return _0x4dcb62['set'](_0xaf7d('0x2d'),_0x2697a4+'-'+_0x23d339+'/'+_0x54fcd8)[_0xaf7d('0x28')](_0x22ee9e);}return null;};}function patchUpdates(_0x6d4010){return function(_0x1748a5){try{jsonpatch[_0xaf7d('0x2e')](_0x1748a5,_0x6d4010,!![]);}catch(_0x3b23b1){return BPromise[_0xaf7d('0x2f')](_0x3b23b1);}return _0x1748a5[_0xaf7d('0x30')]();};}function saveUpdates(_0x20006b,_0xf71842){return function(_0xf0d35e){if(_0xf0d35e){return _0xf0d35e['update'](_0x20006b)[_0xaf7d('0x31')](function(_0x5159b3){return _0x5159b3;});}return null;};}function removeEntity(_0x23fe8b,_0x4bea37){return function(_0x3916d7){if(_0x3916d7){return _0x3916d7[_0xaf7d('0x32')]()['then'](function(){var _0x59a1a4=_0x3916d7['get']({'plain':!![]});var _0x2d5e25=_0xaf7d('0x33');return db[_0xaf7d('0x34')]['destroy']({'where':{'type':_0x2d5e25,'resourceId':_0x59a1a4['id']}})['then'](function(){return _0x3916d7;});})[_0xaf7d('0x31')](function(){_0x23fe8b[_0xaf7d('0x26')](0xcc)[_0xaf7d('0x27')]();});}};}function handleEntityNotFound(_0xb10af6,_0x30cc65){return function(_0x184630){if(!_0x184630){_0xb10af6[_0xaf7d('0x25')](0x194);}return _0x184630;};}function handleError(_0x54e71e,_0x1845ff){_0x1845ff=_0x1845ff||0x1f4;return function(_0x1dc082){logger[_0xaf7d('0x1f')](_0x1dc082[_0xaf7d('0x35')]);if(_0x1dc082[_0xaf7d('0x36')]){delete _0x1dc082['name'];}_0x54e71e[_0xaf7d('0x26')](_0x1845ff)['send'](_0x1dc082);};}exports['index']=function(_0x5e16d2,_0x101707){var _0x16bcf4={'include':[{'model':db[_0xaf7d('0x37')],'as':_0xaf7d('0x38')}]},_0x51c774={},_0x103987={'count':0x0,'rows':[]};var _0x4e36b2=_['map'](db['SmsAccount'][_0xaf7d('0x39')],function(_0x301de8){return{'name':_0x301de8[_0xaf7d('0x3a')],'type':_0x301de8[_0xaf7d('0x3b')][_0xaf7d('0x3c')]};});_0x51c774['model']=_[_0xaf7d('0x3d')](_0x4e36b2,_0xaf7d('0x36'));_0x51c774[_0xaf7d('0x3e')]=_[_0xaf7d('0x3f')](_0x5e16d2[_0xaf7d('0x3e')]);_0x51c774[_0xaf7d('0x40')]=_[_0xaf7d('0x41')](_0x51c774[_0xaf7d('0x42')],_0x51c774[_0xaf7d('0x3e')]);_0x16bcf4[_0xaf7d('0x43')]=_[_0xaf7d('0x41')](_0x51c774[_0xaf7d('0x42')],qs[_0xaf7d('0x44')](_0x5e16d2['query'][_0xaf7d('0x44')]));_0x16bcf4['attributes']=_0x16bcf4[_0xaf7d('0x43')][_0xaf7d('0x45')]?_0x16bcf4[_0xaf7d('0x43')]:_0x51c774[_0xaf7d('0x42')];if(!_0x5e16d2[_0xaf7d('0x3e')][_0xaf7d('0x46')](_0xaf7d('0x47'))){_0x16bcf4[_0xaf7d('0x2a')]=qs[_0xaf7d('0x2a')](_0x5e16d2[_0xaf7d('0x3e')][_0xaf7d('0x2a')]);_0x16bcf4['offset']=qs[_0xaf7d('0x2c')](_0x5e16d2[_0xaf7d('0x3e')][_0xaf7d('0x2c')]);}_0x16bcf4['order']=qs[_0xaf7d('0x48')](_0x5e16d2[_0xaf7d('0x3e')]['sort']);_0x16bcf4['where']=qs[_0xaf7d('0x40')](_[_0xaf7d('0x49')](_0x5e16d2[_0xaf7d('0x3e')],_0x51c774['filters']),_0x4e36b2);if(_0x5e16d2[_0xaf7d('0x3e')]['filter']){_0x16bcf4[_0xaf7d('0x4a')]=_[_0xaf7d('0x4b')](_0x16bcf4[_0xaf7d('0x4a')],{'$or':_[_0xaf7d('0x3d')](_0x4e36b2,function(_0x22792a){if(_0x22792a[_0xaf7d('0x3b')]!==_0xaf7d('0x4c')){var _0x25d1f5={};_0x25d1f5[_0x22792a[_0xaf7d('0x36')]]={'$like':'%'+_0x5e16d2['query'][_0xaf7d('0x4d')]+'%'};return _0x25d1f5;}})});}_0x16bcf4=_[_0xaf7d('0x4b')]({},_0x16bcf4,_0x5e16d2['options']);var _0x457235={'where':_0x16bcf4[_0xaf7d('0x4a')]};return db['SmsAccount'][_0xaf7d('0x2b')](_0x457235)[_0xaf7d('0x31')](function(_0xe24c0f){_0x103987[_0xaf7d('0x2b')]=_0xe24c0f;if(_0x5e16d2[_0xaf7d('0x3e')][_0xaf7d('0x4e')]){_0x16bcf4[_0xaf7d('0x4f')]=[{'all':!![]}];}return db['SmsAccount'][_0xaf7d('0x50')](_0x16bcf4);})[_0xaf7d('0x31')](function(_0x4e4353){_0x103987[_0xaf7d('0x51')]=_0x4e4353;return _0x103987;})[_0xaf7d('0x31')](respondWithFilteredResult(_0x101707,_0x16bcf4))[_0xaf7d('0x24')](handleError(_0x101707,null));};exports[_0xaf7d('0x52')]=function(_0x4ac9c5,_0x31a1d4){var _0x2d57a7={'raw':![],'where':{'id':_0x4ac9c5[_0xaf7d('0x53')]['id']},'include':[{'model':db[_0xaf7d('0x37')],'as':_0xaf7d('0x38')}]},_0x59f6c5={};_0x59f6c5[_0xaf7d('0x42')]=_['keys'](db['SmsAccount'][_0xaf7d('0x39')]);_0x59f6c5[_0xaf7d('0x3e')]=_['keys'](_0x4ac9c5[_0xaf7d('0x3e')]);_0x59f6c5[_0xaf7d('0x40')]=_[_0xaf7d('0x41')](_0x59f6c5[_0xaf7d('0x42')],_0x59f6c5[_0xaf7d('0x3e')]);_0x2d57a7['attributes']=_[_0xaf7d('0x41')](_0x59f6c5[_0xaf7d('0x42')],qs['fields'](_0x4ac9c5[_0xaf7d('0x3e')][_0xaf7d('0x44')]));_0x2d57a7['attributes']=_0x2d57a7['attributes'][_0xaf7d('0x45')]?_0x2d57a7[_0xaf7d('0x43')]:_0x59f6c5['model'];if(_0x4ac9c5[_0xaf7d('0x3e')][_0xaf7d('0x4e')]){_0x2d57a7['include']=[{'all':!![]}];}_0x2d57a7=_[_0xaf7d('0x4b')]({},_0x2d57a7,_0x4ac9c5['options']);return db[_0xaf7d('0x54')]['find'](_0x2d57a7)[_0xaf7d('0x31')](handleEntityNotFound(_0x31a1d4,null))[_0xaf7d('0x31')](respondWithResult(_0x31a1d4,null))[_0xaf7d('0x24')](handleError(_0x31a1d4,null));};exports['create']=function(_0x2946b5,_0x3cae7a){return db[_0xaf7d('0x54')]['create'](_0x2946b5[_0xaf7d('0x55')],{})[_0xaf7d('0x31')](function(_0x11db6a){var _0x16e9cd=_0x2946b5[_0xaf7d('0x56')][_0xaf7d('0x57')]({'plain':!![]});if(!_0x16e9cd)throw new Error(_0xaf7d('0x58'));if(_0x16e9cd['role']===_0xaf7d('0x56')){var _0x4c3614=_0x11db6a['get']({'plain':!![]});var _0x574238='SmsAccounts';return db['UserProfileSection'][_0xaf7d('0x59')]({'where':{'name':_0x574238,'userProfileId':_0x16e9cd[_0xaf7d('0x5a')]},'raw':!![]})['then'](function(_0x42b9e5){if(_0x42b9e5&&_0x42b9e5['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4c3614[_0xaf7d('0x36')],'resourceId':_0x4c3614['id'],'type':_0x42b9e5[_0xaf7d('0x36')],'sectionId':_0x42b9e5['id']},{})['then'](function(){return _0x11db6a;});}else{return _0x11db6a;}})['catch'](function(_0x2ea9d1){logger['error'](_0xaf7d('0x5b'),_0x2ea9d1);throw _0x2ea9d1;});}return _0x11db6a;})['then'](respondWithResult(_0x3cae7a,0xc9))[_0xaf7d('0x24')](handleError(_0x3cae7a,null));};exports[_0xaf7d('0x5c')]=function(_0x55c803,_0x364970){if(_0x55c803[_0xaf7d('0x55')]['id']){delete _0x55c803[_0xaf7d('0x55')]['id'];}return db['SmsAccount'][_0xaf7d('0x59')]({'where':{'id':_0x55c803[_0xaf7d('0x53')]['id']},'include':[{'model':db[_0xaf7d('0x37')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x364970,null))[_0xaf7d('0x31')](saveUpdates(_0x55c803['body'],null))[_0xaf7d('0x31')](respondWithResult(_0x364970,null))[_0xaf7d('0x24')](handleError(_0x364970,null));};exports[_0xaf7d('0x32')]=function(_0x9f7e7a,_0x36160a){return db[_0xaf7d('0x54')][_0xaf7d('0x59')]({'where':{'id':_0x9f7e7a[_0xaf7d('0x53')]['id']}})[_0xaf7d('0x31')](handleEntityNotFound(_0x36160a,null))[_0xaf7d('0x31')](removeEntity(_0x36160a,null))['catch'](handleError(_0x36160a,null));};exports[_0xaf7d('0x5d')]=function(_0x2d7f6d,_0x10aaf3){return db[_0xaf7d('0x54')][_0xaf7d('0x5d')]()[_0xaf7d('0x31')](respondWithResult(_0x10aaf3,null))[_0xaf7d('0x24')](handleError(_0x10aaf3,null));};exports[_0xaf7d('0x5e')]=function(_0x2aee61,_0x2311d6,_0x315485){if(_0x2aee61['body']['id']){delete _0x2aee61['body']['id'];}return db[_0xaf7d('0x54')]['find']({'where':{'id':_0x2aee61['params']['id']}})[_0xaf7d('0x31')](handleEntityNotFound(_0x2311d6,null))[_0xaf7d('0x31')](function(_0x93b13d){if(_0x93b13d){_0x2aee61[_0xaf7d('0x55')]['SmsAccountId']=_0x93b13d['id'];return db['Disposition'][_0xaf7d('0x5f')](_0x2aee61[_0xaf7d('0x55')]);}})[_0xaf7d('0x31')](respondWithResult(_0x2311d6,null))[_0xaf7d('0x24')](handleError(_0x2311d6,null));};exports[_0xaf7d('0x60')]=function(_0x2cd57f,_0x548f1b,_0x617488){var _0x594a89={'raw':![],'where':{}};var _0x219c7d={};var _0x52946a={'count':0x0,'rows':[]};return db[_0xaf7d('0x54')]['findOne']({'where':{'id':_0x2cd57f[_0xaf7d('0x53')]['id']}})[_0xaf7d('0x31')](handleEntityNotFound(_0x548f1b,null))[_0xaf7d('0x31')](function(_0x307186){if(_0x307186){_0x219c7d[_0xaf7d('0x42')]=_[_0xaf7d('0x3f')](db[_0xaf7d('0x61')]['rawAttributes']);_0x219c7d[_0xaf7d('0x3e')]=_['keys'](_0x2cd57f['query']);_0x219c7d[_0xaf7d('0x40')]=_['intersection'](_0x219c7d[_0xaf7d('0x42')],_0x219c7d[_0xaf7d('0x3e')]);_0x594a89[_0xaf7d('0x43')]=_['intersection'](_0x219c7d['model'],qs[_0xaf7d('0x44')](_0x2cd57f[_0xaf7d('0x3e')][_0xaf7d('0x44')]));_0x594a89[_0xaf7d('0x43')]=_0x594a89[_0xaf7d('0x43')][_0xaf7d('0x45')]?_0x594a89['attributes']:_0x219c7d['model'];if(!_0x2cd57f[_0xaf7d('0x3e')]['hasOwnProperty'](_0xaf7d('0x47'))){_0x594a89[_0xaf7d('0x2a')]=qs[_0xaf7d('0x2a')](_0x2cd57f[_0xaf7d('0x3e')]['limit']);_0x594a89['offset']=qs[_0xaf7d('0x2c')](_0x2cd57f[_0xaf7d('0x3e')][_0xaf7d('0x2c')]);}_0x594a89['order']=qs[_0xaf7d('0x48')](_0x2cd57f['query'][_0xaf7d('0x48')]);_0x594a89[_0xaf7d('0x4a')]=qs['filters'](_[_0xaf7d('0x49')](_0x2cd57f[_0xaf7d('0x3e')],_0x219c7d[_0xaf7d('0x40')]));_0x594a89[_0xaf7d('0x4a')][_0xaf7d('0x62')]=_0x307186['id'];if(_0x2cd57f[_0xaf7d('0x3e')][_0xaf7d('0x4d')]){_0x594a89['where']=_['merge'](_0x594a89[_0xaf7d('0x4a')],{'$or':_[_0xaf7d('0x3d')](_0x594a89[_0xaf7d('0x43')],function(_0x265903){var _0x1811e6={};_0x1811e6[_0x265903]={'$like':'%'+_0x2cd57f[_0xaf7d('0x3e')][_0xaf7d('0x4d')]+'%'};return _0x1811e6;})});}_0x594a89=_[_0xaf7d('0x4b')]({},_0x594a89,_0x2cd57f['options']);return db[_0xaf7d('0x61')][_0xaf7d('0x2b')]({'where':_0x594a89[_0xaf7d('0x4a')]})['then'](function(_0x5349b3){_0x52946a['count']=_0x5349b3;if(_0x2cd57f[_0xaf7d('0x3e')][_0xaf7d('0x4e')]){_0x594a89['include']=[{'all':!![]}];}return db['Disposition'][_0xaf7d('0x50')](_0x594a89);})[_0xaf7d('0x31')](function(_0x5cf025){_0x52946a[_0xaf7d('0x51')]=_0x5cf025;return _0x52946a;});}})['then'](respondWithFilteredResult(_0x548f1b,_0x594a89))[_0xaf7d('0x24')](handleError(_0x548f1b,null));};exports[_0xaf7d('0x63')]=function(_0x5660ca,_0x236c5a,_0x476a19){return db['SmsAccount'][_0xaf7d('0x59')]({'where':{'id':_0x5660ca[_0xaf7d('0x53')]['id']}})[_0xaf7d('0x31')](handleEntityNotFound(_0x236c5a,null))[_0xaf7d('0x31')](function(_0x9d347c){if(_0x9d347c){return _0x9d347c[_0xaf7d('0x63')](_0x5660ca[_0xaf7d('0x3e')][_0xaf7d('0x64')]);}})[_0xaf7d('0x31')](respondWithStatusCode(_0x236c5a,null))[_0xaf7d('0x24')](handleError(_0x236c5a,null));};exports['addAnswer']=function(_0x335bed,_0x19bb68,_0x36c194){if(_0x335bed[_0xaf7d('0x55')]['id']){delete _0x335bed[_0xaf7d('0x55')]['id'];}return db['SmsAccount'][_0xaf7d('0x59')]({'where':{'id':_0x335bed[_0xaf7d('0x53')]['id']}})[_0xaf7d('0x31')](handleEntityNotFound(_0x19bb68,null))['then'](function(_0x342b82){if(_0x342b82){_0x335bed[_0xaf7d('0x55')][_0xaf7d('0x62')]=_0x342b82['id'];return db[_0xaf7d('0x65')][_0xaf7d('0x5f')](_0x335bed[_0xaf7d('0x55')]);}})[_0xaf7d('0x31')](respondWithResult(_0x19bb68,null))[_0xaf7d('0x24')](handleError(_0x19bb68,null));};exports['getAnswers']=function(_0x5a6efa,_0x15b111,_0x4397d7){var _0x1a84c6={'raw':![],'where':{}};var _0x5861ab={};var _0x4f0c46={'count':0x0,'rows':[]};return db[_0xaf7d('0x54')][_0xaf7d('0x66')]({'where':{'id':_0x5a6efa[_0xaf7d('0x53')]['id']}})[_0xaf7d('0x31')](handleEntityNotFound(_0x15b111,null))[_0xaf7d('0x31')](function(_0x280cc0){if(_0x280cc0){_0x5861ab[_0xaf7d('0x42')]=_[_0xaf7d('0x3f')](db[_0xaf7d('0x65')][_0xaf7d('0x39')]);_0x5861ab[_0xaf7d('0x3e')]=_[_0xaf7d('0x3f')](_0x5a6efa['query']);_0x5861ab[_0xaf7d('0x40')]=_[_0xaf7d('0x41')](_0x5861ab[_0xaf7d('0x42')],_0x5861ab[_0xaf7d('0x3e')]);_0x1a84c6[_0xaf7d('0x43')]=_[_0xaf7d('0x41')](_0x5861ab[_0xaf7d('0x42')],qs[_0xaf7d('0x44')](_0x5a6efa[_0xaf7d('0x3e')][_0xaf7d('0x44')]));_0x1a84c6[_0xaf7d('0x43')]=_0x1a84c6[_0xaf7d('0x43')]['length']?_0x1a84c6[_0xaf7d('0x43')]:_0x5861ab[_0xaf7d('0x42')];if(!_0x5a6efa[_0xaf7d('0x3e')][_0xaf7d('0x46')](_0xaf7d('0x47'))){_0x1a84c6['limit']=qs[_0xaf7d('0x2a')](_0x5a6efa['query'][_0xaf7d('0x2a')]);_0x1a84c6[_0xaf7d('0x2c')]=qs[_0xaf7d('0x2c')](_0x5a6efa[_0xaf7d('0x3e')][_0xaf7d('0x2c')]);}_0x1a84c6['order']=qs[_0xaf7d('0x48')](_0x5a6efa['query']['sort']);_0x1a84c6[_0xaf7d('0x4a')]=qs['filters'](_[_0xaf7d('0x49')](_0x5a6efa[_0xaf7d('0x3e')],_0x5861ab[_0xaf7d('0x40')]));_0x1a84c6[_0xaf7d('0x4a')][_0xaf7d('0x62')]=_0x280cc0['id'];if(_0x5a6efa[_0xaf7d('0x3e')][_0xaf7d('0x4d')]){_0x1a84c6['where']=_[_0xaf7d('0x4b')](_0x1a84c6[_0xaf7d('0x4a')],{'$or':_[_0xaf7d('0x3d')](_0x1a84c6[_0xaf7d('0x43')],function(_0x4fc869){var _0x337a14={};_0x337a14[_0x4fc869]={'$like':'%'+_0x5a6efa[_0xaf7d('0x3e')]['filter']+'%'};return _0x337a14;})});}_0x1a84c6=_['merge']({},_0x1a84c6,_0x5a6efa[_0xaf7d('0x67')]);return db[_0xaf7d('0x65')][_0xaf7d('0x2b')]({'where':_0x1a84c6[_0xaf7d('0x4a')]})[_0xaf7d('0x31')](function(_0x2cf7cc){_0x4f0c46['count']=_0x2cf7cc;if(_0x5a6efa['query'][_0xaf7d('0x4e')]){_0x1a84c6[_0xaf7d('0x4f')]=[{'all':!![]}];}return db[_0xaf7d('0x65')][_0xaf7d('0x50')](_0x1a84c6);})[_0xaf7d('0x31')](function(_0x1c2b5c){_0x4f0c46[_0xaf7d('0x51')]=_0x1c2b5c;return _0x4f0c46;});}})[_0xaf7d('0x31')](respondWithFilteredResult(_0x15b111,_0x1a84c6))['catch'](handleError(_0x15b111,null));};exports['removeAnswers']=function(_0x18cf93,_0x5edb9d,_0x5886b3){return db['SmsAccount']['find']({'where':{'id':_0x18cf93[_0xaf7d('0x53')]['id']}})[_0xaf7d('0x31')](handleEntityNotFound(_0x5edb9d,null))[_0xaf7d('0x31')](function(_0x5a1d1){if(_0x5a1d1){return _0x5a1d1['removeAnswers'](_0x18cf93[_0xaf7d('0x3e')]['ids']);}})[_0xaf7d('0x31')](respondWithStatusCode(_0x5edb9d,null))[_0xaf7d('0x24')](handleError(_0x5edb9d,null));};exports['notify']=function(_0x4c32ed,_0x254889,_0x58139f){var _0x2af438={'channel':_0xaf7d('0x68')};var _0x337aa4=[];var _0x411aaf=[];var _0x1188d9={};return db[_0xaf7d('0x54')][_0xaf7d('0x59')]({'where':{'id':_0x4c32ed['params']['id']},'include':[{'model':db[_0xaf7d('0x69')],'as':_0xaf7d('0x6a')}]})[_0xaf7d('0x31')](handleEntityNotFound(_0x254889,null))['then'](function(_0x537e7d){_0x2af438['account']=_0x537e7d;_0x2af438[_0xaf7d('0x6b')]=_[_0xaf7d('0x6c')](_0x537e7d[_0xaf7d('0x6a')],[_0xaf7d('0x6d')],['asc']);if(_0x2af438[_0xaf7d('0x6e')][_0xaf7d('0x6a')]){delete _0x2af438['account'][_0xaf7d('0x6a')];}return db[_0xaf7d('0x6f')][_0xaf7d('0x5d')]();})['then'](function(_0x1a2d53){if(!_0x1a2d53){throw new db[(_0xaf7d('0x70'))][(_0xaf7d('0x71'))](_0xaf7d('0x72'));}_0x337aa4=_[_0xaf7d('0x73')](_['keys'](_0x1a2d53),[_0xaf7d('0x74'),_0xaf7d('0x75')]);_0x411aaf=_[_0xaf7d('0x73')](_['keys'](_0x1a2d53),[_0xaf7d('0x74'),_0xaf7d('0x75'),_0xaf7d('0x76'),'ListId']);_0x2af438[_0xaf7d('0x55')]={'mapKey':'mobile'};if(_0x2af438[_0xaf7d('0x6e')]['type']){switch(_0x2af438['account'][_0xaf7d('0x3b')]){case'twilio':_0x2af438[_0xaf7d('0x55')][_0xaf7d('0x77')]=_0x4c32ed[_0xaf7d('0x55')]['From'];_0x2af438[_0xaf7d('0x55')][_0xaf7d('0x55')]=_0x4c32ed[_0xaf7d('0x55')][_0xaf7d('0x78')];_0x2af438[_0xaf7d('0x55')][_0xaf7d('0x79')]=_0x4c32ed[_0xaf7d('0x55')][_0xaf7d('0x7a')];break;case _0xaf7d('0x7b'):_0x2af438[_0xaf7d('0x55')][_0xaf7d('0x77')]='+'+_0x4c32ed[_0xaf7d('0x55')][_0xaf7d('0x7c')];_0x2af438[_0xaf7d('0x55')][_0xaf7d('0x55')]=_0x4c32ed[_0xaf7d('0x55')]['text'];break;case'connectel':_0x2af438[_0xaf7d('0x55')][_0xaf7d('0x77')]=_0x4c32ed['body']['from'];_0x2af438['body'][_0xaf7d('0x55')]=_0x4c32ed[_0xaf7d('0x55')]['message'];break;case _0xaf7d('0x7d'):_0x2af438[_0xaf7d('0x55')][_0xaf7d('0x77')]=_0x4c32ed['body'][_0xaf7d('0x77')];_0x2af438['body']['body']=_0x4c32ed[_0xaf7d('0x55')]['body'];_0x2af438[_0xaf7d('0x55')][_0xaf7d('0x79')]=_0x4c32ed['body'][_0xaf7d('0x7e')];break;case _0xaf7d('0x7f'):_0x2af438[_0xaf7d('0x55')]['from']=_0x4c32ed['body']['From'];_0x2af438[_0xaf7d('0x55')][_0xaf7d('0x55')]=_0x4c32ed[_0xaf7d('0x55')]['Text'];_0x2af438[_0xaf7d('0x55')]['messageId']=_0x4c32ed[_0xaf7d('0x55')]['MessageUUID'];break;case _0xaf7d('0x80'):_0x2af438[_0xaf7d('0x55')][_0xaf7d('0x77')]='+'+_0x4c32ed[_0xaf7d('0x55')][_0xaf7d('0x81')][0x0][_0xaf7d('0x77')];_0x2af438['body']['body']=_0x4c32ed[_0xaf7d('0x55')][_0xaf7d('0x81')][0x0]['text'];_0x2af438[_0xaf7d('0x55')][_0xaf7d('0x79')]=_0x4c32ed[_0xaf7d('0x55')][_0xaf7d('0x81')][0x0][_0xaf7d('0x79')];break;case _0xaf7d('0x82'):_0x2af438[_0xaf7d('0x55')][_0xaf7d('0x77')]=_0x4c32ed[_0xaf7d('0x55')]['originatingAddress'];_0x2af438[_0xaf7d('0x55')][_0xaf7d('0x55')]=_0x4c32ed['body'][_0xaf7d('0x83')]['message'];break;case _0xaf7d('0x84'):_0x2af438[_0xaf7d('0x55')][_0xaf7d('0x77')]=_0x4c32ed[_0xaf7d('0x55')]['fromNumber'];_0x2af438[_0xaf7d('0x55')][_0xaf7d('0x55')]=_0x4c32ed[_0xaf7d('0x55')][_0xaf7d('0x85')];_0x2af438[_0xaf7d('0x55')]['messageId']=_0x4c32ed['body']['replyMessageId'];break;case _0xaf7d('0x86'):_0x2af438[_0xaf7d('0x55')]['messageId']=_0x4c32ed[_0xaf7d('0x55')][0x0][_0xaf7d('0x22')]['id'];_0x2af438['body'][_0xaf7d('0x77')]=_0x4c32ed[_0xaf7d('0x55')][0x0][_0xaf7d('0x22')][_0xaf7d('0x77')];_0x2af438[_0xaf7d('0x55')][_0xaf7d('0x55')]=_0x4c32ed[_0xaf7d('0x55')][0x0][_0xaf7d('0x22')]['text'];break;case _0xaf7d('0x87'):_0x2af438[_0xaf7d('0x55')][_0xaf7d('0x77')]=_0x4c32ed['body'][_0xaf7d('0x77')];_0x2af438[_0xaf7d('0x55')][_0xaf7d('0x55')]=_0x4c32ed[_0xaf7d('0x55')][_0xaf7d('0x22')];_0x2af438[_0xaf7d('0x55')]['messageId']=_0x4c32ed[_0xaf7d('0x55')]['refid'];break;}}if(_0x2af438[_0xaf7d('0x55')]['id']){delete _0x2af438[_0xaf7d('0x55')]['id'];}if(_[_0xaf7d('0x88')](_0x2af438['body'][_0xaf7d('0x77')])){throw new db['Sequelize']['ValidationError'](_0xaf7d('0x89'));}if(_[_0xaf7d('0x88')](_0x2af438[_0xaf7d('0x55')][_0xaf7d('0x55')])||_0x2af438[_0xaf7d('0x55')]['body']===''){throw new db[(_0xaf7d('0x70'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xaf7d('0x88')](_0x2af438['body'][_0xaf7d('0x8a')])){throw new db[(_0xaf7d('0x70'))][(_0xaf7d('0x71'))](_0xaf7d('0x8b')+_0x411aaf);}if(!_[_0xaf7d('0x8c')](_0x411aaf,_0x2af438[_0xaf7d('0x55')][_0xaf7d('0x8a')])){throw new db[(_0xaf7d('0x70'))][(_0xaf7d('0x71'))](_0xaf7d('0x8d')+_0x411aaf);}_0x1188d9[_0x2af438[_0xaf7d('0x55')][_0xaf7d('0x8a')]]=_0x2af438['body'][_0xaf7d('0x77')];return db['CmList'][_0xaf7d('0x59')]({'where':{'id':_0x2af438[_0xaf7d('0x6e')][_0xaf7d('0x8e')]},'include':[{'model':db[_0xaf7d('0x6f')],'as':_0xaf7d('0x8f'),'where':_0x1188d9,'limit':0x1,'order':[[_0xaf7d('0x75'),_0xaf7d('0x90')]]}]});})[_0xaf7d('0x31')](handleEntityNotFound(_0x254889,null))[_0xaf7d('0x31')](function(_0x2dfabe){if(_0x2dfabe){_0x2af438['list']=_[_0xaf7d('0x91')](_0x2dfabe,[_0xaf7d('0x8f')]);if(_0x2dfabe[_0xaf7d('0x8f')][_0xaf7d('0x45')]){return _0x2dfabe['Contacts'][0x0];}var _0x377038=_['defaults'](_0x2af438[_0xaf7d('0x55')],{'firstName':_0x2af438[_0xaf7d('0x55')][_0xaf7d('0x77')],'ListId':_0x2dfabe['id']});_0x377038[_0x2af438[_0xaf7d('0x55')]['mapKey']]=_0x2af438[_0xaf7d('0x55')][_0xaf7d('0x77')];return db['CmContact'][_0xaf7d('0x5f')](_0x377038,{'fields':_0x337aa4,'raw':!![]});}})[_0xaf7d('0x31')](handleEntityNotFound(_0x254889,null))['then'](function(_0x39b744){if(_0x39b744){_0x2af438[_0xaf7d('0x92')]=_0x39b744;var _0x4a339f={'ContactId':_0x39b744['id'],'phone':_0x2af438[_0xaf7d('0x55')][_0xaf7d('0x77')],'SmsAccountId':_0x4c32ed[_0xaf7d('0x53')]['id']};var _0x39dcbe={'ContactId':_0x39b744['id'],'SmsAccountId':_0x4c32ed[_0xaf7d('0x53')]['id'],'closed':![]};return db[_0xaf7d('0x93')][_0xaf7d('0x59')]({'where':_0x39dcbe})[_0xaf7d('0x31')](function(_0x364c04){if(_0x364c04){return[_0x364c04,![]];}return db[_0xaf7d('0x93')]['create'](_0x4a339f)[_0xaf7d('0x31')](function(_0x3ed4ac){return[_0x3ed4ac,!![]];});});}})['spread'](function(_0x4b0e69,_0x239b1a){_0x2af438[_0xaf7d('0x94')]=_0x4b0e69['get']({'plain':!![]});_0x2af438['interaction']['created']=![];if(_0x239b1a){if(_0x2af438['account'][_0xaf7d('0x95')]){_0x2af438['applications']['push']({'id':0x0,'priority':_0x2af438['applications']['length']+0x1,'app':'close','appdata':_0xaf7d('0x96'),'interval':'*,*,*,*'});}_0x2af438['interaction'][_0xaf7d('0x97')]=!![];}return db[_0xaf7d('0x98')][_0xaf7d('0x5f')]({'phone':_0x2af438[_0xaf7d('0x55')][_0xaf7d('0x77')],'messageId':_0x2af438['body'][_0xaf7d('0x79')],'body':_0x2af438[_0xaf7d('0x55')][_0xaf7d('0x55')],'SmsAccountId':_0x4c32ed[_0xaf7d('0x53')]['id'],'SmsInteractionId':_0x4b0e69['id'],'direction':'in','ContactId':_0x4b0e69['ContactId'],'AttachmentId':_0x2af438[_0xaf7d('0x55')][_0xaf7d('0x99')]});})[_0xaf7d('0x31')](function(_0xc4d90){_0x2af438[_0xaf7d('0x22')]=_0xc4d90;if(_0x2af438[_0xaf7d('0x94')][_0xaf7d('0x9a')]){return db[_0xaf7d('0x9b')][_0xaf7d('0x59')]({'attributes':['id',_0xaf7d('0x36')],'where':{'id':_0x2af438['interaction'][_0xaf7d('0x9a')]}})['then'](function(_0x1daa04){if(_0x1daa04){_0x2af438[_0xaf7d('0x6b')][_0xaf7d('0x9c')]({'id':0x0,'priority':0x0,'app':_0xaf7d('0x9d'),'appdata':_0x1daa04[_0xaf7d('0x36')]+','+(_0x2af438[_0xaf7d('0x6e')][_0xaf7d('0x9e')]||0xa),'interval':_0xaf7d('0x9f')});}return respondWithRpcPromise(_0xaf7d('0xa0'),_0xaf7d('0xa1'),_0x2af438);});}return respondWithRpcPromise(_0xaf7d('0xa0'),_0xaf7d('0xa1'),_0x2af438);})[_0xaf7d('0x31')](function(_0x545029){if(_0x545029){var _0x51a4d0=0xc8;var _0x48eda0=_0xaf7d('0xa2');logger[_0xaf7d('0x1b')](_0xaf7d('0x1e'),_0x48eda0,_0x51a4d0,_0xaf7d('0xa3'));logger['debug'](_0xaf7d('0xa4'),_0x48eda0,_0x51a4d0,_0xaf7d('0xa3'),JSON[_0xaf7d('0xa5')](_0x545029));if(_0x2af438[_0xaf7d('0x6e')][_0xaf7d('0x3b')]===_0xaf7d('0xa6')){return _0x254889[_0xaf7d('0x26')](_0x51a4d0)['set'](_0xaf7d('0xa7'),'text/xml')[_0xaf7d('0xa8')](_0xaf7d('0xa9'));}else{return _0x254889[_0xaf7d('0x26')](_0x51a4d0)[_0xaf7d('0x28')](_0x545029);}}})[_0xaf7d('0x24')](handleError(_0x254889,null));};exports[_0xaf7d('0xaa')]=function(_0x2f84ba,_0x17da4c){var _0x43a126=_0x2f84ba[_0xaf7d('0x53')]['id'];var _0x5bbbc0=_0x2f84ba[_0xaf7d('0x55')];var _0x2397b6=0xc8;var _0x3c84fd=null;return db[_0xaf7d('0xab')]['transaction']({'isolationLevel':db['sequelize'][_0xaf7d('0xac')]['ISOLATION_LEVELS'][_0xaf7d('0xad')]},function(_0x53982f){return db[_0xaf7d('0x54')][_0xaf7d('0x66')]({'where':{'id':_0x43a126},'transaction':_0x53982f})[_0xaf7d('0x31')](function(_0x2435be){if(_0x2435be){return db['SmsApplication'][_0xaf7d('0x32')]({'where':{'SmsAccountId':_0x43a126},'transaction':_0x53982f})[_0xaf7d('0x31')](function(){var _0x40c2f4=_['map'](_0x5bbbc0,function(_0x1454fd){_0x1454fd[_0xaf7d('0x62')]=_0x43a126;return _0x1454fd;});return db[_0xaf7d('0x69')][_0xaf7d('0xae')](_0x40c2f4,{'transaction':_0x53982f});});}else{_0x2397b6=0x194;_0x3c84fd=[];}});})[_0xaf7d('0x31')](function(){if(_0x2397b6!==0x194){return db[_0xaf7d('0x69')][_0xaf7d('0xaf')]({'where':{'SmsAccountId':_0x43a126},'order':_0xaf7d('0x6d')})[_0xaf7d('0x31')](function(_0x1ff740){_0x3c84fd=_0x1ff740;});}})['catch'](function(_0x2d2c19){_0x2397b6=0x1f4;logger[_0xaf7d('0x1f')](_0x2d2c19[_0xaf7d('0x35')]);if(_0x2d2c19[_0xaf7d('0x36')]){delete _0x2d2c19[_0xaf7d('0x36')];}_0x3c84fd=_0x2d2c19;})[_0xaf7d('0xb0')](function(){if(_0x3c84fd===null){_0x17da4c[_0xaf7d('0x25')](_0x2397b6);}else{if(_0x2397b6===0x1f4){_0x17da4c[_0xaf7d('0x26')](_0x2397b6)[_0xaf7d('0xa8')](_0x3c84fd);}else{_0x17da4c[_0xaf7d('0x26')](_0x2397b6)['json'](_0x3c84fd);}}});};exports[_0xaf7d('0xb1')]=function(_0x27dba5,_0x567a4d,_0x483576){var _0x32f2d7={};var _0x345260={};var _0x36f5f6;var _0x5d055e;return db[_0xaf7d('0x54')]['findOne']({'where':{'id':_0x27dba5[_0xaf7d('0x53')]['id']}})['then'](handleEntityNotFound(_0x567a4d,null))[_0xaf7d('0x31')](function(_0x3d2aaa){if(_0x3d2aaa){_0x36f5f6=_0x3d2aaa;_0x345260[_0xaf7d('0x42')]=_[_0xaf7d('0x3f')](db[_0xaf7d('0x69')][_0xaf7d('0x39')]);_0x345260[_0xaf7d('0x3e')]=_[_0xaf7d('0x3f')](_0x27dba5[_0xaf7d('0x3e')]);_0x345260[_0xaf7d('0x40')]=_[_0xaf7d('0x41')](_0x345260[_0xaf7d('0x42')],_0x345260[_0xaf7d('0x3e')]);_0x32f2d7[_0xaf7d('0x43')]=_[_0xaf7d('0x41')](_0x345260[_0xaf7d('0x42')],qs[_0xaf7d('0x44')](_0x27dba5[_0xaf7d('0x3e')][_0xaf7d('0x44')]));_0x32f2d7[_0xaf7d('0x43')]=_0x32f2d7[_0xaf7d('0x43')][_0xaf7d('0x45')]?_0x32f2d7[_0xaf7d('0x43')]:_0x345260[_0xaf7d('0x42')];_0x32f2d7[_0xaf7d('0xb2')]=qs[_0xaf7d('0x48')](_0x27dba5[_0xaf7d('0x3e')][_0xaf7d('0x48')]);_0x32f2d7[_0xaf7d('0x4a')]=qs[_0xaf7d('0x40')](_[_0xaf7d('0x49')](_0x27dba5['query'],_0x345260[_0xaf7d('0x40')]));if(_0x27dba5[_0xaf7d('0x3e')]['filter']){_0x32f2d7[_0xaf7d('0x4a')]=_['merge'](_0x32f2d7[_0xaf7d('0x4a')],{'$or':_['map'](_0x32f2d7[_0xaf7d('0x43')],function(_0x376871){var _0x42bcb6={};_0x42bcb6[_0x376871]={'$like':'%'+_0x27dba5[_0xaf7d('0x3e')][_0xaf7d('0x4d')]+'%'};return _0x42bcb6;})});}_0x32f2d7=_[_0xaf7d('0x4b')]({},_0x32f2d7,_0x27dba5[_0xaf7d('0x67')]);return _0x36f5f6['getApplications'](_0x32f2d7);}})[_0xaf7d('0x31')](function(_0x382744){if(_0x382744){_0x5d055e=_0x382744[_0xaf7d('0x45')];if(!_0x27dba5[_0xaf7d('0x3e')][_0xaf7d('0x46')](_0xaf7d('0x47'))){_0x32f2d7[_0xaf7d('0x2a')]=qs[_0xaf7d('0x2a')](_0x27dba5[_0xaf7d('0x3e')]['limit']);_0x32f2d7[_0xaf7d('0x2c')]=qs[_0xaf7d('0x2c')](_0x27dba5['query'][_0xaf7d('0x2c')]);}return _0x36f5f6[_0xaf7d('0xb1')](_0x32f2d7);}})[_0xaf7d('0x31')](function(_0x9f89a3){if(_0x9f89a3){return _0x9f89a3?{'count':_0x5d055e,'rows':_0x9f89a3}:null;}})[_0xaf7d('0x31')](respondWithResult(_0x567a4d,null))[_0xaf7d('0x24')](handleError(_0x567a4d,null));};exports['getInteractions']=function(_0x294c77,_0x101c7e,_0x2cffdd){var _0x410fea={'raw':![],'where':{}};var _0x2b7de7={};var _0x3acdcd={'count':0x0,'rows':[]};return db[_0xaf7d('0x54')][_0xaf7d('0x66')]({'where':{'id':_0x294c77[_0xaf7d('0x53')]['id']}})[_0xaf7d('0x31')](handleEntityNotFound(_0x101c7e,null))['then'](function(_0x597a5a){if(_0x597a5a){_0x2b7de7[_0xaf7d('0x42')]=_[_0xaf7d('0x3f')](db['SmsInteraction'][_0xaf7d('0x39')]);_0x2b7de7[_0xaf7d('0x3e')]=_['keys'](_0x294c77[_0xaf7d('0x3e')]);_0x2b7de7['filters']=_[_0xaf7d('0x41')](_0x2b7de7[_0xaf7d('0x42')],_0x2b7de7['query']);_0x410fea['attributes']=_[_0xaf7d('0x41')](_0x2b7de7[_0xaf7d('0x42')],qs['fields'](_0x294c77[_0xaf7d('0x3e')][_0xaf7d('0x44')]));_0x410fea[_0xaf7d('0x43')]=_0x410fea['attributes'][_0xaf7d('0x45')]?_0x410fea[_0xaf7d('0x43')]:_0x2b7de7[_0xaf7d('0x42')];if(!_0x294c77[_0xaf7d('0x3e')][_0xaf7d('0x46')]('nolimit')){_0x410fea[_0xaf7d('0x2a')]=qs[_0xaf7d('0x2a')](_0x294c77[_0xaf7d('0x3e')]['limit']);_0x410fea[_0xaf7d('0x2c')]=qs[_0xaf7d('0x2c')](_0x294c77[_0xaf7d('0x3e')]['offset']);}_0x410fea['order']=qs['sort'](_0x294c77[_0xaf7d('0x3e')][_0xaf7d('0x48')]);_0x410fea['where']=qs[_0xaf7d('0x40')](_[_0xaf7d('0x49')](_0x294c77[_0xaf7d('0x3e')],_0x2b7de7[_0xaf7d('0x40')]));_0x410fea[_0xaf7d('0x4a')]['SmsAccountId']=_0x597a5a['id'];if(_0x294c77[_0xaf7d('0x3e')][_0xaf7d('0x4d')]){_0x410fea['where']=_['merge'](_0x410fea[_0xaf7d('0x4a')],{'$or':_[_0xaf7d('0x3d')](_0x410fea[_0xaf7d('0x43')],function(_0x4ea945){var _0x225232={};_0x225232[_0x4ea945]={'$like':'%'+_0x294c77[_0xaf7d('0x3e')][_0xaf7d('0x4d')]+'%'};return _0x225232;})});}_0x410fea=_[_0xaf7d('0x4b')]({},_0x410fea,_0x294c77['options']);return db[_0xaf7d('0x93')]['count']({'where':_0x410fea[_0xaf7d('0x4a')]})['then'](function(_0x57dcb5){_0x3acdcd[_0xaf7d('0x2b')]=_0x57dcb5;if(_0x294c77[_0xaf7d('0x3e')][_0xaf7d('0x4e')]){_0x410fea[_0xaf7d('0x4f')]=[{'model':db[_0xaf7d('0x6f')],'as':_0xaf7d('0xb3'),'required':![]},{'model':db[_0xaf7d('0x9b')],'as':_0xaf7d('0xb4'),'attributes':['name',_0xaf7d('0xb5'),_0xaf7d('0xb6')],'required':![]},{'model':db['Tag'],'as':_0xaf7d('0xb7'),'attributes':['id',_0xaf7d('0x36'),_0xaf7d('0xb8')],'where':_0x294c77[_0xaf7d('0x3e')][_0xaf7d('0xb9')]?{'id':_0x294c77[_0xaf7d('0x3e')][_0xaf7d('0xb9')]}:undefined,'required':_0x294c77[_0xaf7d('0x3e')][_0xaf7d('0xb9')]?!![]:![]}];}return db[_0xaf7d('0x93')][_0xaf7d('0x50')](_0x410fea);})['then'](function(_0x560192){_0x3acdcd[_0xaf7d('0x51')]=_0x560192;return _0x3acdcd;});}})['then'](respondWithFilteredResult(_0x101c7e,_0x410fea))[_0xaf7d('0x24')](handleError(_0x101c7e,null));};exports[_0xaf7d('0xa8')]=function(_0x1e5f24,_0x24a26d,_0xae530c){var _0x1492f6,_0x5040b8,_0x2fcb27;if(_['isNil'](_0x1e5f24[_0xaf7d('0x55')][_0xaf7d('0x55')])||_0x1e5f24[_0xaf7d('0x55')]['body']===''){throw new db[(_0xaf7d('0x70'))]['ValidationError'](_0xaf7d('0xba'));}if(_[_0xaf7d('0x88')](_0x1e5f24[_0xaf7d('0x55')]['to'])){throw new db[(_0xaf7d('0x70'))][(_0xaf7d('0x71'))](_0xaf7d('0xbb'));}_0x1492f6=_0x1e5f24['body']['to'];return db[_0xaf7d('0x54')][_0xaf7d('0x59')]({'where':{'id':_0x1e5f24[_0xaf7d('0x53')]['id']},'include':[{'model':db[_0xaf7d('0xbc')],'as':_0xaf7d('0xbd'),'include':[{'model':db['CmContact'],'as':_0xaf7d('0x8f'),'where':{'mobile':_0x1492f6},'limit':0x1,'order':[[_0xaf7d('0x75'),_0xaf7d('0x90')]]}]}]})['then'](handleEntityNotFound(_0x24a26d,null))['then'](function(_0x426c93){if(_0x426c93&&_0x426c93[_0xaf7d('0xbd')]){_0x5040b8=_0x426c93[_0xaf7d('0x57')]({'plain':!![]});if(_0x5040b8['List']&&_0x5040b8[_0xaf7d('0xbd')][_0xaf7d('0x8f')][_0xaf7d('0x45')]){return _0x5040b8['List'][_0xaf7d('0x8f')][0x0];}return db[_0xaf7d('0x6f')][_0xaf7d('0x5f')](_[_0xaf7d('0xbe')](_0x1e5f24['body'],{'firstName':_0x1492f6,'mobile':_0x1492f6,'phone':_0x1492f6,'ListId':_0x5040b8['ListId']}));}})['then'](handleEntityNotFound(_0x24a26d,null))[_0xaf7d('0x31')](function(_0x302739){if(_0x302739){_0x2fcb27=_0x302739;return db[_0xaf7d('0x93')][_0xaf7d('0x59')]({'where':{'ContactId':_0x2fcb27['id'],'closed':![],'SmsAccountId':_0x5040b8['id']}})[_0xaf7d('0x31')](function(_0x26a263){if(_0x26a263){return[_0x26a263,![]];}return db[_0xaf7d('0x93')][_0xaf7d('0x5f')]({'UserId':_0x1e5f24[_0xaf7d('0x56')]['id'],'ContactId':_0x2fcb27['id'],'SmsAccountId':_0x5040b8['id'],'phone':_0x1492f6,'firstMsgDirection':_0xaf7d('0xbf'),'Messages':[_[_0xaf7d('0x4b')](_0x1e5f24[_0xaf7d('0x55')],{'read':![],'body':_0x1e5f24[_0xaf7d('0x55')][_0xaf7d('0x55')],'phone':_0x1492f6,'SmsAccountId':_0x5040b8['id'],'UserId':_0x1e5f24[_0xaf7d('0x56')]['id'],'ContactId':_0x2fcb27['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xaf7d('0xc0')}]})[_0xaf7d('0x31')](function(_0x47891b){return[_0x47891b,!![]];});});}})[_0xaf7d('0xc1')](function(_0x269ac7,_0x5101fc){if(_0x5101fc){return _0x269ac7;}return db[_0xaf7d('0x98')][_0xaf7d('0x5f')](_[_0xaf7d('0x4b')](_0x1e5f24['body'],{'read':![],'body':_0x1e5f24[_0xaf7d('0x55')][_0xaf7d('0x55')],'phone':_0x1492f6,'SmsAccountId':_0x5040b8['id'],'SmsInteractionId':_0x269ac7['id'],'UserId':_0x1e5f24[_0xaf7d('0x56')]['id'],'ContactId':_0x2fcb27['id']}))[_0xaf7d('0x31')](function(_0x493197){_0x269ac7[_0xaf7d('0xc2')]['Messages']=[];_0x269ac7[_0xaf7d('0xc2')]['Messages'][_0xaf7d('0xc3')](_0x493197[_0xaf7d('0xc2')]);return _0x269ac7;});})[_0xaf7d('0x31')](respondWithResult(_0x24a26d,null))[_0xaf7d('0x24')](handleError(_0x24a26d,null));};exports[_0xaf7d('0x26')]=function(_0xb15959,_0x4b34ad,_0x2f6073){if(_0xb15959[_0xaf7d('0x55')]['id']){delete _0xb15959[_0xaf7d('0x55')]['id'];}var _0x11c33d,_0x573612,_0x35a85e;return db[_0xaf7d('0x54')][_0xaf7d('0x59')]({'where':{'id':_0xb15959['params']['id']}})[_0xaf7d('0x31')](handleEntityNotFound(_0x4b34ad,null))[_0xaf7d('0x31')](function(_0x1d1b57){if(_0x1d1b57){_0x35a85e=_0x1d1b57;logger['debug'](_0xaf7d('0x1e'),_0xaf7d('0x26'),_0xaf7d('0xc4'),_0x1d1b57[_0xaf7d('0x3b')],util[_0xaf7d('0xc5')](_0xb15959['body'],{'showHidden':![],'depth':null}));switch(_0x1d1b57[_0xaf7d('0x3b')]){case _0xaf7d('0x7b'):if(_0xb15959[_0xaf7d('0x55')]['skebby_dispatch_id']&&_0xb15959[_0xaf7d('0x55')][_0xaf7d('0x26')]){_0x573612=_0xb15959['body'][_0xaf7d('0x26')];return db[_0xaf7d('0x98')]['find']({'where':{'messageId':_0xb15959[_0xaf7d('0x55')][_0xaf7d('0xc6')]}});}break;case _0xaf7d('0xc7'):if(_0xb15959[_0xaf7d('0x55')][_0xaf7d('0xc8')]&&_0xb15959[_0xaf7d('0x55')]['statusInt']){_0x573612=_0xb15959[_0xaf7d('0x55')][_0xaf7d('0xc9')];return db[_0xaf7d('0x98')][_0xaf7d('0x59')]({'where':{'messageId':_0xb15959[_0xaf7d('0x55')][_0xaf7d('0xc8')]}});}break;case _0xaf7d('0x7d'):if(_0xb15959['body'][_0xaf7d('0x7e')]&&_0xb15959[_0xaf7d('0x55')][_0xaf7d('0xca')]){_0x573612=_0xb15959[_0xaf7d('0x55')]['status_code'];return db[_0xaf7d('0x98')][_0xaf7d('0x59')]({'where':{'messageId':_0xb15959['body'][_0xaf7d('0x7e')]}});}break;case _0xaf7d('0x80'):var _0x2c5e98=_0xb15959[_0xaf7d('0x55')][_0xaf7d('0x81')][0x0];if(_0x2c5e98['messageId']&&_0x2c5e98['status']['groupName']===_0xaf7d('0xcb')){_0x573612=_0x2c5e98[_0xaf7d('0x26')][_0xaf7d('0xcc')];return db[_0xaf7d('0x98')]['find']({'where':{'messageId':_0x2c5e98[_0xaf7d('0x79')]}});}break;case'clickatell':if(_0xb15959['body'][_0xaf7d('0x79')]&&_0xb15959['body'][_0xaf7d('0x26')]){_0x573612=_0xb15959[_0xaf7d('0x55')][_0xaf7d('0x26')];return db['SmsMessage'][_0xaf7d('0x59')]({'where':{'messageId':_0xb15959[_0xaf7d('0x55')][_0xaf7d('0x79')]}});}break;case _0xaf7d('0x86'):if(_0xb15959[_0xaf7d('0x55')][0x0][_0xaf7d('0x22')]['id']){_0x573612=_0xb15959[_0xaf7d('0x55')][0x0]['type'];return db[_0xaf7d('0x98')][_0xaf7d('0x59')]({'where':{'messageId':_0xb15959[_0xaf7d('0x55')][0x0]['message']['id']}});}break;case _0xaf7d('0x87'):if(_0xb15959['body'][_0xaf7d('0xcd')]&&_0xb15959[_0xaf7d('0x55')][_0xaf7d('0x26')]){_0x573612=_0xb15959[_0xaf7d('0x55')][_0xaf7d('0x26')];return db[_0xaf7d('0x98')][_0xaf7d('0x59')]({'where':{'messageId':_0xb15959['body'][_0xaf7d('0xcd')]}});}break;}}})[_0xaf7d('0x31')](handleEntityNotFound(_0x4b34ad,null))[_0xaf7d('0x31')](function(_0x1d2d1b){if(_0x1d2d1b){_0x11c33d=_0x1d2d1b;switch(_0x35a85e['type']){case'skebby':if(_0x573612===_0xaf7d('0xcb')){return _0x11c33d[_0xaf7d('0x5c')]({'read':!![]});}else{logger[_0xaf7d('0x1f')](_0xaf7d('0x1e'),_0xaf7d('0x26'),'skebby',util[_0xaf7d('0xc5')](_0xb15959['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x573612==='1'){return _0x11c33d[_0xaf7d('0x5c')]({'read':!![]});}else{logger[_0xaf7d('0x1f')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xaf7d('0x26'),_0xaf7d('0x7b'),util[_0xaf7d('0xc5')](_0xb15959[_0xaf7d('0x55')],{'showHidden':![],'depth':null}));}break;case _0xaf7d('0x7d'):if(!_0xb15959[_0xaf7d('0x55')][_0xaf7d('0xce')]&&_0x573612>=0xc8&&_0x573612<=0xce){return _0x11c33d[_0xaf7d('0x5c')]({'read':!![]});}else{logger[_0xaf7d('0x1f')](_0xaf7d('0x1e'),_0xaf7d('0x26'),_0xaf7d('0x7d'),util[_0xaf7d('0xc5')](_0xb15959[_0xaf7d('0x55')],{'showHidden':![],'depth':null}));}break;case _0xaf7d('0x80'):var _0x266245=_0xb15959['body'][_0xaf7d('0x81')][0x0];if(_0x266245[_0xaf7d('0x26')][_0xaf7d('0xcc')]==='DELIVERED'){return _0x11c33d[_0xaf7d('0x5c')]({'read':!![]});}else{logger[_0xaf7d('0x1f')](_0xaf7d('0x1e'),_0xaf7d('0x26'),_0xaf7d('0x80'),util[_0xaf7d('0xc5')](_0xb15959[_0xaf7d('0x55')],{'showHidden':![],'depth':null}));}break;case _0xaf7d('0x84'):if(_0x573612=='DELIVERED_TO_GATEWAY'||_0x573612==_0xaf7d('0xcf')){return _0x11c33d[_0xaf7d('0x5c')]({'read':!![]});}else{logger['error'](_0xaf7d('0x1e'),_0xaf7d('0x26'),_0xaf7d('0x84'),util[_0xaf7d('0xc5')](_0xb15959['body'],{'showHidden':![],'depth':null}));}break;case _0xaf7d('0x86'):if(_0x573612=='message-delivered'){return _0x11c33d['update']({'read':!![]});}else{logger[_0xaf7d('0x1f')](_0xaf7d('0x1e'),_0xaf7d('0x26'),_0xaf7d('0x86'),util['inspect'](_0xb15959[_0xaf7d('0x55')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x573612===_0xaf7d('0xd0')||_0x573612===_0xaf7d('0xd1')){return _0x11c33d['update']({'read':!![]});}else{logger[_0xaf7d('0x1f')](_0xaf7d('0x1e'),_0xaf7d('0x26'),'intelepeer',util[_0xaf7d('0xc5')](_0xb15959['body'],{'showHidden':![],'depth':null}));}break;}return _0x11c33d;}})['then'](respondWithResult(_0x4b34ad,null))['catch'](handleError(_0x4b34ad,null));};exports[_0xaf7d('0xd2')]=function(_0x28e87c,_0x2b2d3c,_0x56bece){var _0x62e8ed,_0x442a8f,_0x427a72;return db[_0xaf7d('0x54')][_0xaf7d('0x59')]({'where':{'id':_0x28e87c[_0xaf7d('0x53')]['id']}})['then'](handleEntityNotFound(_0x2b2d3c,null))['then'](function(_0x20c965){if(_0x20c965){_0x427a72=_0x20c965;logger[_0xaf7d('0x1d')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xaf7d('0x26'),_0xaf7d('0xc4'),_0x20c965['type'],util['inspect'](_0x28e87c[_0xaf7d('0x3e')],{'showHidden':![],'depth':null}));switch(_0x20c965['type']){case _0xaf7d('0x82'):if(_0x28e87c[_0xaf7d('0x3e')][_0xaf7d('0xd3')]&&_0x28e87c['query']['state']){_0x442a8f=_0x28e87c[_0xaf7d('0x3e')][_0xaf7d('0xd4')];return db[_0xaf7d('0x98')][_0xaf7d('0x59')]({'where':{'messageId':_0x28e87c[_0xaf7d('0x3e')][_0xaf7d('0xd3')]}});}break;}}})[_0xaf7d('0x31')](handleEntityNotFound(_0x2b2d3c,null))[_0xaf7d('0x31')](function(_0x3bcd57){if(_0x3bcd57){_0x62e8ed=_0x3bcd57;switch(_0x427a72[_0xaf7d('0x3b')]){case _0xaf7d('0x82'):if(_0x442a8f==='2'||_0x442a8f==='6'){return _0x62e8ed[_0xaf7d('0x5c')]({'read':!![]});}else{logger['error'](_0xaf7d('0x1e'),_0xaf7d('0x26'),_0xaf7d('0x82'),util['inspect'](_0x28e87c[_0xaf7d('0x3e')],{'showHidden':![],'depth':null}));};break;}return _0x62e8ed;}})['then'](respondWithResult(_0x2b2d3c,null))['catch'](handleError(_0x2b2d3c,null));};exports[_0xaf7d('0xd5')]=function(_0x43a0a6,_0x391262,_0x5a83b1){return db[_0xaf7d('0x54')][_0xaf7d('0x59')]({'where':{'id':_0x43a0a6[_0xaf7d('0x53')]['id']}})[_0xaf7d('0x31')](handleEntityNotFound(_0x391262,null))[_0xaf7d('0x31')](function(_0x4007cf){if(_0x4007cf){return _0x4007cf[_0xaf7d('0xd5')](_0x43a0a6[_0xaf7d('0x55')][_0xaf7d('0x64')],_[_0xaf7d('0x91')](_0x43a0a6[_0xaf7d('0x55')],[_0xaf7d('0x64'),'id'])||{})[_0xaf7d('0xc1')](function(_0x5de760){for(var _0x282513=0x0;_0x282513<_0x43a0a6[_0xaf7d('0x55')][_0xaf7d('0x64')]['length'];_0x282513+=0x1){socket[_0xaf7d('0xd6')](_0xaf7d('0xd7'),{'UserId':Number(_0x43a0a6[_0xaf7d('0x55')]['ids'][_0x282513]),'SmsAccountId':Number(_0x43a0a6[_0xaf7d('0x53')]['id'])});}return _0x5de760;});}})[_0xaf7d('0x31')](respondWithResult(_0x391262,null))[_0xaf7d('0x24')](handleError(_0x391262,null));};exports['removeAgents']=function(_0x2c80d1,_0x4015c8,_0x1271e6){return db[_0xaf7d('0x54')][_0xaf7d('0x59')]({'where':{'id':_0x2c80d1[_0xaf7d('0x53')]['id']}})['then'](handleEntityNotFound(_0x4015c8,null))[_0xaf7d('0x31')](function(_0x3f8a92){if(_0x3f8a92){return _0x3f8a92[_0xaf7d('0xd8')](_0x2c80d1[_0xaf7d('0x3e')]['ids'])[_0xaf7d('0x31')](function(){if(_[_0xaf7d('0xd9')](_0x2c80d1[_0xaf7d('0x3e')][_0xaf7d('0x64')])){for(var _0x14b86d=0x0;_0x14b86d<_0x2c80d1[_0xaf7d('0x3e')][_0xaf7d('0x64')][_0xaf7d('0x45')];_0x14b86d+=0x1){socket[_0xaf7d('0xd6')](_0xaf7d('0xda'),{'UserId':Number(_0x2c80d1[_0xaf7d('0x3e')]['ids'][_0x14b86d]),'SmsAccountId':Number(_0x2c80d1[_0xaf7d('0x53')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x2c80d1['query'][_0xaf7d('0x64')]),'SmsAccountId':Number(_0x2c80d1[_0xaf7d('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x4015c8,null))[_0xaf7d('0x24')](handleError(_0x4015c8,null));};exports[_0xaf7d('0xdb')]=function(_0x5e6f64,_0x330ba3,_0x247622){var _0x1cefbf={};var _0x1a8356={};var _0x389e35;var _0x3713c7;return db[_0xaf7d('0x54')][_0xaf7d('0x66')]({'where':{'id':_0x5e6f64[_0xaf7d('0x53')]['id']}})[_0xaf7d('0x31')](handleEntityNotFound(_0x330ba3,null))[_0xaf7d('0x31')](function(_0x5950df){if(_0x5950df){_0x389e35=_0x5950df;_0x1a8356[_0xaf7d('0x42')]=_['keys'](db['User']['rawAttributes']);_0x1a8356[_0xaf7d('0x3e')]=_['keys'](_0x5e6f64['query']);_0x1a8356[_0xaf7d('0x40')]=_[_0xaf7d('0x41')](_0x1a8356['model'],_0x1a8356[_0xaf7d('0x3e')]);_0x1cefbf[_0xaf7d('0x43')]=_[_0xaf7d('0x41')](_0x1a8356[_0xaf7d('0x42')],qs[_0xaf7d('0x44')](_0x5e6f64[_0xaf7d('0x3e')][_0xaf7d('0x44')]));_0x1cefbf[_0xaf7d('0x43')]=_0x1cefbf[_0xaf7d('0x43')][_0xaf7d('0x45')]?_0x1cefbf[_0xaf7d('0x43')]:_0x1a8356[_0xaf7d('0x42')];_0x1cefbf[_0xaf7d('0xb2')]=qs['sort'](_0x5e6f64[_0xaf7d('0x3e')]['sort']);_0x1cefbf[_0xaf7d('0x4a')]=qs[_0xaf7d('0x40')](_[_0xaf7d('0x49')](_0x5e6f64[_0xaf7d('0x3e')],_0x1a8356['filters']));if(_0x5e6f64[_0xaf7d('0x3e')]['filter']){_0x1cefbf['where']=_[_0xaf7d('0x4b')](_0x1cefbf[_0xaf7d('0x4a')],{'$or':_[_0xaf7d('0x3d')](_0x1cefbf['attributes'],function(_0x43ac20){var _0x3dcb27={};_0x3dcb27[_0x43ac20]={'$like':'%'+_0x5e6f64[_0xaf7d('0x3e')][_0xaf7d('0x4d')]+'%'};return _0x3dcb27;})});}_0x1cefbf=_[_0xaf7d('0x4b')]({},_0x1cefbf,_0x5e6f64[_0xaf7d('0x67')]);return _0x389e35['getAgents'](_0x1cefbf);}})[_0xaf7d('0x31')](function(_0x5418e2){if(_0x5418e2){_0x3713c7=_0x5418e2[_0xaf7d('0x45')];if(!_0x5e6f64[_0xaf7d('0x3e')][_0xaf7d('0x46')]('nolimit')){_0x1cefbf['limit']=qs['limit'](_0x5e6f64[_0xaf7d('0x3e')]['limit']);_0x1cefbf['offset']=qs[_0xaf7d('0x2c')](_0x5e6f64[_0xaf7d('0x3e')][_0xaf7d('0x2c')]);}return _0x389e35[_0xaf7d('0xdb')](_0x1cefbf);}})[_0xaf7d('0x31')](function(_0x805d85){if(_0x805d85){return _0x805d85?{'count':_0x3713c7,'rows':_0x805d85}:null;}})[_0xaf7d('0x31')](respondWithResult(_0x330ba3,null))[_0xaf7d('0x24')](handleError(_0x330ba3,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index ff4463d..ee8c042 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 _0x56d8=['remove','hasOwnProperty','hook','exports','../../mysqldb','SmsAccount','setMaxListeners','save','update'];(function(_0x2b5ee9,_0x283791){var _0x1f4555=function(_0x407115){while(--_0x407115){_0x2b5ee9['push'](_0x2b5ee9['shift']());}};_0x1f4555(++_0x283791);}(_0x56d8,0x15a));var _0x856d=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x56d8[_0x1f9f37];return _0x21c080;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x856d('0x0'))['db'][_0x856d('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x856d('0x2')](0x0);var events={'afterCreate':_0x856d('0x3'),'afterUpdate':_0x856d('0x4'),'afterDestroy':_0x856d('0x5')};function emitEvent(_0x47d9d3){return function(_0xa62c49,_0x4b894f,_0x3fd234){SmsAccountEvents['emit'](_0x47d9d3+':'+_0xa62c49['id'],_0xa62c49);SmsAccountEvents['emit'](_0x47d9d3,_0xa62c49);_0x3fd234(null);};}for(var e in events){if(events[_0x856d('0x6')](e)){var event=events[e];SmsAccount[_0x856d('0x7')](e,emitEvent(event));}}module[_0x856d('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0xec0e=['exports','events','SmsAccount','setMaxListeners','update','remove','emit'];(function(_0xe47c8,_0x8fa644){var _0x55eec8=function(_0x47c875){while(--_0x47c875){_0xe47c8['push'](_0xe47c8['shift']());}};_0x55eec8(++_0x8fa644);}(_0xec0e,0x10b));var _0xeec0=function(_0x4ded50,_0x4a6af3){_0x4ded50=_0x4ded50-0x0;var _0xa92135=_0xec0e[_0x4ded50];return _0xa92135;};'use strict';var EventEmitter=require(_0xeec0('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0xeec0('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xeec0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xeec0('0x3'),'afterDestroy':_0xeec0('0x4')};function emitEvent(_0x146683){return function(_0xb9d40,_0x3130b5,_0x144319){SmsAccountEvents[_0xeec0('0x5')](_0x146683+':'+_0xb9d40['id'],_0xb9d40);SmsAccountEvents[_0xeec0('0x5')](_0x146683,_0xb9d40);_0x144319(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0xeec0('0x6')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index dba8145..298a790 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 _0xce28=['bluebird','path','../../config/environment','define','SmsAccount','sms_accounts','lodash','api','moment'];(function(_0x5988f6,_0x39b152){var _0x56d092=function(_0xce9d58){while(--_0xce9d58){_0x5988f6['push'](_0x5988f6['shift']());}};_0x56d092(++_0x39b152);}(_0xce28,0xf9));var _0x8ce2=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xce28[_0x432fca];return _0x3adba4;};'use strict';var _=require(_0x8ce2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8ce2('0x1'));var moment=require(_0x8ce2('0x2'));var BPromise=require(_0x8ce2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ce2('0x4'));var rimraf=require('rimraf');var config=require(_0x8ce2('0x5'));var attributes=require('./smsAccount.attributes');module['exports']=function(_0x115712,_0x57cc16){return _0x115712[_0x8ce2('0x6')](_0x8ce2('0x7'),attributes,{'tableName':_0x8ce2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe372=['lodash','util','../../config/logger','bluebird','path','../../config/environment','./smsAccount.attributes','exports','sms_accounts'];(function(_0x59ace3,_0x336e0c){var _0x523aca=function(_0x3233c5){while(--_0x3233c5){_0x59ace3['push'](_0x59ace3['shift']());}};_0x523aca(++_0x336e0c);}(_0xe372,0x10e));var _0x2e37=function(_0x480409,_0x13b0a5){_0x480409=_0x480409-0x0;var _0x4201bf=_0xe372[_0x480409];return _0x4201bf;};'use strict';var _=require(_0x2e37('0x0'));var util=require(_0x2e37('0x1'));var logger=require(_0x2e37('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2e37('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e37('0x4'));var rimraf=require('rimraf');var config=require(_0x2e37('0x5'));var attributes=require(_0x2e37('0x6'));module[_0x2e37('0x7')]=function(_0x377766,_0x7a50ad){return _0x377766['define']('SmsAccount',attributes,{'tableName':_0x2e37('0x8'),'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 e38d4c4..57ca638 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 _0x5083=['defaults','socket.io-emitter','./smsAccount.socket','register','request','then','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','SmsAccount,\x20%s,\x20%s','message','info','result','ShowSmsAccount','SmsAccount','find','options','raw','attributes','include','map','model','catch','lodash','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x5083,0x182));var _0x3508=function(_0x2c6ab8,_0x87dda2){_0x2c6ab8=_0x2c6ab8-0x0;var _0x2d27b5=_0x5083[_0x2c6ab8];return _0x2d27b5;};'use strict';var _=require(_0x3508('0x0'));var util=require(_0x3508('0x1'));var moment=require(_0x3508('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3508('0x3'));var logger=require(_0x3508('0x4'))(_0x3508('0x5'));var config=require(_0x3508('0x6'));var jayson=require(_0x3508('0x7'));var client=jayson['client'][_0x3508('0x8')]({'port':0x232a});config[_0x3508('0x9')]=_[_0x3508('0xa')](config[_0x3508('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x3508('0xb'))(new Redis(config[_0x3508('0x9')]));require(_0x3508('0xc'))[_0x3508('0xd')](socket);function respondWithRpcPromise(_0x8bbf72,_0x163acf,_0x4f6957){return new BPromise(function(_0x520df3,_0x19969e){return client[_0x3508('0xe')](_0x8bbf72,_0x4f6957)[_0x3508('0xf')](function(_0x3bd3f1){logger['info']('SmsAccount,\x20%s,\x20%s',_0x163acf,_0x3508('0x10'));logger[_0x3508('0x11')](_0x3508('0x12'),_0x163acf,_0x3508('0x10'),JSON[_0x3508('0x13')](_0x3bd3f1));if(_0x3bd3f1['error']){if(_0x3bd3f1['error'][_0x3508('0x14')]===0x1f4){logger[_0x3508('0x15')](_0x3508('0x16'),_0x163acf,_0x3bd3f1['error'][_0x3508('0x17')]);return _0x19969e(_0x3bd3f1[_0x3508('0x15')][_0x3508('0x17')]);}logger[_0x3508('0x15')](_0x3508('0x16'),_0x163acf,_0x3bd3f1[_0x3508('0x15')][_0x3508('0x17')]);return _0x520df3(_0x3bd3f1[_0x3508('0x15')]['message']);}else{logger[_0x3508('0x18')]('SmsAccount,\x20%s,\x20%s',_0x163acf,_0x3508('0x10'));_0x520df3(_0x3bd3f1[_0x3508('0x19')][_0x3508('0x17')]);}})['catch'](function(_0x1a7b7b){logger['error'](_0x3508('0x16'),_0x163acf,_0x1a7b7b);_0x19969e(_0x1a7b7b);});});}exports[_0x3508('0x1a')]=function(_0x42e833){var _0x1f2d7f=this;return new Promise(function(_0x1b0fe2,_0xb541bd){return db[_0x3508('0x1b')][_0x3508('0x1c')]({'raw':_0x42e833[_0x3508('0x1d')]?_0x42e833[_0x3508('0x1d')][_0x3508('0x1e')]===undefined?!![]:![]:!![],'where':_0x42e833[_0x3508('0x1d')]?_0x42e833[_0x3508('0x1d')]['where']||null:null,'attributes':_0x42e833[_0x3508('0x1d')]?_0x42e833[_0x3508('0x1d')][_0x3508('0x1f')]||null:null,'include':_0x42e833['options']?_0x42e833[_0x3508('0x1d')][_0x3508('0x20')]?_[_0x3508('0x21')](_0x42e833['options']['include'],function(_0x27b8b1){return{'model':db[_0x27b8b1[_0x3508('0x22')]],'as':_0x27b8b1['as'],'attributes':_0x27b8b1[_0x3508('0x1f')],'include':_0x27b8b1[_0x3508('0x20')]?_[_0x3508('0x21')](_0x27b8b1[_0x3508('0x20')],function(_0x9b85d7){return{'model':db[_0x9b85d7[_0x3508('0x22')]],'as':_0x9b85d7['as'],'attributes':_0x9b85d7[_0x3508('0x1f')],'include':_0x9b85d7[_0x3508('0x20')]?_[_0x3508('0x21')](_0x9b85d7[_0x3508('0x20')],function(_0xccdd14){return{'model':db[_0xccdd14[_0x3508('0x22')]],'as':_0xccdd14['as'],'attributes':_0xccdd14[_0x3508('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3508('0xf')](function(_0x55f5cc){logger['info']('ShowSmsAccount',_0x42e833);logger['debug'](_0x3508('0x1a'),_0x42e833,JSON[_0x3508('0x13')](_0x55f5cc));_0x1b0fe2(_0x55f5cc);})[_0x3508('0x23')](function(_0x1a0e68){logger['error'](_0x3508('0x1a'),_0x1a0e68[_0x3508('0x17')],_0x42e833);_0xb541bd(_0x1f2d7f[_0x3508('0x15')](0x1f4,_0x1a0e68[_0x3508('0x17')]));});});}; \ No newline at end of file +var _0xd5fb=['ShowSmsAccount','find','options','raw','map','include','attributes','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','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'];(function(_0x5ad60a,_0x5262c5){var _0x266de2=function(_0x467006){while(--_0x467006){_0x5ad60a['push'](_0x5ad60a['shift']());}};_0x266de2(++_0x5262c5);}(_0xd5fb,0x94));var _0xbd5f=function(_0x3eceb2,_0x509ff8){_0x3eceb2=_0x3eceb2-0x0;var _0x818bc4=_0xd5fb[_0x3eceb2];return _0x818bc4;};'use strict';var _=require(_0xbd5f('0x0'));var util=require(_0xbd5f('0x1'));var moment=require(_0xbd5f('0x2'));var BPromise=require(_0xbd5f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbd5f('0x4'));var db=require(_0xbd5f('0x5'))['db'];var utils=require(_0xbd5f('0x6'));var logger=require(_0xbd5f('0x7'))(_0xbd5f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbd5f('0x9')][_0xbd5f('0xa')]({'port':0x232a});config[_0xbd5f('0xb')]=_[_0xbd5f('0xc')](config[_0xbd5f('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsAccount.socket')[_0xbd5f('0xd')](socket);function respondWithRpcPromise(_0x29b8d6,_0x159ad0,_0x68eff){return new BPromise(function(_0x547478,_0x4b6ba6){return client[_0xbd5f('0xe')](_0x29b8d6,_0x68eff)[_0xbd5f('0xf')](function(_0x42caf2){logger[_0xbd5f('0x10')](_0xbd5f('0x11'),_0x159ad0,_0xbd5f('0x12'));logger[_0xbd5f('0x13')](_0xbd5f('0x14'),_0x159ad0,_0xbd5f('0x12'),JSON[_0xbd5f('0x15')](_0x42caf2));if(_0x42caf2['error']){if(_0x42caf2[_0xbd5f('0x16')][_0xbd5f('0x17')]===0x1f4){logger[_0xbd5f('0x16')](_0xbd5f('0x11'),_0x159ad0,_0x42caf2[_0xbd5f('0x16')][_0xbd5f('0x18')]);return _0x4b6ba6(_0x42caf2[_0xbd5f('0x16')][_0xbd5f('0x18')]);}logger[_0xbd5f('0x16')](_0xbd5f('0x11'),_0x159ad0,_0x42caf2[_0xbd5f('0x16')][_0xbd5f('0x18')]);return _0x547478(_0x42caf2[_0xbd5f('0x16')]['message']);}else{logger[_0xbd5f('0x10')](_0xbd5f('0x11'),_0x159ad0,'request\x20sent');_0x547478(_0x42caf2[_0xbd5f('0x19')][_0xbd5f('0x18')]);}})[_0xbd5f('0x1a')](function(_0x3077f6){logger[_0xbd5f('0x16')](_0xbd5f('0x11'),_0x159ad0,_0x3077f6);_0x4b6ba6(_0x3077f6);});});}exports[_0xbd5f('0x1b')]=function(_0x417496){var _0x481578=this;return new Promise(function(_0x16682f,_0x3fbd55){return db['SmsAccount'][_0xbd5f('0x1c')]({'raw':_0x417496[_0xbd5f('0x1d')]?_0x417496[_0xbd5f('0x1d')][_0xbd5f('0x1e')]===undefined?!![]:![]:!![],'where':_0x417496[_0xbd5f('0x1d')]?_0x417496[_0xbd5f('0x1d')]['where']||null:null,'attributes':_0x417496['options']?_0x417496[_0xbd5f('0x1d')]['attributes']||null:null,'include':_0x417496[_0xbd5f('0x1d')]?_0x417496[_0xbd5f('0x1d')]['include']?_[_0xbd5f('0x1f')](_0x417496[_0xbd5f('0x1d')][_0xbd5f('0x20')],function(_0x501e0e){return{'model':db[_0x501e0e['model']],'as':_0x501e0e['as'],'attributes':_0x501e0e[_0xbd5f('0x21')],'include':_0x501e0e[_0xbd5f('0x20')]?_[_0xbd5f('0x1f')](_0x501e0e['include'],function(_0x3cf35b){return{'model':db[_0x3cf35b[_0xbd5f('0x22')]],'as':_0x3cf35b['as'],'attributes':_0x3cf35b[_0xbd5f('0x21')],'include':_0x3cf35b['include']?_[_0xbd5f('0x1f')](_0x3cf35b[_0xbd5f('0x20')],function(_0x59973a){return{'model':db[_0x59973a[_0xbd5f('0x22')]],'as':_0x59973a['as'],'attributes':_0x59973a[_0xbd5f('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbd5f('0xf')](function(_0x21c172){logger['info']('ShowSmsAccount',_0x417496);logger[_0xbd5f('0x13')](_0xbd5f('0x1b'),_0x417496,JSON['stringify'](_0x21c172));_0x16682f(_0x21c172);})['catch'](function(_0x3b27c9){logger[_0xbd5f('0x16')]('ShowSmsAccount',_0x3b27c9[_0xbd5f('0x18')],_0x417496);_0x3fbd55(_0x481578[_0xbd5f('0x16')](0x1f4,_0x3b27c9[_0xbd5f('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index c225066..b35f2d4 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(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 2b9dcec..8a562b3 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(_0x4b32e1,_0x3f4b8c){var _0x5df548=function(_0x563170){while(--_0x563170){_0x4b32e1['push'](_0x4b32e1['shift']());}};_0x5df548(++_0x3f4b8c);}(_0xedd9,0xfc));var _0x9edd=function(_0x1eac98,_0x311fca){_0x1eac98=_0x1eac98-0x0;var _0xe88aaa=_0xedd9[_0x1eac98];return _0xe88aaa;};'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 _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x353517,_0x1031aa){var _0x21a237=function(_0x28928e){while(--_0x28928e){_0x353517['push'](_0x353517['shift']());}};_0x21a237(++_0x1031aa);}(_0x008c,0x188));var _0xc008=function(_0x456066,_0x44930c){_0x456066=_0x456066-0x0;var _0x5a069a=_0x008c[_0x456066];return _0x5a069a;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index b8244d9..6601ade 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 _0x28a4=['INTEGER','STRING','noop','TEXT','exports'];(function(_0x1e3b08,_0x27b228){var _0x42af45=function(_0x369aea){while(--_0x369aea){_0x1e3b08['push'](_0x1e3b08['shift']());}};_0x42af45(++_0x27b228);}(_0x28a4,0x149));var _0x428a=function(_0x233aa1,_0x37af6d){_0x233aa1=_0x233aa1-0x0;var _0x4e670d=_0x28a4[_0x233aa1];return _0x4e670d;};'use strict';var Sequelize=require('sequelize');module[_0x428a('0x0')]={'priority':{'type':Sequelize[_0x428a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x428a('0x2')],'allowNull':![],'defaultValue':_0x428a('0x3')},'appdata':{'type':Sequelize[_0x428a('0x4')]()},'description':{'type':Sequelize[_0x428a('0x2')]},'interval':{'type':Sequelize[_0x428a('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xb2ed=['TEXT','*,*,*,*','sequelize','exports','STRING','noop'];(function(_0x5ac610,_0x1f16c7){var _0x54519c=function(_0x38ea26){while(--_0x38ea26){_0x5ac610['push'](_0x5ac610['shift']());}};_0x54519c(++_0x1f16c7);}(_0xb2ed,0x86));var _0xdb2e=function(_0x1fb4e1,_0x3d4ce6){_0x1fb4e1=_0x1fb4e1-0x0;var _0x22d1b0=_0xb2ed[_0x1fb4e1];return _0x22d1b0;};'use strict';var Sequelize=require(_0xdb2e('0x0'));module[_0xdb2e('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xdb2e('0x2')],'allowNull':![],'defaultValue':_0xdb2e('0x3')},'appdata':{'type':Sequelize[_0xdb2e('0x4')]()},'description':{'type':Sequelize[_0xdb2e('0x2')]},'interval':{'type':Sequelize[_0xdb2e('0x2')],'defaultValue':_0xdb2e('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index c822be4..198367a 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 _0xacb7=['attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','SmsApplication','includeAll','findAll','rows','catch','show','params','rawAttributes','create','body','destroy','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','name','index','map','fieldName','key','model','keys','query','filters','intersection','fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xacb7,0xf3));var _0x7acb=function(_0x5b0198,_0xdf0773){_0x5b0198=_0x5b0198-0x0;var _0x29cbac=_0xacb7[_0x5b0198];return _0x29cbac;};'use strict';var emlformat=require(_0x7acb('0x0'));var rimraf=require(_0x7acb('0x1'));var zipdir=require(_0x7acb('0x2'));var jsonpatch=require(_0x7acb('0x3'));var rp=require('request-promise');var moment=require(_0x7acb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7acb('0x5'));var util=require(_0x7acb('0x6'));var path=require(_0x7acb('0x7'));var sox=require(_0x7acb('0x8'));var csv=require(_0x7acb('0x9'));var ejs=require(_0x7acb('0xa'));var fs=require('fs');var fs_extra=require(_0x7acb('0xb'));var _=require(_0x7acb('0xc'));var squel=require(_0x7acb('0xd'));var crypto=require(_0x7acb('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7acb('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7acb('0x10'));var Papa=require(_0x7acb('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7acb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7acb('0x13'));var logger=require(_0x7acb('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7acb('0x15'));var db=require(_0x7acb('0x16'))['db'];function respondWithStatusCode(_0xe52f34,_0x7dc579){_0x7dc579=_0x7dc579||0xcc;return function(_0x2575fc){if(_0x2575fc){return _0xe52f34[_0x7acb('0x17')](_0x7dc579);}return _0xe52f34['status'](_0x7dc579)['end']();};}function respondWithResult(_0x21527c,_0x256721){_0x256721=_0x256721||0xc8;return function(_0xe1d21f){if(_0xe1d21f){return _0x21527c[_0x7acb('0x18')](_0x256721)['json'](_0xe1d21f);}};}function respondWithFilteredResult(_0x2c0bf5,_0x8c4685){return function(_0x16c451){if(_0x16c451){var _0xc7c900=typeof _0x8c4685[_0x7acb('0x19')]===_0x7acb('0x1a')&&typeof _0x8c4685[_0x7acb('0x1b')]===_0x7acb('0x1a');var _0x453fc1=_0x16c451[_0x7acb('0x1c')];var _0x576232=_0xc7c900?0x0:_0x8c4685[_0x7acb('0x19')];var _0xd785f3=_0xc7c900?_0x16c451['count']:_0x8c4685['offset']+_0x8c4685[_0x7acb('0x1b')];var _0x403cbc;if(_0xd785f3>=_0x453fc1){_0xd785f3=_0x453fc1;_0x403cbc=0xc8;}else{_0x403cbc=0xce;}_0x2c0bf5[_0x7acb('0x18')](_0x403cbc);return _0x2c0bf5[_0x7acb('0x1d')](_0x7acb('0x1e'),_0x576232+'-'+_0xd785f3+'/'+_0x453fc1)['json'](_0x16c451);}return null;};}function patchUpdates(_0x502689){return function(_0x5d9bd4){try{jsonpatch[_0x7acb('0x1f')](_0x5d9bd4,_0x502689,!![]);}catch(_0x2a23e9){return BPromise[_0x7acb('0x20')](_0x2a23e9);}return _0x5d9bd4[_0x7acb('0x21')]();};}function saveUpdates(_0x1bac7d,_0x54de91){return function(_0x71812a){if(_0x71812a){return _0x71812a[_0x7acb('0x22')](_0x1bac7d)[_0x7acb('0x23')](function(_0x4557b5){return _0x4557b5;});}return null;};}function removeEntity(_0x41935f,_0x5aaaf2){return function(_0x2f4a89){if(_0x2f4a89){return _0x2f4a89['destroy']()[_0x7acb('0x23')](function(){_0x41935f[_0x7acb('0x18')](0xcc)[_0x7acb('0x24')]();});}};}function handleEntityNotFound(_0x275db0,_0x638d23){return function(_0x5a63e5){if(!_0x5a63e5){_0x275db0[_0x7acb('0x17')](0x194);}return _0x5a63e5;};}function handleError(_0x39351d,_0x238518){_0x238518=_0x238518||0x1f4;return function(_0x55dc44){logger[_0x7acb('0x25')](_0x55dc44['stack']);if(_0x55dc44[_0x7acb('0x26')]){delete _0x55dc44[_0x7acb('0x26')];}_0x39351d[_0x7acb('0x18')](_0x238518)['send'](_0x55dc44);};}exports[_0x7acb('0x27')]=function(_0x15921f,_0x3e96ed){var _0x12200c={},_0x399ca2={},_0x5c6055={'count':0x0,'rows':[]};var _0x26df72=_[_0x7acb('0x28')](db['SmsApplication']['rawAttributes'],function(_0x1603ad){return{'name':_0x1603ad[_0x7acb('0x29')],'type':_0x1603ad['type'][_0x7acb('0x2a')]};});_0x399ca2[_0x7acb('0x2b')]=_['map'](_0x26df72,'name');_0x399ca2['query']=_[_0x7acb('0x2c')](_0x15921f[_0x7acb('0x2d')]);_0x399ca2[_0x7acb('0x2e')]=_[_0x7acb('0x2f')](_0x399ca2['model'],_0x399ca2[_0x7acb('0x2d')]);_0x12200c['attributes']=_[_0x7acb('0x2f')](_0x399ca2[_0x7acb('0x2b')],qs[_0x7acb('0x30')](_0x15921f[_0x7acb('0x2d')][_0x7acb('0x30')]));_0x12200c[_0x7acb('0x31')]=_0x12200c[_0x7acb('0x31')][_0x7acb('0x32')]?_0x12200c[_0x7acb('0x31')]:_0x399ca2['model'];if(!_0x15921f[_0x7acb('0x2d')][_0x7acb('0x33')](_0x7acb('0x34'))){_0x12200c['limit']=qs[_0x7acb('0x1b')](_0x15921f[_0x7acb('0x2d')][_0x7acb('0x1b')]);_0x12200c[_0x7acb('0x19')]=qs[_0x7acb('0x19')](_0x15921f['query']['offset']);}_0x12200c[_0x7acb('0x35')]=qs[_0x7acb('0x36')](_0x15921f[_0x7acb('0x2d')][_0x7acb('0x36')]);_0x12200c[_0x7acb('0x37')]=qs['filters'](_[_0x7acb('0x38')](_0x15921f['query'],_0x399ca2[_0x7acb('0x2e')]),_0x26df72);if(_0x15921f[_0x7acb('0x2d')]['filter']){_0x12200c['where']=_[_0x7acb('0x39')](_0x12200c[_0x7acb('0x37')],{'$or':_[_0x7acb('0x28')](_0x26df72,function(_0x251ee0){if(_0x251ee0[_0x7acb('0x3a')]!==_0x7acb('0x3b')){var _0x3b1550={};_0x3b1550[_0x251ee0[_0x7acb('0x26')]]={'$like':'%'+_0x15921f[_0x7acb('0x2d')][_0x7acb('0x3c')]+'%'};return _0x3b1550;}})});}_0x12200c=_[_0x7acb('0x39')]({},_0x12200c,_0x15921f['options']);var _0x2f7c53={'where':_0x12200c['where']};return db[_0x7acb('0x3d')][_0x7acb('0x1c')](_0x2f7c53)[_0x7acb('0x23')](function(_0xc5d35e){_0x5c6055[_0x7acb('0x1c')]=_0xc5d35e;if(_0x15921f[_0x7acb('0x2d')][_0x7acb('0x3e')]){_0x12200c['include']=[{'all':!![]}];}return db['SmsApplication'][_0x7acb('0x3f')](_0x12200c);})['then'](function(_0x19c948){_0x5c6055[_0x7acb('0x40')]=_0x19c948;return _0x5c6055;})[_0x7acb('0x23')](respondWithFilteredResult(_0x3e96ed,_0x12200c))[_0x7acb('0x41')](handleError(_0x3e96ed,null));};exports[_0x7acb('0x42')]=function(_0x18c7c8,_0x294382){var _0x27d923={'raw':!![],'where':{'id':_0x18c7c8[_0x7acb('0x43')]['id']}},_0x4876d2={};_0x4876d2['model']=_['keys'](db[_0x7acb('0x3d')][_0x7acb('0x44')]);_0x4876d2[_0x7acb('0x2d')]=_['keys'](_0x18c7c8[_0x7acb('0x2d')]);_0x4876d2[_0x7acb('0x2e')]=_['intersection'](_0x4876d2['model'],_0x4876d2[_0x7acb('0x2d')]);_0x27d923[_0x7acb('0x31')]=_[_0x7acb('0x2f')](_0x4876d2[_0x7acb('0x2b')],qs[_0x7acb('0x30')](_0x18c7c8[_0x7acb('0x2d')][_0x7acb('0x30')]));_0x27d923[_0x7acb('0x31')]=_0x27d923[_0x7acb('0x31')]['length']?_0x27d923[_0x7acb('0x31')]:_0x4876d2[_0x7acb('0x2b')];if(_0x18c7c8[_0x7acb('0x2d')]['includeAll']){_0x27d923['include']=[{'all':!![]}];}_0x27d923=_[_0x7acb('0x39')]({},_0x27d923,_0x18c7c8['options']);return db[_0x7acb('0x3d')]['find'](_0x27d923)[_0x7acb('0x23')](handleEntityNotFound(_0x294382,null))[_0x7acb('0x23')](respondWithResult(_0x294382,null))['catch'](handleError(_0x294382,null));};exports['create']=function(_0x149bb0,_0x27320b){return db[_0x7acb('0x3d')][_0x7acb('0x45')](_0x149bb0[_0x7acb('0x46')],{})['then'](respondWithResult(_0x27320b,0xc9))[_0x7acb('0x41')](handleError(_0x27320b,null));};exports[_0x7acb('0x22')]=function(_0x51b981,_0x563232){if(_0x51b981['body']['id']){delete _0x51b981[_0x7acb('0x46')]['id'];}return db[_0x7acb('0x3d')]['find']({'where':{'id':_0x51b981['params']['id']}})[_0x7acb('0x23')](handleEntityNotFound(_0x563232,null))[_0x7acb('0x23')](saveUpdates(_0x51b981[_0x7acb('0x46')],null))['then'](respondWithResult(_0x563232,null))[_0x7acb('0x41')](handleError(_0x563232,null));};exports[_0x7acb('0x47')]=function(_0x8a87aa,_0x5927b9){return db['SmsApplication'][_0x7acb('0x48')]({'where':{'id':_0x8a87aa[_0x7acb('0x43')]['id']}})[_0x7acb('0x23')](handleEntityNotFound(_0x5927b9,null))['then'](removeEntity(_0x5927b9,null))[_0x7acb('0x41')](handleError(_0x5927b9,null));}; \ No newline at end of file +var _0x86d6=['type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','length','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','error','stack','send','index','map','SmsApplication','rawAttributes','fieldName'];(function(_0x43425c,_0x3e4702){var _0x4c4ab0=function(_0x272995){while(--_0x272995){_0x43425c['push'](_0x43425c['shift']());}};_0x4c4ab0(++_0x3e4702);}(_0x86d6,0x1ea));var _0x686d=function(_0x2ae7f0,_0x42f40b){_0x2ae7f0=_0x2ae7f0-0x0;var _0x5d7bb2=_0x86d6[_0x2ae7f0];return _0x5d7bb2;};'use strict';var emlformat=require(_0x686d('0x0'));var rimraf=require(_0x686d('0x1'));var zipdir=require(_0x686d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x686d('0x3'));var moment=require('moment');var BPromise=require(_0x686d('0x4'));var Mustache=require(_0x686d('0x5'));var util=require(_0x686d('0x6'));var path=require(_0x686d('0x7'));var sox=require(_0x686d('0x8'));var csv=require(_0x686d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x686d('0xa'));var _=require(_0x686d('0xb'));var squel=require(_0x686d('0xc'));var crypto=require(_0x686d('0xd'));var jsforce=require(_0x686d('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x686d('0xf'));var Papa=require(_0x686d('0x10'));var Redis=require(_0x686d('0x11'));var authService=require(_0x686d('0x12'));var qs=require(_0x686d('0x13'));var as=require(_0x686d('0x14'));var hardwareService=require(_0x686d('0x15'));var logger=require('../../config/logger')(_0x686d('0x16'));var utils=require(_0x686d('0x17'));var config=require(_0x686d('0x18'));var licenseUtil=require(_0x686d('0x19'));var db=require(_0x686d('0x1a'))['db'];function respondWithStatusCode(_0x178884,_0x4ef939){_0x4ef939=_0x4ef939||0xcc;return function(_0x490446){if(_0x490446){return _0x178884[_0x686d('0x1b')](_0x4ef939);}return _0x178884['status'](_0x4ef939)['end']();};}function respondWithResult(_0x2e3a79,_0x341fbe){_0x341fbe=_0x341fbe||0xc8;return function(_0x30ad3d){if(_0x30ad3d){return _0x2e3a79[_0x686d('0x1c')](_0x341fbe)[_0x686d('0x1d')](_0x30ad3d);}};}function respondWithFilteredResult(_0x3606b8,_0x2386e1){return function(_0x25d735){if(_0x25d735){var _0x210e58=typeof _0x2386e1[_0x686d('0x1e')]===_0x686d('0x1f')&&typeof _0x2386e1[_0x686d('0x20')]==='undefined';var _0x204608=_0x25d735[_0x686d('0x21')];var _0x4ade8e=_0x210e58?0x0:_0x2386e1[_0x686d('0x1e')];var _0x539687=_0x210e58?_0x25d735[_0x686d('0x21')]:_0x2386e1[_0x686d('0x1e')]+_0x2386e1[_0x686d('0x20')];var _0x2cd6b2;if(_0x539687>=_0x204608){_0x539687=_0x204608;_0x2cd6b2=0xc8;}else{_0x2cd6b2=0xce;}_0x3606b8['status'](_0x2cd6b2);return _0x3606b8[_0x686d('0x22')]('Content-Range',_0x4ade8e+'-'+_0x539687+'/'+_0x204608)[_0x686d('0x1d')](_0x25d735);}return null;};}function patchUpdates(_0x191125){return function(_0x37057c){try{jsonpatch[_0x686d('0x23')](_0x37057c,_0x191125,!![]);}catch(_0x3ded59){return BPromise[_0x686d('0x24')](_0x3ded59);}return _0x37057c[_0x686d('0x25')]();};}function saveUpdates(_0x4e0e3e,_0x1803a2){return function(_0x16a7fb){if(_0x16a7fb){return _0x16a7fb[_0x686d('0x26')](_0x4e0e3e)[_0x686d('0x27')](function(_0x43b392){return _0x43b392;});}return null;};}function removeEntity(_0x307d55,_0x201148){return function(_0x2dc848){if(_0x2dc848){return _0x2dc848['destroy']()['then'](function(){_0x307d55['status'](0xcc)[_0x686d('0x28')]();});}};}function handleEntityNotFound(_0x5abb52,_0x5183a8){return function(_0x1693b9){if(!_0x1693b9){_0x5abb52['sendStatus'](0x194);}return _0x1693b9;};}function handleError(_0xdc2750,_0x2ab843){_0x2ab843=_0x2ab843||0x1f4;return function(_0x3a1696){logger[_0x686d('0x29')](_0x3a1696[_0x686d('0x2a')]);if(_0x3a1696['name']){delete _0x3a1696['name'];}_0xdc2750['status'](_0x2ab843)[_0x686d('0x2b')](_0x3a1696);};}exports[_0x686d('0x2c')]=function(_0x236463,_0x563b7c){var _0x184e04={},_0x8a02d7={},_0x292db0={'count':0x0,'rows':[]};var _0x479293=_[_0x686d('0x2d')](db[_0x686d('0x2e')][_0x686d('0x2f')],function(_0x19050a){return{'name':_0x19050a[_0x686d('0x30')],'type':_0x19050a[_0x686d('0x31')][_0x686d('0x32')]};});_0x8a02d7['model']=_[_0x686d('0x2d')](_0x479293,'name');_0x8a02d7[_0x686d('0x33')]=_[_0x686d('0x34')](_0x236463[_0x686d('0x33')]);_0x8a02d7[_0x686d('0x35')]=_[_0x686d('0x36')](_0x8a02d7[_0x686d('0x37')],_0x8a02d7[_0x686d('0x33')]);_0x184e04[_0x686d('0x38')]=_[_0x686d('0x36')](_0x8a02d7[_0x686d('0x37')],qs[_0x686d('0x39')](_0x236463[_0x686d('0x33')][_0x686d('0x39')]));_0x184e04[_0x686d('0x38')]=_0x184e04[_0x686d('0x38')]['length']?_0x184e04[_0x686d('0x38')]:_0x8a02d7[_0x686d('0x37')];if(!_0x236463[_0x686d('0x33')][_0x686d('0x3a')](_0x686d('0x3b'))){_0x184e04[_0x686d('0x20')]=qs[_0x686d('0x20')](_0x236463[_0x686d('0x33')][_0x686d('0x20')]);_0x184e04[_0x686d('0x1e')]=qs[_0x686d('0x1e')](_0x236463[_0x686d('0x33')]['offset']);}_0x184e04[_0x686d('0x3c')]=qs[_0x686d('0x3d')](_0x236463[_0x686d('0x33')][_0x686d('0x3d')]);_0x184e04['where']=qs[_0x686d('0x35')](_['pick'](_0x236463['query'],_0x8a02d7[_0x686d('0x35')]),_0x479293);if(_0x236463['query'][_0x686d('0x3e')]){_0x184e04[_0x686d('0x3f')]=_[_0x686d('0x40')](_0x184e04[_0x686d('0x3f')],{'$or':_[_0x686d('0x2d')](_0x479293,function(_0x14cbf7){if(_0x14cbf7[_0x686d('0x31')]!==_0x686d('0x41')){var _0x81b194={};_0x81b194[_0x14cbf7['name']]={'$like':'%'+_0x236463[_0x686d('0x33')][_0x686d('0x3e')]+'%'};return _0x81b194;}})});}_0x184e04=_[_0x686d('0x40')]({},_0x184e04,_0x236463[_0x686d('0x42')]);var _0x3950cb={'where':_0x184e04[_0x686d('0x3f')]};return db[_0x686d('0x2e')][_0x686d('0x21')](_0x3950cb)['then'](function(_0x14eb7e){_0x292db0['count']=_0x14eb7e;if(_0x236463['query'][_0x686d('0x43')]){_0x184e04[_0x686d('0x44')]=[{'all':!![]}];}return db[_0x686d('0x2e')][_0x686d('0x45')](_0x184e04);})[_0x686d('0x27')](function(_0x2b89ec){_0x292db0['rows']=_0x2b89ec;return _0x292db0;})[_0x686d('0x27')](respondWithFilteredResult(_0x563b7c,_0x184e04))[_0x686d('0x46')](handleError(_0x563b7c,null));};exports['show']=function(_0x27a3a3,_0x21d24f){var _0x1df439={'raw':!![],'where':{'id':_0x27a3a3[_0x686d('0x47')]['id']}},_0x183bf7={};_0x183bf7['model']=_[_0x686d('0x34')](db['SmsApplication'][_0x686d('0x2f')]);_0x183bf7[_0x686d('0x33')]=_['keys'](_0x27a3a3[_0x686d('0x33')]);_0x183bf7['filters']=_[_0x686d('0x36')](_0x183bf7['model'],_0x183bf7[_0x686d('0x33')]);_0x1df439['attributes']=_['intersection'](_0x183bf7['model'],qs['fields'](_0x27a3a3[_0x686d('0x33')][_0x686d('0x39')]));_0x1df439[_0x686d('0x38')]=_0x1df439['attributes'][_0x686d('0x48')]?_0x1df439[_0x686d('0x38')]:_0x183bf7[_0x686d('0x37')];if(_0x27a3a3[_0x686d('0x33')][_0x686d('0x43')]){_0x1df439[_0x686d('0x44')]=[{'all':!![]}];}_0x1df439=_[_0x686d('0x40')]({},_0x1df439,_0x27a3a3[_0x686d('0x42')]);return db[_0x686d('0x2e')][_0x686d('0x49')](_0x1df439)[_0x686d('0x27')](handleEntityNotFound(_0x21d24f,null))[_0x686d('0x27')](respondWithResult(_0x21d24f,null))['catch'](handleError(_0x21d24f,null));};exports[_0x686d('0x4a')]=function(_0x3bc8b6,_0x126ab9){return db[_0x686d('0x2e')]['create'](_0x3bc8b6[_0x686d('0x4b')],{})[_0x686d('0x27')](respondWithResult(_0x126ab9,0xc9))[_0x686d('0x46')](handleError(_0x126ab9,null));};exports['update']=function(_0xd07145,_0x264717){if(_0xd07145[_0x686d('0x4b')]['id']){delete _0xd07145['body']['id'];}return db['SmsApplication'][_0x686d('0x49')]({'where':{'id':_0xd07145['params']['id']}})[_0x686d('0x27')](handleEntityNotFound(_0x264717,null))[_0x686d('0x27')](saveUpdates(_0xd07145[_0x686d('0x4b')],null))[_0x686d('0x27')](respondWithResult(_0x264717,null))[_0x686d('0x46')](handleError(_0x264717,null));};exports[_0x686d('0x4c')]=function(_0x4f38b6,_0x504c04){return db[_0x686d('0x2e')][_0x686d('0x49')]({'where':{'id':_0x4f38b6[_0x686d('0x47')]['id']}})[_0x686d('0x27')](handleEntityNotFound(_0x504c04,null))[_0x686d('0x27')](removeEntity(_0x504c04,null))[_0x686d('0x46')](handleError(_0x504c04,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 3e172d5..0bbff13 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 _0x6b9d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x6b9d,0xed));var _0xd6b9=function(_0x54381d,_0x247b2c){_0x54381d=_0x54381d-0x0;var _0x5308a7=_0x6b9d[_0x54381d];return _0x5308a7;};'use strict';var _=require(_0xd6b9('0x0'));var util=require(_0xd6b9('0x1'));var logger=require(_0xd6b9('0x2'))(_0xd6b9('0x3'));var moment=require(_0xd6b9('0x4'));var BPromise=require(_0xd6b9('0x5'));var rp=require(_0xd6b9('0x6'));var fs=require('fs');var path=require(_0xd6b9('0x7'));var rimraf=require(_0xd6b9('0x8'));var config=require(_0xd6b9('0x9'));var attributes=require(_0xd6b9('0xa'));module[_0xd6b9('0xb')]=function(_0x5d63d1,_0x111b1b){return _0x5d63d1[_0xd6b9('0xc')]('SmsApplication',attributes,{'tableName':_0xd6b9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd6b9('0xe'),'collate':_0xd6b9('0xf')});}; \ No newline at end of file +var _0x201d=['moment','path','rimraf','../../config/environment','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x4040a6,_0x49cbcd){var _0x55fd3f=function(_0x3cfcf3){while(--_0x3cfcf3){_0x4040a6['push'](_0x4040a6['shift']());}};_0x55fd3f(++_0x49cbcd);}(_0x201d,0x184));var _0xd201=function(_0x1c9048,_0x35f0a4){_0x1c9048=_0x1c9048-0x0;var _0x3eb4ee=_0x201d[_0x1c9048];return _0x3eb4ee;};'use strict';var _=require(_0xd201('0x0'));var util=require(_0xd201('0x1'));var logger=require(_0xd201('0x2'))(_0xd201('0x3'));var moment=require(_0xd201('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd201('0x5'));var rimraf=require(_0xd201('0x6'));var config=require(_0xd201('0x7'));var attributes=require('./smsApplication.attributes');module[_0xd201('0x8')]=function(_0x3d9f2d,_0x498ab8){return _0x3d9f2d[_0xd201('0x9')](_0xd201('0xa'),attributes,{'tableName':_0xd201('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd201('0xc'),'collate':_0xd201('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 5f90978..8164296 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 _0xd301=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd301,0x145));var _0x1d30=function(_0x1034bb,_0x4e20b3){_0x1034bb=_0x1034bb-0x0;var _0x453fdb=_0xd301[_0x1034bb];return _0x453fdb;};'use strict';var _=require(_0x1d30('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1d30('0x1'));var fs=require('fs');var Redis=require(_0x1d30('0x2'));var db=require(_0x1d30('0x3'))['db'];var utils=require(_0x1d30('0x4'));var logger=require(_0x1d30('0x5'))(_0x1d30('0x6'));var config=require(_0x1d30('0x7'));var jayson=require(_0x1d30('0x8'));var client=jayson[_0x1d30('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fe945,_0x375cee,_0x41e079){return new BPromise(function(_0x54320e,_0x40cb9d){return client[_0x1d30('0xa')](_0x2fe945,_0x41e079)[_0x1d30('0xb')](function(_0x18d077){logger[_0x1d30('0xc')](_0x1d30('0xd'),_0x375cee,_0x1d30('0xe'));logger['debug'](_0x1d30('0xf'),_0x375cee,_0x1d30('0xe'),JSON[_0x1d30('0x10')](_0x18d077));if(_0x18d077['error']){if(_0x18d077[_0x1d30('0x11')][_0x1d30('0x12')]===0x1f4){logger[_0x1d30('0x11')](_0x1d30('0xd'),_0x375cee,_0x18d077[_0x1d30('0x11')][_0x1d30('0x13')]);return _0x40cb9d(_0x18d077[_0x1d30('0x11')][_0x1d30('0x13')]);}logger[_0x1d30('0x11')](_0x1d30('0xd'),_0x375cee,_0x18d077[_0x1d30('0x11')][_0x1d30('0x13')]);return _0x54320e(_0x18d077[_0x1d30('0x11')][_0x1d30('0x13')]);}else{logger[_0x1d30('0xc')]('SmsApplication,\x20%s,\x20%s',_0x375cee,_0x1d30('0xe'));_0x54320e(_0x18d077[_0x1d30('0x14')][_0x1d30('0x13')]);}})[_0x1d30('0x15')](function(_0x40f4b5){logger['error']('SmsApplication,\x20%s,\x20%s',_0x375cee,_0x40f4b5);_0x40cb9d(_0x40f4b5);});});} \ No newline at end of file +var _0x19e1=['moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','SmsApplication,\x20%s,\x20%s','message','info','result','catch','lodash','util'];(function(_0x2b1fc6,_0x367ea6){var _0x4801cd=function(_0x178db6){while(--_0x178db6){_0x2b1fc6['push'](_0x2b1fc6['shift']());}};_0x4801cd(++_0x367ea6);}(_0x19e1,0x163));var _0x119e=function(_0x221ba2,_0x79208){_0x221ba2=_0x221ba2-0x0;var _0x47d08e=_0x19e1[_0x221ba2];return _0x47d08e;};'use strict';var _=require(_0x119e('0x0'));var util=require(_0x119e('0x1'));var moment=require(_0x119e('0x2'));var BPromise=require(_0x119e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x119e('0x4'))['db'];var utils=require(_0x119e('0x5'));var logger=require('../../config/logger')(_0x119e('0x6'));var config=require(_0x119e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x119e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b5306,_0x25e166,_0x16a2ee){return new BPromise(function(_0x1b3797,_0x53d5b7){return client[_0x119e('0x9')](_0x1b5306,_0x16a2ee)[_0x119e('0xa')](function(_0x1a6747){logger['info']('SmsApplication,\x20%s,\x20%s',_0x25e166,_0x119e('0xb'));logger[_0x119e('0xc')](_0x119e('0xd'),_0x25e166,_0x119e('0xb'),JSON[_0x119e('0xe')](_0x1a6747));if(_0x1a6747[_0x119e('0xf')]){if(_0x1a6747[_0x119e('0xf')]['code']===0x1f4){logger[_0x119e('0xf')](_0x119e('0x10'),_0x25e166,_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);return _0x53d5b7(_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);}logger['error'](_0x119e('0x10'),_0x25e166,_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);return _0x1b3797(_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);}else{logger[_0x119e('0x12')](_0x119e('0x10'),_0x25e166,_0x119e('0xb'));_0x1b3797(_0x1a6747[_0x119e('0x13')][_0x119e('0x11')]);}})[_0x119e('0x14')](function(_0x54c326){logger[_0x119e('0xf')](_0x119e('0x10'),_0x25e166,_0x54c326);_0x53d5b7(_0x54c326);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 17f93d3..2ff8a27 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 _0x2547=['/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x193e85,_0x8eb100){var _0x464e7b=function(_0x347e01){while(--_0x347e01){_0x193e85['push'](_0x193e85['shift']());}};_0x464e7b(++_0x8eb100);}(_0x2547,0x1cd));var _0x7254=function(_0x3041a9,_0x252166){_0x3041a9=_0x3041a9-0x0;var _0x240523=_0x2547[_0x3041a9];return _0x240523;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var fs_extra=require(_0x7254('0x5'));var auth=require(_0x7254('0x6'));var interaction=require(_0x7254('0x7'));var config=require('../../config/environment');var controller=require(_0x7254('0x8'));router[_0x7254('0x9')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0xb')]);router['get'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0xd')]);router['get'](_0x7254('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x10')]);router[_0x7254('0x9')](_0x7254('0x11'),auth[_0x7254('0xa')](),controller['download']);router[_0x7254('0x12')]('/',auth['isAuthenticated'](),controller[_0x7254('0x13')]);router['post'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x14')]);router[_0x7254('0x12')](_0x7254('0x15'),auth[_0x7254('0xa')](),interaction[_0x7254('0x16')](_0x7254('0x17'),_0x7254('0x18')),controller[_0x7254('0x19')]);router[_0x7254('0x1a')](_0x7254('0xe'),auth[_0x7254('0xa')](),interaction['tracked'](_0x7254('0x17'),_0x7254('0x1b')),controller[_0x7254('0x1c')]);router[_0x7254('0x1d')](_0x7254('0xe'),auth[_0x7254('0xa')](),interaction[_0x7254('0x16')]('sms',_0x7254('0x1e')),controller[_0x7254('0x1f')]);router[_0x7254('0x1d')](_0x7254('0x15'),auth[_0x7254('0xa')](),controller[_0x7254('0x20')]);module[_0x7254('0x21')]=router; \ No newline at end of file +var _0x80ed=['delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','download','post','create','tracked','sms','smsinteraction:addtags','addTags','smsinteraction:update','update'];(function(_0x42ebba,_0x4cbf87){var _0x3fd2af=function(_0x26d999){while(--_0x26d999){_0x42ebba['push'](_0x42ebba['shift']());}};_0x3fd2af(++_0x4cbf87);}(_0x80ed,0x11c));var _0xd80e=function(_0xf8699c,_0x3f8430){_0xf8699c=_0xf8699c-0x0;var _0x279010=_0x80ed[_0xf8699c];return _0x279010;};'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('./smsInteraction.controller');router[_0xd80e('0x8')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0xa')]);router['get'](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xc')]);router[_0xd80e('0x8')](_0xd80e('0xd'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xe')]);router[_0xd80e('0x8')](_0xd80e('0xf'),auth[_0xd80e('0x9')](),controller['getMessages']);router[_0xd80e('0x8')](_0xd80e('0x10'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x11')]);router[_0xd80e('0x12')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0x13')]);router[_0xd80e('0x12')](_0xd80e('0xf'),auth['isAuthenticated'](),controller['addMessage']);router['post']('/:id/tags',auth[_0xd80e('0x9')](),interaction[_0xd80e('0x14')](_0xd80e('0x15'),_0xd80e('0x16')),controller[_0xd80e('0x17')]);router['put'](_0xd80e('0xd'),auth[_0xd80e('0x9')](),interaction[_0xd80e('0x14')](_0xd80e('0x15'),_0xd80e('0x18')),controller[_0xd80e('0x19')]);router[_0xd80e('0x1a')](_0xd80e('0xd'),auth['isAuthenticated'](),interaction[_0xd80e('0x14')](_0xd80e('0x15'),_0xd80e('0x1b')),controller[_0xd80e('0x1c')]);router['delete'](_0xd80e('0x1d'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index b720521..6f129d0 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 _0x503a=['moment','BOOLEAN','STRING','DATE','ENUM','sequelize'];(function(_0x47f8d2,_0x259040){var _0x5b31bb=function(_0x592145){while(--_0x592145){_0x47f8d2['push'](_0x47f8d2['shift']());}};_0x5b31bb(++_0x259040);}(_0x503a,0x19d));var _0xa503=function(_0x1f9f5f,_0x509fb7){_0x1f9f5f=_0x1f9f5f-0x0;var _0x51d649=_0x503a[_0x1f9f5f];return _0x51d649;};'use strict';var Sequelize=require(_0xa503('0x0'));var moment=require(_0xa503('0x1'));module['exports']={'closed':{'type':Sequelize[_0xa503('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xa503('0x3')]},'secondDisposition':{'type':Sequelize[_0xa503('0x3')]},'thirdDisposition':{'type':Sequelize[_0xa503('0x3')]},'note':{'type':Sequelize[_0xa503('0x3')]},'phone':{'type':Sequelize[_0xa503('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa503('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xa503('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xa503('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x448b=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment','exports'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x448b,0x125));var _0xb448=function(_0x4d438a,_0x25c873){_0x4d438a=_0x4d438a-0x0;var _0x542148=_0x448b[_0x4d438a];return _0x542148;};'use strict';var Sequelize=require(_0xb448('0x0'));var moment=require(_0xb448('0x1'));module[_0xb448('0x2')]={'closed':{'type':Sequelize[_0xb448('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb448('0x4')]},'disposition':{'type':Sequelize[_0xb448('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xb448('0x5')]},'note':{'type':Sequelize[_0xb448('0x5')]},'phone':{'type':Sequelize[_0xb448('0x5')]},'read1stAt':{'type':Sequelize[_0xb448('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xb448('0x6')]('in',_0xb448('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb448('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xb448('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb448('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index aecce39..4b529be 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 _0x962d=['unix','toString','root','server','files','join','format','transcript-%d-%s.zip','push','User','fullname','CmContact','firstName','lastName','Messages','createdAt','direction','SmsAccount','Account','Owner','get','Sms','N.A.','closed','closedAt','out','System','Contact','secret','read','value','renderFile','views','downloadInteraction.ejs','transcript-','download','err','rimraf','zip-dir','bluebird','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','error','stack','name','send','map','SmsInteraction','type','getOptions','findAll','sms','user','catch','params','keys','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','create','body','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','rawAttributes','hasOwnProperty','nolimit','order','sort','where','SmsInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','Tag','color','emit','removeTags'];(function(_0x401c80,_0x387f4e){var _0x462bc9=function(_0x2f66cd){while(--_0x2f66cd){_0x401c80['push'](_0x401c80['shift']());}};_0x462bc9(++_0x387f4e);}(_0x962d,0x9b));var _0xd962=function(_0x4709c8,_0x3384ca){_0x4709c8=_0x4709c8-0x0;var _0x478cdd=_0x962d[_0x4709c8];return _0x478cdd;};'use strict';var rimraf=require(_0xd962('0x0'));var zipdir=require(_0xd962('0x1'));var moment=require('moment');var BPromise=require(_0xd962('0x2'));var util=require(_0xd962('0x3'));var path=require('path');var ejs=require(_0xd962('0x4'));var fs=require('fs');var _=require(_0xd962('0x5'));var Redis=require(_0xd962('0x6'));var interaction=require(_0xd962('0x7'));var qs=require(_0xd962('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0xd962('0x9'))(_0xd962('0xa'));var config=require(_0xd962('0xb'));var db=require(_0xd962('0xc'))['db'];config[_0xd962('0xd')]=_[_0xd962('0xe')](config[_0xd962('0xd')],{'host':_0xd962('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x2ad5d5,_0x30274f){_0x30274f=_0x30274f||0xcc;return function(_0x1d8061){if(_0x1d8061){return _0x2ad5d5[_0xd962('0x10')](_0x30274f);}return _0x2ad5d5[_0xd962('0x11')](_0x30274f)[_0xd962('0x12')]();};}function respondWithResult(_0x2ca1bf,_0x7d3e41){_0x7d3e41=_0x7d3e41||0xc8;return function(_0x35ca6f){if(_0x35ca6f){return _0x2ca1bf['status'](_0x7d3e41)[_0xd962('0x13')](_0x35ca6f);}};}function respondWithFilteredResult(_0x2cbd83,_0x41a55e){return function(_0x29e07d){if(_0x29e07d){var _0x5bc236=typeof _0x41a55e[_0xd962('0x14')]==='undefined'&&typeof _0x41a55e[_0xd962('0x15')]===_0xd962('0x16');var _0x31bdcf=_0x29e07d[_0xd962('0x17')];var _0x15f3bf=_0x5bc236?0x0:_0x41a55e['offset'];var _0x14e636=_0x5bc236?_0x29e07d['count']:_0x41a55e['offset']+_0x41a55e['limit'];var _0x114106;if(_0x14e636>=_0x31bdcf){_0x14e636=_0x31bdcf;_0x114106=0xc8;}else{_0x114106=0xce;}_0x2cbd83[_0xd962('0x11')](_0x114106);return _0x2cbd83[_0xd962('0x18')](_0xd962('0x19'),_0x15f3bf+'-'+_0x14e636+'/'+_0x31bdcf)[_0xd962('0x13')](_0x29e07d);}return null;};}function saveUpdates(_0x464f64){return function(_0x245c0c){if(_0x245c0c){return _0x245c0c[_0xd962('0x1a')](_0x464f64)[_0xd962('0x1b')](function(_0x40295f){return _0x40295f;});}return null;};}function removeEntity(_0x3eebcb){return function(_0x36b439){if(_0x36b439){return _0x36b439[_0xd962('0x1c')]()[_0xd962('0x1b')](function(){_0x3eebcb['status'](0xcc)[_0xd962('0x12')]();});}};}function handleEntityNotFound(_0x41adf6){return function(_0x320bf1){if(!_0x320bf1){_0x41adf6['sendStatus'](0x194);}return _0x320bf1;};}function handleError(_0x2f5799,_0x3f2a9b){_0x3f2a9b=_0x3f2a9b||0x1f4;return function(_0xa59fbe){logger[_0xd962('0x1d')](_0xa59fbe[_0xd962('0x1e')]);if(_0xa59fbe[_0xd962('0x1f')]){delete _0xa59fbe[_0xd962('0x1f')];}_0x2f5799['status'](_0x3f2a9b)[_0xd962('0x20')](_0xa59fbe);};}exports['index']=function(_0x502c20,_0x3c474f){var _0x42477a={};var _0x263916=_[_0xd962('0x21')](db[_0xd962('0x22')]['rawAttributes'],function(_0x42427b){return{'name':_0x42427b['fieldName'],'type':_0x42427b[_0xd962('0x23')]['key']};});_0x42477a=qs[_0xd962('0x24')](_0x263916,_0x502c20);return interaction[_0xd962('0x25')](_0xd962('0x26'),_0x502c20['query'],_0x502c20[_0xd962('0x27')],_0x42477a,_0x263916)[_0xd962('0x1b')](respondWithFilteredResult(_0x3c474f,_0x42477a))[_0xd962('0x28')](handleError(_0x3c474f,null));};exports['show']=function(_0x25b1ab,_0x4a2219){var _0x29ca47={'raw':![],'where':{'id':_0x25b1ab[_0xd962('0x29')]['id']}},_0x3f3e72={};_0x3f3e72['model']=_[_0xd962('0x2a')](db[_0xd962('0x22')]['rawAttributes']);_0x3f3e72[_0xd962('0x2b')]=_['keys'](_0x25b1ab[_0xd962('0x2b')]);_0x3f3e72[_0xd962('0x2c')]=_[_0xd962('0x2d')](_0x3f3e72[_0xd962('0x2e')],_0x3f3e72['query']);_0x29ca47[_0xd962('0x2f')]=_[_0xd962('0x2d')](_0x3f3e72['model'],qs[_0xd962('0x30')](_0x25b1ab[_0xd962('0x2b')][_0xd962('0x30')]));_0x29ca47[_0xd962('0x2f')]=_0x29ca47['attributes'][_0xd962('0x31')]?_0x29ca47['attributes']:_0x3f3e72[_0xd962('0x2e')];if(_0x25b1ab[_0xd962('0x2b')][_0xd962('0x32')]){_0x29ca47[_0xd962('0x33')]=[{'all':!![]}];}_0x29ca47=_[_0xd962('0x34')]({},_0x29ca47,_0x25b1ab[_0xd962('0x35')]);return db['SmsInteraction'][_0xd962('0x36')](_0x29ca47)['then'](handleEntityNotFound(_0x4a2219,null))[_0xd962('0x1b')](respondWithResult(_0x4a2219,null))[_0xd962('0x28')](handleError(_0x4a2219,null));};exports[_0xd962('0x37')]=function(_0x4ebd5d,_0x5e570e){return db[_0xd962('0x22')][_0xd962('0x37')](_0x4ebd5d[_0xd962('0x38')],{})['then'](respondWithResult(_0x5e570e,0xc9))[_0xd962('0x28')](handleError(_0x5e570e,null));};exports[_0xd962('0x1a')]=function(_0x363cff,_0x36c84d){if(_0x363cff[_0xd962('0x38')]['id']){delete _0x363cff[_0xd962('0x38')]['id'];}return db[_0xd962('0x22')][_0xd962('0x36')]({'where':{'id':_0x363cff[_0xd962('0x29')]['id']}})[_0xd962('0x1b')](handleEntityNotFound(_0x36c84d,null))[_0xd962('0x1b')](saveUpdates(_0x363cff[_0xd962('0x38')],null))['then'](respondWithResult(_0x36c84d,null))[_0xd962('0x28')](handleError(_0x36c84d,null));};exports[_0xd962('0x1c')]=function(_0x532d61,_0x2bd87f){return db[_0xd962('0x22')][_0xd962('0x36')]({'where':{'id':_0x532d61[_0xd962('0x29')]['id']}})[_0xd962('0x1b')](handleEntityNotFound(_0x2bd87f,null))[_0xd962('0x1b')](removeEntity(_0x2bd87f,null))[_0xd962('0x28')](handleError(_0x2bd87f,null));};exports[_0xd962('0x39')]=function(_0x183303,_0x2bc0d5){return db[_0xd962('0x22')]['describe']()[_0xd962('0x1b')](respondWithResult(_0x2bc0d5,null))[_0xd962('0x28')](handleError(_0x2bc0d5,null));};exports[_0xd962('0x3a')]=function(_0x34a625,_0x1b63fa){return db[_0xd962('0x3b')][_0xd962('0x36')]({'where':{'id':_0x34a625[_0xd962('0x29')]['id']}})['then'](handleEntityNotFound(_0x1b63fa,null))[_0xd962('0x1b')](function(_0x381abb){if(_0x381abb){return _0x381abb[_0xd962('0x3a')](_0x34a625[_0xd962('0x38')][_0xd962('0x3c')],_[_0xd962('0x3d')](_0x34a625[_0xd962('0x38')],[_0xd962('0x3c'),'id'])||{});}})['then'](respondWithResult(_0x1b63fa,null))[_0xd962('0x28')](handleError(_0x1b63fa,null));};exports[_0xd962('0x3e')]=function(_0x4a5202,_0x545ed0){var _0xf3e277={'raw':![],'where':{}};var _0x543077={};var _0x21adde={'count':0x0,'rows':[]};return db[_0xd962('0x22')][_0xd962('0x3f')]({'where':{'id':_0x4a5202[_0xd962('0x29')]['id']}})['then'](handleEntityNotFound(_0x545ed0,null))[_0xd962('0x1b')](function(_0xf118c3){if(_0xf118c3){_0x543077['model']=_[_0xd962('0x2a')](db[_0xd962('0x3b')][_0xd962('0x40')]);_0x543077[_0xd962('0x2b')]=_[_0xd962('0x2a')](_0x4a5202[_0xd962('0x2b')]);_0x543077['filters']=_[_0xd962('0x2d')](_0x543077[_0xd962('0x2e')],_0x543077['query']);_0xf3e277[_0xd962('0x2f')]=_['intersection'](_0x543077[_0xd962('0x2e')],qs[_0xd962('0x30')](_0x4a5202[_0xd962('0x2b')]['fields']));_0xf3e277[_0xd962('0x2f')]=_0xf3e277[_0xd962('0x2f')][_0xd962('0x31')]?_0xf3e277[_0xd962('0x2f')]:_0x543077[_0xd962('0x2e')];if(!_0x4a5202['query'][_0xd962('0x41')](_0xd962('0x42'))){_0xf3e277[_0xd962('0x15')]=qs[_0xd962('0x15')](_0x4a5202[_0xd962('0x2b')][_0xd962('0x15')]);_0xf3e277[_0xd962('0x14')]=qs[_0xd962('0x14')](_0x4a5202['query'][_0xd962('0x14')]);}_0xf3e277[_0xd962('0x43')]=qs[_0xd962('0x44')](_0x4a5202[_0xd962('0x2b')][_0xd962('0x44')]);_0xf3e277[_0xd962('0x45')]=qs[_0xd962('0x2c')](_['pick'](_0x4a5202[_0xd962('0x2b')],_0x543077[_0xd962('0x2c')]));_0xf3e277[_0xd962('0x45')][_0xd962('0x46')]=_0xf118c3['id'];if(_0x4a5202[_0xd962('0x2b')][_0xd962('0x47')]){_0xf3e277[_0xd962('0x45')]=_[_0xd962('0x34')](_0xf3e277[_0xd962('0x45')],{'$or':_[_0xd962('0x21')](_0xf3e277[_0xd962('0x2f')],function(_0xc977c3){var _0x479645={};_0x479645[_0xc977c3]={'$like':'%'+_0x4a5202[_0xd962('0x2b')][_0xd962('0x47')]+'%'};return _0x479645;})});}if(_0x4a5202['query'][_0xd962('0x48')]){var _0x58a60b=_0x4a5202['query'][_0xd962('0x48')][_0xd962('0x49')](',');var _0x55448f={};_0x55448f[_0x58a60b[0x0]]={'$gte':moment(_0x58a60b[0x1])['format'](_0xd962('0x4a'))};_0xf3e277[_0xd962('0x45')]=_[_0xd962('0x34')](_0xf3e277[_0xd962('0x45')],_0x55448f);}_0xf3e277=_[_0xd962('0x34')]({},_0xf3e277,_0x4a5202[_0xd962('0x35')]);return db[_0xd962('0x3b')][_0xd962('0x17')]({'where':_0xf3e277[_0xd962('0x45')]})[_0xd962('0x1b')](function(_0x464ea1){_0x21adde[_0xd962('0x17')]=_0x464ea1;if(_0x4a5202[_0xd962('0x2b')]['includeAll']){_0xf3e277[_0xd962('0x33')]=[{'all':!![]}];}return db[_0xd962('0x3b')][_0xd962('0x25')](_0xf3e277);})[_0xd962('0x1b')](function(_0x599e68){_0x21adde['rows']=_0x599e68;return _0x21adde;});}})[_0xd962('0x1b')](respondWithFilteredResult(_0x545ed0,_0xf3e277))['catch'](handleError(_0x545ed0,null));};exports[_0xd962('0x4b')]=function(_0x1942bf,_0x46fdca){return db[_0xd962('0x22')]['find']({'where':{'id':_0x1942bf[_0xd962('0x29')]['id']}})['then'](handleEntityNotFound(_0x46fdca,null))[_0xd962('0x1b')](function(_0x3e3bec){if(_0x3e3bec){return _0x3e3bec[_0xd962('0x4c')](_0x1942bf[_0xd962('0x38')][_0xd962('0x3c')],_[_0xd962('0x3d')](_0x1942bf['body'],[_0xd962('0x3c'),'id'])||{})['spread'](function(){return db[_0xd962('0x4d')][_0xd962('0x25')]({'attributes':['id',_0xd962('0x1f'),_0xd962('0x4e')],'where':{'id':_0x1942bf[_0xd962('0x38')][_0xd962('0x3c')]}});})[_0xd962('0x1b')](function(_0x9ab677){socket[_0xd962('0x4f')]('smsInteractionTags:save',{'id':Number(_0x1942bf[_0xd962('0x29')]['id']),'tags':_0x9ab677||[]});return{'id':Number(_0x1942bf[_0xd962('0x29')]['id']),'tags':_0x9ab677||[]};});}})[_0xd962('0x1b')](respondWithResult(_0x46fdca,null))[_0xd962('0x28')](handleError(_0x46fdca,null));};exports[_0xd962('0x50')]=function(_0x3cb773,_0x144eba){return db[_0xd962('0x22')][_0xd962('0x36')]({'where':{'id':_0x3cb773[_0xd962('0x29')]['id']}})['then'](handleEntityNotFound(_0x144eba,null))[_0xd962('0x1b')](function(_0x50cb7b){if(_0x50cb7b){return _0x50cb7b[_0xd962('0x50')](_0x3cb773['query'][_0xd962('0x3c')]);}})[_0xd962('0x1b')](respondWithStatusCode(_0x144eba,null))['catch'](handleError(_0x144eba,null));};exports['download']=function(_0x3fa35e,_0x376cde){var _0x3b844c=moment()[_0xd962('0x51')]()[_0xd962('0x52')]();var _0x2ea09a=path['join'](config[_0xd962('0x53')],_0xd962('0x54'),_0xd962('0x55'),'tmp');var _0x2141af=path[_0xd962('0x56')](_0x2ea09a,_0x3b844c);var _0x3bf6b9=util[_0xd962('0x57')](_0xd962('0x58'),_0x3fa35e[_0xd962('0x29')]['id'],_0x3b844c);var _0x5ce17d=path['join'](_0x2ea09a,_0x3bf6b9);var _0x44d234=[];_0x44d234[_0xd962('0x59')]({'model':db[_0xd962('0x5a')],'as':_0xd962('0x5a'),'attributes':['id',_0xd962('0x5b')],'raw':!![]});_0x44d234['push']({'model':db[_0xd962('0x5c')],'as':'Contact','attributes':['id',_0xd962('0x5d'),_0xd962('0x5e')],'raw':!![]});var _0x5d0842=[{'model':db[_0xd962('0x3b')],'as':_0xd962('0x5f'),'attributes':['id','body',_0xd962('0x60'),_0xd962('0x61'),'secret','read'],'include':_0x44d234}];_0x5d0842[_0xd962('0x59')]({'model':db[_0xd962('0x62')],'as':_0xd962('0x63'),'attributes':['id','name']});_0x5d0842[_0xd962('0x59')]({'model':db[_0xd962('0x5a')],'as':_0xd962('0x64'),'attributes':['id',_0xd962('0x5b')]});return db[_0xd962('0x22')][_0xd962('0x36')]({'where':{'id':_0x3fa35e[_0xd962('0x29')]['id']},'include':_0x5d0842})[_0xd962('0x1b')](handleEntityNotFound(_0x376cde,null))[_0xd962('0x1b')](function(_0x18278e){if(_0x18278e){var _0x5954ca=_0x18278e[_0xd962('0x65')]({'plain':!![]});fs['mkdirSync'](_0x2141af);var _0x2f2b6c={'channel':_0xd962('0x66'),'account':_0x5954ca['Account'][_0xd962('0x1f')],'agent':_0x5954ca['Owner']?_0x5954ca[_0xd962('0x64')]['fullname']:_0xd962('0x67'),'createdAt':moment(_0x5954ca[_0xd962('0x60')])[_0xd962('0x57')](_0xd962('0x4a'))[_0xd962('0x52')](),'closedAt':_0x5954ca[_0xd962('0x68')]?moment(_0x5954ca[_0xd962('0x69')])[_0xd962('0x57')](_0xd962('0x4a'))['toString']():'','disposition':_0x5954ca['disposition'],'messages':_(_0x5954ca[_0xd962('0x5f')])[_0xd962('0x47')]({'secret':![]})[_0xd962('0x21')](function(_0x261caf){return{'date':moment(_0x261caf[_0xd962('0x60')])[_0xd962('0x57')](_0xd962('0x4a'))[_0xd962('0x52')](),'sender':_0x261caf['direction']===_0xd962('0x6a')?_0x261caf[_0xd962('0x5a')]?_0x261caf[_0xd962('0x5a')][_0xd962('0x5b')]:_0xd962('0x6b'):_0x261caf[_0xd962('0x6c')][_0xd962('0x5d')]+(_0x261caf['Contact'][_0xd962('0x5e')]?'\x20'+_0x261caf['Contact'][_0xd962('0x5e')]:''),'body':_0x261caf['body'],'direction':_0x261caf[_0xd962('0x61')]===_0xd962('0x6a')?'A':'C','secret':_0x261caf[_0xd962('0x6d')],'read':_0x261caf[_0xd962('0x6e')]};})[_0xd962('0x6f')]()};return ejs[_0xd962('0x70')](path[_0xd962('0x56')](config[_0xd962('0x53')],_0xd962('0x54'),_0xd962('0x71'),_0xd962('0x72')),{'interaction':_0x2f2b6c})[_0xd962('0x1b')](function(_0x2c1ca2){var _0x390639=path[_0xd962('0x56')](_0x2141af,_0xd962('0x73')+_0x5954ca['id']+'-'+_0x3b844c+'.pdf');var _0x3232b0={'path':_0x390639,'channel':'Sms','interactionId':_0x5954ca['id']};return pdf['createPdfFromHTML'](_0x2c1ca2,_0x3232b0);})[_0xd962('0x1b')](function(){return new BPromise(function(_0x225814,_0x25b8b5){zipdir(_0x2141af,{'saveTo':_0x5ce17d},function(_0x11d598,_0xa69491){if(_0x11d598)return _0x25b8b5(_0x11d598);return _0x225814(_0xa69491);});})[_0xd962('0x1b')](function(){return new BPromise(function(_0x5cda8d,_0x279fd4){rimraf(_0x2141af,function(_0x28252c){if(_0x28252c)_0x279fd4(_0x28252c);return _0x5cda8d();});});})[_0xd962('0x1b')](function(){return _0x376cde[_0xd962('0x74')](_0x5ce17d,_0x3bf6b9,function(_0x540fe9){if(_0x540fe9){console['log'](_0xd962('0x75'),_0x540fe9);}else{fs['unlinkSync'](_0x5ce17d);}});});});}else{return _0x376cde['sendStatus'](0xc8);}})['catch'](handleError(_0x376cde,null));}; \ No newline at end of file +var _0xc41a=['User','fullname','CmContact','lastName','createdAt','direction','read','SmsAccount','Account','get','Sms','Owner','toString','closed','closedAt','disposition','out','System','Contact','firstName','value','renderFile','views','downloadInteraction.ejs','.pdf','log','err','unlinkSync','zip-dir','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/environment','redis','localhost','./smsInteraction.socket','register','status','end','json','offset','undefined','count','set','update','then','destroy','sendStatus','error','stack','name','send','index','map','SmsInteraction','rawAttributes','type','getOptions','findAll','sms','query','user','catch','params','model','keys','filters','intersection','attributes','fields','length','merge','find','create','body','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','hasOwnProperty','limit','order','sort','where','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','include','rows','addTags','setTags','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','push'];(function(_0x54eab6,_0x5e262f){var _0x1e7435=function(_0x468c91){while(--_0x468c91){_0x54eab6['push'](_0x54eab6['shift']());}};_0x1e7435(++_0x5e262f);}(_0xc41a,0x104));var _0xac41=function(_0x13ffe5,_0x11f9db){_0x13ffe5=_0x13ffe5-0x0;var _0x4ec3fc=_0xc41a[_0x13ffe5];return _0x4ec3fc;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xac41('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xac41('0x1'));var path=require(_0xac41('0x2'));var ejs=require(_0xac41('0x3'));var fs=require('fs');var _=require(_0xac41('0x4'));var Redis=require(_0xac41('0x5'));var interaction=require(_0xac41('0x6'));var qs=require(_0xac41('0x7'));var pdf=require(_0xac41('0x8'));var logger=require('../../config/logger')('api');var config=require(_0xac41('0x9'));var db=require('../../mysqldb')['db'];config[_0xac41('0xa')]=_['defaults'](config[_0xac41('0xa')],{'host':_0xac41('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xac41('0xa')]));require(_0xac41('0xc'))[_0xac41('0xd')](socket);function respondWithStatusCode(_0x5ef664,_0x3507e6){_0x3507e6=_0x3507e6||0xcc;return function(_0x3a916b){if(_0x3a916b){return _0x5ef664['sendStatus'](_0x3507e6);}return _0x5ef664[_0xac41('0xe')](_0x3507e6)[_0xac41('0xf')]();};}function respondWithResult(_0x394960,_0xcec183){_0xcec183=_0xcec183||0xc8;return function(_0x3f5231){if(_0x3f5231){return _0x394960[_0xac41('0xe')](_0xcec183)[_0xac41('0x10')](_0x3f5231);}};}function respondWithFilteredResult(_0x51febf,_0x10d6d3){return function(_0x178e97){if(_0x178e97){var _0x33b376=typeof _0x10d6d3[_0xac41('0x11')]===_0xac41('0x12')&&typeof _0x10d6d3['limit']===_0xac41('0x12');var _0x3f237f=_0x178e97[_0xac41('0x13')];var _0x284c15=_0x33b376?0x0:_0x10d6d3[_0xac41('0x11')];var _0x552444=_0x33b376?_0x178e97['count']:_0x10d6d3[_0xac41('0x11')]+_0x10d6d3['limit'];var _0x436bb9;if(_0x552444>=_0x3f237f){_0x552444=_0x3f237f;_0x436bb9=0xc8;}else{_0x436bb9=0xce;}_0x51febf[_0xac41('0xe')](_0x436bb9);return _0x51febf[_0xac41('0x14')]('Content-Range',_0x284c15+'-'+_0x552444+'/'+_0x3f237f)[_0xac41('0x10')](_0x178e97);}return null;};}function saveUpdates(_0x36c4ad){return function(_0x1452c2){if(_0x1452c2){return _0x1452c2[_0xac41('0x15')](_0x36c4ad)[_0xac41('0x16')](function(_0x2da946){return _0x2da946;});}return null;};}function removeEntity(_0x4a41ce){return function(_0x10cd5c){if(_0x10cd5c){return _0x10cd5c[_0xac41('0x17')]()[_0xac41('0x16')](function(){_0x4a41ce[_0xac41('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x638968){return function(_0x339a87){if(!_0x339a87){_0x638968[_0xac41('0x18')](0x194);}return _0x339a87;};}function handleError(_0x370048,_0x309238){_0x309238=_0x309238||0x1f4;return function(_0x13da57){logger[_0xac41('0x19')](_0x13da57[_0xac41('0x1a')]);if(_0x13da57[_0xac41('0x1b')]){delete _0x13da57[_0xac41('0x1b')];}_0x370048[_0xac41('0xe')](_0x309238)[_0xac41('0x1c')](_0x13da57);};}exports[_0xac41('0x1d')]=function(_0x4e9465,_0x373695){var _0x5214ab={};var _0x1f218a=_[_0xac41('0x1e')](db[_0xac41('0x1f')][_0xac41('0x20')],function(_0x175bef){return{'name':_0x175bef['fieldName'],'type':_0x175bef[_0xac41('0x21')]['key']};});_0x5214ab=qs[_0xac41('0x22')](_0x1f218a,_0x4e9465);return interaction[_0xac41('0x23')](_0xac41('0x24'),_0x4e9465[_0xac41('0x25')],_0x4e9465[_0xac41('0x26')],_0x5214ab,_0x1f218a)['then'](respondWithFilteredResult(_0x373695,_0x5214ab))[_0xac41('0x27')](handleError(_0x373695,null));};exports['show']=function(_0x493073,_0xd4881f){var _0x4436af={'raw':![],'where':{'id':_0x493073[_0xac41('0x28')]['id']}},_0xcea713={};_0xcea713[_0xac41('0x29')]=_['keys'](db['SmsInteraction'][_0xac41('0x20')]);_0xcea713[_0xac41('0x25')]=_[_0xac41('0x2a')](_0x493073[_0xac41('0x25')]);_0xcea713[_0xac41('0x2b')]=_[_0xac41('0x2c')](_0xcea713[_0xac41('0x29')],_0xcea713['query']);_0x4436af[_0xac41('0x2d')]=_[_0xac41('0x2c')](_0xcea713[_0xac41('0x29')],qs['fields'](_0x493073[_0xac41('0x25')][_0xac41('0x2e')]));_0x4436af[_0xac41('0x2d')]=_0x4436af[_0xac41('0x2d')][_0xac41('0x2f')]?_0x4436af[_0xac41('0x2d')]:_0xcea713[_0xac41('0x29')];if(_0x493073['query']['includeAll']){_0x4436af['include']=[{'all':!![]}];}_0x4436af=_[_0xac41('0x30')]({},_0x4436af,_0x493073['options']);return db['SmsInteraction'][_0xac41('0x31')](_0x4436af)[_0xac41('0x16')](handleEntityNotFound(_0xd4881f,null))[_0xac41('0x16')](respondWithResult(_0xd4881f,null))[_0xac41('0x27')](handleError(_0xd4881f,null));};exports['create']=function(_0x51ece2,_0x5ceaa4){return db[_0xac41('0x1f')][_0xac41('0x32')](_0x51ece2[_0xac41('0x33')],{})[_0xac41('0x16')](respondWithResult(_0x5ceaa4,0xc9))[_0xac41('0x27')](handleError(_0x5ceaa4,null));};exports[_0xac41('0x15')]=function(_0x4527ff,_0x689b74){if(_0x4527ff[_0xac41('0x33')]['id']){delete _0x4527ff[_0xac41('0x33')]['id'];}return db[_0xac41('0x1f')][_0xac41('0x31')]({'where':{'id':_0x4527ff['params']['id']}})['then'](handleEntityNotFound(_0x689b74,null))['then'](saveUpdates(_0x4527ff[_0xac41('0x33')],null))['then'](respondWithResult(_0x689b74,null))[_0xac41('0x27')](handleError(_0x689b74,null));};exports[_0xac41('0x17')]=function(_0x5f46aa,_0x2393f6){return db[_0xac41('0x1f')][_0xac41('0x31')]({'where':{'id':_0x5f46aa[_0xac41('0x28')]['id']}})['then'](handleEntityNotFound(_0x2393f6,null))[_0xac41('0x16')](removeEntity(_0x2393f6,null))['catch'](handleError(_0x2393f6,null));};exports[_0xac41('0x34')]=function(_0x38bf19,_0x2cbe9e){return db[_0xac41('0x1f')][_0xac41('0x34')]()[_0xac41('0x16')](respondWithResult(_0x2cbe9e,null))['catch'](handleError(_0x2cbe9e,null));};exports[_0xac41('0x35')]=function(_0x2a567b,_0x469a2b){return db[_0xac41('0x36')][_0xac41('0x31')]({'where':{'id':_0x2a567b[_0xac41('0x28')]['id']}})[_0xac41('0x16')](handleEntityNotFound(_0x469a2b,null))['then'](function(_0x4de587){if(_0x4de587){return _0x4de587[_0xac41('0x35')](_0x2a567b['body'][_0xac41('0x37')],_[_0xac41('0x38')](_0x2a567b[_0xac41('0x33')],[_0xac41('0x37'),'id'])||{});}})[_0xac41('0x16')](respondWithResult(_0x469a2b,null))[_0xac41('0x27')](handleError(_0x469a2b,null));};exports[_0xac41('0x39')]=function(_0x4ddc88,_0x502eac){var _0x132bbd={'raw':![],'where':{}};var _0x2da1cc={};var _0x2fb930={'count':0x0,'rows':[]};return db[_0xac41('0x1f')][_0xac41('0x3a')]({'where':{'id':_0x4ddc88[_0xac41('0x28')]['id']}})['then'](handleEntityNotFound(_0x502eac,null))['then'](function(_0x238bec){if(_0x238bec){_0x2da1cc['model']=_[_0xac41('0x2a')](db[_0xac41('0x36')]['rawAttributes']);_0x2da1cc[_0xac41('0x25')]=_[_0xac41('0x2a')](_0x4ddc88[_0xac41('0x25')]);_0x2da1cc[_0xac41('0x2b')]=_[_0xac41('0x2c')](_0x2da1cc['model'],_0x2da1cc['query']);_0x132bbd[_0xac41('0x2d')]=_[_0xac41('0x2c')](_0x2da1cc[_0xac41('0x29')],qs[_0xac41('0x2e')](_0x4ddc88[_0xac41('0x25')][_0xac41('0x2e')]));_0x132bbd['attributes']=_0x132bbd[_0xac41('0x2d')]['length']?_0x132bbd[_0xac41('0x2d')]:_0x2da1cc[_0xac41('0x29')];if(!_0x4ddc88[_0xac41('0x25')][_0xac41('0x3b')]('nolimit')){_0x132bbd[_0xac41('0x3c')]=qs[_0xac41('0x3c')](_0x4ddc88[_0xac41('0x25')][_0xac41('0x3c')]);_0x132bbd[_0xac41('0x11')]=qs['offset'](_0x4ddc88[_0xac41('0x25')][_0xac41('0x11')]);}_0x132bbd[_0xac41('0x3d')]=qs[_0xac41('0x3e')](_0x4ddc88[_0xac41('0x25')][_0xac41('0x3e')]);_0x132bbd[_0xac41('0x3f')]=qs[_0xac41('0x2b')](_['pick'](_0x4ddc88['query'],_0x2da1cc[_0xac41('0x2b')]));_0x132bbd['where']['SmsInteractionId']=_0x238bec['id'];if(_0x4ddc88[_0xac41('0x25')][_0xac41('0x40')]){_0x132bbd['where']=_[_0xac41('0x30')](_0x132bbd[_0xac41('0x3f')],{'$or':_['map'](_0x132bbd[_0xac41('0x2d')],function(_0x1b8b33){var _0x3fac4b={};_0x3fac4b[_0x1b8b33]={'$like':'%'+_0x4ddc88[_0xac41('0x25')][_0xac41('0x40')]+'%'};return _0x3fac4b;})});}if(_0x4ddc88['query']['$gte']){var _0x1f2999=_0x4ddc88[_0xac41('0x25')][_0xac41('0x41')]['split'](',');var _0x4fd249={};_0x4fd249[_0x1f2999[0x0]]={'$gte':moment(_0x1f2999[0x1])[_0xac41('0x42')](_0xac41('0x43'))};_0x132bbd[_0xac41('0x3f')]=_[_0xac41('0x30')](_0x132bbd[_0xac41('0x3f')],_0x4fd249);}_0x132bbd=_[_0xac41('0x30')]({},_0x132bbd,_0x4ddc88[_0xac41('0x44')]);return db['SmsMessage'][_0xac41('0x13')]({'where':_0x132bbd[_0xac41('0x3f')]})[_0xac41('0x16')](function(_0x1cc964){_0x2fb930['count']=_0x1cc964;if(_0x4ddc88[_0xac41('0x25')][_0xac41('0x45')]){_0x132bbd[_0xac41('0x46')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x132bbd);})[_0xac41('0x16')](function(_0x2b96e8){_0x2fb930[_0xac41('0x47')]=_0x2b96e8;return _0x2fb930;});}})[_0xac41('0x16')](respondWithFilteredResult(_0x502eac,_0x132bbd))[_0xac41('0x27')](handleError(_0x502eac,null));};exports[_0xac41('0x48')]=function(_0x217274,_0x500639){return db[_0xac41('0x1f')]['find']({'where':{'id':_0x217274[_0xac41('0x28')]['id']}})[_0xac41('0x16')](handleEntityNotFound(_0x500639,null))[_0xac41('0x16')](function(_0x4db326){if(_0x4db326){return _0x4db326[_0xac41('0x49')](_0x217274[_0xac41('0x33')][_0xac41('0x37')],_[_0xac41('0x38')](_0x217274[_0xac41('0x33')],[_0xac41('0x37'),'id'])||{})[_0xac41('0x4a')](function(){return db[_0xac41('0x4b')][_0xac41('0x23')]({'attributes':['id',_0xac41('0x1b'),_0xac41('0x4c')],'where':{'id':_0x217274[_0xac41('0x33')][_0xac41('0x37')]}});})[_0xac41('0x16')](function(_0x1599f0){socket[_0xac41('0x4d')](_0xac41('0x4e'),{'id':Number(_0x217274[_0xac41('0x28')]['id']),'tags':_0x1599f0||[]});return{'id':Number(_0x217274[_0xac41('0x28')]['id']),'tags':_0x1599f0||[]};});}})['then'](respondWithResult(_0x500639,null))[_0xac41('0x27')](handleError(_0x500639,null));};exports[_0xac41('0x4f')]=function(_0x411f0a,_0x27d93b){return db[_0xac41('0x1f')][_0xac41('0x31')]({'where':{'id':_0x411f0a[_0xac41('0x28')]['id']}})[_0xac41('0x16')](handleEntityNotFound(_0x27d93b,null))[_0xac41('0x16')](function(_0x22ab3e){if(_0x22ab3e){return _0x22ab3e['removeTags'](_0x411f0a[_0xac41('0x25')][_0xac41('0x37')]);}})['then'](respondWithStatusCode(_0x27d93b,null))[_0xac41('0x27')](handleError(_0x27d93b,null));};exports[_0xac41('0x50')]=function(_0x1b71f4,_0x534dee){var _0x5c1b0b=moment()[_0xac41('0x51')]()['toString']();var _0x216a9d=path['join'](config[_0xac41('0x52')],_0xac41('0x53'),_0xac41('0x54'),_0xac41('0x55'));var _0x235ebf=path[_0xac41('0x56')](_0x216a9d,_0x5c1b0b);var _0xd46f79=util[_0xac41('0x42')]('transcript-%d-%s.zip',_0x1b71f4[_0xac41('0x28')]['id'],_0x5c1b0b);var _0x44455a=path[_0xac41('0x56')](_0x216a9d,_0xd46f79);var _0x4ffef2=[];_0x4ffef2[_0xac41('0x57')]({'model':db[_0xac41('0x58')],'as':'User','attributes':['id',_0xac41('0x59')],'raw':!![]});_0x4ffef2[_0xac41('0x57')]({'model':db[_0xac41('0x5a')],'as':'Contact','attributes':['id','firstName',_0xac41('0x5b')],'raw':!![]});var _0x3bd08b=[{'model':db[_0xac41('0x36')],'as':'Messages','attributes':['id',_0xac41('0x33'),_0xac41('0x5c'),_0xac41('0x5d'),'secret',_0xac41('0x5e')],'include':_0x4ffef2}];_0x3bd08b[_0xac41('0x57')]({'model':db[_0xac41('0x5f')],'as':_0xac41('0x60'),'attributes':['id','name']});_0x3bd08b[_0xac41('0x57')]({'model':db[_0xac41('0x58')],'as':'Owner','attributes':['id',_0xac41('0x59')]});return db['SmsInteraction'][_0xac41('0x31')]({'where':{'id':_0x1b71f4['params']['id']},'include':_0x3bd08b})[_0xac41('0x16')](handleEntityNotFound(_0x534dee,null))['then'](function(_0x31cb17){if(_0x31cb17){var _0x143726=_0x31cb17[_0xac41('0x61')]({'plain':!![]});fs['mkdirSync'](_0x235ebf);var _0x55fb74={'channel':_0xac41('0x62'),'account':_0x143726[_0xac41('0x60')]['name'],'agent':_0x143726[_0xac41('0x63')]?_0x143726[_0xac41('0x63')][_0xac41('0x59')]:'N.A.','createdAt':moment(_0x143726['createdAt'])[_0xac41('0x42')]('YYYY-MM-DD\x20HH:mm:ss')[_0xac41('0x64')](),'closedAt':_0x143726[_0xac41('0x65')]?moment(_0x143726[_0xac41('0x66')])['format'](_0xac41('0x43'))[_0xac41('0x64')]():'','disposition':_0x143726[_0xac41('0x67')],'messages':_(_0x143726['Messages'])[_0xac41('0x40')]({'secret':![]})[_0xac41('0x1e')](function(_0x145f47){return{'date':moment(_0x145f47[_0xac41('0x5c')])[_0xac41('0x42')](_0xac41('0x43'))['toString'](),'sender':_0x145f47[_0xac41('0x5d')]===_0xac41('0x68')?_0x145f47[_0xac41('0x58')]?_0x145f47[_0xac41('0x58')][_0xac41('0x59')]:_0xac41('0x69'):_0x145f47[_0xac41('0x6a')][_0xac41('0x6b')]+(_0x145f47[_0xac41('0x6a')][_0xac41('0x5b')]?'\x20'+_0x145f47[_0xac41('0x6a')][_0xac41('0x5b')]:''),'body':_0x145f47[_0xac41('0x33')],'direction':_0x145f47['direction']===_0xac41('0x68')?'A':'C','secret':_0x145f47['secret'],'read':_0x145f47[_0xac41('0x5e')]};})[_0xac41('0x6c')]()};return ejs[_0xac41('0x6d')](path[_0xac41('0x56')](config[_0xac41('0x52')],_0xac41('0x53'),_0xac41('0x6e'),_0xac41('0x6f')),{'interaction':_0x55fb74})[_0xac41('0x16')](function(_0x26beb4){var _0x3d61aa=path[_0xac41('0x56')](_0x235ebf,'transcript-'+_0x143726['id']+'-'+_0x5c1b0b+_0xac41('0x70'));var _0x2bec90={'path':_0x3d61aa,'channel':_0xac41('0x62'),'interactionId':_0x143726['id']};return pdf['createPdfFromHTML'](_0x26beb4,_0x2bec90);})[_0xac41('0x16')](function(){return new BPromise(function(_0x15e279,_0xbfe906){zipdir(_0x235ebf,{'saveTo':_0x44455a},function(_0x26112f,_0x1f5597){if(_0x26112f)return _0xbfe906(_0x26112f);return _0x15e279(_0x1f5597);});})[_0xac41('0x16')](function(){return new BPromise(function(_0x2fece9,_0xc89a4b){rimraf(_0x235ebf,function(_0x33dc72){if(_0x33dc72)_0xc89a4b(_0x33dc72);return _0x2fece9();});});})[_0xac41('0x16')](function(){return _0x534dee[_0xac41('0x50')](_0x44455a,_0xd46f79,function(_0x10dc76){if(_0x10dc76){console[_0xac41('0x71')](_0xac41('0x72'),_0x10dc76);}else{fs[_0xac41('0x73')](_0x44455a);}});});});}else{return _0x534dee[_0xac41('0x18')](0xc8);}})[_0xac41('0x27')](handleError(_0x534dee,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 8da32d9..7f34fa6 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 _0xa30a=['update','remove','then','setDataValue','map','findAll','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save'];(function(_0x2c9ae4,_0x2e11de){var _0x13082f=function(_0x3fdaf4){while(--_0x3fdaf4){_0x2c9ae4['push'](_0x2c9ae4['shift']());}};_0x13082f(++_0x2e11de);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0xaa30('0x0'));var SmsInteraction=require(_0xaa30('0x1'))['db'][_0xaa30('0x2')];var SmsMessage=require('../../mysqldb')['db'][_0xaa30('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xaa30('0x4')](0x0);var events={'afterCreate':_0xaa30('0x5'),'afterUpdate':_0xaa30('0x6'),'afterDestroy':_0xaa30('0x7')};function emitEvent(_0x271425){return function(_0x102ad7,_0x555947,_0x347cd5){_0x102ad7['getUsers']({'attributes':['id'],'raw':!![]})[_0xaa30('0x8')](function(_0x14fe09){_0x102ad7[_0xaa30('0x9')]('Users',_0x14fe09[_0xaa30('0xa')](function(_0x40dbda){return{'id':_0x40dbda['id']};}));return SmsMessage[_0xaa30('0xb')]({'where':{'SmsInteractionId':_0x102ad7['id'],'direction':'in','read':![]},'raw':!![]});})[_0xaa30('0x8')](function(_0x14a6a6){_0x102ad7[_0xaa30('0x9')]('unreadMessages',_0x14a6a6['length']);SmsInteractionEvents[_0xaa30('0xc')](_0x271425+':'+_0x102ad7['id'],_0x102ad7);SmsInteractionEvents['emit'](_0x271425,_0x102ad7);_0x347cd5(null);})[_0xaa30('0xd')](_0x347cd5(null));};}for(var e in events){if(events[_0xaa30('0xe')](e)){var event=events[e];SmsInteraction[_0xaa30('0xf')](e,emitEvent(event));}}module[_0xaa30('0x10')]=SmsInteractionEvents; \ No newline at end of file +var _0x430c=['setMaxListeners','getUsers','setDataValue','Users','map','findAll','then','length','emit','catch','hook','events','../../mysqldb','SmsMessage'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x430c,0x1a1));var _0xc430=function(_0x1fdb40,_0x51351c){_0x1fdb40=_0x1fdb40-0x0;var _0x281f93=_0x430c[_0x1fdb40];return _0x281f93;};'use strict';var EventEmitter=require(_0xc430('0x0'));var SmsInteraction=require('../../mysqldb')['db']['SmsInteraction'];var SmsMessage=require(_0xc430('0x1'))['db'][_0xc430('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xc430('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x47d8b9){return function(_0x338a82,_0x2408f5,_0x50b256){_0x338a82[_0xc430('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x212354){_0x338a82[_0xc430('0x5')](_0xc430('0x6'),_0x212354[_0xc430('0x7')](function(_0x2e23f8){return{'id':_0x2e23f8['id']};}));return SmsMessage[_0xc430('0x8')]({'where':{'SmsInteractionId':_0x338a82['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc430('0x9')](function(_0x115814){_0x338a82[_0xc430('0x5')]('unreadMessages',_0x115814[_0xc430('0xa')]);SmsInteractionEvents[_0xc430('0xb')](_0x47d8b9+':'+_0x338a82['id'],_0x338a82);SmsInteractionEvents['emit'](_0x47d8b9,_0x338a82);_0x50b256(null);})[_0xc430('0xc')](_0x50b256(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0xc430('0xd')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 6fdae4d..3acbfb4 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 _0x150a=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','sms_interactions','closed','closedAt'];(function(_0x54ea7a,_0x19df9b){var _0x65a10d=function(_0x1bf936){while(--_0x1bf936){_0x54ea7a['push'](_0x54ea7a['shift']());}};_0x65a10d(++_0x19df9b);}(_0x150a,0x171));var _0xa150=function(_0x597ad5,_0x17e1ff){_0x597ad5=_0x597ad5-0x0;var _0x25b2b4=_0x150a[_0x597ad5];return _0x25b2b4;};'use strict';var _=require(_0xa150('0x0'));var util=require(_0xa150('0x1'));var logger=require(_0xa150('0x2'))(_0xa150('0x3'));var moment=require('moment');var BPromise=require(_0xa150('0x4'));var rp=require(_0xa150('0x5'));var fs=require('fs');var path=require(_0xa150('0x6'));var rimraf=require(_0xa150('0x7'));var config=require(_0xa150('0x8'));var attributes=require(_0xa150('0x9'));module[_0xa150('0xa')]=function(_0x41cb62,_0x3bec62){return _0x41cb62[_0xa150('0xb')]('SmsInteraction',attributes,{'tableName':_0xa150('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3d3b82,_0xa3cf0f,_0x56173a){if(_0x3d3b82['changed'](_0xa150('0xd'))){_0x3d3b82[_0xa150('0xe')]=moment()['format'](_0xa150('0xf'));}_0x56173a(null,_0x3d3b82);}}});}; \ No newline at end of file +var _0x5b67=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsInteraction.attributes','exports','SmsInteraction','sms_interactions'];(function(_0x4d9ac1,_0x38af72){var _0x212b93=function(_0x193eb8){while(--_0x193eb8){_0x4d9ac1['push'](_0x4d9ac1['shift']());}};_0x212b93(++_0x38af72);}(_0x5b67,0xe4));var _0x75b6=function(_0x38d405,_0x285127){_0x38d405=_0x38d405-0x0;var _0xb357f7=_0x5b67[_0x38d405];return _0xb357f7;};'use strict';var _=require('lodash');var util=require(_0x75b6('0x0'));var logger=require(_0x75b6('0x1'))(_0x75b6('0x2'));var moment=require(_0x75b6('0x3'));var BPromise=require(_0x75b6('0x4'));var rp=require(_0x75b6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75b6('0x6'));var config=require(_0x75b6('0x7'));var attributes=require(_0x75b6('0x8'));module[_0x75b6('0x9')]=function(_0x28f4ee,_0x4f7c4d){return _0x28f4ee['define'](_0x75b6('0xa'),attributes,{'tableName':_0x75b6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3f3c40,_0x4cc984,_0x7a5485){if(_0x3f3c40['changed']('closed')){_0x3f3c40[_0x75b6('0xc')]=moment()[_0x75b6('0xd')](_0x75b6('0xe'));}_0x7a5485(null,_0x3f3c40);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 1161d09..d233479 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 _0x7e60=['../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','UpdateSmsInteraction','update','body','options','raw','limit','stringify','AddTagsToSmsInteraction','SmsInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x117d8f,_0x4445d9){var _0x38a1e=function(_0x3b321e){while(--_0x3b321e){_0x117d8f['push'](_0x117d8f['shift']());}};_0x38a1e(++_0x4445d9);}(_0x7e60,0xa0));var _0x07e6=function(_0x4c975c,_0x3f71b6){_0x4c975c=_0x4c975c-0x0;var _0xf90e1f=_0x7e60[_0x4c975c];return _0xf90e1f;};'use strict';var _=require(_0x07e6('0x0'));var util=require(_0x07e6('0x1'));var moment=require('moment');var BPromise=require(_0x07e6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x07e6('0x3'));var db=require(_0x07e6('0x4'))['db'];var utils=require(_0x07e6('0x5'));var logger=require(_0x07e6('0x6'))(_0x07e6('0x7'));var config=require(_0x07e6('0x8'));var jayson=require(_0x07e6('0x9'));var client=jayson[_0x07e6('0xa')][_0x07e6('0xb')]({'port':0x232a});config[_0x07e6('0xc')]=_['defaults'](config[_0x07e6('0xc')],{'host':_0x07e6('0xd'),'port':0x18eb});var socket=require(_0x07e6('0xe'))(new Redis(config[_0x07e6('0xc')]));require(_0x07e6('0xf'))[_0x07e6('0x10')](socket);function respondWithRpcPromise(_0x4d4870,_0x3dbaf4,_0x45ebde){return new BPromise(function(_0x9a308b,_0x33331a){return client['request'](_0x4d4870,_0x45ebde)[_0x07e6('0x11')](function(_0x17a3ba){logger[_0x07e6('0x12')](_0x07e6('0x13'),_0x3dbaf4,_0x07e6('0x14'));logger[_0x07e6('0x15')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x3dbaf4,_0x07e6('0x14'),JSON['stringify'](_0x17a3ba));if(_0x17a3ba[_0x07e6('0x16')]){if(_0x17a3ba[_0x07e6('0x16')][_0x07e6('0x17')]===0x1f4){logger[_0x07e6('0x16')](_0x07e6('0x13'),_0x3dbaf4,_0x17a3ba['error'][_0x07e6('0x18')]);return _0x33331a(_0x17a3ba['error'][_0x07e6('0x18')]);}logger[_0x07e6('0x16')](_0x07e6('0x13'),_0x3dbaf4,_0x17a3ba[_0x07e6('0x16')]['message']);return _0x9a308b(_0x17a3ba['error'][_0x07e6('0x18')]);}else{logger[_0x07e6('0x12')](_0x07e6('0x13'),_0x3dbaf4,_0x07e6('0x14'));_0x9a308b(_0x17a3ba['result'][_0x07e6('0x18')]);}})[_0x07e6('0x19')](function(_0x715c8e){logger[_0x07e6('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x3dbaf4,_0x715c8e);_0x33331a(_0x715c8e);});});}exports[_0x07e6('0x1a')]=function(_0x228ffa){var _0x4448d8=this;return new Promise(function(_0x3304a6,_0x3a875e){return db['SmsInteraction'][_0x07e6('0x1b')](_0x228ffa[_0x07e6('0x1c')],{'raw':_0x228ffa['options']?_0x228ffa[_0x07e6('0x1d')][_0x07e6('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x228ffa[_0x07e6('0x1d')]?_0x228ffa['options']['where']||null:null,'attributes':_0x228ffa[_0x07e6('0x1d')]?_0x228ffa['options']['attributes']||null:null,'limit':_0x228ffa[_0x07e6('0x1d')]?_0x228ffa[_0x07e6('0x1d')][_0x07e6('0x1f')]||null:null})['then'](function(_0x1580ce){logger[_0x07e6('0x12')]('UpdateSmsInteraction',_0x228ffa);logger[_0x07e6('0x15')](_0x07e6('0x1a'),_0x228ffa,JSON[_0x07e6('0x20')](_0x1580ce));_0x3304a6(_0x1580ce);})['catch'](function(_0x4230b9){logger[_0x07e6('0x16')](_0x07e6('0x1a'),_0x4230b9[_0x07e6('0x18')],_0x228ffa);_0x3a875e(_0x4448d8[_0x07e6('0x16')](0x1f4,_0x4230b9[_0x07e6('0x18')]));});});};exports[_0x07e6('0x21')]=function(_0x28088d){return new Promise(function(_0x3f25c6,_0x52bd2a){return db[_0x07e6('0x22')][_0x07e6('0x23')]({'where':_0x28088d[_0x07e6('0x1d')]?_0x28088d['options'][_0x07e6('0x24')]||null:null})[_0x07e6('0x11')](function(_0x15d1f9){if(_0x15d1f9){return _0x15d1f9[_0x07e6('0x25')](_0x28088d[_0x07e6('0x1c')][_0x07e6('0x26')],_[_0x07e6('0x27')](_0x28088d[_0x07e6('0x1c')],[_0x07e6('0x26'),'id'])||{});}})[_0x07e6('0x28')](function(_0x142b19){logger['info']('AddTags',_0x28088d);logger[_0x07e6('0x15')](_0x07e6('0x29'),_0x28088d,JSON['stringify'](_0x142b19));_0x3f25c6(_0x142b19);})[_0x07e6('0x19')](function(_0x4069ea){logger[_0x07e6('0x16')](_0x07e6('0x29'),_0x4069ea[_0x07e6('0x18')],_0x28088d);_0x52bd2a(_this[_0x07e6('0x16')](0x1f4,_0x4069ea[_0x07e6('0x18')]));});});}; \ No newline at end of file +var _0xc2b4=['options','raw','where','attributes','limit','AddTagsToSmsInteraction','find','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateSmsInteraction','update','body'];(function(_0x522e32,_0x440e6d){var _0x216842=function(_0x467028){while(--_0x467028){_0x522e32['push'](_0x522e32['shift']());}};_0x216842(++_0x440e6d);}(_0xc2b4,0xec));var _0x4c2b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc2b4[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x4c2b('0x0'));var util=require(_0x4c2b('0x1'));var moment=require(_0x4c2b('0x2'));var BPromise=require(_0x4c2b('0x3'));var rs=require(_0x4c2b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c2b('0x5'))['db'];var utils=require(_0x4c2b('0x6'));var logger=require(_0x4c2b('0x7'))('rpc');var config=require(_0x4c2b('0x8'));var jayson=require(_0x4c2b('0x9'));var client=jayson[_0x4c2b('0xa')][_0x4c2b('0xb')]({'port':0x232a});config[_0x4c2b('0xc')]=_[_0x4c2b('0xd')](config[_0x4c2b('0xc')],{'host':_0x4c2b('0xe'),'port':0x18eb});var socket=require(_0x4c2b('0xf'))(new Redis(config[_0x4c2b('0xc')]));require(_0x4c2b('0x10'))[_0x4c2b('0x11')](socket);function respondWithRpcPromise(_0x472fa9,_0x1d0dcc,_0x3ed1d9){return new BPromise(function(_0x2a8772,_0x301dab){return client[_0x4c2b('0x12')](_0x472fa9,_0x3ed1d9)[_0x4c2b('0x13')](function(_0x13edb7){logger['info']('SmsInteraction,\x20%s,\x20%s',_0x1d0dcc,_0x4c2b('0x14'));logger[_0x4c2b('0x15')](_0x4c2b('0x16'),_0x1d0dcc,_0x4c2b('0x14'),JSON[_0x4c2b('0x17')](_0x13edb7));if(_0x13edb7[_0x4c2b('0x18')]){if(_0x13edb7[_0x4c2b('0x18')][_0x4c2b('0x19')]===0x1f4){logger[_0x4c2b('0x18')](_0x4c2b('0x1a'),_0x1d0dcc,_0x13edb7[_0x4c2b('0x18')]['message']);return _0x301dab(_0x13edb7[_0x4c2b('0x18')]['message']);}logger['error'](_0x4c2b('0x1a'),_0x1d0dcc,_0x13edb7[_0x4c2b('0x18')][_0x4c2b('0x1b')]);return _0x2a8772(_0x13edb7[_0x4c2b('0x18')][_0x4c2b('0x1b')]);}else{logger[_0x4c2b('0x1c')](_0x4c2b('0x1a'),_0x1d0dcc,'request\x20sent');_0x2a8772(_0x13edb7[_0x4c2b('0x1d')][_0x4c2b('0x1b')]);}})[_0x4c2b('0x1e')](function(_0x5bb626){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x1d0dcc,_0x5bb626);_0x301dab(_0x5bb626);});});}exports[_0x4c2b('0x1f')]=function(_0x347cb4){var _0x407bf8=this;return new Promise(function(_0x5fa935,_0x56b648){return db['SmsInteraction'][_0x4c2b('0x20')](_0x347cb4[_0x4c2b('0x21')],{'raw':_0x347cb4[_0x4c2b('0x22')]?_0x347cb4[_0x4c2b('0x22')][_0x4c2b('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x347cb4[_0x4c2b('0x22')]?_0x347cb4[_0x4c2b('0x22')][_0x4c2b('0x24')]||null:null,'attributes':_0x347cb4[_0x4c2b('0x22')]?_0x347cb4[_0x4c2b('0x22')][_0x4c2b('0x25')]||null:null,'limit':_0x347cb4['options']?_0x347cb4[_0x4c2b('0x22')][_0x4c2b('0x26')]||null:null})[_0x4c2b('0x13')](function(_0x281978){logger[_0x4c2b('0x1c')](_0x4c2b('0x1f'),_0x347cb4);logger['debug'](_0x4c2b('0x1f'),_0x347cb4,JSON[_0x4c2b('0x17')](_0x281978));_0x5fa935(_0x281978);})[_0x4c2b('0x1e')](function(_0x3a100f){logger[_0x4c2b('0x18')](_0x4c2b('0x1f'),_0x3a100f[_0x4c2b('0x1b')],_0x347cb4);_0x56b648(_0x407bf8[_0x4c2b('0x18')](0x1f4,_0x3a100f[_0x4c2b('0x1b')]));});});};exports[_0x4c2b('0x27')]=function(_0x46f1b2){return new Promise(function(_0x53f301,_0x56dc07){return db['SmsInteraction'][_0x4c2b('0x28')]({'where':_0x46f1b2[_0x4c2b('0x22')]?_0x46f1b2[_0x4c2b('0x22')]['where']||null:null})[_0x4c2b('0x13')](function(_0x2d4bcd){if(_0x2d4bcd){return _0x2d4bcd['addTags'](_0x46f1b2['body']['ids'],_[_0x4c2b('0x29')](_0x46f1b2[_0x4c2b('0x21')],[_0x4c2b('0x2a'),'id'])||{});}})[_0x4c2b('0x2b')](function(_0x5432cd){logger[_0x4c2b('0x1c')](_0x4c2b('0x2c'),_0x46f1b2);logger[_0x4c2b('0x15')](_0x4c2b('0x2c'),_0x46f1b2,JSON[_0x4c2b('0x17')](_0x5432cd));_0x53f301(_0x5432cd);})[_0x4c2b('0x1e')](function(_0x252c12){logger[_0x4c2b('0x18')]('AddTags',_0x252c12[_0x4c2b('0x1b')],_0x46f1b2);_0x56dc07(_this[_0x4c2b('0x18')](0x1f4,_0x252c12[_0x4c2b('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 0cb3cb9..0d929d8 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 _0x6690=['remove','update','removeListener','smsInteraction:'];(function(_0x231a47,_0x46a963){var _0x48d7c9=function(_0x1e69b1){while(--_0x1e69b1){_0x231a47['push'](_0x231a47['shift']());}};_0x48d7c9(++_0x46a963);}(_0x6690,0x1d4));var _0x0669=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x6690[_0x1cfa0d];return _0xe33279;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=['save',_0x0669('0x0'),_0x0669('0x1')];function createListener(_0x4e7cbe,_0x6d4a99){return function(_0x502e7c){_0x6d4a99['emit'](_0x4e7cbe,_0x502e7c);};}function removeListener(_0x2b1e99,_0x50fd74){return function(){SmsInteractionEvents[_0x0669('0x2')](_0x2b1e99,_0x50fd74);};}exports['register']=function(_0x55ab1f){for(var _0xa6a6f2=0x0,_0x4b330f=events['length'];_0xa6a6f2<_0x4b330f;_0xa6a6f2++){var _0x3e8258=events[_0xa6a6f2];var _0x56674d=createListener(_0x0669('0x3')+_0x3e8258,_0x55ab1f);SmsInteractionEvents['on'](_0x3e8258,_0x56674d);}}; \ No newline at end of file +var _0xe1f5=['remove','update','emit','removeListener','register','save'];(function(_0x2bf5fa,_0x58ec00){var _0x33b534=function(_0x5a4c86){while(--_0x5a4c86){_0x2bf5fa['push'](_0x2bf5fa['shift']());}};_0x33b534(++_0x58ec00);}(_0xe1f5,0x185));var _0x5e1f=function(_0x463c84,_0x28077c){_0x463c84=_0x463c84-0x0;var _0x3009ab=_0xe1f5[_0x463c84];return _0x3009ab;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x5e1f('0x0'),_0x5e1f('0x1'),_0x5e1f('0x2')];function createListener(_0x3067e7,_0x1629b5){return function(_0x62d09c){_0x1629b5[_0x5e1f('0x3')](_0x3067e7,_0x62d09c);};}function removeListener(_0x104de5,_0x3e84af){return function(){SmsInteractionEvents[_0x5e1f('0x4')](_0x104de5,_0x3e84af);};}exports[_0x5e1f('0x5')]=function(_0x4c7af6){for(var _0x33f639=0x0,_0x3649db=events['length'];_0x33f639<_0x3649db;_0x33f639++){var _0x57686e=events[_0x33f639];var _0x430f36=createListener('smsInteraction:'+_0x57686e,_0x4c7af6);SmsInteractionEvents['on'](_0x57686e,_0x430f36);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 213f78b..4d0dcc1 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 _0xb5f0=['../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','tracked','smsmessage:create','create','post','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5447aa,_0x3afc00){var _0xb21e53=function(_0x2d05f6){while(--_0x2d05f6){_0x5447aa['push'](_0x5447aa['shift']());}};_0xb21e53(++_0x3afc00);}(_0xb5f0,0x1da));var _0x0b5f=function(_0x20bb9f,_0x236103){_0x20bb9f=_0x20bb9f-0x0;var _0x4d450f=_0xb5f0[_0x20bb9f];return _0x4d450f;};'use strict';var multer=require(_0x0b5f('0x0'));var util=require('util');var path=require(_0x0b5f('0x1'));var timeout=require(_0x0b5f('0x2'));var express=require(_0x0b5f('0x3'));var router=express['Router']();var fs_extra=require(_0x0b5f('0x4'));var auth=require(_0x0b5f('0x5'));var interaction=require(_0x0b5f('0x6'));var config=require(_0x0b5f('0x7'));var controller=require(_0x0b5f('0x8'));router[_0x0b5f('0x9')]('/',auth[_0x0b5f('0xa')](),controller['index']);router[_0x0b5f('0x9')](_0x0b5f('0xb'),auth[_0x0b5f('0xa')](),controller[_0x0b5f('0xc')]);router[_0x0b5f('0x9')](_0x0b5f('0xd'),auth['isAuthenticated'](),controller[_0x0b5f('0xe')]);router['post']('/',auth[_0x0b5f('0xa')](),interaction[_0x0b5f('0xf')]('sms',_0x0b5f('0x10')),controller[_0x0b5f('0x11')]);router[_0x0b5f('0x12')](_0x0b5f('0x13'),controller[_0x0b5f('0x14')]);router[_0x0b5f('0x15')](_0x0b5f('0xd'),auth[_0x0b5f('0xa')](),controller[_0x0b5f('0x16')]);router[_0x0b5f('0x15')](_0x0b5f('0x17'),auth[_0x0b5f('0xa')](),controller[_0x0b5f('0x18')]);router[_0x0b5f('0x15')](_0x0b5f('0x19'),auth[_0x0b5f('0xa')](),controller[_0x0b5f('0x1a')]);router[_0x0b5f('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0x0b5f('0x1c')]);module[_0x0b5f('0x1d')]=router; \ No newline at end of file +var _0xe884=['post','smsmessage:create','create','status','put','update','/:id/reject','reject','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x1ae6ec,_0x12bced){var _0xd84edc=function(_0x3f00fe){while(--_0x3f00fe){_0x1ae6ec['push'](_0x1ae6ec['shift']());}};_0xd84edc(++_0x12bced);}(_0xe884,0x1d3));var _0x4e88=function(_0x49c796,_0x3b14b2){_0x49c796=_0x49c796-0x0;var _0x267ec2=_0xe884[_0x49c796];return _0x267ec2;};'use strict';var multer=require(_0x4e88('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4e88('0x1'));var express=require(_0x4e88('0x2'));var router=express[_0x4e88('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4e88('0x4'));var interaction=require(_0x4e88('0x5'));var config=require(_0x4e88('0x6'));var controller=require(_0x4e88('0x7'));router[_0x4e88('0x8')]('/',auth[_0x4e88('0x9')](),controller[_0x4e88('0xa')]);router['get'](_0x4e88('0xb'),auth[_0x4e88('0x9')](),controller['describe']);router[_0x4e88('0x8')](_0x4e88('0xc'),auth[_0x4e88('0x9')](),controller['show']);router[_0x4e88('0xd')]('/',auth['isAuthenticated'](),interaction['tracked']('sms',_0x4e88('0xe')),controller[_0x4e88('0xf')]);router['post']('/:id/status',controller[_0x4e88('0x10')]);router[_0x4e88('0x11')](_0x4e88('0xc'),auth[_0x4e88('0x9')](),controller[_0x4e88('0x12')]);router[_0x4e88('0x11')]('/:id/accept',auth[_0x4e88('0x9')](),controller['accept']);router[_0x4e88('0x11')](_0x4e88('0x13'),auth[_0x4e88('0x9')](),controller[_0x4e88('0x14')]);router[_0x4e88('0x15')](_0x4e88('0xc'),auth[_0x4e88('0x9')](),controller[_0x4e88('0x16')]);module[_0x4e88('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 add8202..970340d 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 _0x18a3=['out','STRING','DATE','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x2478da,_0x224f3f){var _0x39f027=function(_0x535a3f){while(--_0x535a3f){_0x2478da['push'](_0x2478da['shift']());}};_0x39f027(++_0x224f3f);}(_0x18a3,0xb3));var _0x318a=function(_0x1b8d88,_0x22c3d3){_0x1b8d88=_0x1b8d88-0x0;var _0x2a5676=_0x18a3[_0x1b8d88];return _0x2a5676;};'use strict';var Sequelize=require(_0x318a('0x0'));module[_0x318a('0x1')]={'body':{'type':Sequelize[_0x318a('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x318a('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x318a('0x4')]('in',_0x318a('0x5')),'defaultValue':_0x318a('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x318a('0x6')]},'readAt':{'type':Sequelize[_0x318a('0x7')]},'secret':{'type':Sequelize[_0x318a('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x318a('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x7e69=['sequelize','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7e69,0x1b8));var _0x97e6=function(_0x2c8374,_0x5814ab){_0x2c8374=_0x2c8374-0x0;var _0x6c87d9=_0x7e69[_0x2c8374];return _0x6c87d9;};'use strict';var Sequelize=require(_0x97e6('0x0'));module['exports']={'body':{'type':Sequelize[_0x97e6('0x1')](_0x97e6('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x97e6('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x97e6('0x4')]('in',_0x97e6('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x97e6('0x6')](0xbe)},'phone':{'type':Sequelize[_0x97e6('0x6')]},'readAt':{'type':Sequelize[_0x97e6('0x7')]},'secret':{'type':Sequelize[_0x97e6('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x97e6('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 717ae34..f67cf9d 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 _0xd943=['include','findAll','rows','params','rawAttributes','find','create','body','describe','sms-interactions','accept','sms','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','SmsInteraction','read1stAt','interaction','null','AcceptMessage','acceptMessage','ContactId','sequelize','SELECT','User','agent','fullname','email','internal','manual','interface','format','SIP/%s','channel','EventManager','acceptmessage','reject','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','Sequelize','event','SmsAccountId','debug','received\x20delivery\x20report\x20from','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','messageId','indexOf','sent','delivered','inspect','results','groupName','DELIVERED','infobip','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','http','client','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','undefined','count','offset','limit','set','apply','save','update','destroy','sendStatus','stack','name','send','index','map','SmsMessage','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','sort','where','filters','pick','merge','VIRTUAL','options','includeAll'];(function(_0x295e3e,_0x30b417){var _0x4c8a9c=function(_0x2f4ef1){while(--_0x2f4ef1){_0x295e3e['push'](_0x295e3e['shift']());}};_0x4c8a9c(++_0x30b417);}(_0xd943,0x15d));var _0x3d94=function(_0x32ff1a,_0x1a8258){_0x32ff1a=_0x32ff1a-0x0;var _0x12bdd7=_0xd943[_0x32ff1a];return _0x12bdd7;};'use strict';var emlformat=require(_0x3d94('0x0'));var rimraf=require(_0x3d94('0x1'));var zipdir=require(_0x3d94('0x2'));var jsonpatch=require(_0x3d94('0x3'));var rp=require('request-promise');var moment=require(_0x3d94('0x4'));var BPromise=require(_0x3d94('0x5'));var Mustache=require(_0x3d94('0x6'));var util=require(_0x3d94('0x7'));var path=require(_0x3d94('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3d94('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d94('0xa'));var jsforce=require(_0x3d94('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3d94('0xc'));var Papa=require(_0x3d94('0xd'));var Redis=require(_0x3d94('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3d94('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d94('0x10'));var logger=require(_0x3d94('0x11'))('api');var utils=require(_0x3d94('0x12'));var config=require(_0x3d94('0x13'));var licenseUtil=require(_0x3d94('0x14'));var db=require(_0x3d94('0x15'))['db'];config[_0x3d94('0x16')]=_['defaults'](config[_0x3d94('0x16')],{'host':_0x3d94('0x17'),'port':0x18eb});var socket=require(_0x3d94('0x18'))(new Redis(config['redis']));require(_0x3d94('0x19'))[_0x3d94('0x1a')](socket);var jayson=require(_0x3d94('0x1b'));var client=jayson['client'][_0x3d94('0x1c')]({'port':0x232c});var client9002=jayson[_0x3d94('0x1d')][_0x3d94('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x34098e,_0xaf939a,_0xd8efaa,_0x31c6e8){return new BPromise(function(_0x9893cb,_0x540658){var _0x22676a=_0x31c6e8||client;return _0x22676a[_0x3d94('0x1e')](_0x34098e,_0xd8efaa)[_0x3d94('0x1f')](function(_0x1c35a8){logger[_0x3d94('0x20')](_0x3d94('0x21'),_0xaf939a,_0x3d94('0x22'));logger['debug'](_0x3d94('0x23'),_0xaf939a,'request\x20sent',JSON[_0x3d94('0x24')](_0x1c35a8));if(_0x1c35a8[_0x3d94('0x25')]){if(_0x1c35a8[_0x3d94('0x25')][_0x3d94('0x26')]===0x1f4){logger[_0x3d94('0x25')]('SmsMessage,\x20%s,\x20%s',_0xaf939a,_0x1c35a8['error'][_0x3d94('0x27')]);return _0x540658(_0x1c35a8[_0x3d94('0x25')][_0x3d94('0x27')]);}logger['error'](_0x3d94('0x21'),_0xaf939a,_0x1c35a8[_0x3d94('0x25')][_0x3d94('0x27')]);return _0x9893cb(_0x1c35a8[_0x3d94('0x25')][_0x3d94('0x27')]);}else{logger[_0x3d94('0x20')](_0x3d94('0x21'),_0xaf939a,_0x3d94('0x22'));_0x9893cb(_0x1c35a8[_0x3d94('0x28')][_0x3d94('0x27')]);}})[_0x3d94('0x29')](function(_0x192839){logger[_0x3d94('0x25')](_0x3d94('0x21'),_0xaf939a,_0x192839);_0x540658(_0x192839);});});}function respondWithStatusCode(_0x2945d2,_0x5b3b31){_0x5b3b31=_0x5b3b31||0xcc;return function(_0x123183){if(_0x123183){return _0x2945d2['sendStatus'](_0x5b3b31);}return _0x2945d2[_0x3d94('0x2a')](_0x5b3b31)[_0x3d94('0x2b')]();};}function respondWithResult(_0xc2885,_0x439173){_0x439173=_0x439173||0xc8;return function(_0x13254f){if(_0x13254f){return _0xc2885[_0x3d94('0x2a')](_0x439173)[_0x3d94('0x2c')](_0x13254f);}};}function respondWithFilteredResult(_0x47d6ab,_0x584c4a){return function(_0x362642){if(_0x362642){var _0x4813e1=typeof _0x584c4a['offset']===_0x3d94('0x2d')&&typeof _0x584c4a['limit']===_0x3d94('0x2d');var _0xef9644=_0x362642[_0x3d94('0x2e')];var _0x4cef9c=_0x4813e1?0x0:_0x584c4a[_0x3d94('0x2f')];var _0x4c1237=_0x4813e1?_0x362642[_0x3d94('0x2e')]:_0x584c4a['offset']+_0x584c4a[_0x3d94('0x30')];var _0x215ad7;if(_0x4c1237>=_0xef9644){_0x4c1237=_0xef9644;_0x215ad7=0xc8;}else{_0x215ad7=0xce;}_0x47d6ab[_0x3d94('0x2a')](_0x215ad7);return _0x47d6ab[_0x3d94('0x31')]('Content-Range',_0x4cef9c+'-'+_0x4c1237+'/'+_0xef9644)[_0x3d94('0x2c')](_0x362642);}return null;};}function patchUpdates(_0x51f634){return function(_0x1f9559){try{jsonpatch[_0x3d94('0x32')](_0x1f9559,_0x51f634,!![]);}catch(_0x51d308){return BPromise['reject'](_0x51d308);}return _0x1f9559[_0x3d94('0x33')]();};}function saveUpdates(_0x280c73,_0x273337){return function(_0x5cdb2e){if(_0x5cdb2e){return _0x5cdb2e[_0x3d94('0x34')](_0x280c73)[_0x3d94('0x1f')](function(_0x5426bd){return _0x5426bd;});}return null;};}function removeEntity(_0x242500,_0x23f3fe){return function(_0x35947b){if(_0x35947b){return _0x35947b[_0x3d94('0x35')]()[_0x3d94('0x1f')](function(){_0x242500['status'](0xcc)[_0x3d94('0x2b')]();});}};}function handleEntityNotFound(_0x42b742,_0x41579e){return function(_0x52bdb9){if(!_0x52bdb9){_0x42b742[_0x3d94('0x36')](0x194);}return _0x52bdb9;};}function handleError(_0x441523,_0x546658){_0x546658=_0x546658||0x1f4;return function(_0x555ec5){logger[_0x3d94('0x25')](_0x555ec5[_0x3d94('0x37')]);if(_0x555ec5[_0x3d94('0x38')]){delete _0x555ec5[_0x3d94('0x38')];}_0x441523[_0x3d94('0x2a')](_0x546658)[_0x3d94('0x39')](_0x555ec5);};}exports[_0x3d94('0x3a')]=function(_0x12c01a,_0x2e7b97){var _0x2235f9={},_0x4e2244={},_0x6b2b1f={'count':0x0,'rows':[]};var _0x21afb5=_[_0x3d94('0x3b')](db[_0x3d94('0x3c')]['rawAttributes'],function(_0xcf7a73){return{'name':_0xcf7a73[_0x3d94('0x3d')],'type':_0xcf7a73[_0x3d94('0x3e')][_0x3d94('0x3f')]};});_0x4e2244[_0x3d94('0x40')]=_['map'](_0x21afb5,_0x3d94('0x38'));_0x4e2244[_0x3d94('0x41')]=_[_0x3d94('0x42')](_0x12c01a['query']);_0x4e2244['filters']=_['intersection'](_0x4e2244['model'],_0x4e2244[_0x3d94('0x41')]);_0x2235f9[_0x3d94('0x43')]=_[_0x3d94('0x44')](_0x4e2244[_0x3d94('0x40')],qs[_0x3d94('0x45')](_0x12c01a[_0x3d94('0x41')][_0x3d94('0x45')]));_0x2235f9['attributes']=_0x2235f9['attributes'][_0x3d94('0x46')]?_0x2235f9[_0x3d94('0x43')]:_0x4e2244['model'];if(!_0x12c01a[_0x3d94('0x41')]['hasOwnProperty'](_0x3d94('0x47'))){_0x2235f9[_0x3d94('0x30')]=qs[_0x3d94('0x30')](_0x12c01a[_0x3d94('0x41')][_0x3d94('0x30')]);_0x2235f9['offset']=qs[_0x3d94('0x2f')](_0x12c01a[_0x3d94('0x41')][_0x3d94('0x2f')]);}_0x2235f9['order']=qs[_0x3d94('0x48')](_0x12c01a['query']['sort']);_0x2235f9[_0x3d94('0x49')]=qs[_0x3d94('0x4a')](_[_0x3d94('0x4b')](_0x12c01a[_0x3d94('0x41')],_0x4e2244['filters']),_0x21afb5);if(_0x12c01a[_0x3d94('0x41')]['filter']){_0x2235f9[_0x3d94('0x49')]=_[_0x3d94('0x4c')](_0x2235f9[_0x3d94('0x49')],{'$or':_[_0x3d94('0x3b')](_0x21afb5,function(_0x20e6d4){if(_0x20e6d4[_0x3d94('0x3e')]!==_0x3d94('0x4d')){var _0x4e7bfd={};_0x4e7bfd[_0x20e6d4[_0x3d94('0x38')]]={'$like':'%'+_0x12c01a[_0x3d94('0x41')]['filter']+'%'};return _0x4e7bfd;}})});}_0x2235f9=_['merge']({},_0x2235f9,_0x12c01a[_0x3d94('0x4e')]);var _0x9d6cc5={'where':_0x2235f9['where']};return db[_0x3d94('0x3c')][_0x3d94('0x2e')](_0x9d6cc5)[_0x3d94('0x1f')](function(_0x395cd9){_0x6b2b1f[_0x3d94('0x2e')]=_0x395cd9;if(_0x12c01a[_0x3d94('0x41')][_0x3d94('0x4f')]){_0x2235f9[_0x3d94('0x50')]=[{'all':!![]}];}return db[_0x3d94('0x3c')][_0x3d94('0x51')](_0x2235f9);})[_0x3d94('0x1f')](function(_0x29682b){_0x6b2b1f[_0x3d94('0x52')]=_0x29682b;return _0x6b2b1f;})[_0x3d94('0x1f')](respondWithFilteredResult(_0x2e7b97,_0x2235f9))[_0x3d94('0x29')](handleError(_0x2e7b97,null));};exports['show']=function(_0x44df82,_0x22e2b8){var _0x1a9338={'raw':!![],'where':{'id':_0x44df82[_0x3d94('0x53')]['id']}},_0x33d36a={};_0x33d36a[_0x3d94('0x40')]=_[_0x3d94('0x42')](db[_0x3d94('0x3c')][_0x3d94('0x54')]);_0x33d36a['query']=_[_0x3d94('0x42')](_0x44df82['query']);_0x33d36a[_0x3d94('0x4a')]=_[_0x3d94('0x44')](_0x33d36a['model'],_0x33d36a[_0x3d94('0x41')]);_0x1a9338['attributes']=_['intersection'](_0x33d36a[_0x3d94('0x40')],qs['fields'](_0x44df82[_0x3d94('0x41')][_0x3d94('0x45')]));_0x1a9338['attributes']=_0x1a9338[_0x3d94('0x43')]['length']?_0x1a9338['attributes']:_0x33d36a[_0x3d94('0x40')];if(_0x44df82[_0x3d94('0x41')][_0x3d94('0x4f')]){_0x1a9338[_0x3d94('0x50')]=[{'all':!![]}];}_0x1a9338=_[_0x3d94('0x4c')]({},_0x1a9338,_0x44df82[_0x3d94('0x4e')]);return db[_0x3d94('0x3c')][_0x3d94('0x55')](_0x1a9338)[_0x3d94('0x1f')](handleEntityNotFound(_0x22e2b8,null))['then'](respondWithResult(_0x22e2b8,null))[_0x3d94('0x29')](handleError(_0x22e2b8,null));};exports[_0x3d94('0x56')]=function(_0x284fb2,_0x2625e0){return db[_0x3d94('0x3c')][_0x3d94('0x56')](_0x284fb2[_0x3d94('0x57')],{})[_0x3d94('0x1f')](respondWithResult(_0x2625e0,0xc9))[_0x3d94('0x29')](handleError(_0x2625e0,null));};exports[_0x3d94('0x34')]=function(_0x1fd806,_0x5eba38){if(_0x1fd806[_0x3d94('0x57')]['id']){delete _0x1fd806['body']['id'];}return db[_0x3d94('0x3c')][_0x3d94('0x55')]({'where':{'id':_0x1fd806[_0x3d94('0x53')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x5eba38,null))[_0x3d94('0x1f')](saveUpdates(_0x1fd806[_0x3d94('0x57')],null))[_0x3d94('0x1f')](respondWithResult(_0x5eba38,null))[_0x3d94('0x29')](handleError(_0x5eba38,null));};exports[_0x3d94('0x35')]=function(_0x5da38c,_0x519ada){return db[_0x3d94('0x3c')]['find']({'where':{'id':_0x5da38c[_0x3d94('0x53')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x519ada,null))['then'](removeEntity(_0x519ada,null))[_0x3d94('0x29')](handleError(_0x519ada,null));};exports[_0x3d94('0x58')]=function(_0x3cb8f4,_0x467648){return db[_0x3d94('0x3c')][_0x3d94('0x58')]()[_0x3d94('0x1f')](respondWithResult(_0x467648,null))['catch'](handleError(_0x467648,null));};var interaction_log=require(_0x3d94('0x11'))(_0x3d94('0x59'));exports[_0x3d94('0x5a')]=function(_0x4b23b5,_0x2d8b49,_0x15bbe2){var _0x1d9d6d={'agent':{},'channel':_0x3d94('0x5b')};if(_0x4b23b5['body']['id']){delete _0x4b23b5['body']['id'];}_0x4b23b5[_0x3d94('0x57')][_0x3d94('0x5c')]=!![];_0x4b23b5[_0x3d94('0x57')][_0x3d94('0x5d')]=moment()['format'](_0x3d94('0x5e'));_0x4b23b5[_0x3d94('0x57')]['UserId']=_0x4b23b5[_0x3d94('0x57')][_0x3d94('0x5f')]||_0x4b23b5[_0x3d94('0x60')]['id'];_0x1d9d6d['agent']['id']=_0x4b23b5[_0x3d94('0x57')][_0x3d94('0x5f')];return db[_0x3d94('0x3c')]['find']({'where':{'id':_0x4b23b5[_0x3d94('0x53')]['id'],'UserId':null}})[_0x3d94('0x1f')](handleEntityNotFound(_0x2d8b49,null))['then'](saveUpdates(_0x4b23b5['body'],null))['then'](function(_0x3ac9ea){if(_0x3ac9ea){_0x1d9d6d[_0x3d94('0x27')]=_0x3ac9ea[_0x3d94('0x61')]({'plain':!![]});return db[_0x3d94('0x62')][_0x3d94('0x55')]({'where':{'id':_0x3ac9ea['SmsInteractionId']}});}return null;})[_0x3d94('0x1f')](handleEntityNotFound(_0x2d8b49,null))[_0x3d94('0x1f')](function(_0x170d06){if(_0x170d06){return _0x170d06[_0x3d94('0x34')]({'UserId':_0x4b23b5[_0x3d94('0x57')][_0x3d94('0x5f')],'read1stAt':_['isNil'](_0x170d06[_0x3d94('0x63')])?moment()['format'](_0x3d94('0x5e')):undefined});}return null;})[_0x3d94('0x1f')](function(_0x437fff){if(_0x437fff){_0x1d9d6d[_0x3d94('0x64')]=_0x437fff[_0x3d94('0x61')]({'plain':!![]});interaction_log[_0x3d94('0x20')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4b23b5['user']['id'],_0x4b23b5[_0x3d94('0x60')]['name'],_0x4b23b5['user']['role'],_0x1d9d6d[_0x3d94('0x64')]['id'],_0x4b23b5[_0x3d94('0x57')]?JSON[_0x3d94('0x24')](_0x4b23b5[_0x3d94('0x57')]):_0x3d94('0x65'));return respondWithRpcPromise(_0x3d94('0x66'),_0x3d94('0x67'),_0x1d9d6d);}return null;})[_0x3d94('0x1f')](function(_0x5e3480){var _0x22917e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5e3480[_0x3d94('0x27')][_0x3d94('0x68')];return db[_0x3d94('0x69')]['query'](_0x22917e,{'type':db['Sequelize']['QueryTypes'][_0x3d94('0x6a')],'raw':!![]})[_0x3d94('0x1f')](function(_0x2c9c83){return _0x2c9c83;});})[_0x3d94('0x1f')](function(_0x2382df){if(_0x2382df){_0x1d9d6d['message']['contact']=_0x2382df[0x0];if(!_0x4b23b5[_0x3d94('0x57')][_0x3d94('0x5f')])return;return db[_0x3d94('0x6b')]['find']({'where':{'id':_0x4b23b5[_0x3d94('0x57')]['UserId'],'role':_0x3d94('0x6c')},'attributes':['id',_0x3d94('0x38'),_0x3d94('0x6d'),_0x3d94('0x6e'),_0x3d94('0x6f')],'raw':!![]});}return null;})[_0x3d94('0x1f')](function(_0x234bce){if(!_0x234bce)return null;_0x1d9d6d[_0x3d94('0x27')][_0x3d94('0x6c')]=_0x234bce;return _0x1d9d6d;})[_0x3d94('0x1f')](function(_0x3dbf5c){if(_0x3dbf5c){if(_0x4b23b5[_0x3d94('0x57')][_0x3d94('0x70')]){_0x1d9d6d['message'][_0x3d94('0x71')]=util[_0x3d94('0x72')](_0x3d94('0x73'),_0x4b23b5[_0x3d94('0x60')]['name']);_0x1d9d6d[_0x3d94('0x27')]['channel']=_0x1d9d6d['channel'];_0x1d9d6d[_0x3d94('0x27')]['motionChannel']=_0x1d9d6d[_0x3d94('0x74')];_0x1d9d6d[_0x3d94('0x27')]['event']=_0x3d94('0x5a');return respondWithRpcPromise('EventManager',_0x3d94('0x75'),{'event':_0x3d94('0x76'),'message':_0x1d9d6d['message']},client9002)['then'](function(){return _0x1d9d6d;});}return _0x1d9d6d;}return null;})['then'](respondWithResult(_0x2d8b49,null))[_0x3d94('0x29')](handleError(_0x2d8b49,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0x3d94('0x77')]=function(_0x39ea2a,_0x184c4b,_0x15aac4){var _0x4db3a5={'agent':{},'channel':_0x3d94('0x5b')};if(_0x39ea2a[_0x3d94('0x57')]['id']){delete _0x39ea2a[_0x3d94('0x57')]['id'];}_0x39ea2a[_0x3d94('0x57')][_0x3d94('0x5f')]=_0x39ea2a[_0x3d94('0x57')]['UserId']||_0x39ea2a[_0x3d94('0x60')]['id'];_0x4db3a5[_0x3d94('0x6c')]['id']=_0x39ea2a[_0x3d94('0x57')][_0x3d94('0x5f')];return db[_0x3d94('0x3c')][_0x3d94('0x55')]({'where':{'id':_0x39ea2a[_0x3d94('0x53')]['id'],'UserId':null}})[_0x3d94('0x1f')](handleEntityNotFound(_0x184c4b,null))['then'](function(_0x535d01){if(_0x535d01){_0x4db3a5[_0x3d94('0x27')]=_0x535d01[_0x3d94('0x61')]({'plain':!![]});return db[_0x3d94('0x62')]['find']({'where':{'id':_0x535d01[_0x3d94('0x78')]}});}return null;})[_0x3d94('0x1f')](handleEntityNotFound(_0x184c4b,null))[_0x3d94('0x1f')](function(_0xdb96c0){if(_0xdb96c0){_0x4db3a5[_0x3d94('0x64')]=_0xdb96c0['get']({'plain':!![]});interaction_log['info'](_0x3d94('0x79'),_0x39ea2a[_0x3d94('0x60')]['id'],_0x39ea2a[_0x3d94('0x60')][_0x3d94('0x38')],_0x39ea2a[_0x3d94('0x60')][_0x3d94('0x7a')],_0x4db3a5[_0x3d94('0x64')]['id'],_0x39ea2a[_0x3d94('0x57')]?JSON[_0x3d94('0x24')](_0x39ea2a[_0x3d94('0x57')]):_0x3d94('0x65'));return respondWithRpcPromise(_0x3d94('0x7b'),_0x3d94('0x7c'),_0x4db3a5);}return null;})['then'](function(_0x2b5d1c){var _0x447e73='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2b5d1c['message'][_0x3d94('0x68')];return db[_0x3d94('0x69')][_0x3d94('0x41')](_0x447e73,{'type':db[_0x3d94('0x7d')]['QueryTypes']['SELECT'],'raw':!![]})[_0x3d94('0x1f')](function(_0x2ec7d9){return _0x2ec7d9;});})[_0x3d94('0x1f')](function(_0x22283d){if(_0x22283d){_0x4db3a5[_0x3d94('0x27')]['contact']=_0x22283d[0x0];if(!_0x39ea2a[_0x3d94('0x57')]['UserId'])return;return db[_0x3d94('0x6b')][_0x3d94('0x55')]({'where':{'id':_0x39ea2a[_0x3d94('0x57')]['UserId'],'role':_0x3d94('0x6c')},'attributes':['id',_0x3d94('0x38'),'fullname',_0x3d94('0x6e'),'internal'],'raw':!![]});}return null;})[_0x3d94('0x1f')](function(_0x401772){if(!_0x401772)return null;_0x4db3a5[_0x3d94('0x27')]['agent']=_0x401772;return _0x4db3a5;})[_0x3d94('0x1f')](function(_0x315664){if(_0x315664){_0x315664[_0x3d94('0x27')]['interface']=util[_0x3d94('0x72')](_0x3d94('0x73'),_0x39ea2a[_0x3d94('0x60')][_0x3d94('0x38')]);_0x315664[_0x3d94('0x27')][_0x3d94('0x74')]=_0x4db3a5[_0x3d94('0x74')];_0x315664[_0x3d94('0x27')]['motionChannel']=_0x4db3a5[_0x3d94('0x74')];_0x315664[_0x3d94('0x27')][_0x3d94('0x7e')]=_0x3d94('0x77');respondWithRpcPromise(_0x3d94('0x75'),_0x3d94('0x75'),{'event':'rejectmessage','message':_0x315664[_0x3d94('0x27')]},client9002);return _0x4db3a5;}return null;})[_0x3d94('0x1f')](respondWithResult(_0x184c4b,null))[_0x3d94('0x29')](handleError(_0x184c4b,null));};exports['status']=function(_0x3fc2f2,_0x4c6c49,_0xe85875){if(_0x3fc2f2[_0x3d94('0x57')]['id']){delete _0x3fc2f2['body']['id'];}var _0x73b09c;return db[_0x3d94('0x3c')]['find']({'where':{'id':_0x3fc2f2['params']['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x4c6c49,null))[_0x3d94('0x1f')](function(_0x48a22f){if(_0x48a22f){_0x73b09c=_0x48a22f;return db['SmsAccount']['find']({'where':{'id':_0x48a22f[_0x3d94('0x7f')]}});}})[_0x3d94('0x1f')](handleEntityNotFound(_0x4c6c49,null))[_0x3d94('0x1f')](function(_0xcfdc67){if(_0xcfdc67){logger[_0x3d94('0x80')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3d94('0x2a'),_0x3d94('0x81'),_0xcfdc67[_0x3d94('0x3e')],util['inspect'](_0x3fc2f2[_0x3d94('0x57')],{'showHidden':![],'depth':null}));switch(_0xcfdc67['type']){case _0x3d94('0x82'):if(_0x3fc2f2[_0x3d94('0x57')][_0x3d94('0x83')]&&_0x3fc2f2[_0x3d94('0x57')][_0x3d94('0x83')]===_0x73b09c['messageId']){return _0x73b09c['update']({'read':!![]});}else{logger[_0x3d94('0x25')](_0x3d94('0x84'),'status',_0x3d94('0x82'),util['inspect'](_0x3fc2f2[_0x3d94('0x57')],{'showHidden':![],'depth':null}));}break;case _0x3d94('0x85'):if(_0x3fc2f2[_0x3d94('0x57')]['MessageUUID']&&_0x3fc2f2[_0x3d94('0x57')]['MessageUUID']===_0x73b09c[_0x3d94('0x86')]&&_[_0x3d94('0x87')]([_0x3d94('0x88'),_0x3d94('0x89')],_0x3fc2f2['body']['Status'])>=0x0){return _0x73b09c[_0x3d94('0x34')]({'read':!![]});}else{logger[_0x3d94('0x25')](_0x3d94('0x84'),_0x3d94('0x2a'),'plivio',util[_0x3d94('0x8a')](_0x3fc2f2['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x543b1a=_0x3fc2f2[_0x3d94('0x57')][_0x3d94('0x8b')][0x0];if(_0x543b1a[_0x3d94('0x2a')][_0x3d94('0x8c')]===_0x3d94('0x8d')){return _0x73b09c[_0x3d94('0x34')]({'read':!![]});}else{logger[_0x3d94('0x25')](_0x3d94('0x84'),_0x3d94('0x2a'),_0x3d94('0x8e'),util[_0x3d94('0x8a')](_0x3fc2f2[_0x3d94('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x73b09c;}})[_0x3d94('0x1f')](respondWithResult(_0x4c6c49,null))[_0x3d94('0x29')](handleError(_0x4c6c49,null));}; \ No newline at end of file +var _0xffb1=['util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsMessage.socket','jayson/promise','http','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','map','SmsMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','length','create','body','find','describe','sms-interactions','accept','sms','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','format','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','../../config/logger','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','fullname','interface','rejectmessage','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','type','inspect','twilio','MessageSid','messageId','plivo','MessageUUID','indexOf','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x2b590d,_0x13e7f5){var _0x154a3c=function(_0x45f135){while(--_0x45f135){_0x2b590d['push'](_0x2b590d['shift']());}};_0x154a3c(++_0x13e7f5);}(_0xffb1,0x93));var _0x1ffb=function(_0x132d12,_0x2c9799){_0x132d12=_0x132d12-0x0;var _0x1c3163=_0xffb1[_0x132d12];return _0x1c3163;};'use strict';var emlformat=require(_0x1ffb('0x0'));var rimraf=require(_0x1ffb('0x1'));var zipdir=require(_0x1ffb('0x2'));var jsonpatch=require(_0x1ffb('0x3'));var rp=require(_0x1ffb('0x4'));var moment=require(_0x1ffb('0x5'));var BPromise=require(_0x1ffb('0x6'));var Mustache=require(_0x1ffb('0x7'));var util=require(_0x1ffb('0x8'));var path=require(_0x1ffb('0x9'));var sox=require('sox');var csv=require(_0x1ffb('0xa'));var ejs=require(_0x1ffb('0xb'));var fs=require('fs');var fs_extra=require(_0x1ffb('0xc'));var _=require(_0x1ffb('0xd'));var squel=require(_0x1ffb('0xe'));var crypto=require('crypto');var jsforce=require(_0x1ffb('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1ffb('0x10'));var Papa=require(_0x1ffb('0x11'));var Redis=require(_0x1ffb('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1ffb('0x13'));var hardwareService=require(_0x1ffb('0x14'));var logger=require('../../config/logger')(_0x1ffb('0x15'));var utils=require('../../config/utils');var config=require(_0x1ffb('0x16'));var licenseUtil=require(_0x1ffb('0x17'));var db=require(_0x1ffb('0x18'))['db'];config[_0x1ffb('0x19')]=_[_0x1ffb('0x1a')](config[_0x1ffb('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x1ffb('0x1b'))(new Redis(config[_0x1ffb('0x19')]));require(_0x1ffb('0x1c'))['register'](socket);var jayson=require(_0x1ffb('0x1d'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0x1ffb('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1216b5,_0x4c11db,_0x3e0681,_0xf343b5){return new BPromise(function(_0x1a1f21,_0xc81c37){var _0x4de448=_0xf343b5||client;return _0x4de448[_0x1ffb('0x1f')](_0x1216b5,_0x3e0681)['then'](function(_0xd004f){logger[_0x1ffb('0x20')](_0x1ffb('0x21'),_0x4c11db,_0x1ffb('0x22'));logger[_0x1ffb('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4c11db,_0x1ffb('0x22'),JSON['stringify'](_0xd004f));if(_0xd004f[_0x1ffb('0x24')]){if(_0xd004f[_0x1ffb('0x24')][_0x1ffb('0x25')]===0x1f4){logger['error'](_0x1ffb('0x21'),_0x4c11db,_0xd004f['error'][_0x1ffb('0x26')]);return _0xc81c37(_0xd004f['error'][_0x1ffb('0x26')]);}logger['error'](_0x1ffb('0x21'),_0x4c11db,_0xd004f['error'][_0x1ffb('0x26')]);return _0x1a1f21(_0xd004f[_0x1ffb('0x24')]['message']);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x4c11db,_0x1ffb('0x22'));_0x1a1f21(_0xd004f['result']['message']);}})[_0x1ffb('0x27')](function(_0x391085){logger['error'](_0x1ffb('0x21'),_0x4c11db,_0x391085);_0xc81c37(_0x391085);});});}function respondWithStatusCode(_0x4298fd,_0x10b8ea){_0x10b8ea=_0x10b8ea||0xcc;return function(_0x458f6f){if(_0x458f6f){return _0x4298fd[_0x1ffb('0x28')](_0x10b8ea);}return _0x4298fd[_0x1ffb('0x29')](_0x10b8ea)[_0x1ffb('0x2a')]();};}function respondWithResult(_0x55d07b,_0x634d91){_0x634d91=_0x634d91||0xc8;return function(_0x15d636){if(_0x15d636){return _0x55d07b[_0x1ffb('0x29')](_0x634d91)['json'](_0x15d636);}};}function respondWithFilteredResult(_0x2c68fc,_0x471eaf){return function(_0x1c9771){if(_0x1c9771){var _0x5e7859=typeof _0x471eaf[_0x1ffb('0x2b')]===_0x1ffb('0x2c')&&typeof _0x471eaf[_0x1ffb('0x2d')]===_0x1ffb('0x2c');var _0x12e31f=_0x1c9771[_0x1ffb('0x2e')];var _0x3f2d64=_0x5e7859?0x0:_0x471eaf[_0x1ffb('0x2b')];var _0x5da00a=_0x5e7859?_0x1c9771[_0x1ffb('0x2e')]:_0x471eaf[_0x1ffb('0x2b')]+_0x471eaf['limit'];var _0x301b22;if(_0x5da00a>=_0x12e31f){_0x5da00a=_0x12e31f;_0x301b22=0xc8;}else{_0x301b22=0xce;}_0x2c68fc['status'](_0x301b22);return _0x2c68fc['set'](_0x1ffb('0x2f'),_0x3f2d64+'-'+_0x5da00a+'/'+_0x12e31f)[_0x1ffb('0x30')](_0x1c9771);}return null;};}function patchUpdates(_0x24b062){return function(_0x4afe67){try{jsonpatch[_0x1ffb('0x31')](_0x4afe67,_0x24b062,!![]);}catch(_0x38688a){return BPromise[_0x1ffb('0x32')](_0x38688a);}return _0x4afe67[_0x1ffb('0x33')]();};}function saveUpdates(_0x43e4b7,_0x159015){return function(_0xbfbdc8){if(_0xbfbdc8){return _0xbfbdc8[_0x1ffb('0x34')](_0x43e4b7)[_0x1ffb('0x35')](function(_0x58e887){return _0x58e887;});}return null;};}function removeEntity(_0x456554,_0x398c3c){return function(_0x1bcd96){if(_0x1bcd96){return _0x1bcd96[_0x1ffb('0x36')]()[_0x1ffb('0x35')](function(){_0x456554[_0x1ffb('0x29')](0xcc)[_0x1ffb('0x2a')]();});}};}function handleEntityNotFound(_0x247444,_0x187cbe){return function(_0x547a7a){if(!_0x547a7a){_0x247444[_0x1ffb('0x28')](0x194);}return _0x547a7a;};}function handleError(_0x493fff,_0x26f226){_0x26f226=_0x26f226||0x1f4;return function(_0x47c963){logger[_0x1ffb('0x24')](_0x47c963[_0x1ffb('0x37')]);if(_0x47c963[_0x1ffb('0x38')]){delete _0x47c963[_0x1ffb('0x38')];}_0x493fff[_0x1ffb('0x29')](_0x26f226)[_0x1ffb('0x39')](_0x47c963);};}exports['index']=function(_0x2419f0,_0x2b05fc){var _0x1bb59e={},_0x4f4335={},_0x4f9a94={'count':0x0,'rows':[]};var _0x4d27e7=_[_0x1ffb('0x3a')](db[_0x1ffb('0x3b')][_0x1ffb('0x3c')],function(_0x9bbe07){return{'name':_0x9bbe07[_0x1ffb('0x3d')],'type':_0x9bbe07['type'][_0x1ffb('0x3e')]};});_0x4f4335[_0x1ffb('0x3f')]=_[_0x1ffb('0x3a')](_0x4d27e7,_0x1ffb('0x38'));_0x4f4335[_0x1ffb('0x40')]=_[_0x1ffb('0x41')](_0x2419f0[_0x1ffb('0x40')]);_0x4f4335[_0x1ffb('0x42')]=_[_0x1ffb('0x43')](_0x4f4335[_0x1ffb('0x3f')],_0x4f4335['query']);_0x1bb59e[_0x1ffb('0x44')]=_[_0x1ffb('0x43')](_0x4f4335[_0x1ffb('0x3f')],qs[_0x1ffb('0x45')](_0x2419f0['query'][_0x1ffb('0x45')]));_0x1bb59e['attributes']=_0x1bb59e['attributes']['length']?_0x1bb59e[_0x1ffb('0x44')]:_0x4f4335[_0x1ffb('0x3f')];if(!_0x2419f0[_0x1ffb('0x40')][_0x1ffb('0x46')](_0x1ffb('0x47'))){_0x1bb59e['limit']=qs['limit'](_0x2419f0[_0x1ffb('0x40')][_0x1ffb('0x2d')]);_0x1bb59e[_0x1ffb('0x2b')]=qs[_0x1ffb('0x2b')](_0x2419f0[_0x1ffb('0x40')]['offset']);}_0x1bb59e[_0x1ffb('0x48')]=qs[_0x1ffb('0x49')](_0x2419f0['query'][_0x1ffb('0x49')]);_0x1bb59e['where']=qs[_0x1ffb('0x42')](_[_0x1ffb('0x4a')](_0x2419f0[_0x1ffb('0x40')],_0x4f4335[_0x1ffb('0x42')]),_0x4d27e7);if(_0x2419f0[_0x1ffb('0x40')]['filter']){_0x1bb59e[_0x1ffb('0x4b')]=_[_0x1ffb('0x4c')](_0x1bb59e[_0x1ffb('0x4b')],{'$or':_[_0x1ffb('0x3a')](_0x4d27e7,function(_0x57bbfb){if(_0x57bbfb['type']!==_0x1ffb('0x4d')){var _0x469336={};_0x469336[_0x57bbfb['name']]={'$like':'%'+_0x2419f0['query'][_0x1ffb('0x4e')]+'%'};return _0x469336;}})});}_0x1bb59e=_['merge']({},_0x1bb59e,_0x2419f0[_0x1ffb('0x4f')]);var _0x7eaa84={'where':_0x1bb59e[_0x1ffb('0x4b')]};return db[_0x1ffb('0x3b')][_0x1ffb('0x2e')](_0x7eaa84)[_0x1ffb('0x35')](function(_0x37eb63){_0x4f9a94['count']=_0x37eb63;if(_0x2419f0[_0x1ffb('0x40')][_0x1ffb('0x50')]){_0x1bb59e[_0x1ffb('0x51')]=[{'all':!![]}];}return db[_0x1ffb('0x3b')]['findAll'](_0x1bb59e);})[_0x1ffb('0x35')](function(_0x17ca4a){_0x4f9a94[_0x1ffb('0x52')]=_0x17ca4a;return _0x4f9a94;})[_0x1ffb('0x35')](respondWithFilteredResult(_0x2b05fc,_0x1bb59e))[_0x1ffb('0x27')](handleError(_0x2b05fc,null));};exports[_0x1ffb('0x53')]=function(_0x439466,_0x2d60ce){var _0x44229f={'raw':!![],'where':{'id':_0x439466[_0x1ffb('0x54')]['id']}},_0x11040b={};_0x11040b[_0x1ffb('0x3f')]=_[_0x1ffb('0x41')](db[_0x1ffb('0x3b')][_0x1ffb('0x3c')]);_0x11040b[_0x1ffb('0x40')]=_[_0x1ffb('0x41')](_0x439466[_0x1ffb('0x40')]);_0x11040b['filters']=_[_0x1ffb('0x43')](_0x11040b['model'],_0x11040b[_0x1ffb('0x40')]);_0x44229f['attributes']=_[_0x1ffb('0x43')](_0x11040b[_0x1ffb('0x3f')],qs[_0x1ffb('0x45')](_0x439466['query']['fields']));_0x44229f['attributes']=_0x44229f[_0x1ffb('0x44')][_0x1ffb('0x55')]?_0x44229f[_0x1ffb('0x44')]:_0x11040b[_0x1ffb('0x3f')];if(_0x439466[_0x1ffb('0x40')][_0x1ffb('0x50')]){_0x44229f[_0x1ffb('0x51')]=[{'all':!![]}];}_0x44229f=_[_0x1ffb('0x4c')]({},_0x44229f,_0x439466[_0x1ffb('0x4f')]);return db[_0x1ffb('0x3b')]['find'](_0x44229f)[_0x1ffb('0x35')](handleEntityNotFound(_0x2d60ce,null))[_0x1ffb('0x35')](respondWithResult(_0x2d60ce,null))[_0x1ffb('0x27')](handleError(_0x2d60ce,null));};exports['create']=function(_0x58db97,_0x42b572){return db[_0x1ffb('0x3b')][_0x1ffb('0x56')](_0x58db97['body'],{})[_0x1ffb('0x35')](respondWithResult(_0x42b572,0xc9))[_0x1ffb('0x27')](handleError(_0x42b572,null));};exports['update']=function(_0x4b724c,_0x51a60a){if(_0x4b724c[_0x1ffb('0x57')]['id']){delete _0x4b724c['body']['id'];}return db['SmsMessage'][_0x1ffb('0x58')]({'where':{'id':_0x4b724c[_0x1ffb('0x54')]['id']}})[_0x1ffb('0x35')](handleEntityNotFound(_0x51a60a,null))[_0x1ffb('0x35')](saveUpdates(_0x4b724c[_0x1ffb('0x57')],null))[_0x1ffb('0x35')](respondWithResult(_0x51a60a,null))['catch'](handleError(_0x51a60a,null));};exports['destroy']=function(_0x49cb0e,_0x36db51){return db[_0x1ffb('0x3b')][_0x1ffb('0x58')]({'where':{'id':_0x49cb0e['params']['id']}})[_0x1ffb('0x35')](handleEntityNotFound(_0x36db51,null))['then'](removeEntity(_0x36db51,null))['catch'](handleError(_0x36db51,null));};exports[_0x1ffb('0x59')]=function(_0x56d05a,_0x370c2b){return db[_0x1ffb('0x3b')][_0x1ffb('0x59')]()[_0x1ffb('0x35')](respondWithResult(_0x370c2b,null))[_0x1ffb('0x27')](handleError(_0x370c2b,null));};var interaction_log=require('../../config/logger')(_0x1ffb('0x5a'));exports[_0x1ffb('0x5b')]=function(_0x17ea1e,_0x5cea9d,_0x343939){var _0x476b15={'agent':{},'channel':_0x1ffb('0x5c')};if(_0x17ea1e[_0x1ffb('0x57')]['id']){delete _0x17ea1e['body']['id'];}_0x17ea1e[_0x1ffb('0x57')][_0x1ffb('0x5d')]=!![];_0x17ea1e[_0x1ffb('0x57')]['readAt']=moment()['format'](_0x1ffb('0x5e'));_0x17ea1e[_0x1ffb('0x57')][_0x1ffb('0x5f')]=_0x17ea1e[_0x1ffb('0x57')][_0x1ffb('0x5f')]||_0x17ea1e[_0x1ffb('0x60')]['id'];_0x476b15[_0x1ffb('0x61')]['id']=_0x17ea1e['body'][_0x1ffb('0x5f')];return db[_0x1ffb('0x3b')][_0x1ffb('0x58')]({'where':{'id':_0x17ea1e[_0x1ffb('0x54')]['id'],'UserId':null}})[_0x1ffb('0x35')](handleEntityNotFound(_0x5cea9d,null))[_0x1ffb('0x35')](saveUpdates(_0x17ea1e[_0x1ffb('0x57')],null))['then'](function(_0x12c7e9){if(_0x12c7e9){_0x476b15[_0x1ffb('0x26')]=_0x12c7e9[_0x1ffb('0x62')]({'plain':!![]});return db[_0x1ffb('0x63')][_0x1ffb('0x58')]({'where':{'id':_0x12c7e9[_0x1ffb('0x64')]}});}return null;})[_0x1ffb('0x35')](handleEntityNotFound(_0x5cea9d,null))['then'](function(_0x2473b9){if(_0x2473b9){return _0x2473b9[_0x1ffb('0x34')]({'UserId':_0x17ea1e[_0x1ffb('0x57')][_0x1ffb('0x5f')],'read1stAt':_[_0x1ffb('0x65')](_0x2473b9['read1stAt'])?moment()['format'](_0x1ffb('0x5e')):undefined});}return null;})[_0x1ffb('0x35')](function(_0x5e524a){if(_0x5e524a){_0x476b15[_0x1ffb('0x66')]=_0x5e524a[_0x1ffb('0x62')]({'plain':!![]});interaction_log[_0x1ffb('0x20')](_0x1ffb('0x67'),_0x17ea1e[_0x1ffb('0x60')]['id'],_0x17ea1e[_0x1ffb('0x60')][_0x1ffb('0x38')],_0x17ea1e['user'][_0x1ffb('0x68')],_0x476b15[_0x1ffb('0x66')]['id'],_0x17ea1e[_0x1ffb('0x57')]?JSON[_0x1ffb('0x69')](_0x17ea1e[_0x1ffb('0x57')]):_0x1ffb('0x6a'));return respondWithRpcPromise(_0x1ffb('0x6b'),_0x1ffb('0x6c'),_0x476b15);}return null;})[_0x1ffb('0x35')](function(_0x377d4b){var _0x1db54d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x377d4b['message'][_0x1ffb('0x6d')];return db[_0x1ffb('0x6e')]['query'](_0x1db54d,{'type':db[_0x1ffb('0x6f')][_0x1ffb('0x70')][_0x1ffb('0x71')],'raw':!![]})['then'](function(_0x782a6f){return _0x782a6f;});})[_0x1ffb('0x35')](function(_0x28eed0){if(_0x28eed0){_0x476b15[_0x1ffb('0x26')][_0x1ffb('0x72')]=_0x28eed0[0x0];if(!_0x17ea1e[_0x1ffb('0x57')]['UserId'])return;return db[_0x1ffb('0x73')][_0x1ffb('0x58')]({'where':{'id':_0x17ea1e['body']['UserId'],'role':'agent'},'attributes':['id',_0x1ffb('0x38'),'fullname',_0x1ffb('0x74'),_0x1ffb('0x75')],'raw':!![]});}return null;})[_0x1ffb('0x35')](function(_0x162d15){if(!_0x162d15)return null;_0x476b15[_0x1ffb('0x26')]['agent']=_0x162d15;return _0x476b15;})['then'](function(_0x59ed33){if(_0x59ed33){if(_0x17ea1e[_0x1ffb('0x57')][_0x1ffb('0x76')]){_0x476b15['message']['interface']=util[_0x1ffb('0x77')](_0x1ffb('0x78'),_0x17ea1e[_0x1ffb('0x60')]['name']);_0x476b15['message'][_0x1ffb('0x79')]=_0x476b15['channel'];_0x476b15[_0x1ffb('0x26')][_0x1ffb('0x7a')]=_0x476b15[_0x1ffb('0x79')];_0x476b15[_0x1ffb('0x26')][_0x1ffb('0x7b')]=_0x1ffb('0x5b');return respondWithRpcPromise(_0x1ffb('0x7c'),_0x1ffb('0x7c'),{'event':_0x1ffb('0x7d'),'message':_0x476b15['message']},client9002)[_0x1ffb('0x35')](function(){return _0x476b15;});}return _0x476b15;}return null;})['then'](respondWithResult(_0x5cea9d,null))['catch'](handleError(_0x5cea9d,null));};var interaction_log=require(_0x1ffb('0x7e'))(_0x1ffb('0x5a'));exports[_0x1ffb('0x32')]=function(_0x561629,_0x337ec9,_0x3b681f){var _0x418122={'agent':{},'channel':'sms'};if(_0x561629[_0x1ffb('0x57')]['id']){delete _0x561629[_0x1ffb('0x57')]['id'];}_0x561629[_0x1ffb('0x57')][_0x1ffb('0x5f')]=_0x561629[_0x1ffb('0x57')][_0x1ffb('0x5f')]||_0x561629[_0x1ffb('0x60')]['id'];_0x418122['agent']['id']=_0x561629[_0x1ffb('0x57')][_0x1ffb('0x5f')];return db[_0x1ffb('0x3b')]['find']({'where':{'id':_0x561629[_0x1ffb('0x54')]['id'],'UserId':null}})[_0x1ffb('0x35')](handleEntityNotFound(_0x337ec9,null))[_0x1ffb('0x35')](function(_0x5f490d){if(_0x5f490d){_0x418122['message']=_0x5f490d[_0x1ffb('0x62')]({'plain':!![]});return db['SmsInteraction'][_0x1ffb('0x58')]({'where':{'id':_0x5f490d[_0x1ffb('0x64')]}});}return null;})[_0x1ffb('0x35')](handleEntityNotFound(_0x337ec9,null))[_0x1ffb('0x35')](function(_0x365bb0){if(_0x365bb0){_0x418122[_0x1ffb('0x66')]=_0x365bb0[_0x1ffb('0x62')]({'plain':!![]});interaction_log[_0x1ffb('0x20')](_0x1ffb('0x7f'),_0x561629[_0x1ffb('0x60')]['id'],_0x561629[_0x1ffb('0x60')][_0x1ffb('0x38')],_0x561629[_0x1ffb('0x60')][_0x1ffb('0x68')],_0x418122[_0x1ffb('0x66')]['id'],_0x561629['body']?JSON['stringify'](_0x561629[_0x1ffb('0x57')]):_0x1ffb('0x6a'));return respondWithRpcPromise(_0x1ffb('0x80'),_0x1ffb('0x81'),_0x418122);}return null;})[_0x1ffb('0x35')](function(_0x28d05e){var _0x18dde6=_0x1ffb('0x82')+_0x28d05e['message'][_0x1ffb('0x6d')];return db[_0x1ffb('0x6e')][_0x1ffb('0x40')](_0x18dde6,{'type':db[_0x1ffb('0x6f')][_0x1ffb('0x70')][_0x1ffb('0x71')],'raw':!![]})[_0x1ffb('0x35')](function(_0x431056){return _0x431056;});})['then'](function(_0x5b0122){if(_0x5b0122){_0x418122[_0x1ffb('0x26')]['contact']=_0x5b0122[0x0];if(!_0x561629[_0x1ffb('0x57')][_0x1ffb('0x5f')])return;return db['User'][_0x1ffb('0x58')]({'where':{'id':_0x561629[_0x1ffb('0x57')][_0x1ffb('0x5f')],'role':'agent'},'attributes':['id',_0x1ffb('0x38'),_0x1ffb('0x83'),'email',_0x1ffb('0x75')],'raw':!![]});}return null;})[_0x1ffb('0x35')](function(_0x3f76f4){if(!_0x3f76f4)return null;_0x418122[_0x1ffb('0x26')]['agent']=_0x3f76f4;return _0x418122;})[_0x1ffb('0x35')](function(_0x3d7e2a){if(_0x3d7e2a){_0x3d7e2a[_0x1ffb('0x26')][_0x1ffb('0x84')]=util[_0x1ffb('0x77')](_0x1ffb('0x78'),_0x561629[_0x1ffb('0x60')][_0x1ffb('0x38')]);_0x3d7e2a[_0x1ffb('0x26')]['channel']=_0x418122[_0x1ffb('0x79')];_0x3d7e2a[_0x1ffb('0x26')]['motionChannel']=_0x418122[_0x1ffb('0x79')];_0x3d7e2a['message'][_0x1ffb('0x7b')]=_0x1ffb('0x32');respondWithRpcPromise(_0x1ffb('0x7c'),_0x1ffb('0x7c'),{'event':_0x1ffb('0x85'),'message':_0x3d7e2a[_0x1ffb('0x26')]},client9002);return _0x418122;}return null;})[_0x1ffb('0x35')](respondWithResult(_0x337ec9,null))[_0x1ffb('0x27')](handleError(_0x337ec9,null));};exports[_0x1ffb('0x29')]=function(_0x39c119,_0x106ea5,_0x173e35){if(_0x39c119['body']['id']){delete _0x39c119[_0x1ffb('0x57')]['id'];}var _0x254cab;return db[_0x1ffb('0x3b')][_0x1ffb('0x58')]({'where':{'id':_0x39c119['params']['id']}})[_0x1ffb('0x35')](handleEntityNotFound(_0x106ea5,null))[_0x1ffb('0x35')](function(_0x2cc23c){if(_0x2cc23c){_0x254cab=_0x2cc23c;return db[_0x1ffb('0x86')][_0x1ffb('0x58')]({'where':{'id':_0x2cc23c[_0x1ffb('0x87')]}});}})[_0x1ffb('0x35')](handleEntityNotFound(_0x106ea5,null))[_0x1ffb('0x35')](function(_0x5dff04){if(_0x5dff04){logger[_0x1ffb('0x23')](_0x1ffb('0x88'),_0x1ffb('0x29'),_0x1ffb('0x89'),_0x5dff04[_0x1ffb('0x8a')],util[_0x1ffb('0x8b')](_0x39c119[_0x1ffb('0x57')],{'showHidden':![],'depth':null}));switch(_0x5dff04[_0x1ffb('0x8a')]){case _0x1ffb('0x8c'):if(_0x39c119['body'][_0x1ffb('0x8d')]&&_0x39c119[_0x1ffb('0x57')][_0x1ffb('0x8d')]===_0x254cab[_0x1ffb('0x8e')]){return _0x254cab['update']({'read':!![]});}else{logger[_0x1ffb('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1ffb('0x29'),'twilio',util[_0x1ffb('0x8b')](_0x39c119[_0x1ffb('0x57')],{'showHidden':![],'depth':null}));}break;case _0x1ffb('0x8f'):if(_0x39c119[_0x1ffb('0x57')][_0x1ffb('0x90')]&&_0x39c119[_0x1ffb('0x57')]['MessageUUID']===_0x254cab[_0x1ffb('0x8e')]&&_[_0x1ffb('0x91')]([_0x1ffb('0x92'),_0x1ffb('0x93')],_0x39c119[_0x1ffb('0x57')][_0x1ffb('0x94')])>=0x0){return _0x254cab[_0x1ffb('0x34')]({'read':!![]});}else{logger[_0x1ffb('0x24')](_0x1ffb('0x95'),_0x1ffb('0x29'),_0x1ffb('0x96'),util['inspect'](_0x39c119[_0x1ffb('0x57')],{'showHidden':![],'depth':null}));}break;case _0x1ffb('0x97'):var _0x246198=_0x39c119[_0x1ffb('0x57')][_0x1ffb('0x98')][0x0];if(_0x246198[_0x1ffb('0x29')][_0x1ffb('0x99')]===_0x1ffb('0x9a')){return _0x254cab[_0x1ffb('0x34')]({'read':!![]});}else{logger[_0x1ffb('0x24')](_0x1ffb('0x95'),_0x1ffb('0x29'),_0x1ffb('0x97'),util[_0x1ffb('0x8b')](_0x39c119[_0x1ffb('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x254cab;}})[_0x1ffb('0x35')](respondWithResult(_0x106ea5,null))[_0x1ffb('0x27')](handleError(_0x106ea5,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 54667fa..ac6e6b2 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 _0x3f8e=['hasOwnProperty','hook','events','../../mysqldb','SmsMessage','setMaxListeners','save','remove','emit'];(function(_0x4ebd64,_0x29f458){var _0x1b49d4=function(_0x548a96){while(--_0x548a96){_0x4ebd64['push'](_0x4ebd64['shift']());}};_0x1b49d4(++_0x29f458);}(_0x3f8e,0x65));var _0xe3f8=function(_0x2a1da0,_0x3b2cf0){_0x2a1da0=_0x2a1da0-0x0;var _0x4aeffe=_0x3f8e[_0x2a1da0];return _0x4aeffe;};'use strict';var EventEmitter=require(_0xe3f8('0x0'));var SmsMessage=require(_0xe3f8('0x1'))['db'][_0xe3f8('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xe3f8('0x3')](0x0);var events={'afterCreate':_0xe3f8('0x4'),'afterUpdate':'update','afterDestroy':_0xe3f8('0x5')};function emitEvent(_0x21b938){return function(_0x14ab79,_0x5e054d,_0x2e3538){SmsMessageEvents[_0xe3f8('0x6')](_0x21b938+':'+_0x14ab79['id'],_0x14ab79);SmsMessageEvents[_0xe3f8('0x6')](_0x21b938,_0x14ab79);_0x2e3538(null);};}for(var e in events){if(events[_0xe3f8('0x7')](e)){var event=events[e];SmsMessage[_0xe3f8('0x8')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0xff5a=['update','remove','emit','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x38e0de,_0x132d49){var _0x1a906a=function(_0x45d5a0){while(--_0x45d5a0){_0x38e0de['push'](_0x38e0de['shift']());}};_0x1a906a(++_0x132d49);}(_0xff5a,0xd4));var _0xaff5=function(_0x176a76,_0x2477fe){_0x176a76=_0x176a76-0x0;var _0x34ffbe=_0xff5a[_0x176a76];return _0x34ffbe;};'use strict';var EventEmitter=require(_0xaff5('0x0'));var SmsMessage=require(_0xaff5('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xaff5('0x2')](0x0);var events={'afterCreate':_0xaff5('0x3'),'afterUpdate':_0xaff5('0x4'),'afterDestroy':_0xaff5('0x5')};function emitEvent(_0x57b418){return function(_0x37d91c,_0x5316ff,_0x4cd832){SmsMessageEvents['emit'](_0x57b418+':'+_0x37d91c['id'],_0x37d91c);SmsMessageEvents[_0xaff5('0x6')](_0x57b418,_0x37d91c);_0x4cd832(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xaff5('0x7')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 846bc44..3819e1c 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 _0x76d8=['data','queued_count','head','message_id','clickSend','plivo','authId','token','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','login','sender','text','timestamp','keys','sort','length','md5','digest','GET','/external/get/send.php?','Missing\x20parameters:\x20apiKey','clickatell','apiKey','uuid','UTF-8','bandwidth','accountId','/messages','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','status','refid','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','error','out','secret','SmsAccount','find','type','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','sid','afterCreate','twilio','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','catch','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','Basic\x20%s','toString','base64','http_code'];(function(_0x3d8235,_0x12d2af){var _0x24eb36=function(_0x86d741){while(--_0x86d741){_0x3d8235['push'](_0x3d8235['shift']());}};_0x24eb36(++_0x12d2af);}(_0x76d8,0xaf));var _0x876d=function(_0xd81333,_0x4d730b){_0xd81333=_0xd81333-0x0;var _0x1a1f7e=_0x76d8[_0xd81333];return _0x1a1f7e;};'use strict';var _=require(_0x876d('0x0'));var util=require(_0x876d('0x1'));var logger=require(_0x876d('0x2'))('api');var moment=require(_0x876d('0x3'));var BPromise=require(_0x876d('0x4'));var rp=require(_0x876d('0x5'));var fs=require('fs');var path=require(_0x876d('0x6'));var rimraf=require(_0x876d('0x7'));var config=require(_0x876d('0x8'));var attributes=require(_0x876d('0x9'));module[_0x876d('0xa')]=function(_0x4f3a48,_0x690417){return _0x4f3a48['define'](_0x876d('0xb'),attributes,{'tableName':_0x876d('0xc'),'paranoid':![],'indexes':[{'name':_0x876d('0xd'),'fields':[_0x876d('0xd')]},{'name':_0x876d('0xe'),'fields':[_0x876d('0xf')],'type':_0x876d('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x49a058,_0x463ead,_0x3b9fc5){var _0x561a25=_0x4f3a48[_0x876d('0x11')];var _0x597275=_0x49a058[_0x876d('0x12')]({'plain':!![]});if(_0x597275[_0x876d('0x13')][_0x876d('0x14')]()==='in'||_0x597275[_0x876d('0x13')][_0x876d('0x14')]()==='out'&&!_0x597275['secret']&&!_[_0x876d('0x15')](_0x597275[_0x876d('0x16')])&&!_[_0x876d('0x15')](_0x597275[_0x876d('0x17')])){_0x561a25[_0x876d('0x18')][_0x876d('0x19')]({'where':{'id':_0x597275[_0x876d('0x17')]}})[_0x876d('0x1a')](function(_0x43f6a8){if(_0x43f6a8){_0x43f6a8[_0x876d('0x1b')]({'lastMsgAt':_0x597275[_0x876d('0x1c')],'lastMsgDirection':_0x597275[_0x876d('0x13')][_0x876d('0x14')]()});}})['catch'](function(_0x6af251){console[_0x876d('0x1d')](_0x6af251);});}if(_0x597275['direction']===_0x876d('0x1e')&&!_0x597275[_0x876d('0x1f')]){var _0x1bb1b9;_0x561a25[_0x876d('0x20')][_0x876d('0x21')]({'where':{'id':_0x597275['SmsAccountId']},'raw':!![]})['then'](function(_0x373049){_0x1bb1b9=_0x373049;if(_0x1bb1b9&&_0x1bb1b9[_0x876d('0x22')]){switch(_0x1bb1b9['type']){case'twilio':var _0x1d7577=require('twilio');if(_0x1bb1b9[_0x876d('0x23')]&&_0x1bb1b9[_0x876d('0x24')]&&_0x1bb1b9[_0x876d('0x25')]){var _0x27b868=new _0x1d7577(_0x1bb1b9[_0x876d('0x23')],_0x1bb1b9['authToken']);_0x27b868[_0x876d('0x26')][_0x876d('0x27')]({'body':_0x597275['body'],'to':_0x597275[_0x876d('0x25')],'from':_0x1bb1b9[_0x876d('0x25')],'statusCallback':_0x1bb1b9[_0x876d('0x28')]+_0x876d('0x29')+_0x597275['id']+_0x876d('0x2a')+_0x1bb1b9['token']})[_0x876d('0x1a')](function(_0xa30ed2){if(_0xa30ed2[_0x876d('0x2b')]){return _0x49a058[_0x876d('0x1b')]({'messageId':_0xa30ed2['sid']});}})['catch'](function(_0x266427){logger[_0x876d('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x876d('0x2c'),_0x876d('0x2d'),util[_0x876d('0x2e')](_0x266427,{'showHidden':![],'depth':null}));});}else{logger[_0x876d('0x1d')](_0x876d('0x2f'),_0x876d('0x2c'),'twilio',_0x876d('0x30'));}break;case _0x876d('0x31'):var _0x11030f=_0x876d('0x32');if(_0x1bb1b9[_0x876d('0x33')]&&_0x1bb1b9[_0x876d('0x34')]){var _0x577230={'recipient':[_0x597275[_0x876d('0x25')]],'message':_0x597275[_0x876d('0xf')],'message_type':_0x1bb1b9[_0x876d('0x35')]};if(_0x1bb1b9[_0x876d('0x35')]&&_0x1bb1b9['smsMethod']!=='SI'){_0x577230['sender']=_0x1bb1b9[_0x876d('0x25')];}var _0x3e1f20={'url':_0x11030f+_0x876d('0x36')+_0x1bb1b9[_0x876d('0x33')]+_0x876d('0x37')+_0x1bb1b9[_0x876d('0x34')],'method':'GET'};rp(_0x3e1f20)['then'](function(_0x39539a){var _0x3630f2=_0x39539a[_0x876d('0x38')](';');var _0x5dad25={'user_key':_0x3630f2[0x0],'session_key':_0x3630f2[0x1]};_0x3e1f20={'url':_0x11030f+_0x876d('0x39'),'method':_0x876d('0x3a'),'headers':{'user_key':_0x5dad25[_0x876d('0x3b')],'Session_key':_0x5dad25[_0x876d('0x3c')]},'json':!![],'body':_0x577230};return rp(_0x3e1f20);})[_0x876d('0x1a')](function(_0x403b0f){if(_0x403b0f[_0x876d('0x3d')]>=0x1){var _0x28a4f2={'messageId':_0x403b0f[_0x876d('0x3e')]};if(_0x1bb1b9[_0x876d('0x35')]!=='GP'||!_0x1bb1b9[_0x876d('0x3f')]){_0x28a4f2[_0x876d('0x40')]=!![];}return _0x49a058[_0x876d('0x1b')](_0x28a4f2);}else{return logger['error'](_0x876d('0x2f'),_0x876d('0x2c'),'skebby',util[_0x876d('0x2e')](_0x403b0f,{'showHidden':![],'depth':null}));}})[_0x876d('0x41')](function(_0xb3812f){return logger[_0x876d('0x1d')](_0x876d('0x2f'),_0x876d('0x2c'),_0x876d('0x31'),util[_0x876d('0x2e')](_0xb3812f,{'showHidden':![],'depth':null}));});}else{logger[_0x876d('0x1d')](_0x876d('0x2f'),_0x876d('0x2c'),'skebby',_0x876d('0x42'));}break;case _0x876d('0x43'):if(_0x1bb1b9[_0x876d('0x24')]){var _0x5eb559={'recipient':_0x597275[_0x876d('0x25')],'message':_0x597275['body'],'sender':_0x1bb1b9[_0x876d('0x44')]||_0x1bb1b9[_0x876d('0x25')],'authorization':_0x1bb1b9['authToken']};var _0x463ead={'method':_0x876d('0x3a'),'uri':_0x876d('0x45'),'body':_0x5eb559,'json':!![]};rp(_0x463ead)[_0x876d('0x1a')](function(_0x8ae2d7){var _0x57fee3={'messageId':_0x8ae2d7[_0x876d('0x46')]};if(!_0x1bb1b9[_0x876d('0x3f')]){_0x57fee3[_0x876d('0x40')]=!![];}return _0x49a058[_0x876d('0x1b')](_0x57fee3);})['catch'](function(_0x1a9da3){logger['error'](_0x876d('0x2f'),'afterCreate',_0x876d('0x43'),util[_0x876d('0x2e')](_0x1a9da3,{'showHidden':![],'depth':null}));});}else{logger[_0x876d('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x876d('0x2c'),_0x876d('0x43'),_0x876d('0x47'));}break;case _0x876d('0x48'):if(_0x1bb1b9[_0x876d('0x33')]&&_0x1bb1b9[_0x876d('0x34')]){var _0x5eb559={'messages':[{'source':'xCALLY\x20Motion','to':_0x597275['phone'],'body':_0x597275['body'],'from':_0x1bb1b9['senderString']||_0x1bb1b9[_0x876d('0x25')]}]};var _0x19c020=util[_0x876d('0x49')](_0x876d('0x4a'),_0x1bb1b9[_0x876d('0x33')],_0x1bb1b9[_0x876d('0x34')]);var _0x463ead={'method':_0x876d('0x3a'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x5eb559,'headers':{'Authorization':util[_0x876d('0x49')](_0x876d('0x4b'),new Buffer(_0x19c020)[_0x876d('0x4c')](_0x876d('0x4d')))},'json':!![]};rp(_0x463ead)[_0x876d('0x1a')](function(_0x4cca2d){if(_0x4cca2d[_0x876d('0x4e')]>=0xc8&&_0x4cca2d[_0x876d('0x4e')]<=0xce){if(_0x4cca2d[_0x876d('0x4f')]&&_0x4cca2d[_0x876d('0x4f')][_0x876d('0x50')]>0x0){var _0x1516d4=_[_0x876d('0x51')](_0x4cca2d[_0x876d('0x4f')][_0x876d('0x26')]);var _0x24d8cf={'messageId':_0x1516d4[_0x876d('0x52')]};if(!_0x1bb1b9[_0x876d('0x3f')]){_0x24d8cf[_0x876d('0x40')]=!![];}return _0x49a058[_0x876d('0x1b')](_0x24d8cf);}else{logger[_0x876d('0x1d')](_0x876d('0x2f'),'afterCreate',_0x876d('0x53'),util[_0x876d('0x2e')](_0x4cca2d,{'showHidden':![],'depth':null}));}}else{logger[_0x876d('0x1d')](_0x876d('0x2f'),_0x876d('0x2c'),_0x876d('0x53'),util[_0x876d('0x2e')](_0x4cca2d,{'showHidden':![],'depth':null}));}})[_0x876d('0x41')](function(_0x1e56e1){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x876d('0x2c'),_0x876d('0x53'),util['inspect'](_0x1e56e1,{'showHidden':![],'depth':null}));});}else{logger[_0x876d('0x1d')](_0x876d('0x2f'),_0x876d('0x2c'),_0x876d('0x53'),_0x876d('0x42'));}break;case _0x876d('0x54'):if(_0x1bb1b9[_0x876d('0x55')]&&_0x1bb1b9[_0x876d('0x24')]){var _0x5eb559={'dst':_0x597275[_0x876d('0x25')],'text':_0x597275['body'],'src':_0x1bb1b9[_0x876d('0x44')]||_0x1bb1b9['phone'],'url':_0x1bb1b9[_0x876d('0x28')]+_0x876d('0x29')+_0x597275['id']+_0x876d('0x2a')+_0x1bb1b9[_0x876d('0x56')]};var _0x19c020=util[_0x876d('0x49')](_0x876d('0x4a'),_0x1bb1b9[_0x876d('0x55')],_0x1bb1b9[_0x876d('0x24')]);var _0x463ead={'method':'POST','uri':util['format']('https://api.plivo.com/v1/Account/%s/Message/',_0x1bb1b9['authId']),'body':_0x5eb559,'headers':{'Authorization':util['format'](_0x876d('0x4b'),new Buffer(_0x19c020)[_0x876d('0x4c')](_0x876d('0x4d')))},'json':!![]};rp(_0x463ead)['then'](function(_0x199f4e){var _0x3d3c6f={'messageId':_0x199f4e[_0x876d('0x57')][0x0]};return _0x49a058['update'](_0x3d3c6f);})[_0x876d('0x41')](function(_0x30e0bb){logger[_0x876d('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x876d('0x2c'),_0x876d('0x54'),util['inspect'](_0x30e0bb,{'showHidden':![],'depth':null}));});}else{logger[_0x876d('0x1d')](_0x876d('0x2f'),'afterCreate',_0x876d('0x54'),_0x876d('0x58'));}break;case _0x876d('0x59'):if(_0x1bb1b9[_0x876d('0x33')]&&_0x1bb1b9[_0x876d('0x34')]){if(_0x1bb1b9[_0x876d('0x5a')]){var _0xa27656={'method':'POST','uri':_0x1bb1b9[_0x876d('0x5a')]+_0x876d('0x5b'),'body':{'username':_0x1bb1b9['username'],'password':_0x1bb1b9[_0x876d('0x34')]},'json':!![]};return rp(_0xa27656)[_0x876d('0x1a')](function(_0x18ae1e){var _0x2cdd29={'method':_0x876d('0x3a'),'uri':_0x1bb1b9['baseUrl']+_0x876d('0x5c'),'body':{'messages':[{'from':_0x1bb1b9[_0x876d('0x25')],'destinations':[{'to':_0x597275[_0x876d('0x25')]}],'text':_0x597275['body'],'notifyUrl':_0x1bb1b9[_0x876d('0x28')]+_0x876d('0x29')+_0x597275['id']+_0x876d('0x2a')+_0x1bb1b9[_0x876d('0x56')],'notifyContentType':_0x876d('0x5d'),'callbackData':_0x1bb1b9['phone']+';'+_0x597275[_0x876d('0xf')]}]},'headers':{'Authorization':_0x876d('0x5e')+_0x18ae1e[_0x876d('0x56')]},'json':!![]};return rp(_0x2cdd29)['then'](function(_0x41e025){if(_0x41e025[_0x876d('0x26')]){var _0x440196={'messageId':_0x41e025[_0x876d('0x26')][0x0][_0x876d('0xd')]};if(!_0x1bb1b9['deliveryReport']){_0x440196[_0x876d('0x40')]=!![];}return _0x49a058['update'](_0x440196);}else{return logger[_0x876d('0x1d')](_0x876d('0x2f'),_0x876d('0x2c'),_0x876d('0x59'),util[_0x876d('0x2e')](_0x41e025,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x326eb3){return logger[_0x876d('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x876d('0x2c'),_0x876d('0x59'),util['inspect'](_0x326eb3,{'showHidden':![],'depth':null}));});}else{logger[_0x876d('0x1d')](_0x876d('0x2f'),_0x876d('0x2c'),_0x876d('0x59'),_0x876d('0x5f'));}}else{logger[_0x876d('0x1d')](_0x876d('0x2f'),_0x876d('0x2c'),_0x876d('0x59'),_0x876d('0x42'));}break;case _0x876d('0x60'):var _0x5179c6=require(_0x876d('0x61'));if(_0x1bb1b9['apiKey']){var _0x3ecf7a={};_0x3ecf7a[_0x876d('0x62')]=_0x1bb1b9['username'];_0x3ecf7a[_0x876d('0x25')]=_0x597275[_0x876d('0x25')];_0x3ecf7a[_0x876d('0x63')]=_0x1bb1b9[_0x876d('0x25')];_0x3ecf7a[_0x876d('0x64')]=_0x597275[_0x876d('0xf')];_0x3ecf7a[_0x876d('0x65')]=+new Date();var _0x3f954e='';var _0x176fd5='';var _0x86007e=Object[_0x876d('0x66')](_0x3ecf7a);_0x86007e[_0x876d('0x67')]();for(var _0x219478=0x0;_0x219478<_0x86007e[_0x876d('0x68')];_0x219478++){if(_0x3f954e!=''){_0x3f954e+='&';}_0x3f954e+=_0x86007e[_0x219478]+'='+encodeURIComponent(_0x3ecf7a[_0x86007e[_0x219478]]);_0x176fd5+=_0x3ecf7a[_0x86007e[_0x219478]];}_0x176fd5+=_0x1bb1b9['apiKey'];_0x176fd5=_0x5179c6['createHash'](_0x876d('0x69'))['update'](_0x176fd5)[_0x876d('0x6a')]('hex');if(_0x3f954e!==''){_0x3f954e+='&';}_0x3f954e+='signature='+_0x176fd5;var _0x3e1f20={'method':_0x876d('0x6b'),'uri':_0x1bb1b9['baseUrl']+_0x876d('0x6c')+_0x3f954e,'json':!![]};return rp(_0x3e1f20)['then'](function(_0x4be323){var _0xe83980=Object[_0x876d('0x66')](_0x4be323);if(_0x4be323[_0xe83980[0x0]][_0x876d('0x1d')]&&parseInt(_0x4be323[_0xe83980[0x0]][_0x876d('0x1d')])===0x0){var _0x13bcc2={'messageId':_0x4be323[_0xe83980[0x0]]['id_sms']};if(!_0x1bb1b9[_0x876d('0x3f')]){_0x13bcc2[_0x876d('0x40')]=!![];}return _0x49a058[_0x876d('0x1b')](_0x13bcc2);}else{return logger[_0x876d('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','csc',util[_0x876d('0x2e')](_0x4be323[_0x876d('0x1d')],{'showHidden':![],'depth':null}));}})[_0x876d('0x41')](function(_0x27099c){return logger[_0x876d('0x1d')](_0x876d('0x2f'),_0x876d('0x2c'),_0x876d('0x60'),util[_0x876d('0x2e')](_0x27099c,{'showHidden':![],'depth':null}));});}else{logger[_0x876d('0x1d')](_0x876d('0x2f'),_0x876d('0x2c'),_0x876d('0x60'),_0x876d('0x6d'));}break;case _0x876d('0x6e'):if(_0x1bb1b9['apiKey']){var _0x8fb7bc={'method':_0x876d('0x3a'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x1bb1b9[_0x876d('0x6f')]},'body':{'content':_0x597275[_0x876d('0xf')],'to':[_0x597275[_0x876d('0x25')]],'from':_0x1bb1b9[_0x876d('0x25')],'binary':![],'clientMessageId':_0x876d('0x70'),'charset':_0x876d('0x71')},'json':!![]};rp(_0x8fb7bc)[_0x876d('0x1a')](function(_0x3712a8){if(!_0x3712a8[_0x876d('0x1d')]){var _0x2ca2a3={'messageId':_0x3712a8[_0x876d('0x26')][0x0]['apiMessageId']};if(!_0x1bb1b9['deliveryReport']){_0x2ca2a3[_0x876d('0x40')]=!![];}return _0x49a058[_0x876d('0x1b')](_0x2ca2a3);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x876d('0x2c'),_0x876d('0x6e'),util[_0x876d('0x2e')](_0x3712a8[_0x876d('0x1d')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x598d2f){return logger[_0x876d('0x1d')](_0x876d('0x2f'),_0x876d('0x2c'),_0x876d('0x6e'),util[_0x876d('0x2e')](_0x598d2f,{'showHidden':![],'depth':null}));});}else{logger[_0x876d('0x1d')](_0x876d('0x2f'),_0x876d('0x2c'),_0x876d('0x6e'),_0x876d('0x6d'));}break;case _0x876d('0x72'):if(_0x1bb1b9[_0x876d('0x33')]&&_0x1bb1b9['password']){var _0x19c020=util['format'](_0x876d('0x4a'),_0x1bb1b9[_0x876d('0x33')],_0x1bb1b9['password']);var _0x463ead={'method':'POST','uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x1bb1b9[_0x876d('0x73')]+_0x876d('0x74'),'body':{'to':[_0x597275[_0x876d('0x25')]],'text':_0x597275[_0x876d('0xf')],'from':_0x1bb1b9[_0x876d('0x25')],'applicationId':_0x1bb1b9['applicationId']},'headers':{'Authorization':util[_0x876d('0x49')](_0x876d('0x4b'),new Buffer(_0x19c020)[_0x876d('0x4c')](_0x876d('0x4d')))},'json':!![]};rp(_0x463ead)['then'](function(_0x1a080b){if(_0x1a080b['id']){var _0x393ac7={'messageId':_0x1a080b['id']};return _0x49a058[_0x876d('0x1b')](_0x393ac7);}else{logger[_0x876d('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x876d('0x2c'),_0x876d('0x72'),util['inspect'](_0x1a080b,{'showHidden':![],'depth':null}));}})['catch'](function(_0x499bde){logger[_0x876d('0x1d')](_0x876d('0x2f'),_0x876d('0x2c'),_0x876d('0x72'),util[_0x876d('0x2e')](_0x499bde,{'showHidden':![],'depth':null}));});}else{logger[_0x876d('0x1d')](_0x876d('0x2f'),_0x876d('0x2c'),_0x876d('0x72'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x876d('0x75'):if(_0x1bb1b9[_0x876d('0x6f')]){var _0x5d395b={};var _0x3e1f20={'method':_0x876d('0x3a'),'uri':_0x876d('0x76'),'headers':{'Authorization':'Bearer\x20'+_0x1bb1b9[_0x876d('0x6f')],'Content-Type':_0x876d('0x5d')},'body':{'from':_0x1bb1b9[_0x876d('0x25')],'to':_0x597275[_0x876d('0x25')],'text':_0x597275['body']},'json':!![]};return rp(_0x3e1f20)[_0x876d('0x1a')](function(_0x4344b0){if(_0x4344b0['code']==0xca){_0x5d395b[_0x876d('0x77')]=_0x4344b0;var _0x527e1e={'method':_0x876d('0x3a'),'uri':_0x876d('0x78'),'headers':{'Authorization':_0x876d('0x79')+_0x1bb1b9[_0x876d('0x6f')],'Content-Type':'application/json'},'body':{'refid':_0x5d395b[_0x876d('0x77')]['refid']},'json':!![]};return rp(_0x527e1e)[_0x876d('0x1a')](function(_0x31dc1b){_0x5d395b[_0x876d('0x7a')]=_0x31dc1b;var _0x17d424={'messageId':_0x5d395b['message'][_0x876d('0x7b')],'read':!![]};return _0x49a058[_0x876d('0x1b')](_0x17d424);});}else{return logger[_0x876d('0x1d')](_0x876d('0x2f'),_0x876d('0x2c'),_0x876d('0x75'),util[_0x876d('0x2e')](_0x4344b0,{'showHidden':![],'depth':null}));}})['catch'](function(_0xf81958){return logger['error'](_0x876d('0x2f'),_0x876d('0x2c'),_0x876d('0x75'),util[_0x876d('0x2e')](_0xf81958,{'showHidden':![],'depth':null}));});}else{return logger[_0x876d('0x1d')](_0x876d('0x2f'),_0x876d('0x2c'),_0x876d('0x75'),'Token\x20not\x20received');}break;}}})[_0x876d('0x7c')](function(){_0x3b9fc5();});}else{_0x3b9fc5();}}},'charset':_0x876d('0x7d'),'collate':_0x876d('0x7e')});}; \ No newline at end of file +var _0x61ef=['sort','createHash','signature=','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','bandwidth','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','get','direction','toLowerCase','secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','update','catch','error','out','SmsAccountId','then','type','twilio','authToken','accountSid','create','phone','remote','/status?token=','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','GET','sms','POST','user_key','total_sent','internal_order_id','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','Missing\x20parameters:\x20authToken','clicksend','format','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','/api/sms/messages/','token','%s:%s','message_uuid','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','messages','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','timestamp','keys'];(function(_0x5ca5bc,_0x5b8a9d){var _0x26ca86=function(_0x1ad9a6){while(--_0x1ad9a6){_0x5ca5bc['push'](_0x5ca5bc['shift']());}};_0x26ca86(++_0x5b8a9d);}(_0x61ef,0x1e7));var _0xf61e=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x61ef[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0xf61e('0x0'));var util=require(_0xf61e('0x1'));var logger=require('../../config/logger')(_0xf61e('0x2'));var moment=require('moment');var BPromise=require(_0xf61e('0x3'));var rp=require(_0xf61e('0x4'));var fs=require('fs');var path=require(_0xf61e('0x5'));var rimraf=require(_0xf61e('0x6'));var config=require(_0xf61e('0x7'));var attributes=require('./smsMessage.attributes');module[_0xf61e('0x8')]=function(_0x3a4b7a,_0x3f51d5){return _0x3a4b7a['define']('SmsMessage',attributes,{'tableName':_0xf61e('0x9'),'paranoid':![],'indexes':[{'name':_0xf61e('0xa'),'fields':['messageId']},{'name':_0xf61e('0xb'),'fields':[_0xf61e('0xc')],'type':_0xf61e('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x28d185,_0x483ac8,_0x186c33){var _0x3dfb9d=_0x3a4b7a['models'];var _0x2e472c=_0x28d185[_0xf61e('0xe')]({'plain':!![]});if(_0x2e472c['direction']['toLowerCase']()==='in'||_0x2e472c[_0xf61e('0xf')][_0xf61e('0x10')]()==='out'&&!_0x2e472c[_0xf61e('0x11')]&&!_[_0xf61e('0x12')](_0x2e472c[_0xf61e('0x13')])&&!_[_0xf61e('0x12')](_0x2e472c[_0xf61e('0x14')])){_0x3dfb9d[_0xf61e('0x15')][_0xf61e('0x16')]({'where':{'id':_0x2e472c['SmsInteractionId']}})['then'](function(_0x142d86){if(_0x142d86){_0x142d86[_0xf61e('0x17')]({'lastMsgAt':_0x2e472c['createdAt'],'lastMsgDirection':_0x2e472c[_0xf61e('0xf')][_0xf61e('0x10')]()});}})[_0xf61e('0x18')](function(_0x22378e){console[_0xf61e('0x19')](_0x22378e);});}if(_0x2e472c[_0xf61e('0xf')]===_0xf61e('0x1a')&&!_0x2e472c[_0xf61e('0x11')]){var _0xc40a59;_0x3dfb9d['SmsAccount']['find']({'where':{'id':_0x2e472c[_0xf61e('0x1b')]},'raw':!![]})[_0xf61e('0x1c')](function(_0x1c5369){_0xc40a59=_0x1c5369;if(_0xc40a59&&_0xc40a59[_0xf61e('0x1d')]){switch(_0xc40a59[_0xf61e('0x1d')]){case _0xf61e('0x1e'):var _0x14686a=require(_0xf61e('0x1e'));if(_0xc40a59['accountSid']&&_0xc40a59[_0xf61e('0x1f')]&&_0xc40a59['phone']){var _0x27644f=new _0x14686a(_0xc40a59[_0xf61e('0x20')],_0xc40a59[_0xf61e('0x1f')]);_0x27644f['messages'][_0xf61e('0x21')]({'body':_0x2e472c[_0xf61e('0xc')],'to':_0x2e472c[_0xf61e('0x22')],'from':_0xc40a59[_0xf61e('0x22')],'statusCallback':_0xc40a59[_0xf61e('0x23')]+'/api/sms/messages/'+_0x2e472c['id']+_0xf61e('0x24')+_0xc40a59['token']})[_0xf61e('0x1c')](function(_0x5b0ec6){if(_0x5b0ec6[_0xf61e('0x25')]){return _0x28d185[_0xf61e('0x17')]({'messageId':_0x5b0ec6[_0xf61e('0x25')]});}})[_0xf61e('0x18')](function(_0x7dc47a){logger['error'](_0xf61e('0x26'),'afterCreate',_0xf61e('0x1e'),util[_0xf61e('0x27')](_0x7dc47a,{'showHidden':![],'depth':null}));});}else{logger[_0xf61e('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf61e('0x28'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xf61e('0x29'):var _0x2a0125=_0xf61e('0x2a');if(_0xc40a59[_0xf61e('0x2b')]&&_0xc40a59[_0xf61e('0x2c')]){var _0x59eef4={'recipient':[_0x2e472c[_0xf61e('0x22')]],'message':_0x2e472c[_0xf61e('0xc')],'message_type':_0xc40a59[_0xf61e('0x2d')]};if(_0xc40a59['smsMethod']&&_0xc40a59[_0xf61e('0x2d')]!=='SI'){_0x59eef4[_0xf61e('0x2e')]=_0xc40a59[_0xf61e('0x22')];}var _0x5edf47={'url':_0x2a0125+_0xf61e('0x2f')+_0xc40a59[_0xf61e('0x2b')]+'&password='+_0xc40a59[_0xf61e('0x2c')],'method':_0xf61e('0x30')};rp(_0x5edf47)['then'](function(_0x6f63f2){var _0x593020=_0x6f63f2['split'](';');var _0x2d06ab={'user_key':_0x593020[0x0],'session_key':_0x593020[0x1]};_0x5edf47={'url':_0x2a0125+_0xf61e('0x31'),'method':_0xf61e('0x32'),'headers':{'user_key':_0x2d06ab[_0xf61e('0x33')],'Session_key':_0x2d06ab['session_key']},'json':!![],'body':_0x59eef4};return rp(_0x5edf47);})['then'](function(_0x53f57b){if(_0x53f57b[_0xf61e('0x34')]>=0x1){var _0x8e1a97={'messageId':_0x53f57b[_0xf61e('0x35')]};if(_0xc40a59[_0xf61e('0x2d')]!=='GP'||!_0xc40a59['deliveryReport']){_0x8e1a97[_0xf61e('0x36')]=!![];}return _0x28d185[_0xf61e('0x17')](_0x8e1a97);}else{return logger[_0xf61e('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf61e('0x28'),'skebby',util[_0xf61e('0x27')](_0x53f57b,{'showHidden':![],'depth':null}));}})['catch'](function(_0x722b77){return logger['error'](_0xf61e('0x26'),'afterCreate',_0xf61e('0x29'),util[_0xf61e('0x27')](_0x722b77,{'showHidden':![],'depth':null}));});}else{logger[_0xf61e('0x19')](_0xf61e('0x26'),_0xf61e('0x28'),'skebby',_0xf61e('0x37'));}break;case _0xf61e('0x38'):if(_0xc40a59[_0xf61e('0x1f')]){var _0x4e33e9={'recipient':_0x2e472c['phone'],'message':_0x2e472c[_0xf61e('0xc')],'sender':_0xc40a59[_0xf61e('0x39')]||_0xc40a59['phone'],'authorization':_0xc40a59['authToken']};var _0x483ac8={'method':_0xf61e('0x32'),'uri':_0xf61e('0x3a'),'body':_0x4e33e9,'json':!![]};rp(_0x483ac8)[_0xf61e('0x1c')](function(_0xbff8c5){var _0xb8a230={'messageId':_0xbff8c5[_0xf61e('0x3b')]};if(!_0xc40a59[_0xf61e('0x3c')]){_0xb8a230['read']=!![];}return _0x28d185[_0xf61e('0x17')](_0xb8a230);})[_0xf61e('0x18')](function(_0x13d3e7){logger[_0xf61e('0x19')](_0xf61e('0x26'),_0xf61e('0x28'),'connectel',util[_0xf61e('0x27')](_0x13d3e7,{'showHidden':![],'depth':null}));});}else{logger[_0xf61e('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf61e('0x28'),_0xf61e('0x38'),_0xf61e('0x3d'));}break;case _0xf61e('0x3e'):if(_0xc40a59[_0xf61e('0x2b')]&&_0xc40a59[_0xf61e('0x2c')]){var _0x4e33e9={'messages':[{'source':'xCALLY\x20Motion','to':_0x2e472c[_0xf61e('0x22')],'body':_0x2e472c[_0xf61e('0xc')],'from':_0xc40a59[_0xf61e('0x39')]||_0xc40a59[_0xf61e('0x22')]}]};var _0x51df54=util[_0xf61e('0x3f')]('%s:%s',_0xc40a59['username'],_0xc40a59['password']);var _0x483ac8={'method':_0xf61e('0x32'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x4e33e9,'headers':{'Authorization':util[_0xf61e('0x3f')](_0xf61e('0x40'),new Buffer(_0x51df54)[_0xf61e('0x41')](_0xf61e('0x42')))},'json':!![]};rp(_0x483ac8)[_0xf61e('0x1c')](function(_0x541561){if(_0x541561[_0xf61e('0x43')]>=0xc8&&_0x541561[_0xf61e('0x43')]<=0xce){if(_0x541561[_0xf61e('0x44')]&&_0x541561[_0xf61e('0x44')][_0xf61e('0x45')]>0x0){var _0x443c7a=_[_0xf61e('0x46')](_0x541561['data']['messages']);var _0x4a4ea8={'messageId':_0x443c7a[_0xf61e('0x47')]};if(!_0xc40a59[_0xf61e('0x3c')]){_0x4a4ea8[_0xf61e('0x36')]=!![];}return _0x28d185['update'](_0x4a4ea8);}else{logger[_0xf61e('0x19')](_0xf61e('0x26'),_0xf61e('0x28'),'clickSend',util[_0xf61e('0x27')](_0x541561,{'showHidden':![],'depth':null}));}}else{logger[_0xf61e('0x19')](_0xf61e('0x26'),_0xf61e('0x28'),_0xf61e('0x48'),util[_0xf61e('0x27')](_0x541561,{'showHidden':![],'depth':null}));}})[_0xf61e('0x18')](function(_0x2173b3){logger[_0xf61e('0x19')](_0xf61e('0x26'),_0xf61e('0x28'),'clickSend',util[_0xf61e('0x27')](_0x2173b3,{'showHidden':![],'depth':null}));});}else{logger[_0xf61e('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf61e('0x28'),_0xf61e('0x48'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xf61e('0x49'):if(_0xc40a59[_0xf61e('0x4a')]&&_0xc40a59['authToken']){var _0x4e33e9={'dst':_0x2e472c[_0xf61e('0x22')],'text':_0x2e472c[_0xf61e('0xc')],'src':_0xc40a59['senderString']||_0xc40a59[_0xf61e('0x22')],'url':_0xc40a59['remote']+_0xf61e('0x4b')+_0x2e472c['id']+_0xf61e('0x24')+_0xc40a59[_0xf61e('0x4c')]};var _0x51df54=util[_0xf61e('0x3f')](_0xf61e('0x4d'),_0xc40a59[_0xf61e('0x4a')],_0xc40a59[_0xf61e('0x1f')]);var _0x483ac8={'method':_0xf61e('0x32'),'uri':util[_0xf61e('0x3f')]('https://api.plivo.com/v1/Account/%s/Message/',_0xc40a59['authId']),'body':_0x4e33e9,'headers':{'Authorization':util['format'](_0xf61e('0x40'),new Buffer(_0x51df54)[_0xf61e('0x41')](_0xf61e('0x42')))},'json':!![]};rp(_0x483ac8)['then'](function(_0x58d62f){var _0x20364c={'messageId':_0x58d62f[_0xf61e('0x4e')][0x0]};return _0x28d185[_0xf61e('0x17')](_0x20364c);})[_0xf61e('0x18')](function(_0x282c8f){logger[_0xf61e('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf61e('0x28'),_0xf61e('0x49'),util['inspect'](_0x282c8f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xf61e('0x26'),'afterCreate','plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xf61e('0x4f'):if(_0xc40a59[_0xf61e('0x2b')]&&_0xc40a59[_0xf61e('0x2c')]){if(_0xc40a59['baseUrl']){var _0x41e340={'method':_0xf61e('0x32'),'uri':_0xc40a59[_0xf61e('0x50')]+_0xf61e('0x51'),'body':{'username':_0xc40a59['username'],'password':_0xc40a59['password']},'json':!![]};return rp(_0x41e340)[_0xf61e('0x1c')](function(_0x366071){var _0x457327={'method':'POST','uri':_0xc40a59[_0xf61e('0x50')]+_0xf61e('0x52'),'body':{'messages':[{'from':_0xc40a59[_0xf61e('0x22')],'destinations':[{'to':_0x2e472c[_0xf61e('0x22')]}],'text':_0x2e472c[_0xf61e('0xc')],'notifyUrl':_0xc40a59['remote']+_0xf61e('0x4b')+_0x2e472c['id']+'/status?token='+_0xc40a59['token'],'notifyContentType':_0xf61e('0x53'),'callbackData':_0xc40a59[_0xf61e('0x22')]+';'+_0x2e472c[_0xf61e('0xc')]}]},'headers':{'Authorization':_0xf61e('0x54')+_0x366071[_0xf61e('0x4c')]},'json':!![]};return rp(_0x457327)[_0xf61e('0x1c')](function(_0x37ed85){if(_0x37ed85[_0xf61e('0x55')]){var _0x28d0f6={'messageId':_0x37ed85[_0xf61e('0x55')][0x0][_0xf61e('0xa')]};if(!_0xc40a59[_0xf61e('0x3c')]){_0x28d0f6[_0xf61e('0x36')]=!![];}return _0x28d185['update'](_0x28d0f6);}else{return logger['error'](_0xf61e('0x26'),'afterCreate',_0xf61e('0x4f'),util[_0xf61e('0x27')](_0x37ed85,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x54df54){return logger['error'](_0xf61e('0x26'),_0xf61e('0x28'),'infobip',util[_0xf61e('0x27')](_0x54df54,{'showHidden':![],'depth':null}));});}else{logger[_0xf61e('0x19')](_0xf61e('0x26'),_0xf61e('0x28'),_0xf61e('0x4f'),_0xf61e('0x56'));}}else{logger[_0xf61e('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf61e('0x28'),_0xf61e('0x4f'),'Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x5c6d1e=require(_0xf61e('0x57'));if(_0xc40a59[_0xf61e('0x58')]){var _0x10a2bb={};_0x10a2bb[_0xf61e('0x59')]=_0xc40a59[_0xf61e('0x2b')];_0x10a2bb['phone']=_0x2e472c[_0xf61e('0x22')];_0x10a2bb[_0xf61e('0x2e')]=_0xc40a59['phone'];_0x10a2bb[_0xf61e('0x5a')]=_0x2e472c[_0xf61e('0xc')];_0x10a2bb[_0xf61e('0x5b')]=+new Date();var _0x397b6b='';var _0x28679f='';var _0x442259=Object[_0xf61e('0x5c')](_0x10a2bb);_0x442259[_0xf61e('0x5d')]();for(var _0x278946=0x0;_0x278946<_0x442259['length'];_0x278946++){if(_0x397b6b!=''){_0x397b6b+='&';}_0x397b6b+=_0x442259[_0x278946]+'='+encodeURIComponent(_0x10a2bb[_0x442259[_0x278946]]);_0x28679f+=_0x10a2bb[_0x442259[_0x278946]];}_0x28679f+=_0xc40a59[_0xf61e('0x58')];_0x28679f=_0x5c6d1e[_0xf61e('0x5e')]('md5')[_0xf61e('0x17')](_0x28679f)['digest']('hex');if(_0x397b6b!==''){_0x397b6b+='&';}_0x397b6b+=_0xf61e('0x5f')+_0x28679f;var _0x5edf47={'method':_0xf61e('0x30'),'uri':_0xc40a59['baseUrl']+'/external/get/send.php?'+_0x397b6b,'json':!![]};return rp(_0x5edf47)['then'](function(_0x6261b6){var _0x5f4d71=Object[_0xf61e('0x5c')](_0x6261b6);if(_0x6261b6[_0x5f4d71[0x0]][_0xf61e('0x19')]&&parseInt(_0x6261b6[_0x5f4d71[0x0]][_0xf61e('0x19')])===0x0){var _0x5bdb1f={'messageId':_0x6261b6[_0x5f4d71[0x0]][_0xf61e('0x60')]};if(!_0xc40a59[_0xf61e('0x3c')]){_0x5bdb1f[_0xf61e('0x36')]=!![];}return _0x28d185['update'](_0x5bdb1f);}else{return logger['error'](_0xf61e('0x26'),_0xf61e('0x28'),'csc',util[_0xf61e('0x27')](_0x6261b6[_0xf61e('0x19')],{'showHidden':![],'depth':null}));}})[_0xf61e('0x18')](function(_0x3b932c){return logger[_0xf61e('0x19')](_0xf61e('0x26'),_0xf61e('0x28'),'csc',util[_0xf61e('0x27')](_0x3b932c,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xf61e('0x26'),_0xf61e('0x28'),'csc',_0xf61e('0x61'));}break;case _0xf61e('0x62'):if(_0xc40a59[_0xf61e('0x58')]){var _0x197f37={'method':_0xf61e('0x32'),'uri':_0xf61e('0x63'),'headers':{'Authorization':_0xc40a59[_0xf61e('0x58')]},'body':{'content':_0x2e472c[_0xf61e('0xc')],'to':[_0x2e472c[_0xf61e('0x22')]],'from':_0xc40a59[_0xf61e('0x22')],'binary':![],'clientMessageId':_0xf61e('0x64'),'charset':_0xf61e('0x65')},'json':!![]};rp(_0x197f37)[_0xf61e('0x1c')](function(_0x4b5ba0){if(!_0x4b5ba0['error']){var _0x260ba8={'messageId':_0x4b5ba0[_0xf61e('0x55')][0x0]['apiMessageId']};if(!_0xc40a59[_0xf61e('0x3c')]){_0x260ba8['read']=!![];}return _0x28d185[_0xf61e('0x17')](_0x260ba8);}else{return logger['error'](_0xf61e('0x26'),_0xf61e('0x28'),_0xf61e('0x62'),util[_0xf61e('0x27')](_0x4b5ba0[_0xf61e('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x29d8f6){return logger[_0xf61e('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf61e('0x28'),'clickatell',util[_0xf61e('0x27')](_0x29d8f6,{'showHidden':![],'depth':null}));});}else{logger[_0xf61e('0x19')](_0xf61e('0x26'),_0xf61e('0x28'),_0xf61e('0x62'),_0xf61e('0x61'));}break;case _0xf61e('0x66'):if(_0xc40a59[_0xf61e('0x2b')]&&_0xc40a59[_0xf61e('0x2c')]){var _0x51df54=util['format']('%s:%s',_0xc40a59[_0xf61e('0x2b')],_0xc40a59['password']);var _0x483ac8={'method':_0xf61e('0x32'),'uri':_0xf61e('0x67')+_0xc40a59['accountId']+_0xf61e('0x68'),'body':{'to':[_0x2e472c[_0xf61e('0x22')]],'text':_0x2e472c[_0xf61e('0xc')],'from':_0xc40a59['phone'],'applicationId':_0xc40a59[_0xf61e('0x69')]},'headers':{'Authorization':util[_0xf61e('0x3f')](_0xf61e('0x40'),new Buffer(_0x51df54)[_0xf61e('0x41')]('base64'))},'json':!![]};rp(_0x483ac8)['then'](function(_0x11519c){if(_0x11519c['id']){var _0x4d62be={'messageId':_0x11519c['id']};return _0x28d185[_0xf61e('0x17')](_0x4d62be);}else{logger[_0xf61e('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xf61e('0x66'),util['inspect'](_0x11519c,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2a7ea4){logger[_0xf61e('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf61e('0x28'),_0xf61e('0x66'),util[_0xf61e('0x27')](_0x2a7ea4,{'showHidden':![],'depth':null}));});}else{logger[_0xf61e('0x19')](_0xf61e('0x26'),_0xf61e('0x28'),_0xf61e('0x66'),_0xf61e('0x37'));}break;case'intelepeer':if(_0xc40a59[_0xf61e('0x58')]){var _0x251bad={};var _0x5edf47={'method':_0xf61e('0x32'),'uri':_0xf61e('0x6a'),'headers':{'Authorization':_0xf61e('0x6b')+_0xc40a59[_0xf61e('0x58')],'Content-Type':_0xf61e('0x53')},'body':{'from':_0xc40a59['phone'],'to':_0x2e472c[_0xf61e('0x22')],'text':_0x2e472c[_0xf61e('0xc')]},'json':!![]};return rp(_0x5edf47)[_0xf61e('0x1c')](function(_0x45f01e){if(_0x45f01e[_0xf61e('0x6c')]==0xca){_0x251bad[_0xf61e('0x6d')]=_0x45f01e;var _0x24d16c={'method':_0xf61e('0x32'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xf61e('0x6b')+_0xc40a59[_0xf61e('0x58')],'Content-Type':_0xf61e('0x53')},'body':{'refid':_0x251bad['message'][_0xf61e('0x6e')]},'json':!![]};return rp(_0x24d16c)[_0xf61e('0x1c')](function(_0x13c9ff){_0x251bad[_0xf61e('0x6f')]=_0x13c9ff;var _0xea8398={'messageId':_0x251bad['message'][_0xf61e('0x6e')],'read':!![]};return _0x28d185[_0xf61e('0x17')](_0xea8398);});}else{return logger[_0xf61e('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf61e('0x28'),_0xf61e('0x70'),util[_0xf61e('0x27')](_0x45f01e,{'showHidden':![],'depth':null}));}})[_0xf61e('0x18')](function(_0xe8edc3){return logger[_0xf61e('0x19')](_0xf61e('0x26'),_0xf61e('0x28'),'intelepeer',util[_0xf61e('0x27')](_0xe8edc3,{'showHidden':![],'depth':null}));});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf61e('0x28'),_0xf61e('0x70'),_0xf61e('0x71'));}break;}}})[_0xf61e('0x72')](function(){_0x186c33();});}else{_0x186c33();}}},'charset':_0xf61e('0x73'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index efebb95..8a246b3 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 _0xf905=['../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','info','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','CreateSmsMessage','body','options','raw','debug','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x175a55,_0x4082fd){var _0x167adf=function(_0x18ef07){while(--_0x18ef07){_0x175a55['push'](_0x175a55['shift']());}};_0x167adf(++_0x4082fd);}(_0xf905,0x1ac));var _0x5f90=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0xf905[_0x1573ea];return _0x51c0e2;};'use strict';var _=require(_0x5f90('0x0'));var util=require(_0x5f90('0x1'));var moment=require('moment');var BPromise=require(_0x5f90('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f90('0x3'));var db=require(_0x5f90('0x4'))['db'];var utils=require(_0x5f90('0x5'));var logger=require(_0x5f90('0x6'))('rpc');var config=require(_0x5f90('0x7'));var jayson=require(_0x5f90('0x8'));var client=jayson[_0x5f90('0x9')][_0x5f90('0xa')]({'port':0x232a});config[_0x5f90('0xb')]=_[_0x5f90('0xc')](config[_0x5f90('0xb')],{'host':_0x5f90('0xd'),'port':0x18eb});var socket=require(_0x5f90('0xe'))(new Redis(config[_0x5f90('0xb')]));require('./smsMessage.socket')[_0x5f90('0xf')](socket);function respondWithRpcPromise(_0x451060,_0x3d2997,_0xc6a7f5){return new BPromise(function(_0x117f2e,_0x2221b9){return client['request'](_0x451060,_0xc6a7f5)['then'](function(_0xabc5c){logger[_0x5f90('0x10')]('SmsMessage,\x20%s,\x20%s',_0x3d2997,_0x5f90('0x11'));logger['debug'](_0x5f90('0x12'),_0x3d2997,_0x5f90('0x11'),JSON[_0x5f90('0x13')](_0xabc5c));if(_0xabc5c[_0x5f90('0x14')]){if(_0xabc5c['error'][_0x5f90('0x15')]===0x1f4){logger[_0x5f90('0x14')](_0x5f90('0x16'),_0x3d2997,_0xabc5c['error'][_0x5f90('0x17')]);return _0x2221b9(_0xabc5c['error'][_0x5f90('0x17')]);}logger[_0x5f90('0x14')](_0x5f90('0x16'),_0x3d2997,_0xabc5c[_0x5f90('0x14')][_0x5f90('0x17')]);return _0x117f2e(_0xabc5c[_0x5f90('0x14')][_0x5f90('0x17')]);}else{logger[_0x5f90('0x10')](_0x5f90('0x16'),_0x3d2997,_0x5f90('0x11'));_0x117f2e(_0xabc5c[_0x5f90('0x18')][_0x5f90('0x17')]);}})[_0x5f90('0x19')](function(_0x2ba91a){logger['error'](_0x5f90('0x16'),_0x3d2997,_0x2ba91a);_0x2221b9(_0x2ba91a);});});}exports[_0x5f90('0x1a')]=function(_0x134007){var _0x585adf=this;return new Promise(function(_0x4ad705,_0x4e94de){return db['SmsMessage']['create'](_0x134007[_0x5f90('0x1b')],{'raw':_0x134007[_0x5f90('0x1c')]?_0x134007[_0x5f90('0x1c')][_0x5f90('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x5391f7){logger[_0x5f90('0x10')]('CreateSmsMessage',_0x134007);logger[_0x5f90('0x1e')](_0x5f90('0x1a'),_0x134007,JSON['stringify'](_0x5391f7));_0x4ad705(_0x5391f7);})[_0x5f90('0x19')](function(_0x27dd47){logger[_0x5f90('0x14')](_0x5f90('0x1a'),_0x27dd47['message'],_0x134007);_0x4e94de(_0x585adf[_0x5f90('0x14')](0x1f4,_0x27dd47[_0x5f90('0x17')]));});});}; \ No newline at end of file +var _0x34c3=['stringify','error','code','SmsMessage,\x20%s,\x20%s','message','catch','CreateSmsMessage','SmsMessage','body','options','raw','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s'];(function(_0x361514,_0x4795be){var _0x22a9dc=function(_0x23f5a3){while(--_0x23f5a3){_0x361514['push'](_0x361514['shift']());}};_0x22a9dc(++_0x4795be);}(_0x34c3,0x1ab));var _0x334c=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x34c3[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x334c('0x0'));var BPromise=require('bluebird');var rs=require(_0x334c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x334c('0x2'));var logger=require(_0x334c('0x3'))(_0x334c('0x4'));var config=require(_0x334c('0x5'));var jayson=require(_0x334c('0x6'));var client=jayson[_0x334c('0x7')][_0x334c('0x8')]({'port':0x232a});config[_0x334c('0x9')]=_[_0x334c('0xa')](config['redis'],{'host':_0x334c('0xb'),'port':0x18eb});var socket=require(_0x334c('0xc'))(new Redis(config['redis']));require(_0x334c('0xd'))[_0x334c('0xe')](socket);function respondWithRpcPromise(_0x1bd93e,_0x85a02a,_0x8839d2){return new BPromise(function(_0x383f77,_0x5b3bc0){return client[_0x334c('0xf')](_0x1bd93e,_0x8839d2)[_0x334c('0x10')](function(_0x32b977){logger[_0x334c('0x11')]('SmsMessage,\x20%s,\x20%s',_0x85a02a,_0x334c('0x12'));logger[_0x334c('0x13')](_0x334c('0x14'),_0x85a02a,_0x334c('0x12'),JSON[_0x334c('0x15')](_0x32b977));if(_0x32b977[_0x334c('0x16')]){if(_0x32b977['error'][_0x334c('0x17')]===0x1f4){logger[_0x334c('0x16')](_0x334c('0x18'),_0x85a02a,_0x32b977[_0x334c('0x16')][_0x334c('0x19')]);return _0x5b3bc0(_0x32b977[_0x334c('0x16')][_0x334c('0x19')]);}logger['error'](_0x334c('0x18'),_0x85a02a,_0x32b977['error'][_0x334c('0x19')]);return _0x383f77(_0x32b977[_0x334c('0x16')]['message']);}else{logger['info'](_0x334c('0x18'),_0x85a02a,_0x334c('0x12'));_0x383f77(_0x32b977['result']['message']);}})[_0x334c('0x1a')](function(_0x4365f6){logger['error'](_0x334c('0x18'),_0x85a02a,_0x4365f6);_0x5b3bc0(_0x4365f6);});});}exports[_0x334c('0x1b')]=function(_0x3dcbd7){var _0x3a4702=this;return new Promise(function(_0x450cc5,_0x112b21){return db[_0x334c('0x1c')]['create'](_0x3dcbd7[_0x334c('0x1d')],{'raw':_0x3dcbd7[_0x334c('0x1e')]?_0x3dcbd7[_0x334c('0x1e')][_0x334c('0x1f')]===undefined?!![]:![]:!![]})[_0x334c('0x10')](function(_0x6a10f3){logger[_0x334c('0x11')]('CreateSmsMessage',_0x3dcbd7);logger[_0x334c('0x13')](_0x334c('0x1b'),_0x3dcbd7,JSON['stringify'](_0x6a10f3));_0x450cc5(_0x6a10f3);})[_0x334c('0x1a')](function(_0x183d7a){logger[_0x334c('0x16')](_0x334c('0x1b'),_0x183d7a[_0x334c('0x19')],_0x3dcbd7);_0x112b21(_0x3a4702[_0x334c('0x16')](0x1f4,_0x183d7a[_0x334c('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index e19f15e..3f503f8 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 _0xe9b8=['register','length','save','remove','emit','removeListener'];(function(_0x5bd1a9,_0x313714){var _0x2ba345=function(_0x21b4af){while(--_0x21b4af){_0x5bd1a9['push'](_0x5bd1a9['shift']());}};_0x2ba345(++_0x313714);}(_0xe9b8,0x1a0));var _0x8e9b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe9b8[_0x14add3];return _0x4a174f;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x8e9b('0x0'),_0x8e9b('0x1'),'update'];function createListener(_0xa83058,_0x57117e){return function(_0x5a37ef){_0x57117e[_0x8e9b('0x2')](_0xa83058,_0x5a37ef);};}function removeListener(_0x30d89b,_0x57b91c){return function(){SmsMessageEvents[_0x8e9b('0x3')](_0x30d89b,_0x57b91c);};}exports[_0x8e9b('0x4')]=function(_0x484c88){for(var _0x377051=0x0,_0x4feffa=events[_0x8e9b('0x5')];_0x377051<_0x4feffa;_0x377051++){var _0x1b1ad0=events[_0x377051];var _0x56ee76=createListener('smsMessage:'+_0x1b1ad0,_0x484c88);SmsMessageEvents['on'](_0x1b1ad0,_0x56ee76);}}; \ No newline at end of file +var _0x94e6=['removeListener','register','length','save','remove'];(function(_0x4c7410,_0x43bf77){var _0x2cf87d=function(_0x5f3db0){while(--_0x5f3db0){_0x4c7410['push'](_0x4c7410['shift']());}};_0x2cf87d(++_0x43bf77);}(_0x94e6,0xd0));var _0x694e=function(_0x4ae3e5,_0x2c4d4d){_0x4ae3e5=_0x4ae3e5-0x0;var _0x23ecd0=_0x94e6[_0x4ae3e5];return _0x23ecd0;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x694e('0x0'),_0x694e('0x1'),'update'];function createListener(_0x3c1e3c,_0x144a9a){return function(_0x228f04){_0x144a9a['emit'](_0x3c1e3c,_0x228f04);};}function removeListener(_0x236279,_0x3ce9f5){return function(){SmsMessageEvents[_0x694e('0x2')](_0x236279,_0x3ce9f5);};}exports[_0x694e('0x3')]=function(_0x3e5827){for(var _0x54ff96=0x0,_0x5a3b9f=events[_0x694e('0x4')];_0x54ff96<_0x5a3b9f;_0x54ff96++){var _0x53f774=events[_0x54ff96];var _0x5a7e42=createListener('smsMessage:'+_0x53f774,_0x3e5827);SmsMessageEvents['on'](_0x53f774,_0x5a7e42);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 800c577..826653a 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 _0x6f15=['removeAgents','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy','removeTeams'];(function(_0x54ad5c,_0x309841){var _0x26ebae=function(_0x14e83a){while(--_0x14e83a){_0x54ad5c['push'](_0x54ad5c['shift']());}};_0x26ebae(++_0x309841);}(_0x6f15,0x1c4));var _0x56f1=function(_0x563413,_0x4317e0){_0x563413=_0x563413-0x0;var _0x47560f=_0x6f15[_0x563413];return _0x47560f;};'use strict';var multer=require('multer');var util=require(_0x56f1('0x0'));var path=require(_0x56f1('0x1'));var timeout=require(_0x56f1('0x2'));var express=require(_0x56f1('0x3'));var router=express['Router']();var fs_extra=require(_0x56f1('0x4'));var auth=require(_0x56f1('0x5'));var interaction=require(_0x56f1('0x6'));var config=require(_0x56f1('0x7'));var controller=require('./smsQueue.controller');router[_0x56f1('0x8')]('/',auth[_0x56f1('0x9')](),controller[_0x56f1('0xa')]);router[_0x56f1('0x8')](_0x56f1('0xb'),auth[_0x56f1('0x9')](),controller[_0x56f1('0xc')]);router[_0x56f1('0x8')](_0x56f1('0xd'),auth[_0x56f1('0x9')](),controller['show']);router[_0x56f1('0x8')](_0x56f1('0xe'),auth['isAuthenticated'](),controller[_0x56f1('0xf')]);router[_0x56f1('0x8')](_0x56f1('0x10'),auth[_0x56f1('0x9')](),controller[_0x56f1('0x11')]);router[_0x56f1('0x8')](_0x56f1('0x12'),auth[_0x56f1('0x9')](),controller[_0x56f1('0x13')]);router[_0x56f1('0x14')]('/',auth[_0x56f1('0x9')](),controller['create']);router[_0x56f1('0x14')](_0x56f1('0x10'),auth[_0x56f1('0x9')](),controller[_0x56f1('0x15')]);router['post'](_0x56f1('0x12'),auth['isAuthenticated'](),controller[_0x56f1('0x16')]);router[_0x56f1('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x56f1('0x18')]);router[_0x56f1('0x19')](_0x56f1('0xd'),auth[_0x56f1('0x9')](),controller[_0x56f1('0x1a')]);router['delete'](_0x56f1('0x10'),auth[_0x56f1('0x9')](),controller[_0x56f1('0x1b')]);router[_0x56f1('0x19')](_0x56f1('0x12'),auth[_0x56f1('0x9')](),controller[_0x56f1('0x1c')]);module[_0x56f1('0x1d')]=router; \ No newline at end of file +var _0x39bf=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','isAuthenticated','index','get','/describe','describe','show','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout'];(function(_0x565051,_0x19ab8d){var _0x48cf46=function(_0x2c25aa){while(--_0x2c25aa){_0x565051['push'](_0x565051['shift']());}};_0x48cf46(++_0x19ab8d);}(_0x39bf,0xcf));var _0xf39b=function(_0x87764a,_0x30ac55){_0x87764a=_0x87764a-0x0;var _0x2ba847=_0x39bf[_0x87764a];return _0x2ba847;};'use strict';var multer=require(_0xf39b('0x0'));var util=require(_0xf39b('0x1'));var path=require('path');var timeout=require(_0xf39b('0x2'));var express=require(_0xf39b('0x3'));var router=express[_0xf39b('0x4')]();var fs_extra=require(_0xf39b('0x5'));var auth=require(_0xf39b('0x6'));var interaction=require(_0xf39b('0x7'));var config=require('../../config/environment');var controller=require(_0xf39b('0x8'));router['get']('/',auth[_0xf39b('0x9')](),controller[_0xf39b('0xa')]);router[_0xf39b('0xb')](_0xf39b('0xc'),auth['isAuthenticated'](),controller[_0xf39b('0xd')]);router[_0xf39b('0xb')]('/:id',auth[_0xf39b('0x9')](),controller[_0xf39b('0xe')]);router[_0xf39b('0xb')]('/:id/members',auth[_0xf39b('0x9')](),controller[_0xf39b('0xf')]);router[_0xf39b('0xb')](_0xf39b('0x10'),auth[_0xf39b('0x9')](),controller[_0xf39b('0x11')]);router[_0xf39b('0xb')](_0xf39b('0x12'),auth['isAuthenticated'](),controller['getAgents']);router[_0xf39b('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf39b('0x13')]('/:id/teams',auth[_0xf39b('0x9')](),controller[_0xf39b('0x14')]);router[_0xf39b('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0xf39b('0x15')]);router[_0xf39b('0x16')](_0xf39b('0x17'),auth['isAuthenticated'](),controller[_0xf39b('0x18')]);router[_0xf39b('0x19')](_0xf39b('0x17'),auth[_0xf39b('0x9')](),controller[_0xf39b('0x1a')]);router['delete']('/:id/teams',auth[_0xf39b('0x9')](),controller[_0xf39b('0x1b')]);router[_0xf39b('0x19')](_0xf39b('0x12'),auth[_0xf39b('0x9')](),controller[_0xf39b('0x1c')]);module[_0xf39b('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 110134a..b6a4fe4 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 _0xd4b6=['name','INTEGER','ENUM','beepall','sequelize','exports','STRING'];(function(_0x37ba2b,_0x4cd547){var _0x427243=function(_0x6d1e1a){while(--_0x6d1e1a){_0x37ba2b['push'](_0x37ba2b['shift']());}};_0x427243(++_0x4cd547);}(_0xd4b6,0x146));var _0x6d4b=function(_0x37219,_0x39d117){_0x37219=_0x37219-0x0;var _0x17e47e=_0xd4b6[_0x37219];return _0x17e47e;};'use strict';var Sequelize=require(_0x6d4b('0x0'));module[_0x6d4b('0x1')]={'name':{'type':Sequelize[_0x6d4b('0x2')],'unique':_0x6d4b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6d4b('0x2')]},'timeout':{'type':Sequelize[_0x6d4b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6d4b('0x5')]('rrmemory',_0x6d4b('0x6'),'roundrobin')}}; \ No newline at end of file +var _0xb62b=['exports','STRING','name','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb62b,0x16f));var _0xbb62=function(_0x444cf1,_0x29c81e){_0x444cf1=_0x444cf1-0x0;var _0x3da734=_0xb62b[_0x444cf1];return _0x3da734;};'use strict';var Sequelize=require(_0xbb62('0x0'));module[_0xbb62('0x1')]={'name':{'type':Sequelize[_0xbb62('0x2')],'unique':_0xbb62('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbb62('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 11663d5..e5e96ce 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 _0xd945=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','index','SmsQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','findAll','rows','catch','params','intersection','length','include','options','create','user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','User','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','Team','pick','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','compact','value','transaction','isEmpty','removeAgents','emit','addAgents','isArray','userSmsQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x3060e3,_0x14f2c6){var _0x497d2c=function(_0x2a274a){while(--_0x2a274a){_0x3060e3['push'](_0x3060e3['shift']());}};_0x497d2c(++_0x14f2c6);}(_0xd945,0x84));var _0x5d94=function(_0x198b2d,_0x4b284b){_0x198b2d=_0x198b2d-0x0;var _0x46abb8=_0xd945[_0x198b2d];return _0x46abb8;};'use strict';var emlformat=require(_0x5d94('0x0'));var rimraf=require(_0x5d94('0x1'));var zipdir=require(_0x5d94('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5d94('0x3'));var moment=require(_0x5d94('0x4'));var BPromise=require(_0x5d94('0x5'));var Mustache=require(_0x5d94('0x6'));var util=require(_0x5d94('0x7'));var path=require('path');var sox=require(_0x5d94('0x8'));var csv=require(_0x5d94('0x9'));var ejs=require(_0x5d94('0xa'));var fs=require('fs');var fs_extra=require(_0x5d94('0xb'));var _=require(_0x5d94('0xc'));var squel=require('squel');var crypto=require(_0x5d94('0xd'));var jsforce=require(_0x5d94('0xe'));var deskjs=require(_0x5d94('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5d94('0x10'));var Papa=require(_0x5d94('0x11'));var Redis=require(_0x5d94('0x12'));var authService=require(_0x5d94('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5d94('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5d94('0x15'))(_0x5d94('0x16'));var utils=require(_0x5d94('0x17'));var config=require(_0x5d94('0x18'));var licenseUtil=require(_0x5d94('0x19'));var db=require(_0x5d94('0x1a'))['db'];config[_0x5d94('0x1b')]=_[_0x5d94('0x1c')](config[_0x5d94('0x1b')],{'host':_0x5d94('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5d94('0x1b')]));require(_0x5d94('0x1e'))['register'](socket);function respondWithStatusCode(_0x1d8291,_0x427eb2){_0x427eb2=_0x427eb2||0xcc;return function(_0xd78460){if(_0xd78460){return _0x1d8291[_0x5d94('0x1f')](_0x427eb2);}return _0x1d8291[_0x5d94('0x20')](_0x427eb2)[_0x5d94('0x21')]();};}function respondWithResult(_0x5c4d65,_0x555419){_0x555419=_0x555419||0xc8;return function(_0x541ef1){if(_0x541ef1){return _0x5c4d65[_0x5d94('0x20')](_0x555419)[_0x5d94('0x22')](_0x541ef1);}};}function respondWithFilteredResult(_0x1ef529,_0x133ee5){return function(_0x12c238){if(_0x12c238){var _0x47ea45=typeof _0x133ee5[_0x5d94('0x23')]===_0x5d94('0x24')&&typeof _0x133ee5[_0x5d94('0x25')]===_0x5d94('0x24');var _0x176f5c=_0x12c238[_0x5d94('0x26')];var _0x66be60=_0x47ea45?0x0:_0x133ee5[_0x5d94('0x23')];var _0x36f6d4=_0x47ea45?_0x12c238[_0x5d94('0x26')]:_0x133ee5[_0x5d94('0x23')]+_0x133ee5[_0x5d94('0x25')];var _0xe21853;if(_0x36f6d4>=_0x176f5c){_0x36f6d4=_0x176f5c;_0xe21853=0xc8;}else{_0xe21853=0xce;}_0x1ef529['status'](_0xe21853);return _0x1ef529[_0x5d94('0x27')](_0x5d94('0x28'),_0x66be60+'-'+_0x36f6d4+'/'+_0x176f5c)[_0x5d94('0x22')](_0x12c238);}return null;};}function patchUpdates(_0x2a643f){return function(_0x2b867b){try{jsonpatch[_0x5d94('0x29')](_0x2b867b,_0x2a643f,!![]);}catch(_0xd0fbf0){return BPromise[_0x5d94('0x2a')](_0xd0fbf0);}return _0x2b867b[_0x5d94('0x2b')]();};}function saveUpdates(_0x40c0a6,_0x100aa2){return function(_0x330d46){if(_0x330d46){return _0x330d46[_0x5d94('0x2c')](_0x40c0a6)[_0x5d94('0x2d')](function(_0x1c1344){return _0x1c1344;});}return null;};}function removeEntity(_0x478c39,_0x374c3f){return function(_0x452ad7){if(_0x452ad7){return _0x452ad7[_0x5d94('0x2e')]()[_0x5d94('0x2d')](function(){var _0x3241a7=_0x452ad7[_0x5d94('0x2f')]({'plain':!![]});var _0x27426f=_0x5d94('0x30');return db[_0x5d94('0x31')][_0x5d94('0x2e')]({'where':{'type':_0x27426f,'resourceId':_0x3241a7['id']}})[_0x5d94('0x2d')](function(){return _0x452ad7;});})['then'](function(){_0x478c39['status'](0xcc)[_0x5d94('0x21')]();});}};}function handleEntityNotFound(_0x54d4df,_0x19ef72){return function(_0x43ef7f){if(!_0x43ef7f){_0x54d4df[_0x5d94('0x1f')](0x194);}return _0x43ef7f;};}function handleError(_0x43ee02,_0x2d90f4){_0x2d90f4=_0x2d90f4||0x1f4;return function(_0x27a401){logger[_0x5d94('0x32')](_0x27a401[_0x5d94('0x33')]);if(_0x27a401[_0x5d94('0x34')]){delete _0x27a401[_0x5d94('0x34')];}_0x43ee02['status'](_0x2d90f4)['send'](_0x27a401);};}exports[_0x5d94('0x35')]=function(_0x34569a,_0x38ca6f){var _0x539599={},_0x5c4d90={},_0x553db2={'count':0x0,'rows':[]};var _0x31acb6=_['map'](db[_0x5d94('0x36')][_0x5d94('0x37')],function(_0xe61bc8){return{'name':_0xe61bc8[_0x5d94('0x38')],'type':_0xe61bc8[_0x5d94('0x39')][_0x5d94('0x3a')]};});_0x5c4d90[_0x5d94('0x3b')]=_[_0x5d94('0x3c')](_0x31acb6,'name');_0x5c4d90[_0x5d94('0x3d')]=_[_0x5d94('0x3e')](_0x34569a[_0x5d94('0x3d')]);_0x5c4d90[_0x5d94('0x3f')]=_['intersection'](_0x5c4d90['model'],_0x5c4d90[_0x5d94('0x3d')]);_0x539599['attributes']=_['intersection'](_0x5c4d90[_0x5d94('0x3b')],qs[_0x5d94('0x40')](_0x34569a['query']['fields']));_0x539599[_0x5d94('0x41')]=_0x539599[_0x5d94('0x41')]['length']?_0x539599[_0x5d94('0x41')]:_0x5c4d90[_0x5d94('0x3b')];if(!_0x34569a[_0x5d94('0x3d')][_0x5d94('0x42')](_0x5d94('0x43'))){_0x539599[_0x5d94('0x25')]=qs[_0x5d94('0x25')](_0x34569a[_0x5d94('0x3d')][_0x5d94('0x25')]);_0x539599[_0x5d94('0x23')]=qs['offset'](_0x34569a[_0x5d94('0x3d')][_0x5d94('0x23')]);}_0x539599[_0x5d94('0x44')]=qs[_0x5d94('0x45')](_0x34569a['query'][_0x5d94('0x45')]);_0x539599[_0x5d94('0x46')]=qs['filters'](_['pick'](_0x34569a[_0x5d94('0x3d')],_0x5c4d90[_0x5d94('0x3f')]),_0x31acb6);if(_0x34569a[_0x5d94('0x3d')][_0x5d94('0x47')]){_0x539599[_0x5d94('0x46')]=_['merge'](_0x539599[_0x5d94('0x46')],{'$or':_[_0x5d94('0x3c')](_0x31acb6,function(_0xdaf7f8){if(_0xdaf7f8[_0x5d94('0x39')]!=='VIRTUAL'){var _0x1cf907={};_0x1cf907[_0xdaf7f8[_0x5d94('0x34')]]={'$like':'%'+_0x34569a[_0x5d94('0x3d')]['filter']+'%'};return _0x1cf907;}})});}_0x539599=_[_0x5d94('0x48')]({},_0x539599,_0x34569a['options']);var _0x5e4156={'where':_0x539599['where']};return db[_0x5d94('0x36')][_0x5d94('0x26')](_0x5e4156)[_0x5d94('0x2d')](function(_0x1822ad){_0x553db2['count']=_0x1822ad;if(_0x34569a[_0x5d94('0x3d')][_0x5d94('0x49')]){_0x539599['include']=[{'all':!![]}];}return db['SmsQueue'][_0x5d94('0x4a')](_0x539599);})[_0x5d94('0x2d')](function(_0x5b0a31){_0x553db2[_0x5d94('0x4b')]=_0x5b0a31;return _0x553db2;})['then'](respondWithFilteredResult(_0x38ca6f,_0x539599))[_0x5d94('0x4c')](handleError(_0x38ca6f,null));};exports['show']=function(_0x219eb9,_0x1810bf){var _0x12834b={'raw':!![],'where':{'id':_0x219eb9[_0x5d94('0x4d')]['id']}},_0x37cda4={};_0x37cda4[_0x5d94('0x3b')]=_['keys'](db[_0x5d94('0x36')][_0x5d94('0x37')]);_0x37cda4[_0x5d94('0x3d')]=_[_0x5d94('0x3e')](_0x219eb9['query']);_0x37cda4[_0x5d94('0x3f')]=_['intersection'](_0x37cda4['model'],_0x37cda4[_0x5d94('0x3d')]);_0x12834b[_0x5d94('0x41')]=_[_0x5d94('0x4e')](_0x37cda4[_0x5d94('0x3b')],qs[_0x5d94('0x40')](_0x219eb9[_0x5d94('0x3d')]['fields']));_0x12834b['attributes']=_0x12834b[_0x5d94('0x41')][_0x5d94('0x4f')]?_0x12834b[_0x5d94('0x41')]:_0x37cda4[_0x5d94('0x3b')];if(_0x219eb9[_0x5d94('0x3d')][_0x5d94('0x49')]){_0x12834b[_0x5d94('0x50')]=[{'all':!![]}];}_0x12834b=_['merge']({},_0x12834b,_0x219eb9[_0x5d94('0x51')]);return db[_0x5d94('0x36')]['find'](_0x12834b)[_0x5d94('0x2d')](handleEntityNotFound(_0x1810bf,null))[_0x5d94('0x2d')](respondWithResult(_0x1810bf,null))[_0x5d94('0x4c')](handleError(_0x1810bf,null));};exports[_0x5d94('0x52')]=function(_0x40e595,_0x12e049){return db[_0x5d94('0x36')][_0x5d94('0x52')](_0x40e595['body'],{})['then'](function(_0x1ffcdf){var _0x38d21a=_0x40e595[_0x5d94('0x53')][_0x5d94('0x2f')]({'plain':!![]});if(!_0x38d21a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38d21a[_0x5d94('0x54')]===_0x5d94('0x53')){var _0x174e25=_0x1ffcdf['get']({'plain':!![]});var _0x3178e0=_0x5d94('0x30');return db[_0x5d94('0x55')][_0x5d94('0x56')]({'where':{'name':_0x3178e0,'userProfileId':_0x38d21a['userProfileId']},'raw':!![]})[_0x5d94('0x2d')](function(_0x10c7cd){if(_0x10c7cd&&_0x10c7cd[_0x5d94('0x57')]===0x0){return db['UserProfileResource'][_0x5d94('0x52')]({'name':_0x174e25[_0x5d94('0x34')],'resourceId':_0x174e25['id'],'type':_0x10c7cd[_0x5d94('0x34')],'sectionId':_0x10c7cd['id']},{})['then'](function(){return _0x1ffcdf;});}else{return _0x1ffcdf;}})[_0x5d94('0x4c')](function(_0x15ed7e){logger[_0x5d94('0x32')](_0x5d94('0x58'),_0x15ed7e);throw _0x15ed7e;});}return _0x1ffcdf;})[_0x5d94('0x2d')](respondWithResult(_0x12e049,0xc9))[_0x5d94('0x4c')](handleError(_0x12e049,null));};exports[_0x5d94('0x2c')]=function(_0xd5cbd6,_0x1fdf6f){if(_0xd5cbd6[_0x5d94('0x59')]['id']){delete _0xd5cbd6['body']['id'];}return db[_0x5d94('0x36')][_0x5d94('0x56')]({'where':{'id':_0xd5cbd6[_0x5d94('0x4d')]['id']}})[_0x5d94('0x2d')](handleEntityNotFound(_0x1fdf6f,null))[_0x5d94('0x2d')](saveUpdates(_0xd5cbd6[_0x5d94('0x59')],null))['then'](respondWithResult(_0x1fdf6f,null))[_0x5d94('0x4c')](handleError(_0x1fdf6f,null));};exports[_0x5d94('0x2e')]=function(_0x128afd,_0x1a2532){return db[_0x5d94('0x36')][_0x5d94('0x56')]({'where':{'id':_0x128afd[_0x5d94('0x4d')]['id']}})[_0x5d94('0x2d')](handleEntityNotFound(_0x1a2532,null))[_0x5d94('0x2d')](removeEntity(_0x1a2532,null))['catch'](handleError(_0x1a2532,null));};exports['describe']=function(_0x31941f,_0x51de26){return db[_0x5d94('0x36')][_0x5d94('0x5a')]()[_0x5d94('0x2d')](respondWithResult(_0x51de26,null))[_0x5d94('0x4c')](handleError(_0x51de26,null));};exports[_0x5d94('0x5b')]=function(_0x4dea2c,_0x4db49a,_0xdcdb1b){var _0x499ba1={'raw':!![],'where':{}},_0x4203f7={},_0x12aec2;return db[_0x5d94('0x36')][_0x5d94('0x5c')]({'where':{'id':_0x4dea2c[_0x5d94('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4db49a,null))[_0x5d94('0x2d')](function(_0x515f25){if(_0x515f25){_0x12aec2=_0x515f25[_0x5d94('0x2f')]({'plain':!![]});_0x4203f7[_0x5d94('0x3b')]=_[_0x5d94('0x3e')](db[_0x5d94('0x5d')][_0x5d94('0x37')]);_0x4203f7[_0x5d94('0x3d')]=_[_0x5d94('0x3e')](_0x4dea2c[_0x5d94('0x3d')]);_0x4203f7[_0x5d94('0x3f')]=_[_0x5d94('0x4e')](_0x4203f7[_0x5d94('0x3b')],_0x4203f7[_0x5d94('0x3d')]);_0x499ba1[_0x5d94('0x41')]=_[_0x5d94('0x4e')](_0x4203f7[_0x5d94('0x3b')],qs[_0x5d94('0x40')](_0x4dea2c[_0x5d94('0x3d')][_0x5d94('0x40')]));_0x499ba1[_0x5d94('0x41')]=_0x499ba1[_0x5d94('0x41')][_0x5d94('0x4f')]?_0x499ba1[_0x5d94('0x41')]:_0x4203f7['model'];if(!_0x4dea2c[_0x5d94('0x3d')]['hasOwnProperty']('nolimit')){_0x499ba1[_0x5d94('0x25')]=qs[_0x5d94('0x25')](_0x4dea2c['query'][_0x5d94('0x25')]);_0x499ba1[_0x5d94('0x23')]=qs[_0x5d94('0x23')](_0x4dea2c[_0x5d94('0x3d')][_0x5d94('0x23')]);}_0x499ba1[_0x5d94('0x44')]=qs[_0x5d94('0x45')](_0x4dea2c[_0x5d94('0x3d')][_0x5d94('0x45')]);_0x499ba1[_0x5d94('0x46')]=qs[_0x5d94('0x3f')](_['pick'](_0x4dea2c[_0x5d94('0x3d')],_0x4203f7[_0x5d94('0x3f')]));_0x499ba1[_0x5d94('0x46')][_0x5d94('0x5e')]=_0x515f25['id'];if(_0x4dea2c[_0x5d94('0x3d')]['filter']){_0x499ba1[_0x5d94('0x46')]=_[_0x5d94('0x48')](_0x499ba1[_0x5d94('0x46')],{'$or':_['map'](_0x499ba1['attributes'],function(_0x100001){var _0x578798={};_0x578798[_0x100001]={'$like':'%'+_0x4dea2c[_0x5d94('0x3d')][_0x5d94('0x47')]+'%'};return _0x578798;})});}_0x499ba1=_[_0x5d94('0x48')]({},_0x499ba1,_0x4dea2c[_0x5d94('0x51')]);return db[_0x5d94('0x5d')][_0x5d94('0x4a')](_0x499ba1);}})[_0x5d94('0x2d')](function(_0x1f2247){if(_0x1f2247){return db[_0x5d94('0x5f')]['findAndCountAll']({'where':{'id':_[_0x5d94('0x3c')](_0x1f2247,'UserId'),'role':_0x5d94('0x60')},'attributes':['id',_0x5d94('0x34'),_0x5d94('0x61'),_0x5d94('0x62'),_0x5d94('0x63')]});}})['then'](function(_0x4c896c){if(_0x4c896c){return{'count':_0x4c896c[_0x5d94('0x26')],'rows':_[_0x5d94('0x3c')](_0x4c896c[_0x5d94('0x4b')],function(_0x42a461){return{'membername':_0x42a461[_0x5d94('0x34')],'UserId':_0x42a461['id'],'queue_name':_0x12aec2[_0x5d94('0x34')],'SmsQueueId':_0x12aec2['id'],'interface':util[_0x5d94('0x64')](_0x5d94('0x65'),_0x5d94('0x66'),_0x42a461['name']),'penalty':0x0,'paused':_0x42a461[_0x5d94('0x61')],'createdAt':_0x42a461[_0x5d94('0x63')],'updatedAt':_0x42a461['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x5d94('0x2d')](respondWithFilteredResult(_0x4db49a,_0x499ba1))['catch'](handleError(_0x4db49a,null));};exports['getTeams']=function(_0x13c988,_0x4e913f,_0x35b053){var _0x195dd8={};var _0x5f3d69={};var _0x36ec8a;var _0x8a97a9;return db['SmsQueue'][_0x5d94('0x5c')]({'where':{'id':_0x13c988[_0x5d94('0x4d')]['id']}})[_0x5d94('0x2d')](handleEntityNotFound(_0x4e913f,null))['then'](function(_0x39cd49){if(_0x39cd49){_0x36ec8a=_0x39cd49;_0x5f3d69[_0x5d94('0x3b')]=_['keys'](db[_0x5d94('0x67')][_0x5d94('0x37')]);_0x5f3d69[_0x5d94('0x3d')]=_['keys'](_0x13c988[_0x5d94('0x3d')]);_0x5f3d69[_0x5d94('0x3f')]=_['intersection'](_0x5f3d69[_0x5d94('0x3b')],_0x5f3d69[_0x5d94('0x3d')]);_0x195dd8[_0x5d94('0x41')]=_['intersection'](_0x5f3d69[_0x5d94('0x3b')],qs[_0x5d94('0x40')](_0x13c988[_0x5d94('0x3d')]['fields']));_0x195dd8[_0x5d94('0x41')]=_0x195dd8[_0x5d94('0x41')][_0x5d94('0x4f')]?_0x195dd8[_0x5d94('0x41')]:_0x5f3d69[_0x5d94('0x3b')];_0x195dd8[_0x5d94('0x44')]=qs[_0x5d94('0x45')](_0x13c988[_0x5d94('0x3d')][_0x5d94('0x45')]);_0x195dd8[_0x5d94('0x46')]=qs['filters'](_[_0x5d94('0x68')](_0x13c988['query'],_0x5f3d69['filters']));if(_0x13c988[_0x5d94('0x3d')][_0x5d94('0x47')]){_0x195dd8[_0x5d94('0x46')]=_[_0x5d94('0x48')](_0x195dd8[_0x5d94('0x46')],{'$or':_[_0x5d94('0x3c')](_0x195dd8['attributes'],function(_0x499bf9){var _0x304753={};_0x304753[_0x499bf9]={'$like':'%'+_0x13c988[_0x5d94('0x3d')][_0x5d94('0x47')]+'%'};return _0x304753;})});}_0x195dd8=_[_0x5d94('0x48')]({},_0x195dd8,_0x13c988[_0x5d94('0x51')]);return _0x36ec8a[_0x5d94('0x69')](_0x195dd8);}})[_0x5d94('0x2d')](function(_0x5e85ab){if(_0x5e85ab){_0x8a97a9=_0x5e85ab[_0x5d94('0x4f')];if(!_0x13c988[_0x5d94('0x3d')][_0x5d94('0x42')](_0x5d94('0x43'))){_0x195dd8[_0x5d94('0x25')]=qs['limit'](_0x13c988[_0x5d94('0x3d')][_0x5d94('0x25')]);_0x195dd8[_0x5d94('0x23')]=qs[_0x5d94('0x23')](_0x13c988['query'][_0x5d94('0x23')]);}return _0x36ec8a[_0x5d94('0x69')](_0x195dd8);}})[_0x5d94('0x2d')](function(_0xcc8815){if(_0xcc8815){return _0xcc8815?{'count':_0x8a97a9,'rows':_0xcc8815}:null;}})[_0x5d94('0x2d')](respondWithResult(_0x4e913f,null))[_0x5d94('0x4c')](handleError(_0x4e913f,null));};exports[_0x5d94('0x6a')]=function(_0x2a8267,_0x2164ef,_0x3655d5){var _0x4078ba=_0x2a8267[_0x5d94('0x59')][_0x5d94('0x6b')];return db['Team']['findAll']({'where':{'id':_0x4078ba},'attributes':['id'],'include':[{'model':db[_0x5d94('0x5f')],'as':_0x5d94('0x6c'),'attributes':['id',_0x5d94('0x34'),_0x5d94('0x6d'),_0x5d94('0x6e'),_0x5d94('0x6f')],'raw':!![]}]})[_0x5d94('0x2d')](function(_0x810ead){if(_0x810ead){var _0x411b1b=_[_0x5d94('0x70')](_0x810ead,function(_0x49ba7a){var _0x4fde77=_0x49ba7a[_0x5d94('0x2f')]({'plain':!![]});return _0x4fde77['Agents'];});return db['SmsQueue']['find']({'where':{'id':_0x2a8267['params']['id']}})[_0x5d94('0x2d')](function(_0x5021f1){return db[_0x5d94('0x71')]['transaction'](function(_0x241f34){return _0x5021f1[_0x5d94('0x6a')](_0x4078ba,{'transaction':_0x241f34})[_0x5d94('0x2d')](function(){return BPromise[_0x5d94('0x72')](_0x411b1b,function(_0x4a8e9a){return db[_0x5d94('0x5d')][_0x5d94('0x73')]({'where':{'UserId':_0x4a8e9a['id'],'SmsQueueId':_0x2a8267[_0x5d94('0x4d')]['id']},'transaction':_0x241f34});});})[_0x5d94('0x2d')](function(){_0x411b1b[_0x5d94('0x74')](function(_0x2864d7){socket['emit'](_0x5d94('0x75'),{'UserId':_0x2864d7['id'],'SmsQueueId':_0x5021f1['id']});});});});});}})[_0x5d94('0x2d')](respondWithStatusCode(_0x2164ef,null))[_0x5d94('0x4c')](handleError(_0x2164ef,null));};exports[_0x5d94('0x76')]=function(_0x456e33,_0x3b60c9,_0x4bee31){return db[_0x5d94('0x67')][_0x5d94('0x4a')]({'where':{'id':_0x456e33[_0x5d94('0x3d')]['ids']},'attributes':['id'],'include':[{'model':db[_0x5d94('0x5f')],'as':_0x5d94('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x5d94('0x2d')](handleEntityNotFound(_0x3b60c9,null))[_0x5d94('0x2d')](function(_0x35ed48){var _0x50824d=_['map'](_0x35ed48,'id');var _0xa324ac=[];var _0x391d76=[];var _0x55ae28=squel[_0x5d94('0x77')]();_0x55ae28[_0x5d94('0x78')](_0x5d94('0x79'))[_0x5d94('0x7a')]('team_has_sms_queues','tq')[_0x5d94('0x7b')](_0x5d94('0x7c'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x5d94('0x7d'),_0x456e33[_0x5d94('0x4d')]['id']);for(var _0x2bb97b=0x0;_0x2bb97b<_0x35ed48[_0x5d94('0x4f')];_0x2bb97b+=0x1){let _0x138922=_0x35ed48[_0x2bb97b];for(var _0x383c98=0x0;_0x383c98<_0x138922['Agents']['length'];_0x383c98+=0x1){let _0x1238ee=_0x138922[_0x5d94('0x6c')][_0x383c98];var _0x335eb6=_0x55ae28[_0x5d94('0x7e')]();_0x335eb6[_0x5d94('0x46')](_0x5d94('0x7f'),_0x1238ee['id']);_0x391d76[_0x5d94('0x80')](db[_0x5d94('0x71')][_0x5d94('0x3d')](_0x335eb6[_0x5d94('0x81')](),{'type':db[_0x5d94('0x71')][_0x5d94('0x82')]['SELECT']})[_0x5d94('0x2d')](function(_0x539309){if(_0x539309[_0x5d94('0x4f')]===0x1){return _0x1238ee['id'];}else{var _0x3b4818=_[_0x5d94('0x83')](_[_0x5d94('0x3c')](_0x539309,_0x5d94('0x84')),function(_0x28c915){return _[_0x5d94('0x85')](_0x50824d,_0x28c915);});if(_0x3b4818){return _0x1238ee['id'];}}}));}}return BPromise[_0x5d94('0x86')](_0x391d76)[_0x5d94('0x2d')](function(_0x434504){_0xa324ac=_(_0xa324ac)['union'](_0x434504)[_0x5d94('0x87')]()[_0x5d94('0x88')]();return db[_0x5d94('0x36')][_0x5d94('0x56')]({'where':{'id':_0x456e33[_0x5d94('0x4d')]['id']}})[_0x5d94('0x2d')](function(_0x22f30e){return db[_0x5d94('0x71')][_0x5d94('0x89')](function(_0x3d8d17){return _0x22f30e[_0x5d94('0x76')](_0x456e33[_0x5d94('0x3d')][_0x5d94('0x6b')],{'transaction':_0x3d8d17})['then'](function(){if(!_[_0x5d94('0x8a')](_0xa324ac)){return _0x22f30e[_0x5d94('0x8b')](_0xa324ac,{'transaction':_0x3d8d17});}})['then'](function(){_0xa324ac[_0x5d94('0x74')](function(_0x522922){socket[_0x5d94('0x8c')]('userSmsQueue:remove',{'UserId':_0x522922,'SmsQueueId':_0x22f30e['id']});});});});});});})[_0x5d94('0x2d')](respondWithStatusCode(_0x3b60c9,null))[_0x5d94('0x4c')](handleError(_0x3b60c9,null));};exports[_0x5d94('0x8d')]=function(_0x396387,_0x1eaaae,_0x432bcf){return db[_0x5d94('0x36')][_0x5d94('0x56')]({'where':{'id':_0x396387[_0x5d94('0x4d')]['id']}})[_0x5d94('0x2d')](handleEntityNotFound(_0x1eaaae,null))[_0x5d94('0x2d')](function(_0x2192b9){if(_0x2192b9){return _0x2192b9[_0x5d94('0x8d')](_0x396387['body']['ids'],_['omit'](_0x396387[_0x5d94('0x59')],[_0x5d94('0x6b'),'id'])||{})['spread'](function(_0x1dd041){for(var _0x5a4d27=0x0;_0x5a4d27<_0x396387[_0x5d94('0x59')][_0x5d94('0x6b')]['length'];_0x5a4d27+=0x1){socket[_0x5d94('0x8c')](_0x5d94('0x75'),{'UserId':Number(_0x396387['body'][_0x5d94('0x6b')][_0x5a4d27]),'SmsQueueId':Number(_0x396387[_0x5d94('0x4d')]['id'])});}return _0x1dd041;});}})[_0x5d94('0x2d')](respondWithResult(_0x1eaaae,null))['catch'](handleError(_0x1eaaae,null));};exports[_0x5d94('0x8b')]=function(_0x1c4a4e,_0x167f9a,_0x4a5c24){return db[_0x5d94('0x36')][_0x5d94('0x56')]({'where':{'id':_0x1c4a4e['params']['id']}})[_0x5d94('0x2d')](handleEntityNotFound(_0x167f9a,null))[_0x5d94('0x2d')](function(_0x8e9be6){if(_0x8e9be6){return _0x8e9be6['removeAgents'](_0x1c4a4e[_0x5d94('0x3d')][_0x5d94('0x6b')])[_0x5d94('0x2d')](function(){if(_[_0x5d94('0x8e')](_0x1c4a4e[_0x5d94('0x3d')][_0x5d94('0x6b')])){for(var _0xc785bd=0x0;_0xc785bd<_0x1c4a4e[_0x5d94('0x3d')][_0x5d94('0x6b')]['length'];_0xc785bd+=0x1){socket[_0x5d94('0x8c')]('userSmsQueue:remove',{'UserId':Number(_0x1c4a4e[_0x5d94('0x3d')][_0x5d94('0x6b')][_0xc785bd]),'SmsQueueId':Number(_0x1c4a4e[_0x5d94('0x4d')]['id'])});}}else{socket['emit'](_0x5d94('0x8f'),{'UserId':Number(_0x1c4a4e[_0x5d94('0x3d')][_0x5d94('0x6b')]),'SmsQueueId':Number(_0x1c4a4e['params']['id'])});}});}})[_0x5d94('0x2d')](respondWithStatusCode(_0x167f9a,null))['catch'](handleError(_0x167f9a,null));};exports[_0x5d94('0x90')]=function(_0xd2be2,_0x5e70d1,_0x1be156){var _0x153afe={};var _0x595fc3={};var _0x2f49c9;var _0x728d52;return db[_0x5d94('0x36')]['findOne']({'where':{'id':_0xd2be2[_0x5d94('0x4d')]['id']}})[_0x5d94('0x2d')](handleEntityNotFound(_0x5e70d1,null))['then'](function(_0x39252a){if(_0x39252a){_0x2f49c9=_0x39252a;_0x595fc3[_0x5d94('0x3b')]=_[_0x5d94('0x3e')](db[_0x5d94('0x5f')][_0x5d94('0x37')]);_0x595fc3[_0x5d94('0x3d')]=_[_0x5d94('0x3e')](_0xd2be2['query']);_0x595fc3[_0x5d94('0x3f')]=_['intersection'](_0x595fc3['model'],_0x595fc3[_0x5d94('0x3d')]);_0x153afe[_0x5d94('0x41')]=_[_0x5d94('0x4e')](_0x595fc3[_0x5d94('0x3b')],qs['fields'](_0xd2be2[_0x5d94('0x3d')][_0x5d94('0x40')]));_0x153afe['attributes']=_0x153afe['attributes'][_0x5d94('0x4f')]?_0x153afe['attributes']:_0x595fc3[_0x5d94('0x3b')];_0x153afe['order']=qs[_0x5d94('0x45')](_0xd2be2[_0x5d94('0x3d')][_0x5d94('0x45')]);_0x153afe[_0x5d94('0x46')]=qs[_0x5d94('0x3f')](_[_0x5d94('0x68')](_0xd2be2[_0x5d94('0x3d')],_0x595fc3[_0x5d94('0x3f')]));if(_0xd2be2['query']['filter']){_0x153afe[_0x5d94('0x46')]=_[_0x5d94('0x48')](_0x153afe['where'],{'$or':_[_0x5d94('0x3c')](_0x153afe[_0x5d94('0x41')],function(_0x335e9e){var _0x4b176b={};_0x4b176b[_0x335e9e]={'$like':'%'+_0xd2be2[_0x5d94('0x3d')][_0x5d94('0x47')]+'%'};return _0x4b176b;})});}_0x153afe=_[_0x5d94('0x48')]({},_0x153afe,_0xd2be2[_0x5d94('0x51')]);return _0x2f49c9[_0x5d94('0x90')](_0x153afe);}})['then'](function(_0x4b9600){if(_0x4b9600){_0x728d52=_0x4b9600[_0x5d94('0x4f')];if(!_0xd2be2[_0x5d94('0x3d')]['hasOwnProperty'](_0x5d94('0x43'))){_0x153afe[_0x5d94('0x25')]=qs[_0x5d94('0x25')](_0xd2be2[_0x5d94('0x3d')]['limit']);_0x153afe[_0x5d94('0x23')]=qs[_0x5d94('0x23')](_0xd2be2[_0x5d94('0x3d')]['offset']);}return _0x2f49c9[_0x5d94('0x90')](_0x153afe);}})[_0x5d94('0x2d')](function(_0x1cf0cc){if(_0x1cf0cc){return _0x1cf0cc?{'count':_0x728d52,'rows':_0x1cf0cc}:null;}})[_0x5d94('0x2d')](respondWithResult(_0x5e70d1,null))[_0x5d94('0x4c')](handleError(_0x5e70d1,null));}; \ No newline at end of file +var _0x3826=['path','sox','lodash','crypto','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','destroy','then','get','error','stack','name','index','map','SmsQueue','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','include','catch','show','params','rawAttributes','keys','includeAll','create','body','role','SmsQueues','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserSmsQueue','SmsQueueId','findAll','findAndCountAll','UserId','smsPause','updatedAt','rows','format','%s/%s','SIP','createdAt','getTeams','findOne','Team','addTeams','ids','voicePause','interface','Agents','sequelize','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','select','field','from','team_has_sms_queues','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','transaction','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','User','eml-format','rimraf','zip-dir','request-promise','moment','util'];(function(_0xb2d8da,_0x239a95){var _0x377456=function(_0x3735f7){while(--_0x3735f7){_0xb2d8da['push'](_0xb2d8da['shift']());}};_0x377456(++_0x239a95);}(_0x3826,0x83));var _0x6382=function(_0x345a17,_0x3b9d2a){_0x345a17=_0x345a17-0x0;var _0xd0f947=_0x3826[_0x345a17];return _0xd0f947;};'use strict';var emlformat=require(_0x6382('0x0'));var rimraf=require(_0x6382('0x1'));var zipdir=require(_0x6382('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6382('0x3'));var moment=require(_0x6382('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6382('0x5'));var path=require(_0x6382('0x6'));var sox=require(_0x6382('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6382('0x8'));var squel=require('squel');var crypto=require(_0x6382('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6382('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6382('0xb'));var authService=require(_0x6382('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x6382('0xd'));var hardwareService=require(_0x6382('0xe'));var logger=require('../../config/logger')(_0x6382('0xf'));var utils=require('../../config/utils');var config=require(_0x6382('0x10'));var licenseUtil=require(_0x6382('0x11'));var db=require(_0x6382('0x12'))['db'];config[_0x6382('0x13')]=_[_0x6382('0x14')](config[_0x6382('0x13')],{'host':_0x6382('0x15'),'port':0x18eb});var socket=require(_0x6382('0x16'))(new Redis(config['redis']));require(_0x6382('0x17'))[_0x6382('0x18')](socket);function respondWithStatusCode(_0x19e48a,_0x180d43){_0x180d43=_0x180d43||0xcc;return function(_0x20780f){if(_0x20780f){return _0x19e48a[_0x6382('0x19')](_0x180d43);}return _0x19e48a[_0x6382('0x1a')](_0x180d43)[_0x6382('0x1b')]();};}function respondWithResult(_0x536ea7,_0x114dc7){_0x114dc7=_0x114dc7||0xc8;return function(_0x20c312){if(_0x20c312){return _0x536ea7['status'](_0x114dc7)[_0x6382('0x1c')](_0x20c312);}};}function respondWithFilteredResult(_0x3c4767,_0x520386){return function(_0x5c9008){if(_0x5c9008){var _0x1b14ba=typeof _0x520386['offset']==='undefined'&&typeof _0x520386['limit']===_0x6382('0x1d');var _0x431dd8=_0x5c9008[_0x6382('0x1e')];var _0x2a5fbe=_0x1b14ba?0x0:_0x520386['offset'];var _0x5eb34b=_0x1b14ba?_0x5c9008[_0x6382('0x1e')]:_0x520386[_0x6382('0x1f')]+_0x520386[_0x6382('0x20')];var _0x4f14eb;if(_0x5eb34b>=_0x431dd8){_0x5eb34b=_0x431dd8;_0x4f14eb=0xc8;}else{_0x4f14eb=0xce;}_0x3c4767[_0x6382('0x1a')](_0x4f14eb);return _0x3c4767[_0x6382('0x21')](_0x6382('0x22'),_0x2a5fbe+'-'+_0x5eb34b+'/'+_0x431dd8)[_0x6382('0x1c')](_0x5c9008);}return null;};}function patchUpdates(_0x4fcf57){return function(_0x2568af){try{jsonpatch[_0x6382('0x23')](_0x2568af,_0x4fcf57,!![]);}catch(_0x52f050){return BPromise['reject'](_0x52f050);}return _0x2568af[_0x6382('0x24')]();};}function saveUpdates(_0x7f1286,_0x4d35c4){return function(_0x3e979f){if(_0x3e979f){return _0x3e979f[_0x6382('0x25')](_0x7f1286)['then'](function(_0x493200){return _0x493200;});}return null;};}function removeEntity(_0x2ab3ed,_0x34d8ba){return function(_0x272e48){if(_0x272e48){return _0x272e48[_0x6382('0x26')]()[_0x6382('0x27')](function(){var _0x7215c6=_0x272e48[_0x6382('0x28')]({'plain':!![]});var _0x5c443c='SmsQueues';return db['UserProfileResource'][_0x6382('0x26')]({'where':{'type':_0x5c443c,'resourceId':_0x7215c6['id']}})[_0x6382('0x27')](function(){return _0x272e48;});})[_0x6382('0x27')](function(){_0x2ab3ed[_0x6382('0x1a')](0xcc)[_0x6382('0x1b')]();});}};}function handleEntityNotFound(_0xae000,_0x272ce6){return function(_0x22deb7){if(!_0x22deb7){_0xae000[_0x6382('0x19')](0x194);}return _0x22deb7;};}function handleError(_0x25b492,_0x11ccbd){_0x11ccbd=_0x11ccbd||0x1f4;return function(_0x3db307){logger[_0x6382('0x29')](_0x3db307[_0x6382('0x2a')]);if(_0x3db307[_0x6382('0x2b')]){delete _0x3db307['name'];}_0x25b492[_0x6382('0x1a')](_0x11ccbd)['send'](_0x3db307);};}exports[_0x6382('0x2c')]=function(_0x3708cd,_0x428bc8){var _0x428e52={},_0x67ac59={},_0x107eaf={'count':0x0,'rows':[]};var _0x5d1e05=_[_0x6382('0x2d')](db[_0x6382('0x2e')]['rawAttributes'],function(_0x26cbde){return{'name':_0x26cbde['fieldName'],'type':_0x26cbde['type'][_0x6382('0x2f')]};});_0x67ac59[_0x6382('0x30')]=_['map'](_0x5d1e05,_0x6382('0x2b'));_0x67ac59['query']=_['keys'](_0x3708cd[_0x6382('0x31')]);_0x67ac59[_0x6382('0x32')]=_[_0x6382('0x33')](_0x67ac59[_0x6382('0x30')],_0x67ac59[_0x6382('0x31')]);_0x428e52[_0x6382('0x34')]=_['intersection'](_0x67ac59[_0x6382('0x30')],qs[_0x6382('0x35')](_0x3708cd[_0x6382('0x31')]['fields']));_0x428e52[_0x6382('0x34')]=_0x428e52[_0x6382('0x34')][_0x6382('0x36')]?_0x428e52[_0x6382('0x34')]:_0x67ac59[_0x6382('0x30')];if(!_0x3708cd[_0x6382('0x31')][_0x6382('0x37')](_0x6382('0x38'))){_0x428e52[_0x6382('0x20')]=qs['limit'](_0x3708cd[_0x6382('0x31')]['limit']);_0x428e52['offset']=qs[_0x6382('0x1f')](_0x3708cd[_0x6382('0x31')]['offset']);}_0x428e52[_0x6382('0x39')]=qs[_0x6382('0x3a')](_0x3708cd[_0x6382('0x31')][_0x6382('0x3a')]);_0x428e52[_0x6382('0x3b')]=qs[_0x6382('0x32')](_[_0x6382('0x3c')](_0x3708cd['query'],_0x67ac59[_0x6382('0x32')]),_0x5d1e05);if(_0x3708cd['query'][_0x6382('0x3d')]){_0x428e52['where']=_['merge'](_0x428e52[_0x6382('0x3b')],{'$or':_['map'](_0x5d1e05,function(_0x13460b){if(_0x13460b[_0x6382('0x3e')]!==_0x6382('0x3f')){var _0x468310={};_0x468310[_0x13460b[_0x6382('0x2b')]]={'$like':'%'+_0x3708cd['query'][_0x6382('0x3d')]+'%'};return _0x468310;}})});}_0x428e52=_[_0x6382('0x40')]({},_0x428e52,_0x3708cd[_0x6382('0x41')]);var _0x20144f={'where':_0x428e52[_0x6382('0x3b')]};return db[_0x6382('0x2e')]['count'](_0x20144f)[_0x6382('0x27')](function(_0x568a53){_0x107eaf[_0x6382('0x1e')]=_0x568a53;if(_0x3708cd[_0x6382('0x31')]['includeAll']){_0x428e52[_0x6382('0x42')]=[{'all':!![]}];}return db['SmsQueue']['findAll'](_0x428e52);})[_0x6382('0x27')](function(_0x203df7){_0x107eaf['rows']=_0x203df7;return _0x107eaf;})[_0x6382('0x27')](respondWithFilteredResult(_0x428bc8,_0x428e52))[_0x6382('0x43')](handleError(_0x428bc8,null));};exports[_0x6382('0x44')]=function(_0x441bc9,_0x3eb775){var _0x1d9d22={'raw':!![],'where':{'id':_0x441bc9[_0x6382('0x45')]['id']}},_0x4f1a78={};_0x4f1a78[_0x6382('0x30')]=_['keys'](db[_0x6382('0x2e')][_0x6382('0x46')]);_0x4f1a78['query']=_[_0x6382('0x47')](_0x441bc9[_0x6382('0x31')]);_0x4f1a78['filters']=_[_0x6382('0x33')](_0x4f1a78['model'],_0x4f1a78[_0x6382('0x31')]);_0x1d9d22[_0x6382('0x34')]=_['intersection'](_0x4f1a78[_0x6382('0x30')],qs[_0x6382('0x35')](_0x441bc9[_0x6382('0x31')][_0x6382('0x35')]));_0x1d9d22[_0x6382('0x34')]=_0x1d9d22[_0x6382('0x34')]['length']?_0x1d9d22['attributes']:_0x4f1a78[_0x6382('0x30')];if(_0x441bc9[_0x6382('0x31')][_0x6382('0x48')]){_0x1d9d22['include']=[{'all':!![]}];}_0x1d9d22=_['merge']({},_0x1d9d22,_0x441bc9['options']);return db[_0x6382('0x2e')]['find'](_0x1d9d22)[_0x6382('0x27')](handleEntityNotFound(_0x3eb775,null))[_0x6382('0x27')](respondWithResult(_0x3eb775,null))[_0x6382('0x43')](handleError(_0x3eb775,null));};exports[_0x6382('0x49')]=function(_0xf72d76,_0x3a3cb6){return db[_0x6382('0x2e')][_0x6382('0x49')](_0xf72d76[_0x6382('0x4a')],{})[_0x6382('0x27')](function(_0xdee60a){var _0x14865b=_0xf72d76['user']['get']({'plain':!![]});if(!_0x14865b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14865b[_0x6382('0x4b')]==='user'){var _0x1cefac=_0xdee60a['get']({'plain':!![]});var _0x138070=_0x6382('0x4c');return db[_0x6382('0x4d')][_0x6382('0x4e')]({'where':{'name':_0x138070,'userProfileId':_0x14865b[_0x6382('0x4f')]},'raw':!![]})[_0x6382('0x27')](function(_0x2b9e46){if(_0x2b9e46&&_0x2b9e46[_0x6382('0x50')]===0x0){return db[_0x6382('0x51')][_0x6382('0x49')]({'name':_0x1cefac['name'],'resourceId':_0x1cefac['id'],'type':_0x2b9e46['name'],'sectionId':_0x2b9e46['id']},{})[_0x6382('0x27')](function(){return _0xdee60a;});}else{return _0xdee60a;}})[_0x6382('0x43')](function(_0x50a983){logger[_0x6382('0x29')](_0x6382('0x52'),_0x50a983);throw _0x50a983;});}return _0xdee60a;})['then'](respondWithResult(_0x3a3cb6,0xc9))[_0x6382('0x43')](handleError(_0x3a3cb6,null));};exports[_0x6382('0x25')]=function(_0x12a291,_0x4e42c5){if(_0x12a291[_0x6382('0x4a')]['id']){delete _0x12a291[_0x6382('0x4a')]['id'];}return db[_0x6382('0x2e')]['find']({'where':{'id':_0x12a291[_0x6382('0x45')]['id']}})[_0x6382('0x27')](handleEntityNotFound(_0x4e42c5,null))[_0x6382('0x27')](saveUpdates(_0x12a291['body'],null))[_0x6382('0x27')](respondWithResult(_0x4e42c5,null))['catch'](handleError(_0x4e42c5,null));};exports[_0x6382('0x26')]=function(_0x20a727,_0x9aadb9){return db['SmsQueue'][_0x6382('0x4e')]({'where':{'id':_0x20a727[_0x6382('0x45')]['id']}})[_0x6382('0x27')](handleEntityNotFound(_0x9aadb9,null))[_0x6382('0x27')](removeEntity(_0x9aadb9,null))[_0x6382('0x43')](handleError(_0x9aadb9,null));};exports['describe']=function(_0x4541d7,_0x2e6372){return db[_0x6382('0x2e')][_0x6382('0x53')]()[_0x6382('0x27')](respondWithResult(_0x2e6372,null))[_0x6382('0x43')](handleError(_0x2e6372,null));};exports[_0x6382('0x54')]=function(_0x2de62a,_0x1a4931,_0x29a782){var _0x162d7c={'raw':!![],'where':{}},_0x34b22c={},_0x180407;return db[_0x6382('0x2e')]['findOne']({'where':{'id':_0x2de62a[_0x6382('0x45')]['id']}})[_0x6382('0x27')](handleEntityNotFound(_0x1a4931,null))[_0x6382('0x27')](function(_0x2d2db1){if(_0x2d2db1){_0x180407=_0x2d2db1[_0x6382('0x28')]({'plain':!![]});_0x34b22c[_0x6382('0x30')]=_[_0x6382('0x47')](db[_0x6382('0x55')][_0x6382('0x46')]);_0x34b22c['query']=_[_0x6382('0x47')](_0x2de62a['query']);_0x34b22c[_0x6382('0x32')]=_['intersection'](_0x34b22c['model'],_0x34b22c[_0x6382('0x31')]);_0x162d7c[_0x6382('0x34')]=_[_0x6382('0x33')](_0x34b22c[_0x6382('0x30')],qs[_0x6382('0x35')](_0x2de62a[_0x6382('0x31')][_0x6382('0x35')]));_0x162d7c[_0x6382('0x34')]=_0x162d7c[_0x6382('0x34')]['length']?_0x162d7c['attributes']:_0x34b22c[_0x6382('0x30')];if(!_0x2de62a[_0x6382('0x31')][_0x6382('0x37')](_0x6382('0x38'))){_0x162d7c['limit']=qs[_0x6382('0x20')](_0x2de62a[_0x6382('0x31')]['limit']);_0x162d7c[_0x6382('0x1f')]=qs[_0x6382('0x1f')](_0x2de62a[_0x6382('0x31')][_0x6382('0x1f')]);}_0x162d7c[_0x6382('0x39')]=qs['sort'](_0x2de62a[_0x6382('0x31')][_0x6382('0x3a')]);_0x162d7c[_0x6382('0x3b')]=qs[_0x6382('0x32')](_['pick'](_0x2de62a[_0x6382('0x31')],_0x34b22c[_0x6382('0x32')]));_0x162d7c[_0x6382('0x3b')][_0x6382('0x56')]=_0x2d2db1['id'];if(_0x2de62a[_0x6382('0x31')][_0x6382('0x3d')]){_0x162d7c[_0x6382('0x3b')]=_[_0x6382('0x40')](_0x162d7c['where'],{'$or':_[_0x6382('0x2d')](_0x162d7c[_0x6382('0x34')],function(_0x3f905a){var _0xd482aa={};_0xd482aa[_0x3f905a]={'$like':'%'+_0x2de62a[_0x6382('0x31')][_0x6382('0x3d')]+'%'};return _0xd482aa;})});}_0x162d7c=_[_0x6382('0x40')]({},_0x162d7c,_0x2de62a[_0x6382('0x41')]);return db[_0x6382('0x55')][_0x6382('0x57')](_0x162d7c);}})['then'](function(_0xfd62c1){if(_0xfd62c1){return db['User'][_0x6382('0x58')]({'where':{'id':_[_0x6382('0x2d')](_0xfd62c1,_0x6382('0x59')),'role':'agent'},'attributes':['id',_0x6382('0x2b'),_0x6382('0x5a'),_0x6382('0x5b'),'createdAt']});}})[_0x6382('0x27')](function(_0x71831c){if(_0x71831c){return{'count':_0x71831c[_0x6382('0x1e')],'rows':_['map'](_0x71831c[_0x6382('0x5c')],function(_0x2ddd5d){return{'membername':_0x2ddd5d[_0x6382('0x2b')],'UserId':_0x2ddd5d['id'],'queue_name':_0x180407[_0x6382('0x2b')],'SmsQueueId':_0x180407['id'],'interface':util[_0x6382('0x5d')](_0x6382('0x5e'),_0x6382('0x5f'),_0x2ddd5d['name']),'penalty':0x0,'paused':_0x2ddd5d[_0x6382('0x5a')],'createdAt':_0x2ddd5d[_0x6382('0x60')],'updatedAt':_0x2ddd5d[_0x6382('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6382('0x27')](respondWithFilteredResult(_0x1a4931,_0x162d7c))['catch'](handleError(_0x1a4931,null));};exports[_0x6382('0x61')]=function(_0x9e8eb0,_0x4159a4,_0x29b061){var _0x39a88e={};var _0x4d71f9={};var _0x2e3126;var _0x582421;return db[_0x6382('0x2e')][_0x6382('0x62')]({'where':{'id':_0x9e8eb0[_0x6382('0x45')]['id']}})[_0x6382('0x27')](handleEntityNotFound(_0x4159a4,null))['then'](function(_0x4609d9){if(_0x4609d9){_0x2e3126=_0x4609d9;_0x4d71f9[_0x6382('0x30')]=_['keys'](db[_0x6382('0x63')]['rawAttributes']);_0x4d71f9[_0x6382('0x31')]=_[_0x6382('0x47')](_0x9e8eb0['query']);_0x4d71f9['filters']=_[_0x6382('0x33')](_0x4d71f9[_0x6382('0x30')],_0x4d71f9[_0x6382('0x31')]);_0x39a88e[_0x6382('0x34')]=_['intersection'](_0x4d71f9[_0x6382('0x30')],qs[_0x6382('0x35')](_0x9e8eb0[_0x6382('0x31')][_0x6382('0x35')]));_0x39a88e[_0x6382('0x34')]=_0x39a88e[_0x6382('0x34')]['length']?_0x39a88e[_0x6382('0x34')]:_0x4d71f9[_0x6382('0x30')];_0x39a88e[_0x6382('0x39')]=qs[_0x6382('0x3a')](_0x9e8eb0[_0x6382('0x31')][_0x6382('0x3a')]);_0x39a88e[_0x6382('0x3b')]=qs[_0x6382('0x32')](_[_0x6382('0x3c')](_0x9e8eb0[_0x6382('0x31')],_0x4d71f9[_0x6382('0x32')]));if(_0x9e8eb0[_0x6382('0x31')][_0x6382('0x3d')]){_0x39a88e[_0x6382('0x3b')]=_[_0x6382('0x40')](_0x39a88e['where'],{'$or':_['map'](_0x39a88e['attributes'],function(_0x36c422){var _0x503936={};_0x503936[_0x36c422]={'$like':'%'+_0x9e8eb0[_0x6382('0x31')]['filter']+'%'};return _0x503936;})});}_0x39a88e=_[_0x6382('0x40')]({},_0x39a88e,_0x9e8eb0['options']);return _0x2e3126['getTeams'](_0x39a88e);}})[_0x6382('0x27')](function(_0x3733b1){if(_0x3733b1){_0x582421=_0x3733b1[_0x6382('0x36')];if(!_0x9e8eb0['query'][_0x6382('0x37')](_0x6382('0x38'))){_0x39a88e[_0x6382('0x20')]=qs[_0x6382('0x20')](_0x9e8eb0['query']['limit']);_0x39a88e['offset']=qs[_0x6382('0x1f')](_0x9e8eb0['query'][_0x6382('0x1f')]);}return _0x2e3126[_0x6382('0x61')](_0x39a88e);}})[_0x6382('0x27')](function(_0x162bae){if(_0x162bae){return _0x162bae?{'count':_0x582421,'rows':_0x162bae}:null;}})['then'](respondWithResult(_0x4159a4,null))[_0x6382('0x43')](handleError(_0x4159a4,null));};exports[_0x6382('0x64')]=function(_0x152d3d,_0x5b9e08,_0x4cc822){var _0x4fd9f1=_0x152d3d[_0x6382('0x4a')][_0x6382('0x65')];return db['Team'][_0x6382('0x57')]({'where':{'id':_0x4fd9f1},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x6382('0x2b'),'online',_0x6382('0x66'),_0x6382('0x67')],'raw':!![]}]})[_0x6382('0x27')](function(_0x4ce2c9){if(_0x4ce2c9){var _0x304cf6=_['flatMap'](_0x4ce2c9,function(_0x5b4e9b){var _0x4da722=_0x5b4e9b[_0x6382('0x28')]({'plain':!![]});return _0x4da722[_0x6382('0x68')];});return db['SmsQueue'][_0x6382('0x4e')]({'where':{'id':_0x152d3d[_0x6382('0x45')]['id']}})[_0x6382('0x27')](function(_0x299fa1){return db[_0x6382('0x69')]['transaction'](function(_0x3f995f){return _0x299fa1['addTeams'](_0x4fd9f1,{'transaction':_0x3f995f})['then'](function(){return BPromise['each'](_0x304cf6,function(_0x1dfa6b){return db[_0x6382('0x55')][_0x6382('0x6a')]({'where':{'UserId':_0x1dfa6b['id'],'SmsQueueId':_0x152d3d['params']['id']},'transaction':_0x3f995f});});})['then'](function(){_0x304cf6[_0x6382('0x6b')](function(_0x47ed72){socket[_0x6382('0x6c')](_0x6382('0x6d'),{'UserId':_0x47ed72['id'],'SmsQueueId':_0x299fa1['id']});});});});});}})[_0x6382('0x27')](respondWithStatusCode(_0x5b9e08,null))[_0x6382('0x43')](handleError(_0x5b9e08,null));};exports[_0x6382('0x6e')]=function(_0x353a4e,_0x28a0cb,_0x5613e2){return db[_0x6382('0x63')][_0x6382('0x57')]({'where':{'id':_0x353a4e[_0x6382('0x31')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6382('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x28a0cb,null))[_0x6382('0x27')](function(_0x454f1a){var _0x567d45=_[_0x6382('0x2d')](_0x454f1a,'id');var _0x3f8a13=[];var _0x9efeb1=[];var _0x8c1be2=squel[_0x6382('0x6f')]();_0x8c1be2[_0x6382('0x70')]('tq.TeamId')[_0x6382('0x71')](_0x6382('0x72'),'tq')['join']('user_has_teams','ut',_0x6382('0x73'))[_0x6382('0x3b')](_0x6382('0x74'),_0x353a4e[_0x6382('0x45')]['id']);for(var _0x1fac39=0x0;_0x1fac39<_0x454f1a[_0x6382('0x36')];_0x1fac39+=0x1){let _0x3702f3=_0x454f1a[_0x1fac39];for(var _0x225fa1=0x0;_0x225fa1<_0x3702f3[_0x6382('0x68')][_0x6382('0x36')];_0x225fa1+=0x1){let _0x314514=_0x3702f3[_0x6382('0x68')][_0x225fa1];var _0x12d30a=_0x8c1be2[_0x6382('0x75')]();_0x12d30a[_0x6382('0x3b')]('ut.UserId\x20=\x20?',_0x314514['id']);_0x9efeb1['push'](db['sequelize'][_0x6382('0x31')](_0x12d30a[_0x6382('0x76')](),{'type':db[_0x6382('0x69')][_0x6382('0x77')][_0x6382('0x78')]})[_0x6382('0x27')](function(_0x1391d7){if(_0x1391d7[_0x6382('0x36')]===0x1){return _0x314514['id'];}else{var _0x1c3972=_[_0x6382('0x79')](_['map'](_0x1391d7,_0x6382('0x7a')),function(_0x3215ea){return _[_0x6382('0x7b')](_0x567d45,_0x3215ea);});if(_0x1c3972){return _0x314514['id'];}}}));}}return BPromise[_0x6382('0x7c')](_0x9efeb1)['then'](function(_0x5b95da){_0x3f8a13=_(_0x3f8a13)[_0x6382('0x7d')](_0x5b95da)['compact']()[_0x6382('0x7e')]();return db['SmsQueue'][_0x6382('0x4e')]({'where':{'id':_0x353a4e[_0x6382('0x45')]['id']}})[_0x6382('0x27')](function(_0x54a8c4){return db[_0x6382('0x69')][_0x6382('0x7f')](function(_0x5a3ffa){return _0x54a8c4[_0x6382('0x6e')](_0x353a4e[_0x6382('0x31')][_0x6382('0x65')],{'transaction':_0x5a3ffa})[_0x6382('0x27')](function(){if(!_[_0x6382('0x80')](_0x3f8a13)){return _0x54a8c4[_0x6382('0x81')](_0x3f8a13,{'transaction':_0x5a3ffa});}})[_0x6382('0x27')](function(){_0x3f8a13[_0x6382('0x6b')](function(_0x4daa30){socket[_0x6382('0x6c')](_0x6382('0x82'),{'UserId':_0x4daa30,'SmsQueueId':_0x54a8c4['id']});});});});});});})['then'](respondWithStatusCode(_0x28a0cb,null))['catch'](handleError(_0x28a0cb,null));};exports[_0x6382('0x83')]=function(_0x27fdd4,_0x52e238,_0x1d039f){return db[_0x6382('0x2e')][_0x6382('0x4e')]({'where':{'id':_0x27fdd4[_0x6382('0x45')]['id']}})[_0x6382('0x27')](handleEntityNotFound(_0x52e238,null))[_0x6382('0x27')](function(_0x5e2ce3){if(_0x5e2ce3){return _0x5e2ce3[_0x6382('0x83')](_0x27fdd4[_0x6382('0x4a')][_0x6382('0x65')],_[_0x6382('0x84')](_0x27fdd4['body'],[_0x6382('0x65'),'id'])||{})[_0x6382('0x85')](function(_0x2585d9){for(var _0x469e24=0x0;_0x469e24<_0x27fdd4[_0x6382('0x4a')][_0x6382('0x65')][_0x6382('0x36')];_0x469e24+=0x1){socket[_0x6382('0x6c')](_0x6382('0x6d'),{'UserId':Number(_0x27fdd4[_0x6382('0x4a')][_0x6382('0x65')][_0x469e24]),'SmsQueueId':Number(_0x27fdd4[_0x6382('0x45')]['id'])});}return _0x2585d9;});}})['then'](respondWithResult(_0x52e238,null))[_0x6382('0x43')](handleError(_0x52e238,null));};exports[_0x6382('0x81')]=function(_0x33e76d,_0x29c5dd,_0x156ea1){return db[_0x6382('0x2e')][_0x6382('0x4e')]({'where':{'id':_0x33e76d[_0x6382('0x45')]['id']}})[_0x6382('0x27')](handleEntityNotFound(_0x29c5dd,null))['then'](function(_0x33d763){if(_0x33d763){return _0x33d763[_0x6382('0x81')](_0x33e76d[_0x6382('0x31')][_0x6382('0x65')])[_0x6382('0x27')](function(){if(_[_0x6382('0x86')](_0x33e76d[_0x6382('0x31')]['ids'])){for(var _0x40dcc2=0x0;_0x40dcc2<_0x33e76d[_0x6382('0x31')][_0x6382('0x65')][_0x6382('0x36')];_0x40dcc2+=0x1){socket[_0x6382('0x6c')](_0x6382('0x82'),{'UserId':Number(_0x33e76d[_0x6382('0x31')][_0x6382('0x65')][_0x40dcc2]),'SmsQueueId':Number(_0x33e76d[_0x6382('0x45')]['id'])});}}else{socket[_0x6382('0x6c')](_0x6382('0x82'),{'UserId':Number(_0x33e76d[_0x6382('0x31')][_0x6382('0x65')]),'SmsQueueId':Number(_0x33e76d['params']['id'])});}});}})[_0x6382('0x27')](respondWithStatusCode(_0x29c5dd,null))[_0x6382('0x43')](handleError(_0x29c5dd,null));};exports[_0x6382('0x87')]=function(_0x2116a8,_0x5ec30e,_0x2598de){var _0x2c180f={};var _0x17fbe2={};var _0x32d466;var _0xe5aa92;return db[_0x6382('0x2e')]['findOne']({'where':{'id':_0x2116a8['params']['id']}})[_0x6382('0x27')](handleEntityNotFound(_0x5ec30e,null))[_0x6382('0x27')](function(_0x17fcf6){if(_0x17fcf6){_0x32d466=_0x17fcf6;_0x17fbe2[_0x6382('0x30')]=_[_0x6382('0x47')](db[_0x6382('0x88')][_0x6382('0x46')]);_0x17fbe2[_0x6382('0x31')]=_[_0x6382('0x47')](_0x2116a8[_0x6382('0x31')]);_0x17fbe2['filters']=_[_0x6382('0x33')](_0x17fbe2[_0x6382('0x30')],_0x17fbe2['query']);_0x2c180f['attributes']=_['intersection'](_0x17fbe2['model'],qs[_0x6382('0x35')](_0x2116a8[_0x6382('0x31')][_0x6382('0x35')]));_0x2c180f[_0x6382('0x34')]=_0x2c180f[_0x6382('0x34')][_0x6382('0x36')]?_0x2c180f[_0x6382('0x34')]:_0x17fbe2[_0x6382('0x30')];_0x2c180f[_0x6382('0x39')]=qs[_0x6382('0x3a')](_0x2116a8[_0x6382('0x31')][_0x6382('0x3a')]);_0x2c180f[_0x6382('0x3b')]=qs[_0x6382('0x32')](_[_0x6382('0x3c')](_0x2116a8[_0x6382('0x31')],_0x17fbe2[_0x6382('0x32')]));if(_0x2116a8[_0x6382('0x31')][_0x6382('0x3d')]){_0x2c180f[_0x6382('0x3b')]=_['merge'](_0x2c180f[_0x6382('0x3b')],{'$or':_[_0x6382('0x2d')](_0x2c180f['attributes'],function(_0xed0e3c){var _0x308160={};_0x308160[_0xed0e3c]={'$like':'%'+_0x2116a8[_0x6382('0x31')][_0x6382('0x3d')]+'%'};return _0x308160;})});}_0x2c180f=_['merge']({},_0x2c180f,_0x2116a8[_0x6382('0x41')]);return _0x32d466[_0x6382('0x87')](_0x2c180f);}})[_0x6382('0x27')](function(_0x4f0b4f){if(_0x4f0b4f){_0xe5aa92=_0x4f0b4f['length'];if(!_0x2116a8[_0x6382('0x31')][_0x6382('0x37')](_0x6382('0x38'))){_0x2c180f[_0x6382('0x20')]=qs[_0x6382('0x20')](_0x2116a8[_0x6382('0x31')][_0x6382('0x20')]);_0x2c180f[_0x6382('0x1f')]=qs[_0x6382('0x1f')](_0x2116a8[_0x6382('0x31')]['offset']);}return _0x32d466[_0x6382('0x87')](_0x2c180f);}})[_0x6382('0x27')](function(_0x4be263){if(_0x4be263){return _0x4be263?{'count':_0xe5aa92,'rows':_0x4be263}:null;}})['then'](respondWithResult(_0x5ec30e,null))['catch'](handleError(_0x5ec30e,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index a2dd4a7..cfcd7d8 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 _0x483f=['SmsQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x483f,0x11c));var _0xf483=function(_0x3460ac,_0x1ab668){_0x3460ac=_0x3460ac-0x0;var _0x54df44=_0x483f[_0x3460ac];return _0x54df44;};'use strict';var EventEmitter=require(_0xf483('0x0'));var SmsQueue=require(_0xf483('0x1'))['db'][_0xf483('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xf483('0x3')](0x0);var events={'afterCreate':_0xf483('0x4'),'afterUpdate':_0xf483('0x5'),'afterDestroy':_0xf483('0x6')};function emitEvent(_0x11eb95){return function(_0x266563,_0x496ae6,_0x5bc1f5){SmsQueueEvents['emit'](_0x11eb95+':'+_0x266563['id'],_0x266563);SmsQueueEvents[_0xf483('0x7')](_0x11eb95,_0x266563);_0x5bc1f5(null);};}for(var e in events){if(events[_0xf483('0x8')](e)){var event=events[e];SmsQueue[_0xf483('0x9')](e,emitEvent(event));}}module[_0xf483('0xa')]=SmsQueueEvents; \ No newline at end of file +var _0x4564=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue'];(function(_0x47c1f4,_0x4847a5){var _0x3e17b3=function(_0x437145){while(--_0x437145){_0x47c1f4['push'](_0x47c1f4['shift']());}};_0x3e17b3(++_0x4847a5);}(_0x4564,0x101));var _0x4456=function(_0xf51dc3,_0x37b81b){_0xf51dc3=_0xf51dc3-0x0;var _0x548b6a=_0x4564[_0xf51dc3];return _0x548b6a;};'use strict';var EventEmitter=require(_0x4456('0x0'));var SmsQueue=require(_0x4456('0x1'))['db'][_0x4456('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x4456('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4456('0x4'),'afterDestroy':_0x4456('0x5')};function emitEvent(_0x4c09d2){return function(_0x5475ab,_0x29cd23,_0x817243){SmsQueueEvents[_0x4456('0x6')](_0x4c09d2+':'+_0x5475ab['id'],_0x5475ab);SmsQueueEvents[_0x4456('0x6')](_0x4c09d2,_0x5475ab);_0x817243(null);};}for(var e in events){if(events[_0x4456('0x7')](e)){var event=events[e];SmsQueue[_0x4456('0x8')](e,emitEvent(event));}}module[_0x4456('0x9')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 9c4faf4..c4fdf1f 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 _0xb113=['SmsQueue','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define'];(function(_0x1326a9,_0x4f8110){var _0x13c810=function(_0x52f8a0){while(--_0x52f8a0){_0x1326a9['push'](_0x1326a9['shift']());}};_0x13c810(++_0x4f8110);}(_0xb113,0x1ae));var _0x3b11=function(_0x4fbb86,_0x374ed0){_0x4fbb86=_0x4fbb86-0x0;var _0xb141fe=_0xb113[_0x4fbb86];return _0xb141fe;};'use strict';var _=require('lodash');var util=require(_0x3b11('0x0'));var logger=require(_0x3b11('0x1'))(_0x3b11('0x2'));var moment=require(_0x3b11('0x3'));var BPromise=require(_0x3b11('0x4'));var rp=require(_0x3b11('0x5'));var fs=require('fs');var path=require(_0x3b11('0x6'));var rimraf=require(_0x3b11('0x7'));var config=require(_0x3b11('0x8'));var attributes=require(_0x3b11('0x9'));module[_0x3b11('0xa')]=function(_0x456ab5,_0x34cd81){return _0x456ab5[_0x3b11('0xb')](_0x3b11('0xc'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a04=['../../config/environment','./smsQueue.attributes','SmsQueue','sms_queues','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x2fb2ff,_0x571b3e){var _0x3763ea=function(_0x2c7abc){while(--_0x2c7abc){_0x2fb2ff['push'](_0x2fb2ff['shift']());}};_0x3763ea(++_0x571b3e);}(_0x0a04,0x1b2));var _0x40a0=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x0a04[_0x36eaaa];return _0x461349;};'use strict';var _=require('lodash');var util=require(_0x40a0('0x0'));var logger=require(_0x40a0('0x1'))(_0x40a0('0x2'));var moment=require(_0x40a0('0x3'));var BPromise=require(_0x40a0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x40a0('0x5'));var config=require(_0x40a0('0x6'));var attributes=require(_0x40a0('0x7'));module['exports']=function(_0x3f61b8,_0x58ae04){return _0x3f61b8['define'](_0x40a0('0x8'),attributes,{'tableName':_0x40a0('0x9'),'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 6da5e31..a645276 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 _0x7e8a=['result','catch','GetSmsQueue','options','where','attributes','limit','include','map','model','ShowSmsQueue','SmsQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x7e8a,0x1b2));var _0xa7e8=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x7e8a[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0xa7e8('0x0'));var util=require(_0xa7e8('0x1'));var moment=require(_0xa7e8('0x2'));var BPromise=require(_0xa7e8('0x3'));var rs=require(_0xa7e8('0x4'));var fs=require('fs');var Redis=require(_0xa7e8('0x5'));var db=require(_0xa7e8('0x6'))['db'];var utils=require(_0xa7e8('0x7'));var logger=require('../../config/logger')(_0xa7e8('0x8'));var config=require(_0xa7e8('0x9'));var jayson=require(_0xa7e8('0xa'));var client=jayson[_0xa7e8('0xb')][_0xa7e8('0xc')]({'port':0x232a});config[_0xa7e8('0xd')]=_[_0xa7e8('0xe')](config[_0xa7e8('0xd')],{'host':_0xa7e8('0xf'),'port':0x18eb});var socket=require(_0xa7e8('0x10'))(new Redis(config[_0xa7e8('0xd')]));require(_0xa7e8('0x11'))[_0xa7e8('0x12')](socket);function respondWithRpcPromise(_0x53c8d2,_0x2c8d7e,_0x2fae1c){return new BPromise(function(_0x4bcb74,_0x1c254b){return client['request'](_0x53c8d2,_0x2fae1c)[_0xa7e8('0x13')](function(_0xfffeeb){logger[_0xa7e8('0x14')](_0xa7e8('0x15'),_0x2c8d7e,_0xa7e8('0x16'));logger[_0xa7e8('0x17')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x2c8d7e,_0xa7e8('0x16'),JSON[_0xa7e8('0x18')](_0xfffeeb));if(_0xfffeeb['error']){if(_0xfffeeb[_0xa7e8('0x19')][_0xa7e8('0x1a')]===0x1f4){logger[_0xa7e8('0x19')](_0xa7e8('0x15'),_0x2c8d7e,_0xfffeeb[_0xa7e8('0x19')][_0xa7e8('0x1b')]);return _0x1c254b(_0xfffeeb[_0xa7e8('0x19')][_0xa7e8('0x1b')]);}logger[_0xa7e8('0x19')](_0xa7e8('0x15'),_0x2c8d7e,_0xfffeeb[_0xa7e8('0x19')][_0xa7e8('0x1b')]);return _0x4bcb74(_0xfffeeb[_0xa7e8('0x19')][_0xa7e8('0x1b')]);}else{logger[_0xa7e8('0x14')]('SmsQueue,\x20%s,\x20%s',_0x2c8d7e,'request\x20sent');_0x4bcb74(_0xfffeeb[_0xa7e8('0x1c')][_0xa7e8('0x1b')]);}})[_0xa7e8('0x1d')](function(_0xb08bbf){logger[_0xa7e8('0x19')](_0xa7e8('0x15'),_0x2c8d7e,_0xb08bbf);_0x1c254b(_0xb08bbf);});});}exports[_0xa7e8('0x1e')]=function(_0xabe2c){var _0x57150e=this;return new Promise(function(_0x52abb2,_0x3dc8d1){return db['SmsQueue']['findAll']({'raw':_0xabe2c['options']?_0xabe2c[_0xa7e8('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0xabe2c['options']?_0xabe2c[_0xa7e8('0x1f')][_0xa7e8('0x20')]||null:null,'attributes':_0xabe2c['options']?_0xabe2c[_0xa7e8('0x1f')][_0xa7e8('0x21')]||null:null,'limit':_0xabe2c[_0xa7e8('0x1f')]?_0xabe2c[_0xa7e8('0x1f')][_0xa7e8('0x22')]||null:null,'include':_0xabe2c[_0xa7e8('0x1f')]?_0xabe2c['options'][_0xa7e8('0x23')]?_[_0xa7e8('0x24')](_0xabe2c[_0xa7e8('0x1f')]['include'],function(_0x2be69e){return{'model':db[_0x2be69e[_0xa7e8('0x25')]],'as':_0x2be69e['as'],'attributes':_0x2be69e[_0xa7e8('0x21')],'include':_0x2be69e[_0xa7e8('0x23')]?_[_0xa7e8('0x24')](_0x2be69e[_0xa7e8('0x23')],function(_0x170481){return{'model':db[_0x170481[_0xa7e8('0x25')]],'as':_0x170481['as'],'attributes':_0x170481[_0xa7e8('0x21')],'include':_0x170481['include']?_[_0xa7e8('0x24')](_0x170481['include'],function(_0x326608){return{'model':db[_0x326608['model']],'as':_0x326608['as'],'attributes':_0x326608[_0xa7e8('0x21')]};}):[]};}):[]};}):[]:[]})[_0xa7e8('0x13')](function(_0x5a6f89){logger[_0xa7e8('0x14')](_0xa7e8('0x1e'),_0xabe2c);logger[_0xa7e8('0x17')](_0xa7e8('0x1e'),_0xabe2c,JSON[_0xa7e8('0x18')](_0x5a6f89));_0x52abb2(_0x5a6f89);})[_0xa7e8('0x1d')](function(_0x84934e){logger[_0xa7e8('0x19')]('GetSmsQueue',_0x84934e['message'],_0xabe2c);_0x3dc8d1(_0x57150e['error'](0x1f4,_0x84934e['message']));});});};exports[_0xa7e8('0x26')]=function(_0x2e0942){var _0x4367f3=this;return new Promise(function(_0x1e380f,_0x27536f){return db[_0xa7e8('0x27')][_0xa7e8('0x28')]({'raw':_0x2e0942[_0xa7e8('0x1f')]?_0x2e0942[_0xa7e8('0x1f')][_0xa7e8('0x29')]===undefined?!![]:![]:!![],'where':_0x2e0942[_0xa7e8('0x1f')]?_0x2e0942[_0xa7e8('0x1f')][_0xa7e8('0x20')]||null:null,'attributes':_0x2e0942[_0xa7e8('0x1f')]?_0x2e0942['options'][_0xa7e8('0x21')]||null:null,'include':_0x2e0942[_0xa7e8('0x1f')]?_0x2e0942[_0xa7e8('0x1f')][_0xa7e8('0x23')]?_[_0xa7e8('0x24')](_0x2e0942[_0xa7e8('0x1f')][_0xa7e8('0x23')],function(_0x2019c8){return{'model':db[_0x2019c8[_0xa7e8('0x25')]],'as':_0x2019c8['as'],'attributes':_0x2019c8[_0xa7e8('0x21')],'include':_0x2019c8['include']?_[_0xa7e8('0x24')](_0x2019c8[_0xa7e8('0x23')],function(_0x35b7e1){return{'model':db[_0x35b7e1['model']],'as':_0x35b7e1['as'],'attributes':_0x35b7e1[_0xa7e8('0x21')],'include':_0x35b7e1[_0xa7e8('0x23')]?_[_0xa7e8('0x24')](_0x35b7e1['include'],function(_0x15f6c6){return{'model':db[_0x15f6c6['model']],'as':_0x15f6c6['as'],'attributes':_0x15f6c6[_0xa7e8('0x21')]};}):[]};}):[]};}):[]:[]})[_0xa7e8('0x13')](function(_0x3b45ff){logger[_0xa7e8('0x14')](_0xa7e8('0x26'),_0x2e0942);logger['debug'](_0xa7e8('0x26'),_0x2e0942,JSON['stringify'](_0x3b45ff));_0x1e380f(_0x3b45ff);})[_0xa7e8('0x1d')](function(_0x71ba35){logger[_0xa7e8('0x19')](_0xa7e8('0x26'),_0x71ba35[_0xa7e8('0x1b')],_0x2e0942);_0x27536f(_0x4367f3[_0xa7e8('0x19')](0x1f4,_0x71ba35[_0xa7e8('0x1b')]));});});}; \ No newline at end of file +var _0xbde7=['result','GetSmsQueue','SmsQueue','options','raw','where','limit','map','include','model','attributes','then','ShowSmsQueue','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x1463f5,_0x4a1ef4){var _0x4cf248=function(_0x5392dd){while(--_0x5392dd){_0x1463f5['push'](_0x1463f5['shift']());}};_0x4cf248(++_0x4a1ef4);}(_0xbde7,0x11f));var _0x7bde=function(_0x5e78e7,_0x50be14){_0x5e78e7=_0x5e78e7-0x0;var _0xfa445f=_0xbde7[_0x5e78e7];return _0xfa445f;};'use strict';var _=require(_0x7bde('0x0'));var util=require(_0x7bde('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7bde('0x2'));var fs=require('fs');var Redis=require(_0x7bde('0x3'));var db=require(_0x7bde('0x4'))['db'];var utils=require(_0x7bde('0x5'));var logger=require('../../config/logger')(_0x7bde('0x6'));var config=require('../../config/environment');var jayson=require(_0x7bde('0x7'));var client=jayson[_0x7bde('0x8')][_0x7bde('0x9')]({'port':0x232a});config[_0x7bde('0xa')]=_[_0x7bde('0xb')](config[_0x7bde('0xa')],{'host':_0x7bde('0xc'),'port':0x18eb});var socket=require(_0x7bde('0xd'))(new Redis(config['redis']));require(_0x7bde('0xe'))[_0x7bde('0xf')](socket);function respondWithRpcPromise(_0x4a7f59,_0x8f9325,_0x1c1be1){return new BPromise(function(_0x5f1c78,_0x4fe712){return client[_0x7bde('0x10')](_0x4a7f59,_0x1c1be1)['then'](function(_0x4e1e23){logger[_0x7bde('0x11')](_0x7bde('0x12'),_0x8f9325,_0x7bde('0x13'));logger[_0x7bde('0x14')](_0x7bde('0x15'),_0x8f9325,_0x7bde('0x13'),JSON[_0x7bde('0x16')](_0x4e1e23));if(_0x4e1e23[_0x7bde('0x17')]){if(_0x4e1e23[_0x7bde('0x17')]['code']===0x1f4){logger['error'](_0x7bde('0x12'),_0x8f9325,_0x4e1e23[_0x7bde('0x17')][_0x7bde('0x18')]);return _0x4fe712(_0x4e1e23[_0x7bde('0x17')][_0x7bde('0x18')]);}logger[_0x7bde('0x17')]('SmsQueue,\x20%s,\x20%s',_0x8f9325,_0x4e1e23[_0x7bde('0x17')][_0x7bde('0x18')]);return _0x5f1c78(_0x4e1e23[_0x7bde('0x17')][_0x7bde('0x18')]);}else{logger['info'](_0x7bde('0x12'),_0x8f9325,_0x7bde('0x13'));_0x5f1c78(_0x4e1e23[_0x7bde('0x19')]['message']);}})['catch'](function(_0x2fdd60){logger[_0x7bde('0x17')](_0x7bde('0x12'),_0x8f9325,_0x2fdd60);_0x4fe712(_0x2fdd60);});});}exports[_0x7bde('0x1a')]=function(_0x168167){var _0x21a9b7=this;return new Promise(function(_0x4ff68a,_0x324d95){return db[_0x7bde('0x1b')]['findAll']({'raw':_0x168167[_0x7bde('0x1c')]?_0x168167[_0x7bde('0x1c')][_0x7bde('0x1d')]===undefined?!![]:![]:!![],'where':_0x168167[_0x7bde('0x1c')]?_0x168167['options'][_0x7bde('0x1e')]||null:null,'attributes':_0x168167[_0x7bde('0x1c')]?_0x168167[_0x7bde('0x1c')]['attributes']||null:null,'limit':_0x168167[_0x7bde('0x1c')]?_0x168167[_0x7bde('0x1c')][_0x7bde('0x1f')]||null:null,'include':_0x168167['options']?_0x168167[_0x7bde('0x1c')]['include']?_[_0x7bde('0x20')](_0x168167[_0x7bde('0x1c')][_0x7bde('0x21')],function(_0x1ec731){return{'model':db[_0x1ec731[_0x7bde('0x22')]],'as':_0x1ec731['as'],'attributes':_0x1ec731[_0x7bde('0x23')],'include':_0x1ec731[_0x7bde('0x21')]?_[_0x7bde('0x20')](_0x1ec731[_0x7bde('0x21')],function(_0x31d6dd){return{'model':db[_0x31d6dd[_0x7bde('0x22')]],'as':_0x31d6dd['as'],'attributes':_0x31d6dd[_0x7bde('0x23')],'include':_0x31d6dd['include']?_[_0x7bde('0x20')](_0x31d6dd[_0x7bde('0x21')],function(_0x3fdd40){return{'model':db[_0x3fdd40[_0x7bde('0x22')]],'as':_0x3fdd40['as'],'attributes':_0x3fdd40[_0x7bde('0x23')]};}):[]};}):[]};}):[]:[]})[_0x7bde('0x24')](function(_0x312e43){logger[_0x7bde('0x11')](_0x7bde('0x1a'),_0x168167);logger['debug'](_0x7bde('0x1a'),_0x168167,JSON[_0x7bde('0x16')](_0x312e43));_0x4ff68a(_0x312e43);})['catch'](function(_0x2c1cee){logger['error'](_0x7bde('0x1a'),_0x2c1cee[_0x7bde('0x18')],_0x168167);_0x324d95(_0x21a9b7['error'](0x1f4,_0x2c1cee['message']));});});};exports[_0x7bde('0x25')]=function(_0x3eef98){var _0x3d4077=this;return new Promise(function(_0x1c63a8,_0x2d3aac){return db[_0x7bde('0x1b')][_0x7bde('0x26')]({'raw':_0x3eef98[_0x7bde('0x1c')]?_0x3eef98[_0x7bde('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3eef98['options']?_0x3eef98[_0x7bde('0x1c')]['where']||null:null,'attributes':_0x3eef98[_0x7bde('0x1c')]?_0x3eef98['options'][_0x7bde('0x23')]||null:null,'include':_0x3eef98[_0x7bde('0x1c')]?_0x3eef98[_0x7bde('0x1c')]['include']?_['map'](_0x3eef98[_0x7bde('0x1c')][_0x7bde('0x21')],function(_0x1db085){return{'model':db[_0x1db085[_0x7bde('0x22')]],'as':_0x1db085['as'],'attributes':_0x1db085[_0x7bde('0x23')],'include':_0x1db085[_0x7bde('0x21')]?_[_0x7bde('0x20')](_0x1db085['include'],function(_0x15941e){return{'model':db[_0x15941e['model']],'as':_0x15941e['as'],'attributes':_0x15941e[_0x7bde('0x23')],'include':_0x15941e[_0x7bde('0x21')]?_[_0x7bde('0x20')](_0x15941e[_0x7bde('0x21')],function(_0xa1ee6d){return{'model':db[_0xa1ee6d['model']],'as':_0xa1ee6d['as'],'attributes':_0xa1ee6d[_0x7bde('0x23')]};}):[]};}):[]};}):[]:[]})[_0x7bde('0x24')](function(_0x33f4aa){logger[_0x7bde('0x11')](_0x7bde('0x25'),_0x3eef98);logger[_0x7bde('0x14')]('ShowSmsQueue',_0x3eef98,JSON['stringify'](_0x33f4aa));_0x1c63a8(_0x33f4aa);})['catch'](function(_0x14572a){logger[_0x7bde('0x17')]('ShowSmsQueue',_0x14572a['message'],_0x3eef98);_0x2d3aac(_0x3d4077[_0x7bde('0x17')](0x1f4,_0x14572a[_0x7bde('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index a8876e9..5348aab 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 _0x710e=['update','emit','removeListener','smsQueue:','./smsQueue.events','remove'];(function(_0x372b9a,_0x4b6f21){var _0x369b3f=function(_0x2d7ad6){while(--_0x2d7ad6){_0x372b9a['push'](_0x372b9a['shift']());}};_0x369b3f(++_0x4b6f21);}(_0x710e,0xc4));var _0xe710=function(_0x1e8640,_0x351bb6){_0x1e8640=_0x1e8640-0x0;var _0x50666e=_0x710e[_0x1e8640];return _0x50666e;};'use strict';var SmsQueueEvents=require(_0xe710('0x0'));var events=['save',_0xe710('0x1'),_0xe710('0x2')];function createListener(_0x14c3eb,_0x3da41c){return function(_0x46a470){_0x3da41c[_0xe710('0x3')](_0x14c3eb,_0x46a470);};}function removeListener(_0x4408e8,_0x39af7e){return function(){SmsQueueEvents[_0xe710('0x4')](_0x4408e8,_0x39af7e);};}exports['register']=function(_0x18a509){for(var _0x317631=0x0,_0x4359ab=events['length'];_0x317631<_0x4359ab;_0x317631++){var _0x36588c=events[_0x317631];var _0xc5b683=createListener(_0xe710('0x5')+_0x36588c,_0x18a509);SmsQueueEvents['on'](_0x36588c,_0xc5b683);}}; \ No newline at end of file +var _0xc1e1=['remove','update','emit','removeListener','length','./smsQueue.events','save'];(function(_0x51a47f,_0x3bdb73){var _0x3cc389=function(_0x5ad005){while(--_0x5ad005){_0x51a47f['push'](_0x51a47f['shift']());}};_0x3cc389(++_0x3bdb73);}(_0xc1e1,0x19b));var _0x1c1e=function(_0x41dc45,_0x5d55f7){_0x41dc45=_0x41dc45-0x0;var _0x50d165=_0xc1e1[_0x41dc45];return _0x50d165;};'use strict';var SmsQueueEvents=require(_0x1c1e('0x0'));var events=[_0x1c1e('0x1'),_0x1c1e('0x2'),_0x1c1e('0x3')];function createListener(_0xc9fc0a,_0x84ef40){return function(_0x22614f){_0x84ef40[_0x1c1e('0x4')](_0xc9fc0a,_0x22614f);};}function removeListener(_0x1903ea,_0x21aef5){return function(){SmsQueueEvents[_0x1c1e('0x5')](_0x1903ea,_0x21aef5);};}exports['register']=function(_0x19a55b){for(var _0x1cf612=0x0,_0x31e4c2=events[_0x1c1e('0x6')];_0x1cf612<_0x31e4c2;_0x1cf612++){var _0x289a62=events[_0x1cf612];var _0x25c146=createListener('smsQueue:'+_0x289a62,_0x19a55b);SmsQueueEvents['on'](_0x289a62,_0x25c146);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index b755879..0ae0347 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 _0xfb15=['describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated'];(function(_0x5d56be,_0x1705c3){var _0x56ba6e=function(_0x1b677e){while(--_0x1b677e){_0x5d56be['push'](_0x5d56be['shift']());}};_0x56ba6e(++_0x1705c3);}(_0xfb15,0x12f));var _0x5fb1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfb15[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x5fb1('0x0'));var util=require(_0x5fb1('0x1'));var path=require(_0x5fb1('0x2'));var timeout=require(_0x5fb1('0x3'));var express=require(_0x5fb1('0x4'));var router=express[_0x5fb1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5fb1('0x6'));var interaction=require(_0x5fb1('0x7'));var config=require(_0x5fb1('0x8'));var controller=require(_0x5fb1('0x9'));router[_0x5fb1('0xa')]('/',auth[_0x5fb1('0xb')](),controller['index']);router[_0x5fb1('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x5fb1('0xc')]);router[_0x5fb1('0xa')](_0x5fb1('0xd'),auth[_0x5fb1('0xb')](),controller[_0x5fb1('0xe')]);router[_0x5fb1('0xf')]('/',auth[_0x5fb1('0xb')](),controller[_0x5fb1('0x10')]);router[_0x5fb1('0x11')](_0x5fb1('0xd'),auth[_0x5fb1('0xb')](),controller[_0x5fb1('0x12')]);router[_0x5fb1('0x13')]('/:id',auth[_0x5fb1('0xb')](),controller[_0x5fb1('0x14')]);module['exports']=router; \ No newline at end of file +var _0x30e9=['./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x30e9,0x158));var _0x930e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x30e9[_0x5783f4];return _0x28e380;};'use strict';var multer=require(_0x930e('0x0'));var util=require(_0x930e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x930e('0x2'));var router=express[_0x930e('0x3')]();var fs_extra=require(_0x930e('0x4'));var auth=require(_0x930e('0x5'));var interaction=require(_0x930e('0x6'));var config=require(_0x930e('0x7'));var controller=require(_0x930e('0x8'));router[_0x930e('0x9')]('/',auth[_0x930e('0xa')](),controller[_0x930e('0xb')]);router[_0x930e('0x9')](_0x930e('0xc'),auth[_0x930e('0xa')](),controller[_0x930e('0xd')]);router[_0x930e('0x9')](_0x930e('0xe'),auth[_0x930e('0xa')](),controller[_0x930e('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x930e('0x10')]);router[_0x930e('0x11')](_0x930e('0xe'),auth[_0x930e('0xa')](),controller[_0x930e('0x12')]);router[_0x930e('0x13')](_0x930e('0xe'),auth[_0x930e('0xa')](),controller[_0x930e('0x14')]);module[_0x930e('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index b28c6cd..06e8a04 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 _0xfbc3=['DATE','moment','sequelize','STRING'];(function(_0x3cbe2f,_0x3ce8fc){var _0x46b0ad=function(_0x3b90f2){while(--_0x3b90f2){_0x3cbe2f['push'](_0x3cbe2f['shift']());}};_0x46b0ad(++_0x3ce8fc);}(_0xfbc3,0x19d));var _0x3fbc=function(_0x246f7e,_0x449e00){_0x246f7e=_0x246f7e-0x0;var _0x50d201=_0xfbc3[_0x246f7e];return _0x50d201;};'use strict';var moment=require(_0x3fbc('0x0'));var Sequelize=require(_0x3fbc('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x3fbc('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x3fbc('0x3')]},'acceptAt':{'type':Sequelize[_0x3fbc('0x3')]},'exitAt':{'type':Sequelize[_0x3fbc('0x3')]},'reason':{'type':Sequelize[_0x3fbc('0x2')]}}; \ No newline at end of file +var _0x521e=['STRING','DATE'];(function(_0x5008c8,_0x342e4a){var _0x28d778=function(_0x2dd365){while(--_0x2dd365){_0x5008c8['push'](_0x5008c8['shift']());}};_0x28d778(++_0x342e4a);}(_0x521e,0x86));var _0xe521=function(_0xd2e465,_0x39e5e8){_0xd2e465=_0xd2e465-0x0;var _0x16eb40=_0x521e[_0xd2e465];return _0x16eb40;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xe521('0x0')],'allowNull':![]},'from':{'type':Sequelize[_0xe521('0x0')]},'joinAt':{'type':Sequelize[_0xe521('0x1')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xe521('0x1')]},'exitAt':{'type':Sequelize[_0xe521('0x1')]},'reason':{'type':Sequelize[_0xe521('0x0')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index bd4f0d1..750e1fe 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 _0xb8ab=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','options','then','includeAll','findAll','rows','show','params','keys','merge','create','body','catch','destroy','find','describe','eml-format','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x3af297,_0xfeba26){var _0x1545f3=function(_0x103f8f){while(--_0x103f8f){_0x3af297['push'](_0x3af297['shift']());}};_0x1545f3(++_0xfeba26);}(_0xb8ab,0xd4));var _0xbb8a=function(_0x5cdd24,_0x3eb2e6){_0x5cdd24=_0x5cdd24-0x0;var _0x12d498=_0xb8ab[_0x5cdd24];return _0x12d498;};'use strict';var emlformat=require(_0xbb8a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbb8a('0x1'));var BPromise=require(_0xbb8a('0x2'));var Mustache=require(_0xbb8a('0x3'));var util=require('util');var path=require('path');var sox=require(_0xbb8a('0x4'));var csv=require(_0xbb8a('0x5'));var ejs=require(_0xbb8a('0x6'));var fs=require('fs');var fs_extra=require(_0xbb8a('0x7'));var _=require(_0xbb8a('0x8'));var squel=require(_0xbb8a('0x9'));var crypto=require(_0xbb8a('0xa'));var jsforce=require(_0xbb8a('0xb'));var deskjs=require(_0xbb8a('0xc'));var toCsv=require(_0xbb8a('0x5'));var querystring=require('querystring');var Papa=require(_0xbb8a('0xd'));var Redis=require(_0xbb8a('0xe'));var authService=require(_0xbb8a('0xf'));var qs=require(_0xbb8a('0x10'));var as=require(_0xbb8a('0x11'));var hardwareService=require(_0xbb8a('0x12'));var logger=require('../../config/logger')(_0xbb8a('0x13'));var utils=require('../../config/utils');var config=require(_0xbb8a('0x14'));var licenseUtil=require(_0xbb8a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2cc182,_0x185dc2){_0x185dc2=_0x185dc2||0xcc;return function(_0x1fda01){if(_0x1fda01){return _0x2cc182[_0xbb8a('0x16')](_0x185dc2);}return _0x2cc182[_0xbb8a('0x17')](_0x185dc2)[_0xbb8a('0x18')]();};}function respondWithResult(_0x155326,_0x1118fb){_0x1118fb=_0x1118fb||0xc8;return function(_0x574e95){if(_0x574e95){return _0x155326[_0xbb8a('0x17')](_0x1118fb)[_0xbb8a('0x19')](_0x574e95);}};}function respondWithFilteredResult(_0x3d04e7,_0x2a4b23){return function(_0x5ba2a9){if(_0x5ba2a9){var _0x2d19a5=typeof _0x2a4b23[_0xbb8a('0x1a')]==='undefined'&&typeof _0x2a4b23[_0xbb8a('0x1b')]===_0xbb8a('0x1c');var _0x3d649e=_0x5ba2a9[_0xbb8a('0x1d')];var _0x4e4b73=_0x2d19a5?0x0:_0x2a4b23['offset'];var _0x28d5fa=_0x2d19a5?_0x5ba2a9[_0xbb8a('0x1d')]:_0x2a4b23[_0xbb8a('0x1a')]+_0x2a4b23[_0xbb8a('0x1b')];var _0x2ef854;if(_0x28d5fa>=_0x3d649e){_0x28d5fa=_0x3d649e;_0x2ef854=0xc8;}else{_0x2ef854=0xce;}_0x3d04e7[_0xbb8a('0x17')](_0x2ef854);return _0x3d04e7['set'](_0xbb8a('0x1e'),_0x4e4b73+'-'+_0x28d5fa+'/'+_0x3d649e)['json'](_0x5ba2a9);}return null;};}function patchUpdates(_0x4e8178){return function(_0x514242){try{jsonpatch[_0xbb8a('0x1f')](_0x514242,_0x4e8178,!![]);}catch(_0x34e971){return BPromise[_0xbb8a('0x20')](_0x34e971);}return _0x514242[_0xbb8a('0x21')]();};}function saveUpdates(_0x22d4ec,_0x393979){return function(_0x3e4214){if(_0x3e4214){return _0x3e4214[_0xbb8a('0x22')](_0x22d4ec)['then'](function(_0x46ed99){return _0x46ed99;});}return null;};}function removeEntity(_0x5f039b,_0x512ac6){return function(_0x589631){if(_0x589631){return _0x589631['destroy']()['then'](function(){_0x5f039b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x658aa6,_0x25fe6b){return function(_0xfb008a){if(!_0xfb008a){_0x658aa6[_0xbb8a('0x16')](0x194);}return _0xfb008a;};}function handleError(_0x9fc0d0,_0x3cd906){_0x3cd906=_0x3cd906||0x1f4;return function(_0x1f7462){logger[_0xbb8a('0x23')](_0x1f7462[_0xbb8a('0x24')]);if(_0x1f7462[_0xbb8a('0x25')]){delete _0x1f7462[_0xbb8a('0x25')];}_0x9fc0d0[_0xbb8a('0x17')](_0x3cd906)[_0xbb8a('0x26')](_0x1f7462);};}exports[_0xbb8a('0x27')]=function(_0x1f8b4c,_0x43a116){var _0x4d1c0d={},_0x4e3e32={},_0x1dcc5b={'count':0x0,'rows':[]};var _0x26e95c=_[_0xbb8a('0x28')](db[_0xbb8a('0x29')][_0xbb8a('0x2a')],function(_0x5f3891){return{'name':_0x5f3891[_0xbb8a('0x2b')],'type':_0x5f3891[_0xbb8a('0x2c')][_0xbb8a('0x2d')]};});_0x4e3e32['model']=_[_0xbb8a('0x28')](_0x26e95c,_0xbb8a('0x25'));_0x4e3e32[_0xbb8a('0x2e')]=_['keys'](_0x1f8b4c[_0xbb8a('0x2e')]);_0x4e3e32[_0xbb8a('0x2f')]=_[_0xbb8a('0x30')](_0x4e3e32[_0xbb8a('0x31')],_0x4e3e32[_0xbb8a('0x2e')]);_0x4d1c0d[_0xbb8a('0x32')]=_[_0xbb8a('0x30')](_0x4e3e32['model'],qs[_0xbb8a('0x33')](_0x1f8b4c[_0xbb8a('0x2e')]['fields']));_0x4d1c0d[_0xbb8a('0x32')]=_0x4d1c0d[_0xbb8a('0x32')][_0xbb8a('0x34')]?_0x4d1c0d['attributes']:_0x4e3e32[_0xbb8a('0x31')];if(!_0x1f8b4c[_0xbb8a('0x2e')][_0xbb8a('0x35')](_0xbb8a('0x36'))){_0x4d1c0d[_0xbb8a('0x1b')]=qs[_0xbb8a('0x1b')](_0x1f8b4c[_0xbb8a('0x2e')][_0xbb8a('0x1b')]);_0x4d1c0d[_0xbb8a('0x1a')]=qs['offset'](_0x1f8b4c[_0xbb8a('0x2e')][_0xbb8a('0x1a')]);}_0x4d1c0d[_0xbb8a('0x37')]=qs[_0xbb8a('0x38')](_0x1f8b4c[_0xbb8a('0x2e')][_0xbb8a('0x38')]);_0x4d1c0d['where']=qs[_0xbb8a('0x2f')](_['pick'](_0x1f8b4c[_0xbb8a('0x2e')],_0x4e3e32[_0xbb8a('0x2f')]),_0x26e95c);if(_0x1f8b4c[_0xbb8a('0x2e')][_0xbb8a('0x39')]){_0x4d1c0d['where']=_['merge'](_0x4d1c0d[_0xbb8a('0x3a')],{'$or':_[_0xbb8a('0x28')](_0x26e95c,function(_0xb3c59){if(_0xb3c59['type']!==_0xbb8a('0x3b')){var _0x4fe569={};_0x4fe569[_0xb3c59['name']]={'$like':'%'+_0x1f8b4c[_0xbb8a('0x2e')]['filter']+'%'};return _0x4fe569;}})});}_0x4d1c0d=_['merge']({},_0x4d1c0d,_0x1f8b4c[_0xbb8a('0x3c')]);var _0x55861a={'where':_0x4d1c0d[_0xbb8a('0x3a')]};return db[_0xbb8a('0x29')][_0xbb8a('0x1d')](_0x55861a)[_0xbb8a('0x3d')](function(_0x182ff8){_0x1dcc5b[_0xbb8a('0x1d')]=_0x182ff8;if(_0x1f8b4c['query'][_0xbb8a('0x3e')]){_0x4d1c0d['include']=[{'all':!![]}];}return db['SmsQueueReport'][_0xbb8a('0x3f')](_0x4d1c0d);})[_0xbb8a('0x3d')](function(_0x388825){_0x1dcc5b[_0xbb8a('0x40')]=_0x388825;return _0x1dcc5b;})['then'](respondWithFilteredResult(_0x43a116,_0x4d1c0d))['catch'](handleError(_0x43a116,null));};exports[_0xbb8a('0x41')]=function(_0x285bc4,_0xc20a0e){var _0x8baee9={'raw':!![],'where':{'id':_0x285bc4[_0xbb8a('0x42')]['id']}},_0x4aa3c3={};_0x4aa3c3[_0xbb8a('0x31')]=_[_0xbb8a('0x43')](db[_0xbb8a('0x29')][_0xbb8a('0x2a')]);_0x4aa3c3[_0xbb8a('0x2e')]=_['keys'](_0x285bc4[_0xbb8a('0x2e')]);_0x4aa3c3[_0xbb8a('0x2f')]=_[_0xbb8a('0x30')](_0x4aa3c3[_0xbb8a('0x31')],_0x4aa3c3[_0xbb8a('0x2e')]);_0x8baee9[_0xbb8a('0x32')]=_[_0xbb8a('0x30')](_0x4aa3c3['model'],qs[_0xbb8a('0x33')](_0x285bc4[_0xbb8a('0x2e')][_0xbb8a('0x33')]));_0x8baee9['attributes']=_0x8baee9[_0xbb8a('0x32')][_0xbb8a('0x34')]?_0x8baee9['attributes']:_0x4aa3c3[_0xbb8a('0x31')];if(_0x285bc4[_0xbb8a('0x2e')][_0xbb8a('0x3e')]){_0x8baee9['include']=[{'all':!![]}];}_0x8baee9=_[_0xbb8a('0x44')]({},_0x8baee9,_0x285bc4[_0xbb8a('0x3c')]);return db[_0xbb8a('0x29')]['find'](_0x8baee9)[_0xbb8a('0x3d')](handleEntityNotFound(_0xc20a0e,null))[_0xbb8a('0x3d')](respondWithResult(_0xc20a0e,null))['catch'](handleError(_0xc20a0e,null));};exports[_0xbb8a('0x45')]=function(_0x27c1da,_0x2334c5){return db['SmsQueueReport']['create'](_0x27c1da[_0xbb8a('0x46')],{})[_0xbb8a('0x3d')](respondWithResult(_0x2334c5,0xc9))[_0xbb8a('0x47')](handleError(_0x2334c5,null));};exports[_0xbb8a('0x22')]=function(_0x2037c4,_0x5b1979){if(_0x2037c4['body']['id']){delete _0x2037c4[_0xbb8a('0x46')]['id'];}return db[_0xbb8a('0x29')]['find']({'where':{'id':_0x2037c4[_0xbb8a('0x42')]['id']}})[_0xbb8a('0x3d')](handleEntityNotFound(_0x5b1979,null))[_0xbb8a('0x3d')](saveUpdates(_0x2037c4[_0xbb8a('0x46')],null))[_0xbb8a('0x3d')](respondWithResult(_0x5b1979,null))[_0xbb8a('0x47')](handleError(_0x5b1979,null));};exports[_0xbb8a('0x48')]=function(_0x50f72a,_0x5703b2){return db[_0xbb8a('0x29')][_0xbb8a('0x49')]({'where':{'id':_0x50f72a[_0xbb8a('0x42')]['id']}})['then'](handleEntityNotFound(_0x5703b2,null))[_0xbb8a('0x3d')](removeEntity(_0x5703b2,null))[_0xbb8a('0x47')](handleError(_0x5703b2,null));};exports[_0xbb8a('0x4a')]=function(_0x20f433,_0xf1678b){return db[_0xbb8a('0x29')]['describe']()[_0xbb8a('0x3d')](respondWithResult(_0xf1678b,null))[_0xbb8a('0x47')](handleError(_0xf1678b,null));}; \ No newline at end of file +var _0xc5c3=['api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','error','name','index','map','SmsQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','then','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0xc5c3,0x17c));var _0x3c5c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc5c3[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3c5c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3c5c('0x1'));var jsonpatch=require(_0x3c5c('0x2'));var rp=require(_0x3c5c('0x3'));var moment=require(_0x3c5c('0x4'));var BPromise=require(_0x3c5c('0x5'));var Mustache=require(_0x3c5c('0x6'));var util=require(_0x3c5c('0x7'));var path=require(_0x3c5c('0x8'));var sox=require(_0x3c5c('0x9'));var csv=require(_0x3c5c('0xa'));var ejs=require(_0x3c5c('0xb'));var fs=require('fs');var fs_extra=require(_0x3c5c('0xc'));var _=require(_0x3c5c('0xd'));var squel=require(_0x3c5c('0xe'));var crypto=require('crypto');var jsforce=require(_0x3c5c('0xf'));var deskjs=require(_0x3c5c('0x10'));var toCsv=require(_0x3c5c('0xa'));var querystring=require(_0x3c5c('0x11'));var Papa=require(_0x3c5c('0x12'));var Redis=require(_0x3c5c('0x13'));var authService=require(_0x3c5c('0x14'));var qs=require(_0x3c5c('0x15'));var as=require(_0x3c5c('0x16'));var hardwareService=require(_0x3c5c('0x17'));var logger=require(_0x3c5c('0x18'))(_0x3c5c('0x19'));var utils=require(_0x3c5c('0x1a'));var config=require(_0x3c5c('0x1b'));var licenseUtil=require(_0x3c5c('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32c801,_0x1965df){_0x1965df=_0x1965df||0xcc;return function(_0x158a11){if(_0x158a11){return _0x32c801[_0x3c5c('0x1d')](_0x1965df);}return _0x32c801[_0x3c5c('0x1e')](_0x1965df)[_0x3c5c('0x1f')]();};}function respondWithResult(_0x48f129,_0x301282){_0x301282=_0x301282||0xc8;return function(_0x58eb04){if(_0x58eb04){return _0x48f129[_0x3c5c('0x1e')](_0x301282)[_0x3c5c('0x20')](_0x58eb04);}};}function respondWithFilteredResult(_0x1e86d1,_0x4506b9){return function(_0x579d4e){if(_0x579d4e){var _0x3dfa90=typeof _0x4506b9[_0x3c5c('0x21')]==='undefined'&&typeof _0x4506b9[_0x3c5c('0x22')]===_0x3c5c('0x23');var _0x4bb6f5=_0x579d4e[_0x3c5c('0x24')];var _0x5afbb5=_0x3dfa90?0x0:_0x4506b9[_0x3c5c('0x21')];var _0x31e457=_0x3dfa90?_0x579d4e['count']:_0x4506b9['offset']+_0x4506b9[_0x3c5c('0x22')];var _0x36b770;if(_0x31e457>=_0x4bb6f5){_0x31e457=_0x4bb6f5;_0x36b770=0xc8;}else{_0x36b770=0xce;}_0x1e86d1[_0x3c5c('0x1e')](_0x36b770);return _0x1e86d1[_0x3c5c('0x25')](_0x3c5c('0x26'),_0x5afbb5+'-'+_0x31e457+'/'+_0x4bb6f5)[_0x3c5c('0x20')](_0x579d4e);}return null;};}function patchUpdates(_0x1f418a){return function(_0x2b2269){try{jsonpatch[_0x3c5c('0x27')](_0x2b2269,_0x1f418a,!![]);}catch(_0x585d98){return BPromise[_0x3c5c('0x28')](_0x585d98);}return _0x2b2269[_0x3c5c('0x29')]();};}function saveUpdates(_0x1fd4b7,_0x40018d){return function(_0x33fc87){if(_0x33fc87){return _0x33fc87[_0x3c5c('0x2a')](_0x1fd4b7)['then'](function(_0x47a82d){return _0x47a82d;});}return null;};}function removeEntity(_0x22454e,_0x5858c9){return function(_0x2dc502){if(_0x2dc502){return _0x2dc502[_0x3c5c('0x2b')]()['then'](function(){_0x22454e[_0x3c5c('0x1e')](0xcc)[_0x3c5c('0x1f')]();});}};}function handleEntityNotFound(_0x59b0f7,_0x1fb56a){return function(_0x7bd237){if(!_0x7bd237){_0x59b0f7['sendStatus'](0x194);}return _0x7bd237;};}function handleError(_0x1d23f5,_0x3859f1){_0x3859f1=_0x3859f1||0x1f4;return function(_0x194252){logger[_0x3c5c('0x2c')](_0x194252['stack']);if(_0x194252[_0x3c5c('0x2d')]){delete _0x194252['name'];}_0x1d23f5['status'](_0x3859f1)['send'](_0x194252);};}exports[_0x3c5c('0x2e')]=function(_0x391394,_0x59d4cb){var _0x11f6d7={},_0x5bd523={},_0x2d7176={'count':0x0,'rows':[]};var _0x24c310=_[_0x3c5c('0x2f')](db[_0x3c5c('0x30')][_0x3c5c('0x31')],function(_0x2dfff9){return{'name':_0x2dfff9[_0x3c5c('0x32')],'type':_0x2dfff9['type'][_0x3c5c('0x33')]};});_0x5bd523[_0x3c5c('0x34')]=_['map'](_0x24c310,_0x3c5c('0x2d'));_0x5bd523[_0x3c5c('0x35')]=_[_0x3c5c('0x36')](_0x391394[_0x3c5c('0x35')]);_0x5bd523[_0x3c5c('0x37')]=_[_0x3c5c('0x38')](_0x5bd523[_0x3c5c('0x34')],_0x5bd523[_0x3c5c('0x35')]);_0x11f6d7[_0x3c5c('0x39')]=_['intersection'](_0x5bd523['model'],qs[_0x3c5c('0x3a')](_0x391394['query'][_0x3c5c('0x3a')]));_0x11f6d7[_0x3c5c('0x39')]=_0x11f6d7['attributes'][_0x3c5c('0x3b')]?_0x11f6d7[_0x3c5c('0x39')]:_0x5bd523[_0x3c5c('0x34')];if(!_0x391394[_0x3c5c('0x35')][_0x3c5c('0x3c')](_0x3c5c('0x3d'))){_0x11f6d7['limit']=qs[_0x3c5c('0x22')](_0x391394[_0x3c5c('0x35')][_0x3c5c('0x22')]);_0x11f6d7['offset']=qs[_0x3c5c('0x21')](_0x391394[_0x3c5c('0x35')]['offset']);}_0x11f6d7[_0x3c5c('0x3e')]=qs[_0x3c5c('0x3f')](_0x391394[_0x3c5c('0x35')][_0x3c5c('0x3f')]);_0x11f6d7[_0x3c5c('0x40')]=qs['filters'](_['pick'](_0x391394[_0x3c5c('0x35')],_0x5bd523['filters']),_0x24c310);if(_0x391394[_0x3c5c('0x35')][_0x3c5c('0x41')]){_0x11f6d7['where']=_['merge'](_0x11f6d7['where'],{'$or':_[_0x3c5c('0x2f')](_0x24c310,function(_0x527ef3){if(_0x527ef3[_0x3c5c('0x42')]!==_0x3c5c('0x43')){var _0x2d5a36={};_0x2d5a36[_0x527ef3[_0x3c5c('0x2d')]]={'$like':'%'+_0x391394[_0x3c5c('0x35')]['filter']+'%'};return _0x2d5a36;}})});}_0x11f6d7=_[_0x3c5c('0x44')]({},_0x11f6d7,_0x391394[_0x3c5c('0x45')]);var _0x3a4b8a={'where':_0x11f6d7[_0x3c5c('0x40')]};return db[_0x3c5c('0x30')][_0x3c5c('0x24')](_0x3a4b8a)['then'](function(_0x4e187b){_0x2d7176[_0x3c5c('0x24')]=_0x4e187b;if(_0x391394['query'][_0x3c5c('0x46')]){_0x11f6d7[_0x3c5c('0x47')]=[{'all':!![]}];}return db[_0x3c5c('0x30')][_0x3c5c('0x48')](_0x11f6d7);})[_0x3c5c('0x49')](function(_0x5897b4){_0x2d7176['rows']=_0x5897b4;return _0x2d7176;})['then'](respondWithFilteredResult(_0x59d4cb,_0x11f6d7))[_0x3c5c('0x4a')](handleError(_0x59d4cb,null));};exports[_0x3c5c('0x4b')]=function(_0x14f3ed,_0x24779e){var _0x6f5a8d={'raw':!![],'where':{'id':_0x14f3ed[_0x3c5c('0x4c')]['id']}},_0x23ae6a={};_0x23ae6a[_0x3c5c('0x34')]=_[_0x3c5c('0x36')](db['SmsQueueReport'][_0x3c5c('0x31')]);_0x23ae6a['query']=_[_0x3c5c('0x36')](_0x14f3ed[_0x3c5c('0x35')]);_0x23ae6a[_0x3c5c('0x37')]=_['intersection'](_0x23ae6a['model'],_0x23ae6a[_0x3c5c('0x35')]);_0x6f5a8d[_0x3c5c('0x39')]=_['intersection'](_0x23ae6a[_0x3c5c('0x34')],qs['fields'](_0x14f3ed[_0x3c5c('0x35')][_0x3c5c('0x3a')]));_0x6f5a8d[_0x3c5c('0x39')]=_0x6f5a8d[_0x3c5c('0x39')]['length']?_0x6f5a8d[_0x3c5c('0x39')]:_0x23ae6a[_0x3c5c('0x34')];if(_0x14f3ed[_0x3c5c('0x35')][_0x3c5c('0x46')]){_0x6f5a8d[_0x3c5c('0x47')]=[{'all':!![]}];}_0x6f5a8d=_[_0x3c5c('0x44')]({},_0x6f5a8d,_0x14f3ed[_0x3c5c('0x45')]);return db[_0x3c5c('0x30')][_0x3c5c('0x4d')](_0x6f5a8d)[_0x3c5c('0x49')](handleEntityNotFound(_0x24779e,null))[_0x3c5c('0x49')](respondWithResult(_0x24779e,null))[_0x3c5c('0x4a')](handleError(_0x24779e,null));};exports[_0x3c5c('0x4e')]=function(_0x41606b,_0x580f75){return db['SmsQueueReport'][_0x3c5c('0x4e')](_0x41606b['body'],{})[_0x3c5c('0x49')](respondWithResult(_0x580f75,0xc9))[_0x3c5c('0x4a')](handleError(_0x580f75,null));};exports[_0x3c5c('0x2a')]=function(_0x9d731b,_0x235985){if(_0x9d731b[_0x3c5c('0x4f')]['id']){delete _0x9d731b[_0x3c5c('0x4f')]['id'];}return db['SmsQueueReport']['find']({'where':{'id':_0x9d731b[_0x3c5c('0x4c')]['id']}})[_0x3c5c('0x49')](handleEntityNotFound(_0x235985,null))[_0x3c5c('0x49')](saveUpdates(_0x9d731b[_0x3c5c('0x4f')],null))[_0x3c5c('0x49')](respondWithResult(_0x235985,null))[_0x3c5c('0x4a')](handleError(_0x235985,null));};exports[_0x3c5c('0x2b')]=function(_0x149b6d,_0x574964){return db['SmsQueueReport'][_0x3c5c('0x4d')]({'where':{'id':_0x149b6d[_0x3c5c('0x4c')]['id']}})[_0x3c5c('0x49')](handleEntityNotFound(_0x574964,null))[_0x3c5c('0x49')](removeEntity(_0x574964,null))[_0x3c5c('0x4a')](handleError(_0x574964,null));};exports[_0x3c5c('0x50')]=function(_0x266832,_0x4dc38b){return db[_0x3c5c('0x30')]['describe']()[_0x3c5c('0x49')](respondWithResult(_0x4dc38b,null))[_0x3c5c('0x4a')](handleError(_0x4dc38b,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index f913765..261e1ce 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x3162b9,_0x3802f3){var _0x175032=function(_0x5ddc1f){while(--_0x5ddc1f){_0x3162b9['push'](_0x3162b9['shift']());}};_0x175032(++_0x3802f3);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x48566d,_0x341848){var _0x2675c2=function(_0x8fa552){while(--_0x8fa552){_0x48566d['push'](_0x48566d['shift']());}};_0x2675c2(++_0x341848);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 901425d..f43c408 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 _0xd501=['debug','stringify','error','message','result','CreateSmsQueueReport','create','body','options','raw','SmsQueueReport','update','where','attributes','limit','UpdateSmsQueueReport','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x458064,_0x4cfbb5){var _0x1ed109=function(_0x5bc9a1){while(--_0x5bc9a1){_0x458064['push'](_0x458064['shift']());}};_0x1ed109(++_0x4cfbb5);}(_0xd501,0x7a));var _0x1d50=function(_0x4d1d0d,_0x300f63){_0x4d1d0d=_0x4d1d0d-0x0;var _0x58244f=_0xd501[_0x4d1d0d];return _0x58244f;};'use strict';var _=require(_0x1d50('0x0'));var util=require(_0x1d50('0x1'));var moment=require(_0x1d50('0x2'));var BPromise=require(_0x1d50('0x3'));var rs=require(_0x1d50('0x4'));var fs=require('fs');var Redis=require(_0x1d50('0x5'));var db=require(_0x1d50('0x6'))['db'];var utils=require(_0x1d50('0x7'));var logger=require(_0x1d50('0x8'))(_0x1d50('0x9'));var config=require(_0x1d50('0xa'));var jayson=require(_0x1d50('0xb'));var client=jayson[_0x1d50('0xc')][_0x1d50('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x54bfe3,_0x5391b0,_0x49bd88){return new BPromise(function(_0x401e79,_0x5730ba){return client['request'](_0x54bfe3,_0x49bd88)[_0x1d50('0xe')](function(_0x23cd59){logger[_0x1d50('0xf')](_0x1d50('0x10'),_0x5391b0,_0x1d50('0x11'));logger[_0x1d50('0x12')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x5391b0,_0x1d50('0x11'),JSON[_0x1d50('0x13')](_0x23cd59));if(_0x23cd59[_0x1d50('0x14')]){if(_0x23cd59[_0x1d50('0x14')]['code']===0x1f4){logger[_0x1d50('0x14')](_0x1d50('0x10'),_0x5391b0,_0x23cd59[_0x1d50('0x14')]['message']);return _0x5730ba(_0x23cd59['error'][_0x1d50('0x15')]);}logger[_0x1d50('0x14')](_0x1d50('0x10'),_0x5391b0,_0x23cd59[_0x1d50('0x14')][_0x1d50('0x15')]);return _0x401e79(_0x23cd59[_0x1d50('0x14')]['message']);}else{logger[_0x1d50('0xf')](_0x1d50('0x10'),_0x5391b0,_0x1d50('0x11'));_0x401e79(_0x23cd59[_0x1d50('0x16')][_0x1d50('0x15')]);}})['catch'](function(_0x10bdf2){logger[_0x1d50('0x14')](_0x1d50('0x10'),_0x5391b0,_0x10bdf2);_0x5730ba(_0x10bdf2);});});}exports[_0x1d50('0x17')]=function(_0x371de4){var _0x12ee28=this;return new Promise(function(_0x2ea2d9,_0x2fdd3e){return db['SmsQueueReport'][_0x1d50('0x18')](_0x371de4[_0x1d50('0x19')],{'raw':_0x371de4[_0x1d50('0x1a')]?_0x371de4[_0x1d50('0x1a')][_0x1d50('0x1b')]===undefined?!![]:![]:!![]})[_0x1d50('0xe')](function(_0x3a9ba8){logger[_0x1d50('0xf')](_0x1d50('0x17'),_0x371de4);logger[_0x1d50('0x12')](_0x1d50('0x17'),_0x371de4,JSON[_0x1d50('0x13')](_0x3a9ba8));_0x2ea2d9(_0x3a9ba8);})['catch'](function(_0xb39034){logger[_0x1d50('0x14')](_0x1d50('0x17'),_0xb39034[_0x1d50('0x15')],_0x371de4);_0x2fdd3e(_0x12ee28[_0x1d50('0x14')](0x1f4,_0xb39034[_0x1d50('0x15')]));});});};exports['UpdateSmsQueueReport']=function(_0x1b990a){var _0x54e406=this;return new Promise(function(_0x34585b,_0x3e5662){return db[_0x1d50('0x1c')][_0x1d50('0x1d')](_0x1b990a[_0x1d50('0x19')],{'raw':_0x1b990a[_0x1d50('0x1a')]?_0x1b990a['options'][_0x1d50('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b990a[_0x1d50('0x1a')]?_0x1b990a[_0x1d50('0x1a')][_0x1d50('0x1e')]||null:null,'attributes':_0x1b990a['options']?_0x1b990a[_0x1d50('0x1a')][_0x1d50('0x1f')]||null:null,'limit':_0x1b990a['options']?_0x1b990a['options'][_0x1d50('0x20')]||null:null})['then'](function(_0xa6c3c4){logger['info'](_0x1d50('0x21'),_0x1b990a);logger['debug']('UpdateSmsQueueReport',_0x1b990a,JSON[_0x1d50('0x13')](_0xa6c3c4));_0x34585b(_0xa6c3c4);})[_0x1d50('0x22')](function(_0x47a1f5){logger[_0x1d50('0x14')](_0x1d50('0x21'),_0x47a1f5[_0x1d50('0x15')],_0x1b990a);_0x3e5662(_0x54e406[_0x1d50('0x14')](0x1f4,_0x47a1f5[_0x1d50('0x15')]));});});}; \ No newline at end of file +var _0x8424=['result','catch','CreateSmsQueueReport','create','options','raw','UpdateSmsQueueReport','update','body','where','limit','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0xb8a863,_0x31638c){var _0x349510=function(_0x3e5b80){while(--_0x3e5b80){_0xb8a863['push'](_0xb8a863['shift']());}};_0x349510(++_0x31638c);}(_0x8424,0xbf));var _0x4842=function(_0x2a8237,_0x3ab8b6){_0x2a8237=_0x2a8237-0x0;var _0x1b88f6=_0x8424[_0x2a8237];return _0x1b88f6;};'use strict';var _=require('lodash');var util=require(_0x4842('0x0'));var moment=require(_0x4842('0x1'));var BPromise=require('bluebird');var rs=require(_0x4842('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4842('0x3'))['db'];var utils=require(_0x4842('0x4'));var logger=require(_0x4842('0x5'))(_0x4842('0x6'));var config=require(_0x4842('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4842('0x8')][_0x4842('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e58dd,_0x3943b3,_0x59a19b){return new BPromise(function(_0x151438,_0x16f0bc){return client[_0x4842('0xa')](_0x1e58dd,_0x59a19b)[_0x4842('0xb')](function(_0x25c80f){logger[_0x4842('0xc')](_0x4842('0xd'),_0x3943b3,_0x4842('0xe'));logger[_0x4842('0xf')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x3943b3,'request\x20sent',JSON[_0x4842('0x10')](_0x25c80f));if(_0x25c80f[_0x4842('0x11')]){if(_0x25c80f[_0x4842('0x11')]['code']===0x1f4){logger[_0x4842('0x11')](_0x4842('0xd'),_0x3943b3,_0x25c80f[_0x4842('0x11')]['message']);return _0x16f0bc(_0x25c80f[_0x4842('0x11')]['message']);}logger[_0x4842('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x3943b3,_0x25c80f[_0x4842('0x11')][_0x4842('0x12')]);return _0x151438(_0x25c80f[_0x4842('0x11')]['message']);}else{logger[_0x4842('0xc')]('SmsQueueReport,\x20%s,\x20%s',_0x3943b3,'request\x20sent');_0x151438(_0x25c80f[_0x4842('0x13')][_0x4842('0x12')]);}})[_0x4842('0x14')](function(_0x145cc4){logger[_0x4842('0x11')](_0x4842('0xd'),_0x3943b3,_0x145cc4);_0x16f0bc(_0x145cc4);});});}exports[_0x4842('0x15')]=function(_0x19d601){var _0x21ea0b=this;return new Promise(function(_0x2dcbf1,_0x42195f){return db['SmsQueueReport'][_0x4842('0x16')](_0x19d601['body'],{'raw':_0x19d601[_0x4842('0x17')]?_0x19d601[_0x4842('0x17')][_0x4842('0x18')]===undefined?!![]:![]:!![]})[_0x4842('0xb')](function(_0x279b32){logger[_0x4842('0xc')](_0x4842('0x15'),_0x19d601);logger[_0x4842('0xf')]('CreateSmsQueueReport',_0x19d601,JSON[_0x4842('0x10')](_0x279b32));_0x2dcbf1(_0x279b32);})['catch'](function(_0x35896f){logger[_0x4842('0x11')](_0x4842('0x15'),_0x35896f['message'],_0x19d601);_0x42195f(_0x21ea0b['error'](0x1f4,_0x35896f[_0x4842('0x12')]));});});};exports[_0x4842('0x19')]=function(_0x57f16d){var _0x2b3009=this;return new Promise(function(_0x12b72e,_0x5d3f41){return db['SmsQueueReport'][_0x4842('0x1a')](_0x57f16d[_0x4842('0x1b')],{'raw':_0x57f16d['options']?_0x57f16d['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57f16d[_0x4842('0x17')]?_0x57f16d[_0x4842('0x17')][_0x4842('0x1c')]||null:null,'attributes':_0x57f16d['options']?_0x57f16d['options']['attributes']||null:null,'limit':_0x57f16d[_0x4842('0x17')]?_0x57f16d[_0x4842('0x17')][_0x4842('0x1d')]||null:null})[_0x4842('0xb')](function(_0x13adb9){logger[_0x4842('0xc')](_0x4842('0x19'),_0x57f16d);logger[_0x4842('0xf')](_0x4842('0x19'),_0x57f16d,JSON[_0x4842('0x10')](_0x13adb9));_0x12b72e(_0x13adb9);})[_0x4842('0x14')](function(_0x1da0b8){logger['error'](_0x4842('0x19'),_0x1da0b8[_0x4842('0x12')],_0x57f16d);_0x5d3f41(_0x2b3009[_0x4842('0x11')](0x1f4,_0x1da0b8[_0x4842('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index bf4cc6c..2eb6266 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 _0x4944=['fs-extra','../../components/interaction/service','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','/:id','update','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x4944,0x6d));var _0x4494=function(_0x309253,_0x2cec7f){_0x309253=_0x309253-0x0;var _0x5b91ef=_0x4944[_0x309253];return _0x5b91ef;};'use strict';var multer=require(_0x4494('0x0'));var util=require('util');var path=require(_0x4494('0x1'));var timeout=require(_0x4494('0x2'));var express=require(_0x4494('0x3'));var router=express[_0x4494('0x4')]();var fs_extra=require(_0x4494('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4494('0x6'));var config=require('../../config/environment');var controller=require(_0x4494('0x7'));router[_0x4494('0x8')]('/',auth[_0x4494('0x9')](),controller[_0x4494('0xa')]);router[_0x4494('0x8')](_0x4494('0xb'),auth[_0x4494('0x9')](),controller[_0x4494('0xc')]);router[_0x4494('0x8')]('/:id',auth[_0x4494('0x9')](),controller[_0x4494('0xd')]);router[_0x4494('0xe')]('/',auth[_0x4494('0x9')](),controller['create']);router['put'](_0x4494('0xf'),auth[_0x4494('0x9')](),controller[_0x4494('0x10')]);router['delete']('/:id',auth[_0x4494('0x9')](),controller[_0x4494('0x11')]);module[_0x4494('0x12')]=router; \ No newline at end of file +var _0x6c32=['get','isAuthenticated','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller'];(function(_0x165752,_0x1654a7){var _0x3a4711=function(_0x1ec088){while(--_0x1ec088){_0x165752['push'](_0x165752['shift']());}};_0x3a4711(++_0x1654a7);}(_0x6c32,0x6e));var _0x26c3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6c32[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x26c3('0x0'));var util=require(_0x26c3('0x1'));var path=require(_0x26c3('0x2'));var timeout=require(_0x26c3('0x3'));var express=require(_0x26c3('0x4'));var router=express[_0x26c3('0x5')]();var fs_extra=require(_0x26c3('0x6'));var auth=require(_0x26c3('0x7'));var interaction=require(_0x26c3('0x8'));var config=require('../../config/environment');var controller=require(_0x26c3('0x9'));router[_0x26c3('0xa')]('/',auth[_0x26c3('0xb')](),controller['index']);router[_0x26c3('0xa')]('/describe',auth[_0x26c3('0xb')](),controller[_0x26c3('0xc')]);router[_0x26c3('0xa')](_0x26c3('0xd'),auth[_0x26c3('0xb')](),controller[_0x26c3('0xe')]);router[_0x26c3('0xf')]('/',auth[_0x26c3('0xb')](),controller[_0x26c3('0x10')]);router[_0x26c3('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x26c3('0xd'),auth[_0x26c3('0xb')](),controller[_0x26c3('0x12')]);module[_0x26c3('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 8c01148..c737420 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 _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x3b9083,_0x2d2b2e){var _0x2ac587=function(_0x173826){while(--_0x173826){_0x3b9083['push'](_0x3b9083['shift']());}};_0x2ac587(++_0x2d2b2e);}(_0x4b84,0x1cc));var _0x44b8=function(_0x2f2360,_0x151089){_0x2f2360=_0x2f2360-0x0;var _0x1cc8d3=_0x4b84[_0x2f2360];return _0x1cc8d3;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x4fab7a,_0x56e9bf){var _0x497b82=function(_0x382f4a){while(--_0x382f4a){_0x4fab7a['push'](_0x4fab7a['shift']());}};_0x497b82(++_0x56e9bf);}(_0x00bb,0x1d8));var _0xb00b=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x00bb[_0x1d9aa0];return _0x226868;};'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 diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 6d7cafa..7848438 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 _0x948b=['rawAttributes','fieldName','type','key','model','keys','query','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','intersection','create','body','find','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','SmsTransferReport'];(function(_0x9df3d8,_0x4074e3){var _0x366da1=function(_0x5af940){while(--_0x5af940){_0x9df3d8['push'](_0x9df3d8['shift']());}};_0x366da1(++_0x4074e3);}(_0x948b,0xb4));var _0xb948=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x948b[_0x9fd887];return _0x1a54ab;};'use strict';var emlformat=require(_0xb948('0x0'));var rimraf=require(_0xb948('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb948('0x2'));var rp=require('request-promise');var moment=require(_0xb948('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb948('0x4'));var util=require(_0xb948('0x5'));var path=require(_0xb948('0x6'));var sox=require(_0xb948('0x7'));var csv=require(_0xb948('0x8'));var ejs=require(_0xb948('0x9'));var fs=require('fs');var fs_extra=require(_0xb948('0xa'));var _=require(_0xb948('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb948('0xc'));var deskjs=require(_0xb948('0xd'));var toCsv=require(_0xb948('0x8'));var querystring=require(_0xb948('0xe'));var Papa=require('papaparse');var Redis=require(_0xb948('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb948('0x10'));var as=require(_0xb948('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb948('0x12'))(_0xb948('0x13'));var utils=require(_0xb948('0x14'));var config=require(_0xb948('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb948('0x16'))['db'];function respondWithStatusCode(_0xf68377,_0x2cf9ba){_0x2cf9ba=_0x2cf9ba||0xcc;return function(_0x4945c8){if(_0x4945c8){return _0xf68377['sendStatus'](_0x2cf9ba);}return _0xf68377[_0xb948('0x17')](_0x2cf9ba)[_0xb948('0x18')]();};}function respondWithResult(_0x9a39b8,_0x170c73){_0x170c73=_0x170c73||0xc8;return function(_0x533798){if(_0x533798){return _0x9a39b8[_0xb948('0x17')](_0x170c73)[_0xb948('0x19')](_0x533798);}};}function respondWithFilteredResult(_0x13c1aa,_0x412431){return function(_0x43a49a){if(_0x43a49a){var _0x512c04=typeof _0x412431['offset']==='undefined'&&typeof _0x412431[_0xb948('0x1a')]===_0xb948('0x1b');var _0x5f52b7=_0x43a49a[_0xb948('0x1c')];var _0x5e719b=_0x512c04?0x0:_0x412431[_0xb948('0x1d')];var _0x247f51=_0x512c04?_0x43a49a[_0xb948('0x1c')]:_0x412431[_0xb948('0x1d')]+_0x412431[_0xb948('0x1a')];var _0x3bdc1d;if(_0x247f51>=_0x5f52b7){_0x247f51=_0x5f52b7;_0x3bdc1d=0xc8;}else{_0x3bdc1d=0xce;}_0x13c1aa['status'](_0x3bdc1d);return _0x13c1aa[_0xb948('0x1e')](_0xb948('0x1f'),_0x5e719b+'-'+_0x247f51+'/'+_0x5f52b7)[_0xb948('0x19')](_0x43a49a);}return null;};}function patchUpdates(_0x526780){return function(_0x26c47f){try{jsonpatch[_0xb948('0x20')](_0x26c47f,_0x526780,!![]);}catch(_0x15de47){return BPromise[_0xb948('0x21')](_0x15de47);}return _0x26c47f[_0xb948('0x22')]();};}function saveUpdates(_0xb2743c,_0x1d1018){return function(_0xdef85f){if(_0xdef85f){return _0xdef85f[_0xb948('0x23')](_0xb2743c)[_0xb948('0x24')](function(_0x7afa96){return _0x7afa96;});}return null;};}function removeEntity(_0x2e2dcd,_0x59dd1b){return function(_0x21cb0e){if(_0x21cb0e){return _0x21cb0e[_0xb948('0x25')]()[_0xb948('0x24')](function(){_0x2e2dcd['status'](0xcc)[_0xb948('0x18')]();});}};}function handleEntityNotFound(_0x4baa9e,_0x3df630){return function(_0x10d260){if(!_0x10d260){_0x4baa9e[_0xb948('0x26')](0x194);}return _0x10d260;};}function handleError(_0x27675f,_0x5f3109){_0x5f3109=_0x5f3109||0x1f4;return function(_0x15bd9c){logger[_0xb948('0x27')](_0x15bd9c[_0xb948('0x28')]);if(_0x15bd9c[_0xb948('0x29')]){delete _0x15bd9c[_0xb948('0x29')];}_0x27675f[_0xb948('0x17')](_0x5f3109)['send'](_0x15bd9c);};}exports[_0xb948('0x2a')]=function(_0x19b33f,_0x4a67c9){var _0x42a147={},_0x46a7d8={},_0x4287f9={'count':0x0,'rows':[]};var _0x5b43c8=_[_0xb948('0x2b')](db[_0xb948('0x2c')][_0xb948('0x2d')],function(_0x131f5e){return{'name':_0x131f5e[_0xb948('0x2e')],'type':_0x131f5e[_0xb948('0x2f')][_0xb948('0x30')]};});_0x46a7d8[_0xb948('0x31')]=_[_0xb948('0x2b')](_0x5b43c8,_0xb948('0x29'));_0x46a7d8['query']=_[_0xb948('0x32')](_0x19b33f[_0xb948('0x33')]);_0x46a7d8[_0xb948('0x34')]=_['intersection'](_0x46a7d8[_0xb948('0x31')],_0x46a7d8[_0xb948('0x33')]);_0x42a147['attributes']=_['intersection'](_0x46a7d8[_0xb948('0x31')],qs[_0xb948('0x35')](_0x19b33f[_0xb948('0x33')][_0xb948('0x35')]));_0x42a147['attributes']=_0x42a147[_0xb948('0x36')]['length']?_0x42a147[_0xb948('0x36')]:_0x46a7d8['model'];if(!_0x19b33f[_0xb948('0x33')][_0xb948('0x37')](_0xb948('0x38'))){_0x42a147[_0xb948('0x1a')]=qs['limit'](_0x19b33f[_0xb948('0x33')][_0xb948('0x1a')]);_0x42a147[_0xb948('0x1d')]=qs[_0xb948('0x1d')](_0x19b33f[_0xb948('0x33')][_0xb948('0x1d')]);}_0x42a147[_0xb948('0x39')]=qs[_0xb948('0x3a')](_0x19b33f[_0xb948('0x33')][_0xb948('0x3a')]);_0x42a147['where']=qs['filters'](_[_0xb948('0x3b')](_0x19b33f[_0xb948('0x33')],_0x46a7d8[_0xb948('0x34')]),_0x5b43c8);if(_0x19b33f[_0xb948('0x33')][_0xb948('0x3c')]){_0x42a147[_0xb948('0x3d')]=_[_0xb948('0x3e')](_0x42a147[_0xb948('0x3d')],{'$or':_[_0xb948('0x2b')](_0x5b43c8,function(_0x469b46){if(_0x469b46[_0xb948('0x2f')]!==_0xb948('0x3f')){var _0x21a358={};_0x21a358[_0x469b46[_0xb948('0x29')]]={'$like':'%'+_0x19b33f['query'][_0xb948('0x3c')]+'%'};return _0x21a358;}})});}_0x42a147=_['merge']({},_0x42a147,_0x19b33f[_0xb948('0x40')]);var _0x597d08={'where':_0x42a147[_0xb948('0x3d')]};return db[_0xb948('0x2c')][_0xb948('0x1c')](_0x597d08)[_0xb948('0x24')](function(_0x6ac236){_0x4287f9[_0xb948('0x1c')]=_0x6ac236;if(_0x19b33f['query'][_0xb948('0x41')]){_0x42a147['include']=[{'all':!![]}];}return db[_0xb948('0x2c')][_0xb948('0x42')](_0x42a147);})[_0xb948('0x24')](function(_0x4f1e7c){_0x4287f9[_0xb948('0x43')]=_0x4f1e7c;return _0x4287f9;})['then'](respondWithFilteredResult(_0x4a67c9,_0x42a147))[_0xb948('0x44')](handleError(_0x4a67c9,null));};exports[_0xb948('0x45')]=function(_0x2ac6a0,_0x15144f){var _0x1a541a={'raw':!![],'where':{'id':_0x2ac6a0[_0xb948('0x46')]['id']}},_0x20f247={};_0x20f247[_0xb948('0x31')]=_[_0xb948('0x32')](db[_0xb948('0x2c')][_0xb948('0x2d')]);_0x20f247[_0xb948('0x33')]=_['keys'](_0x2ac6a0[_0xb948('0x33')]);_0x20f247[_0xb948('0x34')]=_[_0xb948('0x47')](_0x20f247['model'],_0x20f247[_0xb948('0x33')]);_0x1a541a['attributes']=_[_0xb948('0x47')](_0x20f247['model'],qs[_0xb948('0x35')](_0x2ac6a0[_0xb948('0x33')]['fields']));_0x1a541a[_0xb948('0x36')]=_0x1a541a[_0xb948('0x36')]['length']?_0x1a541a[_0xb948('0x36')]:_0x20f247[_0xb948('0x31')];if(_0x2ac6a0[_0xb948('0x33')][_0xb948('0x41')]){_0x1a541a['include']=[{'all':!![]}];}_0x1a541a=_[_0xb948('0x3e')]({},_0x1a541a,_0x2ac6a0[_0xb948('0x40')]);return db[_0xb948('0x2c')]['find'](_0x1a541a)[_0xb948('0x24')](handleEntityNotFound(_0x15144f,null))['then'](respondWithResult(_0x15144f,null))['catch'](handleError(_0x15144f,null));};exports[_0xb948('0x48')]=function(_0x4af4fd,_0x3c4059){return db['SmsTransferReport'][_0xb948('0x48')](_0x4af4fd[_0xb948('0x49')],{})['then'](respondWithResult(_0x3c4059,0xc9))[_0xb948('0x44')](handleError(_0x3c4059,null));};exports[_0xb948('0x23')]=function(_0x4e4942,_0x424b4d){if(_0x4e4942['body']['id']){delete _0x4e4942[_0xb948('0x49')]['id'];}return db['SmsTransferReport'][_0xb948('0x4a')]({'where':{'id':_0x4e4942['params']['id']}})['then'](handleEntityNotFound(_0x424b4d,null))[_0xb948('0x24')](saveUpdates(_0x4e4942[_0xb948('0x49')],null))[_0xb948('0x24')](respondWithResult(_0x424b4d,null))[_0xb948('0x44')](handleError(_0x424b4d,null));};exports[_0xb948('0x25')]=function(_0x4e4da4,_0x5dc8a3){return db[_0xb948('0x2c')][_0xb948('0x4a')]({'where':{'id':_0x4e4da4['params']['id']}})[_0xb948('0x24')](handleEntityNotFound(_0x5dc8a3,null))[_0xb948('0x24')](removeEntity(_0x5dc8a3,null))[_0xb948('0x44')](handleError(_0x5dc8a3,null));};exports['describe']=function(_0x2a6130,_0x55d511){return db[_0xb948('0x2c')]['describe']()[_0xb948('0x24')](respondWithResult(_0x55d511,null))[_0xb948('0x44')](handleError(_0x55d511,null));}; \ No newline at end of file +var _0x3370=['VIRTUAL','filter','options','include','findAll','rows','catch','show','includeAll','create','body','params','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','fields','attributes','length','model','hasOwnProperty','order','sort','where','pick','merge'];(function(_0x1fc90a,_0x4f847e){var _0x30f4cb=function(_0x329a94){while(--_0x329a94){_0x1fc90a['push'](_0x1fc90a['shift']());}};_0x30f4cb(++_0x4f847e);}(_0x3370,0x190));var _0x0337=function(_0x9e30f9,_0x49f526){_0x9e30f9=_0x9e30f9-0x0;var _0x417ba2=_0x3370[_0x9e30f9];return _0x417ba2;};'use strict';var emlformat=require(_0x0337('0x0'));var rimraf=require(_0x0337('0x1'));var zipdir=require(_0x0337('0x2'));var jsonpatch=require(_0x0337('0x3'));var rp=require(_0x0337('0x4'));var moment=require('moment');var BPromise=require(_0x0337('0x5'));var Mustache=require(_0x0337('0x6'));var util=require('util');var path=require(_0x0337('0x7'));var sox=require(_0x0337('0x8'));var csv=require('to-csv');var ejs=require(_0x0337('0x9'));var fs=require('fs');var fs_extra=require(_0x0337('0xa'));var _=require('lodash');var squel=require(_0x0337('0xb'));var crypto=require(_0x0337('0xc'));var jsforce=require(_0x0337('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0337('0xe'));var querystring=require(_0x0337('0xf'));var Papa=require(_0x0337('0x10'));var Redis=require('ioredis');var authService=require(_0x0337('0x11'));var qs=require(_0x0337('0x12'));var as=require(_0x0337('0x13'));var hardwareService=require(_0x0337('0x14'));var logger=require(_0x0337('0x15'))('api');var utils=require(_0x0337('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0337('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x333a4b,_0x4d8976){_0x4d8976=_0x4d8976||0xcc;return function(_0x2a125e){if(_0x2a125e){return _0x333a4b[_0x0337('0x18')](_0x4d8976);}return _0x333a4b[_0x0337('0x19')](_0x4d8976)[_0x0337('0x1a')]();};}function respondWithResult(_0x5e6bad,_0x4e8879){_0x4e8879=_0x4e8879||0xc8;return function(_0x2d8a22){if(_0x2d8a22){return _0x5e6bad[_0x0337('0x19')](_0x4e8879)[_0x0337('0x1b')](_0x2d8a22);}};}function respondWithFilteredResult(_0x1ebed5,_0x59e1f8){return function(_0x2f5f34){if(_0x2f5f34){var _0x187de3=typeof _0x59e1f8[_0x0337('0x1c')]===_0x0337('0x1d')&&typeof _0x59e1f8[_0x0337('0x1e')]===_0x0337('0x1d');var _0x9496=_0x2f5f34[_0x0337('0x1f')];var _0x5ed8c6=_0x187de3?0x0:_0x59e1f8['offset'];var _0x568ab7=_0x187de3?_0x2f5f34[_0x0337('0x1f')]:_0x59e1f8['offset']+_0x59e1f8['limit'];var _0x38bb79;if(_0x568ab7>=_0x9496){_0x568ab7=_0x9496;_0x38bb79=0xc8;}else{_0x38bb79=0xce;}_0x1ebed5[_0x0337('0x19')](_0x38bb79);return _0x1ebed5[_0x0337('0x20')](_0x0337('0x21'),_0x5ed8c6+'-'+_0x568ab7+'/'+_0x9496)[_0x0337('0x1b')](_0x2f5f34);}return null;};}function patchUpdates(_0x27c182){return function(_0x5b3eac){try{jsonpatch['apply'](_0x5b3eac,_0x27c182,!![]);}catch(_0x2fb250){return BPromise[_0x0337('0x22')](_0x2fb250);}return _0x5b3eac[_0x0337('0x23')]();};}function saveUpdates(_0x46d8eb,_0xaed223){return function(_0x593d55){if(_0x593d55){return _0x593d55[_0x0337('0x24')](_0x46d8eb)[_0x0337('0x25')](function(_0x5f11e4){return _0x5f11e4;});}return null;};}function removeEntity(_0x21dd97,_0x103a50){return function(_0x2a0079){if(_0x2a0079){return _0x2a0079['destroy']()[_0x0337('0x25')](function(){_0x21dd97[_0x0337('0x19')](0xcc)[_0x0337('0x1a')]();});}};}function handleEntityNotFound(_0x552fb3,_0x176f65){return function(_0xe6ea90){if(!_0xe6ea90){_0x552fb3[_0x0337('0x18')](0x194);}return _0xe6ea90;};}function handleError(_0x3b027c,_0x304ab0){_0x304ab0=_0x304ab0||0x1f4;return function(_0x3b19e7){logger[_0x0337('0x26')](_0x3b19e7['stack']);if(_0x3b19e7['name']){delete _0x3b19e7[_0x0337('0x27')];}_0x3b027c[_0x0337('0x19')](_0x304ab0)[_0x0337('0x28')](_0x3b19e7);};}exports[_0x0337('0x29')]=function(_0xa666f6,_0x280657){var _0x188d0e={},_0x295405={},_0x1f3ebc={'count':0x0,'rows':[]};var _0x424dc7=_[_0x0337('0x2a')](db[_0x0337('0x2b')][_0x0337('0x2c')],function(_0x7d4bae){return{'name':_0x7d4bae[_0x0337('0x2d')],'type':_0x7d4bae[_0x0337('0x2e')][_0x0337('0x2f')]};});_0x295405['model']=_['map'](_0x424dc7,_0x0337('0x27'));_0x295405[_0x0337('0x30')]=_[_0x0337('0x31')](_0xa666f6['query']);_0x295405[_0x0337('0x32')]=_[_0x0337('0x33')](_0x295405['model'],_0x295405[_0x0337('0x30')]);_0x188d0e['attributes']=_[_0x0337('0x33')](_0x295405['model'],qs[_0x0337('0x34')](_0xa666f6[_0x0337('0x30')][_0x0337('0x34')]));_0x188d0e[_0x0337('0x35')]=_0x188d0e[_0x0337('0x35')][_0x0337('0x36')]?_0x188d0e[_0x0337('0x35')]:_0x295405[_0x0337('0x37')];if(!_0xa666f6[_0x0337('0x30')][_0x0337('0x38')]('nolimit')){_0x188d0e[_0x0337('0x1e')]=qs[_0x0337('0x1e')](_0xa666f6[_0x0337('0x30')][_0x0337('0x1e')]);_0x188d0e[_0x0337('0x1c')]=qs['offset'](_0xa666f6[_0x0337('0x30')]['offset']);}_0x188d0e[_0x0337('0x39')]=qs[_0x0337('0x3a')](_0xa666f6[_0x0337('0x30')][_0x0337('0x3a')]);_0x188d0e[_0x0337('0x3b')]=qs[_0x0337('0x32')](_[_0x0337('0x3c')](_0xa666f6[_0x0337('0x30')],_0x295405['filters']),_0x424dc7);if(_0xa666f6[_0x0337('0x30')]['filter']){_0x188d0e[_0x0337('0x3b')]=_[_0x0337('0x3d')](_0x188d0e['where'],{'$or':_[_0x0337('0x2a')](_0x424dc7,function(_0x2fd204){if(_0x2fd204[_0x0337('0x2e')]!==_0x0337('0x3e')){var _0x5b686f={};_0x5b686f[_0x2fd204['name']]={'$like':'%'+_0xa666f6[_0x0337('0x30')][_0x0337('0x3f')]+'%'};return _0x5b686f;}})});}_0x188d0e=_[_0x0337('0x3d')]({},_0x188d0e,_0xa666f6[_0x0337('0x40')]);var _0x509836={'where':_0x188d0e[_0x0337('0x3b')]};return db[_0x0337('0x2b')][_0x0337('0x1f')](_0x509836)[_0x0337('0x25')](function(_0x2ac97d){_0x1f3ebc['count']=_0x2ac97d;if(_0xa666f6[_0x0337('0x30')]['includeAll']){_0x188d0e[_0x0337('0x41')]=[{'all':!![]}];}return db[_0x0337('0x2b')][_0x0337('0x42')](_0x188d0e);})['then'](function(_0xda4fca){_0x1f3ebc[_0x0337('0x43')]=_0xda4fca;return _0x1f3ebc;})[_0x0337('0x25')](respondWithFilteredResult(_0x280657,_0x188d0e))[_0x0337('0x44')](handleError(_0x280657,null));};exports[_0x0337('0x45')]=function(_0x29936c,_0x213a14){var _0x2aea36={'raw':!![],'where':{'id':_0x29936c['params']['id']}},_0x4487b8={};_0x4487b8['model']=_[_0x0337('0x31')](db[_0x0337('0x2b')]['rawAttributes']);_0x4487b8['query']=_[_0x0337('0x31')](_0x29936c['query']);_0x4487b8[_0x0337('0x32')]=_['intersection'](_0x4487b8['model'],_0x4487b8[_0x0337('0x30')]);_0x2aea36['attributes']=_[_0x0337('0x33')](_0x4487b8[_0x0337('0x37')],qs['fields'](_0x29936c['query'][_0x0337('0x34')]));_0x2aea36[_0x0337('0x35')]=_0x2aea36[_0x0337('0x35')][_0x0337('0x36')]?_0x2aea36[_0x0337('0x35')]:_0x4487b8[_0x0337('0x37')];if(_0x29936c['query'][_0x0337('0x46')]){_0x2aea36[_0x0337('0x41')]=[{'all':!![]}];}_0x2aea36=_[_0x0337('0x3d')]({},_0x2aea36,_0x29936c['options']);return db['SmsTransferReport']['find'](_0x2aea36)[_0x0337('0x25')](handleEntityNotFound(_0x213a14,null))[_0x0337('0x25')](respondWithResult(_0x213a14,null))['catch'](handleError(_0x213a14,null));};exports['create']=function(_0x44598b,_0x151bf9){return db[_0x0337('0x2b')][_0x0337('0x47')](_0x44598b[_0x0337('0x48')],{})[_0x0337('0x25')](respondWithResult(_0x151bf9,0xc9))[_0x0337('0x44')](handleError(_0x151bf9,null));};exports[_0x0337('0x24')]=function(_0x2118fc,_0x5a23d3){if(_0x2118fc[_0x0337('0x48')]['id']){delete _0x2118fc[_0x0337('0x48')]['id'];}return db[_0x0337('0x2b')]['find']({'where':{'id':_0x2118fc[_0x0337('0x49')]['id']}})['then'](handleEntityNotFound(_0x5a23d3,null))[_0x0337('0x25')](saveUpdates(_0x2118fc[_0x0337('0x48')],null))[_0x0337('0x25')](respondWithResult(_0x5a23d3,null))['catch'](handleError(_0x5a23d3,null));};exports[_0x0337('0x4a')]=function(_0x4b906e,_0x112626){return db[_0x0337('0x2b')][_0x0337('0x4b')]({'where':{'id':_0x4b906e[_0x0337('0x49')]['id']}})[_0x0337('0x25')](handleEntityNotFound(_0x112626,null))['then'](removeEntity(_0x112626,null))['catch'](handleError(_0x112626,null));};exports[_0x0337('0x4c')]=function(_0x733e0c,_0x22fa06){return db[_0x0337('0x2b')][_0x0337('0x4c')]()[_0x0337('0x25')](respondWithResult(_0x22fa06,null))[_0x0337('0x44')](handleError(_0x22fa06,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 4b71629..d2e813c 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 _0xbe9a=['define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x20b5de,_0x91b620){var _0x4ed267=function(_0x42b018){while(--_0x42b018){_0x20b5de['push'](_0x20b5de['shift']());}};_0x4ed267(++_0x91b620);}(_0xbe9a,0x1a4));var _0xabe9=function(_0x5e130a,_0x17640c){_0x5e130a=_0x5e130a-0x0;var _0x56326c=_0xbe9a[_0x5e130a];return _0x56326c;};'use strict';var _=require(_0xabe9('0x0'));var util=require('util');var logger=require(_0xabe9('0x1'))(_0xabe9('0x2'));var moment=require(_0xabe9('0x3'));var BPromise=require('bluebird');var rp=require(_0xabe9('0x4'));var fs=require('fs');var path=require(_0xabe9('0x5'));var rimraf=require(_0xabe9('0x6'));var config=require(_0xabe9('0x7'));var attributes=require('./smsTransferReport.attributes');module[_0xabe9('0x8')]=function(_0x40b9aa,_0x1ee7e0){return _0x40b9aa[_0xabe9('0x9')](_0xabe9('0xa'),attributes,{'tableName':_0xabe9('0xb'),'paranoid':![],'indexes':[{'name':_0xabe9('0xc'),'fields':[_0xabe9('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x13c6=['define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment','path','../../config/environment','./smsTransferReport.attributes'];(function(_0x4264bf,_0x39db0f){var _0x515e5f=function(_0x130168){while(--_0x130168){_0x4264bf['push'](_0x4264bf['shift']());}};_0x515e5f(++_0x39db0f);}(_0x13c6,0x94));var _0x613c=function(_0x45d2ed,_0x36b864){_0x45d2ed=_0x45d2ed-0x0;var _0x126138=_0x13c6[_0x45d2ed];return _0x126138;};'use strict';var _=require(_0x613c('0x0'));var util=require(_0x613c('0x1'));var logger=require(_0x613c('0x2'))(_0x613c('0x3'));var moment=require(_0x613c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x613c('0x5'));var rimraf=require('rimraf');var config=require(_0x613c('0x6'));var attributes=require(_0x613c('0x7'));module['exports']=function(_0x1b1cc6,_0x56e0cb){return _0x1b1cc6[_0x613c('0x8')](_0x613c('0x9'),attributes,{'tableName':_0x613c('0xa'),'paranoid':![],'indexes':[{'name':_0x613c('0xb'),'fields':[_0x613c('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 b20674e..ada7f4f 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 _0xf88f=['then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x376c81,_0x27fb63){var _0x2bcb9f=function(_0x3d30ef){while(--_0x3d30ef){_0x376c81['push'](_0x376c81['shift']());}};_0x2bcb9f(++_0x27fb63);}(_0xf88f,0x1bb));var _0xff88=function(_0x4a6cfb,_0x21fff5){_0x4a6cfb=_0x4a6cfb-0x0;var _0xad30d4=_0xf88f[_0x4a6cfb];return _0xad30d4;};'use strict';var _=require(_0xff88('0x0'));var util=require(_0xff88('0x1'));var moment=require(_0xff88('0x2'));var BPromise=require(_0xff88('0x3'));var rs=require(_0xff88('0x4'));var fs=require('fs');var Redis=require(_0xff88('0x5'));var db=require(_0xff88('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xff88('0x7'))(_0xff88('0x8'));var config=require(_0xff88('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xff88('0xa')][_0xff88('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4140a8,_0x1c3110,_0x3551e6){return new BPromise(function(_0x469bfd,_0x585e2b){return client[_0xff88('0xc')](_0x4140a8,_0x3551e6)[_0xff88('0xd')](function(_0x233e85){logger[_0xff88('0xe')](_0xff88('0xf'),_0x1c3110,_0xff88('0x10'));logger[_0xff88('0x11')](_0xff88('0x12'),_0x1c3110,_0xff88('0x10'),JSON[_0xff88('0x13')](_0x233e85));if(_0x233e85[_0xff88('0x14')]){if(_0x233e85[_0xff88('0x14')][_0xff88('0x15')]===0x1f4){logger[_0xff88('0x14')](_0xff88('0xf'),_0x1c3110,_0x233e85['error'][_0xff88('0x16')]);return _0x585e2b(_0x233e85[_0xff88('0x14')][_0xff88('0x16')]);}logger['error'](_0xff88('0xf'),_0x1c3110,_0x233e85[_0xff88('0x14')][_0xff88('0x16')]);return _0x469bfd(_0x233e85[_0xff88('0x14')][_0xff88('0x16')]);}else{logger[_0xff88('0xe')](_0xff88('0xf'),_0x1c3110,_0xff88('0x10'));_0x469bfd(_0x233e85['result'][_0xff88('0x16')]);}})[_0xff88('0x17')](function(_0x5d75ff){logger['error'](_0xff88('0xf'),_0x1c3110,_0x5d75ff);_0x585e2b(_0x5d75ff);});});} \ No newline at end of file +var _0x0689=['catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x3e4bdd,_0x587f24){var _0x2f060b=function(_0x744d50){while(--_0x744d50){_0x3e4bdd['push'](_0x3e4bdd['shift']());}};_0x2f060b(++_0x587f24);}(_0x0689,0x161));var _0x9068=function(_0x1a50e5,_0x14accb){_0x1a50e5=_0x1a50e5-0x0;var _0x53b463=_0x0689[_0x1a50e5];return _0x53b463;};'use strict';var _=require('lodash');var util=require(_0x9068('0x0'));var moment=require('moment');var BPromise=require(_0x9068('0x1'));var rs=require(_0x9068('0x2'));var fs=require('fs');var Redis=require(_0x9068('0x3'));var db=require(_0x9068('0x4'))['db'];var utils=require(_0x9068('0x5'));var logger=require(_0x9068('0x6'))(_0x9068('0x7'));var config=require(_0x9068('0x8'));var jayson=require(_0x9068('0x9'));var client=jayson[_0x9068('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34cb67,_0x5c833f,_0x4bdd1b){return new BPromise(function(_0x17bc63,_0x184746){return client[_0x9068('0xb')](_0x34cb67,_0x4bdd1b)[_0x9068('0xc')](function(_0x1c63d2){logger[_0x9068('0xd')](_0x9068('0xe'),_0x5c833f,_0x9068('0xf'));logger[_0x9068('0x10')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x5c833f,_0x9068('0xf'),JSON[_0x9068('0x11')](_0x1c63d2));if(_0x1c63d2[_0x9068('0x12')]){if(_0x1c63d2[_0x9068('0x12')]['code']===0x1f4){logger[_0x9068('0x12')](_0x9068('0xe'),_0x5c833f,_0x1c63d2[_0x9068('0x12')]['message']);return _0x184746(_0x1c63d2[_0x9068('0x12')][_0x9068('0x13')]);}logger[_0x9068('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x5c833f,_0x1c63d2[_0x9068('0x12')][_0x9068('0x13')]);return _0x17bc63(_0x1c63d2['error'][_0x9068('0x13')]);}else{logger[_0x9068('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x5c833f,_0x9068('0xf'));_0x17bc63(_0x1c63d2[_0x9068('0x14')][_0x9068('0x13')]);}})[_0x9068('0x15')](function(_0x576b34){logger[_0x9068('0x12')](_0x9068('0xe'),_0x5c833f,_0x576b34);_0x184746(_0x576b34);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index f9e50cd..239178e 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 _0xcfee=['now','post','file','create','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','index','show','/:id/download','isAuthenticated','diskStorage','root','originalname','replace','format','%s-%s%s','extname'];(function(_0x4d520e,_0x5f0040){var _0x335a86=function(_0x253182){while(--_0x253182){_0x4d520e['push'](_0x4d520e['shift']());}};_0x335a86(++_0x5f0040);}(_0xcfee,0xfb));var _0xecfe=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xcfee[_0x49b207];return _0x2dc8fa;};'use strict';var multer=require(_0xecfe('0x0'));var util=require(_0xecfe('0x1'));var path=require(_0xecfe('0x2'));var timeout=require(_0xecfe('0x3'));var express=require(_0xecfe('0x4'));var router=express[_0xecfe('0x5')]();var fs_extra=require(_0xecfe('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xecfe('0x7'));var config=require('../../config/environment');var controller=require('./sound.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xecfe('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xecfe('0x9')]);router['get'](_0xecfe('0xa'),auth[_0xecfe('0xb')](),controller['download']);var upload=multer({'storage':multer[_0xecfe('0xc')]({'destination':function(_0x43e402,_0x31faeb,_0x5a362b){_0x5a362b(null,path['join'](config[_0xecfe('0xd')],'server/files/sounds/original/'));},'filename':function(_0x2bab3c,_0x2642a3,_0x9a251f){_0x2642a3[_0xecfe('0xe')]=_0x2642a3[_0xecfe('0xe')][_0xecfe('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x9a251f(null,util[_0xecfe('0x10')](_0xecfe('0x11'),path['basename'](_0x2642a3[_0xecfe('0xe')],path[_0xecfe('0x12')](_0x2642a3[_0xecfe('0xe')])),Date[_0xecfe('0x13')](),path[_0xecfe('0x12')](_0x2642a3[_0xecfe('0xe')])));}})});router[_0xecfe('0x14')]('/',upload['single'](_0xecfe('0x15')),controller[_0xecfe('0x16')]);router[_0xecfe('0x17')](_0xecfe('0x18'),auth[_0xecfe('0xb')](),controller['update']);router['delete'](_0xecfe('0x18'),auth[_0xecfe('0xb')](),controller[_0xecfe('0x19')]);module[_0xecfe('0x1a')]=router; \ No newline at end of file +var _0x5bbf=['extname','post','single','file','create','put','isAuthenticated','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./sound.controller','get','index','/:id','show','download','diskStorage','root','server/files/sounds/original/','originalname','replace','format','basename'];(function(_0x280587,_0x4e9971){var _0x3b7543=function(_0x1e94de){while(--_0x1e94de){_0x280587['push'](_0x280587['shift']());}};_0x3b7543(++_0x4e9971);}(_0x5bbf,0x10a));var _0xf5bb=function(_0xd0a0ae,_0x239a61){_0xd0a0ae=_0xd0a0ae-0x0;var _0x4da1a4=_0x5bbf[_0xd0a0ae];return _0x4da1a4;};'use strict';var multer=require(_0xf5bb('0x0'));var util=require(_0xf5bb('0x1'));var path=require(_0xf5bb('0x2'));var timeout=require(_0xf5bb('0x3'));var express=require(_0xf5bb('0x4'));var router=express[_0xf5bb('0x5')]();var fs_extra=require(_0xf5bb('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf5bb('0x7'));var config=require(_0xf5bb('0x8'));var controller=require(_0xf5bb('0x9'));router[_0xf5bb('0xa')]('/',auth['isAuthenticated'](),controller[_0xf5bb('0xb')]);router[_0xf5bb('0xa')](_0xf5bb('0xc'),auth['isAuthenticated'](),controller[_0xf5bb('0xd')]);router[_0xf5bb('0xa')]('/:id/download',auth['isAuthenticated'](),controller[_0xf5bb('0xe')]);var upload=multer({'storage':multer[_0xf5bb('0xf')]({'destination':function(_0x22ece1,_0xccc099,_0x47dad8){_0x47dad8(null,path['join'](config[_0xf5bb('0x10')],_0xf5bb('0x11')));},'filename':function(_0x2453f2,_0x1eb8d4,_0x255082){_0x1eb8d4[_0xf5bb('0x12')]=_0x1eb8d4['originalname'][_0xf5bb('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x255082(null,util[_0xf5bb('0x14')]('%s-%s%s',path[_0xf5bb('0x15')](_0x1eb8d4[_0xf5bb('0x12')],path[_0xf5bb('0x16')](_0x1eb8d4['originalname'])),Date['now'](),path[_0xf5bb('0x16')](_0x1eb8d4[_0xf5bb('0x12')])));}})});router[_0xf5bb('0x17')]('/',upload[_0xf5bb('0x18')](_0xf5bb('0x19')),controller[_0xf5bb('0x1a')]);router[_0xf5bb('0x1b')](_0xf5bb('0xc'),auth[_0xf5bb('0x1c')](),controller[_0xf5bb('0x1d')]);router[_0xf5bb('0x1e')](_0xf5bb('0xc'),auth[_0xf5bb('0x1c')](),controller['delete']);module[_0xf5bb('0x1f')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 2b83ba8..e5e9fda 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 _0x2eca=['INTEGER','BIGINT','sequelize','exports','name','STRING','FLOAT'];(function(_0x318840,_0x561b1e){var _0x223da4=function(_0x510071){while(--_0x510071){_0x318840['push'](_0x318840['shift']());}};_0x223da4(++_0x561b1e);}(_0x2eca,0x191));var _0xa2ec=function(_0x2918fb,_0x1ac725){_0x2918fb=_0x2918fb-0x0;var _0xef01f8=_0x2eca[_0x2918fb];return _0xef01f8;};'use strict';var Sequelize=require(_0xa2ec('0x0'));module[_0xa2ec('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa2ec('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xa2ec('0x3')]},'display_name':{'type':Sequelize[_0xa2ec('0x3')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xa2ec('0x3')]},'original_duration':{'type':Sequelize[_0xa2ec('0x4')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xa2ec('0x5')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0xa2ec('0x3')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xa2ec('0x6')]},'converted_sampleRate':{'type':Sequelize[_0xa2ec('0x5')]}}; \ No newline at end of file +var _0x9335=['FLOAT','BIGINT','INTEGER','sequelize','exports','name','STRING'];(function(_0x21de89,_0x367053){var _0x290b7e=function(_0x540704){while(--_0x540704){_0x21de89['push'](_0x21de89['shift']());}};_0x290b7e(++_0x367053);}(_0x9335,0xab));var _0x5933=function(_0x1f032e,_0x4daca7){_0x1f032e=_0x1f032e-0x0;var _0x32615d=_0x9335[_0x1f032e];return _0x32615d;};'use strict';var Sequelize=require(_0x5933('0x0'));module[_0x5933('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5933('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x5933('0x3')]},'display_name':{'type':Sequelize[_0x5933('0x3')],'defaultValue':''},'description':{'type':Sequelize[_0x5933('0x3')]},'original_format':{'type':Sequelize[_0x5933('0x3')]},'original_duration':{'type':Sequelize[_0x5933('0x4')]},'original_sampleCount':{'type':Sequelize[_0x5933('0x5')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x5933('0x5')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x5933('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x5933('0x5')]},'converted_channelCount':{'type':Sequelize[_0x5933('0x6')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x5933('0x6')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 8252086..9f7ca30 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 _0x9fa3=['key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Sound','includeAll','include','findAll','find','download','params','save_name','existsSync','join','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','catch','create','basename','file','originalname','filename','extname','wav','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','original_format','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','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','offset','undefined','limit','count','Content-Range','save','update','then','destroy','get','Sounds','error','stack','name','send','index','rawAttributes','fieldName','type'];(function(_0x4bfe28,_0x4ffe2e){var _0x3b6518=function(_0x420d20){while(--_0x420d20){_0x4bfe28['push'](_0x4bfe28['shift']());}};_0x3b6518(++_0x4ffe2e);}(_0x9fa3,0x14d));var _0x39fa=function(_0x49e262,_0x2671aa){_0x49e262=_0x49e262-0x0;var _0x336aa9=_0x9fa3[_0x49e262];return _0x336aa9;};'use strict';var emlformat=require(_0x39fa('0x0'));var rimraf=require(_0x39fa('0x1'));var zipdir=require(_0x39fa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x39fa('0x3'));var moment=require(_0x39fa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x39fa('0x5'));var util=require(_0x39fa('0x6'));var path=require(_0x39fa('0x7'));var sox=require('sox');var csv=require(_0x39fa('0x8'));var ejs=require(_0x39fa('0x9'));var fs=require('fs');var fs_extra=require(_0x39fa('0xa'));var _=require(_0x39fa('0xb'));var squel=require('squel');var crypto=require(_0x39fa('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x39fa('0xd'));var toCsv=require(_0x39fa('0x8'));var querystring=require(_0x39fa('0xe'));var Papa=require(_0x39fa('0xf'));var Redis=require('ioredis');var authService=require(_0x39fa('0x10'));var qs=require(_0x39fa('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x39fa('0x12'));var logger=require(_0x39fa('0x13'))(_0x39fa('0x14'));var utils=require(_0x39fa('0x15'));var config=require(_0x39fa('0x16'));var licenseUtil=require(_0x39fa('0x17'));var db=require(_0x39fa('0x18'))['db'];function respondWithStatusCode(_0x44b632,_0x4546f5){_0x4546f5=_0x4546f5||0xcc;return function(_0x5896fc){if(_0x5896fc){return _0x44b632[_0x39fa('0x19')](_0x4546f5);}return _0x44b632[_0x39fa('0x1a')](_0x4546f5)[_0x39fa('0x1b')]();};}function respondWithResult(_0x53cdbb,_0x35353d){_0x35353d=_0x35353d||0xc8;return function(_0x5d1856){if(_0x5d1856){return _0x53cdbb[_0x39fa('0x1a')](_0x35353d)[_0x39fa('0x1c')](_0x5d1856);}};}function respondWithFilteredResult(_0x4e27f2,_0x3d2448){return function(_0x55dde4){if(_0x55dde4){var _0x47964d=typeof _0x3d2448[_0x39fa('0x1d')]===_0x39fa('0x1e')&&typeof _0x3d2448[_0x39fa('0x1f')]===_0x39fa('0x1e');var _0x221285=_0x55dde4[_0x39fa('0x20')];var _0x43948c=_0x47964d?0x0:_0x3d2448['offset'];var _0x2a297a=_0x47964d?_0x55dde4[_0x39fa('0x20')]:_0x3d2448['offset']+_0x3d2448[_0x39fa('0x1f')];var _0x2dd45e;if(_0x2a297a>=_0x221285){_0x2a297a=_0x221285;_0x2dd45e=0xc8;}else{_0x2dd45e=0xce;}_0x4e27f2[_0x39fa('0x1a')](_0x2dd45e);return _0x4e27f2['set'](_0x39fa('0x21'),_0x43948c+'-'+_0x2a297a+'/'+_0x221285)[_0x39fa('0x1c')](_0x55dde4);}return null;};}function patchUpdates(_0x10f0cc){return function(_0x3fb033){try{jsonpatch['apply'](_0x3fb033,_0x10f0cc,!![]);}catch(_0x45ce51){return BPromise['reject'](_0x45ce51);}return _0x3fb033[_0x39fa('0x22')]();};}function saveUpdates(_0x43e5ae,_0x523e39){return function(_0x2378d4){if(_0x2378d4){return _0x2378d4[_0x39fa('0x23')](_0x43e5ae)[_0x39fa('0x24')](function(_0x1ddd1d){return _0x1ddd1d;});}return null;};}function removeEntity(_0x1d2287,_0x33c652){return function(_0x5221dd){if(_0x5221dd){return _0x5221dd[_0x39fa('0x25')]()['then'](function(){var _0x4adb7c=_0x5221dd[_0x39fa('0x26')]({'plain':!![]});var _0x403d1c=_0x39fa('0x27');return db['UserProfileResource'][_0x39fa('0x25')]({'where':{'type':_0x403d1c,'resourceId':_0x4adb7c['id']}})[_0x39fa('0x24')](function(){return _0x5221dd;});})[_0x39fa('0x24')](function(){_0x1d2287[_0x39fa('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58a138,_0x44ac5b){return function(_0xcb24c8){if(!_0xcb24c8){_0x58a138['sendStatus'](0x194);}return _0xcb24c8;};}function handleError(_0x1179f7,_0x35070c){_0x35070c=_0x35070c||0x1f4;return function(_0x13b43a){logger[_0x39fa('0x28')](_0x13b43a[_0x39fa('0x29')]);if(_0x13b43a[_0x39fa('0x2a')]){delete _0x13b43a['name'];}_0x1179f7[_0x39fa('0x1a')](_0x35070c)[_0x39fa('0x2b')](_0x13b43a);};}exports[_0x39fa('0x2c')]=function(_0xbb3dbb,_0x418585){var _0x4f40c6={},_0x1b8c7c={},_0x48ab74={'count':0x0,'rows':[]};var _0x42e23a=_['map'](db['Sound'][_0x39fa('0x2d')],function(_0x7b2e1){return{'name':_0x7b2e1[_0x39fa('0x2e')],'type':_0x7b2e1[_0x39fa('0x2f')][_0x39fa('0x30')]};});_0x1b8c7c[_0x39fa('0x31')]=_[_0x39fa('0x32')](_0x42e23a,_0x39fa('0x2a'));_0x1b8c7c[_0x39fa('0x33')]=_[_0x39fa('0x34')](_0xbb3dbb[_0x39fa('0x33')]);_0x1b8c7c[_0x39fa('0x35')]=_[_0x39fa('0x36')](_0x1b8c7c[_0x39fa('0x31')],_0x1b8c7c[_0x39fa('0x33')]);_0x4f40c6[_0x39fa('0x37')]=_['intersection'](_0x1b8c7c['model'],qs[_0x39fa('0x38')](_0xbb3dbb[_0x39fa('0x33')][_0x39fa('0x38')]));_0x4f40c6[_0x39fa('0x37')]=_0x4f40c6['attributes'][_0x39fa('0x39')]?_0x4f40c6[_0x39fa('0x37')]:_0x1b8c7c['model'];if(!_0xbb3dbb[_0x39fa('0x33')][_0x39fa('0x3a')]('nolimit')){_0x4f40c6[_0x39fa('0x1f')]=qs[_0x39fa('0x1f')](_0xbb3dbb[_0x39fa('0x33')]['limit']);_0x4f40c6[_0x39fa('0x1d')]=qs[_0x39fa('0x1d')](_0xbb3dbb[_0x39fa('0x33')][_0x39fa('0x1d')]);}_0x4f40c6[_0x39fa('0x3b')]=qs[_0x39fa('0x3c')](_0xbb3dbb[_0x39fa('0x33')]['sort']);_0x4f40c6[_0x39fa('0x3d')]=qs['filters'](_[_0x39fa('0x3e')](_0xbb3dbb[_0x39fa('0x33')],_0x1b8c7c['filters']),_0x42e23a);if(_0xbb3dbb[_0x39fa('0x33')][_0x39fa('0x3f')]){_0x4f40c6[_0x39fa('0x3d')]=_[_0x39fa('0x40')](_0x4f40c6['where'],{'$or':_[_0x39fa('0x32')](_0x42e23a,function(_0x47370c){if(_0x47370c[_0x39fa('0x2f')]!==_0x39fa('0x41')){var _0x289030={};_0x289030[_0x47370c[_0x39fa('0x2a')]]={'$like':'%'+_0xbb3dbb['query'][_0x39fa('0x3f')]+'%'};return _0x289030;}})});}_0x4f40c6=_[_0x39fa('0x40')]({},_0x4f40c6,_0xbb3dbb[_0x39fa('0x42')]);var _0x3a32da={'where':_0x4f40c6[_0x39fa('0x3d')]};return db[_0x39fa('0x43')][_0x39fa('0x20')](_0x3a32da)['then'](function(_0x1899d8){_0x48ab74[_0x39fa('0x20')]=_0x1899d8;if(_0xbb3dbb[_0x39fa('0x33')][_0x39fa('0x44')]){_0x4f40c6[_0x39fa('0x45')]=[{'all':!![]}];}return db[_0x39fa('0x43')][_0x39fa('0x46')](_0x4f40c6);})[_0x39fa('0x24')](function(_0x1ab474){_0x48ab74['rows']=_0x1ab474;return _0x48ab74;})['then'](respondWithFilteredResult(_0x418585,_0x4f40c6))['catch'](handleError(_0x418585,null));};exports['show']=function(_0x42c897,_0x60190b){var _0x40dbb1={'raw':!![],'where':{'id':_0x42c897['params']['id']}},_0x109c12={};_0x109c12[_0x39fa('0x31')]=_[_0x39fa('0x34')](db[_0x39fa('0x43')][_0x39fa('0x2d')]);_0x109c12[_0x39fa('0x33')]=_['keys'](_0x42c897[_0x39fa('0x33')]);_0x109c12['filters']=_['intersection'](_0x109c12[_0x39fa('0x31')],_0x109c12[_0x39fa('0x33')]);_0x40dbb1[_0x39fa('0x37')]=_[_0x39fa('0x36')](_0x109c12['model'],qs['fields'](_0x42c897[_0x39fa('0x33')]['fields']));_0x40dbb1[_0x39fa('0x37')]=_0x40dbb1['attributes'][_0x39fa('0x39')]?_0x40dbb1[_0x39fa('0x37')]:_0x109c12[_0x39fa('0x31')];if(_0x42c897[_0x39fa('0x33')][_0x39fa('0x44')]){_0x40dbb1[_0x39fa('0x45')]=[{'all':!![]}];}_0x40dbb1=_[_0x39fa('0x40')]({},_0x40dbb1,_0x42c897['options']);return db[_0x39fa('0x43')][_0x39fa('0x47')](_0x40dbb1)['then'](handleEntityNotFound(_0x60190b,null))[_0x39fa('0x24')](respondWithResult(_0x60190b,null))['catch'](handleError(_0x60190b,null));};exports[_0x39fa('0x48')]=function(_0x180daa,_0x31a3cf,_0x4e6333){return db[_0x39fa('0x43')][_0x39fa('0x47')]({'where':{'id':_0x180daa[_0x39fa('0x49')]['id']},'attributes':[_0x39fa('0x2a'),_0x39fa('0x4a'),'converted_format'],'raw':!![]})[_0x39fa('0x24')](handleEntityNotFound(_0x31a3cf,null))['then'](function(_0x112318){if(_0x112318){if(!fs[_0x39fa('0x4b')](path[_0x39fa('0x4c')](config[_0x39fa('0x4d')],_0x39fa('0x4e'),_0x112318['save_name']+'.'+_0x112318[_0x39fa('0x4f')]))){throw new db[(_0x39fa('0x50'))][(_0x39fa('0x51'))](_0x39fa('0x52'));}return _0x31a3cf[_0x39fa('0x48')](path[_0x39fa('0x4c')](config[_0x39fa('0x4d')],_0x39fa('0x4e'),util[_0x39fa('0x53')](_0x39fa('0x54'),_0x112318[_0x39fa('0x4a')],_0x112318['converted_format'])),util[_0x39fa('0x53')](_0x39fa('0x54'),_0x112318[_0x39fa('0x2a')],_0x112318[_0x39fa('0x4f')]));}return null;})[_0x39fa('0x55')](handleError(_0x31a3cf,null));};exports[_0x39fa('0x56')]=function(_0x44b257,_0x27b4c5,_0x30e9e9){var _0x37c8d6={'name':path[_0x39fa('0x57')](_0x44b257[_0x39fa('0x58')][_0x39fa('0x59')],path['extname'](_0x44b257['file']['originalname'])),'save_name':path[_0x39fa('0x57')](_0x44b257[_0x39fa('0x58')][_0x39fa('0x5a')],path[_0x39fa('0x5b')](_0x44b257['file'][_0x39fa('0x5a')])),'original_format':path['extname'](_0x44b257[_0x39fa('0x58')][_0x39fa('0x59')])['substring'](0x1),'converted_format':_0x39fa('0x5c')};var _0x79158a=path['join'](config[_0x39fa('0x4d')],_0x39fa('0x5d'),_0x44b257['file'][_0x39fa('0x5a')]);var _0x17be9c=path[_0x39fa('0x4c')](config[_0x39fa('0x4d')],'server/files/sounds/converted',util[_0x39fa('0x53')](_0x39fa('0x54'),path[_0x39fa('0x57')](_0x44b257[_0x39fa('0x58')]['filename'],path[_0x39fa('0x5b')](_0x44b257[_0x39fa('0x58')]['filename'])),_0x37c8d6['converted_format']));logger[_0x39fa('0x5e')]('Sound\x20upload\x20filepath:\x20%s',_0x79158a);logger[_0x39fa('0x5e')](_0x39fa('0x5f'),_0x17be9c);try{fs[_0x39fa('0x60')](_0x79158a,parseInt(_0x39fa('0x61'),0x8));var _0x25575e=sox[_0x39fa('0x62')](_0x79158a,_0x17be9c,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x25575e['on']('error',function(_0x564258){fs['unlinkSync'](_0x79158a);_0x27b4c5[_0x39fa('0x1a')](0x1f4)[_0x39fa('0x2b')](_0x564258);});_0x25575e['on'](_0x39fa('0x63'),function(_0xb08de8){_0x37c8d6[_0x39fa('0x64')]=isNaN(_0xb08de8[_0x39fa('0x65')])?null:_0xb08de8['duration']*0x3e8;_0x37c8d6[_0x39fa('0x66')]=isNaN(_0xb08de8[_0x39fa('0x67')])?null:_0xb08de8[_0x39fa('0x67')];_0x37c8d6[_0x39fa('0x68')]=isNaN(_0xb08de8[_0x39fa('0x69')])?null:_0xb08de8['channelCount'];_0x37c8d6['original_bitRate']=isNaN(_0xb08de8[_0x39fa('0x6a')])?null:_0xb08de8[_0x39fa('0x6a')];_0x37c8d6[_0x39fa('0x6b')]=isNaN(_0xb08de8['sampleRate'])?null:_0xb08de8[_0x39fa('0x6c')];});_0x25575e['on'](_0x39fa('0x6d'),function(_0x223295){_0x37c8d6[_0x39fa('0x6e')]=isNaN(_0x223295[_0x39fa('0x65')])?null:_0x223295['duration']*0x3e8;_0x37c8d6['converted_sampleCount']=isNaN(_0x223295[_0x39fa('0x67')])?null:_0x223295['sampleCount'];_0x37c8d6[_0x39fa('0x6f')]=isNaN(_0x223295[_0x39fa('0x69')])?null:_0x223295[_0x39fa('0x69')];_0x37c8d6[_0x39fa('0x70')]=isNaN(_0x223295[_0x39fa('0x6a')])?null:_0x223295[_0x39fa('0x6a')];_0x37c8d6[_0x39fa('0x71')]=isNaN(_0x223295[_0x39fa('0x6c')])?null:_0x223295['sampleRate'];});_0x25575e['on'](_0x39fa('0x1b'),function(){fs[_0x39fa('0x60')](_0x17be9c,parseInt(_0x39fa('0x61'),0x8));return db[_0x39fa('0x43')][_0x39fa('0x56')](_0x37c8d6)[_0x39fa('0x24')](function(_0x2c48b0){var _0xf89070={'role':_0x44b257[_0x39fa('0x72')][_0x39fa('0x73')],'userProfileId':_0x44b257[_0x39fa('0x72')][_0x39fa('0x74')]};if(!_0xf89070)throw new Error(_0x39fa('0x75'));if(_0xf89070['role']==='user'){var _0x3bf59e=_0x2c48b0[_0x39fa('0x26')]({'plain':!![]});return db[_0x39fa('0x76')][_0x39fa('0x47')]({'where':{'name':_0x39fa('0x27'),'userProfileId':_0xf89070[_0x39fa('0x74')]},'raw':!![]})['then'](function(_0x48447a){if(_0x48447a&&_0x48447a[_0x39fa('0x77')]===0x0){return db[_0x39fa('0x78')][_0x39fa('0x56')]({'name':_0x3bf59e[_0x39fa('0x2a')],'resourceId':_0x3bf59e['id'],'type':_0x48447a[_0x39fa('0x2a')],'sectionId':_0x48447a['id']},{})[_0x39fa('0x24')](function(){return _0x2c48b0;});}else{return _0x2c48b0;}})[_0x39fa('0x55')](function(_0x138575){logger[_0x39fa('0x28')](_0x39fa('0x79'),_0x138575);throw _0x138575;});}return _0x2c48b0;})[_0x39fa('0x24')](respondWithResult(_0x27b4c5,null))[_0x39fa('0x55')](handleError(_0x27b4c5,null));});_0x25575e[_0x39fa('0x7a')]();}catch(_0x5ca790){_0x27b4c5[_0x39fa('0x1a')](0x1f4)['send'](_0x5ca790);}};exports[_0x39fa('0x23')]=function(_0x154316,_0x58e91f,_0x4fe643){return db[_0x39fa('0x43')]['find']({'where':{'id':_0x154316[_0x39fa('0x49')]['id']}})[_0x39fa('0x24')](handleEntityNotFound(_0x58e91f,null))['then'](saveUpdates(_[_0x39fa('0x3e')](_0x154316[_0x39fa('0x72')],[_0x39fa('0x2a'),_0x39fa('0x7b')]),null))[_0x39fa('0x24')](respondWithResult(_0x58e91f,null))[_0x39fa('0x55')](handleError(_0x58e91f,null));};exports[_0x39fa('0x7c')]=function(_0x369112,_0x3663c1,_0x575fcd){return db['Sound']['find']({'where':{'id':_0x369112['params']['id']}})['then'](function(_0x402dd9){if(_0x402dd9){return _0x402dd9[_0x39fa('0x25')]();}})[_0x39fa('0x24')](function(_0x53cbc2){var _0x5a1dc1=path[_0x39fa('0x4c')](config[_0x39fa('0x4d')],_0x39fa('0x5d'),util[_0x39fa('0x53')](_0x39fa('0x54'),_0x53cbc2[_0x39fa('0x4a')],_0x53cbc2[_0x39fa('0x7d')]));var _0x1e24c2=path['join'](config['root'],'server/files/sounds/converted',util[_0x39fa('0x53')](_0x39fa('0x54'),_0x53cbc2[_0x39fa('0x4a')],_0x53cbc2[_0x39fa('0x4f')]));fs[_0x39fa('0x7e')](_0x5a1dc1);fs['unlinkSync'](_0x1e24c2);return _0x53cbc2;})[_0x39fa('0x24')](function(_0x21d849){if(_0x21d849){return _0x3663c1[_0x39fa('0x1a')](0xcc)['end']();}})['then'](handleEntityNotFound(_0x3663c1,null))['catch'](handleError(_0x3663c1,null));}; \ No newline at end of file +var _0xfd4f=['start','update','description','delete','original_format','unlinkSync','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','then','get','Sounds','destroy','error','stack','name','send','index','Sound','rawAttributes','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','options','download','find','save_name','converted_format','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','catch','create','basename','file','originalname','filename','extname','substring','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','dest','converted_channelCount','converted_bitRate','converted_sampleRate','sampleRate','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x466e57,_0x21b819){var _0x34df42=function(_0x3e9758){while(--_0x3e9758){_0x466e57['push'](_0x466e57['shift']());}};_0x34df42(++_0x21b819);}(_0xfd4f,0xf4));var _0xffd4=function(_0x4599e0,_0x21fd43){_0x4599e0=_0x4599e0-0x0;var _0x50c171=_0xfd4f[_0x4599e0];return _0x50c171;};'use strict';var emlformat=require(_0xffd4('0x0'));var rimraf=require(_0xffd4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xffd4('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xffd4('0x3'));var Mustache=require(_0xffd4('0x4'));var util=require(_0xffd4('0x5'));var path=require('path');var sox=require(_0xffd4('0x6'));var csv=require(_0xffd4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xffd4('0x8'));var _=require('lodash');var squel=require(_0xffd4('0x9'));var crypto=require(_0xffd4('0xa'));var jsforce=require(_0xffd4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xffd4('0x7'));var querystring=require(_0xffd4('0xc'));var Papa=require(_0xffd4('0xd'));var Redis=require(_0xffd4('0xe'));var authService=require(_0xffd4('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xffd4('0x10'));var hardwareService=require(_0xffd4('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xffd4('0x12'));var config=require(_0xffd4('0x13'));var licenseUtil=require(_0xffd4('0x14'));var db=require(_0xffd4('0x15'))['db'];function respondWithStatusCode(_0x48b870,_0x1e74ef){_0x1e74ef=_0x1e74ef||0xcc;return function(_0x4b3e25){if(_0x4b3e25){return _0x48b870[_0xffd4('0x16')](_0x1e74ef);}return _0x48b870[_0xffd4('0x17')](_0x1e74ef)[_0xffd4('0x18')]();};}function respondWithResult(_0x217535,_0x4dbca2){_0x4dbca2=_0x4dbca2||0xc8;return function(_0x4a3f52){if(_0x4a3f52){return _0x217535[_0xffd4('0x17')](_0x4dbca2)['json'](_0x4a3f52);}};}function respondWithFilteredResult(_0x1fbe0f,_0x19c143){return function(_0x379de6){if(_0x379de6){var _0x1b333f=typeof _0x19c143[_0xffd4('0x19')]===_0xffd4('0x1a')&&typeof _0x19c143[_0xffd4('0x1b')]===_0xffd4('0x1a');var _0x2b307f=_0x379de6[_0xffd4('0x1c')];var _0x5e1c6c=_0x1b333f?0x0:_0x19c143[_0xffd4('0x19')];var _0x3dcbe0=_0x1b333f?_0x379de6['count']:_0x19c143['offset']+_0x19c143[_0xffd4('0x1b')];var _0x110fab;if(_0x3dcbe0>=_0x2b307f){_0x3dcbe0=_0x2b307f;_0x110fab=0xc8;}else{_0x110fab=0xce;}_0x1fbe0f[_0xffd4('0x17')](_0x110fab);return _0x1fbe0f[_0xffd4('0x1d')]('Content-Range',_0x5e1c6c+'-'+_0x3dcbe0+'/'+_0x2b307f)['json'](_0x379de6);}return null;};}function patchUpdates(_0x253b5d){return function(_0x2f7caa){try{jsonpatch[_0xffd4('0x1e')](_0x2f7caa,_0x253b5d,!![]);}catch(_0x15a73b){return BPromise[_0xffd4('0x1f')](_0x15a73b);}return _0x2f7caa[_0xffd4('0x20')]();};}function saveUpdates(_0x395652,_0x1c6d87){return function(_0x5825e6){if(_0x5825e6){return _0x5825e6['update'](_0x395652)[_0xffd4('0x21')](function(_0x423c5b){return _0x423c5b;});}return null;};}function removeEntity(_0x5edc4f,_0x361910){return function(_0x35ea54){if(_0x35ea54){return _0x35ea54['destroy']()[_0xffd4('0x21')](function(){var _0x1d5ba5=_0x35ea54[_0xffd4('0x22')]({'plain':!![]});var _0x30fbfb=_0xffd4('0x23');return db['UserProfileResource'][_0xffd4('0x24')]({'where':{'type':_0x30fbfb,'resourceId':_0x1d5ba5['id']}})[_0xffd4('0x21')](function(){return _0x35ea54;});})[_0xffd4('0x21')](function(){_0x5edc4f[_0xffd4('0x17')](0xcc)[_0xffd4('0x18')]();});}};}function handleEntityNotFound(_0x64b455,_0x315961){return function(_0x27c69a){if(!_0x27c69a){_0x64b455[_0xffd4('0x16')](0x194);}return _0x27c69a;};}function handleError(_0x48aa84,_0x2447f4){_0x2447f4=_0x2447f4||0x1f4;return function(_0x4cb4bb){logger[_0xffd4('0x25')](_0x4cb4bb[_0xffd4('0x26')]);if(_0x4cb4bb[_0xffd4('0x27')]){delete _0x4cb4bb['name'];}_0x48aa84[_0xffd4('0x17')](_0x2447f4)[_0xffd4('0x28')](_0x4cb4bb);};}exports[_0xffd4('0x29')]=function(_0x315ab7,_0x410843){var _0x55f1d={},_0x2f8990={},_0x1f50a6={'count':0x0,'rows':[]};var _0xad50a=_['map'](db[_0xffd4('0x2a')][_0xffd4('0x2b')],function(_0x510244){return{'name':_0x510244['fieldName'],'type':_0x510244['type'][_0xffd4('0x2c')]};});_0x2f8990[_0xffd4('0x2d')]=_[_0xffd4('0x2e')](_0xad50a,_0xffd4('0x27'));_0x2f8990[_0xffd4('0x2f')]=_['keys'](_0x315ab7[_0xffd4('0x2f')]);_0x2f8990[_0xffd4('0x30')]=_[_0xffd4('0x31')](_0x2f8990[_0xffd4('0x2d')],_0x2f8990['query']);_0x55f1d['attributes']=_['intersection'](_0x2f8990['model'],qs['fields'](_0x315ab7['query'][_0xffd4('0x32')]));_0x55f1d[_0xffd4('0x33')]=_0x55f1d[_0xffd4('0x33')][_0xffd4('0x34')]?_0x55f1d[_0xffd4('0x33')]:_0x2f8990[_0xffd4('0x2d')];if(!_0x315ab7['query'][_0xffd4('0x35')]('nolimit')){_0x55f1d[_0xffd4('0x1b')]=qs[_0xffd4('0x1b')](_0x315ab7[_0xffd4('0x2f')]['limit']);_0x55f1d[_0xffd4('0x19')]=qs['offset'](_0x315ab7[_0xffd4('0x2f')][_0xffd4('0x19')]);}_0x55f1d[_0xffd4('0x36')]=qs[_0xffd4('0x37')](_0x315ab7[_0xffd4('0x2f')][_0xffd4('0x37')]);_0x55f1d['where']=qs[_0xffd4('0x30')](_[_0xffd4('0x38')](_0x315ab7[_0xffd4('0x2f')],_0x2f8990['filters']),_0xad50a);if(_0x315ab7[_0xffd4('0x2f')][_0xffd4('0x39')]){_0x55f1d[_0xffd4('0x3a')]=_[_0xffd4('0x3b')](_0x55f1d[_0xffd4('0x3a')],{'$or':_['map'](_0xad50a,function(_0x1df5fb){if(_0x1df5fb[_0xffd4('0x3c')]!==_0xffd4('0x3d')){var _0x2c4b58={};_0x2c4b58[_0x1df5fb[_0xffd4('0x27')]]={'$like':'%'+_0x315ab7['query'][_0xffd4('0x39')]+'%'};return _0x2c4b58;}})});}_0x55f1d=_['merge']({},_0x55f1d,_0x315ab7['options']);var _0x532653={'where':_0x55f1d[_0xffd4('0x3a')]};return db[_0xffd4('0x2a')][_0xffd4('0x1c')](_0x532653)[_0xffd4('0x21')](function(_0x5becc0){_0x1f50a6['count']=_0x5becc0;if(_0x315ab7['query'][_0xffd4('0x3e')]){_0x55f1d[_0xffd4('0x3f')]=[{'all':!![]}];}return db[_0xffd4('0x2a')][_0xffd4('0x40')](_0x55f1d);})['then'](function(_0x2e861b){_0x1f50a6[_0xffd4('0x41')]=_0x2e861b;return _0x1f50a6;})[_0xffd4('0x21')](respondWithFilteredResult(_0x410843,_0x55f1d))['catch'](handleError(_0x410843,null));};exports[_0xffd4('0x42')]=function(_0x2a8c7f,_0x537d11){var _0x504828={'raw':!![],'where':{'id':_0x2a8c7f[_0xffd4('0x43')]['id']}},_0x286b2f={};_0x286b2f[_0xffd4('0x2d')]=_[_0xffd4('0x44')](db[_0xffd4('0x2a')][_0xffd4('0x2b')]);_0x286b2f[_0xffd4('0x2f')]=_[_0xffd4('0x44')](_0x2a8c7f['query']);_0x286b2f['filters']=_[_0xffd4('0x31')](_0x286b2f[_0xffd4('0x2d')],_0x286b2f[_0xffd4('0x2f')]);_0x504828[_0xffd4('0x33')]=_['intersection'](_0x286b2f['model'],qs[_0xffd4('0x32')](_0x2a8c7f[_0xffd4('0x2f')][_0xffd4('0x32')]));_0x504828[_0xffd4('0x33')]=_0x504828[_0xffd4('0x33')][_0xffd4('0x34')]?_0x504828[_0xffd4('0x33')]:_0x286b2f[_0xffd4('0x2d')];if(_0x2a8c7f[_0xffd4('0x2f')]['includeAll']){_0x504828['include']=[{'all':!![]}];}_0x504828=_[_0xffd4('0x3b')]({},_0x504828,_0x2a8c7f[_0xffd4('0x45')]);return db['Sound']['find'](_0x504828)[_0xffd4('0x21')](handleEntityNotFound(_0x537d11,null))[_0xffd4('0x21')](respondWithResult(_0x537d11,null))['catch'](handleError(_0x537d11,null));};exports[_0xffd4('0x46')]=function(_0x2b18c7,_0x3b7035,_0x4f3688){return db[_0xffd4('0x2a')][_0xffd4('0x47')]({'where':{'id':_0x2b18c7[_0xffd4('0x43')]['id']},'attributes':[_0xffd4('0x27'),_0xffd4('0x48'),_0xffd4('0x49')],'raw':!![]})['then'](handleEntityNotFound(_0x3b7035,null))[_0xffd4('0x21')](function(_0x270a04){if(_0x270a04){if(!fs['existsSync'](path[_0xffd4('0x4a')](config[_0xffd4('0x4b')],_0xffd4('0x4c'),_0x270a04[_0xffd4('0x48')]+'.'+_0x270a04[_0xffd4('0x49')]))){throw new db[(_0xffd4('0x4d'))][(_0xffd4('0x4e'))](_0xffd4('0x4f'));}return _0x3b7035[_0xffd4('0x46')](path[_0xffd4('0x4a')](config[_0xffd4('0x4b')],_0xffd4('0x4c'),util[_0xffd4('0x50')](_0xffd4('0x51'),_0x270a04[_0xffd4('0x48')],_0x270a04[_0xffd4('0x49')])),util['format'](_0xffd4('0x51'),_0x270a04['name'],_0x270a04[_0xffd4('0x49')]));}return null;})[_0xffd4('0x52')](handleError(_0x3b7035,null));};exports[_0xffd4('0x53')]=function(_0x2e45e1,_0x5b4603,_0x25fdf1){var _0x4db26c={'name':path[_0xffd4('0x54')](_0x2e45e1[_0xffd4('0x55')]['originalname'],path['extname'](_0x2e45e1[_0xffd4('0x55')][_0xffd4('0x56')])),'save_name':path['basename'](_0x2e45e1[_0xffd4('0x55')][_0xffd4('0x57')],path['extname'](_0x2e45e1[_0xffd4('0x55')]['filename'])),'original_format':path[_0xffd4('0x58')](_0x2e45e1[_0xffd4('0x55')][_0xffd4('0x56')])[_0xffd4('0x59')](0x1),'converted_format':'wav'};var _0x3ba849=path['join'](config[_0xffd4('0x4b')],_0xffd4('0x5a'),_0x2e45e1[_0xffd4('0x55')]['filename']);var _0x1088e1=path['join'](config['root'],_0xffd4('0x4c'),util[_0xffd4('0x50')](_0xffd4('0x51'),path[_0xffd4('0x54')](_0x2e45e1[_0xffd4('0x55')][_0xffd4('0x57')],path['extname'](_0x2e45e1[_0xffd4('0x55')]['filename'])),_0x4db26c[_0xffd4('0x49')]));logger['info'](_0xffd4('0x5b'),_0x3ba849);logger['info']('Sound\x20upload\x20destination:\x20%s',_0x1088e1);try{fs[_0xffd4('0x5c')](_0x3ba849,parseInt(_0xffd4('0x5d'),0x8));var _0x57ecac=sox['transcode'](_0x3ba849,_0x1088e1,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x57ecac['on'](_0xffd4('0x25'),function(_0x141ce5){fs['unlinkSync'](_0x3ba849);_0x5b4603[_0xffd4('0x17')](0x1f4)[_0xffd4('0x28')](_0x141ce5);});_0x57ecac['on']('src',function(_0xb66fb6){_0x4db26c['original_duration']=isNaN(_0xb66fb6['duration'])?null:_0xb66fb6[_0xffd4('0x5e')]*0x3e8;_0x4db26c[_0xffd4('0x5f')]=isNaN(_0xb66fb6[_0xffd4('0x60')])?null:_0xb66fb6[_0xffd4('0x60')];_0x4db26c[_0xffd4('0x61')]=isNaN(_0xb66fb6[_0xffd4('0x62')])?null:_0xb66fb6[_0xffd4('0x62')];_0x4db26c[_0xffd4('0x63')]=isNaN(_0xb66fb6[_0xffd4('0x64')])?null:_0xb66fb6[_0xffd4('0x64')];_0x4db26c['original_sampleRate']=isNaN(_0xb66fb6['sampleRate'])?null:_0xb66fb6['sampleRate'];});_0x57ecac['on'](_0xffd4('0x65'),function(_0x3fb406){_0x4db26c['converted_duration']=isNaN(_0x3fb406[_0xffd4('0x5e')])?null:_0x3fb406[_0xffd4('0x5e')]*0x3e8;_0x4db26c['converted_sampleCount']=isNaN(_0x3fb406[_0xffd4('0x60')])?null:_0x3fb406['sampleCount'];_0x4db26c[_0xffd4('0x66')]=isNaN(_0x3fb406[_0xffd4('0x62')])?null:_0x3fb406['channelCount'];_0x4db26c[_0xffd4('0x67')]=isNaN(_0x3fb406[_0xffd4('0x64')])?null:_0x3fb406['bitRate'];_0x4db26c[_0xffd4('0x68')]=isNaN(_0x3fb406[_0xffd4('0x69')])?null:_0x3fb406[_0xffd4('0x69')];});_0x57ecac['on'](_0xffd4('0x18'),function(){fs[_0xffd4('0x5c')](_0x1088e1,parseInt(_0xffd4('0x5d'),0x8));return db[_0xffd4('0x2a')][_0xffd4('0x53')](_0x4db26c)[_0xffd4('0x21')](function(_0x8cf32f){var _0x520933={'role':_0x2e45e1[_0xffd4('0x6a')][_0xffd4('0x6b')],'userProfileId':_0x2e45e1[_0xffd4('0x6a')]['userProfileId']};if(!_0x520933)throw new Error(_0xffd4('0x6c'));if(_0x520933['role']===_0xffd4('0x6d')){var _0x4568b6=_0x8cf32f[_0xffd4('0x22')]({'plain':!![]});return db[_0xffd4('0x6e')][_0xffd4('0x47')]({'where':{'name':_0xffd4('0x23'),'userProfileId':_0x520933['userProfileId']},'raw':!![]})[_0xffd4('0x21')](function(_0x3fb14e){if(_0x3fb14e&&_0x3fb14e[_0xffd4('0x6f')]===0x0){return db['UserProfileResource'][_0xffd4('0x53')]({'name':_0x4568b6[_0xffd4('0x27')],'resourceId':_0x4568b6['id'],'type':_0x3fb14e['name'],'sectionId':_0x3fb14e['id']},{})[_0xffd4('0x21')](function(){return _0x8cf32f;});}else{return _0x8cf32f;}})[_0xffd4('0x52')](function(_0x2c1595){logger[_0xffd4('0x25')](_0xffd4('0x70'),_0x2c1595);throw _0x2c1595;});}return _0x8cf32f;})[_0xffd4('0x21')](respondWithResult(_0x5b4603,null))[_0xffd4('0x52')](handleError(_0x5b4603,null));});_0x57ecac[_0xffd4('0x71')]();}catch(_0x2ffb36){_0x5b4603['status'](0x1f4)['send'](_0x2ffb36);}};exports[_0xffd4('0x72')]=function(_0x102a91,_0x2b6e79,_0x156363){return db[_0xffd4('0x2a')]['find']({'where':{'id':_0x102a91[_0xffd4('0x43')]['id']}})[_0xffd4('0x21')](handleEntityNotFound(_0x2b6e79,null))[_0xffd4('0x21')](saveUpdates(_[_0xffd4('0x38')](_0x102a91[_0xffd4('0x6a')],[_0xffd4('0x27'),_0xffd4('0x73')]),null))[_0xffd4('0x21')](respondWithResult(_0x2b6e79,null))[_0xffd4('0x52')](handleError(_0x2b6e79,null));};exports[_0xffd4('0x74')]=function(_0x3fa871,_0x2c6245,_0x1fe2f5){return db[_0xffd4('0x2a')]['find']({'where':{'id':_0x3fa871[_0xffd4('0x43')]['id']}})[_0xffd4('0x21')](function(_0x56e3d3){if(_0x56e3d3){return _0x56e3d3[_0xffd4('0x24')]();}})[_0xffd4('0x21')](function(_0x15b2be){var _0x42a9e3=path[_0xffd4('0x4a')](config[_0xffd4('0x4b')],'server/files/sounds/original',util[_0xffd4('0x50')](_0xffd4('0x51'),_0x15b2be['save_name'],_0x15b2be[_0xffd4('0x75')]));var _0x52b7e0=path[_0xffd4('0x4a')](config[_0xffd4('0x4b')],_0xffd4('0x4c'),util[_0xffd4('0x50')](_0xffd4('0x51'),_0x15b2be[_0xffd4('0x48')],_0x15b2be['converted_format']));fs[_0xffd4('0x76')](_0x42a9e3);fs[_0xffd4('0x76')](_0x52b7e0);return _0x15b2be;})['then'](function(_0x3f689d){if(_0x3f689d){return _0x2c6245['status'](0xcc)['end']();}})['then'](handleEntityNotFound(_0x2c6245,null))[_0xffd4('0x52')](handleError(_0x2c6245,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 2fdc2ce..db74920 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 _0xd37d=['util','../../config/logger','api','moment','rimraf','../../config/environment','exports','define','Sound','tools_sounds','lodash'];(function(_0x5ee21c,_0x23dec0){var _0x375ad3=function(_0x2992b0){while(--_0x2992b0){_0x5ee21c['push'](_0x5ee21c['shift']());}};_0x375ad3(++_0x23dec0);}(_0xd37d,0x18b));var _0xdd37=function(_0x48fb10,_0xa50a89){_0x48fb10=_0x48fb10-0x0;var _0x534251=_0xd37d[_0x48fb10];return _0x534251;};'use strict';var _=require(_0xdd37('0x0'));var util=require(_0xdd37('0x1'));var logger=require(_0xdd37('0x2'))(_0xdd37('0x3'));var moment=require(_0xdd37('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdd37('0x5'));var config=require(_0xdd37('0x6'));var attributes=require('./sound.attributes');module[_0xdd37('0x7')]=function(_0x4919ca,_0x596706){return _0x4919ca[_0xdd37('0x8')](_0xdd37('0x9'),attributes,{'tableName':_0xdd37('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d55=['define','Sound','tools_sounds','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x509b2c,_0xb88b68){var _0x7625f3=function(_0x511650){while(--_0x511650){_0x509b2c['push'](_0x509b2c['shift']());}};_0x7625f3(++_0xb88b68);}(_0x5d55,0x184));var _0x55d5=function(_0x383538,_0x319788){_0x383538=_0x383538-0x0;var _0x23beb5=_0x5d55[_0x383538];return _0x23beb5;};'use strict';var _=require(_0x55d5('0x0'));var util=require('util');var logger=require(_0x55d5('0x1'))(_0x55d5('0x2'));var moment=require('moment');var BPromise=require(_0x55d5('0x3'));var rp=require(_0x55d5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x55d5('0x5'));var config=require(_0x55d5('0x6'));var attributes=require('./sound.attributes');module[_0x55d5('0x7')]=function(_0x3da3bb,_0x155fb5){return _0x3da3bb[_0x55d5('0x8')](_0x55d5('0x9'),attributes,{'tableName':_0x55d5('0xa'),'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 8ca7796..37ce4e0 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 _0x4950=['info','Sound,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','Sound','find','options','where','map','attributes','include','model','ShowSound','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then'];(function(_0x56145a,_0x3e856a){var _0x351c65=function(_0x1247b1){while(--_0x1247b1){_0x56145a['push'](_0x56145a['shift']());}};_0x351c65(++_0x3e856a);}(_0x4950,0x6d));var _0x0495=function(_0x5655a6,_0x1a2140){_0x5655a6=_0x5655a6-0x0;var _0x23f92c=_0x4950[_0x5655a6];return _0x23f92c;};'use strict';var _=require(_0x0495('0x0'));var util=require(_0x0495('0x1'));var moment=require(_0x0495('0x2'));var BPromise=require(_0x0495('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0495('0x4'));var db=require(_0x0495('0x5'))['db'];var utils=require(_0x0495('0x6'));var logger=require('../../config/logger')(_0x0495('0x7'));var config=require('../../config/environment');var jayson=require(_0x0495('0x8'));var client=jayson['client'][_0x0495('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45d392,_0x427a99,_0x26e332){return new BPromise(function(_0x16cd07,_0x17fd66){return client['request'](_0x45d392,_0x26e332)[_0x0495('0xa')](function(_0x1edbfc){logger[_0x0495('0xb')](_0x0495('0xc'),_0x427a99,_0x0495('0xd'));logger[_0x0495('0xe')]('Sound,\x20%s,\x20%s,\x20%s',_0x427a99,'request\x20sent',JSON[_0x0495('0xf')](_0x1edbfc));if(_0x1edbfc[_0x0495('0x10')]){if(_0x1edbfc['error'][_0x0495('0x11')]===0x1f4){logger[_0x0495('0x10')]('Sound,\x20%s,\x20%s',_0x427a99,_0x1edbfc['error'][_0x0495('0x12')]);return _0x17fd66(_0x1edbfc[_0x0495('0x10')][_0x0495('0x12')]);}logger['error'](_0x0495('0xc'),_0x427a99,_0x1edbfc[_0x0495('0x10')]['message']);return _0x16cd07(_0x1edbfc['error'][_0x0495('0x12')]);}else{logger[_0x0495('0xb')](_0x0495('0xc'),_0x427a99,'request\x20sent');_0x16cd07(_0x1edbfc[_0x0495('0x13')][_0x0495('0x12')]);}})[_0x0495('0x14')](function(_0x29f93c){logger[_0x0495('0x10')](_0x0495('0xc'),_0x427a99,_0x29f93c);_0x17fd66(_0x29f93c);});});}exports['ShowSound']=function(_0x3b12ea){var _0x198bfc=this;return new Promise(function(_0x1e7a29,_0x52080f){return db[_0x0495('0x15')][_0x0495('0x16')]({'raw':_0x3b12ea[_0x0495('0x17')]?_0x3b12ea['options']['raw']===undefined?!![]:![]:!![],'where':_0x3b12ea[_0x0495('0x17')]?_0x3b12ea[_0x0495('0x17')][_0x0495('0x18')]||null:null,'attributes':_0x3b12ea['options']?_0x3b12ea['options']['attributes']||null:null,'include':_0x3b12ea[_0x0495('0x17')]?_0x3b12ea[_0x0495('0x17')]['include']?_[_0x0495('0x19')](_0x3b12ea[_0x0495('0x17')]['include'],function(_0x9b56d){return{'model':db[_0x9b56d['model']],'as':_0x9b56d['as'],'attributes':_0x9b56d[_0x0495('0x1a')],'include':_0x9b56d[_0x0495('0x1b')]?_[_0x0495('0x19')](_0x9b56d[_0x0495('0x1b')],function(_0x44bdd0){return{'model':db[_0x44bdd0[_0x0495('0x1c')]],'as':_0x44bdd0['as'],'attributes':_0x44bdd0['attributes'],'include':_0x44bdd0['include']?_[_0x0495('0x19')](_0x44bdd0[_0x0495('0x1b')],function(_0x335596){return{'model':db[_0x335596[_0x0495('0x1c')]],'as':_0x335596['as'],'attributes':_0x335596[_0x0495('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0495('0xa')](function(_0x4aa439){logger[_0x0495('0xb')](_0x0495('0x1d'),_0x3b12ea);logger[_0x0495('0xe')](_0x0495('0x1d'),_0x3b12ea,JSON[_0x0495('0xf')](_0x4aa439));_0x1e7a29(_0x4aa439);})[_0x0495('0x14')](function(_0x3d5ef7){logger[_0x0495('0x10')](_0x0495('0x1d'),_0x3d5ef7[_0x0495('0x12')],_0x3b12ea);_0x52080f(_0x198bfc[_0x0495('0x10')](0x1f4,_0x3d5ef7[_0x0495('0x12')]));});});}; \ No newline at end of file +var _0xb163=['info','result','find','options','raw','where','attributes','include','map','model','then','ShowSound','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','request','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1a7e9f,_0x6ef385){var _0x44b3fa=function(_0x5af143){while(--_0x5af143){_0x1a7e9f['push'](_0x1a7e9f['shift']());}};_0x44b3fa(++_0x6ef385);}(_0xb163,0xd1));var _0x3b16=function(_0x1532c1,_0x53877a){_0x1532c1=_0x1532c1-0x0;var _0x1693ed=_0xb163[_0x1532c1];return _0x1693ed;};'use strict';var _=require(_0x3b16('0x0'));var util=require('util');var moment=require(_0x3b16('0x1'));var BPromise=require('bluebird');var rs=require(_0x3b16('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3b16('0x3'))['db'];var utils=require(_0x3b16('0x4'));var logger=require(_0x3b16('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3cc0c8,_0x1e084e,_0x3377d9){return new BPromise(function(_0x4d23f4,_0x25bf1c){return client[_0x3b16('0x6')](_0x3cc0c8,_0x3377d9)['then'](function(_0x37dd1c){logger['info'](_0x3b16('0x7'),_0x1e084e,_0x3b16('0x8'));logger[_0x3b16('0x9')](_0x3b16('0xa'),_0x1e084e,'request\x20sent',JSON[_0x3b16('0xb')](_0x37dd1c));if(_0x37dd1c[_0x3b16('0xc')]){if(_0x37dd1c[_0x3b16('0xc')][_0x3b16('0xd')]===0x1f4){logger['error'](_0x3b16('0x7'),_0x1e084e,_0x37dd1c[_0x3b16('0xc')][_0x3b16('0xe')]);return _0x25bf1c(_0x37dd1c[_0x3b16('0xc')][_0x3b16('0xe')]);}logger[_0x3b16('0xc')](_0x3b16('0x7'),_0x1e084e,_0x37dd1c[_0x3b16('0xc')][_0x3b16('0xe')]);return _0x4d23f4(_0x37dd1c[_0x3b16('0xc')][_0x3b16('0xe')]);}else{logger[_0x3b16('0xf')](_0x3b16('0x7'),_0x1e084e,_0x3b16('0x8'));_0x4d23f4(_0x37dd1c[_0x3b16('0x10')]['message']);}})['catch'](function(_0x4e665e){logger['error'](_0x3b16('0x7'),_0x1e084e,_0x4e665e);_0x25bf1c(_0x4e665e);});});}exports['ShowSound']=function(_0x2fb903){var _0x4c4629=this;return new Promise(function(_0x407657,_0x5d4e91){return db['Sound'][_0x3b16('0x11')]({'raw':_0x2fb903[_0x3b16('0x12')]?_0x2fb903[_0x3b16('0x12')][_0x3b16('0x13')]===undefined?!![]:![]:!![],'where':_0x2fb903[_0x3b16('0x12')]?_0x2fb903['options'][_0x3b16('0x14')]||null:null,'attributes':_0x2fb903[_0x3b16('0x12')]?_0x2fb903['options'][_0x3b16('0x15')]||null:null,'include':_0x2fb903[_0x3b16('0x12')]?_0x2fb903['options'][_0x3b16('0x16')]?_[_0x3b16('0x17')](_0x2fb903[_0x3b16('0x12')]['include'],function(_0x46943){return{'model':db[_0x46943[_0x3b16('0x18')]],'as':_0x46943['as'],'attributes':_0x46943[_0x3b16('0x15')],'include':_0x46943[_0x3b16('0x16')]?_[_0x3b16('0x17')](_0x46943['include'],function(_0x583c22){return{'model':db[_0x583c22[_0x3b16('0x18')]],'as':_0x583c22['as'],'attributes':_0x583c22[_0x3b16('0x15')],'include':_0x583c22['include']?_['map'](_0x583c22['include'],function(_0x3383c5){return{'model':db[_0x3383c5['model']],'as':_0x3383c5['as'],'attributes':_0x3383c5['attributes']};}):[]};}):[]};}):[]:[]})[_0x3b16('0x19')](function(_0x3ee7b3){logger['info'](_0x3b16('0x1a'),_0x2fb903);logger[_0x3b16('0x9')](_0x3b16('0x1a'),_0x2fb903,JSON[_0x3b16('0xb')](_0x3ee7b3));_0x407657(_0x3ee7b3);})[_0x3b16('0x1b')](function(_0x49318d){logger[_0x3b16('0xc')](_0x3b16('0x1a'),_0x49318d[_0x3b16('0xe')],_0x2fb903);_0x5d4e91(_0x4c4629[_0x3b16('0xc')](0x1f4,_0x49318d[_0x3b16('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index f95306e..9d4c433 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 _0x8603=['../../components/interaction/service','./squareMessage.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x11c6b8,_0x5b2d7b){var _0x38b38f=function(_0x641ad0){while(--_0x641ad0){_0x11c6b8['push'](_0x11c6b8['shift']());}};_0x38b38f(++_0x5b2d7b);}(_0x8603,0x190));var _0x3860=function(_0x3d2f04,_0x2af699){_0x3d2f04=_0x3d2f04-0x0;var _0x453593=_0x8603[_0x3d2f04];return _0x453593;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['delete'](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['destroy']);module[_0x3860('0xe')]=router; \ No newline at end of file +var _0x5f66=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update','delete','destroy'];(function(_0x87c91,_0x310645){var _0x106d30=function(_0x47d85d){while(--_0x47d85d){_0x87c91['push'](_0x87c91['shift']());}};_0x106d30(++_0x310645);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5f66[_0x2f5ac5];return _0x37c9a8;};'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('./squareMessage.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0xb')]('/',auth[_0x65f6('0x8')](),controller[_0x65f6('0xc')]);router['put']('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0xe')](_0x65f6('0x9'),auth['isAuthenticated'](),controller[_0x65f6('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index f8b4ceb..79e517a 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 _0x5830=['sequelize','exports','STRING','TEXT','ENUM','out'];(function(_0x165e05,_0x3207ec){var _0x43a4f2=function(_0x28953f){while(--_0x28953f){_0x165e05['push'](_0x165e05['shift']());}};_0x43a4f2(++_0x3207ec);}(_0x5830,0xba));var _0x0583=function(_0x2c38ca,_0x5da048){_0x2c38ca=_0x2c38ca-0x0;var _0x3ecc5d=_0x5830[_0x2c38ca];return _0x3ecc5d;};'use strict';var Sequelize=require(_0x0583('0x0'));module[_0x0583('0x1')]={'uniqueid':{'type':Sequelize[_0x0583('0x2')]},'body':{'type':Sequelize[_0x0583('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x0583('0x4')]('in','out'),'defaultValue':_0x0583('0x5'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x0583('0x3')]}}; \ No newline at end of file +var _0xfe54=['out','sequelize','exports','STRING','TEXT','medium','ENUM'];(function(_0x4ec42,_0x36177b){var _0x385e11=function(_0x44e535){while(--_0x44e535){_0x4ec42['push'](_0x4ec42['shift']());}};_0x385e11(++_0x36177b);}(_0xfe54,0xbe));var _0x4fe5=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xfe54[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0x4fe5('0x0'));module[_0x4fe5('0x1')]={'uniqueid':{'type':Sequelize[_0x4fe5('0x2')]},'body':{'type':Sequelize[_0x4fe5('0x3')](_0x4fe5('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x4fe5('0x5')]('in',_0x4fe5('0x6')),'defaultValue':_0x4fe5('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0x4fe5('0x2')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 54e6c89..1c8d5e0 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 _0x605a=['fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','save','then','stack','name','index','SquareMessage','rawAttributes','fieldName','model','map','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','options','includeAll','include','catch','show','params','find','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x226494,_0xc4b645){var _0x27b950=function(_0x3e6acf){while(--_0x3e6acf){_0x226494['push'](_0x226494['shift']());}};_0x27b950(++_0xc4b645);}(_0x605a,0x1d7));var _0xa605=function(_0x526897,_0x13c58f){_0x526897=_0x526897-0x0;var _0x4ea847=_0x605a[_0x526897];return _0x4ea847;};'use strict';var emlformat=require(_0xa605('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa605('0x1'));var jsonpatch=require(_0xa605('0x2'));var rp=require(_0xa605('0x3'));var moment=require(_0xa605('0x4'));var BPromise=require(_0xa605('0x5'));var Mustache=require(_0xa605('0x6'));var util=require(_0xa605('0x7'));var path=require(_0xa605('0x8'));var sox=require(_0xa605('0x9'));var csv=require(_0xa605('0xa'));var ejs=require(_0xa605('0xb'));var fs=require('fs');var fs_extra=require(_0xa605('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa605('0xd'));var jsforce=require(_0xa605('0xe'));var deskjs=require(_0xa605('0xf'));var toCsv=require(_0xa605('0xa'));var querystring=require(_0xa605('0x10'));var Papa=require(_0xa605('0x11'));var Redis=require(_0xa605('0x12'));var authService=require(_0xa605('0x13'));var qs=require(_0xa605('0x14'));var as=require(_0xa605('0x15'));var hardwareService=require(_0xa605('0x16'));var logger=require(_0xa605('0x17'))(_0xa605('0x18'));var utils=require(_0xa605('0x19'));var config=require(_0xa605('0x1a'));var licenseUtil=require(_0xa605('0x1b'));var db=require(_0xa605('0x1c'))['db'];function respondWithStatusCode(_0x3a4cc1,_0xf04be4){_0xf04be4=_0xf04be4||0xcc;return function(_0x59be5e){if(_0x59be5e){return _0x3a4cc1[_0xa605('0x1d')](_0xf04be4);}return _0x3a4cc1[_0xa605('0x1e')](_0xf04be4)['end']();};}function respondWithResult(_0x196b97,_0x3b151e){_0x3b151e=_0x3b151e||0xc8;return function(_0x28d6f6){if(_0x28d6f6){return _0x196b97[_0xa605('0x1e')](_0x3b151e)[_0xa605('0x1f')](_0x28d6f6);}};}function respondWithFilteredResult(_0x296747,_0x2c837a){return function(_0x442b8f){if(_0x442b8f){var _0x864952=typeof _0x2c837a['offset']===_0xa605('0x20')&&typeof _0x2c837a[_0xa605('0x21')]===_0xa605('0x20');var _0x2b45f3=_0x442b8f[_0xa605('0x22')];var _0x412389=_0x864952?0x0:_0x2c837a[_0xa605('0x23')];var _0x4f1292=_0x864952?_0x442b8f[_0xa605('0x22')]:_0x2c837a[_0xa605('0x23')]+_0x2c837a[_0xa605('0x21')];var _0x2ce4de;if(_0x4f1292>=_0x2b45f3){_0x4f1292=_0x2b45f3;_0x2ce4de=0xc8;}else{_0x2ce4de=0xce;}_0x296747[_0xa605('0x1e')](_0x2ce4de);return _0x296747['set']('Content-Range',_0x412389+'-'+_0x4f1292+'/'+_0x2b45f3)[_0xa605('0x1f')](_0x442b8f);}return null;};}function patchUpdates(_0x2f1ddb){return function(_0x388a67){try{jsonpatch['apply'](_0x388a67,_0x2f1ddb,!![]);}catch(_0x3b13c1){return BPromise['reject'](_0x3b13c1);}return _0x388a67[_0xa605('0x24')]();};}function saveUpdates(_0x2f9f0c,_0x2119b1){return function(_0x30da9d){if(_0x30da9d){return _0x30da9d['update'](_0x2f9f0c)[_0xa605('0x25')](function(_0x36db64){return _0x36db64;});}return null;};}function removeEntity(_0x353660,_0x159f1f){return function(_0x379297){if(_0x379297){return _0x379297['destroy']()['then'](function(){_0x353660[_0xa605('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46e6ee,_0xa83c8d){return function(_0x48a98f){if(!_0x48a98f){_0x46e6ee[_0xa605('0x1d')](0x194);}return _0x48a98f;};}function handleError(_0x72f138,_0x14e4ca){_0x14e4ca=_0x14e4ca||0x1f4;return function(_0x5ed872){logger['error'](_0x5ed872[_0xa605('0x26')]);if(_0x5ed872[_0xa605('0x27')]){delete _0x5ed872[_0xa605('0x27')];}_0x72f138[_0xa605('0x1e')](_0x14e4ca)['send'](_0x5ed872);};}exports[_0xa605('0x28')]=function(_0x46a220,_0x38c065){var _0x4e0009={},_0x42104d={},_0x39994c={'count':0x0,'rows':[]};var _0x73ab08=_['map'](db[_0xa605('0x29')][_0xa605('0x2a')],function(_0x10f449){return{'name':_0x10f449[_0xa605('0x2b')],'type':_0x10f449['type']['key']};});_0x42104d[_0xa605('0x2c')]=_[_0xa605('0x2d')](_0x73ab08,_0xa605('0x27'));_0x42104d[_0xa605('0x2e')]=_[_0xa605('0x2f')](_0x46a220[_0xa605('0x2e')]);_0x42104d[_0xa605('0x30')]=_['intersection'](_0x42104d[_0xa605('0x2c')],_0x42104d['query']);_0x4e0009['attributes']=_[_0xa605('0x31')](_0x42104d[_0xa605('0x2c')],qs[_0xa605('0x32')](_0x46a220[_0xa605('0x2e')][_0xa605('0x32')]));_0x4e0009[_0xa605('0x33')]=_0x4e0009['attributes'][_0xa605('0x34')]?_0x4e0009[_0xa605('0x33')]:_0x42104d[_0xa605('0x2c')];if(!_0x46a220[_0xa605('0x2e')]['hasOwnProperty']('nolimit')){_0x4e0009['limit']=qs['limit'](_0x46a220[_0xa605('0x2e')][_0xa605('0x21')]);_0x4e0009[_0xa605('0x23')]=qs[_0xa605('0x23')](_0x46a220[_0xa605('0x2e')][_0xa605('0x23')]);}_0x4e0009[_0xa605('0x35')]=qs[_0xa605('0x36')](_0x46a220['query'][_0xa605('0x36')]);_0x4e0009[_0xa605('0x37')]=qs[_0xa605('0x30')](_[_0xa605('0x38')](_0x46a220['query'],_0x42104d[_0xa605('0x30')]),_0x73ab08);if(_0x46a220[_0xa605('0x2e')][_0xa605('0x39')]){_0x4e0009[_0xa605('0x37')]=_[_0xa605('0x3a')](_0x4e0009[_0xa605('0x37')],{'$or':_['map'](_0x73ab08,function(_0x57eb9e){if(_0x57eb9e['type']!=='VIRTUAL'){var _0x50aaa2={};_0x50aaa2[_0x57eb9e[_0xa605('0x27')]]={'$like':'%'+_0x46a220['query']['filter']+'%'};return _0x50aaa2;}})});}_0x4e0009=_[_0xa605('0x3a')]({},_0x4e0009,_0x46a220[_0xa605('0x3b')]);var _0x5cd9af={'where':_0x4e0009[_0xa605('0x37')]};return db[_0xa605('0x29')][_0xa605('0x22')](_0x5cd9af)['then'](function(_0x294488){_0x39994c['count']=_0x294488;if(_0x46a220[_0xa605('0x2e')][_0xa605('0x3c')]){_0x4e0009[_0xa605('0x3d')]=[{'all':!![]}];}return db[_0xa605('0x29')]['findAll'](_0x4e0009);})[_0xa605('0x25')](function(_0x12b199){_0x39994c['rows']=_0x12b199;return _0x39994c;})[_0xa605('0x25')](respondWithFilteredResult(_0x38c065,_0x4e0009))[_0xa605('0x3e')](handleError(_0x38c065,null));};exports[_0xa605('0x3f')]=function(_0x555ea6,_0x27a8a3){var _0x51e1e3={'raw':!![],'where':{'id':_0x555ea6[_0xa605('0x40')]['id']}},_0x34eaf8={};_0x34eaf8[_0xa605('0x2c')]=_[_0xa605('0x2f')](db[_0xa605('0x29')][_0xa605('0x2a')]);_0x34eaf8[_0xa605('0x2e')]=_[_0xa605('0x2f')](_0x555ea6[_0xa605('0x2e')]);_0x34eaf8['filters']=_[_0xa605('0x31')](_0x34eaf8[_0xa605('0x2c')],_0x34eaf8[_0xa605('0x2e')]);_0x51e1e3[_0xa605('0x33')]=_[_0xa605('0x31')](_0x34eaf8['model'],qs['fields'](_0x555ea6[_0xa605('0x2e')][_0xa605('0x32')]));_0x51e1e3[_0xa605('0x33')]=_0x51e1e3[_0xa605('0x33')][_0xa605('0x34')]?_0x51e1e3[_0xa605('0x33')]:_0x34eaf8[_0xa605('0x2c')];if(_0x555ea6[_0xa605('0x2e')]['includeAll']){_0x51e1e3[_0xa605('0x3d')]=[{'all':!![]}];}_0x51e1e3=_['merge']({},_0x51e1e3,_0x555ea6[_0xa605('0x3b')]);return db['SquareMessage'][_0xa605('0x41')](_0x51e1e3)[_0xa605('0x25')](handleEntityNotFound(_0x27a8a3,null))[_0xa605('0x25')](respondWithResult(_0x27a8a3,null))[_0xa605('0x3e')](handleError(_0x27a8a3,null));};exports[_0xa605('0x42')]=function(_0x338197,_0x24fc6c){return db[_0xa605('0x29')][_0xa605('0x42')](_0x338197[_0xa605('0x43')],{})['then'](respondWithResult(_0x24fc6c,0xc9))['catch'](handleError(_0x24fc6c,null));};exports[_0xa605('0x44')]=function(_0x1eb6f9,_0x2069b9){if(_0x1eb6f9['body']['id']){delete _0x1eb6f9[_0xa605('0x43')]['id'];}return db[_0xa605('0x29')][_0xa605('0x41')]({'where':{'id':_0x1eb6f9[_0xa605('0x40')]['id']}})[_0xa605('0x25')](handleEntityNotFound(_0x2069b9,null))[_0xa605('0x25')](saveUpdates(_0x1eb6f9[_0xa605('0x43')],null))[_0xa605('0x25')](respondWithResult(_0x2069b9,null))[_0xa605('0x3e')](handleError(_0x2069b9,null));};exports['destroy']=function(_0x12f66b,_0xcf51e9){return db['SquareMessage']['find']({'where':{'id':_0x12f66b[_0xa605('0x40')]['id']}})[_0xa605('0x25')](handleEntityNotFound(_0xcf51e9,null))[_0xa605('0x25')](removeEntity(_0xcf51e9,null))[_0xa605('0x3e')](handleError(_0xcf51e9,null));}; \ No newline at end of file +var _0x4bc7=['findAll','rows','catch','show','params','keys','rawAttributes','options','create','body','find','destroy','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','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','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','map','SquareMessage','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4bc7,0x188));var _0x74bc=function(_0x4421a0,_0x1525bc){_0x4421a0=_0x4421a0-0x0;var _0x5626d0=_0x4bc7[_0x4421a0];return _0x5626d0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x74bc('0x0'));var jsonpatch=require(_0x74bc('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x74bc('0x2'));var Mustache=require(_0x74bc('0x3'));var util=require(_0x74bc('0x4'));var path=require(_0x74bc('0x5'));var sox=require(_0x74bc('0x6'));var csv=require('to-csv');var ejs=require(_0x74bc('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x74bc('0x8'));var squel=require(_0x74bc('0x9'));var crypto=require(_0x74bc('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x74bc('0xb'));var querystring=require(_0x74bc('0xc'));var Papa=require('papaparse');var Redis=require(_0x74bc('0xd'));var authService=require(_0x74bc('0xe'));var qs=require(_0x74bc('0xf'));var as=require(_0x74bc('0x10'));var hardwareService=require(_0x74bc('0x11'));var logger=require(_0x74bc('0x12'))(_0x74bc('0x13'));var utils=require(_0x74bc('0x14'));var config=require(_0x74bc('0x15'));var licenseUtil=require(_0x74bc('0x16'));var db=require(_0x74bc('0x17'))['db'];function respondWithStatusCode(_0x4ce245,_0x37d793){_0x37d793=_0x37d793||0xcc;return function(_0x316840){if(_0x316840){return _0x4ce245[_0x74bc('0x18')](_0x37d793);}return _0x4ce245['status'](_0x37d793)['end']();};}function respondWithResult(_0x19fdd2,_0x2b40d9){_0x2b40d9=_0x2b40d9||0xc8;return function(_0x570519){if(_0x570519){return _0x19fdd2[_0x74bc('0x19')](_0x2b40d9)[_0x74bc('0x1a')](_0x570519);}};}function respondWithFilteredResult(_0x529a57,_0x2dc5aa){return function(_0x22167d){if(_0x22167d){var _0x7fd952=typeof _0x2dc5aa[_0x74bc('0x1b')]===_0x74bc('0x1c')&&typeof _0x2dc5aa[_0x74bc('0x1d')]==='undefined';var _0x5a97d4=_0x22167d['count'];var _0x118564=_0x7fd952?0x0:_0x2dc5aa[_0x74bc('0x1b')];var _0x569d94=_0x7fd952?_0x22167d[_0x74bc('0x1e')]:_0x2dc5aa['offset']+_0x2dc5aa[_0x74bc('0x1d')];var _0x5592d2;if(_0x569d94>=_0x5a97d4){_0x569d94=_0x5a97d4;_0x5592d2=0xc8;}else{_0x5592d2=0xce;}_0x529a57[_0x74bc('0x19')](_0x5592d2);return _0x529a57[_0x74bc('0x1f')](_0x74bc('0x20'),_0x118564+'-'+_0x569d94+'/'+_0x5a97d4)[_0x74bc('0x1a')](_0x22167d);}return null;};}function patchUpdates(_0x5885c8){return function(_0x22b8e7){try{jsonpatch[_0x74bc('0x21')](_0x22b8e7,_0x5885c8,!![]);}catch(_0x29b4eb){return BPromise[_0x74bc('0x22')](_0x29b4eb);}return _0x22b8e7[_0x74bc('0x23')]();};}function saveUpdates(_0x46e021,_0x2e28b3){return function(_0x38fce3){if(_0x38fce3){return _0x38fce3[_0x74bc('0x24')](_0x46e021)[_0x74bc('0x25')](function(_0x4af99a){return _0x4af99a;});}return null;};}function removeEntity(_0x5cb165,_0x213fb5){return function(_0xdf8387){if(_0xdf8387){return _0xdf8387['destroy']()[_0x74bc('0x25')](function(){_0x5cb165[_0x74bc('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55a6f7,_0x17e844){return function(_0x3405e7){if(!_0x3405e7){_0x55a6f7[_0x74bc('0x18')](0x194);}return _0x3405e7;};}function handleError(_0xa73b10,_0x527039){_0x527039=_0x527039||0x1f4;return function(_0x1be887){logger['error'](_0x1be887[_0x74bc('0x26')]);if(_0x1be887[_0x74bc('0x27')]){delete _0x1be887[_0x74bc('0x27')];}_0xa73b10[_0x74bc('0x19')](_0x527039)[_0x74bc('0x28')](_0x1be887);};}exports['index']=function(_0x35744a,_0x2ae085){var _0x2c2fc4={},_0x48761f={},_0xf3d021={'count':0x0,'rows':[]};var _0x83b250=_[_0x74bc('0x29')](db[_0x74bc('0x2a')]['rawAttributes'],function(_0x1b0e46){return{'name':_0x1b0e46[_0x74bc('0x2b')],'type':_0x1b0e46[_0x74bc('0x2c')][_0x74bc('0x2d')]};});_0x48761f['model']=_[_0x74bc('0x29')](_0x83b250,_0x74bc('0x27'));_0x48761f[_0x74bc('0x2e')]=_['keys'](_0x35744a[_0x74bc('0x2e')]);_0x48761f[_0x74bc('0x2f')]=_[_0x74bc('0x30')](_0x48761f[_0x74bc('0x31')],_0x48761f[_0x74bc('0x2e')]);_0x2c2fc4[_0x74bc('0x32')]=_[_0x74bc('0x30')](_0x48761f['model'],qs['fields'](_0x35744a[_0x74bc('0x2e')][_0x74bc('0x33')]));_0x2c2fc4[_0x74bc('0x32')]=_0x2c2fc4[_0x74bc('0x32')][_0x74bc('0x34')]?_0x2c2fc4[_0x74bc('0x32')]:_0x48761f[_0x74bc('0x31')];if(!_0x35744a[_0x74bc('0x2e')][_0x74bc('0x35')](_0x74bc('0x36'))){_0x2c2fc4[_0x74bc('0x1d')]=qs['limit'](_0x35744a['query']['limit']);_0x2c2fc4['offset']=qs['offset'](_0x35744a[_0x74bc('0x2e')][_0x74bc('0x1b')]);}_0x2c2fc4[_0x74bc('0x37')]=qs[_0x74bc('0x38')](_0x35744a['query']['sort']);_0x2c2fc4[_0x74bc('0x39')]=qs[_0x74bc('0x2f')](_[_0x74bc('0x3a')](_0x35744a[_0x74bc('0x2e')],_0x48761f[_0x74bc('0x2f')]),_0x83b250);if(_0x35744a[_0x74bc('0x2e')][_0x74bc('0x3b')]){_0x2c2fc4[_0x74bc('0x39')]=_[_0x74bc('0x3c')](_0x2c2fc4[_0x74bc('0x39')],{'$or':_[_0x74bc('0x29')](_0x83b250,function(_0x3b85da){if(_0x3b85da[_0x74bc('0x2c')]!==_0x74bc('0x3d')){var _0x2d2e9d={};_0x2d2e9d[_0x3b85da[_0x74bc('0x27')]]={'$like':'%'+_0x35744a['query'][_0x74bc('0x3b')]+'%'};return _0x2d2e9d;}})});}_0x2c2fc4=_['merge']({},_0x2c2fc4,_0x35744a['options']);var _0x1b979a={'where':_0x2c2fc4[_0x74bc('0x39')]};return db[_0x74bc('0x2a')][_0x74bc('0x1e')](_0x1b979a)[_0x74bc('0x25')](function(_0x484624){_0xf3d021[_0x74bc('0x1e')]=_0x484624;if(_0x35744a[_0x74bc('0x2e')][_0x74bc('0x3e')]){_0x2c2fc4[_0x74bc('0x3f')]=[{'all':!![]}];}return db[_0x74bc('0x2a')][_0x74bc('0x40')](_0x2c2fc4);})[_0x74bc('0x25')](function(_0x459ee4){_0xf3d021[_0x74bc('0x41')]=_0x459ee4;return _0xf3d021;})['then'](respondWithFilteredResult(_0x2ae085,_0x2c2fc4))[_0x74bc('0x42')](handleError(_0x2ae085,null));};exports[_0x74bc('0x43')]=function(_0x41dc6e,_0x154dad){var _0x37fe9c={'raw':!![],'where':{'id':_0x41dc6e[_0x74bc('0x44')]['id']}},_0x544d44={};_0x544d44['model']=_[_0x74bc('0x45')](db[_0x74bc('0x2a')][_0x74bc('0x46')]);_0x544d44[_0x74bc('0x2e')]=_[_0x74bc('0x45')](_0x41dc6e[_0x74bc('0x2e')]);_0x544d44['filters']=_['intersection'](_0x544d44['model'],_0x544d44[_0x74bc('0x2e')]);_0x37fe9c[_0x74bc('0x32')]=_[_0x74bc('0x30')](_0x544d44[_0x74bc('0x31')],qs[_0x74bc('0x33')](_0x41dc6e['query'][_0x74bc('0x33')]));_0x37fe9c[_0x74bc('0x32')]=_0x37fe9c[_0x74bc('0x32')][_0x74bc('0x34')]?_0x37fe9c[_0x74bc('0x32')]:_0x544d44[_0x74bc('0x31')];if(_0x41dc6e[_0x74bc('0x2e')][_0x74bc('0x3e')]){_0x37fe9c[_0x74bc('0x3f')]=[{'all':!![]}];}_0x37fe9c=_[_0x74bc('0x3c')]({},_0x37fe9c,_0x41dc6e[_0x74bc('0x47')]);return db[_0x74bc('0x2a')]['find'](_0x37fe9c)['then'](handleEntityNotFound(_0x154dad,null))[_0x74bc('0x25')](respondWithResult(_0x154dad,null))['catch'](handleError(_0x154dad,null));};exports[_0x74bc('0x48')]=function(_0x4ff047,_0x54b288){return db['SquareMessage'][_0x74bc('0x48')](_0x4ff047[_0x74bc('0x49')],{})[_0x74bc('0x25')](respondWithResult(_0x54b288,0xc9))[_0x74bc('0x42')](handleError(_0x54b288,null));};exports[_0x74bc('0x24')]=function(_0x3b2eaf,_0x53b391){if(_0x3b2eaf[_0x74bc('0x49')]['id']){delete _0x3b2eaf[_0x74bc('0x49')]['id'];}return db['SquareMessage'][_0x74bc('0x4a')]({'where':{'id':_0x3b2eaf[_0x74bc('0x44')]['id']}})[_0x74bc('0x25')](handleEntityNotFound(_0x53b391,null))[_0x74bc('0x25')](saveUpdates(_0x3b2eaf[_0x74bc('0x49')],null))[_0x74bc('0x25')](respondWithResult(_0x53b391,null))[_0x74bc('0x42')](handleError(_0x53b391,null));};exports[_0x74bc('0x4b')]=function(_0x4e97e3,_0x37734e){return db[_0x74bc('0x2a')][_0x74bc('0x4a')]({'where':{'id':_0x4e97e3[_0x74bc('0x44')]['id']}})[_0x74bc('0x25')](handleEntityNotFound(_0x37734e,null))[_0x74bc('0x25')](removeEntity(_0x37734e,null))['catch'](handleError(_0x37734e,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 8a578db..274d881 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 _0xde54=['path','../../config/environment','exports','lodash','util','../../config/logger','api'];(function(_0x1a279c,_0x57e1b3){var _0x558576=function(_0x2cd961){while(--_0x2cd961){_0x1a279c['push'](_0x1a279c['shift']());}};_0x558576(++_0x57e1b3);}(_0xde54,0x9d));var _0x4de5=function(_0x586ee3,_0x1691c1){_0x586ee3=_0x586ee3-0x0;var _0xc2ae7d=_0xde54[_0x586ee3];return _0xc2ae7d;};'use strict';var _=require(_0x4de5('0x0'));var util=require(_0x4de5('0x1'));var logger=require(_0x4de5('0x2'))(_0x4de5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4de5('0x4'));var rimraf=require('rimraf');var config=require(_0x4de5('0x5'));var attributes=require('./squareMessage.attributes');module[_0x4de5('0x6')]=function(_0x1cbed3,_0x68757d){return _0x1cbed3['define']('SquareMessage',attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe7b5=['exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareMessage.attributes'];(function(_0x321f6b,_0x2c105e){var _0x3e8a36=function(_0x1b466b){while(--_0x1b466b){_0x321f6b['push'](_0x321f6b['shift']());}};_0x3e8a36(++_0x2c105e);}(_0xe7b5,0xc8));var _0x5e7b=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe7b5[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x5e7b('0x0'));var util=require(_0x5e7b('0x1'));var logger=require(_0x5e7b('0x2'))(_0x5e7b('0x3'));var moment=require(_0x5e7b('0x4'));var BPromise=require(_0x5e7b('0x5'));var rp=require(_0x5e7b('0x6'));var fs=require('fs');var path=require(_0x5e7b('0x7'));var rimraf=require('rimraf');var config=require(_0x5e7b('0x8'));var attributes=require(_0x5e7b('0x9'));module[_0x5e7b('0xa')]=function(_0x13f900,_0x50dbec){return _0x13f900[_0x5e7b('0xb')](_0x5e7b('0xc'),attributes,{'tableName':_0x5e7b('0xd'),'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 e7bbac2..c11a868 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 _0xdfbf=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','create','body','options','CreateSquareMessage','stringify','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x15ec4e,_0x40b7e0){var _0xb5e5dd=function(_0x42bdd7){while(--_0x42bdd7){_0x15ec4e['push'](_0x15ec4e['shift']());}};_0xb5e5dd(++_0x40b7e0);}(_0xdfbf,0x1d7));var _0xfdfb=function(_0x4545aa,_0x29586d){_0x4545aa=_0x4545aa-0x0;var _0x364fa6=_0xdfbf[_0x4545aa];return _0x364fa6;};'use strict';var _=require(_0xfdfb('0x0'));var util=require(_0xfdfb('0x1'));var moment=require(_0xfdfb('0x2'));var BPromise=require(_0xfdfb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfdfb('0x4'))['db'];var utils=require(_0xfdfb('0x5'));var logger=require(_0xfdfb('0x6'))(_0xfdfb('0x7'));var config=require(_0xfdfb('0x8'));var jayson=require(_0xfdfb('0x9'));var client=jayson[_0xfdfb('0xa')][_0xfdfb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4bfcbe,_0x12f993,_0xf1bb45){return new BPromise(function(_0x2c05e5,_0x4b678e){return client[_0xfdfb('0xc')](_0x4bfcbe,_0xf1bb45)[_0xfdfb('0xd')](function(_0x4a6862){logger[_0xfdfb('0xe')](_0xfdfb('0xf'),_0x12f993,'request\x20sent');logger[_0xfdfb('0x10')](_0xfdfb('0x11'),_0x12f993,_0xfdfb('0x12'),JSON['stringify'](_0x4a6862));if(_0x4a6862['error']){if(_0x4a6862[_0xfdfb('0x13')]['code']===0x1f4){logger['error'](_0xfdfb('0xf'),_0x12f993,_0x4a6862[_0xfdfb('0x13')][_0xfdfb('0x14')]);return _0x4b678e(_0x4a6862['error'][_0xfdfb('0x14')]);}logger[_0xfdfb('0x13')](_0xfdfb('0xf'),_0x12f993,_0x4a6862[_0xfdfb('0x13')]['message']);return _0x2c05e5(_0x4a6862['error'][_0xfdfb('0x14')]);}else{logger['info'](_0xfdfb('0xf'),_0x12f993,_0xfdfb('0x12'));_0x2c05e5(_0x4a6862[_0xfdfb('0x15')]['message']);}})[_0xfdfb('0x16')](function(_0x21b7b8){logger[_0xfdfb('0x13')](_0xfdfb('0xf'),_0x12f993,_0x21b7b8);_0x4b678e(_0x21b7b8);});});}exports['CreateSquareMessage']=function(_0x31e592){var _0x3f0b01=this;return new Promise(function(_0x87d1fc,_0x574b87){return db['SquareMessage'][_0xfdfb('0x17')](_0x31e592[_0xfdfb('0x18')],{'raw':_0x31e592[_0xfdfb('0x19')]?_0x31e592[_0xfdfb('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xfdfb('0xd')](function(_0x463a1d){logger[_0xfdfb('0xe')](_0xfdfb('0x1a'),_0x31e592);logger['debug'](_0xfdfb('0x1a'),_0x31e592,JSON[_0xfdfb('0x1b')](_0x463a1d));_0x87d1fc(_0x463a1d);})[_0xfdfb('0x16')](function(_0x494f4b){logger[_0xfdfb('0x13')]('CreateSquareMessage',_0x494f4b[_0xfdfb('0x14')],_0x31e592);_0x574b87(_0x3f0b01[_0xfdfb('0x13')](0x1f4,_0x494f4b[_0xfdfb('0x14')]));});});}; \ No newline at end of file +var _0x3780=['http','request','then','info','request\x20sent','debug','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','result','catch','CreateSquareMessage','SquareMessage','create','options','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client'];(function(_0x52b408,_0x1811ba){var _0x23f8c8=function(_0x47f76b){while(--_0x47f76b){_0x52b408['push'](_0x52b408['shift']());}};_0x23f8c8(++_0x1811ba);}(_0x3780,0x13d));var _0x0378=function(_0x43b609,_0xcf0924){_0x43b609=_0x43b609-0x0;var _0x5d4cef=_0x3780[_0x43b609];return _0x5d4cef;};'use strict';var _=require(_0x0378('0x0'));var util=require('util');var moment=require(_0x0378('0x1'));var BPromise=require(_0x0378('0x2'));var rs=require(_0x0378('0x3'));var fs=require('fs');var Redis=require(_0x0378('0x4'));var db=require(_0x0378('0x5'))['db'];var utils=require(_0x0378('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0378('0x7')][_0x0378('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5953b0,_0x48a1bf,_0x2792a8){return new BPromise(function(_0xad9313,_0x34e493){return client[_0x0378('0x9')](_0x5953b0,_0x2792a8)[_0x0378('0xa')](function(_0x1ab640){logger[_0x0378('0xb')]('SquareMessage,\x20%s,\x20%s',_0x48a1bf,_0x0378('0xc'));logger[_0x0378('0xd')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x48a1bf,'request\x20sent',JSON[_0x0378('0xe')](_0x1ab640));if(_0x1ab640[_0x0378('0xf')]){if(_0x1ab640[_0x0378('0xf')][_0x0378('0x10')]===0x1f4){logger[_0x0378('0xf')](_0x0378('0x11'),_0x48a1bf,_0x1ab640[_0x0378('0xf')][_0x0378('0x12')]);return _0x34e493(_0x1ab640[_0x0378('0xf')][_0x0378('0x12')]);}logger[_0x0378('0xf')](_0x0378('0x11'),_0x48a1bf,_0x1ab640[_0x0378('0xf')][_0x0378('0x12')]);return _0xad9313(_0x1ab640['error'][_0x0378('0x12')]);}else{logger[_0x0378('0xb')](_0x0378('0x11'),_0x48a1bf,_0x0378('0xc'));_0xad9313(_0x1ab640[_0x0378('0x13')][_0x0378('0x12')]);}})[_0x0378('0x14')](function(_0x32f7be){logger['error'](_0x0378('0x11'),_0x48a1bf,_0x32f7be);_0x34e493(_0x32f7be);});});}exports[_0x0378('0x15')]=function(_0xf2c548){var _0x4ac9f0=this;return new Promise(function(_0x77bdbd,_0x2cf94a){return db[_0x0378('0x16')][_0x0378('0x17')](_0xf2c548['body'],{'raw':_0xf2c548[_0x0378('0x18')]?_0xf2c548[_0x0378('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x0378('0xa')](function(_0x12d31f){logger[_0x0378('0xb')]('CreateSquareMessage',_0xf2c548);logger[_0x0378('0xd')](_0x0378('0x15'),_0xf2c548,JSON[_0x0378('0xe')](_0x12d31f));_0x77bdbd(_0x12d31f);})['catch'](function(_0x1d9f2b){logger[_0x0378('0xf')](_0x0378('0x15'),_0x1d9f2b['message'],_0xf2c548);_0x2cf94a(_0x4ac9f0['error'](0x1f4,_0x1d9f2b['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 323d6dd..ab01c2f 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 _0xbb33=['15s','test','post','put','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./squareOdbc.controller','get','/:id','isAuthenticated','show','/:id/test'];(function(_0x12ad0b,_0xd4f4f7){var _0x1a5e55=function(_0x5a3c49){while(--_0x5a3c49){_0x12ad0b['push'](_0x12ad0b['shift']());}};_0x1a5e55(++_0xd4f4f7);}(_0xbb33,0x11e));var _0x3bb3=function(_0x35e84b,_0x454479){_0x35e84b=_0x35e84b-0x0;var _0x4fb29e=_0xbb33[_0x35e84b];return _0x4fb29e;};'use strict';var multer=require(_0x3bb3('0x0'));var util=require(_0x3bb3('0x1'));var path=require(_0x3bb3('0x2'));var timeout=require(_0x3bb3('0x3'));var express=require(_0x3bb3('0x4'));var router=express['Router']();var fs_extra=require(_0x3bb3('0x5'));var auth=require(_0x3bb3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3bb3('0x7'));var controller=require(_0x3bb3('0x8'));router[_0x3bb3('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x3bb3('0xa'),auth[_0x3bb3('0xb')](),controller[_0x3bb3('0xc')]);router[_0x3bb3('0x9')](_0x3bb3('0xd'),auth['isAuthenticated'](),timeout(_0x3bb3('0xe')),controller[_0x3bb3('0xf')]);router[_0x3bb3('0x10')]('/',auth[_0x3bb3('0xb')](),controller['create']);router[_0x3bb3('0x11')]('/:id',auth[_0x3bb3('0xb')](),controller['update']);router['delete'](_0x3bb3('0xa'),auth['isAuthenticated'](),controller[_0x3bb3('0x12')]);module[_0x3bb3('0x13')]=router; \ No newline at end of file +var _0xf57d=['connect-timeout','express','Router','fs-extra','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','test','post','create','put','update','delete','destroy','multer','util','path'];(function(_0xfed299,_0x21b8d0){var _0x4ef1f2=function(_0x347a84){while(--_0x347a84){_0xfed299['push'](_0xfed299['shift']());}};_0x4ef1f2(++_0x21b8d0);}(_0xf57d,0x11b));var _0xdf57=function(_0x337c33,_0x508d9a){_0x337c33=_0x337c33-0x0;var _0x23f2da=_0xf57d[_0x337c33];return _0x23f2da;};'use strict';var multer=require(_0xdf57('0x0'));var util=require(_0xdf57('0x1'));var path=require(_0xdf57('0x2'));var timeout=require(_0xdf57('0x3'));var express=require(_0xdf57('0x4'));var router=express[_0xdf57('0x5')]();var fs_extra=require(_0xdf57('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdf57('0x7'));router[_0xdf57('0x8')]('/',auth[_0xdf57('0x9')](),controller[_0xdf57('0xa')]);router[_0xdf57('0x8')](_0xdf57('0xb'),auth[_0xdf57('0x9')](),controller[_0xdf57('0xc')]);router[_0xdf57('0x8')](_0xdf57('0xd'),auth[_0xdf57('0x9')](),timeout(_0xdf57('0xe')),controller[_0xdf57('0xf')]);router[_0xdf57('0x10')]('/',auth[_0xdf57('0x9')](),controller[_0xdf57('0x11')]);router[_0xdf57('0x12')](_0xdf57('0xb'),auth[_0xdf57('0x9')](),controller[_0xdf57('0x13')]);router[_0xdf57('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xdf57('0x15')]);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 bfba427..bd020cd 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 _0x374a=['sequelize','exports','STRING','name'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x374a,0xc0));var _0xa374=function(_0x5abfcd,_0x4b3c76){_0x5abfcd=_0x5abfcd-0x0;var _0x49388a=_0x374a[_0x5abfcd];return _0x49388a;};'use strict';var Sequelize=require(_0xa374('0x0'));module[_0xa374('0x1')]={'name':{'type':Sequelize[_0xa374('0x2')],'unique':_0xa374('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xa374('0x2')]},'description':{'type':Sequelize[_0xa374('0x2')]}}; \ No newline at end of file +var _0x37ed=['exports','STRING'];(function(_0x4e4d5c,_0x25dd3a){var _0x56854a=function(_0x221d35){while(--_0x221d35){_0x4e4d5c['push'](_0x4e4d5c['shift']());}};_0x56854a(++_0x25dd3a);}(_0x37ed,0x1c2));var _0xd37e=function(_0x3d4948,_0x7b5e60){_0x3d4948=_0x3d4948-0x0;var _0x1a875d=_0x37ed[_0x3d4948];return _0x1a875d;};'use strict';var Sequelize=require('sequelize');module[_0xd37e('0x0')]={'name':{'type':Sequelize[_0xd37e('0x1')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd37e('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 29a963f..0a020e1 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 _0x2ec9=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','ODBC','UserProfileResource','stack','name','send','index','map','rawAttributes','type','key','query','intersection','attributes','fields','model','hasOwnProperty','nolimit','offset','sort','where','filters','VIRTUAL','merge','includeAll','include','SquareOdbc','findAll','show','params','keys','length','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','catch','error','odbc','openSync','dsn','closeSync','eml-format','zip-dir','request-promise','moment'];(function(_0x16bf05,_0x4f70da){var _0xbcf546=function(_0x70b01d){while(--_0x70b01d){_0x16bf05['push'](_0x16bf05['shift']());}};_0xbcf546(++_0x4f70da);}(_0x2ec9,0x1aa));var _0x92ec=function(_0x51500b,_0x48aba5){_0x51500b=_0x51500b-0x0;var _0x3f2648=_0x2ec9[_0x51500b];return _0x3f2648;};'use strict';var emlformat=require(_0x92ec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x92ec('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x92ec('0x2'));var moment=require(_0x92ec('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x92ec('0x4'));var util=require(_0x92ec('0x5'));var path=require(_0x92ec('0x6'));var sox=require(_0x92ec('0x7'));var csv=require(_0x92ec('0x8'));var ejs=require(_0x92ec('0x9'));var fs=require('fs');var fs_extra=require(_0x92ec('0xa'));var _=require(_0x92ec('0xb'));var squel=require(_0x92ec('0xc'));var crypto=require(_0x92ec('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x92ec('0xe'));var toCsv=require(_0x92ec('0x8'));var querystring=require(_0x92ec('0xf'));var Papa=require(_0x92ec('0x10'));var Redis=require('ioredis');var authService=require(_0x92ec('0x11'));var qs=require(_0x92ec('0x12'));var as=require(_0x92ec('0x13'));var hardwareService=require(_0x92ec('0x14'));var logger=require(_0x92ec('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x92ec('0x16'));var licenseUtil=require(_0x92ec('0x17'));var db=require(_0x92ec('0x18'))['db'];function respondWithStatusCode(_0x13da9d,_0x14f169){_0x14f169=_0x14f169||0xcc;return function(_0x570c6c){if(_0x570c6c){return _0x13da9d[_0x92ec('0x19')](_0x14f169);}return _0x13da9d[_0x92ec('0x1a')](_0x14f169)[_0x92ec('0x1b')]();};}function respondWithResult(_0xc532c4,_0x57ad21){_0x57ad21=_0x57ad21||0xc8;return function(_0x35d310){if(_0x35d310){return _0xc532c4[_0x92ec('0x1a')](_0x57ad21)[_0x92ec('0x1c')](_0x35d310);}};}function respondWithFilteredResult(_0x489b92,_0x4401f8){return function(_0x3b283e){if(_0x3b283e){var _0x291c26=typeof _0x4401f8['offset']===_0x92ec('0x1d')&&typeof _0x4401f8[_0x92ec('0x1e')]==='undefined';var _0xfd1ae3=_0x3b283e[_0x92ec('0x1f')];var _0x427294=_0x291c26?0x0:_0x4401f8['offset'];var _0x3ddf28=_0x291c26?_0x3b283e[_0x92ec('0x1f')]:_0x4401f8['offset']+_0x4401f8['limit'];var _0x236eb7;if(_0x3ddf28>=_0xfd1ae3){_0x3ddf28=_0xfd1ae3;_0x236eb7=0xc8;}else{_0x236eb7=0xce;}_0x489b92['status'](_0x236eb7);return _0x489b92[_0x92ec('0x20')](_0x92ec('0x21'),_0x427294+'-'+_0x3ddf28+'/'+_0xfd1ae3)['json'](_0x3b283e);}return null;};}function patchUpdates(_0x2bac50){return function(_0x34ef2c){try{jsonpatch[_0x92ec('0x22')](_0x34ef2c,_0x2bac50,!![]);}catch(_0x3a2336){return BPromise[_0x92ec('0x23')](_0x3a2336);}return _0x34ef2c['save']();};}function saveUpdates(_0x37daf8,_0x852c21){return function(_0x2be29a){if(_0x2be29a){return _0x2be29a[_0x92ec('0x24')](_0x37daf8)['then'](function(_0x3b9113){return _0x3b9113;});}return null;};}function removeEntity(_0x42caa4,_0x7fd0d5){return function(_0x28e92b){if(_0x28e92b){return _0x28e92b[_0x92ec('0x25')]()[_0x92ec('0x26')](function(){var _0x36ceea=_0x28e92b['get']({'plain':!![]});var _0x1f8c23=_0x92ec('0x27');return db[_0x92ec('0x28')][_0x92ec('0x25')]({'where':{'type':_0x1f8c23,'resourceId':_0x36ceea['id']}})[_0x92ec('0x26')](function(){return _0x28e92b;});})[_0x92ec('0x26')](function(){_0x42caa4[_0x92ec('0x1a')](0xcc)[_0x92ec('0x1b')]();});}};}function handleEntityNotFound(_0x23994c,_0x5b2399){return function(_0x2f03d4){if(!_0x2f03d4){_0x23994c[_0x92ec('0x19')](0x194);}return _0x2f03d4;};}function handleError(_0x20c39c,_0x3c35a8){_0x3c35a8=_0x3c35a8||0x1f4;return function(_0x257bf3){logger['error'](_0x257bf3[_0x92ec('0x29')]);if(_0x257bf3[_0x92ec('0x2a')]){delete _0x257bf3['name'];}_0x20c39c[_0x92ec('0x1a')](_0x3c35a8)[_0x92ec('0x2b')](_0x257bf3);};}exports[_0x92ec('0x2c')]=function(_0x25b3f8,_0x3b5e1a){var _0x512028={},_0x15b19f={},_0x5120b2={'count':0x0,'rows':[]};var _0x4f3d0c=_[_0x92ec('0x2d')](db['SquareOdbc'][_0x92ec('0x2e')],function(_0x29c05b){return{'name':_0x29c05b['fieldName'],'type':_0x29c05b[_0x92ec('0x2f')][_0x92ec('0x30')]};});_0x15b19f['model']=_['map'](_0x4f3d0c,'name');_0x15b19f['query']=_['keys'](_0x25b3f8[_0x92ec('0x31')]);_0x15b19f['filters']=_[_0x92ec('0x32')](_0x15b19f['model'],_0x15b19f[_0x92ec('0x31')]);_0x512028[_0x92ec('0x33')]=_[_0x92ec('0x32')](_0x15b19f['model'],qs[_0x92ec('0x34')](_0x25b3f8[_0x92ec('0x31')]['fields']));_0x512028[_0x92ec('0x33')]=_0x512028['attributes']['length']?_0x512028[_0x92ec('0x33')]:_0x15b19f[_0x92ec('0x35')];if(!_0x25b3f8[_0x92ec('0x31')][_0x92ec('0x36')](_0x92ec('0x37'))){_0x512028[_0x92ec('0x1e')]=qs[_0x92ec('0x1e')](_0x25b3f8['query']['limit']);_0x512028['offset']=qs[_0x92ec('0x38')](_0x25b3f8['query'][_0x92ec('0x38')]);}_0x512028['order']=qs[_0x92ec('0x39')](_0x25b3f8[_0x92ec('0x31')]['sort']);_0x512028[_0x92ec('0x3a')]=qs[_0x92ec('0x3b')](_['pick'](_0x25b3f8[_0x92ec('0x31')],_0x15b19f[_0x92ec('0x3b')]),_0x4f3d0c);if(_0x25b3f8[_0x92ec('0x31')]['filter']){_0x512028[_0x92ec('0x3a')]=_['merge'](_0x512028[_0x92ec('0x3a')],{'$or':_[_0x92ec('0x2d')](_0x4f3d0c,function(_0x4523a5){if(_0x4523a5['type']!==_0x92ec('0x3c')){var _0x3d3773={};_0x3d3773[_0x4523a5[_0x92ec('0x2a')]]={'$like':'%'+_0x25b3f8['query']['filter']+'%'};return _0x3d3773;}})});}_0x512028=_[_0x92ec('0x3d')]({},_0x512028,_0x25b3f8['options']);var _0x430fc8={'where':_0x512028[_0x92ec('0x3a')]};return db['SquareOdbc'][_0x92ec('0x1f')](_0x430fc8)[_0x92ec('0x26')](function(_0x453301){_0x5120b2[_0x92ec('0x1f')]=_0x453301;if(_0x25b3f8[_0x92ec('0x31')][_0x92ec('0x3e')]){_0x512028[_0x92ec('0x3f')]=[{'all':!![]}];}return db[_0x92ec('0x40')][_0x92ec('0x41')](_0x512028);})[_0x92ec('0x26')](function(_0x216880){_0x5120b2['rows']=_0x216880;return _0x5120b2;})['then'](respondWithFilteredResult(_0x3b5e1a,_0x512028))['catch'](handleError(_0x3b5e1a,null));};exports[_0x92ec('0x42')]=function(_0x35adbc,_0x59e9f9){var _0x3b1a5f={'raw':!![],'where':{'id':_0x35adbc[_0x92ec('0x43')]['id']}},_0x3acc77={};_0x3acc77[_0x92ec('0x35')]=_[_0x92ec('0x44')](db['SquareOdbc'][_0x92ec('0x2e')]);_0x3acc77[_0x92ec('0x31')]=_[_0x92ec('0x44')](_0x35adbc['query']);_0x3acc77[_0x92ec('0x3b')]=_[_0x92ec('0x32')](_0x3acc77[_0x92ec('0x35')],_0x3acc77[_0x92ec('0x31')]);_0x3b1a5f[_0x92ec('0x33')]=_[_0x92ec('0x32')](_0x3acc77['model'],qs['fields'](_0x35adbc[_0x92ec('0x31')][_0x92ec('0x34')]));_0x3b1a5f[_0x92ec('0x33')]=_0x3b1a5f[_0x92ec('0x33')][_0x92ec('0x45')]?_0x3b1a5f[_0x92ec('0x33')]:_0x3acc77['model'];if(_0x35adbc[_0x92ec('0x31')][_0x92ec('0x3e')]){_0x3b1a5f[_0x92ec('0x3f')]=[{'all':!![]}];}_0x3b1a5f=_[_0x92ec('0x3d')]({},_0x3b1a5f,_0x35adbc[_0x92ec('0x46')]);return db[_0x92ec('0x40')][_0x92ec('0x47')](_0x3b1a5f)['then'](handleEntityNotFound(_0x59e9f9,null))['then'](respondWithResult(_0x59e9f9,null))['catch'](handleError(_0x59e9f9,null));};exports[_0x92ec('0x48')]=function(_0x5389cb,_0x4044de){return db[_0x92ec('0x40')][_0x92ec('0x48')](_0x5389cb[_0x92ec('0x49')],{})['then'](function(_0x333440){var _0x255ee9=_0x5389cb[_0x92ec('0x4a')][_0x92ec('0x4b')]({'plain':!![]});if(!_0x255ee9)throw new Error(_0x92ec('0x4c'));if(_0x255ee9[_0x92ec('0x4d')]===_0x92ec('0x4a')){var _0xd9408e=_0x333440[_0x92ec('0x4b')]({'plain':!![]});var _0x2b8075=_0x92ec('0x27');return db[_0x92ec('0x4e')][_0x92ec('0x47')]({'where':{'name':_0x2b8075,'userProfileId':_0x255ee9['userProfileId']},'raw':!![]})[_0x92ec('0x26')](function(_0xd16966){if(_0xd16966&&_0xd16966[_0x92ec('0x4f')]===0x0){return db[_0x92ec('0x28')][_0x92ec('0x48')]({'name':_0xd9408e[_0x92ec('0x2a')],'resourceId':_0xd9408e['id'],'type':_0xd16966['name'],'sectionId':_0xd16966['id']},{})[_0x92ec('0x26')](function(){return _0x333440;});}else{return _0x333440;}})[_0x92ec('0x50')](function(_0xa07585){logger[_0x92ec('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa07585);throw _0xa07585;});}return _0x333440;})[_0x92ec('0x26')](respondWithResult(_0x4044de,0xc9))['catch'](handleError(_0x4044de,null));};exports[_0x92ec('0x24')]=function(_0x4afeec,_0x202c12){if(_0x4afeec[_0x92ec('0x49')]['id']){delete _0x4afeec[_0x92ec('0x49')]['id'];}return db[_0x92ec('0x40')][_0x92ec('0x47')]({'where':{'id':_0x4afeec[_0x92ec('0x43')]['id']}})['then'](handleEntityNotFound(_0x202c12,null))[_0x92ec('0x26')](saveUpdates(_0x4afeec[_0x92ec('0x49')],null))[_0x92ec('0x26')](respondWithResult(_0x202c12,null))[_0x92ec('0x50')](handleError(_0x202c12,null));};exports['destroy']=function(_0xdd27a2,_0x50574f){return db[_0x92ec('0x40')][_0x92ec('0x47')]({'where':{'id':_0xdd27a2[_0x92ec('0x43')]['id']}})[_0x92ec('0x26')](handleEntityNotFound(_0x50574f,null))[_0x92ec('0x26')](removeEntity(_0x50574f,null))[_0x92ec('0x50')](handleError(_0x50574f,null));};exports['test']=function(_0x5a9651,_0x1bb354,_0x31908f){var _0x44fff9;return db[_0x92ec('0x40')][_0x92ec('0x47')]({'where':{'id':_0x5a9651['params']['id']},'attributes':['id','dsn']})[_0x92ec('0x26')](handleEntityNotFound(_0x1bb354,null))[_0x92ec('0x26')](function(_0x5595a6){if(_0x5595a6){var _0x555fc9=require(_0x92ec('0x52'))();_0x555fc9[_0x92ec('0x53')](_0x5595a6[_0x92ec('0x54')]);_0x555fc9[_0x92ec('0x55')]();return _0x5595a6;}})[_0x92ec('0x26')](respondWithResult(_0x1bb354,null))[_0x92ec('0x50')](handleError(_0x1bb354,null));}; \ No newline at end of file +var _0x06f4=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','ODBC','UserProfileResource','error','stack','name','send','index','SquareOdbc','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','catch','params','options','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','dsn','odbc','eml-format','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x20eb5f,_0x413642){var _0x5882af=function(_0x1540ed){while(--_0x1540ed){_0x20eb5f['push'](_0x20eb5f['shift']());}};_0x5882af(++_0x413642);}(_0x06f4,0x143));var _0x406f=function(_0x8f1262,_0x20f05e){_0x8f1262=_0x8f1262-0x0;var _0x2b6a5c=_0x06f4[_0x8f1262];return _0x2b6a5c;};'use strict';var emlformat=require(_0x406f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x406f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x406f('0x2'));var moment=require('moment');var BPromise=require(_0x406f('0x3'));var Mustache=require('mustache');var util=require(_0x406f('0x4'));var path=require(_0x406f('0x5'));var sox=require(_0x406f('0x6'));var csv=require(_0x406f('0x7'));var ejs=require(_0x406f('0x8'));var fs=require('fs');var fs_extra=require(_0x406f('0x9'));var _=require(_0x406f('0xa'));var squel=require('squel');var crypto=require(_0x406f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x406f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x406f('0xd'));var Papa=require(_0x406f('0xe'));var Redis=require(_0x406f('0xf'));var authService=require(_0x406f('0x10'));var qs=require(_0x406f('0x11'));var as=require(_0x406f('0x12'));var hardwareService=require(_0x406f('0x13'));var logger=require(_0x406f('0x14'))(_0x406f('0x15'));var utils=require('../../config/utils');var config=require(_0x406f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x406f('0x17'))['db'];function respondWithStatusCode(_0x3be364,_0x5dec16){_0x5dec16=_0x5dec16||0xcc;return function(_0x35f95e){if(_0x35f95e){return _0x3be364[_0x406f('0x18')](_0x5dec16);}return _0x3be364[_0x406f('0x19')](_0x5dec16)[_0x406f('0x1a')]();};}function respondWithResult(_0x447353,_0x56e7f9){_0x56e7f9=_0x56e7f9||0xc8;return function(_0x45dd2d){if(_0x45dd2d){return _0x447353[_0x406f('0x19')](_0x56e7f9)['json'](_0x45dd2d);}};}function respondWithFilteredResult(_0xc3b83e,_0x561106){return function(_0x1c3c50){if(_0x1c3c50){var _0x3737cf=typeof _0x561106[_0x406f('0x1b')]===_0x406f('0x1c')&&typeof _0x561106['limit']==='undefined';var _0x35f808=_0x1c3c50[_0x406f('0x1d')];var _0x5ea6b4=_0x3737cf?0x0:_0x561106[_0x406f('0x1b')];var _0x25de84=_0x3737cf?_0x1c3c50[_0x406f('0x1d')]:_0x561106['offset']+_0x561106[_0x406f('0x1e')];var _0x32262d;if(_0x25de84>=_0x35f808){_0x25de84=_0x35f808;_0x32262d=0xc8;}else{_0x32262d=0xce;}_0xc3b83e[_0x406f('0x19')](_0x32262d);return _0xc3b83e[_0x406f('0x1f')](_0x406f('0x20'),_0x5ea6b4+'-'+_0x25de84+'/'+_0x35f808)[_0x406f('0x21')](_0x1c3c50);}return null;};}function patchUpdates(_0x28cd94){return function(_0x4240f4){try{jsonpatch[_0x406f('0x22')](_0x4240f4,_0x28cd94,!![]);}catch(_0x4137a8){return BPromise[_0x406f('0x23')](_0x4137a8);}return _0x4240f4[_0x406f('0x24')]();};}function saveUpdates(_0x2a7dd0,_0x3a9a91){return function(_0x98403c){if(_0x98403c){return _0x98403c['update'](_0x2a7dd0)[_0x406f('0x25')](function(_0x374321){return _0x374321;});}return null;};}function removeEntity(_0xef3c39,_0x2acb68){return function(_0x307df6){if(_0x307df6){return _0x307df6[_0x406f('0x26')]()[_0x406f('0x25')](function(){var _0x542c2c=_0x307df6[_0x406f('0x27')]({'plain':!![]});var _0x34a715=_0x406f('0x28');return db[_0x406f('0x29')][_0x406f('0x26')]({'where':{'type':_0x34a715,'resourceId':_0x542c2c['id']}})[_0x406f('0x25')](function(){return _0x307df6;});})[_0x406f('0x25')](function(){_0xef3c39[_0x406f('0x19')](0xcc)[_0x406f('0x1a')]();});}};}function handleEntityNotFound(_0xacdf42,_0x4d6a2d){return function(_0x38b2f6){if(!_0x38b2f6){_0xacdf42[_0x406f('0x18')](0x194);}return _0x38b2f6;};}function handleError(_0x41bdb9,_0x27f5d4){_0x27f5d4=_0x27f5d4||0x1f4;return function(_0x336702){logger[_0x406f('0x2a')](_0x336702[_0x406f('0x2b')]);if(_0x336702[_0x406f('0x2c')]){delete _0x336702[_0x406f('0x2c')];}_0x41bdb9[_0x406f('0x19')](_0x27f5d4)[_0x406f('0x2d')](_0x336702);};}exports[_0x406f('0x2e')]=function(_0xa862e7,_0x1c4833){var _0x495502={},_0x23d7cd={},_0x54cc94={'count':0x0,'rows':[]};var _0x10cb0d=_['map'](db[_0x406f('0x2f')][_0x406f('0x30')],function(_0x2e26ea){return{'name':_0x2e26ea[_0x406f('0x31')],'type':_0x2e26ea[_0x406f('0x32')]['key']};});_0x23d7cd['model']=_['map'](_0x10cb0d,_0x406f('0x2c'));_0x23d7cd[_0x406f('0x33')]=_[_0x406f('0x34')](_0xa862e7[_0x406f('0x33')]);_0x23d7cd[_0x406f('0x35')]=_[_0x406f('0x36')](_0x23d7cd['model'],_0x23d7cd[_0x406f('0x33')]);_0x495502[_0x406f('0x37')]=_[_0x406f('0x36')](_0x23d7cd[_0x406f('0x38')],qs[_0x406f('0x39')](_0xa862e7['query'][_0x406f('0x39')]));_0x495502[_0x406f('0x37')]=_0x495502[_0x406f('0x37')][_0x406f('0x3a')]?_0x495502[_0x406f('0x37')]:_0x23d7cd['model'];if(!_0xa862e7[_0x406f('0x33')][_0x406f('0x3b')](_0x406f('0x3c'))){_0x495502[_0x406f('0x1e')]=qs['limit'](_0xa862e7[_0x406f('0x33')][_0x406f('0x1e')]);_0x495502[_0x406f('0x1b')]=qs[_0x406f('0x1b')](_0xa862e7[_0x406f('0x33')][_0x406f('0x1b')]);}_0x495502[_0x406f('0x3d')]=qs[_0x406f('0x3e')](_0xa862e7[_0x406f('0x33')][_0x406f('0x3e')]);_0x495502[_0x406f('0x3f')]=qs[_0x406f('0x35')](_[_0x406f('0x40')](_0xa862e7[_0x406f('0x33')],_0x23d7cd[_0x406f('0x35')]),_0x10cb0d);if(_0xa862e7[_0x406f('0x33')][_0x406f('0x41')]){_0x495502[_0x406f('0x3f')]=_[_0x406f('0x42')](_0x495502[_0x406f('0x3f')],{'$or':_[_0x406f('0x43')](_0x10cb0d,function(_0x1f0626){if(_0x1f0626[_0x406f('0x32')]!==_0x406f('0x44')){var _0x3eedd7={};_0x3eedd7[_0x1f0626[_0x406f('0x2c')]]={'$like':'%'+_0xa862e7['query'][_0x406f('0x41')]+'%'};return _0x3eedd7;}})});}_0x495502=_[_0x406f('0x42')]({},_0x495502,_0xa862e7['options']);var _0x236bc2={'where':_0x495502[_0x406f('0x3f')]};return db[_0x406f('0x2f')][_0x406f('0x1d')](_0x236bc2)[_0x406f('0x25')](function(_0xb1c8fc){_0x54cc94[_0x406f('0x1d')]=_0xb1c8fc;if(_0xa862e7['query'][_0x406f('0x45')]){_0x495502[_0x406f('0x46')]=[{'all':!![]}];}return db[_0x406f('0x2f')]['findAll'](_0x495502);})[_0x406f('0x25')](function(_0x19932c){_0x54cc94['rows']=_0x19932c;return _0x54cc94;})[_0x406f('0x25')](respondWithFilteredResult(_0x1c4833,_0x495502))[_0x406f('0x47')](handleError(_0x1c4833,null));};exports['show']=function(_0x15161d,_0x1ff806){var _0x3944a9={'raw':!![],'where':{'id':_0x15161d[_0x406f('0x48')]['id']}},_0x1e0f26={};_0x1e0f26[_0x406f('0x38')]=_['keys'](db[_0x406f('0x2f')][_0x406f('0x30')]);_0x1e0f26['query']=_[_0x406f('0x34')](_0x15161d['query']);_0x1e0f26[_0x406f('0x35')]=_[_0x406f('0x36')](_0x1e0f26[_0x406f('0x38')],_0x1e0f26[_0x406f('0x33')]);_0x3944a9['attributes']=_[_0x406f('0x36')](_0x1e0f26[_0x406f('0x38')],qs[_0x406f('0x39')](_0x15161d['query'][_0x406f('0x39')]));_0x3944a9[_0x406f('0x37')]=_0x3944a9[_0x406f('0x37')][_0x406f('0x3a')]?_0x3944a9[_0x406f('0x37')]:_0x1e0f26['model'];if(_0x15161d[_0x406f('0x33')][_0x406f('0x45')]){_0x3944a9[_0x406f('0x46')]=[{'all':!![]}];}_0x3944a9=_['merge']({},_0x3944a9,_0x15161d[_0x406f('0x49')]);return db[_0x406f('0x2f')]['find'](_0x3944a9)[_0x406f('0x25')](handleEntityNotFound(_0x1ff806,null))['then'](respondWithResult(_0x1ff806,null))[_0x406f('0x47')](handleError(_0x1ff806,null));};exports['create']=function(_0x24f740,_0x2aa9bb){return db[_0x406f('0x2f')]['create'](_0x24f740[_0x406f('0x4a')],{})[_0x406f('0x25')](function(_0x59c7ec){var _0x3d160f=_0x24f740[_0x406f('0x4b')]['get']({'plain':!![]});if(!_0x3d160f)throw new Error(_0x406f('0x4c'));if(_0x3d160f['role']===_0x406f('0x4b')){var _0x648d54=_0x59c7ec[_0x406f('0x27')]({'plain':!![]});var _0x5e9427=_0x406f('0x28');return db[_0x406f('0x4d')][_0x406f('0x4e')]({'where':{'name':_0x5e9427,'userProfileId':_0x3d160f['userProfileId']},'raw':!![]})[_0x406f('0x25')](function(_0x38c705){if(_0x38c705&&_0x38c705[_0x406f('0x4f')]===0x0){return db[_0x406f('0x29')][_0x406f('0x50')]({'name':_0x648d54[_0x406f('0x2c')],'resourceId':_0x648d54['id'],'type':_0x38c705[_0x406f('0x2c')],'sectionId':_0x38c705['id']},{})[_0x406f('0x25')](function(){return _0x59c7ec;});}else{return _0x59c7ec;}})[_0x406f('0x47')](function(_0x502d03){logger[_0x406f('0x2a')](_0x406f('0x51'),_0x502d03);throw _0x502d03;});}return _0x59c7ec;})[_0x406f('0x25')](respondWithResult(_0x2aa9bb,0xc9))[_0x406f('0x47')](handleError(_0x2aa9bb,null));};exports[_0x406f('0x52')]=function(_0x2342c7,_0x3b2001){if(_0x2342c7['body']['id']){delete _0x2342c7[_0x406f('0x4a')]['id'];}return db[_0x406f('0x2f')]['find']({'where':{'id':_0x2342c7[_0x406f('0x48')]['id']}})[_0x406f('0x25')](handleEntityNotFound(_0x3b2001,null))[_0x406f('0x25')](saveUpdates(_0x2342c7[_0x406f('0x4a')],null))[_0x406f('0x25')](respondWithResult(_0x3b2001,null))[_0x406f('0x47')](handleError(_0x3b2001,null));};exports[_0x406f('0x26')]=function(_0x4807cc,_0x33e017){return db['SquareOdbc']['find']({'where':{'id':_0x4807cc[_0x406f('0x48')]['id']}})['then'](handleEntityNotFound(_0x33e017,null))[_0x406f('0x25')](removeEntity(_0x33e017,null))[_0x406f('0x47')](handleError(_0x33e017,null));};exports['test']=function(_0x1d503b,_0xfd6d31,_0x3d7401){var _0x50246e;return db[_0x406f('0x2f')][_0x406f('0x4e')]({'where':{'id':_0x1d503b[_0x406f('0x48')]['id']},'attributes':['id',_0x406f('0x53')]})['then'](handleEntityNotFound(_0xfd6d31,null))['then'](function(_0x4e8639){if(_0x4e8639){var _0x3c989b=require(_0x406f('0x54'))();_0x3c989b['openSync'](_0x4e8639['dsn']);_0x3c989b['closeSync']();return _0x4e8639;}})[_0x406f('0x25')](respondWithResult(_0xfd6d31,null))[_0x406f('0x47')](handleError(_0xfd6d31,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index acf1dad..cd09685 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 _0xea40=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./squareOdbc.attributes','define','SquareOdbc','square_odbc','lodash','util'];(function(_0x15c45f,_0x569a12){var _0x1a5b9=function(_0x55d91d){while(--_0x55d91d){_0x15c45f['push'](_0x15c45f['shift']());}};_0x1a5b9(++_0x569a12);}(_0xea40,0x1a2));var _0x0ea4=function(_0x43907c,_0x4ab831){_0x43907c=_0x43907c-0x0;var _0x42b194=_0xea40[_0x43907c];return _0x42b194;};'use strict';var _=require(_0x0ea4('0x0'));var util=require(_0x0ea4('0x1'));var logger=require(_0x0ea4('0x2'))(_0x0ea4('0x3'));var moment=require('moment');var BPromise=require(_0x0ea4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ea4('0x5'));var rimraf=require(_0x0ea4('0x6'));var config=require(_0x0ea4('0x7'));var attributes=require(_0x0ea4('0x8'));module['exports']=function(_0x2cd735,_0x1c5039){return _0x2cd735[_0x0ea4('0x9')](_0x0ea4('0xa'),attributes,{'tableName':_0x0ea4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa32d=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','SquareOdbc','square_odbc'];(function(_0x33ddea,_0x222f65){var _0x5e2f59=function(_0x15bf02){while(--_0x15bf02){_0x33ddea['push'](_0x33ddea['shift']());}};_0x5e2f59(++_0x222f65);}(_0xa32d,0x68));var _0xda32=function(_0x4063a4,_0x19d730){_0x4063a4=_0x4063a4-0x0;var _0x17908d=_0xa32d[_0x4063a4];return _0x17908d;};'use strict';var _=require(_0xda32('0x0'));var util=require(_0xda32('0x1'));var logger=require(_0xda32('0x2'))(_0xda32('0x3'));var moment=require('moment');var BPromise=require(_0xda32('0x4'));var rp=require(_0xda32('0x5'));var fs=require('fs');var path=require(_0xda32('0x6'));var rimraf=require(_0xda32('0x7'));var config=require(_0xda32('0x8'));var attributes=require(_0xda32('0x9'));module[_0xda32('0xa')]=function(_0x50efff,_0x13f4b8){return _0x50efff['define'](_0xda32('0xb'),attributes,{'tableName':_0xda32('0xc'),'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 ca96028..2d96100 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 _0x301b=['where','include','attributes','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowSquareOdbc','options','raw'];(function(_0x1042e1,_0x2df478){var _0x28527f=function(_0x29caff){while(--_0x29caff){_0x1042e1['push'](_0x1042e1['shift']());}};_0x28527f(++_0x2df478);}(_0x301b,0xcb));var _0xb301=function(_0x2d8f4c,_0x523db3){_0x2d8f4c=_0x2d8f4c-0x0;var _0x57090c=_0x301b[_0x2d8f4c];return _0x57090c;};'use strict';var _=require(_0xb301('0x0'));var util=require(_0xb301('0x1'));var moment=require(_0xb301('0x2'));var BPromise=require(_0xb301('0x3'));var rs=require(_0xb301('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb301('0x5'))['db'];var utils=require(_0xb301('0x6'));var logger=require(_0xb301('0x7'))(_0xb301('0x8'));var config=require(_0xb301('0x9'));var jayson=require(_0xb301('0xa'));var client=jayson[_0xb301('0xb')][_0xb301('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x8063e,_0x497afb,_0xfa2afb){return new BPromise(function(_0x3c7a5c,_0x17beb3){return client[_0xb301('0xd')](_0x8063e,_0xfa2afb)[_0xb301('0xe')](function(_0x2090e7){logger[_0xb301('0xf')](_0xb301('0x10'),_0x497afb,_0xb301('0x11'));logger[_0xb301('0x12')](_0xb301('0x13'),_0x497afb,'request\x20sent',JSON[_0xb301('0x14')](_0x2090e7));if(_0x2090e7[_0xb301('0x15')]){if(_0x2090e7['error'][_0xb301('0x16')]===0x1f4){logger[_0xb301('0x15')](_0xb301('0x10'),_0x497afb,_0x2090e7[_0xb301('0x15')][_0xb301('0x17')]);return _0x17beb3(_0x2090e7[_0xb301('0x15')][_0xb301('0x17')]);}logger[_0xb301('0x15')]('SquareOdbc,\x20%s,\x20%s',_0x497afb,_0x2090e7[_0xb301('0x15')]['message']);return _0x3c7a5c(_0x2090e7['error'][_0xb301('0x17')]);}else{logger[_0xb301('0xf')](_0xb301('0x10'),_0x497afb,_0xb301('0x11'));_0x3c7a5c(_0x2090e7[_0xb301('0x18')][_0xb301('0x17')]);}})['catch'](function(_0x1d3f24){logger[_0xb301('0x15')]('SquareOdbc,\x20%s,\x20%s',_0x497afb,_0x1d3f24);_0x17beb3(_0x1d3f24);});});}exports[_0xb301('0x19')]=function(_0x3674b9){var _0x3c5d0e=this;return new Promise(function(_0x488a83,_0x3367fd){return db['SquareOdbc']['find']({'raw':_0x3674b9[_0xb301('0x1a')]?_0x3674b9['options'][_0xb301('0x1b')]===undefined?!![]:![]:!![],'where':_0x3674b9[_0xb301('0x1a')]?_0x3674b9['options'][_0xb301('0x1c')]||null:null,'attributes':_0x3674b9[_0xb301('0x1a')]?_0x3674b9[_0xb301('0x1a')]['attributes']||null:null,'include':_0x3674b9['options']?_0x3674b9[_0xb301('0x1a')][_0xb301('0x1d')]?_['map'](_0x3674b9[_0xb301('0x1a')][_0xb301('0x1d')],function(_0x395653){return{'model':db[_0x395653['model']],'as':_0x395653['as'],'attributes':_0x395653[_0xb301('0x1e')],'include':_0x395653[_0xb301('0x1d')]?_[_0xb301('0x1f')](_0x395653['include'],function(_0x73ef61){return{'model':db[_0x73ef61[_0xb301('0x20')]],'as':_0x73ef61['as'],'attributes':_0x73ef61[_0xb301('0x1e')],'include':_0x73ef61['include']?_['map'](_0x73ef61[_0xb301('0x1d')],function(_0x307750){return{'model':db[_0x307750[_0xb301('0x20')]],'as':_0x307750['as'],'attributes':_0x307750['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x42c6a5){logger[_0xb301('0xf')](_0xb301('0x19'),_0x3674b9);logger[_0xb301('0x12')](_0xb301('0x19'),_0x3674b9,JSON[_0xb301('0x14')](_0x42c6a5));_0x488a83(_0x42c6a5);})['catch'](function(_0x34520a){logger['error']('ShowSquareOdbc',_0x34520a[_0xb301('0x17')],_0x3674b9);_0x3367fd(_0x3c5d0e[_0xb301('0x15')](0x1f4,_0x34520a[_0xb301('0x17')]));});});}; \ No newline at end of file +var _0x004b=['client','http','request','then','info','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SquareOdbc,\x20%s,\x20%s','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','attributes','include','map','model','lodash','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise'];(function(_0x39c056,_0x2f3a95){var _0x429dc7=function(_0x41ebb7){while(--_0x41ebb7){_0x39c056['push'](_0x39c056['shift']());}};_0x429dc7(++_0x2f3a95);}(_0x004b,0xcb));var _0xb004=function(_0x513727,_0x50370e){_0x513727=_0x513727-0x0;var _0x5b982a=_0x004b[_0x513727];return _0x5b982a;};'use strict';var _=require(_0xb004('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb004('0x1'));var rs=require(_0xb004('0x2'));var fs=require('fs');var Redis=require(_0xb004('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb004('0x4'));var config=require(_0xb004('0x5'));var jayson=require(_0xb004('0x6'));var client=jayson[_0xb004('0x7')][_0xb004('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2bd59d,_0x1e749e,_0x75f20d){return new BPromise(function(_0x3457b5,_0x24866a){return client[_0xb004('0x9')](_0x2bd59d,_0x75f20d)[_0xb004('0xa')](function(_0x1293a5){logger[_0xb004('0xb')]('SquareOdbc,\x20%s,\x20%s',_0x1e749e,'request\x20sent');logger[_0xb004('0xc')](_0xb004('0xd'),_0x1e749e,_0xb004('0xe'),JSON[_0xb004('0xf')](_0x1293a5));if(_0x1293a5[_0xb004('0x10')]){if(_0x1293a5[_0xb004('0x10')]['code']===0x1f4){logger[_0xb004('0x10')](_0xb004('0x11'),_0x1e749e,_0x1293a5[_0xb004('0x10')][_0xb004('0x12')]);return _0x24866a(_0x1293a5[_0xb004('0x10')]['message']);}logger[_0xb004('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x1e749e,_0x1293a5[_0xb004('0x10')][_0xb004('0x12')]);return _0x3457b5(_0x1293a5['error'][_0xb004('0x12')]);}else{logger[_0xb004('0xb')](_0xb004('0x11'),_0x1e749e,_0xb004('0xe'));_0x3457b5(_0x1293a5[_0xb004('0x13')][_0xb004('0x12')]);}})[_0xb004('0x14')](function(_0x563dc9){logger[_0xb004('0x10')](_0xb004('0x11'),_0x1e749e,_0x563dc9);_0x24866a(_0x563dc9);});});}exports[_0xb004('0x15')]=function(_0x5396c2){var _0x3b4d37=this;return new Promise(function(_0x3a6b28,_0x1cc655){return db[_0xb004('0x16')][_0xb004('0x17')]({'raw':_0x5396c2[_0xb004('0x18')]?_0x5396c2[_0xb004('0x18')][_0xb004('0x19')]===undefined?!![]:![]:!![],'where':_0x5396c2[_0xb004('0x18')]?_0x5396c2[_0xb004('0x18')]['where']||null:null,'attributes':_0x5396c2['options']?_0x5396c2[_0xb004('0x18')][_0xb004('0x1a')]||null:null,'include':_0x5396c2['options']?_0x5396c2[_0xb004('0x18')]['include']?_['map'](_0x5396c2[_0xb004('0x18')][_0xb004('0x1b')],function(_0x5e8bc0){return{'model':db[_0x5e8bc0['model']],'as':_0x5e8bc0['as'],'attributes':_0x5e8bc0[_0xb004('0x1a')],'include':_0x5e8bc0['include']?_[_0xb004('0x1c')](_0x5e8bc0[_0xb004('0x1b')],function(_0x1827cb){return{'model':db[_0x1827cb[_0xb004('0x1d')]],'as':_0x1827cb['as'],'attributes':_0x1827cb[_0xb004('0x1a')],'include':_0x1827cb[_0xb004('0x1b')]?_[_0xb004('0x1c')](_0x1827cb[_0xb004('0x1b')],function(_0x1aab42){return{'model':db[_0x1aab42['model']],'as':_0x1aab42['as'],'attributes':_0x1aab42[_0xb004('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb004('0xa')](function(_0x25ecc4){logger[_0xb004('0xb')](_0xb004('0x15'),_0x5396c2);logger[_0xb004('0xc')](_0xb004('0x15'),_0x5396c2,JSON[_0xb004('0xf')](_0x25ecc4));_0x3a6b28(_0x25ecc4);})[_0xb004('0x14')](function(_0x4dd855){logger['error'](_0xb004('0x15'),_0x4dd855[_0xb004('0x12')],_0x5396c2);_0x1cc655(_0x3b4d37[_0xb004('0x10')](0x1f4,_0x4dd855[_0xb004('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index e0a8ad2..c29e0fb 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 _0x0c1a=['/:id','/:id/users','getUsers','post','update','destroy','delete','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index'];(function(_0x5d9694,_0x5eabca){var _0x509376=function(_0x16ac71){while(--_0x16ac71){_0x5d9694['push'](_0x5d9694['shift']());}};_0x509376(++_0x5eabca);}(_0x0c1a,0x127));var _0xa0c1=function(_0xb0211d,_0x31913e){_0xb0211d=_0xb0211d-0x0;var _0x4919d5=_0x0c1a[_0xb0211d];return _0x4919d5;};'use strict';var multer=require(_0xa0c1('0x0'));var util=require(_0xa0c1('0x1'));var path=require(_0xa0c1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa0c1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa0c1('0x4'));var interaction=require(_0xa0c1('0x5'));var config=require(_0xa0c1('0x6'));var controller=require(_0xa0c1('0x7'));router[_0xa0c1('0x8')]('/',auth[_0xa0c1('0x9')](),controller[_0xa0c1('0xa')]);router[_0xa0c1('0x8')](_0xa0c1('0xb'),auth[_0xa0c1('0x9')](),controller['show']);router[_0xa0c1('0x8')](_0xa0c1('0xc'),auth[_0xa0c1('0x9')](),controller[_0xa0c1('0xd')]);router[_0xa0c1('0xe')]('/',auth[_0xa0c1('0x9')](),controller['create']);router[_0xa0c1('0xe')]('/:id/users',auth[_0xa0c1('0x9')](),controller['addUsers']);router['put'](_0xa0c1('0xb'),auth[_0xa0c1('0x9')](),controller[_0xa0c1('0xf')]);router['delete'](_0xa0c1('0xb'),auth[_0xa0c1('0x9')](),controller[_0xa0c1('0x10')]);router[_0xa0c1('0x11')](_0xa0c1('0xc'),auth[_0xa0c1('0x9')](),controller['removeUsers']);module['exports']=router; \ No newline at end of file +var _0x843e=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','index','isAuthenticated','show','/:id/users','getUsers','post','create','addUsers','put','/:id','update','delete','destroy','removeUsers','exports','multer','util','path'];(function(_0x817d9b,_0x3c37e3){var _0x2752e1=function(_0x2b434e){while(--_0x2b434e){_0x817d9b['push'](_0x817d9b['shift']());}};_0x2752e1(++_0x3c37e3);}(_0x843e,0xcd));var _0xe843=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x843e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe843('0x0'));var util=require(_0xe843('0x1'));var path=require(_0xe843('0x2'));var timeout=require(_0xe843('0x3'));var express=require('express');var router=express[_0xe843('0x4')]();var fs_extra=require(_0xe843('0x5'));var auth=require(_0xe843('0x6'));var interaction=require(_0xe843('0x7'));var config=require(_0xe843('0x8'));var controller=require(_0xe843('0x9'));router[_0xe843('0xa')]('/',auth['isAuthenticated'](),controller[_0xe843('0xb')]);router[_0xe843('0xa')]('/:id',auth[_0xe843('0xc')](),controller[_0xe843('0xd')]);router[_0xe843('0xa')](_0xe843('0xe'),auth[_0xe843('0xc')](),controller[_0xe843('0xf')]);router[_0xe843('0x10')]('/',auth[_0xe843('0xc')](),controller[_0xe843('0x11')]);router[_0xe843('0x10')](_0xe843('0xe'),auth[_0xe843('0xc')](),controller[_0xe843('0x12')]);router[_0xe843('0x13')](_0xe843('0x14'),auth[_0xe843('0xc')](),controller[_0xe843('0x15')]);router[_0xe843('0x16')]('/:id',auth[_0xe843('0xc')](),controller[_0xe843('0x17')]);router[_0xe843('0x16')](_0xe843('0xe'),auth['isAuthenticated'](),controller[_0xe843('0x18')]);module[_0xe843('0x19')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 097319a..cb8b14e 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 _0xc4f9=['getDataValue','preproduction','long','production','toString','utf8','DATE','sequelize','exports','name','STRING','TEXT'];(function(_0x36fe46,_0x40010c){var _0x4d2e9c=function(_0x2dfa20){while(--_0x2dfa20){_0x36fe46['push'](_0x36fe46['shift']());}};_0x4d2e9c(++_0x40010c);}(_0xc4f9,0x193));var _0x9c4f=function(_0x32c441,_0x496c57){_0x32c441=_0x32c441-0x0;var _0x2f38a6=_0xc4f9[_0x32c441];return _0x2f38a6;};'use strict';var Sequelize=require(_0x9c4f('0x0'));module[_0x9c4f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9c4f('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x9c4f('0x3')]},'notes':{'type':Sequelize[_0x9c4f('0x4')]},'preproduction':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0x9c4f('0x5')]('preproduction')){return this[_0x9c4f('0x5')](_0x9c4f('0x6'))['toString']('utf8');}}},'production':{'type':Sequelize['BLOB'](_0x9c4f('0x7')),'get':function(){if(this[_0x9c4f('0x5')](_0x9c4f('0x8'))){return this[_0x9c4f('0x5')](_0x9c4f('0x8'))[_0x9c4f('0x9')](_0x9c4f('0xa'));}}},'savedAt':{'type':Sequelize[_0x9c4f('0xb')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x551b=['preproduction','utf8','DATE','exports','STRING','name','TEXT','BLOB','getDataValue'];(function(_0x39f097,_0x17116b){var _0x544f6a=function(_0x457caf){while(--_0x457caf){_0x39f097['push'](_0x39f097['shift']());}};_0x544f6a(++_0x17116b);}(_0x551b,0x66));var _0xb551=function(_0x40911a,_0x55ec99){_0x40911a=_0x40911a-0x0;var _0x27e8e3=_0x551b[_0x40911a];return _0x27e8e3;};'use strict';var Sequelize=require('sequelize');module[_0xb551('0x0')]={'name':{'type':Sequelize[_0xb551('0x1')],'unique':_0xb551('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xb551('0x1')]},'notes':{'type':Sequelize[_0xb551('0x3')]},'preproduction':{'type':Sequelize[_0xb551('0x4')]('long'),'get':function(){if(this[_0xb551('0x5')](_0xb551('0x6'))){return this[_0xb551('0x5')](_0xb551('0x6'))['toString']('utf8');}}},'production':{'type':Sequelize[_0xb551('0x4')]('long'),'get':function(){if(this['getDataValue']('production')){return this['getDataValue']('production')['toString'](_0xb551('0x7'));}}},'savedAt':{'type':Sequelize[_0xb551('0x8')]},'publishedAt':{'type':Sequelize[_0xb551('0x8')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 87ba679..f10874d 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 _0x1261=['userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','stringify','production','destroy','addUsers','omit','ids','removeUsers','emit','userSquareProject:remove','getUsers','findOne','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./squareProject.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','json','update','then','get','UserProfileResource','publish','name','send','index','map','SquareProject','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','filter','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','options','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','SquareProjects','find'];(function(_0x360f32,_0x5a8c68){var _0x484d79=function(_0x62d339){while(--_0x62d339){_0x360f32['push'](_0x360f32['shift']());}};_0x484d79(++_0x5a8c68);}(_0x1261,0x144));var _0x1126=function(_0x15fdff,_0x40d5b2){_0x15fdff=_0x15fdff-0x0;var _0x5450ed=_0x1261[_0x15fdff];return _0x5450ed;};'use strict';var _=require('lodash');var Redis=require(_0x1126('0x0'));var qs=require(_0x1126('0x1'));var logger=require(_0x1126('0x2'))(_0x1126('0x3'));var config=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];config[_0x1126('0x6')]=_[_0x1126('0x7')](config[_0x1126('0x6')],{'host':_0x1126('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1126('0x9'))[_0x1126('0xa')](socket);function respondWithStatusCode(_0x4f239c,_0x17e5f0){_0x17e5f0=_0x17e5f0||0xcc;return function(_0x28772d){if(_0x28772d){return _0x4f239c[_0x1126('0xb')](_0x17e5f0);}return _0x4f239c[_0x1126('0xc')](_0x17e5f0)[_0x1126('0xd')]();};}function respondWithResult(_0x59cfa1,_0x3f09ac){_0x3f09ac=_0x3f09ac||0xc8;return function(_0x18dbe6){if(_0x18dbe6){return _0x59cfa1[_0x1126('0xc')](_0x3f09ac)['json'](_0x18dbe6);}};}function respondWithFilteredResult(_0x34571c,_0x5d581b){return function(_0x52ef15){if(_0x52ef15){var _0x15c071=typeof _0x5d581b['offset']===_0x1126('0xe')&&typeof _0x5d581b[_0x1126('0xf')]===_0x1126('0xe');var _0x273896=_0x52ef15[_0x1126('0x10')];var _0x3f10e9=_0x15c071?0x0:_0x5d581b[_0x1126('0x11')];var _0x2048ad=_0x15c071?_0x52ef15[_0x1126('0x10')]:_0x5d581b['offset']+_0x5d581b['limit'];var _0x1af673;if(_0x2048ad>=_0x273896){_0x2048ad=_0x273896;_0x1af673=0xc8;}else{_0x1af673=0xce;}_0x34571c[_0x1126('0xc')](_0x1af673);return _0x34571c[_0x1126('0x12')]('Content-Range',_0x3f10e9+'-'+_0x2048ad+'/'+_0x273896)[_0x1126('0x13')](_0x52ef15);}return null;};}function saveUpdates(_0x4794a7){return function(_0x35fe9f){if(_0x35fe9f){return _0x35fe9f[_0x1126('0x14')](_0x4794a7)[_0x1126('0x15')](function(_0x4e1c97){return _0x4e1c97;});}return null;};}function removeEntity(_0x245cd7){return function(_0x1695f6){if(_0x1695f6){return _0x1695f6['destroy']()['then'](function(){var _0x22ae0b=_0x1695f6[_0x1126('0x16')]({'plain':!![]});var _0x58d11a='SquareProjects';return db[_0x1126('0x17')]['destroy']({'where':{'type':_0x58d11a,'resourceId':_0x22ae0b['id']}})[_0x1126('0x15')](function(){return _0x1695f6;});})[_0x1126('0x15')](function(){var _0x2f70ac=new Redis(config['redis']);_0x2f70ac[_0x1126('0x18')]('agi',JSON['stringify']({'id':_0x1695f6['id'],'deleted':!![]}));})[_0x1126('0x15')](function(){_0x245cd7[_0x1126('0xc')](0xcc)[_0x1126('0xd')]();});}};}function handleEntityNotFound(_0x36d254){return function(_0x526ca1){if(!_0x526ca1){_0x36d254[_0x1126('0xb')](0x194);}return _0x526ca1;};}function handleError(_0x477e6a,_0x48a08d){_0x48a08d=_0x48a08d||0x1f4;return function(_0x2175fa){logger['error'](_0x2175fa['stack']);if(_0x2175fa['name']){delete _0x2175fa[_0x1126('0x19')];}_0x477e6a[_0x1126('0xc')](_0x48a08d)[_0x1126('0x1a')](_0x2175fa);};}exports[_0x1126('0x1b')]=function(_0x566c09,_0x1b07a7){var _0xea0971={},_0x38119d={},_0x589725={'count':0x0,'rows':[]};var _0x35eec3=_[_0x1126('0x1c')](db[_0x1126('0x1d')]['rawAttributes'],function(_0x541bc9){return{'name':_0x541bc9[_0x1126('0x1e')],'type':_0x541bc9[_0x1126('0x1f')]['key']};});_0x38119d[_0x1126('0x20')]=_[_0x1126('0x1c')](_0x35eec3,'name');_0x38119d[_0x1126('0x21')]=_['keys'](_0x566c09[_0x1126('0x21')]);_0x38119d['filters']=_[_0x1126('0x22')](_0x38119d['model'],_0x38119d[_0x1126('0x21')]);_0xea0971['attributes']=_['intersection'](_0x38119d['model'],qs[_0x1126('0x23')](_0x566c09[_0x1126('0x21')][_0x1126('0x23')]));_0xea0971['attributes']=_0xea0971[_0x1126('0x24')][_0x1126('0x25')]?_0xea0971['attributes']:_0x38119d[_0x1126('0x20')];if(!_0x566c09[_0x1126('0x21')][_0x1126('0x26')](_0x1126('0x27'))){_0xea0971['limit']=qs['limit'](_0x566c09[_0x1126('0x21')][_0x1126('0xf')]);_0xea0971[_0x1126('0x11')]=qs[_0x1126('0x11')](_0x566c09['query'][_0x1126('0x11')]);}_0xea0971[_0x1126('0x28')]=qs[_0x1126('0x29')](_0x566c09[_0x1126('0x21')][_0x1126('0x29')]);_0xea0971['where']=qs[_0x1126('0x2a')](_[_0x1126('0x2b')](_0x566c09[_0x1126('0x21')],_0x38119d[_0x1126('0x2a')]),_0x35eec3);if(_0x566c09['query']['filter']){_0xea0971[_0x1126('0x2c')]=_[_0x1126('0x2d')](_0xea0971['where'],{'$or':_[_0x1126('0x1c')](_0x35eec3,function(_0xf3c21b){if(_0xf3c21b[_0x1126('0x1f')]!=='VIRTUAL'){var _0x4b3859={};_0x4b3859[_0xf3c21b[_0x1126('0x19')]]={'$like':'%'+_0x566c09[_0x1126('0x21')][_0x1126('0x2e')]+'%'};return _0x4b3859;}})});}_0xea0971=_[_0x1126('0x2d')]({},_0xea0971,_0x566c09['options']);var _0x428d3d={'where':_0xea0971['where']};return db[_0x1126('0x1d')][_0x1126('0x10')](_0x428d3d)[_0x1126('0x15')](function(_0x1ea702){_0x589725[_0x1126('0x10')]=_0x1ea702;if(_0x566c09['query'][_0x1126('0x2f')]){_0xea0971[_0x1126('0x30')]=[{'all':!![]}];}return db[_0x1126('0x1d')][_0x1126('0x31')](_0xea0971);})[_0x1126('0x15')](function(_0x3442b8){_0x589725[_0x1126('0x32')]=_0x3442b8;return _0x589725;})['then'](respondWithFilteredResult(_0x1b07a7,_0xea0971))[_0x1126('0x33')](handleError(_0x1b07a7,null));};exports[_0x1126('0x34')]=function(_0x227a6b,_0xf3a0bd){var _0xcf0483={'raw':![],'where':{'id':_0x227a6b['params']['id']}},_0x518de1={};_0x518de1[_0x1126('0x20')]=_[_0x1126('0x35')](db[_0x1126('0x1d')][_0x1126('0x36')]);_0x518de1[_0x1126('0x21')]=_[_0x1126('0x35')](_0x227a6b['query']);_0x518de1['filters']=_['intersection'](_0x518de1[_0x1126('0x20')],_0x518de1['query']);_0xcf0483[_0x1126('0x24')]=_[_0x1126('0x22')](_0x518de1[_0x1126('0x20')],qs[_0x1126('0x23')](_0x227a6b['query']['fields']));_0xcf0483[_0x1126('0x24')]=_0xcf0483[_0x1126('0x24')][_0x1126('0x25')]?_0xcf0483['attributes']:_0x518de1[_0x1126('0x20')];if(_0x227a6b['query'][_0x1126('0x2f')]){_0xcf0483['include']=[{'all':!![]}];}_0xcf0483=_[_0x1126('0x2d')]({},_0xcf0483,_0x227a6b[_0x1126('0x37')]);return db[_0x1126('0x1d')]['find'](_0xcf0483)[_0x1126('0x15')](handleEntityNotFound(_0xf3a0bd,null))[_0x1126('0x15')](respondWithResult(_0xf3a0bd,null))[_0x1126('0x33')](handleError(_0xf3a0bd,null));};exports['create']=function(_0x58ff3a,_0x4dd7f5){return db[_0x1126('0x1d')]['create'](_0x58ff3a[_0x1126('0x38')],{})['then'](function(_0x2f45b9){var _0x323499=_0x58ff3a[_0x1126('0x39')][_0x1126('0x16')]({'plain':!![]});if(!_0x323499)throw new Error(_0x1126('0x3a'));if(_0x323499['role']===_0x1126('0x39')){var _0x512f60=_0x2f45b9['get']({'plain':!![]});var _0x1a15f8=_0x1126('0x3b');return db['UserProfileSection'][_0x1126('0x3c')]({'where':{'name':_0x1a15f8,'userProfileId':_0x323499[_0x1126('0x3d')]},'raw':!![]})['then'](function(_0x3e4eeb){if(_0x3e4eeb&&_0x3e4eeb[_0x1126('0x3e')]===0x0){return db[_0x1126('0x17')]['create']({'name':_0x512f60[_0x1126('0x19')],'resourceId':_0x512f60['id'],'type':_0x3e4eeb[_0x1126('0x19')],'sectionId':_0x3e4eeb['id']},{})[_0x1126('0x15')](function(){return _0x2f45b9;});}else{return _0x2f45b9;}})[_0x1126('0x33')](function(_0x224456){logger[_0x1126('0x3f')](_0x1126('0x40'),_0x224456);throw _0x224456;});}return _0x2f45b9;})[_0x1126('0x15')](respondWithResult(_0x4dd7f5,0xc9))['catch'](handleError(_0x4dd7f5,null));};exports[_0x1126('0x14')]=function(_0x5a2287,_0x40168e){if(_0x5a2287[_0x1126('0x38')]['id']){delete _0x5a2287['body']['id'];}return db['SquareProject'][_0x1126('0x3c')]({'where':{'id':_0x5a2287[_0x1126('0x41')]['id']}})[_0x1126('0x15')](handleEntityNotFound(_0x40168e,null))['then'](saveUpdates(_0x5a2287[_0x1126('0x38')],null))[_0x1126('0x15')](function(_0x3ea23f){if(!_0x3ea23f)return;var _0x615936=_0x3ea23f['get']({'plain':!![]});return _0x615936;})[_0x1126('0x15')](function(_0x46551f){var _0x5c36b9=new Redis(config['redis']);_0x5c36b9['publish']('agi',JSON[_0x1126('0x42')](_[_0x1126('0x2b')](_0x46551f,['id','name',_0x1126('0x43')])));return _0x46551f;})[_0x1126('0x15')](respondWithResult(_0x40168e,null))[_0x1126('0x33')](handleError(_0x40168e,null));};exports[_0x1126('0x44')]=function(_0x29bc7d,_0x4e4d49){return db[_0x1126('0x1d')][_0x1126('0x3c')]({'where':{'id':_0x29bc7d['params']['id']}})[_0x1126('0x15')](handleEntityNotFound(_0x4e4d49,null))[_0x1126('0x15')](removeEntity(_0x4e4d49,null))[_0x1126('0x33')](handleError(_0x4e4d49,null));};exports[_0x1126('0x45')]=function(_0xc8a0f,_0x59c3d0){return db[_0x1126('0x1d')]['find']({'where':{'id':_0xc8a0f[_0x1126('0x41')]['id']}})[_0x1126('0x15')](handleEntityNotFound(_0x59c3d0,null))[_0x1126('0x15')](function(_0x590bc2){if(_0x590bc2){return _0x590bc2[_0x1126('0x45')](_0xc8a0f[_0x1126('0x38')]['ids'],_[_0x1126('0x46')](_0xc8a0f[_0x1126('0x38')],[_0x1126('0x47'),'id'])||{});}})['then'](respondWithResult(_0x59c3d0,null))[_0x1126('0x33')](handleError(_0x59c3d0,null));};exports[_0x1126('0x48')]=function(_0x22ab18,_0x308ee4){return db[_0x1126('0x1d')][_0x1126('0x3c')]({'where':{'id':_0x22ab18[_0x1126('0x41')]['id']}})[_0x1126('0x15')](handleEntityNotFound(_0x308ee4,null))['then'](function(_0x2b23e3){if(_0x2b23e3){return _0x2b23e3[_0x1126('0x48')](_0x22ab18[_0x1126('0x21')][_0x1126('0x47')])[_0x1126('0x15')](function(){if(_['isArray'](_0x22ab18[_0x1126('0x21')][_0x1126('0x47')])){for(var _0x5e0ea1=0x0;_0x5e0ea1<_0x22ab18[_0x1126('0x21')]['ids'][_0x1126('0x25')];_0x5e0ea1+=0x1){socket[_0x1126('0x49')]('userSquareProject:remove',{'UserId':Number(_0x22ab18[_0x1126('0x21')][_0x1126('0x47')][_0x5e0ea1]),'SquareProjectId':Number(_0x22ab18[_0x1126('0x41')]['id'])});}}else{socket['emit'](_0x1126('0x4a'),{'UserId':Number(_0x22ab18['query']['ids']),'SquareProjectId':Number(_0x22ab18[_0x1126('0x41')]['id'])});}});}})[_0x1126('0x15')](respondWithStatusCode(_0x308ee4,null))[_0x1126('0x33')](handleError(_0x308ee4,null));};exports[_0x1126('0x4b')]=function(_0x3a76ec,_0x1b4ebf){var _0x1a0e26={};var _0x5036d4={};var _0x191307;var _0x43ec00;return db[_0x1126('0x1d')][_0x1126('0x4c')]({'where':{'id':_0x3a76ec[_0x1126('0x41')]['id']}})[_0x1126('0x15')](handleEntityNotFound(_0x1b4ebf,null))['then'](function(_0x5b17d6){if(_0x5b17d6){_0x191307=_0x5b17d6;_0x5036d4[_0x1126('0x20')]=_[_0x1126('0x35')](db['User']['rawAttributes']);_0x5036d4['query']=_['keys'](_0x3a76ec[_0x1126('0x21')]);_0x5036d4[_0x1126('0x2a')]=_[_0x1126('0x22')](_0x5036d4['model'],_0x5036d4[_0x1126('0x21')]);_0x1a0e26[_0x1126('0x24')]=_[_0x1126('0x22')](_0x5036d4[_0x1126('0x20')],qs[_0x1126('0x23')](_0x3a76ec[_0x1126('0x21')][_0x1126('0x23')]));_0x1a0e26['attributes']=_0x1a0e26[_0x1126('0x24')][_0x1126('0x25')]?_0x1a0e26[_0x1126('0x24')]:_0x5036d4[_0x1126('0x20')];_0x1a0e26[_0x1126('0x28')]=qs['sort'](_0x3a76ec['query'][_0x1126('0x29')]);_0x1a0e26[_0x1126('0x2c')]=qs['filters'](_[_0x1126('0x2b')](_0x3a76ec[_0x1126('0x21')],_0x5036d4[_0x1126('0x2a')]));if(_0x3a76ec[_0x1126('0x21')][_0x1126('0x2e')]){_0x1a0e26[_0x1126('0x2c')]=_[_0x1126('0x2d')](_0x1a0e26[_0x1126('0x2c')],{'$or':_[_0x1126('0x1c')](_0x1a0e26[_0x1126('0x24')],function(_0x16e48a){var _0x1228cf={};_0x1228cf[_0x16e48a]={'$like':'%'+_0x3a76ec[_0x1126('0x21')]['filter']+'%'};return _0x1228cf;})});}_0x1a0e26=_[_0x1126('0x2d')]({},_0x1a0e26,_0x3a76ec[_0x1126('0x37')]);return _0x191307[_0x1126('0x4b')](_0x1a0e26);}})['then'](function(_0x484881){if(_0x484881){_0x43ec00=_0x484881[_0x1126('0x25')];if(!_0x3a76ec[_0x1126('0x21')][_0x1126('0x26')](_0x1126('0x27'))){_0x1a0e26['limit']=qs['limit'](_0x3a76ec['query'][_0x1126('0xf')]);_0x1a0e26[_0x1126('0x11')]=qs[_0x1126('0x11')](_0x3a76ec[_0x1126('0x21')]['offset']);}return _0x191307[_0x1126('0x4b')](_0x1a0e26);}})['then'](function(_0x30dea4){if(_0x30dea4){return _0x30dea4?{'count':_0x43ec00,'rows':_0x30dea4}:null;}})[_0x1126('0x15')](respondWithResult(_0x1b4ebf,null))[_0x1126('0x33')](handleError(_0x1b4ebf,null));}; \ No newline at end of file +var _0xdb28=['create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','production','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','pick','nolimit','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','SquareProjects','UserProfileResource','publish','agi','stringify','error','send','index','map','SquareProject','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','options','include','findAll','rows','catch','show','fields','find'];(function(_0x40df5f,_0x8fd59f){var _0x1573f1=function(_0x57b8b8){while(--_0x57b8b8){_0x40df5f['push'](_0x40df5f['shift']());}};_0x1573f1(++_0x8fd59f);}(_0xdb28,0x106));var _0x8db2=function(_0x124a94,_0x9d206c){_0x124a94=_0x124a94-0x0;var _0x1f8ea8=_0xdb28[_0x124a94];return _0x1f8ea8;};'use strict';var _=require(_0x8db2('0x0'));var Redis=require(_0x8db2('0x1'));var qs=require(_0x8db2('0x2'));var logger=require(_0x8db2('0x3'))('api');var config=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];config[_0x8db2('0x6')]=_[_0x8db2('0x7')](config[_0x8db2('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x8db2('0x8'))(new Redis(config[_0x8db2('0x6')]));require('./squareProject.socket')['register'](socket);function respondWithStatusCode(_0x477f50,_0x46932f){_0x46932f=_0x46932f||0xcc;return function(_0x131537){if(_0x131537){return _0x477f50[_0x8db2('0x9')](_0x46932f);}return _0x477f50[_0x8db2('0xa')](_0x46932f)[_0x8db2('0xb')]();};}function respondWithResult(_0x126c78,_0x4ba340){_0x4ba340=_0x4ba340||0xc8;return function(_0x30dc90){if(_0x30dc90){return _0x126c78[_0x8db2('0xa')](_0x4ba340)[_0x8db2('0xc')](_0x30dc90);}};}function respondWithFilteredResult(_0x57015f,_0x1d9371){return function(_0x150942){if(_0x150942){var _0x576475=typeof _0x1d9371[_0x8db2('0xd')]===_0x8db2('0xe')&&typeof _0x1d9371[_0x8db2('0xf')]===_0x8db2('0xe');var _0x37d017=_0x150942['count'];var _0x49fadc=_0x576475?0x0:_0x1d9371[_0x8db2('0xd')];var _0x15e87c=_0x576475?_0x150942[_0x8db2('0x10')]:_0x1d9371[_0x8db2('0xd')]+_0x1d9371[_0x8db2('0xf')];var _0xfa285b;if(_0x15e87c>=_0x37d017){_0x15e87c=_0x37d017;_0xfa285b=0xc8;}else{_0xfa285b=0xce;}_0x57015f[_0x8db2('0xa')](_0xfa285b);return _0x57015f[_0x8db2('0x11')](_0x8db2('0x12'),_0x49fadc+'-'+_0x15e87c+'/'+_0x37d017)[_0x8db2('0xc')](_0x150942);}return null;};}function saveUpdates(_0x5489a9){return function(_0x13b0f5){if(_0x13b0f5){return _0x13b0f5[_0x8db2('0x13')](_0x5489a9)['then'](function(_0x2b3f73){return _0x2b3f73;});}return null;};}function removeEntity(_0x44957d){return function(_0x21db8c){if(_0x21db8c){return _0x21db8c[_0x8db2('0x14')]()[_0x8db2('0x15')](function(){var _0x46ce14=_0x21db8c['get']({'plain':!![]});var _0x5df464=_0x8db2('0x16');return db[_0x8db2('0x17')][_0x8db2('0x14')]({'where':{'type':_0x5df464,'resourceId':_0x46ce14['id']}})[_0x8db2('0x15')](function(){return _0x21db8c;});})['then'](function(){var _0x431d60=new Redis(config[_0x8db2('0x6')]);_0x431d60[_0x8db2('0x18')](_0x8db2('0x19'),JSON[_0x8db2('0x1a')]({'id':_0x21db8c['id'],'deleted':!![]}));})['then'](function(){_0x44957d[_0x8db2('0xa')](0xcc)[_0x8db2('0xb')]();});}};}function handleEntityNotFound(_0x18f69c){return function(_0x125be2){if(!_0x125be2){_0x18f69c[_0x8db2('0x9')](0x194);}return _0x125be2;};}function handleError(_0x21704c,_0x796ec1){_0x796ec1=_0x796ec1||0x1f4;return function(_0x5c6614){logger[_0x8db2('0x1b')](_0x5c6614['stack']);if(_0x5c6614['name']){delete _0x5c6614['name'];}_0x21704c['status'](_0x796ec1)[_0x8db2('0x1c')](_0x5c6614);};}exports[_0x8db2('0x1d')]=function(_0x3be281,_0x2baed0){var _0x145328={},_0x8d4f54={},_0x58cd9d={'count':0x0,'rows':[]};var _0x3544ba=_[_0x8db2('0x1e')](db[_0x8db2('0x1f')][_0x8db2('0x20')],function(_0x483aee){return{'name':_0x483aee[_0x8db2('0x21')],'type':_0x483aee[_0x8db2('0x22')][_0x8db2('0x23')]};});_0x8d4f54[_0x8db2('0x24')]=_[_0x8db2('0x1e')](_0x3544ba,_0x8db2('0x25'));_0x8d4f54[_0x8db2('0x26')]=_[_0x8db2('0x27')](_0x3be281[_0x8db2('0x26')]);_0x8d4f54['filters']=_[_0x8db2('0x28')](_0x8d4f54['model'],_0x8d4f54['query']);_0x145328[_0x8db2('0x29')]=_[_0x8db2('0x28')](_0x8d4f54[_0x8db2('0x24')],qs['fields'](_0x3be281[_0x8db2('0x26')]['fields']));_0x145328[_0x8db2('0x29')]=_0x145328[_0x8db2('0x29')][_0x8db2('0x2a')]?_0x145328['attributes']:_0x8d4f54['model'];if(!_0x3be281[_0x8db2('0x26')][_0x8db2('0x2b')]('nolimit')){_0x145328['limit']=qs[_0x8db2('0xf')](_0x3be281[_0x8db2('0x26')][_0x8db2('0xf')]);_0x145328[_0x8db2('0xd')]=qs[_0x8db2('0xd')](_0x3be281[_0x8db2('0x26')][_0x8db2('0xd')]);}_0x145328[_0x8db2('0x2c')]=qs[_0x8db2('0x2d')](_0x3be281[_0x8db2('0x26')]['sort']);_0x145328[_0x8db2('0x2e')]=qs[_0x8db2('0x2f')](_['pick'](_0x3be281[_0x8db2('0x26')],_0x8d4f54[_0x8db2('0x2f')]),_0x3544ba);if(_0x3be281['query']['filter']){_0x145328[_0x8db2('0x2e')]=_['merge'](_0x145328[_0x8db2('0x2e')],{'$or':_[_0x8db2('0x1e')](_0x3544ba,function(_0x26717d){if(_0x26717d[_0x8db2('0x22')]!=='VIRTUAL'){var _0x2d3e98={};_0x2d3e98[_0x26717d['name']]={'$like':'%'+_0x3be281[_0x8db2('0x26')][_0x8db2('0x30')]+'%'};return _0x2d3e98;}})});}_0x145328=_[_0x8db2('0x31')]({},_0x145328,_0x3be281[_0x8db2('0x32')]);var _0x50e88a={'where':_0x145328['where']};return db[_0x8db2('0x1f')][_0x8db2('0x10')](_0x50e88a)['then'](function(_0x2bac57){_0x58cd9d[_0x8db2('0x10')]=_0x2bac57;if(_0x3be281[_0x8db2('0x26')]['includeAll']){_0x145328[_0x8db2('0x33')]=[{'all':!![]}];}return db[_0x8db2('0x1f')][_0x8db2('0x34')](_0x145328);})[_0x8db2('0x15')](function(_0x2e6f0c){_0x58cd9d[_0x8db2('0x35')]=_0x2e6f0c;return _0x58cd9d;})[_0x8db2('0x15')](respondWithFilteredResult(_0x2baed0,_0x145328))[_0x8db2('0x36')](handleError(_0x2baed0,null));};exports[_0x8db2('0x37')]=function(_0x63c561,_0x21cf7c){var _0x20bf0b={'raw':![],'where':{'id':_0x63c561['params']['id']}},_0x1d9025={};_0x1d9025[_0x8db2('0x24')]=_[_0x8db2('0x27')](db['SquareProject']['rawAttributes']);_0x1d9025[_0x8db2('0x26')]=_['keys'](_0x63c561[_0x8db2('0x26')]);_0x1d9025[_0x8db2('0x2f')]=_[_0x8db2('0x28')](_0x1d9025[_0x8db2('0x24')],_0x1d9025[_0x8db2('0x26')]);_0x20bf0b[_0x8db2('0x29')]=_[_0x8db2('0x28')](_0x1d9025['model'],qs[_0x8db2('0x38')](_0x63c561[_0x8db2('0x26')][_0x8db2('0x38')]));_0x20bf0b[_0x8db2('0x29')]=_0x20bf0b['attributes'][_0x8db2('0x2a')]?_0x20bf0b[_0x8db2('0x29')]:_0x1d9025[_0x8db2('0x24')];if(_0x63c561[_0x8db2('0x26')]['includeAll']){_0x20bf0b[_0x8db2('0x33')]=[{'all':!![]}];}_0x20bf0b=_['merge']({},_0x20bf0b,_0x63c561[_0x8db2('0x32')]);return db[_0x8db2('0x1f')][_0x8db2('0x39')](_0x20bf0b)['then'](handleEntityNotFound(_0x21cf7c,null))['then'](respondWithResult(_0x21cf7c,null))[_0x8db2('0x36')](handleError(_0x21cf7c,null));};exports['create']=function(_0x173cc7,_0x467866){return db[_0x8db2('0x1f')][_0x8db2('0x3a')](_0x173cc7[_0x8db2('0x3b')],{})[_0x8db2('0x15')](function(_0x4355e2){var _0xab6bdd=_0x173cc7[_0x8db2('0x3c')][_0x8db2('0x3d')]({'plain':!![]});if(!_0xab6bdd)throw new Error(_0x8db2('0x3e'));if(_0xab6bdd[_0x8db2('0x3f')]==='user'){var _0x449109=_0x4355e2[_0x8db2('0x3d')]({'plain':!![]});var _0xdbba64=_0x8db2('0x16');return db['UserProfileSection']['find']({'where':{'name':_0xdbba64,'userProfileId':_0xab6bdd[_0x8db2('0x40')]},'raw':!![]})[_0x8db2('0x15')](function(_0x164020){if(_0x164020&&_0x164020['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x449109[_0x8db2('0x25')],'resourceId':_0x449109['id'],'type':_0x164020[_0x8db2('0x25')],'sectionId':_0x164020['id']},{})[_0x8db2('0x15')](function(){return _0x4355e2;});}else{return _0x4355e2;}})[_0x8db2('0x36')](function(_0xaab731){logger[_0x8db2('0x1b')](_0x8db2('0x41'),_0xaab731);throw _0xaab731;});}return _0x4355e2;})['then'](respondWithResult(_0x467866,0xc9))['catch'](handleError(_0x467866,null));};exports[_0x8db2('0x13')]=function(_0x18c6ef,_0x2908e4){if(_0x18c6ef[_0x8db2('0x3b')]['id']){delete _0x18c6ef[_0x8db2('0x3b')]['id'];}return db[_0x8db2('0x1f')][_0x8db2('0x39')]({'where':{'id':_0x18c6ef[_0x8db2('0x42')]['id']}})[_0x8db2('0x15')](handleEntityNotFound(_0x2908e4,null))[_0x8db2('0x15')](saveUpdates(_0x18c6ef[_0x8db2('0x3b')],null))[_0x8db2('0x15')](function(_0x345c74){if(!_0x345c74)return;var _0x2d518a=_0x345c74[_0x8db2('0x3d')]({'plain':!![]});return _0x2d518a;})['then'](function(_0x2ded23){var _0xb4b0a=new Redis(config['redis']);_0xb4b0a[_0x8db2('0x18')](_0x8db2('0x19'),JSON[_0x8db2('0x1a')](_['pick'](_0x2ded23,['id',_0x8db2('0x25'),_0x8db2('0x43')])));return _0x2ded23;})[_0x8db2('0x15')](respondWithResult(_0x2908e4,null))[_0x8db2('0x36')](handleError(_0x2908e4,null));};exports[_0x8db2('0x14')]=function(_0x50fab4,_0x467505){return db[_0x8db2('0x1f')][_0x8db2('0x39')]({'where':{'id':_0x50fab4['params']['id']}})[_0x8db2('0x15')](handleEntityNotFound(_0x467505,null))[_0x8db2('0x15')](removeEntity(_0x467505,null))[_0x8db2('0x36')](handleError(_0x467505,null));};exports[_0x8db2('0x44')]=function(_0x2ac590,_0x16d897){return db[_0x8db2('0x1f')]['find']({'where':{'id':_0x2ac590[_0x8db2('0x42')]['id']}})[_0x8db2('0x15')](handleEntityNotFound(_0x16d897,null))['then'](function(_0x1eeafe){if(_0x1eeafe){return _0x1eeafe[_0x8db2('0x44')](_0x2ac590['body'][_0x8db2('0x45')],_[_0x8db2('0x46')](_0x2ac590[_0x8db2('0x3b')],[_0x8db2('0x45'),'id'])||{});}})[_0x8db2('0x15')](respondWithResult(_0x16d897,null))[_0x8db2('0x36')](handleError(_0x16d897,null));};exports[_0x8db2('0x47')]=function(_0x33a600,_0x120ef2){return db[_0x8db2('0x1f')][_0x8db2('0x39')]({'where':{'id':_0x33a600[_0x8db2('0x42')]['id']}})[_0x8db2('0x15')](handleEntityNotFound(_0x120ef2,null))[_0x8db2('0x15')](function(_0x64ec90){if(_0x64ec90){return _0x64ec90[_0x8db2('0x47')](_0x33a600['query'][_0x8db2('0x45')])[_0x8db2('0x15')](function(){if(_[_0x8db2('0x48')](_0x33a600[_0x8db2('0x26')][_0x8db2('0x45')])){for(var _0x53b2dc=0x0;_0x53b2dc<_0x33a600[_0x8db2('0x26')][_0x8db2('0x45')][_0x8db2('0x2a')];_0x53b2dc+=0x1){socket[_0x8db2('0x49')](_0x8db2('0x4a'),{'UserId':Number(_0x33a600[_0x8db2('0x26')][_0x8db2('0x45')][_0x53b2dc]),'SquareProjectId':Number(_0x33a600[_0x8db2('0x42')]['id'])});}}else{socket[_0x8db2('0x49')](_0x8db2('0x4a'),{'UserId':Number(_0x33a600[_0x8db2('0x26')][_0x8db2('0x45')]),'SquareProjectId':Number(_0x33a600[_0x8db2('0x42')]['id'])});}});}})[_0x8db2('0x15')](respondWithStatusCode(_0x120ef2,null))[_0x8db2('0x36')](handleError(_0x120ef2,null));};exports[_0x8db2('0x4b')]=function(_0x1d7862,_0xefb12){var _0x5a719f={};var _0x3273dd={};var _0x536ac1;var _0x364176;return db['SquareProject'][_0x8db2('0x4c')]({'where':{'id':_0x1d7862[_0x8db2('0x42')]['id']}})[_0x8db2('0x15')](handleEntityNotFound(_0xefb12,null))[_0x8db2('0x15')](function(_0x1e812e){if(_0x1e812e){_0x536ac1=_0x1e812e;_0x3273dd['model']=_['keys'](db[_0x8db2('0x4d')][_0x8db2('0x20')]);_0x3273dd[_0x8db2('0x26')]=_[_0x8db2('0x27')](_0x1d7862[_0x8db2('0x26')]);_0x3273dd[_0x8db2('0x2f')]=_[_0x8db2('0x28')](_0x3273dd[_0x8db2('0x24')],_0x3273dd['query']);_0x5a719f[_0x8db2('0x29')]=_[_0x8db2('0x28')](_0x3273dd[_0x8db2('0x24')],qs[_0x8db2('0x38')](_0x1d7862[_0x8db2('0x26')][_0x8db2('0x38')]));_0x5a719f[_0x8db2('0x29')]=_0x5a719f[_0x8db2('0x29')]['length']?_0x5a719f['attributes']:_0x3273dd[_0x8db2('0x24')];_0x5a719f[_0x8db2('0x2c')]=qs[_0x8db2('0x2d')](_0x1d7862[_0x8db2('0x26')][_0x8db2('0x2d')]);_0x5a719f['where']=qs['filters'](_[_0x8db2('0x4e')](_0x1d7862[_0x8db2('0x26')],_0x3273dd['filters']));if(_0x1d7862[_0x8db2('0x26')][_0x8db2('0x30')]){_0x5a719f[_0x8db2('0x2e')]=_['merge'](_0x5a719f[_0x8db2('0x2e')],{'$or':_[_0x8db2('0x1e')](_0x5a719f[_0x8db2('0x29')],function(_0x4f5458){var _0x3ff023={};_0x3ff023[_0x4f5458]={'$like':'%'+_0x1d7862[_0x8db2('0x26')][_0x8db2('0x30')]+'%'};return _0x3ff023;})});}_0x5a719f=_[_0x8db2('0x31')]({},_0x5a719f,_0x1d7862[_0x8db2('0x32')]);return _0x536ac1['getUsers'](_0x5a719f);}})[_0x8db2('0x15')](function(_0x3023fe){if(_0x3023fe){_0x364176=_0x3023fe[_0x8db2('0x2a')];if(!_0x1d7862['query']['hasOwnProperty'](_0x8db2('0x4f'))){_0x5a719f[_0x8db2('0xf')]=qs['limit'](_0x1d7862[_0x8db2('0x26')][_0x8db2('0xf')]);_0x5a719f[_0x8db2('0xd')]=qs[_0x8db2('0xd')](_0x1d7862[_0x8db2('0x26')][_0x8db2('0xd')]);}return _0x536ac1[_0x8db2('0x4b')](_0x5a719f);}})[_0x8db2('0x15')](function(_0x20b85f){if(_0x20b85f){return _0x20b85f?{'count':_0x364176,'rows':_0x20b85f}:null;}})[_0x8db2('0x15')](respondWithResult(_0xefb12,null))[_0x8db2('0x36')](handleError(_0xefb12,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 7d994c6..feb2e09 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 _0x13fa=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','update'];(function(_0x5d0494,_0xd11a3f){var _0x56f01a=function(_0x548423){while(--_0x548423){_0x5d0494['push'](_0x5d0494['shift']());}};_0x56f01a(++_0xd11a3f);}(_0x13fa,0xc4));var _0xa13f=function(_0x19e57f,_0x4ae750){_0x19e57f=_0x19e57f-0x0;var _0x469556=_0x13fa[_0x19e57f];return _0x469556;};'use strict';var EventEmitter=require(_0xa13f('0x0'));var SquareProject=require(_0xa13f('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xa13f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa13f('0x3'),'afterDestroy':_0xa13f('0x4')};function emitEvent(_0x22bfa6){return function(_0x307e26,_0x2cd13d,_0x299fbf){SquareProjectEvents[_0xa13f('0x5')](_0x22bfa6+':'+_0x307e26['id'],_0x307e26);SquareProjectEvents[_0xa13f('0x5')](_0x22bfa6,_0x307e26);_0x299fbf(null);};}for(var e in events){if(events[_0xa13f('0x6')](e)){var event=events[e];SquareProject[_0xa13f('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0x982e=['hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners','save','remove'];(function(_0x16652c,_0x16d42b){var _0x123b8f=function(_0x3efb75){while(--_0x3efb75){_0x16652c['push'](_0x16652c['shift']());}};_0x123b8f(++_0x16d42b);}(_0x982e,0x6f));var _0xe982=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x982e[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0xe982('0x0'));var SquareProject=require(_0xe982('0x1'))['db'][_0xe982('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xe982('0x3')](0x0);var events={'afterCreate':_0xe982('0x4'),'afterUpdate':'update','afterDestroy':_0xe982('0x5')};function emitEvent(_0x37a9ca){return function(_0x68e212,_0x397daa,_0xccc2b8){SquareProjectEvents['emit'](_0x37a9ca+':'+_0x68e212['id'],_0x68e212);SquareProjectEvents['emit'](_0x37a9ca,_0x68e212);_0xccc2b8(null);};}for(var e in events){if(events[_0xe982('0x6')](e)){var event=events[e];SquareProject[_0xe982('0x7')](e,emitEvent(event));}}module[_0xe982('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 2a88395..3106fb3 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 _0xc734=['../../config/environment','./squareProject.attributes','SquareProject','square_projects','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','publishedAt','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x139d09,_0x1dfea6){var _0x451be0=function(_0x371101){while(--_0x371101){_0x139d09['push'](_0x139d09['shift']());}};_0x451be0(++_0x1dfea6);}(_0xc734,0x1ca));var _0x4c73=function(_0x21353c,_0x2ea587){_0x21353c=_0x21353c-0x0;var _0xa99120=_0xc734[_0x21353c];return _0xa99120;};'use strict';var _=require('lodash');var util=require(_0x4c73('0x0'));var logger=require('../../config/logger')(_0x4c73('0x1'));var moment=require(_0x4c73('0x2'));var BPromise=require(_0x4c73('0x3'));var rp=require(_0x4c73('0x4'));var fs=require('fs');var path=require(_0x4c73('0x5'));var rimraf=require(_0x4c73('0x6'));var config=require(_0x4c73('0x7'));var attributes=require(_0x4c73('0x8'));module['exports']=function(_0x588865,_0x13b503){return _0x588865['define'](_0x4c73('0x9'),attributes,{'tableName':_0x4c73('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x33f775,_0xea6e11,_0x6baed2){if(_0x33f775['changed'](_0x4c73('0xb'))){_0x33f775[_0x4c73('0xc')]=moment()['format'](_0x4c73('0xd'));}if(_0x33f775['changed']('production')){_0x33f775[_0x4c73('0xe')]=moment()['format'](_0x4c73('0xd'));}_0x6baed2(null,_0x33f775);}}});}; \ No newline at end of file +var _0xe15f=['preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed'];(function(_0x4f9bc6,_0x55e292){var _0x36b4de=function(_0xdeb4ce){while(--_0xdeb4ce){_0x4f9bc6['push'](_0x4f9bc6['shift']());}};_0x36b4de(++_0x55e292);}(_0xe15f,0x1d1));var _0xfe15=function(_0x1e6ff0,_0x205627){_0x1e6ff0=_0x1e6ff0-0x0;var _0x293f64=_0xe15f[_0x1e6ff0];return _0x293f64;};'use strict';var _=require(_0xfe15('0x0'));var util=require(_0xfe15('0x1'));var logger=require(_0xfe15('0x2'))(_0xfe15('0x3'));var moment=require(_0xfe15('0x4'));var BPromise=require(_0xfe15('0x5'));var rp=require(_0xfe15('0x6'));var fs=require('fs');var path=require(_0xfe15('0x7'));var rimraf=require('rimraf');var config=require(_0xfe15('0x8'));var attributes=require(_0xfe15('0x9'));module[_0xfe15('0xa')]=function(_0x3e1cea,_0x4e1174){return _0x3e1cea[_0xfe15('0xb')](_0xfe15('0xc'),attributes,{'tableName':_0xfe15('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x35ae34,_0x956bb9,_0x38e9dc){if(_0x35ae34[_0xfe15('0xe')](_0xfe15('0xf'))){_0x35ae34[_0xfe15('0x10')]=moment()[_0xfe15('0x11')](_0xfe15('0x12'));}if(_0x35ae34[_0xfe15('0xe')](_0xfe15('0x13'))){_0x35ae34['publishedAt']=moment()[_0xfe15('0x11')](_0xfe15('0x12'));}_0x38e9dc(null,_0x35ae34);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 1a310bc..6ec193b 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 _0xee0f=['map','then','info','GetSquareProjects','debug','stringify','catch','error','message','ShowSquareProject','find','raw','where','lodash','ioredis','../../mysqldb','../../config/logger','defaults','redis','socket.io-emitter','./squareProject.socket','SquareProject','findAll','options','attributes','limit','include','model'];(function(_0x55f103,_0x35e964){var _0x32d0d8=function(_0x1a1e5d){while(--_0x1a1e5d){_0x55f103['push'](_0x55f103['shift']());}};_0x32d0d8(++_0x35e964);}(_0xee0f,0xb5));var _0xfee0=function(_0x111777,_0x43e893){_0x111777=_0x111777-0x0;var _0x18b652=_0xee0f[_0x111777];return _0x18b652;};'use strict';var _=require(_0xfee0('0x0'));var Redis=require(_0xfee0('0x1'));var db=require(_0xfee0('0x2'))['db'];var logger=require(_0xfee0('0x3'))('rpc');var config=require('../../config/environment');config['redis']=_[_0xfee0('0x4')](config[_0xfee0('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0xfee0('0x6'))(new Redis(config['redis']));require(_0xfee0('0x7'))['register'](socket);exports['GetSquareProjects']=function(_0x9d4806){var _0x6437ee=this;return new Promise(function(_0x197fc8,_0x43b308){return db[_0xfee0('0x8')][_0xfee0('0x9')]({'raw':_0x9d4806[_0xfee0('0xa')]?_0x9d4806[_0xfee0('0xa')]['raw']===undefined?!![]:![]:!![],'where':_0x9d4806[_0xfee0('0xa')]?_0x9d4806['options']['where']||null:null,'attributes':_0x9d4806['options']?_0x9d4806[_0xfee0('0xa')][_0xfee0('0xb')]||null:null,'limit':_0x9d4806['options']?_0x9d4806[_0xfee0('0xa')][_0xfee0('0xc')]||null:null,'include':_0x9d4806[_0xfee0('0xa')]?_0x9d4806[_0xfee0('0xa')][_0xfee0('0xd')]?_['map'](_0x9d4806['options']['include'],function(_0x10fecf){return{'model':db[_0x10fecf[_0xfee0('0xe')]],'as':_0x10fecf['as'],'attributes':_0x10fecf['attributes'],'include':_0x10fecf[_0xfee0('0xd')]?_[_0xfee0('0xf')](_0x10fecf['include'],function(_0x54d92d){return{'model':db[_0x54d92d['model']],'as':_0x54d92d['as'],'attributes':_0x54d92d[_0xfee0('0xb')],'include':_0x54d92d[_0xfee0('0xd')]?_[_0xfee0('0xf')](_0x54d92d[_0xfee0('0xd')],function(_0xa8d1aa){return{'model':db[_0xa8d1aa[_0xfee0('0xe')]],'as':_0xa8d1aa['as'],'attributes':_0xa8d1aa[_0xfee0('0xb')]};}):[]};}):[]};}):[]:[]})[_0xfee0('0x10')](function(_0x436c51){logger[_0xfee0('0x11')](_0xfee0('0x12'),_0x9d4806);logger[_0xfee0('0x13')]('GetSquareProjects',_0x9d4806,JSON[_0xfee0('0x14')](_0x436c51));_0x197fc8(_0x436c51);})[_0xfee0('0x15')](function(_0x1329a1){logger[_0xfee0('0x16')](_0xfee0('0x12'),_0x1329a1[_0xfee0('0x17')],_0x9d4806);_0x43b308(_0x6437ee[_0xfee0('0x16')](0x1f4,_0x1329a1[_0xfee0('0x17')]));});});};exports[_0xfee0('0x18')]=function(_0x33a080){var _0x5635f8=this;return new Promise(function(_0x4a73d9,_0x403e00){return db[_0xfee0('0x8')][_0xfee0('0x19')]({'raw':_0x33a080[_0xfee0('0xa')]?_0x33a080[_0xfee0('0xa')][_0xfee0('0x1a')]===undefined?!![]:![]:!![],'where':_0x33a080[_0xfee0('0xa')]?_0x33a080[_0xfee0('0xa')][_0xfee0('0x1b')]||null:null,'attributes':_0x33a080[_0xfee0('0xa')]?_0x33a080[_0xfee0('0xa')][_0xfee0('0xb')]||null:null,'include':_0x33a080[_0xfee0('0xa')]?_0x33a080[_0xfee0('0xa')][_0xfee0('0xd')]?_[_0xfee0('0xf')](_0x33a080[_0xfee0('0xa')]['include'],function(_0x79b53b){return{'model':db[_0x79b53b[_0xfee0('0xe')]],'as':_0x79b53b['as'],'attributes':_0x79b53b[_0xfee0('0xb')],'include':_0x79b53b[_0xfee0('0xd')]?_['map'](_0x79b53b[_0xfee0('0xd')],function(_0x4c1acd){return{'model':db[_0x4c1acd[_0xfee0('0xe')]],'as':_0x4c1acd['as'],'attributes':_0x4c1acd['attributes'],'include':_0x4c1acd[_0xfee0('0xd')]?_[_0xfee0('0xf')](_0x4c1acd[_0xfee0('0xd')],function(_0x49fb16){return{'model':db[_0x49fb16[_0xfee0('0xe')]],'as':_0x49fb16['as'],'attributes':_0x49fb16['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x505009){logger[_0xfee0('0x11')]('ShowSquareProject',_0x33a080);logger[_0xfee0('0x13')](_0xfee0('0x18'),_0x33a080,JSON[_0xfee0('0x14')](_0x505009));_0x4a73d9(_0x505009);})['catch'](function(_0x549c31){logger[_0xfee0('0x16')](_0xfee0('0x18'),_0x549c31['message'],_0x33a080);_0x403e00(_0x5635f8[_0xfee0('0x16')](0x1f4,_0x549c31[_0xfee0('0x17')]));});});}; \ No newline at end of file +var _0x835b=['GetSquareProjects','findAll','raw','options','where','attributes','include','model','map','debug','stringify','catch','error','message','ShowSquareProject','SquareProject','find','info','lodash','../../mysqldb','../../config/logger','rpc','../../config/environment','defaults','localhost','socket.io-emitter','redis','./squareProject.socket','register'];(function(_0x2e3e49,_0x12128a){var _0x19d151=function(_0x335766){while(--_0x335766){_0x2e3e49['push'](_0x2e3e49['shift']());}};_0x19d151(++_0x12128a);}(_0x835b,0xdd));var _0xb835=function(_0xfb0801,_0x1ae851){_0xfb0801=_0xfb0801-0x0;var _0x1699c3=_0x835b[_0xfb0801];return _0x1699c3;};'use strict';var _=require(_0xb835('0x0'));var Redis=require('ioredis');var db=require(_0xb835('0x1'))['db'];var logger=require(_0xb835('0x2'))(_0xb835('0x3'));var config=require(_0xb835('0x4'));config['redis']=_[_0xb835('0x5')](config['redis'],{'host':_0xb835('0x6'),'port':0x18eb});var socket=require(_0xb835('0x7'))(new Redis(config[_0xb835('0x8')]));require(_0xb835('0x9'))[_0xb835('0xa')](socket);exports[_0xb835('0xb')]=function(_0xb3ab){var _0x304184=this;return new Promise(function(_0x4f4d4f,_0x4985e2){return db['SquareProject'][_0xb835('0xc')]({'raw':_0xb3ab['options']?_0xb3ab['options'][_0xb835('0xd')]===undefined?!![]:![]:!![],'where':_0xb3ab[_0xb835('0xe')]?_0xb3ab[_0xb835('0xe')][_0xb835('0xf')]||null:null,'attributes':_0xb3ab[_0xb835('0xe')]?_0xb3ab['options'][_0xb835('0x10')]||null:null,'limit':_0xb3ab[_0xb835('0xe')]?_0xb3ab['options']['limit']||null:null,'include':_0xb3ab[_0xb835('0xe')]?_0xb3ab[_0xb835('0xe')][_0xb835('0x11')]?_['map'](_0xb3ab[_0xb835('0xe')]['include'],function(_0x97d610){return{'model':db[_0x97d610[_0xb835('0x12')]],'as':_0x97d610['as'],'attributes':_0x97d610[_0xb835('0x10')],'include':_0x97d610[_0xb835('0x11')]?_[_0xb835('0x13')](_0x97d610[_0xb835('0x11')],function(_0x29f933){return{'model':db[_0x29f933[_0xb835('0x12')]],'as':_0x29f933['as'],'attributes':_0x29f933['attributes'],'include':_0x29f933[_0xb835('0x11')]?_[_0xb835('0x13')](_0x29f933[_0xb835('0x11')],function(_0x1fc8dc){return{'model':db[_0x1fc8dc['model']],'as':_0x1fc8dc['as'],'attributes':_0x1fc8dc['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d4fb3){logger['info'](_0xb835('0xb'),_0xb3ab);logger[_0xb835('0x14')](_0xb835('0xb'),_0xb3ab,JSON[_0xb835('0x15')](_0x1d4fb3));_0x4f4d4f(_0x1d4fb3);})[_0xb835('0x16')](function(_0x5b4fe5){logger[_0xb835('0x17')]('GetSquareProjects',_0x5b4fe5[_0xb835('0x18')],_0xb3ab);_0x4985e2(_0x304184[_0xb835('0x17')](0x1f4,_0x5b4fe5[_0xb835('0x18')]));});});};exports[_0xb835('0x19')]=function(_0x42109a){var _0x28fb9a=this;return new Promise(function(_0x4480f6,_0x5ec2b1){return db[_0xb835('0x1a')][_0xb835('0x1b')]({'raw':_0x42109a[_0xb835('0xe')]?_0x42109a[_0xb835('0xe')][_0xb835('0xd')]===undefined?!![]:![]:!![],'where':_0x42109a['options']?_0x42109a[_0xb835('0xe')]['where']||null:null,'attributes':_0x42109a[_0xb835('0xe')]?_0x42109a[_0xb835('0xe')][_0xb835('0x10')]||null:null,'include':_0x42109a['options']?_0x42109a[_0xb835('0xe')][_0xb835('0x11')]?_['map'](_0x42109a[_0xb835('0xe')][_0xb835('0x11')],function(_0x1e9314){return{'model':db[_0x1e9314['model']],'as':_0x1e9314['as'],'attributes':_0x1e9314[_0xb835('0x10')],'include':_0x1e9314[_0xb835('0x11')]?_[_0xb835('0x13')](_0x1e9314[_0xb835('0x11')],function(_0x581070){return{'model':db[_0x581070[_0xb835('0x12')]],'as':_0x581070['as'],'attributes':_0x581070[_0xb835('0x10')],'include':_0x581070[_0xb835('0x11')]?_['map'](_0x581070['include'],function(_0x2c2629){return{'model':db[_0x2c2629[_0xb835('0x12')]],'as':_0x2c2629['as'],'attributes':_0x2c2629['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x59999c){logger[_0xb835('0x1c')](_0xb835('0x19'),_0x42109a);logger[_0xb835('0x14')](_0xb835('0x19'),_0x42109a,JSON['stringify'](_0x59999c));_0x4480f6(_0x59999c);})[_0xb835('0x16')](function(_0x23965d){logger['error']('ShowSquareProject',_0x23965d[_0xb835('0x18')],_0x42109a);_0x5ec2b1(_0x28fb9a[_0xb835('0x17')](0x1f4,_0x23965d[_0xb835('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 7f516e1..453fa9a 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 _0xab51=['length','save','remove','update','register'];(function(_0x36240e,_0xd7c612){var _0x28bf04=function(_0x56cafc){while(--_0x56cafc){_0x36240e['push'](_0x36240e['shift']());}};_0x28bf04(++_0xd7c612);}(_0xab51,0x123));var _0x1ab5=function(_0x43fa81,_0x3cb621){_0x43fa81=_0x43fa81-0x0;var _0x1fc7c6=_0xab51[_0x43fa81];return _0x1fc7c6;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x1ab5('0x0'),_0x1ab5('0x1'),_0x1ab5('0x2')];function createListener(_0x46e892,_0x2c0feb){return function(_0x34c024){_0x2c0feb['emit'](_0x46e892,_0x34c024);};}function removeListener(_0x7bf1d3,_0x5cd386){return function(){SquareProjectEvents['removeListener'](_0x7bf1d3,_0x5cd386);};}exports[_0x1ab5('0x3')]=function(_0xd0c887){for(var _0x4f1b3a=0x0,_0x3ff3b9=events[_0x1ab5('0x4')];_0x4f1b3a<_0x3ff3b9;_0x4f1b3a++){var _0x4bde63=events[_0x4f1b3a];var _0x29f0c2=createListener('squareProject:'+_0x4bde63,_0xd0c887);SquareProjectEvents['on'](_0x4bde63,_0x29f0c2);}}; \ No newline at end of file +var _0xccd1=['save','remove','update','emit','removeListener','register','length','squareProject:'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xccd1,0x88));var _0x1ccd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xccd1[_0x3dd15e];return _0x231fd0;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x1ccd('0x0'),_0x1ccd('0x1'),_0x1ccd('0x2')];function createListener(_0x1b1ae5,_0x71512e){return function(_0x4253ad){_0x71512e[_0x1ccd('0x3')](_0x1b1ae5,_0x4253ad);};}function removeListener(_0x5de36f,_0x53b31d){return function(){SquareProjectEvents[_0x1ccd('0x4')](_0x5de36f,_0x53b31d);};}exports[_0x1ccd('0x5')]=function(_0x106c6a){for(var _0x3cf957=0x0,_0x3f55ec=events[_0x1ccd('0x6')];_0x3cf957<_0x3f55ec;_0x3cf957++){var _0x134099=events[_0x3cf957];var _0x4d89e4=createListener(_0x1ccd('0x7')+_0x134099,_0x106c6a);SquareProjectEvents['on'](_0x134099,_0x4d89e4);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index b3fc5a4..e5e9c92 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete'];(function(_0x5c7eab,_0x224049){var _0x42e92b=function(_0x29374c){while(--_0x29374c){_0x5c7eab['push'](_0x5c7eab['shift']());}};_0x42e92b(++_0x224049);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xc4aa[_0x1928c9];return _0x51b5fb;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router; \ No newline at end of file +var _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(_0x2564cf,_0x213e3e){var _0x27d967=function(_0x1aca64){while(--_0x1aca64){_0x2564cf['push'](_0x2564cf['shift']());}};_0x27d967(++_0x213e3e);}(_0x814b,0x1a2));var _0xb814=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x814b[_0x725b8e];return _0x43ac45;};'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 cc8c2f6..d753c40 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 _0x7dfd=['substring','lastIndexOf','sequelize','exports','STRING','VIRTUAL','savePath'];(function(_0x3774e6,_0x1c7fce){var _0x25ef3a=function(_0x2fb2b9){while(--_0x2fb2b9){_0x3774e6['push'](_0x3774e6['shift']());}};_0x25ef3a(++_0x1c7fce);}(_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')]={'uniqueid':{'type':Sequelize[_0xd7df('0x2')]},'callerid':{'type':Sequelize[_0xd7df('0x2')]},'calleridname':{'type':Sequelize[_0xd7df('0x2')]},'context':{'type':Sequelize[_0xd7df('0x2')]},'extension':{'type':Sequelize[_0xd7df('0x2')]},'priority':{'type':Sequelize[_0xd7df('0x2')]},'accountcode':{'type':Sequelize[_0xd7df('0x2')]},'dnid':{'type':Sequelize[_0xd7df('0x2')]},'projectName':{'type':Sequelize[_0xd7df('0x2')]},'saveName':{'type':Sequelize[_0xd7df('0x2')]},'filename':{'type':Sequelize[_0xd7df('0x2')]},'savePath':{'type':Sequelize[_0xd7df('0x2')]},'format':{'type':Sequelize[_0xd7df('0x3')],'get':function(){var _0x16e50='';var _0x2c48a4=this['getDataValue'](_0xd7df('0x4'));if(_0x2c48a4){_0x16e50=_0x2c48a4[_0xd7df('0x5')](_0x2c48a4[_0xd7df('0x6')]('.'));}return _0x16e50;}}}; \ No newline at end of file +var _0x98a8=['exports','STRING','VIRTUAL','savePath','substring','lastIndexOf','sequelize'];(function(_0x16ec06,_0x1513b5){var _0xee6d30=function(_0x1c056d){while(--_0x1c056d){_0x16ec06['push'](_0x16ec06['shift']());}};_0xee6d30(++_0x1513b5);}(_0x98a8,0x12c));var _0x898a=function(_0x5c2d93,_0x10dd36){_0x5c2d93=_0x5c2d93-0x0;var _0x639b0d=_0x98a8[_0x5c2d93];return _0x639b0d;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'uniqueid':{'type':Sequelize[_0x898a('0x2')]},'callerid':{'type':Sequelize[_0x898a('0x2')]},'calleridname':{'type':Sequelize[_0x898a('0x2')]},'context':{'type':Sequelize[_0x898a('0x2')]},'extension':{'type':Sequelize[_0x898a('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x898a('0x2')]},'dnid':{'type':Sequelize[_0x898a('0x2')]},'projectName':{'type':Sequelize[_0x898a('0x2')]},'saveName':{'type':Sequelize[_0x898a('0x2')]},'filename':{'type':Sequelize[_0x898a('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x898a('0x3')],'get':function(){var _0x564583='';var _0xfa8c50=this['getDataValue'](_0x898a('0x4'));if(_0xfa8c50){_0x564583=_0xfa8c50[_0x898a('0x5')](_0xfa8c50[_0x898a('0x6')]('.'));}return _0x564583;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 0d55f3c..d121969 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 _0x0c95=['decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','download','extname','unlink','message','SquareRecording\x20not\x20found','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','File:\x20\x22','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','SquareRecording','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','../../components/encryptor','uniqueid','filename','savePath','format'];(function(_0x48c06e,_0x4db2cf){var _0x4d1d35=function(_0x19907d){while(--_0x19907d){_0x48c06e['push'](_0x48c06e['shift']());}};_0x4d1d35(++_0x4db2cf);}(_0x0c95,0x1ae));var _0x50c9=function(_0x3d89ce,_0x5d5e4b){_0x3d89ce=_0x3d89ce-0x0;var _0x494a2e=_0x0c95[_0x3d89ce];return _0x494a2e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x50c9('0x0'));var zipdir=require(_0x50c9('0x1'));var jsonpatch=require(_0x50c9('0x2'));var rp=require(_0x50c9('0x3'));var moment=require('moment');var BPromise=require(_0x50c9('0x4'));var Mustache=require(_0x50c9('0x5'));var util=require('util');var path=require(_0x50c9('0x6'));var sox=require(_0x50c9('0x7'));var csv=require(_0x50c9('0x8'));var ejs=require(_0x50c9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x50c9('0xa'));var squel=require(_0x50c9('0xb'));var crypto=require(_0x50c9('0xc'));var jsforce=require(_0x50c9('0xd'));var deskjs=require(_0x50c9('0xe'));var toCsv=require(_0x50c9('0x8'));var querystring=require(_0x50c9('0xf'));var Papa=require(_0x50c9('0x10'));var Redis=require(_0x50c9('0x11'));var authService=require(_0x50c9('0x12'));var qs=require(_0x50c9('0x13'));var as=require(_0x50c9('0x14'));var hardwareService=require(_0x50c9('0x15'));var logger=require(_0x50c9('0x16'))(_0x50c9('0x17'));var utils=require(_0x50c9('0x18'));var config=require(_0x50c9('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x50c9('0x1a'))['db'];function respondWithStatusCode(_0x266f24,_0x19af5d){_0x19af5d=_0x19af5d||0xcc;return function(_0x4292ac){if(_0x4292ac){return _0x266f24[_0x50c9('0x1b')](_0x19af5d);}return _0x266f24[_0x50c9('0x1c')](_0x19af5d)[_0x50c9('0x1d')]();};}function respondWithResult(_0xfca4e3,_0x4fe2b2){_0x4fe2b2=_0x4fe2b2||0xc8;return function(_0x29071a){if(_0x29071a){return _0xfca4e3[_0x50c9('0x1c')](_0x4fe2b2)[_0x50c9('0x1e')](_0x29071a);}};}function respondWithFilteredResult(_0x338cf6,_0x395eae){return function(_0x2f8080){if(_0x2f8080){var _0x4852f0=typeof _0x395eae[_0x50c9('0x1f')]==='undefined'&&typeof _0x395eae[_0x50c9('0x20')]==='undefined';var _0x39e52d=_0x2f8080[_0x50c9('0x21')];var _0xdf03ec=_0x4852f0?0x0:_0x395eae[_0x50c9('0x1f')];var _0xc14172=_0x4852f0?_0x2f8080[_0x50c9('0x21')]:_0x395eae[_0x50c9('0x1f')]+_0x395eae[_0x50c9('0x20')];var _0x56553b;if(_0xc14172>=_0x39e52d){_0xc14172=_0x39e52d;_0x56553b=0xc8;}else{_0x56553b=0xce;}_0x338cf6[_0x50c9('0x1c')](_0x56553b);return _0x338cf6[_0x50c9('0x22')](_0x50c9('0x23'),_0xdf03ec+'-'+_0xc14172+'/'+_0x39e52d)[_0x50c9('0x1e')](_0x2f8080);}return null;};}function patchUpdates(_0x1ea3df){return function(_0x3b1914){try{jsonpatch[_0x50c9('0x24')](_0x3b1914,_0x1ea3df,!![]);}catch(_0x40d109){return BPromise['reject'](_0x40d109);}return _0x3b1914[_0x50c9('0x25')]();};}function saveUpdates(_0x434d29,_0x231d02){return function(_0x2c2e0d){if(_0x2c2e0d){return _0x2c2e0d['update'](_0x434d29)[_0x50c9('0x26')](function(_0x51210a){return _0x51210a;});}return null;};}function removeEntity(_0x895034,_0x30d6d6){return function(_0x2503fe){if(_0x2503fe){return _0x2503fe[_0x50c9('0x27')]()[_0x50c9('0x26')](function(){_0x895034[_0x50c9('0x1c')](0xcc)[_0x50c9('0x1d')]();});}};}function handleEntityNotFound(_0x419894,_0x2c00bd){return function(_0x570a10){if(!_0x570a10){_0x419894[_0x50c9('0x1b')](0x194);}return _0x570a10;};}function handleError(_0xfbf7dc,_0x3a9f0d){_0x3a9f0d=_0x3a9f0d||0x1f4;return function(_0x1ac537){logger[_0x50c9('0x28')](_0x1ac537[_0x50c9('0x29')]);if(_0x1ac537[_0x50c9('0x2a')]){delete _0x1ac537[_0x50c9('0x2a')];}_0xfbf7dc[_0x50c9('0x1c')](_0x3a9f0d)[_0x50c9('0x2b')](_0x1ac537);};}exports[_0x50c9('0x2c')]=function(_0x5e5b78,_0x10069c){var _0x59b3f4={},_0x491e5d={},_0x553dc8={'count':0x0,'rows':[]};var _0x21e9b1=_[_0x50c9('0x2d')](db['SquareRecording'][_0x50c9('0x2e')],function(_0x24b3c0){return{'name':_0x24b3c0[_0x50c9('0x2f')],'type':_0x24b3c0[_0x50c9('0x30')][_0x50c9('0x31')]};});_0x491e5d[_0x50c9('0x32')]=_[_0x50c9('0x2d')](_0x21e9b1,_0x50c9('0x2a'));_0x491e5d['query']=_[_0x50c9('0x33')](_0x5e5b78[_0x50c9('0x34')]);_0x491e5d[_0x50c9('0x35')]=_[_0x50c9('0x36')](_0x491e5d[_0x50c9('0x32')],_0x491e5d['query']);_0x59b3f4[_0x50c9('0x37')]=_[_0x50c9('0x36')](_0x491e5d[_0x50c9('0x32')],qs[_0x50c9('0x38')](_0x5e5b78['query'][_0x50c9('0x38')]));_0x59b3f4[_0x50c9('0x37')]=_0x59b3f4['attributes'][_0x50c9('0x39')]?_0x59b3f4[_0x50c9('0x37')]:_0x491e5d[_0x50c9('0x32')];if(!_0x5e5b78[_0x50c9('0x34')][_0x50c9('0x3a')](_0x50c9('0x3b'))){_0x59b3f4[_0x50c9('0x20')]=qs[_0x50c9('0x20')](_0x5e5b78[_0x50c9('0x34')][_0x50c9('0x20')]);_0x59b3f4['offset']=qs[_0x50c9('0x1f')](_0x5e5b78[_0x50c9('0x34')]['offset']);}_0x59b3f4[_0x50c9('0x3c')]=qs[_0x50c9('0x3d')](_0x5e5b78[_0x50c9('0x34')]['sort']);_0x59b3f4[_0x50c9('0x3e')]=qs[_0x50c9('0x35')](_[_0x50c9('0x3f')](_0x5e5b78[_0x50c9('0x34')],_0x491e5d[_0x50c9('0x35')]),_0x21e9b1);if(_0x5e5b78[_0x50c9('0x34')]['filter']){_0x59b3f4['where']=_['merge'](_0x59b3f4['where'],{'$or':_[_0x50c9('0x2d')](_0x21e9b1,function(_0x50510f){if(_0x50510f[_0x50c9('0x30')]!==_0x50c9('0x40')){var _0x1aa34c={};_0x1aa34c[_0x50510f['name']]={'$like':'%'+_0x5e5b78[_0x50c9('0x34')][_0x50c9('0x41')]+'%'};return _0x1aa34c;}})});}_0x59b3f4=_[_0x50c9('0x42')]({},_0x59b3f4,_0x5e5b78[_0x50c9('0x43')]);var _0x582f3d={'where':_0x59b3f4[_0x50c9('0x3e')]};return db[_0x50c9('0x44')][_0x50c9('0x21')](_0x582f3d)[_0x50c9('0x26')](function(_0x89d37a){_0x553dc8[_0x50c9('0x21')]=_0x89d37a;if(_0x5e5b78[_0x50c9('0x34')][_0x50c9('0x45')]){_0x59b3f4[_0x50c9('0x46')]=[{'all':!![]}];}return db[_0x50c9('0x44')][_0x50c9('0x47')](_0x59b3f4);})[_0x50c9('0x26')](function(_0xc0d564){_0x553dc8[_0x50c9('0x48')]=_0xc0d564;return _0x553dc8;})[_0x50c9('0x26')](respondWithFilteredResult(_0x10069c,_0x59b3f4))[_0x50c9('0x49')](handleError(_0x10069c,null));};exports[_0x50c9('0x4a')]=function(_0x150650,_0x18f608){var _0x29ca93={'raw':!![],'where':{'id':_0x150650[_0x50c9('0x4b')]['id']}},_0x37963c={};_0x37963c['model']=_[_0x50c9('0x33')](db['SquareRecording'][_0x50c9('0x2e')]);_0x37963c[_0x50c9('0x34')]=_[_0x50c9('0x33')](_0x150650['query']);_0x37963c[_0x50c9('0x35')]=_['intersection'](_0x37963c['model'],_0x37963c[_0x50c9('0x34')]);_0x29ca93[_0x50c9('0x37')]=_[_0x50c9('0x36')](_0x37963c[_0x50c9('0x32')],qs[_0x50c9('0x38')](_0x150650['query'][_0x50c9('0x38')]));_0x29ca93['attributes']=_0x29ca93[_0x50c9('0x37')]['length']?_0x29ca93[_0x50c9('0x37')]:_0x37963c[_0x50c9('0x32')];if(_0x150650[_0x50c9('0x34')]['includeAll']){_0x29ca93['include']=[{'all':!![]}];}_0x29ca93=_[_0x50c9('0x42')]({},_0x29ca93,_0x150650[_0x50c9('0x43')]);return db[_0x50c9('0x44')][_0x50c9('0x4c')](_0x29ca93)[_0x50c9('0x26')](handleEntityNotFound(_0x18f608,null))[_0x50c9('0x26')](respondWithResult(_0x18f608,null))[_0x50c9('0x49')](handleError(_0x18f608,null));};exports[_0x50c9('0x4d')]=function(_0x1d127d,_0x38752b){return db['SquareRecording'][_0x50c9('0x4d')](_0x1d127d['body'],{})[_0x50c9('0x26')](respondWithResult(_0x38752b,0xc9))[_0x50c9('0x49')](handleError(_0x38752b,null));};exports[_0x50c9('0x4e')]=function(_0x44bf34,_0x16628e){if(_0x44bf34[_0x50c9('0x4f')]['id']){delete _0x44bf34[_0x50c9('0x4f')]['id'];}return db['SquareRecording']['find']({'where':{'id':_0x44bf34['params']['id']}})[_0x50c9('0x26')](handleEntityNotFound(_0x16628e,null))['then'](saveUpdates(_0x44bf34['body'],null))['then'](respondWithResult(_0x16628e,null))[_0x50c9('0x49')](handleError(_0x16628e,null));};exports['download']=function(_0x53bbf1,_0x59647b,_0x56bf68){var _0x1c4f6c=require(_0x50c9('0x50'));var _0x41fcf2=![];var _0x42393c={};if(_0x53bbf1['query'][_0x50c9('0x30')]&&_0x53bbf1[_0x50c9('0x34')][_0x50c9('0x30')]===_0x50c9('0x51')){_0x42393c['uniqueid']=_0x53bbf1[_0x50c9('0x4b')]['id'];}else{_0x42393c['id']=_0x53bbf1['params']['id'];}return db[_0x50c9('0x44')]['find']({'where':_0x42393c,'attributes':['id','savePath',_0x50c9('0x52')],'raw':!![]})[_0x50c9('0x26')](handleEntityNotFound(_0x59647b,null))[_0x50c9('0x26')](function(_0x5b3fee){if(_0x5b3fee){var _0x27ea49=_0x5b3fee[_0x50c9('0x53')];var _0x3ffd18=util[_0x50c9('0x54')]('%s.cypher',_0x27ea49);if(fs['existsSync'](_0x3ffd18)){_0x41fcf2=!![];return _0x1c4f6c[_0x50c9('0x55')](_0x3ffd18,_0x27ea49,config[_0x50c9('0x56')][_0x50c9('0x57')])[_0x50c9('0x26')](function(){return _0x5b3fee;});}return _0x5b3fee;}})[_0x50c9('0x26')](function(_0x40dd17){if(_0x40dd17){var _0x1daf3a=_0x40dd17['savePath'];if(!fs[_0x50c9('0x58')](_0x1daf3a)){throw new db[(_0x50c9('0x59'))][(_0x50c9('0x5a'))]('SquareRecording\x20not\x20found');}if(_0x40dd17[_0x50c9('0x52')]){return _0x59647b[_0x50c9('0x5b')](_0x1daf3a,_0x40dd17[_0x50c9('0x52')]+path[_0x50c9('0x5c')](_0x1daf3a),function(){if(_0x41fcf2){fs['unlink'](_0x1daf3a);}});}else{return _0x59647b['download'](_0x1daf3a,function(_0x29f254){if(_0x41fcf2){fs[_0x50c9('0x5d')](_0x1daf3a);}});}}})[_0x50c9('0x49')](function(_0x28c88c){if(_0x28c88c[_0x50c9('0x5e')]===_0x50c9('0x5f')){_0x59647b[_0x50c9('0x1c')](0x194)[_0x50c9('0x2b')](_0x50c9('0x60'));}else{return handleError(_0x59647b,null);}});};exports[_0x50c9('0x27')]=function(_0x1e6a94,_0x268f58){return db[_0x50c9('0x44')][_0x50c9('0x4c')]({'where':{'id':_0x1e6a94[_0x50c9('0x4b')]['id']}})[_0x50c9('0x26')](function(_0x3cd84e){if(_['isNil'](_0x3cd84e)){throw new ReferenceError(_0x50c9('0x61'));}return _0x3cd84e;})[_0x50c9('0x26')](function(_0x44249b){var _0x56ce68=_0x44249b[_0x50c9('0x53')];logger[_0x50c9('0x62')](_0x50c9('0x63'),_0x56ce68);if(!_[_0x50c9('0x64')](_0x44249b[_0x50c9('0x53')])&&fs['existsSync'](_0x56ce68)){logger[_0x50c9('0x62')]('File:\x20\x22'+_0x56ce68+_0x50c9('0x65'));fs['unlinkSync'](_0x56ce68);}_0x56ce68=_0x56ce68+'.cypher';if(!_['isNil'](_0x44249b[_0x50c9('0x53')])&&fs[_0x50c9('0x58')](_0x56ce68)){logger[_0x50c9('0x62')](_0x50c9('0x66')+_0x56ce68+_0x50c9('0x65'));fs['unlinkSync'](_0x56ce68);}return _0x44249b;})[_0x50c9('0x26')](function(_0x3ad1e8){if(!_0x3ad1e8)throw new InternalError();return _0x3ad1e8[_0x50c9('0x27')]();})['then'](function(){_0x268f58['status'](0xcc)[_0x50c9('0x1d')]();})[_0x50c9('0x49')](handleError(_0x268f58,null));}; \ No newline at end of file +var _0xd2d8=['limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','map','SquareRecording','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','include','rows','catch','params','includeAll','create','body','find','../../components/encryptor','type','uniqueid','filename','savePath','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','SquareRecording\x20not\x20found','download','unlink','message','Not\x20found','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined'];(function(_0x490f03,_0x427c97){var _0xdd7d93=function(_0x44d463){while(--_0x44d463){_0x490f03['push'](_0x490f03['shift']());}};_0xdd7d93(++_0x427c97);}(_0xd2d8,0x1c4));var _0x8d2d=function(_0x139b85,_0x5e0691){_0x139b85=_0x139b85-0x0;var _0x1e833f=_0xd2d8[_0x139b85];return _0x1e833f;};'use strict';var emlformat=require(_0x8d2d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8d2d('0x1'));var rp=require('request-promise');var moment=require(_0x8d2d('0x2'));var BPromise=require(_0x8d2d('0x3'));var Mustache=require('mustache');var util=require(_0x8d2d('0x4'));var path=require(_0x8d2d('0x5'));var sox=require(_0x8d2d('0x6'));var csv=require(_0x8d2d('0x7'));var ejs=require(_0x8d2d('0x8'));var fs=require('fs');var fs_extra=require(_0x8d2d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8d2d('0xa'));var jsforce=require(_0x8d2d('0xb'));var deskjs=require(_0x8d2d('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8d2d('0xd'));var Papa=require(_0x8d2d('0xe'));var Redis=require('ioredis');var authService=require(_0x8d2d('0xf'));var qs=require(_0x8d2d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8d2d('0x11'))(_0x8d2d('0x12'));var utils=require(_0x8d2d('0x13'));var config=require(_0x8d2d('0x14'));var licenseUtil=require(_0x8d2d('0x15'));var db=require(_0x8d2d('0x16'))['db'];function respondWithStatusCode(_0x374a98,_0x1da087){_0x1da087=_0x1da087||0xcc;return function(_0x563a21){if(_0x563a21){return _0x374a98[_0x8d2d('0x17')](_0x1da087);}return _0x374a98[_0x8d2d('0x18')](_0x1da087)['end']();};}function respondWithResult(_0x3505dc,_0x307174){_0x307174=_0x307174||0xc8;return function(_0x59da8e){if(_0x59da8e){return _0x3505dc['status'](_0x307174)[_0x8d2d('0x19')](_0x59da8e);}};}function respondWithFilteredResult(_0x1892b7,_0x777a0e){return function(_0x337c6e){if(_0x337c6e){var _0x43d346=typeof _0x777a0e[_0x8d2d('0x1a')]===_0x8d2d('0x1b')&&typeof _0x777a0e[_0x8d2d('0x1c')]===_0x8d2d('0x1b');var _0x58344f=_0x337c6e[_0x8d2d('0x1d')];var _0x4d839b=_0x43d346?0x0:_0x777a0e[_0x8d2d('0x1a')];var _0x26382c=_0x43d346?_0x337c6e['count']:_0x777a0e['offset']+_0x777a0e[_0x8d2d('0x1c')];var _0x39eeaf;if(_0x26382c>=_0x58344f){_0x26382c=_0x58344f;_0x39eeaf=0xc8;}else{_0x39eeaf=0xce;}_0x1892b7['status'](_0x39eeaf);return _0x1892b7[_0x8d2d('0x1e')](_0x8d2d('0x1f'),_0x4d839b+'-'+_0x26382c+'/'+_0x58344f)[_0x8d2d('0x19')](_0x337c6e);}return null;};}function patchUpdates(_0x2eca6b){return function(_0x3d7d25){try{jsonpatch[_0x8d2d('0x20')](_0x3d7d25,_0x2eca6b,!![]);}catch(_0x49e45e){return BPromise[_0x8d2d('0x21')](_0x49e45e);}return _0x3d7d25[_0x8d2d('0x22')]();};}function saveUpdates(_0x5005fc,_0x4316e8){return function(_0x1a61d4){if(_0x1a61d4){return _0x1a61d4[_0x8d2d('0x23')](_0x5005fc)[_0x8d2d('0x24')](function(_0x4de432){return _0x4de432;});}return null;};}function removeEntity(_0x416273,_0x4af57d){return function(_0x32bfda){if(_0x32bfda){return _0x32bfda['destroy']()['then'](function(){_0x416273[_0x8d2d('0x18')](0xcc)[_0x8d2d('0x25')]();});}};}function handleEntityNotFound(_0x2f69bb,_0x31a8b7){return function(_0x277198){if(!_0x277198){_0x2f69bb[_0x8d2d('0x17')](0x194);}return _0x277198;};}function handleError(_0x2c1b2d,_0x3ccf2c){_0x3ccf2c=_0x3ccf2c||0x1f4;return function(_0x5ca3cb){logger[_0x8d2d('0x26')](_0x5ca3cb[_0x8d2d('0x27')]);if(_0x5ca3cb[_0x8d2d('0x28')]){delete _0x5ca3cb[_0x8d2d('0x28')];}_0x2c1b2d['status'](_0x3ccf2c)[_0x8d2d('0x29')](_0x5ca3cb);};}exports['index']=function(_0x2b51fc,_0x521c52){var _0x3d6634={},_0x101f1c={},_0x55c525={'count':0x0,'rows':[]};var _0x561f09=_[_0x8d2d('0x2a')](db[_0x8d2d('0x2b')][_0x8d2d('0x2c')],function(_0x202e52){return{'name':_0x202e52[_0x8d2d('0x2d')],'type':_0x202e52['type'][_0x8d2d('0x2e')]};});_0x101f1c[_0x8d2d('0x2f')]=_[_0x8d2d('0x2a')](_0x561f09,_0x8d2d('0x28'));_0x101f1c[_0x8d2d('0x30')]=_[_0x8d2d('0x31')](_0x2b51fc[_0x8d2d('0x30')]);_0x101f1c[_0x8d2d('0x32')]=_[_0x8d2d('0x33')](_0x101f1c[_0x8d2d('0x2f')],_0x101f1c['query']);_0x3d6634[_0x8d2d('0x34')]=_[_0x8d2d('0x33')](_0x101f1c['model'],qs[_0x8d2d('0x35')](_0x2b51fc[_0x8d2d('0x30')][_0x8d2d('0x35')]));_0x3d6634['attributes']=_0x3d6634[_0x8d2d('0x34')][_0x8d2d('0x36')]?_0x3d6634[_0x8d2d('0x34')]:_0x101f1c['model'];if(!_0x2b51fc[_0x8d2d('0x30')][_0x8d2d('0x37')]('nolimit')){_0x3d6634[_0x8d2d('0x1c')]=qs[_0x8d2d('0x1c')](_0x2b51fc[_0x8d2d('0x30')][_0x8d2d('0x1c')]);_0x3d6634['offset']=qs[_0x8d2d('0x1a')](_0x2b51fc[_0x8d2d('0x30')][_0x8d2d('0x1a')]);}_0x3d6634[_0x8d2d('0x38')]=qs[_0x8d2d('0x39')](_0x2b51fc[_0x8d2d('0x30')][_0x8d2d('0x39')]);_0x3d6634['where']=qs['filters'](_[_0x8d2d('0x3a')](_0x2b51fc[_0x8d2d('0x30')],_0x101f1c[_0x8d2d('0x32')]),_0x561f09);if(_0x2b51fc[_0x8d2d('0x30')][_0x8d2d('0x3b')]){_0x3d6634[_0x8d2d('0x3c')]=_['merge'](_0x3d6634['where'],{'$or':_[_0x8d2d('0x2a')](_0x561f09,function(_0xab4a78){if(_0xab4a78['type']!==_0x8d2d('0x3d')){var _0x48e867={};_0x48e867[_0xab4a78['name']]={'$like':'%'+_0x2b51fc[_0x8d2d('0x30')][_0x8d2d('0x3b')]+'%'};return _0x48e867;}})});}_0x3d6634=_[_0x8d2d('0x3e')]({},_0x3d6634,_0x2b51fc[_0x8d2d('0x3f')]);var _0x2fe85d={'where':_0x3d6634[_0x8d2d('0x3c')]};return db[_0x8d2d('0x2b')][_0x8d2d('0x1d')](_0x2fe85d)[_0x8d2d('0x24')](function(_0x27a41c){_0x55c525[_0x8d2d('0x1d')]=_0x27a41c;if(_0x2b51fc['query']['includeAll']){_0x3d6634[_0x8d2d('0x40')]=[{'all':!![]}];}return db[_0x8d2d('0x2b')]['findAll'](_0x3d6634);})[_0x8d2d('0x24')](function(_0x74bad3){_0x55c525[_0x8d2d('0x41')]=_0x74bad3;return _0x55c525;})[_0x8d2d('0x24')](respondWithFilteredResult(_0x521c52,_0x3d6634))[_0x8d2d('0x42')](handleError(_0x521c52,null));};exports['show']=function(_0x5f1fcf,_0x12af4e){var _0x441080={'raw':!![],'where':{'id':_0x5f1fcf[_0x8d2d('0x43')]['id']}},_0x761254={};_0x761254[_0x8d2d('0x2f')]=_[_0x8d2d('0x31')](db[_0x8d2d('0x2b')][_0x8d2d('0x2c')]);_0x761254[_0x8d2d('0x30')]=_['keys'](_0x5f1fcf['query']);_0x761254['filters']=_['intersection'](_0x761254[_0x8d2d('0x2f')],_0x761254[_0x8d2d('0x30')]);_0x441080[_0x8d2d('0x34')]=_[_0x8d2d('0x33')](_0x761254[_0x8d2d('0x2f')],qs[_0x8d2d('0x35')](_0x5f1fcf[_0x8d2d('0x30')]['fields']));_0x441080[_0x8d2d('0x34')]=_0x441080['attributes'][_0x8d2d('0x36')]?_0x441080['attributes']:_0x761254[_0x8d2d('0x2f')];if(_0x5f1fcf[_0x8d2d('0x30')][_0x8d2d('0x44')]){_0x441080[_0x8d2d('0x40')]=[{'all':!![]}];}_0x441080=_[_0x8d2d('0x3e')]({},_0x441080,_0x5f1fcf['options']);return db[_0x8d2d('0x2b')]['find'](_0x441080)[_0x8d2d('0x24')](handleEntityNotFound(_0x12af4e,null))[_0x8d2d('0x24')](respondWithResult(_0x12af4e,null))[_0x8d2d('0x42')](handleError(_0x12af4e,null));};exports[_0x8d2d('0x45')]=function(_0x5eeea8,_0x581801){return db[_0x8d2d('0x2b')][_0x8d2d('0x45')](_0x5eeea8[_0x8d2d('0x46')],{})['then'](respondWithResult(_0x581801,0xc9))[_0x8d2d('0x42')](handleError(_0x581801,null));};exports['update']=function(_0x503079,_0xf1222f){if(_0x503079[_0x8d2d('0x46')]['id']){delete _0x503079[_0x8d2d('0x46')]['id'];}return db[_0x8d2d('0x2b')][_0x8d2d('0x47')]({'where':{'id':_0x503079['params']['id']}})[_0x8d2d('0x24')](handleEntityNotFound(_0xf1222f,null))[_0x8d2d('0x24')](saveUpdates(_0x503079['body'],null))['then'](respondWithResult(_0xf1222f,null))[_0x8d2d('0x42')](handleError(_0xf1222f,null));};exports['download']=function(_0x2af163,_0x4a33cf,_0x5b0dbc){var _0x13ddf8=require(_0x8d2d('0x48'));var _0x344cf4=![];var _0x127c5e={};if(_0x2af163[_0x8d2d('0x30')][_0x8d2d('0x49')]&&_0x2af163[_0x8d2d('0x30')][_0x8d2d('0x49')]===_0x8d2d('0x4a')){_0x127c5e[_0x8d2d('0x4a')]=_0x2af163[_0x8d2d('0x43')]['id'];}else{_0x127c5e['id']=_0x2af163[_0x8d2d('0x43')]['id'];}return db['SquareRecording'][_0x8d2d('0x47')]({'where':_0x127c5e,'attributes':['id','savePath',_0x8d2d('0x4b')],'raw':!![]})[_0x8d2d('0x24')](handleEntityNotFound(_0x4a33cf,null))[_0x8d2d('0x24')](function(_0x11cf8c){if(_0x11cf8c){var _0x590d32=_0x11cf8c[_0x8d2d('0x4c')];var _0x34b3f8=util['format'](_0x8d2d('0x4d'),_0x590d32);if(fs[_0x8d2d('0x4e')](_0x34b3f8)){_0x344cf4=!![];return _0x13ddf8[_0x8d2d('0x4f')](_0x34b3f8,_0x590d32,config[_0x8d2d('0x50')][_0x8d2d('0x51')])[_0x8d2d('0x24')](function(){return _0x11cf8c;});}return _0x11cf8c;}})['then'](function(_0x3f6c1a){if(_0x3f6c1a){var _0x44c584=_0x3f6c1a[_0x8d2d('0x4c')];if(!fs[_0x8d2d('0x4e')](_0x44c584)){throw new db[(_0x8d2d('0x52'))]['ValidationError'](_0x8d2d('0x53'));}if(_0x3f6c1a[_0x8d2d('0x4b')]){return _0x4a33cf[_0x8d2d('0x54')](_0x44c584,_0x3f6c1a['filename']+path['extname'](_0x44c584),function(){if(_0x344cf4){fs[_0x8d2d('0x55')](_0x44c584);}});}else{return _0x4a33cf[_0x8d2d('0x54')](_0x44c584,function(_0x36bc1d){if(_0x344cf4){fs[_0x8d2d('0x55')](_0x44c584);}});}}})[_0x8d2d('0x42')](function(_0x2595e7){if(_0x2595e7[_0x8d2d('0x56')]===_0x8d2d('0x53')){_0x4a33cf['status'](0x194)[_0x8d2d('0x29')](_0x8d2d('0x57'));}else{return handleError(_0x4a33cf,null);}});};exports[_0x8d2d('0x58')]=function(_0x40cb5e,_0x11de64){return db[_0x8d2d('0x2b')][_0x8d2d('0x47')]({'where':{'id':_0x40cb5e['params']['id']}})[_0x8d2d('0x24')](function(_0x107d85){if(_[_0x8d2d('0x59')](_0x107d85)){throw new ReferenceError('Entity\x20not\x20found');}return _0x107d85;})['then'](function(_0x20ac9e){var _0xc2f2d3=_0x20ac9e[_0x8d2d('0x4c')];logger[_0x8d2d('0x5a')](_0x8d2d('0x5b'),_0xc2f2d3);if(!_['isNil'](_0x20ac9e[_0x8d2d('0x4c')])&&fs[_0x8d2d('0x4e')](_0xc2f2d3)){logger[_0x8d2d('0x5a')](_0x8d2d('0x5c')+_0xc2f2d3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x8d2d('0x5d')](_0xc2f2d3);}_0xc2f2d3=_0xc2f2d3+_0x8d2d('0x5e');if(!_[_0x8d2d('0x59')](_0x20ac9e[_0x8d2d('0x4c')])&&fs[_0x8d2d('0x4e')](_0xc2f2d3)){logger[_0x8d2d('0x5a')]('File:\x20\x22'+_0xc2f2d3+_0x8d2d('0x5f'));fs[_0x8d2d('0x5d')](_0xc2f2d3);}return _0x20ac9e;})['then'](function(_0x5a8467){if(!_0x5a8467)throw new InternalError();return _0x5a8467[_0x8d2d('0x58')]();})[_0x8d2d('0x24')](function(){_0x11de64[_0x8d2d('0x18')](0xcc)[_0x8d2d('0x25')]();})[_0x8d2d('0x42')](handleError(_0x11de64,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 4076e14..1ab4989 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 _0x6c99=['SquareRecording','square_recordings','lodash','../../config/logger','rimraf','../../config/environment','./squareRecording.attributes','exports','define'];(function(_0x76ea4a,_0x24a09d){var _0x5484b2=function(_0x599e13){while(--_0x599e13){_0x76ea4a['push'](_0x76ea4a['shift']());}};_0x5484b2(++_0x24a09d);}(_0x6c99,0x9b));var _0x96c9=function(_0xabfec4,_0x35076e){_0xabfec4=_0xabfec4-0x0;var _0x7bafa2=_0x6c99[_0xabfec4];return _0x7bafa2;};'use strict';var _=require(_0x96c9('0x0'));var util=require('util');var logger=require(_0x96c9('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x96c9('0x2'));var config=require(_0x96c9('0x3'));var attributes=require(_0x96c9('0x4'));module[_0x96c9('0x5')]=function(_0x4c175f,_0x3bb16a){return _0x4c175f[_0x96c9('0x6')](_0x96c9('0x7'),attributes,{'tableName':_0x96c9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8579=['exports','define','SquareRecording','square_recordings','lodash','util','api','moment','bluebird','request-promise'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x8579,0x16c));var _0x9857=function(_0x11a4d7,_0x4b339f){_0x11a4d7=_0x11a4d7-0x0;var _0x40bb5d=_0x8579[_0x11a4d7];return _0x40bb5d;};'use strict';var _=require(_0x9857('0x0'));var util=require(_0x9857('0x1'));var logger=require('../../config/logger')(_0x9857('0x2'));var moment=require(_0x9857('0x3'));var BPromise=require(_0x9857('0x4'));var rp=require(_0x9857('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareRecording.attributes');module[_0x9857('0x6')]=function(_0x1e72cd,_0x472eab){return _0x1e72cd[_0x9857('0x7')](_0x9857('0x8'),attributes,{'tableName':_0x9857('0x9'),'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 a944b95..22f713e 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 _0x7f59=['create','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','CreateSquareRecording'];(function(_0x11a2af,_0x221376){var _0x27e1fe=function(_0x3bba7c){while(--_0x3bba7c){_0x11a2af['push'](_0x11a2af['shift']());}};_0x27e1fe(++_0x221376);}(_0x7f59,0x19b));var _0x97f5=function(_0x41efc6,_0x2daabf){_0x41efc6=_0x41efc6-0x0;var _0x44f98a=_0x7f59[_0x41efc6];return _0x44f98a;};'use strict';var _=require(_0x97f5('0x0'));var util=require('util');var moment=require(_0x97f5('0x1'));var BPromise=require(_0x97f5('0x2'));var rs=require(_0x97f5('0x3'));var fs=require('fs');var Redis=require(_0x97f5('0x4'));var db=require(_0x97f5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x97f5('0x6'))(_0x97f5('0x7'));var config=require('../../config/environment');var jayson=require(_0x97f5('0x8'));var client=jayson[_0x97f5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6bbc09,_0x18192c,_0x3a8f2a){return new BPromise(function(_0x59c01b,_0x5e45c9){return client[_0x97f5('0xa')](_0x6bbc09,_0x3a8f2a)[_0x97f5('0xb')](function(_0x2ef1a5){logger[_0x97f5('0xc')](_0x97f5('0xd'),_0x18192c,_0x97f5('0xe'));logger[_0x97f5('0xf')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x18192c,_0x97f5('0xe'),JSON[_0x97f5('0x10')](_0x2ef1a5));if(_0x2ef1a5[_0x97f5('0x11')]){if(_0x2ef1a5[_0x97f5('0x11')]['code']===0x1f4){logger['error'](_0x97f5('0xd'),_0x18192c,_0x2ef1a5[_0x97f5('0x11')][_0x97f5('0x12')]);return _0x5e45c9(_0x2ef1a5[_0x97f5('0x11')][_0x97f5('0x12')]);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x18192c,_0x2ef1a5[_0x97f5('0x11')]['message']);return _0x59c01b(_0x2ef1a5[_0x97f5('0x11')]['message']);}else{logger['info'](_0x97f5('0xd'),_0x18192c,_0x97f5('0xe'));_0x59c01b(_0x2ef1a5[_0x97f5('0x13')]['message']);}})['catch'](function(_0x1f701a){logger[_0x97f5('0x11')](_0x97f5('0xd'),_0x18192c,_0x1f701a);_0x5e45c9(_0x1f701a);});});}exports[_0x97f5('0x14')]=function(_0x2dbcdb){var _0x4f8d50=this;return new Promise(function(_0x8529e9,_0x194395){return db['SquareRecording'][_0x97f5('0x15')](_0x2dbcdb['body'],{'raw':_0x2dbcdb['options']?_0x2dbcdb[_0x97f5('0x16')][_0x97f5('0x17')]===undefined?!![]:![]:!![]})[_0x97f5('0xb')](function(_0x52f926){logger['info'](_0x97f5('0x14'),_0x2dbcdb);logger[_0x97f5('0xf')]('CreateSquareRecording',_0x2dbcdb,JSON['stringify'](_0x52f926));_0x8529e9(_0x52f926);})['catch'](function(_0x28dbe9){logger[_0x97f5('0x11')](_0x97f5('0x14'),_0x28dbe9[_0x97f5('0x12')],_0x2dbcdb);_0x194395(_0x4f8d50[_0x97f5('0x11')](0x1f4,_0x28dbe9[_0x97f5('0x12')]));});});}; \ No newline at end of file +var _0x8836=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSquareRecording','body','raw','lodash','util'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x8836,0x6e));var _0x6883=function(_0x2cbccd,_0x28fd0d){_0x2cbccd=_0x2cbccd-0x0;var _0x50aa15=_0x8836[_0x2cbccd];return _0x50aa15;};'use strict';var _=require(_0x6883('0x0'));var util=require(_0x6883('0x1'));var moment=require(_0x6883('0x2'));var BPromise=require(_0x6883('0x3'));var rs=require(_0x6883('0x4'));var fs=require('fs');var Redis=require(_0x6883('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6883('0x6'));var logger=require(_0x6883('0x7'))(_0x6883('0x8'));var config=require(_0x6883('0x9'));var jayson=require(_0x6883('0xa'));var client=jayson[_0x6883('0xb')][_0x6883('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2aae9a,_0x4c8e1e,_0xe6f9a4){return new BPromise(function(_0x52af70,_0x5f073e){return client[_0x6883('0xd')](_0x2aae9a,_0xe6f9a4)[_0x6883('0xe')](function(_0x3c60ab){logger[_0x6883('0xf')](_0x6883('0x10'),_0x4c8e1e,'request\x20sent');logger[_0x6883('0x11')](_0x6883('0x12'),_0x4c8e1e,_0x6883('0x13'),JSON[_0x6883('0x14')](_0x3c60ab));if(_0x3c60ab[_0x6883('0x15')]){if(_0x3c60ab['error']['code']===0x1f4){logger[_0x6883('0x15')]('SquareRecording,\x20%s,\x20%s',_0x4c8e1e,_0x3c60ab[_0x6883('0x15')][_0x6883('0x16')]);return _0x5f073e(_0x3c60ab[_0x6883('0x15')]['message']);}logger[_0x6883('0x15')](_0x6883('0x10'),_0x4c8e1e,_0x3c60ab[_0x6883('0x15')]['message']);return _0x52af70(_0x3c60ab[_0x6883('0x15')][_0x6883('0x16')]);}else{logger[_0x6883('0xf')](_0x6883('0x10'),_0x4c8e1e,'request\x20sent');_0x52af70(_0x3c60ab[_0x6883('0x17')][_0x6883('0x16')]);}})[_0x6883('0x18')](function(_0x3387a0){logger[_0x6883('0x15')](_0x6883('0x10'),_0x4c8e1e,_0x3387a0);_0x5f073e(_0x3387a0);});});}exports[_0x6883('0x19')]=function(_0x2469e7){var _0x7b73d4=this;return new Promise(function(_0x323adb,_0x40be84){return db['SquareRecording']['create'](_0x2469e7[_0x6883('0x1a')],{'raw':_0x2469e7['options']?_0x2469e7['options'][_0x6883('0x1b')]===undefined?!![]:![]:!![]})[_0x6883('0xe')](function(_0xfc62e3){logger['info'](_0x6883('0x19'),_0x2469e7);logger[_0x6883('0x11')](_0x6883('0x19'),_0x2469e7,JSON['stringify'](_0xfc62e3));_0x323adb(_0xfc62e3);})[_0x6883('0x18')](function(_0xce0b14){logger[_0x6883('0x15')]('CreateSquareRecording',_0xce0b14[_0x6883('0x16')],_0x2469e7);_0x40be84(_0x7b73d4[_0x6883('0x15')](0x1f4,_0xce0b14[_0x6883('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 8f4cdaf..363bcc1 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 _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(_0x185133,_0x29a472){var _0x862f7f=function(_0x25ea87){while(--_0x25ea87){_0x185133['push'](_0x185133['shift']());}};_0x862f7f(++_0x29a472);}(_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('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x358825,_0x50b369){var _0x3f003f=function(_0x557674){while(--_0x557674){_0x358825['push'](_0x358825['shift']());}};_0x3f003f(++_0x50b369);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 2a2410a..e723488 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 _0x4a52=['DATE','sequelize','STRING'];(function(_0x300641,_0x4425f4){var _0x5539bd=function(_0x248fcf){while(--_0x248fcf){_0x300641['push'](_0x300641['shift']());}};_0x5539bd(++_0x4425f4);}(_0x4a52,0x15d));var _0x24a5=function(_0x5cb4f8,_0x376e9a){_0x5cb4f8=_0x5cb4f8-0x0;var _0x54be5c=_0x4a52[_0x5cb4f8];return _0x54be5c;};'use strict';var Sequelize=require(_0x24a5('0x0'));module['exports']={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x24a5('0x1')]},'request':{'type':Sequelize[_0x24a5('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x24a5('0x1')]},'type':{'type':Sequelize[_0x24a5('0x1')]},'uniqueid':{'type':Sequelize[_0x24a5('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x24a5('0x1')]},'calleridname':{'type':Sequelize[_0x24a5('0x1')]},'callingpres':{'type':Sequelize[_0x24a5('0x1')]},'callingani2':{'type':Sequelize[_0x24a5('0x1')]},'callington':{'type':Sequelize[_0x24a5('0x1')]},'callingtns':{'type':Sequelize[_0x24a5('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x24a5('0x1')]},'extension':{'type':Sequelize[_0x24a5('0x1')]},'priority':{'type':Sequelize[_0x24a5('0x1')]},'enhanced':{'type':Sequelize[_0x24a5('0x1')]},'accountcode':{'type':Sequelize[_0x24a5('0x1')]},'threadid':{'type':Sequelize[_0x24a5('0x1')]},'project_name':{'type':Sequelize[_0x24a5('0x1')]},'joinAt':{'type':Sequelize[_0x24a5('0x2')]},'leaveAt':{'type':Sequelize[_0x24a5('0x2')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x2232=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x1836ac,_0x55327a){var _0x3ad58c=function(_0x4427b4){while(--_0x4427b4){_0x1836ac['push'](_0x1836ac['shift']());}};_0x3ad58c(++_0x55327a);}(_0x2232,0xd2));var _0x2223=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2232[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x2223('0x0'));module[_0x2223('0x1')]={'network':{'type':Sequelize[_0x2223('0x2')]},'network_script':{'type':Sequelize[_0x2223('0x2')]},'request':{'type':Sequelize[_0x2223('0x2')]},'channel':{'type':Sequelize[_0x2223('0x2')]},'language':{'type':Sequelize[_0x2223('0x2')]},'type':{'type':Sequelize[_0x2223('0x2')]},'uniqueid':{'type':Sequelize[_0x2223('0x2')]},'version':{'type':Sequelize[_0x2223('0x2')]},'callerid':{'type':Sequelize[_0x2223('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x2223('0x2')]},'callingani2':{'type':Sequelize[_0x2223('0x2')]},'callington':{'type':Sequelize[_0x2223('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x2223('0x2')]},'context':{'type':Sequelize[_0x2223('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x2223('0x2')]},'enhanced':{'type':Sequelize[_0x2223('0x2')]},'accountcode':{'type':Sequelize[_0x2223('0x2')]},'threadid':{'type':Sequelize[_0x2223('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x2223('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x2223('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index c5701ae..0a02f65 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 _0xb604=['path','sox','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','map','SquareReport','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','length','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x48c841,_0x27374a){var _0x22c86f=function(_0x1288fe){while(--_0x1288fe){_0x48c841['push'](_0x48c841['shift']());}};_0x22c86f(++_0x27374a);}(_0xb604,0x173));var _0x4b60=function(_0x42baed,_0x46cef3){_0x42baed=_0x42baed-0x0;var _0x17add3=_0xb604[_0x42baed];return _0x17add3;};'use strict';var emlformat=require(_0x4b60('0x0'));var rimraf=require(_0x4b60('0x1'));var zipdir=require(_0x4b60('0x2'));var jsonpatch=require(_0x4b60('0x3'));var rp=require(_0x4b60('0x4'));var moment=require(_0x4b60('0x5'));var BPromise=require(_0x4b60('0x6'));var Mustache=require(_0x4b60('0x7'));var util=require(_0x4b60('0x8'));var path=require(_0x4b60('0x9'));var sox=require(_0x4b60('0xa'));var csv=require('to-csv');var ejs=require(_0x4b60('0xb'));var fs=require('fs');var fs_extra=require(_0x4b60('0xc'));var _=require(_0x4b60('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4b60('0xe'));var deskjs=require(_0x4b60('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4b60('0x10'));var Papa=require(_0x4b60('0x11'));var Redis=require(_0x4b60('0x12'));var authService=require(_0x4b60('0x13'));var qs=require(_0x4b60('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b60('0x15'))(_0x4b60('0x16'));var utils=require(_0x4b60('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4b60('0x18'));var db=require(_0x4b60('0x19'))['db'];function respondWithStatusCode(_0x31a10e,_0xfd5204){_0xfd5204=_0xfd5204||0xcc;return function(_0x179fbf){if(_0x179fbf){return _0x31a10e[_0x4b60('0x1a')](_0xfd5204);}return _0x31a10e[_0x4b60('0x1b')](_0xfd5204)[_0x4b60('0x1c')]();};}function respondWithResult(_0x30a9df,_0x18c1e4){_0x18c1e4=_0x18c1e4||0xc8;return function(_0x508335){if(_0x508335){return _0x30a9df[_0x4b60('0x1b')](_0x18c1e4)[_0x4b60('0x1d')](_0x508335);}};}function respondWithFilteredResult(_0x49467b,_0x58e125){return function(_0x72175a){if(_0x72175a){var _0x568b10=typeof _0x58e125[_0x4b60('0x1e')]===_0x4b60('0x1f')&&typeof _0x58e125[_0x4b60('0x20')]==='undefined';var _0x732c9a=_0x72175a[_0x4b60('0x21')];var _0x2d5bda=_0x568b10?0x0:_0x58e125[_0x4b60('0x1e')];var _0x243e94=_0x568b10?_0x72175a[_0x4b60('0x21')]:_0x58e125[_0x4b60('0x1e')]+_0x58e125['limit'];var _0x13b093;if(_0x243e94>=_0x732c9a){_0x243e94=_0x732c9a;_0x13b093=0xc8;}else{_0x13b093=0xce;}_0x49467b[_0x4b60('0x1b')](_0x13b093);return _0x49467b[_0x4b60('0x22')](_0x4b60('0x23'),_0x2d5bda+'-'+_0x243e94+'/'+_0x732c9a)['json'](_0x72175a);}return null;};}function patchUpdates(_0xfe3e2c){return function(_0x4f9ff7){try{jsonpatch['apply'](_0x4f9ff7,_0xfe3e2c,!![]);}catch(_0x407a23){return BPromise[_0x4b60('0x24')](_0x407a23);}return _0x4f9ff7[_0x4b60('0x25')]();};}function saveUpdates(_0x5e4de4,_0x3ad523){return function(_0x198d43){if(_0x198d43){return _0x198d43[_0x4b60('0x26')](_0x5e4de4)[_0x4b60('0x27')](function(_0x1a198c){return _0x1a198c;});}return null;};}function removeEntity(_0x23a5a3,_0x5786fa){return function(_0x5b580a){if(_0x5b580a){return _0x5b580a[_0x4b60('0x28')]()[_0x4b60('0x27')](function(){_0x23a5a3[_0x4b60('0x1b')](0xcc)[_0x4b60('0x1c')]();});}};}function handleEntityNotFound(_0x36898d,_0x4ce282){return function(_0x7843a2){if(!_0x7843a2){_0x36898d['sendStatus'](0x194);}return _0x7843a2;};}function handleError(_0x35369e,_0x444b7d){_0x444b7d=_0x444b7d||0x1f4;return function(_0x1179d6){logger[_0x4b60('0x29')](_0x1179d6[_0x4b60('0x2a')]);if(_0x1179d6['name']){delete _0x1179d6[_0x4b60('0x2b')];}_0x35369e[_0x4b60('0x1b')](_0x444b7d)['send'](_0x1179d6);};}exports['index']=function(_0x110f2e,_0x335ad3){var _0x2cbac0={},_0x5683d5={},_0xb0b8d4={'count':0x0,'rows':[]};var _0x4f1115=_[_0x4b60('0x2c')](db[_0x4b60('0x2d')]['rawAttributes'],function(_0x358142){return{'name':_0x358142[_0x4b60('0x2e')],'type':_0x358142['type'][_0x4b60('0x2f')]};});_0x5683d5[_0x4b60('0x30')]=_[_0x4b60('0x2c')](_0x4f1115,'name');_0x5683d5[_0x4b60('0x31')]=_[_0x4b60('0x32')](_0x110f2e[_0x4b60('0x31')]);_0x5683d5[_0x4b60('0x33')]=_['intersection'](_0x5683d5[_0x4b60('0x30')],_0x5683d5[_0x4b60('0x31')]);_0x2cbac0[_0x4b60('0x34')]=_[_0x4b60('0x35')](_0x5683d5[_0x4b60('0x30')],qs['fields'](_0x110f2e[_0x4b60('0x31')][_0x4b60('0x36')]));_0x2cbac0['attributes']=_0x2cbac0['attributes']['length']?_0x2cbac0['attributes']:_0x5683d5['model'];if(!_0x110f2e[_0x4b60('0x31')][_0x4b60('0x37')](_0x4b60('0x38'))){_0x2cbac0[_0x4b60('0x20')]=qs[_0x4b60('0x20')](_0x110f2e[_0x4b60('0x31')][_0x4b60('0x20')]);_0x2cbac0[_0x4b60('0x1e')]=qs['offset'](_0x110f2e['query'][_0x4b60('0x1e')]);}_0x2cbac0[_0x4b60('0x39')]=qs['sort'](_0x110f2e[_0x4b60('0x31')][_0x4b60('0x3a')]);_0x2cbac0[_0x4b60('0x3b')]=qs[_0x4b60('0x33')](_[_0x4b60('0x3c')](_0x110f2e[_0x4b60('0x31')],_0x5683d5[_0x4b60('0x33')]),_0x4f1115);if(_0x110f2e[_0x4b60('0x31')][_0x4b60('0x3d')]){_0x2cbac0[_0x4b60('0x3b')]=_[_0x4b60('0x3e')](_0x2cbac0[_0x4b60('0x3b')],{'$or':_[_0x4b60('0x2c')](_0x4f1115,function(_0xe8fa92){if(_0xe8fa92['type']!==_0x4b60('0x3f')){var _0x41c451={};_0x41c451[_0xe8fa92[_0x4b60('0x2b')]]={'$like':'%'+_0x110f2e['query'][_0x4b60('0x3d')]+'%'};return _0x41c451;}})});}_0x2cbac0=_[_0x4b60('0x3e')]({},_0x2cbac0,_0x110f2e[_0x4b60('0x40')]);var _0x36f295={'where':_0x2cbac0[_0x4b60('0x3b')]};return db[_0x4b60('0x2d')][_0x4b60('0x21')](_0x36f295)[_0x4b60('0x27')](function(_0x446273){_0xb0b8d4[_0x4b60('0x21')]=_0x446273;if(_0x110f2e[_0x4b60('0x31')]['includeAll']){_0x2cbac0[_0x4b60('0x41')]=[{'all':!![]}];}return db['SquareReport'][_0x4b60('0x42')](_0x2cbac0);})[_0x4b60('0x27')](function(_0x540dc2){_0xb0b8d4['rows']=_0x540dc2;return _0xb0b8d4;})['then'](respondWithFilteredResult(_0x335ad3,_0x2cbac0))[_0x4b60('0x43')](handleError(_0x335ad3,null));};exports[_0x4b60('0x44')]=function(_0x30c10b,_0x447320){var _0x574afe={'raw':!![],'where':{'id':_0x30c10b[_0x4b60('0x45')]['id']}},_0x3b2ec7={};_0x3b2ec7[_0x4b60('0x30')]=_[_0x4b60('0x32')](db[_0x4b60('0x2d')]['rawAttributes']);_0x3b2ec7[_0x4b60('0x31')]=_[_0x4b60('0x32')](_0x30c10b['query']);_0x3b2ec7[_0x4b60('0x33')]=_[_0x4b60('0x35')](_0x3b2ec7[_0x4b60('0x30')],_0x3b2ec7[_0x4b60('0x31')]);_0x574afe[_0x4b60('0x34')]=_[_0x4b60('0x35')](_0x3b2ec7[_0x4b60('0x30')],qs[_0x4b60('0x36')](_0x30c10b[_0x4b60('0x31')][_0x4b60('0x36')]));_0x574afe[_0x4b60('0x34')]=_0x574afe['attributes'][_0x4b60('0x46')]?_0x574afe[_0x4b60('0x34')]:_0x3b2ec7[_0x4b60('0x30')];if(_0x30c10b[_0x4b60('0x31')][_0x4b60('0x47')]){_0x574afe[_0x4b60('0x41')]=[{'all':!![]}];}_0x574afe=_[_0x4b60('0x3e')]({},_0x574afe,_0x30c10b[_0x4b60('0x40')]);return db[_0x4b60('0x2d')][_0x4b60('0x48')](_0x574afe)[_0x4b60('0x27')](handleEntityNotFound(_0x447320,null))[_0x4b60('0x27')](respondWithResult(_0x447320,null))['catch'](handleError(_0x447320,null));};exports['create']=function(_0x242534,_0x5a0e66){return db[_0x4b60('0x2d')][_0x4b60('0x49')](_0x242534[_0x4b60('0x4a')],{})['then'](respondWithResult(_0x5a0e66,0xc9))[_0x4b60('0x43')](handleError(_0x5a0e66,null));};exports[_0x4b60('0x26')]=function(_0x4f968a,_0x4a7711){if(_0x4f968a[_0x4b60('0x4a')]['id']){delete _0x4f968a['body']['id'];}return db['SquareReport'][_0x4b60('0x48')]({'where':{'id':_0x4f968a[_0x4b60('0x45')]['id']}})['then'](handleEntityNotFound(_0x4a7711,null))['then'](saveUpdates(_0x4f968a[_0x4b60('0x4a')],null))[_0x4b60('0x27')](respondWithResult(_0x4a7711,null))[_0x4b60('0x43')](handleError(_0x4a7711,null));};exports[_0x4b60('0x28')]=function(_0x34909a,_0x4799c9){return db[_0x4b60('0x2d')][_0x4b60('0x48')]({'where':{'id':_0x34909a[_0x4b60('0x45')]['id']}})['then'](handleEntityNotFound(_0x4799c9,null))[_0x4b60('0x27')](removeEntity(_0x4799c9,null))['catch'](handleError(_0x4799c9,null));};exports[_0x4b60('0x4b')]=function(_0x716ea4,_0x1d9471){return db[_0x4b60('0x2d')]['describe']()[_0x4b60('0x27')](respondWithResult(_0x1d9471,null))['catch'](handleError(_0x1d9471,null));}; \ No newline at end of file +var _0xf34e=['save','then','destroy','error','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','keys','merge','find','create','body','update','describe','eml-format','rimraf','zip-dir','bluebird','mustache','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject'];(function(_0x46d30b,_0x51dad9){var _0x516778=function(_0x28dd25){while(--_0x28dd25){_0x46d30b['push'](_0x46d30b['shift']());}};_0x516778(++_0x51dad9);}(_0xf34e,0xbe));var _0xef34=function(_0x5198ce,_0x33236b){_0x5198ce=_0x5198ce-0x0;var _0xc56fa2=_0xf34e[_0x5198ce];return _0xc56fa2;};'use strict';var emlformat=require(_0xef34('0x0'));var rimraf=require(_0xef34('0x1'));var zipdir=require(_0xef34('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xef34('0x3'));var Mustache=require(_0xef34('0x4'));var util=require('util');var path=require('path');var sox=require(_0xef34('0x5'));var csv=require('to-csv');var ejs=require(_0xef34('0x6'));var fs=require('fs');var fs_extra=require(_0xef34('0x7'));var _=require(_0xef34('0x8'));var squel=require('squel');var crypto=require(_0xef34('0x9'));var jsforce=require(_0xef34('0xa'));var deskjs=require(_0xef34('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xef34('0xc'));var Redis=require(_0xef34('0xd'));var authService=require(_0xef34('0xe'));var qs=require(_0xef34('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xef34('0x10'));var logger=require(_0xef34('0x11'))(_0xef34('0x12'));var utils=require('../../config/utils');var config=require(_0xef34('0x13'));var licenseUtil=require(_0xef34('0x14'));var db=require(_0xef34('0x15'))['db'];function respondWithStatusCode(_0xe24c30,_0x460c26){_0x460c26=_0x460c26||0xcc;return function(_0x4d9edc){if(_0x4d9edc){return _0xe24c30['sendStatus'](_0x460c26);}return _0xe24c30['status'](_0x460c26)[_0xef34('0x16')]();};}function respondWithResult(_0x440503,_0x389f9f){_0x389f9f=_0x389f9f||0xc8;return function(_0x2e467e){if(_0x2e467e){return _0x440503[_0xef34('0x17')](_0x389f9f)[_0xef34('0x18')](_0x2e467e);}};}function respondWithFilteredResult(_0x131229,_0x534c2f){return function(_0x56ad9c){if(_0x56ad9c){var _0x25e3dd=typeof _0x534c2f[_0xef34('0x19')]===_0xef34('0x1a')&&typeof _0x534c2f[_0xef34('0x1b')]===_0xef34('0x1a');var _0x12acb4=_0x56ad9c['count'];var _0x4b9e60=_0x25e3dd?0x0:_0x534c2f[_0xef34('0x19')];var _0x4fce9a=_0x25e3dd?_0x56ad9c['count']:_0x534c2f[_0xef34('0x19')]+_0x534c2f['limit'];var _0x442c38;if(_0x4fce9a>=_0x12acb4){_0x4fce9a=_0x12acb4;_0x442c38=0xc8;}else{_0x442c38=0xce;}_0x131229[_0xef34('0x17')](_0x442c38);return _0x131229[_0xef34('0x1c')](_0xef34('0x1d'),_0x4b9e60+'-'+_0x4fce9a+'/'+_0x12acb4)[_0xef34('0x18')](_0x56ad9c);}return null;};}function patchUpdates(_0x39347c){return function(_0x51763c){try{jsonpatch[_0xef34('0x1e')](_0x51763c,_0x39347c,!![]);}catch(_0x31ffa4){return BPromise[_0xef34('0x1f')](_0x31ffa4);}return _0x51763c[_0xef34('0x20')]();};}function saveUpdates(_0x1776a6,_0x2678e1){return function(_0x32c977){if(_0x32c977){return _0x32c977['update'](_0x1776a6)[_0xef34('0x21')](function(_0x2fbf7e){return _0x2fbf7e;});}return null;};}function removeEntity(_0x38bc22,_0x510ec4){return function(_0x381736){if(_0x381736){return _0x381736[_0xef34('0x22')]()[_0xef34('0x21')](function(){_0x38bc22['status'](0xcc)[_0xef34('0x16')]();});}};}function handleEntityNotFound(_0x2a270e,_0x43e044){return function(_0x3998f1){if(!_0x3998f1){_0x2a270e['sendStatus'](0x194);}return _0x3998f1;};}function handleError(_0xd116fb,_0x1babd9){_0x1babd9=_0x1babd9||0x1f4;return function(_0x14a1ec){logger[_0xef34('0x23')](_0x14a1ec[_0xef34('0x24')]);if(_0x14a1ec[_0xef34('0x25')]){delete _0x14a1ec['name'];}_0xd116fb['status'](_0x1babd9)[_0xef34('0x26')](_0x14a1ec);};}exports[_0xef34('0x27')]=function(_0x512c22,_0x550399){var _0x5022b8={},_0x14af0d={},_0x1fba83={'count':0x0,'rows':[]};var _0x228d06=_[_0xef34('0x28')](db[_0xef34('0x29')][_0xef34('0x2a')],function(_0x27d9fa){return{'name':_0x27d9fa[_0xef34('0x2b')],'type':_0x27d9fa[_0xef34('0x2c')]['key']};});_0x14af0d[_0xef34('0x2d')]=_[_0xef34('0x28')](_0x228d06,_0xef34('0x25'));_0x14af0d['query']=_['keys'](_0x512c22[_0xef34('0x2e')]);_0x14af0d[_0xef34('0x2f')]=_[_0xef34('0x30')](_0x14af0d[_0xef34('0x2d')],_0x14af0d[_0xef34('0x2e')]);_0x5022b8['attributes']=_[_0xef34('0x30')](_0x14af0d[_0xef34('0x2d')],qs[_0xef34('0x31')](_0x512c22[_0xef34('0x2e')]['fields']));_0x5022b8[_0xef34('0x32')]=_0x5022b8[_0xef34('0x32')]['length']?_0x5022b8[_0xef34('0x32')]:_0x14af0d['model'];if(!_0x512c22[_0xef34('0x2e')][_0xef34('0x33')](_0xef34('0x34'))){_0x5022b8['limit']=qs[_0xef34('0x1b')](_0x512c22[_0xef34('0x2e')][_0xef34('0x1b')]);_0x5022b8[_0xef34('0x19')]=qs['offset'](_0x512c22[_0xef34('0x2e')][_0xef34('0x19')]);}_0x5022b8[_0xef34('0x35')]=qs[_0xef34('0x36')](_0x512c22['query'][_0xef34('0x36')]);_0x5022b8['where']=qs[_0xef34('0x2f')](_[_0xef34('0x37')](_0x512c22[_0xef34('0x2e')],_0x14af0d[_0xef34('0x2f')]),_0x228d06);if(_0x512c22[_0xef34('0x2e')][_0xef34('0x38')]){_0x5022b8['where']=_['merge'](_0x5022b8[_0xef34('0x39')],{'$or':_[_0xef34('0x28')](_0x228d06,function(_0x432263){if(_0x432263[_0xef34('0x2c')]!==_0xef34('0x3a')){var _0x520aa1={};_0x520aa1[_0x432263[_0xef34('0x25')]]={'$like':'%'+_0x512c22[_0xef34('0x2e')][_0xef34('0x38')]+'%'};return _0x520aa1;}})});}_0x5022b8=_['merge']({},_0x5022b8,_0x512c22[_0xef34('0x3b')]);var _0x1da5ba={'where':_0x5022b8['where']};return db[_0xef34('0x29')][_0xef34('0x3c')](_0x1da5ba)[_0xef34('0x21')](function(_0x367e84){_0x1fba83[_0xef34('0x3c')]=_0x367e84;if(_0x512c22[_0xef34('0x2e')][_0xef34('0x3d')]){_0x5022b8[_0xef34('0x3e')]=[{'all':!![]}];}return db['SquareReport']['findAll'](_0x5022b8);})[_0xef34('0x21')](function(_0x2eecbd){_0x1fba83[_0xef34('0x3f')]=_0x2eecbd;return _0x1fba83;})['then'](respondWithFilteredResult(_0x550399,_0x5022b8))[_0xef34('0x40')](handleError(_0x550399,null));};exports[_0xef34('0x41')]=function(_0x48ef8f,_0x5f00){var _0x6048fc={'raw':!![],'where':{'id':_0x48ef8f[_0xef34('0x42')]['id']}},_0x741958={};_0x741958[_0xef34('0x2d')]=_[_0xef34('0x43')](db[_0xef34('0x29')]['rawAttributes']);_0x741958[_0xef34('0x2e')]=_[_0xef34('0x43')](_0x48ef8f[_0xef34('0x2e')]);_0x741958[_0xef34('0x2f')]=_[_0xef34('0x30')](_0x741958[_0xef34('0x2d')],_0x741958[_0xef34('0x2e')]);_0x6048fc[_0xef34('0x32')]=_[_0xef34('0x30')](_0x741958['model'],qs['fields'](_0x48ef8f[_0xef34('0x2e')][_0xef34('0x31')]));_0x6048fc[_0xef34('0x32')]=_0x6048fc[_0xef34('0x32')]['length']?_0x6048fc[_0xef34('0x32')]:_0x741958['model'];if(_0x48ef8f[_0xef34('0x2e')]['includeAll']){_0x6048fc[_0xef34('0x3e')]=[{'all':!![]}];}_0x6048fc=_[_0xef34('0x44')]({},_0x6048fc,_0x48ef8f[_0xef34('0x3b')]);return db[_0xef34('0x29')][_0xef34('0x45')](_0x6048fc)[_0xef34('0x21')](handleEntityNotFound(_0x5f00,null))[_0xef34('0x21')](respondWithResult(_0x5f00,null))[_0xef34('0x40')](handleError(_0x5f00,null));};exports[_0xef34('0x46')]=function(_0x556c5f,_0x1b7643){return db[_0xef34('0x29')][_0xef34('0x46')](_0x556c5f[_0xef34('0x47')],{})['then'](respondWithResult(_0x1b7643,0xc9))[_0xef34('0x40')](handleError(_0x1b7643,null));};exports[_0xef34('0x48')]=function(_0x535290,_0x44735e){if(_0x535290[_0xef34('0x47')]['id']){delete _0x535290[_0xef34('0x47')]['id'];}return db[_0xef34('0x29')][_0xef34('0x45')]({'where':{'id':_0x535290[_0xef34('0x42')]['id']}})[_0xef34('0x21')](handleEntityNotFound(_0x44735e,null))[_0xef34('0x21')](saveUpdates(_0x535290[_0xef34('0x47')],null))[_0xef34('0x21')](respondWithResult(_0x44735e,null))[_0xef34('0x40')](handleError(_0x44735e,null));};exports[_0xef34('0x22')]=function(_0x58a7ef,_0xcf37c1){return db[_0xef34('0x29')][_0xef34('0x45')]({'where':{'id':_0x58a7ef['params']['id']}})['then'](handleEntityNotFound(_0xcf37c1,null))['then'](removeEntity(_0xcf37c1,null))[_0xef34('0x40')](handleError(_0xcf37c1,null));};exports[_0xef34('0x49')]=function(_0x466399,_0x5690c3){return db[_0xef34('0x29')]['describe']()[_0xef34('0x21')](respondWithResult(_0x5690c3,null))[_0xef34('0x40')](handleError(_0x5690c3,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index ded76f6..4540806 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 _0x8fb0=['SquareReport','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x6dc26f,_0xbe335d){var _0x3411ae=function(_0x47c5f7){while(--_0x47c5f7){_0x6dc26f['push'](_0x6dc26f['shift']());}};_0x3411ae(++_0xbe335d);}(_0x8fb0,0x14f));var _0x08fb=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x8fb0[_0x31ced5];return _0x10d9e5;};'use strict';var _=require(_0x08fb('0x0'));var util=require(_0x08fb('0x1'));var logger=require(_0x08fb('0x2'))(_0x08fb('0x3'));var moment=require(_0x08fb('0x4'));var BPromise=require('bluebird');var rp=require(_0x08fb('0x5'));var fs=require('fs');var path=require(_0x08fb('0x6'));var rimraf=require(_0x08fb('0x7'));var config=require(_0x08fb('0x8'));var attributes=require('./squareReport.attributes');module[_0x08fb('0x9')]=function(_0x1face5,_0x589de5){return _0x1face5['define'](_0x08fb('0xa'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x08fb('0xb'),'fields':[_0x08fb('0xc'),_0x08fb('0xd')]},{'name':_0x08fb('0xe'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4b97=['project_name','leaveAt','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','exports','define','SquareReport','uid_pname','uniqueid'];(function(_0x2d5818,_0x2be6a5){var _0xea4040=function(_0x914a50){while(--_0x914a50){_0x2d5818['push'](_0x2d5818['shift']());}};_0xea4040(++_0x2be6a5);}(_0x4b97,0x110));var _0x74b9=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x4b97[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x74b9('0x0'));var util=require(_0x74b9('0x1'));var logger=require(_0x74b9('0x2'))(_0x74b9('0x3'));var moment=require('moment');var BPromise=require(_0x74b9('0x4'));var rp=require(_0x74b9('0x5'));var fs=require('fs');var path=require(_0x74b9('0x6'));var rimraf=require(_0x74b9('0x7'));var config=require('../../config/environment');var attributes=require('./squareReport.attributes');module[_0x74b9('0x8')]=function(_0x5c138c,_0xfc7533){return _0x5c138c[_0x74b9('0x9')](_0x74b9('0xa'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x74b9('0xb'),'fields':[_0x74b9('0xc'),_0x74b9('0xd')]},{'name':'leaveAt','fields':[_0x74b9('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index a03b20f..051c6c3 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 _0x39df=['catch','UpdateSquareReport','options','where','attributes','limit','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','stringify','error','message','CreateSquareReport','create','body'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x39df,0x173));var _0xf39d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x39df[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf39d('0x0'));var util=require(_0xf39d('0x1'));var moment=require(_0xf39d('0x2'));var BPromise=require(_0xf39d('0x3'));var rs=require(_0xf39d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf39d('0x5'))['db'];var utils=require(_0xf39d('0x6'));var logger=require('../../config/logger')(_0xf39d('0x7'));var config=require(_0xf39d('0x8'));var jayson=require(_0xf39d('0x9'));var client=jayson[_0xf39d('0xa')][_0xf39d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x56aef2,_0x159606,_0x16620f){return new BPromise(function(_0x3bdc6b,_0x1e8fee){return client['request'](_0x56aef2,_0x16620f)['then'](function(_0x18464e){logger[_0xf39d('0xc')]('SquareReport,\x20%s,\x20%s',_0x159606,_0xf39d('0xd'));logger[_0xf39d('0xe')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x159606,'request\x20sent',JSON[_0xf39d('0xf')](_0x18464e));if(_0x18464e[_0xf39d('0x10')]){if(_0x18464e[_0xf39d('0x10')]['code']===0x1f4){logger[_0xf39d('0x10')]('SquareReport,\x20%s,\x20%s',_0x159606,_0x18464e[_0xf39d('0x10')][_0xf39d('0x11')]);return _0x1e8fee(_0x18464e[_0xf39d('0x10')]['message']);}logger[_0xf39d('0x10')]('SquareReport,\x20%s,\x20%s',_0x159606,_0x18464e[_0xf39d('0x10')][_0xf39d('0x11')]);return _0x3bdc6b(_0x18464e[_0xf39d('0x10')][_0xf39d('0x11')]);}else{logger[_0xf39d('0xc')]('SquareReport,\x20%s,\x20%s',_0x159606,_0xf39d('0xd'));_0x3bdc6b(_0x18464e['result'][_0xf39d('0x11')]);}})['catch'](function(_0x1764b9){logger[_0xf39d('0x10')]('SquareReport,\x20%s,\x20%s',_0x159606,_0x1764b9);_0x1e8fee(_0x1764b9);});});}exports[_0xf39d('0x12')]=function(_0x5ee709){var _0x5b3c01=this;return new Promise(function(_0x175fa4,_0x245bd0){return db['SquareReport'][_0xf39d('0x13')](_0x5ee709[_0xf39d('0x14')],{'raw':_0x5ee709['options']?_0x5ee709['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4263a1){logger[_0xf39d('0xc')](_0xf39d('0x12'),_0x5ee709);logger['debug'](_0xf39d('0x12'),_0x5ee709,JSON['stringify'](_0x4263a1));_0x175fa4(_0x4263a1);})[_0xf39d('0x15')](function(_0x55a9bb){logger[_0xf39d('0x10')](_0xf39d('0x12'),_0x55a9bb[_0xf39d('0x11')],_0x5ee709);_0x245bd0(_0x5b3c01[_0xf39d('0x10')](0x1f4,_0x55a9bb[_0xf39d('0x11')]));});});};exports[_0xf39d('0x16')]=function(_0x35ec49){var _0x12d90d=this;return new Promise(function(_0x37c993,_0x4390b3){return db['SquareReport']['update'](_0x35ec49[_0xf39d('0x14')],{'raw':_0x35ec49[_0xf39d('0x17')]?_0x35ec49[_0xf39d('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35ec49['options']?_0x35ec49[_0xf39d('0x17')][_0xf39d('0x18')]||null:null,'attributes':_0x35ec49[_0xf39d('0x17')]?_0x35ec49[_0xf39d('0x17')][_0xf39d('0x19')]||null:null,'limit':_0x35ec49[_0xf39d('0x17')]?_0x35ec49[_0xf39d('0x17')][_0xf39d('0x1a')]||null:null})[_0xf39d('0x1b')](function(_0x26209a){logger[_0xf39d('0xc')](_0xf39d('0x16'),_0x35ec49);logger[_0xf39d('0xe')]('UpdateSquareReport',_0x35ec49,JSON[_0xf39d('0xf')](_0x26209a));_0x37c993(_0x26209a);})[_0xf39d('0x15')](function(_0x10b10a){logger[_0xf39d('0x10')]('UpdateSquareReport',_0x10b10a[_0xf39d('0x11')],_0x35ec49);_0x4390b3(_0x12d90d[_0xf39d('0x10')](0x1f4,_0x10b10a[_0xf39d('0x11')]));});});}; \ No newline at end of file +var _0xb4c8=['CreateSquareReport','SquareReport','create','body','options','raw','then','debug','UpdateSquareReport','update','attributes','limit','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','request\x20sent','stringify','error','SquareReport,\x20%s,\x20%s','message','result'];(function(_0x57056c,_0x12c8a1){var _0xb624a2=function(_0x3933fc){while(--_0x3933fc){_0x57056c['push'](_0x57056c['shift']());}};_0xb624a2(++_0x12c8a1);}(_0xb4c8,0xa2));var _0x8b4c=function(_0x3462fb,_0x41f84d){_0x3462fb=_0x3462fb-0x0;var _0x4fb07f=_0xb4c8[_0x3462fb];return _0x4fb07f;};'use strict';var _=require(_0x8b4c('0x0'));var util=require(_0x8b4c('0x1'));var moment=require(_0x8b4c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b4c('0x3'));var db=require(_0x8b4c('0x4'))['db'];var utils=require(_0x8b4c('0x5'));var logger=require(_0x8b4c('0x6'))(_0x8b4c('0x7'));var config=require(_0x8b4c('0x8'));var jayson=require(_0x8b4c('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x57b801,_0x4e2e6c,_0x434336){return new BPromise(function(_0x528025,_0x553005){return client[_0x8b4c('0xa')](_0x57b801,_0x434336)['then'](function(_0x500bdf){logger[_0x8b4c('0xb')]('SquareReport,\x20%s,\x20%s',_0x4e2e6c,_0x8b4c('0xc'));logger['debug']('SquareReport,\x20%s,\x20%s,\x20%s',_0x4e2e6c,_0x8b4c('0xc'),JSON[_0x8b4c('0xd')](_0x500bdf));if(_0x500bdf['error']){if(_0x500bdf[_0x8b4c('0xe')]['code']===0x1f4){logger[_0x8b4c('0xe')](_0x8b4c('0xf'),_0x4e2e6c,_0x500bdf[_0x8b4c('0xe')]['message']);return _0x553005(_0x500bdf['error'][_0x8b4c('0x10')]);}logger[_0x8b4c('0xe')]('SquareReport,\x20%s,\x20%s',_0x4e2e6c,_0x500bdf[_0x8b4c('0xe')][_0x8b4c('0x10')]);return _0x528025(_0x500bdf[_0x8b4c('0xe')][_0x8b4c('0x10')]);}else{logger[_0x8b4c('0xb')](_0x8b4c('0xf'),_0x4e2e6c,_0x8b4c('0xc'));_0x528025(_0x500bdf[_0x8b4c('0x11')]['message']);}})['catch'](function(_0x20d6f6){logger['error'](_0x8b4c('0xf'),_0x4e2e6c,_0x20d6f6);_0x553005(_0x20d6f6);});});}exports[_0x8b4c('0x12')]=function(_0x512945){var _0x5044de=this;return new Promise(function(_0x57c9d4,_0x3e850b){return db[_0x8b4c('0x13')][_0x8b4c('0x14')](_0x512945[_0x8b4c('0x15')],{'raw':_0x512945['options']?_0x512945[_0x8b4c('0x16')][_0x8b4c('0x17')]===undefined?!![]:![]:!![]})[_0x8b4c('0x18')](function(_0xbc5732){logger[_0x8b4c('0xb')](_0x8b4c('0x12'),_0x512945);logger[_0x8b4c('0x19')](_0x8b4c('0x12'),_0x512945,JSON[_0x8b4c('0xd')](_0xbc5732));_0x57c9d4(_0xbc5732);})['catch'](function(_0xfbdac4){logger[_0x8b4c('0xe')](_0x8b4c('0x12'),_0xfbdac4['message'],_0x512945);_0x3e850b(_0x5044de['error'](0x1f4,_0xfbdac4[_0x8b4c('0x10')]));});});};exports[_0x8b4c('0x1a')]=function(_0x5eb46d){var _0x30609a=this;return new Promise(function(_0x123655,_0x18e270){return db[_0x8b4c('0x13')][_0x8b4c('0x1b')](_0x5eb46d[_0x8b4c('0x15')],{'raw':_0x5eb46d[_0x8b4c('0x16')]?_0x5eb46d['options'][_0x8b4c('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5eb46d[_0x8b4c('0x16')]?_0x5eb46d['options']['where']||null:null,'attributes':_0x5eb46d['options']?_0x5eb46d['options'][_0x8b4c('0x1c')]||null:null,'limit':_0x5eb46d[_0x8b4c('0x16')]?_0x5eb46d[_0x8b4c('0x16')][_0x8b4c('0x1d')]||null:null})[_0x8b4c('0x18')](function(_0xbabcff){logger[_0x8b4c('0xb')](_0x8b4c('0x1a'),_0x5eb46d);logger[_0x8b4c('0x19')]('UpdateSquareReport',_0x5eb46d,JSON[_0x8b4c('0xd')](_0xbabcff));_0x123655(_0xbabcff);})['catch'](function(_0x398819){logger[_0x8b4c('0xe')](_0x8b4c('0x1a'),_0x398819[_0x8b4c('0x10')],_0x5eb46d);_0x18e270(_0x30609a[_0x8b4c('0xe')](0x1f4,_0x398819[_0x8b4c('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index e2cde61..c52646d 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 _0x7303=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','post','put','delete','destroy','exports','multer','util','path'];(function(_0x4081e3,_0x2912a7){var _0x2e8bed=function(_0x58b824){while(--_0x58b824){_0x4081e3['push'](_0x4081e3['shift']());}};_0x2e8bed(++_0x2912a7);}(_0x7303,0xe7));var _0x3730=function(_0x34cb8d,_0x1157f0){_0x34cb8d=_0x34cb8d-0x0;var _0x42d780=_0x7303[_0x34cb8d];return _0x42d780;};'use strict';var multer=require(_0x3730('0x0'));var util=require(_0x3730('0x1'));var path=require(_0x3730('0x2'));var timeout=require('connect-timeout');var express=require(_0x3730('0x3'));var router=express[_0x3730('0x4')]();var fs_extra=require(_0x3730('0x5'));var auth=require(_0x3730('0x6'));var interaction=require(_0x3730('0x7'));var config=require(_0x3730('0x8'));var controller=require('./squareReportDetail.controller');router[_0x3730('0x9')]('/',auth[_0x3730('0xa')](),controller['index']);router[_0x3730('0x9')]('/describe',auth[_0x3730('0xa')](),controller[_0x3730('0xb')]);router[_0x3730('0x9')](_0x3730('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x3730('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3730('0xe')](_0x3730('0xc'),auth[_0x3730('0xa')](),controller['update']);router[_0x3730('0xf')](_0x3730('0xc'),auth[_0x3730('0xa')](),controller[_0x3730('0x10')]);module[_0x3730('0x11')]=router; \ No newline at end of file +var _0x2de2=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','isAuthenticated','get','describe','show','/:id','update','delete'];(function(_0x259cc4,_0x32bde5){var _0xd3d44b=function(_0x586d2c){while(--_0x586d2c){_0x259cc4['push'](_0x259cc4['shift']());}};_0xd3d44b(++_0x32bde5);}(_0x2de2,0x1d6));var _0x22de=function(_0x154838,_0xe3f9c6){_0x154838=_0x154838-0x0;var _0x56f32a=_0x2de2[_0x154838];return _0x56f32a;};'use strict';var multer=require(_0x22de('0x0'));var util=require(_0x22de('0x1'));var path=require(_0x22de('0x2'));var timeout=require(_0x22de('0x3'));var express=require(_0x22de('0x4'));var router=express['Router']();var fs_extra=require(_0x22de('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x22de('0x6'));var config=require(_0x22de('0x7'));var controller=require(_0x22de('0x8'));router['get']('/',auth[_0x22de('0x9')](),controller['index']);router[_0x22de('0xa')]('/describe',auth[_0x22de('0x9')](),controller[_0x22de('0xb')]);router['get']('/:id',auth[_0x22de('0x9')](),controller[_0x22de('0xc')]);router['post']('/',auth[_0x22de('0x9')](),controller['create']);router['put'](_0x22de('0xd'),auth['isAuthenticated'](),controller[_0x22de('0xe')]);router[_0x22de('0xf')](_0x22de('0xd'),auth[_0x22de('0x9')](),controller[_0x22de('0x10')]);module[_0x22de('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 0e5c0cb..86f89e6 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 _0x40e1=['STRING','TEXT','sequelize','exports'];(function(_0x38e7bc,_0x110711){var _0xf16a61=function(_0x1a8e47){while(--_0x1a8e47){_0x38e7bc['push'](_0x38e7bc['shift']());}};_0xf16a61(++_0x110711);}(_0x40e1,0x1ea));var _0x140e=function(_0x49fa01,_0x37f0bd){_0x49fa01=_0x49fa01-0x0;var _0x1362ca=_0x40e1[_0x49fa01];return _0x1362ca;};'use strict';var Sequelize=require(_0x140e('0x0'));module[_0x140e('0x1')]={'uniqueid':{'type':Sequelize[_0x140e('0x2')]},'node':{'type':Sequelize[_0x140e('0x2')]},'application':{'type':Sequelize[_0x140e('0x2')]},'data':{'type':Sequelize[_0x140e('0x3')]},'project_name':{'type':Sequelize[_0x140e('0x2')]},'callerid':{'type':Sequelize[_0x140e('0x2')]}}; \ No newline at end of file +var _0xf16a=['TEXT','exports','STRING'];(function(_0x24fcc6,_0xcda1b0){var _0x18c52a=function(_0x4636bd){while(--_0x4636bd){_0x24fcc6['push'](_0x24fcc6['shift']());}};_0x18c52a(++_0xcda1b0);}(_0xf16a,0xcd));var _0xaf16=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xf16a[_0x5c2e3e];return _0x53f64a;};'use strict';var Sequelize=require('sequelize');module[_0xaf16('0x0')]={'uniqueid':{'type':Sequelize[_0xaf16('0x1')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0xaf16('0x1')]},'data':{'type':Sequelize[_0xaf16('0x2')]},'project_name':{'type':Sequelize[_0xaf16('0x1')]},'callerid':{'type':Sequelize[_0xaf16('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 610a3d5..d6c00a4 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 _0x2297=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','apply','reject','destroy','end','error','stack','SquareDetailsReport','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','rows','catch','show','find','create','body','update','params','describe','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch'];(function(_0x439d59,_0x11ccdf){var _0x3670c7=function(_0x11cfcb){while(--_0x11cfcb){_0x439d59['push'](_0x439d59['shift']());}};_0x3670c7(++_0x11ccdf);}(_0x2297,0x14e));var _0x7229=function(_0x137525,_0x38e188){_0x137525=_0x137525-0x0;var _0x5c0138=_0x2297[_0x137525];return _0x5c0138;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7229('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7229('0x1'));var moment=require(_0x7229('0x2'));var BPromise=require(_0x7229('0x3'));var Mustache=require(_0x7229('0x4'));var util=require(_0x7229('0x5'));var path=require(_0x7229('0x6'));var sox=require('sox');var csv=require(_0x7229('0x7'));var ejs=require(_0x7229('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7229('0x9'));var squel=require(_0x7229('0xa'));var crypto=require(_0x7229('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7229('0xc'));var toCsv=require(_0x7229('0x7'));var querystring=require('querystring');var Papa=require(_0x7229('0xd'));var Redis=require(_0x7229('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7229('0xf'));var hardwareService=require(_0x7229('0x10'));var logger=require(_0x7229('0x11'))('api');var utils=require(_0x7229('0x12'));var config=require(_0x7229('0x13'));var licenseUtil=require(_0x7229('0x14'));var db=require(_0x7229('0x15'))['db'];function respondWithStatusCode(_0x5f2469,_0x1765fc){_0x1765fc=_0x1765fc||0xcc;return function(_0x4f94b1){if(_0x4f94b1){return _0x5f2469[_0x7229('0x16')](_0x1765fc);}return _0x5f2469['status'](_0x1765fc)['end']();};}function respondWithResult(_0x468bdd,_0x37c396){_0x37c396=_0x37c396||0xc8;return function(_0x14a8ba){if(_0x14a8ba){return _0x468bdd[_0x7229('0x17')](_0x37c396)['json'](_0x14a8ba);}};}function respondWithFilteredResult(_0x29563b,_0x55abf1){return function(_0x5ef18d){if(_0x5ef18d){var _0x58408=typeof _0x55abf1[_0x7229('0x18')]===_0x7229('0x19')&&typeof _0x55abf1['limit']===_0x7229('0x19');var _0x7aed04=_0x5ef18d[_0x7229('0x1a')];var _0x1c2c0e=_0x58408?0x0:_0x55abf1[_0x7229('0x18')];var _0x1e81dd=_0x58408?_0x5ef18d[_0x7229('0x1a')]:_0x55abf1[_0x7229('0x18')]+_0x55abf1[_0x7229('0x1b')];var _0x33b7c8;if(_0x1e81dd>=_0x7aed04){_0x1e81dd=_0x7aed04;_0x33b7c8=0xc8;}else{_0x33b7c8=0xce;}_0x29563b[_0x7229('0x17')](_0x33b7c8);return _0x29563b['set']('Content-Range',_0x1c2c0e+'-'+_0x1e81dd+'/'+_0x7aed04)['json'](_0x5ef18d);}return null;};}function patchUpdates(_0x6ba21e){return function(_0x41817f){try{jsonpatch[_0x7229('0x1c')](_0x41817f,_0x6ba21e,!![]);}catch(_0x4793f0){return BPromise[_0x7229('0x1d')](_0x4793f0);}return _0x41817f['save']();};}function saveUpdates(_0x3bd4fc,_0x1874da){return function(_0x5a6527){if(_0x5a6527){return _0x5a6527['update'](_0x3bd4fc)['then'](function(_0x442cba){return _0x442cba;});}return null;};}function removeEntity(_0x2a5861,_0x3bc6b8){return function(_0x2bc59f){if(_0x2bc59f){return _0x2bc59f[_0x7229('0x1e')]()['then'](function(){_0x2a5861[_0x7229('0x17')](0xcc)[_0x7229('0x1f')]();});}};}function handleEntityNotFound(_0x29a936,_0x2731a0){return function(_0xd0016a){if(!_0xd0016a){_0x29a936[_0x7229('0x16')](0x194);}return _0xd0016a;};}function handleError(_0x166051,_0x1b51c6){_0x1b51c6=_0x1b51c6||0x1f4;return function(_0x4cb26f){logger[_0x7229('0x20')](_0x4cb26f[_0x7229('0x21')]);if(_0x4cb26f['name']){delete _0x4cb26f['name'];}_0x166051[_0x7229('0x17')](_0x1b51c6)['send'](_0x4cb26f);};}exports['index']=function(_0x559953,_0x169d0b){var _0x10f58c={},_0x2eb38a={},_0x29b8cf={'count':0x0,'rows':[]};var _0x417967=_['map'](db[_0x7229('0x22')][_0x7229('0x23')],function(_0x60df85){return{'name':_0x60df85[_0x7229('0x24')],'type':_0x60df85[_0x7229('0x25')][_0x7229('0x26')]};});_0x2eb38a[_0x7229('0x27')]=_[_0x7229('0x28')](_0x417967,_0x7229('0x29'));_0x2eb38a[_0x7229('0x2a')]=_[_0x7229('0x2b')](_0x559953[_0x7229('0x2a')]);_0x2eb38a[_0x7229('0x2c')]=_[_0x7229('0x2d')](_0x2eb38a[_0x7229('0x27')],_0x2eb38a[_0x7229('0x2a')]);_0x10f58c[_0x7229('0x2e')]=_['intersection'](_0x2eb38a[_0x7229('0x27')],qs[_0x7229('0x2f')](_0x559953[_0x7229('0x2a')][_0x7229('0x2f')]));_0x10f58c['attributes']=_0x10f58c[_0x7229('0x2e')][_0x7229('0x30')]?_0x10f58c[_0x7229('0x2e')]:_0x2eb38a['model'];if(!_0x559953['query']['hasOwnProperty'](_0x7229('0x31'))){_0x10f58c[_0x7229('0x1b')]=qs[_0x7229('0x1b')](_0x559953[_0x7229('0x2a')][_0x7229('0x1b')]);_0x10f58c[_0x7229('0x18')]=qs[_0x7229('0x18')](_0x559953[_0x7229('0x2a')][_0x7229('0x18')]);}_0x10f58c[_0x7229('0x32')]=qs[_0x7229('0x33')](_0x559953['query']['sort']);_0x10f58c[_0x7229('0x34')]=qs[_0x7229('0x2c')](_[_0x7229('0x35')](_0x559953['query'],_0x2eb38a['filters']),_0x417967);if(_0x559953[_0x7229('0x2a')][_0x7229('0x36')]){_0x10f58c[_0x7229('0x34')]=_[_0x7229('0x37')](_0x10f58c['where'],{'$or':_[_0x7229('0x28')](_0x417967,function(_0x21a767){if(_0x21a767[_0x7229('0x25')]!==_0x7229('0x38')){var _0x4d4f2d={};_0x4d4f2d[_0x21a767[_0x7229('0x29')]]={'$like':'%'+_0x559953[_0x7229('0x2a')]['filter']+'%'};return _0x4d4f2d;}})});}_0x10f58c=_[_0x7229('0x37')]({},_0x10f58c,_0x559953[_0x7229('0x39')]);var _0x5ae089={'where':_0x10f58c[_0x7229('0x34')]};return db[_0x7229('0x22')][_0x7229('0x1a')](_0x5ae089)[_0x7229('0x3a')](function(_0x4a7b59){_0x29b8cf[_0x7229('0x1a')]=_0x4a7b59;if(_0x559953[_0x7229('0x2a')][_0x7229('0x3b')]){_0x10f58c[_0x7229('0x3c')]=[{'all':!![]}];}return db[_0x7229('0x22')]['findAll'](_0x10f58c);})[_0x7229('0x3a')](function(_0x2f3962){_0x29b8cf[_0x7229('0x3d')]=_0x2f3962;return _0x29b8cf;})[_0x7229('0x3a')](respondWithFilteredResult(_0x169d0b,_0x10f58c))[_0x7229('0x3e')](handleError(_0x169d0b,null));};exports[_0x7229('0x3f')]=function(_0x4b76db,_0x1d4b3b){var _0x544b33={'raw':!![],'where':{'id':_0x4b76db['params']['id']}},_0x6a98e={};_0x6a98e[_0x7229('0x27')]=_[_0x7229('0x2b')](db[_0x7229('0x22')][_0x7229('0x23')]);_0x6a98e[_0x7229('0x2a')]=_[_0x7229('0x2b')](_0x4b76db['query']);_0x6a98e[_0x7229('0x2c')]=_[_0x7229('0x2d')](_0x6a98e[_0x7229('0x27')],_0x6a98e[_0x7229('0x2a')]);_0x544b33[_0x7229('0x2e')]=_[_0x7229('0x2d')](_0x6a98e[_0x7229('0x27')],qs[_0x7229('0x2f')](_0x4b76db[_0x7229('0x2a')][_0x7229('0x2f')]));_0x544b33[_0x7229('0x2e')]=_0x544b33[_0x7229('0x2e')][_0x7229('0x30')]?_0x544b33[_0x7229('0x2e')]:_0x6a98e[_0x7229('0x27')];if(_0x4b76db[_0x7229('0x2a')][_0x7229('0x3b')]){_0x544b33[_0x7229('0x3c')]=[{'all':!![]}];}_0x544b33=_[_0x7229('0x37')]({},_0x544b33,_0x4b76db[_0x7229('0x39')]);return db[_0x7229('0x22')][_0x7229('0x40')](_0x544b33)['then'](handleEntityNotFound(_0x1d4b3b,null))['then'](respondWithResult(_0x1d4b3b,null))['catch'](handleError(_0x1d4b3b,null));};exports[_0x7229('0x41')]=function(_0x25e3e4,_0x5e3c85){return db[_0x7229('0x22')][_0x7229('0x41')](_0x25e3e4[_0x7229('0x42')],{})[_0x7229('0x3a')](respondWithResult(_0x5e3c85,0xc9))[_0x7229('0x3e')](handleError(_0x5e3c85,null));};exports[_0x7229('0x43')]=function(_0x4b2461,_0x26101d){if(_0x4b2461[_0x7229('0x42')]['id']){delete _0x4b2461['body']['id'];}return db['SquareDetailsReport'][_0x7229('0x40')]({'where':{'id':_0x4b2461[_0x7229('0x44')]['id']}})[_0x7229('0x3a')](handleEntityNotFound(_0x26101d,null))[_0x7229('0x3a')](saveUpdates(_0x4b2461[_0x7229('0x42')],null))[_0x7229('0x3a')](respondWithResult(_0x26101d,null))['catch'](handleError(_0x26101d,null));};exports[_0x7229('0x1e')]=function(_0x2b1056,_0x573fe6){return db[_0x7229('0x22')][_0x7229('0x40')]({'where':{'id':_0x2b1056[_0x7229('0x44')]['id']}})['then'](handleEntityNotFound(_0x573fe6,null))[_0x7229('0x3a')](removeEntity(_0x573fe6,null))[_0x7229('0x3e')](handleError(_0x573fe6,null));};exports[_0x7229('0x45')]=function(_0x537eca,_0x54de93){return db['SquareDetailsReport'][_0x7229('0x45')]()[_0x7229('0x3a')](respondWithResult(_0x54de93,null))['catch'](handleError(_0x54de93,null));}; \ No newline at end of file +var _0x8a0f=['moment','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','then','destroy','end','error','stack','name','send','index','map','fieldName','key','model','query','filters','attributes','intersection','fields','length','order','sort','where','pick','merge','type','VIRTUAL','filter','options','SquareDetailsReport','includeAll','include','catch','show','params','keys','find','create','update','body','describe','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x50cb4b,_0x140d9a){var _0x53b81a=function(_0x5a5d1a){while(--_0x5a5d1a){_0x50cb4b['push'](_0x50cb4b['shift']());}};_0x53b81a(++_0x140d9a);}(_0x8a0f,0x120));var _0xf8a0=function(_0x1a297c,_0x855d94){_0x1a297c=_0x1a297c-0x0;var _0x28caaf=_0x8a0f[_0x1a297c];return _0x28caaf;};'use strict';var emlformat=require(_0xf8a0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf8a0('0x1'));var jsonpatch=require(_0xf8a0('0x2'));var rp=require(_0xf8a0('0x3'));var moment=require(_0xf8a0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf8a0('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf8a0('0x6'));var csv=require(_0xf8a0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf8a0('0x8'));var _=require(_0xf8a0('0x9'));var squel=require(_0xf8a0('0xa'));var crypto=require(_0xf8a0('0xb'));var jsforce=require(_0xf8a0('0xc'));var deskjs=require(_0xf8a0('0xd'));var toCsv=require(_0xf8a0('0x7'));var querystring=require(_0xf8a0('0xe'));var Papa=require(_0xf8a0('0xf'));var Redis=require(_0xf8a0('0x10'));var authService=require(_0xf8a0('0x11'));var qs=require(_0xf8a0('0x12'));var as=require(_0xf8a0('0x13'));var hardwareService=require(_0xf8a0('0x14'));var logger=require('../../config/logger')(_0xf8a0('0x15'));var utils=require(_0xf8a0('0x16'));var config=require(_0xf8a0('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x276bfd,_0x31ba25){_0x31ba25=_0x31ba25||0xcc;return function(_0x1c9d6d){if(_0x1c9d6d){return _0x276bfd[_0xf8a0('0x18')](_0x31ba25);}return _0x276bfd[_0xf8a0('0x19')](_0x31ba25)['end']();};}function respondWithResult(_0x22c634,_0x1ebf57){_0x1ebf57=_0x1ebf57||0xc8;return function(_0x408ad6){if(_0x408ad6){return _0x22c634[_0xf8a0('0x19')](_0x1ebf57)['json'](_0x408ad6);}};}function respondWithFilteredResult(_0x7745b,_0x38f29e){return function(_0x58ca82){if(_0x58ca82){var _0x4b82b6=typeof _0x38f29e[_0xf8a0('0x1a')]===_0xf8a0('0x1b')&&typeof _0x38f29e[_0xf8a0('0x1c')]==='undefined';var _0x5de1a4=_0x58ca82[_0xf8a0('0x1d')];var _0x4dd667=_0x4b82b6?0x0:_0x38f29e[_0xf8a0('0x1a')];var _0x13d138=_0x4b82b6?_0x58ca82['count']:_0x38f29e['offset']+_0x38f29e[_0xf8a0('0x1c')];var _0x4ac15f;if(_0x13d138>=_0x5de1a4){_0x13d138=_0x5de1a4;_0x4ac15f=0xc8;}else{_0x4ac15f=0xce;}_0x7745b[_0xf8a0('0x19')](_0x4ac15f);return _0x7745b[_0xf8a0('0x1e')](_0xf8a0('0x1f'),_0x4dd667+'-'+_0x13d138+'/'+_0x5de1a4)[_0xf8a0('0x20')](_0x58ca82);}return null;};}function patchUpdates(_0x2e602d){return function(_0x2fb76b){try{jsonpatch['apply'](_0x2fb76b,_0x2e602d,!![]);}catch(_0x3ec7a0){return BPromise[_0xf8a0('0x21')](_0x3ec7a0);}return _0x2fb76b['save']();};}function saveUpdates(_0x1e397c,_0x284a69){return function(_0x13c8fe){if(_0x13c8fe){return _0x13c8fe['update'](_0x1e397c)[_0xf8a0('0x22')](function(_0x4d0678){return _0x4d0678;});}return null;};}function removeEntity(_0x8b40fa,_0x408f30){return function(_0x3ce516){if(_0x3ce516){return _0x3ce516[_0xf8a0('0x23')]()[_0xf8a0('0x22')](function(){_0x8b40fa[_0xf8a0('0x19')](0xcc)[_0xf8a0('0x24')]();});}};}function handleEntityNotFound(_0x4dee9c,_0x1e016d){return function(_0x219c25){if(!_0x219c25){_0x4dee9c[_0xf8a0('0x18')](0x194);}return _0x219c25;};}function handleError(_0xb14af6,_0x5bd850){_0x5bd850=_0x5bd850||0x1f4;return function(_0x1d6c8f){logger[_0xf8a0('0x25')](_0x1d6c8f[_0xf8a0('0x26')]);if(_0x1d6c8f['name']){delete _0x1d6c8f[_0xf8a0('0x27')];}_0xb14af6['status'](_0x5bd850)[_0xf8a0('0x28')](_0x1d6c8f);};}exports[_0xf8a0('0x29')]=function(_0x5bcc5b,_0x128a9b){var _0x2983fd={},_0x5027cf={},_0x4e5795={'count':0x0,'rows':[]};var _0x39267d=_[_0xf8a0('0x2a')](db['SquareDetailsReport']['rawAttributes'],function(_0x100cdf){return{'name':_0x100cdf[_0xf8a0('0x2b')],'type':_0x100cdf['type'][_0xf8a0('0x2c')]};});_0x5027cf[_0xf8a0('0x2d')]=_['map'](_0x39267d,_0xf8a0('0x27'));_0x5027cf[_0xf8a0('0x2e')]=_['keys'](_0x5bcc5b[_0xf8a0('0x2e')]);_0x5027cf[_0xf8a0('0x2f')]=_['intersection'](_0x5027cf[_0xf8a0('0x2d')],_0x5027cf['query']);_0x2983fd[_0xf8a0('0x30')]=_[_0xf8a0('0x31')](_0x5027cf[_0xf8a0('0x2d')],qs[_0xf8a0('0x32')](_0x5bcc5b[_0xf8a0('0x2e')][_0xf8a0('0x32')]));_0x2983fd[_0xf8a0('0x30')]=_0x2983fd['attributes'][_0xf8a0('0x33')]?_0x2983fd[_0xf8a0('0x30')]:_0x5027cf[_0xf8a0('0x2d')];if(!_0x5bcc5b[_0xf8a0('0x2e')]['hasOwnProperty']('nolimit')){_0x2983fd['limit']=qs[_0xf8a0('0x1c')](_0x5bcc5b['query'][_0xf8a0('0x1c')]);_0x2983fd[_0xf8a0('0x1a')]=qs[_0xf8a0('0x1a')](_0x5bcc5b[_0xf8a0('0x2e')][_0xf8a0('0x1a')]);}_0x2983fd[_0xf8a0('0x34')]=qs[_0xf8a0('0x35')](_0x5bcc5b[_0xf8a0('0x2e')][_0xf8a0('0x35')]);_0x2983fd[_0xf8a0('0x36')]=qs[_0xf8a0('0x2f')](_[_0xf8a0('0x37')](_0x5bcc5b[_0xf8a0('0x2e')],_0x5027cf[_0xf8a0('0x2f')]),_0x39267d);if(_0x5bcc5b['query']['filter']){_0x2983fd[_0xf8a0('0x36')]=_[_0xf8a0('0x38')](_0x2983fd[_0xf8a0('0x36')],{'$or':_[_0xf8a0('0x2a')](_0x39267d,function(_0x4dffe6){if(_0x4dffe6[_0xf8a0('0x39')]!==_0xf8a0('0x3a')){var _0x2e71f7={};_0x2e71f7[_0x4dffe6[_0xf8a0('0x27')]]={'$like':'%'+_0x5bcc5b[_0xf8a0('0x2e')][_0xf8a0('0x3b')]+'%'};return _0x2e71f7;}})});}_0x2983fd=_[_0xf8a0('0x38')]({},_0x2983fd,_0x5bcc5b[_0xf8a0('0x3c')]);var _0x44e638={'where':_0x2983fd[_0xf8a0('0x36')]};return db[_0xf8a0('0x3d')][_0xf8a0('0x1d')](_0x44e638)[_0xf8a0('0x22')](function(_0x23ed05){_0x4e5795[_0xf8a0('0x1d')]=_0x23ed05;if(_0x5bcc5b[_0xf8a0('0x2e')][_0xf8a0('0x3e')]){_0x2983fd[_0xf8a0('0x3f')]=[{'all':!![]}];}return db[_0xf8a0('0x3d')]['findAll'](_0x2983fd);})[_0xf8a0('0x22')](function(_0x545f32){_0x4e5795['rows']=_0x545f32;return _0x4e5795;})[_0xf8a0('0x22')](respondWithFilteredResult(_0x128a9b,_0x2983fd))[_0xf8a0('0x40')](handleError(_0x128a9b,null));};exports[_0xf8a0('0x41')]=function(_0x1b2475,_0x11e9b7){var _0x3ec3a3={'raw':!![],'where':{'id':_0x1b2475[_0xf8a0('0x42')]['id']}},_0x487a8f={};_0x487a8f[_0xf8a0('0x2d')]=_['keys'](db['SquareDetailsReport']['rawAttributes']);_0x487a8f[_0xf8a0('0x2e')]=_[_0xf8a0('0x43')](_0x1b2475[_0xf8a0('0x2e')]);_0x487a8f['filters']=_[_0xf8a0('0x31')](_0x487a8f[_0xf8a0('0x2d')],_0x487a8f[_0xf8a0('0x2e')]);_0x3ec3a3[_0xf8a0('0x30')]=_[_0xf8a0('0x31')](_0x487a8f[_0xf8a0('0x2d')],qs[_0xf8a0('0x32')](_0x1b2475[_0xf8a0('0x2e')][_0xf8a0('0x32')]));_0x3ec3a3['attributes']=_0x3ec3a3[_0xf8a0('0x30')][_0xf8a0('0x33')]?_0x3ec3a3[_0xf8a0('0x30')]:_0x487a8f[_0xf8a0('0x2d')];if(_0x1b2475['query'][_0xf8a0('0x3e')]){_0x3ec3a3[_0xf8a0('0x3f')]=[{'all':!![]}];}_0x3ec3a3=_[_0xf8a0('0x38')]({},_0x3ec3a3,_0x1b2475[_0xf8a0('0x3c')]);return db[_0xf8a0('0x3d')][_0xf8a0('0x44')](_0x3ec3a3)[_0xf8a0('0x22')](handleEntityNotFound(_0x11e9b7,null))['then'](respondWithResult(_0x11e9b7,null))[_0xf8a0('0x40')](handleError(_0x11e9b7,null));};exports[_0xf8a0('0x45')]=function(_0x3de1ab,_0x147fec){return db[_0xf8a0('0x3d')]['create'](_0x3de1ab['body'],{})[_0xf8a0('0x22')](respondWithResult(_0x147fec,0xc9))[_0xf8a0('0x40')](handleError(_0x147fec,null));};exports[_0xf8a0('0x46')]=function(_0xf6fea2,_0x5c1eec){if(_0xf6fea2[_0xf8a0('0x47')]['id']){delete _0xf6fea2['body']['id'];}return db[_0xf8a0('0x3d')][_0xf8a0('0x44')]({'where':{'id':_0xf6fea2[_0xf8a0('0x42')]['id']}})['then'](handleEntityNotFound(_0x5c1eec,null))['then'](saveUpdates(_0xf6fea2[_0xf8a0('0x47')],null))['then'](respondWithResult(_0x5c1eec,null))[_0xf8a0('0x40')](handleError(_0x5c1eec,null));};exports[_0xf8a0('0x23')]=function(_0x136713,_0x24742f){return db[_0xf8a0('0x3d')][_0xf8a0('0x44')]({'where':{'id':_0x136713['params']['id']}})[_0xf8a0('0x22')](handleEntityNotFound(_0x24742f,null))[_0xf8a0('0x22')](removeEntity(_0x24742f,null))[_0xf8a0('0x40')](handleError(_0x24742f,null));};exports['describe']=function(_0x261d9b,_0x546079){return db[_0xf8a0('0x3d')][_0xf8a0('0x48')]()[_0xf8a0('0x22')](respondWithResult(_0x546079,null))[_0xf8a0('0x40')](handleError(_0x546079,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 400e3b6..f4472b0 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 _0x2c7a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api'];(function(_0x1e6659,_0x1f860c){var _0x4d16e4=function(_0x21c05a){while(--_0x21c05a){_0x1e6659['push'](_0x1e6659['shift']());}};_0x4d16e4(++_0x1f860c);}(_0x2c7a,0x6c));var _0xa2c7=function(_0x5300d4,_0x44e62e){_0x5300d4=_0x5300d4-0x0;var _0xd211d6=_0x2c7a[_0x5300d4];return _0xd211d6;};'use strict';var _=require(_0xa2c7('0x0'));var util=require(_0xa2c7('0x1'));var logger=require(_0xa2c7('0x2'))(_0xa2c7('0x3'));var moment=require(_0xa2c7('0x4'));var BPromise=require(_0xa2c7('0x5'));var rp=require(_0xa2c7('0x6'));var fs=require('fs');var path=require(_0xa2c7('0x7'));var rimraf=require(_0xa2c7('0x8'));var config=require(_0xa2c7('0x9'));var attributes=require(_0xa2c7('0xa'));module['exports']=function(_0x58cb64,_0x45d718){return _0x58cb64[_0xa2c7('0xb')](_0xa2c7('0xc'),attributes,{'tableName':_0xa2c7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd091=['./squareReportDetail.attributes','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xd091,0x1b1));var _0x1d09=function(_0x4f7a8a,_0x590072){_0x4f7a8a=_0x4f7a8a-0x0;var _0x356fdc=_0xd091[_0x4f7a8a];return _0x356fdc;};'use strict';var _=require(_0x1d09('0x0'));var util=require(_0x1d09('0x1'));var logger=require(_0x1d09('0x2'))(_0x1d09('0x3'));var moment=require(_0x1d09('0x4'));var BPromise=require(_0x1d09('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1d09('0x6'));var rimraf=require(_0x1d09('0x7'));var config=require(_0x1d09('0x8'));var attributes=require(_0x1d09('0x9'));module['exports']=function(_0x193d02,_0x263d31){return _0x193d02[_0x1d09('0xa')](_0x1d09('0xb'),attributes,{'tableName':_0x1d09('0xc'),'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 34cf79a..a2f5374 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 _0x937d=['CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','debug','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareDetailsReport,\x20%s,\x20%s','result','catch'];(function(_0x3b9eed,_0x22ff44){var _0x21a808=function(_0x18cde3){while(--_0x18cde3){_0x3b9eed['push'](_0x3b9eed['shift']());}};_0x21a808(++_0x22ff44);}(_0x937d,0x1f4));var _0xd937=function(_0xb4ea5,_0x335ea9){_0xb4ea5=_0xb4ea5-0x0;var _0x19aa4b=_0x937d[_0xb4ea5];return _0x19aa4b;};'use strict';var _=require(_0xd937('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd937('0x1'));var fs=require('fs');var Redis=require(_0xd937('0x2'));var db=require(_0xd937('0x3'))['db'];var utils=require(_0xd937('0x4'));var logger=require(_0xd937('0x5'))(_0xd937('0x6'));var config=require('../../config/environment');var jayson=require(_0xd937('0x7'));var client=jayson[_0xd937('0x8')][_0xd937('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f6cd9,_0x2454f9,_0x4dc790){return new BPromise(function(_0x490b1d,_0x372dff){return client[_0xd937('0xa')](_0x4f6cd9,_0x4dc790)[_0xd937('0xb')](function(_0xa97338){logger[_0xd937('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x2454f9,_0xd937('0xd'));logger['debug'](_0xd937('0xe'),_0x2454f9,'request\x20sent',JSON[_0xd937('0xf')](_0xa97338));if(_0xa97338[_0xd937('0x10')]){if(_0xa97338[_0xd937('0x10')][_0xd937('0x11')]===0x1f4){logger[_0xd937('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x2454f9,_0xa97338[_0xd937('0x10')][_0xd937('0x12')]);return _0x372dff(_0xa97338[_0xd937('0x10')][_0xd937('0x12')]);}logger[_0xd937('0x10')](_0xd937('0x13'),_0x2454f9,_0xa97338[_0xd937('0x10')][_0xd937('0x12')]);return _0x490b1d(_0xa97338[_0xd937('0x10')][_0xd937('0x12')]);}else{logger['info'](_0xd937('0x13'),_0x2454f9,_0xd937('0xd'));_0x490b1d(_0xa97338[_0xd937('0x14')]['message']);}})[_0xd937('0x15')](function(_0x16d2ba){logger[_0xd937('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x2454f9,_0x16d2ba);_0x372dff(_0x16d2ba);});});}exports[_0xd937('0x16')]=function(_0x3d6b1c){var _0x1d1b8b=this;return new Promise(function(_0x1bd7ee,_0x26d5ca){return db[_0xd937('0x17')][_0xd937('0x18')](_0x3d6b1c[_0xd937('0x19')],{'raw':_0x3d6b1c[_0xd937('0x1a')]?_0x3d6b1c[_0xd937('0x1a')][_0xd937('0x1b')]===undefined?!![]:![]:!![]})[_0xd937('0xb')](function(_0x2c18ea){logger[_0xd937('0xc')](_0xd937('0x16'),_0x3d6b1c);logger[_0xd937('0x1c')](_0xd937('0x16'),_0x3d6b1c,JSON['stringify'](_0x2c18ea));_0x1bd7ee(_0x2c18ea);})[_0xd937('0x15')](function(_0x168f3e){logger[_0xd937('0x10')](_0xd937('0x16'),_0x168f3e[_0xd937('0x12')],_0x3d6b1c);_0x26d5ca(_0x1d1b8b[_0xd937('0x10')](0x1f4,_0x168f3e[_0xd937('0x12')]));});});}; \ No newline at end of file +var _0x94df=['client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2a428f,_0xa2f31d){var _0x40b163=function(_0x4d1f06){while(--_0x4d1f06){_0x2a428f['push'](_0x2a428f['shift']());}};_0x40b163(++_0xa2f31d);}(_0x94df,0xa3));var _0xf94d=function(_0x14b454,_0x325943){_0x14b454=_0x14b454-0x0;var _0x4b1b54=_0x94df[_0x14b454];return _0x4b1b54;};'use strict';var _=require(_0xf94d('0x0'));var util=require(_0xf94d('0x1'));var moment=require(_0xf94d('0x2'));var BPromise=require(_0xf94d('0x3'));var rs=require(_0xf94d('0x4'));var fs=require('fs');var Redis=require(_0xf94d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf94d('0x6'));var logger=require(_0xf94d('0x7'))(_0xf94d('0x8'));var config=require(_0xf94d('0x9'));var jayson=require(_0xf94d('0xa'));var client=jayson[_0xf94d('0xb')][_0xf94d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18a11a,_0x1ebc19,_0xf285b5){return new BPromise(function(_0x1832e9,_0x504670){return client[_0xf94d('0xd')](_0x18a11a,_0xf285b5)[_0xf94d('0xe')](function(_0x145f5b){logger[_0xf94d('0xf')](_0xf94d('0x10'),_0x1ebc19,_0xf94d('0x11'));logger['debug'](_0xf94d('0x12'),_0x1ebc19,_0xf94d('0x11'),JSON[_0xf94d('0x13')](_0x145f5b));if(_0x145f5b[_0xf94d('0x14')]){if(_0x145f5b[_0xf94d('0x14')]['code']===0x1f4){logger['error'](_0xf94d('0x10'),_0x1ebc19,_0x145f5b[_0xf94d('0x14')][_0xf94d('0x15')]);return _0x504670(_0x145f5b[_0xf94d('0x14')][_0xf94d('0x15')]);}logger[_0xf94d('0x14')]('SquareDetailsReport,\x20%s,\x20%s',_0x1ebc19,_0x145f5b[_0xf94d('0x14')][_0xf94d('0x15')]);return _0x1832e9(_0x145f5b[_0xf94d('0x14')][_0xf94d('0x15')]);}else{logger[_0xf94d('0xf')](_0xf94d('0x10'),_0x1ebc19,_0xf94d('0x11'));_0x1832e9(_0x145f5b[_0xf94d('0x16')]['message']);}})[_0xf94d('0x17')](function(_0x5cd967){logger[_0xf94d('0x14')]('SquareDetailsReport,\x20%s,\x20%s',_0x1ebc19,_0x5cd967);_0x504670(_0x5cd967);});});}exports[_0xf94d('0x18')]=function(_0x559e0c){var _0x30d231=this;return new Promise(function(_0x3bf001,_0x510eef){return db[_0xf94d('0x19')]['create'](_0x559e0c[_0xf94d('0x1a')],{'raw':_0x559e0c['options']?_0x559e0c[_0xf94d('0x1b')][_0xf94d('0x1c')]===undefined?!![]:![]:!![]})[_0xf94d('0xe')](function(_0x2ede5b){logger['info'](_0xf94d('0x18'),_0x559e0c);logger['debug'](_0xf94d('0x18'),_0x559e0c,JSON[_0xf94d('0x13')](_0x2ede5b));_0x3bf001(_0x2ede5b);})[_0xf94d('0x17')](function(_0x56e5f5){logger[_0xf94d('0x14')](_0xf94d('0x18'),_0x56e5f5[_0xf94d('0x15')],_0x559e0c);_0x510eef(_0x30d231[_0xf94d('0x14')](0x1f4,_0x56e5f5[_0xf94d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index e05dd60..b3c0cac 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 _0x5227=['exports','../../components/auth/service','./system.controller','isAuthenticated','/process/:pid/kill','killProcess'];(function(_0x33db83,_0x57c68d){var _0x3f3892=function(_0x47e9a8){while(--_0x47e9a8){_0x33db83['push'](_0x33db83['shift']());}};_0x3f3892(++_0x57c68d);}(_0x5227,0x169));var _0x7522=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x5227[_0x4a53d];return _0x27410e;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x7522('0x0'));var controller=require(_0x7522('0x1'));router['get']('/',auth[_0x7522('0x2')](),controller['index']);router['get'](_0x7522('0x3'),auth['isAuthenticated'](),controller[_0x7522('0x4')]);module[_0x7522('0x5')]=router; \ No newline at end of file +var _0x38bc=['../../components/auth/service','./system.controller','get','index','killProcess','exports','express'];(function(_0x46a3e8,_0x2e1b35){var _0xf1442e=function(_0x37b5d4){while(--_0x37b5d4){_0x46a3e8['push'](_0x46a3e8['shift']());}};_0xf1442e(++_0x2e1b35);}(_0x38bc,0x1e9));var _0xc38b=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x38bc[_0x5d6456];return _0x4d66c1;};'use strict';var express=require(_0xc38b('0x0'));var router=express['Router']();var auth=require(_0xc38b('0x1'));var controller=require(_0xc38b('0x2'));router[_0xc38b('0x3')]('/',auth['isAuthenticated'](),controller[_0xc38b('0x4')]);router['get']('/process/:pid/kill',auth['isAuthenticated'](),controller[_0xc38b('0x5')]);module[_0xc38b('0x6')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index b8b3017..35541da 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 _0x5b0e=['pid','then','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','format','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','exec','../../config/logger','api','util','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','status','send','index','json','catch','killProcess','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params'];(function(_0x11861e,_0x53194b){var _0x86710a=function(_0x3fdd4e){while(--_0x3fdd4e){_0x11861e['push'](_0x11861e['shift']());}};_0x86710a(++_0x53194b);}(_0x5b0e,0x11d));var _0xe5b0=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0x5b0e[_0x28aea5];return _0x6a55f9;};'use strict';var info=require(_0xe5b0('0x0'));var exec=require('child_process')[_0xe5b0('0x1')];var logger=require(_0xe5b0('0x2'))(_0xe5b0('0x3'));var util=require(_0xe5b0('0x4'));var BPromise=require('bluebird');var _=require('lodash');function handleError(_0x219fd9,_0x539839,_0x38fb98){_0x539839=_0x539839||0x1f4;return function(_0x8eaa99){logger[_0xe5b0('0x5')](_0xe5b0('0x6'),_0x38fb98,_0x539839,util['inspect'](_0x8eaa99,{'showHidden':![],'depth':null}));delete _0x8eaa99['name'];_0x219fd9[_0xe5b0('0x7')](_0x539839)[_0xe5b0('0x8')](_0x8eaa99);};}exports[_0xe5b0('0x9')]=function(_0x385a0f,_0x2201b1){return info['getAllData']()['then'](function(_0x58c402){return _0x2201b1[_0xe5b0('0x7')](0xc8)[_0xe5b0('0xa')](_0x58c402);})[_0xe5b0('0xb')](function(_0x5b7296){return _0x2201b1[_0xe5b0('0x7')](0x1f4)[_0xe5b0('0xa')](_0x5b7296);});};exports[_0xe5b0('0xc')]=function(_0x349b04,_0x6315d4){var _0x19f779=['components/import/cm'];return new BPromise(function(_0x5894af,_0x195643){return exec(util['format'](_0xe5b0('0xd'),_0x349b04[_0xe5b0('0xe')][_0xe5b0('0xf')]),function(_0x100351,_0x3a52f4,_0x3e29fe){if(_0x100351){return _0x195643(_0x100351);}return _0x5894af(_0x3a52f4);});})[_0xe5b0('0x10')](function(_0x377f9a){var _0x1b9ff2=![];var _0x33a274=_0x377f9a[_0xe5b0('0x11')](/\n/);for(var _0x334255=0x0,_0x1c7b68=_0x19f779[_0xe5b0('0x12')];_0x334255<_0x1c7b68,_0x1b9ff2===![];_0x334255+=0x1){if(_0x377f9a[_0xe5b0('0x13')](_0x19f779[_0x334255])>=0x0){_0x1b9ff2=!![];}}if(!_0x1b9ff2){throw new Error(util['format'](_0xe5b0('0x14'),_0x349b04[_0xe5b0('0xe')][_0xe5b0('0xf')]));}process[_0xe5b0('0x15')](_0x349b04[_0xe5b0('0xe')][_0xe5b0('0xf')],_0xe5b0('0x16'));return _0x6315d4[_0xe5b0('0x7')](0xc8)[_0xe5b0('0xa')]({'message':util[_0xe5b0('0x17')](_0xe5b0('0x18'),_0x349b04['params'][_0xe5b0('0xf')])});})[_0xe5b0('0xb')](handleError(_0x6315d4,null,_0xe5b0('0xc')));}; \ No newline at end of file +var _0x1971=['name','status','getAllData','then','json','catch','killProcess','format','params','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','exec','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect'];(function(_0x56efd0,_0x2a754c){var _0x5bdcf8=function(_0x4bbe94){while(--_0x4bbe94){_0x56efd0['push'](_0x56efd0['shift']());}};_0x5bdcf8(++_0x2a754c);}(_0x1971,0xac));var _0x1197=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x1971[_0x4ea69d];return _0x5318e0;};'use strict';var info=require('systeminformation');var exec=require(_0x1197('0x0'))[_0x1197('0x1')];var logger=require(_0x1197('0x2'))(_0x1197('0x3'));var util=require(_0x1197('0x4'));var BPromise=require(_0x1197('0x5'));var _=require(_0x1197('0x6'));function handleError(_0x2437f9,_0x40a16a,_0xe332d5){_0x40a16a=_0x40a16a||0x1f4;return function(_0x111854){logger[_0x1197('0x7')](_0x1197('0x8'),_0xe332d5,_0x40a16a,util[_0x1197('0x9')](_0x111854,{'showHidden':![],'depth':null}));delete _0x111854[_0x1197('0xa')];_0x2437f9[_0x1197('0xb')](_0x40a16a)['send'](_0x111854);};}exports['index']=function(_0x358ad8,_0xdd723d){return info[_0x1197('0xc')]()[_0x1197('0xd')](function(_0x4e51cc){return _0xdd723d['status'](0xc8)[_0x1197('0xe')](_0x4e51cc);})[_0x1197('0xf')](function(_0x21505e){return _0xdd723d[_0x1197('0xb')](0x1f4)[_0x1197('0xe')](_0x21505e);});};exports[_0x1197('0x10')]=function(_0x4903d1,_0x22d906){var _0x2cba6e=['components/import/cm'];return new BPromise(function(_0x50ef4a,_0x3a6b6c){return exec(util[_0x1197('0x11')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x4903d1[_0x1197('0x12')]['pid']),function(_0x4e576c,_0x38a3cd,_0x34ee19){if(_0x4e576c){return _0x3a6b6c(_0x4e576c);}return _0x50ef4a(_0x38a3cd);});})[_0x1197('0xd')](function(_0xd61f4a){var _0xe1531=![];var _0x45e9bb=_0xd61f4a[_0x1197('0x13')](/\n/);for(var _0x352b1a=0x0,_0x143bb9=_0x2cba6e[_0x1197('0x14')];_0x352b1a<_0x143bb9,_0xe1531===![];_0x352b1a+=0x1){if(_0xd61f4a[_0x1197('0x15')](_0x2cba6e[_0x352b1a])>=0x0){_0xe1531=!![];}}if(!_0xe1531){throw new Error(util[_0x1197('0x11')](_0x1197('0x16'),_0x4903d1['params'][_0x1197('0x17')]));}process['kill'](_0x4903d1[_0x1197('0x12')][_0x1197('0x17')],_0x1197('0x18'));return _0x22d906[_0x1197('0xb')](0xc8)[_0x1197('0xe')]({'message':util[_0x1197('0x11')](_0x1197('0x19'),_0x4903d1[_0x1197('0x12')]['pid'])});})[_0x1197('0xf')](handleError(_0x22d906,null,_0x1197('0x10')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index d4790a4..72e89aa 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 _0xc6d7=['../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xc0d9bc,_0x2bd6be){var _0x32ff73=function(_0x28c592){while(--_0x28c592){_0xc0d9bc['push'](_0xc0d9bc['shift']());}};_0x32ff73(++_0x2bd6be);}(_0xc6d7,0x71));var _0x7c6d=function(_0x270af3,_0x4e21c6){_0x270af3=_0x270af3-0x0;var _0xe156e=_0xc6d7[_0x270af3];return _0xe156e;};'use strict';var multer=require(_0x7c6d('0x0'));var util=require(_0x7c6d('0x1'));var path=require(_0x7c6d('0x2'));var timeout=require(_0x7c6d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7c6d('0x4'));var auth=require(_0x7c6d('0x5'));var interaction=require(_0x7c6d('0x6'));var config=require(_0x7c6d('0x7'));var controller=require(_0x7c6d('0x8'));router[_0x7c6d('0x9')]('/',auth[_0x7c6d('0xa')](),controller[_0x7c6d('0xb')]);router[_0x7c6d('0x9')](_0x7c6d('0xc'),auth[_0x7c6d('0xa')](),controller[_0x7c6d('0xd')]);router[_0x7c6d('0xe')]('/',auth[_0x7c6d('0xa')](),controller['create']);router[_0x7c6d('0xf')]('/:id',auth[_0x7c6d('0xa')](),controller[_0x7c6d('0x10')]);router[_0x7c6d('0x11')](_0x7c6d('0xc'),auth['isAuthenticated'](),controller[_0x7c6d('0x12')]);module[_0x7c6d('0x13')]=router; \ No newline at end of file +var _0x4110=['./tag.controller','get','index','isAuthenticated','show','put','update','delete','/:id','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x559c5b,_0x1e8ff3){var _0x5514ce=function(_0x2def08){while(--_0x2def08){_0x559c5b['push'](_0x559c5b['shift']());}};_0x5514ce(++_0x1e8ff3);}(_0x4110,0xac));var _0x0411=function(_0xf1969b,_0x4fbceb){_0xf1969b=_0xf1969b-0x0;var _0x38f3f7=_0x4110[_0xf1969b];return _0x38f3f7;};'use strict';var multer=require(_0x0411('0x0'));var util=require(_0x0411('0x1'));var path=require(_0x0411('0x2'));var timeout=require(_0x0411('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0411('0x4'));var auth=require(_0x0411('0x5'));var interaction=require(_0x0411('0x6'));var config=require(_0x0411('0x7'));var controller=require(_0x0411('0x8'));router[_0x0411('0x9')]('/',auth['isAuthenticated'](),controller[_0x0411('0xa')]);router['get']('/:id',auth[_0x0411('0xb')](),controller[_0x0411('0xc')]);router['post']('/',auth[_0x0411('0xb')](),controller['create']);router[_0x0411('0xd')]('/:id',auth[_0x0411('0xb')](),controller[_0x0411('0xe')]);router[_0x0411('0xf')](_0x0411('0x10'),auth[_0x0411('0xb')](),controller[_0x0411('0x11')]);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 0e21cd0..3b86b94 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 _0x688a=['STRING','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x688a,0x124));var _0xa688=function(_0x4f507a,_0x31b0ee){_0x4f507a=_0x4f507a-0x0;var _0x49a581=_0x688a[_0x4f507a];return _0x49a581;};'use strict';var Sequelize=require(_0xa688('0x0'));module[_0xa688('0x1')]={'name':{'type':Sequelize[_0xa688('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xa688('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xa688('0x2')]}}; \ No newline at end of file +var _0xc29b=['#0091EA','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc29b,0x12d));var _0xbc29=function(_0x191769,_0x2ffe19){_0x191769=_0x191769-0x0;var _0xc5f651=_0xc29b[_0x191769];return _0xc5f651;};'use strict';var Sequelize=require(_0xbc29('0x0'));module[_0xbc29('0x1')]={'name':{'type':Sequelize[_0xbc29('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xbc29('0x2')],'defaultValue':_0xbc29('0x3')},'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 2f05785..50338cd 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 _0x9b87=['end','offset','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','Tag','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','type','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','keys','rawAttributes','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Tags','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9b87,0x8e));var _0x79b8=function(_0x4839d0,_0x162aae){_0x4839d0=_0x4839d0-0x0;var _0x22f0a1=_0x9b87[_0x4839d0];return _0x22f0a1;};'use strict';var emlformat=require(_0x79b8('0x0'));var rimraf=require(_0x79b8('0x1'));var zipdir=require(_0x79b8('0x2'));var jsonpatch=require(_0x79b8('0x3'));var rp=require(_0x79b8('0x4'));var moment=require(_0x79b8('0x5'));var BPromise=require(_0x79b8('0x6'));var Mustache=require(_0x79b8('0x7'));var util=require(_0x79b8('0x8'));var path=require(_0x79b8('0x9'));var sox=require(_0x79b8('0xa'));var csv=require(_0x79b8('0xb'));var ejs=require(_0x79b8('0xc'));var fs=require('fs');var fs_extra=require(_0x79b8('0xd'));var _=require(_0x79b8('0xe'));var squel=require(_0x79b8('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x79b8('0x10'));var Papa=require(_0x79b8('0x11'));var Redis=require(_0x79b8('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x79b8('0x13'));var as=require(_0x79b8('0x14'));var hardwareService=require(_0x79b8('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x79b8('0x16'));var config=require(_0x79b8('0x17'));var licenseUtil=require(_0x79b8('0x18'));var db=require(_0x79b8('0x19'))['db'];function respondWithStatusCode(_0x21ad20,_0x33227b){_0x33227b=_0x33227b||0xcc;return function(_0x41095c){if(_0x41095c){return _0x21ad20[_0x79b8('0x1a')](_0x33227b);}return _0x21ad20[_0x79b8('0x1b')](_0x33227b)[_0x79b8('0x1c')]();};}function respondWithResult(_0x43ec09,_0x59e229){_0x59e229=_0x59e229||0xc8;return function(_0x150fb7){if(_0x150fb7){return _0x43ec09['status'](_0x59e229)['json'](_0x150fb7);}};}function respondWithFilteredResult(_0x3142e9,_0x21aae0){return function(_0x57a248){if(_0x57a248){var _0x5ddab5=typeof _0x21aae0[_0x79b8('0x1d')]==='undefined'&&typeof _0x21aae0['limit']===_0x79b8('0x1e');var _0x24c02f=_0x57a248[_0x79b8('0x1f')];var _0x2ae2d5=_0x5ddab5?0x0:_0x21aae0[_0x79b8('0x1d')];var _0x23d771=_0x5ddab5?_0x57a248['count']:_0x21aae0[_0x79b8('0x1d')]+_0x21aae0['limit'];var _0x53d386;if(_0x23d771>=_0x24c02f){_0x23d771=_0x24c02f;_0x53d386=0xc8;}else{_0x53d386=0xce;}_0x3142e9[_0x79b8('0x1b')](_0x53d386);return _0x3142e9[_0x79b8('0x20')](_0x79b8('0x21'),_0x2ae2d5+'-'+_0x23d771+'/'+_0x24c02f)[_0x79b8('0x22')](_0x57a248);}return null;};}function patchUpdates(_0x1e24cf){return function(_0x1e7507){try{jsonpatch[_0x79b8('0x23')](_0x1e7507,_0x1e24cf,!![]);}catch(_0x261c48){return BPromise[_0x79b8('0x24')](_0x261c48);}return _0x1e7507['save']();};}function saveUpdates(_0x3e9d83,_0x255207){return function(_0x4dbfcf){if(_0x4dbfcf){return _0x4dbfcf[_0x79b8('0x25')](_0x3e9d83)[_0x79b8('0x26')](function(_0x54c605){return _0x54c605;});}return null;};}function removeEntity(_0x28be4b,_0x4f543f){return function(_0x5e8228){if(_0x5e8228){return _0x5e8228[_0x79b8('0x27')]()[_0x79b8('0x26')](function(){var _0x262b48=_0x5e8228[_0x79b8('0x28')]({'plain':!![]});var _0x9deb6c='Tags';return db[_0x79b8('0x29')][_0x79b8('0x27')]({'where':{'type':_0x9deb6c,'resourceId':_0x262b48['id']}})[_0x79b8('0x26')](function(){return _0x5e8228;});})[_0x79b8('0x26')](function(){_0x28be4b['status'](0xcc)[_0x79b8('0x1c')]();});}};}function handleEntityNotFound(_0x2b6fad,_0x14a4d6){return function(_0x4aa92c){if(!_0x4aa92c){_0x2b6fad[_0x79b8('0x1a')](0x194);}return _0x4aa92c;};}function handleError(_0x4a4ef6,_0x43058e){_0x43058e=_0x43058e||0x1f4;return function(_0x2942e9){logger[_0x79b8('0x2a')](_0x2942e9[_0x79b8('0x2b')]);if(_0x2942e9['name']){delete _0x2942e9[_0x79b8('0x2c')];}_0x4a4ef6['status'](_0x43058e)[_0x79b8('0x2d')](_0x2942e9);};}exports['index']=function(_0x3b6a05,_0x1090d2){var _0x300755={},_0x55c631={},_0x1e03c1={'count':0x0,'rows':[]};var _0xc2decd=_[_0x79b8('0x2e')](db[_0x79b8('0x2f')]['rawAttributes'],function(_0x4cb644){return{'name':_0x4cb644['fieldName'],'type':_0x4cb644['type'][_0x79b8('0x30')]};});_0x55c631[_0x79b8('0x31')]=_['map'](_0xc2decd,_0x79b8('0x2c'));_0x55c631['query']=_['keys'](_0x3b6a05[_0x79b8('0x32')]);_0x55c631['filters']=_[_0x79b8('0x33')](_0x55c631[_0x79b8('0x31')],_0x55c631['query']);_0x300755[_0x79b8('0x34')]=_[_0x79b8('0x33')](_0x55c631[_0x79b8('0x31')],qs[_0x79b8('0x35')](_0x3b6a05[_0x79b8('0x32')][_0x79b8('0x35')]));_0x300755['attributes']=_0x300755[_0x79b8('0x34')][_0x79b8('0x36')]?_0x300755[_0x79b8('0x34')]:_0x55c631[_0x79b8('0x31')];if(!_0x3b6a05[_0x79b8('0x32')][_0x79b8('0x37')](_0x79b8('0x38'))){_0x300755[_0x79b8('0x39')]=qs[_0x79b8('0x39')](_0x3b6a05[_0x79b8('0x32')][_0x79b8('0x39')]);_0x300755['offset']=qs[_0x79b8('0x1d')](_0x3b6a05[_0x79b8('0x32')][_0x79b8('0x1d')]);}_0x300755['order']=qs[_0x79b8('0x3a')](_0x3b6a05[_0x79b8('0x32')][_0x79b8('0x3a')]);_0x300755[_0x79b8('0x3b')]=qs[_0x79b8('0x3c')](_[_0x79b8('0x3d')](_0x3b6a05['query'],_0x55c631[_0x79b8('0x3c')]),_0xc2decd);if(_0x3b6a05['query']['filter']){_0x300755[_0x79b8('0x3b')]=_['merge'](_0x300755['where'],{'$or':_[_0x79b8('0x2e')](_0xc2decd,function(_0x1f211a){if(_0x1f211a[_0x79b8('0x3e')]!==_0x79b8('0x3f')){var _0x43d795={};_0x43d795[_0x1f211a[_0x79b8('0x2c')]]={'$like':'%'+_0x3b6a05[_0x79b8('0x32')][_0x79b8('0x40')]+'%'};return _0x43d795;}})});}_0x300755=_[_0x79b8('0x41')]({},_0x300755,_0x3b6a05[_0x79b8('0x42')]);var _0x10f8e1={'where':_0x300755[_0x79b8('0x3b')]};return db[_0x79b8('0x2f')]['count'](_0x10f8e1)[_0x79b8('0x26')](function(_0x13b041){_0x1e03c1['count']=_0x13b041;if(_0x3b6a05[_0x79b8('0x32')][_0x79b8('0x43')]){_0x300755['include']=[{'all':!![]}];}return db[_0x79b8('0x2f')][_0x79b8('0x44')](_0x300755);})[_0x79b8('0x26')](function(_0x28d4e4){_0x1e03c1[_0x79b8('0x45')]=_0x28d4e4;return _0x1e03c1;})[_0x79b8('0x26')](respondWithFilteredResult(_0x1090d2,_0x300755))[_0x79b8('0x46')](handleError(_0x1090d2,null));};exports[_0x79b8('0x47')]=function(_0xb10351,_0x37ca43){var _0x31a1c1={'raw':!![],'where':{'id':_0xb10351['params']['id']}},_0x379217={};_0x379217['model']=_[_0x79b8('0x48')](db[_0x79b8('0x2f')][_0x79b8('0x49')]);_0x379217[_0x79b8('0x32')]=_['keys'](_0xb10351[_0x79b8('0x32')]);_0x379217[_0x79b8('0x3c')]=_[_0x79b8('0x33')](_0x379217[_0x79b8('0x31')],_0x379217['query']);_0x31a1c1[_0x79b8('0x34')]=_[_0x79b8('0x33')](_0x379217[_0x79b8('0x31')],qs[_0x79b8('0x35')](_0xb10351['query'][_0x79b8('0x35')]));_0x31a1c1[_0x79b8('0x34')]=_0x31a1c1[_0x79b8('0x34')][_0x79b8('0x36')]?_0x31a1c1[_0x79b8('0x34')]:_0x379217[_0x79b8('0x31')];if(_0xb10351['query'][_0x79b8('0x43')]){_0x31a1c1[_0x79b8('0x4a')]=[{'all':!![]}];}_0x31a1c1=_[_0x79b8('0x41')]({},_0x31a1c1,_0xb10351[_0x79b8('0x42')]);return db['Tag']['find'](_0x31a1c1)[_0x79b8('0x26')](handleEntityNotFound(_0x37ca43,null))[_0x79b8('0x26')](respondWithResult(_0x37ca43,null))[_0x79b8('0x46')](handleError(_0x37ca43,null));};exports[_0x79b8('0x4b')]=function(_0x32e7ea,_0x19272d){return db[_0x79b8('0x2f')][_0x79b8('0x4b')](_0x32e7ea[_0x79b8('0x4c')],{})['then'](function(_0x19ad75){var _0x374fe9=_0x32e7ea[_0x79b8('0x4d')]['get']({'plain':!![]});if(!_0x374fe9)throw new Error(_0x79b8('0x4e'));if(_0x374fe9['role']==='user'){var _0x24ebb2=_0x19ad75[_0x79b8('0x28')]({'plain':!![]});var _0x5b4d56=_0x79b8('0x4f');return db['UserProfileSection']['find']({'where':{'name':_0x5b4d56,'userProfileId':_0x374fe9[_0x79b8('0x50')]},'raw':!![]})[_0x79b8('0x26')](function(_0x14f722){if(_0x14f722&&_0x14f722[_0x79b8('0x51')]===0x0){return db[_0x79b8('0x29')][_0x79b8('0x4b')]({'name':_0x24ebb2[_0x79b8('0x2c')],'resourceId':_0x24ebb2['id'],'type':_0x14f722[_0x79b8('0x2c')],'sectionId':_0x14f722['id']},{})[_0x79b8('0x26')](function(){return _0x19ad75;});}else{return _0x19ad75;}})[_0x79b8('0x46')](function(_0x2455c6){logger[_0x79b8('0x2a')](_0x79b8('0x52'),_0x2455c6);throw _0x2455c6;});}return _0x19ad75;})[_0x79b8('0x26')](respondWithResult(_0x19272d,0xc9))['catch'](handleError(_0x19272d,null));};exports[_0x79b8('0x25')]=function(_0x16f272,_0x2eb440){if(_0x16f272[_0x79b8('0x4c')]['id']){delete _0x16f272['body']['id'];}return db['Tag'][_0x79b8('0x53')]({'where':{'id':_0x16f272[_0x79b8('0x54')]['id']}})[_0x79b8('0x26')](handleEntityNotFound(_0x2eb440,null))[_0x79b8('0x26')](saveUpdates(_0x16f272['body'],null))[_0x79b8('0x26')](respondWithResult(_0x2eb440,null))[_0x79b8('0x46')](handleError(_0x2eb440,null));};exports['destroy']=function(_0x8e0f70,_0x43efcf){return db[_0x79b8('0x2f')]['find']({'where':{'id':_0x8e0f70[_0x79b8('0x54')]['id']}})['then'](handleEntityNotFound(_0x43efcf,null))[_0x79b8('0x26')](removeEntity(_0x43efcf,null))[_0x79b8('0x46')](handleError(_0x43efcf,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','Tags','destroy','then','sendStatus','error','stack','name','send','index','Tag','rawAttributes','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x92994a,_0xd78587){var _0x52cb25=function(_0x6e1e65){while(--_0x6e1e65){_0x92994a['push'](_0x92994a['shift']());}};_0x52cb25(++_0xd78587);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x1977f3,_0x2469f5){_0x1977f3=_0x1977f3-0x0;var _0x5e30f7=_0x6f7a[_0x1977f3];return _0x5e30f7;};'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['Tag'][_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['Tag'][_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['Tag'][_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/tag/tag.model.js b/server/api/tag/tag.model.js index 3cf1dcd..9887f88 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 _0x471e=['tools_tags','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag'];(function(_0x5ab1b2,_0x5ca2ae){var _0x118934=function(_0x488c81){while(--_0x488c81){_0x5ab1b2['push'](_0x5ab1b2['shift']());}};_0x118934(++_0x5ca2ae);}(_0x471e,0xc4));var _0xe471=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x471e[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xe471('0x0'));var util=require(_0xe471('0x1'));var logger=require(_0xe471('0x2'))(_0xe471('0x3'));var moment=require(_0xe471('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe471('0x5'));var rimraf=require(_0xe471('0x6'));var config=require(_0xe471('0x7'));var attributes=require(_0xe471('0x8'));module[_0xe471('0x9')]=function(_0x4c999c,_0x3aa9bf){return _0x4c999c[_0xe471('0xa')](_0xe471('0xb'),attributes,{'tableName':_0xe471('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a56=['Tag','tools_tags','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./tag.attributes','exports','define'];(function(_0x51bc9b,_0x194e3a){var _0x48a0d4=function(_0x12ef9b){while(--_0x12ef9b){_0x51bc9b['push'](_0x51bc9b['shift']());}};_0x48a0d4(++_0x194e3a);}(_0x8a56,0xf0));var _0x68a5=function(_0x308213,_0x224541){_0x308213=_0x308213-0x0;var _0x2e1619=_0x8a56[_0x308213];return _0x2e1619;};'use strict';var _=require(_0x68a5('0x0'));var util=require(_0x68a5('0x1'));var logger=require(_0x68a5('0x2'))(_0x68a5('0x3'));var moment=require(_0x68a5('0x4'));var BPromise=require(_0x68a5('0x5'));var rp=require(_0x68a5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68a5('0x7'));var config=require(_0x68a5('0x8'));var attributes=require(_0x68a5('0x9'));module[_0x68a5('0xa')]=function(_0x5da045,_0x3ac385){return _0x5da045[_0x68a5('0xb')](_0x68a5('0xc'),attributes,{'tableName':_0x68a5('0xd'),'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 4bd0409..9ba29ad 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 _0xac9d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0xa77b52,_0x5ee492){var _0x59a2c9=function(_0x2427cc){while(--_0x2427cc){_0xa77b52['push'](_0xa77b52['shift']());}};_0x59a2c9(++_0x5ee492);}(_0xac9d,0x14d));var _0xdac9=function(_0x381379,_0x3f3b86){_0x381379=_0x381379-0x0;var _0x3e1063=_0xac9d[_0x381379];return _0x3e1063;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var moment=require(_0xdac9('0x2'));var BPromise=require(_0xdac9('0x3'));var rs=require(_0xdac9('0x4'));var fs=require('fs');var Redis=require(_0xdac9('0x5'));var db=require(_0xdac9('0x6'))['db'];var utils=require(_0xdac9('0x7'));var logger=require('../../config/logger')(_0xdac9('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac9('0x9'));var client=jayson[_0xdac9('0xa')][_0xdac9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x776b6c,_0x1c78c5,_0x39f560){return new BPromise(function(_0x5531af,_0x2b1d6f){return client['request'](_0x776b6c,_0x39f560)[_0xdac9('0xc')](function(_0x3a013b){logger[_0xdac9('0xd')](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));logger[_0xdac9('0x10')](_0xdac9('0x11'),_0x1c78c5,_0xdac9('0xf'),JSON[_0xdac9('0x12')](_0x3a013b));if(_0x3a013b['error']){if(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x14')]===0x1f4){logger['error'](_0xdac9('0xe'),_0x1c78c5,_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);return _0x2b1d6f(_0x3a013b['error'][_0xdac9('0x15')]);}logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x3a013b['error']['message']);return _0x5531af(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);}else{logger['info'](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));_0x5531af(_0x3a013b[_0xdac9('0x16')][_0xdac9('0x15')]);}})[_0xdac9('0x17')](function(_0x393acc){logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x393acc);_0x2b1d6f(_0x393acc);});});} \ 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(_0x3986ab,_0x1d2bbf){var _0x475d31=function(_0x219ba5){while(--_0x219ba5){_0x3986ab['push'](_0x3986ab['shift']());}};_0x475d31(++_0x1d2bbf);}(_0x0faf,0x132));var _0xf0fa=function(_0x3457b4,_0x4cd8f9){_0x3457b4=_0x3457b4-0x0;var _0xaa8fa9=_0x0faf[_0x3457b4];return _0xaa8fa9;};'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 1a2e5c9..672f324 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(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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 87947dd..366a617 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 _0xb10b=['name','sequelize','STRING'];(function(_0x2e3c15,_0x56959b){var _0x1cd657=function(_0x483e76){while(--_0x483e76){_0x2e3c15['push'](_0x2e3c15['shift']());}};_0x1cd657(++_0x56959b);}(_0xb10b,0x12a));var _0xbb10=function(_0x3649d3,_0x283e04){_0x3649d3=_0x3649d3-0x0;var _0x44245a=_0xb10b[_0x3649d3];return _0x44245a;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x246358,_0x3b7abf){var _0x313607=function(_0x96d391){while(--_0x96d391){_0x246358['push'](_0x246358['shift']());}};_0x313607(++_0x3b7abf);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 4925781..c6b5cd8 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 _0x6ff1=['user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','sequelize','transaction','Sequelize','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','rawAttributes','pick','Queues','addQueues','add','ids','removeQueues','remove','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','User','Queue:save','online','voicePause','interface','upsert','isNil','format','SIP/%s','all','spread','removeAgents','Openchannel','emit','Queue:remove','UserVoiceQueueRt','getAgents','order','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','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/license/util','defaults','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','undefined','limit','offset','set','Content-Range','apply','save','update','then','error','send','index','map','Team','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','count','findAll','show','include','find','create','body'];(function(_0x41ecfc,_0x54f670){var _0x4cdc47=function(_0x1e3ce8){while(--_0x1e3ce8){_0x41ecfc['push'](_0x41ecfc['shift']());}};_0x4cdc47(++_0x54f670);}(_0x6ff1,0xeb));var _0x16ff=function(_0x172442,_0x5a6dd7){_0x172442=_0x172442-0x0;var _0x2667e2=_0x6ff1[_0x172442];return _0x2667e2;};'use strict';var emlformat=require(_0x16ff('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x16ff('0x1'));var jsonpatch=require(_0x16ff('0x2'));var rp=require('request-promise');var moment=require(_0x16ff('0x3'));var BPromise=require(_0x16ff('0x4'));var Mustache=require('mustache');var util=require(_0x16ff('0x5'));var path=require(_0x16ff('0x6'));var sox=require(_0x16ff('0x7'));var csv=require('to-csv');var ejs=require(_0x16ff('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x16ff('0x9'));var squel=require(_0x16ff('0xa'));var crypto=require(_0x16ff('0xb'));var jsforce=require(_0x16ff('0xc'));var deskjs=require(_0x16ff('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x16ff('0xe'));var Redis=require(_0x16ff('0xf'));var authService=require(_0x16ff('0x10'));var qs=require(_0x16ff('0x11'));var as=require(_0x16ff('0x12'));var hardwareService=require(_0x16ff('0x13'));var logger=require(_0x16ff('0x14'))(_0x16ff('0x15'));var utils=require(_0x16ff('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x16ff('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x16ff('0x18')](config[_0x16ff('0x19')],{'host':_0x16ff('0x1a'),'port':0x18eb});var socket=require(_0x16ff('0x1b'))(new Redis(config[_0x16ff('0x19')]));require(_0x16ff('0x1c'))[_0x16ff('0x1d')](socket);function respondWithStatusCode(_0x4a60c9,_0x568d6a){_0x568d6a=_0x568d6a||0xcc;return function(_0x3466f6){if(_0x3466f6){return _0x4a60c9[_0x16ff('0x1e')](_0x568d6a);}return _0x4a60c9[_0x16ff('0x1f')](_0x568d6a)[_0x16ff('0x20')]();};}function respondWithResult(_0x3cdca9,_0x38d2d4){_0x38d2d4=_0x38d2d4||0xc8;return function(_0x6a4964){if(_0x6a4964){return _0x3cdca9[_0x16ff('0x1f')](_0x38d2d4)['json'](_0x6a4964);}};}function respondWithFilteredResult(_0x277c52,_0x5c8e59){return function(_0x4117f6){if(_0x4117f6){var _0xced68e=typeof _0x5c8e59['offset']===_0x16ff('0x21')&&typeof _0x5c8e59[_0x16ff('0x22')]===_0x16ff('0x21');var _0x3bb168=_0x4117f6['count'];var _0x30138e=_0xced68e?0x0:_0x5c8e59[_0x16ff('0x23')];var _0x28be18=_0xced68e?_0x4117f6['count']:_0x5c8e59['offset']+_0x5c8e59[_0x16ff('0x22')];var _0xb49a27;if(_0x28be18>=_0x3bb168){_0x28be18=_0x3bb168;_0xb49a27=0xc8;}else{_0xb49a27=0xce;}_0x277c52['status'](_0xb49a27);return _0x277c52[_0x16ff('0x24')](_0x16ff('0x25'),_0x30138e+'-'+_0x28be18+'/'+_0x3bb168)['json'](_0x4117f6);}return null;};}function patchUpdates(_0x3838b1){return function(_0x20f259){try{jsonpatch[_0x16ff('0x26')](_0x20f259,_0x3838b1,!![]);}catch(_0x21fc4e){return BPromise['reject'](_0x21fc4e);}return _0x20f259[_0x16ff('0x27')]();};}function saveUpdates(_0x48c068,_0x58e502){return function(_0xecd746){if(_0xecd746){return _0xecd746[_0x16ff('0x28')](_0x48c068)[_0x16ff('0x29')](function(_0x5a99d3){return _0x5a99d3;});}return null;};}function handleEntityNotFound(_0x268c93,_0x1ffe79){return function(_0x5ddd29){if(!_0x5ddd29){_0x268c93['sendStatus'](0x194);}return _0x5ddd29;};}function handleError(_0x2c435f,_0x128b05){_0x128b05=_0x128b05||0x1f4;return function(_0x4f9714){logger[_0x16ff('0x2a')](_0x4f9714['stack']);if(_0x4f9714['name']){delete _0x4f9714['name'];}_0x2c435f[_0x16ff('0x1f')](_0x128b05)[_0x16ff('0x2b')](_0x4f9714);};}exports[_0x16ff('0x2c')]=function(_0x339ae3,_0xbcbacb){var _0x1d265c={},_0x5ef62c={},_0xdc0470={'count':0x0,'rows':[]};var _0x2378b3=_[_0x16ff('0x2d')](db[_0x16ff('0x2e')]['rawAttributes'],function(_0x30eee6){return{'name':_0x30eee6['fieldName'],'type':_0x30eee6[_0x16ff('0x2f')]['key']};});_0x5ef62c[_0x16ff('0x30')]=_['map'](_0x2378b3,_0x16ff('0x31'));_0x5ef62c[_0x16ff('0x32')]=_[_0x16ff('0x33')](_0x339ae3[_0x16ff('0x32')]);_0x5ef62c[_0x16ff('0x34')]=_[_0x16ff('0x35')](_0x5ef62c['model'],_0x5ef62c[_0x16ff('0x32')]);_0x1d265c[_0x16ff('0x36')]=_[_0x16ff('0x35')](_0x5ef62c[_0x16ff('0x30')],qs[_0x16ff('0x37')](_0x339ae3['query'][_0x16ff('0x37')]));_0x1d265c[_0x16ff('0x36')]=_0x1d265c[_0x16ff('0x36')][_0x16ff('0x38')]?_0x1d265c['attributes']:_0x5ef62c[_0x16ff('0x30')];if(!_0x339ae3[_0x16ff('0x32')][_0x16ff('0x39')](_0x16ff('0x3a'))){_0x1d265c[_0x16ff('0x22')]=qs[_0x16ff('0x22')](_0x339ae3[_0x16ff('0x32')]['limit']);_0x1d265c['offset']=qs[_0x16ff('0x23')](_0x339ae3['query'][_0x16ff('0x23')]);}_0x1d265c['order']=qs[_0x16ff('0x3b')](_0x339ae3[_0x16ff('0x32')][_0x16ff('0x3b')]);_0x1d265c[_0x16ff('0x3c')]=qs[_0x16ff('0x34')](_['pick'](_0x339ae3[_0x16ff('0x32')],_0x5ef62c[_0x16ff('0x34')]),_0x2378b3);if(_0x339ae3['query'][_0x16ff('0x3d')]){_0x1d265c['where']=_[_0x16ff('0x3e')](_0x1d265c[_0x16ff('0x3c')],{'$or':_[_0x16ff('0x2d')](_0x2378b3,function(_0x580607){if(_0x580607['type']!=='VIRTUAL'){var _0x1f6392={};_0x1f6392[_0x580607['name']]={'$like':'%'+_0x339ae3['query'][_0x16ff('0x3d')]+'%'};return _0x1f6392;}})});}_0x1d265c=_[_0x16ff('0x3e')]({},_0x1d265c,_0x339ae3[_0x16ff('0x3f')]);var _0x4ed6e3={'where':_0x1d265c[_0x16ff('0x3c')]};return db['Team'][_0x16ff('0x40')](_0x4ed6e3)[_0x16ff('0x29')](function(_0x8ec491){_0xdc0470[_0x16ff('0x40')]=_0x8ec491;if(_0x339ae3[_0x16ff('0x32')]['includeAll']){_0x1d265c['include']=[{'all':!![]}];}return db[_0x16ff('0x2e')][_0x16ff('0x41')](_0x1d265c);})[_0x16ff('0x29')](function(_0x50ce28){_0xdc0470['rows']=_0x50ce28;return _0xdc0470;})[_0x16ff('0x29')](respondWithFilteredResult(_0xbcbacb,_0x1d265c))['catch'](handleError(_0xbcbacb,null));};exports[_0x16ff('0x42')]=function(_0x58b0ab,_0x1c4123){var _0x165451={'raw':![],'where':{'id':_0x58b0ab['params']['id']}},_0x31c7b1={};_0x31c7b1[_0x16ff('0x30')]=_[_0x16ff('0x33')](db['Team']['rawAttributes']);_0x31c7b1[_0x16ff('0x32')]=_['keys'](_0x58b0ab[_0x16ff('0x32')]);_0x31c7b1[_0x16ff('0x34')]=_[_0x16ff('0x35')](_0x31c7b1[_0x16ff('0x30')],_0x31c7b1[_0x16ff('0x32')]);_0x165451[_0x16ff('0x36')]=_[_0x16ff('0x35')](_0x31c7b1['model'],qs[_0x16ff('0x37')](_0x58b0ab[_0x16ff('0x32')][_0x16ff('0x37')]));_0x165451[_0x16ff('0x36')]=_0x165451[_0x16ff('0x36')]['length']?_0x165451[_0x16ff('0x36')]:_0x31c7b1['model'];if(_0x58b0ab[_0x16ff('0x32')]['includeAll']){_0x165451[_0x16ff('0x43')]=[{'all':!![]}];}_0x165451=_[_0x16ff('0x3e')]({},_0x165451,_0x58b0ab['options']);return db[_0x16ff('0x2e')][_0x16ff('0x44')](_0x165451)[_0x16ff('0x29')](handleEntityNotFound(_0x1c4123,null))[_0x16ff('0x29')](respondWithResult(_0x1c4123,null))['catch'](handleError(_0x1c4123,null));};exports[_0x16ff('0x45')]=function(_0x3bab07,_0x3de822){return db[_0x16ff('0x2e')][_0x16ff('0x45')](_0x3bab07[_0x16ff('0x46')],{})[_0x16ff('0x29')](function(_0x7277a){var _0x310df4=_0x3bab07[_0x16ff('0x47')][_0x16ff('0x48')]({'plain':!![]});if(!_0x310df4)throw new Error(_0x16ff('0x49'));if(_0x310df4['role']===_0x16ff('0x47')){var _0x4899b8=_0x7277a[_0x16ff('0x48')]({'plain':!![]});var _0x2ad0c8=_0x16ff('0x4a');return db[_0x16ff('0x4b')][_0x16ff('0x44')]({'where':{'name':_0x2ad0c8,'userProfileId':_0x310df4[_0x16ff('0x4c')]},'raw':!![]})['then'](function(_0x2ce176){if(_0x2ce176&&_0x2ce176['autoAssociation']===0x0){return db[_0x16ff('0x4d')]['create']({'name':_0x4899b8[_0x16ff('0x31')],'resourceId':_0x4899b8['id'],'type':_0x2ce176[_0x16ff('0x31')],'sectionId':_0x2ce176['id']},{})[_0x16ff('0x29')](function(){return _0x7277a;});}else{return _0x7277a;}})[_0x16ff('0x4e')](function(_0x54e75a){logger['error'](_0x16ff('0x4f'),_0x54e75a);throw _0x54e75a;});}return _0x7277a;})[_0x16ff('0x29')](respondWithResult(_0x3de822,0xc9))[_0x16ff('0x4e')](handleError(_0x3de822,null));};exports['update']=function(_0x30f49d,_0x51cde7){if(_0x30f49d[_0x16ff('0x46')]['id']){delete _0x30f49d[_0x16ff('0x46')]['id'];}return db['Team']['find']({'where':{'id':_0x30f49d[_0x16ff('0x50')]['id']}})[_0x16ff('0x29')](handleEntityNotFound(_0x51cde7,null))['then'](saveUpdates(_0x30f49d[_0x16ff('0x46')],null))[_0x16ff('0x29')](respondWithResult(_0x51cde7,null))['catch'](handleError(_0x51cde7,null));};exports[_0x16ff('0x51')]=function(_0x5ccf5f,_0xa5878c){var _0x230a41=_0x5ccf5f['params']['id'];var _0x288602=[];return db[_0x16ff('0x52')][_0x16ff('0x53')](function(_0x49e54f){var _0x3bbd8d='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x230a41;return db[_0x16ff('0x52')][_0x16ff('0x32')](_0x3bbd8d,{'type':db[_0x16ff('0x54')][_0x16ff('0x55')][_0x16ff('0x56')],'raw':!![],'transaction':_0x49e54f})[_0x16ff('0x29')](function(_0x4e7511){_0x288602=_[_0x16ff('0x2d')](_0x4e7511,function(_0x1ecf74){return Number(_0x1ecf74['UserId']);});})[_0x16ff('0x29')](function(){var _0x5b1035=_0x16ff('0x57')+_0x230a41;return db['sequelize'][_0x16ff('0x32')](_0x5b1035,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x49e54f});})[_0x16ff('0x29')](function(_0x57ca85){var _0x30b0b=_[_0x16ff('0x2d')](_0x57ca85,function(_0x2c3ea5){return Number(_0x2c3ea5[_0x16ff('0x58')]);});return db[_0x16ff('0x59')][_0x16ff('0x51')]({'where':{'UserId':{'$in':_0x288602},'VoiceQueueId':{'$in':_0x30b0b}},'transaction':_0x49e54f});})[_0x16ff('0x29')](function(){var _0x4c1614=_0x16ff('0x5a')+_0x230a41;return db['sequelize'][_0x16ff('0x32')](_0x4c1614,{'type':db[_0x16ff('0x54')][_0x16ff('0x55')]['SELECT'],'raw':!![],'transaction':_0x49e54f});})[_0x16ff('0x29')](function(_0x38e79d){var _0x53cb3d=_[_0x16ff('0x2d')](_0x38e79d,function(_0x280d3e){return Number(_0x280d3e[_0x16ff('0x5b')]);});return db['UserMailQueue'][_0x16ff('0x51')]({'where':{'UserId':{'$in':_0x288602},'MailQueueId':{'$in':_0x53cb3d}},'transaction':_0x49e54f});})[_0x16ff('0x29')](function(){var _0x480ba5=_0x16ff('0x5c')+_0x230a41;return db[_0x16ff('0x52')][_0x16ff('0x32')](_0x480ba5,{'type':db[_0x16ff('0x54')][_0x16ff('0x55')][_0x16ff('0x56')],'raw':!![],'transaction':_0x49e54f});})['then'](function(_0x81ce39){var _0x5890c5=_[_0x16ff('0x2d')](_0x81ce39,function(_0x19f117){return Number(_0x19f117[_0x16ff('0x5d')]);});return db['UserSmsQueue'][_0x16ff('0x51')]({'where':{'UserId':{'$in':_0x288602},'SmsQueueId':{'$in':_0x5890c5}},'transaction':_0x49e54f});})['then'](function(){var _0xb8b22e=_0x16ff('0x5e')+_0x230a41;return db[_0x16ff('0x52')][_0x16ff('0x32')](_0xb8b22e,{'type':db[_0x16ff('0x54')][_0x16ff('0x55')][_0x16ff('0x56')],'raw':!![],'transaction':_0x49e54f});})[_0x16ff('0x29')](function(_0x5cc675){var _0x578519=_[_0x16ff('0x2d')](_0x5cc675,function(_0xae58cd){return Number(_0xae58cd['ChatQueueId']);});return db[_0x16ff('0x5f')]['destroy']({'where':{'UserId':{'$in':_0x288602},'ChatQueueId':{'$in':_0x578519}},'transaction':_0x49e54f});})[_0x16ff('0x29')](function(){var _0x1b0357='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x230a41;return db[_0x16ff('0x52')]['query'](_0x1b0357,{'type':db['Sequelize'][_0x16ff('0x55')][_0x16ff('0x56')],'raw':!![],'transaction':_0x49e54f});})[_0x16ff('0x29')](function(_0x35392c){var _0x264bac=_[_0x16ff('0x2d')](_0x35392c,function(_0x3a145f){return Number(_0x3a145f[_0x16ff('0x60')]);});return db[_0x16ff('0x61')][_0x16ff('0x51')]({'where':{'UserId':{'$in':_0x288602},'FaxQueueId':{'$in':_0x264bac}},'transaction':_0x49e54f});})[_0x16ff('0x29')](function(){var _0x47c08b=_0x16ff('0x62')+_0x230a41;return db[_0x16ff('0x52')][_0x16ff('0x32')](_0x47c08b,{'type':db['Sequelize'][_0x16ff('0x55')][_0x16ff('0x56')],'raw':!![],'transaction':_0x49e54f});})[_0x16ff('0x29')](function(_0x2f9b4d){var _0x38b885=_[_0x16ff('0x2d')](_0x2f9b4d,function(_0xfc0f97){return Number(_0xfc0f97['OpenchannelQueueId']);});return db[_0x16ff('0x63')][_0x16ff('0x51')]({'where':{'UserId':{'$in':_0x288602},'OpenchannelQueueId':{'$in':_0x38b885}},'transaction':_0x49e54f});})[_0x16ff('0x29')](function(){var _0x5d587e=_0x16ff('0x64')+_0x230a41;return db[_0x16ff('0x52')][_0x16ff('0x32')](_0x5d587e,{'type':db[_0x16ff('0x54')][_0x16ff('0x55')][_0x16ff('0x56')],'raw':!![],'transaction':_0x49e54f});})['then'](function(_0x14f558){var _0x1fc63f=_[_0x16ff('0x2d')](_0x14f558,function(_0x4f4cea){return Number(_0x4f4cea[_0x16ff('0x65')]);});return db[_0x16ff('0x66')][_0x16ff('0x51')]({'where':{'UserId':{'$in':_0x288602},'WhatsappQueueId':{'$in':_0x1fc63f}},'transaction':_0x49e54f});})[_0x16ff('0x29')](function(){return db[_0x16ff('0x67')]['find']({'where':{'TeamId':_0x230a41}});})[_0x16ff('0x29')](function(_0x5dda65){if(_0x5dda65===null){return;}return db[_0x16ff('0x68')][_0x16ff('0x51')]({'where':{'UserId':{'$in':_0x288602},'VoicePrefixId':_0x5dda65[_0x16ff('0x69')]},'transaction':_0x49e54f});})[_0x16ff('0x29')](function(){return db['Team'][_0x16ff('0x51')]({'where':{'id':_0x230a41},'cascade':!![],'transaction':_0x49e54f});})[_0x16ff('0x29')](function(_0x38b619){if(_0x38b619===0x0){_0xa5878c[_0x16ff('0x1e')](0x194);}else{return db[_0x16ff('0x4d')][_0x16ff('0x51')]({'where':{'type':'Teams','resourceId':_0x230a41},'cascade':!![],'transaction':_0x49e54f})[_0x16ff('0x29')](function(){_0xa5878c[_0x16ff('0x1f')](0xcc)[_0x16ff('0x20')]();});}})[_0x16ff('0x4e')](function(_0x530a99){_0xa5878c[_0x16ff('0x1f')](0x1f4)[_0x16ff('0x2b')](_0x530a99);});});};exports[_0x16ff('0x6a')]=function(_0x284d74,_0x5c749f,_0x47c1df){return db[_0x16ff('0x2e')][_0x16ff('0x6b')]({'where':{'id':_0x284d74[_0x16ff('0x50')]['id']}})[_0x16ff('0x29')](handleEntityNotFound(_0x5c749f,null))[_0x16ff('0x29')](function(_0x34146b){if(!_0x284d74['query'][_0x16ff('0x6c')]||!utils[_0x16ff('0x6d')](_0x284d74['query'][_0x16ff('0x6c')])){throw new db['Sequelize'][(_0x16ff('0x6e'))](_0x16ff('0x6f'));}var _0x1aa346={};var _0x20e914={};_0x20e914['model']=_[_0x16ff('0x33')](db[_[_0x16ff('0x70')](_0x284d74['query']['channel'][_0x16ff('0x71')]())+_0x16ff('0x72')][_0x16ff('0x73')]);_0x20e914[_0x16ff('0x32')]=_['keys'](_0x284d74[_0x16ff('0x32')]);_0x20e914[_0x16ff('0x34')]=_[_0x16ff('0x35')](_0x20e914['model'],_0x20e914[_0x16ff('0x32')]);_0x1aa346[_0x16ff('0x36')]=_[_0x16ff('0x35')](_0x20e914[_0x16ff('0x30')],qs[_0x16ff('0x37')](_0x284d74[_0x16ff('0x32')][_0x16ff('0x37')]));_0x1aa346[_0x16ff('0x36')]=_0x1aa346[_0x16ff('0x36')]['length']?_0x1aa346[_0x16ff('0x36')]:_0x20e914[_0x16ff('0x30')];_0x1aa346[_0x16ff('0x22')]=qs['limit'](_0x284d74[_0x16ff('0x32')][_0x16ff('0x22')]);_0x1aa346[_0x16ff('0x23')]=qs['offset'](_0x284d74['query'][_0x16ff('0x23')]);_0x1aa346['order']=qs['sort'](_0x284d74['query'][_0x16ff('0x3b')]);_0x1aa346[_0x16ff('0x3c')]=qs[_0x16ff('0x34')](_[_0x16ff('0x74')](_0x284d74[_0x16ff('0x32')],_0x20e914[_0x16ff('0x34')]));_0x1aa346=_[_0x16ff('0x3e')]({},_0x1aa346,_0x284d74['options']);return _0x34146b[_0x16ff('0x48')+_['capitalize'](_0x284d74['query'][_0x16ff('0x6c')][_0x16ff('0x71')]())+_0x16ff('0x75')](_0x1aa346);})[_0x16ff('0x29')](respondWithResult(_0x5c749f,null))[_0x16ff('0x4e')](handleError(_0x5c749f,null));};exports[_0x16ff('0x76')]=function(_0x41fab3,_0x1304e8,_0xb44a1e){return db[_0x16ff('0x2e')][_0x16ff('0x6b')]({'where':{'id':_0x41fab3['params']['id']}})['then'](function(_0x3c82cc){if(_0x3c82cc){if(!_0x41fab3['body']['channel']||!utils['isValidChannel'](_0x41fab3[_0x16ff('0x46')][_0x16ff('0x6c')])){throw new db['Sequelize'][(_0x16ff('0x6e'))]('Unknown\x20channel');}return _0x3c82cc[_0x16ff('0x77')+_[_0x16ff('0x70')](_0x41fab3[_0x16ff('0x46')][_0x16ff('0x6c')]['toLowerCase']())+'Queues'](_0x41fab3[_0x16ff('0x46')][_0x16ff('0x78')]);}return null;})[_0x16ff('0x29')](handleEntityNotFound(_0x1304e8,null))[_0x16ff('0x29')](respondWithStatusCode(_0x1304e8,null))['catch'](handleError(_0x1304e8,null));};exports[_0x16ff('0x79')]=function(_0x3ecfb3,_0x16d4b0,_0x5d381d){return db['Team'][_0x16ff('0x6b')]({'where':{'id':_0x3ecfb3[_0x16ff('0x50')]['id']}})['then'](function(_0x113ac2){if(_0x113ac2){if(!_0x3ecfb3[_0x16ff('0x32')][_0x16ff('0x6c')]||!utils[_0x16ff('0x6d')](_0x3ecfb3[_0x16ff('0x32')][_0x16ff('0x6c')])){throw new db['Sequelize']['ValidationError'](_0x16ff('0x6f'));}return _0x113ac2[_0x16ff('0x7a')+_[_0x16ff('0x70')](_0x3ecfb3[_0x16ff('0x32')][_0x16ff('0x6c')][_0x16ff('0x71')]())+_0x16ff('0x75')](_0x3ecfb3['query'][_0x16ff('0x78')]);}return null;})[_0x16ff('0x29')](handleEntityNotFound(_0x16d4b0,null))['then'](respondWithStatusCode(_0x16d4b0,null))[_0x16ff('0x4e')](handleError(_0x16d4b0,null));};exports[_0x16ff('0x7b')]=function(_0x12a99e,_0x4e333b){var _0x17167e=_[_0x16ff('0x7c')](_0x12a99e[_0x16ff('0x46')][_0x16ff('0x78')])?_0x12a99e[_0x16ff('0x46')][_0x16ff('0x78')]:[_0x12a99e[_0x16ff('0x46')][_0x16ff('0x78')]];var _0x2b94d2=_0x12a99e[_0x16ff('0x50')]['id'];return db[_0x16ff('0x2e')]['find']({'where':{'id':_0x2b94d2}})[_0x16ff('0x29')](handleEntityNotFound(_0x4e333b,null))[_0x16ff('0x29')](function(_0x3e83f2){if(_0x3e83f2){var _0x259bf5=[_0x16ff('0x7d'),_0x16ff('0x7e'),_0x16ff('0x7f'),_0x16ff('0x80'),_0x16ff('0x81'),'Openchannel',_0x16ff('0x82')];return db[_0x16ff('0x52')][_0x16ff('0x53')](function(_0x26cf16){var _0x3f509b=_[_0x16ff('0x2d')](_0x259bf5,function(_0x57fa1c){var _0x46cfcd={'attributes':['id',_0x16ff('0x31')]};if(_0x57fa1c==='Voice'){_0x46cfcd[_0x16ff('0x83')]={'attributes':[_0x16ff('0x84')]};}return _0x3e83f2[_0x16ff('0x48')+_0x57fa1c+_0x16ff('0x75')](_0x46cfcd)[_0x16ff('0x29')](function(_0x4f0098){var _0x354adf=_[_0x16ff('0x2d')](_0x4f0098,function(_0x20a2eb){var _0x1cad49=_[_0x16ff('0x2d')](_0x17167e,function(_0xdaabc6){var _0x33614c={'where':{'UserId':_0xdaabc6,[_0x57fa1c+_0x16ff('0x85')]:_0x20a2eb['id']},'transaction':_0x26cf16};if(_0x57fa1c===_0x16ff('0x7d')){_0x33614c[_0x16ff('0x18')]={'penalty':_0x20a2eb[_0x16ff('0x86')][_0x16ff('0x84')]};}return db[_0x16ff('0x87')+_0x57fa1c+'Queue']['findOrCreate'](_0x33614c)['then'](function(){socket['emit'](_0x16ff('0x47')+_0x57fa1c+_0x16ff('0x88'),{'UserId':_0xdaabc6,[_0x57fa1c+'QueueId']:_0x20a2eb['id']});if(_0x57fa1c!==_0x16ff('0x7d')){return;}return db[_0x16ff('0x87')][_0x16ff('0x41')]({'where':{'id':_0x17167e,'online':0x1},'attributes':['id',_0x16ff('0x31'),_0x16ff('0x89'),_0x16ff('0x8a'),_0x16ff('0x8b')],'raw':!![]})[_0x16ff('0x29')](function(_0x40f8e0){var _0x219503=_[_0x16ff('0x2d')](_0x40f8e0,function(_0x4da140){return db['UserVoiceQueueRt'][_0x16ff('0x8c')]({'membername':_0x4da140[_0x16ff('0x31')],'UserId':_0x4da140['id'],'queue_name':_0x20a2eb['name'],'VoiceQueueId':_0x20a2eb['id'],'interface':_[_0x16ff('0x8d')](_0x4da140['interface'])?util[_0x16ff('0x8e')](_0x16ff('0x8f'),_0x4da140[_0x16ff('0x31')]):_0x4da140[_0x16ff('0x8b')],'paused':_0x4da140['voicePause']||![],'penalty':_0x20a2eb['TeamVoiceQueue'][_0x16ff('0x84')]},{'transaction':_0x26cf16});});return Promise[_0x16ff('0x90')](_0x219503);});});});return Promise[_0x16ff('0x90')](_0x1cad49);});return Promise[_0x16ff('0x90')](_0x354adf);})['then'](function(){return db[_0x16ff('0x67')][_0x16ff('0x6b')]({'where':{'teamId':_0x2b94d2}})[_0x16ff('0x29')](function(_0x37a6db){if(_0x37a6db){var _0x3dea5a=_['map'](_0x17167e,function(_0x51ab21){db[_0x16ff('0x68')][_0x16ff('0x8c')]({'UserId':_0x51ab21,'VoicePrefixId':_0x37a6db[_0x16ff('0x69')]});});return Promise[_0x16ff('0x90')](_0x3dea5a);}});});});return Promise['all'](_0x3f509b)['then'](function(){return _0x3e83f2[_0x16ff('0x7b')](_0x17167e,{'transaction':_0x26cf16})[_0x16ff('0x91')](function(_0x10b354){return _0x10b354;});});});}})[_0x16ff('0x29')](respondWithResult(_0x4e333b,null))[_0x16ff('0x4e')](handleError(_0x4e333b,null));};exports[_0x16ff('0x92')]=function(_0x52ee29,_0x2b86df){var _0x58f5c2=_['isArray'](_0x52ee29[_0x16ff('0x32')]['ids'])?_0x52ee29['query']['ids']:[_0x52ee29[_0x16ff('0x32')]['ids']];var _0x395d90=_0x52ee29[_0x16ff('0x50')]['id'];return db[_0x16ff('0x2e')][_0x16ff('0x44')]({'where':{'id':_0x395d90}})[_0x16ff('0x29')](handleEntityNotFound(_0x2b86df,null))['then'](function(_0x304cba){if(_0x304cba){var _0x1fa286=[_0x16ff('0x7d'),_0x16ff('0x7e'),_0x16ff('0x7f'),'Sms',_0x16ff('0x81'),_0x16ff('0x93'),'Whatsapp'];return db[_0x16ff('0x52')][_0x16ff('0x53')](function(_0x521f8d){var _0x57f28f=_[_0x16ff('0x2d')](_0x1fa286,function(_0x28b83d){var _0x4201a4={'attributes':['id',_0x16ff('0x31')]};return _0x304cba[_0x16ff('0x48')+_0x28b83d+'Queues'](_0x4201a4)[_0x16ff('0x29')](function(_0x163353){var _0x2daf92=_[_0x16ff('0x2d')](_0x163353,function(_0x94570d){return _0x94570d[_0x16ff('0x92')](_0x58f5c2,{'transaction':_0x521f8d})['then'](function(){var _0x518794=_[_0x16ff('0x2d')](_0x58f5c2,function(_0x161114){socket[_0x16ff('0x94')](_0x16ff('0x47')+_0x28b83d+_0x16ff('0x95'),{'UserId':Number(_0x161114),[_0x28b83d+_0x16ff('0x85')]:_0x94570d['id']});if(_0x28b83d!==_0x16ff('0x7d')){return;}return db[_0x16ff('0x96')][_0x16ff('0x51')]({'where':{'VoiceQueueId':_0x94570d['id'],'UserId':_0x161114},'transaction':_0x521f8d});});return Promise[_0x16ff('0x90')](_0x518794);});});return Promise[_0x16ff('0x90')](_0x2daf92);});});return Promise[_0x16ff('0x90')](_0x57f28f)[_0x16ff('0x29')](function(){return _0x304cba[_0x16ff('0x92')](_0x58f5c2,{'transaction':_0x521f8d});})[_0x16ff('0x29')](function(){return db[_0x16ff('0x67')][_0x16ff('0x6b')]({'where':{'teamId':_0x395d90}})['then'](function(_0x38eb36){if(_0x38eb36){var _0x38caac=_[_0x16ff('0x2d')](_0x58f5c2,function(_0x3443d7){db[_0x16ff('0x68')]['destroy']({'where':{'UserId':_0x3443d7,'VoicePrefixId':_0x38eb36[_0x16ff('0x69')]}});});return Promise[_0x16ff('0x90')](_0x38caac);}});});});}})[_0x16ff('0x29')](respondWithStatusCode(_0x2b86df,null))[_0x16ff('0x4e')](handleError(_0x2b86df,null));};exports[_0x16ff('0x97')]=function(_0x4d2183,_0x48b37c,_0x441467){var _0x1d4cb0={};var _0x53055b={};var _0xa419cb;var _0x2b4b28;return db[_0x16ff('0x2e')]['findOne']({'where':{'id':_0x4d2183[_0x16ff('0x50')]['id']}})[_0x16ff('0x29')](handleEntityNotFound(_0x48b37c,null))[_0x16ff('0x29')](function(_0x3b7685){if(_0x3b7685){_0xa419cb=_0x3b7685;_0x53055b[_0x16ff('0x30')]=_[_0x16ff('0x33')](db[_0x16ff('0x87')][_0x16ff('0x73')]);_0x53055b[_0x16ff('0x32')]=_[_0x16ff('0x33')](_0x4d2183[_0x16ff('0x32')]);_0x53055b[_0x16ff('0x34')]=_['intersection'](_0x53055b['model'],_0x53055b[_0x16ff('0x32')]);_0x1d4cb0[_0x16ff('0x36')]=_[_0x16ff('0x35')](_0x53055b[_0x16ff('0x30')],qs['fields'](_0x4d2183[_0x16ff('0x32')][_0x16ff('0x37')]));_0x1d4cb0[_0x16ff('0x36')]=_0x1d4cb0[_0x16ff('0x36')][_0x16ff('0x38')]?_0x1d4cb0[_0x16ff('0x36')]:_0x53055b[_0x16ff('0x30')];_0x1d4cb0[_0x16ff('0x98')]=qs[_0x16ff('0x3b')](_0x4d2183[_0x16ff('0x32')][_0x16ff('0x3b')]);_0x1d4cb0[_0x16ff('0x3c')]=qs[_0x16ff('0x34')](_[_0x16ff('0x74')](_0x4d2183['query'],_0x53055b[_0x16ff('0x34')]));if(_0x4d2183[_0x16ff('0x32')][_0x16ff('0x3d')]){_0x1d4cb0['where']=_[_0x16ff('0x3e')](_0x1d4cb0[_0x16ff('0x3c')],{'$or':_[_0x16ff('0x2d')](_0x1d4cb0[_0x16ff('0x36')],function(_0x40941a){var _0x43de51={};_0x43de51[_0x40941a]={'$like':'%'+_0x4d2183['query'][_0x16ff('0x3d')]+'%'};return _0x43de51;})});}_0x1d4cb0=_[_0x16ff('0x3e')]({},_0x1d4cb0,_0x4d2183[_0x16ff('0x3f')]);return _0xa419cb[_0x16ff('0x97')](_0x1d4cb0);}})[_0x16ff('0x29')](function(_0x50118c){if(_0x50118c){_0x2b4b28=_0x50118c[_0x16ff('0x38')];if(!_0x4d2183[_0x16ff('0x32')]['hasOwnProperty']('nolimit')){_0x1d4cb0[_0x16ff('0x22')]=qs[_0x16ff('0x22')](_0x4d2183[_0x16ff('0x32')]['limit']);_0x1d4cb0[_0x16ff('0x23')]=qs[_0x16ff('0x23')](_0x4d2183[_0x16ff('0x32')][_0x16ff('0x23')]);}return _0xa419cb[_0x16ff('0x97')](_0x1d4cb0);}})[_0x16ff('0x29')](function(_0x18ae7e){if(_0x18ae7e){return _0x18ae7e?{'count':_0x2b4b28,'rows':_0x18ae7e}:null;}})[_0x16ff('0x29')](respondWithResult(_0x48b37c,null))[_0x16ff('0x4e')](handleError(_0x48b37c,null));}; \ No newline at end of file +var _0x4c04=['to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','./team.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','update','then','sendStatus','error','stack','name','send','index','map','Team','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','options','includeAll','include','findAll','catch','show','params','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','sequelize','transaction','Sequelize','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','VoiceQueueId','MailQueueId','SmsQueueId','UserSmsQueue','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','findOne','isValidChannel','channel','ValidationError','toLowerCase','Queue','capitalize','Queues','Unknown\x20channel','add','removeQueues','remove','ids','isArray','Voice','Chat','Fax','Openchannel','Whatsapp','through','penalty','QueueId','defaults','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','voicePause','interface','upsert','isNil','format','SIP/%s','all','addAgents','spread','Sms','Queue:remove','UserVoiceQueueRt','VoicePrefixId','getAgents','filter','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x4c2241,_0x53e423){var _0x53ca72=function(_0x199817){while(--_0x199817){_0x4c2241['push'](_0x4c2241['shift']());}};_0x53ca72(++_0x53e423);}(_0x4c04,0x118));var _0x44c0=function(_0x19e112,_0x19c9a9){_0x19e112=_0x19e112-0x0;var _0x3ab604=_0x4c04[_0x19e112];return _0x3ab604;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x44c0('0x0'));var zipdir=require(_0x44c0('0x1'));var jsonpatch=require(_0x44c0('0x2'));var rp=require(_0x44c0('0x3'));var moment=require(_0x44c0('0x4'));var BPromise=require(_0x44c0('0x5'));var Mustache=require(_0x44c0('0x6'));var util=require(_0x44c0('0x7'));var path=require(_0x44c0('0x8'));var sox=require(_0x44c0('0x9'));var csv=require('to-csv');var ejs=require(_0x44c0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x44c0('0xb'));var squel=require(_0x44c0('0xc'));var crypto=require(_0x44c0('0xd'));var jsforce=require(_0x44c0('0xe'));var deskjs=require(_0x44c0('0xf'));var toCsv=require(_0x44c0('0x10'));var querystring=require('querystring');var Papa=require(_0x44c0('0x11'));var Redis=require(_0x44c0('0x12'));var authService=require(_0x44c0('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x44c0('0x14'));var hardwareService=require(_0x44c0('0x15'));var logger=require(_0x44c0('0x16'))(_0x44c0('0x17'));var utils=require(_0x44c0('0x18'));var config=require(_0x44c0('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x44c0('0x1a')],{'host':_0x44c0('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x44c0('0x1a')]));require(_0x44c0('0x1c'))[_0x44c0('0x1d')](socket);function respondWithStatusCode(_0x15552d,_0x4b47a1){_0x4b47a1=_0x4b47a1||0xcc;return function(_0x2e5cea){if(_0x2e5cea){return _0x15552d['sendStatus'](_0x4b47a1);}return _0x15552d[_0x44c0('0x1e')](_0x4b47a1)[_0x44c0('0x1f')]();};}function respondWithResult(_0x4244e9,_0x38dd00){_0x38dd00=_0x38dd00||0xc8;return function(_0x4c655c){if(_0x4c655c){return _0x4244e9['status'](_0x38dd00)['json'](_0x4c655c);}};}function respondWithFilteredResult(_0x30e33c,_0x17d9f6){return function(_0x49ab50){if(_0x49ab50){var _0x2f3116=typeof _0x17d9f6[_0x44c0('0x20')]===_0x44c0('0x21')&&typeof _0x17d9f6[_0x44c0('0x22')]==='undefined';var _0x1a37fe=_0x49ab50['count'];var _0x11d7f6=_0x2f3116?0x0:_0x17d9f6[_0x44c0('0x20')];var _0xcddd52=_0x2f3116?_0x49ab50[_0x44c0('0x23')]:_0x17d9f6[_0x44c0('0x20')]+_0x17d9f6[_0x44c0('0x22')];var _0x2d7bde;if(_0xcddd52>=_0x1a37fe){_0xcddd52=_0x1a37fe;_0x2d7bde=0xc8;}else{_0x2d7bde=0xce;}_0x30e33c['status'](_0x2d7bde);return _0x30e33c[_0x44c0('0x24')](_0x44c0('0x25'),_0x11d7f6+'-'+_0xcddd52+'/'+_0x1a37fe)['json'](_0x49ab50);}return null;};}function patchUpdates(_0x3e8b2b){return function(_0x3416cb){try{jsonpatch['apply'](_0x3416cb,_0x3e8b2b,!![]);}catch(_0x5ec9a7){return BPromise['reject'](_0x5ec9a7);}return _0x3416cb['save']();};}function saveUpdates(_0x4c7b8e,_0x595da4){return function(_0x329b74){if(_0x329b74){return _0x329b74[_0x44c0('0x26')](_0x4c7b8e)[_0x44c0('0x27')](function(_0x498f14){return _0x498f14;});}return null;};}function handleEntityNotFound(_0x549ef0,_0x408631){return function(_0x2e374c){if(!_0x2e374c){_0x549ef0[_0x44c0('0x28')](0x194);}return _0x2e374c;};}function handleError(_0x2421a6,_0x2ce255){_0x2ce255=_0x2ce255||0x1f4;return function(_0x2a9166){logger[_0x44c0('0x29')](_0x2a9166[_0x44c0('0x2a')]);if(_0x2a9166[_0x44c0('0x2b')]){delete _0x2a9166[_0x44c0('0x2b')];}_0x2421a6[_0x44c0('0x1e')](_0x2ce255)[_0x44c0('0x2c')](_0x2a9166);};}exports[_0x44c0('0x2d')]=function(_0x394df6,_0x129a26){var _0x3a3e26={},_0x47062b={},_0x44bdf2={'count':0x0,'rows':[]};var _0x202504=_[_0x44c0('0x2e')](db[_0x44c0('0x2f')][_0x44c0('0x30')],function(_0x25e05a){return{'name':_0x25e05a[_0x44c0('0x31')],'type':_0x25e05a[_0x44c0('0x32')][_0x44c0('0x33')]};});_0x47062b[_0x44c0('0x34')]=_[_0x44c0('0x2e')](_0x202504,_0x44c0('0x2b'));_0x47062b[_0x44c0('0x35')]=_[_0x44c0('0x36')](_0x394df6[_0x44c0('0x35')]);_0x47062b[_0x44c0('0x37')]=_[_0x44c0('0x38')](_0x47062b[_0x44c0('0x34')],_0x47062b[_0x44c0('0x35')]);_0x3a3e26[_0x44c0('0x39')]=_[_0x44c0('0x38')](_0x47062b[_0x44c0('0x34')],qs[_0x44c0('0x3a')](_0x394df6[_0x44c0('0x35')][_0x44c0('0x3a')]));_0x3a3e26[_0x44c0('0x39')]=_0x3a3e26[_0x44c0('0x39')][_0x44c0('0x3b')]?_0x3a3e26[_0x44c0('0x39')]:_0x47062b[_0x44c0('0x34')];if(!_0x394df6['query'][_0x44c0('0x3c')](_0x44c0('0x3d'))){_0x3a3e26[_0x44c0('0x22')]=qs[_0x44c0('0x22')](_0x394df6[_0x44c0('0x35')][_0x44c0('0x22')]);_0x3a3e26[_0x44c0('0x20')]=qs[_0x44c0('0x20')](_0x394df6[_0x44c0('0x35')][_0x44c0('0x20')]);}_0x3a3e26[_0x44c0('0x3e')]=qs[_0x44c0('0x3f')](_0x394df6[_0x44c0('0x35')]['sort']);_0x3a3e26['where']=qs['filters'](_[_0x44c0('0x40')](_0x394df6[_0x44c0('0x35')],_0x47062b[_0x44c0('0x37')]),_0x202504);if(_0x394df6[_0x44c0('0x35')]['filter']){_0x3a3e26[_0x44c0('0x41')]=_[_0x44c0('0x42')](_0x3a3e26[_0x44c0('0x41')],{'$or':_[_0x44c0('0x2e')](_0x202504,function(_0x4acda7){if(_0x4acda7[_0x44c0('0x32')]!=='VIRTUAL'){var _0x5d3621={};_0x5d3621[_0x4acda7[_0x44c0('0x2b')]]={'$like':'%'+_0x394df6[_0x44c0('0x35')]['filter']+'%'};return _0x5d3621;}})});}_0x3a3e26=_[_0x44c0('0x42')]({},_0x3a3e26,_0x394df6[_0x44c0('0x43')]);var _0x2efc80={'where':_0x3a3e26[_0x44c0('0x41')]};return db[_0x44c0('0x2f')][_0x44c0('0x23')](_0x2efc80)['then'](function(_0x45208a){_0x44bdf2[_0x44c0('0x23')]=_0x45208a;if(_0x394df6[_0x44c0('0x35')][_0x44c0('0x44')]){_0x3a3e26[_0x44c0('0x45')]=[{'all':!![]}];}return db[_0x44c0('0x2f')][_0x44c0('0x46')](_0x3a3e26);})[_0x44c0('0x27')](function(_0x44caf5){_0x44bdf2['rows']=_0x44caf5;return _0x44bdf2;})[_0x44c0('0x27')](respondWithFilteredResult(_0x129a26,_0x3a3e26))[_0x44c0('0x47')](handleError(_0x129a26,null));};exports[_0x44c0('0x48')]=function(_0x1bf013,_0x3b1e35){var _0x3d2e0a={'raw':![],'where':{'id':_0x1bf013[_0x44c0('0x49')]['id']}},_0xa2264c={};_0xa2264c[_0x44c0('0x34')]=_['keys'](db[_0x44c0('0x2f')][_0x44c0('0x30')]);_0xa2264c[_0x44c0('0x35')]=_[_0x44c0('0x36')](_0x1bf013[_0x44c0('0x35')]);_0xa2264c[_0x44c0('0x37')]=_[_0x44c0('0x38')](_0xa2264c[_0x44c0('0x34')],_0xa2264c[_0x44c0('0x35')]);_0x3d2e0a[_0x44c0('0x39')]=_[_0x44c0('0x38')](_0xa2264c['model'],qs[_0x44c0('0x3a')](_0x1bf013[_0x44c0('0x35')][_0x44c0('0x3a')]));_0x3d2e0a[_0x44c0('0x39')]=_0x3d2e0a[_0x44c0('0x39')][_0x44c0('0x3b')]?_0x3d2e0a[_0x44c0('0x39')]:_0xa2264c[_0x44c0('0x34')];if(_0x1bf013[_0x44c0('0x35')]['includeAll']){_0x3d2e0a['include']=[{'all':!![]}];}_0x3d2e0a=_[_0x44c0('0x42')]({},_0x3d2e0a,_0x1bf013[_0x44c0('0x43')]);return db['Team'][_0x44c0('0x4a')](_0x3d2e0a)[_0x44c0('0x27')](handleEntityNotFound(_0x3b1e35,null))[_0x44c0('0x27')](respondWithResult(_0x3b1e35,null))[_0x44c0('0x47')](handleError(_0x3b1e35,null));};exports[_0x44c0('0x4b')]=function(_0x15b459,_0xbdc98e){return db[_0x44c0('0x2f')]['create'](_0x15b459['body'],{})[_0x44c0('0x27')](function(_0x19f47e){var _0x48b077=_0x15b459[_0x44c0('0x4c')][_0x44c0('0x4d')]({'plain':!![]});if(!_0x48b077)throw new Error(_0x44c0('0x4e'));if(_0x48b077['role']==='user'){var _0x60f04b=_0x19f47e['get']({'plain':!![]});var _0x5574aa=_0x44c0('0x4f');return db['UserProfileSection'][_0x44c0('0x4a')]({'where':{'name':_0x5574aa,'userProfileId':_0x48b077['userProfileId']},'raw':!![]})[_0x44c0('0x27')](function(_0x2aebac){if(_0x2aebac&&_0x2aebac[_0x44c0('0x50')]===0x0){return db[_0x44c0('0x51')][_0x44c0('0x4b')]({'name':_0x60f04b[_0x44c0('0x2b')],'resourceId':_0x60f04b['id'],'type':_0x2aebac['name'],'sectionId':_0x2aebac['id']},{})[_0x44c0('0x27')](function(){return _0x19f47e;});}else{return _0x19f47e;}})[_0x44c0('0x47')](function(_0x4cbf71){logger['error'](_0x44c0('0x52'),_0x4cbf71);throw _0x4cbf71;});}return _0x19f47e;})['then'](respondWithResult(_0xbdc98e,0xc9))[_0x44c0('0x47')](handleError(_0xbdc98e,null));};exports[_0x44c0('0x26')]=function(_0x15632b,_0x35ef02){if(_0x15632b[_0x44c0('0x53')]['id']){delete _0x15632b['body']['id'];}return db[_0x44c0('0x2f')][_0x44c0('0x4a')]({'where':{'id':_0x15632b[_0x44c0('0x49')]['id']}})[_0x44c0('0x27')](handleEntityNotFound(_0x35ef02,null))[_0x44c0('0x27')](saveUpdates(_0x15632b[_0x44c0('0x53')],null))[_0x44c0('0x27')](respondWithResult(_0x35ef02,null))['catch'](handleError(_0x35ef02,null));};exports[_0x44c0('0x54')]=function(_0x360724,_0x3acb0c){var _0x30e424=_0x360724['params']['id'];var _0x5832c6=[];return db[_0x44c0('0x55')][_0x44c0('0x56')](function(_0x2090f4){var _0x29b9b7='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x30e424;return db[_0x44c0('0x55')]['query'](_0x29b9b7,{'type':db[_0x44c0('0x57')][_0x44c0('0x58')]['SELECT'],'raw':!![],'transaction':_0x2090f4})[_0x44c0('0x27')](function(_0x3678ab){_0x5832c6=_[_0x44c0('0x2e')](_0x3678ab,function(_0x1d5cda){return Number(_0x1d5cda[_0x44c0('0x59')]);});})['then'](function(){var _0x15497f=_0x44c0('0x5a')+_0x30e424;return db[_0x44c0('0x55')][_0x44c0('0x35')](_0x15497f,{'type':db[_0x44c0('0x57')][_0x44c0('0x58')][_0x44c0('0x5b')],'raw':!![],'transaction':_0x2090f4});})['then'](function(_0x4516b1){var _0x51df18=_[_0x44c0('0x2e')](_0x4516b1,function(_0xa1973){return Number(_0xa1973[_0x44c0('0x5c')]);});return db['UserVoiceQueue'][_0x44c0('0x54')]({'where':{'UserId':{'$in':_0x5832c6},'VoiceQueueId':{'$in':_0x51df18}},'transaction':_0x2090f4});})['then'](function(){var _0x2f7e88='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x30e424;return db[_0x44c0('0x55')]['query'](_0x2f7e88,{'type':db[_0x44c0('0x57')][_0x44c0('0x58')]['SELECT'],'raw':!![],'transaction':_0x2090f4});})[_0x44c0('0x27')](function(_0x151715){var _0xebaa11=_[_0x44c0('0x2e')](_0x151715,function(_0xaad9e6){return Number(_0xaad9e6[_0x44c0('0x5d')]);});return db['UserMailQueue']['destroy']({'where':{'UserId':{'$in':_0x5832c6},'MailQueueId':{'$in':_0xebaa11}},'transaction':_0x2090f4});})['then'](function(){var _0x1f2ae8='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x30e424;return db[_0x44c0('0x55')]['query'](_0x1f2ae8,{'type':db[_0x44c0('0x57')][_0x44c0('0x58')][_0x44c0('0x5b')],'raw':!![],'transaction':_0x2090f4});})[_0x44c0('0x27')](function(_0x25813f){var _0x317a9e=_['map'](_0x25813f,function(_0x39b4b0){return Number(_0x39b4b0[_0x44c0('0x5e')]);});return db[_0x44c0('0x5f')][_0x44c0('0x54')]({'where':{'UserId':{'$in':_0x5832c6},'SmsQueueId':{'$in':_0x317a9e}},'transaction':_0x2090f4});})[_0x44c0('0x27')](function(){var _0x5c285e='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x30e424;return db['sequelize'][_0x44c0('0x35')](_0x5c285e,{'type':db['Sequelize']['QueryTypes'][_0x44c0('0x5b')],'raw':!![],'transaction':_0x2090f4});})[_0x44c0('0x27')](function(_0x2c95c4){var _0x435ee8=_[_0x44c0('0x2e')](_0x2c95c4,function(_0x322553){return Number(_0x322553['ChatQueueId']);});return db[_0x44c0('0x60')][_0x44c0('0x54')]({'where':{'UserId':{'$in':_0x5832c6},'ChatQueueId':{'$in':_0x435ee8}},'transaction':_0x2090f4});})[_0x44c0('0x27')](function(){var _0x212a7b=_0x44c0('0x61')+_0x30e424;return db[_0x44c0('0x55')][_0x44c0('0x35')](_0x212a7b,{'type':db[_0x44c0('0x57')]['QueryTypes'][_0x44c0('0x5b')],'raw':!![],'transaction':_0x2090f4});})[_0x44c0('0x27')](function(_0x4caba1){var _0x4119ea=_[_0x44c0('0x2e')](_0x4caba1,function(_0x456091){return Number(_0x456091['FaxQueueId']);});return db[_0x44c0('0x62')]['destroy']({'where':{'UserId':{'$in':_0x5832c6},'FaxQueueId':{'$in':_0x4119ea}},'transaction':_0x2090f4});})[_0x44c0('0x27')](function(){var _0x346fef=_0x44c0('0x63')+_0x30e424;return db[_0x44c0('0x55')][_0x44c0('0x35')](_0x346fef,{'type':db[_0x44c0('0x57')][_0x44c0('0x58')][_0x44c0('0x5b')],'raw':!![],'transaction':_0x2090f4});})['then'](function(_0x3ef857){var _0x182824=_[_0x44c0('0x2e')](_0x3ef857,function(_0x592b05){return Number(_0x592b05[_0x44c0('0x64')]);});return db['UserOpenchannelQueue'][_0x44c0('0x54')]({'where':{'UserId':{'$in':_0x5832c6},'OpenchannelQueueId':{'$in':_0x182824}},'transaction':_0x2090f4});})['then'](function(){var _0x1e2df5='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x30e424;return db[_0x44c0('0x55')][_0x44c0('0x35')](_0x1e2df5,{'type':db[_0x44c0('0x57')][_0x44c0('0x58')][_0x44c0('0x5b')],'raw':!![],'transaction':_0x2090f4});})[_0x44c0('0x27')](function(_0x471077){var _0x1de65a=_[_0x44c0('0x2e')](_0x471077,function(_0x5b8d7c){return Number(_0x5b8d7c[_0x44c0('0x65')]);});return db[_0x44c0('0x66')][_0x44c0('0x54')]({'where':{'UserId':{'$in':_0x5832c6},'WhatsappQueueId':{'$in':_0x1de65a}},'transaction':_0x2090f4});})['then'](function(){return db[_0x44c0('0x67')][_0x44c0('0x4a')]({'where':{'TeamId':_0x30e424}});})[_0x44c0('0x27')](function(_0x46fee9){if(_0x46fee9===null){return;}return db[_0x44c0('0x68')][_0x44c0('0x54')]({'where':{'UserId':{'$in':_0x5832c6},'VoicePrefixId':_0x46fee9['VoicePrefixId']},'transaction':_0x2090f4});})[_0x44c0('0x27')](function(){return db[_0x44c0('0x2f')][_0x44c0('0x54')]({'where':{'id':_0x30e424},'cascade':!![],'transaction':_0x2090f4});})[_0x44c0('0x27')](function(_0x3a4117){if(_0x3a4117===0x0){_0x3acb0c['sendStatus'](0x194);}else{return db[_0x44c0('0x51')][_0x44c0('0x54')]({'where':{'type':'Teams','resourceId':_0x30e424},'cascade':!![],'transaction':_0x2090f4})[_0x44c0('0x27')](function(){_0x3acb0c[_0x44c0('0x1e')](0xcc)[_0x44c0('0x1f')]();});}})[_0x44c0('0x47')](function(_0x2c30d9){_0x3acb0c[_0x44c0('0x1e')](0x1f4)[_0x44c0('0x2c')](_0x2c30d9);});});};exports['getQueues']=function(_0x593d5b,_0xcccbf4,_0x1e5b3b){return db['Team'][_0x44c0('0x69')]({'where':{'id':_0x593d5b[_0x44c0('0x49')]['id']}})[_0x44c0('0x27')](handleEntityNotFound(_0xcccbf4,null))[_0x44c0('0x27')](function(_0x153c13){if(!_0x593d5b[_0x44c0('0x35')]['channel']||!utils[_0x44c0('0x6a')](_0x593d5b[_0x44c0('0x35')][_0x44c0('0x6b')])){throw new db[(_0x44c0('0x57'))][(_0x44c0('0x6c'))]('Unknown\x20channel');}var _0x351e4f={};var _0xe05e16={};_0xe05e16['model']=_['keys'](db[_['capitalize'](_0x593d5b[_0x44c0('0x35')][_0x44c0('0x6b')][_0x44c0('0x6d')]())+_0x44c0('0x6e')][_0x44c0('0x30')]);_0xe05e16[_0x44c0('0x35')]=_[_0x44c0('0x36')](_0x593d5b[_0x44c0('0x35')]);_0xe05e16['filters']=_[_0x44c0('0x38')](_0xe05e16['model'],_0xe05e16[_0x44c0('0x35')]);_0x351e4f[_0x44c0('0x39')]=_[_0x44c0('0x38')](_0xe05e16[_0x44c0('0x34')],qs[_0x44c0('0x3a')](_0x593d5b[_0x44c0('0x35')][_0x44c0('0x3a')]));_0x351e4f[_0x44c0('0x39')]=_0x351e4f[_0x44c0('0x39')][_0x44c0('0x3b')]?_0x351e4f[_0x44c0('0x39')]:_0xe05e16[_0x44c0('0x34')];_0x351e4f[_0x44c0('0x22')]=qs[_0x44c0('0x22')](_0x593d5b[_0x44c0('0x35')]['limit']);_0x351e4f['offset']=qs['offset'](_0x593d5b[_0x44c0('0x35')]['offset']);_0x351e4f[_0x44c0('0x3e')]=qs[_0x44c0('0x3f')](_0x593d5b[_0x44c0('0x35')][_0x44c0('0x3f')]);_0x351e4f[_0x44c0('0x41')]=qs[_0x44c0('0x37')](_[_0x44c0('0x40')](_0x593d5b[_0x44c0('0x35')],_0xe05e16[_0x44c0('0x37')]));_0x351e4f=_[_0x44c0('0x42')]({},_0x351e4f,_0x593d5b[_0x44c0('0x43')]);return _0x153c13[_0x44c0('0x4d')+_[_0x44c0('0x6f')](_0x593d5b[_0x44c0('0x35')][_0x44c0('0x6b')][_0x44c0('0x6d')]())+_0x44c0('0x70')](_0x351e4f);})[_0x44c0('0x27')](respondWithResult(_0xcccbf4,null))[_0x44c0('0x47')](handleError(_0xcccbf4,null));};exports['addQueues']=function(_0x104759,_0xbeb4c3,_0x5e48aa){return db[_0x44c0('0x2f')]['findOne']({'where':{'id':_0x104759['params']['id']}})['then'](function(_0xabe43d){if(_0xabe43d){if(!_0x104759[_0x44c0('0x53')][_0x44c0('0x6b')]||!utils[_0x44c0('0x6a')](_0x104759['body'][_0x44c0('0x6b')])){throw new db[(_0x44c0('0x57'))][(_0x44c0('0x6c'))](_0x44c0('0x71'));}return _0xabe43d[_0x44c0('0x72')+_['capitalize'](_0x104759[_0x44c0('0x53')][_0x44c0('0x6b')]['toLowerCase']())+_0x44c0('0x70')](_0x104759[_0x44c0('0x53')]['ids']);}return null;})['then'](handleEntityNotFound(_0xbeb4c3,null))[_0x44c0('0x27')](respondWithStatusCode(_0xbeb4c3,null))[_0x44c0('0x47')](handleError(_0xbeb4c3,null));};exports[_0x44c0('0x73')]=function(_0x2a98df,_0x52d0ef,_0x10ff1d){return db['Team'][_0x44c0('0x69')]({'where':{'id':_0x2a98df[_0x44c0('0x49')]['id']}})['then'](function(_0x5841aa){if(_0x5841aa){if(!_0x2a98df[_0x44c0('0x35')][_0x44c0('0x6b')]||!utils[_0x44c0('0x6a')](_0x2a98df[_0x44c0('0x35')]['channel'])){throw new db['Sequelize'][(_0x44c0('0x6c'))](_0x44c0('0x71'));}return _0x5841aa[_0x44c0('0x74')+_[_0x44c0('0x6f')](_0x2a98df[_0x44c0('0x35')][_0x44c0('0x6b')][_0x44c0('0x6d')]())+_0x44c0('0x70')](_0x2a98df[_0x44c0('0x35')][_0x44c0('0x75')]);}return null;})[_0x44c0('0x27')](handleEntityNotFound(_0x52d0ef,null))[_0x44c0('0x27')](respondWithStatusCode(_0x52d0ef,null))['catch'](handleError(_0x52d0ef,null));};exports['addAgents']=function(_0x3b1aa0,_0x17e4b2){var _0x4b42bf=_[_0x44c0('0x76')](_0x3b1aa0['body'][_0x44c0('0x75')])?_0x3b1aa0[_0x44c0('0x53')][_0x44c0('0x75')]:[_0x3b1aa0[_0x44c0('0x53')][_0x44c0('0x75')]];var _0x4b5562=_0x3b1aa0['params']['id'];return db['Team']['find']({'where':{'id':_0x4b5562}})['then'](handleEntityNotFound(_0x17e4b2,null))[_0x44c0('0x27')](function(_0x423850){if(_0x423850){var _0x1361db=[_0x44c0('0x77'),_0x44c0('0x78'),'Mail','Sms',_0x44c0('0x79'),_0x44c0('0x7a'),_0x44c0('0x7b')];return db['sequelize'][_0x44c0('0x56')](function(_0x2c9ae1){var _0x221953=_[_0x44c0('0x2e')](_0x1361db,function(_0x37ba2d){var _0x1fa31d={'attributes':['id','name']};if(_0x37ba2d===_0x44c0('0x77')){_0x1fa31d[_0x44c0('0x7c')]={'attributes':[_0x44c0('0x7d')]};}return _0x423850['get'+_0x37ba2d+_0x44c0('0x70')](_0x1fa31d)['then'](function(_0x3b231b){var _0x40746f=_[_0x44c0('0x2e')](_0x3b231b,function(_0x2d09ee){var _0x4d7991=_[_0x44c0('0x2e')](_0x4b42bf,function(_0x1d54b7){var _0x45cddb={'where':{'UserId':_0x1d54b7,[_0x37ba2d+_0x44c0('0x7e')]:_0x2d09ee['id']},'transaction':_0x2c9ae1};if(_0x37ba2d==='Voice'){_0x45cddb[_0x44c0('0x7f')]={'penalty':_0x2d09ee[_0x44c0('0x80')]['penalty']};}return db[_0x44c0('0x81')+_0x37ba2d+_0x44c0('0x6e')][_0x44c0('0x82')](_0x45cddb)[_0x44c0('0x27')](function(){socket[_0x44c0('0x83')]('user'+_0x37ba2d+_0x44c0('0x84'),{'UserId':_0x1d54b7,[_0x37ba2d+_0x44c0('0x7e')]:_0x2d09ee['id']});if(_0x37ba2d!==_0x44c0('0x77')){return;}return db[_0x44c0('0x81')][_0x44c0('0x46')]({'where':{'id':_0x4b42bf,'online':0x1},'attributes':['id','name','online',_0x44c0('0x85'),_0x44c0('0x86')],'raw':!![]})['then'](function(_0x578b50){var _0x2be888=_[_0x44c0('0x2e')](_0x578b50,function(_0x182864){return db['UserVoiceQueueRt'][_0x44c0('0x87')]({'membername':_0x182864[_0x44c0('0x2b')],'UserId':_0x182864['id'],'queue_name':_0x2d09ee[_0x44c0('0x2b')],'VoiceQueueId':_0x2d09ee['id'],'interface':_[_0x44c0('0x88')](_0x182864[_0x44c0('0x86')])?util[_0x44c0('0x89')](_0x44c0('0x8a'),_0x182864[_0x44c0('0x2b')]):_0x182864['interface'],'paused':_0x182864[_0x44c0('0x85')]||![],'penalty':_0x2d09ee[_0x44c0('0x80')]['penalty']},{'transaction':_0x2c9ae1});});return Promise['all'](_0x2be888);});});});return Promise[_0x44c0('0x8b')](_0x4d7991);});return Promise[_0x44c0('0x8b')](_0x40746f);})[_0x44c0('0x27')](function(){return db[_0x44c0('0x67')]['findOne']({'where':{'teamId':_0x4b5562}})['then'](function(_0x59e97c){if(_0x59e97c){var _0x21263b=_['map'](_0x4b42bf,function(_0x3fd8ef){db[_0x44c0('0x68')][_0x44c0('0x87')]({'UserId':_0x3fd8ef,'VoicePrefixId':_0x59e97c['VoicePrefixId']});});return Promise[_0x44c0('0x8b')](_0x21263b);}});});});return Promise[_0x44c0('0x8b')](_0x221953)[_0x44c0('0x27')](function(){return _0x423850[_0x44c0('0x8c')](_0x4b42bf,{'transaction':_0x2c9ae1})[_0x44c0('0x8d')](function(_0x432b90){return _0x432b90;});});});}})[_0x44c0('0x27')](respondWithResult(_0x17e4b2,null))[_0x44c0('0x47')](handleError(_0x17e4b2,null));};exports['removeAgents']=function(_0x51f262,_0x3fe97e){var _0x216b8f=_[_0x44c0('0x76')](_0x51f262[_0x44c0('0x35')][_0x44c0('0x75')])?_0x51f262[_0x44c0('0x35')][_0x44c0('0x75')]:[_0x51f262[_0x44c0('0x35')][_0x44c0('0x75')]];var _0x2688c9=_0x51f262[_0x44c0('0x49')]['id'];return db[_0x44c0('0x2f')][_0x44c0('0x4a')]({'where':{'id':_0x2688c9}})[_0x44c0('0x27')](handleEntityNotFound(_0x3fe97e,null))['then'](function(_0x192c66){if(_0x192c66){var _0x503bd0=['Voice','Chat','Mail',_0x44c0('0x8e'),_0x44c0('0x79'),_0x44c0('0x7a'),_0x44c0('0x7b')];return db[_0x44c0('0x55')][_0x44c0('0x56')](function(_0x1c64e2){var _0x243ce2=_[_0x44c0('0x2e')](_0x503bd0,function(_0x1a1f95){var _0x19b653={'attributes':['id','name']};return _0x192c66['get'+_0x1a1f95+_0x44c0('0x70')](_0x19b653)[_0x44c0('0x27')](function(_0x32ef67){var _0x18fda2=_[_0x44c0('0x2e')](_0x32ef67,function(_0x497297){return _0x497297['removeAgents'](_0x216b8f,{'transaction':_0x1c64e2})[_0x44c0('0x27')](function(){var _0x545e3f=_[_0x44c0('0x2e')](_0x216b8f,function(_0x8b1d2a){socket['emit'](_0x44c0('0x4c')+_0x1a1f95+_0x44c0('0x8f'),{'UserId':Number(_0x8b1d2a),[_0x1a1f95+_0x44c0('0x7e')]:_0x497297['id']});if(_0x1a1f95!==_0x44c0('0x77')){return;}return db[_0x44c0('0x90')][_0x44c0('0x54')]({'where':{'VoiceQueueId':_0x497297['id'],'UserId':_0x8b1d2a},'transaction':_0x1c64e2});});return Promise[_0x44c0('0x8b')](_0x545e3f);});});return Promise[_0x44c0('0x8b')](_0x18fda2);});});return Promise[_0x44c0('0x8b')](_0x243ce2)[_0x44c0('0x27')](function(){return _0x192c66['removeAgents'](_0x216b8f,{'transaction':_0x1c64e2});})[_0x44c0('0x27')](function(){return db['TeamVoicePrefix'][_0x44c0('0x69')]({'where':{'teamId':_0x2688c9}})['then'](function(_0x2b418e){if(_0x2b418e){var _0x9cf6a9=_['map'](_0x216b8f,function(_0x59909b){db[_0x44c0('0x68')][_0x44c0('0x54')]({'where':{'UserId':_0x59909b,'VoicePrefixId':_0x2b418e[_0x44c0('0x91')]}});});return Promise[_0x44c0('0x8b')](_0x9cf6a9);}});});});}})[_0x44c0('0x27')](respondWithStatusCode(_0x3fe97e,null))['catch'](handleError(_0x3fe97e,null));};exports[_0x44c0('0x92')]=function(_0x2da532,_0xd17d05,_0x5554b8){var _0xb81de3={};var _0x230d71={};var _0x446b03;var _0x4ff3d2;return db[_0x44c0('0x2f')][_0x44c0('0x69')]({'where':{'id':_0x2da532[_0x44c0('0x49')]['id']}})[_0x44c0('0x27')](handleEntityNotFound(_0xd17d05,null))[_0x44c0('0x27')](function(_0x19896f){if(_0x19896f){_0x446b03=_0x19896f;_0x230d71[_0x44c0('0x34')]=_[_0x44c0('0x36')](db[_0x44c0('0x81')][_0x44c0('0x30')]);_0x230d71[_0x44c0('0x35')]=_[_0x44c0('0x36')](_0x2da532['query']);_0x230d71[_0x44c0('0x37')]=_[_0x44c0('0x38')](_0x230d71[_0x44c0('0x34')],_0x230d71[_0x44c0('0x35')]);_0xb81de3[_0x44c0('0x39')]=_[_0x44c0('0x38')](_0x230d71['model'],qs[_0x44c0('0x3a')](_0x2da532[_0x44c0('0x35')][_0x44c0('0x3a')]));_0xb81de3[_0x44c0('0x39')]=_0xb81de3[_0x44c0('0x39')][_0x44c0('0x3b')]?_0xb81de3[_0x44c0('0x39')]:_0x230d71['model'];_0xb81de3[_0x44c0('0x3e')]=qs['sort'](_0x2da532[_0x44c0('0x35')]['sort']);_0xb81de3[_0x44c0('0x41')]=qs[_0x44c0('0x37')](_['pick'](_0x2da532['query'],_0x230d71[_0x44c0('0x37')]));if(_0x2da532['query'][_0x44c0('0x93')]){_0xb81de3[_0x44c0('0x41')]=_[_0x44c0('0x42')](_0xb81de3['where'],{'$or':_[_0x44c0('0x2e')](_0xb81de3[_0x44c0('0x39')],function(_0x1007a7){var _0x1774cf={};_0x1774cf[_0x1007a7]={'$like':'%'+_0x2da532[_0x44c0('0x35')][_0x44c0('0x93')]+'%'};return _0x1774cf;})});}_0xb81de3=_[_0x44c0('0x42')]({},_0xb81de3,_0x2da532['options']);return _0x446b03['getAgents'](_0xb81de3);}})['then'](function(_0x29b599){if(_0x29b599){_0x4ff3d2=_0x29b599[_0x44c0('0x3b')];if(!_0x2da532[_0x44c0('0x35')][_0x44c0('0x3c')](_0x44c0('0x3d'))){_0xb81de3[_0x44c0('0x22')]=qs[_0x44c0('0x22')](_0x2da532[_0x44c0('0x35')]['limit']);_0xb81de3['offset']=qs[_0x44c0('0x20')](_0x2da532[_0x44c0('0x35')]['offset']);}return _0x446b03[_0x44c0('0x92')](_0xb81de3);}})['then'](function(_0x2f2481){if(_0x2f2481){return _0x2f2481?{'count':_0x4ff3d2,'rows':_0x2f2481}:null;}})['then'](respondWithResult(_0xd17d05,null))['catch'](handleError(_0xd17d05,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 570f098..1f5c9ac 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 _0x1bac=['emit','hasOwnProperty','hook','events','Team','setMaxListeners','save','update','remove'];(function(_0x5c5e59,_0x58688d){var _0x44d798=function(_0x1d7f85){while(--_0x1d7f85){_0x5c5e59['push'](_0x5c5e59['shift']());}};_0x44d798(++_0x58688d);}(_0x1bac,0x1e0));var _0xc1ba=function(_0x548434,_0x259fdc){_0x548434=_0x548434-0x0;var _0x4312ab=_0x1bac[_0x548434];return _0x4312ab;};'use strict';var EventEmitter=require(_0xc1ba('0x0'));var Team=require('../../mysqldb')['db'][_0xc1ba('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xc1ba('0x2')](0x0);var events={'afterCreate':_0xc1ba('0x3'),'afterUpdate':_0xc1ba('0x4'),'afterDestroy':_0xc1ba('0x5')};function emitEvent(_0x5e47d2){return function(_0x2d7273,_0x1fa93d,_0x2e7537){TeamEvents[_0xc1ba('0x6')](_0x5e47d2+':'+_0x2d7273['id'],_0x2d7273);TeamEvents[_0xc1ba('0x6')](_0x5e47d2,_0x2d7273);_0x2e7537(null);};}for(var e in events){if(events[_0xc1ba('0x7')](e)){var event=events[e];Team[_0xc1ba('0x8')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0xd617=['Team','setMaxListeners','save','update','hasOwnProperty','hook','events'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xd617,0x14f));var _0x7d61=function(_0x43d472,_0x4f1c15){_0x43d472=_0x43d472-0x0;var _0x204319=_0xd617[_0x43d472];return _0x204319;};'use strict';var EventEmitter=require(_0x7d61('0x0'));var Team=require('../../mysqldb')['db'][_0x7d61('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x7d61('0x2')](0x0);var events={'afterCreate':_0x7d61('0x3'),'afterUpdate':_0x7d61('0x4'),'afterDestroy':'remove'};function emitEvent(_0x108458){return function(_0x28d296,_0x15069e,_0x452ac3){TeamEvents['emit'](_0x108458+':'+_0x28d296['id'],_0x28d296);TeamEvents['emit'](_0x108458,_0x28d296);_0x452ac3(null);};}for(var e in events){if(events[_0x7d61('0x5')](e)){var event=events[e];Team[_0x7d61('0x6')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 130fdf1..02781f0 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 _0x5920=['Team','teams','Chat','Mail','Openchannel','Voice','Whatsapp','then','all','./team.attributes','get','map','channel','catch','exports'];(function(_0x51439f,_0x170a2a){var _0x541e70=function(_0xfb7a1e){while(--_0xfb7a1e){_0x51439f['push'](_0x51439f['shift']());}};_0x541e70(++_0x170a2a);}(_0x5920,0x153));var _0x0592=function(_0x350f26,_0x2bdfe1){_0x350f26=_0x350f26-0x0;var _0x72eed5=_0x5920[_0x350f26];return _0x72eed5;};'use strict';var _=require('lodash');var attributes=require(_0x0592('0x0'));function getQueuesByChannel(_0x555f81,_0xd434aa){var _0x63d576=_0x0592('0x1')+_0xd434aa+'Queues';return _0x555f81[_0x63d576]()['then'](function(_0x5185c3){return _[_0x0592('0x2')](_0x5185c3,function(_0x4d9388){_0x4d9388['setDataValue'](_0x0592('0x3'),_0xd434aa);return _0x4d9388;});})[_0x0592('0x4')](function(_0x29feb4){throw _0x29feb4;});}module[_0x0592('0x5')]=function(_0x286628){return _0x286628['define'](_0x0592('0x6'),attributes,{'tableName':_0x0592('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x4e15b5=this;var _0x2d2813=[_0x0592('0x8'),'Fax',_0x0592('0x9'),_0x0592('0xa'),'Sms',_0x0592('0xb'),_0x0592('0xc')];return Promise['resolve']()[_0x0592('0xd')](function(){var _0x251d80=_[_0x0592('0x2')](_0x2d2813,function(_0x280b8f){return getQueuesByChannel(_0x4e15b5,_0x280b8f);});return Promise[_0x0592('0xe')](_0x251d80);})[_0x0592('0x4')](function(_0x59863a){throw _0x59863a;});}}});}; \ No newline at end of file +var _0x64d1=['all','catch','lodash','Queues','map','setDataValue','channel','exports','define','Team','teams','Chat','Fax','Openchannel','Voice','Whatsapp','resolve','then'];(function(_0x2998db,_0x3424f1){var _0x115fea=function(_0x3b493c){while(--_0x3b493c){_0x2998db['push'](_0x2998db['shift']());}};_0x115fea(++_0x3424f1);}(_0x64d1,0xda));var _0x164d=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x64d1[_0x49d41c];return _0xb64c5f;};'use strict';var _=require(_0x164d('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x405885,_0x52fd4d){var _0x33221d='get'+_0x52fd4d+_0x164d('0x1');return _0x405885[_0x33221d]()['then'](function(_0x37d63c){return _[_0x164d('0x2')](_0x37d63c,function(_0x5d4b7f){_0x5d4b7f[_0x164d('0x3')](_0x164d('0x4'),_0x52fd4d);return _0x5d4b7f;});})['catch'](function(_0x559b69){throw _0x559b69;});}module[_0x164d('0x5')]=function(_0x36ca68){return _0x36ca68[_0x164d('0x6')](_0x164d('0x7'),attributes,{'tableName':_0x164d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x14cf2c=this;var _0x2fa7a5=[_0x164d('0x9'),_0x164d('0xa'),'Mail',_0x164d('0xb'),'Sms',_0x164d('0xc'),_0x164d('0xd')];return Promise[_0x164d('0xe')]()[_0x164d('0xf')](function(){var _0x1d0010=_[_0x164d('0x2')](_0x2fa7a5,function(_0x476f09){return getQueuesByChannel(_0x14cf2c,_0x476f09);});return Promise[_0x164d('0x10')](_0x1d0010);})[_0x164d('0x11')](function(_0x51f0b7){throw _0x51f0b7;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 3c9be0a..fc5ae9e 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 _0x4571=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x13e49c,_0x39a461){var _0x3b6e71=function(_0xf139a6){while(--_0xf139a6){_0x13e49c['push'](_0x13e49c['shift']());}};_0x3b6e71(++_0x39a461);}(_0x4571,0xb2));var _0x1457=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x4571[_0x409353];return _0x4f4b59;};'use strict';var _=require(_0x1457('0x0'));var util=require(_0x1457('0x1'));var moment=require(_0x1457('0x2'));var BPromise=require(_0x1457('0x3'));var rs=require(_0x1457('0x4'));var fs=require('fs');var Redis=require(_0x1457('0x5'));var db=require(_0x1457('0x6'))['db'];var utils=require(_0x1457('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x1457('0x8'));var jayson=require(_0x1457('0x9'));var client=jayson[_0x1457('0xa')]['http']({'port':0x232a});config[_0x1457('0xb')]=_[_0x1457('0xc')](config[_0x1457('0xb')],{'host':_0x1457('0xd'),'port':0x18eb});var socket=require(_0x1457('0xe'))(new Redis(config[_0x1457('0xb')]));require('./team.socket')[_0x1457('0xf')](socket);function respondWithRpcPromise(_0x8ecbe5,_0x2a5d0c,_0x52395f){return new BPromise(function(_0x58a828,_0x558ebc){return client[_0x1457('0x10')](_0x8ecbe5,_0x52395f)[_0x1457('0x11')](function(_0x52c4aa){logger[_0x1457('0x12')](_0x1457('0x13'),_0x2a5d0c,'request\x20sent');logger[_0x1457('0x14')](_0x1457('0x15'),_0x2a5d0c,_0x1457('0x16'),JSON[_0x1457('0x17')](_0x52c4aa));if(_0x52c4aa['error']){if(_0x52c4aa[_0x1457('0x18')][_0x1457('0x19')]===0x1f4){logger[_0x1457('0x18')](_0x1457('0x13'),_0x2a5d0c,_0x52c4aa['error'][_0x1457('0x1a')]);return _0x558ebc(_0x52c4aa[_0x1457('0x18')][_0x1457('0x1a')]);}logger[_0x1457('0x18')]('Team,\x20%s,\x20%s',_0x2a5d0c,_0x52c4aa[_0x1457('0x18')][_0x1457('0x1a')]);return _0x58a828(_0x52c4aa['error'][_0x1457('0x1a')]);}else{logger['info']('Team,\x20%s,\x20%s',_0x2a5d0c,_0x1457('0x16'));_0x58a828(_0x52c4aa[_0x1457('0x1b')][_0x1457('0x1a')]);}})[_0x1457('0x1c')](function(_0x2ed776){logger['error'](_0x1457('0x13'),_0x2a5d0c,_0x2ed776);_0x558ebc(_0x2ed776);});});} \ No newline at end of file +var _0xb20f=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','defaults','localhost','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x30464a,_0x454a6f){var _0x25817f=function(_0xa78bc3){while(--_0xa78bc3){_0x30464a['push'](_0x30464a['shift']());}};_0x25817f(++_0x454a6f);}(_0xb20f,0x1ef));var _0xfb20=function(_0x14507a,_0x1d4265){_0x14507a=_0x14507a-0x0;var _0xf29027=_0xb20f[_0x14507a];return _0xf29027;};'use strict';var _=require(_0xfb20('0x0'));var util=require(_0xfb20('0x1'));var moment=require(_0xfb20('0x2'));var BPromise=require(_0xfb20('0x3'));var rs=require(_0xfb20('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfb20('0x5'))['db'];var utils=require(_0xfb20('0x6'));var logger=require(_0xfb20('0x7'))(_0xfb20('0x8'));var config=require('../../config/environment');var jayson=require(_0xfb20('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xfb20('0xa')]=_[_0xfb20('0xb')](config['redis'],{'host':_0xfb20('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfb20('0xa')]));require('./team.socket')['register'](socket);function respondWithRpcPromise(_0xa6eb40,_0x232a19,_0x4ca1c0){return new BPromise(function(_0x262f5f,_0x3b0c08){return client[_0xfb20('0xd')](_0xa6eb40,_0x4ca1c0)[_0xfb20('0xe')](function(_0x264a12){logger[_0xfb20('0xf')](_0xfb20('0x10'),_0x232a19,_0xfb20('0x11'));logger[_0xfb20('0x12')](_0xfb20('0x13'),_0x232a19,_0xfb20('0x11'),JSON['stringify'](_0x264a12));if(_0x264a12[_0xfb20('0x14')]){if(_0x264a12[_0xfb20('0x14')][_0xfb20('0x15')]===0x1f4){logger[_0xfb20('0x14')](_0xfb20('0x10'),_0x232a19,_0x264a12['error'][_0xfb20('0x16')]);return _0x3b0c08(_0x264a12['error']['message']);}logger['error']('Team,\x20%s,\x20%s',_0x232a19,_0x264a12[_0xfb20('0x14')][_0xfb20('0x16')]);return _0x262f5f(_0x264a12[_0xfb20('0x14')][_0xfb20('0x16')]);}else{logger[_0xfb20('0xf')](_0xfb20('0x10'),_0x232a19,_0xfb20('0x11'));_0x262f5f(_0x264a12[_0xfb20('0x17')][_0xfb20('0x16')]);}})[_0xfb20('0x18')](function(_0x5119c4){logger[_0xfb20('0x14')](_0xfb20('0x10'),_0x232a19,_0x5119c4);_0x3b0c08(_0x5119c4);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 3230875..77535e0 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 _0x9c2c=['emit','register','length','team:','./team.events','save'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x9c2c,0x1c0));var _0xc9c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c2c[_0x3dd15e];return _0x231fd0;};'use strict';var TeamEvents=require(_0xc9c2('0x0'));var events=[_0xc9c2('0x1'),'remove','update'];function createListener(_0x49c43a,_0x31a779){return function(_0x4ac3bb){_0x31a779[_0xc9c2('0x2')](_0x49c43a,_0x4ac3bb);};}function removeListener(_0x14e513,_0x5bf334){return function(){TeamEvents['removeListener'](_0x14e513,_0x5bf334);};}exports[_0xc9c2('0x3')]=function(_0x5140a8){for(var _0x30f3d6=0x0,_0x17b5e8=events[_0xc9c2('0x4')];_0x30f3d6<_0x17b5e8;_0x30f3d6++){var _0x18a815=events[_0x30f3d6];var _0x270572=createListener(_0xc9c2('0x5')+_0x18a815,_0x5140a8);TeamEvents['on'](_0x18a815,_0x270572);}}; \ No newline at end of file +var _0xb7aa=['./team.events','save','remove','update','emit','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb7aa,0x11a));var _0xab7a=function(_0x4e9aab,_0x5b9288){_0x4e9aab=_0x4e9aab-0x0;var _0x249b5c=_0xb7aa[_0x4e9aab];return _0x249b5c;};'use strict';var TeamEvents=require(_0xab7a('0x0'));var events=[_0xab7a('0x1'),_0xab7a('0x2'),_0xab7a('0x3')];function createListener(_0x1d2507,_0x3eab6c){return function(_0x20b86d){_0x3eab6c[_0xab7a('0x4')](_0x1d2507,_0x20b86d);};}function removeListener(_0x34adc3,_0x3b0621){return function(){TeamEvents['removeListener'](_0x34adc3,_0x3b0621);};}exports[_0xab7a('0x5')]=function(_0x1c761b){for(var _0x2ee412=0x0,_0x29ef15=events['length'];_0x2ee412<_0x29ef15;_0x2ee412++){var _0x99ac82=events[_0x2ee412];var _0x1e3b23=createListener('team:'+_0x99ac82,_0x1c761b);TeamEvents['on'](_0x99ac82,_0x1e3b23);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 851c877..c6e8d21 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 _0xcff8=['INTEGER','sequelize'];(function(_0x2e4cbf,_0x8763d3){var _0x52840f=function(_0x31b93f){while(--_0x31b93f){_0x2e4cbf['push'](_0x2e4cbf['shift']());}};_0x52840f(++_0x8763d3);}(_0xcff8,0x14b));var _0x8cff=function(_0x583eb4,_0x3617a2){_0x583eb4=_0x583eb4-0x0;var _0x234ab3=_0xcff8[_0x583eb4];return _0x234ab3;};'use strict';var Sequelize=require(_0x8cff('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0x8cff('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x8cff('0x1')]}}; \ No newline at end of file +var _0x81a4=['exports','INTEGER','sequelize'];(function(_0x383577,_0x29899f){var _0x1d930f=function(_0x173a49){while(--_0x173a49){_0x383577['push'](_0x383577['shift']());}};_0x1d930f(++_0x29899f);}(_0x81a4,0x1a6));var _0x481a=function(_0x18d5d7,_0x19074b){_0x18d5d7=_0x18d5d7-0x0;var _0x30a9ea=_0x81a4[_0x18d5d7];return _0x30a9ea;};'use strict';var Sequelize=require(_0x481a('0x0'));module[_0x481a('0x1')]={'TeamId':{'type':Sequelize[_0x481a('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x481a('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 7ac190c..e11019f 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 _0x8c7a=['path','./teamVoicePrefix.attributes','exports','define','team_has_voice_prefixes','lodash','api','bluebird','request-promise'];(function(_0x20e1fd,_0x506bf0){var _0x3be635=function(_0x530079){while(--_0x530079){_0x20e1fd['push'](_0x20e1fd['shift']());}};_0x3be635(++_0x506bf0);}(_0x8c7a,0x8c));var _0xa8c7=function(_0x504755,_0x32c503){_0x504755=_0x504755-0x0;var _0x33a3f9=_0x8c7a[_0x504755];return _0x33a3f9;};'use strict';var _=require(_0xa8c7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa8c7('0x1'));var moment=require('moment');var BPromise=require(_0xa8c7('0x2'));var rp=require(_0xa8c7('0x3'));var fs=require('fs');var path=require(_0xa8c7('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa8c7('0x5'));module[_0xa8c7('0x6')]=function(_0x1afbe0,_0x2ecdf1){return _0x1afbe0[_0xa8c7('0x7')]('TeamVoicePrefix',attributes,{'tableName':_0xa8c7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd48a=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./teamVoicePrefix.attributes','team_has_voice_prefixes'];(function(_0x4aee7e,_0x4f74ec){var _0x112546=function(_0x6dcdf5){while(--_0x6dcdf5){_0x4aee7e['push'](_0x4aee7e['shift']());}};_0x112546(++_0x4f74ec);}(_0xd48a,0x96));var _0xad48=function(_0x1b3299,_0x38c939){_0x1b3299=_0x1b3299-0x0;var _0x5df97a=_0xd48a[_0x1b3299];return _0x5df97a;};'use strict';var _=require(_0xad48('0x0'));var util=require('util');var logger=require(_0xad48('0x1'))(_0xad48('0x2'));var moment=require(_0xad48('0x3'));var BPromise=require(_0xad48('0x4'));var rp=require(_0xad48('0x5'));var fs=require('fs');var path=require(_0xad48('0x6'));var rimraf=require('rimraf');var config=require(_0xad48('0x7'));var attributes=require(_0xad48('0x8'));module['exports']=function(_0x143780,_0x584cf0){return _0x143780['define']('TeamVoicePrefix',attributes,{'tableName':_0xad48('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 424d580..08f1782 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x251fde,_0x384469){var _0x350af6=function(_0x15a6a3){while(--_0x15a6a3){_0x251fde['push'](_0x251fde['shift']());}};_0x350af6(++_0x384469);}(_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'));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(_0x11dee9,_0x500fad){var _0x4fdcad=function(_0x247a78){while(--_0x247a78){_0x11dee9['push'](_0x11dee9['shift']());}};_0x4fdcad(++_0x500fad);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index a7f3cda..ffcb42b 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 _0xde8a=['sequelize','exports','INTEGER'];(function(_0x6016a3,_0x354cc2){var _0x2202b3=function(_0x3f3728){while(--_0x3f3728){_0x6016a3['push'](_0x6016a3['shift']());}};_0x2202b3(++_0x354cc2);}(_0xde8a,0x9c));var _0xade8=function(_0x4066f4,_0x29644d){_0x4066f4=_0x4066f4-0x0;var _0x39254a=_0xde8a[_0x4066f4];return _0x39254a;};'use strict';var Sequelize=require(_0xade8('0x0'));module[_0xade8('0x1')]={'penalty':{'type':Sequelize[_0xade8('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd54c=['INTEGER','sequelize'];(function(_0x25fd5e,_0x8a37f5){var _0x154f94=function(_0x31cc2e){while(--_0x31cc2e){_0x25fd5e['push'](_0x25fd5e['shift']());}};_0x154f94(++_0x8a37f5);}(_0xd54c,0x171));var _0xcd54=function(_0x24b926,_0x5766c1){_0x24b926=_0x24b926-0x0;var _0x2809a3=_0xd54c[_0x24b926];return _0x2809a3;};'use strict';var Sequelize=require(_0xcd54('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xcd54('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 dc386f6..761f798 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 _0x192f=['./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','lodash','../../config/logger','moment','path','rimraf','../../config/environment'];(function(_0x47fe1e,_0x858bca){var _0x2e18c7=function(_0x46b678){while(--_0x46b678){_0x47fe1e['push'](_0x47fe1e['shift']());}};_0x2e18c7(++_0x858bca);}(_0x192f,0xd6));var _0xf192=function(_0x43034e,_0x2bd2ed){_0x43034e=_0x43034e-0x0;var _0x2c5397=_0x192f[_0x43034e];return _0x2c5397;};'use strict';var _=require(_0xf192('0x0'));var util=require('util');var logger=require(_0xf192('0x1'))('api');var moment=require(_0xf192('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf192('0x3'));var rimraf=require(_0xf192('0x4'));var config=require(_0xf192('0x5'));var attributes=require(_0xf192('0x6'));module[_0xf192('0x7')]=function(_0x221f55,_0x5a05b0){return _0x221f55[_0xf192('0x8')](_0xf192('0x9'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','team_has_voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports'];(function(_0x533528,_0x409d05){var _0x3189f1=function(_0x5e63d2){while(--_0x5e63d2){_0x533528['push'](_0x533528['shift']());}};_0x3189f1(++_0x409d05);}(_0x008c,0x188));var _0xc008=function(_0x817d9b,_0x3c37e3){_0x817d9b=_0x817d9b-0x0;var _0x2752e1=_0x008c[_0x817d9b];return _0x2752e1;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('TeamVoiceQueue',attributes,{'tableName':_0xc008('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 6c15e71..8fec509 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 _0x96f3=['ioredis','../../config/logger','rpc','../../config/environment','http','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x96f3,0xf7));var _0x396f=function(_0x2a4ef3,_0x376f94){_0x2a4ef3=_0x2a4ef3-0x0;var _0x3b5ed4=_0x96f3[_0x2a4ef3];return _0x3b5ed4;};'use strict';var _=require(_0x396f('0x0'));var util=require(_0x396f('0x1'));var moment=require(_0x396f('0x2'));var BPromise=require(_0x396f('0x3'));var rs=require(_0x396f('0x4'));var fs=require('fs');var Redis=require(_0x396f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x396f('0x6'))(_0x396f('0x7'));var config=require(_0x396f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x396f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x119971,_0x256e0d,_0x2f56e2){return new BPromise(function(_0xe3854d,_0x4030f3){return client['request'](_0x119971,_0x2f56e2)[_0x396f('0xa')](function(_0x5d3a7e){logger[_0x396f('0xb')](_0x396f('0xc'),_0x256e0d,_0x396f('0xd'));logger['debug'](_0x396f('0xe'),_0x256e0d,'request\x20sent',JSON[_0x396f('0xf')](_0x5d3a7e));if(_0x5d3a7e[_0x396f('0x10')]){if(_0x5d3a7e[_0x396f('0x10')][_0x396f('0x11')]===0x1f4){logger[_0x396f('0x10')](_0x396f('0xc'),_0x256e0d,_0x5d3a7e['error'][_0x396f('0x12')]);return _0x4030f3(_0x5d3a7e[_0x396f('0x10')][_0x396f('0x12')]);}logger[_0x396f('0x10')](_0x396f('0xc'),_0x256e0d,_0x5d3a7e['error'][_0x396f('0x12')]);return _0xe3854d(_0x5d3a7e[_0x396f('0x10')][_0x396f('0x12')]);}else{logger[_0x396f('0xb')](_0x396f('0xc'),_0x256e0d,_0x396f('0xd'));_0xe3854d(_0x5d3a7e[_0x396f('0x13')]['message']);}})[_0x396f('0x14')](function(_0x366da4){logger[_0x396f('0x10')](_0x396f('0xc'),_0x256e0d,_0x366da4);_0x4030f3(_0x366da4);});});} \ No newline at end of file +var _0x1af8=['rpc','jayson/promise','client','http','then','info','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4c2d57,_0x3e4a59){var _0x473ad1=function(_0x285beb){while(--_0x285beb){_0x4c2d57['push'](_0x4c2d57['shift']());}};_0x473ad1(++_0x3e4a59);}(_0x1af8,0x99));var _0x81af=function(_0x5e54f0,_0x1f7057){_0x5e54f0=_0x5e54f0-0x0;var _0x9b112a=_0x1af8[_0x5e54f0];return _0x9b112a;};'use strict';var _=require(_0x81af('0x0'));var util=require('util');var moment=require(_0x81af('0x1'));var BPromise=require(_0x81af('0x2'));var rs=require(_0x81af('0x3'));var fs=require('fs');var Redis=require(_0x81af('0x4'));var db=require(_0x81af('0x5'))['db'];var utils=require(_0x81af('0x6'));var logger=require(_0x81af('0x7'))(_0x81af('0x8'));var config=require('../../config/environment');var jayson=require(_0x81af('0x9'));var client=jayson[_0x81af('0xa')][_0x81af('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2aa5c4,_0x4dcfd9,_0x3a759f){return new BPromise(function(_0x51423f,_0x24faef){return client['request'](_0x2aa5c4,_0x3a759f)[_0x81af('0xc')](function(_0x148d2c){logger[_0x81af('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4dcfd9,_0x81af('0xe'));logger[_0x81af('0xf')](_0x81af('0x10'),_0x4dcfd9,_0x81af('0xe'),JSON[_0x81af('0x11')](_0x148d2c));if(_0x148d2c[_0x81af('0x12')]){if(_0x148d2c[_0x81af('0x12')][_0x81af('0x13')]===0x1f4){logger[_0x81af('0x12')](_0x81af('0x14'),_0x4dcfd9,_0x148d2c['error'][_0x81af('0x15')]);return _0x24faef(_0x148d2c[_0x81af('0x12')]['message']);}logger[_0x81af('0x12')](_0x81af('0x14'),_0x4dcfd9,_0x148d2c[_0x81af('0x12')][_0x81af('0x15')]);return _0x51423f(_0x148d2c[_0x81af('0x12')][_0x81af('0x15')]);}else{logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x4dcfd9,_0x81af('0xe'));_0x51423f(_0x148d2c['result'][_0x81af('0x15')]);}})[_0x81af('0x16')](function(_0x4f2a5f){logger[_0x81af('0x12')](_0x81af('0x14'),_0x4dcfd9,_0x4f2a5f);_0x24faef(_0x4f2a5f);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index a0f451d..b4fd56c 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 _0x8a21=['../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer','connect-timeout','express','Router'];(function(_0x1a415e,_0x69e2c7){var _0x2b9e47=function(_0x5abcc5){while(--_0x5abcc5){_0x1a415e['push'](_0x1a415e['shift']());}};_0x2b9e47(++_0x69e2c7);}(_0x8a21,0x1d8));var _0x18a2=function(_0x1ee5ef,_0x38d42b){_0x1ee5ef=_0x1ee5ef-0x0;var _0x448ab8=_0x8a21[_0x1ee5ef];return _0x448ab8;};'use strict';var multer=require(_0x18a2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x18a2('0x1'));var express=require(_0x18a2('0x2'));var router=express[_0x18a2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x18a2('0x4'));var config=require(_0x18a2('0x5'));var controller=require(_0x18a2('0x6'));router[_0x18a2('0x7')]('/',auth[_0x18a2('0x8')](),controller[_0x18a2('0x9')]);router[_0x18a2('0x7')](_0x18a2('0xa'),auth['isAuthenticated'](),controller[_0x18a2('0xb')]);router[_0x18a2('0xc')]('/',auth[_0x18a2('0x8')](),controller['create']);router[_0x18a2('0xd')](_0x18a2('0xa'),auth[_0x18a2('0x8')](),controller[_0x18a2('0xe')]);router[_0x18a2('0xf')]('/:id',auth[_0x18a2('0x8')](),controller[_0x18a2('0x10')]);module['exports']=router; \ No newline at end of file +var _0xbb59=['/:id','show','post','create','put','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xbb59,0xec));var _0x9bb5=function(_0x1742a5,_0x146bd4){_0x1742a5=_0x1742a5-0x0;var _0x6c7395=_0xbb59[_0x1742a5];return _0x6c7395;};'use strict';var multer=require(_0x9bb5('0x0'));var util=require(_0x9bb5('0x1'));var path=require(_0x9bb5('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9bb5('0x3')]();var fs_extra=require(_0x9bb5('0x4'));var auth=require(_0x9bb5('0x5'));var interaction=require(_0x9bb5('0x6'));var config=require(_0x9bb5('0x7'));var controller=require('./template.controller');router[_0x9bb5('0x8')]('/',auth[_0x9bb5('0x9')](),controller[_0x9bb5('0xa')]);router[_0x9bb5('0x8')](_0x9bb5('0xb'),auth[_0x9bb5('0x9')](),controller[_0x9bb5('0xc')]);router[_0x9bb5('0xd')]('/',auth[_0x9bb5('0x9')](),controller[_0x9bb5('0xe')]);router[_0x9bb5('0xf')](_0x9bb5('0xb'),auth[_0x9bb5('0x9')](),controller['update']);router[_0x9bb5('0x10')](_0x9bb5('0xb'),auth[_0x9bb5('0x9')](),controller[_0x9bb5('0x11')]);module[_0x9bb5('0x12')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index dec9ac3..afff188 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 _0xea69=['STRING','sequelize','exports'];(function(_0x4b8470,_0x5bd0c5){var _0x1cf921=function(_0x3c7426){while(--_0x3c7426){_0x4b8470['push'](_0x4b8470['shift']());}};_0x1cf921(++_0x5bd0c5);}(_0xea69,0x142));var _0x9ea6=function(_0x118937,_0xcc709b){_0x118937=_0x118937-0x0;var _0x427a33=_0xea69[_0x118937];return _0x427a33;};'use strict';var Sequelize=require(_0x9ea6('0x0'));module[_0x9ea6('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9ea6('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xc7bc=['exports','STRING','TEXT','sequelize'];(function(_0x45d94b,_0x1c4c14){var _0x26b5f4=function(_0x336641){while(--_0x336641){_0x45d94b['push'](_0x45d94b['shift']());}};_0x26b5f4(++_0x1c4c14);}(_0xc7bc,0xd7));var _0xcc7b=function(_0x245690,_0x3bf938){_0x245690=_0x245690-0x0;var _0x3fb9a4=_0xc7bc[_0x245690];return _0x3fb9a4;};'use strict';var Sequelize=require(_0xcc7b('0x0'));module[_0xcc7b('0x1')]={'name':{'type':Sequelize[_0xcc7b('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xcc7b('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 0834d12..5b27d9a 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 _0x432d=['undefined','offset','count','limit','status','set','reject','save','update','then','get','Templates','UserProfileResource','error','stack','name','send','index','Template','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','params','destroy','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','json'];(function(_0x211e36,_0x4b7fbd){var _0x179c3f=function(_0x1fd207){while(--_0x1fd207){_0x211e36['push'](_0x211e36['shift']());}};_0x179c3f(++_0x4b7fbd);}(_0x432d,0x172));var _0xd432=function(_0x2adf4,_0x5df6de){_0x2adf4=_0x2adf4-0x0;var _0x45d47d=_0x432d[_0x2adf4];return _0x45d47d;};'use strict';var emlformat=require(_0xd432('0x0'));var rimraf=require(_0xd432('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd432('0x2'));var rp=require('request-promise');var moment=require(_0xd432('0x3'));var BPromise=require(_0xd432('0x4'));var Mustache=require(_0xd432('0x5'));var util=require('util');var path=require(_0xd432('0x6'));var sox=require(_0xd432('0x7'));var csv=require('to-csv');var ejs=require(_0xd432('0x8'));var fs=require('fs');var fs_extra=require(_0xd432('0x9'));var _=require(_0xd432('0xa'));var squel=require(_0xd432('0xb'));var crypto=require(_0xd432('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd432('0xd'));var querystring=require(_0xd432('0xe'));var Papa=require(_0xd432('0xf'));var Redis=require('ioredis');var authService=require(_0xd432('0x10'));var qs=require(_0xd432('0x11'));var as=require(_0xd432('0x12'));var hardwareService=require(_0xd432('0x13'));var logger=require(_0xd432('0x14'))('api');var utils=require(_0xd432('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd432('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30661c,_0x5b6564){_0x5b6564=_0x5b6564||0xcc;return function(_0x1afec5){if(_0x1afec5){return _0x30661c[_0xd432('0x17')](_0x5b6564);}return _0x30661c['status'](_0x5b6564)['end']();};}function respondWithResult(_0x35af53,_0x3bfce9){_0x3bfce9=_0x3bfce9||0xc8;return function(_0x38eabc){if(_0x38eabc){return _0x35af53['status'](_0x3bfce9)[_0xd432('0x18')](_0x38eabc);}};}function respondWithFilteredResult(_0x4e3711,_0x4b75e3){return function(_0x43a116){if(_0x43a116){var _0x32546f=typeof _0x4b75e3['offset']===_0xd432('0x19')&&typeof _0x4b75e3['limit']==='undefined';var _0x2f119f=_0x43a116['count'];var _0x5526d8=_0x32546f?0x0:_0x4b75e3[_0xd432('0x1a')];var _0x4f83d5=_0x32546f?_0x43a116[_0xd432('0x1b')]:_0x4b75e3['offset']+_0x4b75e3[_0xd432('0x1c')];var _0x39af91;if(_0x4f83d5>=_0x2f119f){_0x4f83d5=_0x2f119f;_0x39af91=0xc8;}else{_0x39af91=0xce;}_0x4e3711[_0xd432('0x1d')](_0x39af91);return _0x4e3711[_0xd432('0x1e')]('Content-Range',_0x5526d8+'-'+_0x4f83d5+'/'+_0x2f119f)['json'](_0x43a116);}return null;};}function patchUpdates(_0x222e33){return function(_0x521379){try{jsonpatch['apply'](_0x521379,_0x222e33,!![]);}catch(_0x13df78){return BPromise[_0xd432('0x1f')](_0x13df78);}return _0x521379[_0xd432('0x20')]();};}function saveUpdates(_0x3d588f,_0x1da4e7){return function(_0x1204e2){if(_0x1204e2){return _0x1204e2[_0xd432('0x21')](_0x3d588f)['then'](function(_0x11e54c){return _0x11e54c;});}return null;};}function removeEntity(_0x49d7eb,_0x138025){return function(_0x42b896){if(_0x42b896){return _0x42b896['destroy']()[_0xd432('0x22')](function(){var _0x1176a5=_0x42b896[_0xd432('0x23')]({'plain':!![]});var _0x30d6b6=_0xd432('0x24');return db[_0xd432('0x25')]['destroy']({'where':{'type':_0x30d6b6,'resourceId':_0x1176a5['id']}})[_0xd432('0x22')](function(){return _0x42b896;});})['then'](function(){_0x49d7eb[_0xd432('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e11ef,_0x2a4b11){return function(_0x2c3615){if(!_0x2c3615){_0x3e11ef[_0xd432('0x17')](0x194);}return _0x2c3615;};}function handleError(_0xfae037,_0x58dd14){_0x58dd14=_0x58dd14||0x1f4;return function(_0x1b4825){logger[_0xd432('0x26')](_0x1b4825[_0xd432('0x27')]);if(_0x1b4825['name']){delete _0x1b4825[_0xd432('0x28')];}_0xfae037[_0xd432('0x1d')](_0x58dd14)[_0xd432('0x29')](_0x1b4825);};}exports[_0xd432('0x2a')]=function(_0x47831d,_0xc754e1){var _0x3004e0={},_0x2b5a82={},_0x260e90={'count':0x0,'rows':[]};var _0x1d3fbc=_['map'](db[_0xd432('0x2b')]['rawAttributes'],function(_0x5e4740){return{'name':_0x5e4740['fieldName'],'type':_0x5e4740[_0xd432('0x2c')][_0xd432('0x2d')]};});_0x2b5a82[_0xd432('0x2e')]=_[_0xd432('0x2f')](_0x1d3fbc,_0xd432('0x28'));_0x2b5a82[_0xd432('0x30')]=_['keys'](_0x47831d['query']);_0x2b5a82[_0xd432('0x31')]=_['intersection'](_0x2b5a82[_0xd432('0x2e')],_0x2b5a82[_0xd432('0x30')]);_0x3004e0[_0xd432('0x32')]=_[_0xd432('0x33')](_0x2b5a82[_0xd432('0x2e')],qs['fields'](_0x47831d[_0xd432('0x30')][_0xd432('0x34')]));_0x3004e0['attributes']=_0x3004e0[_0xd432('0x32')][_0xd432('0x35')]?_0x3004e0['attributes']:_0x2b5a82[_0xd432('0x2e')];if(!_0x47831d[_0xd432('0x30')][_0xd432('0x36')]('nolimit')){_0x3004e0[_0xd432('0x1c')]=qs[_0xd432('0x1c')](_0x47831d[_0xd432('0x30')]['limit']);_0x3004e0['offset']=qs['offset'](_0x47831d[_0xd432('0x30')][_0xd432('0x1a')]);}_0x3004e0[_0xd432('0x37')]=qs[_0xd432('0x38')](_0x47831d[_0xd432('0x30')][_0xd432('0x38')]);_0x3004e0[_0xd432('0x39')]=qs[_0xd432('0x31')](_['pick'](_0x47831d[_0xd432('0x30')],_0x2b5a82[_0xd432('0x31')]),_0x1d3fbc);if(_0x47831d[_0xd432('0x30')]['filter']){_0x3004e0[_0xd432('0x39')]=_[_0xd432('0x3a')](_0x3004e0[_0xd432('0x39')],{'$or':_[_0xd432('0x2f')](_0x1d3fbc,function(_0x483d27){if(_0x483d27[_0xd432('0x2c')]!==_0xd432('0x3b')){var _0x13e960={};_0x13e960[_0x483d27['name']]={'$like':'%'+_0x47831d[_0xd432('0x30')][_0xd432('0x3c')]+'%'};return _0x13e960;}})});}_0x3004e0=_[_0xd432('0x3a')]({},_0x3004e0,_0x47831d[_0xd432('0x3d')]);var _0x20160a={'where':_0x3004e0[_0xd432('0x39')]};return db[_0xd432('0x2b')][_0xd432('0x1b')](_0x20160a)[_0xd432('0x22')](function(_0x3b583f){_0x260e90[_0xd432('0x1b')]=_0x3b583f;if(_0x47831d[_0xd432('0x30')][_0xd432('0x3e')]){_0x3004e0['include']=[{'all':!![]}];}return db[_0xd432('0x2b')][_0xd432('0x3f')](_0x3004e0);})[_0xd432('0x22')](function(_0x32bbd3){_0x260e90[_0xd432('0x40')]=_0x32bbd3;return _0x260e90;})['then'](respondWithFilteredResult(_0xc754e1,_0x3004e0))[_0xd432('0x41')](handleError(_0xc754e1,null));};exports[_0xd432('0x42')]=function(_0x2507dc,_0x4bb489){var _0x2c7dda={'raw':!![],'where':{'id':_0x2507dc['params']['id']}},_0x2d7a18={};_0x2d7a18[_0xd432('0x2e')]=_[_0xd432('0x43')](db['Template'][_0xd432('0x44')]);_0x2d7a18[_0xd432('0x30')]=_[_0xd432('0x43')](_0x2507dc[_0xd432('0x30')]);_0x2d7a18['filters']=_[_0xd432('0x33')](_0x2d7a18[_0xd432('0x2e')],_0x2d7a18['query']);_0x2c7dda['attributes']=_[_0xd432('0x33')](_0x2d7a18[_0xd432('0x2e')],qs[_0xd432('0x34')](_0x2507dc[_0xd432('0x30')]['fields']));_0x2c7dda[_0xd432('0x32')]=_0x2c7dda[_0xd432('0x32')]['length']?_0x2c7dda[_0xd432('0x32')]:_0x2d7a18[_0xd432('0x2e')];if(_0x2507dc[_0xd432('0x30')][_0xd432('0x3e')]){_0x2c7dda['include']=[{'all':!![]}];}_0x2c7dda=_[_0xd432('0x3a')]({},_0x2c7dda,_0x2507dc[_0xd432('0x3d')]);return db[_0xd432('0x2b')][_0xd432('0x45')](_0x2c7dda)['then'](handleEntityNotFound(_0x4bb489,null))[_0xd432('0x22')](respondWithResult(_0x4bb489,null))['catch'](handleError(_0x4bb489,null));};exports[_0xd432('0x46')]=function(_0x3fc121,_0x1b04ba){return db['Template'][_0xd432('0x46')](_0x3fc121[_0xd432('0x47')],{})[_0xd432('0x22')](function(_0x3da635){var _0x271977=_0x3fc121[_0xd432('0x48')][_0xd432('0x23')]({'plain':!![]});if(!_0x271977)throw new Error(_0xd432('0x49'));if(_0x271977[_0xd432('0x4a')]===_0xd432('0x48')){var _0x8bc734=_0x3da635[_0xd432('0x23')]({'plain':!![]});var _0x2d442f=_0xd432('0x24');return db[_0xd432('0x4b')][_0xd432('0x45')]({'where':{'name':_0x2d442f,'userProfileId':_0x271977['userProfileId']},'raw':!![]})['then'](function(_0x191ab3){if(_0x191ab3&&_0x191ab3[_0xd432('0x4c')]===0x0){return db[_0xd432('0x25')][_0xd432('0x46')]({'name':_0x8bc734[_0xd432('0x28')],'resourceId':_0x8bc734['id'],'type':_0x191ab3['name'],'sectionId':_0x191ab3['id']},{})[_0xd432('0x22')](function(){return _0x3da635;});}else{return _0x3da635;}})[_0xd432('0x41')](function(_0x356f11){logger[_0xd432('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x356f11);throw _0x356f11;});}return _0x3da635;})[_0xd432('0x22')](respondWithResult(_0x1b04ba,0xc9))['catch'](handleError(_0x1b04ba,null));};exports[_0xd432('0x21')]=function(_0x3704dc,_0x280f55){if(_0x3704dc[_0xd432('0x47')]['id']){delete _0x3704dc[_0xd432('0x47')]['id'];}return db['Template'][_0xd432('0x45')]({'where':{'id':_0x3704dc[_0xd432('0x4d')]['id']}})[_0xd432('0x22')](handleEntityNotFound(_0x280f55,null))[_0xd432('0x22')](saveUpdates(_0x3704dc[_0xd432('0x47')],null))[_0xd432('0x22')](respondWithResult(_0x280f55,null))['catch'](handleError(_0x280f55,null));};exports[_0xd432('0x4e')]=function(_0xbda23,_0x4b7ff8){return db[_0xd432('0x2b')]['find']({'where':{'id':_0xbda23['params']['id']}})[_0xd432('0x22')](handleEntityNotFound(_0x4b7ff8,null))[_0xd432('0x22')](removeEntity(_0x4b7ff8,null))[_0xd432('0x41')](handleError(_0x4b7ff8,null));}; \ No newline at end of file +var _0xcfa9=['fast-json-patch','util','path','sox','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','save','update','destroy','Templates','then','error','stack','name','send','index','Template','type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf'];(function(_0x146837,_0x2aa6a2){var _0x3d7e60=function(_0x1301ac){while(--_0x1301ac){_0x146837['push'](_0x146837['shift']());}};_0x3d7e60(++_0x2aa6a2);}(_0xcfa9,0x9d));var _0x9cfa=function(_0x36e1a9,_0x18b702){_0x36e1a9=_0x36e1a9-0x0;var _0x439a1c=_0xcfa9[_0x36e1a9];return _0x439a1c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9cfa('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9cfa('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9cfa('0x2'));var path=require(_0x9cfa('0x3'));var sox=require(_0x9cfa('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9cfa('0x5'));var _=require(_0x9cfa('0x6'));var squel=require(_0x9cfa('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9cfa('0x8'));var toCsv=require('to-csv');var querystring=require(_0x9cfa('0x9'));var Papa=require(_0x9cfa('0xa'));var Redis=require('ioredis');var authService=require(_0x9cfa('0xb'));var qs=require(_0x9cfa('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9cfa('0xd'));var logger=require(_0x9cfa('0xe'))(_0x9cfa('0xf'));var utils=require(_0x9cfa('0x10'));var config=require(_0x9cfa('0x11'));var licenseUtil=require(_0x9cfa('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c2c5a,_0x377674){_0x377674=_0x377674||0xcc;return function(_0x41c2dd){if(_0x41c2dd){return _0x2c2c5a[_0x9cfa('0x13')](_0x377674);}return _0x2c2c5a[_0x9cfa('0x14')](_0x377674)[_0x9cfa('0x15')]();};}function respondWithResult(_0x4bfb1d,_0x34e9e3){_0x34e9e3=_0x34e9e3||0xc8;return function(_0x279f96){if(_0x279f96){return _0x4bfb1d['status'](_0x34e9e3)['json'](_0x279f96);}};}function respondWithFilteredResult(_0x1a4b46,_0x314d9d){return function(_0x1e6bf5){if(_0x1e6bf5){var _0x58601f=typeof _0x314d9d['offset']===_0x9cfa('0x16')&&typeof _0x314d9d[_0x9cfa('0x17')]===_0x9cfa('0x16');var _0xfc7a26=_0x1e6bf5['count'];var _0xfe0cca=_0x58601f?0x0:_0x314d9d['offset'];var _0x1e94b5=_0x58601f?_0x1e6bf5[_0x9cfa('0x18')]:_0x314d9d[_0x9cfa('0x19')]+_0x314d9d['limit'];var _0x8e5f20;if(_0x1e94b5>=_0xfc7a26){_0x1e94b5=_0xfc7a26;_0x8e5f20=0xc8;}else{_0x8e5f20=0xce;}_0x1a4b46[_0x9cfa('0x14')](_0x8e5f20);return _0x1a4b46['set'](_0x9cfa('0x1a'),_0xfe0cca+'-'+_0x1e94b5+'/'+_0xfc7a26)[_0x9cfa('0x1b')](_0x1e6bf5);}return null;};}function patchUpdates(_0x29c966){return function(_0x23582e){try{jsonpatch[_0x9cfa('0x1c')](_0x23582e,_0x29c966,!![]);}catch(_0x5cc487){return BPromise['reject'](_0x5cc487);}return _0x23582e[_0x9cfa('0x1d')]();};}function saveUpdates(_0x5eb59f,_0x262940){return function(_0x1377d0){if(_0x1377d0){return _0x1377d0[_0x9cfa('0x1e')](_0x5eb59f)['then'](function(_0x2da68a){return _0x2da68a;});}return null;};}function removeEntity(_0x382637,_0x349af2){return function(_0xf5bdcb){if(_0xf5bdcb){return _0xf5bdcb[_0x9cfa('0x1f')]()['then'](function(){var _0x3d14b1=_0xf5bdcb['get']({'plain':!![]});var _0x5c0466=_0x9cfa('0x20');return db['UserProfileResource'][_0x9cfa('0x1f')]({'where':{'type':_0x5c0466,'resourceId':_0x3d14b1['id']}})[_0x9cfa('0x21')](function(){return _0xf5bdcb;});})[_0x9cfa('0x21')](function(){_0x382637['status'](0xcc)[_0x9cfa('0x15')]();});}};}function handleEntityNotFound(_0x13bc30,_0x1046d4){return function(_0x36e7de){if(!_0x36e7de){_0x13bc30[_0x9cfa('0x13')](0x194);}return _0x36e7de;};}function handleError(_0x545112,_0x4ff7e0){_0x4ff7e0=_0x4ff7e0||0x1f4;return function(_0x50d0eb){logger[_0x9cfa('0x22')](_0x50d0eb[_0x9cfa('0x23')]);if(_0x50d0eb[_0x9cfa('0x24')]){delete _0x50d0eb['name'];}_0x545112['status'](_0x4ff7e0)[_0x9cfa('0x25')](_0x50d0eb);};}exports[_0x9cfa('0x26')]=function(_0x3cc2e4,_0x3d86fd){var _0x57a7f2={},_0x28e487={},_0x10f5df={'count':0x0,'rows':[]};var _0x510bd0=_['map'](db[_0x9cfa('0x27')]['rawAttributes'],function(_0x73e8b6){return{'name':_0x73e8b6['fieldName'],'type':_0x73e8b6[_0x9cfa('0x28')][_0x9cfa('0x29')]};});_0x28e487[_0x9cfa('0x2a')]=_[_0x9cfa('0x2b')](_0x510bd0,_0x9cfa('0x24'));_0x28e487[_0x9cfa('0x2c')]=_[_0x9cfa('0x2d')](_0x3cc2e4[_0x9cfa('0x2c')]);_0x28e487[_0x9cfa('0x2e')]=_['intersection'](_0x28e487[_0x9cfa('0x2a')],_0x28e487[_0x9cfa('0x2c')]);_0x57a7f2[_0x9cfa('0x2f')]=_['intersection'](_0x28e487[_0x9cfa('0x2a')],qs[_0x9cfa('0x30')](_0x3cc2e4[_0x9cfa('0x2c')][_0x9cfa('0x30')]));_0x57a7f2['attributes']=_0x57a7f2[_0x9cfa('0x2f')][_0x9cfa('0x31')]?_0x57a7f2[_0x9cfa('0x2f')]:_0x28e487[_0x9cfa('0x2a')];if(!_0x3cc2e4[_0x9cfa('0x2c')][_0x9cfa('0x32')](_0x9cfa('0x33'))){_0x57a7f2[_0x9cfa('0x17')]=qs['limit'](_0x3cc2e4[_0x9cfa('0x2c')][_0x9cfa('0x17')]);_0x57a7f2[_0x9cfa('0x19')]=qs[_0x9cfa('0x19')](_0x3cc2e4[_0x9cfa('0x2c')][_0x9cfa('0x19')]);}_0x57a7f2['order']=qs[_0x9cfa('0x34')](_0x3cc2e4[_0x9cfa('0x2c')][_0x9cfa('0x34')]);_0x57a7f2[_0x9cfa('0x35')]=qs[_0x9cfa('0x2e')](_[_0x9cfa('0x36')](_0x3cc2e4[_0x9cfa('0x2c')],_0x28e487[_0x9cfa('0x2e')]),_0x510bd0);if(_0x3cc2e4[_0x9cfa('0x2c')]['filter']){_0x57a7f2[_0x9cfa('0x35')]=_[_0x9cfa('0x37')](_0x57a7f2['where'],{'$or':_[_0x9cfa('0x2b')](_0x510bd0,function(_0x141b56){if(_0x141b56['type']!=='VIRTUAL'){var _0x1b4006={};_0x1b4006[_0x141b56[_0x9cfa('0x24')]]={'$like':'%'+_0x3cc2e4[_0x9cfa('0x2c')][_0x9cfa('0x38')]+'%'};return _0x1b4006;}})});}_0x57a7f2=_[_0x9cfa('0x37')]({},_0x57a7f2,_0x3cc2e4[_0x9cfa('0x39')]);var _0x476414={'where':_0x57a7f2[_0x9cfa('0x35')]};return db[_0x9cfa('0x27')][_0x9cfa('0x18')](_0x476414)[_0x9cfa('0x21')](function(_0x456f5e){_0x10f5df[_0x9cfa('0x18')]=_0x456f5e;if(_0x3cc2e4[_0x9cfa('0x2c')][_0x9cfa('0x3a')]){_0x57a7f2['include']=[{'all':!![]}];}return db['Template'][_0x9cfa('0x3b')](_0x57a7f2);})[_0x9cfa('0x21')](function(_0x25dba1){_0x10f5df[_0x9cfa('0x3c')]=_0x25dba1;return _0x10f5df;})[_0x9cfa('0x21')](respondWithFilteredResult(_0x3d86fd,_0x57a7f2))[_0x9cfa('0x3d')](handleError(_0x3d86fd,null));};exports[_0x9cfa('0x3e')]=function(_0x2696de,_0x280e07){var _0x5683a3={'raw':!![],'where':{'id':_0x2696de[_0x9cfa('0x3f')]['id']}},_0x3e4d79={};_0x3e4d79[_0x9cfa('0x2a')]=_['keys'](db[_0x9cfa('0x27')][_0x9cfa('0x40')]);_0x3e4d79[_0x9cfa('0x2c')]=_[_0x9cfa('0x2d')](_0x2696de[_0x9cfa('0x2c')]);_0x3e4d79['filters']=_[_0x9cfa('0x41')](_0x3e4d79[_0x9cfa('0x2a')],_0x3e4d79[_0x9cfa('0x2c')]);_0x5683a3[_0x9cfa('0x2f')]=_[_0x9cfa('0x41')](_0x3e4d79[_0x9cfa('0x2a')],qs['fields'](_0x2696de['query']['fields']));_0x5683a3[_0x9cfa('0x2f')]=_0x5683a3[_0x9cfa('0x2f')][_0x9cfa('0x31')]?_0x5683a3[_0x9cfa('0x2f')]:_0x3e4d79[_0x9cfa('0x2a')];if(_0x2696de[_0x9cfa('0x2c')][_0x9cfa('0x3a')]){_0x5683a3[_0x9cfa('0x42')]=[{'all':!![]}];}_0x5683a3=_[_0x9cfa('0x37')]({},_0x5683a3,_0x2696de[_0x9cfa('0x39')]);return db[_0x9cfa('0x27')][_0x9cfa('0x43')](_0x5683a3)[_0x9cfa('0x21')](handleEntityNotFound(_0x280e07,null))['then'](respondWithResult(_0x280e07,null))[_0x9cfa('0x3d')](handleError(_0x280e07,null));};exports[_0x9cfa('0x44')]=function(_0x297ad8,_0x467b55){return db[_0x9cfa('0x27')][_0x9cfa('0x44')](_0x297ad8[_0x9cfa('0x45')],{})[_0x9cfa('0x21')](function(_0x102ca3){var _0x28076e=_0x297ad8[_0x9cfa('0x46')][_0x9cfa('0x47')]({'plain':!![]});if(!_0x28076e)throw new Error(_0x9cfa('0x48'));if(_0x28076e[_0x9cfa('0x49')]===_0x9cfa('0x46')){var _0x5b7c76=_0x102ca3[_0x9cfa('0x47')]({'plain':!![]});var _0x53476f=_0x9cfa('0x20');return db[_0x9cfa('0x4a')][_0x9cfa('0x43')]({'where':{'name':_0x53476f,'userProfileId':_0x28076e[_0x9cfa('0x4b')]},'raw':!![]})[_0x9cfa('0x21')](function(_0x5e1652){if(_0x5e1652&&_0x5e1652[_0x9cfa('0x4c')]===0x0){return db[_0x9cfa('0x4d')][_0x9cfa('0x44')]({'name':_0x5b7c76[_0x9cfa('0x24')],'resourceId':_0x5b7c76['id'],'type':_0x5e1652['name'],'sectionId':_0x5e1652['id']},{})[_0x9cfa('0x21')](function(){return _0x102ca3;});}else{return _0x102ca3;}})[_0x9cfa('0x3d')](function(_0x124a7e){logger[_0x9cfa('0x22')](_0x9cfa('0x4e'),_0x124a7e);throw _0x124a7e;});}return _0x102ca3;})[_0x9cfa('0x21')](respondWithResult(_0x467b55,0xc9))['catch'](handleError(_0x467b55,null));};exports[_0x9cfa('0x1e')]=function(_0x5a6489,_0x20a17c){if(_0x5a6489[_0x9cfa('0x45')]['id']){delete _0x5a6489['body']['id'];}return db[_0x9cfa('0x27')]['find']({'where':{'id':_0x5a6489[_0x9cfa('0x3f')]['id']}})[_0x9cfa('0x21')](handleEntityNotFound(_0x20a17c,null))['then'](saveUpdates(_0x5a6489['body'],null))[_0x9cfa('0x21')](respondWithResult(_0x20a17c,null))['catch'](handleError(_0x20a17c,null));};exports[_0x9cfa('0x1f')]=function(_0x167392,_0x54a166){return db[_0x9cfa('0x27')][_0x9cfa('0x43')]({'where':{'id':_0x167392[_0x9cfa('0x3f')]['id']}})[_0x9cfa('0x21')](handleEntityNotFound(_0x54a166,null))[_0x9cfa('0x21')](removeEntity(_0x54a166,null))['catch'](handleError(_0x54a166,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index abcc99e..9574c94 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 _0xa5af=['Template','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment'];(function(_0x3e6729,_0x16d4af){var _0x535bcd=function(_0x5e6c5f){while(--_0x5e6c5f){_0x3e6729['push'](_0x3e6729['shift']());}};_0x535bcd(++_0x16d4af);}(_0xa5af,0xf1));var _0xfa5a=function(_0x21749d,_0x3a8df3){_0x21749d=_0x21749d-0x0;var _0x2586e9=_0xa5af[_0x21749d];return _0x2586e9;};'use strict';var _=require(_0xfa5a('0x0'));var util=require(_0xfa5a('0x1'));var logger=require(_0xfa5a('0x2'))('api');var moment=require(_0xfa5a('0x3'));var BPromise=require('bluebird');var rp=require(_0xfa5a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfa5a('0x5'));var config=require(_0xfa5a('0x6'));var attributes=require('./template.attributes');module['exports']=function(_0x54738c,_0x4821b8){return _0x54738c['define'](_0xfa5a('0x7'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa647=['bluebird','request-promise','rimraf','../../config/environment','./template.attributes','Template','tools_templates','lodash','../../config/logger','api'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa647,0x1dd));var _0x7a64=function(_0x4f4936,_0x2c53f5){_0x4f4936=_0x4f4936-0x0;var _0x48b0ae=_0xa647[_0x4f4936];return _0x48b0ae;};'use strict';var _=require(_0x7a64('0x0'));var util=require('util');var logger=require(_0x7a64('0x1'))(_0x7a64('0x2'));var moment=require('moment');var BPromise=require(_0x7a64('0x3'));var rp=require(_0x7a64('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7a64('0x5'));var config=require(_0x7a64('0x6'));var attributes=require(_0x7a64('0x7'));module['exports']=function(_0x1a4935,_0xe9831){return _0x1a4935['define'](_0x7a64('0x8'),attributes,{'tableName':_0x7a64('0x9'),'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 e4bc2bb..04b431e 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 _0xf570=['http','then','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTemplate','Template','findAll','options','raw','where','limit','include','map','model','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xf570,0x7a));var _0x0f57=function(_0x863e7,_0x51c743){_0x863e7=_0x863e7-0x0;var _0x448353=_0xf570[_0x863e7];return _0x448353;};'use strict';var _=require(_0x0f57('0x0'));var util=require(_0x0f57('0x1'));var moment=require(_0x0f57('0x2'));var BPromise=require(_0x0f57('0x3'));var rs=require(_0x0f57('0x4'));var fs=require('fs');var Redis=require(_0x0f57('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0f57('0x6'));var logger=require('../../config/logger')(_0x0f57('0x7'));var config=require('../../config/environment');var jayson=require(_0x0f57('0x8'));var client=jayson[_0x0f57('0x9')][_0x0f57('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35d1db,_0x560739,_0x4bb57f){return new BPromise(function(_0x4a7b97,_0x17b745){return client['request'](_0x35d1db,_0x4bb57f)[_0x0f57('0xb')](function(_0x43904c){logger[_0x0f57('0xc')](_0x0f57('0xd'),_0x560739,_0x0f57('0xe'));logger['debug'](_0x0f57('0xf'),_0x560739,'request\x20sent',JSON[_0x0f57('0x10')](_0x43904c));if(_0x43904c[_0x0f57('0x11')]){if(_0x43904c['error']['code']===0x1f4){logger[_0x0f57('0x11')]('Template,\x20%s,\x20%s',_0x560739,_0x43904c[_0x0f57('0x11')][_0x0f57('0x12')]);return _0x17b745(_0x43904c[_0x0f57('0x11')][_0x0f57('0x12')]);}logger[_0x0f57('0x11')]('Template,\x20%s,\x20%s',_0x560739,_0x43904c[_0x0f57('0x11')][_0x0f57('0x12')]);return _0x4a7b97(_0x43904c['error']['message']);}else{logger['info'](_0x0f57('0xd'),_0x560739,_0x0f57('0xe'));_0x4a7b97(_0x43904c[_0x0f57('0x13')][_0x0f57('0x12')]);}})[_0x0f57('0x14')](function(_0x311a31){logger['error'](_0x0f57('0xd'),_0x560739,_0x311a31);_0x17b745(_0x311a31);});});}exports[_0x0f57('0x15')]=function(_0xc45790){var _0x235876=this;return new Promise(function(_0x3721e8,_0x4f4971){return db[_0x0f57('0x16')][_0x0f57('0x17')]({'raw':_0xc45790[_0x0f57('0x18')]?_0xc45790[_0x0f57('0x18')][_0x0f57('0x19')]===undefined?!![]:![]:!![],'where':_0xc45790['options']?_0xc45790[_0x0f57('0x18')][_0x0f57('0x1a')]||null:null,'attributes':_0xc45790[_0x0f57('0x18')]?_0xc45790[_0x0f57('0x18')]['attributes']||null:null,'limit':_0xc45790[_0x0f57('0x18')]?_0xc45790[_0x0f57('0x18')][_0x0f57('0x1b')]||null:null,'include':_0xc45790[_0x0f57('0x18')]?_0xc45790[_0x0f57('0x18')][_0x0f57('0x1c')]?_[_0x0f57('0x1d')](_0xc45790[_0x0f57('0x18')][_0x0f57('0x1c')],function(_0x67de23){return{'model':db[_0x67de23['model']],'as':_0x67de23['as'],'attributes':_0x67de23['attributes'],'include':_0x67de23[_0x0f57('0x1c')]?_['map'](_0x67de23[_0x0f57('0x1c')],function(_0x23409c){return{'model':db[_0x23409c[_0x0f57('0x1e')]],'as':_0x23409c['as'],'attributes':_0x23409c[_0x0f57('0x1f')],'include':_0x23409c[_0x0f57('0x1c')]?_[_0x0f57('0x1d')](_0x23409c[_0x0f57('0x1c')],function(_0x1e234a){return{'model':db[_0x1e234a[_0x0f57('0x1e')]],'as':_0x1e234a['as'],'attributes':_0x1e234a[_0x0f57('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0f57('0xb')](function(_0x20e5c8){logger[_0x0f57('0xc')](_0x0f57('0x15'),_0xc45790);logger[_0x0f57('0x20')](_0x0f57('0x15'),_0xc45790,JSON[_0x0f57('0x10')](_0x20e5c8));_0x3721e8(_0x20e5c8);})[_0x0f57('0x14')](function(_0x1d221e){logger[_0x0f57('0x11')](_0x0f57('0x15'),_0x1d221e['message'],_0xc45790);_0x4f4971(_0x235876['error'](0x1f4,_0x1d221e[_0x0f57('0x12')]));});});}; \ No newline at end of file +var _0xbd10=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTemplate','findAll','options','raw','attributes','include','map','model','debug','lodash','util'];(function(_0x6b2f51,_0x25a47e){var _0x254985=function(_0x3e522e){while(--_0x3e522e){_0x6b2f51['push'](_0x6b2f51['shift']());}};_0x254985(++_0x25a47e);}(_0xbd10,0x148));var _0x0bd1=function(_0x181341,_0x12bb48){_0x181341=_0x181341-0x0;var _0x22d7fe=_0xbd10[_0x181341];return _0x22d7fe;};'use strict';var _=require(_0x0bd1('0x0'));var util=require(_0x0bd1('0x1'));var moment=require(_0x0bd1('0x2'));var BPromise=require(_0x0bd1('0x3'));var rs=require(_0x0bd1('0x4'));var fs=require('fs');var Redis=require(_0x0bd1('0x5'));var db=require(_0x0bd1('0x6'))['db'];var utils=require(_0x0bd1('0x7'));var logger=require(_0x0bd1('0x8'))(_0x0bd1('0x9'));var config=require(_0x0bd1('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x0bd1('0xb')][_0x0bd1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4eb621,_0x14af76,_0x18ef54){return new BPromise(function(_0x48573e,_0x5ddd44){return client[_0x0bd1('0xd')](_0x4eb621,_0x18ef54)[_0x0bd1('0xe')](function(_0xd3f287){logger[_0x0bd1('0xf')](_0x0bd1('0x10'),_0x14af76,'request\x20sent');logger['debug']('Template,\x20%s,\x20%s,\x20%s',_0x14af76,_0x0bd1('0x11'),JSON[_0x0bd1('0x12')](_0xd3f287));if(_0xd3f287[_0x0bd1('0x13')]){if(_0xd3f287[_0x0bd1('0x13')][_0x0bd1('0x14')]===0x1f4){logger[_0x0bd1('0x13')]('Template,\x20%s,\x20%s',_0x14af76,_0xd3f287[_0x0bd1('0x13')][_0x0bd1('0x15')]);return _0x5ddd44(_0xd3f287['error'][_0x0bd1('0x15')]);}logger[_0x0bd1('0x13')](_0x0bd1('0x10'),_0x14af76,_0xd3f287[_0x0bd1('0x13')][_0x0bd1('0x15')]);return _0x48573e(_0xd3f287[_0x0bd1('0x13')][_0x0bd1('0x15')]);}else{logger[_0x0bd1('0xf')]('Template,\x20%s,\x20%s',_0x14af76,_0x0bd1('0x11'));_0x48573e(_0xd3f287[_0x0bd1('0x16')][_0x0bd1('0x15')]);}})[_0x0bd1('0x17')](function(_0x3a72ea){logger[_0x0bd1('0x13')](_0x0bd1('0x10'),_0x14af76,_0x3a72ea);_0x5ddd44(_0x3a72ea);});});}exports[_0x0bd1('0x18')]=function(_0x244a87){var _0x5bc81a=this;return new Promise(function(_0x14810a,_0x1910c2){return db['Template'][_0x0bd1('0x19')]({'raw':_0x244a87['options']?_0x244a87[_0x0bd1('0x1a')][_0x0bd1('0x1b')]===undefined?!![]:![]:!![],'where':_0x244a87[_0x0bd1('0x1a')]?_0x244a87[_0x0bd1('0x1a')]['where']||null:null,'attributes':_0x244a87[_0x0bd1('0x1a')]?_0x244a87[_0x0bd1('0x1a')][_0x0bd1('0x1c')]||null:null,'limit':_0x244a87[_0x0bd1('0x1a')]?_0x244a87[_0x0bd1('0x1a')]['limit']||null:null,'include':_0x244a87['options']?_0x244a87[_0x0bd1('0x1a')][_0x0bd1('0x1d')]?_[_0x0bd1('0x1e')](_0x244a87[_0x0bd1('0x1a')][_0x0bd1('0x1d')],function(_0x184892){return{'model':db[_0x184892['model']],'as':_0x184892['as'],'attributes':_0x184892[_0x0bd1('0x1c')],'include':_0x184892[_0x0bd1('0x1d')]?_[_0x0bd1('0x1e')](_0x184892[_0x0bd1('0x1d')],function(_0x5b2829){return{'model':db[_0x5b2829[_0x0bd1('0x1f')]],'as':_0x5b2829['as'],'attributes':_0x5b2829['attributes'],'include':_0x5b2829[_0x0bd1('0x1d')]?_['map'](_0x5b2829['include'],function(_0x1eab6a){return{'model':db[_0x1eab6a[_0x0bd1('0x1f')]],'as':_0x1eab6a['as'],'attributes':_0x1eab6a[_0x0bd1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0bd1('0xe')](function(_0x302af6){logger[_0x0bd1('0xf')](_0x0bd1('0x18'),_0x244a87);logger[_0x0bd1('0x20')]('GetTemplate',_0x244a87,JSON[_0x0bd1('0x12')](_0x302af6));_0x14810a(_0x302af6);})[_0x0bd1('0x17')](function(_0x295b8f){logger['error']('GetTemplate',_0x295b8f[_0x0bd1('0x15')],_0x244a87);_0x1910c2(_0x5bc81a[_0x0bd1('0x13')](0x1f4,_0x295b8f[_0x0bd1('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index f8ee7ef..787fe16 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 _0xcaee=['post','addAnyCondition','addAction','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./trigger.controller','isAuthenticated','index','get','/:id','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','addAllCondition'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0xcaee,0x1b8));var _0xecae=function(_0x752f8c,_0x3cd9dd){_0x752f8c=_0x752f8c-0x0;var _0x253b8d=_0xcaee[_0x752f8c];return _0x253b8d;};'use strict';var multer=require(_0xecae('0x0'));var util=require(_0xecae('0x1'));var path=require(_0xecae('0x2'));var timeout=require(_0xecae('0x3'));var express=require(_0xecae('0x4'));var router=express[_0xecae('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xecae('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xecae('0x7'));var controller=require(_0xecae('0x8'));router['get']('/',auth[_0xecae('0x9')](),controller[_0xecae('0xa')]);router[_0xecae('0xb')](_0xecae('0xc'),auth[_0xecae('0x9')](),controller['show']);router[_0xecae('0xb')](_0xecae('0xd'),auth[_0xecae('0x9')](),controller[_0xecae('0xe')]);router['get'](_0xecae('0xf'),auth[_0xecae('0x9')](),controller[_0xecae('0x10')]);router[_0xecae('0xb')](_0xecae('0x11'),auth[_0xecae('0x9')](),controller['getActions']);router['post']('/',auth[_0xecae('0x9')](),controller['create']);router['post'](_0xecae('0xd'),auth[_0xecae('0x9')](),controller[_0xecae('0x12')]);router[_0xecae('0x13')](_0xecae('0xf'),auth[_0xecae('0x9')](),controller[_0xecae('0x14')]);router['post'](_0xecae('0x11'),auth['isAuthenticated'](),controller[_0xecae('0x15')]);router[_0xecae('0x16')](_0xecae('0xc'),auth[_0xecae('0x9')](),controller[_0xecae('0x17')]);router[_0xecae('0x18')](_0xecae('0xc'),auth['isAuthenticated'](),controller[_0xecae('0x19')]);module[_0xecae('0x1a')]=router; \ No newline at end of file +var _0x799f=['../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','/:id/all_conditions','getAllConditions','/:id/any_conditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','addAction','put','update','delete','destroy','exports','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3dea33,_0x12d0b1){var _0x5d2054=function(_0x5390e3){while(--_0x5390e3){_0x3dea33['push'](_0x3dea33['shift']());}};_0x5d2054(++_0x12d0b1);}(_0x799f,0x1cf));var _0xf799=function(_0x4ed579,_0x2ea2d2){_0x4ed579=_0x4ed579-0x0;var _0x5ad91d=_0x799f[_0x4ed579];return _0x5ad91d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf799('0x0'));var timeout=require(_0xf799('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf799('0x2'));var auth=require(_0xf799('0x3'));var interaction=require(_0xf799('0x4'));var config=require(_0xf799('0x5'));var controller=require(_0xf799('0x6'));router[_0xf799('0x7')]('/',auth[_0xf799('0x8')](),controller[_0xf799('0x9')]);router[_0xf799('0x7')](_0xf799('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xf799('0x7')](_0xf799('0xb'),auth[_0xf799('0x8')](),controller[_0xf799('0xc')]);router[_0xf799('0x7')](_0xf799('0xd'),auth['isAuthenticated'](),controller['getAnyConditions']);router[_0xf799('0x7')](_0xf799('0xe'),auth[_0xf799('0x8')](),controller[_0xf799('0xf')]);router[_0xf799('0x10')]('/',auth[_0xf799('0x8')](),controller[_0xf799('0x11')]);router['post'](_0xf799('0xb'),auth[_0xf799('0x8')](),controller[_0xf799('0x12')]);router[_0xf799('0x10')](_0xf799('0xd'),auth[_0xf799('0x8')](),controller[_0xf799('0x13')]);router[_0xf799('0x10')](_0xf799('0xe'),auth['isAuthenticated'](),controller[_0xf799('0x14')]);router[_0xf799('0x15')](_0xf799('0xa'),auth[_0xf799('0x8')](),controller[_0xf799('0x16')]);router[_0xf799('0x17')](_0xf799('0xa'),auth[_0xf799('0x8')](),controller[_0xf799('0x18')]);module[_0xf799('0x19')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 417e62e..8e72fcf 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 _0x83e0=['STRING','BOOLEAN','sequelize','exports'];(function(_0x38d8e2,_0x48603c){var _0x5afbee=function(_0x2eca5e){while(--_0x2eca5e){_0x38d8e2['push'](_0x38d8e2['shift']());}};_0x5afbee(++_0x48603c);}(_0x83e0,0x1a2));var _0x083e=function(_0xf6e69b,_0x497fcf){_0xf6e69b=_0xf6e69b-0x0;var _0x170410=_0x83e0[_0xf6e69b];return _0x170410;};'use strict';var Sequelize=require(_0x083e('0x0'));module[_0x083e('0x1')]={'name':{'type':Sequelize[_0x083e('0x2')]},'channel':{'type':Sequelize[_0x083e('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x083e('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xc70f=['exports','STRING','sequelize'];(function(_0x134412,_0x45ead6){var _0x235175=function(_0x5ca262){while(--_0x5ca262){_0x134412['push'](_0x134412['shift']());}};_0x235175(++_0x45ead6);}(_0xc70f,0x19a));var _0xfc70=function(_0x254f40,_0x2e09d9){_0x254f40=_0x254f40-0x0;var _0x4cd227=_0xc70f[_0x254f40];return _0x4cd227;};'use strict';var Sequelize=require(_0xfc70('0x0'));module[_0xfc70('0x1')]={'name':{'type':Sequelize[_0xfc70('0x2')]},'channel':{'type':Sequelize[_0xfc70('0x2')]},'description':{'type':Sequelize[_0xfc70('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 81eb14f..13a3272 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 _0x753d=['fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','error','stack','name','send','Trigger','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','Condition','map','getAllConditions','hasOwnProperty','findOne','order','getAnyConditions','addAction','TriggerId','Action','getActions','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv'];(function(_0x1afcdd,_0xeebda8){var _0x8226fc=function(_0x5d341e){while(--_0x5d341e){_0x1afcdd['push'](_0x1afcdd['shift']());}};_0x8226fc(++_0xeebda8);}(_0x753d,0x16b));var _0xd753=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x753d[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd753('0x0'));var zipdir=require(_0xd753('0x1'));var jsonpatch=require(_0xd753('0x2'));var rp=require('request-promise');var moment=require(_0xd753('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd753('0x4'));var util=require(_0xd753('0x5'));var path=require(_0xd753('0x6'));var sox=require(_0xd753('0x7'));var csv=require(_0xd753('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd753('0x9'));var _=require(_0xd753('0xa'));var squel=require(_0xd753('0xb'));var crypto=require('crypto');var jsforce=require(_0xd753('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd753('0x8'));var querystring=require(_0xd753('0xd'));var Papa=require(_0xd753('0xe'));var Redis=require(_0xd753('0xf'));var authService=require(_0xd753('0x10'));var qs=require(_0xd753('0x11'));var as=require(_0xd753('0x12'));var hardwareService=require(_0xd753('0x13'));var logger=require(_0xd753('0x14'))('api');var utils=require(_0xd753('0x15'));var config=require(_0xd753('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd753('0x17'))['db'];function respondWithStatusCode(_0x2a062c,_0x18195f){_0x18195f=_0x18195f||0xcc;return function(_0x26097f){if(_0x26097f){return _0x2a062c[_0xd753('0x18')](_0x18195f);}return _0x2a062c['status'](_0x18195f)[_0xd753('0x19')]();};}function respondWithResult(_0x534a74,_0x4c38a4){_0x4c38a4=_0x4c38a4||0xc8;return function(_0x355bab){if(_0x355bab){return _0x534a74[_0xd753('0x1a')](_0x4c38a4)[_0xd753('0x1b')](_0x355bab);}};}function respondWithFilteredResult(_0x321272,_0x4c2dcf){return function(_0x9f6b6e){if(_0x9f6b6e){var _0x34a7ed=typeof _0x4c2dcf[_0xd753('0x1c')]===_0xd753('0x1d')&&typeof _0x4c2dcf[_0xd753('0x1e')]===_0xd753('0x1d');var _0x5f5383=_0x9f6b6e[_0xd753('0x1f')];var _0x59748d=_0x34a7ed?0x0:_0x4c2dcf[_0xd753('0x1c')];var _0x3ff2a4=_0x34a7ed?_0x9f6b6e['count']:_0x4c2dcf[_0xd753('0x1c')]+_0x4c2dcf[_0xd753('0x1e')];var _0x50f7b3;if(_0x3ff2a4>=_0x5f5383){_0x3ff2a4=_0x5f5383;_0x50f7b3=0xc8;}else{_0x50f7b3=0xce;}_0x321272['status'](_0x50f7b3);return _0x321272[_0xd753('0x20')](_0xd753('0x21'),_0x59748d+'-'+_0x3ff2a4+'/'+_0x5f5383)[_0xd753('0x1b')](_0x9f6b6e);}return null;};}function patchUpdates(_0x3d1b68){return function(_0x4d99af){try{jsonpatch['apply'](_0x4d99af,_0x3d1b68,!![]);}catch(_0x2552be){return BPromise[_0xd753('0x22')](_0x2552be);}return _0x4d99af[_0xd753('0x23')]();};}function saveUpdates(_0x27d226,_0x374545){return function(_0x1cb2b1){if(_0x1cb2b1){return _0x1cb2b1[_0xd753('0x24')](_0x27d226)[_0xd753('0x25')](function(_0x595fbd){return _0x595fbd;});}return null;};}function removeEntity(_0x4ff195,_0xc9d5bd){return function(_0x380418){if(_0x380418){return _0x380418[_0xd753('0x26')]()[_0xd753('0x25')](function(){var _0x3107b9=_0x380418[_0xd753('0x27')]({'plain':!![]});var _0x2b363e='Triggers';return db['UserProfileResource']['destroy']({'where':{'type':_0x2b363e,'resourceId':_0x3107b9['id']}})[_0xd753('0x25')](function(){return _0x380418;});})[_0xd753('0x25')](function(){_0x4ff195[_0xd753('0x1a')](0xcc)[_0xd753('0x19')]();});}};}function handleEntityNotFound(_0x101d37,_0x414fc1){return function(_0x1038ba){if(!_0x1038ba){_0x101d37[_0xd753('0x18')](0x194);}return _0x1038ba;};}function handleError(_0x354b3e,_0x1b78f6){_0x1b78f6=_0x1b78f6||0x1f4;return function(_0x346dcc){logger[_0xd753('0x28')](_0x346dcc[_0xd753('0x29')]);if(_0x346dcc['name']){delete _0x346dcc[_0xd753('0x2a')];}_0x354b3e['status'](_0x1b78f6)[_0xd753('0x2b')](_0x346dcc);};}exports['index']=function(_0xf5d85b,_0x59f330){var _0xf3f1c3={},_0x844b10={},_0x1c4533={'count':0x0,'rows':[]};var _0x8ed063=_['map'](db[_0xd753('0x2c')][_0xd753('0x2d')],function(_0x594241){return{'name':_0x594241[_0xd753('0x2e')],'type':_0x594241[_0xd753('0x2f')][_0xd753('0x30')]};});_0x844b10[_0xd753('0x31')]=_['map'](_0x8ed063,_0xd753('0x2a'));_0x844b10[_0xd753('0x32')]=_['keys'](_0xf5d85b[_0xd753('0x32')]);_0x844b10[_0xd753('0x33')]=_[_0xd753('0x34')](_0x844b10[_0xd753('0x31')],_0x844b10[_0xd753('0x32')]);_0xf3f1c3[_0xd753('0x35')]=_['intersection'](_0x844b10[_0xd753('0x31')],qs['fields'](_0xf5d85b[_0xd753('0x32')][_0xd753('0x36')]));_0xf3f1c3['attributes']=_0xf3f1c3['attributes'][_0xd753('0x37')]?_0xf3f1c3[_0xd753('0x35')]:_0x844b10['model'];if(!_0xf5d85b[_0xd753('0x32')]['hasOwnProperty'](_0xd753('0x38'))){_0xf3f1c3[_0xd753('0x1e')]=qs[_0xd753('0x1e')](_0xf5d85b['query'][_0xd753('0x1e')]);_0xf3f1c3['offset']=qs[_0xd753('0x1c')](_0xf5d85b[_0xd753('0x32')][_0xd753('0x1c')]);}_0xf3f1c3['order']=qs[_0xd753('0x39')](_0xf5d85b[_0xd753('0x32')]['sort']);_0xf3f1c3[_0xd753('0x3a')]=qs[_0xd753('0x33')](_[_0xd753('0x3b')](_0xf5d85b[_0xd753('0x32')],_0x844b10['filters']),_0x8ed063);if(_0xf5d85b['query'][_0xd753('0x3c')]){_0xf3f1c3['where']=_[_0xd753('0x3d')](_0xf3f1c3[_0xd753('0x3a')],{'$or':_['map'](_0x8ed063,function(_0x3ef7bb){if(_0x3ef7bb[_0xd753('0x2f')]!==_0xd753('0x3e')){var _0x83451c={};_0x83451c[_0x3ef7bb[_0xd753('0x2a')]]={'$like':'%'+_0xf5d85b[_0xd753('0x32')][_0xd753('0x3c')]+'%'};return _0x83451c;}})});}_0xf3f1c3=_[_0xd753('0x3d')]({},_0xf3f1c3,_0xf5d85b[_0xd753('0x3f')]);var _0x5ea0ef={'where':_0xf3f1c3[_0xd753('0x3a')]};return db['Trigger']['count'](_0x5ea0ef)['then'](function(_0x5456a3){_0x1c4533[_0xd753('0x1f')]=_0x5456a3;if(_0xf5d85b[_0xd753('0x32')]['includeAll']){_0xf3f1c3[_0xd753('0x40')]=[{'all':!![]}];}return db[_0xd753('0x2c')][_0xd753('0x41')](_0xf3f1c3);})[_0xd753('0x25')](function(_0x5eedc1){_0x1c4533[_0xd753('0x42')]=_0x5eedc1;return _0x1c4533;})[_0xd753('0x25')](respondWithFilteredResult(_0x59f330,_0xf3f1c3))[_0xd753('0x43')](handleError(_0x59f330,null));};exports['show']=function(_0x4072f8,_0x26c235){var _0x3a8193={'raw':![],'where':{'id':_0x4072f8[_0xd753('0x44')]['id']}},_0x53c6ba={};_0x53c6ba[_0xd753('0x31')]=_[_0xd753('0x45')](db[_0xd753('0x2c')][_0xd753('0x2d')]);_0x53c6ba[_0xd753('0x32')]=_['keys'](_0x4072f8['query']);_0x53c6ba[_0xd753('0x33')]=_[_0xd753('0x34')](_0x53c6ba['model'],_0x53c6ba[_0xd753('0x32')]);_0x3a8193['attributes']=_[_0xd753('0x34')](_0x53c6ba[_0xd753('0x31')],qs['fields'](_0x4072f8['query']['fields']));_0x3a8193['attributes']=_0x3a8193['attributes']['length']?_0x3a8193['attributes']:_0x53c6ba['model'];if(_0x4072f8[_0xd753('0x32')]['includeAll']){_0x3a8193[_0xd753('0x40')]=[{'all':!![]}];}_0x3a8193=_[_0xd753('0x3d')]({},_0x3a8193,_0x4072f8['options']);return db[_0xd753('0x2c')][_0xd753('0x46')](_0x3a8193)['then'](handleEntityNotFound(_0x26c235,null))[_0xd753('0x25')](respondWithResult(_0x26c235,null))[_0xd753('0x43')](handleError(_0x26c235,null));};exports[_0xd753('0x47')]=function(_0x300920,_0xee3e2b){return db[_0xd753('0x2c')][_0xd753('0x47')](_0x300920[_0xd753('0x48')],{})[_0xd753('0x25')](function(_0x49b958){var _0x2ebb17=_0x300920[_0xd753('0x49')][_0xd753('0x27')]({'plain':!![]});if(!_0x2ebb17)throw new Error(_0xd753('0x4a'));if(_0x2ebb17[_0xd753('0x4b')]===_0xd753('0x49')){var _0x5c371d=_0x49b958[_0xd753('0x27')]({'plain':!![]});var _0x41bf64=_0xd753('0x4c');return db[_0xd753('0x4d')]['find']({'where':{'name':_0x41bf64,'userProfileId':_0x2ebb17['userProfileId']},'raw':!![]})[_0xd753('0x25')](function(_0x52b575){if(_0x52b575&&_0x52b575[_0xd753('0x4e')]===0x0){return db[_0xd753('0x4f')][_0xd753('0x47')]({'name':_0x5c371d['name'],'resourceId':_0x5c371d['id'],'type':_0x52b575[_0xd753('0x2a')],'sectionId':_0x52b575['id']},{})[_0xd753('0x25')](function(){return _0x49b958;});}else{return _0x49b958;}})[_0xd753('0x43')](function(_0x3e5698){logger['error'](_0xd753('0x50'),_0x3e5698);throw _0x3e5698;});}return _0x49b958;})[_0xd753('0x25')](respondWithResult(_0xee3e2b,0xc9))[_0xd753('0x43')](handleError(_0xee3e2b,null));};exports['update']=function(_0x4bf00e,_0x5dfada){if(_0x4bf00e[_0xd753('0x48')]['id']){delete _0x4bf00e[_0xd753('0x48')]['id'];}return db[_0xd753('0x2c')]['find']({'where':{'id':_0x4bf00e[_0xd753('0x44')]['id']}})[_0xd753('0x25')](handleEntityNotFound(_0x5dfada,null))[_0xd753('0x25')](saveUpdates(_0x4bf00e[_0xd753('0x48')],null))['then'](respondWithResult(_0x5dfada,null))[_0xd753('0x43')](handleError(_0x5dfada,null));};exports[_0xd753('0x26')]=function(_0x490258,_0x3344e3){return db[_0xd753('0x2c')]['find']({'where':{'id':_0x490258[_0xd753('0x44')]['id']}})[_0xd753('0x25')](handleEntityNotFound(_0x3344e3,null))[_0xd753('0x25')](removeEntity(_0x3344e3,null))[_0xd753('0x43')](handleError(_0x3344e3,null));};exports[_0xd753('0x51')]=function(_0x23fefb,_0x173247,_0x5d7c3b){if(_0x23fefb[_0xd753('0x48')]['id']){delete _0x23fefb['body']['id'];}return db[_0xd753('0x2c')][_0xd753('0x46')]({'where':{'id':_0x23fefb[_0xd753('0x44')]['id']}})[_0xd753('0x25')](handleEntityNotFound(_0x173247,null))[_0xd753('0x25')](function(_0x4e1606){if(_0x4e1606){_0x23fefb['body']['TriggerAllId']=_0x4e1606['id'];return db[_0xd753('0x52')][_0xd753('0x47')](_0x23fefb[_0xd753('0x48')]);}})[_0xd753('0x25')](respondWithResult(_0x173247,null))[_0xd753('0x43')](handleError(_0x173247,null));};exports['addAnyCondition']=function(_0xf66259,_0x6a3d79,_0x3ddb33){if(_0xf66259[_0xd753('0x48')]['id']){delete _0xf66259['body']['id'];}return db['Trigger'][_0xd753('0x46')]({'where':{'id':_0xf66259[_0xd753('0x44')]['id']}})[_0xd753('0x25')](handleEntityNotFound(_0x6a3d79,null))[_0xd753('0x25')](function(_0x44ce20){if(_0x44ce20){_0xf66259[_0xd753('0x48')]['TriggerAnyId']=_0x44ce20['id'];return db['Condition'][_0xd753('0x47')](_0xf66259[_0xd753('0x48')]);}})[_0xd753('0x25')](respondWithResult(_0x6a3d79,null))[_0xd753('0x43')](handleError(_0x6a3d79,null));};exports['getAllConditions']=function(_0x54430b,_0x2466e8,_0x1843af){var _0x25945b={};var _0x12f0c8={};var _0x1b6ce1;var _0x285906;return db[_0xd753('0x2c')]['findOne']({'where':{'id':_0x54430b[_0xd753('0x44')]['id']}})['then'](handleEntityNotFound(_0x2466e8,null))[_0xd753('0x25')](function(_0x53e23a){if(_0x53e23a){_0x1b6ce1=_0x53e23a;_0x12f0c8['model']=_[_0xd753('0x45')](db[_0xd753('0x52')]['rawAttributes']);_0x12f0c8['query']=_[_0xd753('0x45')](_0x54430b[_0xd753('0x32')]);_0x12f0c8[_0xd753('0x33')]=_[_0xd753('0x34')](_0x12f0c8[_0xd753('0x31')],_0x12f0c8[_0xd753('0x32')]);_0x25945b[_0xd753('0x35')]=_[_0xd753('0x34')](_0x12f0c8[_0xd753('0x31')],qs['fields'](_0x54430b['query'][_0xd753('0x36')]));_0x25945b['attributes']=_0x25945b[_0xd753('0x35')]['length']?_0x25945b[_0xd753('0x35')]:_0x12f0c8[_0xd753('0x31')];_0x25945b['order']=qs[_0xd753('0x39')](_0x54430b[_0xd753('0x32')][_0xd753('0x39')]);_0x25945b['where']=qs[_0xd753('0x33')](_['pick'](_0x54430b[_0xd753('0x32')],_0x12f0c8['filters']));if(_0x54430b['query'][_0xd753('0x3c')]){_0x25945b[_0xd753('0x3a')]=_[_0xd753('0x3d')](_0x25945b[_0xd753('0x3a')],{'$or':_[_0xd753('0x53')](_0x25945b[_0xd753('0x35')],function(_0x32a16e){var _0x306398={};_0x306398[_0x32a16e]={'$like':'%'+_0x54430b[_0xd753('0x32')][_0xd753('0x3c')]+'%'};return _0x306398;})});}_0x25945b=_['merge']({},_0x25945b,_0x54430b[_0xd753('0x3f')]);return _0x1b6ce1[_0xd753('0x54')](_0x25945b);}})[_0xd753('0x25')](function(_0x3fa66a){if(_0x3fa66a){_0x285906=_0x3fa66a[_0xd753('0x37')];if(!_0x54430b[_0xd753('0x32')][_0xd753('0x55')](_0xd753('0x38'))){_0x25945b[_0xd753('0x1e')]=qs[_0xd753('0x1e')](_0x54430b['query']['limit']);_0x25945b[_0xd753('0x1c')]=qs[_0xd753('0x1c')](_0x54430b[_0xd753('0x32')][_0xd753('0x1c')]);}return _0x1b6ce1[_0xd753('0x54')](_0x25945b);}})[_0xd753('0x25')](function(_0x42d6bd){if(_0x42d6bd){return _0x42d6bd?{'count':_0x285906,'rows':_0x42d6bd}:null;}})['then'](respondWithResult(_0x2466e8,null))[_0xd753('0x43')](handleError(_0x2466e8,null));};exports['getAnyConditions']=function(_0x243205,_0x5be785,_0x2e609c){var _0x30beed={};var _0x2a186a={};var _0x5b44c5;var _0x432021;return db[_0xd753('0x2c')][_0xd753('0x56')]({'where':{'id':_0x243205['params']['id']}})[_0xd753('0x25')](handleEntityNotFound(_0x5be785,null))[_0xd753('0x25')](function(_0x3cbed3){if(_0x3cbed3){_0x5b44c5=_0x3cbed3;_0x2a186a[_0xd753('0x31')]=_[_0xd753('0x45')](db[_0xd753('0x52')]['rawAttributes']);_0x2a186a['query']=_['keys'](_0x243205[_0xd753('0x32')]);_0x2a186a['filters']=_[_0xd753('0x34')](_0x2a186a['model'],_0x2a186a[_0xd753('0x32')]);_0x30beed[_0xd753('0x35')]=_[_0xd753('0x34')](_0x2a186a[_0xd753('0x31')],qs[_0xd753('0x36')](_0x243205[_0xd753('0x32')][_0xd753('0x36')]));_0x30beed[_0xd753('0x35')]=_0x30beed[_0xd753('0x35')][_0xd753('0x37')]?_0x30beed[_0xd753('0x35')]:_0x2a186a['model'];_0x30beed[_0xd753('0x57')]=qs['sort'](_0x243205[_0xd753('0x32')][_0xd753('0x39')]);_0x30beed[_0xd753('0x3a')]=qs[_0xd753('0x33')](_[_0xd753('0x3b')](_0x243205[_0xd753('0x32')],_0x2a186a[_0xd753('0x33')]));if(_0x243205['query'][_0xd753('0x3c')]){_0x30beed['where']=_[_0xd753('0x3d')](_0x30beed['where'],{'$or':_['map'](_0x30beed[_0xd753('0x35')],function(_0x1c9c50){var _0x2f24b2={};_0x2f24b2[_0x1c9c50]={'$like':'%'+_0x243205[_0xd753('0x32')][_0xd753('0x3c')]+'%'};return _0x2f24b2;})});}_0x30beed=_[_0xd753('0x3d')]({},_0x30beed,_0x243205[_0xd753('0x3f')]);return _0x5b44c5['getAnyConditions'](_0x30beed);}})[_0xd753('0x25')](function(_0x2f35a6){if(_0x2f35a6){_0x432021=_0x2f35a6[_0xd753('0x37')];if(!_0x243205[_0xd753('0x32')][_0xd753('0x55')](_0xd753('0x38'))){_0x30beed['limit']=qs[_0xd753('0x1e')](_0x243205[_0xd753('0x32')]['limit']);_0x30beed[_0xd753('0x1c')]=qs[_0xd753('0x1c')](_0x243205[_0xd753('0x32')]['offset']);}return _0x5b44c5[_0xd753('0x58')](_0x30beed);}})[_0xd753('0x25')](function(_0x5370c8){if(_0x5370c8){return _0x5370c8?{'count':_0x432021,'rows':_0x5370c8}:null;}})[_0xd753('0x25')](respondWithResult(_0x5be785,null))[_0xd753('0x43')](handleError(_0x5be785,null));};exports[_0xd753('0x59')]=function(_0x3af6cd,_0x179f66,_0x189813){if(_0x3af6cd[_0xd753('0x48')]['id']){delete _0x3af6cd[_0xd753('0x48')]['id'];}return db['Trigger'][_0xd753('0x46')]({'where':{'id':_0x3af6cd[_0xd753('0x44')]['id']}})[_0xd753('0x25')](handleEntityNotFound(_0x179f66,null))[_0xd753('0x25')](function(_0x2b5939){if(_0x2b5939){_0x3af6cd[_0xd753('0x48')][_0xd753('0x5a')]=_0x2b5939['id'];return db[_0xd753('0x5b')][_0xd753('0x47')](_0x3af6cd[_0xd753('0x48')]);}})[_0xd753('0x25')](respondWithResult(_0x179f66,null))[_0xd753('0x43')](handleError(_0x179f66,null));};exports['getActions']=function(_0x249a2d,_0x396057,_0x1d65cc){var _0xb1a86f={};var _0x17e920={};var _0x4a9426;var _0x57cc2f;return db['Trigger'][_0xd753('0x56')]({'where':{'id':_0x249a2d[_0xd753('0x44')]['id']}})['then'](handleEntityNotFound(_0x396057,null))[_0xd753('0x25')](function(_0x2f9b96){if(_0x2f9b96){_0x4a9426=_0x2f9b96;_0x17e920[_0xd753('0x31')]=_[_0xd753('0x45')](db['Action'][_0xd753('0x2d')]);_0x17e920[_0xd753('0x32')]=_['keys'](_0x249a2d[_0xd753('0x32')]);_0x17e920[_0xd753('0x33')]=_[_0xd753('0x34')](_0x17e920[_0xd753('0x31')],_0x17e920[_0xd753('0x32')]);_0xb1a86f[_0xd753('0x35')]=_[_0xd753('0x34')](_0x17e920[_0xd753('0x31')],qs[_0xd753('0x36')](_0x249a2d[_0xd753('0x32')][_0xd753('0x36')]));_0xb1a86f[_0xd753('0x35')]=_0xb1a86f[_0xd753('0x35')]['length']?_0xb1a86f[_0xd753('0x35')]:_0x17e920['model'];_0xb1a86f['order']=qs[_0xd753('0x39')](_0x249a2d[_0xd753('0x32')][_0xd753('0x39')]);_0xb1a86f[_0xd753('0x3a')]=qs[_0xd753('0x33')](_[_0xd753('0x3b')](_0x249a2d[_0xd753('0x32')],_0x17e920[_0xd753('0x33')]));if(_0x249a2d[_0xd753('0x32')][_0xd753('0x3c')]){_0xb1a86f[_0xd753('0x3a')]=_[_0xd753('0x3d')](_0xb1a86f[_0xd753('0x3a')],{'$or':_[_0xd753('0x53')](_0xb1a86f['attributes'],function(_0x11dc2b){var _0x20b872={};_0x20b872[_0x11dc2b]={'$like':'%'+_0x249a2d['query']['filter']+'%'};return _0x20b872;})});}_0xb1a86f=_[_0xd753('0x3d')]({},_0xb1a86f,_0x249a2d[_0xd753('0x3f')]);return _0x4a9426[_0xd753('0x5c')](_0xb1a86f);}})[_0xd753('0x25')](function(_0x41d35a){if(_0x41d35a){_0x57cc2f=_0x41d35a['length'];if(!_0x249a2d['query']['hasOwnProperty'](_0xd753('0x38'))){_0xb1a86f[_0xd753('0x1e')]=qs[_0xd753('0x1e')](_0x249a2d[_0xd753('0x32')][_0xd753('0x1e')]);_0xb1a86f[_0xd753('0x1c')]=qs[_0xd753('0x1c')](_0x249a2d[_0xd753('0x32')][_0xd753('0x1c')]);}return _0x4a9426[_0xd753('0x5c')](_0xb1a86f);}})[_0xd753('0x25')](function(_0x23fade){if(_0x23fade){return _0x23fade?{'count':_0x57cc2f,'rows':_0x23fade}:null;}})[_0xd753('0x25')](respondWithResult(_0x396057,null))[_0xd753('0x43')](handleError(_0x396057,null));}; \ No newline at end of file +var _0x1f39=['include','show','includeAll','create','role','user','get','UserProfileSection','find','autoAssociation','catch','error','body','params','addAllCondition','Condition','addAnyCondition','TriggerAnyId','findOne','getAllConditions','getAnyConditions','TriggerId','getActions','Action','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','Triggers','UserProfileResource','stack','send','index','map','Trigger','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options'];(function(_0x267d8d,_0xe90f65){var _0x11a98f=function(_0x5703c9){while(--_0x5703c9){_0x267d8d['push'](_0x267d8d['shift']());}};_0x11a98f(++_0xe90f65);}(_0x1f39,0x7a));var _0x91f3=function(_0x198c41,_0x1c00c3){_0x198c41=_0x198c41-0x0;var _0xc51abc=_0x1f39[_0x198c41];return _0xc51abc;};'use strict';var emlformat=require(_0x91f3('0x0'));var rimraf=require(_0x91f3('0x1'));var zipdir=require(_0x91f3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x91f3('0x3'));var moment=require(_0x91f3('0x4'));var BPromise=require(_0x91f3('0x5'));var Mustache=require(_0x91f3('0x6'));var util=require(_0x91f3('0x7'));var path=require(_0x91f3('0x8'));var sox=require('sox');var csv=require(_0x91f3('0x9'));var ejs=require(_0x91f3('0xa'));var fs=require('fs');var fs_extra=require(_0x91f3('0xb'));var _=require('lodash');var squel=require(_0x91f3('0xc'));var crypto=require(_0x91f3('0xd'));var jsforce=require(_0x91f3('0xe'));var deskjs=require(_0x91f3('0xf'));var toCsv=require(_0x91f3('0x9'));var querystring=require(_0x91f3('0x10'));var Papa=require(_0x91f3('0x11'));var Redis=require(_0x91f3('0x12'));var authService=require(_0x91f3('0x13'));var qs=require(_0x91f3('0x14'));var as=require(_0x91f3('0x15'));var hardwareService=require(_0x91f3('0x16'));var logger=require(_0x91f3('0x17'))(_0x91f3('0x18'));var utils=require(_0x91f3('0x19'));var config=require(_0x91f3('0x1a'));var licenseUtil=require(_0x91f3('0x1b'));var db=require(_0x91f3('0x1c'))['db'];function respondWithStatusCode(_0x2f8c1e,_0x5e1bfb){_0x5e1bfb=_0x5e1bfb||0xcc;return function(_0x1ab099){if(_0x1ab099){return _0x2f8c1e[_0x91f3('0x1d')](_0x5e1bfb);}return _0x2f8c1e[_0x91f3('0x1e')](_0x5e1bfb)[_0x91f3('0x1f')]();};}function respondWithResult(_0x368067,_0x11fcf8){_0x11fcf8=_0x11fcf8||0xc8;return function(_0x109a1f){if(_0x109a1f){return _0x368067[_0x91f3('0x1e')](_0x11fcf8)[_0x91f3('0x20')](_0x109a1f);}};}function respondWithFilteredResult(_0x5ad2a0,_0x16ffea){return function(_0x576318){if(_0x576318){var _0x233586=typeof _0x16ffea['offset']===_0x91f3('0x21')&&typeof _0x16ffea[_0x91f3('0x22')]===_0x91f3('0x21');var _0xe76ecf=_0x576318[_0x91f3('0x23')];var _0x5755d2=_0x233586?0x0:_0x16ffea[_0x91f3('0x24')];var _0x40f46e=_0x233586?_0x576318['count']:_0x16ffea[_0x91f3('0x24')]+_0x16ffea[_0x91f3('0x22')];var _0x17d1bd;if(_0x40f46e>=_0xe76ecf){_0x40f46e=_0xe76ecf;_0x17d1bd=0xc8;}else{_0x17d1bd=0xce;}_0x5ad2a0['status'](_0x17d1bd);return _0x5ad2a0['set'](_0x91f3('0x25'),_0x5755d2+'-'+_0x40f46e+'/'+_0xe76ecf)[_0x91f3('0x20')](_0x576318);}return null;};}function patchUpdates(_0x223923){return function(_0x43ad51){try{jsonpatch[_0x91f3('0x26')](_0x43ad51,_0x223923,!![]);}catch(_0x2b93f8){return BPromise[_0x91f3('0x27')](_0x2b93f8);}return _0x43ad51[_0x91f3('0x28')]();};}function saveUpdates(_0x51f046,_0x1dbe8c){return function(_0x54e60f){if(_0x54e60f){return _0x54e60f[_0x91f3('0x29')](_0x51f046)[_0x91f3('0x2a')](function(_0x45bbe7){return _0x45bbe7;});}return null;};}function removeEntity(_0xb5ea47,_0x984a63){return function(_0x3ddb44){if(_0x3ddb44){return _0x3ddb44[_0x91f3('0x2b')]()[_0x91f3('0x2a')](function(){var _0x2531cc=_0x3ddb44['get']({'plain':!![]});var _0x311069=_0x91f3('0x2c');return db[_0x91f3('0x2d')][_0x91f3('0x2b')]({'where':{'type':_0x311069,'resourceId':_0x2531cc['id']}})[_0x91f3('0x2a')](function(){return _0x3ddb44;});})[_0x91f3('0x2a')](function(){_0xb5ea47[_0x91f3('0x1e')](0xcc)[_0x91f3('0x1f')]();});}};}function handleEntityNotFound(_0x58d29e,_0x26cbab){return function(_0x5102b7){if(!_0x5102b7){_0x58d29e[_0x91f3('0x1d')](0x194);}return _0x5102b7;};}function handleError(_0x5cd539,_0x324a17){_0x324a17=_0x324a17||0x1f4;return function(_0x3cf346){logger['error'](_0x3cf346[_0x91f3('0x2e')]);if(_0x3cf346['name']){delete _0x3cf346['name'];}_0x5cd539[_0x91f3('0x1e')](_0x324a17)[_0x91f3('0x2f')](_0x3cf346);};}exports[_0x91f3('0x30')]=function(_0x2071ed,_0x2a2d97){var _0x5ca8e7={},_0x5d41a7={},_0x5e6d57={'count':0x0,'rows':[]};var _0x6aed3=_[_0x91f3('0x31')](db[_0x91f3('0x32')][_0x91f3('0x33')],function(_0x49cfb6){return{'name':_0x49cfb6[_0x91f3('0x34')],'type':_0x49cfb6[_0x91f3('0x35')][_0x91f3('0x36')]};});_0x5d41a7[_0x91f3('0x37')]=_[_0x91f3('0x31')](_0x6aed3,_0x91f3('0x38'));_0x5d41a7[_0x91f3('0x39')]=_[_0x91f3('0x3a')](_0x2071ed[_0x91f3('0x39')]);_0x5d41a7['filters']=_[_0x91f3('0x3b')](_0x5d41a7[_0x91f3('0x37')],_0x5d41a7['query']);_0x5ca8e7[_0x91f3('0x3c')]=_[_0x91f3('0x3b')](_0x5d41a7[_0x91f3('0x37')],qs[_0x91f3('0x3d')](_0x2071ed[_0x91f3('0x39')][_0x91f3('0x3d')]));_0x5ca8e7['attributes']=_0x5ca8e7[_0x91f3('0x3c')][_0x91f3('0x3e')]?_0x5ca8e7[_0x91f3('0x3c')]:_0x5d41a7[_0x91f3('0x37')];if(!_0x2071ed[_0x91f3('0x39')][_0x91f3('0x3f')](_0x91f3('0x40'))){_0x5ca8e7[_0x91f3('0x22')]=qs[_0x91f3('0x22')](_0x2071ed['query']['limit']);_0x5ca8e7['offset']=qs['offset'](_0x2071ed[_0x91f3('0x39')][_0x91f3('0x24')]);}_0x5ca8e7[_0x91f3('0x41')]=qs[_0x91f3('0x42')](_0x2071ed[_0x91f3('0x39')][_0x91f3('0x42')]);_0x5ca8e7['where']=qs[_0x91f3('0x43')](_[_0x91f3('0x44')](_0x2071ed[_0x91f3('0x39')],_0x5d41a7[_0x91f3('0x43')]),_0x6aed3);if(_0x2071ed[_0x91f3('0x39')][_0x91f3('0x45')]){_0x5ca8e7[_0x91f3('0x46')]=_[_0x91f3('0x47')](_0x5ca8e7[_0x91f3('0x46')],{'$or':_[_0x91f3('0x31')](_0x6aed3,function(_0x2e4952){if(_0x2e4952[_0x91f3('0x35')]!==_0x91f3('0x48')){var _0x5ec1ff={};_0x5ec1ff[_0x2e4952[_0x91f3('0x38')]]={'$like':'%'+_0x2071ed[_0x91f3('0x39')][_0x91f3('0x45')]+'%'};return _0x5ec1ff;}})});}_0x5ca8e7=_['merge']({},_0x5ca8e7,_0x2071ed[_0x91f3('0x49')]);var _0x58c492={'where':_0x5ca8e7['where']};return db[_0x91f3('0x32')][_0x91f3('0x23')](_0x58c492)['then'](function(_0x4ecf58){_0x5e6d57['count']=_0x4ecf58;if(_0x2071ed[_0x91f3('0x39')]['includeAll']){_0x5ca8e7[_0x91f3('0x4a')]=[{'all':!![]}];}return db[_0x91f3('0x32')]['findAll'](_0x5ca8e7);})[_0x91f3('0x2a')](function(_0x31ac19){_0x5e6d57['rows']=_0x31ac19;return _0x5e6d57;})[_0x91f3('0x2a')](respondWithFilteredResult(_0x2a2d97,_0x5ca8e7))['catch'](handleError(_0x2a2d97,null));};exports[_0x91f3('0x4b')]=function(_0x5209f9,_0x542f9a){var _0x1f0fa6={'raw':![],'where':{'id':_0x5209f9['params']['id']}},_0x48e729={};_0x48e729[_0x91f3('0x37')]=_[_0x91f3('0x3a')](db[_0x91f3('0x32')]['rawAttributes']);_0x48e729[_0x91f3('0x39')]=_['keys'](_0x5209f9['query']);_0x48e729[_0x91f3('0x43')]=_[_0x91f3('0x3b')](_0x48e729[_0x91f3('0x37')],_0x48e729[_0x91f3('0x39')]);_0x1f0fa6[_0x91f3('0x3c')]=_[_0x91f3('0x3b')](_0x48e729[_0x91f3('0x37')],qs['fields'](_0x5209f9[_0x91f3('0x39')]['fields']));_0x1f0fa6['attributes']=_0x1f0fa6[_0x91f3('0x3c')]['length']?_0x1f0fa6['attributes']:_0x48e729[_0x91f3('0x37')];if(_0x5209f9[_0x91f3('0x39')][_0x91f3('0x4c')]){_0x1f0fa6[_0x91f3('0x4a')]=[{'all':!![]}];}_0x1f0fa6=_['merge']({},_0x1f0fa6,_0x5209f9[_0x91f3('0x49')]);return db['Trigger']['find'](_0x1f0fa6)['then'](handleEntityNotFound(_0x542f9a,null))[_0x91f3('0x2a')](respondWithResult(_0x542f9a,null))['catch'](handleError(_0x542f9a,null));};exports['create']=function(_0x281b49,_0x13f2ea){return db[_0x91f3('0x32')][_0x91f3('0x4d')](_0x281b49['body'],{})['then'](function(_0x37eff7){var _0x3e3978=_0x281b49['user']['get']({'plain':!![]});if(!_0x3e3978)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e3978[_0x91f3('0x4e')]===_0x91f3('0x4f')){var _0x2d1c1b=_0x37eff7[_0x91f3('0x50')]({'plain':!![]});var _0x2a4055=_0x91f3('0x2c');return db[_0x91f3('0x51')][_0x91f3('0x52')]({'where':{'name':_0x2a4055,'userProfileId':_0x3e3978['userProfileId']},'raw':!![]})[_0x91f3('0x2a')](function(_0x1ae0d5){if(_0x1ae0d5&&_0x1ae0d5[_0x91f3('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x2d1c1b[_0x91f3('0x38')],'resourceId':_0x2d1c1b['id'],'type':_0x1ae0d5['name'],'sectionId':_0x1ae0d5['id']},{})[_0x91f3('0x2a')](function(){return _0x37eff7;});}else{return _0x37eff7;}})[_0x91f3('0x54')](function(_0xa67176){logger[_0x91f3('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa67176);throw _0xa67176;});}return _0x37eff7;})[_0x91f3('0x2a')](respondWithResult(_0x13f2ea,0xc9))[_0x91f3('0x54')](handleError(_0x13f2ea,null));};exports['update']=function(_0x5ebe6f,_0xe8e1b1){if(_0x5ebe6f[_0x91f3('0x56')]['id']){delete _0x5ebe6f['body']['id'];}return db[_0x91f3('0x32')][_0x91f3('0x52')]({'where':{'id':_0x5ebe6f[_0x91f3('0x57')]['id']}})['then'](handleEntityNotFound(_0xe8e1b1,null))[_0x91f3('0x2a')](saveUpdates(_0x5ebe6f[_0x91f3('0x56')],null))[_0x91f3('0x2a')](respondWithResult(_0xe8e1b1,null))[_0x91f3('0x54')](handleError(_0xe8e1b1,null));};exports[_0x91f3('0x2b')]=function(_0xa10a59,_0x4d3cee){return db[_0x91f3('0x32')]['find']({'where':{'id':_0xa10a59[_0x91f3('0x57')]['id']}})[_0x91f3('0x2a')](handleEntityNotFound(_0x4d3cee,null))[_0x91f3('0x2a')](removeEntity(_0x4d3cee,null))[_0x91f3('0x54')](handleError(_0x4d3cee,null));};exports[_0x91f3('0x58')]=function(_0xe6edcc,_0xb336b8,_0x276752){if(_0xe6edcc[_0x91f3('0x56')]['id']){delete _0xe6edcc[_0x91f3('0x56')]['id'];}return db[_0x91f3('0x32')]['find']({'where':{'id':_0xe6edcc[_0x91f3('0x57')]['id']}})['then'](handleEntityNotFound(_0xb336b8,null))[_0x91f3('0x2a')](function(_0x3c0243){if(_0x3c0243){_0xe6edcc[_0x91f3('0x56')]['TriggerAllId']=_0x3c0243['id'];return db[_0x91f3('0x59')]['create'](_0xe6edcc[_0x91f3('0x56')]);}})[_0x91f3('0x2a')](respondWithResult(_0xb336b8,null))[_0x91f3('0x54')](handleError(_0xb336b8,null));};exports[_0x91f3('0x5a')]=function(_0x1057ae,_0xfcda72,_0x51c440){if(_0x1057ae[_0x91f3('0x56')]['id']){delete _0x1057ae[_0x91f3('0x56')]['id'];}return db[_0x91f3('0x32')][_0x91f3('0x52')]({'where':{'id':_0x1057ae[_0x91f3('0x57')]['id']}})['then'](handleEntityNotFound(_0xfcda72,null))[_0x91f3('0x2a')](function(_0x5e3e23){if(_0x5e3e23){_0x1057ae[_0x91f3('0x56')][_0x91f3('0x5b')]=_0x5e3e23['id'];return db['Condition'][_0x91f3('0x4d')](_0x1057ae['body']);}})[_0x91f3('0x2a')](respondWithResult(_0xfcda72,null))[_0x91f3('0x54')](handleError(_0xfcda72,null));};exports['getAllConditions']=function(_0x5c08ad,_0x3f51c0,_0x53798f){var _0x245bf6={};var _0x3a3c97={};var _0x4c9b9b;var _0x455644;return db['Trigger'][_0x91f3('0x5c')]({'where':{'id':_0x5c08ad[_0x91f3('0x57')]['id']}})[_0x91f3('0x2a')](handleEntityNotFound(_0x3f51c0,null))['then'](function(_0x399851){if(_0x399851){_0x4c9b9b=_0x399851;_0x3a3c97['model']=_[_0x91f3('0x3a')](db['Condition'][_0x91f3('0x33')]);_0x3a3c97[_0x91f3('0x39')]=_[_0x91f3('0x3a')](_0x5c08ad[_0x91f3('0x39')]);_0x3a3c97[_0x91f3('0x43')]=_[_0x91f3('0x3b')](_0x3a3c97[_0x91f3('0x37')],_0x3a3c97[_0x91f3('0x39')]);_0x245bf6[_0x91f3('0x3c')]=_[_0x91f3('0x3b')](_0x3a3c97['model'],qs[_0x91f3('0x3d')](_0x5c08ad[_0x91f3('0x39')][_0x91f3('0x3d')]));_0x245bf6[_0x91f3('0x3c')]=_0x245bf6[_0x91f3('0x3c')][_0x91f3('0x3e')]?_0x245bf6[_0x91f3('0x3c')]:_0x3a3c97[_0x91f3('0x37')];_0x245bf6['order']=qs[_0x91f3('0x42')](_0x5c08ad[_0x91f3('0x39')][_0x91f3('0x42')]);_0x245bf6[_0x91f3('0x46')]=qs[_0x91f3('0x43')](_['pick'](_0x5c08ad['query'],_0x3a3c97['filters']));if(_0x5c08ad[_0x91f3('0x39')][_0x91f3('0x45')]){_0x245bf6[_0x91f3('0x46')]=_[_0x91f3('0x47')](_0x245bf6[_0x91f3('0x46')],{'$or':_[_0x91f3('0x31')](_0x245bf6[_0x91f3('0x3c')],function(_0x4562ea){var _0x3d87ba={};_0x3d87ba[_0x4562ea]={'$like':'%'+_0x5c08ad[_0x91f3('0x39')][_0x91f3('0x45')]+'%'};return _0x3d87ba;})});}_0x245bf6=_[_0x91f3('0x47')]({},_0x245bf6,_0x5c08ad[_0x91f3('0x49')]);return _0x4c9b9b['getAllConditions'](_0x245bf6);}})[_0x91f3('0x2a')](function(_0x3e8ffc){if(_0x3e8ffc){_0x455644=_0x3e8ffc[_0x91f3('0x3e')];if(!_0x5c08ad[_0x91f3('0x39')][_0x91f3('0x3f')](_0x91f3('0x40'))){_0x245bf6['limit']=qs['limit'](_0x5c08ad['query']['limit']);_0x245bf6['offset']=qs[_0x91f3('0x24')](_0x5c08ad[_0x91f3('0x39')][_0x91f3('0x24')]);}return _0x4c9b9b[_0x91f3('0x5d')](_0x245bf6);}})[_0x91f3('0x2a')](function(_0x5d094b){if(_0x5d094b){return _0x5d094b?{'count':_0x455644,'rows':_0x5d094b}:null;}})[_0x91f3('0x2a')](respondWithResult(_0x3f51c0,null))['catch'](handleError(_0x3f51c0,null));};exports[_0x91f3('0x5e')]=function(_0x958097,_0x36751e,_0x2fc49c){var _0x805c4b={};var _0x5abf18={};var _0x3383c5;var _0x3673b3;return db[_0x91f3('0x32')]['findOne']({'where':{'id':_0x958097[_0x91f3('0x57')]['id']}})[_0x91f3('0x2a')](handleEntityNotFound(_0x36751e,null))['then'](function(_0x58c8c1){if(_0x58c8c1){_0x3383c5=_0x58c8c1;_0x5abf18[_0x91f3('0x37')]=_['keys'](db[_0x91f3('0x59')][_0x91f3('0x33')]);_0x5abf18[_0x91f3('0x39')]=_[_0x91f3('0x3a')](_0x958097['query']);_0x5abf18['filters']=_[_0x91f3('0x3b')](_0x5abf18[_0x91f3('0x37')],_0x5abf18[_0x91f3('0x39')]);_0x805c4b[_0x91f3('0x3c')]=_['intersection'](_0x5abf18[_0x91f3('0x37')],qs[_0x91f3('0x3d')](_0x958097[_0x91f3('0x39')]['fields']));_0x805c4b['attributes']=_0x805c4b[_0x91f3('0x3c')][_0x91f3('0x3e')]?_0x805c4b['attributes']:_0x5abf18[_0x91f3('0x37')];_0x805c4b['order']=qs['sort'](_0x958097[_0x91f3('0x39')]['sort']);_0x805c4b[_0x91f3('0x46')]=qs[_0x91f3('0x43')](_[_0x91f3('0x44')](_0x958097[_0x91f3('0x39')],_0x5abf18[_0x91f3('0x43')]));if(_0x958097[_0x91f3('0x39')][_0x91f3('0x45')]){_0x805c4b[_0x91f3('0x46')]=_[_0x91f3('0x47')](_0x805c4b[_0x91f3('0x46')],{'$or':_[_0x91f3('0x31')](_0x805c4b['attributes'],function(_0x51efcf){var _0x23b71e={};_0x23b71e[_0x51efcf]={'$like':'%'+_0x958097['query']['filter']+'%'};return _0x23b71e;})});}_0x805c4b=_[_0x91f3('0x47')]({},_0x805c4b,_0x958097['options']);return _0x3383c5[_0x91f3('0x5e')](_0x805c4b);}})[_0x91f3('0x2a')](function(_0x3eb359){if(_0x3eb359){_0x3673b3=_0x3eb359[_0x91f3('0x3e')];if(!_0x958097[_0x91f3('0x39')][_0x91f3('0x3f')]('nolimit')){_0x805c4b[_0x91f3('0x22')]=qs[_0x91f3('0x22')](_0x958097[_0x91f3('0x39')][_0x91f3('0x22')]);_0x805c4b[_0x91f3('0x24')]=qs[_0x91f3('0x24')](_0x958097[_0x91f3('0x39')]['offset']);}return _0x3383c5[_0x91f3('0x5e')](_0x805c4b);}})[_0x91f3('0x2a')](function(_0xfc4ed0){if(_0xfc4ed0){return _0xfc4ed0?{'count':_0x3673b3,'rows':_0xfc4ed0}:null;}})[_0x91f3('0x2a')](respondWithResult(_0x36751e,null))['catch'](handleError(_0x36751e,null));};exports['addAction']=function(_0x4e5704,_0x1593a4,_0x2b7b4f){if(_0x4e5704[_0x91f3('0x56')]['id']){delete _0x4e5704[_0x91f3('0x56')]['id'];}return db[_0x91f3('0x32')][_0x91f3('0x52')]({'where':{'id':_0x4e5704['params']['id']}})['then'](handleEntityNotFound(_0x1593a4,null))[_0x91f3('0x2a')](function(_0x253067){if(_0x253067){_0x4e5704[_0x91f3('0x56')][_0x91f3('0x5f')]=_0x253067['id'];return db['Action'][_0x91f3('0x4d')](_0x4e5704[_0x91f3('0x56')]);}})[_0x91f3('0x2a')](respondWithResult(_0x1593a4,null))['catch'](handleError(_0x1593a4,null));};exports[_0x91f3('0x60')]=function(_0x23805f,_0x1f3945,_0x5c158e){var _0x5264db={};var _0x557508={};var _0x40c22a;var _0x178600;return db[_0x91f3('0x32')][_0x91f3('0x5c')]({'where':{'id':_0x23805f[_0x91f3('0x57')]['id']}})[_0x91f3('0x2a')](handleEntityNotFound(_0x1f3945,null))[_0x91f3('0x2a')](function(_0x29da92){if(_0x29da92){_0x40c22a=_0x29da92;_0x557508[_0x91f3('0x37')]=_[_0x91f3('0x3a')](db[_0x91f3('0x61')]['rawAttributes']);_0x557508['query']=_['keys'](_0x23805f[_0x91f3('0x39')]);_0x557508[_0x91f3('0x43')]=_[_0x91f3('0x3b')](_0x557508[_0x91f3('0x37')],_0x557508[_0x91f3('0x39')]);_0x5264db[_0x91f3('0x3c')]=_['intersection'](_0x557508[_0x91f3('0x37')],qs['fields'](_0x23805f['query'][_0x91f3('0x3d')]));_0x5264db[_0x91f3('0x3c')]=_0x5264db[_0x91f3('0x3c')][_0x91f3('0x3e')]?_0x5264db[_0x91f3('0x3c')]:_0x557508[_0x91f3('0x37')];_0x5264db[_0x91f3('0x41')]=qs[_0x91f3('0x42')](_0x23805f[_0x91f3('0x39')]['sort']);_0x5264db[_0x91f3('0x46')]=qs['filters'](_[_0x91f3('0x44')](_0x23805f[_0x91f3('0x39')],_0x557508['filters']));if(_0x23805f[_0x91f3('0x39')][_0x91f3('0x45')]){_0x5264db[_0x91f3('0x46')]=_[_0x91f3('0x47')](_0x5264db[_0x91f3('0x46')],{'$or':_[_0x91f3('0x31')](_0x5264db[_0x91f3('0x3c')],function(_0x11fdc1){var _0x5dde03={};_0x5dde03[_0x11fdc1]={'$like':'%'+_0x23805f[_0x91f3('0x39')][_0x91f3('0x45')]+'%'};return _0x5dde03;})});}_0x5264db=_[_0x91f3('0x47')]({},_0x5264db,_0x23805f[_0x91f3('0x49')]);return _0x40c22a['getActions'](_0x5264db);}})[_0x91f3('0x2a')](function(_0x442996){if(_0x442996){_0x178600=_0x442996[_0x91f3('0x3e')];if(!_0x23805f[_0x91f3('0x39')][_0x91f3('0x3f')](_0x91f3('0x40'))){_0x5264db['limit']=qs[_0x91f3('0x22')](_0x23805f[_0x91f3('0x39')][_0x91f3('0x22')]);_0x5264db[_0x91f3('0x24')]=qs['offset'](_0x23805f[_0x91f3('0x39')][_0x91f3('0x24')]);}return _0x40c22a[_0x91f3('0x60')](_0x5264db);}})[_0x91f3('0x2a')](function(_0x2297a1){if(_0x2297a1){return _0x2297a1?{'count':_0x178600,'rows':_0x2297a1}:null;}})['then'](respondWithResult(_0x1f3945,null))[_0x91f3('0x54')](handleError(_0x1f3945,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index b132de2..143f707 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 _0x4c4e=['moment','request-promise','path','rimraf','./trigger.attributes','define','Trigger','tools_triggers','lodash','../../config/logger','api'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x4c4e,0x152));var _0xe4c4=function(_0x4578c3,_0xc5c714){_0x4578c3=_0x4578c3-0x0;var _0x43f5a3=_0x4c4e[_0x4578c3];return _0x43f5a3;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var logger=require(_0xe4c4('0x1'))(_0xe4c4('0x2'));var moment=require(_0xe4c4('0x3'));var BPromise=require('bluebird');var rp=require(_0xe4c4('0x4'));var fs=require('fs');var path=require(_0xe4c4('0x5'));var rimraf=require(_0xe4c4('0x6'));var config=require('../../config/environment');var attributes=require(_0xe4c4('0x7'));module['exports']=function(_0x177732,_0x1a12a6){return _0x177732[_0xe4c4('0x8')](_0xe4c4('0x9'),attributes,{'tableName':_0xe4c4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe181=['bluebird','request-promise','path','rimraf','./trigger.attributes','define','Trigger','tools_triggers','lodash','../../config/logger','api','moment'];(function(_0x280820,_0xce9bc7){var _0x474787=function(_0x3d224e){while(--_0x3d224e){_0x280820['push'](_0x280820['shift']());}};_0x474787(++_0xce9bc7);}(_0xe181,0x68));var _0x1e18=function(_0x5a0bab,_0x168def){_0x5a0bab=_0x5a0bab-0x0;var _0x32b15a=_0xe181[_0x5a0bab];return _0x32b15a;};'use strict';var _=require(_0x1e18('0x0'));var util=require('util');var logger=require(_0x1e18('0x1'))(_0x1e18('0x2'));var moment=require(_0x1e18('0x3'));var BPromise=require(_0x1e18('0x4'));var rp=require(_0x1e18('0x5'));var fs=require('fs');var path=require(_0x1e18('0x6'));var rimraf=require(_0x1e18('0x7'));var config=require('../../config/environment');var attributes=require(_0x1e18('0x8'));module['exports']=function(_0x512343,_0x18fabb){return _0x512343[_0x1e18('0x9')](_0x1e18('0xa'),attributes,{'tableName':_0x1e18('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index f6bbef4..1cbc71a 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 _0x8a95=['include','model','then','find','ShowTrigger','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','Trigger,\x20%s,\x20%s','message','info','request\x20sent','result','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','map'];(function(_0x198d2a,_0x510eb7){var _0xfda34d=function(_0x581078){while(--_0x581078){_0x198d2a['push'](_0x198d2a['shift']());}};_0xfda34d(++_0x510eb7);}(_0x8a95,0xe3));var _0x58a9=function(_0x2bb359,_0x57a52e){_0x2bb359=_0x2bb359-0x0;var _0xec8647=_0x8a95[_0x2bb359];return _0xec8647;};'use strict';var _=require('lodash');var util=require(_0x58a9('0x0'));var moment=require(_0x58a9('0x1'));var BPromise=require(_0x58a9('0x2'));var rs=require(_0x58a9('0x3'));var fs=require('fs');var Redis=require(_0x58a9('0x4'));var db=require(_0x58a9('0x5'))['db'];var utils=require(_0x58a9('0x6'));var logger=require(_0x58a9('0x7'))(_0x58a9('0x8'));var config=require(_0x58a9('0x9'));var jayson=require(_0x58a9('0xa'));var client=jayson[_0x58a9('0xb')][_0x58a9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5d088a,_0x337ffb,_0x2a03b3){return new BPromise(function(_0x4d38df,_0x50d909){return client['request'](_0x5d088a,_0x2a03b3)['then'](function(_0x30fad4){logger['info']('Trigger,\x20%s,\x20%s',_0x337ffb,'request\x20sent');logger[_0x58a9('0xd')](_0x58a9('0xe'),_0x337ffb,'request\x20sent',JSON[_0x58a9('0xf')](_0x30fad4));if(_0x30fad4[_0x58a9('0x10')]){if(_0x30fad4[_0x58a9('0x10')]['code']===0x1f4){logger[_0x58a9('0x10')](_0x58a9('0x11'),_0x337ffb,_0x30fad4['error'][_0x58a9('0x12')]);return _0x50d909(_0x30fad4[_0x58a9('0x10')][_0x58a9('0x12')]);}logger['error'](_0x58a9('0x11'),_0x337ffb,_0x30fad4[_0x58a9('0x10')][_0x58a9('0x12')]);return _0x4d38df(_0x30fad4[_0x58a9('0x10')][_0x58a9('0x12')]);}else{logger[_0x58a9('0x13')](_0x58a9('0x11'),_0x337ffb,_0x58a9('0x14'));_0x4d38df(_0x30fad4[_0x58a9('0x15')][_0x58a9('0x12')]);}})[_0x58a9('0x16')](function(_0x219890){logger[_0x58a9('0x10')]('Trigger,\x20%s,\x20%s',_0x337ffb,_0x219890);_0x50d909(_0x219890);});});}exports[_0x58a9('0x17')]=function(_0x14c38){var _0x4c62e0=this;return new Promise(function(_0x5dbf0c,_0x3e146a){return db[_0x58a9('0x18')][_0x58a9('0x19')]({'raw':_0x14c38[_0x58a9('0x1a')]?_0x14c38[_0x58a9('0x1a')][_0x58a9('0x1b')]===undefined?!![]:![]:!![],'where':_0x14c38[_0x58a9('0x1a')]?_0x14c38[_0x58a9('0x1a')][_0x58a9('0x1c')]||null:null,'attributes':_0x14c38[_0x58a9('0x1a')]?_0x14c38[_0x58a9('0x1a')][_0x58a9('0x1d')]||null:null,'limit':_0x14c38['options']?_0x14c38[_0x58a9('0x1a')][_0x58a9('0x1e')]||null:null,'include':_0x14c38['options']?_0x14c38[_0x58a9('0x1a')]['include']?_[_0x58a9('0x1f')](_0x14c38[_0x58a9('0x1a')]['include'],function(_0x4ae487){return{'model':db[_0x4ae487['model']],'as':_0x4ae487['as'],'attributes':_0x4ae487[_0x58a9('0x1d')],'include':_0x4ae487[_0x58a9('0x20')]?_[_0x58a9('0x1f')](_0x4ae487[_0x58a9('0x20')],function(_0xf174de){return{'model':db[_0xf174de[_0x58a9('0x21')]],'as':_0xf174de['as'],'attributes':_0xf174de['attributes'],'include':_0xf174de[_0x58a9('0x20')]?_[_0x58a9('0x1f')](_0xf174de[_0x58a9('0x20')],function(_0x1f39ab){return{'model':db[_0x1f39ab[_0x58a9('0x21')]],'as':_0x1f39ab['as'],'attributes':_0x1f39ab[_0x58a9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x58a9('0x22')](function(_0x210008){logger['info'](_0x58a9('0x17'),_0x14c38);logger[_0x58a9('0xd')](_0x58a9('0x17'),_0x14c38,JSON[_0x58a9('0xf')](_0x210008));_0x5dbf0c(_0x210008);})[_0x58a9('0x16')](function(_0x158789){logger[_0x58a9('0x10')](_0x58a9('0x17'),_0x158789['message'],_0x14c38);_0x3e146a(_0x4c62e0[_0x58a9('0x10')](0x1f4,_0x158789[_0x58a9('0x12')]));});});};exports['ShowTrigger']=function(_0x43d3c0){var _0x2fcf82=this;return new Promise(function(_0x289b24,_0x4e09af){return db['Trigger'][_0x58a9('0x23')]({'raw':_0x43d3c0[_0x58a9('0x1a')]?_0x43d3c0['options'][_0x58a9('0x1b')]===undefined?!![]:![]:!![],'where':_0x43d3c0[_0x58a9('0x1a')]?_0x43d3c0[_0x58a9('0x1a')][_0x58a9('0x1c')]||null:null,'attributes':_0x43d3c0['options']?_0x43d3c0[_0x58a9('0x1a')][_0x58a9('0x1d')]||null:null,'include':_0x43d3c0['options']?_0x43d3c0[_0x58a9('0x1a')][_0x58a9('0x20')]?_[_0x58a9('0x1f')](_0x43d3c0[_0x58a9('0x1a')][_0x58a9('0x20')],function(_0x155e3d){return{'model':db[_0x155e3d[_0x58a9('0x21')]],'as':_0x155e3d['as'],'attributes':_0x155e3d[_0x58a9('0x1d')],'include':_0x155e3d[_0x58a9('0x20')]?_[_0x58a9('0x1f')](_0x155e3d[_0x58a9('0x20')],function(_0x58fe67){return{'model':db[_0x58fe67[_0x58a9('0x21')]],'as':_0x58fe67['as'],'attributes':_0x58fe67[_0x58a9('0x1d')],'include':_0x58fe67[_0x58a9('0x20')]?_[_0x58a9('0x1f')](_0x58fe67[_0x58a9('0x20')],function(_0x5ab915){return{'model':db[_0x5ab915[_0x58a9('0x21')]],'as':_0x5ab915['as'],'attributes':_0x5ab915['attributes']};}):[]};}):[]};}):[]:[]})[_0x58a9('0x22')](function(_0x1395a7){logger[_0x58a9('0x13')](_0x58a9('0x24'),_0x43d3c0);logger['debug']('ShowTrigger',_0x43d3c0,JSON[_0x58a9('0xf')](_0x1395a7));_0x289b24(_0x1395a7);})[_0x58a9('0x16')](function(_0x2c5db7){logger[_0x58a9('0x10')](_0x58a9('0x24'),_0x2c5db7['message'],_0x43d3c0);_0x4e09af(_0x2fcf82[_0x58a9('0x10')](0x1f4,_0x2c5db7[_0x58a9('0x12')]));});});}; \ No newline at end of file +var _0x270e=['ioredis','../../mysqldb','../../config/logger','../../config/environment','http','request','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','Trigger,\x20%s,\x20%s','result','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowTrigger','lodash','util','bluebird','randomstring'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x270e,0x194));var _0xe270=function(_0xa3d957,_0x5cefc3){_0xa3d957=_0xa3d957-0x0;var _0x1f2f67=_0x270e[_0xa3d957];return _0x1f2f67;};'use strict';var _=require(_0xe270('0x0'));var util=require(_0xe270('0x1'));var moment=require('moment');var BPromise=require(_0xe270('0x2'));var rs=require(_0xe270('0x3'));var fs=require('fs');var Redis=require(_0xe270('0x4'));var db=require(_0xe270('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe270('0x6'))('rpc');var config=require(_0xe270('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe270('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa1eac1,_0x6784df,_0x435889){return new BPromise(function(_0xbffed3,_0x1009c2){return client[_0xe270('0x9')](_0xa1eac1,_0x435889)[_0xe270('0xa')](function(_0x5cd235){logger[_0xe270('0xb')]('Trigger,\x20%s,\x20%s',_0x6784df,_0xe270('0xc'));logger[_0xe270('0xd')](_0xe270('0xe'),_0x6784df,_0xe270('0xc'),JSON[_0xe270('0xf')](_0x5cd235));if(_0x5cd235[_0xe270('0x10')]){if(_0x5cd235[_0xe270('0x10')]['code']===0x1f4){logger[_0xe270('0x10')]('Trigger,\x20%s,\x20%s',_0x6784df,_0x5cd235[_0xe270('0x10')][_0xe270('0x11')]);return _0x1009c2(_0x5cd235['error'][_0xe270('0x11')]);}logger[_0xe270('0x10')](_0xe270('0x12'),_0x6784df,_0x5cd235['error'][_0xe270('0x11')]);return _0xbffed3(_0x5cd235[_0xe270('0x10')][_0xe270('0x11')]);}else{logger[_0xe270('0xb')](_0xe270('0x12'),_0x6784df,_0xe270('0xc'));_0xbffed3(_0x5cd235[_0xe270('0x13')][_0xe270('0x11')]);}})[_0xe270('0x14')](function(_0x457846){logger[_0xe270('0x10')]('Trigger,\x20%s,\x20%s',_0x6784df,_0x457846);_0x1009c2(_0x457846);});});}exports[_0xe270('0x15')]=function(_0x17913e){var _0x3a2da0=this;return new Promise(function(_0x35977e,_0x4382f5){return db[_0xe270('0x16')][_0xe270('0x17')]({'raw':_0x17913e[_0xe270('0x18')]?_0x17913e['options'][_0xe270('0x19')]===undefined?!![]:![]:!![],'where':_0x17913e[_0xe270('0x18')]?_0x17913e[_0xe270('0x18')][_0xe270('0x1a')]||null:null,'attributes':_0x17913e[_0xe270('0x18')]?_0x17913e[_0xe270('0x18')][_0xe270('0x1b')]||null:null,'limit':_0x17913e['options']?_0x17913e[_0xe270('0x18')][_0xe270('0x1c')]||null:null,'include':_0x17913e['options']?_0x17913e['options'][_0xe270('0x1d')]?_[_0xe270('0x1e')](_0x17913e['options'][_0xe270('0x1d')],function(_0x18da02){return{'model':db[_0x18da02[_0xe270('0x1f')]],'as':_0x18da02['as'],'attributes':_0x18da02[_0xe270('0x1b')],'include':_0x18da02[_0xe270('0x1d')]?_['map'](_0x18da02[_0xe270('0x1d')],function(_0x3ecd95){return{'model':db[_0x3ecd95[_0xe270('0x1f')]],'as':_0x3ecd95['as'],'attributes':_0x3ecd95[_0xe270('0x1b')],'include':_0x3ecd95[_0xe270('0x1d')]?_[_0xe270('0x1e')](_0x3ecd95[_0xe270('0x1d')],function(_0x481573){return{'model':db[_0x481573[_0xe270('0x1f')]],'as':_0x481573['as'],'attributes':_0x481573[_0xe270('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1bcdec){logger[_0xe270('0xb')]('GetTrigger',_0x17913e);logger[_0xe270('0xd')](_0xe270('0x15'),_0x17913e,JSON['stringify'](_0x1bcdec));_0x35977e(_0x1bcdec);})[_0xe270('0x14')](function(_0x13ec32){logger['error'](_0xe270('0x15'),_0x13ec32['message'],_0x17913e);_0x4382f5(_0x3a2da0[_0xe270('0x10')](0x1f4,_0x13ec32[_0xe270('0x11')]));});});};exports['ShowTrigger']=function(_0x455856){var _0x1c8333=this;return new Promise(function(_0x593c76,_0x34ac27){return db[_0xe270('0x16')][_0xe270('0x20')]({'raw':_0x455856['options']?_0x455856[_0xe270('0x18')][_0xe270('0x19')]===undefined?!![]:![]:!![],'where':_0x455856[_0xe270('0x18')]?_0x455856[_0xe270('0x18')][_0xe270('0x1a')]||null:null,'attributes':_0x455856['options']?_0x455856[_0xe270('0x18')][_0xe270('0x1b')]||null:null,'include':_0x455856[_0xe270('0x18')]?_0x455856[_0xe270('0x18')][_0xe270('0x1d')]?_[_0xe270('0x1e')](_0x455856[_0xe270('0x18')][_0xe270('0x1d')],function(_0x54d793){return{'model':db[_0x54d793[_0xe270('0x1f')]],'as':_0x54d793['as'],'attributes':_0x54d793['attributes'],'include':_0x54d793[_0xe270('0x1d')]?_[_0xe270('0x1e')](_0x54d793[_0xe270('0x1d')],function(_0x14a734){return{'model':db[_0x14a734[_0xe270('0x1f')]],'as':_0x14a734['as'],'attributes':_0x14a734['attributes'],'include':_0x14a734[_0xe270('0x1d')]?_[_0xe270('0x1e')](_0x14a734['include'],function(_0x2e3af2){return{'model':db[_0x2e3af2[_0xe270('0x1f')]],'as':_0x2e3af2['as'],'attributes':_0x2e3af2[_0xe270('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe270('0xa')](function(_0x4a21cd){logger['info'](_0xe270('0x21'),_0x455856);logger[_0xe270('0xd')]('ShowTrigger',_0x455856,JSON['stringify'](_0x4a21cd));_0x593c76(_0x4a21cd);})[_0xe270('0x14')](function(_0x405ff9){logger[_0xe270('0x10')]('ShowTrigger',_0x405ff9[_0xe270('0x11')],_0x455856);_0x34ac27(_0x1c8333[_0xe270('0x10')](0x1f4,_0x405ff9['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 602ba43..1214b58 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 _0x34dc=['express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','show','post','/:id/clone','create','/:id','update','destroy','exports','multer','connect-timeout'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x34dc,0xae));var _0xc34d=function(_0x314648,_0x17e629){_0x314648=_0x314648-0x0;var _0x3e654f=_0x34dc[_0x314648];return _0x3e654f;};'use strict';var multer=require(_0xc34d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc34d('0x1'));var express=require(_0xc34d('0x2'));var router=express['Router']();var fs_extra=require(_0xc34d('0x3'));var auth=require(_0xc34d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc34d('0x5'));var controller=require('./trunk.controller');router[_0xc34d('0x6')]('/',auth[_0xc34d('0x7')](),controller['index']);router['get']('/:id',auth[_0xc34d('0x7')](),controller[_0xc34d('0x8')]);router[_0xc34d('0x9')](_0xc34d('0xa'),auth[_0xc34d('0x7')](),controller['clone']);router[_0xc34d('0x9')]('/',auth['isAuthenticated'](),controller[_0xc34d('0xb')]);router['put'](_0xc34d('0xc'),auth[_0xc34d('0x7')](),controller[_0xc34d('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc34d('0xe')]);module[_0xc34d('0xf')]=router; \ No newline at end of file +var _0x43aa=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./trunk.controller','index','get','/:id','isAuthenticated','post','/:id/clone','clone','put','update','delete','destroy','exports','multer'];(function(_0x47c8f1,_0x3534cb){var _0x1deb50=function(_0x512cf7){while(--_0x512cf7){_0x47c8f1['push'](_0x47c8f1['shift']());}};_0x1deb50(++_0x3534cb);}(_0x43aa,0xfb));var _0xa43a=function(_0x13a591,_0xd6367c){_0x13a591=_0x13a591-0x0;var _0x1592f0=_0x43aa[_0x13a591];return _0x1592f0;};'use strict';var multer=require(_0xa43a('0x0'));var util=require(_0xa43a('0x1'));var path=require(_0xa43a('0x2'));var timeout=require(_0xa43a('0x3'));var express=require(_0xa43a('0x4'));var router=express[_0xa43a('0x5')]();var fs_extra=require(_0xa43a('0x6'));var auth=require(_0xa43a('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa43a('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xa43a('0x9')]);router[_0xa43a('0xa')](_0xa43a('0xb'),auth[_0xa43a('0xc')](),controller['show']);router[_0xa43a('0xd')](_0xa43a('0xe'),auth[_0xa43a('0xc')](),controller[_0xa43a('0xf')]);router[_0xa43a('0xd')]('/',auth[_0xa43a('0xc')](),controller['create']);router[_0xa43a('0x10')]('/:id',auth[_0xa43a('0xc')](),controller[_0xa43a('0x11')]);router[_0xa43a('0x12')](_0xa43a('0xb'),auth[_0xa43a('0xc')](),controller[_0xa43a('0x13')]);module[_0xa43a('0x14')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 50ab7b4..2f8dca8 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 _0xb1d3=['pai','fingerprint','certificate','passive','dynamic','nonat','update,nonat','BOOLEAN','sequelize','exports','ENUM','friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','STRING','udp','transport','getDataValue','split','rfc2833','shortinfo','inband','update','outgoing','yes','force_rport,comedia','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','join','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','INTEGER','always','originate','uac','uas'];(function(_0x7c9fba,_0x10b015){var _0x5cceed=function(_0x4ae29a){while(--_0x4ae29a){_0x7c9fba['push'](_0x7c9fba['shift']());}};_0x5cceed(++_0x10b015);}(_0xb1d3,0x6c));var _0x3b1d=function(_0x532519,_0x360f22){_0x532519=_0x532519-0x0;var _0x2b3796=_0xb1d3[_0x532519];return _0x2b3796;};'use strict';var Sequelize=require(_0x3b1d('0x0'));module[_0x3b1d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x3b1d('0x2')](_0x3b1d('0x3'),_0x3b1d('0x4'),_0x3b1d('0x5')),'allowNull':![],'defaultValue':_0x3b1d('0x3')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x3b1d('0x2')](_0x3b1d('0x6'),_0x3b1d('0x7'),_0x3b1d('0x8'),_0x3b1d('0x9'),_0x3b1d('0xa'),_0x3b1d('0xb'),'PROHIB_FAILED_SCREEN',_0x3b1d('0xc'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x3b1d('0xd')]},'secret':{'type':Sequelize[_0x3b1d('0xd')]},'md5secret':{'type':Sequelize[_0x3b1d('0xd')]},'remotesecret':{'type':Sequelize[_0x3b1d('0xd')]},'transport':{'type':Sequelize[_0x3b1d('0xd')],'defaultValue':_0x3b1d('0xe'),'set':function(_0x473d20){this['setDataValue'](_0x3b1d('0xf'),_0x473d20?_0x473d20['join'](','):null);},'get':function(){return this[_0x3b1d('0x10')](_0x3b1d('0xf'))?this['getDataValue'](_0x3b1d('0xf'))[_0x3b1d('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x3b1d('0x2')](_0x3b1d('0x12'),'info',_0x3b1d('0x13'),_0x3b1d('0x14'),'auto'),'defaultValue':_0x3b1d('0x12')},'directmedia':{'type':Sequelize[_0x3b1d('0x2')]('yes','no','nonat',_0x3b1d('0x15'),_0x3b1d('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x3b1d('0x2')](_0x3b1d('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x3b1d('0xd')]},'directmediadeny':{'type':Sequelize[_0x3b1d('0xd')]},'nat':{'type':Sequelize[_0x3b1d('0xd')],'defaultValue':_0x3b1d('0x18'),'set':function(_0x5a9cae){this[_0x3b1d('0x19')](_0x3b1d('0x1a'),_0x5a9cae?_0x5a9cae['join'](','):null);},'get':function(){return this[_0x3b1d('0x10')](_0x3b1d('0x1a'))?this['getDataValue'](_0x3b1d('0x1a'))[_0x3b1d('0x11')](','):null;},'comment':_0x3b1d('0x1b')},'callgroup':{'type':Sequelize[_0x3b1d('0xd')]},'namedcallgroup':{'type':Sequelize[_0x3b1d('0xd')]},'pickupgroup':{'type':Sequelize[_0x3b1d('0xd')]},'namedpickupgroup':{'type':Sequelize[_0x3b1d('0xd')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x3b1d('0xd')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x3b1d('0xd')],'defaultValue':_0x3b1d('0x1c')},'allow':{'type':Sequelize[_0x3b1d('0xd')],'allowNull':![],'defaultValue':_0x3b1d('0x1d'),'set':function(_0x585b74){this[_0x3b1d('0x19')](_0x3b1d('0x1e'),_0x585b74?_0x585b74[_0x3b1d('0x1f')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x3b1d('0x10')](_0x3b1d('0x1e'))?this[_0x3b1d('0x10')]('allow')[_0x3b1d('0x11')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x3b1d('0x2')]('yes','no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x3b1d('0x20'),'set':function(_0x58639f){this[_0x3b1d('0x19')](_0x3b1d('0x21'),_0x58639f?_0x58639f['join'](','):null);},'get':function(){return this[_0x3b1d('0x10')](_0x3b1d('0x21'))?this['getDataValue'](_0x3b1d('0x21'))[_0x3b1d('0x11')](','):null;},'comment':_0x3b1d('0x22')},'trustrpid':{'type':Sequelize[_0x3b1d('0x2')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x3b1d('0x2')](_0x3b1d('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x3b1d('0x23'))},'promiscredir':{'type':Sequelize[_0x3b1d('0x2')](_0x3b1d('0x17'),'no')},'useclientcode':{'type':Sequelize[_0x3b1d('0x2')]('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x3b1d('0xd')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x3b1d('0x24')},'amaflags':{'type':Sequelize[_0x3b1d('0xd')]},'callcounter':{'type':Sequelize[_0x3b1d('0x2')]('yes','no'),'defaultValue':_0x3b1d('0x17')},'busylevel':{'type':Sequelize[_0x3b1d('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0x3b1d('0x2')](_0x3b1d('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x3b1d('0x2')](_0x3b1d('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0x3b1d('0x2')]('yes','no')},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x3b1d('0xd')]},'videosupport':{'type':Sequelize[_0x3b1d('0x2')](_0x3b1d('0x17'),'no',_0x3b1d('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x3b1d('0x2')](_0x3b1d('0x17'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x3b1d('0x2')]('accept','refuse',_0x3b1d('0x27'))},'session_expires':{'type':Sequelize[_0x3b1d('0x25')](0xb)},'session_minse':{'type':Sequelize[_0x3b1d('0x25')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x3b1d('0x28'),'uas'),'defaultValue':_0x3b1d('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0x3b1d('0xd')]},'regexten':{'type':Sequelize[_0x3b1d('0xd')]},'fromdomain':{'type':Sequelize[_0x3b1d('0xd')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x3b1d('0x2')]('yes','no'),'defaultValue':_0x3b1d('0x17')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x3b1d('0xd')]},'rtptimeout':{'type':Sequelize[_0x3b1d('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x3b1d('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x3b1d('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x3b1d('0x2')]('yes','no',_0x3b1d('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x3b1d('0xd')]},'callbackextension':{'type':Sequelize[_0x3b1d('0xd')]},'timert1':{'type':Sequelize[_0x3b1d('0x25')](0xb)},'timerb':{'type':Sequelize[_0x3b1d('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0x3b1d('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0x3b1d('0xd')]},'contactdeny':{'type':Sequelize[_0x3b1d('0xd')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x3b1d('0xd')]},'use_q850_reason':{'type':Sequelize[_0x3b1d('0xd')]},'maxforwards':{'type':Sequelize[_0x3b1d('0x25')](0xb)},'encryption':{'type':Sequelize[_0x3b1d('0x2')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x3b1d('0x2')](_0x3b1d('0x17'),'no')},'force_avp':{'type':Sequelize[_0x3b1d('0x2')](_0x3b1d('0x17'),'no')},'icesupport':{'type':Sequelize[_0x3b1d('0x2')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x3b1d('0x2')](_0x3b1d('0x17'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x3b1d('0x17'),'no',_0x3b1d('0x2b'),_0x3b1d('0x2c'))},'dtlsrekey':{'type':Sequelize[_0x3b1d('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0x3b1d('0xd')]},'dtlsprivatekey':{'type':Sequelize[_0x3b1d('0xd')]},'dtlscipher':{'type':Sequelize[_0x3b1d('0xd')]},'dtlscafile':{'type':Sequelize[_0x3b1d('0xd')]},'dtlscapath':{'type':Sequelize[_0x3b1d('0xd')]},'dtlssetup':{'type':Sequelize[_0x3b1d('0x2')]('active',_0x3b1d('0x2d'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x3b1d('0xd')]},'usereqphone':{'type':Sequelize['ENUM'](_0x3b1d('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x3b1d('0xd')]},'recordofffeature':{'type':Sequelize[_0x3b1d('0xd')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x3b1d('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0x3b1d('0x2')]('yes','no')},'vmexten':{'type':Sequelize[_0x3b1d('0xd')]},'mohinterpret':{'type':Sequelize[_0x3b1d('0xd')]},'mohsuggest':{'type':Sequelize[_0x3b1d('0xd')]},'parkinglot':{'type':Sequelize[_0x3b1d('0xd')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':_0x3b1d('0x2e')},'canreinvite':{'type':Sequelize[_0x3b1d('0x2')](_0x3b1d('0x17'),'no',_0x3b1d('0x2f'),'update',_0x3b1d('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x3b1d('0xd')]},'otherFields':{'type':Sequelize[_0x3b1d('0xd')]},'active':{'type':Sequelize[_0x3b1d('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x3b1d('0xd')],'defaultValue':'no'}}; \ No newline at end of file +var _0xaeba=['never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai','certificate','active','passive','actpass','dynamic','update','update,nonat','sequelize','exports','STRING','name','ENUM','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','setDataValue','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','yes','nonat','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'];(function(_0x1ac7f8,_0x17d8d8){var _0x11c7ac=function(_0x186bb9){while(--_0x186bb9){_0x1ac7f8['push'](_0x1ac7f8['shift']());}};_0x11c7ac(++_0x17d8d8);}(_0xaeba,0xdd));var _0xaaeb=function(_0x4ead9b,_0x5cffd0){_0x4ead9b=_0x4ead9b-0x0;var _0x36f7f6=_0xaeba[_0x4ead9b];return _0x36f7f6;};'use strict';var Sequelize=require(_0xaaeb('0x0'));module[_0xaaeb('0x1')]={'name':{'type':Sequelize[_0xaaeb('0x2')],'allowNull':![],'unique':_0xaaeb('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xaaeb('0x4')]('friend',_0xaaeb('0x5'),_0xaaeb('0x6')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xaaeb('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0xaaeb('0x4')](_0xaaeb('0x7'),_0xaaeb('0x8'),_0xaaeb('0x9'),'ALLOWED',_0xaaeb('0xa'),'PROHIB_PASSED_SCREEN',_0xaaeb('0xb'),'PROHIB')},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xaaeb('0x2')]},'md5secret':{'type':Sequelize[_0xaaeb('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xaaeb('0x2')],'defaultValue':'udp','set':function(_0x2a7900){this[_0xaaeb('0xc')]('transport',_0x2a7900?_0x2a7900[_0xaaeb('0xd')](','):null);},'get':function(){return this[_0xaaeb('0xe')]('transport')?this[_0xaaeb('0xe')](_0xaaeb('0xf'))[_0xaaeb('0x10')](','):null;},'comment':_0xaaeb('0x11')},'dtmfmode':{'type':Sequelize['ENUM'](_0xaaeb('0x12'),_0xaaeb('0x13'),_0xaaeb('0x14'),'inband','auto'),'defaultValue':_0xaaeb('0x12')},'directmedia':{'type':Sequelize[_0xaaeb('0x4')](_0xaaeb('0x15'),'no',_0xaaeb('0x16'),'update',_0xaaeb('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xaaeb('0x4')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xaaeb('0x2')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xaaeb('0x2')],'defaultValue':_0xaaeb('0x18'),'set':function(_0xb8707d){this[_0xaaeb('0xc')](_0xaaeb('0x19'),_0xb8707d?_0xb8707d[_0xaaeb('0xd')](','):null);},'get':function(){return this['getDataValue'](_0xaaeb('0x19'))?this[_0xaaeb('0xe')](_0xaaeb('0x19'))[_0xaaeb('0x10')](','):null;},'comment':_0xaaeb('0x1a')},'callgroup':{'type':Sequelize[_0xaaeb('0x2')]},'namedcallgroup':{'type':Sequelize[_0xaaeb('0x2')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xaaeb('0x2')]},'language':{'type':Sequelize[_0xaaeb('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xaaeb('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xaaeb('0x2')],'defaultValue':_0xaaeb('0x1b')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xaaeb('0x1c'),'set':function(_0x59b31e){this[_0xaaeb('0xc')](_0xaaeb('0x1d'),_0x59b31e?_0x59b31e[_0xaaeb('0xd')](';'):_0xaaeb('0x1c'));},'get':function(){return this[_0xaaeb('0xe')](_0xaaeb('0x1d'))?this[_0xaaeb('0xe')](_0xaaeb('0x1d'))['split'](';'):null;},'comment':_0xaaeb('0x1e')},'autoframing':{'type':Sequelize[_0xaaeb('0x4')](_0xaaeb('0x15'),'no')},'insecure':{'type':Sequelize[_0xaaeb('0x2')],'defaultValue':_0xaaeb('0x1f'),'set':function(_0xeeb40f){this['setDataValue'](_0xaaeb('0x20'),_0xeeb40f?_0xeeb40f[_0xaaeb('0xd')](','):null);},'get':function(){return this[_0xaaeb('0xe')](_0xaaeb('0x20'))?this[_0xaaeb('0xe')](_0xaaeb('0x20'))[_0xaaeb('0x10')](','):null;},'comment':_0xaaeb('0x21')},'trustrpid':{'type':Sequelize[_0xaaeb('0x4')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xaaeb('0x4')](_0xaaeb('0x15'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0xaaeb('0x22'))},'promiscredir':{'type':Sequelize[_0xaaeb('0x4')](_0xaaeb('0x15'),'no')},'useclientcode':{'type':Sequelize[_0xaaeb('0x4')](_0xaaeb('0x15'),'no')},'accountcode':{'type':Sequelize[_0xaaeb('0x23')](0xb)},'setvar':{'type':Sequelize[_0xaaeb('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xaaeb('0x24')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xaaeb('0x4')]('yes','no'),'defaultValue':_0xaaeb('0x15')},'busylevel':{'type':Sequelize[_0xaaeb('0x23')](0xb)},'allowoverlap':{'type':Sequelize[_0xaaeb('0x4')](_0xaaeb('0x15'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize[_0xaaeb('0x4')](_0xaaeb('0x15'),'no')},'ignoresdpversion':{'type':Sequelize[_0xaaeb('0x4')](_0xaaeb('0x15'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0xaaeb('0x2')]},'videosupport':{'type':Sequelize['ENUM'](_0xaaeb('0x15'),'no',_0xaaeb('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xaaeb('0x4')](_0xaaeb('0x15'),'no')},'mailbox':{'type':Sequelize[_0xaaeb('0x2')]},'session_timers':{'type':Sequelize[_0xaaeb('0x4')](_0xaaeb('0x26'),_0xaaeb('0x27'),_0xaaeb('0x28'))},'session_expires':{'type':Sequelize[_0xaaeb('0x23')](0xb)},'session_minse':{'type':Sequelize[_0xaaeb('0x23')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xaaeb('0x29'),'uas'),'defaultValue':_0xaaeb('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0xaaeb('0x2')]},'regexten':{'type':Sequelize[_0xaaeb('0x2')]},'fromdomain':{'type':Sequelize[_0xaaeb('0x2')]},'fromuser':{'type':Sequelize[_0xaaeb('0x2')]},'port':{'type':Sequelize[_0xaaeb('0x23')](0x5)},'qualify':{'type':Sequelize[_0xaaeb('0x4')](_0xaaeb('0x15'),'no'),'defaultValue':_0xaaeb('0x15')},'keepalive':{'type':Sequelize[_0xaaeb('0x23')](0xb)},'defaultip':{'type':Sequelize[_0xaaeb('0x2')]},'defaultuser':{'type':Sequelize[_0xaaeb('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xaaeb('0x23')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0xaaeb('0x15'),'no',_0xaaeb('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xaaeb('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0xaaeb('0x23')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0xaaeb('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0xaaeb('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0xaaeb('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xaaeb('0x2')]},'use_q850_reason':{'type':Sequelize[_0xaaeb('0x2')]},'maxforwards':{'type':Sequelize[_0xaaeb('0x23')](0xb)},'encryption':{'type':Sequelize[_0xaaeb('0x4')](_0xaaeb('0x15'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xaaeb('0x4')](_0xaaeb('0x15'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0xaaeb('0x15'),'no')},'icesupport':{'type':Sequelize[_0xaaeb('0x4')](_0xaaeb('0x15'),'no')},'dtlsenable':{'type':Sequelize[_0xaaeb('0x4')]('yes','no')},'dtlsverify':{'type':Sequelize[_0xaaeb('0x4')](_0xaaeb('0x15'),'no','fingerprint',_0xaaeb('0x2c'))},'dtlsrekey':{'type':Sequelize[_0xaaeb('0x23')](0xb)},'dtlscertfile':{'type':Sequelize[_0xaaeb('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xaaeb('0x2')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xaaeb('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize['ENUM'](_0xaaeb('0x2d'),_0xaaeb('0x2e'),_0xaaeb('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xaaeb('0x4')](_0xaaeb('0x15'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xaaeb('0x2')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xaaeb('0x4')](_0xaaeb('0x15'),'no')},'subscribemwi':{'type':Sequelize[_0xaaeb('0x4')](_0xaaeb('0x15'),'no')},'vmexten':{'type':Sequelize[_0xaaeb('0x2')]},'mohinterpret':{'type':Sequelize[_0xaaeb('0x2')]},'mohsuggest':{'type':Sequelize[_0xaaeb('0x2')]},'parkinglot':{'type':Sequelize[_0xaaeb('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xaaeb('0x2')],'defaultValue':_0xaaeb('0x30')},'canreinvite':{'type':Sequelize['ENUM'](_0xaaeb('0x15'),'no',_0xaaeb('0x16'),_0xaaeb('0x31'),_0xaaeb('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xaaeb('0x2')]},'otherFields':{'type':Sequelize[_0xaaeb('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xaaeb('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 606eb73..3527f97 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 _0x84ab=['../../mysqldb','client','http','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','destroy','stack','name','index','map','rawAttributes','fieldName','type','query','keys','intersection','fields','attributes','length','model','order','sort','where','filters','pick','merge','filter','options','Trunk','count','includeAll','rows','params','include','find','createdAt','updatedAt','body','omit','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','readFileSync','utf8','join','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','userProfileId','autoAssociation','root','chan_sip.so','server/files/templates/trunk.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0xb71c35,_0x129343){var _0x39224f=function(_0x26eee8){while(--_0x26eee8){_0xb71c35['push'](_0xb71c35['shift']());}};_0x39224f(++_0x129343);}(_0x84ab,0x12f));var _0xb84a=function(_0x2eb5bc,_0x4634c6){_0x2eb5bc=_0x2eb5bc-0x0;var _0x51c7b1=_0x84ab[_0x2eb5bc];return _0x51c7b1;};'use strict';var emlformat=require(_0xb84a('0x0'));var rimraf=require(_0xb84a('0x1'));var zipdir=require(_0xb84a('0x2'));var jsonpatch=require(_0xb84a('0x3'));var rp=require(_0xb84a('0x4'));var moment=require('moment');var BPromise=require(_0xb84a('0x5'));var Mustache=require(_0xb84a('0x6'));var util=require('util');var path=require(_0xb84a('0x7'));var sox=require(_0xb84a('0x8'));var csv=require(_0xb84a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb84a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb84a('0xb'));var deskjs=require(_0xb84a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84a('0xe'));var authService=require(_0xb84a('0xf'));var qs=require(_0xb84a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb84a('0x11'));var utils=require(_0xb84a('0x12'));var config=require(_0xb84a('0x13'));var licenseUtil=require(_0xb84a('0x14'));var db=require(_0xb84a('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xb84a('0x16')][_0xb84a('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x39a0df,_0x3c161c,_0x44b26b,_0x11dfe9){return new BPromise(function(_0x12ccab,_0x475b){var _0x3113a2=_0x11dfe9||client;return _0x3113a2[_0xb84a('0x18')](_0x39a0df,_0x44b26b)[_0xb84a('0x19')](function(_0x1251ec){logger['info'](_0xb84a('0x1a'),_0x3c161c,_0xb84a('0x1b'));logger[_0xb84a('0x1c')](_0xb84a('0x1d'),_0x3c161c,_0xb84a('0x1b'),JSON[_0xb84a('0x1e')](_0x1251ec));if(_0x1251ec[_0xb84a('0x1f')]){if(_0x1251ec[_0xb84a('0x1f')][_0xb84a('0x20')]===0x1f4){logger[_0xb84a('0x1f')](_0xb84a('0x1a'),_0x3c161c,_0x1251ec[_0xb84a('0x1f')][_0xb84a('0x21')]);return _0x475b(_0x1251ec[_0xb84a('0x1f')]['message']);}logger[_0xb84a('0x1f')](_0xb84a('0x1a'),_0x3c161c,_0x1251ec['error'][_0xb84a('0x21')]);return _0x12ccab(_0x1251ec[_0xb84a('0x1f')][_0xb84a('0x21')]);}else{logger[_0xb84a('0x22')]('Trunk,\x20%s,\x20%s',_0x3c161c,'request\x20sent');_0x12ccab(_0x1251ec[_0xb84a('0x23')][_0xb84a('0x21')]);}})[_0xb84a('0x24')](function(_0x259f74){logger[_0xb84a('0x1f')](_0xb84a('0x1a'),_0x3c161c,_0x259f74);_0x475b(_0x259f74);});});}function respondWithStatusCode(_0x8b28cd,_0x21d0d3){_0x21d0d3=_0x21d0d3||0xcc;return function(_0x3aa06f){if(_0x3aa06f){return _0x8b28cd[_0xb84a('0x25')](_0x21d0d3);}return _0x8b28cd[_0xb84a('0x26')](_0x21d0d3)[_0xb84a('0x27')]();};}function respondWithResult(_0x218aef,_0x409df0){_0x409df0=_0x409df0||0xc8;return function(_0x19bdfa){if(_0x19bdfa){return _0x218aef[_0xb84a('0x26')](_0x409df0)[_0xb84a('0x28')](_0x19bdfa);}};}function respondWithFilteredResult(_0x3ff0bc,_0x3b6805){return function(_0xd468c3){if(_0xd468c3){var _0x33bf1d=typeof _0x3b6805[_0xb84a('0x29')]===_0xb84a('0x2a')&&typeof _0x3b6805[_0xb84a('0x2b')]===_0xb84a('0x2a');var _0x97d71b=_0xd468c3['count'];var _0x582954=_0x33bf1d?0x0:_0x3b6805[_0xb84a('0x29')];var _0x2c30b0=_0x33bf1d?_0xd468c3['count']:_0x3b6805[_0xb84a('0x29')]+_0x3b6805[_0xb84a('0x2b')];var _0x52c23c;if(_0x2c30b0>=_0x97d71b){_0x2c30b0=_0x97d71b;_0x52c23c=0xc8;}else{_0x52c23c=0xce;}_0x3ff0bc['status'](_0x52c23c);return _0x3ff0bc[_0xb84a('0x2c')](_0xb84a('0x2d'),_0x582954+'-'+_0x2c30b0+'/'+_0x97d71b)['json'](_0xd468c3);}return null;};}function patchUpdates(_0x251778){return function(_0xba1147){try{jsonpatch[_0xb84a('0x2e')](_0xba1147,_0x251778,!![]);}catch(_0x44a405){return BPromise[_0xb84a('0x2f')](_0x44a405);}return _0xba1147[_0xb84a('0x30')]();};}function saveUpdates(_0x34b212,_0xac214f){return function(_0x54ec50){if(_0x54ec50){return _0x54ec50[_0xb84a('0x31')](_0x34b212)['then'](function(_0x4bca85){return _0x4bca85;});}return null;};}function removeEntity(_0x2eea7e,_0x3b4515){return function(_0x47a5b6){if(_0x47a5b6){return _0x47a5b6['destroy']()[_0xb84a('0x19')](function(){var _0x13c167=_0x47a5b6[_0xb84a('0x32')]({'plain':!![]});var _0x308240=_0xb84a('0x33');return db[_0xb84a('0x34')][_0xb84a('0x35')]({'where':{'type':_0x308240,'resourceId':_0x13c167['id']}})[_0xb84a('0x19')](function(){return _0x47a5b6;});})['then'](function(){_0x2eea7e[_0xb84a('0x26')](0xcc)[_0xb84a('0x27')]();});}};}function handleEntityNotFound(_0x10b944,_0xf894a6){return function(_0x36aa07){if(!_0x36aa07){_0x10b944[_0xb84a('0x25')](0x194);}return _0x36aa07;};}function handleError(_0x2a5130,_0x5aa2ae){_0x5aa2ae=_0x5aa2ae||0x1f4;return function(_0x30d22d){logger['error'](_0x30d22d[_0xb84a('0x36')]);if(_0x30d22d[_0xb84a('0x37')]){delete _0x30d22d[_0xb84a('0x37')];}_0x2a5130['status'](_0x5aa2ae)['send'](_0x30d22d);};}exports[_0xb84a('0x38')]=function(_0x75e6e6,_0x4a3737){var _0x2d3e08={},_0xab76ce={},_0x4cb5d4={'count':0x0,'rows':[]};var _0x19aa4c=_[_0xb84a('0x39')](db['Trunk'][_0xb84a('0x3a')],function(_0xe6f19e){return{'name':_0xe6f19e[_0xb84a('0x3b')],'type':_0xe6f19e[_0xb84a('0x3c')]['key']};});_0xab76ce['model']=_['map'](_0x19aa4c,_0xb84a('0x37'));_0xab76ce[_0xb84a('0x3d')]=_[_0xb84a('0x3e')](_0x75e6e6[_0xb84a('0x3d')]);_0xab76ce['filters']=_[_0xb84a('0x3f')](_0xab76ce['model'],_0xab76ce[_0xb84a('0x3d')]);_0x2d3e08['attributes']=_['intersection'](_0xab76ce['model'],qs[_0xb84a('0x40')](_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x40')]));_0x2d3e08[_0xb84a('0x41')]=_0x2d3e08['attributes'][_0xb84a('0x42')]?_0x2d3e08[_0xb84a('0x41')]:_0xab76ce[_0xb84a('0x43')];if(!_0x75e6e6[_0xb84a('0x3d')]['hasOwnProperty']('nolimit')){_0x2d3e08[_0xb84a('0x2b')]=qs[_0xb84a('0x2b')](_0x75e6e6['query'][_0xb84a('0x2b')]);_0x2d3e08[_0xb84a('0x29')]=qs[_0xb84a('0x29')](_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x29')]);}_0x2d3e08[_0xb84a('0x44')]=qs[_0xb84a('0x45')](_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x45')]);_0x2d3e08[_0xb84a('0x46')]=qs[_0xb84a('0x47')](_[_0xb84a('0x48')](_0x75e6e6[_0xb84a('0x3d')],_0xab76ce[_0xb84a('0x47')]),_0x19aa4c);if(_0x75e6e6[_0xb84a('0x3d')]['filter']){_0x2d3e08[_0xb84a('0x46')]=_[_0xb84a('0x49')](_0x2d3e08[_0xb84a('0x46')],{'$or':_[_0xb84a('0x39')](_0x19aa4c,function(_0x37f4fe){if(_0x37f4fe[_0xb84a('0x3c')]!=='VIRTUAL'){var _0xfd2927={};_0xfd2927[_0x37f4fe['name']]={'$like':'%'+_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x4a')]+'%'};return _0xfd2927;}})});}_0x2d3e08=_[_0xb84a('0x49')]({},_0x2d3e08,_0x75e6e6[_0xb84a('0x4b')]);var _0x5e7327={'where':_0x2d3e08[_0xb84a('0x46')]};return db[_0xb84a('0x4c')][_0xb84a('0x4d')](_0x5e7327)['then'](function(_0x55f39f){_0x4cb5d4[_0xb84a('0x4d')]=_0x55f39f;if(_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x4e')]){_0x2d3e08['include']=[{'all':!![]}];}return db['Trunk']['findAll'](_0x2d3e08);})[_0xb84a('0x19')](function(_0x384a0d){_0x4cb5d4[_0xb84a('0x4f')]=_0x384a0d;return _0x4cb5d4;})[_0xb84a('0x19')](respondWithFilteredResult(_0x4a3737,_0x2d3e08))[_0xb84a('0x24')](handleError(_0x4a3737,null));};exports['show']=function(_0x4b40fe,_0x5b853a){var _0x53d4d6={'raw':![],'where':{'id':_0x4b40fe[_0xb84a('0x50')]['id']}},_0x421ba0={};_0x421ba0['model']=_[_0xb84a('0x3e')](db[_0xb84a('0x4c')][_0xb84a('0x3a')]);_0x421ba0[_0xb84a('0x3d')]=_[_0xb84a('0x3e')](_0x4b40fe[_0xb84a('0x3d')]);_0x421ba0['filters']=_['intersection'](_0x421ba0[_0xb84a('0x43')],_0x421ba0['query']);_0x53d4d6[_0xb84a('0x41')]=_['intersection'](_0x421ba0['model'],qs['fields'](_0x4b40fe[_0xb84a('0x3d')][_0xb84a('0x40')]));_0x53d4d6[_0xb84a('0x41')]=_0x53d4d6[_0xb84a('0x41')][_0xb84a('0x42')]?_0x53d4d6[_0xb84a('0x41')]:_0x421ba0[_0xb84a('0x43')];if(_0x4b40fe[_0xb84a('0x3d')]['includeAll']){_0x53d4d6['include']=[{'all':!![]}];}_0x53d4d6=_['merge']({},_0x53d4d6,_0x4b40fe[_0xb84a('0x4b')]);return db[_0xb84a('0x4c')]['find'](_0x53d4d6)[_0xb84a('0x19')](handleEntityNotFound(_0x5b853a,null))['then'](respondWithResult(_0x5b853a,null))['catch'](handleError(_0x5b853a,null));};exports['clone']=function(_0x419e27,_0x172076){var _0x49a0e2={'where':{'id':_0x419e27[_0xb84a('0x50')]['id']}},_0x51c415={};_0x51c415[_0xb84a('0x43')]=_[_0xb84a('0x3e')](db['Trunk'][_0xb84a('0x3a')]);_0x49a0e2['attributes']=_['intersection'](_0x51c415[_0xb84a('0x43')],qs['fields'](_0x419e27[_0xb84a('0x3d')]['fields']));_0x49a0e2[_0xb84a('0x41')]=_0x49a0e2[_0xb84a('0x41')][_0xb84a('0x42')]?_0x49a0e2[_0xb84a('0x41')]:_0x51c415['model'];if(_0x419e27['query']['includeAll']){_0x49a0e2[_0xb84a('0x51')]=[{'all':!![]}];}_0x49a0e2=_[_0xb84a('0x49')]({},_0x49a0e2,_0x419e27['options']);return db['Trunk'][_0xb84a('0x52')](_0x49a0e2)[_0xb84a('0x19')](handleEntityNotFound(_0x172076,null))[_0xb84a('0x19')](function(_0x5f415d){if(_0x5f415d){var _0x29f67f=_0x5f415d[_0xb84a('0x32')]({'plain':!![]});_0x29f67f=qs['omit'](_0x29f67f,['id',_0xb84a('0x53'),_0xb84a('0x54')]);_0x419e27[_0xb84a('0x55')]=_[_0xb84a('0x56')](_0x419e27[_0xb84a('0x55')],['id',_0xb84a('0x53'),_0xb84a('0x54')]);return db['Trunk'][_0xb84a('0x57')](_[_0xb84a('0x49')](_0x29f67f,_0x419e27['body']),{'include':_0x419e27[_0xb84a('0x3d')][_0xb84a('0x4e')]?[{'all':!![]}]:undefined})[_0xb84a('0x19')](function(_0x3e16d8){var _0x347998=_0x419e27[_0xb84a('0x58')][_0xb84a('0x32')]({'plain':!![]});if(!_0x347998)throw new Error(_0xb84a('0x59'));if(_0x347998[_0xb84a('0x5a')]==='user'){var _0x291008=_0x3e16d8['get']({'plain':!![]});var _0x5a2d44=_0xb84a('0x33');return db['UserProfileSection'][_0xb84a('0x52')]({'where':{'name':_0x5a2d44,'userProfileId':_0x347998['userProfileId']},'raw':!![]})[_0xb84a('0x19')](function(_0x44e508){if(_0x44e508&&_0x44e508['autoAssociation']===0x0){return db[_0xb84a('0x34')][_0xb84a('0x57')]({'name':_0x291008[_0xb84a('0x37')],'resourceId':_0x291008['id'],'type':_0x44e508[_0xb84a('0x37')],'sectionId':_0x44e508['id']},{})[_0xb84a('0x19')](function(){return _0x3e16d8;});}else{return _0x3e16d8;}})[_0xb84a('0x24')](function(_0x4514f0){logger['error'](_0xb84a('0x5b'),_0x4514f0);throw _0x4514f0;});}return _0x3e16d8;});}})['then'](respondWithResult(_0x172076,0xc9))['catch'](handleError(_0x172076,null));};exports[_0xb84a('0x57')]=function(_0x2a2dc0,_0x2ee241,_0x32a455){var _0x5612f3;return db['Trunk'][_0xb84a('0x57')](_0x2a2dc0[_0xb84a('0x55')],{'raw':!![]})[_0xb84a('0x19')](function(_0x1a2e1a){_0x5612f3=_0x1a2e1a;return db['Trunk'][_0xb84a('0x5c')]({'raw':!![]});})['then'](function(_0x1eec1f){var _0x57b784=fs[_0xb84a('0x5d')](path['join'](config['root'],'server/files/templates/trunk.ejs'),_0xb84a('0x5e'));var _0xf936f1=fs[_0xb84a('0x5d')](path[_0xb84a('0x5f')](config['root'],_0xb84a('0x60')),_0xb84a('0x5e'));var _0x33d416=ejs[_0xb84a('0x61')](_0x57b784,{'trunks':_0x1eec1f||[]});fs[_0xb84a('0x62')](_0xb84a('0x63'),_0x33d416);if(_0x5612f3[_0xb84a('0x64')]){var _0x542d70=ejs[_0xb84a('0x61')](_0xf936f1,{'trunks':_0x1eec1f||[]});fs[_0xb84a('0x62')](_0xb84a('0x65'),_0x542d70);}})[_0xb84a('0x19')](function(){return respondWithRpcPromise(_0xb84a('0x66'),_0xb84a('0x57'),{'module':'chan_sip.so'});})[_0xb84a('0x19')](function(){var _0x6f8f=_0x2a2dc0[_0xb84a('0x58')][_0xb84a('0x32')]({'plain':!![]});if(!_0x6f8f)throw new Error(_0xb84a('0x59'));if(_0x6f8f['role']===_0xb84a('0x58')){var _0x4b0b18=_0x5612f3[_0xb84a('0x32')]({'plain':!![]});return db['UserProfileSection'][_0xb84a('0x52')]({'where':{'name':_0xb84a('0x33'),'userProfileId':_0x6f8f[_0xb84a('0x67')]},'raw':!![]})['then'](function(_0x121fda){if(_0x121fda&&_0x121fda[_0xb84a('0x68')]===0x0){return db[_0xb84a('0x34')][_0xb84a('0x57')]({'name':_0x4b0b18[_0xb84a('0x37')],'resourceId':_0x4b0b18['id'],'type':_0x121fda['name'],'sectionId':_0x121fda['id']},{})[_0xb84a('0x19')](function(){return _0x5612f3;});}else{return _0x5612f3;}})[_0xb84a('0x24')](function(_0x287d25){logger['error'](_0xb84a('0x5b'),_0x287d25);throw _0x287d25;});}return _0x5612f3;})['then'](respondWithResult(_0x2ee241,0xc9))['catch'](handleError(_0x2ee241,null));};exports[_0xb84a('0x31')]=function(_0x35cb8b,_0x13c7b7,_0x3b2a2d){var _0x2047f5;return db[_0xb84a('0x4c')][_0xb84a('0x52')]({'where':{'id':_0x35cb8b[_0xb84a('0x50')]['id']}})[_0xb84a('0x19')](handleEntityNotFound(_0x13c7b7,null))[_0xb84a('0x19')](saveUpdates(_0x35cb8b[_0xb84a('0x55')],null))[_0xb84a('0x19')](function(_0x3ec1fb){if(_0x3ec1fb){_0x2047f5=_0x3ec1fb;return db[_0xb84a('0x4c')][_0xb84a('0x5c')]({'raw':!![]});}})[_0xb84a('0x19')](function(_0xb18756){if(_0xb18756){var _0x1169d1=fs['readFileSync'](path[_0xb84a('0x5f')](config[_0xb84a('0x69')],'server/files/templates/trunk.ejs'),_0xb84a('0x5e'));var _0x576df5=fs[_0xb84a('0x5d')](path['join'](config[_0xb84a('0x69')],'server/files/templates/registry.ejs'),'utf8');var _0xf3f253=ejs[_0xb84a('0x61')](_0x1169d1,{'trunks':_0xb18756||[]});fs['writeFileSync'](_0xb84a('0x63'),_0xf3f253);var _0xcf9bc2=ejs[_0xb84a('0x61')](_0x576df5,{'trunks':_0xb18756||[]});fs[_0xb84a('0x62')](_0xb84a('0x65'),_0xcf9bc2);return respondWithRpcPromise('Reload',_0xb84a('0x31'),{'module':_0xb84a('0x6a')});}return null;})[_0xb84a('0x19')](function(_0x30f7cd){if(_0x30f7cd){return _0x2047f5;}})['then'](respondWithResult(_0x13c7b7,null))[_0xb84a('0x24')](handleError(_0x13c7b7,null));};exports['destroy']=function(_0x14118c,_0x12d796,_0x54ae3e){var _0xf6765a;return db[_0xb84a('0x4c')][_0xb84a('0x52')]({'where':{'id':_0x14118c['params']['id']}})['then'](handleEntityNotFound(_0x12d796,null))[_0xb84a('0x19')](removeEntity(_0x12d796,null))[_0xb84a('0x19')](function(){return db['Trunk'][_0xb84a('0x5c')]({'raw':!![]});})['then'](function(_0x166d75){var _0x54161c=fs['readFileSync'](path[_0xb84a('0x5f')](config[_0xb84a('0x69')],_0xb84a('0x6b')),_0xb84a('0x5e'));var _0x403a3e=fs['readFileSync'](path['join'](config[_0xb84a('0x69')],_0xb84a('0x60')),'utf8');var _0x305b67=ejs[_0xb84a('0x61')](_0x54161c,{'trunks':_0x166d75});var _0x385a05=ejs[_0xb84a('0x61')](_0x403a3e,{'trunks':_0x166d75});fs['writeFileSync'](_0xb84a('0x63'),_0x305b67);fs['writeFileSync'](_0xb84a('0x65'),_0x385a05);return respondWithRpcPromise(_0xb84a('0x66'),_0xb84a('0x35'),{'module':_0xb84a('0x6a')});})[_0xb84a('0x24')](handleError(_0x12d796,null));}; \ No newline at end of file +var _0xd6d6=['sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','get','Trunks','UserProfileResource','stack','send','index','rawAttributes','fieldName','type','model','map','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','VIRTUAL','filter','merge','options','Trunk','includeAll','include','findAll','rows','show','params','find','clone','omit','createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','create','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','role','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch'];(function(_0x59a903,_0x281c6c){var _0x187c59=function(_0x415be1){while(--_0x415be1){_0x59a903['push'](_0x59a903['shift']());}};_0x187c59(++_0x281c6c);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x56b9b5,_0x452847){_0x56b9b5=_0x56b9b5-0x0;var _0x142072=_0xd6d6[_0x56b9b5];return _0x142072;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];var jayson=require(_0x6d6d('0x19'));var client=jayson[_0x6d6d('0x1a')][_0x6d6d('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2b74ed,_0x41fbdf,_0x19cf50,_0x2cb2dd){return new BPromise(function(_0x5f4154,_0xd09ea7){var _0x3dd4b3=_0x2cb2dd||client;return _0x3dd4b3[_0x6d6d('0x1c')](_0x2b74ed,_0x19cf50)[_0x6d6d('0x1d')](function(_0x29cbd8){logger['info'](_0x6d6d('0x1e'),_0x41fbdf,'request\x20sent');logger[_0x6d6d('0x1f')](_0x6d6d('0x20'),_0x41fbdf,_0x6d6d('0x21'),JSON['stringify'](_0x29cbd8));if(_0x29cbd8['error']){if(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x23')]===0x1f4){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8['error']['message']);return _0xd09ea7(_0x29cbd8[_0x6d6d('0x22')]['message']);}logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);return _0x5f4154(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);}else{logger[_0x6d6d('0x25')](_0x6d6d('0x1e'),_0x41fbdf,_0x6d6d('0x21'));_0x5f4154(_0x29cbd8[_0x6d6d('0x26')][_0x6d6d('0x24')]);}})[_0x6d6d('0x27')](function(_0x466a29){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x466a29);_0xd09ea7(_0x466a29);});});}function respondWithStatusCode(_0x25a02e,_0xced622){_0xced622=_0xced622||0xcc;return function(_0x583b10){if(_0x583b10){return _0x25a02e[_0x6d6d('0x28')](_0xced622);}return _0x25a02e[_0x6d6d('0x29')](_0xced622)[_0x6d6d('0x2a')]();};}function respondWithResult(_0x97ec9e,_0xf0df7f){_0xf0df7f=_0xf0df7f||0xc8;return function(_0x12fab2){if(_0x12fab2){return _0x97ec9e['status'](_0xf0df7f)[_0x6d6d('0x2b')](_0x12fab2);}};}function respondWithFilteredResult(_0x2b5e31,_0x235451){return function(_0x126ac8){if(_0x126ac8){var _0x25c121=typeof _0x235451[_0x6d6d('0x2c')]===_0x6d6d('0x2d')&&typeof _0x235451['limit']===_0x6d6d('0x2d');var _0x9595d8=_0x126ac8['count'];var _0x553645=_0x25c121?0x0:_0x235451[_0x6d6d('0x2c')];var _0x5273cd=_0x25c121?_0x126ac8[_0x6d6d('0x2e')]:_0x235451['offset']+_0x235451[_0x6d6d('0x2f')];var _0x20255e;if(_0x5273cd>=_0x9595d8){_0x5273cd=_0x9595d8;_0x20255e=0xc8;}else{_0x20255e=0xce;}_0x2b5e31[_0x6d6d('0x29')](_0x20255e);return _0x2b5e31[_0x6d6d('0x30')](_0x6d6d('0x31'),_0x553645+'-'+_0x5273cd+'/'+_0x9595d8)[_0x6d6d('0x2b')](_0x126ac8);}return null;};}function patchUpdates(_0xdda3f2){return function(_0x359cfd){try{jsonpatch[_0x6d6d('0x32')](_0x359cfd,_0xdda3f2,!![]);}catch(_0x34050a){return BPromise['reject'](_0x34050a);}return _0x359cfd[_0x6d6d('0x33')]();};}function saveUpdates(_0x4f1fc5,_0x18015a){return function(_0x1ea9b2){if(_0x1ea9b2){return _0x1ea9b2[_0x6d6d('0x34')](_0x4f1fc5)[_0x6d6d('0x1d')](function(_0x5c6248){return _0x5c6248;});}return null;};}function removeEntity(_0x182441,_0x4f2f13){return function(_0x3cc702){if(_0x3cc702){return _0x3cc702[_0x6d6d('0x35')]()['then'](function(){var _0x37993f=_0x3cc702[_0x6d6d('0x36')]({'plain':!![]});var _0x37ac94=_0x6d6d('0x37');return db[_0x6d6d('0x38')][_0x6d6d('0x35')]({'where':{'type':_0x37ac94,'resourceId':_0x37993f['id']}})[_0x6d6d('0x1d')](function(){return _0x3cc702;});})[_0x6d6d('0x1d')](function(){_0x182441[_0x6d6d('0x29')](0xcc)[_0x6d6d('0x2a')]();});}};}function handleEntityNotFound(_0x2fcf88,_0x3693da){return function(_0x17d863){if(!_0x17d863){_0x2fcf88[_0x6d6d('0x28')](0x194);}return _0x17d863;};}function handleError(_0x5a2397,_0x1335ef){_0x1335ef=_0x1335ef||0x1f4;return function(_0xf98bfa){logger[_0x6d6d('0x22')](_0xf98bfa[_0x6d6d('0x39')]);if(_0xf98bfa['name']){delete _0xf98bfa['name'];}_0x5a2397[_0x6d6d('0x29')](_0x1335ef)[_0x6d6d('0x3a')](_0xf98bfa);};}exports[_0x6d6d('0x3b')]=function(_0x4d42ff,_0x2a3f67){var _0x2607c1={},_0x23c173={},_0x125d79={'count':0x0,'rows':[]};var _0x52556b=_['map'](db['Trunk'][_0x6d6d('0x3c')],function(_0x4196f0){return{'name':_0x4196f0[_0x6d6d('0x3d')],'type':_0x4196f0[_0x6d6d('0x3e')]['key']};});_0x23c173[_0x6d6d('0x3f')]=_[_0x6d6d('0x40')](_0x52556b,_0x6d6d('0x41'));_0x23c173[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x4d42ff[_0x6d6d('0x42')]);_0x23c173['filters']=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],_0x23c173[_0x6d6d('0x42')]);_0x2607c1[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x4d42ff['query'][_0x6d6d('0x46')]));_0x2607c1[_0x6d6d('0x45')]=_0x2607c1[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x2607c1[_0x6d6d('0x45')]:_0x23c173['model'];if(!_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x48')]('nolimit')){_0x2607c1[_0x6d6d('0x2f')]=qs['limit'](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2f')]);_0x2607c1['offset']=qs[_0x6d6d('0x2c')](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2c')]);}_0x2607c1[_0x6d6d('0x49')]=qs[_0x6d6d('0x4a')](_0x4d42ff['query']['sort']);_0x2607c1[_0x6d6d('0x4b')]=qs['filters'](_['pick'](_0x4d42ff[_0x6d6d('0x42')],_0x23c173[_0x6d6d('0x4c')]),_0x52556b);if(_0x4d42ff[_0x6d6d('0x42')]['filter']){_0x2607c1[_0x6d6d('0x4b')]=_['merge'](_0x2607c1[_0x6d6d('0x4b')],{'$or':_[_0x6d6d('0x40')](_0x52556b,function(_0x1d3826){if(_0x1d3826[_0x6d6d('0x3e')]!==_0x6d6d('0x4d')){var _0x2669f0={};_0x2669f0[_0x1d3826[_0x6d6d('0x41')]]={'$like':'%'+_0x4d42ff['query'][_0x6d6d('0x4e')]+'%'};return _0x2669f0;}})});}_0x2607c1=_[_0x6d6d('0x4f')]({},_0x2607c1,_0x4d42ff[_0x6d6d('0x50')]);var _0x389e51={'where':_0x2607c1[_0x6d6d('0x4b')]};return db[_0x6d6d('0x51')][_0x6d6d('0x2e')](_0x389e51)[_0x6d6d('0x1d')](function(_0x24cec2){_0x125d79['count']=_0x24cec2;if(_0x4d42ff['query'][_0x6d6d('0x52')]){_0x2607c1[_0x6d6d('0x53')]=[{'all':!![]}];}return db[_0x6d6d('0x51')][_0x6d6d('0x54')](_0x2607c1);})[_0x6d6d('0x1d')](function(_0x492834){_0x125d79[_0x6d6d('0x55')]=_0x492834;return _0x125d79;})[_0x6d6d('0x1d')](respondWithFilteredResult(_0x2a3f67,_0x2607c1))[_0x6d6d('0x27')](handleError(_0x2a3f67,null));};exports[_0x6d6d('0x56')]=function(_0x2ee917,_0x23c2db){var _0x1f7a09={'raw':![],'where':{'id':_0x2ee917[_0x6d6d('0x57')]['id']}},_0x39ec2a={};_0x39ec2a[_0x6d6d('0x3f')]=_[_0x6d6d('0x43')](db[_0x6d6d('0x51')]['rawAttributes']);_0x39ec2a[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x2ee917[_0x6d6d('0x42')]);_0x39ec2a[_0x6d6d('0x4c')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],_0x39ec2a[_0x6d6d('0x42')]);_0x1f7a09[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],qs['fields'](_0x2ee917[_0x6d6d('0x42')]['fields']));_0x1f7a09[_0x6d6d('0x45')]=_0x1f7a09[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x1f7a09[_0x6d6d('0x45')]:_0x39ec2a[_0x6d6d('0x3f')];if(_0x2ee917[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x1f7a09[_0x6d6d('0x53')]=[{'all':!![]}];}_0x1f7a09=_[_0x6d6d('0x4f')]({},_0x1f7a09,_0x2ee917[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x1f7a09)[_0x6d6d('0x1d')](handleEntityNotFound(_0x23c2db,null))[_0x6d6d('0x1d')](respondWithResult(_0x23c2db,null))[_0x6d6d('0x27')](handleError(_0x23c2db,null));};exports[_0x6d6d('0x59')]=function(_0x45f44a,_0x243be3){var _0x5e5ace={'where':{'id':_0x45f44a[_0x6d6d('0x57')]['id']}},_0x5a1cdc={};_0x5a1cdc[_0x6d6d('0x3f')]=_['keys'](db[_0x6d6d('0x51')][_0x6d6d('0x3c')]);_0x5e5ace[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x5a1cdc[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x46')]));_0x5e5ace[_0x6d6d('0x45')]=_0x5e5ace[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x5e5ace[_0x6d6d('0x45')]:_0x5a1cdc[_0x6d6d('0x3f')];if(_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x5e5ace['include']=[{'all':!![]}];}_0x5e5ace=_[_0x6d6d('0x4f')]({},_0x5e5ace,_0x45f44a[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x5e5ace)[_0x6d6d('0x1d')](handleEntityNotFound(_0x243be3,null))[_0x6d6d('0x1d')](function(_0x407357){if(_0x407357){var _0x2d61cc=_0x407357[_0x6d6d('0x36')]({'plain':!![]});_0x2d61cc=qs[_0x6d6d('0x5a')](_0x2d61cc,['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);_0x45f44a['body']=_['omit'](_0x45f44a[_0x6d6d('0x5d')],['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);return db['Trunk']['create'](_[_0x6d6d('0x4f')](_0x2d61cc,_0x45f44a['body']),{'include':_0x45f44a[_0x6d6d('0x42')]['includeAll']?[{'all':!![]}]:undefined})[_0x6d6d('0x1d')](function(_0x367a6f){var _0x21f14c=_0x45f44a[_0x6d6d('0x5e')][_0x6d6d('0x36')]({'plain':!![]});if(!_0x21f14c)throw new Error(_0x6d6d('0x5f'));if(_0x21f14c['role']===_0x6d6d('0x5e')){var _0x5eb78f=_0x367a6f[_0x6d6d('0x36')]({'plain':!![]});var _0x52d9e7=_0x6d6d('0x37');return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x52d9e7,'userProfileId':_0x21f14c[_0x6d6d('0x61')]},'raw':!![]})[_0x6d6d('0x1d')](function(_0x163bb7){if(_0x163bb7&&_0x163bb7[_0x6d6d('0x62')]===0x0){return db['UserProfileResource']['create']({'name':_0x5eb78f[_0x6d6d('0x41')],'resourceId':_0x5eb78f['id'],'type':_0x163bb7['name'],'sectionId':_0x163bb7['id']},{})[_0x6d6d('0x1d')](function(){return _0x367a6f;});}else{return _0x367a6f;}})['catch'](function(_0xe19d23){logger[_0x6d6d('0x22')](_0x6d6d('0x63'),_0xe19d23);throw _0xe19d23;});}return _0x367a6f;});}})[_0x6d6d('0x1d')](respondWithResult(_0x243be3,0xc9))[_0x6d6d('0x27')](handleError(_0x243be3,null));};exports[_0x6d6d('0x64')]=function(_0x5dd3b0,_0x3cedc0,_0xbca58e){var _0x3a6d79;return db[_0x6d6d('0x51')][_0x6d6d('0x64')](_0x5dd3b0[_0x6d6d('0x5d')],{'raw':!![]})[_0x6d6d('0x1d')](function(_0x589d64){_0x3a6d79=_0x589d64;return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0x3bf8a7){var _0x1aa25d=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x1efc55=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x5b6ca7=ejs[_0x6d6d('0x6a')](_0x1aa25d,{'trunks':_0x3bf8a7||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x5b6ca7);if(_0x3a6d79[_0x6d6d('0x6d')]){var _0x2d4a04=ejs[_0x6d6d('0x6a')](_0x1efc55,{'trunks':_0x3bf8a7||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x2d4a04);}})[_0x6d6d('0x1d')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})[_0x6d6d('0x1d')](function(){var _0x5cd494=_0x5dd3b0[_0x6d6d('0x5e')]['get']({'plain':!![]});if(!_0x5cd494)throw new Error(_0x6d6d('0x5f'));if(_0x5cd494[_0x6d6d('0x6e')]==='user'){var _0x52dca9=_0x3a6d79[_0x6d6d('0x36')]({'plain':!![]});return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x6d6d('0x37'),'userProfileId':_0x5cd494['userProfileId']},'raw':!![]})[_0x6d6d('0x1d')](function(_0x264d24){if(_0x264d24&&_0x264d24[_0x6d6d('0x62')]===0x0){return db[_0x6d6d('0x38')]['create']({'name':_0x52dca9[_0x6d6d('0x41')],'resourceId':_0x52dca9['id'],'type':_0x264d24['name'],'sectionId':_0x264d24['id']},{})['then'](function(){return _0x3a6d79;});}else{return _0x3a6d79;}})['catch'](function(_0x3da125){logger['error'](_0x6d6d('0x63'),_0x3da125);throw _0x3da125;});}return _0x3a6d79;})[_0x6d6d('0x1d')](respondWithResult(_0x3cedc0,0xc9))[_0x6d6d('0x27')](handleError(_0x3cedc0,null));};exports['update']=function(_0x5146a4,_0x55d877,_0xcba8dd){var _0x542386;return db['Trunk'][_0x6d6d('0x58')]({'where':{'id':_0x5146a4[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x55d877,null))[_0x6d6d('0x1d')](saveUpdates(_0x5146a4[_0x6d6d('0x5d')],null))[_0x6d6d('0x1d')](function(_0x3f9aad){if(_0x3f9aad){_0x542386=_0x3f9aad;return db['Trunk']['findAll']({'raw':!![]});}})['then'](function(_0x5c20c5){if(_0x5c20c5){var _0x54bdef=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x59998e=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],_0x6d6d('0x6f')),_0x6d6d('0x69'));var _0x1c8d15=ejs['render'](_0x54bdef,{'trunks':_0x5c20c5||[]});fs['writeFileSync'](_0x6d6d('0x6c'),_0x1c8d15);var _0x1e1c4e=ejs['render'](_0x59998e,{'trunks':_0x5c20c5||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x1e1c4e);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x34'),{'module':_0x6d6d('0x72')});}return null;})['then'](function(_0xf5586f){if(_0xf5586f){return _0x542386;}})['then'](respondWithResult(_0x55d877,null))[_0x6d6d('0x27')](handleError(_0x55d877,null));};exports['destroy']=function(_0x108108,_0x54a5a9,_0x445196){var _0x1bfce6;return db[_0x6d6d('0x51')][_0x6d6d('0x58')]({'where':{'id':_0x108108[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x54a5a9,null))[_0x6d6d('0x1d')](removeEntity(_0x54a5a9,null))[_0x6d6d('0x1d')](function(){return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0xb2940d){var _0x7c1934=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/trunk.ejs'),'utf8');var _0x139b61=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x1d2668=ejs['render'](_0x7c1934,{'trunks':_0xb2940d});var _0x2ab52f=ejs[_0x6d6d('0x6a')](_0x139b61,{'trunks':_0xb2940d});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x1d2668);fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x2ab52f);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x35'),{'module':'chan_sip.so'});})[_0x6d6d('0x27')](handleError(_0x54a5a9,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 788c56f..4cac5ff 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 _0xd249=['rimraf','./trunk.attributes','define','Trunk','tools_trunks','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2aa9f5,_0x3c351d){var _0x511493=function(_0x474188){while(--_0x474188){_0x2aa9f5['push'](_0x2aa9f5['shift']());}};_0x511493(++_0x3c351d);}(_0xd249,0xdd));var _0x9d24=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xd249[_0x3fba9f];return _0x192cf1;};'use strict';var _=require(_0x9d24('0x0'));var util=require('util');var logger=require(_0x9d24('0x1'))(_0x9d24('0x2'));var moment=require(_0x9d24('0x3'));var BPromise=require(_0x9d24('0x4'));var rp=require(_0x9d24('0x5'));var fs=require('fs');var path=require(_0x9d24('0x6'));var rimraf=require(_0x9d24('0x7'));var config=require('../../config/environment');var attributes=require(_0x9d24('0x8'));module['exports']=function(_0xe3943,_0x382d34){return _0xe3943[_0x9d24('0x9')](_0x9d24('0xa'),attributes,{'tableName':_0x9d24('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x02b8=['./trunk.attributes','define','Trunk','tools_trunks','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x317722,_0x58fba2){var _0xa152ad=function(_0x1a1b4e){while(--_0x1a1b4e){_0x317722['push'](_0x317722['shift']());}};_0xa152ad(++_0x58fba2);}(_0x02b8,0x86));var _0x802b=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x02b8[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x802b('0x0'));var util=require(_0x802b('0x1'));var logger=require(_0x802b('0x2'))(_0x802b('0x3'));var moment=require(_0x802b('0x4'));var BPromise=require(_0x802b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x802b('0x6'));var rimraf=require(_0x802b('0x7'));var config=require(_0x802b('0x8'));var attributes=require(_0x802b('0x9'));module['exports']=function(_0x4424da,_0x4beb1f){return _0x4424da[_0x802b('0xa')](_0x802b('0xb'),attributes,{'tableName':_0x802b('0xc'),'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 3e96c99..6d7e52f 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 _0xc36e=['stringify','error','code','message','result','GetTrunk','Trunk','findAll','options','where','attributes','include','map','model','debug','ShowTrunk','find','raw','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s'];(function(_0x24c3f2,_0x4a95ed){var _0x197f69=function(_0x3e697e){while(--_0x3e697e){_0x24c3f2['push'](_0x24c3f2['shift']());}};_0x197f69(++_0x4a95ed);}(_0xc36e,0x79));var _0xec36=function(_0x2148c0,_0x3f9c39){_0x2148c0=_0x2148c0-0x0;var _0x30eaaa=_0xc36e[_0x2148c0];return _0x30eaaa;};'use strict';var _=require('lodash');var util=require(_0xec36('0x0'));var moment=require('moment');var BPromise=require(_0xec36('0x1'));var rs=require(_0xec36('0x2'));var fs=require('fs');var Redis=require(_0xec36('0x3'));var db=require(_0xec36('0x4'))['db'];var utils=require(_0xec36('0x5'));var logger=require(_0xec36('0x6'))('rpc');var config=require(_0xec36('0x7'));var jayson=require(_0xec36('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xa8c6d8,_0x2e0be2,_0x3362ab){return new BPromise(function(_0x45cd17,_0x200b07){return client[_0xec36('0x9')](_0xa8c6d8,_0x3362ab)[_0xec36('0xa')](function(_0xd7046c){logger[_0xec36('0xb')](_0xec36('0xc'),_0x2e0be2,_0xec36('0xd'));logger['debug'](_0xec36('0xe'),_0x2e0be2,_0xec36('0xd'),JSON[_0xec36('0xf')](_0xd7046c));if(_0xd7046c[_0xec36('0x10')]){if(_0xd7046c[_0xec36('0x10')][_0xec36('0x11')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x2e0be2,_0xd7046c['error']['message']);return _0x200b07(_0xd7046c['error']['message']);}logger['error'](_0xec36('0xc'),_0x2e0be2,_0xd7046c[_0xec36('0x10')][_0xec36('0x12')]);return _0x45cd17(_0xd7046c['error'][_0xec36('0x12')]);}else{logger['info'](_0xec36('0xc'),_0x2e0be2,_0xec36('0xd'));_0x45cd17(_0xd7046c[_0xec36('0x13')][_0xec36('0x12')]);}})['catch'](function(_0x150b25){logger[_0xec36('0x10')]('Trunk,\x20%s,\x20%s',_0x2e0be2,_0x150b25);_0x200b07(_0x150b25);});});}exports[_0xec36('0x14')]=function(_0x1d1854){var _0x5bcd60=this;return new Promise(function(_0x446b6c,_0x8315f4){return db[_0xec36('0x15')][_0xec36('0x16')]({'raw':_0x1d1854[_0xec36('0x17')]?_0x1d1854['options']['raw']===undefined?!![]:![]:!![],'where':_0x1d1854['options']?_0x1d1854['options'][_0xec36('0x18')]||null:null,'attributes':_0x1d1854[_0xec36('0x17')]?_0x1d1854['options'][_0xec36('0x19')]||null:null,'limit':_0x1d1854['options']?_0x1d1854[_0xec36('0x17')]['limit']||null:null,'include':_0x1d1854[_0xec36('0x17')]?_0x1d1854[_0xec36('0x17')][_0xec36('0x1a')]?_['map'](_0x1d1854[_0xec36('0x17')]['include'],function(_0x2abb07){return{'model':db[_0x2abb07['model']],'as':_0x2abb07['as'],'attributes':_0x2abb07[_0xec36('0x19')],'include':_0x2abb07[_0xec36('0x1a')]?_[_0xec36('0x1b')](_0x2abb07['include'],function(_0x20ca59){return{'model':db[_0x20ca59[_0xec36('0x1c')]],'as':_0x20ca59['as'],'attributes':_0x20ca59['attributes'],'include':_0x20ca59['include']?_[_0xec36('0x1b')](_0x20ca59[_0xec36('0x1a')],function(_0x3e4d37){return{'model':db[_0x3e4d37['model']],'as':_0x3e4d37['as'],'attributes':_0x3e4d37[_0xec36('0x19')]};}):[]};}):[]};}):[]:[]})[_0xec36('0xa')](function(_0x1586f4){logger[_0xec36('0xb')](_0xec36('0x14'),_0x1d1854);logger[_0xec36('0x1d')](_0xec36('0x14'),_0x1d1854,JSON[_0xec36('0xf')](_0x1586f4));_0x446b6c(_0x1586f4);})['catch'](function(_0x3f3556){logger['error'](_0xec36('0x14'),_0x3f3556['message'],_0x1d1854);_0x8315f4(_0x5bcd60[_0xec36('0x10')](0x1f4,_0x3f3556[_0xec36('0x12')]));});});};exports[_0xec36('0x1e')]=function(_0x16ab39){var _0x8ad1ea=this;return new Promise(function(_0x145292,_0x509ce2){return db[_0xec36('0x15')][_0xec36('0x1f')]({'raw':_0x16ab39[_0xec36('0x17')]?_0x16ab39[_0xec36('0x17')][_0xec36('0x20')]===undefined?!![]:![]:!![],'where':_0x16ab39['options']?_0x16ab39[_0xec36('0x17')][_0xec36('0x18')]||null:null,'attributes':_0x16ab39[_0xec36('0x17')]?_0x16ab39['options']['attributes']||null:null,'include':_0x16ab39[_0xec36('0x17')]?_0x16ab39[_0xec36('0x17')][_0xec36('0x1a')]?_['map'](_0x16ab39[_0xec36('0x17')][_0xec36('0x1a')],function(_0x2c5042){return{'model':db[_0x2c5042[_0xec36('0x1c')]],'as':_0x2c5042['as'],'attributes':_0x2c5042[_0xec36('0x19')],'include':_0x2c5042[_0xec36('0x1a')]?_[_0xec36('0x1b')](_0x2c5042[_0xec36('0x1a')],function(_0x4a2349){return{'model':db[_0x4a2349['model']],'as':_0x4a2349['as'],'attributes':_0x4a2349[_0xec36('0x19')],'include':_0x4a2349[_0xec36('0x1a')]?_['map'](_0x4a2349[_0xec36('0x1a')],function(_0x52cb56){return{'model':db[_0x52cb56[_0xec36('0x1c')]],'as':_0x52cb56['as'],'attributes':_0x52cb56[_0xec36('0x19')]};}):[]};}):[]};}):[]:[]})[_0xec36('0xa')](function(_0x10d20d){logger[_0xec36('0xb')](_0xec36('0x1e'),_0x16ab39);logger[_0xec36('0x1d')]('ShowTrunk',_0x16ab39,JSON['stringify'](_0x10d20d));_0x145292(_0x10d20d);})[_0xec36('0x21')](function(_0x1bfa06){logger['error'](_0xec36('0x1e'),_0x1bfa06['message'],_0x16ab39);_0x509ce2(_0x8ad1ea['error'](0x1f4,_0x1bfa06[_0xec36('0x12')]));});});}; \ No newline at end of file +var _0x19aa=['findAll','options','where','attributes','limit','include','map','model','ShowTrunk','Trunk','find','raw','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk'];(function(_0x2be240,_0x1e119d){var _0x123543=function(_0x580bf4){while(--_0x580bf4){_0x2be240['push'](_0x2be240['shift']());}};_0x123543(++_0x1e119d);}(_0x19aa,0x147));var _0xa19a=function(_0x44f139,_0x1814ab){_0x44f139=_0x44f139-0x0;var _0x5913b7=_0x19aa[_0x44f139];return _0x5913b7;};'use strict';var _=require(_0xa19a('0x0'));var util=require(_0xa19a('0x1'));var moment=require('moment');var BPromise=require(_0xa19a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa19a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa19a('0x4'));var logger=require(_0xa19a('0x5'))(_0xa19a('0x6'));var config=require(_0xa19a('0x7'));var jayson=require(_0xa19a('0x8'));var client=jayson[_0xa19a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x80b4d7,_0x25776a,_0x2af195){return new BPromise(function(_0x1878d8,_0x3cb206){return client['request'](_0x80b4d7,_0x2af195)[_0xa19a('0xa')](function(_0x111dd7){logger[_0xa19a('0xb')](_0xa19a('0xc'),_0x25776a,_0xa19a('0xd'));logger[_0xa19a('0xe')](_0xa19a('0xf'),_0x25776a,'request\x20sent',JSON[_0xa19a('0x10')](_0x111dd7));if(_0x111dd7['error']){if(_0x111dd7[_0xa19a('0x11')][_0xa19a('0x12')]===0x1f4){logger[_0xa19a('0x11')](_0xa19a('0xc'),_0x25776a,_0x111dd7[_0xa19a('0x11')][_0xa19a('0x13')]);return _0x3cb206(_0x111dd7[_0xa19a('0x11')]['message']);}logger[_0xa19a('0x11')](_0xa19a('0xc'),_0x25776a,_0x111dd7[_0xa19a('0x11')]['message']);return _0x1878d8(_0x111dd7[_0xa19a('0x11')][_0xa19a('0x13')]);}else{logger[_0xa19a('0xb')]('Trunk,\x20%s,\x20%s',_0x25776a,_0xa19a('0xd'));_0x1878d8(_0x111dd7[_0xa19a('0x14')][_0xa19a('0x13')]);}})[_0xa19a('0x15')](function(_0x3a4b69){logger['error'](_0xa19a('0xc'),_0x25776a,_0x3a4b69);_0x3cb206(_0x3a4b69);});});}exports[_0xa19a('0x16')]=function(_0x405551){var _0x5c0037=this;return new Promise(function(_0x138001,_0xc0feed){return db['Trunk'][_0xa19a('0x17')]({'raw':_0x405551[_0xa19a('0x18')]?_0x405551[_0xa19a('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x405551[_0xa19a('0x18')]?_0x405551[_0xa19a('0x18')][_0xa19a('0x19')]||null:null,'attributes':_0x405551[_0xa19a('0x18')]?_0x405551['options'][_0xa19a('0x1a')]||null:null,'limit':_0x405551[_0xa19a('0x18')]?_0x405551[_0xa19a('0x18')][_0xa19a('0x1b')]||null:null,'include':_0x405551[_0xa19a('0x18')]?_0x405551['options'][_0xa19a('0x1c')]?_[_0xa19a('0x1d')](_0x405551[_0xa19a('0x18')][_0xa19a('0x1c')],function(_0x525cdc){return{'model':db[_0x525cdc[_0xa19a('0x1e')]],'as':_0x525cdc['as'],'attributes':_0x525cdc[_0xa19a('0x1a')],'include':_0x525cdc[_0xa19a('0x1c')]?_[_0xa19a('0x1d')](_0x525cdc['include'],function(_0x2d13c0){return{'model':db[_0x2d13c0[_0xa19a('0x1e')]],'as':_0x2d13c0['as'],'attributes':_0x2d13c0[_0xa19a('0x1a')],'include':_0x2d13c0[_0xa19a('0x1c')]?_['map'](_0x2d13c0[_0xa19a('0x1c')],function(_0x311c8a){return{'model':db[_0x311c8a[_0xa19a('0x1e')]],'as':_0x311c8a['as'],'attributes':_0x311c8a[_0xa19a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa19a('0xa')](function(_0x1ede1a){logger[_0xa19a('0xb')](_0xa19a('0x16'),_0x405551);logger['debug']('GetTrunk',_0x405551,JSON[_0xa19a('0x10')](_0x1ede1a));_0x138001(_0x1ede1a);})[_0xa19a('0x15')](function(_0xa7a683){logger[_0xa19a('0x11')](_0xa19a('0x16'),_0xa7a683['message'],_0x405551);_0xc0feed(_0x5c0037[_0xa19a('0x11')](0x1f4,_0xa7a683['message']));});});};exports[_0xa19a('0x1f')]=function(_0x307baa){var _0x5ba416=this;return new Promise(function(_0x2a87e4,_0x76615e){return db[_0xa19a('0x20')][_0xa19a('0x21')]({'raw':_0x307baa[_0xa19a('0x18')]?_0x307baa[_0xa19a('0x18')][_0xa19a('0x22')]===undefined?!![]:![]:!![],'where':_0x307baa[_0xa19a('0x18')]?_0x307baa[_0xa19a('0x18')][_0xa19a('0x19')]||null:null,'attributes':_0x307baa[_0xa19a('0x18')]?_0x307baa['options'][_0xa19a('0x1a')]||null:null,'include':_0x307baa['options']?_0x307baa[_0xa19a('0x18')]['include']?_[_0xa19a('0x1d')](_0x307baa[_0xa19a('0x18')][_0xa19a('0x1c')],function(_0x33d075){return{'model':db[_0x33d075[_0xa19a('0x1e')]],'as':_0x33d075['as'],'attributes':_0x33d075['attributes'],'include':_0x33d075[_0xa19a('0x1c')]?_[_0xa19a('0x1d')](_0x33d075['include'],function(_0x2e9e45){return{'model':db[_0x2e9e45['model']],'as':_0x2e9e45['as'],'attributes':_0x2e9e45[_0xa19a('0x1a')],'include':_0x2e9e45[_0xa19a('0x1c')]?_[_0xa19a('0x1d')](_0x2e9e45[_0xa19a('0x1c')],function(_0x949a5b){return{'model':db[_0x949a5b[_0xa19a('0x1e')]],'as':_0x949a5b['as'],'attributes':_0x949a5b[_0xa19a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa19a('0xa')](function(_0x5eb0db){logger['info'](_0xa19a('0x1f'),_0x307baa);logger[_0xa19a('0xe')](_0xa19a('0x1f'),_0x307baa,JSON[_0xa19a('0x10')](_0x5eb0db));_0x2a87e4(_0x5eb0db);})[_0xa19a('0x15')](function(_0x5a8bd6){logger['error'](_0xa19a('0x1f'),_0x5a8bd6[_0xa19a('0x13')],_0x307baa);_0x76615e(_0x5ba416['error'](0x1f4,_0x5a8bd6[_0xa19a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 6737b97..b03931c 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 _0x1ce0=['isAuthenticated','update','Router','../../components/auth/service','put','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1ce0,0x1d6));var _0x01ce=function(_0x570016,_0x111cb9){_0x570016=_0x570016-0x0;var _0x3b4176=_0x1ce0[_0x570016];return _0x3b4176;};'use strict';var express=require('express');var router=express[_0x01ce('0x0')]();var auth=require(_0x01ce('0x1'));var controller=require('./user-setting.controller');router[_0x01ce('0x2')](_0x01ce('0x3'),auth[_0x01ce('0x4')](),controller[_0x01ce('0x5')]);module['exports']=router; \ No newline at end of file +var _0xa427=['./user-setting.controller','/:id','update','exports','express','Router'];(function(_0x32da24,_0x4a85e4){var _0x333b00=function(_0x31bf91){while(--_0x31bf91){_0x32da24['push'](_0x32da24['shift']());}};_0x333b00(++_0x4a85e4);}(_0xa427,0x154));var _0x7a42=function(_0x4387ab,_0x4ac0bd){_0x4387ab=_0x4387ab-0x0;var _0x11dde3=_0xa427[_0x4387ab];return _0x11dde3;};'use strict';var express=require(_0x7a42('0x0'));var router=express[_0x7a42('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x7a42('0x2'));router['put'](_0x7a42('0x3'),auth['isAuthenticated'](),controller[_0x7a42('0x4')]);module[_0x7a42('0x5')]=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 c897ede..073b95c 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 _0x644f=['sequelize','error','info','debug','exports','ENUM','BOOLEAN','TEXT','DATE','INTEGER','UserId'];(function(_0x50d960,_0x511eeb){var _0x46bffa=function(_0x2b1d65){while(--_0x2b1d65){_0x50d960['push'](_0x50d960['shift']());}};_0x46bffa(++_0x511eeb);}(_0x644f,0x13f));var _0xf644=function(_0x17a32f,_0x5a51a){_0x17a32f=_0x17a32f-0x0;var _0x15a293=_0x644f[_0x17a32f];return _0x15a293;};'use strict';var Sequelize=require(_0xf644('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xf644('0x1'),'warning',_0xf644('0x2'),_0xf644('0x3')];module[_0xf644('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0xf644('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xf644('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xf644('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xf644('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xf644('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xf644('0x9')],'unique':_0xf644('0xa')}}; \ No newline at end of file +var _0xcfd9=['error','BOOLEAN','INTEGER','UserId','sequelize','warning','info','debug','exports'];(function(_0x5539b3,_0x3dba3d){var _0x4c1327=function(_0x5036d6){while(--_0x5036d6){_0x5539b3['push'](_0x5539b3['shift']());}};_0x4c1327(++_0x3dba3d);}(_0xcfd9,0x13f));var _0x9cfd=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xcfd9[_0x243b59];return _0x3e1676;};'use strict';var Sequelize=require(_0x9cfd('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0x9cfd('0x1'),_0x9cfd('0x2'),_0x9cfd('0x3')];module[_0x9cfd('0x4')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x9cfd('0x5'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x9cfd('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x9cfd('0x7')],'unique':_0x9cfd('0x8')}}; \ 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 619608e..08d16cf 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 _0x9b67=['redis','defaults','localhost','json','update','then','sendStatus','error','stack','name','status','send','user','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','lodash','ioredis','../../config/logger','api','../../config/environment','socket.io-emitter'];(function(_0x3f6f5b,_0x3624eb){var _0x2973a5=function(_0x2e9e3f){while(--_0x2e9e3f){_0x3f6f5b['push'](_0x3f6f5b['shift']());}};_0x2973a5(++_0x3624eb);}(_0x9b67,0xf6));var _0x79b6=function(_0x5872b2,_0x20631c){_0x5872b2=_0x5872b2-0x0;var _0x66952e=_0x9b67[_0x5872b2];return _0x66952e;};'use strict';var _=require(_0x79b6('0x0'));var Redis=require(_0x79b6('0x1'));var logger=require(_0x79b6('0x2'))(_0x79b6('0x3'));var config=require(_0x79b6('0x4'));var db=require('../../mysqldb')['db'];var socket=require(_0x79b6('0x5'))(new Redis(config[_0x79b6('0x6')]));require('./user-setting.socket')['register'](socket);config[_0x79b6('0x6')]=_[_0x79b6('0x7')](config[_0x79b6('0x6')],{'host':_0x79b6('0x8'),'port':0x18eb});function respondWithResult(_0xfa6a05,_0x128543){_0x128543=_0x128543||0xc8;return function(_0x34adbe){if(_0x34adbe){return _0xfa6a05['status'](_0x128543)[_0x79b6('0x9')](_0x34adbe);}};}function saveUpdates(_0x107e4b){return function(_0x233d31){if(_0x233d31){return _0x233d31[_0x79b6('0xa')](_0x107e4b)[_0x79b6('0xb')](function(_0x52600c){return _0x52600c;});}return null;};}function handleEntityNotFound(_0x3dd86d){return function(_0x380b39){if(!_0x380b39){_0x3dd86d[_0x79b6('0xc')](0x194);}return _0x380b39;};}function handleError(_0x301f13,_0x58a98b){_0x58a98b=_0x58a98b||0x1f4;return function(_0x566c99){logger[_0x79b6('0xd')](_0x566c99[_0x79b6('0xe')]);if(_0x566c99[_0x79b6('0xf')]){delete _0x566c99['name'];}_0x301f13[_0x79b6('0x10')](_0x58a98b)[_0x79b6('0x11')](_0x566c99);};}exports[_0x79b6('0xa')]=function(_0x70886c,_0x3b0721){if(_0x70886c[_0x79b6('0x12')][_0x79b6('0x13')]!==_0x79b6('0x14'))throw new Error(_0x79b6('0x15'));if(isNaN(Number(_0x70886c[_0x79b6('0x16')]['id'])))throw new Error(_0x79b6('0x17'));return db[_0x79b6('0x18')][_0x79b6('0x19')]({'where':{'id':_0x70886c['params']['id']}})[_0x79b6('0xb')](handleEntityNotFound(_0x3b0721,null))[_0x79b6('0xb')](saveUpdates(_0x70886c[_0x79b6('0x1a')],null))[_0x79b6('0xb')](respondWithResult(_0x3b0721,null))[_0x79b6('0x1b')](handleError(_0x3b0721,null));}; \ No newline at end of file +var _0xe148=['../../config/environment','socket.io-emitter','redis','./user-setting.socket','register','localhost','status','json','then','error','stack','name','update','user','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','catch','lodash','ioredis','api'];(function(_0x74ab89,_0x4595bf){var _0x51d309=function(_0x1c3865){while(--_0x1c3865){_0x74ab89['push'](_0x74ab89['shift']());}};_0x51d309(++_0x4595bf);}(_0xe148,0x9e));var _0x8e14=function(_0x479650,_0x2bee99){_0x479650=_0x479650-0x0;var _0x26b288=_0xe148[_0x479650];return _0x26b288;};'use strict';var _=require(_0x8e14('0x0'));var Redis=require(_0x8e14('0x1'));var logger=require('../../config/logger')(_0x8e14('0x2'));var config=require(_0x8e14('0x3'));var db=require('../../mysqldb')['db'];var socket=require(_0x8e14('0x4'))(new Redis(config[_0x8e14('0x5')]));require(_0x8e14('0x6'))[_0x8e14('0x7')](socket);config['redis']=_['defaults'](config[_0x8e14('0x5')],{'host':_0x8e14('0x8'),'port':0x18eb});function respondWithResult(_0x5d5232,_0x1a8608){_0x1a8608=_0x1a8608||0xc8;return function(_0x231d97){if(_0x231d97){return _0x5d5232[_0x8e14('0x9')](_0x1a8608)[_0x8e14('0xa')](_0x231d97);}};}function saveUpdates(_0x57b082){return function(_0x1aaba9){if(_0x1aaba9){return _0x1aaba9['update'](_0x57b082)[_0x8e14('0xb')](function(_0x2587a1){return _0x2587a1;});}return null;};}function handleEntityNotFound(_0x491a46){return function(_0x9a0381){if(!_0x9a0381){_0x491a46['sendStatus'](0x194);}return _0x9a0381;};}function handleError(_0x4792a0,_0x197f35){_0x197f35=_0x197f35||0x1f4;return function(_0x48554a){logger[_0x8e14('0xc')](_0x48554a[_0x8e14('0xd')]);if(_0x48554a['name']){delete _0x48554a[_0x8e14('0xe')];}_0x4792a0['status'](_0x197f35)['send'](_0x48554a);};}exports[_0x8e14('0xf')]=function(_0x5d85ce,_0x29a2b4){if(_0x5d85ce[_0x8e14('0x10')]['role']!=='admin')throw new Error(_0x8e14('0x11'));if(isNaN(Number(_0x5d85ce[_0x8e14('0x12')]['id'])))throw new Error(_0x8e14('0x13'));return db[_0x8e14('0x14')][_0x8e14('0x15')]({'where':{'id':_0x5d85ce['params']['id']}})[_0x8e14('0xb')](handleEntityNotFound(_0x29a2b4,null))[_0x8e14('0xb')](saveUpdates(_0x5d85ce['body'],null))[_0x8e14('0xb')](respondWithResult(_0x29a2b4,null))[_0x8e14('0x16')](handleError(_0x29a2b4,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 f3fc5cd..fa705ff 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 _0x9d76=['remove','emit','hook','../../mysqldb','setMaxListeners','save','update'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x9d76,0x13e));var _0x69d7=function(_0x5b6b6b,_0x37414d){_0x5b6b6b=_0x5b6b6b-0x0;var _0x27b464=_0x9d76[_0x5b6b6b];return _0x27b464;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x69d7('0x0'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x69d7('0x1')](0x0);var events={'afterCreate':_0x69d7('0x2'),'afterUpdate':_0x69d7('0x3'),'afterDestroy':_0x69d7('0x4')};function emitEvent(_0x3cc11d){return function(_0x4f138c,_0x1bdef9,_0x4b31b0){UserSettingEvents[_0x69d7('0x5')](_0x3cc11d+':'+_0x4f138c['id'],_0x4f138c);UserSettingEvents[_0x69d7('0x5')](_0x3cc11d,_0x4f138c);_0x4b31b0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0x69d7('0x6')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file +var _0xeb61=['setMaxListeners','save','update','emit','hook','events','../../mysqldb','UserSetting'];(function(_0x52f4d6,_0x2f4818){var _0xaa4059=function(_0x1ecfb3){while(--_0x1ecfb3){_0x52f4d6['push'](_0x52f4d6['shift']());}};_0xaa4059(++_0x2f4818);}(_0xeb61,0x8d));var _0x1eb6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeb61[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x1eb6('0x0'));var UserSetting=require(_0x1eb6('0x1'))['db'][_0x1eb6('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x1eb6('0x3')](0x0);var events={'afterCreate':_0x1eb6('0x4'),'afterUpdate':_0x1eb6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x278838){return function(_0x9d1a54,_0x56c35f,_0x3051e6){UserSettingEvents[_0x1eb6('0x6')](_0x278838+':'+_0x9d1a54['id'],_0x9d1a54);UserSettingEvents[_0x1eb6('0x6')](_0x278838,_0x9d1a54);_0x3051e6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0x1eb6('0x7')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 8e8f88f..0ff6a2f 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 _0xc686=['clientSideLoggingEnabledSince','UserSetting','clientSideLoggingEnabled'];(function(_0x401d62,_0xcde1c3){var _0x3617d9=function(_0x4bc135){while(--_0x4bc135){_0x401d62['push'](_0x401d62['shift']());}};_0x3617d9(++_0xcde1c3);}(_0xc686,0x148));var _0x6c68=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xc686[_0x5c351c];return _0x26f3b3;};'use strict';var attributes=require('./user-setting.attributes');module['exports']=function(_0x2c78d4){return _0x2c78d4['define'](_0x6c68('0x0'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1f6b6d){if(!_0x1f6b6d[_0x6c68('0x1')])_0x1f6b6d[_0x6c68('0x2')]=null;else if(_0x1f6b6d[_0x6c68('0x2')]===null)_0x1f6b6d[_0x6c68('0x2')]=new Date();}}});}; \ No newline at end of file +var _0xa7fa=['user_settings','clientSideLoggingEnabledSince','./user-setting.attributes','define','UserSetting'];(function(_0x4cbe50,_0x709c83){var _0x12c686=function(_0x343f12){while(--_0x343f12){_0x4cbe50['push'](_0x4cbe50['shift']());}};_0x12c686(++_0x709c83);}(_0xa7fa,0xfc));var _0xaa7f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa7fa[_0x14add3];return _0x4a174f;};'use strict';var attributes=require(_0xaa7f('0x0'));module['exports']=function(_0x5f4cc1){return _0x5f4cc1[_0xaa7f('0x1')](_0xaa7f('0x2'),attributes,{'tableName':_0xaa7f('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x236e94){if(!_0x236e94['clientSideLoggingEnabled'])_0x236e94[_0xaa7f('0x4')]=null;else if(_0x236e94[_0xaa7f('0x4')]===null)_0x236e94[_0xaa7f('0x4')]=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 bd3624d..f10a789 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 _0x0bc2=['update','emit','user-setting:update','UserId','register','length','user-setting:','./user-setting.events','save'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x0bc2,0xf1));var _0x20bc=function(_0xe4973b,_0x5a7662){_0xe4973b=_0xe4973b-0x0;var _0x2bcc9f=_0x0bc2[_0xe4973b];return _0x2bcc9f;};'use strict';var UserSettingEvents=require(_0x20bc('0x0'));var events=[_0x20bc('0x1'),'remove',_0x20bc('0x2')];function createListener(_0x46807a,_0x571355){return function(_0x77fa1a){_0x571355[_0x20bc('0x3')](_0x46807a,_0x77fa1a);if(_0x46807a===_0x20bc('0x4')){_0x571355[_0x20bc('0x3')]('user-setting:update:user-'+_0x77fa1a[_0x20bc('0x5')],_0x77fa1a);}};}exports[_0x20bc('0x6')]=function(_0x4a86e1){for(var _0x232ebb=0x0,_0x36af61=events[_0x20bc('0x7')];_0x232ebb<_0x36af61;_0x232ebb++){var _0xc47616=events[_0x232ebb];var _0x171840=createListener(_0x20bc('0x8')+_0xc47616,_0x4a86e1);UserSettingEvents['on'](_0xc47616,_0x171840);}}; \ No newline at end of file +var _0xe49d=['user-setting:update:user-','UserId','length','user-setting:','save','remove','update','emit','user-setting:update'];(function(_0x199c5e,_0x3aefcb){var _0xac1328=function(_0x1013de){while(--_0x1013de){_0x199c5e['push'](_0x199c5e['shift']());}};_0xac1328(++_0x3aefcb);}(_0xe49d,0x9d));var _0xde49=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe49d[_0x321bb2];return _0x9c12ed;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0xde49('0x0'),_0xde49('0x1'),_0xde49('0x2')];function createListener(_0x276ccf,_0x385c86){return function(_0x6d1825){_0x385c86[_0xde49('0x3')](_0x276ccf,_0x6d1825);if(_0x276ccf===_0xde49('0x4')){_0x385c86[_0xde49('0x3')](_0xde49('0x5')+_0x6d1825[_0xde49('0x6')],_0x6d1825);}};}exports['register']=function(_0x311f55){for(var _0x4031cf=0x0,_0x6f2650=events[_0xde49('0x7')];_0x4031cf<_0x6f2650;_0x4031cf++){var _0x5656eb=events[_0x4031cf];var _0x1fb83e=createListener(_0xde49('0x8')+_0x5656eb,_0x311f55);UserSettingEvents['on'](_0x5656eb,_0x1fb83e);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 36b0b2d..8483170 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 _0x6e52=['root','format','file','addAvatar','/:id/login','login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','addSquareProjects','/:id/api_key','createApiKey','put','/:id/password','changePassword','delete','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeFaxInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','/describe','/whoami','whoami','/presence','getPresence','/:id','show','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','addContacts','create','bulkCreate','addQueues','diskStorage'];(function(_0x1cfc65,_0x2d5e45){var _0x5b7296=function(_0x470d52){while(--_0x470d52){_0x1cfc65['push'](_0x1cfc65['shift']());}};_0x5b7296(++_0x2d5e45);}(_0x6e52,0x9e));var _0x26e5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6e52[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x26e5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x26e5('0x1'));var express=require('express');var router=express[_0x26e5('0x2')]();var fs_extra=require(_0x26e5('0x3'));var auth=require(_0x26e5('0x4'));var interaction=require(_0x26e5('0x5'));var config=require(_0x26e5('0x6'));var controller=require(_0x26e5('0x7'));router[_0x26e5('0x8')]('/',auth[_0x26e5('0x9')](),controller['index']);router[_0x26e5('0x8')](_0x26e5('0xa'),auth[_0x26e5('0x9')](),controller['describe']);router[_0x26e5('0x8')](_0x26e5('0xb'),auth[_0x26e5('0x9')](),controller[_0x26e5('0xc')]);router[_0x26e5('0x8')](_0x26e5('0xd'),auth[_0x26e5('0x9')](),controller[_0x26e5('0xe')]);router[_0x26e5('0x8')](_0x26e5('0xf'),auth[_0x26e5('0x9')](),controller[_0x26e5('0x10')]);router[_0x26e5('0x8')]('/:id/avatar',controller[_0x26e5('0x11')]);router[_0x26e5('0x8')](_0x26e5('0x12'),auth[_0x26e5('0x9')](),controller[_0x26e5('0x13')]);router['get'](_0x26e5('0x14'),auth['isAuthenticated'](),controller[_0x26e5('0x15')]);router[_0x26e5('0x8')](_0x26e5('0x16'),auth[_0x26e5('0x9')](),controller['getQueues']);router[_0x26e5('0x8')]('/:id/queues_rt',auth[_0x26e5('0x9')](),controller[_0x26e5('0x17')]);router['get'](_0x26e5('0x18'),auth['isAuthenticated'](),controller[_0x26e5('0x19')]);router[_0x26e5('0x8')](_0x26e5('0x1a'),auth[_0x26e5('0x9')](),controller[_0x26e5('0x1b')]);router[_0x26e5('0x8')]('/:id/screen_recordings',auth['isAuthenticated'](),controller[_0x26e5('0x1c')]);router[_0x26e5('0x8')]('/:id/chat/interactions',auth[_0x26e5('0x9')](),controller['getChatInteractions']);router[_0x26e5('0x8')](_0x26e5('0x1d'),auth[_0x26e5('0x9')](),controller['getOpenchannelInteractions']);router[_0x26e5('0x8')](_0x26e5('0x1e'),auth[_0x26e5('0x9')](),controller[_0x26e5('0x1f')]);router['get'](_0x26e5('0x20'),auth[_0x26e5('0x9')](),controller[_0x26e5('0x21')]);router['get']('/:id/fax/interactions',auth[_0x26e5('0x9')](),controller['getFaxInteractions']);router[_0x26e5('0x8')](_0x26e5('0x22'),auth[_0x26e5('0x9')](),controller[_0x26e5('0x23')]);router[_0x26e5('0x8')](_0x26e5('0x24'),auth[_0x26e5('0x9')](),controller['getTeams']);router[_0x26e5('0x8')](_0x26e5('0x25'),auth[_0x26e5('0x9')](),controller[_0x26e5('0x26')]);router[_0x26e5('0x8')](_0x26e5('0x27'),auth[_0x26e5('0x9')](),controller[_0x26e5('0x28')]);router[_0x26e5('0x8')](_0x26e5('0x29'),auth[_0x26e5('0x9')](),controller['getVoicePrefixes']);router[_0x26e5('0x8')](_0x26e5('0x2a'),auth[_0x26e5('0x9')](),controller[_0x26e5('0x2b')]);router['get'](_0x26e5('0x2c'),auth[_0x26e5('0x9')](),controller[_0x26e5('0x2d')]);router[_0x26e5('0x8')]('/:id/openchannel_accounts',auth[_0x26e5('0x9')](),controller[_0x26e5('0x2e')]);router[_0x26e5('0x8')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x26e5('0x2f')]);router[_0x26e5('0x8')](_0x26e5('0x30'),auth['isAuthenticated'](),controller[_0x26e5('0x31')]);router[_0x26e5('0x8')]('/:id/whatsapp_accounts',auth[_0x26e5('0x9')](),controller[_0x26e5('0x32')]);router[_0x26e5('0x8')](_0x26e5('0x33'),auth['isAuthenticated'](),controller[_0x26e5('0x34')]);router[_0x26e5('0x8')](_0x26e5('0x35'),auth[_0x26e5('0x9')](),controller[_0x26e5('0x36')]);router[_0x26e5('0x8')]('/:id/api_key',auth[_0x26e5('0x9')](),controller[_0x26e5('0x37')]);router[_0x26e5('0x38')](_0x26e5('0x14'),auth[_0x26e5('0x9')](),controller[_0x26e5('0x39')]);router['post']('/',auth[_0x26e5('0x9')](),controller[_0x26e5('0x3a')]);router['post']('/create_many',auth[_0x26e5('0x9')](),controller[_0x26e5('0x3b')]);router['post']('/:id/queues',auth['isAuthenticated'](),controller[_0x26e5('0x3c')]);var upload=multer({'storage':multer[_0x26e5('0x3d')]({'destination':function(_0x540f19,_0x4bfc52,_0x5b4559){_0x5b4559(null,path['join'](config[_0x26e5('0x3e')],'server/files/images/'));},'filename':function(_0x3dda73,_0x5ad663,_0x91980c){_0x91980c(null,util[_0x26e5('0x3f')]('%s-%s',Date['now'](),_0x5ad663['originalname']));}})});router['post']('/:id/avatar',upload['single'](_0x26e5('0x40')),controller[_0x26e5('0x41')]);router[_0x26e5('0x38')](_0x26e5('0x42'),auth[_0x26e5('0x9')](),controller[_0x26e5('0x43')]);router[_0x26e5('0x38')](_0x26e5('0x44'),auth[_0x26e5('0x9')](),controller['logout']);router['post'](_0x26e5('0x45'),auth['isAuthenticated'](),controller[_0x26e5('0x46')]);router[_0x26e5('0x38')](_0x26e5('0x47'),auth['isAuthenticated'](),controller[_0x26e5('0x48')]);router[_0x26e5('0x38')](_0x26e5('0x24'),auth[_0x26e5('0x9')](),controller[_0x26e5('0x49')]);router[_0x26e5('0x38')]('/:id/chat_interactions',auth[_0x26e5('0x9')](),controller[_0x26e5('0x4a')]);router[_0x26e5('0x38')](_0x26e5('0x4b'),auth[_0x26e5('0x9')](),controller[_0x26e5('0x4c')]);router[_0x26e5('0x38')]('/:id/fax_interactions',auth[_0x26e5('0x9')](),controller[_0x26e5('0x4d')]);router[_0x26e5('0x38')](_0x26e5('0x4e'),auth[_0x26e5('0x9')](),controller[_0x26e5('0x4f')]);router[_0x26e5('0x38')]('/:id/openchannel_interactions',auth[_0x26e5('0x9')](),controller[_0x26e5('0x50')]);router[_0x26e5('0x38')](_0x26e5('0x51'),auth[_0x26e5('0x9')](),controller['addWhatsappInteractions']);router['post']('/:id/fax_accounts',auth['isAuthenticated'](),controller['addFaxAccounts']);router['post'](_0x26e5('0x2c'),auth[_0x26e5('0x9')](),controller[_0x26e5('0x52')]);router[_0x26e5('0x38')](_0x26e5('0x53'),auth[_0x26e5('0x9')](),controller['addOpenchannelAccounts']);router['post'](_0x26e5('0x54'),auth[_0x26e5('0x9')](),controller[_0x26e5('0x55')]);router[_0x26e5('0x38')](_0x26e5('0x30'),auth[_0x26e5('0x9')](),controller[_0x26e5('0x56')]);router[_0x26e5('0x38')](_0x26e5('0x57'),auth[_0x26e5('0x9')](),controller['addWhatsappAccounts']);router[_0x26e5('0x38')](_0x26e5('0x33'),auth[_0x26e5('0x9')](),controller[_0x26e5('0x58')]);router[_0x26e5('0x38')](_0x26e5('0x59'),auth[_0x26e5('0x9')](),controller[_0x26e5('0x5a')]);router[_0x26e5('0x5b')](_0x26e5('0xf'),auth[_0x26e5('0x9')](),controller['update']);router['put'](_0x26e5('0x5c'),auth['isAuthenticated'](),controller[_0x26e5('0x5d')]);router[_0x26e5('0x5e')]('/:id/queues',auth[_0x26e5('0x9')](),controller['removeQueues']);router['delete'](_0x26e5('0x24'),auth['isAuthenticated'](),controller[_0x26e5('0x5f')]);router[_0x26e5('0x5e')](_0x26e5('0xf'),auth[_0x26e5('0x9')](),controller[_0x26e5('0x60')]);router['delete'](_0x26e5('0x61'),auth[_0x26e5('0x9')](),controller[_0x26e5('0x62')]);router[_0x26e5('0x5e')](_0x26e5('0x4b'),auth[_0x26e5('0x9')](),controller['removeMailInteractions']);router[_0x26e5('0x5e')]('/:id/fax_interactions',auth[_0x26e5('0x9')](),controller[_0x26e5('0x63')]);router['delete'](_0x26e5('0x4e'),auth[_0x26e5('0x9')](),controller[_0x26e5('0x64')]);router[_0x26e5('0x5e')](_0x26e5('0x65'),auth['isAuthenticated'](),controller[_0x26e5('0x66')]);router[_0x26e5('0x5e')](_0x26e5('0x51'),auth[_0x26e5('0x9')](),controller['removeWhatsappInteractions']);router[_0x26e5('0x5e')](_0x26e5('0x2a'),auth['isAuthenticated'](),controller[_0x26e5('0x67')]);router['delete'](_0x26e5('0x2c'),auth[_0x26e5('0x9')](),controller['removeMailAccounts']);router['delete'](_0x26e5('0x53'),auth[_0x26e5('0x9')](),controller[_0x26e5('0x68')]);router[_0x26e5('0x5e')]('/:id/sms_accounts',auth[_0x26e5('0x9')](),controller[_0x26e5('0x69')]);router[_0x26e5('0x5e')](_0x26e5('0x30'),auth[_0x26e5('0x9')](),controller[_0x26e5('0x6a')]);router[_0x26e5('0x5e')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x26e5('0x6b')]);router[_0x26e5('0x5e')](_0x26e5('0x33'),auth[_0x26e5('0x9')](),controller['removeSquareProjects']);router[_0x26e5('0x5e')]('/:id/api_key',auth[_0x26e5('0x9')](),controller[_0x26e5('0x6c')]);module[_0x26e5('0x6d')]=router; \ No newline at end of file +var _0xc396=['originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','pause','/:id/unpause','unpause','/:id/teams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','addWhatsappAccounts','addSquareProjects','/:id/api_key','createApiKey','put','changePassword','delete','removeQueues','removeTeams','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','/:id/fax_accounts','removeFaxAccounts','removeMailAccounts','/:id/sms_accounts','removeChatWebsites','removeWhatsappAccounts','/:id/square_projects','removeSquareProjects','removeApiKey','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','./user.controller','isAuthenticated','index','get','describe','/whoami','whoami','/presence','getPresence','/:id','/:id/open_tabs','getOpenTabs','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','getTeams','/:id/lists','getLists','/:id/agents','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','/:id/contacts','addContacts','create','bulkCreate','addQueues','join','root','server/files/images/','now'];(function(_0x4aed69,_0x2719c9){var _0x360b9c=function(_0x221b52){while(--_0x221b52){_0x4aed69['push'](_0x4aed69['shift']());}};_0x360b9c(++_0x2719c9);}(_0xc396,0x18e));var _0x6c39=function(_0x14dc50,_0x21c3a0){_0x14dc50=_0x14dc50-0x0;var _0xdc374c=_0xc396[_0x14dc50];return _0xdc374c;};'use strict';var multer=require(_0x6c39('0x0'));var util=require(_0x6c39('0x1'));var path=require(_0x6c39('0x2'));var timeout=require(_0x6c39('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6c39('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6c39('0x5'));var config=require('../../config/environment');var controller=require(_0x6c39('0x6'));router['get']('/',auth[_0x6c39('0x7')](),controller[_0x6c39('0x8')]);router[_0x6c39('0x9')]('/describe',auth[_0x6c39('0x7')](),controller[_0x6c39('0xa')]);router[_0x6c39('0x9')](_0x6c39('0xb'),auth[_0x6c39('0x7')](),controller[_0x6c39('0xc')]);router[_0x6c39('0x9')](_0x6c39('0xd'),auth[_0x6c39('0x7')](),controller[_0x6c39('0xe')]);router[_0x6c39('0x9')](_0x6c39('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x6c39('0x9')]('/:id/avatar',controller['getAvatar']);router[_0x6c39('0x9')](_0x6c39('0x10'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x11')]);router['get']('/:id/contacts',auth[_0x6c39('0x7')](),controller['getContacts']);router[_0x6c39('0x9')](_0x6c39('0x12'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x13')]);router[_0x6c39('0x9')](_0x6c39('0x14'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x15')]);router[_0x6c39('0x9')](_0x6c39('0x16'),auth[_0x6c39('0x7')](),controller['getGroups']);router['get']('/:id/recordings',auth[_0x6c39('0x7')](),controller[_0x6c39('0x17')]);router['get']('/:id/screen_recordings',auth[_0x6c39('0x7')](),controller['getScreenRecordings']);router[_0x6c39('0x9')](_0x6c39('0x18'),auth[_0x6c39('0x7')](),controller['getChatInteractions']);router[_0x6c39('0x9')](_0x6c39('0x19'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x1a')]);router[_0x6c39('0x9')](_0x6c39('0x1b'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x1c')]);router['get']('/:id/sms/interactions',auth['isAuthenticated'](),controller[_0x6c39('0x1d')]);router[_0x6c39('0x9')](_0x6c39('0x1e'),auth['isAuthenticated'](),controller[_0x6c39('0x1f')]);router['get'](_0x6c39('0x20'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x21')]);router['get']('/:id/teams',auth[_0x6c39('0x7')](),controller[_0x6c39('0x22')]);router[_0x6c39('0x9')](_0x6c39('0x23'),auth['isAuthenticated'](),controller[_0x6c39('0x24')]);router[_0x6c39('0x9')](_0x6c39('0x25'),auth['isAuthenticated'](),controller['getAgents']);router[_0x6c39('0x9')]('/:id/prefixes',auth[_0x6c39('0x7')](),controller[_0x6c39('0x26')]);router[_0x6c39('0x9')]('/:id/fax_accounts',auth[_0x6c39('0x7')](),controller[_0x6c39('0x27')]);router[_0x6c39('0x9')](_0x6c39('0x28'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x29')]);router[_0x6c39('0x9')](_0x6c39('0x2a'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x2b')]);router['get']('/:id/sms_accounts',auth[_0x6c39('0x7')](),controller[_0x6c39('0x2c')]);router[_0x6c39('0x9')]('/:id/chat_websites',auth[_0x6c39('0x7')](),controller[_0x6c39('0x2d')]);router[_0x6c39('0x9')](_0x6c39('0x2e'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x2f')]);router[_0x6c39('0x9')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0x6c39('0x30')]);router[_0x6c39('0x9')](_0x6c39('0x31'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x32')]);router[_0x6c39('0x9')]('/:id/api_key',auth[_0x6c39('0x7')](),controller[_0x6c39('0x33')]);router[_0x6c39('0x34')](_0x6c39('0x35'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x36')]);router[_0x6c39('0x34')]('/',auth['isAuthenticated'](),controller[_0x6c39('0x37')]);router['post']('/create_many',auth[_0x6c39('0x7')](),controller[_0x6c39('0x38')]);router[_0x6c39('0x34')](_0x6c39('0x12'),auth['isAuthenticated'](),controller[_0x6c39('0x39')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x30b7d4,_0x17ae1f,_0x4a33ad){_0x4a33ad(null,path[_0x6c39('0x3a')](config[_0x6c39('0x3b')],_0x6c39('0x3c')));},'filename':function(_0x1256a2,_0x377f81,_0x3e5191){_0x3e5191(null,util['format']('%s-%s',Date[_0x6c39('0x3d')](),_0x377f81[_0x6c39('0x3e')]));}})});router[_0x6c39('0x34')]('/:id/avatar',upload[_0x6c39('0x3f')](_0x6c39('0x40')),controller[_0x6c39('0x41')]);router[_0x6c39('0x34')](_0x6c39('0x42'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x43')]);router[_0x6c39('0x34')](_0x6c39('0x44'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x45')]);router[_0x6c39('0x34')]('/:id/pause',auth['isAuthenticated'](),controller[_0x6c39('0x46')]);router['post'](_0x6c39('0x47'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x48')]);router[_0x6c39('0x34')](_0x6c39('0x49'),auth[_0x6c39('0x7')](),controller['addTeams']);router[_0x6c39('0x34')](_0x6c39('0x4a'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x4b')]);router[_0x6c39('0x34')](_0x6c39('0x4c'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x4d')]);router[_0x6c39('0x34')](_0x6c39('0x4e'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x4f')]);router[_0x6c39('0x34')](_0x6c39('0x50'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x51')]);router['post'](_0x6c39('0x52'),auth['isAuthenticated'](),controller[_0x6c39('0x53')]);router[_0x6c39('0x34')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller[_0x6c39('0x54')]);router[_0x6c39('0x34')]('/:id/fax_accounts',auth[_0x6c39('0x7')](),controller[_0x6c39('0x55')]);router['post'](_0x6c39('0x28'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x56')]);router['post'](_0x6c39('0x2a'),auth['isAuthenticated'](),controller[_0x6c39('0x57')]);router['post']('/:id/sms_accounts',auth[_0x6c39('0x7')](),controller[_0x6c39('0x58')]);router[_0x6c39('0x34')](_0x6c39('0x59'),auth['isAuthenticated'](),controller[_0x6c39('0x5a')]);router['post'](_0x6c39('0x2e'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x5b')]);router[_0x6c39('0x34')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0x6c39('0x5c')]);router['post'](_0x6c39('0x5d'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x5e')]);router[_0x6c39('0x5f')]('/:id',auth[_0x6c39('0x7')](),controller['update']);router[_0x6c39('0x5f')]('/:id/password',auth['isAuthenticated'](),controller[_0x6c39('0x60')]);router[_0x6c39('0x61')](_0x6c39('0x12'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x62')]);router[_0x6c39('0x61')](_0x6c39('0x49'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x63')]);router[_0x6c39('0x61')]('/:id',auth[_0x6c39('0x7')](),controller['destroy']);router[_0x6c39('0x61')](_0x6c39('0x4a'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x64')]);router['delete'](_0x6c39('0x4c'),auth['isAuthenticated'](),controller[_0x6c39('0x65')]);router[_0x6c39('0x61')](_0x6c39('0x4e'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x66')]);router[_0x6c39('0x61')](_0x6c39('0x50'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x67')]);router[_0x6c39('0x61')](_0x6c39('0x52'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x68')]);router[_0x6c39('0x61')](_0x6c39('0x69'),auth[_0x6c39('0x7')](),controller['removeWhatsappInteractions']);router[_0x6c39('0x61')](_0x6c39('0x6a'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x6b')]);router[_0x6c39('0x61')](_0x6c39('0x28'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x6c')]);router[_0x6c39('0x61')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller['removeOpenchannelAccounts']);router[_0x6c39('0x61')](_0x6c39('0x6d'),auth[_0x6c39('0x7')](),controller['removeSmsAccounts']);router['delete'](_0x6c39('0x59'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x6e')]);router[_0x6c39('0x61')](_0x6c39('0x2e'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x6f')]);router[_0x6c39('0x61')](_0x6c39('0x70'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x71')]);router[_0x6c39('0x61')](_0x6c39('0x5d'),auth[_0x6c39('0x7')](),controller[_0x6c39('0x72')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index ad9fa71..2a33503 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 _0xedd9=['rfc2833','info','shortinfo','inband','auto','yes','update','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','originate','uas','certificate','active','passive','actpass','nonat','update,nonat','DATE','showWebBar','get','isArray','wss','encryption','force_avp','icesupport','dtlsverify','rtcp_mux','dtlsenable','dtlssetup','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','\x22%s\x22\x20<%s>','internal','email','ENUM','admin','user','agent','telephone','local','accountcode','getDataValue','fullname','BOOLEAN','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'];(function(_0x20a1aa,_0x16c1a8){var _0x33d371=function(_0x110c20){while(--_0x110c20){_0x20a1aa['push'](_0x20a1aa['shift']());}};_0x33d371(++_0x16c1a8);}(_0xedd9,0xfc));var _0x9edd=function(_0x537c57,_0x331c56){_0x537c57=_0x537c57-0x0;var _0x1e69fc=_0xedd9[_0x537c57];return _0x1e69fc;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9edd('0x0'));var util=require(_0x9edd('0x1'));var _=require(_0x9edd('0x2'));module[_0x9edd('0x3')]={'name':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'unique':_0x9edd('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3e6d3a){this[_0x9edd('0x6')]('name',_0x3e6d3a);this[_0x9edd('0x6')](_0x9edd('0x7'),_0x3e6d3a);},'comment':_0x9edd('0x8')},'fullname':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'set':function(_0x5319f7){this[_0x9edd('0x6')]('fullname',_0x5319f7);this[_0x9edd('0x6')](_0x9edd('0x9'),util[_0x9edd('0xa')](_0x9edd('0xb'),_0x5319f7,this['getDataValue'](_0x9edd('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'unique':_0x9edd('0xd'),'validate':{'isEmail':!![]},'set':function(_0x523026){if(_0x523026){this[_0x9edd('0x6')](_0x9edd('0xd'),_0x523026['toLowerCase']());}}},'role':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0xf'),_0x9edd('0x10'),_0x9edd('0x11'),_0x9edd('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':_0x9edd('0x13')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x9edd('0xc'),'set':function(_0x44fc7c){this[_0x9edd('0x6')](_0x9edd('0xc'),_0x44fc7c);this[_0x9edd('0x6')](_0x9edd('0x14'),_0x44fc7c);this[_0x9edd('0x6')](_0x9edd('0x9'),util['format'](_0x9edd('0xb'),this[_0x9edd('0x15')](_0x9edd('0x16')),_0x44fc7c));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x9edd('0x4')]},'mobile':{'type':Sequelize[_0x9edd('0x4')]},'address':{'type':Sequelize[_0x9edd('0x4')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x9edd('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x9edd('0x4')]},'online':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x9edd('0x18')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x9edd('0x19')},'ipaddr':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x9edd('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x1a'),'user',_0x9edd('0x1b')),'allowNull':!![],'defaultValue':_0x9edd('0x1a')},'context':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':_0x9edd('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0x9edd('0x1d'),_0x9edd('0x1e'),_0x9edd('0x1f'),_0x9edd('0x20'),_0x9edd('0x21'),_0x9edd('0x22'),_0x9edd('0x23'),_0x9edd('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':_0x9edd('0x25'),'set':function(_0x5af178){this[_0x9edd('0x6')](_0x9edd('0x26'),_0x5af178?_0x5af178[_0x9edd('0x27')](','):null);},'get':function(){return this['getDataValue'](_0x9edd('0x26'))?this[_0x9edd('0x15')](_0x9edd('0x26'))[_0x9edd('0x28')](','):null;},'comment':_0x9edd('0x29')},'dtmfmode':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2a'),_0x9edd('0x2b'),_0x9edd('0x2c'),_0x9edd('0x2d'),_0x9edd('0x2e')),'allowNull':!![],'defaultValue':_0x9edd('0x2a')},'directmedia':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no','nonat',_0x9edd('0x30'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x6de835){this[_0x9edd('0x6')](_0x9edd('0x31'),_0x6de835?_0x6de835[_0x9edd('0x27')](','):null);},'get':function(){return this[_0x9edd('0x15')](_0x9edd('0x31'))?this[_0x9edd('0x15')](_0x9edd('0x31'))[_0x9edd('0x28')](','):null;},'comment':_0x9edd('0x32')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x9edd('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x9edd('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9edd('0x4')]},'disallow':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'defaultValue':_0x9edd('0x33')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9edd('0x34'),'set':function(_0xcbd0ef){this[_0x9edd('0x6')]('allow',_0xcbd0ef?_0xcbd0ef[_0x9edd('0x27')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x9edd('0x15')](_0x9edd('0x35'))?this['getDataValue'](_0x9edd('0x35'))[_0x9edd('0x28')](';'):null;},'comment':_0x9edd('0x36')},'autoframing':{'type':Sequelize[_0x9edd('0xe')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'set':function(_0x5bbdf8){this[_0x9edd('0x6')](_0x9edd('0x37'),_0x5bbdf8?_0x5bbdf8['join'](','):null);},'get':function(){return this[_0x9edd('0x15')]('insecure')?this['getDataValue'](_0x9edd('0x37'))[_0x9edd('0x28')](','):null;},'comment':_0x9edd('0x38')},'trustrpid':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no',_0x9edd('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':_0x9edd('0x3a')},'amaflags':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':_0x9edd('0x2f')},'busylevel':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no',_0x9edd('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x3c'),_0x9edd('0x3d'),_0x9edd('0x3e')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x9edd('0xe')]('uac',_0x9edd('0x3f')),'allowNull':!![],'defaultValue':_0x9edd('0x3f')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':_0x9edd('0x2f')},'keepalive':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no','fingerprint',_0x9edd('0x40')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x41'),_0x9edd('0x42'),_0x9edd('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x9edd('0xe')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no',_0x9edd('0x44'),_0x9edd('0x30'),_0x9edd('0x45')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x9edd('0x46')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0,'set':function(_0x3e9a3e){this[_0x9edd('0x6')](_0x9edd('0x47'),_0x3e9a3e);var _0x5df1d7=this[_0x9edd('0x48')]({'plain':!![]});switch(_0x3e9a3e){case 0x0:case 0x1:var _0x507cce=_0x5df1d7[_0x9edd('0x26')]?_[_0x9edd('0x49')](_0x5df1d7[_0x9edd('0x26')])?_0x5df1d7['transport'][_0x9edd('0x27')]():_0x5df1d7['transport']:_0x9edd('0x25');if(_0x507cce===_0x9edd('0x4a')){_0x507cce='udp';}this[_0x9edd('0x6')]('transport',_0x507cce);this[_0x9edd('0x6')](_0x9edd('0x4b'),'no');this[_0x9edd('0x6')]('avpf',null);this[_0x9edd('0x6')](_0x9edd('0x4c'),null);this[_0x9edd('0x6')](_0x9edd('0x4d'),null);this[_0x9edd('0x6')]('dtlsenable',null);this['setDataValue'](_0x9edd('0x4e'),null);this[_0x9edd('0x6')]('dtlssetup',null);this['setDataValue']('dtlscertfile',null);this[_0x9edd('0x6')]('dtlsprivatekey',null);this['setDataValue'](_0x9edd('0x4f'),'no');break;case 0x2:this[_0x9edd('0x6')]('transport',_0x9edd('0x4a'));this[_0x9edd('0x6')](_0x9edd('0x4b'),'yes');this[_0x9edd('0x6')]('avpf',_0x9edd('0x2f'));this[_0x9edd('0x6')]('force_avp',_0x9edd('0x2f'));this[_0x9edd('0x6')]('icesupport',_0x9edd('0x2f'));this[_0x9edd('0x6')](_0x9edd('0x50'),_0x9edd('0x2f'));this['setDataValue'](_0x9edd('0x4e'),'no');this['setDataValue'](_0x9edd('0x51'),_0x9edd('0x43'));this[_0x9edd('0x6')]('dtlscertfile',_0x5df1d7[_0x9edd('0x52')]||_0x9edd('0x53'));this[_0x9edd('0x6')](_0x9edd('0x54'),_0x5df1d7[_0x9edd('0x54')]||_0x9edd('0x55'));this[_0x9edd('0x6')]('rtcp_mux','yes');break;default:}}},'permissions':{'type':Sequelize[_0x9edd('0x56')],'set':function(_0x3c7874){this[_0x9edd('0x6')](_0x9edd('0x57'),_0x3c7874?_0x3c7874[_0x9edd('0x27')](','):[]);},'get':function(){return this['getDataValue'](_0x9edd('0x57'))?_[_0x9edd('0x58')](this[_0x9edd('0x15')]('permissions')[_0x9edd('0x28')](','),function(_0x29d70d){return parseInt(_0x29d70d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x9edd('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x9edd('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x9edd('0xe')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x9edd('0x4')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x9edd('0x59')],'get':function(){return this[_0x9edd('0x15')](_0x9edd('0x5a'))?this['getDataValue']('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![],'set':function(_0x1eabcd){if(typeof _0x1eabcd===_0x9edd('0x5b')){var _0xef1397=_0x1eabcd==='1'?!![]:_0x1eabcd==='0'?![]:_0x1eabcd==='true'?!![]:_0x1eabcd===_0x9edd('0x5c')?![]:![];this[_0x9edd('0x6')](_0x9edd('0x5d'),_0xef1397);}else{this[_0x9edd('0x6')](_0x9edd('0x5d'),_0x1eabcd);}}},'blocked':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![],'set':function(_0x14fa8a){this['setDataValue'](_0x9edd('0x5e'),_0x14fa8a);if(_0x14fa8a===!![]){this[_0x9edd('0x6')]('blockedAt',moment());this[_0x9edd('0x6')](_0x9edd('0x5f'),0x0);}else{this['setDataValue'](_0x9edd('0x60'),null);}}},'blockedAt':{'type':Sequelize[_0x9edd('0x46')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x9edd('0x18')](0x5)[_0x9edd('0x61')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0}}; \ No newline at end of file +var _0x70e0=['refuse','originate','uac','uas','fingerprint','update,nonat','TEXT','showWebBar','get','isArray','wss','udp','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','BOOLEAN','DATE','dynamic','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','join','transport','split','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','ulaw;alaw;gsm','allow','insecure','\x22\x22\x20<>','always','accept'];(function(_0x58304c,_0x3cd1cb){var _0x53944e=function(_0x47f632){while(--_0x47f632){_0x58304c['push'](_0x58304c['shift']());}};_0x53944e(++_0x3cd1cb);}(_0x70e0,0x17b));var _0x070e=function(_0x1d420b,_0x34528d){_0x1d420b=_0x1d420b-0x0;var _0x53bd4d=_0x70e0[_0x1d420b];return _0x53bd4d;};'use strict';var Sequelize=require(_0x070e('0x0'));var moment=require(_0x070e('0x1'));var util=require(_0x070e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'unique':_0x070e('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x277d32){this[_0x070e('0x5')]('name',_0x277d32);this[_0x070e('0x5')]('defaultuser',_0x277d32);},'comment':_0x070e('0x6')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x56e420){this['setDataValue'](_0x070e('0x7'),_0x56e420);this[_0x070e('0x5')](_0x070e('0x8'),util[_0x070e('0x9')](_0x070e('0xa'),_0x56e420,this[_0x070e('0xb')](_0x070e('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x070e('0xd'),'validate':{'isEmail':!![]},'set':function(_0x2e3e5e){if(_0x2e3e5e){this[_0x070e('0x5')](_0x070e('0xd'),_0x2e3e5e[_0x070e('0xe')]());}}},'role':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x10'),_0x070e('0x11'),_0x070e('0x12'),_0x070e('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':![],'unique':'internal','set':function(_0x4a33d2){this['setDataValue'](_0x070e('0xc'),_0x4a33d2);this[_0x070e('0x5')]('accountcode',_0x4a33d2);this['setDataValue'](_0x070e('0x8'),util[_0x070e('0x9')](_0x070e('0xa'),this[_0x070e('0xb')]('fullname'),_0x4a33d2));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x070e('0x3')]},'mobile':{'type':Sequelize[_0x070e('0x3')]},'address':{'type':Sequelize[_0x070e('0x3')]},'zipcode':{'type':Sequelize[_0x070e('0x3')]},'userpic':{'type':Sequelize[_0x070e('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x070e('0x3')]},'online':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x070e('0x16')]},'voicePause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x070e('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x070e('0x16')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x070e('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x17')},'ipaddr':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x070e('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x18'),_0x070e('0x11'),_0x070e('0x19')),'allowNull':!![],'defaultValue':_0x070e('0x18')},'context':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x1a'),_0x070e('0x1b'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0x070e('0x1c'),_0x070e('0x1d'),_0x070e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'udp','set':function(_0x59c5b4){this[_0x070e('0x5')]('transport',_0x59c5b4?_0x59c5b4[_0x070e('0x1f')](','):null);},'get':function(){return this[_0x070e('0xb')]('transport')?this['getDataValue'](_0x070e('0x20'))[_0x070e('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x070e('0x22'),_0x070e('0x23'),_0x070e('0x24'),_0x070e('0x25'),_0x070e('0x26')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no',_0x070e('0x28'),_0x070e('0x29'),_0x070e('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x2b'),'set':function(_0x34746e){this['setDataValue']('nat',_0x34746e?_0x34746e['join'](','):null);},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2c'))?this[_0x070e('0xb')](_0x070e('0x2c'))[_0x070e('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x070e('0x3')]},'namedcallgroup':{'type':Sequelize[_0x070e('0x3')]},'pickupgroup':{'type':Sequelize[_0x070e('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x070e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x070e('0x3')]},'disallow':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'defaultValue':_0x070e('0x2d'),'set':function(_0x4800a9){this[_0x070e('0x5')]('allow',_0x4800a9?_0x4800a9[_0x070e('0x1f')](';'):_0x070e('0x2d'));},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2e'))?this[_0x070e('0xb')]('allow')[_0x070e('0x21')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![],'set':function(_0x38879f){this['setDataValue'](_0x070e('0x2f'),_0x38879f?_0x38879f[_0x070e('0x1f')](','):null);},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2f'))?this['getDataValue'](_0x070e('0x2f'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x30')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':_0x070e('0x27')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no',_0x070e('0x31')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x32'),_0x070e('0x33'),_0x070e('0x34')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x35'),'uas'),'allowNull':!![],'defaultValue':_0x070e('0x36')},'t38pt_usertpsource':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':_0x070e('0x27')},'keepalive':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no',_0x070e('0x37'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x070e('0xf')]('active','passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no',_0x070e('0x28'),'update',_0x070e('0x38')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x070e('0x16')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x070e('0x39')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x4cb86f){this['setDataValue'](_0x070e('0x3a'),_0x4cb86f);var _0x1ae5cb=this[_0x070e('0x3b')]({'plain':!![]});switch(_0x4cb86f){case 0x0:case 0x1:var _0x122198=_0x1ae5cb[_0x070e('0x20')]?_[_0x070e('0x3c')](_0x1ae5cb['transport'])?_0x1ae5cb[_0x070e('0x20')]['join']():_0x1ae5cb[_0x070e('0x20')]:'udp';if(_0x122198===_0x070e('0x3d')){_0x122198=_0x070e('0x3e');}this['setDataValue'](_0x070e('0x20'),_0x122198);this['setDataValue'](_0x070e('0x3f'),'no');this[_0x070e('0x5')](_0x070e('0x40'),null);this[_0x070e('0x5')](_0x070e('0x41'),null);this[_0x070e('0x5')](_0x070e('0x42'),null);this[_0x070e('0x5')](_0x070e('0x43'),null);this[_0x070e('0x5')](_0x070e('0x44'),null);this[_0x070e('0x5')](_0x070e('0x45'),null);this[_0x070e('0x5')]('dtlscertfile',null);this[_0x070e('0x5')](_0x070e('0x46'),null);this[_0x070e('0x5')](_0x070e('0x47'),'no');break;case 0x2:this['setDataValue'](_0x070e('0x20'),_0x070e('0x3d'));this[_0x070e('0x5')](_0x070e('0x3f'),_0x070e('0x27'));this[_0x070e('0x5')]('avpf',_0x070e('0x27'));this[_0x070e('0x5')](_0x070e('0x41'),_0x070e('0x27'));this['setDataValue'](_0x070e('0x42'),'yes');this[_0x070e('0x5')](_0x070e('0x43'),_0x070e('0x27'));this[_0x070e('0x5')](_0x070e('0x44'),'no');this['setDataValue'](_0x070e('0x45'),_0x070e('0x48'));this[_0x070e('0x5')](_0x070e('0x49'),_0x1ae5cb['dtlscertfile']||_0x070e('0x4a'));this['setDataValue'](_0x070e('0x46'),_0x1ae5cb[_0x070e('0x46')]||_0x070e('0x4b'));this['setDataValue'](_0x070e('0x47'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x070e('0x39')],'set':function(_0x5ce157){this[_0x070e('0x5')](_0x070e('0x4c'),_0x5ce157?_0x5ce157['join'](','):[]);},'get':function(){return this[_0x070e('0xb')]('permissions')?_[_0x070e('0x4d')](this[_0x070e('0xb')]('permissions')['split'](','),function(_0x29ee66){return parseInt(_0x29ee66,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x070e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x070e('0x4e')],'get':function(){return this[_0x070e('0xb')](_0x070e('0x4f'))?this[_0x070e('0xb')](_0x070e('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x070e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x4f720f){if(typeof _0x4f720f==='string'){var _0x1624cd=_0x4f720f==='1'?!![]:_0x4f720f==='0'?![]:_0x4f720f===_0x070e('0x50')?!![]:_0x4f720f===_0x070e('0x51')?![]:![];this[_0x070e('0x5')]('screenrecording',_0x1624cd);}else{this[_0x070e('0x5')](_0x070e('0x52'),_0x4f720f);}}},'blocked':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![],'set':function(_0xd74f9c){this[_0x070e('0x5')](_0x070e('0x53'),_0xd74f9c);if(_0xd74f9c===!![]){this['setDataValue'](_0x070e('0x54'),moment());this['setDataValue'](_0x070e('0x55'),0x0);}else{this[_0x070e('0x5')](_0x070e('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x070e('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x070e('0x14')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 2b12ee5..ec9e131 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 _0x0465=['ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','FaxInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','intrf','format','headers','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','PAUSE','LOGININPAUSE','isMiddleware','resolve','pause','updateAttributes','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','getTeams','Team','addTeams','transaction','flattenDeep','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','getAssociatedQueues','getLists','values','send','addChatInteractions','omit','spread','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gte','$lte','$not','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$overlap','$contained','firstName','lastName','dialActive','getApiKey','retrieveApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','whoami','getUserSetting','getPresence','teams','queues','inbound','flatten','lower','toString','asc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','client','http','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','voiceStatus','slice','charAt','toUpperCase','QueryTypes','select','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','moment','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','handleError','../../mysqldb','register','redis','defaults','localhost','request','then','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','update','emit','userNotification:recalc:','destroy','get','admin','Users','user','Agents','agent','Telephones','filter','ignore','map','value','includes','role','find','stack','name','index','rawAttributes','fieldName','type','key','salt','getOptions','User','query','includeAll','include','userSetting','true','attributes','push','rows','openTabs','length','chat','dataValues','sms','fax','mail','whatsapp','show','params','differenceBy','keys','password','filters','intersection','model','fields','UserSetting','options','all','body','describe','addContacts','ids','internal','Setting','findById','securePassword','validatePasswordPattern','max','min_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)','isNil','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','102','103','113','110','104','105','106','107','108','109','111','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','UserProfileResource','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','telephone','findAll','isEmpty','autoAssociation','compact','changePassword','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','passwordHistoryLimit','enforcePasswordHistory','previousPasswords','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','interface','isValidChannel','add','toLowerCase','Queues','penalty','capitalize','Queue:save','voice','VoiceQueue','SIP/%s','UserVoiceQueueRt','upsert','Unknown\x20channel','remove','isArray','QueueId','Queue:remove','addAvatar','userpic','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getOpenTabs','openchannel','ChatOpenTabs','CHAT','createdAt','FAX','OpenchannelOpenTabs','OPENCHANNEL','MAIL','SmsOpenTabs','SMS','concat','getContacts','CmContact','sort','where','pick','merge','CmList','List','Tag','Tags','color','tag','hasOwnProperty','nolimit','Queue','order','Unknown\x20role','getVoiceQueuesRt','getGroups','VoiceRecording','UserId','getScreenRecordings'];(function(_0x498210,_0x3c0b7b){var _0x5d2e0e=function(_0x459227){while(--_0x459227){_0x498210['push'](_0x498210['shift']());}};_0x5d2e0e(++_0x3c0b7b);}(_0x0465,0xae));var _0x5046=function(_0x48c29b,_0x3763ab){_0x48c29b=_0x48c29b-0x0;var _0x27a520=_0x0465[_0x48c29b];return _0x27a520;};'use strict';var moment=require(_0x5046('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x5046('0x1'));var squel=require(_0x5046('0x2'));var jayson=require(_0x5046('0x3'));var Redis=require(_0x5046('0x4'));var authService=require(_0x5046('0x5'));var qs=require(_0x5046('0x6'));var logger=require(_0x5046('0x7'))(_0x5046('0x8'));var utils=require(_0x5046('0x9'));var config=require('../../config/environment');var licenseUtil=require(_0x5046('0xa'));var APIBadRequestError=require(_0x5046('0xb'))[_0x5046('0xc')];var APINotFoundError=require(_0x5046('0xb'))[_0x5046('0xd')];var APIHandleError=require(_0x5046('0xb'))[_0x5046('0xe')];var db=require(_0x5046('0xf'))['db'];var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./user.socket')[_0x5046('0x10')](socket);config[_0x5046('0x11')]=_[_0x5046('0x12')](config[_0x5046('0x11')],{'host':_0x5046('0x13'),'port':0x18eb});var amiClient=jayson['client']['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x39f3ea,_0x37a1b1,_0x3f298c,_0x34ea5b){return new Promise(function(_0x3c10dd,_0x1e1eb7){var _0x35ee47=_0x34ea5b||amiClient;return _0x35ee47[_0x5046('0x14')](_0x39f3ea,_0x3f298c)[_0x5046('0x15')](function(_0xb5ee90){logger['info'](_0x5046('0x16'),_0x37a1b1,_0x5046('0x17'));logger[_0x5046('0x18')](_0x5046('0x19'),_0x37a1b1,_0x5046('0x17'),JSON['stringify'](_0xb5ee90));if(_0xb5ee90['error']){if(_0xb5ee90['error'][_0x5046('0x1a')]===0x1f4){logger[_0x5046('0x1b')]('User,\x20%s,\x20%s',_0x37a1b1,_0xb5ee90[_0x5046('0x1b')][_0x5046('0x1c')]);return _0x1e1eb7(_0xb5ee90['error'][_0x5046('0x1c')]);}logger[_0x5046('0x1b')]('User,\x20%s,\x20%s',_0x37a1b1,_0xb5ee90['error']['message']);return _0x3c10dd(_0xb5ee90[_0x5046('0x1b')][_0x5046('0x1c')]);}else{logger[_0x5046('0x1d')]('User,\x20%s,\x20%s',_0x37a1b1,_0x5046('0x17'));_0x3c10dd(_0xb5ee90[_0x5046('0x1e')][_0x5046('0x1c')]);}})[_0x5046('0x1f')](function(_0x26df64){logger[_0x5046('0x1b')](_0x5046('0x16'),_0x37a1b1,_0x26df64);_0x1e1eb7(_0x26df64);});});}function respondWithStatusCode(_0x4bce55,_0x24b6db){_0x24b6db=_0x24b6db||0xcc;return function(_0x998fc4){if(_0x998fc4){return _0x4bce55[_0x5046('0x20')](_0x24b6db);}return _0x4bce55[_0x5046('0x21')](_0x24b6db)[_0x5046('0x22')]();};}function respondWithResult(_0x1aa334,_0x3c3089){_0x3c3089=_0x3c3089||0xc8;return function(_0x8600bd){if(_0x8600bd){return _0x1aa334[_0x5046('0x21')](_0x3c3089)[_0x5046('0x23')](_0x8600bd);}};}function respondWithFilteredResult(_0x1e548c,_0x31014a){return function(_0xc5eb82){if(_0xc5eb82){var _0xf31ae2=typeof _0x31014a[_0x5046('0x24')]==='undefined'&&typeof _0x31014a[_0x5046('0x25')]===_0x5046('0x26');var _0x299112=_0xc5eb82[_0x5046('0x27')];var _0x183398=_0xf31ae2?0x0:_0x31014a[_0x5046('0x24')];var _0x278456=_0xf31ae2?_0xc5eb82[_0x5046('0x27')]:_0x31014a['offset']+_0x31014a[_0x5046('0x25')];var _0x26e42c;if(_0x278456>=_0x299112){_0x278456=_0x299112;_0x26e42c=0xc8;}else{_0x26e42c=0xce;}_0x1e548c[_0x5046('0x21')](_0x26e42c);return _0x1e548c[_0x5046('0x28')]('Content-Range',_0x183398+'-'+_0x278456+'/'+_0x299112)[_0x5046('0x23')](_0xc5eb82);}return null;};}function saveUpdates(_0x5c29b3){return function(_0x478157){if(_0x478157){return _0x478157[_0x5046('0x29')](_0x5c29b3)['then'](function(_0x52fcf8){socket[_0x5046('0x2a')](_0x5046('0x2b')+_0x52fcf8['id'],{});return _0x52fcf8;});}return null;};}function removeEntity(_0x2cce73){return function(_0x38265a){if(_0x38265a){return _0x38265a[_0x5046('0x2c')]()['then'](function(){var _0x416cc8=_0x38265a[_0x5046('0x2d')]({'plain':!![]});if(_0x416cc8['role']===_0x5046('0x2e'))return;var _0xfbc1b9=[{'name':_0x5046('0x2f'),'value':_0x5046('0x30'),'ignore':!![]},{'name':_0x5046('0x31'),'value':_0x5046('0x32'),'ignore':![]},{'name':_0x5046('0x33'),'value':'telephone','ignore':![]}];var _0x7fd2c3=_(_0xfbc1b9)[_0x5046('0x34')](_0x5046('0x35'))[_0x5046('0x36')](_0x5046('0x37'))[_0x5046('0x37')]();if(_[_0x5046('0x38')](_0x7fd2c3,_0x416cc8[_0x5046('0x39')])){return;}var _0x4e28b3=_[_0x5046('0x3a')](_0xfbc1b9,[_0x5046('0x37'),_0x416cc8[_0x5046('0x39')]])['name'];return db['UserProfileResource'][_0x5046('0x2c')]({'where':{'type':_0x4e28b3,'resourceId':_0x416cc8['id']}})['then'](function(){return _0x38265a;});})['then'](function(){_0x2cce73[_0x5046('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x186482){return function(_0x217574){if(!_0x217574){_0x186482[_0x5046('0x20')](0x194);}return _0x217574;};}function handleError(_0x5f1d0b,_0x1e8dd4){_0x1e8dd4=_0x1e8dd4||0x1f4;return function(_0x2ddfed){logger['error'](_0x2ddfed[_0x5046('0x3b')]);if(_0x2ddfed[_0x5046('0x3c')]){delete _0x2ddfed[_0x5046('0x3c')];}_0x5f1d0b[_0x5046('0x21')](_0x1e8dd4)['send'](_0x2ddfed);};}exports[_0x5046('0x3d')]=function(_0x318d61,_0x2a3ddc){var _0x3ffc89={},_0x735dd9={'count':0x0,'rows':[]};var _0x81cb46=_(db['User'][_0x5046('0x3e')])['map'](function(_0x249e65){return{'name':_0x249e65[_0x5046('0x3f')],'type':_0x249e65[_0x5046('0x40')][_0x5046('0x41')]};})[_0x5046('0x34')](function(_0x2afe7a){return!_['includes'](['password',_0x5046('0x42')],_0x2afe7a[_0x5046('0x3c')]);})[_0x5046('0x37')]();_0x3ffc89=qs[_0x5046('0x43')](_0x81cb46,_0x318d61);var _0x1469a4={'where':_0x3ffc89['where']};return db[_0x5046('0x44')][_0x5046('0x27')](_0x1469a4)['then'](function(_0x4acace){_0x735dd9[_0x5046('0x27')]=_0x4acace;if(_0x318d61[_0x5046('0x45')][_0x5046('0x46')]){_0x3ffc89[_0x5046('0x47')]=[{'all':!![]}];}if(_0x318d61[_0x5046('0x45')][_0x5046('0x48')]===_0x5046('0x49')){_0x3ffc89[_0x5046('0x47')]=[{'model':db['UserSetting'],'as':_0x5046('0x48')}];}if(!_[_0x5046('0x38')](_0x3ffc89['attributes'],'id')){_0x3ffc89[_0x5046('0x4a')][_0x5046('0x4b')]('id');}return db[_0x5046('0x44')]['findAll'](_0x3ffc89);})[_0x5046('0x15')](function(_0x5cd94f){_0x735dd9[_0x5046('0x4c')]=_0x5cd94f;if(_0x318d61[_0x5046('0x45')][_0x5046('0x4d')]===_0x5046('0x49')){var _0xaf2832=[];for(var _0xbfd124=0x0;_0xbfd124<_0x735dd9[_0x5046('0x4c')][_0x5046('0x4e')];_0xbfd124++){_0xaf2832[_0x5046('0x4b')](get_open_tabs(_0x5046('0x4f'),_0x735dd9[_0x5046('0x4c')][_0xbfd124][_0x5046('0x50')]));_0xaf2832[_0x5046('0x4b')](get_open_tabs(_0x5046('0x51'),_0x735dd9['rows'][_0xbfd124]['dataValues']));_0xaf2832[_0x5046('0x4b')](get_open_tabs(_0x5046('0x52'),_0x735dd9[_0x5046('0x4c')][_0xbfd124]['dataValues']));_0xaf2832['push'](get_open_tabs(_0x5046('0x53'),_0x735dd9[_0x5046('0x4c')][_0xbfd124][_0x5046('0x50')]));_0xaf2832[_0x5046('0x4b')](get_open_tabs('openchannel',_0x735dd9[_0x5046('0x4c')][_0xbfd124][_0x5046('0x50')]));_0xaf2832['push'](get_open_tabs(_0x5046('0x54'),_0x735dd9[_0x5046('0x4c')][_0xbfd124][_0x5046('0x50')]));}return Promise['all'](_0xaf2832)[_0x5046('0x15')](function(){return _0x735dd9;});}else{return _0x735dd9;}})[_0x5046('0x15')](respondWithFilteredResult(_0x2a3ddc,_0x3ffc89))[_0x5046('0x1f')](handleError(_0x2a3ddc,null));};exports[_0x5046('0x55')]=function(_0x3556ab,_0x5fe31a){var _0x3133a8={'raw':![],'where':{'id':_0x3556ab[_0x5046('0x56')]['id']}},_0x5a7507={};_0x5a7507['model']=_[_0x5046('0x57')](_[_0x5046('0x58')](db[_0x5046('0x44')][_0x5046('0x3e')]),[_0x5046('0x59'),_0x5046('0x42')]);_0x5a7507[_0x5046('0x45')]=_['keys'](_0x3556ab[_0x5046('0x45')]);_0x5a7507[_0x5046('0x5a')]=_[_0x5046('0x5b')](_0x5a7507[_0x5046('0x5c')],_0x5a7507[_0x5046('0x45')]);_0x3133a8[_0x5046('0x4a')]=_[_0x5046('0x5b')](_0x5a7507[_0x5046('0x5c')],qs[_0x5046('0x5d')](_0x3556ab[_0x5046('0x45')][_0x5046('0x5d')]));_0x3133a8[_0x5046('0x4a')]=_0x3133a8['attributes'][_0x5046('0x4e')]?_0x3133a8[_0x5046('0x4a')]:_0x5a7507[_0x5046('0x5c')];if(_0x3556ab['query'][_0x5046('0x46')]){_0x3133a8[_0x5046('0x47')]=[{'all':!![]}];}if(_0x3556ab[_0x5046('0x45')][_0x5046('0x48')]===_0x5046('0x49')){_0x3133a8[_0x5046('0x47')]=[{'model':db[_0x5046('0x5e')],'as':_0x5046('0x48')}];}_0x3133a8=_['merge']({},_0x3133a8,_0x3556ab[_0x5046('0x5f')]);if(!_['includes'](_0x3133a8['attributes'],'id')){_0x3133a8[_0x5046('0x4a')][_0x5046('0x4b')]('id');}return db[_0x5046('0x44')]['find'](_0x3133a8)['then'](handleEntityNotFound(_0x5fe31a,null))[_0x5046('0x15')](function(_0x567310){var _0x445337=[];values=_0x567310;if(_0x3556ab['query'][_0x5046('0x4d')]===_0x5046('0x49')){_0x445337[_0x5046('0x4b')](get_open_tabs('chat',_0x567310[_0x5046('0x50')]));_0x445337[_0x5046('0x4b')](get_open_tabs('sms',_0x567310[_0x5046('0x50')]));_0x445337[_0x5046('0x4b')](get_open_tabs('openchannel',_0x567310['dataValues']));_0x445337[_0x5046('0x4b')](get_open_tabs(_0x5046('0x54'),_0x567310[_0x5046('0x50')]));_0x445337[_0x5046('0x4b')](get_open_tabs(_0x5046('0x52'),_0x567310[_0x5046('0x50')]));_0x445337[_0x5046('0x4b')](get_open_tabs('mail',_0x567310[_0x5046('0x50')]));return Promise[_0x5046('0x60')](_0x445337);}else{return values;}})[_0x5046('0x15')](function(){return values;})[_0x5046('0x15')](respondWithResult(_0x5fe31a,null))['catch'](handleError(_0x5fe31a,null));};exports[_0x5046('0x29')]=function(_0x1035b4,_0x1d7af1){if(_0x1035b4[_0x5046('0x61')]['id']){delete _0x1035b4[_0x5046('0x61')]['id'];}delete _0x1035b4[_0x5046('0x61')][_0x5046('0x39')];return db[_0x5046('0x44')]['find']({'where':{'id':_0x1035b4['params']['id']}})[_0x5046('0x15')](handleEntityNotFound(_0x1d7af1,null))[_0x5046('0x15')](saveUpdates(_0x1035b4[_0x5046('0x61')],null))['then'](respondWithResult(_0x1d7af1,null))[_0x5046('0x1f')](handleError(_0x1d7af1,null));};exports[_0x5046('0x62')]=function(_0x2b0dcf,_0x4744df){return db[_0x5046('0x44')][_0x5046('0x62')]()['then'](respondWithResult(_0x4744df,null))[_0x5046('0x1f')](handleError(_0x4744df,null));};exports[_0x5046('0x63')]=function(_0x34eaae,_0x39ad8a){return db[_0x5046('0x44')][_0x5046('0x3a')]({'where':{'id':_0x34eaae['params']['id']}})[_0x5046('0x15')](handleEntityNotFound(_0x39ad8a,null))[_0x5046('0x15')](function(_0x4ad2b7){if(_0x4ad2b7){return _0x4ad2b7['addContacts'](_0x34eaae[_0x5046('0x61')]['ids'],_['omit'](_0x34eaae[_0x5046('0x61')],[_0x5046('0x64'),'id'])||{});}})['then'](respondWithResult(_0x39ad8a,null))[_0x5046('0x1f')](handleError(_0x39ad8a,null));};function validateUser(_0x16acdb){return new Promise(function(_0x7f2bf8,_0x5ad607){if(_0x16acdb[_0x5046('0x65')])return _0x7f2bf8(_0x16acdb);return db[_0x5046('0x66')][_0x5046('0x67')](0x1)['then'](function(_0x1c4995){if(_0x1c4995[_0x5046('0x68')])authService[_0x5046('0x69')](_0x16acdb[_0x5046('0x59')]);db['User'][_0x5046('0x6a')]('internal')['then'](function(_0x990259){if(_['isNil'](_0x990259)){_0x16acdb[_0x5046('0x65')]=_0x1c4995['min_internal']||0x1;return;}if(_['isNil'](_0x1c4995[_0x5046('0x6b')])||_0x1c4995[_0x5046('0x6b')]===_0x990259){_0x16acdb[_0x5046('0x65')]=_0x990259+0x1;return;}if(_0x1c4995['min_internal']>_0x990259){_0x16acdb[_0x5046('0x65')]=_0x1c4995[_0x5046('0x6b')];return;}return db[_0x5046('0x6c')][_0x5046('0x45')](_0x5046('0x6d'),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0x5046('0x15')](function(_0x2ea948){if(_0x2ea948&&_0x2ea948['length']){for(var _0x4654d7=0x0,_0x277455=_0x2ea948['length'];_0x4654d7<_0x277455&&_[_0x5046('0x6e')](_0x16acdb[_0x5046('0x65')]);_0x4654d7++){if(_0x1c4995['min_internal']<=_0x2ea948[_0x4654d7][_0x5046('0x6f')]){_0x16acdb[_0x5046('0x65')]=_0x2ea948[_0x4654d7][_0x5046('0x6f')];}else if(_0x1c4995[_0x5046('0x6b')]>_0x2ea948[_0x4654d7][_0x5046('0x6f')]&&_0x1c4995[_0x5046('0x6b')]<=_0x2ea948[_0x4654d7]['to']){_0x16acdb['internal']=_0x1c4995[_0x5046('0x6b')];}}}if(_[_0x5046('0x6e')](_0x16acdb[_0x5046('0x65')])){_0x16acdb[_0x5046('0x65')]=_0x990259+0x1;}return _0x7f2bf8(_0x16acdb);});});})[_0x5046('0x1f')](function(_0x394332){_0x5ad607(_0x394332);});});}function updateUser(_0x18ca28){return new Promise(function(_0x53335b,_0x3d82ec){try{if(_0x18ca28[_0x5046('0x70')]){_0x18ca28[_0x5046('0x71')]=_0x18ca28[_0x5046('0x65')];_0x18ca28[_0x5046('0x72')]={'mailbox':_0x18ca28[_0x5046('0x65')],'password':_0x18ca28[_0x5046('0x59')],'fullname':_0x18ca28[_0x5046('0x73')],'email':_0x18ca28[_0x5046('0x74')]};}if(_0x18ca28[_0x5046('0x39')]===_0x5046('0x32')){if(!_0x18ca28[_0x5046('0x75')])_0x18ca28['permissions']=[_0x5046('0x76'),_0x5046('0x77'),_0x5046('0x78'),_0x5046('0x79'),_0x5046('0x7a'),_0x5046('0x7b'),_0x5046('0x7c'),_0x5046('0x7d'),_0x5046('0x7e'),_0x5046('0x7f'),_0x5046('0x80'),'100',_0x5046('0x81'),_0x5046('0x82'),_0x5046('0x83')];}_0x53335b(_0x18ca28);}catch(_0x102821){_0x3d82ec(_0x102821);}});}exports[_0x5046('0x84')]=function(_0x4e5357,_0x3ca487){if(_0x4e5357['user'][_0x5046('0x39')]===_0x5046('0x32'))throw new Error(_0x5046('0x85'));if(_0x4e5357[_0x5046('0x61')][_0x5046('0x39')]===_0x5046('0x30')&&_0x4e5357['user'][_0x5046('0x39')]!==_0x5046('0x2e')){throw new Error(_0x5046('0x86'));}if(_0x4e5357['body']['role']===_0x5046('0x2e')&&_0x4e5357['user']['role']!==_0x5046('0x2e')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x5046('0x87')]([_0x4e5357[_0x5046('0x61')]])[_0x5046('0x15')](function(){return validateUser(_0x4e5357[_0x5046('0x61')]);})[_0x5046('0x15')](function(_0x31ad44){return updateUser(_0x31ad44)[_0x5046('0x15')](function(_0x4e6298){if(_0x4e6298['role']===_0x5046('0x2e')){_0x4e6298[_0x5046('0x88')]=_0x4e5357['user']['settingsEnabled'];delete _0x4e6298[_0x5046('0x89')];}return _0x4e6298;});})[_0x5046('0x15')](function(_0x456994){return db[_0x5046('0x44')][_0x5046('0x84')](_0x456994,{'include':[{'model':db[_0x5046('0x72')],'as':_0x5046('0x72')}]});})[_0x5046('0x15')](function(_0x1c7a9c){if(_0x4e5357[_0x5046('0x61')][_0x5046('0x39')]===_0x5046('0x30'))return _0x1c7a9c;if(_0x4e5357[_0x5046('0x30')][_0x5046('0x39')]!==_0x5046('0x30'))return _0x1c7a9c;return db[_0x5046('0x8a')][_0x5046('0x3a')]({'where':{'name':_0x1c7a9c[_0x5046('0x39')]==='agent'?_0x5046('0x31'):'Telephones','userProfileId':_0x4e5357['user'][_0x5046('0x89')]},'raw':!![]})[_0x5046('0x15')](function(_0x8632c9){if(!_0x8632c9||_0x8632c9['autoAssociation']!=0x0)return _0x1c7a9c;return db[_0x5046('0x8b')][_0x5046('0x84')]({'name':_0x1c7a9c[_0x5046('0x3c')],'resourceId':_0x1c7a9c['id'],'type':_0x8632c9[_0x5046('0x3c')],'sectionId':_0x8632c9['id']},{})[_0x5046('0x15')](function(){return _0x1c7a9c;});})['catch'](function(_0x3ce912){logger[_0x5046('0x1b')](_0x5046('0x8c'),_0x3ce912);throw _0x3ce912;});})[_0x5046('0x15')](respondWithResult(_0x3ca487,0xc9))['catch'](handleError(_0x3ca487,null));};exports[_0x5046('0x8d')]=function(_0x4a5ab5,_0x20cc4a){var _0x3245d6=_0x4a5ab5[_0x5046('0x61')];var _0x273088=[];if(_0x4a5ab5['user'][_0x5046('0x39')]==='agent')throw new Error('Unauthorized');if(_[_0x5046('0x8e')](_0x3245d6,[_0x5046('0x39'),_0x5046('0x30')])&&_0x4a5ab5[_0x5046('0x30')][_0x5046('0x39')]!==_0x5046('0x2e')){throw new Error(_0x5046('0x86'));}if(_[_0x5046('0x8e')](_0x3245d6,[_0x5046('0x39'),_0x5046('0x2e')])&&_0x4a5ab5[_0x5046('0x30')][_0x5046('0x39')]!==_0x5046('0x2e')){throw new Error(_0x5046('0x8f'));}return licenseUtil['checkUserLimits'](_0x3245d6)[_0x5046('0x15')](function(){return validateUser(_0x3245d6[0x0]);})[_0x5046('0x15')](function(){for(var _0x4432ec=0x1;_0x4432ec<_0x3245d6[_0x5046('0x4e')];_0x4432ec++){var _0x5506e9=_0x3245d6[_0x4432ec-0x1][_0x5046('0x65')];if(!_0x3245d6[_0x4432ec][_0x5046('0x65')])_0x3245d6[_0x4432ec][_0x5046('0x65')]=_0x5506e9+0x1;_0x273088[_0x5046('0x4b')](validateUser(_0x3245d6[_0x4432ec]));}return Promise['all'](_0x273088);})[_0x5046('0x15')](function(){_0x273088=[];for(var _0x7b1235=0x0;_0x7b1235<_0x3245d6[_0x5046('0x4e')];_0x7b1235++){_0x273088[_0x5046('0x4b')](updateUser(_0x3245d6[_0x7b1235]));}return Promise[_0x5046('0x60')](_0x273088);})['then'](function(){_0x273088=_0x3245d6[_0x5046('0x36')](function(_0x423c49){return db[_0x5046('0x44')][_0x5046('0x84')](_0x423c49,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]})[_0x5046('0x15')](function(_0x5adb99){_0x423c49['id']=_0x5adb99['id'];return _0x423c49;});});return Promise[_0x5046('0x60')](_0x273088);})['then'](function(_0x231e50){if(_0x4a5ab5[_0x5046('0x61')][_0x5046('0x39')]===_0x5046('0x30'))return _0x231e50;if(_0x4a5ab5['user']['role']!=='user')return _0x231e50;var _0xe4431b=_[_0x5046('0x8e')](_0x231e50,function(_0x4082e5){return _0x4082e5['role']==='agent'||_0x4082e5['role']===_0x5046('0x90');});if(!_0xe4431b)return _0x231e50;return db['UserProfileSection'][_0x5046('0x91')]({'where':{'name':{'$or':['Agents','Telephones']},'userProfileId':_0x4a5ab5[_0x5046('0x30')][_0x5046('0x89')]},'raw':!![]})[_0x5046('0x15')](function(_0x253175){if(_[_0x5046('0x92')](_0x253175)||!_[_0x5046('0x8e')](_0x253175,[_0x5046('0x93'),0x0]))return _0x231e50;_0x273088=[];var _0x202822=_(_0x253175)[_0x5046('0x36')](function(_0xcbda9f){if(_0xcbda9f[_0x5046('0x93')]===0x1)return;return _0xcbda9f[_0x5046('0x3c')]===_0x5046('0x31')?_0x5046('0x32'):_0x5046('0x90');})[_0x5046('0x94')]()[_0x5046('0x37')]();for(var _0x3b6e4a=0x0;_0x3b6e4a<_0x231e50[_0x5046('0x4e')];_0x3b6e4a++){if(!_[_0x5046('0x38')](_0x202822,_0x231e50[_0x3b6e4a][_0x5046('0x39')]))return;var _0x3ea5c8=_0x231e50[_0x3b6e4a][_0x5046('0x39')]===_0x5046('0x32')?_0x5046('0x31'):_0x5046('0x33');_0x273088[_0x5046('0x4b')](db[_0x5046('0x8b')][_0x5046('0x84')]({'name':_0x231e50[_0x3b6e4a][_0x5046('0x3c')],'resourceId':_0x231e50[_0x3b6e4a]['id'],'type':_0x3ea5c8,'sectionId':_[_0x5046('0x3a')](_0x253175,[_0x5046('0x3c'),_0x3ea5c8])['id']},{}));}return Promise[_0x5046('0x60')](_0x273088);});})[_0x5046('0x15')](respondWithResult(_0x20cc4a,0xc9))['catch'](handleError(_0x20cc4a,null));};exports[_0x5046('0x95')]=function(_0x3b3968,_0xf7710f){if(_0x3b3968['body']['id']){delete _0x3b3968[_0x5046('0x61')]['id'];}return db['User']['find']({'where':{'id':_0x3b3968[_0x5046('0x56')]['id']}})[_0x5046('0x15')](function(_0x21fbc9){if(!_0x21fbc9)return null;if(_0x21fbc9['id']===_0x3b3968[_0x5046('0x30')]['id']){if(!_0x3b3968[_0x5046('0x61')][_0x5046('0x96')]||!_0x3b3968[_0x5046('0x61')][_0x5046('0x97')]){throw new db[(_0x5046('0x98'))][(_0x5046('0x99'))](_0x5046('0x9a'));}if(!_0x21fbc9[_0x5046('0x9b')](_0x3b3968[_0x5046('0x61')]['oldPassword'])){throw new db[(_0x5046('0x98'))][(_0x5046('0x99'))](_0x5046('0x9c'));}if(_0x3b3968[_0x5046('0x61')][_0x5046('0x96')]===_0x3b3968[_0x5046('0x61')]['newPassword']){throw new db[(_0x5046('0x98'))][(_0x5046('0x99'))](_0x5046('0x9d'));}}else if(_0x3b3968[_0x5046('0x30')][_0x5046('0x39')]===_0x5046('0x2e')){if(!_0x3b3968[_0x5046('0x61')][_0x5046('0x97')]){throw new db['Sequelize']['ValidationError'](_0x5046('0x9e'));}}else if(_0x3b3968['user'][_0x5046('0x39')]===_0x5046('0x30')){if(!_0x3b3968['body'][_0x5046('0x97')]){throw new db[(_0x5046('0x98'))]['ValidationError'](_0x5046('0x9e'));}if(_0x21fbc9['role']!==_0x5046('0x32')){throw new db[(_0x5046('0x98'))][(_0x5046('0x99'))](_0x5046('0x85'));}}else{throw new db['Sequelize'][(_0x5046('0x99'))](_0x5046('0x85'));}return _0x21fbc9;})[_0x5046('0x15')](handleEntityNotFound(_0xf7710f,null))[_0x5046('0x15')](function(_0x41b34c){return db[_0x5046('0x66')][_0x5046('0x9f')]({'attributes':['id',_0x5046('0x68'),'enforcePasswordHistory',_0x5046('0xa0')]})[_0x5046('0x15')](function(_0x120ced){if(_0x120ced[_0x5046('0x68')])authService[_0x5046('0x69')](_0x3b3968[_0x5046('0x61')][_0x5046('0x97')]);if(!_0x120ced[_0x5046('0xa1')]||!_0x41b34c[_0x5046('0xa2')])return _0x41b34c;authService['validatePasswordHistory'](_0x3b3968[_0x5046('0x61')][_0x5046('0x97')],_0x41b34c[_0x5046('0xa2')],_0x120ced[_0x5046('0xa0')]);return _0x41b34c;})['then'](saveUpdates({'password':_0x3b3968[_0x5046('0x61')]['newPassword'],'passwordResetAt':_0x3b3968['user']['id']==_0x3b3968[_0x5046('0x56')]['id']?moment():null,'previousPasswords':authService[_0x5046('0xa3')](_0x3b3968[_0x5046('0x61')][_0x5046('0x97')],_0x41b34c[_0x5046('0xa2')])},null));})[_0x5046('0x15')](respondWithResult(_0xf7710f,null))[_0x5046('0x1f')](handleError(_0xf7710f,null));};exports[_0x5046('0xa4')]=function(_0x7b7e8a,_0x1bace9){var _0x39207c=_0x7b7e8a[_0x5046('0x61')][_0x5046('0xa5')];return db[_0x5046('0x44')]['find']({'where':{'id':_0x7b7e8a[_0x5046('0x56')]['id']},'attributes':['id',_0x5046('0x3c'),_0x5046('0x39'),_0x5046('0xa6'),_0x5046('0xa7'),_0x5046('0xa8'),_0x5046('0xa9')]})[_0x5046('0x15')](handleEntityNotFound(_0x1bace9,null))[_0x5046('0x15')](function(_0x4b9734){if(_0x4b9734){if(!utils[_0x5046('0xaa')](_0x39207c)){throw new db[(_0x5046('0x98'))]['ValidationError']('Unknown\x20channel');}return _0x4b9734[_0x5046('0xab')+_['capitalize'](_0x39207c[_0x5046('0xac')]())+_0x5046('0xad')](_0x7b7e8a['body'][_0x5046('0x64')],{'penalty':_0x7b7e8a[_0x5046('0x61')][_0x5046('0xae')]||0x0})['spread'](function(_0x6f7596){for(var _0xf747c1=0x0;_0xf747c1<_0x7b7e8a[_0x5046('0x61')][_0x5046('0x64')][_0x5046('0x4e')];_0xf747c1+=0x1){var _0x6c657c={'UserId':Number(_0x7b7e8a['params']['id'])};_0x6c657c[_[_0x5046('0xaf')](_0x39207c[_0x5046('0xac')]())+'QueueId']=Number(_0x7b7e8a[_0x5046('0x61')][_0x5046('0x64')][_0xf747c1]);socket[_0x5046('0x2a')]('user'+_[_0x5046('0xaf')](_0x39207c[_0x5046('0xac')]())+_0x5046('0xb0'),_0x6c657c);}return _0x6f7596;})[_0x5046('0x15')](function(){if(_0x39207c===_0x5046('0xb1')){return db[_0x5046('0xb2')]['findAll']({'where':{'id':_0x7b7e8a[_0x5046('0x61')][_0x5046('0x64')]||[]},'raw':!![],'attributes':['id',_0x5046('0x3c')]});}})['then'](function(_0x1cd228){var _0x2734f6=_0x4b9734['get']({'plain':!![]});var _0x3c1c9c=[];if(_0x39207c==='voice'&&_0x2734f6[_0x5046('0x39')]==='agent'&&_0x2734f6[_0x5046('0xa6')]){for(let _0x539043=0x0;_0x539043<_0x1cd228['length'];_0x539043+=0x1){_0x3c1c9c[_0x5046('0x4b')]({'membername':_0x2734f6[_0x5046('0x3c')],'UserId':_0x2734f6['id'],'queue_name':_0x1cd228[_0x539043]['name'],'VoiceQueueId':_0x1cd228[_0x539043]['id'],'interface':_[_0x5046('0x6e')](_0x2734f6[_0x5046('0xa9')])?util['format'](_0x5046('0xb3'),_0x2734f6[_0x5046('0x3c')]):_0x2734f6[_0x5046('0xa9')],'paused':_0x2734f6[_0x5046('0xa8')]||![],'penalty':_0x7b7e8a[_0x5046('0x61')][_0x5046('0xae')]||0x0});}return Promise[_0x5046('0x60')](_0x3c1c9c['map'](function(_0x285395){return db[_0x5046('0xb4')][_0x5046('0xb5')](_0x285395);}));}return _0x4b9734;});}})[_0x5046('0x15')](respondWithStatusCode(_0x1bace9,null))[_0x5046('0x1f')](handleError(_0x1bace9,null));};exports['removeQueues']=function(_0x3e0506,_0x2faa79){var _0x3a0e61,_0x5a2643;return db[_0x5046('0x44')][_0x5046('0x3a')]({'where':{'id':_0x3e0506[_0x5046('0x56')]['id']},'attributes':['id',_0x5046('0x3c'),_0x5046('0x39')]})[_0x5046('0x15')](handleEntityNotFound(_0x2faa79,null))[_0x5046('0x15')](function(_0x7cbd64){if(_0x7cbd64){_0x3a0e61=_0x7cbd64;if(!_0x3e0506[_0x5046('0x45')]['channel']||!utils['isValidChannel'](_0x3e0506['query'][_0x5046('0xa5')])){throw new db[(_0x5046('0x98'))][(_0x5046('0x99'))](_0x5046('0xb6'));}return _0x7cbd64[_0x5046('0xb7')+_[_0x5046('0xaf')](_0x3e0506[_0x5046('0x45')][_0x5046('0xa5')][_0x5046('0xac')]())+_0x5046('0xad')](_0x3e0506['query'][_0x5046('0x64')]);}})[_0x5046('0x15')](function(_0x757c1e){if(_[_0x5046('0xb8')](_0x3e0506[_0x5046('0x45')]['ids'])){for(var _0x4af7eb=0x0;_0x4af7eb<_0x3e0506[_0x5046('0x45')][_0x5046('0x64')][_0x5046('0x4e')];_0x4af7eb+=0x1){_0x5a2643={'UserId':Number(_0x3e0506[_0x5046('0x56')]['id'])};_0x5a2643[_[_0x5046('0xaf')](_0x3e0506[_0x5046('0x45')][_0x5046('0xa5')][_0x5046('0xac')]())+_0x5046('0xb9')]=Number(_0x3e0506[_0x5046('0x45')][_0x5046('0x64')][_0x4af7eb]);socket[_0x5046('0x2a')](_0x5046('0x30')+_['capitalize'](_0x3e0506[_0x5046('0x45')][_0x5046('0xa5')][_0x5046('0xac')]())+_0x5046('0xba'),_0x5a2643);}}else{_0x5a2643={'UserId':Number(_0x3e0506['params']['id'])};_0x5a2643[_[_0x5046('0xaf')](_0x3e0506[_0x5046('0x45')][_0x5046('0xa5')][_0x5046('0xac')]())+'QueueId']=Number(_0x3e0506['query'][_0x5046('0x64')]);socket[_0x5046('0x2a')](_0x5046('0x30')+_[_0x5046('0xaf')](_0x3e0506['query'][_0x5046('0xa5')][_0x5046('0xac')]())+'Queue:remove',_0x5a2643);}return _0x757c1e;})[_0x5046('0x15')](function(){if(_0x3e0506[_0x5046('0x45')][_0x5046('0xa5')]===_0x5046('0xb1')){return db[_0x5046('0xb4')]['destroy']({'where':{'UserId':_0x3e0506[_0x5046('0x56')]['id'],'VoiceQueueId':_0x3e0506[_0x5046('0x45')][_0x5046('0x64')]},'individualHooks':!![]})[_0x5046('0x15')](function(){return _0x3a0e61;});}return _0x3a0e61;})[_0x5046('0x15')](respondWithStatusCode(_0x2faa79,null))[_0x5046('0x1f')](handleError(_0x2faa79,null));};exports[_0x5046('0xbb')]=function(_0x4cf600,_0x38af50){_0x4cf600[_0x5046('0x61')][_0x5046('0xbc')]=_0x4cf600['file'][_0x5046('0xbd')];return db[_0x5046('0x44')]['find']({'where':{'id':_0x4cf600[_0x5046('0x56')]['id']}})[_0x5046('0x15')](handleEntityNotFound(_0x38af50,null))[_0x5046('0x15')](saveUpdates(_0x4cf600[_0x5046('0x61')],null))[_0x5046('0x15')](respondWithResult(_0x38af50,null))[_0x5046('0x1f')](handleError(_0x38af50,null));};exports[_0x5046('0xbe')]=function(_0x5c0e35,_0x1c0f58){var _0x1ed10c=path[_0x5046('0xbf')](config[_0x5046('0xc0')],_0x5046('0xc1'));return db[_0x5046('0x44')]['find']({'where':{'id':_0x5c0e35['params']['id']},'attributes':['id',_0x5046('0xbc')],'raw':!![]})[_0x5046('0x15')](handleEntityNotFound(_0x1c0f58,null))['then'](function(_0x214cc5){if(_0x214cc5){if(_['isNil'](_0x214cc5[_0x5046('0xbc')])){return _0x1c0f58[_0x5046('0xc2')](_0x1ed10c);}else{if(!fs[_0x5046('0xc3')](path[_0x5046('0xbf')](config[_0x5046('0xc0')],_0x5046('0xc4'),_0x214cc5[_0x5046('0xbc')]))){return _0x1c0f58[_0x5046('0xc2')](_0x1ed10c);}return _0x1c0f58[_0x5046('0xc2')](path[_0x5046('0xbf')](config[_0x5046('0xc0')],_0x5046('0xc4'),_0x214cc5[_0x5046('0xbc')]));}}})['catch'](handleError(_0x1c0f58,null));};exports[_0x5046('0xc5')]=function(_0x4a2b41,_0x322c6f){return db[_0x5046('0x44')][_0x5046('0x3a')]({'where':{'id':_0x4a2b41[_0x5046('0x56')]['id']},'attributes':['id']})[_0x5046('0x15')](handleEntityNotFound(_0x322c6f,null))['then'](function(_0x20c681){var _0x34de71=[];values=_0x20c681['dataValues'];_0x34de71[_0x5046('0x4b')](get_open_tabs(_0x5046('0x4f'),_0x20c681[_0x5046('0x50')]));_0x34de71[_0x5046('0x4b')](get_open_tabs(_0x5046('0x51'),_0x20c681[_0x5046('0x50')]));_0x34de71[_0x5046('0x4b')](get_open_tabs(_0x5046('0xc6'),_0x20c681['dataValues']));_0x34de71['push'](get_open_tabs(_0x5046('0x54'),_0x20c681[_0x5046('0x50')]));_0x34de71['push'](get_open_tabs(_0x5046('0x52'),_0x20c681['dataValues']));_0x34de71[_0x5046('0x4b')](get_open_tabs(_0x5046('0x53'),_0x20c681['dataValues']));return Promise[_0x5046('0x60')](_0x34de71);})['then'](function(_0x571fdb){if(_0x571fdb){var _0x4916da=_['map'](values[_0x5046('0xc7')],function(_0x25c509){return{'channel':_0x5046('0xc8'),'id':_0x25c509['id'],'createdAt':_0x25c509[_0x5046('0xc9')]};});var _0x301734=_[_0x5046('0x36')](values['FaxOpenTabs'],function(_0x3c1004){return{'channel':_0x5046('0xca'),'id':_0x3c1004['id'],'createdAt':_0x3c1004[_0x5046('0xc9')]};});var _0x55d81c=_[_0x5046('0x36')](values[_0x5046('0xcb')],function(_0x2da9f9){return{'channel':_0x5046('0xcc'),'id':_0x2da9f9['id'],'createdAt':_0x2da9f9[_0x5046('0xc9')]};});var _0xca5954=_[_0x5046('0x36')](values['MailOpenTabs'],function(_0x35a8e5){return{'channel':_0x5046('0xcd'),'id':_0x35a8e5['id'],'createdAt':_0x35a8e5[_0x5046('0xc9')]};});var _0xf676a1=_[_0x5046('0x36')](values[_0x5046('0xce')],function(_0x4c8b43){return{'channel':_0x5046('0xcf'),'id':_0x4c8b43['id'],'createdAt':_0x4c8b43[_0x5046('0xc9')]};});var _0x1a4882=_[_0x5046('0x36')](values['WhatsappOpenTabs'],function(_0x1daa45){return{'channel':'WHATSAPP','id':_0x1daa45['id'],'createdAt':_0x1daa45['createdAt']};});var _0x1a7f9b=_[_0x5046('0xd0')](_0x4916da,_0x301734,_0x55d81c,_0xca5954,_0xf676a1,_0x1a4882);var _0x225527={'count':_0x1a7f9b[_0x5046('0x4e')],'rows':_0x1a7f9b};return _0x225527;}else return null;})[_0x5046('0x15')](respondWithResult(_0x322c6f,null))[_0x5046('0x1f')](handleError(_0x322c6f,null));};exports[_0x5046('0xd1')]=function(_0x280844,_0x5821b5){var _0x44673e={};var _0x2c2a47={};var _0x257296;var _0x3f5517;return db[_0x5046('0x44')][_0x5046('0x9f')]({'where':{'id':_0x280844[_0x5046('0x56')]['id']}})[_0x5046('0x15')](handleEntityNotFound(_0x5821b5,null))[_0x5046('0x15')](function(_0x52afc5){if(_0x52afc5){_0x257296=_0x52afc5;_0x2c2a47['model']=_[_0x5046('0x58')](db[_0x5046('0xd2')][_0x5046('0x3e')]);_0x2c2a47['query']=_[_0x5046('0x58')](_0x280844[_0x5046('0x45')]);_0x2c2a47['filters']=_[_0x5046('0x5b')](_0x2c2a47[_0x5046('0x5c')],_0x2c2a47[_0x5046('0x45')]);_0x44673e[_0x5046('0x4a')]=_[_0x5046('0x5b')](_0x2c2a47['model'],qs[_0x5046('0x5d')](_0x280844['query'][_0x5046('0x5d')]));_0x44673e[_0x5046('0x4a')]=_0x44673e[_0x5046('0x4a')][_0x5046('0x4e')]?_0x44673e[_0x5046('0x4a')]:_0x2c2a47[_0x5046('0x5c')];_0x44673e['order']=qs['sort'](_0x280844[_0x5046('0x45')][_0x5046('0xd3')]);_0x44673e[_0x5046('0xd4')]=qs[_0x5046('0x5a')](_[_0x5046('0xd5')](_0x280844['query'],_0x2c2a47[_0x5046('0x5a')]));if(_0x280844[_0x5046('0x45')][_0x5046('0x34')]){_0x44673e[_0x5046('0xd4')]=_['merge'](_0x44673e[_0x5046('0xd4')],{'$or':_['map'](_0x44673e[_0x5046('0x4a')],function(_0x89f033){var _0x5bdeb2={};_0x5bdeb2[_0x89f033]={'$like':'%'+_0x280844[_0x5046('0x45')][_0x5046('0x34')]+'%'};return _0x5bdeb2;})});}_0x44673e=_[_0x5046('0xd6')]({},_0x44673e,_0x280844[_0x5046('0x5f')]);return _0x257296['getContacts'](_0x44673e);}})[_0x5046('0x15')](function(_0x2af86b){if(_0x2af86b){_0x3f5517=_0x2af86b[_0x5046('0x4e')];if(_0x280844[_0x5046('0x45')]['hasOwnProperty'](_0x5046('0x46'))){_0x44673e['include']=[{'model':db[_0x5046('0xd7')],'as':_0x5046('0xd8'),'required':![]},{'model':db[_0x5046('0xd9')],'as':_0x5046('0xda'),'attributes':['id',_0x5046('0x3c'),_0x5046('0xdb')],'where':_0x280844[_0x5046('0x45')]['tag']?{'id':_0x280844[_0x5046('0x45')][_0x5046('0xdc')]}:undefined,'required':_0x280844[_0x5046('0x45')][_0x5046('0xdc')]?!![]:![]}];}if(!_0x280844['query'][_0x5046('0xdd')](_0x5046('0xde'))){_0x44673e[_0x5046('0x25')]=qs[_0x5046('0x25')](_0x280844[_0x5046('0x45')]['limit']);_0x44673e[_0x5046('0x24')]=qs[_0x5046('0x24')](_0x280844[_0x5046('0x45')][_0x5046('0x24')]);}return _0x257296[_0x5046('0xd1')](_0x44673e);}})['then'](function(_0x582b00){if(_0x582b00){return _0x582b00?{'count':_0x3f5517,'rows':_0x582b00}:null;}})['then'](respondWithResult(_0x5821b5,null))[_0x5046('0x1f')](handleError(_0x5821b5,null));};exports['getQueues']=function(_0x428ecf,_0x57c216){var _0x581694;var _0x25d90e={};var _0x27c94f;return db[_0x5046('0x44')][_0x5046('0x9f')]({'where':{'id':_0x428ecf[_0x5046('0x56')]['id']},'attributes':['id',_0x5046('0x3c'),_0x5046('0x39')]})[_0x5046('0x15')](handleEntityNotFound(_0x57c216,null))[_0x5046('0x15')](function(_0x256442){if(!utils[_0x5046('0xaa')](_0x428ecf['query'][_0x5046('0xa5')])){throw new db[(_0x5046('0x98'))][(_0x5046('0x99'))](_0x5046('0xb6'));}_0x581694=_0x256442;var _0x4521fb={};_0x4521fb[_0x5046('0x5c')]=_[_0x5046('0x58')](db[_[_0x5046('0xaf')](_0x428ecf[_0x5046('0x45')][_0x5046('0xa5')])+_0x5046('0xdf')][_0x5046('0x3e')]);_0x4521fb[_0x5046('0x45')]=_[_0x5046('0x58')](_0x428ecf['query']);_0x4521fb[_0x5046('0x5a')]=_[_0x5046('0x5b')](_0x4521fb[_0x5046('0x5c')],_0x4521fb[_0x5046('0x45')]);_0x25d90e[_0x5046('0x4a')]=_['intersection'](_0x4521fb[_0x5046('0x5c')],qs[_0x5046('0x5d')](_0x428ecf[_0x5046('0x45')]['fields']));_0x25d90e[_0x5046('0x4a')]=_0x25d90e[_0x5046('0x4a')][_0x5046('0x4e')]?_0x25d90e[_0x5046('0x4a')]:_0x4521fb[_0x5046('0x5c')];_0x25d90e[_0x5046('0xe0')]=qs[_0x5046('0xd3')](_0x428ecf[_0x5046('0x45')][_0x5046('0xd3')]);_0x25d90e[_0x5046('0xd4')]=qs[_0x5046('0x5a')](_[_0x5046('0xd5')](_0x428ecf[_0x5046('0x45')],_0x4521fb[_0x5046('0x5a')]));if(_0x428ecf[_0x5046('0x45')][_0x5046('0x34')]){_0x25d90e['where']=_[_0x5046('0xd6')](_0x25d90e[_0x5046('0xd4')],{'$or':_[_0x5046('0x36')](_0x25d90e['attributes'],function(_0x26a59d){var _0x4b96b9={};_0x4b96b9[_0x26a59d]={'$like':'%'+_0x428ecf['query']['filter']+'%'};return _0x4b96b9;})});}_0x25d90e=_[_0x5046('0xd6')]({},_0x25d90e,_0x428ecf[_0x5046('0x5f')]);switch(_0x581694[_0x5046('0x39')]){case _0x5046('0x2e'):return db[_[_0x5046('0xaf')](_0x428ecf[_0x5046('0x45')][_0x5046('0xa5')])+_0x5046('0xdf')][_0x5046('0x91')](_0x25d90e);case _0x5046('0x30'):case _0x5046('0x32'):return _0x581694[_0x5046('0x2d')+_[_0x5046('0xaf')](_0x428ecf['query'][_0x5046('0xa5')])+_0x5046('0xad')](_0x25d90e);default:throw new db[(_0x5046('0x98'))][(_0x5046('0x99'))](_0x5046('0xe1'));}})[_0x5046('0x15')](function(_0x16ea56){_0x27c94f=_0x16ea56[_0x5046('0x4e')];if(!_0x428ecf[_0x5046('0x45')][_0x5046('0xdd')](_0x5046('0xde'))){_0x25d90e[_0x5046('0x25')]=qs[_0x5046('0x25')](_0x428ecf['query'][_0x5046('0x25')]);_0x25d90e['offset']=qs[_0x5046('0x24')](_0x428ecf[_0x5046('0x45')][_0x5046('0x24')]);}switch(_0x581694[_0x5046('0x39')]){case _0x5046('0x2e'):return db[_[_0x5046('0xaf')](_0x428ecf[_0x5046('0x45')][_0x5046('0xa5')])+'Queue'][_0x5046('0x91')](_0x25d90e);case'user':case _0x5046('0x32'):return _0x581694[_0x5046('0x2d')+_['capitalize'](_0x428ecf[_0x5046('0x45')][_0x5046('0xa5')])+_0x5046('0xad')](_0x25d90e);}})['then'](function(_0xe3cbc3){return{'count':_0x27c94f,'rows':_0xe3cbc3};})[_0x5046('0x15')](respondWithResult(_0x57c216,null))[_0x5046('0x1f')](handleError(_0x57c216,null));};exports[_0x5046('0xe2')]=function(_0x1f4160,_0x3f8081){var _0x5064be={};var _0x5137e1={};var _0x26c8ff;var _0x3b53fa;return db[_0x5046('0x44')][_0x5046('0x9f')]({'where':{'id':_0x1f4160['params']['id']}})[_0x5046('0x15')](handleEntityNotFound(_0x3f8081,null))[_0x5046('0x15')](function(_0x439ba5){if(_0x439ba5){_0x26c8ff=_0x439ba5;_0x5137e1['model']=_[_0x5046('0x58')](db[_0x5046('0xb4')][_0x5046('0x3e')]);_0x5137e1[_0x5046('0x45')]=_['keys'](_0x1f4160[_0x5046('0x45')]);_0x5137e1['filters']=_['intersection'](_0x5137e1[_0x5046('0x5c')],_0x5137e1[_0x5046('0x45')]);_0x5064be[_0x5046('0x4a')]=_[_0x5046('0x5b')](_0x5137e1[_0x5046('0x5c')],qs[_0x5046('0x5d')](_0x1f4160[_0x5046('0x45')][_0x5046('0x5d')]));_0x5064be[_0x5046('0x4a')]=_0x5064be[_0x5046('0x4a')][_0x5046('0x4e')]?_0x5064be[_0x5046('0x4a')]:_0x5137e1[_0x5046('0x5c')];_0x5064be['order']=qs[_0x5046('0xd3')](_0x1f4160[_0x5046('0x45')]['sort']);_0x5064be[_0x5046('0xd4')]=qs['filters'](_[_0x5046('0xd5')](_0x1f4160[_0x5046('0x45')],_0x5137e1[_0x5046('0x5a')]));if(_0x1f4160[_0x5046('0x45')][_0x5046('0x34')]){_0x5064be[_0x5046('0xd4')]=_[_0x5046('0xd6')](_0x5064be[_0x5046('0xd4')],{'$or':_[_0x5046('0x36')](_0x5064be[_0x5046('0x4a')],function(_0x4b1fa8){var _0xc9012={};_0xc9012[_0x4b1fa8]={'$like':'%'+_0x1f4160[_0x5046('0x45')]['filter']+'%'};return _0xc9012;})});}_0x5064be=_[_0x5046('0xd6')]({},_0x5064be,_0x1f4160[_0x5046('0x5f')]);return _0x26c8ff[_0x5046('0xe2')](_0x5064be);}})[_0x5046('0x15')](function(_0x54c406){if(_0x54c406){_0x3b53fa=_0x54c406['length'];if(!_0x1f4160[_0x5046('0x45')]['hasOwnProperty'](_0x5046('0xde'))){_0x5064be[_0x5046('0x25')]=qs['limit'](_0x1f4160['query']['limit']);_0x5064be[_0x5046('0x24')]=qs[_0x5046('0x24')](_0x1f4160[_0x5046('0x45')]['offset']);}return _0x26c8ff[_0x5046('0xe2')](_0x5064be);}})[_0x5046('0x15')](function(_0xa6fcca){if(_0xa6fcca){return _0xa6fcca?{'count':_0x3b53fa,'rows':_0xa6fcca}:null;}})[_0x5046('0x15')](respondWithResult(_0x3f8081,null))[_0x5046('0x1f')](handleError(_0x3f8081,null));};exports[_0x5046('0xe3')]=function(_0x265403,_0x280b65){var _0x1e81e6={};var _0x5f3fdd={};var _0xb15953;var _0x40fed2;return db[_0x5046('0x44')][_0x5046('0x9f')]({'where':{'id':_0x265403[_0x5046('0x56')]['id']}})[_0x5046('0x15')](handleEntityNotFound(_0x280b65,null))[_0x5046('0x15')](function(_0x141888){if(_0x141888){_0xb15953=_0x141888;_0x5f3fdd[_0x5046('0x5c')]=_[_0x5046('0x58')](db['ChatGroup'][_0x5046('0x3e')]);_0x5f3fdd[_0x5046('0x45')]=_[_0x5046('0x58')](_0x265403[_0x5046('0x45')]);_0x5f3fdd[_0x5046('0x5a')]=_[_0x5046('0x5b')](_0x5f3fdd[_0x5046('0x5c')],_0x5f3fdd[_0x5046('0x45')]);_0x1e81e6['attributes']=_[_0x5046('0x5b')](_0x5f3fdd['model'],qs['fields'](_0x265403[_0x5046('0x45')][_0x5046('0x5d')]));_0x1e81e6[_0x5046('0x4a')]=_0x1e81e6[_0x5046('0x4a')][_0x5046('0x4e')]?_0x1e81e6['attributes']:_0x5f3fdd['model'];_0x1e81e6[_0x5046('0xe0')]=qs[_0x5046('0xd3')](_0x265403[_0x5046('0x45')][_0x5046('0xd3')]);_0x1e81e6[_0x5046('0xd4')]=qs['filters'](_[_0x5046('0xd5')](_0x265403['query'],_0x5f3fdd[_0x5046('0x5a')]));if(_0x265403[_0x5046('0x45')][_0x5046('0x34')]){_0x1e81e6[_0x5046('0xd4')]=_['merge'](_0x1e81e6[_0x5046('0xd4')],{'$or':_[_0x5046('0x36')](_0x1e81e6['attributes'],function(_0x3688ff){var _0x241921={};_0x241921[_0x3688ff]={'$like':'%'+_0x265403['query'][_0x5046('0x34')]+'%'};return _0x241921;})});}_0x1e81e6=_[_0x5046('0xd6')]({},_0x1e81e6,_0x265403['options']);return _0xb15953[_0x5046('0xe3')](_0x1e81e6);}})[_0x5046('0x15')](function(_0x56a8ec){if(_0x56a8ec){_0x40fed2=_0x56a8ec[_0x5046('0x4e')];if(!_0x265403[_0x5046('0x45')][_0x5046('0xdd')]('nolimit')){_0x1e81e6[_0x5046('0x25')]=qs[_0x5046('0x25')](_0x265403[_0x5046('0x45')][_0x5046('0x25')]);_0x1e81e6[_0x5046('0x24')]=qs[_0x5046('0x24')](_0x265403[_0x5046('0x45')][_0x5046('0x24')]);}return _0xb15953['getGroups'](_0x1e81e6);}})[_0x5046('0x15')](function(_0x4da62e){if(_0x4da62e){return _0x4da62e?{'count':_0x40fed2,'rows':_0x4da62e}:null;}})[_0x5046('0x15')](respondWithResult(_0x280b65,null))['catch'](handleError(_0x280b65,null));};exports['getRecordings']=function(_0x325b3f,_0x1be321){var _0x2975b0={'raw':!![],'where':{}};var _0x2fa5dd={};var _0x441f95={'count':0x0,'rows':[]};return db['User'][_0x5046('0x9f')]({'where':{'id':_0x325b3f[_0x5046('0x56')]['id']}})['then'](handleEntityNotFound(_0x1be321,null))['then'](function(_0x22bba4){if(_0x22bba4){_0x2fa5dd[_0x5046('0x5c')]=_[_0x5046('0x58')](db[_0x5046('0xe4')][_0x5046('0x3e')]);_0x2fa5dd['query']=_[_0x5046('0x58')](_0x325b3f['query']);_0x2fa5dd['filters']=_[_0x5046('0x5b')](_0x2fa5dd[_0x5046('0x5c')],_0x2fa5dd['query']);_0x2975b0['attributes']=_['intersection'](_0x2fa5dd['model'],qs[_0x5046('0x5d')](_0x325b3f[_0x5046('0x45')][_0x5046('0x5d')]));_0x2975b0[_0x5046('0x4a')]=_0x2975b0[_0x5046('0x4a')][_0x5046('0x4e')]?_0x2975b0[_0x5046('0x4a')]:_0x2fa5dd[_0x5046('0x5c')];if(!_0x325b3f[_0x5046('0x45')][_0x5046('0xdd')](_0x5046('0xde'))){_0x2975b0[_0x5046('0x25')]=qs[_0x5046('0x25')](_0x325b3f['query']['limit']);_0x2975b0[_0x5046('0x24')]=qs[_0x5046('0x24')](_0x325b3f[_0x5046('0x45')]['offset']);}_0x2975b0[_0x5046('0xe0')]=qs[_0x5046('0xd3')](_0x325b3f[_0x5046('0x45')]['sort']);_0x2975b0[_0x5046('0xd4')]=qs[_0x5046('0x5a')](_[_0x5046('0xd5')](_0x325b3f[_0x5046('0x45')],_0x2fa5dd['filters']));_0x2975b0[_0x5046('0xd4')][_0x5046('0xe5')]=_0x22bba4['id'];if(_0x325b3f['query'][_0x5046('0x34')]){_0x2975b0[_0x5046('0xd4')]=_[_0x5046('0xd6')](_0x2975b0['where'],{'$or':_['map'](_0x2975b0[_0x5046('0x4a')],function(_0x5c5956){var _0x458dd2={};_0x458dd2[_0x5c5956]={'$like':'%'+_0x325b3f[_0x5046('0x45')][_0x5046('0x34')]+'%'};return _0x458dd2;})});}_0x2975b0=_[_0x5046('0xd6')]({},_0x2975b0,_0x325b3f[_0x5046('0x5f')]);return db['VoiceRecording']['count']({'where':_0x2975b0[_0x5046('0xd4')]})[_0x5046('0x15')](function(_0x272db2){_0x441f95[_0x5046('0x27')]=_0x272db2;if(_0x325b3f['query'][_0x5046('0x46')]){_0x2975b0['include']=[{'all':!![]}];}return db[_0x5046('0xe4')][_0x5046('0x91')](_0x2975b0);})[_0x5046('0x15')](function(_0x347b2c){_0x441f95[_0x5046('0x4c')]=_0x347b2c;return _0x441f95;});}})[_0x5046('0x15')](respondWithFilteredResult(_0x1be321,_0x2975b0))[_0x5046('0x1f')](handleError(_0x1be321,null));};exports[_0x5046('0xe6')]=function(_0x3b7306,_0x14955d){var _0x52e062={'raw':!![],'where':{}};var _0x353d1b={};var _0xf2125c={'count':0x0,'rows':[]};return db[_0x5046('0x44')][_0x5046('0x9f')]({'where':{'id':_0x3b7306[_0x5046('0x56')]['id']}})[_0x5046('0x15')](handleEntityNotFound(_0x14955d,null))[_0x5046('0x15')](function(_0x5d7bb9){if(_0x5d7bb9){_0x353d1b[_0x5046('0x5c')]=_[_0x5046('0x58')](db['ScreenRecording']['rawAttributes']);_0x353d1b['query']=_['keys'](_0x3b7306[_0x5046('0x45')]);_0x353d1b[_0x5046('0x5a')]=_[_0x5046('0x5b')](_0x353d1b['model'],_0x353d1b[_0x5046('0x45')]);_0x52e062[_0x5046('0x4a')]=_[_0x5046('0x5b')](_0x353d1b['model'],qs[_0x5046('0x5d')](_0x3b7306['query'][_0x5046('0x5d')]));_0x52e062[_0x5046('0x4a')]=_0x52e062[_0x5046('0x4a')]['length']?_0x52e062[_0x5046('0x4a')]:_0x353d1b['model'];if(!_0x3b7306[_0x5046('0x45')][_0x5046('0xdd')](_0x5046('0xde'))){_0x52e062[_0x5046('0x25')]=qs[_0x5046('0x25')](_0x3b7306[_0x5046('0x45')][_0x5046('0x25')]);_0x52e062[_0x5046('0x24')]=qs['offset'](_0x3b7306[_0x5046('0x45')][_0x5046('0x24')]);}_0x52e062[_0x5046('0xe0')]=qs[_0x5046('0xd3')](_0x3b7306[_0x5046('0x45')][_0x5046('0xd3')]);_0x52e062[_0x5046('0xd4')]=qs['filters'](_['pick'](_0x3b7306[_0x5046('0x45')],_0x353d1b[_0x5046('0x5a')]));_0x52e062['where'][_0x5046('0xe5')]=_0x5d7bb9['id'];if(_0x3b7306['query'][_0x5046('0x34')]){_0x52e062[_0x5046('0xd4')]=_[_0x5046('0xd6')](_0x52e062[_0x5046('0xd4')],{'$or':_[_0x5046('0x36')](_0x52e062[_0x5046('0x4a')],function(_0x100ac0){var _0x10dd31={};_0x10dd31[_0x100ac0]={'$like':'%'+_0x3b7306[_0x5046('0x45')][_0x5046('0x34')]+'%'};return _0x10dd31;})});}_0x52e062=_[_0x5046('0xd6')]({},_0x52e062,_0x3b7306['options']);return db[_0x5046('0xe7')][_0x5046('0x27')]({'where':_0x52e062[_0x5046('0xd4')]})[_0x5046('0x15')](function(_0x36fe0c){_0xf2125c[_0x5046('0x27')]=_0x36fe0c;if(_0x3b7306[_0x5046('0x45')][_0x5046('0x46')]){_0x52e062[_0x5046('0x47')]=[{'all':!![]}];}return db[_0x5046('0xe7')]['findAll'](_0x52e062);})[_0x5046('0x15')](function(_0x2745e1){_0xf2125c['rows']=_0x2745e1;return _0xf2125c;});}})[_0x5046('0x15')](respondWithFilteredResult(_0x14955d,_0x52e062))['catch'](handleError(_0x14955d,null));};exports[_0x5046('0xe8')]=function(_0x205245,_0x2d5c36){var _0x466ce5={};var _0x23a1ea={};var _0x2287dc;var _0x53f2e6;return db[_0x5046('0x44')]['findOne']({'where':{'id':_0x205245[_0x5046('0x56')]['id']}})['then'](handleEntityNotFound(_0x2d5c36,null))[_0x5046('0x15')](function(_0x35b24f){if(_0x35b24f){_0x2287dc=_0x35b24f;_0x23a1ea[_0x5046('0x5c')]=_[_0x5046('0x58')](db[_0x5046('0xe9')]['rawAttributes']);_0x23a1ea[_0x5046('0x45')]=_[_0x5046('0x58')](_0x205245[_0x5046('0x45')]);_0x23a1ea[_0x5046('0x5a')]=_['intersection'](_0x23a1ea['model'],_0x23a1ea['query']);_0x466ce5[_0x5046('0x4a')]=_['intersection'](_0x23a1ea[_0x5046('0x5c')],qs[_0x5046('0x5d')](_0x205245[_0x5046('0x45')][_0x5046('0x5d')]));_0x466ce5[_0x5046('0x4a')]=_0x466ce5['attributes'][_0x5046('0x4e')]?_0x466ce5[_0x5046('0x4a')]:_0x23a1ea['model'];_0x466ce5[_0x5046('0xe0')]=qs['sort'](_0x205245[_0x5046('0x45')]['sort']);_0x466ce5[_0x5046('0xd4')]=qs[_0x5046('0x5a')](_[_0x5046('0xd5')](_0x205245[_0x5046('0x45')],_0x23a1ea['filters']));if(_0x205245['query']['filter']){_0x466ce5[_0x5046('0xd4')]=_[_0x5046('0xd6')](_0x466ce5[_0x5046('0xd4')],{'$or':_['map'](_0x466ce5[_0x5046('0x4a')],function(_0x5b242c){var _0x43bb07={};_0x43bb07[_0x5b242c]={'$like':'%'+_0x205245['query'][_0x5046('0x34')]+'%'};return _0x43bb07;})});}_0x466ce5=_[_0x5046('0xd6')]({},_0x466ce5,_0x205245[_0x5046('0x5f')]);return _0x2287dc[_0x5046('0xe8')](_0x466ce5);}})[_0x5046('0x15')](function(_0x754e41){if(_0x754e41){_0x53f2e6=_0x754e41[_0x5046('0x4e')];if(!_0x205245['query']['hasOwnProperty']('nolimit')){_0x466ce5[_0x5046('0x25')]=qs['limit'](_0x205245['query'][_0x5046('0x25')]);_0x466ce5[_0x5046('0x24')]=qs[_0x5046('0x24')](_0x205245[_0x5046('0x45')][_0x5046('0x24')]);}return _0x2287dc[_0x5046('0xe8')](_0x466ce5);}})[_0x5046('0x15')](function(_0x2dc631){if(_0x2dc631){return _0x2dc631?{'count':_0x53f2e6,'rows':_0x2dc631}:null;}})[_0x5046('0x15')](respondWithResult(_0x2d5c36,null))['catch'](handleError(_0x2d5c36,null));};exports[_0x5046('0xea')]=function(_0x4f92ba,_0x37b13d){var _0x578cf6={};var _0x593f58={};var _0x5e4343;var _0x5695cf;return db[_0x5046('0x44')][_0x5046('0x9f')]({'where':{'id':_0x4f92ba[_0x5046('0x56')]['id']}})[_0x5046('0x15')](handleEntityNotFound(_0x37b13d,null))['then'](function(_0x31e709){if(_0x31e709){_0x5e4343=_0x31e709;_0x593f58[_0x5046('0x5c')]=_[_0x5046('0x58')](db['OpenchannelInteraction'][_0x5046('0x3e')]);_0x593f58['query']=_['keys'](_0x4f92ba[_0x5046('0x45')]);_0x593f58[_0x5046('0x5a')]=_[_0x5046('0x5b')](_0x593f58['model'],_0x593f58[_0x5046('0x45')]);_0x578cf6['attributes']=_[_0x5046('0x5b')](_0x593f58[_0x5046('0x5c')],qs[_0x5046('0x5d')](_0x4f92ba['query'][_0x5046('0x5d')]));_0x578cf6['attributes']=_0x578cf6[_0x5046('0x4a')][_0x5046('0x4e')]?_0x578cf6[_0x5046('0x4a')]:_0x593f58[_0x5046('0x5c')];_0x578cf6[_0x5046('0xe0')]=qs[_0x5046('0xd3')](_0x4f92ba['query'][_0x5046('0xd3')]);_0x578cf6[_0x5046('0xd4')]=qs[_0x5046('0x5a')](_[_0x5046('0xd5')](_0x4f92ba['query'],_0x593f58[_0x5046('0x5a')]));if(_0x4f92ba[_0x5046('0x45')][_0x5046('0x34')]){_0x578cf6[_0x5046('0xd4')]=_[_0x5046('0xd6')](_0x578cf6[_0x5046('0xd4')],{'$or':_[_0x5046('0x36')](_0x578cf6[_0x5046('0x4a')],function(_0x1c2e1a){var _0x19b955={};_0x19b955[_0x1c2e1a]={'$like':'%'+_0x4f92ba[_0x5046('0x45')]['filter']+'%'};return _0x19b955;})});}_0x578cf6=_[_0x5046('0xd6')]({},_0x578cf6,_0x4f92ba[_0x5046('0x5f')]);return _0x5e4343[_0x5046('0xea')](_0x578cf6);}})[_0x5046('0x15')](function(_0x49d0ce){if(_0x49d0ce){_0x5695cf=_0x49d0ce[_0x5046('0x4e')];if(!_0x4f92ba[_0x5046('0x45')]['hasOwnProperty']('nolimit')){_0x578cf6[_0x5046('0x25')]=qs[_0x5046('0x25')](_0x4f92ba[_0x5046('0x45')][_0x5046('0x25')]);_0x578cf6[_0x5046('0x24')]=qs[_0x5046('0x24')](_0x4f92ba['query'][_0x5046('0x24')]);}return _0x5e4343[_0x5046('0xea')](_0x578cf6);}})[_0x5046('0x15')](function(_0x195066){if(_0x195066){return _0x195066?{'count':_0x5695cf,'rows':_0x195066}:null;}})[_0x5046('0x15')](respondWithResult(_0x37b13d,null))[_0x5046('0x1f')](handleError(_0x37b13d,null));};exports[_0x5046('0xeb')]=function(_0x122eeb,_0x49373a){var _0x35b470={'raw':!![],'where':{}};var _0x15e3d9={};var _0x292bfd={'count':0x0,'rows':[]};return db[_0x5046('0x44')]['findOne']({'where':{'id':_0x122eeb['params']['id']}})['then'](handleEntityNotFound(_0x49373a,null))['then'](function(_0xc3c89f){if(_0xc3c89f){_0x15e3d9[_0x5046('0x5c')]=_[_0x5046('0x58')](db[_0x5046('0xec')][_0x5046('0x3e')]);_0x15e3d9[_0x5046('0x45')]=_[_0x5046('0x58')](_0x122eeb['query']);_0x15e3d9['filters']=_[_0x5046('0x5b')](_0x15e3d9['model'],_0x15e3d9[_0x5046('0x45')]);_0x35b470[_0x5046('0x4a')]=_[_0x5046('0x5b')](_0x15e3d9[_0x5046('0x5c')],qs[_0x5046('0x5d')](_0x122eeb[_0x5046('0x45')][_0x5046('0x5d')]));_0x35b470[_0x5046('0x4a')]=_0x35b470[_0x5046('0x4a')][_0x5046('0x4e')]?_0x35b470[_0x5046('0x4a')]:_0x15e3d9[_0x5046('0x5c')];if(!_0x122eeb[_0x5046('0x45')][_0x5046('0xdd')](_0x5046('0xde'))){_0x35b470[_0x5046('0x25')]=qs[_0x5046('0x25')](_0x122eeb[_0x5046('0x45')][_0x5046('0x25')]);_0x35b470[_0x5046('0x24')]=qs[_0x5046('0x24')](_0x122eeb[_0x5046('0x45')][_0x5046('0x24')]);}_0x35b470['order']=qs['sort'](_0x122eeb[_0x5046('0x45')][_0x5046('0xd3')]);_0x35b470['where']=qs[_0x5046('0x5a')](_['pick'](_0x122eeb[_0x5046('0x45')],_0x15e3d9[_0x5046('0x5a')]));_0x35b470[_0x5046('0xd4')]['UserId']=_0xc3c89f['id'];if(_0x122eeb['query'][_0x5046('0x34')]){_0x35b470[_0x5046('0xd4')]=_[_0x5046('0xd6')](_0x35b470['where'],{'$or':_[_0x5046('0x36')](_0x35b470[_0x5046('0x4a')],function(_0x16b31e){var _0x627497={};_0x627497[_0x16b31e]={'$like':'%'+_0x122eeb[_0x5046('0x45')][_0x5046('0x34')]+'%'};return _0x627497;})});}_0x35b470=_[_0x5046('0xd6')]({},_0x35b470,_0x122eeb[_0x5046('0x5f')]);return db[_0x5046('0xec')][_0x5046('0x27')]({'where':_0x35b470[_0x5046('0xd4')]})['then'](function(_0x4b9713){_0x292bfd['count']=_0x4b9713;if(_0x122eeb['query']['includeAll']){_0x35b470[_0x5046('0x47')]=[{'all':!![]}];}return db['MailInteraction']['findAll'](_0x35b470);})[_0x5046('0x15')](function(_0x756a03){_0x292bfd[_0x5046('0x4c')]=_0x756a03;return _0x292bfd;});}})[_0x5046('0x15')](respondWithFilteredResult(_0x49373a,_0x35b470))[_0x5046('0x1f')](handleError(_0x49373a,null));};exports[_0x5046('0xed')]=function(_0x276ab4,_0x5ce12e){var _0x1fb4da={};var _0x571aea={};var _0x13ef87;var _0x1005d0;return db[_0x5046('0x44')][_0x5046('0x9f')]({'where':{'id':_0x276ab4[_0x5046('0x56')]['id']}})[_0x5046('0x15')](handleEntityNotFound(_0x5ce12e,null))[_0x5046('0x15')](function(_0x703b51){if(_0x703b51){_0x13ef87=_0x703b51;_0x571aea['model']=_[_0x5046('0x58')](db[_0x5046('0xee')][_0x5046('0x3e')]);_0x571aea[_0x5046('0x45')]=_[_0x5046('0x58')](_0x276ab4[_0x5046('0x45')]);_0x571aea[_0x5046('0x5a')]=_[_0x5046('0x5b')](_0x571aea['model'],_0x571aea['query']);_0x1fb4da[_0x5046('0x4a')]=_[_0x5046('0x5b')](_0x571aea['model'],qs['fields'](_0x276ab4[_0x5046('0x45')][_0x5046('0x5d')]));_0x1fb4da['attributes']=_0x1fb4da['attributes'][_0x5046('0x4e')]?_0x1fb4da[_0x5046('0x4a')]:_0x571aea[_0x5046('0x5c')];_0x1fb4da['order']=qs[_0x5046('0xd3')](_0x276ab4[_0x5046('0x45')][_0x5046('0xd3')]);_0x1fb4da[_0x5046('0xd4')]=qs[_0x5046('0x5a')](_['pick'](_0x276ab4[_0x5046('0x45')],_0x571aea['filters']));if(_0x276ab4[_0x5046('0x45')][_0x5046('0x34')]){_0x1fb4da[_0x5046('0xd4')]=_[_0x5046('0xd6')](_0x1fb4da[_0x5046('0xd4')],{'$or':_[_0x5046('0x36')](_0x1fb4da['attributes'],function(_0x5e626e){var _0x8aa511={};_0x8aa511[_0x5e626e]={'$like':'%'+_0x276ab4[_0x5046('0x45')]['filter']+'%'};return _0x8aa511;})});}_0x1fb4da=_[_0x5046('0xd6')]({},_0x1fb4da,_0x276ab4[_0x5046('0x5f')]);return _0x13ef87[_0x5046('0xed')](_0x1fb4da);}})[_0x5046('0x15')](function(_0x36865c){if(_0x36865c){_0x1005d0=_0x36865c['length'];if(!_0x276ab4[_0x5046('0x45')][_0x5046('0xdd')](_0x5046('0xde'))){_0x1fb4da[_0x5046('0x25')]=qs[_0x5046('0x25')](_0x276ab4[_0x5046('0x45')][_0x5046('0x25')]);_0x1fb4da[_0x5046('0x24')]=qs[_0x5046('0x24')](_0x276ab4[_0x5046('0x45')][_0x5046('0x24')]);}return _0x13ef87[_0x5046('0xed')](_0x1fb4da);}})['then'](function(_0x380752){if(_0x380752){return _0x380752?{'count':_0x1005d0,'rows':_0x380752}:null;}})[_0x5046('0x15')](respondWithResult(_0x5ce12e,null))[_0x5046('0x1f')](handleError(_0x5ce12e,null));};exports['getFaxInteractions']=function(_0x569b9a,_0x45cd38){var _0x5da8d3={};var _0x23f6a8={};var _0x39dba7;var _0x14576e;return db['User'][_0x5046('0x9f')]({'where':{'id':_0x569b9a[_0x5046('0x56')]['id']}})[_0x5046('0x15')](handleEntityNotFound(_0x45cd38,null))[_0x5046('0x15')](function(_0x1f8efc){if(_0x1f8efc){_0x39dba7=_0x1f8efc;_0x23f6a8[_0x5046('0x5c')]=_['keys'](db[_0x5046('0xef')][_0x5046('0x3e')]);_0x23f6a8[_0x5046('0x45')]=_[_0x5046('0x58')](_0x569b9a['query']);_0x23f6a8['filters']=_[_0x5046('0x5b')](_0x23f6a8['model'],_0x23f6a8[_0x5046('0x45')]);_0x5da8d3[_0x5046('0x4a')]=_[_0x5046('0x5b')](_0x23f6a8['model'],qs[_0x5046('0x5d')](_0x569b9a[_0x5046('0x45')][_0x5046('0x5d')]));_0x5da8d3[_0x5046('0x4a')]=_0x5da8d3[_0x5046('0x4a')]['length']?_0x5da8d3['attributes']:_0x23f6a8[_0x5046('0x5c')];_0x5da8d3['order']=qs['sort'](_0x569b9a[_0x5046('0x45')][_0x5046('0xd3')]);_0x5da8d3[_0x5046('0xd4')]=qs['filters'](_['pick'](_0x569b9a[_0x5046('0x45')],_0x23f6a8[_0x5046('0x5a')]));if(_0x569b9a[_0x5046('0x45')][_0x5046('0x34')]){_0x5da8d3[_0x5046('0xd4')]=_[_0x5046('0xd6')](_0x5da8d3['where'],{'$or':_[_0x5046('0x36')](_0x5da8d3['attributes'],function(_0x403d90){var _0x31514c={};_0x31514c[_0x403d90]={'$like':'%'+_0x569b9a['query'][_0x5046('0x34')]+'%'};return _0x31514c;})});}_0x5da8d3=_[_0x5046('0xd6')]({},_0x5da8d3,_0x569b9a[_0x5046('0x5f')]);return _0x39dba7[_0x5046('0xf0')](_0x5da8d3);}})[_0x5046('0x15')](function(_0x3c784a){if(_0x3c784a){_0x14576e=_0x3c784a[_0x5046('0x4e')];if(!_0x569b9a['query'][_0x5046('0xdd')](_0x5046('0xde'))){_0x5da8d3[_0x5046('0x25')]=qs['limit'](_0x569b9a[_0x5046('0x45')][_0x5046('0x25')]);_0x5da8d3[_0x5046('0x24')]=qs[_0x5046('0x24')](_0x569b9a[_0x5046('0x45')][_0x5046('0x24')]);}return _0x39dba7[_0x5046('0xf0')](_0x5da8d3);}})[_0x5046('0x15')](function(_0xdc13b0){if(_0xdc13b0){return _0xdc13b0?{'count':_0x14576e,'rows':_0xdc13b0}:null;}})[_0x5046('0x15')](respondWithResult(_0x45cd38,null))[_0x5046('0x1f')](handleError(_0x45cd38,null));};exports[_0x5046('0xf1')]=function(_0x26802e,_0x270e0b){var _0x37ad3f={};var _0x1d4cb5={};var _0x4d0dce;var _0x1f6b2f;return db[_0x5046('0x44')][_0x5046('0x9f')]({'where':{'id':_0x26802e[_0x5046('0x56')]['id']}})['then'](handleEntityNotFound(_0x270e0b,null))[_0x5046('0x15')](function(_0x58132f){if(_0x58132f){_0x4d0dce=_0x58132f;_0x1d4cb5[_0x5046('0x5c')]=_[_0x5046('0x58')](db[_0x5046('0xf2')][_0x5046('0x3e')]);_0x1d4cb5[_0x5046('0x45')]=_[_0x5046('0x58')](_0x26802e[_0x5046('0x45')]);_0x1d4cb5['filters']=_['intersection'](_0x1d4cb5['model'],_0x1d4cb5[_0x5046('0x45')]);_0x37ad3f['attributes']=_['intersection'](_0x1d4cb5[_0x5046('0x5c')],qs[_0x5046('0x5d')](_0x26802e[_0x5046('0x45')][_0x5046('0x5d')]));_0x37ad3f[_0x5046('0x4a')]=_0x37ad3f[_0x5046('0x4a')][_0x5046('0x4e')]?_0x37ad3f[_0x5046('0x4a')]:_0x1d4cb5[_0x5046('0x5c')];_0x37ad3f[_0x5046('0xe0')]=qs[_0x5046('0xd3')](_0x26802e[_0x5046('0x45')]['sort']);_0x37ad3f[_0x5046('0xd4')]=qs['filters'](_[_0x5046('0xd5')](_0x26802e[_0x5046('0x45')],_0x1d4cb5[_0x5046('0x5a')]));if(_0x26802e[_0x5046('0x45')][_0x5046('0x34')]){_0x37ad3f[_0x5046('0xd4')]=_[_0x5046('0xd6')](_0x37ad3f['where'],{'$or':_[_0x5046('0x36')](_0x37ad3f['attributes'],function(_0x3d18f5){var _0x400c43={};_0x400c43[_0x3d18f5]={'$like':'%'+_0x26802e[_0x5046('0x45')][_0x5046('0x34')]+'%'};return _0x400c43;})});}_0x37ad3f=_[_0x5046('0xd6')]({},_0x37ad3f,_0x26802e[_0x5046('0x5f')]);return _0x4d0dce[_0x5046('0xf1')](_0x37ad3f);}})[_0x5046('0x15')](function(_0x324670){if(_0x324670){_0x1f6b2f=_0x324670[_0x5046('0x4e')];if(!_0x26802e['query'][_0x5046('0xdd')](_0x5046('0xde'))){_0x37ad3f[_0x5046('0x25')]=qs[_0x5046('0x25')](_0x26802e[_0x5046('0x45')][_0x5046('0x25')]);_0x37ad3f[_0x5046('0x24')]=qs[_0x5046('0x24')](_0x26802e[_0x5046('0x45')][_0x5046('0x24')]);}return _0x4d0dce[_0x5046('0xf1')](_0x37ad3f);}})[_0x5046('0x15')](function(_0x47f65f){if(_0x47f65f){return _0x47f65f?{'count':_0x1f6b2f,'rows':_0x47f65f}:null;}})['then'](respondWithResult(_0x270e0b,null))[_0x5046('0x1f')](handleError(_0x270e0b,null));};exports[_0x5046('0xf3')]=function(_0x11e942,_0x4ae0ff,_0x5c1a50){var _0xcbbdf8;var _0x285413;var _0x8563b9;var _0x18a495=!_[_0x5046('0x6e')](_0x11e942['params']['id'])?_0x11e942[_0x5046('0x56')]['id']:!_['isNil'](_0x11e942[_0x5046('0x30')]['id'])?_0x11e942[_0x5046('0x30')]['id']:null;return db[_0x5046('0x44')][_0x5046('0x3a')]({'where':{'id':_0x18a495,'role':{'$or':[_0x5046('0x2e'),_0x5046('0x30'),_0x5046('0x32')]}},'attributes':['id','name',_0x5046('0xf4'),_0x5046('0xf5'),'role',_0x5046('0x65'),'loginInPause']})['then'](function(_0x6d0be8){if(_0x6d0be8){if(_0x6d0be8[_0x5046('0x39')]===_0x5046('0x32')){_0xcbbdf8=_0x6d0be8;if(_0x11e942[_0x5046('0x61')][_0x5046('0xa9')]){_0x8563b9=util['format']('LOCAL/%s@from-sip/n',_0xcbbdf8[_0x11e942['body'][_0x5046('0xa9')]]);}else if(_0x11e942[_0x5046('0x61')][_0x5046('0xf6')]){_0x8563b9=util['format'](_0x5046('0xb3'),_0x11e942[_0x5046('0x61')]['intrf']);}else{_0x8563b9=util[_0x5046('0xf7')](_0x5046('0xb3'),_0xcbbdf8['name']);}socket['to'](util[_0x5046('0xf7')]('user:%s',_0xcbbdf8[_0x5046('0x3c')]))[_0x5046('0x2a')]('user:forcelogout',{'user':{'id':_0xcbbdf8['id'],'name':_0xcbbdf8[_0x5046('0x3c')]},'ip':_0x11e942[_0x5046('0xf8')]['x-forwarded-for']||_0x11e942[_0x5046('0xf9')][_0x5046('0xfa')]||_0x11e942['socket']['remoteAddress']||_0x11e942['connection'][_0x5046('0xfb')][_0x5046('0xfa')]});return db[_0x5046('0xb4')][_0x5046('0x2c')]({'where':{'membername':_0xcbbdf8[_0x5046('0x3c')]},'individualHooks':!![]});}}else{throw new db[(_0x5046('0x98'))]['ValidationError'](_0x5046('0xfc'));}})[_0x5046('0x15')](function(){if(_0xcbbdf8){return _0xcbbdf8[_0x5046('0xfd')]({'raw':!![]});}})[_0x5046('0x15')](function(_0x473288){if(_0xcbbdf8){if(_0x473288){_0x285413=_0x473288;if(_0x285413[_0x5046('0x4e')]){var _0x38064e=_0x285413[_0x5046('0x36')](function(_0x1d2679){var _0x3dba5a={'membername':_0xcbbdf8[_0x5046('0x3c')],'UserId':_0xcbbdf8['id'],'queue_name':_0x1d2679[_0x5046('0x3c')],'VoiceQueueId':_0x1d2679['id'],'interface':_0x8563b9,'paused':_0xcbbdf8[_0x5046('0xa7')]||![],'penalty':_0x1d2679['UserVoiceQueue.penalty']||0x0};return db[_0x5046('0xb4')]['upsert'](_0x3dba5a);});return Promise[_0x5046('0x60')](_0x38064e);}}}})[_0x5046('0x15')](function(){if(_0xcbbdf8){return db[_0x5046('0xfe')][_0x5046('0x91')]({'where':{'membername':_0xcbbdf8['name'],'exitAt':null}});}})[_0x5046('0x15')](function(_0x22cbd7){if(_0xcbbdf8){var _0x2e3534=[];_0x22cbd7[_0x5046('0xff')](function(_0x1e44d2){_0x2e3534[_0x5046('0x4b')](_0x1e44d2['update']({'exitAt':moment()[_0x5046('0xf7')](_0x5046('0x100'))}));});return Promise[_0x5046('0x60')](_0x2e3534);}})[_0x5046('0x15')](function(){if(_0xcbbdf8){var _0x31733b=[];var _0x411bce=[];var _0x4d4474=utils[_0x5046('0x101')]();var _0x1c3ea5={'membername':_0xcbbdf8[_0x5046('0x3c')],'interface':_0x8563b9,'enterAt':moment()[_0x5046('0xf7')](_0x5046('0x100')),'role':_0xcbbdf8[_0x5046('0x39')],'internal':_0xcbbdf8['internal']};_0x4d4474[_0x5046('0xff')](function(_0x457edf){_0x31733b[_0x5046('0x4b')](_[_0x5046('0xd6')]({'channel':_0x457edf,'type':_0x5046('0x102'),'data1':_0x11e942['body']['device'],'data2':_0x8563b9},_0x1c3ea5));if(_0xcbbdf8[_0x5046('0xa7')]){_0x411bce[_0x5046('0x4b')](_[_0x5046('0xd6')]({'channel':_0x457edf,'type':_0x5046('0x103'),'data1':_0x5046('0x104')},_0x1c3ea5));}});return db[_0x5046('0xfe')][_0x5046('0x8d')](_0x31733b[_0x5046('0xd0')](_0x411bce),{'individualHooks':!![]});}})[_0x5046('0x15')](function(){if(_0xcbbdf8){return _0xcbbdf8['update']({'online':!![],'lastLoginAt':moment()[_0x5046('0xf7')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0xcbbdf8[_0x5046('0xa7')]||![],'mailPause':_0xcbbdf8['loginInPause']||![],'chatPause':_0xcbbdf8[_0x5046('0xa7')]||![],'faxPause':_0xcbbdf8[_0x5046('0xa7')]||![],'smsPause':_0xcbbdf8[_0x5046('0xa7')]||![],'openchannelPause':_0xcbbdf8[_0x5046('0xa7')]||![],'whatsappPause':_0xcbbdf8[_0x5046('0xa7')]||![],'pauseType':_0xcbbdf8['loginInPause']?_0x5046('0x104'):null,'interface':_0x8563b9,'lastPauseAt':moment()[_0x5046('0xf7')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x5046('0x15')](function(_0x4d3586){if(_0x11e942[_0x5046('0x105')]){return _0x5c1a50();}else{return Promise[_0x5046('0x106')](_0x4d3586)[_0x5046('0x15')](respondWithResult(_0x4ae0ff,null));}})['catch'](handleError(_0x4ae0ff,null));};exports['logout']=function(_0x302995,_0x300739){var _0x5b1fa4;return db[_0x5046('0x44')]['find']({'where':{'id':_0x302995[_0x5046('0x56')]['id'],'role':_0x5046('0x32')},'attributes':['id',_0x5046('0x3c'),'role']})['then'](handleEntityNotFound(_0x300739,null))[_0x5046('0x15')](function(_0x3cd27c){if(_0x3cd27c){_0x5b1fa4=_0x3cd27c;return db['UserVoiceQueueRt'][_0x5046('0x2c')]({'where':{'membername':_0x5b1fa4[_0x5046('0x3c')]},'individualHooks':!![]});}})[_0x5046('0x15')](function(){return db[_0x5046('0xfe')][_0x5046('0x91')]({'where':{'membername':_0x5b1fa4[_0x5046('0x3c')],'exitAt':null}});})[_0x5046('0x15')](function(_0x4aa4a4){var _0x55b670=[];_0x4aa4a4[_0x5046('0xff')](function(_0x42edd7){_0x55b670[_0x5046('0x4b')](_0x42edd7['update']({'exitAt':moment()[_0x5046('0xf7')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x5046('0x60')](_0x55b670);})[_0x5046('0x15')](function(){return _0x5b1fa4[_0x5046('0x29')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x5046('0x15')](respondWithResult(_0x300739,null))[_0x5046('0x1f')](handleError(_0x300739,null));};exports[_0x5046('0x107')]=function(_0x33dd0f,_0x4fd4d9){var _0x366940;return db[_0x5046('0xb4')][_0x5046('0x29')]({'paused':0x1},{'where':{'UserId':_0x33dd0f['params']['id']},'individualHooks':!![]})[_0x5046('0x15')](function(){return db[_0x5046('0x44')][_0x5046('0x3a')]({'where':{'id':_0x33dd0f['params']['id'],'role':_0x5046('0x32')},'attributes':['id',_0x5046('0x3c'),_0x5046('0x39'),_0x5046('0x65'),_0x5046('0xa9'),_0x5046('0xa6')]});})[_0x5046('0x15')](handleEntityNotFound(_0x4fd4d9,null))[_0x5046('0x15')](function(_0x120a3c){if(_0x120a3c){_0x366940=_0x120a3c;return respondWithRpcPromise('QueuePause',_0x5046('0x107'),{'id':_0x366940['id'],'name':_0x366940['name'],'pause':!![]});}})[_0x5046('0x15')](function(){if(_0x366940){return db[_0x5046('0xfe')][_0x5046('0x91')]({'where':{'membername':_0x366940[_0x5046('0x3c')],'type':_0x5046('0x103'),'exitAt':null}});}})['then'](function(_0x547254){if(_0x547254[_0x5046('0x4e')]){var _0x17f00d=moment()['format'](_0x5046('0x100'));for(var _0x387dde=0x0,_0x1892da=_0x547254[_0x5046('0x4e')];_0x387dde<_0x1892da;_0x387dde++){_0x547254[_0x387dde][_0x5046('0x108')]({'exitAt':_0x17f00d});}}})['then'](function(){var _0x3ee7ed=[];var _0x9324c2=utils[_0x5046('0x101')]();_0x9324c2[_0x5046('0xff')](function(_0x1d10e8){_0x3ee7ed[_0x5046('0x4b')]({'channel':_0x1d10e8,'membername':_0x366940['name'],'interface':_[_0x5046('0x6e')](_0x366940[_0x5046('0xa9')])?util[_0x5046('0xf7')](_0x5046('0xb3'),_0x366940[_0x5046('0x3c')]):_0x366940[_0x5046('0xa9')],'type':_0x5046('0x103'),'enterAt':moment()[_0x5046('0xf7')](_0x5046('0x100')),'data1':_0x33dd0f[_0x5046('0x61')][_0x5046('0x40')]||'DEFAULT\x20PAUSE','role':_0x366940[_0x5046('0x39')],'internal':_0x366940[_0x5046('0x65')]});});return db[_0x5046('0xfe')][_0x5046('0x8d')](_0x3ee7ed,{'individualHooks':!![]});})[_0x5046('0x15')](function(){return _0x366940[_0x5046('0x29')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x33dd0f[_0x5046('0x61')][_0x5046('0x40')]||_0x5046('0x109'),'lastPauseAt':moment()[_0x5046('0xf7')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x5046('0x15')](respondWithResult(_0x4fd4d9,null))[_0x5046('0x1f')](handleError(_0x4fd4d9,null));};exports[_0x5046('0x10a')]=function(_0x110bf1,_0xf43a4c){if(_0x110bf1['body'][_0x5046('0xa5')]&&!utils[_0x5046('0xaa')](_0x110bf1[_0x5046('0x61')][_0x5046('0xa5')])){throw new APIBadRequestError(util[_0x5046('0xf7')](_0x5046('0x10b'),_0x110bf1['body'][_0x5046('0xa5')]));}return db['User'][_0x5046('0x3a')]({'where':{'id':_0x110bf1[_0x5046('0x56')]['id']},'attributes':['id',_0x5046('0x3c'),_0x5046('0x39'),_0x5046('0x65'),_0x5046('0xa9'),_0x5046('0xa6'),_0x5046('0xa8'),_0x5046('0x10c'),'chatPause',_0x5046('0x10d'),_0x5046('0x10e'),_0x5046('0x10f'),_0x5046('0x110'),_0x5046('0x111'),_0x5046('0x112')]})[_0x5046('0x15')](function(_0x31d558){if(!_0x31d558){throw new APINotFoundError(util[_0x5046('0xf7')](_0x5046('0x113'),_0x110bf1[_0x5046('0x56')]['id']));}return _0x31d558[_0x5046('0x10a')](_0x110bf1['body'][_0x5046('0xa5')]);})['then'](respondWithResult(_0xf43a4c,null))[_0x5046('0x1f')](APIHandleError(_0xf43a4c));};exports[_0x5046('0x114')]=function(_0x556037,_0x5abe7d){var _0x5b66bb={};var _0x72d210={};var _0x4ac68b;var _0x391da3;return db[_0x5046('0x44')][_0x5046('0x9f')]({'where':{'id':_0x556037[_0x5046('0x56')]['id']}})[_0x5046('0x15')](handleEntityNotFound(_0x5abe7d,null))[_0x5046('0x15')](function(_0x31765e){if(_0x31765e){_0x4ac68b=_0x31765e;_0x72d210['model']=_[_0x5046('0x58')](db[_0x5046('0x115')]['rawAttributes']);_0x72d210[_0x5046('0x45')]=_['keys'](_0x556037[_0x5046('0x45')]);_0x72d210[_0x5046('0x5a')]=_['intersection'](_0x72d210['model'],_0x72d210[_0x5046('0x45')]);_0x5b66bb[_0x5046('0x4a')]=_[_0x5046('0x5b')](_0x72d210['model'],qs[_0x5046('0x5d')](_0x556037[_0x5046('0x45')][_0x5046('0x5d')]));_0x5b66bb['attributes']=_0x5b66bb[_0x5046('0x4a')][_0x5046('0x4e')]?_0x5b66bb['attributes']:_0x72d210[_0x5046('0x5c')];_0x5b66bb['order']=qs[_0x5046('0xd3')](_0x556037['query'][_0x5046('0xd3')]);_0x5b66bb[_0x5046('0xd4')]=qs[_0x5046('0x5a')](_[_0x5046('0xd5')](_0x556037['query'],_0x72d210['filters']));if(_0x556037['query']['filter']){_0x5b66bb[_0x5046('0xd4')]=_[_0x5046('0xd6')](_0x5b66bb[_0x5046('0xd4')],{'$or':_['map'](_0x5b66bb[_0x5046('0x4a')],function(_0x454396){var _0x2e68b9={};_0x2e68b9[_0x454396]={'$like':'%'+_0x556037[_0x5046('0x45')][_0x5046('0x34')]+'%'};return _0x2e68b9;})});}_0x5b66bb=_[_0x5046('0xd6')]({},_0x5b66bb,_0x556037[_0x5046('0x5f')]);return _0x4ac68b[_0x5046('0x114')](_0x5b66bb);}})[_0x5046('0x15')](function(_0x5d96a2){if(_0x5d96a2){_0x391da3=_0x5d96a2[_0x5046('0x4e')];if(!_0x556037[_0x5046('0x45')]['hasOwnProperty'](_0x5046('0xde'))){_0x5b66bb['limit']=qs[_0x5046('0x25')](_0x556037[_0x5046('0x45')]['limit']);_0x5b66bb[_0x5046('0x24')]=qs[_0x5046('0x24')](_0x556037['query'][_0x5046('0x24')]);}return _0x4ac68b[_0x5046('0x114')](_0x5b66bb);}})['then'](function(_0x307316){if(_0x307316){return _0x307316?{'count':_0x391da3,'rows':_0x307316}:null;}})['then'](respondWithResult(_0x5abe7d,null))[_0x5046('0x1f')](handleError(_0x5abe7d,null));};exports[_0x5046('0x116')]=function(_0x43afad,_0x5607f7){var _0x4d3f0d=_0x43afad[_0x5046('0x56')]['id'];var _0x5677cc=_0x43afad['body']?_0x43afad['body']['ids']:null;var _0x41cb74=[];return Promise[_0x5046('0x106')]()[_0x5046('0x15')](function(){if(!_0x5677cc)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x5046('0x15')](function(){return db[_0x5046('0x44')][_0x5046('0x9f')]({'where':{'id':_0x4d3f0d}});})[_0x5046('0x15')](function(_0x2fff95){if(!_0x2fff95)throw new APINotFoundError(util[_0x5046('0xf7')](_0x5046('0x113'),_0x43afad['params']['id']));return db[_0x5046('0x6c')][_0x5046('0x117')](function(_0x44e0fe){return _0x2fff95[_0x5046('0x116')](_0x5677cc,{'transaction':_0x44e0fe})[_0x5046('0x15')](function(){return db[_0x5046('0x115')]['findAll']({'where':{'id':{'$in':_0x5677cc}}});})['then'](function(_0x4b112c){var _0x17b5a6=_['map'](_0x4b112c,function(_0x4c661f){return _0x4c661f['getAssociatedQueues']();});return Promise[_0x5046('0x60')](_0x17b5a6);})['then'](function(_0x17867d){_0x41cb74=_[_0x5046('0x118')](_0x17867d);var _0x1dc6e1=_['map'](_0x41cb74,function(_0x402fcb){return _0x402fcb['addAgent'](_0x2fff95['id'],{'transaction':_0x44e0fe});});return Promise[_0x5046('0x60')](_0x1dc6e1);})[_0x5046('0x15')](function(){if(!_0x2fff95['online'])return;var _0x20aaa1=_[_0x5046('0x34')](_0x41cb74,function(_0x50061f){return _0x50061f[_0x5046('0x119')]('channel')===_0x5046('0x11a');});var _0x514d99=_[_0x5046('0x36')](_0x20aaa1,function(_0x47066c){return db[_0x5046('0xb4')][_0x5046('0xb5')]({'membername':_0x2fff95[_0x5046('0x3c')],'UserId':_0x2fff95['id'],'queue_name':_0x47066c[_0x5046('0x3c')],'VoiceQueueId':_0x47066c['id'],'interface':_[_0x5046('0x6e')](_0x2fff95['interface'])?util[_0x5046('0xf7')](_0x5046('0xb3'),_0x2fff95[_0x5046('0x3c')]):_0x2fff95[_0x5046('0xa9')],'paused':_0x2fff95[_0x5046('0xa8')]||![],'penalty':_0x2fff95[_0x5046('0xae')]},{'transaction':_0x44e0fe});});return Promise[_0x5046('0x60')](_0x514d99);})[_0x5046('0x15')](function(){return db[_0x5046('0x11b')][_0x5046('0x91')]({'where':{'teamId':{'$in':_0x5677cc}}});})['then'](function(_0xaefb77){var _0x355cce=_['map'](_0xaefb77,function(_0x313af0){return db[_0x5046('0x11c')]['create']({'UserId':_0x2fff95['id'],'VoicePrefixId':_0x313af0[_0x5046('0x11d')]},{'transaction':_0x44e0fe});});return Promise['all'](_0x355cce);});});})[_0x5046('0x15')](function(){for(var _0x3e59cc=0x0;_0x3e59cc<_0x41cb74[_0x5046('0x4e')];_0x3e59cc++){var _0x599d56=_0x41cb74[_0x3e59cc][_0x5046('0x119')](_0x5046('0xa5'));var _0x5c1e9a=_0x599d56+'QueueId';socket[_0x5046('0x2a')]('user'+_0x599d56+_0x5046('0xb0'),{'UserId':_0x4d3f0d,['queueField']:_0x41cb74[_0x3e59cc]['id']});}})[_0x5046('0x15')](respondWithStatusCode(_0x5607f7,null))['catch'](APIHandleError(_0x5607f7));};exports[_0x5046('0x11e')]=function(_0x163551,_0x460202){var _0x233e63=_0x163551[_0x5046('0x56')]['id'];var _0x33b9a7=null;if(_0x163551[_0x5046('0x45')][_0x5046('0x64')]){_0x33b9a7=_['isArray'](_0x163551[_0x5046('0x45')][_0x5046('0x64')])?_0x163551[_0x5046('0x45')]['ids']:[_0x163551[_0x5046('0x45')][_0x5046('0x64')]];}var _0xadff9e=[];return Promise[_0x5046('0x106')]()['then'](function(){if(!_0x33b9a7)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})['then'](function(){return db[_0x5046('0x44')][_0x5046('0x9f')]({'where':{'id':_0x233e63}});})['then'](function(_0x5bee45){if(!_0x5bee45)throw new APINotFoundError(util[_0x5046('0xf7')](_0x5046('0x113'),_0x163551[_0x5046('0x56')]['id']));return db['sequelize'][_0x5046('0x117')](function(_0x5335db){return _0x5bee45[_0x5046('0x11e')](_0x33b9a7,{'transaction':_0x5335db})[_0x5046('0x15')](function(){return db[_0x5046('0x115')][_0x5046('0x91')]({'where':{'id':{'$in':_0x33b9a7}}});})['then'](function(_0x27f714){var _0x414acf=_[_0x5046('0x36')](_0x27f714,function(_0x1bf65b){return _0x1bf65b[_0x5046('0x11f')]();});return Promise['all'](_0x414acf);})[_0x5046('0x15')](function(_0x2dc3b9){_0xadff9e=_[_0x5046('0x118')](_0x2dc3b9);var _0x4f740e=_[_0x5046('0x36')](_0xadff9e,function(_0x2d6497){return _0x2d6497['removeAgent'](_0x5bee45['id'],{'transaction':_0x5335db});});return Promise[_0x5046('0x60')](_0x4f740e);})[_0x5046('0x15')](function(){if(!_0x5bee45[_0x5046('0xa6')])return;var _0x19b7de=_[_0x5046('0x34')](_0xadff9e,function(_0x56a661){return _0x56a661[_0x5046('0x119')]('channel')==='Voice';});var _0x3fbb78=_[_0x5046('0x36')](_0x19b7de,function(_0x39afd3){return db['UserVoiceQueueRt'][_0x5046('0x2c')]({'where':{'VoiceQueueId':_0x39afd3['id'],'UserId':_0x5bee45['id']},'transaction':_0x5335db});});return Promise[_0x5046('0x60')](_0x3fbb78);})[_0x5046('0x15')](function(){return db['TeamVoicePrefix']['findAll']({'where':{'teamId':{'$in':_0x33b9a7}}});})[_0x5046('0x15')](function(_0x2c4a75){var _0xce16ad=_[_0x5046('0x36')](_0x2c4a75,function(_0x370967){return db[_0x5046('0x11c')][_0x5046('0x2c')]({'where':{'UserId':_0x5bee45['id'],'VoicePrefixId':_0x370967[_0x5046('0x11d')]}},{'transaction':_0x5335db});});return Promise[_0x5046('0x60')](_0xce16ad);});});})[_0x5046('0x15')](function(){for(var _0x4a4054=0x0;_0x4a4054<_0xadff9e[_0x5046('0x4e')];_0x4a4054++){var _0x14905d=_0xadff9e[_0x4a4054][_0x5046('0x119')](_0x5046('0xa5'));var _0x3df8ef=_0x14905d+_0x5046('0xb9');socket[_0x5046('0x2a')]('user'+_0x14905d+_0x5046('0xba'),{'UserId':_0x233e63,['queueField']:_0xadff9e[_0x4a4054]['id']});}})['then'](respondWithStatusCode(_0x460202,null))[_0x5046('0x1f')](APIHandleError(_0x460202));};exports['getLists']=function(_0x5ec486,_0x646a55){var _0x11b871={};var _0x25a39c={};var _0x48b212;var _0x1d5672;return db[_0x5046('0x44')]['findOne']({'where':{'id':_0x5ec486[_0x5046('0x56')]['id']}})['then'](handleEntityNotFound(_0x646a55,null))[_0x5046('0x15')](function(_0x3acffa){if(_0x3acffa){_0x48b212=_0x3acffa;_0x25a39c[_0x5046('0x5c')]=_[_0x5046('0x58')](db[_0x5046('0xd7')][_0x5046('0x3e')]);_0x25a39c[_0x5046('0x45')]=_[_0x5046('0x58')](_0x5ec486[_0x5046('0x45')]);_0x25a39c['filters']=_[_0x5046('0x5b')](_0x25a39c['model'],_0x25a39c['query']);_0x11b871['attributes']=_['intersection'](_0x25a39c[_0x5046('0x5c')],qs[_0x5046('0x5d')](_0x5ec486[_0x5046('0x45')][_0x5046('0x5d')]));_0x11b871[_0x5046('0x4a')]=_0x11b871[_0x5046('0x4a')][_0x5046('0x4e')]?_0x11b871[_0x5046('0x4a')]:_0x25a39c[_0x5046('0x5c')];_0x11b871[_0x5046('0xe0')]=qs[_0x5046('0xd3')](_0x5ec486[_0x5046('0x45')][_0x5046('0xd3')]);_0x11b871[_0x5046('0xd4')]=qs[_0x5046('0x5a')](_[_0x5046('0xd5')](_0x5ec486[_0x5046('0x45')],_0x25a39c['filters']));if(_0x5ec486[_0x5046('0x45')][_0x5046('0x34')]){_0x11b871[_0x5046('0xd4')]=_['merge'](_0x11b871[_0x5046('0xd4')],{'$or':_[_0x5046('0x36')](_0x11b871['attributes'],function(_0x262518){var _0x3192d4={};_0x3192d4[_0x262518]={'$like':'%'+_0x5ec486[_0x5046('0x45')][_0x5046('0x34')]+'%'};return _0x3192d4;})});}_0x11b871=_[_0x5046('0xd6')]({},_0x11b871,_0x5ec486['options']);return _0x48b212[_0x5046('0x120')](_0x11b871);}})[_0x5046('0x15')](function(_0x2f800f){if(_0x2f800f){_0x1d5672=_0x2f800f[_0x5046('0x4e')];if(!_0x5ec486[_0x5046('0x45')][_0x5046('0xdd')](_0x5046('0xde'))){_0x11b871[_0x5046('0x25')]=qs[_0x5046('0x25')](_0x5ec486['query']['limit']);_0x11b871['offset']=qs[_0x5046('0x24')](_0x5ec486['query'][_0x5046('0x24')]);}return _0x48b212[_0x5046('0x120')](_0x11b871);}})[_0x5046('0x15')](function(_0x2083d8){if(_0x2083d8){return _0x2083d8?{'count':_0x1d5672,'rows':_0x2083d8}:null;}})[_0x5046('0x15')](respondWithResult(_0x646a55,null))[_0x5046('0x1f')](handleError(_0x646a55,null));};exports['getAgents']=function(_0x869942,_0x135177){var _0x42b099={};var _0x15fc7d={};var _0x21743a;return db[_0x5046('0x44')]['findOne']({'where':{'id':_0x869942['params']['id']}})['then'](handleEntityNotFound(_0x135177,null))[_0x5046('0x15')](function(_0x3d8efa){if(_0x3d8efa){_0x21743a=_0x3d8efa;_0x15fc7d[_0x5046('0x5c')]=_['keys'](db[_0x5046('0x44')]['rawAttributes']);_0x15fc7d['query']=_['keys'](_0x869942['query']);_0x15fc7d[_0x5046('0x5a')]=_[_0x5046('0x5b')](_0x15fc7d[_0x5046('0x5c')],_0x15fc7d[_0x5046('0x45')]);_0x42b099['attributes']=_[_0x5046('0x5b')](_0x15fc7d[_0x5046('0x5c')],qs[_0x5046('0x5d')](_0x869942[_0x5046('0x45')][_0x5046('0x5d')]));_0x42b099[_0x5046('0x4a')]=_0x42b099[_0x5046('0x4a')][_0x5046('0x4e')]?_0x42b099[_0x5046('0x4a')]:_0x15fc7d[_0x5046('0x5c')];_0x42b099[_0x5046('0xe0')]=qs[_0x5046('0xd3')](_0x869942[_0x5046('0x45')][_0x5046('0xd3')]);_0x42b099[_0x5046('0xd4')]=qs[_0x5046('0x5a')](_['pick'](_0x869942[_0x5046('0x45')],_0x15fc7d[_0x5046('0x5a')]));if(_0x869942['query'][_0x5046('0x34')]){_0x42b099[_0x5046('0xd4')]=_[_0x5046('0xd6')](_0x42b099['where'],{'$or':_[_0x5046('0x36')](_0x42b099[_0x5046('0x4a')],function(_0x4d86ce){var _0x5f0f6a={};_0x5f0f6a[_0x4d86ce]={'$like':'%'+_0x869942['query'][_0x5046('0x34')]+'%'};return _0x5f0f6a;})});}_0x42b099[_0x5046('0x5c')]=db[_0x5046('0x44')];_0x42b099['as']=_0x5046('0x31');_0x42b099=_['merge']({},_0x42b099,_0x869942[_0x5046('0x5f')]);return _0x21743a[_0x5046('0xfd')]({'include':[_0x42b099]});}})[_0x5046('0x15')](function(_0x774508){if(_0x774508){var _0x382ea3={},_0x14c1be=[];for(var _0x147d06=0x0;_0x147d06<_0x774508[_0x5046('0x4e')];_0x147d06+=0x1){for(var _0x5069f6=0x0,_0x137c3f;_0x5069f6<_0x774508[_0x147d06][_0x5046('0x31')][_0x5046('0x4e')];_0x5069f6+=0x1){_0x137c3f=_0x774508[_0x147d06]['Agents'][_0x5069f6]['get']({'plain':!![]});_0x382ea3[_0x137c3f['id']]=_0x137c3f;}}_0x382ea3=_[_0x5046('0x121')](_0x382ea3);for(var _0x1f07b3=qs[_0x5046('0x24')](_0x869942[_0x5046('0x45')][_0x5046('0x24')]);_0x1f07b3<_0x382ea3[_0x5046('0x4e')]&&_0x14c1be[_0x5046('0x4e')]=_0x5db1fb){_0x53ead8=_0x5db1fb;_0x23fa4c=0xc8;}else{_0x23fa4c=0xce;}_0x18582e[_0xf70d('0x21')](_0x23fa4c);return _0x18582e[_0xf70d('0x28')](_0xf70d('0x29'),_0x2c84fa+'-'+_0x53ead8+'/'+_0x5db1fb)['json'](_0x596fbe);}return null;};}function saveUpdates(_0x44ddfb){return function(_0x2cf494){if(_0x2cf494){return _0x2cf494[_0xf70d('0x2a')](_0x44ddfb)[_0xf70d('0x17')](function(_0x5b792e){socket[_0xf70d('0x2b')]('userNotification:recalc:'+_0x5b792e['id'],{});return _0x5b792e;});}return null;};}function removeEntity(_0x3d07ae){return function(_0x1b7fd8){if(_0x1b7fd8){return _0x1b7fd8['destroy']()[_0xf70d('0x17')](function(){var _0x5e9ddc=_0x1b7fd8[_0xf70d('0x2c')]({'plain':!![]});if(_0x5e9ddc[_0xf70d('0x2d')]===_0xf70d('0x2e'))return;var _0x284000=[{'name':_0xf70d('0x2f'),'value':_0xf70d('0x30'),'ignore':!![]},{'name':_0xf70d('0x31'),'value':_0xf70d('0x32'),'ignore':![]},{'name':_0xf70d('0x33'),'value':'telephone','ignore':![]}];var _0xac77b6=_(_0x284000)[_0xf70d('0x34')]('ignore')[_0xf70d('0x35')]('value')[_0xf70d('0x36')]();if(_[_0xf70d('0x37')](_0xac77b6,_0x5e9ddc[_0xf70d('0x2d')])){return;}var _0x32d44d=_[_0xf70d('0x38')](_0x284000,['value',_0x5e9ddc['role']])[_0xf70d('0x39')];return db[_0xf70d('0x3a')][_0xf70d('0x3b')]({'where':{'type':_0x32d44d,'resourceId':_0x5e9ddc['id']}})['then'](function(){return _0x1b7fd8;});})[_0xf70d('0x17')](function(){_0x3d07ae[_0xf70d('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56d219){return function(_0x5972f7){if(!_0x5972f7){_0x56d219[_0xf70d('0x20')](0x194);}return _0x5972f7;};}function handleError(_0x2bbb49,_0x1fe3b7){_0x1fe3b7=_0x1fe3b7||0x1f4;return function(_0x33526d){logger[_0xf70d('0x1d')](_0x33526d['stack']);if(_0x33526d[_0xf70d('0x39')]){delete _0x33526d[_0xf70d('0x39')];}_0x2bbb49[_0xf70d('0x21')](_0x1fe3b7)[_0xf70d('0x3c')](_0x33526d);};}exports[_0xf70d('0x3d')]=function(_0x4edc38,_0x4e3ed7){var _0x63eb2b={},_0x36aeb4={'count':0x0,'rows':[]};var _0x139306=_(db[_0xf70d('0x3e')][_0xf70d('0x3f')])['map'](function(_0x4e9a85){return{'name':_0x4e9a85['fieldName'],'type':_0x4e9a85[_0xf70d('0x40')][_0xf70d('0x41')]};})['filter'](function(_0x21f3e7){return!_[_0xf70d('0x37')](['password',_0xf70d('0x42')],_0x21f3e7[_0xf70d('0x39')]);})[_0xf70d('0x36')]();_0x63eb2b=qs['getOptions'](_0x139306,_0x4edc38);var _0x3b8c25={'where':_0x63eb2b[_0xf70d('0x43')]};return db['User']['count'](_0x3b8c25)[_0xf70d('0x17')](function(_0x441a54){_0x36aeb4[_0xf70d('0x27')]=_0x441a54;if(_0x4edc38[_0xf70d('0x44')][_0xf70d('0x45')]){_0x63eb2b[_0xf70d('0x46')]=[{'all':!![]}];}if(_0x4edc38[_0xf70d('0x44')][_0xf70d('0x47')]===_0xf70d('0x48')){_0x63eb2b[_0xf70d('0x46')]=[{'model':db[_0xf70d('0x49')],'as':'userSetting'}];}if(!_[_0xf70d('0x37')](_0x63eb2b['attributes'],'id')){_0x63eb2b['attributes'][_0xf70d('0x4a')]('id');}return db[_0xf70d('0x3e')]['findAll'](_0x63eb2b);})[_0xf70d('0x17')](function(_0x2f6af3){_0x36aeb4['rows']=_0x2f6af3;if(_0x4edc38[_0xf70d('0x44')]['openTabs']===_0xf70d('0x48')){var _0x566043=[];for(var _0x4eaec5=0x0;_0x4eaec5<_0x36aeb4['rows'][_0xf70d('0x4b')];_0x4eaec5++){_0x566043[_0xf70d('0x4a')](get_open_tabs(_0xf70d('0x4c'),_0x36aeb4['rows'][_0x4eaec5][_0xf70d('0x4d')]));_0x566043[_0xf70d('0x4a')](get_open_tabs(_0xf70d('0x4e'),_0x36aeb4[_0xf70d('0x4f')][_0x4eaec5]['dataValues']));_0x566043['push'](get_open_tabs(_0xf70d('0x50'),_0x36aeb4[_0xf70d('0x4f')][_0x4eaec5][_0xf70d('0x4d')]));_0x566043[_0xf70d('0x4a')](get_open_tabs(_0xf70d('0x51'),_0x36aeb4[_0xf70d('0x4f')][_0x4eaec5][_0xf70d('0x4d')]));_0x566043[_0xf70d('0x4a')](get_open_tabs('openchannel',_0x36aeb4[_0xf70d('0x4f')][_0x4eaec5][_0xf70d('0x4d')]));_0x566043[_0xf70d('0x4a')](get_open_tabs('whatsapp',_0x36aeb4[_0xf70d('0x4f')][_0x4eaec5]['dataValues']));}return Promise['all'](_0x566043)[_0xf70d('0x17')](function(){return _0x36aeb4;});}else{return _0x36aeb4;}})[_0xf70d('0x17')](respondWithFilteredResult(_0x4e3ed7,_0x63eb2b))[_0xf70d('0x1f')](handleError(_0x4e3ed7,null));};exports[_0xf70d('0x52')]=function(_0x5e8f51,_0x68bc85){var _0x18d277={'raw':![],'where':{'id':_0x5e8f51[_0xf70d('0x53')]['id']}},_0x155f92={};_0x155f92['model']=_['differenceBy'](_[_0xf70d('0x54')](db[_0xf70d('0x3e')][_0xf70d('0x3f')]),[_0xf70d('0x55'),_0xf70d('0x42')]);_0x155f92[_0xf70d('0x44')]=_['keys'](_0x5e8f51[_0xf70d('0x44')]);_0x155f92[_0xf70d('0x56')]=_[_0xf70d('0x57')](_0x155f92[_0xf70d('0x58')],_0x155f92[_0xf70d('0x44')]);_0x18d277[_0xf70d('0x59')]=_[_0xf70d('0x57')](_0x155f92[_0xf70d('0x58')],qs[_0xf70d('0x5a')](_0x5e8f51[_0xf70d('0x44')][_0xf70d('0x5a')]));_0x18d277[_0xf70d('0x59')]=_0x18d277[_0xf70d('0x59')][_0xf70d('0x4b')]?_0x18d277['attributes']:_0x155f92[_0xf70d('0x58')];if(_0x5e8f51[_0xf70d('0x44')][_0xf70d('0x45')]){_0x18d277[_0xf70d('0x46')]=[{'all':!![]}];}if(_0x5e8f51[_0xf70d('0x44')]['userSetting']===_0xf70d('0x48')){_0x18d277[_0xf70d('0x46')]=[{'model':db[_0xf70d('0x49')],'as':_0xf70d('0x47')}];}_0x18d277=_[_0xf70d('0x5b')]({},_0x18d277,_0x5e8f51['options']);if(!_[_0xf70d('0x37')](_0x18d277[_0xf70d('0x59')],'id')){_0x18d277[_0xf70d('0x59')]['push']('id');}return db[_0xf70d('0x3e')][_0xf70d('0x38')](_0x18d277)[_0xf70d('0x17')](handleEntityNotFound(_0x68bc85,null))[_0xf70d('0x17')](function(_0x382574){var _0x5ee256=[];values=_0x382574;if(_0x5e8f51[_0xf70d('0x44')][_0xf70d('0x5c')]===_0xf70d('0x48')){_0x5ee256[_0xf70d('0x4a')](get_open_tabs('chat',_0x382574[_0xf70d('0x4d')]));_0x5ee256['push'](get_open_tabs('sms',_0x382574[_0xf70d('0x4d')]));_0x5ee256['push'](get_open_tabs(_0xf70d('0x5d'),_0x382574[_0xf70d('0x4d')]));_0x5ee256[_0xf70d('0x4a')](get_open_tabs(_0xf70d('0x5e'),_0x382574[_0xf70d('0x4d')]));_0x5ee256[_0xf70d('0x4a')](get_open_tabs(_0xf70d('0x50'),_0x382574[_0xf70d('0x4d')]));_0x5ee256[_0xf70d('0x4a')](get_open_tabs(_0xf70d('0x51'),_0x382574[_0xf70d('0x4d')]));return Promise[_0xf70d('0x5f')](_0x5ee256);}else{return values;}})[_0xf70d('0x17')](function(){return values;})[_0xf70d('0x17')](respondWithResult(_0x68bc85,null))[_0xf70d('0x1f')](handleError(_0x68bc85,null));};exports['update']=function(_0x2f8f42,_0xb6c838){if(_0x2f8f42['body']['id']){delete _0x2f8f42['body']['id'];}delete _0x2f8f42[_0xf70d('0x60')]['role'];return db['User'][_0xf70d('0x38')]({'where':{'id':_0x2f8f42[_0xf70d('0x53')]['id']}})[_0xf70d('0x17')](handleEntityNotFound(_0xb6c838,null))[_0xf70d('0x17')](saveUpdates(_0x2f8f42['body'],null))[_0xf70d('0x17')](respondWithResult(_0xb6c838,null))['catch'](handleError(_0xb6c838,null));};exports[_0xf70d('0x61')]=function(_0x54751f,_0x287548){return db[_0xf70d('0x3e')][_0xf70d('0x61')]()[_0xf70d('0x17')](respondWithResult(_0x287548,null))[_0xf70d('0x1f')](handleError(_0x287548,null));};exports[_0xf70d('0x62')]=function(_0x374aea,_0x142256){return db[_0xf70d('0x3e')][_0xf70d('0x38')]({'where':{'id':_0x374aea[_0xf70d('0x53')]['id']}})[_0xf70d('0x17')](handleEntityNotFound(_0x142256,null))[_0xf70d('0x17')](function(_0x45eeb9){if(_0x45eeb9){return _0x45eeb9[_0xf70d('0x62')](_0x374aea[_0xf70d('0x60')][_0xf70d('0x63')],_[_0xf70d('0x64')](_0x374aea[_0xf70d('0x60')],[_0xf70d('0x63'),'id'])||{});}})[_0xf70d('0x17')](respondWithResult(_0x142256,null))['catch'](handleError(_0x142256,null));};function validateUser(_0x31a754){return new Promise(function(_0x332979,_0x384148){if(_0x31a754['internal'])return _0x332979(_0x31a754);return db[_0xf70d('0x65')][_0xf70d('0x66')](0x1)[_0xf70d('0x17')](function(_0x24494d){if(_0x24494d[_0xf70d('0x67')])authService[_0xf70d('0x68')](_0x31a754['password']);db[_0xf70d('0x3e')][_0xf70d('0x69')]('internal')['then'](function(_0x398cee){if(_['isNil'](_0x398cee)){_0x31a754['internal']=_0x24494d[_0xf70d('0x6a')]||0x1;return;}if(_[_0xf70d('0x6b')](_0x24494d[_0xf70d('0x6a')])||_0x24494d['min_internal']===_0x398cee){_0x31a754[_0xf70d('0x6c')]=_0x398cee+0x1;return;}if(_0x24494d['min_internal']>_0x398cee){_0x31a754[_0xf70d('0x6c')]=_0x24494d['min_internal'];return;}return db['sequelize'][_0xf70d('0x44')](_0xf70d('0x6d'),{'type':db['sequelize'][_0xf70d('0x6e')]['SELECT']})[_0xf70d('0x17')](function(_0x2537d1){if(_0x2537d1&&_0x2537d1[_0xf70d('0x4b')]){for(var _0x53c16b=0x0,_0x2c29d8=_0x2537d1[_0xf70d('0x4b')];_0x53c16b<_0x2c29d8&&_['isNil'](_0x31a754['internal']);_0x53c16b++){if(_0x24494d[_0xf70d('0x6a')]<=_0x2537d1[_0x53c16b][_0xf70d('0x6f')]){_0x31a754[_0xf70d('0x6c')]=_0x2537d1[_0x53c16b]['from'];}else if(_0x24494d[_0xf70d('0x6a')]>_0x2537d1[_0x53c16b][_0xf70d('0x6f')]&&_0x24494d[_0xf70d('0x6a')]<=_0x2537d1[_0x53c16b]['to']){_0x31a754[_0xf70d('0x6c')]=_0x24494d[_0xf70d('0x6a')];}}}if(_[_0xf70d('0x6b')](_0x31a754['internal'])){_0x31a754[_0xf70d('0x6c')]=_0x398cee+0x1;}return _0x332979(_0x31a754);});});})['catch'](function(_0x428275){_0x384148(_0x428275);});});}function updateUser(_0x307ab6){return new Promise(function(_0x267c60,_0xcf2ca4){try{if(_0x307ab6[_0xf70d('0x70')]){_0x307ab6[_0xf70d('0x71')]=_0x307ab6[_0xf70d('0x6c')];_0x307ab6[_0xf70d('0x72')]={'mailbox':_0x307ab6[_0xf70d('0x6c')],'password':_0x307ab6['password'],'fullname':_0x307ab6[_0xf70d('0x73')],'email':_0x307ab6['email']};}if(_0x307ab6['role']===_0xf70d('0x32')){if(!_0x307ab6[_0xf70d('0x74')])_0x307ab6['permissions']=[_0xf70d('0x75'),_0xf70d('0x76'),_0xf70d('0x77'),_0xf70d('0x78'),_0xf70d('0x79'),_0xf70d('0x7a'),_0xf70d('0x7b'),'106',_0xf70d('0x7c'),_0xf70d('0x7d'),_0xf70d('0x7e'),_0xf70d('0x7f'),_0xf70d('0x80'),_0xf70d('0x81'),'115'];}_0x267c60(_0x307ab6);}catch(_0x10cfb6){_0xcf2ca4(_0x10cfb6);}});}exports['create']=function(_0x5a87ed,_0x4d7572){if(_0x5a87ed[_0xf70d('0x30')][_0xf70d('0x2d')]===_0xf70d('0x32'))throw new Error(_0xf70d('0x82'));if(_0x5a87ed['body'][_0xf70d('0x2d')]===_0xf70d('0x30')&&_0x5a87ed[_0xf70d('0x30')][_0xf70d('0x2d')]!==_0xf70d('0x2e')){throw new Error(_0xf70d('0x83'));}if(_0x5a87ed[_0xf70d('0x60')][_0xf70d('0x2d')]===_0xf70d('0x2e')&&_0x5a87ed['user']['role']!==_0xf70d('0x2e')){throw new Error(_0xf70d('0x84'));}return licenseUtil[_0xf70d('0x85')]([_0x5a87ed[_0xf70d('0x60')]])[_0xf70d('0x17')](function(){return validateUser(_0x5a87ed[_0xf70d('0x60')]);})[_0xf70d('0x17')](function(_0x2d407b){return updateUser(_0x2d407b)[_0xf70d('0x17')](function(_0x253a85){if(_0x253a85[_0xf70d('0x2d')]===_0xf70d('0x2e')){_0x253a85['settingsEnabled']=_0x5a87ed[_0xf70d('0x30')][_0xf70d('0x86')];delete _0x253a85[_0xf70d('0x87')];}return _0x253a85;});})[_0xf70d('0x17')](function(_0x3013c1){return db[_0xf70d('0x3e')][_0xf70d('0x88')](_0x3013c1,{'include':[{'model':db['VoiceMail'],'as':_0xf70d('0x72')}]});})[_0xf70d('0x17')](function(_0x640593){if(_0x5a87ed['body'][_0xf70d('0x2d')]===_0xf70d('0x30'))return _0x640593;if(_0x5a87ed[_0xf70d('0x30')]['role']!=='user')return _0x640593;return db[_0xf70d('0x89')][_0xf70d('0x38')]({'where':{'name':_0x640593['role']==='agent'?'Agents':_0xf70d('0x33'),'userProfileId':_0x5a87ed[_0xf70d('0x30')]['userProfileId']},'raw':!![]})[_0xf70d('0x17')](function(_0x25b38e){if(!_0x25b38e||_0x25b38e[_0xf70d('0x8a')]!=0x0)return _0x640593;return db[_0xf70d('0x3a')][_0xf70d('0x88')]({'name':_0x640593[_0xf70d('0x39')],'resourceId':_0x640593['id'],'type':_0x25b38e[_0xf70d('0x39')],'sectionId':_0x25b38e['id']},{})[_0xf70d('0x17')](function(){return _0x640593;});})[_0xf70d('0x1f')](function(_0x10ccd4){logger[_0xf70d('0x1d')](_0xf70d('0x8b'),_0x10ccd4);throw _0x10ccd4;});})[_0xf70d('0x17')](respondWithResult(_0x4d7572,0xc9))[_0xf70d('0x1f')](handleError(_0x4d7572,null));};exports['bulkCreate']=function(_0x1c05a3,_0x110738){var _0x807893=_0x1c05a3[_0xf70d('0x60')];var _0x17e7c6=[];if(_0x1c05a3[_0xf70d('0x30')]['role']===_0xf70d('0x32'))throw new Error(_0xf70d('0x82'));if(_[_0xf70d('0x8c')](_0x807893,[_0xf70d('0x2d'),'user'])&&_0x1c05a3[_0xf70d('0x30')][_0xf70d('0x2d')]!==_0xf70d('0x2e')){throw new Error(_0xf70d('0x83'));}if(_[_0xf70d('0x8c')](_0x807893,[_0xf70d('0x2d'),_0xf70d('0x2e')])&&_0x1c05a3[_0xf70d('0x30')]['role']!=='admin'){throw new Error(_0xf70d('0x8d'));}return licenseUtil[_0xf70d('0x85')](_0x807893)[_0xf70d('0x17')](function(){return validateUser(_0x807893[0x0]);})[_0xf70d('0x17')](function(){for(var _0x435fda=0x1;_0x435fda<_0x807893[_0xf70d('0x4b')];_0x435fda++){var _0x3c25b3=_0x807893[_0x435fda-0x1][_0xf70d('0x6c')];if(!_0x807893[_0x435fda]['internal'])_0x807893[_0x435fda][_0xf70d('0x6c')]=_0x3c25b3+0x1;_0x17e7c6[_0xf70d('0x4a')](validateUser(_0x807893[_0x435fda]));}return Promise[_0xf70d('0x5f')](_0x17e7c6);})[_0xf70d('0x17')](function(){_0x17e7c6=[];for(var _0x20ca72=0x0;_0x20ca72<_0x807893[_0xf70d('0x4b')];_0x20ca72++){_0x17e7c6['push'](updateUser(_0x807893[_0x20ca72]));}return Promise[_0xf70d('0x5f')](_0x17e7c6);})[_0xf70d('0x17')](function(){_0x17e7c6=_0x807893['map'](function(_0x284a9){return db['User'][_0xf70d('0x88')](_0x284a9,{'include':[{'model':db[_0xf70d('0x72')],'as':'VoiceMail'}]})[_0xf70d('0x17')](function(_0x5637a4){_0x284a9['id']=_0x5637a4['id'];return _0x284a9;});});return Promise[_0xf70d('0x5f')](_0x17e7c6);})['then'](function(_0x86fef6){if(_0x1c05a3[_0xf70d('0x60')][_0xf70d('0x2d')]==='user')return _0x86fef6;if(_0x1c05a3[_0xf70d('0x30')][_0xf70d('0x2d')]!==_0xf70d('0x30'))return _0x86fef6;var _0x31383a=_['some'](_0x86fef6,function(_0x3246e6){return _0x3246e6[_0xf70d('0x2d')]===_0xf70d('0x32')||_0x3246e6[_0xf70d('0x2d')]===_0xf70d('0x8e');});if(!_0x31383a)return _0x86fef6;return db[_0xf70d('0x89')][_0xf70d('0x8f')]({'where':{'name':{'$or':['Agents',_0xf70d('0x33')]},'userProfileId':_0x1c05a3['user']['userProfileId']},'raw':!![]})[_0xf70d('0x17')](function(_0x2194a8){if(_[_0xf70d('0x90')](_0x2194a8)||!_[_0xf70d('0x8c')](_0x2194a8,['autoAssociation',0x0]))return _0x86fef6;_0x17e7c6=[];var _0x295ba5=_(_0x2194a8)[_0xf70d('0x35')](function(_0x63d203){if(_0x63d203['autoAssociation']===0x1)return;return _0x63d203['name']===_0xf70d('0x31')?_0xf70d('0x32'):_0xf70d('0x8e');})[_0xf70d('0x91')]()[_0xf70d('0x36')]();for(var _0x4a2ae9=0x0;_0x4a2ae9<_0x86fef6[_0xf70d('0x4b')];_0x4a2ae9++){if(!_[_0xf70d('0x37')](_0x295ba5,_0x86fef6[_0x4a2ae9][_0xf70d('0x2d')]))return;var _0x39e199=_0x86fef6[_0x4a2ae9][_0xf70d('0x2d')]===_0xf70d('0x32')?_0xf70d('0x31'):'Telephones';_0x17e7c6[_0xf70d('0x4a')](db[_0xf70d('0x3a')][_0xf70d('0x88')]({'name':_0x86fef6[_0x4a2ae9][_0xf70d('0x39')],'resourceId':_0x86fef6[_0x4a2ae9]['id'],'type':_0x39e199,'sectionId':_[_0xf70d('0x38')](_0x2194a8,[_0xf70d('0x39'),_0x39e199])['id']},{}));}return Promise[_0xf70d('0x5f')](_0x17e7c6);});})['then'](respondWithResult(_0x110738,0xc9))['catch'](handleError(_0x110738,null));};exports[_0xf70d('0x92')]=function(_0x329462,_0x22ee79){if(_0x329462['body']['id']){delete _0x329462[_0xf70d('0x60')]['id'];}return db[_0xf70d('0x3e')][_0xf70d('0x38')]({'where':{'id':_0x329462['params']['id']}})[_0xf70d('0x17')](function(_0x35f62b){if(!_0x35f62b)return null;if(_0x35f62b['id']===_0x329462['user']['id']){if(!_0x329462[_0xf70d('0x60')][_0xf70d('0x93')]||!_0x329462[_0xf70d('0x60')][_0xf70d('0x94')]){throw new db['Sequelize'][(_0xf70d('0x95'))](_0xf70d('0x96'));}if(!_0x35f62b[_0xf70d('0x97')](_0x329462[_0xf70d('0x60')]['oldPassword'])){throw new db[(_0xf70d('0x98'))]['ValidationError'](_0xf70d('0x99'));}if(_0x329462[_0xf70d('0x60')]['oldPassword']===_0x329462[_0xf70d('0x60')]['newPassword']){throw new db['Sequelize'][(_0xf70d('0x95'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x329462['user'][_0xf70d('0x2d')]===_0xf70d('0x2e')){if(!_0x329462[_0xf70d('0x60')][_0xf70d('0x94')]){throw new db[(_0xf70d('0x98'))][(_0xf70d('0x95'))](_0xf70d('0x9a'));}}else if(_0x329462[_0xf70d('0x30')][_0xf70d('0x2d')]==='user'){if(!_0x329462[_0xf70d('0x60')]['newPassword']){throw new db[(_0xf70d('0x98'))][(_0xf70d('0x95'))](_0xf70d('0x9a'));}if(_0x35f62b[_0xf70d('0x2d')]!==_0xf70d('0x32')){throw new db[(_0xf70d('0x98'))][(_0xf70d('0x95'))](_0xf70d('0x82'));}}else{throw new db[(_0xf70d('0x98'))]['ValidationError'](_0xf70d('0x82'));}return _0x35f62b;})[_0xf70d('0x17')](handleEntityNotFound(_0x22ee79,null))[_0xf70d('0x17')](function(_0x1942e4){return db[_0xf70d('0x65')][_0xf70d('0x9b')]({'attributes':['id',_0xf70d('0x67'),_0xf70d('0x9c'),_0xf70d('0x9d')]})[_0xf70d('0x17')](function(_0xcd11f9){if(_0xcd11f9[_0xf70d('0x67')])authService[_0xf70d('0x68')](_0x329462[_0xf70d('0x60')]['newPassword']);if(!_0xcd11f9[_0xf70d('0x9c')]||!_0x1942e4[_0xf70d('0x9e')])return _0x1942e4;authService[_0xf70d('0x9f')](_0x329462[_0xf70d('0x60')][_0xf70d('0x94')],_0x1942e4[_0xf70d('0x9e')],_0xcd11f9[_0xf70d('0x9d')]);return _0x1942e4;})[_0xf70d('0x17')](saveUpdates({'password':_0x329462['body'][_0xf70d('0x94')],'passwordResetAt':_0x329462[_0xf70d('0x30')]['id']==_0x329462[_0xf70d('0x53')]['id']?moment():null,'previousPasswords':authService[_0xf70d('0xa0')](_0x329462[_0xf70d('0x60')][_0xf70d('0x94')],_0x1942e4[_0xf70d('0x9e')])},null));})[_0xf70d('0x17')](respondWithResult(_0x22ee79,null))['catch'](handleError(_0x22ee79,null));};exports[_0xf70d('0xa1')]=function(_0x324104,_0x384532){var _0x442f0c=_0x324104[_0xf70d('0x60')][_0xf70d('0xa2')];return db['User']['find']({'where':{'id':_0x324104[_0xf70d('0x53')]['id']},'attributes':['id',_0xf70d('0x39'),_0xf70d('0x2d'),_0xf70d('0xa3'),'loginInPause',_0xf70d('0xa4'),_0xf70d('0xa5')]})['then'](handleEntityNotFound(_0x384532,null))[_0xf70d('0x17')](function(_0x16a5a2){if(_0x16a5a2){if(!utils['isValidChannel'](_0x442f0c)){throw new db[(_0xf70d('0x98'))][(_0xf70d('0x95'))](_0xf70d('0xa6'));}return _0x16a5a2[_0xf70d('0xa7')+_['capitalize'](_0x442f0c['toLowerCase']())+_0xf70d('0xa8')](_0x324104['body']['ids'],{'penalty':_0x324104[_0xf70d('0x60')][_0xf70d('0xa9')]||0x0})['spread'](function(_0x59401c){for(var _0x3c5ff5=0x0;_0x3c5ff5<_0x324104[_0xf70d('0x60')]['ids']['length'];_0x3c5ff5+=0x1){var _0x4d5be7={'UserId':Number(_0x324104[_0xf70d('0x53')]['id'])};_0x4d5be7[_[_0xf70d('0xaa')](_0x442f0c['toLowerCase']())+_0xf70d('0xab')]=Number(_0x324104[_0xf70d('0x60')][_0xf70d('0x63')][_0x3c5ff5]);socket[_0xf70d('0x2b')](_0xf70d('0x30')+_[_0xf70d('0xaa')](_0x442f0c[_0xf70d('0xac')]())+_0xf70d('0xad'),_0x4d5be7);}return _0x59401c;})['then'](function(){if(_0x442f0c===_0xf70d('0xae')){return db['VoiceQueue'][_0xf70d('0x8f')]({'where':{'id':_0x324104[_0xf70d('0x60')][_0xf70d('0x63')]||[]},'raw':!![],'attributes':['id',_0xf70d('0x39')]});}})['then'](function(_0x48beb8){var _0x45e24=_0x16a5a2[_0xf70d('0x2c')]({'plain':!![]});var _0x1ed5e0=[];if(_0x442f0c===_0xf70d('0xae')&&_0x45e24['role']===_0xf70d('0x32')&&_0x45e24[_0xf70d('0xa3')]){for(let _0x5ed926=0x0;_0x5ed926<_0x48beb8[_0xf70d('0x4b')];_0x5ed926+=0x1){_0x1ed5e0[_0xf70d('0x4a')]({'membername':_0x45e24[_0xf70d('0x39')],'UserId':_0x45e24['id'],'queue_name':_0x48beb8[_0x5ed926][_0xf70d('0x39')],'VoiceQueueId':_0x48beb8[_0x5ed926]['id'],'interface':_[_0xf70d('0x6b')](_0x45e24['interface'])?util[_0xf70d('0xaf')](_0xf70d('0xb0'),_0x45e24[_0xf70d('0x39')]):_0x45e24['interface'],'paused':_0x45e24[_0xf70d('0xa4')]||![],'penalty':_0x324104['body'][_0xf70d('0xa9')]||0x0});}return Promise[_0xf70d('0x5f')](_0x1ed5e0[_0xf70d('0x35')](function(_0x5f3c39){return db['UserVoiceQueueRt'][_0xf70d('0xb1')](_0x5f3c39);}));}return _0x16a5a2;});}})['then'](respondWithStatusCode(_0x384532,null))[_0xf70d('0x1f')](handleError(_0x384532,null));};exports[_0xf70d('0xb2')]=function(_0x1f2093,_0x2eb01f){var _0x2a5847,_0x1512f1;return db['User'][_0xf70d('0x38')]({'where':{'id':_0x1f2093['params']['id']},'attributes':['id','name',_0xf70d('0x2d')]})[_0xf70d('0x17')](handleEntityNotFound(_0x2eb01f,null))[_0xf70d('0x17')](function(_0x5f1e62){if(_0x5f1e62){_0x2a5847=_0x5f1e62;if(!_0x1f2093[_0xf70d('0x44')][_0xf70d('0xa2')]||!utils[_0xf70d('0xb3')](_0x1f2093['query'][_0xf70d('0xa2')])){throw new db[(_0xf70d('0x98'))][(_0xf70d('0x95'))]('Unknown\x20channel');}return _0x5f1e62['remove'+_[_0xf70d('0xaa')](_0x1f2093[_0xf70d('0x44')]['channel'][_0xf70d('0xac')]())+_0xf70d('0xa8')](_0x1f2093[_0xf70d('0x44')][_0xf70d('0x63')]);}})['then'](function(_0x3668ac){if(_[_0xf70d('0xb4')](_0x1f2093[_0xf70d('0x44')][_0xf70d('0x63')])){for(var _0x34b5a7=0x0;_0x34b5a7<_0x1f2093[_0xf70d('0x44')][_0xf70d('0x63')][_0xf70d('0x4b')];_0x34b5a7+=0x1){_0x1512f1={'UserId':Number(_0x1f2093[_0xf70d('0x53')]['id'])};_0x1512f1[_[_0xf70d('0xaa')](_0x1f2093[_0xf70d('0x44')]['channel'][_0xf70d('0xac')]())+'QueueId']=Number(_0x1f2093[_0xf70d('0x44')][_0xf70d('0x63')][_0x34b5a7]);socket[_0xf70d('0x2b')](_0xf70d('0x30')+_[_0xf70d('0xaa')](_0x1f2093[_0xf70d('0x44')]['channel'][_0xf70d('0xac')]())+_0xf70d('0xb5'),_0x1512f1);}}else{_0x1512f1={'UserId':Number(_0x1f2093[_0xf70d('0x53')]['id'])};_0x1512f1[_[_0xf70d('0xaa')](_0x1f2093['query'][_0xf70d('0xa2')][_0xf70d('0xac')]())+'QueueId']=Number(_0x1f2093[_0xf70d('0x44')][_0xf70d('0x63')]);socket[_0xf70d('0x2b')](_0xf70d('0x30')+_[_0xf70d('0xaa')](_0x1f2093[_0xf70d('0x44')][_0xf70d('0xa2')][_0xf70d('0xac')]())+_0xf70d('0xb5'),_0x1512f1);}return _0x3668ac;})['then'](function(){if(_0x1f2093[_0xf70d('0x44')]['channel']==='voice'){return db[_0xf70d('0xb6')][_0xf70d('0x3b')]({'where':{'UserId':_0x1f2093[_0xf70d('0x53')]['id'],'VoiceQueueId':_0x1f2093[_0xf70d('0x44')][_0xf70d('0x63')]},'individualHooks':!![]})[_0xf70d('0x17')](function(){return _0x2a5847;});}return _0x2a5847;})[_0xf70d('0x17')](respondWithStatusCode(_0x2eb01f,null))[_0xf70d('0x1f')](handleError(_0x2eb01f,null));};exports[_0xf70d('0xb7')]=function(_0x1f4fd0,_0x40c6d8){_0x1f4fd0[_0xf70d('0x60')][_0xf70d('0xb8')]=_0x1f4fd0[_0xf70d('0xb9')]['filename'];return db[_0xf70d('0x3e')][_0xf70d('0x38')]({'where':{'id':_0x1f4fd0[_0xf70d('0x53')]['id']}})[_0xf70d('0x17')](handleEntityNotFound(_0x40c6d8,null))['then'](saveUpdates(_0x1f4fd0[_0xf70d('0x60')],null))[_0xf70d('0x17')](respondWithResult(_0x40c6d8,null))[_0xf70d('0x1f')](handleError(_0x40c6d8,null));};exports['getAvatar']=function(_0x1a1e92,_0x409031){var _0x2306a3=path[_0xf70d('0xba')](config['root'],_0xf70d('0xbb'));return db[_0xf70d('0x3e')][_0xf70d('0x38')]({'where':{'id':_0x1a1e92[_0xf70d('0x53')]['id']},'attributes':['id',_0xf70d('0xb8')],'raw':!![]})[_0xf70d('0x17')](handleEntityNotFound(_0x409031,null))[_0xf70d('0x17')](function(_0x26c1c8){if(_0x26c1c8){if(_['isNil'](_0x26c1c8[_0xf70d('0xb8')])){return _0x409031[_0xf70d('0xbc')](_0x2306a3);}else{if(!fs[_0xf70d('0xbd')](path[_0xf70d('0xba')](config[_0xf70d('0xbe')],'server/files/images/',_0x26c1c8[_0xf70d('0xb8')]))){return _0x409031[_0xf70d('0xbc')](_0x2306a3);}return _0x409031['download'](path['join'](config[_0xf70d('0xbe')],_0xf70d('0xbf'),_0x26c1c8[_0xf70d('0xb8')]));}}})[_0xf70d('0x1f')](handleError(_0x409031,null));};exports['getOpenTabs']=function(_0x17743e,_0x205fc7){return db[_0xf70d('0x3e')][_0xf70d('0x38')]({'where':{'id':_0x17743e['params']['id']},'attributes':['id']})[_0xf70d('0x17')](handleEntityNotFound(_0x205fc7,null))['then'](function(_0x4ca5a1){var _0xb96088=[];values=_0x4ca5a1['dataValues'];_0xb96088[_0xf70d('0x4a')](get_open_tabs(_0xf70d('0x4c'),_0x4ca5a1[_0xf70d('0x4d')]));_0xb96088[_0xf70d('0x4a')](get_open_tabs(_0xf70d('0x4e'),_0x4ca5a1['dataValues']));_0xb96088[_0xf70d('0x4a')](get_open_tabs(_0xf70d('0x5d'),_0x4ca5a1['dataValues']));_0xb96088[_0xf70d('0x4a')](get_open_tabs(_0xf70d('0x5e'),_0x4ca5a1[_0xf70d('0x4d')]));_0xb96088['push'](get_open_tabs(_0xf70d('0x50'),_0x4ca5a1[_0xf70d('0x4d')]));_0xb96088[_0xf70d('0x4a')](get_open_tabs('mail',_0x4ca5a1['dataValues']));return Promise[_0xf70d('0x5f')](_0xb96088);})[_0xf70d('0x17')](function(_0x3f3ebc){if(_0x3f3ebc){var _0x3d49e8=_[_0xf70d('0x35')](values[_0xf70d('0xc0')],function(_0x46818d){return{'channel':_0xf70d('0xc1'),'id':_0x46818d['id'],'createdAt':_0x46818d[_0xf70d('0xc2')]};});var _0x23c52e=_[_0xf70d('0x35')](values['FaxOpenTabs'],function(_0x68d14a){return{'channel':_0xf70d('0xc3'),'id':_0x68d14a['id'],'createdAt':_0x68d14a[_0xf70d('0xc2')]};});var _0x89bb39=_[_0xf70d('0x35')](values[_0xf70d('0xc4')],function(_0xaa48c2){return{'channel':'OPENCHANNEL','id':_0xaa48c2['id'],'createdAt':_0xaa48c2[_0xf70d('0xc2')]};});var _0x10be6e=_['map'](values[_0xf70d('0xc5')],function(_0x57d31e){return{'channel':_0xf70d('0xc6'),'id':_0x57d31e['id'],'createdAt':_0x57d31e[_0xf70d('0xc2')]};});var _0xf29ece=_['map'](values[_0xf70d('0xc7')],function(_0xff2480){return{'channel':_0xf70d('0xc8'),'id':_0xff2480['id'],'createdAt':_0xff2480[_0xf70d('0xc2')]};});var _0x352c0e=_[_0xf70d('0x35')](values[_0xf70d('0xc9')],function(_0xf588d4){return{'channel':_0xf70d('0xca'),'id':_0xf588d4['id'],'createdAt':_0xf588d4['createdAt']};});var _0x4b6631=_[_0xf70d('0xcb')](_0x3d49e8,_0x23c52e,_0x89bb39,_0x10be6e,_0xf29ece,_0x352c0e);var _0x1eb613={'count':_0x4b6631[_0xf70d('0x4b')],'rows':_0x4b6631};return _0x1eb613;}else return null;})['then'](respondWithResult(_0x205fc7,null))[_0xf70d('0x1f')](handleError(_0x205fc7,null));};exports['getContacts']=function(_0x4c0c64,_0x5e677d){var _0x179e91={};var _0x5c62de={};var _0x5bc7a8;var _0x3c8d75;return db[_0xf70d('0x3e')][_0xf70d('0x9b')]({'where':{'id':_0x4c0c64['params']['id']}})[_0xf70d('0x17')](handleEntityNotFound(_0x5e677d,null))['then'](function(_0x53af22){if(_0x53af22){_0x5bc7a8=_0x53af22;_0x5c62de[_0xf70d('0x58')]=_['keys'](db[_0xf70d('0xcc')]['rawAttributes']);_0x5c62de[_0xf70d('0x44')]=_[_0xf70d('0x54')](_0x4c0c64[_0xf70d('0x44')]);_0x5c62de[_0xf70d('0x56')]=_[_0xf70d('0x57')](_0x5c62de['model'],_0x5c62de[_0xf70d('0x44')]);_0x179e91[_0xf70d('0x59')]=_['intersection'](_0x5c62de[_0xf70d('0x58')],qs[_0xf70d('0x5a')](_0x4c0c64['query']['fields']));_0x179e91[_0xf70d('0x59')]=_0x179e91['attributes'][_0xf70d('0x4b')]?_0x179e91['attributes']:_0x5c62de[_0xf70d('0x58')];_0x179e91[_0xf70d('0xcd')]=qs[_0xf70d('0xce')](_0x4c0c64[_0xf70d('0x44')]['sort']);_0x179e91[_0xf70d('0x43')]=qs[_0xf70d('0x56')](_[_0xf70d('0xcf')](_0x4c0c64[_0xf70d('0x44')],_0x5c62de['filters']));if(_0x4c0c64['query'][_0xf70d('0x34')]){_0x179e91['where']=_['merge'](_0x179e91[_0xf70d('0x43')],{'$or':_['map'](_0x179e91[_0xf70d('0x59')],function(_0x97f623){var _0x2e5056={};_0x2e5056[_0x97f623]={'$like':'%'+_0x4c0c64[_0xf70d('0x44')][_0xf70d('0x34')]+'%'};return _0x2e5056;})});}_0x179e91=_[_0xf70d('0x5b')]({},_0x179e91,_0x4c0c64[_0xf70d('0xd0')]);return _0x5bc7a8[_0xf70d('0xd1')](_0x179e91);}})['then'](function(_0x4f8b4e){if(_0x4f8b4e){_0x3c8d75=_0x4f8b4e[_0xf70d('0x4b')];if(_0x4c0c64[_0xf70d('0x44')][_0xf70d('0xd2')]('includeAll')){_0x179e91[_0xf70d('0x46')]=[{'model':db[_0xf70d('0xd3')],'as':_0xf70d('0xd4'),'required':![]},{'model':db[_0xf70d('0xd5')],'as':_0xf70d('0xd6'),'attributes':['id',_0xf70d('0x39'),'color'],'where':_0x4c0c64[_0xf70d('0x44')][_0xf70d('0xd7')]?{'id':_0x4c0c64[_0xf70d('0x44')][_0xf70d('0xd7')]}:undefined,'required':_0x4c0c64[_0xf70d('0x44')][_0xf70d('0xd7')]?!![]:![]}];}if(!_0x4c0c64[_0xf70d('0x44')][_0xf70d('0xd2')](_0xf70d('0xd8'))){_0x179e91[_0xf70d('0x26')]=qs[_0xf70d('0x26')](_0x4c0c64[_0xf70d('0x44')][_0xf70d('0x26')]);_0x179e91['offset']=qs[_0xf70d('0x24')](_0x4c0c64[_0xf70d('0x44')][_0xf70d('0x24')]);}return _0x5bc7a8['getContacts'](_0x179e91);}})[_0xf70d('0x17')](function(_0xa8b052){if(_0xa8b052){return _0xa8b052?{'count':_0x3c8d75,'rows':_0xa8b052}:null;}})[_0xf70d('0x17')](respondWithResult(_0x5e677d,null))[_0xf70d('0x1f')](handleError(_0x5e677d,null));};exports[_0xf70d('0xd9')]=function(_0x20cb62,_0x439bc7){var _0x3b95c2;var _0x54a63a={};var _0x4264da;return db[_0xf70d('0x3e')][_0xf70d('0x9b')]({'where':{'id':_0x20cb62[_0xf70d('0x53')]['id']},'attributes':['id','name',_0xf70d('0x2d')]})[_0xf70d('0x17')](handleEntityNotFound(_0x439bc7,null))[_0xf70d('0x17')](function(_0x5c3976){if(!utils[_0xf70d('0xb3')](_0x20cb62[_0xf70d('0x44')][_0xf70d('0xa2')])){throw new db[(_0xf70d('0x98'))][(_0xf70d('0x95'))](_0xf70d('0xa6'));}_0x3b95c2=_0x5c3976;var _0x44e3b8={};_0x44e3b8[_0xf70d('0x58')]=_[_0xf70d('0x54')](db[_[_0xf70d('0xaa')](_0x20cb62[_0xf70d('0x44')]['channel'])+'Queue'][_0xf70d('0x3f')]);_0x44e3b8[_0xf70d('0x44')]=_['keys'](_0x20cb62['query']);_0x44e3b8[_0xf70d('0x56')]=_['intersection'](_0x44e3b8[_0xf70d('0x58')],_0x44e3b8[_0xf70d('0x44')]);_0x54a63a[_0xf70d('0x59')]=_[_0xf70d('0x57')](_0x44e3b8[_0xf70d('0x58')],qs[_0xf70d('0x5a')](_0x20cb62['query']['fields']));_0x54a63a[_0xf70d('0x59')]=_0x54a63a['attributes']['length']?_0x54a63a[_0xf70d('0x59')]:_0x44e3b8[_0xf70d('0x58')];_0x54a63a[_0xf70d('0xcd')]=qs[_0xf70d('0xce')](_0x20cb62['query'][_0xf70d('0xce')]);_0x54a63a[_0xf70d('0x43')]=qs['filters'](_[_0xf70d('0xcf')](_0x20cb62[_0xf70d('0x44')],_0x44e3b8[_0xf70d('0x56')]));if(_0x20cb62[_0xf70d('0x44')][_0xf70d('0x34')]){_0x54a63a['where']=_[_0xf70d('0x5b')](_0x54a63a[_0xf70d('0x43')],{'$or':_[_0xf70d('0x35')](_0x54a63a[_0xf70d('0x59')],function(_0x15d392){var _0x323bda={};_0x323bda[_0x15d392]={'$like':'%'+_0x20cb62['query'][_0xf70d('0x34')]+'%'};return _0x323bda;})});}_0x54a63a=_[_0xf70d('0x5b')]({},_0x54a63a,_0x20cb62['options']);switch(_0x3b95c2['role']){case _0xf70d('0x2e'):return db[_[_0xf70d('0xaa')](_0x20cb62[_0xf70d('0x44')]['channel'])+_0xf70d('0xda')][_0xf70d('0x8f')](_0x54a63a);case _0xf70d('0x30'):case _0xf70d('0x32'):return _0x3b95c2[_0xf70d('0x2c')+_[_0xf70d('0xaa')](_0x20cb62[_0xf70d('0x44')]['channel'])+_0xf70d('0xa8')](_0x54a63a);default:throw new db[(_0xf70d('0x98'))][(_0xf70d('0x95'))]('Unknown\x20role');}})[_0xf70d('0x17')](function(_0x3577b2){_0x4264da=_0x3577b2['length'];if(!_0x20cb62['query'][_0xf70d('0xd2')](_0xf70d('0xd8'))){_0x54a63a[_0xf70d('0x26')]=qs['limit'](_0x20cb62[_0xf70d('0x44')]['limit']);_0x54a63a[_0xf70d('0x24')]=qs['offset'](_0x20cb62[_0xf70d('0x44')][_0xf70d('0x24')]);}switch(_0x3b95c2[_0xf70d('0x2d')]){case _0xf70d('0x2e'):return db[_[_0xf70d('0xaa')](_0x20cb62[_0xf70d('0x44')][_0xf70d('0xa2')])+_0xf70d('0xda')]['findAll'](_0x54a63a);case _0xf70d('0x30'):case'agent':return _0x3b95c2['get'+_[_0xf70d('0xaa')](_0x20cb62['query'][_0xf70d('0xa2')])+_0xf70d('0xa8')](_0x54a63a);}})[_0xf70d('0x17')](function(_0x126abf){return{'count':_0x4264da,'rows':_0x126abf};})['then'](respondWithResult(_0x439bc7,null))[_0xf70d('0x1f')](handleError(_0x439bc7,null));};exports['getVoiceQueuesRt']=function(_0x10b1a0,_0x1af32a){var _0x30f766={};var _0x35cd09={};var _0x772704;var _0x5d9845;return db['User'][_0xf70d('0x9b')]({'where':{'id':_0x10b1a0[_0xf70d('0x53')]['id']}})['then'](handleEntityNotFound(_0x1af32a,null))[_0xf70d('0x17')](function(_0x4ffd74){if(_0x4ffd74){_0x772704=_0x4ffd74;_0x35cd09[_0xf70d('0x58')]=_['keys'](db['UserVoiceQueueRt'][_0xf70d('0x3f')]);_0x35cd09['query']=_['keys'](_0x10b1a0['query']);_0x35cd09[_0xf70d('0x56')]=_[_0xf70d('0x57')](_0x35cd09[_0xf70d('0x58')],_0x35cd09['query']);_0x30f766[_0xf70d('0x59')]=_['intersection'](_0x35cd09[_0xf70d('0x58')],qs[_0xf70d('0x5a')](_0x10b1a0[_0xf70d('0x44')][_0xf70d('0x5a')]));_0x30f766['attributes']=_0x30f766[_0xf70d('0x59')][_0xf70d('0x4b')]?_0x30f766[_0xf70d('0x59')]:_0x35cd09[_0xf70d('0x58')];_0x30f766[_0xf70d('0xcd')]=qs[_0xf70d('0xce')](_0x10b1a0[_0xf70d('0x44')][_0xf70d('0xce')]);_0x30f766['where']=qs['filters'](_[_0xf70d('0xcf')](_0x10b1a0[_0xf70d('0x44')],_0x35cd09[_0xf70d('0x56')]));if(_0x10b1a0[_0xf70d('0x44')][_0xf70d('0x34')]){_0x30f766[_0xf70d('0x43')]=_[_0xf70d('0x5b')](_0x30f766[_0xf70d('0x43')],{'$or':_[_0xf70d('0x35')](_0x30f766[_0xf70d('0x59')],function(_0x451071){var _0xeb861b={};_0xeb861b[_0x451071]={'$like':'%'+_0x10b1a0[_0xf70d('0x44')]['filter']+'%'};return _0xeb861b;})});}_0x30f766=_[_0xf70d('0x5b')]({},_0x30f766,_0x10b1a0[_0xf70d('0xd0')]);return _0x772704[_0xf70d('0xdb')](_0x30f766);}})['then'](function(_0x4cc0f8){if(_0x4cc0f8){_0x5d9845=_0x4cc0f8[_0xf70d('0x4b')];if(!_0x10b1a0[_0xf70d('0x44')][_0xf70d('0xd2')](_0xf70d('0xd8'))){_0x30f766['limit']=qs['limit'](_0x10b1a0[_0xf70d('0x44')][_0xf70d('0x26')]);_0x30f766[_0xf70d('0x24')]=qs['offset'](_0x10b1a0['query'][_0xf70d('0x24')]);}return _0x772704[_0xf70d('0xdb')](_0x30f766);}})['then'](function(_0x330109){if(_0x330109){return _0x330109?{'count':_0x5d9845,'rows':_0x330109}:null;}})[_0xf70d('0x17')](respondWithResult(_0x1af32a,null))[_0xf70d('0x1f')](handleError(_0x1af32a,null));};exports['getGroups']=function(_0x58b46c,_0xd35e66){var _0x56d00c={};var _0x3a688c={};var _0x1e7751;var _0x587a27;return db[_0xf70d('0x3e')][_0xf70d('0x9b')]({'where':{'id':_0x58b46c['params']['id']}})[_0xf70d('0x17')](handleEntityNotFound(_0xd35e66,null))[_0xf70d('0x17')](function(_0x1fb408){if(_0x1fb408){_0x1e7751=_0x1fb408;_0x3a688c[_0xf70d('0x58')]=_[_0xf70d('0x54')](db[_0xf70d('0xdc')][_0xf70d('0x3f')]);_0x3a688c['query']=_[_0xf70d('0x54')](_0x58b46c[_0xf70d('0x44')]);_0x3a688c['filters']=_[_0xf70d('0x57')](_0x3a688c[_0xf70d('0x58')],_0x3a688c[_0xf70d('0x44')]);_0x56d00c[_0xf70d('0x59')]=_[_0xf70d('0x57')](_0x3a688c[_0xf70d('0x58')],qs['fields'](_0x58b46c['query'][_0xf70d('0x5a')]));_0x56d00c[_0xf70d('0x59')]=_0x56d00c[_0xf70d('0x59')][_0xf70d('0x4b')]?_0x56d00c[_0xf70d('0x59')]:_0x3a688c['model'];_0x56d00c[_0xf70d('0xcd')]=qs[_0xf70d('0xce')](_0x58b46c['query'][_0xf70d('0xce')]);_0x56d00c['where']=qs['filters'](_[_0xf70d('0xcf')](_0x58b46c['query'],_0x3a688c[_0xf70d('0x56')]));if(_0x58b46c['query'][_0xf70d('0x34')]){_0x56d00c[_0xf70d('0x43')]=_['merge'](_0x56d00c[_0xf70d('0x43')],{'$or':_['map'](_0x56d00c[_0xf70d('0x59')],function(_0x517304){var _0x4d93ea={};_0x4d93ea[_0x517304]={'$like':'%'+_0x58b46c[_0xf70d('0x44')][_0xf70d('0x34')]+'%'};return _0x4d93ea;})});}_0x56d00c=_['merge']({},_0x56d00c,_0x58b46c[_0xf70d('0xd0')]);return _0x1e7751[_0xf70d('0xdd')](_0x56d00c);}})[_0xf70d('0x17')](function(_0xf16b03){if(_0xf16b03){_0x587a27=_0xf16b03[_0xf70d('0x4b')];if(!_0x58b46c[_0xf70d('0x44')][_0xf70d('0xd2')]('nolimit')){_0x56d00c[_0xf70d('0x26')]=qs['limit'](_0x58b46c[_0xf70d('0x44')]['limit']);_0x56d00c['offset']=qs[_0xf70d('0x24')](_0x58b46c['query'][_0xf70d('0x24')]);}return _0x1e7751[_0xf70d('0xdd')](_0x56d00c);}})[_0xf70d('0x17')](function(_0x4d12c0){if(_0x4d12c0){return _0x4d12c0?{'count':_0x587a27,'rows':_0x4d12c0}:null;}})[_0xf70d('0x17')](respondWithResult(_0xd35e66,null))[_0xf70d('0x1f')](handleError(_0xd35e66,null));};exports[_0xf70d('0xde')]=function(_0x2dd0e3,_0x2d238f){var _0x146bec={'raw':!![],'where':{}};var _0x410cb7={};var _0x1378fa={'count':0x0,'rows':[]};return db[_0xf70d('0x3e')]['findOne']({'where':{'id':_0x2dd0e3[_0xf70d('0x53')]['id']}})['then'](handleEntityNotFound(_0x2d238f,null))['then'](function(_0x5a943c){if(_0x5a943c){_0x410cb7[_0xf70d('0x58')]=_[_0xf70d('0x54')](db['VoiceRecording'][_0xf70d('0x3f')]);_0x410cb7[_0xf70d('0x44')]=_[_0xf70d('0x54')](_0x2dd0e3['query']);_0x410cb7[_0xf70d('0x56')]=_[_0xf70d('0x57')](_0x410cb7[_0xf70d('0x58')],_0x410cb7['query']);_0x146bec[_0xf70d('0x59')]=_[_0xf70d('0x57')](_0x410cb7[_0xf70d('0x58')],qs[_0xf70d('0x5a')](_0x2dd0e3[_0xf70d('0x44')][_0xf70d('0x5a')]));_0x146bec[_0xf70d('0x59')]=_0x146bec[_0xf70d('0x59')][_0xf70d('0x4b')]?_0x146bec['attributes']:_0x410cb7[_0xf70d('0x58')];if(!_0x2dd0e3[_0xf70d('0x44')][_0xf70d('0xd2')]('nolimit')){_0x146bec[_0xf70d('0x26')]=qs[_0xf70d('0x26')](_0x2dd0e3[_0xf70d('0x44')][_0xf70d('0x26')]);_0x146bec[_0xf70d('0x24')]=qs[_0xf70d('0x24')](_0x2dd0e3['query'][_0xf70d('0x24')]);}_0x146bec[_0xf70d('0xcd')]=qs[_0xf70d('0xce')](_0x2dd0e3[_0xf70d('0x44')][_0xf70d('0xce')]);_0x146bec['where']=qs[_0xf70d('0x56')](_['pick'](_0x2dd0e3['query'],_0x410cb7['filters']));_0x146bec[_0xf70d('0x43')][_0xf70d('0xdf')]=_0x5a943c['id'];if(_0x2dd0e3['query']['filter']){_0x146bec[_0xf70d('0x43')]=_[_0xf70d('0x5b')](_0x146bec[_0xf70d('0x43')],{'$or':_['map'](_0x146bec['attributes'],function(_0x4b31d7){var _0x3f76b8={};_0x3f76b8[_0x4b31d7]={'$like':'%'+_0x2dd0e3[_0xf70d('0x44')][_0xf70d('0x34')]+'%'};return _0x3f76b8;})});}_0x146bec=_[_0xf70d('0x5b')]({},_0x146bec,_0x2dd0e3[_0xf70d('0xd0')]);return db[_0xf70d('0xe0')][_0xf70d('0x27')]({'where':_0x146bec[_0xf70d('0x43')]})['then'](function(_0x2a9a47){_0x1378fa[_0xf70d('0x27')]=_0x2a9a47;if(_0x2dd0e3['query'][_0xf70d('0x45')]){_0x146bec[_0xf70d('0x46')]=[{'all':!![]}];}return db[_0xf70d('0xe0')]['findAll'](_0x146bec);})[_0xf70d('0x17')](function(_0x567b4e){_0x1378fa[_0xf70d('0x4f')]=_0x567b4e;return _0x1378fa;});}})['then'](respondWithFilteredResult(_0x2d238f,_0x146bec))[_0xf70d('0x1f')](handleError(_0x2d238f,null));};exports['getScreenRecordings']=function(_0x2d03d3,_0xbc3c0d){var _0x12d078={'raw':!![],'where':{}};var _0x1836ad={};var _0x25b3c6={'count':0x0,'rows':[]};return db['User'][_0xf70d('0x9b')]({'where':{'id':_0x2d03d3[_0xf70d('0x53')]['id']}})[_0xf70d('0x17')](handleEntityNotFound(_0xbc3c0d,null))[_0xf70d('0x17')](function(_0x576f32){if(_0x576f32){_0x1836ad[_0xf70d('0x58')]=_['keys'](db[_0xf70d('0xe1')][_0xf70d('0x3f')]);_0x1836ad['query']=_[_0xf70d('0x54')](_0x2d03d3[_0xf70d('0x44')]);_0x1836ad[_0xf70d('0x56')]=_[_0xf70d('0x57')](_0x1836ad[_0xf70d('0x58')],_0x1836ad[_0xf70d('0x44')]);_0x12d078['attributes']=_['intersection'](_0x1836ad[_0xf70d('0x58')],qs[_0xf70d('0x5a')](_0x2d03d3[_0xf70d('0x44')]['fields']));_0x12d078[_0xf70d('0x59')]=_0x12d078[_0xf70d('0x59')][_0xf70d('0x4b')]?_0x12d078['attributes']:_0x1836ad[_0xf70d('0x58')];if(!_0x2d03d3[_0xf70d('0x44')][_0xf70d('0xd2')](_0xf70d('0xd8'))){_0x12d078[_0xf70d('0x26')]=qs[_0xf70d('0x26')](_0x2d03d3[_0xf70d('0x44')][_0xf70d('0x26')]);_0x12d078['offset']=qs['offset'](_0x2d03d3['query'][_0xf70d('0x24')]);}_0x12d078[_0xf70d('0xcd')]=qs[_0xf70d('0xce')](_0x2d03d3[_0xf70d('0x44')][_0xf70d('0xce')]);_0x12d078['where']=qs[_0xf70d('0x56')](_[_0xf70d('0xcf')](_0x2d03d3[_0xf70d('0x44')],_0x1836ad[_0xf70d('0x56')]));_0x12d078[_0xf70d('0x43')]['UserId']=_0x576f32['id'];if(_0x2d03d3[_0xf70d('0x44')][_0xf70d('0x34')]){_0x12d078[_0xf70d('0x43')]=_[_0xf70d('0x5b')](_0x12d078['where'],{'$or':_[_0xf70d('0x35')](_0x12d078['attributes'],function(_0x2a6ec1){var _0x3e367d={};_0x3e367d[_0x2a6ec1]={'$like':'%'+_0x2d03d3[_0xf70d('0x44')][_0xf70d('0x34')]+'%'};return _0x3e367d;})});}_0x12d078=_[_0xf70d('0x5b')]({},_0x12d078,_0x2d03d3[_0xf70d('0xd0')]);return db['ScreenRecording'][_0xf70d('0x27')]({'where':_0x12d078[_0xf70d('0x43')]})[_0xf70d('0x17')](function(_0x124886){_0x25b3c6[_0xf70d('0x27')]=_0x124886;if(_0x2d03d3['query'][_0xf70d('0x45')]){_0x12d078['include']=[{'all':!![]}];}return db[_0xf70d('0xe1')][_0xf70d('0x8f')](_0x12d078);})['then'](function(_0x3a3551){_0x25b3c6[_0xf70d('0x4f')]=_0x3a3551;return _0x25b3c6;});}})[_0xf70d('0x17')](respondWithFilteredResult(_0xbc3c0d,_0x12d078))[_0xf70d('0x1f')](handleError(_0xbc3c0d,null));};exports[_0xf70d('0xe2')]=function(_0x48688b,_0x52785a){var _0x3cdeba={};var _0x313215={};var _0x27b7e6;var _0x52dfd9;return db[_0xf70d('0x3e')][_0xf70d('0x9b')]({'where':{'id':_0x48688b[_0xf70d('0x53')]['id']}})['then'](handleEntityNotFound(_0x52785a,null))[_0xf70d('0x17')](function(_0x3dbdef){if(_0x3dbdef){_0x27b7e6=_0x3dbdef;_0x313215[_0xf70d('0x58')]=_['keys'](db['ChatInteraction']['rawAttributes']);_0x313215['query']=_[_0xf70d('0x54')](_0x48688b[_0xf70d('0x44')]);_0x313215[_0xf70d('0x56')]=_[_0xf70d('0x57')](_0x313215[_0xf70d('0x58')],_0x313215[_0xf70d('0x44')]);_0x3cdeba[_0xf70d('0x59')]=_[_0xf70d('0x57')](_0x313215[_0xf70d('0x58')],qs[_0xf70d('0x5a')](_0x48688b[_0xf70d('0x44')]['fields']));_0x3cdeba[_0xf70d('0x59')]=_0x3cdeba[_0xf70d('0x59')][_0xf70d('0x4b')]?_0x3cdeba[_0xf70d('0x59')]:_0x313215[_0xf70d('0x58')];_0x3cdeba[_0xf70d('0xcd')]=qs[_0xf70d('0xce')](_0x48688b['query']['sort']);_0x3cdeba[_0xf70d('0x43')]=qs['filters'](_['pick'](_0x48688b['query'],_0x313215[_0xf70d('0x56')]));if(_0x48688b['query'][_0xf70d('0x34')]){_0x3cdeba[_0xf70d('0x43')]=_[_0xf70d('0x5b')](_0x3cdeba['where'],{'$or':_['map'](_0x3cdeba[_0xf70d('0x59')],function(_0x690012){var _0x525485={};_0x525485[_0x690012]={'$like':'%'+_0x48688b[_0xf70d('0x44')][_0xf70d('0x34')]+'%'};return _0x525485;})});}_0x3cdeba=_[_0xf70d('0x5b')]({},_0x3cdeba,_0x48688b['options']);return _0x27b7e6[_0xf70d('0xe2')](_0x3cdeba);}})[_0xf70d('0x17')](function(_0x46a452){if(_0x46a452){_0x52dfd9=_0x46a452['length'];if(!_0x48688b[_0xf70d('0x44')]['hasOwnProperty']('nolimit')){_0x3cdeba[_0xf70d('0x26')]=qs[_0xf70d('0x26')](_0x48688b['query']['limit']);_0x3cdeba[_0xf70d('0x24')]=qs[_0xf70d('0x24')](_0x48688b[_0xf70d('0x44')][_0xf70d('0x24')]);}return _0x27b7e6[_0xf70d('0xe2')](_0x3cdeba);}})[_0xf70d('0x17')](function(_0x44258c){if(_0x44258c){return _0x44258c?{'count':_0x52dfd9,'rows':_0x44258c}:null;}})[_0xf70d('0x17')](respondWithResult(_0x52785a,null))['catch'](handleError(_0x52785a,null));};exports['getOpenchannelInteractions']=function(_0x4ed52a,_0x4bed05){var _0x497b57={};var _0x40ee7b={};var _0x5f495b;var _0x345e5f;return db['User']['findOne']({'where':{'id':_0x4ed52a[_0xf70d('0x53')]['id']}})[_0xf70d('0x17')](handleEntityNotFound(_0x4bed05,null))[_0xf70d('0x17')](function(_0x5a8038){if(_0x5a8038){_0x5f495b=_0x5a8038;_0x40ee7b[_0xf70d('0x58')]=_[_0xf70d('0x54')](db[_0xf70d('0xe3')][_0xf70d('0x3f')]);_0x40ee7b[_0xf70d('0x44')]=_['keys'](_0x4ed52a['query']);_0x40ee7b[_0xf70d('0x56')]=_['intersection'](_0x40ee7b[_0xf70d('0x58')],_0x40ee7b[_0xf70d('0x44')]);_0x497b57[_0xf70d('0x59')]=_['intersection'](_0x40ee7b[_0xf70d('0x58')],qs['fields'](_0x4ed52a['query'][_0xf70d('0x5a')]));_0x497b57[_0xf70d('0x59')]=_0x497b57[_0xf70d('0x59')][_0xf70d('0x4b')]?_0x497b57[_0xf70d('0x59')]:_0x40ee7b['model'];_0x497b57[_0xf70d('0xcd')]=qs[_0xf70d('0xce')](_0x4ed52a[_0xf70d('0x44')][_0xf70d('0xce')]);_0x497b57[_0xf70d('0x43')]=qs[_0xf70d('0x56')](_[_0xf70d('0xcf')](_0x4ed52a[_0xf70d('0x44')],_0x40ee7b[_0xf70d('0x56')]));if(_0x4ed52a['query'][_0xf70d('0x34')]){_0x497b57[_0xf70d('0x43')]=_[_0xf70d('0x5b')](_0x497b57['where'],{'$or':_[_0xf70d('0x35')](_0x497b57[_0xf70d('0x59')],function(_0x512365){var _0x52cb74={};_0x52cb74[_0x512365]={'$like':'%'+_0x4ed52a[_0xf70d('0x44')]['filter']+'%'};return _0x52cb74;})});}_0x497b57=_[_0xf70d('0x5b')]({},_0x497b57,_0x4ed52a[_0xf70d('0xd0')]);return _0x5f495b[_0xf70d('0xe4')](_0x497b57);}})[_0xf70d('0x17')](function(_0x1473eb){if(_0x1473eb){_0x345e5f=_0x1473eb[_0xf70d('0x4b')];if(!_0x4ed52a[_0xf70d('0x44')][_0xf70d('0xd2')](_0xf70d('0xd8'))){_0x497b57['limit']=qs[_0xf70d('0x26')](_0x4ed52a['query'][_0xf70d('0x26')]);_0x497b57[_0xf70d('0x24')]=qs[_0xf70d('0x24')](_0x4ed52a[_0xf70d('0x44')][_0xf70d('0x24')]);}return _0x5f495b[_0xf70d('0xe4')](_0x497b57);}})[_0xf70d('0x17')](function(_0x5926a3){if(_0x5926a3){return _0x5926a3?{'count':_0x345e5f,'rows':_0x5926a3}:null;}})[_0xf70d('0x17')](respondWithResult(_0x4bed05,null))[_0xf70d('0x1f')](handleError(_0x4bed05,null));};exports[_0xf70d('0xe5')]=function(_0x13882b,_0x3ee9bb){var _0x4fc18={'raw':!![],'where':{}};var _0x21dfce={};var _0x2d4fa9={'count':0x0,'rows':[]};return db[_0xf70d('0x3e')][_0xf70d('0x9b')]({'where':{'id':_0x13882b[_0xf70d('0x53')]['id']}})[_0xf70d('0x17')](handleEntityNotFound(_0x3ee9bb,null))[_0xf70d('0x17')](function(_0x2dd7fb){if(_0x2dd7fb){_0x21dfce['model']=_[_0xf70d('0x54')](db[_0xf70d('0xe6')][_0xf70d('0x3f')]);_0x21dfce[_0xf70d('0x44')]=_[_0xf70d('0x54')](_0x13882b['query']);_0x21dfce[_0xf70d('0x56')]=_[_0xf70d('0x57')](_0x21dfce[_0xf70d('0x58')],_0x21dfce[_0xf70d('0x44')]);_0x4fc18[_0xf70d('0x59')]=_[_0xf70d('0x57')](_0x21dfce['model'],qs['fields'](_0x13882b[_0xf70d('0x44')][_0xf70d('0x5a')]));_0x4fc18['attributes']=_0x4fc18[_0xf70d('0x59')]['length']?_0x4fc18[_0xf70d('0x59')]:_0x21dfce['model'];if(!_0x13882b[_0xf70d('0x44')]['hasOwnProperty']('nolimit')){_0x4fc18['limit']=qs['limit'](_0x13882b['query'][_0xf70d('0x26')]);_0x4fc18[_0xf70d('0x24')]=qs[_0xf70d('0x24')](_0x13882b['query'][_0xf70d('0x24')]);}_0x4fc18[_0xf70d('0xcd')]=qs['sort'](_0x13882b[_0xf70d('0x44')]['sort']);_0x4fc18[_0xf70d('0x43')]=qs['filters'](_[_0xf70d('0xcf')](_0x13882b[_0xf70d('0x44')],_0x21dfce[_0xf70d('0x56')]));_0x4fc18[_0xf70d('0x43')]['UserId']=_0x2dd7fb['id'];if(_0x13882b[_0xf70d('0x44')]['filter']){_0x4fc18['where']=_[_0xf70d('0x5b')](_0x4fc18[_0xf70d('0x43')],{'$or':_[_0xf70d('0x35')](_0x4fc18[_0xf70d('0x59')],function(_0x3f4c96){var _0x3a5a90={};_0x3a5a90[_0x3f4c96]={'$like':'%'+_0x13882b[_0xf70d('0x44')][_0xf70d('0x34')]+'%'};return _0x3a5a90;})});}_0x4fc18=_[_0xf70d('0x5b')]({},_0x4fc18,_0x13882b[_0xf70d('0xd0')]);return db[_0xf70d('0xe6')]['count']({'where':_0x4fc18[_0xf70d('0x43')]})[_0xf70d('0x17')](function(_0x22d413){_0x2d4fa9[_0xf70d('0x27')]=_0x22d413;if(_0x13882b[_0xf70d('0x44')][_0xf70d('0x45')]){_0x4fc18[_0xf70d('0x46')]=[{'all':!![]}];}return db[_0xf70d('0xe6')]['findAll'](_0x4fc18);})[_0xf70d('0x17')](function(_0x2863b7){_0x2d4fa9[_0xf70d('0x4f')]=_0x2863b7;return _0x2d4fa9;});}})[_0xf70d('0x17')](respondWithFilteredResult(_0x3ee9bb,_0x4fc18))[_0xf70d('0x1f')](handleError(_0x3ee9bb,null));};exports[_0xf70d('0xe7')]=function(_0x426b28,_0x3b1008){var _0x5085d8={};var _0x5dedde={};var _0x15ef97;var _0x78947e;return db[_0xf70d('0x3e')][_0xf70d('0x9b')]({'where':{'id':_0x426b28[_0xf70d('0x53')]['id']}})['then'](handleEntityNotFound(_0x3b1008,null))[_0xf70d('0x17')](function(_0x5d91e6){if(_0x5d91e6){_0x15ef97=_0x5d91e6;_0x5dedde[_0xf70d('0x58')]=_[_0xf70d('0x54')](db['SmsInteraction'][_0xf70d('0x3f')]);_0x5dedde[_0xf70d('0x44')]=_[_0xf70d('0x54')](_0x426b28[_0xf70d('0x44')]);_0x5dedde['filters']=_['intersection'](_0x5dedde[_0xf70d('0x58')],_0x5dedde[_0xf70d('0x44')]);_0x5085d8[_0xf70d('0x59')]=_['intersection'](_0x5dedde[_0xf70d('0x58')],qs[_0xf70d('0x5a')](_0x426b28[_0xf70d('0x44')]['fields']));_0x5085d8[_0xf70d('0x59')]=_0x5085d8[_0xf70d('0x59')][_0xf70d('0x4b')]?_0x5085d8[_0xf70d('0x59')]:_0x5dedde[_0xf70d('0x58')];_0x5085d8[_0xf70d('0xcd')]=qs[_0xf70d('0xce')](_0x426b28[_0xf70d('0x44')]['sort']);_0x5085d8['where']=qs[_0xf70d('0x56')](_[_0xf70d('0xcf')](_0x426b28[_0xf70d('0x44')],_0x5dedde[_0xf70d('0x56')]));if(_0x426b28[_0xf70d('0x44')][_0xf70d('0x34')]){_0x5085d8[_0xf70d('0x43')]=_[_0xf70d('0x5b')](_0x5085d8[_0xf70d('0x43')],{'$or':_[_0xf70d('0x35')](_0x5085d8[_0xf70d('0x59')],function(_0x2bb65a){var _0x114e53={};_0x114e53[_0x2bb65a]={'$like':'%'+_0x426b28[_0xf70d('0x44')][_0xf70d('0x34')]+'%'};return _0x114e53;})});}_0x5085d8=_[_0xf70d('0x5b')]({},_0x5085d8,_0x426b28[_0xf70d('0xd0')]);return _0x15ef97[_0xf70d('0xe7')](_0x5085d8);}})['then'](function(_0x346c7e){if(_0x346c7e){_0x78947e=_0x346c7e[_0xf70d('0x4b')];if(!_0x426b28[_0xf70d('0x44')][_0xf70d('0xd2')](_0xf70d('0xd8'))){_0x5085d8[_0xf70d('0x26')]=qs[_0xf70d('0x26')](_0x426b28['query'][_0xf70d('0x26')]);_0x5085d8['offset']=qs[_0xf70d('0x24')](_0x426b28[_0xf70d('0x44')]['offset']);}return _0x15ef97[_0xf70d('0xe7')](_0x5085d8);}})[_0xf70d('0x17')](function(_0xef736){if(_0xef736){return _0xef736?{'count':_0x78947e,'rows':_0xef736}:null;}})[_0xf70d('0x17')](respondWithResult(_0x3b1008,null))[_0xf70d('0x1f')](handleError(_0x3b1008,null));};exports[_0xf70d('0xe8')]=function(_0x41b8d7,_0x33e44d){var _0x5cd6f1={};var _0x58caa7={};var _0x4782cf;var _0x10de13;return db[_0xf70d('0x3e')]['findOne']({'where':{'id':_0x41b8d7[_0xf70d('0x53')]['id']}})['then'](handleEntityNotFound(_0x33e44d,null))['then'](function(_0x5ce837){if(_0x5ce837){_0x4782cf=_0x5ce837;_0x58caa7[_0xf70d('0x58')]=_[_0xf70d('0x54')](db[_0xf70d('0xe9')][_0xf70d('0x3f')]);_0x58caa7[_0xf70d('0x44')]=_[_0xf70d('0x54')](_0x41b8d7[_0xf70d('0x44')]);_0x58caa7[_0xf70d('0x56')]=_[_0xf70d('0x57')](_0x58caa7[_0xf70d('0x58')],_0x58caa7[_0xf70d('0x44')]);_0x5cd6f1[_0xf70d('0x59')]=_[_0xf70d('0x57')](_0x58caa7[_0xf70d('0x58')],qs[_0xf70d('0x5a')](_0x41b8d7[_0xf70d('0x44')]['fields']));_0x5cd6f1[_0xf70d('0x59')]=_0x5cd6f1[_0xf70d('0x59')][_0xf70d('0x4b')]?_0x5cd6f1[_0xf70d('0x59')]:_0x58caa7['model'];_0x5cd6f1['order']=qs[_0xf70d('0xce')](_0x41b8d7['query'][_0xf70d('0xce')]);_0x5cd6f1[_0xf70d('0x43')]=qs['filters'](_[_0xf70d('0xcf')](_0x41b8d7[_0xf70d('0x44')],_0x58caa7[_0xf70d('0x56')]));if(_0x41b8d7[_0xf70d('0x44')][_0xf70d('0x34')]){_0x5cd6f1[_0xf70d('0x43')]=_['merge'](_0x5cd6f1[_0xf70d('0x43')],{'$or':_[_0xf70d('0x35')](_0x5cd6f1[_0xf70d('0x59')],function(_0x292d30){var _0x101036={};_0x101036[_0x292d30]={'$like':'%'+_0x41b8d7[_0xf70d('0x44')][_0xf70d('0x34')]+'%'};return _0x101036;})});}_0x5cd6f1=_[_0xf70d('0x5b')]({},_0x5cd6f1,_0x41b8d7[_0xf70d('0xd0')]);return _0x4782cf[_0xf70d('0xe8')](_0x5cd6f1);}})[_0xf70d('0x17')](function(_0x5874c4){if(_0x5874c4){_0x10de13=_0x5874c4['length'];if(!_0x41b8d7[_0xf70d('0x44')][_0xf70d('0xd2')](_0xf70d('0xd8'))){_0x5cd6f1[_0xf70d('0x26')]=qs[_0xf70d('0x26')](_0x41b8d7[_0xf70d('0x44')][_0xf70d('0x26')]);_0x5cd6f1[_0xf70d('0x24')]=qs[_0xf70d('0x24')](_0x41b8d7[_0xf70d('0x44')][_0xf70d('0x24')]);}return _0x4782cf[_0xf70d('0xe8')](_0x5cd6f1);}})['then'](function(_0x4da273){if(_0x4da273){return _0x4da273?{'count':_0x10de13,'rows':_0x4da273}:null;}})['then'](respondWithResult(_0x33e44d,null))[_0xf70d('0x1f')](handleError(_0x33e44d,null));};exports[_0xf70d('0xea')]=function(_0x3fcc0f,_0x1b3506){var _0x5d3d2d={};var _0x1e8ca3={};var _0x539df9;var _0x116bcd;return db[_0xf70d('0x3e')]['findOne']({'where':{'id':_0x3fcc0f['params']['id']}})[_0xf70d('0x17')](handleEntityNotFound(_0x1b3506,null))[_0xf70d('0x17')](function(_0x4f315b){if(_0x4f315b){_0x539df9=_0x4f315b;_0x1e8ca3[_0xf70d('0x58')]=_[_0xf70d('0x54')](db[_0xf70d('0xeb')][_0xf70d('0x3f')]);_0x1e8ca3[_0xf70d('0x44')]=_[_0xf70d('0x54')](_0x3fcc0f['query']);_0x1e8ca3[_0xf70d('0x56')]=_[_0xf70d('0x57')](_0x1e8ca3[_0xf70d('0x58')],_0x1e8ca3['query']);_0x5d3d2d[_0xf70d('0x59')]=_[_0xf70d('0x57')](_0x1e8ca3[_0xf70d('0x58')],qs[_0xf70d('0x5a')](_0x3fcc0f[_0xf70d('0x44')][_0xf70d('0x5a')]));_0x5d3d2d[_0xf70d('0x59')]=_0x5d3d2d['attributes'][_0xf70d('0x4b')]?_0x5d3d2d['attributes']:_0x1e8ca3[_0xf70d('0x58')];_0x5d3d2d[_0xf70d('0xcd')]=qs[_0xf70d('0xce')](_0x3fcc0f['query'][_0xf70d('0xce')]);_0x5d3d2d[_0xf70d('0x43')]=qs[_0xf70d('0x56')](_[_0xf70d('0xcf')](_0x3fcc0f['query'],_0x1e8ca3[_0xf70d('0x56')]));if(_0x3fcc0f['query']['filter']){_0x5d3d2d[_0xf70d('0x43')]=_[_0xf70d('0x5b')](_0x5d3d2d['where'],{'$or':_[_0xf70d('0x35')](_0x5d3d2d[_0xf70d('0x59')],function(_0x1188dc){var _0x22c116={};_0x22c116[_0x1188dc]={'$like':'%'+_0x3fcc0f['query'][_0xf70d('0x34')]+'%'};return _0x22c116;})});}_0x5d3d2d=_[_0xf70d('0x5b')]({},_0x5d3d2d,_0x3fcc0f[_0xf70d('0xd0')]);return _0x539df9[_0xf70d('0xea')](_0x5d3d2d);}})[_0xf70d('0x17')](function(_0x46fa74){if(_0x46fa74){_0x116bcd=_0x46fa74[_0xf70d('0x4b')];if(!_0x3fcc0f['query'][_0xf70d('0xd2')](_0xf70d('0xd8'))){_0x5d3d2d[_0xf70d('0x26')]=qs[_0xf70d('0x26')](_0x3fcc0f[_0xf70d('0x44')][_0xf70d('0x26')]);_0x5d3d2d[_0xf70d('0x24')]=qs[_0xf70d('0x24')](_0x3fcc0f[_0xf70d('0x44')][_0xf70d('0x24')]);}return _0x539df9['getWhatsappInteractions'](_0x5d3d2d);}})[_0xf70d('0x17')](function(_0x5a4a12){if(_0x5a4a12){return _0x5a4a12?{'count':_0x116bcd,'rows':_0x5a4a12}:null;}})[_0xf70d('0x17')](respondWithResult(_0x1b3506,null))[_0xf70d('0x1f')](handleError(_0x1b3506,null));};exports[_0xf70d('0xec')]=function(_0x20faba,_0x225e27,_0x3b1f07){var _0x230b1e;var _0x158060;var _0x1ac00d;var _0x598b80=!_[_0xf70d('0x6b')](_0x20faba[_0xf70d('0x53')]['id'])?_0x20faba[_0xf70d('0x53')]['id']:!_[_0xf70d('0x6b')](_0x20faba[_0xf70d('0x30')]['id'])?_0x20faba['user']['id']:null;return db[_0xf70d('0x3e')][_0xf70d('0x38')]({'where':{'id':_0x598b80,'role':{'$or':[_0xf70d('0x2e'),_0xf70d('0x30'),'agent']}},'attributes':['id',_0xf70d('0x39'),'phone',_0xf70d('0xed'),_0xf70d('0x2d'),_0xf70d('0x6c'),_0xf70d('0xee')]})[_0xf70d('0x17')](function(_0x5d8472){if(_0x5d8472){if(_0x5d8472[_0xf70d('0x2d')]==='agent'){_0x230b1e=_0x5d8472;if(_0x20faba[_0xf70d('0x60')][_0xf70d('0xa5')]){_0x1ac00d=util['format']('LOCAL/%s@from-sip/n',_0x230b1e[_0x20faba['body'][_0xf70d('0xa5')]]);}else if(_0x20faba['body'][_0xf70d('0xef')]){_0x1ac00d=util[_0xf70d('0xaf')](_0xf70d('0xb0'),_0x20faba[_0xf70d('0x60')][_0xf70d('0xef')]);}else{_0x1ac00d=util[_0xf70d('0xaf')]('SIP/%s',_0x230b1e[_0xf70d('0x39')]);}socket['to'](util['format'](_0xf70d('0xf0'),_0x230b1e[_0xf70d('0x39')]))[_0xf70d('0x2b')](_0xf70d('0xf1'),{'user':{'id':_0x230b1e['id'],'name':_0x230b1e[_0xf70d('0x39')]},'ip':_0x20faba[_0xf70d('0xf2')][_0xf70d('0xf3')]||_0x20faba[_0xf70d('0xf4')][_0xf70d('0xf5')]||_0x20faba[_0xf70d('0xf6')]['remoteAddress']||_0x20faba[_0xf70d('0xf4')]['socket'][_0xf70d('0xf5')]});return db[_0xf70d('0xb6')][_0xf70d('0x3b')]({'where':{'membername':_0x230b1e[_0xf70d('0x39')]},'individualHooks':!![]});}}else{throw new db[(_0xf70d('0x98'))][(_0xf70d('0x95'))](_0xf70d('0xf7'));}})[_0xf70d('0x17')](function(){if(_0x230b1e){return _0x230b1e[_0xf70d('0xf8')]({'raw':!![]});}})[_0xf70d('0x17')](function(_0x32b460){if(_0x230b1e){if(_0x32b460){_0x158060=_0x32b460;if(_0x158060[_0xf70d('0x4b')]){var _0x557c3e=_0x158060['map'](function(_0xb413bd){var _0x6b5532={'membername':_0x230b1e['name'],'UserId':_0x230b1e['id'],'queue_name':_0xb413bd[_0xf70d('0x39')],'VoiceQueueId':_0xb413bd['id'],'interface':_0x1ac00d,'paused':_0x230b1e[_0xf70d('0xee')]||![],'penalty':_0xb413bd['UserVoiceQueue.penalty']||0x0};return db[_0xf70d('0xb6')]['upsert'](_0x6b5532);});return Promise[_0xf70d('0x5f')](_0x557c3e);}}}})[_0xf70d('0x17')](function(){if(_0x230b1e){return db['MemberReport'][_0xf70d('0x8f')]({'where':{'membername':_0x230b1e[_0xf70d('0x39')],'exitAt':null}});}})[_0xf70d('0x17')](function(_0xf24c58){if(_0x230b1e){var _0x1e4f5e=[];_0xf24c58[_0xf70d('0xf9')](function(_0x4c2f78){_0x1e4f5e['push'](_0x4c2f78[_0xf70d('0x2a')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0xf70d('0x5f')](_0x1e4f5e);}})[_0xf70d('0x17')](function(){if(_0x230b1e){var _0x4f2047=[];var _0x44fea6=[];var _0x43fa4d=utils[_0xf70d('0xfa')]();var _0x55bdc3={'membername':_0x230b1e[_0xf70d('0x39')],'interface':_0x1ac00d,'enterAt':moment()[_0xf70d('0xaf')](_0xf70d('0xfb')),'role':_0x230b1e[_0xf70d('0x2d')],'internal':_0x230b1e[_0xf70d('0x6c')]};_0x43fa4d['forEach'](function(_0x44b29d){_0x4f2047[_0xf70d('0x4a')](_[_0xf70d('0x5b')]({'channel':_0x44b29d,'type':_0xf70d('0xfc'),'data1':_0x20faba[_0xf70d('0x60')]['device'],'data2':_0x1ac00d},_0x55bdc3));if(_0x230b1e['loginInPause']){_0x44fea6['push'](_[_0xf70d('0x5b')]({'channel':_0x44b29d,'type':_0xf70d('0xfd'),'data1':_0xf70d('0xfe')},_0x55bdc3));}});return db[_0xf70d('0xff')][_0xf70d('0x100')](_0x4f2047[_0xf70d('0xcb')](_0x44fea6),{'individualHooks':!![]});}})[_0xf70d('0x17')](function(){if(_0x230b1e){return _0x230b1e[_0xf70d('0x2a')]({'online':!![],'lastLoginAt':moment()[_0xf70d('0xaf')](_0xf70d('0xfb')),'voicePause':_0x230b1e[_0xf70d('0xee')]||![],'mailPause':_0x230b1e[_0xf70d('0xee')]||![],'chatPause':_0x230b1e['loginInPause']||![],'faxPause':_0x230b1e[_0xf70d('0xee')]||![],'smsPause':_0x230b1e[_0xf70d('0xee')]||![],'openchannelPause':_0x230b1e[_0xf70d('0xee')]||![],'whatsappPause':_0x230b1e[_0xf70d('0xee')]||![],'pauseType':_0x230b1e[_0xf70d('0xee')]?_0xf70d('0xfe'):null,'interface':_0x1ac00d,'lastPauseAt':moment()['format'](_0xf70d('0xfb'))});}})[_0xf70d('0x17')](function(_0x146661){if(_0x20faba[_0xf70d('0x101')]){return _0x3b1f07();}else{return Promise[_0xf70d('0x102')](_0x146661)[_0xf70d('0x17')](respondWithResult(_0x225e27,null));}})[_0xf70d('0x1f')](handleError(_0x225e27,null));};exports[_0xf70d('0x103')]=function(_0x1f1634,_0xdbcd6c){var _0x5ab122;return db['User'][_0xf70d('0x38')]({'where':{'id':_0x1f1634[_0xf70d('0x53')]['id'],'role':_0xf70d('0x32')},'attributes':['id','name',_0xf70d('0x2d')]})[_0xf70d('0x17')](handleEntityNotFound(_0xdbcd6c,null))['then'](function(_0x371a2d){if(_0x371a2d){_0x5ab122=_0x371a2d;return db[_0xf70d('0xb6')]['destroy']({'where':{'membername':_0x5ab122[_0xf70d('0x39')]},'individualHooks':!![]});}})[_0xf70d('0x17')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x5ab122['name'],'exitAt':null}});})[_0xf70d('0x17')](function(_0x289c87){var _0x27b500=[];_0x289c87[_0xf70d('0xf9')](function(_0x352b35){_0x27b500[_0xf70d('0x4a')](_0x352b35[_0xf70d('0x2a')]({'exitAt':moment()['format'](_0xf70d('0xfb'))}));});return Promise['all'](_0x27b500);})['then'](function(){return _0x5ab122['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xf70d('0x17')](respondWithResult(_0xdbcd6c,null))[_0xf70d('0x1f')](handleError(_0xdbcd6c,null));};exports[_0xf70d('0x104')]=function(_0x2b147a,_0x19fdb2){var _0x4e22eb;return db[_0xf70d('0xb6')][_0xf70d('0x2a')]({'paused':0x1},{'where':{'UserId':_0x2b147a['params']['id']},'individualHooks':!![]})[_0xf70d('0x17')](function(){return db[_0xf70d('0x3e')][_0xf70d('0x38')]({'where':{'id':_0x2b147a[_0xf70d('0x53')]['id'],'role':_0xf70d('0x32')},'attributes':['id',_0xf70d('0x39'),'role','internal',_0xf70d('0xa5'),_0xf70d('0xa3')]});})[_0xf70d('0x17')](handleEntityNotFound(_0x19fdb2,null))['then'](function(_0x90ec4){if(_0x90ec4){_0x4e22eb=_0x90ec4;return respondWithRpcPromise(_0xf70d('0x105'),_0xf70d('0x104'),{'id':_0x4e22eb['id'],'name':_0x4e22eb[_0xf70d('0x39')],'pause':!![]});}})[_0xf70d('0x17')](function(){if(_0x4e22eb){return db[_0xf70d('0xff')][_0xf70d('0x8f')]({'where':{'membername':_0x4e22eb['name'],'type':'PAUSE','exitAt':null}});}})[_0xf70d('0x17')](function(_0x37056f){if(_0x37056f[_0xf70d('0x4b')]){var _0x1f9c54=moment()[_0xf70d('0xaf')](_0xf70d('0xfb'));for(var _0x5a1ccc=0x0,_0x337aad=_0x37056f['length'];_0x5a1ccc<_0x337aad;_0x5a1ccc++){_0x37056f[_0x5a1ccc]['updateAttributes']({'exitAt':_0x1f9c54});}}})[_0xf70d('0x17')](function(){var _0x4c1a85=[];var _0x23286f=utils['getChannels']();_0x23286f[_0xf70d('0xf9')](function(_0x1c6cec){_0x4c1a85['push']({'channel':_0x1c6cec,'membername':_0x4e22eb[_0xf70d('0x39')],'interface':_['isNil'](_0x4e22eb[_0xf70d('0xa5')])?util[_0xf70d('0xaf')]('SIP/%s',_0x4e22eb[_0xf70d('0x39')]):_0x4e22eb[_0xf70d('0xa5')],'type':_0xf70d('0xfd'),'enterAt':moment()['format'](_0xf70d('0xfb')),'data1':_0x2b147a[_0xf70d('0x60')][_0xf70d('0x40')]||_0xf70d('0x106'),'role':_0x4e22eb['role'],'internal':_0x4e22eb[_0xf70d('0x6c')]});});return db['MemberReport'][_0xf70d('0x100')](_0x4c1a85,{'individualHooks':!![]});})[_0xf70d('0x17')](function(){return _0x4e22eb[_0xf70d('0x2a')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x2b147a[_0xf70d('0x60')][_0xf70d('0x40')]||_0xf70d('0x106'),'lastPauseAt':moment()[_0xf70d('0xaf')]('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0x19fdb2,null))[_0xf70d('0x1f')](handleError(_0x19fdb2,null));};exports[_0xf70d('0x107')]=function(_0x12cc09,_0x4c533e){if(_0x12cc09['body'][_0xf70d('0xa2')]&&!utils[_0xf70d('0xb3')](_0x12cc09[_0xf70d('0x60')]['channel'])){throw new APIBadRequestError(util['format'](_0xf70d('0x108'),_0x12cc09[_0xf70d('0x60')][_0xf70d('0xa2')]));}return db['User'][_0xf70d('0x38')]({'where':{'id':_0x12cc09['params']['id']},'attributes':['id',_0xf70d('0x39'),_0xf70d('0x2d'),_0xf70d('0x6c'),_0xf70d('0xa5'),'online',_0xf70d('0xa4'),_0xf70d('0x109'),_0xf70d('0x10a'),_0xf70d('0x10b'),_0xf70d('0x10c'),'smsPause',_0xf70d('0x10d'),_0xf70d('0x10e'),_0xf70d('0x10f')]})[_0xf70d('0x17')](function(_0xc1fd83){if(!_0xc1fd83){throw new APINotFoundError(util['format'](_0xf70d('0x110'),_0x12cc09[_0xf70d('0x53')]['id']));}return _0xc1fd83[_0xf70d('0x107')](_0x12cc09['body'][_0xf70d('0xa2')]);})['then'](respondWithResult(_0x4c533e,null))['catch'](APIHandleError(_0x4c533e));};exports[_0xf70d('0x111')]=function(_0x3c4579,_0x1d5e89){var _0x1dd927={};var _0x34c52c={};var _0x48347d;var _0x2c894f;return db[_0xf70d('0x3e')][_0xf70d('0x9b')]({'where':{'id':_0x3c4579[_0xf70d('0x53')]['id']}})[_0xf70d('0x17')](handleEntityNotFound(_0x1d5e89,null))[_0xf70d('0x17')](function(_0x4b9714){if(_0x4b9714){_0x48347d=_0x4b9714;_0x34c52c[_0xf70d('0x58')]=_['keys'](db['Team'][_0xf70d('0x3f')]);_0x34c52c[_0xf70d('0x44')]=_['keys'](_0x3c4579[_0xf70d('0x44')]);_0x34c52c[_0xf70d('0x56')]=_['intersection'](_0x34c52c[_0xf70d('0x58')],_0x34c52c['query']);_0x1dd927[_0xf70d('0x59')]=_[_0xf70d('0x57')](_0x34c52c[_0xf70d('0x58')],qs['fields'](_0x3c4579['query'][_0xf70d('0x5a')]));_0x1dd927[_0xf70d('0x59')]=_0x1dd927['attributes'][_0xf70d('0x4b')]?_0x1dd927['attributes']:_0x34c52c[_0xf70d('0x58')];_0x1dd927[_0xf70d('0xcd')]=qs[_0xf70d('0xce')](_0x3c4579[_0xf70d('0x44')][_0xf70d('0xce')]);_0x1dd927[_0xf70d('0x43')]=qs['filters'](_[_0xf70d('0xcf')](_0x3c4579[_0xf70d('0x44')],_0x34c52c[_0xf70d('0x56')]));if(_0x3c4579['query']['filter']){_0x1dd927['where']=_[_0xf70d('0x5b')](_0x1dd927[_0xf70d('0x43')],{'$or':_['map'](_0x1dd927[_0xf70d('0x59')],function(_0x44858e){var _0x2bd987={};_0x2bd987[_0x44858e]={'$like':'%'+_0x3c4579[_0xf70d('0x44')][_0xf70d('0x34')]+'%'};return _0x2bd987;})});}_0x1dd927=_[_0xf70d('0x5b')]({},_0x1dd927,_0x3c4579[_0xf70d('0xd0')]);return _0x48347d[_0xf70d('0x111')](_0x1dd927);}})[_0xf70d('0x17')](function(_0x2dd33b){if(_0x2dd33b){_0x2c894f=_0x2dd33b[_0xf70d('0x4b')];if(!_0x3c4579['query']['hasOwnProperty'](_0xf70d('0xd8'))){_0x1dd927[_0xf70d('0x26')]=qs[_0xf70d('0x26')](_0x3c4579[_0xf70d('0x44')]['limit']);_0x1dd927['offset']=qs[_0xf70d('0x24')](_0x3c4579[_0xf70d('0x44')][_0xf70d('0x24')]);}return _0x48347d[_0xf70d('0x111')](_0x1dd927);}})[_0xf70d('0x17')](function(_0x188952){if(_0x188952){return _0x188952?{'count':_0x2c894f,'rows':_0x188952}:null;}})['then'](respondWithResult(_0x1d5e89,null))[_0xf70d('0x1f')](handleError(_0x1d5e89,null));};exports['addTeams']=function(_0x229644,_0x568bfb){var _0x325ce8=_0x229644[_0xf70d('0x53')]['id'];var _0x24b1d2=_0x229644[_0xf70d('0x60')]?_0x229644[_0xf70d('0x60')][_0xf70d('0x63')]:null;var _0x435a77=[];return Promise[_0xf70d('0x102')]()[_0xf70d('0x17')](function(){if(!_0x24b1d2)throw new APIBadRequestError(_0xf70d('0x112'));})[_0xf70d('0x17')](function(){return db[_0xf70d('0x3e')][_0xf70d('0x9b')]({'where':{'id':_0x325ce8}});})['then'](function(_0x29c4ee){if(!_0x29c4ee)throw new APINotFoundError(util['format'](_0xf70d('0x110'),_0x229644[_0xf70d('0x53')]['id']));return db['sequelize'][_0xf70d('0x113')](function(_0x3b6339){return _0x29c4ee[_0xf70d('0x114')](_0x24b1d2,{'transaction':_0x3b6339})[_0xf70d('0x17')](function(){return db[_0xf70d('0x115')][_0xf70d('0x8f')]({'where':{'id':{'$in':_0x24b1d2}}});})[_0xf70d('0x17')](function(_0x1c08ce){var _0x433e18=_[_0xf70d('0x35')](_0x1c08ce,function(_0x8ca4f3){return _0x8ca4f3[_0xf70d('0x116')]();});return Promise[_0xf70d('0x5f')](_0x433e18);})[_0xf70d('0x17')](function(_0x145d80){_0x435a77=_[_0xf70d('0x117')](_0x145d80);var _0x522a25=_[_0xf70d('0x35')](_0x435a77,function(_0x51c081){return _0x51c081[_0xf70d('0x118')](_0x29c4ee['id'],{'transaction':_0x3b6339});});return Promise[_0xf70d('0x5f')](_0x522a25);})[_0xf70d('0x17')](function(){if(!_0x29c4ee[_0xf70d('0xa3')])return;var _0x123fc7=_[_0xf70d('0x34')](_0x435a77,function(_0x51887a){return _0x51887a['getDataValue'](_0xf70d('0xa2'))===_0xf70d('0x119');});var _0x96eaa5=_[_0xf70d('0x35')](_0x123fc7,function(_0x33da31){return db[_0xf70d('0xb6')][_0xf70d('0xb1')]({'membername':_0x29c4ee['name'],'UserId':_0x29c4ee['id'],'queue_name':_0x33da31[_0xf70d('0x39')],'VoiceQueueId':_0x33da31['id'],'interface':_['isNil'](_0x29c4ee[_0xf70d('0xa5')])?util[_0xf70d('0xaf')]('SIP/%s',_0x29c4ee[_0xf70d('0x39')]):_0x29c4ee['interface'],'paused':_0x29c4ee['voicePause']||![],'penalty':_0x29c4ee[_0xf70d('0xa9')]},{'transaction':_0x3b6339});});return Promise[_0xf70d('0x5f')](_0x96eaa5);})[_0xf70d('0x17')](function(){return db['TeamVoicePrefix']['findAll']({'where':{'teamId':{'$in':_0x24b1d2}}});})['then'](function(_0x440b66){var _0x4f12e7=_[_0xf70d('0x35')](_0x440b66,function(_0x3936cf){return db[_0xf70d('0x11a')][_0xf70d('0x88')]({'UserId':_0x29c4ee['id'],'VoicePrefixId':_0x3936cf[_0xf70d('0x11b')]},{'transaction':_0x3b6339});});return Promise['all'](_0x4f12e7);});});})['then'](function(){for(var _0x6d19e2=0x0;_0x6d19e2<_0x435a77['length'];_0x6d19e2++){var _0x15d42e=_0x435a77[_0x6d19e2][_0xf70d('0x11c')]('channel');var _0x22e6fc=_0x15d42e+_0xf70d('0xab');socket[_0xf70d('0x2b')](_0xf70d('0x30')+_0x15d42e+_0xf70d('0xad'),{'UserId':_0x325ce8,['queueField']:_0x435a77[_0x6d19e2]['id']});}})[_0xf70d('0x17')](respondWithStatusCode(_0x568bfb,null))[_0xf70d('0x1f')](APIHandleError(_0x568bfb));};exports[_0xf70d('0x11d')]=function(_0x194c04,_0x9ffec1){var _0x34012f=_0x194c04[_0xf70d('0x53')]['id'];var _0x5c5b65=null;if(_0x194c04[_0xf70d('0x44')][_0xf70d('0x63')]){_0x5c5b65=_[_0xf70d('0xb4')](_0x194c04[_0xf70d('0x44')][_0xf70d('0x63')])?_0x194c04['query'][_0xf70d('0x63')]:[_0x194c04[_0xf70d('0x44')]['ids']];}var _0x113002=[];return Promise[_0xf70d('0x102')]()['then'](function(){if(!_0x5c5b65)throw new APIBadRequestError(_0xf70d('0x11e'));})[_0xf70d('0x17')](function(){return db['User'][_0xf70d('0x9b')]({'where':{'id':_0x34012f}});})[_0xf70d('0x17')](function(_0x1649aa){if(!_0x1649aa)throw new APINotFoundError(util[_0xf70d('0xaf')](_0xf70d('0x110'),_0x194c04[_0xf70d('0x53')]['id']));return db[_0xf70d('0x11f')][_0xf70d('0x113')](function(_0x5dabc5){return _0x1649aa[_0xf70d('0x11d')](_0x5c5b65,{'transaction':_0x5dabc5})[_0xf70d('0x17')](function(){return db['Team'][_0xf70d('0x8f')]({'where':{'id':{'$in':_0x5c5b65}}});})['then'](function(_0x1910d7){var _0x4df8de=_[_0xf70d('0x35')](_0x1910d7,function(_0x50423c){return _0x50423c[_0xf70d('0x116')]();});return Promise[_0xf70d('0x5f')](_0x4df8de);})['then'](function(_0x39e40b){_0x113002=_[_0xf70d('0x117')](_0x39e40b);var _0x3388f3=_[_0xf70d('0x35')](_0x113002,function(_0xa4bd3b){return _0xa4bd3b['removeAgent'](_0x1649aa['id'],{'transaction':_0x5dabc5});});return Promise[_0xf70d('0x5f')](_0x3388f3);})[_0xf70d('0x17')](function(){if(!_0x1649aa[_0xf70d('0xa3')])return;var _0x18537f=_[_0xf70d('0x34')](_0x113002,function(_0x3b7b37){return _0x3b7b37['getDataValue'](_0xf70d('0xa2'))===_0xf70d('0x119');});var _0x1dde2b=_[_0xf70d('0x35')](_0x18537f,function(_0x5b92ce){return db[_0xf70d('0xb6')][_0xf70d('0x3b')]({'where':{'VoiceQueueId':_0x5b92ce['id'],'UserId':_0x1649aa['id']},'transaction':_0x5dabc5});});return Promise[_0xf70d('0x5f')](_0x1dde2b);})[_0xf70d('0x17')](function(){return db[_0xf70d('0x120')][_0xf70d('0x8f')]({'where':{'teamId':{'$in':_0x5c5b65}}});})['then'](function(_0x46120d){var _0x2d8bff=_[_0xf70d('0x35')](_0x46120d,function(_0x160a96){return db[_0xf70d('0x11a')][_0xf70d('0x3b')]({'where':{'UserId':_0x1649aa['id'],'VoicePrefixId':_0x160a96['VoicePrefixId']}},{'transaction':_0x5dabc5});});return Promise['all'](_0x2d8bff);});});})['then'](function(){for(var _0x473f02=0x0;_0x473f02<_0x113002[_0xf70d('0x4b')];_0x473f02++){var _0x1eda0e=_0x113002[_0x473f02]['getDataValue']('channel');var _0x9a6d9d=_0x1eda0e+'QueueId';socket[_0xf70d('0x2b')]('user'+_0x1eda0e+_0xf70d('0xb5'),{'UserId':_0x34012f,['queueField']:_0x113002[_0x473f02]['id']});}})[_0xf70d('0x17')](respondWithStatusCode(_0x9ffec1,null))[_0xf70d('0x1f')](APIHandleError(_0x9ffec1));};exports[_0xf70d('0x121')]=function(_0x5dff9c,_0x4fbf93){var _0x4eea80={};var _0x13cbc8={};var _0x3f479f;var _0x37b33e;return db[_0xf70d('0x3e')][_0xf70d('0x9b')]({'where':{'id':_0x5dff9c[_0xf70d('0x53')]['id']}})[_0xf70d('0x17')](handleEntityNotFound(_0x4fbf93,null))['then'](function(_0x5d6014){if(_0x5d6014){_0x3f479f=_0x5d6014;_0x13cbc8['model']=_[_0xf70d('0x54')](db[_0xf70d('0xd3')][_0xf70d('0x3f')]);_0x13cbc8['query']=_[_0xf70d('0x54')](_0x5dff9c[_0xf70d('0x44')]);_0x13cbc8[_0xf70d('0x56')]=_[_0xf70d('0x57')](_0x13cbc8['model'],_0x13cbc8[_0xf70d('0x44')]);_0x4eea80[_0xf70d('0x59')]=_[_0xf70d('0x57')](_0x13cbc8[_0xf70d('0x58')],qs[_0xf70d('0x5a')](_0x5dff9c[_0xf70d('0x44')]['fields']));_0x4eea80['attributes']=_0x4eea80[_0xf70d('0x59')]['length']?_0x4eea80[_0xf70d('0x59')]:_0x13cbc8[_0xf70d('0x58')];_0x4eea80['order']=qs['sort'](_0x5dff9c[_0xf70d('0x44')]['sort']);_0x4eea80[_0xf70d('0x43')]=qs[_0xf70d('0x56')](_[_0xf70d('0xcf')](_0x5dff9c[_0xf70d('0x44')],_0x13cbc8[_0xf70d('0x56')]));if(_0x5dff9c['query']['filter']){_0x4eea80[_0xf70d('0x43')]=_[_0xf70d('0x5b')](_0x4eea80[_0xf70d('0x43')],{'$or':_[_0xf70d('0x35')](_0x4eea80[_0xf70d('0x59')],function(_0x372864){var _0xf398c4={};_0xf398c4[_0x372864]={'$like':'%'+_0x5dff9c[_0xf70d('0x44')][_0xf70d('0x34')]+'%'};return _0xf398c4;})});}_0x4eea80=_[_0xf70d('0x5b')]({},_0x4eea80,_0x5dff9c[_0xf70d('0xd0')]);return _0x3f479f['getLists'](_0x4eea80);}})['then'](function(_0x4ed674){if(_0x4ed674){_0x37b33e=_0x4ed674[_0xf70d('0x4b')];if(!_0x5dff9c['query']['hasOwnProperty'](_0xf70d('0xd8'))){_0x4eea80[_0xf70d('0x26')]=qs[_0xf70d('0x26')](_0x5dff9c[_0xf70d('0x44')]['limit']);_0x4eea80[_0xf70d('0x24')]=qs[_0xf70d('0x24')](_0x5dff9c[_0xf70d('0x44')][_0xf70d('0x24')]);}return _0x3f479f[_0xf70d('0x121')](_0x4eea80);}})['then'](function(_0x16a12a){if(_0x16a12a){return _0x16a12a?{'count':_0x37b33e,'rows':_0x16a12a}:null;}})[_0xf70d('0x17')](respondWithResult(_0x4fbf93,null))[_0xf70d('0x1f')](handleError(_0x4fbf93,null));};exports[_0xf70d('0x122')]=function(_0x4426c6,_0x311002){var _0x51d207={};var _0x1e1d0a={};var _0x13c6d6;return db[_0xf70d('0x3e')][_0xf70d('0x9b')]({'where':{'id':_0x4426c6['params']['id']}})[_0xf70d('0x17')](handleEntityNotFound(_0x311002,null))['then'](function(_0x4a546c){if(_0x4a546c){_0x13c6d6=_0x4a546c;_0x1e1d0a[_0xf70d('0x58')]=_['keys'](db['User'][_0xf70d('0x3f')]);_0x1e1d0a[_0xf70d('0x44')]=_[_0xf70d('0x54')](_0x4426c6['query']);_0x1e1d0a[_0xf70d('0x56')]=_[_0xf70d('0x57')](_0x1e1d0a[_0xf70d('0x58')],_0x1e1d0a[_0xf70d('0x44')]);_0x51d207[_0xf70d('0x59')]=_[_0xf70d('0x57')](_0x1e1d0a[_0xf70d('0x58')],qs[_0xf70d('0x5a')](_0x4426c6['query'][_0xf70d('0x5a')]));_0x51d207[_0xf70d('0x59')]=_0x51d207[_0xf70d('0x59')]['length']?_0x51d207[_0xf70d('0x59')]:_0x1e1d0a['model'];_0x51d207[_0xf70d('0xcd')]=qs[_0xf70d('0xce')](_0x4426c6[_0xf70d('0x44')]['sort']);_0x51d207[_0xf70d('0x43')]=qs[_0xf70d('0x56')](_[_0xf70d('0xcf')](_0x4426c6[_0xf70d('0x44')],_0x1e1d0a[_0xf70d('0x56')]));if(_0x4426c6[_0xf70d('0x44')][_0xf70d('0x34')]){_0x51d207[_0xf70d('0x43')]=_[_0xf70d('0x5b')](_0x51d207['where'],{'$or':_[_0xf70d('0x35')](_0x51d207[_0xf70d('0x59')],function(_0x2bff11){var _0x5f2c4b={};_0x5f2c4b[_0x2bff11]={'$like':'%'+_0x4426c6['query'][_0xf70d('0x34')]+'%'};return _0x5f2c4b;})});}_0x51d207[_0xf70d('0x58')]=db[_0xf70d('0x3e')];_0x51d207['as']=_0xf70d('0x31');_0x51d207=_[_0xf70d('0x5b')]({},_0x51d207,_0x4426c6[_0xf70d('0xd0')]);return _0x13c6d6[_0xf70d('0xf8')]({'include':[_0x51d207]});}})[_0xf70d('0x17')](function(_0x47b3bf){if(_0x47b3bf){var _0x3afd92={},_0x3d4cc6=[];for(var _0x2229fd=0x0;_0x2229fd<_0x47b3bf[_0xf70d('0x4b')];_0x2229fd+=0x1){for(var _0x5076dd=0x0,_0x1d3899;_0x5076dd<_0x47b3bf[_0x2229fd][_0xf70d('0x31')][_0xf70d('0x4b')];_0x5076dd+=0x1){_0x1d3899=_0x47b3bf[_0x2229fd][_0xf70d('0x31')][_0x5076dd][_0xf70d('0x2c')]({'plain':!![]});_0x3afd92[_0x1d3899['id']]=_0x1d3899;}}_0x3afd92=_[_0xf70d('0x123')](_0x3afd92);for(var _0x14c74b=qs[_0xf70d('0x24')](_0x4426c6[_0xf70d('0x44')]['offset']);_0x14c74b<_0x3afd92[_0xf70d('0x4b')]&&_0x3d4cc6[_0xf70d('0x4b')]=_0x14c9f6[_0x398c('0x4d')]){throw new Error(_0x398c('0x4e'));}})[_0x398c('0x15')](function(){if(_0x431fa5){return db[_0x398c('0x42')]['destroy']({'where':{'membername':_0x431fa5['name']},'individualHooks':!![]});}})[_0x398c('0x15')](function(){if(_0x431fa5){return _0x431fa5[_0x398c('0x4f')]({'raw':!![]});}})['then'](function(_0x533c9f){if(_0x431fa5){if(_0x533c9f){var _0x55035e=[];_0x1153ad=_0x533c9f;if(_0x1153ad['length']){for(var _0x39c6e9=0x0;_0x39c6e9<_0x1153ad['length'];_0x39c6e9++){_0x55035e[_0x398c('0x28')](db[_0x398c('0x42')][_0x398c('0x50')]({'membername':_0x431fa5[_0x398c('0x1f')],'UserId':_0x431fa5['id'],'queue_name':_0x1153ad[_0x39c6e9]['name'],'VoiceQueueId':_0x1153ad[_0x39c6e9]['id'],'interface':_0x3df64d,'paused':_0x431fa5['loginInPause']||![],'penalty':_0x1153ad[_0x39c6e9][_0x398c('0x51')]||0x0}));}return BPromise[_0x398c('0x44')](_0x55035e);}}}})[_0x398c('0x15')](function(){if(_0x431fa5){return db['MemberReport'][_0x398c('0xd')]({'where':{'membername':_0x431fa5[_0x398c('0x1f')],'exitAt':null}});}})['then'](function(_0x25efdb){if(_0x431fa5){if(_0x25efdb&&_0x25efdb[_0x398c('0x23')]){var _0x547a7b=[];_0x25efdb[_0x398c('0x27')](function(_0x4af760){_0x547a7b['push'](_0x4af760[_0x398c('0x31')]({'exitAt':moment()[_0x398c('0x24')](_0x398c('0x25'))}));});return BPromise['all'](_0x547a7b);}}})['then'](function(){if(_0x431fa5){var _0x553a0b=[];var _0x3b70e9=[];var _0x36c957=utils['getChannels']();var _0x1c89e5={'membername':_0x431fa5[_0x398c('0x1f')],'interface':_0x3df64d,'enterAt':moment()[_0x398c('0x24')](_0x398c('0x25')),'role':_0x431fa5[_0x398c('0x2d')],'internal':_0x431fa5[_0x398c('0x20')]};_0x36c957[_0x398c('0x27')](function(_0x42fe42){_0x553a0b[_0x398c('0x28')](_['merge']({'channel':_0x42fe42,'type':_0x398c('0x52'),'data1':_0x398c('0x53'),'data2':_0x3df64d},_0x1c89e5));if(_0x431fa5[_0x398c('0x48')]){_0x3b70e9[_0x398c('0x28')](_['merge']({'channel':_0x42fe42,'type':_0x398c('0x22'),'data1':'LOGININPAUSE'},_0x1c89e5));}});return db[_0x398c('0x2f')]['bulkCreate'](_0x553a0b[_0x398c('0x54')](_0x3b70e9),{'individualHooks':!![]});}})[_0x398c('0x15')](function(){if(_0x431fa5){return _0x431fa5[_0x398c('0x31')]({'online':!![],'lastLoginAt':moment()[_0x398c('0x24')](_0x398c('0x25')),'voicePause':_0x431fa5[_0x398c('0x48')]||![],'mailPause':_0x431fa5['loginInPause']||![],'chatPause':_0x431fa5[_0x398c('0x48')]||![],'faxPause':_0x431fa5['loginInPause']||![],'smsPause':_0x431fa5['loginInPause']||![],'openchannelPause':_0x431fa5['loginInPause']||![],'pauseType':_0x431fa5[_0x398c('0x48')]?_0x398c('0x55'):null,'lastPauseAt':moment()[_0x398c('0x24')](_0x398c('0x25')),'interface':_0x3df64d});}})[_0x398c('0x15')](function(_0x483588){_0x132fc7(_0x483588);})['catch'](function(_0x2cc905){_0x182f6d(_0x57f027['error'](0x1f4,_0x2cc905[_0x398c('0x19')]));});});}; \ No newline at end of file +var _0xb2c5=['ShowUser','PauseUser','role','internal','interface','UserVoiceQueueRt','update','MemberReport','name','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','forEach','SIP/%s','DEFAULT\x20PAUSE','body','uniqueid','bulkCreate','type','UnpauseUser','channel','isValidChannel','online','voicePause','mailPause','chatPause','openchannelPause','smsPause','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','params','unpause','system','LogoutUser','findOne','destroy','all','LoginUser','mobile','phone','loginInPause','count','../../config/license/util','getLicense','agents','getVoiceQueues','push','upsert','merge','LOGIN','LOGININPAUSE','concat','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','redis','defaults','localhost','socket.io-emitter','register','GetUser','findAll','options','where','attributes','limit','include','model','map','info','debug','stringify','catch','message','error','User','find','raw','then'];(function(_0x152220,_0x38a858){var _0xcb20e2=function(_0x49cfdc){while(--_0x49cfdc){_0x152220['push'](_0x152220['shift']());}};_0xcb20e2(++_0x38a858);}(_0xb2c5,0x89));var _0x5b2c=function(_0x38550,_0x1e36a6){_0x38550=_0x38550-0x0;var _0x556e2c=_0xb2c5[_0x38550];return _0x556e2c;};'use strict';var _=require(_0x5b2c('0x0'));var util=require(_0x5b2c('0x1'));var moment=require(_0x5b2c('0x2'));var BPromise=require(_0x5b2c('0x3'));var Redis=require(_0x5b2c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5b2c('0x5'));var logger=require('../../config/logger')(_0x5b2c('0x6'));var config=require('../../config/environment');config[_0x5b2c('0x7')]=_[_0x5b2c('0x8')](config[_0x5b2c('0x7')],{'host':_0x5b2c('0x9'),'port':0x18eb});var socket=require(_0x5b2c('0xa'))(new Redis(config[_0x5b2c('0x7')]));require('./user.socket')[_0x5b2c('0xb')](socket);exports[_0x5b2c('0xc')]=function(_0xed2ca){var _0x240b74=this;return new Promise(function(_0x40e652,_0x14b40a){return db['User'][_0x5b2c('0xd')]({'raw':_0xed2ca[_0x5b2c('0xe')]?_0xed2ca[_0x5b2c('0xe')]['raw']===undefined?!![]:![]:!![],'where':_0xed2ca[_0x5b2c('0xe')]?_0xed2ca[_0x5b2c('0xe')][_0x5b2c('0xf')]||null:null,'attributes':_0xed2ca[_0x5b2c('0xe')]?_0xed2ca[_0x5b2c('0xe')][_0x5b2c('0x10')]||null:null,'limit':_0xed2ca[_0x5b2c('0xe')]?_0xed2ca['options'][_0x5b2c('0x11')]||null:null,'include':_0xed2ca[_0x5b2c('0xe')]?_0xed2ca[_0x5b2c('0xe')][_0x5b2c('0x12')]?_['map'](_0xed2ca[_0x5b2c('0xe')][_0x5b2c('0x12')],function(_0x16b378){return{'model':db[_0x16b378[_0x5b2c('0x13')]],'as':_0x16b378['as'],'attributes':_0x16b378[_0x5b2c('0x10')],'include':_0x16b378[_0x5b2c('0x12')]?_['map'](_0x16b378[_0x5b2c('0x12')],function(_0x1a0492){return{'model':db[_0x1a0492[_0x5b2c('0x13')]],'as':_0x1a0492['as'],'attributes':_0x1a0492[_0x5b2c('0x10')],'include':_0x1a0492[_0x5b2c('0x12')]?_[_0x5b2c('0x14')](_0x1a0492[_0x5b2c('0x12')],function(_0x31dfc7){return{'model':db[_0x31dfc7[_0x5b2c('0x13')]],'as':_0x31dfc7['as'],'attributes':_0x31dfc7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1413e2){logger[_0x5b2c('0x15')](_0x5b2c('0xc'),_0xed2ca);logger[_0x5b2c('0x16')](_0x5b2c('0xc'),_0xed2ca,JSON[_0x5b2c('0x17')](_0x1413e2));_0x40e652(_0x1413e2);})[_0x5b2c('0x18')](function(_0x1bccc4){logger['error']('GetUser',_0x1bccc4[_0x5b2c('0x19')],_0xed2ca);_0x14b40a(_0x240b74[_0x5b2c('0x1a')](0x1f4,_0x1bccc4[_0x5b2c('0x19')]));});});};exports['ShowUser']=function(_0x1ca083){var _0x5bc825=this;return new Promise(function(_0x783fe,_0x459764){return db[_0x5b2c('0x1b')][_0x5b2c('0x1c')]({'raw':_0x1ca083['options']?_0x1ca083['options'][_0x5b2c('0x1d')]===undefined?!![]:![]:!![],'where':_0x1ca083['options']?_0x1ca083[_0x5b2c('0xe')][_0x5b2c('0xf')]||null:null,'attributes':_0x1ca083['options']?_0x1ca083[_0x5b2c('0xe')][_0x5b2c('0x10')]||null:null,'include':_0x1ca083['options']?_0x1ca083[_0x5b2c('0xe')][_0x5b2c('0x12')]?_[_0x5b2c('0x14')](_0x1ca083[_0x5b2c('0xe')][_0x5b2c('0x12')],function(_0x371738){return{'model':db[_0x371738['model']],'as':_0x371738['as'],'attributes':_0x371738[_0x5b2c('0x10')],'include':_0x371738['include']?_[_0x5b2c('0x14')](_0x371738[_0x5b2c('0x12')],function(_0xa52dd1){return{'model':db[_0xa52dd1['model']],'as':_0xa52dd1['as'],'attributes':_0xa52dd1['attributes'],'include':_0xa52dd1[_0x5b2c('0x12')]?_[_0x5b2c('0x14')](_0xa52dd1['include'],function(_0x2cfb37){return{'model':db[_0x2cfb37[_0x5b2c('0x13')]],'as':_0x2cfb37['as'],'attributes':_0x2cfb37['attributes']};}):[]};}):[]};}):[]:[]})[_0x5b2c('0x1e')](function(_0x111553){logger[_0x5b2c('0x15')](_0x5b2c('0x1f'),_0x1ca083);logger[_0x5b2c('0x16')](_0x5b2c('0x1f'),_0x1ca083,JSON[_0x5b2c('0x17')](_0x111553));_0x783fe(_0x111553);})['catch'](function(_0x4b03ad){logger[_0x5b2c('0x1a')](_0x5b2c('0x1f'),_0x4b03ad['message'],_0x1ca083);_0x459764(_0x5bc825['error'](0x1f4,_0x4b03ad[_0x5b2c('0x19')]));});});};exports[_0x5b2c('0x20')]=function(_0x482c88){var _0x4442b7=this;return new Promise(function(_0x233c53,_0x5d3a6b){var _0x2d1126;return db[_0x5b2c('0x1b')][_0x5b2c('0x1c')]({'where':_0x482c88['options'][_0x5b2c('0xf')]||{},'attributes':['id','name',_0x5b2c('0x21'),_0x5b2c('0x22'),_0x5b2c('0x23')]})[_0x5b2c('0x1e')](function(_0x1dc09b){if(_0x1dc09b){_0x2d1126=_0x1dc09b;return db[_0x5b2c('0x24')][_0x5b2c('0x25')]({'paused':0x1},{'where':{'UserId':_0x2d1126['id']},'individualHooks':!![]});}})[_0x5b2c('0x1e')](function(){if(_0x2d1126){return db[_0x5b2c('0x26')][_0x5b2c('0xd')]({'where':{'membername':_0x2d1126[_0x5b2c('0x27')],'type':_0x5b2c('0x28'),'exitAt':null}});}})[_0x5b2c('0x1e')](function(_0x2eff09){if(_0x2d1126){if(_0x2eff09&&_0x2eff09[_0x5b2c('0x29')]){var _0x4f9976=moment()[_0x5b2c('0x2a')](_0x5b2c('0x2b'));for(var _0x217c95=0x0,_0x190d6e=_0x2eff09[_0x5b2c('0x29')];_0x217c95<_0x190d6e;_0x217c95++){_0x2eff09[_0x217c95]['updateAttributes']({'exitAt':_0x4f9976});}}}})[_0x5b2c('0x1e')](function(){if(_0x2d1126){var _0x41af3c=[];var _0x33b6cb=utils['getChannels']();_0x33b6cb[_0x5b2c('0x2c')](function(_0x13914c){_0x41af3c['push']({'channel':_0x13914c,'membername':_0x2d1126[_0x5b2c('0x27')],'interface':_['isNil'](_0x2d1126[_0x5b2c('0x23')])?util[_0x5b2c('0x2a')](_0x5b2c('0x2d'),_0x2d1126[_0x5b2c('0x27')]):_0x2d1126['interface'],'type':'PAUSE','enterAt':moment()[_0x5b2c('0x2a')](_0x5b2c('0x2b')),'data1':_0x482c88['body']['type']||_0x5b2c('0x2e'),'role':_0x2d1126['role'],'internal':_0x2d1126[_0x5b2c('0x22')],'uniqueid':_0x482c88[_0x5b2c('0x2f')][_0x5b2c('0x30')]||null});});return db[_0x5b2c('0x26')][_0x5b2c('0x31')](_0x41af3c,{'individualHooks':!![]});}})[_0x5b2c('0x1e')](function(){if(_0x2d1126){return _0x2d1126[_0x5b2c('0x25')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x482c88['body'][_0x5b2c('0x32')]||_0x5b2c('0x2e'),'lastPauseAt':moment()['format'](_0x5b2c('0x2b'))});}})[_0x5b2c('0x1e')](function(_0x2cea0e){_0x233c53(_0x2cea0e);})[_0x5b2c('0x18')](function(_0x4af80f){_0x5d3a6b(_0x4442b7[_0x5b2c('0x1a')](0x1f4,_0x4af80f[_0x5b2c('0x19')]));});});};exports[_0x5b2c('0x33')]=function(_0x190407){var _0x29c531=this;return new Promise(function(_0x2df98a,_0x3c9e6c){if(_0x190407[_0x5b2c('0x2f')][_0x5b2c('0x34')]&&!utils[_0x5b2c('0x35')](_0x190407[_0x5b2c('0x2f')][_0x5b2c('0x34')])){throw new Error(util[_0x5b2c('0x2a')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x190407[_0x5b2c('0x2f')][_0x5b2c('0x34')]));}return db[_0x5b2c('0x1b')]['findOne']({'where':_0x190407[_0x5b2c('0xe')][_0x5b2c('0xf')]||{},'attributes':['id',_0x5b2c('0x27'),'role','internal',_0x5b2c('0x23'),_0x5b2c('0x36'),_0x5b2c('0x37'),_0x5b2c('0x38'),_0x5b2c('0x39'),'faxPause',_0x5b2c('0x3a'),_0x5b2c('0x3b'),'whatsappPause','pauseType',_0x5b2c('0x3c')]})['then'](function(_0x208555){if(!_0x208555){throw new Error(util['format'](_0x5b2c('0x3d'),_0x190407[_0x5b2c('0x3e')]['id']));}return _0x208555[_0x5b2c('0x3f')](_0x190407['body'][_0x5b2c('0x34')],_0x5b2c('0x40'));})[_0x5b2c('0x1e')](function(_0x4f573a){_0x2df98a(_0x4f573a);})[_0x5b2c('0x18')](function(_0x5d0e51){_0x3c9e6c(_0x29c531[_0x5b2c('0x1a')](0x1f4,_0x5d0e51[_0x5b2c('0x19')]));});});};exports[_0x5b2c('0x41')]=function(_0x4d3ecf){var _0x494c47=this;return new Promise(function(_0x725e8f,_0x34744f){var _0x12fa5c;return db[_0x5b2c('0x1b')][_0x5b2c('0x42')]({'where':_0x4d3ecf[_0x5b2c('0xe')][_0x5b2c('0xf')]||{},'attributes':['id',_0x5b2c('0x27')]})[_0x5b2c('0x1e')](function(_0x45316c){if(_0x45316c){_0x12fa5c=_0x45316c;return db[_0x5b2c('0x24')][_0x5b2c('0x43')]({'where':{'membername':_0x12fa5c['name']},'individualHooks':!![]});}})['then'](function(){if(_0x12fa5c){return db[_0x5b2c('0x26')][_0x5b2c('0xd')]({'where':{'membername':_0x12fa5c[_0x5b2c('0x27')],'exitAt':null}});}})[_0x5b2c('0x1e')](function(_0x1333af){if(_0x12fa5c){if(_0x1333af&&_0x1333af['length']){var _0x1c5484=[];_0x1333af[_0x5b2c('0x2c')](function(_0x14ab80){_0x1c5484['push'](_0x14ab80[_0x5b2c('0x25')]({'exitAt':moment()[_0x5b2c('0x2a')](_0x5b2c('0x2b'))}));});return BPromise[_0x5b2c('0x44')](_0x1c5484);}}})[_0x5b2c('0x1e')](function(){if(_0x12fa5c){return _0x12fa5c[_0x5b2c('0x25')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x5b2c('0x1e')](function(_0x1e53da){_0x725e8f(_0x1e53da);})[_0x5b2c('0x18')](function(_0x2e29ca){_0x34744f(_0x494c47[_0x5b2c('0x1a')](0x1f4,_0x2e29ca[_0x5b2c('0x19')]));});});};exports[_0x5b2c('0x45')]=function(_0x2270fa){var _0x32a811=this;return new Promise(function(_0x485ee9,_0x5c4605){var _0x5b6d18;var _0x1a42aa;var _0x3c3422;var _0x132c36;return db[_0x5b2c('0x1b')][_0x5b2c('0x42')]({'where':_0x2270fa[_0x5b2c('0xe')]['where']||{},'attributes':['id',_0x5b2c('0x27'),'role',_0x5b2c('0x46'),_0x5b2c('0x47'),'internal',_0x5b2c('0x48'),_0x5b2c('0x23')]})['then'](function(_0x4d479a){if(_0x4d479a){_0x5b6d18=_0x4d479a;_0x132c36=_0x2270fa[_0x5b2c('0x2f')]['interface']?_0x2270fa[_0x5b2c('0x2f')][_0x5b2c('0x23')]:util[_0x5b2c('0x2a')]('SIP/%s',_0x5b6d18[_0x5b2c('0x27')]);return db[_0x5b2c('0x1b')][_0x5b2c('0x49')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x5b6d18['id']}}});}})['then'](function(_0x345d1c){if(_0x345d1c){_0x3c3422=_0x345d1c;return require(_0x5b2c('0x4a'))[_0x5b2c('0x4b')]();}})['then'](function(_0x4906c3){if(_0x4906c3&&_0x4906c3['agents']&&_0x3c3422>=_0x4906c3[_0x5b2c('0x4c')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x5b2c('0x1e')](function(){if(_0x5b6d18){return db[_0x5b2c('0x24')][_0x5b2c('0x43')]({'where':{'membername':_0x5b6d18[_0x5b2c('0x27')]},'individualHooks':!![]});}})['then'](function(){if(_0x5b6d18){return _0x5b6d18[_0x5b2c('0x4d')]({'raw':!![]});}})[_0x5b2c('0x1e')](function(_0x4e809b){if(_0x5b6d18){if(_0x4e809b){var _0x477c0d=[];_0x1a42aa=_0x4e809b;if(_0x1a42aa[_0x5b2c('0x29')]){for(var _0x104718=0x0;_0x104718<_0x1a42aa[_0x5b2c('0x29')];_0x104718++){_0x477c0d[_0x5b2c('0x4e')](db[_0x5b2c('0x24')][_0x5b2c('0x4f')]({'membername':_0x5b6d18['name'],'UserId':_0x5b6d18['id'],'queue_name':_0x1a42aa[_0x104718][_0x5b2c('0x27')],'VoiceQueueId':_0x1a42aa[_0x104718]['id'],'interface':_0x132c36,'paused':_0x5b6d18[_0x5b2c('0x48')]||![],'penalty':_0x1a42aa[_0x104718]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x5b2c('0x44')](_0x477c0d);}}}})['then'](function(){if(_0x5b6d18){return db['MemberReport'][_0x5b2c('0xd')]({'where':{'membername':_0x5b6d18[_0x5b2c('0x27')],'exitAt':null}});}})[_0x5b2c('0x1e')](function(_0xeb487a){if(_0x5b6d18){if(_0xeb487a&&_0xeb487a[_0x5b2c('0x29')]){var _0x50b756=[];_0xeb487a['forEach'](function(_0x5e2544){_0x50b756[_0x5b2c('0x4e')](_0x5e2544[_0x5b2c('0x25')]({'exitAt':moment()[_0x5b2c('0x2a')](_0x5b2c('0x2b'))}));});return BPromise['all'](_0x50b756);}}})['then'](function(){if(_0x5b6d18){var _0x2e66ce=[];var _0x47ce6a=[];var _0x484c04=utils['getChannels']();var _0x4d7c5d={'membername':_0x5b6d18[_0x5b2c('0x27')],'interface':_0x132c36,'enterAt':moment()[_0x5b2c('0x2a')](_0x5b2c('0x2b')),'role':_0x5b6d18['role'],'internal':_0x5b6d18['internal']};_0x484c04[_0x5b2c('0x2c')](function(_0x2fcc5f){_0x2e66ce[_0x5b2c('0x4e')](_[_0x5b2c('0x50')]({'channel':_0x2fcc5f,'type':_0x5b2c('0x51'),'data1':'callysquare','data2':_0x132c36},_0x4d7c5d));if(_0x5b6d18[_0x5b2c('0x48')]){_0x47ce6a[_0x5b2c('0x4e')](_[_0x5b2c('0x50')]({'channel':_0x2fcc5f,'type':_0x5b2c('0x28'),'data1':_0x5b2c('0x52')},_0x4d7c5d));}});return db[_0x5b2c('0x26')]['bulkCreate'](_0x2e66ce[_0x5b2c('0x53')](_0x47ce6a),{'individualHooks':!![]});}})['then'](function(){if(_0x5b6d18){return _0x5b6d18[_0x5b2c('0x25')]({'online':!![],'lastLoginAt':moment()[_0x5b2c('0x2a')](_0x5b2c('0x2b')),'voicePause':_0x5b6d18[_0x5b2c('0x48')]||![],'mailPause':_0x5b6d18[_0x5b2c('0x48')]||![],'chatPause':_0x5b6d18[_0x5b2c('0x48')]||![],'faxPause':_0x5b6d18[_0x5b2c('0x48')]||![],'smsPause':_0x5b6d18[_0x5b2c('0x48')]||![],'openchannelPause':_0x5b6d18[_0x5b2c('0x48')]||![],'pauseType':_0x5b6d18[_0x5b2c('0x48')]?_0x5b2c('0x52'):null,'lastPauseAt':moment()[_0x5b2c('0x2a')](_0x5b2c('0x2b')),'interface':_0x132c36});}})[_0x5b2c('0x1e')](function(_0x117451){_0x485ee9(_0x117451);})[_0x5b2c('0x18')](function(_0x8725d8){_0x5c4605(_0x32a811[_0x5b2c('0x1a')](0x1f4,_0x8725d8['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 57e8a50..f9732ff 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 _0x62c7=['save','remove','update','emit','register','length','user:','./user.events'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x62c7,0xbf));var _0x762c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x62c7[_0x321bb2];return _0x9c12ed;};'use strict';var UserEvents=require(_0x762c('0x0'));var events=[_0x762c('0x1'),_0x762c('0x2'),_0x762c('0x3')];function createListener(_0x23d80f,_0x2aaa26){return function(_0x498cfb){_0x2aaa26[_0x762c('0x4')](_0x23d80f,_0x498cfb);};}function removeListener(_0x3f8f12,_0x563d81){return function(){UserEvents['removeListener'](_0x3f8f12,_0x563d81);};}exports[_0x762c('0x5')]=function(_0x57f634){for(var _0x137f2b=0x0,_0x261c27=events[_0x762c('0x6')];_0x137f2b<_0x261c27;_0x137f2b++){var _0x55ed9e=events[_0x137f2b];var _0x413894=createListener(_0x762c('0x7')+_0x55ed9e,_0x57f634);UserEvents['on'](_0x55ed9e,_0x413894);}}; \ No newline at end of file +var _0x7ebd=['user:','./user.events','remove','update','length'];(function(_0x874cf1,_0x2a4954){var _0x233579=function(_0xa6e939){while(--_0xa6e939){_0x874cf1['push'](_0x874cf1['shift']());}};_0x233579(++_0x2a4954);}(_0x7ebd,0xd8));var _0xd7eb=function(_0x952a2f,_0x50f186){_0x952a2f=_0x952a2f-0x0;var _0x4d1add=_0x7ebd[_0x952a2f];return _0x4d1add;};'use strict';var UserEvents=require(_0xd7eb('0x0'));var events=['save',_0xd7eb('0x1'),_0xd7eb('0x2')];function createListener(_0x1db6a7,_0x5b079d){return function(_0x27d03f){_0x5b079d['emit'](_0x1db6a7,_0x27d03f);};}function removeListener(_0x407b9d,_0x3a491d){return function(){UserEvents['removeListener'](_0x407b9d,_0x3a491d);};}exports['register']=function(_0x87faf6){for(var _0x5e4e1d=0x0,_0x178ade=events[_0xd7eb('0x3')];_0x5e4e1d<_0x178ade;_0x5e4e1d++){var _0x30e997=events[_0x5e4e1d];var _0x2efe69=createListener(_0xd7eb('0x4')+_0x30e997,_0x87faf6);UserEvents['on'](_0x30e997,_0x2efe69);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index f23242e..852fb06 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x500d3f,_0x3ba9b0){var _0x43c336=function(_0x59209b){while(--_0x59209b){_0x500d3f['push'](_0x500d3f['shift']());}};_0x43c336(++_0x3ba9b0);}(_0xedd9,0xfc));var _0x9edd=function(_0x29eccd,_0x2f190d){_0x29eccd=_0x29eccd-0x0;var _0x3b4972=_0xedd9[_0x29eccd];return _0x3b4972;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x371d2c,_0x52347e){var _0x109892=function(_0x36c169){while(--_0x36c169){_0x371d2c['push'](_0x371d2c['shift']());}};_0x109892(++_0x52347e);}(_0xe706,0xa3));var _0x6e70=function(_0x348fec,_0x486f87){_0x348fec=_0x348fec-0x0;var _0x5914c7=_0xe706[_0x348fec];return _0x5914c7;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index ffe6d25..32687f5 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 _0xdb73=['sequelize','exports','INTEGER'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xdb73,0xe7));var _0x3db7=function(_0x4227aa,_0xdfe07){_0x4227aa=_0x4227aa-0x0;var _0x450c2a=_0xdb73[_0x4227aa];return _0x450c2a;};'use strict';var Sequelize=require(_0x3db7('0x0'));module[_0x3db7('0x1')]={'penalty':{'type':Sequelize[_0x3db7('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa6c8=['INTEGER','exports'];(function(_0x12c9d8,_0x9b4624){var _0x25e985=function(_0x1de1de){while(--_0x1de1de){_0x12c9d8['push'](_0x12c9d8['shift']());}};_0x25e985(++_0x9b4624);}(_0xa6c8,0x1d7));var _0x8a6c=function(_0x306c17,_0x4e333d){_0x306c17=_0x306c17-0x0;var _0x33913f=_0xa6c8[_0x306c17];return _0x33913f;};'use strict';var Sequelize=require('sequelize');module[_0x8a6c('0x0')]={'penalty':{'type':Sequelize[_0x8a6c('0x1')],'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 7ce03d0..c4dcef4 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 _0x4316=['exports','define','user_has_chat_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes'];(function(_0x582d5a,_0x3b57c0){var _0x5625ef=function(_0x509d83){while(--_0x509d83){_0x582d5a['push'](_0x582d5a['shift']());}};_0x5625ef(++_0x3b57c0);}(_0x4316,0x189));var _0x6431=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4316[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x6431('0x0'));var util=require(_0x6431('0x1'));var logger=require(_0x6431('0x2'))(_0x6431('0x3'));var moment=require('moment');var BPromise=require(_0x6431('0x4'));var rp=require(_0x6431('0x5'));var fs=require('fs');var path=require(_0x6431('0x6'));var rimraf=require(_0x6431('0x7'));var config=require(_0x6431('0x8'));var attributes=require(_0x6431('0x9'));module[_0x6431('0xa')]=function(_0x1ab150,_0x290e27){return _0x1ab150[_0x6431('0xb')]('UserChatQueue',attributes,{'tableName':_0x6431('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf6a=['../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbf6a,0x1a6));var _0xabf6=function(_0x146a85,_0x529b52){_0x146a85=_0x146a85-0x0;var _0x1b59bf=_0xbf6a[_0x146a85];return _0x1b59bf;};'use strict';var _=require(_0xabf6('0x0'));var util=require('util');var logger=require(_0xabf6('0x1'))(_0xabf6('0x2'));var moment=require(_0xabf6('0x3'));var BPromise=require(_0xabf6('0x4'));var rp=require(_0xabf6('0x5'));var fs=require('fs');var path=require(_0xabf6('0x6'));var rimraf=require('rimraf');var config=require(_0xabf6('0x7'));var attributes=require(_0xabf6('0x8'));module[_0xabf6('0x9')]=function(_0x1e5d53,_0x344e1c){return _0x1e5d53[_0xabf6('0xa')](_0xabf6('0xb'),attributes,{'tableName':_0xabf6('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 cac3a05..013a019 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 _0x6315=['debug','stringify','error','code','message','info','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','UserChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x3de873,_0x174b5f){var _0x380b8c=function(_0x313dea){while(--_0x313dea){_0x3de873['push'](_0x3de873['shift']());}};_0x380b8c(++_0x174b5f);}(_0x6315,0x151));var _0x5631=function(_0x5cc143,_0x4aa9d7){_0x5cc143=_0x5cc143-0x0;var _0x2b7b88=_0x6315[_0x5cc143];return _0x2b7b88;};'use strict';var _=require(_0x5631('0x0'));var util=require('util');var moment=require(_0x5631('0x1'));var BPromise=require(_0x5631('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5631('0x3'));var db=require(_0x5631('0x4'))['db'];var utils=require(_0x5631('0x5'));var logger=require(_0x5631('0x6'))(_0x5631('0x7'));var config=require(_0x5631('0x8'));var jayson=require(_0x5631('0x9'));var client=jayson['client'][_0x5631('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58f870,_0x2bb3bd,_0x53df9b){return new BPromise(function(_0x2b4484,_0x33ff21){return client[_0x5631('0xb')](_0x58f870,_0x53df9b)[_0x5631('0xc')](function(_0x38e645){logger['info'](_0x5631('0xd'),_0x2bb3bd,_0x5631('0xe'));logger[_0x5631('0xf')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x2bb3bd,_0x5631('0xe'),JSON[_0x5631('0x10')](_0x38e645));if(_0x38e645['error']){if(_0x38e645[_0x5631('0x11')][_0x5631('0x12')]===0x1f4){logger[_0x5631('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x2bb3bd,_0x38e645['error'][_0x5631('0x13')]);return _0x33ff21(_0x38e645[_0x5631('0x11')]['message']);}logger[_0x5631('0x11')](_0x5631('0xd'),_0x2bb3bd,_0x38e645['error'][_0x5631('0x13')]);return _0x2b4484(_0x38e645[_0x5631('0x11')]['message']);}else{logger[_0x5631('0x14')](_0x5631('0xd'),_0x2bb3bd,'request\x20sent');_0x2b4484(_0x38e645[_0x5631('0x15')]['message']);}})['catch'](function(_0x3e6427){logger[_0x5631('0x11')](_0x5631('0xd'),_0x2bb3bd,_0x3e6427);_0x33ff21(_0x3e6427);});});} \ No newline at end of file +var _0x2510=['UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x148634,_0xb2a21c){var _0x4bf6ae=function(_0x46bc48){while(--_0x46bc48){_0x148634['push'](_0x148634['shift']());}};_0x4bf6ae(++_0xb2a21c);}(_0x2510,0x129));var _0x0251=function(_0x2b6eb3,_0x37ff56){_0x2b6eb3=_0x2b6eb3-0x0;var _0x1c42c2=_0x2510[_0x2b6eb3];return _0x1c42c2;};'use strict';var _=require(_0x0251('0x0'));var util=require(_0x0251('0x1'));var moment=require(_0x0251('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0251('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0251('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x0251('0x5'));var jayson=require(_0x0251('0x6'));var client=jayson[_0x0251('0x7')][_0x0251('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10b6f9,_0x113af3,_0x20cae7){return new BPromise(function(_0x828cd9,_0x5d440a){return client[_0x0251('0x9')](_0x10b6f9,_0x20cae7)[_0x0251('0xa')](function(_0x185ae2){logger['info'](_0x0251('0xb'),_0x113af3,_0x0251('0xc'));logger[_0x0251('0xd')](_0x0251('0xe'),_0x113af3,_0x0251('0xc'),JSON[_0x0251('0xf')](_0x185ae2));if(_0x185ae2[_0x0251('0x10')]){if(_0x185ae2['error'][_0x0251('0x11')]===0x1f4){logger[_0x0251('0x10')](_0x0251('0xb'),_0x113af3,_0x185ae2[_0x0251('0x10')][_0x0251('0x12')]);return _0x5d440a(_0x185ae2[_0x0251('0x10')][_0x0251('0x12')]);}logger[_0x0251('0x10')](_0x0251('0xb'),_0x113af3,_0x185ae2['error'][_0x0251('0x12')]);return _0x828cd9(_0x185ae2[_0x0251('0x10')][_0x0251('0x12')]);}else{logger[_0x0251('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x113af3,_0x0251('0xc'));_0x828cd9(_0x185ae2[_0x0251('0x14')][_0x0251('0x12')]);}})[_0x0251('0x15')](function(_0x258604){logger[_0x0251('0x10')](_0x0251('0xb'),_0x113af3,_0x258604);_0x5d440a(_0x258604);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index f02b74f..8a67d1c 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3ba652,_0x43ca01){var _0x95f28=function(_0x565db6){while(--_0x565db6){_0x3ba652['push'](_0x3ba652['shift']());}};_0x95f28(++_0x43ca01);}(_0xe706,0xa3));var _0x6e70=function(_0x34620e,_0x582015){_0x34620e=_0x34620e-0x0;var _0x3d33cd=_0xe706[_0x34620e];return _0x3d33cd;};'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(_0x163442,_0x313f1a){var _0x4c8475=function(_0x5b4c73){while(--_0x5b4c73){_0x163442['push'](_0x163442['shift']());}};_0x4c8475(++_0x313f1a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5280f4,_0x3c36d0){_0x5280f4=_0x5280f4-0x0;var _0xba93e7=_0xcb91[_0x5280f4];return _0xba93e7;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index a055c14..11041b6 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 _0x77bc=['INTEGER','STRING','exports'];(function(_0x515177,_0x117389){var _0x3f4baf=function(_0x5d91e3){while(--_0x5d91e3){_0x515177['push'](_0x515177['shift']());}};_0x3f4baf(++_0x117389);}(_0x77bc,0x176));var _0xc77b=function(_0x42c2a9,_0x339812){_0x42c2a9=_0x42c2a9-0x0;var _0x5c0640=_0x77bc[_0x42c2a9];return _0x5c0640;};'use strict';var Sequelize=require('sequelize');module[_0xc77b('0x0')]={'penalty':{'type':Sequelize[_0xc77b('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xc77b('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xc77b('0x2')]}}; \ No newline at end of file +var _0x3607=['sequelize','exports','STRING'];(function(_0x159877,_0x8c66e7){var _0x16ae6e=function(_0x55bcae){while(--_0x55bcae){_0x159877['push'](_0x159877['shift']());}};_0x16ae6e(++_0x8c66e7);}(_0x3607,0x1ec));var _0x7360=function(_0x12ef70,_0x39c22e){_0x12ef70=_0x12ef70-0x0;var _0x5925be=_0x3607[_0x12ef70];return _0x5925be;};'use strict';var Sequelize=require(_0x7360('0x0'));module[_0x7360('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x7360('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 9f5e994..075dfd9 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 _0xf586=['api','moment','bluebird','request-promise','path','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger'];(function(_0x38001c,_0x452469){var _0x4278a2=function(_0x5bd0f8){while(--_0x5bd0f8){_0x38001c['push'](_0x38001c['shift']());}};_0x4278a2(++_0x452469);}(_0xf586,0x169));var _0x6f58=function(_0x35d2d6,_0x14e944){_0x35d2d6=_0x35d2d6-0x0;var _0x1637d5=_0xf586[_0x35d2d6];return _0x1637d5;};'use strict';var _=require(_0x6f58('0x0'));var util=require(_0x6f58('0x1'));var logger=require(_0x6f58('0x2'))(_0x6f58('0x3'));var moment=require(_0x6f58('0x4'));var BPromise=require(_0x6f58('0x5'));var rp=require(_0x6f58('0x6'));var fs=require('fs');var path=require(_0x6f58('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6f58('0x8'));module[_0x6f58('0x9')]=function(_0x2c77cc,_0x1a6c4e){return _0x2c77cc[_0x6f58('0xa')](_0x6f58('0xb'),attributes,{'tableName':_0x6f58('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc72=['exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','moment','bluebird','request-promise','path','rimraf','./userFaxQueue.attributes'];(function(_0x3dab4d,_0x2a5813){var _0x2eec5e=function(_0x113428){while(--_0x113428){_0x3dab4d['push'](_0x3dab4d['shift']());}};_0x2eec5e(++_0x2a5813);}(_0xdc72,0x178));var _0x2dc7=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xdc72[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x2dc7('0x0'));var util=require(_0x2dc7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2dc7('0x2'));var BPromise=require(_0x2dc7('0x3'));var rp=require(_0x2dc7('0x4'));var fs=require('fs');var path=require(_0x2dc7('0x5'));var rimraf=require(_0x2dc7('0x6'));var config=require('../../config/environment');var attributes=require(_0x2dc7('0x7'));module[_0x2dc7('0x8')]=function(_0xd555f7,_0x27957b){return _0xd555f7[_0x2dc7('0x9')](_0x2dc7('0xa'),attributes,{'tableName':_0x2dc7('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 8748ecc..e3b7bfc 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 _0xac47=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','UserFaxQueue,\x20%s,\x20%s','result','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x3b3dee,_0x22280c){var _0x2676d6=function(_0x5cd354){while(--_0x5cd354){_0x3b3dee['push'](_0x3b3dee['shift']());}};_0x2676d6(++_0x22280c);}(_0xac47,0xed));var _0x7ac4=function(_0x305cb0,_0x124dbf){_0x305cb0=_0x305cb0-0x0;var _0x5b4133=_0xac47[_0x305cb0];return _0x5b4133;};'use strict';var _=require(_0x7ac4('0x0'));var util=require('util');var moment=require(_0x7ac4('0x1'));var BPromise=require(_0x7ac4('0x2'));var rs=require(_0x7ac4('0x3'));var fs=require('fs');var Redis=require(_0x7ac4('0x4'));var db=require(_0x7ac4('0x5'))['db'];var utils=require(_0x7ac4('0x6'));var logger=require(_0x7ac4('0x7'))(_0x7ac4('0x8'));var config=require(_0x7ac4('0x9'));var jayson=require(_0x7ac4('0xa'));var client=jayson[_0x7ac4('0xb')][_0x7ac4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4f0a02,_0x541d9c,_0x12e9af){return new BPromise(function(_0x3be94d,_0x524b31){return client[_0x7ac4('0xd')](_0x4f0a02,_0x12e9af)['then'](function(_0x3ed222){logger[_0x7ac4('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x541d9c,'request\x20sent');logger[_0x7ac4('0xf')](_0x7ac4('0x10'),_0x541d9c,_0x7ac4('0x11'),JSON['stringify'](_0x3ed222));if(_0x3ed222[_0x7ac4('0x12')]){if(_0x3ed222[_0x7ac4('0x12')]['code']===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x541d9c,_0x3ed222[_0x7ac4('0x12')][_0x7ac4('0x13')]);return _0x524b31(_0x3ed222[_0x7ac4('0x12')][_0x7ac4('0x13')]);}logger[_0x7ac4('0x12')](_0x7ac4('0x14'),_0x541d9c,_0x3ed222[_0x7ac4('0x12')]['message']);return _0x3be94d(_0x3ed222['error']['message']);}else{logger['info'](_0x7ac4('0x14'),_0x541d9c,_0x7ac4('0x11'));_0x3be94d(_0x3ed222[_0x7ac4('0x15')][_0x7ac4('0x13')]);}})['catch'](function(_0xbca12){logger['error'](_0x7ac4('0x14'),_0x541d9c,_0xbca12);_0x524b31(_0xbca12);});});} \ No newline at end of file +var _0xaa2f=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s'];(function(_0x299d36,_0x3ea05e){var _0x7701e1=function(_0x27d3b5){while(--_0x27d3b5){_0x299d36['push'](_0x299d36['shift']());}};_0x7701e1(++_0x3ea05e);}(_0xaa2f,0xdf));var _0xfaa2=function(_0x18a71e,_0x1887ec){_0x18a71e=_0x18a71e-0x0;var _0x6a2ef7=_0xaa2f[_0x18a71e];return _0x6a2ef7;};'use strict';var _=require(_0xfaa2('0x0'));var util=require(_0xfaa2('0x1'));var moment=require(_0xfaa2('0x2'));var BPromise=require(_0xfaa2('0x3'));var rs=require(_0xfaa2('0x4'));var fs=require('fs');var Redis=require(_0xfaa2('0x5'));var db=require(_0xfaa2('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfaa2('0x7'));var config=require(_0xfaa2('0x8'));var jayson=require(_0xfaa2('0x9'));var client=jayson['client'][_0xfaa2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28057b,_0x156622,_0x26a502){return new BPromise(function(_0x3eae27,_0x309ae6){return client[_0xfaa2('0xb')](_0x28057b,_0x26a502)[_0xfaa2('0xc')](function(_0x22ed7f){logger[_0xfaa2('0xd')](_0xfaa2('0xe'),_0x156622,'request\x20sent');logger[_0xfaa2('0xf')](_0xfaa2('0x10'),_0x156622,_0xfaa2('0x11'),JSON[_0xfaa2('0x12')](_0x22ed7f));if(_0x22ed7f[_0xfaa2('0x13')]){if(_0x22ed7f['error'][_0xfaa2('0x14')]===0x1f4){logger['error'](_0xfaa2('0xe'),_0x156622,_0x22ed7f[_0xfaa2('0x13')][_0xfaa2('0x15')]);return _0x309ae6(_0x22ed7f[_0xfaa2('0x13')][_0xfaa2('0x15')]);}logger[_0xfaa2('0x13')](_0xfaa2('0xe'),_0x156622,_0x22ed7f[_0xfaa2('0x13')][_0xfaa2('0x15')]);return _0x3eae27(_0x22ed7f[_0xfaa2('0x13')][_0xfaa2('0x15')]);}else{logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x156622,_0xfaa2('0x11'));_0x3eae27(_0x22ed7f[_0xfaa2('0x16')]['message']);}})[_0xfaa2('0x17')](function(_0x2c99ac){logger[_0xfaa2('0x13')](_0xfaa2('0xe'),_0x156622,_0x2c99ac);_0x309ae6(_0x2c99ac);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index be81b95..c35847b 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2ec650,_0x24b011){var _0xdb00de=function(_0x3244e6){while(--_0x3244e6){_0x2ec650['push'](_0x2ec650['shift']());}};_0xdb00de(++_0x24b011);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x8608e6,_0x236ccb){var _0xb2a9fb=function(_0x32e425){while(--_0x32e425){_0x8608e6['push'](_0x8608e6['shift']());}};_0xb2a9fb(++_0x236ccb);}(_0xe706,0xa3));var _0x6e70=function(_0x96a34a,_0x48b3c6){_0x96a34a=_0x96a34a-0x0;var _0x4e325e=_0xe706[_0x96a34a];return _0x4e325e;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index bd9f48a..f6ecbd9 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 _0xc7df=['exports','INTEGER','sequelize'];(function(_0x43026b,_0x928d8c){var _0x4a96cd=function(_0x362cbd){while(--_0x362cbd){_0x43026b['push'](_0x43026b['shift']());}};_0x4a96cd(++_0x928d8c);}(_0xc7df,0x149));var _0xfc7d=function(_0x4c567d,_0x524490){_0x4c567d=_0x4c567d-0x0;var _0x8e4c38=_0xc7df[_0x4c567d];return _0x8e4c38;};'use strict';var Sequelize=require(_0xfc7d('0x0'));module[_0xfc7d('0x1')]={'penalty':{'type':Sequelize[_0xfc7d('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1375=['exports','INTEGER','sequelize'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1375,0x170));var _0x5137=function(_0x4405c2,_0x22531d){_0x4405c2=_0x4405c2-0x0;var _0x28aef0=_0x1375[_0x4405c2];return _0x28aef0;};'use strict';var Sequelize=require(_0x5137('0x0'));module[_0x5137('0x1')]={'penalty':{'type':Sequelize[_0x5137('0x2')],'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 c85fdaa..3f67cf8 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 _0xb3f7=['exports','define','UserMailQueue','user_has_mail_queues','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes'];(function(_0x1280a1,_0x5967cd){var _0x240d6f=function(_0x480ee9){while(--_0x480ee9){_0x1280a1['push'](_0x1280a1['shift']());}};_0x240d6f(++_0x5967cd);}(_0xb3f7,0x13c));var _0x7b3f=function(_0xc67471,_0x1791f8){_0xc67471=_0xc67471-0x0;var _0x52e443=_0xb3f7[_0xc67471];return _0x52e443;};'use strict';var _=require('lodash');var util=require(_0x7b3f('0x0'));var logger=require(_0x7b3f('0x1'))(_0x7b3f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7b3f('0x3'));var fs=require('fs');var path=require(_0x7b3f('0x4'));var rimraf=require(_0x7b3f('0x5'));var config=require(_0x7b3f('0x6'));var attributes=require(_0x7b3f('0x7'));module[_0x7b3f('0x8')]=function(_0x224787,_0x1e20f1){return _0x224787[_0x7b3f('0x9')](_0x7b3f('0xa'),attributes,{'tableName':_0x7b3f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc24=['./userMailQueue.attributes','exports','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xdc24,0x66));var _0x4dc2=function(_0x5e3f0a,_0x539b4d){_0x5e3f0a=_0x5e3f0a-0x0;var _0x2b5920=_0xdc24[_0x5e3f0a];return _0x2b5920;};'use strict';var _=require(_0x4dc2('0x0'));var util=require(_0x4dc2('0x1'));var logger=require(_0x4dc2('0x2'))(_0x4dc2('0x3'));var moment=require(_0x4dc2('0x4'));var BPromise=require(_0x4dc2('0x5'));var rp=require(_0x4dc2('0x6'));var fs=require('fs');var path=require(_0x4dc2('0x7'));var rimraf=require(_0x4dc2('0x8'));var config=require(_0x4dc2('0x9'));var attributes=require(_0x4dc2('0xa'));module[_0x4dc2('0xb')]=function(_0x5b837f,_0x1695b5){return _0x5b837f['define'](_0x4dc2('0xc'),attributes,{'tableName':_0x4dc2('0xd'),'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 1536c97..fb6182b 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 _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserMailQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x008c,0x188));var _0xc008=function(_0x455b35,_0x5d2b5e){_0x455b35=_0x455b35-0x0;var _0x1fc095=_0x008c[_0x455b35];return _0x1fc095;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});} \ No newline at end of file +var _0x7fbe=['request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2b02d5,_0x211431){var _0x2126e7=function(_0x42aae8){while(--_0x42aae8){_0x2b02d5['push'](_0x2b02d5['shift']());}};_0x2126e7(++_0x211431);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x6d070a,_0x47e825){_0x6d070a=_0x6d070a-0x0;var _0x2c065d=_0x7fbe[_0x6d070a];return _0x2c065d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index ab1de94..1ba992f 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 _0x637b=['isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x637b,0xe0));var _0xb637=function(_0x3daced,_0x52bc61){_0x3daced=_0x3daced-0x0;var _0x289c13=_0x637b[_0x3daced];return _0x289c13;};'use strict';var multer=require(_0xb637('0x0'));var util=require(_0xb637('0x1'));var path=require(_0xb637('0x2'));var timeout=require(_0xb637('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb637('0x4'));var auth=require(_0xb637('0x5'));var interaction=require(_0xb637('0x6'));var config=require(_0xb637('0x7'));var controller=require(_0xb637('0x8'));router[_0xb637('0x9')]('/',auth[_0xb637('0xa')](),controller[_0xb637('0xb')]);module[_0xb637('0xc')]=router; \ No newline at end of file +var _0x387d=['util','path','express','fs-extra','../../components/auth/service','./userNotification.controller','post','isAuthenticated','sendUserNotification','multer'];(function(_0x3f4f4c,_0x152171){var _0x3d48b3=function(_0x18a8a4){while(--_0x18a8a4){_0x3f4f4c['push'](_0x3f4f4c['shift']());}};_0x3d48b3(++_0x152171);}(_0x387d,0x1cb));var _0xd387=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x387d[_0x126558];return _0x1f6d14;};'use strict';var multer=require(_0xd387('0x0'));var util=require(_0xd387('0x1'));var path=require(_0xd387('0x2'));var timeout=require('connect-timeout');var express=require(_0xd387('0x3'));var router=express['Router']();var fs_extra=require(_0xd387('0x4'));var auth=require(_0xd387('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd387('0x6'));router[_0xd387('0x7')]('/',auth[_0xd387('0x8')](),controller[_0xd387('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index eced9e7..138fa7a 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 _0xd08b=['TEXT','STRING','sequelize','exports'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xd08b,0x112));var _0xbd08=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0xd08b[_0x616290];return _0x453879;};'use strict';var Sequelize=require(_0xbd08('0x0'));module[_0xbd08('0x1')]={'body':{'type':Sequelize[_0xbd08('0x2')]},'senderName':{'type':Sequelize[_0xbd08('0x3')]},'recipientsId':{'type':Sequelize[_0xbd08('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0x80aa=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x528442,_0x3f7aed){var _0x4c42cd=function(_0x304a36){while(--_0x304a36){_0x528442['push'](_0x528442['shift']());}};_0x4c42cd(++_0x3f7aed);}(_0x80aa,0xb1));var _0xa80a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x80aa[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xa80a('0x0'));module[_0xa80a('0x1')]={'body':{'type':Sequelize[_0xa80a('0x2')]},'senderName':{'type':Sequelize[_0xa80a('0x3')]},'recipientsId':{'type':Sequelize[_0xa80a('0x2')]},'recipientsDescription':{'type':Sequelize[_0xa80a('0x3')]},'beep':{'type':Sequelize[_0xa80a('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index c0bcb94..9b9f113 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 _0xfb36=['./userNotification.socket','sendStatus','status','json','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','sendUserNotification','body','text','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','hasOwnProperty','view','Missing\x20\x27view\x27\x20parameter','recipients','Sequelize','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','some','model','toLowerCase','senderName','isEmpty','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','recipient','emit','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','forEach','startCase','User','ids','queue','replace','Queue','union','flatten','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','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','redis','defaults','localhost','socket.io-emitter'];(function(_0x93988,_0x357fd5){var _0x42110c=function(_0x4a9004){while(--_0x4a9004){_0x93988['push'](_0x93988['shift']());}};_0x42110c(++_0x357fd5);}(_0xfb36,0x1df));var _0x6fb3=function(_0x52646d,_0x2a3297){_0x52646d=_0x52646d-0x0;var _0x10c91b=_0xfb36[_0x52646d];return _0x10c91b;};'use strict';var emlformat=require(_0x6fb3('0x0'));var rimraf=require(_0x6fb3('0x1'));var zipdir=require(_0x6fb3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6fb3('0x3'));var moment=require('moment');var BPromise=require(_0x6fb3('0x4'));var Mustache=require(_0x6fb3('0x5'));var util=require(_0x6fb3('0x6'));var path=require(_0x6fb3('0x7'));var sox=require(_0x6fb3('0x8'));var csv=require(_0x6fb3('0x9'));var ejs=require(_0x6fb3('0xa'));var fs=require('fs');var fs_extra=require(_0x6fb3('0xb'));var _=require(_0x6fb3('0xc'));var squel=require('squel');var crypto=require(_0x6fb3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6fb3('0xe'));var toCsv=require(_0x6fb3('0x9'));var querystring=require(_0x6fb3('0xf'));var Papa=require(_0x6fb3('0x10'));var Redis=require(_0x6fb3('0x11'));var authService=require(_0x6fb3('0x12'));var qs=require(_0x6fb3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6fb3('0x14'));var logger=require(_0x6fb3('0x15'))(_0x6fb3('0x16'));var utils=require(_0x6fb3('0x17'));var config=require(_0x6fb3('0x18'));var licenseUtil=require(_0x6fb3('0x19'));var db=require(_0x6fb3('0x1a'))['db'];config[_0x6fb3('0x1b')]=_[_0x6fb3('0x1c')](config[_0x6fb3('0x1b')],{'host':_0x6fb3('0x1d'),'port':0x18eb});var socket=require(_0x6fb3('0x1e'))(new Redis(config[_0x6fb3('0x1b')]));require(_0x6fb3('0x1f'))['register'](socket);function respondWithStatusCode(_0x4ad220,_0x1f3517){_0x1f3517=_0x1f3517||0xcc;return function(_0x262159){if(_0x262159){return _0x4ad220[_0x6fb3('0x20')](_0x1f3517);}return _0x4ad220[_0x6fb3('0x21')](_0x1f3517)['end']();};}function respondWithResult(_0x46a471,_0xde7f63){_0xde7f63=_0xde7f63||0xc8;return function(_0x18636d){if(_0x18636d){return _0x46a471[_0x6fb3('0x21')](_0xde7f63)[_0x6fb3('0x22')](_0x18636d);}};}function respondWithFilteredResult(_0x579455,_0x1d0205){return function(_0x149ea9){if(_0x149ea9){var _0x132412=typeof _0x1d0205['offset']==='undefined'&&typeof _0x1d0205[_0x6fb3('0x23')]==='undefined';var _0x5f0dc8=_0x149ea9['count'];var _0x392f2d=_0x132412?0x0:_0x1d0205['offset'];var _0x25d776=_0x132412?_0x149ea9[_0x6fb3('0x24')]:_0x1d0205['offset']+_0x1d0205[_0x6fb3('0x23')];var _0x5eeaca;if(_0x25d776>=_0x5f0dc8){_0x25d776=_0x5f0dc8;_0x5eeaca=0xc8;}else{_0x5eeaca=0xce;}_0x579455[_0x6fb3('0x21')](_0x5eeaca);return _0x579455[_0x6fb3('0x25')](_0x6fb3('0x26'),_0x392f2d+'-'+_0x25d776+'/'+_0x5f0dc8)[_0x6fb3('0x22')](_0x149ea9);}return null;};}function patchUpdates(_0x744c09){return function(_0x1297aa){try{jsonpatch[_0x6fb3('0x27')](_0x1297aa,_0x744c09,!![]);}catch(_0x44bcdf){return BPromise[_0x6fb3('0x28')](_0x44bcdf);}return _0x1297aa[_0x6fb3('0x29')]();};}function saveUpdates(_0x5c7150,_0x3448d3){return function(_0x16c10b){if(_0x16c10b){return _0x16c10b[_0x6fb3('0x2a')](_0x5c7150)[_0x6fb3('0x2b')](function(_0x4c8f9c){return _0x4c8f9c;});}return null;};}function removeEntity(_0x514343,_0x59e3be){return function(_0x22d6b3){if(_0x22d6b3){return _0x22d6b3[_0x6fb3('0x2c')]()['then'](function(){_0x514343['status'](0xcc)[_0x6fb3('0x2d')]();});}};}function handleEntityNotFound(_0x248269,_0x13314a){return function(_0x1d83d4){if(!_0x1d83d4){_0x248269[_0x6fb3('0x20')](0x194);}return _0x1d83d4;};}function handleError(_0x3a5b33,_0x5ebc8a){_0x5ebc8a=_0x5ebc8a||0x1f4;return function(_0x432f84){logger[_0x6fb3('0x2e')](_0x432f84[_0x6fb3('0x2f')]);if(_0x432f84[_0x6fb3('0x30')]){delete _0x432f84[_0x6fb3('0x30')];}_0x3a5b33[_0x6fb3('0x21')](_0x5ebc8a)[_0x6fb3('0x31')](_0x432f84);};}exports[_0x6fb3('0x32')]=function(_0x519750,_0x88830b,_0x4e6d40){if(!_0x519750[_0x6fb3('0x33')]['hasOwnProperty'](_0x6fb3('0x34'))&&!_0x519750[_0x6fb3('0x33')]['hasOwnProperty'](_0x6fb3('0x35'))){throw new db['Sequelize'][(_0x6fb3('0x36'))](_0x6fb3('0x37'));}else{if(_0x519750[_0x6fb3('0x33')]['hasOwnProperty']('TemplateId')&&!_0x519750[_0x6fb3('0x33')][_0x6fb3('0x38')](_0x6fb3('0x39'))){throw new db['Sequelize'][(_0x6fb3('0x36'))](_0x6fb3('0x3a'));}if(!_0x519750[_0x6fb3('0x33')][_0x6fb3('0x38')](_0x6fb3('0x3b'))){throw new db[(_0x6fb3('0x3c'))]['ValidationError'](_0x6fb3('0x3d'));}else{try{var _0x57ad07=JSON[_0x6fb3('0x3e')](_0x519750['body'][_0x6fb3('0x3b')]);}catch(_0x309ee0){logger[_0x6fb3('0x2e')](_0x309ee0);throw new db['Sequelize'][(_0x6fb3('0x36'))](_0x6fb3('0x3f'));}var _0x5d075b=[_0x6fb3('0x40'),_0x6fb3('0x41'),_0x6fb3('0x42'),_0x6fb3('0x43'),_0x6fb3('0x44'),_0x6fb3('0x45'),_0x6fb3('0x46'),_0x6fb3('0x47'),'user'];if(_[_0x6fb3('0x48')](_0x57ad07,function(_0x393043){return!_['includes'](_0x5d075b,_0x393043[_0x6fb3('0x49')][_0x6fb3('0x4a')]());})){throw new db[(_0x6fb3('0x3c'))][(_0x6fb3('0x36'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x4b21e5={};_0x4b21e5[_0x6fb3('0x4b')]=_0x519750['body'][_0x6fb3('0x38')]('senderName')?_0x519750['body'][_0x6fb3('0x4b')]:_0x519750['user']['fullname'];_0x4b21e5['recipientsDescription']=_[_0x6fb3('0x4c')](_0x519750['body'][_0x6fb3('0x4d')])?null:_0x519750[_0x6fb3('0x33')][_0x6fb3('0x4d')];_0x4b21e5[_0x6fb3('0x4e')]=_0x519750[_0x6fb3('0x33')][_0x6fb3('0x4e')]||![];_0x4b21e5[_0x6fb3('0x4f')]=_0x519750['user']['id'];return getContent(_0x519750['body'])[_0x6fb3('0x2b')](function(_0x304bee){_0x4b21e5[_0x6fb3('0x33')]=_0x304bee;return getRecipients(_0x57ad07);})[_0x6fb3('0x2b')](function(_0xb35e7a){_0x4b21e5[_0x6fb3('0x50')]=_[_0x6fb3('0x51')](_0xb35e7a)[_0x6fb3('0x52')](',');return db[_0x6fb3('0x53')][_0x6fb3('0x54')](function(_0x245c83){return db[_0x6fb3('0x55')]['create'](_0x4b21e5,{'raw':!![],'transaction':_0x245c83})[_0x6fb3('0x2b')](function(_0x4bf49b){var _0x1e45e3={'sender':_0x4b21e5[_0x6fb3('0x4b')],'description':_0x4b21e5[_0x6fb3('0x4d')],'content':_0x4b21e5[_0x6fb3('0x33')],'beep':_0x4b21e5[_0x6fb3('0x4e')]};_0xb35e7a['forEach'](function(_0x588d99){_0x1e45e3[_0x6fb3('0x56')]=_0x588d99;socket[_0x6fb3('0x57')]('userNotification:send',_0x1e45e3);});return _0x4bf49b;});});})[_0x6fb3('0x2b')](respondWithResult(_0x88830b,0xc9))[_0x6fb3('0x58')](handleError(_0x88830b,null));};function getContent(_0x42c3e5){return new BPromise(function(_0x4a0b13,_0xf5dd5f){if(_0x42c3e5[_0x6fb3('0x34')]){_0x4a0b13(_0x42c3e5[_0x6fb3('0x34')]);return;}return db[_0x6fb3('0x59')][_0x6fb3('0x5a')]({'attributes':[_0x6fb3('0x5b')],'where':{'id':_0x42c3e5[_0x6fb3('0x35')]},'raw':!![]})[_0x6fb3('0x2b')](function(_0x28d4c1){if(!_0x28d4c1)throw new db[(_0x6fb3('0x3c'))][(_0x6fb3('0x36'))](_0x6fb3('0x5c'));var _0x130f09=Mustache['render'](_0x28d4c1[_0x6fb3('0x5b')],_0x42c3e5[_0x6fb3('0x39')]);_0x4a0b13(_0x130f09);})[_0x6fb3('0x58')](function(_0x566f3a){_0xf5dd5f(_0x566f3a);});});}function getRecipients(_0x497af2){return new BPromise(function(_0xce45c3,_0x27ac1b){var _0x5c113b=[];var _0x343b99=[];_0x497af2[_0x6fb3('0x5d')](function(_0x1f1d94){var _0x5cf701=_[_0x6fb3('0x5e')](_0x1f1d94[_0x6fb3('0x49')][_0x6fb3('0x4a')]());if(_0x5cf701===_0x6fb3('0x5f')){_0x5c113b=_['union'](_0x5c113b,_0x1f1d94[_0x6fb3('0x60')]);}else{if(_['includes'](_0x5cf701,_0x6fb3('0x61')))_0x5cf701=_0x5cf701[_0x6fb3('0x62')](_0x6fb3('0x61'),_0x6fb3('0x63'));_0x1f1d94[_0x6fb3('0x60')][_0x6fb3('0x5d')](function(_0x2242bf){_0x343b99['push'](getAgents(_0x5cf701,_0x2242bf));});}});return BPromise['all'](_0x343b99)[_0x6fb3('0x2b')](function(_0x5720fd){_0x5c113b=_[_0x6fb3('0x64')](_0x5c113b,_[_0x6fb3('0x65')](_0x5720fd));_0xce45c3(_0x5c113b);})[_0x6fb3('0x58')](function(_0x239394){_0x27ac1b(_0x239394);});});}function getAgents(_0x37309f,_0x18bc1b){return new BPromise(function(_0x5c3763,_0x488d70){return db[_0x37309f][_0x6fb3('0x5a')]({'where':{'id':_0x18bc1b}})['then'](function(_0x70fea6){return _0x70fea6['getAgents']({'attributes':['id'],'raw':!![]})[_0x6fb3('0x2b')](function(_0x500b0f){var _0x4bd989=_['map'](_0x500b0f,'id');_0x5c3763(_0x4bd989);});})[_0x6fb3('0x58')](function(_0xe8b6f4){_0x488d70(_0xe8b6f4);});});} \ No newline at end of file +var _0x610f=['forEach','startCase','User','ids','queue','replace','Queue','push','all','union','flatten','getAgents','map','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./userNotification.socket','register','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','then','destroy','sendStatus','error','name','send','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','parse','recipients','chatqueue','faxqueue','mailqueue','openchannelqueue','voicequeue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','UserNotification','create','catch','findOne','html','render'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0x610f,0x6e));var _0xf610=function(_0x12f451,_0x3b618f){_0x12f451=_0x12f451-0x0;var _0x5e9589=_0x610f[_0x12f451];return _0x5e9589;};'use strict';var emlformat=require(_0xf610('0x0'));var rimraf=require(_0xf610('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf610('0x2'));var rp=require(_0xf610('0x3'));var moment=require(_0xf610('0x4'));var BPromise=require(_0xf610('0x5'));var Mustache=require(_0xf610('0x6'));var util=require(_0xf610('0x7'));var path=require(_0xf610('0x8'));var sox=require(_0xf610('0x9'));var csv=require(_0xf610('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf610('0xb'));var squel=require(_0xf610('0xc'));var crypto=require(_0xf610('0xd'));var jsforce=require(_0xf610('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf610('0xa'));var querystring=require(_0xf610('0xf'));var Papa=require('papaparse');var Redis=require(_0xf610('0x10'));var authService=require(_0xf610('0x11'));var qs=require(_0xf610('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf610('0x13'));var logger=require(_0xf610('0x14'))(_0xf610('0x15'));var utils=require(_0xf610('0x16'));var config=require(_0xf610('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xf610('0x18')]=_['defaults'](config[_0xf610('0x18')],{'host':_0xf610('0x19'),'port':0x18eb});var socket=require(_0xf610('0x1a'))(new Redis(config[_0xf610('0x18')]));require(_0xf610('0x1b'))[_0xf610('0x1c')](socket);function respondWithStatusCode(_0x5ef77b,_0x5eb559){_0x5eb559=_0x5eb559||0xcc;return function(_0x539e45){if(_0x539e45){return _0x5ef77b['sendStatus'](_0x5eb559);}return _0x5ef77b[_0xf610('0x1d')](_0x5eb559)[_0xf610('0x1e')]();};}function respondWithResult(_0xd748f3,_0x2bbba4){_0x2bbba4=_0x2bbba4||0xc8;return function(_0x4572fc){if(_0x4572fc){return _0xd748f3[_0xf610('0x1d')](_0x2bbba4)[_0xf610('0x1f')](_0x4572fc);}};}function respondWithFilteredResult(_0x2bd861,_0x56d7d7){return function(_0x196320){if(_0x196320){var _0x131c2c=typeof _0x56d7d7['offset']===_0xf610('0x20')&&typeof _0x56d7d7[_0xf610('0x21')]===_0xf610('0x20');var _0x33388f=_0x196320[_0xf610('0x22')];var _0x596c7c=_0x131c2c?0x0:_0x56d7d7[_0xf610('0x23')];var _0x4cc4a4=_0x131c2c?_0x196320[_0xf610('0x22')]:_0x56d7d7['offset']+_0x56d7d7['limit'];var _0x4dda39;if(_0x4cc4a4>=_0x33388f){_0x4cc4a4=_0x33388f;_0x4dda39=0xc8;}else{_0x4dda39=0xce;}_0x2bd861[_0xf610('0x1d')](_0x4dda39);return _0x2bd861['set'](_0xf610('0x24'),_0x596c7c+'-'+_0x4cc4a4+'/'+_0x33388f)[_0xf610('0x1f')](_0x196320);}return null;};}function patchUpdates(_0x357bc0){return function(_0x47f225){try{jsonpatch['apply'](_0x47f225,_0x357bc0,!![]);}catch(_0x43055e){return BPromise[_0xf610('0x25')](_0x43055e);}return _0x47f225[_0xf610('0x26')]();};}function saveUpdates(_0x235b1e,_0x459815){return function(_0x5f0a96){if(_0x5f0a96){return _0x5f0a96['update'](_0x235b1e)[_0xf610('0x27')](function(_0x4c7d0c){return _0x4c7d0c;});}return null;};}function removeEntity(_0x5d563c,_0x3eadbe){return function(_0x123733){if(_0x123733){return _0x123733[_0xf610('0x28')]()[_0xf610('0x27')](function(){_0x5d563c[_0xf610('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c67f9,_0x28f59b){return function(_0x2b0cf0){if(!_0x2b0cf0){_0x2c67f9[_0xf610('0x29')](0x194);}return _0x2b0cf0;};}function handleError(_0x37d291,_0x574d0e){_0x574d0e=_0x574d0e||0x1f4;return function(_0x5745d2){logger[_0xf610('0x2a')](_0x5745d2['stack']);if(_0x5745d2['name']){delete _0x5745d2[_0xf610('0x2b')];}_0x37d291[_0xf610('0x1d')](_0x574d0e)[_0xf610('0x2c')](_0x5745d2);};}exports['sendUserNotification']=function(_0x2c8036,_0x96a076,_0x338c26){if(!_0x2c8036[_0xf610('0x2d')][_0xf610('0x2e')](_0xf610('0x2f'))&&!_0x2c8036[_0xf610('0x2d')]['hasOwnProperty'](_0xf610('0x30'))){throw new db[(_0xf610('0x31'))][(_0xf610('0x32'))](_0xf610('0x33'));}else{if(_0x2c8036[_0xf610('0x2d')]['hasOwnProperty'](_0xf610('0x30'))&&!_0x2c8036['body'][_0xf610('0x2e')](_0xf610('0x34'))){throw new db[(_0xf610('0x31'))][(_0xf610('0x32'))](_0xf610('0x35'));}if(!_0x2c8036['body'][_0xf610('0x2e')]('recipients')){throw new db['Sequelize'][(_0xf610('0x32'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x2898ca=JSON[_0xf610('0x36')](_0x2c8036[_0xf610('0x2d')][_0xf610('0x37')]);}catch(_0x100544){logger[_0xf610('0x2a')](_0x100544);throw new db[(_0xf610('0x31'))][(_0xf610('0x32'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x48ecd5=[_0xf610('0x38'),_0xf610('0x39'),_0xf610('0x3a'),_0xf610('0x3b'),'smsqueue',_0xf610('0x3c'),'whatsappqueue',_0xf610('0x3d'),_0xf610('0x3e')];if(_[_0xf610('0x3f')](_0x2898ca,function(_0x1d313d){return!_[_0xf610('0x40')](_0x48ecd5,_0x1d313d[_0xf610('0x41')][_0xf610('0x42')]());})){throw new db[(_0xf610('0x31'))]['ValidationError'](_0xf610('0x43'));}}}var _0x717a2={};_0x717a2['senderName']=_0x2c8036[_0xf610('0x2d')][_0xf610('0x2e')](_0xf610('0x44'))?_0x2c8036['body']['senderName']:_0x2c8036['user'][_0xf610('0x45')];_0x717a2[_0xf610('0x46')]=_[_0xf610('0x47')](_0x2c8036[_0xf610('0x2d')][_0xf610('0x46')])?null:_0x2c8036[_0xf610('0x2d')][_0xf610('0x46')];_0x717a2[_0xf610('0x48')]=_0x2c8036[_0xf610('0x2d')][_0xf610('0x48')]||![];_0x717a2[_0xf610('0x49')]=_0x2c8036[_0xf610('0x3e')]['id'];return getContent(_0x2c8036[_0xf610('0x2d')])[_0xf610('0x27')](function(_0x3ee70e){_0x717a2['body']=_0x3ee70e;return getRecipients(_0x2898ca);})[_0xf610('0x27')](function(_0x398ed2){_0x717a2[_0xf610('0x4a')]=_[_0xf610('0x4b')](_0x398ed2)[_0xf610('0x4c')](',');return db[_0xf610('0x4d')]['transaction'](function(_0x7cbefb){return db[_0xf610('0x4e')][_0xf610('0x4f')](_0x717a2,{'raw':!![],'transaction':_0x7cbefb})[_0xf610('0x27')](function(_0x3aab44){var _0x185f31={'sender':_0x717a2[_0xf610('0x44')],'description':_0x717a2[_0xf610('0x46')],'content':_0x717a2[_0xf610('0x2d')],'beep':_0x717a2[_0xf610('0x48')]};_0x398ed2['forEach'](function(_0x23de28){_0x185f31['recipient']=_0x23de28;socket['emit']('userNotification:send',_0x185f31);});return _0x3aab44;});});})['then'](respondWithResult(_0x96a076,0xc9))[_0xf610('0x50')](handleError(_0x96a076,null));};function getContent(_0xcaadeb){return new BPromise(function(_0x1c0142,_0x34f438){if(_0xcaadeb[_0xf610('0x2f')]){_0x1c0142(_0xcaadeb[_0xf610('0x2f')]);return;}return db['Template'][_0xf610('0x51')]({'attributes':[_0xf610('0x52')],'where':{'id':_0xcaadeb[_0xf610('0x30')]},'raw':!![]})[_0xf610('0x27')](function(_0xf78b31){if(!_0xf78b31)throw new db[(_0xf610('0x31'))]['ValidationError']('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x174e26=Mustache[_0xf610('0x53')](_0xf78b31[_0xf610('0x52')],_0xcaadeb[_0xf610('0x34')]);_0x1c0142(_0x174e26);})[_0xf610('0x50')](function(_0x5361f8){_0x34f438(_0x5361f8);});});}function getRecipients(_0xe0577a){return new BPromise(function(_0x3d52f2,_0x57cdb5){var _0x75891b=[];var _0x42a83a=[];_0xe0577a[_0xf610('0x54')](function(_0x1964e2){var _0x26473b=_[_0xf610('0x55')](_0x1964e2['model'][_0xf610('0x42')]());if(_0x26473b===_0xf610('0x56')){_0x75891b=_['union'](_0x75891b,_0x1964e2[_0xf610('0x57')]);}else{if(_[_0xf610('0x40')](_0x26473b,_0xf610('0x58')))_0x26473b=_0x26473b[_0xf610('0x59')](_0xf610('0x58'),_0xf610('0x5a'));_0x1964e2[_0xf610('0x57')][_0xf610('0x54')](function(_0x57360f){_0x42a83a[_0xf610('0x5b')](getAgents(_0x26473b,_0x57360f));});}});return BPromise[_0xf610('0x5c')](_0x42a83a)['then'](function(_0x446aa7){_0x75891b=_[_0xf610('0x5d')](_0x75891b,_[_0xf610('0x5e')](_0x446aa7));_0x3d52f2(_0x75891b);})[_0xf610('0x50')](function(_0x4a0862){_0x57cdb5(_0x4a0862);});});}function getAgents(_0x171810,_0x29f746){return new BPromise(function(_0x576a6b,_0x39d5e2){return db[_0x171810][_0xf610('0x51')]({'where':{'id':_0x29f746}})['then'](function(_0x3df784){return _0x3df784[_0xf610('0x5f')]({'attributes':['id'],'raw':!![]})[_0xf610('0x27')](function(_0x375c26){var _0x4f7251=_[_0xf610('0x60')](_0x375c26,'id');_0x576a6b(_0x4f7251);});})[_0xf610('0x50')](function(_0x275e36){_0x39d5e2(_0x275e36);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 6f49e93..1439d5c 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 _0xe112=['hook','exports','events','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x1ffe76,_0x4ebdfd){var _0x279a53=function(_0x28a47c){while(--_0x28a47c){_0x1ffe76['push'](_0x1ffe76['shift']());}};_0x279a53(++_0x4ebdfd);}(_0xe112,0x112));var _0x2e11=function(_0xdffcc0,_0xf261a9){_0xdffcc0=_0xdffcc0-0x0;var _0x1fa4b4=_0xe112[_0xdffcc0];return _0x1fa4b4;};'use strict';var EventEmitter=require(_0x2e11('0x0'));var UserNotification=require('../../mysqldb')['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x2e11('0x1')](0x0);var events={'afterCreate':_0x2e11('0x2'),'afterUpdate':_0x2e11('0x3'),'afterDestroy':_0x2e11('0x4')};function emitEvent(_0x515d91){return function(_0x5ec8bf,_0x3ba2d8,_0x41e32e){UserNotificationEvents['emit'](_0x515d91+':'+_0x5ec8bf['id'],_0x5ec8bf);UserNotificationEvents['emit'](_0x515d91,_0x5ec8bf);_0x41e32e(null);};}for(var e in events){if(events[_0x2e11('0x5')](e)){var event=events[e];UserNotification[_0x2e11('0x6')](e,emitEvent(event));}}module[_0x2e11('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0xa5f5=['hasOwnProperty','hook','events','../../mysqldb','UserNotification','setMaxListeners','save','update','remove','emit'];(function(_0xf2d6b2,_0x3bacc8){var _0x5f6e12=function(_0x1a86ca){while(--_0x1a86ca){_0xf2d6b2['push'](_0xf2d6b2['shift']());}};_0x5f6e12(++_0x3bacc8);}(_0xa5f5,0x16a));var _0x5a5f=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0xa5f5[_0x556bb1];return _0x45455f;};'use strict';var EventEmitter=require(_0x5a5f('0x0'));var UserNotification=require(_0x5a5f('0x1'))['db'][_0x5a5f('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x5a5f('0x3')](0x0);var events={'afterCreate':_0x5a5f('0x4'),'afterUpdate':_0x5a5f('0x5'),'afterDestroy':_0x5a5f('0x6')};function emitEvent(_0x25be7c){return function(_0x7546a,_0x57b251,_0x317a80){UserNotificationEvents[_0x5a5f('0x7')](_0x25be7c+':'+_0x7546a['id'],_0x7546a);UserNotificationEvents['emit'](_0x25be7c,_0x7546a);_0x317a80(null);};}for(var e in events){if(events[_0x5a5f('0x8')](e)){var event=events[e];UserNotification[_0x5a5f('0x9')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 3f2c3d8..981fbcc 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 _0x8713=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4_unicode_ci'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x8713,0x1ea));var _0x3871=function(_0x1e69c0,_0x58042e){_0x1e69c0=_0x1e69c0-0x0;var _0x2105be=_0x8713[_0x1e69c0];return _0x2105be;};'use strict';var _=require('lodash');var util=require(_0x3871('0x0'));var logger=require(_0x3871('0x1'))(_0x3871('0x2'));var moment=require(_0x3871('0x3'));var BPromise=require(_0x3871('0x4'));var rp=require(_0x3871('0x5'));var fs=require('fs');var path=require(_0x3871('0x6'));var rimraf=require(_0x3871('0x7'));var config=require('../../config/environment');var attributes=require(_0x3871('0x8'));module[_0x3871('0x9')]=function(_0x556645,_0x47a21f){return _0x556645[_0x3871('0xa')](_0x3871('0xb'),attributes,{'tableName':_0x3871('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3871('0xd')});}; \ No newline at end of file +var _0x0da7=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4573ff,_0x459a66){var _0x280a7b=function(_0x5a0ead){while(--_0x5a0ead){_0x4573ff['push'](_0x4573ff['shift']());}};_0x280a7b(++_0x459a66);}(_0x0da7,0x17a));var _0x70da=function(_0x515ae8,_0x2a964f){_0x515ae8=_0x515ae8-0x0;var _0x4cf66a=_0x0da7[_0x515ae8];return _0x4cf66a;};'use strict';var _=require(_0x70da('0x0'));var util=require('util');var logger=require(_0x70da('0x1'))('api');var moment=require(_0x70da('0x2'));var BPromise=require(_0x70da('0x3'));var rp=require(_0x70da('0x4'));var fs=require('fs');var path=require(_0x70da('0x5'));var rimraf=require(_0x70da('0x6'));var config=require(_0x70da('0x7'));var attributes=require(_0x70da('0x8'));module[_0x70da('0x9')]=function(_0x53fbf4,_0x49a911){return _0x53fbf4[_0x70da('0xa')](_0x70da('0xb'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x70da('0xc'),'collate':_0x70da('0xd')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index d571ecd..2bab9aa 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 _0xabda=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./userNotification.socket','register','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x199b1f,_0x4ed849){var _0x267ac9=function(_0x184ac6){while(--_0x184ac6){_0x199b1f['push'](_0x199b1f['shift']());}};_0x267ac9(++_0x4ed849);}(_0xabda,0x151));var _0xaabd=function(_0x4f46f1,_0x2a39b9){_0x4f46f1=_0x4f46f1-0x0;var _0x5e146b=_0xabda[_0x4f46f1];return _0x5e146b;};'use strict';var _=require(_0xaabd('0x0'));var util=require(_0xaabd('0x1'));var moment=require(_0xaabd('0x2'));var BPromise=require('bluebird');var rs=require(_0xaabd('0x3'));var fs=require('fs');var Redis=require(_0xaabd('0x4'));var db=require(_0xaabd('0x5'))['db'];var utils=require(_0xaabd('0x6'));var logger=require('../../config/logger')(_0xaabd('0x7'));var config=require(_0xaabd('0x8'));var jayson=require(_0xaabd('0x9'));var client=jayson[_0xaabd('0xa')][_0xaabd('0xb')]({'port':0x232a});config[_0xaabd('0xc')]=_[_0xaabd('0xd')](config[_0xaabd('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xaabd('0xe'))(new Redis(config[_0xaabd('0xc')]));require(_0xaabd('0xf'))[_0xaabd('0x10')](socket);function respondWithRpcPromise(_0x463cd5,_0x3c29a2,_0x3fe103){return new BPromise(function(_0x5574d5,_0x9ca8ec){return client['request'](_0x463cd5,_0x3fe103)[_0xaabd('0x11')](function(_0x35235e){logger['info'](_0xaabd('0x12'),_0x3c29a2,_0xaabd('0x13'));logger[_0xaabd('0x14')](_0xaabd('0x15'),_0x3c29a2,_0xaabd('0x13'),JSON[_0xaabd('0x16')](_0x35235e));if(_0x35235e[_0xaabd('0x17')]){if(_0x35235e[_0xaabd('0x17')]['code']===0x1f4){logger[_0xaabd('0x17')](_0xaabd('0x12'),_0x3c29a2,_0x35235e[_0xaabd('0x17')][_0xaabd('0x18')]);return _0x9ca8ec(_0x35235e['error'][_0xaabd('0x18')]);}logger[_0xaabd('0x17')](_0xaabd('0x12'),_0x3c29a2,_0x35235e[_0xaabd('0x17')][_0xaabd('0x18')]);return _0x5574d5(_0x35235e[_0xaabd('0x17')][_0xaabd('0x18')]);}else{logger[_0xaabd('0x19')]('UserNotification,\x20%s,\x20%s',_0x3c29a2,'request\x20sent');_0x5574d5(_0x35235e[_0xaabd('0x1a')][_0xaabd('0x18')]);}})[_0xaabd('0x1b')](function(_0x9d5a16){logger[_0xaabd('0x17')](_0xaabd('0x12'),_0x3c29a2,_0x9d5a16);_0x9ca8ec(_0x9d5a16);});});} \ No newline at end of file +var _0x248c=['../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x2cce35,_0x412c00){var _0x3fa633=function(_0x41cf41){while(--_0x41cf41){_0x2cce35['push'](_0x2cce35['shift']());}};_0x3fa633(++_0x412c00);}(_0x248c,0xe0));var _0xc248=function(_0x5d7b38,_0x618dda){_0x5d7b38=_0x5d7b38-0x0;var _0x5a72fe=_0x248c[_0x5d7b38];return _0x5a72fe;};'use strict';var _=require(_0xc248('0x0'));var util=require(_0xc248('0x1'));var moment=require(_0xc248('0x2'));var BPromise=require(_0xc248('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc248('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc248('0x5'));var logger=require(_0xc248('0x6'))(_0xc248('0x7'));var config=require(_0xc248('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc248('0x9')]['http']({'port':0x232a});config[_0xc248('0xa')]=_[_0xc248('0xb')](config[_0xc248('0xa')],{'host':_0xc248('0xc'),'port':0x18eb});var socket=require(_0xc248('0xd'))(new Redis(config['redis']));require(_0xc248('0xe'))[_0xc248('0xf')](socket);function respondWithRpcPromise(_0x26fb34,_0x346b2e,_0x11c90f){return new BPromise(function(_0x4ee1ab,_0x9428c1){return client[_0xc248('0x10')](_0x26fb34,_0x11c90f)[_0xc248('0x11')](function(_0x480cf2){logger[_0xc248('0x12')](_0xc248('0x13'),_0x346b2e,_0xc248('0x14'));logger[_0xc248('0x15')](_0xc248('0x16'),_0x346b2e,_0xc248('0x14'),JSON[_0xc248('0x17')](_0x480cf2));if(_0x480cf2[_0xc248('0x18')]){if(_0x480cf2[_0xc248('0x18')][_0xc248('0x19')]===0x1f4){logger['error'](_0xc248('0x13'),_0x346b2e,_0x480cf2[_0xc248('0x18')][_0xc248('0x1a')]);return _0x9428c1(_0x480cf2['error'][_0xc248('0x1a')]);}logger['error'](_0xc248('0x13'),_0x346b2e,_0x480cf2['error'][_0xc248('0x1a')]);return _0x4ee1ab(_0x480cf2[_0xc248('0x18')][_0xc248('0x1a')]);}else{logger[_0xc248('0x12')](_0xc248('0x13'),_0x346b2e,_0xc248('0x14'));_0x4ee1ab(_0x480cf2[_0xc248('0x1b')][_0xc248('0x1a')]);}})[_0xc248('0x1c')](function(_0x1b9d5a){logger[_0xc248('0x18')](_0xc248('0x13'),_0x346b2e,_0x1b9d5a);_0x9428c1(_0x1b9d5a);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 4044994..a180a78 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 _0xd232=['removeListener','register','length','userNotification:','./userNotification.events','save','update'];(function(_0x3bdf3f,_0x4256b1){var _0x4fb1fe=function(_0xd30819){while(--_0xd30819){_0x3bdf3f['push'](_0x3bdf3f['shift']());}};_0x4fb1fe(++_0x4256b1);}(_0xd232,0xc8));var _0x2d23=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd232[_0x3dd15e];return _0x231fd0;};'use strict';var UserNotificationEvents=require(_0x2d23('0x0'));var events=[_0x2d23('0x1'),'remove',_0x2d23('0x2')];function createListener(_0x540ef6,_0x302915){return function(_0x1bc7d9){_0x302915['emit'](_0x540ef6,_0x1bc7d9);};}function removeListener(_0x54ad91,_0x4a0807){return function(){UserNotificationEvents[_0x2d23('0x3')](_0x54ad91,_0x4a0807);};}exports[_0x2d23('0x4')]=function(_0xbec180){for(var _0x525bb6=0x0,_0x2f2317=events[_0x2d23('0x5')];_0x525bb6<_0x2f2317;_0x525bb6++){var _0x5f565=events[_0x525bb6];var _0x4fb4de=createListener(_0x2d23('0x6')+_0x5f565,_0xbec180);UserNotificationEvents['on'](_0x5f565,_0x4fb4de);}}; \ No newline at end of file +var _0x6de6=['save','remove','emit','register','userNotification:','./userNotification.events'];(function(_0x3dd225,_0x1dc7eb){var _0x52b7ad=function(_0x4d868d){while(--_0x4d868d){_0x3dd225['push'](_0x3dd225['shift']());}};_0x52b7ad(++_0x1dc7eb);}(_0x6de6,0xcb));var _0x66de=function(_0x2554b6,_0x22e703){_0x2554b6=_0x2554b6-0x0;var _0x4b23b9=_0x6de6[_0x2554b6];return _0x4b23b9;};'use strict';var UserNotificationEvents=require(_0x66de('0x0'));var events=[_0x66de('0x1'),_0x66de('0x2'),'update'];function createListener(_0x59a866,_0x61db08){return function(_0x572d7c){_0x61db08[_0x66de('0x3')](_0x59a866,_0x572d7c);};}function removeListener(_0x2b8bce,_0x4c4ef2){return function(){UserNotificationEvents['removeListener'](_0x2b8bce,_0x4c4ef2);};}exports[_0x66de('0x4')]=function(_0x28a232){for(var _0x3699ee=0x0,_0x10fa00=events['length'];_0x3699ee<_0x10fa00;_0x3699ee++){var _0x4cfd23=events[_0x3699ee];var _0x1587aa=createListener(_0x66de('0x5')+_0x4cfd23,_0x28a232);UserNotificationEvents['on'](_0x4cfd23,_0x1587aa);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index ff53777..8dfce4c 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x57a4b6,_0x2d1d3b){var _0x527244=function(_0x566973){while(--_0x566973){_0x57a4b6['push'](_0x57a4b6['shift']());}};_0x527244(++_0x2d1d3b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xcb91[_0x2235bf];return _0x4c3a64;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xe84953,_0xa2cc7){var _0x2f486f=function(_0x4a0a09){while(--_0x4a0a09){_0xe84953['push'](_0xe84953['shift']());}};_0x2f486f(++_0xa2cc7);}(_0x9c44,0x178));var _0x49c4=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x9c44[_0x3b0731];return _0x4204d7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 87ccd60..e41691f 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 _0xcf70=['INTEGER','sequelize','exports'];(function(_0x744586,_0x2e4d07){var _0x363931=function(_0x18b0f5){while(--_0x18b0f5){_0x744586['push'](_0x744586['shift']());}};_0x363931(++_0x2e4d07);}(_0xcf70,0x94));var _0x0cf7=function(_0x1aa897,_0x24368e){_0x1aa897=_0x1aa897-0x0;var _0x556aa0=_0xcf70[_0x1aa897];return _0x556aa0;};'use strict';var Sequelize=require(_0x0cf7('0x0'));module[_0x0cf7('0x1')]={'penalty':{'type':Sequelize[_0x0cf7('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4d4b=['INTEGER','sequelize','exports'];(function(_0x2c6810,_0x23c079){var _0x213881=function(_0x528021){while(--_0x528021){_0x2c6810['push'](_0x2c6810['shift']());}};_0x213881(++_0x23c079);}(_0x4d4b,0x1a8));var _0xb4d4=function(_0x46fe27,_0x32d2e0){_0x46fe27=_0x46fe27-0x0;var _0x40122c=_0x4d4b[_0x46fe27];return _0x40122c;};'use strict';var Sequelize=require(_0xb4d4('0x0'));module[_0xb4d4('0x1')]={'penalty':{'type':Sequelize[_0xb4d4('0x2')],'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 d35faa9..6204396 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 _0x46c4=['exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x46c4,0xa0));var _0x446c=function(_0x339ce4,_0x56ac8b){_0x339ce4=_0x339ce4-0x0;var _0x383d89=_0x46c4[_0x339ce4];return _0x383d89;};'use strict';var _=require(_0x446c('0x0'));var util=require(_0x446c('0x1'));var logger=require('../../config/logger')(_0x446c('0x2'));var moment=require(_0x446c('0x3'));var BPromise=require(_0x446c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x446c('0x5'));var rimraf=require(_0x446c('0x6'));var config=require(_0x446c('0x7'));var attributes=require(_0x446c('0x8'));module[_0x446c('0x9')]=function(_0x29221a,_0x4a7002){return _0x29221a[_0x446c('0xa')](_0x446c('0xb'),attributes,{'tableName':_0x446c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b51=['path','rimraf','../../config/environment','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x2906c6,_0x3c7382){var _0x21b5af=function(_0x37cd9a){while(--_0x37cd9a){_0x2906c6['push'](_0x2906c6['shift']());}};_0x21b5af(++_0x3c7382);}(_0x8b51,0x1bd));var _0x18b5=function(_0x36934d,_0x42f73f){_0x36934d=_0x36934d-0x0;var _0x16052e=_0x8b51[_0x36934d];return _0x16052e;};'use strict';var _=require(_0x18b5('0x0'));var util=require(_0x18b5('0x1'));var logger=require(_0x18b5('0x2'))('api');var moment=require(_0x18b5('0x3'));var BPromise=require(_0x18b5('0x4'));var rp=require(_0x18b5('0x5'));var fs=require('fs');var path=require(_0x18b5('0x6'));var rimraf=require(_0x18b5('0x7'));var config=require(_0x18b5('0x8'));var attributes=require('./userOpenchannelQueue.attributes');module['exports']=function(_0x444433,_0x3a8bc6){return _0x444433['define'](_0x18b5('0x9'),attributes,{'tableName':_0x18b5('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 45ecd1e..584624f 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 _0xa053=['message','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xa053,0x169));var _0x3a05=function(_0x57131b,_0x51dec7){_0x57131b=_0x57131b-0x0;var _0x2559dd=_0xa053[_0x57131b];return _0x2559dd;};'use strict';var _=require(_0x3a05('0x0'));var util=require(_0x3a05('0x1'));var moment=require(_0x3a05('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3a05('0x3'));var db=require(_0x3a05('0x4'))['db'];var utils=require(_0x3a05('0x5'));var logger=require(_0x3a05('0x6'))('rpc');var config=require(_0x3a05('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3a05('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34882c,_0x38664c,_0x254293){return new BPromise(function(_0x1259a2,_0x218277){return client['request'](_0x34882c,_0x254293)[_0x3a05('0x9')](function(_0x211f2d){logger[_0x3a05('0xa')](_0x3a05('0xb'),_0x38664c,_0x3a05('0xc'));logger['debug'](_0x3a05('0xd'),_0x38664c,_0x3a05('0xc'),JSON[_0x3a05('0xe')](_0x211f2d));if(_0x211f2d[_0x3a05('0xf')]){if(_0x211f2d[_0x3a05('0xf')][_0x3a05('0x10')]===0x1f4){logger[_0x3a05('0xf')](_0x3a05('0xb'),_0x38664c,_0x211f2d['error'][_0x3a05('0x11')]);return _0x218277(_0x211f2d[_0x3a05('0xf')][_0x3a05('0x11')]);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x38664c,_0x211f2d[_0x3a05('0xf')][_0x3a05('0x11')]);return _0x1259a2(_0x211f2d['error'][_0x3a05('0x11')]);}else{logger[_0x3a05('0xa')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x38664c,_0x3a05('0xc'));_0x1259a2(_0x211f2d['result'][_0x3a05('0x11')]);}})['catch'](function(_0x2c6553){logger[_0x3a05('0xf')](_0x3a05('0xb'),_0x38664c,_0x2c6553);_0x218277(_0x2c6553);});});} \ No newline at end of file +var _0xb82d=['moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash'];(function(_0x19a10a,_0x4e6832){var _0xbf0b68=function(_0x4bbb6d){while(--_0x4bbb6d){_0x19a10a['push'](_0x19a10a['shift']());}};_0xbf0b68(++_0x4e6832);}(_0xb82d,0x1af));var _0xdb82=function(_0x4e64b5,_0x2a314a){_0x4e64b5=_0x4e64b5-0x0;var _0x37d275=_0xb82d[_0x4e64b5];return _0x37d275;};'use strict';var _=require(_0xdb82('0x0'));var util=require('util');var moment=require(_0xdb82('0x1'));var BPromise=require('bluebird');var rs=require(_0xdb82('0x2'));var fs=require('fs');var Redis=require(_0xdb82('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdb82('0x4'));var logger=require(_0xdb82('0x5'))('rpc');var config=require(_0xdb82('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xdb82('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3555db,_0x587962,_0x30f03a){return new BPromise(function(_0x1c7570,_0xe0de5c){return client[_0xdb82('0x8')](_0x3555db,_0x30f03a)[_0xdb82('0x9')](function(_0x22aa82){logger[_0xdb82('0xa')](_0xdb82('0xb'),_0x587962,_0xdb82('0xc'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x587962,_0xdb82('0xc'),JSON[_0xdb82('0xd')](_0x22aa82));if(_0x22aa82[_0xdb82('0xe')]){if(_0x22aa82[_0xdb82('0xe')][_0xdb82('0xf')]===0x1f4){logger[_0xdb82('0xe')](_0xdb82('0xb'),_0x587962,_0x22aa82['error'][_0xdb82('0x10')]);return _0xe0de5c(_0x22aa82[_0xdb82('0xe')]['message']);}logger[_0xdb82('0xe')](_0xdb82('0xb'),_0x587962,_0x22aa82[_0xdb82('0xe')][_0xdb82('0x10')]);return _0x1c7570(_0x22aa82[_0xdb82('0xe')]['message']);}else{logger[_0xdb82('0xa')](_0xdb82('0xb'),_0x587962,_0xdb82('0xc'));_0x1c7570(_0x22aa82[_0xdb82('0x11')][_0xdb82('0x10')]);}})['catch'](function(_0x485541){logger[_0xdb82('0xe')](_0xdb82('0xb'),_0x587962,_0x485541);_0xe0de5c(_0x485541);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index c451224..ab0015a 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 _0x6e43=['getResources','create','post','/:id/clone','clone','addSections','put','update','destroy','delete','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./userProfile.controller','get','index','/describe','isAuthenticated','/:id','show','getSections','/:id/resources'];(function(_0xb56500,_0x373751){var _0x589ce5=function(_0x526913){while(--_0x526913){_0xb56500['push'](_0xb56500['shift']());}};_0x589ce5(++_0x373751);}(_0x6e43,0x11b));var _0x36e4=function(_0x1aecc3,_0x319f00){_0x1aecc3=_0x1aecc3-0x0;var _0x45d474=_0x6e43[_0x1aecc3];return _0x45d474;};'use strict';var multer=require(_0x36e4('0x0'));var util=require(_0x36e4('0x1'));var path=require(_0x36e4('0x2'));var timeout=require(_0x36e4('0x3'));var express=require(_0x36e4('0x4'));var router=express[_0x36e4('0x5')]();var fs_extra=require(_0x36e4('0x6'));var auth=require(_0x36e4('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x36e4('0x8'));router[_0x36e4('0x9')]('/',auth['isAuthenticated'](),controller[_0x36e4('0xa')]);router[_0x36e4('0x9')](_0x36e4('0xb'),auth[_0x36e4('0xc')](),controller['describe']);router[_0x36e4('0x9')](_0x36e4('0xd'),auth['isAuthenticated'](),controller[_0x36e4('0xe')]);router['get']('/:id/sections',auth[_0x36e4('0xc')](),controller[_0x36e4('0xf')]);router[_0x36e4('0x9')](_0x36e4('0x10'),auth[_0x36e4('0xc')](),controller[_0x36e4('0x11')]);router['post']('/',auth[_0x36e4('0xc')](),controller[_0x36e4('0x12')]);router[_0x36e4('0x13')](_0x36e4('0x14'),auth['isAuthenticated'](),controller[_0x36e4('0x15')]);router[_0x36e4('0x13')]('/:id/sections',auth['isAuthenticated'](),controller[_0x36e4('0x16')]);router['post'](_0x36e4('0x10'),auth[_0x36e4('0xc')](),controller['addResources']);router[_0x36e4('0x17')](_0x36e4('0xd'),auth[_0x36e4('0xc')](),controller[_0x36e4('0x18')]);router['delete'](_0x36e4('0xd'),auth['isAuthenticated'](),controller[_0x36e4('0x19')]);router[_0x36e4('0x1a')]('/:id/sections',auth[_0x36e4('0xc')](),controller[_0x36e4('0x1b')]);router[_0x36e4('0x1a')](_0x36e4('0x10'),auth[_0x36e4('0xc')](),controller[_0x36e4('0x1c')]);module[_0x36e4('0x1d')]=router; \ No newline at end of file +var _0x1ad9=['update','destroy','delete','removeSections','removeResources','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/sections','getSections','getResources','create','post','/:id/clone','clone','addSections','/:id/resources','addResources','put'];(function(_0x1715f8,_0x2ee01a){var _0x54853e=function(_0xc9e425){while(--_0xc9e425){_0x1715f8['push'](_0x1715f8['shift']());}};_0x54853e(++_0x2ee01a);}(_0x1ad9,0x69));var _0x91ad=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0x1ad9[_0xf0bcac];return _0x4e4c65;};'use strict';var multer=require(_0x91ad('0x0'));var util=require(_0x91ad('0x1'));var path=require('path');var timeout=require(_0x91ad('0x2'));var express=require(_0x91ad('0x3'));var router=express[_0x91ad('0x4')]();var fs_extra=require(_0x91ad('0x5'));var auth=require(_0x91ad('0x6'));var interaction=require(_0x91ad('0x7'));var config=require(_0x91ad('0x8'));var controller=require('./userProfile.controller');router[_0x91ad('0x9')]('/',auth[_0x91ad('0xa')](),controller[_0x91ad('0xb')]);router['get'](_0x91ad('0xc'),auth[_0x91ad('0xa')](),controller[_0x91ad('0xd')]);router[_0x91ad('0x9')](_0x91ad('0xe'),auth['isAuthenticated'](),controller[_0x91ad('0xf')]);router[_0x91ad('0x9')](_0x91ad('0x10'),auth[_0x91ad('0xa')](),controller[_0x91ad('0x11')]);router[_0x91ad('0x9')]('/:id/resources',auth[_0x91ad('0xa')](),controller[_0x91ad('0x12')]);router['post']('/',auth[_0x91ad('0xa')](),controller[_0x91ad('0x13')]);router[_0x91ad('0x14')](_0x91ad('0x15'),auth[_0x91ad('0xa')](),controller[_0x91ad('0x16')]);router[_0x91ad('0x14')](_0x91ad('0x10'),auth[_0x91ad('0xa')](),controller[_0x91ad('0x17')]);router[_0x91ad('0x14')](_0x91ad('0x18'),auth[_0x91ad('0xa')](),controller[_0x91ad('0x19')]);router[_0x91ad('0x1a')](_0x91ad('0xe'),auth[_0x91ad('0xa')](),controller[_0x91ad('0x1b')]);router['delete'](_0x91ad('0xe'),auth[_0x91ad('0xa')](),controller[_0x91ad('0x1c')]);router[_0x91ad('0x1d')](_0x91ad('0x10'),auth[_0x91ad('0xa')](),controller[_0x91ad('0x1e')]);router['delete'](_0x91ad('0x18'),auth[_0x91ad('0xa')](),controller[_0x91ad('0x1f')]);module[_0x91ad('0x20')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index d2c402c..fc7e592 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 _0xfcba=['exports','STRING','name','join','getDataValue','crudPermissions','split','BOOLEAN'];(function(_0x1de131,_0x41c6ca){var _0x4d7570=function(_0x3242c4){while(--_0x3242c4){_0x1de131['push'](_0x1de131['shift']());}};_0x4d7570(++_0x41c6ca);}(_0xfcba,0x198));var _0xafcb=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xfcba[_0x2dea24];return _0x309d58;};'use strict';var Sequelize=require('sequelize');module[_0xafcb('0x0')]={'name':{'type':Sequelize[_0xafcb('0x1')],'allowNull':![],'unique':_0xafcb('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x38c3ad){this['setDataValue']('crudPermissions',_0x38c3ad?_0x38c3ad[_0xafcb('0x3')](''):[]);},'get':function(){return this[_0xafcb('0x4')]('crudPermissions')?this[_0xafcb('0x4')](_0xafcb('0x5'))[_0xafcb('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xafcb('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xafcb('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xafcb('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xafcb('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xafcb('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xafcb('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x6bd1=['join','getDataValue','crudPermissions','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue'];(function(_0x37fc07,_0x2ef518){var _0x226b5b=function(_0x28dab2){while(--_0x28dab2){_0x37fc07['push'](_0x37fc07['shift']());}};_0x226b5b(++_0x2ef518);}(_0x6bd1,0x91));var _0x16bd=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x6bd1[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require(_0x16bd('0x0'));module[_0x16bd('0x1')]={'name':{'type':Sequelize[_0x16bd('0x2')],'allowNull':![],'unique':_0x16bd('0x3')},'crudPermissions':{'type':Sequelize[_0x16bd('0x2')],'set':function(_0x57057a){this[_0x16bd('0x4')]('crudPermissions',_0x57057a?_0x57057a[_0x16bd('0x5')](''):[]);},'get':function(){return this[_0x16bd('0x6')](_0x16bd('0x7'))?this[_0x16bd('0x6')]('crudPermissions')[_0x16bd('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x16bd('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x16bd('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x16bd('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x16bd('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x16bd('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x16bd('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x16bd('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index d2e8201..a3264ff 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 _0x77e6=['set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','nolimit','order','sort','where','merge','filter','options','include','findAll','rows','catch','params','intersection','find','create','clone','includeAll','get','omit','updatedAt','crudPermissions','createdAt','sequelize','transaction','body','UserProfileSection','each','autoAssociation','sectionId','Resources','UserProfileResource','destroy','describe','userProfileId','removeSections','ids','getSections','isEmpty','includes','enabled','subsections','push','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../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','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x404df5,_0x159e48){var _0x234a99=function(_0x5e7725){while(--_0x5e7725){_0x404df5['push'](_0x404df5['shift']());}};_0x234a99(++_0x159e48);}(_0x77e6,0x1a6));var _0x677e=function(_0x2a2c95,_0xfb0ab0){_0x2a2c95=_0x2a2c95-0x0;var _0x3db27d=_0x77e6[_0x2a2c95];return _0x3db27d;};'use strict';var emlformat=require(_0x677e('0x0'));var rimraf=require(_0x677e('0x1'));var zipdir=require(_0x677e('0x2'));var jsonpatch=require(_0x677e('0x3'));var rp=require(_0x677e('0x4'));var moment=require(_0x677e('0x5'));var BPromise=require(_0x677e('0x6'));var Mustache=require(_0x677e('0x7'));var util=require('util');var path=require(_0x677e('0x8'));var sox=require(_0x677e('0x9'));var csv=require('to-csv');var ejs=require(_0x677e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x677e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x677e('0xc'));var deskjs=require(_0x677e('0xd'));var toCsv=require(_0x677e('0xe'));var querystring=require(_0x677e('0xf'));var Papa=require('papaparse');var Redis=require(_0x677e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x677e('0x11'));var as=require(_0x677e('0x12'));var hardwareService=require(_0x677e('0x13'));var logger=require(_0x677e('0x14'))(_0x677e('0x15'));var utils=require(_0x677e('0x16'));var config=require(_0x677e('0x17'));var licenseUtil=require(_0x677e('0x18'));var db=require(_0x677e('0x19'))['db'];config[_0x677e('0x1a')]=_[_0x677e('0x1b')](config[_0x677e('0x1a')],{'host':_0x677e('0x1c'),'port':0x18eb});var socket=require(_0x677e('0x1d'))(new Redis(config['redis']));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x213a50,_0x1dbe16){_0x1dbe16=_0x1dbe16||0xcc;return function(_0x105c88){if(_0x105c88){return _0x213a50[_0x677e('0x1e')](_0x1dbe16);}return _0x213a50[_0x677e('0x1f')](_0x1dbe16)[_0x677e('0x20')]();};}function respondWithResult(_0x24c9eb,_0xe88242){_0xe88242=_0xe88242||0xc8;return function(_0x251069){if(_0x251069){return _0x24c9eb[_0x677e('0x1f')](_0xe88242)[_0x677e('0x21')](_0x251069);}};}function respondWithFilteredResult(_0xe4d960,_0x49d428){return function(_0x1c5124){if(_0x1c5124){var _0x2ef2bf=typeof _0x49d428[_0x677e('0x22')]===_0x677e('0x23')&&typeof _0x49d428[_0x677e('0x24')]===_0x677e('0x23');var _0x52f65d=_0x1c5124[_0x677e('0x25')];var _0x4bfbb6=_0x2ef2bf?0x0:_0x49d428[_0x677e('0x22')];var _0x267aac=_0x2ef2bf?_0x1c5124[_0x677e('0x25')]:_0x49d428['offset']+_0x49d428[_0x677e('0x24')];var _0x1a6122;if(_0x267aac>=_0x52f65d){_0x267aac=_0x52f65d;_0x1a6122=0xc8;}else{_0x1a6122=0xce;}_0xe4d960[_0x677e('0x1f')](_0x1a6122);return _0xe4d960[_0x677e('0x26')](_0x677e('0x27'),_0x4bfbb6+'-'+_0x267aac+'/'+_0x52f65d)[_0x677e('0x21')](_0x1c5124);}return null;};}function patchUpdates(_0x3a7895){return function(_0x52ee8b){try{jsonpatch['apply'](_0x52ee8b,_0x3a7895,!![]);}catch(_0x52d915){return BPromise[_0x677e('0x28')](_0x52d915);}return _0x52ee8b[_0x677e('0x29')]();};}function saveUpdates(_0x31a1e4,_0x540d0e){return function(_0x424e5d){if(_0x424e5d){return _0x424e5d[_0x677e('0x2a')](_0x31a1e4)[_0x677e('0x2b')](function(_0x42f2b8){return _0x42f2b8;});}return null;};}function removeEntity(_0x2c51d3,_0x3f0646){return function(_0x5e5397){if(_0x5e5397){return _0x5e5397['destroy']()[_0x677e('0x2b')](function(){_0x2c51d3[_0x677e('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51e39d,_0x264ed3){return function(_0xf6b3ad){if(!_0xf6b3ad){_0x51e39d[_0x677e('0x1e')](0x194);}return _0xf6b3ad;};}function handleError(_0x21a26b,_0x1c0f28){_0x1c0f28=_0x1c0f28||0x1f4;return function(_0x56ad40){logger[_0x677e('0x2c')](_0x56ad40[_0x677e('0x2d')]);if(_0x56ad40[_0x677e('0x2e')]){delete _0x56ad40[_0x677e('0x2e')];}_0x21a26b[_0x677e('0x1f')](_0x1c0f28)[_0x677e('0x2f')](_0x56ad40);};}exports[_0x677e('0x30')]=function(_0x10eb66,_0x9d49b5){var _0x4c5113={},_0x22ccfb={},_0x3cac19={'count':0x0,'rows':[]};var _0x2fb815=_[_0x677e('0x31')](db[_0x677e('0x32')][_0x677e('0x33')],function(_0x34bb3d){return{'name':_0x34bb3d[_0x677e('0x34')],'type':_0x34bb3d[_0x677e('0x35')][_0x677e('0x36')]};});_0x22ccfb['model']=_[_0x677e('0x31')](_0x2fb815,_0x677e('0x2e'));_0x22ccfb[_0x677e('0x37')]=_[_0x677e('0x38')](_0x10eb66[_0x677e('0x37')]);_0x22ccfb[_0x677e('0x39')]=_['intersection'](_0x22ccfb[_0x677e('0x3a')],_0x22ccfb[_0x677e('0x37')]);_0x4c5113[_0x677e('0x3b')]=_['intersection'](_0x22ccfb[_0x677e('0x3a')],qs[_0x677e('0x3c')](_0x10eb66[_0x677e('0x37')][_0x677e('0x3c')]));_0x4c5113[_0x677e('0x3b')]=_0x4c5113['attributes'][_0x677e('0x3d')]?_0x4c5113[_0x677e('0x3b')]:_0x22ccfb[_0x677e('0x3a')];if(!_0x10eb66[_0x677e('0x37')]['hasOwnProperty'](_0x677e('0x3e'))){_0x4c5113[_0x677e('0x24')]=qs[_0x677e('0x24')](_0x10eb66['query']['limit']);_0x4c5113[_0x677e('0x22')]=qs[_0x677e('0x22')](_0x10eb66['query'][_0x677e('0x22')]);}_0x4c5113[_0x677e('0x3f')]=qs['sort'](_0x10eb66['query'][_0x677e('0x40')]);_0x4c5113[_0x677e('0x41')]=qs['filters'](_['pick'](_0x10eb66[_0x677e('0x37')],_0x22ccfb[_0x677e('0x39')]),_0x2fb815);if(_0x10eb66[_0x677e('0x37')]['filter']){_0x4c5113[_0x677e('0x41')]=_[_0x677e('0x42')](_0x4c5113[_0x677e('0x41')],{'$or':_[_0x677e('0x31')](_0x2fb815,function(_0x6756e8){if(_0x6756e8['type']!=='VIRTUAL'){var _0x15faa3={};_0x15faa3[_0x6756e8[_0x677e('0x2e')]]={'$like':'%'+_0x10eb66[_0x677e('0x37')][_0x677e('0x43')]+'%'};return _0x15faa3;}})});}_0x4c5113=_[_0x677e('0x42')]({},_0x4c5113,_0x10eb66[_0x677e('0x44')]);var _0x1b9a35={'where':_0x4c5113[_0x677e('0x41')]};return db[_0x677e('0x32')][_0x677e('0x25')](_0x1b9a35)['then'](function(_0x56eb30){_0x3cac19[_0x677e('0x25')]=_0x56eb30;if(_0x10eb66[_0x677e('0x37')]['includeAll']){_0x4c5113[_0x677e('0x45')]=[{'all':!![]}];}return db['UserProfile'][_0x677e('0x46')](_0x4c5113);})[_0x677e('0x2b')](function(_0x283aaa){_0x3cac19[_0x677e('0x47')]=_0x283aaa;return _0x3cac19;})[_0x677e('0x2b')](respondWithFilteredResult(_0x9d49b5,_0x4c5113))[_0x677e('0x48')](handleError(_0x9d49b5,null));};exports['show']=function(_0x17fe91,_0x1f2bf5){var _0x2c2fd4={'raw':![],'where':{'id':_0x17fe91[_0x677e('0x49')]['id']}},_0x33fce2={};_0x33fce2[_0x677e('0x3a')]=_['keys'](db[_0x677e('0x32')]['rawAttributes']);_0x33fce2[_0x677e('0x37')]=_[_0x677e('0x38')](_0x17fe91[_0x677e('0x37')]);_0x33fce2[_0x677e('0x39')]=_[_0x677e('0x4a')](_0x33fce2[_0x677e('0x3a')],_0x33fce2[_0x677e('0x37')]);_0x2c2fd4[_0x677e('0x3b')]=_[_0x677e('0x4a')](_0x33fce2[_0x677e('0x3a')],qs['fields'](_0x17fe91[_0x677e('0x37')]['fields']));_0x2c2fd4['attributes']=_0x2c2fd4[_0x677e('0x3b')][_0x677e('0x3d')]?_0x2c2fd4[_0x677e('0x3b')]:_0x33fce2[_0x677e('0x3a')];if(_0x17fe91[_0x677e('0x37')]['includeAll']){_0x2c2fd4[_0x677e('0x45')]=[{'all':!![]}];}_0x2c2fd4=_[_0x677e('0x42')]({},_0x2c2fd4,_0x17fe91[_0x677e('0x44')]);return db[_0x677e('0x32')][_0x677e('0x4b')](_0x2c2fd4)['then'](handleEntityNotFound(_0x1f2bf5,null))[_0x677e('0x2b')](respondWithResult(_0x1f2bf5,null))[_0x677e('0x48')](handleError(_0x1f2bf5,null));};exports[_0x677e('0x4c')]=function(_0x496627,_0x30ed5c){return db['UserProfile'][_0x677e('0x4c')](_0x496627['body'],{})['then'](respondWithResult(_0x30ed5c,0xc9))[_0x677e('0x48')](handleError(_0x30ed5c,null));};exports[_0x677e('0x4d')]=function(_0x1f767f,_0x3ff832){var _0x5d8c27={'where':{'id':_0x1f767f[_0x677e('0x49')]['id']}},_0x210f46={};_0x210f46['model']=_[_0x677e('0x38')](db[_0x677e('0x32')][_0x677e('0x33')]);_0x5d8c27[_0x677e('0x3b')]=_[_0x677e('0x4a')](_0x210f46['model'],qs[_0x677e('0x3c')](_0x1f767f['query']['fields']));_0x5d8c27[_0x677e('0x3b')]=_0x5d8c27['attributes'][_0x677e('0x3d')]?_0x5d8c27[_0x677e('0x3b')]:_0x210f46[_0x677e('0x3a')];if(_0x1f767f[_0x677e('0x37')][_0x677e('0x4e')]){_0x5d8c27[_0x677e('0x45')]=[{'all':!![]}];}_0x5d8c27=_[_0x677e('0x42')]({},_0x5d8c27,_0x1f767f['options']);return db['UserProfile']['find'](_0x5d8c27)[_0x677e('0x2b')](handleEntityNotFound(_0x3ff832,null))[_0x677e('0x2b')](function(_0x108d48){if(_0x108d48){var _0x3dd218=_0x108d48[_0x677e('0x4f')]({'plain':!![]});_0x3dd218=qs[_0x677e('0x50')](_0x3dd218,['id','createdAt',_0x677e('0x51'),_0x677e('0x52')]);_0x1f767f['body']=_[_0x677e('0x50')](_0x1f767f['body'],['id',_0x677e('0x53'),_0x677e('0x51')]);return db[_0x677e('0x54')][_0x677e('0x55')](function(_0x495bcf){return db[_0x677e('0x32')]['create'](_[_0x677e('0x42')](_0x3dd218,_0x1f767f[_0x677e('0x56')]),{'include':_0x1f767f[_0x677e('0x37')][_0x677e('0x4e')]?[{'all':!![]}]:undefined,'transaction':_0x495bcf})[_0x677e('0x2b')](function(_0x5044e2){var _0x4ed131=_0x5044e2[_0x677e('0x4f')]({'plain':!![]});return db[_0x677e('0x57')]['findAll']({'where':{'userProfileId':_0x1f767f[_0x677e('0x49')]['id']},'raw':!![]})[_0x677e('0x2b')](function(_0xaa218d){if(_0xaa218d){return BPromise[_0x677e('0x58')](_0xaa218d,function(_0x35c3b7){return new BPromise(function(_0x44988b,_0x52cd04){if(_0x35c3b7[_0x677e('0x59')]===null||_0x35c3b7['autoAssociation']===0x1)_0x44988b(null);return db['UserProfileResource'][_0x677e('0x46')]({'where':{'sectionId':_0x35c3b7['id']},'raw':!![]})['then'](function(_0x5ddc5f){var _0x69c67c=_['map'](_0x5ddc5f,function(_0x2affc1){return qs[_0x677e('0x50')](_0x2affc1,['id','createdAt',_0x677e('0x51'),_0x677e('0x5a')]);});_0x44988b(_0x69c67c);})[_0x677e('0x48')](function(_0x1f11c1){_0x52cd04(_0x1f11c1);});})[_0x677e('0x2b')](function(_0x160edd){var _0x517df4=qs[_0x677e('0x50')](_0x35c3b7,['id',_0x677e('0x53'),_0x677e('0x51')]);_0x517df4['userProfileId']=_0x4ed131['id'];if(_0x160edd)_0x517df4[_0x677e('0x5b')]=_0x160edd;return _0x517df4;})[_0x677e('0x2b')](function(_0x32cc95){return db[_0x677e('0x57')][_0x677e('0x4c')](_0x32cc95,{'include':[{'model':db[_0x677e('0x5c')],'as':_0x677e('0x5b')}],'raw':!![],'transaction':_0x495bcf});});})[_0x677e('0x2b')](function(){return _0x4ed131;});}});});});}})['then'](respondWithResult(_0x3ff832,0xc9))[_0x677e('0x48')](handleError(_0x3ff832,null));};exports[_0x677e('0x2a')]=function(_0x223f61,_0x2fa495){if(_0x223f61[_0x677e('0x56')]['id']){delete _0x223f61['body']['id'];}return db[_0x677e('0x32')][_0x677e('0x4b')]({'where':{'id':_0x223f61[_0x677e('0x49')]['id']}})[_0x677e('0x2b')](handleEntityNotFound(_0x2fa495,null))['then'](saveUpdates(_0x223f61[_0x677e('0x56')],null))[_0x677e('0x2b')](respondWithResult(_0x2fa495,null))[_0x677e('0x48')](handleError(_0x2fa495,null));};exports[_0x677e('0x5d')]=function(_0x42d64d,_0x18c92c){return db[_0x677e('0x32')][_0x677e('0x4b')]({'where':{'id':_0x42d64d[_0x677e('0x49')]['id']}})[_0x677e('0x2b')](handleEntityNotFound(_0x18c92c,null))[_0x677e('0x2b')](removeEntity(_0x18c92c,null))['catch'](handleError(_0x18c92c,null));};exports['describe']=function(_0x1e2568,_0x17613c){return db[_0x677e('0x32')][_0x677e('0x5e')]()[_0x677e('0x2b')](respondWithResult(_0x17613c,null))[_0x677e('0x48')](handleError(_0x17613c,null));};exports['addSections']=function(_0x10cdb6,_0x1a3b1c){var _0x10e3ee=_0x10cdb6[_0x677e('0x56')];return db[_0x677e('0x32')][_0x677e('0x4b')]({'where':{'id':_0x10cdb6['params']['id']}})[_0x677e('0x2b')](handleEntityNotFound(_0x1a3b1c,null))['then'](function(_0x4b7dca){if(_0x4b7dca){return db[_0x677e('0x54')]['transaction'](function(_0x49c583){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x10cdb6[_0x677e('0x49')]['id'],'sectionId':_['map'](_0x10e3ee,function(_0x8f3069){return _0x8f3069[_0x677e('0x5a')];})},'transaction':_0x49c583})['then'](function(){var _0x380281=_[_0x677e('0x31')](_0x10e3ee,function(_0x19fabf){_0x19fabf[_0x677e('0x5f')]=_0x10cdb6[_0x677e('0x49')]['id'];return _0x19fabf;});var _0x3ad539=[];return BPromise['each'](_0x380281,function(_0x15a176){return db['UserProfileSection'][_0x677e('0x4c')](_0x15a176,{'include':[{'model':db['UserProfileResource'],'as':_0x677e('0x5b')}],'raw':!![],'transaction':_0x49c583})[_0x677e('0x2b')](function(_0x9bff3f){_0x3ad539['push'](_0x9bff3f['get']({'plain':!![]}));});})['then'](function(){return _0x3ad539;});});});}})['then'](function(_0x1b4080){return _0x1b4080;})[_0x677e('0x2b')](respondWithResult(_0x1a3b1c,null))[_0x677e('0x48')](handleError(_0x1a3b1c,null));};exports[_0x677e('0x60')]=function(_0xff9fdf,_0x2f9c58){var _0x2b1639;return db[_0x677e('0x32')][_0x677e('0x4b')]({'where':{'id':_0xff9fdf[_0x677e('0x49')]['id']},'attributes':['id',_0x677e('0x2e')]})['then'](handleEntityNotFound(_0x2f9c58,null))[_0x677e('0x2b')](function(_0x358ba9){if(_0x358ba9){_0x2b1639=_0x358ba9;return db['UserProfileSection'][_0x677e('0x5d')]({'where':{'userProfileId':_0xff9fdf[_0x677e('0x49')]['id'],'sectionId':_0xff9fdf[_0x677e('0x37')][_0x677e('0x61')]}});}})[_0x677e('0x2b')](function(){return _0x2b1639;})[_0x677e('0x2b')](respondWithStatusCode(_0x2f9c58,null))[_0x677e('0x48')](handleError(_0x2f9c58,null));};exports[_0x677e('0x62')]=function(_0x147277,_0x52f57d){var _0x4b4895=[];var _0x3bc3e3=[];return db[_0x677e('0x57')][_0x677e('0x46')]({'where':{'userProfileId':_0x147277[_0x677e('0x49')]['id']},'raw':!![]})['then'](function(_0x18e034){_0x4b4895=_[_0x677e('0x43')](_0x18e034,function(_0x1c658b){return _0x1c658b['enabled']===0x1||_['includes']([0x3eb,0x709],_0x1c658b['sectionId']);});if(!_[_0x677e('0x63')](_0x4b4895)){return _[_0x677e('0x31')](_0x4b4895,function(_0x4cc89e){return _0x4cc89e[_0x677e('0x5a')];});}else{return;}})[_0x677e('0x2b')](function(_0x164211){if(_0x164211)_0x3bc3e3=_0x164211;if(_[_0x677e('0x64')](_0x3bc3e3,0x64)){var _0x5603d6=_['find'](_0x4b4895,{'sectionId':0x64});return hasDefaultDashboard(_0x5603d6)[_0x677e('0x2b')](function(_0x2dd4ec){return _[_0x677e('0x31')](_0x4b4895,function(_0x474d77){if(_0x474d77['sectionId']===0x64){_0x474d77['subsections']=_0x2dd4ec;}return _0x474d77;});});}else{return;}})['then'](function(_0x3c2ba0){if(_0x3c2ba0)_0x4b4895=_0x3c2ba0;if(_[_0x677e('0x64')](_0x3bc3e3,0x3eb)){var _0x4c2cf4=_['find'](_0x4b4895,{'sectionId':0x3eb});return getCustomDashboards(_0x4c2cf4)[_0x677e('0x2b')](function(_0x566539){return _['map'](_0x4b4895,function(_0x3e4d40){if(_0x4c2cf4[_0x677e('0x65')]){if(_0x3e4d40[_0x677e('0x5a')]===0x3eb){_0x3e4d40[_0x677e('0x66')]=_0x566539;}}else{if(_0x3e4d40['sectionId']===0x64){_0x3e4d40['subsections']=_0x566539;}}return _0x3e4d40;});});}else{return;}})['then'](function(_0x2affa9){if(_0x2affa9)_0x4b4895=_0x2affa9;if(_[_0x677e('0x64')](_0x3bc3e3,0x709)){var _0x18dd11=_[_0x677e('0x4b')](_0x4b4895,{'sectionId':0x709});return getPlugins(_0x18dd11)[_0x677e('0x2b')](function(_0x1d5561){if(_0x18dd11['enabled']){return _[_0x677e('0x31')](_0x4b4895,function(_0x56df1c){if(_0x56df1c['sectionId']===0x709){_0x56df1c[_0x677e('0x66')]=_0x1d5561;}return _0x56df1c;});}else{var _0x1a1108={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1d5561};var _0x47e578=_[_0x677e('0x31')](_0x4b4895);_0x47e578[_0x677e('0x67')](_0x1a1108);return _0x47e578;}});}else{return;}})[_0x677e('0x2b')](function(_0x4df9ba){if(_0x4df9ba)_0x4b4895=_0x4df9ba;return _['filter'](_0x4b4895,[_0x677e('0x65'),0x1]);})['then'](respondWithResult(_0x52f57d,null))['catch'](handleError(_0x52f57d,null));};function hasDefaultDashboard(_0x205756){var _0x25c4e6=[0x65];return new BPromise(function(_0x37ba8e,_0x4ba87b){try{if(_0x205756['autoAssociation']){_0x37ba8e(_0x25c4e6);}else{return db[_0x677e('0x5c')][_0x677e('0x68')]({'where':{'sectionId':_0x205756['id']},'raw':!![]})[_0x677e('0x2b')](function(_0x4ebfa3){_0x4ebfa3?_0x37ba8e(_0x25c4e6):_0x37ba8e();});}}catch(_0x3f66db){_0x4ba87b(_0x3f66db);}});}function getCustomDashboards(_0x7edc45){var _0x5c8cd9=[];return new BPromise(function(_0x5fc404,_0x5539f3){try{if(_0x7edc45[_0x677e('0x59')]){return db[_0x677e('0x69')]['findAll']({'raw':!![]})[_0x677e('0x2b')](function(_0x12cb20){_0x12cb20[_0x677e('0x6a')](function(_0x5193f6){_0x5c8cd9['push'](_0x5193f6['id']+0x1869f);});_0x5fc404(_0x5c8cd9);});}else{return db['UserProfileResource'][_0x677e('0x46')]({'where':{'sectionId':_0x7edc45['id']},'raw':!![]})[_0x677e('0x2b')](function(_0x17859a){_0x17859a[_0x677e('0x6a')](function(_0x1e73e3){_0x5c8cd9[_0x677e('0x67')](_0x1e73e3[_0x677e('0x6b')]+0x1869f);});_0x5fc404(_0x5c8cd9);});}}catch(_0x24a584){_0x5539f3(_0x24a584);}});}function getPlugins(_0x31ed60){var _0x404a68=[];return new BPromise(function(_0x36823d,_0x1b7db9){try{if(_0x31ed60['autoAssociation']){return db[_0x677e('0x6c')]['findAll']({'raw':!![]})['then'](function(_0x487107){_0x487107[_0x677e('0x6a')](function(_0x3c29df){_0x404a68[_0x677e('0x67')](_0x3c29df['id']+0x15b38);});_0x36823d(_0x404a68);});}else{return db['UserProfileResource'][_0x677e('0x46')]({'where':{'sectionId':_0x31ed60['id']},'raw':!![]})[_0x677e('0x2b')](function(_0x4fd7e1){_0x4fd7e1['forEach'](function(_0x32edc3){_0x404a68['push'](_0x32edc3[_0x677e('0x6b')]+0x15b38);});_0x36823d(_0x404a68);});}}catch(_0x4b6280){_0x1b7db9(_0x4b6280);}});}exports[_0x677e('0x6d')]=function(_0x2171ec,_0x4d24ca){return db[_0x677e('0x32')][_0x677e('0x4b')]({'where':{'id':_0x2171ec[_0x677e('0x49')]['id']}})[_0x677e('0x2b')](handleEntityNotFound(_0x4d24ca,null))[_0x677e('0x2b')](function(_0x3c8ea0){if(_0x3c8ea0){return db[_0x677e('0x54')][_0x677e('0x55')](function(_0x24810f){return db[_0x677e('0x57')]['findAll']({'where':{'userProfileId':_0x2171ec['params']['id']},'attributes':['id'],'raw':!![]})[_0x677e('0x2b')](function(_0x18bc64){if(_0x18bc64){return db[_0x677e('0x57')]['destroy']({'where':{'userProfileId':_0x2171ec[_0x677e('0x49')]['id'],'id':_[_0x677e('0x31')](_0x18bc64,function(_0x12f311){return _0x12f311['id'];})},'transaction':_0x24810f});}})[_0x677e('0x2b')](function(_0x486199){var _0x2f06e7=_[_0x677e('0x31')](_0x2171ec[_0x677e('0x56')],function(_0x343a8e){_0x343a8e['userProfileId']=_0x2171ec['params']['id'];return _0x343a8e;});return db[_0x677e('0x57')][_0x677e('0x6e')](_0x2f06e7,{'raw':!![],'transaction':_0x24810f});})['then'](function(_0x368f80){var _0x163107=_[_0x677e('0x43')](_[_0x677e('0x31')](_0x368f80,function(_0x3c40b2){return _0x3c40b2[_0x677e('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x163107){return db[_0x677e('0x57')][_0x677e('0x46')]({'where':{'userProfileId':_0x2171ec[_0x677e('0x49')]['id'],'sectionId':_[_0x677e('0x31')](_0x163107,function(_0x4a6a8c){return _0x4a6a8c[_0x677e('0x5a')];})},'attributes':['id',_0x677e('0x5a')],'raw':!![]})[_0x677e('0x2b')](function(_0x2a8250){var _0x39ab73=_['map'](_0x2171ec[_0x677e('0x56')],function(_0x6f2bee){_0x6f2bee['userProfileId']=_0x2171ec[_0x677e('0x49')]['id'];return _0x6f2bee;});return db[_0x677e('0x5c')][_0x677e('0x6e')](_0x39ab73,{'raw':!![],'transaction':_0x24810f});});}})[_0x677e('0x48')](handleError(_0x4d24ca,null));});}})['then'](function(_0x39c1c8){var _0x11253d=_['map'](_0x39c1c8,function(_0x3ed608){return _0x3ed608[_0x677e('0x4f')]({'plain':!![]});});})[_0x677e('0x2b')](respondWithResult(_0x4d24ca,null))[_0x677e('0x48')](handleError(_0x4d24ca,null));};exports[_0x677e('0x6f')]=function(_0x577cf8,_0x945235,_0x22ae87){return db[_0x677e('0x32')]['find']({'where':{'id':_0x577cf8[_0x677e('0x49')]['id']}})[_0x677e('0x2b')](handleEntityNotFound(_0x945235,null))['then'](function(_0x8d7c00){if(_0x8d7c00){return _0x8d7c00[_0x677e('0x6f')](_0x577cf8['query'][_0x677e('0x61')]);}})[_0x677e('0x2b')](respondWithStatusCode(_0x945235,null))[_0x677e('0x48')](handleError(_0x945235,null));};exports[_0x677e('0x70')]=function(_0x3ceb0d,_0x2cedf1){var _0x5f4a85={};if(!_0x3ceb0d[_0x677e('0x37')][_0x677e('0x71')])throw new Error('Missing\x20section\x20parameter');if(!_0x3ceb0d[_0x677e('0x37')]['hasOwnProperty']('nolimit')){_0x5f4a85['limit']=qs[_0x677e('0x24')](_0x3ceb0d[_0x677e('0x37')][_0x677e('0x24')]);_0x5f4a85[_0x677e('0x22')]=qs['offset'](_0x3ceb0d['query'][_0x677e('0x22')]);}return db[_0x677e('0x32')]['find']({'where':{'id':_0x3ceb0d[_0x677e('0x49')]['id']}})[_0x677e('0x2b')](function(_0x7c18c1){if(!_0x7c18c1)throw new Error(_0x677e('0x72')+_0x3ceb0d['params']['id']);return db[_0x677e('0x32')]['getResources'](_0x3ceb0d);})[_0x677e('0x2b')](respondWithFilteredResult(_0x2cedf1,_0x5f4a85))['catch'](handleError(_0x2cedf1,null));}; \ No newline at end of file +var _0x2ff5=['forEach','resourceId','Plugin','addResources','bulkCreate','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','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','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','UserProfile','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','clone','omit','updatedAt','body','transaction','get','UserProfileSection','autoAssociation','UserProfileResource','sectionId','createdAt','userProfileId','Resources','find','describe','addSections','sequelize','each','push','removeSections','ids','getSections','enabled','includes','subsections'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x2ff5,0x1d5));var _0x52ff=function(_0x1c58f7,_0x42e68d){_0x1c58f7=_0x1c58f7-0x0;var _0x5ab006=_0x2ff5[_0x1c58f7];return _0x5ab006;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x52ff('0x0'));var zipdir=require(_0x52ff('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x52ff('0x2'));var moment=require(_0x52ff('0x3'));var BPromise=require(_0x52ff('0x4'));var Mustache=require(_0x52ff('0x5'));var util=require(_0x52ff('0x6'));var path=require(_0x52ff('0x7'));var sox=require('sox');var csv=require(_0x52ff('0x8'));var ejs=require(_0x52ff('0x9'));var fs=require('fs');var fs_extra=require(_0x52ff('0xa'));var _=require('lodash');var squel=require(_0x52ff('0xb'));var crypto=require(_0x52ff('0xc'));var jsforce=require(_0x52ff('0xd'));var deskjs=require(_0x52ff('0xe'));var toCsv=require(_0x52ff('0x8'));var querystring=require(_0x52ff('0xf'));var Papa=require(_0x52ff('0x10'));var Redis=require(_0x52ff('0x11'));var authService=require(_0x52ff('0x12'));var qs=require(_0x52ff('0x13'));var as=require(_0x52ff('0x14'));var hardwareService=require(_0x52ff('0x15'));var logger=require(_0x52ff('0x16'))(_0x52ff('0x17'));var utils=require(_0x52ff('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x52ff('0x19')](config['redis'],{'host':_0x52ff('0x1a'),'port':0x18eb});var socket=require(_0x52ff('0x1b'))(new Redis(config['redis']));require(_0x52ff('0x1c'))[_0x52ff('0x1d')](socket);function respondWithStatusCode(_0x3c787b,_0x2023d3){_0x2023d3=_0x2023d3||0xcc;return function(_0x418202){if(_0x418202){return _0x3c787b[_0x52ff('0x1e')](_0x2023d3);}return _0x3c787b['status'](_0x2023d3)[_0x52ff('0x1f')]();};}function respondWithResult(_0x2b8846,_0x3154b7){_0x3154b7=_0x3154b7||0xc8;return function(_0x4c83f){if(_0x4c83f){return _0x2b8846[_0x52ff('0x20')](_0x3154b7)[_0x52ff('0x21')](_0x4c83f);}};}function respondWithFilteredResult(_0x4ef571,_0x426858){return function(_0x154419){if(_0x154419){var _0x3cbe60=typeof _0x426858[_0x52ff('0x22')]==='undefined'&&typeof _0x426858[_0x52ff('0x23')]===_0x52ff('0x24');var _0xdb6659=_0x154419[_0x52ff('0x25')];var _0x3d008d=_0x3cbe60?0x0:_0x426858[_0x52ff('0x22')];var _0x2ba460=_0x3cbe60?_0x154419[_0x52ff('0x25')]:_0x426858[_0x52ff('0x22')]+_0x426858[_0x52ff('0x23')];var _0x30c1e9;if(_0x2ba460>=_0xdb6659){_0x2ba460=_0xdb6659;_0x30c1e9=0xc8;}else{_0x30c1e9=0xce;}_0x4ef571[_0x52ff('0x20')](_0x30c1e9);return _0x4ef571[_0x52ff('0x26')](_0x52ff('0x27'),_0x3d008d+'-'+_0x2ba460+'/'+_0xdb6659)[_0x52ff('0x21')](_0x154419);}return null;};}function patchUpdates(_0xe68eb5){return function(_0x1414c3){try{jsonpatch[_0x52ff('0x28')](_0x1414c3,_0xe68eb5,!![]);}catch(_0x556779){return BPromise[_0x52ff('0x29')](_0x556779);}return _0x1414c3[_0x52ff('0x2a')]();};}function saveUpdates(_0x1272ac,_0x3accd4){return function(_0x55f32d){if(_0x55f32d){return _0x55f32d[_0x52ff('0x2b')](_0x1272ac)[_0x52ff('0x2c')](function(_0x888232){return _0x888232;});}return null;};}function removeEntity(_0x5a6ebc,_0x5b8905){return function(_0x1ac770){if(_0x1ac770){return _0x1ac770[_0x52ff('0x2d')]()[_0x52ff('0x2c')](function(){_0x5a6ebc[_0x52ff('0x20')](0xcc)[_0x52ff('0x1f')]();});}};}function handleEntityNotFound(_0x1d9b8e,_0x25450b){return function(_0x322260){if(!_0x322260){_0x1d9b8e[_0x52ff('0x1e')](0x194);}return _0x322260;};}function handleError(_0x3a049f,_0xd95637){_0xd95637=_0xd95637||0x1f4;return function(_0x24094b){logger[_0x52ff('0x2e')](_0x24094b[_0x52ff('0x2f')]);if(_0x24094b['name']){delete _0x24094b[_0x52ff('0x30')];}_0x3a049f['status'](_0xd95637)[_0x52ff('0x31')](_0x24094b);};}exports[_0x52ff('0x32')]=function(_0x530abb,_0x2d1cba){var _0x326d23={},_0x264c7c={},_0x2e6c9a={'count':0x0,'rows':[]};var _0x50fd8b=_[_0x52ff('0x33')](db[_0x52ff('0x34')]['rawAttributes'],function(_0x603c97){return{'name':_0x603c97[_0x52ff('0x35')],'type':_0x603c97[_0x52ff('0x36')][_0x52ff('0x37')]};});_0x264c7c['model']=_[_0x52ff('0x33')](_0x50fd8b,_0x52ff('0x30'));_0x264c7c['query']=_[_0x52ff('0x38')](_0x530abb[_0x52ff('0x39')]);_0x264c7c[_0x52ff('0x3a')]=_[_0x52ff('0x3b')](_0x264c7c['model'],_0x264c7c[_0x52ff('0x39')]);_0x326d23['attributes']=_[_0x52ff('0x3b')](_0x264c7c[_0x52ff('0x3c')],qs['fields'](_0x530abb[_0x52ff('0x39')][_0x52ff('0x3d')]));_0x326d23[_0x52ff('0x3e')]=_0x326d23['attributes']['length']?_0x326d23[_0x52ff('0x3e')]:_0x264c7c['model'];if(!_0x530abb[_0x52ff('0x39')]['hasOwnProperty'](_0x52ff('0x3f'))){_0x326d23[_0x52ff('0x23')]=qs['limit'](_0x530abb[_0x52ff('0x39')][_0x52ff('0x23')]);_0x326d23[_0x52ff('0x22')]=qs[_0x52ff('0x22')](_0x530abb[_0x52ff('0x39')][_0x52ff('0x22')]);}_0x326d23[_0x52ff('0x40')]=qs['sort'](_0x530abb[_0x52ff('0x39')][_0x52ff('0x41')]);_0x326d23[_0x52ff('0x42')]=qs[_0x52ff('0x3a')](_[_0x52ff('0x43')](_0x530abb[_0x52ff('0x39')],_0x264c7c[_0x52ff('0x3a')]),_0x50fd8b);if(_0x530abb['query'][_0x52ff('0x44')]){_0x326d23[_0x52ff('0x42')]=_[_0x52ff('0x45')](_0x326d23['where'],{'$or':_['map'](_0x50fd8b,function(_0x3c680b){if(_0x3c680b['type']!==_0x52ff('0x46')){var _0xbbfef8={};_0xbbfef8[_0x3c680b[_0x52ff('0x30')]]={'$like':'%'+_0x530abb[_0x52ff('0x39')][_0x52ff('0x44')]+'%'};return _0xbbfef8;}})});}_0x326d23=_[_0x52ff('0x45')]({},_0x326d23,_0x530abb[_0x52ff('0x47')]);var _0x18a780={'where':_0x326d23[_0x52ff('0x42')]};return db['UserProfile'][_0x52ff('0x25')](_0x18a780)[_0x52ff('0x2c')](function(_0x5a5c37){_0x2e6c9a[_0x52ff('0x25')]=_0x5a5c37;if(_0x530abb[_0x52ff('0x39')][_0x52ff('0x48')]){_0x326d23[_0x52ff('0x49')]=[{'all':!![]}];}return db[_0x52ff('0x34')][_0x52ff('0x4a')](_0x326d23);})[_0x52ff('0x2c')](function(_0x4f18ee){_0x2e6c9a[_0x52ff('0x4b')]=_0x4f18ee;return _0x2e6c9a;})[_0x52ff('0x2c')](respondWithFilteredResult(_0x2d1cba,_0x326d23))[_0x52ff('0x4c')](handleError(_0x2d1cba,null));};exports[_0x52ff('0x4d')]=function(_0x571b8e,_0x4fee7d){var _0x304c80={'raw':![],'where':{'id':_0x571b8e[_0x52ff('0x4e')]['id']}},_0x30c868={};_0x30c868[_0x52ff('0x3c')]=_[_0x52ff('0x38')](db['UserProfile'][_0x52ff('0x4f')]);_0x30c868[_0x52ff('0x39')]=_[_0x52ff('0x38')](_0x571b8e[_0x52ff('0x39')]);_0x30c868[_0x52ff('0x3a')]=_[_0x52ff('0x3b')](_0x30c868[_0x52ff('0x3c')],_0x30c868[_0x52ff('0x39')]);_0x304c80[_0x52ff('0x3e')]=_[_0x52ff('0x3b')](_0x30c868['model'],qs[_0x52ff('0x3d')](_0x571b8e[_0x52ff('0x39')][_0x52ff('0x3d')]));_0x304c80[_0x52ff('0x3e')]=_0x304c80[_0x52ff('0x3e')]['length']?_0x304c80[_0x52ff('0x3e')]:_0x30c868[_0x52ff('0x3c')];if(_0x571b8e['query'][_0x52ff('0x48')]){_0x304c80[_0x52ff('0x49')]=[{'all':!![]}];}_0x304c80=_[_0x52ff('0x45')]({},_0x304c80,_0x571b8e[_0x52ff('0x47')]);return db['UserProfile']['find'](_0x304c80)[_0x52ff('0x2c')](handleEntityNotFound(_0x4fee7d,null))[_0x52ff('0x2c')](respondWithResult(_0x4fee7d,null))[_0x52ff('0x4c')](handleError(_0x4fee7d,null));};exports[_0x52ff('0x50')]=function(_0x427d52,_0xb31bad){return db[_0x52ff('0x34')]['create'](_0x427d52['body'],{})[_0x52ff('0x2c')](respondWithResult(_0xb31bad,0xc9))[_0x52ff('0x4c')](handleError(_0xb31bad,null));};exports[_0x52ff('0x51')]=function(_0x172701,_0x3ab361){var _0x2acff8={'where':{'id':_0x172701[_0x52ff('0x4e')]['id']}},_0x3bf84f={};_0x3bf84f[_0x52ff('0x3c')]=_['keys'](db[_0x52ff('0x34')][_0x52ff('0x4f')]);_0x2acff8[_0x52ff('0x3e')]=_[_0x52ff('0x3b')](_0x3bf84f[_0x52ff('0x3c')],qs['fields'](_0x172701[_0x52ff('0x39')][_0x52ff('0x3d')]));_0x2acff8[_0x52ff('0x3e')]=_0x2acff8[_0x52ff('0x3e')]['length']?_0x2acff8[_0x52ff('0x3e')]:_0x3bf84f[_0x52ff('0x3c')];if(_0x172701[_0x52ff('0x39')][_0x52ff('0x48')]){_0x2acff8[_0x52ff('0x49')]=[{'all':!![]}];}_0x2acff8=_[_0x52ff('0x45')]({},_0x2acff8,_0x172701['options']);return db[_0x52ff('0x34')]['find'](_0x2acff8)[_0x52ff('0x2c')](handleEntityNotFound(_0x3ab361,null))[_0x52ff('0x2c')](function(_0x445cb2){if(_0x445cb2){var _0x1445cf=_0x445cb2['get']({'plain':!![]});_0x1445cf=qs[_0x52ff('0x52')](_0x1445cf,['id','createdAt',_0x52ff('0x53'),'crudPermissions']);_0x172701['body']=_[_0x52ff('0x52')](_0x172701[_0x52ff('0x54')],['id','createdAt',_0x52ff('0x53')]);return db['sequelize'][_0x52ff('0x55')](function(_0x4c95ec){return db[_0x52ff('0x34')][_0x52ff('0x50')](_[_0x52ff('0x45')](_0x1445cf,_0x172701[_0x52ff('0x54')]),{'include':_0x172701['query'][_0x52ff('0x48')]?[{'all':!![]}]:undefined,'transaction':_0x4c95ec})[_0x52ff('0x2c')](function(_0x312c48){var _0x30a071=_0x312c48[_0x52ff('0x56')]({'plain':!![]});return db[_0x52ff('0x57')][_0x52ff('0x4a')]({'where':{'userProfileId':_0x172701['params']['id']},'raw':!![]})['then'](function(_0x4801c3){if(_0x4801c3){return BPromise['each'](_0x4801c3,function(_0x2c1fe9){return new BPromise(function(_0x1e77ad,_0x364fb3){if(_0x2c1fe9[_0x52ff('0x58')]===null||_0x2c1fe9[_0x52ff('0x58')]===0x1)_0x1e77ad(null);return db[_0x52ff('0x59')]['findAll']({'where':{'sectionId':_0x2c1fe9['id']},'raw':!![]})[_0x52ff('0x2c')](function(_0x3443f6){var _0x286dbd=_[_0x52ff('0x33')](_0x3443f6,function(_0x40460f){return qs[_0x52ff('0x52')](_0x40460f,['id','createdAt',_0x52ff('0x53'),_0x52ff('0x5a')]);});_0x1e77ad(_0x286dbd);})[_0x52ff('0x4c')](function(_0x42fadc){_0x364fb3(_0x42fadc);});})[_0x52ff('0x2c')](function(_0x35ec14){var _0x39ed64=qs[_0x52ff('0x52')](_0x2c1fe9,['id',_0x52ff('0x5b'),_0x52ff('0x53')]);_0x39ed64[_0x52ff('0x5c')]=_0x30a071['id'];if(_0x35ec14)_0x39ed64[_0x52ff('0x5d')]=_0x35ec14;return _0x39ed64;})[_0x52ff('0x2c')](function(_0x265370){return db['UserProfileSection'][_0x52ff('0x50')](_0x265370,{'include':[{'model':db[_0x52ff('0x59')],'as':_0x52ff('0x5d')}],'raw':!![],'transaction':_0x4c95ec});});})[_0x52ff('0x2c')](function(){return _0x30a071;});}});});});}})[_0x52ff('0x2c')](respondWithResult(_0x3ab361,0xc9))[_0x52ff('0x4c')](handleError(_0x3ab361,null));};exports[_0x52ff('0x2b')]=function(_0x568e17,_0xfc9c40){if(_0x568e17[_0x52ff('0x54')]['id']){delete _0x568e17[_0x52ff('0x54')]['id'];}return db[_0x52ff('0x34')]['find']({'where':{'id':_0x568e17[_0x52ff('0x4e')]['id']}})[_0x52ff('0x2c')](handleEntityNotFound(_0xfc9c40,null))[_0x52ff('0x2c')](saveUpdates(_0x568e17[_0x52ff('0x54')],null))[_0x52ff('0x2c')](respondWithResult(_0xfc9c40,null))[_0x52ff('0x4c')](handleError(_0xfc9c40,null));};exports[_0x52ff('0x2d')]=function(_0x4a26ef,_0x186534){return db[_0x52ff('0x34')][_0x52ff('0x5e')]({'where':{'id':_0x4a26ef[_0x52ff('0x4e')]['id']}})[_0x52ff('0x2c')](handleEntityNotFound(_0x186534,null))[_0x52ff('0x2c')](removeEntity(_0x186534,null))[_0x52ff('0x4c')](handleError(_0x186534,null));};exports[_0x52ff('0x5f')]=function(_0x1e66fd,_0x565a82){return db['UserProfile'][_0x52ff('0x5f')]()[_0x52ff('0x2c')](respondWithResult(_0x565a82,null))[_0x52ff('0x4c')](handleError(_0x565a82,null));};exports[_0x52ff('0x60')]=function(_0xef16d6,_0x3abae0){var _0xdc235b=_0xef16d6[_0x52ff('0x54')];return db[_0x52ff('0x34')][_0x52ff('0x5e')]({'where':{'id':_0xef16d6['params']['id']}})['then'](handleEntityNotFound(_0x3abae0,null))[_0x52ff('0x2c')](function(_0x353a99){if(_0x353a99){return db[_0x52ff('0x61')][_0x52ff('0x55')](function(_0x1c6ec0){return db[_0x52ff('0x57')][_0x52ff('0x2d')]({'where':{'userProfileId':_0xef16d6[_0x52ff('0x4e')]['id'],'sectionId':_[_0x52ff('0x33')](_0xdc235b,function(_0x316e6){return _0x316e6['sectionId'];})},'transaction':_0x1c6ec0})[_0x52ff('0x2c')](function(){var _0x18c357=_[_0x52ff('0x33')](_0xdc235b,function(_0x33db64){_0x33db64[_0x52ff('0x5c')]=_0xef16d6[_0x52ff('0x4e')]['id'];return _0x33db64;});var _0x4d90ea=[];return BPromise[_0x52ff('0x62')](_0x18c357,function(_0x47f07d){return db[_0x52ff('0x57')]['create'](_0x47f07d,{'include':[{'model':db['UserProfileResource'],'as':_0x52ff('0x5d')}],'raw':!![],'transaction':_0x1c6ec0})[_0x52ff('0x2c')](function(_0x51da79){_0x4d90ea[_0x52ff('0x63')](_0x51da79[_0x52ff('0x56')]({'plain':!![]}));});})[_0x52ff('0x2c')](function(){return _0x4d90ea;});});});}})[_0x52ff('0x2c')](function(_0xb259d7){return _0xb259d7;})['then'](respondWithResult(_0x3abae0,null))[_0x52ff('0x4c')](handleError(_0x3abae0,null));};exports[_0x52ff('0x64')]=function(_0x70737f,_0x39d146){var _0x4f1e54;return db[_0x52ff('0x34')][_0x52ff('0x5e')]({'where':{'id':_0x70737f[_0x52ff('0x4e')]['id']},'attributes':['id',_0x52ff('0x30')]})['then'](handleEntityNotFound(_0x39d146,null))['then'](function(_0x3a053d){if(_0x3a053d){_0x4f1e54=_0x3a053d;return db[_0x52ff('0x57')][_0x52ff('0x2d')]({'where':{'userProfileId':_0x70737f[_0x52ff('0x4e')]['id'],'sectionId':_0x70737f[_0x52ff('0x39')][_0x52ff('0x65')]}});}})['then'](function(){return _0x4f1e54;})[_0x52ff('0x2c')](respondWithStatusCode(_0x39d146,null))[_0x52ff('0x4c')](handleError(_0x39d146,null));};exports[_0x52ff('0x66')]=function(_0x17c41f,_0x427ab4){var _0x1ce2f8=[];var _0x7d530b=[];return db['UserProfileSection'][_0x52ff('0x4a')]({'where':{'userProfileId':_0x17c41f['params']['id']},'raw':!![]})[_0x52ff('0x2c')](function(_0x2396b4){_0x1ce2f8=_[_0x52ff('0x44')](_0x2396b4,function(_0x313376){return _0x313376[_0x52ff('0x67')]===0x1||_[_0x52ff('0x68')]([0x3eb,0x709],_0x313376[_0x52ff('0x5a')]);});if(!_['isEmpty'](_0x1ce2f8)){return _[_0x52ff('0x33')](_0x1ce2f8,function(_0x132537){return _0x132537[_0x52ff('0x5a')];});}else{return;}})[_0x52ff('0x2c')](function(_0x56c794){if(_0x56c794)_0x7d530b=_0x56c794;if(_[_0x52ff('0x68')](_0x7d530b,0x64)){var _0x3539fa=_['find'](_0x1ce2f8,{'sectionId':0x64});return hasDefaultDashboard(_0x3539fa)[_0x52ff('0x2c')](function(_0x36a4c5){return _[_0x52ff('0x33')](_0x1ce2f8,function(_0x312165){if(_0x312165[_0x52ff('0x5a')]===0x64){_0x312165['subsections']=_0x36a4c5;}return _0x312165;});});}else{return;}})[_0x52ff('0x2c')](function(_0x136ebb){if(_0x136ebb)_0x1ce2f8=_0x136ebb;if(_[_0x52ff('0x68')](_0x7d530b,0x3eb)){var _0x2ef3dc=_[_0x52ff('0x5e')](_0x1ce2f8,{'sectionId':0x3eb});return getCustomDashboards(_0x2ef3dc)[_0x52ff('0x2c')](function(_0x2f588c){return _[_0x52ff('0x33')](_0x1ce2f8,function(_0x584ec0){if(_0x2ef3dc[_0x52ff('0x67')]){if(_0x584ec0[_0x52ff('0x5a')]===0x3eb){_0x584ec0[_0x52ff('0x69')]=_0x2f588c;}}else{if(_0x584ec0[_0x52ff('0x5a')]===0x64){_0x584ec0[_0x52ff('0x69')]=_0x2f588c;}}return _0x584ec0;});});}else{return;}})['then'](function(_0x429292){if(_0x429292)_0x1ce2f8=_0x429292;if(_[_0x52ff('0x68')](_0x7d530b,0x709)){var _0x5ebcdb=_[_0x52ff('0x5e')](_0x1ce2f8,{'sectionId':0x709});return getPlugins(_0x5ebcdb)['then'](function(_0x1ef0aa){if(_0x5ebcdb[_0x52ff('0x67')]){return _['map'](_0x1ce2f8,function(_0x4e4816){if(_0x4e4816[_0x52ff('0x5a')]===0x709){_0x4e4816[_0x52ff('0x69')]=_0x1ef0aa;}return _0x4e4816;});}else{var _0x21ea9d={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1ef0aa};var _0x3e5036=_[_0x52ff('0x33')](_0x1ce2f8);_0x3e5036[_0x52ff('0x63')](_0x21ea9d);return _0x3e5036;}});}else{return;}})[_0x52ff('0x2c')](function(_0x43fd1c){if(_0x43fd1c)_0x1ce2f8=_0x43fd1c;return _[_0x52ff('0x44')](_0x1ce2f8,['enabled',0x1]);})[_0x52ff('0x2c')](respondWithResult(_0x427ab4,null))[_0x52ff('0x4c')](handleError(_0x427ab4,null));};function hasDefaultDashboard(_0xa1335a){var _0x196430=[0x65];return new BPromise(function(_0x897df2,_0x2feb08){try{if(_0xa1335a[_0x52ff('0x58')]){_0x897df2(_0x196430);}else{return db[_0x52ff('0x59')]['findOne']({'where':{'sectionId':_0xa1335a['id']},'raw':!![]})[_0x52ff('0x2c')](function(_0x38ec5c){_0x38ec5c?_0x897df2(_0x196430):_0x897df2();});}}catch(_0x281b67){_0x2feb08(_0x281b67);}});}function getCustomDashboards(_0x47463f){var _0x4db09d=[];return new BPromise(function(_0x1af88e,_0x47e1e7){try{if(_0x47463f['autoAssociation']){return db['Dashboard'][_0x52ff('0x4a')]({'raw':!![]})[_0x52ff('0x2c')](function(_0xaf330b){_0xaf330b[_0x52ff('0x6a')](function(_0x560700){_0x4db09d[_0x52ff('0x63')](_0x560700['id']+0x1869f);});_0x1af88e(_0x4db09d);});}else{return db[_0x52ff('0x59')][_0x52ff('0x4a')]({'where':{'sectionId':_0x47463f['id']},'raw':!![]})[_0x52ff('0x2c')](function(_0x314a18){_0x314a18[_0x52ff('0x6a')](function(_0xb008ab){_0x4db09d[_0x52ff('0x63')](_0xb008ab[_0x52ff('0x6b')]+0x1869f);});_0x1af88e(_0x4db09d);});}}catch(_0x15e563){_0x47e1e7(_0x15e563);}});}function getPlugins(_0x5c6574){var _0x16932d=[];return new BPromise(function(_0x3e51ce,_0x41b62c){try{if(_0x5c6574[_0x52ff('0x58')]){return db[_0x52ff('0x6c')][_0x52ff('0x4a')]({'raw':!![]})[_0x52ff('0x2c')](function(_0x51e380){_0x51e380[_0x52ff('0x6a')](function(_0xcc8a3){_0x16932d[_0x52ff('0x63')](_0xcc8a3['id']+0x15b38);});_0x3e51ce(_0x16932d);});}else{return db['UserProfileResource'][_0x52ff('0x4a')]({'where':{'sectionId':_0x5c6574['id']},'raw':!![]})[_0x52ff('0x2c')](function(_0x4aa08e){_0x4aa08e['forEach'](function(_0x4bab0b){_0x16932d[_0x52ff('0x63')](_0x4bab0b[_0x52ff('0x6b')]+0x15b38);});_0x3e51ce(_0x16932d);});}}catch(_0x19b603){_0x41b62c(_0x19b603);}});}exports[_0x52ff('0x6d')]=function(_0x38b25a,_0x56fef6){return db[_0x52ff('0x34')][_0x52ff('0x5e')]({'where':{'id':_0x38b25a[_0x52ff('0x4e')]['id']}})[_0x52ff('0x2c')](handleEntityNotFound(_0x56fef6,null))[_0x52ff('0x2c')](function(_0x14ee25){if(_0x14ee25){return db[_0x52ff('0x61')][_0x52ff('0x55')](function(_0x450f2f){return db[_0x52ff('0x57')][_0x52ff('0x4a')]({'where':{'userProfileId':_0x38b25a[_0x52ff('0x4e')]['id']},'attributes':['id'],'raw':!![]})[_0x52ff('0x2c')](function(_0x285192){if(_0x285192){return db[_0x52ff('0x57')][_0x52ff('0x2d')]({'where':{'userProfileId':_0x38b25a[_0x52ff('0x4e')]['id'],'id':_[_0x52ff('0x33')](_0x285192,function(_0x5087af){return _0x5087af['id'];})},'transaction':_0x450f2f});}})[_0x52ff('0x2c')](function(_0x3abbf9){var _0x3b024a=_[_0x52ff('0x33')](_0x38b25a[_0x52ff('0x54')],function(_0x3c2ddb){_0x3c2ddb['userProfileId']=_0x38b25a['params']['id'];return _0x3c2ddb;});return db[_0x52ff('0x57')][_0x52ff('0x6e')](_0x3b024a,{'raw':!![],'transaction':_0x450f2f});})[_0x52ff('0x2c')](function(_0x3e10b2){var _0x58076a=_[_0x52ff('0x44')](_[_0x52ff('0x33')](_0x3e10b2,function(_0x1fdc86){return _0x1fdc86[_0x52ff('0x56')]({'plain':!![]});}),{'includeAll':![]});if(_0x58076a){return db[_0x52ff('0x57')][_0x52ff('0x4a')]({'where':{'userProfileId':_0x38b25a[_0x52ff('0x4e')]['id'],'sectionId':_[_0x52ff('0x33')](_0x58076a,function(_0x257d03){return _0x257d03[_0x52ff('0x5a')];})},'attributes':['id',_0x52ff('0x5a')],'raw':!![]})['then'](function(_0x1bfcd4){var _0xdc2520=_['map'](_0x38b25a[_0x52ff('0x54')],function(_0xa2db0a){_0xa2db0a[_0x52ff('0x5c')]=_0x38b25a[_0x52ff('0x4e')]['id'];return _0xa2db0a;});return db[_0x52ff('0x59')][_0x52ff('0x6e')](_0xdc2520,{'raw':!![],'transaction':_0x450f2f});});}})['catch'](handleError(_0x56fef6,null));});}})[_0x52ff('0x2c')](function(_0x4e0eb1){var _0x13259e=_[_0x52ff('0x33')](_0x4e0eb1,function(_0x32de71){return _0x32de71[_0x52ff('0x56')]({'plain':!![]});});})[_0x52ff('0x2c')](respondWithResult(_0x56fef6,null))[_0x52ff('0x4c')](handleError(_0x56fef6,null));};exports['removeResources']=function(_0x2b6eeb,_0x13d7ad,_0x6a3192){return db[_0x52ff('0x34')]['find']({'where':{'id':_0x2b6eeb[_0x52ff('0x4e')]['id']}})[_0x52ff('0x2c')](handleEntityNotFound(_0x13d7ad,null))[_0x52ff('0x2c')](function(_0x318514){if(_0x318514){return _0x318514['removeResources'](_0x2b6eeb[_0x52ff('0x39')][_0x52ff('0x65')]);}})[_0x52ff('0x2c')](respondWithStatusCode(_0x13d7ad,null))[_0x52ff('0x4c')](handleError(_0x13d7ad,null));};exports[_0x52ff('0x6f')]=function(_0x1eeb9d,_0x449d6a){var _0x1a1b6c={};if(!_0x1eeb9d[_0x52ff('0x39')][_0x52ff('0x70')])throw new Error(_0x52ff('0x71'));if(!_0x1eeb9d['query'][_0x52ff('0x72')](_0x52ff('0x3f'))){_0x1a1b6c['limit']=qs[_0x52ff('0x23')](_0x1eeb9d[_0x52ff('0x39')][_0x52ff('0x23')]);_0x1a1b6c[_0x52ff('0x22')]=qs[_0x52ff('0x22')](_0x1eeb9d[_0x52ff('0x39')][_0x52ff('0x22')]);}return db[_0x52ff('0x34')][_0x52ff('0x5e')]({'where':{'id':_0x1eeb9d[_0x52ff('0x4e')]['id']}})['then'](function(_0x30d7ef){if(!_0x30d7ef)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x1eeb9d[_0x52ff('0x4e')]['id']);return db[_0x52ff('0x34')][_0x52ff('0x6f')](_0x1eeb9d);})[_0x52ff('0x2c')](respondWithFilteredResult(_0x449d6a,_0x1a1b6c))[_0x52ff('0x4c')](handleError(_0x449d6a,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index e8a2ce8..0cd7440 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 _0x9ab8=['exports','events','../../mysqldb','UserProfile','update','emit','hasOwnProperty','hook'];(function(_0x29733c,_0x2da30b){var _0x49e72f=function(_0x405c92){while(--_0x405c92){_0x29733c['push'](_0x29733c['shift']());}};_0x49e72f(++_0x2da30b);}(_0x9ab8,0x81));var _0x89ab=function(_0x3677ae,_0x530d0c){_0x3677ae=_0x3677ae-0x0;var _0x1f68ff=_0x9ab8[_0x3677ae];return _0x1f68ff;};'use strict';var EventEmitter=require(_0x89ab('0x0'));var UserProfile=require(_0x89ab('0x1'))['db'][_0x89ab('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x89ab('0x3'),'afterDestroy':'remove'};function emitEvent(_0x52a059){return function(_0x490c1e,_0x50b72d,_0x19fc7e){UserProfileEvents[_0x89ab('0x4')](_0x52a059+':'+_0x490c1e['id'],_0x490c1e);UserProfileEvents[_0x89ab('0x4')](_0x52a059,_0x490c1e);_0x19fc7e(null);};}for(var e in events){if(events[_0x89ab('0x5')](e)){var event=events[e];UserProfile[_0x89ab('0x6')](e,emitEvent(event));}}module[_0x89ab('0x7')]=UserProfileEvents; \ No newline at end of file +var _0xffd6=['../../mysqldb','UserProfile','update','remove','emit','hook','exports','events'];(function(_0x3c858f,_0x235201){var _0x198090=function(_0xc4c406){while(--_0xc4c406){_0x3c858f['push'](_0x3c858f['shift']());}};_0x198090(++_0x235201);}(_0xffd6,0x97));var _0x6ffd=function(_0xfb0cfd,_0x500179){_0xfb0cfd=_0xfb0cfd-0x0;var _0x2fd8aa=_0xffd6[_0xfb0cfd];return _0x2fd8aa;};'use strict';var EventEmitter=require(_0x6ffd('0x0'));var UserProfile=require(_0x6ffd('0x1'))['db'][_0x6ffd('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6ffd('0x3'),'afterDestroy':_0x6ffd('0x4')};function emitEvent(_0x39fd49){return function(_0x560afa,_0x1d12e3,_0x173979){UserProfileEvents[_0x6ffd('0x5')](_0x39fd49+':'+_0x560afa['id'],_0x560afa);UserProfileEvents[_0x6ffd('0x5')](_0x39fd49,_0x560afa);_0x173979(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x6ffd('0x6')](e,emitEvent(event));}}module[_0x6ffd('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 51a2d97..007047f 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 _0xe2bd=['CmCustomField','chatwebsites','faxqueues','FaxAccount','inboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','name','role','agent','membername','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','ivrcampaigns','mailqueues','MailQueue','mailaccounts','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','teams','voicequeues','queuecampaigns','users','User','admin','user','Telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','pauses','Pause','scheduler','Schedule','sounds','templates','Template','triggers','Trigger','Trunk','variables','Variable','plugins','Plugin','AnalyticExtractedReport','Reports','metrics','AnalyticMetric','toUpperCase','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','UserProfile','user_profiles','raw','section','Invalid\x20section\x20\x27','isEmpty','find','params','all','union','length','ignore','push','autoAssociation','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','filters','pick','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','include','reportType','default','reportId','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','Tag','color','tag','ThroughTags','openTabs','true','chat','dataValues','sms','fax','mail','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','models','filter','value','then','associatedResources','catch','field','model','findAll','map','UserProfileResource','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projects','JscriptyProject','contacts','CmContact','Lists','lists','CmCompany','globalcustomfields'];(function(_0x136fb3,_0x14fbeb){var _0x3d52d8=function(_0x391c7d){while(--_0x391c7d){_0x136fb3['push'](_0x136fb3['shift']());}};_0x3d52d8(++_0x14fbeb);}(_0xe2bd,0xa1));var _0xde2b=function(_0x115dfa,_0xa32a7b){_0x115dfa=_0x115dfa-0x0;var _0x358464=_0xe2bd[_0x115dfa];return _0x358464;};'use strict';var _=require(_0xde2b('0x0'));var attributes=require(_0xde2b('0x1'));var qs=require(_0xde2b('0x2'));var squel=require('squel');module['exports']=function(_0x212fa9){var _0x538baa=_0x212fa9[_0xde2b('0x3')];function _0x233420(_0x11c18a,_0x1ad4ab){return new Promise(function(_0x418fd8,_0x59d23b){if(!_0x1ad4ab)return _0x418fd8(null);var _0x2508d8=_0x1ad4ab[_0xde2b('0x4')]?{[_0x1ad4ab['filter']['field']]:_0x1ad4ab[_0xde2b('0x4')][_0xde2b('0x5')]}:undefined;return _0x538baa[_0x11c18a]['findAll']({'where':_0x2508d8,'raw':!![]})[_0xde2b('0x6')](function(_0x1b8198){_0x1ad4ab[_0xde2b('0x7')]=_['map'](_0x1b8198,'id');_0x418fd8(_0x1ad4ab);})[_0xde2b('0x8')](function(_0x1aaadd){_0x59d23b(_0x1aaadd);});});}function _0x31c353(_0x8dce19,_0x532bb0){return new Promise(function(_0x395a99,_0x24fa87){var _0x11daee=_0x8dce19[_0xde2b('0x4')]?{[_0x8dce19['filter'][_0xde2b('0x9')]]:_0x8dce19[_0xde2b('0x4')]['value']}:undefined;return _0x538baa[_0x8dce19[_0xde2b('0xa')]][_0xde2b('0xb')]({'where':_0x11daee,'raw':!![]})['then'](function(_0x1d63e1){_0x532bb0['associatedResources']=_[_0xde2b('0xc')](_0x1d63e1,function(_0x130fc2){return _0x130fc2['name'];});_0x395a99(_0x532bb0);})[_0xde2b('0x8')](function(_0x4930cf){_0x24fa87(_0x4930cf);});});}function _0x1f7352(_0x29788a,_0x2173d3,_0x52ada3){if(!_0x2173d3)return Promise['resolve'](null);return new Promise(function(_0x263872,_0x4710ff){return _0x538baa[_0xde2b('0xd')][_0xde2b('0xb')]({'where':{'sectionId':_0x2173d3['id']},'raw':!![]})['then'](function(_0x5dc88e){if(_0x29788a[_0xde2b('0x9')]&&_0x29788a[_0xde2b('0x9')]!=='id'){_0x2173d3[_0xde2b('0x7')]=_[_0xde2b('0xc')](_0x5dc88e,function(_0x7c6e5c){return _0x7c6e5c[_0x29788a[_0xde2b('0x9')]];});}else{if(_0x52ada3==='AnalyticExtractedReport'){_0x2173d3[_0xde2b('0x7')]=_[_0xde2b('0xc')](_0x5dc88e,function(_0x4ad858){return{'id':_0x4ad858[_0xde2b('0xe')],'type':_0x4ad858[_0xde2b('0xf')]};});}else{_0x2173d3['associatedResources']=_[_0xde2b('0xc')](_0x5dc88e,function(_0x2772b1){return _0x2772b1['resourceId'];});}}_0x263872(_0x2173d3);})[_0xde2b('0x8')](function(_0x129e26){_0x4710ff(_0x129e26);});});}function _0x5b7ca6(_0x1e5b20,_0x3767a7){var _0xdf03bb={'parentSections':[]};switch(_0x1e5b20[_0xde2b('0x10')]()){case _0xde2b('0x11'):_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x13');break;case _0xde2b('0x14'):_0xdf03bb['childModel']='SquareOdbc';break;case _0xde2b('0x15'):_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x16');_0xdf03bb[_0xde2b('0x17')]=[{'name':_0xde2b('0x18'),'field':'name','foreignKey':'projectName'}];break;case _0xde2b('0x19'):_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x1a');break;case _0xde2b('0x1b'):_0xdf03bb['childModel']=_0xde2b('0x1c');_0xdf03bb['parentSections']=[{'name':_0xde2b('0x1d'),'field':'id','foreignKey':'ListId'}];break;case _0xde2b('0x1e'):_0xdf03bb[_0xde2b('0x12')]='CmList';break;case'companies':_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x1f');break;case _0xde2b('0x20'):_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x21');break;case'chatqueues':_0xdf03bb[_0xde2b('0x12')]='ChatQueue';break;case _0xde2b('0x22'):_0xdf03bb[_0xde2b('0x12')]='ChatWebsite';break;case _0xde2b('0x23'):_0xdf03bb['childModel']='FaxQueue';break;case'faxaccounts':_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x24');break;case _0xde2b('0x25'):case'internalroutes':case'outboundroutes':_0xdf03bb['childModel']=_0xde2b('0x26');break;case _0xde2b('0x27'):_0xdf03bb['childModel']=_0xde2b('0x28');break;case _0xde2b('0x29'):_0xdf03bb[_0xde2b('0x12')]='VoiceMail';break;case _0xde2b('0x2a'):_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x2b');_0xdf03bb[_0xde2b('0x17')]=[{'name':_0xde2b('0x2c'),'field':_0xde2b('0x2d'),'foreignKey':'membername','model':'User','filter':{'field':_0xde2b('0x2e'),'value':[_0xde2b('0x2f')]}},{'name':'Telephones','field':_0xde2b('0x2d'),'foreignKey':_0xde2b('0x30'),'model':'User','filter':{'field':_0xde2b('0x2e'),'value':[_0xde2b('0x31')]}},{'name':_0xde2b('0x32'),'field':_0xde2b('0x2d'),'foreignKey':_0xde2b('0x33'),'model':_0xde2b('0x34'),'filter':{'field':'type','value':[_0xde2b('0x35')]}},{'name':_0xde2b('0x36'),'field':_0xde2b('0x2d'),'foreignKey':_0xde2b('0x33'),'model':'VoiceQueue','filter':{'field':_0xde2b('0xf'),'value':[_0xde2b('0x37')]}}];break;case _0xde2b('0x38'):_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x39');break;case _0xde2b('0x3a'):_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x3b');break;case _0xde2b('0x3c'):_0xdf03bb[_0xde2b('0x12')]='VoicePrefix';break;case _0xde2b('0x3d'):_0xdf03bb[_0xde2b('0x12')]='Campaign';break;case _0xde2b('0x3e'):_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x3f');break;case _0xde2b('0x40'):_0xdf03bb[_0xde2b('0x12')]='MailAccount';break;case _0xde2b('0x41'):_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x42');break;case'openchannelqueues':_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x43');break;case _0xde2b('0x44'):_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x45');break;case _0xde2b('0x46'):_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x47');break;case _0xde2b('0x48'):_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x49');break;case _0xde2b('0x4a'):_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x4b');break;case _0xde2b('0x4c'):_0xdf03bb[_0xde2b('0x12')]='WhatsappAccount';break;case _0xde2b('0x4d'):_0xdf03bb[_0xde2b('0x12')]='Team';break;case _0xde2b('0x4e'):case _0xde2b('0x4f'):_0xdf03bb['childModel']=_0xde2b('0x34');if(_0x3767a7){_0xdf03bb[_0xde2b('0x17')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0xde2b('0x50'):case'agents':case'telephones':_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x51');if(_0x3767a7){_0xdf03bb['parentSections']=[{'name':'Users','filter':{'field':_0xde2b('0x2e'),'value':[_0xde2b('0x52'),_0xde2b('0x53')]},'ignore':!![]},{'name':'Agents'},{'name':_0xde2b('0x54')}];}break;case _0xde2b('0x55'):_0xdf03bb['childModel']=_0xde2b('0x56');break;case _0xde2b('0x57'):_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x58');break;case _0xde2b('0x59'):_0xdf03bb['childModel']='FreshdeskAccount';break;case _0xde2b('0x5a'):_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x5b');break;case _0xde2b('0x5c'):_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x5d');break;case _0xde2b('0x5e'):_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x5f');break;case _0xde2b('0x60'):_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x51');break;case _0xde2b('0x61'):_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x62');break;case _0xde2b('0x63'):_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x64');break;case _0xde2b('0x65'):_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x66');break;case'intervals':_0xdf03bb[_0xde2b('0x12')]='Interval';break;case _0xde2b('0x67'):_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x68');break;case _0xde2b('0x69'):_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x6a');break;case _0xde2b('0x6b'):_0xdf03bb[_0xde2b('0x12')]='Sound';break;case'tags':_0xdf03bb[_0xde2b('0x12')]='Tag';break;case _0xde2b('0x6c'):_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x6d');break;case _0xde2b('0x6e'):_0xdf03bb['childModel']=_0xde2b('0x6f');break;case'trunks':_0xdf03bb['childModel']=_0xde2b('0x70');break;case _0xde2b('0x71'):_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x72');break;case _0xde2b('0x73'):_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x74');break;case'extractedreports':_0xdf03bb['childModel']=_0xde2b('0x75');_0xdf03bb['parentSections']=[{'name':_0xde2b('0x76'),'field':'id','foreignKey':'reportId'}];break;case _0xde2b('0x77'):_0xdf03bb[_0xde2b('0x12')]=_0xde2b('0x78');break;}return _0xdf03bb;}function _0x191b39(_0xb5c651,_0x546b21){var _0x3c5998=_0xb5c651['charAt'](0x0)[_0xde2b('0x79')]()+_0xb5c651['slice'](0x1);var _0xa987ec={'type':_0x538baa[_0xde2b('0x7a')][_0xde2b('0x7b')][_0xde2b('0x7c')],'raw':!![]};return new Promise(function(_0x3c7348,_0x4ae614){var _0x4a93ab=squel[_0xde2b('0x7d')]()[_0xde2b('0x9')](_0xde2b('0x7e')+_0x3c5998+_0xde2b('0x7f'),'id')[_0xde2b('0x9')](_0xde2b('0x80'))[_0xde2b('0x81')](_0xde2b('0x82')+_0xb5c651+_0xde2b('0x83'),'ui')[_0xde2b('0x84')](_0xde2b('0x85'),_0x546b21['id']);return _0x538baa['sequelize'][_0xde2b('0x86')](_0x4a93ab[_0xde2b('0x87')](),_0xa987ec)['then'](function(_0x130afb){_0x546b21[_0x3c5998+_0xde2b('0x88')]=_0x130afb;_0x3c7348(_0x130afb);})[_0xde2b('0x8')](function(_0x1aaa9f){_0x4ae614(_0x1aaa9f);});});}return _0x212fa9[_0xde2b('0x89')](_0xde2b('0x8a'),attributes,{'tableName':_0xde2b('0x8b'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x40cd96){var _0x43d0c0={'raw':_0x40cd96[_0xde2b('0x86')][_0xde2b('0x8c')],'where':{}};var _0x3e138b={};var _0x3955f6={'count':0x0,'rows':[]};var _0xa3631c=_0x40cd96[_0xde2b('0x86')][_0xde2b('0x8d')];var _0x4c3329=_0x40cd96['query']['mergeResources']||![];var _0x69e085=_0x5b7ca6(_0xa3631c,_0x4c3329);if(!_0x69e085[_0xde2b('0x12')])throw new Error(_0xde2b('0x8e')+_0xa3631c+'\x27');var _0x23b914=[{'name':_0xa3631c}];if(!_[_0xde2b('0x8f')](_0x69e085[_0xde2b('0x17')]))_0x23b914=_0x69e085[_0xde2b('0x17')];var _0x574d1e=[];for(var _0x1f8b17=0x0;_0x1f8b17<_0x23b914['length'];_0x1f8b17++){_0x574d1e['push'](_0x538baa['UserProfileSection'][_0xde2b('0x90')]({'where':{'userProfileId':_0x40cd96[_0xde2b('0x91')]['id'],'name':_0x23b914[_0x1f8b17][_0xde2b('0x2d')]},'raw':!![]}));}return Promise[_0xde2b('0x92')](_0x574d1e)['then'](function(_0x47e906){var _0x341d9f=_[_0xde2b('0x4')](_0x47e906,function(_0x23bd0d){return _0x23bd0d?_0x23bd0d:undefined;});var _0x26535c=_[_0xde2b('0x4')](_0x23b914,['ignore',!![]]);var _0x47db5c=_[_0xde2b('0x8f')](_0x341d9f)&&_[_0xde2b('0x8f')](_0x26535c)?null:_[_0xde2b('0x93')](_0x26535c,_0x341d9f);if(!_0x47db5c)return null;var _0x22a9fa=[];for(var _0x2c9a30=0x0;_0x2c9a30<_0x47db5c[_0xde2b('0x94')];_0x2c9a30++){var _0x232c38=_['find'](_0x23b914,function(_0x2aa2df){return _0x47db5c[_0x2c9a30]?_0x2aa2df[_0xde2b('0x2d')]===_0x47db5c[_0x2c9a30]['name']:null;});if(_0x232c38){if(_0x47db5c[_0x2c9a30][_0xde2b('0x95')]){_0x22a9fa[_0xde2b('0x96')](_0x233420(_0x69e085[_0xde2b('0x12')],_0x47db5c[_0x2c9a30]));}else{if(!_0x47db5c[_0x2c9a30][_0xde2b('0x97')]){_0x22a9fa[_0xde2b('0x96')](_0x1f7352(_0x232c38,_0x47db5c[_0x2c9a30],_0x69e085['childModel']));}else{if(_0x232c38[_0xde2b('0xa')]){_0x22a9fa[_0xde2b('0x96')](_0x31c353(_0x232c38,_0x47db5c[_0x2c9a30]));}}}}}return Promise[_0xde2b('0x92')](_0x22a9fa);})['then'](function(_0x22b588){var _0x624e1f=_0x22b588;var _0x5c9c1d=null;if(_0x624e1f){_0x5c9c1d=_0x624e1f[_0xde2b('0x94')]===0x1?_0x624e1f[0x0]:null;}if(!_0x5c9c1d&&!_0x624e1f)return _0x3955f6;var _0x3dfa1d=_0x538baa[_0x69e085[_0xde2b('0x12')]]['rawAttributes'];_0x3e138b[_0xde2b('0xa')]=_['keys'](_0x3dfa1d);_0x3e138b['query']=_['keys'](_0x40cd96[_0xde2b('0x86')]);_0x3e138b['filters']=_[_0xde2b('0x98')](_0x3e138b['model'],_0x3e138b[_0xde2b('0x86')]);_0x43d0c0[_0xde2b('0x99')]=_[_0xde2b('0x98')](_0x3e138b[_0xde2b('0xa')],qs[_0xde2b('0x9a')](_0x40cd96[_0xde2b('0x86')]['fields']));_0x43d0c0[_0xde2b('0x99')]=_0x43d0c0[_0xde2b('0x99')][_0xde2b('0x94')]?_0x43d0c0[_0xde2b('0x99')]:_0x3e138b[_0xde2b('0xa')];if(!_0x40cd96[_0xde2b('0x86')][_0xde2b('0x9b')](_0xde2b('0x9c'))){_0x43d0c0[_0xde2b('0x9d')]=qs['limit'](_0x40cd96[_0xde2b('0x86')]['limit']);_0x43d0c0[_0xde2b('0x9e')]=qs[_0xde2b('0x9e')](_0x40cd96[_0xde2b('0x86')][_0xde2b('0x9e')]);}_0x43d0c0[_0xde2b('0x9f')]=qs['sort'](_0x40cd96[_0xde2b('0x86')][_0xde2b('0xa0')]);_0x43d0c0[_0xde2b('0x84')]=qs[_0xde2b('0xa1')](_[_0xde2b('0xa2')](_0x40cd96['query'],_0x3e138b[_0xde2b('0xa1')]));if(_0x40cd96[_0xde2b('0x86')]['filter']){_0x43d0c0[_0xde2b('0x84')]=_[_0xde2b('0xa3')](_0x43d0c0['where'],{'$or':_[_0xde2b('0xc')](_0x3dfa1d,function(_0x176454){if(_0x176454['type'][_0xde2b('0xa4')]!==_0xde2b('0xa5')){var _0x500b4b={};_0x500b4b[_0x176454['field']]={'$like':'%'+_0x40cd96[_0xde2b('0x86')][_0xde2b('0x4')]+'%'};return _0x500b4b;}})});}var _0x8c154e=[];var _0x16d0ab=null;var _0x491bd6={};if(_0x5c9c1d){_0x16d0ab=_['find'](_0x23b914,[_0xde2b('0x2d'),_0x5c9c1d['name']]);if(_0x16d0ab['field']){_0x491bd6={};if(_0x69e085[_0xde2b('0x12')]===_0xde2b('0x75')){_0x491bd6[_0x16d0ab['foreignKey']]=_[_0xde2b('0xc')](_0x5c9c1d[_0xde2b('0x7')],'id');}else{_0x491bd6[_0x16d0ab[_0xde2b('0xa6')]]=_0x5c9c1d[_0xde2b('0x7')];}_0x8c154e['push'](_0x491bd6);}else{_0x43d0c0[_0xde2b('0x84')]['id']=_0x5c9c1d[_0xde2b('0x7')];}}else{for(var _0x1dcd75=0x0;_0x1dcd75<_0x624e1f['length'];_0x1dcd75++){_0x16d0ab=_['find'](_0x23b914,[_0xde2b('0x2d'),_0x624e1f[_0x1dcd75][_0xde2b('0x2d')]]);if(_0x16d0ab['field']){_0x491bd6={};_0x491bd6[_0x16d0ab[_0xde2b('0xa6')]]=_0x624e1f[_0x1dcd75][_0xde2b('0x7')];_0x8c154e[_0xde2b('0x96')](_0x491bd6);}else{if(!_0x43d0c0[_0xde2b('0x84')]['id'])_0x43d0c0[_0xde2b('0x84')]['id']=[];_0x624e1f[_0x1dcd75][_0xde2b('0x7')][_0xde2b('0xa7')](function(_0x65c9f9){_0x43d0c0['where']['id'][_0xde2b('0x96')](_0x65c9f9);});}}}if(!_[_0xde2b('0x8f')](_0x8c154e)){_0x43d0c0[_0xde2b('0x84')]=_[_0xde2b('0xa3')](_0x43d0c0[_0xde2b('0x84')],{'$and':{'$or':_0x8c154e}});}_0x43d0c0=_[_0xde2b('0xa3')]({},_0x43d0c0,_0x40cd96[_0xde2b('0xa8')]);if(_0x5c9c1d&&!_0x5c9c1d[_0xde2b('0x97')]&&_0x69e085[_0xde2b('0x12')]===_0xde2b('0x75')){if(_0x40cd96['query'][_0xde2b('0xa9')]){_0x43d0c0[_0xde2b('0xaa')]=[{'all':!![]}];}return _0x538baa[_0x69e085[_0xde2b('0x12')]][_0xde2b('0xb')](_0x43d0c0)[_0xde2b('0x6')](function(_0xd95c8b){var _0x5cda5c=[];_0xd95c8b[_0xde2b('0xa7')](function(_0x23cfea){var _0x4faf21;switch(_0x23cfea[_0xde2b('0xab')]){case _0xde2b('0xac'):_0x4faf21=_[_0xde2b('0x90')](_0x5c9c1d[_0xde2b('0x7')],function(_0x4e1dcf){return _0x4e1dcf['id']===_0x23cfea[_0xde2b('0xad')]&&_0x4e1dcf[_0xde2b('0xf')]===_0xde2b('0xae');});break;case _0xde2b('0xaf'):_0x4faf21=_[_0xde2b('0x90')](_0x5c9c1d['associatedResources'],function(_0x2e32b9){return _0x2e32b9['id']===_0x23cfea[_0xde2b('0xad')]&&_0x2e32b9['type']===_0xde2b('0xb0');});break;}if(_0x4faf21)_0x5cda5c[_0xde2b('0x96')](_0x23cfea);});_0x3955f6[_0xde2b('0xb1')]=_0x5cda5c[_0xde2b('0x94')];_0x3955f6[_0xde2b('0xb2')]=_0x5cda5c;return _0x3955f6;});}else{if(!_[_0xde2b('0x8f')](_0x40cd96[_0xde2b('0x86')][_0xde2b('0xb3')])){_0x43d0c0[_0xde2b('0x84')]['id']=_0x43d0c0[_0xde2b('0x84')]['id']?_[_0xde2b('0x98')](_0x43d0c0[_0xde2b('0x84')]['id'],_0x40cd96['query']['ids']):_0x40cd96['query']['ids'];if(_0x40cd96[_0xde2b('0x86')][_0xde2b('0xb4')]){_0x43d0c0['order']=_0x40cd96['query'][_0xde2b('0xb4')];}}if(_0x40cd96[_0xde2b('0x86')][_0xde2b('0xb5')]){_0x43d0c0[_0xde2b('0x84')]=_[_0xde2b('0xa3')](_0x43d0c0[_0xde2b('0x84')],{'$and':_0x40cd96[_0xde2b('0x86')]['extraQueryConditions']});}return _0x538baa[_0x69e085[_0xde2b('0x12')]][_0xde2b('0xb1')]({'where':_0x43d0c0[_0xde2b('0x84')]})[_0xde2b('0x6')](function(_0xf11c96){_0x3955f6[_0xde2b('0xb1')]=_0xf11c96;if(_0x40cd96[_0xde2b('0x86')]['includeAll']){if(_0x69e085[_0xde2b('0x12')]==='CmContact'){_0x43d0c0[_0xde2b('0xaa')]=[{'model':_0x538baa[_0xde2b('0xb6')],'as':'Tags','attributes':['id',_0xde2b('0x2d'),_0xde2b('0xb7')],'required':_0x40cd96[_0xde2b('0x86')][_0xde2b('0xb8')]?!![]:![]},{'model':_0x538baa[_0xde2b('0xb6')],'as':_0xde2b('0xb9'),'attributes':['id',_0xde2b('0x2d'),_0xde2b('0xb7')],'through':_0x40cd96[_0xde2b('0x86')][_0xde2b('0xb8')]?{'attributes':[],'where':{'TagId':_0x40cd96[_0xde2b('0x86')][_0xde2b('0xb8')]||undefined}}:{},'required':_0x40cd96['query'][_0xde2b('0xb8')]?!![]:![]}];}else{_0x43d0c0['include']=[{'all':!![]}];}}return _0x538baa[_0x69e085[_0xde2b('0x12')]][_0xde2b('0xb')](_0x43d0c0);})[_0xde2b('0x6')](function(_0x18e807){_0x3955f6[_0xde2b('0xb2')]=_0x18e807;if(_0xa3631c==='Agents'&&_0x40cd96['query'][_0xde2b('0xba')]===_0xde2b('0xbb')){var _0x159ce5=[];for(var _0x34ade2=0x0;_0x34ade2<_0x3955f6[_0xde2b('0xb2')][_0xde2b('0x94')];_0x34ade2++){_0x159ce5[_0xde2b('0x96')](_0x191b39(_0xde2b('0xbc'),_0x3955f6[_0xde2b('0xb2')][_0x34ade2][_0xde2b('0xbd')]));_0x159ce5[_0xde2b('0x96')](_0x191b39(_0xde2b('0xbe'),_0x3955f6[_0xde2b('0xb2')][_0x34ade2][_0xde2b('0xbd')]));_0x159ce5[_0xde2b('0x96')](_0x191b39(_0xde2b('0xbf'),_0x3955f6[_0xde2b('0xb2')][_0x34ade2][_0xde2b('0xbd')]));_0x159ce5['push'](_0x191b39(_0xde2b('0xc0'),_0x3955f6[_0xde2b('0xb2')][_0x34ade2][_0xde2b('0xbd')]));_0x159ce5['push'](_0x191b39('openchannel',_0x3955f6['rows'][_0x34ade2]['dataValues']));_0x159ce5[_0xde2b('0x96')](_0x191b39(_0xde2b('0xc1'),_0x3955f6[_0xde2b('0xb2')][_0x34ade2][_0xde2b('0xbd')]));}return Promise['all'](_0x159ce5)[_0xde2b('0x6')](function(){return _0x3955f6;});}return _0x3955f6;});}});}}});}; \ No newline at end of file +var _0x6706=['telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','outbound','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','MailQueue','mailaccounts','MailAccount','MailSubstatus','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Schedule','sounds','tags','Tag','templates','triggers','Trigger','variables','Variable','plugins','Reports','reportId','metrics','charAt','toUpperCase','slice','Sequelize','SELECT','select','ui.','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','toString','UserProfile','user_profiles','query','raw','section','mergeResources','Invalid\x20section\x20\x27','length','UserProfileSection','find','params','all','ignore','isEmpty','union','push','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','merge','key','foreignKey','forEach','options','include','reportType','default','DefaultReports','custom','CustomReports','rows','ids','customSorting','count','includeAll','Tags','tag','ThroughTags','color','true','chat','dataValues','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','associatedResources','model','then','map','catch','resolve','UserProfileResource','AnalyticExtractedReport','type','toLowerCase','childModel','SquareProject','odbc','squarerecordings','SquareRecording','parentSections','SquareProjects','name','projectName','projects','JscriptyProject','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','chatqueues','chatwebsites','FaxQueue','faxaccounts','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','membername','role','agent','Telephones','User'];(function(_0x170252,_0x38c2b4){var _0xd57eb3=function(_0x39ccf0){while(--_0x39ccf0){_0x170252['push'](_0x170252['shift']());}};_0xd57eb3(++_0x38c2b4);}(_0x6706,0x89));var _0x6670=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6706[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6670('0x0'));var attributes=require(_0x6670('0x1'));var qs=require(_0x6670('0x2'));var squel=require(_0x6670('0x3'));module[_0x6670('0x4')]=function(_0x53181b){var _0x402a5d=_0x53181b[_0x6670('0x5')];function _0x586747(_0x588b7a,_0x1e86ba){return new Promise(function(_0xd34a7e,_0x3cade4){if(!_0x1e86ba)return _0xd34a7e(null);var _0x3dd3dd=_0x1e86ba[_0x6670('0x6')]?{[_0x1e86ba[_0x6670('0x6')][_0x6670('0x7')]]:_0x1e86ba[_0x6670('0x6')][_0x6670('0x8')]}:undefined;return _0x402a5d[_0x588b7a][_0x6670('0x9')]({'where':_0x3dd3dd,'raw':!![]})['then'](function(_0xc371c1){_0x1e86ba[_0x6670('0xa')]=_['map'](_0xc371c1,'id');_0xd34a7e(_0x1e86ba);})['catch'](function(_0x46a8f6){_0x3cade4(_0x46a8f6);});});}function _0x493318(_0x774bd5,_0x10c07c){return new Promise(function(_0x440e28,_0x46b17e){var _0x4ddfcb=_0x774bd5[_0x6670('0x6')]?{[_0x774bd5['filter'][_0x6670('0x7')]]:_0x774bd5[_0x6670('0x6')][_0x6670('0x8')]}:undefined;return _0x402a5d[_0x774bd5[_0x6670('0xb')]][_0x6670('0x9')]({'where':_0x4ddfcb,'raw':!![]})[_0x6670('0xc')](function(_0x730d1){_0x10c07c[_0x6670('0xa')]=_[_0x6670('0xd')](_0x730d1,function(_0x8fc63b){return _0x8fc63b['name'];});_0x440e28(_0x10c07c);})[_0x6670('0xe')](function(_0x32c6ba){_0x46b17e(_0x32c6ba);});});}function _0x191bea(_0x4b011a,_0x46ba15,_0x8b69ae){if(!_0x46ba15)return Promise[_0x6670('0xf')](null);return new Promise(function(_0x5aa2e7,_0x578475){return _0x402a5d[_0x6670('0x10')][_0x6670('0x9')]({'where':{'sectionId':_0x46ba15['id']},'raw':!![]})[_0x6670('0xc')](function(_0x2fb283){if(_0x4b011a[_0x6670('0x7')]&&_0x4b011a['field']!=='id'){_0x46ba15['associatedResources']=_['map'](_0x2fb283,function(_0x326b72){return _0x326b72[_0x4b011a[_0x6670('0x7')]];});}else{if(_0x8b69ae===_0x6670('0x11')){_0x46ba15[_0x6670('0xa')]=_[_0x6670('0xd')](_0x2fb283,function(_0x47c1ac){return{'id':_0x47c1ac['resourceId'],'type':_0x47c1ac[_0x6670('0x12')]};});}else{_0x46ba15[_0x6670('0xa')]=_['map'](_0x2fb283,function(_0x956dce){return _0x956dce['resourceId'];});}}_0x5aa2e7(_0x46ba15);})['catch'](function(_0x42f027){_0x578475(_0x42f027);});});}function _0x314659(_0x449b8a,_0x419f6e){var _0x40e84c={'parentSections':[]};switch(_0x449b8a[_0x6670('0x13')]()){case'squareprojects':_0x40e84c[_0x6670('0x14')]=_0x6670('0x15');break;case _0x6670('0x16'):_0x40e84c[_0x6670('0x14')]='SquareOdbc';break;case _0x6670('0x17'):_0x40e84c[_0x6670('0x14')]=_0x6670('0x18');_0x40e84c[_0x6670('0x19')]=[{'name':_0x6670('0x1a'),'field':_0x6670('0x1b'),'foreignKey':_0x6670('0x1c')}];break;case _0x6670('0x1d'):_0x40e84c['childModel']=_0x6670('0x1e');break;case'contacts':_0x40e84c[_0x6670('0x14')]=_0x6670('0x1f');_0x40e84c['parentSections']=[{'name':_0x6670('0x20'),'field':'id','foreignKey':_0x6670('0x21')}];break;case _0x6670('0x22'):_0x40e84c[_0x6670('0x14')]=_0x6670('0x23');break;case _0x6670('0x24'):_0x40e84c[_0x6670('0x14')]=_0x6670('0x25');break;case _0x6670('0x26'):_0x40e84c[_0x6670('0x14')]='CmCustomField';break;case _0x6670('0x27'):_0x40e84c['childModel']='ChatQueue';break;case _0x6670('0x28'):_0x40e84c['childModel']='ChatWebsite';break;case'faxqueues':_0x40e84c[_0x6670('0x14')]=_0x6670('0x29');break;case _0x6670('0x2a'):_0x40e84c['childModel']='FaxAccount';break;case'inboundroutes':case _0x6670('0x2b'):case _0x6670('0x2c'):_0x40e84c[_0x6670('0x14')]=_0x6670('0x2d');break;case _0x6670('0x2e'):_0x40e84c['childModel']=_0x6670('0x2f');break;case _0x6670('0x30'):_0x40e84c['childModel']=_0x6670('0x31');break;case _0x6670('0x32'):_0x40e84c['childModel']=_0x6670('0x33');_0x40e84c[_0x6670('0x19')]=[{'name':'Agents','field':_0x6670('0x1b'),'foreignKey':_0x6670('0x34'),'model':'User','filter':{'field':_0x6670('0x35'),'value':[_0x6670('0x36')]}},{'name':_0x6670('0x37'),'field':_0x6670('0x1b'),'foreignKey':'membername','model':_0x6670('0x38'),'filter':{'field':'role','value':[_0x6670('0x39')]}},{'name':_0x6670('0x3a'),'field':_0x6670('0x1b'),'foreignKey':_0x6670('0x3b'),'model':_0x6670('0x3c'),'filter':{'field':_0x6670('0x12'),'value':['inbound']}},{'name':_0x6670('0x3d'),'field':'name','foreignKey':_0x6670('0x3b'),'model':_0x6670('0x3c'),'filter':{'field':_0x6670('0x12'),'value':[_0x6670('0x3e')]}}];break;case'musiconholds':_0x40e84c[_0x6670('0x14')]=_0x6670('0x3f');break;case'chanspies':_0x40e84c[_0x6670('0x14')]=_0x6670('0x40');break;case _0x6670('0x41'):_0x40e84c[_0x6670('0x14')]=_0x6670('0x42');break;case'ivrcampaigns':_0x40e84c[_0x6670('0x14')]=_0x6670('0x43');break;case'mailqueues':_0x40e84c[_0x6670('0x14')]=_0x6670('0x44');break;case _0x6670('0x45'):_0x40e84c[_0x6670('0x14')]=_0x6670('0x46');break;case'mailsubstatuses':_0x40e84c[_0x6670('0x14')]=_0x6670('0x47');break;case'openchannelqueues':_0x40e84c[_0x6670('0x14')]=_0x6670('0x48');break;case'openchannelaccounts':_0x40e84c[_0x6670('0x14')]=_0x6670('0x49');break;case _0x6670('0x4a'):_0x40e84c[_0x6670('0x14')]=_0x6670('0x4b');break;case _0x6670('0x4c'):_0x40e84c[_0x6670('0x14')]=_0x6670('0x4d');break;case _0x6670('0x4e'):_0x40e84c[_0x6670('0x14')]=_0x6670('0x4f');break;case _0x6670('0x50'):_0x40e84c['childModel']='WhatsappAccount';break;case _0x6670('0x51'):_0x40e84c['childModel']=_0x6670('0x52');break;case _0x6670('0x53'):case _0x6670('0x54'):_0x40e84c[_0x6670('0x14')]=_0x6670('0x3c');if(_0x419f6e){_0x40e84c[_0x6670('0x19')]=[{'name':_0x6670('0x3a')},{'name':'QueueCampaigns'}];}break;case _0x6670('0x55'):case _0x6670('0x56'):case _0x6670('0x57'):_0x40e84c['childModel']=_0x6670('0x38');if(_0x419f6e){_0x40e84c[_0x6670('0x19')]=[{'name':_0x6670('0x58'),'filter':{'field':'role','value':[_0x6670('0x59'),_0x6670('0x5a')]},'ignore':!![]},{'name':_0x6670('0x5b')},{'name':_0x6670('0x37')}];}break;case _0x6670('0x5c'):_0x40e84c[_0x6670('0x14')]=_0x6670('0x5d');break;case _0x6670('0x5e'):_0x40e84c[_0x6670('0x14')]=_0x6670('0x5f');break;case _0x6670('0x60'):_0x40e84c[_0x6670('0x14')]=_0x6670('0x61');break;case _0x6670('0x62'):_0x40e84c[_0x6670('0x14')]=_0x6670('0x63');break;case _0x6670('0x64'):_0x40e84c[_0x6670('0x14')]=_0x6670('0x65');break;case _0x6670('0x66'):_0x40e84c['childModel']=_0x6670('0x67');break;case _0x6670('0x68'):_0x40e84c[_0x6670('0x14')]=_0x6670('0x38');break;case _0x6670('0x69'):_0x40e84c['childModel']='CannedAnswer';break;case'dispositions':_0x40e84c[_0x6670('0x14')]=_0x6670('0x6a');break;case _0x6670('0x6b'):_0x40e84c[_0x6670('0x14')]=_0x6670('0x6c');break;case _0x6670('0x6d'):_0x40e84c[_0x6670('0x14')]=_0x6670('0x6e');break;case _0x6670('0x6f'):_0x40e84c[_0x6670('0x14')]='Pause';break;case'scheduler':_0x40e84c['childModel']=_0x6670('0x70');break;case _0x6670('0x71'):_0x40e84c[_0x6670('0x14')]='Sound';break;case _0x6670('0x72'):_0x40e84c[_0x6670('0x14')]=_0x6670('0x73');break;case _0x6670('0x74'):_0x40e84c[_0x6670('0x14')]='Template';break;case _0x6670('0x75'):_0x40e84c[_0x6670('0x14')]=_0x6670('0x76');break;case'trunks':_0x40e84c[_0x6670('0x14')]='Trunk';break;case _0x6670('0x77'):_0x40e84c[_0x6670('0x14')]=_0x6670('0x78');break;case _0x6670('0x79'):_0x40e84c[_0x6670('0x14')]='Plugin';break;case'extractedreports':_0x40e84c[_0x6670('0x14')]='AnalyticExtractedReport';_0x40e84c['parentSections']=[{'name':_0x6670('0x7a'),'field':'id','foreignKey':_0x6670('0x7b')}];break;case _0x6670('0x7c'):_0x40e84c[_0x6670('0x14')]='AnalyticMetric';break;}return _0x40e84c;}function _0x28813b(_0x19a347,_0x383d65){var _0x3af329=_0x19a347[_0x6670('0x7d')](0x0)[_0x6670('0x7e')]()+_0x19a347[_0x6670('0x7f')](0x1);var _0x35d9ce={'type':_0x402a5d[_0x6670('0x80')]['QueryTypes'][_0x6670('0x81')],'raw':!![]};return new Promise(function(_0x38622e,_0x2726f1){var _0x579469=squel[_0x6670('0x82')]()[_0x6670('0x7')](_0x6670('0x83')+_0x3af329+'InteractionId','id')[_0x6670('0x7')]('ui.createdAt')[_0x6670('0x84')](_0x6670('0x85')+_0x19a347+_0x6670('0x86'),'ui')[_0x6670('0x87')](_0x6670('0x88'),_0x383d65['id']);return _0x402a5d['sequelize']['query'](_0x579469[_0x6670('0x89')](),_0x35d9ce)[_0x6670('0xc')](function(_0x57eaed){_0x383d65[_0x3af329+'OpenTabs']=_0x57eaed;_0x38622e(_0x57eaed);})[_0x6670('0xe')](function(_0x584990){_0x2726f1(_0x584990);});});}return _0x53181b['define'](_0x6670('0x8a'),attributes,{'tableName':_0x6670('0x8b'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x40c8cb){var _0x3622c6={'raw':_0x40c8cb[_0x6670('0x8c')][_0x6670('0x8d')],'where':{}};var _0xca3748={};var _0x34eab8={'count':0x0,'rows':[]};var _0x2fa36b=_0x40c8cb[_0x6670('0x8c')][_0x6670('0x8e')];var _0x539ae3=_0x40c8cb[_0x6670('0x8c')][_0x6670('0x8f')]||![];var _0x3a3d82=_0x314659(_0x2fa36b,_0x539ae3);if(!_0x3a3d82[_0x6670('0x14')])throw new Error(_0x6670('0x90')+_0x2fa36b+'\x27');var _0xffb8c=[{'name':_0x2fa36b}];if(!_['isEmpty'](_0x3a3d82[_0x6670('0x19')]))_0xffb8c=_0x3a3d82[_0x6670('0x19')];var _0x1e1b20=[];for(var _0x1e83b4=0x0;_0x1e83b4<_0xffb8c[_0x6670('0x91')];_0x1e83b4++){_0x1e1b20['push'](_0x402a5d[_0x6670('0x92')][_0x6670('0x93')]({'where':{'userProfileId':_0x40c8cb[_0x6670('0x94')]['id'],'name':_0xffb8c[_0x1e83b4][_0x6670('0x1b')]},'raw':!![]}));}return Promise[_0x6670('0x95')](_0x1e1b20)[_0x6670('0xc')](function(_0x22c2e0){var _0x581151=_['filter'](_0x22c2e0,function(_0x1eb23f){return _0x1eb23f?_0x1eb23f:undefined;});var _0x4ad8e8=_[_0x6670('0x6')](_0xffb8c,[_0x6670('0x96'),!![]]);var _0x4883d4=_[_0x6670('0x97')](_0x581151)&&_[_0x6670('0x97')](_0x4ad8e8)?null:_[_0x6670('0x98')](_0x4ad8e8,_0x581151);if(!_0x4883d4)return null;var _0xaa86a6=[];for(var _0x4e37fc=0x0;_0x4e37fc<_0x4883d4[_0x6670('0x91')];_0x4e37fc++){var _0xc6fe44=_[_0x6670('0x93')](_0xffb8c,function(_0x30efc8){return _0x4883d4[_0x4e37fc]?_0x30efc8[_0x6670('0x1b')]===_0x4883d4[_0x4e37fc][_0x6670('0x1b')]:null;});if(_0xc6fe44){if(_0x4883d4[_0x4e37fc][_0x6670('0x96')]){_0xaa86a6[_0x6670('0x99')](_0x586747(_0x3a3d82[_0x6670('0x14')],_0x4883d4[_0x4e37fc]));}else{if(!_0x4883d4[_0x4e37fc][_0x6670('0x9a')]){_0xaa86a6['push'](_0x191bea(_0xc6fe44,_0x4883d4[_0x4e37fc],_0x3a3d82[_0x6670('0x14')]));}else{if(_0xc6fe44[_0x6670('0xb')]){_0xaa86a6[_0x6670('0x99')](_0x493318(_0xc6fe44,_0x4883d4[_0x4e37fc]));}}}}}return Promise['all'](_0xaa86a6);})['then'](function(_0x404c){var _0x2d8cbd=_0x404c;var _0x154a4f=null;if(_0x2d8cbd){_0x154a4f=_0x2d8cbd[_0x6670('0x91')]===0x1?_0x2d8cbd[0x0]:null;}if(!_0x154a4f&&!_0x2d8cbd)return _0x34eab8;var _0xb617aa=_0x402a5d[_0x3a3d82['childModel']][_0x6670('0x9b')];_0xca3748[_0x6670('0xb')]=_[_0x6670('0x9c')](_0xb617aa);_0xca3748['query']=_[_0x6670('0x9c')](_0x40c8cb['query']);_0xca3748[_0x6670('0x9d')]=_[_0x6670('0x9e')](_0xca3748['model'],_0xca3748[_0x6670('0x8c')]);_0x3622c6[_0x6670('0x9f')]=_[_0x6670('0x9e')](_0xca3748['model'],qs['fields'](_0x40c8cb[_0x6670('0x8c')][_0x6670('0xa0')]));_0x3622c6[_0x6670('0x9f')]=_0x3622c6[_0x6670('0x9f')][_0x6670('0x91')]?_0x3622c6[_0x6670('0x9f')]:_0xca3748[_0x6670('0xb')];if(!_0x40c8cb['query'][_0x6670('0xa1')](_0x6670('0xa2'))){_0x3622c6[_0x6670('0xa3')]=qs[_0x6670('0xa3')](_0x40c8cb[_0x6670('0x8c')]['limit']);_0x3622c6[_0x6670('0xa4')]=qs[_0x6670('0xa4')](_0x40c8cb[_0x6670('0x8c')]['offset']);}_0x3622c6[_0x6670('0xa5')]=qs[_0x6670('0xa6')](_0x40c8cb['query'][_0x6670('0xa6')]);_0x3622c6[_0x6670('0x87')]=qs[_0x6670('0x9d')](_['pick'](_0x40c8cb[_0x6670('0x8c')],_0xca3748[_0x6670('0x9d')]));if(_0x40c8cb[_0x6670('0x8c')]['filter']){_0x3622c6['where']=_[_0x6670('0xa7')](_0x3622c6[_0x6670('0x87')],{'$or':_[_0x6670('0xd')](_0xb617aa,function(_0x1182d9){if(_0x1182d9[_0x6670('0x12')][_0x6670('0xa8')]!=='VIRTUAL'){var _0x290332={};_0x290332[_0x1182d9['field']]={'$like':'%'+_0x40c8cb[_0x6670('0x8c')][_0x6670('0x6')]+'%'};return _0x290332;}})});}var _0x458fe8=[];var _0x33fe85=null;var _0x554c33={};if(_0x154a4f){_0x33fe85=_[_0x6670('0x93')](_0xffb8c,['name',_0x154a4f[_0x6670('0x1b')]]);if(_0x33fe85[_0x6670('0x7')]){_0x554c33={};if(_0x3a3d82['childModel']===_0x6670('0x11')){_0x554c33[_0x33fe85[_0x6670('0xa9')]]=_[_0x6670('0xd')](_0x154a4f[_0x6670('0xa')],'id');}else{_0x554c33[_0x33fe85[_0x6670('0xa9')]]=_0x154a4f[_0x6670('0xa')];}_0x458fe8[_0x6670('0x99')](_0x554c33);}else{_0x3622c6[_0x6670('0x87')]['id']=_0x154a4f[_0x6670('0xa')];}}else{for(var _0xb6740=0x0;_0xb6740<_0x2d8cbd[_0x6670('0x91')];_0xb6740++){_0x33fe85=_[_0x6670('0x93')](_0xffb8c,[_0x6670('0x1b'),_0x2d8cbd[_0xb6740][_0x6670('0x1b')]]);if(_0x33fe85[_0x6670('0x7')]){_0x554c33={};_0x554c33[_0x33fe85['foreignKey']]=_0x2d8cbd[_0xb6740][_0x6670('0xa')];_0x458fe8[_0x6670('0x99')](_0x554c33);}else{if(!_0x3622c6[_0x6670('0x87')]['id'])_0x3622c6[_0x6670('0x87')]['id']=[];_0x2d8cbd[_0xb6740]['associatedResources'][_0x6670('0xaa')](function(_0x35b15d){_0x3622c6[_0x6670('0x87')]['id'][_0x6670('0x99')](_0x35b15d);});}}}if(!_[_0x6670('0x97')](_0x458fe8)){_0x3622c6['where']=_['merge'](_0x3622c6[_0x6670('0x87')],{'$and':{'$or':_0x458fe8}});}_0x3622c6=_['merge']({},_0x3622c6,_0x40c8cb[_0x6670('0xab')]);if(_0x154a4f&&!_0x154a4f[_0x6670('0x9a')]&&_0x3a3d82[_0x6670('0x14')]===_0x6670('0x11')){if(_0x40c8cb[_0x6670('0x8c')]['includeAll']){_0x3622c6[_0x6670('0xac')]=[{'all':!![]}];}return _0x402a5d[_0x3a3d82[_0x6670('0x14')]][_0x6670('0x9')](_0x3622c6)[_0x6670('0xc')](function(_0x23026b){var _0x27247d=[];_0x23026b[_0x6670('0xaa')](function(_0x25c4de){var _0x29e967;switch(_0x25c4de[_0x6670('0xad')]){case _0x6670('0xae'):_0x29e967=_[_0x6670('0x93')](_0x154a4f['associatedResources'],function(_0x548944){return _0x548944['id']===_0x25c4de[_0x6670('0x7b')]&&_0x548944['type']===_0x6670('0xaf');});break;case _0x6670('0xb0'):_0x29e967=_[_0x6670('0x93')](_0x154a4f[_0x6670('0xa')],function(_0x362656){return _0x362656['id']===_0x25c4de[_0x6670('0x7b')]&&_0x362656[_0x6670('0x12')]===_0x6670('0xb1');});break;}if(_0x29e967)_0x27247d[_0x6670('0x99')](_0x25c4de);});_0x34eab8['count']=_0x27247d[_0x6670('0x91')];_0x34eab8[_0x6670('0xb2')]=_0x27247d;return _0x34eab8;});}else{if(!_[_0x6670('0x97')](_0x40c8cb[_0x6670('0x8c')]['ids'])){_0x3622c6['where']['id']=_0x3622c6['where']['id']?_[_0x6670('0x9e')](_0x3622c6[_0x6670('0x87')]['id'],_0x40c8cb[_0x6670('0x8c')][_0x6670('0xb3')]):_0x40c8cb[_0x6670('0x8c')]['ids'];if(_0x40c8cb[_0x6670('0x8c')][_0x6670('0xb4')]){_0x3622c6[_0x6670('0xa5')]=_0x40c8cb['query'][_0x6670('0xb4')];}}if(_0x40c8cb[_0x6670('0x8c')]['extraQueryConditions']){_0x3622c6[_0x6670('0x87')]=_[_0x6670('0xa7')](_0x3622c6[_0x6670('0x87')],{'$and':_0x40c8cb[_0x6670('0x8c')]['extraQueryConditions']});}return _0x402a5d[_0x3a3d82[_0x6670('0x14')]]['count']({'where':_0x3622c6['where']})[_0x6670('0xc')](function(_0x2d4e60){_0x34eab8[_0x6670('0xb5')]=_0x2d4e60;if(_0x40c8cb[_0x6670('0x8c')][_0x6670('0xb6')]){if(_0x3a3d82[_0x6670('0x14')]===_0x6670('0x1f')){_0x3622c6[_0x6670('0xac')]=[{'model':_0x402a5d[_0x6670('0x73')],'as':_0x6670('0xb7'),'attributes':['id',_0x6670('0x1b'),'color'],'required':_0x40c8cb[_0x6670('0x8c')][_0x6670('0xb8')]?!![]:![]},{'model':_0x402a5d[_0x6670('0x73')],'as':_0x6670('0xb9'),'attributes':['id',_0x6670('0x1b'),_0x6670('0xba')],'through':_0x40c8cb['query'][_0x6670('0xb8')]?{'attributes':[],'where':{'TagId':_0x40c8cb['query'][_0x6670('0xb8')]||undefined}}:{},'required':_0x40c8cb[_0x6670('0x8c')][_0x6670('0xb8')]?!![]:![]}];}else{_0x3622c6[_0x6670('0xac')]=[{'all':!![]}];}}return _0x402a5d[_0x3a3d82['childModel']][_0x6670('0x9')](_0x3622c6);})[_0x6670('0xc')](function(_0x2fda6f){_0x34eab8[_0x6670('0xb2')]=_0x2fda6f;if(_0x2fa36b==='Agents'&&_0x40c8cb['query']['openTabs']===_0x6670('0xbb')){var _0x3aebcc=[];for(var _0x5cc02e=0x0;_0x5cc02e<_0x34eab8['rows'][_0x6670('0x91')];_0x5cc02e++){_0x3aebcc[_0x6670('0x99')](_0x28813b(_0x6670('0xbc'),_0x34eab8['rows'][_0x5cc02e][_0x6670('0xbd')]));_0x3aebcc['push'](_0x28813b('sms',_0x34eab8['rows'][_0x5cc02e][_0x6670('0xbd')]));_0x3aebcc[_0x6670('0x99')](_0x28813b(_0x6670('0xbe'),_0x34eab8[_0x6670('0xb2')][_0x5cc02e][_0x6670('0xbd')]));_0x3aebcc['push'](_0x28813b(_0x6670('0xbf'),_0x34eab8['rows'][_0x5cc02e]['dataValues']));_0x3aebcc[_0x6670('0x99')](_0x28813b(_0x6670('0xc0'),_0x34eab8[_0x6670('0xb2')][_0x5cc02e][_0x6670('0xbd')]));_0x3aebcc[_0x6670('0x99')](_0x28813b(_0x6670('0xc1'),_0x34eab8[_0x6670('0xb2')][_0x5cc02e][_0x6670('0xbd')]));}return Promise[_0x6670('0x95')](_0x3aebcc)['then'](function(){return _0x34eab8;});}return _0x34eab8;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index d3303b3..c716dc5 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 _0x7804=['message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http','redis','defaults','socket.io-emitter','register','request','then','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','code','UserProfile,\x20%s,\x20%s','error'];(function(_0x2b5ecd,_0x2258f2){var _0x17a4af=function(_0x3eb4e1){while(--_0x3eb4e1){_0x2b5ecd['push'](_0x2b5ecd['shift']());}};_0x17a4af(++_0x2258f2);}(_0x7804,0xc3));var _0x4780=function(_0x4b1ba0,_0x57190c){_0x4b1ba0=_0x4b1ba0-0x0;var _0xd6e1a6=_0x7804[_0x4b1ba0];return _0xd6e1a6;};'use strict';var _=require(_0x4780('0x0'));var util=require('util');var moment=require(_0x4780('0x1'));var BPromise=require(_0x4780('0x2'));var rs=require(_0x4780('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4780('0x4'))['db'];var utils=require(_0x4780('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4780('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4780('0x7')]({'port':0x232a});config[_0x4780('0x8')]=_[_0x4780('0x9')](config[_0x4780('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x4780('0xa'))(new Redis(config['redis']));require('./userProfile.socket')[_0x4780('0xb')](socket);function respondWithRpcPromise(_0x14be09,_0x2fc8a9,_0x45369b){return new BPromise(function(_0x4af80e,_0x5ca23a){return client[_0x4780('0xc')](_0x14be09,_0x45369b)[_0x4780('0xd')](function(_0x21d3d5){logger['info']('UserProfile,\x20%s,\x20%s',_0x2fc8a9,_0x4780('0xe'));logger[_0x4780('0xf')](_0x4780('0x10'),_0x2fc8a9,_0x4780('0xe'),JSON[_0x4780('0x11')](_0x21d3d5));if(_0x21d3d5['error']){if(_0x21d3d5['error'][_0x4780('0x12')]===0x1f4){logger['error'](_0x4780('0x13'),_0x2fc8a9,_0x21d3d5[_0x4780('0x14')][_0x4780('0x15')]);return _0x5ca23a(_0x21d3d5[_0x4780('0x14')]['message']);}logger[_0x4780('0x14')]('UserProfile,\x20%s,\x20%s',_0x2fc8a9,_0x21d3d5[_0x4780('0x14')][_0x4780('0x15')]);return _0x4af80e(_0x21d3d5[_0x4780('0x14')][_0x4780('0x15')]);}else{logger['info'](_0x4780('0x13'),_0x2fc8a9,'request\x20sent');_0x4af80e(_0x21d3d5[_0x4780('0x16')][_0x4780('0x15')]);}})[_0x4780('0x17')](function(_0x3af22f){logger['error'](_0x4780('0x13'),_0x2fc8a9,_0x3af22f);_0x5ca23a(_0x3af22f);});});} \ No newline at end of file +var _0x631c=['UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','debug'];(function(_0x5b2a95,_0x175f25){var _0x40db19=function(_0xb87ac0){while(--_0xb87ac0){_0x5b2a95['push'](_0x5b2a95['shift']());}};_0x40db19(++_0x175f25);}(_0x631c,0x1b6));var _0xc631=function(_0x26a388,_0x2ff6a2){_0x26a388=_0x26a388-0x0;var _0x2d1a3a=_0x631c[_0x26a388];return _0x2d1a3a;};'use strict';var _=require(_0xc631('0x0'));var util=require(_0xc631('0x1'));var moment=require('moment');var BPromise=require(_0xc631('0x2'));var rs=require(_0xc631('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc631('0x4'))['db'];var utils=require(_0xc631('0x5'));var logger=require(_0xc631('0x6'))('rpc');var config=require(_0xc631('0x7'));var jayson=require(_0xc631('0x8'));var client=jayson['client'][_0xc631('0x9')]({'port':0x232a});config['redis']=_[_0xc631('0xa')](config[_0xc631('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc631('0xc'))['register'](socket);function respondWithRpcPromise(_0x3a81e0,_0x461dfc,_0x1bd8ac){return new BPromise(function(_0x5eae13,_0x895dd6){return client[_0xc631('0xd')](_0x3a81e0,_0x1bd8ac)[_0xc631('0xe')](function(_0x333a67){logger[_0xc631('0xf')](_0xc631('0x10'),_0x461dfc,'request\x20sent');logger[_0xc631('0x11')](_0xc631('0x12'),_0x461dfc,_0xc631('0x13'),JSON[_0xc631('0x14')](_0x333a67));if(_0x333a67[_0xc631('0x15')]){if(_0x333a67['error'][_0xc631('0x16')]===0x1f4){logger[_0xc631('0x15')]('UserProfile,\x20%s,\x20%s',_0x461dfc,_0x333a67[_0xc631('0x15')][_0xc631('0x17')]);return _0x895dd6(_0x333a67[_0xc631('0x15')][_0xc631('0x17')]);}logger[_0xc631('0x15')](_0xc631('0x10'),_0x461dfc,_0x333a67[_0xc631('0x15')][_0xc631('0x17')]);return _0x5eae13(_0x333a67[_0xc631('0x15')]['message']);}else{logger[_0xc631('0xf')]('UserProfile,\x20%s,\x20%s',_0x461dfc,_0xc631('0x13'));_0x5eae13(_0x333a67['result'][_0xc631('0x17')]);}})['catch'](function(_0x4ab1dc){logger[_0xc631('0x15')](_0xc631('0x10'),_0x461dfc,_0x4ab1dc);_0x895dd6(_0x4ab1dc);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 799be43..a00c3a2 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 _0xe1cc=['emit','register','length','userProfile:','save'];(function(_0x5f185e,_0x187ea2){var _0x43e499=function(_0x477a7b){while(--_0x477a7b){_0x5f185e['push'](_0x5f185e['shift']());}};_0x43e499(++_0x187ea2);}(_0xe1cc,0x68));var _0xce1c=function(_0x8a5173,_0x40ad7a){_0x8a5173=_0x8a5173-0x0;var _0xa536e6=_0xe1cc[_0x8a5173];return _0xa536e6;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xce1c('0x0'),'remove','update'];function createListener(_0x1e05b6,_0x244b8f){return function(_0x58ef88){_0x244b8f[_0xce1c('0x1')](_0x1e05b6,_0x58ef88);};}function removeListener(_0x31fd50,_0x23ef95){return function(){UserProfileEvents['removeListener'](_0x31fd50,_0x23ef95);};}exports[_0xce1c('0x2')]=function(_0x17bee4){for(var _0x17af04=0x0,_0x58eed4=events[_0xce1c('0x3')];_0x17af04<_0x58eed4;_0x17af04++){var _0x22a834=events[_0x17af04];var _0x457703=createListener(_0xce1c('0x4')+_0x22a834,_0x17bee4);UserProfileEvents['on'](_0x22a834,_0x457703);}}; \ No newline at end of file +var _0xfbf4=['update','removeListener','userProfile:','./userProfile.events','save'];(function(_0x1a7295,_0x14b7e6){var _0x2b3396=function(_0x2a2957){while(--_0x2a2957){_0x1a7295['push'](_0x1a7295['shift']());}};_0x2b3396(++_0x14b7e6);}(_0xfbf4,0xad));var _0x4fbf=function(_0x5d5bc0,_0x31a0d3){_0x5d5bc0=_0x5d5bc0-0x0;var _0x2c9022=_0xfbf4[_0x5d5bc0];return _0x2c9022;};'use strict';var UserProfileEvents=require(_0x4fbf('0x0'));var events=[_0x4fbf('0x1'),'remove',_0x4fbf('0x2')];function createListener(_0x173505,_0x28f962){return function(_0x1c96c7){_0x28f962['emit'](_0x173505,_0x1c96c7);};}function removeListener(_0x4473c9,_0x38e65f){return function(){UserProfileEvents[_0x4fbf('0x3')](_0x4473c9,_0x38e65f);};}exports['register']=function(_0x214534){for(var _0x2dbe55=0x0,_0x2e61ea=events['length'];_0x2dbe55<_0x2e61ea;_0x2dbe55++){var _0x3ce646=events[_0x2dbe55];var _0x53e234=createListener(_0x4fbf('0x4')+_0x3ce646,_0x214534);UserProfileEvents['on'](_0x3ce646,_0x53e234);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 25278e3..550f98d 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 _0x99f8=['/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x30a380,_0x597e42){var _0x3e1198=function(_0x3f70b9){while(--_0x3f70b9){_0x30a380['push'](_0x30a380['shift']());}};_0x3e1198(++_0x597e42);}(_0x99f8,0x72));var _0x899f=function(_0xd8c96f,_0x284984){_0xd8c96f=_0xd8c96f-0x0;var _0xe3f43c=_0x99f8[_0xd8c96f];return _0xe3f43c;};'use strict';var multer=require('multer');var util=require(_0x899f('0x0'));var path=require(_0x899f('0x1'));var timeout=require(_0x899f('0x2'));var express=require(_0x899f('0x3'));var router=express['Router']();var fs_extra=require(_0x899f('0x4'));var auth=require(_0x899f('0x5'));var interaction=require(_0x899f('0x6'));var config=require(_0x899f('0x7'));var controller=require('./userProfileResource.controller');router[_0x899f('0x8')]('/',auth[_0x899f('0x9')](),controller[_0x899f('0xa')]);router['get'](_0x899f('0xb'),auth[_0x899f('0x9')](),controller['describe']);router['get'](_0x899f('0xc'),auth[_0x899f('0x9')](),controller[_0x899f('0xd')]);router[_0x899f('0xe')]('/',auth[_0x899f('0x9')](),controller[_0x899f('0xf')]);router[_0x899f('0x10')]('/:id',auth[_0x899f('0x9')](),controller[_0x899f('0x11')]);router[_0x899f('0x12')](_0x899f('0xc'),auth[_0x899f('0x9')](),controller[_0x899f('0x13')]);module[_0x899f('0x14')]=router; \ No newline at end of file +var _0xfd4d=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','/describe','isAuthenticated','show','post','create','put','delete','/:id','destroy','exports','multer','path','express'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xfd4d,0x18c));var _0xdfd4=function(_0x4aa1ba,_0xf2e76a){_0x4aa1ba=_0x4aa1ba-0x0;var _0x5ec871=_0xfd4d[_0x4aa1ba];return _0x5ec871;};'use strict';var multer=require(_0xdfd4('0x0'));var util=require('util');var path=require(_0xdfd4('0x1'));var timeout=require('connect-timeout');var express=require(_0xdfd4('0x2'));var router=express[_0xdfd4('0x3')]();var fs_extra=require(_0xdfd4('0x4'));var auth=require(_0xdfd4('0x5'));var interaction=require(_0xdfd4('0x6'));var config=require('../../config/environment');var controller=require(_0xdfd4('0x7'));router[_0xdfd4('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdfd4('0x8')](_0xdfd4('0x9'),auth[_0xdfd4('0xa')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xdfd4('0xb')]);router[_0xdfd4('0xc')]('/',auth['isAuthenticated'](),controller[_0xdfd4('0xd')]);router[_0xdfd4('0xe')]('/:id',auth[_0xdfd4('0xa')](),controller['update']);router[_0xdfd4('0xf')](_0xdfd4('0x10'),auth['isAuthenticated'](),controller[_0xdfd4('0x11')]);module[_0xdfd4('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 37142bd..c1f322e 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 _0xa39e=['STRING','INTEGER','sequelize','exports'];(function(_0x379d2f,_0x14e055){var _0x2bfbc3=function(_0x39c5e2){while(--_0x39c5e2){_0x379d2f['push'](_0x379d2f['shift']());}};_0x2bfbc3(++_0x14e055);}(_0xa39e,0x106));var _0xea39=function(_0x3917d3,_0xab2510){_0x3917d3=_0x3917d3-0x0;var _0x36b6fa=_0xa39e[_0x3917d3];return _0x36b6fa;};'use strict';var Sequelize=require(_0xea39('0x0'));module[_0xea39('0x1')]={'name':{'type':Sequelize[_0xea39('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xea39('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xea39('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xd8b6=['exports','INTEGER','STRING','sequelize'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xd8b6,0xc3));var _0x6d8b=function(_0x133345,_0x4a78b1){_0x133345=_0x133345-0x0;var _0x51f3d2=_0xd8b6[_0x133345];return _0x51f3d2;};'use strict';var Sequelize=require(_0x6d8b('0x0'));module[_0x6d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x6d8b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6d8b('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 325de51..7c100f5 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 _0x8952=['filter','VIRTUAL','merge','options','findAll','rows','show','params','keys','includeAll','include','catch','create','body','destroy','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','end','stack','name','map','UserProfileResource','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x8952,0x17e));var _0x2895=function(_0x3f8c8c,_0x5eb568){_0x3f8c8c=_0x3f8c8c-0x0;var _0x355bce=_0x8952[_0x3f8c8c];return _0x355bce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2895('0x0'));var zipdir=require(_0x2895('0x1'));var jsonpatch=require(_0x2895('0x2'));var rp=require(_0x2895('0x3'));var moment=require(_0x2895('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2895('0x5'));var util=require(_0x2895('0x6'));var path=require(_0x2895('0x7'));var sox=require('sox');var csv=require(_0x2895('0x8'));var ejs=require(_0x2895('0x9'));var fs=require('fs');var fs_extra=require(_0x2895('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2895('0xb'));var jsforce=require(_0x2895('0xc'));var deskjs=require(_0x2895('0xd'));var toCsv=require(_0x2895('0x8'));var querystring=require(_0x2895('0xe'));var Papa=require('papaparse');var Redis=require(_0x2895('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2895('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2895('0x11'));var utils=require(_0x2895('0x12'));var config=require(_0x2895('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2895('0x14'))['db'];function respondWithStatusCode(_0x3924be,_0x4b1342){_0x4b1342=_0x4b1342||0xcc;return function(_0x32574c){if(_0x32574c){return _0x3924be[_0x2895('0x15')](_0x4b1342);}return _0x3924be['status'](_0x4b1342)['end']();};}function respondWithResult(_0x1d1493,_0x2ca2ac){_0x2ca2ac=_0x2ca2ac||0xc8;return function(_0x5777a0){if(_0x5777a0){return _0x1d1493[_0x2895('0x16')](_0x2ca2ac)[_0x2895('0x17')](_0x5777a0);}};}function respondWithFilteredResult(_0x27b50e,_0x1ae013){return function(_0x1d3659){if(_0x1d3659){var _0x2627e6=typeof _0x1ae013[_0x2895('0x18')]===_0x2895('0x19')&&typeof _0x1ae013[_0x2895('0x1a')]===_0x2895('0x19');var _0x10a1bf=_0x1d3659[_0x2895('0x1b')];var _0xbf8b63=_0x2627e6?0x0:_0x1ae013[_0x2895('0x18')];var _0x155124=_0x2627e6?_0x1d3659[_0x2895('0x1b')]:_0x1ae013[_0x2895('0x18')]+_0x1ae013[_0x2895('0x1a')];var _0x5a8eab;if(_0x155124>=_0x10a1bf){_0x155124=_0x10a1bf;_0x5a8eab=0xc8;}else{_0x5a8eab=0xce;}_0x27b50e['status'](_0x5a8eab);return _0x27b50e['set'](_0x2895('0x1c'),_0xbf8b63+'-'+_0x155124+'/'+_0x10a1bf)[_0x2895('0x17')](_0x1d3659);}return null;};}function patchUpdates(_0x3ec4da){return function(_0x593e47){try{jsonpatch[_0x2895('0x1d')](_0x593e47,_0x3ec4da,!![]);}catch(_0x190b79){return BPromise[_0x2895('0x1e')](_0x190b79);}return _0x593e47[_0x2895('0x1f')]();};}function saveUpdates(_0x8b75e0,_0x5dbbfe){return function(_0x30c6c3){if(_0x30c6c3){return _0x30c6c3[_0x2895('0x20')](_0x8b75e0)['then'](function(_0x142e58){return _0x142e58;});}return null;};}function removeEntity(_0x384357,_0x6f8ad4){return function(_0x511286){if(_0x511286){return _0x511286['destroy']()[_0x2895('0x21')](function(){_0x384357[_0x2895('0x16')](0xcc)[_0x2895('0x22')]();});}};}function handleEntityNotFound(_0x4a21cf,_0x3d3320){return function(_0x3690ce){if(!_0x3690ce){_0x4a21cf['sendStatus'](0x194);}return _0x3690ce;};}function handleError(_0x293ad3,_0x127540){_0x127540=_0x127540||0x1f4;return function(_0x2cd4df){logger['error'](_0x2cd4df[_0x2895('0x23')]);if(_0x2cd4df[_0x2895('0x24')]){delete _0x2cd4df['name'];}_0x293ad3[_0x2895('0x16')](_0x127540)['send'](_0x2cd4df);};}exports['index']=function(_0x18a935,_0x4ee2cc){var _0xfa4f85={},_0x381538={},_0x4fdd94={'count':0x0,'rows':[]};var _0x5574bf=_[_0x2895('0x25')](db[_0x2895('0x26')][_0x2895('0x27')],function(_0x14e343){return{'name':_0x14e343[_0x2895('0x28')],'type':_0x14e343[_0x2895('0x29')][_0x2895('0x2a')]};});_0x381538['model']=_[_0x2895('0x25')](_0x5574bf,_0x2895('0x24'));_0x381538[_0x2895('0x2b')]=_['keys'](_0x18a935[_0x2895('0x2b')]);_0x381538[_0x2895('0x2c')]=_[_0x2895('0x2d')](_0x381538[_0x2895('0x2e')],_0x381538['query']);_0xfa4f85[_0x2895('0x2f')]=_[_0x2895('0x2d')](_0x381538[_0x2895('0x2e')],qs[_0x2895('0x30')](_0x18a935[_0x2895('0x2b')]['fields']));_0xfa4f85['attributes']=_0xfa4f85[_0x2895('0x2f')][_0x2895('0x31')]?_0xfa4f85['attributes']:_0x381538[_0x2895('0x2e')];if(!_0x18a935['query'][_0x2895('0x32')](_0x2895('0x33'))){_0xfa4f85['limit']=qs[_0x2895('0x1a')](_0x18a935['query'][_0x2895('0x1a')]);_0xfa4f85['offset']=qs['offset'](_0x18a935[_0x2895('0x2b')][_0x2895('0x18')]);}_0xfa4f85[_0x2895('0x34')]=qs['sort'](_0x18a935[_0x2895('0x2b')][_0x2895('0x35')]);_0xfa4f85[_0x2895('0x36')]=qs[_0x2895('0x2c')](_[_0x2895('0x37')](_0x18a935[_0x2895('0x2b')],_0x381538[_0x2895('0x2c')]),_0x5574bf);if(_0x18a935[_0x2895('0x2b')][_0x2895('0x38')]){_0xfa4f85[_0x2895('0x36')]=_['merge'](_0xfa4f85[_0x2895('0x36')],{'$or':_[_0x2895('0x25')](_0x5574bf,function(_0x47413d){if(_0x47413d[_0x2895('0x29')]!==_0x2895('0x39')){var _0x12d7d8={};_0x12d7d8[_0x47413d[_0x2895('0x24')]]={'$like':'%'+_0x18a935['query']['filter']+'%'};return _0x12d7d8;}})});}_0xfa4f85=_[_0x2895('0x3a')]({},_0xfa4f85,_0x18a935[_0x2895('0x3b')]);var _0x24b9e0={'where':_0xfa4f85[_0x2895('0x36')]};return db[_0x2895('0x26')][_0x2895('0x1b')](_0x24b9e0)['then'](function(_0x5d18ef){_0x4fdd94[_0x2895('0x1b')]=_0x5d18ef;if(_0x18a935[_0x2895('0x2b')]['includeAll']){_0xfa4f85['include']=[{'all':!![]}];}return db[_0x2895('0x26')][_0x2895('0x3c')](_0xfa4f85);})[_0x2895('0x21')](function(_0x28967f){_0x4fdd94[_0x2895('0x3d')]=_0x28967f;return _0x4fdd94;})[_0x2895('0x21')](respondWithFilteredResult(_0x4ee2cc,_0xfa4f85))['catch'](handleError(_0x4ee2cc,null));};exports[_0x2895('0x3e')]=function(_0x2cfb24,_0x18ca24){var _0x1537fd={'raw':![],'where':{'id':_0x2cfb24[_0x2895('0x3f')]['id']}},_0x4af6d6={};_0x4af6d6[_0x2895('0x2e')]=_[_0x2895('0x40')](db[_0x2895('0x26')]['rawAttributes']);_0x4af6d6['query']=_[_0x2895('0x40')](_0x2cfb24[_0x2895('0x2b')]);_0x4af6d6[_0x2895('0x2c')]=_[_0x2895('0x2d')](_0x4af6d6[_0x2895('0x2e')],_0x4af6d6['query']);_0x1537fd['attributes']=_[_0x2895('0x2d')](_0x4af6d6[_0x2895('0x2e')],qs[_0x2895('0x30')](_0x2cfb24[_0x2895('0x2b')][_0x2895('0x30')]));_0x1537fd[_0x2895('0x2f')]=_0x1537fd[_0x2895('0x2f')]['length']?_0x1537fd[_0x2895('0x2f')]:_0x4af6d6[_0x2895('0x2e')];if(_0x2cfb24[_0x2895('0x2b')][_0x2895('0x41')]){_0x1537fd[_0x2895('0x42')]=[{'all':!![]}];}_0x1537fd=_[_0x2895('0x3a')]({},_0x1537fd,_0x2cfb24[_0x2895('0x3b')]);return db[_0x2895('0x26')]['find'](_0x1537fd)[_0x2895('0x21')](handleEntityNotFound(_0x18ca24,null))[_0x2895('0x21')](respondWithResult(_0x18ca24,null))[_0x2895('0x43')](handleError(_0x18ca24,null));};exports['create']=function(_0xc85aa1,_0x5307a9){return db['UserProfileResource'][_0x2895('0x44')](_0xc85aa1[_0x2895('0x45')],{})[_0x2895('0x21')](respondWithResult(_0x5307a9,0xc9))[_0x2895('0x43')](handleError(_0x5307a9,null));};exports[_0x2895('0x20')]=function(_0x3cc331,_0x11e53a){if(_0x3cc331['body']['id']){delete _0x3cc331[_0x2895('0x45')]['id'];}return db[_0x2895('0x26')]['find']({'where':{'id':_0x3cc331['params']['id']}})['then'](handleEntityNotFound(_0x11e53a,null))[_0x2895('0x21')](saveUpdates(_0x3cc331[_0x2895('0x45')],null))[_0x2895('0x21')](respondWithResult(_0x11e53a,null))[_0x2895('0x43')](handleError(_0x11e53a,null));};exports[_0x2895('0x46')]=function(_0x3c5261,_0xaca46c){return db[_0x2895('0x26')][_0x2895('0x47')]({'where':{'id':_0x3c5261[_0x2895('0x3f')]['id']}})[_0x2895('0x21')](handleEntityNotFound(_0xaca46c,null))[_0x2895('0x21')](removeEntity(_0xaca46c,null))[_0x2895('0x43')](handleError(_0xaca46c,null));};exports[_0x2895('0x48')]=function(_0x356d35,_0x3c1135){return db[_0x2895('0x26')][_0x2895('0x48')]()[_0x2895('0x21')](respondWithResult(_0x3c1135,null))[_0x2895('0x43')](handleError(_0x3c1135,null));}; \ No newline at end of file +var _0xd943=['jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','UserProfileResource','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','merge','includeAll','include','findAll','catch','show','params','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','crypto'];(function(_0x5f06c4,_0x59ca1d){var _0x32dcc7=function(_0x1aba08){while(--_0x1aba08){_0x5f06c4['push'](_0x5f06c4['shift']());}};_0x32dcc7(++_0x59ca1d);}(_0xd943,0x15d));var _0x3d94=function(_0x29343c,_0x59361b){_0x29343c=_0x29343c-0x0;var _0x167d3d=_0xd943[_0x29343c];return _0x167d3d;};'use strict';var emlformat=require(_0x3d94('0x0'));var rimraf=require(_0x3d94('0x1'));var zipdir=require(_0x3d94('0x2'));var jsonpatch=require(_0x3d94('0x3'));var rp=require('request-promise');var moment=require(_0x3d94('0x4'));var BPromise=require(_0x3d94('0x5'));var Mustache=require(_0x3d94('0x6'));var util=require(_0x3d94('0x7'));var path=require(_0x3d94('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3d94('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d94('0xa'));var jsforce=require(_0x3d94('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3d94('0xc'));var Papa=require(_0x3d94('0xd'));var Redis=require(_0x3d94('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3d94('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d94('0x10'));var logger=require(_0x3d94('0x11'))('api');var utils=require(_0x3d94('0x12'));var config=require(_0x3d94('0x13'));var licenseUtil=require(_0x3d94('0x14'));var db=require(_0x3d94('0x15'))['db'];function respondWithStatusCode(_0x15a392,_0x548b89){_0x548b89=_0x548b89||0xcc;return function(_0x96c54b){if(_0x96c54b){return _0x15a392[_0x3d94('0x16')](_0x548b89);}return _0x15a392[_0x3d94('0x17')](_0x548b89)['end']();};}function respondWithResult(_0x24e8b9,_0x29608d){_0x29608d=_0x29608d||0xc8;return function(_0x7d6969){if(_0x7d6969){return _0x24e8b9['status'](_0x29608d)[_0x3d94('0x18')](_0x7d6969);}};}function respondWithFilteredResult(_0x340818,_0x292419){return function(_0x34098e){if(_0x34098e){var _0xaf939a=typeof _0x292419[_0x3d94('0x19')]===_0x3d94('0x1a')&&typeof _0x292419[_0x3d94('0x1b')]==='undefined';var _0x22676a=_0x34098e[_0x3d94('0x1c')];var _0x2acee3=_0xaf939a?0x0:_0x292419[_0x3d94('0x19')];var _0x4afc92=_0xaf939a?_0x34098e[_0x3d94('0x1c')]:_0x292419[_0x3d94('0x19')]+_0x292419['limit'];var _0x9bca24;if(_0x4afc92>=_0x22676a){_0x4afc92=_0x22676a;_0x9bca24=0xc8;}else{_0x9bca24=0xce;}_0x340818['status'](_0x9bca24);return _0x340818[_0x3d94('0x1d')](_0x3d94('0x1e'),_0x2acee3+'-'+_0x4afc92+'/'+_0x22676a)[_0x3d94('0x18')](_0x34098e);}return null;};}function patchUpdates(_0x1e9ec2){return function(_0x35a3cc){try{jsonpatch['apply'](_0x35a3cc,_0x1e9ec2,!![]);}catch(_0x578002){return BPromise[_0x3d94('0x1f')](_0x578002);}return _0x35a3cc[_0x3d94('0x20')]();};}function saveUpdates(_0x9c2f2c,_0x4edee4){return function(_0x30af25){if(_0x30af25){return _0x30af25[_0x3d94('0x21')](_0x9c2f2c)[_0x3d94('0x22')](function(_0x384f76){return _0x384f76;});}return null;};}function removeEntity(_0x395133,_0x4093a4){return function(_0x295493){if(_0x295493){return _0x295493[_0x3d94('0x23')]()[_0x3d94('0x22')](function(){_0x395133[_0x3d94('0x17')](0xcc)[_0x3d94('0x24')]();});}};}function handleEntityNotFound(_0x192839,_0x292976){return function(_0x3496c3){if(!_0x3496c3){_0x192839[_0x3d94('0x16')](0x194);}return _0x3496c3;};}function handleError(_0x5b3b31,_0x123183){_0x123183=_0x123183||0x1f4;return function(_0x558fd2){logger[_0x3d94('0x25')](_0x558fd2[_0x3d94('0x26')]);if(_0x558fd2[_0x3d94('0x27')]){delete _0x558fd2[_0x3d94('0x27')];}_0x5b3b31[_0x3d94('0x17')](_0x123183)[_0x3d94('0x28')](_0x558fd2);};}exports[_0x3d94('0x29')]=function(_0x47d6ab,_0x584c4a){var _0x362642={},_0x4813e1={},_0x4dd410={'count':0x0,'rows':[]};var _0x23d20d=_['map'](db[_0x3d94('0x2a')][_0x3d94('0x2b')],function(_0x32403a){return{'name':_0x32403a['fieldName'],'type':_0x32403a[_0x3d94('0x2c')]['key']};});_0x4813e1[_0x3d94('0x2d')]=_['map'](_0x23d20d,_0x3d94('0x27'));_0x4813e1[_0x3d94('0x2e')]=_[_0x3d94('0x2f')](_0x47d6ab[_0x3d94('0x2e')]);_0x4813e1['filters']=_[_0x3d94('0x30')](_0x4813e1['model'],_0x4813e1[_0x3d94('0x2e')]);_0x362642[_0x3d94('0x31')]=_['intersection'](_0x4813e1['model'],qs[_0x3d94('0x32')](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x32')]));_0x362642['attributes']=_0x362642[_0x3d94('0x31')][_0x3d94('0x33')]?_0x362642['attributes']:_0x4813e1[_0x3d94('0x2d')];if(!_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x34')](_0x3d94('0x35'))){_0x362642[_0x3d94('0x1b')]=qs['limit'](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x1b')]);_0x362642[_0x3d94('0x19')]=qs[_0x3d94('0x19')](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x19')]);}_0x362642['order']=qs['sort'](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x36')]);_0x362642[_0x3d94('0x37')]=qs[_0x3d94('0x38')](_[_0x3d94('0x39')](_0x47d6ab[_0x3d94('0x2e')],_0x4813e1[_0x3d94('0x38')]),_0x23d20d);if(_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3a')]){_0x362642[_0x3d94('0x37')]=_['merge'](_0x362642[_0x3d94('0x37')],{'$or':_[_0x3d94('0x3b')](_0x23d20d,function(_0x361fbb){if(_0x361fbb[_0x3d94('0x2c')]!=='VIRTUAL'){var _0xcf7a73={};_0xcf7a73[_0x361fbb[_0x3d94('0x27')]]={'$like':'%'+_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3a')]+'%'};return _0xcf7a73;}})});}_0x362642=_[_0x3d94('0x3c')]({},_0x362642,_0x47d6ab['options']);var _0x217e5e={'where':_0x362642[_0x3d94('0x37')]};return db[_0x3d94('0x2a')]['count'](_0x217e5e)['then'](function(_0x4d8a8f){_0x4dd410['count']=_0x4d8a8f;if(_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3d')]){_0x362642[_0x3d94('0x3e')]=[{'all':!![]}];}return db[_0x3d94('0x2a')][_0x3d94('0x3f')](_0x362642);})[_0x3d94('0x22')](function(_0x3a3898){_0x4dd410['rows']=_0x3a3898;return _0x4dd410;})['then'](respondWithFilteredResult(_0x584c4a,_0x362642))[_0x3d94('0x40')](handleError(_0x584c4a,null));};exports[_0x3d94('0x41')]=function(_0x512cef,_0x2d0aa2){var _0x4af4b6={'raw':![],'where':{'id':_0x512cef[_0x3d94('0x42')]['id']}},_0x1361fb={};_0x1361fb[_0x3d94('0x2d')]=_[_0x3d94('0x2f')](db[_0x3d94('0x2a')]['rawAttributes']);_0x1361fb[_0x3d94('0x2e')]=_[_0x3d94('0x2f')](_0x512cef[_0x3d94('0x2e')]);_0x1361fb['filters']=_[_0x3d94('0x30')](_0x1361fb['model'],_0x1361fb['query']);_0x4af4b6[_0x3d94('0x31')]=_[_0x3d94('0x30')](_0x1361fb[_0x3d94('0x2d')],qs[_0x3d94('0x32')](_0x512cef['query'][_0x3d94('0x32')]));_0x4af4b6['attributes']=_0x4af4b6[_0x3d94('0x31')][_0x3d94('0x33')]?_0x4af4b6[_0x3d94('0x31')]:_0x1361fb[_0x3d94('0x2d')];if(_0x512cef[_0x3d94('0x2e')][_0x3d94('0x3d')]){_0x4af4b6[_0x3d94('0x3e')]=[{'all':!![]}];}_0x4af4b6=_['merge']({},_0x4af4b6,_0x512cef[_0x3d94('0x43')]);return db[_0x3d94('0x2a')]['find'](_0x4af4b6)['then'](handleEntityNotFound(_0x2d0aa2,null))[_0x3d94('0x22')](respondWithResult(_0x2d0aa2,null))[_0x3d94('0x40')](handleError(_0x2d0aa2,null));};exports['create']=function(_0x3c8571,_0x13fda9){return db[_0x3d94('0x2a')][_0x3d94('0x44')](_0x3c8571[_0x3d94('0x45')],{})[_0x3d94('0x22')](respondWithResult(_0x13fda9,0xc9))[_0x3d94('0x40')](handleError(_0x13fda9,null));};exports[_0x3d94('0x21')]=function(_0x60279f,_0x2429bc){if(_0x60279f[_0x3d94('0x45')]['id']){delete _0x60279f[_0x3d94('0x45')]['id'];}return db[_0x3d94('0x2a')][_0x3d94('0x46')]({'where':{'id':_0x60279f[_0x3d94('0x42')]['id']}})['then'](handleEntityNotFound(_0x2429bc,null))[_0x3d94('0x22')](saveUpdates(_0x60279f[_0x3d94('0x45')],null))[_0x3d94('0x22')](respondWithResult(_0x2429bc,null))[_0x3d94('0x40')](handleError(_0x2429bc,null));};exports[_0x3d94('0x23')]=function(_0x3ce0be,_0x129783){return db[_0x3d94('0x2a')][_0x3d94('0x46')]({'where':{'id':_0x3ce0be['params']['id']}})[_0x3d94('0x22')](handleEntityNotFound(_0x129783,null))['then'](removeEntity(_0x129783,null))[_0x3d94('0x40')](handleError(_0x129783,null));};exports[_0x3d94('0x47')]=function(_0x4af4c2,_0x255630){return db['UserProfileResource']['describe']()[_0x3d94('0x22')](respondWithResult(_0x255630,null))['catch'](handleError(_0x255630,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 4c857d5..4bf34f1 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 _0x4b61=['./userProfileResource.attributes','exports','UserProfileResource','compositeIndex','resourceId','lodash','util','api','bluebird','request-promise','path','../../config/environment'];(function(_0x402567,_0x580286){var _0x392944=function(_0x3a3f0e){while(--_0x3a3f0e){_0x402567['push'](_0x402567['shift']());}};_0x392944(++_0x580286);}(_0x4b61,0x89));var _0x14b6=function(_0x2a4095,_0x13f4f0){_0x2a4095=_0x2a4095-0x0;var _0x52eeab=_0x4b61[_0x2a4095];return _0x52eeab;};'use strict';var _=require(_0x14b6('0x0'));var util=require(_0x14b6('0x1'));var logger=require('../../config/logger')(_0x14b6('0x2'));var moment=require('moment');var BPromise=require(_0x14b6('0x3'));var rp=require(_0x14b6('0x4'));var fs=require('fs');var path=require(_0x14b6('0x5'));var rimraf=require('rimraf');var config=require(_0x14b6('0x6'));var attributes=require(_0x14b6('0x7'));module[_0x14b6('0x8')]=function(_0x13d057,_0x1d7bb9){return _0x13d057['define'](_0x14b6('0x9'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x14b6('0xa'),'fields':[_0x14b6('0xb'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbe27=['compositeIndex','resourceId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./userProfileResource.attributes','exports','define','user_profile_has_resources'];(function(_0x1f246f,_0x1f3cd8){var _0x2c393d=function(_0x3d21f5){while(--_0x3d21f5){_0x1f246f['push'](_0x1f246f['shift']());}};_0x2c393d(++_0x1f3cd8);}(_0xbe27,0x16e));var _0x7be2=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbe27[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x7be2('0x0'));var util=require(_0x7be2('0x1'));var logger=require(_0x7be2('0x2'))(_0x7be2('0x3'));var moment=require('moment');var BPromise=require(_0x7be2('0x4'));var rp=require(_0x7be2('0x5'));var fs=require('fs');var path=require(_0x7be2('0x6'));var rimraf=require(_0x7be2('0x7'));var config=require('../../config/environment');var attributes=require(_0x7be2('0x8'));module[_0x7be2('0x9')]=function(_0x6b1952,_0x4d7941){return _0x6b1952[_0x7be2('0xa')]('UserProfileResource',attributes,{'tableName':_0x7be2('0xb'),'paranoid':![],'indexes':[{'name':_0x7be2('0xc'),'fields':[_0x7be2('0xd'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index e7ba36a..d0113fd 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 _0x44e6=['debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','UserProfileResource,\x20%s,\x20%s'];(function(_0x3952a9,_0xa41a1f){var _0x3834c9=function(_0x59121a){while(--_0x59121a){_0x3952a9['push'](_0x3952a9['shift']());}};_0x3834c9(++_0xa41a1f);}(_0x44e6,0x113));var _0x644e=function(_0x1733e6,_0x388eda){_0x1733e6=_0x1733e6-0x0;var _0x5e11d1=_0x44e6[_0x1733e6];return _0x5e11d1;};'use strict';var _=require(_0x644e('0x0'));var util=require(_0x644e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x644e('0x2'))['db'];var utils=require(_0x644e('0x3'));var logger=require(_0x644e('0x4'))(_0x644e('0x5'));var config=require(_0x644e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x644e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x378fbc,_0x1d6498,_0x4721f2){return new BPromise(function(_0x3b2947,_0x2daff7){return client['request'](_0x378fbc,_0x4721f2)[_0x644e('0x8')](function(_0x19e837){logger['info'](_0x644e('0x9'),_0x1d6498,'request\x20sent');logger[_0x644e('0xa')](_0x644e('0xb'),_0x1d6498,_0x644e('0xc'),JSON['stringify'](_0x19e837));if(_0x19e837[_0x644e('0xd')]){if(_0x19e837['error'][_0x644e('0xe')]===0x1f4){logger[_0x644e('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x1d6498,_0x19e837[_0x644e('0xd')][_0x644e('0xf')]);return _0x2daff7(_0x19e837[_0x644e('0xd')][_0x644e('0xf')]);}logger[_0x644e('0xd')](_0x644e('0x9'),_0x1d6498,_0x19e837[_0x644e('0xd')]['message']);return _0x3b2947(_0x19e837[_0x644e('0xd')][_0x644e('0xf')]);}else{logger[_0x644e('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x1d6498,_0x644e('0xc'));_0x3b2947(_0x19e837[_0x644e('0x11')][_0x644e('0xf')]);}})[_0x644e('0x12')](function(_0x3f79bb){logger[_0x644e('0xd')](_0x644e('0x9'),_0x1d6498,_0x3f79bb);_0x2daff7(_0x3f79bb);});});} \ No newline at end of file +var _0x6297=['../../config/environment','jayson/promise','client','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','rpc'];(function(_0x3dba21,_0x12ec5d){var _0x2e4d12=function(_0x400265){while(--_0x400265){_0x3dba21['push'](_0x3dba21['shift']());}};_0x2e4d12(++_0x12ec5d);}(_0x6297,0x10c));var _0x7629=function(_0x15929a,_0x45a0f2){_0x15929a=_0x15929a-0x0;var _0x3cdc20=_0x6297[_0x15929a];return _0x3cdc20;};'use strict';var _=require(_0x7629('0x0'));var util=require(_0x7629('0x1'));var moment=require(_0x7629('0x2'));var BPromise=require('bluebird');var rs=require(_0x7629('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7629('0x4'));var config=require(_0x7629('0x5'));var jayson=require(_0x7629('0x6'));var client=jayson[_0x7629('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d14cb,_0x457e16,_0x40e07a){return new BPromise(function(_0x3cc478,_0x408e5d){return client[_0x7629('0x8')](_0x3d14cb,_0x40e07a)[_0x7629('0x9')](function(_0x3bc45e){logger[_0x7629('0xa')](_0x7629('0xb'),_0x457e16,_0x7629('0xc'));logger[_0x7629('0xd')](_0x7629('0xe'),_0x457e16,_0x7629('0xc'),JSON[_0x7629('0xf')](_0x3bc45e));if(_0x3bc45e[_0x7629('0x10')]){if(_0x3bc45e['error'][_0x7629('0x11')]===0x1f4){logger['error'](_0x7629('0xb'),_0x457e16,_0x3bc45e['error'][_0x7629('0x12')]);return _0x408e5d(_0x3bc45e['error'][_0x7629('0x12')]);}logger['error'](_0x7629('0xb'),_0x457e16,_0x3bc45e[_0x7629('0x10')][_0x7629('0x12')]);return _0x3cc478(_0x3bc45e[_0x7629('0x10')]['message']);}else{logger[_0x7629('0xa')](_0x7629('0xb'),_0x457e16,_0x7629('0xc'));_0x3cc478(_0x3bc45e[_0x7629('0x13')][_0x7629('0x12')]);}})[_0x7629('0x14')](function(_0x7c1d52){logger[_0x7629('0x10')](_0x7629('0xb'),_0x457e16,_0x7c1d52);_0x408e5d(_0x7c1d52);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index c495939..71a9ccd 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 _0xba54=['/:id','post','create','put','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','index','/describe','isAuthenticated'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xba54,0xb2));var _0x4ba5=function(_0x32870c,_0x78e575){_0x32870c=_0x32870c-0x0;var _0x43833e=_0xba54[_0x32870c];return _0x43833e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4ba5('0x0'));var timeout=require(_0x4ba5('0x1'));var express=require(_0x4ba5('0x2'));var router=express['Router']();var fs_extra=require(_0x4ba5('0x3'));var auth=require(_0x4ba5('0x4'));var interaction=require(_0x4ba5('0x5'));var config=require(_0x4ba5('0x6'));var controller=require(_0x4ba5('0x7'));router[_0x4ba5('0x8')]('/',auth['isAuthenticated'](),controller[_0x4ba5('0x9')]);router[_0x4ba5('0x8')](_0x4ba5('0xa'),auth[_0x4ba5('0xb')](),controller['describe']);router[_0x4ba5('0x8')](_0x4ba5('0xc'),auth[_0x4ba5('0xb')](),controller['show']);router[_0x4ba5('0xd')]('/',auth[_0x4ba5('0xb')](),controller[_0x4ba5('0xe')]);router[_0x4ba5('0xf')]('/:id',auth[_0x4ba5('0xb')](),controller['update']);router[_0x4ba5('0x10')](_0x4ba5('0xc'),auth[_0x4ba5('0xb')](),controller[_0x4ba5('0x11')]);module[_0x4ba5('0x12')]=router; \ No newline at end of file +var _0x9242=['post','create','put','update','delete','destroy','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x33e313,_0x441c19){var _0x36c2d1=function(_0x2820e5){while(--_0x2820e5){_0x33e313['push'](_0x33e313['shift']());}};_0x36c2d1(++_0x441c19);}(_0x9242,0x182));var _0x2924=function(_0x4fa438,_0x1f15a7){_0x4fa438=_0x4fa438-0x0;var _0x4e3958=_0x9242[_0x4fa438];return _0x4e3958;};'use strict';var multer=require(_0x2924('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2924('0x1'));var express=require(_0x2924('0x2'));var router=express['Router']();var fs_extra=require(_0x2924('0x3'));var auth=require(_0x2924('0x4'));var interaction=require(_0x2924('0x5'));var config=require('../../config/environment');var controller=require(_0x2924('0x6'));router[_0x2924('0x7')]('/',auth[_0x2924('0x8')](),controller[_0x2924('0x9')]);router['get'](_0x2924('0xa'),auth['isAuthenticated'](),controller[_0x2924('0xb')]);router[_0x2924('0x7')](_0x2924('0xc'),auth[_0x2924('0x8')](),controller[_0x2924('0xd')]);router[_0x2924('0xe')]('/',auth[_0x2924('0x8')](),controller[_0x2924('0xf')]);router[_0x2924('0x10')]('/:id',auth[_0x2924('0x8')](),controller[_0x2924('0x11')]);router[_0x2924('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x2924('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 96ed2e2..b2d1601 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 _0x1399=['sequelize','exports','STRING','BOOLEAN','setDataValue','crudPermissions','getDataValue'];(function(_0x4a9be9,_0x3f3d64){var _0x1e12b5=function(_0x558a38){while(--_0x558a38){_0x4a9be9['push'](_0x4a9be9['shift']());}};_0x1e12b5(++_0x3f3d64);}(_0x1399,0x16c));var _0x9139=function(_0x49296c,_0x14f891){_0x49296c=_0x49296c-0x0;var _0x3f0d68=_0x1399[_0x49296c];return _0x3f0d68;};'use strict';var Sequelize=require(_0x9139('0x0'));module[_0x9139('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x9139('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x9139('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x9139('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x9139('0x2')],'set':function(_0x28f155){this[_0x9139('0x4')](_0x9139('0x5'),_0x28f155?_0x28f155['join'](''):[]);},'get':function(){return this['getDataValue'](_0x9139('0x5'))?this[_0x9139('0x6')](_0x9139('0x5'))['split'](''):[];}}}; \ No newline at end of file +var _0xa30a=['exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','getDataValue','split','sequelize'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xaa30('0x0'));module[_0xaa30('0x1')]={'name':{'type':Sequelize[_0xaa30('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0xaa30('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xaa30('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xaa30('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xaa30('0x2')],'set':function(_0x2a9b06){this[_0xaa30('0x5')](_0xaa30('0x6'),_0x2a9b06?_0x2a9b06['join'](''):[]);},'get':function(){return this[_0xaa30('0x7')]('crudPermissions')?this[_0xaa30('0x7')](_0xaa30('0x6'))[_0xaa30('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 2769585..b3b57a7 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 _0xf7bb=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','end','error','name','index','map','UserProfileSection','fieldName','key','model','query'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0xf7bb,0xae));var _0xbf7b=function(_0x17042b,_0x595c02){_0x17042b=_0x17042b-0x0;var _0x246bf6=_0xf7bb[_0x17042b];return _0x246bf6;};'use strict';var emlformat=require(_0xbf7b('0x0'));var rimraf=require(_0xbf7b('0x1'));var zipdir=require(_0xbf7b('0x2'));var jsonpatch=require(_0xbf7b('0x3'));var rp=require(_0xbf7b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbf7b('0x5'));var util=require(_0xbf7b('0x6'));var path=require(_0xbf7b('0x7'));var sox=require(_0xbf7b('0x8'));var csv=require(_0xbf7b('0x9'));var ejs=require(_0xbf7b('0xa'));var fs=require('fs');var fs_extra=require(_0xbf7b('0xb'));var _=require(_0xbf7b('0xc'));var squel=require(_0xbf7b('0xd'));var crypto=require(_0xbf7b('0xe'));var jsforce=require(_0xbf7b('0xf'));var deskjs=require(_0xbf7b('0x10'));var toCsv=require(_0xbf7b('0x9'));var querystring=require(_0xbf7b('0x11'));var Papa=require(_0xbf7b('0x12'));var Redis=require('ioredis');var authService=require(_0xbf7b('0x13'));var qs=require(_0xbf7b('0x14'));var as=require(_0xbf7b('0x15'));var hardwareService=require(_0xbf7b('0x16'));var logger=require(_0xbf7b('0x17'))(_0xbf7b('0x18'));var utils=require(_0xbf7b('0x19'));var config=require(_0xbf7b('0x1a'));var licenseUtil=require(_0xbf7b('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x253a1a,_0x171d82){_0x171d82=_0x171d82||0xcc;return function(_0x4e3d44){if(_0x4e3d44){return _0x253a1a[_0xbf7b('0x1c')](_0x171d82);}return _0x253a1a[_0xbf7b('0x1d')](_0x171d82)['end']();};}function respondWithResult(_0x48f809,_0x2bdf8f){_0x2bdf8f=_0x2bdf8f||0xc8;return function(_0x147cc7){if(_0x147cc7){return _0x48f809[_0xbf7b('0x1d')](_0x2bdf8f)['json'](_0x147cc7);}};}function respondWithFilteredResult(_0x325f6f,_0xd95944){return function(_0x552902){if(_0x552902){var _0x3310ca=typeof _0xd95944[_0xbf7b('0x1e')]===_0xbf7b('0x1f')&&typeof _0xd95944[_0xbf7b('0x20')]===_0xbf7b('0x1f');var _0x46ad70=_0x552902[_0xbf7b('0x21')];var _0x16f5b1=_0x3310ca?0x0:_0xd95944['offset'];var _0x1894cf=_0x3310ca?_0x552902[_0xbf7b('0x21')]:_0xd95944[_0xbf7b('0x1e')]+_0xd95944[_0xbf7b('0x20')];var _0x11fe55;if(_0x1894cf>=_0x46ad70){_0x1894cf=_0x46ad70;_0x11fe55=0xc8;}else{_0x11fe55=0xce;}_0x325f6f[_0xbf7b('0x1d')](_0x11fe55);return _0x325f6f['set'](_0xbf7b('0x22'),_0x16f5b1+'-'+_0x1894cf+'/'+_0x46ad70)[_0xbf7b('0x23')](_0x552902);}return null;};}function patchUpdates(_0xba0b4){return function(_0x59c291){try{jsonpatch[_0xbf7b('0x24')](_0x59c291,_0xba0b4,!![]);}catch(_0x286667){return BPromise[_0xbf7b('0x25')](_0x286667);}return _0x59c291['save']();};}function saveUpdates(_0x31a129,_0x362759){return function(_0x52534f){if(_0x52534f){return _0x52534f[_0xbf7b('0x26')](_0x31a129)[_0xbf7b('0x27')](function(_0x1bc58c){return _0x1bc58c;});}return null;};}function removeEntity(_0x5ae411,_0x34bd37){return function(_0x1ee8bb){if(_0x1ee8bb){return _0x1ee8bb[_0xbf7b('0x28')]()[_0xbf7b('0x27')](function(){_0x5ae411[_0xbf7b('0x1d')](0xcc)[_0xbf7b('0x29')]();});}};}function handleEntityNotFound(_0x578188,_0x5eb514){return function(_0x53d156){if(!_0x53d156){_0x578188['sendStatus'](0x194);}return _0x53d156;};}function handleError(_0x2ded44,_0x181102){_0x181102=_0x181102||0x1f4;return function(_0x485052){logger[_0xbf7b('0x2a')](_0x485052['stack']);if(_0x485052[_0xbf7b('0x2b')]){delete _0x485052[_0xbf7b('0x2b')];}_0x2ded44[_0xbf7b('0x1d')](_0x181102)['send'](_0x485052);};}exports[_0xbf7b('0x2c')]=function(_0x2b3d75,_0x207228){var _0x17501f={},_0x1d676c={},_0x245b67={'count':0x0,'rows':[]};var _0x2a8977=_[_0xbf7b('0x2d')](db[_0xbf7b('0x2e')]['rawAttributes'],function(_0x4b82a2){return{'name':_0x4b82a2[_0xbf7b('0x2f')],'type':_0x4b82a2['type'][_0xbf7b('0x30')]};});_0x1d676c[_0xbf7b('0x31')]=_[_0xbf7b('0x2d')](_0x2a8977,_0xbf7b('0x2b'));_0x1d676c[_0xbf7b('0x32')]=_['keys'](_0x2b3d75[_0xbf7b('0x32')]);_0x1d676c[_0xbf7b('0x33')]=_[_0xbf7b('0x34')](_0x1d676c['model'],_0x1d676c[_0xbf7b('0x32')]);_0x17501f[_0xbf7b('0x35')]=_[_0xbf7b('0x34')](_0x1d676c['model'],qs[_0xbf7b('0x36')](_0x2b3d75[_0xbf7b('0x32')]['fields']));_0x17501f[_0xbf7b('0x35')]=_0x17501f[_0xbf7b('0x35')][_0xbf7b('0x37')]?_0x17501f[_0xbf7b('0x35')]:_0x1d676c[_0xbf7b('0x31')];if(!_0x2b3d75[_0xbf7b('0x32')][_0xbf7b('0x38')](_0xbf7b('0x39'))){_0x17501f[_0xbf7b('0x20')]=qs[_0xbf7b('0x20')](_0x2b3d75[_0xbf7b('0x32')]['limit']);_0x17501f['offset']=qs[_0xbf7b('0x1e')](_0x2b3d75['query'][_0xbf7b('0x1e')]);}_0x17501f[_0xbf7b('0x3a')]=qs['sort'](_0x2b3d75[_0xbf7b('0x32')][_0xbf7b('0x3b')]);_0x17501f[_0xbf7b('0x3c')]=qs[_0xbf7b('0x33')](_[_0xbf7b('0x3d')](_0x2b3d75[_0xbf7b('0x32')],_0x1d676c[_0xbf7b('0x33')]),_0x2a8977);if(_0x2b3d75[_0xbf7b('0x32')]['filter']){_0x17501f[_0xbf7b('0x3c')]=_[_0xbf7b('0x3e')](_0x17501f[_0xbf7b('0x3c')],{'$or':_[_0xbf7b('0x2d')](_0x2a8977,function(_0x24f092){if(_0x24f092[_0xbf7b('0x3f')]!==_0xbf7b('0x40')){var _0xabfa4a={};_0xabfa4a[_0x24f092[_0xbf7b('0x2b')]]={'$like':'%'+_0x2b3d75[_0xbf7b('0x32')]['filter']+'%'};return _0xabfa4a;}})});}_0x17501f=_[_0xbf7b('0x3e')]({},_0x17501f,_0x2b3d75['options']);var _0x46cf95={'where':_0x17501f[_0xbf7b('0x3c')]};return db['UserProfileSection'][_0xbf7b('0x21')](_0x46cf95)[_0xbf7b('0x27')](function(_0x36eae2){_0x245b67[_0xbf7b('0x21')]=_0x36eae2;if(_0x2b3d75[_0xbf7b('0x32')][_0xbf7b('0x41')]){_0x17501f[_0xbf7b('0x42')]=[{'all':!![]}];}return db[_0xbf7b('0x2e')][_0xbf7b('0x43')](_0x17501f);})[_0xbf7b('0x27')](function(_0xda026c){_0x245b67['rows']=_0xda026c;return _0x245b67;})[_0xbf7b('0x27')](respondWithFilteredResult(_0x207228,_0x17501f))[_0xbf7b('0x44')](handleError(_0x207228,null));};exports['show']=function(_0x4e7b3c,_0x47c4d3){var _0x40f69c={'raw':![],'where':{'id':_0x4e7b3c[_0xbf7b('0x45')]['id']}},_0xa35613={};_0xa35613[_0xbf7b('0x31')]=_['keys'](db['UserProfileSection'][_0xbf7b('0x46')]);_0xa35613[_0xbf7b('0x32')]=_['keys'](_0x4e7b3c[_0xbf7b('0x32')]);_0xa35613[_0xbf7b('0x33')]=_[_0xbf7b('0x34')](_0xa35613[_0xbf7b('0x31')],_0xa35613[_0xbf7b('0x32')]);_0x40f69c[_0xbf7b('0x35')]=_['intersection'](_0xa35613[_0xbf7b('0x31')],qs['fields'](_0x4e7b3c['query'][_0xbf7b('0x36')]));_0x40f69c[_0xbf7b('0x35')]=_0x40f69c[_0xbf7b('0x35')][_0xbf7b('0x37')]?_0x40f69c[_0xbf7b('0x35')]:_0xa35613[_0xbf7b('0x31')];if(_0x4e7b3c['query'][_0xbf7b('0x41')]){_0x40f69c[_0xbf7b('0x42')]=[{'all':!![]}];}_0x40f69c=_[_0xbf7b('0x3e')]({},_0x40f69c,_0x4e7b3c['options']);return db['UserProfileSection'][_0xbf7b('0x47')](_0x40f69c)['then'](handleEntityNotFound(_0x47c4d3,null))[_0xbf7b('0x27')](respondWithResult(_0x47c4d3,null))['catch'](handleError(_0x47c4d3,null));};exports['create']=function(_0x52a926,_0x1d9ef6){return db['UserProfileSection'][_0xbf7b('0x48')](_0x52a926['body'],{})['then'](respondWithResult(_0x1d9ef6,0xc9))[_0xbf7b('0x44')](handleError(_0x1d9ef6,null));};exports[_0xbf7b('0x26')]=function(_0x225e9b,_0x5d3bc2){if(_0x225e9b[_0xbf7b('0x49')]['id']){delete _0x225e9b[_0xbf7b('0x49')]['id'];}return db[_0xbf7b('0x2e')][_0xbf7b('0x47')]({'where':{'id':_0x225e9b['params']['id']}})[_0xbf7b('0x27')](handleEntityNotFound(_0x5d3bc2,null))[_0xbf7b('0x27')](saveUpdates(_0x225e9b[_0xbf7b('0x49')],null))[_0xbf7b('0x27')](respondWithResult(_0x5d3bc2,null))['catch'](handleError(_0x5d3bc2,null));};exports[_0xbf7b('0x28')]=function(_0x4712d6,_0x409b15){return db['UserProfileSection']['find']({'where':{'id':_0x4712d6['params']['id']}})[_0xbf7b('0x27')](handleEntityNotFound(_0x409b15,null))[_0xbf7b('0x27')](removeEntity(_0x409b15,null))[_0xbf7b('0x44')](handleError(_0x409b15,null));};exports[_0xbf7b('0x4a')]=function(_0x560c49,_0x46a163){return db[_0xbf7b('0x2e')]['describe']()['then'](respondWithResult(_0x46a163,null))[_0xbf7b('0x44')](handleError(_0x46a163,null));}; \ No newline at end of file +var _0x3a90=['squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','then','include','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','fs-extra','lodash'];(function(_0x439190,_0x267b5a){var _0x4c9435=function(_0x27a562){while(--_0x27a562){_0x439190['push'](_0x439190['shift']());}};_0x4c9435(++_0x267b5a);}(_0x3a90,0x1b3));var _0x03a9=function(_0x22cb06,_0x2b979d){_0x22cb06=_0x22cb06-0x0;var _0x53776b=_0x3a90[_0x22cb06];return _0x53776b;};'use strict';var emlformat=require(_0x03a9('0x0'));var rimraf=require(_0x03a9('0x1'));var zipdir=require(_0x03a9('0x2'));var jsonpatch=require(_0x03a9('0x3'));var rp=require(_0x03a9('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x03a9('0x5'));var path=require(_0x03a9('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x03a9('0x7'));var _=require(_0x03a9('0x8'));var squel=require(_0x03a9('0x9'));var crypto=require(_0x03a9('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x03a9('0xb'));var Redis=require(_0x03a9('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x03a9('0xd'));var as=require(_0x03a9('0xe'));var hardwareService=require(_0x03a9('0xf'));var logger=require('../../config/logger')(_0x03a9('0x10'));var utils=require(_0x03a9('0x11'));var config=require(_0x03a9('0x12'));var licenseUtil=require(_0x03a9('0x13'));var db=require(_0x03a9('0x14'))['db'];function respondWithStatusCode(_0x14d7bc,_0x42e84a){_0x42e84a=_0x42e84a||0xcc;return function(_0x298c5b){if(_0x298c5b){return _0x14d7bc[_0x03a9('0x15')](_0x42e84a);}return _0x14d7bc['status'](_0x42e84a)[_0x03a9('0x16')]();};}function respondWithResult(_0xcdf797,_0xbcfb9d){_0xbcfb9d=_0xbcfb9d||0xc8;return function(_0x29dad8){if(_0x29dad8){return _0xcdf797[_0x03a9('0x17')](_0xbcfb9d)[_0x03a9('0x18')](_0x29dad8);}};}function respondWithFilteredResult(_0x387d88,_0xefd652){return function(_0x3e6cdb){if(_0x3e6cdb){var _0x442f13=typeof _0xefd652['offset']===_0x03a9('0x19')&&typeof _0xefd652[_0x03a9('0x1a')]===_0x03a9('0x19');var _0x25c9e1=_0x3e6cdb[_0x03a9('0x1b')];var _0x6f54a7=_0x442f13?0x0:_0xefd652['offset'];var _0x2f442c=_0x442f13?_0x3e6cdb['count']:_0xefd652[_0x03a9('0x1c')]+_0xefd652[_0x03a9('0x1a')];var _0x2c3244;if(_0x2f442c>=_0x25c9e1){_0x2f442c=_0x25c9e1;_0x2c3244=0xc8;}else{_0x2c3244=0xce;}_0x387d88[_0x03a9('0x17')](_0x2c3244);return _0x387d88['set'](_0x03a9('0x1d'),_0x6f54a7+'-'+_0x2f442c+'/'+_0x25c9e1)[_0x03a9('0x18')](_0x3e6cdb);}return null;};}function patchUpdates(_0x4023c7){return function(_0x2983b1){try{jsonpatch[_0x03a9('0x1e')](_0x2983b1,_0x4023c7,!![]);}catch(_0x256486){return BPromise[_0x03a9('0x1f')](_0x256486);}return _0x2983b1[_0x03a9('0x20')]();};}function saveUpdates(_0x550dca,_0x381b76){return function(_0x101235){if(_0x101235){return _0x101235[_0x03a9('0x21')](_0x550dca)['then'](function(_0x1c86cf){return _0x1c86cf;});}return null;};}function removeEntity(_0x2e04a0,_0x588745){return function(_0x12181c){if(_0x12181c){return _0x12181c[_0x03a9('0x22')]()['then'](function(){_0x2e04a0['status'](0xcc)[_0x03a9('0x16')]();});}};}function handleEntityNotFound(_0x2d339e,_0x184291){return function(_0x6feae0){if(!_0x6feae0){_0x2d339e['sendStatus'](0x194);}return _0x6feae0;};}function handleError(_0x30d735,_0x3e433c){_0x3e433c=_0x3e433c||0x1f4;return function(_0x38f49a){logger[_0x03a9('0x23')](_0x38f49a[_0x03a9('0x24')]);if(_0x38f49a[_0x03a9('0x25')]){delete _0x38f49a['name'];}_0x30d735[_0x03a9('0x17')](_0x3e433c)[_0x03a9('0x26')](_0x38f49a);};}exports[_0x03a9('0x27')]=function(_0x3a420a,_0x32703d){var _0xb5ac96={},_0x40f4dc={},_0x25803d={'count':0x0,'rows':[]};var _0x54b80f=_[_0x03a9('0x28')](db[_0x03a9('0x29')][_0x03a9('0x2a')],function(_0x3c9ec7){return{'name':_0x3c9ec7[_0x03a9('0x2b')],'type':_0x3c9ec7[_0x03a9('0x2c')][_0x03a9('0x2d')]};});_0x40f4dc[_0x03a9('0x2e')]=_[_0x03a9('0x28')](_0x54b80f,_0x03a9('0x25'));_0x40f4dc[_0x03a9('0x2f')]=_[_0x03a9('0x30')](_0x3a420a[_0x03a9('0x2f')]);_0x40f4dc[_0x03a9('0x31')]=_[_0x03a9('0x32')](_0x40f4dc[_0x03a9('0x2e')],_0x40f4dc[_0x03a9('0x2f')]);_0xb5ac96['attributes']=_[_0x03a9('0x32')](_0x40f4dc['model'],qs[_0x03a9('0x33')](_0x3a420a[_0x03a9('0x2f')][_0x03a9('0x33')]));_0xb5ac96[_0x03a9('0x34')]=_0xb5ac96[_0x03a9('0x34')][_0x03a9('0x35')]?_0xb5ac96[_0x03a9('0x34')]:_0x40f4dc[_0x03a9('0x2e')];if(!_0x3a420a[_0x03a9('0x2f')][_0x03a9('0x36')](_0x03a9('0x37'))){_0xb5ac96[_0x03a9('0x1a')]=qs[_0x03a9('0x1a')](_0x3a420a[_0x03a9('0x2f')][_0x03a9('0x1a')]);_0xb5ac96[_0x03a9('0x1c')]=qs['offset'](_0x3a420a[_0x03a9('0x2f')][_0x03a9('0x1c')]);}_0xb5ac96[_0x03a9('0x38')]=qs[_0x03a9('0x39')](_0x3a420a[_0x03a9('0x2f')][_0x03a9('0x39')]);_0xb5ac96['where']=qs[_0x03a9('0x31')](_[_0x03a9('0x3a')](_0x3a420a[_0x03a9('0x2f')],_0x40f4dc[_0x03a9('0x31')]),_0x54b80f);if(_0x3a420a[_0x03a9('0x2f')][_0x03a9('0x3b')]){_0xb5ac96[_0x03a9('0x3c')]=_[_0x03a9('0x3d')](_0xb5ac96['where'],{'$or':_[_0x03a9('0x28')](_0x54b80f,function(_0x5947df){if(_0x5947df[_0x03a9('0x2c')]!==_0x03a9('0x3e')){var _0x220430={};_0x220430[_0x5947df[_0x03a9('0x25')]]={'$like':'%'+_0x3a420a[_0x03a9('0x2f')][_0x03a9('0x3b')]+'%'};return _0x220430;}})});}_0xb5ac96=_['merge']({},_0xb5ac96,_0x3a420a[_0x03a9('0x3f')]);var _0x47c409={'where':_0xb5ac96[_0x03a9('0x3c')]};return db[_0x03a9('0x29')]['count'](_0x47c409)[_0x03a9('0x40')](function(_0x45713e){_0x25803d[_0x03a9('0x1b')]=_0x45713e;if(_0x3a420a[_0x03a9('0x2f')]['includeAll']){_0xb5ac96[_0x03a9('0x41')]=[{'all':!![]}];}return db[_0x03a9('0x29')][_0x03a9('0x42')](_0xb5ac96);})[_0x03a9('0x40')](function(_0x2f0ab9){_0x25803d[_0x03a9('0x43')]=_0x2f0ab9;return _0x25803d;})[_0x03a9('0x40')](respondWithFilteredResult(_0x32703d,_0xb5ac96))[_0x03a9('0x44')](handleError(_0x32703d,null));};exports['show']=function(_0x2ed944,_0x5ac762){var _0x21f159={'raw':![],'where':{'id':_0x2ed944[_0x03a9('0x45')]['id']}},_0x5d44e0={};_0x5d44e0[_0x03a9('0x2e')]=_[_0x03a9('0x30')](db[_0x03a9('0x29')]['rawAttributes']);_0x5d44e0['query']=_[_0x03a9('0x30')](_0x2ed944['query']);_0x5d44e0[_0x03a9('0x31')]=_[_0x03a9('0x32')](_0x5d44e0['model'],_0x5d44e0[_0x03a9('0x2f')]);_0x21f159[_0x03a9('0x34')]=_[_0x03a9('0x32')](_0x5d44e0['model'],qs[_0x03a9('0x33')](_0x2ed944[_0x03a9('0x2f')]['fields']));_0x21f159[_0x03a9('0x34')]=_0x21f159[_0x03a9('0x34')][_0x03a9('0x35')]?_0x21f159[_0x03a9('0x34')]:_0x5d44e0['model'];if(_0x2ed944['query']['includeAll']){_0x21f159[_0x03a9('0x41')]=[{'all':!![]}];}_0x21f159=_[_0x03a9('0x3d')]({},_0x21f159,_0x2ed944[_0x03a9('0x3f')]);return db[_0x03a9('0x29')][_0x03a9('0x46')](_0x21f159)[_0x03a9('0x40')](handleEntityNotFound(_0x5ac762,null))[_0x03a9('0x40')](respondWithResult(_0x5ac762,null))[_0x03a9('0x44')](handleError(_0x5ac762,null));};exports[_0x03a9('0x47')]=function(_0x388fc7,_0x2c6f06){return db[_0x03a9('0x29')][_0x03a9('0x47')](_0x388fc7[_0x03a9('0x48')],{})[_0x03a9('0x40')](respondWithResult(_0x2c6f06,0xc9))[_0x03a9('0x44')](handleError(_0x2c6f06,null));};exports[_0x03a9('0x21')]=function(_0x2e89ec,_0x148e9e){if(_0x2e89ec[_0x03a9('0x48')]['id']){delete _0x2e89ec[_0x03a9('0x48')]['id'];}return db['UserProfileSection'][_0x03a9('0x46')]({'where':{'id':_0x2e89ec[_0x03a9('0x45')]['id']}})[_0x03a9('0x40')](handleEntityNotFound(_0x148e9e,null))[_0x03a9('0x40')](saveUpdates(_0x2e89ec[_0x03a9('0x48')],null))['then'](respondWithResult(_0x148e9e,null))['catch'](handleError(_0x148e9e,null));};exports[_0x03a9('0x22')]=function(_0x1ae9cc,_0x1e6c42){return db[_0x03a9('0x29')][_0x03a9('0x46')]({'where':{'id':_0x1ae9cc['params']['id']}})[_0x03a9('0x40')](handleEntityNotFound(_0x1e6c42,null))[_0x03a9('0x40')](removeEntity(_0x1e6c42,null))[_0x03a9('0x44')](handleError(_0x1e6c42,null));};exports['describe']=function(_0x2d349f,_0x55f3a4){return db[_0x03a9('0x29')][_0x03a9('0x49')]()[_0x03a9('0x40')](respondWithResult(_0x55f3a4,null))[_0x03a9('0x44')](handleError(_0x55f3a4,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 2826bb7..db70039 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 _0x42c6=['compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x42c6,0xd3));var _0x642c=function(_0x80327a,_0x5cf28e){_0x80327a=_0x80327a-0x0;var _0x27b045=_0x42c6[_0x80327a];return _0x27b045;};'use strict';var _=require(_0x642c('0x0'));var util=require(_0x642c('0x1'));var logger=require(_0x642c('0x2'))(_0x642c('0x3'));var moment=require('moment');var BPromise=require(_0x642c('0x4'));var rp=require(_0x642c('0x5'));var fs=require('fs');var path=require(_0x642c('0x6'));var rimraf=require(_0x642c('0x7'));var config=require(_0x642c('0x8'));var attributes=require(_0x642c('0x9'));module[_0x642c('0xa')]=function(_0x5bea33,_0x412c0e){return _0x5bea33['define'](_0x642c('0xb'),attributes,{'tableName':_0x642c('0xc'),'paranoid':![],'indexes':[{'name':_0x642c('0xd'),'fields':[_0x642c('0xe'),_0x642c('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x048d=['userProfileId','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex'];(function(_0x49f811,_0x165726){var _0x456f56=function(_0x3b70ec){while(--_0x3b70ec){_0x49f811['push'](_0x49f811['shift']());}};_0x456f56(++_0x165726);}(_0x048d,0xc5));var _0xd048=function(_0x3cb30b,_0x504b3e){_0x3cb30b=_0x3cb30b-0x0;var _0x2ca717=_0x048d[_0x3cb30b];return _0x2ca717;};'use strict';var _=require('lodash');var util=require(_0xd048('0x0'));var logger=require(_0xd048('0x1'))(_0xd048('0x2'));var moment=require(_0xd048('0x3'));var BPromise=require('bluebird');var rp=require(_0xd048('0x4'));var fs=require('fs');var path=require(_0xd048('0x5'));var rimraf=require(_0xd048('0x6'));var config=require(_0xd048('0x7'));var attributes=require('./userProfileSection.attributes');module[_0xd048('0x8')]=function(_0x1ec125,_0x5a9ab3){return _0x1ec125[_0xd048('0x9')](_0xd048('0xa'),attributes,{'tableName':_0xd048('0xb'),'paranoid':![],'indexes':[{'name':_0xd048('0xc'),'fields':['sectionId',_0xd048('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 3ce1ebb..f0f6d18 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 _0xc57b=['jayson/promise','client','http','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x236380,_0x25476c){var _0x2e4104=function(_0x2b6a71){while(--_0x2b6a71){_0x236380['push'](_0x236380['shift']());}};_0x2e4104(++_0x25476c);}(_0xc57b,0x90));var _0xbc57=function(_0xf8bf87,_0x3d09a3){_0xf8bf87=_0xf8bf87-0x0;var _0x135dd6=_0xc57b[_0xf8bf87];return _0x135dd6;};'use strict';var _=require('lodash');var util=require(_0xbc57('0x0'));var moment=require(_0xbc57('0x1'));var BPromise=require(_0xbc57('0x2'));var rs=require(_0xbc57('0x3'));var fs=require('fs');var Redis=require(_0xbc57('0x4'));var db=require(_0xbc57('0x5'))['db'];var utils=require(_0xbc57('0x6'));var logger=require(_0xbc57('0x7'))(_0xbc57('0x8'));var config=require(_0xbc57('0x9'));var jayson=require(_0xbc57('0xa'));var client=jayson[_0xbc57('0xb')][_0xbc57('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e38e0,_0x5420f3,_0x29a563){return new BPromise(function(_0x193991,_0xfeb949){return client['request'](_0x2e38e0,_0x29a563)[_0xbc57('0xd')](function(_0x1a895c){logger['info'](_0xbc57('0xe'),_0x5420f3,_0xbc57('0xf'));logger[_0xbc57('0x10')](_0xbc57('0x11'),_0x5420f3,'request\x20sent',JSON[_0xbc57('0x12')](_0x1a895c));if(_0x1a895c[_0xbc57('0x13')]){if(_0x1a895c[_0xbc57('0x13')]['code']===0x1f4){logger[_0xbc57('0x13')](_0xbc57('0xe'),_0x5420f3,_0x1a895c[_0xbc57('0x13')]['message']);return _0xfeb949(_0x1a895c[_0xbc57('0x13')][_0xbc57('0x14')]);}logger['error'](_0xbc57('0xe'),_0x5420f3,_0x1a895c[_0xbc57('0x13')][_0xbc57('0x14')]);return _0x193991(_0x1a895c[_0xbc57('0x13')]['message']);}else{logger['info'](_0xbc57('0xe'),_0x5420f3,_0xbc57('0xf'));_0x193991(_0x1a895c['result'][_0xbc57('0x14')]);}})[_0xbc57('0x15')](function(_0x356e14){logger[_0xbc57('0x13')](_0xbc57('0xe'),_0x5420f3,_0x356e14);_0xfeb949(_0x356e14);});});} \ No newline at end of file +var _0xb905=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x2e077b,_0x451fdf){var _0x2929e=function(_0x3ca4d1){while(--_0x3ca4d1){_0x2e077b['push'](_0x2e077b['shift']());}};_0x2929e(++_0x451fdf);}(_0xb905,0xa7));var _0x5b90=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xb905[_0x23e7c1];return _0x1add43;};'use strict';var _=require(_0x5b90('0x0'));var util=require('util');var moment=require(_0x5b90('0x1'));var BPromise=require('bluebird');var rs=require(_0x5b90('0x2'));var fs=require('fs');var Redis=require(_0x5b90('0x3'));var db=require(_0x5b90('0x4'))['db'];var utils=require(_0x5b90('0x5'));var logger=require(_0x5b90('0x6'))(_0x5b90('0x7'));var config=require(_0x5b90('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5b90('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x296cd0,_0x362fbb,_0x55f7cc){return new BPromise(function(_0xfe8529,_0x428eb9){return client['request'](_0x296cd0,_0x55f7cc)['then'](function(_0x3cff73){logger[_0x5b90('0xa')](_0x5b90('0xb'),_0x362fbb,_0x5b90('0xc'));logger[_0x5b90('0xd')](_0x5b90('0xe'),_0x362fbb,_0x5b90('0xc'),JSON[_0x5b90('0xf')](_0x3cff73));if(_0x3cff73[_0x5b90('0x10')]){if(_0x3cff73[_0x5b90('0x10')][_0x5b90('0x11')]===0x1f4){logger[_0x5b90('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x362fbb,_0x3cff73[_0x5b90('0x10')][_0x5b90('0x12')]);return _0x428eb9(_0x3cff73[_0x5b90('0x10')][_0x5b90('0x12')]);}logger['error'](_0x5b90('0xb'),_0x362fbb,_0x3cff73[_0x5b90('0x10')][_0x5b90('0x12')]);return _0xfe8529(_0x3cff73[_0x5b90('0x10')][_0x5b90('0x12')]);}else{logger[_0x5b90('0xa')](_0x5b90('0xb'),_0x362fbb,_0x5b90('0xc'));_0xfe8529(_0x3cff73[_0x5b90('0x13')][_0x5b90('0x12')]);}})[_0x5b90('0x14')](function(_0x14e829){logger[_0x5b90('0x10')](_0x5b90('0xb'),_0x362fbb,_0x14e829);_0x428eb9(_0x14e829);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 07aa31a..fec5fc3 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4af53a,_0x4f350f){var _0x232ccb=function(_0x35445d){while(--_0x35445d){_0x4af53a['push'](_0x4af53a['shift']());}};_0x232ccb(++_0x4f350f);}(_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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x140654,_0x1c55c5){var _0x28b0fb=function(_0x1dac7b){while(--_0x1dac7b){_0x140654['push'](_0x140654['shift']());}};_0x28b0fb(++_0x1c55c5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x38b14f,_0xd08fa8){_0x38b14f=_0x38b14f-0x0;var _0x22a324=_0xcb91[_0x38b14f];return _0x22a324;};'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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 013ead0..b0c58e7 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 _0x98b4=['INTEGER','sequelize'];(function(_0x3ccc55,_0x1d4b34){var _0x3ecbe0=function(_0x4a17f6){while(--_0x4a17f6){_0x3ccc55['push'](_0x3ccc55['shift']());}};_0x3ecbe0(++_0x1d4b34);}(_0x98b4,0x93));var _0x498b=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x98b4[_0x5f3f88];return _0xd08119;};'use strict';var Sequelize=require(_0x498b('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x498b('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc005=['sequelize','exports','INTEGER'];(function(_0x334f9a,_0x542f01){var _0x2b219d=function(_0x25bb3e){while(--_0x25bb3e){_0x334f9a['push'](_0x334f9a['shift']());}};_0x2b219d(++_0x542f01);}(_0xc005,0x1f2));var _0x5c00=function(_0x3df871,_0xda2e11){_0x3df871=_0x3df871-0x0;var _0x570f7b=_0xc005[_0x3df871];return _0x570f7b;};'use strict';var Sequelize=require(_0x5c00('0x0'));module[_0x5c00('0x1')]={'penalty':{'type':Sequelize[_0x5c00('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 72fd188..533ce48 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 _0x53ec=['bluebird','path','../../config/environment','./userSmsQueue.attributes','define','UserSmsQueue','lodash','util','../../config/logger','api','moment'];(function(_0x1ccddd,_0x3995f2){var _0x4a2f00=function(_0x20098a){while(--_0x20098a){_0x1ccddd['push'](_0x1ccddd['shift']());}};_0x4a2f00(++_0x3995f2);}(_0x53ec,0x192));var _0xc53e=function(_0x1a9ed0,_0x1085fc){_0x1a9ed0=_0x1a9ed0-0x0;var _0x47bbd6=_0x53ec[_0x1a9ed0];return _0x47bbd6;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d58=['request-promise','rimraf','../../config/environment','exports','define','user_has_sms_queues','bluebird'];(function(_0xc87d08,_0x59c9be){var _0x30a714=function(_0x437c0d){while(--_0x437c0d){_0xc87d08['push'](_0xc87d08['shift']());}};_0x30a714(++_0x59c9be);}(_0x5d58,0x187));var _0x85d5=function(_0x1c29d0,_0x20b026){_0x1c29d0=_0x1c29d0-0x0;var _0x3101f0=_0x5d58[_0x1c29d0];return _0x3101f0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x85d5('0x0'));var rp=require(_0x85d5('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var attributes=require('./userSmsQueue.attributes');module[_0x85d5('0x4')]=function(_0x2d457a,_0x578fad){return _0x2d457a[_0x85d5('0x5')]('UserSmsQueue',attributes,{'tableName':_0x85d5('0x6'),'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 7ca80bb..292f0ee 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 _0x7cbd=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','UserSmsQueue,\x20%s,\x20%s','message'];(function(_0x1b5b60,_0x212a13){var _0x4cb04a=function(_0x49c350){while(--_0x49c350){_0x1b5b60['push'](_0x1b5b60['shift']());}};_0x4cb04a(++_0x212a13);}(_0x7cbd,0x15b));var _0xd7cb=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0x7cbd[_0x2c0dc0];return _0x4c0990;};'use strict';var _=require(_0xd7cb('0x0'));var util=require(_0xd7cb('0x1'));var moment=require(_0xd7cb('0x2'));var BPromise=require(_0xd7cb('0x3'));var rs=require(_0xd7cb('0x4'));var fs=require('fs');var Redis=require(_0xd7cb('0x5'));var db=require(_0xd7cb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd7cb('0x7'))('rpc');var config=require(_0xd7cb('0x8'));var jayson=require(_0xd7cb('0x9'));var client=jayson[_0xd7cb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a9372,_0xe2fa34,_0x3b00d6){return new BPromise(function(_0x332b55,_0x31e5a3){return client[_0xd7cb('0xb')](_0x2a9372,_0x3b00d6)[_0xd7cb('0xc')](function(_0x1bce4f){logger[_0xd7cb('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0xe2fa34,_0xd7cb('0xe'));logger[_0xd7cb('0xf')](_0xd7cb('0x10'),_0xe2fa34,_0xd7cb('0xe'),JSON['stringify'](_0x1bce4f));if(_0x1bce4f[_0xd7cb('0x11')]){if(_0x1bce4f[_0xd7cb('0x11')][_0xd7cb('0x12')]===0x1f4){logger['error'](_0xd7cb('0x13'),_0xe2fa34,_0x1bce4f[_0xd7cb('0x11')][_0xd7cb('0x14')]);return _0x31e5a3(_0x1bce4f['error'][_0xd7cb('0x14')]);}logger[_0xd7cb('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0xe2fa34,_0x1bce4f[_0xd7cb('0x11')][_0xd7cb('0x14')]);return _0x332b55(_0x1bce4f[_0xd7cb('0x11')][_0xd7cb('0x14')]);}else{logger[_0xd7cb('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0xe2fa34,_0xd7cb('0xe'));_0x332b55(_0x1bce4f[_0xd7cb('0x15')][_0xd7cb('0x14')]);}})[_0xd7cb('0x16')](function(_0x57ec8f){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0xe2fa34,_0x57ec8f);_0x31e5a3(_0x57ec8f);});});} \ No newline at end of file +var _0xa333=['jayson/promise','request','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x1db989,_0x3c0c9d){var _0x36e8b3=function(_0x3ac5e9){while(--_0x3ac5e9){_0x1db989['push'](_0x1db989['shift']());}};_0x36e8b3(++_0x3c0c9d);}(_0xa333,0x1a8));var _0x3a33=function(_0x5c9968,_0x2d9779){_0x5c9968=_0x5c9968-0x0;var _0x3e444d=_0xa333[_0x5c9968];return _0x3e444d;};'use strict';var _=require(_0x3a33('0x0'));var util=require(_0x3a33('0x1'));var moment=require(_0x3a33('0x2'));var BPromise=require(_0x3a33('0x3'));var rs=require(_0x3a33('0x4'));var fs=require('fs');var Redis=require(_0x3a33('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3a33('0x6'));var logger=require(_0x3a33('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3a33('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x274198,_0x5934c7,_0x32fb9a){return new BPromise(function(_0x1d056e,_0x3baf26){return client[_0x3a33('0x9')](_0x274198,_0x32fb9a)[_0x3a33('0xa')](function(_0x422c69){logger['info'](_0x3a33('0xb'),_0x5934c7,_0x3a33('0xc'));logger['debug'](_0x3a33('0xd'),_0x5934c7,'request\x20sent',JSON[_0x3a33('0xe')](_0x422c69));if(_0x422c69[_0x3a33('0xf')]){if(_0x422c69[_0x3a33('0xf')]['code']===0x1f4){logger[_0x3a33('0xf')](_0x3a33('0xb'),_0x5934c7,_0x422c69[_0x3a33('0xf')]['message']);return _0x3baf26(_0x422c69[_0x3a33('0xf')][_0x3a33('0x10')]);}logger['error'](_0x3a33('0xb'),_0x5934c7,_0x422c69[_0x3a33('0xf')]['message']);return _0x1d056e(_0x422c69['error'][_0x3a33('0x10')]);}else{logger[_0x3a33('0x11')](_0x3a33('0xb'),_0x5934c7,'request\x20sent');_0x1d056e(_0x422c69['result']['message']);}})['catch'](function(_0x30a6ba){logger[_0x3a33('0xf')](_0x3a33('0xb'),_0x5934c7,_0x30a6ba);_0x3baf26(_0x30a6ba);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 93b8304..6223a78 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 _0x2afb=['exports','INTEGER','sequelize'];(function(_0x22e9fe,_0x3d019f){var _0x47cd19=function(_0x8fd5fc){while(--_0x8fd5fc){_0x22e9fe['push'](_0x22e9fe['shift']());}};_0x47cd19(++_0x3d019f);}(_0x2afb,0x95));var _0xb2af=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x2afb[_0x4a3898];return _0x25ceb0;};'use strict';var Sequelize=require(_0xb2af('0x0'));module[_0xb2af('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xb2af('0x2')]}}; \ No newline at end of file +var _0x4774=['sequelize','exports','INTEGER'];(function(_0x4e5af1,_0x1dfc1f){var _0x357f9d=function(_0x645f3b){while(--_0x645f3b){_0x4e5af1['push'](_0x4e5af1['shift']());}};_0x357f9d(++_0x1dfc1f);}(_0x4774,0xb4));var _0x4477=function(_0x1974a1,_0x347db8){_0x1974a1=_0x1974a1-0x0;var _0x415789=_0x4774[_0x1974a1];return _0x415789;};'use strict';var Sequelize=require(_0x4477('0x0'));module[_0x4477('0x1')]={'UserId':{'type':Sequelize[_0x4477('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x4477('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 62b427a..ba9c76c 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(_0x13020b,_0x358596){var _0x53128c=function(_0x23d106){while(--_0x23d106){_0x13020b['push'](_0x13020b['shift']());}};_0x53128c(++_0x358596);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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(_0x36e805,_0x4d6a08){var _0x510b39=function(_0x221281){while(--_0x221281){_0x36e805['push'](_0x36e805['shift']());}};_0x510b39(++_0x4d6a08);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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 7f47ba8..8345708 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x191cbc,_0x188e9e){var _0x1ca819=function(_0xf7ee62){while(--_0xf7ee62){_0x191cbc['push'](_0x191cbc['shift']());}};_0x1ca819(++_0x188e9e);}(_0xe706,0xa3));var _0x6e70=function(_0x2d7cca,_0x104977){_0x2d7cca=_0x2d7cca-0x0;var _0x347b84=_0xe706[_0x2d7cca];return _0x347b84;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x592461,_0x24cc58){var _0x2af32f=function(_0x4f8dcb){while(--_0x4f8dcb){_0x592461['push'](_0x592461['shift']());}};_0x2af32f(++_0x24cc58);}(_0xe706,0xa3));var _0x6e70=function(_0x36de53,_0x4a0679){_0x36de53=_0x36de53-0x0;var _0x2b04cb=_0xe706[_0x36de53];return _0x2b04cb;};'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 49f032c..8fdbf1d 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 _0x4a2e=['sequelize','exports','INTEGER'];(function(_0x53cd90,_0x9362cc){var _0x50f905=function(_0x184504){while(--_0x184504){_0x53cd90['push'](_0x53cd90['shift']());}};_0x50f905(++_0x9362cc);}(_0x4a2e,0x87));var _0xe4a2=function(_0x59bed0,_0xad50a5){_0x59bed0=_0x59bed0-0x0;var _0x2e5d4c=_0x4a2e[_0x59bed0];return _0x2e5d4c;};'use strict';var Sequelize=require(_0xe4a2('0x0'));module[_0xe4a2('0x1')]={'penalty':{'type':Sequelize[_0xe4a2('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd9ee=['exports','sequelize'];(function(_0x2ddb83,_0x4f0c1f){var _0x3349eb=function(_0xb5164){while(--_0xb5164){_0x2ddb83['push'](_0x2ddb83['shift']());}};_0x3349eb(++_0x4f0c1f);}(_0xd9ee,0x1d3));var _0xed9e=function(_0x438d1a,_0x205b46){_0x438d1a=_0x438d1a-0x0;var _0x2de8ca=_0xd9ee[_0x438d1a];return _0x2de8ca;};'use strict';var Sequelize=require(_0xed9e('0x0'));module[_0xed9e('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 b57bc48..2224735 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 _0xc67b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xc67b,0x175));var _0xbc67=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xc67b[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0xbc67('0x0'));var util=require(_0xbc67('0x1'));var logger=require(_0xbc67('0x2'))(_0xbc67('0x3'));var moment=require(_0xbc67('0x4'));var BPromise=require(_0xbc67('0x5'));var rp=require(_0xbc67('0x6'));var fs=require('fs');var path=require(_0xbc67('0x7'));var rimraf=require(_0xbc67('0x8'));var config=require(_0xbc67('0x9'));var attributes=require('./userVoiceQueue.attributes');module[_0xbc67('0xa')]=function(_0x5def56,_0x2c2bc3){return _0x5def56['define'](_0xbc67('0xb'),attributes,{'tableName':_0xbc67('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x20c0=['request-promise','rimraf','../../config/environment','exports','define','user_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1f1e31,_0x27b5c3){var _0x229b56=function(_0x16db77){while(--_0x16db77){_0x1f1e31['push'](_0x1f1e31['shift']());}};_0x229b56(++_0x27b5c3);}(_0x20c0,0x186));var _0x020c=function(_0x2a5029,_0x20f267){_0x2a5029=_0x2a5029-0x0;var _0x51f3af=_0x20c0[_0x2a5029];return _0x51f3af;};'use strict';var _=require(_0x020c('0x0'));var util=require(_0x020c('0x1'));var logger=require(_0x020c('0x2'))(_0x020c('0x3'));var moment=require(_0x020c('0x4'));var BPromise=require(_0x020c('0x5'));var rp=require(_0x020c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x020c('0x7'));var config=require(_0x020c('0x8'));var attributes=require('./userVoiceQueue.attributes');module[_0x020c('0x9')]=function(_0x2a0bc7,_0x598f3b){return _0x2a0bc7[_0x020c('0xa')]('UserVoiceQueue',attributes,{'tableName':_0x020c('0xb'),'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 1e7efb0..525dbd5 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 _0xcca9=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x44a0a6,_0x5e36d7){var _0x5732a8=function(_0x1dae52){while(--_0x1dae52){_0x44a0a6['push'](_0x44a0a6['shift']());}};_0x5732a8(++_0x5e36d7);}(_0xcca9,0xc2));var _0x9cca=function(_0x22b39b,_0x2b7d63){_0x22b39b=_0x22b39b-0x0;var _0x280e1d=_0xcca9[_0x22b39b];return _0x280e1d;};'use strict';var _=require(_0x9cca('0x0'));var util=require(_0x9cca('0x1'));var moment=require(_0x9cca('0x2'));var BPromise=require(_0x9cca('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9cca('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9cca('0x5'));var logger=require(_0x9cca('0x6'))('rpc');var config=require(_0x9cca('0x7'));var jayson=require(_0x9cca('0x8'));var client=jayson['client'][_0x9cca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c2034,_0x3175a8,_0x1d925b){return new BPromise(function(_0x1766f8,_0x205b6d){return client[_0x9cca('0xa')](_0x5c2034,_0x1d925b)['then'](function(_0x4c4bef){logger[_0x9cca('0xb')](_0x9cca('0xc'),_0x3175a8,_0x9cca('0xd'));logger[_0x9cca('0xe')](_0x9cca('0xf'),_0x3175a8,_0x9cca('0xd'),JSON[_0x9cca('0x10')](_0x4c4bef));if(_0x4c4bef['error']){if(_0x4c4bef['error'][_0x9cca('0x11')]===0x1f4){logger['error'](_0x9cca('0xc'),_0x3175a8,_0x4c4bef[_0x9cca('0x12')][_0x9cca('0x13')]);return _0x205b6d(_0x4c4bef[_0x9cca('0x12')][_0x9cca('0x13')]);}logger[_0x9cca('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x3175a8,_0x4c4bef[_0x9cca('0x12')][_0x9cca('0x13')]);return _0x1766f8(_0x4c4bef['error'][_0x9cca('0x13')]);}else{logger[_0x9cca('0xb')](_0x9cca('0xc'),_0x3175a8,_0x9cca('0xd'));_0x1766f8(_0x4c4bef[_0x9cca('0x14')][_0x9cca('0x13')]);}})[_0x9cca('0x15')](function(_0x448c4c){logger[_0x9cca('0x12')](_0x9cca('0xc'),_0x3175a8,_0x448c4c);_0x205b6d(_0x448c4c);});});} \ No newline at end of file +var _0xe64c=['info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x36e557,_0x582535){var _0x4072f7=function(_0x552ed5){while(--_0x552ed5){_0x36e557['push'](_0x36e557['shift']());}};_0x4072f7(++_0x582535);}(_0xe64c,0xe9));var _0xce64=function(_0x3f48d9,_0xa5956d){_0x3f48d9=_0x3f48d9-0x0;var _0x32de47=_0xe64c[_0x3f48d9];return _0x32de47;};'use strict';var _=require(_0xce64('0x0'));var util=require(_0xce64('0x1'));var moment=require(_0xce64('0x2'));var BPromise=require(_0xce64('0x3'));var rs=require(_0xce64('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xce64('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xce64('0x6'))(_0xce64('0x7'));var config=require('../../config/environment');var jayson=require(_0xce64('0x8'));var client=jayson[_0xce64('0x9')][_0xce64('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37f4c5,_0x27e27a,_0x3ac7e0){return new BPromise(function(_0x2babca,_0x13daaf){return client['request'](_0x37f4c5,_0x3ac7e0)[_0xce64('0xb')](function(_0x3929a9){logger['info'](_0xce64('0xc'),_0x27e27a,'request\x20sent');logger[_0xce64('0xd')](_0xce64('0xe'),_0x27e27a,_0xce64('0xf'),JSON[_0xce64('0x10')](_0x3929a9));if(_0x3929a9[_0xce64('0x11')]){if(_0x3929a9[_0xce64('0x11')][_0xce64('0x12')]===0x1f4){logger[_0xce64('0x11')](_0xce64('0xc'),_0x27e27a,_0x3929a9[_0xce64('0x11')][_0xce64('0x13')]);return _0x13daaf(_0x3929a9[_0xce64('0x11')][_0xce64('0x13')]);}logger[_0xce64('0x11')](_0xce64('0xc'),_0x27e27a,_0x3929a9[_0xce64('0x11')]['message']);return _0x2babca(_0x3929a9[_0xce64('0x11')][_0xce64('0x13')]);}else{logger[_0xce64('0x14')](_0xce64('0xc'),_0x27e27a,'request\x20sent');_0x2babca(_0x3929a9[_0xce64('0x15')][_0xce64('0x13')]);}})[_0xce64('0x16')](function(_0x29ecfa){logger['error'](_0xce64('0xc'),_0x27e27a,_0x29ecfa);_0x13daaf(_0x29ecfa);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index da7d3dc..fc154c8 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x8929a1,_0x25516b){var _0x5102cc=function(_0x2d128e){while(--_0x2d128e){_0x8929a1['push'](_0x8929a1['shift']());}};_0x5102cc(++_0x25516b);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3a7155,_0x3683f5){var _0x24b0e1=function(_0x399e7d){while(--_0x399e7d){_0x3a7155['push'](_0x3a7155['shift']());}};_0x24b0e1(++_0x3683f5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 39754ec..e15e014 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 _0xcd66=['INTEGER','STRING','Required\x20by\x20Asterisk','queue_interface','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd66,0x166));var _0x6cd6=function(_0x475845,_0x265c01){_0x475845=_0x475845-0x0;var _0x5eefd2=_0xcd66[_0x475845];return _0x5eefd2;};'use strict';var Sequelize=require(_0x6cd6('0x0'));module[_0x6cd6('0x1')]={'uniqueid':{'type':Sequelize[_0x6cd6('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x6cd6('0x3')],'allowNull':![],'comment':_0x6cd6('0x4')},'UserId':{'type':Sequelize[_0x6cd6('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x6cd6('0x3')],'allowNull':![],'unique':_0x6cd6('0x5'),'comment':_0x6cd6('0x4')},'VoiceQueueId':{'type':Sequelize[_0x6cd6('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x6cd6('0x3')],'allowNull':![],'unique':_0x6cd6('0x5'),'comment':_0x6cd6('0x4')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x6cd6('0x4')},'paused':{'type':Sequelize[_0x6cd6('0x2')](0xb),'defaultValue':0x0,'comment':_0x6cd6('0x4')}}; \ No newline at end of file +var _0x87f9=['STRING','Required\x20by\x20Asterisk','INTEGER','queue_interface','sequelize','exports'];(function(_0x36d25e,_0x1a047d){var _0x4b95b8=function(_0x74da3){while(--_0x74da3){_0x36d25e['push'](_0x36d25e['shift']());}};_0x4b95b8(++_0x1a047d);}(_0x87f9,0xa6));var _0x987f=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x87f9[_0x4dbaad];return _0x226c72;};'use strict';var Sequelize=require(_0x987f('0x0'));module[_0x987f('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x987f('0x2')],'allowNull':![],'comment':_0x987f('0x3')},'UserId':{'type':Sequelize[_0x987f('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x987f('0x2')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x987f('0x4')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x987f('0x5'),'comment':_0x987f('0x3')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x987f('0x4')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 1422819..bd563e1 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 _0xea1c=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt'];(function(_0x86e239,_0x59d4d0){var _0x3e1683=function(_0x5df8eb){while(--_0x5df8eb){_0x86e239['push'](_0x86e239['shift']());}};_0x3e1683(++_0x59d4d0);}(_0xea1c,0x15b));var _0xcea1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea1c[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xcea1('0x0'));var UserVoiceQueueRt=require(_0xcea1('0x1'))['db'][_0xcea1('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xcea1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcea1('0x4'),'afterDestroy':_0xcea1('0x5')};function emitEvent(_0x25ae2c){return function(_0x2448ef,_0x22afbc,_0x453f2d){UserVoiceQueueRtEvents[_0xcea1('0x6')](_0x25ae2c+':'+_0x2448ef['id'],_0x2448ef);UserVoiceQueueRtEvents[_0xcea1('0x6')](_0x25ae2c,_0x2448ef);_0x453f2d(null);};}for(var e in events){if(events[_0xcea1('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0xcea1('0x8')](e,emitEvent(event));}}module[_0xcea1('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xcac4=['setMaxListeners','update','hasOwnProperty','hook','exports','events','UserVoiceQueueRt'];(function(_0x1a79c8,_0x5f0d05){var _0x11abc2=function(_0x3c8559){while(--_0x3c8559){_0x1a79c8['push'](_0x1a79c8['shift']());}};_0x11abc2(++_0x5f0d05);}(_0xcac4,0xbb));var _0x4cac=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xcac4[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require(_0x4cac('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x4cac('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x4cac('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4cac('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1e2f3a){return function(_0x249a6c,_0x5b9d30,_0x5f4721){UserVoiceQueueRtEvents['emit'](_0x1e2f3a+':'+_0x249a6c['id'],_0x249a6c);UserVoiceQueueRtEvents['emit'](_0x1e2f3a,_0x249a6c);_0x5f4721(null);};}for(var e in events){if(events[_0x4cac('0x4')](e)){var event=events[e];UserVoiceQueueRt[_0x4cac('0x5')](e,emitEvent(event));}}module[_0x4cac('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 da5a5ab..83d3da0 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 _0xefd2=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','UserVoiceQueueRt','user_has_voice_queues_rt'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0xefd2,0x136));var _0x2efd=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0xefd2[_0x58e469];return _0x4c01c5;};'use strict';var _=require(_0x2efd('0x0'));var util=require('util');var logger=require(_0x2efd('0x1'))(_0x2efd('0x2'));var moment=require(_0x2efd('0x3'));var BPromise=require(_0x2efd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2efd('0x5'));var rimraf=require(_0x2efd('0x6'));var config=require(_0x2efd('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x59d24a,_0xde4b41){return _0x59d24a['define'](_0x2efd('0x8'),attributes,{'tableName':_0x2efd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf916=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xf916,0xec));var _0x6f91=function(_0x3a3f9c,_0x486feb){_0x3a3f9c=_0x3a3f9c-0x0;var _0x494643=_0xf916[_0x3a3f9c];return _0x494643;};'use strict';var _=require(_0x6f91('0x0'));var util=require(_0x6f91('0x1'));var logger=require('../../config/logger')(_0x6f91('0x2'));var moment=require(_0x6f91('0x3'));var BPromise=require(_0x6f91('0x4'));var rp=require(_0x6f91('0x5'));var fs=require('fs');var path=require(_0x6f91('0x6'));var rimraf=require(_0x6f91('0x7'));var config=require(_0x6f91('0x8'));var attributes=require(_0x6f91('0x9'));module[_0x6f91('0xa')]=function(_0x295bbe,_0x4c4807){return _0x295bbe[_0x6f91('0xb')](_0x6f91('0xc'),attributes,{'tableName':_0x6f91('0xd'),'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 9d6b64e..8f5553e 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 _0x8b2c=['raw','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options'];(function(_0x5a4367,_0x2f2679){var _0x459332=function(_0x2bdc02){while(--_0x2bdc02){_0x5a4367['push'](_0x5a4367['shift']());}};_0x459332(++_0x2f2679);}(_0x8b2c,0x1e6));var _0xc8b2=function(_0x4a0ae0,_0x4740a4){_0x4a0ae0=_0x4a0ae0-0x0;var _0x514e6d=_0x8b2c[_0x4a0ae0];return _0x514e6d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc8b2('0x0'));var BPromise=require(_0xc8b2('0x1'));var rs=require(_0xc8b2('0x2'));var fs=require('fs');var Redis=require(_0xc8b2('0x3'));var db=require(_0xc8b2('0x4'))['db'];var utils=require(_0xc8b2('0x5'));var logger=require(_0xc8b2('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc8b2('0x7'));var client=jayson[_0xc8b2('0x8')][_0xc8b2('0x9')]({'port':0x232a});config[_0xc8b2('0xa')]=_[_0xc8b2('0xb')](config['redis'],{'host':_0xc8b2('0xc'),'port':0x18eb});var socket=require(_0xc8b2('0xd'))(new Redis(config[_0xc8b2('0xa')]));require(_0xc8b2('0xe'))[_0xc8b2('0xf')](socket);function respondWithRpcPromise(_0x1c39d2,_0x3bcd6a,_0x221f84){return new BPromise(function(_0x55ae4a,_0x224f9e){return client[_0xc8b2('0x10')](_0x1c39d2,_0x221f84)[_0xc8b2('0x11')](function(_0x1fd782){logger[_0xc8b2('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3bcd6a,_0xc8b2('0x13'));logger[_0xc8b2('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x3bcd6a,_0xc8b2('0x13'),JSON[_0xc8b2('0x15')](_0x1fd782));if(_0x1fd782[_0xc8b2('0x16')]){if(_0x1fd782[_0xc8b2('0x16')][_0xc8b2('0x17')]===0x1f4){logger[_0xc8b2('0x16')](_0xc8b2('0x18'),_0x3bcd6a,_0x1fd782['error'][_0xc8b2('0x19')]);return _0x224f9e(_0x1fd782['error']['message']);}logger[_0xc8b2('0x16')](_0xc8b2('0x18'),_0x3bcd6a,_0x1fd782['error'][_0xc8b2('0x19')]);return _0x55ae4a(_0x1fd782[_0xc8b2('0x16')][_0xc8b2('0x19')]);}else{logger[_0xc8b2('0x12')](_0xc8b2('0x18'),_0x3bcd6a,_0xc8b2('0x13'));_0x55ae4a(_0x1fd782[_0xc8b2('0x1a')]['message']);}})[_0xc8b2('0x1b')](function(_0x36268){logger[_0xc8b2('0x16')](_0xc8b2('0x18'),_0x3bcd6a,_0x36268);_0x224f9e(_0x36268);});});}exports[_0xc8b2('0x1c')]=function(_0x16c158){var _0x34f208=this;return new Promise(function(_0x32c887,_0x107be0){return db[_0xc8b2('0x1d')][_0xc8b2('0x1e')]({'raw':_0x16c158[_0xc8b2('0x1f')]?_0x16c158[_0xc8b2('0x1f')][_0xc8b2('0x20')]===undefined?!![]:![]:!![],'where':_0x16c158['options']?_0x16c158['options']['where']||null:null,'attributes':[[db['sequelize']['fn'](_0xc8b2('0x21'),db[_0xc8b2('0x22')]['fn']('IF',db[_0xc8b2('0x22')][_0xc8b2('0x23')](_0xc8b2('0x24')))),'outboundQueuePauses']]})[_0xc8b2('0x11')](function(_0x42a1f4){logger[_0xc8b2('0x12')](_0xc8b2('0x1c'),_0x16c158);logger['debug']('GetVoiceQueueRtPauses',_0x16c158,JSON[_0xc8b2('0x15')](_0x42a1f4));_0x32c887(_0x42a1f4);})[_0xc8b2('0x1b')](function(_0x117763){logger[_0xc8b2('0x16')]('GetVoiceQueueRtPauses',_0x117763[_0xc8b2('0x19')],_0x16c158);_0x107be0(_0x34f208['error'](0x1f4,_0x117763[_0xc8b2('0x19')]));});});}; \ No newline at end of file +var _0xf214=['then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','localhost','socket.io-emitter','redis','./userVoiceQueueRt.socket','register'];(function(_0x349ec1,_0x4388c3){var _0x39ca27=function(_0xaba773){while(--_0xaba773){_0x349ec1['push'](_0x349ec1['shift']());}};_0x39ca27(++_0x4388c3);}(_0xf214,0x111));var _0x4f21=function(_0x58f363,_0x135c64){_0x58f363=_0x58f363-0x0;var _0xcb2c83=_0xf214[_0x58f363];return _0xcb2c83;};'use strict';var _=require(_0x4f21('0x0'));var util=require('util');var moment=require(_0x4f21('0x1'));var BPromise=require(_0x4f21('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f21('0x3'));var db=require(_0x4f21('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4f21('0x5'))(_0x4f21('0x6'));var config=require(_0x4f21('0x7'));var jayson=require(_0x4f21('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x4f21('0x9')](config['redis'],{'host':_0x4f21('0xa'),'port':0x18eb});var socket=require(_0x4f21('0xb'))(new Redis(config[_0x4f21('0xc')]));require(_0x4f21('0xd'))[_0x4f21('0xe')](socket);function respondWithRpcPromise(_0x432925,_0x2c7a7e,_0x1b591a){return new BPromise(function(_0x23f383,_0x1d866e){return client['request'](_0x432925,_0x1b591a)[_0x4f21('0xf')](function(_0x3edd1e){logger['info'](_0x4f21('0x10'),_0x2c7a7e,_0x4f21('0x11'));logger[_0x4f21('0x12')](_0x4f21('0x13'),_0x2c7a7e,'request\x20sent',JSON[_0x4f21('0x14')](_0x3edd1e));if(_0x3edd1e[_0x4f21('0x15')]){if(_0x3edd1e[_0x4f21('0x15')][_0x4f21('0x16')]===0x1f4){logger[_0x4f21('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2c7a7e,_0x3edd1e[_0x4f21('0x15')][_0x4f21('0x17')]);return _0x1d866e(_0x3edd1e[_0x4f21('0x15')][_0x4f21('0x17')]);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x2c7a7e,_0x3edd1e['error'][_0x4f21('0x17')]);return _0x23f383(_0x3edd1e[_0x4f21('0x15')][_0x4f21('0x17')]);}else{logger[_0x4f21('0x18')](_0x4f21('0x10'),_0x2c7a7e,'request\x20sent');_0x23f383(_0x3edd1e[_0x4f21('0x19')][_0x4f21('0x17')]);}})[_0x4f21('0x1a')](function(_0x364e2f){logger[_0x4f21('0x15')](_0x4f21('0x10'),_0x2c7a7e,_0x364e2f);_0x1d866e(_0x364e2f);});});}exports[_0x4f21('0x1b')]=function(_0x1737ae){var _0x79107d=this;return new Promise(function(_0x3ab2a8,_0x414548){return db[_0x4f21('0x1c')][_0x4f21('0x1d')]({'raw':_0x1737ae[_0x4f21('0x1e')]?_0x1737ae[_0x4f21('0x1e')][_0x4f21('0x1f')]===undefined?!![]:![]:!![],'where':_0x1737ae[_0x4f21('0x1e')]?_0x1737ae['options'][_0x4f21('0x20')]||null:null,'attributes':[[db[_0x4f21('0x21')]['fn'](_0x4f21('0x22'),db['sequelize']['fn']('IF',db[_0x4f21('0x21')][_0x4f21('0x23')]('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})[_0x4f21('0xf')](function(_0xbcad70){logger[_0x4f21('0x18')](_0x4f21('0x1b'),_0x1737ae);logger[_0x4f21('0x12')](_0x4f21('0x1b'),_0x1737ae,JSON[_0x4f21('0x14')](_0xbcad70));_0x3ab2a8(_0xbcad70);})[_0x4f21('0x1a')](function(_0x4177d8){logger[_0x4f21('0x15')](_0x4f21('0x1b'),_0x4177d8[_0x4f21('0x17')],_0x1737ae);_0x414548(_0x79107d[_0x4f21('0x15')](0x1f4,_0x4177d8[_0x4f21('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index b3135bd..7d53b77 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 _0xca84=['emit','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove'];(function(_0x770604,_0x9748ef){var _0x433a0d=function(_0x4aa0ca){while(--_0x4aa0ca){_0x770604['push'](_0x770604['shift']());}};_0x433a0d(++_0x9748ef);}(_0xca84,0xf5));var _0x4ca8=function(_0xf0ee74,_0xa0720){_0xf0ee74=_0xf0ee74-0x0;var _0x4a3e6b=_0xca84[_0xf0ee74];return _0x4a3e6b;};'use strict';var UserVoiceQueueRtEvents=require(_0x4ca8('0x0'));var events=[_0x4ca8('0x1'),_0x4ca8('0x2'),'update'];function createListener(_0x612395,_0x8b138b){return function(_0x59c921){_0x8b138b[_0x4ca8('0x3')](_0x612395,_0x59c921);};}function removeListener(_0x45236d,_0x2bc818){return function(){UserVoiceQueueRtEvents[_0x4ca8('0x4')](_0x45236d,_0x2bc818);};}exports[_0x4ca8('0x5')]=function(_0x3ee942){for(var _0x167424=0x0,_0x3ca9f5=events[_0x4ca8('0x6')];_0x167424<_0x3ca9f5;_0x167424++){var _0x246619=events[_0x167424];var _0x52a992=createListener(_0x4ca8('0x7')+_0x246619,_0x3ee942);UserVoiceQueueRtEvents['on'](_0x246619,_0x52a992);}}; \ No newline at end of file +var _0x1354=['save','remove','update','removeListener','length','./userVoiceQueueRt.events'];(function(_0x7f870e,_0x393b9c){var _0x752210=function(_0x23a1ea){while(--_0x23a1ea){_0x7f870e['push'](_0x7f870e['shift']());}};_0x752210(++_0x393b9c);}(_0x1354,0x95));var _0x4135=function(_0x5dfd65,_0x1ad889){_0x5dfd65=_0x5dfd65-0x0;var _0x47f853=_0x1354[_0x5dfd65];return _0x47f853;};'use strict';var UserVoiceQueueRtEvents=require(_0x4135('0x0'));var events=[_0x4135('0x1'),_0x4135('0x2'),_0x4135('0x3')];function createListener(_0x41c8f3,_0x435d5e){return function(_0x102fec){_0x435d5e['emit'](_0x41c8f3,_0x102fec);};}function removeListener(_0x2c75a3,_0x4ed434){return function(){UserVoiceQueueRtEvents[_0x4135('0x4')](_0x2c75a3,_0x4ed434);};}exports['register']=function(_0x14ff47){for(var _0x2bcd68=0x0,_0x5e355d=events[_0x4135('0x5')];_0x2bcd68<_0x5e355d;_0x2bcd68++){var _0x1dcce0=events[_0x2bcd68];var _0x3e7ae3=createListener('userVoiceQueueRt:'+_0x1dcce0,_0x14ff47);UserVoiceQueueRtEvents['on'](_0x1dcce0,_0x3e7ae3);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index e0e130c..090c040 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x537742,_0x338073){var _0x3941e9=function(_0x27e81e){while(--_0x27e81e){_0x537742['push'](_0x537742['shift']());}};_0x3941e9(++_0x338073);}(_0xe706,0xa3));var _0x6e70=function(_0x4292cd,_0x327a40){_0x4292cd=_0x4292cd-0x0;var _0x5e4838=_0xe706[_0x4292cd];return _0x5e4838;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x25dfdf,_0x542333){var _0x5220da=function(_0x53accc){while(--_0x53accc){_0x25dfdf['push'](_0x25dfdf['shift']());}};_0x5220da(++_0x542333);}(_0x9c44,0x178));var _0x49c4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9c44[_0x255d5b];return _0x3e141a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 9bdc39a..3334852 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 _0x307b=['sequelize','INTEGER'];(function(_0x319df2,_0x4085fb){var _0x41f9df=function(_0x8b9a53){while(--_0x8b9a53){_0x319df2['push'](_0x319df2['shift']());}};_0x41f9df(++_0x4085fb);}(_0x307b,0x108));var _0xb307=function(_0xf7da80,_0x3d522a){_0xf7da80=_0xf7da80-0x0;var _0x15b27b=_0x307b[_0xf7da80];return _0x15b27b;};'use strict';var Sequelize=require(_0xb307('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xb307('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf7c4=['exports','INTEGER','sequelize'];(function(_0x1255e0,_0x159cbe){var _0x305ce8=function(_0x29545a){while(--_0x29545a){_0x1255e0['push'](_0x1255e0['shift']());}};_0x305ce8(++_0x159cbe);}(_0xf7c4,0xc2));var _0x4f7c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf7c4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4f7c('0x0'));module[_0x4f7c('0x1')]={'penalty':{'type':Sequelize[_0x4f7c('0x2')],'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 0329f64..8e5dde0 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 _0xb26d=['define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','api','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0x367faf,_0x4744bd){var _0xb5800a=function(_0x147e4a){while(--_0x147e4a){_0x367faf['push'](_0x367faf['shift']());}};_0xb5800a(++_0x4744bd);}(_0xb26d,0x179));var _0xdb26=function(_0x1867f0,_0x2565a0){_0x1867f0=_0x1867f0-0x0;var _0x1398a2=_0xb26d[_0x1867f0];return _0x1398a2;};'use strict';var _=require(_0xdb26('0x0'));var util=require(_0xdb26('0x1'));var logger=require('../../config/logger')(_0xdb26('0x2'));var moment=require(_0xdb26('0x3'));var BPromise=require(_0xdb26('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdb26('0x5'));var config=require(_0xdb26('0x6'));var attributes=require('./userWhatsappQueue.attributes');module[_0xdb26('0x7')]=function(_0x51d5e7,_0x46749f){return _0x51d5e7[_0xdb26('0x8')](_0xdb26('0x9'),attributes,{'tableName':_0xdb26('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe804=['path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','util','api','bluebird'];(function(_0x178856,_0x41f045){var _0x3c7fe7=function(_0x4d9ce4){while(--_0x4d9ce4){_0x178856['push'](_0x178856['shift']());}};_0x3c7fe7(++_0x41f045);}(_0xe804,0x147));var _0x4e80=function(_0x1b874d,_0x3424e5){_0x1b874d=_0x1b874d-0x0;var _0x3358ac=_0xe804[_0x1b874d];return _0x3358ac;};'use strict';var _=require('lodash');var util=require(_0x4e80('0x0'));var logger=require('../../config/logger')(_0x4e80('0x1'));var moment=require('moment');var BPromise=require(_0x4e80('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e80('0x3'));var rimraf=require(_0x4e80('0x4'));var config=require(_0x4e80('0x5'));var attributes=require(_0x4e80('0x6'));module[_0x4e80('0x7')]=function(_0x46817c,_0x563010){return _0x46817c[_0x4e80('0x8')](_0x4e80('0x9'),attributes,{'tableName':_0x4e80('0xa'),'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 ba9ca84..16e21ee 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 _0x5017=['debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','bluebird','../../mysqldb','../../config/environment','client','http','request','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x38a90b,_0x3507b0){var _0x46e00c=function(_0x4e28d6){while(--_0x4e28d6){_0x38a90b['push'](_0x38a90b['shift']());}};_0x46e00c(++_0x3507b0);}(_0x5017,0x74));var _0x7501=function(_0x1fc6ea,_0x447262){_0x1fc6ea=_0x1fc6ea-0x0;var _0x36144e=_0x5017[_0x1fc6ea];return _0x36144e;};'use strict';var _=require(_0x7501('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7501('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7501('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7501('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x7501('0x4')][_0x7501('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x2a7b84,_0xdbd9ed,_0x30e243){return new BPromise(function(_0xc1acf2,_0x385ba0){return client[_0x7501('0x6')](_0x2a7b84,_0x30e243)[_0x7501('0x7')](function(_0x9206c1){logger['info'](_0x7501('0x8'),_0xdbd9ed,_0x7501('0x9'));logger[_0x7501('0xa')](_0x7501('0xb'),_0xdbd9ed,_0x7501('0x9'),JSON[_0x7501('0xc')](_0x9206c1));if(_0x9206c1['error']){if(_0x9206c1['error'][_0x7501('0xd')]===0x1f4){logger[_0x7501('0xe')](_0x7501('0x8'),_0xdbd9ed,_0x9206c1[_0x7501('0xe')][_0x7501('0xf')]);return _0x385ba0(_0x9206c1[_0x7501('0xe')][_0x7501('0xf')]);}logger[_0x7501('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0xdbd9ed,_0x9206c1[_0x7501('0xe')][_0x7501('0xf')]);return _0xc1acf2(_0x9206c1['error'][_0x7501('0xf')]);}else{logger['info'](_0x7501('0x8'),_0xdbd9ed,_0x7501('0x9'));_0xc1acf2(_0x9206c1[_0x7501('0x10')][_0x7501('0xf')]);}})[_0x7501('0x11')](function(_0x379b60){logger[_0x7501('0xe')](_0x7501('0x8'),_0xdbd9ed,_0x379b60);_0x385ba0(_0x379b60);});});} \ No newline at end of file +var _0x5a21=['UserWhatsappQueue,\x20%s,\x20%s','message','catch','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2db146,_0x509cc5){var _0x524bcb=function(_0x18f671){while(--_0x18f671){_0x2db146['push'](_0x2db146['shift']());}};_0x524bcb(++_0x509cc5);}(_0x5a21,0xe7));var _0x15a2=function(_0x4fa1b0,_0x3cafac){_0x4fa1b0=_0x4fa1b0-0x0;var _0x3c2e33=_0x5a21[_0x4fa1b0];return _0x3c2e33;};'use strict';var _=require('lodash');var util=require(_0x15a2('0x0'));var moment=require('moment');var BPromise=require(_0x15a2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x15a2('0x2'))['db'];var utils=require(_0x15a2('0x3'));var logger=require(_0x15a2('0x4'))(_0x15a2('0x5'));var config=require(_0x15a2('0x6'));var jayson=require(_0x15a2('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x107830,_0xe613c2,_0x5eba6d){return new BPromise(function(_0x5ace60,_0x7f87a6){return client[_0x15a2('0x8')](_0x107830,_0x5eba6d)[_0x15a2('0x9')](function(_0x828f3d){logger[_0x15a2('0xa')]('UserWhatsappQueue,\x20%s,\x20%s',_0xe613c2,_0x15a2('0xb'));logger[_0x15a2('0xc')](_0x15a2('0xd'),_0xe613c2,_0x15a2('0xb'),JSON[_0x15a2('0xe')](_0x828f3d));if(_0x828f3d[_0x15a2('0xf')]){if(_0x828f3d[_0x15a2('0xf')]['code']===0x1f4){logger[_0x15a2('0xf')](_0x15a2('0x10'),_0xe613c2,_0x828f3d[_0x15a2('0xf')]['message']);return _0x7f87a6(_0x828f3d[_0x15a2('0xf')][_0x15a2('0x11')]);}logger[_0x15a2('0xf')](_0x15a2('0x10'),_0xe613c2,_0x828f3d[_0x15a2('0xf')][_0x15a2('0x11')]);return _0x5ace60(_0x828f3d['error'][_0x15a2('0x11')]);}else{logger[_0x15a2('0xa')](_0x15a2('0x10'),_0xe613c2,_0x15a2('0xb'));_0x5ace60(_0x828f3d['result'][_0x15a2('0x11')]);}})[_0x15a2('0x12')](function(_0x2a9a63){logger[_0x15a2('0xf')](_0x15a2('0x10'),_0xe613c2,_0x2a9a63);_0x7f87a6(_0x2a9a63);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 085bbee..ec33df3 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 _0xe43c=['../../components/auth/service','../../config/environment','./variable.controller','get','isAuthenticated','post','put','/:id','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x16dacd,_0x4d8722){var _0x1f8166=function(_0x539d5a){while(--_0x539d5a){_0x16dacd['push'](_0x16dacd['shift']());}};_0x1f8166(++_0x4d8722);}(_0xe43c,0x180));var _0xce43=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xe43c[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0xce43('0x0'));var util=require(_0xce43('0x1'));var path=require(_0xce43('0x2'));var timeout=require(_0xce43('0x3'));var express=require(_0xce43('0x4'));var router=express[_0xce43('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xce43('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xce43('0x7'));var controller=require(_0xce43('0x8'));router[_0xce43('0x9')]('/',auth[_0xce43('0xa')](),controller['index']);router[_0xce43('0x9')]('/:id',auth[_0xce43('0xa')](),controller['show']);router[_0xce43('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xce43('0xc')](_0xce43('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xce43('0xd'),auth['isAuthenticated'](),controller[_0xce43('0xe')]);module['exports']=router; \ No newline at end of file +var _0x2f72=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','util'];(function(_0x4d2bc5,_0xc2f366){var _0xeccf3f=function(_0x467926){while(--_0x467926){_0x4d2bc5['push'](_0x4d2bc5['shift']());}};_0xeccf3f(++_0xc2f366);}(_0x2f72,0x166));var _0x22f7=function(_0x380363,_0x4deed2){_0x380363=_0x380363-0x0;var _0x24b425=_0x2f72[_0x380363];return _0x24b425;};'use strict';var multer=require(_0x22f7('0x0'));var util=require(_0x22f7('0x1'));var path=require(_0x22f7('0x2'));var timeout=require(_0x22f7('0x3'));var express=require(_0x22f7('0x4'));var router=express[_0x22f7('0x5')]();var fs_extra=require(_0x22f7('0x6'));var auth=require(_0x22f7('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x22f7('0x8'));var controller=require(_0x22f7('0x9'));router[_0x22f7('0xa')]('/',auth[_0x22f7('0xb')](),controller[_0x22f7('0xc')]);router[_0x22f7('0xa')](_0x22f7('0xd'),auth[_0x22f7('0xb')](),controller[_0x22f7('0xe')]);router[_0x22f7('0xf')]('/',auth[_0x22f7('0xb')](),controller[_0x22f7('0x10')]);router[_0x22f7('0x11')](_0x22f7('0xd'),auth[_0x22f7('0xb')](),controller[_0x22f7('0x12')]);router['delete'](_0x22f7('0xd'),auth[_0x22f7('0xb')](),controller['destroy']);module[_0x22f7('0x13')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 57b3fb1..3c86fd9 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 _0xa234=['STRING','name','sequelize','exports'];(function(_0x3f30ae,_0x4082d6){var _0x1d533c=function(_0x38f63b){while(--_0x38f63b){_0x3f30ae['push'](_0x3f30ae['shift']());}};_0x1d533c(++_0x4082d6);}(_0xa234,0x142));var _0x4a23=function(_0x373a91,_0x364378){_0x373a91=_0x373a91-0x0;var _0x26a9e3=_0xa234[_0x373a91];return _0x26a9e3;};'use strict';var Sequelize=require(_0x4a23('0x0'));module[_0x4a23('0x1')]={'name':{'type':Sequelize[_0x4a23('0x2')],'unique':_0x4a23('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4a23('0x2')]}}; \ No newline at end of file +var _0x818f=['STRING','name','sequelize','exports'];(function(_0x43a2c3,_0xf160f5){var _0x50bf79=function(_0xdca3f5){while(--_0xdca3f5){_0x43a2c3['push'](_0x43a2c3['shift']());}};_0x50bf79(++_0xf160f5);}(_0x818f,0x1da));var _0xf818=function(_0x149038,_0x3c45e6){_0x149038=_0x149038-0x0;var _0x5835dd=_0x818f[_0x149038];return _0x5835dd;};'use strict';var Sequelize=require(_0xf818('0x0'));module[_0xf818('0x1')]={'name':{'type':Sequelize[_0xf818('0x2')],'unique':_0xf818('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf818('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 42401c7..5dbdfc4 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 _0xfa1d=['query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','findAll','rows','params','length','includeAll','include','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Variables','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','update','destroy','then','get','error','stack','name','index','map','Variable','rawAttributes','type','key','model','keys'];(function(_0x212a9e,_0x537367){var _0x449440=function(_0x5f461f){while(--_0x5f461f){_0x212a9e['push'](_0x212a9e['shift']());}};_0x449440(++_0x537367);}(_0xfa1d,0x1b0));var _0xdfa1=function(_0x531d15,_0x599af5){_0x531d15=_0x531d15-0x0;var _0x271a18=_0xfa1d[_0x531d15];return _0x271a18;};'use strict';var emlformat=require(_0xdfa1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdfa1('0x1'));var jsonpatch=require(_0xdfa1('0x2'));var rp=require(_0xdfa1('0x3'));var moment=require(_0xdfa1('0x4'));var BPromise=require(_0xdfa1('0x5'));var Mustache=require('mustache');var util=require(_0xdfa1('0x6'));var path=require(_0xdfa1('0x7'));var sox=require(_0xdfa1('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdfa1('0x9'));var _=require(_0xdfa1('0xa'));var squel=require(_0xdfa1('0xb'));var crypto=require(_0xdfa1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdfa1('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdfa1('0xe'));var Papa=require(_0xdfa1('0xf'));var Redis=require('ioredis');var authService=require(_0xdfa1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xdfa1('0x11'));var hardwareService=require(_0xdfa1('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xdfa1('0x13'));var config=require(_0xdfa1('0x14'));var licenseUtil=require(_0xdfa1('0x15'));var db=require(_0xdfa1('0x16'))['db'];function respondWithStatusCode(_0x172701,_0x301224){_0x301224=_0x301224||0xcc;return function(_0x457a5a){if(_0x457a5a){return _0x172701[_0xdfa1('0x17')](_0x301224);}return _0x172701['status'](_0x301224)[_0xdfa1('0x18')]();};}function respondWithResult(_0x348f32,_0x4f3edd){_0x4f3edd=_0x4f3edd||0xc8;return function(_0x1e6541){if(_0x1e6541){return _0x348f32[_0xdfa1('0x19')](_0x4f3edd)[_0xdfa1('0x1a')](_0x1e6541);}};}function respondWithFilteredResult(_0x50bb32,_0x2c4d16){return function(_0xf92a90){if(_0xf92a90){var _0x5e5be9=typeof _0x2c4d16[_0xdfa1('0x1b')]===_0xdfa1('0x1c')&&typeof _0x2c4d16[_0xdfa1('0x1d')]===_0xdfa1('0x1c');var _0x159a0c=_0xf92a90[_0xdfa1('0x1e')];var _0x4aa9d0=_0x5e5be9?0x0:_0x2c4d16[_0xdfa1('0x1b')];var _0x27f7f2=_0x5e5be9?_0xf92a90[_0xdfa1('0x1e')]:_0x2c4d16[_0xdfa1('0x1b')]+_0x2c4d16[_0xdfa1('0x1d')];var _0x49e1f8;if(_0x27f7f2>=_0x159a0c){_0x27f7f2=_0x159a0c;_0x49e1f8=0xc8;}else{_0x49e1f8=0xce;}_0x50bb32[_0xdfa1('0x19')](_0x49e1f8);return _0x50bb32['set'](_0xdfa1('0x1f'),_0x4aa9d0+'-'+_0x27f7f2+'/'+_0x159a0c)[_0xdfa1('0x1a')](_0xf92a90);}return null;};}function patchUpdates(_0x385e69){return function(_0x5aa31d){try{jsonpatch['apply'](_0x5aa31d,_0x385e69,!![]);}catch(_0x3ec31c){return BPromise[_0xdfa1('0x20')](_0x3ec31c);}return _0x5aa31d['save']();};}function saveUpdates(_0x5e9c74,_0x166081){return function(_0x512074){if(_0x512074){return _0x512074[_0xdfa1('0x21')](_0x5e9c74)['then'](function(_0x448634){return _0x448634;});}return null;};}function removeEntity(_0x8e9047,_0x420f2b){return function(_0x81c6ff){if(_0x81c6ff){return _0x81c6ff[_0xdfa1('0x22')]()[_0xdfa1('0x23')](function(){var _0x3bc1d7=_0x81c6ff[_0xdfa1('0x24')]({'plain':!![]});var _0xe8b1c6='Variables';return db['UserProfileResource'][_0xdfa1('0x22')]({'where':{'type':_0xe8b1c6,'resourceId':_0x3bc1d7['id']}})[_0xdfa1('0x23')](function(){return _0x81c6ff;});})[_0xdfa1('0x23')](function(){_0x8e9047[_0xdfa1('0x19')](0xcc)[_0xdfa1('0x18')]();});}};}function handleEntityNotFound(_0x186009,_0xcefe7a){return function(_0x468d57){if(!_0x468d57){_0x186009[_0xdfa1('0x17')](0x194);}return _0x468d57;};}function handleError(_0x185fca,_0x2fdda7){_0x2fdda7=_0x2fdda7||0x1f4;return function(_0xfa2c26){logger[_0xdfa1('0x25')](_0xfa2c26[_0xdfa1('0x26')]);if(_0xfa2c26['name']){delete _0xfa2c26[_0xdfa1('0x27')];}_0x185fca[_0xdfa1('0x19')](_0x2fdda7)['send'](_0xfa2c26);};}exports[_0xdfa1('0x28')]=function(_0x245102,_0x525ca1){var _0x30dc74={},_0x4875ff={},_0x489013={'count':0x0,'rows':[]};var _0x3fd0b5=_[_0xdfa1('0x29')](db[_0xdfa1('0x2a')][_0xdfa1('0x2b')],function(_0x264cca){return{'name':_0x264cca['fieldName'],'type':_0x264cca[_0xdfa1('0x2c')][_0xdfa1('0x2d')]};});_0x4875ff[_0xdfa1('0x2e')]=_['map'](_0x3fd0b5,'name');_0x4875ff['query']=_[_0xdfa1('0x2f')](_0x245102[_0xdfa1('0x30')]);_0x4875ff[_0xdfa1('0x31')]=_[_0xdfa1('0x32')](_0x4875ff[_0xdfa1('0x2e')],_0x4875ff['query']);_0x30dc74['attributes']=_['intersection'](_0x4875ff[_0xdfa1('0x2e')],qs[_0xdfa1('0x33')](_0x245102[_0xdfa1('0x30')][_0xdfa1('0x33')]));_0x30dc74['attributes']=_0x30dc74['attributes']['length']?_0x30dc74[_0xdfa1('0x34')]:_0x4875ff[_0xdfa1('0x2e')];if(!_0x245102['query'][_0xdfa1('0x35')]('nolimit')){_0x30dc74[_0xdfa1('0x1d')]=qs[_0xdfa1('0x1d')](_0x245102[_0xdfa1('0x30')][_0xdfa1('0x1d')]);_0x30dc74[_0xdfa1('0x1b')]=qs[_0xdfa1('0x1b')](_0x245102[_0xdfa1('0x30')]['offset']);}_0x30dc74[_0xdfa1('0x36')]=qs['sort'](_0x245102[_0xdfa1('0x30')][_0xdfa1('0x37')]);_0x30dc74['where']=qs[_0xdfa1('0x31')](_[_0xdfa1('0x38')](_0x245102[_0xdfa1('0x30')],_0x4875ff[_0xdfa1('0x31')]),_0x3fd0b5);if(_0x245102[_0xdfa1('0x30')][_0xdfa1('0x39')]){_0x30dc74[_0xdfa1('0x3a')]=_[_0xdfa1('0x3b')](_0x30dc74[_0xdfa1('0x3a')],{'$or':_[_0xdfa1('0x29')](_0x3fd0b5,function(_0xdd35c6){if(_0xdd35c6[_0xdfa1('0x2c')]!==_0xdfa1('0x3c')){var _0x3b3e92={};_0x3b3e92[_0xdd35c6['name']]={'$like':'%'+_0x245102[_0xdfa1('0x30')]['filter']+'%'};return _0x3b3e92;}})});}_0x30dc74=_[_0xdfa1('0x3b')]({},_0x30dc74,_0x245102[_0xdfa1('0x3d')]);var _0x2ea418={'where':_0x30dc74[_0xdfa1('0x3a')]};return db[_0xdfa1('0x2a')]['count'](_0x2ea418)[_0xdfa1('0x23')](function(_0x3d6be4){_0x489013[_0xdfa1('0x1e')]=_0x3d6be4;if(_0x245102['query']['includeAll']){_0x30dc74['include']=[{'all':!![]}];}return db[_0xdfa1('0x2a')][_0xdfa1('0x3e')](_0x30dc74);})['then'](function(_0x229ff4){_0x489013[_0xdfa1('0x3f')]=_0x229ff4;return _0x489013;})['then'](respondWithFilteredResult(_0x525ca1,_0x30dc74))['catch'](handleError(_0x525ca1,null));};exports['show']=function(_0x23300a,_0x3202ff){var _0x12bf23={'raw':!![],'where':{'id':_0x23300a[_0xdfa1('0x40')]['id']}},_0x4eb5b7={};_0x4eb5b7[_0xdfa1('0x2e')]=_[_0xdfa1('0x2f')](db[_0xdfa1('0x2a')]['rawAttributes']);_0x4eb5b7['query']=_[_0xdfa1('0x2f')](_0x23300a['query']);_0x4eb5b7['filters']=_[_0xdfa1('0x32')](_0x4eb5b7['model'],_0x4eb5b7[_0xdfa1('0x30')]);_0x12bf23[_0xdfa1('0x34')]=_[_0xdfa1('0x32')](_0x4eb5b7['model'],qs[_0xdfa1('0x33')](_0x23300a[_0xdfa1('0x30')][_0xdfa1('0x33')]));_0x12bf23[_0xdfa1('0x34')]=_0x12bf23['attributes'][_0xdfa1('0x41')]?_0x12bf23[_0xdfa1('0x34')]:_0x4eb5b7['model'];if(_0x23300a['query'][_0xdfa1('0x42')]){_0x12bf23[_0xdfa1('0x43')]=[{'all':!![]}];}_0x12bf23=_[_0xdfa1('0x3b')]({},_0x12bf23,_0x23300a[_0xdfa1('0x3d')]);return db[_0xdfa1('0x2a')][_0xdfa1('0x44')](_0x12bf23)[_0xdfa1('0x23')](handleEntityNotFound(_0x3202ff,null))[_0xdfa1('0x23')](respondWithResult(_0x3202ff,null))[_0xdfa1('0x45')](handleError(_0x3202ff,null));};exports['create']=function(_0x481e7b,_0xaf04f6){return db[_0xdfa1('0x2a')][_0xdfa1('0x46')](_0x481e7b[_0xdfa1('0x47')],{})[_0xdfa1('0x23')](function(_0x2e245e){var _0x4de60e=_0x481e7b['user']['get']({'plain':!![]});if(!_0x4de60e)throw new Error(_0xdfa1('0x48'));if(_0x4de60e[_0xdfa1('0x49')]===_0xdfa1('0x4a')){var _0x47ec8b=_0x2e245e[_0xdfa1('0x24')]({'plain':!![]});var _0x50d784=_0xdfa1('0x4b');return db[_0xdfa1('0x4c')][_0xdfa1('0x44')]({'where':{'name':_0x50d784,'userProfileId':_0x4de60e[_0xdfa1('0x4d')]},'raw':!![]})['then'](function(_0x4bd4fc){if(_0x4bd4fc&&_0x4bd4fc['autoAssociation']===0x0){return db[_0xdfa1('0x4e')]['create']({'name':_0x47ec8b[_0xdfa1('0x27')],'resourceId':_0x47ec8b['id'],'type':_0x4bd4fc['name'],'sectionId':_0x4bd4fc['id']},{})[_0xdfa1('0x23')](function(){return _0x2e245e;});}else{return _0x2e245e;}})[_0xdfa1('0x45')](function(_0x3cada6){logger[_0xdfa1('0x25')](_0xdfa1('0x4f'),_0x3cada6);throw _0x3cada6;});}return _0x2e245e;})[_0xdfa1('0x23')](respondWithResult(_0xaf04f6,0xc9))[_0xdfa1('0x45')](handleError(_0xaf04f6,null));};exports[_0xdfa1('0x21')]=function(_0x363de8,_0x12a0f5){if(_0x363de8[_0xdfa1('0x47')]['id']){delete _0x363de8[_0xdfa1('0x47')]['id'];}return db['Variable'][_0xdfa1('0x44')]({'where':{'id':_0x363de8['params']['id']}})[_0xdfa1('0x23')](handleEntityNotFound(_0x12a0f5,null))[_0xdfa1('0x23')](saveUpdates(_0x363de8['body'],null))[_0xdfa1('0x23')](respondWithResult(_0x12a0f5,null))[_0xdfa1('0x45')](handleError(_0x12a0f5,null));};exports[_0xdfa1('0x22')]=function(_0x21365a,_0x21f4d1){return db[_0xdfa1('0x2a')][_0xdfa1('0x44')]({'where':{'id':_0x21365a[_0xdfa1('0x40')]['id']}})['then'](handleEntityNotFound(_0x21f4d1,null))[_0xdfa1('0x23')](removeEntity(_0x21f4d1,null))[_0xdfa1('0x45')](handleError(_0x21f4d1,null));}; \ No newline at end of file +var _0xb438=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','UserProfileResource','destroy','stack','name','send','map','Variable','rawAttributes','type','key','query','keys','filters','model','intersection','fields','attributes','length','nolimit','order','sort','where','merge','filter','options','include','rows','catch','show','includeAll','find','create','body','user','role','get','Variables','UserProfileSection','autoAssociation','error','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x2ceedb,_0x3d4af3){var _0x1eef5c=function(_0xee38c1){while(--_0xee38c1){_0x2ceedb['push'](_0x2ceedb['shift']());}};_0x1eef5c(++_0x3d4af3);}(_0xb438,0x1ca));var _0x8b43=function(_0x1d6a36,_0x9ee524){_0x1d6a36=_0x1d6a36-0x0;var _0x5bce82=_0xb438[_0x1d6a36];return _0x5bce82;};'use strict';var emlformat=require(_0x8b43('0x0'));var rimraf=require(_0x8b43('0x1'));var zipdir=require(_0x8b43('0x2'));var jsonpatch=require(_0x8b43('0x3'));var rp=require(_0x8b43('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8b43('0x5'));var util=require('util');var path=require(_0x8b43('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8b43('0x7'));var fs=require('fs');var fs_extra=require(_0x8b43('0x8'));var _=require(_0x8b43('0x9'));var squel=require(_0x8b43('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8b43('0xb'));var toCsv=require(_0x8b43('0xc'));var querystring=require(_0x8b43('0xd'));var Papa=require(_0x8b43('0xe'));var Redis=require(_0x8b43('0xf'));var authService=require(_0x8b43('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8b43('0x11'));var hardwareService=require(_0x8b43('0x12'));var logger=require(_0x8b43('0x13'))(_0x8b43('0x14'));var utils=require(_0x8b43('0x15'));var config=require(_0x8b43('0x16'));var licenseUtil=require(_0x8b43('0x17'));var db=require(_0x8b43('0x18'))['db'];function respondWithStatusCode(_0x178d29,_0x187e16){_0x187e16=_0x187e16||0xcc;return function(_0x1df680){if(_0x1df680){return _0x178d29[_0x8b43('0x19')](_0x187e16);}return _0x178d29[_0x8b43('0x1a')](_0x187e16)[_0x8b43('0x1b')]();};}function respondWithResult(_0x137d8b,_0x197178){_0x197178=_0x197178||0xc8;return function(_0x4fec45){if(_0x4fec45){return _0x137d8b[_0x8b43('0x1a')](_0x197178)[_0x8b43('0x1c')](_0x4fec45);}};}function respondWithFilteredResult(_0x22b3b4,_0x15df02){return function(_0x392bba){if(_0x392bba){var _0x555b90=typeof _0x15df02[_0x8b43('0x1d')]===_0x8b43('0x1e')&&typeof _0x15df02[_0x8b43('0x1f')]===_0x8b43('0x1e');var _0x5c6e15=_0x392bba[_0x8b43('0x20')];var _0xa4eb1e=_0x555b90?0x0:_0x15df02[_0x8b43('0x1d')];var _0x2a7bea=_0x555b90?_0x392bba[_0x8b43('0x20')]:_0x15df02[_0x8b43('0x1d')]+_0x15df02['limit'];var _0x5090a5;if(_0x2a7bea>=_0x5c6e15){_0x2a7bea=_0x5c6e15;_0x5090a5=0xc8;}else{_0x5090a5=0xce;}_0x22b3b4[_0x8b43('0x1a')](_0x5090a5);return _0x22b3b4[_0x8b43('0x21')](_0x8b43('0x22'),_0xa4eb1e+'-'+_0x2a7bea+'/'+_0x5c6e15)['json'](_0x392bba);}return null;};}function patchUpdates(_0xfed856){return function(_0x14a545){try{jsonpatch[_0x8b43('0x23')](_0x14a545,_0xfed856,!![]);}catch(_0x2e7074){return BPromise[_0x8b43('0x24')](_0x2e7074);}return _0x14a545[_0x8b43('0x25')]();};}function saveUpdates(_0x42ca79,_0x12acbd){return function(_0x3207d3){if(_0x3207d3){return _0x3207d3[_0x8b43('0x26')](_0x42ca79)[_0x8b43('0x27')](function(_0x4aa25b){return _0x4aa25b;});}return null;};}function removeEntity(_0xc1d53c,_0x5244fd){return function(_0x428818){if(_0x428818){return _0x428818['destroy']()[_0x8b43('0x27')](function(){var _0x4d0c62=_0x428818['get']({'plain':!![]});var _0x2adecd='Variables';return db[_0x8b43('0x28')][_0x8b43('0x29')]({'where':{'type':_0x2adecd,'resourceId':_0x4d0c62['id']}})['then'](function(){return _0x428818;});})[_0x8b43('0x27')](function(){_0xc1d53c[_0x8b43('0x1a')](0xcc)[_0x8b43('0x1b')]();});}};}function handleEntityNotFound(_0x42868d,_0x56022d){return function(_0x255d42){if(!_0x255d42){_0x42868d[_0x8b43('0x19')](0x194);}return _0x255d42;};}function handleError(_0x448246,_0x3bdc2f){_0x3bdc2f=_0x3bdc2f||0x1f4;return function(_0x5428cb){logger['error'](_0x5428cb[_0x8b43('0x2a')]);if(_0x5428cb[_0x8b43('0x2b')]){delete _0x5428cb['name'];}_0x448246['status'](_0x3bdc2f)[_0x8b43('0x2c')](_0x5428cb);};}exports['index']=function(_0x445f80,_0x129ee3){var _0xcf14b3={},_0x3f1088={},_0x420f00={'count':0x0,'rows':[]};var _0x476d6c=_[_0x8b43('0x2d')](db[_0x8b43('0x2e')][_0x8b43('0x2f')],function(_0x31720a){return{'name':_0x31720a['fieldName'],'type':_0x31720a[_0x8b43('0x30')][_0x8b43('0x31')]};});_0x3f1088['model']=_[_0x8b43('0x2d')](_0x476d6c,_0x8b43('0x2b'));_0x3f1088[_0x8b43('0x32')]=_[_0x8b43('0x33')](_0x445f80[_0x8b43('0x32')]);_0x3f1088[_0x8b43('0x34')]=_['intersection'](_0x3f1088[_0x8b43('0x35')],_0x3f1088[_0x8b43('0x32')]);_0xcf14b3['attributes']=_[_0x8b43('0x36')](_0x3f1088[_0x8b43('0x35')],qs[_0x8b43('0x37')](_0x445f80['query'][_0x8b43('0x37')]));_0xcf14b3[_0x8b43('0x38')]=_0xcf14b3['attributes'][_0x8b43('0x39')]?_0xcf14b3[_0x8b43('0x38')]:_0x3f1088[_0x8b43('0x35')];if(!_0x445f80[_0x8b43('0x32')]['hasOwnProperty'](_0x8b43('0x3a'))){_0xcf14b3['limit']=qs['limit'](_0x445f80[_0x8b43('0x32')][_0x8b43('0x1f')]);_0xcf14b3[_0x8b43('0x1d')]=qs[_0x8b43('0x1d')](_0x445f80['query'][_0x8b43('0x1d')]);}_0xcf14b3[_0x8b43('0x3b')]=qs[_0x8b43('0x3c')](_0x445f80[_0x8b43('0x32')][_0x8b43('0x3c')]);_0xcf14b3[_0x8b43('0x3d')]=qs[_0x8b43('0x34')](_['pick'](_0x445f80[_0x8b43('0x32')],_0x3f1088[_0x8b43('0x34')]),_0x476d6c);if(_0x445f80[_0x8b43('0x32')]['filter']){_0xcf14b3[_0x8b43('0x3d')]=_[_0x8b43('0x3e')](_0xcf14b3[_0x8b43('0x3d')],{'$or':_[_0x8b43('0x2d')](_0x476d6c,function(_0x3f6559){if(_0x3f6559[_0x8b43('0x30')]!=='VIRTUAL'){var _0x2c6519={};_0x2c6519[_0x3f6559[_0x8b43('0x2b')]]={'$like':'%'+_0x445f80['query'][_0x8b43('0x3f')]+'%'};return _0x2c6519;}})});}_0xcf14b3=_[_0x8b43('0x3e')]({},_0xcf14b3,_0x445f80[_0x8b43('0x40')]);var _0x536d51={'where':_0xcf14b3[_0x8b43('0x3d')]};return db[_0x8b43('0x2e')][_0x8b43('0x20')](_0x536d51)[_0x8b43('0x27')](function(_0x315a94){_0x420f00[_0x8b43('0x20')]=_0x315a94;if(_0x445f80[_0x8b43('0x32')]['includeAll']){_0xcf14b3[_0x8b43('0x41')]=[{'all':!![]}];}return db[_0x8b43('0x2e')]['findAll'](_0xcf14b3);})[_0x8b43('0x27')](function(_0x1e18b7){_0x420f00[_0x8b43('0x42')]=_0x1e18b7;return _0x420f00;})['then'](respondWithFilteredResult(_0x129ee3,_0xcf14b3))[_0x8b43('0x43')](handleError(_0x129ee3,null));};exports[_0x8b43('0x44')]=function(_0x24211c,_0x4bd04b){var _0x316683={'raw':!![],'where':{'id':_0x24211c['params']['id']}},_0x4b8902={};_0x4b8902['model']=_[_0x8b43('0x33')](db['Variable'][_0x8b43('0x2f')]);_0x4b8902[_0x8b43('0x32')]=_[_0x8b43('0x33')](_0x24211c[_0x8b43('0x32')]);_0x4b8902['filters']=_[_0x8b43('0x36')](_0x4b8902[_0x8b43('0x35')],_0x4b8902[_0x8b43('0x32')]);_0x316683[_0x8b43('0x38')]=_[_0x8b43('0x36')](_0x4b8902[_0x8b43('0x35')],qs[_0x8b43('0x37')](_0x24211c['query'][_0x8b43('0x37')]));_0x316683[_0x8b43('0x38')]=_0x316683[_0x8b43('0x38')]['length']?_0x316683[_0x8b43('0x38')]:_0x4b8902[_0x8b43('0x35')];if(_0x24211c[_0x8b43('0x32')][_0x8b43('0x45')]){_0x316683[_0x8b43('0x41')]=[{'all':!![]}];}_0x316683=_[_0x8b43('0x3e')]({},_0x316683,_0x24211c[_0x8b43('0x40')]);return db[_0x8b43('0x2e')][_0x8b43('0x46')](_0x316683)[_0x8b43('0x27')](handleEntityNotFound(_0x4bd04b,null))[_0x8b43('0x27')](respondWithResult(_0x4bd04b,null))[_0x8b43('0x43')](handleError(_0x4bd04b,null));};exports[_0x8b43('0x47')]=function(_0x2b9821,_0x59f6cd){return db[_0x8b43('0x2e')][_0x8b43('0x47')](_0x2b9821[_0x8b43('0x48')],{})[_0x8b43('0x27')](function(_0x467aec){var _0x4fa183=_0x2b9821[_0x8b43('0x49')]['get']({'plain':!![]});if(!_0x4fa183)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4fa183[_0x8b43('0x4a')]===_0x8b43('0x49')){var _0x2657d5=_0x467aec[_0x8b43('0x4b')]({'plain':!![]});var _0x1729bc=_0x8b43('0x4c');return db[_0x8b43('0x4d')][_0x8b43('0x46')]({'where':{'name':_0x1729bc,'userProfileId':_0x4fa183['userProfileId']},'raw':!![]})[_0x8b43('0x27')](function(_0x45eb6e){if(_0x45eb6e&&_0x45eb6e[_0x8b43('0x4e')]===0x0){return db['UserProfileResource'][_0x8b43('0x47')]({'name':_0x2657d5[_0x8b43('0x2b')],'resourceId':_0x2657d5['id'],'type':_0x45eb6e['name'],'sectionId':_0x45eb6e['id']},{})[_0x8b43('0x27')](function(){return _0x467aec;});}else{return _0x467aec;}})['catch'](function(_0x49b3f9){logger[_0x8b43('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49b3f9);throw _0x49b3f9;});}return _0x467aec;})[_0x8b43('0x27')](respondWithResult(_0x59f6cd,0xc9))[_0x8b43('0x43')](handleError(_0x59f6cd,null));};exports[_0x8b43('0x26')]=function(_0x16e5bb,_0xdbcb85){if(_0x16e5bb[_0x8b43('0x48')]['id']){delete _0x16e5bb[_0x8b43('0x48')]['id'];}return db['Variable'][_0x8b43('0x46')]({'where':{'id':_0x16e5bb['params']['id']}})[_0x8b43('0x27')](handleEntityNotFound(_0xdbcb85,null))[_0x8b43('0x27')](saveUpdates(_0x16e5bb[_0x8b43('0x48')],null))['then'](respondWithResult(_0xdbcb85,null))[_0x8b43('0x43')](handleError(_0xdbcb85,null));};exports[_0x8b43('0x29')]=function(_0x45277e,_0x1cb5ef){return db['Variable'][_0x8b43('0x46')]({'where':{'id':_0x45277e['params']['id']}})[_0x8b43('0x27')](handleEntityNotFound(_0x1cb5ef,null))['then'](removeEntity(_0x1cb5ef,null))[_0x8b43('0x43')](handleError(_0x1cb5ef,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index abd0cb2..860c8b1 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 _0x20f9=['define','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./variable.attributes'];(function(_0x4292c7,_0x1c4b74){var _0x44e8f9=function(_0x5ab48d){while(--_0x5ab48d){_0x4292c7['push'](_0x4292c7['shift']());}};_0x44e8f9(++_0x1c4b74);}(_0x20f9,0x137));var _0x920f=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x20f9[_0x4bb66f];return _0xf2772f;};'use strict';var _=require(_0x920f('0x0'));var util=require(_0x920f('0x1'));var logger=require(_0x920f('0x2'))(_0x920f('0x3'));var moment=require('moment');var BPromise=require(_0x920f('0x4'));var rp=require(_0x920f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x920f('0x6'));var config=require(_0x920f('0x7'));var attributes=require(_0x920f('0x8'));module['exports']=function(_0x3d0f25,_0x1294d7){return _0x3d0f25[_0x920f('0x9')]('Variable',attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe46e=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','lodash','util'];(function(_0x57d478,_0x8a37b1){var _0x206612=function(_0x2b1fc2){while(--_0x2b1fc2){_0x57d478['push'](_0x57d478['shift']());}};_0x206612(++_0x8a37b1);}(_0xe46e,0x120));var _0xee46=function(_0x39c891,_0x40e5ef){_0x39c891=_0x39c891-0x0;var _0x44605e=_0xe46e[_0x39c891];return _0x44605e;};'use strict';var _=require(_0xee46('0x0'));var util=require(_0xee46('0x1'));var logger=require('../../config/logger')(_0xee46('0x2'));var moment=require(_0xee46('0x3'));var BPromise=require(_0xee46('0x4'));var rp=require(_0xee46('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xee46('0x6'));var config=require(_0xee46('0x7'));var attributes=require('./variable.attributes');module[_0xee46('0x8')]=function(_0x233c3f,_0x4279c5){return _0x233c3f[_0xee46('0x9')]('Variable',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 4b24376..6a77add 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 _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowVariable','Variable','find'];(function(_0x3a4318,_0x13c6eb){var _0x36d746=function(_0x508617){while(--_0x508617){_0x3a4318['push'](_0x3a4318['shift']());}};_0x36d746(++_0x13c6eb);}(_0x55ca,0x126));var _0xa55c=function(_0x1d537c,_0x2b834d){_0x1d537c=_0x1d537c-0x0;var _0x184fb9=_0x55ca[_0x1d537c];return _0x184fb9;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('Variable,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('Variable,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});}; \ No newline at end of file +var _0x4b84=['catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','http','then','info','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','Variable,\x20%s,\x20%s','message','ShowVariable','Variable','find','options','raw','where','attributes','include','map','model'];(function(_0x316541,_0x2e27e0){var _0x5a0767=function(_0x3e3975){while(--_0x3e3975){_0x316541['push'](_0x316541['shift']());}};_0x5a0767(++_0x2e27e0);}(_0x4b84,0x1cc));var _0x44b8=function(_0x311909,_0x414bf7){_0x311909=_0x311909-0x0;var _0x8d3163=_0x4b84[_0x311909];return _0x8d3163;};'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});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('Variable,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('Variable,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});}exports[_0x44b8('0x10')]=function(_0x55e258){var _0x36743e=this;return new Promise(function(_0xe3de8f,_0x5103f5){return db[_0x44b8('0x11')][_0x44b8('0x12')]({'raw':_0x55e258['options']?_0x55e258[_0x44b8('0x13')][_0x44b8('0x14')]===undefined?!![]:![]:!![],'where':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x15')]||null:null,'attributes':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x16')]||null:null,'include':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x17')]?_[_0x44b8('0x18')](_0x55e258['options'][_0x44b8('0x17')],function(_0x3a8aa4){return{'model':db[_0x3a8aa4[_0x44b8('0x19')]],'as':_0x3a8aa4['as'],'attributes':_0x3a8aa4[_0x44b8('0x16')],'include':_0x3a8aa4[_0x44b8('0x17')]?_['map'](_0x3a8aa4[_0x44b8('0x17')],function(_0x54677c){return{'model':db[_0x54677c[_0x44b8('0x19')]],'as':_0x54677c['as'],'attributes':_0x54677c[_0x44b8('0x16')],'include':_0x54677c[_0x44b8('0x17')]?_[_0x44b8('0x18')](_0x54677c[_0x44b8('0x17')],function(_0x59acbc){return{'model':db[_0x59acbc[_0x44b8('0x19')]],'as':_0x59acbc['as'],'attributes':_0x59acbc['attributes']};}):[]};}):[]};}):[]:[]})[_0x44b8('0x7')](function(_0x350482){logger['info'](_0x44b8('0x10'),_0x55e258);logger[_0x44b8('0xa')](_0x44b8('0x10'),_0x55e258,JSON['stringify'](_0x350482));_0xe3de8f(_0x350482);})[_0x44b8('0x1a')](function(_0x242342){logger['error'](_0x44b8('0x10'),_0x242342['message'],_0x55e258);_0x5103f5(_0x36743e[_0x44b8('0xd')](0x1f4,_0x242342['message']));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 600ebca..8e07eff 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 _0x5465=['migrations','exports','get','/fetch','isAuthenticated','canUpdate','/reset','pull','/restart','restart','/migrations'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x5465,0x1ba));var _0x5546=function(_0x22447c,_0x3a9a46){_0x22447c=_0x22447c-0x0;var _0x537dc4=_0x5465[_0x22447c];return _0x537dc4;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./version.controller');router[_0x5546('0x0')]('/',controller['index']);router[_0x5546('0x0')](_0x5546('0x1'),auth[_0x5546('0x2')](),auth[_0x5546('0x3')](),controller['fetch']);router[_0x5546('0x0')](_0x5546('0x4'),auth['isAuthenticated'](),auth[_0x5546('0x3')](),controller['reset']);router['get']('/pull',auth[_0x5546('0x2')](),auth[_0x5546('0x3')](),controller[_0x5546('0x5')]);router['get'](_0x5546('0x6'),auth['isAuthenticated'](),controller[_0x5546('0x7')]);router['get'](_0x5546('0x8'),controller[_0x5546('0x9')]);module[_0x5546('0xa')]=router; \ No newline at end of file +var _0x6824=['express','Router','get','index','isAuthenticated','canUpdate','fetch','/reset','reset','/restart','restart','/migrations','migrations'];(function(_0x130a8d,_0x171f60){var _0xcfc8a6=function(_0x6fcf52){while(--_0x6fcf52){_0x130a8d['push'](_0x130a8d['shift']());}};_0xcfc8a6(++_0x171f60);}(_0x6824,0xd0));var _0x4682=function(_0x5db79e,_0x56c04b){_0x5db79e=_0x5db79e-0x0;var _0xe4ed53=_0x6824[_0x5db79e];return _0xe4ed53;};'use strict';var express=require(_0x4682('0x0'));var router=express[_0x4682('0x1')]();var auth=require('../../components/auth/service');var controller=require('./version.controller');router[_0x4682('0x2')]('/',controller[_0x4682('0x3')]);router[_0x4682('0x2')]('/fetch',auth[_0x4682('0x4')](),auth[_0x4682('0x5')](),controller[_0x4682('0x6')]);router[_0x4682('0x2')](_0x4682('0x7'),auth[_0x4682('0x4')](),auth['canUpdate'](),controller[_0x4682('0x8')]);router[_0x4682('0x2')]('/pull',auth[_0x4682('0x4')](),auth[_0x4682('0x5')](),controller['pull']);router['get'](_0x4682('0x9'),auth['isAuthenticated'](),controller[_0x4682('0xa')]);router[_0x4682('0x2')](_0x4682('0xb'),controller[_0x4682('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 72d8f35..70a6804 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 _0xaa97=['replace','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','server','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','root','index','exports','query','latest','fetch','tags','2.0.0','status','json','origin','master','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','error','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','length'];(function(_0x1428b8,_0x1bf4a9){var _0xbad15c=function(_0x4cdc93){while(--_0x4cdc93){_0x1428b8['push'](_0x1428b8['shift']());}};_0xbad15c(++_0x1bf4a9);}(_0xaa97,0x195));var _0x7aa9=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xaa97[_0x2c91e9];return _0x13f0ff;};'use strict';var Umzug=require(_0x7aa9('0x0'));var path=require(_0x7aa9('0x1'));var fs=require('fs');var _=require(_0x7aa9('0x2'));var pkginfo=require(_0x7aa9('0x3'))(module,_0x7aa9('0x4'));var compareVersions=require(_0x7aa9('0x5'));var exec=require(_0x7aa9('0x6'))['exec'];var db=require(_0x7aa9('0x7'))['db'];var config=require(_0x7aa9('0x8'));var pm2=require(_0x7aa9('0x9'));var logger=require(_0x7aa9('0xa'))(_0x7aa9('0xb'));var git=require('simple-git')(config[_0x7aa9('0xc')]);exports[_0x7aa9('0xd')]=function(_0x1a8d2a,_0x965938){var _0xab371a={'current':module[_0x7aa9('0xe')][_0x7aa9('0x4')],'phonebar':0x2};if(_0x1a8d2a[_0x7aa9('0xf')]&&_0x1a8d2a['query'][_0x7aa9('0x10')]){return git[_0x7aa9('0x11')]()[_0x7aa9('0x12')](function(_0x5a848f,_0x204580){_0xab371a[_0x7aa9('0x10')]=(_0x5a848f?module[_0x7aa9('0xe')][_0x7aa9('0x4')]:_0x204580[_0x7aa9('0x10')])||_0x7aa9('0x13');return _0x965938[_0x7aa9('0x14')](0xc8)[_0x7aa9('0x15')](_0xab371a);});}else{return _0x965938[_0x7aa9('0x14')](0xc8)[_0x7aa9('0x15')](_0xab371a);}};exports[_0x7aa9('0x11')]=function(_0x23bc1d,_0x9d9db7){return git['fetch']([_0x7aa9('0x16'),_0x7aa9('0x17')],function(_0x43c170){if(_0x43c170){logger['error'](_0x43c170);return _0x9d9db7[_0x7aa9('0x14')](0x1f4)[_0x7aa9('0x15')](_0x43c170);}logger[_0x7aa9('0x18')](_0x7aa9('0x19'));return _0x9d9db7['status'](0xc8)['json']({'output':_0x7aa9('0x1a')});});};exports[_0x7aa9('0x1b')]=function(_0x2c200c,_0x5a8fff){return git[_0x7aa9('0x1b')](['--hard','FETCH_HEAD'],function(_0x3b08f6){if(_0x3b08f6){logger[_0x7aa9('0x1c')](_0x3b08f6);return _0x5a8fff[_0x7aa9('0x14')](0x1f4)[_0x7aa9('0x15')](_0x3b08f6);}logger[_0x7aa9('0x18')](_0x7aa9('0x1d'));return _0x5a8fff['status'](0xc8)[_0x7aa9('0x15')]({'output':_0x7aa9('0x1e')});});};exports[_0x7aa9('0x1f')]=function(_0x3d012e,_0x379b57){exec(_0x7aa9('0x20'),function(_0xf78a39,_0x35f498,_0x2b695d){logger[_0x7aa9('0x18')](_0x35f498);logger['info'](_0x2b695d);if(_0xf78a39){logger[_0x7aa9('0x1c')](_0xf78a39);return _0x379b57[_0x7aa9('0x14')](0x1f4)['json'](_0xf78a39);}return _0x379b57['status'](0xc8)[_0x7aa9('0x15')]({'output':_0x35f498});});};exports[_0x7aa9('0x21')]=function(_0x278242,_0x1c333f){return pm2[_0x7aa9('0x21')](_0x7aa9('0x22'))[_0x7aa9('0x23')](function(_0x5881b5){logger[_0x7aa9('0x18')](_0x7aa9('0x24'),_0x5881b5);return _0x1c333f[_0x7aa9('0x14')](0xc8)[_0x7aa9('0x15')]({'output':_0x7aa9('0x25')});})[_0x7aa9('0x26')](function(_0x157c1b){logger[_0x7aa9('0x1c')](_0x157c1b);return _0x1c333f[_0x7aa9('0x14')](0x1f4)['json'](_0x157c1b);});};exports[_0x7aa9('0x27')]=function(_0x2bdd10,_0x46894f){var _0xda1d7c=fs[_0x7aa9('0x28')](path[_0x7aa9('0x29')](config[_0x7aa9('0xc')],'server',_0x7aa9('0x27')));var _0xb2ee14=[];for(var _0x3e7e35=0x0;_0x3e7e35<_0xda1d7c[_0x7aa9('0x2a')];_0x3e7e35++){var _0x9e9227=_0xda1d7c[_0x3e7e35][_0x7aa9('0x2b')](_0x7aa9('0x2c'),'');if(compareVersions(module[_0x7aa9('0xe')][_0x7aa9('0x4')],_0x9e9227)===-0x1){_0xb2ee14[_0x7aa9('0x2d')](_0x9e9227);}}if(_0xb2ee14['length']){var _0x27f8cc=_0xb2ee14[_0x7aa9('0x2e')](compareVersions);var _0x49ab0b=new Umzug({'storage':_0x7aa9('0x2f'),'storageOptions':{'model':db[_0x7aa9('0x30')],'modelName':_0x7aa9('0x30'),'columnName':_0x7aa9('0x4')},'migrations':{'params':[db['sequelize'][_0x7aa9('0x31')](),db[_0x7aa9('0x2f')][_0x7aa9('0x32')],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[_0x7aa9('0x29')](config['root'],_0x7aa9('0x33'),'migrations'),'pattern':/\.js$/}});_0x49ab0b['up']({'migrations':_['map'](_0x27f8cc,function(_0x1156b6){return _0x1156b6+'.js';})})[_0x7aa9('0x23')](function(){return _0x46894f['status'](0xc8)[_0x7aa9('0x15')]({'output':_0x7aa9('0x34')+module[_0x7aa9('0xe')][_0x7aa9('0x4')]+_0x7aa9('0x35')+_['last'](_0x27f8cc),'migrations':_[_0x7aa9('0x29')](_0x27f8cc)});})['catch'](function(_0x352eab){if(_0x352eab instanceof db[_0x7aa9('0x2f')][_0x7aa9('0x36')]){return _0x46894f[_0x7aa9('0x14')](0xc8)[_0x7aa9('0x15')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x46894f[_0x7aa9('0x14')](0x1f4)['json'](_0x352eab);}});}else{return _0x46894f[_0x7aa9('0x14')](0xc8)[_0x7aa9('0x15')]({'output':_0x7aa9('0x37')});}}; \ No newline at end of file +var _0x7217=['--hard','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','error','restart','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','.js','push','length','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.','server','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','exports','version','query','tags','latest','status','json','fetch','master','git\x20fetch','reset'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x7217,0xf6));var _0x7721=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x7217[_0x40ac5e];return _0x2839d6;};'use strict';var Umzug=require(_0x7721('0x0'));var path=require(_0x7721('0x1'));var fs=require('fs');var _=require(_0x7721('0x2'));var pkginfo=require(_0x7721('0x3'))(module,'version');var compareVersions=require('compare-versions');var exec=require(_0x7721('0x4'))[_0x7721('0x5')];var db=require(_0x7721('0x6'))['db'];var config=require(_0x7721('0x7'));var pm2=require(_0x7721('0x8'));var logger=require(_0x7721('0x9'))(_0x7721('0xa'));var git=require(_0x7721('0xb'))(config[_0x7721('0xc')]);exports['index']=function(_0x117c0d,_0x14a2ed){var _0x50e15d={'current':module[_0x7721('0xd')][_0x7721('0xe')],'phonebar':0x2};if(_0x117c0d[_0x7721('0xf')]&&_0x117c0d['query']['latest']){return git['fetch']()[_0x7721('0x10')](function(_0xc38619,_0x2181b3){_0x50e15d[_0x7721('0x11')]=(_0xc38619?module['exports']['version']:_0x2181b3['latest'])||'2.0.0';return _0x14a2ed[_0x7721('0x12')](0xc8)[_0x7721('0x13')](_0x50e15d);});}else{return _0x14a2ed[_0x7721('0x12')](0xc8)['json'](_0x50e15d);}};exports[_0x7721('0x14')]=function(_0x126d28,_0x76c107){return git['fetch'](['origin',_0x7721('0x15')],function(_0x5d0e3a){if(_0x5d0e3a){logger['error'](_0x5d0e3a);return _0x76c107[_0x7721('0x12')](0x1f4)[_0x7721('0x13')](_0x5d0e3a);}logger['info'](_0x7721('0x16'));return _0x76c107[_0x7721('0x12')](0xc8)[_0x7721('0x13')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x7721('0x17')]=function(_0x4faaff,_0x3f573d){return git[_0x7721('0x17')]([_0x7721('0x18'),_0x7721('0x19')],function(_0x5c1d33){if(_0x5c1d33){logger['error'](_0x5c1d33);return _0x3f573d[_0x7721('0x12')](0x1f4)[_0x7721('0x13')](_0x5c1d33);}logger[_0x7721('0x1a')](_0x7721('0x1b'));return _0x3f573d[_0x7721('0x12')](0xc8)[_0x7721('0x13')]({'output':_0x7721('0x1c')});});};exports[_0x7721('0x1d')]=function(_0x2293ba,_0x4e8092){exec(_0x7721('0x1e'),function(_0x20990b,_0x57d93e,_0x873b76){logger[_0x7721('0x1a')](_0x57d93e);logger[_0x7721('0x1a')](_0x873b76);if(_0x20990b){logger[_0x7721('0x1f')](_0x20990b);return _0x4e8092['status'](0x1f4)['json'](_0x20990b);}return _0x4e8092[_0x7721('0x12')](0xc8)[_0x7721('0x13')]({'output':_0x57d93e});});};exports[_0x7721('0x20')]=function(_0x27de37,_0x4a0e85){return pm2[_0x7721('0x20')]('motion2')['then'](function(_0xbfcccc){logger[_0x7721('0x1a')]('pm2\x20restart\x20motion\x20%s',_0xbfcccc);return _0x4a0e85[_0x7721('0x12')](0xc8)[_0x7721('0x13')]({'output':_0x7721('0x21')});})[_0x7721('0x22')](function(_0x1ef6be){logger['error'](_0x1ef6be);return _0x4a0e85[_0x7721('0x12')](0x1f4)[_0x7721('0x13')](_0x1ef6be);});};exports[_0x7721('0x23')]=function(_0x4a724f,_0xd4c168){var _0x1ab9a3=fs[_0x7721('0x24')](path[_0x7721('0x25')](config['root'],'server',_0x7721('0x23')));var _0x5a86ea=[];for(var _0x123a97=0x0;_0x123a97<_0x1ab9a3['length'];_0x123a97++){var _0x548aef=_0x1ab9a3[_0x123a97]['replace'](_0x7721('0x26'),'');if(compareVersions(module[_0x7721('0xd')]['version'],_0x548aef)===-0x1){_0x5a86ea[_0x7721('0x27')](_0x548aef);}}if(_0x5a86ea[_0x7721('0x28')]){var _0x225de4=_0x5a86ea[_0x7721('0x29')](compareVersions);var _0xf1defa=new Umzug({'storage':_0x7721('0x2a'),'storageOptions':{'model':db[_0x7721('0x2b')],'modelName':'Migration','columnName':_0x7721('0xe')},'migrations':{'params':[db['sequelize'][_0x7721('0x2c')](),db[_0x7721('0x2a')][_0x7721('0x2d')],function(){throw new Error(_0x7721('0x2e'));}],'path':path[_0x7721('0x25')](config[_0x7721('0xc')],_0x7721('0x2f'),_0x7721('0x23')),'pattern':/\.js$/}});_0xf1defa['up']({'migrations':_[_0x7721('0x30')](_0x225de4,function(_0x1b1db3){return _0x1b1db3+_0x7721('0x26');})})['then'](function(){return _0xd4c168[_0x7721('0x12')](0xc8)[_0x7721('0x13')]({'output':_0x7721('0x31')+module[_0x7721('0xd')][_0x7721('0xe')]+_0x7721('0x32')+_[_0x7721('0x33')](_0x225de4),'migrations':_[_0x7721('0x25')](_0x225de4)});})[_0x7721('0x22')](function(_0x5241ae){if(_0x5241ae instanceof db[_0x7721('0x2a')][_0x7721('0x34')]){return _0xd4c168['status'](0xc8)[_0x7721('0x13')]({'output':_0x7721('0x35')});}else{return _0xd4c168[_0x7721('0x12')](0x1f4)[_0x7721('0x13')](_0x5241ae);}});}else{return _0xd4c168[_0x7721('0x12')](0xc8)[_0x7721('0x13')]({'output':_0x7721('0x35')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index ad363dc..763d09c 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 _0xf697=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x279a37,_0x508f6f){var _0xa51dae=function(_0x8a1022){while(--_0x8a1022){_0x279a37['push'](_0x279a37['shift']());}};_0xa51dae(++_0x508f6f);}(_0xf697,0xdf));var _0x7f69=function(_0x8d5de5,_0x143d83){_0x8d5de5=_0x8d5de5-0x0;var _0x400b7d=_0xf697[_0x8d5de5];return _0x400b7d;};'use strict';var multer=require(_0x7f69('0x0'));var util=require(_0x7f69('0x1'));var path=require('path');var timeout=require(_0x7f69('0x2'));var express=require('express');var router=express[_0x7f69('0x3')]();var fs_extra=require(_0x7f69('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7f69('0x5'));var controller=require('./voiceAgentReport.controller');router[_0x7f69('0x6')]('/',auth[_0x7f69('0x7')](),controller[_0x7f69('0x8')]);router[_0x7f69('0x6')](_0x7f69('0x9'),auth[_0x7f69('0x7')](),controller[_0x7f69('0xa')]);router[_0x7f69('0x6')](_0x7f69('0xb'),auth[_0x7f69('0x7')](),controller['show']);router[_0x7f69('0xc')]('/',auth[_0x7f69('0x7')](),controller[_0x7f69('0xd')]);router[_0x7f69('0xe')](_0x7f69('0xb'),auth[_0x7f69('0x7')](),controller[_0x7f69('0xf')]);router[_0x7f69('0x10')](_0x7f69('0xb'),auth[_0x7f69('0x7')](),controller[_0x7f69('0x11')]);module[_0x7f69('0x12')]=router; \ No newline at end of file +var _0x1483=['Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','exports','util','connect-timeout','express'];(function(_0x4f1c6c,_0x1e8f52){var _0x1d9e2a=function(_0xbd0746){while(--_0xbd0746){_0x4f1c6c['push'](_0x4f1c6c['shift']());}};_0x1d9e2a(++_0x1e8f52);}(_0x1483,0xed));var _0x3148=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x1483[_0x1da527];return _0x40fc7c;};'use strict';var multer=require('multer');var util=require(_0x3148('0x0'));var path=require('path');var timeout=require(_0x3148('0x1'));var express=require(_0x3148('0x2'));var router=express[_0x3148('0x3')]();var fs_extra=require(_0x3148('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3148('0x5'));var config=require(_0x3148('0x6'));var controller=require(_0x3148('0x7'));router[_0x3148('0x8')]('/',auth['isAuthenticated'](),controller[_0x3148('0x9')]);router[_0x3148('0x8')](_0x3148('0xa'),auth[_0x3148('0xb')](),controller[_0x3148('0xc')]);router['get'](_0x3148('0xd'),auth[_0x3148('0xb')](),controller['show']);router[_0x3148('0xe')]('/',auth[_0x3148('0xb')](),controller[_0x3148('0xf')]);router[_0x3148('0x10')](_0x3148('0xd'),auth[_0x3148('0xb')](),controller[_0x3148('0x11')]);router[_0x3148('0x12')](_0x3148('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x3148('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 450f692..b14e05b 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 _0x4227=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x5c386a,_0x5a111a){var _0x2c005e=function(_0x4d4266){while(--_0x4d4266){_0x5c386a['push'](_0x5c386a['shift']());}};_0x2c005e(++_0x5a111a);}(_0x4227,0x89));var _0x7422=function(_0x71a3d2,_0x149530){_0x71a3d2=_0x71a3d2-0x0;var _0x21e8f=_0x4227[_0x71a3d2];return _0x21e8f;};'use strict';var Sequelize=require(_0x7422('0x0'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x7422('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7422('0x1')]},'queue':{'type':Sequelize[_0x7422('0x1')]},'interface':{'type':Sequelize[_0x7422('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x7422('0x2')]},'agentconnectAt':{'type':Sequelize[_0x7422('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x7422('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x7422('0x2')]},'agentdumpAt':{'type':Sequelize[_0x7422('0x2')]},'holdtime':{'type':Sequelize[_0x7422('0x3')]},'agentcomplete':{'type':Sequelize[_0x7422('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x7422('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x7422('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x7422('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7422('0x3')]},'reason':{'type':Sequelize[_0x7422('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x7422('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x7422('0x1')]},'connectedlinenum':{'type':Sequelize[_0x7422('0x1')]},'connectedlinename':{'type':Sequelize[_0x7422('0x1')]},'language':{'type':Sequelize[_0x7422('0x1')]},'accountcode':{'type':Sequelize[_0x7422('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x7422('0x1')]},'priority':{'type':Sequelize[_0x7422('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x7422('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x7422('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x7422('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x7422('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x7422('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x7422('0x1')]},'destpriority':{'type':Sequelize[_0x7422('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x7422('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x7422('0x1')]},'transfer':{'type':Sequelize[_0x7422('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x7422('0x1')],'comment':_0x7422('0x5')},'transferexten':{'type':Sequelize[_0x7422('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x7422('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcabe=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE'];(function(_0xf0330b,_0x814253){var _0x538518=function(_0x9c7d43){while(--_0x9c7d43){_0xf0330b['push'](_0xf0330b['shift']());}};_0x538518(++_0x814253);}(_0xcabe,0x1ef));var _0xecab=function(_0x49cffa,_0x35093c){_0x49cffa=_0x49cffa-0x0;var _0x206ef1=_0xcabe[_0x49cffa];return _0x206ef1;};'use strict';var Sequelize=require(_0xecab('0x0'));module['exports']={'type':{'type':Sequelize[_0xecab('0x1')]},'uniqueid':{'type':Sequelize[_0xecab('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xecab('0x1')]},'queue':{'type':Sequelize[_0xecab('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xecab('0x1')]},'agentcalledAt':{'type':Sequelize[_0xecab('0x2')]},'agentconnectAt':{'type':Sequelize[_0xecab('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0xecab('0x2')]},'agentdumpAt':{'type':Sequelize[_0xecab('0x2')]},'holdtime':{'type':Sequelize[_0xecab('0x3')]},'agentcomplete':{'type':Sequelize[_0xecab('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xecab('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xecab('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xecab('0x3')]},'agentacw':{'type':Sequelize[_0xecab('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xecab('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xecab('0x1')]},'channelstate':{'type':Sequelize[_0xecab('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xecab('0x1')]},'connectedlinename':{'type':Sequelize[_0xecab('0x1')]},'language':{'type':Sequelize[_0xecab('0x1')]},'accountcode':{'type':Sequelize[_0xecab('0x1')]},'context':{'type':Sequelize[_0xecab('0x1')]},'exten':{'type':Sequelize[_0xecab('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xecab('0x1')]},'destchannelstate':{'type':Sequelize[_0xecab('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xecab('0x1')]},'destcalleridnum':{'type':Sequelize[_0xecab('0x1')]},'destcalleridname':{'type':Sequelize[_0xecab('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xecab('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xecab('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xecab('0x1')]},'destpriority':{'type':Sequelize[_0xecab('0x1')]},'destuniqueid':{'type':Sequelize[_0xecab('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xecab('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xecab('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xecab('0x1')],'comment':_0xecab('0x5')},'transferexten':{'type':Sequelize[_0xecab('0x1')]},'transferuniqueid':{'type':Sequelize[_0xecab('0x1')]},'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 ab8753a..7e039a8 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(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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 e85fea8..6849065 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 _0xf006=['./voiceAgentReport.attributes','exports','define','report_agent','uniqueid','destuniqueid','../../config/logger','api','bluebird','path'];(function(_0x51b70d,_0x1b78d8){var _0x1e9be7=function(_0x2d6cc1){while(--_0x2d6cc1){_0x51b70d['push'](_0x51b70d['shift']());}};_0x1e9be7(++_0x1b78d8);}(_0xf006,0x146));var _0x6f00=function(_0x31e4e8,_0x5dd036){_0x31e4e8=_0x31e4e8-0x0;var _0x45c874=_0xf006[_0x31e4e8];return _0x45c874;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6f00('0x0'))(_0x6f00('0x1'));var moment=require('moment');var BPromise=require(_0x6f00('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f00('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6f00('0x4'));module[_0x6f00('0x5')]=function(_0x141e71,_0x52c9a2){return _0x141e71[_0x6f00('0x6')]('VoiceAgentReport',attributes,{'tableName':_0x6f00('0x7'),'paranoid':![],'indexes':[{'fields':[_0x6f00('0x8'),_0x6f00('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x28a2=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./voiceAgentReport.attributes','exports','define','report_agent','uniqueid','destuniqueid','lodash'];(function(_0x5ce15c,_0x19c917){var _0x36e4f5=function(_0x50fa90){while(--_0x50fa90){_0x5ce15c['push'](_0x5ce15c['shift']());}};_0x36e4f5(++_0x19c917);}(_0x28a2,0x141));var _0x228a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28a2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x228a('0x0'));var util=require(_0x228a('0x1'));var logger=require(_0x228a('0x2'))(_0x228a('0x3'));var moment=require(_0x228a('0x4'));var BPromise=require(_0x228a('0x5'));var rp=require(_0x228a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x228a('0x7'));var config=require('../../config/environment');var attributes=require(_0x228a('0x8'));module[_0x228a('0x9')]=function(_0x17727b,_0xf86d1d){return _0x17727b[_0x228a('0xa')]('VoiceAgentReport',attributes,{'tableName':_0x228a('0xb'),'paranoid':![],'indexes':[{'fields':[_0x228a('0xc'),_0x228a('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 841b20a..8d506b7 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 _0xd852=['error','code','message','info','result','catch','VoiceAgentReport','create','body','options','then','CreateVoiceAgentReport','update','where','attributes','debug','UpdateVoiceAgentReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x6324d4,_0x151b14){var _0x3190f7=function(_0x1d551b){while(--_0x1d551b){_0x6324d4['push'](_0x6324d4['shift']());}};_0x3190f7(++_0x151b14);}(_0xd852,0x119));var _0x2d85=function(_0x694ba,_0x5afc7a){_0x694ba=_0x694ba-0x0;var _0x3f502d=_0xd852[_0x694ba];return _0x3f502d;};'use strict';var _=require(_0x2d85('0x0'));var util=require(_0x2d85('0x1'));var moment=require('moment');var BPromise=require(_0x2d85('0x2'));var rs=require(_0x2d85('0x3'));var fs=require('fs');var Redis=require(_0x2d85('0x4'));var db=require(_0x2d85('0x5'))['db'];var utils=require(_0x2d85('0x6'));var logger=require('../../config/logger')(_0x2d85('0x7'));var config=require(_0x2d85('0x8'));var jayson=require(_0x2d85('0x9'));var client=jayson['client'][_0x2d85('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5530c6,_0x4bc936,_0x396525){return new BPromise(function(_0x2ea899,_0x7856cd){return client[_0x2d85('0xb')](_0x5530c6,_0x396525)['then'](function(_0x4b5db4){logger['info'](_0x2d85('0xc'),_0x4bc936,_0x2d85('0xd'));logger['debug'](_0x2d85('0xe'),_0x4bc936,'request\x20sent',JSON[_0x2d85('0xf')](_0x4b5db4));if(_0x4b5db4[_0x2d85('0x10')]){if(_0x4b5db4[_0x2d85('0x10')][_0x2d85('0x11')]===0x1f4){logger[_0x2d85('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x4bc936,_0x4b5db4[_0x2d85('0x10')][_0x2d85('0x12')]);return _0x7856cd(_0x4b5db4[_0x2d85('0x10')][_0x2d85('0x12')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x4bc936,_0x4b5db4[_0x2d85('0x10')][_0x2d85('0x12')]);return _0x2ea899(_0x4b5db4[_0x2d85('0x10')]['message']);}else{logger[_0x2d85('0x13')](_0x2d85('0xc'),_0x4bc936,_0x2d85('0xd'));_0x2ea899(_0x4b5db4[_0x2d85('0x14')][_0x2d85('0x12')]);}})[_0x2d85('0x15')](function(_0x45177c){logger[_0x2d85('0x10')](_0x2d85('0xc'),_0x4bc936,_0x45177c);_0x7856cd(_0x45177c);});});}exports['CreateVoiceAgentReport']=function(_0x48d1a5){var _0x11a488=this;return new Promise(function(_0x4ea37c,_0x4c79f5){return db[_0x2d85('0x16')][_0x2d85('0x17')](_0x48d1a5[_0x2d85('0x18')],{'raw':_0x48d1a5[_0x2d85('0x19')]?_0x48d1a5[_0x2d85('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x2d85('0x1a')](function(_0x160b4e){logger[_0x2d85('0x13')](_0x2d85('0x1b'),_0x48d1a5);logger['debug'](_0x2d85('0x1b'),_0x48d1a5,JSON['stringify'](_0x160b4e));_0x4ea37c(_0x160b4e);})[_0x2d85('0x15')](function(_0x44c0be){logger[_0x2d85('0x10')](_0x2d85('0x1b'),_0x44c0be['message'],_0x48d1a5);_0x4c79f5(_0x11a488['error'](0x1f4,_0x44c0be['message']));});});};exports['UpdateVoiceAgentReport']=function(_0x543012){var _0x41479e=this;return new Promise(function(_0x1749e8,_0x49fe48){return db[_0x2d85('0x16')][_0x2d85('0x1c')](_0x543012[_0x2d85('0x18')],{'raw':_0x543012[_0x2d85('0x19')]?_0x543012[_0x2d85('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x543012[_0x2d85('0x19')]?_0x543012[_0x2d85('0x19')][_0x2d85('0x1d')]||null:null,'attributes':_0x543012[_0x2d85('0x19')]?_0x543012['options'][_0x2d85('0x1e')]||null:null,'limit':_0x543012['options']?_0x543012['options']['limit']||null:null})['then'](function(_0x3b9f09){logger[_0x2d85('0x13')]('UpdateVoiceAgentReport',_0x543012);logger[_0x2d85('0x1f')]('UpdateVoiceAgentReport',_0x543012,JSON['stringify'](_0x3b9f09));_0x1749e8(_0x3b9f09);})[_0x2d85('0x15')](function(_0x57cd14){logger['error'](_0x2d85('0x20'),_0x57cd14[_0x2d85('0x12')],_0x543012);_0x49fe48(_0x41479e['error'](0x1f4,_0x57cd14['message']));});});}; \ No newline at end of file +var _0xae86=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','debug','update','where','attributes','limit','UpdateVoiceAgentReport','lodash','util','bluebird'];(function(_0x3a5b9f,_0x599f46){var _0x4e9b72=function(_0x20ac03){while(--_0x20ac03){_0x3a5b9f['push'](_0x3a5b9f['shift']());}};_0x4e9b72(++_0x599f46);}(_0xae86,0xeb));var _0x6ae8=function(_0x52cbc6,_0x3a9e07){_0x52cbc6=_0x52cbc6-0x0;var _0x5b7ee5=_0xae86[_0x52cbc6];return _0x5b7ee5;};'use strict';var _=require(_0x6ae8('0x0'));var util=require(_0x6ae8('0x1'));var moment=require('moment');var BPromise=require(_0x6ae8('0x2'));var rs=require(_0x6ae8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ae8('0x4'))['db'];var utils=require(_0x6ae8('0x5'));var logger=require(_0x6ae8('0x6'))(_0x6ae8('0x7'));var config=require(_0x6ae8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6ae8('0x9')][_0x6ae8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x422d17,_0x380eeb,_0x31cb56){return new BPromise(function(_0xe1b4d5,_0x2bd2f5){return client[_0x6ae8('0xb')](_0x422d17,_0x31cb56)[_0x6ae8('0xc')](function(_0x452567){logger[_0x6ae8('0xd')](_0x6ae8('0xe'),_0x380eeb,_0x6ae8('0xf'));logger['debug']('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x380eeb,_0x6ae8('0xf'),JSON[_0x6ae8('0x10')](_0x452567));if(_0x452567['error']){if(_0x452567[_0x6ae8('0x11')][_0x6ae8('0x12')]===0x1f4){logger[_0x6ae8('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x380eeb,_0x452567[_0x6ae8('0x11')]['message']);return _0x2bd2f5(_0x452567[_0x6ae8('0x11')][_0x6ae8('0x13')]);}logger[_0x6ae8('0x11')](_0x6ae8('0xe'),_0x380eeb,_0x452567[_0x6ae8('0x11')]['message']);return _0xe1b4d5(_0x452567[_0x6ae8('0x11')][_0x6ae8('0x13')]);}else{logger[_0x6ae8('0xd')](_0x6ae8('0xe'),_0x380eeb,_0x6ae8('0xf'));_0xe1b4d5(_0x452567[_0x6ae8('0x14')][_0x6ae8('0x13')]);}})[_0x6ae8('0x15')](function(_0x2afc39){logger[_0x6ae8('0x11')](_0x6ae8('0xe'),_0x380eeb,_0x2afc39);_0x2bd2f5(_0x2afc39);});});}exports[_0x6ae8('0x16')]=function(_0x42fc6f){var _0xd7527f=this;return new Promise(function(_0x3204ee,_0x2ace66){return db[_0x6ae8('0x17')][_0x6ae8('0x18')](_0x42fc6f[_0x6ae8('0x19')],{'raw':_0x42fc6f[_0x6ae8('0x1a')]?_0x42fc6f[_0x6ae8('0x1a')][_0x6ae8('0x1b')]===undefined?!![]:![]:!![]})[_0x6ae8('0xc')](function(_0x41da20){logger['info'](_0x6ae8('0x16'),_0x42fc6f);logger[_0x6ae8('0x1c')](_0x6ae8('0x16'),_0x42fc6f,JSON[_0x6ae8('0x10')](_0x41da20));_0x3204ee(_0x41da20);})[_0x6ae8('0x15')](function(_0x2d1ea1){logger[_0x6ae8('0x11')]('CreateVoiceAgentReport',_0x2d1ea1[_0x6ae8('0x13')],_0x42fc6f);_0x2ace66(_0xd7527f['error'](0x1f4,_0x2d1ea1[_0x6ae8('0x13')]));});});};exports['UpdateVoiceAgentReport']=function(_0x4c173c){var _0x2bc96a=this;return new Promise(function(_0x40718c,_0x47af18){return db[_0x6ae8('0x17')][_0x6ae8('0x1d')](_0x4c173c['body'],{'raw':_0x4c173c[_0x6ae8('0x1a')]?_0x4c173c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c173c[_0x6ae8('0x1a')]?_0x4c173c[_0x6ae8('0x1a')][_0x6ae8('0x1e')]||null:null,'attributes':_0x4c173c[_0x6ae8('0x1a')]?_0x4c173c[_0x6ae8('0x1a')][_0x6ae8('0x1f')]||null:null,'limit':_0x4c173c['options']?_0x4c173c[_0x6ae8('0x1a')][_0x6ae8('0x20')]||null:null})[_0x6ae8('0xc')](function(_0x56def5){logger[_0x6ae8('0xd')](_0x6ae8('0x21'),_0x4c173c);logger['debug'](_0x6ae8('0x21'),_0x4c173c,JSON[_0x6ae8('0x10')](_0x56def5));_0x40718c(_0x56def5);})[_0x6ae8('0x15')](function(_0x38e57f){logger[_0x6ae8('0x11')](_0x6ae8('0x21'),_0x38e57f[_0x6ae8('0x13')],_0x4c173c);_0x47af18(_0x2bc96a['error'](0x1f4,_0x38e57f[_0x6ae8('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 3787522..7d4bdb2 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 _0x9b67=['../../components/auth/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','destroy','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x4cb87b,_0x1851e0){var _0x3e5686=function(_0x4fe7f6){while(--_0x4fe7f6){_0x4cb87b['push'](_0x4cb87b['shift']());}};_0x3e5686(++_0x1851e0);}(_0x9b67,0xf6));var _0x79b6=function(_0x3d452a,_0x392afb){_0x3d452a=_0x3d452a-0x0;var _0x4ec2f0=_0x9b67[_0x3d452a];return _0x4ec2f0;};'use strict';var multer=require(_0x79b6('0x0'));var util=require(_0x79b6('0x1'));var path=require(_0x79b6('0x2'));var timeout=require(_0x79b6('0x3'));var express=require(_0x79b6('0x4'));var router=express['Router']();var fs_extra=require(_0x79b6('0x5'));var auth=require(_0x79b6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x79b6('0x7'));router[_0x79b6('0x8')]('/',auth[_0x79b6('0x9')](),controller[_0x79b6('0xa')]);router[_0x79b6('0x8')](_0x79b6('0xb'),auth[_0x79b6('0x9')](),controller['describe']);router[_0x79b6('0x8')](_0x79b6('0xc'),auth[_0x79b6('0x9')](),controller[_0x79b6('0xd')]);router[_0x79b6('0xe')]('/',auth['isAuthenticated'](),controller[_0x79b6('0xf')]);router[_0x79b6('0x10')](_0x79b6('0xc'),auth[_0x79b6('0x9')](),controller['update']);router['delete'](_0x79b6('0xc'),auth[_0x79b6('0x9')](),controller[_0x79b6('0x11')]);module['exports']=router; \ No newline at end of file +var _0xcb99=['create','put','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller','isAuthenticated','get','/describe','describe','/:id','show'];(function(_0x4d20c0,_0x33210c){var _0x1afcc3=function(_0x1fcc87){while(--_0x1fcc87){_0x4d20c0['push'](_0x4d20c0['shift']());}};_0x1afcc3(++_0x33210c);}(_0xcb99,0x8b));var _0x9cb9=function(_0x431cf2,_0x1d4456){_0x431cf2=_0x431cf2-0x0;var _0x10c9a7=_0xcb99[_0x431cf2];return _0x10c9a7;};'use strict';var multer=require(_0x9cb9('0x0'));var util=require('util');var path=require(_0x9cb9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9cb9('0x2')]();var fs_extra=require(_0x9cb9('0x3'));var auth=require(_0x9cb9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9cb9('0x5'));var controller=require(_0x9cb9('0x6'));router['get']('/',auth[_0x9cb9('0x7')](),controller['index']);router[_0x9cb9('0x8')](_0x9cb9('0x9'),auth[_0x9cb9('0x7')](),controller[_0x9cb9('0xa')]);router[_0x9cb9('0x8')](_0x9cb9('0xb'),auth[_0x9cb9('0x7')](),controller[_0x9cb9('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9cb9('0xd')]);router[_0x9cb9('0xe')](_0x9cb9('0xb'),auth['isAuthenticated'](),controller[_0x9cb9('0xf')]);router[_0x9cb9('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x9cb9('0x11')]);module[_0x9cb9('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 772467f..3cb736d 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 _0x1a4d=['TEXT','DATE','INTEGER','sequelize','exports','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','dialer','STRING'];(function(_0x87239,_0x38c793){var _0x53af1e=function(_0x11eb5f){while(--_0x11eb5f){_0x87239['push'](_0x87239['shift']());}};_0x53af1e(++_0x38c793);}(_0x1a4d,0x189));var _0xd1a4=function(_0x1b052f,_0x7fb565){_0x1b052f=_0x1b052f-0x0;var _0x297706=_0x1a4d[_0x1b052f];return _0x297706;};'use strict';var Sequelize=require(_0xd1a4('0x0'));module[_0xd1a4('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd1a4('0x2')](_0xd1a4('0x3'),_0xd1a4('0x4'),_0xd1a4('0x5'),_0xd1a4('0x6'),_0xd1a4('0x7'),_0xd1a4('0x8'))},'tag':{'type':Sequelize[_0xd1a4('0x9')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0xd1a4('0x9')]},'destination':{'type':Sequelize[_0xd1a4('0x9')]},'destinationcontext':{'type':Sequelize[_0xd1a4('0x9')]},'callerid':{'type':Sequelize[_0xd1a4('0x9')]},'channel':{'type':Sequelize[_0xd1a4('0x9')]},'destinationchannel':{'type':Sequelize[_0xd1a4('0x9')]},'lastapplication':{'type':Sequelize[_0xd1a4('0x9')]},'lastdata':{'type':Sequelize[_0xd1a4('0xa')]},'starttime':{'type':Sequelize[_0xd1a4('0xb')]},'systemanswertime':{'type':Sequelize[_0xd1a4('0xb')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xd1a4('0xb')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xd1a4('0xc')]},'mohtime':{'type':Sequelize[_0xd1a4('0xc')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd1a4('0x9')]},'amaflags':{'type':Sequelize[_0xd1a4('0x9')]},'userfield':{'type':Sequelize[_0xd1a4('0x9')]},'userDisposition':{'type':Sequelize[_0xd1a4('0x9')]},'userSecondDisposition':{'type':Sequelize[_0xd1a4('0x9')]},'userThirdDisposition':{'type':Sequelize[_0xd1a4('0x9')]},'note':{'type':Sequelize[_0xd1a4('0x9')]},'prefix':{'type':Sequelize[_0xd1a4('0x9')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0xd1a4('0x9')]}}; \ No newline at end of file +var _0xb515=['internal','outbound','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','STRING','ENUM','inbound'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0xb515,0x1b8));var _0x5b51=function(_0x5805d7,_0x3d584a){_0x5805d7=_0x5805d7-0x0;var _0x170fe4=_0xb515[_0x5805d7];return _0x170fe4;};'use strict';var Sequelize=require(_0x5b51('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x5b51('0x1')]},'type':{'type':Sequelize[_0x5b51('0x2')](_0x5b51('0x3'),_0x5b51('0x4'),_0x5b51('0x5'),_0x5b51('0x6'),_0x5b51('0x7'),_0x5b51('0x8'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5b51('0x1')]},'source':{'type':Sequelize[_0x5b51('0x1')]},'destination':{'type':Sequelize[_0x5b51('0x1')]},'destinationcontext':{'type':Sequelize[_0x5b51('0x1')]},'callerid':{'type':Sequelize[_0x5b51('0x1')]},'channel':{'type':Sequelize[_0x5b51('0x1')]},'destinationchannel':{'type':Sequelize[_0x5b51('0x1')]},'lastapplication':{'type':Sequelize[_0x5b51('0x1')]},'lastdata':{'type':Sequelize[_0x5b51('0x9')]},'starttime':{'type':Sequelize[_0x5b51('0xa')]},'systemanswertime':{'type':Sequelize[_0x5b51('0xa')]},'answertime':{'type':Sequelize[_0x5b51('0xa')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x5b51('0xb')]},'billableseconds':{'type':Sequelize[_0x5b51('0xb')]},'mohtime':{'type':Sequelize[_0x5b51('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5b51('0x1')]},'amaflags':{'type':Sequelize[_0x5b51('0x1')]},'userfield':{'type':Sequelize[_0x5b51('0x1')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x5b51('0x1')]},'prefix':{'type':Sequelize[_0x5b51('0x1')]},'routeid':{'type':Sequelize[_0x5b51('0xb')]},'sipcallid':{'type':Sequelize[_0x5b51('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 0628feb..4c91447 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(_0x292e42,_0x12cc46){_0x292e42=_0x292e42-0x0;var _0x217a06=_0x2032[_0x292e42];return _0x217a06;};'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 _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x3afe18,_0x26922c){var _0x19ed1f=function(_0x1c0660){while(--_0x1c0660){_0x3afe18['push'](_0x3afe18['shift']());}};_0x19ed1f(++_0x26922c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x283b7c,_0x53bb1f){_0x283b7c=_0x283b7c-0x0;var _0x2a26ea=_0x5f2f[_0x283b7c];return _0x2a26ea;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 611b4f1..edd77d0 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 _0xcc69=['util','api','bluebird','request-promise','path','rimraf','exports','define','VoiceCallReport','report_call','lodash'];(function(_0x251aac,_0x16d6b){var _0x14053c=function(_0xf2b9c4){while(--_0xf2b9c4){_0x251aac['push'](_0x251aac['shift']());}};_0x14053c(++_0x16d6b);}(_0xcc69,0x6d));var _0x9cc6=function(_0x4057ec,_0x425f09){_0x4057ec=_0x4057ec-0x0;var _0xe062c=_0xcc69[_0x4057ec];return _0xe062c;};'use strict';var _=require(_0x9cc6('0x0'));var util=require(_0x9cc6('0x1'));var logger=require('../../config/logger')(_0x9cc6('0x2'));var moment=require('moment');var BPromise=require(_0x9cc6('0x3'));var rp=require(_0x9cc6('0x4'));var fs=require('fs');var path=require(_0x9cc6('0x5'));var rimraf=require(_0x9cc6('0x6'));var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module[_0x9cc6('0x7')]=function(_0x10fa3d,_0x417b82){return _0x10fa3d[_0x9cc6('0x8')](_0x9cc6('0x9'),attributes,{'tableName':_0x9cc6('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7abb=['../../config/environment','exports','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xdd3867,_0x5b59b2){var _0xe1ec64=function(_0x57e2c8){while(--_0x57e2c8){_0xdd3867['push'](_0xdd3867['shift']());}};_0xe1ec64(++_0x5b59b2);}(_0x7abb,0xe5));var _0xb7ab=function(_0x2af627,_0x33d47f){_0x2af627=_0x2af627-0x0;var _0x14eda9=_0x7abb[_0x2af627];return _0x14eda9;};'use strict';var _=require(_0xb7ab('0x0'));var util=require(_0xb7ab('0x1'));var logger=require(_0xb7ab('0x2'))(_0xb7ab('0x3'));var moment=require(_0xb7ab('0x4'));var BPromise=require(_0xb7ab('0x5'));var rp=require(_0xb7ab('0x6'));var fs=require('fs');var path=require(_0xb7ab('0x7'));var rimraf=require(_0xb7ab('0x8'));var config=require(_0xb7ab('0x9'));var attributes=require('./voiceCallReport.attributes');module[_0xb7ab('0xa')]=function(_0x6d4fa3,_0x539440){return _0x6d4fa3['define'](_0xb7ab('0xb'),attributes,{'tableName':_0xb7ab('0xc'),'paranoid':![],'indexes':[{'fields':[_0xb7ab('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index a5c3207..c8b31b9 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 _0xc1e6=['rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','GetVoiceCallReport','VoiceCallReport','findAll','raw','options','where','attributes','limit','include','map','model','debug','catch','create','body','CreateVoiceCallReport','UpdateVoiceCallReport','update','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xc1e6,0x12a));var _0x6c1e=function(_0x16c0f4,_0x12f281){_0x16c0f4=_0x16c0f4-0x0;var _0x59dc0a=_0xc1e6[_0x16c0f4];return _0x59dc0a;};'use strict';var _=require(_0x6c1e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6c1e('0x1'));var fs=require('fs');var Redis=require(_0x6c1e('0x2'));var db=require(_0x6c1e('0x3'))['db'];var utils=require(_0x6c1e('0x4'));var logger=require(_0x6c1e('0x5'))(_0x6c1e('0x6'));var config=require(_0x6c1e('0x7'));var jayson=require(_0x6c1e('0x8'));var client=jayson['client'][_0x6c1e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1dea63,_0x215dbe,_0x12b6e3){return new BPromise(function(_0x1d1328,_0x42f425){return client[_0x6c1e('0xa')](_0x1dea63,_0x12b6e3)[_0x6c1e('0xb')](function(_0x84bdc2){logger[_0x6c1e('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x215dbe,'request\x20sent');logger['debug'](_0x6c1e('0xd'),_0x215dbe,_0x6c1e('0xe'),JSON[_0x6c1e('0xf')](_0x84bdc2));if(_0x84bdc2[_0x6c1e('0x10')]){if(_0x84bdc2[_0x6c1e('0x10')][_0x6c1e('0x11')]===0x1f4){logger['error'](_0x6c1e('0x12'),_0x215dbe,_0x84bdc2['error'][_0x6c1e('0x13')]);return _0x42f425(_0x84bdc2[_0x6c1e('0x10')][_0x6c1e('0x13')]);}logger[_0x6c1e('0x10')](_0x6c1e('0x12'),_0x215dbe,_0x84bdc2[_0x6c1e('0x10')][_0x6c1e('0x13')]);return _0x1d1328(_0x84bdc2[_0x6c1e('0x10')][_0x6c1e('0x13')]);}else{logger[_0x6c1e('0xc')](_0x6c1e('0x12'),_0x215dbe,'request\x20sent');_0x1d1328(_0x84bdc2['result'][_0x6c1e('0x13')]);}})['catch'](function(_0x104149){logger['error'](_0x6c1e('0x12'),_0x215dbe,_0x104149);_0x42f425(_0x104149);});});}exports[_0x6c1e('0x14')]=function(_0x27fb8f){var _0x1b5e14=this;return new Promise(function(_0x10e918,_0x46bd78){return db[_0x6c1e('0x15')][_0x6c1e('0x16')]({'raw':_0x27fb8f['options']?_0x27fb8f['options'][_0x6c1e('0x17')]===undefined?!![]:![]:!![],'where':_0x27fb8f[_0x6c1e('0x18')]?_0x27fb8f[_0x6c1e('0x18')][_0x6c1e('0x19')]||null:null,'attributes':_0x27fb8f['options']?_0x27fb8f[_0x6c1e('0x18')][_0x6c1e('0x1a')]||null:null,'limit':_0x27fb8f[_0x6c1e('0x18')]?_0x27fb8f[_0x6c1e('0x18')][_0x6c1e('0x1b')]||null:null,'include':_0x27fb8f[_0x6c1e('0x18')]?_0x27fb8f['options'][_0x6c1e('0x1c')]?_['map'](_0x27fb8f['options']['include'],function(_0xaf6ed6){return{'model':db[_0xaf6ed6['model']],'as':_0xaf6ed6['as'],'attributes':_0xaf6ed6['attributes'],'include':_0xaf6ed6[_0x6c1e('0x1c')]?_[_0x6c1e('0x1d')](_0xaf6ed6[_0x6c1e('0x1c')],function(_0x3a3cba){return{'model':db[_0x3a3cba[_0x6c1e('0x1e')]],'as':_0x3a3cba['as'],'attributes':_0x3a3cba['attributes'],'include':_0x3a3cba[_0x6c1e('0x1c')]?_[_0x6c1e('0x1d')](_0x3a3cba[_0x6c1e('0x1c')],function(_0xa67ee2){return{'model':db[_0xa67ee2['model']],'as':_0xa67ee2['as'],'attributes':_0xa67ee2['attributes']};}):[]};}):[]};}):[]:[]})[_0x6c1e('0xb')](function(_0x58a621){logger[_0x6c1e('0xc')]('GetVoiceCallReport',_0x27fb8f);logger[_0x6c1e('0x1f')]('GetVoiceCallReport',_0x27fb8f,JSON['stringify'](_0x58a621));_0x10e918(_0x58a621);})[_0x6c1e('0x20')](function(_0x5f288f){logger[_0x6c1e('0x10')](_0x6c1e('0x14'),_0x5f288f['message'],_0x27fb8f);_0x46bd78(_0x1b5e14[_0x6c1e('0x10')](0x1f4,_0x5f288f['message']));});});};exports['CreateVoiceCallReport']=function(_0x2842e3){var _0x750218=this;return new Promise(function(_0x2912a8,_0x4deebf){return db[_0x6c1e('0x15')][_0x6c1e('0x21')](_0x2842e3[_0x6c1e('0x22')],{'raw':_0x2842e3[_0x6c1e('0x18')]?_0x2842e3[_0x6c1e('0x18')][_0x6c1e('0x17')]===undefined?!![]:![]:!![]})[_0x6c1e('0xb')](function(_0x9c032){logger[_0x6c1e('0xc')](_0x6c1e('0x23'),_0x2842e3);logger[_0x6c1e('0x1f')](_0x6c1e('0x23'),_0x2842e3,JSON[_0x6c1e('0xf')](_0x9c032));_0x2912a8(_0x9c032);})[_0x6c1e('0x20')](function(_0x47b708){logger[_0x6c1e('0x10')](_0x6c1e('0x23'),_0x47b708[_0x6c1e('0x13')],_0x2842e3);_0x4deebf(_0x750218[_0x6c1e('0x10')](0x1f4,_0x47b708['message']));});});};exports[_0x6c1e('0x24')]=function(_0x188da7){var _0x2c826f=this;return new Promise(function(_0x585f73,_0x3c324c){return db['VoiceCallReport'][_0x6c1e('0x25')](_0x188da7[_0x6c1e('0x22')],{'raw':_0x188da7[_0x6c1e('0x18')]?_0x188da7['options'][_0x6c1e('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x188da7[_0x6c1e('0x18')]?_0x188da7[_0x6c1e('0x18')][_0x6c1e('0x19')]||null:null,'attributes':_0x188da7[_0x6c1e('0x18')]?_0x188da7[_0x6c1e('0x18')][_0x6c1e('0x1a')]||null:null,'limit':_0x188da7['options']?_0x188da7['options'][_0x6c1e('0x1b')]||null:null})['then'](function(_0x565d22){logger[_0x6c1e('0xc')](_0x6c1e('0x24'),_0x188da7);logger[_0x6c1e('0x1f')](_0x6c1e('0x24'),_0x188da7,JSON[_0x6c1e('0xf')](_0x565d22));_0x585f73(_0x565d22);})[_0x6c1e('0x20')](function(_0x5e85b2){logger[_0x6c1e('0x10')](_0x6c1e('0x24'),_0x5e85b2[_0x6c1e('0x13')],_0x188da7);_0x3c324c(_0x2c826f[_0x6c1e('0x10')](0x1f4,_0x5e85b2[_0x6c1e('0x13')]));});});}; \ No newline at end of file +var _0x0aae=['model','create','CreateVoiceCallReport','UpdateVoiceCallReport','update','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceCallReport,\x20%s,\x20%s','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x487ed4,_0x312026){var _0xa1193e=function(_0x608154){while(--_0x608154){_0x487ed4['push'](_0x487ed4['shift']());}};_0xa1193e(++_0x312026);}(_0x0aae,0x101));var _0xe0aa=function(_0x395c77,_0x3069fa){_0x395c77=_0x395c77-0x0;var _0x16bc28=_0x0aae[_0x395c77];return _0x16bc28;};'use strict';var _=require(_0xe0aa('0x0'));var util=require('util');var moment=require(_0xe0aa('0x1'));var BPromise=require(_0xe0aa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0aa('0x3'));var db=require(_0xe0aa('0x4'))['db'];var utils=require(_0xe0aa('0x5'));var logger=require('../../config/logger')(_0xe0aa('0x6'));var config=require(_0xe0aa('0x7'));var jayson=require(_0xe0aa('0x8'));var client=jayson['client'][_0xe0aa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55dfdb,_0x36fa1a,_0x24e53d){return new BPromise(function(_0x2361d0,_0x247919){return client['request'](_0x55dfdb,_0x24e53d)[_0xe0aa('0xa')](function(_0x9e8079){logger[_0xe0aa('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x36fa1a,_0xe0aa('0xc'));logger[_0xe0aa('0xd')](_0xe0aa('0xe'),_0x36fa1a,'request\x20sent',JSON[_0xe0aa('0xf')](_0x9e8079));if(_0x9e8079['error']){if(_0x9e8079[_0xe0aa('0x10')]['code']===0x1f4){logger['error'](_0xe0aa('0x11'),_0x36fa1a,_0x9e8079[_0xe0aa('0x10')]['message']);return _0x247919(_0x9e8079[_0xe0aa('0x10')][_0xe0aa('0x12')]);}logger['error'](_0xe0aa('0x11'),_0x36fa1a,_0x9e8079['error'][_0xe0aa('0x12')]);return _0x2361d0(_0x9e8079['error'][_0xe0aa('0x12')]);}else{logger[_0xe0aa('0xb')](_0xe0aa('0x11'),_0x36fa1a,_0xe0aa('0xc'));_0x2361d0(_0x9e8079[_0xe0aa('0x13')][_0xe0aa('0x12')]);}})[_0xe0aa('0x14')](function(_0x2b96e8){logger[_0xe0aa('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x36fa1a,_0x2b96e8);_0x247919(_0x2b96e8);});});}exports[_0xe0aa('0x15')]=function(_0x7ba647){var _0x1d7582=this;return new Promise(function(_0x1931e1,_0x4ad0bc){return db[_0xe0aa('0x16')][_0xe0aa('0x17')]({'raw':_0x7ba647[_0xe0aa('0x18')]?_0x7ba647['options'][_0xe0aa('0x19')]===undefined?!![]:![]:!![],'where':_0x7ba647[_0xe0aa('0x18')]?_0x7ba647[_0xe0aa('0x18')][_0xe0aa('0x1a')]||null:null,'attributes':_0x7ba647[_0xe0aa('0x18')]?_0x7ba647[_0xe0aa('0x18')][_0xe0aa('0x1b')]||null:null,'limit':_0x7ba647['options']?_0x7ba647[_0xe0aa('0x18')][_0xe0aa('0x1c')]||null:null,'include':_0x7ba647[_0xe0aa('0x18')]?_0x7ba647[_0xe0aa('0x18')][_0xe0aa('0x1d')]?_[_0xe0aa('0x1e')](_0x7ba647['options'][_0xe0aa('0x1d')],function(_0x18d2cd){return{'model':db[_0x18d2cd[_0xe0aa('0x1f')]],'as':_0x18d2cd['as'],'attributes':_0x18d2cd['attributes'],'include':_0x18d2cd['include']?_[_0xe0aa('0x1e')](_0x18d2cd[_0xe0aa('0x1d')],function(_0x3b4ee7){return{'model':db[_0x3b4ee7[_0xe0aa('0x1f')]],'as':_0x3b4ee7['as'],'attributes':_0x3b4ee7['attributes'],'include':_0x3b4ee7['include']?_[_0xe0aa('0x1e')](_0x3b4ee7[_0xe0aa('0x1d')],function(_0x3424e7){return{'model':db[_0x3424e7['model']],'as':_0x3424e7['as'],'attributes':_0x3424e7[_0xe0aa('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e2b54){logger['info']('GetVoiceCallReport',_0x7ba647);logger[_0xe0aa('0xd')]('GetVoiceCallReport',_0x7ba647,JSON['stringify'](_0x5e2b54));_0x1931e1(_0x5e2b54);})[_0xe0aa('0x14')](function(_0x1f5b02){logger[_0xe0aa('0x10')]('GetVoiceCallReport',_0x1f5b02[_0xe0aa('0x12')],_0x7ba647);_0x4ad0bc(_0x1d7582[_0xe0aa('0x10')](0x1f4,_0x1f5b02['message']));});});};exports['CreateVoiceCallReport']=function(_0x475c59){var _0xbdef2b=this;return new Promise(function(_0x55bb04,_0x3dbd03){return db['VoiceCallReport'][_0xe0aa('0x20')](_0x475c59['body'],{'raw':_0x475c59[_0xe0aa('0x18')]?_0x475c59[_0xe0aa('0x18')][_0xe0aa('0x19')]===undefined?!![]:![]:!![]})[_0xe0aa('0xa')](function(_0x2d6eb7){logger['info'](_0xe0aa('0x21'),_0x475c59);logger[_0xe0aa('0xd')](_0xe0aa('0x21'),_0x475c59,JSON[_0xe0aa('0xf')](_0x2d6eb7));_0x55bb04(_0x2d6eb7);})['catch'](function(_0x57b2f8){logger[_0xe0aa('0x10')](_0xe0aa('0x21'),_0x57b2f8[_0xe0aa('0x12')],_0x475c59);_0x3dbd03(_0xbdef2b['error'](0x1f4,_0x57b2f8[_0xe0aa('0x12')]));});});};exports[_0xe0aa('0x22')]=function(_0xd9c9c8){var _0x311cb1=this;return new Promise(function(_0x5d759f,_0xd308e7){return db[_0xe0aa('0x16')][_0xe0aa('0x23')](_0xd9c9c8['body'],{'raw':_0xd9c9c8[_0xe0aa('0x18')]?_0xd9c9c8[_0xe0aa('0x18')][_0xe0aa('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd9c9c8[_0xe0aa('0x18')]?_0xd9c9c8[_0xe0aa('0x18')][_0xe0aa('0x1a')]||null:null,'attributes':_0xd9c9c8[_0xe0aa('0x18')]?_0xd9c9c8[_0xe0aa('0x18')][_0xe0aa('0x1b')]||null:null,'limit':_0xd9c9c8[_0xe0aa('0x18')]?_0xd9c9c8['options'][_0xe0aa('0x1c')]||null:null})[_0xe0aa('0xa')](function(_0x11218e){logger['info'](_0xe0aa('0x22'),_0xd9c9c8);logger[_0xe0aa('0xd')](_0xe0aa('0x22'),_0xd9c9c8,JSON[_0xe0aa('0xf')](_0x11218e));_0x5d759f(_0x11218e);})[_0xe0aa('0x14')](function(_0x57a32c){logger[_0xe0aa('0x10')](_0xe0aa('0x22'),_0x57a32c['message'],_0xd9c9c8);_0xd308e7(_0x311cb1['error'](0x1f4,_0x57a32c[_0xe0aa('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 3d97ceb..6127609 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 _0x3222=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x24cbb8,_0x3fa149){var _0x58c2e1=function(_0x474e0a){while(--_0x474e0a){_0x24cbb8['push'](_0x24cbb8['shift']());}};_0x58c2e1(++_0x3fa149);}(_0x3222,0xc6));var _0x2322=function(_0x10cabe,_0x56da29){_0x10cabe=_0x10cabe-0x0;var _0xeb60fc=_0x3222[_0x10cabe];return _0xeb60fc;};'use strict';var multer=require(_0x2322('0x0'));var util=require(_0x2322('0x1'));var path=require(_0x2322('0x2'));var timeout=require(_0x2322('0x3'));var express=require(_0x2322('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2322('0x5'));var interaction=require(_0x2322('0x6'));var config=require(_0x2322('0x7'));var controller=require('./voiceChanSpy.controller');router[_0x2322('0x8')]('/',auth[_0x2322('0x9')](),controller[_0x2322('0xa')]);router[_0x2322('0x8')]('/:id',auth[_0x2322('0x9')](),controller[_0x2322('0xb')]);router[_0x2322('0xc')]('/',auth[_0x2322('0x9')](),controller[_0x2322('0xd')]);router[_0x2322('0xe')](_0x2322('0xf'),auth[_0x2322('0x9')](),controller[_0x2322('0x10')]);router[_0x2322('0x11')](_0x2322('0xf'),auth['isAuthenticated'](),controller[_0x2322('0x12')]);module[_0x2322('0x13')]=router; \ No newline at end of file +var _0xc6e3=['isAuthenticated','index','get','/:id','show','post','create','update','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller'];(function(_0x1cf0bc,_0x3fc67d){var _0x986385=function(_0x5e1325){while(--_0x5e1325){_0x1cf0bc['push'](_0x1cf0bc['shift']());}};_0x986385(++_0x3fc67d);}(_0xc6e3,0x100));var _0x3c6e=function(_0x5e21ae,_0x2e8b72){_0x5e21ae=_0x5e21ae-0x0;var _0x264f59=_0xc6e3[_0x5e21ae];return _0x264f59;};'use strict';var multer=require(_0x3c6e('0x0'));var util=require(_0x3c6e('0x1'));var path=require(_0x3c6e('0x2'));var timeout=require(_0x3c6e('0x3'));var express=require('express');var router=express[_0x3c6e('0x4')]();var fs_extra=require(_0x3c6e('0x5'));var auth=require(_0x3c6e('0x6'));var interaction=require(_0x3c6e('0x7'));var config=require(_0x3c6e('0x8'));var controller=require(_0x3c6e('0x9'));router['get']('/',auth[_0x3c6e('0xa')](),controller[_0x3c6e('0xb')]);router[_0x3c6e('0xc')](_0x3c6e('0xd'),auth[_0x3c6e('0xa')](),controller[_0x3c6e('0xe')]);router[_0x3c6e('0xf')]('/',auth[_0x3c6e('0xa')](),controller[_0x3c6e('0x10')]);router['put'](_0x3c6e('0xd'),auth['isAuthenticated'](),controller[_0x3c6e('0x11')]);router['delete'](_0x3c6e('0xd'),auth['isAuthenticated'](),controller[_0x3c6e('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 44a9d3d..72a5519 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 _0x9898=['STRING','name','setDataValue','options','getDataValue','split','BOOLEAN','sequelize','exports'];(function(_0x44676a,_0x3e7b88){var _0x588695=function(_0x168ed1){while(--_0x168ed1){_0x44676a['push'](_0x44676a['shift']());}};_0x588695(++_0x3e7b88);}(_0x9898,0x1e4));var _0x8989=function(_0x3d4876,_0x366386){_0x3d4876=_0x3d4876-0x0;var _0x58ca9d=_0x9898[_0x3d4876];return _0x58ca9d;};'use strict';var Sequelize=require(_0x8989('0x0'));module[_0x8989('0x1')]={'name':{'type':Sequelize[_0x8989('0x2')]},'prefix':{'type':Sequelize[_0x8989('0x2')],'unique':_0x8989('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x5c8555){this[_0x8989('0x4')](_0x8989('0x5'),_0x5c8555?_0x5c8555['join'](''):[]);},'get':function(){return this[_0x8989('0x6')](_0x8989('0x5'))?this['getDataValue'](_0x8989('0x5'))[_0x8989('0x7')](''):[];}},'auth':{'type':Sequelize[_0x8989('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x8989('0x2')]},'record':{'type':Sequelize[_0x8989('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x8989('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0ba3=['sequelize','exports','STRING','name','setDataValue','options','join','getDataValue','split','BOOLEAN'];(function(_0x160570,_0x5e7c87){var _0x2a968d=function(_0x44b685){while(--_0x44b685){_0x160570['push'](_0x160570['shift']());}};_0x2a968d(++_0x5e7c87);}(_0x0ba3,0xa0));var _0x30ba=function(_0x25a42a,_0x3d489b){_0x25a42a=_0x25a42a-0x0;var _0x1129b1=_0x0ba3[_0x25a42a];return _0x1129b1;};'use strict';var Sequelize=require(_0x30ba('0x0'));module[_0x30ba('0x1')]={'name':{'type':Sequelize[_0x30ba('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x30ba('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x30ba('0x2')],'set':function(_0x341225){this[_0x30ba('0x4')](_0x30ba('0x5'),_0x341225?_0x341225[_0x30ba('0x6')](''):[]);},'get':function(){return this[_0x30ba('0x7')]('options')?this['getDataValue'](_0x30ba('0x5'))[_0x30ba('0x8')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x30ba('0x2')]},'record':{'type':Sequelize[_0x30ba('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x30ba('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 393f912..247fbab 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 _0x6a00=['hasOwnProperty','nolimit','order','where','filters','pick','merge','VIRTUAL','findAll','show','params','rawAttributes','length','includeAll','include','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','end','error','stack','name','send','index','map','VoiceChanSpy','type','key','query','keys','intersection','attributes','model','fields'];(function(_0x13bee1,_0x1492ce){var _0x45846f=function(_0x4cdd56){while(--_0x4cdd56){_0x13bee1['push'](_0x13bee1['shift']());}};_0x45846f(++_0x1492ce);}(_0x6a00,0xc9));var _0x06a0=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x6a00[_0x2555d0];return _0x3bb486;};'use strict';var emlformat=require(_0x06a0('0x0'));var rimraf=require(_0x06a0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x06a0('0x2'));var rp=require(_0x06a0('0x3'));var moment=require(_0x06a0('0x4'));var BPromise=require(_0x06a0('0x5'));var Mustache=require(_0x06a0('0x6'));var util=require('util');var path=require('path');var sox=require(_0x06a0('0x7'));var csv=require(_0x06a0('0x8'));var ejs=require(_0x06a0('0x9'));var fs=require('fs');var fs_extra=require(_0x06a0('0xa'));var _=require(_0x06a0('0xb'));var squel=require(_0x06a0('0xc'));var crypto=require('crypto');var jsforce=require(_0x06a0('0xd'));var deskjs=require(_0x06a0('0xe'));var toCsv=require(_0x06a0('0x8'));var querystring=require(_0x06a0('0xf'));var Papa=require(_0x06a0('0x10'));var Redis=require(_0x06a0('0x11'));var authService=require(_0x06a0('0x12'));var qs=require(_0x06a0('0x13'));var as=require(_0x06a0('0x14'));var hardwareService=require(_0x06a0('0x15'));var logger=require(_0x06a0('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x06a0('0x17'));var licenseUtil=require(_0x06a0('0x18'));var db=require(_0x06a0('0x19'))['db'];function respondWithStatusCode(_0x1d2b7f,_0x688bf0){_0x688bf0=_0x688bf0||0xcc;return function(_0x177234){if(_0x177234){return _0x1d2b7f[_0x06a0('0x1a')](_0x688bf0);}return _0x1d2b7f[_0x06a0('0x1b')](_0x688bf0)['end']();};}function respondWithResult(_0x44c82a,_0x2d3f61){_0x2d3f61=_0x2d3f61||0xc8;return function(_0x26bba1){if(_0x26bba1){return _0x44c82a['status'](_0x2d3f61)[_0x06a0('0x1c')](_0x26bba1);}};}function respondWithFilteredResult(_0x2f694f,_0x363210){return function(_0x5560e3){if(_0x5560e3){var _0x4083e7=typeof _0x363210[_0x06a0('0x1d')]==='undefined'&&typeof _0x363210[_0x06a0('0x1e')]===_0x06a0('0x1f');var _0xacb02c=_0x5560e3[_0x06a0('0x20')];var _0x3d8836=_0x4083e7?0x0:_0x363210['offset'];var _0x3b6e74=_0x4083e7?_0x5560e3[_0x06a0('0x20')]:_0x363210[_0x06a0('0x1d')]+_0x363210[_0x06a0('0x1e')];var _0x3bce23;if(_0x3b6e74>=_0xacb02c){_0x3b6e74=_0xacb02c;_0x3bce23=0xc8;}else{_0x3bce23=0xce;}_0x2f694f[_0x06a0('0x1b')](_0x3bce23);return _0x2f694f[_0x06a0('0x21')](_0x06a0('0x22'),_0x3d8836+'-'+_0x3b6e74+'/'+_0xacb02c)[_0x06a0('0x1c')](_0x5560e3);}return null;};}function patchUpdates(_0x9772f5){return function(_0x52fc73){try{jsonpatch[_0x06a0('0x23')](_0x52fc73,_0x9772f5,!![]);}catch(_0x2b18b3){return BPromise[_0x06a0('0x24')](_0x2b18b3);}return _0x52fc73[_0x06a0('0x25')]();};}function saveUpdates(_0x422603,_0x304f8d){return function(_0x5b57d6){if(_0x5b57d6){return _0x5b57d6['update'](_0x422603)[_0x06a0('0x26')](function(_0x2ab1a2){return _0x2ab1a2;});}return null;};}function removeEntity(_0x4fc9a7,_0x151c35){return function(_0x1ae968){if(_0x1ae968){return _0x1ae968[_0x06a0('0x27')]()['then'](function(){var _0x98ae05=_0x1ae968[_0x06a0('0x28')]({'plain':!![]});var _0x4a7fff='ChanSpies';return db['UserProfileResource'][_0x06a0('0x27')]({'where':{'type':_0x4a7fff,'resourceId':_0x98ae05['id']}})[_0x06a0('0x26')](function(){return _0x1ae968;});})[_0x06a0('0x26')](function(){_0x4fc9a7[_0x06a0('0x1b')](0xcc)[_0x06a0('0x29')]();});}};}function handleEntityNotFound(_0x4676f2,_0xcc78b9){return function(_0x123958){if(!_0x123958){_0x4676f2[_0x06a0('0x1a')](0x194);}return _0x123958;};}function handleError(_0x54b7c5,_0x187f6f){_0x187f6f=_0x187f6f||0x1f4;return function(_0x49c8b0){logger[_0x06a0('0x2a')](_0x49c8b0[_0x06a0('0x2b')]);if(_0x49c8b0[_0x06a0('0x2c')]){delete _0x49c8b0[_0x06a0('0x2c')];}_0x54b7c5[_0x06a0('0x1b')](_0x187f6f)[_0x06a0('0x2d')](_0x49c8b0);};}exports[_0x06a0('0x2e')]=function(_0x3984eb,_0x10933e){var _0x56fd9a={},_0x3b2666={},_0x4177df={'count':0x0,'rows':[]};var _0x1a9e50=_[_0x06a0('0x2f')](db[_0x06a0('0x30')]['rawAttributes'],function(_0x1c2291){return{'name':_0x1c2291['fieldName'],'type':_0x1c2291[_0x06a0('0x31')][_0x06a0('0x32')]};});_0x3b2666['model']=_['map'](_0x1a9e50,_0x06a0('0x2c'));_0x3b2666[_0x06a0('0x33')]=_[_0x06a0('0x34')](_0x3984eb[_0x06a0('0x33')]);_0x3b2666['filters']=_[_0x06a0('0x35')](_0x3b2666['model'],_0x3b2666[_0x06a0('0x33')]);_0x56fd9a[_0x06a0('0x36')]=_['intersection'](_0x3b2666[_0x06a0('0x37')],qs[_0x06a0('0x38')](_0x3984eb['query'][_0x06a0('0x38')]));_0x56fd9a[_0x06a0('0x36')]=_0x56fd9a['attributes']['length']?_0x56fd9a[_0x06a0('0x36')]:_0x3b2666[_0x06a0('0x37')];if(!_0x3984eb['query'][_0x06a0('0x39')](_0x06a0('0x3a'))){_0x56fd9a['limit']=qs[_0x06a0('0x1e')](_0x3984eb[_0x06a0('0x33')][_0x06a0('0x1e')]);_0x56fd9a[_0x06a0('0x1d')]=qs[_0x06a0('0x1d')](_0x3984eb['query'][_0x06a0('0x1d')]);}_0x56fd9a[_0x06a0('0x3b')]=qs['sort'](_0x3984eb[_0x06a0('0x33')]['sort']);_0x56fd9a[_0x06a0('0x3c')]=qs[_0x06a0('0x3d')](_[_0x06a0('0x3e')](_0x3984eb[_0x06a0('0x33')],_0x3b2666[_0x06a0('0x3d')]),_0x1a9e50);if(_0x3984eb['query']['filter']){_0x56fd9a[_0x06a0('0x3c')]=_[_0x06a0('0x3f')](_0x56fd9a[_0x06a0('0x3c')],{'$or':_[_0x06a0('0x2f')](_0x1a9e50,function(_0x3aa6a3){if(_0x3aa6a3[_0x06a0('0x31')]!==_0x06a0('0x40')){var _0x49a6b2={};_0x49a6b2[_0x3aa6a3['name']]={'$like':'%'+_0x3984eb[_0x06a0('0x33')]['filter']+'%'};return _0x49a6b2;}})});}_0x56fd9a=_['merge']({},_0x56fd9a,_0x3984eb['options']);var _0x159fc1={'where':_0x56fd9a['where']};return db[_0x06a0('0x30')][_0x06a0('0x20')](_0x159fc1)[_0x06a0('0x26')](function(_0x1eac18){_0x4177df[_0x06a0('0x20')]=_0x1eac18;if(_0x3984eb[_0x06a0('0x33')]['includeAll']){_0x56fd9a['include']=[{'all':!![]}];}return db[_0x06a0('0x30')][_0x06a0('0x41')](_0x56fd9a);})[_0x06a0('0x26')](function(_0x4d0343){_0x4177df['rows']=_0x4d0343;return _0x4177df;})['then'](respondWithFilteredResult(_0x10933e,_0x56fd9a))['catch'](handleError(_0x10933e,null));};exports[_0x06a0('0x42')]=function(_0x40af26,_0x4806a1){var _0x4ab7cd={'raw':![],'where':{'id':_0x40af26[_0x06a0('0x43')]['id']}},_0x5d0611={};_0x5d0611['model']=_[_0x06a0('0x34')](db['VoiceChanSpy'][_0x06a0('0x44')]);_0x5d0611[_0x06a0('0x33')]=_['keys'](_0x40af26[_0x06a0('0x33')]);_0x5d0611['filters']=_[_0x06a0('0x35')](_0x5d0611[_0x06a0('0x37')],_0x5d0611[_0x06a0('0x33')]);_0x4ab7cd[_0x06a0('0x36')]=_[_0x06a0('0x35')](_0x5d0611[_0x06a0('0x37')],qs['fields'](_0x40af26[_0x06a0('0x33')][_0x06a0('0x38')]));_0x4ab7cd['attributes']=_0x4ab7cd[_0x06a0('0x36')][_0x06a0('0x45')]?_0x4ab7cd[_0x06a0('0x36')]:_0x5d0611['model'];if(_0x40af26['query'][_0x06a0('0x46')]){_0x4ab7cd[_0x06a0('0x47')]=[{'all':!![]}];}_0x4ab7cd=_[_0x06a0('0x3f')]({},_0x4ab7cd,_0x40af26[_0x06a0('0x48')]);return db[_0x06a0('0x30')][_0x06a0('0x49')](_0x4ab7cd)['then'](handleEntityNotFound(_0x4806a1,null))[_0x06a0('0x26')](respondWithResult(_0x4806a1,null))[_0x06a0('0x4a')](handleError(_0x4806a1,null));};exports[_0x06a0('0x4b')]=function(_0x423bc0,_0x1ad115){return db[_0x06a0('0x30')][_0x06a0('0x4b')](_0x423bc0[_0x06a0('0x4c')],{})[_0x06a0('0x26')](function(_0x54807e){var _0xcce2a6=_0x423bc0[_0x06a0('0x4d')][_0x06a0('0x28')]({'plain':!![]});if(!_0xcce2a6)throw new Error(_0x06a0('0x4e'));if(_0xcce2a6[_0x06a0('0x4f')]===_0x06a0('0x4d')){var _0x4e9351=_0x54807e['get']({'plain':!![]});var _0x404076=_0x06a0('0x50');return db[_0x06a0('0x51')][_0x06a0('0x49')]({'where':{'name':_0x404076,'userProfileId':_0xcce2a6[_0x06a0('0x52')]},'raw':!![]})['then'](function(_0x32a1b4){if(_0x32a1b4&&_0x32a1b4['autoAssociation']===0x0){return db[_0x06a0('0x53')][_0x06a0('0x4b')]({'name':_0x4e9351[_0x06a0('0x2c')],'resourceId':_0x4e9351['id'],'type':_0x32a1b4['name'],'sectionId':_0x32a1b4['id']},{})[_0x06a0('0x26')](function(){return _0x54807e;});}else{return _0x54807e;}})[_0x06a0('0x4a')](function(_0x207989){logger[_0x06a0('0x2a')](_0x06a0('0x54'),_0x207989);throw _0x207989;});}return _0x54807e;})[_0x06a0('0x26')](respondWithResult(_0x1ad115,0xc9))['catch'](handleError(_0x1ad115,null));};exports[_0x06a0('0x55')]=function(_0x572bca,_0x4b7051){if(_0x572bca[_0x06a0('0x4c')]['id']){delete _0x572bca[_0x06a0('0x4c')]['id'];}return db['VoiceChanSpy'][_0x06a0('0x49')]({'where':{'id':_0x572bca['params']['id']}})[_0x06a0('0x26')](handleEntityNotFound(_0x4b7051,null))[_0x06a0('0x26')](saveUpdates(_0x572bca[_0x06a0('0x4c')],null))[_0x06a0('0x26')](respondWithResult(_0x4b7051,null))[_0x06a0('0x4a')](handleError(_0x4b7051,null));};exports[_0x06a0('0x27')]=function(_0x51bb9d,_0x3c138e){return db['VoiceChanSpy'][_0x06a0('0x49')]({'where':{'id':_0x51bb9d['params']['id']}})[_0x06a0('0x26')](handleEntityNotFound(_0x3c138e,null))[_0x06a0('0x26')](removeEntity(_0x3c138e,null))[_0x06a0('0x4a')](handleError(_0x3c138e,null));}; \ No newline at end of file +var _0xc73e=['show','params','includeAll','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','autoAssociation','UserProfileResource','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','then','get','stack','name','index','map','VoiceChanSpy','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','options','include','findAll','rows','catch'];(function(_0xc79f2e,_0x594942){var _0x3219dc=function(_0x4f563b){while(--_0x4f563b){_0xc79f2e['push'](_0xc79f2e['shift']());}};_0x3219dc(++_0x594942);}(_0xc73e,0x1e9));var _0xec73=function(_0x3cfc96,_0x398015){_0x3cfc96=_0x3cfc96-0x0;var _0x1fcae6=_0xc73e[_0x3cfc96];return _0x1fcae6;};'use strict';var emlformat=require(_0xec73('0x0'));var rimraf=require(_0xec73('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xec73('0x2'));var rp=require(_0xec73('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xec73('0x4'));var path=require(_0xec73('0x5'));var sox=require('sox');var csv=require(_0xec73('0x6'));var ejs=require(_0xec73('0x7'));var fs=require('fs');var fs_extra=require(_0xec73('0x8'));var _=require(_0xec73('0x9'));var squel=require('squel');var crypto=require(_0xec73('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xec73('0xb'));var toCsv=require(_0xec73('0x6'));var querystring=require(_0xec73('0xc'));var Papa=require(_0xec73('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xec73('0xe'));var as=require(_0xec73('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xec73('0x10'));var utils=require(_0xec73('0x11'));var config=require(_0xec73('0x12'));var licenseUtil=require(_0xec73('0x13'));var db=require(_0xec73('0x14'))['db'];function respondWithStatusCode(_0x19d0f2,_0x1e67ac){_0x1e67ac=_0x1e67ac||0xcc;return function(_0x5f5594){if(_0x5f5594){return _0x19d0f2[_0xec73('0x15')](_0x1e67ac);}return _0x19d0f2['status'](_0x1e67ac)[_0xec73('0x16')]();};}function respondWithResult(_0x4be73c,_0x10f003){_0x10f003=_0x10f003||0xc8;return function(_0x1e4869){if(_0x1e4869){return _0x4be73c[_0xec73('0x17')](_0x10f003)[_0xec73('0x18')](_0x1e4869);}};}function respondWithFilteredResult(_0x3690c3,_0x2a3296){return function(_0x35be28){if(_0x35be28){var _0x2b4e70=typeof _0x2a3296['offset']===_0xec73('0x19')&&typeof _0x2a3296[_0xec73('0x1a')]===_0xec73('0x19');var _0x219119=_0x35be28[_0xec73('0x1b')];var _0x2d646e=_0x2b4e70?0x0:_0x2a3296['offset'];var _0x1bacbf=_0x2b4e70?_0x35be28[_0xec73('0x1b')]:_0x2a3296[_0xec73('0x1c')]+_0x2a3296['limit'];var _0x57ac66;if(_0x1bacbf>=_0x219119){_0x1bacbf=_0x219119;_0x57ac66=0xc8;}else{_0x57ac66=0xce;}_0x3690c3[_0xec73('0x17')](_0x57ac66);return _0x3690c3[_0xec73('0x1d')](_0xec73('0x1e'),_0x2d646e+'-'+_0x1bacbf+'/'+_0x219119)[_0xec73('0x18')](_0x35be28);}return null;};}function patchUpdates(_0x1169c4){return function(_0x5d4c7c){try{jsonpatch['apply'](_0x5d4c7c,_0x1169c4,!![]);}catch(_0x3eeaff){return BPromise[_0xec73('0x1f')](_0x3eeaff);}return _0x5d4c7c[_0xec73('0x20')]();};}function saveUpdates(_0x60bfec,_0x451715){return function(_0x4a862b){if(_0x4a862b){return _0x4a862b[_0xec73('0x21')](_0x60bfec)['then'](function(_0x3d58bc){return _0x3d58bc;});}return null;};}function removeEntity(_0x4f95d2,_0x4df08e){return function(_0x490ee2){if(_0x490ee2){return _0x490ee2[_0xec73('0x22')]()[_0xec73('0x23')](function(){var _0x2caf6b=_0x490ee2[_0xec73('0x24')]({'plain':!![]});var _0x3df864='ChanSpies';return db['UserProfileResource'][_0xec73('0x22')]({'where':{'type':_0x3df864,'resourceId':_0x2caf6b['id']}})[_0xec73('0x23')](function(){return _0x490ee2;});})['then'](function(){_0x4f95d2[_0xec73('0x17')](0xcc)[_0xec73('0x16')]();});}};}function handleEntityNotFound(_0x3bf259,_0x4dc430){return function(_0x23ff51){if(!_0x23ff51){_0x3bf259[_0xec73('0x15')](0x194);}return _0x23ff51;};}function handleError(_0x370e7a,_0x28361e){_0x28361e=_0x28361e||0x1f4;return function(_0x49a1da){logger['error'](_0x49a1da[_0xec73('0x25')]);if(_0x49a1da[_0xec73('0x26')]){delete _0x49a1da[_0xec73('0x26')];}_0x370e7a[_0xec73('0x17')](_0x28361e)['send'](_0x49a1da);};}exports[_0xec73('0x27')]=function(_0x269ca5,_0x24268b){var _0x90341f={},_0x3d46e9={},_0x3dffd0={'count':0x0,'rows':[]};var _0x47cb62=_[_0xec73('0x28')](db[_0xec73('0x29')][_0xec73('0x2a')],function(_0x4049ec){return{'name':_0x4049ec[_0xec73('0x2b')],'type':_0x4049ec[_0xec73('0x2c')]['key']};});_0x3d46e9[_0xec73('0x2d')]=_[_0xec73('0x28')](_0x47cb62,_0xec73('0x26'));_0x3d46e9[_0xec73('0x2e')]=_[_0xec73('0x2f')](_0x269ca5[_0xec73('0x2e')]);_0x3d46e9[_0xec73('0x30')]=_['intersection'](_0x3d46e9[_0xec73('0x2d')],_0x3d46e9['query']);_0x90341f[_0xec73('0x31')]=_[_0xec73('0x32')](_0x3d46e9[_0xec73('0x2d')],qs[_0xec73('0x33')](_0x269ca5[_0xec73('0x2e')][_0xec73('0x33')]));_0x90341f[_0xec73('0x31')]=_0x90341f[_0xec73('0x31')][_0xec73('0x34')]?_0x90341f['attributes']:_0x3d46e9['model'];if(!_0x269ca5[_0xec73('0x2e')][_0xec73('0x35')](_0xec73('0x36'))){_0x90341f[_0xec73('0x1a')]=qs[_0xec73('0x1a')](_0x269ca5[_0xec73('0x2e')][_0xec73('0x1a')]);_0x90341f[_0xec73('0x1c')]=qs['offset'](_0x269ca5[_0xec73('0x2e')][_0xec73('0x1c')]);}_0x90341f[_0xec73('0x37')]=qs['sort'](_0x269ca5['query']['sort']);_0x90341f[_0xec73('0x38')]=qs['filters'](_[_0xec73('0x39')](_0x269ca5['query'],_0x3d46e9['filters']),_0x47cb62);if(_0x269ca5[_0xec73('0x2e')]['filter']){_0x90341f[_0xec73('0x38')]=_['merge'](_0x90341f[_0xec73('0x38')],{'$or':_['map'](_0x47cb62,function(_0x3a971e){if(_0x3a971e[_0xec73('0x2c')]!=='VIRTUAL'){var _0x50623e={};_0x50623e[_0x3a971e['name']]={'$like':'%'+_0x269ca5[_0xec73('0x2e')]['filter']+'%'};return _0x50623e;}})});}_0x90341f=_[_0xec73('0x3a')]({},_0x90341f,_0x269ca5[_0xec73('0x3b')]);var _0x3c7ecd={'where':_0x90341f['where']};return db[_0xec73('0x29')][_0xec73('0x1b')](_0x3c7ecd)[_0xec73('0x23')](function(_0x1c5e2b){_0x3dffd0[_0xec73('0x1b')]=_0x1c5e2b;if(_0x269ca5['query']['includeAll']){_0x90341f[_0xec73('0x3c')]=[{'all':!![]}];}return db[_0xec73('0x29')][_0xec73('0x3d')](_0x90341f);})[_0xec73('0x23')](function(_0x1f6eeb){_0x3dffd0[_0xec73('0x3e')]=_0x1f6eeb;return _0x3dffd0;})[_0xec73('0x23')](respondWithFilteredResult(_0x24268b,_0x90341f))[_0xec73('0x3f')](handleError(_0x24268b,null));};exports[_0xec73('0x40')]=function(_0xe7862b,_0x27e8ac){var _0x1a43ef={'raw':![],'where':{'id':_0xe7862b[_0xec73('0x41')]['id']}},_0x474009={};_0x474009['model']=_['keys'](db[_0xec73('0x29')][_0xec73('0x2a')]);_0x474009[_0xec73('0x2e')]=_[_0xec73('0x2f')](_0xe7862b[_0xec73('0x2e')]);_0x474009[_0xec73('0x30')]=_[_0xec73('0x32')](_0x474009[_0xec73('0x2d')],_0x474009[_0xec73('0x2e')]);_0x1a43ef['attributes']=_['intersection'](_0x474009[_0xec73('0x2d')],qs['fields'](_0xe7862b[_0xec73('0x2e')]['fields']));_0x1a43ef[_0xec73('0x31')]=_0x1a43ef[_0xec73('0x31')][_0xec73('0x34')]?_0x1a43ef[_0xec73('0x31')]:_0x474009[_0xec73('0x2d')];if(_0xe7862b['query'][_0xec73('0x42')]){_0x1a43ef[_0xec73('0x3c')]=[{'all':!![]}];}_0x1a43ef=_['merge']({},_0x1a43ef,_0xe7862b[_0xec73('0x3b')]);return db[_0xec73('0x29')][_0xec73('0x43')](_0x1a43ef)[_0xec73('0x23')](handleEntityNotFound(_0x27e8ac,null))[_0xec73('0x23')](respondWithResult(_0x27e8ac,null))['catch'](handleError(_0x27e8ac,null));};exports['create']=function(_0x42e20f,_0x2a7bec){return db[_0xec73('0x29')]['create'](_0x42e20f[_0xec73('0x44')],{})['then'](function(_0x32af0e){var _0x990149=_0x42e20f[_0xec73('0x45')][_0xec73('0x24')]({'plain':!![]});if(!_0x990149)throw new Error(_0xec73('0x46'));if(_0x990149[_0xec73('0x47')]==='user'){var _0x5ab01e=_0x32af0e[_0xec73('0x24')]({'plain':!![]});var _0x56209d=_0xec73('0x48');return db[_0xec73('0x49')][_0xec73('0x43')]({'where':{'name':_0x56209d,'userProfileId':_0x990149['userProfileId']},'raw':!![]})[_0xec73('0x23')](function(_0xcb3229){if(_0xcb3229&&_0xcb3229[_0xec73('0x4a')]===0x0){return db[_0xec73('0x4b')][_0xec73('0x4c')]({'name':_0x5ab01e[_0xec73('0x26')],'resourceId':_0x5ab01e['id'],'type':_0xcb3229[_0xec73('0x26')],'sectionId':_0xcb3229['id']},{})[_0xec73('0x23')](function(){return _0x32af0e;});}else{return _0x32af0e;}})[_0xec73('0x3f')](function(_0x332ab5){logger[_0xec73('0x4d')](_0xec73('0x4e'),_0x332ab5);throw _0x332ab5;});}return _0x32af0e;})[_0xec73('0x23')](respondWithResult(_0x2a7bec,0xc9))[_0xec73('0x3f')](handleError(_0x2a7bec,null));};exports['update']=function(_0x3c76c5,_0x375e5d){if(_0x3c76c5[_0xec73('0x44')]['id']){delete _0x3c76c5[_0xec73('0x44')]['id'];}return db[_0xec73('0x29')][_0xec73('0x43')]({'where':{'id':_0x3c76c5['params']['id']}})[_0xec73('0x23')](handleEntityNotFound(_0x375e5d,null))[_0xec73('0x23')](saveUpdates(_0x3c76c5[_0xec73('0x44')],null))['then'](respondWithResult(_0x375e5d,null))[_0xec73('0x3f')](handleError(_0x375e5d,null));};exports[_0xec73('0x22')]=function(_0x631a54,_0x290ee8){return db[_0xec73('0x29')][_0xec73('0x43')]({'where':{'id':_0x631a54[_0xec73('0x41')]['id']}})[_0xec73('0x23')](handleEntityNotFound(_0x290ee8,null))['then'](removeEntity(_0x290ee8,null))[_0xec73('0x3f')](handleError(_0x290ee8,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 514a185..efbf6ad 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 _0x1391=['MixMonitor','Authenticate','password','ChanSpy','options','join','merge','StopMixMonitor','internal','name','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','length','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','system','push','Set','CDR(type)=%s','chanspy','record'];(function(_0x13bd3c,_0xb33ae6){var _0x526a1d=function(_0x3fd00d){while(--_0x3fd00d){_0x13bd3c['push'](_0x13bd3c['shift']());}};_0x526a1d(++_0xb33ae6);}(_0x1391,0x1a2));var _0x1139=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x1391[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x1139('0x0'));var util=require(_0x1139('0x1'));var BPromise=require(_0x1139('0x2'));var attributes=require(_0x1139('0x3'));var getUserApplications=function(_0x3250ea,_0x19e572,_0x455fe0){var _0x19f7eb=0x1;var _0x4dd0db=[];var _0x9c155a={'context':_0x19e572[_0x1139('0x4')]||_0x1139('0x5'),'exten':util[_0x1139('0x6')](_0x1139('0x7'),_0x3250ea['prefix'],_0x455fe0),'type':_0x1139('0x8'),'isApp':![],'ChanSpyId':_0x3250ea['id'],'UserId':_0x19e572['id']};_0x4dd0db[_0x1139('0x9')](_['merge']({'app':_0x1139('0xa'),'appdata':util[_0x1139('0x6')](_0x1139('0xb'),_0x1139('0xc')),'priority':_0x19f7eb++},_0x9c155a));if(_0x3250ea[_0x1139('0xd')]){_0x4dd0db['push'](_['merge']({'app':_0x1139('0xe'),'appdata':util[_0x1139('0x6')]('${UNIQUEID}.%s,a',_0x3250ea['recordingFormat']),'priority':_0x19f7eb++},_0x9c155a));}if(_0x3250ea['auth']){_0x4dd0db[_0x1139('0x9')](_['merge']({'app':_0x1139('0xf'),'appdata':_0x3250ea[_0x1139('0x10')],'priority':_0x19f7eb++},_0x9c155a));}_0x4dd0db['push'](_['merge']({'app':_0x1139('0x11'),'appdata':util[_0x1139('0x6')]('SIP/%s,%s',_0x19e572['name'],_0x3250ea[_0x1139('0x12')]?_0x3250ea[_0x1139('0x12')][_0x1139('0x13')](''):''),'priority':_0x19f7eb++},_0x9c155a));if(_0x3250ea[_0x1139('0xd')]){_0x4dd0db[_0x1139('0x9')](_[_0x1139('0x14')]({'app':_0x1139('0x15'),'priority':_0x19f7eb++},_0x9c155a));}return _0x4dd0db;};var getChanSpyApplications=function(_0x2b43c7,_0x589c34){var _0x4856ef=[];for(var _0x1dc152=0x0,_0x337739=0x1;_0x1dc152<_0x589c34['length'];_0x1dc152++,_0x337739=0x1){_0x4856ef=_0x4856ef['concat'](getUserApplications(_0x2b43c7,_0x589c34[_0x1dc152],_0x589c34[_0x1dc152][_0x1139('0x16')]));if(_0x589c34[_0x1dc152]['internal']!=_0x589c34[_0x1dc152][_0x1139('0x17')]){_0x4856ef=_0x4856ef['concat'](getUserApplications(_0x2b43c7,_0x589c34[_0x1dc152],_0x589c34[_0x1dc152][_0x1139('0x17')]));}}return _0x4856ef;};var getChanSpyPromise=function(_0x5393d1,_0x279d64){return new BPromise(function(_0x5cacbe,_0xa767d3){return _0x5393d1['User']['findAll']({'attributes':['id',_0x1139('0x17'),_0x1139('0x16')],'where':{'role':_0x1139('0x18'),'chanspy':!![]},'raw':!![]})[_0x1139('0x19')](function(_0x183a10){if(_0x183a10){return _0x5cacbe(getChanSpyApplications(_0x279d64,_0x183a10));}return _0x5cacbe([]);})[_0x1139('0x1a')](function(_0x2ee7bd){_0xa767d3(_0x2ee7bd);});});};module[_0x1139('0x1b')]=function(_0x21626b,_0x4a9827){var _0x234591=_0x21626b[_0x1139('0x1c')];return _0x21626b[_0x1139('0x1d')](_0x1139('0x1e'),attributes,{'tableName':_0x1139('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2a0ce7,_0x1194ed,_0x1a3817){return getChanSpyPromise(_0x234591,_0x2a0ce7)['then'](function(_0x25542b){if(_0x25542b&&_0x25542b[_0x1139('0x20')]){return _0x234591[_0x1139('0x21')][_0x1139('0x22')](_0x25542b);}})[_0x1139('0x19')](function(){_0x1a3817();})[_0x1139('0x1a')](function(_0x561b5a){_0x1a3817(_0x561b5a);});},'afterUpdate':function(_0x3ae9ad,_0x4591e8,_0x5bd26c){return _0x234591[_0x1139('0x21')][_0x1139('0x23')]({'where':{'ChanSpyId':_0x3ae9ad['id']}})[_0x1139('0x19')](function(){return getChanSpyPromise(_0x234591,_0x3ae9ad);})[_0x1139('0x19')](function(_0x3a07f4){if(_0x3a07f4&&_0x3a07f4[_0x1139('0x20')]){return _0x234591[_0x1139('0x21')]['bulkCreate'](_0x3a07f4);}})[_0x1139('0x19')](function(){_0x5bd26c();})[_0x1139('0x1a')](function(_0x29e02d){_0x5bd26c(_0x29e02d);});},'afterDestroy':function(_0x4ef04b,_0x2c49cb,_0x42821a){return _0x234591[_0x1139('0x21')][_0x1139('0x23')]({'where':{'ChanSpyId':_0x4ef04b['id']}})[_0x1139('0x19')](function(){_0x42821a();})['catch'](function(_0x1372f7){_0x42821a(_0x1372f7);});}}});}; \ No newline at end of file +var _0xe084=['models','define','voice_chanspy','bulkCreate','VoiceExtension','destroy','util','bluebird','./voiceChanSpy.attributes','from-sip','format','system','Set','CDR(type)=%s','chanspy','record','merge','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','push','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','agent','then','catch','exports'];(function(_0x34a988,_0x53a955){var _0x47cc33=function(_0x43bc37){while(--_0x43bc37){_0x34a988['push'](_0x34a988['shift']());}};_0x47cc33(++_0x53a955);}(_0xe084,0x9a));var _0x4e08=function(_0x447b93,_0x190bbb){_0x447b93=_0x447b93-0x0;var _0x31acf5=_0xe084[_0x447b93];return _0x31acf5;};'use strict';var _=require('lodash');var util=require(_0x4e08('0x0'));var BPromise=require(_0x4e08('0x1'));var attributes=require(_0x4e08('0x2'));var getUserApplications=function(_0x591c26,_0x297370,_0xc5e2b0){var _0x111b1a=0x1;var _0x681383=[];var _0x2fae05={'context':_0x297370['context']||_0x4e08('0x3'),'exten':util[_0x4e08('0x4')]('%s%s',_0x591c26['prefix'],_0xc5e2b0),'type':_0x4e08('0x5'),'isApp':![],'ChanSpyId':_0x591c26['id'],'UserId':_0x297370['id']};_0x681383['push'](_['merge']({'app':_0x4e08('0x6'),'appdata':util[_0x4e08('0x4')](_0x4e08('0x7'),_0x4e08('0x8')),'priority':_0x111b1a++},_0x2fae05));if(_0x591c26[_0x4e08('0x9')]){_0x681383['push'](_[_0x4e08('0xa')]({'app':_0x4e08('0xb'),'appdata':util['format'](_0x4e08('0xc'),_0x591c26[_0x4e08('0xd')]),'priority':_0x111b1a++},_0x2fae05));}if(_0x591c26[_0x4e08('0xe')]){_0x681383[_0x4e08('0xf')](_[_0x4e08('0xa')]({'app':_0x4e08('0x10'),'appdata':_0x591c26['password'],'priority':_0x111b1a++},_0x2fae05));}_0x681383[_0x4e08('0xf')](_[_0x4e08('0xa')]({'app':_0x4e08('0x11'),'appdata':util[_0x4e08('0x4')](_0x4e08('0x12'),_0x297370[_0x4e08('0x13')],_0x591c26['options']?_0x591c26[_0x4e08('0x14')][_0x4e08('0x15')](''):''),'priority':_0x111b1a++},_0x2fae05));if(_0x591c26[_0x4e08('0x9')]){_0x681383[_0x4e08('0xf')](_[_0x4e08('0xa')]({'app':_0x4e08('0x16'),'priority':_0x111b1a++},_0x2fae05));}return _0x681383;};var getChanSpyApplications=function(_0x1fa6dd,_0x398397){var _0x468b1e=[];for(var _0x2cc112=0x0,_0x2325bc=0x1;_0x2cc112<_0x398397[_0x4e08('0x17')];_0x2cc112++,_0x2325bc=0x1){_0x468b1e=_0x468b1e[_0x4e08('0x18')](getUserApplications(_0x1fa6dd,_0x398397[_0x2cc112],_0x398397[_0x2cc112][_0x4e08('0x19')]));if(_0x398397[_0x2cc112]['internal']!=_0x398397[_0x2cc112]['name']){_0x468b1e=_0x468b1e[_0x4e08('0x18')](getUserApplications(_0x1fa6dd,_0x398397[_0x2cc112],_0x398397[_0x2cc112][_0x4e08('0x13')]));}}return _0x468b1e;};var getChanSpyPromise=function(_0x1cea31,_0x2c5a21){return new BPromise(function(_0x55fdeb,_0x4014a5){return _0x1cea31[_0x4e08('0x1a')]['findAll']({'attributes':['id',_0x4e08('0x13'),_0x4e08('0x19')],'where':{'role':_0x4e08('0x1b'),'chanspy':!![]},'raw':!![]})[_0x4e08('0x1c')](function(_0x2581c0){if(_0x2581c0){return _0x55fdeb(getChanSpyApplications(_0x2c5a21,_0x2581c0));}return _0x55fdeb([]);})[_0x4e08('0x1d')](function(_0x29f448){_0x4014a5(_0x29f448);});});};module[_0x4e08('0x1e')]=function(_0x1c5b5d,_0x3e6b93){var _0x360c2e=_0x1c5b5d[_0x4e08('0x1f')];return _0x1c5b5d[_0x4e08('0x20')]('VoiceChanSpy',attributes,{'tableName':_0x4e08('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x15df0e,_0x9e30cf,_0x58aa3e){return getChanSpyPromise(_0x360c2e,_0x15df0e)[_0x4e08('0x1c')](function(_0x2877db){if(_0x2877db&&_0x2877db[_0x4e08('0x17')]){return _0x360c2e['VoiceExtension'][_0x4e08('0x22')](_0x2877db);}})[_0x4e08('0x1c')](function(){_0x58aa3e();})[_0x4e08('0x1d')](function(_0x5e8e23){_0x58aa3e(_0x5e8e23);});},'afterUpdate':function(_0x80e601,_0x68bcf3,_0x168067){return _0x360c2e[_0x4e08('0x23')][_0x4e08('0x24')]({'where':{'ChanSpyId':_0x80e601['id']}})[_0x4e08('0x1c')](function(){return getChanSpyPromise(_0x360c2e,_0x80e601);})[_0x4e08('0x1c')](function(_0x677a67){if(_0x677a67&&_0x677a67[_0x4e08('0x17')]){return _0x360c2e[_0x4e08('0x23')]['bulkCreate'](_0x677a67);}})[_0x4e08('0x1c')](function(){_0x168067();})[_0x4e08('0x1d')](function(_0x51071f){_0x168067(_0x51071f);});},'afterDestroy':function(_0x2feb6d,_0x18b73b,_0x197927){return _0x360c2e[_0x4e08('0x23')][_0x4e08('0x24')]({'where':{'ChanSpyId':_0x2feb6d['id']}})[_0x4e08('0x1c')](function(){_0x197927();})[_0x4e08('0x1d')](function(_0xf31f25){_0x197927(_0xf31f25);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 9d59188..ff9526b 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 _0x74f0=['message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x74f0,0xf3));var _0x074f=function(_0x469393,_0x247969){_0x469393=_0x469393-0x0;var _0x5f720d=_0x74f0[_0x469393];return _0x5f720d;};'use strict';var _=require('lodash');var util=require(_0x074f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x074f('0x1'));var fs=require('fs');var Redis=require(_0x074f('0x2'));var db=require(_0x074f('0x3'))['db'];var utils=require(_0x074f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x074f('0x5'));var jayson=require(_0x074f('0x6'));var client=jayson[_0x074f('0x7')][_0x074f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10b244,_0x395b3c,_0x3dd440){return new BPromise(function(_0x547297,_0x7108e1){return client[_0x074f('0x9')](_0x10b244,_0x3dd440)['then'](function(_0x252a2e){logger[_0x074f('0xa')](_0x074f('0xb'),_0x395b3c,_0x074f('0xc'));logger[_0x074f('0xd')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x395b3c,'request\x20sent',JSON[_0x074f('0xe')](_0x252a2e));if(_0x252a2e[_0x074f('0xf')]){if(_0x252a2e[_0x074f('0xf')][_0x074f('0x10')]===0x1f4){logger[_0x074f('0xf')](_0x074f('0xb'),_0x395b3c,_0x252a2e[_0x074f('0xf')][_0x074f('0x11')]);return _0x7108e1(_0x252a2e[_0x074f('0xf')]['message']);}logger[_0x074f('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x395b3c,_0x252a2e[_0x074f('0xf')][_0x074f('0x11')]);return _0x547297(_0x252a2e[_0x074f('0xf')][_0x074f('0x11')]);}else{logger[_0x074f('0xa')](_0x074f('0xb'),_0x395b3c,_0x074f('0xc'));_0x547297(_0x252a2e[_0x074f('0x12')][_0x074f('0x11')]);}})[_0x074f('0x13')](function(_0x40fd10){logger['error'](_0x074f('0xb'),_0x395b3c,_0x40fd10);_0x7108e1(_0x40fd10);});});} \ No newline at end of file +var _0x6f7a=['http','request','then','info','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5a6cef,_0x1697df){var _0x37f76f=function(_0x17dc71){while(--_0x17dc71){_0x5a6cef['push'](_0x5a6cef['shift']());}};_0x37f76f(++_0x1697df);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x1b3eae,_0x109999){_0x1b3eae=_0x1b3eae-0x0;var _0x334dbb=_0x6f7a[_0x1b3eae];return _0x334dbb;};'use strict';var _=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var moment=require(_0xa6f7('0x2'));var BPromise=require(_0xa6f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6f7('0x4'));var db=require(_0xa6f7('0x5'))['db'];var utils=require(_0xa6f7('0x6'));var logger=require(_0xa6f7('0x7'))(_0xa6f7('0x8'));var config=require(_0xa6f7('0x9'));var jayson=require(_0xa6f7('0xa'));var client=jayson[_0xa6f7('0xb')][_0xa6f7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x335aaa,_0x1a06d1,_0x481a8c){return new BPromise(function(_0x4b4f9e,_0x30f2a7){return client[_0xa6f7('0xd')](_0x335aaa,_0x481a8c)[_0xa6f7('0xe')](function(_0x362404){logger[_0xa6f7('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x1a06d1,'request\x20sent');logger[_0xa6f7('0x10')](_0xa6f7('0x11'),_0x1a06d1,'request\x20sent',JSON[_0xa6f7('0x12')](_0x362404));if(_0x362404['error']){if(_0x362404[_0xa6f7('0x13')][_0xa6f7('0x14')]===0x1f4){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x30f2a7(_0x362404['error'][_0xa6f7('0x16')]);}logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x4b4f9e(_0x362404['error'][_0xa6f7('0x16')]);}else{logger['info'](_0xa6f7('0x15'),_0x1a06d1,_0xa6f7('0x17'));_0x4b4f9e(_0x362404[_0xa6f7('0x18')]['message']);}})[_0xa6f7('0x19')](function(_0x22635e){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x22635e);_0x30f2a7(_0x22635e);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 1229b51..6e4459e 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 _0x986e=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','index','/:id','isAuthenticated','show','create','put','destroy','exports','multer','util','path'];(function(_0x547cbf,_0x235a49){var _0x4e6480=function(_0x2468d8){while(--_0x2468d8){_0x547cbf['push'](_0x547cbf['shift']());}};_0x4e6480(++_0x235a49);}(_0x986e,0x8d));var _0xe986=function(_0x11d208,_0x1376e4){_0x11d208=_0x11d208-0x0;var _0x57440b=_0x986e[_0x11d208];return _0x57440b;};'use strict';var multer=require(_0xe986('0x0'));var util=require(_0xe986('0x1'));var path=require(_0xe986('0x2'));var timeout=require(_0xe986('0x3'));var express=require(_0xe986('0x4'));var router=express[_0xe986('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe986('0x6'));var config=require(_0xe986('0x7'));var controller=require(_0xe986('0x8'));router[_0xe986('0x9')]('/',auth['isAuthenticated'](),controller[_0xe986('0xa')]);router['get'](_0xe986('0xb'),auth[_0xe986('0xc')](),controller[_0xe986('0xd')]);router['post']('/',auth[_0xe986('0xc')](),controller[_0xe986('0xe')]);router[_0xe986('0xf')](_0xe986('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe986('0xb'),auth['isAuthenticated'](),controller[_0xe986('0x10')]);module[_0xe986('0x11')]=router; \ No newline at end of file +var _0x7bd1=['isAuthenticated','index','show','post','create','put','update','/:id','destroy','multer','util','path','express','Router','../../components/auth/service','../../config/environment','get'];(function(_0x458f49,_0x1a1af1){var _0x36e8c9=function(_0x1273cb){while(--_0x1273cb){_0x458f49['push'](_0x458f49['shift']());}};_0x36e8c9(++_0x1a1af1);}(_0x7bd1,0x1e5));var _0x17bd=function(_0x1e0c0e,_0x5ccb80){_0x1e0c0e=_0x1e0c0e-0x0;var _0x53fecc=_0x7bd1[_0x1e0c0e];return _0x53fecc;};'use strict';var multer=require(_0x17bd('0x0'));var util=require(_0x17bd('0x1'));var path=require(_0x17bd('0x2'));var timeout=require('connect-timeout');var express=require(_0x17bd('0x3'));var router=express[_0x17bd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x17bd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x17bd('0x6'));var controller=require('./voiceContext.controller');router[_0x17bd('0x7')]('/',auth[_0x17bd('0x8')](),controller[_0x17bd('0x9')]);router['get']('/:id',auth[_0x17bd('0x8')](),controller[_0x17bd('0xa')]);router[_0x17bd('0xb')]('/',auth[_0x17bd('0x8')](),controller[_0x17bd('0xc')]);router[_0x17bd('0xd')]('/:id',auth[_0x17bd('0x8')](),controller[_0x17bd('0xe')]);router['delete'](_0x17bd('0xf'),auth[_0x17bd('0x8')](),controller[_0x17bd('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index f2c51e7..51b5ad3 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 _0x833b=['name','BOOLEAN','exports'];(function(_0x4a1289,_0x44e294){var _0x56508d=function(_0x2b321f){while(--_0x2b321f){_0x4a1289['push'](_0x4a1289['shift']());}};_0x56508d(++_0x44e294);}(_0x833b,0x131));var _0xb833=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x833b[_0x39c734];return _0xb2a2f9;};'use strict';var Sequelize=require('sequelize');module[_0xb833('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xb833('0x1')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xb833('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xeb0b=['name','STRING','exports'];(function(_0x36e059,_0x19ee27){var _0x52ee13=function(_0x3dbfb1){while(--_0x3dbfb1){_0x36e059['push'](_0x36e059['shift']());}};_0x52ee13(++_0x19ee27);}(_0xeb0b,0x12b));var _0xbeb0=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xeb0b[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');module[_0xbeb0('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xbeb0('0x1')},'description':{'type':Sequelize[_0xbeb0('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 7e97dd9..c0972ad 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 _0x2a1b=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','error','message','info','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','get','Contexts','UserProfileResource','stack','name','index','map','VoiceContext','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','nolimit','sort','where','filters','pick','filter','type','VIRTUAL','include','findAll','show','params','length','includeAll','merge','options','find','catch','body','readFileSync','root','server/files/templates/context.ejs','utf8','writeFileSync','Reload','create','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','render','/etc/asterisk/extensions_xcally_contexts.conf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x2a1b,0x185));var _0xb2a1=function(_0x4a9c1e,_0x31ec16){_0x4a9c1e=_0x4a9c1e-0x0;var _0x207d0c=_0x2a1b[_0x4a9c1e];return _0x207d0c;};'use strict';var emlformat=require(_0xb2a1('0x0'));var rimraf=require(_0xb2a1('0x1'));var zipdir=require(_0xb2a1('0x2'));var jsonpatch=require(_0xb2a1('0x3'));var rp=require(_0xb2a1('0x4'));var moment=require(_0xb2a1('0x5'));var BPromise=require(_0xb2a1('0x6'));var Mustache=require(_0xb2a1('0x7'));var util=require(_0xb2a1('0x8'));var path=require(_0xb2a1('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb2a1('0xa'));var fs=require('fs');var fs_extra=require(_0xb2a1('0xb'));var _=require('lodash');var squel=require(_0xb2a1('0xc'));var crypto=require(_0xb2a1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb2a1('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb2a1('0xf'));var Papa=require(_0xb2a1('0x10'));var Redis=require(_0xb2a1('0x11'));var authService=require(_0xb2a1('0x12'));var qs=require(_0xb2a1('0x13'));var as=require(_0xb2a1('0x14'));var hardwareService=require(_0xb2a1('0x15'));var logger=require(_0xb2a1('0x16'))(_0xb2a1('0x17'));var utils=require('../../config/utils');var config=require(_0xb2a1('0x18'));var licenseUtil=require(_0xb2a1('0x19'));var db=require(_0xb2a1('0x1a'))['db'];var jayson=require(_0xb2a1('0x1b'));var client=jayson[_0xb2a1('0x1c')][_0xb2a1('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x17f6f3,_0x4faf74,_0x468923,_0x4ee9a1){return new BPromise(function(_0x1fdfc5,_0xc8b98f){var _0x2cb3a3=_0x4ee9a1||client;return _0x2cb3a3[_0xb2a1('0x1e')](_0x17f6f3,_0x468923)[_0xb2a1('0x1f')](function(_0x3f063c){logger['info'](_0xb2a1('0x20'),_0x4faf74,_0xb2a1('0x21'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x4faf74,_0xb2a1('0x21'),JSON['stringify'](_0x3f063c));if(_0x3f063c[_0xb2a1('0x22')]){if(_0x3f063c[_0xb2a1('0x22')]['code']===0x1f4){logger[_0xb2a1('0x22')]('VoiceContext,\x20%s,\x20%s',_0x4faf74,_0x3f063c[_0xb2a1('0x22')][_0xb2a1('0x23')]);return _0xc8b98f(_0x3f063c[_0xb2a1('0x22')]['message']);}logger[_0xb2a1('0x22')](_0xb2a1('0x20'),_0x4faf74,_0x3f063c[_0xb2a1('0x22')][_0xb2a1('0x23')]);return _0x1fdfc5(_0x3f063c[_0xb2a1('0x22')][_0xb2a1('0x23')]);}else{logger[_0xb2a1('0x24')](_0xb2a1('0x20'),_0x4faf74,'request\x20sent');_0x1fdfc5(_0x3f063c[_0xb2a1('0x25')][_0xb2a1('0x23')]);}})['catch'](function(_0x24d87a){logger[_0xb2a1('0x22')](_0xb2a1('0x20'),_0x4faf74,_0x24d87a);_0xc8b98f(_0x24d87a);});});}function respondWithStatusCode(_0x377adf,_0x41c68e){_0x41c68e=_0x41c68e||0xcc;return function(_0x2d8a45){if(_0x2d8a45){return _0x377adf[_0xb2a1('0x26')](_0x41c68e);}return _0x377adf['status'](_0x41c68e)['end']();};}function respondWithResult(_0x240a74,_0x51a64d){_0x51a64d=_0x51a64d||0xc8;return function(_0x26c668){if(_0x26c668){return _0x240a74[_0xb2a1('0x27')](_0x51a64d)[_0xb2a1('0x28')](_0x26c668);}};}function respondWithFilteredResult(_0x25320b,_0x764c64){return function(_0x1c09a2){if(_0x1c09a2){var _0x3b0c66=typeof _0x764c64[_0xb2a1('0x29')]===_0xb2a1('0x2a')&&typeof _0x764c64[_0xb2a1('0x2b')]===_0xb2a1('0x2a');var _0x4fff4a=_0x1c09a2[_0xb2a1('0x2c')];var _0x32ea9b=_0x3b0c66?0x0:_0x764c64[_0xb2a1('0x29')];var _0x288a1b=_0x3b0c66?_0x1c09a2[_0xb2a1('0x2c')]:_0x764c64[_0xb2a1('0x29')]+_0x764c64[_0xb2a1('0x2b')];var _0x7ec721;if(_0x288a1b>=_0x4fff4a){_0x288a1b=_0x4fff4a;_0x7ec721=0xc8;}else{_0x7ec721=0xce;}_0x25320b[_0xb2a1('0x27')](_0x7ec721);return _0x25320b[_0xb2a1('0x2d')](_0xb2a1('0x2e'),_0x32ea9b+'-'+_0x288a1b+'/'+_0x4fff4a)['json'](_0x1c09a2);}return null;};}function patchUpdates(_0x3e8cfe){return function(_0x380988){try{jsonpatch['apply'](_0x380988,_0x3e8cfe,!![]);}catch(_0x2d7f45){return BPromise[_0xb2a1('0x2f')](_0x2d7f45);}return _0x380988['save']();};}function saveUpdates(_0x3f43a1,_0x1e25ec){return function(_0x47c8d5){if(_0x47c8d5){return _0x47c8d5[_0xb2a1('0x30')](_0x3f43a1)[_0xb2a1('0x1f')](function(_0x4e9755){return _0x4e9755;});}return null;};}function removeEntity(_0x338f54,_0x154f37){return function(_0xb3e885){if(_0xb3e885){return _0xb3e885[_0xb2a1('0x31')]()[_0xb2a1('0x1f')](function(){var _0x12fe90=_0xb3e885[_0xb2a1('0x32')]({'plain':!![]});var _0x2a3c0e=_0xb2a1('0x33');return db[_0xb2a1('0x34')][_0xb2a1('0x31')]({'where':{'type':_0x2a3c0e,'resourceId':_0x12fe90['id']}})[_0xb2a1('0x1f')](function(){return _0xb3e885;});})[_0xb2a1('0x1f')](function(){_0x338f54[_0xb2a1('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f4585,_0x3ac501){return function(_0x5f4d29){if(!_0x5f4d29){_0x4f4585['sendStatus'](0x194);}return _0x5f4d29;};}function handleError(_0x3db360,_0x37bdf7){_0x37bdf7=_0x37bdf7||0x1f4;return function(_0x2ca552){logger[_0xb2a1('0x22')](_0x2ca552[_0xb2a1('0x35')]);if(_0x2ca552[_0xb2a1('0x36')]){delete _0x2ca552[_0xb2a1('0x36')];}_0x3db360[_0xb2a1('0x27')](_0x37bdf7)['send'](_0x2ca552);};}exports[_0xb2a1('0x37')]=function(_0x538ed7,_0x521777){var _0x217ccb={},_0x16f9ed={},_0x2bc85c={'count':0x0,'rows':[]};var _0x557946=_[_0xb2a1('0x38')](db[_0xb2a1('0x39')][_0xb2a1('0x3a')],function(_0x4c342e){return{'name':_0x4c342e[_0xb2a1('0x3b')],'type':_0x4c342e['type'][_0xb2a1('0x3c')]};});_0x16f9ed[_0xb2a1('0x3d')]=_[_0xb2a1('0x38')](_0x557946,_0xb2a1('0x36'));_0x16f9ed[_0xb2a1('0x3e')]=_[_0xb2a1('0x3f')](_0x538ed7['query']);_0x16f9ed['filters']=_['intersection'](_0x16f9ed['model'],_0x16f9ed[_0xb2a1('0x3e')]);_0x217ccb[_0xb2a1('0x40')]=_[_0xb2a1('0x41')](_0x16f9ed['model'],qs[_0xb2a1('0x42')](_0x538ed7[_0xb2a1('0x3e')]['fields']));_0x217ccb[_0xb2a1('0x40')]=_0x217ccb[_0xb2a1('0x40')]['length']?_0x217ccb[_0xb2a1('0x40')]:_0x16f9ed[_0xb2a1('0x3d')];if(!_0x538ed7['query']['hasOwnProperty'](_0xb2a1('0x43'))){_0x217ccb['limit']=qs[_0xb2a1('0x2b')](_0x538ed7[_0xb2a1('0x3e')][_0xb2a1('0x2b')]);_0x217ccb[_0xb2a1('0x29')]=qs[_0xb2a1('0x29')](_0x538ed7['query']['offset']);}_0x217ccb['order']=qs[_0xb2a1('0x44')](_0x538ed7[_0xb2a1('0x3e')]['sort']);_0x217ccb[_0xb2a1('0x45')]=qs[_0xb2a1('0x46')](_[_0xb2a1('0x47')](_0x538ed7[_0xb2a1('0x3e')],_0x16f9ed[_0xb2a1('0x46')]),_0x557946);if(_0x538ed7[_0xb2a1('0x3e')][_0xb2a1('0x48')]){_0x217ccb['where']=_['merge'](_0x217ccb[_0xb2a1('0x45')],{'$or':_['map'](_0x557946,function(_0x105a2d){if(_0x105a2d[_0xb2a1('0x49')]!==_0xb2a1('0x4a')){var _0x1db9ba={};_0x1db9ba[_0x105a2d[_0xb2a1('0x36')]]={'$like':'%'+_0x538ed7[_0xb2a1('0x3e')][_0xb2a1('0x48')]+'%'};return _0x1db9ba;}})});}_0x217ccb=_['merge']({},_0x217ccb,_0x538ed7['options']);var _0x9a2c31={'where':_0x217ccb[_0xb2a1('0x45')]};return db[_0xb2a1('0x39')][_0xb2a1('0x2c')](_0x9a2c31)['then'](function(_0x4529b3){_0x2bc85c[_0xb2a1('0x2c')]=_0x4529b3;if(_0x538ed7['query']['includeAll']){_0x217ccb[_0xb2a1('0x4b')]=[{'all':!![]}];}return db[_0xb2a1('0x39')][_0xb2a1('0x4c')](_0x217ccb);})['then'](function(_0x182d6b){_0x2bc85c['rows']=_0x182d6b;return _0x2bc85c;})[_0xb2a1('0x1f')](respondWithFilteredResult(_0x521777,_0x217ccb))['catch'](handleError(_0x521777,null));};exports[_0xb2a1('0x4d')]=function(_0x582de8,_0x190f0e){var _0x5d4783={'raw':![],'where':{'id':_0x582de8[_0xb2a1('0x4e')]['id']}},_0x4ec470={};_0x4ec470[_0xb2a1('0x3d')]=_[_0xb2a1('0x3f')](db[_0xb2a1('0x39')][_0xb2a1('0x3a')]);_0x4ec470[_0xb2a1('0x3e')]=_[_0xb2a1('0x3f')](_0x582de8[_0xb2a1('0x3e')]);_0x4ec470[_0xb2a1('0x46')]=_[_0xb2a1('0x41')](_0x4ec470[_0xb2a1('0x3d')],_0x4ec470[_0xb2a1('0x3e')]);_0x5d4783[_0xb2a1('0x40')]=_[_0xb2a1('0x41')](_0x4ec470[_0xb2a1('0x3d')],qs['fields'](_0x582de8[_0xb2a1('0x3e')]['fields']));_0x5d4783[_0xb2a1('0x40')]=_0x5d4783['attributes'][_0xb2a1('0x4f')]?_0x5d4783['attributes']:_0x4ec470[_0xb2a1('0x3d')];if(_0x582de8[_0xb2a1('0x3e')][_0xb2a1('0x50')]){_0x5d4783[_0xb2a1('0x4b')]=[{'all':!![]}];}_0x5d4783=_[_0xb2a1('0x51')]({},_0x5d4783,_0x582de8[_0xb2a1('0x52')]);return db[_0xb2a1('0x39')][_0xb2a1('0x53')](_0x5d4783)[_0xb2a1('0x1f')](handleEntityNotFound(_0x190f0e,null))[_0xb2a1('0x1f')](respondWithResult(_0x190f0e,null))[_0xb2a1('0x54')](handleError(_0x190f0e,null));};exports['create']=function(_0x1068e7,_0x143a81,_0x566ddf){var _0x5f298d;return db[_0xb2a1('0x39')]['create'](_0x1068e7[_0xb2a1('0x55')],{'raw':!![]})[_0xb2a1('0x1f')](function(_0x280da7){_0x5f298d=_0x280da7;return db[_0xb2a1('0x39')][_0xb2a1('0x4c')]({'raw':!![]});})[_0xb2a1('0x1f')](function(_0x44ea3d){var _0x56812f=fs[_0xb2a1('0x56')](path['join'](config[_0xb2a1('0x57')],_0xb2a1('0x58')),_0xb2a1('0x59'));var _0x3e6b4f=ejs['render'](_0x56812f,{'contexts':_0x44ea3d||[]});fs[_0xb2a1('0x5a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3e6b4f);})[_0xb2a1('0x1f')](function(){return respondWithRpcPromise(_0xb2a1('0x5b'),_0xb2a1('0x5c'),{'module':_0xb2a1('0x5d')});})[_0xb2a1('0x1f')](function(){var _0x403f72=_0x1068e7[_0xb2a1('0x5e')]['get']({'plain':!![]});if(!_0x403f72)throw new Error(_0xb2a1('0x5f'));if(_0x403f72['role']===_0xb2a1('0x5e')){var _0x127312=_0x5f298d[_0xb2a1('0x32')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xb2a1('0x33'),'userProfileId':_0x403f72[_0xb2a1('0x60')]},'raw':!![]})[_0xb2a1('0x1f')](function(_0x5b603d){if(_0x5b603d&&_0x5b603d[_0xb2a1('0x61')]===0x0){return db['UserProfileResource'][_0xb2a1('0x5c')]({'name':_0x127312[_0xb2a1('0x36')],'resourceId':_0x127312['id'],'type':_0x5b603d[_0xb2a1('0x36')],'sectionId':_0x5b603d['id']},{})[_0xb2a1('0x1f')](function(){return _0x5f298d;});}else{return _0x5f298d;}})[_0xb2a1('0x54')](function(_0x37677b){logger[_0xb2a1('0x22')](_0xb2a1('0x62'),_0x37677b);throw _0x37677b;});}return _0x5f298d;})[_0xb2a1('0x1f')](respondWithResult(_0x143a81,0xc9))[_0xb2a1('0x54')](handleError(_0x143a81,null));};exports[_0xb2a1('0x30')]=function(_0x77a215,_0x2db62c,_0x5977d5){var _0x4655da;return db[_0xb2a1('0x39')][_0xb2a1('0x53')]({'where':{'id':_0x77a215['params']['id']}})[_0xb2a1('0x1f')](handleEntityNotFound(_0x2db62c,null))['then'](saveUpdates(_0x77a215[_0xb2a1('0x55')],null))[_0xb2a1('0x1f')](function(_0x57941c){if(_0x57941c){_0x4655da=_0x57941c;return db[_0xb2a1('0x39')][_0xb2a1('0x4c')]({'raw':!![]});}})[_0xb2a1('0x1f')](function(_0x1e2625){var _0xc4f809=fs['readFileSync'](path[_0xb2a1('0x63')](config['root'],_0xb2a1('0x58')),_0xb2a1('0x59'));var _0x439752=ejs[_0xb2a1('0x64')](_0xc4f809,{'contexts':_0x1e2625||[]});fs[_0xb2a1('0x5a')](_0xb2a1('0x65'),_0x439752);})[_0xb2a1('0x1f')](function(){return respondWithRpcPromise(_0xb2a1('0x5b'),_0xb2a1('0x30'),{'module':_0xb2a1('0x5d')});})['then'](function(){return _0x4655da;})[_0xb2a1('0x1f')](respondWithResult(_0x2db62c,null))[_0xb2a1('0x54')](handleError(_0x2db62c,null));};exports[_0xb2a1('0x31')]=function(_0x1d3789,_0x22713d,_0x122918){var _0x589a26;return db['VoiceContext'][_0xb2a1('0x53')]({'where':{'id':_0x1d3789['params']['id']}})['then'](handleEntityNotFound(_0x22713d,null))[_0xb2a1('0x1f')](removeEntity(_0x22713d,null))[_0xb2a1('0x1f')](function(){return db['VoiceContext'][_0xb2a1('0x4c')]({'raw':!![]});})[_0xb2a1('0x1f')](function(_0x4e948c){var _0x52cd0e=fs[_0xb2a1('0x56')](path[_0xb2a1('0x63')](config[_0xb2a1('0x57')],'server/files/templates/context.ejs'),_0xb2a1('0x59'));var _0x33a67d=ejs[_0xb2a1('0x64')](_0x52cd0e,{'contexts':_0x4e948c});fs[_0xb2a1('0x5a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x33a67d);return respondWithRpcPromise(_0xb2a1('0x5b'),'destroy',{'module':_0xb2a1('0x5d')});})[_0xb2a1('0x54')](handleError(_0x22713d,null));}; \ No newline at end of file +var _0x6267=['sort','where','pick','filter','merge','VIRTUAL','options','VoiceContext','count','includeAll','rows','show','params','catch','create','body','findAll','join','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','readFileSync','root','utf8','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','jayson/promise','client','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','end','json','offset','undefined','limit','status','apply','reject','save','update','destroy','then','get','Contexts','UserProfileResource','sendStatus','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order'];(function(_0x2fbd82,_0x201f4d){var _0x56bf99=function(_0x3baf30){while(--_0x3baf30){_0x2fbd82['push'](_0x2fbd82['shift']());}};_0x56bf99(++_0x201f4d);}(_0x6267,0x8c));var _0x7626=function(_0x3c4754,_0x995bf7){_0x3c4754=_0x3c4754-0x0;var _0x527934=_0x6267[_0x3c4754];return _0x527934;};'use strict';var emlformat=require(_0x7626('0x0'));var rimraf=require(_0x7626('0x1'));var zipdir=require(_0x7626('0x2'));var jsonpatch=require(_0x7626('0x3'));var rp=require(_0x7626('0x4'));var moment=require(_0x7626('0x5'));var BPromise=require(_0x7626('0x6'));var Mustache=require(_0x7626('0x7'));var util=require('util');var path=require(_0x7626('0x8'));var sox=require(_0x7626('0x9'));var csv=require(_0x7626('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7626('0xb'));var _=require(_0x7626('0xc'));var squel=require('squel');var crypto=require(_0x7626('0xd'));var jsforce=require(_0x7626('0xe'));var deskjs=require(_0x7626('0xf'));var toCsv=require(_0x7626('0xa'));var querystring=require(_0x7626('0x10'));var Papa=require(_0x7626('0x11'));var Redis=require(_0x7626('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7626('0x13'));var as=require(_0x7626('0x14'));var hardwareService=require(_0x7626('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x7626('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7626('0x17'))['db'];var jayson=require(_0x7626('0x18'));var client=jayson[_0x7626('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x492066,_0x6280c6,_0x3fde8d,_0x41ee6b){return new BPromise(function(_0x2a617c,_0x21c7a8){var _0x20df0c=_0x41ee6b||client;return _0x20df0c['request'](_0x492066,_0x3fde8d)['then'](function(_0x29a1dc){logger[_0x7626('0x1a')](_0x7626('0x1b'),_0x6280c6,_0x7626('0x1c'));logger[_0x7626('0x1d')](_0x7626('0x1e'),_0x6280c6,_0x7626('0x1c'),JSON[_0x7626('0x1f')](_0x29a1dc));if(_0x29a1dc[_0x7626('0x20')]){if(_0x29a1dc[_0x7626('0x20')][_0x7626('0x21')]===0x1f4){logger[_0x7626('0x20')]('VoiceContext,\x20%s,\x20%s',_0x6280c6,_0x29a1dc[_0x7626('0x20')][_0x7626('0x22')]);return _0x21c7a8(_0x29a1dc[_0x7626('0x20')][_0x7626('0x22')]);}logger[_0x7626('0x20')](_0x7626('0x1b'),_0x6280c6,_0x29a1dc[_0x7626('0x20')][_0x7626('0x22')]);return _0x2a617c(_0x29a1dc[_0x7626('0x20')]['message']);}else{logger[_0x7626('0x1a')](_0x7626('0x1b'),_0x6280c6,_0x7626('0x1c'));_0x2a617c(_0x29a1dc[_0x7626('0x23')][_0x7626('0x22')]);}})['catch'](function(_0x4bf821){logger[_0x7626('0x20')](_0x7626('0x1b'),_0x6280c6,_0x4bf821);_0x21c7a8(_0x4bf821);});});}function respondWithStatusCode(_0x4f82c7,_0x2268da){_0x2268da=_0x2268da||0xcc;return function(_0x25b3fb){if(_0x25b3fb){return _0x4f82c7['sendStatus'](_0x2268da);}return _0x4f82c7['status'](_0x2268da)[_0x7626('0x24')]();};}function respondWithResult(_0x4bfdbf,_0x451f00){_0x451f00=_0x451f00||0xc8;return function(_0x5c5f6d){if(_0x5c5f6d){return _0x4bfdbf['status'](_0x451f00)[_0x7626('0x25')](_0x5c5f6d);}};}function respondWithFilteredResult(_0xf04446,_0x57393a){return function(_0x556f46){if(_0x556f46){var _0x2c74ec=typeof _0x57393a[_0x7626('0x26')]===_0x7626('0x27')&&typeof _0x57393a[_0x7626('0x28')]===_0x7626('0x27');var _0x5c8eba=_0x556f46['count'];var _0xfef3cb=_0x2c74ec?0x0:_0x57393a[_0x7626('0x26')];var _0x3b2ef5=_0x2c74ec?_0x556f46['count']:_0x57393a[_0x7626('0x26')]+_0x57393a[_0x7626('0x28')];var _0x3d02e6;if(_0x3b2ef5>=_0x5c8eba){_0x3b2ef5=_0x5c8eba;_0x3d02e6=0xc8;}else{_0x3d02e6=0xce;}_0xf04446[_0x7626('0x29')](_0x3d02e6);return _0xf04446['set']('Content-Range',_0xfef3cb+'-'+_0x3b2ef5+'/'+_0x5c8eba)['json'](_0x556f46);}return null;};}function patchUpdates(_0x52d2a9){return function(_0xd270ac){try{jsonpatch[_0x7626('0x2a')](_0xd270ac,_0x52d2a9,!![]);}catch(_0x380ea7){return BPromise[_0x7626('0x2b')](_0x380ea7);}return _0xd270ac[_0x7626('0x2c')]();};}function saveUpdates(_0x55afc6,_0x31175f){return function(_0x12c4bc){if(_0x12c4bc){return _0x12c4bc[_0x7626('0x2d')](_0x55afc6)['then'](function(_0x20f14){return _0x20f14;});}return null;};}function removeEntity(_0x3b1aa5,_0x52b110){return function(_0x3e9b98){if(_0x3e9b98){return _0x3e9b98[_0x7626('0x2e')]()[_0x7626('0x2f')](function(){var _0x1f308d=_0x3e9b98[_0x7626('0x30')]({'plain':!![]});var _0x2108a6=_0x7626('0x31');return db[_0x7626('0x32')][_0x7626('0x2e')]({'where':{'type':_0x2108a6,'resourceId':_0x1f308d['id']}})['then'](function(){return _0x3e9b98;});})[_0x7626('0x2f')](function(){_0x3b1aa5[_0x7626('0x29')](0xcc)[_0x7626('0x24')]();});}};}function handleEntityNotFound(_0x29d89d,_0x4d0421){return function(_0x1e9702){if(!_0x1e9702){_0x29d89d[_0x7626('0x33')](0x194);}return _0x1e9702;};}function handleError(_0x16818c,_0xd0dc32){_0xd0dc32=_0xd0dc32||0x1f4;return function(_0x1385a1){logger[_0x7626('0x20')](_0x1385a1[_0x7626('0x34')]);if(_0x1385a1['name']){delete _0x1385a1[_0x7626('0x35')];}_0x16818c[_0x7626('0x29')](_0xd0dc32)['send'](_0x1385a1);};}exports[_0x7626('0x36')]=function(_0x2a308e,_0x4dbbf4){var _0x507264={},_0x14f6cb={},_0x430a6f={'count':0x0,'rows':[]};var _0x561e5d=_['map'](db['VoiceContext'][_0x7626('0x37')],function(_0x4176f1){return{'name':_0x4176f1[_0x7626('0x38')],'type':_0x4176f1[_0x7626('0x39')][_0x7626('0x3a')]};});_0x14f6cb[_0x7626('0x3b')]=_[_0x7626('0x3c')](_0x561e5d,_0x7626('0x35'));_0x14f6cb[_0x7626('0x3d')]=_[_0x7626('0x3e')](_0x2a308e[_0x7626('0x3d')]);_0x14f6cb[_0x7626('0x3f')]=_[_0x7626('0x40')](_0x14f6cb[_0x7626('0x3b')],_0x14f6cb['query']);_0x507264[_0x7626('0x41')]=_[_0x7626('0x40')](_0x14f6cb[_0x7626('0x3b')],qs['fields'](_0x2a308e[_0x7626('0x3d')][_0x7626('0x42')]));_0x507264[_0x7626('0x41')]=_0x507264[_0x7626('0x41')][_0x7626('0x43')]?_0x507264[_0x7626('0x41')]:_0x14f6cb[_0x7626('0x3b')];if(!_0x2a308e['query']['hasOwnProperty'](_0x7626('0x44'))){_0x507264[_0x7626('0x28')]=qs[_0x7626('0x28')](_0x2a308e[_0x7626('0x3d')][_0x7626('0x28')]);_0x507264[_0x7626('0x26')]=qs[_0x7626('0x26')](_0x2a308e['query']['offset']);}_0x507264[_0x7626('0x45')]=qs[_0x7626('0x46')](_0x2a308e['query'][_0x7626('0x46')]);_0x507264[_0x7626('0x47')]=qs['filters'](_[_0x7626('0x48')](_0x2a308e[_0x7626('0x3d')],_0x14f6cb['filters']),_0x561e5d);if(_0x2a308e[_0x7626('0x3d')][_0x7626('0x49')]){_0x507264['where']=_[_0x7626('0x4a')](_0x507264[_0x7626('0x47')],{'$or':_[_0x7626('0x3c')](_0x561e5d,function(_0x47a40c){if(_0x47a40c[_0x7626('0x39')]!==_0x7626('0x4b')){var _0x4da8f7={};_0x4da8f7[_0x47a40c[_0x7626('0x35')]]={'$like':'%'+_0x2a308e['query'][_0x7626('0x49')]+'%'};return _0x4da8f7;}})});}_0x507264=_['merge']({},_0x507264,_0x2a308e[_0x7626('0x4c')]);var _0x1e5355={'where':_0x507264['where']};return db[_0x7626('0x4d')][_0x7626('0x4e')](_0x1e5355)['then'](function(_0x4c66d9){_0x430a6f[_0x7626('0x4e')]=_0x4c66d9;if(_0x2a308e['query'][_0x7626('0x4f')]){_0x507264['include']=[{'all':!![]}];}return db['VoiceContext']['findAll'](_0x507264);})['then'](function(_0x383db3){_0x430a6f[_0x7626('0x50')]=_0x383db3;return _0x430a6f;})[_0x7626('0x2f')](respondWithFilteredResult(_0x4dbbf4,_0x507264))['catch'](handleError(_0x4dbbf4,null));};exports[_0x7626('0x51')]=function(_0x4bb7dc,_0x755e93){var _0xe134e9={'raw':![],'where':{'id':_0x4bb7dc[_0x7626('0x52')]['id']}},_0xb9bdec={};_0xb9bdec['model']=_['keys'](db['VoiceContext'][_0x7626('0x37')]);_0xb9bdec['query']=_[_0x7626('0x3e')](_0x4bb7dc[_0x7626('0x3d')]);_0xb9bdec['filters']=_['intersection'](_0xb9bdec['model'],_0xb9bdec[_0x7626('0x3d')]);_0xe134e9[_0x7626('0x41')]=_['intersection'](_0xb9bdec['model'],qs[_0x7626('0x42')](_0x4bb7dc[_0x7626('0x3d')][_0x7626('0x42')]));_0xe134e9[_0x7626('0x41')]=_0xe134e9[_0x7626('0x41')][_0x7626('0x43')]?_0xe134e9[_0x7626('0x41')]:_0xb9bdec[_0x7626('0x3b')];if(_0x4bb7dc['query'][_0x7626('0x4f')]){_0xe134e9['include']=[{'all':!![]}];}_0xe134e9=_[_0x7626('0x4a')]({},_0xe134e9,_0x4bb7dc[_0x7626('0x4c')]);return db[_0x7626('0x4d')]['find'](_0xe134e9)[_0x7626('0x2f')](handleEntityNotFound(_0x755e93,null))['then'](respondWithResult(_0x755e93,null))[_0x7626('0x53')](handleError(_0x755e93,null));};exports[_0x7626('0x54')]=function(_0x3ed5d9,_0x3c064b,_0x49ac2a){var _0x21ebdf;return db[_0x7626('0x4d')][_0x7626('0x54')](_0x3ed5d9[_0x7626('0x55')],{'raw':!![]})[_0x7626('0x2f')](function(_0x10a79e){_0x21ebdf=_0x10a79e;return db[_0x7626('0x4d')][_0x7626('0x56')]({'raw':!![]});})['then'](function(_0x272000){var _0x229e31=fs['readFileSync'](path[_0x7626('0x57')](config['root'],_0x7626('0x58')),'utf8');var _0x581b82=ejs[_0x7626('0x59')](_0x229e31,{'contexts':_0x272000||[]});fs[_0x7626('0x5a')](_0x7626('0x5b'),_0x581b82);})[_0x7626('0x2f')](function(){return respondWithRpcPromise(_0x7626('0x5c'),_0x7626('0x54'),{'module':'chan_sip.so'});})[_0x7626('0x2f')](function(){var _0x493b35=_0x3ed5d9['user'][_0x7626('0x30')]({'plain':!![]});if(!_0x493b35)throw new Error(_0x7626('0x5d'));if(_0x493b35[_0x7626('0x5e')]===_0x7626('0x5f')){var _0x121592=_0x21ebdf[_0x7626('0x30')]({'plain':!![]});return db[_0x7626('0x60')]['find']({'where':{'name':_0x7626('0x31'),'userProfileId':_0x493b35[_0x7626('0x61')]},'raw':!![]})[_0x7626('0x2f')](function(_0x206ea9){if(_0x206ea9&&_0x206ea9[_0x7626('0x62')]===0x0){return db[_0x7626('0x32')][_0x7626('0x54')]({'name':_0x121592[_0x7626('0x35')],'resourceId':_0x121592['id'],'type':_0x206ea9[_0x7626('0x35')],'sectionId':_0x206ea9['id']},{})[_0x7626('0x2f')](function(){return _0x21ebdf;});}else{return _0x21ebdf;}})[_0x7626('0x53')](function(_0x1155ed){logger[_0x7626('0x20')](_0x7626('0x63'),_0x1155ed);throw _0x1155ed;});}return _0x21ebdf;})[_0x7626('0x2f')](respondWithResult(_0x3c064b,0xc9))['catch'](handleError(_0x3c064b,null));};exports[_0x7626('0x2d')]=function(_0x19d351,_0x155b5b,_0x1b65e9){var _0x5bc90f;return db[_0x7626('0x4d')][_0x7626('0x64')]({'where':{'id':_0x19d351[_0x7626('0x52')]['id']}})[_0x7626('0x2f')](handleEntityNotFound(_0x155b5b,null))['then'](saveUpdates(_0x19d351[_0x7626('0x55')],null))[_0x7626('0x2f')](function(_0x1c8428){if(_0x1c8428){_0x5bc90f=_0x1c8428;return db[_0x7626('0x4d')][_0x7626('0x56')]({'raw':!![]});}})[_0x7626('0x2f')](function(_0xd87e03){var _0x169c75=fs[_0x7626('0x65')](path[_0x7626('0x57')](config[_0x7626('0x66')],_0x7626('0x58')),_0x7626('0x67'));var _0x3d68f4=ejs[_0x7626('0x59')](_0x169c75,{'contexts':_0xd87e03||[]});fs[_0x7626('0x5a')](_0x7626('0x5b'),_0x3d68f4);})[_0x7626('0x2f')](function(){return respondWithRpcPromise(_0x7626('0x5c'),'update',{'module':_0x7626('0x68')});})[_0x7626('0x2f')](function(){return _0x5bc90f;})[_0x7626('0x2f')](respondWithResult(_0x155b5b,null))[_0x7626('0x53')](handleError(_0x155b5b,null));};exports[_0x7626('0x2e')]=function(_0x4332b3,_0x188181,_0x151723){var _0x173070;return db['VoiceContext'][_0x7626('0x64')]({'where':{'id':_0x4332b3[_0x7626('0x52')]['id']}})[_0x7626('0x2f')](handleEntityNotFound(_0x188181,null))[_0x7626('0x2f')](removeEntity(_0x188181,null))[_0x7626('0x2f')](function(){return db[_0x7626('0x4d')][_0x7626('0x56')]({'raw':!![]});})[_0x7626('0x2f')](function(_0x59c303){var _0x94c9c4=fs['readFileSync'](path[_0x7626('0x57')](config['root'],_0x7626('0x58')),'utf8');var _0x3ca904=ejs[_0x7626('0x59')](_0x94c9c4,{'contexts':_0x59c303});fs[_0x7626('0x5a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3ca904);return respondWithRpcPromise(_0x7626('0x5c'),_0x7626('0x2e'),{'module':_0x7626('0x68')});})[_0x7626('0x53')](handleError(_0x188181,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 882c7d1..de0ed15 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 _0x1876=['bluebird','request-promise','path','rimraf','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger'];(function(_0x3f83ba,_0x11110d){var _0x31bc0a=function(_0x545f06){while(--_0x545f06){_0x3f83ba['push'](_0x3f83ba['shift']());}};_0x31bc0a(++_0x11110d);}(_0x1876,0x99));var _0x6187=function(_0x2f676e,_0x43d0bd){_0x2f676e=_0x2f676e-0x0;var _0x447c2a=_0x1876[_0x2f676e];return _0x447c2a;};'use strict';var _=require(_0x6187('0x0'));var util=require(_0x6187('0x1'));var logger=require(_0x6187('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6187('0x3'));var rp=require(_0x6187('0x4'));var fs=require('fs');var path=require(_0x6187('0x5'));var rimraf=require(_0x6187('0x6'));var config=require('../../config/environment');var attributes=require(_0x6187('0x7'));module[_0x6187('0x8')]=function(_0x2af574,_0x2a4284){return _0x2af574[_0x6187('0x9')](_0x6187('0xa'),attributes,{'tableName':_0x6187('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe5fe=['../../config/logger','api','request-promise','rimraf','./voiceContext.attributes','define','VoiceContext','lodash','util'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xe5fe,0x6a));var _0xee5f=function(_0x225e96,_0x38c4e9){_0x225e96=_0x225e96-0x0;var _0x5ea9be=_0xe5fe[_0x225e96];return _0x5ea9be;};'use strict';var _=require(_0xee5f('0x0'));var util=require(_0xee5f('0x1'));var logger=require(_0xee5f('0x2'))(_0xee5f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xee5f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xee5f('0x5'));var config=require('../../config/environment');var attributes=require(_0xee5f('0x6'));module['exports']=function(_0xa99bb9,_0x261f62){return _0xa99bb9[_0xee5f('0x7')](_0xee5f('0x8'),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 996398c..64514fc 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 _0xbe58=['VoiceContext,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xbe58,0x19f));var _0x8be5=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xbe58[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8be5('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8be5('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x8be5('0x2'));var logger=require(_0x8be5('0x3'))(_0x8be5('0x4'));var config=require(_0x8be5('0x5'));var jayson=require(_0x8be5('0x6'));var client=jayson[_0x8be5('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fdbb6,_0x61c95,_0x22ed1f){return new BPromise(function(_0xb9d4df,_0x9d6c40){return client[_0x8be5('0x8')](_0x4fdbb6,_0x22ed1f)['then'](function(_0x364658){logger[_0x8be5('0x9')](_0x8be5('0xa'),_0x61c95,_0x8be5('0xb'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x61c95,_0x8be5('0xb'),JSON['stringify'](_0x364658));if(_0x364658[_0x8be5('0xc')]){if(_0x364658[_0x8be5('0xc')][_0x8be5('0xd')]===0x1f4){logger[_0x8be5('0xc')](_0x8be5('0xa'),_0x61c95,_0x364658['error'][_0x8be5('0xe')]);return _0x9d6c40(_0x364658[_0x8be5('0xc')]['message']);}logger[_0x8be5('0xc')](_0x8be5('0xa'),_0x61c95,_0x364658['error']['message']);return _0xb9d4df(_0x364658['error'][_0x8be5('0xe')]);}else{logger[_0x8be5('0x9')](_0x8be5('0xa'),_0x61c95,_0x8be5('0xb'));_0xb9d4df(_0x364658[_0x8be5('0xf')][_0x8be5('0xe')]);}})[_0x8be5('0x10')](function(_0x3ea19c){logger['error'](_0x8be5('0xa'),_0x61c95,_0x3ea19c);_0x9d6c40(_0x3ea19c);});});} \ No newline at end of file +var _0x1dcc=['request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','error','message','result','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s'];(function(_0x1be311,_0x37b4fe){var _0x518d9a=function(_0x2f4f29){while(--_0x2f4f29){_0x1be311['push'](_0x1be311['shift']());}};_0x518d9a(++_0x37b4fe);}(_0x1dcc,0x77));var _0xc1dc=function(_0xc7ab0e,_0x20e4e6){_0xc7ab0e=_0xc7ab0e-0x0;var _0x5b97d9=_0x1dcc[_0xc7ab0e];return _0x5b97d9;};'use strict';var _=require(_0xc1dc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc1dc('0x1'));var rs=require(_0xc1dc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc1dc('0x3'));var logger=require(_0xc1dc('0x4'))(_0xc1dc('0x5'));var config=require(_0xc1dc('0x6'));var jayson=require(_0xc1dc('0x7'));var client=jayson[_0xc1dc('0x8')][_0xc1dc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5867ea,_0x1a08cf,_0x5bc085){return new BPromise(function(_0x2544d4,_0x419ef4){return client[_0xc1dc('0xa')](_0x5867ea,_0x5bc085)[_0xc1dc('0xb')](function(_0x4e88d4){logger[_0xc1dc('0xc')](_0xc1dc('0xd'),_0x1a08cf,_0xc1dc('0xe'));logger['debug'](_0xc1dc('0xf'),_0x1a08cf,_0xc1dc('0xe'),JSON['stringify'](_0x4e88d4));if(_0x4e88d4[_0xc1dc('0x10')]){if(_0x4e88d4[_0xc1dc('0x10')]['code']===0x1f4){logger[_0xc1dc('0x10')](_0xc1dc('0xd'),_0x1a08cf,_0x4e88d4[_0xc1dc('0x10')][_0xc1dc('0x11')]);return _0x419ef4(_0x4e88d4[_0xc1dc('0x10')][_0xc1dc('0x11')]);}logger[_0xc1dc('0x10')]('VoiceContext,\x20%s,\x20%s',_0x1a08cf,_0x4e88d4[_0xc1dc('0x10')][_0xc1dc('0x11')]);return _0x2544d4(_0x4e88d4[_0xc1dc('0x10')][_0xc1dc('0x11')]);}else{logger[_0xc1dc('0xc')](_0xc1dc('0xd'),_0x1a08cf,_0xc1dc('0xe'));_0x2544d4(_0x4e88d4[_0xc1dc('0x12')]['message']);}})['catch'](function(_0x4b9832){logger['error'](_0xc1dc('0xd'),_0x1a08cf,_0x4b9832);_0x419ef4(_0x4b9832);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 5d85f93..b1fafa1 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 _0xe725=['get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceDialReport.controller'];(function(_0x492ed8,_0x2d1966){var _0x3d8503=function(_0x5dc69a){while(--_0x5dc69a){_0x492ed8['push'](_0x492ed8['shift']());}};_0x3d8503(++_0x2d1966);}(_0xe725,0x109));var _0x5e72=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xe725[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x5e72('0x0'));var util=require(_0x5e72('0x1'));var path=require('path');var timeout=require(_0x5e72('0x2'));var express=require(_0x5e72('0x3'));var router=express['Router']();var fs_extra=require(_0x5e72('0x4'));var auth=require(_0x5e72('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5e72('0x6'));var controller=require(_0x5e72('0x7'));router[_0x5e72('0x8')]('/',auth[_0x5e72('0x9')](),controller[_0x5e72('0xa')]);router[_0x5e72('0x8')](_0x5e72('0xb'),auth['isAuthenticated'](),controller[_0x5e72('0xc')]);router['get'](_0x5e72('0xd'),auth[_0x5e72('0x9')](),controller[_0x5e72('0xe')]);router[_0x5e72('0xf')]('/',auth['isAuthenticated'](),controller[_0x5e72('0x10')]);router[_0x5e72('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x5e72('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x5e72('0x13')]);module[_0x5e72('0x14')]=router; \ No newline at end of file +var _0x754e=['Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/:id','show','put','delete','exports','util','path','connect-timeout','express'];(function(_0xf73c09,_0x4e424e){var _0xa8923c=function(_0x4831c1){while(--_0x4831c1){_0xf73c09['push'](_0xf73c09['shift']());}};_0xa8923c(++_0x4e424e);}(_0x754e,0xa6));var _0xe754=function(_0x46f529,_0x136f40){_0x46f529=_0x46f529-0x0;var _0x4a0ef7=_0x754e[_0x46f529];return _0x4a0ef7;};'use strict';var multer=require('multer');var util=require(_0xe754('0x0'));var path=require(_0xe754('0x1'));var timeout=require(_0xe754('0x2'));var express=require(_0xe754('0x3'));var router=express[_0xe754('0x4')]();var fs_extra=require(_0xe754('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe754('0x6'));var config=require(_0xe754('0x7'));var controller=require(_0xe754('0x8'));router[_0xe754('0x9')]('/',auth[_0xe754('0xa')](),controller[_0xe754('0xb')]);router['get']('/describe',auth[_0xe754('0xa')](),controller['describe']);router[_0xe754('0x9')](_0xe754('0xc'),auth[_0xe754('0xa')](),controller[_0xe754('0xd')]);router['post']('/',auth[_0xe754('0xa')](),controller['create']);router[_0xe754('0xe')](_0xe754('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xe754('0xf')](_0xe754('0xc'),auth[_0xe754('0xa')](),controller['destroy']);module[_0xe754('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index ca7a935..50060e8 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 _0x9a19=['sequelize','exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x4dc7bb,_0x224c6e){var _0x30bd46=function(_0x386111){while(--_0x386111){_0x4dc7bb['push'](_0x4dc7bb['shift']());}};_0x30bd46(++_0x224c6e);}(_0x9a19,0x114));var _0x99a1=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9a19[_0x8c43de];return _0xa6591b;};'use strict';var Sequelize=require(_0x99a1('0x0'));module[_0x99a1('0x1')]={'privilege':{'type':Sequelize[_0x99a1('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x99a1('0x3')]},'channelstatedesc':{'type':Sequelize[_0x99a1('0x2')]},'calleridnum':{'type':Sequelize[_0x99a1('0x2')]},'calleridname':{'type':Sequelize[_0x99a1('0x2')]},'connectedlinenum':{'type':Sequelize[_0x99a1('0x2')]},'connectedlinename':{'type':Sequelize[_0x99a1('0x2')]},'language':{'type':Sequelize[_0x99a1('0x2')]},'accountcode':{'type':Sequelize[_0x99a1('0x2')]},'context':{'type':Sequelize[_0x99a1('0x2')]},'exten':{'type':Sequelize[_0x99a1('0x2')]},'priority':{'type':Sequelize[_0x99a1('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x99a1('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x99a1('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x99a1('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x99a1('0x2')]},'destlanguage':{'type':Sequelize[_0x99a1('0x2')]},'destaccountcode':{'type':Sequelize[_0x99a1('0x2')]},'destcontext':{'type':Sequelize[_0x99a1('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x99a1('0x3')]},'destuniqueid':{'type':Sequelize[_0x99a1('0x2')]},'destlinkedid':{'type':Sequelize[_0x99a1('0x2')]},'dialstring':{'type':Sequelize[_0x99a1('0x2')]},'dialstatus':{'type':Sequelize[_0x99a1('0x2')]},'starttime':{'type':Sequelize[_0x99a1('0x4')]},'answertime':{'type':Sequelize[_0x99a1('0x4')]},'endtime':{'type':Sequelize[_0x99a1('0x4')]},'lastevent':{'type':Sequelize[_0x99a1('0x2')],'comment':_0x99a1('0x5')},'routeId':{'type':Sequelize[_0x99a1('0x3')]},'duration':{'type':Sequelize[_0x99a1('0x3')]},'holdtime':{'type':Sequelize[_0x99a1('0x3')]},'billableseconds':{'type':Sequelize[_0x99a1('0x3')]}}; \ No newline at end of file +var _0x3e74=['DATE','sequelize','STRING','INTEGER'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x3e74,0x175));var _0x43e7=function(_0x362efa,_0x11fcd6){_0x362efa=_0x362efa-0x0;var _0xaf2c97=_0x3e74[_0x362efa];return _0xaf2c97;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x43e7('0x1')]},'channel':{'type':Sequelize[_0x43e7('0x1')]},'channelstate':{'type':Sequelize[_0x43e7('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x43e7('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x43e7('0x1')]},'language':{'type':Sequelize[_0x43e7('0x1')]},'accountcode':{'type':Sequelize[_0x43e7('0x1')]},'context':{'type':Sequelize[_0x43e7('0x1')]},'exten':{'type':Sequelize[_0x43e7('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x43e7('0x1')]},'linkedid':{'type':Sequelize[_0x43e7('0x1')]},'destchannel':{'type':Sequelize[_0x43e7('0x1')]},'destchannelstate':{'type':Sequelize[_0x43e7('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x43e7('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x43e7('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x43e7('0x1')]},'destaccountcode':{'type':Sequelize[_0x43e7('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x43e7('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x43e7('0x1')]},'destlinkedid':{'type':Sequelize[_0x43e7('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x43e7('0x1')]},'starttime':{'type':Sequelize[_0x43e7('0x3')]},'answertime':{'type':Sequelize[_0x43e7('0x3')]},'endtime':{'type':Sequelize[_0x43e7('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x43e7('0x2')]},'duration':{'type':Sequelize[_0x43e7('0x2')]},'holdtime':{'type':Sequelize[_0x43e7('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 9c530c0..b9f63d2 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 _0x4afe=['then','end','stack','name','send','map','VoiceDialReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','describe','request-promise','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x4afe,0x136));var _0xe4af=function(_0x52899d,_0x5ade7e){_0x52899d=_0x52899d-0x0;var _0x1a4d20=_0x4afe[_0x52899d];return _0x1a4d20;};'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(_0xe4af('0x0'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xe4af('0x1'));var sox=require(_0xe4af('0x2'));var csv=require(_0xe4af('0x3'));var ejs=require(_0xe4af('0x4'));var fs=require('fs');var fs_extra=require(_0xe4af('0x5'));var _=require(_0xe4af('0x6'));var squel=require(_0xe4af('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe4af('0x8'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe4af('0x9'));var Redis=require(_0xe4af('0xa'));var authService=require(_0xe4af('0xb'));var qs=require(_0xe4af('0xc'));var as=require(_0xe4af('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xe4af('0xe'));var config=require('../../config/environment');var licenseUtil=require(_0xe4af('0xf'));var db=require(_0xe4af('0x10'))['db'];function respondWithStatusCode(_0x5bcfb7,_0x52b487){_0x52b487=_0x52b487||0xcc;return function(_0x333fa8){if(_0x333fa8){return _0x5bcfb7[_0xe4af('0x11')](_0x52b487);}return _0x5bcfb7[_0xe4af('0x12')](_0x52b487)['end']();};}function respondWithResult(_0x51ac54,_0x53bdb1){_0x53bdb1=_0x53bdb1||0xc8;return function(_0x586787){if(_0x586787){return _0x51ac54[_0xe4af('0x12')](_0x53bdb1)[_0xe4af('0x13')](_0x586787);}};}function respondWithFilteredResult(_0x547083,_0x14c813){return function(_0x45e47e){if(_0x45e47e){var _0xe44a64=typeof _0x14c813['offset']===_0xe4af('0x14')&&typeof _0x14c813[_0xe4af('0x15')]===_0xe4af('0x14');var _0x220c0c=_0x45e47e['count'];var _0x48946a=_0xe44a64?0x0:_0x14c813['offset'];var _0x30e212=_0xe44a64?_0x45e47e[_0xe4af('0x16')]:_0x14c813[_0xe4af('0x17')]+_0x14c813[_0xe4af('0x15')];var _0x591811;if(_0x30e212>=_0x220c0c){_0x30e212=_0x220c0c;_0x591811=0xc8;}else{_0x591811=0xce;}_0x547083['status'](_0x591811);return _0x547083[_0xe4af('0x18')](_0xe4af('0x19'),_0x48946a+'-'+_0x30e212+'/'+_0x220c0c)[_0xe4af('0x13')](_0x45e47e);}return null;};}function patchUpdates(_0xd2c6bd){return function(_0x39ea79){try{jsonpatch[_0xe4af('0x1a')](_0x39ea79,_0xd2c6bd,!![]);}catch(_0x1c74de){return BPromise[_0xe4af('0x1b')](_0x1c74de);}return _0x39ea79[_0xe4af('0x1c')]();};}function saveUpdates(_0x567fae,_0x2e9b04){return function(_0x381e3a){if(_0x381e3a){return _0x381e3a[_0xe4af('0x1d')](_0x567fae)[_0xe4af('0x1e')](function(_0x346f45){return _0x346f45;});}return null;};}function removeEntity(_0x3cfce9,_0x556ee4){return function(_0x592d85){if(_0x592d85){return _0x592d85['destroy']()[_0xe4af('0x1e')](function(){_0x3cfce9[_0xe4af('0x12')](0xcc)[_0xe4af('0x1f')]();});}};}function handleEntityNotFound(_0xf0361c,_0x2a5cc8){return function(_0x2c898b){if(!_0x2c898b){_0xf0361c['sendStatus'](0x194);}return _0x2c898b;};}function handleError(_0xf0166f,_0x491be5){_0x491be5=_0x491be5||0x1f4;return function(_0xafe19f){logger['error'](_0xafe19f[_0xe4af('0x20')]);if(_0xafe19f[_0xe4af('0x21')]){delete _0xafe19f[_0xe4af('0x21')];}_0xf0166f[_0xe4af('0x12')](_0x491be5)[_0xe4af('0x22')](_0xafe19f);};}exports['index']=function(_0x47474b,_0x24142a){var _0x5c8952={},_0x459517={},_0x6f985c={'count':0x0,'rows':[]};var _0x8294fe=_[_0xe4af('0x23')](db[_0xe4af('0x24')][_0xe4af('0x25')],function(_0x3f5a57){return{'name':_0x3f5a57[_0xe4af('0x26')],'type':_0x3f5a57[_0xe4af('0x27')]['key']};});_0x459517[_0xe4af('0x28')]=_['map'](_0x8294fe,_0xe4af('0x21'));_0x459517[_0xe4af('0x29')]=_[_0xe4af('0x2a')](_0x47474b[_0xe4af('0x29')]);_0x459517[_0xe4af('0x2b')]=_['intersection'](_0x459517[_0xe4af('0x28')],_0x459517['query']);_0x5c8952[_0xe4af('0x2c')]=_[_0xe4af('0x2d')](_0x459517[_0xe4af('0x28')],qs[_0xe4af('0x2e')](_0x47474b['query'][_0xe4af('0x2e')]));_0x5c8952[_0xe4af('0x2c')]=_0x5c8952[_0xe4af('0x2c')][_0xe4af('0x2f')]?_0x5c8952[_0xe4af('0x2c')]:_0x459517['model'];if(!_0x47474b[_0xe4af('0x29')][_0xe4af('0x30')](_0xe4af('0x31'))){_0x5c8952[_0xe4af('0x15')]=qs[_0xe4af('0x15')](_0x47474b[_0xe4af('0x29')][_0xe4af('0x15')]);_0x5c8952[_0xe4af('0x17')]=qs[_0xe4af('0x17')](_0x47474b[_0xe4af('0x29')]['offset']);}_0x5c8952[_0xe4af('0x32')]=qs['sort'](_0x47474b[_0xe4af('0x29')][_0xe4af('0x33')]);_0x5c8952[_0xe4af('0x34')]=qs[_0xe4af('0x2b')](_[_0xe4af('0x35')](_0x47474b[_0xe4af('0x29')],_0x459517[_0xe4af('0x2b')]),_0x8294fe);if(_0x47474b[_0xe4af('0x29')][_0xe4af('0x36')]){_0x5c8952[_0xe4af('0x34')]=_[_0xe4af('0x37')](_0x5c8952[_0xe4af('0x34')],{'$or':_[_0xe4af('0x23')](_0x8294fe,function(_0xbe0ae7){if(_0xbe0ae7[_0xe4af('0x27')]!==_0xe4af('0x38')){var _0x9df978={};_0x9df978[_0xbe0ae7['name']]={'$like':'%'+_0x47474b['query'][_0xe4af('0x36')]+'%'};return _0x9df978;}})});}_0x5c8952=_[_0xe4af('0x37')]({},_0x5c8952,_0x47474b[_0xe4af('0x39')]);var _0x187521={'where':_0x5c8952['where']};return db[_0xe4af('0x24')][_0xe4af('0x16')](_0x187521)[_0xe4af('0x1e')](function(_0x3de073){_0x6f985c['count']=_0x3de073;if(_0x47474b[_0xe4af('0x29')][_0xe4af('0x3a')]){_0x5c8952[_0xe4af('0x3b')]=[{'all':!![]}];}return db[_0xe4af('0x24')]['findAll'](_0x5c8952);})['then'](function(_0x18aa9b){_0x6f985c[_0xe4af('0x3c')]=_0x18aa9b;return _0x6f985c;})[_0xe4af('0x1e')](respondWithFilteredResult(_0x24142a,_0x5c8952))[_0xe4af('0x3d')](handleError(_0x24142a,null));};exports[_0xe4af('0x3e')]=function(_0x4afe6a,_0x425dce){var _0x4f9f23={'raw':!![],'where':{'id':_0x4afe6a[_0xe4af('0x3f')]['id']}},_0x24f588={};_0x24f588[_0xe4af('0x28')]=_[_0xe4af('0x2a')](db[_0xe4af('0x24')][_0xe4af('0x25')]);_0x24f588[_0xe4af('0x29')]=_[_0xe4af('0x2a')](_0x4afe6a[_0xe4af('0x29')]);_0x24f588[_0xe4af('0x2b')]=_[_0xe4af('0x2d')](_0x24f588[_0xe4af('0x28')],_0x24f588[_0xe4af('0x29')]);_0x4f9f23[_0xe4af('0x2c')]=_[_0xe4af('0x2d')](_0x24f588[_0xe4af('0x28')],qs[_0xe4af('0x2e')](_0x4afe6a[_0xe4af('0x29')][_0xe4af('0x2e')]));_0x4f9f23[_0xe4af('0x2c')]=_0x4f9f23[_0xe4af('0x2c')][_0xe4af('0x2f')]?_0x4f9f23[_0xe4af('0x2c')]:_0x24f588[_0xe4af('0x28')];if(_0x4afe6a[_0xe4af('0x29')][_0xe4af('0x3a')]){_0x4f9f23[_0xe4af('0x3b')]=[{'all':!![]}];}_0x4f9f23=_['merge']({},_0x4f9f23,_0x4afe6a[_0xe4af('0x39')]);return db[_0xe4af('0x24')][_0xe4af('0x40')](_0x4f9f23)[_0xe4af('0x1e')](handleEntityNotFound(_0x425dce,null))[_0xe4af('0x1e')](respondWithResult(_0x425dce,null))[_0xe4af('0x3d')](handleError(_0x425dce,null));};exports[_0xe4af('0x41')]=function(_0x3ee0c8,_0x4f27e2){return db[_0xe4af('0x24')][_0xe4af('0x41')](_0x3ee0c8[_0xe4af('0x42')],{})[_0xe4af('0x1e')](respondWithResult(_0x4f27e2,0xc9))[_0xe4af('0x3d')](handleError(_0x4f27e2,null));};exports[_0xe4af('0x1d')]=function(_0x28f368,_0x1df7b4){if(_0x28f368[_0xe4af('0x42')]['id']){delete _0x28f368[_0xe4af('0x42')]['id'];}return db[_0xe4af('0x24')][_0xe4af('0x40')]({'where':{'id':_0x28f368[_0xe4af('0x3f')]['id']}})[_0xe4af('0x1e')](handleEntityNotFound(_0x1df7b4,null))[_0xe4af('0x1e')](saveUpdates(_0x28f368[_0xe4af('0x42')],null))[_0xe4af('0x1e')](respondWithResult(_0x1df7b4,null))[_0xe4af('0x3d')](handleError(_0x1df7b4,null));};exports['destroy']=function(_0x5009b1,_0x2eeb97){return db['VoiceDialReport'][_0xe4af('0x40')]({'where':{'id':_0x5009b1['params']['id']}})[_0xe4af('0x1e')](handleEntityNotFound(_0x2eeb97,null))[_0xe4af('0x1e')](removeEntity(_0x2eeb97,null))[_0xe4af('0x3d')](handleError(_0x2eeb97,null));};exports['describe']=function(_0x5d3a64,_0x44473f){return db[_0xe4af('0x24')][_0xe4af('0x43')]()['then'](respondWithResult(_0x44473f,null))[_0xe4af('0x3d')](handleError(_0x44473f,null));}; \ No newline at end of file +var _0xb371=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','stack','name','send','index','map','rawAttributes','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','VoiceDialReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','describe','rimraf'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb371,0x97));var _0x1b37=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xb371[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b37('0x0'));var zipdir=require(_0x1b37('0x1'));var jsonpatch=require(_0x1b37('0x2'));var rp=require(_0x1b37('0x3'));var moment=require(_0x1b37('0x4'));var BPromise=require(_0x1b37('0x5'));var Mustache=require('mustache');var util=require(_0x1b37('0x6'));var path=require(_0x1b37('0x7'));var sox=require(_0x1b37('0x8'));var csv=require(_0x1b37('0x9'));var ejs=require(_0x1b37('0xa'));var fs=require('fs');var fs_extra=require(_0x1b37('0xb'));var _=require('lodash');var squel=require(_0x1b37('0xc'));var crypto=require(_0x1b37('0xd'));var jsforce=require(_0x1b37('0xe'));var deskjs=require(_0x1b37('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1b37('0x10'));var authService=require(_0x1b37('0x11'));var qs=require(_0x1b37('0x12'));var as=require(_0x1b37('0x13'));var hardwareService=require(_0x1b37('0x14'));var logger=require(_0x1b37('0x15'))('api');var utils=require(_0x1b37('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1b37('0x17'))['db'];function respondWithStatusCode(_0xc24133,_0x56a3dc){_0x56a3dc=_0x56a3dc||0xcc;return function(_0x4e769a){if(_0x4e769a){return _0xc24133[_0x1b37('0x18')](_0x56a3dc);}return _0xc24133[_0x1b37('0x19')](_0x56a3dc)[_0x1b37('0x1a')]();};}function respondWithResult(_0x164852,_0x1f95f6){_0x1f95f6=_0x1f95f6||0xc8;return function(_0x32c564){if(_0x32c564){return _0x164852[_0x1b37('0x19')](_0x1f95f6)[_0x1b37('0x1b')](_0x32c564);}};}function respondWithFilteredResult(_0x192026,_0x140667){return function(_0x1961d4){if(_0x1961d4){var _0x46dd2=typeof _0x140667[_0x1b37('0x1c')]==='undefined'&&typeof _0x140667[_0x1b37('0x1d')]===_0x1b37('0x1e');var _0x25b107=_0x1961d4[_0x1b37('0x1f')];var _0x2540ca=_0x46dd2?0x0:_0x140667[_0x1b37('0x1c')];var _0x484b6f=_0x46dd2?_0x1961d4[_0x1b37('0x1f')]:_0x140667['offset']+_0x140667['limit'];var _0x595b30;if(_0x484b6f>=_0x25b107){_0x484b6f=_0x25b107;_0x595b30=0xc8;}else{_0x595b30=0xce;}_0x192026[_0x1b37('0x19')](_0x595b30);return _0x192026['set'](_0x1b37('0x20'),_0x2540ca+'-'+_0x484b6f+'/'+_0x25b107)[_0x1b37('0x1b')](_0x1961d4);}return null;};}function patchUpdates(_0x451898){return function(_0xaf27a3){try{jsonpatch[_0x1b37('0x21')](_0xaf27a3,_0x451898,!![]);}catch(_0x16e171){return BPromise[_0x1b37('0x22')](_0x16e171);}return _0xaf27a3[_0x1b37('0x23')]();};}function saveUpdates(_0x59b1f4,_0x2fdcf0){return function(_0x583665){if(_0x583665){return _0x583665['update'](_0x59b1f4)[_0x1b37('0x24')](function(_0x7afbed){return _0x7afbed;});}return null;};}function removeEntity(_0x537bbf,_0x5dc3a3){return function(_0x268aa4){if(_0x268aa4){return _0x268aa4['destroy']()[_0x1b37('0x24')](function(){_0x537bbf[_0x1b37('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33f096,_0x536830){return function(_0x84fe5d){if(!_0x84fe5d){_0x33f096[_0x1b37('0x18')](0x194);}return _0x84fe5d;};}function handleError(_0x3f25f1,_0x461510){_0x461510=_0x461510||0x1f4;return function(_0x2a115a){logger['error'](_0x2a115a[_0x1b37('0x25')]);if(_0x2a115a[_0x1b37('0x26')]){delete _0x2a115a[_0x1b37('0x26')];}_0x3f25f1[_0x1b37('0x19')](_0x461510)[_0x1b37('0x27')](_0x2a115a);};}exports[_0x1b37('0x28')]=function(_0x534854,_0x179118){var _0x3550e2={},_0x1c661d={},_0x2fe6bc={'count':0x0,'rows':[]};var _0x119eb3=_[_0x1b37('0x29')](db['VoiceDialReport'][_0x1b37('0x2a')],function(_0x68e529){return{'name':_0x68e529['fieldName'],'type':_0x68e529['type'][_0x1b37('0x2b')]};});_0x1c661d[_0x1b37('0x2c')]=_[_0x1b37('0x29')](_0x119eb3,_0x1b37('0x26'));_0x1c661d[_0x1b37('0x2d')]=_[_0x1b37('0x2e')](_0x534854[_0x1b37('0x2d')]);_0x1c661d['filters']=_['intersection'](_0x1c661d[_0x1b37('0x2c')],_0x1c661d[_0x1b37('0x2d')]);_0x3550e2[_0x1b37('0x2f')]=_[_0x1b37('0x30')](_0x1c661d['model'],qs[_0x1b37('0x31')](_0x534854[_0x1b37('0x2d')]['fields']));_0x3550e2[_0x1b37('0x2f')]=_0x3550e2[_0x1b37('0x2f')][_0x1b37('0x32')]?_0x3550e2[_0x1b37('0x2f')]:_0x1c661d[_0x1b37('0x2c')];if(!_0x534854['query'][_0x1b37('0x33')](_0x1b37('0x34'))){_0x3550e2['limit']=qs[_0x1b37('0x1d')](_0x534854['query'][_0x1b37('0x1d')]);_0x3550e2[_0x1b37('0x1c')]=qs[_0x1b37('0x1c')](_0x534854[_0x1b37('0x2d')][_0x1b37('0x1c')]);}_0x3550e2[_0x1b37('0x35')]=qs[_0x1b37('0x36')](_0x534854[_0x1b37('0x2d')][_0x1b37('0x36')]);_0x3550e2['where']=qs[_0x1b37('0x37')](_[_0x1b37('0x38')](_0x534854[_0x1b37('0x2d')],_0x1c661d[_0x1b37('0x37')]),_0x119eb3);if(_0x534854[_0x1b37('0x2d')][_0x1b37('0x39')]){_0x3550e2[_0x1b37('0x3a')]=_[_0x1b37('0x3b')](_0x3550e2[_0x1b37('0x3a')],{'$or':_[_0x1b37('0x29')](_0x119eb3,function(_0x2e47a9){if(_0x2e47a9[_0x1b37('0x3c')]!==_0x1b37('0x3d')){var _0x4fecfb={};_0x4fecfb[_0x2e47a9[_0x1b37('0x26')]]={'$like':'%'+_0x534854[_0x1b37('0x2d')][_0x1b37('0x39')]+'%'};return _0x4fecfb;}})});}_0x3550e2=_['merge']({},_0x3550e2,_0x534854['options']);var _0x521cdd={'where':_0x3550e2[_0x1b37('0x3a')]};return db[_0x1b37('0x3e')]['count'](_0x521cdd)[_0x1b37('0x24')](function(_0x439f5f){_0x2fe6bc[_0x1b37('0x1f')]=_0x439f5f;if(_0x534854[_0x1b37('0x2d')][_0x1b37('0x3f')]){_0x3550e2[_0x1b37('0x40')]=[{'all':!![]}];}return db[_0x1b37('0x3e')][_0x1b37('0x41')](_0x3550e2);})[_0x1b37('0x24')](function(_0x3cde59){_0x2fe6bc[_0x1b37('0x42')]=_0x3cde59;return _0x2fe6bc;})[_0x1b37('0x24')](respondWithFilteredResult(_0x179118,_0x3550e2))[_0x1b37('0x43')](handleError(_0x179118,null));};exports[_0x1b37('0x44')]=function(_0x3a406a,_0x3a72b0){var _0x3846c7={'raw':!![],'where':{'id':_0x3a406a[_0x1b37('0x45')]['id']}},_0x43d258={};_0x43d258[_0x1b37('0x2c')]=_[_0x1b37('0x2e')](db[_0x1b37('0x3e')][_0x1b37('0x2a')]);_0x43d258[_0x1b37('0x2d')]=_[_0x1b37('0x2e')](_0x3a406a['query']);_0x43d258[_0x1b37('0x37')]=_[_0x1b37('0x30')](_0x43d258[_0x1b37('0x2c')],_0x43d258[_0x1b37('0x2d')]);_0x3846c7['attributes']=_[_0x1b37('0x30')](_0x43d258['model'],qs[_0x1b37('0x31')](_0x3a406a[_0x1b37('0x2d')]['fields']));_0x3846c7['attributes']=_0x3846c7[_0x1b37('0x2f')]['length']?_0x3846c7[_0x1b37('0x2f')]:_0x43d258[_0x1b37('0x2c')];if(_0x3a406a[_0x1b37('0x2d')][_0x1b37('0x3f')]){_0x3846c7[_0x1b37('0x40')]=[{'all':!![]}];}_0x3846c7=_[_0x1b37('0x3b')]({},_0x3846c7,_0x3a406a['options']);return db[_0x1b37('0x3e')][_0x1b37('0x46')](_0x3846c7)[_0x1b37('0x24')](handleEntityNotFound(_0x3a72b0,null))[_0x1b37('0x24')](respondWithResult(_0x3a72b0,null))[_0x1b37('0x43')](handleError(_0x3a72b0,null));};exports[_0x1b37('0x47')]=function(_0x5becb0,_0x172b08){return db[_0x1b37('0x3e')][_0x1b37('0x47')](_0x5becb0[_0x1b37('0x48')],{})[_0x1b37('0x24')](respondWithResult(_0x172b08,0xc9))[_0x1b37('0x43')](handleError(_0x172b08,null));};exports[_0x1b37('0x49')]=function(_0x36cf5e,_0x4207c8){if(_0x36cf5e[_0x1b37('0x48')]['id']){delete _0x36cf5e[_0x1b37('0x48')]['id'];}return db[_0x1b37('0x3e')][_0x1b37('0x46')]({'where':{'id':_0x36cf5e[_0x1b37('0x45')]['id']}})[_0x1b37('0x24')](handleEntityNotFound(_0x4207c8,null))[_0x1b37('0x24')](saveUpdates(_0x36cf5e[_0x1b37('0x48')],null))[_0x1b37('0x24')](respondWithResult(_0x4207c8,null))['catch'](handleError(_0x4207c8,null));};exports[_0x1b37('0x4a')]=function(_0x21b832,_0x2e5f5e){return db[_0x1b37('0x3e')][_0x1b37('0x46')]({'where':{'id':_0x21b832[_0x1b37('0x45')]['id']}})[_0x1b37('0x24')](handleEntityNotFound(_0x2e5f5e,null))[_0x1b37('0x24')](removeEntity(_0x2e5f5e,null))[_0x1b37('0x43')](handleError(_0x2e5f5e,null));};exports[_0x1b37('0x4b')]=function(_0x2195a3,_0x3542a2){return db[_0x1b37('0x3e')][_0x1b37('0x4b')]()[_0x1b37('0x24')](respondWithResult(_0x3542a2,null))[_0x1b37('0x43')](handleError(_0x3542a2,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index fdffa2e..ede8f82 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 _0xc910=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','define','VoiceDialReport','report_dial','lodash'];(function(_0x303f33,_0x30552b){var _0x50a5=function(_0x1799ef){while(--_0x1799ef){_0x303f33['push'](_0x303f33['shift']());}};_0x50a5(++_0x30552b);}(_0xc910,0x109));var _0x0c91=function(_0x25b798,_0x4d690c){_0x25b798=_0x25b798-0x0;var _0x4ae54b=_0xc910[_0x25b798];return _0x4ae54b;};'use strict';var _=require(_0x0c91('0x0'));var util=require(_0x0c91('0x1'));var logger=require(_0x0c91('0x2'))(_0x0c91('0x3'));var moment=require(_0x0c91('0x4'));var BPromise=require(_0x0c91('0x5'));var rp=require(_0x0c91('0x6'));var fs=require('fs');var path=require(_0x0c91('0x7'));var rimraf=require(_0x0c91('0x8'));var config=require(_0x0c91('0x9'));var attributes=require(_0x0c91('0xa'));module['exports']=function(_0x129432,_0x439ac9){return _0x129432[_0x0c91('0xb')](_0x0c91('0xc'),attributes,{'tableName':_0x0c91('0xd'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3893=['api','moment','bluebird','request-promise','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','../../config/logger'];(function(_0x365c22,_0x23c5fb){var _0x551d75=function(_0x2ef044){while(--_0x2ef044){_0x365c22['push'](_0x365c22['shift']());}};_0x551d75(++_0x23c5fb);}(_0x3893,0x1a1));var _0x3389=function(_0x2265da,_0xfbbd2e){_0x2265da=_0x2265da-0x0;var _0x430c2b=_0x3893[_0x2265da];return _0x430c2b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3389('0x0'))(_0x3389('0x1'));var moment=require(_0x3389('0x2'));var BPromise=require(_0x3389('0x3'));var rp=require(_0x3389('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3389('0x5'));var attributes=require(_0x3389('0x6'));module[_0x3389('0x7')]=function(_0x546865,_0x5e963b){return _0x546865[_0x3389('0x8')](_0x3389('0x9'),attributes,{'tableName':_0x3389('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 086be99..8e32e4a 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 _0x67f7=['lodash','util','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateVoiceDialReport','VoiceDialReport','body','options','update','raw','where','attributes','UpdateVoiceDialReport'];(function(_0x1332bc,_0x63af04){var _0x427301=function(_0x5ac525){while(--_0x5ac525){_0x1332bc['push'](_0x1332bc['shift']());}};_0x427301(++_0x63af04);}(_0x67f7,0x179));var _0x767f=function(_0x45704e,_0x2a60bc){_0x45704e=_0x45704e-0x0;var _0x173ecb=_0x67f7[_0x45704e];return _0x173ecb;};'use strict';var _=require(_0x767f('0x0'));var util=require(_0x767f('0x1'));var moment=require(_0x767f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x767f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x767f('0x4'))(_0x767f('0x5'));var config=require('../../config/environment');var jayson=require(_0x767f('0x6'));var client=jayson[_0x767f('0x7')][_0x767f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x44cbfe,_0x53de8a,_0x34ed02){return new BPromise(function(_0x1d353e,_0x401ab4){return client[_0x767f('0x9')](_0x44cbfe,_0x34ed02)[_0x767f('0xa')](function(_0x1a3b90){logger[_0x767f('0xb')](_0x767f('0xc'),_0x53de8a,_0x767f('0xd'));logger[_0x767f('0xe')](_0x767f('0xf'),_0x53de8a,_0x767f('0xd'),JSON[_0x767f('0x10')](_0x1a3b90));if(_0x1a3b90[_0x767f('0x11')]){if(_0x1a3b90[_0x767f('0x11')]['code']===0x1f4){logger[_0x767f('0x11')](_0x767f('0xc'),_0x53de8a,_0x1a3b90[_0x767f('0x11')][_0x767f('0x12')]);return _0x401ab4(_0x1a3b90['error'][_0x767f('0x12')]);}logger['error'](_0x767f('0xc'),_0x53de8a,_0x1a3b90[_0x767f('0x11')]['message']);return _0x1d353e(_0x1a3b90[_0x767f('0x11')][_0x767f('0x12')]);}else{logger['info'](_0x767f('0xc'),_0x53de8a,_0x767f('0xd'));_0x1d353e(_0x1a3b90['result'][_0x767f('0x12')]);}})[_0x767f('0x13')](function(_0xa869cd){logger[_0x767f('0x11')](_0x767f('0xc'),_0x53de8a,_0xa869cd);_0x401ab4(_0xa869cd);});});}exports[_0x767f('0x14')]=function(_0x3a5e10){var _0x1315ea=this;return new Promise(function(_0x1ef774,_0x46a747){return db[_0x767f('0x15')]['create'](_0x3a5e10[_0x767f('0x16')],{'raw':_0x3a5e10[_0x767f('0x17')]?_0x3a5e10['options']['raw']===undefined?!![]:![]:!![]})[_0x767f('0xa')](function(_0x12edb6){logger['info'](_0x767f('0x14'),_0x3a5e10);logger[_0x767f('0xe')](_0x767f('0x14'),_0x3a5e10,JSON[_0x767f('0x10')](_0x12edb6));_0x1ef774(_0x12edb6);})[_0x767f('0x13')](function(_0x560ec7){logger['error']('CreateVoiceDialReport',_0x560ec7[_0x767f('0x12')],_0x3a5e10);_0x46a747(_0x1315ea[_0x767f('0x11')](0x1f4,_0x560ec7[_0x767f('0x12')]));});});};exports['UpdateVoiceDialReport']=function(_0x386298){var _0x1645f4=this;return new Promise(function(_0x631f96,_0x48d300){return db[_0x767f('0x15')][_0x767f('0x18')](_0x386298[_0x767f('0x16')],{'raw':_0x386298[_0x767f('0x17')]?_0x386298[_0x767f('0x17')][_0x767f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x386298[_0x767f('0x17')]?_0x386298[_0x767f('0x17')][_0x767f('0x1a')]||null:null,'attributes':_0x386298['options']?_0x386298['options'][_0x767f('0x1b')]||null:null,'limit':_0x386298[_0x767f('0x17')]?_0x386298['options']['limit']||null:null})[_0x767f('0xa')](function(_0x2e6e65){logger['info'](_0x767f('0x1c'),_0x386298);logger[_0x767f('0xe')](_0x767f('0x1c'),_0x386298,JSON[_0x767f('0x10')](_0x2e6e65));_0x631f96(_0x2e6e65);})[_0x767f('0x13')](function(_0x4271c3){logger[_0x767f('0x11')](_0x767f('0x1c'),_0x4271c3[_0x767f('0x12')],_0x386298);_0x48d300(_0x1645f4[_0x767f('0x11')](0x1f4,_0x4271c3[_0x767f('0x12')]));});});}; \ No newline at end of file +var _0x82c2=['VoiceDialReport,\x20%s,\x20%s','message','info','result','CreateVoiceDialReport','VoiceDialReport','create','body','options','catch','UpdateVoiceDialReport','update','raw','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x82c2,0x17a));var _0x282c=function(_0x26299e,_0x394ad1){_0x26299e=_0x26299e-0x0;var _0x6c4f4a=_0x82c2[_0x26299e];return _0x6c4f4a;};'use strict';var _=require(_0x282c('0x0'));var util=require(_0x282c('0x1'));var moment=require(_0x282c('0x2'));var BPromise=require(_0x282c('0x3'));var rs=require(_0x282c('0x4'));var fs=require('fs');var Redis=require(_0x282c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x282c('0x6'));var logger=require(_0x282c('0x7'))(_0x282c('0x8'));var config=require(_0x282c('0x9'));var jayson=require(_0x282c('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x28c08e,_0x307fb1,_0x5895d0){return new BPromise(function(_0x48612e,_0x2e8ffc){return client[_0x282c('0xb')](_0x28c08e,_0x5895d0)[_0x282c('0xc')](function(_0x1dc6ab){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x307fb1,'request\x20sent');logger[_0x282c('0xd')](_0x282c('0xe'),_0x307fb1,'request\x20sent',JSON[_0x282c('0xf')](_0x1dc6ab));if(_0x1dc6ab[_0x282c('0x10')]){if(_0x1dc6ab[_0x282c('0x10')][_0x282c('0x11')]===0x1f4){logger[_0x282c('0x10')](_0x282c('0x12'),_0x307fb1,_0x1dc6ab[_0x282c('0x10')][_0x282c('0x13')]);return _0x2e8ffc(_0x1dc6ab[_0x282c('0x10')]['message']);}logger[_0x282c('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x307fb1,_0x1dc6ab[_0x282c('0x10')][_0x282c('0x13')]);return _0x48612e(_0x1dc6ab['error'][_0x282c('0x13')]);}else{logger[_0x282c('0x14')](_0x282c('0x12'),_0x307fb1,'request\x20sent');_0x48612e(_0x1dc6ab[_0x282c('0x15')]['message']);}})['catch'](function(_0x3a5403){logger['error'](_0x282c('0x12'),_0x307fb1,_0x3a5403);_0x2e8ffc(_0x3a5403);});});}exports[_0x282c('0x16')]=function(_0x4a16b9){var _0x374184=this;return new Promise(function(_0xc7a79f,_0x581d55){return db[_0x282c('0x17')][_0x282c('0x18')](_0x4a16b9[_0x282c('0x19')],{'raw':_0x4a16b9[_0x282c('0x1a')]?_0x4a16b9[_0x282c('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x282c('0xc')](function(_0x15a625){logger[_0x282c('0x14')](_0x282c('0x16'),_0x4a16b9);logger[_0x282c('0xd')](_0x282c('0x16'),_0x4a16b9,JSON[_0x282c('0xf')](_0x15a625));_0xc7a79f(_0x15a625);})[_0x282c('0x1b')](function(_0x36d40c){logger[_0x282c('0x10')](_0x282c('0x16'),_0x36d40c[_0x282c('0x13')],_0x4a16b9);_0x581d55(_0x374184[_0x282c('0x10')](0x1f4,_0x36d40c[_0x282c('0x13')]));});});};exports[_0x282c('0x1c')]=function(_0x43073c){var _0x3a9beb=this;return new Promise(function(_0x2df539,_0x3f94dc){return db['VoiceDialReport'][_0x282c('0x1d')](_0x43073c[_0x282c('0x19')],{'raw':_0x43073c[_0x282c('0x1a')]?_0x43073c[_0x282c('0x1a')][_0x282c('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43073c[_0x282c('0x1a')]?_0x43073c[_0x282c('0x1a')][_0x282c('0x1f')]||null:null,'attributes':_0x43073c[_0x282c('0x1a')]?_0x43073c['options'][_0x282c('0x20')]||null:null,'limit':_0x43073c[_0x282c('0x1a')]?_0x43073c['options']['limit']||null:null})[_0x282c('0xc')](function(_0x2e1af5){logger[_0x282c('0x14')](_0x282c('0x1c'),_0x43073c);logger[_0x282c('0xd')]('UpdateVoiceDialReport',_0x43073c,JSON[_0x282c('0xf')](_0x2e1af5));_0x2df539(_0x2e1af5);})[_0x282c('0x1b')](function(_0x470126){logger[_0x282c('0x10')](_0x282c('0x1c'),_0x470126[_0x282c('0x13')],_0x43073c);_0x3f94dc(_0x3a9beb['error'](0x1f4,_0x470126['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 1664f28..e0df8d5 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 _0x5d04=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','post','create','/:id/applications','addApplications','put','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x101670,_0x51e170){var _0x46dade=function(_0x110f76){while(--_0x110f76){_0x101670['push'](_0x101670['shift']());}};_0x46dade(++_0x51e170);}(_0x5d04,0x188));var _0x45d0=function(_0x2e89f2,_0x242212){_0x2e89f2=_0x2e89f2-0x0;var _0x4f04b0=_0x5d04[_0x2e89f2];return _0x4f04b0;};'use strict';var multer=require(_0x45d0('0x0'));var util=require('util');var path=require(_0x45d0('0x1'));var timeout=require(_0x45d0('0x2'));var express=require(_0x45d0('0x3'));var router=express[_0x45d0('0x4')]();var fs_extra=require(_0x45d0('0x5'));var auth=require(_0x45d0('0x6'));var interaction=require(_0x45d0('0x7'));var config=require(_0x45d0('0x8'));var controller=require('./voiceExtension.controller');router[_0x45d0('0x9')]('/',auth['isAuthenticated'](),controller[_0x45d0('0xa')]);router[_0x45d0('0x9')](_0x45d0('0xb'),auth[_0x45d0('0xc')](),controller['show']);router[_0x45d0('0xd')]('/',auth[_0x45d0('0xc')](),controller[_0x45d0('0xe')]);router['post'](_0x45d0('0xf'),auth['isAuthenticated'](),controller[_0x45d0('0x10')]);router[_0x45d0('0x11')](_0x45d0('0xb'),auth[_0x45d0('0xc')](),controller[_0x45d0('0x12')]);router[_0x45d0('0x13')]('/:id',auth[_0x45d0('0xc')](),controller[_0x45d0('0x14')]);module[_0x45d0('0x15')]=router; \ No newline at end of file +var _0x6abb=['index','/:id','create','addApplications','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','get','isAuthenticated'];(function(_0xefa736,_0x866a70){var _0x3340dd=function(_0xaa05c){while(--_0xaa05c){_0xefa736['push'](_0xefa736['shift']());}};_0x3340dd(++_0x866a70);}(_0x6abb,0x1a9));var _0xb6ab=function(_0x1abda3,_0x17b851){_0x1abda3=_0x1abda3-0x0;var _0x19d3d2=_0x6abb[_0x1abda3];return _0x19d3d2;};'use strict';var multer=require(_0xb6ab('0x0'));var util=require(_0xb6ab('0x1'));var path=require(_0xb6ab('0x2'));var timeout=require(_0xb6ab('0x3'));var express=require(_0xb6ab('0x4'));var router=express[_0xb6ab('0x5')]();var fs_extra=require(_0xb6ab('0x6'));var auth=require(_0xb6ab('0x7'));var interaction=require(_0xb6ab('0x8'));var config=require('../../config/environment');var controller=require(_0xb6ab('0x9'));router[_0xb6ab('0xa')]('/',auth[_0xb6ab('0xb')](),controller[_0xb6ab('0xc')]);router[_0xb6ab('0xa')](_0xb6ab('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xb6ab('0xe')]);router['post']('/:id/applications',auth[_0xb6ab('0xb')](),controller[_0xb6ab('0xf')]);router['put'](_0xb6ab('0xd'),auth[_0xb6ab('0xb')](),controller[_0xb6ab('0x10')]);router[_0xb6ab('0x11')](_0xb6ab('0xd'),auth['isAuthenticated'](),controller[_0xb6ab('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 5975a16..b835dde 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 _0x499c=['*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','compositeIndex','STRING','NoOp','inbound','outbound','internal','inbound-fax','system'];(function(_0xb47e18,_0x9af321){var _0x403d3b=function(_0x189954){while(--_0x189954){_0xb47e18['push'](_0xb47e18['shift']());}};_0x403d3b(++_0x9af321);}(_0x499c,0x106));var _0xc499=function(_0x283af9,_0x4b0264){_0x283af9=_0x283af9-0x0;var _0x5d1b60=_0x499c[_0x283af9];return _0x5d1b60;};'use strict';var Sequelize=require(_0xc499('0x0'));module[_0xc499('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc499('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xc499('0x3')],'allowNull':![],'unique':_0xc499('0x2')},'priority':{'type':Sequelize[_0xc499('0x3')],'allowNull':![],'defaultValue':'1','unique':_0xc499('0x2')},'tag':{'type':Sequelize[_0xc499('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xc499('0x3')],'allowNull':![],'defaultValue':_0xc499('0x4')},'appdata':{'type':Sequelize[_0xc499('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0xc499('0x5'),_0xc499('0x6'),_0xc499('0x7'),_0xc499('0x8'),'outbound-fax',_0xc499('0x9'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0xc499('0x3')]},'interval':{'type':Sequelize[_0xc499('0x3')],'allowNull':![],'defaultValue':_0xc499('0xa')},'IntervalId':{'type':Sequelize[_0xc499('0xb')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xc499('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0xc499('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0xc499('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0xc499('0x3')],'defaultValue':_0xc499('0xd')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0xc499('0xe')],'get':function(_0x51630f){return this[_0xc499('0xf')](_0xc499('0x10'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x77d3=['BOOLEAN','wav','VIRTUAL','exten','sequelize','exports','STRING','compositeIndex','ENUM','inbound','outbound','internal','outbound-fax','system','any','*,*,*,*','INTEGER'];(function(_0x140325,_0x53234c){var _0x318d4d=function(_0x179f53){while(--_0x179f53){_0x140325['push'](_0x140325['shift']());}};_0x318d4d(++_0x53234c);}(_0x77d3,0xd0));var _0x377d=function(_0x1177d5,_0x22b649){_0x1177d5=_0x1177d5-0x0;var _0xc3ddc2=_0x77d3[_0x1177d5];return _0xc3ddc2;};'use strict';var Sequelize=require(_0x377d('0x0'));module[_0x377d('0x1')]={'context':{'type':Sequelize[_0x377d('0x2')],'allowNull':![],'unique':_0x377d('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x377d('0x2')],'allowNull':![],'unique':_0x377d('0x3')},'priority':{'type':Sequelize[_0x377d('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x377d('0x3')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x377d('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0x377d('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x377d('0x4')](_0x377d('0x5'),_0x377d('0x6'),_0x377d('0x7'),'inbound-fax',_0x377d('0x8'),_0x377d('0x9'),_0x377d('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x377d('0x2')]},'interval':{'type':Sequelize[_0x377d('0x2')],'allowNull':![],'defaultValue':_0x377d('0xb')},'IntervalId':{'type':Sequelize[_0x377d('0xc')]},'isApp':{'type':Sequelize[_0x377d('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x377d('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x377d('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x377d('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x377d('0xc')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x377d('0xe')},'answer':{'type':Sequelize[_0x377d('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0x377d('0xf')],'get':function(_0x40a062){return this['getDataValue'](_0x377d('0x10'));}},'alias':{'type':Sequelize[_0x377d('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index e92b7d5..388993b 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 _0x26da=['VIRTUAL','includeAll','include','findAll','rows','catch','params','rawAttributes','options','create','body','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','json','lodash','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','then','get','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','internal','ignore','value','type','find','name','error','stack','send','index','map','VoiceExtension','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge'];(function(_0x13e63f,_0x1910a7){var _0x5baeaf=function(_0x420581){while(--_0x420581){_0x13e63f['push'](_0x13e63f['shift']());}};_0x5baeaf(++_0x1910a7);}(_0x26da,0xe5));var _0xa26d=function(_0x1ec73a,_0x491889){_0x1ec73a=_0x1ec73a-0x0;var _0x2dd506=_0x26da[_0x1ec73a];return _0x2dd506;};'use strict';var _=require(_0xa26d('0x0'));var Redis=require(_0xa26d('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xa26d('0x2'))('api');var config=require(_0xa26d('0x3'));var db=require(_0xa26d('0x4'))['db'];config['redis']=_['defaults'](config[_0xa26d('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0xa26d('0x6'))(new Redis(config[_0xa26d('0x5')]));require(_0xa26d('0x7'))[_0xa26d('0x8')](socket);function respondWithStatusCode(_0x2cca04,_0x5c5b77){_0x5c5b77=_0x5c5b77||0xcc;return function(_0x5927f5){if(_0x5927f5){return _0x2cca04[_0xa26d('0x9')](_0x5c5b77);}return _0x2cca04[_0xa26d('0xa')](_0x5c5b77)[_0xa26d('0xb')]();};}function respondWithResult(_0x59a673,_0x4a174a){_0x4a174a=_0x4a174a||0xc8;return function(_0xb8a015){if(_0xb8a015){return _0x59a673['status'](_0x4a174a)['json'](_0xb8a015);}};}function respondWithFilteredResult(_0xfbf0d,_0x5b2d6b){return function(_0x48a825){if(_0x48a825){var _0x50678c=typeof _0x5b2d6b['offset']===_0xa26d('0xc')&&typeof _0x5b2d6b[_0xa26d('0xd')]==='undefined';var _0x106bd0=_0x48a825[_0xa26d('0xe')];var _0x2af8f6=_0x50678c?0x0:_0x5b2d6b[_0xa26d('0xf')];var _0x3f4388=_0x50678c?_0x48a825[_0xa26d('0xe')]:_0x5b2d6b[_0xa26d('0xf')]+_0x5b2d6b[_0xa26d('0xd')];var _0x224bc8;if(_0x3f4388>=_0x106bd0){_0x3f4388=_0x106bd0;_0x224bc8=0xc8;}else{_0x224bc8=0xce;}_0xfbf0d[_0xa26d('0xa')](_0x224bc8);return _0xfbf0d[_0xa26d('0x10')](_0xa26d('0x11'),_0x2af8f6+'-'+_0x3f4388+'/'+_0x106bd0)['json'](_0x48a825);}return null;};}function removeEntity(_0x359cf7){return function(_0x1f1cfa){if(_0x1f1cfa){return _0x1f1cfa['destroy']()[_0xa26d('0x12')](function(){var _0x481202=_0x1f1cfa[_0xa26d('0x13')]({'plain':!![]});var _0x4926b2=[{'name':_0xa26d('0x14'),'value':'inbound','ignore':![]},{'name':_0xa26d('0x15'),'value':_0xa26d('0x16'),'ignore':![]},{'name':_0xa26d('0x17'),'value':_0xa26d('0x18'),'ignore':![]}];var _0x8147cf=_(_0x4926b2)['filter'](_0xa26d('0x19'))['map']('value')[_0xa26d('0x1a')]();if(_['includes'](_0x8147cf,_0x481202[_0xa26d('0x1b')])){return;}var _0x372fe2=_[_0xa26d('0x1c')](_0x4926b2,[_0xa26d('0x1a'),_0x481202[_0xa26d('0x1b')]])[_0xa26d('0x1d')];return db['UserProfileResource']['destroy']({'where':{'type':_0x372fe2,'resourceId':_0x481202['id']}})[_0xa26d('0x12')](function(){return _0x1f1cfa;});})['then'](function(){_0x359cf7['status'](0xcc)[_0xa26d('0xb')]();});}};}function handleEntityNotFound(_0x50a9f9){return function(_0x2ceee0){if(!_0x2ceee0){_0x50a9f9['sendStatus'](0x194);}return _0x2ceee0;};}function handleError(_0x16bdab,_0x41fddb){_0x41fddb=_0x41fddb||0x1f4;return function(_0x2a30b1){logger[_0xa26d('0x1e')](_0x2a30b1[_0xa26d('0x1f')]);if(_0x2a30b1['name']){delete _0x2a30b1[_0xa26d('0x1d')];}_0x16bdab[_0xa26d('0xa')](_0x41fddb)[_0xa26d('0x20')](_0x2a30b1);};}exports[_0xa26d('0x21')]=function(_0x5de0d9,_0x2a257f){var _0xa7288={},_0x226262={},_0x6cf869={'count':0x0,'rows':[]};var _0x378ac5=_[_0xa26d('0x22')](db[_0xa26d('0x23')]['rawAttributes'],function(_0x3c7444){return{'name':_0x3c7444[_0xa26d('0x24')],'type':_0x3c7444[_0xa26d('0x1b')][_0xa26d('0x25')]};});_0x226262[_0xa26d('0x26')]=_[_0xa26d('0x22')](_0x378ac5,'name');_0x226262[_0xa26d('0x27')]=_[_0xa26d('0x28')](_0x5de0d9[_0xa26d('0x27')]);_0x226262[_0xa26d('0x29')]=_[_0xa26d('0x2a')](_0x226262['model'],_0x226262['query']);_0xa7288[_0xa26d('0x2b')]=_[_0xa26d('0x2a')](_0x226262[_0xa26d('0x26')],qs[_0xa26d('0x2c')](_0x5de0d9[_0xa26d('0x27')]['fields']));_0xa7288[_0xa26d('0x2b')]=_0xa7288['attributes'][_0xa26d('0x2d')]?_0xa7288['attributes']:_0x226262[_0xa26d('0x26')];if(!_0x5de0d9[_0xa26d('0x27')][_0xa26d('0x2e')]('nolimit')){_0xa7288[_0xa26d('0xd')]=qs[_0xa26d('0xd')](_0x5de0d9['query']['limit']);_0xa7288[_0xa26d('0xf')]=qs['offset'](_0x5de0d9[_0xa26d('0x27')]['offset']);}_0xa7288[_0xa26d('0x2f')]=qs[_0xa26d('0x30')](_0x5de0d9[_0xa26d('0x27')]['sort']);_0xa7288[_0xa26d('0x31')]=qs[_0xa26d('0x29')](_[_0xa26d('0x32')](_0x5de0d9['query'],_0x226262[_0xa26d('0x29')]),_0x378ac5);if(_0x5de0d9[_0xa26d('0x27')][_0xa26d('0x33')]){_0xa7288[_0xa26d('0x31')]=_[_0xa26d('0x34')](_0xa7288['where'],{'$or':_['map'](_0x378ac5,function(_0x352884){if(_0x352884['type']!==_0xa26d('0x35')){var _0x3b8452={};_0x3b8452[_0x352884[_0xa26d('0x1d')]]={'$like':'%'+_0x5de0d9[_0xa26d('0x27')][_0xa26d('0x33')]+'%'};return _0x3b8452;}})});}_0xa7288=_[_0xa26d('0x34')]({},_0xa7288,_0x5de0d9['options']);var _0x66ba9c={'where':_0xa7288[_0xa26d('0x31')]};return db['VoiceExtension'][_0xa26d('0xe')](_0x66ba9c)[_0xa26d('0x12')](function(_0x40b4dd){_0x6cf869[_0xa26d('0xe')]=_0x40b4dd;if(_0x5de0d9[_0xa26d('0x27')][_0xa26d('0x36')]){_0xa7288[_0xa26d('0x37')]=[{'all':!![]}];}return db[_0xa26d('0x23')][_0xa26d('0x38')](_0xa7288);})[_0xa26d('0x12')](function(_0x2e3ebf){_0x6cf869[_0xa26d('0x39')]=_0x2e3ebf;return _0x6cf869;})[_0xa26d('0x12')](respondWithFilteredResult(_0x2a257f,_0xa7288))[_0xa26d('0x3a')](handleError(_0x2a257f,null));};exports['show']=function(_0x127dea,_0x31a8ae){var _0x595b07={'raw':![],'where':{'id':_0x127dea[_0xa26d('0x3b')]['id']}},_0x40d51e={};_0x40d51e['model']=_[_0xa26d('0x28')](db[_0xa26d('0x23')][_0xa26d('0x3c')]);_0x40d51e[_0xa26d('0x27')]=_['keys'](_0x127dea[_0xa26d('0x27')]);_0x40d51e[_0xa26d('0x29')]=_[_0xa26d('0x2a')](_0x40d51e[_0xa26d('0x26')],_0x40d51e[_0xa26d('0x27')]);_0x595b07[_0xa26d('0x2b')]=_[_0xa26d('0x2a')](_0x40d51e[_0xa26d('0x26')],qs['fields'](_0x127dea[_0xa26d('0x27')]['fields']));_0x595b07[_0xa26d('0x2b')]=_0x595b07[_0xa26d('0x2b')][_0xa26d('0x2d')]?_0x595b07['attributes']:_0x40d51e[_0xa26d('0x26')];if(_0x127dea[_0xa26d('0x27')][_0xa26d('0x36')]){_0x595b07['include']=[{'all':!![]}];}_0x595b07=_[_0xa26d('0x34')]({},_0x595b07,_0x127dea[_0xa26d('0x3d')]);return db[_0xa26d('0x23')]['find'](_0x595b07)[_0xa26d('0x12')](handleEntityNotFound(_0x31a8ae,null))[_0xa26d('0x12')](respondWithResult(_0x31a8ae,null))[_0xa26d('0x3a')](handleError(_0x31a8ae,null));};exports['destroy']=function(_0x453b20,_0x36f589){return db[_0xa26d('0x23')][_0xa26d('0x1c')]({'where':{'id':_0x453b20[_0xa26d('0x3b')]['id']}})[_0xa26d('0x12')](handleEntityNotFound(_0x36f589,null))[_0xa26d('0x12')](removeEntity(_0x36f589,null))[_0xa26d('0x3a')](handleError(_0x36f589,null));};exports[_0xa26d('0x3e')]=function(_0x2e11fa,_0x5bdc4e){if(_0x2e11fa[_0xa26d('0x3f')][_0xa26d('0x1b')]===_0xa26d('0x16')&&!_['startsWith'](_0x2e11fa[_0xa26d('0x3f')][_0xa26d('0x40')],'_')){_0x2e11fa[_0xa26d('0x3f')][_0xa26d('0x40')]='_'['concat'](_0x2e11fa['body']['exten']);}return db[_0xa26d('0x23')][_0xa26d('0x3e')](_0x2e11fa[_0xa26d('0x3f')],{'raw':![]})['then'](function(_0x404773){var _0x463707=_0x2e11fa[_0xa26d('0x41')][_0xa26d('0x13')]({'plain':!![]});if(!_0x463707)throw new Error(_0xa26d('0x42'));if(_0x463707[_0xa26d('0x43')]==='user'){var _0x620532=_0x404773['get']({'plain':!![]});var _0x3beb58=[{'name':_0xa26d('0x14'),'value':_0xa26d('0x44')},{'name':_0xa26d('0x15'),'value':'outbound'},{'name':_0xa26d('0x17'),'value':_0xa26d('0x18')}];var _0x5d15a9=_[_0xa26d('0x1c')](_0x3beb58,['value',_0x620532['type']])['name'];return db[_0xa26d('0x45')][_0xa26d('0x1c')]({'where':{'name':_0x5d15a9,'userProfileId':_0x463707[_0xa26d('0x46')]},'raw':!![]})[_0xa26d('0x12')](function(_0x29c08a){if(_0x29c08a&&_0x29c08a[_0xa26d('0x47')]===0x0){return db[_0xa26d('0x48')][_0xa26d('0x3e')]({'name':_0x620532['name'],'resourceId':_0x620532['id'],'type':_0x29c08a['name'],'sectionId':_0x29c08a['id']},{})[_0xa26d('0x12')](function(){return _0x404773;});}else{return _0x404773;}})[_0xa26d('0x3a')](function(_0xc9b405){logger['error'](_0xa26d('0x49'),_0xc9b405);throw _0xc9b405;});}return _0x404773;})[_0xa26d('0x12')](respondWithResult(_0x5bdc4e,0xc9))['catch'](handleError(_0x5bdc4e,null));};exports['update']=function(_0x4a60f3,_0x3cf0d1){if(_0x4a60f3[_0xa26d('0x3f')]['id']){delete _0x4a60f3[_0xa26d('0x3f')]['id'];}return db[_0xa26d('0x23')][_0xa26d('0x1c')]({'where':{'id':_0x4a60f3[_0xa26d('0x3b')]['id']}})[_0xa26d('0x12')](handleEntityNotFound(_0x3cf0d1,null))['then'](function(_0x23c3a7){if(_0x23c3a7){return db[_0xa26d('0x23')][_0xa26d('0x4a')](_[_0xa26d('0x32')](_0x4a60f3[_0xa26d('0x3f')],[_0xa26d('0x40'),_0xa26d('0x4b'),_0xa26d('0x4c'),_0xa26d('0x4d'),_0xa26d('0x4e'),_0xa26d('0x4f'),_0xa26d('0x50')]),{'where':{'context':_0x23c3a7[_0xa26d('0x4b')],'exten':_0x23c3a7[_0xa26d('0x40')]},'individualHooks':!![]})['then'](function(_0x2be1e8){return _0x2be1e8;});}return null;})[_0xa26d('0x12')](respondWithStatusCode(_0x3cf0d1,null))['catch'](handleError(_0x3cf0d1,null));};exports[_0xa26d('0x51')]=function(_0x5dd8af,_0x475d08){var _0x349b36=_0x5dd8af['params']['id'];var _0x1ee4fe=_0x5dd8af[_0xa26d('0x3f')];var _0x4668f0=0xc8;var _0x4d3d56=null;return db[_0xa26d('0x52')]['transaction']({'isolationLevel':db[_0xa26d('0x52')][_0xa26d('0x53')][_0xa26d('0x54')][_0xa26d('0x55')]},function(_0x174933){return db[_0xa26d('0x23')][_0xa26d('0x56')]({'where':{'id':_0x349b36},'transaction':_0x174933})[_0xa26d('0x12')](function(_0x443673){if(_0x443673){return db['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':_0x349b36},'transaction':_0x174933})[_0xa26d('0x12')](function(){var _0x5183e9=_['map'](_0x1ee4fe,function(_0x5d7d03){_0x5d7d03[_0xa26d('0x57')]=_0x349b36;_0x5d7d03[_0xa26d('0x58')]=!![];return _0x5d7d03;});return _0x443673[_0xa26d('0x59')](_0x5183e9);})[_0xa26d('0x12')](function(_0x567d77){return db[_0xa26d('0x23')][_0xa26d('0x5a')](_0x567d77,{'transaction':_0x174933});});}else{_0x4668f0=0x194;_0x4d3d56=[];}});})[_0xa26d('0x12')](function(){if(_0x4668f0!==0x194){return db[_0xa26d('0x23')][_0xa26d('0x5b')]({'where':{'isApp':!![],'VoiceExtensionId':_0x349b36},'order':_0xa26d('0x5c')})[_0xa26d('0x12')](function(_0x2863de){_0x4d3d56=_0x2863de;});}})[_0xa26d('0x3a')](function(_0x2c2d7a){_0x4668f0=0x1f4;logger[_0xa26d('0x1e')](_0x2c2d7a[_0xa26d('0x1f')]);if(_0x2c2d7a['name']){delete _0x2c2d7a[_0xa26d('0x1d')];}_0x4d3d56=_0x2c2d7a;})['finally'](function(){if(_0x4d3d56===null){_0x475d08[_0xa26d('0x9')](_0x4668f0);}else{if(_0x4668f0===0x1f4){_0x475d08[_0xa26d('0xa')](_0x4668f0)[_0xa26d('0x20')](_0x4d3d56);}else{_0x475d08[_0xa26d('0xa')](_0x4668f0)[_0xa26d('0x5d')](_0x4d3d56);}}});}; \ No newline at end of file +var _0xb912=['length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','VoiceExtension','includeAll','include','findAll','rows','catch','show','params','find','create','body','startsWith','exten','user','get','role','inbound','OutboundRoutes','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','createRouting','bulkCreate','ioredis','../../components/parsers/qs','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','end','status','undefined','count','offset','set','Content-Range','json','InboundRoutes','outbound','InternalRoutes','internal','ignore','map','value','includes','type','UserProfileResource','destroy','then','error','stack','name','send','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb912,0x18c));var _0x2b91=function(_0xffdef,_0x43a2bd){_0xffdef=_0xffdef-0x0;var _0x30cba3=_0xb912[_0xffdef];return _0x30cba3;};'use strict';var _=require('lodash');var Redis=require(_0x2b91('0x0'));var qs=require(_0x2b91('0x1'));var logger=require('../../config/logger')(_0x2b91('0x2'));var config=require(_0x2b91('0x3'));var db=require('../../mysqldb')['db'];config[_0x2b91('0x4')]=_[_0x2b91('0x5')](config[_0x2b91('0x4')],{'host':_0x2b91('0x6'),'port':0x18eb});var socket=require(_0x2b91('0x7'))(new Redis(config[_0x2b91('0x4')]));require(_0x2b91('0x8'))[_0x2b91('0x9')](socket);function respondWithStatusCode(_0x518298,_0x22820b){_0x22820b=_0x22820b||0xcc;return function(_0x934a1f){if(_0x934a1f){return _0x518298[_0x2b91('0xa')](_0x22820b);}return _0x518298['status'](_0x22820b)[_0x2b91('0xb')]();};}function respondWithResult(_0x4aab82,_0x15dab2){_0x15dab2=_0x15dab2||0xc8;return function(_0x23fce7){if(_0x23fce7){return _0x4aab82[_0x2b91('0xc')](_0x15dab2)['json'](_0x23fce7);}};}function respondWithFilteredResult(_0x9b6141,_0xda8184){return function(_0x21aba3){if(_0x21aba3){var _0x805f60=typeof _0xda8184['offset']===_0x2b91('0xd')&&typeof _0xda8184['limit']===_0x2b91('0xd');var _0x10bf7a=_0x21aba3[_0x2b91('0xe')];var _0x2c9572=_0x805f60?0x0:_0xda8184[_0x2b91('0xf')];var _0x2fb3ee=_0x805f60?_0x21aba3[_0x2b91('0xe')]:_0xda8184[_0x2b91('0xf')]+_0xda8184['limit'];var _0x36e359;if(_0x2fb3ee>=_0x10bf7a){_0x2fb3ee=_0x10bf7a;_0x36e359=0xc8;}else{_0x36e359=0xce;}_0x9b6141[_0x2b91('0xc')](_0x36e359);return _0x9b6141[_0x2b91('0x10')](_0x2b91('0x11'),_0x2c9572+'-'+_0x2fb3ee+'/'+_0x10bf7a)[_0x2b91('0x12')](_0x21aba3);}return null;};}function removeEntity(_0x3de6a4){return function(_0x2f5a47){if(_0x2f5a47){return _0x2f5a47['destroy']()['then'](function(){var _0x52b5e6=_0x2f5a47['get']({'plain':!![]});var _0x27fb51=[{'name':_0x2b91('0x13'),'value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':_0x2b91('0x14'),'ignore':![]},{'name':_0x2b91('0x15'),'value':_0x2b91('0x16'),'ignore':![]}];var _0x3d6aaf=_(_0x27fb51)['filter'](_0x2b91('0x17'))[_0x2b91('0x18')](_0x2b91('0x19'))[_0x2b91('0x19')]();if(_[_0x2b91('0x1a')](_0x3d6aaf,_0x52b5e6[_0x2b91('0x1b')])){return;}var _0x56ba8d=_['find'](_0x27fb51,[_0x2b91('0x19'),_0x52b5e6[_0x2b91('0x1b')]])['name'];return db[_0x2b91('0x1c')][_0x2b91('0x1d')]({'where':{'type':_0x56ba8d,'resourceId':_0x52b5e6['id']}})[_0x2b91('0x1e')](function(){return _0x2f5a47;});})[_0x2b91('0x1e')](function(){_0x3de6a4[_0x2b91('0xc')](0xcc)[_0x2b91('0xb')]();});}};}function handleEntityNotFound(_0x1f4964){return function(_0x52f506){if(!_0x52f506){_0x1f4964['sendStatus'](0x194);}return _0x52f506;};}function handleError(_0x3e95e5,_0x258a13){_0x258a13=_0x258a13||0x1f4;return function(_0x5628ed){logger[_0x2b91('0x1f')](_0x5628ed[_0x2b91('0x20')]);if(_0x5628ed[_0x2b91('0x21')]){delete _0x5628ed[_0x2b91('0x21')];}_0x3e95e5[_0x2b91('0xc')](_0x258a13)[_0x2b91('0x22')](_0x5628ed);};}exports['index']=function(_0x2703f4,_0x5f511e){var _0x570a16={},_0x4b2909={},_0x407b10={'count':0x0,'rows':[]};var _0x18295a=_['map'](db['VoiceExtension'][_0x2b91('0x23')],function(_0x41fc6d){return{'name':_0x41fc6d['fieldName'],'type':_0x41fc6d['type'][_0x2b91('0x24')]};});_0x4b2909['model']=_[_0x2b91('0x18')](_0x18295a,_0x2b91('0x21'));_0x4b2909[_0x2b91('0x25')]=_[_0x2b91('0x26')](_0x2703f4[_0x2b91('0x25')]);_0x4b2909[_0x2b91('0x27')]=_[_0x2b91('0x28')](_0x4b2909[_0x2b91('0x29')],_0x4b2909[_0x2b91('0x25')]);_0x570a16[_0x2b91('0x2a')]=_[_0x2b91('0x28')](_0x4b2909[_0x2b91('0x29')],qs['fields'](_0x2703f4[_0x2b91('0x25')][_0x2b91('0x2b')]));_0x570a16[_0x2b91('0x2a')]=_0x570a16[_0x2b91('0x2a')][_0x2b91('0x2c')]?_0x570a16[_0x2b91('0x2a')]:_0x4b2909[_0x2b91('0x29')];if(!_0x2703f4[_0x2b91('0x25')][_0x2b91('0x2d')](_0x2b91('0x2e'))){_0x570a16[_0x2b91('0x2f')]=qs['limit'](_0x2703f4[_0x2b91('0x25')]['limit']);_0x570a16['offset']=qs['offset'](_0x2703f4[_0x2b91('0x25')][_0x2b91('0xf')]);}_0x570a16[_0x2b91('0x30')]=qs[_0x2b91('0x31')](_0x2703f4[_0x2b91('0x25')][_0x2b91('0x31')]);_0x570a16['where']=qs[_0x2b91('0x27')](_[_0x2b91('0x32')](_0x2703f4[_0x2b91('0x25')],_0x4b2909[_0x2b91('0x27')]),_0x18295a);if(_0x2703f4['query'][_0x2b91('0x33')]){_0x570a16[_0x2b91('0x34')]=_[_0x2b91('0x35')](_0x570a16['where'],{'$or':_['map'](_0x18295a,function(_0x545137){if(_0x545137[_0x2b91('0x1b')]!==_0x2b91('0x36')){var _0x29e124={};_0x29e124[_0x545137['name']]={'$like':'%'+_0x2703f4['query']['filter']+'%'};return _0x29e124;}})});}_0x570a16=_[_0x2b91('0x35')]({},_0x570a16,_0x2703f4['options']);var _0x2f52f1={'where':_0x570a16['where']};return db[_0x2b91('0x37')][_0x2b91('0xe')](_0x2f52f1)[_0x2b91('0x1e')](function(_0x1df98f){_0x407b10['count']=_0x1df98f;if(_0x2703f4[_0x2b91('0x25')][_0x2b91('0x38')]){_0x570a16[_0x2b91('0x39')]=[{'all':!![]}];}return db[_0x2b91('0x37')][_0x2b91('0x3a')](_0x570a16);})[_0x2b91('0x1e')](function(_0xebbb9b){_0x407b10[_0x2b91('0x3b')]=_0xebbb9b;return _0x407b10;})[_0x2b91('0x1e')](respondWithFilteredResult(_0x5f511e,_0x570a16))[_0x2b91('0x3c')](handleError(_0x5f511e,null));};exports[_0x2b91('0x3d')]=function(_0x27fe52,_0xa8aa21){var _0x105d0a={'raw':![],'where':{'id':_0x27fe52[_0x2b91('0x3e')]['id']}},_0x2902e2={};_0x2902e2[_0x2b91('0x29')]=_[_0x2b91('0x26')](db['VoiceExtension'][_0x2b91('0x23')]);_0x2902e2[_0x2b91('0x25')]=_[_0x2b91('0x26')](_0x27fe52['query']);_0x2902e2[_0x2b91('0x27')]=_['intersection'](_0x2902e2[_0x2b91('0x29')],_0x2902e2[_0x2b91('0x25')]);_0x105d0a['attributes']=_[_0x2b91('0x28')](_0x2902e2[_0x2b91('0x29')],qs['fields'](_0x27fe52[_0x2b91('0x25')][_0x2b91('0x2b')]));_0x105d0a['attributes']=_0x105d0a['attributes'][_0x2b91('0x2c')]?_0x105d0a[_0x2b91('0x2a')]:_0x2902e2['model'];if(_0x27fe52['query'][_0x2b91('0x38')]){_0x105d0a[_0x2b91('0x39')]=[{'all':!![]}];}_0x105d0a=_[_0x2b91('0x35')]({},_0x105d0a,_0x27fe52['options']);return db[_0x2b91('0x37')][_0x2b91('0x3f')](_0x105d0a)[_0x2b91('0x1e')](handleEntityNotFound(_0xa8aa21,null))[_0x2b91('0x1e')](respondWithResult(_0xa8aa21,null))['catch'](handleError(_0xa8aa21,null));};exports['destroy']=function(_0x1f4f0d,_0x306941){return db[_0x2b91('0x37')][_0x2b91('0x3f')]({'where':{'id':_0x1f4f0d[_0x2b91('0x3e')]['id']}})[_0x2b91('0x1e')](handleEntityNotFound(_0x306941,null))[_0x2b91('0x1e')](removeEntity(_0x306941,null))[_0x2b91('0x3c')](handleError(_0x306941,null));};exports[_0x2b91('0x40')]=function(_0x3530fd,_0x21a9ed){if(_0x3530fd[_0x2b91('0x41')][_0x2b91('0x1b')]===_0x2b91('0x14')&&!_[_0x2b91('0x42')](_0x3530fd['body'][_0x2b91('0x43')],'_')){_0x3530fd['body'][_0x2b91('0x43')]='_'['concat'](_0x3530fd['body']['exten']);}return db['VoiceExtension'][_0x2b91('0x40')](_0x3530fd['body'],{'raw':![]})[_0x2b91('0x1e')](function(_0xc9dac7){var _0x4b2646=_0x3530fd[_0x2b91('0x44')][_0x2b91('0x45')]({'plain':!![]});if(!_0x4b2646)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b2646[_0x2b91('0x46')]===_0x2b91('0x44')){var _0xf78a79=_0xc9dac7[_0x2b91('0x45')]({'plain':!![]});var _0x38ec40=[{'name':_0x2b91('0x13'),'value':_0x2b91('0x47')},{'name':_0x2b91('0x48'),'value':_0x2b91('0x14')},{'name':_0x2b91('0x15'),'value':_0x2b91('0x16')}];var _0xd2ed73=_[_0x2b91('0x3f')](_0x38ec40,[_0x2b91('0x19'),_0xf78a79['type']])['name'];return db['UserProfileSection'][_0x2b91('0x3f')]({'where':{'name':_0xd2ed73,'userProfileId':_0x4b2646[_0x2b91('0x49')]},'raw':!![]})['then'](function(_0x277c1d){if(_0x277c1d&&_0x277c1d['autoAssociation']===0x0){return db['UserProfileResource'][_0x2b91('0x40')]({'name':_0xf78a79[_0x2b91('0x21')],'resourceId':_0xf78a79['id'],'type':_0x277c1d[_0x2b91('0x21')],'sectionId':_0x277c1d['id']},{})[_0x2b91('0x1e')](function(){return _0xc9dac7;});}else{return _0xc9dac7;}})[_0x2b91('0x3c')](function(_0x1bf50a){logger[_0x2b91('0x1f')](_0x2b91('0x4a'),_0x1bf50a);throw _0x1bf50a;});}return _0xc9dac7;})['then'](respondWithResult(_0x21a9ed,0xc9))[_0x2b91('0x3c')](handleError(_0x21a9ed,null));};exports[_0x2b91('0x4b')]=function(_0x5b6d9a,_0x664f66){if(_0x5b6d9a[_0x2b91('0x41')]['id']){delete _0x5b6d9a[_0x2b91('0x41')]['id'];}return db[_0x2b91('0x37')][_0x2b91('0x3f')]({'where':{'id':_0x5b6d9a[_0x2b91('0x3e')]['id']}})['then'](handleEntityNotFound(_0x664f66,null))['then'](function(_0x590db8){if(_0x590db8){return db[_0x2b91('0x37')][_0x2b91('0x4b')](_[_0x2b91('0x32')](_0x5b6d9a[_0x2b91('0x41')],[_0x2b91('0x43'),_0x2b91('0x4c'),_0x2b91('0x4d'),_0x2b91('0x4e'),_0x2b91('0x4f'),_0x2b91('0x50'),'alias']),{'where':{'context':_0x590db8[_0x2b91('0x4c')],'exten':_0x590db8['exten']},'individualHooks':!![]})[_0x2b91('0x1e')](function(_0x5264c3){return _0x5264c3;});}return null;})[_0x2b91('0x1e')](respondWithStatusCode(_0x664f66,null))['catch'](handleError(_0x664f66,null));};exports['addApplications']=function(_0x101977,_0x524741){var _0x153e83=_0x101977[_0x2b91('0x3e')]['id'];var _0x791887=_0x101977['body'];var _0x40b2a0=0xc8;var _0x36d718=null;return db[_0x2b91('0x51')][_0x2b91('0x52')]({'isolationLevel':db['sequelize'][_0x2b91('0x53')][_0x2b91('0x54')][_0x2b91('0x55')]},function(_0x31a479){return db['VoiceExtension']['findOne']({'where':{'id':_0x153e83},'transaction':_0x31a479})['then'](function(_0x137c8e){if(_0x137c8e){return db[_0x2b91('0x37')][_0x2b91('0x1d')]({'where':{'VoiceExtensionId':_0x153e83},'transaction':_0x31a479})[_0x2b91('0x1e')](function(){var _0x33e2f6=_[_0x2b91('0x18')](_0x791887,function(_0x21ab75){_0x21ab75['VoiceExtensionId']=_0x153e83;_0x21ab75['isApp']=!![];return _0x21ab75;});return _0x137c8e[_0x2b91('0x56')](_0x33e2f6);})[_0x2b91('0x1e')](function(_0x35ec6f){return db[_0x2b91('0x37')][_0x2b91('0x57')](_0x35ec6f,{'transaction':_0x31a479});});}else{_0x40b2a0=0x194;_0x36d718=[];}});})[_0x2b91('0x1e')](function(){if(_0x40b2a0!==0x194){return db[_0x2b91('0x37')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x153e83},'order':'cast(priority\x20as\x20unsigned)'})['then'](function(_0x467fb7){_0x36d718=_0x467fb7;});}})[_0x2b91('0x3c')](function(_0x33fb65){_0x40b2a0=0x1f4;logger[_0x2b91('0x1f')](_0x33fb65[_0x2b91('0x20')]);if(_0x33fb65[_0x2b91('0x21')]){delete _0x33fb65[_0x2b91('0x21')];}_0x36d718=_0x33fb65;})['finally'](function(){if(_0x36d718===null){_0x524741['sendStatus'](_0x40b2a0);}else{if(_0x40b2a0===0x1f4){_0x524741[_0x2b91('0xc')](_0x40b2a0)[_0x2b91('0x22')](_0x36d718);}else{_0x524741['status'](_0x40b2a0)['json'](_0x36d718);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 5a47681..5784809 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 _0x6b7d=['VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x48bd33,_0x1b047e){var _0x183b91=function(_0x1c426c){while(--_0x1c426c){_0x48bd33['push'](_0x48bd33['shift']());}};_0x183b91(++_0x1b047e);}(_0x6b7d,0x80));var _0xd6b7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6b7d[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db'][_0xd6b7('0x0')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xd6b7('0x1')](0x0);var events={'afterCreate':_0xd6b7('0x2'),'afterUpdate':_0xd6b7('0x3'),'afterDestroy':_0xd6b7('0x4')};function emitEvent(_0x4176eb){return function(_0x394b14,_0x53fbf6,_0x2b0ba8){VoiceExtensionEvents['emit'](_0x4176eb+':'+_0x394b14['id'],_0x394b14);VoiceExtensionEvents[_0xd6b7('0x5')](_0x4176eb,_0x394b14);_0x2b0ba8(null);};}for(var e in events){if(events[_0xd6b7('0x6')](e)){var event=events[e];VoiceExtension[_0xd6b7('0x7')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0x9e4a=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','VoiceExtension'];(function(_0x47ad67,_0x488da1){var _0x22834b=function(_0x30106e){while(--_0x30106e){_0x47ad67['push'](_0x47ad67['shift']());}};_0x22834b(++_0x488da1);}(_0x9e4a,0x76));var _0xa9e4=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x9e4a[_0x565ed7];return _0x183ad7;};'use strict';var EventEmitter=require(_0xa9e4('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xa9e4('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xa9e4('0x2')](0x0);var events={'afterCreate':_0xa9e4('0x3'),'afterUpdate':_0xa9e4('0x4'),'afterDestroy':_0xa9e4('0x5')};function emitEvent(_0x2b37ae){return function(_0x50795a,_0x12b3b0,_0x3ea697){VoiceExtensionEvents[_0xa9e4('0x6')](_0x2b37ae+':'+_0x50795a['id'],_0x50795a);VoiceExtensionEvents[_0xa9e4('0x6')](_0x2b37ae,_0x50795a);_0x3ea697(null);};}for(var e in events){if(events[_0xa9e4('0x7')](e)){var event=events[e];VoiceExtension[_0xa9e4('0x8')](e,emitEvent(event));}}module[_0xa9e4('0x9')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index bdbf28f..83e754a 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 _0x1ef3=['$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','playback','includes','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice',',${EXTEN},','appType','appdata','priority','last','define','VoiceExtension','get','concat','Hangup','lodash','./voiceExtension.attributes','models','type','Set','CDR(type)=','context','exten','alias','NoOp','push','inbound','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(routeAlias)=','No\x20alias\x20set','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','trunk','timeout','options','url','length','name','param','split','phone','prefix','SIP','join','none','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','IntervalId','then','interval','intervals','map','filter','toLowerCase','tag','CDR(tag)='];(function(_0x30faec,_0x18940b){var _0x29484f=function(_0x169ae8){while(--_0x169ae8){_0x30faec['push'](_0x30faec['shift']());}};_0x29484f(++_0x18940b);}(_0x1ef3,0x69));var _0x31ef=function(_0x30014e,_0x555f27){_0x30014e=_0x30014e-0x0;var _0x1e3be1=_0x1ef3[_0x30014e];return _0x1e3be1;};'use strict';var _=require(_0x31ef('0x0'));var attributes=require(_0x31ef('0x1'));module['exports']=function(_0x2097e1){var _0x24447b=_0x2097e1[_0x31ef('0x2')];function _0x4df75f(_0x311a32){var _0x58388a=0x2;var _0x49ce87=[{'type':_0x311a32[_0x31ef('0x3')],'app':_0x31ef('0x4'),'appdata':_0x31ef('0x5')+_0x311a32[_0x31ef('0x3')],'context':_0x311a32[_0x31ef('0x6')],'exten':_0x311a32[_0x31ef('0x7')],'priority':_0x58388a++,'VoiceExtensionId':_0x311a32['id']},{'type':_0x311a32['type'],'app':_0x311a32[_0x31ef('0x8')]?_0x31ef('0x4'):_0x31ef('0x9'),'appdata':_0x311a32[_0x31ef('0x8')]?'CDR(routeAlias)='+_0x311a32[_0x31ef('0x8')]:'No\x20alias\x20set','context':_0x311a32[_0x31ef('0x6')],'exten':_0x311a32['exten'],'priority':_0x58388a++,'VoiceExtensionId':_0x311a32['id']}];if(_0x311a32['type']==='inbound'){_0x49ce87[_0x31ef('0xa')]({'type':_0x31ef('0xb'),'app':_0x31ef('0x4'),'appdata':_0x31ef('0xc')+_0x311a32['id'],'context':_0x311a32['context'],'exten':_0x311a32['exten'],'priority':_0x58388a++,'VoiceExtensionId':_0x311a32['id']});}_0x49ce87['push']({'type':_0x311a32['type'],'app':'Set','appdata':_0x31ef('0xd'),'context':_0x311a32['context'],'exten':_0x311a32[_0x31ef('0x7')],'priority':_0x58388a++,'VoiceExtensionId':_0x311a32['id']},{'type':_0x311a32[_0x31ef('0x3')],'app':'Set','appdata':_0x31ef('0xe'),'context':_0x311a32[_0x31ef('0x6')],'exten':_0x311a32[_0x31ef('0x7')],'priority':_0x58388a++,'VoiceExtensionId':_0x311a32['id']},{'type':_0x311a32[_0x31ef('0x3')],'app':_0x31ef('0x4'),'appdata':_0x31ef('0xf'),'context':_0x311a32['context'],'exten':_0x311a32['exten'],'priority':_0x58388a++,'VoiceExtensionId':_0x311a32['id']});return _0x49ce87;}function _0x8910a9(_0x572d9f){var _0x2ee39a=0x2;var _0x10775e=[{'type':_0x31ef('0x10'),'app':_0x31ef('0x4'),'appdata':_0x31ef('0x11'),'context':_0x572d9f['context'],'exten':_0x572d9f[_0x31ef('0x7')],'priority':_0x2ee39a++,'VoiceExtensionId':_0x572d9f['id']},{'type':_0x31ef('0x10'),'app':_0x572d9f[_0x31ef('0x8')]?_0x31ef('0x4'):'NoOp','appdata':_0x572d9f['alias']?_0x31ef('0x12')+_0x572d9f[_0x31ef('0x8')]:_0x31ef('0x13'),'context':_0x572d9f[_0x31ef('0x6')],'exten':_0x572d9f['exten'],'priority':_0x2ee39a++,'VoiceExtensionId':_0x572d9f['id']},{'type':_0x31ef('0x10'),'app':_0x31ef('0x4'),'appdata':'CDR(destination)='+(_0x572d9f[_0x31ef('0x14')]?_0x31ef('0x15')+_0x572d9f[_0x31ef('0x14')]+'}':_0x31ef('0x16')),'context':_0x572d9f[_0x31ef('0x6')],'exten':_0x572d9f[_0x31ef('0x7')],'priority':_0x2ee39a++,'VoiceExtensionId':_0x572d9f['id']},{'type':_0x31ef('0x10'),'app':_0x31ef('0x4'),'appdata':_0x31ef('0xc')+_0x572d9f['id'],'context':_0x572d9f[_0x31ef('0x6')],'exten':_0x572d9f['exten'],'priority':_0x2ee39a++,'VoiceExtensionId':_0x572d9f['id']},{'type':'outbound','app':_0x31ef('0x17'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x2ee39a+0x2)+_0x31ef('0x18')+(_0x2ee39a+0x1)+')','context':_0x572d9f[_0x31ef('0x6')],'exten':_0x572d9f['exten'],'priority':_0x2ee39a++,'VoiceExtensionId':_0x572d9f['id']},{'type':_0x31ef('0x10'),'app':'Set','appdata':_0x572d9f[_0x31ef('0x14')]?_0x31ef('0x19')+_0x572d9f[_0x31ef('0x14')]+'}':_0x31ef('0x1a'),'context':_0x572d9f[_0x31ef('0x6')],'exten':_0x572d9f[_0x31ef('0x7')],'priority':_0x2ee39a++,'VoiceExtensionId':_0x572d9f['id']},{'type':'outbound','app':_0x31ef('0x4'),'appdata':_0x31ef('0xd'),'context':_0x572d9f['context'],'exten':_0x572d9f['exten'],'priority':_0x2ee39a++,'VoiceExtensionId':_0x572d9f['id']},{'type':_0x31ef('0x10'),'app':_0x31ef('0x4'),'appdata':_0x31ef('0xe'),'context':_0x572d9f[_0x31ef('0x6')],'exten':_0x572d9f[_0x31ef('0x7')],'priority':_0x2ee39a++,'VoiceExtensionId':_0x572d9f['id']},{'type':_0x31ef('0x10'),'app':_0x31ef('0x4'),'appdata':_0x31ef('0xf'),'context':_0x572d9f[_0x31ef('0x6')],'exten':_0x572d9f[_0x31ef('0x7')],'priority':_0x2ee39a++,'VoiceExtensionId':_0x572d9f['id']},{'type':'outbound','app':_0x31ef('0x4'),'appdata':'outboundrouteid='+_0x572d9f['id'],'context':_0x572d9f[_0x31ef('0x6')],'exten':_0x572d9f[_0x31ef('0x7')],'priority':_0x2ee39a++,'VoiceExtensionId':_0x572d9f['id']}];if(_0x572d9f[_0x31ef('0x1b')]('recordingFormat')&&_0x572d9f[_0x31ef('0x1c')]!=='none'){_0x10775e['push']({'type':_0x31ef('0x10'),'app':_0x31ef('0x4'),'appdata':_0x31ef('0x1d'),'context':_0x572d9f[_0x31ef('0x6')],'exten':_0x572d9f[_0x31ef('0x7')],'priority':_0x2ee39a++,'VoiceExtensionId':_0x572d9f['id']},{'type':_0x31ef('0x10'),'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x572d9f[_0x31ef('0x1c')]||_0x31ef('0x1e'),'context':_0x572d9f[_0x31ef('0x6')],'exten':_0x572d9f['exten'],'priority':_0x2ee39a++,'VoiceExtensionId':_0x572d9f['id']});}return _0x10775e;}function _0x4ea4cb(_0x4d4fb8,_0x31bef3){var _0x189d92=[{'name':_0x31ef('0x1f'),'param':0x0},{'name':_0x31ef('0x20'),'param':0x1},{'name':_0x31ef('0x21'),'param':0x2},{'name':_0x31ef('0x22'),'param':0x3}];var _0x2753cd={};var _0x1316f4=_0x31bef3['split'](',');var _0x179bc9=[];for(var _0x44f474=0x0;_0x44f474<_0x189d92[_0x31ef('0x23')];_0x44f474++){switch(_0x189d92[_0x44f474][_0x31ef('0x24')]){case _0x31ef('0x1f'):_0x2753cd[_0x31ef('0x1f')]=_0x1316f4[_0x189d92[_0x44f474][_0x31ef('0x25')]]['split']('/')[0x1];_0x2753cd['phone']=_0x1316f4[_0x189d92[_0x44f474][_0x31ef('0x25')]][_0x31ef('0x26')]('/')[0x2];_0x2753cd['prefix']=_0x2753cd[_0x31ef('0x27')]?_0x2753cd[_0x31ef('0x27')]['split']('$')[0x0]:undefined;_0x2753cd[_0x31ef('0x27')]=_0x4d4fb8[_0x31ef('0x14')]?(_0x2753cd[_0x31ef('0x28')]||'')+_0x31ef('0x15')+_0x4d4fb8[_0x31ef('0x14')]+'}':(_0x2753cd['prefix']||'')+_0x31ef('0x16');_0x179bc9[_0x189d92[_0x44f474][_0x31ef('0x25')]]=[_0x31ef('0x29'),_0x2753cd[_0x31ef('0x1f')],_0x2753cd[_0x31ef('0x27')]][_0x31ef('0x2a')]('/');break;case _0x31ef('0x21'):_0x2753cd[_0x31ef('0x21')]=_0x1316f4[_0x189d92[_0x44f474]['param']];if(_0x4d4fb8[_0x31ef('0x1c')]!==_0x31ef('0x2b')){if(_0x2753cd[_0x31ef('0x21')][_0x31ef('0x2c')]('U(xcally-mixmonitor-context)')<0x0){_0x2753cd['options']+=_0x31ef('0x2d');}}else{_0x2753cd[_0x31ef('0x21')]=_0x2753cd[_0x31ef('0x21')][_0x31ef('0x2e')](_0x31ef('0x2d'),'');}_0x179bc9[_0x189d92[_0x44f474]['param']]=_0x2753cd[_0x31ef('0x21')];break;default:_0x179bc9[_0x189d92[_0x44f474][_0x31ef('0x25')]]=_0x1316f4[_0x189d92[_0x44f474][_0x31ef('0x25')]];}}return _0x179bc9['join'](',');}function _0x34047e(_0x4dae63,_0x33cb44,_0x39509f){return new Promise(function(_0x425786,_0x5accbb){var _0x29faa9=[];if(_[_0x31ef('0x2f')](_0x33cb44))return _0x425786(_0x29faa9);_0x24447b[_0x31ef('0x30')][_0x31ef('0x31')]({'attributes':['id','interval',_0x31ef('0x32')],'raw':!![]})[_0x31ef('0x33')](function(_0x8602ce){for(var _0x23b2cf=0x0,_0x4c003e=0x0;_0x23b2cf<_0x33cb44['length'];_0x23b2cf++,_0x4c003e=0x0){var _0x162234=_0x33cb44[_0x23b2cf];var _0x45c29c=[];var _0x162406=[];delete _0x162234['id'];if(_0x162234[_0x31ef('0x34')]!=='*,*,*,*'){_0x162234[_0x31ef('0x35')]=[_0x162234[_0x31ef('0x34')]];}else{_0x162234[_0x31ef('0x35')]=_0x162234[_0x31ef('0x32')]?_[_0x31ef('0x36')](_[_0x31ef('0x37')](_0x8602ce,{'IntervalId':_0x162234['IntervalId']}),'interval'):[];}_0x162234[_0x31ef('0x6')]=_0x4dae63[_0x31ef('0x6')];_0x162234['exten']=_0x4dae63[_0x31ef('0x7')];if(_0x162234[_0x31ef('0x3')])_0x162234[_0x31ef('0x3')]=_0x162234['type'][_0x31ef('0x38')]();if(_0x4dae63[_0x31ef('0x3')]==='outbound'){if(_0x162234[_0x31ef('0x1b')](_0x31ef('0x39'))&&_0x162234[_0x31ef('0x39')]&&_0x162234['tag']!=='--'){_0x45c29c[_0x31ef('0xa')]({'type':_0x162234[_0x31ef('0x3')]['toLowerCase'](),'app':'Set','appdata':_0x31ef('0x3a')+_0x162234[_0x31ef('0x39')],'context':_0x4dae63[_0x31ef('0x6')],'exten':_0x4dae63[_0x31ef('0x7')],'priority':_0x162234['intervals'][_0x31ef('0x23')]+_0x39509f+_0x4c003e++,'VoiceExtensionId':_0x4dae63['id']});}_0x45c29c[_0x31ef('0xa')]({'type':_0x162234[_0x31ef('0x3')][_0x31ef('0x38')](),'app':_0x31ef('0x17'),'appdata':_0x31ef('0x3b')+(_0x162234[_0x31ef('0x3c')]?_0x31ef('0x3d')+_0x162234['callerID']+')':_0x31ef('0x3e')),'context':_0x4dae63[_0x31ef('0x6')],'exten':_0x4dae63[_0x31ef('0x7')],'priority':_0x162234['intervals'][_0x31ef('0x23')]+_0x39509f+_0x4c003e++,'VoiceExtensionId':_0x4dae63['id']});}else{if(_0x162234[_0x31ef('0x1b')](_0x31ef('0x3f'))){if(['queue',_0x31ef('0x40')][_0x31ef('0x41')](_0x162234[_0x31ef('0x42')][_0x31ef('0x38')]())&&_0x162234['appType']!==_0x31ef('0x43')){if(_0x162234['answer']){_0x45c29c[_0x31ef('0xa')]({'type':_0x162234[_0x31ef('0x3')][_0x31ef('0x38')](),'app':_0x31ef('0x17'),'appdata':_0x31ef('0x44'),'context':_0x4dae63[_0x31ef('0x6')],'exten':_0x4dae63[_0x31ef('0x7')],'priority':_0x162234['intervals'][_0x31ef('0x23')]+_0x39509f+_0x4c003e++,'VoiceExtensionId':_0x4dae63['id']});_0x45c29c[_0x31ef('0xa')]({'type':_0x162234[_0x31ef('0x3')][_0x31ef('0x38')](),'app':_0x31ef('0x4'),'appdata':_0x31ef('0x45'),'context':_0x4dae63['context'],'exten':_0x4dae63[_0x31ef('0x7')],'priority':_0x162234[_0x31ef('0x35')][_0x31ef('0x23')]+_0x39509f+_0x4c003e++,'VoiceExtensionId':_0x4dae63['id']});}else{_0x45c29c['push']({'type':_0x162234['type'][_0x31ef('0x38')](),'app':'ExecIf','appdata':_0x31ef('0x46'),'context':_0x4dae63['context'],'exten':_0x4dae63['exten'],'priority':_0x162234[_0x31ef('0x35')]['length']+_0x39509f+_0x4c003e++,'VoiceExtensionId':_0x4dae63['id']});_0x45c29c[_0x31ef('0xa')]({'type':_0x162234[_0x31ef('0x3')]['toLowerCase'](),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x4dae63[_0x31ef('0x6')],'exten':_0x4dae63[_0x31ef('0x7')],'priority':_0x162234[_0x31ef('0x35')][_0x31ef('0x23')]+_0x39509f+_0x4c003e++,'VoiceExtensionId':_0x4dae63['id']});}}}}for(var _0x3222e1=0x0;_0x3222e1<_0x162234['intervals'][_0x31ef('0x23')];_0x3222e1++){var _0x16f858=_0x39509f+_0x162234[_0x31ef('0x35')][_0x31ef('0x23')];var _0x47167c=_0x3222e1===_0x162234['intervals']['length']-0x1?_0x39509f+_0x45c29c[_0x31ef('0x23')]+_0x162406[_0x31ef('0x23')]+0x2:_0x39509f+_0x3222e1+0x1;_0x45c29c[_0x31ef('0x47')](_0x3222e1,0x0,{'type':_0x4dae63[_0x31ef('0x3')],'app':'GotoIfTime','appdata':_0x162234[_0x31ef('0x35')][_0x3222e1]+'?'+_0x4dae63[_0x31ef('0x6')]+_0x31ef('0x48')+_0x16f858+':'+_0x4dae63[_0x31ef('0x6')]+',${EXTEN},'+_0x47167c,'exten':_0x4dae63[_0x31ef('0x7')],'context':_0x4dae63[_0x31ef('0x6')],'priority':_0x39509f+_0x3222e1,'VoiceExtensionId':_0x4dae63['id']});}if(_0x162234[_0x31ef('0x49')]==='outboundDial')_0x162234['appdata']=_0x4ea4cb(_0x4dae63,_0x162234[_0x31ef('0x4a')]);_0x162234[_0x31ef('0x4b')]=_0x45c29c[_0x31ef('0x23')]?_[_0x31ef('0x4c')](_0x45c29c)[_0x31ef('0x4b')]+0x1:_0x39509f;_0x29faa9=_['concat'](_0x29faa9,_0x45c29c,[_0x162234],_0x162406);_0x39509f=_[_0x31ef('0x4c')](_0x29faa9)['priority']+0x1;}return _0x425786(_0x29faa9);})['catch'](function(_0x494dfd){_0x5accbb(_0x494dfd);});});}return _0x2097e1[_0x31ef('0x4d')](_0x31ef('0x4e'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x584f25){var _0x5eff1a=this[_0x31ef('0x4f')]({'plain':!![]});var _0x4872a7=_0x5eff1a[_0x31ef('0x3')]===_0x31ef('0x10')?_0x8910a9(_0x5eff1a):_0x4df75f(_0x5eff1a);return _0x34047e(_0x5eff1a,_0x584f25,_[_0x31ef('0x4c')](_0x4872a7)['priority']+0x1)[_0x31ef('0x33')](function(_0x22dd78){var _0x39c2dd=_[_0x31ef('0x50')](_0x4872a7,_0x22dd78);_0x39c2dd[_0x31ef('0xa')]({'type':_0x5eff1a[_0x31ef('0x3')],'app':_0x31ef('0x51'),'exten':_0x5eff1a['exten'],'context':_0x5eff1a['context'],'priority':_[_0x31ef('0x4c')](_0x39c2dd)[_0x31ef('0x4b')]+0x1,'VoiceExtensionId':_0x5eff1a['id']});return _0x39c2dd;});}}});}; \ No newline at end of file +var _0xa8c4=['wav','trunk','timeout','options','url','length','name','param','split','phone','prefix','SIP','indexOf','U(xcally-mixmonitor-context)','join','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','answer','playback','includes','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','appdata','priority','last','concat','catch','define','VoiceExtension','voice_extensions','get','Hangup','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','NoOp','alias','CDR(routeAlias)=','No\x20alias\x20set','inbound','CDR(routeid)=','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(destination)=','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT='];(function(_0x460150,_0x232949){var _0x340677=function(_0x5b7e32){while(--_0x5b7e32){_0x460150['push'](_0x460150['shift']());}};_0x340677(++_0x232949);}(_0xa8c4,0x12d));var _0x4a8c=function(_0x17fdf1,_0xd819ae){_0x17fdf1=_0x17fdf1-0x0;var _0x50cfec=_0xa8c4[_0x17fdf1];return _0x50cfec;};'use strict';var _=require('lodash');var attributes=require(_0x4a8c('0x0'));module[_0x4a8c('0x1')]=function(_0x5cb13b){var _0xcd762c=_0x5cb13b[_0x4a8c('0x2')];function _0x4ddf3b(_0x2bbcab){var _0x402ceb=0x2;var _0x3eb6cf=[{'type':_0x2bbcab[_0x4a8c('0x3')],'app':_0x4a8c('0x4'),'appdata':_0x4a8c('0x5')+_0x2bbcab[_0x4a8c('0x3')],'context':_0x2bbcab[_0x4a8c('0x6')],'exten':_0x2bbcab[_0x4a8c('0x7')],'priority':_0x402ceb++,'VoiceExtensionId':_0x2bbcab['id']},{'type':_0x2bbcab[_0x4a8c('0x3')],'app':_0x2bbcab['alias']?_0x4a8c('0x4'):_0x4a8c('0x8'),'appdata':_0x2bbcab[_0x4a8c('0x9')]?_0x4a8c('0xa')+_0x2bbcab[_0x4a8c('0x9')]:_0x4a8c('0xb'),'context':_0x2bbcab[_0x4a8c('0x6')],'exten':_0x2bbcab[_0x4a8c('0x7')],'priority':_0x402ceb++,'VoiceExtensionId':_0x2bbcab['id']}];if(_0x2bbcab['type']===_0x4a8c('0xc')){_0x3eb6cf['push']({'type':'inbound','app':_0x4a8c('0x4'),'appdata':_0x4a8c('0xd')+_0x2bbcab['id'],'context':_0x2bbcab[_0x4a8c('0x6')],'exten':_0x2bbcab[_0x4a8c('0x7')],'priority':_0x402ceb++,'VoiceExtensionId':_0x2bbcab['id']});}_0x3eb6cf[_0x4a8c('0xe')]({'type':_0x2bbcab[_0x4a8c('0x3')],'app':_0x4a8c('0x4'),'appdata':_0x4a8c('0xf'),'context':_0x2bbcab[_0x4a8c('0x6')],'exten':_0x2bbcab['exten'],'priority':_0x402ceb++,'VoiceExtensionId':_0x2bbcab['id']},{'type':_0x2bbcab[_0x4a8c('0x3')],'app':_0x4a8c('0x4'),'appdata':_0x4a8c('0x10'),'context':_0x2bbcab[_0x4a8c('0x6')],'exten':_0x2bbcab[_0x4a8c('0x7')],'priority':_0x402ceb++,'VoiceExtensionId':_0x2bbcab['id']},{'type':_0x2bbcab[_0x4a8c('0x3')],'app':_0x4a8c('0x4'),'appdata':_0x4a8c('0x11'),'context':_0x2bbcab['context'],'exten':_0x2bbcab[_0x4a8c('0x7')],'priority':_0x402ceb++,'VoiceExtensionId':_0x2bbcab['id']});return _0x3eb6cf;}function _0x3cf5aa(_0x48c327){var _0x473847=0x2;var _0x13de46=[{'type':_0x4a8c('0x12'),'app':_0x4a8c('0x4'),'appdata':'CDR(type)=outbound','context':_0x48c327['context'],'exten':_0x48c327[_0x4a8c('0x7')],'priority':_0x473847++,'VoiceExtensionId':_0x48c327['id']},{'type':_0x4a8c('0x12'),'app':_0x48c327[_0x4a8c('0x9')]?_0x4a8c('0x4'):_0x4a8c('0x8'),'appdata':_0x48c327['alias']?_0x4a8c('0xa')+_0x48c327[_0x4a8c('0x9')]:_0x4a8c('0xb'),'context':_0x48c327[_0x4a8c('0x6')],'exten':_0x48c327['exten'],'priority':_0x473847++,'VoiceExtensionId':_0x48c327['id']},{'type':_0x4a8c('0x12'),'app':_0x4a8c('0x4'),'appdata':_0x4a8c('0x13')+(_0x48c327[_0x4a8c('0x14')]?_0x4a8c('0x15')+_0x48c327[_0x4a8c('0x14')]+'}':'${EXTEN}'),'context':_0x48c327[_0x4a8c('0x6')],'exten':_0x48c327[_0x4a8c('0x7')],'priority':_0x473847++,'VoiceExtensionId':_0x48c327['id']},{'type':'outbound','app':_0x4a8c('0x4'),'appdata':_0x4a8c('0xd')+_0x48c327['id'],'context':_0x48c327[_0x4a8c('0x6')],'exten':_0x48c327[_0x4a8c('0x7')],'priority':_0x473847++,'VoiceExtensionId':_0x48c327['id']},{'type':'outbound','app':_0x4a8c('0x16'),'appdata':_0x4a8c('0x17')+(_0x473847+0x2)+_0x4a8c('0x18')+(_0x473847+0x1)+')','context':_0x48c327[_0x4a8c('0x6')],'exten':_0x48c327[_0x4a8c('0x7')],'priority':_0x473847++,'VoiceExtensionId':_0x48c327['id']},{'type':_0x4a8c('0x12'),'app':_0x4a8c('0x4'),'appdata':_0x48c327['cutdigits']?_0x4a8c('0x19')+_0x48c327[_0x4a8c('0x14')]+'}':'CDR(prefix)=noprefix','context':_0x48c327['context'],'exten':_0x48c327[_0x4a8c('0x7')],'priority':_0x473847++,'VoiceExtensionId':_0x48c327['id']},{'type':'outbound','app':_0x4a8c('0x4'),'appdata':_0x4a8c('0xf'),'context':_0x48c327[_0x4a8c('0x6')],'exten':_0x48c327['exten'],'priority':_0x473847++,'VoiceExtensionId':_0x48c327['id']},{'type':_0x4a8c('0x12'),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x48c327[_0x4a8c('0x6')],'exten':_0x48c327[_0x4a8c('0x7')],'priority':_0x473847++,'VoiceExtensionId':_0x48c327['id']},{'type':'outbound','app':_0x4a8c('0x4'),'appdata':_0x4a8c('0x11'),'context':_0x48c327[_0x4a8c('0x6')],'exten':_0x48c327[_0x4a8c('0x7')],'priority':_0x473847++,'VoiceExtensionId':_0x48c327['id']},{'type':_0x4a8c('0x12'),'app':_0x4a8c('0x4'),'appdata':_0x4a8c('0x1a')+_0x48c327['id'],'context':_0x48c327[_0x4a8c('0x6')],'exten':_0x48c327[_0x4a8c('0x7')],'priority':_0x473847++,'VoiceExtensionId':_0x48c327['id']}];if(_0x48c327[_0x4a8c('0x1b')](_0x4a8c('0x1c'))&&_0x48c327['recordingFormat']!==_0x4a8c('0x1d')){_0x13de46['push']({'type':_0x4a8c('0x12'),'app':_0x4a8c('0x4'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x48c327['context'],'exten':_0x48c327['exten'],'priority':_0x473847++,'VoiceExtensionId':_0x48c327['id']},{'type':_0x4a8c('0x12'),'app':_0x4a8c('0x4'),'appdata':_0x4a8c('0x1e')+_0x48c327['recordingFormat']||_0x4a8c('0x1f'),'context':_0x48c327[_0x4a8c('0x6')],'exten':_0x48c327[_0x4a8c('0x7')],'priority':_0x473847++,'VoiceExtensionId':_0x48c327['id']});}return _0x13de46;}function _0x1a3ce3(_0xde5ddd,_0x30e8e){var _0x2e9c38=[{'name':_0x4a8c('0x20'),'param':0x0},{'name':_0x4a8c('0x21'),'param':0x1},{'name':_0x4a8c('0x22'),'param':0x2},{'name':_0x4a8c('0x23'),'param':0x3}];var _0x337e2f={};var _0x297cb0=_0x30e8e['split'](',');var _0x5e1dc2=[];for(var _0x4782af=0x0;_0x4782af<_0x2e9c38[_0x4a8c('0x24')];_0x4782af++){switch(_0x2e9c38[_0x4782af][_0x4a8c('0x25')]){case _0x4a8c('0x20'):_0x337e2f[_0x4a8c('0x20')]=_0x297cb0[_0x2e9c38[_0x4782af][_0x4a8c('0x26')]][_0x4a8c('0x27')]('/')[0x1];_0x337e2f[_0x4a8c('0x28')]=_0x297cb0[_0x2e9c38[_0x4782af]['param']][_0x4a8c('0x27')]('/')[0x2];_0x337e2f['prefix']=_0x337e2f['phone']?_0x337e2f['phone']['split']('$')[0x0]:undefined;_0x337e2f[_0x4a8c('0x28')]=_0xde5ddd['cutdigits']?(_0x337e2f[_0x4a8c('0x29')]||'')+_0x4a8c('0x15')+_0xde5ddd[_0x4a8c('0x14')]+'}':(_0x337e2f[_0x4a8c('0x29')]||'')+'${EXTEN}';_0x5e1dc2[_0x2e9c38[_0x4782af]['param']]=[_0x4a8c('0x2a'),_0x337e2f[_0x4a8c('0x20')],_0x337e2f[_0x4a8c('0x28')]]['join']('/');break;case'options':_0x337e2f[_0x4a8c('0x22')]=_0x297cb0[_0x2e9c38[_0x4782af]['param']];if(_0xde5ddd[_0x4a8c('0x1c')]!==_0x4a8c('0x1d')){if(_0x337e2f[_0x4a8c('0x22')][_0x4a8c('0x2b')](_0x4a8c('0x2c'))<0x0){_0x337e2f[_0x4a8c('0x22')]+=_0x4a8c('0x2c');}}else{_0x337e2f[_0x4a8c('0x22')]=_0x337e2f[_0x4a8c('0x22')]['replace'](_0x4a8c('0x2c'),'');}_0x5e1dc2[_0x2e9c38[_0x4782af]['param']]=_0x337e2f[_0x4a8c('0x22')];break;default:_0x5e1dc2[_0x2e9c38[_0x4782af][_0x4a8c('0x26')]]=_0x297cb0[_0x2e9c38[_0x4782af][_0x4a8c('0x26')]];}}return _0x5e1dc2[_0x4a8c('0x2d')](',');}function _0x17333a(_0x2f0c30,_0x5812f4,_0x53289a){return new Promise(function(_0x3ec08b,_0xc9af98){var _0x1c4afe=[];if(_[_0x4a8c('0x2e')](_0x5812f4))return _0x3ec08b(_0x1c4afe);_0xcd762c[_0x4a8c('0x2f')][_0x4a8c('0x30')]({'attributes':['id',_0x4a8c('0x31'),_0x4a8c('0x32')],'raw':!![]})[_0x4a8c('0x33')](function(_0x1ba212){for(var _0x19ca7a=0x0,_0xd4c801=0x0;_0x19ca7a<_0x5812f4['length'];_0x19ca7a++,_0xd4c801=0x0){var _0x250b13=_0x5812f4[_0x19ca7a];var _0x993279=[];var _0x305072=[];delete _0x250b13['id'];if(_0x250b13[_0x4a8c('0x31')]!==_0x4a8c('0x34')){_0x250b13['intervals']=[_0x250b13[_0x4a8c('0x31')]];}else{_0x250b13[_0x4a8c('0x35')]=_0x250b13[_0x4a8c('0x32')]?_[_0x4a8c('0x36')](_[_0x4a8c('0x37')](_0x1ba212,{'IntervalId':_0x250b13[_0x4a8c('0x32')]}),_0x4a8c('0x31')):[];}_0x250b13[_0x4a8c('0x6')]=_0x2f0c30['context'];_0x250b13[_0x4a8c('0x7')]=_0x2f0c30[_0x4a8c('0x7')];if(_0x250b13[_0x4a8c('0x3')])_0x250b13[_0x4a8c('0x3')]=_0x250b13['type'][_0x4a8c('0x38')]();if(_0x2f0c30[_0x4a8c('0x3')]==='outbound'){if(_0x250b13[_0x4a8c('0x1b')](_0x4a8c('0x39'))&&_0x250b13[_0x4a8c('0x39')]&&_0x250b13[_0x4a8c('0x39')]!=='--'){_0x993279[_0x4a8c('0xe')]({'type':_0x250b13['type'][_0x4a8c('0x38')](),'app':_0x4a8c('0x4'),'appdata':_0x4a8c('0x3a')+_0x250b13[_0x4a8c('0x39')],'context':_0x2f0c30[_0x4a8c('0x6')],'exten':_0x2f0c30['exten'],'priority':_0x250b13[_0x4a8c('0x35')][_0x4a8c('0x24')]+_0x53289a+_0xd4c801++,'VoiceExtensionId':_0x2f0c30['id']});}_0x993279['push']({'type':_0x250b13[_0x4a8c('0x3')]['toLowerCase'](),'app':_0x4a8c('0x16'),'appdata':_0x4a8c('0x3b')+(_0x250b13[_0x4a8c('0x3c')]?_0x4a8c('0x3d')+_0x250b13['callerID']+')':'NoOp(No\x20number\x20available)'),'context':_0x2f0c30[_0x4a8c('0x6')],'exten':_0x2f0c30['exten'],'priority':_0x250b13[_0x4a8c('0x35')][_0x4a8c('0x24')]+_0x53289a+_0xd4c801++,'VoiceExtensionId':_0x2f0c30['id']});}else{if(_0x250b13['hasOwnProperty'](_0x4a8c('0x3e'))){if(['queue',_0x4a8c('0x3f')][_0x4a8c('0x40')](_0x250b13[_0x4a8c('0x41')]['toLowerCase']())&&_0x250b13[_0x4a8c('0x42')]!==_0x4a8c('0x43')){if(_0x250b13[_0x4a8c('0x3e')]){_0x993279[_0x4a8c('0xe')]({'type':_0x250b13[_0x4a8c('0x3')][_0x4a8c('0x38')](),'app':_0x4a8c('0x16'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x2f0c30[_0x4a8c('0x6')],'exten':_0x2f0c30[_0x4a8c('0x7')],'priority':_0x250b13[_0x4a8c('0x35')]['length']+_0x53289a+_0xd4c801++,'VoiceExtensionId':_0x2f0c30['id']});_0x993279['push']({'type':_0x250b13['type'][_0x4a8c('0x38')](),'app':_0x4a8c('0x4'),'appdata':_0x4a8c('0x44'),'context':_0x2f0c30['context'],'exten':_0x2f0c30[_0x4a8c('0x7')],'priority':_0x250b13[_0x4a8c('0x35')][_0x4a8c('0x24')]+_0x53289a+_0xd4c801++,'VoiceExtensionId':_0x2f0c30['id']});}else{_0x993279[_0x4a8c('0xe')]({'type':_0x250b13[_0x4a8c('0x3')][_0x4a8c('0x38')](),'app':'ExecIf','appdata':_0x4a8c('0x45'),'context':_0x2f0c30[_0x4a8c('0x6')],'exten':_0x2f0c30[_0x4a8c('0x7')],'priority':_0x250b13[_0x4a8c('0x35')][_0x4a8c('0x24')]+_0x53289a+_0xd4c801++,'VoiceExtensionId':_0x2f0c30['id']});_0x993279[_0x4a8c('0xe')]({'type':_0x250b13[_0x4a8c('0x3')][_0x4a8c('0x38')](),'app':_0x4a8c('0x4'),'appdata':_0x4a8c('0x46'),'context':_0x2f0c30[_0x4a8c('0x6')],'exten':_0x2f0c30['exten'],'priority':_0x250b13['intervals']['length']+_0x53289a+_0xd4c801++,'VoiceExtensionId':_0x2f0c30['id']});}}}}for(var _0x4b97a2=0x0;_0x4b97a2<_0x250b13[_0x4a8c('0x35')][_0x4a8c('0x24')];_0x4b97a2++){var _0xe5f774=_0x53289a+_0x250b13[_0x4a8c('0x35')][_0x4a8c('0x24')];var _0x158eda=_0x4b97a2===_0x250b13[_0x4a8c('0x35')][_0x4a8c('0x24')]-0x1?_0x53289a+_0x993279[_0x4a8c('0x24')]+_0x305072['length']+0x2:_0x53289a+_0x4b97a2+0x1;_0x993279[_0x4a8c('0x47')](_0x4b97a2,0x0,{'type':_0x2f0c30[_0x4a8c('0x3')],'app':'GotoIfTime','appdata':_0x250b13[_0x4a8c('0x35')][_0x4b97a2]+'?'+_0x2f0c30[_0x4a8c('0x6')]+_0x4a8c('0x48')+_0xe5f774+':'+_0x2f0c30['context']+_0x4a8c('0x48')+_0x158eda,'exten':_0x2f0c30[_0x4a8c('0x7')],'context':_0x2f0c30['context'],'priority':_0x53289a+_0x4b97a2,'VoiceExtensionId':_0x2f0c30['id']});}if(_0x250b13[_0x4a8c('0x42')]==='outboundDial')_0x250b13['appdata']=_0x1a3ce3(_0x2f0c30,_0x250b13[_0x4a8c('0x49')]);_0x250b13[_0x4a8c('0x4a')]=_0x993279[_0x4a8c('0x24')]?_[_0x4a8c('0x4b')](_0x993279)[_0x4a8c('0x4a')]+0x1:_0x53289a;_0x1c4afe=_[_0x4a8c('0x4c')](_0x1c4afe,_0x993279,[_0x250b13],_0x305072);_0x53289a=_[_0x4a8c('0x4b')](_0x1c4afe)[_0x4a8c('0x4a')]+0x1;}return _0x3ec08b(_0x1c4afe);})[_0x4a8c('0x4d')](function(_0x28407d){_0xc9af98(_0x28407d);});});}return _0x5cb13b[_0x4a8c('0x4e')](_0x4a8c('0x4f'),attributes,{'tableName':_0x4a8c('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x16c724){var _0x1107cd=this[_0x4a8c('0x51')]({'plain':!![]});var _0x34147f=_0x1107cd[_0x4a8c('0x3')]===_0x4a8c('0x12')?_0x3cf5aa(_0x1107cd):_0x4ddf3b(_0x1107cd);return _0x17333a(_0x1107cd,_0x16c724,_[_0x4a8c('0x4b')](_0x34147f)[_0x4a8c('0x4a')]+0x1)[_0x4a8c('0x33')](function(_0xf954e4){var _0x9ce21d=_[_0x4a8c('0x4c')](_0x34147f,_0xf954e4);_0x9ce21d[_0x4a8c('0xe')]({'type':_0x1107cd[_0x4a8c('0x3')],'app':_0x4a8c('0x52'),'exten':_0x1107cd['exten'],'context':_0x1107cd[_0x4a8c('0x6')],'priority':_['last'](_0x9ce21d)[_0x4a8c('0x4a')]+0x1,'VoiceExtensionId':_0x1107cd['id']});return _0x9ce21d;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 31671a3..9d8eb5c 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 _0x9f02=['then','debug','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','socket.io-emitter','./voiceExtension.socket','register','info','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension','findAll','options','where','limit','include','map','model','attributes'];(function(_0x29a32f,_0x379acd){var _0x5201d4=function(_0x4a01e8){while(--_0x4a01e8){_0x29a32f['push'](_0x29a32f['shift']());}};_0x5201d4(++_0x379acd);}(_0x9f02,0x68));var _0x29f0=function(_0x5ed09c,_0x1eb30d){_0x5ed09c=_0x5ed09c-0x0;var _0x5ca820=_0x9f02[_0x5ed09c];return _0x5ca820;};'use strict';var _=require(_0x29f0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x29f0('0x1'));var fs=require('fs');var Redis=require(_0x29f0('0x2'));var db=require(_0x29f0('0x3'))['db'];var utils=require(_0x29f0('0x4'));var logger=require(_0x29f0('0x5'))('rpc');var config=require(_0x29f0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x29f0('0x7')][_0x29f0('0x8')]({'port':0x232a});config[_0x29f0('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x29f0('0xa'))(new Redis(config['redis']));require(_0x29f0('0xb'))[_0x29f0('0xc')](socket);function respondWithRpcPromise(_0x581e4,_0x529ded,_0x48adaf){return new BPromise(function(_0x3e1eeb,_0x5a8eb2){return client['request'](_0x581e4,_0x48adaf)['then'](function(_0x488b7f){logger[_0x29f0('0xd')]('VoiceExtension,\x20%s,\x20%s',_0x529ded,_0x29f0('0xe'));logger['debug'](_0x29f0('0xf'),_0x529ded,_0x29f0('0xe'),JSON[_0x29f0('0x10')](_0x488b7f));if(_0x488b7f[_0x29f0('0x11')]){if(_0x488b7f['error'][_0x29f0('0x12')]===0x1f4){logger[_0x29f0('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x529ded,_0x488b7f[_0x29f0('0x11')]['message']);return _0x5a8eb2(_0x488b7f[_0x29f0('0x11')]['message']);}logger[_0x29f0('0x11')](_0x29f0('0x13'),_0x529ded,_0x488b7f['error']['message']);return _0x3e1eeb(_0x488b7f['error'][_0x29f0('0x14')]);}else{logger[_0x29f0('0xd')](_0x29f0('0x13'),_0x529ded,'request\x20sent');_0x3e1eeb(_0x488b7f[_0x29f0('0x15')][_0x29f0('0x14')]);}})[_0x29f0('0x16')](function(_0x12e197){logger[_0x29f0('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x529ded,_0x12e197);_0x5a8eb2(_0x12e197);});});}exports[_0x29f0('0x17')]=function(_0xf7da2e){var _0x340fc0=this;return new Promise(function(_0x5a4579,_0x2fd36b){return db['VoiceExtension'][_0x29f0('0x18')]({'raw':_0xf7da2e[_0x29f0('0x19')]?_0xf7da2e[_0x29f0('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xf7da2e[_0x29f0('0x19')]?_0xf7da2e[_0x29f0('0x19')][_0x29f0('0x1a')]||null:null,'attributes':_0xf7da2e[_0x29f0('0x19')]?_0xf7da2e[_0x29f0('0x19')]['attributes']||null:null,'limit':_0xf7da2e[_0x29f0('0x19')]?_0xf7da2e[_0x29f0('0x19')][_0x29f0('0x1b')]||null:null,'include':_0xf7da2e[_0x29f0('0x19')]?_0xf7da2e[_0x29f0('0x19')][_0x29f0('0x1c')]?_[_0x29f0('0x1d')](_0xf7da2e[_0x29f0('0x19')][_0x29f0('0x1c')],function(_0x2012c3){return{'model':db[_0x2012c3[_0x29f0('0x1e')]],'as':_0x2012c3['as'],'attributes':_0x2012c3['attributes'],'include':_0x2012c3[_0x29f0('0x1c')]?_[_0x29f0('0x1d')](_0x2012c3['include'],function(_0x5afe68){return{'model':db[_0x5afe68[_0x29f0('0x1e')]],'as':_0x5afe68['as'],'attributes':_0x5afe68[_0x29f0('0x1f')],'include':_0x5afe68['include']?_[_0x29f0('0x1d')](_0x5afe68[_0x29f0('0x1c')],function(_0x115996){return{'model':db[_0x115996['model']],'as':_0x115996['as'],'attributes':_0x115996['attributes']};}):[]};}):[]};}):[]:[]})[_0x29f0('0x20')](function(_0x3dc23b){logger[_0x29f0('0xd')](_0x29f0('0x17'),_0xf7da2e);logger[_0x29f0('0x21')]('GetVoiceExtension',_0xf7da2e,JSON[_0x29f0('0x10')](_0x3dc23b));_0x5a4579(_0x3dc23b);})[_0x29f0('0x16')](function(_0x1fcdfa){logger[_0x29f0('0x11')](_0x29f0('0x17'),_0x1fcdfa[_0x29f0('0x14')],_0xf7da2e);_0x2fd36b(_0x340fc0[_0x29f0('0x11')](0x1f4,_0x1fcdfa['message']));});});}; \ No newline at end of file +var _0xbd0e=['../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','include','map','model','then','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4afac5,_0x1ab4ed){var _0x2404b3=function(_0x5c700b){while(--_0x5c700b){_0x4afac5['push'](_0x4afac5['shift']());}};_0x2404b3(++_0x1ab4ed);}(_0xbd0e,0x187));var _0xebd0=function(_0xe485c4,_0x3d0f36){_0xe485c4=_0xe485c4-0x0;var _0x24cb58=_0xbd0e[_0xe485c4];return _0x24cb58;};'use strict';var _=require('lodash');var util=require(_0xebd0('0x0'));var moment=require('moment');var BPromise=require(_0xebd0('0x1'));var rs=require(_0xebd0('0x2'));var fs=require('fs');var Redis=require(_0xebd0('0x3'));var db=require(_0xebd0('0x4'))['db'];var utils=require(_0xebd0('0x5'));var logger=require(_0xebd0('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xebd0('0x7'));var client=jayson[_0xebd0('0x8')][_0xebd0('0x9')]({'port':0x232a});config[_0xebd0('0xa')]=_[_0xebd0('0xb')](config[_0xebd0('0xa')],{'host':_0xebd0('0xc'),'port':0x18eb});var socket=require(_0xebd0('0xd'))(new Redis(config[_0xebd0('0xa')]));require('./voiceExtension.socket')[_0xebd0('0xe')](socket);function respondWithRpcPromise(_0x474bef,_0x2dbee9,_0x54b2a1){return new BPromise(function(_0xbec226,_0x1346d1){return client['request'](_0x474bef,_0x54b2a1)['then'](function(_0xb15b3e){logger[_0xebd0('0xf')](_0xebd0('0x10'),_0x2dbee9,_0xebd0('0x11'));logger[_0xebd0('0x12')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x2dbee9,_0xebd0('0x11'),JSON[_0xebd0('0x13')](_0xb15b3e));if(_0xb15b3e[_0xebd0('0x14')]){if(_0xb15b3e['error'][_0xebd0('0x15')]===0x1f4){logger[_0xebd0('0x14')](_0xebd0('0x10'),_0x2dbee9,_0xb15b3e[_0xebd0('0x14')][_0xebd0('0x16')]);return _0x1346d1(_0xb15b3e[_0xebd0('0x14')][_0xebd0('0x16')]);}logger[_0xebd0('0x14')](_0xebd0('0x10'),_0x2dbee9,_0xb15b3e[_0xebd0('0x14')][_0xebd0('0x16')]);return _0xbec226(_0xb15b3e[_0xebd0('0x14')][_0xebd0('0x16')]);}else{logger[_0xebd0('0xf')](_0xebd0('0x10'),_0x2dbee9,'request\x20sent');_0xbec226(_0xb15b3e[_0xebd0('0x17')][_0xebd0('0x16')]);}})[_0xebd0('0x18')](function(_0x2834ad){logger['error'](_0xebd0('0x10'),_0x2dbee9,_0x2834ad);_0x1346d1(_0x2834ad);});});}exports[_0xebd0('0x19')]=function(_0x51774c){var _0x22bb7f=this;return new Promise(function(_0x4ef17f,_0x4720d5){return db[_0xebd0('0x1a')][_0xebd0('0x1b')]({'raw':_0x51774c[_0xebd0('0x1c')]?_0x51774c['options'][_0xebd0('0x1d')]===undefined?!![]:![]:!![],'where':_0x51774c['options']?_0x51774c[_0xebd0('0x1c')][_0xebd0('0x1e')]||null:null,'attributes':_0x51774c[_0xebd0('0x1c')]?_0x51774c['options'][_0xebd0('0x1f')]||null:null,'limit':_0x51774c[_0xebd0('0x1c')]?_0x51774c[_0xebd0('0x1c')]['limit']||null:null,'include':_0x51774c[_0xebd0('0x1c')]?_0x51774c[_0xebd0('0x1c')][_0xebd0('0x20')]?_[_0xebd0('0x21')](_0x51774c['options']['include'],function(_0x144f13){return{'model':db[_0x144f13[_0xebd0('0x22')]],'as':_0x144f13['as'],'attributes':_0x144f13[_0xebd0('0x1f')],'include':_0x144f13[_0xebd0('0x20')]?_[_0xebd0('0x21')](_0x144f13['include'],function(_0x411eb4){return{'model':db[_0x411eb4[_0xebd0('0x22')]],'as':_0x411eb4['as'],'attributes':_0x411eb4[_0xebd0('0x1f')],'include':_0x411eb4[_0xebd0('0x20')]?_[_0xebd0('0x21')](_0x411eb4['include'],function(_0x53169b){return{'model':db[_0x53169b['model']],'as':_0x53169b['as'],'attributes':_0x53169b['attributes']};}):[]};}):[]};}):[]:[]})[_0xebd0('0x23')](function(_0x3b9033){logger[_0xebd0('0xf')]('GetVoiceExtension',_0x51774c);logger['debug']('GetVoiceExtension',_0x51774c,JSON[_0xebd0('0x13')](_0x3b9033));_0x4ef17f(_0x3b9033);})[_0xebd0('0x18')](function(_0x30a12a){logger[_0xebd0('0x14')](_0xebd0('0x19'),_0x30a12a[_0xebd0('0x16')],_0x51774c);_0x4720d5(_0x22bb7f[_0xebd0('0x14')](0x1f4,_0x30a12a[_0xebd0('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index cd8fd5b..edb1d60 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 _0x326f=['update','emit','removeListener','register','length','./voiceExtension.events'];(function(_0x483dde,_0xa6e721){var _0x483ca5=function(_0x39f13d){while(--_0x39f13d){_0x483dde['push'](_0x483dde['shift']());}};_0x483ca5(++_0xa6e721);}(_0x326f,0xd1));var _0xf326=function(_0x12ea6c,_0x5a4603){_0x12ea6c=_0x12ea6c-0x0;var _0x3e89ef=_0x326f[_0x12ea6c];return _0x3e89ef;};'use strict';var VoiceExtensionEvents=require(_0xf326('0x0'));var events=['save','remove',_0xf326('0x1')];function createListener(_0x330ddb,_0x22aabf){return function(_0x408257){_0x22aabf[_0xf326('0x2')](_0x330ddb,_0x408257);};}function removeListener(_0x120a26,_0x9445c6){return function(){VoiceExtensionEvents[_0xf326('0x3')](_0x120a26,_0x9445c6);};}exports[_0xf326('0x4')]=function(_0x3ace29){for(var _0x4c2249=0x0,_0x3c254d=events[_0xf326('0x5')];_0x4c2249<_0x3c254d;_0x4c2249++){var _0x165f95=events[_0x4c2249];var _0x1e7b8a=createListener('voiceExtension:'+_0x165f95,_0x3ace29);VoiceExtensionEvents['on'](_0x165f95,_0x1e7b8a);}}; \ No newline at end of file +var _0xabce=['voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x32cb5e,_0x302fc5){var _0x27bd09=function(_0x3c33bc){while(--_0x3c33bc){_0x32cb5e['push'](_0x32cb5e['shift']());}};_0x27bd09(++_0x302fc5);}(_0xabce,0x103));var _0xeabc=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xabce[_0xb0f7c3];return _0x28ea68;};'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 cda301d..50a39dc 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 _0x1623=['/:id','show','get','/:id/messages','getMessages','post','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceMail.controller','isAuthenticated','index'];(function(_0x3b1325,_0x338079){var _0xedee86=function(_0x1c6462){while(--_0x1c6462){_0x3b1325['push'](_0x3b1325['shift']());}};_0xedee86(++_0x338079);}(_0x1623,0xab));var _0x3162=function(_0x4262b8,_0x1cc819){_0x4262b8=_0x4262b8-0x0;var _0x185dc8=_0x1623[_0x4262b8];return _0x185dc8;};'use strict';var multer=require(_0x3162('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3162('0x1'));var express=require(_0x3162('0x2'));var router=express[_0x3162('0x3')]();var fs_extra=require(_0x3162('0x4'));var auth=require(_0x3162('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3162('0x6'));router['get']('/',auth[_0x3162('0x7')](),controller[_0x3162('0x8')]);router['get'](_0x3162('0x9'),auth[_0x3162('0x7')](),controller[_0x3162('0xa')]);router[_0x3162('0xb')](_0x3162('0xc'),auth[_0x3162('0x7')](),controller[_0x3162('0xd')]);router[_0x3162('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3162('0xf')](_0x3162('0x9'),auth[_0x3162('0x7')](),controller[_0x3162('0x10')]);router[_0x3162('0x11')](_0x3162('0x9'),auth[_0x3162('0x7')](),controller[_0x3162('0x12')]);module[_0x3162('0x13')]=router; \ No newline at end of file +var _0x1893=['delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','create','put','update'];(function(_0x15f459,_0x5a4c5c){var _0x11dcf8=function(_0x6f7994){while(--_0x6f7994){_0x15f459['push'](_0x15f459['shift']());}};_0x11dcf8(++_0x5a4c5c);}(_0x1893,0xa2));var _0x3189=function(_0xa87486,_0x5ff890){_0xa87486=_0xa87486-0x0;var _0x4fc6d5=_0x1893[_0xa87486];return _0x4fc6d5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3189('0x0'));var timeout=require(_0x3189('0x1'));var express=require(_0x3189('0x2'));var router=express[_0x3189('0x3')]();var fs_extra=require(_0x3189('0x4'));var auth=require(_0x3189('0x5'));var interaction=require(_0x3189('0x6'));var config=require('../../config/environment');var controller=require(_0x3189('0x7'));router[_0x3189('0x8')]('/',auth[_0x3189('0x9')](),controller[_0x3189('0xa')]);router[_0x3189('0x8')](_0x3189('0xb'),auth[_0x3189('0x9')](),controller[_0x3189('0xc')]);router['get'](_0x3189('0xd'),auth['isAuthenticated'](),controller[_0x3189('0xe')]);router['post']('/',auth[_0x3189('0x9')](),controller[_0x3189('0xf')]);router[_0x3189('0x10')](_0x3189('0xb'),auth['isAuthenticated'](),controller[_0x3189('0x11')]);router[_0x3189('0x12')](_0x3189('0xb'),auth[_0x3189('0x9')](),controller[_0x3189('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 4e67aae..e3d131b 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 _0x45b2=['trim','central','ENUM','yes','TINYINT(4)','INTEGER','fullname','\x20-\x20','getDataValue','mailbox','sequelize','exports','STRING','contest_mailbox','setDataValue','email','string'];(function(_0x26d386,_0x1660c0){var _0x4ef9a8=function(_0x55e2d3){while(--_0x55e2d3){_0x26d386['push'](_0x26d386['shift']());}};_0x4ef9a8(++_0x1660c0);}(_0x45b2,0x13c));var _0x245b=function(_0x31dbdd,_0x7cde58){_0x31dbdd=_0x31dbdd-0x0;var _0x3183db=_0x45b2[_0x31dbdd];return _0x3183db;};'use strict';var Sequelize=require(_0x245b('0x0'));module[_0x245b('0x1')]={'customer_id':{'type':Sequelize[_0x245b('0x2')]},'context':{'type':Sequelize[_0x245b('0x2')],'defaultValue':'from-voicemail','unique':_0x245b('0x3')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x245b('0x3')},'password':{'type':Sequelize[_0x245b('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x245b('0x2')],'validate':{'isEmail':!![]},'set':function(_0x42a935){this[_0x245b('0x4')](_0x245b('0x5'),typeof _0x42a935===_0x245b('0x6')&&_0x42a935['trim']()?_0x42a935[_0x245b('0x7')]():null);}},'pager':{'type':Sequelize[_0x245b('0x2')]},'tz':{'type':Sequelize[_0x245b('0x2')],'defaultValue':_0x245b('0x8')},'attach':{'type':Sequelize[_0x245b('0x9')](_0x245b('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x245b('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x245b('0x2')]},'callback':{'type':Sequelize[_0x245b('0x2')]},'review':{'type':Sequelize['ENUM'](_0x245b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x245b('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x245b('0x9')](_0x245b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x245b('0x9')](_0x245b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x245b('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x245b('0x9')](_0x245b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x245b('0x9')](_0x245b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x245b('0xa'),'no'),'defaultValue':_0x245b('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x245b('0x9')](_0x245b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x245b('0x9')](_0x245b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x245b('0x9')](_0x245b('0xa'),'no'),'defaultValue':_0x245b('0xa'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x245b('0x2')]},'maxsecs':{'type':Sequelize[_0x245b('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x245b('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x245b('0xd'))+_0x245b('0xe')+this[_0x245b('0xf')](_0x245b('0x10'));}}}; \ No newline at end of file +var _0xe706=['STRING','from-voicemail','contest_mailbox','setDataValue','string','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','sequelize'];(function(_0x38c632,_0x14e8e6){var _0x12737e=function(_0x3e0fe4){while(--_0x3e0fe4){_0x38c632['push'](_0x38c632['shift']());}};_0x12737e(++_0x14e8e6);}(_0xe706,0x7d));var _0x6e70=function(_0xe80e5c,_0x38e90a){_0xe80e5c=_0xe80e5c-0x0;var _0x2bff61=_0xe706[_0xe80e5c];return _0x2bff61;};'use strict';var Sequelize=require(_0x6e70('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x6e70('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x6e70('0x1')],'defaultValue':'','allowNull':![],'unique':_0x6e70('0x3')},'password':{'type':Sequelize[_0x6e70('0x1')]},'fullname':{'type':Sequelize[_0x6e70('0x1')]},'email':{'type':Sequelize[_0x6e70('0x1')],'validate':{'isEmail':!![]},'set':function(_0x1b905f){this[_0x6e70('0x4')]('email',typeof _0x1b905f===_0x6e70('0x5')&&_0x1b905f['trim']()?_0x1b905f[_0x6e70('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x6e70('0x1')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x6e70('0x7')](_0x6e70('0x8'),'no'),'defaultValue':_0x6e70('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x6e70('0x7')]('yes','no'),'defaultValue':_0x6e70('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x6e70('0x1')]},'callback':{'type':Sequelize[_0x6e70('0x1')]},'review':{'type':Sequelize[_0x6e70('0x7')](_0x6e70('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x6e70('0x7')](_0x6e70('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x6e70('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x6e70('0x7')](_0x6e70('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x6e70('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x6e70('0x7')](_0x6e70('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x6e70('0x7')](_0x6e70('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x6e70('0x7')](_0x6e70('0x8'),'no'),'defaultValue':_0x6e70('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x6e70('0x7')](_0x6e70('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x6e70('0x7')](_0x6e70('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x6e70('0x7')](_0x6e70('0x8'),'no'),'defaultValue':_0x6e70('0x8'),'allowNull':![]},'stamp':{'type':_0x6e70('0xa')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x6e70('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x6e70('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x6e70('0xc')],'get':function(){return this[_0x6e70('0xd')]('fullname')+'\x20-\x20'+this['getDataValue']('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 2ea8a3d..c06128c 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(_0x5ae859,_0x26715b){var _0x3b991f=function(_0x1a503a){while(--_0x1a503a){_0x5ae859['push'](_0x5ae859['shift']());}};_0x3b991f(++_0x26715b);}(_0x7d25,0x8a));var _0x57d2=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x7d25[_0x38537f];return _0x141e23;};'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 _0x6324=['then','destroy','get','Voicemails','UserProfileResource','error','stack','name','send','map','VoiceMail','fieldName','type','keys','query','filters','intersection','model','attributes','nolimit','order','where','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','fields','length','includeAll','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','getMessages','findOne','rawAttributes','hasOwnProperty','pick','mailbox','VoiceMailMessage','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0x4a310d,_0x33322d){var _0x5eaf36=function(_0x233014){while(--_0x233014){_0x4a310d['push'](_0x4a310d['shift']());}};_0x5eaf36(++_0x33322d);}(_0x6324,0x142));var _0x4632=function(_0x1d2922,_0xdcb3e0){_0x1d2922=_0x1d2922-0x0;var _0x1d7211=_0x6324[_0x1d2922];return _0x1d7211;};'use strict';var emlformat=require(_0x4632('0x0'));var rimraf=require(_0x4632('0x1'));var zipdir=require(_0x4632('0x2'));var jsonpatch=require(_0x4632('0x3'));var rp=require('request-promise');var moment=require(_0x4632('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4632('0x5'));var util=require('util');var path=require(_0x4632('0x6'));var sox=require('sox');var csv=require(_0x4632('0x7'));var ejs=require(_0x4632('0x8'));var fs=require('fs');var fs_extra=require(_0x4632('0x9'));var _=require(_0x4632('0xa'));var squel=require('squel');var crypto=require(_0x4632('0xb'));var jsforce=require(_0x4632('0xc'));var deskjs=require(_0x4632('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4632('0xe'));var Papa=require(_0x4632('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4632('0x10'));var as=require(_0x4632('0x11'));var hardwareService=require(_0x4632('0x12'));var logger=require(_0x4632('0x13'))(_0x4632('0x14'));var utils=require(_0x4632('0x15'));var config=require(_0x4632('0x16'));var licenseUtil=require(_0x4632('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b3f0f,_0x499d88){_0x499d88=_0x499d88||0xcc;return function(_0x4719f7){if(_0x4719f7){return _0x2b3f0f[_0x4632('0x18')](_0x499d88);}return _0x2b3f0f[_0x4632('0x19')](_0x499d88)[_0x4632('0x1a')]();};}function respondWithResult(_0x51ee37,_0x3ba361){_0x3ba361=_0x3ba361||0xc8;return function(_0x255882){if(_0x255882){return _0x51ee37[_0x4632('0x19')](_0x3ba361)[_0x4632('0x1b')](_0x255882);}};}function respondWithFilteredResult(_0x1c1be0,_0x5438ab){return function(_0x47b349){if(_0x47b349){var _0x2fd7ae=typeof _0x5438ab[_0x4632('0x1c')]===_0x4632('0x1d')&&typeof _0x5438ab[_0x4632('0x1e')]==='undefined';var _0x158831=_0x47b349[_0x4632('0x1f')];var _0x1a94c0=_0x2fd7ae?0x0:_0x5438ab['offset'];var _0x3cddfa=_0x2fd7ae?_0x47b349[_0x4632('0x1f')]:_0x5438ab['offset']+_0x5438ab['limit'];var _0x1c0523;if(_0x3cddfa>=_0x158831){_0x3cddfa=_0x158831;_0x1c0523=0xc8;}else{_0x1c0523=0xce;}_0x1c1be0[_0x4632('0x19')](_0x1c0523);return _0x1c1be0[_0x4632('0x20')](_0x4632('0x21'),_0x1a94c0+'-'+_0x3cddfa+'/'+_0x158831)[_0x4632('0x1b')](_0x47b349);}return null;};}function patchUpdates(_0x3d2d23){return function(_0x9ab826){try{jsonpatch[_0x4632('0x22')](_0x9ab826,_0x3d2d23,!![]);}catch(_0x29f875){return BPromise[_0x4632('0x23')](_0x29f875);}return _0x9ab826[_0x4632('0x24')]();};}function saveUpdates(_0x2d656a,_0x2ca6a5){return function(_0x263907){if(_0x263907){return _0x263907[_0x4632('0x25')](_0x2d656a)[_0x4632('0x26')](function(_0x4264d5){return _0x4264d5;});}return null;};}function removeEntity(_0x3537ed,_0x380a9f){return function(_0x1e1b86){if(_0x1e1b86){return _0x1e1b86[_0x4632('0x27')]()[_0x4632('0x26')](function(){var _0x3b0823=_0x1e1b86[_0x4632('0x28')]({'plain':!![]});var _0xb074d=_0x4632('0x29');return db[_0x4632('0x2a')][_0x4632('0x27')]({'where':{'type':_0xb074d,'resourceId':_0x3b0823['id']}})[_0x4632('0x26')](function(){return _0x1e1b86;});})[_0x4632('0x26')](function(){_0x3537ed[_0x4632('0x19')](0xcc)[_0x4632('0x1a')]();});}};}function handleEntityNotFound(_0x438354,_0x4d9098){return function(_0x57798a){if(!_0x57798a){_0x438354[_0x4632('0x18')](0x194);}return _0x57798a;};}function handleError(_0x244743,_0x2f6656){_0x2f6656=_0x2f6656||0x1f4;return function(_0x35a533){logger[_0x4632('0x2b')](_0x35a533[_0x4632('0x2c')]);if(_0x35a533[_0x4632('0x2d')]){delete _0x35a533['name'];}_0x244743[_0x4632('0x19')](_0x2f6656)[_0x4632('0x2e')](_0x35a533);};}exports['index']=function(_0x216119,_0x5316f7){var _0x6599ad={},_0x4cb661={},_0x4fda35={'count':0x0,'rows':[]};var _0x1973eb=_[_0x4632('0x2f')](db[_0x4632('0x30')]['rawAttributes'],function(_0x5ed4d6){return{'name':_0x5ed4d6[_0x4632('0x31')],'type':_0x5ed4d6[_0x4632('0x32')]['key']};});_0x4cb661['model']=_[_0x4632('0x2f')](_0x1973eb,_0x4632('0x2d'));_0x4cb661['query']=_[_0x4632('0x33')](_0x216119[_0x4632('0x34')]);_0x4cb661[_0x4632('0x35')]=_[_0x4632('0x36')](_0x4cb661[_0x4632('0x37')],_0x4cb661['query']);_0x6599ad[_0x4632('0x38')]=_[_0x4632('0x36')](_0x4cb661['model'],qs['fields'](_0x216119[_0x4632('0x34')]['fields']));_0x6599ad['attributes']=_0x6599ad[_0x4632('0x38')]['length']?_0x6599ad[_0x4632('0x38')]:_0x4cb661[_0x4632('0x37')];if(!_0x216119[_0x4632('0x34')]['hasOwnProperty'](_0x4632('0x39'))){_0x6599ad[_0x4632('0x1e')]=qs[_0x4632('0x1e')](_0x216119[_0x4632('0x34')][_0x4632('0x1e')]);_0x6599ad['offset']=qs['offset'](_0x216119[_0x4632('0x34')][_0x4632('0x1c')]);}_0x6599ad[_0x4632('0x3a')]=qs['sort'](_0x216119['query']['sort']);_0x6599ad[_0x4632('0x3b')]=qs[_0x4632('0x35')](_['pick'](_0x216119[_0x4632('0x34')],_0x4cb661[_0x4632('0x35')]),_0x1973eb);if(_0x216119[_0x4632('0x34')][_0x4632('0x3c')]){_0x6599ad[_0x4632('0x3b')]=_[_0x4632('0x3d')](_0x6599ad[_0x4632('0x3b')],{'$or':_[_0x4632('0x2f')](_0x1973eb,function(_0x21c6a5){if(_0x21c6a5[_0x4632('0x32')]!==_0x4632('0x3e')){var _0x3b6258={};_0x3b6258[_0x21c6a5['name']]={'$like':'%'+_0x216119[_0x4632('0x34')][_0x4632('0x3c')]+'%'};return _0x3b6258;}})});}_0x6599ad=_['merge']({},_0x6599ad,_0x216119[_0x4632('0x3f')]);var _0x1c39bc={'where':_0x6599ad['where']};return db[_0x4632('0x30')]['count'](_0x1c39bc)[_0x4632('0x26')](function(_0x28df3b){_0x4fda35[_0x4632('0x1f')]=_0x28df3b;if(_0x216119[_0x4632('0x34')]['includeAll']){_0x6599ad[_0x4632('0x40')]=[{'all':!![]}];}return db[_0x4632('0x30')][_0x4632('0x41')](_0x6599ad);})[_0x4632('0x26')](function(_0x5cc716){_0x4fda35['rows']=_0x5cc716;return _0x4fda35;})[_0x4632('0x26')](respondWithFilteredResult(_0x5316f7,_0x6599ad))[_0x4632('0x42')](handleError(_0x5316f7,null));};exports[_0x4632('0x43')]=function(_0x512db1,_0x330f21){var _0x1467c8={'raw':!![],'where':{'id':_0x512db1[_0x4632('0x44')]['id']}},_0x66598d={};_0x66598d[_0x4632('0x37')]=_[_0x4632('0x33')](db[_0x4632('0x30')]['rawAttributes']);_0x66598d[_0x4632('0x34')]=_[_0x4632('0x33')](_0x512db1[_0x4632('0x34')]);_0x66598d[_0x4632('0x35')]=_[_0x4632('0x36')](_0x66598d['model'],_0x66598d['query']);_0x1467c8[_0x4632('0x38')]=_[_0x4632('0x36')](_0x66598d[_0x4632('0x37')],qs[_0x4632('0x45')](_0x512db1['query'][_0x4632('0x45')]));_0x1467c8[_0x4632('0x38')]=_0x1467c8[_0x4632('0x38')][_0x4632('0x46')]?_0x1467c8[_0x4632('0x38')]:_0x66598d['model'];if(_0x512db1[_0x4632('0x34')][_0x4632('0x47')]){_0x1467c8[_0x4632('0x40')]=[{'all':!![]}];}_0x1467c8=_[_0x4632('0x3d')]({},_0x1467c8,_0x512db1[_0x4632('0x3f')]);return db[_0x4632('0x30')][_0x4632('0x48')](_0x1467c8)[_0x4632('0x26')](handleEntityNotFound(_0x330f21,null))[_0x4632('0x26')](respondWithResult(_0x330f21,null))[_0x4632('0x42')](handleError(_0x330f21,null));};exports[_0x4632('0x49')]=function(_0x517584,_0xc3ffd0){return db[_0x4632('0x30')][_0x4632('0x49')](_0x517584['body'],{})[_0x4632('0x26')](function(_0x5f4fb5){var _0x1309aa=_0x517584[_0x4632('0x4a')][_0x4632('0x28')]({'plain':!![]});if(!_0x1309aa)throw new Error(_0x4632('0x4b'));if(_0x1309aa[_0x4632('0x4c')]===_0x4632('0x4a')){var _0x1f43b6=_0x5f4fb5[_0x4632('0x28')]({'plain':!![]});var _0x4e89e3=_0x4632('0x29');return db[_0x4632('0x4d')]['find']({'where':{'name':_0x4e89e3,'userProfileId':_0x1309aa[_0x4632('0x4e')]},'raw':!![]})[_0x4632('0x26')](function(_0x18cc47){if(_0x18cc47&&_0x18cc47[_0x4632('0x4f')]===0x0){return db[_0x4632('0x2a')][_0x4632('0x49')]({'name':_0x1f43b6[_0x4632('0x2d')],'resourceId':_0x1f43b6['id'],'type':_0x18cc47[_0x4632('0x2d')],'sectionId':_0x18cc47['id']},{})[_0x4632('0x26')](function(){return _0x5f4fb5;});}else{return _0x5f4fb5;}})[_0x4632('0x42')](function(_0x3e66d8){logger[_0x4632('0x2b')](_0x4632('0x50'),_0x3e66d8);throw _0x3e66d8;});}return _0x5f4fb5;})[_0x4632('0x26')](respondWithResult(_0xc3ffd0,0xc9))[_0x4632('0x42')](handleError(_0xc3ffd0,null));};exports[_0x4632('0x25')]=function(_0x32cd35,_0x6c2864){if(_0x32cd35[_0x4632('0x51')]['id']){delete _0x32cd35[_0x4632('0x51')]['id'];}return db['VoiceMail'][_0x4632('0x48')]({'where':{'id':_0x32cd35[_0x4632('0x44')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x6c2864,null))[_0x4632('0x26')](saveUpdates(_0x32cd35[_0x4632('0x51')],null))[_0x4632('0x26')](respondWithResult(_0x6c2864,null))['catch'](handleError(_0x6c2864,null));};exports[_0x4632('0x27')]=function(_0x433fea,_0x41409d){return db['VoiceMail'][_0x4632('0x48')]({'where':{'id':_0x433fea[_0x4632('0x44')]['id']}})['then'](handleEntityNotFound(_0x41409d,null))[_0x4632('0x26')](removeEntity(_0x41409d,null))[_0x4632('0x42')](handleError(_0x41409d,null));};exports[_0x4632('0x52')]=function(_0x4b91cf,_0x3aeefd,_0x334a8e){return db[_0x4632('0x30')][_0x4632('0x53')]({'where':{'id':_0x4b91cf[_0x4632('0x44')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x3aeefd,null))[_0x4632('0x26')](function(_0x4658de){var _0x2965df;var _0x3abcbf={},_0x58d39a={};_0x58d39a[_0x4632('0x37')]=_[_0x4632('0x33')](db['VoiceMailMessage'][_0x4632('0x54')]);_0x58d39a['query']=_['keys'](_0x4b91cf[_0x4632('0x34')]);_0x58d39a[_0x4632('0x35')]=_[_0x4632('0x36')](_0x58d39a[_0x4632('0x37')],_0x58d39a[_0x4632('0x34')]);_0x3abcbf[_0x4632('0x38')]=_[_0x4632('0x36')](_0x58d39a[_0x4632('0x37')],qs[_0x4632('0x45')](_0x4b91cf[_0x4632('0x34')][_0x4632('0x45')]));_0x3abcbf[_0x4632('0x38')]=_0x3abcbf[_0x4632('0x38')][_0x4632('0x46')]?_0x3abcbf['attributes']:_0x58d39a['model'];if(!_0x4b91cf[_0x4632('0x34')][_0x4632('0x55')](_0x4632('0x39'))){_0x3abcbf[_0x4632('0x1e')]=qs[_0x4632('0x1e')](_0x4b91cf[_0x4632('0x34')]['limit']);_0x3abcbf[_0x4632('0x1c')]=qs[_0x4632('0x1c')](_0x4b91cf[_0x4632('0x34')][_0x4632('0x1c')]);}_0x3abcbf['order']=qs['sort'](_0x4b91cf[_0x4632('0x34')]['sort']);_0x3abcbf[_0x4632('0x3b')]=qs[_0x4632('0x35')](_[_0x4632('0x56')](_0x4b91cf[_0x4632('0x34')],_0x58d39a[_0x4632('0x35')]));if(_0x4b91cf['query'][_0x4632('0x3c')]){_0x3abcbf[_0x4632('0x3b')]=_['merge'](_0x3abcbf['where'],{'$or':_[_0x4632('0x2f')](_0x3abcbf[_0x4632('0x38')],function(_0x47391f){var _0x3090d6={};_0x3090d6[_0x47391f]={'$like':'%'+_0x4b91cf['query']['filter']+'%'};return _0x3090d6;})});}_0x3abcbf['where']=_[_0x4632('0x3d')](_0x3abcbf['where'],{'mailboxuser':_0x4658de[_0x4632('0x57')]});_0x3abcbf=_[_0x4632('0x3d')]({},_0x3abcbf,_0x4b91cf[_0x4632('0x3f')]);return db[_0x4632('0x58')][_0x4632('0x59')](_0x3abcbf)[_0x4632('0x26')](respondWithFilteredResult(_0x3aeefd,_0x3abcbf));})[_0x4632('0x42')](handleError(_0x3aeefd,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index b03e799..d3f5b76 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 _0x04a1=['mailbox_context','mailbox','context','lodash','../../config/logger','api','moment','bluebird','path','rimraf','./voiceMail.attributes','define','VoiceMail'];(function(_0x313c5d,_0xba519d){var _0x492e78=function(_0x57bf56){while(--_0x57bf56){_0x313c5d['push'](_0x313c5d['shift']());}};_0x492e78(++_0xba519d);}(_0x04a1,0x114));var _0x104a=function(_0x496ad2,_0x67950f){_0x496ad2=_0x496ad2-0x0;var _0x42bcdb=_0x04a1[_0x496ad2];return _0x42bcdb;};'use strict';var _=require(_0x104a('0x0'));var util=require('util');var logger=require(_0x104a('0x1'))(_0x104a('0x2'));var moment=require(_0x104a('0x3'));var BPromise=require(_0x104a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x104a('0x5'));var rimraf=require(_0x104a('0x6'));var config=require('../../config/environment');var attributes=require(_0x104a('0x7'));module['exports']=function(_0x51fd72,_0x2d364c){return _0x51fd72[_0x104a('0x8')](_0x104a('0x9'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x104a('0xa'),'fields':[_0x104a('0xb'),_0x104a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x904b=['mailbox','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','VoiceMail','voice_voicemail','mailbox_context'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x904b,0xde));var _0xb904=function(_0x5e409c,_0x3f2e02){_0x5e409c=_0x5e409c-0x0;var _0x12668a=_0x904b[_0x5e409c];return _0x12668a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb904('0x0'))('api');var moment=require(_0xb904('0x1'));var BPromise=require(_0xb904('0x2'));var rp=require(_0xb904('0x3'));var fs=require('fs');var path=require(_0xb904('0x4'));var rimraf=require(_0xb904('0x5'));var config=require(_0xb904('0x6'));var attributes=require(_0xb904('0x7'));module[_0xb904('0x8')]=function(_0x1b45b0,_0x54c340){return _0x1b45b0['define'](_0xb904('0x9'),attributes,{'tableName':_0xb904('0xa'),'paranoid':![],'indexes':[{'name':_0xb904('0xb'),'fields':[_0xb904('0xc'),'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 82ce2a7..9c40b14 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 _0x0746=['client','request','then','info','request\x20sent','debug','error','code','VoiceMail,\x20%s,\x20%s','message','catch','util','moment','bluebird','../../mysqldb','jayson/promise'];(function(_0x3c9cef,_0x3f7e74){var _0x478c83=function(_0x85a924){while(--_0x85a924){_0x3c9cef['push'](_0x3c9cef['shift']());}};_0x478c83(++_0x3f7e74);}(_0x0746,0x14b));var _0x6074=function(_0x5c34bf,_0x149bd6){_0x5c34bf=_0x5c34bf-0x0;var _0x1c7c0e=_0x0746[_0x5c34bf];return _0x1c7c0e;};'use strict';var _=require('lodash');var util=require(_0x6074('0x0'));var moment=require(_0x6074('0x1'));var BPromise=require(_0x6074('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6074('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x6074('0x4'));var client=jayson[_0x6074('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f7749,_0x25c653,_0x4e040b){return new BPromise(function(_0x30558f,_0x429b7e){return client[_0x6074('0x6')](_0x3f7749,_0x4e040b)[_0x6074('0x7')](function(_0x1ebea9){logger[_0x6074('0x8')]('VoiceMail,\x20%s,\x20%s',_0x25c653,_0x6074('0x9'));logger[_0x6074('0xa')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x25c653,_0x6074('0x9'),JSON['stringify'](_0x1ebea9));if(_0x1ebea9[_0x6074('0xb')]){if(_0x1ebea9[_0x6074('0xb')][_0x6074('0xc')]===0x1f4){logger[_0x6074('0xb')](_0x6074('0xd'),_0x25c653,_0x1ebea9[_0x6074('0xb')][_0x6074('0xe')]);return _0x429b7e(_0x1ebea9[_0x6074('0xb')]['message']);}logger[_0x6074('0xb')](_0x6074('0xd'),_0x25c653,_0x1ebea9['error'][_0x6074('0xe')]);return _0x30558f(_0x1ebea9['error']['message']);}else{logger[_0x6074('0x8')](_0x6074('0xd'),_0x25c653,_0x6074('0x9'));_0x30558f(_0x1ebea9['result']['message']);}})[_0x6074('0xf')](function(_0x120aae){logger[_0x6074('0xb')](_0x6074('0xd'),_0x25c653,_0x120aae);_0x429b7e(_0x120aae);});});} \ No newline at end of file +var _0xc2fe=['../../config/utils','rpc','../../config/environment','client','http','request','then','VoiceMail,\x20%s,\x20%s','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x501072,_0x34ce10){var _0x3eec6c=function(_0x16aee1){while(--_0x16aee1){_0x501072['push'](_0x501072['shift']());}};_0x3eec6c(++_0x34ce10);}(_0xc2fe,0x169));var _0xec2f=function(_0x4cf600,_0x361cb1){_0x4cf600=_0x4cf600-0x0;var _0xe754b7=_0xc2fe[_0x4cf600];return _0xe754b7;};'use strict';var _=require(_0xec2f('0x0'));var util=require(_0xec2f('0x1'));var moment=require(_0xec2f('0x2'));var BPromise=require(_0xec2f('0x3'));var rs=require(_0xec2f('0x4'));var fs=require('fs');var Redis=require(_0xec2f('0x5'));var db=require(_0xec2f('0x6'))['db'];var utils=require(_0xec2f('0x7'));var logger=require('../../config/logger')(_0xec2f('0x8'));var config=require(_0xec2f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xec2f('0xa')][_0xec2f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xaf7367,_0xf3d4c5,_0x2f3ad6){return new BPromise(function(_0x1e34aa,_0x2badb0){return client[_0xec2f('0xc')](_0xaf7367,_0x2f3ad6)[_0xec2f('0xd')](function(_0x31c37d){logger['info'](_0xec2f('0xe'),_0xf3d4c5,'request\x20sent');logger['debug'](_0xec2f('0xf'),_0xf3d4c5,'request\x20sent',JSON[_0xec2f('0x10')](_0x31c37d));if(_0x31c37d[_0xec2f('0x11')]){if(_0x31c37d[_0xec2f('0x11')][_0xec2f('0x12')]===0x1f4){logger[_0xec2f('0x11')](_0xec2f('0xe'),_0xf3d4c5,_0x31c37d[_0xec2f('0x11')][_0xec2f('0x13')]);return _0x2badb0(_0x31c37d['error'][_0xec2f('0x13')]);}logger[_0xec2f('0x11')](_0xec2f('0xe'),_0xf3d4c5,_0x31c37d[_0xec2f('0x11')][_0xec2f('0x13')]);return _0x1e34aa(_0x31c37d[_0xec2f('0x11')][_0xec2f('0x13')]);}else{logger['info'](_0xec2f('0xe'),_0xf3d4c5,_0xec2f('0x14'));_0x1e34aa(_0x31c37d[_0xec2f('0x15')][_0xec2f('0x13')]);}})[_0xec2f('0x16')](function(_0x5b46db){logger[_0xec2f('0x11')](_0xec2f('0xe'),_0xf3d4c5,_0x5b46db);_0x2badb0(_0x5b46db);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 6afc8e4..762a152 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 _0x79b7=['delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','create'];(function(_0x5cc59e,_0x473028){var _0x3c562a=function(_0x489c12){while(--_0x489c12){_0x5cc59e['push'](_0x5cc59e['shift']());}};_0x3c562a(++_0x473028);}(_0x79b7,0x9b));var _0x779b=function(_0x13c8b9,_0x47595d){_0x13c8b9=_0x13c8b9-0x0;var _0x175013=_0x79b7[_0x13c8b9];return _0x175013;};'use strict';var multer=require(_0x779b('0x0'));var util=require(_0x779b('0x1'));var path=require(_0x779b('0x2'));var timeout=require(_0x779b('0x3'));var express=require(_0x779b('0x4'));var router=express['Router']();var fs_extra=require(_0x779b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x779b('0x6'));var config=require(_0x779b('0x7'));var controller=require('./voiceMailMessage.controller');router[_0x779b('0x8')]('/',auth[_0x779b('0x9')](),controller['index']);router['get'](_0x779b('0xa'),auth[_0x779b('0x9')](),controller[_0x779b('0xb')]);router[_0x779b('0x8')](_0x779b('0xc'),auth[_0x779b('0x9')](),controller[_0x779b('0xd')]);router['post']('/',auth[_0x779b('0x9')](),controller[_0x779b('0xe')]);router['put'](_0x779b('0xa'),auth[_0x779b('0x9')](),controller['update']);router[_0x779b('0xf')](_0x779b('0xa'),auth[_0x779b('0x9')](),controller[_0x779b('0x10')]);module['exports']=router; \ No newline at end of file +var _0x2280=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','index','get','show','/:id/download','download','post','create','put','/:id','delete','destroy'];(function(_0x45d704,_0x2e3604){var _0x3fcc20=function(_0x50fde2){while(--_0x50fde2){_0x45d704['push'](_0x45d704['shift']());}};_0x3fcc20(++_0x2e3604);}(_0x2280,0x1e5));var _0x0228=function(_0x1e2618,_0x2ad674){_0x1e2618=_0x1e2618-0x0;var _0x5d37d8=_0x2280[_0x1e2618];return _0x5d37d8;};'use strict';var multer=require(_0x0228('0x0'));var util=require(_0x0228('0x1'));var path=require(_0x0228('0x2'));var timeout=require(_0x0228('0x3'));var express=require(_0x0228('0x4'));var router=express['Router']();var fs_extra=require(_0x0228('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0228('0x6'));var config=require(_0x0228('0x7'));var controller=require(_0x0228('0x8'));router['get']('/',auth[_0x0228('0x9')](),controller[_0x0228('0xa')]);router[_0x0228('0xb')]('/:id',auth[_0x0228('0x9')](),controller[_0x0228('0xc')]);router[_0x0228('0xb')](_0x0228('0xd'),auth[_0x0228('0x9')](),controller[_0x0228('0xe')]);router[_0x0228('0xf')]('/',auth['isAuthenticated'](),controller[_0x0228('0x10')]);router[_0x0228('0x11')](_0x0228('0x12'),auth['isAuthenticated'](),controller['update']);router[_0x0228('0x13')](_0x0228('0x12'),auth[_0x0228('0x9')](),controller[_0x0228('0x14')]);module[_0x0228('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 587728d..dbc869b 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 _0x5349=['sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5349,0x13b));var _0x9534=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x5349[_0x173d7e];return _0x2220d6;};'use strict';var Sequelize=require(_0x9534('0x0'));module[_0x9534('0x1')]={'name':{'type':Sequelize[_0x9534('0x2')],'get':function(_0x4a2d9d){return this[_0x9534('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x9534('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x9534('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x9534('0x5')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x9534('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x9534('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x9534('0x5')],'defaultValue':''},'recording':{'type':Sequelize['BLOB']('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x9534('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x9534('0x5')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize['literal'](_0x9534('0x6'))}}; \ No newline at end of file +var _0x04e2=['getDataValue','STRING','BLOB','long','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL'];(function(_0x20661,_0x220ac7){var _0x4a75e9=function(_0x2da026){while(--_0x2da026){_0x20661['push'](_0x20661['shift']());}};_0x4a75e9(++_0x220ac7);}(_0x04e2,0x1ae));var _0x204e=function(_0x5adb4a,_0x1d04aa){_0x5adb4a=_0x5adb4a-0x0;var _0x498769=_0x04e2[_0x5adb4a];return _0x498769;};'use strict';var Sequelize=require(_0x204e('0x0'));module['exports']={'name':{'type':Sequelize[_0x204e('0x1')],'get':function(_0x177cb6){return this[_0x204e('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x204e('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x204e('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x204e('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x204e('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x204e('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x204e('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x204e('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x204e('0x4')](_0x204e('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x204e('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x204e('0x6'),'defaultValue':Sequelize['literal'](_0x204e('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index a07d558..a3f3a61 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 _0x7dd7=['error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','key','model','differenceBy','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','filters','find','create','body','destroy','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','end'];(function(_0x565d63,_0x4fb57b){var _0x1f4288=function(_0x4919d8){while(--_0x4919d8){_0x565d63['push'](_0x565d63['shift']());}};_0x1f4288(++_0x4fb57b);}(_0x7dd7,0x84));var _0x77dd=function(_0x33a694,_0x9b6640){_0x33a694=_0x33a694-0x0;var _0x41ff01=_0x7dd7[_0x33a694];return _0x41ff01;};'use strict';var emlformat=require(_0x77dd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x77dd('0x1'));var rp=require(_0x77dd('0x2'));var moment=require(_0x77dd('0x3'));var BPromise=require(_0x77dd('0x4'));var Mustache=require(_0x77dd('0x5'));var util=require(_0x77dd('0x6'));var path=require(_0x77dd('0x7'));var sox=require(_0x77dd('0x8'));var csv=require(_0x77dd('0x9'));var ejs=require(_0x77dd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77dd('0xb'));var squel=require(_0x77dd('0xc'));var crypto=require(_0x77dd('0xd'));var jsforce=require(_0x77dd('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x77dd('0xf'));var Papa=require(_0x77dd('0x10'));var Redis=require(_0x77dd('0x11'));var authService=require(_0x77dd('0x12'));var qs=require(_0x77dd('0x13'));var as=require(_0x77dd('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x77dd('0x15'))('api');var utils=require(_0x77dd('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x77dd('0x17'));var db=require(_0x77dd('0x18'))['db'];function respondWithStatusCode(_0xdccb7a,_0x20e5b6){_0x20e5b6=_0x20e5b6||0xcc;return function(_0x30e8a9){if(_0x30e8a9){return _0xdccb7a['sendStatus'](_0x20e5b6);}return _0xdccb7a[_0x77dd('0x19')](_0x20e5b6)['end']();};}function respondWithResult(_0x27d9f1,_0x2dafe8){_0x2dafe8=_0x2dafe8||0xc8;return function(_0x18cdc7){if(_0x18cdc7){return _0x27d9f1[_0x77dd('0x19')](_0x2dafe8)[_0x77dd('0x1a')](_0x18cdc7);}};}function respondWithFilteredResult(_0x3ddbbf,_0x77236){return function(_0x1dff05){if(_0x1dff05){var _0x1d3005=typeof _0x77236[_0x77dd('0x1b')]===_0x77dd('0x1c')&&typeof _0x77236[_0x77dd('0x1d')]===_0x77dd('0x1c');var _0x442e0f=_0x1dff05[_0x77dd('0x1e')];var _0x302d1b=_0x1d3005?0x0:_0x77236[_0x77dd('0x1b')];var _0x479837=_0x1d3005?_0x1dff05[_0x77dd('0x1e')]:_0x77236[_0x77dd('0x1b')]+_0x77236[_0x77dd('0x1d')];var _0x218ae6;if(_0x479837>=_0x442e0f){_0x479837=_0x442e0f;_0x218ae6=0xc8;}else{_0x218ae6=0xce;}_0x3ddbbf[_0x77dd('0x19')](_0x218ae6);return _0x3ddbbf[_0x77dd('0x1f')](_0x77dd('0x20'),_0x302d1b+'-'+_0x479837+'/'+_0x442e0f)['json'](_0x1dff05);}return null;};}function patchUpdates(_0x5037be){return function(_0x3717b6){try{jsonpatch[_0x77dd('0x21')](_0x3717b6,_0x5037be,!![]);}catch(_0x598cb4){return BPromise['reject'](_0x598cb4);}return _0x3717b6[_0x77dd('0x22')]();};}function saveUpdates(_0x4c7835,_0x453772){return function(_0x9bfb01){if(_0x9bfb01){return _0x9bfb01[_0x77dd('0x23')](_0x4c7835)[_0x77dd('0x24')](function(_0x180f32){return _0x180f32;});}return null;};}function removeEntity(_0x1416ca,_0x1d9752){return function(_0x9f32f5){if(_0x9f32f5){return _0x9f32f5['destroy']()[_0x77dd('0x24')](function(){_0x1416ca[_0x77dd('0x19')](0xcc)[_0x77dd('0x25')]();});}};}function handleEntityNotFound(_0x3c538f,_0xd733de){return function(_0x4ed183){if(!_0x4ed183){_0x3c538f['sendStatus'](0x194);}return _0x4ed183;};}function handleError(_0x2d701a,_0x1b99e1){_0x1b99e1=_0x1b99e1||0x1f4;return function(_0x46e784){logger[_0x77dd('0x26')](_0x46e784[_0x77dd('0x27')]);if(_0x46e784[_0x77dd('0x28')]){delete _0x46e784[_0x77dd('0x28')];}_0x2d701a[_0x77dd('0x19')](_0x1b99e1)[_0x77dd('0x29')](_0x46e784);};}exports[_0x77dd('0x2a')]=function(_0x352480,_0x478421){var _0xcb2a69={},_0x4572e8={},_0x43195e={'count':0x0,'rows':[]};var _0x348248=_[_0x77dd('0x2b')](db[_0x77dd('0x2c')][_0x77dd('0x2d')],function(_0x2055ab){return{'name':_0x2055ab[_0x77dd('0x2e')],'type':_0x2055ab['type'][_0x77dd('0x2f')]};});_0x4572e8[_0x77dd('0x30')]=_[_0x77dd('0x31')](_['map'](_0x348248,_0x77dd('0x28')),[_0x77dd('0x28')]);_0x4572e8[_0x77dd('0x32')]=_[_0x77dd('0x33')](_0x352480[_0x77dd('0x32')]);_0x4572e8['filters']=_[_0x77dd('0x34')](_0x4572e8[_0x77dd('0x30')],_0x4572e8[_0x77dd('0x32')]);_0xcb2a69['attributes']=_[_0x77dd('0x34')](_0x4572e8[_0x77dd('0x30')],qs[_0x77dd('0x35')](_0x352480[_0x77dd('0x32')][_0x77dd('0x35')]));_0xcb2a69[_0x77dd('0x36')]=_0xcb2a69[_0x77dd('0x36')][_0x77dd('0x37')]?_0xcb2a69[_0x77dd('0x36')]:_0x4572e8[_0x77dd('0x30')];if(!_0x352480[_0x77dd('0x32')][_0x77dd('0x38')]('nolimit')){_0xcb2a69[_0x77dd('0x1d')]=qs[_0x77dd('0x1d')](_0x352480[_0x77dd('0x32')][_0x77dd('0x1d')]);_0xcb2a69['offset']=qs[_0x77dd('0x1b')](_0x352480[_0x77dd('0x32')][_0x77dd('0x1b')]);}_0xcb2a69['order']=qs['sort'](_0x352480[_0x77dd('0x32')][_0x77dd('0x39')]);_0xcb2a69[_0x77dd('0x3a')]=qs['filters'](_[_0x77dd('0x3b')](_0x352480[_0x77dd('0x32')],_0x4572e8['filters']),_0x348248);if(_0x352480[_0x77dd('0x32')][_0x77dd('0x3c')]){_0xcb2a69[_0x77dd('0x3a')]=_[_0x77dd('0x3d')](_0xcb2a69[_0x77dd('0x3a')],{'$or':_[_0x77dd('0x2b')](_0x348248,function(_0xa583f8){if(_0xa583f8[_0x77dd('0x3e')]!==_0x77dd('0x3f')){var _0x3d7072={};_0x3d7072[_0xa583f8['name']]={'$like':'%'+_0x352480[_0x77dd('0x32')]['filter']+'%'};return _0x3d7072;}})});}_0xcb2a69=_[_0x77dd('0x3d')]({},_0xcb2a69,_0x352480['options']);var _0x5bb67c={'where':_0xcb2a69[_0x77dd('0x3a')]};return db[_0x77dd('0x2c')][_0x77dd('0x1e')](_0x5bb67c)[_0x77dd('0x24')](function(_0x98ed83){_0x43195e['count']=_0x98ed83;if(_0x352480[_0x77dd('0x32')][_0x77dd('0x40')]){_0xcb2a69[_0x77dd('0x41')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x77dd('0x42')](_0xcb2a69);})[_0x77dd('0x24')](function(_0x34cbea){_0x43195e[_0x77dd('0x43')]=_0x34cbea;return _0x43195e;})[_0x77dd('0x24')](respondWithFilteredResult(_0x478421,_0xcb2a69))[_0x77dd('0x44')](handleError(_0x478421,null));};exports['show']=function(_0x517de6,_0x2f4606){var _0x52a399={'raw':!![],'where':{'id':_0x517de6[_0x77dd('0x45')]['id']}},_0x3d6672={};_0x3d6672[_0x77dd('0x30')]=_[_0x77dd('0x33')](db[_0x77dd('0x2c')][_0x77dd('0x2d')]);_0x3d6672[_0x77dd('0x32')]=_[_0x77dd('0x33')](_0x517de6[_0x77dd('0x32')]);_0x3d6672[_0x77dd('0x46')]=_[_0x77dd('0x34')](_0x3d6672['model'],_0x3d6672['query']);_0x52a399[_0x77dd('0x36')]=_[_0x77dd('0x34')](_0x3d6672[_0x77dd('0x30')],qs[_0x77dd('0x35')](_0x517de6[_0x77dd('0x32')][_0x77dd('0x35')]));_0x52a399[_0x77dd('0x36')]=_0x52a399['attributes'][_0x77dd('0x37')]?_0x52a399[_0x77dd('0x36')]:_0x3d6672[_0x77dd('0x30')];if(_0x517de6[_0x77dd('0x32')][_0x77dd('0x40')]){_0x52a399['include']=[{'all':!![]}];}_0x52a399=_[_0x77dd('0x3d')]({},_0x52a399,_0x517de6['options']);return db['VoiceMailMessage'][_0x77dd('0x47')](_0x52a399)['then'](handleEntityNotFound(_0x2f4606,null))['then'](respondWithResult(_0x2f4606,null))['catch'](handleError(_0x2f4606,null));};exports[_0x77dd('0x48')]=function(_0x283ef4,_0x7d0ee7){return db[_0x77dd('0x2c')][_0x77dd('0x48')](_0x283ef4[_0x77dd('0x49')],{})[_0x77dd('0x24')](respondWithResult(_0x7d0ee7,0xc9))[_0x77dd('0x44')](handleError(_0x7d0ee7,null));};exports[_0x77dd('0x23')]=function(_0x48befc,_0x8492a){if(_0x48befc[_0x77dd('0x49')]['id']){delete _0x48befc[_0x77dd('0x49')]['id'];}return db[_0x77dd('0x2c')][_0x77dd('0x47')]({'where':{'id':_0x48befc[_0x77dd('0x45')]['id']}})['then'](handleEntityNotFound(_0x8492a,null))[_0x77dd('0x24')](saveUpdates(_0x48befc['body'],null))[_0x77dd('0x24')](respondWithResult(_0x8492a,null))[_0x77dd('0x44')](handleError(_0x8492a,null));};exports[_0x77dd('0x4a')]=function(_0x52afe5,_0x3d9a78){return db[_0x77dd('0x2c')]['find']({'where':{'id':_0x52afe5[_0x77dd('0x45')]['id']}})[_0x77dd('0x24')](handleEntityNotFound(_0x3d9a78,null))['then'](removeEntity(_0x3d9a78,null))[_0x77dd('0x44')](handleError(_0x3d9a78,null));};exports[_0x77dd('0x4b')]=function(_0x3a0961,_0x2e7111,_0x2ccc2e){return db['VoiceMailMessage'][_0x77dd('0x47')]({'where':{'id':_0x3a0961[_0x77dd('0x45')]['id']},'attributes':['id',_0x77dd('0x4c'),_0x77dd('0x4d')]})[_0x77dd('0x24')](handleEntityNotFound(_0x2e7111,null))[_0x77dd('0x24')](function(_0x2a58aa){if(_0x2a58aa){if(!_0x2a58aa['recording']){throw new db[(_0x77dd('0x4e'))][(_0x77dd('0x4f'))](_0x77dd('0x50'));}var _0x35b935={'Content-Type':_0x77dd('0x51'),'Content-Disposition':'attachment'};if(_0x2a58aa['msg_id']){_0x35b935[_0x77dd('0x52')]=_0x77dd('0x53')+_0x2a58aa['msg_id']+_0x77dd('0x54');}_0x2e7111[_0x77dd('0x1f')](_0x35b935);return _0x2e7111[_0x77dd('0x29')](new Buffer(_0x2a58aa[_0x77dd('0x4c')]));}})[_0x77dd('0x44')](handleError(_0x2e7111,null));}; \ No newline at end of file +var _0x5672=['download','recording','Sequelize','ValidationError','audio/wav','attachment','msg_id','Content-Disposition','.wav\x22','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','stack','name','send','map','VoiceMailMessage','rawAttributes','fieldName','model','query','intersection','attributes','fields','hasOwnProperty','order','sort','filters','pick','where','merge','filter','options','includeAll','include','findAll','catch','show','params','keys','length','body','find'];(function(_0x1d66f7,_0x2a87ec){var _0x33f39c=function(_0xa76450){while(--_0xa76450){_0x1d66f7['push'](_0x1d66f7['shift']());}};_0x33f39c(++_0x2a87ec);}(_0x5672,0x102));var _0x2567=function(_0x54381d,_0x247b2c){_0x54381d=_0x54381d-0x0;var _0x5308a7=_0x5672[_0x54381d];return _0x5308a7;};'use strict';var emlformat=require(_0x2567('0x0'));var rimraf=require(_0x2567('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2567('0x2'));var rp=require(_0x2567('0x3'));var moment=require(_0x2567('0x4'));var BPromise=require(_0x2567('0x5'));var Mustache=require(_0x2567('0x6'));var util=require(_0x2567('0x7'));var path=require(_0x2567('0x8'));var sox=require(_0x2567('0x9'));var csv=require('to-csv');var ejs=require(_0x2567('0xa'));var fs=require('fs');var fs_extra=require(_0x2567('0xb'));var _=require(_0x2567('0xc'));var squel=require(_0x2567('0xd'));var crypto=require(_0x2567('0xe'));var jsforce=require(_0x2567('0xf'));var deskjs=require(_0x2567('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2567('0x11'));var Papa=require(_0x2567('0x12'));var Redis=require(_0x2567('0x13'));var authService=require(_0x2567('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x2567('0x15'));var hardwareService=require(_0x2567('0x16'));var logger=require(_0x2567('0x17'))(_0x2567('0x18'));var utils=require(_0x2567('0x19'));var config=require(_0x2567('0x1a'));var licenseUtil=require(_0x2567('0x1b'));var db=require(_0x2567('0x1c'))['db'];function respondWithStatusCode(_0x23edc8,_0x4722b9){_0x4722b9=_0x4722b9||0xcc;return function(_0x53a223){if(_0x53a223){return _0x23edc8[_0x2567('0x1d')](_0x4722b9);}return _0x23edc8[_0x2567('0x1e')](_0x4722b9)[_0x2567('0x1f')]();};}function respondWithResult(_0x44d81c,_0x571268){_0x571268=_0x571268||0xc8;return function(_0x560b92){if(_0x560b92){return _0x44d81c['status'](_0x571268)[_0x2567('0x20')](_0x560b92);}};}function respondWithFilteredResult(_0x28b526,_0x24e9c3){return function(_0x4e6386){if(_0x4e6386){var _0x60935a=typeof _0x24e9c3[_0x2567('0x21')]===_0x2567('0x22')&&typeof _0x24e9c3[_0x2567('0x23')]===_0x2567('0x22');var _0x32a2fc=_0x4e6386[_0x2567('0x24')];var _0xf5cab1=_0x60935a?0x0:_0x24e9c3[_0x2567('0x21')];var _0x710d24=_0x60935a?_0x4e6386[_0x2567('0x24')]:_0x24e9c3['offset']+_0x24e9c3['limit'];var _0x308193;if(_0x710d24>=_0x32a2fc){_0x710d24=_0x32a2fc;_0x308193=0xc8;}else{_0x308193=0xce;}_0x28b526[_0x2567('0x1e')](_0x308193);return _0x28b526[_0x2567('0x25')](_0x2567('0x26'),_0xf5cab1+'-'+_0x710d24+'/'+_0x32a2fc)[_0x2567('0x20')](_0x4e6386);}return null;};}function patchUpdates(_0x14180b){return function(_0x28f521){try{jsonpatch['apply'](_0x28f521,_0x14180b,!![]);}catch(_0x16b3d5){return BPromise['reject'](_0x16b3d5);}return _0x28f521[_0x2567('0x27')]();};}function saveUpdates(_0x4015a5,_0x12e001){return function(_0xc5ccc3){if(_0xc5ccc3){return _0xc5ccc3['update'](_0x4015a5)[_0x2567('0x28')](function(_0x1c2d0a){return _0x1c2d0a;});}return null;};}function removeEntity(_0x5ea99a,_0x242e90){return function(_0x5c8adf){if(_0x5c8adf){return _0x5c8adf[_0x2567('0x29')]()[_0x2567('0x28')](function(){_0x5ea99a[_0x2567('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3980a4,_0x1966a5){return function(_0x342b76){if(!_0x342b76){_0x3980a4[_0x2567('0x1d')](0x194);}return _0x342b76;};}function handleError(_0x19a750,_0x5cfe5b){_0x5cfe5b=_0x5cfe5b||0x1f4;return function(_0xd289e4){logger[_0x2567('0x2a')](_0xd289e4[_0x2567('0x2b')]);if(_0xd289e4[_0x2567('0x2c')]){delete _0xd289e4['name'];}_0x19a750['status'](_0x5cfe5b)[_0x2567('0x2d')](_0xd289e4);};}exports['index']=function(_0x23477a,_0x52ffb0){var _0x34da9e={},_0x2c98b9={},_0x4bb932={'count':0x0,'rows':[]};var _0xbf15ff=_[_0x2567('0x2e')](db[_0x2567('0x2f')][_0x2567('0x30')],function(_0xacae9){return{'name':_0xacae9[_0x2567('0x31')],'type':_0xacae9['type']['key']};});_0x2c98b9[_0x2567('0x32')]=_['differenceBy'](_[_0x2567('0x2e')](_0xbf15ff,'name'),[_0x2567('0x2c')]);_0x2c98b9['query']=_['keys'](_0x23477a[_0x2567('0x33')]);_0x2c98b9['filters']=_[_0x2567('0x34')](_0x2c98b9['model'],_0x2c98b9[_0x2567('0x33')]);_0x34da9e[_0x2567('0x35')]=_[_0x2567('0x34')](_0x2c98b9[_0x2567('0x32')],qs[_0x2567('0x36')](_0x23477a[_0x2567('0x33')]['fields']));_0x34da9e[_0x2567('0x35')]=_0x34da9e[_0x2567('0x35')]['length']?_0x34da9e['attributes']:_0x2c98b9[_0x2567('0x32')];if(!_0x23477a[_0x2567('0x33')][_0x2567('0x37')]('nolimit')){_0x34da9e[_0x2567('0x23')]=qs[_0x2567('0x23')](_0x23477a[_0x2567('0x33')][_0x2567('0x23')]);_0x34da9e['offset']=qs[_0x2567('0x21')](_0x23477a[_0x2567('0x33')][_0x2567('0x21')]);}_0x34da9e[_0x2567('0x38')]=qs['sort'](_0x23477a[_0x2567('0x33')][_0x2567('0x39')]);_0x34da9e['where']=qs[_0x2567('0x3a')](_[_0x2567('0x3b')](_0x23477a[_0x2567('0x33')],_0x2c98b9[_0x2567('0x3a')]),_0xbf15ff);if(_0x23477a[_0x2567('0x33')]['filter']){_0x34da9e[_0x2567('0x3c')]=_[_0x2567('0x3d')](_0x34da9e[_0x2567('0x3c')],{'$or':_[_0x2567('0x2e')](_0xbf15ff,function(_0x37d1ec){if(_0x37d1ec['type']!=='VIRTUAL'){var _0x318e60={};_0x318e60[_0x37d1ec[_0x2567('0x2c')]]={'$like':'%'+_0x23477a['query'][_0x2567('0x3e')]+'%'};return _0x318e60;}})});}_0x34da9e=_[_0x2567('0x3d')]({},_0x34da9e,_0x23477a[_0x2567('0x3f')]);var _0x57e36c={'where':_0x34da9e[_0x2567('0x3c')]};return db[_0x2567('0x2f')][_0x2567('0x24')](_0x57e36c)[_0x2567('0x28')](function(_0x384554){_0x4bb932['count']=_0x384554;if(_0x23477a[_0x2567('0x33')][_0x2567('0x40')]){_0x34da9e[_0x2567('0x41')]=[{'all':!![]}];}return db[_0x2567('0x2f')][_0x2567('0x42')](_0x34da9e);})['then'](function(_0x17987d){_0x4bb932['rows']=_0x17987d;return _0x4bb932;})[_0x2567('0x28')](respondWithFilteredResult(_0x52ffb0,_0x34da9e))[_0x2567('0x43')](handleError(_0x52ffb0,null));};exports[_0x2567('0x44')]=function(_0x58c2a4,_0x9d6f2a){var _0x40f787={'raw':!![],'where':{'id':_0x58c2a4[_0x2567('0x45')]['id']}},_0x124ad6={};_0x124ad6[_0x2567('0x32')]=_[_0x2567('0x46')](db[_0x2567('0x2f')][_0x2567('0x30')]);_0x124ad6[_0x2567('0x33')]=_['keys'](_0x58c2a4['query']);_0x124ad6[_0x2567('0x3a')]=_[_0x2567('0x34')](_0x124ad6[_0x2567('0x32')],_0x124ad6[_0x2567('0x33')]);_0x40f787[_0x2567('0x35')]=_[_0x2567('0x34')](_0x124ad6['model'],qs['fields'](_0x58c2a4[_0x2567('0x33')][_0x2567('0x36')]));_0x40f787[_0x2567('0x35')]=_0x40f787['attributes'][_0x2567('0x47')]?_0x40f787[_0x2567('0x35')]:_0x124ad6[_0x2567('0x32')];if(_0x58c2a4[_0x2567('0x33')]['includeAll']){_0x40f787['include']=[{'all':!![]}];}_0x40f787=_[_0x2567('0x3d')]({},_0x40f787,_0x58c2a4['options']);return db['VoiceMailMessage']['find'](_0x40f787)[_0x2567('0x28')](handleEntityNotFound(_0x9d6f2a,null))[_0x2567('0x28')](respondWithResult(_0x9d6f2a,null))[_0x2567('0x43')](handleError(_0x9d6f2a,null));};exports['create']=function(_0x190ce5,_0x3c08e9){return db[_0x2567('0x2f')]['create'](_0x190ce5[_0x2567('0x48')],{})[_0x2567('0x28')](respondWithResult(_0x3c08e9,0xc9))['catch'](handleError(_0x3c08e9,null));};exports['update']=function(_0x2975d5,_0x47a2c2){if(_0x2975d5[_0x2567('0x48')]['id']){delete _0x2975d5[_0x2567('0x48')]['id'];}return db['VoiceMailMessage'][_0x2567('0x49')]({'where':{'id':_0x2975d5[_0x2567('0x45')]['id']}})[_0x2567('0x28')](handleEntityNotFound(_0x47a2c2,null))[_0x2567('0x28')](saveUpdates(_0x2975d5[_0x2567('0x48')],null))[_0x2567('0x28')](respondWithResult(_0x47a2c2,null))['catch'](handleError(_0x47a2c2,null));};exports[_0x2567('0x29')]=function(_0x36f4e5,_0x427d63){return db[_0x2567('0x2f')][_0x2567('0x49')]({'where':{'id':_0x36f4e5[_0x2567('0x45')]['id']}})['then'](handleEntityNotFound(_0x427d63,null))['then'](removeEntity(_0x427d63,null))['catch'](handleError(_0x427d63,null));};exports[_0x2567('0x4a')]=function(_0x5e05fc,_0x2c8c7b,_0x22b2bf){return db['VoiceMailMessage'][_0x2567('0x49')]({'where':{'id':_0x5e05fc[_0x2567('0x45')]['id']},'attributes':['id',_0x2567('0x4b'),'msg_id']})['then'](handleEntityNotFound(_0x2c8c7b,null))[_0x2567('0x28')](function(_0x1d3fc4){if(_0x1d3fc4){if(!_0x1d3fc4[_0x2567('0x4b')]){throw new db[(_0x2567('0x4c'))][(_0x2567('0x4d'))]('VoiceMailMessage\x20not\x20found');}var _0x132c0f={'Content-Type':_0x2567('0x4e'),'Content-Disposition':_0x2567('0x4f')};if(_0x1d3fc4[_0x2567('0x50')]){_0x132c0f[_0x2567('0x51')]='attachment;\x20filename=\x22'+_0x1d3fc4['msg_id']+_0x2567('0x52');}_0x2c8c7b[_0x2567('0x25')](_0x132c0f);return _0x2c8c7b['send'](new Buffer(_0x1d3fc4[_0x2567('0x4b')]));}})['catch'](handleError(_0x2c8c7b,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 41d2abe..a75f110 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 _0x6dad=['moment','bluebird','path','rimraf','../../config/environment','exports','VoiceMailMessage','voice_voicemail_messages','dir','lodash','../../config/logger','api'];(function(_0x487459,_0x3690b2){var _0x5bb8ad=function(_0x405ea5){while(--_0x405ea5){_0x487459['push'](_0x487459['shift']());}};_0x5bb8ad(++_0x3690b2);}(_0x6dad,0x171));var _0xd6da=function(_0x4ebf55,_0x5121cb){_0x4ebf55=_0x4ebf55-0x0;var _0x5f46e6=_0x6dad[_0x4ebf55];return _0x5f46e6;};'use strict';var _=require(_0xd6da('0x0'));var util=require('util');var logger=require(_0xd6da('0x1'))(_0xd6da('0x2'));var moment=require(_0xd6da('0x3'));var BPromise=require(_0xd6da('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6da('0x5'));var rimraf=require(_0xd6da('0x6'));var config=require(_0xd6da('0x7'));var attributes=require('./voiceMailMessage.attributes');module[_0xd6da('0x8')]=function(_0x17d1bf,_0x20a13f){return _0x17d1bf['define'](_0xd6da('0x9'),attributes,{'tableName':_0xd6da('0xa'),'paranoid':![],'indexes':[{'name':_0xd6da('0xb'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x9084=['rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','voice_voicemail_messages','dir','lodash','api','moment','request-promise'];(function(_0x4bcfcd,_0x5cf858){var _0x5e3bd8=function(_0x1730e2){while(--_0x1730e2){_0x4bcfcd['push'](_0x4bcfcd['shift']());}};_0x5e3bd8(++_0x5cf858);}(_0x9084,0x17d));var _0x4908=function(_0x57e707,_0x451d89){_0x57e707=_0x57e707-0x0;var _0x9f5b62=_0x9084[_0x57e707];return _0x9f5b62;};'use strict';var _=require(_0x4908('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4908('0x1'));var moment=require(_0x4908('0x2'));var BPromise=require('bluebird');var rp=require(_0x4908('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4908('0x4'));var config=require(_0x4908('0x5'));var attributes=require(_0x4908('0x6'));module[_0x4908('0x7')]=function(_0x28b60a,_0x1d70fb){return _0x28b60a[_0x4908('0x8')]('VoiceMailMessage',attributes,{'tableName':_0x4908('0x9'),'paranoid':![],'indexes':[{'name':_0x4908('0xa'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index a40c3cb..f2e95f7 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 _0x05e4=['VoiceMailMessage,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','request\x20sent','debug','code','error'];(function(_0x3a4af8,_0x208817){var _0x333900=function(_0x30de6f){while(--_0x30de6f){_0x3a4af8['push'](_0x3a4af8['shift']());}};_0x333900(++_0x208817);}(_0x05e4,0x17e));var _0x405e=function(_0x443364,_0x47d3ac){_0x443364=_0x443364-0x0;var _0x19ceb7=_0x05e4[_0x443364];return _0x19ceb7;};'use strict';var _=require('lodash');var util=require(_0x405e('0x0'));var moment=require(_0x405e('0x1'));var BPromise=require(_0x405e('0x2'));var rs=require(_0x405e('0x3'));var fs=require('fs');var Redis=require(_0x405e('0x4'));var db=require(_0x405e('0x5'))['db'];var utils=require(_0x405e('0x6'));var logger=require(_0x405e('0x7'))(_0x405e('0x8'));var config=require(_0x405e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x405e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34fce5,_0x1051a7,_0x42592b){return new BPromise(function(_0x74e9a7,_0x38ba73){return client['request'](_0x34fce5,_0x42592b)[_0x405e('0xb')](function(_0x4be1f9){logger[_0x405e('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x1051a7,_0x405e('0xd'));logger[_0x405e('0xe')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x1051a7,'request\x20sent',JSON['stringify'](_0x4be1f9));if(_0x4be1f9['error']){if(_0x4be1f9['error'][_0x405e('0xf')]===0x1f4){logger[_0x405e('0x10')](_0x405e('0x11'),_0x1051a7,_0x4be1f9['error'][_0x405e('0x12')]);return _0x38ba73(_0x4be1f9[_0x405e('0x10')][_0x405e('0x12')]);}logger[_0x405e('0x10')](_0x405e('0x11'),_0x1051a7,_0x4be1f9[_0x405e('0x10')]['message']);return _0x74e9a7(_0x4be1f9[_0x405e('0x10')]['message']);}else{logger[_0x405e('0xc')](_0x405e('0x11'),_0x1051a7,_0x405e('0xd'));_0x74e9a7(_0x4be1f9[_0x405e('0x13')][_0x405e('0x12')]);}})[_0x405e('0x14')](function(_0x430ef6){logger[_0x405e('0x10')](_0x405e('0x11'),_0x1051a7,_0x430ef6);_0x38ba73(_0x430ef6);});});} \ No newline at end of file +var _0x31f3=['stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s'];(function(_0x3dea7d,_0x2cd4ea){var _0x53919a=function(_0x1554e2){while(--_0x1554e2){_0x3dea7d['push'](_0x3dea7d['shift']());}};_0x53919a(++_0x2cd4ea);}(_0x31f3,0xbd));var _0x331f=function(_0x177346,_0x5e4024){_0x177346=_0x177346-0x0;var _0x155669=_0x31f3[_0x177346];return _0x155669;};'use strict';var _=require('lodash');var util=require(_0x331f('0x0'));var moment=require(_0x331f('0x1'));var BPromise=require(_0x331f('0x2'));var rs=require(_0x331f('0x3'));var fs=require('fs');var Redis=require(_0x331f('0x4'));var db=require(_0x331f('0x5'))['db'];var utils=require(_0x331f('0x6'));var logger=require(_0x331f('0x7'))('rpc');var config=require(_0x331f('0x8'));var jayson=require(_0x331f('0x9'));var client=jayson[_0x331f('0xa')][_0x331f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x975d18,_0x298fa9,_0x3a4080){return new BPromise(function(_0x1f5201,_0xb3a601){return client['request'](_0x975d18,_0x3a4080)[_0x331f('0xc')](function(_0x27ae0f){logger[_0x331f('0xd')](_0x331f('0xe'),_0x298fa9,_0x331f('0xf'));logger[_0x331f('0x10')](_0x331f('0x11'),_0x298fa9,_0x331f('0xf'),JSON[_0x331f('0x12')](_0x27ae0f));if(_0x27ae0f[_0x331f('0x13')]){if(_0x27ae0f['error'][_0x331f('0x14')]===0x1f4){logger[_0x331f('0x13')](_0x331f('0xe'),_0x298fa9,_0x27ae0f[_0x331f('0x13')]['message']);return _0xb3a601(_0x27ae0f[_0x331f('0x13')][_0x331f('0x15')]);}logger[_0x331f('0x13')](_0x331f('0xe'),_0x298fa9,_0x27ae0f[_0x331f('0x13')][_0x331f('0x15')]);return _0x1f5201(_0x27ae0f[_0x331f('0x13')][_0x331f('0x15')]);}else{logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x298fa9,'request\x20sent');_0x1f5201(_0x27ae0f['result'][_0x331f('0x15')]);}})[_0x331f('0x16')](function(_0x4e34a0){logger['error'](_0x331f('0xe'),_0x298fa9,_0x4e34a0);_0xb3a601(_0x4e34a0);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 9095efb..eb5f15a 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 _0x40a7=['getSounds','post','addSound','put','delete','destroy','/:id/sounds/:id2','removeSound','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/sounds'];(function(_0xb1937e,_0x330b2f){var _0x44474f=function(_0x4336e0){while(--_0x4336e0){_0xb1937e['push'](_0xb1937e['shift']());}};_0x44474f(++_0x330b2f);}(_0x40a7,0x1bd));var _0x740a=function(_0xf4c043,_0xba3070){_0xf4c043=_0xf4c043-0x0;var _0x23ebe9=_0x40a7[_0xf4c043];return _0x23ebe9;};'use strict';var multer=require('multer');var util=require(_0x740a('0x0'));var path=require(_0x740a('0x1'));var timeout=require('connect-timeout');var express=require(_0x740a('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x740a('0x3'));var interaction=require(_0x740a('0x4'));var config=require(_0x740a('0x5'));var controller=require('./voiceMusicOnHold.controller');router[_0x740a('0x6')]('/',auth[_0x740a('0x7')](),controller[_0x740a('0x8')]);router[_0x740a('0x6')](_0x740a('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x740a('0x6')](_0x740a('0xa'),auth[_0x740a('0x7')](),controller[_0x740a('0xb')]);router[_0x740a('0xc')]('/',auth[_0x740a('0x7')](),controller['create']);router['post']('/:id/sounds',auth['isAuthenticated'](),controller[_0x740a('0xd')]);router[_0x740a('0xe')]('/:id',auth[_0x740a('0x7')](),controller['update']);router[_0x740a('0xf')](_0x740a('0x9'),auth[_0x740a('0x7')](),controller[_0x740a('0x10')]);router[_0x740a('0xf')](_0x740a('0x11'),auth['isAuthenticated'](),controller[_0x740a('0x12')]);module['exports']=router; \ No newline at end of file +var _0x7080=['connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','/:id/sounds','getSounds','post','addSound','update','destroy','delete','removeSound','multer'];(function(_0x35f0fa,_0x5e9e69){var _0x1950af=function(_0x2fba3d){while(--_0x2fba3d){_0x35f0fa['push'](_0x35f0fa['shift']());}};_0x1950af(++_0x5e9e69);}(_0x7080,0x6b));var _0x0708=function(_0x2d1371,_0x43aef7){_0x2d1371=_0x2d1371-0x0;var _0xf17680=_0x7080[_0x2d1371];return _0xf17680;};'use strict';var multer=require(_0x0708('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0708('0x1'));var express=require('express');var router=express[_0x0708('0x2')]();var fs_extra=require(_0x0708('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0708('0x4'));var config=require(_0x0708('0x5'));var controller=require(_0x0708('0x6'));router[_0x0708('0x7')]('/',auth[_0x0708('0x8')](),controller['index']);router[_0x0708('0x7')](_0x0708('0x9'),auth[_0x0708('0x8')](),controller['show']);router[_0x0708('0x7')](_0x0708('0xa'),auth['isAuthenticated'](),controller[_0x0708('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x0708('0xc')](_0x0708('0xa'),auth[_0x0708('0x8')](),controller[_0x0708('0xd')]);router['put'](_0x0708('0x9'),auth[_0x0708('0x8')](),controller[_0x0708('0xe')]);router['delete']('/:id',auth[_0x0708('0x8')](),controller[_0x0708('0xf')]);router[_0x0708('0x10')]('/:id/sounds/:id2',auth['isAuthenticated'](),controller[_0x0708('0x11')]);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 7b598f0..f2676ca 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 _0x673c=['BOOLEAN','sequelize','exports','STRING','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP'];(function(_0xbc7530,_0x381d8c){var _0x479ce7=function(_0x14627e){while(--_0x14627e){_0xbc7530['push'](_0xbc7530['shift']());}};_0x479ce7(++_0x381d8c);}(_0x673c,0xc4));var _0xc673=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x673c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc673('0x0'));module[_0xc673('0x1')]={'name':{'type':Sequelize[_0xc673('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0xc673('0x3')](_0xc673('0x4'),_0xc673('0x5'),_0xc673('0x6'),_0xc673('0x7'),_0xc673('0x8'),_0xc673('0x9')),'allowNull':!![],'defaultValue':_0xc673('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xc673('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xc673('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xc673('0x2')],'allowNull':!![],'defaultValue':_0xc673('0xa')},'format':{'type':Sequelize[_0xc673('0x2')],'allowNull':!![]},'stamp':{'type':_0xc673('0xb')},'defaultEntry':{'type':Sequelize[_0xc673('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfaf5=['mp3','alpha','TIMESTAMP','STRING','name','custom','files','mp3nb','quietmp3'];(function(_0x536919,_0x2d0c68){var _0x3694d9=function(_0xf21223){while(--_0xf21223){_0x536919['push'](_0x536919['shift']());}};_0x3694d9(++_0x2d0c68);}(_0xfaf5,0x159));var _0x5faf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfaf5[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5faf('0x0')],'allowNull':![],'unique':_0x5faf('0x1')},'mode':{'type':Sequelize['ENUM'](_0x5faf('0x2'),_0x5faf('0x3'),_0x5faf('0x4'),'quietmp3nb',_0x5faf('0x5'),_0x5faf('0x6')),'allowNull':!![],'defaultValue':_0x5faf('0x3')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x5faf('0x0')],'allowNull':!![]},'digit':{'type':Sequelize[_0x5faf('0x0')],'allowNull':!![]},'sort':{'type':Sequelize[_0x5faf('0x0')],'allowNull':!![],'defaultValue':_0x5faf('0x7')},'format':{'type':Sequelize[_0x5faf('0x0')],'allowNull':!![]},'stamp':{'type':_0x5faf('0x8')},'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 2d8c383..a22bec4 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 _0xee57=['merge','options','includeAll','findAll','rows','catch','show','params','include','find','body','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','rmdirSync','Sequelize','message','addSound','Sound','save_name','converted_format','createdAt','format','%s.%s','basename','extname','symlinkSync','ValidationError','removeSound','findOne','id2','getSounds','order','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','get','MusicOnHolds','UserProfileResource','destroy','stack','name','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter'];(function(_0x5300f2,_0x3cf31c){var _0x1a4833=function(_0x483621){while(--_0x483621){_0x5300f2['push'](_0x5300f2['shift']());}};_0x1a4833(++_0x3cf31c);}(_0xee57,0x189));var _0x7ee5=function(_0x4769a6,_0x2c41d2){_0x4769a6=_0x4769a6-0x0;var _0x1629d8=_0xee57[_0x4769a6];return _0x1629d8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7ee5('0x0'));var zipdir=require(_0x7ee5('0x1'));var jsonpatch=require(_0x7ee5('0x2'));var rp=require(_0x7ee5('0x3'));var moment=require(_0x7ee5('0x4'));var BPromise=require(_0x7ee5('0x5'));var Mustache=require(_0x7ee5('0x6'));var util=require(_0x7ee5('0x7'));var path=require(_0x7ee5('0x8'));var sox=require(_0x7ee5('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7ee5('0xa'));var _=require(_0x7ee5('0xb'));var squel=require(_0x7ee5('0xc'));var crypto=require(_0x7ee5('0xd'));var jsforce=require(_0x7ee5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7ee5('0xf'));var querystring=require(_0x7ee5('0x10'));var Papa=require(_0x7ee5('0x11'));var Redis=require(_0x7ee5('0x12'));var authService=require(_0x7ee5('0x13'));var qs=require(_0x7ee5('0x14'));var as=require(_0x7ee5('0x15'));var hardwareService=require(_0x7ee5('0x16'));var logger=require(_0x7ee5('0x17'))(_0x7ee5('0x18'));var utils=require(_0x7ee5('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7ee5('0x1a'))['db'];function respondWithStatusCode(_0x109da9,_0x4e9889){_0x4e9889=_0x4e9889||0xcc;return function(_0x50c27d){if(_0x50c27d){return _0x109da9[_0x7ee5('0x1b')](_0x4e9889);}return _0x109da9[_0x7ee5('0x1c')](_0x4e9889)[_0x7ee5('0x1d')]();};}function respondWithResult(_0x313f6d,_0x36c7c3){_0x36c7c3=_0x36c7c3||0xc8;return function(_0x4f151f){if(_0x4f151f){return _0x313f6d[_0x7ee5('0x1c')](_0x36c7c3)[_0x7ee5('0x1e')](_0x4f151f);}};}function respondWithFilteredResult(_0x48e7f9,_0x5329ae){return function(_0x43be64){if(_0x43be64){var _0x33bd46=typeof _0x5329ae[_0x7ee5('0x1f')]==='undefined'&&typeof _0x5329ae['limit']==='undefined';var _0x3c60cd=_0x43be64['count'];var _0x6132ca=_0x33bd46?0x0:_0x5329ae[_0x7ee5('0x1f')];var _0x2ef62d=_0x33bd46?_0x43be64[_0x7ee5('0x20')]:_0x5329ae['offset']+_0x5329ae[_0x7ee5('0x21')];var _0x3d177b;if(_0x2ef62d>=_0x3c60cd){_0x2ef62d=_0x3c60cd;_0x3d177b=0xc8;}else{_0x3d177b=0xce;}_0x48e7f9['status'](_0x3d177b);return _0x48e7f9[_0x7ee5('0x22')](_0x7ee5('0x23'),_0x6132ca+'-'+_0x2ef62d+'/'+_0x3c60cd)['json'](_0x43be64);}return null;};}function patchUpdates(_0x4986b3){return function(_0x2d541c){try{jsonpatch[_0x7ee5('0x24')](_0x2d541c,_0x4986b3,!![]);}catch(_0x516e7f){return BPromise[_0x7ee5('0x25')](_0x516e7f);}return _0x2d541c[_0x7ee5('0x26')]();};}function saveUpdates(_0x24f8e7,_0xac8197){return function(_0x2834e2){if(_0x2834e2){return _0x2834e2[_0x7ee5('0x27')](_0x24f8e7)['then'](function(_0x50a57b){return _0x50a57b;});}return null;};}function removeEntity(_0x18c7d4,_0x37225d){return function(_0x20e516){if(_0x20e516){return _0x20e516['destroy']()[_0x7ee5('0x28')](function(){var _0x34401f=_0x20e516[_0x7ee5('0x29')]({'plain':!![]});var _0x4aaf84=_0x7ee5('0x2a');return db[_0x7ee5('0x2b')][_0x7ee5('0x2c')]({'where':{'type':_0x4aaf84,'resourceId':_0x34401f['id']}})[_0x7ee5('0x28')](function(){return _0x20e516;});})[_0x7ee5('0x28')](function(){_0x18c7d4[_0x7ee5('0x1c')](0xcc)[_0x7ee5('0x1d')]();});}};}function handleEntityNotFound(_0x448b84,_0x48d264){return function(_0x287258){if(!_0x287258){_0x448b84[_0x7ee5('0x1b')](0x194);}return _0x287258;};}function handleError(_0x1b7a03,_0x3ab162){_0x3ab162=_0x3ab162||0x1f4;return function(_0x51eaa0){logger['error'](_0x51eaa0[_0x7ee5('0x2d')]);if(_0x51eaa0[_0x7ee5('0x2e')]){delete _0x51eaa0[_0x7ee5('0x2e')];}_0x1b7a03['status'](_0x3ab162)['send'](_0x51eaa0);};}exports[_0x7ee5('0x2f')]=function(_0x2181f0,_0x2eb41e){var _0x43a2dd={},_0x3c8791={},_0x23cd9b={'count':0x0,'rows':[]};var _0x2a0951=_[_0x7ee5('0x30')](db[_0x7ee5('0x31')][_0x7ee5('0x32')],function(_0x3ce0f8){return{'name':_0x3ce0f8[_0x7ee5('0x33')],'type':_0x3ce0f8[_0x7ee5('0x34')][_0x7ee5('0x35')]};});_0x3c8791[_0x7ee5('0x36')]=_[_0x7ee5('0x30')](_0x2a0951,'name');_0x3c8791[_0x7ee5('0x37')]=_[_0x7ee5('0x38')](_0x2181f0[_0x7ee5('0x37')]);_0x3c8791[_0x7ee5('0x39')]=_['intersection'](_0x3c8791[_0x7ee5('0x36')],_0x3c8791[_0x7ee5('0x37')]);_0x43a2dd[_0x7ee5('0x3a')]=_[_0x7ee5('0x3b')](_0x3c8791[_0x7ee5('0x36')],qs['fields'](_0x2181f0[_0x7ee5('0x37')][_0x7ee5('0x3c')]));_0x43a2dd[_0x7ee5('0x3a')]=_0x43a2dd['attributes'][_0x7ee5('0x3d')]?_0x43a2dd[_0x7ee5('0x3a')]:_0x3c8791['model'];if(!_0x2181f0[_0x7ee5('0x37')][_0x7ee5('0x3e')]('nolimit')){_0x43a2dd['limit']=qs['limit'](_0x2181f0[_0x7ee5('0x37')][_0x7ee5('0x21')]);_0x43a2dd[_0x7ee5('0x1f')]=qs['offset'](_0x2181f0['query']['offset']);}_0x43a2dd['order']=qs[_0x7ee5('0x3f')](_0x2181f0[_0x7ee5('0x37')][_0x7ee5('0x3f')]);delete _0x2181f0[_0x7ee5('0x37')][_0x7ee5('0x3f')];_0x43a2dd[_0x7ee5('0x40')]=qs[_0x7ee5('0x39')](_[_0x7ee5('0x41')](_0x2181f0[_0x7ee5('0x37')],_0x3c8791[_0x7ee5('0x39')]),_0x2a0951);if(_0x2181f0[_0x7ee5('0x37')][_0x7ee5('0x42')]){_0x43a2dd['where']=_['merge'](_0x43a2dd[_0x7ee5('0x40')],{'$or':_[_0x7ee5('0x30')](_0x2a0951,function(_0x100e6){if(_0x100e6['type']!=='VIRTUAL'){var _0x3059df={};_0x3059df[_0x100e6[_0x7ee5('0x2e')]]={'$like':'%'+_0x2181f0['query'][_0x7ee5('0x42')]+'%'};return _0x3059df;}})});}_0x43a2dd=_[_0x7ee5('0x43')]({},_0x43a2dd,_0x2181f0[_0x7ee5('0x44')]);var _0x5776bf={'where':_0x43a2dd[_0x7ee5('0x40')]};return db[_0x7ee5('0x31')]['count'](_0x5776bf)[_0x7ee5('0x28')](function(_0x414018){_0x23cd9b[_0x7ee5('0x20')]=_0x414018;if(_0x2181f0['query'][_0x7ee5('0x45')]){_0x43a2dd['include']=[{'all':!![]}];}return db[_0x7ee5('0x31')][_0x7ee5('0x46')](_0x43a2dd);})[_0x7ee5('0x28')](function(_0x5bc783){_0x23cd9b[_0x7ee5('0x47')]=_0x5bc783;return _0x23cd9b;})['then'](respondWithFilteredResult(_0x2eb41e,_0x43a2dd))[_0x7ee5('0x48')](handleError(_0x2eb41e,null));};exports[_0x7ee5('0x49')]=function(_0x1778ae,_0x1da595){var _0x2dad22={'raw':![],'where':{'id':_0x1778ae[_0x7ee5('0x4a')]['id']}},_0x2e77c2={};_0x2e77c2[_0x7ee5('0x36')]=_['keys'](db[_0x7ee5('0x31')][_0x7ee5('0x32')]);_0x2e77c2[_0x7ee5('0x37')]=_[_0x7ee5('0x38')](_0x1778ae[_0x7ee5('0x37')]);_0x2e77c2[_0x7ee5('0x39')]=_[_0x7ee5('0x3b')](_0x2e77c2[_0x7ee5('0x36')],_0x2e77c2['query']);_0x2dad22['attributes']=_['intersection'](_0x2e77c2[_0x7ee5('0x36')],qs[_0x7ee5('0x3c')](_0x1778ae[_0x7ee5('0x37')]['fields']));_0x2dad22[_0x7ee5('0x3a')]=_0x2dad22[_0x7ee5('0x3a')][_0x7ee5('0x3d')]?_0x2dad22[_0x7ee5('0x3a')]:_0x2e77c2[_0x7ee5('0x36')];if(_0x1778ae[_0x7ee5('0x37')]['includeAll']){_0x2dad22[_0x7ee5('0x4b')]=[{'all':!![]}];}_0x2dad22=_[_0x7ee5('0x43')]({},_0x2dad22,_0x1778ae['options']);return db[_0x7ee5('0x31')][_0x7ee5('0x4c')](_0x2dad22)[_0x7ee5('0x28')](handleEntityNotFound(_0x1da595,null))[_0x7ee5('0x28')](respondWithResult(_0x1da595,null))['catch'](handleError(_0x1da595,null));};exports['update']=function(_0xa2cf2e,_0x50d5df){if(_0xa2cf2e[_0x7ee5('0x4d')]['id']){delete _0xa2cf2e['body']['id'];}return db[_0x7ee5('0x31')][_0x7ee5('0x4c')]({'where':{'id':_0xa2cf2e[_0x7ee5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x50d5df,null))[_0x7ee5('0x28')](saveUpdates(_0xa2cf2e[_0x7ee5('0x4d')],null))[_0x7ee5('0x28')](respondWithResult(_0x50d5df,null))['catch'](handleError(_0x50d5df,null));};exports[_0x7ee5('0x4e')]=function(_0xf0b277,_0x299e27,_0x5d8960){return db[_0x7ee5('0x4f')][_0x7ee5('0x50')](function(_0x23214b){if(_0xf0b277[_0x7ee5('0x4d')][_0x7ee5('0x51')]===_0x7ee5('0x52')){_0xf0b277[_0x7ee5('0x4d')][_0x7ee5('0x53')]=path[_0x7ee5('0x54')](config[_0x7ee5('0x55')],_0x7ee5('0x56'),_0xf0b277[_0x7ee5('0x4d')][_0x7ee5('0x2e')]);}return db[_0x7ee5('0x31')]['create'](_0xf0b277[_0x7ee5('0x4d')],{'transaction':_0x23214b})[_0x7ee5('0x28')](function(_0x174e17){if(_0xf0b277[_0x7ee5('0x4d')][_0x7ee5('0x51')]==='files'){fs['mkdirSync'](_0x174e17[_0x7ee5('0x53')],parseInt('0777',0x8));}var _0x36f9a0=_0xf0b277[_0x7ee5('0x57')][_0x7ee5('0x29')]({'plain':!![]});if(!_0x36f9a0)throw new Error(_0x7ee5('0x58'));if(_0x36f9a0['role']===_0x7ee5('0x57')){var _0xa2d534=_0x174e17[_0x7ee5('0x29')]({'plain':!![]});return db[_0x7ee5('0x59')][_0x7ee5('0x4c')]({'where':{'name':'MusicOnHolds','userProfileId':_0x36f9a0[_0x7ee5('0x5a')]},'raw':!![]})['then'](function(_0x48ef03){if(_0x48ef03&&_0x48ef03['autoAssociation']===0x0){return db[_0x7ee5('0x2b')][_0x7ee5('0x4e')]({'name':_0xa2d534[_0x7ee5('0x2e')],'resourceId':_0xa2d534['id'],'type':_0x48ef03['name'],'sectionId':_0x48ef03['id']},{})[_0x7ee5('0x28')](function(){return _0x174e17;});}else{return _0x174e17;}})[_0x7ee5('0x48')](function(_0x533381){logger[_0x7ee5('0x5b')](_0x7ee5('0x5c'),_0x533381);});}return _0x174e17;});})['then'](respondWithResult(_0x299e27,0xc9))[_0x7ee5('0x48')](handleError(_0x299e27,null));};exports[_0x7ee5('0x2c')]=function(_0x5583f2,_0x44d301,_0x4be8a0){var _0x685249;return db['VoiceMusicOnHold'][_0x7ee5('0x4c')]({'where':{'id':_0x5583f2[_0x7ee5('0x4a')]['id']}})['then'](function(_0x1f93f3){if(_0x1f93f3){return db[_0x7ee5('0x4f')][_0x7ee5('0x50')](function(_0x2399cb){return _0x1f93f3[_0x7ee5('0x2c')]({'transaction':_0x2399cb,'raw':!![]})['then'](function(_0x47aa8f){if(_0x47aa8f[_0x7ee5('0x53')]){fs[_0x7ee5('0x5d')](_0x47aa8f[_0x7ee5('0x53')])[_0x7ee5('0x5e')](function(_0x3f3ede){fs['unlinkSync'](path[_0x7ee5('0x54')](_0x47aa8f['directory'],_0x3f3ede));});fs[_0x7ee5('0x5f')](_0x47aa8f[_0x7ee5('0x53')]);}return _0x47aa8f;});})['catch'](function(_0x2ab0e0){throw new db[(_0x7ee5('0x60'))]['ValidationError'](_0x2ab0e0[_0x7ee5('0x61')]);});}})[_0x7ee5('0x28')](handleEntityNotFound(_0x44d301,null))[_0x7ee5('0x28')](removeEntity(_0x44d301,null))[_0x7ee5('0x48')](handleError(_0x44d301,null));};exports[_0x7ee5('0x62')]=function(_0x23417e,_0x30fc46,_0x48034f){return db[_0x7ee5('0x4f')][_0x7ee5('0x50')](function(_0x3dac78){var _0x31015e;return db[_0x7ee5('0x31')][_0x7ee5('0x4c')]({'where':{'id':_0x23417e[_0x7ee5('0x4a')]['id']}})[_0x7ee5('0x28')](function(_0x4565c1){if(_0x4565c1){_0x31015e=_0x4565c1;return _0x4565c1['addSound'](_0x23417e[_0x7ee5('0x4d')]['id'],{'transaction':_0x3dac78});}})[_0x7ee5('0x28')](function(_0x4c1e12){if(_0x4c1e12){return db[_0x7ee5('0x63')]['findOne']({'where':{'id':_0x23417e['body']['id']},'attributes':['id',_0x7ee5('0x2e'),_0x7ee5('0x64'),_0x7ee5('0x65'),_0x7ee5('0x66')],'raw':!![]});}})[_0x7ee5('0x28')](function(_0x412aa1){if(_0x412aa1){var _0x4dbcbe=path['join'](config['root'],'server/files/sounds/converted',util[_0x7ee5('0x67')](_0x7ee5('0x68'),path[_0x7ee5('0x69')](_0x412aa1[_0x7ee5('0x64')],path[_0x7ee5('0x6a')](_0x412aa1[_0x7ee5('0x64')])),_0x412aa1[_0x7ee5('0x65')]));var _0x16f7e6=path[_0x7ee5('0x54')](config[_0x7ee5('0x55')],'server/files/moh',_0x31015e[_0x7ee5('0x2e')],util['format'](_0x7ee5('0x68'),_0x412aa1[_0x7ee5('0x2e')],_0x412aa1[_0x7ee5('0x65')]));fs[_0x7ee5('0x6b')](_0x4dbcbe,_0x16f7e6);return _0x412aa1;}})[_0x7ee5('0x48')](function(_0x3bae1d){throw new db[(_0x7ee5('0x60'))][(_0x7ee5('0x6c'))](_0x3bae1d[_0x7ee5('0x61')]);});})[_0x7ee5('0x28')](handleEntityNotFound(_0x30fc46,null))[_0x7ee5('0x28')](respondWithResult(_0x30fc46,0xc9))[_0x7ee5('0x48')](handleError(_0x30fc46,null));};exports[_0x7ee5('0x6d')]=function(_0x4bb5e4,_0x3348f7,_0x3788b5){return db['sequelize'][_0x7ee5('0x50')](function(_0x9385eb){var _0x5ac516;return db[_0x7ee5('0x31')][_0x7ee5('0x6e')]({'where':{'id':_0x4bb5e4[_0x7ee5('0x4a')]['id']}})[_0x7ee5('0x28')](handleEntityNotFound(_0x3348f7,null))[_0x7ee5('0x28')](function(_0x2f4910){if(_0x2f4910){_0x5ac516=_0x2f4910;return _0x2f4910[_0x7ee5('0x6d')](_0x4bb5e4[_0x7ee5('0x4a')][_0x7ee5('0x6f')]);}})[_0x7ee5('0x28')](function(_0x503dae){if(_0x503dae){return db[_0x7ee5('0x63')][_0x7ee5('0x6e')]({'where':{'id':_0x4bb5e4[_0x7ee5('0x4a')][_0x7ee5('0x6f')]},'attributes':['id',_0x7ee5('0x2e'),'save_name',_0x7ee5('0x65'),_0x7ee5('0x66')],'raw':!![]});}})[_0x7ee5('0x28')](function(_0x23ea7c){if(_0x23ea7c){fs['unlinkSync'](path[_0x7ee5('0x54')](_0x5ac516[_0x7ee5('0x53')],util[_0x7ee5('0x67')](_0x7ee5('0x68'),_0x23ea7c[_0x7ee5('0x2e')],_0x23ea7c[_0x7ee5('0x65')])));return _0x23ea7c;}})['catch'](function(_0x34f85a){throw new db[(_0x7ee5('0x60'))]['ValidationError'](_0x34f85a[_0x7ee5('0x61')]);});})[_0x7ee5('0x28')](handleEntityNotFound(_0x3348f7,null))[_0x7ee5('0x28')](respondWithStatusCode(_0x3348f7,0xcc))['catch'](handleError(_0x3348f7,null));};exports[_0x7ee5('0x70')]=function(_0x3ff4ed,_0x1da8f4,_0x8b5962){var _0xd84e0c={};var _0x524090={};var _0x31d0ff;var _0x5b8bcc;return db[_0x7ee5('0x31')][_0x7ee5('0x6e')]({'where':{'id':_0x3ff4ed[_0x7ee5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1da8f4,null))[_0x7ee5('0x28')](function(_0x4b5d87){if(_0x4b5d87){_0x31d0ff=_0x4b5d87;_0x524090[_0x7ee5('0x36')]=_[_0x7ee5('0x38')](db[_0x7ee5('0x63')][_0x7ee5('0x32')]);_0x524090[_0x7ee5('0x37')]=_['keys'](_0x3ff4ed['query']);_0x524090['filters']=_['intersection'](_0x524090[_0x7ee5('0x36')],_0x524090[_0x7ee5('0x37')]);_0xd84e0c[_0x7ee5('0x3a')]=_[_0x7ee5('0x3b')](_0x524090[_0x7ee5('0x36')],qs[_0x7ee5('0x3c')](_0x3ff4ed[_0x7ee5('0x37')]['fields']));_0xd84e0c[_0x7ee5('0x3a')]=_0xd84e0c[_0x7ee5('0x3a')][_0x7ee5('0x3d')]?_0xd84e0c[_0x7ee5('0x3a')]:_0x524090[_0x7ee5('0x36')];_0xd84e0c[_0x7ee5('0x71')]=qs[_0x7ee5('0x3f')](_0x3ff4ed[_0x7ee5('0x37')]['sort']);_0xd84e0c[_0x7ee5('0x40')]=qs[_0x7ee5('0x39')](_['pick'](_0x3ff4ed['query'],_0x524090['filters']));if(_0x3ff4ed[_0x7ee5('0x37')][_0x7ee5('0x42')]){_0xd84e0c[_0x7ee5('0x40')]=_[_0x7ee5('0x43')](_0xd84e0c[_0x7ee5('0x40')],{'$or':_[_0x7ee5('0x30')](_0xd84e0c[_0x7ee5('0x3a')],function(_0x33bec5){var _0x1f6acd={};_0x1f6acd[_0x33bec5]={'$like':'%'+_0x3ff4ed[_0x7ee5('0x37')][_0x7ee5('0x42')]+'%'};return _0x1f6acd;})});}_0xd84e0c=_[_0x7ee5('0x43')]({},_0xd84e0c,_0x3ff4ed[_0x7ee5('0x44')]);return _0x31d0ff[_0x7ee5('0x70')](_0xd84e0c);}})[_0x7ee5('0x28')](function(_0x147c1b){if(_0x147c1b){_0x5b8bcc=_0x147c1b[_0x7ee5('0x3d')];if(!_0x3ff4ed[_0x7ee5('0x37')]['hasOwnProperty'](_0x7ee5('0x72'))){_0xd84e0c[_0x7ee5('0x21')]=qs[_0x7ee5('0x21')](_0x3ff4ed[_0x7ee5('0x37')][_0x7ee5('0x21')]);_0xd84e0c['offset']=qs[_0x7ee5('0x1f')](_0x3ff4ed['query'][_0x7ee5('0x1f')]);}return _0x31d0ff['getSounds'](_0xd84e0c);}})[_0x7ee5('0x28')](function(_0x30b8ba){if(_0x30b8ba){return _0x30b8ba?{'count':_0x5b8bcc,'rows':_0x30b8ba}:null;}})[_0x7ee5('0x28')](respondWithResult(_0x1da8f4,null))[_0x7ee5('0x48')](handleError(_0x1da8f4,null));}; \ No newline at end of file +var _0xaba5=['body','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','0777','user','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','error','destroy','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','message','addSound','findOne','save_name','converted_format','server/files/sounds/converted','format','%s.%s','extname','symlinkSync','ValidationError','removeSound','id2','Sound','createdAt','pick','hasOwnProperty','getSounds','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','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','set','Content-Range','json','reject','save','get','UserProfileResource','then','name','send','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','update'];(function(_0x45a16,_0x3432fb){var _0x4a65b2=function(_0x115f21){while(--_0x115f21){_0x45a16['push'](_0x45a16['shift']());}};_0x4a65b2(++_0x3432fb);}(_0xaba5,0x9d));var _0x5aba=function(_0x438e9d,_0x47dd98){_0x438e9d=_0x438e9d-0x0;var _0x2364c9=_0xaba5[_0x438e9d];return _0x2364c9;};'use strict';var emlformat=require(_0x5aba('0x0'));var rimraf=require(_0x5aba('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5aba('0x2'));var rp=require(_0x5aba('0x3'));var moment=require(_0x5aba('0x4'));var BPromise=require(_0x5aba('0x5'));var Mustache=require(_0x5aba('0x6'));var util=require(_0x5aba('0x7'));var path=require(_0x5aba('0x8'));var sox=require(_0x5aba('0x9'));var csv=require('to-csv');var ejs=require(_0x5aba('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5aba('0xb'));var squel=require('squel');var crypto=require(_0x5aba('0xc'));var jsforce=require(_0x5aba('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5aba('0xe'));var Redis=require(_0x5aba('0xf'));var authService=require(_0x5aba('0x10'));var qs=require(_0x5aba('0x11'));var as=require(_0x5aba('0x12'));var hardwareService=require(_0x5aba('0x13'));var logger=require('../../config/logger')(_0x5aba('0x14'));var utils=require(_0x5aba('0x15'));var config=require(_0x5aba('0x16'));var licenseUtil=require(_0x5aba('0x17'));var db=require(_0x5aba('0x18'))['db'];function respondWithStatusCode(_0x293616,_0x2744a3){_0x2744a3=_0x2744a3||0xcc;return function(_0x152fe4){if(_0x152fe4){return _0x293616[_0x5aba('0x19')](_0x2744a3);}return _0x293616[_0x5aba('0x1a')](_0x2744a3)[_0x5aba('0x1b')]();};}function respondWithResult(_0x1fd0d9,_0x4665ee){_0x4665ee=_0x4665ee||0xc8;return function(_0x5b54c3){if(_0x5b54c3){return _0x1fd0d9[_0x5aba('0x1a')](_0x4665ee)['json'](_0x5b54c3);}};}function respondWithFilteredResult(_0x500ec2,_0x180267){return function(_0x405ed6){if(_0x405ed6){var _0x34d852=typeof _0x180267[_0x5aba('0x1c')]===_0x5aba('0x1d')&&typeof _0x180267[_0x5aba('0x1e')]===_0x5aba('0x1d');var _0x5a01bb=_0x405ed6['count'];var _0x1b8c4d=_0x34d852?0x0:_0x180267['offset'];var _0x410326=_0x34d852?_0x405ed6[_0x5aba('0x1f')]:_0x180267[_0x5aba('0x1c')]+_0x180267['limit'];var _0x53ace6;if(_0x410326>=_0x5a01bb){_0x410326=_0x5a01bb;_0x53ace6=0xc8;}else{_0x53ace6=0xce;}_0x500ec2['status'](_0x53ace6);return _0x500ec2[_0x5aba('0x20')](_0x5aba('0x21'),_0x1b8c4d+'-'+_0x410326+'/'+_0x5a01bb)[_0x5aba('0x22')](_0x405ed6);}return null;};}function patchUpdates(_0xa4b19){return function(_0x106205){try{jsonpatch['apply'](_0x106205,_0xa4b19,!![]);}catch(_0x2101a6){return BPromise[_0x5aba('0x23')](_0x2101a6);}return _0x106205[_0x5aba('0x24')]();};}function saveUpdates(_0x512a5b,_0x392ef5){return function(_0x2ac202){if(_0x2ac202){return _0x2ac202['update'](_0x512a5b)['then'](function(_0x31d90){return _0x31d90;});}return null;};}function removeEntity(_0x19da2d,_0x358d02){return function(_0x26b92d){if(_0x26b92d){return _0x26b92d['destroy']()['then'](function(){var _0x5662a7=_0x26b92d[_0x5aba('0x25')]({'plain':!![]});var _0xa716c='MusicOnHolds';return db[_0x5aba('0x26')]['destroy']({'where':{'type':_0xa716c,'resourceId':_0x5662a7['id']}})[_0x5aba('0x27')](function(){return _0x26b92d;});})[_0x5aba('0x27')](function(){_0x19da2d[_0x5aba('0x1a')](0xcc)[_0x5aba('0x1b')]();});}};}function handleEntityNotFound(_0x1f04b0,_0x2361d0){return function(_0x27ad51){if(!_0x27ad51){_0x1f04b0[_0x5aba('0x19')](0x194);}return _0x27ad51;};}function handleError(_0xa083ba,_0x32c58c){_0x32c58c=_0x32c58c||0x1f4;return function(_0x28454f){logger['error'](_0x28454f['stack']);if(_0x28454f[_0x5aba('0x28')]){delete _0x28454f[_0x5aba('0x28')];}_0xa083ba[_0x5aba('0x1a')](_0x32c58c)[_0x5aba('0x29')](_0x28454f);};}exports['index']=function(_0x26f196,_0x47b30d){var _0x5e0907={},_0x1ec634={},_0x317690={'count':0x0,'rows':[]};var _0x213851=_[_0x5aba('0x2a')](db[_0x5aba('0x2b')][_0x5aba('0x2c')],function(_0x5cd555){return{'name':_0x5cd555[_0x5aba('0x2d')],'type':_0x5cd555[_0x5aba('0x2e')][_0x5aba('0x2f')]};});_0x1ec634[_0x5aba('0x30')]=_['map'](_0x213851,'name');_0x1ec634['query']=_[_0x5aba('0x31')](_0x26f196[_0x5aba('0x32')]);_0x1ec634[_0x5aba('0x33')]=_['intersection'](_0x1ec634[_0x5aba('0x30')],_0x1ec634[_0x5aba('0x32')]);_0x5e0907[_0x5aba('0x34')]=_[_0x5aba('0x35')](_0x1ec634[_0x5aba('0x30')],qs[_0x5aba('0x36')](_0x26f196[_0x5aba('0x32')][_0x5aba('0x36')]));_0x5e0907[_0x5aba('0x34')]=_0x5e0907['attributes'][_0x5aba('0x37')]?_0x5e0907[_0x5aba('0x34')]:_0x1ec634[_0x5aba('0x30')];if(!_0x26f196[_0x5aba('0x32')]['hasOwnProperty'](_0x5aba('0x38'))){_0x5e0907[_0x5aba('0x1e')]=qs[_0x5aba('0x1e')](_0x26f196[_0x5aba('0x32')][_0x5aba('0x1e')]);_0x5e0907[_0x5aba('0x1c')]=qs[_0x5aba('0x1c')](_0x26f196[_0x5aba('0x32')][_0x5aba('0x1c')]);}_0x5e0907[_0x5aba('0x39')]=qs[_0x5aba('0x3a')](_0x26f196[_0x5aba('0x32')]['sort']);delete _0x26f196['query'][_0x5aba('0x3a')];_0x5e0907[_0x5aba('0x3b')]=qs['filters'](_['pick'](_0x26f196[_0x5aba('0x32')],_0x1ec634['filters']),_0x213851);if(_0x26f196['query'][_0x5aba('0x3c')]){_0x5e0907['where']=_[_0x5aba('0x3d')](_0x5e0907[_0x5aba('0x3b')],{'$or':_[_0x5aba('0x2a')](_0x213851,function(_0x4ecbef){if(_0x4ecbef[_0x5aba('0x2e')]!==_0x5aba('0x3e')){var _0x1b1e44={};_0x1b1e44[_0x4ecbef[_0x5aba('0x28')]]={'$like':'%'+_0x26f196[_0x5aba('0x32')][_0x5aba('0x3c')]+'%'};return _0x1b1e44;}})});}_0x5e0907=_[_0x5aba('0x3d')]({},_0x5e0907,_0x26f196[_0x5aba('0x3f')]);var _0x4a779a={'where':_0x5e0907['where']};return db[_0x5aba('0x2b')][_0x5aba('0x1f')](_0x4a779a)['then'](function(_0x244d1b){_0x317690['count']=_0x244d1b;if(_0x26f196['query'][_0x5aba('0x40')]){_0x5e0907[_0x5aba('0x41')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x5aba('0x42')](_0x5e0907);})[_0x5aba('0x27')](function(_0x36e442){_0x317690[_0x5aba('0x43')]=_0x36e442;return _0x317690;})[_0x5aba('0x27')](respondWithFilteredResult(_0x47b30d,_0x5e0907))[_0x5aba('0x44')](handleError(_0x47b30d,null));};exports[_0x5aba('0x45')]=function(_0x222192,_0x118ade){var _0x5e3cdc={'raw':![],'where':{'id':_0x222192[_0x5aba('0x46')]['id']}},_0x1f3109={};_0x1f3109[_0x5aba('0x30')]=_['keys'](db['VoiceMusicOnHold'][_0x5aba('0x2c')]);_0x1f3109[_0x5aba('0x32')]=_[_0x5aba('0x31')](_0x222192['query']);_0x1f3109[_0x5aba('0x33')]=_[_0x5aba('0x35')](_0x1f3109[_0x5aba('0x30')],_0x1f3109[_0x5aba('0x32')]);_0x5e3cdc[_0x5aba('0x34')]=_['intersection'](_0x1f3109[_0x5aba('0x30')],qs[_0x5aba('0x36')](_0x222192[_0x5aba('0x32')]['fields']));_0x5e3cdc[_0x5aba('0x34')]=_0x5e3cdc[_0x5aba('0x34')][_0x5aba('0x37')]?_0x5e3cdc[_0x5aba('0x34')]:_0x1f3109[_0x5aba('0x30')];if(_0x222192[_0x5aba('0x32')][_0x5aba('0x40')]){_0x5e3cdc[_0x5aba('0x41')]=[{'all':!![]}];}_0x5e3cdc=_[_0x5aba('0x3d')]({},_0x5e3cdc,_0x222192[_0x5aba('0x3f')]);return db['VoiceMusicOnHold'][_0x5aba('0x47')](_0x5e3cdc)['then'](handleEntityNotFound(_0x118ade,null))[_0x5aba('0x27')](respondWithResult(_0x118ade,null))[_0x5aba('0x44')](handleError(_0x118ade,null));};exports[_0x5aba('0x48')]=function(_0xc62f4d,_0x1674d7){if(_0xc62f4d[_0x5aba('0x49')]['id']){delete _0xc62f4d['body']['id'];}return db[_0x5aba('0x2b')][_0x5aba('0x47')]({'where':{'id':_0xc62f4d['params']['id']}})['then'](handleEntityNotFound(_0x1674d7,null))[_0x5aba('0x27')](saveUpdates(_0xc62f4d[_0x5aba('0x49')],null))[_0x5aba('0x27')](respondWithResult(_0x1674d7,null))[_0x5aba('0x44')](handleError(_0x1674d7,null));};exports[_0x5aba('0x4a')]=function(_0x2cf04f,_0x56c933,_0x209ca5){return db[_0x5aba('0x4b')][_0x5aba('0x4c')](function(_0x24e177){if(_0x2cf04f[_0x5aba('0x49')][_0x5aba('0x4d')]===_0x5aba('0x4e')){_0x2cf04f[_0x5aba('0x49')][_0x5aba('0x4f')]=path[_0x5aba('0x50')](config[_0x5aba('0x51')],_0x5aba('0x52'),_0x2cf04f[_0x5aba('0x49')][_0x5aba('0x28')]);}return db[_0x5aba('0x2b')][_0x5aba('0x4a')](_0x2cf04f['body'],{'transaction':_0x24e177})['then'](function(_0x2c4611){if(_0x2cf04f[_0x5aba('0x49')][_0x5aba('0x4d')]===_0x5aba('0x4e')){fs[_0x5aba('0x53')](_0x2c4611['directory'],parseInt(_0x5aba('0x54'),0x8));}var _0x5cb813=_0x2cf04f[_0x5aba('0x55')][_0x5aba('0x25')]({'plain':!![]});if(!_0x5cb813)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5cb813['role']===_0x5aba('0x55')){var _0x31a28b=_0x2c4611[_0x5aba('0x25')]({'plain':!![]});return db[_0x5aba('0x56')][_0x5aba('0x47')]({'where':{'name':_0x5aba('0x57'),'userProfileId':_0x5cb813[_0x5aba('0x58')]},'raw':!![]})[_0x5aba('0x27')](function(_0x112834){if(_0x112834&&_0x112834[_0x5aba('0x59')]===0x0){return db['UserProfileResource']['create']({'name':_0x31a28b[_0x5aba('0x28')],'resourceId':_0x31a28b['id'],'type':_0x112834[_0x5aba('0x28')],'sectionId':_0x112834['id']},{})[_0x5aba('0x27')](function(){return _0x2c4611;});}else{return _0x2c4611;}})[_0x5aba('0x44')](function(_0x3e6b9b){logger[_0x5aba('0x5a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e6b9b);});}return _0x2c4611;});})[_0x5aba('0x27')](respondWithResult(_0x56c933,0xc9))['catch'](handleError(_0x56c933,null));};exports['destroy']=function(_0x40e773,_0xf2e252,_0x21b3f7){var _0x105781;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x40e773[_0x5aba('0x46')]['id']}})['then'](function(_0x5467aa){if(_0x5467aa){return db[_0x5aba('0x4b')]['transaction'](function(_0x4cde4f){return _0x5467aa[_0x5aba('0x5b')]({'transaction':_0x4cde4f,'raw':!![]})[_0x5aba('0x27')](function(_0x3ef7fd){if(_0x3ef7fd['directory']){fs[_0x5aba('0x5c')](_0x3ef7fd['directory'])[_0x5aba('0x5d')](function(_0x1d1ea3){fs[_0x5aba('0x5e')](path[_0x5aba('0x50')](_0x3ef7fd[_0x5aba('0x4f')],_0x1d1ea3));});fs[_0x5aba('0x5f')](_0x3ef7fd[_0x5aba('0x4f')]);}return _0x3ef7fd;});})[_0x5aba('0x44')](function(_0x16e595){throw new db[(_0x5aba('0x60'))]['ValidationError'](_0x16e595[_0x5aba('0x61')]);});}})[_0x5aba('0x27')](handleEntityNotFound(_0xf2e252,null))['then'](removeEntity(_0xf2e252,null))[_0x5aba('0x44')](handleError(_0xf2e252,null));};exports[_0x5aba('0x62')]=function(_0x2b998a,_0x196084,_0x3b8a67){return db['sequelize']['transaction'](function(_0x3a1615){var _0x37fbd4;return db[_0x5aba('0x2b')][_0x5aba('0x47')]({'where':{'id':_0x2b998a[_0x5aba('0x46')]['id']}})[_0x5aba('0x27')](function(_0xee8f65){if(_0xee8f65){_0x37fbd4=_0xee8f65;return _0xee8f65[_0x5aba('0x62')](_0x2b998a[_0x5aba('0x49')]['id'],{'transaction':_0x3a1615});}})[_0x5aba('0x27')](function(_0x2f4ed0){if(_0x2f4ed0){return db['Sound'][_0x5aba('0x63')]({'where':{'id':_0x2b998a[_0x5aba('0x49')]['id']},'attributes':['id',_0x5aba('0x28'),_0x5aba('0x64'),_0x5aba('0x65'),'createdAt'],'raw':!![]});}})[_0x5aba('0x27')](function(_0x2cd572){if(_0x2cd572){var _0x434d6b=path[_0x5aba('0x50')](config[_0x5aba('0x51')],_0x5aba('0x66'),util[_0x5aba('0x67')](_0x5aba('0x68'),path['basename'](_0x2cd572[_0x5aba('0x64')],path[_0x5aba('0x69')](_0x2cd572[_0x5aba('0x64')])),_0x2cd572[_0x5aba('0x65')]));var _0x4b6e0b=path[_0x5aba('0x50')](config[_0x5aba('0x51')],_0x5aba('0x52'),_0x37fbd4['name'],util[_0x5aba('0x67')]('%s.%s',_0x2cd572[_0x5aba('0x28')],_0x2cd572[_0x5aba('0x65')]));fs[_0x5aba('0x6a')](_0x434d6b,_0x4b6e0b);return _0x2cd572;}})['catch'](function(_0x5067bb){throw new db[(_0x5aba('0x60'))][(_0x5aba('0x6b'))](_0x5067bb['message']);});})[_0x5aba('0x27')](handleEntityNotFound(_0x196084,null))[_0x5aba('0x27')](respondWithResult(_0x196084,0xc9))[_0x5aba('0x44')](handleError(_0x196084,null));};exports[_0x5aba('0x6c')]=function(_0xaf49df,_0x403f89,_0x148621){return db[_0x5aba('0x4b')]['transaction'](function(_0x55abff){var _0x9710f0;return db[_0x5aba('0x2b')][_0x5aba('0x63')]({'where':{'id':_0xaf49df['params']['id']}})[_0x5aba('0x27')](handleEntityNotFound(_0x403f89,null))['then'](function(_0xe7f851){if(_0xe7f851){_0x9710f0=_0xe7f851;return _0xe7f851[_0x5aba('0x6c')](_0xaf49df[_0x5aba('0x46')][_0x5aba('0x6d')]);}})[_0x5aba('0x27')](function(_0x14fd9b){if(_0x14fd9b){return db[_0x5aba('0x6e')][_0x5aba('0x63')]({'where':{'id':_0xaf49df[_0x5aba('0x46')]['id2']},'attributes':['id',_0x5aba('0x28'),_0x5aba('0x64'),_0x5aba('0x65'),_0x5aba('0x6f')],'raw':!![]});}})['then'](function(_0x4524b3){if(_0x4524b3){fs[_0x5aba('0x5e')](path[_0x5aba('0x50')](_0x9710f0['directory'],util[_0x5aba('0x67')](_0x5aba('0x68'),_0x4524b3[_0x5aba('0x28')],_0x4524b3['converted_format'])));return _0x4524b3;}})['catch'](function(_0x4e4db2){throw new db[(_0x5aba('0x60'))][(_0x5aba('0x6b'))](_0x4e4db2[_0x5aba('0x61')]);});})[_0x5aba('0x27')](handleEntityNotFound(_0x403f89,null))['then'](respondWithStatusCode(_0x403f89,0xcc))['catch'](handleError(_0x403f89,null));};exports['getSounds']=function(_0x51b87c,_0x2d67f3,_0x331450){var _0x329f2d={};var _0x3e7ed6={};var _0x4d876b;var _0x48c88d;return db['VoiceMusicOnHold'][_0x5aba('0x63')]({'where':{'id':_0x51b87c[_0x5aba('0x46')]['id']}})['then'](handleEntityNotFound(_0x2d67f3,null))['then'](function(_0x3d0db5){if(_0x3d0db5){_0x4d876b=_0x3d0db5;_0x3e7ed6[_0x5aba('0x30')]=_['keys'](db[_0x5aba('0x6e')]['rawAttributes']);_0x3e7ed6[_0x5aba('0x32')]=_[_0x5aba('0x31')](_0x51b87c[_0x5aba('0x32')]);_0x3e7ed6[_0x5aba('0x33')]=_['intersection'](_0x3e7ed6['model'],_0x3e7ed6['query']);_0x329f2d['attributes']=_[_0x5aba('0x35')](_0x3e7ed6[_0x5aba('0x30')],qs[_0x5aba('0x36')](_0x51b87c['query'][_0x5aba('0x36')]));_0x329f2d[_0x5aba('0x34')]=_0x329f2d[_0x5aba('0x34')][_0x5aba('0x37')]?_0x329f2d[_0x5aba('0x34')]:_0x3e7ed6[_0x5aba('0x30')];_0x329f2d[_0x5aba('0x39')]=qs[_0x5aba('0x3a')](_0x51b87c[_0x5aba('0x32')][_0x5aba('0x3a')]);_0x329f2d[_0x5aba('0x3b')]=qs[_0x5aba('0x33')](_[_0x5aba('0x70')](_0x51b87c[_0x5aba('0x32')],_0x3e7ed6[_0x5aba('0x33')]));if(_0x51b87c['query']['filter']){_0x329f2d[_0x5aba('0x3b')]=_['merge'](_0x329f2d['where'],{'$or':_[_0x5aba('0x2a')](_0x329f2d[_0x5aba('0x34')],function(_0x5774e6){var _0x4c5fcc={};_0x4c5fcc[_0x5774e6]={'$like':'%'+_0x51b87c[_0x5aba('0x32')]['filter']+'%'};return _0x4c5fcc;})});}_0x329f2d=_[_0x5aba('0x3d')]({},_0x329f2d,_0x51b87c['options']);return _0x4d876b['getSounds'](_0x329f2d);}})[_0x5aba('0x27')](function(_0x2b21db){if(_0x2b21db){_0x48c88d=_0x2b21db[_0x5aba('0x37')];if(!_0x51b87c[_0x5aba('0x32')][_0x5aba('0x71')](_0x5aba('0x38'))){_0x329f2d['limit']=qs[_0x5aba('0x1e')](_0x51b87c[_0x5aba('0x32')][_0x5aba('0x1e')]);_0x329f2d[_0x5aba('0x1c')]=qs[_0x5aba('0x1c')](_0x51b87c['query'][_0x5aba('0x1c')]);}return _0x4d876b[_0x5aba('0x72')](_0x329f2d);}})[_0x5aba('0x27')](function(_0xb4ffcc){if(_0xb4ffcc){return _0xb4ffcc?{'count':_0x48c88d,'rows':_0xb4ffcc}:null;}})[_0x5aba('0x27')](respondWithResult(_0x2d67f3,null))['catch'](handleError(_0x2d67f3,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index ebd8b45..b3351ff 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 _0x3fa2=['path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','moment','request-promise'];(function(_0x5c7939,_0x22f61e){var _0x5bcfbc=function(_0x80c86){while(--_0x80c86){_0x5c7939['push'](_0x5c7939['shift']());}};_0x5bcfbc(++_0x22f61e);}(_0x3fa2,0xdf));var _0x23fa=function(_0x32d1b3,_0x2dcb60){_0x32d1b3=_0x32d1b3-0x0;var _0x1f0b74=_0x3fa2[_0x32d1b3];return _0x1f0b74;};'use strict';var _=require(_0x23fa('0x0'));var util=require(_0x23fa('0x1'));var logger=require(_0x23fa('0x2'))('api');var moment=require(_0x23fa('0x3'));var BPromise=require('bluebird');var rp=require(_0x23fa('0x4'));var fs=require('fs');var path=require(_0x23fa('0x5'));var rimraf=require(_0x23fa('0x6'));var config=require(_0x23fa('0x7'));var attributes=require(_0x23fa('0x8'));module['exports']=function(_0x4fcd3a,_0xf17fbd){return _0x4fcd3a[_0x23fa('0x9')](_0x23fa('0xa'),attributes,{'tableName':_0x23fa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x67dd=['lodash','util','../../config/logger','request-promise','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold'];(function(_0x4a9e4a,_0x585df1){var _0xaa903e=function(_0x4190dd){while(--_0x4190dd){_0x4a9e4a['push'](_0x4a9e4a['shift']());}};_0xaa903e(++_0x585df1);}(_0x67dd,0xbb));var _0xd67d=function(_0x369e3e,_0x5dbe15){_0x369e3e=_0x369e3e-0x0;var _0xf704a7=_0x67dd[_0x369e3e];return _0xf704a7;};'use strict';var _=require(_0xd67d('0x0'));var util=require(_0xd67d('0x1'));var logger=require(_0xd67d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd67d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd67d('0x4'));var config=require(_0xd67d('0x5'));var attributes=require(_0xd67d('0x6'));module[_0xd67d('0x7')]=function(_0x1b7b09,_0x7428ac){return _0x1b7b09[_0xd67d('0x8')](_0xd67d('0x9'),attributes,{'tableName':_0xd67d('0xa'),'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 120d42d..6b3753e 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 _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(_0x5f36be,_0x269cd9){var _0x2bcfb5=function(_0xc7ba7a){while(--_0xc7ba7a){_0x5f36be['push'](_0x5f36be['shift']());}};_0x2bcfb5(++_0x269cd9);}(_0xe706,0xa3));var _0x6e70=function(_0x680b65,_0x5b2e9c){_0x680b65=_0x680b65-0x0;var _0x1c2053=_0xe706[_0x680b65];return _0x1c2053;};'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 +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(_0x5b9277,_0x3e4116){var _0x55f70f=function(_0x557603){while(--_0x557603){_0x5b9277['push'](_0x5b9277['shift']());}};_0x55f70f(++_0x3e4116);}(_0xe706,0xa3));var _0x6e70=function(_0x1cea7b,_0x37f5f4){_0x1cea7b=_0x1cea7b-0x0;var _0x5618d1=_0xe706[_0x1cea7b];return _0x5618d1;};'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 2549d7e..33ff7e5 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 _0xd8ee=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','index','/describe','isAuthenticated','describe','/:id','getAgents','/:id/teams','post','addAgents','addTeams','put','update','delete','removeAgents','removeTeams','multer','path'];(function(_0x4bb93b,_0x4a2487){var _0x2d7a4f=function(_0x3abc9a){while(--_0x3abc9a){_0x4bb93b['push'](_0x4bb93b['shift']());}};_0x2d7a4f(++_0x4a2487);}(_0xd8ee,0x1f2));var _0xed8e=function(_0x4acf20,_0x3f4636){_0x4acf20=_0x4acf20-0x0;var _0x50eabc=_0xd8ee[_0x4acf20];return _0x50eabc;};'use strict';var multer=require(_0xed8e('0x0'));var util=require('util');var path=require(_0xed8e('0x1'));var timeout=require(_0xed8e('0x2'));var express=require(_0xed8e('0x3'));var router=express['Router']();var fs_extra=require(_0xed8e('0x4'));var auth=require(_0xed8e('0x5'));var interaction=require(_0xed8e('0x6'));var config=require(_0xed8e('0x7'));var controller=require(_0xed8e('0x8'));router[_0xed8e('0x9')]('/',auth['isAuthenticated'](),controller[_0xed8e('0xa')]);router[_0xed8e('0x9')](_0xed8e('0xb'),auth[_0xed8e('0xc')](),controller[_0xed8e('0xd')]);router[_0xed8e('0x9')](_0xed8e('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xed8e('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xed8e('0xf')]);router['get'](_0xed8e('0x10'),auth[_0xed8e('0xc')](),controller['getTeams']);router[_0xed8e('0x11')]('/',auth[_0xed8e('0xc')](),controller['create']);router[_0xed8e('0x11')]('/:id/users',auth[_0xed8e('0xc')](),controller[_0xed8e('0x12')]);router[_0xed8e('0x11')](_0xed8e('0x10'),auth[_0xed8e('0xc')](),controller[_0xed8e('0x13')]);router[_0xed8e('0x14')](_0xed8e('0xe'),auth[_0xed8e('0xc')](),controller[_0xed8e('0x15')]);router[_0xed8e('0x16')](_0xed8e('0xe'),auth[_0xed8e('0xc')](),controller['destroy']);router[_0xed8e('0x16')]('/:id/users',auth[_0xed8e('0xc')](),controller[_0xed8e('0x17')]);router['delete'](_0xed8e('0x10'),auth[_0xed8e('0xc')](),controller[_0xed8e('0x18')]);module['exports']=router; \ No newline at end of file +var _0x9335=['post','create','addAgents','addTeams','update','destroy','removeAgents','delete','removeTeams','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','/:id','show','/:id/users','getAgents','/:id/teams','getTeams'];(function(_0x54088a,_0x141f6d){var _0x49f36c=function(_0x4c969c){while(--_0x4c969c){_0x54088a['push'](_0x54088a['shift']());}};_0x49f36c(++_0x141f6d);}(_0x9335,0xab));var _0x5933=function(_0x317fe2,_0x3fc17d){_0x317fe2=_0x317fe2-0x0;var _0x5d6df8=_0x9335[_0x317fe2];return _0x5d6df8;};'use strict';var multer=require(_0x5933('0x0'));var util=require(_0x5933('0x1'));var path=require('path');var timeout=require(_0x5933('0x2'));var express=require(_0x5933('0x3'));var router=express[_0x5933('0x4')]();var fs_extra=require(_0x5933('0x5'));var auth=require(_0x5933('0x6'));var interaction=require(_0x5933('0x7'));var config=require(_0x5933('0x8'));var controller=require('./voicePrefix.controller');router[_0x5933('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5933('0x9')](_0x5933('0xa'),auth[_0x5933('0xb')](),controller['describe']);router[_0x5933('0x9')](_0x5933('0xc'),auth[_0x5933('0xb')](),controller[_0x5933('0xd')]);router[_0x5933('0x9')](_0x5933('0xe'),auth[_0x5933('0xb')](),controller[_0x5933('0xf')]);router[_0x5933('0x9')](_0x5933('0x10'),auth[_0x5933('0xb')](),controller[_0x5933('0x11')]);router[_0x5933('0x12')]('/',auth['isAuthenticated'](),controller[_0x5933('0x13')]);router['post'](_0x5933('0xe'),auth[_0x5933('0xb')](),controller[_0x5933('0x14')]);router['post'](_0x5933('0x10'),auth['isAuthenticated'](),controller[_0x5933('0x15')]);router['put'](_0x5933('0xc'),auth['isAuthenticated'](),controller[_0x5933('0x16')]);router['delete'](_0x5933('0xc'),auth[_0x5933('0xb')](),controller[_0x5933('0x17')]);router['delete']('/:id/users',auth[_0x5933('0xb')](),controller[_0x5933('0x18')]);router[_0x5933('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0x5933('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index d6490eb..1409fa5 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 _0xc45e=['exports','STRING','name','VIRTUAL','system-','getDataValue','INTEGER','sequelize'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xc45e,0xd7));var _0xec45=function(_0x459e81,_0x52aeb0){_0x459e81=_0x459e81-0x0;var _0x4fac6a=_0xc45e[_0x459e81];return _0x4fac6a;};'use strict';var Sequelize=require(_0xec45('0x0'));module[_0xec45('0x1')]={'name':{'type':Sequelize[_0xec45('0x2')],'allowNull':![],'unique':_0xec45('0x3')},'prefix':{'type':Sequelize[_0xec45('0x4')],'get':function(_0x1a8362){return _0xec45('0x5')+this[_0xec45('0x6')]('name')+'-';}},'description':{'type':Sequelize[_0xec45('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0xec45('0x7')]}}; \ No newline at end of file +var _0xeb44=['INTEGER','exports','STRING','name','VIRTUAL','getDataValue'];(function(_0x31991b,_0xaf75d2){var _0x307304=function(_0x2f36c5){while(--_0x2f36c5){_0x31991b['push'](_0x31991b['shift']());}};_0x307304(++_0xaf75d2);}(_0xeb44,0x19f));var _0x4eb4=function(_0x204198,_0x8139d0){_0x204198=_0x204198-0x0;var _0x281e02=_0xeb44[_0x204198];return _0x281e02;};'use strict';var Sequelize=require('sequelize');module[_0x4eb4('0x0')]={'name':{'type':Sequelize[_0x4eb4('0x1')],'allowNull':![],'unique':_0x4eb4('0x2')},'prefix':{'type':Sequelize[_0x4eb4('0x3')],'get':function(_0x444d96){return'system-'+this[_0x4eb4('0x4')](_0x4eb4('0x2'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x4eb4('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x4eb4('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 7179848..94a3b38 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 _0xed3c=['apply','save','then','destroy','get','error','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','keys','find','params','describe','create','sequelize','transaction','body','VoiceExtensionId','role','user','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','UserProfileResource','from-sip','app','system','description','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','${EXTEN:','charAt','update','system-','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','getAgents','getTeams','addTeams','findAll','Agents','interface','flatMap','each','upsert','UserVoicePrefix','forEach','Team','select','field','tq.TeamId','from','join','user_has_teams','VoicePrefixId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','union','compact','value','removeTeams','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x5deeab,_0x20e9aa){var _0x40f3ac=function(_0x4837fa){while(--_0x4837fa){_0x5deeab['push'](_0x5deeab['shift']());}};_0x40f3ac(++_0x20e9aa);}(_0xed3c,0x1a6));var _0xced3=function(_0x1a6399,_0x437d38){_0x1a6399=_0x1a6399-0x0;var _0x3a42d1=_0xed3c[_0x1a6399];return _0x3a42d1;};'use strict';var emlformat=require(_0xced3('0x0'));var rimraf=require(_0xced3('0x1'));var zipdir=require(_0xced3('0x2'));var jsonpatch=require(_0xced3('0x3'));var rp=require('request-promise');var moment=require(_0xced3('0x4'));var BPromise=require(_0xced3('0x5'));var Mustache=require(_0xced3('0x6'));var util=require('util');var path=require('path');var sox=require(_0xced3('0x7'));var csv=require(_0xced3('0x8'));var ejs=require(_0xced3('0x9'));var fs=require('fs');var fs_extra=require(_0xced3('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xced3('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xced3('0xc'));var Redis=require(_0xced3('0xd'));var authService=require(_0xced3('0xe'));var qs=require(_0xced3('0xf'));var as=require(_0xced3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xced3('0x11'))(_0xced3('0x12'));var utils=require(_0xced3('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xced3('0x14'));var db=require(_0xced3('0x15'))['db'];config[_0xced3('0x16')]=_[_0xced3('0x17')](config[_0xced3('0x16')],{'host':_0xced3('0x18'),'port':0x18eb});var socket=require(_0xced3('0x19'))(new Redis(config['redis']));require(_0xced3('0x1a'))['register'](socket);function respondWithStatusCode(_0xf2db6f,_0x435616){_0x435616=_0x435616||0xcc;return function(_0x20d099){if(_0x20d099){return _0xf2db6f[_0xced3('0x1b')](_0x435616);}return _0xf2db6f['status'](_0x435616)[_0xced3('0x1c')]();};}function respondWithResult(_0x322c2d,_0x4acae6){_0x4acae6=_0x4acae6||0xc8;return function(_0x3b5962){if(_0x3b5962){return _0x322c2d[_0xced3('0x1d')](_0x4acae6)[_0xced3('0x1e')](_0x3b5962);}};}function respondWithFilteredResult(_0x17f611,_0x55dbd5){return function(_0x4569af){if(_0x4569af){var _0x4a3afe=typeof _0x55dbd5[_0xced3('0x1f')]===_0xced3('0x20')&&typeof _0x55dbd5[_0xced3('0x21')]===_0xced3('0x20');var _0x44143f=_0x4569af[_0xced3('0x22')];var _0xe0cf2e=_0x4a3afe?0x0:_0x55dbd5[_0xced3('0x1f')];var _0x3f688c=_0x4a3afe?_0x4569af[_0xced3('0x22')]:_0x55dbd5[_0xced3('0x1f')]+_0x55dbd5['limit'];var _0x5b8b1f;if(_0x3f688c>=_0x44143f){_0x3f688c=_0x44143f;_0x5b8b1f=0xc8;}else{_0x5b8b1f=0xce;}_0x17f611['status'](_0x5b8b1f);return _0x17f611[_0xced3('0x23')](_0xced3('0x24'),_0xe0cf2e+'-'+_0x3f688c+'/'+_0x44143f)[_0xced3('0x1e')](_0x4569af);}return null;};}function patchUpdates(_0x4bf915){return function(_0x19d15c){try{jsonpatch[_0xced3('0x25')](_0x19d15c,_0x4bf915,!![]);}catch(_0x526854){return BPromise['reject'](_0x526854);}return _0x19d15c[_0xced3('0x26')]();};}function saveUpdates(_0x101708,_0x219fa8){return function(_0x15c6c5){if(_0x15c6c5){return _0x15c6c5['update'](_0x101708)[_0xced3('0x27')](function(_0x23f92b){return _0x23f92b;});}return null;};}function removeEntity(_0x4fc285,_0x3fb4f9){return function(_0x4da7ce){if(_0x4da7ce){return _0x4da7ce[_0xced3('0x28')]()[_0xced3('0x27')](function(){var _0x3b728d=_0x4da7ce[_0xced3('0x29')]({'plain':!![]});var _0x2ec2c4='VoicePrefixes';return db['UserProfileResource'][_0xced3('0x28')]({'where':{'type':_0x2ec2c4,'resourceId':_0x3b728d['id']}})['then'](function(){return _0x4da7ce;});})[_0xced3('0x27')](function(){_0x4fc285[_0xced3('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3db664,_0x4024fa){return function(_0x196956){if(!_0x196956){_0x3db664[_0xced3('0x1b')](0x194);}return _0x196956;};}function handleError(_0x4389f8,_0x38f594){_0x38f594=_0x38f594||0x1f4;return function(_0x895a32){logger[_0xced3('0x2a')](_0x895a32[_0xced3('0x2b')]);if(_0x895a32['name']){delete _0x895a32[_0xced3('0x2c')];}_0x4389f8[_0xced3('0x1d')](_0x38f594)[_0xced3('0x2d')](_0x895a32);};}exports[_0xced3('0x2e')]=function(_0x111769,_0x21e4a2){var _0x41ce44={},_0x4f2439={},_0xc8e557={'count':0x0,'rows':[]};var _0x30cd7f=_[_0xced3('0x2f')](db[_0xced3('0x30')][_0xced3('0x31')],function(_0x407a24){return{'name':_0x407a24[_0xced3('0x32')],'type':_0x407a24[_0xced3('0x33')][_0xced3('0x34')]};});_0x4f2439[_0xced3('0x35')]=_[_0xced3('0x2f')](_0x30cd7f,_0xced3('0x2c'));_0x4f2439[_0xced3('0x36')]=_['keys'](_0x111769[_0xced3('0x36')]);_0x4f2439['filters']=_[_0xced3('0x37')](_0x4f2439[_0xced3('0x35')],_0x4f2439[_0xced3('0x36')]);_0x41ce44[_0xced3('0x38')]=_[_0xced3('0x37')](_0x4f2439[_0xced3('0x35')],qs[_0xced3('0x39')](_0x111769[_0xced3('0x36')][_0xced3('0x39')]));_0x41ce44[_0xced3('0x38')]=_0x41ce44['attributes'][_0xced3('0x3a')]?_0x41ce44[_0xced3('0x38')]:_0x4f2439['model'];if(!_0x111769[_0xced3('0x36')][_0xced3('0x3b')](_0xced3('0x3c'))){_0x41ce44['limit']=qs['limit'](_0x111769[_0xced3('0x36')]['limit']);_0x41ce44[_0xced3('0x1f')]=qs[_0xced3('0x1f')](_0x111769['query'][_0xced3('0x1f')]);}_0x41ce44[_0xced3('0x3d')]=qs[_0xced3('0x3e')](_0x111769['query'][_0xced3('0x3e')]);_0x41ce44['where']=qs['filters'](_[_0xced3('0x3f')](_0x111769[_0xced3('0x36')],_0x4f2439[_0xced3('0x40')]),_0x30cd7f);if(_0x111769['query'][_0xced3('0x41')]){_0x41ce44[_0xced3('0x42')]=_[_0xced3('0x43')](_0x41ce44[_0xced3('0x42')],{'$or':_[_0xced3('0x2f')](_0x30cd7f,function(_0x2a8e0e){if(_0x2a8e0e[_0xced3('0x33')]!==_0xced3('0x44')){var _0x9c8a07={};_0x9c8a07[_0x2a8e0e[_0xced3('0x2c')]]={'$like':'%'+_0x111769[_0xced3('0x36')][_0xced3('0x41')]+'%'};return _0x9c8a07;}})});}_0x41ce44=_[_0xced3('0x43')]({},_0x41ce44,_0x111769[_0xced3('0x45')]);var _0x1ced3a={'where':_0x41ce44['where']};return db[_0xced3('0x30')][_0xced3('0x22')](_0x1ced3a)[_0xced3('0x27')](function(_0x1a6c1f){_0xc8e557[_0xced3('0x22')]=_0x1a6c1f;if(_0x111769[_0xced3('0x36')][_0xced3('0x46')]){_0x41ce44[_0xced3('0x47')]=[{'all':!![]}];}return db[_0xced3('0x30')]['findAll'](_0x41ce44);})[_0xced3('0x27')](function(_0x47ab23){_0xc8e557[_0xced3('0x48')]=_0x47ab23;return _0xc8e557;})[_0xced3('0x27')](respondWithFilteredResult(_0x21e4a2,_0x41ce44))[_0xced3('0x49')](handleError(_0x21e4a2,null));};exports['show']=function(_0x11e733,_0x34f24a){var _0x3569f3={'raw':![],'where':{'id':_0x11e733['params']['id']}},_0x26b8ac={};_0x26b8ac[_0xced3('0x35')]=_[_0xced3('0x4a')](db[_0xced3('0x30')][_0xced3('0x31')]);_0x26b8ac[_0xced3('0x36')]=_['keys'](_0x11e733[_0xced3('0x36')]);_0x26b8ac[_0xced3('0x40')]=_[_0xced3('0x37')](_0x26b8ac[_0xced3('0x35')],_0x26b8ac[_0xced3('0x36')]);_0x3569f3[_0xced3('0x38')]=_[_0xced3('0x37')](_0x26b8ac['model'],qs[_0xced3('0x39')](_0x11e733[_0xced3('0x36')]['fields']));_0x3569f3['attributes']=_0x3569f3[_0xced3('0x38')]['length']?_0x3569f3[_0xced3('0x38')]:_0x26b8ac[_0xced3('0x35')];if(_0x11e733[_0xced3('0x36')][_0xced3('0x46')]){_0x3569f3[_0xced3('0x47')]=[{'all':!![]}];}_0x3569f3=_[_0xced3('0x43')]({},_0x3569f3,_0x11e733[_0xced3('0x45')]);return db[_0xced3('0x30')][_0xced3('0x4b')](_0x3569f3)['then'](handleEntityNotFound(_0x34f24a,null))[_0xced3('0x27')](respondWithResult(_0x34f24a,null))[_0xced3('0x49')](handleError(_0x34f24a,null));};exports[_0xced3('0x28')]=function(_0x469b6,_0x24ee62){return db[_0xced3('0x30')]['find']({'where':{'id':_0x469b6[_0xced3('0x4c')]['id']}})[_0xced3('0x27')](handleEntityNotFound(_0x24ee62,null))[_0xced3('0x27')](removeEntity(_0x24ee62,null))[_0xced3('0x49')](handleError(_0x24ee62,null));};exports[_0xced3('0x4d')]=function(_0x14dbfe,_0x1543b0){return db[_0xced3('0x30')][_0xced3('0x4d')]()[_0xced3('0x27')](respondWithResult(_0x1543b0,null))[_0xced3('0x49')](handleError(_0x1543b0,null));};exports[_0xced3('0x4e')]=function(_0x4a9111,_0x1c69df){var _0x4bd3cb;return db[_0xced3('0x4f')][_0xced3('0x50')](function(_0xc93e05){return db['VoicePrefix']['create'](_0x4a9111[_0xced3('0x51')],{'transaction':_0xc93e05})[_0xced3('0x27')](function(_0x53724a){_0x4bd3cb=_0x53724a[_0xced3('0x29')]({'plain':!![]});return db['VoiceExtension'][_0xced3('0x4b')]({'where':{'id':_0x4bd3cb[_0xced3('0x52')]},'raw':!![]})['then'](function(_0x1627f9){return createVoicePrefixExtensions(_0x4bd3cb,_0x1627f9,_0xc93e05);});});})[_0xced3('0x27')](function(){var _0xf4d7bf=_0x4a9111['user'][_0xced3('0x29')]({'plain':!![]});if(!_0xf4d7bf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf4d7bf[_0xced3('0x53')]===_0xced3('0x54')){var _0x4694b8=_0x4bd3cb;return db[_0xced3('0x55')][_0xced3('0x4b')]({'where':{'name':_0xced3('0x56'),'userProfileId':_0xf4d7bf[_0xced3('0x57')]},'raw':!![]})[_0xced3('0x27')](function(_0x1b2592){if(_0x1b2592&&_0x1b2592[_0xced3('0x58')]===0x0){return db[_0xced3('0x59')]['create']({'name':_0x4694b8[_0xced3('0x2c')],'resourceId':_0x4694b8['id'],'type':_0x1b2592[_0xced3('0x2c')],'sectionId':_0x1b2592['id']},{})[_0xced3('0x27')](function(){return _0x4bd3cb;});}else{return _0x4bd3cb;}})[_0xced3('0x49')](function(_0x21a22d){logger[_0xced3('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x21a22d);throw _0x21a22d;});}return _0x4bd3cb;})[_0xced3('0x27')](respondWithResult(_0x1c69df,null))[_0xced3('0x49')](handleError(_0x1c69df,null));};function Extension(_0x21ea6a,_0x440a0f,_0x443469,_0x1537ca){this['context']=_0xced3('0x5a');this['exten']=_0x21ea6a;this[_0xced3('0x5b')]=_0x443469;this['type']=_0xced3('0x5c');this[_0xced3('0x5d')]='Voice\x20Prefix\x20Extension';this[_0xced3('0x5e')]=_0x440a0f;this[_0xced3('0x5f')]=_0x1537ca;}function createVoicePrefixExtensions(_0x76d1f6,_0x3bb7d5,_0x1ec94b){return new BPromise(function(_0x21eeec,_0x2318a0){var _0x206dd3=new Extension(formatPrefixName(_0x76d1f6[_0xced3('0x60')]),0x1,_0xced3('0x61'),_0xced3('0x62'));_0x206dd3[_0xced3('0x63')]=_0x76d1f6['id'];return db[_0xced3('0x64')]['create'](_0x206dd3,{'transaction':_0x1ec94b})[_0xced3('0x27')](function(_0xb2b5d7){var _0x2857c8=_0xb2b5d7[_0xced3('0x29')]({'plain':!![]});var _0x4f8a3f=_[_0xced3('0x2f')](addVoicePrefixExtensions(_0x76d1f6,_0x3bb7d5),function(_0x979b24){_0x979b24[_0xced3('0x52')]=_0x2857c8['id'];_0x979b24[_0xced3('0x63')]=_0x76d1f6['id'];return _0x979b24;});return db[_0xced3('0x64')][_0xced3('0x65')](_0x4f8a3f,{'transaction':_0x1ec94b})[_0xced3('0x27')](function(_0x4df923){if(!_0x4df923){return _0x2318a0(_0xced3('0x66'));}else{return _0x21eeec(_0x4df923);}})[_0xced3('0x49')](function(_0x5db4eb){return _0x2318a0(_0x5db4eb);});});;});};function addVoicePrefixExtensions(_0x1630d7,_0xde15b5){var _0x3a9dac=[];var _0x2ac060=formatPrefixName(_0x1630d7['prefix']);_0x3a9dac[_0xced3('0x67')](new Extension(_0x2ac060,0x2,_0xced3('0x68'),_0xced3('0x69')+_0x1630d7[_0xced3('0x2c')]));if(_0x1630d7[_0xced3('0x6a')]){_0x3a9dac[_0xced3('0x67')](new Extension(_0x2ac060,0x3,_0xced3('0x68'),_0xced3('0x6b')+_0x1630d7[_0xced3('0x6a')]));}else{_0x3a9dac[_0xced3('0x67')](new Extension(_0x2ac060,0x3,'NoOp',_0xced3('0x6c')));}_0x3a9dac[_0xced3('0x67')](new Extension(_0x2ac060,0x4,'goto',_0xde15b5['context']+','+_0xced3('0x6d')+(0x8+_0x1630d7['name'][_0xced3('0x3a')])+'}'+','+0x1));return _0x3a9dac;}function formatPrefixName(_0x256216){var _0x5e3d3d='_';for(var _0x2936b5=0x0;_0x2936b5<_0x256216[_0xced3('0x3a')];_0x2936b5++){if(_0x256216['charAt'](_0x2936b5)=='-'){_0x5e3d3d+=_0x256216[_0xced3('0x6e')](_0x2936b5);}else{_0x5e3d3d+='['+_0x256216['charAt'](_0x2936b5)+']';}}_0x5e3d3d+='.';return _0x5e3d3d;}exports[_0xced3('0x6f')]=function(_0x58b66b,_0xf8ccc6,_0x3c9de8){var _0x11f393=_0x58b66b['body'];_0x11f393[_0xced3('0x60')]=_0xced3('0x70')+_0x11f393[_0xced3('0x2c')]+'-';return db['sequelize'][_0xced3('0x50')](function(_0x1abe1a){return db[_0xced3('0x30')][_0xced3('0x6f')](_0x11f393,{'where':{'id':_0x11f393['id']},'transaction':_0x1abe1a})['then'](function(){return db['VoiceExtension'][_0xced3('0x28')]({'where':{'VoicePrefixId':_0x11f393['id']},'transaction':_0x1abe1a})[_0xced3('0x27')](function(){return db[_0xced3('0x64')][_0xced3('0x4b')]({'where':{'id':_0x11f393[_0xced3('0x52')]},'raw':!![]})[_0xced3('0x27')](function(_0x55da18){return createVoicePrefixExtensions(_0x11f393,_0x55da18,_0x1abe1a);});});});})[_0xced3('0x27')](function(){return db['VoicePrefix'][_0xced3('0x71')](_0x11f393['id']);})[_0xced3('0x27')](respondWithResult(_0xf8ccc6,null))[_0xced3('0x49')](handleError(_0xf8ccc6,null));};exports[_0xced3('0x72')]=function(_0x569055,_0x24d0ad,_0x22e74d){return db['VoicePrefix']['find']({'where':{'id':_0x569055[_0xced3('0x4c')]['id']}})[_0xced3('0x27')](handleEntityNotFound(_0x24d0ad,null))[_0xced3('0x27')](function(_0x138e25){if(_0x138e25){return _0x138e25[_0xced3('0x72')](_0x569055['body'][_0xced3('0x73')],_[_0xced3('0x74')](_0x569055[_0xced3('0x51')],[_0xced3('0x73'),'id'])||{})['spread'](function(_0x13020d){for(var _0x1777eb=0x0;_0x1777eb<_0x569055[_0xced3('0x51')][_0xced3('0x73')][_0xced3('0x3a')];_0x1777eb+=0x1){socket[_0xced3('0x75')](_0xced3('0x76'),{'UserId':Number(_0x569055[_0xced3('0x51')][_0xced3('0x73')][_0x1777eb]),'VoicePrefixId':Number(_0x569055[_0xced3('0x4c')]['id'])});}return _0x13020d;});}})['then'](respondWithResult(_0x24d0ad,null))[_0xced3('0x49')](handleError(_0x24d0ad,null));};exports[_0xced3('0x77')]=function(_0x498ea9,_0x284cf2,_0xeef6f4){return db[_0xced3('0x30')][_0xced3('0x4b')]({'where':{'id':_0x498ea9[_0xced3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x284cf2,null))[_0xced3('0x27')](function(_0x3e561e){if(_0x3e561e){return _0x3e561e['removeAgents'](_0x498ea9[_0xced3('0x36')][_0xced3('0x73')])[_0xced3('0x27')](function(){if(_[_0xced3('0x78')](_0x498ea9[_0xced3('0x36')][_0xced3('0x73')])){for(var _0x5c68e1=0x0;_0x5c68e1<_0x498ea9[_0xced3('0x36')][_0xced3('0x73')][_0xced3('0x3a')];_0x5c68e1+=0x1){socket[_0xced3('0x75')](_0xced3('0x79'),{'UserId':Number(_0x498ea9[_0xced3('0x36')]['ids'][_0x5c68e1]),'VoicePrefixId':Number(_0x498ea9['params']['id'])});}}else{socket[_0xced3('0x75')](_0xced3('0x79'),{'UserId':Number(_0x498ea9[_0xced3('0x36')][_0xced3('0x73')]),'VoicePrefixId':Number(_0x498ea9[_0xced3('0x4c')]['id'])});}});}})[_0xced3('0x27')](respondWithStatusCode(_0x284cf2,null))[_0xced3('0x49')](handleError(_0x284cf2,null));};exports['getAgents']=function(_0x3d64ec,_0x290ca3,_0x51979a){var _0x5de22d={};var _0x12de12={};var _0x29f8b5;var _0x3b07ac;return db[_0xced3('0x30')][_0xced3('0x7a')]({'where':{'id':_0x3d64ec['params']['id']}})[_0xced3('0x27')](handleEntityNotFound(_0x290ca3,null))['then'](function(_0x34edbf){if(_0x34edbf){_0x29f8b5=_0x34edbf;_0x12de12[_0xced3('0x35')]=_[_0xced3('0x4a')](db[_0xced3('0x7b')][_0xced3('0x31')]);_0x12de12['query']=_[_0xced3('0x4a')](_0x3d64ec[_0xced3('0x36')]);_0x12de12[_0xced3('0x40')]=_[_0xced3('0x37')](_0x12de12['model'],_0x12de12['query']);_0x5de22d[_0xced3('0x38')]=_[_0xced3('0x37')](_0x12de12[_0xced3('0x35')],qs[_0xced3('0x39')](_0x3d64ec[_0xced3('0x36')][_0xced3('0x39')]));_0x5de22d[_0xced3('0x38')]=_0x5de22d[_0xced3('0x38')]['length']?_0x5de22d['attributes']:_0x12de12[_0xced3('0x35')];_0x5de22d[_0xced3('0x3d')]=qs[_0xced3('0x3e')](_0x3d64ec[_0xced3('0x36')][_0xced3('0x3e')]);_0x5de22d[_0xced3('0x42')]=qs[_0xced3('0x40')](_[_0xced3('0x3f')](_0x3d64ec[_0xced3('0x36')],_0x12de12[_0xced3('0x40')]));if(_0x3d64ec[_0xced3('0x36')]['filter']){_0x5de22d[_0xced3('0x42')]=_['merge'](_0x5de22d[_0xced3('0x42')],{'$or':_[_0xced3('0x2f')](_0x5de22d[_0xced3('0x38')],function(_0x3ad616){var _0x1df2d1={};_0x1df2d1[_0x3ad616]={'$like':'%'+_0x3d64ec[_0xced3('0x36')][_0xced3('0x41')]+'%'};return _0x1df2d1;})});}_0x5de22d=_[_0xced3('0x43')]({},_0x5de22d,_0x3d64ec[_0xced3('0x45')]);return _0x29f8b5[_0xced3('0x7c')](_0x5de22d);}})[_0xced3('0x27')](function(_0x3869f3){if(_0x3869f3){_0x3b07ac=_0x3869f3[_0xced3('0x3a')];if(!_0x3d64ec[_0xced3('0x36')][_0xced3('0x3b')](_0xced3('0x3c'))){_0x5de22d[_0xced3('0x21')]=qs['limit'](_0x3d64ec['query']['limit']);_0x5de22d[_0xced3('0x1f')]=qs[_0xced3('0x1f')](_0x3d64ec[_0xced3('0x36')][_0xced3('0x1f')]);}return _0x29f8b5[_0xced3('0x7c')](_0x5de22d);}})[_0xced3('0x27')](function(_0x587891){if(_0x587891){return _0x587891?{'count':_0x3b07ac,'rows':_0x587891}:null;}})[_0xced3('0x27')](respondWithResult(_0x290ca3,null))[_0xced3('0x49')](handleError(_0x290ca3,null));};exports['getTeams']=function(_0x5e6a80,_0x451c1a,_0x3284da){var _0x34ebbd={};var _0x4412cc={};var _0x3e5f7f;var _0x3b3a5c;return db['VoicePrefix'][_0xced3('0x7a')]({'where':{'id':_0x5e6a80['params']['id']}})[_0xced3('0x27')](handleEntityNotFound(_0x451c1a,null))[_0xced3('0x27')](function(_0x44a80b){if(_0x44a80b){_0x3e5f7f=_0x44a80b;_0x4412cc['model']=_['keys'](db['Team'][_0xced3('0x31')]);_0x4412cc[_0xced3('0x36')]=_['keys'](_0x5e6a80[_0xced3('0x36')]);_0x4412cc[_0xced3('0x40')]=_['intersection'](_0x4412cc[_0xced3('0x35')],_0x4412cc[_0xced3('0x36')]);_0x34ebbd[_0xced3('0x38')]=_[_0xced3('0x37')](_0x4412cc[_0xced3('0x35')],qs[_0xced3('0x39')](_0x5e6a80[_0xced3('0x36')][_0xced3('0x39')]));_0x34ebbd['attributes']=_0x34ebbd[_0xced3('0x38')][_0xced3('0x3a')]?_0x34ebbd[_0xced3('0x38')]:_0x4412cc[_0xced3('0x35')];_0x34ebbd[_0xced3('0x3d')]=qs[_0xced3('0x3e')](_0x5e6a80[_0xced3('0x36')][_0xced3('0x3e')]);_0x34ebbd[_0xced3('0x42')]=qs[_0xced3('0x40')](_[_0xced3('0x3f')](_0x5e6a80[_0xced3('0x36')],_0x4412cc[_0xced3('0x40')]));if(_0x5e6a80[_0xced3('0x36')][_0xced3('0x41')]){_0x34ebbd['where']=_[_0xced3('0x43')](_0x34ebbd[_0xced3('0x42')],{'$or':_[_0xced3('0x2f')](_0x34ebbd[_0xced3('0x38')],function(_0x2c59f5){var _0x5874b5={};_0x5874b5[_0x2c59f5]={'$like':'%'+_0x5e6a80['query'][_0xced3('0x41')]+'%'};return _0x5874b5;})});}_0x34ebbd=_[_0xced3('0x43')]({},_0x34ebbd,_0x5e6a80[_0xced3('0x45')]);return _0x3e5f7f[_0xced3('0x7d')](_0x34ebbd);}})[_0xced3('0x27')](function(_0x26920d){if(_0x26920d){_0x3b3a5c=_0x26920d[_0xced3('0x3a')];if(!_0x5e6a80['query']['hasOwnProperty'](_0xced3('0x3c'))){_0x34ebbd['limit']=qs[_0xced3('0x21')](_0x5e6a80[_0xced3('0x36')][_0xced3('0x21')]);_0x34ebbd[_0xced3('0x1f')]=qs[_0xced3('0x1f')](_0x5e6a80[_0xced3('0x36')][_0xced3('0x1f')]);}return _0x3e5f7f[_0xced3('0x7d')](_0x34ebbd);}})[_0xced3('0x27')](function(_0x2b688c){if(_0x2b688c){return _0x2b688c?{'count':_0x3b3a5c,'rows':_0x2b688c}:null;}})[_0xced3('0x27')](respondWithResult(_0x451c1a,null))[_0xced3('0x49')](handleError(_0x451c1a,null));};exports[_0xced3('0x7e')]=function(_0xbd91ef,_0x561aca,_0x4b2f62){var _0x361c6f=_0xbd91ef['body'][_0xced3('0x73')];var _0x4f0fcb;return db['Team'][_0xced3('0x7f')]({'where':{'id':_0x361c6f},'attributes':['id'],'include':[{'model':db[_0xced3('0x7b')],'as':_0xced3('0x80'),'attributes':['id',_0xced3('0x2c'),'online','voicePause',_0xced3('0x81')],'raw':!![]}]})[_0xced3('0x27')](function(_0x2f2f77){if(_0x2f2f77){_0x4f0fcb=_0x2f2f77;var _0x5448d5=_[_0xced3('0x82')](_0x2f2f77,function(_0x50cc83){var _0x4b6afc=_0x50cc83[_0xced3('0x29')]({'plain':!![]});return _0x4b6afc[_0xced3('0x80')];});return db[_0xced3('0x30')][_0xced3('0x4b')]({'where':{'id':_0xbd91ef[_0xced3('0x4c')]['id']}})[_0xced3('0x27')](function(_0x420c12){return db[_0xced3('0x4f')]['transaction'](function(_0x566191){return _0x420c12[_0xced3('0x7e')](_0x361c6f,{'transaction':_0x566191})['then'](function(){return BPromise[_0xced3('0x83')](_0x4f0fcb,function(_0x239dda){return db['TeamVoicePrefix'][_0xced3('0x84')]({'TeamId':_0x239dda['id'],'VoicePrefixId':_0xbd91ef[_0xced3('0x4c')]['id']},{'transaction':_0x566191});});})[_0xced3('0x27')](function(){return BPromise[_0xced3('0x83')](_0x5448d5,function(_0x7fb3c7){return db[_0xced3('0x85')]['findOrCreate']({'where':{'UserId':_0x7fb3c7['id'],'VoicePrefixId':_0xbd91ef[_0xced3('0x4c')]['id']},'transaction':_0x566191});});})[_0xced3('0x27')](function(){_0x5448d5[_0xced3('0x86')](function(_0x3d88fc){socket[_0xced3('0x75')](_0xced3('0x76'),{'UserId':_0x3d88fc['id'],'VoicePrefixId':_0x420c12['id']});});});});});}})['then'](respondWithStatusCode(_0x561aca,null))['catch'](handleError(_0x561aca,null));};exports['removeTeams']=function(_0x4074b9,_0x2e2303,_0x26af34){return db[_0xced3('0x87')][_0xced3('0x7f')]({'where':{'id':_0x4074b9['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xced3('0x7b')],'as':_0xced3('0x80'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2e2303,null))['then'](function(_0xdec3b0){var _0x38a06b=_[_0xced3('0x2f')](_0xdec3b0,'id');var _0xbeffe6=[];var _0x2211ed=[];var _0x22ab59=squel[_0xced3('0x88')]();_0x22ab59[_0xced3('0x89')](_0xced3('0x8a'))[_0xced3('0x8b')]('team_has_voice_prefixes','tq')[_0xced3('0x8c')](_0xced3('0x8d'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xced3('0x42')](_0xced3('0x8e'),_0x4074b9[_0xced3('0x4c')]['id']);for(var _0x268c72=0x0;_0x268c72<_0xdec3b0[_0xced3('0x3a')];_0x268c72+=0x1){let _0x26daab=_0xdec3b0[_0x268c72];for(var _0x1ab60d=0x0;_0x1ab60d<_0x26daab[_0xced3('0x80')]['length'];_0x1ab60d+=0x1){let _0x5dd10b=_0x26daab[_0xced3('0x80')][_0x1ab60d];var _0x173a37=_0x22ab59['clone']();_0x173a37[_0xced3('0x42')](_0xced3('0x8f'),_0x5dd10b['id']);_0x2211ed[_0xced3('0x67')](db[_0xced3('0x4f')][_0xced3('0x36')](_0x173a37[_0xced3('0x90')](),{'type':db['sequelize'][_0xced3('0x91')]['SELECT']})['then'](function(_0x2ed48f){if(_0x2ed48f[_0xced3('0x3a')]===0x1){return _0x5dd10b['id'];}else{var _0x21f013=_[_0xced3('0x92')](_['map'](_0x2ed48f,_0xced3('0x93')),function(_0x1082c0){return _['includes'](_0x38a06b,_0x1082c0);});if(_0x21f013){return _0x5dd10b['id'];}}}));}}return BPromise['all'](_0x2211ed)['then'](function(_0x3e8ed7){_0xbeffe6=_(_0xbeffe6)[_0xced3('0x94')](_0x3e8ed7)[_0xced3('0x95')]()[_0xced3('0x96')]();return db[_0xced3('0x30')][_0xced3('0x4b')]({'where':{'id':_0x4074b9[_0xced3('0x4c')]['id']}})[_0xced3('0x27')](function(_0x235faa){return db[_0xced3('0x4f')]['transaction'](function(_0x5e9fba){return _0x235faa[_0xced3('0x97')](_0x4074b9[_0xced3('0x36')]['ids'],{'transaction':_0x5e9fba})['then'](function(){if(!_[_0xced3('0x98')](_0xbeffe6)){return _0x235faa[_0xced3('0x77')](_0xbeffe6,{'transaction':_0x5e9fba});}})[_0xced3('0x27')](function(){_0xbeffe6['forEach'](function(_0x473c70){socket['emit'](_0xced3('0x79'),{'UserId':_0x473c70,'VoicePrefixId':_0x235faa['id']});});});});});});})['then'](respondWithStatusCode(_0x2e2303,null))[_0xced3('0x49')](handleError(_0x2e2303,null));}; \ No newline at end of file +var _0x5c3c=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','UserProfileResource','error','name','send','index','map','VoicePrefix','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','include','options','find','create','sequelize','transaction','get','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','VoicePrefixes','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','body','system-','VoiceExtensionId','findById','addAgents','ids','omit','removeAgents','isArray','userVoicePrefix:remove','emit','getAgents','findOne','User','pick','getTeams','addTeams','Team','findAll','voicePause','interface','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','removeTeams','select','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','Agents','clone','ut.UserId\x20=\x20?','toString','QueryTypes','TeamId','union','compact','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x24c086,_0x58503a){var _0x437816=function(_0x5ca169){while(--_0x5ca169){_0x24c086['push'](_0x24c086['shift']());}};_0x437816(++_0x58503a);}(_0x5c3c,0x132));var _0xc5c3=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x5c3c[_0x1c8c28];return _0x1f59b4;};'use strict';var emlformat=require(_0xc5c3('0x0'));var rimraf=require(_0xc5c3('0x1'));var zipdir=require(_0xc5c3('0x2'));var jsonpatch=require(_0xc5c3('0x3'));var rp=require('request-promise');var moment=require(_0xc5c3('0x4'));var BPromise=require(_0xc5c3('0x5'));var Mustache=require(_0xc5c3('0x6'));var util=require(_0xc5c3('0x7'));var path=require(_0xc5c3('0x8'));var sox=require(_0xc5c3('0x9'));var csv=require(_0xc5c3('0xa'));var ejs=require(_0xc5c3('0xb'));var fs=require('fs');var fs_extra=require(_0xc5c3('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc5c3('0xd'));var deskjs=require(_0xc5c3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc5c3('0xf'));var Papa=require(_0xc5c3('0x10'));var Redis=require('ioredis');var authService=require(_0xc5c3('0x11'));var qs=require(_0xc5c3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5c3('0x13'));var logger=require(_0xc5c3('0x14'))(_0xc5c3('0x15'));var utils=require('../../config/utils');var config=require(_0xc5c3('0x16'));var licenseUtil=require(_0xc5c3('0x17'));var db=require('../../mysqldb')['db'];config[_0xc5c3('0x18')]=_[_0xc5c3('0x19')](config[_0xc5c3('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xc5c3('0x1a'))(new Redis(config[_0xc5c3('0x18')]));require(_0xc5c3('0x1b'))[_0xc5c3('0x1c')](socket);function respondWithStatusCode(_0xc8a636,_0x5f34bb){_0x5f34bb=_0x5f34bb||0xcc;return function(_0x5c0341){if(_0x5c0341){return _0xc8a636[_0xc5c3('0x1d')](_0x5f34bb);}return _0xc8a636[_0xc5c3('0x1e')](_0x5f34bb)[_0xc5c3('0x1f')]();};}function respondWithResult(_0xef8b21,_0x5ecd4b){_0x5ecd4b=_0x5ecd4b||0xc8;return function(_0x4ff2de){if(_0x4ff2de){return _0xef8b21[_0xc5c3('0x1e')](_0x5ecd4b)['json'](_0x4ff2de);}};}function respondWithFilteredResult(_0xa9bc84,_0x17ec62){return function(_0x2ff158){if(_0x2ff158){var _0x13c867=typeof _0x17ec62[_0xc5c3('0x20')]==='undefined'&&typeof _0x17ec62[_0xc5c3('0x21')]===_0xc5c3('0x22');var _0x123dba=_0x2ff158[_0xc5c3('0x23')];var _0x4e570f=_0x13c867?0x0:_0x17ec62[_0xc5c3('0x20')];var _0x41578a=_0x13c867?_0x2ff158[_0xc5c3('0x23')]:_0x17ec62[_0xc5c3('0x20')]+_0x17ec62[_0xc5c3('0x21')];var _0x564815;if(_0x41578a>=_0x123dba){_0x41578a=_0x123dba;_0x564815=0xc8;}else{_0x564815=0xce;}_0xa9bc84[_0xc5c3('0x1e')](_0x564815);return _0xa9bc84[_0xc5c3('0x24')](_0xc5c3('0x25'),_0x4e570f+'-'+_0x41578a+'/'+_0x123dba)[_0xc5c3('0x26')](_0x2ff158);}return null;};}function patchUpdates(_0x1c5793){return function(_0x67445){try{jsonpatch[_0xc5c3('0x27')](_0x67445,_0x1c5793,!![]);}catch(_0x5996a0){return BPromise['reject'](_0x5996a0);}return _0x67445[_0xc5c3('0x28')]();};}function saveUpdates(_0x38dd9e,_0x53ab72){return function(_0x5c7329){if(_0x5c7329){return _0x5c7329[_0xc5c3('0x29')](_0x38dd9e)[_0xc5c3('0x2a')](function(_0x38a3df){return _0x38a3df;});}return null;};}function removeEntity(_0x52e54a,_0x4af067){return function(_0x2df06b){if(_0x2df06b){return _0x2df06b[_0xc5c3('0x2b')]()[_0xc5c3('0x2a')](function(){var _0x29791c=_0x2df06b['get']({'plain':!![]});var _0x21efd6='VoicePrefixes';return db[_0xc5c3('0x2c')]['destroy']({'where':{'type':_0x21efd6,'resourceId':_0x29791c['id']}})[_0xc5c3('0x2a')](function(){return _0x2df06b;});})[_0xc5c3('0x2a')](function(){_0x52e54a[_0xc5c3('0x1e')](0xcc)[_0xc5c3('0x1f')]();});}};}function handleEntityNotFound(_0x15361c,_0x2d07e1){return function(_0x35a397){if(!_0x35a397){_0x15361c['sendStatus'](0x194);}return _0x35a397;};}function handleError(_0xbcafd6,_0x4a3300){_0x4a3300=_0x4a3300||0x1f4;return function(_0xc4b134){logger[_0xc5c3('0x2d')](_0xc4b134['stack']);if(_0xc4b134['name']){delete _0xc4b134[_0xc5c3('0x2e')];}_0xbcafd6[_0xc5c3('0x1e')](_0x4a3300)[_0xc5c3('0x2f')](_0xc4b134);};}exports[_0xc5c3('0x30')]=function(_0x52adcf,_0x3f9591){var _0x24aa70={},_0x3ebcbc={},_0x303eab={'count':0x0,'rows':[]};var _0x1b4538=_[_0xc5c3('0x31')](db[_0xc5c3('0x32')][_0xc5c3('0x33')],function(_0x1d1e6d){return{'name':_0x1d1e6d['fieldName'],'type':_0x1d1e6d[_0xc5c3('0x34')][_0xc5c3('0x35')]};});_0x3ebcbc[_0xc5c3('0x36')]=_[_0xc5c3('0x31')](_0x1b4538,_0xc5c3('0x2e'));_0x3ebcbc[_0xc5c3('0x37')]=_[_0xc5c3('0x38')](_0x52adcf['query']);_0x3ebcbc['filters']=_[_0xc5c3('0x39')](_0x3ebcbc['model'],_0x3ebcbc[_0xc5c3('0x37')]);_0x24aa70[_0xc5c3('0x3a')]=_[_0xc5c3('0x39')](_0x3ebcbc[_0xc5c3('0x36')],qs[_0xc5c3('0x3b')](_0x52adcf['query'][_0xc5c3('0x3b')]));_0x24aa70[_0xc5c3('0x3a')]=_0x24aa70['attributes'][_0xc5c3('0x3c')]?_0x24aa70[_0xc5c3('0x3a')]:_0x3ebcbc[_0xc5c3('0x36')];if(!_0x52adcf[_0xc5c3('0x37')][_0xc5c3('0x3d')](_0xc5c3('0x3e'))){_0x24aa70[_0xc5c3('0x21')]=qs[_0xc5c3('0x21')](_0x52adcf[_0xc5c3('0x37')][_0xc5c3('0x21')]);_0x24aa70['offset']=qs[_0xc5c3('0x20')](_0x52adcf['query']['offset']);}_0x24aa70[_0xc5c3('0x3f')]=qs[_0xc5c3('0x40')](_0x52adcf[_0xc5c3('0x37')][_0xc5c3('0x40')]);_0x24aa70[_0xc5c3('0x41')]=qs['filters'](_['pick'](_0x52adcf[_0xc5c3('0x37')],_0x3ebcbc[_0xc5c3('0x42')]),_0x1b4538);if(_0x52adcf['query'][_0xc5c3('0x43')]){_0x24aa70['where']=_[_0xc5c3('0x44')](_0x24aa70[_0xc5c3('0x41')],{'$or':_[_0xc5c3('0x31')](_0x1b4538,function(_0x59c9cb){if(_0x59c9cb[_0xc5c3('0x34')]!==_0xc5c3('0x45')){var _0x525ef8={};_0x525ef8[_0x59c9cb[_0xc5c3('0x2e')]]={'$like':'%'+_0x52adcf['query'][_0xc5c3('0x43')]+'%'};return _0x525ef8;}})});}_0x24aa70=_[_0xc5c3('0x44')]({},_0x24aa70,_0x52adcf['options']);var _0x4d2056={'where':_0x24aa70['where']};return db[_0xc5c3('0x32')][_0xc5c3('0x23')](_0x4d2056)['then'](function(_0x1a8490){_0x303eab[_0xc5c3('0x23')]=_0x1a8490;if(_0x52adcf[_0xc5c3('0x37')][_0xc5c3('0x46')]){_0x24aa70['include']=[{'all':!![]}];}return db[_0xc5c3('0x32')]['findAll'](_0x24aa70);})['then'](function(_0x1363fa){_0x303eab[_0xc5c3('0x47')]=_0x1363fa;return _0x303eab;})['then'](respondWithFilteredResult(_0x3f9591,_0x24aa70))[_0xc5c3('0x48')](handleError(_0x3f9591,null));};exports[_0xc5c3('0x49')]=function(_0x590e65,_0x333c38){var _0x4ffc5a={'raw':![],'where':{'id':_0x590e65[_0xc5c3('0x4a')]['id']}},_0x122a6d={};_0x122a6d['model']=_[_0xc5c3('0x38')](db['VoicePrefix'][_0xc5c3('0x33')]);_0x122a6d[_0xc5c3('0x37')]=_['keys'](_0x590e65[_0xc5c3('0x37')]);_0x122a6d[_0xc5c3('0x42')]=_[_0xc5c3('0x39')](_0x122a6d[_0xc5c3('0x36')],_0x122a6d[_0xc5c3('0x37')]);_0x4ffc5a[_0xc5c3('0x3a')]=_['intersection'](_0x122a6d[_0xc5c3('0x36')],qs[_0xc5c3('0x3b')](_0x590e65[_0xc5c3('0x37')][_0xc5c3('0x3b')]));_0x4ffc5a[_0xc5c3('0x3a')]=_0x4ffc5a['attributes']['length']?_0x4ffc5a[_0xc5c3('0x3a')]:_0x122a6d[_0xc5c3('0x36')];if(_0x590e65[_0xc5c3('0x37')]['includeAll']){_0x4ffc5a[_0xc5c3('0x4b')]=[{'all':!![]}];}_0x4ffc5a=_[_0xc5c3('0x44')]({},_0x4ffc5a,_0x590e65[_0xc5c3('0x4c')]);return db[_0xc5c3('0x32')][_0xc5c3('0x4d')](_0x4ffc5a)[_0xc5c3('0x2a')](handleEntityNotFound(_0x333c38,null))[_0xc5c3('0x2a')](respondWithResult(_0x333c38,null))['catch'](handleError(_0x333c38,null));};exports[_0xc5c3('0x2b')]=function(_0x3ff21e,_0x4538ab){return db['VoicePrefix'][_0xc5c3('0x4d')]({'where':{'id':_0x3ff21e[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2a')](handleEntityNotFound(_0x4538ab,null))[_0xc5c3('0x2a')](removeEntity(_0x4538ab,null))[_0xc5c3('0x48')](handleError(_0x4538ab,null));};exports['describe']=function(_0xd716e6,_0x58204c){return db[_0xc5c3('0x32')]['describe']()[_0xc5c3('0x2a')](respondWithResult(_0x58204c,null))[_0xc5c3('0x48')](handleError(_0x58204c,null));};exports[_0xc5c3('0x4e')]=function(_0x325643,_0x1311de){var _0x4be969;return db[_0xc5c3('0x4f')][_0xc5c3('0x50')](function(_0x348960){return db[_0xc5c3('0x32')][_0xc5c3('0x4e')](_0x325643['body'],{'transaction':_0x348960})[_0xc5c3('0x2a')](function(_0x34bf9c){_0x4be969=_0x34bf9c[_0xc5c3('0x51')]({'plain':!![]});return db['VoiceExtension'][_0xc5c3('0x4d')]({'where':{'id':_0x4be969['VoiceExtensionId']},'raw':!![]})['then'](function(_0x39f83a){return createVoicePrefixExtensions(_0x4be969,_0x39f83a,_0x348960);});});})[_0xc5c3('0x2a')](function(){var _0x110105=_0x325643[_0xc5c3('0x52')][_0xc5c3('0x51')]({'plain':!![]});if(!_0x110105)throw new Error(_0xc5c3('0x53'));if(_0x110105['role']===_0xc5c3('0x52')){var _0x1ad3aa=_0x4be969;return db[_0xc5c3('0x54')][_0xc5c3('0x4d')]({'where':{'name':_0xc5c3('0x55'),'userProfileId':_0x110105[_0xc5c3('0x56')]},'raw':!![]})[_0xc5c3('0x2a')](function(_0x524aff){if(_0x524aff&&_0x524aff['autoAssociation']===0x0){return db[_0xc5c3('0x2c')][_0xc5c3('0x4e')]({'name':_0x1ad3aa['name'],'resourceId':_0x1ad3aa['id'],'type':_0x524aff[_0xc5c3('0x2e')],'sectionId':_0x524aff['id']},{})[_0xc5c3('0x2a')](function(){return _0x4be969;});}else{return _0x4be969;}})[_0xc5c3('0x48')](function(_0x41bcf7){logger['error'](_0xc5c3('0x57'),_0x41bcf7);throw _0x41bcf7;});}return _0x4be969;})[_0xc5c3('0x2a')](respondWithResult(_0x1311de,null))[_0xc5c3('0x48')](handleError(_0x1311de,null));};function Extension(_0x314392,_0x1b66bf,_0x36420a,_0x90e30b){this[_0xc5c3('0x58')]=_0xc5c3('0x59');this['exten']=_0x314392;this[_0xc5c3('0x5a')]=_0x36420a;this[_0xc5c3('0x34')]=_0xc5c3('0x5b');this['description']=_0xc5c3('0x5c');this[_0xc5c3('0x5d')]=_0x1b66bf;this[_0xc5c3('0x5e')]=_0x90e30b;}function createVoicePrefixExtensions(_0x30226f,_0x32d5e2,_0x5067ed){return new BPromise(function(_0xf54924,_0xea569b){var _0xf40f27=new Extension(formatPrefixName(_0x30226f[_0xc5c3('0x5f')]),0x1,_0xc5c3('0x60'),_0xc5c3('0x61'));_0xf40f27[_0xc5c3('0x62')]=_0x30226f['id'];return db['VoiceExtension'][_0xc5c3('0x4e')](_0xf40f27,{'transaction':_0x5067ed})[_0xc5c3('0x2a')](function(_0x397fc8){var _0x13f6a1=_0x397fc8[_0xc5c3('0x51')]({'plain':!![]});var _0x3cd213=_[_0xc5c3('0x31')](addVoicePrefixExtensions(_0x30226f,_0x32d5e2),function(_0x5b9013){_0x5b9013['VoiceExtensionId']=_0x13f6a1['id'];_0x5b9013[_0xc5c3('0x62')]=_0x30226f['id'];return _0x5b9013;});return db[_0xc5c3('0x63')][_0xc5c3('0x64')](_0x3cd213,{'transaction':_0x5067ed})[_0xc5c3('0x2a')](function(_0x1ed757){if(!_0x1ed757){return _0xea569b(_0xc5c3('0x65'));}else{return _0xf54924(_0x1ed757);}})[_0xc5c3('0x48')](function(_0x2cdd7a){return _0xea569b(_0x2cdd7a);});});;});};function addVoicePrefixExtensions(_0x385b39,_0x4d3e6f){var _0x92c6cf=[];var _0x358b83=formatPrefixName(_0x385b39['prefix']);_0x92c6cf['push'](new Extension(_0x358b83,0x2,_0xc5c3('0x66'),_0xc5c3('0x67')+_0x385b39[_0xc5c3('0x2e')]));if(_0x385b39[_0xc5c3('0x68')]){_0x92c6cf[_0xc5c3('0x69')](new Extension(_0x358b83,0x3,_0xc5c3('0x66'),_0xc5c3('0x6a')+_0x385b39[_0xc5c3('0x68')]));}else{_0x92c6cf[_0xc5c3('0x69')](new Extension(_0x358b83,0x3,'NoOp',_0xc5c3('0x6b')));}_0x92c6cf[_0xc5c3('0x69')](new Extension(_0x358b83,0x4,_0xc5c3('0x6c'),_0x4d3e6f[_0xc5c3('0x58')]+','+_0xc5c3('0x6d')+(0x8+_0x385b39[_0xc5c3('0x2e')][_0xc5c3('0x3c')])+'}'+','+0x1));return _0x92c6cf;}function formatPrefixName(_0x114c90){var _0x22606a='_';for(var _0x31e280=0x0;_0x31e280<_0x114c90[_0xc5c3('0x3c')];_0x31e280++){if(_0x114c90['charAt'](_0x31e280)=='-'){_0x22606a+=_0x114c90['charAt'](_0x31e280);}else{_0x22606a+='['+_0x114c90[_0xc5c3('0x6e')](_0x31e280)+']';}}_0x22606a+='.';return _0x22606a;}exports[_0xc5c3('0x29')]=function(_0x6281e5,_0x1951a5,_0x5540c0){var _0x2da018=_0x6281e5[_0xc5c3('0x6f')];_0x2da018[_0xc5c3('0x5f')]=_0xc5c3('0x70')+_0x2da018[_0xc5c3('0x2e')]+'-';return db[_0xc5c3('0x4f')][_0xc5c3('0x50')](function(_0x4a3f71){return db[_0xc5c3('0x32')]['update'](_0x2da018,{'where':{'id':_0x2da018['id']},'transaction':_0x4a3f71})[_0xc5c3('0x2a')](function(){return db[_0xc5c3('0x63')][_0xc5c3('0x2b')]({'where':{'VoicePrefixId':_0x2da018['id']},'transaction':_0x4a3f71})[_0xc5c3('0x2a')](function(){return db[_0xc5c3('0x63')][_0xc5c3('0x4d')]({'where':{'id':_0x2da018[_0xc5c3('0x71')]},'raw':!![]})[_0xc5c3('0x2a')](function(_0x4813a0){return createVoicePrefixExtensions(_0x2da018,_0x4813a0,_0x4a3f71);});});});})[_0xc5c3('0x2a')](function(){return db[_0xc5c3('0x32')][_0xc5c3('0x72')](_0x2da018['id']);})['then'](respondWithResult(_0x1951a5,null))['catch'](handleError(_0x1951a5,null));};exports[_0xc5c3('0x73')]=function(_0x5d6b6b,_0x5bcbd3,_0x1f222f){return db[_0xc5c3('0x32')]['find']({'where':{'id':_0x5d6b6b[_0xc5c3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5bcbd3,null))['then'](function(_0x2dbe80){if(_0x2dbe80){return _0x2dbe80[_0xc5c3('0x73')](_0x5d6b6b[_0xc5c3('0x6f')][_0xc5c3('0x74')],_[_0xc5c3('0x75')](_0x5d6b6b['body'],[_0xc5c3('0x74'),'id'])||{})['spread'](function(_0x110167){for(var _0x109cfa=0x0;_0x109cfa<_0x5d6b6b[_0xc5c3('0x6f')][_0xc5c3('0x74')][_0xc5c3('0x3c')];_0x109cfa+=0x1){socket['emit']('userVoicePrefix:save',{'UserId':Number(_0x5d6b6b['body'][_0xc5c3('0x74')][_0x109cfa]),'VoicePrefixId':Number(_0x5d6b6b[_0xc5c3('0x4a')]['id'])});}return _0x110167;});}})[_0xc5c3('0x2a')](respondWithResult(_0x5bcbd3,null))['catch'](handleError(_0x5bcbd3,null));};exports[_0xc5c3('0x76')]=function(_0x41222d,_0x5dcd4d,_0x3afa94){return db['VoicePrefix'][_0xc5c3('0x4d')]({'where':{'id':_0x41222d[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2a')](handleEntityNotFound(_0x5dcd4d,null))[_0xc5c3('0x2a')](function(_0x4b0d02){if(_0x4b0d02){return _0x4b0d02[_0xc5c3('0x76')](_0x41222d[_0xc5c3('0x37')][_0xc5c3('0x74')])[_0xc5c3('0x2a')](function(){if(_[_0xc5c3('0x77')](_0x41222d[_0xc5c3('0x37')][_0xc5c3('0x74')])){for(var _0x1f36f8=0x0;_0x1f36f8<_0x41222d['query']['ids']['length'];_0x1f36f8+=0x1){socket['emit'](_0xc5c3('0x78'),{'UserId':Number(_0x41222d[_0xc5c3('0x37')][_0xc5c3('0x74')][_0x1f36f8]),'VoicePrefixId':Number(_0x41222d[_0xc5c3('0x4a')]['id'])});}}else{socket[_0xc5c3('0x79')](_0xc5c3('0x78'),{'UserId':Number(_0x41222d[_0xc5c3('0x37')][_0xc5c3('0x74')]),'VoicePrefixId':Number(_0x41222d[_0xc5c3('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x5dcd4d,null))[_0xc5c3('0x48')](handleError(_0x5dcd4d,null));};exports[_0xc5c3('0x7a')]=function(_0x3aa5e2,_0x1efa1d,_0x2fae6d){var _0x258e36={};var _0x2f1be8={};var _0x550966;var _0x5733a2;return db[_0xc5c3('0x32')][_0xc5c3('0x7b')]({'where':{'id':_0x3aa5e2[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2a')](handleEntityNotFound(_0x1efa1d,null))[_0xc5c3('0x2a')](function(_0x306d22){if(_0x306d22){_0x550966=_0x306d22;_0x2f1be8[_0xc5c3('0x36')]=_[_0xc5c3('0x38')](db[_0xc5c3('0x7c')][_0xc5c3('0x33')]);_0x2f1be8[_0xc5c3('0x37')]=_['keys'](_0x3aa5e2[_0xc5c3('0x37')]);_0x2f1be8[_0xc5c3('0x42')]=_[_0xc5c3('0x39')](_0x2f1be8[_0xc5c3('0x36')],_0x2f1be8[_0xc5c3('0x37')]);_0x258e36['attributes']=_[_0xc5c3('0x39')](_0x2f1be8[_0xc5c3('0x36')],qs[_0xc5c3('0x3b')](_0x3aa5e2[_0xc5c3('0x37')]['fields']));_0x258e36[_0xc5c3('0x3a')]=_0x258e36[_0xc5c3('0x3a')][_0xc5c3('0x3c')]?_0x258e36['attributes']:_0x2f1be8[_0xc5c3('0x36')];_0x258e36[_0xc5c3('0x3f')]=qs[_0xc5c3('0x40')](_0x3aa5e2[_0xc5c3('0x37')][_0xc5c3('0x40')]);_0x258e36[_0xc5c3('0x41')]=qs[_0xc5c3('0x42')](_[_0xc5c3('0x7d')](_0x3aa5e2[_0xc5c3('0x37')],_0x2f1be8[_0xc5c3('0x42')]));if(_0x3aa5e2[_0xc5c3('0x37')][_0xc5c3('0x43')]){_0x258e36[_0xc5c3('0x41')]=_[_0xc5c3('0x44')](_0x258e36[_0xc5c3('0x41')],{'$or':_[_0xc5c3('0x31')](_0x258e36['attributes'],function(_0x2bf9d2){var _0x8aaa64={};_0x8aaa64[_0x2bf9d2]={'$like':'%'+_0x3aa5e2['query'][_0xc5c3('0x43')]+'%'};return _0x8aaa64;})});}_0x258e36=_['merge']({},_0x258e36,_0x3aa5e2[_0xc5c3('0x4c')]);return _0x550966[_0xc5c3('0x7a')](_0x258e36);}})[_0xc5c3('0x2a')](function(_0x1800a0){if(_0x1800a0){_0x5733a2=_0x1800a0[_0xc5c3('0x3c')];if(!_0x3aa5e2['query'][_0xc5c3('0x3d')](_0xc5c3('0x3e'))){_0x258e36[_0xc5c3('0x21')]=qs['limit'](_0x3aa5e2['query'][_0xc5c3('0x21')]);_0x258e36['offset']=qs[_0xc5c3('0x20')](_0x3aa5e2[_0xc5c3('0x37')][_0xc5c3('0x20')]);}return _0x550966['getAgents'](_0x258e36);}})[_0xc5c3('0x2a')](function(_0x3325b6){if(_0x3325b6){return _0x3325b6?{'count':_0x5733a2,'rows':_0x3325b6}:null;}})[_0xc5c3('0x2a')](respondWithResult(_0x1efa1d,null))[_0xc5c3('0x48')](handleError(_0x1efa1d,null));};exports[_0xc5c3('0x7e')]=function(_0x57070d,_0x2f5315,_0x37ef35){var _0x2dcae5={};var _0x5d5248={};var _0xd3091c;var _0x26292e;return db[_0xc5c3('0x32')][_0xc5c3('0x7b')]({'where':{'id':_0x57070d[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2a')](handleEntityNotFound(_0x2f5315,null))[_0xc5c3('0x2a')](function(_0x12d800){if(_0x12d800){_0xd3091c=_0x12d800;_0x5d5248['model']=_[_0xc5c3('0x38')](db['Team'][_0xc5c3('0x33')]);_0x5d5248[_0xc5c3('0x37')]=_['keys'](_0x57070d[_0xc5c3('0x37')]);_0x5d5248[_0xc5c3('0x42')]=_['intersection'](_0x5d5248[_0xc5c3('0x36')],_0x5d5248[_0xc5c3('0x37')]);_0x2dcae5[_0xc5c3('0x3a')]=_[_0xc5c3('0x39')](_0x5d5248[_0xc5c3('0x36')],qs['fields'](_0x57070d[_0xc5c3('0x37')][_0xc5c3('0x3b')]));_0x2dcae5[_0xc5c3('0x3a')]=_0x2dcae5[_0xc5c3('0x3a')][_0xc5c3('0x3c')]?_0x2dcae5[_0xc5c3('0x3a')]:_0x5d5248['model'];_0x2dcae5[_0xc5c3('0x3f')]=qs[_0xc5c3('0x40')](_0x57070d['query']['sort']);_0x2dcae5[_0xc5c3('0x41')]=qs[_0xc5c3('0x42')](_['pick'](_0x57070d[_0xc5c3('0x37')],_0x5d5248[_0xc5c3('0x42')]));if(_0x57070d[_0xc5c3('0x37')]['filter']){_0x2dcae5[_0xc5c3('0x41')]=_[_0xc5c3('0x44')](_0x2dcae5[_0xc5c3('0x41')],{'$or':_[_0xc5c3('0x31')](_0x2dcae5[_0xc5c3('0x3a')],function(_0x86d21a){var _0x53f1d={};_0x53f1d[_0x86d21a]={'$like':'%'+_0x57070d[_0xc5c3('0x37')][_0xc5c3('0x43')]+'%'};return _0x53f1d;})});}_0x2dcae5=_[_0xc5c3('0x44')]({},_0x2dcae5,_0x57070d[_0xc5c3('0x4c')]);return _0xd3091c[_0xc5c3('0x7e')](_0x2dcae5);}})['then'](function(_0x48e3a2){if(_0x48e3a2){_0x26292e=_0x48e3a2[_0xc5c3('0x3c')];if(!_0x57070d['query']['hasOwnProperty'](_0xc5c3('0x3e'))){_0x2dcae5['limit']=qs[_0xc5c3('0x21')](_0x57070d[_0xc5c3('0x37')]['limit']);_0x2dcae5['offset']=qs[_0xc5c3('0x20')](_0x57070d['query']['offset']);}return _0xd3091c[_0xc5c3('0x7e')](_0x2dcae5);}})[_0xc5c3('0x2a')](function(_0x3ce0e9){if(_0x3ce0e9){return _0x3ce0e9?{'count':_0x26292e,'rows':_0x3ce0e9}:null;}})[_0xc5c3('0x2a')](respondWithResult(_0x2f5315,null))[_0xc5c3('0x48')](handleError(_0x2f5315,null));};exports[_0xc5c3('0x7f')]=function(_0x116965,_0xa4672a,_0x1aba09){var _0x557b8f=_0x116965['body'][_0xc5c3('0x74')];var _0x389c96;return db[_0xc5c3('0x80')][_0xc5c3('0x81')]({'where':{'id':_0x557b8f},'attributes':['id'],'include':[{'model':db[_0xc5c3('0x7c')],'as':'Agents','attributes':['id',_0xc5c3('0x2e'),'online',_0xc5c3('0x82'),_0xc5c3('0x83')],'raw':!![]}]})[_0xc5c3('0x2a')](function(_0x2c8937){if(_0x2c8937){_0x389c96=_0x2c8937;var _0x9e9372=_[_0xc5c3('0x84')](_0x2c8937,function(_0x1dcde5){var _0x2c8fdb=_0x1dcde5['get']({'plain':!![]});return _0x2c8fdb['Agents'];});return db['VoicePrefix'][_0xc5c3('0x4d')]({'where':{'id':_0x116965[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2a')](function(_0x3cc60b){return db[_0xc5c3('0x4f')][_0xc5c3('0x50')](function(_0x2c5fd2){return _0x3cc60b[_0xc5c3('0x7f')](_0x557b8f,{'transaction':_0x2c5fd2})[_0xc5c3('0x2a')](function(){return BPromise[_0xc5c3('0x85')](_0x389c96,function(_0x554787){return db[_0xc5c3('0x86')][_0xc5c3('0x87')]({'TeamId':_0x554787['id'],'VoicePrefixId':_0x116965[_0xc5c3('0x4a')]['id']},{'transaction':_0x2c5fd2});});})[_0xc5c3('0x2a')](function(){return BPromise[_0xc5c3('0x85')](_0x9e9372,function(_0x589e28){return db[_0xc5c3('0x88')][_0xc5c3('0x89')]({'where':{'UserId':_0x589e28['id'],'VoicePrefixId':_0x116965[_0xc5c3('0x4a')]['id']},'transaction':_0x2c5fd2});});})['then'](function(){_0x9e9372[_0xc5c3('0x8a')](function(_0x2dd850){socket[_0xc5c3('0x79')](_0xc5c3('0x8b'),{'UserId':_0x2dd850['id'],'VoicePrefixId':_0x3cc60b['id']});});});});});}})[_0xc5c3('0x2a')](respondWithStatusCode(_0xa4672a,null))[_0xc5c3('0x48')](handleError(_0xa4672a,null));};exports[_0xc5c3('0x8c')]=function(_0x53a502,_0x762654,_0x37459f){return db['Team'][_0xc5c3('0x81')]({'where':{'id':_0x53a502[_0xc5c3('0x37')][_0xc5c3('0x74')]},'attributes':['id'],'include':[{'model':db[_0xc5c3('0x7c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc5c3('0x2a')](handleEntityNotFound(_0x762654,null))[_0xc5c3('0x2a')](function(_0x3aafa0){var _0xe80b2b=_[_0xc5c3('0x31')](_0x3aafa0,'id');var _0x2b49da=[];var _0x47bd08=[];var _0x314072=squel[_0xc5c3('0x8d')]();_0x314072['field'](_0xc5c3('0x8e'))['from'](_0xc5c3('0x8f'),'tq')[_0xc5c3('0x90')](_0xc5c3('0x91'),'ut',_0xc5c3('0x92'))['where']('VoicePrefixId\x20=\x20?',_0x53a502['params']['id']);for(var _0x3b5ca9=0x0;_0x3b5ca9<_0x3aafa0[_0xc5c3('0x3c')];_0x3b5ca9+=0x1){let _0x283935=_0x3aafa0[_0x3b5ca9];for(var _0x5cebbc=0x0;_0x5cebbc<_0x283935[_0xc5c3('0x93')]['length'];_0x5cebbc+=0x1){let _0x423b48=_0x283935[_0xc5c3('0x93')][_0x5cebbc];var _0x2a8dfc=_0x314072[_0xc5c3('0x94')]();_0x2a8dfc[_0xc5c3('0x41')](_0xc5c3('0x95'),_0x423b48['id']);_0x47bd08[_0xc5c3('0x69')](db[_0xc5c3('0x4f')][_0xc5c3('0x37')](_0x2a8dfc[_0xc5c3('0x96')](),{'type':db['sequelize'][_0xc5c3('0x97')]['SELECT']})[_0xc5c3('0x2a')](function(_0x397543){if(_0x397543[_0xc5c3('0x3c')]===0x1){return _0x423b48['id'];}else{var _0x21941a=_['every'](_[_0xc5c3('0x31')](_0x397543,_0xc5c3('0x98')),function(_0x1b7fc8){return _['includes'](_0xe80b2b,_0x1b7fc8);});if(_0x21941a){return _0x423b48['id'];}}}));}}return BPromise['all'](_0x47bd08)[_0xc5c3('0x2a')](function(_0x5731da){_0x2b49da=_(_0x2b49da)[_0xc5c3('0x99')](_0x5731da)[_0xc5c3('0x9a')]()['value']();return db[_0xc5c3('0x32')][_0xc5c3('0x4d')]({'where':{'id':_0x53a502['params']['id']}})['then'](function(_0x288b93){return db[_0xc5c3('0x4f')][_0xc5c3('0x50')](function(_0x187a7a){return _0x288b93['removeTeams'](_0x53a502[_0xc5c3('0x37')][_0xc5c3('0x74')],{'transaction':_0x187a7a})[_0xc5c3('0x2a')](function(){if(!_['isEmpty'](_0x2b49da)){return _0x288b93[_0xc5c3('0x76')](_0x2b49da,{'transaction':_0x187a7a});}})[_0xc5c3('0x2a')](function(){_0x2b49da['forEach'](function(_0x8ec6b6){socket[_0xc5c3('0x79')](_0xc5c3('0x78'),{'UserId':_0x8ec6b6,'VoicePrefixId':_0x288b93['id']});});});});});});})[_0xc5c3('0x2a')](respondWithStatusCode(_0x762654,null))[_0xc5c3('0x48')](handleError(_0x762654,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 756d903..6901213 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 _0xd45f=['exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xd45f,0xe8));var _0xfd45=function(_0x505569,_0x3b4d50){_0x505569=_0x505569-0x0;var _0x41573f=_0xd45f[_0x505569];return _0x41573f;};'use strict';var EventEmitter=require(_0xfd45('0x0'));var VoicePrefix=require(_0xfd45('0x1'))['db'][_0xfd45('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xfd45('0x3')](0x0);var events={'afterCreate':_0xfd45('0x4'),'afterUpdate':_0xfd45('0x5'),'afterDestroy':_0xfd45('0x6')};function emitEvent(_0x30fd5c){return function(_0x22dd77,_0x523522,_0x28d0ca){VoicePrefixEvents[_0xfd45('0x7')](_0x30fd5c+':'+_0x22dd77['id'],_0x22dd77);VoicePrefixEvents[_0xfd45('0x7')](_0x30fd5c,_0x22dd77);_0x28d0ca(null);};}for(var e in events){if(events[_0xfd45('0x8')](e)){var event=events[e];VoicePrefix[_0xfd45('0x9')](e,emitEvent(event));}}module[_0xfd45('0xa')]=VoicePrefixEvents; \ No newline at end of file +var _0x10c5=['../../mysqldb','VoicePrefix','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1c3422,_0xe8dfee){var _0x55c276=function(_0x10ea4e){while(--_0x10ea4e){_0x1c3422['push'](_0x1c3422['shift']());}};_0x55c276(++_0xe8dfee);}(_0x10c5,0x12b));var _0x510c=function(_0x309b9e,_0x3a124d){_0x309b9e=_0x309b9e-0x0;var _0x201ea5=_0x10c5[_0x309b9e];return _0x201ea5;};'use strict';var EventEmitter=require(_0x510c('0x0'));var VoicePrefix=require(_0x510c('0x1'))['db'][_0x510c('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x510c('0x3')](0x0);var events={'afterCreate':_0x510c('0x4'),'afterUpdate':'update','afterDestroy':_0x510c('0x5')};function emitEvent(_0x52bddc){return function(_0x1ac5b0,_0x41cf9e,_0x24e457){VoicePrefixEvents[_0x510c('0x6')](_0x52bddc+':'+_0x1ac5b0['id'],_0x1ac5b0);VoicePrefixEvents[_0x510c('0x6')](_0x52bddc,_0x1ac5b0);_0x24e457(null);};}for(var e in events){if(events[_0x510c('0x7')](e)){var event=events[e];VoicePrefix[_0x510c('0x8')](e,emitEvent(event));}}module[_0x510c('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 a6d8e8d..8f06199 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 _0xadb1=['request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','VoicePrefix','lodash','../../config/logger','bluebird'];(function(_0x26475e,_0xe34ebb){var _0x44d0dc=function(_0x170925){while(--_0x170925){_0x26475e['push'](_0x26475e['shift']());}};_0x44d0dc(++_0xe34ebb);}(_0xadb1,0xa8));var _0x1adb=function(_0x38b728,_0x5a4e32){_0x38b728=_0x38b728-0x0;var _0x5e615c=_0xadb1[_0x38b728];return _0x5e615c;};'use strict';var _=require(_0x1adb('0x0'));var util=require('util');var logger=require(_0x1adb('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1adb('0x2'));var rp=require(_0x1adb('0x3'));var fs=require('fs');var path=require(_0x1adb('0x4'));var rimraf=require(_0x1adb('0x5'));var config=require(_0x1adb('0x6'));var attributes=require(_0x1adb('0x7'));module['exports']=function(_0x3afe9b,_0x1d4a04){return _0x3afe9b['define'](_0x1adb('0x8'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3736=['VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x414655,_0x79d916){var _0x237884=function(_0x2737d9){while(--_0x2737d9){_0x414655['push'](_0x414655['shift']());}};_0x237884(++_0x79d916);}(_0x3736,0x1c9));var _0x6373=function(_0x3d994d,_0x3347e0){_0x3d994d=_0x3d994d-0x0;var _0x2bd56f=_0x3736[_0x3d994d];return _0x2bd56f;};'use strict';var _=require(_0x6373('0x0'));var util=require(_0x6373('0x1'));var logger=require(_0x6373('0x2'))(_0x6373('0x3'));var moment=require(_0x6373('0x4'));var BPromise=require(_0x6373('0x5'));var rp=require(_0x6373('0x6'));var fs=require('fs');var path=require(_0x6373('0x7'));var rimraf=require(_0x6373('0x8'));var config=require(_0x6373('0x9'));var attributes=require('./voicePrefix.attributes');module['exports']=function(_0x2865c7,_0x3135b0){return _0x2865c7[_0x6373('0xa')](_0x6373('0xb'),attributes,{'tableName':_0x6373('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index d26604f..3c25e56 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 _0xe635=['moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','then','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util'];(function(_0x3263a5,_0x24e81a){var _0x201980=function(_0x1333f8){while(--_0x1333f8){_0x3263a5['push'](_0x3263a5['shift']());}};_0x201980(++_0x24e81a);}(_0xe635,0x1be));var _0x5e63=function(_0x1e0414,_0x2f755a){_0x1e0414=_0x1e0414-0x0;var _0x84b43=_0xe635[_0x1e0414];return _0x84b43;};'use strict';var _=require(_0x5e63('0x0'));var util=require(_0x5e63('0x1'));var moment=require(_0x5e63('0x2'));var BPromise=require(_0x5e63('0x3'));var rs=require(_0x5e63('0x4'));var fs=require('fs');var Redis=require(_0x5e63('0x5'));var db=require(_0x5e63('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5e63('0x7'));var config=require(_0x5e63('0x8'));var jayson=require(_0x5e63('0x9'));var client=jayson[_0x5e63('0xa')][_0x5e63('0xb')]({'port':0x232a});config[_0x5e63('0xc')]=_[_0x5e63('0xd')](config[_0x5e63('0xc')],{'host':_0x5e63('0xe'),'port':0x18eb});var socket=require(_0x5e63('0xf'))(new Redis(config['redis']));require(_0x5e63('0x10'))[_0x5e63('0x11')](socket);function respondWithRpcPromise(_0x307b83,_0x1b8208,_0x5d025f){return new BPromise(function(_0xd64e99,_0x2e9340){return client['request'](_0x307b83,_0x5d025f)[_0x5e63('0x12')](function(_0x2ac738){logger['info'](_0x5e63('0x13'),_0x1b8208,'request\x20sent');logger[_0x5e63('0x14')](_0x5e63('0x15'),_0x1b8208,_0x5e63('0x16'),JSON[_0x5e63('0x17')](_0x2ac738));if(_0x2ac738['error']){if(_0x2ac738['error']['code']===0x1f4){logger[_0x5e63('0x18')](_0x5e63('0x13'),_0x1b8208,_0x2ac738['error'][_0x5e63('0x19')]);return _0x2e9340(_0x2ac738[_0x5e63('0x18')][_0x5e63('0x19')]);}logger['error'](_0x5e63('0x13'),_0x1b8208,_0x2ac738[_0x5e63('0x18')][_0x5e63('0x19')]);return _0xd64e99(_0x2ac738[_0x5e63('0x18')][_0x5e63('0x19')]);}else{logger['info'](_0x5e63('0x13'),_0x1b8208,_0x5e63('0x16'));_0xd64e99(_0x2ac738[_0x5e63('0x1a')][_0x5e63('0x19')]);}})[_0x5e63('0x1b')](function(_0x4a6013){logger[_0x5e63('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x1b8208,_0x4a6013);_0x2e9340(_0x4a6013);});});} \ No newline at end of file +var _0x27c8=['stringify','error','code','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','then','info','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s'];(function(_0x348587,_0x58c657){var _0x1d777d=function(_0x25d467){while(--_0x25d467){_0x348587['push'](_0x348587['shift']());}};_0x1d777d(++_0x58c657);}(_0x27c8,0x6a));var _0x827c=function(_0x252199,_0x48cf98){_0x252199=_0x252199-0x0;var _0x4bacd8=_0x27c8[_0x252199];return _0x4bacd8;};'use strict';var _=require('lodash');var util=require(_0x827c('0x0'));var moment=require(_0x827c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x827c('0x2'));var db=require(_0x827c('0x3'))['db'];var utils=require(_0x827c('0x4'));var logger=require(_0x827c('0x5'))(_0x827c('0x6'));var config=require(_0x827c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x827c('0x8')]({'port':0x232a});config[_0x827c('0x9')]=_[_0x827c('0xa')](config[_0x827c('0x9')],{'host':_0x827c('0xb'),'port':0x18eb});var socket=require(_0x827c('0xc'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0x827c('0xd')](socket);function respondWithRpcPromise(_0x35b5ba,_0x544f14,_0x5c3fc8){return new BPromise(function(_0x3f0a30,_0x193193){return client['request'](_0x35b5ba,_0x5c3fc8)[_0x827c('0xe')](function(_0x2fea87){logger[_0x827c('0xf')](_0x827c('0x10'),_0x544f14,'request\x20sent');logger[_0x827c('0x11')](_0x827c('0x12'),_0x544f14,'request\x20sent',JSON[_0x827c('0x13')](_0x2fea87));if(_0x2fea87[_0x827c('0x14')]){if(_0x2fea87[_0x827c('0x14')][_0x827c('0x15')]===0x1f4){logger[_0x827c('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x544f14,_0x2fea87['error']['message']);return _0x193193(_0x2fea87[_0x827c('0x14')][_0x827c('0x16')]);}logger[_0x827c('0x14')](_0x827c('0x10'),_0x544f14,_0x2fea87['error'][_0x827c('0x16')]);return _0x3f0a30(_0x2fea87[_0x827c('0x14')][_0x827c('0x16')]);}else{logger[_0x827c('0xf')](_0x827c('0x10'),_0x544f14,'request\x20sent');_0x3f0a30(_0x2fea87[_0x827c('0x17')]['message']);}})[_0x827c('0x18')](function(_0x3f7270){logger['error'](_0x827c('0x10'),_0x544f14,_0x3f7270);_0x193193(_0x3f7270);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 46336a9..c511944 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 _0x87ae=['emit','removeListener','register','length','voicePrefix:','remove'];(function(_0xc677a9,_0x16fa84){var _0x59e76c=function(_0x3f7522){while(--_0x3f7522){_0xc677a9['push'](_0xc677a9['shift']());}};_0x59e76c(++_0x16fa84);}(_0x87ae,0xf5));var _0xe87a=function(_0x3f0b30,_0x159bc8){_0x3f0b30=_0x3f0b30-0x0;var _0x2748a5=_0x87ae[_0x3f0b30];return _0x2748a5;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=['save',_0xe87a('0x0'),'update'];function createListener(_0x4ab66a,_0x2241d2){return function(_0x44fc79){_0x2241d2[_0xe87a('0x1')](_0x4ab66a,_0x44fc79);};}function removeListener(_0x5a55b8,_0x28899c){return function(){VoicePrefixEvents[_0xe87a('0x2')](_0x5a55b8,_0x28899c);};}exports[_0xe87a('0x3')]=function(_0x5ef978){for(var _0x4b9934=0x0,_0x125dd3=events[_0xe87a('0x4')];_0x4b9934<_0x125dd3;_0x4b9934++){var _0x5dff22=events[_0x4b9934];var _0x379db4=createListener(_0xe87a('0x5')+_0x5dff22,_0x5ef978);VoicePrefixEvents['on'](_0x5dff22,_0x379db4);}}; \ No newline at end of file +var _0x682e=['register','length','voicePrefix:','./voicePrefix.events','save','remove','update','emit','removeListener'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x682e,0x1ce));var _0xe682=function(_0x3db902,_0x47208a){_0x3db902=_0x3db902-0x0;var _0xe06d91=_0x682e[_0x3db902];return _0xe06d91;};'use strict';var VoicePrefixEvents=require(_0xe682('0x0'));var events=[_0xe682('0x1'),_0xe682('0x2'),_0xe682('0x3')];function createListener(_0x1fc41a,_0x31f019){return function(_0x5cbf47){_0x31f019[_0xe682('0x4')](_0x1fc41a,_0x5cbf47);};}function removeListener(_0x10c8cd,_0x3705a2){return function(){VoicePrefixEvents[_0xe682('0x5')](_0x10c8cd,_0x3705a2);};}exports[_0xe682('0x6')]=function(_0x51e786){for(var _0x3b4c98=0x0,_0xd6995=events[_0xe682('0x7')];_0x3b4c98<_0xd6995;_0x3b4c98++){var _0x1ab428=events[_0x3b4c98];var _0x4e7e7d=createListener(_0xe682('0x8')+_0x1ab428,_0x51e786);VoicePrefixEvents['on'](_0x1ab428,_0x4e7e7d);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index bd40dab..8f84e43 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(_0x4f8d61,_0x29eff0){var _0x3bc078=function(_0x4c7203){while(--_0x4c7203){_0x4f8d61['push'](_0x4f8d61['shift']());}};_0x3bc078(++_0x29eff0);}(_0xb10b,0x12a));var _0xbb10=function(_0x1c1913,_0x1d1b59){_0x1c1913=_0x1c1913-0x0;var _0x3b352a=_0xb10b[_0x1c1913];return _0x3b352a;};'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(_0x29d044,_0x4d9f96){var _0x522c49=function(_0x5af506){while(--_0x5af506){_0x29d044['push'](_0x29d044['shift']());}};_0x522c49(++_0x4d9f96);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/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 ff686e7..d760dee 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 _0x1ca1=['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','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','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','sequelize','exports','STRING','name','ENUM','inbound','outbound','ringall','leastrecent','rrmemory','rrordered','setDataValue','strategy','type','getDataValue','dialMethod','booked','roundrobin','progressive','predictive','INTEGER','yes','once','TEXT','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','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).'];(function(_0x5c16e1,_0x12ea72){var _0x4f59d0=function(_0x48ed32){while(--_0x48ed32){_0x5c16e1['push'](_0x5c16e1['shift']());}};_0x4f59d0(++_0x12ea72);}(_0x1ca1,0x163));var _0x11ca=function(_0x311bdd,_0x66de32){_0x311bdd=_0x311bdd-0x0;var _0x1c32ed=_0x1ca1[_0x311bdd];return _0x1c32ed;};'use strict';var Sequelize=require(_0x11ca('0x0'));module[_0x11ca('0x1')]={'name':{'type':Sequelize[_0x11ca('0x2')],'allowNull':![],'unique':_0x11ca('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x11ca('0x4')](_0x11ca('0x5'),_0x11ca('0x6')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x11ca('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x11ca('0x4')]('rr',_0x11ca('0x7'),_0x11ca('0x8'),'fewestcalls','random',_0x11ca('0x9'),'linear','wrandom',_0x11ca('0xa')),'allowNull':![],'defaultValue':'ringall','set':function(_0x48d0aa){this[_0x11ca('0xb')](_0x11ca('0xc'),_0x48d0aa?_0x48d0aa:_0x11ca('0x9'));},'get':function(){var _0x52958e=this['getDataValue'](_0x11ca('0xd'));var _0x176448=this[_0x11ca('0xe')](_0x11ca('0xf'));var _0x208974=this['getDataValue'](_0x11ca('0xc'));if(_0x52958e==='inbound'){return _0x208974;}if(_0x176448===_0x11ca('0x10')&&_0x208974==='rrmemory'||_0x176448==='booked'&&_0x208974===_0x11ca('0x11')){return _0x208974;}if(_0x176448===_0x11ca('0x12')||_0x176448===_0x11ca('0x13')||_0x176448==='power'){return _0x208974;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x11ca('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x11ca('0x14')](0xb)},'timeout':{'type':Sequelize[_0x11ca('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x11ca('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x11ca('0x2')]},'weight':{'type':Sequelize[_0x11ca('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x11ca('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x11ca('0x4')](_0x11ca('0x15'),'no'),'defaultValue':_0x11ca('0x15')},'autopause':{'type':Sequelize[_0x11ca('0x4')](_0x11ca('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x11ca('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0x11ca('0x4')](_0x11ca('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x11ca('0x4')](_0x11ca('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x11ca('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x11ca('0x4')](_0x11ca('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x11ca('0x4')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x11ca('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x11ca('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x11ca('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x11ca('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x11ca('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x11ca('0x4')](_0x11ca('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x11ca('0x4')](_0x11ca('0x15'),'no'),'defaultValue':_0x11ca('0x15')},'announce_holdtime':{'type':Sequelize[_0x11ca('0x4')](_0x11ca('0x15'),'no',_0x11ca('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x11ca('0x4')](_0x11ca('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0x11ca('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x11ca('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x11ca('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x11ca('0x2')]},'queue_youarenext':{'type':Sequelize[_0x11ca('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x11ca('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x11ca('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x11ca('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x11ca('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x11ca('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x11ca('0x2')]},'queue_quantity2':{'type':Sequelize[_0x11ca('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x11ca('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x11ca('0x17')],'set':function(_0x20f080){this[_0x11ca('0xb')](_0x11ca('0x18'),_0x20f080?_0x20f080['join'](','):[]);},'get':function(){return this[_0x11ca('0xe')](_0x11ca('0x18'))?this[_0x11ca('0xe')](_0x11ca('0x18'))[_0x11ca('0x19')](','):[];}},'joinempty':{'type':Sequelize[_0x11ca('0x2')],'defaultValue':'yes','set':function(_0x41e5ce){this[_0x11ca('0xb')](_0x11ca('0x1a'),_0x41e5ce?_0x41e5ce[_0x11ca('0x1b')](','):undefined);},'get':function(){return this[_0x11ca('0xe')](_0x11ca('0x1a'))?this[_0x11ca('0xe')](_0x11ca('0x1a'))[_0x11ca('0x19')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x11ca('0x2')],'defaultValue':'no','set':function(_0x1b8f6a){this[_0x11ca('0xb')](_0x11ca('0x1c'),_0x1b8f6a?_0x1b8f6a[_0x11ca('0x1b')](','):undefined);},'get':function(){return this[_0x11ca('0xe')](_0x11ca('0x1c'))?this['getDataValue']('leavewhenempty')[_0x11ca('0x19')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x11ca('0x4')](_0x11ca('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x11ca('0x4')](_0x11ca('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x11ca('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x11ca('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x11ca('0x1d')],'defaultValue':0x0,'set':function(_0x3d2f5f){this['setDataValue'](_0x11ca('0x1e'),_0x3d2f5f);if(_0x3d2f5f){if(this[_0x11ca('0xe')](_0x11ca('0x1f'))<0x2){this[_0x11ca('0xb')](_0x11ca('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x11ca('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x11ca('0x1d')],'defaultValue':0x0,'comment':_0x11ca('0x20')},'dialMethod':{'type':Sequelize['ENUM'](_0x11ca('0x21'),_0x11ca('0x12'),_0x11ca('0x22'),_0x11ca('0x13'),'booked'),'defaultValue':_0x11ca('0x12'),'comment':_0x11ca('0x23')},'dialLimitChannel':{'type':Sequelize[_0x11ca('0x14')](0x4)[_0x11ca('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x11ca('0x14')](0x4)[_0x11ca('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x11ca('0x25')},'dialPowerLevel':{'type':Sequelize[_0x11ca('0x26')](0x2)[_0x11ca('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x11ca('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0x11ca('0x4')](_0x11ca('0x28'),'dropRate'),'defaultValue':_0x11ca('0x29'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x11ca('0x26')](0x2)[_0x11ca('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x11ca('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0x11ca('0x14')](0x3)[_0x11ca('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x11ca('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0x11ca('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x11ca('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x11ca('0x14')](0x3)[_0x11ca('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11ca('0x2c')},'dialQueueOptions':{'type':Sequelize[_0x11ca('0x2')],'defaultValue':_0x11ca('0x2d'),'comment':_0x11ca('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0x11ca('0x14')](0x3)[_0x11ca('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x11ca('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0x11ca('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x11ca('0x14')](0x5)[_0x11ca('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11ca('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0x11ca('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11ca('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0x11ca('0x14')](0x5)[_0x11ca('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x11ca('0x14')](0x3)[_0x11ca('0x24')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x11ca('0x14')](0x5)[_0x11ca('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11ca('0x32')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x11ca('0x33')},'dialTimezone':{'type':Sequelize[_0x11ca('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x11ca('0x34')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x11ca('0x4')](_0x11ca('0x35'),_0x11ca('0x36'),'onlyIfOpen'),'defaultValue':_0x11ca('0x35')},'dialAMDActive':{'type':Sequelize[_0x11ca('0x1d')],'defaultValue':0x0,'comment':_0x11ca('0x37')},'dialAMDInitialSilence':{'type':Sequelize[_0x11ca('0x14')](0x9)[_0x11ca('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x11ca('0x38')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x11ca('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x11ca('0x14')](0x9)[_0x11ca('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x11ca('0x14')](0x9)[_0x11ca('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x11ca('0x14')](0x9)[_0x11ca('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x11ca('0x14')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x11ca('0x3a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x11ca('0x3b')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x11ca('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x11ca('0x3c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x11ca('0x14')](0x9)[_0x11ca('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x11ca('0x3d')},'dialRecallMeTimeout':{'type':Sequelize[_0x11ca('0x14')](0x5)[_0x11ca('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x11ca('0x1d')],'defaultValue':0x0,'comment':_0x11ca('0x3e')},'dialOrderByScheduledAt':{'type':Sequelize[_0x11ca('0x4')]('DESC',_0x11ca('0x3f')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x11ca('0x2')],'comment':_0x11ca('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x11ca('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x11ca('0x14')](0x3)[_0x11ca('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x11ca('0x40')},'dialCutDigit':{'type':Sequelize[_0x11ca('0x14')](0x3)[_0x11ca('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x11ca('0x41')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11ca('0x42')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x11ca('0x14')](0x5)[_0x11ca('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11ca('0x43')},'dialDropMaxRetry':{'type':Sequelize[_0x11ca('0x14')](0x3)[_0x11ca('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11ca('0x44')},'dialDropRetryFrequency':{'type':Sequelize[_0x11ca('0x14')](0x5)[_0x11ca('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11ca('0x45')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x11ca('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11ca('0x46')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x11ca('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11ca('0x47')},'dialMachineMaxRetry':{'type':Sequelize[_0x11ca('0x14')](0x3)[_0x11ca('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11ca('0x48')},'dialMachineRetryFrequency':{'type':Sequelize[_0x11ca('0x14')](0x5)[_0x11ca('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11ca('0x49')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x11ca('0x14')](0x3)[_0x11ca('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11ca('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x11ca('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11ca('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x11ca('0x14')],'allowNull':!![],'comment':_0x11ca('0x4c')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x11ca('0x4d'),'set':function(_0x2b758d){if(!_0x2b758d)this[_0x11ca('0xb')](_0x11ca('0x4e'),null);this['setDataValue']('mandatoryDisposition',_0x2b758d);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x11ca('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x11ca('0x14')](0x3)[_0x11ca('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x11ca('0x1d')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x11ca('0x14')](0x3)[_0x11ca('0x24')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x11ca('0x1d')],'defaultValue':![]}}; \ No newline at end of file +var _0x0b33=['TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','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)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','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)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\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','sequelize','name','ENUM','inbound','default','ringall','leastrecent','random','linear','wrandom','rrordered','setDataValue','strategy','rrmemory','getDataValue','type','dialMethod','booked','progressive','predictive','power','STRING','INTEGER','yes','all','once'];(function(_0x1fc3a5,_0x271270){var _0x5ef0ea=function(_0x4d6f13){while(--_0x4d6f13){_0x1fc3a5['push'](_0x1fc3a5['shift']());}};_0x5ef0ea(++_0x271270);}(_0x0b33,0x17b));var _0x30b3=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x0b33[_0x11005e];return _0x29338f;};'use strict';var Sequelize=require(_0x30b3('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x30b3('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x30b3('0x2')]('inbound','outbound'),'allowNull':![],'defaultValue':_0x30b3('0x3')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x30b3('0x4')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x30b3('0x5'),_0x30b3('0x6'),'fewestcalls',_0x30b3('0x7'),'rrmemory',_0x30b3('0x8'),_0x30b3('0x9'),_0x30b3('0xa')),'allowNull':![],'defaultValue':'ringall','set':function(_0x1c651c){this[_0x30b3('0xb')](_0x30b3('0xc'),_0x1c651c?_0x1c651c:_0x30b3('0xd'));},'get':function(){var _0x5d37df=this[_0x30b3('0xe')](_0x30b3('0xf'));var _0x12f162=this[_0x30b3('0xe')](_0x30b3('0x10'));var _0x368e5e=this[_0x30b3('0xe')](_0x30b3('0xc'));if(_0x5d37df===_0x30b3('0x3')){return _0x368e5e;}if(_0x12f162===_0x30b3('0x11')&&_0x368e5e==='rrmemory'||_0x12f162===_0x30b3('0x11')&&_0x368e5e==='roundrobin'){return _0x368e5e;}if(_0x12f162===_0x30b3('0x12')||_0x12f162===_0x30b3('0x13')||_0x12f162===_0x30b3('0x14')){return _0x368e5e;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x30b3('0x15')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x30b3('0x16')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x30b3('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x30b3('0x15')]},'weight':{'type':Sequelize[_0x30b3('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x30b3('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x30b3('0x17'),'no'),'defaultValue':_0x30b3('0x17')},'autopause':{'type':Sequelize['ENUM']('yes','no',_0x30b3('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x30b3('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x30b3('0x2')](_0x30b3('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x30b3('0x2')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x30b3('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x30b3('0x2')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x30b3('0x2')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x30b3('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x30b3('0x2')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x30b3('0x15')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x30b3('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x30b3('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x30b3('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x30b3('0x2')](_0x30b3('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x30b3('0x2')](_0x30b3('0x17'),'no'),'defaultValue':_0x30b3('0x17')},'announce_holdtime':{'type':Sequelize['ENUM']('yes','no',_0x30b3('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x30b3('0x15')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x30b3('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x30b3('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x30b3('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x30b3('0x15')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x30b3('0x15')]},'queue_youarenext':{'type':Sequelize[_0x30b3('0x15')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x30b3('0x15')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x30b3('0x15')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x30b3('0x15')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x30b3('0x15')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x30b3('0x15')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x30b3('0x15')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x30b3('0x15')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x30b3('0x15')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x30b3('0x1a')],'set':function(_0x33b000){this[_0x30b3('0xb')](_0x30b3('0x1b'),_0x33b000?_0x33b000[_0x30b3('0x1c')](','):[]);},'get':function(){return this['getDataValue'](_0x30b3('0x1b'))?this[_0x30b3('0xe')]('periodic_announce')[_0x30b3('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0x30b3('0x15')],'defaultValue':'yes','set':function(_0x84040d){this['setDataValue'](_0x30b3('0x1e'),_0x84040d?_0x84040d[_0x30b3('0x1c')](','):undefined);},'get':function(){return this[_0x30b3('0xe')](_0x30b3('0x1e'))?this['getDataValue']('joinempty')[_0x30b3('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x30b3('0x15')],'defaultValue':'no','set':function(_0x42590){this[_0x30b3('0xb')](_0x30b3('0x1f'),_0x42590?_0x42590[_0x30b3('0x1c')](','):undefined);},'get':function(){return this[_0x30b3('0xe')](_0x30b3('0x1f'))?this[_0x30b3('0xe')](_0x30b3('0x1f'))[_0x30b3('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x30b3('0x2')](_0x30b3('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x30b3('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x30b3('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x30b3('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x30b3('0x15')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x2b9ba3){this['setDataValue'](_0x30b3('0x20'),_0x2b9ba3);if(_0x2b9ba3){if(this[_0x30b3('0xe')]('wrapuptime')<0x2){this['setDataValue'](_0x30b3('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x30b3('0x22')],'defaultValue':0x0,'comment':_0x30b3('0x23')},'dialMethod':{'type':Sequelize[_0x30b3('0x2')]('preview',_0x30b3('0x12'),'power',_0x30b3('0x13'),_0x30b3('0x11')),'defaultValue':'progressive','comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x30b3('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x30b3('0x16')](0x4)[_0x30b3('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x30b3('0x25')},'dialPowerLevel':{'type':Sequelize[_0x30b3('0x26')](0x2)[_0x30b3('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x30b3('0x2')](_0x30b3('0x27'),_0x30b3('0x28')),'defaultValue':_0x30b3('0x28'),'comment':_0x30b3('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x30b3('0x26')](0x2)[_0x30b3('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x30b3('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0x30b3('0x16')](0x3)[_0x30b3('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x30b3('0x15')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x30b3('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x30b3('0x2b')},'dialQueueOptions':{'type':Sequelize[_0x30b3('0x15')],'defaultValue':'tTxX','comment':_0x30b3('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x30b3('0x16')](0x3)[_0x30b3('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x30b3('0x2d')},'dialQueueProject':{'type':Sequelize[_0x30b3('0x15')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x30b3('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x30b3('0x2e')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x30b3('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x30b3('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x30b3('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x30b3('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x30b3('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x30b3('0x30')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x30b3('0x16')](0x5)[_0x30b3('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x30b3('0x31')},'dialGlobalMaxRetry':{'type':Sequelize[_0x30b3('0x16')](0x3)[_0x30b3('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x30b3('0x32')},'dialTimezone':{'type':Sequelize[_0x30b3('0x15')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x30b3('0x15')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x30b3('0x15')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x30b3('0x2')](_0x30b3('0x33'),_0x30b3('0x34'),_0x30b3('0x35')),'defaultValue':_0x30b3('0x33')},'dialAMDActive':{'type':Sequelize[_0x30b3('0x22')],'defaultValue':0x0,'comment':_0x30b3('0x36')},'dialAMDInitialSilence':{'type':Sequelize[_0x30b3('0x16')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x30b3('0x37')},'dialAMDGreeting':{'type':Sequelize[_0x30b3('0x16')](0x9)[_0x30b3('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x30b3('0x38')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x30b3('0x16')](0x9)[_0x30b3('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x30b3('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x30b3('0x16')](0x9)[_0x30b3('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x30b3('0x16')](0x9)[_0x30b3('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x30b3('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x30b3('0x16')](0x9)[_0x30b3('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x30b3('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x30b3('0x16')](0x5)[_0x30b3('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x30b3('0x3c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x30b3('0x16')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x30b3('0x3d')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x30b3('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x30b3('0x3e')},'dialRecallInQueue':{'type':Sequelize[_0x30b3('0x22')],'defaultValue':0x0,'comment':_0x30b3('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize[_0x30b3('0x2')](_0x30b3('0x40'),_0x30b3('0x41')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x30b3('0x15')],'comment':_0x30b3('0x42')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x30b3('0x22')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x30b3('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x30b3('0x43')},'dialCutDigit':{'type':Sequelize[_0x30b3('0x16')](0x3)[_0x30b3('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x30b3('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x30b3('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x30b3('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x30b3('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x30b3('0x46')},'dialDropMaxRetry':{'type':Sequelize[_0x30b3('0x16')](0x3)[_0x30b3('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x30b3('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x30b3('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x30b3('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x30b3('0x16')](0x3)[_0x30b3('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x30b3('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x30b3('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x30b3('0x4a')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x30b3('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x30b3('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x30b3('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x30b3('0x16')](0x3)[_0x30b3('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x30b3('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x30b3('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x30b3('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x30b3('0x16')],'allowNull':!![],'comment':_0x30b3('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x30b3('0x22')],'defaultValue':![],'comment':_0x30b3('0x4f'),'set':function(_0x5a6caa){if(!_0x5a6caa)this[_0x30b3('0xb')](_0x30b3('0x50'),null);this[_0x30b3('0xb')]('mandatoryDisposition',_0x5a6caa);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x30b3('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x30b3('0x16')](0x3)[_0x30b3('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x30b3('0x16')](0x3)[_0x30b3('0x24')],'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 90090d8..c945460 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 _0xf603=['body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','error','createdAt','omit','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','CmHopper','hasOwnProperty','order','VoiceQueueId','findAll','rows','getHopperHistories','CmHopperHistory','findOne','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','Team','User','online','interface','flatMap','Agents','forEach','penalty','sequelize','transaction','TeamVoiceQueue','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','team_has_voice_queues','clone','push','toString','QueryTypes','SELECT','every','all','compact','userVoiceQueue:remove','addAgents','spread','removeAgents','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','updatedAt','from','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','VoiceQueueId\x20=\x20?','onlyIfOpen','insert','ListId\x20=\x20?','cm_hopper_additional_phones','OrderBy','join','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','localhost','./voiceQueue.socket','sendStatus','end','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','name','UserProfileResource','stack','send','index','rawAttributes','fieldName','query','keys','filters','model','attributes','fields','nolimit','offset','sort','where','pick','merge','options','VoiceQueue','includeAll','include','catch','show','params','intersection','length','create'];(function(_0x113855,_0x2bd31b){var _0x229a37=function(_0x7ddb1f){while(--_0x7ddb1f){_0x113855['push'](_0x113855['shift']());}};_0x229a37(++_0x2bd31b);}(_0xf603,0x124));var _0x3f60=function(_0x499d5b,_0x375ac4){_0x499d5b=_0x499d5b-0x0;var _0x25176d=_0xf603[_0x499d5b];return _0x25176d;};'use strict';var emlformat=require(_0x3f60('0x0'));var rimraf=require(_0x3f60('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3f60('0x2'));var rp=require(_0x3f60('0x3'));var moment=require(_0x3f60('0x4'));var BPromise=require(_0x3f60('0x5'));var Mustache=require(_0x3f60('0x6'));var util=require(_0x3f60('0x7'));var path=require(_0x3f60('0x8'));var sox=require(_0x3f60('0x9'));var csv=require(_0x3f60('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3f60('0xb'));var crypto=require(_0x3f60('0xc'));var jsforce=require(_0x3f60('0xd'));var deskjs=require(_0x3f60('0xe'));var toCsv=require(_0x3f60('0xa'));var querystring=require(_0x3f60('0xf'));var Papa=require(_0x3f60('0x10'));var Redis=require(_0x3f60('0x11'));var authService=require(_0x3f60('0x12'));var qs=require(_0x3f60('0x13'));var as=require(_0x3f60('0x14'));var hardwareService=require(_0x3f60('0x15'));var logger=require(_0x3f60('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3f60('0x17'));var db=require(_0x3f60('0x18'))['db'];config[_0x3f60('0x19')]=_['defaults'](config[_0x3f60('0x19')],{'host':_0x3f60('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3f60('0x19')]));require(_0x3f60('0x1b'))['register'](socket);function respondWithStatusCode(_0x1ec7f4,_0x5a047a){_0x5a047a=_0x5a047a||0xcc;return function(_0x39ce92){if(_0x39ce92){return _0x1ec7f4[_0x3f60('0x1c')](_0x5a047a);}return _0x1ec7f4['status'](_0x5a047a)[_0x3f60('0x1d')]();};}function respondWithResult(_0x4e84b5,_0x2fe94a){_0x2fe94a=_0x2fe94a||0xc8;return function(_0x4fe8ee){if(_0x4fe8ee){return _0x4e84b5[_0x3f60('0x1e')](_0x2fe94a)[_0x3f60('0x1f')](_0x4fe8ee);}};}function respondWithFilteredResult(_0xbc26c,_0x2b893c){return function(_0x3ae771){if(_0x3ae771){var _0xe64a00=typeof _0x2b893c['offset']===_0x3f60('0x20')&&typeof _0x2b893c[_0x3f60('0x21')]===_0x3f60('0x20');var _0x9c845f=_0x3ae771[_0x3f60('0x22')];var _0x14f44a=_0xe64a00?0x0:_0x2b893c['offset'];var _0x35dcd8=_0xe64a00?_0x3ae771[_0x3f60('0x22')]:_0x2b893c['offset']+_0x2b893c[_0x3f60('0x21')];var _0x2dba08;if(_0x35dcd8>=_0x9c845f){_0x35dcd8=_0x9c845f;_0x2dba08=0xc8;}else{_0x2dba08=0xce;}_0xbc26c[_0x3f60('0x1e')](_0x2dba08);return _0xbc26c[_0x3f60('0x23')](_0x3f60('0x24'),_0x14f44a+'-'+_0x35dcd8+'/'+_0x9c845f)[_0x3f60('0x1f')](_0x3ae771);}return null;};}function patchUpdates(_0x44b665){return function(_0x15f705){try{jsonpatch[_0x3f60('0x25')](_0x15f705,_0x44b665,!![]);}catch(_0x31847d){return BPromise[_0x3f60('0x26')](_0x31847d);}return _0x15f705[_0x3f60('0x27')]();};}function saveUpdates(_0x1f9390,_0x39ba85){return function(_0x2e3918){if(_0x2e3918){return _0x2e3918['update'](_0x1f9390)[_0x3f60('0x28')](function(_0x3cdef4){return _0x3cdef4;});}return null;};}function removeEntity(_0x15315b,_0x4581d6){return function(_0x1e1af4){if(_0x1e1af4){return _0x1e1af4[_0x3f60('0x29')]()[_0x3f60('0x28')](function(){var _0x23e265=_0x1e1af4['get']({'plain':!![]});var _0x473bd7=[{'name':_0x3f60('0x2a'),'value':_0x3f60('0x2b'),'ignore':![]},{'name':_0x3f60('0x2c'),'value':_0x3f60('0x2d'),'ignore':![]}];var _0xa69033=_(_0x473bd7)[_0x3f60('0x2e')](_0x3f60('0x2f'))[_0x3f60('0x30')](_0x3f60('0x31'))[_0x3f60('0x31')]();if(_[_0x3f60('0x32')](_0xa69033,_0x23e265[_0x3f60('0x33')])){return;}var _0x23ec35=_[_0x3f60('0x34')](_0x473bd7,[_0x3f60('0x31'),_0x23e265[_0x3f60('0x33')]])[_0x3f60('0x35')];return db[_0x3f60('0x36')][_0x3f60('0x29')]({'where':{'type':_0x23ec35,'resourceId':_0x23e265['id']}})[_0x3f60('0x28')](function(){return _0x1e1af4;});})[_0x3f60('0x28')](function(){_0x15315b[_0x3f60('0x1e')](0xcc)[_0x3f60('0x1d')]();});}};}function handleEntityNotFound(_0x1a4ebb,_0x34f212){return function(_0x3e2401){if(!_0x3e2401){_0x1a4ebb[_0x3f60('0x1c')](0x194);}return _0x3e2401;};}function handleError(_0x271d20,_0xdacf71){_0xdacf71=_0xdacf71||0x1f4;return function(_0x9e5918){logger['error'](_0x9e5918[_0x3f60('0x37')]);if(_0x9e5918[_0x3f60('0x35')]){delete _0x9e5918['name'];}_0x271d20[_0x3f60('0x1e')](_0xdacf71)[_0x3f60('0x38')](_0x9e5918);};}exports[_0x3f60('0x39')]=function(_0x12c79e,_0x54680c){var _0x1a6e0d={},_0x14292c={},_0x5e6bb4={'count':0x0,'rows':[]};var _0x5c6685=_[_0x3f60('0x30')](db['VoiceQueue'][_0x3f60('0x3a')],function(_0x3658fe){return{'name':_0x3658fe[_0x3f60('0x3b')],'type':_0x3658fe[_0x3f60('0x33')]['key']};});_0x14292c['model']=_[_0x3f60('0x30')](_0x5c6685,_0x3f60('0x35'));_0x14292c[_0x3f60('0x3c')]=_[_0x3f60('0x3d')](_0x12c79e[_0x3f60('0x3c')]);_0x14292c[_0x3f60('0x3e')]=_['intersection'](_0x14292c[_0x3f60('0x3f')],_0x14292c['query']);_0x1a6e0d[_0x3f60('0x40')]=_['intersection'](_0x14292c[_0x3f60('0x3f')],qs[_0x3f60('0x41')](_0x12c79e[_0x3f60('0x3c')][_0x3f60('0x41')]));_0x1a6e0d[_0x3f60('0x40')]=_0x1a6e0d['attributes']['length']?_0x1a6e0d[_0x3f60('0x40')]:_0x14292c[_0x3f60('0x3f')];if(!_0x12c79e[_0x3f60('0x3c')]['hasOwnProperty'](_0x3f60('0x42'))){_0x1a6e0d[_0x3f60('0x21')]=qs['limit'](_0x12c79e['query'][_0x3f60('0x21')]);_0x1a6e0d[_0x3f60('0x43')]=qs[_0x3f60('0x43')](_0x12c79e[_0x3f60('0x3c')][_0x3f60('0x43')]);}_0x1a6e0d['order']=qs[_0x3f60('0x44')](_0x12c79e[_0x3f60('0x3c')][_0x3f60('0x44')]);_0x1a6e0d[_0x3f60('0x45')]=qs[_0x3f60('0x3e')](_[_0x3f60('0x46')](_0x12c79e['query'],_0x14292c['filters']),_0x5c6685);if(_0x12c79e[_0x3f60('0x3c')][_0x3f60('0x2e')]){_0x1a6e0d['where']=_['merge'](_0x1a6e0d['where'],{'$or':_[_0x3f60('0x30')](_0x5c6685,function(_0x1a3d5f){if(_0x1a3d5f['type']!=='VIRTUAL'){var _0x4f38d5={};_0x4f38d5[_0x1a3d5f[_0x3f60('0x35')]]={'$like':'%'+_0x12c79e['query']['filter']+'%'};return _0x4f38d5;}})});}_0x1a6e0d=_[_0x3f60('0x47')]({},_0x1a6e0d,_0x12c79e[_0x3f60('0x48')]);var _0x572059={'where':_0x1a6e0d['where']};return db[_0x3f60('0x49')]['count'](_0x572059)[_0x3f60('0x28')](function(_0x4a1c9f){_0x5e6bb4[_0x3f60('0x22')]=_0x4a1c9f;if(_0x12c79e[_0x3f60('0x3c')][_0x3f60('0x4a')]){_0x1a6e0d[_0x3f60('0x4b')]=[{'all':!![]}];}return db[_0x3f60('0x49')]['findAll'](_0x1a6e0d);})[_0x3f60('0x28')](function(_0x3f7372){_0x5e6bb4['rows']=_0x3f7372;return _0x5e6bb4;})['then'](respondWithFilteredResult(_0x54680c,_0x1a6e0d))[_0x3f60('0x4c')](handleError(_0x54680c,null));};exports[_0x3f60('0x4d')]=function(_0x1e56a0,_0xe70ab0){var _0x44444d={'raw':![],'where':{'id':_0x1e56a0[_0x3f60('0x4e')]['id']}},_0x55851d={};_0x55851d['model']=_[_0x3f60('0x3d')](db[_0x3f60('0x49')][_0x3f60('0x3a')]);_0x55851d['query']=_[_0x3f60('0x3d')](_0x1e56a0[_0x3f60('0x3c')]);_0x55851d[_0x3f60('0x3e')]=_['intersection'](_0x55851d[_0x3f60('0x3f')],_0x55851d['query']);_0x44444d[_0x3f60('0x40')]=_[_0x3f60('0x4f')](_0x55851d[_0x3f60('0x3f')],qs[_0x3f60('0x41')](_0x1e56a0['query'][_0x3f60('0x41')]));_0x44444d[_0x3f60('0x40')]=_0x44444d['attributes'][_0x3f60('0x50')]?_0x44444d['attributes']:_0x55851d['model'];if(_0x1e56a0['query']['includeAll']){_0x44444d['include']=[{'all':!![]}];}_0x44444d=_[_0x3f60('0x47')]({},_0x44444d,_0x1e56a0['options']);return db[_0x3f60('0x49')][_0x3f60('0x34')](_0x44444d)[_0x3f60('0x28')](handleEntityNotFound(_0xe70ab0,null))['then'](respondWithResult(_0xe70ab0,null))[_0x3f60('0x4c')](handleError(_0xe70ab0,null));};exports[_0x3f60('0x51')]=function(_0xaa97d7,_0x749daa){return db[_0x3f60('0x49')][_0x3f60('0x51')](_0xaa97d7[_0x3f60('0x52')],{})[_0x3f60('0x28')](function(_0x291bbf){var _0x403976=_0xaa97d7['user'][_0x3f60('0x53')]({'plain':!![]});if(!_0x403976)throw new Error(_0x3f60('0x54'));if(_0x403976[_0x3f60('0x55')]===_0x3f60('0x56')){var _0x46a3fb=_0x291bbf[_0x3f60('0x53')]({'plain':!![]});var _0x461ccb=[{'name':_0x3f60('0x2a'),'value':_0x3f60('0x2b')},{'name':_0x3f60('0x2c'),'value':_0x3f60('0x2d')}];var _0x1ce71c=_[_0x3f60('0x34')](_0x461ccb,[_0x3f60('0x31'),_0x46a3fb[_0x3f60('0x33')]])[_0x3f60('0x35')];return db['UserProfileSection'][_0x3f60('0x34')]({'where':{'name':_0x1ce71c,'userProfileId':_0x403976[_0x3f60('0x57')]},'raw':!![]})['then'](function(_0x648ba5){if(_0x648ba5&&_0x648ba5[_0x3f60('0x58')]===0x0){return db[_0x3f60('0x36')]['create']({'name':_0x46a3fb['name'],'resourceId':_0x46a3fb['id'],'type':_0x648ba5['name'],'sectionId':_0x648ba5['id']},{})[_0x3f60('0x28')](function(){return _0x291bbf;});}else{return _0x291bbf;}})[_0x3f60('0x4c')](function(_0x19fbf1){logger[_0x3f60('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x19fbf1);throw _0x19fbf1;});}return _0x291bbf;})[_0x3f60('0x28')](respondWithResult(_0x749daa,0xc9))[_0x3f60('0x4c')](handleError(_0x749daa,null));};exports['clone']=function(_0x262bf9,_0x52eb53){var _0x1d1999={'where':{'id':_0x262bf9[_0x3f60('0x4e')]['id']}},_0x1f3478={};_0x1f3478[_0x3f60('0x3f')]=_[_0x3f60('0x3d')](db[_0x3f60('0x49')]['rawAttributes']);_0x1d1999[_0x3f60('0x40')]=_[_0x3f60('0x4f')](_0x1f3478[_0x3f60('0x3f')],qs[_0x3f60('0x41')](_0x262bf9[_0x3f60('0x3c')][_0x3f60('0x41')]));_0x1d1999[_0x3f60('0x40')]=_0x1d1999['attributes']['length']?_0x1d1999[_0x3f60('0x40')]:_0x1f3478[_0x3f60('0x3f')];if(_0x262bf9[_0x3f60('0x3c')][_0x3f60('0x4a')]){_0x1d1999['include']=[{'all':!![]}];}_0x1d1999=_[_0x3f60('0x47')]({},_0x1d1999,_0x262bf9[_0x3f60('0x48')]);return db['VoiceQueue'][_0x3f60('0x34')](_0x1d1999)['then'](handleEntityNotFound(_0x52eb53,null))[_0x3f60('0x28')](function(_0x3878b6){if(_0x3878b6){var _0x40e444=_0x3878b6[_0x3f60('0x53')]({'plain':!![]});_0x40e444=qs['omit'](_0x40e444,['id',_0x3f60('0x5a'),'updatedAt']);_0x262bf9[_0x3f60('0x52')]=_[_0x3f60('0x5b')](_0x262bf9[_0x3f60('0x52')],['id',_0x3f60('0x5a'),'updatedAt']);return db['VoiceQueue']['create'](_['merge'](_0x40e444,_0x262bf9[_0x3f60('0x52')]),{'include':_0x262bf9[_0x3f60('0x3c')][_0x3f60('0x4a')]?[{'all':!![]}]:undefined})['then'](function(_0x2d4563){var _0xf5e02=_0x262bf9[_0x3f60('0x56')][_0x3f60('0x53')]({'plain':!![]});if(!_0xf5e02)throw new Error(_0x3f60('0x54'));if(_0xf5e02[_0x3f60('0x55')]===_0x3f60('0x56')){var _0x52c643=_0x2d4563[_0x3f60('0x53')]({'plain':!![]});var _0x4cbbb2=[{'name':_0x3f60('0x2a'),'value':'inbound'},{'name':_0x3f60('0x2c'),'value':_0x3f60('0x2d')}];var _0x58656f=_[_0x3f60('0x34')](_0x4cbbb2,[_0x3f60('0x31'),_0x52c643[_0x3f60('0x33')]])['name'];return db['UserProfileSection'][_0x3f60('0x34')]({'where':{'name':_0x58656f,'userProfileId':_0xf5e02[_0x3f60('0x57')]},'raw':!![]})[_0x3f60('0x28')](function(_0x223151){if(_0x223151&&_0x223151[_0x3f60('0x58')]===0x0){return db['UserProfileResource'][_0x3f60('0x51')]({'name':_0x52c643[_0x3f60('0x35')],'resourceId':_0x52c643['id'],'type':_0x223151[_0x3f60('0x35')],'sectionId':_0x223151['id']},{})['then'](function(){return _0x2d4563;});}else{return _0x2d4563;}})[_0x3f60('0x4c')](function(_0x31f78e){logger[_0x3f60('0x59')](_0x3f60('0x5c'),_0x31f78e);throw _0x31f78e;});}return _0x2d4563;});}})['then'](respondWithResult(_0x52eb53,0xc9))['catch'](handleError(_0x52eb53,null));};exports[_0x3f60('0x5d')]=function(_0x59716a,_0x13cf62){if(_0x59716a[_0x3f60('0x52')]['id']){delete _0x59716a[_0x3f60('0x52')]['id'];}return db[_0x3f60('0x49')]['find']({'where':{'id':_0x59716a[_0x3f60('0x4e')]['id']}})[_0x3f60('0x28')](handleEntityNotFound(_0x13cf62,null))['then'](saveUpdates(_0x59716a[_0x3f60('0x52')],null))[_0x3f60('0x28')](respondWithResult(_0x13cf62,null))[_0x3f60('0x4c')](handleError(_0x13cf62,null));};exports['destroy']=function(_0x54a943,_0x192c37){return db[_0x3f60('0x49')][_0x3f60('0x34')]({'where':{'id':_0x54a943[_0x3f60('0x4e')]['id']}})[_0x3f60('0x28')](handleEntityNotFound(_0x192c37,null))[_0x3f60('0x28')](removeEntity(_0x192c37,null))['catch'](handleError(_0x192c37,null));};exports['getHoppers']=function(_0x395cc7,_0x5025cb,_0x44b98e){var _0x3b39a0={'raw':![],'where':{}};var _0x71b68={};var _0x3221e1={'count':0x0,'rows':[]};return db[_0x3f60('0x49')]['findOne']({'where':{'id':_0x395cc7['params']['id']}})[_0x3f60('0x28')](handleEntityNotFound(_0x5025cb,null))['then'](function(_0x14536f){if(_0x14536f){_0x71b68[_0x3f60('0x3f')]=_[_0x3f60('0x3d')](db[_0x3f60('0x5e')]['rawAttributes']);_0x71b68[_0x3f60('0x3c')]=_['keys'](_0x395cc7['query']);_0x71b68[_0x3f60('0x3e')]=_[_0x3f60('0x4f')](_0x71b68[_0x3f60('0x3f')],_0x71b68[_0x3f60('0x3c')]);_0x3b39a0['attributes']=_[_0x3f60('0x4f')](_0x71b68[_0x3f60('0x3f')],qs[_0x3f60('0x41')](_0x395cc7[_0x3f60('0x3c')][_0x3f60('0x41')]));_0x3b39a0[_0x3f60('0x40')]=_0x3b39a0[_0x3f60('0x40')][_0x3f60('0x50')]?_0x3b39a0[_0x3f60('0x40')]:_0x71b68[_0x3f60('0x3f')];if(!_0x395cc7[_0x3f60('0x3c')][_0x3f60('0x5f')](_0x3f60('0x42'))){_0x3b39a0[_0x3f60('0x21')]=qs[_0x3f60('0x21')](_0x395cc7[_0x3f60('0x3c')][_0x3f60('0x21')]);_0x3b39a0[_0x3f60('0x43')]=qs[_0x3f60('0x43')](_0x395cc7['query'][_0x3f60('0x43')]);}_0x3b39a0[_0x3f60('0x60')]=qs['sort'](_0x395cc7[_0x3f60('0x3c')][_0x3f60('0x44')]);_0x3b39a0['where']=qs[_0x3f60('0x3e')](_[_0x3f60('0x46')](_0x395cc7[_0x3f60('0x3c')],_0x71b68['filters']));_0x3b39a0[_0x3f60('0x45')][_0x3f60('0x61')]=_0x14536f['id'];if(_0x395cc7[_0x3f60('0x3c')][_0x3f60('0x2e')]){_0x3b39a0[_0x3f60('0x45')]=_['merge'](_0x3b39a0[_0x3f60('0x45')],{'$or':_[_0x3f60('0x30')](_0x3b39a0['attributes'],function(_0x4b5f94){var _0x102df3={};_0x102df3[_0x4b5f94]={'$like':'%'+_0x395cc7[_0x3f60('0x3c')][_0x3f60('0x2e')]+'%'};return _0x102df3;})});}_0x3b39a0=_[_0x3f60('0x47')]({},_0x3b39a0,_0x395cc7[_0x3f60('0x48')]);return db[_0x3f60('0x5e')][_0x3f60('0x22')]({'where':_0x3b39a0['where']})[_0x3f60('0x28')](function(_0x345d51){_0x3221e1['count']=_0x345d51;if(_0x395cc7[_0x3f60('0x3c')][_0x3f60('0x4a')]){_0x3b39a0[_0x3f60('0x4b')]=[{'all':!![]}];}return db[_0x3f60('0x5e')][_0x3f60('0x62')](_0x3b39a0);})[_0x3f60('0x28')](function(_0x2874a7){_0x3221e1[_0x3f60('0x63')]=_0x2874a7;return _0x3221e1;});}})['then'](respondWithFilteredResult(_0x5025cb,_0x3b39a0))['catch'](handleError(_0x5025cb,null));};exports[_0x3f60('0x64')]=function(_0x4d5cd7,_0x438084,_0x181826){var _0x38a6d3={'raw':!![],'where':{}};var _0x11b3e1={};var _0x37ed84={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x4d5cd7[_0x3f60('0x4e')]['id']}})['then'](handleEntityNotFound(_0x438084,null))['then'](function(_0x51aa38){if(_0x51aa38){_0x11b3e1[_0x3f60('0x3f')]=_[_0x3f60('0x3d')](db[_0x3f60('0x65')][_0x3f60('0x3a')]);_0x11b3e1['query']=_[_0x3f60('0x3d')](_0x4d5cd7[_0x3f60('0x3c')]);_0x11b3e1[_0x3f60('0x3e')]=_[_0x3f60('0x4f')](_0x11b3e1['model'],_0x11b3e1[_0x3f60('0x3c')]);_0x38a6d3[_0x3f60('0x40')]=_['intersection'](_0x11b3e1[_0x3f60('0x3f')],qs[_0x3f60('0x41')](_0x4d5cd7[_0x3f60('0x3c')][_0x3f60('0x41')]));_0x38a6d3[_0x3f60('0x40')]=_0x38a6d3['attributes'][_0x3f60('0x50')]?_0x38a6d3[_0x3f60('0x40')]:_0x11b3e1[_0x3f60('0x3f')];if(!_0x4d5cd7[_0x3f60('0x3c')][_0x3f60('0x5f')](_0x3f60('0x42'))){_0x38a6d3['limit']=qs['limit'](_0x4d5cd7['query']['limit']);_0x38a6d3[_0x3f60('0x43')]=qs['offset'](_0x4d5cd7['query']['offset']);}_0x38a6d3[_0x3f60('0x60')]=qs[_0x3f60('0x44')](_0x4d5cd7[_0x3f60('0x3c')][_0x3f60('0x44')]);_0x38a6d3[_0x3f60('0x45')]=qs[_0x3f60('0x3e')](_[_0x3f60('0x46')](_0x4d5cd7[_0x3f60('0x3c')],_0x11b3e1[_0x3f60('0x3e')]));_0x38a6d3['where'][_0x3f60('0x61')]=_0x51aa38['id'];if(_0x4d5cd7[_0x3f60('0x3c')][_0x3f60('0x2e')]){_0x38a6d3['where']=_[_0x3f60('0x47')](_0x38a6d3[_0x3f60('0x45')],{'$or':_[_0x3f60('0x30')](_0x38a6d3[_0x3f60('0x40')],function(_0x25e1f3){var _0x30c0f2={};_0x30c0f2[_0x25e1f3]={'$like':'%'+_0x4d5cd7['query'][_0x3f60('0x2e')]+'%'};return _0x30c0f2;})});}_0x38a6d3=_[_0x3f60('0x47')]({},_0x38a6d3,_0x4d5cd7['options']);return db['CmHopperHistory'][_0x3f60('0x22')]({'where':_0x38a6d3[_0x3f60('0x45')]})[_0x3f60('0x28')](function(_0x45f896){_0x37ed84[_0x3f60('0x22')]=_0x45f896;if(_0x4d5cd7['query']['includeAll']){_0x38a6d3[_0x3f60('0x4b')]=[{'all':!![]}];}return db[_0x3f60('0x65')][_0x3f60('0x62')](_0x38a6d3);})[_0x3f60('0x28')](function(_0x39a6fa){_0x37ed84[_0x3f60('0x63')]=_0x39a6fa;return _0x37ed84;});}})[_0x3f60('0x28')](respondWithFilteredResult(_0x438084,_0x38a6d3))[_0x3f60('0x4c')](handleError(_0x438084,null));};exports['getHopperFinals']=function(_0x9b8949,_0x7cf08a,_0x22fa44){var _0x18eaaa={'raw':!![],'where':{}};var _0x4d6c6f={};var _0x25fb62={'count':0x0,'rows':[]};return db[_0x3f60('0x49')][_0x3f60('0x66')]({'where':{'id':_0x9b8949[_0x3f60('0x4e')]['id']}})[_0x3f60('0x28')](handleEntityNotFound(_0x7cf08a,null))[_0x3f60('0x28')](function(_0x2b427e){if(_0x2b427e){_0x4d6c6f[_0x3f60('0x3f')]=_[_0x3f60('0x3d')](db[_0x3f60('0x67')]['rawAttributes']);_0x4d6c6f[_0x3f60('0x3c')]=_[_0x3f60('0x3d')](_0x9b8949[_0x3f60('0x3c')]);_0x4d6c6f[_0x3f60('0x3e')]=_['intersection'](_0x4d6c6f[_0x3f60('0x3f')],_0x4d6c6f[_0x3f60('0x3c')]);_0x18eaaa[_0x3f60('0x40')]=_[_0x3f60('0x4f')](_0x4d6c6f['model'],qs['fields'](_0x9b8949[_0x3f60('0x3c')][_0x3f60('0x41')]));_0x18eaaa[_0x3f60('0x40')]=_0x18eaaa[_0x3f60('0x40')][_0x3f60('0x50')]?_0x18eaaa[_0x3f60('0x40')]:_0x4d6c6f[_0x3f60('0x3f')];if(!_0x9b8949[_0x3f60('0x3c')][_0x3f60('0x5f')](_0x3f60('0x42'))){_0x18eaaa[_0x3f60('0x21')]=qs[_0x3f60('0x21')](_0x9b8949[_0x3f60('0x3c')]['limit']);_0x18eaaa['offset']=qs['offset'](_0x9b8949['query'][_0x3f60('0x43')]);}_0x18eaaa['order']=qs['sort'](_0x9b8949[_0x3f60('0x3c')][_0x3f60('0x44')]);_0x18eaaa['where']=qs[_0x3f60('0x3e')](_[_0x3f60('0x46')](_0x9b8949['query'],_0x4d6c6f[_0x3f60('0x3e')]));_0x18eaaa[_0x3f60('0x45')][_0x3f60('0x61')]=_0x2b427e['id'];if(_0x9b8949[_0x3f60('0x3c')]['filter']){_0x18eaaa[_0x3f60('0x45')]=_[_0x3f60('0x47')](_0x18eaaa[_0x3f60('0x45')],{'$or':_[_0x3f60('0x30')](_0x18eaaa[_0x3f60('0x40')],function(_0x17050f){var _0x2b4711={};_0x2b4711[_0x17050f]={'$like':'%'+_0x9b8949[_0x3f60('0x3c')][_0x3f60('0x2e')]+'%'};return _0x2b4711;})});}_0x18eaaa=_[_0x3f60('0x47')]({},_0x18eaaa,_0x9b8949['options']);return db[_0x3f60('0x67')][_0x3f60('0x22')]({'where':_0x18eaaa[_0x3f60('0x45')]})['then'](function(_0x1ceb8a){_0x25fb62[_0x3f60('0x22')]=_0x1ceb8a;if(_0x9b8949['query'][_0x3f60('0x4a')]){_0x18eaaa[_0x3f60('0x4b')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x3f60('0x62')](_0x18eaaa);})[_0x3f60('0x28')](function(_0x14659c){_0x25fb62[_0x3f60('0x63')]=_0x14659c;return _0x25fb62;});}})[_0x3f60('0x28')](respondWithFilteredResult(_0x7cf08a,_0x18eaaa))['catch'](handleError(_0x7cf08a,null));};exports[_0x3f60('0x68')]=function(_0x5cde2f,_0x3aa1af,_0x4f20ae){var _0x5315bb={'raw':!![],'where':{}};var _0x312be7={};var _0x40c2ae={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x3f60('0x66')]({'where':{'id':_0x5cde2f['params']['id']}})[_0x3f60('0x28')](handleEntityNotFound(_0x3aa1af,null))[_0x3f60('0x28')](function(_0x4715f9){if(_0x4715f9){_0x312be7[_0x3f60('0x3f')]=_[_0x3f60('0x3d')](db[_0x3f60('0x69')][_0x3f60('0x3a')]);_0x312be7['query']=_[_0x3f60('0x3d')](_0x5cde2f[_0x3f60('0x3c')]);_0x312be7['filters']=_[_0x3f60('0x4f')](_0x312be7[_0x3f60('0x3f')],_0x312be7[_0x3f60('0x3c')]);_0x5315bb['attributes']=_[_0x3f60('0x4f')](_0x312be7['model'],qs[_0x3f60('0x41')](_0x5cde2f['query'][_0x3f60('0x41')]));_0x5315bb[_0x3f60('0x40')]=_0x5315bb[_0x3f60('0x40')]['length']?_0x5315bb[_0x3f60('0x40')]:_0x312be7[_0x3f60('0x3f')];if(!_0x5cde2f[_0x3f60('0x3c')][_0x3f60('0x5f')](_0x3f60('0x42'))){_0x5315bb[_0x3f60('0x21')]=qs[_0x3f60('0x21')](_0x5cde2f[_0x3f60('0x3c')][_0x3f60('0x21')]);_0x5315bb[_0x3f60('0x43')]=qs['offset'](_0x5cde2f['query'][_0x3f60('0x43')]);}_0x5315bb[_0x3f60('0x60')]=qs[_0x3f60('0x44')](_0x5cde2f[_0x3f60('0x3c')][_0x3f60('0x44')]);_0x5315bb[_0x3f60('0x45')]=qs[_0x3f60('0x3e')](_[_0x3f60('0x46')](_0x5cde2f[_0x3f60('0x3c')],_0x312be7[_0x3f60('0x3e')]));_0x5315bb['where'][_0x3f60('0x61')]=_0x4715f9['id'];if(_0x5cde2f[_0x3f60('0x3c')][_0x3f60('0x2e')]){_0x5315bb[_0x3f60('0x45')]=_[_0x3f60('0x47')](_0x5315bb[_0x3f60('0x45')],{'$or':_[_0x3f60('0x30')](_0x5315bb['attributes'],function(_0xa0d7bd){var _0xbe8580={};_0xbe8580[_0xa0d7bd]={'$like':'%'+_0x5cde2f['query'][_0x3f60('0x2e')]+'%'};return _0xbe8580;})});}_0x5315bb=_[_0x3f60('0x47')]({},_0x5315bb,_0x5cde2f[_0x3f60('0x48')]);return db[_0x3f60('0x69')][_0x3f60('0x22')]({'where':_0x5315bb[_0x3f60('0x45')]})[_0x3f60('0x28')](function(_0x28544e){_0x40c2ae['count']=_0x28544e;if(_0x5cde2f[_0x3f60('0x3c')]['includeAll']){_0x5315bb[_0x3f60('0x4b')]=[{'all':!![]}];}return db[_0x3f60('0x69')][_0x3f60('0x62')](_0x5315bb);})[_0x3f60('0x28')](function(_0x24d356){_0x40c2ae[_0x3f60('0x63')]=_0x24d356;return _0x40c2ae;});}})[_0x3f60('0x28')](respondWithFilteredResult(_0x3aa1af,_0x5315bb))[_0x3f60('0x4c')](handleError(_0x3aa1af,null));};exports[_0x3f60('0x6a')]=function(_0x435111,_0x37a06f,_0x2acd37){var _0x2a3296={};var _0x195a81={};var _0x5777a4;var _0x4743d9;return db[_0x3f60('0x49')][_0x3f60('0x66')]({'where':{'id':_0x435111['params']['id']}})[_0x3f60('0x28')](handleEntityNotFound(_0x37a06f,null))['then'](function(_0x4876db){if(_0x4876db){_0x5777a4=_0x4876db;_0x195a81[_0x3f60('0x3f')]=_['keys'](db['Team'][_0x3f60('0x3a')]);_0x195a81[_0x3f60('0x3c')]=_[_0x3f60('0x3d')](_0x435111[_0x3f60('0x3c')]);_0x195a81['filters']=_['intersection'](_0x195a81[_0x3f60('0x3f')],_0x195a81[_0x3f60('0x3c')]);_0x2a3296['attributes']=_[_0x3f60('0x4f')](_0x195a81[_0x3f60('0x3f')],qs['fields'](_0x435111[_0x3f60('0x3c')][_0x3f60('0x41')]));_0x2a3296[_0x3f60('0x40')]=_0x2a3296[_0x3f60('0x40')][_0x3f60('0x50')]?_0x2a3296[_0x3f60('0x40')]:_0x195a81[_0x3f60('0x3f')];_0x2a3296[_0x3f60('0x60')]=qs['sort'](_0x435111['query'][_0x3f60('0x44')]);_0x2a3296[_0x3f60('0x45')]=qs[_0x3f60('0x3e')](_['pick'](_0x435111[_0x3f60('0x3c')],_0x195a81['filters']));if(_0x435111['query'][_0x3f60('0x2e')]){_0x2a3296[_0x3f60('0x45')]=_['merge'](_0x2a3296[_0x3f60('0x45')],{'$or':_['map'](_0x2a3296[_0x3f60('0x40')],function(_0x4f020a){var _0xe8fbdf={};_0xe8fbdf[_0x4f020a]={'$like':'%'+_0x435111[_0x3f60('0x3c')]['filter']+'%'};return _0xe8fbdf;})});}_0x2a3296=_['merge']({},_0x2a3296,_0x435111['options']);return _0x5777a4['getTeams'](_0x2a3296);}})[_0x3f60('0x28')](function(_0x3f54ff){if(_0x3f54ff){_0x4743d9=_0x3f54ff[_0x3f60('0x50')];if(!_0x435111[_0x3f60('0x3c')][_0x3f60('0x5f')](_0x3f60('0x42'))){_0x2a3296[_0x3f60('0x21')]=qs['limit'](_0x435111['query'][_0x3f60('0x21')]);_0x2a3296[_0x3f60('0x43')]=qs['offset'](_0x435111[_0x3f60('0x3c')]['offset']);}return _0x5777a4[_0x3f60('0x6a')](_0x2a3296);}})[_0x3f60('0x28')](function(_0x458a10){if(_0x458a10){return _0x458a10?{'count':_0x4743d9,'rows':_0x458a10}:null;}})['then'](respondWithResult(_0x37a06f,null))['catch'](handleError(_0x37a06f,null));};exports[_0x3f60('0x6b')]=function(_0x5eb441,_0x1144e6,_0x36169d){var _0x37f0c4=_0x5eb441[_0x3f60('0x52')][_0x3f60('0x6c')];var _0x478a0b=_['map'](_0x37f0c4,'id');return db[_0x3f60('0x6d')][_0x3f60('0x62')]({'where':{'id':_0x478a0b},'attributes':['id'],'include':[{'model':db[_0x3f60('0x6e')],'as':'Agents','attributes':['id','name',_0x3f60('0x6f'),'voicePause',_0x3f60('0x70')],'raw':!![]}]})[_0x3f60('0x28')](function(_0x599ed6){if(_0x599ed6){var _0x242a6e=_[_0x3f60('0x71')](_0x599ed6,function(_0x5c4b36){var _0x4f21f6=_0x5c4b36['get']({'plain':!![]});_0x4f21f6[_0x3f60('0x72')][_0x3f60('0x73')](function(_0x5e0c61){_0x5e0c61[_0x3f60('0x74')]=_['find'](_0x37f0c4,{'id':_0x4f21f6['id']})['penalty'];});return _0x4f21f6[_0x3f60('0x72')];});return db['VoiceQueue'][_0x3f60('0x34')]({'where':{'id':_0x5eb441[_0x3f60('0x4e')]['id']}})['then'](function(_0x3e5289){return db[_0x3f60('0x75')][_0x3f60('0x76')](function(_0x460d02){return _0x3e5289['addTeams'](_0x478a0b,{'transaction':_0x460d02})[_0x3f60('0x28')](function(){return BPromise['each'](_0x37f0c4,function(_0x64b02f){return db[_0x3f60('0x77')]['upsert']({'TeamId':_0x64b02f['id'],'VoiceQueueId':_0x5eb441[_0x3f60('0x4e')]['id'],'penalty':_0x64b02f[_0x3f60('0x74')]},{'transaction':_0x460d02});});})[_0x3f60('0x28')](function(){return BPromise[_0x3f60('0x78')](_0x242a6e,function(_0x5d79d5){return db[_0x3f60('0x79')][_0x3f60('0x7a')]({'where':{'UserId':_0x5d79d5['id'],'VoiceQueueId':_0x5eb441[_0x3f60('0x4e')]['id']},'defaults':{'penalty':_0x5d79d5[_0x3f60('0x74')]},'transaction':_0x460d02});});})['then'](function(){return BPromise[_0x3f60('0x78')](_['filter'](_0x242a6e,{'online':!![]}),function(_0x3db3b8){return db[_0x3f60('0x7b')][_0x3f60('0x7c')]({'membername':_0x3db3b8[_0x3f60('0x35')],'UserId':_0x3db3b8['id'],'queue_name':_0x3e5289['name'],'VoiceQueueId':_0x3e5289['id'],'interface':_[_0x3f60('0x7d')](_0x3db3b8['interface'])?util[_0x3f60('0x7e')](_0x3f60('0x7f'),_0x3db3b8[_0x3f60('0x35')]):_0x3db3b8[_0x3f60('0x70')],'paused':_0x3db3b8[_0x3f60('0x80')]||![],'penalty':_0x3db3b8[_0x3f60('0x74')]},{'transaction':_0x460d02});});})['then'](function(){_0x242a6e['forEach'](function(_0x53d6a4){socket[_0x3f60('0x81')](_0x3f60('0x82'),{'UserId':_0x53d6a4['id'],'VoiceQueueId':_0x3e5289['id']});});});});});}})['then'](respondWithStatusCode(_0x1144e6,null))[_0x3f60('0x4c')](handleError(_0x1144e6,null));};exports[_0x3f60('0x83')]=function(_0x3d0b8c,_0x37ecbd,_0x38c7fc){return db[_0x3f60('0x6d')]['findAll']({'where':{'id':_0x3d0b8c[_0x3f60('0x3c')][_0x3f60('0x84')]},'attributes':['id'],'include':[{'model':db[_0x3f60('0x6e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x3f60('0x28')](handleEntityNotFound(_0x37ecbd,null))[_0x3f60('0x28')](function(_0xad04c7){var _0x2c33ab=_[_0x3f60('0x30')](_0xad04c7,'id');var _0x484ed7=[];var _0xe1c7ac=[];var _0x250883=squel[_0x3f60('0x85')]();_0x250883[_0x3f60('0x86')](_0x3f60('0x87'))['from'](_0x3f60('0x88'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3f60('0x45')]('VoiceQueueId\x20=\x20?',_0x3d0b8c[_0x3f60('0x4e')]['id']);for(var _0x5d7071=0x0;_0x5d7071<_0xad04c7['length'];_0x5d7071+=0x1){let _0x114315=_0xad04c7[_0x5d7071];for(var _0x2f68b2=0x0;_0x2f68b2<_0x114315[_0x3f60('0x72')][_0x3f60('0x50')];_0x2f68b2+=0x1){let _0x26244e=_0x114315[_0x3f60('0x72')][_0x2f68b2];var _0x5323ce=_0x250883[_0x3f60('0x89')]();_0x5323ce[_0x3f60('0x45')]('ut.UserId\x20=\x20?',_0x26244e['id']);_0xe1c7ac[_0x3f60('0x8a')](db[_0x3f60('0x75')]['query'](_0x5323ce[_0x3f60('0x8b')](),{'type':db[_0x3f60('0x75')][_0x3f60('0x8c')][_0x3f60('0x8d')]})['then'](function(_0x4ac864){if(_0x4ac864['length']===0x1){return _0x26244e['id'];}else{var _0x29b5b7=_[_0x3f60('0x8e')](_[_0x3f60('0x30')](_0x4ac864,'TeamId'),function(_0xe98cb8){return _[_0x3f60('0x32')](_0x2c33ab,_0xe98cb8);});if(_0x29b5b7){return _0x26244e['id'];}}}));}}return BPromise[_0x3f60('0x8f')](_0xe1c7ac)[_0x3f60('0x28')](function(_0x7f8774){_0x484ed7=_(_0x484ed7)['union'](_0x7f8774)[_0x3f60('0x90')]()[_0x3f60('0x31')]();return db[_0x3f60('0x49')][_0x3f60('0x34')]({'where':{'id':_0x3d0b8c[_0x3f60('0x4e')]['id']}})[_0x3f60('0x28')](function(_0x3217c1){return db[_0x3f60('0x75')][_0x3f60('0x76')](function(_0x3020cd){return _0x3217c1['removeTeams'](_0x3d0b8c[_0x3f60('0x3c')][_0x3f60('0x84')],{'transaction':_0x3020cd})[_0x3f60('0x28')](function(){if(!_['isEmpty'](_0x484ed7)){return _0x3217c1['removeAgents'](_0x484ed7,{'transaction':_0x3020cd})[_0x3f60('0x28')](function(){return db[_0x3f60('0x7b')][_0x3f60('0x29')]({'where':{'VoiceQueueId':_0x3d0b8c[_0x3f60('0x4e')]['id'],'UserId':_0x484ed7},'transaction':_0x3020cd});});}})['then'](function(){_0x484ed7[_0x3f60('0x73')](function(_0x4bea74){socket[_0x3f60('0x81')](_0x3f60('0x91'),{'UserId':_0x4bea74,'VoiceQueueId':_0x3217c1['id']});});});});});});})[_0x3f60('0x28')](respondWithStatusCode(_0x37ecbd,null))[_0x3f60('0x4c')](handleError(_0x37ecbd,null));};exports[_0x3f60('0x92')]=function(_0x8844d,_0x489e77,_0x3d2d6c){var _0x11c5fb,_0x41fd84;return db[_0x3f60('0x49')]['find']({'where':{'id':_0x8844d[_0x3f60('0x4e')]['id']}})[_0x3f60('0x28')](handleEntityNotFound(_0x489e77,null))['then'](function(_0x121518){if(_0x121518){_0x41fd84=_0x121518;return _0x121518[_0x3f60('0x92')](_0x8844d[_0x3f60('0x52')][_0x3f60('0x84')],_[_0x3f60('0x5b')](_0x8844d[_0x3f60('0x52')],['ids','id'])||{})[_0x3f60('0x93')](function(_0x3143b0){for(var _0xa27a93=0x0;_0xa27a93<_0x8844d['body'][_0x3f60('0x84')][_0x3f60('0x50')];_0xa27a93+=0x1){socket[_0x3f60('0x81')](_0x3f60('0x82'),{'UserId':Number(_0x8844d[_0x3f60('0x52')][_0x3f60('0x84')][_0xa27a93]),'VoiceQueueId':Number(_0x8844d[_0x3f60('0x4e')]['id'])});}return _0x3143b0;});}})[_0x3f60('0x28')](function(_0x262647){_0x11c5fb=_0x262647||[];if(_0x41fd84){return db[_0x3f60('0x6e')][_0x3f60('0x62')]({'where':{'id':_0x8844d[_0x3f60('0x52')][_0x3f60('0x84')]},'attributes':['id',_0x3f60('0x35'),_0x3f60('0x6f'),_0x3f60('0x80'),_0x3f60('0x70')],'raw':!![]});}})[_0x3f60('0x28')](function(_0x4037a1){if(!_['isEmpty'](_0x4037a1)){var _0x45d28c=[];for(var _0x594c3e=0x0;_0x594c3e<_0x4037a1[_0x3f60('0x50')];_0x594c3e++){if(_0x4037a1[_0x594c3e]['online']){_0x45d28c[_0x3f60('0x8a')](db['UserVoiceQueueRt'][_0x3f60('0x7c')]({'membername':_0x4037a1[_0x594c3e][_0x3f60('0x35')],'UserId':_0x4037a1[_0x594c3e]['id'],'queue_name':_0x41fd84[_0x3f60('0x35')],'VoiceQueueId':_0x41fd84['id'],'interface':_[_0x3f60('0x7d')](_0x4037a1[_0x594c3e]['interface'])?util[_0x3f60('0x7e')](_0x3f60('0x7f'),_0x4037a1[_0x594c3e][_0x3f60('0x35')]):_0x4037a1[_0x594c3e][_0x3f60('0x70')],'paused':_0x4037a1[_0x594c3e]['voicePause']||![],'penalty':_0x8844d[_0x3f60('0x52')][_0x3f60('0x74')]||0x0}));}}return BPromise['all'](_0x45d28c);}})[_0x3f60('0x28')](function(){return _0x11c5fb;})[_0x3f60('0x28')](respondWithResult(_0x489e77,null))['catch'](handleError(_0x489e77,null));};exports[_0x3f60('0x94')]=function(_0x1c1a64,_0x38922a,_0x98e7c4){return db['VoiceQueue']['find']({'where':{'id':_0x1c1a64[_0x3f60('0x4e')]['id']}})['then'](handleEntityNotFound(_0x38922a,null))[_0x3f60('0x28')](function(_0x1e9b04){if(_0x1e9b04){return _0x1e9b04[_0x3f60('0x94')](_0x1c1a64['query'][_0x3f60('0x84')])[_0x3f60('0x28')](function(){if(_['isArray'](_0x1c1a64[_0x3f60('0x3c')][_0x3f60('0x84')])){for(var _0x10428e=0x0;_0x10428e<_0x1c1a64['query'][_0x3f60('0x84')][_0x3f60('0x50')];_0x10428e+=0x1){socket['emit'](_0x3f60('0x91'),{'UserId':Number(_0x1c1a64[_0x3f60('0x3c')]['ids'][_0x10428e]),'VoiceQueueId':Number(_0x1c1a64[_0x3f60('0x4e')]['id'])});}}else{socket[_0x3f60('0x81')](_0x3f60('0x91'),{'UserId':Number(_0x1c1a64[_0x3f60('0x3c')][_0x3f60('0x84')]),'VoiceQueueId':Number(_0x1c1a64['params']['id'])});}});}})[_0x3f60('0x28')](function(_0x316964){return db[_0x3f60('0x7b')]['destroy']({'where':{'VoiceQueueId':_0x1c1a64[_0x3f60('0x4e')]['id'],'UserId':_0x1c1a64[_0x3f60('0x3c')]['ids']}})[_0x3f60('0x28')](function(){return _0x316964;});})[_0x3f60('0x28')](respondWithStatusCode(_0x38922a,null))['catch'](handleError(_0x38922a,null));};exports[_0x3f60('0x95')]=function(_0xe78b93,_0x33273c,_0x5598cb){var _0x14a0db={};var _0x5a4f01={};var _0x48ff63;var _0x4e83d9;return db[_0x3f60('0x49')][_0x3f60('0x66')]({'where':{'id':_0xe78b93[_0x3f60('0x4e')]['id']}})[_0x3f60('0x28')](handleEntityNotFound(_0x33273c,null))[_0x3f60('0x28')](function(_0x3e9ec9){if(_0x3e9ec9){_0x48ff63=_0x3e9ec9;_0x5a4f01[_0x3f60('0x3f')]=_['keys'](db[_0x3f60('0x6e')][_0x3f60('0x3a')]);_0x5a4f01['query']=_[_0x3f60('0x3d')](_0xe78b93[_0x3f60('0x3c')]);_0x5a4f01[_0x3f60('0x3e')]=_[_0x3f60('0x4f')](_0x5a4f01[_0x3f60('0x3f')],_0x5a4f01[_0x3f60('0x3c')]);_0x14a0db[_0x3f60('0x40')]=_[_0x3f60('0x4f')](_0x5a4f01[_0x3f60('0x3f')],qs['fields'](_0xe78b93[_0x3f60('0x3c')]['fields']));_0x14a0db[_0x3f60('0x40')]=_0x14a0db[_0x3f60('0x40')][_0x3f60('0x50')]?_0x14a0db[_0x3f60('0x40')]:_0x5a4f01[_0x3f60('0x3f')];_0x14a0db[_0x3f60('0x60')]=qs[_0x3f60('0x44')](_0xe78b93['query'][_0x3f60('0x44')]);_0x14a0db[_0x3f60('0x45')]=qs['filters'](_['pick'](_0xe78b93[_0x3f60('0x3c')],_0x5a4f01[_0x3f60('0x3e')]));if(_0xe78b93[_0x3f60('0x3c')][_0x3f60('0x2e')]){_0x14a0db[_0x3f60('0x45')]=_[_0x3f60('0x47')](_0x14a0db[_0x3f60('0x45')],{'$or':_[_0x3f60('0x30')](_0x14a0db[_0x3f60('0x40')],function(_0x11b081){var _0x39be80={};_0x39be80[_0x11b081]={'$like':'%'+_0xe78b93[_0x3f60('0x3c')]['filter']+'%'};return _0x39be80;})});}_0x14a0db=_[_0x3f60('0x47')]({},_0x14a0db,_0xe78b93[_0x3f60('0x48')]);return _0x48ff63[_0x3f60('0x95')](_0x14a0db);}})[_0x3f60('0x28')](function(_0x5e2dbb){if(_0x5e2dbb){_0x4e83d9=_0x5e2dbb[_0x3f60('0x50')];if(!_0xe78b93['query'][_0x3f60('0x5f')](_0x3f60('0x42'))){_0x14a0db[_0x3f60('0x21')]=qs[_0x3f60('0x21')](_0xe78b93[_0x3f60('0x3c')][_0x3f60('0x21')]);_0x14a0db[_0x3f60('0x43')]=qs[_0x3f60('0x43')](_0xe78b93[_0x3f60('0x3c')][_0x3f60('0x43')]);}return _0x48ff63[_0x3f60('0x95')](_0x14a0db);}})[_0x3f60('0x28')](function(_0x116748){if(_0x116748){return _0x116748?{'count':_0x4e83d9,'rows':_0x116748}:null;}})['then'](respondWithResult(_0x33273c,null))[_0x3f60('0x4c')](handleError(_0x33273c,null));};exports[_0x3f60('0x96')]=function(_0x1b219c,_0x2d444b,_0x3e681d){var _0x39a88e={};var _0x18c3fd={};var _0x20cfcf;var _0x4d8301;return db[_0x3f60('0x49')][_0x3f60('0x66')]({'where':{'id':_0x1b219c[_0x3f60('0x4e')]['id']}})[_0x3f60('0x28')](handleEntityNotFound(_0x2d444b,null))['then'](function(_0x4a91e9){if(_0x4a91e9){_0x20cfcf=_0x4a91e9;_0x18c3fd[_0x3f60('0x3f')]=_[_0x3f60('0x3d')](db[_0x3f60('0x7b')][_0x3f60('0x3a')]);_0x18c3fd[_0x3f60('0x3c')]=_[_0x3f60('0x3d')](_0x1b219c[_0x3f60('0x3c')]);_0x18c3fd[_0x3f60('0x3e')]=_[_0x3f60('0x4f')](_0x18c3fd[_0x3f60('0x3f')],_0x18c3fd[_0x3f60('0x3c')]);_0x39a88e[_0x3f60('0x40')]=_['intersection'](_0x18c3fd[_0x3f60('0x3f')],qs[_0x3f60('0x41')](_0x1b219c['query'][_0x3f60('0x41')]));_0x39a88e[_0x3f60('0x40')]=_0x39a88e[_0x3f60('0x40')]['length']?_0x39a88e[_0x3f60('0x40')]:_0x18c3fd[_0x3f60('0x3f')];_0x39a88e['order']=qs[_0x3f60('0x44')](_0x1b219c[_0x3f60('0x3c')][_0x3f60('0x44')]);_0x39a88e[_0x3f60('0x45')]=qs['filters'](_[_0x3f60('0x46')](_0x1b219c[_0x3f60('0x3c')],_0x18c3fd[_0x3f60('0x3e')]));if(_0x1b219c[_0x3f60('0x3c')][_0x3f60('0x2e')]){_0x39a88e[_0x3f60('0x45')]=_['merge'](_0x39a88e['where'],{'$or':_[_0x3f60('0x30')](_0x39a88e['attributes'],function(_0x3cdee4){var _0x586932={};_0x586932[_0x3cdee4]={'$like':'%'+_0x1b219c['query'][_0x3f60('0x2e')]+'%'};return _0x586932;})});}_0x39a88e=_[_0x3f60('0x47')]({},_0x39a88e,_0x1b219c['options']);return _0x20cfcf[_0x3f60('0x96')](_0x39a88e);}})[_0x3f60('0x28')](function(_0x1a4136){if(_0x1a4136){_0x4d8301=_0x1a4136[_0x3f60('0x50')];if(!_0x1b219c[_0x3f60('0x3c')]['hasOwnProperty'](_0x3f60('0x42'))){_0x39a88e[_0x3f60('0x21')]=qs[_0x3f60('0x21')](_0x1b219c[_0x3f60('0x3c')][_0x3f60('0x21')]);_0x39a88e[_0x3f60('0x43')]=qs[_0x3f60('0x43')](_0x1b219c[_0x3f60('0x3c')]['offset']);}return _0x20cfcf[_0x3f60('0x96')](_0x39a88e);}})[_0x3f60('0x28')](function(_0x4fb1a7){return _0x4fb1a7?{'count':_0x4d8301,'rows':_0x4fb1a7}:null;})['then'](respondWithResult(_0x2d444b,null))[_0x3f60('0x4c')](handleError(_0x2d444b,null));};exports['getLists']=function(_0x476bb0,_0x5751cb,_0x362e04){var _0x442671={};var _0x357999={};var _0x23223e;var _0x41b903;return db[_0x3f60('0x49')]['findOne']({'where':{'id':_0x476bb0[_0x3f60('0x4e')]['id']}})[_0x3f60('0x28')](handleEntityNotFound(_0x5751cb,null))[_0x3f60('0x28')](function(_0xda6687){if(_0xda6687){_0x23223e=_0xda6687;_0x357999[_0x3f60('0x3f')]=_[_0x3f60('0x3d')](db[_0x3f60('0x97')][_0x3f60('0x3a')]);_0x357999[_0x3f60('0x3c')]=_[_0x3f60('0x3d')](_0x476bb0[_0x3f60('0x3c')]);_0x357999['filters']=_[_0x3f60('0x4f')](_0x357999[_0x3f60('0x3f')],_0x357999[_0x3f60('0x3c')]);_0x442671[_0x3f60('0x40')]=_[_0x3f60('0x4f')](_0x357999[_0x3f60('0x3f')],qs[_0x3f60('0x41')](_0x476bb0[_0x3f60('0x3c')][_0x3f60('0x41')]));_0x442671['attributes']=_0x442671[_0x3f60('0x40')][_0x3f60('0x50')]?_0x442671[_0x3f60('0x40')]:_0x357999[_0x3f60('0x3f')];_0x442671['order']=qs[_0x3f60('0x44')](_0x476bb0['query'][_0x3f60('0x44')]);_0x442671['where']=qs[_0x3f60('0x3e')](_[_0x3f60('0x46')](_0x476bb0[_0x3f60('0x3c')],_0x357999[_0x3f60('0x3e')]));if(_0x476bb0[_0x3f60('0x3c')]['filter']){_0x442671[_0x3f60('0x45')]=_['merge'](_0x442671[_0x3f60('0x45')],{'$or':_[_0x3f60('0x30')](_0x442671[_0x3f60('0x40')],function(_0x17f411){var _0x3e7883={};_0x3e7883[_0x17f411]={'$like':'%'+_0x476bb0[_0x3f60('0x3c')][_0x3f60('0x2e')]+'%'};return _0x3e7883;})});}_0x442671=_[_0x3f60('0x47')]({},_0x442671,_0x476bb0[_0x3f60('0x48')]);return _0x23223e['getLists'](_0x442671);}})[_0x3f60('0x28')](function(_0x17a629){if(_0x17a629){_0x41b903=_0x17a629['length'];if(!_0x476bb0[_0x3f60('0x3c')][_0x3f60('0x5f')](_0x3f60('0x42'))){_0x442671[_0x3f60('0x21')]=qs[_0x3f60('0x21')](_0x476bb0[_0x3f60('0x3c')][_0x3f60('0x21')]);_0x442671[_0x3f60('0x43')]=qs[_0x3f60('0x43')](_0x476bb0[_0x3f60('0x3c')]['offset']);}return _0x23223e[_0x3f60('0x98')](_0x442671);}})[_0x3f60('0x28')](function(_0x22446e){if(_0x22446e){return _0x22446e?{'count':_0x41b903,'rows':_0x22446e}:null;}})[_0x3f60('0x28')](respondWithResult(_0x5751cb,null))[_0x3f60('0x4c')](handleError(_0x5751cb,null));};exports[_0x3f60('0x99')]=function(_0x1401c0,_0x61c416,_0x1e713a){var _0x25994b=moment()[_0x3f60('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');var _0x35697f,_0x3ac401;return db['VoiceQueue'][_0x3f60('0x34')]({'where':{'id':_0x1401c0['params']['id']}})['then'](handleEntityNotFound(_0x61c416,null))[_0x3f60('0x28')](function(_0x1c3f60){if(_0x1c3f60){_0x3ac401=_0x1c3f60;return _0x1c3f60[_0x3f60('0x99')](_0x1401c0[_0x3f60('0x52')]['ids'],_[_0x3f60('0x5b')](_0x1401c0[_0x3f60('0x52')],[_0x3f60('0x84'),'id'])||{});}return null;})[_0x3f60('0x93')](function(_0x3b8c60){var _0x368fd9;_0x35697f=_0x3b8c60||[];var _0x402c43=[];if(_0x3b8c60){for(var _0x307763=0x0;_0x307763<_0x3b8c60[_0x3f60('0x50')];_0x307763+=0x1){var _0x322d11=_0x3b8c60[_0x307763][_0x3f60('0x53')]({'plain':!![]});_0x3ac401['dialCheckDuplicateType']=_0x1401c0['body'][_0x3f60('0x9a')]?_0x1401c0[_0x3f60('0x52')][_0x3f60('0x9a')]:_0x3ac401['dialCheckDuplicateType'];switch(_0x3ac401['dialCheckDuplicateType']){case _0x3f60('0x9b'):_0x368fd9=squel['insert']()[_0x3f60('0x9c')](_0x3f60('0x9d'))[_0x3f60('0x9e')]([_0x3f60('0x9f'),_0x3f60('0xa0'),_0x3f60('0xa1'),_0x3f60('0xa2'),_0x3f60('0x61'),_0x3f60('0x5a'),_0x3f60('0xa3')],squel['select']()['field']('phone','phone')[_0x3f60('0x86')]('\x27'+_0x25994b+'\x27','scheduledAt')[_0x3f60('0x86')]('id',_0x3f60('0xa1'))[_0x3f60('0x86')](_0x322d11['CmListId'][_0x3f60('0x8b')](),_0x3f60('0xa2'))['field'](_0x1401c0[_0x3f60('0x4e')]['id'][_0x3f60('0x8b')](),'VoiceQueueId')[_0x3f60('0x86')]('\x27'+_0x25994b+'\x27','createdAt')[_0x3f60('0x86')]('\x27'+_0x25994b+'\x27','updatedAt')[_0x3f60('0xa4')](_0x3f60('0xa5'))['where'](_0x3f60('0xa6'))[_0x3f60('0x45')]('ListId\x20=\x20?',_0x322d11[_0x3f60('0xa7')]['toString']())['where'](_0x3f60('0xa8'))['where'](_0x3f60('0xa9'),squel[_0x3f60('0x85')]()['field'](_0x3f60('0xaa'))[_0x3f60('0xa4')]('cm_hopper_final')[_0x3f60('0x45')](_0x3f60('0xab'),_0x1401c0[_0x3f60('0x4e')]['id'][_0x3f60('0x8b')]()))[_0x3f60('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3f60('0x85')]()[_0x3f60('0x86')]('COALESCE(phone,\x27\x27)')[_0x3f60('0xa4')]('cm_hopper')[_0x3f60('0x45')]('VoiceQueueId\x20=\x20?',_0x1401c0[_0x3f60('0x4e')]['id'][_0x3f60('0x8b')]())))[_0x3f60('0x8b')]();break;case _0x3f60('0xac'):_0x368fd9=squel[_0x3f60('0xad')]()['into'](_0x3f60('0x9d'))[_0x3f60('0x9e')]([_0x3f60('0x9f'),_0x3f60('0xa0'),'ContactId',_0x3f60('0xa2'),_0x3f60('0x61'),_0x3f60('0x5a'),_0x3f60('0xa3')],squel[_0x3f60('0x85')]()[_0x3f60('0x86')](_0x3f60('0x9f'),_0x3f60('0x9f'))[_0x3f60('0x86')]('\x27'+_0x25994b+'\x27',_0x3f60('0xa0'))[_0x3f60('0x86')]('id',_0x3f60('0xa1'))[_0x3f60('0x86')](_0x322d11[_0x3f60('0xa7')]['toString'](),'ListId')[_0x3f60('0x86')](_0x1401c0[_0x3f60('0x4e')]['id'][_0x3f60('0x8b')](),_0x3f60('0x61'))[_0x3f60('0x86')]('\x27'+_0x25994b+'\x27',_0x3f60('0x5a'))['field']('\x27'+_0x25994b+'\x27',_0x3f60('0xa3'))[_0x3f60('0xa4')](_0x3f60('0xa5'))[_0x3f60('0x45')](_0x3f60('0xa6'))['where'](_0x3f60('0xae'),_0x322d11[_0x3f60('0xa7')]['toString']())['where'](_0x3f60('0xa8'))['where'](_0x3f60('0xa9'),squel['select']()[_0x3f60('0x86')]('COALESCE(phone,\x27\x27)')[_0x3f60('0xa4')](_0x3f60('0x9d'))[_0x3f60('0x45')](_0x3f60('0xab'),_0x1401c0['params']['id'][_0x3f60('0x8b')]())))['toString']();break;default:_0x368fd9=squel[_0x3f60('0xad')]()[_0x3f60('0x9c')](_0x3f60('0x9d'))[_0x3f60('0x9e')]([_0x3f60('0x9f'),'scheduledAt',_0x3f60('0xa1'),_0x3f60('0xa2'),_0x3f60('0x61'),_0x3f60('0x5a'),_0x3f60('0xa3')],squel['select']()[_0x3f60('0x86')](_0x3f60('0x9f'),_0x3f60('0x9f'))['field']('\x27'+_0x25994b+'\x27',_0x3f60('0xa0'))[_0x3f60('0x86')]('id',_0x3f60('0xa1'))[_0x3f60('0x86')](_0x322d11['CmListId']['toString'](),_0x3f60('0xa2'))[_0x3f60('0x86')](_0x1401c0[_0x3f60('0x4e')]['id']['toString'](),_0x3f60('0x61'))[_0x3f60('0x86')]('\x27'+_0x25994b+'\x27','createdAt')[_0x3f60('0x86')]('\x27'+_0x25994b+'\x27',_0x3f60('0xa3'))[_0x3f60('0xa4')]('cm_contacts')[_0x3f60('0x45')]('deletedAt\x20IS\x20NULL')[_0x3f60('0x45')](_0x3f60('0xae'),_0x322d11[_0x3f60('0xa7')][_0x3f60('0x8b')]())[_0x3f60('0x45')](_0x3f60('0xa8')))['toString']();}_0x402c43[_0x3f60('0x8a')](db[_0x3f60('0x75')]['query'](_0x368fd9));}return BPromise[_0x3f60('0x8f')](_0x402c43);}})[_0x3f60('0x28')](function(){var _0x3278ae=[];var _0x2d608b=squel['insert']()['into'](_0x3f60('0xaf'))[_0x3f60('0x9e')](['CmHopperId',_0x3f60('0x9f'),_0x3f60('0xb0'),_0x3f60('0x5a'),_0x3f60('0xa3')],squel[_0x3f60('0x85')]()[_0x3f60('0x86')]('h.id')[_0x3f60('0x86')]('ci.item')[_0x3f60('0x86')]('ci.OrderBy+1')['field']('\x27'+_0x25994b+'\x27',_0x3f60('0x5a'))[_0x3f60('0x86')]('\x27'+_0x25994b+'\x27','updatedAt')[_0x3f60('0xa4')]('cm_contact_has_items','ci')[_0x3f60('0xb1')](_0x3f60('0x9d'),'h',_0x3f60('0xb2'))[_0x3f60('0x45')](_0x3f60('0xb3'),_0x25994b)[_0x3f60('0x45')](_0x3f60('0xb4'),_0x3f60('0xb5')))[_0x3f60('0x8b')]();_0x3278ae['push'](db['sequelize'][_0x3f60('0x3c')](_0x2d608b));return BPromise[_0x3f60('0x8f')](_0x3278ae);})['then'](function(){return _0x35697f;})[_0x3f60('0x28')](respondWithResult(_0x61c416,null))[_0x3f60('0x4c')](handleError(_0x61c416,null));};exports['removeLists']=function(_0x36f237,_0x15eea0,_0x360be4){return db[_0x3f60('0x49')][_0x3f60('0x34')]({'where':{'id':_0x36f237['params']['id']}})[_0x3f60('0x28')](handleEntityNotFound(_0x15eea0,null))[_0x3f60('0x28')](function(_0x4b168f){if(_0x4b168f){return _0x4b168f[_0x3f60('0xb6')](_0x36f237[_0x3f60('0x3c')]['ids']);}})[_0x3f60('0x28')](function(_0x365c6d){if(_0x365c6d){return db[_0x3f60('0x5e')][_0x3f60('0x29')]({'where':{'ListId':_0x36f237[_0x3f60('0x3c')]['ids'],'VoiceQueueId':_0x36f237[_0x3f60('0x4e')]['id']}})[_0x3f60('0x28')](function(){return _0x365c6d;});}})[_0x3f60('0x28')](respondWithStatusCode(_0x15eea0,null))[_0x3f60('0x4c')](handleError(_0x15eea0,null));};exports['getBlackLists']=function(_0x9b7d59,_0x1e67fe,_0x54a502){var _0x557fb5={};var _0x3f94af={};var _0x5bdae4;var _0x34f8a3;return db['VoiceQueue'][_0x3f60('0x66')]({'where':{'id':_0x9b7d59[_0x3f60('0x4e')]['id']}})[_0x3f60('0x28')](handleEntityNotFound(_0x1e67fe,null))[_0x3f60('0x28')](function(_0x3dcda9){if(_0x3dcda9){_0x5bdae4=_0x3dcda9;_0x3f94af[_0x3f60('0x3f')]=_[_0x3f60('0x3d')](db[_0x3f60('0x97')][_0x3f60('0x3a')]);_0x3f94af['query']=_[_0x3f60('0x3d')](_0x9b7d59[_0x3f60('0x3c')]);_0x3f94af[_0x3f60('0x3e')]=_[_0x3f60('0x4f')](_0x3f94af[_0x3f60('0x3f')],_0x3f94af['query']);_0x557fb5[_0x3f60('0x40')]=_['intersection'](_0x3f94af['model'],qs[_0x3f60('0x41')](_0x9b7d59[_0x3f60('0x3c')]['fields']));_0x557fb5[_0x3f60('0x40')]=_0x557fb5[_0x3f60('0x40')][_0x3f60('0x50')]?_0x557fb5['attributes']:_0x3f94af['model'];_0x557fb5['order']=qs[_0x3f60('0x44')](_0x9b7d59[_0x3f60('0x3c')][_0x3f60('0x44')]);_0x557fb5[_0x3f60('0x45')]=qs['filters'](_[_0x3f60('0x46')](_0x9b7d59[_0x3f60('0x3c')],_0x3f94af[_0x3f60('0x3e')]));if(_0x9b7d59['query']['filter']){_0x557fb5['where']=_[_0x3f60('0x47')](_0x557fb5[_0x3f60('0x45')],{'$or':_['map'](_0x557fb5[_0x3f60('0x40')],function(_0x14b2bd){var _0x54d192={};_0x54d192[_0x14b2bd]={'$like':'%'+_0x9b7d59[_0x3f60('0x3c')]['filter']+'%'};return _0x54d192;})});}_0x557fb5=_[_0x3f60('0x47')]({},_0x557fb5,_0x9b7d59[_0x3f60('0x48')]);return _0x5bdae4[_0x3f60('0xb7')](_0x557fb5);}})[_0x3f60('0x28')](function(_0x1f9509){if(_0x1f9509){_0x34f8a3=_0x1f9509[_0x3f60('0x50')];if(!_0x9b7d59[_0x3f60('0x3c')][_0x3f60('0x5f')](_0x3f60('0x42'))){_0x557fb5['limit']=qs[_0x3f60('0x21')](_0x9b7d59[_0x3f60('0x3c')]['limit']);_0x557fb5[_0x3f60('0x43')]=qs['offset'](_0x9b7d59[_0x3f60('0x3c')][_0x3f60('0x43')]);}return _0x5bdae4[_0x3f60('0xb7')](_0x557fb5);}})[_0x3f60('0x28')](function(_0x2288c7){if(_0x2288c7){return _0x2288c7?{'count':_0x34f8a3,'rows':_0x2288c7}:null;}})[_0x3f60('0x28')](respondWithResult(_0x1e67fe,null))['catch'](handleError(_0x1e67fe,null));};exports[_0x3f60('0xb8')]=function(_0x261948,_0x3272ab,_0xf54b75){var _0x10c3d2,_0x3bc18d;return db[_0x3f60('0x49')][_0x3f60('0x34')]({'where':{'id':_0x261948[_0x3f60('0x4e')]['id']}})[_0x3f60('0x28')](handleEntityNotFound(_0x3272ab,null))['then'](function(_0x5d7a54){if(_0x5d7a54){_0x3bc18d=_0x5d7a54;return _0x5d7a54[_0x3f60('0xb8')](_0x261948[_0x3f60('0x52')]['ids'],_[_0x3f60('0x5b')](_0x261948['body'],[_0x3f60('0x84'),'id'])||{});}return null;})[_0x3f60('0x93')](function(_0x412348){var _0x17388b;_0x10c3d2=_0x412348||[];var _0x322823=[];if(_0x412348){for(var _0xc24848=0x0;_0xc24848<_0x412348[_0x3f60('0x50')];_0xc24848+=0x1){var _0x20e075=_0x412348[_0xc24848]['get']({'plain':!![]});_0x17388b=squel[_0x3f60('0xad')]()['into'](_0x3f60('0xb9'))[_0x3f60('0x9e')]([_0x3f60('0x9f'),_0x3f60('0xa1'),_0x3f60('0xa2'),_0x3f60('0x61'),_0x3f60('0x5a'),_0x3f60('0xa3')],squel[_0x3f60('0x85')]()[_0x3f60('0x86')](_0x3f60('0x9f'),'phone')[_0x3f60('0x86')]('id',_0x3f60('0xa1'))[_0x3f60('0x86')](_0x20e075[_0x3f60('0xa7')][_0x3f60('0x8b')](),_0x3f60('0xa2'))['field'](_0x261948[_0x3f60('0x4e')]['id'][_0x3f60('0x8b')](),_0x3f60('0x61'))[_0x3f60('0x86')]('NOW()',_0x3f60('0x5a'))['field']('NOW()',_0x3f60('0xa3'))['from']('cm_contacts')[_0x3f60('0x45')](_0x3f60('0xa6'))[_0x3f60('0x45')](_0x3f60('0xae'),_0x20e075[_0x3f60('0xa7')][_0x3f60('0x8b')]())[_0x3f60('0x45')](_0x3f60('0xa8')))[_0x3f60('0x8b')]();_0x322823['push'](db[_0x3f60('0x75')][_0x3f60('0x3c')](_0x17388b));}return BPromise['all'](_0x322823);}})[_0x3f60('0x28')](function(){return _0x10c3d2;})['then'](respondWithResult(_0x3272ab,null))[_0x3f60('0x4c')](handleError(_0x3272ab,null));};exports[_0x3f60('0xba')]=function(_0x5b8243,_0x598edd,_0x4b2f9d){return db[_0x3f60('0x49')][_0x3f60('0x34')]({'where':{'id':_0x5b8243['params']['id']}})[_0x3f60('0x28')](handleEntityNotFound(_0x598edd,null))[_0x3f60('0x28')](function(_0x432c54){if(_0x432c54){return _0x432c54[_0x3f60('0xba')](_0x5b8243[_0x3f60('0x3c')]['ids']);}})['then'](function(_0x56cdf4){if(_0x56cdf4){return db[_0x3f60('0x69')]['destroy']({'where':{'ListId':_0x5b8243[_0x3f60('0x3c')][_0x3f60('0x84')],'VoiceQueueId':_0x5b8243['params']['id']}})[_0x3f60('0x28')](function(){return _0x56cdf4;});}})[_0x3f60('0x28')](respondWithStatusCode(_0x598edd,null))[_0x3f60('0x4c')](handleError(_0x598edd,null));}; \ No newline at end of file +var _0x598a=['compact','removeTeams','isEmpty','removeAgents','addAgents','isNil','SIP/%s','all','isArray','userVoiceQueue:remove','getAgents','getMembers','CmList','getLists','format','YYYY-MM-DD\x20HH:mm:ss','addLists','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','get','VoiceQueues','outbound','ignore','map','value','type','UserProfileResource','then','end','error','name','index','rawAttributes','key','query','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','VoiceQueue','includeAll','include','rows','catch','show','keys','find','create','user','role','inbound','QueueCampaigns','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','findOne','CmHopper','order','VoiceQueueId','CmHopperHistory','findAll','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','online','interface','flatMap','Agents','penalty','sequelize','transaction','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','voicePause','forEach','emit','userVoiceQueue:save','Team','ids','User','field','tq.TeamId','from','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','union'];(function(_0x12a2a6,_0x374ff1){var _0x1754ae=function(_0x49d787){while(--_0x49d787){_0x12a2a6['push'](_0x12a2a6['shift']());}};_0x1754ae(++_0x374ff1);}(_0x598a,0xfb));var _0xa598=function(_0x28047d,_0x58797e){_0x28047d=_0x28047d-0x0;var _0x9ee4c8=_0x598a[_0x28047d];return _0x9ee4c8;};'use strict';var emlformat=require(_0xa598('0x0'));var rimraf=require(_0xa598('0x1'));var zipdir=require(_0xa598('0x2'));var jsonpatch=require(_0xa598('0x3'));var rp=require(_0xa598('0x4'));var moment=require('moment');var BPromise=require(_0xa598('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa598('0x6'));var csv=require(_0xa598('0x7'));var ejs=require(_0xa598('0x8'));var fs=require('fs');var fs_extra=require(_0xa598('0x9'));var _=require(_0xa598('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa598('0xb'));var deskjs=require(_0xa598('0xc'));var toCsv=require(_0xa598('0x7'));var querystring=require(_0xa598('0xd'));var Papa=require(_0xa598('0xe'));var Redis=require(_0xa598('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa598('0x10'));var hardwareService=require(_0xa598('0x11'));var logger=require(_0xa598('0x12'))(_0xa598('0x13'));var utils=require(_0xa598('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa598('0x15'));var db=require(_0xa598('0x16'))['db'];config[_0xa598('0x17')]=_['defaults'](config[_0xa598('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xa598('0x18'))(new Redis(config[_0xa598('0x17')]));require(_0xa598('0x19'))[_0xa598('0x1a')](socket);function respondWithStatusCode(_0x1949b5,_0x21f1d8){_0x21f1d8=_0x21f1d8||0xcc;return function(_0x4ee141){if(_0x4ee141){return _0x1949b5[_0xa598('0x1b')](_0x21f1d8);}return _0x1949b5[_0xa598('0x1c')](_0x21f1d8)['end']();};}function respondWithResult(_0x88df86,_0x82a6cc){_0x82a6cc=_0x82a6cc||0xc8;return function(_0x6e6ff5){if(_0x6e6ff5){return _0x88df86[_0xa598('0x1c')](_0x82a6cc)[_0xa598('0x1d')](_0x6e6ff5);}};}function respondWithFilteredResult(_0xecb39d,_0x3cbb9f){return function(_0x2746e3){if(_0x2746e3){var _0x36492f=typeof _0x3cbb9f[_0xa598('0x1e')]==='undefined'&&typeof _0x3cbb9f[_0xa598('0x1f')]===_0xa598('0x20');var _0x3fd5a4=_0x2746e3[_0xa598('0x21')];var _0x2ad4ff=_0x36492f?0x0:_0x3cbb9f[_0xa598('0x1e')];var _0x53d689=_0x36492f?_0x2746e3['count']:_0x3cbb9f[_0xa598('0x1e')]+_0x3cbb9f['limit'];var _0x3ac469;if(_0x53d689>=_0x3fd5a4){_0x53d689=_0x3fd5a4;_0x3ac469=0xc8;}else{_0x3ac469=0xce;}_0xecb39d[_0xa598('0x1c')](_0x3ac469);return _0xecb39d[_0xa598('0x22')](_0xa598('0x23'),_0x2ad4ff+'-'+_0x53d689+'/'+_0x3fd5a4)[_0xa598('0x1d')](_0x2746e3);}return null;};}function patchUpdates(_0x24f4f0){return function(_0x483556){try{jsonpatch[_0xa598('0x24')](_0x483556,_0x24f4f0,!![]);}catch(_0x46d225){return BPromise[_0xa598('0x25')](_0x46d225);}return _0x483556[_0xa598('0x26')]();};}function saveUpdates(_0x802679,_0x3c533a){return function(_0x2c9a9b){if(_0x2c9a9b){return _0x2c9a9b[_0xa598('0x27')](_0x802679)['then'](function(_0x473d07){return _0x473d07;});}return null;};}function removeEntity(_0x414d2c,_0x499565){return function(_0x4ae8b1){if(_0x4ae8b1){return _0x4ae8b1[_0xa598('0x28')]()['then'](function(){var _0x527c9f=_0x4ae8b1[_0xa598('0x29')]({'plain':!![]});var _0x5918f1=[{'name':_0xa598('0x2a'),'value':'inbound','ignore':![]},{'name':'QueueCampaigns','value':_0xa598('0x2b'),'ignore':![]}];var _0x4138a1=_(_0x5918f1)['filter'](_0xa598('0x2c'))[_0xa598('0x2d')](_0xa598('0x2e'))[_0xa598('0x2e')]();if(_['includes'](_0x4138a1,_0x527c9f[_0xa598('0x2f')])){return;}var _0x5ab302=_['find'](_0x5918f1,['value',_0x527c9f[_0xa598('0x2f')]])['name'];return db[_0xa598('0x30')][_0xa598('0x28')]({'where':{'type':_0x5ab302,'resourceId':_0x527c9f['id']}})[_0xa598('0x31')](function(){return _0x4ae8b1;});})['then'](function(){_0x414d2c[_0xa598('0x1c')](0xcc)[_0xa598('0x32')]();});}};}function handleEntityNotFound(_0x12c5b3,_0x21cd3a){return function(_0x232b6e){if(!_0x232b6e){_0x12c5b3['sendStatus'](0x194);}return _0x232b6e;};}function handleError(_0x430d21,_0x39a83e){_0x39a83e=_0x39a83e||0x1f4;return function(_0x25bc50){logger[_0xa598('0x33')](_0x25bc50['stack']);if(_0x25bc50[_0xa598('0x34')]){delete _0x25bc50[_0xa598('0x34')];}_0x430d21['status'](_0x39a83e)['send'](_0x25bc50);};}exports[_0xa598('0x35')]=function(_0xa19e0,_0xce832c){var _0x5a816b={},_0x1fed30={},_0x3928a1={'count':0x0,'rows':[]};var _0x556d2d=_[_0xa598('0x2d')](db['VoiceQueue'][_0xa598('0x36')],function(_0x4074b0){return{'name':_0x4074b0['fieldName'],'type':_0x4074b0[_0xa598('0x2f')][_0xa598('0x37')]};});_0x1fed30['model']=_[_0xa598('0x2d')](_0x556d2d,_0xa598('0x34'));_0x1fed30[_0xa598('0x38')]=_['keys'](_0xa19e0[_0xa598('0x38')]);_0x1fed30[_0xa598('0x39')]=_[_0xa598('0x3a')](_0x1fed30['model'],_0x1fed30[_0xa598('0x38')]);_0x5a816b['attributes']=_[_0xa598('0x3a')](_0x1fed30[_0xa598('0x3b')],qs[_0xa598('0x3c')](_0xa19e0['query']['fields']));_0x5a816b['attributes']=_0x5a816b['attributes'][_0xa598('0x3d')]?_0x5a816b[_0xa598('0x3e')]:_0x1fed30[_0xa598('0x3b')];if(!_0xa19e0[_0xa598('0x38')][_0xa598('0x3f')](_0xa598('0x40'))){_0x5a816b[_0xa598('0x1f')]=qs[_0xa598('0x1f')](_0xa19e0[_0xa598('0x38')][_0xa598('0x1f')]);_0x5a816b['offset']=qs[_0xa598('0x1e')](_0xa19e0[_0xa598('0x38')][_0xa598('0x1e')]);}_0x5a816b['order']=qs[_0xa598('0x41')](_0xa19e0[_0xa598('0x38')][_0xa598('0x41')]);_0x5a816b[_0xa598('0x42')]=qs[_0xa598('0x39')](_[_0xa598('0x43')](_0xa19e0['query'],_0x1fed30['filters']),_0x556d2d);if(_0xa19e0[_0xa598('0x38')][_0xa598('0x44')]){_0x5a816b['where']=_[_0xa598('0x45')](_0x5a816b['where'],{'$or':_['map'](_0x556d2d,function(_0x829e75){if(_0x829e75['type']!==_0xa598('0x46')){var _0x4722f4={};_0x4722f4[_0x829e75[_0xa598('0x34')]]={'$like':'%'+_0xa19e0[_0xa598('0x38')][_0xa598('0x44')]+'%'};return _0x4722f4;}})});}_0x5a816b=_[_0xa598('0x45')]({},_0x5a816b,_0xa19e0[_0xa598('0x47')]);var _0x3d18d7={'where':_0x5a816b[_0xa598('0x42')]};return db[_0xa598('0x48')]['count'](_0x3d18d7)[_0xa598('0x31')](function(_0xf8099c){_0x3928a1[_0xa598('0x21')]=_0xf8099c;if(_0xa19e0[_0xa598('0x38')][_0xa598('0x49')]){_0x5a816b[_0xa598('0x4a')]=[{'all':!![]}];}return db[_0xa598('0x48')]['findAll'](_0x5a816b);})[_0xa598('0x31')](function(_0x13324b){_0x3928a1[_0xa598('0x4b')]=_0x13324b;return _0x3928a1;})[_0xa598('0x31')](respondWithFilteredResult(_0xce832c,_0x5a816b))[_0xa598('0x4c')](handleError(_0xce832c,null));};exports[_0xa598('0x4d')]=function(_0x475201,_0x21656a){var _0x49e12c={'raw':![],'where':{'id':_0x475201['params']['id']}},_0x2df028={};_0x2df028[_0xa598('0x3b')]=_[_0xa598('0x4e')](db[_0xa598('0x48')][_0xa598('0x36')]);_0x2df028[_0xa598('0x38')]=_[_0xa598('0x4e')](_0x475201[_0xa598('0x38')]);_0x2df028[_0xa598('0x39')]=_[_0xa598('0x3a')](_0x2df028['model'],_0x2df028['query']);_0x49e12c[_0xa598('0x3e')]=_[_0xa598('0x3a')](_0x2df028[_0xa598('0x3b')],qs[_0xa598('0x3c')](_0x475201['query']['fields']));_0x49e12c['attributes']=_0x49e12c[_0xa598('0x3e')][_0xa598('0x3d')]?_0x49e12c['attributes']:_0x2df028['model'];if(_0x475201['query'][_0xa598('0x49')]){_0x49e12c[_0xa598('0x4a')]=[{'all':!![]}];}_0x49e12c=_[_0xa598('0x45')]({},_0x49e12c,_0x475201[_0xa598('0x47')]);return db['VoiceQueue'][_0xa598('0x4f')](_0x49e12c)[_0xa598('0x31')](handleEntityNotFound(_0x21656a,null))[_0xa598('0x31')](respondWithResult(_0x21656a,null))[_0xa598('0x4c')](handleError(_0x21656a,null));};exports[_0xa598('0x50')]=function(_0x10a8de,_0x1f5097){return db[_0xa598('0x48')][_0xa598('0x50')](_0x10a8de['body'],{})[_0xa598('0x31')](function(_0x5440b8){var _0x5bdb02=_0x10a8de[_0xa598('0x51')]['get']({'plain':!![]});if(!_0x5bdb02)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5bdb02[_0xa598('0x52')]===_0xa598('0x51')){var _0x5d4715=_0x5440b8[_0xa598('0x29')]({'plain':!![]});var _0x4e4fc0=[{'name':_0xa598('0x2a'),'value':_0xa598('0x53')},{'name':_0xa598('0x54'),'value':_0xa598('0x2b')}];var _0x8e3ced=_[_0xa598('0x4f')](_0x4e4fc0,[_0xa598('0x2e'),_0x5d4715[_0xa598('0x2f')]])[_0xa598('0x34')];return db[_0xa598('0x55')][_0xa598('0x4f')]({'where':{'name':_0x8e3ced,'userProfileId':_0x5bdb02[_0xa598('0x56')]},'raw':!![]})[_0xa598('0x31')](function(_0x58a182){if(_0x58a182&&_0x58a182[_0xa598('0x57')]===0x0){return db[_0xa598('0x30')][_0xa598('0x50')]({'name':_0x5d4715['name'],'resourceId':_0x5d4715['id'],'type':_0x58a182[_0xa598('0x34')],'sectionId':_0x58a182['id']},{})[_0xa598('0x31')](function(){return _0x5440b8;});}else{return _0x5440b8;}})[_0xa598('0x4c')](function(_0x5c6985){logger[_0xa598('0x33')](_0xa598('0x58'),_0x5c6985);throw _0x5c6985;});}return _0x5440b8;})['then'](respondWithResult(_0x1f5097,0xc9))['catch'](handleError(_0x1f5097,null));};exports[_0xa598('0x59')]=function(_0x4d00c1,_0x3b80a0){var _0x2163bc={'where':{'id':_0x4d00c1[_0xa598('0x5a')]['id']}},_0x5c9db8={};_0x5c9db8[_0xa598('0x3b')]=_[_0xa598('0x4e')](db[_0xa598('0x48')]['rawAttributes']);_0x2163bc[_0xa598('0x3e')]=_[_0xa598('0x3a')](_0x5c9db8[_0xa598('0x3b')],qs[_0xa598('0x3c')](_0x4d00c1['query']['fields']));_0x2163bc[_0xa598('0x3e')]=_0x2163bc[_0xa598('0x3e')]['length']?_0x2163bc[_0xa598('0x3e')]:_0x5c9db8[_0xa598('0x3b')];if(_0x4d00c1[_0xa598('0x38')]['includeAll']){_0x2163bc[_0xa598('0x4a')]=[{'all':!![]}];}_0x2163bc=_[_0xa598('0x45')]({},_0x2163bc,_0x4d00c1[_0xa598('0x47')]);return db['VoiceQueue'][_0xa598('0x4f')](_0x2163bc)[_0xa598('0x31')](handleEntityNotFound(_0x3b80a0,null))['then'](function(_0xd12e6c){if(_0xd12e6c){var _0x5a7ee9=_0xd12e6c['get']({'plain':!![]});_0x5a7ee9=qs[_0xa598('0x5b')](_0x5a7ee9,['id',_0xa598('0x5c'),_0xa598('0x5d')]);_0x4d00c1[_0xa598('0x5e')]=_['omit'](_0x4d00c1[_0xa598('0x5e')],['id',_0xa598('0x5c'),_0xa598('0x5d')]);return db[_0xa598('0x48')][_0xa598('0x50')](_[_0xa598('0x45')](_0x5a7ee9,_0x4d00c1[_0xa598('0x5e')]),{'include':_0x4d00c1[_0xa598('0x38')][_0xa598('0x49')]?[{'all':!![]}]:undefined})[_0xa598('0x31')](function(_0x4ae14e){var _0x2beff7=_0x4d00c1[_0xa598('0x51')][_0xa598('0x29')]({'plain':!![]});if(!_0x2beff7)throw new Error(_0xa598('0x5f'));if(_0x2beff7['role']===_0xa598('0x51')){var _0xb81e3=_0x4ae14e['get']({'plain':!![]});var _0x4353dd=[{'name':'VoiceQueues','value':_0xa598('0x53')},{'name':'QueueCampaigns','value':'outbound'}];var _0x4b5056=_[_0xa598('0x4f')](_0x4353dd,[_0xa598('0x2e'),_0xb81e3['type']])['name'];return db[_0xa598('0x55')][_0xa598('0x4f')]({'where':{'name':_0x4b5056,'userProfileId':_0x2beff7[_0xa598('0x56')]},'raw':!![]})[_0xa598('0x31')](function(_0x59b864){if(_0x59b864&&_0x59b864[_0xa598('0x57')]===0x0){return db[_0xa598('0x30')][_0xa598('0x50')]({'name':_0xb81e3[_0xa598('0x34')],'resourceId':_0xb81e3['id'],'type':_0x59b864[_0xa598('0x34')],'sectionId':_0x59b864['id']},{})[_0xa598('0x31')](function(){return _0x4ae14e;});}else{return _0x4ae14e;}})['catch'](function(_0x1b7827){logger[_0xa598('0x33')](_0xa598('0x58'),_0x1b7827);throw _0x1b7827;});}return _0x4ae14e;});}})[_0xa598('0x31')](respondWithResult(_0x3b80a0,0xc9))[_0xa598('0x4c')](handleError(_0x3b80a0,null));};exports[_0xa598('0x27')]=function(_0xe0fd89,_0x314558){if(_0xe0fd89[_0xa598('0x5e')]['id']){delete _0xe0fd89[_0xa598('0x5e')]['id'];}return db[_0xa598('0x48')][_0xa598('0x4f')]({'where':{'id':_0xe0fd89[_0xa598('0x5a')]['id']}})[_0xa598('0x31')](handleEntityNotFound(_0x314558,null))[_0xa598('0x31')](saveUpdates(_0xe0fd89['body'],null))['then'](respondWithResult(_0x314558,null))[_0xa598('0x4c')](handleError(_0x314558,null));};exports[_0xa598('0x28')]=function(_0x54adf4,_0x26e2d0){return db['VoiceQueue'][_0xa598('0x4f')]({'where':{'id':_0x54adf4[_0xa598('0x5a')]['id']}})['then'](handleEntityNotFound(_0x26e2d0,null))['then'](removeEntity(_0x26e2d0,null))[_0xa598('0x4c')](handleError(_0x26e2d0,null));};exports[_0xa598('0x60')]=function(_0xfdd4f8,_0x57349b,_0x24ec4f){var _0x3db66f={'raw':![],'where':{}};var _0x202af1={};var _0x33b3af={'count':0x0,'rows':[]};return db[_0xa598('0x48')][_0xa598('0x61')]({'where':{'id':_0xfdd4f8['params']['id']}})[_0xa598('0x31')](handleEntityNotFound(_0x57349b,null))['then'](function(_0x177178){if(_0x177178){_0x202af1[_0xa598('0x3b')]=_[_0xa598('0x4e')](db[_0xa598('0x62')]['rawAttributes']);_0x202af1[_0xa598('0x38')]=_['keys'](_0xfdd4f8[_0xa598('0x38')]);_0x202af1[_0xa598('0x39')]=_[_0xa598('0x3a')](_0x202af1[_0xa598('0x3b')],_0x202af1[_0xa598('0x38')]);_0x3db66f[_0xa598('0x3e')]=_[_0xa598('0x3a')](_0x202af1[_0xa598('0x3b')],qs[_0xa598('0x3c')](_0xfdd4f8[_0xa598('0x38')]['fields']));_0x3db66f['attributes']=_0x3db66f[_0xa598('0x3e')][_0xa598('0x3d')]?_0x3db66f['attributes']:_0x202af1[_0xa598('0x3b')];if(!_0xfdd4f8['query'][_0xa598('0x3f')](_0xa598('0x40'))){_0x3db66f[_0xa598('0x1f')]=qs[_0xa598('0x1f')](_0xfdd4f8[_0xa598('0x38')][_0xa598('0x1f')]);_0x3db66f[_0xa598('0x1e')]=qs[_0xa598('0x1e')](_0xfdd4f8[_0xa598('0x38')][_0xa598('0x1e')]);}_0x3db66f[_0xa598('0x63')]=qs[_0xa598('0x41')](_0xfdd4f8[_0xa598('0x38')][_0xa598('0x41')]);_0x3db66f[_0xa598('0x42')]=qs[_0xa598('0x39')](_[_0xa598('0x43')](_0xfdd4f8[_0xa598('0x38')],_0x202af1[_0xa598('0x39')]));_0x3db66f[_0xa598('0x42')][_0xa598('0x64')]=_0x177178['id'];if(_0xfdd4f8[_0xa598('0x38')][_0xa598('0x44')]){_0x3db66f[_0xa598('0x42')]=_[_0xa598('0x45')](_0x3db66f['where'],{'$or':_[_0xa598('0x2d')](_0x3db66f[_0xa598('0x3e')],function(_0x1e7df1){var _0x186864={};_0x186864[_0x1e7df1]={'$like':'%'+_0xfdd4f8['query']['filter']+'%'};return _0x186864;})});}_0x3db66f=_[_0xa598('0x45')]({},_0x3db66f,_0xfdd4f8[_0xa598('0x47')]);return db['CmHopper']['count']({'where':_0x3db66f['where']})[_0xa598('0x31')](function(_0x3ae0f6){_0x33b3af[_0xa598('0x21')]=_0x3ae0f6;if(_0xfdd4f8['query'][_0xa598('0x49')]){_0x3db66f[_0xa598('0x4a')]=[{'all':!![]}];}return db[_0xa598('0x62')]['findAll'](_0x3db66f);})[_0xa598('0x31')](function(_0x1307a7){_0x33b3af[_0xa598('0x4b')]=_0x1307a7;return _0x33b3af;});}})[_0xa598('0x31')](respondWithFilteredResult(_0x57349b,_0x3db66f))['catch'](handleError(_0x57349b,null));};exports['getHopperHistories']=function(_0x5441c6,_0x1f3acd,_0x418f26){var _0x5e0ba0={'raw':!![],'where':{}};var _0x4981a7={};var _0x4bcff0={'count':0x0,'rows':[]};return db[_0xa598('0x48')][_0xa598('0x61')]({'where':{'id':_0x5441c6[_0xa598('0x5a')]['id']}})[_0xa598('0x31')](handleEntityNotFound(_0x1f3acd,null))['then'](function(_0x11d155){if(_0x11d155){_0x4981a7[_0xa598('0x3b')]=_[_0xa598('0x4e')](db[_0xa598('0x65')][_0xa598('0x36')]);_0x4981a7[_0xa598('0x38')]=_['keys'](_0x5441c6[_0xa598('0x38')]);_0x4981a7[_0xa598('0x39')]=_['intersection'](_0x4981a7['model'],_0x4981a7[_0xa598('0x38')]);_0x5e0ba0[_0xa598('0x3e')]=_[_0xa598('0x3a')](_0x4981a7['model'],qs[_0xa598('0x3c')](_0x5441c6[_0xa598('0x38')][_0xa598('0x3c')]));_0x5e0ba0[_0xa598('0x3e')]=_0x5e0ba0[_0xa598('0x3e')]['length']?_0x5e0ba0['attributes']:_0x4981a7[_0xa598('0x3b')];if(!_0x5441c6[_0xa598('0x38')][_0xa598('0x3f')](_0xa598('0x40'))){_0x5e0ba0[_0xa598('0x1f')]=qs[_0xa598('0x1f')](_0x5441c6[_0xa598('0x38')][_0xa598('0x1f')]);_0x5e0ba0['offset']=qs[_0xa598('0x1e')](_0x5441c6[_0xa598('0x38')][_0xa598('0x1e')]);}_0x5e0ba0[_0xa598('0x63')]=qs['sort'](_0x5441c6['query'][_0xa598('0x41')]);_0x5e0ba0[_0xa598('0x42')]=qs['filters'](_[_0xa598('0x43')](_0x5441c6[_0xa598('0x38')],_0x4981a7[_0xa598('0x39')]));_0x5e0ba0[_0xa598('0x42')][_0xa598('0x64')]=_0x11d155['id'];if(_0x5441c6['query'][_0xa598('0x44')]){_0x5e0ba0[_0xa598('0x42')]=_['merge'](_0x5e0ba0[_0xa598('0x42')],{'$or':_[_0xa598('0x2d')](_0x5e0ba0['attributes'],function(_0x804931){var _0xa07e80={};_0xa07e80[_0x804931]={'$like':'%'+_0x5441c6[_0xa598('0x38')][_0xa598('0x44')]+'%'};return _0xa07e80;})});}_0x5e0ba0=_[_0xa598('0x45')]({},_0x5e0ba0,_0x5441c6['options']);return db['CmHopperHistory'][_0xa598('0x21')]({'where':_0x5e0ba0[_0xa598('0x42')]})[_0xa598('0x31')](function(_0x466516){_0x4bcff0[_0xa598('0x21')]=_0x466516;if(_0x5441c6[_0xa598('0x38')][_0xa598('0x49')]){_0x5e0ba0[_0xa598('0x4a')]=[{'all':!![]}];}return db[_0xa598('0x65')][_0xa598('0x66')](_0x5e0ba0);})[_0xa598('0x31')](function(_0x2ea2cb){_0x4bcff0[_0xa598('0x4b')]=_0x2ea2cb;return _0x4bcff0;});}})[_0xa598('0x31')](respondWithFilteredResult(_0x1f3acd,_0x5e0ba0))['catch'](handleError(_0x1f3acd,null));};exports['getHopperFinals']=function(_0x20a408,_0x53eeb5,_0x53732d){var _0x56a8e7={'raw':!![],'where':{}};var _0x1ecf05={};var _0x3faf3d={'count':0x0,'rows':[]};return db[_0xa598('0x48')][_0xa598('0x61')]({'where':{'id':_0x20a408[_0xa598('0x5a')]['id']}})[_0xa598('0x31')](handleEntityNotFound(_0x53eeb5,null))[_0xa598('0x31')](function(_0x377b98){if(_0x377b98){_0x1ecf05[_0xa598('0x3b')]=_[_0xa598('0x4e')](db['CmHopperFinal'][_0xa598('0x36')]);_0x1ecf05[_0xa598('0x38')]=_[_0xa598('0x4e')](_0x20a408['query']);_0x1ecf05[_0xa598('0x39')]=_[_0xa598('0x3a')](_0x1ecf05[_0xa598('0x3b')],_0x1ecf05[_0xa598('0x38')]);_0x56a8e7[_0xa598('0x3e')]=_['intersection'](_0x1ecf05['model'],qs['fields'](_0x20a408[_0xa598('0x38')][_0xa598('0x3c')]));_0x56a8e7[_0xa598('0x3e')]=_0x56a8e7[_0xa598('0x3e')][_0xa598('0x3d')]?_0x56a8e7[_0xa598('0x3e')]:_0x1ecf05[_0xa598('0x3b')];if(!_0x20a408[_0xa598('0x38')]['hasOwnProperty'](_0xa598('0x40'))){_0x56a8e7[_0xa598('0x1f')]=qs[_0xa598('0x1f')](_0x20a408['query'][_0xa598('0x1f')]);_0x56a8e7[_0xa598('0x1e')]=qs[_0xa598('0x1e')](_0x20a408[_0xa598('0x38')][_0xa598('0x1e')]);}_0x56a8e7[_0xa598('0x63')]=qs['sort'](_0x20a408[_0xa598('0x38')]['sort']);_0x56a8e7[_0xa598('0x42')]=qs[_0xa598('0x39')](_[_0xa598('0x43')](_0x20a408[_0xa598('0x38')],_0x1ecf05['filters']));_0x56a8e7[_0xa598('0x42')][_0xa598('0x64')]=_0x377b98['id'];if(_0x20a408[_0xa598('0x38')][_0xa598('0x44')]){_0x56a8e7['where']=_[_0xa598('0x45')](_0x56a8e7[_0xa598('0x42')],{'$or':_[_0xa598('0x2d')](_0x56a8e7[_0xa598('0x3e')],function(_0x300cf8){var _0x163191={};_0x163191[_0x300cf8]={'$like':'%'+_0x20a408[_0xa598('0x38')][_0xa598('0x44')]+'%'};return _0x163191;})});}_0x56a8e7=_[_0xa598('0x45')]({},_0x56a8e7,_0x20a408[_0xa598('0x47')]);return db[_0xa598('0x67')][_0xa598('0x21')]({'where':_0x56a8e7['where']})[_0xa598('0x31')](function(_0x3a113b){_0x3faf3d[_0xa598('0x21')]=_0x3a113b;if(_0x20a408[_0xa598('0x38')][_0xa598('0x49')]){_0x56a8e7[_0xa598('0x4a')]=[{'all':!![]}];}return db[_0xa598('0x67')][_0xa598('0x66')](_0x56a8e7);})[_0xa598('0x31')](function(_0x219fb6){_0x3faf3d[_0xa598('0x4b')]=_0x219fb6;return _0x3faf3d;});}})['then'](respondWithFilteredResult(_0x53eeb5,_0x56a8e7))[_0xa598('0x4c')](handleError(_0x53eeb5,null));};exports[_0xa598('0x68')]=function(_0x19e1f9,_0x4e6025,_0x5b28c7){var _0xf240d9={'raw':!![],'where':{}};var _0x47c95c={};var _0x56c4cf={'count':0x0,'rows':[]};return db[_0xa598('0x48')]['findOne']({'where':{'id':_0x19e1f9[_0xa598('0x5a')]['id']}})[_0xa598('0x31')](handleEntityNotFound(_0x4e6025,null))[_0xa598('0x31')](function(_0x2dd2e2){if(_0x2dd2e2){_0x47c95c[_0xa598('0x3b')]=_[_0xa598('0x4e')](db[_0xa598('0x69')][_0xa598('0x36')]);_0x47c95c[_0xa598('0x38')]=_[_0xa598('0x4e')](_0x19e1f9[_0xa598('0x38')]);_0x47c95c[_0xa598('0x39')]=_[_0xa598('0x3a')](_0x47c95c[_0xa598('0x3b')],_0x47c95c[_0xa598('0x38')]);_0xf240d9[_0xa598('0x3e')]=_[_0xa598('0x3a')](_0x47c95c['model'],qs[_0xa598('0x3c')](_0x19e1f9[_0xa598('0x38')][_0xa598('0x3c')]));_0xf240d9[_0xa598('0x3e')]=_0xf240d9[_0xa598('0x3e')][_0xa598('0x3d')]?_0xf240d9['attributes']:_0x47c95c[_0xa598('0x3b')];if(!_0x19e1f9[_0xa598('0x38')]['hasOwnProperty']('nolimit')){_0xf240d9[_0xa598('0x1f')]=qs[_0xa598('0x1f')](_0x19e1f9['query']['limit']);_0xf240d9[_0xa598('0x1e')]=qs[_0xa598('0x1e')](_0x19e1f9[_0xa598('0x38')]['offset']);}_0xf240d9['order']=qs[_0xa598('0x41')](_0x19e1f9[_0xa598('0x38')][_0xa598('0x41')]);_0xf240d9[_0xa598('0x42')]=qs[_0xa598('0x39')](_[_0xa598('0x43')](_0x19e1f9[_0xa598('0x38')],_0x47c95c[_0xa598('0x39')]));_0xf240d9['where']['VoiceQueueId']=_0x2dd2e2['id'];if(_0x19e1f9['query'][_0xa598('0x44')]){_0xf240d9[_0xa598('0x42')]=_[_0xa598('0x45')](_0xf240d9[_0xa598('0x42')],{'$or':_['map'](_0xf240d9[_0xa598('0x3e')],function(_0x9eff95){var _0x4bb5e1={};_0x4bb5e1[_0x9eff95]={'$like':'%'+_0x19e1f9[_0xa598('0x38')][_0xa598('0x44')]+'%'};return _0x4bb5e1;})});}_0xf240d9=_[_0xa598('0x45')]({},_0xf240d9,_0x19e1f9[_0xa598('0x47')]);return db[_0xa598('0x69')]['count']({'where':_0xf240d9[_0xa598('0x42')]})[_0xa598('0x31')](function(_0x25484a){_0x56c4cf[_0xa598('0x21')]=_0x25484a;if(_0x19e1f9['query'][_0xa598('0x49')]){_0xf240d9[_0xa598('0x4a')]=[{'all':!![]}];}return db[_0xa598('0x69')][_0xa598('0x66')](_0xf240d9);})['then'](function(_0x1c14e7){_0x56c4cf[_0xa598('0x4b')]=_0x1c14e7;return _0x56c4cf;});}})[_0xa598('0x31')](respondWithFilteredResult(_0x4e6025,_0xf240d9))['catch'](handleError(_0x4e6025,null));};exports['getTeams']=function(_0x493333,_0x40ca45,_0x35d8b7){var _0x4d9371={};var _0x4ecfd9={};var _0x41bc8b;var _0x9a0dfe;return db[_0xa598('0x48')]['findOne']({'where':{'id':_0x493333[_0xa598('0x5a')]['id']}})[_0xa598('0x31')](handleEntityNotFound(_0x40ca45,null))[_0xa598('0x31')](function(_0x3db159){if(_0x3db159){_0x41bc8b=_0x3db159;_0x4ecfd9[_0xa598('0x3b')]=_['keys'](db['Team'][_0xa598('0x36')]);_0x4ecfd9[_0xa598('0x38')]=_[_0xa598('0x4e')](_0x493333[_0xa598('0x38')]);_0x4ecfd9[_0xa598('0x39')]=_[_0xa598('0x3a')](_0x4ecfd9[_0xa598('0x3b')],_0x4ecfd9['query']);_0x4d9371['attributes']=_[_0xa598('0x3a')](_0x4ecfd9['model'],qs['fields'](_0x493333[_0xa598('0x38')]['fields']));_0x4d9371['attributes']=_0x4d9371[_0xa598('0x3e')][_0xa598('0x3d')]?_0x4d9371[_0xa598('0x3e')]:_0x4ecfd9[_0xa598('0x3b')];_0x4d9371[_0xa598('0x63')]=qs[_0xa598('0x41')](_0x493333[_0xa598('0x38')]['sort']);_0x4d9371['where']=qs[_0xa598('0x39')](_['pick'](_0x493333[_0xa598('0x38')],_0x4ecfd9[_0xa598('0x39')]));if(_0x493333['query'][_0xa598('0x44')]){_0x4d9371[_0xa598('0x42')]=_[_0xa598('0x45')](_0x4d9371[_0xa598('0x42')],{'$or':_[_0xa598('0x2d')](_0x4d9371[_0xa598('0x3e')],function(_0xc22fae){var _0x5a912e={};_0x5a912e[_0xc22fae]={'$like':'%'+_0x493333[_0xa598('0x38')][_0xa598('0x44')]+'%'};return _0x5a912e;})});}_0x4d9371=_[_0xa598('0x45')]({},_0x4d9371,_0x493333[_0xa598('0x47')]);return _0x41bc8b[_0xa598('0x6a')](_0x4d9371);}})[_0xa598('0x31')](function(_0x40713b){if(_0x40713b){_0x9a0dfe=_0x40713b[_0xa598('0x3d')];if(!_0x493333['query'][_0xa598('0x3f')](_0xa598('0x40'))){_0x4d9371[_0xa598('0x1f')]=qs[_0xa598('0x1f')](_0x493333['query'][_0xa598('0x1f')]);_0x4d9371['offset']=qs[_0xa598('0x1e')](_0x493333[_0xa598('0x38')][_0xa598('0x1e')]);}return _0x41bc8b[_0xa598('0x6a')](_0x4d9371);}})[_0xa598('0x31')](function(_0x4b7369){if(_0x4b7369){return _0x4b7369?{'count':_0x9a0dfe,'rows':_0x4b7369}:null;}})[_0xa598('0x31')](respondWithResult(_0x40ca45,null))[_0xa598('0x4c')](handleError(_0x40ca45,null));};exports[_0xa598('0x6b')]=function(_0x331fb5,_0x23635e,_0x502e6b){var _0x3d1e79=_0x331fb5[_0xa598('0x5e')][_0xa598('0x6c')];var _0x58ca85=_[_0xa598('0x2d')](_0x3d1e79,'id');return db['Team'][_0xa598('0x66')]({'where':{'id':_0x58ca85},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xa598('0x34'),_0xa598('0x6d'),'voicePause',_0xa598('0x6e')],'raw':!![]}]})[_0xa598('0x31')](function(_0x1f39a3){if(_0x1f39a3){var _0x156a2f=_[_0xa598('0x6f')](_0x1f39a3,function(_0x1a956a){var _0x5addfc=_0x1a956a[_0xa598('0x29')]({'plain':!![]});_0x5addfc[_0xa598('0x70')]['forEach'](function(_0x2418d3){_0x2418d3[_0xa598('0x71')]=_[_0xa598('0x4f')](_0x3d1e79,{'id':_0x5addfc['id']})[_0xa598('0x71')];});return _0x5addfc[_0xa598('0x70')];});return db[_0xa598('0x48')][_0xa598('0x4f')]({'where':{'id':_0x331fb5[_0xa598('0x5a')]['id']}})['then'](function(_0x35b714){return db[_0xa598('0x72')][_0xa598('0x73')](function(_0x5b6d84){return _0x35b714[_0xa598('0x6b')](_0x58ca85,{'transaction':_0x5b6d84})['then'](function(){return BPromise[_0xa598('0x74')](_0x3d1e79,function(_0x32cf7a){return db['TeamVoiceQueue']['upsert']({'TeamId':_0x32cf7a['id'],'VoiceQueueId':_0x331fb5[_0xa598('0x5a')]['id'],'penalty':_0x32cf7a[_0xa598('0x71')]},{'transaction':_0x5b6d84});});})[_0xa598('0x31')](function(){return BPromise[_0xa598('0x74')](_0x156a2f,function(_0x2e49ae){return db[_0xa598('0x75')][_0xa598('0x76')]({'where':{'UserId':_0x2e49ae['id'],'VoiceQueueId':_0x331fb5[_0xa598('0x5a')]['id']},'defaults':{'penalty':_0x2e49ae['penalty']},'transaction':_0x5b6d84});});})[_0xa598('0x31')](function(){return BPromise['each'](_[_0xa598('0x44')](_0x156a2f,{'online':!![]}),function(_0x9e5417){return db[_0xa598('0x77')][_0xa598('0x78')]({'membername':_0x9e5417[_0xa598('0x34')],'UserId':_0x9e5417['id'],'queue_name':_0x35b714[_0xa598('0x34')],'VoiceQueueId':_0x35b714['id'],'interface':_['isNil'](_0x9e5417[_0xa598('0x6e')])?util['format']('SIP/%s',_0x9e5417['name']):_0x9e5417[_0xa598('0x6e')],'paused':_0x9e5417[_0xa598('0x79')]||![],'penalty':_0x9e5417[_0xa598('0x71')]},{'transaction':_0x5b6d84});});})['then'](function(){_0x156a2f[_0xa598('0x7a')](function(_0x56cbba){socket[_0xa598('0x7b')](_0xa598('0x7c'),{'UserId':_0x56cbba['id'],'VoiceQueueId':_0x35b714['id']});});});});});}})[_0xa598('0x31')](respondWithStatusCode(_0x23635e,null))[_0xa598('0x4c')](handleError(_0x23635e,null));};exports['removeTeams']=function(_0x2ab527,_0x4dd654,_0x146a4c){return db[_0xa598('0x7d')]['findAll']({'where':{'id':_0x2ab527['query'][_0xa598('0x7e')]},'attributes':['id'],'include':[{'model':db[_0xa598('0x7f')],'as':_0xa598('0x70'),'attributes':['id'],'raw':!![]}]})[_0xa598('0x31')](handleEntityNotFound(_0x4dd654,null))['then'](function(_0x1be477){var _0x37444b=_['map'](_0x1be477,'id');var _0x1b4c60=[];var _0x3c5f6b=[];var _0xe8e809=squel['select']();_0xe8e809[_0xa598('0x80')](_0xa598('0x81'))[_0xa598('0x82')](_0xa598('0x83'),'tq')[_0xa598('0x84')]('user_has_teams','ut',_0xa598('0x85'))[_0xa598('0x42')](_0xa598('0x86'),_0x2ab527[_0xa598('0x5a')]['id']);for(var _0x56c601=0x0;_0x56c601<_0x1be477[_0xa598('0x3d')];_0x56c601+=0x1){let _0x42b784=_0x1be477[_0x56c601];for(var _0x1069db=0x0;_0x1069db<_0x42b784[_0xa598('0x70')][_0xa598('0x3d')];_0x1069db+=0x1){let _0x41d204=_0x42b784['Agents'][_0x1069db];var _0x4f8920=_0xe8e809[_0xa598('0x59')]();_0x4f8920[_0xa598('0x42')](_0xa598('0x87'),_0x41d204['id']);_0x3c5f6b[_0xa598('0x88')](db[_0xa598('0x72')][_0xa598('0x38')](_0x4f8920[_0xa598('0x89')](),{'type':db['sequelize'][_0xa598('0x8a')][_0xa598('0x8b')]})[_0xa598('0x31')](function(_0x45d3a8){if(_0x45d3a8[_0xa598('0x3d')]===0x1){return _0x41d204['id'];}else{var _0x38362e=_[_0xa598('0x8c')](_[_0xa598('0x2d')](_0x45d3a8,'TeamId'),function(_0x471b35){return _[_0xa598('0x8d')](_0x37444b,_0x471b35);});if(_0x38362e){return _0x41d204['id'];}}}));}}return BPromise['all'](_0x3c5f6b)['then'](function(_0x25585e){_0x1b4c60=_(_0x1b4c60)[_0xa598('0x8e')](_0x25585e)[_0xa598('0x8f')]()[_0xa598('0x2e')]();return db[_0xa598('0x48')]['find']({'where':{'id':_0x2ab527[_0xa598('0x5a')]['id']}})[_0xa598('0x31')](function(_0x25eb80){return db[_0xa598('0x72')][_0xa598('0x73')](function(_0x549f38){return _0x25eb80[_0xa598('0x90')](_0x2ab527[_0xa598('0x38')][_0xa598('0x7e')],{'transaction':_0x549f38})[_0xa598('0x31')](function(){if(!_[_0xa598('0x91')](_0x1b4c60)){return _0x25eb80[_0xa598('0x92')](_0x1b4c60,{'transaction':_0x549f38})[_0xa598('0x31')](function(){return db[_0xa598('0x77')][_0xa598('0x28')]({'where':{'VoiceQueueId':_0x2ab527[_0xa598('0x5a')]['id'],'UserId':_0x1b4c60},'transaction':_0x549f38});});}})['then'](function(){_0x1b4c60['forEach'](function(_0x38c392){socket[_0xa598('0x7b')]('userVoiceQueue:remove',{'UserId':_0x38c392,'VoiceQueueId':_0x25eb80['id']});});});});});});})[_0xa598('0x31')](respondWithStatusCode(_0x4dd654,null))[_0xa598('0x4c')](handleError(_0x4dd654,null));};exports[_0xa598('0x93')]=function(_0x3392ba,_0xdc3032,_0x26cf75){var _0x31234e,_0x501349;return db[_0xa598('0x48')][_0xa598('0x4f')]({'where':{'id':_0x3392ba[_0xa598('0x5a')]['id']}})[_0xa598('0x31')](handleEntityNotFound(_0xdc3032,null))['then'](function(_0xd3d248){if(_0xd3d248){_0x501349=_0xd3d248;return _0xd3d248['addAgents'](_0x3392ba[_0xa598('0x5e')][_0xa598('0x7e')],_[_0xa598('0x5b')](_0x3392ba[_0xa598('0x5e')],[_0xa598('0x7e'),'id'])||{})['spread'](function(_0x264d70){for(var _0x5b4b4d=0x0;_0x5b4b4d<_0x3392ba[_0xa598('0x5e')]['ids'][_0xa598('0x3d')];_0x5b4b4d+=0x1){socket['emit'](_0xa598('0x7c'),{'UserId':Number(_0x3392ba[_0xa598('0x5e')]['ids'][_0x5b4b4d]),'VoiceQueueId':Number(_0x3392ba[_0xa598('0x5a')]['id'])});}return _0x264d70;});}})[_0xa598('0x31')](function(_0xa7d493){_0x31234e=_0xa7d493||[];if(_0x501349){return db[_0xa598('0x7f')][_0xa598('0x66')]({'where':{'id':_0x3392ba['body'][_0xa598('0x7e')]},'attributes':['id',_0xa598('0x34'),_0xa598('0x6d'),_0xa598('0x79'),_0xa598('0x6e')],'raw':!![]});}})[_0xa598('0x31')](function(_0x512247){if(!_[_0xa598('0x91')](_0x512247)){var _0x3e97b8=[];for(var _0x11b1b6=0x0;_0x11b1b6<_0x512247[_0xa598('0x3d')];_0x11b1b6++){if(_0x512247[_0x11b1b6][_0xa598('0x6d')]){_0x3e97b8[_0xa598('0x88')](db[_0xa598('0x77')][_0xa598('0x78')]({'membername':_0x512247[_0x11b1b6][_0xa598('0x34')],'UserId':_0x512247[_0x11b1b6]['id'],'queue_name':_0x501349[_0xa598('0x34')],'VoiceQueueId':_0x501349['id'],'interface':_[_0xa598('0x94')](_0x512247[_0x11b1b6][_0xa598('0x6e')])?util['format'](_0xa598('0x95'),_0x512247[_0x11b1b6][_0xa598('0x34')]):_0x512247[_0x11b1b6][_0xa598('0x6e')],'paused':_0x512247[_0x11b1b6][_0xa598('0x79')]||![],'penalty':_0x3392ba[_0xa598('0x5e')]['penalty']||0x0}));}}return BPromise[_0xa598('0x96')](_0x3e97b8);}})[_0xa598('0x31')](function(){return _0x31234e;})[_0xa598('0x31')](respondWithResult(_0xdc3032,null))['catch'](handleError(_0xdc3032,null));};exports['removeAgents']=function(_0x42c58f,_0x5ea2e9,_0x4dbb09){return db[_0xa598('0x48')][_0xa598('0x4f')]({'where':{'id':_0x42c58f['params']['id']}})[_0xa598('0x31')](handleEntityNotFound(_0x5ea2e9,null))['then'](function(_0x56a711){if(_0x56a711){return _0x56a711[_0xa598('0x92')](_0x42c58f[_0xa598('0x38')][_0xa598('0x7e')])[_0xa598('0x31')](function(){if(_[_0xa598('0x97')](_0x42c58f[_0xa598('0x38')][_0xa598('0x7e')])){for(var _0xdf829a=0x0;_0xdf829a<_0x42c58f[_0xa598('0x38')][_0xa598('0x7e')][_0xa598('0x3d')];_0xdf829a+=0x1){socket[_0xa598('0x7b')](_0xa598('0x98'),{'UserId':Number(_0x42c58f[_0xa598('0x38')][_0xa598('0x7e')][_0xdf829a]),'VoiceQueueId':Number(_0x42c58f['params']['id'])});}}else{socket[_0xa598('0x7b')]('userVoiceQueue:remove',{'UserId':Number(_0x42c58f[_0xa598('0x38')]['ids']),'VoiceQueueId':Number(_0x42c58f['params']['id'])});}});}})[_0xa598('0x31')](function(_0x3a6bf8){return db[_0xa598('0x77')]['destroy']({'where':{'VoiceQueueId':_0x42c58f[_0xa598('0x5a')]['id'],'UserId':_0x42c58f[_0xa598('0x38')]['ids']}})[_0xa598('0x31')](function(){return _0x3a6bf8;});})[_0xa598('0x31')](respondWithStatusCode(_0x5ea2e9,null))['catch'](handleError(_0x5ea2e9,null));};exports['getAgents']=function(_0x362361,_0x366cb7,_0x4ff415){var _0x171ec1={};var _0x452a66={};var _0x5acaf8;var _0x274bff;return db[_0xa598('0x48')][_0xa598('0x61')]({'where':{'id':_0x362361[_0xa598('0x5a')]['id']}})[_0xa598('0x31')](handleEntityNotFound(_0x366cb7,null))[_0xa598('0x31')](function(_0x2cc46d){if(_0x2cc46d){_0x5acaf8=_0x2cc46d;_0x452a66['model']=_[_0xa598('0x4e')](db[_0xa598('0x7f')][_0xa598('0x36')]);_0x452a66[_0xa598('0x38')]=_['keys'](_0x362361[_0xa598('0x38')]);_0x452a66[_0xa598('0x39')]=_[_0xa598('0x3a')](_0x452a66[_0xa598('0x3b')],_0x452a66['query']);_0x171ec1['attributes']=_['intersection'](_0x452a66[_0xa598('0x3b')],qs[_0xa598('0x3c')](_0x362361['query'][_0xa598('0x3c')]));_0x171ec1[_0xa598('0x3e')]=_0x171ec1[_0xa598('0x3e')][_0xa598('0x3d')]?_0x171ec1[_0xa598('0x3e')]:_0x452a66[_0xa598('0x3b')];_0x171ec1[_0xa598('0x63')]=qs[_0xa598('0x41')](_0x362361[_0xa598('0x38')][_0xa598('0x41')]);_0x171ec1[_0xa598('0x42')]=qs[_0xa598('0x39')](_[_0xa598('0x43')](_0x362361['query'],_0x452a66[_0xa598('0x39')]));if(_0x362361[_0xa598('0x38')][_0xa598('0x44')]){_0x171ec1[_0xa598('0x42')]=_[_0xa598('0x45')](_0x171ec1['where'],{'$or':_[_0xa598('0x2d')](_0x171ec1['attributes'],function(_0x24cce8){var _0x265bd6={};_0x265bd6[_0x24cce8]={'$like':'%'+_0x362361[_0xa598('0x38')]['filter']+'%'};return _0x265bd6;})});}_0x171ec1=_[_0xa598('0x45')]({},_0x171ec1,_0x362361[_0xa598('0x47')]);return _0x5acaf8[_0xa598('0x99')](_0x171ec1);}})[_0xa598('0x31')](function(_0x117b0c){if(_0x117b0c){_0x274bff=_0x117b0c['length'];if(!_0x362361[_0xa598('0x38')][_0xa598('0x3f')](_0xa598('0x40'))){_0x171ec1[_0xa598('0x1f')]=qs[_0xa598('0x1f')](_0x362361['query']['limit']);_0x171ec1['offset']=qs[_0xa598('0x1e')](_0x362361[_0xa598('0x38')]['offset']);}return _0x5acaf8[_0xa598('0x99')](_0x171ec1);}})[_0xa598('0x31')](function(_0x2715cf){if(_0x2715cf){return _0x2715cf?{'count':_0x274bff,'rows':_0x2715cf}:null;}})[_0xa598('0x31')](respondWithResult(_0x366cb7,null))[_0xa598('0x4c')](handleError(_0x366cb7,null));};exports[_0xa598('0x9a')]=function(_0x2e10bc,_0x25a965,_0xc176f5){var _0x57c7b6={};var _0x457636={};var _0x50fc7d;var _0x343436;return db['VoiceQueue'][_0xa598('0x61')]({'where':{'id':_0x2e10bc['params']['id']}})['then'](handleEntityNotFound(_0x25a965,null))[_0xa598('0x31')](function(_0x494de7){if(_0x494de7){_0x50fc7d=_0x494de7;_0x457636[_0xa598('0x3b')]=_[_0xa598('0x4e')](db[_0xa598('0x77')][_0xa598('0x36')]);_0x457636[_0xa598('0x38')]=_[_0xa598('0x4e')](_0x2e10bc[_0xa598('0x38')]);_0x457636[_0xa598('0x39')]=_[_0xa598('0x3a')](_0x457636[_0xa598('0x3b')],_0x457636[_0xa598('0x38')]);_0x57c7b6[_0xa598('0x3e')]=_[_0xa598('0x3a')](_0x457636[_0xa598('0x3b')],qs[_0xa598('0x3c')](_0x2e10bc[_0xa598('0x38')][_0xa598('0x3c')]));_0x57c7b6['attributes']=_0x57c7b6[_0xa598('0x3e')][_0xa598('0x3d')]?_0x57c7b6[_0xa598('0x3e')]:_0x457636[_0xa598('0x3b')];_0x57c7b6[_0xa598('0x63')]=qs[_0xa598('0x41')](_0x2e10bc[_0xa598('0x38')][_0xa598('0x41')]);_0x57c7b6[_0xa598('0x42')]=qs[_0xa598('0x39')](_[_0xa598('0x43')](_0x2e10bc[_0xa598('0x38')],_0x457636[_0xa598('0x39')]));if(_0x2e10bc[_0xa598('0x38')][_0xa598('0x44')]){_0x57c7b6[_0xa598('0x42')]=_['merge'](_0x57c7b6[_0xa598('0x42')],{'$or':_[_0xa598('0x2d')](_0x57c7b6[_0xa598('0x3e')],function(_0x4f3914){var _0xf9e81f={};_0xf9e81f[_0x4f3914]={'$like':'%'+_0x2e10bc[_0xa598('0x38')][_0xa598('0x44')]+'%'};return _0xf9e81f;})});}_0x57c7b6=_['merge']({},_0x57c7b6,_0x2e10bc[_0xa598('0x47')]);return _0x50fc7d[_0xa598('0x9a')](_0x57c7b6);}})[_0xa598('0x31')](function(_0x9272d6){if(_0x9272d6){_0x343436=_0x9272d6[_0xa598('0x3d')];if(!_0x2e10bc[_0xa598('0x38')][_0xa598('0x3f')](_0xa598('0x40'))){_0x57c7b6[_0xa598('0x1f')]=qs[_0xa598('0x1f')](_0x2e10bc[_0xa598('0x38')]['limit']);_0x57c7b6[_0xa598('0x1e')]=qs[_0xa598('0x1e')](_0x2e10bc['query'][_0xa598('0x1e')]);}return _0x50fc7d[_0xa598('0x9a')](_0x57c7b6);}})[_0xa598('0x31')](function(_0x1776ab){return _0x1776ab?{'count':_0x343436,'rows':_0x1776ab}:null;})[_0xa598('0x31')](respondWithResult(_0x25a965,null))['catch'](handleError(_0x25a965,null));};exports['getLists']=function(_0x479930,_0x256ca4,_0x3b8682){var _0x54cc73={};var _0x2434a8={};var _0x359c88;var _0x28fcc0;return db[_0xa598('0x48')][_0xa598('0x61')]({'where':{'id':_0x479930[_0xa598('0x5a')]['id']}})[_0xa598('0x31')](handleEntityNotFound(_0x256ca4,null))[_0xa598('0x31')](function(_0x227def){if(_0x227def){_0x359c88=_0x227def;_0x2434a8['model']=_[_0xa598('0x4e')](db[_0xa598('0x9b')][_0xa598('0x36')]);_0x2434a8[_0xa598('0x38')]=_[_0xa598('0x4e')](_0x479930[_0xa598('0x38')]);_0x2434a8[_0xa598('0x39')]=_[_0xa598('0x3a')](_0x2434a8[_0xa598('0x3b')],_0x2434a8[_0xa598('0x38')]);_0x54cc73['attributes']=_[_0xa598('0x3a')](_0x2434a8[_0xa598('0x3b')],qs[_0xa598('0x3c')](_0x479930[_0xa598('0x38')][_0xa598('0x3c')]));_0x54cc73[_0xa598('0x3e')]=_0x54cc73[_0xa598('0x3e')][_0xa598('0x3d')]?_0x54cc73['attributes']:_0x2434a8[_0xa598('0x3b')];_0x54cc73[_0xa598('0x63')]=qs[_0xa598('0x41')](_0x479930[_0xa598('0x38')][_0xa598('0x41')]);_0x54cc73[_0xa598('0x42')]=qs[_0xa598('0x39')](_[_0xa598('0x43')](_0x479930['query'],_0x2434a8['filters']));if(_0x479930[_0xa598('0x38')][_0xa598('0x44')]){_0x54cc73[_0xa598('0x42')]=_['merge'](_0x54cc73[_0xa598('0x42')],{'$or':_['map'](_0x54cc73[_0xa598('0x3e')],function(_0x438527){var _0x4baf3d={};_0x4baf3d[_0x438527]={'$like':'%'+_0x479930[_0xa598('0x38')]['filter']+'%'};return _0x4baf3d;})});}_0x54cc73=_[_0xa598('0x45')]({},_0x54cc73,_0x479930[_0xa598('0x47')]);return _0x359c88[_0xa598('0x9c')](_0x54cc73);}})[_0xa598('0x31')](function(_0x4b1242){if(_0x4b1242){_0x28fcc0=_0x4b1242[_0xa598('0x3d')];if(!_0x479930[_0xa598('0x38')][_0xa598('0x3f')](_0xa598('0x40'))){_0x54cc73[_0xa598('0x1f')]=qs[_0xa598('0x1f')](_0x479930['query'][_0xa598('0x1f')]);_0x54cc73[_0xa598('0x1e')]=qs[_0xa598('0x1e')](_0x479930[_0xa598('0x38')][_0xa598('0x1e')]);}return _0x359c88['getLists'](_0x54cc73);}})['then'](function(_0x49e567){if(_0x49e567){return _0x49e567?{'count':_0x28fcc0,'rows':_0x49e567}:null;}})['then'](respondWithResult(_0x256ca4,null))[_0xa598('0x4c')](handleError(_0x256ca4,null));};exports['addLists']=function(_0x22370a,_0x8de326,_0x257024){var _0x176729=moment()[_0xa598('0x9d')](_0xa598('0x9e'));var _0x2d4686,_0x2cb4f4;return db[_0xa598('0x48')][_0xa598('0x4f')]({'where':{'id':_0x22370a[_0xa598('0x5a')]['id']}})[_0xa598('0x31')](handleEntityNotFound(_0x8de326,null))['then'](function(_0x5dbc2c){if(_0x5dbc2c){_0x2cb4f4=_0x5dbc2c;return _0x5dbc2c[_0xa598('0x9f')](_0x22370a[_0xa598('0x5e')][_0xa598('0x7e')],_[_0xa598('0x5b')](_0x22370a['body'],[_0xa598('0x7e'),'id'])||{});}return null;})[_0xa598('0xa0')](function(_0x4e2a2a){var _0x37cf15;_0x2d4686=_0x4e2a2a||[];var _0x17b32a=[];if(_0x4e2a2a){for(var _0x34bd86=0x0;_0x34bd86<_0x4e2a2a[_0xa598('0x3d')];_0x34bd86+=0x1){var _0x128c2d=_0x4e2a2a[_0x34bd86][_0xa598('0x29')]({'plain':!![]});_0x2cb4f4[_0xa598('0xa1')]=_0x22370a[_0xa598('0x5e')][_0xa598('0xa1')]?_0x22370a[_0xa598('0x5e')][_0xa598('0xa1')]:_0x2cb4f4[_0xa598('0xa1')];switch(_0x2cb4f4['dialCheckDuplicateType']){case _0xa598('0xa2'):_0x37cf15=squel[_0xa598('0xa3')]()[_0xa598('0xa4')](_0xa598('0xa5'))['fromQuery']([_0xa598('0xa6'),_0xa598('0xa7'),_0xa598('0xa8'),_0xa598('0xa9'),_0xa598('0x64'),_0xa598('0x5c'),_0xa598('0x5d')],squel['select']()[_0xa598('0x80')](_0xa598('0xa6'),_0xa598('0xa6'))['field']('\x27'+_0x176729+'\x27',_0xa598('0xa7'))[_0xa598('0x80')]('id','ContactId')[_0xa598('0x80')](_0x128c2d[_0xa598('0xaa')]['toString'](),_0xa598('0xa9'))[_0xa598('0x80')](_0x22370a['params']['id'][_0xa598('0x89')](),'VoiceQueueId')['field']('\x27'+_0x176729+'\x27',_0xa598('0x5c'))[_0xa598('0x80')]('\x27'+_0x176729+'\x27',_0xa598('0x5d'))[_0xa598('0x82')](_0xa598('0xab'))[_0xa598('0x42')](_0xa598('0xac'))[_0xa598('0x42')](_0xa598('0xad'),_0x128c2d[_0xa598('0xaa')]['toString']())[_0xa598('0x42')](_0xa598('0xae'))[_0xa598('0x42')](_0xa598('0xaf'),squel[_0xa598('0xb0')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0xa598('0x82')](_0xa598('0xb1'))[_0xa598('0x42')]('VoiceQueueId\x20=\x20?',_0x22370a[_0xa598('0x5a')]['id']['toString']()))[_0xa598('0x42')](_0xa598('0xaf'),squel[_0xa598('0xb0')]()['field'](_0xa598('0xb2'))[_0xa598('0x82')]('cm_hopper')[_0xa598('0x42')](_0xa598('0x86'),_0x22370a['params']['id'][_0xa598('0x89')]())))['toString']();break;case _0xa598('0xb3'):_0x37cf15=squel[_0xa598('0xa3')]()[_0xa598('0xa4')](_0xa598('0xa5'))[_0xa598('0xb4')]([_0xa598('0xa6'),_0xa598('0xa7'),_0xa598('0xa8'),_0xa598('0xa9'),_0xa598('0x64'),_0xa598('0x5c'),'updatedAt'],squel[_0xa598('0xb0')]()[_0xa598('0x80')](_0xa598('0xa6'),'phone')['field']('\x27'+_0x176729+'\x27',_0xa598('0xa7'))[_0xa598('0x80')]('id',_0xa598('0xa8'))['field'](_0x128c2d[_0xa598('0xaa')]['toString'](),_0xa598('0xa9'))[_0xa598('0x80')](_0x22370a[_0xa598('0x5a')]['id'][_0xa598('0x89')](),_0xa598('0x64'))['field']('\x27'+_0x176729+'\x27',_0xa598('0x5c'))['field']('\x27'+_0x176729+'\x27',_0xa598('0x5d'))[_0xa598('0x82')](_0xa598('0xab'))['where']('deletedAt\x20IS\x20NULL')[_0xa598('0x42')](_0xa598('0xad'),_0x128c2d[_0xa598('0xaa')][_0xa598('0x89')]())[_0xa598('0x42')](_0xa598('0xae'))[_0xa598('0x42')](_0xa598('0xaf'),squel[_0xa598('0xb0')]()[_0xa598('0x80')](_0xa598('0xb2'))['from'](_0xa598('0xa5'))[_0xa598('0x42')]('VoiceQueueId\x20=\x20?',_0x22370a['params']['id']['toString']())))[_0xa598('0x89')]();break;default:_0x37cf15=squel[_0xa598('0xa3')]()[_0xa598('0xa4')](_0xa598('0xa5'))[_0xa598('0xb4')]([_0xa598('0xa6'),_0xa598('0xa7'),_0xa598('0xa8'),_0xa598('0xa9'),'VoiceQueueId',_0xa598('0x5c'),_0xa598('0x5d')],squel['select']()[_0xa598('0x80')]('phone','phone')['field']('\x27'+_0x176729+'\x27','scheduledAt')[_0xa598('0x80')]('id','ContactId')[_0xa598('0x80')](_0x128c2d[_0xa598('0xaa')][_0xa598('0x89')](),_0xa598('0xa9'))['field'](_0x22370a['params']['id'][_0xa598('0x89')](),_0xa598('0x64'))[_0xa598('0x80')]('\x27'+_0x176729+'\x27','createdAt')['field']('\x27'+_0x176729+'\x27',_0xa598('0x5d'))[_0xa598('0x82')](_0xa598('0xab'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xa598('0xad'),_0x128c2d[_0xa598('0xaa')][_0xa598('0x89')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xa598('0x89')]();}_0x17b32a['push'](db['sequelize'][_0xa598('0x38')](_0x37cf15));}return BPromise['all'](_0x17b32a);}})[_0xa598('0x31')](function(){var _0x409bf7=[];var _0x319436=squel['insert']()[_0xa598('0xa4')](_0xa598('0xb5'))[_0xa598('0xb4')]([_0xa598('0xb6'),_0xa598('0xa6'),_0xa598('0xb7'),_0xa598('0x5c'),_0xa598('0x5d')],squel[_0xa598('0xb0')]()[_0xa598('0x80')](_0xa598('0xb8'))[_0xa598('0x80')](_0xa598('0xb9'))['field']('ci.OrderBy+1')[_0xa598('0x80')]('\x27'+_0x176729+'\x27',_0xa598('0x5c'))['field']('\x27'+_0x176729+'\x27',_0xa598('0x5d'))['from'](_0xa598('0xba'),'ci')[_0xa598('0x84')](_0xa598('0xa5'),'h',_0xa598('0xbb'))[_0xa598('0x42')](_0xa598('0xbc'),_0x176729)[_0xa598('0x42')](_0xa598('0xbd'),_0xa598('0xbe')))[_0xa598('0x89')]();_0x409bf7['push'](db[_0xa598('0x72')][_0xa598('0x38')](_0x319436));return BPromise[_0xa598('0x96')](_0x409bf7);})['then'](function(){return _0x2d4686;})['then'](respondWithResult(_0x8de326,null))[_0xa598('0x4c')](handleError(_0x8de326,null));};exports[_0xa598('0xbf')]=function(_0x450969,_0x4361cc,_0x35ba26){return db[_0xa598('0x48')]['find']({'where':{'id':_0x450969[_0xa598('0x5a')]['id']}})[_0xa598('0x31')](handleEntityNotFound(_0x4361cc,null))[_0xa598('0x31')](function(_0x160ef4){if(_0x160ef4){return _0x160ef4[_0xa598('0xbf')](_0x450969[_0xa598('0x38')][_0xa598('0x7e')]);}})[_0xa598('0x31')](function(_0x4db642){if(_0x4db642){return db[_0xa598('0x62')]['destroy']({'where':{'ListId':_0x450969[_0xa598('0x38')]['ids'],'VoiceQueueId':_0x450969['params']['id']}})[_0xa598('0x31')](function(){return _0x4db642;});}})[_0xa598('0x31')](respondWithStatusCode(_0x4361cc,null))[_0xa598('0x4c')](handleError(_0x4361cc,null));};exports[_0xa598('0xc0')]=function(_0xbc4a1d,_0x154299,_0x215d6d){var _0xacdb03={};var _0x3e414b={};var _0x287b14;var _0x35cf19;return db[_0xa598('0x48')]['findOne']({'where':{'id':_0xbc4a1d[_0xa598('0x5a')]['id']}})[_0xa598('0x31')](handleEntityNotFound(_0x154299,null))[_0xa598('0x31')](function(_0x35c709){if(_0x35c709){_0x287b14=_0x35c709;_0x3e414b[_0xa598('0x3b')]=_[_0xa598('0x4e')](db[_0xa598('0x9b')][_0xa598('0x36')]);_0x3e414b['query']=_[_0xa598('0x4e')](_0xbc4a1d[_0xa598('0x38')]);_0x3e414b[_0xa598('0x39')]=_[_0xa598('0x3a')](_0x3e414b[_0xa598('0x3b')],_0x3e414b[_0xa598('0x38')]);_0xacdb03[_0xa598('0x3e')]=_[_0xa598('0x3a')](_0x3e414b[_0xa598('0x3b')],qs['fields'](_0xbc4a1d[_0xa598('0x38')][_0xa598('0x3c')]));_0xacdb03[_0xa598('0x3e')]=_0xacdb03[_0xa598('0x3e')][_0xa598('0x3d')]?_0xacdb03['attributes']:_0x3e414b[_0xa598('0x3b')];_0xacdb03['order']=qs[_0xa598('0x41')](_0xbc4a1d[_0xa598('0x38')][_0xa598('0x41')]);_0xacdb03[_0xa598('0x42')]=qs[_0xa598('0x39')](_[_0xa598('0x43')](_0xbc4a1d[_0xa598('0x38')],_0x3e414b[_0xa598('0x39')]));if(_0xbc4a1d['query'][_0xa598('0x44')]){_0xacdb03['where']=_[_0xa598('0x45')](_0xacdb03[_0xa598('0x42')],{'$or':_[_0xa598('0x2d')](_0xacdb03[_0xa598('0x3e')],function(_0x5bd4ff){var _0x4c2c78={};_0x4c2c78[_0x5bd4ff]={'$like':'%'+_0xbc4a1d[_0xa598('0x38')][_0xa598('0x44')]+'%'};return _0x4c2c78;})});}_0xacdb03=_[_0xa598('0x45')]({},_0xacdb03,_0xbc4a1d[_0xa598('0x47')]);return _0x287b14[_0xa598('0xc0')](_0xacdb03);}})[_0xa598('0x31')](function(_0x13c1b0){if(_0x13c1b0){_0x35cf19=_0x13c1b0[_0xa598('0x3d')];if(!_0xbc4a1d['query']['hasOwnProperty'](_0xa598('0x40'))){_0xacdb03[_0xa598('0x1f')]=qs[_0xa598('0x1f')](_0xbc4a1d[_0xa598('0x38')][_0xa598('0x1f')]);_0xacdb03['offset']=qs[_0xa598('0x1e')](_0xbc4a1d[_0xa598('0x38')][_0xa598('0x1e')]);}return _0x287b14[_0xa598('0xc0')](_0xacdb03);}})[_0xa598('0x31')](function(_0x44f94c){if(_0x44f94c){return _0x44f94c?{'count':_0x35cf19,'rows':_0x44f94c}:null;}})[_0xa598('0x31')](respondWithResult(_0x154299,null))[_0xa598('0x4c')](handleError(_0x154299,null));};exports[_0xa598('0xc1')]=function(_0x4fcec8,_0x5173fb,_0x5461af){var _0x21d428,_0x2891a2;return db['VoiceQueue']['find']({'where':{'id':_0x4fcec8[_0xa598('0x5a')]['id']}})[_0xa598('0x31')](handleEntityNotFound(_0x5173fb,null))[_0xa598('0x31')](function(_0xccb143){if(_0xccb143){_0x2891a2=_0xccb143;return _0xccb143['addBlackLists'](_0x4fcec8[_0xa598('0x5e')]['ids'],_[_0xa598('0x5b')](_0x4fcec8[_0xa598('0x5e')],['ids','id'])||{});}return null;})[_0xa598('0xa0')](function(_0x14a8ff){var _0x45498b;_0x21d428=_0x14a8ff||[];var _0x522f1b=[];if(_0x14a8ff){for(var _0x420d4b=0x0;_0x420d4b<_0x14a8ff[_0xa598('0x3d')];_0x420d4b+=0x1){var _0x24b6df=_0x14a8ff[_0x420d4b][_0xa598('0x29')]({'plain':!![]});_0x45498b=squel[_0xa598('0xa3')]()['into'](_0xa598('0xc2'))['fromQuery'](['phone',_0xa598('0xa8'),'ListId','VoiceQueueId','createdAt','updatedAt'],squel[_0xa598('0xb0')]()[_0xa598('0x80')](_0xa598('0xa6'),_0xa598('0xa6'))[_0xa598('0x80')]('id',_0xa598('0xa8'))['field'](_0x24b6df[_0xa598('0xaa')][_0xa598('0x89')](),'ListId')[_0xa598('0x80')](_0x4fcec8[_0xa598('0x5a')]['id'][_0xa598('0x89')](),_0xa598('0x64'))['field']('NOW()',_0xa598('0x5c'))['field'](_0xa598('0xc3'),'updatedAt')[_0xa598('0x82')](_0xa598('0xab'))[_0xa598('0x42')](_0xa598('0xac'))[_0xa598('0x42')](_0xa598('0xad'),_0x24b6df[_0xa598('0xaa')][_0xa598('0x89')]())[_0xa598('0x42')](_0xa598('0xae')))[_0xa598('0x89')]();_0x522f1b[_0xa598('0x88')](db['sequelize'][_0xa598('0x38')](_0x45498b));}return BPromise[_0xa598('0x96')](_0x522f1b);}})[_0xa598('0x31')](function(){return _0x21d428;})[_0xa598('0x31')](respondWithResult(_0x5173fb,null))['catch'](handleError(_0x5173fb,null));};exports[_0xa598('0xc4')]=function(_0x1efed6,_0x3b36b,_0xb75826){return db['VoiceQueue'][_0xa598('0x4f')]({'where':{'id':_0x1efed6[_0xa598('0x5a')]['id']}})[_0xa598('0x31')](handleEntityNotFound(_0x3b36b,null))[_0xa598('0x31')](function(_0x2d265b){if(_0x2d265b){return _0x2d265b[_0xa598('0xc4')](_0x1efed6[_0xa598('0x38')][_0xa598('0x7e')]);}})[_0xa598('0x31')](function(_0xa41482){if(_0xa41482){return db['CmHopperBlack'][_0xa598('0x28')]({'where':{'ListId':_0x1efed6[_0xa598('0x38')][_0xa598('0x7e')],'VoiceQueueId':_0x1efed6[_0xa598('0x5a')]['id']}})[_0xa598('0x31')](function(){return _0xa41482;});}})['then'](respondWithStatusCode(_0x3b36b,null))[_0xa598('0x4c')](handleError(_0x3b36b,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 9e5d341..8d161cf 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 _0x4cb0=['update','remove','emit','hook','exports','VoiceQueue','setMaxListeners','save'];(function(_0x1c274b,_0x1b3fec){var _0x33597c=function(_0x5c0d32){while(--_0x5c0d32){_0x1c274b['push'](_0x1c274b['shift']());}};_0x33597c(++_0x1b3fec);}(_0x4cb0,0x16d));var _0x04cb=function(_0x999240,_0x3dcd00){_0x999240=_0x999240-0x0;var _0x93d5e=_0x4cb0[_0x999240];return _0x93d5e;};'use strict';var EventEmitter=require('events');var VoiceQueue=require('../../mysqldb')['db'][_0x04cb('0x0')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x04cb('0x1')](0x0);var events={'afterCreate':_0x04cb('0x2'),'afterUpdate':_0x04cb('0x3'),'afterDestroy':_0x04cb('0x4')};function emitEvent(_0x1cc605){return function(_0x596fb6,_0xfa0cfc,_0x45b985){VoiceQueueEvents['emit'](_0x1cc605+':'+_0x596fb6['id'],_0x596fb6);VoiceQueueEvents[_0x04cb('0x5')](_0x1cc605,_0x596fb6);_0x45b985(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x04cb('0x6')](e,emitEvent(event));}}module[_0x04cb('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0x21e5=['remove','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x2b8ae8,_0xffad5){var _0x9c9a1d=function(_0x5d98db){while(--_0x5d98db){_0x2b8ae8['push'](_0x2b8ae8['shift']());}};_0x9c9a1d(++_0xffad5);}(_0x21e5,0x1c4));var _0x521e=function(_0x359bbe,_0x5b7fcc){_0x359bbe=_0x359bbe-0x0;var _0x1b3353=_0x21e5[_0x359bbe];return _0x1b3353;};'use strict';var EventEmitter=require(_0x521e('0x0'));var VoiceQueue=require(_0x521e('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x521e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x521e('0x3')};function emitEvent(_0x415cbc){return function(_0x3c5a54,_0x4646cf,_0x7fdcc7){VoiceQueueEvents[_0x521e('0x4')](_0x415cbc+':'+_0x3c5a54['id'],_0x3c5a54);VoiceQueueEvents['emit'](_0x415cbc,_0x3c5a54);_0x7fdcc7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x521e('0x5')](e,emitEvent(event));}}module[_0x521e('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 4bcf362..2133252 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 _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x831e73,_0x16a972){var _0x3a2097=function(_0x106857){while(--_0x106857){_0x831e73['push'](_0x831e73['shift']());}};_0x3a2097(++_0x16a972);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x343e70,_0xe5f373){var _0x2742fd=function(_0x27e56e){while(--_0x27e56e){_0x343e70['push'](_0x343e70['shift']());}};_0x2742fd(++_0xe5f373);}(_0x008c,0x188));var _0xc008=function(_0x194494,_0x57c76e){_0x194494=_0x194494-0x0;var _0x45acaf=_0x008c[_0x194494];return _0x45acaf;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('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 e6b4049..4a93396 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 _0x85a9=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','include','map','model','ShowVoiceQueue','find','catch','lodash','moment','bluebird'];(function(_0x568d32,_0x25edf9){var _0x59d096=function(_0xc06b41){while(--_0xc06b41){_0x568d32['push'](_0x568d32['shift']());}};_0x59d096(++_0x25edf9);}(_0x85a9,0x135));var _0x985a=function(_0x3598bb,_0x24befa){_0x3598bb=_0x3598bb-0x0;var _0x13c837=_0x85a9[_0x3598bb];return _0x13c837;};'use strict';var _=require(_0x985a('0x0'));var util=require('util');var moment=require(_0x985a('0x1'));var BPromise=require(_0x985a('0x2'));var rs=require(_0x985a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x985a('0x4'));var logger=require(_0x985a('0x5'))(_0x985a('0x6'));var config=require(_0x985a('0x7'));var jayson=require(_0x985a('0x8'));var client=jayson[_0x985a('0x9')][_0x985a('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x985a('0xb')],{'host':_0x985a('0xc'),'port':0x18eb});var socket=require(_0x985a('0xd'))(new Redis(config[_0x985a('0xb')]));require('./voiceQueue.socket')[_0x985a('0xe')](socket);function respondWithRpcPromise(_0x4e55a4,_0x274e0d,_0x333669){return new BPromise(function(_0x21ae87,_0x40f97c){return client[_0x985a('0xf')](_0x4e55a4,_0x333669)[_0x985a('0x10')](function(_0x57fcf8){logger[_0x985a('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x274e0d,_0x985a('0x12'));logger[_0x985a('0x13')](_0x985a('0x14'),_0x274e0d,'request\x20sent',JSON[_0x985a('0x15')](_0x57fcf8));if(_0x57fcf8[_0x985a('0x16')]){if(_0x57fcf8['error'][_0x985a('0x17')]===0x1f4){logger['error'](_0x985a('0x18'),_0x274e0d,_0x57fcf8[_0x985a('0x16')]['message']);return _0x40f97c(_0x57fcf8[_0x985a('0x16')]['message']);}logger['error'](_0x985a('0x18'),_0x274e0d,_0x57fcf8[_0x985a('0x16')][_0x985a('0x19')]);return _0x21ae87(_0x57fcf8[_0x985a('0x16')][_0x985a('0x19')]);}else{logger[_0x985a('0x11')](_0x985a('0x18'),_0x274e0d,'request\x20sent');_0x21ae87(_0x57fcf8['result']['message']);}})['catch'](function(_0x15bcac){logger[_0x985a('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x274e0d,_0x15bcac);_0x40f97c(_0x15bcac);});});}exports[_0x985a('0x1a')]=function(_0x588467){var _0x29b023=this;return new Promise(function(_0x140c35,_0x12107b){return db[_0x985a('0x1b')][_0x985a('0x1c')]({'raw':_0x588467['options']?_0x588467[_0x985a('0x1d')][_0x985a('0x1e')]===undefined?!![]:![]:!![],'where':_0x588467[_0x985a('0x1d')]?_0x588467[_0x985a('0x1d')][_0x985a('0x1f')]||null:null,'attributes':_0x588467[_0x985a('0x1d')]?_0x588467[_0x985a('0x1d')][_0x985a('0x20')]||null:null,'limit':_0x588467[_0x985a('0x1d')]?_0x588467[_0x985a('0x1d')]['limit']||null:null,'include':_0x588467[_0x985a('0x1d')]?_0x588467[_0x985a('0x1d')][_0x985a('0x21')]?_[_0x985a('0x22')](_0x588467[_0x985a('0x1d')]['include'],function(_0x50ff46){return{'model':db[_0x50ff46[_0x985a('0x23')]],'as':_0x50ff46['as'],'attributes':_0x50ff46[_0x985a('0x20')],'include':_0x50ff46[_0x985a('0x21')]?_[_0x985a('0x22')](_0x50ff46['include'],function(_0x138dea){return{'model':db[_0x138dea[_0x985a('0x23')]],'as':_0x138dea['as'],'attributes':_0x138dea[_0x985a('0x20')],'include':_0x138dea[_0x985a('0x21')]?_[_0x985a('0x22')](_0x138dea[_0x985a('0x21')],function(_0x331d6e){return{'model':db[_0x331d6e['model']],'as':_0x331d6e['as'],'attributes':_0x331d6e[_0x985a('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x28ca66){logger[_0x985a('0x11')](_0x985a('0x1a'),_0x588467);logger[_0x985a('0x13')](_0x985a('0x1a'),_0x588467,JSON[_0x985a('0x15')](_0x28ca66));_0x140c35(_0x28ca66);})['catch'](function(_0x5879ad){logger[_0x985a('0x16')]('GetVoiceQueue',_0x5879ad[_0x985a('0x19')],_0x588467);_0x12107b(_0x29b023[_0x985a('0x16')](0x1f4,_0x5879ad[_0x985a('0x19')]));});});};exports[_0x985a('0x24')]=function(_0x10f65c){var _0x248b51=this;return new Promise(function(_0x16c9c8,_0x1b3302){return db['VoiceQueue'][_0x985a('0x25')]({'raw':_0x10f65c[_0x985a('0x1d')]?_0x10f65c[_0x985a('0x1d')][_0x985a('0x1e')]===undefined?!![]:![]:!![],'where':_0x10f65c['options']?_0x10f65c[_0x985a('0x1d')]['where']||null:null,'attributes':_0x10f65c[_0x985a('0x1d')]?_0x10f65c[_0x985a('0x1d')][_0x985a('0x20')]||null:null,'include':_0x10f65c[_0x985a('0x1d')]?_0x10f65c[_0x985a('0x1d')][_0x985a('0x21')]?_[_0x985a('0x22')](_0x10f65c[_0x985a('0x1d')][_0x985a('0x21')],function(_0x2c0504){return{'model':db[_0x2c0504[_0x985a('0x23')]],'as':_0x2c0504['as'],'attributes':_0x2c0504[_0x985a('0x20')],'include':_0x2c0504[_0x985a('0x21')]?_['map'](_0x2c0504[_0x985a('0x21')],function(_0x5cef0e){return{'model':db[_0x5cef0e[_0x985a('0x23')]],'as':_0x5cef0e['as'],'attributes':_0x5cef0e[_0x985a('0x20')],'include':_0x5cef0e[_0x985a('0x21')]?_[_0x985a('0x22')](_0x5cef0e['include'],function(_0x261e99){return{'model':db[_0x261e99['model']],'as':_0x261e99['as'],'attributes':_0x261e99['attributes']};}):[]};}):[]};}):[]:[]})[_0x985a('0x10')](function(_0x501d46){logger[_0x985a('0x11')](_0x985a('0x24'),_0x10f65c);logger[_0x985a('0x13')](_0x985a('0x24'),_0x10f65c,JSON[_0x985a('0x15')](_0x501d46));_0x16c9c8(_0x501d46);})[_0x985a('0x26')](function(_0x245237){logger[_0x985a('0x16')](_0x985a('0x24'),_0x245237[_0x985a('0x19')],_0x10f65c);_0x1b3302(_0x248b51[_0x985a('0x16')](0x1f4,_0x245237[_0x985a('0x19')]));});});}; \ No newline at end of file +var _0x8908=['options','where','attributes','limit','include','map','model','find','ShowVoiceQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','raw'];(function(_0x3d550f,_0x2df132){var _0x32e660=function(_0x32d8df){while(--_0x32d8df){_0x3d550f['push'](_0x3d550f['shift']());}};_0x32e660(++_0x2df132);}(_0x8908,0x8a));var _0x8890=function(_0x2c6e3f,_0x240e60){_0x2c6e3f=_0x2c6e3f-0x0;var _0x49f7e6=_0x8908[_0x2c6e3f];return _0x49f7e6;};'use strict';var _=require(_0x8890('0x0'));var util=require(_0x8890('0x1'));var moment=require(_0x8890('0x2'));var BPromise=require(_0x8890('0x3'));var rs=require(_0x8890('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8890('0x5'))['db'];var utils=require(_0x8890('0x6'));var logger=require(_0x8890('0x7'))(_0x8890('0x8'));var config=require(_0x8890('0x9'));var jayson=require(_0x8890('0xa'));var client=jayson[_0x8890('0xb')]['http']({'port':0x232a});config[_0x8890('0xc')]=_[_0x8890('0xd')](config[_0x8890('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x8890('0xe'))(new Redis(config[_0x8890('0xc')]));require(_0x8890('0xf'))[_0x8890('0x10')](socket);function respondWithRpcPromise(_0x29c166,_0x5b5415,_0x20883a){return new BPromise(function(_0x590df0,_0x207023){return client[_0x8890('0x11')](_0x29c166,_0x20883a)[_0x8890('0x12')](function(_0x107960){logger[_0x8890('0x13')](_0x8890('0x14'),_0x5b5415,_0x8890('0x15'));logger[_0x8890('0x16')](_0x8890('0x17'),_0x5b5415,'request\x20sent',JSON[_0x8890('0x18')](_0x107960));if(_0x107960['error']){if(_0x107960[_0x8890('0x19')][_0x8890('0x1a')]===0x1f4){logger[_0x8890('0x19')](_0x8890('0x14'),_0x5b5415,_0x107960['error'][_0x8890('0x1b')]);return _0x207023(_0x107960['error']['message']);}logger[_0x8890('0x19')]('VoiceQueue,\x20%s,\x20%s',_0x5b5415,_0x107960[_0x8890('0x19')]['message']);return _0x590df0(_0x107960['error'][_0x8890('0x1b')]);}else{logger[_0x8890('0x13')](_0x8890('0x14'),_0x5b5415,_0x8890('0x15'));_0x590df0(_0x107960[_0x8890('0x1c')][_0x8890('0x1b')]);}})[_0x8890('0x1d')](function(_0x4054dd){logger[_0x8890('0x19')](_0x8890('0x14'),_0x5b5415,_0x4054dd);_0x207023(_0x4054dd);});});}exports[_0x8890('0x1e')]=function(_0x40d611){var _0x266da2=this;return new Promise(function(_0x316bf6,_0x4a5770){return db[_0x8890('0x1f')][_0x8890('0x20')]({'raw':_0x40d611['options']?_0x40d611['options'][_0x8890('0x21')]===undefined?!![]:![]:!![],'where':_0x40d611[_0x8890('0x22')]?_0x40d611[_0x8890('0x22')][_0x8890('0x23')]||null:null,'attributes':_0x40d611[_0x8890('0x22')]?_0x40d611[_0x8890('0x22')][_0x8890('0x24')]||null:null,'limit':_0x40d611['options']?_0x40d611['options'][_0x8890('0x25')]||null:null,'include':_0x40d611[_0x8890('0x22')]?_0x40d611['options'][_0x8890('0x26')]?_[_0x8890('0x27')](_0x40d611[_0x8890('0x22')]['include'],function(_0x5110f0){return{'model':db[_0x5110f0[_0x8890('0x28')]],'as':_0x5110f0['as'],'attributes':_0x5110f0['attributes'],'include':_0x5110f0[_0x8890('0x26')]?_[_0x8890('0x27')](_0x5110f0[_0x8890('0x26')],function(_0x15e27d){return{'model':db[_0x15e27d[_0x8890('0x28')]],'as':_0x15e27d['as'],'attributes':_0x15e27d[_0x8890('0x24')],'include':_0x15e27d[_0x8890('0x26')]?_[_0x8890('0x27')](_0x15e27d[_0x8890('0x26')],function(_0x6dee77){return{'model':db[_0x6dee77[_0x8890('0x28')]],'as':_0x6dee77['as'],'attributes':_0x6dee77[_0x8890('0x24')]};}):[]};}):[]};}):[]:[]})[_0x8890('0x12')](function(_0x34cbce){logger['info']('GetVoiceQueue',_0x40d611);logger[_0x8890('0x16')](_0x8890('0x1e'),_0x40d611,JSON[_0x8890('0x18')](_0x34cbce));_0x316bf6(_0x34cbce);})['catch'](function(_0x71c187){logger['error']('GetVoiceQueue',_0x71c187[_0x8890('0x1b')],_0x40d611);_0x4a5770(_0x266da2[_0x8890('0x19')](0x1f4,_0x71c187[_0x8890('0x1b')]));});});};exports['ShowVoiceQueue']=function(_0x95363a){var _0x503cd2=this;return new Promise(function(_0x52b597,_0x41bf7f){return db[_0x8890('0x1f')][_0x8890('0x29')]({'raw':_0x95363a[_0x8890('0x22')]?_0x95363a['options'][_0x8890('0x21')]===undefined?!![]:![]:!![],'where':_0x95363a[_0x8890('0x22')]?_0x95363a[_0x8890('0x22')]['where']||null:null,'attributes':_0x95363a['options']?_0x95363a[_0x8890('0x22')][_0x8890('0x24')]||null:null,'include':_0x95363a[_0x8890('0x22')]?_0x95363a[_0x8890('0x22')][_0x8890('0x26')]?_['map'](_0x95363a[_0x8890('0x22')][_0x8890('0x26')],function(_0x5250e0){return{'model':db[_0x5250e0[_0x8890('0x28')]],'as':_0x5250e0['as'],'attributes':_0x5250e0['attributes'],'include':_0x5250e0[_0x8890('0x26')]?_[_0x8890('0x27')](_0x5250e0[_0x8890('0x26')],function(_0x1de6f4){return{'model':db[_0x1de6f4[_0x8890('0x28')]],'as':_0x1de6f4['as'],'attributes':_0x1de6f4[_0x8890('0x24')],'include':_0x1de6f4[_0x8890('0x26')]?_['map'](_0x1de6f4[_0x8890('0x26')],function(_0x2f4dc3){return{'model':db[_0x2f4dc3['model']],'as':_0x2f4dc3['as'],'attributes':_0x2f4dc3['attributes']};}):[]};}):[]};}):[]:[]})[_0x8890('0x12')](function(_0x4e820b){logger[_0x8890('0x13')]('ShowVoiceQueue',_0x95363a);logger[_0x8890('0x16')]('ShowVoiceQueue',_0x95363a,JSON[_0x8890('0x18')](_0x4e820b));_0x52b597(_0x4e820b);})['catch'](function(_0x112244){logger[_0x8890('0x19')](_0x8890('0x2a'),_0x112244[_0x8890('0x1b')],_0x95363a);_0x41bf7f(_0x503cd2[_0x8890('0x19')](0x1f4,_0x112244[_0x8890('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index c91b3da..d7fa20a 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 _0xd0e5=['register','length','voiceQueue:','./voiceQueue.events','remove','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd0e5,0x14c));var _0x5d0e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xd0e5[_0x4ea69d];return _0x5318e0;};'use strict';var VoiceQueueEvents=require(_0x5d0e('0x0'));var events=['save',_0x5d0e('0x1'),_0x5d0e('0x2')];function createListener(_0x42e88d,_0x293210){return function(_0x40829a){_0x293210[_0x5d0e('0x3')](_0x42e88d,_0x40829a);};}function removeListener(_0x7c5d6f,_0x5271cb){return function(){VoiceQueueEvents['removeListener'](_0x7c5d6f,_0x5271cb);};}exports[_0x5d0e('0x4')]=function(_0x206489){for(var _0x43f320=0x0,_0xd8d582=events[_0x5d0e('0x5')];_0x43f320<_0xd8d582;_0x43f320++){var _0x4316bb=events[_0x43f320];var _0x1efbae=createListener(_0x5d0e('0x6')+_0x4316bb,_0x206489);VoiceQueueEvents['on'](_0x4316bb,_0x1efbae);}}; \ No newline at end of file +var _0x59b1=['removeListener','register','length','voiceQueue:','./voiceQueue.events','save','remove','update'];(function(_0x41a6b1,_0x33302b){var _0x26a187=function(_0x4fa33f){while(--_0x4fa33f){_0x41a6b1['push'](_0x41a6b1['shift']());}};_0x26a187(++_0x33302b);}(_0x59b1,0x10c));var _0x159b=function(_0x38344e,_0x11a470){_0x38344e=_0x38344e-0x0;var _0x1ef998=_0x59b1[_0x38344e];return _0x1ef998;};'use strict';var VoiceQueueEvents=require(_0x159b('0x0'));var events=[_0x159b('0x1'),_0x159b('0x2'),_0x159b('0x3')];function createListener(_0x47e523,_0x27e016){return function(_0x36356d){_0x27e016['emit'](_0x47e523,_0x36356d);};}function removeListener(_0x1cc5be,_0x189b16){return function(){VoiceQueueEvents[_0x159b('0x4')](_0x1cc5be,_0x189b16);};}exports[_0x159b('0x5')]=function(_0x72a1b1){for(var _0x2d42cb=0x0,_0x436770=events[_0x159b('0x6')];_0x2d42cb<_0x436770;_0x2d42cb++){var _0x1a21de=events[_0x2d42cb];var _0x27504e=createListener(_0x159b('0x7')+_0x1a21de,_0x72a1b1);VoiceQueueEvents['on'](_0x1a21de,_0x27504e);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index a91799c..f604062 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 _0xdeca=['describe','getVoiceQueuesReport','/:id','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/describe','isAuthenticated'];(function(_0x1c24bb,_0x20a80c){var _0x26851d=function(_0x322c44){while(--_0x322c44){_0x1c24bb['push'](_0x1c24bb['shift']());}};_0x26851d(++_0x20a80c);}(_0xdeca,0xff));var _0xadec=function(_0x47531b,_0x8b7c8f){_0x47531b=_0x47531b-0x0;var _0x1471f8=_0xdeca[_0x47531b];return _0x1471f8;};'use strict';var multer=require(_0xadec('0x0'));var util=require(_0xadec('0x1'));var path=require(_0xadec('0x2'));var timeout=require(_0xadec('0x3'));var express=require(_0xadec('0x4'));var router=express[_0xadec('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xadec('0x6'));var interaction=require(_0xadec('0x7'));var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xadec('0x8')](_0xadec('0x9'),auth[_0xadec('0xa')](),controller[_0xadec('0xb')]);router[_0xadec('0x8')]('/index',auth[_0xadec('0xa')](),controller[_0xadec('0xc')]);router['get'](_0xadec('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xadec('0xe')]('/',auth[_0xadec('0xa')](),controller[_0xadec('0xf')]);router[_0xadec('0x10')]('/:id',auth[_0xadec('0xa')](),controller[_0xadec('0x11')]);router['delete'](_0xadec('0xd'),auth[_0xadec('0xa')](),controller['destroy']);module[_0xadec('0x12')]=router; \ No newline at end of file +var _0x02dc=['./voiceQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x27431e,_0x5140c9){var _0x520750=function(_0x3f32ba){while(--_0x3f32ba){_0x27431e['push'](_0x27431e['shift']());}};_0x520750(++_0x5140c9);}(_0x02dc,0xbf));var _0xc02d=function(_0x462eb2,_0x585579){_0x462eb2=_0x462eb2-0x0;var _0x27dcd6=_0x02dc[_0x462eb2];return _0x27dcd6;};'use strict';var multer=require('multer');var util=require(_0xc02d('0x0'));var path=require(_0xc02d('0x1'));var timeout=require(_0xc02d('0x2'));var express=require('express');var router=express[_0xc02d('0x3')]();var fs_extra=require(_0xc02d('0x4'));var auth=require(_0xc02d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc02d('0x6'));var controller=require(_0xc02d('0x7'));router[_0xc02d('0x8')]('/',auth['isAuthenticated'](),controller[_0xc02d('0x9')]);router['get'](_0xc02d('0xa'),auth[_0xc02d('0xb')](),controller[_0xc02d('0xc')]);router['get']('/index',auth[_0xc02d('0xb')](),controller['getVoiceQueuesReport']);router['get'](_0xc02d('0xd'),auth[_0xc02d('0xb')](),controller[_0xc02d('0xe')]);router['post']('/',auth[_0xc02d('0xb')](),controller[_0xc02d('0xf')]);router['put'](_0xc02d('0xd'),auth[_0xc02d('0xb')](),controller['update']);router[_0xc02d('0x10')](_0xc02d('0xd'),auth[_0xc02d('0xb')](),controller['destroy']);module[_0xc02d('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 8b5ac2b..ba46b38 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 _0xe0be=['queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','getDataValue'];(function(_0x5b78fe,_0x44542c){var _0x24ac3c=function(_0x552b51){while(--_0x552b51){_0x5b78fe['push'](_0x5b78fe['shift']());}};_0x24ac3c(++_0x44542c);}(_0xe0be,0xbe));var _0xee0b=function(_0x50675b,_0xba75bf){_0x50675b=_0x50675b-0x0;var _0x4b2d1b=_0xe0be[_0x50675b];return _0x4b2d1b;};'use strict';var Sequelize=require(_0xee0b('0x0'));var moment=require('moment');module[_0xee0b('0x1')]={'type':{'type':Sequelize[_0xee0b('0x2')]},'uniqueid':{'type':Sequelize[_0xee0b('0x2')]},'calleridnum':{'type':Sequelize[_0xee0b('0x2')]},'calleridname':{'type':Sequelize[_0xee0b('0x2')]},'queue':{'type':Sequelize[_0xee0b('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xee0b('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x3e426b){var _0x335587=moment(_0x3e426b);var _0xc4afa7=moment(this[_0xee0b('0x4')](_0xee0b('0x5')))['format'](_0xee0b('0x6'));var _0x431384=_0x335587[_0xee0b('0x7')](_0xc4afa7,_0xee0b('0x8'));this[_0xee0b('0x9')](_0xee0b('0xa'),_0x3e426b);this[_0xee0b('0x9')](_0xee0b('0xb'),_0x431384||null);}},'position':{'type':Sequelize[_0xee0b('0xc')]},'count':{'type':Sequelize[_0xee0b('0xc')]},'queuecallerabandon':{'type':Sequelize[_0xee0b('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xee0b('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0xee0b('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0xee0b('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0xee0b('0xc')]},'channel':{'type':Sequelize[_0xee0b('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xee0b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xee0b('0x2')]},'exten':{'type':Sequelize[_0xee0b('0x2')]},'priority':{'type':Sequelize[_0xee0b('0x2')]},'holdtime':{'type':Sequelize[_0xee0b('0xc')]},'mohtime':{'type':Sequelize[_0xee0b('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xee0b('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xee0b('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xee0b('0xe')},'transferexten':{'type':Sequelize[_0xee0b('0x2')]},'transferuniqueid':{'type':Sequelize[_0xee0b('0x2')]},'disposition':{'type':Sequelize[_0xee0b('0x2')]},'secondDisposition':{'type':Sequelize[_0xee0b('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0xee0b('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0x55cb=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','queuecallerjoinAt','format','diff','seconds','setDataValue','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x55cb,0x1c1));var _0xb55c=function(_0x1ebc6c,_0x58a00b){_0x1ebc6c=_0x1ebc6c-0x0;var _0x3a826d=_0x55cb[_0x1ebc6c];return _0x3a826d;};'use strict';var Sequelize=require(_0xb55c('0x0'));var moment=require(_0xb55c('0x1'));module[_0xb55c('0x2')]={'type':{'type':Sequelize[_0xb55c('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb55c('0x3')]},'queue':{'type':Sequelize[_0xb55c('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xb55c('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xb55c('0x4')],'set':function(_0x101087){var _0x340d3f=moment(_0x101087);var _0x4616dc=moment(this['getDataValue'](_0xb55c('0x5')))[_0xb55c('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0x182480=_0x340d3f[_0xb55c('0x7')](_0x4616dc,_0xb55c('0x8'));this[_0xb55c('0x9')]('queuecallerleaveAt',_0x101087);this[_0xb55c('0x9')]('holdtime',_0x182480||null);}},'position':{'type':Sequelize[_0xb55c('0xa')]},'count':{'type':Sequelize[_0xb55c('0xa')]},'queuecallerabandon':{'type':Sequelize[_0xb55c('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xb55c('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xb55c('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0xb55c('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xb55c('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0xb55c('0x3')],'comment':_0xb55c('0xc')},'originalposition':{'type':Sequelize[_0xb55c('0xa')]},'channel':{'type':Sequelize[_0xb55c('0x3')]},'connectedlinenum':{'type':Sequelize[_0xb55c('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xb55c('0x3')]},'priority':{'type':Sequelize[_0xb55c('0x3')]},'holdtime':{'type':Sequelize[_0xb55c('0xa')]},'mohtime':{'type':Sequelize[_0xb55c('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xb55c('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xb55c('0x3')]},'transfer':{'type':Sequelize[_0xb55c('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xb55c('0x3')],'comment':_0xb55c('0xd')},'transferexten':{'type':Sequelize[_0xb55c('0x3')]},'transferuniqueid':{'type':Sequelize[_0xb55c('0x3')]},'disposition':{'type':Sequelize[_0xb55c('0x3')]},'secondDisposition':{'type':Sequelize[_0xb55c('0x3')]},'thirdDisposition':{'type':Sequelize[_0xb55c('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xb55c('0xa')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index b0b8c8d..30e62ef 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 _0x743c=['lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','length','find','catch','body','describe','getVoiceQueuesReport','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x1b1a3b,_0x52a88a){var _0x385347=function(_0x4ca60a){while(--_0x4ca60a){_0x1b1a3b['push'](_0x1b1a3b['shift']());}};_0x385347(++_0x52a88a);}(_0x743c,0x9e));var _0xc743=function(_0x4f3522,_0x3e9fb){_0x4f3522=_0x4f3522-0x0;var _0x5b4de7=_0x743c[_0x4f3522];return _0x5b4de7;};'use strict';var emlformat=require(_0xc743('0x0'));var rimraf=require(_0xc743('0x1'));var zipdir=require(_0xc743('0x2'));var jsonpatch=require(_0xc743('0x3'));var rp=require(_0xc743('0x4'));var moment=require(_0xc743('0x5'));var BPromise=require(_0xc743('0x6'));var Mustache=require(_0xc743('0x7'));var util=require(_0xc743('0x8'));var path=require(_0xc743('0x9'));var sox=require(_0xc743('0xa'));var csv=require(_0xc743('0xb'));var ejs=require(_0xc743('0xc'));var fs=require('fs');var fs_extra=require(_0xc743('0xd'));var _=require(_0xc743('0xe'));var squel=require(_0xc743('0xf'));var crypto=require(_0xc743('0x10'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc743('0xb'));var querystring=require(_0xc743('0x11'));var Papa=require(_0xc743('0x12'));var Redis=require(_0xc743('0x13'));var authService=require(_0xc743('0x14'));var qs=require(_0xc743('0x15'));var as=require(_0xc743('0x16'));var hardwareService=require(_0xc743('0x17'));var logger=require(_0xc743('0x18'))(_0xc743('0x19'));var utils=require(_0xc743('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xc743('0x1b'));var db=require(_0xc743('0x1c'))['db'];config[_0xc743('0x1d')]=_[_0xc743('0x1e')](config['redis'],{'host':_0xc743('0x1f'),'port':0x18eb});var socket=require(_0xc743('0x20'))(new Redis(config['redis']));require(_0xc743('0x21'))[_0xc743('0x22')](socket);function respondWithStatusCode(_0x1dbde8,_0x2f9069){_0x2f9069=_0x2f9069||0xcc;return function(_0x41ef01){if(_0x41ef01){return _0x1dbde8['sendStatus'](_0x2f9069);}return _0x1dbde8['status'](_0x2f9069)['end']();};}function respondWithResult(_0x5240ca,_0x57c779){_0x57c779=_0x57c779||0xc8;return function(_0x183463){if(_0x183463){return _0x5240ca[_0xc743('0x23')](_0x57c779)['json'](_0x183463);}};}function respondWithFilteredResult(_0xe53579,_0x22a63a){return function(_0x1d6012){if(_0x1d6012){var _0xd1aaf3=typeof _0x22a63a[_0xc743('0x24')]===_0xc743('0x25')&&typeof _0x22a63a[_0xc743('0x26')]===_0xc743('0x25');var _0x258374=_0x1d6012['count'];var _0x5e7c75=_0xd1aaf3?0x0:_0x22a63a[_0xc743('0x24')];var _0x3abf6f=_0xd1aaf3?_0x1d6012[_0xc743('0x27')]:_0x22a63a[_0xc743('0x24')]+_0x22a63a[_0xc743('0x26')];var _0x5c7c23;if(_0x3abf6f>=_0x258374){_0x3abf6f=_0x258374;_0x5c7c23=0xc8;}else{_0x5c7c23=0xce;}_0xe53579[_0xc743('0x23')](_0x5c7c23);return _0xe53579[_0xc743('0x28')](_0xc743('0x29'),_0x5e7c75+'-'+_0x3abf6f+'/'+_0x258374)[_0xc743('0x2a')](_0x1d6012);}return null;};}function patchUpdates(_0x56926e){return function(_0x480847){try{jsonpatch[_0xc743('0x2b')](_0x480847,_0x56926e,!![]);}catch(_0x31af2b){return BPromise[_0xc743('0x2c')](_0x31af2b);}return _0x480847[_0xc743('0x2d')]();};}function saveUpdates(_0x105e38,_0x1ae80e){return function(_0x3ff31c){if(_0x3ff31c){return _0x3ff31c[_0xc743('0x2e')](_0x105e38)[_0xc743('0x2f')](function(_0x193e0a){return _0x193e0a;});}return null;};}function removeEntity(_0x395eda,_0x174ee9){return function(_0x124f33){if(_0x124f33){return _0x124f33[_0xc743('0x30')]()[_0xc743('0x2f')](function(){_0x395eda[_0xc743('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5baec5,_0x5b36c1){return function(_0x5def7c){if(!_0x5def7c){_0x5baec5['sendStatus'](0x194);}return _0x5def7c;};}function handleError(_0x136c7e,_0x5c9478){_0x5c9478=_0x5c9478||0x1f4;return function(_0x4e1836){logger['error'](_0x4e1836[_0xc743('0x31')]);if(_0x4e1836[_0xc743('0x32')]){delete _0x4e1836[_0xc743('0x32')];}_0x136c7e[_0xc743('0x23')](_0x5c9478)['send'](_0x4e1836);};}exports[_0xc743('0x33')]=function(_0x28bf0d,_0x29c2a4){var _0x7a4032={},_0x1b1645={},_0x3f8d38={'count':0x0,'rows':[]};var _0x35faad=_[_0xc743('0x34')](db[_0xc743('0x35')][_0xc743('0x36')],function(_0xab5121){return{'name':_0xab5121[_0xc743('0x37')],'type':_0xab5121[_0xc743('0x38')][_0xc743('0x39')]};});_0x1b1645[_0xc743('0x3a')]=_['map'](_0x35faad,_0xc743('0x32'));_0x1b1645['query']=_[_0xc743('0x3b')](_0x28bf0d[_0xc743('0x3c')]);_0x1b1645[_0xc743('0x3d')]=_[_0xc743('0x3e')](_0x1b1645[_0xc743('0x3a')],_0x1b1645['query']);_0x7a4032[_0xc743('0x3f')]=_['intersection'](_0x1b1645[_0xc743('0x3a')],qs[_0xc743('0x40')](_0x28bf0d[_0xc743('0x3c')]['fields']));_0x7a4032[_0xc743('0x3f')]=_0x7a4032[_0xc743('0x3f')]['length']?_0x7a4032[_0xc743('0x3f')]:_0x1b1645[_0xc743('0x3a')];if(!_0x28bf0d[_0xc743('0x3c')]['hasOwnProperty'](_0xc743('0x41'))){_0x7a4032[_0xc743('0x26')]=qs[_0xc743('0x26')](_0x28bf0d[_0xc743('0x3c')]['limit']);_0x7a4032[_0xc743('0x24')]=qs[_0xc743('0x24')](_0x28bf0d[_0xc743('0x3c')]['offset']);}_0x7a4032[_0xc743('0x42')]=qs[_0xc743('0x43')](_0x28bf0d[_0xc743('0x3c')][_0xc743('0x43')]);_0x7a4032[_0xc743('0x44')]=qs[_0xc743('0x3d')](_[_0xc743('0x45')](_0x28bf0d['query'],_0x1b1645[_0xc743('0x3d')]),_0x35faad);if(_0x28bf0d['query'][_0xc743('0x46')]){_0x7a4032[_0xc743('0x44')]=_[_0xc743('0x47')](_0x7a4032[_0xc743('0x44')],{'$or':_[_0xc743('0x34')](_0x35faad,function(_0x489ff6){if(_0x489ff6[_0xc743('0x38')]!==_0xc743('0x48')){var _0x1954fb={};_0x1954fb[_0x489ff6['name']]={'$like':'%'+_0x28bf0d[_0xc743('0x3c')][_0xc743('0x46')]+'%'};return _0x1954fb;}})});}_0x7a4032=_['merge']({},_0x7a4032,_0x28bf0d[_0xc743('0x49')]);var _0x188622={'where':_0x7a4032['where']};return db[_0xc743('0x35')][_0xc743('0x27')](_0x188622)[_0xc743('0x2f')](function(_0x1ca022){_0x3f8d38[_0xc743('0x27')]=_0x1ca022;if(_0x28bf0d[_0xc743('0x3c')][_0xc743('0x4a')]){_0x7a4032[_0xc743('0x4b')]=[{'all':!![]}];}return db[_0xc743('0x35')][_0xc743('0x4c')](_0x7a4032);})[_0xc743('0x2f')](function(_0x586da6){_0x3f8d38[_0xc743('0x4d')]=_0x586da6;return _0x3f8d38;})[_0xc743('0x2f')](respondWithFilteredResult(_0x29c2a4,_0x7a4032))['catch'](handleError(_0x29c2a4,null));};exports['show']=function(_0x84c737,_0x483fff){var _0x48c447={'raw':![],'where':{'id':_0x84c737[_0xc743('0x4e')]['id']}},_0xecc13a={};_0xecc13a[_0xc743('0x3a')]=_[_0xc743('0x3b')](db['VoiceQueueReport']['rawAttributes']);_0xecc13a[_0xc743('0x3c')]=_[_0xc743('0x3b')](_0x84c737[_0xc743('0x3c')]);_0xecc13a['filters']=_['intersection'](_0xecc13a[_0xc743('0x3a')],_0xecc13a[_0xc743('0x3c')]);_0x48c447[_0xc743('0x3f')]=_[_0xc743('0x3e')](_0xecc13a[_0xc743('0x3a')],qs['fields'](_0x84c737['query']['fields']));_0x48c447['attributes']=_0x48c447['attributes'][_0xc743('0x4f')]?_0x48c447['attributes']:_0xecc13a['model'];if(_0x84c737[_0xc743('0x3c')]['includeAll']){_0x48c447['include']=[{'all':!![]}];}_0x48c447=_[_0xc743('0x47')]({},_0x48c447,_0x84c737['options']);return db[_0xc743('0x35')][_0xc743('0x50')](_0x48c447)[_0xc743('0x2f')](handleEntityNotFound(_0x483fff,null))['then'](respondWithResult(_0x483fff,null))[_0xc743('0x51')](handleError(_0x483fff,null));};exports['create']=function(_0x2b83a0,_0x6e22c0){return db[_0xc743('0x35')]['create'](_0x2b83a0[_0xc743('0x52')],{})[_0xc743('0x2f')](respondWithResult(_0x6e22c0,0xc9))[_0xc743('0x51')](handleError(_0x6e22c0,null));};exports['update']=function(_0x497fd0,_0x160221){if(_0x497fd0[_0xc743('0x52')]['id']){delete _0x497fd0[_0xc743('0x52')]['id'];}return db[_0xc743('0x35')]['find']({'where':{'id':_0x497fd0[_0xc743('0x4e')]['id']}})['then'](handleEntityNotFound(_0x160221,null))[_0xc743('0x2f')](saveUpdates(_0x497fd0[_0xc743('0x52')],null))['then'](respondWithResult(_0x160221,null))['catch'](handleError(_0x160221,null));};exports['destroy']=function(_0x50cf47,_0x15c770){return db[_0xc743('0x35')]['find']({'where':{'id':_0x50cf47[_0xc743('0x4e')]['id']}})[_0xc743('0x2f')](handleEntityNotFound(_0x15c770,null))[_0xc743('0x2f')](removeEntity(_0x15c770,null))[_0xc743('0x51')](handleError(_0x15c770,null));};exports[_0xc743('0x53')]=function(_0x380c75,_0x3a830c){return db[_0xc743('0x35')][_0xc743('0x53')]()[_0xc743('0x2f')](respondWithResult(_0x3a830c,null))[_0xc743('0x51')](handleError(_0x3a830c,null));};exports[_0xc743('0x54')]=function(_0x48f340,_0x3d5a54){var _0x69e6d6={},_0x50784f={},_0x44ba1a={'count':0x0,'rows':[]};_0x50784f[_0xc743('0x3a')]=_[_0xc743('0x3b')](db[_0xc743('0x35')][_0xc743('0x36')]);_0x50784f[_0xc743('0x3c')]=_[_0xc743('0x3b')](_0x48f340[_0xc743('0x3c')]);_0x50784f[_0xc743('0x3d')]=_['intersection'](_0x50784f['model'],_0x50784f['query']);_0x69e6d6[_0xc743('0x3f')]=_[_0xc743('0x3e')](_0x50784f[_0xc743('0x3a')],qs[_0xc743('0x40')](_0x48f340['query'][_0xc743('0x40')]));_0x69e6d6[_0xc743('0x3f')]=_0x69e6d6['attributes']['length']?_0x69e6d6[_0xc743('0x3f')]:_0x50784f['model'];if(!_0x48f340['query'][_0xc743('0x55')](_0xc743('0x41'))){_0x69e6d6[_0xc743('0x26')]=qs['limit'](_0x48f340[_0xc743('0x3c')]['limit']);_0x69e6d6[_0xc743('0x24')]=qs[_0xc743('0x24')](_0x48f340['query'][_0xc743('0x24')]);}_0x69e6d6[_0xc743('0x42')]=qs[_0xc743('0x43')](_0x48f340[_0xc743('0x3c')][_0xc743('0x43')]);_0x69e6d6[_0xc743('0x44')]=qs['filters'](_[_0xc743('0x45')](_0x48f340['query'],_0x50784f[_0xc743('0x3d')]));if(_0x48f340[_0xc743('0x3c')]['filter']){_0x69e6d6[_0xc743('0x44')]=_[_0xc743('0x47')](_0x69e6d6[_0xc743('0x44')],{'$or':_[_0xc743('0x34')](_0x69e6d6[_0xc743('0x3f')],function(_0x7b3d4){var _0x35852a={};_0x35852a[_0x7b3d4]={'$like':'%'+_0x48f340[_0xc743('0x3c')][_0xc743('0x46')]+'%'};return _0x35852a;})});}_0x69e6d6=_['merge']({},_0x69e6d6,_0x48f340['options']);var _0x3b9ba6={'where':_0x69e6d6[_0xc743('0x44')]};return db[_0xc743('0x35')][_0xc743('0x27')](_0x3b9ba6)['then'](function(_0x55ed10){_0x44ba1a[_0xc743('0x27')]=_0x55ed10;if(_0x48f340[_0xc743('0x3c')][_0xc743('0x4a')]){_0x69e6d6[_0xc743('0x4b')]=[{'all':!![]}];}return db[_0xc743('0x35')][_0xc743('0x4c')](_0x69e6d6);})[_0xc743('0x2f')](function(_0x2b5af4){_0x44ba1a['rows']=_0x2b5af4;return _0x44ba1a;})[_0xc743('0x2f')](respondWithFilteredResult(_0x3d5a54,_0x69e6d6,_0xc743('0x54')))[_0xc743('0x51')](handleError(_0x3d5a54,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0x4e9b=['model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','intersection','create','body','describe','getVoiceQueuesReport','pick','options','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','redis','defaults','localhost','./voiceQueueReport.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','save','update','destroy','then','error','stack','name','send','map','VoiceQueueReport','rawAttributes','type','key','keys','query','filters','attributes'];(function(_0x160b80,_0xed97e1){var _0x4bc963=function(_0x182215){while(--_0x182215){_0x160b80['push'](_0x160b80['shift']());}};_0x4bc963(++_0xed97e1);}(_0x4e9b,0x112));var _0xb4e9=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x4e9b[_0x58e469];return _0x4c01c5;};'use strict';var emlformat=require(_0xb4e9('0x0'));var rimraf=require(_0xb4e9('0x1'));var zipdir=require(_0xb4e9('0x2'));var jsonpatch=require(_0xb4e9('0x3'));var rp=require(_0xb4e9('0x4'));var moment=require(_0xb4e9('0x5'));var BPromise=require(_0xb4e9('0x6'));var Mustache=require(_0xb4e9('0x7'));var util=require(_0xb4e9('0x8'));var path=require(_0xb4e9('0x9'));var sox=require(_0xb4e9('0xa'));var csv=require('to-csv');var ejs=require(_0xb4e9('0xb'));var fs=require('fs');var fs_extra=require(_0xb4e9('0xc'));var _=require(_0xb4e9('0xd'));var squel=require('squel');var crypto=require(_0xb4e9('0xe'));var jsforce=require(_0xb4e9('0xf'));var deskjs=require(_0xb4e9('0x10'));var toCsv=require(_0xb4e9('0x11'));var querystring=require(_0xb4e9('0x12'));var Papa=require(_0xb4e9('0x13'));var Redis=require('ioredis');var authService=require(_0xb4e9('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xb4e9('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb4e9('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xb4e9('0x17'));var licenseUtil=require(_0xb4e9('0x18'));var db=require('../../mysqldb')['db'];config[_0xb4e9('0x19')]=_[_0xb4e9('0x1a')](config[_0xb4e9('0x19')],{'host':_0xb4e9('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb4e9('0x19')]));require(_0xb4e9('0x1c'))[_0xb4e9('0x1d')](socket);function respondWithStatusCode(_0x41f214,_0x13840a){_0x13840a=_0x13840a||0xcc;return function(_0x45d34e){if(_0x45d34e){return _0x41f214[_0xb4e9('0x1e')](_0x13840a);}return _0x41f214[_0xb4e9('0x1f')](_0x13840a)[_0xb4e9('0x20')]();};}function respondWithResult(_0x247ed1,_0x53df14){_0x53df14=_0x53df14||0xc8;return function(_0x4c8910){if(_0x4c8910){return _0x247ed1['status'](_0x53df14)['json'](_0x4c8910);}};}function respondWithFilteredResult(_0x4b2544,_0x1fc747){return function(_0x49eb5f){if(_0x49eb5f){var _0x2896f1=typeof _0x1fc747['offset']===_0xb4e9('0x21')&&typeof _0x1fc747[_0xb4e9('0x22')]===_0xb4e9('0x21');var _0x35cd07=_0x49eb5f[_0xb4e9('0x23')];var _0x4422b3=_0x2896f1?0x0:_0x1fc747['offset'];var _0x440766=_0x2896f1?_0x49eb5f['count']:_0x1fc747[_0xb4e9('0x24')]+_0x1fc747[_0xb4e9('0x22')];var _0xffaf64;if(_0x440766>=_0x35cd07){_0x440766=_0x35cd07;_0xffaf64=0xc8;}else{_0xffaf64=0xce;}_0x4b2544[_0xb4e9('0x1f')](_0xffaf64);return _0x4b2544[_0xb4e9('0x25')]('Content-Range',_0x4422b3+'-'+_0x440766+'/'+_0x35cd07)[_0xb4e9('0x26')](_0x49eb5f);}return null;};}function patchUpdates(_0x1cc79b){return function(_0x47cfec){try{jsonpatch[_0xb4e9('0x27')](_0x47cfec,_0x1cc79b,!![]);}catch(_0x483eb1){return BPromise[_0xb4e9('0x28')](_0x483eb1);}return _0x47cfec[_0xb4e9('0x29')]();};}function saveUpdates(_0x157da0,_0x3dddaa){return function(_0x26c0cf){if(_0x26c0cf){return _0x26c0cf[_0xb4e9('0x2a')](_0x157da0)['then'](function(_0x42858d){return _0x42858d;});}return null;};}function removeEntity(_0x3512e4,_0x494afc){return function(_0x2906a9){if(_0x2906a9){return _0x2906a9[_0xb4e9('0x2b')]()[_0xb4e9('0x2c')](function(){_0x3512e4[_0xb4e9('0x1f')](0xcc)[_0xb4e9('0x20')]();});}};}function handleEntityNotFound(_0x4e5126,_0x44788f){return function(_0xd3756b){if(!_0xd3756b){_0x4e5126[_0xb4e9('0x1e')](0x194);}return _0xd3756b;};}function handleError(_0x5df813,_0x1a2835){_0x1a2835=_0x1a2835||0x1f4;return function(_0x151873){logger[_0xb4e9('0x2d')](_0x151873[_0xb4e9('0x2e')]);if(_0x151873[_0xb4e9('0x2f')]){delete _0x151873[_0xb4e9('0x2f')];}_0x5df813[_0xb4e9('0x1f')](_0x1a2835)[_0xb4e9('0x30')](_0x151873);};}exports['index']=function(_0x4d993f,_0x16b4bd){var _0x406834={},_0x4f9c07={},_0x50d23c={'count':0x0,'rows':[]};var _0x175196=_[_0xb4e9('0x31')](db[_0xb4e9('0x32')][_0xb4e9('0x33')],function(_0xbc678f){return{'name':_0xbc678f['fieldName'],'type':_0xbc678f[_0xb4e9('0x34')][_0xb4e9('0x35')]};});_0x4f9c07['model']=_[_0xb4e9('0x31')](_0x175196,_0xb4e9('0x2f'));_0x4f9c07['query']=_[_0xb4e9('0x36')](_0x4d993f[_0xb4e9('0x37')]);_0x4f9c07[_0xb4e9('0x38')]=_['intersection'](_0x4f9c07['model'],_0x4f9c07[_0xb4e9('0x37')]);_0x406834[_0xb4e9('0x39')]=_['intersection'](_0x4f9c07[_0xb4e9('0x3a')],qs['fields'](_0x4d993f[_0xb4e9('0x37')][_0xb4e9('0x3b')]));_0x406834['attributes']=_0x406834[_0xb4e9('0x39')][_0xb4e9('0x3c')]?_0x406834[_0xb4e9('0x39')]:_0x4f9c07[_0xb4e9('0x3a')];if(!_0x4d993f['query'][_0xb4e9('0x3d')](_0xb4e9('0x3e'))){_0x406834[_0xb4e9('0x22')]=qs[_0xb4e9('0x22')](_0x4d993f[_0xb4e9('0x37')][_0xb4e9('0x22')]);_0x406834[_0xb4e9('0x24')]=qs['offset'](_0x4d993f[_0xb4e9('0x37')]['offset']);}_0x406834[_0xb4e9('0x3f')]=qs[_0xb4e9('0x40')](_0x4d993f[_0xb4e9('0x37')][_0xb4e9('0x40')]);_0x406834[_0xb4e9('0x41')]=qs[_0xb4e9('0x38')](_['pick'](_0x4d993f[_0xb4e9('0x37')],_0x4f9c07[_0xb4e9('0x38')]),_0x175196);if(_0x4d993f[_0xb4e9('0x37')][_0xb4e9('0x42')]){_0x406834[_0xb4e9('0x41')]=_[_0xb4e9('0x43')](_0x406834[_0xb4e9('0x41')],{'$or':_['map'](_0x175196,function(_0x278db8){if(_0x278db8[_0xb4e9('0x34')]!==_0xb4e9('0x44')){var _0x43d368={};_0x43d368[_0x278db8[_0xb4e9('0x2f')]]={'$like':'%'+_0x4d993f[_0xb4e9('0x37')][_0xb4e9('0x42')]+'%'};return _0x43d368;}})});}_0x406834=_['merge']({},_0x406834,_0x4d993f['options']);var _0x14156b={'where':_0x406834[_0xb4e9('0x41')]};return db[_0xb4e9('0x32')][_0xb4e9('0x23')](_0x14156b)[_0xb4e9('0x2c')](function(_0x247149){_0x50d23c['count']=_0x247149;if(_0x4d993f[_0xb4e9('0x37')][_0xb4e9('0x45')]){_0x406834[_0xb4e9('0x46')]=[{'all':!![]}];}return db[_0xb4e9('0x32')][_0xb4e9('0x47')](_0x406834);})[_0xb4e9('0x2c')](function(_0x448bca){_0x50d23c[_0xb4e9('0x48')]=_0x448bca;return _0x50d23c;})['then'](respondWithFilteredResult(_0x16b4bd,_0x406834))[_0xb4e9('0x49')](handleError(_0x16b4bd,null));};exports[_0xb4e9('0x4a')]=function(_0x5bb3c6,_0x456703){var _0x54ef39={'raw':![],'where':{'id':_0x5bb3c6[_0xb4e9('0x4b')]['id']}},_0xe076a9={};_0xe076a9[_0xb4e9('0x3a')]=_['keys'](db[_0xb4e9('0x32')]['rawAttributes']);_0xe076a9[_0xb4e9('0x37')]=_['keys'](_0x5bb3c6['query']);_0xe076a9[_0xb4e9('0x38')]=_[_0xb4e9('0x4c')](_0xe076a9[_0xb4e9('0x3a')],_0xe076a9[_0xb4e9('0x37')]);_0x54ef39[_0xb4e9('0x39')]=_[_0xb4e9('0x4c')](_0xe076a9[_0xb4e9('0x3a')],qs[_0xb4e9('0x3b')](_0x5bb3c6[_0xb4e9('0x37')][_0xb4e9('0x3b')]));_0x54ef39['attributes']=_0x54ef39['attributes']['length']?_0x54ef39[_0xb4e9('0x39')]:_0xe076a9['model'];if(_0x5bb3c6['query'][_0xb4e9('0x45')]){_0x54ef39[_0xb4e9('0x46')]=[{'all':!![]}];}_0x54ef39=_[_0xb4e9('0x43')]({},_0x54ef39,_0x5bb3c6['options']);return db['VoiceQueueReport']['find'](_0x54ef39)[_0xb4e9('0x2c')](handleEntityNotFound(_0x456703,null))[_0xb4e9('0x2c')](respondWithResult(_0x456703,null))[_0xb4e9('0x49')](handleError(_0x456703,null));};exports['create']=function(_0x598152,_0x33073f){return db[_0xb4e9('0x32')][_0xb4e9('0x4d')](_0x598152[_0xb4e9('0x4e')],{})[_0xb4e9('0x2c')](respondWithResult(_0x33073f,0xc9))['catch'](handleError(_0x33073f,null));};exports['update']=function(_0x18cc54,_0x5a8ed5){if(_0x18cc54['body']['id']){delete _0x18cc54[_0xb4e9('0x4e')]['id'];}return db[_0xb4e9('0x32')]['find']({'where':{'id':_0x18cc54['params']['id']}})[_0xb4e9('0x2c')](handleEntityNotFound(_0x5a8ed5,null))[_0xb4e9('0x2c')](saveUpdates(_0x18cc54[_0xb4e9('0x4e')],null))['then'](respondWithResult(_0x5a8ed5,null))[_0xb4e9('0x49')](handleError(_0x5a8ed5,null));};exports[_0xb4e9('0x2b')]=function(_0x396df4,_0xd23d31){return db[_0xb4e9('0x32')]['find']({'where':{'id':_0x396df4[_0xb4e9('0x4b')]['id']}})['then'](handleEntityNotFound(_0xd23d31,null))['then'](removeEntity(_0xd23d31,null))[_0xb4e9('0x49')](handleError(_0xd23d31,null));};exports['describe']=function(_0x4cb949,_0x566625){return db[_0xb4e9('0x32')][_0xb4e9('0x4f')]()[_0xb4e9('0x2c')](respondWithResult(_0x566625,null))['catch'](handleError(_0x566625,null));};exports[_0xb4e9('0x50')]=function(_0x167595,_0x1e53a7){var _0x8771f={},_0x21046d={},_0x291dd3={'count':0x0,'rows':[]};_0x21046d[_0xb4e9('0x3a')]=_[_0xb4e9('0x36')](db[_0xb4e9('0x32')]['rawAttributes']);_0x21046d[_0xb4e9('0x37')]=_[_0xb4e9('0x36')](_0x167595[_0xb4e9('0x37')]);_0x21046d[_0xb4e9('0x38')]=_[_0xb4e9('0x4c')](_0x21046d['model'],_0x21046d[_0xb4e9('0x37')]);_0x8771f[_0xb4e9('0x39')]=_[_0xb4e9('0x4c')](_0x21046d[_0xb4e9('0x3a')],qs[_0xb4e9('0x3b')](_0x167595['query'][_0xb4e9('0x3b')]));_0x8771f['attributes']=_0x8771f[_0xb4e9('0x39')][_0xb4e9('0x3c')]?_0x8771f[_0xb4e9('0x39')]:_0x21046d['model'];if(!_0x167595[_0xb4e9('0x37')][_0xb4e9('0x3d')](_0xb4e9('0x3e'))){_0x8771f[_0xb4e9('0x22')]=qs[_0xb4e9('0x22')](_0x167595[_0xb4e9('0x37')]['limit']);_0x8771f['offset']=qs['offset'](_0x167595[_0xb4e9('0x37')]['offset']);}_0x8771f[_0xb4e9('0x3f')]=qs['sort'](_0x167595[_0xb4e9('0x37')]['sort']);_0x8771f['where']=qs[_0xb4e9('0x38')](_[_0xb4e9('0x51')](_0x167595[_0xb4e9('0x37')],_0x21046d[_0xb4e9('0x38')]));if(_0x167595[_0xb4e9('0x37')]['filter']){_0x8771f['where']=_[_0xb4e9('0x43')](_0x8771f['where'],{'$or':_['map'](_0x8771f[_0xb4e9('0x39')],function(_0x5c0120){var _0x367f78={};_0x367f78[_0x5c0120]={'$like':'%'+_0x167595['query'][_0xb4e9('0x42')]+'%'};return _0x367f78;})});}_0x8771f=_[_0xb4e9('0x43')]({},_0x8771f,_0x167595[_0xb4e9('0x52')]);var _0x211ee1={'where':_0x8771f[_0xb4e9('0x41')]};return db['VoiceQueueReport'][_0xb4e9('0x23')](_0x211ee1)['then'](function(_0x158345){_0x291dd3['count']=_0x158345;if(_0x167595['query'][_0xb4e9('0x45')]){_0x8771f['include']=[{'all':!![]}];}return db[_0xb4e9('0x32')]['findAll'](_0x8771f);})[_0xb4e9('0x2c')](function(_0x422308){_0x291dd3[_0xb4e9('0x48')]=_0x422308;return _0x291dd3;})['then'](respondWithFilteredResult(_0x1e53a7,_0x8771f,'getVoiceQueuesReport'))['catch'](handleError(_0x1e53a7,null,_0xb4e9('0x50')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index efb31d4..3aaa441 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 _0x9e1d=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceQueueReport'];(function(_0x490a99,_0x385d34){var _0x5b6a4e=function(_0x1c68da){while(--_0x1c68da){_0x490a99['push'](_0x490a99['shift']());}};_0x5b6a4e(++_0x385d34);}(_0x9e1d,0x178));var _0xd9e1=function(_0x122266,_0x2e52b1){_0x122266=_0x122266-0x0;var _0x19aee9=_0x9e1d[_0x122266];return _0x19aee9;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xd9e1('0x0'))['db'][_0xd9e1('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xd9e1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd9e1('0x3'),'afterDestroy':_0xd9e1('0x4')};function emitEvent(_0x336cd6){return function(_0x3961e9,_0x3f6605,_0x957b21){VoiceQueueReportEvents[_0xd9e1('0x5')](_0x336cd6+':'+_0x3961e9['id'],_0x3961e9);VoiceQueueReportEvents[_0xd9e1('0x5')](_0x336cd6,_0x3961e9);_0x957b21(null);};}for(var e in events){if(events[_0xd9e1('0x6')](e)){var event=events[e];VoiceQueueReport[_0xd9e1('0x7')](e,emitEvent(event));}}module[_0xd9e1('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x46fd=['../../mysqldb','VoiceQueueReport','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x46fd,0x18f));var _0xd46f=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x46fd[_0x4ff09b];return _0x3f5c2e;};'use strict';var EventEmitter=require(_0xd46f('0x0'));var VoiceQueueReport=require(_0xd46f('0x1'))['db'][_0xd46f('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xd46f('0x3')](0x0);var events={'afterCreate':_0xd46f('0x4'),'afterUpdate':'update','afterDestroy':_0xd46f('0x5')};function emitEvent(_0x2c2cf1){return function(_0x270739,_0x54952f,_0x510d26){VoiceQueueReportEvents['emit'](_0x2c2cf1+':'+_0x270739['id'],_0x270739);VoiceQueueReportEvents[_0xd46f('0x6')](_0x2c2cf1,_0x270739);_0x510d26(null);};}for(var e in events){if(events[_0xd46f('0x7')](e)){var event=events[e];VoiceQueueReport[_0xd46f('0x8')](e,emitEvent(event));}}module[_0xd46f('0x9')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index ca27c24..3a190ce 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 _0x2b90=['util','../../config/logger','api','moment','bluebird','rimraf','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','calleridnum','lodash'];(function(_0x65c40e,_0x44f286){var _0x34af6a=function(_0x3d947c){while(--_0x3d947c){_0x65c40e['push'](_0x65c40e['shift']());}};_0x34af6a(++_0x44f286);}(_0x2b90,0xcf));var _0x02b9=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x2b90[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0x02b9('0x0'));var util=require(_0x02b9('0x1'));var logger=require(_0x02b9('0x2'))(_0x02b9('0x3'));var moment=require(_0x02b9('0x4'));var BPromise=require(_0x02b9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x02b9('0x6'));var config=require('../../config/environment');var attributes=require(_0x02b9('0x7'));module[_0x02b9('0x8')]=function(_0x326cc7,_0x3b82a9){return _0x326cc7[_0x02b9('0x9')](_0x02b9('0xa'),attributes,{'tableName':_0x02b9('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x02b9('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x913f=['calleridnum','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','define','VoiceQueueReport','uniqueid'];(function(_0x240b87,_0x4a85a2){var _0x1ffb1e=function(_0x4542e2){while(--_0x4542e2){_0x240b87['push'](_0x240b87['shift']());}};_0x1ffb1e(++_0x4a85a2);}(_0x913f,0xbc));var _0xf913=function(_0x3a0af1,_0x55d915){_0x3a0af1=_0x3a0af1-0x0;var _0x229aa1=_0x913f[_0x3a0af1];return _0x229aa1;};'use strict';var _=require(_0xf913('0x0'));var util=require('util');var logger=require(_0xf913('0x1'))(_0xf913('0x2'));var moment=require(_0xf913('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf913('0x4'));var rimraf=require(_0xf913('0x5'));var config=require(_0xf913('0x6'));var attributes=require('./voiceQueueReport.attributes');module['exports']=function(_0x1c3735,_0x108758){return _0x1c3735[_0xf913('0x7')](_0xf913('0x8'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xf913('0x9')]},{'fields':[_0xf913('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index e1b9706..1922475 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 _0x4ebd=['redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','findAll','options','raw','where','include','map','attributes','model','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','VoiceQueueReport','update','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http'];(function(_0x553b7d,_0x260b3a){var _0x3996dc=function(_0x4d5453){while(--_0x4d5453){_0x553b7d['push'](_0x553b7d['shift']());}};_0x3996dc(++_0x260b3a);}(_0x4ebd,0xaa));var _0xd4eb=function(_0xfa3b9,_0xdc5957){_0xfa3b9=_0xfa3b9-0x0;var _0x582c3d=_0x4ebd[_0xfa3b9];return _0x582c3d;};'use strict';var _=require(_0xd4eb('0x0'));var util=require(_0xd4eb('0x1'));var moment=require(_0xd4eb('0x2'));var BPromise=require(_0xd4eb('0x3'));var rs=require(_0xd4eb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4eb('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd4eb('0x6'));var jayson=require(_0xd4eb('0x7'));var client=jayson[_0xd4eb('0x8')][_0xd4eb('0x9')]({'port':0x232a});config[_0xd4eb('0xa')]=_[_0xd4eb('0xb')](config['redis'],{'host':_0xd4eb('0xc'),'port':0x18eb});var socket=require(_0xd4eb('0xd'))(new Redis(config[_0xd4eb('0xa')]));require(_0xd4eb('0xe'))[_0xd4eb('0xf')](socket);function respondWithRpcPromise(_0x395e0b,_0x2c1eef,_0xfc2931){return new BPromise(function(_0x2dad1d,_0x19658e){return client[_0xd4eb('0x10')](_0x395e0b,_0xfc2931)[_0xd4eb('0x11')](function(_0x1b9072){logger[_0xd4eb('0x12')](_0xd4eb('0x13'),_0x2c1eef,_0xd4eb('0x14'));logger[_0xd4eb('0x15')](_0xd4eb('0x16'),_0x2c1eef,_0xd4eb('0x14'),JSON[_0xd4eb('0x17')](_0x1b9072));if(_0x1b9072['error']){if(_0x1b9072[_0xd4eb('0x18')][_0xd4eb('0x19')]===0x1f4){logger[_0xd4eb('0x18')](_0xd4eb('0x13'),_0x2c1eef,_0x1b9072[_0xd4eb('0x18')][_0xd4eb('0x1a')]);return _0x19658e(_0x1b9072[_0xd4eb('0x18')][_0xd4eb('0x1a')]);}logger[_0xd4eb('0x18')](_0xd4eb('0x13'),_0x2c1eef,_0x1b9072[_0xd4eb('0x18')][_0xd4eb('0x1a')]);return _0x2dad1d(_0x1b9072['error'][_0xd4eb('0x1a')]);}else{logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x2c1eef,_0xd4eb('0x14'));_0x2dad1d(_0x1b9072[_0xd4eb('0x1b')][_0xd4eb('0x1a')]);}})[_0xd4eb('0x1c')](function(_0x1b076b){logger[_0xd4eb('0x18')](_0xd4eb('0x13'),_0x2c1eef,_0x1b076b);_0x19658e(_0x1b076b);});});}exports[_0xd4eb('0x1d')]=function(_0x503749){var _0xe68a38=this;return new Promise(function(_0x3ac301,_0x1bfb4d){return db['VoiceQueueReport'][_0xd4eb('0x1e')]({'raw':_0x503749[_0xd4eb('0x1f')]?_0x503749[_0xd4eb('0x1f')][_0xd4eb('0x20')]===undefined?!![]:![]:!![],'where':_0x503749[_0xd4eb('0x1f')]?_0x503749[_0xd4eb('0x1f')][_0xd4eb('0x21')]||null:null,'attributes':_0x503749[_0xd4eb('0x1f')]?_0x503749[_0xd4eb('0x1f')]['attributes']||null:null,'limit':_0x503749[_0xd4eb('0x1f')]?_0x503749[_0xd4eb('0x1f')]['limit']||null:null,'include':_0x503749['options']?_0x503749[_0xd4eb('0x1f')][_0xd4eb('0x22')]?_[_0xd4eb('0x23')](_0x503749[_0xd4eb('0x1f')][_0xd4eb('0x22')],function(_0x7d038c){return{'model':db[_0x7d038c['model']],'as':_0x7d038c['as'],'attributes':_0x7d038c[_0xd4eb('0x24')],'include':_0x7d038c[_0xd4eb('0x22')]?_['map'](_0x7d038c[_0xd4eb('0x22')],function(_0xbf73c1){return{'model':db[_0xbf73c1[_0xd4eb('0x25')]],'as':_0xbf73c1['as'],'attributes':_0xbf73c1[_0xd4eb('0x24')],'include':_0xbf73c1['include']?_[_0xd4eb('0x23')](_0xbf73c1[_0xd4eb('0x22')],function(_0x1b9ecb){return{'model':db[_0x1b9ecb[_0xd4eb('0x25')]],'as':_0x1b9ecb['as'],'attributes':_0x1b9ecb['attributes']};}):[]};}):[]};}):[]:[]})[_0xd4eb('0x11')](function(_0x38347d){logger[_0xd4eb('0x12')](_0xd4eb('0x1d'),_0x503749);logger[_0xd4eb('0x15')](_0xd4eb('0x1d'),_0x503749,JSON['stringify'](_0x38347d));_0x3ac301(_0x38347d);})['catch'](function(_0x2d7610){logger[_0xd4eb('0x18')](_0xd4eb('0x1d'),_0x2d7610[_0xd4eb('0x1a')],_0x503749);_0x1bfb4d(_0xe68a38['error'](0x1f4,_0x2d7610[_0xd4eb('0x1a')]));});});};exports[_0xd4eb('0x26')]=function(_0x5d154d){var _0x4502dd=this;return new Promise(function(_0xd36105,_0x4c0848){return db['VoiceQueueReport'][_0xd4eb('0x27')](_0x5d154d[_0xd4eb('0x28')],{'raw':_0x5d154d[_0xd4eb('0x1f')]?_0x5d154d[_0xd4eb('0x1f')][_0xd4eb('0x20')]===undefined?!![]:![]:!![]})[_0xd4eb('0x11')](function(_0x3e09cf){logger[_0xd4eb('0x12')](_0xd4eb('0x26'),_0x5d154d);logger[_0xd4eb('0x15')](_0xd4eb('0x26'),_0x5d154d,JSON[_0xd4eb('0x17')](_0x3e09cf));_0xd36105(_0x3e09cf);})['catch'](function(_0x1e7e7e){logger[_0xd4eb('0x18')](_0xd4eb('0x26'),_0x1e7e7e['message'],_0x5d154d);_0x4c0848(_0x4502dd['error'](0x1f4,_0x1e7e7e[_0xd4eb('0x1a')]));});});};exports[_0xd4eb('0x29')]=function(_0x3eb3d2){var _0x1ff1d8=this;return new Promise(function(_0x5f0160,_0xf00f5c){return db[_0xd4eb('0x2a')][_0xd4eb('0x2b')](_0x3eb3d2[_0xd4eb('0x28')],{'raw':_0x3eb3d2[_0xd4eb('0x1f')]?_0x3eb3d2[_0xd4eb('0x1f')][_0xd4eb('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3eb3d2['options']?_0x3eb3d2[_0xd4eb('0x1f')][_0xd4eb('0x21')]||null:null,'attributes':_0x3eb3d2[_0xd4eb('0x1f')]?_0x3eb3d2[_0xd4eb('0x1f')][_0xd4eb('0x24')]||null:null,'limit':_0x3eb3d2[_0xd4eb('0x1f')]?_0x3eb3d2[_0xd4eb('0x1f')][_0xd4eb('0x2c')]||null:null})[_0xd4eb('0x11')](function(_0x1fcd7e){logger[_0xd4eb('0x12')](_0xd4eb('0x29'),_0x3eb3d2);logger['debug'](_0xd4eb('0x29'),_0x3eb3d2,JSON[_0xd4eb('0x17')](_0x1fcd7e));_0x5f0160(_0x1fcd7e);})[_0xd4eb('0x1c')](function(_0x7792fe){logger[_0xd4eb('0x18')](_0xd4eb('0x29'),_0x7792fe[_0xd4eb('0x1a')],_0x3eb3d2);_0xf00f5c(_0x1ff1d8['error'](0x1f4,_0x7792fe['message']));});});}; \ No newline at end of file +var _0xae99=['attributes','limit','include','map','model','debug','catch','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','then','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','info','result','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw'];(function(_0x59710f,_0x44c7f0){var _0xaae66a=function(_0x1c2397){while(--_0x1c2397){_0x59710f['push'](_0x59710f['shift']());}};_0xaae66a(++_0x44c7f0);}(_0xae99,0x113));var _0x9ae9=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xae99[_0x18ab2a];return _0x16dcee;};'use strict';var _=require(_0x9ae9('0x0'));var util=require('util');var moment=require(_0x9ae9('0x1'));var BPromise=require(_0x9ae9('0x2'));var rs=require(_0x9ae9('0x3'));var fs=require('fs');var Redis=require(_0x9ae9('0x4'));var db=require(_0x9ae9('0x5'))['db'];var utils=require(_0x9ae9('0x6'));var logger=require('../../config/logger')(_0x9ae9('0x7'));var config=require(_0x9ae9('0x8'));var jayson=require(_0x9ae9('0x9'));var client=jayson[_0x9ae9('0xa')][_0x9ae9('0xb')]({'port':0x232a});config[_0x9ae9('0xc')]=_[_0x9ae9('0xd')](config[_0x9ae9('0xc')],{'host':_0x9ae9('0xe'),'port':0x18eb});var socket=require(_0x9ae9('0xf'))(new Redis(config[_0x9ae9('0xc')]));require(_0x9ae9('0x10'))[_0x9ae9('0x11')](socket);function respondWithRpcPromise(_0x11af05,_0x130c9c,_0x20de44){return new BPromise(function(_0x3c8df3,_0x62e465){return client['request'](_0x11af05,_0x20de44)[_0x9ae9('0x12')](function(_0xa45929){logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x130c9c,_0x9ae9('0x13'));logger['debug'](_0x9ae9('0x14'),_0x130c9c,_0x9ae9('0x13'),JSON[_0x9ae9('0x15')](_0xa45929));if(_0xa45929[_0x9ae9('0x16')]){if(_0xa45929[_0x9ae9('0x16')][_0x9ae9('0x17')]===0x1f4){logger['error'](_0x9ae9('0x18'),_0x130c9c,_0xa45929['error'][_0x9ae9('0x19')]);return _0x62e465(_0xa45929[_0x9ae9('0x16')][_0x9ae9('0x19')]);}logger[_0x9ae9('0x16')](_0x9ae9('0x18'),_0x130c9c,_0xa45929[_0x9ae9('0x16')][_0x9ae9('0x19')]);return _0x3c8df3(_0xa45929[_0x9ae9('0x16')][_0x9ae9('0x19')]);}else{logger[_0x9ae9('0x1a')](_0x9ae9('0x18'),_0x130c9c,_0x9ae9('0x13'));_0x3c8df3(_0xa45929[_0x9ae9('0x1b')][_0x9ae9('0x19')]);}})['catch'](function(_0x392089){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x130c9c,_0x392089);_0x62e465(_0x392089);});});}exports[_0x9ae9('0x1c')]=function(_0x2929af){var _0x100748=this;return new Promise(function(_0x1096d2,_0x5d9dd4){return db[_0x9ae9('0x1d')][_0x9ae9('0x1e')]({'raw':_0x2929af[_0x9ae9('0x1f')]?_0x2929af['options'][_0x9ae9('0x20')]===undefined?!![]:![]:!![],'where':_0x2929af[_0x9ae9('0x1f')]?_0x2929af[_0x9ae9('0x1f')]['where']||null:null,'attributes':_0x2929af[_0x9ae9('0x1f')]?_0x2929af[_0x9ae9('0x1f')][_0x9ae9('0x21')]||null:null,'limit':_0x2929af[_0x9ae9('0x1f')]?_0x2929af[_0x9ae9('0x1f')][_0x9ae9('0x22')]||null:null,'include':_0x2929af[_0x9ae9('0x1f')]?_0x2929af[_0x9ae9('0x1f')][_0x9ae9('0x23')]?_[_0x9ae9('0x24')](_0x2929af[_0x9ae9('0x1f')][_0x9ae9('0x23')],function(_0x32e107){return{'model':db[_0x32e107['model']],'as':_0x32e107['as'],'attributes':_0x32e107[_0x9ae9('0x21')],'include':_0x32e107[_0x9ae9('0x23')]?_['map'](_0x32e107['include'],function(_0x54c1b5){return{'model':db[_0x54c1b5[_0x9ae9('0x25')]],'as':_0x54c1b5['as'],'attributes':_0x54c1b5[_0x9ae9('0x21')],'include':_0x54c1b5[_0x9ae9('0x23')]?_[_0x9ae9('0x24')](_0x54c1b5[_0x9ae9('0x23')],function(_0x515f4b){return{'model':db[_0x515f4b['model']],'as':_0x515f4b['as'],'attributes':_0x515f4b[_0x9ae9('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x21d7bf){logger['info'](_0x9ae9('0x1c'),_0x2929af);logger[_0x9ae9('0x26')](_0x9ae9('0x1c'),_0x2929af,JSON['stringify'](_0x21d7bf));_0x1096d2(_0x21d7bf);})[_0x9ae9('0x27')](function(_0x5ed35e){logger[_0x9ae9('0x16')](_0x9ae9('0x1c'),_0x5ed35e[_0x9ae9('0x19')],_0x2929af);_0x5d9dd4(_0x100748[_0x9ae9('0x16')](0x1f4,_0x5ed35e[_0x9ae9('0x19')]));});});};exports[_0x9ae9('0x28')]=function(_0x327895){var _0x563ce9=this;return new Promise(function(_0xab56c1,_0x186cb3){return db[_0x9ae9('0x1d')]['create'](_0x327895[_0x9ae9('0x29')],{'raw':_0x327895[_0x9ae9('0x1f')]?_0x327895[_0x9ae9('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x9ae9('0x12')](function(_0x4f9fdf){logger[_0x9ae9('0x1a')](_0x9ae9('0x28'),_0x327895);logger[_0x9ae9('0x26')]('CreateVoiceQueueReport',_0x327895,JSON[_0x9ae9('0x15')](_0x4f9fdf));_0xab56c1(_0x4f9fdf);})[_0x9ae9('0x27')](function(_0x5e5aa6){logger[_0x9ae9('0x16')](_0x9ae9('0x28'),_0x5e5aa6[_0x9ae9('0x19')],_0x327895);_0x186cb3(_0x563ce9['error'](0x1f4,_0x5e5aa6[_0x9ae9('0x19')]));});});};exports[_0x9ae9('0x2a')]=function(_0x509f53){var _0x39fdc1=this;return new Promise(function(_0xdf8975,_0x5869e6){return db[_0x9ae9('0x1d')]['update'](_0x509f53[_0x9ae9('0x29')],{'raw':_0x509f53[_0x9ae9('0x1f')]?_0x509f53[_0x9ae9('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x509f53[_0x9ae9('0x1f')]?_0x509f53['options'][_0x9ae9('0x2b')]||null:null,'attributes':_0x509f53[_0x9ae9('0x1f')]?_0x509f53[_0x9ae9('0x1f')][_0x9ae9('0x21')]||null:null,'limit':_0x509f53['options']?_0x509f53[_0x9ae9('0x1f')][_0x9ae9('0x22')]||null:null})[_0x9ae9('0x12')](function(_0x603522){logger[_0x9ae9('0x1a')]('UpdateVoiceQueueReport',_0x509f53);logger[_0x9ae9('0x26')](_0x9ae9('0x2a'),_0x509f53,JSON[_0x9ae9('0x15')](_0x603522));_0xdf8975(_0x603522);})['catch'](function(_0x3ac8d5){logger[_0x9ae9('0x16')](_0x9ae9('0x2a'),_0x3ac8d5[_0x9ae9('0x19')],_0x509f53);_0x5869e6(_0x39fdc1[_0x9ae9('0x16')](0x1f4,_0x3ac8d5['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 1c4e2e0..7c4d8eb 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 _0x5687=['register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit','removeListener'];(function(_0x25a536,_0x3d172a){var _0x55c706=function(_0x34277a){while(--_0x34277a){_0x25a536['push'](_0x25a536['shift']());}};_0x55c706(++_0x3d172a);}(_0x5687,0x1ce));var _0x7568=function(_0x375864,_0x3181d4){_0x375864=_0x375864-0x0;var _0x252045=_0x5687[_0x375864];return _0x252045;};'use strict';var VoiceQueueReportEvents=require(_0x7568('0x0'));var events=[_0x7568('0x1'),_0x7568('0x2'),_0x7568('0x3')];function createListener(_0x15ee08,_0x18182a){return function(_0xfb8891){_0x18182a[_0x7568('0x4')](_0x15ee08,_0xfb8891);};}function removeListener(_0x28894f,_0x58cfad){return function(){VoiceQueueReportEvents[_0x7568('0x5')](_0x28894f,_0x58cfad);};}exports[_0x7568('0x6')]=function(_0x327400){for(var _0x248492=0x0,_0x53ac94=events[_0x7568('0x7')];_0x248492<_0x53ac94;_0x248492++){var _0x1ad91f=events[_0x248492];var _0x500856=createListener(_0x7568('0x8')+_0x1ad91f,_0x327400);VoiceQueueReportEvents['on'](_0x1ad91f,_0x500856);}}; \ No newline at end of file +var _0x7dbc=['update','emit','removeListener','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7dbc,0xe2));var _0xc7db=function(_0x35447b,_0x3d6e36){_0x35447b=_0x35447b-0x0;var _0x314fbb=_0x7dbc[_0x35447b];return _0x314fbb;};'use strict';var VoiceQueueReportEvents=require(_0xc7db('0x0'));var events=[_0xc7db('0x1'),'remove',_0xc7db('0x2')];function createListener(_0x454e70,_0xd6b569){return function(_0x4c6402){_0xd6b569[_0xc7db('0x3')](_0x454e70,_0x4c6402);};}function removeListener(_0x29bda9,_0x1ea8cb){return function(){VoiceQueueReportEvents[_0xc7db('0x4')](_0x29bda9,_0x1ea8cb);};}exports['register']=function(_0x4ee443){for(var _0x1aef6b=0x0,_0x256ea6=events['length'];_0x1aef6b<_0x256ea6;_0x1aef6b++){var _0x51dd2c=events[_0x1aef6b];var _0x9eff32=createListener(_0xc7db('0x5')+_0x51dd2c,_0x4ee443);VoiceQueueReportEvents['on'](_0x51dd2c,_0x9eff32);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 6151572..e7ebe91 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 _0xe23d=['multer','util','path','express','Router','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy'];(function(_0x4fb022,_0xd61cd4){var _0x233c36=function(_0x208240){while(--_0x208240){_0x4fb022['push'](_0x4fb022['shift']());}};_0x233c36(++_0xd61cd4);}(_0xe23d,0x90));var _0xde23=function(_0x16bd84,_0x3362dd){_0x16bd84=_0x16bd84-0x0;var _0x1afd1f=_0xe23d[_0x16bd84];return _0x1afd1f;};'use strict';var multer=require(_0xde23('0x0'));var util=require(_0xde23('0x1'));var path=require(_0xde23('0x2'));var timeout=require('connect-timeout');var express=require(_0xde23('0x3'));var router=express[_0xde23('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xde23('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xde23('0x6'));var controller=require(_0xde23('0x7'));router[_0xde23('0x8')]('/',auth[_0xde23('0x9')](),controller[_0xde23('0xa')]);router[_0xde23('0x8')](_0xde23('0xb'),auth['isAuthenticated'](),controller[_0xde23('0xc')]);router[_0xde23('0xd')]('/',auth[_0xde23('0x9')](),controller['create']);router[_0xde23('0xe')](_0xde23('0xb'),auth[_0xde23('0x9')](),controller[_0xde23('0xf')]);router[_0xde23('0x10')](_0xde23('0xb'),auth['isAuthenticated'](),controller[_0xde23('0x11')]);module['exports']=router; \ No newline at end of file +var _0xf3c5=['get','isAuthenticated','index','show','post','create','put','update','delete','/:id','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller'];(function(_0x42ceee,_0x45bd20){var _0x300d8d=function(_0x2894e1){while(--_0x2894e1){_0x42ceee['push'](_0x42ceee['shift']());}};_0x300d8d(++_0x45bd20);}(_0xf3c5,0x187));var _0x5f3c=function(_0x57166e,_0x4648bc){_0x57166e=_0x57166e-0x0;var _0x3379ea=_0xf3c5[_0x57166e];return _0x3379ea;};'use strict';var multer=require(_0x5f3c('0x0'));var util=require(_0x5f3c('0x1'));var path=require(_0x5f3c('0x2'));var timeout=require('connect-timeout');var express=require(_0x5f3c('0x3'));var router=express['Router']();var fs_extra=require(_0x5f3c('0x4'));var auth=require(_0x5f3c('0x5'));var interaction=require(_0x5f3c('0x6'));var config=require('../../config/environment');var controller=require(_0x5f3c('0x7'));router[_0x5f3c('0x8')]('/',auth[_0x5f3c('0x9')](),controller[_0x5f3c('0xa')]);router[_0x5f3c('0x8')]('/:id',auth[_0x5f3c('0x9')](),controller[_0x5f3c('0xb')]);router[_0x5f3c('0xc')]('/',auth[_0x5f3c('0x9')](),controller[_0x5f3c('0xd')]);router[_0x5f3c('0xe')]('/:id',auth[_0x5f3c('0x9')](),controller[_0x5f3c('0xf')]);router[_0x5f3c('0x10')](_0x5f3c('0x11'),auth[_0x5f3c('0x9')](),controller[_0x5f3c('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 9d6e935..0548a97 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 _0x1490=['YYYY-MM-DD\x20HH:mm:ss','sequelize','STRING','DATE'];(function(_0x1f5664,_0x2eff45){var _0xf87976=function(_0x42dca5){while(--_0x42dca5){_0x1f5664['push'](_0x1f5664['shift']());}};_0xf87976(++_0x2eff45);}(_0x1490,0x85));var _0x0149=function(_0x352635,_0x11301a){_0x352635=_0x352635-0x0;var _0x32435c=_0x1490[_0x352635];return _0x32435c;};'use strict';var Sequelize=require(_0x0149('0x0'));var moment=require('moment');module['exports']={'time':{'type':Sequelize[_0x0149('0x1')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x0149('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x0149('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x0149('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x0149('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x0149('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x0149('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x0149('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x0149('0x2')],'allowNull':![],'defaultValue':moment()['format'](_0x0149('0x3'))}}; \ No newline at end of file +var _0xf8e0=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0xf8e0,0x103));var _0x0f8e=function(_0x1ab13e,_0x44507a){_0x1ab13e=_0x1ab13e-0x0;var _0xa28f8=_0xf8e0[_0x1ab13e];return _0xa28f8;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0f8e('0x0'));module['exports']={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x0f8e('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x0f8e('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x0f8e('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x0f8e('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x0f8e('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x0f8e('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x0f8e('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x0f8e('0x2')],'allowNull':![],'defaultValue':moment()[_0x0f8e('0x3')](_0x0f8e('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 0bae57d..e8c78e1 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 _0x36e4=['reject','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VoiceQueuesLog','includeAll','include','findAll','show','params','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','offset','count','set','Content-Range'];(function(_0x2a473d,_0x50aa36){var _0x1a8bfa=function(_0x7c4e31){while(--_0x7c4e31){_0x2a473d['push'](_0x2a473d['shift']());}};_0x1a8bfa(++_0x50aa36);}(_0x36e4,0xfb));var _0x436e=function(_0x135bd7,_0x46774f){_0x135bd7=_0x135bd7-0x0;var _0x6ca3ae=_0x36e4[_0x135bd7];return _0x6ca3ae;};'use strict';var emlformat=require(_0x436e('0x0'));var rimraf=require(_0x436e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x436e('0x2'));var rp=require(_0x436e('0x3'));var moment=require('moment');var BPromise=require(_0x436e('0x4'));var Mustache=require('mustache');var util=require(_0x436e('0x5'));var path=require(_0x436e('0x6'));var sox=require(_0x436e('0x7'));var csv=require(_0x436e('0x8'));var ejs=require(_0x436e('0x9'));var fs=require('fs');var fs_extra=require(_0x436e('0xa'));var _=require(_0x436e('0xb'));var squel=require(_0x436e('0xc'));var crypto=require(_0x436e('0xd'));var jsforce=require(_0x436e('0xe'));var deskjs=require(_0x436e('0xf'));var toCsv=require(_0x436e('0x8'));var querystring=require(_0x436e('0x10'));var Papa=require('papaparse');var Redis=require(_0x436e('0x11'));var authService=require(_0x436e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x436e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x436e('0x14'))('api');var utils=require(_0x436e('0x15'));var config=require(_0x436e('0x16'));var licenseUtil=require(_0x436e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29f5b2,_0x3b491a){_0x3b491a=_0x3b491a||0xcc;return function(_0x35bb46){if(_0x35bb46){return _0x29f5b2['sendStatus'](_0x3b491a);}return _0x29f5b2[_0x436e('0x18')](_0x3b491a)[_0x436e('0x19')]();};}function respondWithResult(_0x5e1b2e,_0x7baf0d){_0x7baf0d=_0x7baf0d||0xc8;return function(_0xebb20c){if(_0xebb20c){return _0x5e1b2e[_0x436e('0x18')](_0x7baf0d)[_0x436e('0x1a')](_0xebb20c);}};}function respondWithFilteredResult(_0x302d52,_0xf34334){return function(_0x4b5897){if(_0x4b5897){var _0x3ca6c7=typeof _0xf34334['offset']===_0x436e('0x1b')&&typeof _0xf34334[_0x436e('0x1c')]==='undefined';var _0x2f8052=_0x4b5897['count'];var _0x9a5b8a=_0x3ca6c7?0x0:_0xf34334[_0x436e('0x1d')];var _0x577cc6=_0x3ca6c7?_0x4b5897[_0x436e('0x1e')]:_0xf34334[_0x436e('0x1d')]+_0xf34334[_0x436e('0x1c')];var _0x404649;if(_0x577cc6>=_0x2f8052){_0x577cc6=_0x2f8052;_0x404649=0xc8;}else{_0x404649=0xce;}_0x302d52[_0x436e('0x18')](_0x404649);return _0x302d52[_0x436e('0x1f')](_0x436e('0x20'),_0x9a5b8a+'-'+_0x577cc6+'/'+_0x2f8052)['json'](_0x4b5897);}return null;};}function patchUpdates(_0x4a18e2){return function(_0x4b034b){try{jsonpatch['apply'](_0x4b034b,_0x4a18e2,!![]);}catch(_0xf83129){return BPromise[_0x436e('0x21')](_0xf83129);}return _0x4b034b['save']();};}function saveUpdates(_0x37d11c,_0xedb463){return function(_0x8e1a8){if(_0x8e1a8){return _0x8e1a8[_0x436e('0x22')](_0x37d11c)[_0x436e('0x23')](function(_0x13f641){return _0x13f641;});}return null;};}function removeEntity(_0x1b37cc,_0x23a478){return function(_0x22c793){if(_0x22c793){return _0x22c793[_0x436e('0x24')]()[_0x436e('0x23')](function(){_0x1b37cc[_0x436e('0x18')](0xcc)[_0x436e('0x19')]();});}};}function handleEntityNotFound(_0x2b7729,_0x1b9ad5){return function(_0x3f696b){if(!_0x3f696b){_0x2b7729[_0x436e('0x25')](0x194);}return _0x3f696b;};}function handleError(_0x460008,_0x15f667){_0x15f667=_0x15f667||0x1f4;return function(_0x15f96c){logger[_0x436e('0x26')](_0x15f96c['stack']);if(_0x15f96c[_0x436e('0x27')]){delete _0x15f96c[_0x436e('0x27')];}_0x460008[_0x436e('0x18')](_0x15f667)[_0x436e('0x28')](_0x15f96c);};}exports[_0x436e('0x29')]=function(_0x4a0b5b,_0x56417c){var _0x242f43={},_0x31e3e9={},_0xa1380b={'count':0x0,'rows':[]};var _0x570723=_[_0x436e('0x2a')](db['VoiceQueuesLog'][_0x436e('0x2b')],function(_0x1fb3f2){return{'name':_0x1fb3f2[_0x436e('0x2c')],'type':_0x1fb3f2[_0x436e('0x2d')]['key']};});_0x31e3e9[_0x436e('0x2e')]=_['map'](_0x570723,_0x436e('0x27'));_0x31e3e9[_0x436e('0x2f')]=_[_0x436e('0x30')](_0x4a0b5b[_0x436e('0x2f')]);_0x31e3e9[_0x436e('0x31')]=_[_0x436e('0x32')](_0x31e3e9[_0x436e('0x2e')],_0x31e3e9[_0x436e('0x2f')]);_0x242f43[_0x436e('0x33')]=_['intersection'](_0x31e3e9[_0x436e('0x2e')],qs['fields'](_0x4a0b5b[_0x436e('0x2f')][_0x436e('0x34')]));_0x242f43[_0x436e('0x33')]=_0x242f43[_0x436e('0x33')][_0x436e('0x35')]?_0x242f43[_0x436e('0x33')]:_0x31e3e9['model'];if(!_0x4a0b5b[_0x436e('0x2f')][_0x436e('0x36')](_0x436e('0x37'))){_0x242f43['limit']=qs[_0x436e('0x1c')](_0x4a0b5b[_0x436e('0x2f')]['limit']);_0x242f43[_0x436e('0x1d')]=qs['offset'](_0x4a0b5b[_0x436e('0x2f')][_0x436e('0x1d')]);}_0x242f43[_0x436e('0x38')]=qs[_0x436e('0x39')](_0x4a0b5b['query'][_0x436e('0x39')]);_0x242f43['where']=qs[_0x436e('0x31')](_['pick'](_0x4a0b5b[_0x436e('0x2f')],_0x31e3e9['filters']),_0x570723);if(_0x4a0b5b[_0x436e('0x2f')][_0x436e('0x3a')]){_0x242f43[_0x436e('0x3b')]=_[_0x436e('0x3c')](_0x242f43[_0x436e('0x3b')],{'$or':_['map'](_0x570723,function(_0x6c623f){if(_0x6c623f['type']!=='VIRTUAL'){var _0x4318f9={};_0x4318f9[_0x6c623f[_0x436e('0x27')]]={'$like':'%'+_0x4a0b5b[_0x436e('0x2f')]['filter']+'%'};return _0x4318f9;}})});}_0x242f43=_[_0x436e('0x3c')]({},_0x242f43,_0x4a0b5b['options']);var _0x40e3a1={'where':_0x242f43[_0x436e('0x3b')]};return db[_0x436e('0x3d')]['count'](_0x40e3a1)[_0x436e('0x23')](function(_0x5f5029){_0xa1380b[_0x436e('0x1e')]=_0x5f5029;if(_0x4a0b5b['query'][_0x436e('0x3e')]){_0x242f43[_0x436e('0x3f')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x436e('0x40')](_0x242f43);})[_0x436e('0x23')](function(_0x527932){_0xa1380b['rows']=_0x527932;return _0xa1380b;})[_0x436e('0x23')](respondWithFilteredResult(_0x56417c,_0x242f43))['catch'](handleError(_0x56417c,null));};exports[_0x436e('0x41')]=function(_0x53fbc9,_0x1ae8b2){var _0x125481={'raw':!![],'where':{'id':_0x53fbc9[_0x436e('0x42')]['id']}},_0x12d98b={};_0x12d98b[_0x436e('0x2e')]=_['keys'](db[_0x436e('0x3d')][_0x436e('0x2b')]);_0x12d98b[_0x436e('0x2f')]=_[_0x436e('0x30')](_0x53fbc9[_0x436e('0x2f')]);_0x12d98b[_0x436e('0x31')]=_['intersection'](_0x12d98b[_0x436e('0x2e')],_0x12d98b[_0x436e('0x2f')]);_0x125481['attributes']=_[_0x436e('0x32')](_0x12d98b[_0x436e('0x2e')],qs[_0x436e('0x34')](_0x53fbc9[_0x436e('0x2f')][_0x436e('0x34')]));_0x125481[_0x436e('0x33')]=_0x125481[_0x436e('0x33')]['length']?_0x125481[_0x436e('0x33')]:_0x12d98b['model'];if(_0x53fbc9[_0x436e('0x2f')][_0x436e('0x3e')]){_0x125481[_0x436e('0x3f')]=[{'all':!![]}];}_0x125481=_['merge']({},_0x125481,_0x53fbc9['options']);return db[_0x436e('0x3d')][_0x436e('0x43')](_0x125481)[_0x436e('0x23')](handleEntityNotFound(_0x1ae8b2,null))[_0x436e('0x23')](respondWithResult(_0x1ae8b2,null))[_0x436e('0x44')](handleError(_0x1ae8b2,null));};exports[_0x436e('0x45')]=function(_0x49c2ac,_0x1423e8){return db[_0x436e('0x3d')][_0x436e('0x45')](_0x49c2ac[_0x436e('0x46')],{})['then'](respondWithResult(_0x1423e8,0xc9))[_0x436e('0x44')](handleError(_0x1423e8,null));};exports[_0x436e('0x22')]=function(_0x24c369,_0x3ccd87){if(_0x24c369['body']['id']){delete _0x24c369[_0x436e('0x46')]['id'];}return db[_0x436e('0x3d')]['find']({'where':{'id':_0x24c369[_0x436e('0x42')]['id']}})['then'](handleEntityNotFound(_0x3ccd87,null))[_0x436e('0x23')](saveUpdates(_0x24c369['body'],null))[_0x436e('0x23')](respondWithResult(_0x3ccd87,null))[_0x436e('0x44')](handleError(_0x3ccd87,null));};exports[_0x436e('0x24')]=function(_0x3bcf41,_0x51cc5d){return db[_0x436e('0x3d')]['find']({'where':{'id':_0x3bcf41[_0x436e('0x42')]['id']}})[_0x436e('0x23')](handleEntityNotFound(_0x51cc5d,null))[_0x436e('0x23')](removeEntity(_0x51cc5d,null))[_0x436e('0x44')](handleError(_0x51cc5d,null));}; \ No newline at end of file +var _0x42e3=['../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','then','destroy','error','stack','name','send','index','VoiceQueuesLog','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','update','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils'];(function(_0x95942,_0x85da80){var _0x6d7f81=function(_0x510549){while(--_0x510549){_0x95942['push'](_0x95942['shift']());}};_0x6d7f81(++_0x85da80);}(_0x42e3,0x1e3));var _0x342e=function(_0x2521f7,_0x36c45b){_0x2521f7=_0x2521f7-0x0;var _0x359014=_0x42e3[_0x2521f7];return _0x359014;};'use strict';var emlformat=require(_0x342e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x342e('0x1'));var jsonpatch=require(_0x342e('0x2'));var rp=require(_0x342e('0x3'));var moment=require(_0x342e('0x4'));var BPromise=require(_0x342e('0x5'));var Mustache=require(_0x342e('0x6'));var util=require(_0x342e('0x7'));var path=require(_0x342e('0x8'));var sox=require(_0x342e('0x9'));var csv=require(_0x342e('0xa'));var ejs=require(_0x342e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x342e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x342e('0xd'));var toCsv=require(_0x342e('0xa'));var querystring=require(_0x342e('0xe'));var Papa=require(_0x342e('0xf'));var Redis=require('ioredis');var authService=require(_0x342e('0x10'));var qs=require(_0x342e('0x11'));var as=require(_0x342e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x342e('0x13'));var utils=require(_0x342e('0x14'));var config=require(_0x342e('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f9b98,_0x36afab){_0x36afab=_0x36afab||0xcc;return function(_0xbfbb5d){if(_0xbfbb5d){return _0x1f9b98[_0x342e('0x16')](_0x36afab);}return _0x1f9b98[_0x342e('0x17')](_0x36afab)[_0x342e('0x18')]();};}function respondWithResult(_0x2c029b,_0x2a1bc9){_0x2a1bc9=_0x2a1bc9||0xc8;return function(_0x495bf8){if(_0x495bf8){return _0x2c029b[_0x342e('0x17')](_0x2a1bc9)[_0x342e('0x19')](_0x495bf8);}};}function respondWithFilteredResult(_0xcf70a9,_0x4dfcd8){return function(_0x2b0276){if(_0x2b0276){var _0x173b27=typeof _0x4dfcd8[_0x342e('0x1a')]===_0x342e('0x1b')&&typeof _0x4dfcd8[_0x342e('0x1c')]===_0x342e('0x1b');var _0x3f9b05=_0x2b0276[_0x342e('0x1d')];var _0x3bed4a=_0x173b27?0x0:_0x4dfcd8[_0x342e('0x1a')];var _0x279a57=_0x173b27?_0x2b0276['count']:_0x4dfcd8['offset']+_0x4dfcd8[_0x342e('0x1c')];var _0x4c5826;if(_0x279a57>=_0x3f9b05){_0x279a57=_0x3f9b05;_0x4c5826=0xc8;}else{_0x4c5826=0xce;}_0xcf70a9[_0x342e('0x17')](_0x4c5826);return _0xcf70a9['set']('Content-Range',_0x3bed4a+'-'+_0x279a57+'/'+_0x3f9b05)[_0x342e('0x19')](_0x2b0276);}return null;};}function patchUpdates(_0x40e988){return function(_0xf03623){try{jsonpatch[_0x342e('0x1e')](_0xf03623,_0x40e988,!![]);}catch(_0x19d538){return BPromise[_0x342e('0x1f')](_0x19d538);}return _0xf03623[_0x342e('0x20')]();};}function saveUpdates(_0x5609e4,_0x24359a){return function(_0x24f3ac){if(_0x24f3ac){return _0x24f3ac['update'](_0x5609e4)[_0x342e('0x21')](function(_0x36afa1){return _0x36afa1;});}return null;};}function removeEntity(_0x5ef161,_0x473f27){return function(_0x156f62){if(_0x156f62){return _0x156f62[_0x342e('0x22')]()[_0x342e('0x21')](function(){_0x5ef161[_0x342e('0x17')](0xcc)[_0x342e('0x18')]();});}};}function handleEntityNotFound(_0x5c82b2,_0xf21b14){return function(_0x4f60ba){if(!_0x4f60ba){_0x5c82b2['sendStatus'](0x194);}return _0x4f60ba;};}function handleError(_0x155b12,_0x44296a){_0x44296a=_0x44296a||0x1f4;return function(_0x47c0e7){logger[_0x342e('0x23')](_0x47c0e7[_0x342e('0x24')]);if(_0x47c0e7[_0x342e('0x25')]){delete _0x47c0e7[_0x342e('0x25')];}_0x155b12['status'](_0x44296a)[_0x342e('0x26')](_0x47c0e7);};}exports[_0x342e('0x27')]=function(_0x151554,_0x8ac3d1){var _0x333bd9={},_0x4ff47a={},_0x56c1b0={'count':0x0,'rows':[]};var _0x1ff079=_['map'](db[_0x342e('0x28')][_0x342e('0x29')],function(_0x42f6bf){return{'name':_0x42f6bf[_0x342e('0x2a')],'type':_0x42f6bf['type'][_0x342e('0x2b')]};});_0x4ff47a[_0x342e('0x2c')]=_[_0x342e('0x2d')](_0x1ff079,_0x342e('0x25'));_0x4ff47a['query']=_[_0x342e('0x2e')](_0x151554[_0x342e('0x2f')]);_0x4ff47a[_0x342e('0x30')]=_[_0x342e('0x31')](_0x4ff47a[_0x342e('0x2c')],_0x4ff47a[_0x342e('0x2f')]);_0x333bd9[_0x342e('0x32')]=_[_0x342e('0x31')](_0x4ff47a['model'],qs[_0x342e('0x33')](_0x151554[_0x342e('0x2f')][_0x342e('0x33')]));_0x333bd9['attributes']=_0x333bd9[_0x342e('0x32')]['length']?_0x333bd9[_0x342e('0x32')]:_0x4ff47a[_0x342e('0x2c')];if(!_0x151554[_0x342e('0x2f')][_0x342e('0x34')]('nolimit')){_0x333bd9['limit']=qs[_0x342e('0x1c')](_0x151554[_0x342e('0x2f')][_0x342e('0x1c')]);_0x333bd9[_0x342e('0x1a')]=qs[_0x342e('0x1a')](_0x151554[_0x342e('0x2f')][_0x342e('0x1a')]);}_0x333bd9[_0x342e('0x35')]=qs[_0x342e('0x36')](_0x151554[_0x342e('0x2f')][_0x342e('0x36')]);_0x333bd9[_0x342e('0x37')]=qs[_0x342e('0x30')](_[_0x342e('0x38')](_0x151554[_0x342e('0x2f')],_0x4ff47a['filters']),_0x1ff079);if(_0x151554[_0x342e('0x2f')][_0x342e('0x39')]){_0x333bd9['where']=_[_0x342e('0x3a')](_0x333bd9[_0x342e('0x37')],{'$or':_[_0x342e('0x2d')](_0x1ff079,function(_0x5828bf){if(_0x5828bf['type']!=='VIRTUAL'){var _0x501e0e={};_0x501e0e[_0x5828bf[_0x342e('0x25')]]={'$like':'%'+_0x151554[_0x342e('0x2f')][_0x342e('0x39')]+'%'};return _0x501e0e;}})});}_0x333bd9=_['merge']({},_0x333bd9,_0x151554[_0x342e('0x3b')]);var _0x36886b={'where':_0x333bd9['where']};return db['VoiceQueuesLog'][_0x342e('0x1d')](_0x36886b)['then'](function(_0x3e5c6b){_0x56c1b0['count']=_0x3e5c6b;if(_0x151554['query'][_0x342e('0x3c')]){_0x333bd9[_0x342e('0x3d')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x342e('0x3e')](_0x333bd9);})[_0x342e('0x21')](function(_0x5427da){_0x56c1b0[_0x342e('0x3f')]=_0x5427da;return _0x56c1b0;})[_0x342e('0x21')](respondWithFilteredResult(_0x8ac3d1,_0x333bd9))[_0x342e('0x40')](handleError(_0x8ac3d1,null));};exports[_0x342e('0x41')]=function(_0x3c5dbc,_0x204179){var _0x3a993b={'raw':!![],'where':{'id':_0x3c5dbc[_0x342e('0x42')]['id']}},_0x5e663e={};_0x5e663e[_0x342e('0x2c')]=_[_0x342e('0x2e')](db[_0x342e('0x28')][_0x342e('0x29')]);_0x5e663e['query']=_['keys'](_0x3c5dbc[_0x342e('0x2f')]);_0x5e663e[_0x342e('0x30')]=_['intersection'](_0x5e663e['model'],_0x5e663e[_0x342e('0x2f')]);_0x3a993b[_0x342e('0x32')]=_[_0x342e('0x31')](_0x5e663e[_0x342e('0x2c')],qs[_0x342e('0x33')](_0x3c5dbc[_0x342e('0x2f')][_0x342e('0x33')]));_0x3a993b['attributes']=_0x3a993b[_0x342e('0x32')][_0x342e('0x43')]?_0x3a993b[_0x342e('0x32')]:_0x5e663e['model'];if(_0x3c5dbc[_0x342e('0x2f')][_0x342e('0x3c')]){_0x3a993b['include']=[{'all':!![]}];}_0x3a993b=_['merge']({},_0x3a993b,_0x3c5dbc['options']);return db[_0x342e('0x28')]['find'](_0x3a993b)['then'](handleEntityNotFound(_0x204179,null))[_0x342e('0x21')](respondWithResult(_0x204179,null))['catch'](handleError(_0x204179,null));};exports[_0x342e('0x44')]=function(_0x5d1250,_0x2182a3){return db['VoiceQueuesLog']['create'](_0x5d1250[_0x342e('0x45')],{})[_0x342e('0x21')](respondWithResult(_0x2182a3,0xc9))['catch'](handleError(_0x2182a3,null));};exports[_0x342e('0x46')]=function(_0x5a3822,_0x5ba590){if(_0x5a3822[_0x342e('0x45')]['id']){delete _0x5a3822[_0x342e('0x45')]['id'];}return db[_0x342e('0x28')][_0x342e('0x47')]({'where':{'id':_0x5a3822[_0x342e('0x42')]['id']}})['then'](handleEntityNotFound(_0x5ba590,null))[_0x342e('0x21')](saveUpdates(_0x5a3822[_0x342e('0x45')],null))['then'](respondWithResult(_0x5ba590,null))[_0x342e('0x40')](handleError(_0x5ba590,null));};exports[_0x342e('0x22')]=function(_0x30e8ef,_0x2fc93c){return db['VoiceQueuesLog'][_0x342e('0x47')]({'where':{'id':_0x30e8ef[_0x342e('0x42')]['id']}})[_0x342e('0x21')](handleEntityNotFound(_0x2fc93c,null))[_0x342e('0x21')](removeEntity(_0x2fc93c,null))[_0x342e('0x40')](handleError(_0x2fc93c,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 7ff3965..e8ca2a5 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 _0xf759=['event','lodash','util','../../config/logger','api','rimraf','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log','event_dtm'];(function(_0x319ff8,_0x45ca90){var _0x11d674=function(_0x2e8194){while(--_0x2e8194){_0x319ff8['push'](_0x319ff8['shift']());}};_0x11d674(++_0x45ca90);}(_0xf759,0x1e1));var _0x9f75=function(_0x3c2b71,_0x5bb4d3){_0x3c2b71=_0x3c2b71-0x0;var _0x39de3d=_0xf759[_0x3c2b71];return _0x39de3d;};'use strict';var _=require(_0x9f75('0x0'));var util=require(_0x9f75('0x1'));var logger=require(_0x9f75('0x2'))(_0x9f75('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9f75('0x4'));var config=require(_0x9f75('0x5'));var attributes=require(_0x9f75('0x6'));module['exports']=function(_0x171ef1,_0x2ed8ce){return _0x171ef1[_0x9f75('0x7')](_0x9f75('0x8'),attributes,{'tableName':_0x9f75('0x9'),'paranoid':![],'indexes':[{'name':_0x9f75('0xa'),'fields':[_0x9f75('0xb'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0xbc2f=['moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','util','../../config/logger'];(function(_0x56f660,_0x179e45){var _0x26dd08=function(_0x566286){while(--_0x566286){_0x56f660['push'](_0x56f660['shift']());}};_0x26dd08(++_0x179e45);}(_0xbc2f,0x157));var _0xfbc2=function(_0x48179c,_0x2a4bf4){_0x48179c=_0x48179c-0x0;var _0x2d0153=_0xbc2f[_0x48179c];return _0x2d0153;};'use strict';var _=require('lodash');var util=require(_0xfbc2('0x0'));var logger=require(_0xfbc2('0x1'))('api');var moment=require(_0xfbc2('0x2'));var BPromise=require(_0xfbc2('0x3'));var rp=require(_0xfbc2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfbc2('0x5'));var config=require(_0xfbc2('0x6'));var attributes=require(_0xfbc2('0x7'));module[_0xfbc2('0x8')]=function(_0x2821f9,_0x408481){return _0x2821f9[_0xfbc2('0x9')](_0xfbc2('0xa'),attributes,{'tableName':_0xfbc2('0xb'),'paranoid':![],'indexes':[{'name':_0xfbc2('0xc'),'fields':[_0xfbc2('0xd'),_0xfbc2('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 c2c74f6..d65c566 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 _0xd200=['info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3f30d6,_0x1dd6aa){var _0x1e9986=function(_0x170334){while(--_0x170334){_0x3f30d6['push'](_0x3f30d6['shift']());}};_0x1e9986(++_0x1dd6aa);}(_0xd200,0x7d));var _0x0d20=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xd200[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x0d20('0x0'));var util=require(_0x0d20('0x1'));var moment=require(_0x0d20('0x2'));var BPromise=require(_0x0d20('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d20('0x4'));var db=require(_0x0d20('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d20('0x6'))('rpc');var config=require(_0x0d20('0x7'));var jayson=require(_0x0d20('0x8'));var client=jayson[_0x0d20('0x9')][_0x0d20('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bd4c4,_0x1c779c,_0x564056){return new BPromise(function(_0x2ab54b,_0x1a1be6){return client[_0x0d20('0xb')](_0x3bd4c4,_0x564056)[_0x0d20('0xc')](function(_0x209575){logger[_0x0d20('0xd')](_0x0d20('0xe'),_0x1c779c,_0x0d20('0xf'));logger[_0x0d20('0x10')](_0x0d20('0x11'),_0x1c779c,_0x0d20('0xf'),JSON[_0x0d20('0x12')](_0x209575));if(_0x209575[_0x0d20('0x13')]){if(_0x209575[_0x0d20('0x13')][_0x0d20('0x14')]===0x1f4){logger[_0x0d20('0x13')](_0x0d20('0xe'),_0x1c779c,_0x209575[_0x0d20('0x13')][_0x0d20('0x15')]);return _0x1a1be6(_0x209575[_0x0d20('0x13')][_0x0d20('0x15')]);}logger[_0x0d20('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1c779c,_0x209575[_0x0d20('0x13')]['message']);return _0x2ab54b(_0x209575[_0x0d20('0x13')][_0x0d20('0x15')]);}else{logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x1c779c,_0x0d20('0xf'));_0x2ab54b(_0x209575['result'][_0x0d20('0x15')]);}})[_0x0d20('0x16')](function(_0x2cc8c6){logger[_0x0d20('0x13')](_0x0d20('0xe'),_0x1c779c,_0x2cc8c6);_0x1a1be6(_0x2cc8c6);});});} \ No newline at end of file +var _0x5379=['result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5379,0x85));var _0x9537=function(_0x50fbf2,_0x339d31){_0x50fbf2=_0x50fbf2-0x0;var _0xf95284=_0x5379[_0x50fbf2];return _0xf95284;};'use strict';var _=require(_0x9537('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9537('0x1'));var fs=require('fs');var Redis=require(_0x9537('0x2'));var db=require(_0x9537('0x3'))['db'];var utils=require(_0x9537('0x4'));var logger=require(_0x9537('0x5'))(_0x9537('0x6'));var config=require(_0x9537('0x7'));var jayson=require(_0x9537('0x8'));var client=jayson[_0x9537('0x9')][_0x9537('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x323b3a,_0x4298a4,_0x1d7e40){return new BPromise(function(_0x5a27b3,_0x11cecf){return client[_0x9537('0xb')](_0x323b3a,_0x1d7e40)[_0x9537('0xc')](function(_0x55265e){logger['info'](_0x9537('0xd'),_0x4298a4,'request\x20sent');logger[_0x9537('0xe')](_0x9537('0xf'),_0x4298a4,_0x9537('0x10'),JSON[_0x9537('0x11')](_0x55265e));if(_0x55265e[_0x9537('0x12')]){if(_0x55265e[_0x9537('0x12')][_0x9537('0x13')]===0x1f4){logger[_0x9537('0x12')](_0x9537('0xd'),_0x4298a4,_0x55265e[_0x9537('0x12')][_0x9537('0x14')]);return _0x11cecf(_0x55265e[_0x9537('0x12')][_0x9537('0x14')]);}logger['error'](_0x9537('0xd'),_0x4298a4,_0x55265e[_0x9537('0x12')][_0x9537('0x14')]);return _0x5a27b3(_0x55265e[_0x9537('0x12')][_0x9537('0x14')]);}else{logger['info'](_0x9537('0xd'),_0x4298a4,_0x9537('0x10'));_0x5a27b3(_0x55265e[_0x9537('0x15')][_0x9537('0x14')]);}})['catch'](function(_0x5b416c){logger[_0x9537('0x12')](_0x9537('0xd'),_0x4298a4,_0x5b416c);_0x11cecf(_0x5b416c);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index f920425..7f99c2f 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 _0x8700=['downloadTranscribe','post','create','runTranscribe','update','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceRecording.controller','isAuthenticated','index','get','show','/:id/download','download','/:id/downloads'];(function(_0x16b90c,_0x370e80){var _0x4cede8=function(_0x30e1ab){while(--_0x30e1ab){_0x16b90c['push'](_0x16b90c['shift']());}};_0x4cede8(++_0x370e80);}(_0x8700,0xe0));var _0x0870=function(_0x199046,_0x3b1d4b){_0x199046=_0x199046-0x0;var _0x3e7068=_0x8700[_0x199046];return _0x3e7068;};'use strict';var multer=require(_0x0870('0x0'));var util=require(_0x0870('0x1'));var path=require(_0x0870('0x2'));var timeout=require(_0x0870('0x3'));var express=require(_0x0870('0x4'));var router=express[_0x0870('0x5')]();var fs_extra=require(_0x0870('0x6'));var auth=require(_0x0870('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0870('0x8'));router['get']('/',auth[_0x0870('0x9')](),controller[_0x0870('0xa')]);router[_0x0870('0xb')]('/describe',auth[_0x0870('0x9')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0870('0xc')]);router[_0x0870('0xb')](_0x0870('0xd'),auth[_0x0870('0x9')](),controller[_0x0870('0xe')]);router['get'](_0x0870('0xf'),controller['downloads']);router[_0x0870('0xb')]('/:id/transcribe',auth[_0x0870('0x9')](),controller[_0x0870('0x10')]);router[_0x0870('0x11')]('/',auth[_0x0870('0x9')](),controller[_0x0870('0x12')]);router[_0x0870('0x11')]('/:id/transcribe',auth[_0x0870('0x9')](),controller[_0x0870('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0870('0x14')]);router['delete'](_0x0870('0x15'),auth[_0x0870('0x9')](),controller[_0x0870('0x16')]);module[_0x0870('0x17')]=router; \ No newline at end of file +var _0x7d67=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','index','/describe','isAuthenticated','describe','/:id/download','download','/:id/downloads','/:id/transcribe','post','create','runTranscribe','put','update','delete','/:id','destroy','util','path','connect-timeout','fs-extra'];(function(_0x2fee96,_0x2f735d){var _0x2e6ad1=function(_0x2c55ad){while(--_0x2c55ad){_0x2fee96['push'](_0x2fee96['shift']());}};_0x2e6ad1(++_0x2f735d);}(_0x7d67,0x1be));var _0x77d6=function(_0x17a7a1,_0x8637a5){_0x17a7a1=_0x17a7a1-0x0;var _0xc0a25c=_0x7d67[_0x17a7a1];return _0xc0a25c;};'use strict';var multer=require('multer');var util=require(_0x77d6('0x0'));var path=require(_0x77d6('0x1'));var timeout=require(_0x77d6('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x77d6('0x3'));var auth=require(_0x77d6('0x4'));var interaction=require(_0x77d6('0x5'));var config=require(_0x77d6('0x6'));var controller=require(_0x77d6('0x7'));router[_0x77d6('0x8')]('/',auth['isAuthenticated'](),controller[_0x77d6('0x9')]);router[_0x77d6('0x8')](_0x77d6('0xa'),auth[_0x77d6('0xb')](),controller[_0x77d6('0xc')]);router['get']('/:id',auth[_0x77d6('0xb')](),controller['show']);router['get'](_0x77d6('0xd'),auth[_0x77d6('0xb')](),controller[_0x77d6('0xe')]);router[_0x77d6('0x8')](_0x77d6('0xf'),controller['downloads']);router[_0x77d6('0x8')](_0x77d6('0x10'),auth['isAuthenticated'](),controller['downloadTranscribe']);router[_0x77d6('0x11')]('/',auth['isAuthenticated'](),controller[_0x77d6('0x12')]);router[_0x77d6('0x11')]('/:id/transcribe',auth[_0x77d6('0xb')](),controller[_0x77d6('0x13')]);router[_0x77d6('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x77d6('0x15')]);router[_0x77d6('0x16')](_0x77d6('0x17'),auth[_0x77d6('0xb')](),controller[_0x77d6('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index eedd8a3..a1a040e 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(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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 d1e6810..a8c57b5 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 _0xae45=['ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','send','Not\x20found','sequelize','MD5','col','$and','push','%s.cypher','extname','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentRegion','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','transcribeStatus','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','end','sendStatus','error','stack','name','index','map','VoiceRecording','rawAttributes','fieldName','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','catch','show','length','find','create','body','update','params','describe','download','../../components/encryptor','uniqueid','value','existsSync','decryptFile','secrets','recording','Sequelize'];(function(_0x4f8d61,_0x29eff0){var _0x3bc078=function(_0x4c7203){while(--_0x4c7203){_0x4f8d61['push'](_0x4f8d61['shift']());}};_0x3bc078(++_0x29eff0);}(_0xae45,0xe0));var _0x5ae4=function(_0x462d87,_0x5918be){_0x462d87=_0x462d87-0x0;var _0x407c16=_0xae45[_0x462d87];return _0x407c16;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5ae4('0x0'));var rp=require(_0x5ae4('0x1'));var moment=require(_0x5ae4('0x2'));var BPromise=require(_0x5ae4('0x3'));var Mustache=require(_0x5ae4('0x4'));var util=require(_0x5ae4('0x5'));var path=require(_0x5ae4('0x6'));var sox=require(_0x5ae4('0x7'));var csv=require('to-csv');var ejs=require(_0x5ae4('0x8'));var fs=require('fs');var fs_extra=require(_0x5ae4('0x9'));var _=require(_0x5ae4('0xa'));var squel=require(_0x5ae4('0xb'));var crypto=require('crypto');var jsforce=require(_0x5ae4('0xc'));var deskjs=require(_0x5ae4('0xd'));var toCsv=require(_0x5ae4('0xe'));var querystring=require(_0x5ae4('0xf'));var Papa=require(_0x5ae4('0x10'));var AWS=require(_0x5ae4('0x11'));var uuidv4=require(_0x5ae4('0x12'));var Redis=require(_0x5ae4('0x13'));var authService=require(_0x5ae4('0x14'));var qs=require(_0x5ae4('0x15'));var as=require(_0x5ae4('0x16'));var hardwareService=require(_0x5ae4('0x17'));var logger=require(_0x5ae4('0x18'))(_0x5ae4('0x19'));var utils=require(_0x5ae4('0x1a'));var config=require(_0x5ae4('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x5ae4('0x1c'))['db'];function respondWithStatusCode(_0x32b16b,_0x2cc7b2){_0x2cc7b2=_0x2cc7b2||0xcc;return function(_0x5475a5){if(_0x5475a5){return _0x32b16b['sendStatus'](_0x2cc7b2);}return _0x32b16b[_0x5ae4('0x1d')](_0x2cc7b2)['end']();};}function respondWithResult(_0x4e264b,_0x1c8f4b){_0x1c8f4b=_0x1c8f4b||0xc8;return function(_0x20d503){if(_0x20d503){return _0x4e264b[_0x5ae4('0x1d')](_0x1c8f4b)[_0x5ae4('0x1e')](_0x20d503);}};}function respondWithFilteredResult(_0x4ba31e,_0x116ed5){return function(_0x5c0cce){if(_0x5c0cce){var _0x2904d0=typeof _0x116ed5[_0x5ae4('0x1f')]===_0x5ae4('0x20')&&typeof _0x116ed5[_0x5ae4('0x21')]===_0x5ae4('0x20');var _0x581731=_0x5c0cce[_0x5ae4('0x22')];var _0x2efa0f=_0x2904d0?0x0:_0x116ed5[_0x5ae4('0x1f')];var _0xb9217a=_0x2904d0?_0x5c0cce['count']:_0x116ed5[_0x5ae4('0x1f')]+_0x116ed5[_0x5ae4('0x21')];var _0x2e9c3c;if(_0xb9217a>=_0x581731){_0xb9217a=_0x581731;_0x2e9c3c=0xc8;}else{_0x2e9c3c=0xce;}_0x4ba31e[_0x5ae4('0x1d')](_0x2e9c3c);return _0x4ba31e[_0x5ae4('0x23')](_0x5ae4('0x24'),_0x2efa0f+'-'+_0xb9217a+'/'+_0x581731)[_0x5ae4('0x1e')](_0x5c0cce);}return null;};}function patchUpdates(_0x10271a){return function(_0x472c6e){try{jsonpatch[_0x5ae4('0x25')](_0x472c6e,_0x10271a,!![]);}catch(_0x350da7){return BPromise['reject'](_0x350da7);}return _0x472c6e[_0x5ae4('0x26')]();};}function saveUpdates(_0xf86cb7,_0x202a07){return function(_0x4a9050){if(_0x4a9050){return _0x4a9050['update'](_0xf86cb7)[_0x5ae4('0x27')](function(_0x71358f){return _0x71358f;});}return null;};}function removeEntity(_0x599089,_0x2f86d1){return function(_0x454f15){if(_0x454f15){return _0x454f15[_0x5ae4('0x28')]()[_0x5ae4('0x27')](function(){_0x599089[_0x5ae4('0x1d')](0xcc)[_0x5ae4('0x29')]();});}};}function handleEntityNotFound(_0x2e84b7,_0x3d588b){return function(_0x31a447){if(!_0x31a447){_0x2e84b7[_0x5ae4('0x2a')](0x194);}return _0x31a447;};}function handleError(_0x580597,_0x368344){_0x368344=_0x368344||0x1f4;return function(_0x1c505a){logger[_0x5ae4('0x2b')](_0x1c505a[_0x5ae4('0x2c')]);if(_0x1c505a[_0x5ae4('0x2d')]){delete _0x1c505a[_0x5ae4('0x2d')];}_0x580597[_0x5ae4('0x1d')](_0x368344)['send'](_0x1c505a);};}exports[_0x5ae4('0x2e')]=function(_0x61e769,_0x329c8c){var _0x233ca3={},_0x196b18={},_0x484179={'count':0x0,'rows':[]};var _0x13df9e=_[_0x5ae4('0x2f')](db[_0x5ae4('0x30')][_0x5ae4('0x31')],function(_0x14356b){return{'name':_0x14356b[_0x5ae4('0x32')],'type':_0x14356b['type'][_0x5ae4('0x33')]};});_0x196b18[_0x5ae4('0x34')]=_[_0x5ae4('0x35')](_[_0x5ae4('0x2f')](_0x13df9e,'name'),[_0x5ae4('0x36')]);_0x196b18[_0x5ae4('0x37')]=_[_0x5ae4('0x38')](_0x61e769[_0x5ae4('0x37')]);_0x196b18[_0x5ae4('0x39')]=_['intersection'](_0x196b18[_0x5ae4('0x34')],_0x196b18[_0x5ae4('0x37')]);_0x233ca3[_0x5ae4('0x3a')]=_[_0x5ae4('0x3b')](_0x196b18[_0x5ae4('0x34')],qs[_0x5ae4('0x3c')](_0x61e769[_0x5ae4('0x37')]['fields']));_0x233ca3[_0x5ae4('0x3a')]=_0x233ca3[_0x5ae4('0x3a')]['length']?_0x233ca3[_0x5ae4('0x3a')]:_0x196b18[_0x5ae4('0x34')];if(!_0x61e769['query']['hasOwnProperty'](_0x5ae4('0x3d'))){_0x233ca3[_0x5ae4('0x21')]=qs[_0x5ae4('0x21')](_0x61e769[_0x5ae4('0x37')]['limit']);_0x233ca3[_0x5ae4('0x1f')]=qs[_0x5ae4('0x1f')](_0x61e769[_0x5ae4('0x37')][_0x5ae4('0x1f')]);}_0x233ca3['order']=qs[_0x5ae4('0x3e')](_0x61e769[_0x5ae4('0x37')][_0x5ae4('0x3e')]);_0x233ca3[_0x5ae4('0x3f')]=qs[_0x5ae4('0x39')](_[_0x5ae4('0x40')](_0x61e769[_0x5ae4('0x37')],_0x196b18['filters']),_0x13df9e);if(_0x61e769[_0x5ae4('0x37')][_0x5ae4('0x41')]){_0x233ca3['where']=_[_0x5ae4('0x42')](_0x233ca3[_0x5ae4('0x3f')],{'$or':_[_0x5ae4('0x2f')](_0x13df9e,function(_0x2dbf60){if(_0x2dbf60[_0x5ae4('0x43')]!==_0x5ae4('0x44')){var _0x1dd5f3={};_0x1dd5f3[_0x2dbf60['name']]={'$like':'%'+_0x61e769[_0x5ae4('0x37')][_0x5ae4('0x41')]+'%'};return _0x1dd5f3;}})});}_0x233ca3=_[_0x5ae4('0x42')]({},_0x233ca3,_0x61e769[_0x5ae4('0x45')]);var _0x386bdd={'where':_0x233ca3[_0x5ae4('0x3f')]};return db[_0x5ae4('0x30')][_0x5ae4('0x22')](_0x386bdd)[_0x5ae4('0x27')](function(_0xacd4f6){_0x484179[_0x5ae4('0x22')]=_0xacd4f6;if(_0x61e769[_0x5ae4('0x37')]['includeAll']){_0x233ca3[_0x5ae4('0x46')]=[{'all':!![]}];}return db['VoiceRecording'][_0x5ae4('0x47')](_0x233ca3);})[_0x5ae4('0x27')](function(_0x58f974){_0x484179['rows']=_0x58f974;return _0x484179;})['then'](respondWithFilteredResult(_0x329c8c,_0x233ca3))[_0x5ae4('0x48')](handleError(_0x329c8c,null));};exports[_0x5ae4('0x49')]=function(_0x2a6590,_0x27f0e4){var _0x1bcd21={'raw':![],'where':{'id':_0x2a6590['params']['id']}},_0x268bb9={};_0x268bb9[_0x5ae4('0x34')]=_[_0x5ae4('0x38')](db[_0x5ae4('0x30')][_0x5ae4('0x31')]);_0x268bb9[_0x5ae4('0x37')]=_[_0x5ae4('0x38')](_0x2a6590[_0x5ae4('0x37')]);_0x268bb9['filters']=_[_0x5ae4('0x3b')](_0x268bb9[_0x5ae4('0x34')],_0x268bb9[_0x5ae4('0x37')]);_0x1bcd21[_0x5ae4('0x3a')]=_[_0x5ae4('0x3b')](_0x268bb9[_0x5ae4('0x34')],qs[_0x5ae4('0x3c')](_0x2a6590[_0x5ae4('0x37')][_0x5ae4('0x3c')]));_0x1bcd21[_0x5ae4('0x3a')]=_0x1bcd21['attributes'][_0x5ae4('0x4a')]?_0x1bcd21['attributes']:_0x268bb9[_0x5ae4('0x34')];if(_0x2a6590[_0x5ae4('0x37')]['includeAll']){_0x1bcd21[_0x5ae4('0x46')]=[{'all':!![]}];}_0x1bcd21=_[_0x5ae4('0x42')]({},_0x1bcd21,_0x2a6590[_0x5ae4('0x45')]);return db['VoiceRecording'][_0x5ae4('0x4b')](_0x1bcd21)[_0x5ae4('0x27')](handleEntityNotFound(_0x27f0e4,null))[_0x5ae4('0x27')](respondWithResult(_0x27f0e4,null))['catch'](handleError(_0x27f0e4,null));};exports[_0x5ae4('0x4c')]=function(_0x5392a2,_0x2fe057){return db[_0x5ae4('0x30')]['create'](_0x5392a2[_0x5ae4('0x4d')],{})[_0x5ae4('0x27')](respondWithResult(_0x2fe057,0xc9))[_0x5ae4('0x48')](handleError(_0x2fe057,null));};exports[_0x5ae4('0x4e')]=function(_0x1a6575,_0x1b9d4e){if(_0x1a6575[_0x5ae4('0x4d')]['id']){delete _0x1a6575[_0x5ae4('0x4d')]['id'];}return db['VoiceRecording'][_0x5ae4('0x4b')]({'where':{'id':_0x1a6575[_0x5ae4('0x4f')]['id']}})[_0x5ae4('0x27')](handleEntityNotFound(_0x1b9d4e,null))['then'](saveUpdates(_0x1a6575[_0x5ae4('0x4d')],null))['then'](respondWithResult(_0x1b9d4e,null))[_0x5ae4('0x48')](handleError(_0x1b9d4e,null));};exports['describe']=function(_0x1648eb,_0x57e83b){return db[_0x5ae4('0x30')][_0x5ae4('0x50')]()[_0x5ae4('0x27')](respondWithResult(_0x57e83b,null))[_0x5ae4('0x48')](handleError(_0x57e83b,null));};exports[_0x5ae4('0x51')]=function(_0x35bf79,_0xb20a4d,_0x4d2ab0){var _0x913af6=require(_0x5ae4('0x52'));var _0x27146e=![];var _0x3a7bfb={};if(_0x35bf79[_0x5ae4('0x37')][_0x5ae4('0x43')]&&_0x35bf79[_0x5ae4('0x37')][_0x5ae4('0x43')]==='uniqueid'){_0x3a7bfb[_0x5ae4('0x53')]=_0x35bf79[_0x5ae4('0x4f')]['id'];}else{_0x3a7bfb['id']=_0x35bf79[_0x5ae4('0x4f')]['id'];}return db[_0x5ae4('0x30')][_0x5ae4('0x4b')]({'where':_0x3a7bfb,'attributes':['id',_0x5ae4('0x54')],'raw':!![]})[_0x5ae4('0x27')](handleEntityNotFound(_0xb20a4d,null))[_0x5ae4('0x27')](function(_0x49cc59){if(_0x49cc59){var _0x3258aa=_0x49cc59[_0x5ae4('0x54')];var _0x2d8777=util['format']('%s.cypher',_0x3258aa);if(fs[_0x5ae4('0x55')](_0x2d8777)){_0x27146e=!![];return _0x913af6[_0x5ae4('0x56')](_0x2d8777,_0x3258aa,config[_0x5ae4('0x57')][_0x5ae4('0x58')])[_0x5ae4('0x27')](function(){return _0x49cc59;});}return _0x49cc59;}})[_0x5ae4('0x27')](function(_0x452574){if(_0x452574){var _0x4461bb=_0x452574[_0x5ae4('0x54')];if(!fs[_0x5ae4('0x55')](_0x4461bb)){throw new db[(_0x5ae4('0x59'))][(_0x5ae4('0x5a'))](_0x5ae4('0x5b'));}if(_0x452574[_0x5ae4('0x5c')]){return _0xb20a4d[_0x5ae4('0x51')](_0x4461bb,_0x452574[_0x5ae4('0x5c')]+path['extname'](_0x4461bb),function(){if(_0x27146e){fs['unlink'](_0x4461bb);}});}else{return _0xb20a4d[_0x5ae4('0x51')](_0x4461bb,function(_0x28654a){if(_0x27146e){fs[_0x5ae4('0x5d')](_0x4461bb);}});}}})['catch'](function(_0x15f0b1){if(_0x15f0b1[_0x5ae4('0x5e')]===_0x5ae4('0x5b')){_0xb20a4d['status'](0x194)[_0x5ae4('0x5f')](_0x5ae4('0x60'));}else{return handleError(_0xb20a4d,null);}});};exports['downloads']=function(_0x5d2a4f,_0x5b1fe9,_0x295660){var _0x46f8cc=require(_0x5ae4('0x52'));var _0x4fb6f9=![];var _0xa958ed={'$and':[db[_0x5ae4('0x61')]['where'](db['sequelize']['fn'](_0x5ae4('0x62'),db[_0x5ae4('0x61')][_0x5ae4('0x63')](_0x5ae4('0x53'))),_0x5d2a4f[_0x5ae4('0x37')]['token'])]};if(_0x5d2a4f[_0x5ae4('0x37')]['type']&&_0x5d2a4f[_0x5ae4('0x37')][_0x5ae4('0x43')]===_0x5ae4('0x53')){_0xa958ed[_0x5ae4('0x64')]['push']({'uniqueid':_0x5d2a4f[_0x5ae4('0x4f')]['id']});}else{_0xa958ed['$and'][_0x5ae4('0x65')]({'id':_0x5d2a4f['params']['id']});}return db[_0x5ae4('0x30')][_0x5ae4('0x4b')]({'where':_0xa958ed,'attributes':['id',_0x5ae4('0x54')],'raw':!![]})[_0x5ae4('0x27')](handleEntityNotFound(_0x5b1fe9,null))[_0x5ae4('0x27')](function(_0x3e9943){if(_0x3e9943){var _0x41c672=util['format'](_0x5ae4('0x66'),_0x3e9943[_0x5ae4('0x54')]);if(fs[_0x5ae4('0x55')](_0x41c672)){_0x4fb6f9=!![];return _0x46f8cc[_0x5ae4('0x56')](_0x41c672,_0x3e9943['value'],config[_0x5ae4('0x57')][_0x5ae4('0x58')])[_0x5ae4('0x27')](function(){return _0x3e9943;});}return _0x3e9943;}})[_0x5ae4('0x27')](function(_0x284e8c){if(_0x284e8c){if(!fs['existsSync'](_0x284e8c['value'])){throw new db[(_0x5ae4('0x59'))][(_0x5ae4('0x5a'))](_0x5ae4('0x5b'));}if(_0x284e8c[_0x5ae4('0x5c')]){return _0x5b1fe9[_0x5ae4('0x51')](_0x284e8c[_0x5ae4('0x54')],_0x284e8c['filename']+path[_0x5ae4('0x67')](_0x284e8c[_0x5ae4('0x54')]),function(){if(_0x4fb6f9){fs['unlink'](_0x284e8c[_0x5ae4('0x54')]);}});}else{return _0x5b1fe9[_0x5ae4('0x51')](_0x284e8c[_0x5ae4('0x54')],function(_0xf4c3e2){if(_0x4fb6f9){fs[_0x5ae4('0x5d')](_0x284e8c[_0x5ae4('0x54')]);}});}}})[_0x5ae4('0x48')](handleError(_0x5b1fe9,null));};exports[_0x5ae4('0x28')]=function(_0xda7379,_0x198767){return db['VoiceRecording'][_0x5ae4('0x4b')]({'where':{'id':_0xda7379['params']['id']}})['then'](function(_0x5112e3){if(_[_0x5ae4('0x68')](_0x5112e3)){throw new ReferenceError(_0x5ae4('0x69'));}return _0x5112e3;})['then'](function(_0x23e5a1){var _0x10dab5=_0x23e5a1[_0x5ae4('0x54')];logger[_0x5ae4('0x6a')](_0x5ae4('0x6b'),_0x10dab5);if(!_[_0x5ae4('0x68')](_0x23e5a1[_0x5ae4('0x54')])&&fs['existsSync'](_0x10dab5)){logger[_0x5ae4('0x6a')]('File:\x20\x22'+_0x10dab5+_0x5ae4('0x6c'));fs[_0x5ae4('0x6d')](_0x10dab5);}_0x10dab5=_0x10dab5+_0x5ae4('0x6e');if(!_[_0x5ae4('0x68')](_0x23e5a1[_0x5ae4('0x54')])&&fs[_0x5ae4('0x55')](_0x10dab5)){logger[_0x5ae4('0x6a')]('File:\x20\x22'+_0x10dab5+_0x5ae4('0x6c'));fs['unlinkSync'](_0x10dab5);}return _0x23e5a1;})[_0x5ae4('0x27')](function(_0x22c863){if(!_0x22c863)throw new InternalError();return _0x22c863[_0x5ae4('0x28')]();})[_0x5ae4('0x27')](function(){_0x198767[_0x5ae4('0x1d')](0xcc)[_0x5ae4('0x29')]();})[_0x5ae4('0x48')](handleError(_0x198767,null));};function getBucketslist(_0xf4ace3,_0x5451b4,_0x23b60b){return new Promise(function(_0x1f5e57,_0x38b6ac){var _0x1182c7=new AWS['S3']({'accessKeyId':_0x5451b4,'secretAccessKey':_0xf4ace3,'region':_0x23b60b});_0x1182c7[_0x5ae4('0x6f')]({},function(_0x6478ba,_0x581217){if(_0x6478ba){return _0x38b6ac(_0x6478ba);}else{return _0x1f5e57(_0x581217);}});});}function createBucket(_0x2063c2,_0x3f56ef,_0x357a4e,_0x3c6892){return new Promise(function(_0x26ca54,_0x200a1f){var _0x108e7e=new AWS['S3']({'accessKeyId':_0x3f56ef,'secretAccessKey':_0x2063c2,'region':_0x357a4e});_0x108e7e[_0x5ae4('0x70')]({'Bucket':_0x3c6892},function(_0x250737,_0x242a6a){if(_0x250737){return _0x200a1f(_0x250737);}else{return _0x26ca54(_0x242a6a);}});});}function uploadFile(_0xa3d70c,_0x482430,_0x45dbd0,_0x48ae58,_0x5828d0,_0xa72bbf){return new Promise(function(_0x430232,_0x37b915){var _0x211f32=new AWS['S3']({'accessKeyId':_0x482430,'secretAccessKey':_0xa3d70c,'region':_0x45dbd0});_0x211f32[_0x5ae4('0x71')]({'Bucket':_0x48ae58,'Key':_0x5828d0,'Body':_0xa72bbf},function(_0x25211b,_0x4de71c){if(_0x25211b){return _0x37b915(_0x25211b);}else{return _0x430232(_0x4de71c);}});});}function startTranscribe(_0x5e0888,_0x3c2104,_0x257c58,_0x405008,_0x3ba709,_0x5ec479){return new Promise(function(_0x5e9a23,_0x9a2074){var _0x3a6c4b=new AWS[(_0x5ae4('0x72'))]({'accessKeyId':_0x3c2104,'secretAccessKey':_0x5e0888,'region':_0x257c58});_0x3a6c4b['startTranscriptionJob']({'TranscriptionJobName':_0x405008,'LanguageCode':_0x3ba709,'Media':{'MediaFileUri':_0x5ec479}},function(_0x2067c1,_0x5846bc){if(_0x2067c1){return _0x9a2074(_0x2067c1);}else{return _0x5e9a23(_0x5846bc);}});});}function transcribe(_0x2d7bf7,_0x94ffd5,_0x2f8ad4,_0x2ac065,_0x408f3c,_0x237ea2,_0x2fdc49){return new Promise(function(_0x856317,_0xe22577){var _0x563c94={};logger[_0x5ae4('0x6a')](util[_0x5ae4('0x36')](_0x5ae4('0x73'),_0x2d7bf7,_0x408f3c));return uploadFile(_0x94ffd5,_0x2f8ad4,_0x2ac065,_0x408f3c,path[_0x5ae4('0x74')](_0x237ea2),fs['readFileSync'](_0x237ea2))['then'](function(_0x7ffcc5){logger[_0x5ae4('0x6a')](util[_0x5ae4('0x36')](_0x5ae4('0x75'),_0x2d7bf7,_0x408f3c,_0x7ffcc5[_0x5ae4('0x76')]));_0x563c94[_0x5ae4('0x77')]=_0x7ffcc5[_0x5ae4('0x78')];_0x563c94['location']=_0x7ffcc5['Location'];logger[_0x5ae4('0x6a')](util['format']('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x2d7bf7));return startTranscribe(_0x94ffd5,_0x2f8ad4,_0x2ac065,uuidv4(),_0x2fdc49,_0x7ffcc5[_0x5ae4('0x76')]);})[_0x5ae4('0x27')](function(_0x655e02){logger[_0x5ae4('0x6a')](util[_0x5ae4('0x36')](_0x5ae4('0x79'),_0x2d7bf7,_0x655e02[_0x5ae4('0x7a')][_0x5ae4('0x7b')]));_0x563c94[_0x5ae4('0x7c')]=_0x655e02[_0x5ae4('0x7a')]['TranscriptionJobName'];_0x563c94['transcribeStatus']=_0x655e02[_0x5ae4('0x7a')][_0x5ae4('0x7d')];return _0x856317(_0x563c94);})['catch'](function(_0x2ce9a0){return _0xe22577(_0x2ce9a0);});});}exports[_0x5ae4('0x7e')]=function(_0x591f2b,_0x5cef25,_0x45d908){var _0x4ffb7d;var _0x3be44f;var _0x1c87e6;var _0x4e0a0a=require('../../components/encryptor');return db[_0x5ae4('0x30')][_0x5ae4('0x7f')]({'where':{'id':_0x591f2b[_0x5ae4('0x4f')]['id']}})['then'](function(_0x2eafd3){if(_0x2eafd3){var _0x5c0739=util[_0x5ae4('0x36')](_0x5ae4('0x66'),_0x2eafd3['value']);if(fs[_0x5ae4('0x55')](_0x5c0739)){cypher=!![];return _0x4e0a0a[_0x5ae4('0x56')](_0x5c0739,_0x2eafd3[_0x5ae4('0x54')],config[_0x5ae4('0x57')][_0x5ae4('0x58')])[_0x5ae4('0x27')](function(){return _0x2eafd3;});}return _0x2eafd3;}})[_0x5ae4('0x27')](function(_0x5c7168){if(!_0x5c7168){throw new db['Sequelize']['ValidationError'](_0x5ae4('0x80'));}_0x3be44f=_0x5c7168;return db['Setting'][_0x5ae4('0x7f')]({'where':{'id':0x1}});})[_0x5ae4('0x27')](handleEntityNotFound(_0x5cef25,null))[_0x5ae4('0x27')](function(_0x75f66b){if(_0x75f66b){_0x4ffb7d=_0x75f66b;if(!_0x4ffb7d[_0x5ae4('0x81')]||!_0x4ffb7d[_0x5ae4('0x82')]||!_0x4ffb7d[_0x5ae4('0x83')]||!_0x4ffb7d[_0x5ae4('0x84')]||!_0x4ffb7d[_0x5ae4('0x77')]){throw new db[(_0x5ae4('0x59'))][(_0x5ae4('0x5a'))](_0x5ae4('0x85'));}if(_0x591f2b[_0x5ae4('0x4d')][_0x5ae4('0x86')]&&(!_0x4ffb7d[_0x5ae4('0x87')]||!_0x4ffb7d['sentimentAccountId']||!_0x4ffb7d[_0x5ae4('0x88')]||!_0x4ffb7d[_0x5ae4('0x84')]||!_0x4ffb7d['bucket'])){throw new db[(_0x5ae4('0x59'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x5ae4('0x89')][_0x5ae4('0x7f')]({'where':{'id':_0x4ffb7d[_0x5ae4('0x82')]}});}})['then'](function(_0x3661ca){if(!_0x3661ca){throw new db[(_0x5ae4('0x59'))][(_0x5ae4('0x5a'))](_0x5ae4('0x8a'));}if(!_0x3661ca[_0x5ae4('0x8b')]||!_0x3661ca[_0x5ae4('0x8c')]){throw new db[(_0x5ae4('0x59'))][(_0x5ae4('0x5a'))](_0x5ae4('0x8d'));}_0x1c87e6=_0x3661ca;return getBucketslist(_0x1c87e6[_0x5ae4('0x8b')],_0x1c87e6[_0x5ae4('0x8c')],_0x4ffb7d[_0x5ae4('0x83')]);})[_0x5ae4('0x27')](function(_0x171f72){if(_0x171f72&&_0x171f72[_0x5ae4('0x8e')]){var _0x151dfe=_[_0x5ae4('0x4b')](_0x171f72[_0x5ae4('0x8e')],function(_0x43e034){return _0x43e034[_0x5ae4('0x8f')]===_0x4ffb7d['bucket'];});if(!_0x151dfe){logger['info'](util[_0x5ae4('0x36')](_0x5ae4('0x90'),_0x591f2b[_0x5ae4('0x4f')]['id'],_0x4ffb7d[_0x5ae4('0x77')]));return createBucket(_0x1c87e6['data1'],_0x1c87e6[_0x5ae4('0x8c')],_0x4ffb7d[_0x5ae4('0x83')],_0x4ffb7d[_0x5ae4('0x77')]);}logger['info'](util['format'](_0x5ae4('0x91'),_0x591f2b[_0x5ae4('0x4f')]['id'],_0x4ffb7d[_0x5ae4('0x77')]));return;}})[_0x5ae4('0x27')](function(_0x3ba9aa){if(_0x3be44f[_0x5ae4('0x92')]==='NEW'){return transcribe(_0x591f2b[_0x5ae4('0x4f')]['id'],_0x1c87e6['data1'],_0x1c87e6[_0x5ae4('0x8c')],_0x4ffb7d[_0x5ae4('0x83')],_0x4ffb7d['bucket'],_0x3be44f[_0x5ae4('0x54')],_0x4ffb7d[_0x5ae4('0x84')]);}else{logger[_0x5ae4('0x6a')](util[_0x5ae4('0x36')](_0x5ae4('0x93'),_0x591f2b['params']['id']));return{'transcribeStatus':_0x5ae4('0x94')};}})[_0x5ae4('0x27')](function(_0x4e1a1d){if(_0x4e1a1d){_0x4e1a1d[_0x5ae4('0x95')]=_0x591f2b[_0x5ae4('0x4d')]['runSentiment'];return _0x3be44f['updateAttributes'](_0x4e1a1d);}})[_0x5ae4('0x27')](respondWithResult(_0x5cef25,null))['catch'](handleError(_0x5cef25,null));};function writeFile(_0x588aab,_0x14ee68){return new Promise(function(_0x487b77,_0x4ff1f3){fs[_0x5ae4('0x96')](_0x14ee68,_0x588aab,function(_0x9dec84,_0x30bf7c){if(_0x9dec84){return _0x4ff1f3(_0x9dec84);}else{return _0x487b77(_0x30bf7c);}});});}exports[_0x5ae4('0x97')]=function(_0x1ec431,_0x3b3ce9,_0x29a3a3){return db[_0x5ae4('0x30')]['findOne']({'where':{'id':_0x1ec431[_0x5ae4('0x4f')]['id']}})[_0x5ae4('0x27')](handleEntityNotFound(_0x3b3ce9))[_0x5ae4('0x27')](function(_0x2f47d5){if(_0x2f47d5&&_0x2f47d5[_0x5ae4('0x98')]){var _0x5a504c=_0x2f47d5[_0x5ae4('0x98')];var _0x445391=config[_0x5ae4('0x99')]+_0x5ae4('0x9a')+_0x2f47d5['id']+_0x5ae4('0x9b');if(fs[_0x5ae4('0x55')](_0x445391)){return _0x445391;}return writeFile(_0x5a504c,_0x445391)[_0x5ae4('0x27')](function(){return _0x445391;});}else{throw new db[(_0x5ae4('0x59'))]['ValidationError'](_0x5ae4('0x9c'));}})[_0x5ae4('0x27')](function(_0x5dfb8a){return _0x3b3ce9[_0x5ae4('0x51')](_0x5dfb8a);})['catch'](handleError(_0x3b3ce9));}; \ No newline at end of file +var _0x10df=['format','keys','query','filters','intersection','attributes','model','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','params','fields','includeAll','find','catch','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','Not\x20found','downloads','sequelize','col','token','push','$and','extname','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','info','createBucket','upload','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','recording','Voice\x20Recording\x20not\x20found','findOne','transcribe','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','VoiceRecording','rawAttributes','type','differenceBy'];(function(_0x2d0729,_0x5a48b7){var _0x3f98db=function(_0x4a50b1){while(--_0x4a50b1){_0x2d0729['push'](_0x2d0729['shift']());}};_0x3f98db(++_0x5a48b7);}(_0x10df,0x199));var _0xf10d=function(_0x3f48c8,_0x299d53){_0x3f48c8=_0x3f48c8-0x0;var _0x4c7512=_0x10df[_0x3f48c8];return _0x4c7512;};'use strict';var emlformat=require(_0xf10d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf10d('0x1'));var jsonpatch=require(_0xf10d('0x2'));var rp=require(_0xf10d('0x3'));var moment=require(_0xf10d('0x4'));var BPromise=require(_0xf10d('0x5'));var Mustache=require(_0xf10d('0x6'));var util=require(_0xf10d('0x7'));var path=require(_0xf10d('0x8'));var sox=require(_0xf10d('0x9'));var csv=require(_0xf10d('0xa'));var ejs=require(_0xf10d('0xb'));var fs=require('fs');var fs_extra=require(_0xf10d('0xc'));var _=require(_0xf10d('0xd'));var squel=require(_0xf10d('0xe'));var crypto=require(_0xf10d('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf10d('0xa'));var querystring=require(_0xf10d('0x10'));var Papa=require('papaparse');var AWS=require(_0xf10d('0x11'));var uuidv4=require(_0xf10d('0x12'));var Redis=require(_0xf10d('0x13'));var authService=require(_0xf10d('0x14'));var qs=require(_0xf10d('0x15'));var as=require(_0xf10d('0x16'));var hardwareService=require(_0xf10d('0x17'));var logger=require('../../config/logger')(_0xf10d('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf10d('0x19'))['db'];function respondWithStatusCode(_0x5c258f,_0x181064){_0x181064=_0x181064||0xcc;return function(_0x820df7){if(_0x820df7){return _0x5c258f[_0xf10d('0x1a')](_0x181064);}return _0x5c258f[_0xf10d('0x1b')](_0x181064)[_0xf10d('0x1c')]();};}function respondWithResult(_0x448fa1,_0x2e51a1){_0x2e51a1=_0x2e51a1||0xc8;return function(_0x1945bf){if(_0x1945bf){return _0x448fa1['status'](_0x2e51a1)[_0xf10d('0x1d')](_0x1945bf);}};}function respondWithFilteredResult(_0x29446c,_0x42a094){return function(_0x5db709){if(_0x5db709){var _0x1f1150=typeof _0x42a094['offset']==='undefined'&&typeof _0x42a094[_0xf10d('0x1e')]===_0xf10d('0x1f');var _0x4fda04=_0x5db709[_0xf10d('0x20')];var _0x2f350a=_0x1f1150?0x0:_0x42a094[_0xf10d('0x21')];var _0x21b034=_0x1f1150?_0x5db709[_0xf10d('0x20')]:_0x42a094['offset']+_0x42a094[_0xf10d('0x1e')];var _0x477c9f;if(_0x21b034>=_0x4fda04){_0x21b034=_0x4fda04;_0x477c9f=0xc8;}else{_0x477c9f=0xce;}_0x29446c[_0xf10d('0x1b')](_0x477c9f);return _0x29446c['set'](_0xf10d('0x22'),_0x2f350a+'-'+_0x21b034+'/'+_0x4fda04)[_0xf10d('0x1d')](_0x5db709);}return null;};}function patchUpdates(_0x4d9d32){return function(_0x2f49d7){try{jsonpatch[_0xf10d('0x23')](_0x2f49d7,_0x4d9d32,!![]);}catch(_0x2d560b){return BPromise[_0xf10d('0x24')](_0x2d560b);}return _0x2f49d7[_0xf10d('0x25')]();};}function saveUpdates(_0x314ec0,_0x3e1ebd){return function(_0x341415){if(_0x341415){return _0x341415[_0xf10d('0x26')](_0x314ec0)[_0xf10d('0x27')](function(_0x47e698){return _0x47e698;});}return null;};}function removeEntity(_0x39bd4a,_0x351161){return function(_0xa4f876){if(_0xa4f876){return _0xa4f876[_0xf10d('0x28')]()[_0xf10d('0x27')](function(){_0x39bd4a[_0xf10d('0x1b')](0xcc)[_0xf10d('0x1c')]();});}};}function handleEntityNotFound(_0x1d6c0d,_0x414ecc){return function(_0x1dfc55){if(!_0x1dfc55){_0x1d6c0d[_0xf10d('0x1a')](0x194);}return _0x1dfc55;};}function handleError(_0x27a296,_0x4826ed){_0x4826ed=_0x4826ed||0x1f4;return function(_0x1c8ce0){logger[_0xf10d('0x29')](_0x1c8ce0[_0xf10d('0x2a')]);if(_0x1c8ce0[_0xf10d('0x2b')]){delete _0x1c8ce0['name'];}_0x27a296['status'](_0x4826ed)[_0xf10d('0x2c')](_0x1c8ce0);};}exports['index']=function(_0x576b6e,_0x185e70){var _0xb20e5c={},_0x3e45f5={},_0x534c63={'count':0x0,'rows':[]};var _0x8164c3=_[_0xf10d('0x2d')](db[_0xf10d('0x2e')][_0xf10d('0x2f')],function(_0x2166ce){return{'name':_0x2166ce['fieldName'],'type':_0x2166ce[_0xf10d('0x30')]['key']};});_0x3e45f5['model']=_[_0xf10d('0x31')](_[_0xf10d('0x2d')](_0x8164c3,'name'),[_0xf10d('0x32')]);_0x3e45f5['query']=_[_0xf10d('0x33')](_0x576b6e[_0xf10d('0x34')]);_0x3e45f5[_0xf10d('0x35')]=_[_0xf10d('0x36')](_0x3e45f5['model'],_0x3e45f5[_0xf10d('0x34')]);_0xb20e5c[_0xf10d('0x37')]=_[_0xf10d('0x36')](_0x3e45f5[_0xf10d('0x38')],qs['fields'](_0x576b6e[_0xf10d('0x34')]['fields']));_0xb20e5c['attributes']=_0xb20e5c[_0xf10d('0x37')][_0xf10d('0x39')]?_0xb20e5c['attributes']:_0x3e45f5[_0xf10d('0x38')];if(!_0x576b6e[_0xf10d('0x34')][_0xf10d('0x3a')](_0xf10d('0x3b'))){_0xb20e5c['limit']=qs['limit'](_0x576b6e['query'][_0xf10d('0x1e')]);_0xb20e5c['offset']=qs[_0xf10d('0x21')](_0x576b6e['query'][_0xf10d('0x21')]);}_0xb20e5c[_0xf10d('0x3c')]=qs[_0xf10d('0x3d')](_0x576b6e[_0xf10d('0x34')][_0xf10d('0x3d')]);_0xb20e5c[_0xf10d('0x3e')]=qs[_0xf10d('0x35')](_[_0xf10d('0x3f')](_0x576b6e[_0xf10d('0x34')],_0x3e45f5[_0xf10d('0x35')]),_0x8164c3);if(_0x576b6e[_0xf10d('0x34')][_0xf10d('0x40')]){_0xb20e5c['where']=_[_0xf10d('0x41')](_0xb20e5c[_0xf10d('0x3e')],{'$or':_[_0xf10d('0x2d')](_0x8164c3,function(_0x1bde6b){if(_0x1bde6b['type']!==_0xf10d('0x42')){var _0x5466d3={};_0x5466d3[_0x1bde6b[_0xf10d('0x2b')]]={'$like':'%'+_0x576b6e[_0xf10d('0x34')][_0xf10d('0x40')]+'%'};return _0x5466d3;}})});}_0xb20e5c=_[_0xf10d('0x41')]({},_0xb20e5c,_0x576b6e[_0xf10d('0x43')]);var _0x5e628c={'where':_0xb20e5c[_0xf10d('0x3e')]};return db[_0xf10d('0x2e')][_0xf10d('0x20')](_0x5e628c)[_0xf10d('0x27')](function(_0xbd3a8d){_0x534c63[_0xf10d('0x20')]=_0xbd3a8d;if(_0x576b6e[_0xf10d('0x34')]['includeAll']){_0xb20e5c[_0xf10d('0x44')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0xb20e5c);})[_0xf10d('0x27')](function(_0x58726a){_0x534c63[_0xf10d('0x45')]=_0x58726a;return _0x534c63;})[_0xf10d('0x27')](respondWithFilteredResult(_0x185e70,_0xb20e5c))['catch'](handleError(_0x185e70,null));};exports[_0xf10d('0x46')]=function(_0x432e78,_0x4d01be){var _0x3d4cb1={'raw':![],'where':{'id':_0x432e78[_0xf10d('0x47')]['id']}},_0x1ef50e={};_0x1ef50e[_0xf10d('0x38')]=_[_0xf10d('0x33')](db['VoiceRecording'][_0xf10d('0x2f')]);_0x1ef50e[_0xf10d('0x34')]=_['keys'](_0x432e78['query']);_0x1ef50e[_0xf10d('0x35')]=_[_0xf10d('0x36')](_0x1ef50e[_0xf10d('0x38')],_0x1ef50e[_0xf10d('0x34')]);_0x3d4cb1[_0xf10d('0x37')]=_['intersection'](_0x1ef50e['model'],qs['fields'](_0x432e78['query'][_0xf10d('0x48')]));_0x3d4cb1[_0xf10d('0x37')]=_0x3d4cb1[_0xf10d('0x37')][_0xf10d('0x39')]?_0x3d4cb1['attributes']:_0x1ef50e['model'];if(_0x432e78[_0xf10d('0x34')][_0xf10d('0x49')]){_0x3d4cb1[_0xf10d('0x44')]=[{'all':!![]}];}_0x3d4cb1=_[_0xf10d('0x41')]({},_0x3d4cb1,_0x432e78[_0xf10d('0x43')]);return db[_0xf10d('0x2e')][_0xf10d('0x4a')](_0x3d4cb1)['then'](handleEntityNotFound(_0x4d01be,null))[_0xf10d('0x27')](respondWithResult(_0x4d01be,null))[_0xf10d('0x4b')](handleError(_0x4d01be,null));};exports[_0xf10d('0x4c')]=function(_0x311baf,_0x3aeec8){return db[_0xf10d('0x2e')][_0xf10d('0x4c')](_0x311baf[_0xf10d('0x4d')],{})['then'](respondWithResult(_0x3aeec8,0xc9))[_0xf10d('0x4b')](handleError(_0x3aeec8,null));};exports[_0xf10d('0x26')]=function(_0x137ed1,_0x22b731){if(_0x137ed1[_0xf10d('0x4d')]['id']){delete _0x137ed1['body']['id'];}return db['VoiceRecording'][_0xf10d('0x4a')]({'where':{'id':_0x137ed1[_0xf10d('0x47')]['id']}})[_0xf10d('0x27')](handleEntityNotFound(_0x22b731,null))['then'](saveUpdates(_0x137ed1['body'],null))[_0xf10d('0x27')](respondWithResult(_0x22b731,null))[_0xf10d('0x4b')](handleError(_0x22b731,null));};exports[_0xf10d('0x4e')]=function(_0x2de805,_0x24f2d5){return db[_0xf10d('0x2e')][_0xf10d('0x4e')]()[_0xf10d('0x27')](respondWithResult(_0x24f2d5,null))[_0xf10d('0x4b')](handleError(_0x24f2d5,null));};exports[_0xf10d('0x4f')]=function(_0x2141bf,_0x3eb996,_0x5829de){var _0x2d1472=require(_0xf10d('0x50'));var _0xd465e6=![];var _0x1ef33a={};if(_0x2141bf[_0xf10d('0x34')][_0xf10d('0x30')]&&_0x2141bf[_0xf10d('0x34')][_0xf10d('0x30')]===_0xf10d('0x51')){_0x1ef33a['uniqueid']=_0x2141bf[_0xf10d('0x47')]['id'];}else{_0x1ef33a['id']=_0x2141bf[_0xf10d('0x47')]['id'];}return db[_0xf10d('0x2e')][_0xf10d('0x4a')]({'where':_0x1ef33a,'attributes':['id',_0xf10d('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x3eb996,null))[_0xf10d('0x27')](function(_0x2c80c0){if(_0x2c80c0){var _0x37bca7=_0x2c80c0['value'];var _0x4cb6e6=util[_0xf10d('0x32')](_0xf10d('0x53'),_0x37bca7);if(fs[_0xf10d('0x54')](_0x4cb6e6)){_0xd465e6=!![];return _0x2d1472[_0xf10d('0x55')](_0x4cb6e6,_0x37bca7,config[_0xf10d('0x56')]['recording'])[_0xf10d('0x27')](function(){return _0x2c80c0;});}return _0x2c80c0;}})['then'](function(_0x2b06b7){if(_0x2b06b7){var _0x21b95b=_0x2b06b7[_0xf10d('0x52')];if(!fs[_0xf10d('0x54')](_0x21b95b)){throw new db[(_0xf10d('0x57'))][(_0xf10d('0x58'))](_0xf10d('0x59'));}if(_0x2b06b7[_0xf10d('0x5a')]){return _0x3eb996[_0xf10d('0x4f')](_0x21b95b,_0x2b06b7[_0xf10d('0x5a')]+path['extname'](_0x21b95b),function(){if(_0xd465e6){fs[_0xf10d('0x5b')](_0x21b95b);}});}else{return _0x3eb996[_0xf10d('0x4f')](_0x21b95b,function(_0x2a0be1){if(_0xd465e6){fs[_0xf10d('0x5b')](_0x21b95b);}});}}})[_0xf10d('0x4b')](function(_0x2e28b4){if(_0x2e28b4[_0xf10d('0x5c')]===_0xf10d('0x59')){_0x3eb996['status'](0x194)['send'](_0xf10d('0x5d'));}else{return handleError(_0x3eb996,null);}});};exports[_0xf10d('0x5e')]=function(_0x344021,_0x21108d,_0x38a0bd){var _0x50d2cf=require(_0xf10d('0x50'));var _0x4a98f1=![];var _0x3bc51c={'$and':[db['sequelize']['where'](db[_0xf10d('0x5f')]['fn']('MD5',db[_0xf10d('0x5f')][_0xf10d('0x60')](_0xf10d('0x51'))),_0x344021['query'][_0xf10d('0x61')])]};if(_0x344021['query'][_0xf10d('0x30')]&&_0x344021[_0xf10d('0x34')][_0xf10d('0x30')]==='uniqueid'){_0x3bc51c['$and'][_0xf10d('0x62')]({'uniqueid':_0x344021['params']['id']});}else{_0x3bc51c[_0xf10d('0x63')]['push']({'id':_0x344021['params']['id']});}return db[_0xf10d('0x2e')][_0xf10d('0x4a')]({'where':_0x3bc51c,'attributes':['id',_0xf10d('0x52')],'raw':!![]})[_0xf10d('0x27')](handleEntityNotFound(_0x21108d,null))['then'](function(_0x39e026){if(_0x39e026){var _0x1228c9=util[_0xf10d('0x32')]('%s.cypher',_0x39e026[_0xf10d('0x52')]);if(fs['existsSync'](_0x1228c9)){_0x4a98f1=!![];return _0x50d2cf[_0xf10d('0x55')](_0x1228c9,_0x39e026[_0xf10d('0x52')],config[_0xf10d('0x56')]['recording'])['then'](function(){return _0x39e026;});}return _0x39e026;}})[_0xf10d('0x27')](function(_0x48c587){if(_0x48c587){if(!fs['existsSync'](_0x48c587[_0xf10d('0x52')])){throw new db[(_0xf10d('0x57'))][(_0xf10d('0x58'))]('VoiceRecording\x20not\x20found');}if(_0x48c587[_0xf10d('0x5a')]){return _0x21108d['download'](_0x48c587['value'],_0x48c587[_0xf10d('0x5a')]+path[_0xf10d('0x64')](_0x48c587[_0xf10d('0x52')]),function(){if(_0x4a98f1){fs[_0xf10d('0x5b')](_0x48c587[_0xf10d('0x52')]);}});}else{return _0x21108d['download'](_0x48c587['value'],function(_0x4c33db){if(_0x4a98f1){fs[_0xf10d('0x5b')](_0x48c587[_0xf10d('0x52')]);}});}}})[_0xf10d('0x4b')](handleError(_0x21108d,null));};exports[_0xf10d('0x28')]=function(_0x11fc01,_0x2ff817){return db[_0xf10d('0x2e')][_0xf10d('0x4a')]({'where':{'id':_0x11fc01[_0xf10d('0x47')]['id']}})[_0xf10d('0x27')](function(_0x43f1c5){if(_['isNil'](_0x43f1c5)){throw new ReferenceError(_0xf10d('0x65'));}return _0x43f1c5;})[_0xf10d('0x27')](function(_0x106d76){var _0x25b529=_0x106d76[_0xf10d('0x52')];logger['info'](_0xf10d('0x66'),_0x25b529);if(!_[_0xf10d('0x67')](_0x106d76[_0xf10d('0x52')])&&fs['existsSync'](_0x25b529)){logger['info'](_0xf10d('0x68')+_0x25b529+_0xf10d('0x69'));fs[_0xf10d('0x6a')](_0x25b529);}_0x25b529=_0x25b529+_0xf10d('0x6b');if(!_['isNil'](_0x106d76['value'])&&fs[_0xf10d('0x54')](_0x25b529)){logger[_0xf10d('0x6c')]('File:\x20\x22'+_0x25b529+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xf10d('0x6a')](_0x25b529);}return _0x106d76;})[_0xf10d('0x27')](function(_0x58e253){if(!_0x58e253)throw new InternalError();return _0x58e253[_0xf10d('0x28')]();})[_0xf10d('0x27')](function(){_0x2ff817[_0xf10d('0x1b')](0xcc)['end']();})[_0xf10d('0x4b')](handleError(_0x2ff817,null));};function getBucketslist(_0x27cdff,_0x9f68ed,_0x462779){return new Promise(function(_0x25e3b0,_0x3d2ca4){var _0x307653=new AWS['S3']({'accessKeyId':_0x9f68ed,'secretAccessKey':_0x27cdff,'region':_0x462779});_0x307653['listBuckets']({},function(_0x4cf6c7,_0x58868a){if(_0x4cf6c7){return _0x3d2ca4(_0x4cf6c7);}else{return _0x25e3b0(_0x58868a);}});});}function createBucket(_0x4a3a09,_0x5407a8,_0x181d96,_0x3ff30f){return new Promise(function(_0x52f807,_0xb3c148){var _0x339dfa=new AWS['S3']({'accessKeyId':_0x5407a8,'secretAccessKey':_0x4a3a09,'region':_0x181d96});_0x339dfa[_0xf10d('0x6d')]({'Bucket':_0x3ff30f},function(_0xbd9c7,_0x2b081c){if(_0xbd9c7){return _0xb3c148(_0xbd9c7);}else{return _0x52f807(_0x2b081c);}});});}function uploadFile(_0x2648b0,_0x3b70d6,_0x19fb05,_0xc305b3,_0x12abe4,_0x121753){return new Promise(function(_0x5cb091,_0xed29c2){var _0x20c8e1=new AWS['S3']({'accessKeyId':_0x3b70d6,'secretAccessKey':_0x2648b0,'region':_0x19fb05});_0x20c8e1[_0xf10d('0x6e')]({'Bucket':_0xc305b3,'Key':_0x12abe4,'Body':_0x121753},function(_0x599210,_0x2e0f0f){if(_0x599210){return _0xed29c2(_0x599210);}else{return _0x5cb091(_0x2e0f0f);}});});}function startTranscribe(_0x1de235,_0x29db3a,_0x56c2ca,_0x2c8d63,_0x44119a,_0x3208a5){return new Promise(function(_0x5440ac,_0x54ab14){var _0xdf6577=new AWS['TranscribeService']({'accessKeyId':_0x29db3a,'secretAccessKey':_0x1de235,'region':_0x56c2ca});_0xdf6577['startTranscriptionJob']({'TranscriptionJobName':_0x2c8d63,'LanguageCode':_0x44119a,'Media':{'MediaFileUri':_0x3208a5}},function(_0x7756c1,_0x40a119){if(_0x7756c1){return _0x54ab14(_0x7756c1);}else{return _0x5440ac(_0x40a119);}});});}function transcribe(_0x426099,_0x16d50c,_0x1b82a6,_0x25ec89,_0x3886f3,_0x4c2a8e,_0x3f04a1){return new Promise(function(_0x5d2fa7,_0xa3dbef){var _0x352d84={};logger[_0xf10d('0x6c')](util[_0xf10d('0x32')](_0xf10d('0x6f'),_0x426099,_0x3886f3));return uploadFile(_0x16d50c,_0x1b82a6,_0x25ec89,_0x3886f3,path['basename'](_0x4c2a8e),fs['readFileSync'](_0x4c2a8e))['then'](function(_0x136b6b){logger['info'](util[_0xf10d('0x32')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x426099,_0x3886f3,_0x136b6b[_0xf10d('0x70')]));_0x352d84[_0xf10d('0x71')]=_0x136b6b[_0xf10d('0x72')];_0x352d84[_0xf10d('0x73')]=_0x136b6b[_0xf10d('0x70')];logger[_0xf10d('0x6c')](util[_0xf10d('0x32')](_0xf10d('0x74'),_0x426099));return startTranscribe(_0x16d50c,_0x1b82a6,_0x25ec89,uuidv4(),_0x3f04a1,_0x136b6b[_0xf10d('0x70')]);})[_0xf10d('0x27')](function(_0x39f619){logger[_0xf10d('0x6c')](util['format'](_0xf10d('0x75'),_0x426099,_0x39f619[_0xf10d('0x76')][_0xf10d('0x77')]));_0x352d84['transcribeName']=_0x39f619[_0xf10d('0x76')]['TranscriptionJobName'];_0x352d84[_0xf10d('0x78')]=_0x39f619[_0xf10d('0x76')][_0xf10d('0x79')];return _0x5d2fa7(_0x352d84);})[_0xf10d('0x4b')](function(_0x55fcbe){return _0xa3dbef(_0x55fcbe);});});}exports['runTranscribe']=function(_0x9762b8,_0xbbae18,_0x5b84d3){var _0x9275cc;var _0x782367;var _0x10ae03;var _0x34f679=require('../../components/encryptor');return db['VoiceRecording']['findOne']({'where':{'id':_0x9762b8[_0xf10d('0x47')]['id']}})[_0xf10d('0x27')](function(_0x388504){if(_0x388504){var _0x1a6c31=util['format'](_0xf10d('0x53'),_0x388504['value']);if(fs['existsSync'](_0x1a6c31)){cypher=!![];return _0x34f679[_0xf10d('0x55')](_0x1a6c31,_0x388504[_0xf10d('0x52')],config[_0xf10d('0x56')][_0xf10d('0x7a')])[_0xf10d('0x27')](function(){return _0x388504;});}return _0x388504;}})[_0xf10d('0x27')](function(_0x4825db){if(!_0x4825db){throw new db[(_0xf10d('0x57'))][(_0xf10d('0x58'))](_0xf10d('0x7b'));}_0x782367=_0x4825db;return db['Setting'][_0xf10d('0x7c')]({'where':{'id':0x1}});})[_0xf10d('0x27')](handleEntityNotFound(_0xbbae18,null))[_0xf10d('0x27')](function(_0x236763){if(_0x236763){_0x9275cc=_0x236763;if(!_0x9275cc[_0xf10d('0x7d')]||!_0x9275cc['transcribeAccountId']||!_0x9275cc[_0xf10d('0x7e')]||!_0x9275cc[_0xf10d('0x7f')]||!_0x9275cc[_0xf10d('0x71')]){throw new db[(_0xf10d('0x57'))][(_0xf10d('0x58'))](_0xf10d('0x80'));}if(_0x9762b8[_0xf10d('0x4d')]['runSentiment']&&(!_0x9275cc[_0xf10d('0x81')]||!_0x9275cc['sentimentAccountId']||!_0x9275cc[_0xf10d('0x82')]||!_0x9275cc[_0xf10d('0x7f')]||!_0x9275cc[_0xf10d('0x71')])){throw new db['Sequelize']['ValidationError'](_0xf10d('0x83'));}return db[_0xf10d('0x84')][_0xf10d('0x7c')]({'where':{'id':_0x9275cc[_0xf10d('0x85')]}});}})[_0xf10d('0x27')](function(_0x4ac86f){if(!_0x4ac86f){throw new db[(_0xf10d('0x57'))]['ValidationError'](_0xf10d('0x86'));}if(!_0x4ac86f[_0xf10d('0x87')]||!_0x4ac86f['data2']){throw new db[(_0xf10d('0x57'))][(_0xf10d('0x58'))](_0xf10d('0x88'));}_0x10ae03=_0x4ac86f;return getBucketslist(_0x10ae03['data1'],_0x10ae03[_0xf10d('0x89')],_0x9275cc[_0xf10d('0x7e')]);})[_0xf10d('0x27')](function(_0x1818a5){if(_0x1818a5&&_0x1818a5[_0xf10d('0x8a')]){var _0x385f96=_['find'](_0x1818a5['Buckets'],function(_0x3dd811){return _0x3dd811[_0xf10d('0x8b')]===_0x9275cc[_0xf10d('0x71')];});if(!_0x385f96){logger[_0xf10d('0x6c')](util[_0xf10d('0x32')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x9762b8['params']['id'],_0x9275cc[_0xf10d('0x71')]));return createBucket(_0x10ae03[_0xf10d('0x87')],_0x10ae03[_0xf10d('0x89')],_0x9275cc[_0xf10d('0x7e')],_0x9275cc['bucket']);}logger[_0xf10d('0x6c')](util[_0xf10d('0x32')](_0xf10d('0x8c'),_0x9762b8[_0xf10d('0x47')]['id'],_0x9275cc[_0xf10d('0x71')]));return;}})['then'](function(_0x2433b8){if(_0x782367[_0xf10d('0x78')]===_0xf10d('0x8d')){return transcribe(_0x9762b8[_0xf10d('0x47')]['id'],_0x10ae03['data1'],_0x10ae03['data2'],_0x9275cc['transcribeRegion'],_0x9275cc['bucket'],_0x782367['value'],_0x9275cc[_0xf10d('0x7f')]);}else{logger[_0xf10d('0x6c')](util[_0xf10d('0x32')](_0xf10d('0x8e'),_0x9762b8['params']['id']));return{'transcribeStatus':_0xf10d('0x8f')};}})[_0xf10d('0x27')](function(_0x1c572c){if(_0x1c572c){_0x1c572c[_0xf10d('0x90')]=_0x9762b8['body'][_0xf10d('0x91')];return _0x782367[_0xf10d('0x92')](_0x1c572c);}})[_0xf10d('0x27')](respondWithResult(_0xbbae18,null))[_0xf10d('0x4b')](handleError(_0xbbae18,null));};function writeFile(_0x212b0d,_0x2005d0){return new Promise(function(_0x37f5aa,_0x569510){fs[_0xf10d('0x93')](_0x2005d0,_0x212b0d,function(_0x4b975b,_0x2a3bb9){if(_0x4b975b){return _0x569510(_0x4b975b);}else{return _0x37f5aa(_0x2a3bb9);}});});}exports[_0xf10d('0x94')]=function(_0x1097cf,_0x631729,_0x4ec3b6){return db[_0xf10d('0x2e')]['findOne']({'where':{'id':_0x1097cf['params']['id']}})[_0xf10d('0x27')](handleEntityNotFound(_0x631729))[_0xf10d('0x27')](function(_0x4080ad){if(_0x4080ad&&_0x4080ad[_0xf10d('0x95')]){var _0x4981c1=_0x4080ad[_0xf10d('0x95')];var _0x45850b=config[_0xf10d('0x96')]+'/server/files/transcribes/transcribe_'+_0x4080ad['id']+_0xf10d('0x97');if(fs[_0xf10d('0x54')](_0x45850b)){return _0x45850b;}return writeFile(_0x4981c1,_0x45850b)[_0xf10d('0x27')](function(){return _0x45850b;});}else{throw new db[(_0xf10d('0x57'))][(_0xf10d('0x58'))](_0xf10d('0x98'));}})[_0xf10d('0x27')](function(_0x41d2cd){return _0x631729[_0xf10d('0x4f')](_0x41d2cd);})[_0xf10d('0x4b')](handleError(_0x631729));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 2f6d4b1..cf052d0 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 _0xd2ce=['VoiceRecording','voice_recordings','uniqueid','transcribeStatus','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd2ce,0x13c));var _0xed2c=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xd2ce[_0x2f3848];return _0x102668;};'use strict';var attributes=require('./voiceRecording.attributes');module[_0xed2c('0x0')]=function(_0x4f7719,_0x409f03){return _0x4f7719[_0xed2c('0x1')](_0xed2c('0x2'),attributes,{'tableName':_0xed2c('0x3'),'paranoid':![],'indexes':[{'name':_0xed2c('0x4'),'fields':[_0xed2c('0x4')]},{'name':_0xed2c('0x5'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file +var _0x385b=['voice_recordings','uniqueid','transcribeStatus','exports','define','VoiceRecording'];(function(_0x38080e,_0x95512d){var _0x4e4c87=function(_0x2be6b3){while(--_0x2be6b3){_0x38080e['push'](_0x38080e['shift']());}};_0x4e4c87(++_0x95512d);}(_0x385b,0x1a7));var _0xb385=function(_0x17fea7,_0x102927){_0x17fea7=_0x17fea7-0x0;var _0x3150c3=_0x385b[_0x17fea7];return _0x3150c3;};'use strict';var attributes=require('./voiceRecording.attributes');module[_0xb385('0x0')]=function(_0x4ee4ed,_0x2d214b){return _0x4ee4ed[_0xb385('0x1')](_0xb385('0x2'),attributes,{'tableName':_0xb385('0x3'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb385('0x4')]},{'name':_0xb385('0x5'),'fields':[_0xb385('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 9501272..eeca0b9 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 _0x33af=['error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','limit','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x254b22,_0x27159f){var _0x1279db=function(_0x3ca06f){while(--_0x3ca06f){_0x254b22['push'](_0x254b22['shift']());}};_0x1279db(++_0x27159f);}(_0x33af,0xec));var _0xf33a=function(_0x26dc96,_0x10c6f5){_0x26dc96=_0x26dc96-0x0;var _0x30b7be=_0x33af[_0x26dc96];return _0x30b7be;};'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')]('VoiceRecording,\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')]('VoiceRecording,\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);});});}exports[_0xf33a('0x15')]=function(_0x524109){var _0x2946ef=this;return new Promise(function(_0x23d9e2,_0x38d69a){return db[_0xf33a('0x16')]['update'](_0x524109[_0xf33a('0x17')],{'raw':_0x524109[_0xf33a('0x18')]?_0x524109[_0xf33a('0x18')][_0xf33a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x524109[_0xf33a('0x18')]?_0x524109[_0xf33a('0x18')][_0xf33a('0x1a')]||null:null,'attributes':_0x524109[_0xf33a('0x18')]?_0x524109[_0xf33a('0x18')][_0xf33a('0x1b')]||null:null,'limit':_0x524109['options']?_0x524109[_0xf33a('0x18')][_0xf33a('0x1c')]||null:null})[_0xf33a('0xa')](function(_0x27faa1){logger[_0xf33a('0xb')]('UpdateVoiceRecording',_0x524109);logger[_0xf33a('0xe')]('UpdateVoiceRecording',_0x524109,JSON[_0xf33a('0xf')](_0x27faa1));_0x23d9e2(_0x27faa1);})[_0xf33a('0x14')](function(_0x394468){logger[_0xf33a('0x10')](_0xf33a('0x15'),_0x394468['message'],_0x524109);_0x38d69a(_0x2946ef[_0xf33a('0x10')](0x1f4,_0x394468[_0xf33a('0x12')]));});});};exports['CreateVoiceRecording']=function(_0x4af24a){var _0x16ef31=this;return new Promise(function(_0x5f0a53,_0x5cf981){var _0x38eba2=require('../../components/encryptor');var _0x79d653;return db['Setting'][_0xf33a('0x1d')]({'attributes':['id',_0xf33a('0x1e')],'where':{'id':0x1},'raw':!![]})[_0xf33a('0xa')](function(_0x729fca){_0x79d653=_0x729fca;return db[_0xf33a('0x16')][_0xf33a('0x1f')](_0x4af24a[_0xf33a('0x17')]);})[_0xf33a('0xa')](function(_0x26e81){if(_0x79d653[_0xf33a('0x1e')]&&fs[_0xf33a('0x20')](_0x26e81[_0xf33a('0x21')])){var _0x22c9f2=util[_0xf33a('0x22')](_0xf33a('0x23'),_0x26e81['value']);return _0x38eba2[_0xf33a('0x24')](_0x26e81[_0xf33a('0x21')],_0x22c9f2,config[_0xf33a('0x25')][_0xf33a('0x26')])['then'](function(){fs[_0xf33a('0x27')](_0x26e81[_0xf33a('0x21')]);logger[_0xf33a('0xb')](_0xf33a('0x28'));return _0x26e81;});}return _0x26e81;})[_0xf33a('0xa')](function(_0x109d84){logger['info'](_0xf33a('0x29'),_0x4af24a);logger[_0xf33a('0xe')](_0xf33a('0x29'),_0x4af24a,JSON[_0xf33a('0xf')](_0x109d84));_0x5f0a53(_0x109d84);})[_0xf33a('0x14')](function(_0x57e7be){logger['error'](_0xf33a('0x29'),_0x57e7be['message'],_0x4af24a);_0x5cf981(_0x16ef31['error'](0x1f4,_0x57e7be['message']));});});}; \ No newline at end of file +var _0x9536=['util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','CreateVoiceRecording','Setting','callRecordingEncryption','create','value','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash'];(function(_0x3b30be,_0x47bcd9){var _0x546361=function(_0x233425){while(--_0x233425){_0x3b30be['push'](_0x3b30be['shift']());}};_0x546361(++_0x47bcd9);}(_0x9536,0x179));var _0x6953=function(_0x40be86,_0x68fe5d){_0x40be86=_0x40be86-0x0;var _0xda3c3b=_0x9536[_0x40be86];return _0xda3c3b;};'use strict';var _=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var moment=require(_0x6953('0x2'));var BPromise=require(_0x6953('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6953('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6953('0x5'));var logger=require(_0x6953('0x6'))(_0x6953('0x7'));var config=require(_0x6953('0x8'));var jayson=require(_0x6953('0x9'));var client=jayson['client'][_0x6953('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bb026,_0x385f2d,_0x3e1aff){return new BPromise(function(_0x1c8225,_0x58ac30){return client[_0x6953('0xb')](_0x2bb026,_0x3e1aff)[_0x6953('0xc')](function(_0x449acb){logger['info'](_0x6953('0xd'),_0x385f2d,_0x6953('0xe'));logger[_0x6953('0xf')](_0x6953('0x10'),_0x385f2d,_0x6953('0xe'),JSON[_0x6953('0x11')](_0x449acb));if(_0x449acb[_0x6953('0x12')]){if(_0x449acb[_0x6953('0x12')][_0x6953('0x13')]===0x1f4){logger['error'](_0x6953('0xd'),_0x385f2d,_0x449acb['error'][_0x6953('0x14')]);return _0x58ac30(_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);}logger[_0x6953('0x12')](_0x6953('0xd'),_0x385f2d,_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);return _0x1c8225(_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);}else{logger[_0x6953('0x15')](_0x6953('0xd'),_0x385f2d,'request\x20sent');_0x1c8225(_0x449acb['result'][_0x6953('0x14')]);}})[_0x6953('0x16')](function(_0x16b79b){logger[_0x6953('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x385f2d,_0x16b79b);_0x58ac30(_0x16b79b);});});}exports[_0x6953('0x17')]=function(_0x2da771){var _0x4b43ae=this;return new Promise(function(_0x10858a,_0x3207dd){return db[_0x6953('0x18')][_0x6953('0x19')](_0x2da771[_0x6953('0x1a')],{'raw':_0x2da771['options']?_0x2da771[_0x6953('0x1b')][_0x6953('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2da771[_0x6953('0x1b')]?_0x2da771[_0x6953('0x1b')][_0x6953('0x1d')]||null:null,'attributes':_0x2da771['options']?_0x2da771[_0x6953('0x1b')][_0x6953('0x1e')]||null:null,'limit':_0x2da771['options']?_0x2da771[_0x6953('0x1b')][_0x6953('0x1f')]||null:null})[_0x6953('0xc')](function(_0x171dd8){logger['info'](_0x6953('0x17'),_0x2da771);logger[_0x6953('0xf')](_0x6953('0x17'),_0x2da771,JSON['stringify'](_0x171dd8));_0x10858a(_0x171dd8);})['catch'](function(_0x5a4cd7){logger[_0x6953('0x12')](_0x6953('0x17'),_0x5a4cd7['message'],_0x2da771);_0x3207dd(_0x4b43ae[_0x6953('0x12')](0x1f4,_0x5a4cd7['message']));});});};exports[_0x6953('0x20')]=function(_0x2bf39b){var _0xcdbce8=this;return new Promise(function(_0x2cc01e,_0x191d80){var _0x1497e3=require('../../components/encryptor');var _0x3dd890;return db[_0x6953('0x21')]['findOne']({'attributes':['id',_0x6953('0x22')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x173b3c){_0x3dd890=_0x173b3c;return db[_0x6953('0x18')][_0x6953('0x23')](_0x2bf39b['body']);})[_0x6953('0xc')](function(_0x3d7b04){if(_0x3dd890[_0x6953('0x22')]&&fs['existsSync'](_0x3d7b04[_0x6953('0x24')])){var _0x132a71=util['format']('%s.cypher',_0x3d7b04[_0x6953('0x24')]);return _0x1497e3[_0x6953('0x25')](_0x3d7b04[_0x6953('0x24')],_0x132a71,config[_0x6953('0x26')][_0x6953('0x27')])['then'](function(){fs[_0x6953('0x28')](_0x3d7b04['value']);logger[_0x6953('0x15')](_0x6953('0x29'));return _0x3d7b04;});}return _0x3d7b04;})['then'](function(_0x4a4d41){logger[_0x6953('0x15')](_0x6953('0x20'),_0x2bf39b);logger[_0x6953('0xf')]('CreateVoiceRecording',_0x2bf39b,JSON[_0x6953('0x11')](_0x4a4d41));_0x2cc01e(_0x4a4d41);})['catch'](function(_0x4e95f1){logger['error']('CreateVoiceRecording',_0x4e95f1[_0x6953('0x14')],_0x2bf39b);_0x191d80(_0xcdbce8[_0x6953('0x12')](0x1f4,_0x4e95f1[_0x6953('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index e78ad14..17aec4a 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 _0x9853=['show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','index','isAuthenticated','describe','/:id'];(function(_0x3c76fc,_0x39e116){var _0x4755f5=function(_0x493e01){while(--_0x493e01){_0x3c76fc['push'](_0x3c76fc['shift']());}};_0x4755f5(++_0x39e116);}(_0x9853,0x125));var _0x3985=function(_0x3b4493,_0x106e71){_0x3b4493=_0x3b4493-0x0;var _0x28fc72=_0x9853[_0x3b4493];return _0x28fc72;};'use strict';var multer=require(_0x3985('0x0'));var util=require('util');var path=require(_0x3985('0x1'));var timeout=require(_0x3985('0x2'));var express=require(_0x3985('0x3'));var router=express[_0x3985('0x4')]();var fs_extra=require(_0x3985('0x5'));var auth=require(_0x3985('0x6'));var interaction=require(_0x3985('0x7'));var config=require(_0x3985('0x8'));var controller=require(_0x3985('0x9'));router[_0x3985('0xa')]('/',auth['isAuthenticated'](),controller[_0x3985('0xb')]);router[_0x3985('0xa')]('/describe',auth[_0x3985('0xc')](),controller[_0x3985('0xd')]);router['get'](_0x3985('0xe'),auth[_0x3985('0xc')](),controller[_0x3985('0xf')]);router[_0x3985('0x10')]('/',auth[_0x3985('0xc')](),controller[_0x3985('0x11')]);router[_0x3985('0x12')](_0x3985('0xe'),auth[_0x3985('0xc')](),controller[_0x3985('0x13')]);router[_0x3985('0x14')](_0x3985('0xe'),auth[_0x3985('0xc')](),controller['destroy']);module[_0x3985('0x15')]=router; \ No newline at end of file +var _0xf0f8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x1709e7,_0x2ced21){var _0x402819=function(_0x3637a0){while(--_0x3637a0){_0x1709e7['push'](_0x1709e7['shift']());}};_0x402819(++_0x2ced21);}(_0xf0f8,0x69));var _0x8f0f=function(_0x3b4f86,_0x1c3605){_0x3b4f86=_0x3b4f86-0x0;var _0x2d4eca=_0xf0f8[_0x3b4f86];return _0x2d4eca;};'use strict';var multer=require(_0x8f0f('0x0'));var util=require(_0x8f0f('0x1'));var path=require('path');var timeout=require(_0x8f0f('0x2'));var express=require('express');var router=express[_0x8f0f('0x3')]();var fs_extra=require(_0x8f0f('0x4'));var auth=require(_0x8f0f('0x5'));var interaction=require(_0x8f0f('0x6'));var config=require(_0x8f0f('0x7'));var controller=require(_0x8f0f('0x8'));router[_0x8f0f('0x9')]('/',auth[_0x8f0f('0xa')](),controller[_0x8f0f('0xb')]);router['get'](_0x8f0f('0xc'),auth[_0x8f0f('0xa')](),controller[_0x8f0f('0xd')]);router['get'](_0x8f0f('0xe'),auth[_0x8f0f('0xa')](),controller[_0x8f0f('0xf')]);router[_0x8f0f('0x10')]('/',auth['isAuthenticated'](),controller[_0x8f0f('0x11')]);router[_0x8f0f('0x12')]('/:id',auth[_0x8f0f('0xa')](),controller[_0x8f0f('0x13')]);router['delete'](_0x8f0f('0xe'),auth[_0x8f0f('0xa')](),controller[_0x8f0f('0x14')]);module[_0x8f0f('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 40e09fe..edbe200 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 _0x44a0=['sequelize','moment','exports','ENUM','blind','STRING','Yes'];(function(_0x4984d7,_0x406583){var _0x562ec8=function(_0x2f8ed6){while(--_0x2f8ed6){_0x4984d7['push'](_0x4984d7['shift']());}};_0x562ec8(++_0x406583);}(_0x44a0,0x149));var _0x044a=function(_0x3456bf,_0x544591){_0x3456bf=_0x3456bf-0x0;var _0x40eb69=_0x44a0[_0x3456bf];return _0x40eb69;};'use strict';var Sequelize=require(_0x044a('0x0'));var moment=require(_0x044a('0x1'));module[_0x044a('0x2')]={'type':{'type':Sequelize[_0x044a('0x3')](_0x044a('0x4'),'attended')},'result':{'type':Sequelize[_0x044a('0x5')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x044a('0x5')]},'transferercalleridname':{'type':Sequelize[_0x044a('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x044a('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x044a('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x044a('0x5')]},'transferercontext':{'type':Sequelize[_0x044a('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x044a('0x5')]},'transfereechannel':{'type':Sequelize[_0x044a('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x044a('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x044a('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x044a('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x044a('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x044a('0x5')]},'isexternal':{'type':Sequelize[_0x044a('0x3')](_0x044a('0x6'),'No')},'context':{'type':Sequelize[_0x044a('0x5')]},'extension':{'type':Sequelize[_0x044a('0x5')]}}; \ No newline at end of file +var _0xb3c4=['attended','STRING','Yes','moment','ENUM'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xb3c4,0xad));var _0x4b3c=function(_0x5a9515,_0x149a83){_0x5a9515=_0x5a9515-0x0;var _0x5d7226=_0xb3c4[_0x5a9515];return _0x5d7226;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x4b3c('0x0'));module['exports']={'type':{'type':Sequelize[_0x4b3c('0x1')]('blind',_0x4b3c('0x2'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x4b3c('0x3')]},'transferercalleridnum':{'type':Sequelize[_0x4b3c('0x3')]},'transferercalleridname':{'type':Sequelize[_0x4b3c('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0x4b3c('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0x4b3c('0x3')]},'transfereraccountcode':{'type':Sequelize[_0x4b3c('0x3')]},'transferercontext':{'type':Sequelize[_0x4b3c('0x3')]},'transfererexten':{'type':Sequelize[_0x4b3c('0x3')]},'transfererlinkedid':{'type':Sequelize[_0x4b3c('0x3')]},'transfereechannel':{'type':Sequelize[_0x4b3c('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0x4b3c('0x3')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x4b3c('0x3')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x4b3c('0x3')]},'transfereecontext':{'type':Sequelize[_0x4b3c('0x3')]},'transfereeexten':{'type':Sequelize[_0x4b3c('0x3')]},'transfereelinkedid':{'type':Sequelize[_0x4b3c('0x3')]},'isexternal':{'type':Sequelize['ENUM'](_0x4b3c('0x4'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x4b3c('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 0f82a0f..45064b1 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 _0xabb9=['send','index','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name'];(function(_0x12e073,_0x4d43db){var _0x267748=function(_0x381284){while(--_0x381284){_0x12e073['push'](_0x12e073['shift']());}};_0x267748(++_0x4d43db);}(_0xabb9,0x1da));var _0x9abb=function(_0x40eb9a,_0x7ee37e){_0x40eb9a=_0x40eb9a-0x0;var _0x4caaa8=_0xabb9[_0x40eb9a];return _0x4caaa8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9abb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9abb('0x1'));var rp=require(_0x9abb('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9abb('0x3'));var util=require(_0x9abb('0x4'));var path=require(_0x9abb('0x5'));var sox=require(_0x9abb('0x6'));var csv=require('to-csv');var ejs=require(_0x9abb('0x7'));var fs=require('fs');var fs_extra=require(_0x9abb('0x8'));var _=require('lodash');var squel=require(_0x9abb('0x9'));var crypto=require(_0x9abb('0xa'));var jsforce=require(_0x9abb('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9abb('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9abb('0xd'));var qs=require(_0x9abb('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9abb('0xf'))(_0x9abb('0x10'));var utils=require(_0x9abb('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9abb('0x12'))['db'];function respondWithStatusCode(_0xdc4506,_0x2df209){_0x2df209=_0x2df209||0xcc;return function(_0x13b68f){if(_0x13b68f){return _0xdc4506[_0x9abb('0x13')](_0x2df209);}return _0xdc4506[_0x9abb('0x14')](_0x2df209)['end']();};}function respondWithResult(_0x304c75,_0x57e026){_0x57e026=_0x57e026||0xc8;return function(_0x4998bd){if(_0x4998bd){return _0x304c75['status'](_0x57e026)[_0x9abb('0x15')](_0x4998bd);}};}function respondWithFilteredResult(_0x1e8416,_0x43b7f4){return function(_0x482482){if(_0x482482){var _0x2199d8=typeof _0x43b7f4[_0x9abb('0x16')]===_0x9abb('0x17')&&typeof _0x43b7f4[_0x9abb('0x18')]===_0x9abb('0x17');var _0x5c496b=_0x482482[_0x9abb('0x19')];var _0x2a32ca=_0x2199d8?0x0:_0x43b7f4[_0x9abb('0x16')];var _0x16fbc5=_0x2199d8?_0x482482['count']:_0x43b7f4[_0x9abb('0x16')]+_0x43b7f4[_0x9abb('0x18')];var _0xf8d809;if(_0x16fbc5>=_0x5c496b){_0x16fbc5=_0x5c496b;_0xf8d809=0xc8;}else{_0xf8d809=0xce;}_0x1e8416[_0x9abb('0x14')](_0xf8d809);return _0x1e8416[_0x9abb('0x1a')](_0x9abb('0x1b'),_0x2a32ca+'-'+_0x16fbc5+'/'+_0x5c496b)[_0x9abb('0x15')](_0x482482);}return null;};}function patchUpdates(_0x34f1f6){return function(_0x232d0e){try{jsonpatch['apply'](_0x232d0e,_0x34f1f6,!![]);}catch(_0x11c45d){return BPromise[_0x9abb('0x1c')](_0x11c45d);}return _0x232d0e[_0x9abb('0x1d')]();};}function saveUpdates(_0x15ed66,_0x531ba7){return function(_0x5ee593){if(_0x5ee593){return _0x5ee593[_0x9abb('0x1e')](_0x15ed66)[_0x9abb('0x1f')](function(_0x48d975){return _0x48d975;});}return null;};}function removeEntity(_0x16be50,_0x3cb09d){return function(_0x2d3080){if(_0x2d3080){return _0x2d3080[_0x9abb('0x20')]()[_0x9abb('0x1f')](function(){_0x16be50[_0x9abb('0x14')](0xcc)[_0x9abb('0x21')]();});}};}function handleEntityNotFound(_0x5a816b,_0x1d86bb){return function(_0x1c98f5){if(!_0x1c98f5){_0x5a816b[_0x9abb('0x13')](0x194);}return _0x1c98f5;};}function handleError(_0x7bd959,_0x4252a3){_0x4252a3=_0x4252a3||0x1f4;return function(_0x5f5547){logger[_0x9abb('0x22')](_0x5f5547[_0x9abb('0x23')]);if(_0x5f5547[_0x9abb('0x24')]){delete _0x5f5547[_0x9abb('0x24')];}_0x7bd959[_0x9abb('0x14')](_0x4252a3)[_0x9abb('0x25')](_0x5f5547);};}exports[_0x9abb('0x26')]=function(_0x5c12d2,_0x230095){var _0x4fae4d={},_0x26dfe8={},_0x5f516b={'count':0x0,'rows':[]};var _0x31af8b=_['map'](db[_0x9abb('0x27')][_0x9abb('0x28')],function(_0x303285){return{'name':_0x303285[_0x9abb('0x29')],'type':_0x303285[_0x9abb('0x2a')][_0x9abb('0x2b')]};});_0x26dfe8[_0x9abb('0x2c')]=_['map'](_0x31af8b,_0x9abb('0x24'));_0x26dfe8[_0x9abb('0x2d')]=_[_0x9abb('0x2e')](_0x5c12d2['query']);_0x26dfe8['filters']=_[_0x9abb('0x2f')](_0x26dfe8[_0x9abb('0x2c')],_0x26dfe8[_0x9abb('0x2d')]);_0x4fae4d[_0x9abb('0x30')]=_[_0x9abb('0x2f')](_0x26dfe8[_0x9abb('0x2c')],qs[_0x9abb('0x31')](_0x5c12d2[_0x9abb('0x2d')][_0x9abb('0x31')]));_0x4fae4d[_0x9abb('0x30')]=_0x4fae4d['attributes'][_0x9abb('0x32')]?_0x4fae4d['attributes']:_0x26dfe8[_0x9abb('0x2c')];if(!_0x5c12d2[_0x9abb('0x2d')][_0x9abb('0x33')]('nolimit')){_0x4fae4d[_0x9abb('0x18')]=qs[_0x9abb('0x18')](_0x5c12d2[_0x9abb('0x2d')][_0x9abb('0x18')]);_0x4fae4d[_0x9abb('0x16')]=qs[_0x9abb('0x16')](_0x5c12d2[_0x9abb('0x2d')][_0x9abb('0x16')]);}_0x4fae4d[_0x9abb('0x34')]=qs[_0x9abb('0x35')](_0x5c12d2[_0x9abb('0x2d')][_0x9abb('0x35')]);_0x4fae4d[_0x9abb('0x36')]=qs[_0x9abb('0x37')](_[_0x9abb('0x38')](_0x5c12d2[_0x9abb('0x2d')],_0x26dfe8[_0x9abb('0x37')]),_0x31af8b);if(_0x5c12d2['query'][_0x9abb('0x39')]){_0x4fae4d[_0x9abb('0x36')]=_[_0x9abb('0x3a')](_0x4fae4d[_0x9abb('0x36')],{'$or':_[_0x9abb('0x3b')](_0x31af8b,function(_0x356a05){if(_0x356a05[_0x9abb('0x2a')]!==_0x9abb('0x3c')){var _0x281ad8={};_0x281ad8[_0x356a05[_0x9abb('0x24')]]={'$like':'%'+_0x5c12d2[_0x9abb('0x2d')]['filter']+'%'};return _0x281ad8;}})});}_0x4fae4d=_[_0x9abb('0x3a')]({},_0x4fae4d,_0x5c12d2[_0x9abb('0x3d')]);var _0x45bbe1={'where':_0x4fae4d[_0x9abb('0x36')]};return db[_0x9abb('0x27')]['count'](_0x45bbe1)[_0x9abb('0x1f')](function(_0x40df5a){_0x5f516b[_0x9abb('0x19')]=_0x40df5a;if(_0x5c12d2['query'][_0x9abb('0x3e')]){_0x4fae4d[_0x9abb('0x3f')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x9abb('0x40')](_0x4fae4d);})['then'](function(_0x2bc685){_0x5f516b[_0x9abb('0x41')]=_0x2bc685;return _0x5f516b;})[_0x9abb('0x1f')](respondWithFilteredResult(_0x230095,_0x4fae4d))[_0x9abb('0x42')](handleError(_0x230095,null));};exports[_0x9abb('0x43')]=function(_0x26d69b,_0x5ca9a4){var _0x2ed9c5={'raw':!![],'where':{'id':_0x26d69b[_0x9abb('0x44')]['id']}},_0x58afc1={};_0x58afc1[_0x9abb('0x2c')]=_['keys'](db[_0x9abb('0x27')][_0x9abb('0x28')]);_0x58afc1['query']=_['keys'](_0x26d69b['query']);_0x58afc1[_0x9abb('0x37')]=_[_0x9abb('0x2f')](_0x58afc1[_0x9abb('0x2c')],_0x58afc1[_0x9abb('0x2d')]);_0x2ed9c5[_0x9abb('0x30')]=_[_0x9abb('0x2f')](_0x58afc1[_0x9abb('0x2c')],qs[_0x9abb('0x31')](_0x26d69b[_0x9abb('0x2d')][_0x9abb('0x31')]));_0x2ed9c5[_0x9abb('0x30')]=_0x2ed9c5[_0x9abb('0x30')]['length']?_0x2ed9c5['attributes']:_0x58afc1['model'];if(_0x26d69b[_0x9abb('0x2d')][_0x9abb('0x3e')]){_0x2ed9c5['include']=[{'all':!![]}];}_0x2ed9c5=_[_0x9abb('0x3a')]({},_0x2ed9c5,_0x26d69b['options']);return db[_0x9abb('0x27')][_0x9abb('0x45')](_0x2ed9c5)[_0x9abb('0x1f')](handleEntityNotFound(_0x5ca9a4,null))[_0x9abb('0x1f')](respondWithResult(_0x5ca9a4,null))[_0x9abb('0x42')](handleError(_0x5ca9a4,null));};exports[_0x9abb('0x46')]=function(_0x49ba80,_0x548231){return db[_0x9abb('0x27')]['create'](_0x49ba80[_0x9abb('0x47')],{})[_0x9abb('0x1f')](respondWithResult(_0x548231,0xc9))[_0x9abb('0x42')](handleError(_0x548231,null));};exports['update']=function(_0x5d4038,_0x24b959){if(_0x5d4038[_0x9abb('0x47')]['id']){delete _0x5d4038[_0x9abb('0x47')]['id'];}return db[_0x9abb('0x27')]['find']({'where':{'id':_0x5d4038[_0x9abb('0x44')]['id']}})['then'](handleEntityNotFound(_0x24b959,null))[_0x9abb('0x1f')](saveUpdates(_0x5d4038[_0x9abb('0x47')],null))[_0x9abb('0x1f')](respondWithResult(_0x24b959,null))[_0x9abb('0x42')](handleError(_0x24b959,null));};exports[_0x9abb('0x20')]=function(_0x4c975e,_0x5b9c0c){return db[_0x9abb('0x27')][_0x9abb('0x45')]({'where':{'id':_0x4c975e[_0x9abb('0x44')]['id']}})[_0x9abb('0x1f')](handleEntityNotFound(_0x5b9c0c,null))[_0x9abb('0x1f')](removeEntity(_0x5b9c0c,null))[_0x9abb('0x42')](handleError(_0x5b9c0c,null));};exports[_0x9abb('0x48')]=function(_0xdee271,_0x1c3436){return db[_0x9abb('0x27')][_0x9abb('0x48')]()[_0x9abb('0x1f')](respondWithResult(_0x1c3436,null))[_0x9abb('0x42')](handleError(_0x1c3436,null));}; \ No newline at end of file +var _0xbcd2=['bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','count','limit','status','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','sort','pick','filter','where','merge','VIRTUAL','options','VoiceTransferReport','includeAll','include','findAll','catch','show','params','find','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x21c31d,_0x4e6ee5){var _0x57ec28=function(_0x50ae6b){while(--_0x50ae6b){_0x21c31d['push'](_0x21c31d['shift']());}};_0x57ec28(++_0x4e6ee5);}(_0xbcd2,0x1c3));var _0x2bcd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbcd2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2bcd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2bcd('0x1'));var jsonpatch=require(_0x2bcd('0x2'));var rp=require(_0x2bcd('0x3'));var moment=require(_0x2bcd('0x4'));var BPromise=require(_0x2bcd('0x5'));var Mustache=require(_0x2bcd('0x6'));var util=require(_0x2bcd('0x7'));var path=require(_0x2bcd('0x8'));var sox=require(_0x2bcd('0x9'));var csv=require(_0x2bcd('0xa'));var ejs=require(_0x2bcd('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2bcd('0xc'));var squel=require(_0x2bcd('0xd'));var crypto=require(_0x2bcd('0xe'));var jsforce=require(_0x2bcd('0xf'));var deskjs=require(_0x2bcd('0x10'));var toCsv=require(_0x2bcd('0xa'));var querystring=require(_0x2bcd('0x11'));var Papa=require(_0x2bcd('0x12'));var Redis=require(_0x2bcd('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x2bcd('0x14'));var as=require(_0x2bcd('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2bcd('0x16'));var utils=require(_0x2bcd('0x17'));var config=require(_0x2bcd('0x18'));var licenseUtil=require(_0x2bcd('0x19'));var db=require(_0x2bcd('0x1a'))['db'];function respondWithStatusCode(_0x2ba5c8,_0x49b9a2){_0x49b9a2=_0x49b9a2||0xcc;return function(_0x30f571){if(_0x30f571){return _0x2ba5c8[_0x2bcd('0x1b')](_0x49b9a2);}return _0x2ba5c8['status'](_0x49b9a2)['end']();};}function respondWithResult(_0x4049bb,_0x444d9e){_0x444d9e=_0x444d9e||0xc8;return function(_0x64432b){if(_0x64432b){return _0x4049bb['status'](_0x444d9e)[_0x2bcd('0x1c')](_0x64432b);}};}function respondWithFilteredResult(_0x3fe0ac,_0x2d358f){return function(_0x1d7d36){if(_0x1d7d36){var _0x398862=typeof _0x2d358f[_0x2bcd('0x1d')]==='undefined'&&typeof _0x2d358f['limit']===_0x2bcd('0x1e');var _0x41c4ad=_0x1d7d36[_0x2bcd('0x1f')];var _0x42b59e=_0x398862?0x0:_0x2d358f[_0x2bcd('0x1d')];var _0x33bd3b=_0x398862?_0x1d7d36[_0x2bcd('0x1f')]:_0x2d358f['offset']+_0x2d358f[_0x2bcd('0x20')];var _0x674e74;if(_0x33bd3b>=_0x41c4ad){_0x33bd3b=_0x41c4ad;_0x674e74=0xc8;}else{_0x674e74=0xce;}_0x3fe0ac[_0x2bcd('0x21')](_0x674e74);return _0x3fe0ac['set'](_0x2bcd('0x22'),_0x42b59e+'-'+_0x33bd3b+'/'+_0x41c4ad)[_0x2bcd('0x1c')](_0x1d7d36);}return null;};}function patchUpdates(_0x39df9c){return function(_0x2a2459){try{jsonpatch[_0x2bcd('0x23')](_0x2a2459,_0x39df9c,!![]);}catch(_0x389c29){return BPromise[_0x2bcd('0x24')](_0x389c29);}return _0x2a2459[_0x2bcd('0x25')]();};}function saveUpdates(_0x50efac,_0x5c02bb){return function(_0x5c06df){if(_0x5c06df){return _0x5c06df['update'](_0x50efac)[_0x2bcd('0x26')](function(_0x4b196f){return _0x4b196f;});}return null;};}function removeEntity(_0x2f4eea,_0x3e2b89){return function(_0x17cbd5){if(_0x17cbd5){return _0x17cbd5[_0x2bcd('0x27')]()[_0x2bcd('0x26')](function(){_0x2f4eea[_0x2bcd('0x21')](0xcc)[_0x2bcd('0x28')]();});}};}function handleEntityNotFound(_0x209c89,_0x8f3978){return function(_0x7c0df8){if(!_0x7c0df8){_0x209c89[_0x2bcd('0x1b')](0x194);}return _0x7c0df8;};}function handleError(_0x29b3fe,_0x998bba){_0x998bba=_0x998bba||0x1f4;return function(_0x39eb27){logger[_0x2bcd('0x29')](_0x39eb27[_0x2bcd('0x2a')]);if(_0x39eb27[_0x2bcd('0x2b')]){delete _0x39eb27[_0x2bcd('0x2b')];}_0x29b3fe['status'](_0x998bba)[_0x2bcd('0x2c')](_0x39eb27);};}exports[_0x2bcd('0x2d')]=function(_0xd731ed,_0x3078eb){var _0x4a511f={},_0x48bcc3={},_0x49ad3a={'count':0x0,'rows':[]};var _0x508196=_[_0x2bcd('0x2e')](db['VoiceTransferReport'][_0x2bcd('0x2f')],function(_0xc7e287){return{'name':_0xc7e287[_0x2bcd('0x30')],'type':_0xc7e287[_0x2bcd('0x31')]['key']};});_0x48bcc3[_0x2bcd('0x32')]=_[_0x2bcd('0x2e')](_0x508196,_0x2bcd('0x2b'));_0x48bcc3[_0x2bcd('0x33')]=_[_0x2bcd('0x34')](_0xd731ed[_0x2bcd('0x33')]);_0x48bcc3[_0x2bcd('0x35')]=_[_0x2bcd('0x36')](_0x48bcc3[_0x2bcd('0x32')],_0x48bcc3['query']);_0x4a511f[_0x2bcd('0x37')]=_[_0x2bcd('0x36')](_0x48bcc3[_0x2bcd('0x32')],qs['fields'](_0xd731ed[_0x2bcd('0x33')][_0x2bcd('0x38')]));_0x4a511f[_0x2bcd('0x37')]=_0x4a511f[_0x2bcd('0x37')][_0x2bcd('0x39')]?_0x4a511f[_0x2bcd('0x37')]:_0x48bcc3[_0x2bcd('0x32')];if(!_0xd731ed['query']['hasOwnProperty']('nolimit')){_0x4a511f[_0x2bcd('0x20')]=qs[_0x2bcd('0x20')](_0xd731ed['query']['limit']);_0x4a511f[_0x2bcd('0x1d')]=qs[_0x2bcd('0x1d')](_0xd731ed['query'][_0x2bcd('0x1d')]);}_0x4a511f['order']=qs[_0x2bcd('0x3a')](_0xd731ed[_0x2bcd('0x33')][_0x2bcd('0x3a')]);_0x4a511f['where']=qs[_0x2bcd('0x35')](_[_0x2bcd('0x3b')](_0xd731ed[_0x2bcd('0x33')],_0x48bcc3[_0x2bcd('0x35')]),_0x508196);if(_0xd731ed[_0x2bcd('0x33')][_0x2bcd('0x3c')]){_0x4a511f[_0x2bcd('0x3d')]=_[_0x2bcd('0x3e')](_0x4a511f[_0x2bcd('0x3d')],{'$or':_[_0x2bcd('0x2e')](_0x508196,function(_0x284b95){if(_0x284b95[_0x2bcd('0x31')]!==_0x2bcd('0x3f')){var _0x566dca={};_0x566dca[_0x284b95[_0x2bcd('0x2b')]]={'$like':'%'+_0xd731ed['query'][_0x2bcd('0x3c')]+'%'};return _0x566dca;}})});}_0x4a511f=_[_0x2bcd('0x3e')]({},_0x4a511f,_0xd731ed[_0x2bcd('0x40')]);var _0x5caaf1={'where':_0x4a511f[_0x2bcd('0x3d')]};return db[_0x2bcd('0x41')][_0x2bcd('0x1f')](_0x5caaf1)[_0x2bcd('0x26')](function(_0x122b3c){_0x49ad3a['count']=_0x122b3c;if(_0xd731ed[_0x2bcd('0x33')][_0x2bcd('0x42')]){_0x4a511f[_0x2bcd('0x43')]=[{'all':!![]}];}return db[_0x2bcd('0x41')][_0x2bcd('0x44')](_0x4a511f);})['then'](function(_0x5aaa44){_0x49ad3a['rows']=_0x5aaa44;return _0x49ad3a;})[_0x2bcd('0x26')](respondWithFilteredResult(_0x3078eb,_0x4a511f))[_0x2bcd('0x45')](handleError(_0x3078eb,null));};exports[_0x2bcd('0x46')]=function(_0x34bc03,_0x5962b9){var _0x3708ab={'raw':!![],'where':{'id':_0x34bc03[_0x2bcd('0x47')]['id']}},_0x50daef={};_0x50daef[_0x2bcd('0x32')]=_[_0x2bcd('0x34')](db[_0x2bcd('0x41')][_0x2bcd('0x2f')]);_0x50daef[_0x2bcd('0x33')]=_[_0x2bcd('0x34')](_0x34bc03[_0x2bcd('0x33')]);_0x50daef[_0x2bcd('0x35')]=_['intersection'](_0x50daef[_0x2bcd('0x32')],_0x50daef[_0x2bcd('0x33')]);_0x3708ab[_0x2bcd('0x37')]=_[_0x2bcd('0x36')](_0x50daef[_0x2bcd('0x32')],qs[_0x2bcd('0x38')](_0x34bc03[_0x2bcd('0x33')][_0x2bcd('0x38')]));_0x3708ab[_0x2bcd('0x37')]=_0x3708ab[_0x2bcd('0x37')][_0x2bcd('0x39')]?_0x3708ab[_0x2bcd('0x37')]:_0x50daef['model'];if(_0x34bc03[_0x2bcd('0x33')][_0x2bcd('0x42')]){_0x3708ab[_0x2bcd('0x43')]=[{'all':!![]}];}_0x3708ab=_[_0x2bcd('0x3e')]({},_0x3708ab,_0x34bc03['options']);return db[_0x2bcd('0x41')][_0x2bcd('0x48')](_0x3708ab)[_0x2bcd('0x26')](handleEntityNotFound(_0x5962b9,null))['then'](respondWithResult(_0x5962b9,null))['catch'](handleError(_0x5962b9,null));};exports[_0x2bcd('0x49')]=function(_0x409274,_0x2791b7){return db[_0x2bcd('0x41')][_0x2bcd('0x49')](_0x409274[_0x2bcd('0x4a')],{})['then'](respondWithResult(_0x2791b7,0xc9))[_0x2bcd('0x45')](handleError(_0x2791b7,null));};exports[_0x2bcd('0x4b')]=function(_0x62cf06,_0x42e3e3){if(_0x62cf06['body']['id']){delete _0x62cf06[_0x2bcd('0x4a')]['id'];}return db[_0x2bcd('0x41')][_0x2bcd('0x48')]({'where':{'id':_0x62cf06[_0x2bcd('0x47')]['id']}})[_0x2bcd('0x26')](handleEntityNotFound(_0x42e3e3,null))[_0x2bcd('0x26')](saveUpdates(_0x62cf06[_0x2bcd('0x4a')],null))['then'](respondWithResult(_0x42e3e3,null))[_0x2bcd('0x45')](handleError(_0x42e3e3,null));};exports[_0x2bcd('0x27')]=function(_0x19e459,_0x131f24){return db[_0x2bcd('0x41')][_0x2bcd('0x48')]({'where':{'id':_0x19e459['params']['id']}})[_0x2bcd('0x26')](handleEntityNotFound(_0x131f24,null))[_0x2bcd('0x26')](removeEntity(_0x131f24,null))[_0x2bcd('0x45')](handleError(_0x131f24,null));};exports['describe']=function(_0x1c5609,_0x31653b){return db['VoiceTransferReport']['describe']()[_0x2bcd('0x26')](respondWithResult(_0x31653b,null))['catch'](handleError(_0x31653b,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index d1daf2c..06c4a06 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 _0xff4a=['path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','lodash','util','api','moment','bluebird'];(function(_0x533132,_0xf5b6fa){var _0x1a7447=function(_0x44d580){while(--_0x44d580){_0x533132['push'](_0x533132['shift']());}};_0x1a7447(++_0xf5b6fa);}(_0xff4a,0xe2));var _0xaff4=function(_0x4799d1,_0x481a79){_0x4799d1=_0x4799d1-0x0;var _0x39d0fe=_0xff4a[_0x4799d1];return _0x39d0fe;};'use strict';var _=require(_0xaff4('0x0'));var util=require(_0xaff4('0x1'));var logger=require('../../config/logger')(_0xaff4('0x2'));var moment=require(_0xaff4('0x3'));var BPromise=require(_0xaff4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaff4('0x5'));var rimraf=require(_0xaff4('0x6'));var config=require(_0xaff4('0x7'));var attributes=require(_0xaff4('0x8'));module[_0xaff4('0x9')]=function(_0x5316a5,_0x591228){return _0x5316a5[_0xaff4('0xa')]('VoiceTransferReport',attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7766=['../../config/logger','api','../../config/environment','./voiceTransferReport.attributes','exports','report_call_transfer','lodash'];(function(_0x4a5c02,_0x5dc14a){var _0x39a30f=function(_0x3fd756){while(--_0x3fd756){_0x4a5c02['push'](_0x4a5c02['shift']());}};_0x39a30f(++_0x5dc14a);}(_0x7766,0x172));var _0x6776=function(_0x1c2b9a,_0x26821f){_0x1c2b9a=_0x1c2b9a-0x0;var _0x285cce=_0x7766[_0x1c2b9a];return _0x285cce;};'use strict';var _=require(_0x6776('0x0'));var util=require('util');var logger=require(_0x6776('0x1'))(_0x6776('0x2'));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(_0x6776('0x3'));var attributes=require(_0x6776('0x4'));module[_0x6776('0x5')]=function(_0xe8d397,_0x2e36f2){return _0xe8d397['define']('VoiceTransferReport',attributes,{'tableName':_0x6776('0x6'),'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 be53ba4..bdf77c2 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 _0xec63=['VoiceTransferReport,\x20%s,\x20%s','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3d27a,_0x31311d){var _0x314fd7=function(_0x20ac55){while(--_0x20ac55){_0x3d27a['push'](_0x3d27a['shift']());}};_0x314fd7(++_0x31311d);}(_0xec63,0xa5));var _0x3ec6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xec63[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x3ec6('0x0'));var util=require(_0x3ec6('0x1'));var moment=require(_0x3ec6('0x2'));var BPromise=require(_0x3ec6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3ec6('0x4'));var db=require(_0x3ec6('0x5'))['db'];var utils=require(_0x3ec6('0x6'));var logger=require(_0x3ec6('0x7'))(_0x3ec6('0x8'));var config=require(_0x3ec6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3ec6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9af0cf,_0x19f3de,_0x44d854){return new BPromise(function(_0x1f7b09,_0x173776){return client['request'](_0x9af0cf,_0x44d854)[_0x3ec6('0xb')](function(_0xf8b0d8){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x19f3de,'request\x20sent');logger[_0x3ec6('0xc')](_0x3ec6('0xd'),_0x19f3de,'request\x20sent',JSON[_0x3ec6('0xe')](_0xf8b0d8));if(_0xf8b0d8[_0x3ec6('0xf')]){if(_0xf8b0d8[_0x3ec6('0xf')][_0x3ec6('0x10')]===0x1f4){logger['error'](_0x3ec6('0x11'),_0x19f3de,_0xf8b0d8['error'][_0x3ec6('0x12')]);return _0x173776(_0xf8b0d8['error'][_0x3ec6('0x12')]);}logger['error'](_0x3ec6('0x11'),_0x19f3de,_0xf8b0d8[_0x3ec6('0xf')][_0x3ec6('0x12')]);return _0x1f7b09(_0xf8b0d8[_0x3ec6('0xf')][_0x3ec6('0x12')]);}else{logger['info'](_0x3ec6('0x11'),_0x19f3de,'request\x20sent');_0x1f7b09(_0xf8b0d8[_0x3ec6('0x13')][_0x3ec6('0x12')]);}})[_0x3ec6('0x14')](function(_0x1926ca){logger[_0x3ec6('0xf')](_0x3ec6('0x11'),_0x19f3de,_0x1926ca);_0x173776(_0x1926ca);});});}exports[_0x3ec6('0x15')]=function(_0x20c8b2){var _0x4da3a7=this;return new Promise(function(_0x2dfdc4,_0x3f4a73){return db[_0x3ec6('0x16')][_0x3ec6('0x17')](_0x20c8b2['body'],{'raw':_0x20c8b2[_0x3ec6('0x18')]?_0x20c8b2['options'][_0x3ec6('0x19')]===undefined?!![]:![]:!![]})[_0x3ec6('0xb')](function(_0xcc28e4){logger['info'](_0x3ec6('0x15'),_0x20c8b2);logger[_0x3ec6('0xc')](_0x3ec6('0x15'),_0x20c8b2,JSON['stringify'](_0xcc28e4));_0x2dfdc4(_0xcc28e4);})[_0x3ec6('0x14')](function(_0x1cff41){logger[_0x3ec6('0xf')]('CreateVoiceTransferReport',_0x1cff41[_0x3ec6('0x12')],_0x20c8b2);_0x3f4a73(_0x4da3a7[_0x3ec6('0xf')](0x1f4,_0x1cff41[_0x3ec6('0x12')]));});});}; \ No newline at end of file +var _0x6843=['request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','then','stringify','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','VoiceTransferReport,\x20%s,\x20%s'];(function(_0x2c4126,_0x3906f8){var _0x1f4ba3=function(_0x36f1e5){while(--_0x36f1e5){_0x2c4126['push'](_0x2c4126['shift']());}};_0x1f4ba3(++_0x3906f8);}(_0x6843,0xbe));var _0x3684=function(_0x151bc5,_0x2beb10){_0x151bc5=_0x151bc5-0x0;var _0x1f1df7=_0x6843[_0x151bc5];return _0x1f1df7;};'use strict';var _=require(_0x3684('0x0'));var util=require(_0x3684('0x1'));var moment=require(_0x3684('0x2'));var BPromise=require(_0x3684('0x3'));var rs=require(_0x3684('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3684('0x5'));var logger=require(_0x3684('0x6'))(_0x3684('0x7'));var config=require(_0x3684('0x8'));var jayson=require(_0x3684('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3f396c,_0x1e1f4d,_0x132683){return new BPromise(function(_0x2ae591,_0x15b94e){return client[_0x3684('0xa')](_0x3f396c,_0x132683)['then'](function(_0x3d8c3d){logger[_0x3684('0xb')](_0x3684('0xc'),_0x1e1f4d,_0x3684('0xd'));logger[_0x3684('0xe')](_0x3684('0xf'),_0x1e1f4d,_0x3684('0xd'),JSON['stringify'](_0x3d8c3d));if(_0x3d8c3d['error']){if(_0x3d8c3d[_0x3684('0x10')][_0x3684('0x11')]===0x1f4){logger['error'](_0x3684('0xc'),_0x1e1f4d,_0x3d8c3d[_0x3684('0x10')][_0x3684('0x12')]);return _0x15b94e(_0x3d8c3d['error'][_0x3684('0x12')]);}logger[_0x3684('0x10')](_0x3684('0xc'),_0x1e1f4d,_0x3d8c3d[_0x3684('0x10')][_0x3684('0x12')]);return _0x2ae591(_0x3d8c3d[_0x3684('0x10')][_0x3684('0x12')]);}else{logger[_0x3684('0xb')](_0x3684('0xc'),_0x1e1f4d,_0x3684('0xd'));_0x2ae591(_0x3d8c3d[_0x3684('0x13')][_0x3684('0x12')]);}})[_0x3684('0x14')](function(_0x4c3612){logger[_0x3684('0x10')](_0x3684('0xc'),_0x1e1f4d,_0x4c3612);_0x15b94e(_0x4c3612);});});}exports[_0x3684('0x15')]=function(_0x127f96){var _0x2deee0=this;return new Promise(function(_0x384f81,_0x12be2a){return db[_0x3684('0x16')][_0x3684('0x17')](_0x127f96[_0x3684('0x18')],{'raw':_0x127f96[_0x3684('0x19')]?_0x127f96[_0x3684('0x19')][_0x3684('0x1a')]===undefined?!![]:![]:!![]})[_0x3684('0x1b')](function(_0x3e8f4e){logger[_0x3684('0xb')](_0x3684('0x15'),_0x127f96);logger['debug'](_0x3684('0x15'),_0x127f96,JSON[_0x3684('0x1c')](_0x3e8f4e));_0x384f81(_0x3e8f4e);})[_0x3684('0x14')](function(_0x17cd5e){logger[_0x3684('0x10')](_0x3684('0x15'),_0x17cd5e['message'],_0x127f96);_0x12be2a(_0x2deee0['error'](0x1f4,_0x17cd5e[_0x3684('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 5c2cc49..20cc00d 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(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5e9a69,_0x40c0ec){_0x5e9a69=_0x5e9a69-0x0;var _0x5979c8=_0xcb91[_0x5e9a69];return _0x5979c8;};'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 _0xf109=['/transfer','transfer','express','Router','../../components/auth/service','isAuthenticated','isWebrtcLicence','originate','post','/hangup','hangup','/answer','answer','/hold','/unhold','/calls','calls'];(function(_0x2effdf,_0xc01bfc){var _0xd4143a=function(_0x57a7b5){while(--_0x57a7b5){_0x2effdf['push'](_0x2effdf['shift']());}};_0xd4143a(++_0xc01bfc);}(_0xf109,0xce));var _0x9f10=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0xf109[_0x1a9204];return _0x17ca68;};'use strict';var express=require(_0x9f10('0x0'));var router=express[_0x9f10('0x1')]();var auth=require(_0x9f10('0x2'));var controller=require('./webbar.controller');router['post']('/originate',auth[_0x9f10('0x3')](),auth[_0x9f10('0x4')](),controller[_0x9f10('0x5')]);router[_0x9f10('0x6')](_0x9f10('0x7'),auth[_0x9f10('0x3')](),auth[_0x9f10('0x4')](),controller[_0x9f10('0x8')]);router[_0x9f10('0x6')](_0x9f10('0x9'),auth[_0x9f10('0x3')](),auth['isWebrtcLicence'](),controller[_0x9f10('0xa')]);router[_0x9f10('0x6')](_0x9f10('0xb'),auth[_0x9f10('0x3')](),auth[_0x9f10('0x4')](),controller['hold']);router[_0x9f10('0x6')](_0x9f10('0xc'),auth[_0x9f10('0x3')](),auth['isWebrtcLicence'](),controller['unhold']);router[_0x9f10('0x6')](_0x9f10('0xd'),auth[_0x9f10('0x3')](),auth['isWebrtcLicence'](),controller[_0x9f10('0xe')]);router[_0x9f10('0x6')](_0x9f10('0xf'),auth['isAuthenticated'](),auth[_0x9f10('0x4')](),controller[_0x9f10('0x10')]);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 7ba1e4c..d18922a 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 _0x49e9=['transferNumber\x20is\x20required','info','emit','log','handleError:','stack','name','status','send','NotFound','then','code','error','message','result','catch','User','agent','VoiceChannels','all','filter','rows','\x20not\x20found!','originate','originate\x20fired:','body','length','userId','callerId','callbackUrl','webbar:originate','json','originate\x20executed!','hangup','hangup\x20fired:','user:%s','answer','sessionId','entityFound:','webbar:answer','hold','hold\x20fired:','format','webbar:hold','hold\x20executed!','calls','UserId','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../config/environment','util','bluebird','http','webbarapi','ioredis','redis','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required'];(function(_0x2335ca,_0xd3c44){var _0x5d7d94=function(_0x5a0ccc){while(--_0x5a0ccc){_0x2335ca['push'](_0x2335ca['shift']());}};_0x5d7d94(++_0xd3c44);}(_0x49e9,0x10f));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};'use strict';var path=require(_0x949e('0x0'));var fs=require('fs');var _=require(_0x949e('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0x949e('0x2'));var util=require(_0x949e('0x3'));var BPromise=require(_0x949e('0x4'));var jayson=require('jayson/promise');var amiClient=jayson['client'][_0x949e('0x5')]({'port':0x232a});var logger=require('../../config/logger')(_0x949e('0x6'));var Redis=require(_0x949e('0x7'));config[_0x949e('0x8')]=_['defaults'](config[_0x949e('0x8')],{'host':_0x949e('0x9'),'port':0x18eb});var io=require(_0x949e('0xa'))(new Redis(config[_0x949e('0x8')]));var Schema=require(_0x949e('0xb'));var originateValidation=new Schema({'userId':{'type':_0x949e('0xc'),'required':[!![],_0x949e('0xd')]},'callNumber':{'type':'string','required':[!![],_0x949e('0xe')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x949e('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0x949e('0xc'),'required':[!![],_0x949e('0xd')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x949e('0xc'),'required':[!![],_0x949e('0xd')]},'sessionId':{'type':_0x949e('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x949e('0xc'),'required':[!![],_0x949e('0xd')]},'sessionId':{'type':_0x949e('0xf'),'required':[!![],_0x949e('0x10')]},'transferNumber':{'type':_0x949e('0xf'),'required':[!![],_0x949e('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0x949e('0xc'),'required':[!![],_0x949e('0xd')]},'sessionId':{'type':_0x949e('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x949e('0xc'),'required':[!![],_0x949e('0xd')]},'sessionId':{'type':_0x949e('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x949e('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':_0x949e('0xc'),'required':[!![],_0x949e('0xd')]}});function emit(_0xf1f41a,_0x5f5962,_0x420733){logger[_0x949e('0x12')](_0xf1f41a,_0x5f5962,JSON['stringify'](_0x420733));io['to'](_0xf1f41a)[_0x949e('0x13')](_0x5f5962,_0x420733);}function handleError(_0x175d62){return function(_0x43498d){console[_0x949e('0x14')](_0x949e('0x15'),_0x43498d,_0x43498d instanceof RangeError);logger['error'](_0x43498d[_0x949e('0x16')]);if(_0x43498d instanceof RangeError){if(_0x43498d[_0x949e('0x17')]){delete _0x43498d[_0x949e('0x17')];}_0x175d62[_0x949e('0x18')](0x194)[_0x949e('0x19')](_0x43498d);}else{if(_0x43498d[_0x949e('0x17')]){delete _0x43498d[_0x949e('0x17')];}_0x175d62[_0x949e('0x18')](0x1f4)[_0x949e('0x19')](_0x43498d);}};}function checkError(){return function(_0x39ad61){if(!_0x39ad61){throw new RangeError(_0x949e('0x1a'));}return _0x39ad61;};}function respondWithRpcPromise(_0x260c1c,_0x1e3a79){return new BPromise(function(_0x1927ab,_0x199d53){var _0x2e81f2=amiClient;return _0x2e81f2['request'](_0x260c1c,_0x1e3a79)[_0x949e('0x1b')](function(_0x44ffb4){if(_0x44ffb4['error']){if(_0x44ffb4['error'][_0x949e('0x1c')]===0x1f4){return _0x199d53(_0x44ffb4[_0x949e('0x1d')][_0x949e('0x1e')]);}return _0x1927ab(_0x44ffb4[_0x949e('0x1d')][_0x949e('0x1e')]);}else{_0x1927ab(_0x44ffb4[_0x949e('0x1f')]);}})[_0x949e('0x20')](function(_0x255b11){_0x199d53(_0x255b11);});});}function getAgent(_0x3468ac){return db[_0x949e('0x21')]['findOne']({'where':{'id':_0x3468ac,'role':_0x949e('0x22')}})[_0x949e('0x1b')](checkError());}function getAgentCheckSession(_0x59b3a1,_0x39308f){return new BPromise(function(_0x20061d,_0x55d56a){var _0x446401=respondWithRpcPromise(_0x949e('0x23'));var _0x5b9f28=getAgent(_0x59b3a1);Promise[_0x949e('0x24')]([_0x446401,_0x5b9f28])['then'](function(_0x5e6e34){var _0x4e169d=_0x5e6e34[0x0];var _0x54ad5d=_0x5e6e34[0x1];var _0x52f5bd=_[_0x949e('0x25')](_0x4e169d[_0x949e('0x26')],function(_0x3051ec){return _0x3051ec['UserId']==_0x54ad5d['id']&&_0x3051ec['sessionId']==_0x39308f;});if(_0x52f5bd['length']==0x1){_0x20061d(_0x54ad5d);}else{_0x55d56a(new RangeError('sessionId\x20'+_0x39308f+_0x949e('0x27')));}});});}exports[_0x949e('0x28')]=function(_0xcfd5a6,_0x1fe31b){logger['info'](_0x949e('0x29'),_0xcfd5a6[_0x949e('0x2a')]);var _0xad8500=originateValidation['validate'](_0xcfd5a6[_0x949e('0x2a')]);if(_0xad8500[_0x949e('0x2b')]>0x0){return _0x1fe31b[_0x949e('0x18')](0x190)['json'](_0xad8500);}var _0x5b7d77=_0xcfd5a6[_0x949e('0x2a')][_0x949e('0x2c')];var _0x25d65a=_0xcfd5a6[_0x949e('0x2a')]['callNumber'];var _0x15a63f=_0xcfd5a6[_0x949e('0x2a')][_0x949e('0x2d')];var _0x41b8d7=_0xcfd5a6[_0x949e('0x2a')][_0x949e('0x2e')];return getAgent(_0x5b7d77)[_0x949e('0x1b')](function(_0xe6c996){logger['info']('entityFound:',_0xe6c996[_0x949e('0x17')]);emit(util['format']('user:%s',_0xe6c996[_0x949e('0x17')]),_0x949e('0x2f'),{'callNumber':_0x25d65a,'callerId':_0x15a63f,'callbackUrl':_0x41b8d7});return _0x1fe31b[_0x949e('0x18')](0xc8)[_0x949e('0x30')]({'error':![],'message':_0x949e('0x31')});})[_0x949e('0x20')](handleError(_0x1fe31b));};exports[_0x949e('0x32')]=function(_0x49bf64,_0x21bd17){logger[_0x949e('0x12')](_0x949e('0x33'),_0x49bf64[_0x949e('0x2a')]);var _0x39c90b=hangupValidation[_0x949e('0xb')](_0x49bf64[_0x949e('0x2a')]);if(_0x39c90b[_0x949e('0x2b')]>0x0){return _0x21bd17[_0x949e('0x18')](0x190)['json'](_0x39c90b);}var _0x34bcd5=_0x49bf64['body'][_0x949e('0x2c')];var _0x2b112a=_0x49bf64['body']['sessionId'];return getAgent(_0x34bcd5)['then'](function(_0x1e848c){logger[_0x949e('0x12')]('entityFound:',_0x1e848c['name']);emit(util['format'](_0x949e('0x34'),_0x1e848c[_0x949e('0x17')]),'webbar:hangup',{'sessionId':_0x2b112a});return _0x21bd17[_0x949e('0x18')](0xc8)[_0x949e('0x30')]({'error':![],'message':'hangup\x20executed!'});})[_0x949e('0x20')](handleError(_0x21bd17));};exports[_0x949e('0x35')]=function(_0x3db452,_0xb384ed){logger['info']('answer\x20fired:',_0x3db452[_0x949e('0x2a')]);var _0x590aa7=answerValidation[_0x949e('0xb')](_0x3db452[_0x949e('0x2a')]);if(_0x590aa7[_0x949e('0x2b')]>0x0){return _0xb384ed[_0x949e('0x18')](0x190)[_0x949e('0x30')](_0x590aa7);}var _0x572f20=_0x3db452['body'][_0x949e('0x2c')];var _0x5e970b=_0x3db452[_0x949e('0x2a')][_0x949e('0x36')];return getAgent(_0x572f20)[_0x949e('0x1b')](function(_0x2fdfe6){logger[_0x949e('0x12')](_0x949e('0x37'),_0x2fdfe6['name']);emit(util['format'](_0x949e('0x34'),_0x2fdfe6[_0x949e('0x17')]),_0x949e('0x38'),{'sessionId':_0x5e970b});return _0xb384ed[_0x949e('0x18')](0xc8)[_0x949e('0x30')]({'error':![],'message':'answer\x20executed!'});})[_0x949e('0x20')](handleError(_0xb384ed));};exports[_0x949e('0x39')]=function(_0x5b3086,_0x216789){logger[_0x949e('0x12')](_0x949e('0x3a'),_0x5b3086[_0x949e('0x2a')]);var _0x1f1e69=holdValidation[_0x949e('0xb')](_0x5b3086[_0x949e('0x2a')]);if(_0x1f1e69[_0x949e('0x2b')]>0x0){return _0x216789[_0x949e('0x18')](0x190)['json'](_0x1f1e69);}var _0x1599ea=_0x5b3086['body'][_0x949e('0x2c')];var _0x24c7a6=_0x5b3086['body'][_0x949e('0x36')];return getAgent(_0x1599ea)[_0x949e('0x1b')](function(_0x121355){logger[_0x949e('0x12')](_0x949e('0x37'),_0x121355[_0x949e('0x17')]);emit(util[_0x949e('0x3b')](_0x949e('0x34'),_0x121355['name']),_0x949e('0x3c'),{'sessionId':_0x24c7a6});return _0x216789[_0x949e('0x18')](0xc8)[_0x949e('0x30')]({'error':![],'message':_0x949e('0x3d')});})[_0x949e('0x20')](handleError(_0x216789));};exports['unhold']=function(_0x5f23b2,_0x46a4fe){logger[_0x949e('0x12')]('unhold\x20fired:',_0x5f23b2[_0x949e('0x2a')]);var _0xdeefe1=unholdValidation[_0x949e('0xb')](_0x5f23b2[_0x949e('0x2a')]);if(_0xdeefe1['length']>0x0){return _0x46a4fe['status'](0x190)[_0x949e('0x30')](_0xdeefe1);}var _0x46d687=_0x5f23b2[_0x949e('0x2a')][_0x949e('0x2c')];var _0x16ec1b=_0x5f23b2[_0x949e('0x2a')][_0x949e('0x36')];return getAgent(_0x46d687)[_0x949e('0x1b')](function(_0x21477f){logger['info'](_0x949e('0x37'),_0x21477f['name']);emit(util[_0x949e('0x3b')]('user:%s',_0x21477f[_0x949e('0x17')]),'webbar:unhold',{'sessionId':_0x16ec1b});return _0x46a4fe[_0x949e('0x18')](0xc8)[_0x949e('0x30')]({'error':![],'message':'unhold\x20executed!'});})[_0x949e('0x20')](handleError(_0x46a4fe));};exports[_0x949e('0x3e')]=function(_0x2eb9f9,_0x2a5e99){logger[_0x949e('0x12')]('calls\x20fired:',_0x2a5e99['body']);var _0x287a45=callsValidation[_0x949e('0xb')](_0x2eb9f9['body']);if(_0x287a45[_0x949e('0x2b')]>0x0){return _0x2a5e99[_0x949e('0x18')](0x190)['json'](_0x287a45);}var _0x195371=_0x2eb9f9[_0x949e('0x2a')][_0x949e('0x2c')];var _0x2d7397=respondWithRpcPromise(_0x949e('0x23'));var _0x41798a=getAgent(_0x195371);return Promise[_0x949e('0x24')]([_0x2d7397,_0x41798a])[_0x949e('0x1b')](function(_0x394b92){var _0x7dd940=_0x394b92[0x0];var _0x8cc24a=_0x394b92[0x1];var _0x1561b2=_[_0x949e('0x25')](_0x7dd940[_0x949e('0x26')],function(_0x1284ec){return _0x1284ec[_0x949e('0x3f')]==_0x8cc24a['id'];});return _0x2a5e99[_0x949e('0x18')](0xc8)[_0x949e('0x30')]({'count':_0x1561b2['length'],'rows':_0x1561b2});})[_0x949e('0x20')](handleError(_0x2a5e99));};exports['conference']=function(_0x5520cd,_0x1bc2bb){logger[_0x949e('0x12')](_0x949e('0x40'),_0x5520cd['body']);var _0xa07383=conferenceValidation[_0x949e('0xb')](_0x5520cd[_0x949e('0x2a')]);if(_0xa07383['length']>0x0){return _0x1bc2bb[_0x949e('0x18')](0x190)[_0x949e('0x30')](_0xa07383);}var _0x23a1c5=_0x5520cd['body'][_0x949e('0x2c')];return getAgent(_0x23a1c5)[_0x949e('0x1b')](function(_0x4073e9){logger[_0x949e('0x12')](_0x949e('0x37'),_0x4073e9[_0x949e('0x17')]);emit(util['format'](_0x949e('0x34'),_0x4073e9[_0x949e('0x17')]),_0x949e('0x41'));return _0x1bc2bb['status'](0xc8)['json']({'error':![],'message':_0x949e('0x42')});})['catch'](handleError(_0x1bc2bb));};exports[_0x949e('0x43')]=function(_0xcc3e22,_0x226576){logger[_0x949e('0x12')](_0x949e('0x44'),_0xcc3e22[_0x949e('0x2a')]);var _0x5ebbe3=transferValidation[_0x949e('0xb')](_0xcc3e22[_0x949e('0x2a')]);if(_0x5ebbe3[_0x949e('0x2b')]>0x0){return _0x226576[_0x949e('0x18')](0x190)[_0x949e('0x30')](_0x5ebbe3);}var _0x470e2a=_0xcc3e22['body'][_0x949e('0x2c')];var _0x1a1ebd=_0xcc3e22['body']['sessionId'];var _0x6ecca9=_0xcc3e22['body'][_0x949e('0x45')];return getAgent(_0x470e2a)['then'](function(_0x5c4c4c){logger[_0x949e('0x12')](_0x949e('0x37'),_0x5c4c4c[_0x949e('0x17')]);emit(util[_0x949e('0x3b')](_0x949e('0x34'),_0x5c4c4c[_0x949e('0x17')]),_0x949e('0x46'),{'sessionId':_0x1a1ebd,'transferNumber':_0x6ecca9});return _0x226576[_0x949e('0x18')](0xc8)[_0x949e('0x30')]({'error':![],'message':_0x949e('0x47')});})[_0x949e('0x20')](handleError(_0x226576));}; \ No newline at end of file +var _0x6737=['answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','UserId','conference\x20fired:','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','lodash','../../mysqldb','util','bluebird','jayson/promise','client','../../config/logger','webbarapi','redis','defaults','validate','userId\x20is\x20required','string','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','handleError:','error','stack','status','send','name','NotFound','request','then','code','message','catch','User','VoiceChannels','filter','rows','sessionId','length','sessionId\x20','\x20not\x20found!','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','webbar:hangup','answer\x20fired:','webbar:answer'];(function(_0x33f84f,_0x33dab2){var _0x5ed7ca=function(_0x57cbfb){while(--_0x57cbfb){_0x33f84f['push'](_0x33f84f['shift']());}};_0x5ed7ca(++_0x33dab2);}(_0x6737,0xe2));var _0x7673=function(_0x4d72f1,_0x4de1e6){_0x4d72f1=_0x4d72f1-0x0;var _0x38d936=_0x6737[_0x4d72f1];return _0x38d936;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x7673('0x0'));var db=require(_0x7673('0x1'))['db'];var config=require('../../config/environment');var util=require(_0x7673('0x2'));var BPromise=require(_0x7673('0x3'));var jayson=require(_0x7673('0x4'));var amiClient=jayson[_0x7673('0x5')]['http']({'port':0x232a});var logger=require(_0x7673('0x6'))(_0x7673('0x7'));var Redis=require('ioredis');config[_0x7673('0x8')]=_[_0x7673('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require(_0x7673('0xa'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x7673('0xb')]},'callNumber':{'type':_0x7673('0xc'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x7673('0xc')},'callbackUrl':{'type':_0x7673('0xc')}});var hangupValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x7673('0xc'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],_0x7673('0xb')]},'sessionId':{'type':_0x7673('0xc'),'required':[!![],_0x7673('0xe')]},'transferNumber':{'type':_0x7673('0xc'),'required':[!![],_0x7673('0xf')]}});var holdValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],_0x7673('0xb')]},'sessionId':{'type':_0x7673('0xc'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x7673('0xb')]},'sessionId':{'type':_0x7673('0xc'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],_0x7673('0xb')]}});var conferenceValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],_0x7673('0xb')]}});function emit(_0x2a2840,_0x4a8ea0,_0x5ed354){logger[_0x7673('0x10')](_0x2a2840,_0x4a8ea0,JSON[_0x7673('0x11')](_0x5ed354));io['to'](_0x2a2840)['emit'](_0x4a8ea0,_0x5ed354);}function handleError(_0x3afbb3){return function(_0x17699a){console['log'](_0x7673('0x12'),_0x17699a,_0x17699a instanceof RangeError);logger[_0x7673('0x13')](_0x17699a[_0x7673('0x14')]);if(_0x17699a instanceof RangeError){if(_0x17699a['name']){delete _0x17699a['name'];}_0x3afbb3[_0x7673('0x15')](0x194)[_0x7673('0x16')](_0x17699a);}else{if(_0x17699a['name']){delete _0x17699a[_0x7673('0x17')];}_0x3afbb3[_0x7673('0x15')](0x1f4)[_0x7673('0x16')](_0x17699a);}};}function checkError(){return function(_0x33eb47){if(!_0x33eb47){throw new RangeError(_0x7673('0x18'));}return _0x33eb47;};}function respondWithRpcPromise(_0x3e28ca,_0x59879a){return new BPromise(function(_0x557161,_0xea9b37){var _0x21774f=amiClient;return _0x21774f[_0x7673('0x19')](_0x3e28ca,_0x59879a)[_0x7673('0x1a')](function(_0x16bb16){if(_0x16bb16['error']){if(_0x16bb16[_0x7673('0x13')][_0x7673('0x1b')]===0x1f4){return _0xea9b37(_0x16bb16[_0x7673('0x13')][_0x7673('0x1c')]);}return _0x557161(_0x16bb16[_0x7673('0x13')][_0x7673('0x1c')]);}else{_0x557161(_0x16bb16['result']);}})[_0x7673('0x1d')](function(_0xaca974){_0xea9b37(_0xaca974);});});}function getAgent(_0x425897){return db[_0x7673('0x1e')]['findOne']({'where':{'id':_0x425897,'role':'agent'}})[_0x7673('0x1a')](checkError());}function getAgentCheckSession(_0x11b42b,_0x291d10){return new BPromise(function(_0x9d9eab,_0x119a21){var _0x45a045=respondWithRpcPromise(_0x7673('0x1f'));var _0x5a59f9=getAgent(_0x11b42b);Promise['all']([_0x45a045,_0x5a59f9])[_0x7673('0x1a')](function(_0x2d4c0a){var _0x1dd436=_0x2d4c0a[0x0];var _0x335743=_0x2d4c0a[0x1];var _0x12ac6b=_[_0x7673('0x20')](_0x1dd436[_0x7673('0x21')],function(_0x4f12b9){return _0x4f12b9['UserId']==_0x335743['id']&&_0x4f12b9[_0x7673('0x22')]==_0x291d10;});if(_0x12ac6b[_0x7673('0x23')]==0x1){_0x9d9eab(_0x335743);}else{_0x119a21(new RangeError(_0x7673('0x24')+_0x291d10+_0x7673('0x25')));}});});}exports['originate']=function(_0x3aa249,_0x497760){logger[_0x7673('0x10')](_0x7673('0x26'),_0x3aa249[_0x7673('0x27')]);var _0x1b924f=originateValidation[_0x7673('0xa')](_0x3aa249[_0x7673('0x27')]);if(_0x1b924f[_0x7673('0x23')]>0x0){return _0x497760[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0x1b924f);}var _0x1b6061=_0x3aa249[_0x7673('0x27')][_0x7673('0x29')];var _0x26cccd=_0x3aa249['body'][_0x7673('0x2a')];var _0x42f658=_0x3aa249[_0x7673('0x27')][_0x7673('0x2b')];var _0x30ddec=_0x3aa249[_0x7673('0x27')][_0x7673('0x2c')];return getAgent(_0x1b6061)['then'](function(_0x563e2d){logger[_0x7673('0x10')](_0x7673('0x2d'),_0x563e2d[_0x7673('0x17')]);emit(util[_0x7673('0x2e')](_0x7673('0x2f'),_0x563e2d[_0x7673('0x17')]),_0x7673('0x30'),{'callNumber':_0x26cccd,'callerId':_0x42f658,'callbackUrl':_0x30ddec});return _0x497760['status'](0xc8)[_0x7673('0x28')]({'error':![],'message':_0x7673('0x31')});})['catch'](handleError(_0x497760));};exports[_0x7673('0x32')]=function(_0x400f3c,_0x287eee){logger[_0x7673('0x10')]('hangup\x20fired:',_0x400f3c[_0x7673('0x27')]);var _0x1f77c0=hangupValidation['validate'](_0x400f3c[_0x7673('0x27')]);if(_0x1f77c0[_0x7673('0x23')]>0x0){return _0x287eee[_0x7673('0x15')](0x190)['json'](_0x1f77c0);}var _0xe50aa5=_0x400f3c[_0x7673('0x27')][_0x7673('0x29')];var _0x5dfb9a=_0x400f3c['body'][_0x7673('0x22')];return getAgent(_0xe50aa5)['then'](function(_0x4ba2b4){logger[_0x7673('0x10')](_0x7673('0x2d'),_0x4ba2b4['name']);emit(util[_0x7673('0x2e')](_0x7673('0x2f'),_0x4ba2b4[_0x7673('0x17')]),_0x7673('0x33'),{'sessionId':_0x5dfb9a});return _0x287eee[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'error':![],'message':'hangup\x20executed!'});})[_0x7673('0x1d')](handleError(_0x287eee));};exports['answer']=function(_0xf43bb7,_0x52f803){logger[_0x7673('0x10')](_0x7673('0x34'),_0xf43bb7['body']);var _0x5b2e69=answerValidation[_0x7673('0xa')](_0xf43bb7['body']);if(_0x5b2e69[_0x7673('0x23')]>0x0){return _0x52f803[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0x5b2e69);}var _0x3b6223=_0xf43bb7[_0x7673('0x27')]['userId'];var _0x4ea8b3=_0xf43bb7[_0x7673('0x27')][_0x7673('0x22')];return getAgent(_0x3b6223)['then'](function(_0x4005ee){logger[_0x7673('0x10')](_0x7673('0x2d'),_0x4005ee['name']);emit(util[_0x7673('0x2e')](_0x7673('0x2f'),_0x4005ee[_0x7673('0x17')]),_0x7673('0x35'),{'sessionId':_0x4ea8b3});return _0x52f803[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'error':![],'message':_0x7673('0x36')});})[_0x7673('0x1d')](handleError(_0x52f803));};exports[_0x7673('0x37')]=function(_0x4ed31d,_0x126981){logger[_0x7673('0x10')](_0x7673('0x38'),_0x4ed31d[_0x7673('0x27')]);var _0x332b5a=holdValidation[_0x7673('0xa')](_0x4ed31d[_0x7673('0x27')]);if(_0x332b5a['length']>0x0){return _0x126981[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0x332b5a);}var _0x461ac3=_0x4ed31d[_0x7673('0x27')][_0x7673('0x29')];var _0x4b844d=_0x4ed31d[_0x7673('0x27')][_0x7673('0x22')];return getAgent(_0x461ac3)[_0x7673('0x1a')](function(_0x2397fb){logger[_0x7673('0x10')]('entityFound:',_0x2397fb['name']);emit(util[_0x7673('0x2e')](_0x7673('0x2f'),_0x2397fb['name']),_0x7673('0x39'),{'sessionId':_0x4b844d});return _0x126981[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'error':![],'message':_0x7673('0x3a')});})[_0x7673('0x1d')](handleError(_0x126981));};exports['unhold']=function(_0x23789d,_0x3afffa){logger[_0x7673('0x10')](_0x7673('0x3b'),_0x23789d['body']);var _0x1691a5=unholdValidation[_0x7673('0xa')](_0x23789d[_0x7673('0x27')]);if(_0x1691a5[_0x7673('0x23')]>0x0){return _0x3afffa[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0x1691a5);}var _0x115eef=_0x23789d[_0x7673('0x27')][_0x7673('0x29')];var _0x362409=_0x23789d[_0x7673('0x27')]['sessionId'];return getAgent(_0x115eef)[_0x7673('0x1a')](function(_0x4a0d99){logger[_0x7673('0x10')](_0x7673('0x2d'),_0x4a0d99[_0x7673('0x17')]);emit(util['format'](_0x7673('0x2f'),_0x4a0d99[_0x7673('0x17')]),_0x7673('0x3c'),{'sessionId':_0x362409});return _0x3afffa[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'error':![],'message':_0x7673('0x3d')});})[_0x7673('0x1d')](handleError(_0x3afffa));};exports[_0x7673('0x3e')]=function(_0x375bca,_0x1064d5){logger[_0x7673('0x10')](_0x7673('0x3f'),_0x1064d5[_0x7673('0x27')]);var _0xb3c9e9=callsValidation['validate'](_0x375bca[_0x7673('0x27')]);if(_0xb3c9e9['length']>0x0){return _0x1064d5[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0xb3c9e9);}var _0x1d424a=_0x375bca['body'][_0x7673('0x29')];var _0x5d71b7=respondWithRpcPromise('VoiceChannels');var _0x1804a4=getAgent(_0x1d424a);return Promise['all']([_0x5d71b7,_0x1804a4])['then'](function(_0x1dd141){var _0x3f6ef3=_0x1dd141[0x0];var _0x215a32=_0x1dd141[0x1];var _0xeaa731=_[_0x7673('0x20')](_0x3f6ef3[_0x7673('0x21')],function(_0x151276){return _0x151276[_0x7673('0x40')]==_0x215a32['id'];});return _0x1064d5[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'count':_0xeaa731[_0x7673('0x23')],'rows':_0xeaa731});})['catch'](handleError(_0x1064d5));};exports['conference']=function(_0x2aa032,_0x297744){logger[_0x7673('0x10')](_0x7673('0x41'),_0x2aa032[_0x7673('0x27')]);var _0x48e51c=conferenceValidation['validate'](_0x2aa032[_0x7673('0x27')]);if(_0x48e51c[_0x7673('0x23')]>0x0){return _0x297744[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0x48e51c);}var _0x51c617=_0x2aa032['body'][_0x7673('0x29')];return getAgent(_0x51c617)[_0x7673('0x1a')](function(_0x1cf039){logger['info'](_0x7673('0x2d'),_0x1cf039['name']);emit(util[_0x7673('0x2e')](_0x7673('0x2f'),_0x1cf039[_0x7673('0x17')]),'webbar:conference');return _0x297744[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x297744));};exports['transfer']=function(_0x32dcfc,_0x2dd367){logger[_0x7673('0x10')](_0x7673('0x42'),_0x32dcfc['body']);var _0xed9040=transferValidation['validate'](_0x32dcfc[_0x7673('0x27')]);if(_0xed9040[_0x7673('0x23')]>0x0){return _0x2dd367[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0xed9040);}var _0x5abb12=_0x32dcfc[_0x7673('0x27')][_0x7673('0x29')];var _0x308a9e=_0x32dcfc['body']['sessionId'];var _0x2d21f2=_0x32dcfc[_0x7673('0x27')][_0x7673('0x43')];return getAgent(_0x5abb12)[_0x7673('0x1a')](function(_0x20e9bd){logger['info'](_0x7673('0x2d'),_0x20e9bd[_0x7673('0x17')]);emit(util['format']('user:%s',_0x20e9bd['name']),_0x7673('0x44'),{'sessionId':_0x308a9e,'transferNumber':_0x2d21f2});return _0x2dd367[_0x7673('0x15')](0xc8)['json']({'error':![],'message':_0x7673('0x45')});})['catch'](handleError(_0x2dd367));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index d040cd6..d206f73 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 _0xe2fe=['removeAgents','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions','getAgents','/:id/applications','getApplications','post','addDisposition','/:id/canned_answers','addAnswer','/:id/users','addAgents','addApplications','/:id/notify','notify','send','put','destroy','delete','removeDispositions','removeAnswers'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xee2f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xee2f('0x1'));var express=require('express');var router=express[_0xee2f('0x2')]();var fs_extra=require(_0xee2f('0x3'));var auth=require(_0xee2f('0x4'));var interaction=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var controller=require('./whatsappAccount.controller');router[_0xee2f('0x7')]('/',auth[_0xee2f('0x8')](),controller['index']);router[_0xee2f('0x7')](_0xee2f('0x9'),auth['isAuthenticated'](),controller[_0xee2f('0xa')]);router['get'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['show']);router[_0xee2f('0x7')](_0xee2f('0xc'),auth['isAuthenticated'](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0xee2f('0x8')](),controller['getAnswers']);router['get']('/:id/users',auth[_0xee2f('0x8')](),controller[_0xee2f('0xd')]);router[_0xee2f('0x7')](_0xee2f('0xe'),auth[_0xee2f('0x8')](),controller[_0xee2f('0xf')]);router['post']('/',auth[_0xee2f('0x8')](),controller['create']);router[_0xee2f('0x10')](_0xee2f('0xc'),auth['isAuthenticated'](),controller[_0xee2f('0x11')]);router[_0xee2f('0x10')](_0xee2f('0x12'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x13')]);router['post'](_0xee2f('0x14'),auth['isAuthenticated'](),controller[_0xee2f('0x15')]);router[_0xee2f('0x10')]('/:id/applications',auth['isAuthenticated'](),controller[_0xee2f('0x16')]);router['post'](_0xee2f('0x17'),controller[_0xee2f('0x18')]);router[_0xee2f('0x10')]('/:id/send',auth[_0xee2f('0x8')](),controller[_0xee2f('0x19')]);router[_0xee2f('0x1a')](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['update']);router['delete'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1b')]);router[_0xee2f('0x1c')](_0xee2f('0xc'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1d')]);router['delete'](_0xee2f('0x12'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1e')]);router[_0xee2f('0x1c')](_0xee2f('0x14'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1f')]);module[_0xee2f('0x20')]=router; \ No newline at end of file +var _0xe3da=['/:id/send','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','/:id/canned_answers','addAnswer','addAgents','/:id/notify','notify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe3da,0x1cd));var _0xae3d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe3da[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var path=require(_0xae3d('0x2'));var timeout=require(_0xae3d('0x3'));var express=require(_0xae3d('0x4'));var router=express[_0xae3d('0x5')]();var fs_extra=require(_0xae3d('0x6'));var auth=require(_0xae3d('0x7'));var interaction=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var controller=require(_0xae3d('0xa'));router[_0xae3d('0xb')]('/',auth[_0xae3d('0xc')](),controller[_0xae3d('0xd')]);router[_0xae3d('0xb')](_0xae3d('0xe'),auth['isAuthenticated'](),controller[_0xae3d('0xf')]);router[_0xae3d('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xae3d('0x10')]);router[_0xae3d('0xb')](_0xae3d('0x11'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x12')]);router[_0xae3d('0xb')]('/:id/canned_answers',auth[_0xae3d('0xc')](),controller['getAnswers']);router[_0xae3d('0xb')](_0xae3d('0x13'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x14')]);router['get'](_0xae3d('0x15'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x16')]);router[_0xae3d('0x17')]('/',auth[_0xae3d('0xc')](),controller[_0xae3d('0x18')]);router[_0xae3d('0x17')]('/:id/dispositions',auth[_0xae3d('0xc')](),controller[_0xae3d('0x19')]);router[_0xae3d('0x17')](_0xae3d('0x1a'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x1b')]);router['post'](_0xae3d('0x13'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x1c')]);router['post'](_0xae3d('0x15'),auth[_0xae3d('0xc')](),controller['addApplications']);router['post'](_0xae3d('0x1d'),controller[_0xae3d('0x1e')]);router[_0xae3d('0x17')](_0xae3d('0x1f'),auth[_0xae3d('0xc')](),controller['send']);router[_0xae3d('0x20')]('/:id',auth[_0xae3d('0xc')](),controller[_0xae3d('0x21')]);router[_0xae3d('0x22')](_0xae3d('0x23'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x24')]);router[_0xae3d('0x22')](_0xae3d('0x11'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x25')]);router[_0xae3d('0x22')](_0xae3d('0x1a'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x26')]);router[_0xae3d('0x22')](_0xae3d('0x13'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x27')]);module[_0xae3d('0x28')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 6ee769b..0c5101c 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 _0xe5a2=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','name','generate','ENUM','twilio','sinch','TEXT'];(function(_0x4b8b67,_0x13a829){var _0x259efc=function(_0x421140){while(--_0x421140){_0x4b8b67['push'](_0x4b8b67['shift']());}};_0x259efc(++_0x13a829);}(_0xe5a2,0x197));var _0x2e5a=function(_0x1380fe,_0x29e61f){_0x1380fe=_0x1380fe-0x0;var _0xb10a48=_0xe5a2[_0x1380fe];return _0xb10a48;};'use strict';var Sequelize=require(_0x2e5a('0x0'));var rs=require(_0x2e5a('0x1'));module['exports']={'name':{'type':Sequelize[_0x2e5a('0x2')],'unique':_0x2e5a('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x2e5a('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x2e5a('0x4')]();}},'phone':{'type':Sequelize[_0x2e5a('0x2')]},'type':{'type':Sequelize[_0x2e5a('0x5')](_0x2e5a('0x6'),_0x2e5a('0x7'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x2e5a('0x2')]},'notificationTemplate':{'type':Sequelize[_0x2e5a('0x8')],'defaultValue':function(){return _0x2e5a('0x9');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x2e5a('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2e5a('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2e5a('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2e5a('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2e5a('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2e5a('0xb')],'comment':_0x2e5a('0xc')},'mandatoryDisposition':{'type':Sequelize[_0x2e5a('0xa')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x517551){if(!_0x517551){this[_0x2e5a('0xd')](_0x2e5a('0xe'),null);}this[_0x2e5a('0xd')](_0x2e5a('0xf'),_0x517551);}},'description':{'type':Sequelize[_0x2e5a('0x2')]}}; \ No newline at end of file +var _0x9c79=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x531d80,_0x530508){var _0x222b7d=function(_0x122cd0){while(--_0x122cd0){_0x531d80['push'](_0x531d80['shift']());}};_0x222b7d(++_0x530508);}(_0x9c79,0x1b8));var _0x99c7=function(_0x4ae506,_0x5a97ed){_0x4ae506=_0x4ae506-0x0;var _0x18e3a1=_0x9c79[_0x4ae506];return _0x18e3a1;};'use strict';var Sequelize=require(_0x99c7('0x0'));var rs=require(_0x99c7('0x1'));module['exports']={'name':{'type':Sequelize[_0x99c7('0x2')],'unique':_0x99c7('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x99c7('0x4')]();}},'phone':{'type':Sequelize[_0x99c7('0x2')]},'type':{'type':Sequelize['ENUM']('twilio','sinch')},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x99c7('0x2')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x99c7('0x5')],'defaultValue':function(){return _0x99c7('0x6');}},'notificationSound':{'type':Sequelize[_0x99c7('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x99c7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x99c7('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x99c7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x99c7('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x99c7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x99c7('0x8')],'comment':_0x99c7('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x99c7('0xa'),'set':function(_0x336625){if(!_0x336625){this[_0x99c7('0xb')](_0x99c7('0xc'),null);}this['setDataValue'](_0x99c7('0xd'),_0x336625);}},'description':{'type':Sequelize[_0x99c7('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 3c96ec8..f1e9f16 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 _0x21ab=['order','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','omit','spread','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','applications','CmContact','Sequelize','ValidationError','difference','createdAt','CompanyId','ListId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','notifications','message_id','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','ContactId','UserId','agent','startRouting','Start','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','updatedAt','out','dataValues','Messages','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','http','request','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappAccount,\x20%s,\x20%s','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','nolimit','sort','pick','filter','where','merge','options','includeAll','findAll','rows','params','intersection','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','hasOwnProperty'];(function(_0x2a68b3,_0x21b722){var _0x5181c1=function(_0x266dbe){while(--_0x266dbe){_0x2a68b3['push'](_0x2a68b3['shift']());}};_0x5181c1(++_0x21b722);}(_0x21ab,0x1e3));var _0xb21a=function(_0x368e09,_0x2c1517){_0x368e09=_0x368e09-0x0;var _0x14b7df=_0x21ab[_0x368e09];return _0x14b7df;};'use strict';var emlformat=require(_0xb21a('0x0'));var rimraf=require(_0xb21a('0x1'));var zipdir=require(_0xb21a('0x2'));var jsonpatch=require(_0xb21a('0x3'));var rp=require('request-promise');var moment=require(_0xb21a('0x4'));var BPromise=require(_0xb21a('0x5'));var Mustache=require(_0xb21a('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xb21a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb21a('0x8'));var _=require(_0xb21a('0x9'));var squel=require(_0xb21a('0xa'));var crypto=require(_0xb21a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb21a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb21a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb21a('0xe'));var authService=require(_0xb21a('0xf'));var qs=require(_0xb21a('0x10'));var as=require(_0xb21a('0x11'));var hardwareService=require(_0xb21a('0x12'));var logger=require(_0xb21a('0x13'))(_0xb21a('0x14'));var utils=require(_0xb21a('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb21a('0x16'))['db'];config[_0xb21a('0x17')]=_[_0xb21a('0x18')](config[_0xb21a('0x17')],{'host':_0xb21a('0x19'),'port':0x18eb});var socket=require(_0xb21a('0x1a'))(new Redis(config['redis']));require(_0xb21a('0x1b'))[_0xb21a('0x1c')](socket);var jayson=require(_0xb21a('0x1d'));var client=jayson['client'][_0xb21a('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x42e461,_0x280767,_0x58f146,_0x6b08bc){return new BPromise(function(_0x452624,_0x2f1d1e){var _0x557554=_0x6b08bc||client;return _0x557554[_0xb21a('0x1f')](_0x42e461,_0x58f146)[_0xb21a('0x20')](function(_0x498513){logger[_0xb21a('0x21')]('WhatsappAccount,\x20%s,\x20%s',_0x280767,_0xb21a('0x22'));logger[_0xb21a('0x23')](_0xb21a('0x24'),_0x280767,_0xb21a('0x22'),JSON[_0xb21a('0x25')](_0x498513));if(_0x498513[_0xb21a('0x26')]){if(_0x498513['error'][_0xb21a('0x27')]===0x1f4){logger[_0xb21a('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x280767,_0x498513['error'][_0xb21a('0x28')]);return _0x2f1d1e(_0x498513['error'][_0xb21a('0x28')]);}logger[_0xb21a('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x280767,_0x498513[_0xb21a('0x26')][_0xb21a('0x28')]);return _0x452624(_0x498513[_0xb21a('0x26')]['message']);}else{logger[_0xb21a('0x21')](_0xb21a('0x29'),_0x280767,_0xb21a('0x22'));_0x452624(_0x498513[_0xb21a('0x2a')]['message']);}})[_0xb21a('0x2b')](function(_0x2e7a03){logger[_0xb21a('0x26')](_0xb21a('0x29'),_0x280767,_0x2e7a03);_0x2f1d1e(_0x2e7a03);});});}function respondWithStatusCode(_0x1c105b,_0x119532){_0x119532=_0x119532||0xcc;return function(_0x375fb6){if(_0x375fb6){return _0x1c105b[_0xb21a('0x2c')](_0x119532);}return _0x1c105b['status'](_0x119532)[_0xb21a('0x2d')]();};}function respondWithResult(_0x45f2c2,_0xb48665){_0xb48665=_0xb48665||0xc8;return function(_0x42f019){if(_0x42f019){return _0x45f2c2[_0xb21a('0x2e')](_0xb48665)[_0xb21a('0x2f')](_0x42f019);}};}function respondWithFilteredResult(_0x173c5e,_0x251312){return function(_0x468d70){if(_0x468d70){var _0x1365ed=typeof _0x251312[_0xb21a('0x30')]==='undefined'&&typeof _0x251312[_0xb21a('0x31')]===_0xb21a('0x32');var _0x1923f1=_0x468d70[_0xb21a('0x33')];var _0x25c2e9=_0x1365ed?0x0:_0x251312[_0xb21a('0x30')];var _0x3aabdb=_0x1365ed?_0x468d70[_0xb21a('0x33')]:_0x251312[_0xb21a('0x30')]+_0x251312[_0xb21a('0x31')];var _0x2498dd;if(_0x3aabdb>=_0x1923f1){_0x3aabdb=_0x1923f1;_0x2498dd=0xc8;}else{_0x2498dd=0xce;}_0x173c5e[_0xb21a('0x2e')](_0x2498dd);return _0x173c5e[_0xb21a('0x34')](_0xb21a('0x35'),_0x25c2e9+'-'+_0x3aabdb+'/'+_0x1923f1)[_0xb21a('0x2f')](_0x468d70);}return null;};}function patchUpdates(_0x5a45dc){return function(_0x595317){try{jsonpatch['apply'](_0x595317,_0x5a45dc,!![]);}catch(_0x4f670a){return BPromise[_0xb21a('0x36')](_0x4f670a);}return _0x595317[_0xb21a('0x37')]();};}function saveUpdates(_0x339bcf,_0x1929c4){return function(_0x3bdc0f){if(_0x3bdc0f){return _0x3bdc0f[_0xb21a('0x38')](_0x339bcf)[_0xb21a('0x20')](function(_0x510203){return _0x510203;});}return null;};}function removeEntity(_0x32f443,_0x353ccc){return function(_0x1d7dff){if(_0x1d7dff){return _0x1d7dff[_0xb21a('0x39')]()[_0xb21a('0x20')](function(){var _0x384b0e=_0x1d7dff[_0xb21a('0x3a')]({'plain':!![]});var _0x47aef1=_0xb21a('0x3b');return db[_0xb21a('0x3c')]['destroy']({'where':{'type':_0x47aef1,'resourceId':_0x384b0e['id']}})[_0xb21a('0x20')](function(){return _0x1d7dff;});})[_0xb21a('0x20')](function(){_0x32f443[_0xb21a('0x2e')](0xcc)[_0xb21a('0x2d')]();});}};}function handleEntityNotFound(_0x4185af,_0x2daa1c){return function(_0x5bbff9){if(!_0x5bbff9){_0x4185af[_0xb21a('0x2c')](0x194);}return _0x5bbff9;};}function handleError(_0x1db683,_0x5d2eae){_0x5d2eae=_0x5d2eae||0x1f4;return function(_0x3dc053){logger[_0xb21a('0x26')](_0x3dc053['stack']);if(_0x3dc053[_0xb21a('0x3d')]){delete _0x3dc053[_0xb21a('0x3d')];}_0x1db683[_0xb21a('0x2e')](_0x5d2eae)[_0xb21a('0x3e')](_0x3dc053);};}exports[_0xb21a('0x3f')]=function(_0xa5184c,_0x5238d7){var _0x479d9c={'include':[{'model':db[_0xb21a('0x40')],'as':_0xb21a('0x41')}]},_0x209b1b={},_0x3d2bc2={'count':0x0,'rows':[]};var _0x196f80=_[_0xb21a('0x42')](db[_0xb21a('0x43')][_0xb21a('0x44')],function(_0x4f26da){return{'name':_0x4f26da[_0xb21a('0x45')],'type':_0x4f26da[_0xb21a('0x46')][_0xb21a('0x47')]};});_0x209b1b[_0xb21a('0x48')]=_['map'](_0x196f80,_0xb21a('0x3d'));_0x209b1b['query']=_[_0xb21a('0x49')](_0xa5184c[_0xb21a('0x4a')]);_0x209b1b[_0xb21a('0x4b')]=_['intersection'](_0x209b1b['model'],_0x209b1b[_0xb21a('0x4a')]);_0x479d9c[_0xb21a('0x4c')]=_['intersection'](_0x209b1b[_0xb21a('0x48')],qs[_0xb21a('0x4d')](_0xa5184c['query']['fields']));_0x479d9c[_0xb21a('0x4c')]=_0x479d9c['attributes']['length']?_0x479d9c[_0xb21a('0x4c')]:_0x209b1b[_0xb21a('0x48')];if(!_0xa5184c[_0xb21a('0x4a')]['hasOwnProperty'](_0xb21a('0x4e'))){_0x479d9c[_0xb21a('0x31')]=qs['limit'](_0xa5184c['query'][_0xb21a('0x31')]);_0x479d9c['offset']=qs[_0xb21a('0x30')](_0xa5184c[_0xb21a('0x4a')][_0xb21a('0x30')]);}_0x479d9c['order']=qs[_0xb21a('0x4f')](_0xa5184c[_0xb21a('0x4a')][_0xb21a('0x4f')]);_0x479d9c['where']=qs['filters'](_[_0xb21a('0x50')](_0xa5184c['query'],_0x209b1b[_0xb21a('0x4b')]),_0x196f80);if(_0xa5184c[_0xb21a('0x4a')][_0xb21a('0x51')]){_0x479d9c[_0xb21a('0x52')]=_[_0xb21a('0x53')](_0x479d9c['where'],{'$or':_[_0xb21a('0x42')](_0x196f80,function(_0x33a5ab){if(_0x33a5ab[_0xb21a('0x46')]!=='VIRTUAL'){var _0x351e1b={};_0x351e1b[_0x33a5ab[_0xb21a('0x3d')]]={'$like':'%'+_0xa5184c[_0xb21a('0x4a')][_0xb21a('0x51')]+'%'};return _0x351e1b;}})});}_0x479d9c=_[_0xb21a('0x53')]({},_0x479d9c,_0xa5184c[_0xb21a('0x54')]);var _0x1c27dc={'where':_0x479d9c['where']};return db['WhatsappAccount']['count'](_0x1c27dc)[_0xb21a('0x20')](function(_0x49fb6b){_0x3d2bc2[_0xb21a('0x33')]=_0x49fb6b;if(_0xa5184c['query'][_0xb21a('0x55')]){_0x479d9c['include']=[{'all':!![]}];}return db['WhatsappAccount'][_0xb21a('0x56')](_0x479d9c);})[_0xb21a('0x20')](function(_0x155199){_0x3d2bc2[_0xb21a('0x57')]=_0x155199;return _0x3d2bc2;})[_0xb21a('0x20')](respondWithFilteredResult(_0x5238d7,_0x479d9c))[_0xb21a('0x2b')](handleError(_0x5238d7,null));};exports['show']=function(_0x4c5993,_0x2d11dd){var _0x53b045={'raw':![],'where':{'id':_0x4c5993[_0xb21a('0x58')]['id']},'include':[{'model':db[_0xb21a('0x40')],'as':'mandatoryDispositionPause'}]},_0x438d82={};_0x438d82[_0xb21a('0x48')]=_[_0xb21a('0x49')](db[_0xb21a('0x43')][_0xb21a('0x44')]);_0x438d82[_0xb21a('0x4a')]=_[_0xb21a('0x49')](_0x4c5993[_0xb21a('0x4a')]);_0x438d82[_0xb21a('0x4b')]=_[_0xb21a('0x59')](_0x438d82[_0xb21a('0x48')],_0x438d82[_0xb21a('0x4a')]);_0x53b045[_0xb21a('0x4c')]=_['intersection'](_0x438d82[_0xb21a('0x48')],qs[_0xb21a('0x4d')](_0x4c5993['query']['fields']));_0x53b045[_0xb21a('0x4c')]=_0x53b045[_0xb21a('0x4c')][_0xb21a('0x5a')]?_0x53b045['attributes']:_0x438d82[_0xb21a('0x48')];if(_0x4c5993[_0xb21a('0x4a')][_0xb21a('0x55')]){_0x53b045[_0xb21a('0x5b')]=[{'all':!![]}];}_0x53b045=_['merge']({},_0x53b045,_0x4c5993['options']);return db[_0xb21a('0x43')][_0xb21a('0x5c')](_0x53b045)[_0xb21a('0x20')](handleEntityNotFound(_0x2d11dd,null))['then'](respondWithResult(_0x2d11dd,null))[_0xb21a('0x2b')](handleError(_0x2d11dd,null));};exports[_0xb21a('0x5d')]=function(_0x36e2b3,_0x1c2a39){return db['WhatsappAccount'][_0xb21a('0x5d')](_0x36e2b3[_0xb21a('0x5e')],{})['then'](function(_0x227f50){var _0x457ef4=_0x36e2b3[_0xb21a('0x5f')]['get']({'plain':!![]});if(!_0x457ef4)throw new Error(_0xb21a('0x60'));if(_0x457ef4[_0xb21a('0x61')]===_0xb21a('0x5f')){var _0xb1dab6=_0x227f50[_0xb21a('0x3a')]({'plain':!![]});var _0x6b480a=_0xb21a('0x3b');return db[_0xb21a('0x62')][_0xb21a('0x5c')]({'where':{'name':_0x6b480a,'userProfileId':_0x457ef4['userProfileId']},'raw':!![]})['then'](function(_0x3acbc4){if(_0x3acbc4&&_0x3acbc4[_0xb21a('0x63')]===0x0){return db[_0xb21a('0x3c')][_0xb21a('0x5d')]({'name':_0xb1dab6['name'],'resourceId':_0xb1dab6['id'],'type':_0x3acbc4[_0xb21a('0x3d')],'sectionId':_0x3acbc4['id']},{})['then'](function(){return _0x227f50;});}else{return _0x227f50;}})[_0xb21a('0x2b')](function(_0x329eed){logger[_0xb21a('0x26')](_0xb21a('0x64'),_0x329eed);throw _0x329eed;});}return _0x227f50;})[_0xb21a('0x20')](respondWithResult(_0x1c2a39,0xc9))[_0xb21a('0x2b')](handleError(_0x1c2a39,null));};exports[_0xb21a('0x38')]=function(_0x2db808,_0x51440c){if(_0x2db808[_0xb21a('0x5e')]['id']){delete _0x2db808[_0xb21a('0x5e')]['id'];}return db[_0xb21a('0x43')][_0xb21a('0x5c')]({'where':{'id':_0x2db808[_0xb21a('0x58')]['id']},'include':[{'model':db[_0xb21a('0x40')],'as':'mandatoryDispositionPause'}]})[_0xb21a('0x20')](handleEntityNotFound(_0x51440c,null))[_0xb21a('0x20')](saveUpdates(_0x2db808[_0xb21a('0x5e')],null))['then'](respondWithResult(_0x51440c,null))[_0xb21a('0x2b')](handleError(_0x51440c,null));};exports[_0xb21a('0x39')]=function(_0x5f10e1,_0x35d594){return db[_0xb21a('0x43')][_0xb21a('0x5c')]({'where':{'id':_0x5f10e1[_0xb21a('0x58')]['id']}})[_0xb21a('0x20')](handleEntityNotFound(_0x35d594,null))[_0xb21a('0x20')](removeEntity(_0x35d594,null))[_0xb21a('0x2b')](handleError(_0x35d594,null));};exports[_0xb21a('0x65')]=function(_0x2bdcf3,_0x1195e8){return db[_0xb21a('0x43')][_0xb21a('0x65')]()['then'](respondWithResult(_0x1195e8,null))['catch'](handleError(_0x1195e8,null));};exports[_0xb21a('0x66')]=function(_0x17febe,_0x35b444,_0x5c3e7b){if(_0x17febe[_0xb21a('0x5e')]['id']){delete _0x17febe['body']['id'];}return db[_0xb21a('0x43')]['find']({'where':{'id':_0x17febe[_0xb21a('0x58')]['id']}})[_0xb21a('0x20')](handleEntityNotFound(_0x35b444,null))[_0xb21a('0x20')](function(_0x3a72d2){if(_0x3a72d2){_0x17febe[_0xb21a('0x5e')][_0xb21a('0x67')]=_0x3a72d2['id'];return db[_0xb21a('0x68')][_0xb21a('0x5d')](_0x17febe['body']);}})['then'](respondWithResult(_0x35b444,null))[_0xb21a('0x2b')](handleError(_0x35b444,null));};exports[_0xb21a('0x69')]=function(_0x5ac88c,_0x1ff14a,_0x383fad){var _0x543ece={'raw':![],'where':{}};var _0x33dabe={};var _0x5bdfa8={'count':0x0,'rows':[]};return db[_0xb21a('0x43')][_0xb21a('0x6a')]({'where':{'id':_0x5ac88c[_0xb21a('0x58')]['id']}})['then'](handleEntityNotFound(_0x1ff14a,null))[_0xb21a('0x20')](function(_0x122342){if(_0x122342){_0x33dabe[_0xb21a('0x48')]=_[_0xb21a('0x49')](db[_0xb21a('0x68')]['rawAttributes']);_0x33dabe[_0xb21a('0x4a')]=_[_0xb21a('0x49')](_0x5ac88c[_0xb21a('0x4a')]);_0x33dabe[_0xb21a('0x4b')]=_[_0xb21a('0x59')](_0x33dabe[_0xb21a('0x48')],_0x33dabe[_0xb21a('0x4a')]);_0x543ece[_0xb21a('0x4c')]=_[_0xb21a('0x59')](_0x33dabe[_0xb21a('0x48')],qs[_0xb21a('0x4d')](_0x5ac88c['query'][_0xb21a('0x4d')]));_0x543ece[_0xb21a('0x4c')]=_0x543ece[_0xb21a('0x4c')][_0xb21a('0x5a')]?_0x543ece['attributes']:_0x33dabe[_0xb21a('0x48')];if(!_0x5ac88c[_0xb21a('0x4a')][_0xb21a('0x6b')](_0xb21a('0x4e'))){_0x543ece[_0xb21a('0x31')]=qs['limit'](_0x5ac88c[_0xb21a('0x4a')][_0xb21a('0x31')]);_0x543ece[_0xb21a('0x30')]=qs[_0xb21a('0x30')](_0x5ac88c['query'][_0xb21a('0x30')]);}_0x543ece[_0xb21a('0x6c')]=qs[_0xb21a('0x4f')](_0x5ac88c[_0xb21a('0x4a')]['sort']);_0x543ece['where']=qs['filters'](_[_0xb21a('0x50')](_0x5ac88c[_0xb21a('0x4a')],_0x33dabe[_0xb21a('0x4b')]));_0x543ece[_0xb21a('0x52')][_0xb21a('0x67')]=_0x122342['id'];if(_0x5ac88c[_0xb21a('0x4a')]['filter']){_0x543ece[_0xb21a('0x52')]=_['merge'](_0x543ece[_0xb21a('0x52')],{'$or':_[_0xb21a('0x42')](_0x543ece[_0xb21a('0x4c')],function(_0x501ac7){var _0x4e36e8={};_0x4e36e8[_0x501ac7]={'$like':'%'+_0x5ac88c[_0xb21a('0x4a')]['filter']+'%'};return _0x4e36e8;})});}_0x543ece=_['merge']({},_0x543ece,_0x5ac88c[_0xb21a('0x54')]);return db[_0xb21a('0x68')]['count']({'where':_0x543ece['where']})[_0xb21a('0x20')](function(_0x1a259b){_0x5bdfa8[_0xb21a('0x33')]=_0x1a259b;if(_0x5ac88c[_0xb21a('0x4a')][_0xb21a('0x55')]){_0x543ece[_0xb21a('0x5b')]=[{'all':!![]}];}return db[_0xb21a('0x68')]['findAll'](_0x543ece);})[_0xb21a('0x20')](function(_0x3428bc){_0x5bdfa8[_0xb21a('0x57')]=_0x3428bc;return _0x5bdfa8;});}})['then'](respondWithFilteredResult(_0x1ff14a,_0x543ece))[_0xb21a('0x2b')](handleError(_0x1ff14a,null));};exports[_0xb21a('0x6d')]=function(_0x3222c3,_0x4f1bfc,_0x4706c6){return db[_0xb21a('0x43')][_0xb21a('0x5c')]({'where':{'id':_0x3222c3['params']['id']}})['then'](handleEntityNotFound(_0x4f1bfc,null))[_0xb21a('0x20')](function(_0x5325ff){if(_0x5325ff){return _0x5325ff[_0xb21a('0x6d')](_0x3222c3[_0xb21a('0x4a')][_0xb21a('0x6e')]);}})['then'](respondWithStatusCode(_0x4f1bfc,null))[_0xb21a('0x2b')](handleError(_0x4f1bfc,null));};exports[_0xb21a('0x6f')]=function(_0x409624,_0x16e550,_0x2ca19c){if(_0x409624[_0xb21a('0x5e')]['id']){delete _0x409624[_0xb21a('0x5e')]['id'];}return db[_0xb21a('0x43')]['find']({'where':{'id':_0x409624[_0xb21a('0x58')]['id']}})[_0xb21a('0x20')](handleEntityNotFound(_0x16e550,null))['then'](function(_0x236b71){if(_0x236b71){_0x409624[_0xb21a('0x5e')][_0xb21a('0x67')]=_0x236b71['id'];return db[_0xb21a('0x70')]['create'](_0x409624[_0xb21a('0x5e')]);}})['then'](respondWithResult(_0x16e550,null))[_0xb21a('0x2b')](handleError(_0x16e550,null));};exports['getAnswers']=function(_0x35ffd3,_0x2b0f78,_0x1863b0){var _0x5f4eb5={'raw':![],'where':{}};var _0x5a494c={};var _0x482bac={'count':0x0,'rows':[]};return db[_0xb21a('0x43')][_0xb21a('0x6a')]({'where':{'id':_0x35ffd3[_0xb21a('0x58')]['id']}})[_0xb21a('0x20')](handleEntityNotFound(_0x2b0f78,null))[_0xb21a('0x20')](function(_0x3cfc5b){if(_0x3cfc5b){_0x5a494c[_0xb21a('0x48')]=_[_0xb21a('0x49')](db[_0xb21a('0x70')][_0xb21a('0x44')]);_0x5a494c['query']=_[_0xb21a('0x49')](_0x35ffd3['query']);_0x5a494c[_0xb21a('0x4b')]=_[_0xb21a('0x59')](_0x5a494c[_0xb21a('0x48')],_0x5a494c[_0xb21a('0x4a')]);_0x5f4eb5[_0xb21a('0x4c')]=_[_0xb21a('0x59')](_0x5a494c[_0xb21a('0x48')],qs[_0xb21a('0x4d')](_0x35ffd3[_0xb21a('0x4a')][_0xb21a('0x4d')]));_0x5f4eb5[_0xb21a('0x4c')]=_0x5f4eb5[_0xb21a('0x4c')][_0xb21a('0x5a')]?_0x5f4eb5['attributes']:_0x5a494c[_0xb21a('0x48')];if(!_0x35ffd3[_0xb21a('0x4a')][_0xb21a('0x6b')](_0xb21a('0x4e'))){_0x5f4eb5[_0xb21a('0x31')]=qs[_0xb21a('0x31')](_0x35ffd3[_0xb21a('0x4a')][_0xb21a('0x31')]);_0x5f4eb5[_0xb21a('0x30')]=qs['offset'](_0x35ffd3[_0xb21a('0x4a')][_0xb21a('0x30')]);}_0x5f4eb5[_0xb21a('0x6c')]=qs[_0xb21a('0x4f')](_0x35ffd3[_0xb21a('0x4a')][_0xb21a('0x4f')]);_0x5f4eb5[_0xb21a('0x52')]=qs[_0xb21a('0x4b')](_['pick'](_0x35ffd3[_0xb21a('0x4a')],_0x5a494c[_0xb21a('0x4b')]));_0x5f4eb5[_0xb21a('0x52')][_0xb21a('0x67')]=_0x3cfc5b['id'];if(_0x35ffd3[_0xb21a('0x4a')][_0xb21a('0x51')]){_0x5f4eb5['where']=_[_0xb21a('0x53')](_0x5f4eb5[_0xb21a('0x52')],{'$or':_[_0xb21a('0x42')](_0x5f4eb5[_0xb21a('0x4c')],function(_0x1a4614){var _0x19ef24={};_0x19ef24[_0x1a4614]={'$like':'%'+_0x35ffd3[_0xb21a('0x4a')]['filter']+'%'};return _0x19ef24;})});}_0x5f4eb5=_[_0xb21a('0x53')]({},_0x5f4eb5,_0x35ffd3['options']);return db[_0xb21a('0x70')][_0xb21a('0x33')]({'where':_0x5f4eb5[_0xb21a('0x52')]})[_0xb21a('0x20')](function(_0x56f50b){_0x482bac[_0xb21a('0x33')]=_0x56f50b;if(_0x35ffd3['query'][_0xb21a('0x55')]){_0x5f4eb5[_0xb21a('0x5b')]=[{'all':!![]}];}return db[_0xb21a('0x70')][_0xb21a('0x56')](_0x5f4eb5);})['then'](function(_0x2b45e5){_0x482bac[_0xb21a('0x57')]=_0x2b45e5;return _0x482bac;});}})[_0xb21a('0x20')](respondWithFilteredResult(_0x2b0f78,_0x5f4eb5))[_0xb21a('0x2b')](handleError(_0x2b0f78,null));};exports[_0xb21a('0x71')]=function(_0xf1bfdc,_0xd49a4,_0x3cf095){return db[_0xb21a('0x43')][_0xb21a('0x5c')]({'where':{'id':_0xf1bfdc[_0xb21a('0x58')]['id']}})[_0xb21a('0x20')](handleEntityNotFound(_0xd49a4,null))['then'](function(_0xc67e3a){if(_0xc67e3a){return _0xc67e3a[_0xb21a('0x71')](_0xf1bfdc[_0xb21a('0x4a')][_0xb21a('0x6e')]);}})['then'](respondWithStatusCode(_0xd49a4,null))[_0xb21a('0x2b')](handleError(_0xd49a4,null));};exports[_0xb21a('0x72')]=function(_0x55b974,_0x5c3322,_0x175fc0){return db[_0xb21a('0x43')][_0xb21a('0x5c')]({'where':{'id':_0x55b974[_0xb21a('0x58')]['id']}})[_0xb21a('0x20')](handleEntityNotFound(_0x5c3322,null))['then'](function(_0x4ca28a){if(_0x4ca28a){return _0x4ca28a[_0xb21a('0x72')](_0x55b974[_0xb21a('0x5e')][_0xb21a('0x6e')],_[_0xb21a('0x73')](_0x55b974[_0xb21a('0x5e')],[_0xb21a('0x6e'),'id'])||{})[_0xb21a('0x74')](function(_0x550d5d){for(var _0x1a15f9=0x0;_0x1a15f9<_0x55b974[_0xb21a('0x5e')][_0xb21a('0x6e')][_0xb21a('0x5a')];_0x1a15f9+=0x1){socket['emit'](_0xb21a('0x75'),{'UserId':Number(_0x55b974[_0xb21a('0x5e')]['ids'][_0x1a15f9]),'WhatsappAccountId':Number(_0x55b974['params']['id'])});}return _0x550d5d;});}})[_0xb21a('0x20')](respondWithResult(_0x5c3322,null))[_0xb21a('0x2b')](handleError(_0x5c3322,null));};exports[_0xb21a('0x76')]=function(_0x32fa3d,_0x3ea416,_0x9bad5f){return db[_0xb21a('0x43')][_0xb21a('0x5c')]({'where':{'id':_0x32fa3d[_0xb21a('0x58')]['id']}})[_0xb21a('0x20')](handleEntityNotFound(_0x3ea416,null))['then'](function(_0x226a42){if(_0x226a42){return _0x226a42[_0xb21a('0x76')](_0x32fa3d[_0xb21a('0x4a')]['ids'])[_0xb21a('0x20')](function(){if(_[_0xb21a('0x77')](_0x32fa3d[_0xb21a('0x4a')][_0xb21a('0x6e')])){for(var _0x2bfa22=0x0;_0x2bfa22<_0x32fa3d['query']['ids'][_0xb21a('0x5a')];_0x2bfa22+=0x1){socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x32fa3d[_0xb21a('0x4a')][_0xb21a('0x6e')][_0x2bfa22]),'WhatsappAccountId':Number(_0x32fa3d[_0xb21a('0x58')]['id'])});}}else{socket[_0xb21a('0x78')](_0xb21a('0x79'),{'UserId':Number(_0x32fa3d[_0xb21a('0x4a')][_0xb21a('0x6e')]),'WhatsappAccountId':Number(_0x32fa3d[_0xb21a('0x58')]['id'])});}});}})[_0xb21a('0x20')](respondWithStatusCode(_0x3ea416,null))[_0xb21a('0x2b')](handleError(_0x3ea416,null));};exports[_0xb21a('0x7a')]=function(_0x55ad8f,_0x53d337,_0x1ed4f9){var _0x2b021b={};var _0x3cab72={};var _0x58cbbd;var _0x269bbb;return db[_0xb21a('0x43')][_0xb21a('0x6a')]({'where':{'id':_0x55ad8f[_0xb21a('0x58')]['id']}})['then'](handleEntityNotFound(_0x53d337,null))['then'](function(_0x5505e4){if(_0x5505e4){_0x58cbbd=_0x5505e4;_0x3cab72[_0xb21a('0x48')]=_[_0xb21a('0x49')](db[_0xb21a('0x7b')]['rawAttributes']);_0x3cab72[_0xb21a('0x4a')]=_[_0xb21a('0x49')](_0x55ad8f[_0xb21a('0x4a')]);_0x3cab72[_0xb21a('0x4b')]=_[_0xb21a('0x59')](_0x3cab72[_0xb21a('0x48')],_0x3cab72[_0xb21a('0x4a')]);_0x2b021b[_0xb21a('0x4c')]=_[_0xb21a('0x59')](_0x3cab72['model'],qs[_0xb21a('0x4d')](_0x55ad8f[_0xb21a('0x4a')]['fields']));_0x2b021b[_0xb21a('0x4c')]=_0x2b021b[_0xb21a('0x4c')]['length']?_0x2b021b[_0xb21a('0x4c')]:_0x3cab72[_0xb21a('0x48')];_0x2b021b['order']=qs['sort'](_0x55ad8f[_0xb21a('0x4a')][_0xb21a('0x4f')]);_0x2b021b['where']=qs[_0xb21a('0x4b')](_['pick'](_0x55ad8f[_0xb21a('0x4a')],_0x3cab72[_0xb21a('0x4b')]));if(_0x55ad8f[_0xb21a('0x4a')][_0xb21a('0x51')]){_0x2b021b[_0xb21a('0x52')]=_['merge'](_0x2b021b[_0xb21a('0x52')],{'$or':_[_0xb21a('0x42')](_0x2b021b[_0xb21a('0x4c')],function(_0x1b61ee){var _0x1f51b5={};_0x1f51b5[_0x1b61ee]={'$like':'%'+_0x55ad8f[_0xb21a('0x4a')][_0xb21a('0x51')]+'%'};return _0x1f51b5;})});}_0x2b021b=_[_0xb21a('0x53')]({},_0x2b021b,_0x55ad8f[_0xb21a('0x54')]);return _0x58cbbd[_0xb21a('0x7a')](_0x2b021b);}})[_0xb21a('0x20')](function(_0x15b602){if(_0x15b602){_0x269bbb=_0x15b602[_0xb21a('0x5a')];if(!_0x55ad8f[_0xb21a('0x4a')][_0xb21a('0x6b')]('nolimit')){_0x2b021b[_0xb21a('0x31')]=qs['limit'](_0x55ad8f[_0xb21a('0x4a')]['limit']);_0x2b021b['offset']=qs['offset'](_0x55ad8f['query']['offset']);}return _0x58cbbd[_0xb21a('0x7a')](_0x2b021b);}})[_0xb21a('0x20')](function(_0x134d0a){if(_0x134d0a){return _0x134d0a?{'count':_0x269bbb,'rows':_0x134d0a}:null;}})[_0xb21a('0x20')](respondWithResult(_0x53d337,null))[_0xb21a('0x2b')](handleError(_0x53d337,null));};exports[_0xb21a('0x7c')]=function(_0x28ec65,_0x11e1b2){var _0x1d1de8=_0x28ec65['params']['id'];var _0xb012ea=_0x28ec65[_0xb21a('0x5e')];var _0x42800b=0xc8;var _0x3b5af6=null;return db[_0xb21a('0x7d')][_0xb21a('0x7e')]({'isolationLevel':db[_0xb21a('0x7d')][_0xb21a('0x7f')][_0xb21a('0x80')]['READ_COMMITTED']},function(_0xaea7b1){return db[_0xb21a('0x43')][_0xb21a('0x6a')]({'where':{'id':_0x1d1de8},'transaction':_0xaea7b1})['then'](function(_0x5a0f17){if(_0x5a0f17){return db[_0xb21a('0x81')][_0xb21a('0x39')]({'where':{'WhatsappAccountId':_0x1d1de8},'transaction':_0xaea7b1})['then'](function(){var _0x3e069d=_[_0xb21a('0x42')](_0xb012ea,function(_0x40672f){_0x40672f[_0xb21a('0x67')]=_0x1d1de8;return _0x40672f;});return db[_0xb21a('0x81')][_0xb21a('0x82')](_0x3e069d,{'transaction':_0xaea7b1});});}else{_0x42800b=0x194;_0x3b5af6=[];}});})['then'](function(){if(_0x42800b!==0x194){return db[_0xb21a('0x81')][_0xb21a('0x83')]({'where':{'WhatsappAccountId':_0x1d1de8},'order':_0xb21a('0x84')})[_0xb21a('0x20')](function(_0x22a0cc){_0x3b5af6=_0x22a0cc;});}})[_0xb21a('0x2b')](function(_0x26c5c1){_0x42800b=0x1f4;logger[_0xb21a('0x26')](_0x26c5c1['stack']);if(_0x26c5c1[_0xb21a('0x3d')]){delete _0x26c5c1['name'];}_0x3b5af6=_0x26c5c1;})['finally'](function(){if(_0x3b5af6===null){_0x11e1b2['sendStatus'](_0x42800b);}else{if(_0x42800b===0x1f4){_0x11e1b2['status'](_0x42800b)[_0xb21a('0x3e')](_0x3b5af6);}else{_0x11e1b2[_0xb21a('0x2e')](_0x42800b)[_0xb21a('0x2f')](_0x3b5af6);}}});};exports[_0xb21a('0x85')]=function(_0x29e697,_0x1060fb,_0x4a0a06){var _0x334ebc={};var _0x58fbb5={};var _0x11f7ff;var _0x560243;return db[_0xb21a('0x43')]['findOne']({'where':{'id':_0x29e697[_0xb21a('0x58')]['id']}})[_0xb21a('0x20')](handleEntityNotFound(_0x1060fb,null))[_0xb21a('0x20')](function(_0x2086bc){if(_0x2086bc){_0x11f7ff=_0x2086bc;_0x58fbb5[_0xb21a('0x48')]=_[_0xb21a('0x49')](db[_0xb21a('0x81')][_0xb21a('0x44')]);_0x58fbb5['query']=_[_0xb21a('0x49')](_0x29e697[_0xb21a('0x4a')]);_0x58fbb5[_0xb21a('0x4b')]=_['intersection'](_0x58fbb5['model'],_0x58fbb5['query']);_0x334ebc['attributes']=_[_0xb21a('0x59')](_0x58fbb5[_0xb21a('0x48')],qs[_0xb21a('0x4d')](_0x29e697[_0xb21a('0x4a')]['fields']));_0x334ebc[_0xb21a('0x4c')]=_0x334ebc[_0xb21a('0x4c')][_0xb21a('0x5a')]?_0x334ebc[_0xb21a('0x4c')]:_0x58fbb5[_0xb21a('0x48')];_0x334ebc[_0xb21a('0x6c')]=qs['sort'](_0x29e697['query'][_0xb21a('0x4f')]);_0x334ebc[_0xb21a('0x52')]=qs[_0xb21a('0x4b')](_[_0xb21a('0x50')](_0x29e697[_0xb21a('0x4a')],_0x58fbb5[_0xb21a('0x4b')]));if(_0x29e697[_0xb21a('0x4a')][_0xb21a('0x51')]){_0x334ebc[_0xb21a('0x52')]=_['merge'](_0x334ebc[_0xb21a('0x52')],{'$or':_[_0xb21a('0x42')](_0x334ebc[_0xb21a('0x4c')],function(_0x13636d){var _0x5d73bb={};_0x5d73bb[_0x13636d]={'$like':'%'+_0x29e697['query'][_0xb21a('0x51')]+'%'};return _0x5d73bb;})});}_0x334ebc=_[_0xb21a('0x53')]({},_0x334ebc,_0x29e697['options']);return _0x11f7ff['getApplications'](_0x334ebc);}})[_0xb21a('0x20')](function(_0x2845bc){if(_0x2845bc){_0x560243=_0x2845bc[_0xb21a('0x5a')];if(!_0x29e697['query'][_0xb21a('0x6b')]('nolimit')){_0x334ebc[_0xb21a('0x31')]=qs[_0xb21a('0x31')](_0x29e697['query']['limit']);_0x334ebc[_0xb21a('0x30')]=qs[_0xb21a('0x30')](_0x29e697[_0xb21a('0x4a')][_0xb21a('0x30')]);}return _0x11f7ff[_0xb21a('0x85')](_0x334ebc);}})[_0xb21a('0x20')](function(_0x6b62ee){if(_0x6b62ee){return _0x6b62ee?{'count':_0x560243,'rows':_0x6b62ee}:null;}})[_0xb21a('0x20')](respondWithResult(_0x1060fb,null))[_0xb21a('0x2b')](handleError(_0x1060fb,null));};exports[_0xb21a('0x86')]=function(_0x4c888e,_0x54deeb,_0x4e3975){var _0x56e8d2={'channel':'whatsapp'};var _0x9edfe1=[];var _0x1a53b1=[];var _0x343c50={};return db[_0xb21a('0x43')][_0xb21a('0x5c')]({'where':{'id':_0x4c888e['params']['id']},'include':[{'model':db[_0xb21a('0x81')],'as':_0xb21a('0x87')}]})[_0xb21a('0x20')](handleEntityNotFound(_0x54deeb,null))[_0xb21a('0x20')](function(_0x574026){_0x56e8d2[_0xb21a('0x88')]=_0x574026;if(_0x56e8d2[_0xb21a('0x88')]&&_0x56e8d2[_0xb21a('0x88')]['type']===_0xb21a('0x89')&&_0x4c888e[_0xb21a('0x5e')][_0xb21a('0x8a')]){if(_0x4c888e[_0xb21a('0x5e')]['statuses'][_0xb21a('0x5a')]===0x0)return;if(_0x4c888e[_0xb21a('0x5e')][_0xb21a('0x8a')][0x0][_0xb21a('0x8b')]!==_0xb21a('0x8c'))return;return db[_0xb21a('0x8d')]['update']({'read':!![],'readAt':_0x4c888e['body'][_0xb21a('0x8a')][0x0][_0xb21a('0x8e')]},{'where':{'messageId':_0x4c888e[_0xb21a('0x5e')][_0xb21a('0x8a')][0x0]['message_id']},'individualHooks':!![]})[_0xb21a('0x20')](function(_0x148ef1){return _0x54deeb['status'](0xc8)['json'](_0x148ef1);});}_0x56e8d2[_0xb21a('0x8f')]=_['orderBy'](_0x574026['Applications'],['priority'],['asc']);if(_0x56e8d2[_0xb21a('0x88')][_0xb21a('0x87')]){delete _0x56e8d2[_0xb21a('0x88')]['Applications'];}return db[_0xb21a('0x90')][_0xb21a('0x65')]()['then'](function(_0x3965f2){if(!_0x3965f2){throw new db[(_0xb21a('0x91'))][(_0xb21a('0x92'))]('no\x20available\x20attributes');}_0x9edfe1=_[_0xb21a('0x93')](_[_0xb21a('0x49')](_0x3965f2),[_0xb21a('0x94'),'updatedAt']);_0x1a53b1=_[_0xb21a('0x93')](_[_0xb21a('0x49')](_0x3965f2),[_0xb21a('0x94'),'updatedAt',_0xb21a('0x95'),_0xb21a('0x96')]);_0x56e8d2[_0xb21a('0x5e')]={'mapKey':_0xb21a('0x97')};if(_0x56e8d2['account']&&_0x56e8d2[_0xb21a('0x88')]['type']===_0xb21a('0x98')){_0x56e8d2['body'][_0xb21a('0x99')]=_0x4c888e[_0xb21a('0x5e')][_0xb21a('0x9a')][_0xb21a('0x9b')](_0xb21a('0x9c'),'');_0x56e8d2[_0xb21a('0x5e')][_0xb21a('0x5e')]=_0x4c888e[_0xb21a('0x5e')][_0xb21a('0x9d')];_0x56e8d2[_0xb21a('0x5e')][_0xb21a('0x9e')]=_0x4c888e['body']['MessageSid'];}if(_0x56e8d2['account']&&_0x56e8d2[_0xb21a('0x88')]['type']==='sinch'){_0x56e8d2[_0xb21a('0x5e')][_0xb21a('0x99')]=_0x4c888e['body'][_0xb21a('0x9f')][0x0][_0xb21a('0x99')];_0x56e8d2[_0xb21a('0x5e')][_0xb21a('0x5e')]=_0x4c888e[_0xb21a('0x5e')][_0xb21a('0x9f')][0x0][_0xb21a('0x28')][_0xb21a('0x5e')];_0x56e8d2['body'][_0xb21a('0x9e')]=_0x4c888e[_0xb21a('0x5e')][_0xb21a('0x9f')][0x0][_0xb21a('0xa0')];}if(_0x56e8d2[_0xb21a('0x5e')]['id']){delete _0x56e8d2[_0xb21a('0x5e')]['id'];}if(_['isNil'](_0x56e8d2['body']['from'])){throw new db[(_0xb21a('0x91'))]['ValidationError'](_0xb21a('0xa1'));}if(_['isNil'](_0x56e8d2[_0xb21a('0x5e')][_0xb21a('0x5e')])||_0x56e8d2['body']['body']===''){throw new db[(_0xb21a('0x91'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xb21a('0xa2')](_0x56e8d2[_0xb21a('0x5e')][_0xb21a('0xa3')])){throw new db['Sequelize'][(_0xb21a('0x92'))](_0xb21a('0xa4')+_0x1a53b1);}if(!_[_0xb21a('0xa5')](_0x1a53b1,_0x56e8d2['body'][_0xb21a('0xa3')])){throw new db[(_0xb21a('0x91'))]['ValidationError'](_0xb21a('0xa6')+_0x1a53b1);}_0x343c50[_0x56e8d2[_0xb21a('0x5e')][_0xb21a('0xa3')]]=_0x56e8d2[_0xb21a('0x5e')][_0xb21a('0x99')];return db[_0xb21a('0xa7')]['find']({'where':{'id':_0x56e8d2[_0xb21a('0x88')][_0xb21a('0x96')]},'include':[{'model':db['CmContact'],'as':_0xb21a('0xa8'),'where':_0x343c50,'limit':0x1,'order':[['updatedAt',_0xb21a('0xa9')]]}]});})['then'](handleEntityNotFound(_0x54deeb,null))[_0xb21a('0x20')](function(_0x406349){if(_0x406349){_0x56e8d2[_0xb21a('0xaa')]=_[_0xb21a('0x73')](_0x406349,[_0xb21a('0xa8')]);if(_0x406349['Contacts']['length']){return _0x406349['Contacts'][0x0];}var _0x11d71c=_['defaults'](_0x56e8d2[_0xb21a('0x5e')],{'firstName':_0x56e8d2[_0xb21a('0x5e')][_0xb21a('0x99')],'ListId':_0x406349['id']});_0x11d71c[_0x56e8d2[_0xb21a('0x5e')]['mapKey']]=_0x56e8d2[_0xb21a('0x5e')]['from'];return db[_0xb21a('0x90')][_0xb21a('0x5d')](_0x11d71c,{'fields':_0x9edfe1,'raw':!![]});}})[_0xb21a('0x20')](handleEntityNotFound(_0x54deeb,null))[_0xb21a('0x20')](function(_0x16f808){if(_0x16f808){_0x56e8d2[_0xb21a('0xab')]=_0x16f808;var _0x26335b={'ContactId':_0x16f808['id'],'phone':_0x56e8d2[_0xb21a('0x5e')]['from'],'WhatsappAccountId':_0x4c888e[_0xb21a('0x58')]['id']};var _0x327a4b={'ContactId':_0x16f808['id'],'WhatsappAccountId':_0x4c888e[_0xb21a('0x58')]['id'],'closed':![]};return db[_0xb21a('0xac')][_0xb21a('0x5c')]({'where':_0x327a4b})['then'](function(_0x497710){if(_0x497710){return[_0x497710,![]];}return db['WhatsappInteraction'][_0xb21a('0x5d')](_0x26335b)[_0xb21a('0x20')](function(_0x966404){return[_0x966404,!![]];});});}})['spread'](function(_0x3c8c9d,_0x575725){_0x56e8d2[_0xb21a('0xad')]=_0x3c8c9d[_0xb21a('0x3a')]({'plain':!![]});_0x56e8d2[_0xb21a('0xad')][_0xb21a('0xae')]=![];if(_0x575725){if(_0x56e8d2['account'][_0xb21a('0xaf')]){_0x56e8d2[_0xb21a('0x8f')][_0xb21a('0xb0')]({'id':0x0,'priority':_0x56e8d2[_0xb21a('0x8f')][_0xb21a('0x5a')]+0x1,'app':_0xb21a('0xb1'),'appdata':_0xb21a('0xb2'),'interval':_0xb21a('0xb3')});}_0x56e8d2[_0xb21a('0xad')]['created']=!![];}return db[_0xb21a('0x8d')]['create']({'phone':_0x56e8d2[_0xb21a('0x5e')][_0xb21a('0x99')],'messageId':_0x56e8d2[_0xb21a('0x5e')][_0xb21a('0x9e')],'body':_0x56e8d2[_0xb21a('0x5e')][_0xb21a('0x5e')],'WhatsappAccountId':_0x4c888e['params']['id'],'WhatsappInteractionId':_0x3c8c9d['id'],'direction':'in','ContactId':_0x3c8c9d[_0xb21a('0xb4')],'AttachmentId':_0x56e8d2[_0xb21a('0x5e')]['AttachmentId']});})['then'](function(_0x159364){_0x56e8d2[_0xb21a('0x28')]=_0x159364;if(_0x56e8d2[_0xb21a('0xad')][_0xb21a('0xb5')]){return db['User'][_0xb21a('0x5c')]({'attributes':['id',_0xb21a('0x3d')],'where':{'id':_0x56e8d2['interaction'][_0xb21a('0xb5')]}})['then'](function(_0x449fcc){if(_0x449fcc){_0x56e8d2[_0xb21a('0x8f')]['unshift']({'id':0x0,'priority':0x0,'app':_0xb21a('0xb6'),'appdata':_0x449fcc['name']+','+(_0x56e8d2['account']['waitForTheAssignedAgent']||0xa),'interval':_0xb21a('0xb3')});}return respondWithRpcPromise('Start',_0xb21a('0xb7'),_0x56e8d2);});}return respondWithRpcPromise(_0xb21a('0xb8'),_0xb21a('0xb7'),_0x56e8d2);})[_0xb21a('0x20')](function(_0x3e1a86){if(_0x3e1a86){var _0x8f6f4d=0xc8;var _0x5f327e=_0xb21a('0xb9');logger[_0xb21a('0x21')](_0xb21a('0x24'),_0x5f327e,_0x8f6f4d,_0xb21a('0xba'));logger[_0xb21a('0x23')](_0xb21a('0xbb'),_0x5f327e,_0x8f6f4d,_0xb21a('0xba'),JSON[_0xb21a('0x25')](_0x3e1a86));if(_0x56e8d2[_0xb21a('0x88')][_0xb21a('0x46')]===_0xb21a('0x98')){return _0x54deeb[_0xb21a('0x2e')](_0x8f6f4d)['set'](_0xb21a('0xbc'),'text/xml')[_0xb21a('0x3e')](_0xb21a('0xbd'));}else{return _0x54deeb[_0xb21a('0x2e')](_0x8f6f4d)[_0xb21a('0x2f')](_0x3e1a86);}}});})[_0xb21a('0x2b')](handleError(_0x54deeb,null));};exports[_0xb21a('0x3e')]=function(_0x314627,_0x5408af,_0x8691d9){var _0x5dfc4a,_0x4e9450,_0x1d7318;if(_[_0xb21a('0xa2')](_0x314627[_0xb21a('0x5e')]['body'])||_0x314627[_0xb21a('0x5e')][_0xb21a('0x5e')]===''){throw new db[(_0xb21a('0x91'))]['ValidationError'](_0xb21a('0xbe'));}if(_[_0xb21a('0xa2')](_0x314627[_0xb21a('0x5e')]['to'])){throw new db[(_0xb21a('0x91'))][(_0xb21a('0x92'))](_0xb21a('0xbf'));}_0x5dfc4a=_0x314627[_0xb21a('0x5e')]['to'];return db[_0xb21a('0x43')][_0xb21a('0x5c')]({'where':{'id':_0x314627['params']['id']},'include':[{'model':db[_0xb21a('0xa7')],'as':_0xb21a('0xc0'),'include':[{'model':db[_0xb21a('0x90')],'as':'Contacts','where':{'mobile':_0x5dfc4a},'limit':0x1,'order':[[_0xb21a('0xc1'),_0xb21a('0xa9')]]}]}]})[_0xb21a('0x20')](handleEntityNotFound(_0x5408af,null))[_0xb21a('0x20')](function(_0x3ce495){if(_0x3ce495&&_0x3ce495[_0xb21a('0xc0')]){_0x4e9450=_0x3ce495[_0xb21a('0x3a')]({'plain':!![]});if(_0x4e9450['List']&&_0x4e9450[_0xb21a('0xc0')][_0xb21a('0xa8')]['length']){return _0x4e9450[_0xb21a('0xc0')][_0xb21a('0xa8')][0x0];}return db['CmContact'][_0xb21a('0x5d')](_[_0xb21a('0x18')](_0x314627[_0xb21a('0x5e')],{'firstName':_0x5dfc4a,'mobile':_0x5dfc4a,'phone':_0x5dfc4a,'ListId':_0x4e9450[_0xb21a('0x96')]}));}})[_0xb21a('0x20')](handleEntityNotFound(_0x5408af,null))[_0xb21a('0x20')](function(_0x46d614){if(_0x46d614){_0x1d7318=_0x46d614;return db[_0xb21a('0xac')][_0xb21a('0x5c')]({'where':{'ContactId':_0x1d7318['id'],'closed':![],'WhatsappAccountId':_0x4e9450['id']}})[_0xb21a('0x20')](function(_0x4716ce){if(_0x4716ce){return[_0x4716ce,![]];}return db[_0xb21a('0xac')][_0xb21a('0x5d')]({'UserId':_0x314627[_0xb21a('0x5f')]['id'],'ContactId':_0x1d7318['id'],'WhatsappAccountId':_0x4e9450['id'],'phone':_0x5dfc4a,'firstMsgDirection':_0xb21a('0xc2'),'Messages':[_[_0xb21a('0x53')](_0x314627[_0xb21a('0x5e')],{'read':![],'body':_0x314627[_0xb21a('0x5e')][_0xb21a('0x5e')],'phone':_0x5dfc4a,'WhatsappAccountId':_0x4e9450['id'],'UserId':_0x314627[_0xb21a('0x5f')]['id'],'ContactId':_0x1d7318['id']})]},{'include':[{'model':db[_0xb21a('0x8d')],'as':'Messages'}]})[_0xb21a('0x20')](function(_0x397347){return[_0x397347,!![]];});});}})['spread'](function(_0x4d243a,_0x356758){if(_0x356758){return _0x4d243a;}return db[_0xb21a('0x8d')]['create'](_['merge'](_0x314627['body'],{'read':![],'body':_0x314627[_0xb21a('0x5e')][_0xb21a('0x5e')],'phone':_0x5dfc4a,'WhatsappAccountId':_0x4e9450['id'],'WhatsappInteractionId':_0x4d243a['id'],'UserId':_0x314627['user']['id'],'ContactId':_0x1d7318['id']}))[_0xb21a('0x20')](function(_0x377986){_0x4d243a[_0xb21a('0xc3')][_0xb21a('0xc4')]=[];_0x4d243a[_0xb21a('0xc3')][_0xb21a('0xc4')][_0xb21a('0xb0')](_0x377986[_0xb21a('0xc3')]);return _0x4d243a;});})[_0xb21a('0x20')](respondWithResult(_0x5408af,null))[_0xb21a('0x2b')](handleError(_0x5408af,null));}; \ No newline at end of file +var _0xb190=['WhatsappAccounts','UserProfileResource','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','type','key','model','query','attributes','intersection','length','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','merge','options','count','includeAll','include','rows','params','keys','fields','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','nolimit','order','findAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','transaction','sequelize','Transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','from','From','whatsapp:','Body','messageId','notifications','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','contact','WhatsappInteraction','created','close','*,*,*,*','ContactId','AttachmentId','interaction','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','destroy'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0xb190,0x90));var _0x0b19=function(_0x20c19f,_0x2448ed){_0x20c19f=_0x20c19f-0x0;var _0xdeba0c=_0xb190[_0x20c19f];return _0xdeba0c;};'use strict';var emlformat=require(_0x0b19('0x0'));var rimraf=require(_0x0b19('0x1'));var zipdir=require(_0x0b19('0x2'));var jsonpatch=require(_0x0b19('0x3'));var rp=require('request-promise');var moment=require(_0x0b19('0x4'));var BPromise=require(_0x0b19('0x5'));var Mustache=require('mustache');var util=require(_0x0b19('0x6'));var path=require(_0x0b19('0x7'));var sox=require(_0x0b19('0x8'));var csv=require(_0x0b19('0x9'));var ejs=require(_0x0b19('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0b19('0xb'));var squel=require(_0x0b19('0xc'));var crypto=require(_0x0b19('0xd'));var jsforce=require(_0x0b19('0xe'));var deskjs=require(_0x0b19('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0b19('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0b19('0x11'));var hardwareService=require(_0x0b19('0x12'));var logger=require(_0x0b19('0x13'))(_0x0b19('0x14'));var utils=require(_0x0b19('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x0b19('0x16')]=_[_0x0b19('0x17')](config[_0x0b19('0x16')],{'host':_0x0b19('0x18'),'port':0x18eb});var socket=require(_0x0b19('0x19'))(new Redis(config[_0x0b19('0x16')]));require('./whatsappAccount.socket')['register'](socket);var jayson=require(_0x0b19('0x1a'));var client=jayson[_0x0b19('0x1b')][_0x0b19('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x2a21bd,_0xa928a6,_0x35e7f4,_0x1a8b20){return new BPromise(function(_0x4f88d5,_0x2e55a5){var _0x1c3583=_0x1a8b20||client;return _0x1c3583[_0x0b19('0x1d')](_0x2a21bd,_0x35e7f4)[_0x0b19('0x1e')](function(_0x31e4d2){logger[_0x0b19('0x1f')](_0x0b19('0x20'),_0xa928a6,_0x0b19('0x21'));logger[_0x0b19('0x22')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xa928a6,_0x0b19('0x21'),JSON[_0x0b19('0x23')](_0x31e4d2));if(_0x31e4d2[_0x0b19('0x24')]){if(_0x31e4d2['error'][_0x0b19('0x25')]===0x1f4){logger['error'](_0x0b19('0x20'),_0xa928a6,_0x31e4d2['error']['message']);return _0x2e55a5(_0x31e4d2['error'][_0x0b19('0x26')]);}logger[_0x0b19('0x24')](_0x0b19('0x20'),_0xa928a6,_0x31e4d2[_0x0b19('0x24')]['message']);return _0x4f88d5(_0x31e4d2[_0x0b19('0x24')]['message']);}else{logger[_0x0b19('0x1f')](_0x0b19('0x20'),_0xa928a6,_0x0b19('0x21'));_0x4f88d5(_0x31e4d2[_0x0b19('0x27')][_0x0b19('0x26')]);}})[_0x0b19('0x28')](function(_0x283bbf){logger[_0x0b19('0x24')](_0x0b19('0x20'),_0xa928a6,_0x283bbf);_0x2e55a5(_0x283bbf);});});}function respondWithStatusCode(_0x5db1da,_0x26b9a1){_0x26b9a1=_0x26b9a1||0xcc;return function(_0x5c19dd){if(_0x5c19dd){return _0x5db1da['sendStatus'](_0x26b9a1);}return _0x5db1da[_0x0b19('0x29')](_0x26b9a1)[_0x0b19('0x2a')]();};}function respondWithResult(_0x187961,_0x215846){_0x215846=_0x215846||0xc8;return function(_0x11bacc){if(_0x11bacc){return _0x187961[_0x0b19('0x29')](_0x215846)[_0x0b19('0x2b')](_0x11bacc);}};}function respondWithFilteredResult(_0x14cef4,_0x1a2b6c){return function(_0x1fd0aa){if(_0x1fd0aa){var _0x3b6496=typeof _0x1a2b6c[_0x0b19('0x2c')]===_0x0b19('0x2d')&&typeof _0x1a2b6c[_0x0b19('0x2e')]==='undefined';var _0x184310=_0x1fd0aa['count'];var _0x11d292=_0x3b6496?0x0:_0x1a2b6c['offset'];var _0x1e8ed3=_0x3b6496?_0x1fd0aa['count']:_0x1a2b6c[_0x0b19('0x2c')]+_0x1a2b6c[_0x0b19('0x2e')];var _0x148199;if(_0x1e8ed3>=_0x184310){_0x1e8ed3=_0x184310;_0x148199=0xc8;}else{_0x148199=0xce;}_0x14cef4[_0x0b19('0x29')](_0x148199);return _0x14cef4[_0x0b19('0x2f')](_0x0b19('0x30'),_0x11d292+'-'+_0x1e8ed3+'/'+_0x184310)[_0x0b19('0x2b')](_0x1fd0aa);}return null;};}function patchUpdates(_0x5e6b55){return function(_0x1f4aed){try{jsonpatch[_0x0b19('0x31')](_0x1f4aed,_0x5e6b55,!![]);}catch(_0x21e03f){return BPromise[_0x0b19('0x32')](_0x21e03f);}return _0x1f4aed[_0x0b19('0x33')]();};}function saveUpdates(_0x2bff5e,_0x780185){return function(_0x4fc1cb){if(_0x4fc1cb){return _0x4fc1cb['update'](_0x2bff5e)[_0x0b19('0x1e')](function(_0x49fd24){return _0x49fd24;});}return null;};}function removeEntity(_0x3a6882,_0x48b1b4){return function(_0x54c17b){if(_0x54c17b){return _0x54c17b[_0x0b19('0x34')]()[_0x0b19('0x1e')](function(){var _0x819e41=_0x54c17b['get']({'plain':!![]});var _0xcd838=_0x0b19('0x35');return db[_0x0b19('0x36')]['destroy']({'where':{'type':_0xcd838,'resourceId':_0x819e41['id']}})['then'](function(){return _0x54c17b;});})[_0x0b19('0x1e')](function(){_0x3a6882['status'](0xcc)[_0x0b19('0x2a')]();});}};}function handleEntityNotFound(_0x30b5b0,_0x19c8e6){return function(_0xe041e5){if(!_0xe041e5){_0x30b5b0[_0x0b19('0x37')](0x194);}return _0xe041e5;};}function handleError(_0x26b08d,_0x3e15ce){_0x3e15ce=_0x3e15ce||0x1f4;return function(_0x489c14){logger[_0x0b19('0x24')](_0x489c14[_0x0b19('0x38')]);if(_0x489c14[_0x0b19('0x39')]){delete _0x489c14['name'];}_0x26b08d[_0x0b19('0x29')](_0x3e15ce)['send'](_0x489c14);};}exports[_0x0b19('0x3a')]=function(_0x1a243a,_0x52c5e6){var _0x33a32a={'include':[{'model':db[_0x0b19('0x3b')],'as':_0x0b19('0x3c')}]},_0x54da1c={},_0x209668={'count':0x0,'rows':[]};var _0x5e5a8f=_[_0x0b19('0x3d')](db[_0x0b19('0x3e')][_0x0b19('0x3f')],function(_0x1e015f){return{'name':_0x1e015f['fieldName'],'type':_0x1e015f[_0x0b19('0x40')][_0x0b19('0x41')]};});_0x54da1c[_0x0b19('0x42')]=_[_0x0b19('0x3d')](_0x5e5a8f,_0x0b19('0x39'));_0x54da1c[_0x0b19('0x43')]=_['keys'](_0x1a243a[_0x0b19('0x43')]);_0x54da1c['filters']=_['intersection'](_0x54da1c[_0x0b19('0x42')],_0x54da1c[_0x0b19('0x43')]);_0x33a32a[_0x0b19('0x44')]=_[_0x0b19('0x45')](_0x54da1c['model'],qs['fields'](_0x1a243a[_0x0b19('0x43')]['fields']));_0x33a32a[_0x0b19('0x44')]=_0x33a32a[_0x0b19('0x44')][_0x0b19('0x46')]?_0x33a32a[_0x0b19('0x44')]:_0x54da1c[_0x0b19('0x42')];if(!_0x1a243a[_0x0b19('0x43')][_0x0b19('0x47')]('nolimit')){_0x33a32a[_0x0b19('0x2e')]=qs['limit'](_0x1a243a[_0x0b19('0x43')][_0x0b19('0x2e')]);_0x33a32a[_0x0b19('0x2c')]=qs[_0x0b19('0x2c')](_0x1a243a[_0x0b19('0x43')][_0x0b19('0x2c')]);}_0x33a32a['order']=qs[_0x0b19('0x48')](_0x1a243a[_0x0b19('0x43')][_0x0b19('0x48')]);_0x33a32a[_0x0b19('0x49')]=qs[_0x0b19('0x4a')](_[_0x0b19('0x4b')](_0x1a243a['query'],_0x54da1c[_0x0b19('0x4a')]),_0x5e5a8f);if(_0x1a243a[_0x0b19('0x43')][_0x0b19('0x4c')]){_0x33a32a[_0x0b19('0x49')]=_['merge'](_0x33a32a[_0x0b19('0x49')],{'$or':_['map'](_0x5e5a8f,function(_0x160186){if(_0x160186[_0x0b19('0x40')]!==_0x0b19('0x4d')){var _0x1883b1={};_0x1883b1[_0x160186['name']]={'$like':'%'+_0x1a243a[_0x0b19('0x43')][_0x0b19('0x4c')]+'%'};return _0x1883b1;}})});}_0x33a32a=_[_0x0b19('0x4e')]({},_0x33a32a,_0x1a243a[_0x0b19('0x4f')]);var _0x1beb3d={'where':_0x33a32a['where']};return db[_0x0b19('0x3e')][_0x0b19('0x50')](_0x1beb3d)[_0x0b19('0x1e')](function(_0x3ccf59){_0x209668[_0x0b19('0x50')]=_0x3ccf59;if(_0x1a243a[_0x0b19('0x43')][_0x0b19('0x51')]){_0x33a32a[_0x0b19('0x52')]=[{'all':!![]}];}return db['WhatsappAccount']['findAll'](_0x33a32a);})['then'](function(_0x1d22bc){_0x209668[_0x0b19('0x53')]=_0x1d22bc;return _0x209668;})[_0x0b19('0x1e')](respondWithFilteredResult(_0x52c5e6,_0x33a32a))[_0x0b19('0x28')](handleError(_0x52c5e6,null));};exports['show']=function(_0x34403e,_0x2e5b11){var _0x15db55={'raw':![],'where':{'id':_0x34403e[_0x0b19('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0x0b19('0x3c')}]},_0x51f916={};_0x51f916[_0x0b19('0x42')]=_[_0x0b19('0x55')](db[_0x0b19('0x3e')]['rawAttributes']);_0x51f916[_0x0b19('0x43')]=_[_0x0b19('0x55')](_0x34403e[_0x0b19('0x43')]);_0x51f916[_0x0b19('0x4a')]=_[_0x0b19('0x45')](_0x51f916['model'],_0x51f916[_0x0b19('0x43')]);_0x15db55[_0x0b19('0x44')]=_['intersection'](_0x51f916[_0x0b19('0x42')],qs[_0x0b19('0x56')](_0x34403e[_0x0b19('0x43')][_0x0b19('0x56')]));_0x15db55[_0x0b19('0x44')]=_0x15db55['attributes'][_0x0b19('0x46')]?_0x15db55[_0x0b19('0x44')]:_0x51f916[_0x0b19('0x42')];if(_0x34403e[_0x0b19('0x43')][_0x0b19('0x51')]){_0x15db55[_0x0b19('0x52')]=[{'all':!![]}];}_0x15db55=_['merge']({},_0x15db55,_0x34403e['options']);return db[_0x0b19('0x3e')][_0x0b19('0x57')](_0x15db55)[_0x0b19('0x1e')](handleEntityNotFound(_0x2e5b11,null))[_0x0b19('0x1e')](respondWithResult(_0x2e5b11,null))['catch'](handleError(_0x2e5b11,null));};exports[_0x0b19('0x58')]=function(_0x5e00b4,_0x5b3605){return db[_0x0b19('0x3e')][_0x0b19('0x58')](_0x5e00b4[_0x0b19('0x59')],{})['then'](function(_0x3bc05b){var _0x2092ca=_0x5e00b4['user'][_0x0b19('0x5a')]({'plain':!![]});if(!_0x2092ca)throw new Error(_0x0b19('0x5b'));if(_0x2092ca[_0x0b19('0x5c')]===_0x0b19('0x5d')){var _0x1895a7=_0x3bc05b[_0x0b19('0x5a')]({'plain':!![]});var _0x18fd31=_0x0b19('0x35');return db[_0x0b19('0x5e')][_0x0b19('0x57')]({'where':{'name':_0x18fd31,'userProfileId':_0x2092ca[_0x0b19('0x5f')]},'raw':!![]})[_0x0b19('0x1e')](function(_0x365fe0){if(_0x365fe0&&_0x365fe0[_0x0b19('0x60')]===0x0){return db[_0x0b19('0x36')][_0x0b19('0x58')]({'name':_0x1895a7[_0x0b19('0x39')],'resourceId':_0x1895a7['id'],'type':_0x365fe0['name'],'sectionId':_0x365fe0['id']},{})[_0x0b19('0x1e')](function(){return _0x3bc05b;});}else{return _0x3bc05b;}})[_0x0b19('0x28')](function(_0x35f399){logger[_0x0b19('0x24')](_0x0b19('0x61'),_0x35f399);throw _0x35f399;});}return _0x3bc05b;})[_0x0b19('0x1e')](respondWithResult(_0x5b3605,0xc9))[_0x0b19('0x28')](handleError(_0x5b3605,null));};exports[_0x0b19('0x62')]=function(_0x30083e,_0x15b51e){if(_0x30083e[_0x0b19('0x59')]['id']){delete _0x30083e['body']['id'];}return db[_0x0b19('0x3e')][_0x0b19('0x57')]({'where':{'id':_0x30083e[_0x0b19('0x54')]['id']},'include':[{'model':db[_0x0b19('0x3b')],'as':'mandatoryDispositionPause'}]})[_0x0b19('0x1e')](handleEntityNotFound(_0x15b51e,null))[_0x0b19('0x1e')](saveUpdates(_0x30083e[_0x0b19('0x59')],null))[_0x0b19('0x1e')](respondWithResult(_0x15b51e,null))['catch'](handleError(_0x15b51e,null));};exports[_0x0b19('0x34')]=function(_0x547106,_0x11a24f){return db[_0x0b19('0x3e')][_0x0b19('0x57')]({'where':{'id':_0x547106[_0x0b19('0x54')]['id']}})[_0x0b19('0x1e')](handleEntityNotFound(_0x11a24f,null))[_0x0b19('0x1e')](removeEntity(_0x11a24f,null))[_0x0b19('0x28')](handleError(_0x11a24f,null));};exports[_0x0b19('0x63')]=function(_0x35bff1,_0x14fea4){return db[_0x0b19('0x3e')]['describe']()[_0x0b19('0x1e')](respondWithResult(_0x14fea4,null))[_0x0b19('0x28')](handleError(_0x14fea4,null));};exports[_0x0b19('0x64')]=function(_0x3f105f,_0x4db372,_0x35c6b2){if(_0x3f105f[_0x0b19('0x59')]['id']){delete _0x3f105f['body']['id'];}return db[_0x0b19('0x3e')][_0x0b19('0x57')]({'where':{'id':_0x3f105f[_0x0b19('0x54')]['id']}})[_0x0b19('0x1e')](handleEntityNotFound(_0x4db372,null))[_0x0b19('0x1e')](function(_0xf8632d){if(_0xf8632d){_0x3f105f['body'][_0x0b19('0x65')]=_0xf8632d['id'];return db[_0x0b19('0x66')]['create'](_0x3f105f['body']);}})['then'](respondWithResult(_0x4db372,null))[_0x0b19('0x28')](handleError(_0x4db372,null));};exports[_0x0b19('0x67')]=function(_0x54a809,_0x4cdba3,_0x561c27){var _0x1d417b={'raw':![],'where':{}};var _0x4c47e2={};var _0x3bd7fa={'count':0x0,'rows':[]};return db[_0x0b19('0x3e')][_0x0b19('0x68')]({'where':{'id':_0x54a809['params']['id']}})[_0x0b19('0x1e')](handleEntityNotFound(_0x4cdba3,null))[_0x0b19('0x1e')](function(_0xfe8705){if(_0xfe8705){_0x4c47e2[_0x0b19('0x42')]=_[_0x0b19('0x55')](db[_0x0b19('0x66')][_0x0b19('0x3f')]);_0x4c47e2['query']=_[_0x0b19('0x55')](_0x54a809[_0x0b19('0x43')]);_0x4c47e2[_0x0b19('0x4a')]=_[_0x0b19('0x45')](_0x4c47e2[_0x0b19('0x42')],_0x4c47e2['query']);_0x1d417b[_0x0b19('0x44')]=_[_0x0b19('0x45')](_0x4c47e2[_0x0b19('0x42')],qs[_0x0b19('0x56')](_0x54a809[_0x0b19('0x43')][_0x0b19('0x56')]));_0x1d417b[_0x0b19('0x44')]=_0x1d417b[_0x0b19('0x44')][_0x0b19('0x46')]?_0x1d417b['attributes']:_0x4c47e2['model'];if(!_0x54a809['query'][_0x0b19('0x47')](_0x0b19('0x69'))){_0x1d417b['limit']=qs[_0x0b19('0x2e')](_0x54a809[_0x0b19('0x43')][_0x0b19('0x2e')]);_0x1d417b[_0x0b19('0x2c')]=qs['offset'](_0x54a809[_0x0b19('0x43')][_0x0b19('0x2c')]);}_0x1d417b[_0x0b19('0x6a')]=qs[_0x0b19('0x48')](_0x54a809[_0x0b19('0x43')]['sort']);_0x1d417b['where']=qs[_0x0b19('0x4a')](_['pick'](_0x54a809[_0x0b19('0x43')],_0x4c47e2[_0x0b19('0x4a')]));_0x1d417b[_0x0b19('0x49')]['WhatsappAccountId']=_0xfe8705['id'];if(_0x54a809[_0x0b19('0x43')][_0x0b19('0x4c')]){_0x1d417b['where']=_[_0x0b19('0x4e')](_0x1d417b[_0x0b19('0x49')],{'$or':_[_0x0b19('0x3d')](_0x1d417b['attributes'],function(_0x28cece){var _0x3daa1b={};_0x3daa1b[_0x28cece]={'$like':'%'+_0x54a809[_0x0b19('0x43')][_0x0b19('0x4c')]+'%'};return _0x3daa1b;})});}_0x1d417b=_[_0x0b19('0x4e')]({},_0x1d417b,_0x54a809[_0x0b19('0x4f')]);return db[_0x0b19('0x66')][_0x0b19('0x50')]({'where':_0x1d417b[_0x0b19('0x49')]})['then'](function(_0x17870f){_0x3bd7fa[_0x0b19('0x50')]=_0x17870f;if(_0x54a809[_0x0b19('0x43')][_0x0b19('0x51')]){_0x1d417b[_0x0b19('0x52')]=[{'all':!![]}];}return db[_0x0b19('0x66')][_0x0b19('0x6b')](_0x1d417b);})[_0x0b19('0x1e')](function(_0x178b3c){_0x3bd7fa['rows']=_0x178b3c;return _0x3bd7fa;});}})[_0x0b19('0x1e')](respondWithFilteredResult(_0x4cdba3,_0x1d417b))[_0x0b19('0x28')](handleError(_0x4cdba3,null));};exports[_0x0b19('0x6c')]=function(_0x48d79a,_0x384eaf,_0x2a61e7){return db['WhatsappAccount']['find']({'where':{'id':_0x48d79a[_0x0b19('0x54')]['id']}})['then'](handleEntityNotFound(_0x384eaf,null))['then'](function(_0xf9504b){if(_0xf9504b){return _0xf9504b['removeDispositions'](_0x48d79a[_0x0b19('0x43')][_0x0b19('0x6d')]);}})[_0x0b19('0x1e')](respondWithStatusCode(_0x384eaf,null))['catch'](handleError(_0x384eaf,null));};exports[_0x0b19('0x6e')]=function(_0x5c6f0c,_0x1dcdae,_0x369a9e){if(_0x5c6f0c[_0x0b19('0x59')]['id']){delete _0x5c6f0c[_0x0b19('0x59')]['id'];}return db['WhatsappAccount'][_0x0b19('0x57')]({'where':{'id':_0x5c6f0c['params']['id']}})[_0x0b19('0x1e')](handleEntityNotFound(_0x1dcdae,null))[_0x0b19('0x1e')](function(_0x2eb42c){if(_0x2eb42c){_0x5c6f0c[_0x0b19('0x59')][_0x0b19('0x65')]=_0x2eb42c['id'];return db['CannedAnswer'][_0x0b19('0x58')](_0x5c6f0c[_0x0b19('0x59')]);}})[_0x0b19('0x1e')](respondWithResult(_0x1dcdae,null))[_0x0b19('0x28')](handleError(_0x1dcdae,null));};exports[_0x0b19('0x6f')]=function(_0x2c0d37,_0x5a9ccf,_0x2bab29){var _0x42f806={'raw':![],'where':{}};var _0xcee123={};var _0x4275bb={'count':0x0,'rows':[]};return db[_0x0b19('0x3e')][_0x0b19('0x68')]({'where':{'id':_0x2c0d37[_0x0b19('0x54')]['id']}})[_0x0b19('0x1e')](handleEntityNotFound(_0x5a9ccf,null))[_0x0b19('0x1e')](function(_0x26be61){if(_0x26be61){_0xcee123[_0x0b19('0x42')]=_['keys'](db[_0x0b19('0x70')]['rawAttributes']);_0xcee123['query']=_[_0x0b19('0x55')](_0x2c0d37[_0x0b19('0x43')]);_0xcee123[_0x0b19('0x4a')]=_[_0x0b19('0x45')](_0xcee123[_0x0b19('0x42')],_0xcee123[_0x0b19('0x43')]);_0x42f806[_0x0b19('0x44')]=_[_0x0b19('0x45')](_0xcee123[_0x0b19('0x42')],qs['fields'](_0x2c0d37[_0x0b19('0x43')]['fields']));_0x42f806['attributes']=_0x42f806[_0x0b19('0x44')]['length']?_0x42f806[_0x0b19('0x44')]:_0xcee123['model'];if(!_0x2c0d37[_0x0b19('0x43')]['hasOwnProperty'](_0x0b19('0x69'))){_0x42f806[_0x0b19('0x2e')]=qs[_0x0b19('0x2e')](_0x2c0d37['query'][_0x0b19('0x2e')]);_0x42f806[_0x0b19('0x2c')]=qs[_0x0b19('0x2c')](_0x2c0d37[_0x0b19('0x43')][_0x0b19('0x2c')]);}_0x42f806[_0x0b19('0x6a')]=qs[_0x0b19('0x48')](_0x2c0d37['query'][_0x0b19('0x48')]);_0x42f806['where']=qs[_0x0b19('0x4a')](_[_0x0b19('0x4b')](_0x2c0d37[_0x0b19('0x43')],_0xcee123['filters']));_0x42f806[_0x0b19('0x49')][_0x0b19('0x65')]=_0x26be61['id'];if(_0x2c0d37[_0x0b19('0x43')][_0x0b19('0x4c')]){_0x42f806[_0x0b19('0x49')]=_['merge'](_0x42f806[_0x0b19('0x49')],{'$or':_['map'](_0x42f806['attributes'],function(_0x2963de){var _0x1598c2={};_0x1598c2[_0x2963de]={'$like':'%'+_0x2c0d37[_0x0b19('0x43')]['filter']+'%'};return _0x1598c2;})});}_0x42f806=_[_0x0b19('0x4e')]({},_0x42f806,_0x2c0d37[_0x0b19('0x4f')]);return db[_0x0b19('0x70')][_0x0b19('0x50')]({'where':_0x42f806[_0x0b19('0x49')]})['then'](function(_0x1475c1){_0x4275bb['count']=_0x1475c1;if(_0x2c0d37[_0x0b19('0x43')]['includeAll']){_0x42f806[_0x0b19('0x52')]=[{'all':!![]}];}return db['CannedAnswer'][_0x0b19('0x6b')](_0x42f806);})[_0x0b19('0x1e')](function(_0xbe9d4f){_0x4275bb[_0x0b19('0x53')]=_0xbe9d4f;return _0x4275bb;});}})['then'](respondWithFilteredResult(_0x5a9ccf,_0x42f806))['catch'](handleError(_0x5a9ccf,null));};exports['removeAnswers']=function(_0x45cf67,_0x54850f,_0x4124b3){return db[_0x0b19('0x3e')][_0x0b19('0x57')]({'where':{'id':_0x45cf67[_0x0b19('0x54')]['id']}})[_0x0b19('0x1e')](handleEntityNotFound(_0x54850f,null))[_0x0b19('0x1e')](function(_0x3f2df2){if(_0x3f2df2){return _0x3f2df2[_0x0b19('0x71')](_0x45cf67['query']['ids']);}})[_0x0b19('0x1e')](respondWithStatusCode(_0x54850f,null))[_0x0b19('0x28')](handleError(_0x54850f,null));};exports[_0x0b19('0x72')]=function(_0x1e1574,_0x4ae3ed,_0x226ef9){return db[_0x0b19('0x3e')]['find']({'where':{'id':_0x1e1574['params']['id']}})[_0x0b19('0x1e')](handleEntityNotFound(_0x4ae3ed,null))[_0x0b19('0x1e')](function(_0xdcef6f){if(_0xdcef6f){return _0xdcef6f['addAgents'](_0x1e1574[_0x0b19('0x59')][_0x0b19('0x6d')],_[_0x0b19('0x73')](_0x1e1574[_0x0b19('0x59')],['ids','id'])||{})[_0x0b19('0x74')](function(_0x5a10c7){for(var _0x5a4278=0x0;_0x5a4278<_0x1e1574[_0x0b19('0x59')][_0x0b19('0x6d')]['length'];_0x5a4278+=0x1){socket[_0x0b19('0x75')](_0x0b19('0x76'),{'UserId':Number(_0x1e1574[_0x0b19('0x59')][_0x0b19('0x6d')][_0x5a4278]),'WhatsappAccountId':Number(_0x1e1574[_0x0b19('0x54')]['id'])});}return _0x5a10c7;});}})[_0x0b19('0x1e')](respondWithResult(_0x4ae3ed,null))[_0x0b19('0x28')](handleError(_0x4ae3ed,null));};exports[_0x0b19('0x77')]=function(_0x59bd79,_0x536b84,_0x118266){return db[_0x0b19('0x3e')][_0x0b19('0x57')]({'where':{'id':_0x59bd79[_0x0b19('0x54')]['id']}})[_0x0b19('0x1e')](handleEntityNotFound(_0x536b84,null))[_0x0b19('0x1e')](function(_0x36611d){if(_0x36611d){return _0x36611d[_0x0b19('0x77')](_0x59bd79[_0x0b19('0x43')][_0x0b19('0x6d')])[_0x0b19('0x1e')](function(){if(_[_0x0b19('0x78')](_0x59bd79[_0x0b19('0x43')][_0x0b19('0x6d')])){for(var _0x29a61f=0x0;_0x29a61f<_0x59bd79[_0x0b19('0x43')]['ids'][_0x0b19('0x46')];_0x29a61f+=0x1){socket[_0x0b19('0x75')](_0x0b19('0x79'),{'UserId':Number(_0x59bd79[_0x0b19('0x43')]['ids'][_0x29a61f]),'WhatsappAccountId':Number(_0x59bd79[_0x0b19('0x54')]['id'])});}}else{socket['emit'](_0x0b19('0x79'),{'UserId':Number(_0x59bd79[_0x0b19('0x43')][_0x0b19('0x6d')]),'WhatsappAccountId':Number(_0x59bd79[_0x0b19('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x536b84,null))['catch'](handleError(_0x536b84,null));};exports[_0x0b19('0x7a')]=function(_0x141de5,_0x1bd165,_0x112a5b){var _0x375cc3={};var _0x48a0f1={};var _0x45f017;var _0x19ea78;return db[_0x0b19('0x3e')][_0x0b19('0x68')]({'where':{'id':_0x141de5[_0x0b19('0x54')]['id']}})[_0x0b19('0x1e')](handleEntityNotFound(_0x1bd165,null))[_0x0b19('0x1e')](function(_0x3333f8){if(_0x3333f8){_0x45f017=_0x3333f8;_0x48a0f1['model']=_[_0x0b19('0x55')](db[_0x0b19('0x7b')][_0x0b19('0x3f')]);_0x48a0f1[_0x0b19('0x43')]=_[_0x0b19('0x55')](_0x141de5[_0x0b19('0x43')]);_0x48a0f1[_0x0b19('0x4a')]=_[_0x0b19('0x45')](_0x48a0f1['model'],_0x48a0f1['query']);_0x375cc3[_0x0b19('0x44')]=_[_0x0b19('0x45')](_0x48a0f1[_0x0b19('0x42')],qs['fields'](_0x141de5[_0x0b19('0x43')]['fields']));_0x375cc3[_0x0b19('0x44')]=_0x375cc3[_0x0b19('0x44')][_0x0b19('0x46')]?_0x375cc3['attributes']:_0x48a0f1[_0x0b19('0x42')];_0x375cc3['order']=qs[_0x0b19('0x48')](_0x141de5[_0x0b19('0x43')][_0x0b19('0x48')]);_0x375cc3[_0x0b19('0x49')]=qs[_0x0b19('0x4a')](_[_0x0b19('0x4b')](_0x141de5[_0x0b19('0x43')],_0x48a0f1[_0x0b19('0x4a')]));if(_0x141de5[_0x0b19('0x43')]['filter']){_0x375cc3[_0x0b19('0x49')]=_[_0x0b19('0x4e')](_0x375cc3[_0x0b19('0x49')],{'$or':_['map'](_0x375cc3['attributes'],function(_0x431eb0){var _0x11dc36={};_0x11dc36[_0x431eb0]={'$like':'%'+_0x141de5['query'][_0x0b19('0x4c')]+'%'};return _0x11dc36;})});}_0x375cc3=_['merge']({},_0x375cc3,_0x141de5[_0x0b19('0x4f')]);return _0x45f017[_0x0b19('0x7a')](_0x375cc3);}})[_0x0b19('0x1e')](function(_0x5664dd){if(_0x5664dd){_0x19ea78=_0x5664dd[_0x0b19('0x46')];if(!_0x141de5[_0x0b19('0x43')][_0x0b19('0x47')](_0x0b19('0x69'))){_0x375cc3[_0x0b19('0x2e')]=qs['limit'](_0x141de5[_0x0b19('0x43')][_0x0b19('0x2e')]);_0x375cc3['offset']=qs[_0x0b19('0x2c')](_0x141de5['query'][_0x0b19('0x2c')]);}return _0x45f017[_0x0b19('0x7a')](_0x375cc3);}})['then'](function(_0x55964b){if(_0x55964b){return _0x55964b?{'count':_0x19ea78,'rows':_0x55964b}:null;}})['then'](respondWithResult(_0x1bd165,null))[_0x0b19('0x28')](handleError(_0x1bd165,null));};exports['addApplications']=function(_0x10d3c2,_0x1c601d){var _0x43cbe1=_0x10d3c2[_0x0b19('0x54')]['id'];var _0x172e9f=_0x10d3c2['body'];var _0x234e15=0xc8;var _0x2cde74=null;return db['sequelize'][_0x0b19('0x7c')]({'isolationLevel':db[_0x0b19('0x7d')][_0x0b19('0x7e')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x4ce5c7){return db[_0x0b19('0x3e')]['findOne']({'where':{'id':_0x43cbe1},'transaction':_0x4ce5c7})['then'](function(_0x2fcc85){if(_0x2fcc85){return db['WhatsappApplication'][_0x0b19('0x34')]({'where':{'WhatsappAccountId':_0x43cbe1},'transaction':_0x4ce5c7})[_0x0b19('0x1e')](function(){var _0x188bfe=_[_0x0b19('0x3d')](_0x172e9f,function(_0x1002f8){_0x1002f8['WhatsappAccountId']=_0x43cbe1;return _0x1002f8;});return db[_0x0b19('0x7f')][_0x0b19('0x80')](_0x188bfe,{'transaction':_0x4ce5c7});});}else{_0x234e15=0x194;_0x2cde74=[];}});})[_0x0b19('0x1e')](function(){if(_0x234e15!==0x194){return db[_0x0b19('0x7f')][_0x0b19('0x81')]({'where':{'WhatsappAccountId':_0x43cbe1},'order':_0x0b19('0x82')})['then'](function(_0x4bf709){_0x2cde74=_0x4bf709;});}})['catch'](function(_0x30a745){_0x234e15=0x1f4;logger['error'](_0x30a745[_0x0b19('0x38')]);if(_0x30a745['name']){delete _0x30a745[_0x0b19('0x39')];}_0x2cde74=_0x30a745;})[_0x0b19('0x83')](function(){if(_0x2cde74===null){_0x1c601d[_0x0b19('0x37')](_0x234e15);}else{if(_0x234e15===0x1f4){_0x1c601d[_0x0b19('0x29')](_0x234e15)[_0x0b19('0x84')](_0x2cde74);}else{_0x1c601d['status'](_0x234e15)[_0x0b19('0x2b')](_0x2cde74);}}});};exports['getApplications']=function(_0x542273,_0x27a035,_0x16672e){var _0x14e975={};var _0x1acf3b={};var _0x12504b;var _0x1a9de6;return db[_0x0b19('0x3e')]['findOne']({'where':{'id':_0x542273[_0x0b19('0x54')]['id']}})[_0x0b19('0x1e')](handleEntityNotFound(_0x27a035,null))[_0x0b19('0x1e')](function(_0x5bdd5d){if(_0x5bdd5d){_0x12504b=_0x5bdd5d;_0x1acf3b[_0x0b19('0x42')]=_[_0x0b19('0x55')](db[_0x0b19('0x7f')][_0x0b19('0x3f')]);_0x1acf3b[_0x0b19('0x43')]=_[_0x0b19('0x55')](_0x542273[_0x0b19('0x43')]);_0x1acf3b[_0x0b19('0x4a')]=_['intersection'](_0x1acf3b[_0x0b19('0x42')],_0x1acf3b[_0x0b19('0x43')]);_0x14e975[_0x0b19('0x44')]=_[_0x0b19('0x45')](_0x1acf3b['model'],qs['fields'](_0x542273[_0x0b19('0x43')][_0x0b19('0x56')]));_0x14e975[_0x0b19('0x44')]=_0x14e975['attributes'][_0x0b19('0x46')]?_0x14e975[_0x0b19('0x44')]:_0x1acf3b[_0x0b19('0x42')];_0x14e975[_0x0b19('0x6a')]=qs[_0x0b19('0x48')](_0x542273[_0x0b19('0x43')]['sort']);_0x14e975[_0x0b19('0x49')]=qs[_0x0b19('0x4a')](_[_0x0b19('0x4b')](_0x542273[_0x0b19('0x43')],_0x1acf3b[_0x0b19('0x4a')]));if(_0x542273[_0x0b19('0x43')][_0x0b19('0x4c')]){_0x14e975['where']=_[_0x0b19('0x4e')](_0x14e975['where'],{'$or':_[_0x0b19('0x3d')](_0x14e975[_0x0b19('0x44')],function(_0x5b31db){var _0x3875e4={};_0x3875e4[_0x5b31db]={'$like':'%'+_0x542273[_0x0b19('0x43')]['filter']+'%'};return _0x3875e4;})});}_0x14e975=_[_0x0b19('0x4e')]({},_0x14e975,_0x542273['options']);return _0x12504b['getApplications'](_0x14e975);}})[_0x0b19('0x1e')](function(_0x4e8dcc){if(_0x4e8dcc){_0x1a9de6=_0x4e8dcc[_0x0b19('0x46')];if(!_0x542273['query'][_0x0b19('0x47')](_0x0b19('0x69'))){_0x14e975[_0x0b19('0x2e')]=qs[_0x0b19('0x2e')](_0x542273[_0x0b19('0x43')]['limit']);_0x14e975['offset']=qs[_0x0b19('0x2c')](_0x542273[_0x0b19('0x43')]['offset']);}return _0x12504b[_0x0b19('0x85')](_0x14e975);}})[_0x0b19('0x1e')](function(_0x170c74){if(_0x170c74){return _0x170c74?{'count':_0x1a9de6,'rows':_0x170c74}:null;}})[_0x0b19('0x1e')](respondWithResult(_0x27a035,null))[_0x0b19('0x28')](handleError(_0x27a035,null));};exports[_0x0b19('0x86')]=function(_0x21e029,_0x4e576c,_0x2888ec){var _0xec7ee7={'channel':_0x0b19('0x87')};var _0x5e469f=[];var _0x3c421f=[];var _0x480647={};return db[_0x0b19('0x3e')]['find']({'where':{'id':_0x21e029[_0x0b19('0x54')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x0b19('0x88')}]})[_0x0b19('0x1e')](handleEntityNotFound(_0x4e576c,null))[_0x0b19('0x1e')](function(_0x4891b1){_0xec7ee7[_0x0b19('0x89')]=_0x4891b1;if(_0xec7ee7[_0x0b19('0x89')]&&_0xec7ee7['account'][_0x0b19('0x40')]===_0x0b19('0x8a')&&_0x21e029[_0x0b19('0x59')][_0x0b19('0x8b')]){if(_0x21e029[_0x0b19('0x59')][_0x0b19('0x8b')][_0x0b19('0x46')]===0x0)return;if(_0x21e029[_0x0b19('0x59')][_0x0b19('0x8b')][0x0][_0x0b19('0x8c')]!==_0x0b19('0x8d'))return;return db[_0x0b19('0x8e')]['update']({'read':!![],'readAt':_0x21e029[_0x0b19('0x59')]['statuses'][0x0][_0x0b19('0x8f')]},{'where':{'messageId':_0x21e029[_0x0b19('0x59')]['statuses'][0x0][_0x0b19('0x90')]},'individualHooks':!![]})[_0x0b19('0x1e')](function(_0x1127f9){return _0x4e576c['status'](0xc8)[_0x0b19('0x2b')](_0x1127f9);});}_0xec7ee7[_0x0b19('0x91')]=_[_0x0b19('0x92')](_0x4891b1[_0x0b19('0x88')],[_0x0b19('0x82')],[_0x0b19('0x93')]);if(_0xec7ee7[_0x0b19('0x89')][_0x0b19('0x88')]){delete _0xec7ee7['account']['Applications'];}return db[_0x0b19('0x94')][_0x0b19('0x63')]()['then'](function(_0x4a9fc2){if(!_0x4a9fc2){throw new db[(_0x0b19('0x95'))]['ValidationError'](_0x0b19('0x96'));}_0x5e469f=_[_0x0b19('0x97')](_[_0x0b19('0x55')](_0x4a9fc2),[_0x0b19('0x98'),'updatedAt']);_0x3c421f=_['difference'](_[_0x0b19('0x55')](_0x4a9fc2),[_0x0b19('0x98'),_0x0b19('0x99'),_0x0b19('0x9a'),_0x0b19('0x9b')]);_0xec7ee7[_0x0b19('0x59')]={'mapKey':_0x0b19('0x9c')};if(_0xec7ee7[_0x0b19('0x89')]&&_0xec7ee7['account'][_0x0b19('0x40')]==='twilio'){_0xec7ee7[_0x0b19('0x59')][_0x0b19('0x9d')]=_0x21e029[_0x0b19('0x59')][_0x0b19('0x9e')]['replace'](_0x0b19('0x9f'),'');_0xec7ee7['body'][_0x0b19('0x59')]=_0x21e029['body'][_0x0b19('0xa0')];_0xec7ee7[_0x0b19('0x59')][_0x0b19('0xa1')]=_0x21e029['body']['MessageSid'];}if(_0xec7ee7[_0x0b19('0x89')]&&_0xec7ee7[_0x0b19('0x89')]['type']===_0x0b19('0x8a')){_0xec7ee7[_0x0b19('0x59')]['from']=_0x21e029[_0x0b19('0x59')]['notifications'][0x0][_0x0b19('0x9d')];_0xec7ee7[_0x0b19('0x59')][_0x0b19('0x59')]=_0x21e029['body'][_0x0b19('0xa2')][0x0][_0x0b19('0x26')][_0x0b19('0x59')];_0xec7ee7[_0x0b19('0x59')][_0x0b19('0xa1')]=_0x21e029[_0x0b19('0x59')][_0x0b19('0xa2')][0x0]['message_id'];}if(_0xec7ee7[_0x0b19('0x59')]['id']){delete _0xec7ee7[_0x0b19('0x59')]['id'];}if(_[_0x0b19('0xa3')](_0xec7ee7[_0x0b19('0x59')]['from'])){throw new db['Sequelize'][(_0x0b19('0xa4'))]('from\x20is\x20mandatory');}if(_[_0x0b19('0xa3')](_0xec7ee7[_0x0b19('0x59')][_0x0b19('0x59')])||_0xec7ee7[_0x0b19('0x59')]['body']===''){throw new db[(_0x0b19('0x95'))][(_0x0b19('0xa4'))](_0x0b19('0xa5'));}if(_[_0x0b19('0xa3')](_0xec7ee7[_0x0b19('0x59')][_0x0b19('0xa6')])){throw new db[(_0x0b19('0x95'))][(_0x0b19('0xa4'))](_0x0b19('0xa7')+_0x3c421f);}if(!_['includes'](_0x3c421f,_0xec7ee7[_0x0b19('0x59')][_0x0b19('0xa6')])){throw new db[(_0x0b19('0x95'))][(_0x0b19('0xa4'))](_0x0b19('0xa8')+_0x3c421f);}_0x480647[_0xec7ee7[_0x0b19('0x59')]['mapKey']]=_0xec7ee7['body'][_0x0b19('0x9d')];return db[_0x0b19('0xa9')][_0x0b19('0x57')]({'where':{'id':_0xec7ee7['account']['ListId']},'include':[{'model':db[_0x0b19('0x94')],'as':_0x0b19('0xaa'),'where':_0x480647,'limit':0x1,'order':[[_0x0b19('0x99'),_0x0b19('0xab')]]}]});})[_0x0b19('0x1e')](handleEntityNotFound(_0x4e576c,null))[_0x0b19('0x1e')](function(_0xed7bde){if(_0xed7bde){_0xec7ee7['list']=_['omit'](_0xed7bde,['Contacts']);if(_0xed7bde[_0x0b19('0xaa')][_0x0b19('0x46')]){return _0xed7bde['Contacts'][0x0];}var _0xfb1727=_['defaults'](_0xec7ee7[_0x0b19('0x59')],{'firstName':_0xec7ee7[_0x0b19('0x59')][_0x0b19('0x9d')],'ListId':_0xed7bde['id']});_0xfb1727[_0xec7ee7[_0x0b19('0x59')][_0x0b19('0xa6')]]=_0xec7ee7[_0x0b19('0x59')][_0x0b19('0x9d')];return db[_0x0b19('0x94')][_0x0b19('0x58')](_0xfb1727,{'fields':_0x5e469f,'raw':!![]});}})[_0x0b19('0x1e')](handleEntityNotFound(_0x4e576c,null))[_0x0b19('0x1e')](function(_0x181885){if(_0x181885){_0xec7ee7[_0x0b19('0xac')]=_0x181885;var _0x4ca97f={'ContactId':_0x181885['id'],'phone':_0xec7ee7[_0x0b19('0x59')][_0x0b19('0x9d')],'WhatsappAccountId':_0x21e029[_0x0b19('0x54')]['id']};var _0x390c60={'ContactId':_0x181885['id'],'WhatsappAccountId':_0x21e029[_0x0b19('0x54')]['id'],'closed':![]};return db[_0x0b19('0xad')][_0x0b19('0x57')]({'where':_0x390c60})['then'](function(_0x5d1eef){if(_0x5d1eef){return[_0x5d1eef,![]];}return db[_0x0b19('0xad')]['create'](_0x4ca97f)[_0x0b19('0x1e')](function(_0x450618){return[_0x450618,!![]];});});}})[_0x0b19('0x74')](function(_0x2e739b,_0x3b6ac1){_0xec7ee7['interaction']=_0x2e739b[_0x0b19('0x5a')]({'plain':!![]});_0xec7ee7['interaction'][_0x0b19('0xae')]=![];if(_0x3b6ac1){if(_0xec7ee7[_0x0b19('0x89')]['autoclose']){_0xec7ee7[_0x0b19('0x91')]['push']({'id':0x0,'priority':_0xec7ee7['applications'][_0x0b19('0x46')]+0x1,'app':_0x0b19('0xaf'),'appdata':'unmanaged','interval':_0x0b19('0xb0')});}_0xec7ee7['interaction'][_0x0b19('0xae')]=!![];}return db[_0x0b19('0x8e')][_0x0b19('0x58')]({'phone':_0xec7ee7[_0x0b19('0x59')][_0x0b19('0x9d')],'messageId':_0xec7ee7[_0x0b19('0x59')][_0x0b19('0xa1')],'body':_0xec7ee7[_0x0b19('0x59')]['body'],'WhatsappAccountId':_0x21e029[_0x0b19('0x54')]['id'],'WhatsappInteractionId':_0x2e739b['id'],'direction':'in','ContactId':_0x2e739b[_0x0b19('0xb1')],'AttachmentId':_0xec7ee7[_0x0b19('0x59')][_0x0b19('0xb2')]});})[_0x0b19('0x1e')](function(_0xb3ef94){_0xec7ee7[_0x0b19('0x26')]=_0xb3ef94;if(_0xec7ee7[_0x0b19('0xb3')]['UserId']){return db[_0x0b19('0x7b')][_0x0b19('0x57')]({'attributes':['id',_0x0b19('0x39')],'where':{'id':_0xec7ee7[_0x0b19('0xb3')][_0x0b19('0xb4')]}})[_0x0b19('0x1e')](function(_0x1b579c){if(_0x1b579c){_0xec7ee7[_0x0b19('0x91')][_0x0b19('0xb5')]({'id':0x0,'priority':0x0,'app':_0x0b19('0xb6'),'appdata':_0x1b579c[_0x0b19('0x39')]+','+(_0xec7ee7[_0x0b19('0x89')][_0x0b19('0xb7')]||0xa),'interval':_0x0b19('0xb0')});}return respondWithRpcPromise('Start','startRouting',_0xec7ee7);});}return respondWithRpcPromise(_0x0b19('0xb8'),_0x0b19('0xb9'),_0xec7ee7);})[_0x0b19('0x1e')](function(_0x4bbdc1){if(_0x4bbdc1){var _0x5dcbda=0xc8;var _0x45c357='receiveMessage';logger[_0x0b19('0x1f')](_0x0b19('0xba'),_0x45c357,_0x5dcbda,_0x0b19('0xbb'));logger['debug'](_0x0b19('0xbc'),_0x45c357,_0x5dcbda,_0x0b19('0xbb'),JSON[_0x0b19('0x23')](_0x4bbdc1));if(_0xec7ee7[_0x0b19('0x89')][_0x0b19('0x40')]==='twilio'){return _0x4e576c[_0x0b19('0x29')](_0x5dcbda)[_0x0b19('0x2f')](_0x0b19('0xbd'),_0x0b19('0xbe'))[_0x0b19('0x84')](_0x0b19('0xbf'));}else{return _0x4e576c['status'](_0x5dcbda)['json'](_0x4bbdc1);}}});})[_0x0b19('0x28')](handleError(_0x4e576c,null));};exports['send']=function(_0xc0166d,_0x53d033,_0x1b05c1){var _0x105c49,_0x3ad32,_0x15aa5f;if(_[_0x0b19('0xa3')](_0xc0166d['body'][_0x0b19('0x59')])||_0xc0166d['body'][_0x0b19('0x59')]===''){throw new db[(_0x0b19('0x95'))][(_0x0b19('0xa4'))](_0x0b19('0xa5'));}if(_[_0x0b19('0xa3')](_0xc0166d[_0x0b19('0x59')]['to'])){throw new db[(_0x0b19('0x95'))][(_0x0b19('0xa4'))](_0x0b19('0xc0'));}_0x105c49=_0xc0166d[_0x0b19('0x59')]['to'];return db['WhatsappAccount'][_0x0b19('0x57')]({'where':{'id':_0xc0166d[_0x0b19('0x54')]['id']},'include':[{'model':db[_0x0b19('0xa9')],'as':_0x0b19('0xc1'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x105c49},'limit':0x1,'order':[['updatedAt',_0x0b19('0xab')]]}]}]})[_0x0b19('0x1e')](handleEntityNotFound(_0x53d033,null))['then'](function(_0x49aaef){if(_0x49aaef&&_0x49aaef[_0x0b19('0xc1')]){_0x3ad32=_0x49aaef[_0x0b19('0x5a')]({'plain':!![]});if(_0x3ad32['List']&&_0x3ad32[_0x0b19('0xc1')][_0x0b19('0xaa')]['length']){return _0x3ad32[_0x0b19('0xc1')]['Contacts'][0x0];}return db['CmContact']['create'](_[_0x0b19('0x17')](_0xc0166d[_0x0b19('0x59')],{'firstName':_0x105c49,'mobile':_0x105c49,'phone':_0x105c49,'ListId':_0x3ad32[_0x0b19('0x9b')]}));}})[_0x0b19('0x1e')](handleEntityNotFound(_0x53d033,null))[_0x0b19('0x1e')](function(_0x3dccbe){if(_0x3dccbe){_0x15aa5f=_0x3dccbe;return db['WhatsappInteraction'][_0x0b19('0x57')]({'where':{'ContactId':_0x15aa5f['id'],'closed':![],'WhatsappAccountId':_0x3ad32['id']}})[_0x0b19('0x1e')](function(_0x44a6e8){if(_0x44a6e8){return[_0x44a6e8,![]];}return db[_0x0b19('0xad')][_0x0b19('0x58')]({'UserId':_0xc0166d[_0x0b19('0x5d')]['id'],'ContactId':_0x15aa5f['id'],'WhatsappAccountId':_0x3ad32['id'],'phone':_0x105c49,'firstMsgDirection':_0x0b19('0xc2'),'Messages':[_[_0x0b19('0x4e')](_0xc0166d[_0x0b19('0x59')],{'read':![],'body':_0xc0166d[_0x0b19('0x59')][_0x0b19('0x59')],'phone':_0x105c49,'WhatsappAccountId':_0x3ad32['id'],'UserId':_0xc0166d[_0x0b19('0x5d')]['id'],'ContactId':_0x15aa5f['id']})]},{'include':[{'model':db[_0x0b19('0x8e')],'as':_0x0b19('0xc3')}]})[_0x0b19('0x1e')](function(_0x46516a){return[_0x46516a,!![]];});});}})['spread'](function(_0x161cc9,_0x30952e){if(_0x30952e){return _0x161cc9;}return db[_0x0b19('0x8e')]['create'](_[_0x0b19('0x4e')](_0xc0166d[_0x0b19('0x59')],{'read':![],'body':_0xc0166d[_0x0b19('0x59')][_0x0b19('0x59')],'phone':_0x105c49,'WhatsappAccountId':_0x3ad32['id'],'WhatsappInteractionId':_0x161cc9['id'],'UserId':_0xc0166d['user']['id'],'ContactId':_0x15aa5f['id']}))[_0x0b19('0x1e')](function(_0x1486f5){_0x161cc9['dataValues']['Messages']=[];_0x161cc9[_0x0b19('0xc4')][_0x0b19('0xc3')]['push'](_0x1486f5[_0x0b19('0xc4')]);return _0x161cc9;});})[_0x0b19('0x1e')](respondWithResult(_0x53d033,null))[_0x0b19('0x28')](handleError(_0x53d033,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 7d02e73..19b3a99 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 _0x5867=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0x5867,0xa0));var _0x7586=function(_0x2379e8,_0x5dc8c0){_0x2379e8=_0x2379e8-0x0;var _0x5a8266=_0x5867[_0x2379e8];return _0x5a8266;};'use strict';var EventEmitter=require(_0x7586('0x0'));var WhatsappAccount=require(_0x7586('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x7586('0x2')](0x0);var events={'afterCreate':_0x7586('0x3'),'afterUpdate':_0x7586('0x4'),'afterDestroy':_0x7586('0x5')};function emitEvent(_0x431791){return function(_0x4718b9,_0x40c3c5,_0x123ce3){WhatsappAccountEvents[_0x7586('0x6')](_0x431791+':'+_0x4718b9['id'],_0x4718b9);WhatsappAccountEvents[_0x7586('0x6')](_0x431791,_0x4718b9);_0x123ce3(null);};}for(var e in events){if(events[_0x7586('0x7')](e)){var event=events[e];WhatsappAccount[_0x7586('0x8')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0xea22=['exports','../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty','hook'];(function(_0x211fdc,_0x4d5567){var _0x225ce2=function(_0x148c7c){while(--_0x148c7c){_0x211fdc['push'](_0x211fdc['shift']());}};_0x225ce2(++_0x4d5567);}(_0xea22,0x1c8));var _0x2ea2=function(_0x583023,_0x14508a){_0x583023=_0x583023-0x0;var _0x1f1dee=_0xea22[_0x583023];return _0x1f1dee;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x2ea2('0x0'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x2ea2('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2ea2('0x2')};function emitEvent(_0x30af6a){return function(_0x1edd15,_0x3ff242,_0x1bf57d){WhatsappAccountEvents[_0x2ea2('0x3')](_0x30af6a+':'+_0x1edd15['id'],_0x1edd15);WhatsappAccountEvents[_0x2ea2('0x3')](_0x30af6a,_0x1edd15);_0x1bf57d(null);};}for(var e in events){if(events[_0x2ea2('0x4')](e)){var event=events[e];WhatsappAccount[_0x2ea2('0x5')](e,emitEvent(event));}}module[_0x2ea2('0x6')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 4cf183d..d73de1d 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 _0x576f=['exports','WhatsappAccount','whatsapp_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4d43f0,_0x3006f2){var _0x58ef91=function(_0x44a7f1){while(--_0x44a7f1){_0x4d43f0['push'](_0x4d43f0['shift']());}};_0x58ef91(++_0x3006f2);}(_0x576f,0xf3));var _0xf576=function(_0x4601ff,_0x505e7a){_0x4601ff=_0x4601ff-0x0;var _0x474cb7=_0x576f[_0x4601ff];return _0x474cb7;};'use strict';var _=require(_0xf576('0x0'));var util=require('util');var logger=require(_0xf576('0x1'))(_0xf576('0x2'));var moment=require(_0xf576('0x3'));var BPromise=require(_0xf576('0x4'));var rp=require(_0xf576('0x5'));var fs=require('fs');var path=require(_0xf576('0x6'));var rimraf=require(_0xf576('0x7'));var config=require(_0xf576('0x8'));var attributes=require('./whatsappAccount.attributes');module[_0xf576('0x9')]=function(_0x396591,_0x32201b){return _0x396591['define'](_0xf576('0xa'),attributes,{'tableName':_0xf576('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb9c0=['WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define'];(function(_0x25e775,_0x427253){var _0x45df77=function(_0x5e6c17){while(--_0x5e6c17){_0x25e775['push'](_0x25e775['shift']());}};_0x45df77(++_0x427253);}(_0xb9c0,0x64));var _0x0b9c=function(_0x3a777b,_0x27a9f1){_0x3a777b=_0x3a777b-0x0;var _0xcfe488=_0xb9c0[_0x3a777b];return _0xcfe488;};'use strict';var _=require(_0x0b9c('0x0'));var util=require(_0x0b9c('0x1'));var logger=require(_0x0b9c('0x2'))(_0x0b9c('0x3'));var moment=require(_0x0b9c('0x4'));var BPromise=require(_0x0b9c('0x5'));var rp=require(_0x0b9c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0b9c('0x7'));var config=require(_0x0b9c('0x8'));var attributes=require(_0x0b9c('0x9'));module[_0x0b9c('0xa')]=function(_0x4d41dd,_0x2167ce){return _0x4d41dd[_0x0b9c('0xb')](_0x0b9c('0xc'),attributes,{'tableName':_0x0b9c('0xd'),'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 5fa910c..07c43f7 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 _0xbefc=['model','then','ShowWhatsappAccount','stringify','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','WhatsappAccount','find','options','raw','attributes','map','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbefc,0x195));var _0xcbef=function(_0x282db0,_0x5024d0){_0x282db0=_0x282db0-0x0;var _0x58f016=_0xbefc[_0x282db0];return _0x58f016;};'use strict';var _=require('lodash');var util=require(_0xcbef('0x0'));var moment=require(_0xcbef('0x1'));var BPromise=require(_0xcbef('0x2'));var rs=require(_0xcbef('0x3'));var fs=require('fs');var Redis=require(_0xcbef('0x4'));var db=require(_0xcbef('0x5'))['db'];var utils=require(_0xcbef('0x6'));var logger=require(_0xcbef('0x7'))(_0xcbef('0x8'));var config=require(_0xcbef('0x9'));var jayson=require(_0xcbef('0xa'));var client=jayson[_0xcbef('0xb')][_0xcbef('0xc')]({'port':0x232a});config[_0xcbef('0xd')]=_[_0xcbef('0xe')](config[_0xcbef('0xd')],{'host':_0xcbef('0xf'),'port':0x18eb});var socket=require(_0xcbef('0x10'))(new Redis(config[_0xcbef('0xd')]));require(_0xcbef('0x11'))[_0xcbef('0x12')](socket);function respondWithRpcPromise(_0xeea55e,_0x559a65,_0x32d5e0){return new BPromise(function(_0x156458,_0x28001b){return client['request'](_0xeea55e,_0x32d5e0)['then'](function(_0x26ef80){logger[_0xcbef('0x13')](_0xcbef('0x14'),_0x559a65,_0xcbef('0x15'));logger[_0xcbef('0x16')](_0xcbef('0x17'),_0x559a65,_0xcbef('0x15'),JSON['stringify'](_0x26ef80));if(_0x26ef80[_0xcbef('0x18')]){if(_0x26ef80[_0xcbef('0x18')][_0xcbef('0x19')]===0x1f4){logger[_0xcbef('0x18')](_0xcbef('0x14'),_0x559a65,_0x26ef80[_0xcbef('0x18')][_0xcbef('0x1a')]);return _0x28001b(_0x26ef80['error']['message']);}logger[_0xcbef('0x18')](_0xcbef('0x14'),_0x559a65,_0x26ef80[_0xcbef('0x18')]['message']);return _0x156458(_0x26ef80['error'][_0xcbef('0x1a')]);}else{logger[_0xcbef('0x13')](_0xcbef('0x14'),_0x559a65,'request\x20sent');_0x156458(_0x26ef80[_0xcbef('0x1b')][_0xcbef('0x1a')]);}})['catch'](function(_0x35f00c){logger[_0xcbef('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x559a65,_0x35f00c);_0x28001b(_0x35f00c);});});}exports['ShowWhatsappAccount']=function(_0x3b8752){var _0x2c4f2c=this;return new Promise(function(_0x24272b,_0x490b04){return db[_0xcbef('0x1c')][_0xcbef('0x1d')]({'raw':_0x3b8752[_0xcbef('0x1e')]?_0x3b8752['options'][_0xcbef('0x1f')]===undefined?!![]:![]:!![],'where':_0x3b8752[_0xcbef('0x1e')]?_0x3b8752[_0xcbef('0x1e')]['where']||null:null,'attributes':_0x3b8752[_0xcbef('0x1e')]?_0x3b8752[_0xcbef('0x1e')][_0xcbef('0x20')]||null:null,'include':_0x3b8752[_0xcbef('0x1e')]?_0x3b8752[_0xcbef('0x1e')]['include']?_[_0xcbef('0x21')](_0x3b8752[_0xcbef('0x1e')][_0xcbef('0x22')],function(_0x2d4279){return{'model':db[_0x2d4279[_0xcbef('0x23')]],'as':_0x2d4279['as'],'attributes':_0x2d4279['attributes'],'include':_0x2d4279[_0xcbef('0x22')]?_['map'](_0x2d4279[_0xcbef('0x22')],function(_0xfedcaa){return{'model':db[_0xfedcaa[_0xcbef('0x23')]],'as':_0xfedcaa['as'],'attributes':_0xfedcaa[_0xcbef('0x20')],'include':_0xfedcaa['include']?_[_0xcbef('0x21')](_0xfedcaa['include'],function(_0x1f7c5a){return{'model':db[_0x1f7c5a[_0xcbef('0x23')]],'as':_0x1f7c5a['as'],'attributes':_0x1f7c5a[_0xcbef('0x20')]};}):[]};}):[]};}):[]:[]})[_0xcbef('0x24')](function(_0x5ef8ce){logger[_0xcbef('0x13')](_0xcbef('0x25'),_0x3b8752);logger[_0xcbef('0x16')](_0xcbef('0x25'),_0x3b8752,JSON[_0xcbef('0x26')](_0x5ef8ce));_0x24272b(_0x5ef8ce);})[_0xcbef('0x27')](function(_0x57b8be){logger[_0xcbef('0x18')]('ShowWhatsappAccount',_0x57b8be[_0xcbef('0x1a')],_0x3b8752);_0x490b04(_0x2c4f2c['error'](0x1f4,_0x57b8be['message']));});});}; \ No newline at end of file +var _0x844f=['include','map','model','then','stringify','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','options','raw','where','attributes'];(function(_0x5d43ec,_0x4730e2){var _0x316949=function(_0x2208f6){while(--_0x2208f6){_0x5d43ec['push'](_0x5d43ec['shift']());}};_0x316949(++_0x4730e2);}(_0x844f,0x19c));var _0xf844=function(_0x2d248c,_0x42a3df){_0x2d248c=_0x2d248c-0x0;var _0xf3820=_0x844f[_0x2d248c];return _0xf3820;};'use strict';var _=require('lodash');var util=require(_0xf844('0x0'));var moment=require('moment');var BPromise=require(_0xf844('0x1'));var rs=require(_0xf844('0x2'));var fs=require('fs');var Redis=require(_0xf844('0x3'));var db=require(_0xf844('0x4'))['db'];var utils=require(_0xf844('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf844('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf844('0x7')][_0xf844('0x8')]({'port':0x232a});config['redis']=_[_0xf844('0x9')](config[_0xf844('0xa')],{'host':_0xf844('0xb'),'port':0x18eb});var socket=require(_0xf844('0xc'))(new Redis(config[_0xf844('0xa')]));require(_0xf844('0xd'))[_0xf844('0xe')](socket);function respondWithRpcPromise(_0x14041a,_0x1df6b3,_0x3e80d7){return new BPromise(function(_0x45b0e3,_0x3efdac){return client[_0xf844('0xf')](_0x14041a,_0x3e80d7)['then'](function(_0x4b39ab){logger[_0xf844('0x10')](_0xf844('0x11'),_0x1df6b3,_0xf844('0x12'));logger[_0xf844('0x13')](_0xf844('0x14'),_0x1df6b3,_0xf844('0x12'),JSON['stringify'](_0x4b39ab));if(_0x4b39ab[_0xf844('0x15')]){if(_0x4b39ab[_0xf844('0x15')][_0xf844('0x16')]===0x1f4){logger['error'](_0xf844('0x11'),_0x1df6b3,_0x4b39ab['error'][_0xf844('0x17')]);return _0x3efdac(_0x4b39ab[_0xf844('0x15')][_0xf844('0x17')]);}logger[_0xf844('0x15')]('WhatsappAccount,\x20%s,\x20%s',_0x1df6b3,_0x4b39ab['error']['message']);return _0x45b0e3(_0x4b39ab['error'][_0xf844('0x17')]);}else{logger[_0xf844('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x1df6b3,_0xf844('0x12'));_0x45b0e3(_0x4b39ab[_0xf844('0x18')][_0xf844('0x17')]);}})[_0xf844('0x19')](function(_0x5e11ef){logger[_0xf844('0x15')]('WhatsappAccount,\x20%s,\x20%s',_0x1df6b3,_0x5e11ef);_0x3efdac(_0x5e11ef);});});}exports[_0xf844('0x1a')]=function(_0x1f6510){var _0x2d734a=this;return new Promise(function(_0x436eaa,_0x3b11d1){return db[_0xf844('0x1b')]['find']({'raw':_0x1f6510[_0xf844('0x1c')]?_0x1f6510[_0xf844('0x1c')][_0xf844('0x1d')]===undefined?!![]:![]:!![],'where':_0x1f6510['options']?_0x1f6510[_0xf844('0x1c')][_0xf844('0x1e')]||null:null,'attributes':_0x1f6510[_0xf844('0x1c')]?_0x1f6510[_0xf844('0x1c')][_0xf844('0x1f')]||null:null,'include':_0x1f6510[_0xf844('0x1c')]?_0x1f6510[_0xf844('0x1c')][_0xf844('0x20')]?_[_0xf844('0x21')](_0x1f6510[_0xf844('0x1c')][_0xf844('0x20')],function(_0x58b1c4){return{'model':db[_0x58b1c4[_0xf844('0x22')]],'as':_0x58b1c4['as'],'attributes':_0x58b1c4['attributes'],'include':_0x58b1c4[_0xf844('0x20')]?_[_0xf844('0x21')](_0x58b1c4[_0xf844('0x20')],function(_0x166f91){return{'model':db[_0x166f91['model']],'as':_0x166f91['as'],'attributes':_0x166f91['attributes'],'include':_0x166f91[_0xf844('0x20')]?_[_0xf844('0x21')](_0x166f91[_0xf844('0x20')],function(_0xb8d782){return{'model':db[_0xb8d782[_0xf844('0x22')]],'as':_0xb8d782['as'],'attributes':_0xb8d782['attributes']};}):[]};}):[]};}):[]:[]})[_0xf844('0x23')](function(_0x2d7956){logger[_0xf844('0x10')]('ShowWhatsappAccount',_0x1f6510);logger[_0xf844('0x13')]('ShowWhatsappAccount',_0x1f6510,JSON[_0xf844('0x24')](_0x2d7956));_0x436eaa(_0x2d7956);})['catch'](function(_0x4dbf5a){logger[_0xf844('0x15')](_0xf844('0x1a'),_0x4dbf5a[_0xf844('0x17')],_0x1f6510);_0x3b11d1(_0x2d734a[_0xf844('0x15')](0x1f4,_0x4dbf5a['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 1e0af87..f53d4a3 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 _0x0a07=['save','remove','update','emit','removeListener','length','whatsappAccount:'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0a07,0x1c0));var _0x70a0=function(_0x4cc868,_0xbd4314){_0x4cc868=_0x4cc868-0x0;var _0x2439b1=_0x0a07[_0x4cc868];return _0x2439b1;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x70a0('0x0'),_0x70a0('0x1'),_0x70a0('0x2')];function createListener(_0x5ed1d6,_0xb53de9){return function(_0x5f02e6){_0xb53de9[_0x70a0('0x3')](_0x5ed1d6,_0x5f02e6);};}function removeListener(_0x831b47,_0x2e62ff){return function(){WhatsappAccountEvents[_0x70a0('0x4')](_0x831b47,_0x2e62ff);};}exports['register']=function(_0x45ea8f){for(var _0xab0347=0x0,_0x1b3f40=events[_0x70a0('0x5')];_0xab0347<_0x1b3f40;_0xab0347++){var _0x500c10=events[_0xab0347];var _0x36b937=createListener(_0x70a0('0x6')+_0x500c10,_0x45ea8f);WhatsappAccountEvents['on'](_0x500c10,_0x36b937);}}; \ No newline at end of file +var _0x57f9=['save','remove','update','emit','removeListener','register','whatsappAccount:'];(function(_0x10fa85,_0x4381f3){var _0x5bbd98=function(_0x36619c){while(--_0x36619c){_0x10fa85['push'](_0x10fa85['shift']());}};_0x5bbd98(++_0x4381f3);}(_0x57f9,0x165));var _0x957f=function(_0x567870,_0x207545){_0x567870=_0x567870-0x0;var _0x2f7898=_0x57f9[_0x567870];return _0x2f7898;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x957f('0x0'),_0x957f('0x1'),_0x957f('0x2')];function createListener(_0x44dfc2,_0x59cfdf){return function(_0x28f6c4){_0x59cfdf[_0x957f('0x3')](_0x44dfc2,_0x28f6c4);};}function removeListener(_0x3e05c3,_0x193e60){return function(){WhatsappAccountEvents[_0x957f('0x4')](_0x3e05c3,_0x193e60);};}exports[_0x957f('0x5')]=function(_0x53f76c){for(var _0x29c7fb=0x0,_0xad20a4=events['length'];_0x29c7fb<_0xad20a4;_0x29c7fb++){var _0x5626be=events[_0x29c7fb];var _0x2e2648=createListener(_0x957f('0x6')+_0x5626be,_0x53f76c);WhatsappAccountEvents['on'](_0x5626be,_0x2e2648);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 150ddc2..8e46664 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 _0x9362=['index','/:id','post','create','update','delete','exports','util','path','connect-timeout','express','Router','../../config/environment','./whatsappApplication.controller','get','isAuthenticated'];(function(_0x253167,_0x5a3145){var _0x2d924d=function(_0x433ba9){while(--_0x433ba9){_0x253167['push'](_0x253167['shift']());}};_0x2d924d(++_0x5a3145);}(_0x9362,0x1b7));var _0x2936=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9362[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x2936('0x0'));var path=require(_0x2936('0x1'));var timeout=require(_0x2936('0x2'));var express=require(_0x2936('0x3'));var router=express[_0x2936('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2936('0x5'));var controller=require(_0x2936('0x6'));router[_0x2936('0x7')]('/',auth[_0x2936('0x8')](),controller[_0x2936('0x9')]);router['get'](_0x2936('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x2936('0xb')]('/',auth[_0x2936('0x8')](),controller[_0x2936('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x2936('0xd')]);router[_0x2936('0xe')](_0x2936('0xa'),auth[_0x2936('0x8')](),controller['destroy']);module[_0x2936('0xf')]=router; \ No newline at end of file +var _0xc518=['multer','util','path','Router','./whatsappApplication.controller','get','isAuthenticated','index','show','post','create','update','destroy','exports'];(function(_0x1b1ff6,_0x54a036){var _0x54b26a=function(_0x139fdc){while(--_0x139fdc){_0x1b1ff6['push'](_0x1b1ff6['shift']());}};_0x54b26a(++_0x54a036);}(_0xc518,0xee));var _0x8c51=function(_0x140d2f,_0x2ad576){_0x140d2f=_0x140d2f-0x0;var _0x1a04c6=_0xc518[_0x140d2f];return _0x1a04c6;};'use strict';var multer=require(_0x8c51('0x0'));var util=require(_0x8c51('0x1'));var path=require(_0x8c51('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8c51('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8c51('0x4'));router[_0x8c51('0x5')]('/',auth[_0x8c51('0x6')](),controller[_0x8c51('0x7')]);router[_0x8c51('0x5')]('/:id',auth[_0x8c51('0x6')](),controller[_0x8c51('0x8')]);router[_0x8c51('0x9')]('/',auth[_0x8c51('0x6')](),controller[_0x8c51('0xa')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x8c51('0xb')]);router['delete']('/:id',auth[_0x8c51('0x6')](),controller[_0x8c51('0xc')]);module[_0x8c51('0xd')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index c20875d..543e6a0 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 _0xfadd=['sequelize','exports','TEXT','STRING','*,*,*,*'];(function(_0x58974c,_0x5c473a){var _0x2ee3db=function(_0x6267a4){while(--_0x6267a4){_0x58974c['push'](_0x58974c['shift']());}};_0x2ee3db(++_0x5c473a);}(_0xfadd,0x1a4));var _0xdfad=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfadd[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xdfad('0x0'));module[_0xdfad('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xdfad('0x2')]()},'description':{'type':Sequelize[_0xdfad('0x3')]},'interval':{'type':Sequelize[_0xdfad('0x3')],'defaultValue':_0xdfad('0x4')}}; \ No newline at end of file +var _0x5459=['exports','INTEGER','noop','TEXT','STRING','sequelize'];(function(_0x4cae38,_0x1f7372){var _0x4fc0d6=function(_0x105335){while(--_0x105335){_0x4cae38['push'](_0x4cae38['shift']());}};_0x4fc0d6(++_0x1f7372);}(_0x5459,0x1cd));var _0x9545=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x5459[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x9545('0x0'));module[_0x9545('0x1')]={'priority':{'type':Sequelize[_0x9545('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9545('0x3')},'appdata':{'type':Sequelize[_0x9545('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x9545('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 31b892f..85cd874 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 _0xf02c=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','error','stack','send','index','WhatsappApplication','rawAttributes','type','key','map','name','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x4247e8,_0x4d8a20){var _0x48288d=function(_0x3b3b5f){while(--_0x3b3b5f){_0x4247e8['push'](_0x4247e8['shift']());}};_0x48288d(++_0x4d8a20);}(_0xf02c,0x92));var _0xcf02=function(_0x381f23,_0x8f524c){_0x381f23=_0x381f23-0x0;var _0x36d50f=_0xf02c[_0x381f23];return _0x36d50f;};'use strict';var emlformat=require(_0xcf02('0x0'));var rimraf=require(_0xcf02('0x1'));var zipdir=require(_0xcf02('0x2'));var jsonpatch=require(_0xcf02('0x3'));var rp=require(_0xcf02('0x4'));var moment=require(_0xcf02('0x5'));var BPromise=require(_0xcf02('0x6'));var Mustache=require(_0xcf02('0x7'));var util=require(_0xcf02('0x8'));var path=require(_0xcf02('0x9'));var sox=require(_0xcf02('0xa'));var csv=require(_0xcf02('0xb'));var ejs=require(_0xcf02('0xc'));var fs=require('fs');var fs_extra=require(_0xcf02('0xd'));var _=require(_0xcf02('0xe'));var squel=require('squel');var crypto=require(_0xcf02('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcf02('0x10'));var Papa=require(_0xcf02('0x11'));var Redis=require(_0xcf02('0x12'));var authService=require(_0xcf02('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xcf02('0x14'));var hardwareService=require(_0xcf02('0x15'));var logger=require(_0xcf02('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xcf02('0x17'));var licenseUtil=require(_0xcf02('0x18'));var db=require(_0xcf02('0x19'))['db'];function respondWithStatusCode(_0x20b8c7,_0x2908b5){_0x2908b5=_0x2908b5||0xcc;return function(_0x5da922){if(_0x5da922){return _0x20b8c7[_0xcf02('0x1a')](_0x2908b5);}return _0x20b8c7[_0xcf02('0x1b')](_0x2908b5)[_0xcf02('0x1c')]();};}function respondWithResult(_0x304dc8,_0x3621a6){_0x3621a6=_0x3621a6||0xc8;return function(_0x19f1be){if(_0x19f1be){return _0x304dc8[_0xcf02('0x1b')](_0x3621a6)['json'](_0x19f1be);}};}function respondWithFilteredResult(_0x255ff7,_0x123d77){return function(_0x275870){if(_0x275870){var _0x5b2512=typeof _0x123d77[_0xcf02('0x1d')]===_0xcf02('0x1e')&&typeof _0x123d77[_0xcf02('0x1f')]===_0xcf02('0x1e');var _0x4a2d89=_0x275870['count'];var _0x4f3829=_0x5b2512?0x0:_0x123d77[_0xcf02('0x1d')];var _0x53a97e=_0x5b2512?_0x275870[_0xcf02('0x20')]:_0x123d77[_0xcf02('0x1d')]+_0x123d77[_0xcf02('0x1f')];var _0x4424bb;if(_0x53a97e>=_0x4a2d89){_0x53a97e=_0x4a2d89;_0x4424bb=0xc8;}else{_0x4424bb=0xce;}_0x255ff7['status'](_0x4424bb);return _0x255ff7['set'](_0xcf02('0x21'),_0x4f3829+'-'+_0x53a97e+'/'+_0x4a2d89)[_0xcf02('0x22')](_0x275870);}return null;};}function patchUpdates(_0x5bc7a2){return function(_0xff91e7){try{jsonpatch[_0xcf02('0x23')](_0xff91e7,_0x5bc7a2,!![]);}catch(_0x37f8b2){return BPromise[_0xcf02('0x24')](_0x37f8b2);}return _0xff91e7['save']();};}function saveUpdates(_0x18819a,_0x4260e2){return function(_0x3bf3f4){if(_0x3bf3f4){return _0x3bf3f4[_0xcf02('0x25')](_0x18819a)[_0xcf02('0x26')](function(_0x731aed){return _0x731aed;});}return null;};}function removeEntity(_0x17cce9,_0x2926b9){return function(_0x4f651c){if(_0x4f651c){return _0x4f651c['destroy']()['then'](function(){_0x17cce9[_0xcf02('0x1b')](0xcc)[_0xcf02('0x1c')]();});}};}function handleEntityNotFound(_0x2fd260,_0x67d43c){return function(_0xc424cc){if(!_0xc424cc){_0x2fd260[_0xcf02('0x1a')](0x194);}return _0xc424cc;};}function handleError(_0x207cfe,_0x1cccb0){_0x1cccb0=_0x1cccb0||0x1f4;return function(_0x4ee2b9){logger[_0xcf02('0x27')](_0x4ee2b9[_0xcf02('0x28')]);if(_0x4ee2b9['name']){delete _0x4ee2b9['name'];}_0x207cfe[_0xcf02('0x1b')](_0x1cccb0)[_0xcf02('0x29')](_0x4ee2b9);};}exports[_0xcf02('0x2a')]=function(_0x210256,_0x3cc47e){var _0x5eb4c5={},_0x2b8bc6={},_0x318c5e={'count':0x0,'rows':[]};var _0x32edbf=_['map'](db[_0xcf02('0x2b')][_0xcf02('0x2c')],function(_0xab73ca){return{'name':_0xab73ca['fieldName'],'type':_0xab73ca[_0xcf02('0x2d')][_0xcf02('0x2e')]};});_0x2b8bc6['model']=_[_0xcf02('0x2f')](_0x32edbf,_0xcf02('0x30'));_0x2b8bc6['query']=_[_0xcf02('0x31')](_0x210256[_0xcf02('0x32')]);_0x2b8bc6[_0xcf02('0x33')]=_[_0xcf02('0x34')](_0x2b8bc6[_0xcf02('0x35')],_0x2b8bc6['query']);_0x5eb4c5[_0xcf02('0x36')]=_[_0xcf02('0x34')](_0x2b8bc6[_0xcf02('0x35')],qs[_0xcf02('0x37')](_0x210256[_0xcf02('0x32')]['fields']));_0x5eb4c5['attributes']=_0x5eb4c5[_0xcf02('0x36')][_0xcf02('0x38')]?_0x5eb4c5[_0xcf02('0x36')]:_0x2b8bc6['model'];if(!_0x210256['query'][_0xcf02('0x39')](_0xcf02('0x3a'))){_0x5eb4c5[_0xcf02('0x1f')]=qs[_0xcf02('0x1f')](_0x210256[_0xcf02('0x32')]['limit']);_0x5eb4c5[_0xcf02('0x1d')]=qs[_0xcf02('0x1d')](_0x210256[_0xcf02('0x32')]['offset']);}_0x5eb4c5[_0xcf02('0x3b')]=qs[_0xcf02('0x3c')](_0x210256[_0xcf02('0x32')][_0xcf02('0x3c')]);_0x5eb4c5[_0xcf02('0x3d')]=qs['filters'](_[_0xcf02('0x3e')](_0x210256[_0xcf02('0x32')],_0x2b8bc6['filters']),_0x32edbf);if(_0x210256[_0xcf02('0x32')][_0xcf02('0x3f')]){_0x5eb4c5[_0xcf02('0x3d')]=_[_0xcf02('0x40')](_0x5eb4c5['where'],{'$or':_[_0xcf02('0x2f')](_0x32edbf,function(_0x2db3ba){if(_0x2db3ba[_0xcf02('0x2d')]!==_0xcf02('0x41')){var _0x3d6d1d={};_0x3d6d1d[_0x2db3ba[_0xcf02('0x30')]]={'$like':'%'+_0x210256['query'][_0xcf02('0x3f')]+'%'};return _0x3d6d1d;}})});}_0x5eb4c5=_[_0xcf02('0x40')]({},_0x5eb4c5,_0x210256[_0xcf02('0x42')]);var _0x301630={'where':_0x5eb4c5[_0xcf02('0x3d')]};return db['WhatsappApplication'][_0xcf02('0x20')](_0x301630)['then'](function(_0x24e2ff){_0x318c5e[_0xcf02('0x20')]=_0x24e2ff;if(_0x210256[_0xcf02('0x32')][_0xcf02('0x43')]){_0x5eb4c5['include']=[{'all':!![]}];}return db['WhatsappApplication'][_0xcf02('0x44')](_0x5eb4c5);})[_0xcf02('0x26')](function(_0x33372b){_0x318c5e[_0xcf02('0x45')]=_0x33372b;return _0x318c5e;})[_0xcf02('0x26')](respondWithFilteredResult(_0x3cc47e,_0x5eb4c5))[_0xcf02('0x46')](handleError(_0x3cc47e,null));};exports['show']=function(_0x256323,_0x45898d){var _0x345f41={'raw':!![],'where':{'id':_0x256323[_0xcf02('0x47')]['id']}},_0x2525d8={};_0x2525d8[_0xcf02('0x35')]=_['keys'](db[_0xcf02('0x2b')]['rawAttributes']);_0x2525d8[_0xcf02('0x32')]=_[_0xcf02('0x31')](_0x256323[_0xcf02('0x32')]);_0x2525d8['filters']=_[_0xcf02('0x34')](_0x2525d8['model'],_0x2525d8[_0xcf02('0x32')]);_0x345f41['attributes']=_[_0xcf02('0x34')](_0x2525d8[_0xcf02('0x35')],qs[_0xcf02('0x37')](_0x256323[_0xcf02('0x32')]['fields']));_0x345f41['attributes']=_0x345f41[_0xcf02('0x36')][_0xcf02('0x38')]?_0x345f41[_0xcf02('0x36')]:_0x2525d8[_0xcf02('0x35')];if(_0x256323[_0xcf02('0x32')][_0xcf02('0x43')]){_0x345f41['include']=[{'all':!![]}];}_0x345f41=_[_0xcf02('0x40')]({},_0x345f41,_0x256323[_0xcf02('0x42')]);return db[_0xcf02('0x2b')][_0xcf02('0x48')](_0x345f41)[_0xcf02('0x26')](handleEntityNotFound(_0x45898d,null))[_0xcf02('0x26')](respondWithResult(_0x45898d,null))[_0xcf02('0x46')](handleError(_0x45898d,null));};exports['create']=function(_0x58b78f,_0x46478e){return db['WhatsappApplication'][_0xcf02('0x49')](_0x58b78f['body'],{})[_0xcf02('0x26')](respondWithResult(_0x46478e,0xc9))[_0xcf02('0x46')](handleError(_0x46478e,null));};exports[_0xcf02('0x25')]=function(_0x175765,_0x29831c){if(_0x175765[_0xcf02('0x4a')]['id']){delete _0x175765[_0xcf02('0x4a')]['id'];}return db[_0xcf02('0x2b')][_0xcf02('0x48')]({'where':{'id':_0x175765[_0xcf02('0x47')]['id']}})['then'](handleEntityNotFound(_0x29831c,null))[_0xcf02('0x26')](saveUpdates(_0x175765[_0xcf02('0x4a')],null))[_0xcf02('0x26')](respondWithResult(_0x29831c,null))[_0xcf02('0x46')](handleError(_0x29831c,null));};exports['destroy']=function(_0x13d8f0,_0x444867){return db[_0xcf02('0x2b')][_0xcf02('0x48')]({'where':{'id':_0x13d8f0[_0xcf02('0x47')]['id']}})[_0xcf02('0x26')](handleEntityNotFound(_0x444867,null))[_0xcf02('0x26')](removeEntity(_0x444867,null))[_0xcf02('0x46')](handleError(_0x444867,null));}; \ No newline at end of file +var _0x2dd8=['findAll','rows','catch','show','keys','intersection','find','create','body','update','params','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','index','WhatsappApplication','rawAttributes','type','key','map','query','filters','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x2dd8,0x143));var _0x82dd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2dd8[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x82dd('0x0'));var rimraf=require(_0x82dd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x82dd('0x2'));var moment=require(_0x82dd('0x3'));var BPromise=require(_0x82dd('0x4'));var Mustache=require(_0x82dd('0x5'));var util=require(_0x82dd('0x6'));var path=require(_0x82dd('0x7'));var sox=require(_0x82dd('0x8'));var csv=require('to-csv');var ejs=require(_0x82dd('0x9'));var fs=require('fs');var fs_extra=require(_0x82dd('0xa'));var _=require(_0x82dd('0xb'));var squel=require(_0x82dd('0xc'));var crypto=require('crypto');var jsforce=require(_0x82dd('0xd'));var deskjs=require(_0x82dd('0xe'));var toCsv=require(_0x82dd('0xf'));var querystring=require(_0x82dd('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x82dd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x82dd('0x12'));var hardwareService=require(_0x82dd('0x13'));var logger=require(_0x82dd('0x14'))(_0x82dd('0x15'));var utils=require(_0x82dd('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x82dd('0x17'));var db=require(_0x82dd('0x18'))['db'];function respondWithStatusCode(_0x348f79,_0x18b9f6){_0x18b9f6=_0x18b9f6||0xcc;return function(_0x24d045){if(_0x24d045){return _0x348f79['sendStatus'](_0x18b9f6);}return _0x348f79['status'](_0x18b9f6)[_0x82dd('0x19')]();};}function respondWithResult(_0x255abd,_0x6fcc1b){_0x6fcc1b=_0x6fcc1b||0xc8;return function(_0x46beb0){if(_0x46beb0){return _0x255abd[_0x82dd('0x1a')](_0x6fcc1b)[_0x82dd('0x1b')](_0x46beb0);}};}function respondWithFilteredResult(_0x31b9c1,_0x275802){return function(_0x101eb7){if(_0x101eb7){var _0x1b90e0=typeof _0x275802[_0x82dd('0x1c')]===_0x82dd('0x1d')&&typeof _0x275802[_0x82dd('0x1e')]==='undefined';var _0x352400=_0x101eb7[_0x82dd('0x1f')];var _0x34d991=_0x1b90e0?0x0:_0x275802[_0x82dd('0x1c')];var _0x445fa0=_0x1b90e0?_0x101eb7[_0x82dd('0x1f')]:_0x275802[_0x82dd('0x1c')]+_0x275802[_0x82dd('0x1e')];var _0x26373a;if(_0x445fa0>=_0x352400){_0x445fa0=_0x352400;_0x26373a=0xc8;}else{_0x26373a=0xce;}_0x31b9c1[_0x82dd('0x1a')](_0x26373a);return _0x31b9c1[_0x82dd('0x20')](_0x82dd('0x21'),_0x34d991+'-'+_0x445fa0+'/'+_0x352400)[_0x82dd('0x1b')](_0x101eb7);}return null;};}function patchUpdates(_0x5ebea8){return function(_0x45205d){try{jsonpatch[_0x82dd('0x22')](_0x45205d,_0x5ebea8,!![]);}catch(_0x28352e){return BPromise[_0x82dd('0x23')](_0x28352e);}return _0x45205d[_0x82dd('0x24')]();};}function saveUpdates(_0x251b5b,_0x15f5b8){return function(_0x45e92c){if(_0x45e92c){return _0x45e92c['update'](_0x251b5b)['then'](function(_0x1c095e){return _0x1c095e;});}return null;};}function removeEntity(_0x96dbc0,_0x4e1463){return function(_0x59a173){if(_0x59a173){return _0x59a173[_0x82dd('0x25')]()[_0x82dd('0x26')](function(){_0x96dbc0[_0x82dd('0x1a')](0xcc)[_0x82dd('0x19')]();});}};}function handleEntityNotFound(_0x4609c1,_0x1233e4){return function(_0x17eb32){if(!_0x17eb32){_0x4609c1[_0x82dd('0x27')](0x194);}return _0x17eb32;};}function handleError(_0x1ae382,_0x1d27f1){_0x1d27f1=_0x1d27f1||0x1f4;return function(_0xe6aacd){logger[_0x82dd('0x28')](_0xe6aacd[_0x82dd('0x29')]);if(_0xe6aacd[_0x82dd('0x2a')]){delete _0xe6aacd['name'];}_0x1ae382[_0x82dd('0x1a')](_0x1d27f1)[_0x82dd('0x2b')](_0xe6aacd);};}exports[_0x82dd('0x2c')]=function(_0x53965f,_0x15da13){var _0x5238a2={},_0x15f31f={},_0x93fd00={'count':0x0,'rows':[]};var _0x2b4a63=_['map'](db[_0x82dd('0x2d')][_0x82dd('0x2e')],function(_0x47c0ff){return{'name':_0x47c0ff['fieldName'],'type':_0x47c0ff[_0x82dd('0x2f')][_0x82dd('0x30')]};});_0x15f31f['model']=_[_0x82dd('0x31')](_0x2b4a63,_0x82dd('0x2a'));_0x15f31f[_0x82dd('0x32')]=_['keys'](_0x53965f[_0x82dd('0x32')]);_0x15f31f[_0x82dd('0x33')]=_['intersection'](_0x15f31f['model'],_0x15f31f[_0x82dd('0x32')]);_0x5238a2[_0x82dd('0x34')]=_['intersection'](_0x15f31f[_0x82dd('0x35')],qs[_0x82dd('0x36')](_0x53965f[_0x82dd('0x32')][_0x82dd('0x36')]));_0x5238a2[_0x82dd('0x34')]=_0x5238a2['attributes'][_0x82dd('0x37')]?_0x5238a2[_0x82dd('0x34')]:_0x15f31f['model'];if(!_0x53965f[_0x82dd('0x32')][_0x82dd('0x38')](_0x82dd('0x39'))){_0x5238a2[_0x82dd('0x1e')]=qs['limit'](_0x53965f[_0x82dd('0x32')][_0x82dd('0x1e')]);_0x5238a2[_0x82dd('0x1c')]=qs[_0x82dd('0x1c')](_0x53965f[_0x82dd('0x32')][_0x82dd('0x1c')]);}_0x5238a2[_0x82dd('0x3a')]=qs[_0x82dd('0x3b')](_0x53965f['query'][_0x82dd('0x3b')]);_0x5238a2['where']=qs[_0x82dd('0x33')](_[_0x82dd('0x3c')](_0x53965f[_0x82dd('0x32')],_0x15f31f['filters']),_0x2b4a63);if(_0x53965f[_0x82dd('0x32')][_0x82dd('0x3d')]){_0x5238a2[_0x82dd('0x3e')]=_[_0x82dd('0x3f')](_0x5238a2['where'],{'$or':_['map'](_0x2b4a63,function(_0xc3d6d9){if(_0xc3d6d9[_0x82dd('0x2f')]!==_0x82dd('0x40')){var _0x19c736={};_0x19c736[_0xc3d6d9['name']]={'$like':'%'+_0x53965f['query'][_0x82dd('0x3d')]+'%'};return _0x19c736;}})});}_0x5238a2=_[_0x82dd('0x3f')]({},_0x5238a2,_0x53965f['options']);var _0x3a905d={'where':_0x5238a2[_0x82dd('0x3e')]};return db[_0x82dd('0x2d')][_0x82dd('0x1f')](_0x3a905d)[_0x82dd('0x26')](function(_0x104568){_0x93fd00[_0x82dd('0x1f')]=_0x104568;if(_0x53965f[_0x82dd('0x32')][_0x82dd('0x41')]){_0x5238a2[_0x82dd('0x42')]=[{'all':!![]}];}return db[_0x82dd('0x2d')][_0x82dd('0x43')](_0x5238a2);})[_0x82dd('0x26')](function(_0x27cfd6){_0x93fd00[_0x82dd('0x44')]=_0x27cfd6;return _0x93fd00;})[_0x82dd('0x26')](respondWithFilteredResult(_0x15da13,_0x5238a2))[_0x82dd('0x45')](handleError(_0x15da13,null));};exports[_0x82dd('0x46')]=function(_0x41d36,_0x5bcc32){var _0x644d3a={'raw':!![],'where':{'id':_0x41d36['params']['id']}},_0x4cd127={};_0x4cd127[_0x82dd('0x35')]=_[_0x82dd('0x47')](db[_0x82dd('0x2d')]['rawAttributes']);_0x4cd127[_0x82dd('0x32')]=_[_0x82dd('0x47')](_0x41d36[_0x82dd('0x32')]);_0x4cd127[_0x82dd('0x33')]=_[_0x82dd('0x48')](_0x4cd127[_0x82dd('0x35')],_0x4cd127['query']);_0x644d3a[_0x82dd('0x34')]=_[_0x82dd('0x48')](_0x4cd127[_0x82dd('0x35')],qs[_0x82dd('0x36')](_0x41d36[_0x82dd('0x32')]['fields']));_0x644d3a[_0x82dd('0x34')]=_0x644d3a[_0x82dd('0x34')]['length']?_0x644d3a[_0x82dd('0x34')]:_0x4cd127[_0x82dd('0x35')];if(_0x41d36[_0x82dd('0x32')][_0x82dd('0x41')]){_0x644d3a[_0x82dd('0x42')]=[{'all':!![]}];}_0x644d3a=_[_0x82dd('0x3f')]({},_0x644d3a,_0x41d36['options']);return db[_0x82dd('0x2d')][_0x82dd('0x49')](_0x644d3a)[_0x82dd('0x26')](handleEntityNotFound(_0x5bcc32,null))[_0x82dd('0x26')](respondWithResult(_0x5bcc32,null))['catch'](handleError(_0x5bcc32,null));};exports[_0x82dd('0x4a')]=function(_0x418fd3,_0x3035b8){return db['WhatsappApplication']['create'](_0x418fd3[_0x82dd('0x4b')],{})[_0x82dd('0x26')](respondWithResult(_0x3035b8,0xc9))[_0x82dd('0x45')](handleError(_0x3035b8,null));};exports[_0x82dd('0x4c')]=function(_0x208e4f,_0x4ff539){if(_0x208e4f['body']['id']){delete _0x208e4f[_0x82dd('0x4b')]['id'];}return db[_0x82dd('0x2d')]['find']({'where':{'id':_0x208e4f['params']['id']}})['then'](handleEntityNotFound(_0x4ff539,null))[_0x82dd('0x26')](saveUpdates(_0x208e4f['body'],null))[_0x82dd('0x26')](respondWithResult(_0x4ff539,null))[_0x82dd('0x45')](handleError(_0x4ff539,null));};exports[_0x82dd('0x25')]=function(_0x96e9f1,_0x24fa02){return db[_0x82dd('0x2d')][_0x82dd('0x49')]({'where':{'id':_0x96e9f1[_0x82dd('0x4d')]['id']}})[_0x82dd('0x26')](handleEntityNotFound(_0x24fa02,null))['then'](removeEntity(_0x24fa02,null))[_0x82dd('0x45')](handleError(_0x24fa02,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 1ff94c8..54cfc76 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 _0x89c3=['bluebird','request-promise','path','../../config/environment','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x582ddb,_0x41756d){var _0x13e893=function(_0x2031bc){while(--_0x2031bc){_0x582ddb['push'](_0x582ddb['shift']());}};_0x13e893(++_0x41756d);}(_0x89c3,0xff));var _0x389c=function(_0x5a633e,_0x5dfdf4){_0x5a633e=_0x5a633e-0x0;var _0xd542e0=_0x89c3[_0x5a633e];return _0xd542e0;};'use strict';var _=require(_0x389c('0x0'));var util=require(_0x389c('0x1'));var logger=require(_0x389c('0x2'))(_0x389c('0x3'));var moment=require(_0x389c('0x4'));var BPromise=require(_0x389c('0x5'));var rp=require(_0x389c('0x6'));var fs=require('fs');var path=require(_0x389c('0x7'));var rimraf=require('rimraf');var config=require(_0x389c('0x8'));var attributes=require('./whatsappApplication.attributes');module[_0x389c('0x9')]=function(_0x4bece6,_0x51f5f5){return _0x4bece6[_0x389c('0xa')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x389c('0xb'),'collate':_0x389c('0xc')});}; \ No newline at end of file +var _0x7d9f=['api','moment','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','define','whatsapp_applications','utf8mb4','lodash','util','../../config/logger'];(function(_0x47173d,_0x1cee9d){var _0x4d3e2a=function(_0x22bba8){while(--_0x22bba8){_0x47173d['push'](_0x47173d['shift']());}};_0x4d3e2a(++_0x1cee9d);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x4544c8,_0x5de2d7){_0x4544c8=_0x4544c8-0x0;var _0x5afe0e=_0x7d9f[_0x4544c8];return _0x5afe0e;};'use strict';var _=require(_0xf7d9('0x0'));var util=require(_0xf7d9('0x1'));var logger=require(_0xf7d9('0x2'))(_0xf7d9('0x3'));var moment=require(_0xf7d9('0x4'));var BPromise=require('bluebird');var rp=require(_0xf7d9('0x5'));var fs=require('fs');var path=require(_0xf7d9('0x6'));var rimraf=require(_0xf7d9('0x7'));var config=require(_0xf7d9('0x8'));var attributes=require(_0xf7d9('0x9'));module['exports']=function(_0x4b50c7,_0x2eb0f1){return _0x4b50c7[_0xf7d9('0xa')]('WhatsappApplication',attributes,{'tableName':_0xf7d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf7d9('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 29b91f0..54d474a 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 _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','WhatsappApplication,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x37d58d,_0x1c0f3c){var _0x5ec189=function(_0x5bbf94){while(--_0x5bbf94){_0x37d58d['push'](_0x37d58d['shift']());}};_0x5ec189(++_0x1c0f3c);}(_0x9c44,0x178));var _0x49c4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9c44[_0x422905];return _0x33dc6c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('WhatsappApplication,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file +var _0xa8a8=['stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x591292,_0x42bc77){var _0x324652=function(_0x2d610f){while(--_0x2d610f){_0x591292['push'](_0x591292['shift']());}};_0x324652(++_0x42bc77);}(_0xa8a8,0xec));var _0x8a8a=function(_0x1ac1c4,_0x36010b){_0x1ac1c4=_0x1ac1c4-0x0;var _0x4ca336=_0xa8a8[_0x1ac1c4];return _0x4ca336;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var BPromise=require(_0x8a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a8a('0x4'));var db=require(_0x8a8a('0x5'))['db'];var utils=require(_0x8a8a('0x6'));var logger=require(_0x8a8a('0x7'))(_0x8a8a('0x8'));var config=require(_0x8a8a('0x9'));var jayson=require(_0x8a8a('0xa'));var client=jayson[_0x8a8a('0xb')][_0x8a8a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x315fe9,_0x1d7121,_0x8e7aa0){return new BPromise(function(_0x4225b9,_0xecaa6f){return client[_0x8a8a('0xd')](_0x315fe9,_0x8e7aa0)['then'](function(_0x576ef9){logger[_0x8a8a('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));logger[_0x8a8a('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'),JSON[_0x8a8a('0x11')](_0x576ef9));if(_0x576ef9[_0x8a8a('0x12')]){if(_0x576ef9['error'][_0x8a8a('0x13')]===0x1f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')]['message']);return _0xecaa6f(_0x576ef9[_0x8a8a('0x12')]['message']);}logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);return _0x4225b9(_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);}else{logger[_0x8a8a('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));_0x4225b9(_0x576ef9['result'][_0x8a8a('0x15')]);}})[_0x8a8a('0x16')](function(_0x46a4f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x46a4f4);_0xecaa6f(_0x46a4f4);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 65312e8..0722085 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 _0xa0a1=['whatsappinteraction:update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./whatsappInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','getMessages','/:id/download','download','create','post','/:id/messages','addMessage','tracked','whatsapp','whatsappinteraction:addtags','addTags'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa0a1,0x15b));var _0x1a0a=function(_0x146ddc,_0x400bcf){_0x146ddc=_0x146ddc-0x0;var _0xedfe8f=_0xa0a1[_0x146ddc];return _0xedfe8f;};'use strict';var multer=require(_0x1a0a('0x0'));var util=require('util');var path=require(_0x1a0a('0x1'));var timeout=require(_0x1a0a('0x2'));var express=require(_0x1a0a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1a0a('0x4'));var interaction=require(_0x1a0a('0x5'));var config=require('../../config/environment');var controller=require(_0x1a0a('0x6'));router[_0x1a0a('0x7')]('/',auth['isAuthenticated'](),controller[_0x1a0a('0x8')]);router[_0x1a0a('0x7')](_0x1a0a('0x9'),auth[_0x1a0a('0xa')](),controller[_0x1a0a('0xb')]);router['get'](_0x1a0a('0xc'),auth[_0x1a0a('0xa')](),controller[_0x1a0a('0xd')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x1a0a('0xe')]);router[_0x1a0a('0x7')](_0x1a0a('0xf'),auth['isAuthenticated'](),controller[_0x1a0a('0x10')]);router['post']('/',auth[_0x1a0a('0xa')](),controller[_0x1a0a('0x11')]);router[_0x1a0a('0x12')](_0x1a0a('0x13'),auth[_0x1a0a('0xa')](),controller[_0x1a0a('0x14')]);router[_0x1a0a('0x12')]('/:id/tags',auth[_0x1a0a('0xa')](),interaction[_0x1a0a('0x15')](_0x1a0a('0x16'),_0x1a0a('0x17')),controller[_0x1a0a('0x18')]);router['put'](_0x1a0a('0xc'),auth[_0x1a0a('0xa')](),interaction[_0x1a0a('0x15')]('whatsapp',_0x1a0a('0x19')),controller['update']);router[_0x1a0a('0x1a')]('/:id',auth['isAuthenticated'](),interaction[_0x1a0a('0x15')](_0x1a0a('0x16'),_0x1a0a('0x1b')),controller[_0x1a0a('0x1c')]);router['delete']('/:id/tags',auth[_0x1a0a('0xa')](),controller[_0x1a0a('0x1d')]);module[_0x1a0a('0x1e')]=router; \ No newline at end of file +var _0x5162=['whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','delete','removeTags','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','whatsapp'];(function(_0x41074d,_0x19b20f){var _0x1f61b9=function(_0x34458c){while(--_0x34458c){_0x41074d['push'](_0x41074d['shift']());}};_0x1f61b9(++_0x19b20f);}(_0x5162,0x103));var _0x2516=function(_0xb89931,_0x461b9e){_0xb89931=_0xb89931-0x0;var _0x324b86=_0x5162[_0xb89931];return _0x324b86;};'use strict';var multer=require(_0x2516('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2516('0x1')]();var fs_extra=require(_0x2516('0x2'));var auth=require(_0x2516('0x3'));var interaction=require(_0x2516('0x4'));var config=require(_0x2516('0x5'));var controller=require(_0x2516('0x6'));router[_0x2516('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2516('0x8'),auth[_0x2516('0x9')](),controller[_0x2516('0xa')]);router[_0x2516('0x7')](_0x2516('0xb'),auth[_0x2516('0x9')](),controller[_0x2516('0xc')]);router['get'](_0x2516('0xd'),auth[_0x2516('0x9')](),controller[_0x2516('0xe')]);router['get']('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x2516('0xf')]('/',auth[_0x2516('0x9')](),controller[_0x2516('0x10')]);router[_0x2516('0xf')]('/:id/messages',auth[_0x2516('0x9')](),controller[_0x2516('0x11')]);router[_0x2516('0xf')](_0x2516('0x12'),auth[_0x2516('0x9')](),interaction[_0x2516('0x13')](_0x2516('0x14'),_0x2516('0x15')),controller[_0x2516('0x16')]);router[_0x2516('0x17')](_0x2516('0xb'),auth[_0x2516('0x9')](),interaction[_0x2516('0x13')](_0x2516('0x14'),_0x2516('0x18')),controller['update']);router[_0x2516('0x19')](_0x2516('0xb'),auth[_0x2516('0x9')](),interaction['tracked'](_0x2516('0x14'),'whatsappinteraction:destroy'),controller['destroy']);router[_0x2516('0x19')](_0x2516('0x12'),auth[_0x2516('0x9')](),controller[_0x2516('0x1a')]);module[_0x2516('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index d7211c6..f5f7f66 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 _0xe4b8=['out','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x124f94,_0x4c8dda){var _0x5e8d66=function(_0x3da30f){while(--_0x3da30f){_0x124f94['push'](_0x124f94['shift']());}};_0x5e8d66(++_0x4c8dda);}(_0xe4b8,0x179));var _0x8e4b=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xe4b8[_0x2e4e19];return _0x9ba20b;};'use strict';var Sequelize=require(_0x8e4b('0x0'));var moment=require(_0x8e4b('0x1'));module[_0x8e4b('0x2')]={'closed':{'type':Sequelize[_0x8e4b('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8e4b('0x4')]},'disposition':{'type':Sequelize[_0x8e4b('0x5')]},'secondDisposition':{'type':Sequelize[_0x8e4b('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x8e4b('0x5')]},'read1stAt':{'type':Sequelize[_0x8e4b('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x8e4b('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8e4b('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x8e4b('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa23f=['DATE','STRING','ENUM','out','BOOLEAN','sequelize','moment'];(function(_0x3f78e5,_0x5eaa2b){var _0x4d5732=function(_0x2022ba){while(--_0x2022ba){_0x3f78e5['push'](_0x3f78e5['shift']());}};_0x4d5732(++_0x5eaa2b);}(_0xa23f,0x7c));var _0xfa23=function(_0x593cd3,_0x187cb7){_0x593cd3=_0x593cd3-0x0;var _0x3142f9=_0xa23f[_0x593cd3];return _0x3142f9;};'use strict';var Sequelize=require(_0xfa23('0x0'));var moment=require(_0xfa23('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xfa23('0x2')]},'disposition':{'type':Sequelize[_0xfa23('0x3')]},'secondDisposition':{'type':Sequelize[_0xfa23('0x3')]},'thirdDisposition':{'type':Sequelize[_0xfa23('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xfa23('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xfa23('0x4')]('in',_0xfa23('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xfa23('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xfa23('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xfa23('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 6f5e776..cb09814 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 _0x75d4=['rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','api','../../config/environment','../../mysqldb','defaults','redis','./whatsappInteraction.socket','register','sendStatus','status','end','json','limit','count','offset','set','Content-Range','then','destroy','error','stack','name','send','map','WhatsappInteraction','rawAttributes','fieldName','type','key','getOptions','whatsapp','query','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','options','find','create','update','body','describe','addMessage','WhatsappMessage','ids','omit','hasOwnProperty','nolimit','order','sort','where','pick','WhatsappInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','merge','findAll','rows','setTags','spread','color','whatsappInteractionTags:save','removeTags','download','toString','join','server','tmp','root','attachments','push','User','fullname','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','read','Account','Owner','get','mkdirSync','N.A.','closed','closedAt','disposition','basename','existsSync','createWriteStream','out','System','secret','value','views','.pdf','Whatsapp','createPdfFromHTML','log','err'];(function(_0x52aa8f,_0x4ca3bb){var _0x22079e=function(_0x51c7be){while(--_0x51c7be){_0x52aa8f['push'](_0x52aa8f['shift']());}};_0x22079e(++_0x4ca3bb);}(_0x75d4,0x16e));var _0x475d=function(_0x53861f,_0x3090d6){_0x53861f=_0x53861f-0x0;var _0x1ac6d4=_0x75d4[_0x53861f];return _0x1ac6d4;};'use strict';var rimraf=require(_0x475d('0x0'));var zipdir=require(_0x475d('0x1'));var moment=require(_0x475d('0x2'));var BPromise=require(_0x475d('0x3'));var util=require(_0x475d('0x4'));var path=require(_0x475d('0x5'));var ejs=require(_0x475d('0x6'));var fs=require('fs');var _=require(_0x475d('0x7'));var Redis=require(_0x475d('0x8'));var interaction=require(_0x475d('0x9'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0x475d('0xa'));var config=require(_0x475d('0xb'));var db=require(_0x475d('0xc'))['db'];config['redis']=_[_0x475d('0xd')](config[_0x475d('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x475d('0xe')]));require(_0x475d('0xf'))[_0x475d('0x10')](socket);function respondWithStatusCode(_0x42dbe4,_0x1d7a25){_0x1d7a25=_0x1d7a25||0xcc;return function(_0x64e08){if(_0x64e08){return _0x42dbe4[_0x475d('0x11')](_0x1d7a25);}return _0x42dbe4[_0x475d('0x12')](_0x1d7a25)[_0x475d('0x13')]();};}function respondWithResult(_0x586ac0,_0x420bfe){_0x420bfe=_0x420bfe||0xc8;return function(_0xfb10bc){if(_0xfb10bc){return _0x586ac0[_0x475d('0x12')](_0x420bfe)[_0x475d('0x14')](_0xfb10bc);}};}function respondWithFilteredResult(_0x40aea9,_0x14100a){return function(_0x4f7b81){if(_0x4f7b81){var _0x4ff91b=typeof _0x14100a['offset']==='undefined'&&typeof _0x14100a[_0x475d('0x15')]==='undefined';var _0x5d4168=_0x4f7b81[_0x475d('0x16')];var _0xf9f5c7=_0x4ff91b?0x0:_0x14100a[_0x475d('0x17')];var _0x2613d2=_0x4ff91b?_0x4f7b81[_0x475d('0x16')]:_0x14100a[_0x475d('0x17')]+_0x14100a[_0x475d('0x15')];var _0xc57bc4;if(_0x2613d2>=_0x5d4168){_0x2613d2=_0x5d4168;_0xc57bc4=0xc8;}else{_0xc57bc4=0xce;}_0x40aea9['status'](_0xc57bc4);return _0x40aea9[_0x475d('0x18')](_0x475d('0x19'),_0xf9f5c7+'-'+_0x2613d2+'/'+_0x5d4168)['json'](_0x4f7b81);}return null;};}function saveUpdates(_0x4ddd85){return function(_0x2d7007){if(_0x2d7007){return _0x2d7007['update'](_0x4ddd85)[_0x475d('0x1a')](function(_0x2344d7){return _0x2344d7;});}return null;};}function removeEntity(_0x5e5a07){return function(_0x3ecf1c){if(_0x3ecf1c){return _0x3ecf1c[_0x475d('0x1b')]()[_0x475d('0x1a')](function(){_0x5e5a07[_0x475d('0x12')](0xcc)[_0x475d('0x13')]();});}};}function handleEntityNotFound(_0x272859){return function(_0x51c618){if(!_0x51c618){_0x272859['sendStatus'](0x194);}return _0x51c618;};}function handleError(_0x239fad,_0x5330f9){_0x5330f9=_0x5330f9||0x1f4;return function(_0x44e3f6){logger[_0x475d('0x1c')](_0x44e3f6[_0x475d('0x1d')]);if(_0x44e3f6['name']){delete _0x44e3f6[_0x475d('0x1e')];}_0x239fad[_0x475d('0x12')](_0x5330f9)[_0x475d('0x1f')](_0x44e3f6);};}exports['index']=function(_0x13e35a,_0x299aa8){var _0x4365f0={};var _0x54922a=_[_0x475d('0x20')](db[_0x475d('0x21')][_0x475d('0x22')],function(_0x34ddfa){return{'name':_0x34ddfa[_0x475d('0x23')],'type':_0x34ddfa[_0x475d('0x24')][_0x475d('0x25')]};});_0x4365f0=qs[_0x475d('0x26')](_0x54922a,_0x13e35a);return interaction['findAll'](_0x475d('0x27'),_0x13e35a[_0x475d('0x28')],_0x13e35a['user'],_0x4365f0,_0x54922a)[_0x475d('0x1a')](respondWithFilteredResult(_0x299aa8,_0x4365f0))[_0x475d('0x29')](handleError(_0x299aa8,null));};exports[_0x475d('0x2a')]=function(_0x3ee84d,_0x15ca1c){var _0x105ff0={'raw':![],'where':{'id':_0x3ee84d[_0x475d('0x2b')]['id']}},_0x480ce9={};_0x480ce9[_0x475d('0x2c')]=_[_0x475d('0x2d')](db[_0x475d('0x21')][_0x475d('0x22')]);_0x480ce9[_0x475d('0x28')]=_[_0x475d('0x2d')](_0x3ee84d[_0x475d('0x28')]);_0x480ce9[_0x475d('0x2e')]=_[_0x475d('0x2f')](_0x480ce9['model'],_0x480ce9[_0x475d('0x28')]);_0x105ff0[_0x475d('0x30')]=_[_0x475d('0x2f')](_0x480ce9['model'],qs[_0x475d('0x31')](_0x3ee84d[_0x475d('0x28')][_0x475d('0x31')]));_0x105ff0['attributes']=_0x105ff0[_0x475d('0x30')][_0x475d('0x32')]?_0x105ff0[_0x475d('0x30')]:_0x480ce9[_0x475d('0x2c')];if(_0x3ee84d[_0x475d('0x28')][_0x475d('0x33')]){_0x105ff0[_0x475d('0x34')]=[{'all':!![]}];}_0x105ff0=_['merge']({},_0x105ff0,_0x3ee84d[_0x475d('0x35')]);return db['WhatsappInteraction'][_0x475d('0x36')](_0x105ff0)[_0x475d('0x1a')](handleEntityNotFound(_0x15ca1c,null))['then'](respondWithResult(_0x15ca1c,null))[_0x475d('0x29')](handleError(_0x15ca1c,null));};exports[_0x475d('0x37')]=function(_0x5d9eb5,_0x58f7b2){return db['WhatsappInteraction'][_0x475d('0x37')](_0x5d9eb5['body'],{})[_0x475d('0x1a')](respondWithResult(_0x58f7b2,0xc9))[_0x475d('0x29')](handleError(_0x58f7b2,null));};exports[_0x475d('0x38')]=function(_0x29d786,_0x31535b){if(_0x29d786[_0x475d('0x39')]['id']){delete _0x29d786[_0x475d('0x39')]['id'];}return db[_0x475d('0x21')][_0x475d('0x36')]({'where':{'id':_0x29d786[_0x475d('0x2b')]['id']}})[_0x475d('0x1a')](handleEntityNotFound(_0x31535b,null))[_0x475d('0x1a')](saveUpdates(_0x29d786[_0x475d('0x39')],null))['then'](respondWithResult(_0x31535b,null))[_0x475d('0x29')](handleError(_0x31535b,null));};exports[_0x475d('0x1b')]=function(_0x1248d4,_0xa2ec1){return db['WhatsappInteraction'][_0x475d('0x36')]({'where':{'id':_0x1248d4[_0x475d('0x2b')]['id']}})[_0x475d('0x1a')](handleEntityNotFound(_0xa2ec1,null))[_0x475d('0x1a')](removeEntity(_0xa2ec1,null))[_0x475d('0x29')](handleError(_0xa2ec1,null));};exports['describe']=function(_0x3e0522,_0x2fee96){return db['WhatsappInteraction'][_0x475d('0x3a')]()[_0x475d('0x1a')](respondWithResult(_0x2fee96,null))['catch'](handleError(_0x2fee96,null));};exports[_0x475d('0x3b')]=function(_0x42d555,_0x3bdf63){return db[_0x475d('0x3c')][_0x475d('0x36')]({'where':{'id':_0x42d555[_0x475d('0x2b')]['id']}})[_0x475d('0x1a')](handleEntityNotFound(_0x3bdf63,null))[_0x475d('0x1a')](function(_0x24705e){if(_0x24705e){return _0x24705e[_0x475d('0x3b')](_0x42d555[_0x475d('0x39')][_0x475d('0x3d')],_[_0x475d('0x3e')](_0x42d555['body'],[_0x475d('0x3d'),'id'])||{});}})['then'](respondWithResult(_0x3bdf63,null))['catch'](handleError(_0x3bdf63,null));};exports['getMessages']=function(_0x252664,_0x10e24a){var _0x44c888={'raw':![],'where':{}};var _0x16b753={};var _0x44c4b1={'count':0x0,'rows':[]};return db[_0x475d('0x21')]['findOne']({'where':{'id':_0x252664['params']['id']}})['then'](handleEntityNotFound(_0x10e24a,null))[_0x475d('0x1a')](function(_0x4649c2){if(_0x4649c2){_0x16b753[_0x475d('0x2c')]=_[_0x475d('0x2d')](db[_0x475d('0x3c')][_0x475d('0x22')]);_0x16b753[_0x475d('0x28')]=_[_0x475d('0x2d')](_0x252664[_0x475d('0x28')]);_0x16b753[_0x475d('0x2e')]=_['intersection'](_0x16b753[_0x475d('0x2c')],_0x16b753[_0x475d('0x28')]);_0x44c888[_0x475d('0x30')]=_[_0x475d('0x2f')](_0x16b753[_0x475d('0x2c')],qs[_0x475d('0x31')](_0x252664[_0x475d('0x28')][_0x475d('0x31')]));_0x44c888[_0x475d('0x30')]=_0x44c888[_0x475d('0x30')][_0x475d('0x32')]?_0x44c888[_0x475d('0x30')]:_0x16b753[_0x475d('0x2c')];if(!_0x252664[_0x475d('0x28')][_0x475d('0x3f')](_0x475d('0x40'))){_0x44c888[_0x475d('0x15')]=qs['limit'](_0x252664[_0x475d('0x28')]['limit']);_0x44c888[_0x475d('0x17')]=qs['offset'](_0x252664[_0x475d('0x28')][_0x475d('0x17')]);}_0x44c888[_0x475d('0x41')]=qs[_0x475d('0x42')](_0x252664[_0x475d('0x28')][_0x475d('0x42')]);_0x44c888[_0x475d('0x43')]=qs[_0x475d('0x2e')](_[_0x475d('0x44')](_0x252664[_0x475d('0x28')],_0x16b753[_0x475d('0x2e')]));_0x44c888[_0x475d('0x43')][_0x475d('0x45')]=_0x4649c2['id'];if(_0x252664[_0x475d('0x28')][_0x475d('0x46')]){_0x44c888[_0x475d('0x43')]=_['merge'](_0x44c888[_0x475d('0x43')],{'$or':_[_0x475d('0x20')](_0x44c888[_0x475d('0x30')],function(_0x314961){var _0x2de383={};_0x2de383[_0x314961]={'$like':'%'+_0x252664[_0x475d('0x28')]['filter']+'%'};return _0x2de383;})});}if(_0x252664[_0x475d('0x28')]['$gte']){var _0x2bac31=_0x252664['query'][_0x475d('0x47')][_0x475d('0x48')](',');var _0x5ea4e0={};_0x5ea4e0[_0x2bac31[0x0]]={'$gte':moment(_0x2bac31[0x1])[_0x475d('0x49')](_0x475d('0x4a'))};_0x44c888[_0x475d('0x43')]=_[_0x475d('0x4b')](_0x44c888[_0x475d('0x43')],_0x5ea4e0);}_0x44c888=_[_0x475d('0x4b')]({},_0x44c888,_0x252664['options']);return db[_0x475d('0x3c')][_0x475d('0x16')]({'where':_0x44c888[_0x475d('0x43')]})[_0x475d('0x1a')](function(_0x1047ce){_0x44c4b1[_0x475d('0x16')]=_0x1047ce;if(_0x252664[_0x475d('0x28')]['includeAll']){_0x44c888[_0x475d('0x34')]=[{'all':!![]}];}return db[_0x475d('0x3c')][_0x475d('0x4c')](_0x44c888);})[_0x475d('0x1a')](function(_0x4308e4){_0x44c4b1[_0x475d('0x4d')]=_0x4308e4;return _0x44c4b1;});}})[_0x475d('0x1a')](respondWithFilteredResult(_0x10e24a,_0x44c888))[_0x475d('0x29')](handleError(_0x10e24a,null));};exports['addTags']=function(_0x108954,_0x2856c3){return db[_0x475d('0x21')][_0x475d('0x36')]({'where':{'id':_0x108954[_0x475d('0x2b')]['id']}})[_0x475d('0x1a')](handleEntityNotFound(_0x2856c3,null))[_0x475d('0x1a')](function(_0x5dc9e0){if(_0x5dc9e0){return _0x5dc9e0[_0x475d('0x4e')](_0x108954[_0x475d('0x39')]['ids'],_[_0x475d('0x3e')](_0x108954[_0x475d('0x39')],[_0x475d('0x3d'),'id'])||{})[_0x475d('0x4f')](function(){return db['Tag'][_0x475d('0x4c')]({'attributes':['id',_0x475d('0x1e'),_0x475d('0x50')],'where':{'id':_0x108954[_0x475d('0x39')][_0x475d('0x3d')]}});})[_0x475d('0x1a')](function(_0x84a1d7){socket['emit'](_0x475d('0x51'),{'id':Number(_0x108954[_0x475d('0x2b')]['id']),'tags':_0x84a1d7||[]});return{'id':Number(_0x108954['params']['id']),'tags':_0x84a1d7||[]};});}})[_0x475d('0x1a')](respondWithResult(_0x2856c3,null))[_0x475d('0x29')](handleError(_0x2856c3,null));};exports[_0x475d('0x52')]=function(_0x4fe7e1,_0x1a06a6){return db['WhatsappInteraction'][_0x475d('0x36')]({'where':{'id':_0x4fe7e1[_0x475d('0x2b')]['id']}})[_0x475d('0x1a')](handleEntityNotFound(_0x1a06a6,null))[_0x475d('0x1a')](function(_0x5c3254){if(_0x5c3254){return _0x5c3254[_0x475d('0x52')](_0x4fe7e1[_0x475d('0x28')][_0x475d('0x3d')]);}})[_0x475d('0x1a')](respondWithStatusCode(_0x1a06a6,null))[_0x475d('0x29')](handleError(_0x1a06a6,null));};exports[_0x475d('0x53')]=function(_0x2d3011,_0x3c8cc8){var _0xe51a83=moment()['unix']()[_0x475d('0x54')]();var _0x2dc0bb=path[_0x475d('0x55')](config['root'],_0x475d('0x56'),'files',_0x475d('0x57'));var _0x4fc1a7=path[_0x475d('0x55')](config[_0x475d('0x58')],_0x475d('0x56'),'files',_0x475d('0x59'));var _0x160ead=path[_0x475d('0x55')](_0x2dc0bb,_0xe51a83);var _0x279b2b=util['format']('transcript-%d-%s.zip',_0x2d3011[_0x475d('0x2b')]['id'],_0xe51a83);var _0x23168f=path[_0x475d('0x55')](_0x2dc0bb,_0x279b2b);var _0x4e13c0=[];_0x4e13c0[_0x475d('0x5a')]({'model':db[_0x475d('0x5b')],'as':'User','attributes':['id',_0x475d('0x5c')],'raw':!![]});_0x4e13c0['push']({'model':db['CmContact'],'as':_0x475d('0x5d'),'attributes':['id',_0x475d('0x5e'),_0x475d('0x5f')],'raw':!![]});if(_0x2d3011[_0x475d('0x28')]['attachments']){_0x4e13c0['push']({'model':db[_0x475d('0x60')],'as':'Attachment','raw':!![]});}var _0x5602ef=[{'model':db[_0x475d('0x3c')],'as':_0x475d('0x61'),'attributes':['id',_0x475d('0x39'),_0x475d('0x62'),_0x475d('0x63'),'secret',_0x475d('0x64')],'include':_0x4e13c0}];_0x5602ef[_0x475d('0x5a')]({'model':db['WhatsappAccount'],'as':_0x475d('0x65'),'attributes':['id',_0x475d('0x1e')]});_0x5602ef['push']({'model':db[_0x475d('0x5b')],'as':_0x475d('0x66'),'attributes':['id',_0x475d('0x5c')]});return db['WhatsappInteraction'][_0x475d('0x36')]({'where':{'id':_0x2d3011[_0x475d('0x2b')]['id']},'include':_0x5602ef})[_0x475d('0x1a')](handleEntityNotFound(_0x3c8cc8,null))[_0x475d('0x1a')](function(_0xd4102e){if(_0xd4102e){var _0xe3b683=_0xd4102e[_0x475d('0x67')]({'plain':!![]});fs[_0x475d('0x68')](_0x160ead);var _0x2a7757={'channel':'Whatsapp','account':_0xe3b683[_0x475d('0x65')][_0x475d('0x1e')],'agent':_0xe3b683[_0x475d('0x66')]?_0xe3b683[_0x475d('0x66')]['fullname']:_0x475d('0x69'),'createdAt':moment(_0xe3b683[_0x475d('0x62')])['format'](_0x475d('0x4a'))[_0x475d('0x54')](),'closedAt':_0xe3b683[_0x475d('0x6a')]?moment(_0xe3b683[_0x475d('0x6b')])['format'](_0x475d('0x4a'))[_0x475d('0x54')]():'','disposition':_0xe3b683[_0x475d('0x6c')],'messages':_(_0xe3b683[_0x475d('0x61')])['filter']({'secret':![]})[_0x475d('0x20')](function(_0x3e5700){if(_0x3e5700[_0x475d('0x60')]){var _0x198ec1=path[_0x475d('0x55')](_0x4fc1a7,_0x3e5700['Attachment'][_0x475d('0x6d')]);if(fs[_0x475d('0x6e')](_0x198ec1)){fs['createReadStream'](_0x198ec1)['pipe'](fs[_0x475d('0x6f')](path['join'](_0x160ead,_0x3e5700[_0x475d('0x60')][_0x475d('0x6d')])));}}return{'date':moment(_0x3e5700['createdAt'])[_0x475d('0x49')](_0x475d('0x4a'))[_0x475d('0x54')](),'sender':_0x3e5700[_0x475d('0x63')]===_0x475d('0x70')?_0x3e5700['User']?_0x3e5700[_0x475d('0x5b')][_0x475d('0x5c')]:_0x475d('0x71'):_0x3e5700[_0x475d('0x5d')][_0x475d('0x5e')]+(_0x3e5700[_0x475d('0x5d')][_0x475d('0x5f')]?'\x20'+_0x3e5700['Contact']['lastName']:''),'body':_0x3e5700[_0x475d('0x60')]?_0x3e5700[_0x475d('0x60')][_0x475d('0x6d')]:_0x3e5700['body'],'direction':_0x3e5700[_0x475d('0x63')]===_0x475d('0x70')?'A':'C','secret':_0x3e5700[_0x475d('0x72')],'read':_0x3e5700[_0x475d('0x64')],'attachment':_0x3e5700[_0x475d('0x60')]};})[_0x475d('0x73')]()};return ejs['renderFile'](path[_0x475d('0x55')](config['root'],_0x475d('0x56'),_0x475d('0x74'),'downloadInteraction.ejs'),{'interaction':_0x2a7757})[_0x475d('0x1a')](function(_0x472949){var _0x5bd260=path['join'](_0x160ead,'transcript-'+_0xe3b683['id']+'-'+_0xe51a83+_0x475d('0x75'));var _0x3dc63a={'path':_0x5bd260,'channel':_0x475d('0x76'),'interactionId':_0xe3b683['id']};return pdf[_0x475d('0x77')](_0x472949,_0x3dc63a);})['then'](function(){return new BPromise(function(_0xe34915,_0x270d7c){zipdir(_0x160ead,{'saveTo':_0x23168f},function(_0x167495,_0x3c4502){if(_0x167495)return _0x270d7c(_0x167495);return _0xe34915(_0x3c4502);});})[_0x475d('0x1a')](function(){return new BPromise(function(_0xd86a0e,_0x18e020){rimraf(_0x160ead,function(_0x58afeb){if(_0x58afeb)_0x18e020(_0x58afeb);return _0xd86a0e();});});})[_0x475d('0x1a')](function(){return _0x3c8cc8[_0x475d('0x53')](_0x23168f,_0x279b2b,function(_0x5288dd){if(_0x5288dd){console[_0x475d('0x78')](_0x475d('0x79'),_0x5288dd);}else{fs['unlinkSync'](_0x23168f);}});});});}else{return _0x3c8cc8[_0x475d('0x11')](0xc8);}})[_0x475d('0x29')](handleError(_0x3c8cc8,null));}; \ No newline at end of file +var _0x45ca=['../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','error','name','send','index','map','WhatsappInteraction','rawAttributes','type','key','getOptions','findAll','whatsapp','catch','keys','query','filters','attributes','intersection','model','fields','includeAll','include','merge','options','find','create','body','params','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','length','hasOwnProperty','order','sort','where','pick','WhatsappInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','Tag','color','emit','whatsappInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','format','transcript-%d-%s.zip','User','fullname','push','Contact','lastName','attachments','Attachment','Messages','direction','WhatsappAccount','Owner','get','mkdirSync','Whatsapp','Account','N.A.','closed','closedAt','disposition','basename','createReadStream','pipe','createWriteStream','createdAt','toString','firstName','out','read','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','ioredis','../../components/export/pdf','api'];(function(_0x517bc5,_0x2893eb){var _0x220437=function(_0x222051){while(--_0x222051){_0x517bc5['push'](_0x517bc5['shift']());}};_0x220437(++_0x2893eb);}(_0x45ca,0xfa));var _0xa45c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x45ca[_0x502c7d];return _0x30b7ed;};'use strict';var rimraf=require(_0xa45c('0x0'));var zipdir=require(_0xa45c('0x1'));var moment=require(_0xa45c('0x2'));var BPromise=require(_0xa45c('0x3'));var util=require(_0xa45c('0x4'));var path=require(_0xa45c('0x5'));var ejs=require(_0xa45c('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xa45c('0x7'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0xa45c('0x8'));var logger=require('../../config/logger')(_0xa45c('0x9'));var config=require(_0xa45c('0xa'));var db=require(_0xa45c('0xb'))['db'];config[_0xa45c('0xc')]=_[_0xa45c('0xd')](config[_0xa45c('0xc')],{'host':_0xa45c('0xe'),'port':0x18eb});var socket=require(_0xa45c('0xf'))(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0xa45c('0x10')](socket);function respondWithStatusCode(_0x4b8943,_0x1e0837){_0x1e0837=_0x1e0837||0xcc;return function(_0x162e42){if(_0x162e42){return _0x4b8943[_0xa45c('0x11')](_0x1e0837);}return _0x4b8943[_0xa45c('0x12')](_0x1e0837)[_0xa45c('0x13')]();};}function respondWithResult(_0x1a5fed,_0x1101b6){_0x1101b6=_0x1101b6||0xc8;return function(_0x461091){if(_0x461091){return _0x1a5fed['status'](_0x1101b6)[_0xa45c('0x14')](_0x461091);}};}function respondWithFilteredResult(_0x43bc3a,_0x5cd71a){return function(_0x54f5f1){if(_0x54f5f1){var _0x8fd052=typeof _0x5cd71a[_0xa45c('0x15')]===_0xa45c('0x16')&&typeof _0x5cd71a[_0xa45c('0x17')]==='undefined';var _0x5309fe=_0x54f5f1[_0xa45c('0x18')];var _0x520b59=_0x8fd052?0x0:_0x5cd71a[_0xa45c('0x15')];var _0x4b146a=_0x8fd052?_0x54f5f1[_0xa45c('0x18')]:_0x5cd71a[_0xa45c('0x15')]+_0x5cd71a['limit'];var _0x1e8ea7;if(_0x4b146a>=_0x5309fe){_0x4b146a=_0x5309fe;_0x1e8ea7=0xc8;}else{_0x1e8ea7=0xce;}_0x43bc3a['status'](_0x1e8ea7);return _0x43bc3a['set'](_0xa45c('0x19'),_0x520b59+'-'+_0x4b146a+'/'+_0x5309fe)[_0xa45c('0x14')](_0x54f5f1);}return null;};}function saveUpdates(_0x30f613){return function(_0x4a1067){if(_0x4a1067){return _0x4a1067[_0xa45c('0x1a')](_0x30f613)[_0xa45c('0x1b')](function(_0x2cc886){return _0x2cc886;});}return null;};}function removeEntity(_0x2a0d87){return function(_0x5ac663){if(_0x5ac663){return _0x5ac663[_0xa45c('0x1c')]()['then'](function(){_0x2a0d87[_0xa45c('0x12')](0xcc)[_0xa45c('0x13')]();});}};}function handleEntityNotFound(_0x57cb4c){return function(_0x3c8ef4){if(!_0x3c8ef4){_0x57cb4c[_0xa45c('0x11')](0x194);}return _0x3c8ef4;};}function handleError(_0x1eb9dc,_0x2ad87a){_0x2ad87a=_0x2ad87a||0x1f4;return function(_0x47a6ca){logger[_0xa45c('0x1d')](_0x47a6ca['stack']);if(_0x47a6ca[_0xa45c('0x1e')]){delete _0x47a6ca['name'];}_0x1eb9dc[_0xa45c('0x12')](_0x2ad87a)[_0xa45c('0x1f')](_0x47a6ca);};}exports[_0xa45c('0x20')]=function(_0x160d64,_0xbd85ff){var _0x18987a={};var _0x23d907=_[_0xa45c('0x21')](db[_0xa45c('0x22')][_0xa45c('0x23')],function(_0x427294){return{'name':_0x427294['fieldName'],'type':_0x427294[_0xa45c('0x24')][_0xa45c('0x25')]};});_0x18987a=qs[_0xa45c('0x26')](_0x23d907,_0x160d64);return interaction[_0xa45c('0x27')](_0xa45c('0x28'),_0x160d64['query'],_0x160d64['user'],_0x18987a,_0x23d907)[_0xa45c('0x1b')](respondWithFilteredResult(_0xbd85ff,_0x18987a))[_0xa45c('0x29')](handleError(_0xbd85ff,null));};exports['show']=function(_0x312b10,_0x5e3cce){var _0x4d0f29={'raw':![],'where':{'id':_0x312b10['params']['id']}},_0x22be0d={};_0x22be0d['model']=_[_0xa45c('0x2a')](db[_0xa45c('0x22')][_0xa45c('0x23')]);_0x22be0d[_0xa45c('0x2b')]=_['keys'](_0x312b10['query']);_0x22be0d[_0xa45c('0x2c')]=_['intersection'](_0x22be0d['model'],_0x22be0d['query']);_0x4d0f29[_0xa45c('0x2d')]=_[_0xa45c('0x2e')](_0x22be0d[_0xa45c('0x2f')],qs['fields'](_0x312b10[_0xa45c('0x2b')][_0xa45c('0x30')]));_0x4d0f29[_0xa45c('0x2d')]=_0x4d0f29[_0xa45c('0x2d')]['length']?_0x4d0f29[_0xa45c('0x2d')]:_0x22be0d['model'];if(_0x312b10[_0xa45c('0x2b')][_0xa45c('0x31')]){_0x4d0f29[_0xa45c('0x32')]=[{'all':!![]}];}_0x4d0f29=_[_0xa45c('0x33')]({},_0x4d0f29,_0x312b10[_0xa45c('0x34')]);return db[_0xa45c('0x22')][_0xa45c('0x35')](_0x4d0f29)[_0xa45c('0x1b')](handleEntityNotFound(_0x5e3cce,null))[_0xa45c('0x1b')](respondWithResult(_0x5e3cce,null))[_0xa45c('0x29')](handleError(_0x5e3cce,null));};exports['create']=function(_0x1bf452,_0x1989ac){return db[_0xa45c('0x22')][_0xa45c('0x36')](_0x1bf452[_0xa45c('0x37')],{})[_0xa45c('0x1b')](respondWithResult(_0x1989ac,0xc9))[_0xa45c('0x29')](handleError(_0x1989ac,null));};exports['update']=function(_0x23ff76,_0x494989){if(_0x23ff76[_0xa45c('0x37')]['id']){delete _0x23ff76[_0xa45c('0x37')]['id'];}return db[_0xa45c('0x22')][_0xa45c('0x35')]({'where':{'id':_0x23ff76[_0xa45c('0x38')]['id']}})[_0xa45c('0x1b')](handleEntityNotFound(_0x494989,null))[_0xa45c('0x1b')](saveUpdates(_0x23ff76[_0xa45c('0x37')],null))[_0xa45c('0x1b')](respondWithResult(_0x494989,null))[_0xa45c('0x29')](handleError(_0x494989,null));};exports[_0xa45c('0x1c')]=function(_0x433dd4,_0x5e4f3f){return db[_0xa45c('0x22')][_0xa45c('0x35')]({'where':{'id':_0x433dd4['params']['id']}})['then'](handleEntityNotFound(_0x5e4f3f,null))[_0xa45c('0x1b')](removeEntity(_0x5e4f3f,null))[_0xa45c('0x29')](handleError(_0x5e4f3f,null));};exports[_0xa45c('0x39')]=function(_0x3beed7,_0x2bf2f5){return db['WhatsappInteraction'][_0xa45c('0x39')]()[_0xa45c('0x1b')](respondWithResult(_0x2bf2f5,null))[_0xa45c('0x29')](handleError(_0x2bf2f5,null));};exports[_0xa45c('0x3a')]=function(_0x59aba1,_0x2ffbc9){return db[_0xa45c('0x3b')][_0xa45c('0x35')]({'where':{'id':_0x59aba1[_0xa45c('0x38')]['id']}})['then'](handleEntityNotFound(_0x2ffbc9,null))['then'](function(_0x2726a2){if(_0x2726a2){return _0x2726a2['addMessage'](_0x59aba1[_0xa45c('0x37')][_0xa45c('0x3c')],_[_0xa45c('0x3d')](_0x59aba1[_0xa45c('0x37')],['ids','id'])||{});}})[_0xa45c('0x1b')](respondWithResult(_0x2ffbc9,null))[_0xa45c('0x29')](handleError(_0x2ffbc9,null));};exports[_0xa45c('0x3e')]=function(_0x431b16,_0x525575){var _0x4b4168={'raw':![],'where':{}};var _0x3cf0c0={};var _0x3d651b={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0xa45c('0x3f')]({'where':{'id':_0x431b16[_0xa45c('0x38')]['id']}})[_0xa45c('0x1b')](handleEntityNotFound(_0x525575,null))[_0xa45c('0x1b')](function(_0x48929c){if(_0x48929c){_0x3cf0c0['model']=_[_0xa45c('0x2a')](db[_0xa45c('0x3b')][_0xa45c('0x23')]);_0x3cf0c0[_0xa45c('0x2b')]=_[_0xa45c('0x2a')](_0x431b16[_0xa45c('0x2b')]);_0x3cf0c0[_0xa45c('0x2c')]=_[_0xa45c('0x2e')](_0x3cf0c0[_0xa45c('0x2f')],_0x3cf0c0[_0xa45c('0x2b')]);_0x4b4168[_0xa45c('0x2d')]=_['intersection'](_0x3cf0c0[_0xa45c('0x2f')],qs[_0xa45c('0x30')](_0x431b16[_0xa45c('0x2b')][_0xa45c('0x30')]));_0x4b4168[_0xa45c('0x2d')]=_0x4b4168[_0xa45c('0x2d')][_0xa45c('0x40')]?_0x4b4168[_0xa45c('0x2d')]:_0x3cf0c0[_0xa45c('0x2f')];if(!_0x431b16[_0xa45c('0x2b')][_0xa45c('0x41')]('nolimit')){_0x4b4168['limit']=qs[_0xa45c('0x17')](_0x431b16[_0xa45c('0x2b')][_0xa45c('0x17')]);_0x4b4168[_0xa45c('0x15')]=qs[_0xa45c('0x15')](_0x431b16[_0xa45c('0x2b')][_0xa45c('0x15')]);}_0x4b4168[_0xa45c('0x42')]=qs[_0xa45c('0x43')](_0x431b16[_0xa45c('0x2b')][_0xa45c('0x43')]);_0x4b4168[_0xa45c('0x44')]=qs[_0xa45c('0x2c')](_[_0xa45c('0x45')](_0x431b16[_0xa45c('0x2b')],_0x3cf0c0['filters']));_0x4b4168[_0xa45c('0x44')][_0xa45c('0x46')]=_0x48929c['id'];if(_0x431b16[_0xa45c('0x2b')][_0xa45c('0x47')]){_0x4b4168[_0xa45c('0x44')]=_[_0xa45c('0x33')](_0x4b4168[_0xa45c('0x44')],{'$or':_['map'](_0x4b4168[_0xa45c('0x2d')],function(_0x120084){var _0xb91c7e={};_0xb91c7e[_0x120084]={'$like':'%'+_0x431b16[_0xa45c('0x2b')][_0xa45c('0x47')]+'%'};return _0xb91c7e;})});}if(_0x431b16[_0xa45c('0x2b')][_0xa45c('0x48')]){var _0x1590b1=_0x431b16['query']['$gte'][_0xa45c('0x49')](',');var _0x1575dd={};_0x1575dd[_0x1590b1[0x0]]={'$gte':moment(_0x1590b1[0x1])['format'](_0xa45c('0x4a'))};_0x4b4168[_0xa45c('0x44')]=_[_0xa45c('0x33')](_0x4b4168[_0xa45c('0x44')],_0x1575dd);}_0x4b4168=_[_0xa45c('0x33')]({},_0x4b4168,_0x431b16[_0xa45c('0x34')]);return db[_0xa45c('0x3b')][_0xa45c('0x18')]({'where':_0x4b4168[_0xa45c('0x44')]})[_0xa45c('0x1b')](function(_0xdaaf83){_0x3d651b[_0xa45c('0x18')]=_0xdaaf83;if(_0x431b16['query'][_0xa45c('0x31')]){_0x4b4168['include']=[{'all':!![]}];}return db[_0xa45c('0x3b')][_0xa45c('0x27')](_0x4b4168);})[_0xa45c('0x1b')](function(_0x1bb0fc){_0x3d651b[_0xa45c('0x4b')]=_0x1bb0fc;return _0x3d651b;});}})['then'](respondWithFilteredResult(_0x525575,_0x4b4168))[_0xa45c('0x29')](handleError(_0x525575,null));};exports[_0xa45c('0x4c')]=function(_0x64b399,_0x44b672){return db[_0xa45c('0x22')]['find']({'where':{'id':_0x64b399[_0xa45c('0x38')]['id']}})[_0xa45c('0x1b')](handleEntityNotFound(_0x44b672,null))[_0xa45c('0x1b')](function(_0x23b7bc){if(_0x23b7bc){return _0x23b7bc[_0xa45c('0x4d')](_0x64b399[_0xa45c('0x37')][_0xa45c('0x3c')],_['omit'](_0x64b399[_0xa45c('0x37')],[_0xa45c('0x3c'),'id'])||{})[_0xa45c('0x4e')](function(){return db[_0xa45c('0x4f')]['findAll']({'attributes':['id',_0xa45c('0x1e'),_0xa45c('0x50')],'where':{'id':_0x64b399[_0xa45c('0x37')][_0xa45c('0x3c')]}});})[_0xa45c('0x1b')](function(_0xb830a9){socket[_0xa45c('0x51')](_0xa45c('0x52'),{'id':Number(_0x64b399[_0xa45c('0x38')]['id']),'tags':_0xb830a9||[]});return{'id':Number(_0x64b399['params']['id']),'tags':_0xb830a9||[]};});}})[_0xa45c('0x1b')](respondWithResult(_0x44b672,null))[_0xa45c('0x29')](handleError(_0x44b672,null));};exports[_0xa45c('0x53')]=function(_0x2ae708,_0x52abcc){return db['WhatsappInteraction'][_0xa45c('0x35')]({'where':{'id':_0x2ae708['params']['id']}})['then'](handleEntityNotFound(_0x52abcc,null))[_0xa45c('0x1b')](function(_0x3560c4){if(_0x3560c4){return _0x3560c4[_0xa45c('0x53')](_0x2ae708[_0xa45c('0x2b')][_0xa45c('0x3c')]);}})[_0xa45c('0x1b')](respondWithStatusCode(_0x52abcc,null))[_0xa45c('0x29')](handleError(_0x52abcc,null));};exports[_0xa45c('0x54')]=function(_0x212318,_0x2d8be3){var _0x4e2391=moment()[_0xa45c('0x55')]()['toString']();var _0x4366ea=path['join'](config[_0xa45c('0x56')],_0xa45c('0x57'),_0xa45c('0x58'),_0xa45c('0x59'));var _0x2d4ddc=path[_0xa45c('0x5a')](config[_0xa45c('0x56')],_0xa45c('0x57'),_0xa45c('0x58'),'attachments');var _0x5412aa=path[_0xa45c('0x5a')](_0x4366ea,_0x4e2391);var _0x1aa3af=util[_0xa45c('0x5b')](_0xa45c('0x5c'),_0x212318[_0xa45c('0x38')]['id'],_0x4e2391);var _0x59de7b=path[_0xa45c('0x5a')](_0x4366ea,_0x1aa3af);var _0xad837d=[];_0xad837d['push']({'model':db[_0xa45c('0x5d')],'as':_0xa45c('0x5d'),'attributes':['id',_0xa45c('0x5e')],'raw':!![]});_0xad837d[_0xa45c('0x5f')]({'model':db['CmContact'],'as':_0xa45c('0x60'),'attributes':['id','firstName',_0xa45c('0x61')],'raw':!![]});if(_0x212318[_0xa45c('0x2b')][_0xa45c('0x62')]){_0xad837d[_0xa45c('0x5f')]({'model':db[_0xa45c('0x63')],'as':_0xa45c('0x63'),'raw':!![]});}var _0x2fff47=[{'model':db[_0xa45c('0x3b')],'as':_0xa45c('0x64'),'attributes':['id','body','createdAt',_0xa45c('0x65'),'secret','read'],'include':_0xad837d}];_0x2fff47['push']({'model':db[_0xa45c('0x66')],'as':'Account','attributes':['id',_0xa45c('0x1e')]});_0x2fff47['push']({'model':db[_0xa45c('0x5d')],'as':_0xa45c('0x67'),'attributes':['id',_0xa45c('0x5e')]});return db['WhatsappInteraction']['find']({'where':{'id':_0x212318['params']['id']},'include':_0x2fff47})[_0xa45c('0x1b')](handleEntityNotFound(_0x2d8be3,null))[_0xa45c('0x1b')](function(_0x4b9d7f){if(_0x4b9d7f){var _0x1e2e36=_0x4b9d7f[_0xa45c('0x68')]({'plain':!![]});fs[_0xa45c('0x69')](_0x5412aa);var _0x5e7db3={'channel':_0xa45c('0x6a'),'account':_0x1e2e36[_0xa45c('0x6b')][_0xa45c('0x1e')],'agent':_0x1e2e36[_0xa45c('0x67')]?_0x1e2e36[_0xa45c('0x67')][_0xa45c('0x5e')]:_0xa45c('0x6c'),'createdAt':moment(_0x1e2e36['createdAt'])[_0xa45c('0x5b')](_0xa45c('0x4a'))['toString'](),'closedAt':_0x1e2e36[_0xa45c('0x6d')]?moment(_0x1e2e36[_0xa45c('0x6e')])[_0xa45c('0x5b')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x1e2e36[_0xa45c('0x6f')],'messages':_(_0x1e2e36[_0xa45c('0x64')])[_0xa45c('0x47')]({'secret':![]})[_0xa45c('0x21')](function(_0x4a2be5){if(_0x4a2be5[_0xa45c('0x63')]){var _0x2aa216=path[_0xa45c('0x5a')](_0x2d4ddc,_0x4a2be5[_0xa45c('0x63')][_0xa45c('0x70')]);if(fs['existsSync'](_0x2aa216)){fs[_0xa45c('0x71')](_0x2aa216)[_0xa45c('0x72')](fs[_0xa45c('0x73')](path['join'](_0x5412aa,_0x4a2be5[_0xa45c('0x63')][_0xa45c('0x70')])));}}return{'date':moment(_0x4a2be5[_0xa45c('0x74')])['format'](_0xa45c('0x4a'))[_0xa45c('0x75')](),'sender':_0x4a2be5[_0xa45c('0x65')]==='out'?_0x4a2be5[_0xa45c('0x5d')]?_0x4a2be5[_0xa45c('0x5d')][_0xa45c('0x5e')]:'System':_0x4a2be5[_0xa45c('0x60')][_0xa45c('0x76')]+(_0x4a2be5[_0xa45c('0x60')][_0xa45c('0x61')]?'\x20'+_0x4a2be5[_0xa45c('0x60')][_0xa45c('0x61')]:''),'body':_0x4a2be5[_0xa45c('0x63')]?_0x4a2be5[_0xa45c('0x63')][_0xa45c('0x70')]:_0x4a2be5['body'],'direction':_0x4a2be5[_0xa45c('0x65')]===_0xa45c('0x77')?'A':'C','secret':_0x4a2be5['secret'],'read':_0x4a2be5[_0xa45c('0x78')],'attachment':_0x4a2be5[_0xa45c('0x63')]};})[_0xa45c('0x79')]()};return ejs[_0xa45c('0x7a')](path[_0xa45c('0x5a')](config[_0xa45c('0x56')],_0xa45c('0x57'),_0xa45c('0x7b'),_0xa45c('0x7c')),{'interaction':_0x5e7db3})[_0xa45c('0x1b')](function(_0xfed4fe){var _0x3975f1=path[_0xa45c('0x5a')](_0x5412aa,_0xa45c('0x7d')+_0x1e2e36['id']+'-'+_0x4e2391+_0xa45c('0x7e'));var _0xdfd451={'path':_0x3975f1,'channel':_0xa45c('0x6a'),'interactionId':_0x1e2e36['id']};return pdf['createPdfFromHTML'](_0xfed4fe,_0xdfd451);})[_0xa45c('0x1b')](function(){return new BPromise(function(_0x13c5a6,_0x1d17f8){zipdir(_0x5412aa,{'saveTo':_0x59de7b},function(_0x1d53a6,_0x280044){if(_0x1d53a6)return _0x1d17f8(_0x1d53a6);return _0x13c5a6(_0x280044);});})['then'](function(){return new BPromise(function(_0x4b912c,_0x37c854){rimraf(_0x5412aa,function(_0xb50b62){if(_0xb50b62)_0x37c854(_0xb50b62);return _0x4b912c();});});})[_0xa45c('0x1b')](function(){return _0x2d8be3[_0xa45c('0x54')](_0x59de7b,_0x1aa3af,function(_0x503c6e){if(_0x503c6e){console[_0xa45c('0x7f')](_0xa45c('0x80'),_0x503c6e);}else{fs[_0xa45c('0x81')](_0x59de7b);}});});});}else{return _0x2d8be3[_0xa45c('0x11')](0xc8);}})[_0xa45c('0x29')](handleError(_0x2d8be3,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 242f559..ec98713 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 _0x2bdb=['map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','remove','getUsers','then','setDataValue'];(function(_0xa28bd4,_0x399fa9){var _0x1c642e=function(_0x210bba){while(--_0x210bba){_0xa28bd4['push'](_0xa28bd4['shift']());}};_0x1c642e(++_0x399fa9);}(_0x2bdb,0x105));var _0xb2bd=function(_0x47f2fa,_0x23809b){_0x47f2fa=_0x47f2fa-0x0;var _0x521ffd=_0x2bdb[_0x47f2fa];return _0x521ffd;};'use strict';var EventEmitter=require(_0xb2bd('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0xb2bd('0x1')];var WhatsappMessage=require('../../mysqldb')['db'][_0xb2bd('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xb2bd('0x3')](0x0);var events={'afterCreate':_0xb2bd('0x4'),'afterUpdate':'update','afterDestroy':_0xb2bd('0x5')};function emitEvent(_0x2be356){return function(_0x1fa03c,_0x4676c1,_0x461137){_0x1fa03c[_0xb2bd('0x6')]({'attributes':['id'],'raw':!![]})[_0xb2bd('0x7')](function(_0x5bae78){_0x1fa03c[_0xb2bd('0x8')]('Users',_0x5bae78[_0xb2bd('0x9')](function(_0x29f784){return{'id':_0x29f784['id']};}));return WhatsappMessage[_0xb2bd('0xa')]({'where':{'WhatsappInteractionId':_0x1fa03c['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb2bd('0x7')](function(_0x412872){_0x1fa03c[_0xb2bd('0x8')](_0xb2bd('0xb'),_0x412872[_0xb2bd('0xc')]);WhatsappInteractionEvents[_0xb2bd('0xd')](_0x2be356+':'+_0x1fa03c['id'],_0x1fa03c);WhatsappInteractionEvents['emit'](_0x2be356,_0x1fa03c);_0x461137(null);})[_0xb2bd('0xe')](_0x461137(null));};}for(var e in events){if(events[_0xb2bd('0xf')](e)){var event=events[e];WhatsappInteraction[_0xb2bd('0x10')](e,emitEvent(event));}}module[_0xb2bd('0x11')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x028d=['map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x5a1402,_0x5ae28d){var _0x467031=function(_0xb37a51){while(--_0xb37a51){_0x5a1402['push'](_0x5a1402['shift']());}};_0x467031(++_0x5ae28d);}(_0x028d,0xff));var _0xd028=function(_0xc2e9b3,_0x3a015f){_0xc2e9b3=_0xc2e9b3-0x0;var _0x355895=_0x028d[_0xc2e9b3];return _0x355895;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0xd028('0x0'))['db'][_0xd028('0x1')];var WhatsappMessage=require('../../mysqldb')['db'][_0xd028('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xd028('0x3')](0x0);var events={'afterCreate':_0xd028('0x4'),'afterUpdate':_0xd028('0x5'),'afterDestroy':_0xd028('0x6')};function emitEvent(_0x67d150){return function(_0x5094d8,_0x153af8,_0x4592fd){_0x5094d8[_0xd028('0x7')]({'attributes':['id'],'raw':!![]})[_0xd028('0x8')](function(_0x110b50){_0x5094d8[_0xd028('0x9')](_0xd028('0xa'),_0x110b50[_0xd028('0xb')](function(_0xadea4b){return{'id':_0xadea4b['id']};}));return WhatsappMessage[_0xd028('0xc')]({'where':{'WhatsappInteractionId':_0x5094d8['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd028('0x8')](function(_0x1211c6){_0x5094d8[_0xd028('0x9')](_0xd028('0xd'),_0x1211c6['length']);WhatsappInteractionEvents[_0xd028('0xe')](_0x67d150+':'+_0x5094d8['id'],_0x5094d8);WhatsappInteractionEvents[_0xd028('0xe')](_0x67d150,_0x5094d8);_0x4592fd(null);})[_0xd028('0xf')](_0x4592fd(null));};}for(var e in events){if(events[_0xd028('0x10')](e)){var event=events[e];WhatsappInteraction[_0xd028('0x11')](e,emitEvent(event));}}module[_0xd028('0x12')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 3f41829..a11db10 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 _0xa25d=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','changed','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5f03b8,_0x5ea05c){var _0x354a99=function(_0x4c6922){while(--_0x4c6922){_0x5f03b8['push'](_0x5f03b8['shift']());}};_0x354a99(++_0x5ea05c);}(_0xa25d,0x1b3));var _0xda25=function(_0x4271f1,_0xdbdc80){_0x4271f1=_0x4271f1-0x0;var _0x1bc9c9=_0xa25d[_0x4271f1];return _0x1bc9c9;};'use strict';var _=require(_0xda25('0x0'));var util=require(_0xda25('0x1'));var logger=require(_0xda25('0x2'))('api');var moment=require(_0xda25('0x3'));var BPromise=require(_0xda25('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xda25('0x5'));var rimraf=require(_0xda25('0x6'));var config=require(_0xda25('0x7'));var attributes=require(_0xda25('0x8'));module[_0xda25('0x9')]=function(_0x4f5388,_0x682a21){return _0x4f5388[_0xda25('0xa')](_0xda25('0xb'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x48b59c,_0x3a6538,_0x26d65a){if(_0x48b59c[_0xda25('0xc')]('closed')){_0x48b59c['closedAt']=moment()[_0xda25('0xd')](_0xda25('0xe'));}_0x26d65a(null,_0x48b59c);}}});}; \ No newline at end of file +var _0xbcc2=['bluebird','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','lodash','../../config/logger','moment'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xbcc2,0x93));var _0x2bcc=function(_0x4cbb8e,_0x1047c8){_0x4cbb8e=_0x4cbb8e-0x0;var _0x17846f=_0xbcc2[_0x4cbb8e];return _0x17846f;};'use strict';var _=require(_0x2bcc('0x0'));var util=require('util');var logger=require(_0x2bcc('0x1'))('api');var moment=require(_0x2bcc('0x2'));var BPromise=require(_0x2bcc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2bcc('0x4'));var config=require(_0x2bcc('0x5'));var attributes=require(_0x2bcc('0x6'));module[_0x2bcc('0x7')]=function(_0x5615d9,_0x1148ba){return _0x5615d9[_0x2bcc('0x8')](_0x2bcc('0x9'),attributes,{'tableName':_0x2bcc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x31af6a,_0x5e14eb,_0x1fe9c8){if(_0x31af6a[_0x2bcc('0xb')](_0x2bcc('0xc'))){_0x31af6a[_0x2bcc('0xd')]=moment()[_0x2bcc('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1fe9c8(null,_0x31af6a);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 20f54c6..9344ccf 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 _0xf66f=['ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','localhost','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','WhatsappInteraction','update','body','options','raw','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','find','where','addTags'];(function(_0x539a38,_0x36aeae){var _0x18898e=function(_0xdc2d40){while(--_0xdc2d40){_0x539a38['push'](_0x539a38['shift']());}};_0x18898e(++_0x36aeae);}(_0xf66f,0x1c7));var _0xff66=function(_0x14b268,_0xc29a1a){_0x14b268=_0x14b268-0x0;var _0x58fd2a=_0xf66f[_0x14b268];return _0x58fd2a;};'use strict';var _=require(_0xff66('0x0'));var util=require(_0xff66('0x1'));var moment=require(_0xff66('0x2'));var BPromise=require(_0xff66('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xff66('0x4'));var db=require(_0xff66('0x5'))['db'];var utils=require(_0xff66('0x6'));var logger=require('../../config/logger')(_0xff66('0x7'));var config=require('../../config/environment');var jayson=require(_0xff66('0x8'));var client=jayson['client'][_0xff66('0x9')]({'port':0x232a});config[_0xff66('0xa')]=_['defaults'](config[_0xff66('0xa')],{'host':_0xff66('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xff66('0xc'))[_0xff66('0xd')](socket);function respondWithRpcPromise(_0x48153e,_0x129e8d,_0x26af66){return new BPromise(function(_0x3aa2c5,_0x39c09f){return client[_0xff66('0xe')](_0x48153e,_0x26af66)[_0xff66('0xf')](function(_0xf4f090){logger[_0xff66('0x10')](_0xff66('0x11'),_0x129e8d,_0xff66('0x12'));logger[_0xff66('0x13')](_0xff66('0x14'),_0x129e8d,'request\x20sent',JSON[_0xff66('0x15')](_0xf4f090));if(_0xf4f090[_0xff66('0x16')]){if(_0xf4f090[_0xff66('0x16')][_0xff66('0x17')]===0x1f4){logger[_0xff66('0x16')](_0xff66('0x11'),_0x129e8d,_0xf4f090[_0xff66('0x16')][_0xff66('0x18')]);return _0x39c09f(_0xf4f090[_0xff66('0x16')]['message']);}logger[_0xff66('0x16')](_0xff66('0x11'),_0x129e8d,_0xf4f090[_0xff66('0x16')][_0xff66('0x18')]);return _0x3aa2c5(_0xf4f090[_0xff66('0x16')][_0xff66('0x18')]);}else{logger[_0xff66('0x10')](_0xff66('0x11'),_0x129e8d,_0xff66('0x12'));_0x3aa2c5(_0xf4f090[_0xff66('0x19')]['message']);}})[_0xff66('0x1a')](function(_0xc6a34c){logger[_0xff66('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x129e8d,_0xc6a34c);_0x39c09f(_0xc6a34c);});});}exports['UpdateWhatsappInteraction']=function(_0x4ab4b3){var _0x384b8f=this;return new Promise(function(_0x3f284b,_0x2b0328){return db[_0xff66('0x1b')][_0xff66('0x1c')](_0x4ab4b3[_0xff66('0x1d')],{'raw':_0x4ab4b3['options']?_0x4ab4b3[_0xff66('0x1e')][_0xff66('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ab4b3[_0xff66('0x1e')]?_0x4ab4b3[_0xff66('0x1e')]['where']||null:null,'attributes':_0x4ab4b3[_0xff66('0x1e')]?_0x4ab4b3[_0xff66('0x1e')]['attributes']||null:null,'limit':_0x4ab4b3[_0xff66('0x1e')]?_0x4ab4b3[_0xff66('0x1e')]['limit']||null:null})[_0xff66('0xf')](function(_0x20437d){logger[_0xff66('0x10')](_0xff66('0x20'),_0x4ab4b3);logger[_0xff66('0x13')]('UpdateWhatsappInteraction',_0x4ab4b3,JSON['stringify'](_0x20437d));_0x3f284b(_0x20437d);})[_0xff66('0x1a')](function(_0x25d0b8){logger['error'](_0xff66('0x20'),_0x25d0b8[_0xff66('0x18')],_0x4ab4b3);_0x2b0328(_0x384b8f[_0xff66('0x16')](0x1f4,_0x25d0b8[_0xff66('0x18')]));});});};exports[_0xff66('0x21')]=function(_0x126ba9){return new Promise(function(_0x311332,_0x102025){return db[_0xff66('0x1b')][_0xff66('0x22')]({'where':_0x126ba9['options']?_0x126ba9[_0xff66('0x1e')][_0xff66('0x23')]||null:null})[_0xff66('0xf')](function(_0x3ceee1){if(_0x3ceee1){return _0x3ceee1[_0xff66('0x24')](_0x126ba9[_0xff66('0x1d')][_0xff66('0x25')],_[_0xff66('0x26')](_0x126ba9['body'],[_0xff66('0x25'),'id'])||{});}})[_0xff66('0x27')](function(_0x464d14){logger['info'](_0xff66('0x28'),_0x126ba9);logger['debug'](_0xff66('0x28'),_0x126ba9,JSON['stringify'](_0x464d14));_0x311332(_0x464d14);})[_0xff66('0x1a')](function(_0x2b5adf){logger['error']('AddTags',_0x2b5adf[_0xff66('0x18')],_0x126ba9);_0x102025(_this[_0xff66('0x16')](0x1f4,_0x2b5adf[_0xff66('0x18')]));});});}; \ No newline at end of file +var _0x8c2f=['info','result','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','AddTagsToWhatsappInteraction','addTags','ids','AddTags','stringify','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./whatsappInteraction.socket','register','request','then','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','WhatsappInteraction,\x20%s,\x20%s','message'];(function(_0x206915,_0x5d88cf){var _0x446548=function(_0xc83cf0){while(--_0xc83cf0){_0x206915['push'](_0x206915['shift']());}};_0x446548(++_0x5d88cf);}(_0x8c2f,0xbd));var _0xf8c2=function(_0x28fd11,_0xb7b5ca){_0x28fd11=_0x28fd11-0x0;var _0x51caa0=_0x8c2f[_0x28fd11];return _0x51caa0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf8c2('0x0'));var BPromise=require(_0xf8c2('0x1'));var rs=require(_0xf8c2('0x2'));var fs=require('fs');var Redis=require(_0xf8c2('0x3'));var db=require(_0xf8c2('0x4'))['db'];var utils=require(_0xf8c2('0x5'));var logger=require(_0xf8c2('0x6'))(_0xf8c2('0x7'));var config=require('../../config/environment');var jayson=require(_0xf8c2('0x8'));var client=jayson[_0xf8c2('0x9')][_0xf8c2('0xa')]({'port':0x232a});config['redis']=_[_0xf8c2('0xb')](config['redis'],{'host':_0xf8c2('0xc'),'port':0x18eb});var socket=require(_0xf8c2('0xd'))(new Redis(config[_0xf8c2('0xe')]));require(_0xf8c2('0xf'))[_0xf8c2('0x10')](socket);function respondWithRpcPromise(_0x398abb,_0x5af03e,_0x31132e){return new BPromise(function(_0x5ce0c6,_0x176259){return client[_0xf8c2('0x11')](_0x398abb,_0x31132e)[_0xf8c2('0x12')](function(_0x15d7d8){logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x5af03e,_0xf8c2('0x13'));logger[_0xf8c2('0x14')](_0xf8c2('0x15'),_0x5af03e,_0xf8c2('0x13'),JSON['stringify'](_0x15d7d8));if(_0x15d7d8[_0xf8c2('0x16')]){if(_0x15d7d8[_0xf8c2('0x16')][_0xf8c2('0x17')]===0x1f4){logger[_0xf8c2('0x16')](_0xf8c2('0x18'),_0x5af03e,_0x15d7d8['error'][_0xf8c2('0x19')]);return _0x176259(_0x15d7d8['error']['message']);}logger[_0xf8c2('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x5af03e,_0x15d7d8[_0xf8c2('0x16')]['message']);return _0x5ce0c6(_0x15d7d8[_0xf8c2('0x16')][_0xf8c2('0x19')]);}else{logger[_0xf8c2('0x1a')](_0xf8c2('0x18'),_0x5af03e,'request\x20sent');_0x5ce0c6(_0x15d7d8[_0xf8c2('0x1b')][_0xf8c2('0x19')]);}})['catch'](function(_0x1ee401){logger[_0xf8c2('0x16')](_0xf8c2('0x18'),_0x5af03e,_0x1ee401);_0x176259(_0x1ee401);});});}exports[_0xf8c2('0x1c')]=function(_0x15aef6){var _0xfd6493=this;return new Promise(function(_0x1cfdd6,_0x5ab0ef){return db[_0xf8c2('0x1d')][_0xf8c2('0x1e')](_0x15aef6[_0xf8c2('0x1f')],{'raw':_0x15aef6[_0xf8c2('0x20')]?_0x15aef6['options'][_0xf8c2('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15aef6[_0xf8c2('0x20')]?_0x15aef6[_0xf8c2('0x20')][_0xf8c2('0x22')]||null:null,'attributes':_0x15aef6[_0xf8c2('0x20')]?_0x15aef6[_0xf8c2('0x20')][_0xf8c2('0x23')]||null:null,'limit':_0x15aef6['options']?_0x15aef6[_0xf8c2('0x20')][_0xf8c2('0x24')]||null:null})['then'](function(_0x62c14e){logger[_0xf8c2('0x1a')](_0xf8c2('0x1c'),_0x15aef6);logger[_0xf8c2('0x14')]('UpdateWhatsappInteraction',_0x15aef6,JSON['stringify'](_0x62c14e));_0x1cfdd6(_0x62c14e);})['catch'](function(_0x31ab89){logger[_0xf8c2('0x16')](_0xf8c2('0x1c'),_0x31ab89[_0xf8c2('0x19')],_0x15aef6);_0x5ab0ef(_0xfd6493[_0xf8c2('0x16')](0x1f4,_0x31ab89[_0xf8c2('0x19')]));});});};exports[_0xf8c2('0x25')]=function(_0x404f1a){return new Promise(function(_0x3544fb,_0x3b9833){return db[_0xf8c2('0x1d')]['find']({'where':_0x404f1a[_0xf8c2('0x20')]?_0x404f1a[_0xf8c2('0x20')][_0xf8c2('0x22')]||null:null})['then'](function(_0x15858b){if(_0x15858b){return _0x15858b[_0xf8c2('0x26')](_0x404f1a[_0xf8c2('0x1f')]['ids'],_['omit'](_0x404f1a[_0xf8c2('0x1f')],[_0xf8c2('0x27'),'id'])||{});}})['spread'](function(_0x7a67dc){logger[_0xf8c2('0x1a')](_0xf8c2('0x28'),_0x404f1a);logger[_0xf8c2('0x14')](_0xf8c2('0x28'),_0x404f1a,JSON[_0xf8c2('0x29')](_0x7a67dc));_0x3544fb(_0x7a67dc);})[_0xf8c2('0x2a')](function(_0x432cb6){logger[_0xf8c2('0x16')](_0xf8c2('0x28'),_0x432cb6[_0xf8c2('0x19')],_0x404f1a);_0x3b9833(_this['error'](0x1f4,_0x432cb6[_0xf8c2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 8be577d..034ba6b 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 _0x124c=['length','whatsappInteraction:','./whatsappInteraction.events','remove','update','emit'];(function(_0x5e090e,_0x447f5f){var _0x462bd0=function(_0xc5534b){while(--_0xc5534b){_0x5e090e['push'](_0x5e090e['shift']());}};_0x462bd0(++_0x447f5f);}(_0x124c,0x12e));var _0xc124=function(_0x4a7a35,_0x1fbfae){_0x4a7a35=_0x4a7a35-0x0;var _0x3e0d0f=_0x124c[_0x4a7a35];return _0x3e0d0f;};'use strict';var WhatsappInteractionEvents=require(_0xc124('0x0'));var events=['save',_0xc124('0x1'),_0xc124('0x2')];function createListener(_0x3aa332,_0x1330d7){return function(_0x29fccb){_0x1330d7[_0xc124('0x3')](_0x3aa332,_0x29fccb);};}function removeListener(_0x361ffc,_0x373ac2){return function(){WhatsappInteractionEvents['removeListener'](_0x361ffc,_0x373ac2);};}exports['register']=function(_0x345fd5){for(var _0x23280d=0x0,_0x2fd5af=events[_0xc124('0x4')];_0x23280d<_0x2fd5af;_0x23280d++){var _0x1c6c0d=events[_0x23280d];var _0x411d16=createListener(_0xc124('0x5')+_0x1c6c0d,_0x345fd5);WhatsappInteractionEvents['on'](_0x1c6c0d,_0x411d16);}}; \ No newline at end of file +var _0x2561=['register','length','whatsappInteraction:','save','remove','update','emit','removeListener'];(function(_0x5ce68f,_0x1c468d){var _0x2a7421=function(_0x3e8270){while(--_0x3e8270){_0x5ce68f['push'](_0x5ce68f['shift']());}};_0x2a7421(++_0x1c468d);}(_0x2561,0x73));var _0x1256=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x2561[_0x4565bf];return _0x5610ba;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x1256('0x0'),_0x1256('0x1'),_0x1256('0x2')];function createListener(_0x3e532d,_0xdc5a66){return function(_0x564641){_0xdc5a66[_0x1256('0x3')](_0x3e532d,_0x564641);};}function removeListener(_0x319e58,_0x2c8892){return function(){WhatsappInteractionEvents[_0x1256('0x4')](_0x319e58,_0x2c8892);};}exports[_0x1256('0x5')]=function(_0x226010){for(var _0x27dc87=0x0,_0x1b7662=events[_0x1256('0x6')];_0x27dc87<_0x1b7662;_0x27dc87++){var _0xd5f4d4=events[_0x27dc87];var _0x32c557=createListener(_0x1256('0x7')+_0xd5f4d4,_0x226010);WhatsappInteractionEvents['on'](_0xd5f4d4,_0x32c557);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 66b3201..1db326f 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 _0xa632=['exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','tracked','whatsappmessage:create','status','put','/:id/accept','accept','/:id/reject','destroy'];(function(_0xe5b433,_0x2c9ceb){var _0x23957f=function(_0x2b41ea){while(--_0x2b41ea){_0xe5b433['push'](_0xe5b433['shift']());}};_0x23957f(++_0x2c9ceb);}(_0xa632,0xb0));var _0x2a63=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0xa632[_0x288f5e];return _0x476cc9;};'use strict';var multer=require(_0x2a63('0x0'));var util=require(_0x2a63('0x1'));var path=require('path');var timeout=require(_0x2a63('0x2'));var express=require('express');var router=express[_0x2a63('0x3')]();var fs_extra=require(_0x2a63('0x4'));var auth=require(_0x2a63('0x5'));var interaction=require(_0x2a63('0x6'));var config=require(_0x2a63('0x7'));var controller=require(_0x2a63('0x8'));router[_0x2a63('0x9')]('/',auth[_0x2a63('0xa')](),controller['index']);router['get'](_0x2a63('0xb'),auth[_0x2a63('0xa')](),controller[_0x2a63('0xc')]);router['get'](_0x2a63('0xd'),auth[_0x2a63('0xa')](),controller[_0x2a63('0xe')]);router[_0x2a63('0xf')]('/',auth['isAuthenticated'](),interaction[_0x2a63('0x10')]('whatsapp',_0x2a63('0x11')),controller['create']);router[_0x2a63('0xf')]('/:id/status',controller[_0x2a63('0x12')]);router[_0x2a63('0x13')](_0x2a63('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x2a63('0x13')](_0x2a63('0x14'),auth[_0x2a63('0xa')](),controller[_0x2a63('0x15')]);router['put'](_0x2a63('0x16'),auth[_0x2a63('0xa')](),controller['reject']);router['delete'](_0x2a63('0xd'),auth[_0x2a63('0xa')](),controller[_0x2a63('0x17')]);module[_0x2a63('0x18')]=router; \ No newline at end of file +var _0x07bd=['tracked','whatsapp','post','/:id/status','status','put','/:id/accept','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','/describe','isAuthenticated','describe','/:id','show'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x07bd,0xa8));var _0xd07b=function(_0x4c064e,_0x4dbc05){_0x4c064e=_0x4c064e-0x0;var _0x5722f8=_0x07bd[_0x4c064e];return _0x5722f8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd07b('0x0'));var timeout=require(_0xd07b('0x1'));var express=require(_0xd07b('0x2'));var router=express[_0xd07b('0x3')]();var fs_extra=require(_0xd07b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd07b('0x5'));var config=require(_0xd07b('0x6'));var controller=require(_0xd07b('0x7'));router[_0xd07b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd07b('0x8')](_0xd07b('0x9'),auth[_0xd07b('0xa')](),controller[_0xd07b('0xb')]);router['get'](_0xd07b('0xc'),auth[_0xd07b('0xa')](),controller[_0xd07b('0xd')]);router['post']('/',auth[_0xd07b('0xa')](),interaction[_0xd07b('0xe')](_0xd07b('0xf'),'whatsappmessage:create'),controller['create']);router[_0xd07b('0x10')](_0xd07b('0x11'),controller[_0xd07b('0x12')]);router[_0xd07b('0x13')](_0xd07b('0xc'),auth[_0xd07b('0xa')](),controller['update']);router[_0xd07b('0x13')](_0xd07b('0x14'),auth[_0xd07b('0xa')](),controller[_0xd07b('0x15')]);router[_0xd07b('0x13')](_0xd07b('0x16'),auth['isAuthenticated'](),controller['reject']);router[_0xd07b('0x17')](_0xd07b('0xc'),auth[_0xd07b('0xa')](),controller[_0xd07b('0x18')]);module[_0xd07b('0x19')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index a424a47..ce51e30 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 _0x947f=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x308b17,_0x3e7f01){var _0x44d753=function(_0x55287f){while(--_0x55287f){_0x308b17['push'](_0x308b17['shift']());}};_0x44d753(++_0x3e7f01);}(_0x947f,0x150));var _0xf947=function(_0x28e2cd,_0x153b42){_0x28e2cd=_0x28e2cd-0x0;var _0x11fd46=_0x947f[_0x28e2cd];return _0x11fd46;};'use strict';var Sequelize=require(_0xf947('0x0'));module[_0xf947('0x1')]={'body':{'type':Sequelize[_0xf947('0x2')](_0xf947('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf947('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf947('0x5')]('in',_0xf947('0x6')),'defaultValue':_0xf947('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xf947('0x7')](0xbe)},'phone':{'type':Sequelize[_0xf947('0x7')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xf947('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xf947('0x7')]},'providerResponse':{'type':Sequelize[_0xf947('0x2')]}}; \ No newline at end of file +var _0x7ba0=['BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports','TEXT'];(function(_0x380307,_0x440ccd){var _0x9ea14b=function(_0x51024c){while(--_0x51024c){_0x380307['push'](_0x380307['shift']());}};_0x9ea14b(++_0x440ccd);}(_0x7ba0,0x1e5));var _0x07ba=function(_0x137007,_0x14852c){_0x137007=_0x137007-0x0;var _0x454de9=_0x7ba0[_0x137007];return _0x454de9;};'use strict';var Sequelize=require(_0x07ba('0x0'));module[_0x07ba('0x1')]={'body':{'type':Sequelize[_0x07ba('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x07ba('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x07ba('0x4')]('in',_0x07ba('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x07ba('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x07ba('0x7')]},'secret':{'type':Sequelize[_0x07ba('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x07ba('0x6')]},'providerResponse':{'type':Sequelize[_0x07ba('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 93a43ef..95f029b 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 _0x4d4a=['../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','index','map','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','WhatsappMessage','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','params','describe','accept','whatsapp','readAt','UserId','user','get','WhatsappInteraction','isNil','read1stAt','format','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','User','agent','email','internal','interface','channel','motionChannel','event','EventManager','role','RejectMessage','rejectMessage','QueryTypes','contact','SIP/%s','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','type','inspect','twilio','messageId','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x24303a,_0x4d2ae1){var _0x53efac=function(_0x1c0e01){while(--_0x1c0e01){_0x24303a['push'](_0x24303a['shift']());}};_0x53efac(++_0x4d2ae1);}(_0x4d4a,0x189));var _0xa4d4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4d4a[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xa4d4('0x0'));var rimraf=require(_0xa4d4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa4d4('0x2'));var BPromise=require(_0xa4d4('0x3'));var Mustache=require('mustache');var util=require(_0xa4d4('0x4'));var path=require('path');var sox=require(_0xa4d4('0x5'));var csv=require(_0xa4d4('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa4d4('0x7'));var _=require(_0xa4d4('0x8'));var squel=require(_0xa4d4('0x9'));var crypto=require(_0xa4d4('0xa'));var jsforce=require(_0xa4d4('0xb'));var deskjs=require(_0xa4d4('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa4d4('0xd'));var Papa=require(_0xa4d4('0xe'));var Redis=require('ioredis');var authService=require(_0xa4d4('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa4d4('0x10'));var hardwareService=require(_0xa4d4('0x11'));var logger=require(_0xa4d4('0x12'))(_0xa4d4('0x13'));var utils=require(_0xa4d4('0x14'));var config=require(_0xa4d4('0x15'));var licenseUtil=require(_0xa4d4('0x16'));var db=require(_0xa4d4('0x17'))['db'];config['redis']=_[_0xa4d4('0x18')](config[_0xa4d4('0x19')],{'host':_0xa4d4('0x1a'),'port':0x18eb});var socket=require(_0xa4d4('0x1b'))(new Redis(config['redis']));require('./whatsappMessage.socket')['register'](socket);var jayson=require(_0xa4d4('0x1c'));var client=jayson[_0xa4d4('0x1d')][_0xa4d4('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0xa4d4('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x251d39,_0x3372a5,_0x4a8687,_0x2be4f1){return new BPromise(function(_0x5152ee,_0x1c0bd7){var _0x6862d=_0x2be4f1||client;return _0x6862d[_0xa4d4('0x1f')](_0x251d39,_0x4a8687)[_0xa4d4('0x20')](function(_0x24aad6){logger[_0xa4d4('0x21')](_0xa4d4('0x22'),_0x3372a5,_0xa4d4('0x23'));logger[_0xa4d4('0x24')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x3372a5,_0xa4d4('0x23'),JSON['stringify'](_0x24aad6));if(_0x24aad6[_0xa4d4('0x25')]){if(_0x24aad6[_0xa4d4('0x25')][_0xa4d4('0x26')]===0x1f4){logger[_0xa4d4('0x25')](_0xa4d4('0x22'),_0x3372a5,_0x24aad6[_0xa4d4('0x25')]['message']);return _0x1c0bd7(_0x24aad6['error'][_0xa4d4('0x27')]);}logger[_0xa4d4('0x25')](_0xa4d4('0x22'),_0x3372a5,_0x24aad6['error'][_0xa4d4('0x27')]);return _0x5152ee(_0x24aad6[_0xa4d4('0x25')]['message']);}else{logger[_0xa4d4('0x21')](_0xa4d4('0x22'),_0x3372a5,_0xa4d4('0x23'));_0x5152ee(_0x24aad6['result'][_0xa4d4('0x27')]);}})[_0xa4d4('0x28')](function(_0x5a9ebb){logger[_0xa4d4('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x3372a5,_0x5a9ebb);_0x1c0bd7(_0x5a9ebb);});});}function respondWithStatusCode(_0x21cf2d,_0x4552c8){_0x4552c8=_0x4552c8||0xcc;return function(_0x211234){if(_0x211234){return _0x21cf2d[_0xa4d4('0x29')](_0x4552c8);}return _0x21cf2d['status'](_0x4552c8)['end']();};}function respondWithResult(_0x860115,_0x171bba){_0x171bba=_0x171bba||0xc8;return function(_0x5ae247){if(_0x5ae247){return _0x860115[_0xa4d4('0x2a')](_0x171bba)[_0xa4d4('0x2b')](_0x5ae247);}};}function respondWithFilteredResult(_0x265dd1,_0x4a3a06){return function(_0x4a1d16){if(_0x4a1d16){var _0x3e6e63=typeof _0x4a3a06[_0xa4d4('0x2c')]===_0xa4d4('0x2d')&&typeof _0x4a3a06[_0xa4d4('0x2e')]==='undefined';var _0x112c17=_0x4a1d16[_0xa4d4('0x2f')];var _0x4ccfaf=_0x3e6e63?0x0:_0x4a3a06[_0xa4d4('0x2c')];var _0x428a22=_0x3e6e63?_0x4a1d16['count']:_0x4a3a06['offset']+_0x4a3a06['limit'];var _0x3bdfac;if(_0x428a22>=_0x112c17){_0x428a22=_0x112c17;_0x3bdfac=0xc8;}else{_0x3bdfac=0xce;}_0x265dd1[_0xa4d4('0x2a')](_0x3bdfac);return _0x265dd1[_0xa4d4('0x30')](_0xa4d4('0x31'),_0x4ccfaf+'-'+_0x428a22+'/'+_0x112c17)[_0xa4d4('0x2b')](_0x4a1d16);}return null;};}function patchUpdates(_0xc47665){return function(_0x40738b){try{jsonpatch[_0xa4d4('0x32')](_0x40738b,_0xc47665,!![]);}catch(_0x6325f1){return BPromise[_0xa4d4('0x33')](_0x6325f1);}return _0x40738b[_0xa4d4('0x34')]();};}function saveUpdates(_0x3f0d9e,_0x1c0ce2){return function(_0x3c552b){if(_0x3c552b){return _0x3c552b[_0xa4d4('0x35')](_0x3f0d9e)[_0xa4d4('0x20')](function(_0x42ecac){return _0x42ecac;});}return null;};}function removeEntity(_0x60648d,_0x62c908){return function(_0x594311){if(_0x594311){return _0x594311[_0xa4d4('0x36')]()[_0xa4d4('0x20')](function(){_0x60648d[_0xa4d4('0x2a')](0xcc)[_0xa4d4('0x37')]();});}};}function handleEntityNotFound(_0x37f911,_0x4b3ff2){return function(_0x234641){if(!_0x234641){_0x37f911[_0xa4d4('0x29')](0x194);}return _0x234641;};}function handleError(_0x22f636,_0x157856){_0x157856=_0x157856||0x1f4;return function(_0x402111){logger[_0xa4d4('0x25')](_0x402111[_0xa4d4('0x38')]);if(_0x402111['name']){delete _0x402111[_0xa4d4('0x39')];}_0x22f636[_0xa4d4('0x2a')](_0x157856)['send'](_0x402111);};}exports[_0xa4d4('0x3a')]=function(_0xc1db71,_0x54b75f){var _0xea7b79={},_0x5cbbc7={},_0xf429b5={'count':0x0,'rows':[]};var _0x9a4976=_[_0xa4d4('0x3b')](db['WhatsappMessage']['rawAttributes'],function(_0x338ebf){return{'name':_0x338ebf[_0xa4d4('0x3c')],'type':_0x338ebf['type'][_0xa4d4('0x3d')]};});_0x5cbbc7[_0xa4d4('0x3e')]=_[_0xa4d4('0x3b')](_0x9a4976,_0xa4d4('0x39'));_0x5cbbc7[_0xa4d4('0x3f')]=_[_0xa4d4('0x40')](_0xc1db71[_0xa4d4('0x3f')]);_0x5cbbc7[_0xa4d4('0x41')]=_['intersection'](_0x5cbbc7[_0xa4d4('0x3e')],_0x5cbbc7[_0xa4d4('0x3f')]);_0xea7b79[_0xa4d4('0x42')]=_[_0xa4d4('0x43')](_0x5cbbc7['model'],qs[_0xa4d4('0x44')](_0xc1db71[_0xa4d4('0x3f')]['fields']));_0xea7b79['attributes']=_0xea7b79['attributes'][_0xa4d4('0x45')]?_0xea7b79[_0xa4d4('0x42')]:_0x5cbbc7[_0xa4d4('0x3e')];if(!_0xc1db71[_0xa4d4('0x3f')][_0xa4d4('0x46')](_0xa4d4('0x47'))){_0xea7b79[_0xa4d4('0x2e')]=qs[_0xa4d4('0x2e')](_0xc1db71[_0xa4d4('0x3f')][_0xa4d4('0x2e')]);_0xea7b79[_0xa4d4('0x2c')]=qs[_0xa4d4('0x2c')](_0xc1db71[_0xa4d4('0x3f')][_0xa4d4('0x2c')]);}_0xea7b79[_0xa4d4('0x48')]=qs['sort'](_0xc1db71[_0xa4d4('0x3f')][_0xa4d4('0x49')]);_0xea7b79['where']=qs['filters'](_[_0xa4d4('0x4a')](_0xc1db71[_0xa4d4('0x3f')],_0x5cbbc7['filters']),_0x9a4976);if(_0xc1db71['query'][_0xa4d4('0x4b')]){_0xea7b79[_0xa4d4('0x4c')]=_[_0xa4d4('0x4d')](_0xea7b79[_0xa4d4('0x4c')],{'$or':_[_0xa4d4('0x3b')](_0x9a4976,function(_0x2358d2){if(_0x2358d2['type']!==_0xa4d4('0x4e')){var _0x5b2334={};_0x5b2334[_0x2358d2[_0xa4d4('0x39')]]={'$like':'%'+_0xc1db71['query'][_0xa4d4('0x4b')]+'%'};return _0x5b2334;}})});}_0xea7b79=_[_0xa4d4('0x4d')]({},_0xea7b79,_0xc1db71[_0xa4d4('0x4f')]);var _0xc5d2bc={'where':_0xea7b79[_0xa4d4('0x4c')]};return db[_0xa4d4('0x50')]['count'](_0xc5d2bc)['then'](function(_0x54e32c){_0xf429b5[_0xa4d4('0x2f')]=_0x54e32c;if(_0xc1db71[_0xa4d4('0x3f')][_0xa4d4('0x51')]){_0xea7b79[_0xa4d4('0x52')]=[{'all':!![]}];}return db[_0xa4d4('0x50')][_0xa4d4('0x53')](_0xea7b79);})[_0xa4d4('0x20')](function(_0x5c6d63){_0xf429b5[_0xa4d4('0x54')]=_0x5c6d63;return _0xf429b5;})['then'](respondWithFilteredResult(_0x54b75f,_0xea7b79))[_0xa4d4('0x28')](handleError(_0x54b75f,null));};exports[_0xa4d4('0x55')]=function(_0x18353d,_0x267843){var _0x2b9852={'raw':!![],'where':{'id':_0x18353d['params']['id']}},_0x12e6ea={};_0x12e6ea[_0xa4d4('0x3e')]=_['keys'](db[_0xa4d4('0x50')][_0xa4d4('0x56')]);_0x12e6ea[_0xa4d4('0x3f')]=_[_0xa4d4('0x40')](_0x18353d[_0xa4d4('0x3f')]);_0x12e6ea[_0xa4d4('0x41')]=_[_0xa4d4('0x43')](_0x12e6ea['model'],_0x12e6ea[_0xa4d4('0x3f')]);_0x2b9852[_0xa4d4('0x42')]=_[_0xa4d4('0x43')](_0x12e6ea[_0xa4d4('0x3e')],qs[_0xa4d4('0x44')](_0x18353d[_0xa4d4('0x3f')][_0xa4d4('0x44')]));_0x2b9852[_0xa4d4('0x42')]=_0x2b9852[_0xa4d4('0x42')][_0xa4d4('0x45')]?_0x2b9852[_0xa4d4('0x42')]:_0x12e6ea[_0xa4d4('0x3e')];if(_0x18353d[_0xa4d4('0x3f')][_0xa4d4('0x51')]){_0x2b9852['include']=[{'all':!![]}];}_0x2b9852=_[_0xa4d4('0x4d')]({},_0x2b9852,_0x18353d['options']);return db[_0xa4d4('0x50')][_0xa4d4('0x57')](_0x2b9852)[_0xa4d4('0x20')](handleEntityNotFound(_0x267843,null))[_0xa4d4('0x20')](respondWithResult(_0x267843,null))[_0xa4d4('0x28')](handleError(_0x267843,null));};exports[_0xa4d4('0x58')]=function(_0x1bd3c6,_0x580fd8){return db[_0xa4d4('0x50')][_0xa4d4('0x58')](_0x1bd3c6['body'],{})['then'](respondWithResult(_0x580fd8,0xc9))['catch'](handleError(_0x580fd8,null));};exports[_0xa4d4('0x35')]=function(_0x4425b0,_0x263c79){if(_0x4425b0[_0xa4d4('0x59')]['id']){delete _0x4425b0[_0xa4d4('0x59')]['id'];}return db['WhatsappMessage'][_0xa4d4('0x57')]({'where':{'id':_0x4425b0[_0xa4d4('0x5a')]['id']}})['then'](handleEntityNotFound(_0x263c79,null))[_0xa4d4('0x20')](saveUpdates(_0x4425b0[_0xa4d4('0x59')],null))[_0xa4d4('0x20')](respondWithResult(_0x263c79,null))['catch'](handleError(_0x263c79,null));};exports[_0xa4d4('0x36')]=function(_0x359c59,_0x5bd8be){return db[_0xa4d4('0x50')][_0xa4d4('0x57')]({'where':{'id':_0x359c59[_0xa4d4('0x5a')]['id']}})[_0xa4d4('0x20')](handleEntityNotFound(_0x5bd8be,null))[_0xa4d4('0x20')](removeEntity(_0x5bd8be,null))[_0xa4d4('0x28')](handleError(_0x5bd8be,null));};exports[_0xa4d4('0x5b')]=function(_0x2094c9,_0x2e7d06){return db['WhatsappMessage'][_0xa4d4('0x5b')]()[_0xa4d4('0x20')](respondWithResult(_0x2e7d06,null))[_0xa4d4('0x28')](handleError(_0x2e7d06,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0xa4d4('0x5c')]=function(_0x2f5f25,_0x4b1e61,_0x45d908){var _0x359fca={'agent':{},'channel':_0xa4d4('0x5d')};if(_0x2f5f25[_0xa4d4('0x59')]['id']){delete _0x2f5f25[_0xa4d4('0x59')]['id'];}_0x2f5f25['body']['read']=!![];_0x2f5f25['body'][_0xa4d4('0x5e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2f5f25['body'][_0xa4d4('0x5f')]=_0x2f5f25[_0xa4d4('0x59')][_0xa4d4('0x5f')]||_0x2f5f25[_0xa4d4('0x60')]['id'];_0x359fca['agent']['id']=_0x2f5f25[_0xa4d4('0x59')]['UserId'];return db[_0xa4d4('0x50')][_0xa4d4('0x57')]({'where':{'id':_0x2f5f25[_0xa4d4('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4b1e61,null))[_0xa4d4('0x20')](saveUpdates(_0x2f5f25[_0xa4d4('0x59')],null))[_0xa4d4('0x20')](function(_0x5bfe8f){if(_0x5bfe8f){_0x359fca[_0xa4d4('0x27')]=_0x5bfe8f[_0xa4d4('0x61')]({'plain':!![]});return db[_0xa4d4('0x62')]['find']({'where':{'id':_0x5bfe8f['WhatsappInteractionId']}});}return null;})[_0xa4d4('0x20')](handleEntityNotFound(_0x4b1e61,null))['then'](function(_0x700d49){if(_0x700d49){return _0x700d49[_0xa4d4('0x35')]({'UserId':_0x2f5f25[_0xa4d4('0x59')][_0xa4d4('0x5f')],'read1stAt':_[_0xa4d4('0x63')](_0x700d49[_0xa4d4('0x64')])?moment()[_0xa4d4('0x65')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xa4d4('0x20')](function(_0x209a57){if(_0x209a57){_0x359fca[_0xa4d4('0x66')]=_0x209a57[_0xa4d4('0x61')]({'plain':!![]});interaction_log[_0xa4d4('0x21')](_0xa4d4('0x67'),_0x2f5f25[_0xa4d4('0x60')]['id'],_0x2f5f25[_0xa4d4('0x60')]['name'],_0x2f5f25[_0xa4d4('0x60')]['role'],_0x359fca[_0xa4d4('0x66')]['id'],_0x2f5f25[_0xa4d4('0x59')]?JSON[_0xa4d4('0x68')](_0x2f5f25[_0xa4d4('0x59')]):_0xa4d4('0x69'));return respondWithRpcPromise(_0xa4d4('0x6a'),_0xa4d4('0x6b'),_0x359fca);}return null;})[_0xa4d4('0x20')](function(_0x2849ea){var _0x150570=_0xa4d4('0x6c')+_0x2849ea['message'][_0xa4d4('0x6d')];return db['sequelize']['query'](_0x150570,{'type':db[_0xa4d4('0x6e')]['QueryTypes'][_0xa4d4('0x6f')],'raw':!![]})[_0xa4d4('0x20')](function(_0x58cec5){return _0x58cec5;});})[_0xa4d4('0x20')](function(_0x9314c0){if(_0x9314c0){_0x359fca[_0xa4d4('0x27')]['contact']=_0x9314c0[0x0];if(!_0x2f5f25[_0xa4d4('0x59')]['UserId'])return;return db[_0xa4d4('0x70')]['find']({'where':{'id':_0x2f5f25[_0xa4d4('0x59')]['UserId'],'role':_0xa4d4('0x71')},'attributes':['id','name','fullname',_0xa4d4('0x72'),_0xa4d4('0x73')],'raw':!![]});}return null;})[_0xa4d4('0x20')](function(_0x1c99fd){if(!_0x1c99fd)return null;_0x359fca[_0xa4d4('0x27')]['agent']=_0x1c99fd;return _0x359fca;})['then'](function(_0x3d017d){if(_0x3d017d){if(_0x2f5f25['body']['manual']){_0x359fca['message'][_0xa4d4('0x74')]=util[_0xa4d4('0x65')]('SIP/%s',_0x2f5f25[_0xa4d4('0x60')][_0xa4d4('0x39')]);_0x359fca[_0xa4d4('0x27')][_0xa4d4('0x75')]=_0x359fca[_0xa4d4('0x75')];_0x359fca[_0xa4d4('0x27')][_0xa4d4('0x76')]=_0x359fca[_0xa4d4('0x75')];_0x359fca[_0xa4d4('0x27')][_0xa4d4('0x77')]='accept';return respondWithRpcPromise(_0xa4d4('0x78'),_0xa4d4('0x78'),{'event':'acceptmessage','message':_0x359fca['message']},client9002)['then'](function(){return _0x359fca;});}return _0x359fca;}return null;})[_0xa4d4('0x20')](respondWithResult(_0x4b1e61,null))['catch'](handleError(_0x4b1e61,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0xa4d4('0x33')]=function(_0x32c1f2,_0x1578ca,_0x2f2097){var _0xcb28e6={'agent':{},'channel':_0xa4d4('0x5d')};if(_0x32c1f2[_0xa4d4('0x59')]['id']){delete _0x32c1f2[_0xa4d4('0x59')]['id'];}_0x32c1f2[_0xa4d4('0x59')]['UserId']=_0x32c1f2['body'][_0xa4d4('0x5f')]||_0x32c1f2[_0xa4d4('0x60')]['id'];_0xcb28e6[_0xa4d4('0x71')]['id']=_0x32c1f2[_0xa4d4('0x59')][_0xa4d4('0x5f')];return db['WhatsappMessage'][_0xa4d4('0x57')]({'where':{'id':_0x32c1f2[_0xa4d4('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1578ca,null))['then'](function(_0x75c7f9){if(_0x75c7f9){_0xcb28e6[_0xa4d4('0x27')]=_0x75c7f9[_0xa4d4('0x61')]({'plain':!![]});return db[_0xa4d4('0x62')][_0xa4d4('0x57')]({'where':{'id':_0x75c7f9['WhatsappInteractionId']}});}return null;})[_0xa4d4('0x20')](handleEntityNotFound(_0x1578ca,null))[_0xa4d4('0x20')](function(_0xdd4bd){if(_0xdd4bd){_0xcb28e6[_0xa4d4('0x66')]=_0xdd4bd[_0xa4d4('0x61')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x32c1f2['user']['id'],_0x32c1f2[_0xa4d4('0x60')][_0xa4d4('0x39')],_0x32c1f2[_0xa4d4('0x60')][_0xa4d4('0x79')],_0xcb28e6[_0xa4d4('0x66')]['id'],_0x32c1f2[_0xa4d4('0x59')]?JSON['stringify'](_0x32c1f2[_0xa4d4('0x59')]):_0xa4d4('0x69'));return respondWithRpcPromise(_0xa4d4('0x7a'),_0xa4d4('0x7b'),_0xcb28e6);}return null;})[_0xa4d4('0x20')](function(_0x43a1ce){var _0x59b141=_0xa4d4('0x6c')+_0x43a1ce[_0xa4d4('0x27')][_0xa4d4('0x6d')];return db['sequelize'][_0xa4d4('0x3f')](_0x59b141,{'type':db['Sequelize'][_0xa4d4('0x7c')]['SELECT'],'raw':!![]})[_0xa4d4('0x20')](function(_0x5e70b9){return _0x5e70b9;});})[_0xa4d4('0x20')](function(_0x5531ee){if(_0x5531ee){_0xcb28e6[_0xa4d4('0x27')][_0xa4d4('0x7d')]=_0x5531ee[0x0];if(!_0x32c1f2[_0xa4d4('0x59')][_0xa4d4('0x5f')])return;return db['User'][_0xa4d4('0x57')]({'where':{'id':_0x32c1f2['body'][_0xa4d4('0x5f')],'role':'agent'},'attributes':['id',_0xa4d4('0x39'),'fullname','email',_0xa4d4('0x73')],'raw':!![]});}return null;})[_0xa4d4('0x20')](function(_0x53ca0a){if(!_0x53ca0a)return null;_0xcb28e6[_0xa4d4('0x27')]['agent']=_0x53ca0a;return _0xcb28e6;})[_0xa4d4('0x20')](function(_0x48ae4b){if(_0x48ae4b){_0x48ae4b[_0xa4d4('0x27')][_0xa4d4('0x74')]=util[_0xa4d4('0x65')](_0xa4d4('0x7e'),_0x32c1f2['user']['name']);_0x48ae4b[_0xa4d4('0x27')]['channel']=_0xcb28e6[_0xa4d4('0x75')];_0x48ae4b[_0xa4d4('0x27')]['motionChannel']=_0xcb28e6[_0xa4d4('0x75')];_0x48ae4b[_0xa4d4('0x27')][_0xa4d4('0x77')]='reject';respondWithRpcPromise(_0xa4d4('0x78'),_0xa4d4('0x78'),{'event':_0xa4d4('0x7f'),'message':_0x48ae4b[_0xa4d4('0x27')]},client9002);return _0xcb28e6;}return null;})[_0xa4d4('0x20')](respondWithResult(_0x1578ca,null))[_0xa4d4('0x28')](handleError(_0x1578ca,null));};exports[_0xa4d4('0x2a')]=function(_0x34d13e,_0x589735,_0x415d49){if(_0x34d13e[_0xa4d4('0x59')]['id']){delete _0x34d13e['body']['id'];}var _0x1eaefd;return db['WhatsappMessage'][_0xa4d4('0x57')]({'where':{'id':_0x34d13e[_0xa4d4('0x5a')]['id']}})[_0xa4d4('0x20')](handleEntityNotFound(_0x589735,null))['then'](function(_0x5c298b){if(_0x5c298b){_0x1eaefd=_0x5c298b;return db[_0xa4d4('0x80')][_0xa4d4('0x57')]({'where':{'id':_0x5c298b[_0xa4d4('0x81')]}});}})[_0xa4d4('0x20')](handleEntityNotFound(_0x589735,null))[_0xa4d4('0x20')](function(_0x5522f2){if(_0x5522f2){logger[_0xa4d4('0x24')](_0xa4d4('0x82'),'status',_0xa4d4('0x83'),_0x5522f2[_0xa4d4('0x84')],util[_0xa4d4('0x85')](_0x34d13e['body'],{'showHidden':![],'depth':null}));switch(_0x5522f2[_0xa4d4('0x84')]){case _0xa4d4('0x86'):if(_0x34d13e[_0xa4d4('0x59')]['MessageSid']&&_0x34d13e[_0xa4d4('0x59')]['MessageSid']===_0x1eaefd[_0xa4d4('0x87')]&&_0x34d13e[_0xa4d4('0x59')]['MessageStatus']&&_0x34d13e[_0xa4d4('0x59')]['MessageStatus']===_0xa4d4('0x88')){return _0x1eaefd[_0xa4d4('0x35')]({'read':!![]});}else{logger[_0xa4d4('0x25')](_0xa4d4('0x89'),_0xa4d4('0x2a'),_0xa4d4('0x86'),util[_0xa4d4('0x85')](_0x34d13e[_0xa4d4('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x1eaefd;}})[_0xa4d4('0x20')](respondWithResult(_0x589735,null))[_0xa4d4('0x28')](handleError(_0x589735,null));}; \ No newline at end of file +var _0x9457=['request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','http','request','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','WhatsappMessage','includeAll','include','findAll','show','params','length','find','create','body','destroy','describe','whatsapp-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','EventManager','acceptmessage','whatsapp','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','contact','interface','event','WhatsappAccount','WhatsappAccountId','twilio','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','rimraf','zip-dir'];(function(_0x59031e,_0x5e8e19){var _0x829afe=function(_0x289d6e){while(--_0x289d6e){_0x59031e['push'](_0x59031e['shift']());}};_0x829afe(++_0x5e8e19);}(_0x9457,0x1a1));var _0x7945=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9457[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7945('0x0'));var rimraf=require(_0x7945('0x1'));var zipdir=require(_0x7945('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7945('0x3'));var moment=require(_0x7945('0x4'));var BPromise=require(_0x7945('0x5'));var Mustache=require('mustache');var util=require(_0x7945('0x6'));var path=require(_0x7945('0x7'));var sox=require(_0x7945('0x8'));var csv=require(_0x7945('0x9'));var ejs=require(_0x7945('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7945('0xb'));var crypto=require(_0x7945('0xc'));var jsforce=require(_0x7945('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7945('0xe'));var Redis=require(_0x7945('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7945('0x10'));var hardwareService=require(_0x7945('0x11'));var logger=require(_0x7945('0x12'))(_0x7945('0x13'));var utils=require(_0x7945('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7945('0x15'))['db'];config[_0x7945('0x16')]=_[_0x7945('0x17')](config[_0x7945('0x16')],{'host':_0x7945('0x18'),'port':0x18eb});var socket=require(_0x7945('0x19'))(new Redis(config[_0x7945('0x16')]));require(_0x7945('0x1a'))[_0x7945('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x7945('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x7945('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x23dca6,_0x21cbc8,_0x374437,_0x37771b){return new BPromise(function(_0xfe731f,_0x5d31cd){var _0x5ae1dc=_0x37771b||client;return _0x5ae1dc[_0x7945('0x1d')](_0x23dca6,_0x374437)['then'](function(_0x155de4){logger['info'](_0x7945('0x1e'),_0x21cbc8,_0x7945('0x1f'));logger[_0x7945('0x20')](_0x7945('0x21'),_0x21cbc8,_0x7945('0x1f'),JSON[_0x7945('0x22')](_0x155de4));if(_0x155de4[_0x7945('0x23')]){if(_0x155de4[_0x7945('0x23')][_0x7945('0x24')]===0x1f4){logger[_0x7945('0x23')](_0x7945('0x1e'),_0x21cbc8,_0x155de4[_0x7945('0x23')][_0x7945('0x25')]);return _0x5d31cd(_0x155de4[_0x7945('0x23')][_0x7945('0x25')]);}logger['error'](_0x7945('0x1e'),_0x21cbc8,_0x155de4['error'][_0x7945('0x25')]);return _0xfe731f(_0x155de4['error'][_0x7945('0x25')]);}else{logger[_0x7945('0x26')](_0x7945('0x1e'),_0x21cbc8,_0x7945('0x1f'));_0xfe731f(_0x155de4[_0x7945('0x27')][_0x7945('0x25')]);}})[_0x7945('0x28')](function(_0x408d00){logger[_0x7945('0x23')](_0x7945('0x1e'),_0x21cbc8,_0x408d00);_0x5d31cd(_0x408d00);});});}function respondWithStatusCode(_0x26f416,_0x166638){_0x166638=_0x166638||0xcc;return function(_0x48fefa){if(_0x48fefa){return _0x26f416[_0x7945('0x29')](_0x166638);}return _0x26f416[_0x7945('0x2a')](_0x166638)[_0x7945('0x2b')]();};}function respondWithResult(_0x147b98,_0x3e55a4){_0x3e55a4=_0x3e55a4||0xc8;return function(_0x4d48be){if(_0x4d48be){return _0x147b98[_0x7945('0x2a')](_0x3e55a4)[_0x7945('0x2c')](_0x4d48be);}};}function respondWithFilteredResult(_0x2fbc6f,_0x28fbd5){return function(_0x590f20){if(_0x590f20){var _0x1a9e53=typeof _0x28fbd5[_0x7945('0x2d')]===_0x7945('0x2e')&&typeof _0x28fbd5[_0x7945('0x2f')]===_0x7945('0x2e');var _0x4d66ae=_0x590f20[_0x7945('0x30')];var _0x4c8d4d=_0x1a9e53?0x0:_0x28fbd5['offset'];var _0x455ec0=_0x1a9e53?_0x590f20[_0x7945('0x30')]:_0x28fbd5['offset']+_0x28fbd5['limit'];var _0x58b3bd;if(_0x455ec0>=_0x4d66ae){_0x455ec0=_0x4d66ae;_0x58b3bd=0xc8;}else{_0x58b3bd=0xce;}_0x2fbc6f[_0x7945('0x2a')](_0x58b3bd);return _0x2fbc6f[_0x7945('0x31')](_0x7945('0x32'),_0x4c8d4d+'-'+_0x455ec0+'/'+_0x4d66ae)[_0x7945('0x2c')](_0x590f20);}return null;};}function patchUpdates(_0x41aad9){return function(_0x481811){try{jsonpatch[_0x7945('0x33')](_0x481811,_0x41aad9,!![]);}catch(_0x4e0b1a){return BPromise[_0x7945('0x34')](_0x4e0b1a);}return _0x481811['save']();};}function saveUpdates(_0x3ada76,_0x5a7eeb){return function(_0x57b2f1){if(_0x57b2f1){return _0x57b2f1[_0x7945('0x35')](_0x3ada76)[_0x7945('0x36')](function(_0x173203){return _0x173203;});}return null;};}function removeEntity(_0x36916e,_0x7e993){return function(_0x3e4b08){if(_0x3e4b08){return _0x3e4b08['destroy']()['then'](function(){_0x36916e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x273558,_0xf6cba6){return function(_0x14b904){if(!_0x14b904){_0x273558[_0x7945('0x29')](0x194);}return _0x14b904;};}function handleError(_0x3337a3,_0x3b8716){_0x3b8716=_0x3b8716||0x1f4;return function(_0x2d8d1c){logger[_0x7945('0x23')](_0x2d8d1c[_0x7945('0x37')]);if(_0x2d8d1c[_0x7945('0x38')]){delete _0x2d8d1c['name'];}_0x3337a3[_0x7945('0x2a')](_0x3b8716)[_0x7945('0x39')](_0x2d8d1c);};}exports[_0x7945('0x3a')]=function(_0xf493a4,_0x16bc32){var _0x1483d8={},_0x13a976={},_0x194fb5={'count':0x0,'rows':[]};var _0x5b60d1=_[_0x7945('0x3b')](db['WhatsappMessage'][_0x7945('0x3c')],function(_0x3feca9){return{'name':_0x3feca9[_0x7945('0x3d')],'type':_0x3feca9[_0x7945('0x3e')][_0x7945('0x3f')]};});_0x13a976[_0x7945('0x40')]=_[_0x7945('0x3b')](_0x5b60d1,'name');_0x13a976[_0x7945('0x41')]=_[_0x7945('0x42')](_0xf493a4[_0x7945('0x41')]);_0x13a976[_0x7945('0x43')]=_[_0x7945('0x44')](_0x13a976[_0x7945('0x40')],_0x13a976[_0x7945('0x41')]);_0x1483d8[_0x7945('0x45')]=_['intersection'](_0x13a976[_0x7945('0x40')],qs['fields'](_0xf493a4[_0x7945('0x41')][_0x7945('0x46')]));_0x1483d8[_0x7945('0x45')]=_0x1483d8['attributes']['length']?_0x1483d8['attributes']:_0x13a976[_0x7945('0x40')];if(!_0xf493a4[_0x7945('0x41')][_0x7945('0x47')](_0x7945('0x48'))){_0x1483d8[_0x7945('0x2f')]=qs[_0x7945('0x2f')](_0xf493a4['query'][_0x7945('0x2f')]);_0x1483d8[_0x7945('0x2d')]=qs[_0x7945('0x2d')](_0xf493a4['query'][_0x7945('0x2d')]);}_0x1483d8[_0x7945('0x49')]=qs[_0x7945('0x4a')](_0xf493a4['query']['sort']);_0x1483d8['where']=qs[_0x7945('0x43')](_['pick'](_0xf493a4[_0x7945('0x41')],_0x13a976[_0x7945('0x43')]),_0x5b60d1);if(_0xf493a4['query'][_0x7945('0x4b')]){_0x1483d8[_0x7945('0x4c')]=_[_0x7945('0x4d')](_0x1483d8['where'],{'$or':_[_0x7945('0x3b')](_0x5b60d1,function(_0x1f5844){if(_0x1f5844[_0x7945('0x3e')]!==_0x7945('0x4e')){var _0x35c8d8={};_0x35c8d8[_0x1f5844[_0x7945('0x38')]]={'$like':'%'+_0xf493a4['query'][_0x7945('0x4b')]+'%'};return _0x35c8d8;}})});}_0x1483d8=_['merge']({},_0x1483d8,_0xf493a4[_0x7945('0x4f')]);var _0x53f61e={'where':_0x1483d8[_0x7945('0x4c')]};return db[_0x7945('0x50')][_0x7945('0x30')](_0x53f61e)[_0x7945('0x36')](function(_0x4b07ce){_0x194fb5[_0x7945('0x30')]=_0x4b07ce;if(_0xf493a4[_0x7945('0x41')][_0x7945('0x51')]){_0x1483d8[_0x7945('0x52')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x7945('0x53')](_0x1483d8);})[_0x7945('0x36')](function(_0x2d5064){_0x194fb5['rows']=_0x2d5064;return _0x194fb5;})[_0x7945('0x36')](respondWithFilteredResult(_0x16bc32,_0x1483d8))[_0x7945('0x28')](handleError(_0x16bc32,null));};exports[_0x7945('0x54')]=function(_0x21f39d,_0x402ef1){var _0x1cac7e={'raw':!![],'where':{'id':_0x21f39d[_0x7945('0x55')]['id']}},_0x3f2aba={};_0x3f2aba[_0x7945('0x40')]=_[_0x7945('0x42')](db[_0x7945('0x50')][_0x7945('0x3c')]);_0x3f2aba[_0x7945('0x41')]=_[_0x7945('0x42')](_0x21f39d[_0x7945('0x41')]);_0x3f2aba[_0x7945('0x43')]=_['intersection'](_0x3f2aba[_0x7945('0x40')],_0x3f2aba[_0x7945('0x41')]);_0x1cac7e['attributes']=_['intersection'](_0x3f2aba['model'],qs[_0x7945('0x46')](_0x21f39d[_0x7945('0x41')][_0x7945('0x46')]));_0x1cac7e[_0x7945('0x45')]=_0x1cac7e[_0x7945('0x45')][_0x7945('0x56')]?_0x1cac7e[_0x7945('0x45')]:_0x3f2aba[_0x7945('0x40')];if(_0x21f39d['query'][_0x7945('0x51')]){_0x1cac7e[_0x7945('0x52')]=[{'all':!![]}];}_0x1cac7e=_[_0x7945('0x4d')]({},_0x1cac7e,_0x21f39d[_0x7945('0x4f')]);return db['WhatsappMessage'][_0x7945('0x57')](_0x1cac7e)[_0x7945('0x36')](handleEntityNotFound(_0x402ef1,null))[_0x7945('0x36')](respondWithResult(_0x402ef1,null))[_0x7945('0x28')](handleError(_0x402ef1,null));};exports[_0x7945('0x58')]=function(_0x41784c,_0x1eb859){return db[_0x7945('0x50')][_0x7945('0x58')](_0x41784c['body'],{})[_0x7945('0x36')](respondWithResult(_0x1eb859,0xc9))[_0x7945('0x28')](handleError(_0x1eb859,null));};exports['update']=function(_0x57c255,_0x4d051d){if(_0x57c255['body']['id']){delete _0x57c255[_0x7945('0x59')]['id'];}return db[_0x7945('0x50')]['find']({'where':{'id':_0x57c255['params']['id']}})[_0x7945('0x36')](handleEntityNotFound(_0x4d051d,null))[_0x7945('0x36')](saveUpdates(_0x57c255[_0x7945('0x59')],null))[_0x7945('0x36')](respondWithResult(_0x4d051d,null))[_0x7945('0x28')](handleError(_0x4d051d,null));};exports[_0x7945('0x5a')]=function(_0x3a2109,_0x375fbf){return db[_0x7945('0x50')][_0x7945('0x57')]({'where':{'id':_0x3a2109['params']['id']}})[_0x7945('0x36')](handleEntityNotFound(_0x375fbf,null))[_0x7945('0x36')](removeEntity(_0x375fbf,null))['catch'](handleError(_0x375fbf,null));};exports[_0x7945('0x5b')]=function(_0x159d1b,_0x5366e8){return db['WhatsappMessage'][_0x7945('0x5b')]()['then'](respondWithResult(_0x5366e8,null))['catch'](handleError(_0x5366e8,null));};var interaction_log=require('../../config/logger')(_0x7945('0x5c'));exports[_0x7945('0x5d')]=function(_0x5e6611,_0x453820,_0x6b1b94){var _0x7a0200={'agent':{},'channel':'whatsapp'};if(_0x5e6611[_0x7945('0x59')]['id']){delete _0x5e6611[_0x7945('0x59')]['id'];}_0x5e6611['body'][_0x7945('0x5e')]=!![];_0x5e6611['body'][_0x7945('0x5f')]=moment()[_0x7945('0x60')](_0x7945('0x61'));_0x5e6611[_0x7945('0x59')][_0x7945('0x62')]=_0x5e6611[_0x7945('0x59')][_0x7945('0x62')]||_0x5e6611['user']['id'];_0x7a0200[_0x7945('0x63')]['id']=_0x5e6611[_0x7945('0x59')]['UserId'];return db['WhatsappMessage'][_0x7945('0x57')]({'where':{'id':_0x5e6611[_0x7945('0x55')]['id'],'UserId':null}})[_0x7945('0x36')](handleEntityNotFound(_0x453820,null))[_0x7945('0x36')](saveUpdates(_0x5e6611[_0x7945('0x59')],null))['then'](function(_0x32b73b){if(_0x32b73b){_0x7a0200[_0x7945('0x25')]=_0x32b73b[_0x7945('0x64')]({'plain':!![]});return db[_0x7945('0x65')][_0x7945('0x57')]({'where':{'id':_0x32b73b[_0x7945('0x66')]}});}return null;})[_0x7945('0x36')](handleEntityNotFound(_0x453820,null))[_0x7945('0x36')](function(_0x5d48a1){if(_0x5d48a1){return _0x5d48a1[_0x7945('0x35')]({'UserId':_0x5e6611[_0x7945('0x59')]['UserId'],'read1stAt':_[_0x7945('0x67')](_0x5d48a1[_0x7945('0x68')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x7945('0x36')](function(_0x26dbeb){if(_0x26dbeb){_0x7a0200[_0x7945('0x69')]=_0x26dbeb[_0x7945('0x64')]({'plain':!![]});interaction_log[_0x7945('0x26')](_0x7945('0x6a'),_0x5e6611[_0x7945('0x6b')]['id'],_0x5e6611[_0x7945('0x6b')][_0x7945('0x38')],_0x5e6611[_0x7945('0x6b')]['role'],_0x7a0200[_0x7945('0x69')]['id'],_0x5e6611[_0x7945('0x59')]?JSON[_0x7945('0x22')](_0x5e6611[_0x7945('0x59')]):_0x7945('0x6c'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x7a0200);}return null;})['then'](function(_0x3a927b){var _0x446893='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3a927b[_0x7945('0x25')][_0x7945('0x6d')];return db[_0x7945('0x6e')][_0x7945('0x41')](_0x446893,{'type':db[_0x7945('0x6f')][_0x7945('0x70')][_0x7945('0x71')],'raw':!![]})['then'](function(_0x24add9){return _0x24add9;});})[_0x7945('0x36')](function(_0x299494){if(_0x299494){_0x7a0200[_0x7945('0x25')]['contact']=_0x299494[0x0];if(!_0x5e6611[_0x7945('0x59')][_0x7945('0x62')])return;return db[_0x7945('0x72')][_0x7945('0x57')]({'where':{'id':_0x5e6611[_0x7945('0x59')]['UserId'],'role':'agent'},'attributes':['id',_0x7945('0x38'),_0x7945('0x73'),_0x7945('0x74'),_0x7945('0x75')],'raw':!![]});}return null;})[_0x7945('0x36')](function(_0x2c5233){if(!_0x2c5233)return null;_0x7a0200[_0x7945('0x25')]['agent']=_0x2c5233;return _0x7a0200;})[_0x7945('0x36')](function(_0x4eae41){if(_0x4eae41){if(_0x5e6611[_0x7945('0x59')][_0x7945('0x76')]){_0x7a0200[_0x7945('0x25')]['interface']=util['format'](_0x7945('0x77'),_0x5e6611[_0x7945('0x6b')][_0x7945('0x38')]);_0x7a0200[_0x7945('0x25')]['channel']=_0x7a0200[_0x7945('0x78')];_0x7a0200['message'][_0x7945('0x79')]=_0x7a0200['channel'];_0x7a0200['message']['event']=_0x7945('0x5d');return respondWithRpcPromise('EventManager',_0x7945('0x7a'),{'event':_0x7945('0x7b'),'message':_0x7a0200[_0x7945('0x25')]},client9002)['then'](function(){return _0x7a0200;});}return _0x7a0200;}return null;})[_0x7945('0x36')](respondWithResult(_0x453820,null))['catch'](handleError(_0x453820,null));};var interaction_log=require(_0x7945('0x12'))(_0x7945('0x5c'));exports[_0x7945('0x34')]=function(_0x4f9c35,_0x37d5e8,_0xf54736){var _0x9ac45e={'agent':{},'channel':_0x7945('0x7c')};if(_0x4f9c35[_0x7945('0x59')]['id']){delete _0x4f9c35[_0x7945('0x59')]['id'];}_0x4f9c35['body'][_0x7945('0x62')]=_0x4f9c35[_0x7945('0x59')][_0x7945('0x62')]||_0x4f9c35[_0x7945('0x6b')]['id'];_0x9ac45e[_0x7945('0x63')]['id']=_0x4f9c35[_0x7945('0x59')][_0x7945('0x62')];return db['WhatsappMessage']['find']({'where':{'id':_0x4f9c35['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x37d5e8,null))[_0x7945('0x36')](function(_0x8c879d){if(_0x8c879d){_0x9ac45e['message']=_0x8c879d[_0x7945('0x64')]({'plain':!![]});return db[_0x7945('0x65')]['find']({'where':{'id':_0x8c879d[_0x7945('0x66')]}});}return null;})[_0x7945('0x36')](handleEntityNotFound(_0x37d5e8,null))['then'](function(_0x5114db){if(_0x5114db){_0x9ac45e[_0x7945('0x69')]=_0x5114db['get']({'plain':!![]});interaction_log[_0x7945('0x26')](_0x7945('0x7d'),_0x4f9c35[_0x7945('0x6b')]['id'],_0x4f9c35[_0x7945('0x6b')]['name'],_0x4f9c35[_0x7945('0x6b')][_0x7945('0x7e')],_0x9ac45e[_0x7945('0x69')]['id'],_0x4f9c35[_0x7945('0x59')]?JSON['stringify'](_0x4f9c35['body']):'null');return respondWithRpcPromise(_0x7945('0x7f'),_0x7945('0x80'),_0x9ac45e);}return null;})[_0x7945('0x36')](function(_0x57300f){var _0x3a6fd6=_0x7945('0x81')+_0x57300f[_0x7945('0x25')]['ContactId'];return db[_0x7945('0x6e')]['query'](_0x3a6fd6,{'type':db['Sequelize'][_0x7945('0x70')][_0x7945('0x71')],'raw':!![]})[_0x7945('0x36')](function(_0x154491){return _0x154491;});})[_0x7945('0x36')](function(_0xe021a3){if(_0xe021a3){_0x9ac45e[_0x7945('0x25')][_0x7945('0x82')]=_0xe021a3[0x0];if(!_0x4f9c35[_0x7945('0x59')][_0x7945('0x62')])return;return db[_0x7945('0x72')][_0x7945('0x57')]({'where':{'id':_0x4f9c35[_0x7945('0x59')]['UserId'],'role':_0x7945('0x63')},'attributes':['id','name',_0x7945('0x73'),_0x7945('0x74'),_0x7945('0x75')],'raw':!![]});}return null;})['then'](function(_0x37499f){if(!_0x37499f)return null;_0x9ac45e[_0x7945('0x25')][_0x7945('0x63')]=_0x37499f;return _0x9ac45e;})[_0x7945('0x36')](function(_0x189fa7){if(_0x189fa7){_0x189fa7['message'][_0x7945('0x83')]=util['format'](_0x7945('0x77'),_0x4f9c35[_0x7945('0x6b')][_0x7945('0x38')]);_0x189fa7[_0x7945('0x25')][_0x7945('0x78')]=_0x9ac45e[_0x7945('0x78')];_0x189fa7[_0x7945('0x25')]['motionChannel']=_0x9ac45e[_0x7945('0x78')];_0x189fa7[_0x7945('0x25')][_0x7945('0x84')]='reject';respondWithRpcPromise(_0x7945('0x7a'),_0x7945('0x7a'),{'event':'rejectmessage','message':_0x189fa7['message']},client9002);return _0x9ac45e;}return null;})['then'](respondWithResult(_0x37d5e8,null))[_0x7945('0x28')](handleError(_0x37d5e8,null));};exports['status']=function(_0x3d8d55,_0x3ed678,_0xd3d760){if(_0x3d8d55[_0x7945('0x59')]['id']){delete _0x3d8d55['body']['id'];}var _0x28c5ce;return db['WhatsappMessage'][_0x7945('0x57')]({'where':{'id':_0x3d8d55[_0x7945('0x55')]['id']}})['then'](handleEntityNotFound(_0x3ed678,null))[_0x7945('0x36')](function(_0x462de9){if(_0x462de9){_0x28c5ce=_0x462de9;return db[_0x7945('0x85')][_0x7945('0x57')]({'where':{'id':_0x462de9[_0x7945('0x86')]}});}})['then'](handleEntityNotFound(_0x3ed678,null))['then'](function(_0x76c2f5){if(_0x76c2f5){logger['debug']('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x7945('0x2a'),'received\x20delivery\x20report\x20from',_0x76c2f5[_0x7945('0x3e')],util['inspect'](_0x3d8d55[_0x7945('0x59')],{'showHidden':![],'depth':null}));switch(_0x76c2f5['type']){case _0x7945('0x87'):if(_0x3d8d55[_0x7945('0x59')]['MessageSid']&&_0x3d8d55['body']['MessageSid']===_0x28c5ce[_0x7945('0x88')]&&_0x3d8d55[_0x7945('0x59')][_0x7945('0x89')]&&_0x3d8d55['body'][_0x7945('0x89')]==='read'){return _0x28c5ce[_0x7945('0x35')]({'read':!![]});}else{logger['error'](_0x7945('0x8a'),_0x7945('0x2a'),_0x7945('0x87'),util[_0x7945('0x8b')](_0x3d8d55['body'],{'showHidden':![],'depth':null}));}break;}return _0x28c5ce;}})[_0x7945('0x36')](respondWithResult(_0x3ed678,null))[_0x7945('0x28')](handleError(_0x3ed678,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 21f33cb..e0e311f 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 _0x55ea=['WhatsappMessage','save','update','remove','exports','events','../../mysqldb'];(function(_0x49e868,_0x55ed08){var _0x4ebf3c=function(_0x4b93bf){while(--_0x4b93bf){_0x49e868['push'](_0x49e868['shift']());}};_0x4ebf3c(++_0x55ed08);}(_0x55ea,0xc9));var _0xa55e=function(_0x55faff,_0x1a1147){_0x55faff=_0x55faff-0x0;var _0x9fb04e=_0x55ea[_0x55faff];return _0x9fb04e;};'use strict';var EventEmitter=require(_0xa55e('0x0'));var WhatsappMessage=require(_0xa55e('0x1'))['db'][_0xa55e('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa55e('0x3'),'afterUpdate':_0xa55e('0x4'),'afterDestroy':_0xa55e('0x5')};function emitEvent(_0x1325cc){return function(_0x95af3d,_0x54f178,_0x2d1040){WhatsappMessageEvents['emit'](_0x1325cc+':'+_0x95af3d['id'],_0x95af3d);WhatsappMessageEvents['emit'](_0x1325cc,_0x95af3d);_0x2d1040(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xa55e('0x6')]=WhatsappMessageEvents; \ No newline at end of file +var _0xb921=['hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xb921,0x16a));var _0x1b92=function(_0x2cc8bb,_0x5f2607){_0x2cc8bb=_0x2cc8bb-0x0;var _0x140e40=_0xb921[_0x2cc8bb];return _0x140e40;};'use strict';var EventEmitter=require(_0x1b92('0x0'));var WhatsappMessage=require(_0x1b92('0x1'))['db'][_0x1b92('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x1b92('0x3')](0x0);var events={'afterCreate':_0x1b92('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x389da0){return function(_0xc3832e,_0x1e49a8,_0x10868d){WhatsappMessageEvents[_0x1b92('0x5')](_0x389da0+':'+_0xc3832e['id'],_0xc3832e);WhatsappMessageEvents[_0x1b92('0x5')](_0x389da0,_0xc3832e);_0x10868d(null);};}for(var e in events){if(events[_0x1b92('0x6')](e)){var event=events[e];WhatsappMessage[_0x1b92('0x7')](e,emitEvent(event));}}module[_0x1b92('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 2dff3ea..c6ac5d6 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 _0x3151=['find','WhatsappAccountId','type','twilio','accountSid','phone','authToken','create','whatsapp:','remote','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','baseUrl','/whatsapp/v1/','text','POST','Bearer\x20','statuses','message_id','err','WhatsappMessage,\x20%s','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','node-fetch','path','rimraf','exports','define','WhatsappMessage','messageId','fti_whatsapp_messages','body','FULLTEXT','get','direction','toLowerCase','out','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','secret'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x3151,0x1c0));var _0x1315=function(_0x17369c,_0x57e58f){_0x17369c=_0x17369c-0x0;var _0x5d558e=_0x3151[_0x17369c];return _0x5d558e;};'use strict';var _=require(_0x1315('0x0'));var util=require(_0x1315('0x1'));var logger=require(_0x1315('0x2'))(_0x1315('0x3'));var moment=require(_0x1315('0x4'));var BPromise=require(_0x1315('0x5'));var rp=require(_0x1315('0x6'));var fetch=require(_0x1315('0x7'));var fs=require('fs');var path=require(_0x1315('0x8'));var rimraf=require(_0x1315('0x9'));var config=require('../../config/environment');var attributes=require('./whatsappMessage.attributes');module[_0x1315('0xa')]=function(_0x546c31,_0x18b49){return _0x546c31[_0x1315('0xb')](_0x1315('0xc'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x1315('0xd'),'fields':[_0x1315('0xd')]},{'name':_0x1315('0xe'),'fields':[_0x1315('0xf')],'type':_0x1315('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x28ceb,_0x17c699,_0x3e95ed){var _0x5aac52=_0x546c31['models'];var _0x12660f=_0x28ceb[_0x1315('0x11')]({'plain':!![]});if(_0x12660f[_0x1315('0x12')][_0x1315('0x13')]()==='in'||_0x12660f[_0x1315('0x12')][_0x1315('0x13')]()===_0x1315('0x14')&&!_0x12660f['secret']&&!_[_0x1315('0x15')](_0x12660f[_0x1315('0x16')])){_0x5aac52[_0x1315('0x17')][_0x1315('0x18')]({'where':{'id':_0x12660f[_0x1315('0x19')]}})[_0x1315('0x1a')](function(_0x5bd026){if(_0x5bd026){_0x5bd026[_0x1315('0x1b')]({'lastMsgAt':_0x12660f[_0x1315('0x1c')],'lastMsgDirection':_0x12660f[_0x1315('0x12')]['toLowerCase']()});}})[_0x1315('0x1d')](function(_0x4aef9b){console[_0x1315('0x1e')](_0x4aef9b);});}if(_0x12660f[_0x1315('0x12')]==='out'&&!_0x12660f[_0x1315('0x1f')]){var _0x9946d;_0x5aac52['WhatsappAccount'][_0x1315('0x20')]({'where':{'id':_0x12660f[_0x1315('0x21')]},'raw':!![]})[_0x1315('0x1a')](function(_0x5bd287){_0x9946d=_0x5bd287;if(_0x9946d&&_0x9946d[_0x1315('0x22')]){switch(_0x9946d[_0x1315('0x22')]){case _0x1315('0x23'):var _0x5acab1=require(_0x1315('0x23'));if(_0x9946d[_0x1315('0x24')]&&_0x9946d['authToken']&&_0x9946d[_0x1315('0x25')]){var _0x30ce5a=new _0x5acab1(_0x9946d[_0x1315('0x24')],_0x9946d[_0x1315('0x26')]);_0x30ce5a['messages'][_0x1315('0x27')]({'body':_0x12660f[_0x1315('0xf')],'to':_0x1315('0x28')+_0x12660f[_0x1315('0x25')],'from':_0x1315('0x28')+_0x9946d['phone'],'statusCallback':_0x9946d[_0x1315('0x29')]+'/api/whatsapp/messages/'+_0x12660f['id']+_0x1315('0x2a')+_0x9946d[_0x1315('0x2b')]})[_0x1315('0x1a')](function(_0x1471bc){if(_0x1471bc['sid']){return _0x28ceb[_0x1315('0x1b')]({'messageId':_0x1471bc[_0x1315('0x2c')]});}})[_0x1315('0x1d')](function(_0x5d3cd7){logger['error'](_0x1315('0x2d'),_0x1315('0x2e'),'twilio',util[_0x1315('0x2f')](_0x5d3cd7,{'showHidden':![],'depth':null}));});}else{logger[_0x1315('0x1e')](_0x1315('0x2d'),'afterCreate',_0x1315('0x23'),_0x1315('0x30'));}break;case'sinch':var _0x4962c9=_0x9946d['accountSid'];var _0x484f1c=_0x9946d[_0x1315('0x26')];var _0x3d3356=_0x9946d[_0x1315('0x31')]+_0x1315('0x32')+_0x4962c9+'/messages/';var _0x19e5b6={'to':[_0x12660f[_0x1315('0x25')]],'message':{'type':_0x1315('0x33'),'text':_0x12660f[_0x1315('0xf')]}};var _0x24ea67={'method':_0x1315('0x34'),'uri':_0x3d3356,'headers':{'Authorization':_0x1315('0x35')+_0x484f1c,'Content-Type':'application/json'},'body':_0x19e5b6,'json':!![]};rp(_0x24ea67)['then'](function(_0x3d355f){if(_0x3d355f[_0x1315('0x36')][0x0]['message_id']){return _0x28ceb['update']({'messageId':_0x3d355f[_0x1315('0x36')][0x0][_0x1315('0x37')]});}})[_0x1315('0x1d')](function(_0xc93a2c){logger[_0x1315('0x38')](_0x1315('0x39'),_0xc93a2c);});break;}}})['finally'](function(){_0x3e95ed();});}else{_0x3e95ed();}}},'charset':_0x1315('0x3a'),'collate':_0x1315('0x3b')});}; \ No newline at end of file +var _0x6a6b=['whatsapp_messages','messageId','fti_whatsapp_messages','direction','toLowerCase','out','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','createdAt','catch','error','secret','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','messages','whatsapp:','phone','/api/whatsapp/messages/','/status?token=','token','update','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','application/json','statuses','message_id','err','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage'];(function(_0x47b15f,_0x103e93){var _0x55bf25=function(_0x51fe7f){while(--_0x51fe7f){_0x47b15f['push'](_0x47b15f['shift']());}};_0x55bf25(++_0x103e93);}(_0x6a6b,0x165));var _0xb6a6=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x6a6b[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xb6a6('0x0'));var util=require(_0xb6a6('0x1'));var logger=require(_0xb6a6('0x2'))(_0xb6a6('0x3'));var moment=require(_0xb6a6('0x4'));var BPromise=require(_0xb6a6('0x5'));var rp=require(_0xb6a6('0x6'));var fetch=require(_0xb6a6('0x7'));var fs=require('fs');var path=require(_0xb6a6('0x8'));var rimraf=require(_0xb6a6('0x9'));var config=require(_0xb6a6('0xa'));var attributes=require(_0xb6a6('0xb'));module[_0xb6a6('0xc')]=function(_0x12b562,_0xf3045b){return _0x12b562[_0xb6a6('0xd')](_0xb6a6('0xe'),attributes,{'tableName':_0xb6a6('0xf'),'paranoid':![],'indexes':[{'name':_0xb6a6('0x10'),'fields':[_0xb6a6('0x10')]},{'name':_0xb6a6('0x11'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x422861,_0x110465,_0xbe90e3){var _0x20ba40=_0x12b562['models'];var _0x1fbbe8=_0x422861['get']({'plain':!![]});if(_0x1fbbe8[_0xb6a6('0x12')]['toLowerCase']()==='in'||_0x1fbbe8[_0xb6a6('0x12')][_0xb6a6('0x13')]()===_0xb6a6('0x14')&&!_0x1fbbe8['secret']&&!_[_0xb6a6('0x15')](_0x1fbbe8[_0xb6a6('0x16')])){_0x20ba40[_0xb6a6('0x17')][_0xb6a6('0x18')]({'where':{'id':_0x1fbbe8[_0xb6a6('0x19')]}})[_0xb6a6('0x1a')](function(_0x96e323){if(_0x96e323){_0x96e323['update']({'lastMsgAt':_0x1fbbe8[_0xb6a6('0x1b')],'lastMsgDirection':_0x1fbbe8[_0xb6a6('0x12')][_0xb6a6('0x13')]()});}})[_0xb6a6('0x1c')](function(_0xc67af){console[_0xb6a6('0x1d')](_0xc67af);});}if(_0x1fbbe8['direction']===_0xb6a6('0x14')&&!_0x1fbbe8[_0xb6a6('0x1e')]){var _0x5adb76;_0x20ba40[_0xb6a6('0x1f')][_0xb6a6('0x20')]({'where':{'id':_0x1fbbe8[_0xb6a6('0x21')]},'raw':!![]})[_0xb6a6('0x1a')](function(_0x2f02ff){_0x5adb76=_0x2f02ff;if(_0x5adb76&&_0x5adb76[_0xb6a6('0x22')]){switch(_0x5adb76['type']){case _0xb6a6('0x23'):var _0x3021b1=require(_0xb6a6('0x23'));if(_0x5adb76[_0xb6a6('0x24')]&&_0x5adb76[_0xb6a6('0x25')]&&_0x5adb76['phone']){var _0x416880=new _0x3021b1(_0x5adb76[_0xb6a6('0x24')],_0x5adb76[_0xb6a6('0x25')]);_0x416880[_0xb6a6('0x26')]['create']({'body':_0x1fbbe8['body'],'to':_0xb6a6('0x27')+_0x1fbbe8[_0xb6a6('0x28')],'from':_0xb6a6('0x27')+_0x5adb76[_0xb6a6('0x28')],'statusCallback':_0x5adb76['remote']+_0xb6a6('0x29')+_0x1fbbe8['id']+_0xb6a6('0x2a')+_0x5adb76[_0xb6a6('0x2b')]})[_0xb6a6('0x1a')](function(_0x57bf44){if(_0x57bf44['sid']){return _0x422861[_0xb6a6('0x2c')]({'messageId':_0x57bf44[_0xb6a6('0x2d')]});}})[_0xb6a6('0x1c')](function(_0x727711){logger['error'](_0xb6a6('0x2e'),'afterCreate',_0xb6a6('0x23'),util['inspect'](_0x727711,{'showHidden':![],'depth':null}));});}else{logger[_0xb6a6('0x1d')](_0xb6a6('0x2e'),'afterCreate',_0xb6a6('0x23'),_0xb6a6('0x2f'));}break;case _0xb6a6('0x30'):var _0x79fe09=_0x5adb76[_0xb6a6('0x24')];var _0x11bcd9=_0x5adb76[_0xb6a6('0x25')];var _0x336460=_0x5adb76[_0xb6a6('0x31')]+_0xb6a6('0x32')+_0x79fe09+_0xb6a6('0x33');var _0x5941e1={'to':[_0x1fbbe8[_0xb6a6('0x28')]],'message':{'type':_0xb6a6('0x34'),'text':_0x1fbbe8['body']}};var _0x20cc2a={'method':_0xb6a6('0x35'),'uri':_0x336460,'headers':{'Authorization':_0xb6a6('0x36')+_0x11bcd9,'Content-Type':_0xb6a6('0x37')},'body':_0x5941e1,'json':!![]};rp(_0x20cc2a)[_0xb6a6('0x1a')](function(_0x1106cb){if(_0x1106cb[_0xb6a6('0x38')][0x0]['message_id']){return _0x422861[_0xb6a6('0x2c')]({'messageId':_0x1106cb[_0xb6a6('0x38')][0x0][_0xb6a6('0x39')]});}})[_0xb6a6('0x1c')](function(_0x5d4ac3){logger[_0xb6a6('0x3a')]('WhatsappMessage,\x20%s',_0x5d4ac3);});break;}}})[_0xb6a6('0x3b')](function(){_0xbe90e3();});}else{_0xbe90e3();}}},'charset':_0xb6a6('0x3c'),'collate':_0xb6a6('0x3d')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 09567ca..ee78873 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 _0xaae4=['body','options','raw','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateWhatsappMessage','WhatsappMessage','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xaae4,0x70));var _0x4aae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaae4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4aae('0x0'));var moment=require(_0x4aae('0x1'));var BPromise=require(_0x4aae('0x2'));var rs=require(_0x4aae('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4aae('0x4'))['db'];var utils=require(_0x4aae('0x5'));var logger=require(_0x4aae('0x6'))(_0x4aae('0x7'));var config=require(_0x4aae('0x8'));var jayson=require(_0x4aae('0x9'));var client=jayson[_0x4aae('0xa')]['http']({'port':0x232a});config[_0x4aae('0xb')]=_[_0x4aae('0xc')](config[_0x4aae('0xb')],{'host':_0x4aae('0xd'),'port':0x18eb});var socket=require(_0x4aae('0xe'))(new Redis(config[_0x4aae('0xb')]));require(_0x4aae('0xf'))[_0x4aae('0x10')](socket);function respondWithRpcPromise(_0x3695f2,_0x54ac85,_0x25178b){return new BPromise(function(_0x74c49c,_0x122bbd){return client[_0x4aae('0x11')](_0x3695f2,_0x25178b)[_0x4aae('0x12')](function(_0x372b90){logger[_0x4aae('0x13')](_0x4aae('0x14'),_0x54ac85,_0x4aae('0x15'));logger[_0x4aae('0x16')](_0x4aae('0x17'),_0x54ac85,'request\x20sent',JSON[_0x4aae('0x18')](_0x372b90));if(_0x372b90[_0x4aae('0x19')]){if(_0x372b90[_0x4aae('0x19')][_0x4aae('0x1a')]===0x1f4){logger[_0x4aae('0x19')](_0x4aae('0x14'),_0x54ac85,_0x372b90[_0x4aae('0x19')][_0x4aae('0x1b')]);return _0x122bbd(_0x372b90[_0x4aae('0x19')]['message']);}logger[_0x4aae('0x19')](_0x4aae('0x14'),_0x54ac85,_0x372b90[_0x4aae('0x19')][_0x4aae('0x1b')]);return _0x74c49c(_0x372b90['error'][_0x4aae('0x1b')]);}else{logger[_0x4aae('0x13')](_0x4aae('0x14'),_0x54ac85,_0x4aae('0x15'));_0x74c49c(_0x372b90[_0x4aae('0x1c')][_0x4aae('0x1b')]);}})['catch'](function(_0x194921){logger[_0x4aae('0x19')]('WhatsappMessage,\x20%s,\x20%s',_0x54ac85,_0x194921);_0x122bbd(_0x194921);});});}exports[_0x4aae('0x1d')]=function(_0x1326e0){var _0x3be7ea=this;return new Promise(function(_0x5eecd4,_0x3cdffb){return db[_0x4aae('0x1e')][_0x4aae('0x1f')](_0x1326e0[_0x4aae('0x20')],{'raw':_0x1326e0[_0x4aae('0x21')]?_0x1326e0[_0x4aae('0x21')][_0x4aae('0x22')]===undefined?!![]:![]:!![]})[_0x4aae('0x12')](function(_0x44656d){logger[_0x4aae('0x13')](_0x4aae('0x1d'),_0x1326e0);logger[_0x4aae('0x16')](_0x4aae('0x1d'),_0x1326e0,JSON[_0x4aae('0x18')](_0x44656d));_0x5eecd4(_0x44656d);})[_0x4aae('0x23')](function(_0x36b17f){logger[_0x4aae('0x19')](_0x4aae('0x1d'),_0x36b17f[_0x4aae('0x1b')],_0x1326e0);_0x3cdffb(_0x3be7ea[_0x4aae('0x19')](0x1f4,_0x36b17f[_0x4aae('0x1b')]));});});}; \ No newline at end of file +var _0x9f7e=['options','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','./whatsappMessage.socket','register','request','then','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','info','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body'];(function(_0x5b1b07,_0x119df6){var _0x59fbbc=function(_0xc8f58a){while(--_0xc8f58a){_0x5b1b07['push'](_0x5b1b07['shift']());}};_0x59fbbc(++_0x119df6);}(_0x9f7e,0x138));var _0xe9f7=function(_0x3898cf,_0x50dde3){_0x3898cf=_0x3898cf-0x0;var _0x3f6e4b=_0x9f7e[_0x3898cf];return _0x3f6e4b;};'use strict';var _=require(_0xe9f7('0x0'));var util=require(_0xe9f7('0x1'));var moment=require(_0xe9f7('0x2'));var BPromise=require('bluebird');var rs=require(_0xe9f7('0x3'));var fs=require('fs');var Redis=require(_0xe9f7('0x4'));var db=require(_0xe9f7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe9f7('0x6'));var config=require(_0xe9f7('0x7'));var jayson=require(_0xe9f7('0x8'));var client=jayson[_0xe9f7('0x9')]['http']({'port':0x232a});config[_0xe9f7('0xa')]=_['defaults'](config[_0xe9f7('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe9f7('0xb'))[_0xe9f7('0xc')](socket);function respondWithRpcPromise(_0x5bab83,_0x5396c1,_0x3f5160){return new BPromise(function(_0x2d8215,_0x44c4cb){return client[_0xe9f7('0xd')](_0x5bab83,_0x3f5160)[_0xe9f7('0xe')](function(_0x65d06e){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x5396c1,_0xe9f7('0xf'));logger['debug'](_0xe9f7('0x10'),_0x5396c1,_0xe9f7('0xf'),JSON[_0xe9f7('0x11')](_0x65d06e));if(_0x65d06e[_0xe9f7('0x12')]){if(_0x65d06e[_0xe9f7('0x12')][_0xe9f7('0x13')]===0x1f4){logger[_0xe9f7('0x12')](_0xe9f7('0x14'),_0x5396c1,_0x65d06e['error'][_0xe9f7('0x15')]);return _0x44c4cb(_0x65d06e[_0xe9f7('0x12')]['message']);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x5396c1,_0x65d06e[_0xe9f7('0x12')][_0xe9f7('0x15')]);return _0x2d8215(_0x65d06e[_0xe9f7('0x12')]['message']);}else{logger[_0xe9f7('0x16')](_0xe9f7('0x14'),_0x5396c1,_0xe9f7('0xf'));_0x2d8215(_0x65d06e[_0xe9f7('0x17')][_0xe9f7('0x15')]);}})[_0xe9f7('0x18')](function(_0x49c59c){logger[_0xe9f7('0x12')](_0xe9f7('0x14'),_0x5396c1,_0x49c59c);_0x44c4cb(_0x49c59c);});});}exports[_0xe9f7('0x19')]=function(_0xc0adb7){var _0x18e38d=this;return new Promise(function(_0x5db7dc,_0x2b86b6){return db[_0xe9f7('0x1a')][_0xe9f7('0x1b')](_0xc0adb7[_0xe9f7('0x1c')],{'raw':_0xc0adb7[_0xe9f7('0x1d')]?_0xc0adb7[_0xe9f7('0x1d')][_0xe9f7('0x1e')]===undefined?!![]:![]:!![]})[_0xe9f7('0xe')](function(_0x238376){logger[_0xe9f7('0x16')](_0xe9f7('0x19'),_0xc0adb7);logger['debug']('CreateWhatsappMessage',_0xc0adb7,JSON['stringify'](_0x238376));_0x5db7dc(_0x238376);})[_0xe9f7('0x18')](function(_0xb4e4c2){logger[_0xe9f7('0x12')](_0xe9f7('0x19'),_0xb4e4c2[_0xe9f7('0x15')],_0xc0adb7);_0x2b86b6(_0x18e38d[_0xe9f7('0x12')](0x1f4,_0xb4e4c2[_0xe9f7('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 873ac3c..746326f 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 _0xbd4e=['removeListener','length','whatsappMessage:','save','update','emit'];(function(_0x46616a,_0x53d3d9){var _0x39e49e=function(_0x834bb3){while(--_0x834bb3){_0x46616a['push'](_0x46616a['shift']());}};_0x39e49e(++_0x53d3d9);}(_0xbd4e,0x111));var _0xebd4=function(_0x42583d,_0x59d3a8){_0x42583d=_0x42583d-0x0;var _0x59941b=_0xbd4e[_0x42583d];return _0x59941b;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0xebd4('0x0'),'remove',_0xebd4('0x1')];function createListener(_0x3a46d2,_0x49276d){return function(_0x3d243c){_0x49276d[_0xebd4('0x2')](_0x3a46d2,_0x3d243c);};}function removeListener(_0x5d720a,_0x1c5bd8){return function(){WhatsappMessageEvents[_0xebd4('0x3')](_0x5d720a,_0x1c5bd8);};}exports['register']=function(_0x144a8b){for(var _0x4045b9=0x0,_0x58b191=events[_0xebd4('0x4')];_0x4045b9<_0x58b191;_0x4045b9++){var _0x4acdea=events[_0x4045b9];var _0x2518bb=createListener(_0xebd4('0x5')+_0x4acdea,_0x144a8b);WhatsappMessageEvents['on'](_0x4acdea,_0x2518bb);}}; \ No newline at end of file +var _0x9d9c=['whatsappMessage:','./whatsappMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x167a99,_0x1bbb59){var _0x442d62=function(_0x12c3f8){while(--_0x12c3f8){_0x167a99['push'](_0x167a99['shift']());}};_0x442d62(++_0x1bbb59);}(_0x9d9c,0x1e9));var _0xc9d9=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x9d9c[_0x40a825];return _0x273a54;};'use strict';var WhatsappMessageEvents=require(_0xc9d9('0x0'));var events=[_0xc9d9('0x1'),_0xc9d9('0x2'),_0xc9d9('0x3')];function createListener(_0x333906,_0x230998){return function(_0x2b9202){_0x230998[_0xc9d9('0x4')](_0x333906,_0x2b9202);};}function removeListener(_0x12bac9,_0x41d4f3){return function(){WhatsappMessageEvents[_0xc9d9('0x5')](_0x12bac9,_0x41d4f3);};}exports[_0xc9d9('0x6')]=function(_0x1234b4){for(var _0x528f9e=0x0,_0x159acf=events['length'];_0x528f9e<_0x159acf;_0x528f9e++){var _0x2450a8=events[_0x528f9e];var _0x5e0383=createListener(_0xc9d9('0x7')+_0x2450a8,_0x1234b4);WhatsappMessageEvents['on'](_0x2450a8,_0x5e0383);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index cc815ed..3648ae4 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 _0x2ffc=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','describe','/:id','isAuthenticated','show'];(function(_0x57b432,_0x1589a0){var _0x2edf2a=function(_0x20edfc){while(--_0x20edfc){_0x57b432['push'](_0x57b432['shift']());}};_0x2edf2a(++_0x1589a0);}(_0x2ffc,0xc4));var _0xc2ff=function(_0x438940,_0x445e27){_0x438940=_0x438940-0x0;var _0x38d3b7=_0x2ffc[_0x438940];return _0x38d3b7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc2ff('0x0'));var timeout=require(_0xc2ff('0x1'));var express=require(_0xc2ff('0x2'));var router=express[_0xc2ff('0x3')]();var fs_extra=require(_0xc2ff('0x4'));var auth=require(_0xc2ff('0x5'));var interaction=require(_0xc2ff('0x6'));var config=require(_0xc2ff('0x7'));var controller=require(_0xc2ff('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc2ff('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xc2ff('0xa')]);router[_0xc2ff('0x9')](_0xc2ff('0xb'),auth[_0xc2ff('0xc')](),controller[_0xc2ff('0xd')]);router[_0xc2ff('0x9')](_0xc2ff('0xe'),auth[_0xc2ff('0xc')](),controller[_0xc2ff('0xf')]);router[_0xc2ff('0x9')](_0xc2ff('0x10'),auth['isAuthenticated'](),controller[_0xc2ff('0x11')]);router['get'](_0xc2ff('0x12'),auth[_0xc2ff('0xc')](),controller[_0xc2ff('0x13')]);router[_0xc2ff('0x14')]('/',auth[_0xc2ff('0xc')](),controller[_0xc2ff('0x15')]);router[_0xc2ff('0x14')](_0xc2ff('0x10'),auth[_0xc2ff('0xc')](),controller['addTeams']);router[_0xc2ff('0x14')](_0xc2ff('0x12'),auth['isAuthenticated'](),controller[_0xc2ff('0x16')]);router[_0xc2ff('0x17')](_0xc2ff('0xb'),auth[_0xc2ff('0xc')](),controller[_0xc2ff('0x18')]);router[_0xc2ff('0x19')](_0xc2ff('0xb'),auth[_0xc2ff('0xc')](),controller[_0xc2ff('0x1a')]);router[_0xc2ff('0x19')](_0xc2ff('0x10'),auth[_0xc2ff('0xc')](),controller[_0xc2ff('0x1b')]);router[_0xc2ff('0x19')]('/:id/users',auth[_0xc2ff('0xc')](),controller[_0xc2ff('0x1c')]);module[_0xc2ff('0x1d')]=router; \ No newline at end of file +var _0x035c=['create','addTeams','/:id/users','addAgents','/:id','update','delete','destroy','removeTeams','removeAgents','multer','util','express','Router','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','index','get','/:id/members','getMembers','/:id/teams','getTeams','getAgents'];(function(_0x18c325,_0x7c19a6){var _0x3bc840=function(_0x74a209){while(--_0x74a209){_0x18c325['push'](_0x18c325['shift']());}};_0x3bc840(++_0x7c19a6);}(_0x035c,0x87));var _0xc035=function(_0x40f076,_0x3bffc3){_0x40f076=_0x40f076-0x0;var _0x540041=_0x035c[_0x40f076];return _0x540041;};'use strict';var multer=require(_0xc035('0x0'));var util=require(_0xc035('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc035('0x2'));var router=express[_0xc035('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc035('0x4'));var config=require(_0xc035('0x5'));var controller=require(_0xc035('0x6'));router['get']('/',auth[_0xc035('0x7')](),controller[_0xc035('0x8')]);router[_0xc035('0x9')]('/describe',auth[_0xc035('0x7')](),controller['describe']);router[_0xc035('0x9')]('/:id',auth[_0xc035('0x7')](),controller['show']);router[_0xc035('0x9')](_0xc035('0xa'),auth[_0xc035('0x7')](),controller[_0xc035('0xb')]);router[_0xc035('0x9')](_0xc035('0xc'),auth[_0xc035('0x7')](),controller[_0xc035('0xd')]);router[_0xc035('0x9')]('/:id/users',auth[_0xc035('0x7')](),controller[_0xc035('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc035('0xf')]);router['post'](_0xc035('0xc'),auth[_0xc035('0x7')](),controller[_0xc035('0x10')]);router['post'](_0xc035('0x11'),auth[_0xc035('0x7')](),controller[_0xc035('0x12')]);router['put'](_0xc035('0x13'),auth[_0xc035('0x7')](),controller[_0xc035('0x14')]);router[_0xc035('0x15')](_0xc035('0x13'),auth['isAuthenticated'](),controller[_0xc035('0x16')]);router['delete'](_0xc035('0xc'),auth[_0xc035('0x7')](),controller[_0xc035('0x17')]);router['delete']('/:id/users',auth[_0xc035('0x7')](),controller[_0xc035('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index a977743..adff375 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 _0x976a=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','INTEGER'];(function(_0x5acb7d,_0x32def7){var _0x4213c9=function(_0x4b562b){while(--_0x4b562b){_0x5acb7d['push'](_0x5acb7d['shift']());}};_0x4213c9(++_0x32def7);}(_0x976a,0xf4));var _0xa976=function(_0x262957,_0x34c699){_0x262957=_0x262957-0x0;var _0x27e221=_0x976a[_0x262957];return _0x27e221;};'use strict';var Sequelize=require(_0xa976('0x0'));module[_0xa976('0x1')]={'name':{'type':Sequelize[_0xa976('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xa976('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa976('0x4')](_0xa976('0x5'),_0xa976('0x6'),_0xa976('0x7'))},'description':{'type':Sequelize[_0xa976('0x2')]}}; \ No newline at end of file +var _0x946e=['STRING','INTEGER','beepall','roundrobin','sequelize'];(function(_0x432434,_0x465d94){var _0x38cbd0=function(_0x2fa3a9){while(--_0x2fa3a9){_0x432434['push'](_0x432434['shift']());}};_0x38cbd0(++_0x465d94);}(_0x946e,0x1d0));var _0xe946=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x946e[_0x2d34d6];return _0x1d3d12;};'use strict';var Sequelize=require(_0xe946('0x0'));module['exports']={'name':{'type':Sequelize[_0xe946('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xe946('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xe946('0x3'),_0xe946('0x4'))},'description':{'type':Sequelize[_0xe946('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 15a6afa..e20b7a5 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 _0x8978=['userWhatsappQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','stack','name','send','map','WhatsappQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','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','catch','params','describe','findOne','UserWhatsappQueue','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','format','SIP','getTeams','hasOwnProperty','addTeams','ids','Team','Agents','online','voicePause','flatMap','each','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','includes','all','union','compact','value','transaction','isEmpty','removeAgents','emit','userWhatsappQueue:remove','addAgents','omit','spread'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8978,0x93));var _0x8897=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x8978[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x8897('0x0'));var rimraf=require(_0x8897('0x1'));var zipdir=require(_0x8897('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8897('0x3'));var moment=require(_0x8897('0x4'));var BPromise=require(_0x8897('0x5'));var Mustache=require(_0x8897('0x6'));var util=require(_0x8897('0x7'));var path=require(_0x8897('0x8'));var sox=require(_0x8897('0x9'));var csv=require('to-csv');var ejs=require(_0x8897('0xa'));var fs=require('fs');var fs_extra=require(_0x8897('0xb'));var _=require(_0x8897('0xc'));var squel=require(_0x8897('0xd'));var crypto=require(_0x8897('0xe'));var jsforce=require(_0x8897('0xf'));var deskjs=require(_0x8897('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8897('0x11'));var Papa=require(_0x8897('0x12'));var Redis=require(_0x8897('0x13'));var authService=require(_0x8897('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8897('0x15'));var logger=require(_0x8897('0x16'))('api');var utils=require(_0x8897('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8897('0x18'));var db=require('../../mysqldb')['db'];config[_0x8897('0x19')]=_[_0x8897('0x1a')](config[_0x8897('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8897('0x19')]));require(_0x8897('0x1b'))[_0x8897('0x1c')](socket);function respondWithStatusCode(_0x50693d,_0x323b7d){_0x323b7d=_0x323b7d||0xcc;return function(_0x29beb7){if(_0x29beb7){return _0x50693d[_0x8897('0x1d')](_0x323b7d);}return _0x50693d[_0x8897('0x1e')](_0x323b7d)[_0x8897('0x1f')]();};}function respondWithResult(_0x192a39,_0x17d269){_0x17d269=_0x17d269||0xc8;return function(_0x6fc458){if(_0x6fc458){return _0x192a39[_0x8897('0x1e')](_0x17d269)[_0x8897('0x20')](_0x6fc458);}};}function respondWithFilteredResult(_0x1a5750,_0x3161ed){return function(_0x16c63b){if(_0x16c63b){var _0x3d2352=typeof _0x3161ed[_0x8897('0x21')]===_0x8897('0x22')&&typeof _0x3161ed[_0x8897('0x23')]==='undefined';var _0x1aefa4=_0x16c63b[_0x8897('0x24')];var _0x96e1e=_0x3d2352?0x0:_0x3161ed[_0x8897('0x21')];var _0xc1892b=_0x3d2352?_0x16c63b[_0x8897('0x24')]:_0x3161ed[_0x8897('0x21')]+_0x3161ed[_0x8897('0x23')];var _0x231ad3;if(_0xc1892b>=_0x1aefa4){_0xc1892b=_0x1aefa4;_0x231ad3=0xc8;}else{_0x231ad3=0xce;}_0x1a5750[_0x8897('0x1e')](_0x231ad3);return _0x1a5750[_0x8897('0x25')](_0x8897('0x26'),_0x96e1e+'-'+_0xc1892b+'/'+_0x1aefa4)[_0x8897('0x20')](_0x16c63b);}return null;};}function patchUpdates(_0x4d538c){return function(_0x102dd6){try{jsonpatch[_0x8897('0x27')](_0x102dd6,_0x4d538c,!![]);}catch(_0x3341bd){return BPromise[_0x8897('0x28')](_0x3341bd);}return _0x102dd6[_0x8897('0x29')]();};}function saveUpdates(_0xed61f,_0x2292ad){return function(_0x4a04d0){if(_0x4a04d0){return _0x4a04d0[_0x8897('0x2a')](_0xed61f)[_0x8897('0x2b')](function(_0x485925){return _0x485925;});}return null;};}function removeEntity(_0x3c66dd,_0x354ba3){return function(_0xf9b10a){if(_0xf9b10a){return _0xf9b10a[_0x8897('0x2c')]()['then'](function(){var _0x3a727a=_0xf9b10a[_0x8897('0x2d')]({'plain':!![]});var _0x1de393=_0x8897('0x2e');return db[_0x8897('0x2f')]['destroy']({'where':{'type':_0x1de393,'resourceId':_0x3a727a['id']}})['then'](function(){return _0xf9b10a;});})[_0x8897('0x2b')](function(){_0x3c66dd[_0x8897('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1eb0da,_0x529fe0){return function(_0x4288e0){if(!_0x4288e0){_0x1eb0da[_0x8897('0x1d')](0x194);}return _0x4288e0;};}function handleError(_0x17e780,_0x240b51){_0x240b51=_0x240b51||0x1f4;return function(_0x1669d3){logger['error'](_0x1669d3[_0x8897('0x30')]);if(_0x1669d3['name']){delete _0x1669d3[_0x8897('0x31')];}_0x17e780[_0x8897('0x1e')](_0x240b51)[_0x8897('0x32')](_0x1669d3);};}exports['index']=function(_0x50867a,_0x55991c){var _0x58a8a8={},_0x14f08e={},_0x3b76cd={'count':0x0,'rows':[]};var _0x3ed01e=_[_0x8897('0x33')](db[_0x8897('0x34')][_0x8897('0x35')],function(_0x21ec22){return{'name':_0x21ec22[_0x8897('0x36')],'type':_0x21ec22[_0x8897('0x37')][_0x8897('0x38')]};});_0x14f08e['model']=_[_0x8897('0x33')](_0x3ed01e,'name');_0x14f08e[_0x8897('0x39')]=_[_0x8897('0x3a')](_0x50867a[_0x8897('0x39')]);_0x14f08e[_0x8897('0x3b')]=_[_0x8897('0x3c')](_0x14f08e[_0x8897('0x3d')],_0x14f08e[_0x8897('0x39')]);_0x58a8a8['attributes']=_[_0x8897('0x3c')](_0x14f08e[_0x8897('0x3d')],qs[_0x8897('0x3e')](_0x50867a[_0x8897('0x39')][_0x8897('0x3e')]));_0x58a8a8[_0x8897('0x3f')]=_0x58a8a8[_0x8897('0x3f')]['length']?_0x58a8a8[_0x8897('0x3f')]:_0x14f08e[_0x8897('0x3d')];if(!_0x50867a[_0x8897('0x39')]['hasOwnProperty'](_0x8897('0x40'))){_0x58a8a8[_0x8897('0x23')]=qs[_0x8897('0x23')](_0x50867a[_0x8897('0x39')][_0x8897('0x23')]);_0x58a8a8[_0x8897('0x21')]=qs[_0x8897('0x21')](_0x50867a[_0x8897('0x39')]['offset']);}_0x58a8a8[_0x8897('0x41')]=qs[_0x8897('0x42')](_0x50867a[_0x8897('0x39')][_0x8897('0x42')]);_0x58a8a8[_0x8897('0x43')]=qs[_0x8897('0x3b')](_[_0x8897('0x44')](_0x50867a[_0x8897('0x39')],_0x14f08e[_0x8897('0x3b')]),_0x3ed01e);if(_0x50867a[_0x8897('0x39')]['filter']){_0x58a8a8[_0x8897('0x43')]=_['merge'](_0x58a8a8[_0x8897('0x43')],{'$or':_[_0x8897('0x33')](_0x3ed01e,function(_0x57e5f6){if(_0x57e5f6[_0x8897('0x37')]!==_0x8897('0x45')){var _0x2607b7={};_0x2607b7[_0x57e5f6[_0x8897('0x31')]]={'$like':'%'+_0x50867a['query'][_0x8897('0x46')]+'%'};return _0x2607b7;}})});}_0x58a8a8=_[_0x8897('0x47')]({},_0x58a8a8,_0x50867a[_0x8897('0x48')]);var _0x1a7da={'where':_0x58a8a8[_0x8897('0x43')]};return db['WhatsappQueue'][_0x8897('0x24')](_0x1a7da)[_0x8897('0x2b')](function(_0x425bfc){_0x3b76cd[_0x8897('0x24')]=_0x425bfc;if(_0x50867a[_0x8897('0x39')][_0x8897('0x49')]){_0x58a8a8[_0x8897('0x4a')]=[{'all':!![]}];}return db['WhatsappQueue'][_0x8897('0x4b')](_0x58a8a8);})[_0x8897('0x2b')](function(_0x1591ba){_0x3b76cd[_0x8897('0x4c')]=_0x1591ba;return _0x3b76cd;})[_0x8897('0x2b')](respondWithFilteredResult(_0x55991c,_0x58a8a8))['catch'](handleError(_0x55991c,null));};exports['show']=function(_0x4e357b,_0x5496f9){var _0x3b09f5={'raw':!![],'where':{'id':_0x4e357b['params']['id']}},_0x36d7b0={};_0x36d7b0['model']=_[_0x8897('0x3a')](db[_0x8897('0x34')]['rawAttributes']);_0x36d7b0['query']=_[_0x8897('0x3a')](_0x4e357b[_0x8897('0x39')]);_0x36d7b0[_0x8897('0x3b')]=_[_0x8897('0x3c')](_0x36d7b0[_0x8897('0x3d')],_0x36d7b0[_0x8897('0x39')]);_0x3b09f5[_0x8897('0x3f')]=_['intersection'](_0x36d7b0['model'],qs['fields'](_0x4e357b['query'][_0x8897('0x3e')]));_0x3b09f5[_0x8897('0x3f')]=_0x3b09f5[_0x8897('0x3f')][_0x8897('0x4d')]?_0x3b09f5[_0x8897('0x3f')]:_0x36d7b0[_0x8897('0x3d')];if(_0x4e357b[_0x8897('0x39')][_0x8897('0x49')]){_0x3b09f5[_0x8897('0x4a')]=[{'all':!![]}];}_0x3b09f5=_[_0x8897('0x47')]({},_0x3b09f5,_0x4e357b[_0x8897('0x48')]);return db[_0x8897('0x34')][_0x8897('0x4e')](_0x3b09f5)[_0x8897('0x2b')](handleEntityNotFound(_0x5496f9,null))[_0x8897('0x2b')](respondWithResult(_0x5496f9,null))['catch'](handleError(_0x5496f9,null));};exports[_0x8897('0x4f')]=function(_0x2da404,_0x27b471){return db[_0x8897('0x34')][_0x8897('0x4f')](_0x2da404[_0x8897('0x50')],{})[_0x8897('0x2b')](function(_0x1e5103){var _0x33c2e1=_0x2da404[_0x8897('0x51')][_0x8897('0x2d')]({'plain':!![]});if(!_0x33c2e1)throw new Error(_0x8897('0x52'));if(_0x33c2e1[_0x8897('0x53')]===_0x8897('0x51')){var _0x491955=_0x1e5103[_0x8897('0x2d')]({'plain':!![]});var _0x3d0cb9=_0x8897('0x2e');return db[_0x8897('0x54')][_0x8897('0x4e')]({'where':{'name':_0x3d0cb9,'userProfileId':_0x33c2e1[_0x8897('0x55')]},'raw':!![]})[_0x8897('0x2b')](function(_0x961c25){if(_0x961c25&&_0x961c25[_0x8897('0x56')]===0x0){return db[_0x8897('0x2f')][_0x8897('0x4f')]({'name':_0x491955[_0x8897('0x31')],'resourceId':_0x491955['id'],'type':_0x961c25[_0x8897('0x31')],'sectionId':_0x961c25['id']},{})[_0x8897('0x2b')](function(){return _0x1e5103;});}else{return _0x1e5103;}})['catch'](function(_0x980e76){logger['error'](_0x8897('0x57'),_0x980e76);throw _0x980e76;});}return _0x1e5103;})[_0x8897('0x2b')](respondWithResult(_0x27b471,0xc9))[_0x8897('0x58')](handleError(_0x27b471,null));};exports['update']=function(_0x19245c,_0x13bdc2){if(_0x19245c[_0x8897('0x50')]['id']){delete _0x19245c[_0x8897('0x50')]['id'];}return db[_0x8897('0x34')]['find']({'where':{'id':_0x19245c[_0x8897('0x59')]['id']}})[_0x8897('0x2b')](handleEntityNotFound(_0x13bdc2,null))[_0x8897('0x2b')](saveUpdates(_0x19245c[_0x8897('0x50')],null))[_0x8897('0x2b')](respondWithResult(_0x13bdc2,null))[_0x8897('0x58')](handleError(_0x13bdc2,null));};exports['destroy']=function(_0x487070,_0x189396){return db[_0x8897('0x34')][_0x8897('0x4e')]({'where':{'id':_0x487070['params']['id']}})[_0x8897('0x2b')](handleEntityNotFound(_0x189396,null))[_0x8897('0x2b')](removeEntity(_0x189396,null))[_0x8897('0x58')](handleError(_0x189396,null));};exports[_0x8897('0x5a')]=function(_0x14319a,_0x5171db){return db[_0x8897('0x34')]['describe']()['then'](respondWithResult(_0x5171db,null))['catch'](handleError(_0x5171db,null));};exports['getMembers']=function(_0x5dca72,_0x3deb7f,_0x2b5fcb){var _0x56bbec={'raw':!![],'where':{}},_0x29d6a5={},_0x47d36a;return db[_0x8897('0x34')][_0x8897('0x5b')]({'where':{'id':_0x5dca72['params']['id']}})[_0x8897('0x2b')](handleEntityNotFound(_0x3deb7f,null))[_0x8897('0x2b')](function(_0x447aa5){if(_0x447aa5){_0x47d36a=_0x447aa5[_0x8897('0x2d')]({'plain':!![]});_0x29d6a5[_0x8897('0x3d')]=_[_0x8897('0x3a')](db[_0x8897('0x5c')][_0x8897('0x35')]);_0x29d6a5[_0x8897('0x39')]=_[_0x8897('0x3a')](_0x5dca72[_0x8897('0x39')]);_0x29d6a5[_0x8897('0x3b')]=_[_0x8897('0x3c')](_0x29d6a5[_0x8897('0x3d')],_0x29d6a5['query']);_0x56bbec[_0x8897('0x3f')]=_['intersection'](_0x29d6a5[_0x8897('0x3d')],qs[_0x8897('0x3e')](_0x5dca72[_0x8897('0x39')]['fields']));_0x56bbec['attributes']=_0x56bbec[_0x8897('0x3f')][_0x8897('0x4d')]?_0x56bbec[_0x8897('0x3f')]:_0x29d6a5[_0x8897('0x3d')];if(!_0x5dca72['query']['hasOwnProperty'](_0x8897('0x40'))){_0x56bbec['limit']=qs[_0x8897('0x23')](_0x5dca72[_0x8897('0x39')]['limit']);_0x56bbec[_0x8897('0x21')]=qs['offset'](_0x5dca72[_0x8897('0x39')][_0x8897('0x21')]);}_0x56bbec[_0x8897('0x41')]=qs[_0x8897('0x42')](_0x5dca72['query'][_0x8897('0x42')]);_0x56bbec[_0x8897('0x43')]=qs[_0x8897('0x3b')](_[_0x8897('0x44')](_0x5dca72[_0x8897('0x39')],_0x29d6a5[_0x8897('0x3b')]));_0x56bbec[_0x8897('0x43')][_0x8897('0x5d')]=_0x447aa5['id'];if(_0x5dca72[_0x8897('0x39')][_0x8897('0x46')]){_0x56bbec['where']=_['merge'](_0x56bbec['where'],{'$or':_['map'](_0x56bbec[_0x8897('0x3f')],function(_0x1073b2){var _0x53874c={};_0x53874c[_0x1073b2]={'$like':'%'+_0x5dca72[_0x8897('0x39')]['filter']+'%'};return _0x53874c;})});}_0x56bbec=_[_0x8897('0x47')]({},_0x56bbec,_0x5dca72[_0x8897('0x48')]);return db[_0x8897('0x5c')]['findAll'](_0x56bbec);}})['then'](function(_0x55263f){if(_0x55263f){return db[_0x8897('0x5e')][_0x8897('0x5f')]({'where':{'id':_['map'](_0x55263f,_0x8897('0x60')),'role':_0x8897('0x61')},'attributes':['id','name',_0x8897('0x62'),_0x8897('0x63'),'createdAt']});}})['then'](function(_0x57392a){if(_0x57392a){return{'count':_0x57392a[_0x8897('0x24')],'rows':_[_0x8897('0x33')](_0x57392a['rows'],function(_0x203c54){return{'membername':_0x203c54['name'],'UserId':_0x203c54['id'],'queue_name':_0x47d36a[_0x8897('0x31')],'WhatsappQueueId':_0x47d36a['id'],'interface':util[_0x8897('0x64')]('%s/%s',_0x8897('0x65'),_0x203c54[_0x8897('0x31')]),'penalty':0x0,'paused':_0x203c54[_0x8897('0x62')],'createdAt':_0x203c54['createdAt'],'updatedAt':_0x203c54[_0x8897('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8897('0x2b')](respondWithFilteredResult(_0x3deb7f,_0x56bbec))['catch'](handleError(_0x3deb7f,null));};exports[_0x8897('0x66')]=function(_0x72d816,_0x20d1ac,_0x101597){var _0x6c554={};var _0x43ff93={};var _0x62f63;var _0x585885;return db['WhatsappQueue'][_0x8897('0x5b')]({'where':{'id':_0x72d816[_0x8897('0x59')]['id']}})[_0x8897('0x2b')](handleEntityNotFound(_0x20d1ac,null))['then'](function(_0x5f348f){if(_0x5f348f){_0x62f63=_0x5f348f;_0x43ff93[_0x8897('0x3d')]=_['keys'](db['Team'][_0x8897('0x35')]);_0x43ff93['query']=_['keys'](_0x72d816['query']);_0x43ff93[_0x8897('0x3b')]=_[_0x8897('0x3c')](_0x43ff93['model'],_0x43ff93['query']);_0x6c554[_0x8897('0x3f')]=_[_0x8897('0x3c')](_0x43ff93[_0x8897('0x3d')],qs['fields'](_0x72d816[_0x8897('0x39')][_0x8897('0x3e')]));_0x6c554[_0x8897('0x3f')]=_0x6c554[_0x8897('0x3f')][_0x8897('0x4d')]?_0x6c554['attributes']:_0x43ff93[_0x8897('0x3d')];_0x6c554[_0x8897('0x41')]=qs[_0x8897('0x42')](_0x72d816[_0x8897('0x39')][_0x8897('0x42')]);_0x6c554[_0x8897('0x43')]=qs[_0x8897('0x3b')](_['pick'](_0x72d816['query'],_0x43ff93[_0x8897('0x3b')]));if(_0x72d816[_0x8897('0x39')]['filter']){_0x6c554['where']=_[_0x8897('0x47')](_0x6c554[_0x8897('0x43')],{'$or':_[_0x8897('0x33')](_0x6c554[_0x8897('0x3f')],function(_0x1871c7){var _0x235ef2={};_0x235ef2[_0x1871c7]={'$like':'%'+_0x72d816[_0x8897('0x39')]['filter']+'%'};return _0x235ef2;})});}_0x6c554=_[_0x8897('0x47')]({},_0x6c554,_0x72d816['options']);return _0x62f63[_0x8897('0x66')](_0x6c554);}})[_0x8897('0x2b')](function(_0x5c1c48){if(_0x5c1c48){_0x585885=_0x5c1c48[_0x8897('0x4d')];if(!_0x72d816['query'][_0x8897('0x67')](_0x8897('0x40'))){_0x6c554[_0x8897('0x23')]=qs[_0x8897('0x23')](_0x72d816['query']['limit']);_0x6c554[_0x8897('0x21')]=qs['offset'](_0x72d816[_0x8897('0x39')][_0x8897('0x21')]);}return _0x62f63['getTeams'](_0x6c554);}})[_0x8897('0x2b')](function(_0x4af022){if(_0x4af022){return _0x4af022?{'count':_0x585885,'rows':_0x4af022}:null;}})[_0x8897('0x2b')](respondWithResult(_0x20d1ac,null))['catch'](handleError(_0x20d1ac,null));};exports[_0x8897('0x68')]=function(_0x54062b,_0xebe0f,_0x51a432){var _0x1445b8=_0x54062b[_0x8897('0x50')][_0x8897('0x69')];return db[_0x8897('0x6a')][_0x8897('0x4b')]({'where':{'id':_0x1445b8},'attributes':['id'],'include':[{'model':db[_0x8897('0x5e')],'as':_0x8897('0x6b'),'attributes':['id',_0x8897('0x31'),_0x8897('0x6c'),_0x8897('0x6d'),'interface'],'raw':!![]}]})[_0x8897('0x2b')](function(_0x354409){if(_0x354409){var _0x19e0d8=_[_0x8897('0x6e')](_0x354409,function(_0x15b62){var _0x45d530=_0x15b62[_0x8897('0x2d')]({'plain':!![]});return _0x45d530[_0x8897('0x6b')];});return db[_0x8897('0x34')][_0x8897('0x4e')]({'where':{'id':_0x54062b[_0x8897('0x59')]['id']}})[_0x8897('0x2b')](function(_0x132848){return db['sequelize']['transaction'](function(_0x1e6690){return _0x132848['addTeams'](_0x1445b8,{'transaction':_0x1e6690})[_0x8897('0x2b')](function(){return BPromise[_0x8897('0x6f')](_0x19e0d8,function(_0x4e612b){return db[_0x8897('0x5c')][_0x8897('0x70')]({'where':{'UserId':_0x4e612b['id'],'WhatsappQueueId':_0x54062b[_0x8897('0x59')]['id']},'transaction':_0x1e6690});});})['then'](function(){_0x19e0d8[_0x8897('0x71')](function(_0x42c973){socket['emit']('userWhatsappQueue:save',{'UserId':_0x42c973['id'],'WhatsappQueueId':_0x132848['id']});});});});});}})[_0x8897('0x2b')](respondWithStatusCode(_0xebe0f,null))[_0x8897('0x58')](handleError(_0xebe0f,null));};exports[_0x8897('0x72')]=function(_0x4884fb,_0x375289,_0x2e9cff){return db['Team'][_0x8897('0x4b')]({'where':{'id':_0x4884fb['query'][_0x8897('0x69')]},'attributes':['id'],'include':[{'model':db[_0x8897('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8897('0x2b')](handleEntityNotFound(_0x375289,null))[_0x8897('0x2b')](function(_0x3fc59f){var _0x232e83=_['map'](_0x3fc59f,'id');var _0x3fd0e3=[];var _0x5615da=[];var _0x199042=squel[_0x8897('0x73')]();_0x199042[_0x8897('0x74')](_0x8897('0x75'))[_0x8897('0x76')](_0x8897('0x77'),'tq')[_0x8897('0x78')](_0x8897('0x79'),'ut',_0x8897('0x7a'))[_0x8897('0x43')](_0x8897('0x7b'),_0x4884fb[_0x8897('0x59')]['id']);for(var _0x248466=0x0;_0x248466<_0x3fc59f[_0x8897('0x4d')];_0x248466+=0x1){let _0x811193=_0x3fc59f[_0x248466];for(var _0x43e4da=0x0;_0x43e4da<_0x811193['Agents'][_0x8897('0x4d')];_0x43e4da+=0x1){let _0x4e4ea8=_0x811193['Agents'][_0x43e4da];var _0x1f3df3=_0x199042['clone']();_0x1f3df3[_0x8897('0x43')]('ut.UserId\x20=\x20?',_0x4e4ea8['id']);_0x5615da['push'](db[_0x8897('0x7c')][_0x8897('0x39')](_0x1f3df3[_0x8897('0x7d')](),{'type':db['sequelize'][_0x8897('0x7e')][_0x8897('0x7f')]})['then'](function(_0x4f2f03){if(_0x4f2f03[_0x8897('0x4d')]===0x1){return _0x4e4ea8['id'];}else{var _0x369363=_['every'](_['map'](_0x4f2f03,'TeamId'),function(_0x524326){return _[_0x8897('0x80')](_0x232e83,_0x524326);});if(_0x369363){return _0x4e4ea8['id'];}}}));}}return BPromise[_0x8897('0x81')](_0x5615da)[_0x8897('0x2b')](function(_0x39263f){_0x3fd0e3=_(_0x3fd0e3)[_0x8897('0x82')](_0x39263f)[_0x8897('0x83')]()[_0x8897('0x84')]();return db['WhatsappQueue'][_0x8897('0x4e')]({'where':{'id':_0x4884fb[_0x8897('0x59')]['id']}})[_0x8897('0x2b')](function(_0x46dbc8){return db[_0x8897('0x7c')][_0x8897('0x85')](function(_0xef0437){return _0x46dbc8[_0x8897('0x72')](_0x4884fb[_0x8897('0x39')][_0x8897('0x69')],{'transaction':_0xef0437})[_0x8897('0x2b')](function(){if(!_[_0x8897('0x86')](_0x3fd0e3)){return _0x46dbc8[_0x8897('0x87')](_0x3fd0e3,{'transaction':_0xef0437});}})['then'](function(){_0x3fd0e3[_0x8897('0x71')](function(_0x52d07){socket[_0x8897('0x88')](_0x8897('0x89'),{'UserId':_0x52d07,'WhatsappQueueId':_0x46dbc8['id']});});});});});});})[_0x8897('0x2b')](respondWithStatusCode(_0x375289,null))['catch'](handleError(_0x375289,null));};exports[_0x8897('0x8a')]=function(_0x2d3bd3,_0x375e32,_0x4f0f86){return db['WhatsappQueue'][_0x8897('0x4e')]({'where':{'id':_0x2d3bd3[_0x8897('0x59')]['id']}})[_0x8897('0x2b')](handleEntityNotFound(_0x375e32,null))[_0x8897('0x2b')](function(_0x166d11){if(_0x166d11){return _0x166d11[_0x8897('0x8a')](_0x2d3bd3[_0x8897('0x50')][_0x8897('0x69')],_[_0x8897('0x8b')](_0x2d3bd3[_0x8897('0x50')],[_0x8897('0x69'),'id'])||{})[_0x8897('0x8c')](function(_0x1e60c5){for(var _0xc033ab=0x0;_0xc033ab<_0x2d3bd3['body'][_0x8897('0x69')][_0x8897('0x4d')];_0xc033ab+=0x1){socket[_0x8897('0x88')](_0x8897('0x8d'),{'UserId':Number(_0x2d3bd3[_0x8897('0x50')][_0x8897('0x69')][_0xc033ab]),'WhatsappQueueId':Number(_0x2d3bd3['params']['id'])});}return _0x1e60c5;});}})[_0x8897('0x2b')](respondWithResult(_0x375e32,null))['catch'](handleError(_0x375e32,null));};exports[_0x8897('0x87')]=function(_0x359c84,_0xd6fd37,_0x4b3a0b){return db[_0x8897('0x34')]['find']({'where':{'id':_0x359c84[_0x8897('0x59')]['id']}})[_0x8897('0x2b')](handleEntityNotFound(_0xd6fd37,null))['then'](function(_0x26c097){if(_0x26c097){return _0x26c097['removeAgents'](_0x359c84['query'][_0x8897('0x69')])[_0x8897('0x2b')](function(){if(_[_0x8897('0x8e')](_0x359c84[_0x8897('0x39')][_0x8897('0x69')])){for(var _0x13ffb8=0x0;_0x13ffb8<_0x359c84[_0x8897('0x39')][_0x8897('0x69')][_0x8897('0x4d')];_0x13ffb8+=0x1){socket[_0x8897('0x88')](_0x8897('0x89'),{'UserId':Number(_0x359c84[_0x8897('0x39')][_0x8897('0x69')][_0x13ffb8]),'WhatsappQueueId':Number(_0x359c84[_0x8897('0x59')]['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x359c84[_0x8897('0x39')]['ids']),'WhatsappQueueId':Number(_0x359c84[_0x8897('0x59')]['id'])});}});}})[_0x8897('0x2b')](respondWithStatusCode(_0xd6fd37,null))[_0x8897('0x58')](handleError(_0xd6fd37,null));};exports[_0x8897('0x8f')]=function(_0x35b61c,_0x304262,_0x4a054f){var _0x5c05b6={};var _0x29c3eb={};var _0x5b09e9;var _0x5ba017;return db['WhatsappQueue'][_0x8897('0x5b')]({'where':{'id':_0x35b61c[_0x8897('0x59')]['id']}})['then'](handleEntityNotFound(_0x304262,null))['then'](function(_0x537171){if(_0x537171){_0x5b09e9=_0x537171;_0x29c3eb['model']=_[_0x8897('0x3a')](db[_0x8897('0x5e')][_0x8897('0x35')]);_0x29c3eb[_0x8897('0x39')]=_[_0x8897('0x3a')](_0x35b61c[_0x8897('0x39')]);_0x29c3eb[_0x8897('0x3b')]=_[_0x8897('0x3c')](_0x29c3eb[_0x8897('0x3d')],_0x29c3eb['query']);_0x5c05b6['attributes']=_[_0x8897('0x3c')](_0x29c3eb[_0x8897('0x3d')],qs['fields'](_0x35b61c['query'][_0x8897('0x3e')]));_0x5c05b6[_0x8897('0x3f')]=_0x5c05b6[_0x8897('0x3f')][_0x8897('0x4d')]?_0x5c05b6['attributes']:_0x29c3eb['model'];_0x5c05b6[_0x8897('0x41')]=qs['sort'](_0x35b61c['query'][_0x8897('0x42')]);_0x5c05b6[_0x8897('0x43')]=qs['filters'](_[_0x8897('0x44')](_0x35b61c['query'],_0x29c3eb['filters']));if(_0x35b61c['query'][_0x8897('0x46')]){_0x5c05b6[_0x8897('0x43')]=_[_0x8897('0x47')](_0x5c05b6[_0x8897('0x43')],{'$or':_['map'](_0x5c05b6[_0x8897('0x3f')],function(_0x5b3e2a){var _0x215ec8={};_0x215ec8[_0x5b3e2a]={'$like':'%'+_0x35b61c['query']['filter']+'%'};return _0x215ec8;})});}_0x5c05b6=_['merge']({},_0x5c05b6,_0x35b61c[_0x8897('0x48')]);return _0x5b09e9[_0x8897('0x8f')](_0x5c05b6);}})['then'](function(_0x19d54f){if(_0x19d54f){_0x5ba017=_0x19d54f[_0x8897('0x4d')];if(!_0x35b61c[_0x8897('0x39')]['hasOwnProperty'](_0x8897('0x40'))){_0x5c05b6[_0x8897('0x23')]=qs[_0x8897('0x23')](_0x35b61c['query']['limit']);_0x5c05b6[_0x8897('0x21')]=qs[_0x8897('0x21')](_0x35b61c[_0x8897('0x39')][_0x8897('0x21')]);}return _0x5b09e9[_0x8897('0x8f')](_0x5c05b6);}})[_0x8897('0x2b')](function(_0x15325d){if(_0x15325d){return _0x15325d?{'count':_0x5ba017,'rows':_0x15325d}:null;}})['then'](respondWithResult(_0x304262,null))[_0x8897('0x58')](handleError(_0x304262,null));}; \ No newline at end of file +var _0x4c5d=['includes','all','union','compact','value','isEmpty','emit','userWhatsappQueue:remove','addAgents','omit','removeAgents','eml-format','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','get','WhatsappQueues','UserProfileResource','destroy','name','send','map','WhatsappQueue','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','describe','getMembers','findOne','UserWhatsappQueue','hasOwnProperty','WhatsappQueueId','User','UserId','agent','whatsappPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','addTeams','ids','Team','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','select','team_has_whatsapp_queues','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId'];(function(_0x2ef8c1,_0x2f72f4){var _0x288305=function(_0x56244b){while(--_0x56244b){_0x2ef8c1['push'](_0x2ef8c1['shift']());}};_0x288305(++_0x2f72f4);}(_0x4c5d,0x92));var _0xd4c5=function(_0x102b83,_0x4a4479){_0x102b83=_0x102b83-0x0;var _0x5d377e=_0x4c5d[_0x102b83];return _0x5d377e;};'use strict';var emlformat=require(_0xd4c5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd4c5('0x1'));var Mustache=require(_0xd4c5('0x2'));var util=require(_0xd4c5('0x3'));var path=require(_0xd4c5('0x4'));var sox=require(_0xd4c5('0x5'));var csv=require(_0xd4c5('0x6'));var ejs=require(_0xd4c5('0x7'));var fs=require('fs');var fs_extra=require(_0xd4c5('0x8'));var _=require(_0xd4c5('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd4c5('0xa'));var deskjs=require(_0xd4c5('0xb'));var toCsv=require(_0xd4c5('0x6'));var querystring=require(_0xd4c5('0xc'));var Papa=require(_0xd4c5('0xd'));var Redis=require(_0xd4c5('0xe'));var authService=require(_0xd4c5('0xf'));var qs=require(_0xd4c5('0x10'));var as=require(_0xd4c5('0x11'));var hardwareService=require(_0xd4c5('0x12'));var logger=require(_0xd4c5('0x13'))(_0xd4c5('0x14'));var utils=require(_0xd4c5('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd4c5('0x16'));var db=require(_0xd4c5('0x17'))['db'];config['redis']=_[_0xd4c5('0x18')](config['redis'],{'host':_0xd4c5('0x19'),'port':0x18eb});var socket=require(_0xd4c5('0x1a'))(new Redis(config['redis']));require(_0xd4c5('0x1b'))[_0xd4c5('0x1c')](socket);function respondWithStatusCode(_0x52af22,_0x5d2722){_0x5d2722=_0x5d2722||0xcc;return function(_0xaeb591){if(_0xaeb591){return _0x52af22[_0xd4c5('0x1d')](_0x5d2722);}return _0x52af22['status'](_0x5d2722)[_0xd4c5('0x1e')]();};}function respondWithResult(_0x4f0bda,_0x73aa3e){_0x73aa3e=_0x73aa3e||0xc8;return function(_0x220d78){if(_0x220d78){return _0x4f0bda[_0xd4c5('0x1f')](_0x73aa3e)['json'](_0x220d78);}};}function respondWithFilteredResult(_0x4f413b,_0x34dbd4){return function(_0x273fcd){if(_0x273fcd){var _0x15c901=typeof _0x34dbd4[_0xd4c5('0x20')]===_0xd4c5('0x21')&&typeof _0x34dbd4[_0xd4c5('0x22')]==='undefined';var _0x235250=_0x273fcd[_0xd4c5('0x23')];var _0x5f59ce=_0x15c901?0x0:_0x34dbd4[_0xd4c5('0x20')];var _0x4b2b62=_0x15c901?_0x273fcd[_0xd4c5('0x23')]:_0x34dbd4['offset']+_0x34dbd4[_0xd4c5('0x22')];var _0x556141;if(_0x4b2b62>=_0x235250){_0x4b2b62=_0x235250;_0x556141=0xc8;}else{_0x556141=0xce;}_0x4f413b[_0xd4c5('0x1f')](_0x556141);return _0x4f413b[_0xd4c5('0x24')](_0xd4c5('0x25'),_0x5f59ce+'-'+_0x4b2b62+'/'+_0x235250)[_0xd4c5('0x26')](_0x273fcd);}return null;};}function patchUpdates(_0x1ef546){return function(_0x2fc61a){try{jsonpatch[_0xd4c5('0x27')](_0x2fc61a,_0x1ef546,!![]);}catch(_0x4e494c){return BPromise[_0xd4c5('0x28')](_0x4e494c);}return _0x2fc61a['save']();};}function saveUpdates(_0x45fb51,_0x5e0add){return function(_0x5ee565){if(_0x5ee565){return _0x5ee565['update'](_0x45fb51)[_0xd4c5('0x29')](function(_0x305c90){return _0x305c90;});}return null;};}function removeEntity(_0x531387,_0x1a2b29){return function(_0x1b4fec){if(_0x1b4fec){return _0x1b4fec['destroy']()[_0xd4c5('0x29')](function(){var _0x2cfed7=_0x1b4fec[_0xd4c5('0x2a')]({'plain':!![]});var _0x152a03=_0xd4c5('0x2b');return db[_0xd4c5('0x2c')][_0xd4c5('0x2d')]({'where':{'type':_0x152a03,'resourceId':_0x2cfed7['id']}})[_0xd4c5('0x29')](function(){return _0x1b4fec;});})[_0xd4c5('0x29')](function(){_0x531387[_0xd4c5('0x1f')](0xcc)[_0xd4c5('0x1e')]();});}};}function handleEntityNotFound(_0x26593c,_0x41b14f){return function(_0x429e9a){if(!_0x429e9a){_0x26593c[_0xd4c5('0x1d')](0x194);}return _0x429e9a;};}function handleError(_0x399a90,_0x5c1866){_0x5c1866=_0x5c1866||0x1f4;return function(_0x468da9){logger['error'](_0x468da9['stack']);if(_0x468da9[_0xd4c5('0x2e')]){delete _0x468da9[_0xd4c5('0x2e')];}_0x399a90[_0xd4c5('0x1f')](_0x5c1866)[_0xd4c5('0x2f')](_0x468da9);};}exports['index']=function(_0x40bd84,_0x106801){var _0x34f035={},_0x3a69ca={},_0x2d7b7e={'count':0x0,'rows':[]};var _0x27e1b0=_[_0xd4c5('0x30')](db[_0xd4c5('0x31')]['rawAttributes'],function(_0x5c34d1){return{'name':_0x5c34d1[_0xd4c5('0x32')],'type':_0x5c34d1[_0xd4c5('0x33')]['key']};});_0x3a69ca[_0xd4c5('0x34')]=_[_0xd4c5('0x30')](_0x27e1b0,_0xd4c5('0x2e'));_0x3a69ca[_0xd4c5('0x35')]=_[_0xd4c5('0x36')](_0x40bd84['query']);_0x3a69ca[_0xd4c5('0x37')]=_['intersection'](_0x3a69ca[_0xd4c5('0x34')],_0x3a69ca[_0xd4c5('0x35')]);_0x34f035[_0xd4c5('0x38')]=_[_0xd4c5('0x39')](_0x3a69ca[_0xd4c5('0x34')],qs[_0xd4c5('0x3a')](_0x40bd84['query'][_0xd4c5('0x3a')]));_0x34f035[_0xd4c5('0x38')]=_0x34f035[_0xd4c5('0x38')][_0xd4c5('0x3b')]?_0x34f035['attributes']:_0x3a69ca[_0xd4c5('0x34')];if(!_0x40bd84[_0xd4c5('0x35')]['hasOwnProperty'](_0xd4c5('0x3c'))){_0x34f035[_0xd4c5('0x22')]=qs[_0xd4c5('0x22')](_0x40bd84['query'][_0xd4c5('0x22')]);_0x34f035['offset']=qs[_0xd4c5('0x20')](_0x40bd84[_0xd4c5('0x35')][_0xd4c5('0x20')]);}_0x34f035[_0xd4c5('0x3d')]=qs[_0xd4c5('0x3e')](_0x40bd84['query'][_0xd4c5('0x3e')]);_0x34f035[_0xd4c5('0x3f')]=qs[_0xd4c5('0x37')](_[_0xd4c5('0x40')](_0x40bd84[_0xd4c5('0x35')],_0x3a69ca[_0xd4c5('0x37')]),_0x27e1b0);if(_0x40bd84[_0xd4c5('0x35')][_0xd4c5('0x41')]){_0x34f035[_0xd4c5('0x3f')]=_[_0xd4c5('0x42')](_0x34f035['where'],{'$or':_[_0xd4c5('0x30')](_0x27e1b0,function(_0xbf0623){if(_0xbf0623[_0xd4c5('0x33')]!=='VIRTUAL'){var _0x1b1ecd={};_0x1b1ecd[_0xbf0623[_0xd4c5('0x2e')]]={'$like':'%'+_0x40bd84[_0xd4c5('0x35')]['filter']+'%'};return _0x1b1ecd;}})});}_0x34f035=_[_0xd4c5('0x42')]({},_0x34f035,_0x40bd84[_0xd4c5('0x43')]);var _0x1f3107={'where':_0x34f035['where']};return db[_0xd4c5('0x31')]['count'](_0x1f3107)[_0xd4c5('0x29')](function(_0x533fa5){_0x2d7b7e['count']=_0x533fa5;if(_0x40bd84[_0xd4c5('0x35')][_0xd4c5('0x44')]){_0x34f035[_0xd4c5('0x45')]=[{'all':!![]}];}return db[_0xd4c5('0x31')][_0xd4c5('0x46')](_0x34f035);})[_0xd4c5('0x29')](function(_0xd944c0){_0x2d7b7e[_0xd4c5('0x47')]=_0xd944c0;return _0x2d7b7e;})['then'](respondWithFilteredResult(_0x106801,_0x34f035))[_0xd4c5('0x48')](handleError(_0x106801,null));};exports[_0xd4c5('0x49')]=function(_0x53da99,_0x45102){var _0x2edb46={'raw':!![],'where':{'id':_0x53da99[_0xd4c5('0x4a')]['id']}},_0xeb34f5={};_0xeb34f5[_0xd4c5('0x34')]=_[_0xd4c5('0x36')](db[_0xd4c5('0x31')][_0xd4c5('0x4b')]);_0xeb34f5[_0xd4c5('0x35')]=_[_0xd4c5('0x36')](_0x53da99['query']);_0xeb34f5['filters']=_[_0xd4c5('0x39')](_0xeb34f5[_0xd4c5('0x34')],_0xeb34f5[_0xd4c5('0x35')]);_0x2edb46[_0xd4c5('0x38')]=_[_0xd4c5('0x39')](_0xeb34f5[_0xd4c5('0x34')],qs[_0xd4c5('0x3a')](_0x53da99['query']['fields']));_0x2edb46[_0xd4c5('0x38')]=_0x2edb46[_0xd4c5('0x38')][_0xd4c5('0x3b')]?_0x2edb46[_0xd4c5('0x38')]:_0xeb34f5[_0xd4c5('0x34')];if(_0x53da99[_0xd4c5('0x35')][_0xd4c5('0x44')]){_0x2edb46['include']=[{'all':!![]}];}_0x2edb46=_[_0xd4c5('0x42')]({},_0x2edb46,_0x53da99[_0xd4c5('0x43')]);return db['WhatsappQueue']['find'](_0x2edb46)['then'](handleEntityNotFound(_0x45102,null))['then'](respondWithResult(_0x45102,null))[_0xd4c5('0x48')](handleError(_0x45102,null));};exports['create']=function(_0x160e61,_0x8b49fc){return db[_0xd4c5('0x31')]['create'](_0x160e61[_0xd4c5('0x4c')],{})[_0xd4c5('0x29')](function(_0x3b829c){var _0x456d1a=_0x160e61[_0xd4c5('0x4d')][_0xd4c5('0x2a')]({'plain':!![]});if(!_0x456d1a)throw new Error(_0xd4c5('0x4e'));if(_0x456d1a[_0xd4c5('0x4f')]===_0xd4c5('0x4d')){var _0x264b46=_0x3b829c[_0xd4c5('0x2a')]({'plain':!![]});var _0x4f704e='WhatsappQueues';return db[_0xd4c5('0x50')]['find']({'where':{'name':_0x4f704e,'userProfileId':_0x456d1a['userProfileId']},'raw':!![]})[_0xd4c5('0x29')](function(_0x43ff20){if(_0x43ff20&&_0x43ff20['autoAssociation']===0x0){return db[_0xd4c5('0x2c')]['create']({'name':_0x264b46[_0xd4c5('0x2e')],'resourceId':_0x264b46['id'],'type':_0x43ff20['name'],'sectionId':_0x43ff20['id']},{})[_0xd4c5('0x29')](function(){return _0x3b829c;});}else{return _0x3b829c;}})[_0xd4c5('0x48')](function(_0x1dc55e){logger[_0xd4c5('0x51')](_0xd4c5('0x52'),_0x1dc55e);throw _0x1dc55e;});}return _0x3b829c;})[_0xd4c5('0x29')](respondWithResult(_0x8b49fc,0xc9))['catch'](handleError(_0x8b49fc,null));};exports[_0xd4c5('0x53')]=function(_0x147e0f,_0x58e930){if(_0x147e0f['body']['id']){delete _0x147e0f[_0xd4c5('0x4c')]['id'];}return db['WhatsappQueue'][_0xd4c5('0x54')]({'where':{'id':_0x147e0f[_0xd4c5('0x4a')]['id']}})[_0xd4c5('0x29')](handleEntityNotFound(_0x58e930,null))[_0xd4c5('0x29')](saveUpdates(_0x147e0f['body'],null))[_0xd4c5('0x29')](respondWithResult(_0x58e930,null))['catch'](handleError(_0x58e930,null));};exports[_0xd4c5('0x2d')]=function(_0x49fb2b,_0xbede35){return db[_0xd4c5('0x31')]['find']({'where':{'id':_0x49fb2b['params']['id']}})[_0xd4c5('0x29')](handleEntityNotFound(_0xbede35,null))[_0xd4c5('0x29')](removeEntity(_0xbede35,null))['catch'](handleError(_0xbede35,null));};exports[_0xd4c5('0x55')]=function(_0x5c8479,_0x1d74c6){return db[_0xd4c5('0x31')][_0xd4c5('0x55')]()[_0xd4c5('0x29')](respondWithResult(_0x1d74c6,null))[_0xd4c5('0x48')](handleError(_0x1d74c6,null));};exports[_0xd4c5('0x56')]=function(_0x3fe171,_0x1bf7c8,_0xfa4939){var _0x6c0eb0={'raw':!![],'where':{}},_0x478227={},_0x43cc44;return db[_0xd4c5('0x31')][_0xd4c5('0x57')]({'where':{'id':_0x3fe171[_0xd4c5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1bf7c8,null))[_0xd4c5('0x29')](function(_0x3ce735){if(_0x3ce735){_0x43cc44=_0x3ce735[_0xd4c5('0x2a')]({'plain':!![]});_0x478227['model']=_[_0xd4c5('0x36')](db[_0xd4c5('0x58')][_0xd4c5('0x4b')]);_0x478227['query']=_[_0xd4c5('0x36')](_0x3fe171[_0xd4c5('0x35')]);_0x478227['filters']=_[_0xd4c5('0x39')](_0x478227[_0xd4c5('0x34')],_0x478227[_0xd4c5('0x35')]);_0x6c0eb0[_0xd4c5('0x38')]=_[_0xd4c5('0x39')](_0x478227[_0xd4c5('0x34')],qs['fields'](_0x3fe171[_0xd4c5('0x35')][_0xd4c5('0x3a')]));_0x6c0eb0[_0xd4c5('0x38')]=_0x6c0eb0[_0xd4c5('0x38')]['length']?_0x6c0eb0['attributes']:_0x478227[_0xd4c5('0x34')];if(!_0x3fe171[_0xd4c5('0x35')][_0xd4c5('0x59')](_0xd4c5('0x3c'))){_0x6c0eb0[_0xd4c5('0x22')]=qs[_0xd4c5('0x22')](_0x3fe171[_0xd4c5('0x35')][_0xd4c5('0x22')]);_0x6c0eb0[_0xd4c5('0x20')]=qs[_0xd4c5('0x20')](_0x3fe171['query'][_0xd4c5('0x20')]);}_0x6c0eb0[_0xd4c5('0x3d')]=qs[_0xd4c5('0x3e')](_0x3fe171[_0xd4c5('0x35')][_0xd4c5('0x3e')]);_0x6c0eb0[_0xd4c5('0x3f')]=qs[_0xd4c5('0x37')](_['pick'](_0x3fe171[_0xd4c5('0x35')],_0x478227['filters']));_0x6c0eb0['where'][_0xd4c5('0x5a')]=_0x3ce735['id'];if(_0x3fe171['query'][_0xd4c5('0x41')]){_0x6c0eb0[_0xd4c5('0x3f')]=_[_0xd4c5('0x42')](_0x6c0eb0[_0xd4c5('0x3f')],{'$or':_[_0xd4c5('0x30')](_0x6c0eb0[_0xd4c5('0x38')],function(_0xe9721d){var _0x5b4775={};_0x5b4775[_0xe9721d]={'$like':'%'+_0x3fe171[_0xd4c5('0x35')][_0xd4c5('0x41')]+'%'};return _0x5b4775;})});}_0x6c0eb0=_['merge']({},_0x6c0eb0,_0x3fe171[_0xd4c5('0x43')]);return db[_0xd4c5('0x58')][_0xd4c5('0x46')](_0x6c0eb0);}})[_0xd4c5('0x29')](function(_0x19244c){if(_0x19244c){return db[_0xd4c5('0x5b')]['findAndCountAll']({'where':{'id':_[_0xd4c5('0x30')](_0x19244c,_0xd4c5('0x5c')),'role':_0xd4c5('0x5d')},'attributes':['id',_0xd4c5('0x2e'),_0xd4c5('0x5e'),'updatedAt',_0xd4c5('0x5f')]});}})[_0xd4c5('0x29')](function(_0x47ead3){if(_0x47ead3){return{'count':_0x47ead3[_0xd4c5('0x23')],'rows':_[_0xd4c5('0x30')](_0x47ead3[_0xd4c5('0x47')],function(_0x46f825){return{'membername':_0x46f825[_0xd4c5('0x2e')],'UserId':_0x46f825['id'],'queue_name':_0x43cc44[_0xd4c5('0x2e')],'WhatsappQueueId':_0x43cc44['id'],'interface':util[_0xd4c5('0x60')](_0xd4c5('0x61'),_0xd4c5('0x62'),_0x46f825['name']),'penalty':0x0,'paused':_0x46f825[_0xd4c5('0x5e')],'createdAt':_0x46f825[_0xd4c5('0x5f')],'updatedAt':_0x46f825[_0xd4c5('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd4c5('0x29')](respondWithFilteredResult(_0x1bf7c8,_0x6c0eb0))[_0xd4c5('0x48')](handleError(_0x1bf7c8,null));};exports[_0xd4c5('0x64')]=function(_0x2e16af,_0x301874,_0x2c8727){var _0x17c23a={};var _0xbb1948={};var _0xbc1139;var _0x4241ca;return db[_0xd4c5('0x31')][_0xd4c5('0x57')]({'where':{'id':_0x2e16af[_0xd4c5('0x4a')]['id']}})[_0xd4c5('0x29')](handleEntityNotFound(_0x301874,null))[_0xd4c5('0x29')](function(_0x31fc78){if(_0x31fc78){_0xbc1139=_0x31fc78;_0xbb1948[_0xd4c5('0x34')]=_[_0xd4c5('0x36')](db['Team'][_0xd4c5('0x4b')]);_0xbb1948[_0xd4c5('0x35')]=_[_0xd4c5('0x36')](_0x2e16af[_0xd4c5('0x35')]);_0xbb1948[_0xd4c5('0x37')]=_[_0xd4c5('0x39')](_0xbb1948[_0xd4c5('0x34')],_0xbb1948['query']);_0x17c23a['attributes']=_[_0xd4c5('0x39')](_0xbb1948[_0xd4c5('0x34')],qs[_0xd4c5('0x3a')](_0x2e16af[_0xd4c5('0x35')][_0xd4c5('0x3a')]));_0x17c23a[_0xd4c5('0x38')]=_0x17c23a['attributes'][_0xd4c5('0x3b')]?_0x17c23a[_0xd4c5('0x38')]:_0xbb1948[_0xd4c5('0x34')];_0x17c23a[_0xd4c5('0x3d')]=qs[_0xd4c5('0x3e')](_0x2e16af[_0xd4c5('0x35')][_0xd4c5('0x3e')]);_0x17c23a['where']=qs[_0xd4c5('0x37')](_['pick'](_0x2e16af[_0xd4c5('0x35')],_0xbb1948['filters']));if(_0x2e16af[_0xd4c5('0x35')]['filter']){_0x17c23a[_0xd4c5('0x3f')]=_['merge'](_0x17c23a[_0xd4c5('0x3f')],{'$or':_['map'](_0x17c23a['attributes'],function(_0x25c280){var _0x135ab0={};_0x135ab0[_0x25c280]={'$like':'%'+_0x2e16af[_0xd4c5('0x35')][_0xd4c5('0x41')]+'%'};return _0x135ab0;})});}_0x17c23a=_[_0xd4c5('0x42')]({},_0x17c23a,_0x2e16af[_0xd4c5('0x43')]);return _0xbc1139[_0xd4c5('0x64')](_0x17c23a);}})[_0xd4c5('0x29')](function(_0x213a7c){if(_0x213a7c){_0x4241ca=_0x213a7c[_0xd4c5('0x3b')];if(!_0x2e16af[_0xd4c5('0x35')][_0xd4c5('0x59')](_0xd4c5('0x3c'))){_0x17c23a[_0xd4c5('0x22')]=qs[_0xd4c5('0x22')](_0x2e16af[_0xd4c5('0x35')][_0xd4c5('0x22')]);_0x17c23a[_0xd4c5('0x20')]=qs[_0xd4c5('0x20')](_0x2e16af[_0xd4c5('0x35')][_0xd4c5('0x20')]);}return _0xbc1139[_0xd4c5('0x64')](_0x17c23a);}})[_0xd4c5('0x29')](function(_0x2c8c3f){if(_0x2c8c3f){return _0x2c8c3f?{'count':_0x4241ca,'rows':_0x2c8c3f}:null;}})[_0xd4c5('0x29')](respondWithResult(_0x301874,null))[_0xd4c5('0x48')](handleError(_0x301874,null));};exports[_0xd4c5('0x65')]=function(_0x11bb7e,_0x5ec05e,_0x4ca267){var _0x50208b=_0x11bb7e[_0xd4c5('0x4c')][_0xd4c5('0x66')];return db[_0xd4c5('0x67')][_0xd4c5('0x46')]({'where':{'id':_0x50208b},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd4c5('0x68'),'attributes':['id',_0xd4c5('0x2e'),_0xd4c5('0x69'),'voicePause',_0xd4c5('0x6a')],'raw':!![]}]})[_0xd4c5('0x29')](function(_0x1014b7){if(_0x1014b7){var _0x5d9a4b=_[_0xd4c5('0x6b')](_0x1014b7,function(_0x5d0bcb){var _0x94a609=_0x5d0bcb[_0xd4c5('0x2a')]({'plain':!![]});return _0x94a609[_0xd4c5('0x68')];});return db[_0xd4c5('0x31')][_0xd4c5('0x54')]({'where':{'id':_0x11bb7e[_0xd4c5('0x4a')]['id']}})[_0xd4c5('0x29')](function(_0x4aa5af){return db[_0xd4c5('0x6c')][_0xd4c5('0x6d')](function(_0x48d9ef){return _0x4aa5af[_0xd4c5('0x65')](_0x50208b,{'transaction':_0x48d9ef})[_0xd4c5('0x29')](function(){return BPromise[_0xd4c5('0x6e')](_0x5d9a4b,function(_0x397003){return db[_0xd4c5('0x58')][_0xd4c5('0x6f')]({'where':{'UserId':_0x397003['id'],'WhatsappQueueId':_0x11bb7e[_0xd4c5('0x4a')]['id']},'transaction':_0x48d9ef});});})['then'](function(){_0x5d9a4b[_0xd4c5('0x70')](function(_0x7c4243){socket['emit'](_0xd4c5('0x71'),{'UserId':_0x7c4243['id'],'WhatsappQueueId':_0x4aa5af['id']});});});});});}})[_0xd4c5('0x29')](respondWithStatusCode(_0x5ec05e,null))[_0xd4c5('0x48')](handleError(_0x5ec05e,null));};exports[_0xd4c5('0x72')]=function(_0x333442,_0x4f8936,_0x19de22){return db[_0xd4c5('0x67')][_0xd4c5('0x46')]({'where':{'id':_0x333442[_0xd4c5('0x35')][_0xd4c5('0x66')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd4c5('0x68'),'attributes':['id'],'raw':!![]}]})[_0xd4c5('0x29')](handleEntityNotFound(_0x4f8936,null))[_0xd4c5('0x29')](function(_0x3d1396){var _0x1bec66=_[_0xd4c5('0x30')](_0x3d1396,'id');var _0x11de4f=[];var _0x39052b=[];var _0x1a0f23=squel[_0xd4c5('0x73')]();_0x1a0f23['field']('tq.TeamId')['from'](_0xd4c5('0x74'),'tq')['join']('user_has_teams','ut',_0xd4c5('0x75'))[_0xd4c5('0x3f')]('WhatsappQueueId\x20=\x20?',_0x333442[_0xd4c5('0x4a')]['id']);for(var _0x355d88=0x0;_0x355d88<_0x3d1396['length'];_0x355d88+=0x1){let _0x71f243=_0x3d1396[_0x355d88];for(var _0x2e6698=0x0;_0x2e6698<_0x71f243[_0xd4c5('0x68')][_0xd4c5('0x3b')];_0x2e6698+=0x1){let _0x5449fb=_0x71f243[_0xd4c5('0x68')][_0x2e6698];var _0x40a387=_0x1a0f23[_0xd4c5('0x76')]();_0x40a387['where'](_0xd4c5('0x77'),_0x5449fb['id']);_0x39052b[_0xd4c5('0x78')](db['sequelize'][_0xd4c5('0x35')](_0x40a387['toString'](),{'type':db['sequelize'][_0xd4c5('0x79')][_0xd4c5('0x7a')]})[_0xd4c5('0x29')](function(_0x32d29c){if(_0x32d29c[_0xd4c5('0x3b')]===0x1){return _0x5449fb['id'];}else{var _0x11de3c=_['every'](_[_0xd4c5('0x30')](_0x32d29c,_0xd4c5('0x7b')),function(_0x4f3a){return _[_0xd4c5('0x7c')](_0x1bec66,_0x4f3a);});if(_0x11de3c){return _0x5449fb['id'];}}}));}}return BPromise[_0xd4c5('0x7d')](_0x39052b)[_0xd4c5('0x29')](function(_0x6cca60){_0x11de4f=_(_0x11de4f)[_0xd4c5('0x7e')](_0x6cca60)[_0xd4c5('0x7f')]()[_0xd4c5('0x80')]();return db[_0xd4c5('0x31')][_0xd4c5('0x54')]({'where':{'id':_0x333442[_0xd4c5('0x4a')]['id']}})[_0xd4c5('0x29')](function(_0x1ed862){return db['sequelize'][_0xd4c5('0x6d')](function(_0x128c9f){return _0x1ed862['removeTeams'](_0x333442[_0xd4c5('0x35')][_0xd4c5('0x66')],{'transaction':_0x128c9f})[_0xd4c5('0x29')](function(){if(!_[_0xd4c5('0x81')](_0x11de4f)){return _0x1ed862['removeAgents'](_0x11de4f,{'transaction':_0x128c9f});}})[_0xd4c5('0x29')](function(){_0x11de4f[_0xd4c5('0x70')](function(_0xc8e512){socket[_0xd4c5('0x82')](_0xd4c5('0x83'),{'UserId':_0xc8e512,'WhatsappQueueId':_0x1ed862['id']});});});});});});})[_0xd4c5('0x29')](respondWithStatusCode(_0x4f8936,null))[_0xd4c5('0x48')](handleError(_0x4f8936,null));};exports[_0xd4c5('0x84')]=function(_0x1f4dae,_0x64da77,_0x22e749){return db['WhatsappQueue'][_0xd4c5('0x54')]({'where':{'id':_0x1f4dae[_0xd4c5('0x4a')]['id']}})[_0xd4c5('0x29')](handleEntityNotFound(_0x64da77,null))[_0xd4c5('0x29')](function(_0x172abc){if(_0x172abc){return _0x172abc[_0xd4c5('0x84')](_0x1f4dae[_0xd4c5('0x4c')][_0xd4c5('0x66')],_[_0xd4c5('0x85')](_0x1f4dae[_0xd4c5('0x4c')],[_0xd4c5('0x66'),'id'])||{})['spread'](function(_0x55575d){for(var _0x17ca8e=0x0;_0x17ca8e<_0x1f4dae[_0xd4c5('0x4c')][_0xd4c5('0x66')][_0xd4c5('0x3b')];_0x17ca8e+=0x1){socket[_0xd4c5('0x82')](_0xd4c5('0x71'),{'UserId':Number(_0x1f4dae[_0xd4c5('0x4c')]['ids'][_0x17ca8e]),'WhatsappQueueId':Number(_0x1f4dae[_0xd4c5('0x4a')]['id'])});}return _0x55575d;});}})[_0xd4c5('0x29')](respondWithResult(_0x64da77,null))['catch'](handleError(_0x64da77,null));};exports[_0xd4c5('0x86')]=function(_0x3a1479,_0x1b3b4d,_0x3c7f15){return db['WhatsappQueue'][_0xd4c5('0x54')]({'where':{'id':_0x3a1479['params']['id']}})[_0xd4c5('0x29')](handleEntityNotFound(_0x1b3b4d,null))[_0xd4c5('0x29')](function(_0x519f24){if(_0x519f24){return _0x519f24[_0xd4c5('0x86')](_0x3a1479[_0xd4c5('0x35')][_0xd4c5('0x66')])[_0xd4c5('0x29')](function(){if(_['isArray'](_0x3a1479[_0xd4c5('0x35')]['ids'])){for(var _0x43ebaf=0x0;_0x43ebaf<_0x3a1479[_0xd4c5('0x35')]['ids'][_0xd4c5('0x3b')];_0x43ebaf+=0x1){socket['emit'](_0xd4c5('0x83'),{'UserId':Number(_0x3a1479[_0xd4c5('0x35')][_0xd4c5('0x66')][_0x43ebaf]),'WhatsappQueueId':Number(_0x3a1479[_0xd4c5('0x4a')]['id'])});}}else{socket[_0xd4c5('0x82')](_0xd4c5('0x83'),{'UserId':Number(_0x3a1479[_0xd4c5('0x35')][_0xd4c5('0x66')]),'WhatsappQueueId':Number(_0x3a1479[_0xd4c5('0x4a')]['id'])});}});}})[_0xd4c5('0x29')](respondWithStatusCode(_0x1b3b4d,null))[_0xd4c5('0x48')](handleError(_0x1b3b4d,null));};exports['getAgents']=function(_0x11fbbc,_0x5decce,_0x39f98f){var _0x452837={};var _0x4f6fff={};var _0x27241a;var _0x97b99c;return db[_0xd4c5('0x31')][_0xd4c5('0x57')]({'where':{'id':_0x11fbbc[_0xd4c5('0x4a')]['id']}})[_0xd4c5('0x29')](handleEntityNotFound(_0x5decce,null))[_0xd4c5('0x29')](function(_0x287232){if(_0x287232){_0x27241a=_0x287232;_0x4f6fff[_0xd4c5('0x34')]=_[_0xd4c5('0x36')](db['User'][_0xd4c5('0x4b')]);_0x4f6fff[_0xd4c5('0x35')]=_['keys'](_0x11fbbc[_0xd4c5('0x35')]);_0x4f6fff['filters']=_['intersection'](_0x4f6fff[_0xd4c5('0x34')],_0x4f6fff['query']);_0x452837[_0xd4c5('0x38')]=_[_0xd4c5('0x39')](_0x4f6fff['model'],qs[_0xd4c5('0x3a')](_0x11fbbc[_0xd4c5('0x35')][_0xd4c5('0x3a')]));_0x452837['attributes']=_0x452837['attributes'][_0xd4c5('0x3b')]?_0x452837[_0xd4c5('0x38')]:_0x4f6fff[_0xd4c5('0x34')];_0x452837[_0xd4c5('0x3d')]=qs[_0xd4c5('0x3e')](_0x11fbbc[_0xd4c5('0x35')]['sort']);_0x452837[_0xd4c5('0x3f')]=qs[_0xd4c5('0x37')](_[_0xd4c5('0x40')](_0x11fbbc[_0xd4c5('0x35')],_0x4f6fff['filters']));if(_0x11fbbc[_0xd4c5('0x35')][_0xd4c5('0x41')]){_0x452837[_0xd4c5('0x3f')]=_['merge'](_0x452837[_0xd4c5('0x3f')],{'$or':_[_0xd4c5('0x30')](_0x452837['attributes'],function(_0x399d82){var _0x20b695={};_0x20b695[_0x399d82]={'$like':'%'+_0x11fbbc[_0xd4c5('0x35')][_0xd4c5('0x41')]+'%'};return _0x20b695;})});}_0x452837=_[_0xd4c5('0x42')]({},_0x452837,_0x11fbbc[_0xd4c5('0x43')]);return _0x27241a['getAgents'](_0x452837);}})[_0xd4c5('0x29')](function(_0xf6b5a0){if(_0xf6b5a0){_0x97b99c=_0xf6b5a0[_0xd4c5('0x3b')];if(!_0x11fbbc['query'][_0xd4c5('0x59')](_0xd4c5('0x3c'))){_0x452837[_0xd4c5('0x22')]=qs['limit'](_0x11fbbc['query'][_0xd4c5('0x22')]);_0x452837[_0xd4c5('0x20')]=qs[_0xd4c5('0x20')](_0x11fbbc[_0xd4c5('0x35')]['offset']);}return _0x27241a['getAgents'](_0x452837);}})[_0xd4c5('0x29')](function(_0x5ea3e1){if(_0x5ea3e1){return _0x5ea3e1?{'count':_0x97b99c,'rows':_0x5ea3e1}:null;}})[_0xd4c5('0x29')](respondWithResult(_0x5decce,null))[_0xd4c5('0x48')](handleError(_0x5decce,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 8346216..197a67d 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 _0x1221=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','update','remove'];(function(_0x314e22,_0x891517){var _0x4ac0f5=function(_0x43aa65){while(--_0x43aa65){_0x314e22['push'](_0x314e22['shift']());}};_0x4ac0f5(++_0x891517);}(_0x1221,0xc2));var _0x1122=function(_0xdfc7ce,_0x183f1e){_0xdfc7ce=_0xdfc7ce-0x0;var _0x221980=_0x1221[_0xdfc7ce];return _0x221980;};'use strict';var EventEmitter=require(_0x1122('0x0'));var WhatsappQueue=require(_0x1122('0x1'))['db'][_0x1122('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x1122('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1122('0x4'),'afterDestroy':_0x1122('0x5')};function emitEvent(_0x499cf8){return function(_0x5f0f20,_0x20d939,_0x2d5fca){WhatsappQueueEvents[_0x1122('0x6')](_0x499cf8+':'+_0x5f0f20['id'],_0x5f0f20);WhatsappQueueEvents[_0x1122('0x6')](_0x499cf8,_0x5f0f20);_0x2d5fca(null);};}for(var e in events){if(events[_0x1122('0x7')](e)){var event=events[e];WhatsappQueue[_0x1122('0x8')](e,emitEvent(event));}}module[_0x1122('0x9')]=WhatsappQueueEvents; \ No newline at end of file +var _0xf338=['../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x94763a,_0x2cf313){var _0x16ea37=function(_0x542cb1){while(--_0x542cb1){_0x94763a['push'](_0x94763a['shift']());}};_0x16ea37(++_0x2cf313);}(_0xf338,0x188));var _0x8f33=function(_0x14d76a,_0x38c683){_0x14d76a=_0x14d76a-0x0;var _0x5baef8=_0xf338[_0x14d76a];return _0x5baef8;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x8f33('0x0'))['db'][_0x8f33('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x8f33('0x2')](0x0);var events={'afterCreate':_0x8f33('0x3'),'afterUpdate':_0x8f33('0x4'),'afterDestroy':_0x8f33('0x5')};function emitEvent(_0x350d79){return function(_0x749325,_0x16bd62,_0x187058){WhatsappQueueEvents['emit'](_0x350d79+':'+_0x749325['id'],_0x749325);WhatsappQueueEvents['emit'](_0x350d79,_0x749325);_0x187058(null);};}for(var e in events){if(events[_0x8f33('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index ecc3255..9b5fdb1 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 _0x48e3=['rimraf','./whatsappQueue.attributes','define','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x57fd67,_0x4a14ba){var _0x4a45d1=function(_0x30e5af){while(--_0x30e5af){_0x57fd67['push'](_0x57fd67['shift']());}};_0x4a45d1(++_0x4a14ba);}(_0x48e3,0x18b));var _0x348e=function(_0x235620,_0x431a7d){_0x235620=_0x235620-0x0;var _0x53f128=_0x48e3[_0x235620];return _0x53f128;};'use strict';var _=require(_0x348e('0x0'));var util=require(_0x348e('0x1'));var logger=require(_0x348e('0x2'))(_0x348e('0x3'));var moment=require(_0x348e('0x4'));var BPromise=require(_0x348e('0x5'));var rp=require(_0x348e('0x6'));var fs=require('fs');var path=require(_0x348e('0x7'));var rimraf=require(_0x348e('0x8'));var config=require('../../config/environment');var attributes=require(_0x348e('0x9'));module['exports']=function(_0x3d4d60,_0x4374f6){return _0x3d4d60[_0x348e('0xa')](_0x348e('0xb'),attributes,{'tableName':_0x348e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x52c1=['moment','request-promise','rimraf','./whatsappQueue.attributes','exports','define','WhatsappQueue','lodash','../../config/logger','api'];(function(_0x425635,_0x2c2fcf){var _0x26b976=function(_0x2f5c47){while(--_0x2f5c47){_0x425635['push'](_0x425635['shift']());}};_0x26b976(++_0x2c2fcf);}(_0x52c1,0xb1));var _0x152c=function(_0x4bd439,_0x3755f8){_0x4bd439=_0x4bd439-0x0;var _0x4adefa=_0x52c1[_0x4bd439];return _0x4adefa;};'use strict';var _=require(_0x152c('0x0'));var util=require('util');var logger=require(_0x152c('0x1'))(_0x152c('0x2'));var moment=require(_0x152c('0x3'));var BPromise=require('bluebird');var rp=require(_0x152c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x152c('0x5'));var config=require('../../config/environment');var attributes=require(_0x152c('0x6'));module[_0x152c('0x7')]=function(_0x25aa9e,_0x21d262){return _0x25aa9e[_0x152c('0x8')](_0x152c('0x9'),attributes,{'tableName':'whatsapp_queues','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 3329801..8bcba28 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 _0xe369=['message','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','map','include','model','find','ShowWhatsappQueue','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x555f7b,_0x2db992){var _0x330ec1=function(_0x42326a){while(--_0x42326a){_0x555f7b['push'](_0x555f7b['shift']());}};_0x330ec1(++_0x2db992);}(_0xe369,0x126));var _0x9e36=function(_0x389f51,_0x14fb67){_0x389f51=_0x389f51-0x0;var _0x32da11=_0xe369[_0x389f51];return _0x32da11;};'use strict';var _=require('lodash');var util=require(_0x9e36('0x0'));var moment=require(_0x9e36('0x1'));var BPromise=require('bluebird');var rs=require(_0x9e36('0x2'));var fs=require('fs');var Redis=require(_0x9e36('0x3'));var db=require(_0x9e36('0x4'))['db'];var utils=require(_0x9e36('0x5'));var logger=require(_0x9e36('0x6'))(_0x9e36('0x7'));var config=require(_0x9e36('0x8'));var jayson=require(_0x9e36('0x9'));var client=jayson[_0x9e36('0xa')][_0x9e36('0xb')]({'port':0x232a});config[_0x9e36('0xc')]=_[_0x9e36('0xd')](config['redis'],{'host':_0x9e36('0xe'),'port':0x18eb});var socket=require(_0x9e36('0xf'))(new Redis(config['redis']));require('./whatsappQueue.socket')['register'](socket);function respondWithRpcPromise(_0x5e93c7,_0x2e4ca3,_0x33e7dc){return new BPromise(function(_0x2c6924,_0x2224c5){return client[_0x9e36('0x10')](_0x5e93c7,_0x33e7dc)[_0x9e36('0x11')](function(_0x5bb39d){logger[_0x9e36('0x12')](_0x9e36('0x13'),_0x2e4ca3,'request\x20sent');logger[_0x9e36('0x14')](_0x9e36('0x15'),_0x2e4ca3,_0x9e36('0x16'),JSON[_0x9e36('0x17')](_0x5bb39d));if(_0x5bb39d[_0x9e36('0x18')]){if(_0x5bb39d['error'][_0x9e36('0x19')]===0x1f4){logger[_0x9e36('0x18')](_0x9e36('0x13'),_0x2e4ca3,_0x5bb39d[_0x9e36('0x18')][_0x9e36('0x1a')]);return _0x2224c5(_0x5bb39d[_0x9e36('0x18')]['message']);}logger[_0x9e36('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x2e4ca3,_0x5bb39d['error']['message']);return _0x2c6924(_0x5bb39d[_0x9e36('0x18')]['message']);}else{logger[_0x9e36('0x12')](_0x9e36('0x13'),_0x2e4ca3,_0x9e36('0x16'));_0x2c6924(_0x5bb39d['result']['message']);}})[_0x9e36('0x1b')](function(_0x2b7702){logger[_0x9e36('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x2e4ca3,_0x2b7702);_0x2224c5(_0x2b7702);});});}exports[_0x9e36('0x1c')]=function(_0x1ab727){var _0x328bf7=this;return new Promise(function(_0x2360cb,_0x47c7a9){return db[_0x9e36('0x1d')][_0x9e36('0x1e')]({'raw':_0x1ab727[_0x9e36('0x1f')]?_0x1ab727[_0x9e36('0x1f')][_0x9e36('0x20')]===undefined?!![]:![]:!![],'where':_0x1ab727[_0x9e36('0x1f')]?_0x1ab727[_0x9e36('0x1f')][_0x9e36('0x21')]||null:null,'attributes':_0x1ab727[_0x9e36('0x1f')]?_0x1ab727[_0x9e36('0x1f')][_0x9e36('0x22')]||null:null,'limit':_0x1ab727[_0x9e36('0x1f')]?_0x1ab727[_0x9e36('0x1f')]['limit']||null:null,'include':_0x1ab727[_0x9e36('0x1f')]?_0x1ab727['options']['include']?_[_0x9e36('0x23')](_0x1ab727[_0x9e36('0x1f')][_0x9e36('0x24')],function(_0x25e6c6){return{'model':db[_0x25e6c6['model']],'as':_0x25e6c6['as'],'attributes':_0x25e6c6[_0x9e36('0x22')],'include':_0x25e6c6[_0x9e36('0x24')]?_[_0x9e36('0x23')](_0x25e6c6[_0x9e36('0x24')],function(_0x50c493){return{'model':db[_0x50c493[_0x9e36('0x25')]],'as':_0x50c493['as'],'attributes':_0x50c493[_0x9e36('0x22')],'include':_0x50c493[_0x9e36('0x24')]?_[_0x9e36('0x23')](_0x50c493[_0x9e36('0x24')],function(_0x4746ac){return{'model':db[_0x4746ac['model']],'as':_0x4746ac['as'],'attributes':_0x4746ac[_0x9e36('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x55191b){logger['info'](_0x9e36('0x1c'),_0x1ab727);logger[_0x9e36('0x14')](_0x9e36('0x1c'),_0x1ab727,JSON[_0x9e36('0x17')](_0x55191b));_0x2360cb(_0x55191b);})[_0x9e36('0x1b')](function(_0x1d4bd5){logger['error'](_0x9e36('0x1c'),_0x1d4bd5['message'],_0x1ab727);_0x47c7a9(_0x328bf7[_0x9e36('0x18')](0x1f4,_0x1d4bd5[_0x9e36('0x1a')]));});});};exports['ShowWhatsappQueue']=function(_0x43e6fd){var _0x3fba23=this;return new Promise(function(_0x277e64,_0x3bced6){return db[_0x9e36('0x1d')][_0x9e36('0x26')]({'raw':_0x43e6fd[_0x9e36('0x1f')]?_0x43e6fd[_0x9e36('0x1f')][_0x9e36('0x20')]===undefined?!![]:![]:!![],'where':_0x43e6fd[_0x9e36('0x1f')]?_0x43e6fd[_0x9e36('0x1f')]['where']||null:null,'attributes':_0x43e6fd[_0x9e36('0x1f')]?_0x43e6fd[_0x9e36('0x1f')][_0x9e36('0x22')]||null:null,'include':_0x43e6fd['options']?_0x43e6fd[_0x9e36('0x1f')][_0x9e36('0x24')]?_['map'](_0x43e6fd[_0x9e36('0x1f')][_0x9e36('0x24')],function(_0x10c5f6){return{'model':db[_0x10c5f6[_0x9e36('0x25')]],'as':_0x10c5f6['as'],'attributes':_0x10c5f6[_0x9e36('0x22')],'include':_0x10c5f6[_0x9e36('0x24')]?_[_0x9e36('0x23')](_0x10c5f6[_0x9e36('0x24')],function(_0x3d7a73){return{'model':db[_0x3d7a73[_0x9e36('0x25')]],'as':_0x3d7a73['as'],'attributes':_0x3d7a73[_0x9e36('0x22')],'include':_0x3d7a73[_0x9e36('0x24')]?_[_0x9e36('0x23')](_0x3d7a73[_0x9e36('0x24')],function(_0x5c35c4){return{'model':db[_0x5c35c4['model']],'as':_0x5c35c4['as'],'attributes':_0x5c35c4[_0x9e36('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9e36('0x11')](function(_0x4c4f5a){logger[_0x9e36('0x12')](_0x9e36('0x27'),_0x43e6fd);logger[_0x9e36('0x14')](_0x9e36('0x27'),_0x43e6fd,JSON[_0x9e36('0x17')](_0x4c4f5a));_0x277e64(_0x4c4f5a);})[_0x9e36('0x1b')](function(_0x486695){logger[_0x9e36('0x18')]('ShowWhatsappQueue',_0x486695[_0x9e36('0x1a')],_0x43e6fd);_0x3bced6(_0x3fba23[_0x9e36('0x18')](0x1f4,_0x486695[_0x9e36('0x1a')]));});});}; \ No newline at end of file +var _0x3374=['ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','localhost','request','then','info','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappQueue,\x20%s,\x20%s','message','result','catch','GetWhatsappQueue','WhatsappQueue','options','raw','where','include','model','attributes','debug','ShowWhatsappQueue','find','map','lodash','moment','randomstring'];(function(_0x12d403,_0x2a1d4f){var _0x544ced=function(_0x2772f2){while(--_0x2772f2){_0x12d403['push'](_0x12d403['shift']());}};_0x544ced(++_0x2a1d4f);}(_0x3374,0xf9));var _0x4337=function(_0x4c81cb,_0x5a0b47){_0x4c81cb=_0x4c81cb-0x0;var _0x85c34a=_0x3374[_0x4c81cb];return _0x85c34a;};'use strict';var _=require(_0x4337('0x0'));var util=require('util');var moment=require(_0x4337('0x1'));var BPromise=require('bluebird');var rs=require(_0x4337('0x2'));var fs=require('fs');var Redis=require(_0x4337('0x3'));var db=require(_0x4337('0x4'))['db'];var utils=require(_0x4337('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4337('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4337('0x7')][_0x4337('0x8')]({'port':0x232a});config[_0x4337('0x9')]=_[_0x4337('0xa')](config[_0x4337('0x9')],{'host':_0x4337('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappQueue.socket')['register'](socket);function respondWithRpcPromise(_0x26925e,_0x26d6db,_0x2e12eb){return new BPromise(function(_0x38ae56,_0x2d37d2){return client[_0x4337('0xc')](_0x26925e,_0x2e12eb)[_0x4337('0xd')](function(_0x49a02c){logger[_0x4337('0xe')]('WhatsappQueue,\x20%s,\x20%s',_0x26d6db,_0x4337('0xf'));logger['debug'](_0x4337('0x10'),_0x26d6db,'request\x20sent',JSON[_0x4337('0x11')](_0x49a02c));if(_0x49a02c[_0x4337('0x12')]){if(_0x49a02c[_0x4337('0x12')][_0x4337('0x13')]===0x1f4){logger['error'](_0x4337('0x14'),_0x26d6db,_0x49a02c[_0x4337('0x12')][_0x4337('0x15')]);return _0x2d37d2(_0x49a02c['error'][_0x4337('0x15')]);}logger[_0x4337('0x12')](_0x4337('0x14'),_0x26d6db,_0x49a02c[_0x4337('0x12')]['message']);return _0x38ae56(_0x49a02c[_0x4337('0x12')][_0x4337('0x15')]);}else{logger[_0x4337('0xe')](_0x4337('0x14'),_0x26d6db,'request\x20sent');_0x38ae56(_0x49a02c[_0x4337('0x16')][_0x4337('0x15')]);}})[_0x4337('0x17')](function(_0x57a37a){logger['error'](_0x4337('0x14'),_0x26d6db,_0x57a37a);_0x2d37d2(_0x57a37a);});});}exports[_0x4337('0x18')]=function(_0x3663c1){var _0x26e3ed=this;return new Promise(function(_0x18836b,_0x2049d6){return db[_0x4337('0x19')]['findAll']({'raw':_0x3663c1[_0x4337('0x1a')]?_0x3663c1[_0x4337('0x1a')][_0x4337('0x1b')]===undefined?!![]:![]:!![],'where':_0x3663c1[_0x4337('0x1a')]?_0x3663c1[_0x4337('0x1a')][_0x4337('0x1c')]||null:null,'attributes':_0x3663c1[_0x4337('0x1a')]?_0x3663c1[_0x4337('0x1a')]['attributes']||null:null,'limit':_0x3663c1[_0x4337('0x1a')]?_0x3663c1['options']['limit']||null:null,'include':_0x3663c1[_0x4337('0x1a')]?_0x3663c1['options'][_0x4337('0x1d')]?_['map'](_0x3663c1[_0x4337('0x1a')][_0x4337('0x1d')],function(_0x2b01b5){return{'model':db[_0x2b01b5[_0x4337('0x1e')]],'as':_0x2b01b5['as'],'attributes':_0x2b01b5[_0x4337('0x1f')],'include':_0x2b01b5[_0x4337('0x1d')]?_['map'](_0x2b01b5[_0x4337('0x1d')],function(_0x3b5d78){return{'model':db[_0x3b5d78[_0x4337('0x1e')]],'as':_0x3b5d78['as'],'attributes':_0x3b5d78[_0x4337('0x1f')],'include':_0x3b5d78[_0x4337('0x1d')]?_['map'](_0x3b5d78['include'],function(_0x3a3029){return{'model':db[_0x3a3029[_0x4337('0x1e')]],'as':_0x3a3029['as'],'attributes':_0x3a3029['attributes']};}):[]};}):[]};}):[]:[]})[_0x4337('0xd')](function(_0x5647e1){logger[_0x4337('0xe')](_0x4337('0x18'),_0x3663c1);logger[_0x4337('0x20')](_0x4337('0x18'),_0x3663c1,JSON[_0x4337('0x11')](_0x5647e1));_0x18836b(_0x5647e1);})[_0x4337('0x17')](function(_0x5b450e){logger['error'](_0x4337('0x18'),_0x5b450e[_0x4337('0x15')],_0x3663c1);_0x2049d6(_0x26e3ed[_0x4337('0x12')](0x1f4,_0x5b450e['message']));});});};exports[_0x4337('0x21')]=function(_0x87898){var _0x85ee2c=this;return new Promise(function(_0x5a6103,_0x505e21){return db[_0x4337('0x19')][_0x4337('0x22')]({'raw':_0x87898['options']?_0x87898[_0x4337('0x1a')][_0x4337('0x1b')]===undefined?!![]:![]:!![],'where':_0x87898[_0x4337('0x1a')]?_0x87898[_0x4337('0x1a')]['where']||null:null,'attributes':_0x87898['options']?_0x87898[_0x4337('0x1a')][_0x4337('0x1f')]||null:null,'include':_0x87898['options']?_0x87898[_0x4337('0x1a')][_0x4337('0x1d')]?_[_0x4337('0x23')](_0x87898['options'][_0x4337('0x1d')],function(_0x43d0e8){return{'model':db[_0x43d0e8[_0x4337('0x1e')]],'as':_0x43d0e8['as'],'attributes':_0x43d0e8[_0x4337('0x1f')],'include':_0x43d0e8[_0x4337('0x1d')]?_[_0x4337('0x23')](_0x43d0e8[_0x4337('0x1d')],function(_0x4b09f1){return{'model':db[_0x4b09f1['model']],'as':_0x4b09f1['as'],'attributes':_0x4b09f1[_0x4337('0x1f')],'include':_0x4b09f1['include']?_[_0x4337('0x23')](_0x4b09f1[_0x4337('0x1d')],function(_0x22fcf8){return{'model':db[_0x22fcf8[_0x4337('0x1e')]],'as':_0x22fcf8['as'],'attributes':_0x22fcf8[_0x4337('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4337('0xd')](function(_0x5097b2){logger[_0x4337('0xe')](_0x4337('0x21'),_0x87898);logger[_0x4337('0x20')](_0x4337('0x21'),_0x87898,JSON['stringify'](_0x5097b2));_0x5a6103(_0x5097b2);})[_0x4337('0x17')](function(_0x19255e){logger[_0x4337('0x12')](_0x4337('0x21'),_0x19255e['message'],_0x87898);_0x505e21(_0x85ee2c[_0x4337('0x12')](0x1f4,_0x19255e[_0x4337('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 8db885d..cf95f70 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 _0xf985=['save','remove','update','removeListener','register','length','./whatsappQueue.events'];(function(_0x20e08e,_0x5947ec){var _0xbc6791=function(_0x5455e8){while(--_0x5455e8){_0x20e08e['push'](_0x20e08e['shift']());}};_0xbc6791(++_0x5947ec);}(_0xf985,0x1a3));var _0x5f98=function(_0x1ca274,_0x460d98){_0x1ca274=_0x1ca274-0x0;var _0x57fdac=_0xf985[_0x1ca274];return _0x57fdac;};'use strict';var WhatsappQueueEvents=require(_0x5f98('0x0'));var events=[_0x5f98('0x1'),_0x5f98('0x2'),_0x5f98('0x3')];function createListener(_0x4f08e2,_0x114ae5){return function(_0x39015d){_0x114ae5['emit'](_0x4f08e2,_0x39015d);};}function removeListener(_0x431bff,_0x264dd0){return function(){WhatsappQueueEvents[_0x5f98('0x4')](_0x431bff,_0x264dd0);};}exports[_0x5f98('0x5')]=function(_0x424522){for(var _0x3a7f59=0x0,_0x157210=events[_0x5f98('0x6')];_0x3a7f59<_0x157210;_0x3a7f59++){var _0x324a24=events[_0x3a7f59];var _0x1b8faf=createListener('whatsappQueue:'+_0x324a24,_0x424522);WhatsappQueueEvents['on'](_0x324a24,_0x1b8faf);}}; \ No newline at end of file +var _0x9140=['register','length','whatsappQueue:','./whatsappQueue.events','save','remove','update','emit'];(function(_0x147d62,_0x1a11ca){var _0x4cb168=function(_0x300e3e){while(--_0x300e3e){_0x147d62['push'](_0x147d62['shift']());}};_0x4cb168(++_0x1a11ca);}(_0x9140,0xd3));var _0x0914=function(_0x26fb62,_0x574e5e){_0x26fb62=_0x26fb62-0x0;var _0x556ad1=_0x9140[_0x26fb62];return _0x556ad1;};'use strict';var WhatsappQueueEvents=require(_0x0914('0x0'));var events=[_0x0914('0x1'),_0x0914('0x2'),_0x0914('0x3')];function createListener(_0x5b749f,_0x2791a9){return function(_0x523a3e){_0x2791a9[_0x0914('0x4')](_0x5b749f,_0x523a3e);};}function removeListener(_0x5dd21a,_0x75a0ec){return function(){WhatsappQueueEvents['removeListener'](_0x5dd21a,_0x75a0ec);};}exports[_0x0914('0x5')]=function(_0x23b29a){for(var _0x3fb171=0x0,_0x46f663=events[_0x0914('0x6')];_0x3fb171<_0x46f663;_0x3fb171++){var _0x44a6bf=events[_0x3fb171];var _0x27102f=createListener(_0x0914('0x7')+_0x44a6bf,_0x23b29a);WhatsappQueueEvents['on'](_0x44a6bf,_0x27102f);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 8281d74..3f33ede 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 _0x9983=['../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','isAuthenticated','get','describe','/:id','show','post','create','put','exports','multer','connect-timeout','express','Router','fs-extra'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x9983,0x14f));var _0x3998=function(_0x872be4,_0x577d9b){_0x872be4=_0x872be4-0x0;var _0x2e4225=_0x9983[_0x872be4];return _0x2e4225;};'use strict';var multer=require(_0x3998('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3998('0x1'));var express=require(_0x3998('0x2'));var router=express[_0x3998('0x3')]();var fs_extra=require(_0x3998('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3998('0x5'));var config=require(_0x3998('0x6'));var controller=require(_0x3998('0x7'));router['get']('/',auth[_0x3998('0x8')](),controller['index']);router[_0x3998('0x9')]('/describe',auth[_0x3998('0x8')](),controller[_0x3998('0xa')]);router[_0x3998('0x9')](_0x3998('0xb'),auth['isAuthenticated'](),controller[_0x3998('0xc')]);router[_0x3998('0xd')]('/',auth[_0x3998('0x8')](),controller[_0x3998('0xe')]);router[_0x3998('0xf')](_0x3998('0xb'),auth[_0x3998('0x8')](),controller['update']);router['delete'](_0x3998('0xb'),auth[_0x3998('0x8')](),controller['destroy']);module[_0x3998('0x10')]=router; \ No newline at end of file +var _0xd137=['isAuthenticated','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','index','describe','/:id','show','post'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd137,0x140));var _0x7d13=function(_0x285070,_0x1704ba){_0x285070=_0x285070-0x0;var _0x7c6ad4=_0xd137[_0x285070];return _0x7c6ad4;};'use strict';var multer=require(_0x7d13('0x0'));var util=require(_0x7d13('0x1'));var path=require(_0x7d13('0x2'));var timeout=require(_0x7d13('0x3'));var express=require(_0x7d13('0x4'));var router=express[_0x7d13('0x5')]();var fs_extra=require(_0x7d13('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7d13('0x7'));var config=require(_0x7d13('0x8'));var controller=require(_0x7d13('0x9'));router[_0x7d13('0xa')]('/',auth['isAuthenticated'](),controller[_0x7d13('0xb')]);router[_0x7d13('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x7d13('0xc')]);router['get'](_0x7d13('0xd'),auth['isAuthenticated'](),controller[_0x7d13('0xe')]);router[_0x7d13('0xf')]('/',auth[_0x7d13('0x10')](),controller[_0x7d13('0x11')]);router[_0x7d13('0x12')](_0x7d13('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x7d13('0x13')](_0x7d13('0xd'),auth[_0x7d13('0x10')](),controller['destroy']);module[_0x7d13('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 940f7f2..2544c5d 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(_0x2fcc32,_0x247008){var _0x1b960c=function(_0x58ac92){while(--_0x58ac92){_0x2fcc32['push'](_0x2fcc32['shift']());}};_0x1b960c(++_0x247008);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x29bb65,_0x22a0d8){var _0xbe6e2f=function(_0xcb68b3){while(--_0xcb68b3){_0x29bb65['push'](_0x29bb65['shift']());}};_0xbe6e2f(++_0x22a0d8);}(_0x7a54,0x106));var _0x47a5=function(_0x1a2517,_0xe7894e){_0x1a2517=_0x1a2517-0x0;var _0x16d146=_0x7a54[_0x1a2517];return _0x16d146;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index e859f31..5770e38 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 _0xb574=['set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','WhatsappQueueReport','findAll','rows','catch','params','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset'];(function(_0x30c57f,_0x4e26ca){var _0x570756=function(_0xd1ee2e){while(--_0xd1ee2e){_0x30c57f['push'](_0x30c57f['shift']());}};_0x570756(++_0x4e26ca);}(_0xb574,0x106));var _0x4b57=function(_0x3cfd73,_0x2e87b8){_0x3cfd73=_0x3cfd73-0x0;var _0x2ff9af=_0xb574[_0x3cfd73];return _0x2ff9af;};'use strict';var emlformat=require(_0x4b57('0x0'));var rimraf=require(_0x4b57('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4b57('0x2'));var rp=require(_0x4b57('0x3'));var moment=require('moment');var BPromise=require(_0x4b57('0x4'));var Mustache=require(_0x4b57('0x5'));var util=require(_0x4b57('0x6'));var path=require(_0x4b57('0x7'));var sox=require(_0x4b57('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b57('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4b57('0xa'));var toCsv=require(_0x4b57('0xb'));var querystring=require(_0x4b57('0xc'));var Papa=require(_0x4b57('0xd'));var Redis=require(_0x4b57('0xe'));var authService=require(_0x4b57('0xf'));var qs=require(_0x4b57('0x10'));var as=require(_0x4b57('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b57('0x12'))(_0x4b57('0x13'));var utils=require(_0x4b57('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4b57('0x15'))['db'];function respondWithStatusCode(_0x357c8b,_0x43d066){_0x43d066=_0x43d066||0xcc;return function(_0xf8a6fc){if(_0xf8a6fc){return _0x357c8b[_0x4b57('0x16')](_0x43d066);}return _0x357c8b[_0x4b57('0x17')](_0x43d066)[_0x4b57('0x18')]();};}function respondWithResult(_0xd5ee6d,_0x31cced){_0x31cced=_0x31cced||0xc8;return function(_0x4e15be){if(_0x4e15be){return _0xd5ee6d['status'](_0x31cced)[_0x4b57('0x19')](_0x4e15be);}};}function respondWithFilteredResult(_0x24f776,_0x10b9ff){return function(_0x58d6bd){if(_0x58d6bd){var _0x284640=typeof _0x10b9ff['offset']===_0x4b57('0x1a')&&typeof _0x10b9ff[_0x4b57('0x1b')]===_0x4b57('0x1a');var _0x10eda5=_0x58d6bd[_0x4b57('0x1c')];var _0xfb71cc=_0x284640?0x0:_0x10b9ff['offset'];var _0x1b35ff=_0x284640?_0x58d6bd[_0x4b57('0x1c')]:_0x10b9ff[_0x4b57('0x1d')]+_0x10b9ff[_0x4b57('0x1b')];var _0x4baaeb;if(_0x1b35ff>=_0x10eda5){_0x1b35ff=_0x10eda5;_0x4baaeb=0xc8;}else{_0x4baaeb=0xce;}_0x24f776[_0x4b57('0x17')](_0x4baaeb);return _0x24f776[_0x4b57('0x1e')](_0x4b57('0x1f'),_0xfb71cc+'-'+_0x1b35ff+'/'+_0x10eda5)[_0x4b57('0x19')](_0x58d6bd);}return null;};}function patchUpdates(_0xef1eae){return function(_0x4454c8){try{jsonpatch['apply'](_0x4454c8,_0xef1eae,!![]);}catch(_0x4b504b){return BPromise[_0x4b57('0x20')](_0x4b504b);}return _0x4454c8[_0x4b57('0x21')]();};}function saveUpdates(_0x567d8f,_0x380554){return function(_0x4a34b2){if(_0x4a34b2){return _0x4a34b2[_0x4b57('0x22')](_0x567d8f)[_0x4b57('0x23')](function(_0x56f017){return _0x56f017;});}return null;};}function removeEntity(_0x271361,_0x368c5f){return function(_0x4d07c9){if(_0x4d07c9){return _0x4d07c9[_0x4b57('0x24')]()[_0x4b57('0x23')](function(){_0x271361[_0x4b57('0x17')](0xcc)[_0x4b57('0x18')]();});}};}function handleEntityNotFound(_0x540eff,_0x156962){return function(_0x51d0c3){if(!_0x51d0c3){_0x540eff[_0x4b57('0x16')](0x194);}return _0x51d0c3;};}function handleError(_0x517119,_0x36ceb1){_0x36ceb1=_0x36ceb1||0x1f4;return function(_0x2dc9d8){logger[_0x4b57('0x25')](_0x2dc9d8[_0x4b57('0x26')]);if(_0x2dc9d8[_0x4b57('0x27')]){delete _0x2dc9d8[_0x4b57('0x27')];}_0x517119['status'](_0x36ceb1)['send'](_0x2dc9d8);};}exports[_0x4b57('0x28')]=function(_0x4c58e4,_0x1ea0cb){var _0x458f70={},_0x874cf7={},_0x3af22f={'count':0x0,'rows':[]};var _0x249461=_[_0x4b57('0x29')](db['WhatsappQueueReport'][_0x4b57('0x2a')],function(_0x2e9922){return{'name':_0x2e9922[_0x4b57('0x2b')],'type':_0x2e9922[_0x4b57('0x2c')]['key']};});_0x874cf7[_0x4b57('0x2d')]=_[_0x4b57('0x29')](_0x249461,'name');_0x874cf7[_0x4b57('0x2e')]=_[_0x4b57('0x2f')](_0x4c58e4[_0x4b57('0x2e')]);_0x874cf7[_0x4b57('0x30')]=_['intersection'](_0x874cf7['model'],_0x874cf7['query']);_0x458f70[_0x4b57('0x31')]=_[_0x4b57('0x32')](_0x874cf7[_0x4b57('0x2d')],qs[_0x4b57('0x33')](_0x4c58e4[_0x4b57('0x2e')]['fields']));_0x458f70[_0x4b57('0x31')]=_0x458f70[_0x4b57('0x31')][_0x4b57('0x34')]?_0x458f70['attributes']:_0x874cf7[_0x4b57('0x2d')];if(!_0x4c58e4[_0x4b57('0x2e')][_0x4b57('0x35')]('nolimit')){_0x458f70[_0x4b57('0x1b')]=qs[_0x4b57('0x1b')](_0x4c58e4['query'][_0x4b57('0x1b')]);_0x458f70[_0x4b57('0x1d')]=qs[_0x4b57('0x1d')](_0x4c58e4[_0x4b57('0x2e')][_0x4b57('0x1d')]);}_0x458f70[_0x4b57('0x36')]=qs['sort'](_0x4c58e4[_0x4b57('0x2e')][_0x4b57('0x37')]);_0x458f70[_0x4b57('0x38')]=qs[_0x4b57('0x30')](_[_0x4b57('0x39')](_0x4c58e4[_0x4b57('0x2e')],_0x874cf7[_0x4b57('0x30')]),_0x249461);if(_0x4c58e4['query']['filter']){_0x458f70[_0x4b57('0x38')]=_[_0x4b57('0x3a')](_0x458f70[_0x4b57('0x38')],{'$or':_['map'](_0x249461,function(_0x40414f){if(_0x40414f[_0x4b57('0x2c')]!==_0x4b57('0x3b')){var _0x3c086e={};_0x3c086e[_0x40414f['name']]={'$like':'%'+_0x4c58e4[_0x4b57('0x2e')][_0x4b57('0x3c')]+'%'};return _0x3c086e;}})});}_0x458f70=_[_0x4b57('0x3a')]({},_0x458f70,_0x4c58e4[_0x4b57('0x3d')]);var _0x56528f={'where':_0x458f70['where']};return db['WhatsappQueueReport'][_0x4b57('0x1c')](_0x56528f)[_0x4b57('0x23')](function(_0x188f24){_0x3af22f[_0x4b57('0x1c')]=_0x188f24;if(_0x4c58e4['query'][_0x4b57('0x3e')]){_0x458f70[_0x4b57('0x3f')]=[{'all':!![]}];}return db[_0x4b57('0x40')][_0x4b57('0x41')](_0x458f70);})[_0x4b57('0x23')](function(_0x453129){_0x3af22f[_0x4b57('0x42')]=_0x453129;return _0x3af22f;})[_0x4b57('0x23')](respondWithFilteredResult(_0x1ea0cb,_0x458f70))[_0x4b57('0x43')](handleError(_0x1ea0cb,null));};exports['show']=function(_0x318187,_0x3685fd){var _0x3c5095={'raw':!![],'where':{'id':_0x318187[_0x4b57('0x44')]['id']}},_0x5b2f50={};_0x5b2f50['model']=_[_0x4b57('0x2f')](db[_0x4b57('0x40')][_0x4b57('0x2a')]);_0x5b2f50[_0x4b57('0x2e')]=_[_0x4b57('0x2f')](_0x318187[_0x4b57('0x2e')]);_0x5b2f50[_0x4b57('0x30')]=_[_0x4b57('0x32')](_0x5b2f50[_0x4b57('0x2d')],_0x5b2f50[_0x4b57('0x2e')]);_0x3c5095[_0x4b57('0x31')]=_[_0x4b57('0x32')](_0x5b2f50[_0x4b57('0x2d')],qs['fields'](_0x318187['query'][_0x4b57('0x33')]));_0x3c5095[_0x4b57('0x31')]=_0x3c5095[_0x4b57('0x31')][_0x4b57('0x34')]?_0x3c5095['attributes']:_0x5b2f50[_0x4b57('0x2d')];if(_0x318187[_0x4b57('0x2e')]['includeAll']){_0x3c5095[_0x4b57('0x3f')]=[{'all':!![]}];}_0x3c5095=_['merge']({},_0x3c5095,_0x318187[_0x4b57('0x3d')]);return db['WhatsappQueueReport']['find'](_0x3c5095)[_0x4b57('0x23')](handleEntityNotFound(_0x3685fd,null))[_0x4b57('0x23')](respondWithResult(_0x3685fd,null))['catch'](handleError(_0x3685fd,null));};exports[_0x4b57('0x45')]=function(_0xc19684,_0x2732ff){return db[_0x4b57('0x40')][_0x4b57('0x45')](_0xc19684[_0x4b57('0x46')],{})['then'](respondWithResult(_0x2732ff,0xc9))[_0x4b57('0x43')](handleError(_0x2732ff,null));};exports[_0x4b57('0x22')]=function(_0x4a632c,_0xd529fb){if(_0x4a632c[_0x4b57('0x46')]['id']){delete _0x4a632c[_0x4b57('0x46')]['id'];}return db['WhatsappQueueReport'][_0x4b57('0x47')]({'where':{'id':_0x4a632c['params']['id']}})[_0x4b57('0x23')](handleEntityNotFound(_0xd529fb,null))[_0x4b57('0x23')](saveUpdates(_0x4a632c[_0x4b57('0x46')],null))[_0x4b57('0x23')](respondWithResult(_0xd529fb,null))[_0x4b57('0x43')](handleError(_0xd529fb,null));};exports[_0x4b57('0x24')]=function(_0x3d1ecd,_0x3ec6ba){return db['WhatsappQueueReport'][_0x4b57('0x47')]({'where':{'id':_0x3d1ecd[_0x4b57('0x44')]['id']}})[_0x4b57('0x23')](handleEntityNotFound(_0x3ec6ba,null))['then'](removeEntity(_0x3ec6ba,null))[_0x4b57('0x43')](handleError(_0x3ec6ba,null));};exports[_0x4b57('0x48')]=function(_0x32985f,_0x488bea){return db[_0x4b57('0x40')][_0x4b57('0x48')]()[_0x4b57('0x23')](respondWithResult(_0x488bea,null))[_0x4b57('0x43')](handleError(_0x488bea,null));}; \ No newline at end of file +var _0x69d3=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','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','count','set','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','WhatsappQueueReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','find','create','body','catch','update','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','util','to-csv'];(function(_0x518081,_0x288e8a){var _0x51be07=function(_0x119190){while(--_0x119190){_0x518081['push'](_0x518081['shift']());}};_0x51be07(++_0x288e8a);}(_0x69d3,0xda));var _0x369d=function(_0x53196a,_0x3678a8){_0x53196a=_0x53196a-0x0;var _0x536b97=_0x69d3[_0x53196a];return _0x536b97;};'use strict';var emlformat=require(_0x369d('0x0'));var rimraf=require(_0x369d('0x1'));var zipdir=require(_0x369d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x369d('0x3'));var moment=require(_0x369d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x369d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x369d('0x6'));var ejs=require(_0x369d('0x7'));var fs=require('fs');var fs_extra=require(_0x369d('0x8'));var _=require(_0x369d('0x9'));var squel=require(_0x369d('0xa'));var crypto=require(_0x369d('0xb'));var jsforce=require(_0x369d('0xc'));var deskjs=require(_0x369d('0xd'));var toCsv=require(_0x369d('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x369d('0xe'));var authService=require(_0x369d('0xf'));var qs=require(_0x369d('0x10'));var as=require(_0x369d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x369d('0x12'));var utils=require(_0x369d('0x13'));var config=require(_0x369d('0x14'));var licenseUtil=require(_0x369d('0x15'));var db=require(_0x369d('0x16'))['db'];function respondWithStatusCode(_0xee549e,_0x52c126){_0x52c126=_0x52c126||0xcc;return function(_0x15b417){if(_0x15b417){return _0xee549e[_0x369d('0x17')](_0x52c126);}return _0xee549e[_0x369d('0x18')](_0x52c126)[_0x369d('0x19')]();};}function respondWithResult(_0x121307,_0x539536){_0x539536=_0x539536||0xc8;return function(_0x5cd4c3){if(_0x5cd4c3){return _0x121307['status'](_0x539536)[_0x369d('0x1a')](_0x5cd4c3);}};}function respondWithFilteredResult(_0xa126c1,_0x389c43){return function(_0x5b4f55){if(_0x5b4f55){var _0x2c1a4a=typeof _0x389c43[_0x369d('0x1b')]===_0x369d('0x1c')&&typeof _0x389c43['limit']===_0x369d('0x1c');var _0x1f37ff=_0x5b4f55['count'];var _0x572513=_0x2c1a4a?0x0:_0x389c43['offset'];var _0x2946be=_0x2c1a4a?_0x5b4f55[_0x369d('0x1d')]:_0x389c43[_0x369d('0x1b')]+_0x389c43['limit'];var _0x410dbe;if(_0x2946be>=_0x1f37ff){_0x2946be=_0x1f37ff;_0x410dbe=0xc8;}else{_0x410dbe=0xce;}_0xa126c1[_0x369d('0x18')](_0x410dbe);return _0xa126c1[_0x369d('0x1e')](_0x369d('0x1f'),_0x572513+'-'+_0x2946be+'/'+_0x1f37ff)[_0x369d('0x1a')](_0x5b4f55);}return null;};}function patchUpdates(_0x538ca4){return function(_0x5c9fdd){try{jsonpatch[_0x369d('0x20')](_0x5c9fdd,_0x538ca4,!![]);}catch(_0x1edcd5){return BPromise[_0x369d('0x21')](_0x1edcd5);}return _0x5c9fdd[_0x369d('0x22')]();};}function saveUpdates(_0x84cc0f,_0x15fbef){return function(_0x1b262a){if(_0x1b262a){return _0x1b262a['update'](_0x84cc0f)['then'](function(_0x32ef9a){return _0x32ef9a;});}return null;};}function removeEntity(_0xed16e,_0xf7bc3a){return function(_0xcae58){if(_0xcae58){return _0xcae58[_0x369d('0x23')]()[_0x369d('0x24')](function(){_0xed16e[_0x369d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dfe83,_0x16145e){return function(_0x46de2b){if(!_0x46de2b){_0x4dfe83[_0x369d('0x17')](0x194);}return _0x46de2b;};}function handleError(_0xe01d2b,_0x8aa521){_0x8aa521=_0x8aa521||0x1f4;return function(_0x41e0cf){logger[_0x369d('0x25')](_0x41e0cf['stack']);if(_0x41e0cf[_0x369d('0x26')]){delete _0x41e0cf[_0x369d('0x26')];}_0xe01d2b[_0x369d('0x18')](_0x8aa521)[_0x369d('0x27')](_0x41e0cf);};}exports[_0x369d('0x28')]=function(_0x41367a,_0x3d1ce0){var _0x4d42ea={},_0x157291={},_0x56efb1={'count':0x0,'rows':[]};var _0x57b94c=_[_0x369d('0x29')](db[_0x369d('0x2a')]['rawAttributes'],function(_0x104540){return{'name':_0x104540['fieldName'],'type':_0x104540[_0x369d('0x2b')][_0x369d('0x2c')]};});_0x157291[_0x369d('0x2d')]=_[_0x369d('0x29')](_0x57b94c,_0x369d('0x26'));_0x157291[_0x369d('0x2e')]=_[_0x369d('0x2f')](_0x41367a['query']);_0x157291[_0x369d('0x30')]=_[_0x369d('0x31')](_0x157291[_0x369d('0x2d')],_0x157291[_0x369d('0x2e')]);_0x4d42ea[_0x369d('0x32')]=_[_0x369d('0x31')](_0x157291[_0x369d('0x2d')],qs[_0x369d('0x33')](_0x41367a['query'][_0x369d('0x33')]));_0x4d42ea[_0x369d('0x32')]=_0x4d42ea[_0x369d('0x32')][_0x369d('0x34')]?_0x4d42ea[_0x369d('0x32')]:_0x157291['model'];if(!_0x41367a[_0x369d('0x2e')][_0x369d('0x35')](_0x369d('0x36'))){_0x4d42ea[_0x369d('0x37')]=qs[_0x369d('0x37')](_0x41367a[_0x369d('0x2e')]['limit']);_0x4d42ea[_0x369d('0x1b')]=qs[_0x369d('0x1b')](_0x41367a[_0x369d('0x2e')][_0x369d('0x1b')]);}_0x4d42ea[_0x369d('0x38')]=qs[_0x369d('0x39')](_0x41367a[_0x369d('0x2e')][_0x369d('0x39')]);_0x4d42ea[_0x369d('0x3a')]=qs[_0x369d('0x30')](_[_0x369d('0x3b')](_0x41367a[_0x369d('0x2e')],_0x157291[_0x369d('0x30')]),_0x57b94c);if(_0x41367a[_0x369d('0x2e')][_0x369d('0x3c')]){_0x4d42ea[_0x369d('0x3a')]=_[_0x369d('0x3d')](_0x4d42ea[_0x369d('0x3a')],{'$or':_[_0x369d('0x29')](_0x57b94c,function(_0x7fd64b){if(_0x7fd64b[_0x369d('0x2b')]!==_0x369d('0x3e')){var _0xb7837f={};_0xb7837f[_0x7fd64b[_0x369d('0x26')]]={'$like':'%'+_0x41367a['query']['filter']+'%'};return _0xb7837f;}})});}_0x4d42ea=_[_0x369d('0x3d')]({},_0x4d42ea,_0x41367a[_0x369d('0x3f')]);var _0x8a1ef5={'where':_0x4d42ea[_0x369d('0x3a')]};return db[_0x369d('0x2a')][_0x369d('0x1d')](_0x8a1ef5)[_0x369d('0x24')](function(_0x169340){_0x56efb1[_0x369d('0x1d')]=_0x169340;if(_0x41367a['query'][_0x369d('0x40')]){_0x4d42ea[_0x369d('0x41')]=[{'all':!![]}];}return db[_0x369d('0x2a')][_0x369d('0x42')](_0x4d42ea);})[_0x369d('0x24')](function(_0x25cf4e){_0x56efb1[_0x369d('0x43')]=_0x25cf4e;return _0x56efb1;})[_0x369d('0x24')](respondWithFilteredResult(_0x3d1ce0,_0x4d42ea))['catch'](handleError(_0x3d1ce0,null));};exports['show']=function(_0x20b351,_0x3222ce){var _0x30909a={'raw':!![],'where':{'id':_0x20b351['params']['id']}},_0x4dad71={};_0x4dad71['model']=_[_0x369d('0x2f')](db[_0x369d('0x2a')]['rawAttributes']);_0x4dad71[_0x369d('0x2e')]=_[_0x369d('0x2f')](_0x20b351[_0x369d('0x2e')]);_0x4dad71[_0x369d('0x30')]=_['intersection'](_0x4dad71[_0x369d('0x2d')],_0x4dad71['query']);_0x30909a[_0x369d('0x32')]=_['intersection'](_0x4dad71[_0x369d('0x2d')],qs[_0x369d('0x33')](_0x20b351[_0x369d('0x2e')]['fields']));_0x30909a['attributes']=_0x30909a[_0x369d('0x32')][_0x369d('0x34')]?_0x30909a[_0x369d('0x32')]:_0x4dad71['model'];if(_0x20b351[_0x369d('0x2e')][_0x369d('0x40')]){_0x30909a[_0x369d('0x41')]=[{'all':!![]}];}_0x30909a=_[_0x369d('0x3d')]({},_0x30909a,_0x20b351[_0x369d('0x3f')]);return db[_0x369d('0x2a')][_0x369d('0x44')](_0x30909a)[_0x369d('0x24')](handleEntityNotFound(_0x3222ce,null))[_0x369d('0x24')](respondWithResult(_0x3222ce,null))['catch'](handleError(_0x3222ce,null));};exports[_0x369d('0x45')]=function(_0x41066d,_0xcc1465){return db[_0x369d('0x2a')][_0x369d('0x45')](_0x41066d[_0x369d('0x46')],{})['then'](respondWithResult(_0xcc1465,0xc9))[_0x369d('0x47')](handleError(_0xcc1465,null));};exports[_0x369d('0x48')]=function(_0x16dd8f,_0x44a357){if(_0x16dd8f[_0x369d('0x46')]['id']){delete _0x16dd8f[_0x369d('0x46')]['id'];}return db[_0x369d('0x2a')][_0x369d('0x44')]({'where':{'id':_0x16dd8f[_0x369d('0x49')]['id']}})[_0x369d('0x24')](handleEntityNotFound(_0x44a357,null))[_0x369d('0x24')](saveUpdates(_0x16dd8f[_0x369d('0x46')],null))['then'](respondWithResult(_0x44a357,null))[_0x369d('0x47')](handleError(_0x44a357,null));};exports[_0x369d('0x23')]=function(_0x289eb8,_0x85edd6){return db[_0x369d('0x2a')]['find']({'where':{'id':_0x289eb8[_0x369d('0x49')]['id']}})['then'](handleEntityNotFound(_0x85edd6,null))[_0x369d('0x24')](removeEntity(_0x85edd6,null))[_0x369d('0x47')](handleError(_0x85edd6,null));};exports[_0x369d('0x4a')]=function(_0x851746,_0x46c62c){return db[_0x369d('0x2a')][_0x369d('0x4a')]()[_0x369d('0x24')](respondWithResult(_0x46c62c,null))[_0x369d('0x47')](handleError(_0x46c62c,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index c96b280..5749080 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 _0xea59=['rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x3328cd,_0x40c52d){var _0x28341d=function(_0x4a6e1b){while(--_0x4a6e1b){_0x3328cd['push'](_0x3328cd['shift']());}};_0x28341d(++_0x40c52d);}(_0xea59,0xda));var _0x9ea5=function(_0x3b9b3b,_0x3ba36b){_0x3b9b3b=_0x3b9b3b-0x0;var _0x276785=_0xea59[_0x3b9b3b];return _0x276785;};'use strict';var _=require(_0x9ea5('0x0'));var util=require(_0x9ea5('0x1'));var logger=require('../../config/logger')(_0x9ea5('0x2'));var moment=require(_0x9ea5('0x3'));var BPromise=require(_0x9ea5('0x4'));var rp=require(_0x9ea5('0x5'));var fs=require('fs');var path=require(_0x9ea5('0x6'));var rimraf=require(_0x9ea5('0x7'));var config=require(_0x9ea5('0x8'));var attributes=require(_0x9ea5('0x9'));module[_0x9ea5('0xa')]=function(_0x5ddebf,_0x4d5014){return _0x5ddebf[_0x9ea5('0xb')](_0x9ea5('0xc'),attributes,{'tableName':_0x9ea5('0xd'),'paranoid':![],'indexes':[{'name':_0x9ea5('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa7b6=['exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','./whatsappQueueReport.attributes'];(function(_0x3963e2,_0x5ca5db){var _0x573236=function(_0x3f9ecd){while(--_0x3f9ecd){_0x3963e2['push'](_0x3963e2['shift']());}};_0x573236(++_0x5ca5db);}(_0xa7b6,0x88));var _0x6a7b=function(_0x1cbcf1,_0x3f9fd9){_0x1cbcf1=_0x1cbcf1-0x0;var _0x3a06f0=_0xa7b6[_0x1cbcf1];return _0x3a06f0;};'use strict';var _=require(_0x6a7b('0x0'));var util=require('util');var logger=require(_0x6a7b('0x1'))(_0x6a7b('0x2'));var moment=require(_0x6a7b('0x3'));var BPromise=require(_0x6a7b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a7b('0x5'));var rimraf=require('rimraf');var config=require(_0x6a7b('0x6'));var attributes=require(_0x6a7b('0x7'));module[_0x6a7b('0x8')]=function(_0x45381e,_0x47d691){return _0x45381e['define'](_0x6a7b('0x9'),attributes,{'tableName':_0x6a7b('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x6a7b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 3a6bb23..8131769 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 _0x4775=['moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateWhatsappQueueReport','WhatsappQueueReport','options','raw','update','body','where','attributes','limit','UpdateWhatsappQueueReport','lodash','util'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x4775,0x153));var _0x5477=function(_0x46c1d5,_0x5ca335){_0x46c1d5=_0x46c1d5-0x0;var _0x40fe7b=_0x4775[_0x46c1d5];return _0x40fe7b;};'use strict';var _=require(_0x5477('0x0'));var util=require(_0x5477('0x1'));var moment=require(_0x5477('0x2'));var BPromise=require(_0x5477('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5477('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5477('0x5'));var logger=require('../../config/logger')(_0x5477('0x6'));var config=require(_0x5477('0x7'));var jayson=require(_0x5477('0x8'));var client=jayson[_0x5477('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x586263,_0x312c1b,_0x4cb109){return new BPromise(function(_0x4acf98,_0x4168c3){return client[_0x5477('0xa')](_0x586263,_0x4cb109)[_0x5477('0xb')](function(_0x4d9f47){logger[_0x5477('0xc')](_0x5477('0xd'),_0x312c1b,_0x5477('0xe'));logger[_0x5477('0xf')](_0x5477('0x10'),_0x312c1b,'request\x20sent',JSON[_0x5477('0x11')](_0x4d9f47));if(_0x4d9f47[_0x5477('0x12')]){if(_0x4d9f47['error']['code']===0x1f4){logger[_0x5477('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x312c1b,_0x4d9f47[_0x5477('0x12')][_0x5477('0x13')]);return _0x4168c3(_0x4d9f47[_0x5477('0x12')][_0x5477('0x13')]);}logger[_0x5477('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x312c1b,_0x4d9f47['error'][_0x5477('0x13')]);return _0x4acf98(_0x4d9f47['error'][_0x5477('0x13')]);}else{logger[_0x5477('0xc')](_0x5477('0xd'),_0x312c1b,_0x5477('0xe'));_0x4acf98(_0x4d9f47['result']['message']);}})[_0x5477('0x14')](function(_0x127cd9){logger[_0x5477('0x12')](_0x5477('0xd'),_0x312c1b,_0x127cd9);_0x4168c3(_0x127cd9);});});}exports[_0x5477('0x15')]=function(_0x279404){var _0x159040=this;return new Promise(function(_0x118198,_0x3f37ae){return db[_0x5477('0x16')]['create'](_0x279404['body'],{'raw':_0x279404['options']?_0x279404[_0x5477('0x17')][_0x5477('0x18')]===undefined?!![]:![]:!![]})[_0x5477('0xb')](function(_0x3df0ca){logger[_0x5477('0xc')](_0x5477('0x15'),_0x279404);logger[_0x5477('0xf')](_0x5477('0x15'),_0x279404,JSON[_0x5477('0x11')](_0x3df0ca));_0x118198(_0x3df0ca);})[_0x5477('0x14')](function(_0x2c1efc){logger['error'](_0x5477('0x15'),_0x2c1efc[_0x5477('0x13')],_0x279404);_0x3f37ae(_0x159040[_0x5477('0x12')](0x1f4,_0x2c1efc[_0x5477('0x13')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x4cc026){var _0x14d19d=this;return new Promise(function(_0x5701a4,_0x41a0cf){return db[_0x5477('0x16')][_0x5477('0x19')](_0x4cc026[_0x5477('0x1a')],{'raw':_0x4cc026[_0x5477('0x17')]?_0x4cc026[_0x5477('0x17')][_0x5477('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cc026[_0x5477('0x17')]?_0x4cc026[_0x5477('0x17')][_0x5477('0x1b')]||null:null,'attributes':_0x4cc026[_0x5477('0x17')]?_0x4cc026[_0x5477('0x17')][_0x5477('0x1c')]||null:null,'limit':_0x4cc026[_0x5477('0x17')]?_0x4cc026[_0x5477('0x17')][_0x5477('0x1d')]||null:null})[_0x5477('0xb')](function(_0x135219){logger[_0x5477('0xc')](_0x5477('0x1e'),_0x4cc026);logger[_0x5477('0xf')](_0x5477('0x1e'),_0x4cc026,JSON[_0x5477('0x11')](_0x135219));_0x5701a4(_0x135219);})[_0x5477('0x14')](function(_0x337913){logger[_0x5477('0x12')](_0x5477('0x1e'),_0x337913['message'],_0x4cc026);_0x41a0cf(_0x14d19d['error'](0x1f4,_0x337913[_0x5477('0x13')]));});});}; \ No newline at end of file +var _0xcf9d=['WhatsappQueueReport','create','body','options','stringify','update','raw','where','attributes','limit','UpdateWhatsappQueueReport','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateWhatsappQueueReport'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xcf9d,0x1df));var _0xdcf9=function(_0x580e16,_0x557e74){_0x580e16=_0x580e16-0x0;var _0x40af00=_0xcf9d[_0x580e16];return _0x40af00;};'use strict';var _=require(_0xdcf9('0x0'));var util=require(_0xdcf9('0x1'));var moment=require(_0xdcf9('0x2'));var BPromise=require(_0xdcf9('0x3'));var rs=require(_0xdcf9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdcf9('0x5'));var logger=require(_0xdcf9('0x6'))(_0xdcf9('0x7'));var config=require(_0xdcf9('0x8'));var jayson=require(_0xdcf9('0x9'));var client=jayson[_0xdcf9('0xa')][_0xdcf9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2bad6f,_0x5a4d96,_0x450a77){return new BPromise(function(_0x2b8b93,_0xbed8f6){return client[_0xdcf9('0xc')](_0x2bad6f,_0x450a77)[_0xdcf9('0xd')](function(_0x37878e){logger[_0xdcf9('0xe')](_0xdcf9('0xf'),_0x5a4d96,_0xdcf9('0x10'));logger[_0xdcf9('0x11')](_0xdcf9('0x12'),_0x5a4d96,_0xdcf9('0x10'),JSON['stringify'](_0x37878e));if(_0x37878e[_0xdcf9('0x13')]){if(_0x37878e[_0xdcf9('0x13')][_0xdcf9('0x14')]===0x1f4){logger[_0xdcf9('0x13')](_0xdcf9('0xf'),_0x5a4d96,_0x37878e[_0xdcf9('0x13')][_0xdcf9('0x15')]);return _0xbed8f6(_0x37878e['error']['message']);}logger[_0xdcf9('0x13')](_0xdcf9('0xf'),_0x5a4d96,_0x37878e['error'][_0xdcf9('0x15')]);return _0x2b8b93(_0x37878e[_0xdcf9('0x13')][_0xdcf9('0x15')]);}else{logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x5a4d96,'request\x20sent');_0x2b8b93(_0x37878e[_0xdcf9('0x16')][_0xdcf9('0x15')]);}})[_0xdcf9('0x17')](function(_0x4026f7){logger[_0xdcf9('0x13')](_0xdcf9('0xf'),_0x5a4d96,_0x4026f7);_0xbed8f6(_0x4026f7);});});}exports[_0xdcf9('0x18')]=function(_0x11a6e3){var _0x56cceb=this;return new Promise(function(_0x2319da,_0x54e0ff){return db[_0xdcf9('0x19')][_0xdcf9('0x1a')](_0x11a6e3[_0xdcf9('0x1b')],{'raw':_0x11a6e3[_0xdcf9('0x1c')]?_0x11a6e3[_0xdcf9('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x49ed61){logger[_0xdcf9('0xe')](_0xdcf9('0x18'),_0x11a6e3);logger[_0xdcf9('0x11')]('CreateWhatsappQueueReport',_0x11a6e3,JSON[_0xdcf9('0x1d')](_0x49ed61));_0x2319da(_0x49ed61);})[_0xdcf9('0x17')](function(_0x4b2afb){logger[_0xdcf9('0x13')](_0xdcf9('0x18'),_0x4b2afb[_0xdcf9('0x15')],_0x11a6e3);_0x54e0ff(_0x56cceb[_0xdcf9('0x13')](0x1f4,_0x4b2afb['message']));});});};exports['UpdateWhatsappQueueReport']=function(_0x9e1ff8){var _0x386779=this;return new Promise(function(_0x490461,_0x10697f){return db[_0xdcf9('0x19')][_0xdcf9('0x1e')](_0x9e1ff8['body'],{'raw':_0x9e1ff8[_0xdcf9('0x1c')]?_0x9e1ff8[_0xdcf9('0x1c')][_0xdcf9('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9e1ff8['options']?_0x9e1ff8['options'][_0xdcf9('0x20')]||null:null,'attributes':_0x9e1ff8[_0xdcf9('0x1c')]?_0x9e1ff8[_0xdcf9('0x1c')][_0xdcf9('0x21')]||null:null,'limit':_0x9e1ff8[_0xdcf9('0x1c')]?_0x9e1ff8[_0xdcf9('0x1c')][_0xdcf9('0x22')]||null:null})[_0xdcf9('0xd')](function(_0x57a631){logger['info'](_0xdcf9('0x23'),_0x9e1ff8);logger[_0xdcf9('0x11')](_0xdcf9('0x23'),_0x9e1ff8,JSON[_0xdcf9('0x1d')](_0x57a631));_0x490461(_0x57a631);})['catch'](function(_0xb80736){logger[_0xdcf9('0x13')](_0xdcf9('0x23'),_0xb80736[_0xdcf9('0x15')],_0x9e1ff8);_0x10697f(_0x386779[_0xdcf9('0x13')](0x1f4,_0xb80736['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index e2ff9f9..de463fa 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 _0xad00=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x403fc7,_0x32931a){var _0x5d0827=function(_0x5ea698){while(--_0x5ea698){_0x403fc7['push'](_0x403fc7['shift']());}};_0x5d0827(++_0x32931a);}(_0xad00,0x1f1));var _0x0ad0=function(_0x26da89,_0x264785){_0x26da89=_0x26da89-0x0;var _0xc95b7b=_0xad00[_0x26da89];return _0xc95b7b;};'use strict';var multer=require(_0x0ad0('0x0'));var util=require(_0x0ad0('0x1'));var path=require(_0x0ad0('0x2'));var timeout=require(_0x0ad0('0x3'));var express=require(_0x0ad0('0x4'));var router=express[_0x0ad0('0x5')]();var fs_extra=require(_0x0ad0('0x6'));var auth=require(_0x0ad0('0x7'));var interaction=require(_0x0ad0('0x8'));var config=require(_0x0ad0('0x9'));var controller=require('./whatsappTransferReport.controller');router[_0x0ad0('0xa')]('/',auth[_0x0ad0('0xb')](),controller[_0x0ad0('0xc')]);router[_0x0ad0('0xa')](_0x0ad0('0xd'),auth[_0x0ad0('0xb')](),controller[_0x0ad0('0xe')]);router[_0x0ad0('0xa')](_0x0ad0('0xf'),auth[_0x0ad0('0xb')](),controller[_0x0ad0('0x10')]);router[_0x0ad0('0x11')]('/',auth[_0x0ad0('0xb')](),controller[_0x0ad0('0x12')]);router['put'](_0x0ad0('0xf'),auth[_0x0ad0('0xb')](),controller[_0x0ad0('0x13')]);router[_0x0ad0('0x14')]('/:id',auth[_0x0ad0('0xb')](),controller[_0x0ad0('0x15')]);module[_0x0ad0('0x16')]=router; \ No newline at end of file +var _0x9421=['show','post','create','put','/:id','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappTransferReport.controller','/describe','isAuthenticated','describe','get'];(function(_0x343090,_0x433a80){var _0x3ff3e8=function(_0x16c811){while(--_0x16c811){_0x343090['push'](_0x343090['shift']());}};_0x3ff3e8(++_0x433a80);}(_0x9421,0x7a));var _0x1942=function(_0x3e2300,_0x562761){_0x3e2300=_0x3e2300-0x0;var _0x164a5b=_0x9421[_0x3e2300];return _0x164a5b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1942('0x0'));var timeout=require(_0x1942('0x1'));var express=require(_0x1942('0x2'));var router=express[_0x1942('0x3')]();var fs_extra=require(_0x1942('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1942('0x5'));var controller=require(_0x1942('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x1942('0x7'),auth[_0x1942('0x8')](),controller[_0x1942('0x9')]);router[_0x1942('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x1942('0xb')]);router[_0x1942('0xc')]('/',auth[_0x1942('0x8')](),controller[_0x1942('0xd')]);router[_0x1942('0xe')](_0x1942('0xf'),auth[_0x1942('0x8')](),controller['update']);router[_0x1942('0x10')](_0x1942('0xf'),auth[_0x1942('0x8')](),controller[_0x1942('0x11')]);module[_0x1942('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 58531de..7d72d28 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 _0x0caf=['ENUM','account','agent'];(function(_0x590b00,_0x116248){var _0x21c77a=function(_0x5636d9){while(--_0x5636d9){_0x590b00['push'](_0x590b00['shift']());}};_0x21c77a(++_0x116248);}(_0x0caf,0x9f));var _0xf0ca=function(_0xd6f740,_0x3011f4){_0xd6f740=_0xd6f740-0x0;var _0x1d4ae7=_0x0caf[_0xd6f740];return _0x1d4ae7;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf0ca('0x0')](_0xf0ca('0x1'),_0xf0ca('0x2'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x88a6=['DATE','exports','STRING','account','agent','queue'];(function(_0x45a2b8,_0x26ebe3){var _0x3bdebd=function(_0x2d171b){while(--_0x2d171b){_0x45a2b8['push'](_0x45a2b8['shift']());}};_0x3bdebd(++_0x26ebe3);}(_0x88a6,0x121));var _0x688a=function(_0x3ea360,_0x4a3b9e){_0x3ea360=_0x3ea360-0x0;var _0x330457=_0x88a6[_0x3ea360];return _0x330457;};'use strict';var Sequelize=require('sequelize');module[_0x688a('0x0')]={'uniqueid':{'type':Sequelize[_0x688a('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x688a('0x2'),_0x688a('0x3'),_0x688a('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x688a('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 28c3605..c263b97 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 _0x5ab9=['fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','end','status','offset','limit','undefined','count','Content-Range','json','reject','update','destroy','then','name','index','map','WhatsappTransferReport','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','rawAttributes','options','find','create','body','params','describe','rimraf'];(function(_0x5b246e,_0x4fd37c){var _0x502592=function(_0x569af5){while(--_0x569af5){_0x5b246e['push'](_0x5b246e['shift']());}};_0x502592(++_0x4fd37c);}(_0x5ab9,0x117));var _0x95ab=function(_0x18e80c,_0x4077f7){_0x18e80c=_0x18e80c-0x0;var _0x183ba9=_0x5ab9[_0x18e80c];return _0x183ba9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x95ab('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x95ab('0x1'));var rp=require(_0x95ab('0x2'));var moment=require(_0x95ab('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x95ab('0x4'));var util=require(_0x95ab('0x5'));var path=require('path');var sox=require(_0x95ab('0x6'));var csv=require('to-csv');var ejs=require(_0x95ab('0x7'));var fs=require('fs');var fs_extra=require(_0x95ab('0x8'));var _=require('lodash');var squel=require(_0x95ab('0x9'));var crypto=require('crypto');var jsforce=require(_0x95ab('0xa'));var deskjs=require(_0x95ab('0xb'));var toCsv=require(_0x95ab('0xc'));var querystring=require(_0x95ab('0xd'));var Papa=require(_0x95ab('0xe'));var Redis=require(_0x95ab('0xf'));var authService=require(_0x95ab('0x10'));var qs=require(_0x95ab('0x11'));var as=require(_0x95ab('0x12'));var hardwareService=require(_0x95ab('0x13'));var logger=require(_0x95ab('0x14'))(_0x95ab('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x95ab('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1053d3,_0x35515a){_0x35515a=_0x35515a||0xcc;return function(_0x2e2e99){if(_0x2e2e99){return _0x1053d3['sendStatus'](_0x35515a);}return _0x1053d3['status'](_0x35515a)[_0x95ab('0x17')]();};}function respondWithResult(_0x3bbd05,_0x427889){_0x427889=_0x427889||0xc8;return function(_0x2b1d19){if(_0x2b1d19){return _0x3bbd05[_0x95ab('0x18')](_0x427889)['json'](_0x2b1d19);}};}function respondWithFilteredResult(_0x308cdf,_0x8743ad){return function(_0x27e1a3){if(_0x27e1a3){var _0x3fd3d2=typeof _0x8743ad[_0x95ab('0x19')]==='undefined'&&typeof _0x8743ad[_0x95ab('0x1a')]===_0x95ab('0x1b');var _0x4b7ffd=_0x27e1a3[_0x95ab('0x1c')];var _0x1889da=_0x3fd3d2?0x0:_0x8743ad[_0x95ab('0x19')];var _0x137646=_0x3fd3d2?_0x27e1a3[_0x95ab('0x1c')]:_0x8743ad[_0x95ab('0x19')]+_0x8743ad[_0x95ab('0x1a')];var _0x2ce167;if(_0x137646>=_0x4b7ffd){_0x137646=_0x4b7ffd;_0x2ce167=0xc8;}else{_0x2ce167=0xce;}_0x308cdf['status'](_0x2ce167);return _0x308cdf['set'](_0x95ab('0x1d'),_0x1889da+'-'+_0x137646+'/'+_0x4b7ffd)[_0x95ab('0x1e')](_0x27e1a3);}return null;};}function patchUpdates(_0x3446b4){return function(_0xb1885e){try{jsonpatch['apply'](_0xb1885e,_0x3446b4,!![]);}catch(_0x4e5b9b){return BPromise[_0x95ab('0x1f')](_0x4e5b9b);}return _0xb1885e['save']();};}function saveUpdates(_0x50e6ce,_0x3cd351){return function(_0x3eb073){if(_0x3eb073){return _0x3eb073[_0x95ab('0x20')](_0x50e6ce)['then'](function(_0x5ebcc8){return _0x5ebcc8;});}return null;};}function removeEntity(_0x2d71f8,_0x11e92d){return function(_0x37aaea){if(_0x37aaea){return _0x37aaea[_0x95ab('0x21')]()[_0x95ab('0x22')](function(){_0x2d71f8[_0x95ab('0x18')](0xcc)[_0x95ab('0x17')]();});}};}function handleEntityNotFound(_0x46309d,_0x31f4c1){return function(_0x5cb9be){if(!_0x5cb9be){_0x46309d['sendStatus'](0x194);}return _0x5cb9be;};}function handleError(_0xd28b4f,_0x2cdc52){_0x2cdc52=_0x2cdc52||0x1f4;return function(_0x58231c){logger['error'](_0x58231c['stack']);if(_0x58231c[_0x95ab('0x23')]){delete _0x58231c[_0x95ab('0x23')];}_0xd28b4f[_0x95ab('0x18')](_0x2cdc52)['send'](_0x58231c);};}exports[_0x95ab('0x24')]=function(_0x395516,_0x1fcd49){var _0x9e7f4d={},_0x1f5ee8={},_0xd0bc7={'count':0x0,'rows':[]};var _0x56b4e3=_[_0x95ab('0x25')](db[_0x95ab('0x26')]['rawAttributes'],function(_0x9965d3){return{'name':_0x9965d3[_0x95ab('0x27')],'type':_0x9965d3[_0x95ab('0x28')]['key']};});_0x1f5ee8[_0x95ab('0x29')]=_[_0x95ab('0x25')](_0x56b4e3,_0x95ab('0x23'));_0x1f5ee8[_0x95ab('0x2a')]=_[_0x95ab('0x2b')](_0x395516[_0x95ab('0x2a')]);_0x1f5ee8['filters']=_[_0x95ab('0x2c')](_0x1f5ee8[_0x95ab('0x29')],_0x1f5ee8[_0x95ab('0x2a')]);_0x9e7f4d[_0x95ab('0x2d')]=_[_0x95ab('0x2c')](_0x1f5ee8[_0x95ab('0x29')],qs[_0x95ab('0x2e')](_0x395516[_0x95ab('0x2a')][_0x95ab('0x2e')]));_0x9e7f4d[_0x95ab('0x2d')]=_0x9e7f4d[_0x95ab('0x2d')][_0x95ab('0x2f')]?_0x9e7f4d[_0x95ab('0x2d')]:_0x1f5ee8[_0x95ab('0x29')];if(!_0x395516[_0x95ab('0x2a')][_0x95ab('0x30')](_0x95ab('0x31'))){_0x9e7f4d[_0x95ab('0x1a')]=qs[_0x95ab('0x1a')](_0x395516['query'][_0x95ab('0x1a')]);_0x9e7f4d[_0x95ab('0x19')]=qs[_0x95ab('0x19')](_0x395516[_0x95ab('0x2a')][_0x95ab('0x19')]);}_0x9e7f4d[_0x95ab('0x32')]=qs[_0x95ab('0x33')](_0x395516[_0x95ab('0x2a')][_0x95ab('0x33')]);_0x9e7f4d[_0x95ab('0x34')]=qs[_0x95ab('0x35')](_[_0x95ab('0x36')](_0x395516[_0x95ab('0x2a')],_0x1f5ee8[_0x95ab('0x35')]),_0x56b4e3);if(_0x395516[_0x95ab('0x2a')][_0x95ab('0x37')]){_0x9e7f4d['where']=_['merge'](_0x9e7f4d['where'],{'$or':_[_0x95ab('0x25')](_0x56b4e3,function(_0x18eda3){if(_0x18eda3[_0x95ab('0x28')]!==_0x95ab('0x38')){var _0x285696={};_0x285696[_0x18eda3['name']]={'$like':'%'+_0x395516[_0x95ab('0x2a')][_0x95ab('0x37')]+'%'};return _0x285696;}})});}_0x9e7f4d=_[_0x95ab('0x39')]({},_0x9e7f4d,_0x395516['options']);var _0xba40f9={'where':_0x9e7f4d['where']};return db[_0x95ab('0x26')][_0x95ab('0x1c')](_0xba40f9)[_0x95ab('0x22')](function(_0x13612b){_0xd0bc7[_0x95ab('0x1c')]=_0x13612b;if(_0x395516[_0x95ab('0x2a')][_0x95ab('0x3a')]){_0x9e7f4d[_0x95ab('0x3b')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x95ab('0x3c')](_0x9e7f4d);})[_0x95ab('0x22')](function(_0x18af01){_0xd0bc7[_0x95ab('0x3d')]=_0x18af01;return _0xd0bc7;})[_0x95ab('0x22')](respondWithFilteredResult(_0x1fcd49,_0x9e7f4d))[_0x95ab('0x3e')](handleError(_0x1fcd49,null));};exports['show']=function(_0x26c872,_0x3198e1){var _0x996f5={'raw':!![],'where':{'id':_0x26c872['params']['id']}},_0x2b9d8e={};_0x2b9d8e[_0x95ab('0x29')]=_[_0x95ab('0x2b')](db[_0x95ab('0x26')][_0x95ab('0x3f')]);_0x2b9d8e[_0x95ab('0x2a')]=_['keys'](_0x26c872['query']);_0x2b9d8e[_0x95ab('0x35')]=_['intersection'](_0x2b9d8e['model'],_0x2b9d8e[_0x95ab('0x2a')]);_0x996f5[_0x95ab('0x2d')]=_[_0x95ab('0x2c')](_0x2b9d8e[_0x95ab('0x29')],qs['fields'](_0x26c872[_0x95ab('0x2a')][_0x95ab('0x2e')]));_0x996f5[_0x95ab('0x2d')]=_0x996f5[_0x95ab('0x2d')]['length']?_0x996f5[_0x95ab('0x2d')]:_0x2b9d8e['model'];if(_0x26c872[_0x95ab('0x2a')][_0x95ab('0x3a')]){_0x996f5['include']=[{'all':!![]}];}_0x996f5=_[_0x95ab('0x39')]({},_0x996f5,_0x26c872[_0x95ab('0x40')]);return db[_0x95ab('0x26')][_0x95ab('0x41')](_0x996f5)[_0x95ab('0x22')](handleEntityNotFound(_0x3198e1,null))[_0x95ab('0x22')](respondWithResult(_0x3198e1,null))[_0x95ab('0x3e')](handleError(_0x3198e1,null));};exports[_0x95ab('0x42')]=function(_0x2238ee,_0x254d16){return db[_0x95ab('0x26')][_0x95ab('0x42')](_0x2238ee[_0x95ab('0x43')],{})[_0x95ab('0x22')](respondWithResult(_0x254d16,0xc9))['catch'](handleError(_0x254d16,null));};exports[_0x95ab('0x20')]=function(_0x5296a3,_0x38e3f5){if(_0x5296a3[_0x95ab('0x43')]['id']){delete _0x5296a3[_0x95ab('0x43')]['id'];}return db[_0x95ab('0x26')][_0x95ab('0x41')]({'where':{'id':_0x5296a3[_0x95ab('0x44')]['id']}})[_0x95ab('0x22')](handleEntityNotFound(_0x38e3f5,null))[_0x95ab('0x22')](saveUpdates(_0x5296a3['body'],null))['then'](respondWithResult(_0x38e3f5,null))['catch'](handleError(_0x38e3f5,null));};exports[_0x95ab('0x21')]=function(_0x21b0c6,_0x1c0aa8){return db[_0x95ab('0x26')]['find']({'where':{'id':_0x21b0c6[_0x95ab('0x44')]['id']}})[_0x95ab('0x22')](handleEntityNotFound(_0x1c0aa8,null))['then'](removeEntity(_0x1c0aa8,null))['catch'](handleError(_0x1c0aa8,null));};exports[_0x95ab('0x45')]=function(_0x111fe6,_0x50dd24){return db[_0x95ab('0x26')]['describe']()[_0x95ab('0x22')](respondWithResult(_0x50dd24,null))['catch'](handleError(_0x50dd24,null));}; \ No newline at end of file +var _0x8ced=['path','ejs','fs-extra','lodash','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','offset','set','Content-Range','json','apply','update','then','destroy','stack','name','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','count','include','rows','catch','show','params','keys','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x8ced,0xc7));var _0xd8ce=function(_0x3480e9,_0x1ce980){_0x3480e9=_0x3480e9-0x0;var _0x389aad=_0x8ced[_0x3480e9];return _0x389aad;};'use strict';var emlformat=require(_0xd8ce('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd8ce('0x1'));var jsonpatch=require(_0xd8ce('0x2'));var rp=require(_0xd8ce('0x3'));var moment=require(_0xd8ce('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd8ce('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd8ce('0x6'));var fs=require('fs');var fs_extra=require(_0xd8ce('0x7'));var _=require(_0xd8ce('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd8ce('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xd8ce('0xa'));var querystring=require(_0xd8ce('0xb'));var Papa=require('papaparse');var Redis=require(_0xd8ce('0xc'));var authService=require(_0xd8ce('0xd'));var qs=require(_0xd8ce('0xe'));var as=require(_0xd8ce('0xf'));var hardwareService=require(_0xd8ce('0x10'));var logger=require(_0xd8ce('0x11'))('api');var utils=require(_0xd8ce('0x12'));var config=require(_0xd8ce('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xd8ce('0x14'))['db'];function respondWithStatusCode(_0x42d4c9,_0x328ca5){_0x328ca5=_0x328ca5||0xcc;return function(_0x1dfa2f){if(_0x1dfa2f){return _0x42d4c9[_0xd8ce('0x15')](_0x328ca5);}return _0x42d4c9[_0xd8ce('0x16')](_0x328ca5)[_0xd8ce('0x17')]();};}function respondWithResult(_0x2d520e,_0x19a30c){_0x19a30c=_0x19a30c||0xc8;return function(_0x5698ed){if(_0x5698ed){return _0x2d520e[_0xd8ce('0x16')](_0x19a30c)['json'](_0x5698ed);}};}function respondWithFilteredResult(_0x40b83e,_0x23072d){return function(_0x364d9c){if(_0x364d9c){var _0x3fd350=typeof _0x23072d['offset']===_0xd8ce('0x18')&&typeof _0x23072d[_0xd8ce('0x19')]==='undefined';var _0x209b92=_0x364d9c['count'];var _0x35061b=_0x3fd350?0x0:_0x23072d[_0xd8ce('0x1a')];var _0xffca0e=_0x3fd350?_0x364d9c['count']:_0x23072d[_0xd8ce('0x1a')]+_0x23072d[_0xd8ce('0x19')];var _0x4fa86d;if(_0xffca0e>=_0x209b92){_0xffca0e=_0x209b92;_0x4fa86d=0xc8;}else{_0x4fa86d=0xce;}_0x40b83e['status'](_0x4fa86d);return _0x40b83e[_0xd8ce('0x1b')](_0xd8ce('0x1c'),_0x35061b+'-'+_0xffca0e+'/'+_0x209b92)[_0xd8ce('0x1d')](_0x364d9c);}return null;};}function patchUpdates(_0x5e0a5e){return function(_0x10e77e){try{jsonpatch[_0xd8ce('0x1e')](_0x10e77e,_0x5e0a5e,!![]);}catch(_0x858c8a){return BPromise['reject'](_0x858c8a);}return _0x10e77e['save']();};}function saveUpdates(_0x156575,_0x34d610){return function(_0x405503){if(_0x405503){return _0x405503[_0xd8ce('0x1f')](_0x156575)[_0xd8ce('0x20')](function(_0x3ff13f){return _0x3ff13f;});}return null;};}function removeEntity(_0x42621f,_0x35dcd2){return function(_0x3a4366){if(_0x3a4366){return _0x3a4366[_0xd8ce('0x21')]()[_0xd8ce('0x20')](function(){_0x42621f['status'](0xcc)[_0xd8ce('0x17')]();});}};}function handleEntityNotFound(_0x47ac73,_0x2454a4){return function(_0x44445e){if(!_0x44445e){_0x47ac73['sendStatus'](0x194);}return _0x44445e;};}function handleError(_0x30999a,_0x4e9965){_0x4e9965=_0x4e9965||0x1f4;return function(_0x240a07){logger['error'](_0x240a07[_0xd8ce('0x22')]);if(_0x240a07[_0xd8ce('0x23')]){delete _0x240a07[_0xd8ce('0x23')];}_0x30999a['status'](_0x4e9965)['send'](_0x240a07);};}exports[_0xd8ce('0x24')]=function(_0xb9acbc,_0x1f6a7d){var _0x4020c6={},_0x133160={},_0x1476cf={'count':0x0,'rows':[]};var _0x24e1a8=_[_0xd8ce('0x25')](db[_0xd8ce('0x26')][_0xd8ce('0x27')],function(_0x275f5e){return{'name':_0x275f5e[_0xd8ce('0x28')],'type':_0x275f5e[_0xd8ce('0x29')]['key']};});_0x133160[_0xd8ce('0x2a')]=_[_0xd8ce('0x25')](_0x24e1a8,'name');_0x133160[_0xd8ce('0x2b')]=_['keys'](_0xb9acbc[_0xd8ce('0x2b')]);_0x133160[_0xd8ce('0x2c')]=_[_0xd8ce('0x2d')](_0x133160[_0xd8ce('0x2a')],_0x133160[_0xd8ce('0x2b')]);_0x4020c6[_0xd8ce('0x2e')]=_[_0xd8ce('0x2d')](_0x133160[_0xd8ce('0x2a')],qs[_0xd8ce('0x2f')](_0xb9acbc[_0xd8ce('0x2b')][_0xd8ce('0x2f')]));_0x4020c6[_0xd8ce('0x2e')]=_0x4020c6[_0xd8ce('0x2e')][_0xd8ce('0x30')]?_0x4020c6['attributes']:_0x133160['model'];if(!_0xb9acbc[_0xd8ce('0x2b')][_0xd8ce('0x31')](_0xd8ce('0x32'))){_0x4020c6['limit']=qs[_0xd8ce('0x19')](_0xb9acbc['query'][_0xd8ce('0x19')]);_0x4020c6[_0xd8ce('0x1a')]=qs['offset'](_0xb9acbc[_0xd8ce('0x2b')]['offset']);}_0x4020c6[_0xd8ce('0x33')]=qs[_0xd8ce('0x34')](_0xb9acbc[_0xd8ce('0x2b')][_0xd8ce('0x34')]);_0x4020c6[_0xd8ce('0x35')]=qs['filters'](_['pick'](_0xb9acbc[_0xd8ce('0x2b')],_0x133160[_0xd8ce('0x2c')]),_0x24e1a8);if(_0xb9acbc[_0xd8ce('0x2b')][_0xd8ce('0x36')]){_0x4020c6[_0xd8ce('0x35')]=_['merge'](_0x4020c6['where'],{'$or':_['map'](_0x24e1a8,function(_0x287332){if(_0x287332[_0xd8ce('0x29')]!=='VIRTUAL'){var _0x1e4543={};_0x1e4543[_0x287332[_0xd8ce('0x23')]]={'$like':'%'+_0xb9acbc[_0xd8ce('0x2b')][_0xd8ce('0x36')]+'%'};return _0x1e4543;}})});}_0x4020c6=_[_0xd8ce('0x37')]({},_0x4020c6,_0xb9acbc[_0xd8ce('0x38')]);var _0x309b03={'where':_0x4020c6[_0xd8ce('0x35')]};return db['WhatsappTransferReport'][_0xd8ce('0x39')](_0x309b03)[_0xd8ce('0x20')](function(_0x3414ee){_0x1476cf[_0xd8ce('0x39')]=_0x3414ee;if(_0xb9acbc[_0xd8ce('0x2b')]['includeAll']){_0x4020c6[_0xd8ce('0x3a')]=[{'all':!![]}];}return db[_0xd8ce('0x26')]['findAll'](_0x4020c6);})[_0xd8ce('0x20')](function(_0x3e6069){_0x1476cf[_0xd8ce('0x3b')]=_0x3e6069;return _0x1476cf;})[_0xd8ce('0x20')](respondWithFilteredResult(_0x1f6a7d,_0x4020c6))[_0xd8ce('0x3c')](handleError(_0x1f6a7d,null));};exports[_0xd8ce('0x3d')]=function(_0x4d448f,_0x21045c){var _0x279eec={'raw':!![],'where':{'id':_0x4d448f[_0xd8ce('0x3e')]['id']}},_0xed4423={};_0xed4423[_0xd8ce('0x2a')]=_[_0xd8ce('0x3f')](db[_0xd8ce('0x26')][_0xd8ce('0x27')]);_0xed4423['query']=_[_0xd8ce('0x3f')](_0x4d448f[_0xd8ce('0x2b')]);_0xed4423['filters']=_['intersection'](_0xed4423[_0xd8ce('0x2a')],_0xed4423[_0xd8ce('0x2b')]);_0x279eec['attributes']=_[_0xd8ce('0x2d')](_0xed4423[_0xd8ce('0x2a')],qs['fields'](_0x4d448f[_0xd8ce('0x2b')][_0xd8ce('0x2f')]));_0x279eec[_0xd8ce('0x2e')]=_0x279eec[_0xd8ce('0x2e')]['length']?_0x279eec[_0xd8ce('0x2e')]:_0xed4423[_0xd8ce('0x2a')];if(_0x4d448f['query']['includeAll']){_0x279eec[_0xd8ce('0x3a')]=[{'all':!![]}];}_0x279eec=_[_0xd8ce('0x37')]({},_0x279eec,_0x4d448f[_0xd8ce('0x38')]);return db[_0xd8ce('0x26')][_0xd8ce('0x40')](_0x279eec)[_0xd8ce('0x20')](handleEntityNotFound(_0x21045c,null))[_0xd8ce('0x20')](respondWithResult(_0x21045c,null))[_0xd8ce('0x3c')](handleError(_0x21045c,null));};exports[_0xd8ce('0x41')]=function(_0x2d8b62,_0x3e5edc){return db[_0xd8ce('0x26')][_0xd8ce('0x41')](_0x2d8b62['body'],{})[_0xd8ce('0x20')](respondWithResult(_0x3e5edc,0xc9))[_0xd8ce('0x3c')](handleError(_0x3e5edc,null));};exports[_0xd8ce('0x1f')]=function(_0x3edd53,_0x198722){if(_0x3edd53['body']['id']){delete _0x3edd53[_0xd8ce('0x42')]['id'];}return db[_0xd8ce('0x26')][_0xd8ce('0x40')]({'where':{'id':_0x3edd53['params']['id']}})[_0xd8ce('0x20')](handleEntityNotFound(_0x198722,null))[_0xd8ce('0x20')](saveUpdates(_0x3edd53[_0xd8ce('0x42')],null))['then'](respondWithResult(_0x198722,null))[_0xd8ce('0x3c')](handleError(_0x198722,null));};exports[_0xd8ce('0x21')]=function(_0x571597,_0x484675){return db[_0xd8ce('0x26')]['find']({'where':{'id':_0x571597[_0xd8ce('0x3e')]['id']}})[_0xd8ce('0x20')](handleEntityNotFound(_0x484675,null))[_0xd8ce('0x20')](removeEntity(_0x484675,null))[_0xd8ce('0x3c')](handleError(_0x484675,null));};exports[_0xd8ce('0x43')]=function(_0x54c65f,_0x4482c6){return db[_0xd8ce('0x26')][_0xd8ce('0x43')]()['then'](respondWithResult(_0x4482c6,null))[_0xd8ce('0x3c')](handleError(_0x4482c6,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index f3b5e75..d83441b 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 _0xf160=['define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x19d210,_0x121510){var _0x35e3af=function(_0x535f37){while(--_0x535f37){_0x19d210['push'](_0x19d210['shift']());}};_0x35e3af(++_0x121510);}(_0xf160,0x1bc));var _0x0f16=function(_0x311997,_0x4c2cc7){_0x311997=_0x311997-0x0;var _0x3be163=_0xf160[_0x311997];return _0x3be163;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0f16('0x0'))(_0x0f16('0x1'));var moment=require(_0x0f16('0x2'));var BPromise=require(_0x0f16('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f16('0x4'));var rimraf=require(_0x0f16('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappTransferReport.attributes');module['exports']=function(_0x1aedeb,_0x22ee1a){return _0x1aedeb[_0x0f16('0x6')](_0x0f16('0x7'),attributes,{'tableName':_0x0f16('0x8'),'paranoid':![],'indexes':[{'name':_0x0f16('0x9'),'fields':[_0x0f16('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x11cc=['path','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise'];(function(_0x1c512d,_0x38c07c){var _0x4cf33e=function(_0x5166c0){while(--_0x5166c0){_0x1c512d['push'](_0x1c512d['shift']());}};_0x4cf33e(++_0x38c07c);}(_0x11cc,0x78));var _0xc11c=function(_0x42afde,_0x377195){_0x42afde=_0x42afde-0x0;var _0x5e9990=_0x11cc[_0x42afde];return _0x5e9990;};'use strict';var _=require(_0xc11c('0x0'));var util=require(_0xc11c('0x1'));var logger=require('../../config/logger')(_0xc11c('0x2'));var moment=require(_0xc11c('0x3'));var BPromise=require(_0xc11c('0x4'));var rp=require(_0xc11c('0x5'));var fs=require('fs');var path=require(_0xc11c('0x6'));var rimraf=require('rimraf');var config=require(_0xc11c('0x7'));var attributes=require(_0xc11c('0x8'));module[_0xc11c('0x9')]=function(_0x34eb98,_0x4c435c){return _0x34eb98[_0xc11c('0xa')](_0xc11c('0xb'),attributes,{'tableName':_0xc11c('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc11c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 24b245b..3de7b4e 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 _0x34bd=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x184869,_0x4641fe){var _0x56414f=function(_0x6ea11f){while(--_0x6ea11f){_0x184869['push'](_0x184869['shift']());}};_0x56414f(++_0x4641fe);}(_0x34bd,0x8f));var _0xd34b=function(_0x56aa66,_0x1ddf52){_0x56aa66=_0x56aa66-0x0;var _0xeba9ff=_0x34bd[_0x56aa66];return _0xeba9ff;};'use strict';var _=require(_0xd34b('0x0'));var util=require(_0xd34b('0x1'));var moment=require(_0xd34b('0x2'));var BPromise=require('bluebird');var rs=require(_0xd34b('0x3'));var fs=require('fs');var Redis=require(_0xd34b('0x4'));var db=require(_0xd34b('0x5'))['db'];var utils=require(_0xd34b('0x6'));var logger=require(_0xd34b('0x7'))(_0xd34b('0x8'));var config=require(_0xd34b('0x9'));var jayson=require(_0xd34b('0xa'));var client=jayson[_0xd34b('0xb')][_0xd34b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21bf2f,_0x4ff019,_0x51d6e0){return new BPromise(function(_0x35cd39,_0x16c20b){return client[_0xd34b('0xd')](_0x21bf2f,_0x51d6e0)[_0xd34b('0xe')](function(_0xce0486){logger[_0xd34b('0xf')](_0xd34b('0x10'),_0x4ff019,_0xd34b('0x11'));logger[_0xd34b('0x12')](_0xd34b('0x13'),_0x4ff019,_0xd34b('0x11'),JSON[_0xd34b('0x14')](_0xce0486));if(_0xce0486[_0xd34b('0x15')]){if(_0xce0486[_0xd34b('0x15')][_0xd34b('0x16')]===0x1f4){logger[_0xd34b('0x15')](_0xd34b('0x10'),_0x4ff019,_0xce0486[_0xd34b('0x15')][_0xd34b('0x17')]);return _0x16c20b(_0xce0486[_0xd34b('0x15')]['message']);}logger[_0xd34b('0x15')](_0xd34b('0x10'),_0x4ff019,_0xce0486[_0xd34b('0x15')][_0xd34b('0x17')]);return _0x35cd39(_0xce0486[_0xd34b('0x15')]['message']);}else{logger[_0xd34b('0xf')](_0xd34b('0x10'),_0x4ff019,_0xd34b('0x11'));_0x35cd39(_0xce0486[_0xd34b('0x18')][_0xd34b('0x17')]);}})['catch'](function(_0x11c10c){logger['error'](_0xd34b('0x10'),_0x4ff019,_0x11c10c);_0x16c20b(_0x11c10c);});});} \ No newline at end of file +var _0x126d=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappTransferReport,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x126d,0xc7));var _0xd126=function(_0x353800,_0x10aeec){_0x353800=_0x353800-0x0;var _0x390a5b=_0x126d[_0x353800];return _0x390a5b;};'use strict';var _=require(_0xd126('0x0'));var util=require(_0xd126('0x1'));var moment=require(_0xd126('0x2'));var BPromise=require(_0xd126('0x3'));var rs=require(_0xd126('0x4'));var fs=require('fs');var Redis=require(_0xd126('0x5'));var db=require(_0xd126('0x6'))['db'];var utils=require(_0xd126('0x7'));var logger=require('../../config/logger')(_0xd126('0x8'));var config=require(_0xd126('0x9'));var jayson=require(_0xd126('0xa'));var client=jayson[_0xd126('0xb')][_0xd126('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x23f6c3,_0x36834c,_0x390427){return new BPromise(function(_0x3d8f98,_0x5e30a7){return client['request'](_0x23f6c3,_0x390427)[_0xd126('0xd')](function(_0x27507c){logger[_0xd126('0xe')]('WhatsappTransferReport,\x20%s,\x20%s',_0x36834c,'request\x20sent');logger[_0xd126('0xf')](_0xd126('0x10'),_0x36834c,'request\x20sent',JSON[_0xd126('0x11')](_0x27507c));if(_0x27507c[_0xd126('0x12')]){if(_0x27507c[_0xd126('0x12')][_0xd126('0x13')]===0x1f4){logger[_0xd126('0x12')](_0xd126('0x14'),_0x36834c,_0x27507c[_0xd126('0x12')][_0xd126('0x15')]);return _0x5e30a7(_0x27507c['error'][_0xd126('0x15')]);}logger['error'](_0xd126('0x14'),_0x36834c,_0x27507c[_0xd126('0x12')][_0xd126('0x15')]);return _0x3d8f98(_0x27507c['error']['message']);}else{logger[_0xd126('0xe')](_0xd126('0x14'),_0x36834c,_0xd126('0x16'));_0x3d8f98(_0x27507c[_0xd126('0x17')][_0xd126('0x15')]);}})[_0xd126('0x18')](function(_0x2e0606){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x36834c,_0x2e0606);_0x5e30a7(_0x2e0606);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 156c653..0781b38 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x24ca=['./config/schedule/cloud-provider','sequelize','sync','seedDB','default','then','listen','info','start','filter','number','exitCode','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','Online\x20apps:','name','join','status','online','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./config/seedDB','./config/license','./rpc','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe'];(function(_0xd074a2,_0x3c1867){var _0x1bea99=function(_0x5f41c2){while(--_0x5f41c2){_0xd074a2['push'](_0xd074a2['shift']());}};_0x1bea99(++_0x3c1867);}(_0x24ca,0x1bc));var _0xa24c=function(_0x199c03,_0x3254aa){_0x199c03=_0x199c03-0x0;var _0x11a7d4=_0x24ca[_0x199c03];return _0x11a7d4;};'use strict';var _=require(_0xa24c('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0xa24c('0x1'));var checkLicense=require(_0xa24c('0x2'));var rpc=require(_0xa24c('0x3'));var config=require('./config/environment');var logger=require(_0xa24c('0x4'))(_0xa24c('0x5'));var pm2=require(_0xa24c('0x6'));var pm2Config=require(_0xa24c('0x7'));var schedule=require(_0xa24c('0x8'));var chat=require(_0xa24c('0x9'));var whatsapp=require(_0xa24c('0xa'));var transcribe=require(_0xa24c('0xb'));var provider=require(_0xa24c('0xc'));function main(){return db[_0xa24c('0xd')][_0xa24c('0xe')]()['then'](function(){if(config[_0xa24c('0xf')]){return seedDb[_0xa24c('0x10')]();}})[_0xa24c('0x11')](function(){return checkLicense['default']();})[_0xa24c('0x11')](function(){return rpc[_0xa24c('0x12')]();})[_0xa24c('0x11')](function(_0x211003){logger[_0xa24c('0x13')](_0x211003);return chat[_0xa24c('0x14')]();})[_0xa24c('0x11')](function(){return whatsapp[_0xa24c('0x14')]();})[_0xa24c('0x11')](function(){return schedule['start']();})[_0xa24c('0x11')](function(){return transcribe[_0xa24c('0x14')]();})[_0xa24c('0x11')](function(){return provider[_0xa24c('0x14')]();})['then'](function(_0x3ad0bf){logger[_0xa24c('0x13')](_0x3ad0bf);return pm2[_0xa24c('0x14')](pm2Config);})[_0xa24c('0x11')](function(_0x1cb08e){var _0x2d185c=_0x1cb08e[_0xa24c('0x15')](function(_0x5d4727){return typeof _0x5d4727['exitCode']===_0xa24c('0x16')&&_0x5d4727[_0xa24c('0x17')]>=0x0;});if(_0x2d185c['length']>0x0){throw new Error(_0x2d185c['length']+_0xa24c('0x18')+_[_0xa24c('0x19')](_0x2d185c,function(_0x5c479e){return'\x22'+_0x5c479e[_0xa24c('0x1a')]['name']+'\x22';}));}logger[_0xa24c('0x13')](_0xa24c('0x1b'),_[_0xa24c('0x19')](_[_0xa24c('0x15')](_0x1cb08e,{'status':'online'}),_0xa24c('0x1c'))[_0xa24c('0x1d')]());logger[_0xa24c('0x13')]('Offline\x20apps:',_['map'](_['filter'](_0x1cb08e,function(_0x4cd77e){return _0x4cd77e[_0xa24c('0x1e')]!==_0xa24c('0x1f');}),_0xa24c('0x1c'))[_0xa24c('0x1d')]()||'None');console[_0xa24c('0x20')]('App\x20Ready!');})[_0xa24c('0x21')](function(_0xb81d97){console['log'](_0xa24c('0x22'),_0xb81d97);logger[_0xa24c('0x23')](_0xa24c('0x24'),_0xb81d97);process[_0xa24c('0x25')](0x1);});}main(); \ No newline at end of file +var _0x6347=['error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./config/license','./rpc','./config/environment','./config/logger','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','info','start','filter','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','Online\x20apps:','online','join','Offline\x20apps:','status','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!'];(function(_0x3d6f5e,_0x298b35){var _0x47651c=function(_0xacae01){while(--_0xacae01){_0x3d6f5e['push'](_0x3d6f5e['shift']());}};_0x47651c(++_0x298b35);}(_0x6347,0x1c9));var _0x7634=function(_0xfc21ee,_0x236af1){_0xfc21ee=_0xfc21ee-0x0;var _0x38b17a=_0x6347[_0xfc21ee];return _0x38b17a;};'use strict';var _=require(_0x7634('0x0'));var db=require(_0x7634('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x7634('0x2'));var rpc=require(_0x7634('0x3'));var config=require(_0x7634('0x4'));var logger=require(_0x7634('0x5'))('app');var pm2=require(_0x7634('0x6'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x7634('0x7'));var chat=require(_0x7634('0x8'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require('./config/schedule/transcribe');var provider=require(_0x7634('0x9'));function main(){return db[_0x7634('0xa')][_0x7634('0xb')]()[_0x7634('0xc')](function(){if(config[_0x7634('0xd')]){return seedDb[_0x7634('0xe')]();}})['then'](function(){return checkLicense[_0x7634('0xe')]();})['then'](function(){return rpc['listen']();})['then'](function(_0x2b1bef){logger[_0x7634('0xf')](_0x2b1bef);return chat[_0x7634('0x10')]();})[_0x7634('0xc')](function(){return whatsapp[_0x7634('0x10')]();})['then'](function(){return schedule['start']();})[_0x7634('0xc')](function(){return transcribe[_0x7634('0x10')]();})[_0x7634('0xc')](function(){return provider[_0x7634('0x10')]();})[_0x7634('0xc')](function(_0x9b7445){logger[_0x7634('0xf')](_0x9b7445);return pm2[_0x7634('0x10')](pm2Config);})['then'](function(_0x3b0fd4){var _0x439d57=_0x3b0fd4[_0x7634('0x11')](function(_0x20dc07){return typeof _0x20dc07['exitCode']===_0x7634('0x12')&&_0x20dc07['exitCode']>=0x0;});if(_0x439d57[_0x7634('0x13')]>0x0){throw new Error(_0x439d57[_0x7634('0x13')]+_0x7634('0x14')+_[_0x7634('0x15')](_0x439d57,function(_0x5cfed7){return'\x22'+_0x5cfed7[_0x7634('0x16')]['name']+'\x22';}));}logger[_0x7634('0xf')](_0x7634('0x17'),_['map'](_[_0x7634('0x11')](_0x3b0fd4,{'status':_0x7634('0x18')}),'name')[_0x7634('0x19')]());logger['info'](_0x7634('0x1a'),_['map'](_[_0x7634('0x11')](_0x3b0fd4,function(_0xbe6288){return _0xbe6288[_0x7634('0x1b')]!==_0x7634('0x18');}),'name')[_0x7634('0x19')]()||_0x7634('0x1c'));console[_0x7634('0x1d')](_0x7634('0x1e'));})[_0x7634('0x1f')](function(_0x49cd89){console[_0x7634('0x1d')](_0x7634('0x20'),_0x49cd89);logger[_0x7634('0x21')](_0x7634('0x22'),_0x49cd89);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 12373a3..9b74031 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 _0x4b84=['User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','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','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.','Sequelize','ValidationError','updatePasswordsHistory','length','splice','unshift','encryptString','join','promisify','secret','secrets','payload','randomBytes','hex','now','toString','HS512','../../mysqldb','../../config/environment','../encryptor','express-jwt','composable-middleware','basic-auth','moment','session','fullname','email','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','allowmessenger','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','userProfileId','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','chatAutoanswer','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','params','disposition','then','closed','status','unmanaged','Forbidden.','catch','use','headers','authorization','Basic','User','find','name','authenticate','pass','json','startsWith','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','blocked','blockedAt','add','minutes','Invalid\x20API\x20access\x20key'];(function(_0xfa7bee,_0x10fb04){var _0x175464=function(_0x1c7f5c){while(--_0x1c7f5c){_0xfa7bee['push'](_0xfa7bee['shift']());}};_0x175464(++_0x10fb04);}(_0x4b84,0x1cc));var _0x44b8=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x4b84[_0x1b349a];return _0x5d1f7c;};'use strict';var db=require(_0x44b8('0x0'))['db'];var config=require(_0x44b8('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require(_0x44b8('0x2'));var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require(_0x44b8('0x3'));var compose=require(_0x44b8('0x4'));var basicAuth=require(_0x44b8('0x5'));var crypto=require('crypto');var BPromise=require('bluebird');var util=require('util');var moment=require(_0x44b8('0x6'));var validateJwt=expressJwt({'secret':config['secrets'][_0x44b8('0x7')]});var userAttributes=['id','role',_0x44b8('0x8'),'name','internal',_0x44b8('0x9'),_0x44b8('0xa'),_0x44b8('0xb'),'md5secret',_0x44b8('0xc'),_0x44b8('0xd'),_0x44b8('0xe'),_0x44b8('0xf'),_0x44b8('0x10'),_0x44b8('0x11'),_0x44b8('0x12'),'showWebBar',_0x44b8('0x13'),_0x44b8('0x14'),'crudPermissions',_0x44b8('0x15'),'passwordResetAt',_0x44b8('0x16'),_0x44b8('0x17'),'phoneBarAutoAnswerDelay',_0x44b8('0x18'),'phoneBarEnableRecording','phoneBarEnableDtmfTone',_0x44b8('0x19'),_0x44b8('0x1a'),_0x44b8('0x1b'),_0x44b8('0x1c'),'phoneBarRemoteControlPort','hotdesk','interface',_0x44b8('0x1d'),'privacyEnabled',_0x44b8('0x1e'),_0x44b8('0x1f'),'downloadVoiceRecordings',_0x44b8('0x20'),_0x44b8('0x21'),'ignorePauseForPreviewCalls',_0x44b8('0x22'),_0x44b8('0x23'),'chatAutoanswerDelay',_0x44b8('0x24'),_0x44b8('0x25'),_0x44b8('0x26'),_0x44b8('0x27'),_0x44b8('0x28'),_0x44b8('0x29'),_0x44b8('0x2a'),_0x44b8('0x2b'),_0x44b8('0x2c'),_0x44b8('0x2d')];exports[_0x44b8('0x2e')]=function(){return this[_0x44b8('0x2f')](!![])['use'](function(_0x56549a,_0x3a8aa4,_0x416b34){if(_0x56549a[_0x44b8('0x30')]){_0x416b34();}else{return db[_0x44b8('0x31')]['findOne']({'where':{'id':_0x56549a[_0x44b8('0x32')]['id']},'attributes':['id','closed',_0x44b8('0x33')],'raw':!![]})[_0x44b8('0x34')](function(_0x25a0c1){if(_0x25a0c1&&_0x25a0c1[_0x44b8('0x35')]){return _0x3a8aa4[_0x44b8('0x36')](_0x25a0c1['disposition']===_0x44b8('0x37')?0x195:0x193)['json']({'message':_0x25a0c1[_0x44b8('0x33')]===_0x44b8('0x37')?'Unmanaged.':_0x44b8('0x38')});}else{_0x416b34();}})[_0x44b8('0x39')](function(_0x2656d7){_0x416b34(_0x2656d7);});}});};exports['isAuthenticated']=function isAuthenticated(_0xb22107){return compose()[_0x44b8('0x3a')](function(_0x53d9c7,_0x2e0174,_0x4a182d){var _0xfb0028;if(_0x53d9c7['headers']['authorization']){if(_['startsWith'](_0x53d9c7[_0x44b8('0x3b')][_0x44b8('0x3c')],_0x44b8('0x3d'))){var _0x1bd1be=basicAuth(_0x53d9c7);db[_0x44b8('0x3e')][_0x44b8('0x3f')]({'where':{'name':_0x1bd1be[_0x44b8('0x40')]}})[_0x44b8('0x34')](function(_0xd1d320){if(!_0xd1d320||!_0xd1d320[_0x44b8('0x41')](_0x1bd1be[_0x44b8('0x42')])){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':'Wrong\x20credentials.'});}_0x53d9c7[_0x44b8('0x30')]={'id':_0xd1d320['id']};_0x4a182d();})['catch'](function(_0x212983){_0x4a182d(_0x212983);});}else if(_[_0x44b8('0x44')](_0x53d9c7[_0x44b8('0x3b')][_0x44b8('0x3c')],_0x44b8('0x45'))){validateJwt(_0x53d9c7,_0x2e0174,_0x4a182d);}else{if(_0xb22107){_0x4a182d();}else{return _0x2e0174['status'](0x193)[_0x44b8('0x43')]({'message':_0x44b8('0x46')});}}}else if(_0x53d9c7[_0x44b8('0x47')][_0x44b8('0x48')]){try{var _0x46b008={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x44b8('0x49')]()};verifyJwt(_0x53d9c7[_0x44b8('0x47')][_0x44b8('0x48')],_0x46b008)[_0x44b8('0x34')](function(_0x140a79){return db[_0x44b8('0x3e')][_0x44b8('0x3f')]({'where':{'id':_0x140a79[_0x44b8('0x4a')]}})[_0x44b8('0x34')](function(_0x181761){_0xfb0028=_0x181761;return db[_0x44b8('0x4b')][_0x44b8('0x4c')]({'where':{'id':0x1},'attributes':[_0x44b8('0x4d'),_0x44b8('0x4e')],'raw':!![]});})[_0x44b8('0x34')](function(_0x1becb0){if(!_0xfb0028||!_[_0x44b8('0x4f')](_0xfb0028[_0x44b8('0x50')],_0x140a79[_0x44b8('0x51')])){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x52')});}if(_0xfb0028['disabled']){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0xfb0028[_0x44b8('0x53')]){if(_0x1becb0[_0x44b8('0x4e')]>0x0){if(moment(_0xfb0028[_0x44b8('0x54')])[_0x44b8('0x55')](_0x1becb0['blockDuration'],_0x44b8('0x56'))>moment()){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x57')});}}else{return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x57')});}}_0x53d9c7[_0x44b8('0x30')]={'id':_0xfb0028['id']};_0x4a182d();});})[_0x44b8('0x39')](function(){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x57')});});}catch(_0xd69398){_0x4a182d(_0xd69398);}}else if(_0xb22107){_0x4a182d();}else{return _0x2e0174[_0x44b8('0x36')](0x193)[_0x44b8('0x43')]({'message':_0x44b8('0x46')});}})['use'](function(_0x12a0a4,_0x43e43a,_0xbf444f){if(_0x12a0a4['user']){db[_0x44b8('0x3e')][_0x44b8('0x3f')]({'where':{'id':_0x12a0a4[_0x44b8('0x30')]['id']},'attributes':userAttributes})['then'](function(_0xbad4bb){if(!_0xbad4bb){return _0x43e43a[_0x44b8('0x36')](0x194)[_0x44b8('0x43')]({'message':_0x44b8('0x58')});}_0x12a0a4[_0x44b8('0x30')]=_0xbad4bb;_0xbf444f();})['catch'](function(_0x5ae5f9){_0xbf444f(_0x5ae5f9);});}else if(_0xb22107){_0xbf444f();}else{return _0x43e43a[_0x44b8('0x36')](0x194)[_0x44b8('0x43')]({'message':_0x44b8('0x59')});}});};exports[_0x44b8('0x5a')]=function canUpdate(){return compose()[_0x44b8('0x3a')](function(_0x26e1f1,_0x3fc41b,_0x457348){return licenseUtil[_0x44b8('0x5b')]()[_0x44b8('0x34')](function(_0x197782){if(_0x197782[_0x44b8('0x5c')]){_0x457348();}else{return _0x3fc41b[_0x44b8('0x36')](0x193)[_0x44b8('0x43')]({'message':_0x44b8('0x5d')});}})[_0x44b8('0x39')](function(_0xce06dc){_0x457348(_0xce06dc);});});};exports[_0x44b8('0x5e')]=function isWebrtcLicence(){return compose()[_0x44b8('0x3a')](function(_0x49c507,_0x547dc1,_0x3b1b12){return licenseUtil[_0x44b8('0x5b')]()[_0x44b8('0x34')](function(_0x269284){if(_0x269284[_0x44b8('0x5f')]){_0x3b1b12();}else{return _0x547dc1[_0x44b8('0x36')](0x193)[_0x44b8('0x43')]({'message':'Forbidden'});}})[_0x44b8('0x39')](function(_0x53edca){_0x3b1b12(_0x53edca);});});};exports[_0x44b8('0x60')]=function(_0x3ef886,_0x1dbc28,_0x9207bf){_0x3ef886[_0x44b8('0x60')]=!![];return _0x9207bf();};exports[_0x44b8('0x61')]=function signToken(_0x491600){return signJwt(_0x491600);};exports[_0x44b8('0x62')]=function(_0xff92fb,_0x10602c){if(!_0xff92fb[_0x44b8('0x30')]){return _0x10602c['status'](0x194)[_0x44b8('0x43')]({'message':_0x44b8('0x63')});}var _0x36afa9={'payload':{'id':_0xff92fb[_0x44b8('0x30')]['id'],'role':_0xff92fb[_0x44b8('0x30')][_0x44b8('0x64')]},'options':{'expiresIn':0x15180}};return signJwt(_0x36afa9)['then'](function(_0x19d95d){_0x10602c[_0x44b8('0x65')](_0x44b8('0x66'),_0x19d95d);_0x10602c[_0x44b8('0x67')](_0x44b8('0x68'));})['catch'](function(_0x493840){return _0x10602c[_0x44b8('0x36')](0x1f4)['send'](_0x493840);});};exports[_0x44b8('0x69')]=function(_0x5785ef){if(_[_0x44b8('0x6a')](_0x5785ef[_0x44b8('0x50')])||_[_0x44b8('0x6a')](_0x5785ef[_0x44b8('0x6b')])){return null;}else{return createJwt(_0x5785ef);}};exports[_0x44b8('0x6c')]=function(_0x32f588){_0x32f588[_0x44b8('0x50')]=generateNonce();_0x32f588['apiKeyIat']=generateIssuedAt();return createJwt(_0x32f588);};exports[_0x44b8('0x6d')]=function(_0x37b2c2,_0x1e6a5e){var _0x492be6=_0x37b2c2[_0x44b8('0x47')][_0x44b8('0x48')];if(_0x492be6){var _0x45f9a0={'nonce':_0x1e6a5e[_0x44b8('0x50')],'iat':_0x1e6a5e['apiKeyIat'],'audience':hardwareConf[_0x44b8('0x49')](),'issuer':hardwareConf[_0x44b8('0x49')]()};return verifyJwt(_0x492be6,_0x45f9a0)['then'](function(){return generateApiKey(_0x1e6a5e);});}else{throw{'message':_0x44b8('0x6e')};}};exports[_0x44b8('0x6f')]=function(_0x35136e){var _0x3df6aa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3df6aa[_0x44b8('0x70')](_0x35136e))throw new db['Sequelize']['ValidationError'](_0x44b8('0x71'));return;};exports[_0x44b8('0x72')]=function(_0xa30834,_0x4358aa,_0x765e45){var _0x3f6b92=encryptor[_0x44b8('0x73')](_0x4358aa)[_0x44b8('0x74')](',');for(var _0x10bbd9=0x0;_0x10bbd9<_0x765e45;_0x10bbd9++){if(!_0x3f6b92[_0x10bbd9])break;if(_0xa30834[_0x44b8('0x75')]()===_0x3f6b92[_0x10bbd9][_0x44b8('0x75')]()){var _0x3f7576=util['format'](_0x44b8('0x76'),_0x765e45);if(_0x765e45===0x1){_0x3f7576=_0x44b8('0x77');}throw new db[(_0x44b8('0x78'))][(_0x44b8('0x79'))](_0x3f7576);}}return;};exports[_0x44b8('0x7a')]=function(_0x1df915,_0x426a6a){var _0x172ff3=_0x426a6a?encryptor[_0x44b8('0x73')](_0x426a6a)[_0x44b8('0x74')](','):[];if(_0x172ff3[_0x44b8('0x7b')]===0x5){_0x172ff3[_0x44b8('0x7c')](-0x1,0x1);}_0x172ff3[_0x44b8('0x7d')](_0x1df915);return encryptor[_0x44b8('0x7e')](_0x172ff3[_0x44b8('0x7f')](','));};function signJwt(_0x293c2e){var _0x25f91c=BPromise[_0x44b8('0x80')](jwt['sign'],{'context':jwt});var _0x1ec516=_0x293c2e[_0x44b8('0x81')]||config[_0x44b8('0x82')][_0x44b8('0x7')];return new BPromise(function(_0x51f763,_0x29ed5d){_0x25f91c(_0x293c2e[_0x44b8('0x83')],_0x1ec516,_0x293c2e['options'])[_0x44b8('0x34')](function(_0xc4d667){_0x51f763(_0xc4d667);})['catch'](function(_0x2a95f6){_0x29ed5d(_0x2a95f6);});});}function verifyJwt(_0x3354bd,_0x520929,_0x37e42e){var _0x454fe6=BPromise[_0x44b8('0x80')](jwt['verify'],{'context':jwt});var _0x16e790=_0x37e42e||config['secrets'][_0x44b8('0x7')];return new BPromise(function(_0x5161ea,_0x176536){_0x454fe6(_0x3354bd,_0x16e790,_0x520929)[_0x44b8('0x34')](function(_0xf4d81f){_0x5161ea(_0xf4d81f);})[_0x44b8('0x39')](function(_0x3c6aad){_0x176536(_0x3c6aad);});});}function generateNonce(){return crypto[_0x44b8('0x84')](0x10)['toString'](_0x44b8('0x85'));}function generateIssuedAt(){return Math['floor'](Date[_0x44b8('0x86')]()/0x3e8)[_0x44b8('0x87')]();}function createJwt(_0x4c1a7c){var _0x3f9438={'payload':{'iat':_0x4c1a7c[_0x44b8('0x6b')],'nonce':_0x4c1a7c[_0x44b8('0x50')]},'options':{'algorithm':_0x44b8('0x88'),'subject':_0x4c1a7c['id'][_0x44b8('0x87')](),'issuer':hardwareConf[_0x44b8('0x49')](),'audience':hardwareConf[_0x44b8('0x49')]()}};return signJwt(_0x3f9438)[_0x44b8('0x34')](function(_0x3f9102){return{'iat':_0x4c1a7c[_0x44b8('0x6b')],'nonce':_0x4c1a7c[_0x44b8('0x50')],'token':_0x3f9102};});} \ No newline at end of file +var _0xedd9=['crypto','bluebird','util','moment','session','fullname','name','internal','email','permissions','voicePause','chatPause','faxPause','smsPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','hotdesk','interface','userProfileId','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','selectRecallMeCampaign','chatAutoanswer','emailAutoanswerDelay','smsAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','closed','disposition','then','unmanaged','json','Unmanaged.','authorization','startsWith','headers','Basic','User','find','authenticate','pass','status','catch','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockedAt','add','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','isWebrtcLicence','webrtc','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','send','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','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','toLowerCase','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.','Sequelize','updatePasswordsHistory','split','unshift','join','promisify','secrets','payload','verify','hex','toString','HS512','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware'];(function(_0x19107b,_0x366bf6){var _0x3bd484=function(_0x100cb3){while(--_0x100cb3){_0x19107b['push'](_0x19107b['shift']());}};_0x3bd484(++_0x366bf6);}(_0xedd9,0xfc));var _0x9edd=function(_0x28710d,_0x2b828d){_0x28710d=_0x28710d-0x0;var _0x2b7fa1=_0xedd9[_0x28710d];return _0x2b7fa1;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x9edd('0x0'));var hardwareConf=require(_0x9edd('0x1'));var licenseUtil=require(_0x9edd('0x2'));var encryptor=require(_0x9edd('0x3'));var _=require(_0x9edd('0x4'));var jwt=require(_0x9edd('0x5'));var expressJwt=require(_0x9edd('0x6'));var compose=require(_0x9edd('0x7'));var basicAuth=require('basic-auth');var crypto=require(_0x9edd('0x8'));var BPromise=require(_0x9edd('0x9'));var util=require(_0x9edd('0xa'));var moment=require(_0x9edd('0xb'));var validateJwt=expressJwt({'secret':config['secrets'][_0x9edd('0xc')]});var userAttributes=['id','role',_0x9edd('0xd'),_0x9edd('0xe'),_0x9edd('0xf'),_0x9edd('0x10'),'userpic',_0x9edd('0x11'),'md5secret',_0x9edd('0x12'),_0x9edd('0x13'),'mailPause',_0x9edd('0x14'),_0x9edd('0x15'),'openchannelPause',_0x9edd('0x16'),_0x9edd('0x17'),_0x9edd('0x18'),_0x9edd('0x19'),_0x9edd('0x1a'),_0x9edd('0x1b'),_0x9edd('0x1c'),_0x9edd('0x1d'),'phoneBarAutoAnswer',_0x9edd('0x1e'),_0x9edd('0x1f'),_0x9edd('0x20'),_0x9edd('0x21'),_0x9edd('0x22'),_0x9edd('0x23'),_0x9edd('0x24'),_0x9edd('0x25'),'phoneBarRemoteControlPort',_0x9edd('0x26'),_0x9edd('0x27'),_0x9edd('0x28'),'privacyEnabled',_0x9edd('0x29'),_0x9edd('0x2a'),_0x9edd('0x2b'),'downloadOmnichannelInteractions',_0x9edd('0x2c'),'ignorePauseForPreviewCalls',_0x9edd('0x2d'),_0x9edd('0x2e'),'chatAutoanswerDelay','emailAutoanswer',_0x9edd('0x2f'),'smsAutoanswer',_0x9edd('0x30'),'openchannelAutoanswer','openchannelAutoanswerDelay',_0x9edd('0x31'),_0x9edd('0x32'),'whatsappAutoanswer','whatsappAutoanswerDelay'];exports[_0x9edd('0x33')]=function(){return this[_0x9edd('0x34')](!![])[_0x9edd('0x35')](function(_0x542172,_0x3741c8,_0x1dca43){if(_0x542172[_0x9edd('0x36')]){_0x1dca43();}else{return db[_0x9edd('0x37')][_0x9edd('0x38')]({'where':{'id':_0x542172['params']['id']},'attributes':['id',_0x9edd('0x39'),_0x9edd('0x3a')],'raw':!![]})[_0x9edd('0x3b')](function(_0x2f9f86){if(_0x2f9f86&&_0x2f9f86[_0x9edd('0x39')]){return _0x3741c8['status'](_0x2f9f86['disposition']===_0x9edd('0x3c')?0x195:0x193)[_0x9edd('0x3d')]({'message':_0x2f9f86[_0x9edd('0x3a')]===_0x9edd('0x3c')?_0x9edd('0x3e'):'Forbidden.'});}else{_0x1dca43();}})['catch'](function(_0x214d0a){_0x1dca43(_0x214d0a);});}});};exports[_0x9edd('0x34')]=function isAuthenticated(_0x1c762c){return compose()['use'](function(_0x238b22,_0x28cfae,_0x2ae8dd){var _0x41af53;if(_0x238b22['headers'][_0x9edd('0x3f')]){if(_[_0x9edd('0x40')](_0x238b22[_0x9edd('0x41')][_0x9edd('0x3f')],_0x9edd('0x42'))){var _0x42e664=basicAuth(_0x238b22);db[_0x9edd('0x43')][_0x9edd('0x44')]({'where':{'name':_0x42e664[_0x9edd('0xe')]}})[_0x9edd('0x3b')](function(_0x4fd03f){if(!_0x4fd03f||!_0x4fd03f[_0x9edd('0x45')](_0x42e664[_0x9edd('0x46')])){return _0x28cfae[_0x9edd('0x47')](0x191)[_0x9edd('0x3d')]({'message':'Wrong\x20credentials.'});}_0x238b22[_0x9edd('0x36')]={'id':_0x4fd03f['id']};_0x2ae8dd();})[_0x9edd('0x48')](function(_0x267c74){_0x2ae8dd(_0x267c74);});}else if(_['startsWith'](_0x238b22[_0x9edd('0x41')][_0x9edd('0x3f')],_0x9edd('0x49'))){validateJwt(_0x238b22,_0x28cfae,_0x2ae8dd);}else{if(_0x1c762c){_0x2ae8dd();}else{return _0x28cfae[_0x9edd('0x47')](0x193)[_0x9edd('0x3d')]({'message':_0x9edd('0x4a')});}}}else if(_0x238b22[_0x9edd('0x4b')][_0x9edd('0x4c')]){try{var _0xd0fd74={'audience':hardwareConf[_0x9edd('0x4d')](),'issuer':hardwareConf[_0x9edd('0x4d')]()};verifyJwt(_0x238b22[_0x9edd('0x4b')][_0x9edd('0x4c')],_0xd0fd74)[_0x9edd('0x3b')](function(_0x5757fc){return db[_0x9edd('0x43')]['find']({'where':{'id':_0x5757fc[_0x9edd('0x4e')]}})[_0x9edd('0x3b')](function(_0x10d6fd){_0x41af53=_0x10d6fd;return db[_0x9edd('0x4f')][_0x9edd('0x38')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x9edd('0x50')],'raw':!![]});})[_0x9edd('0x3b')](function(_0x2b3469){if(!_0x41af53||!_[_0x9edd('0x51')](_0x41af53[_0x9edd('0x52')],_0x5757fc[_0x9edd('0x53')])){return _0x28cfae[_0x9edd('0x47')](0x191)[_0x9edd('0x3d')]({'message':_0x9edd('0x54')});}if(_0x41af53[_0x9edd('0x55')]){return _0x28cfae['status'](0x191)[_0x9edd('0x3d')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x41af53[_0x9edd('0x56')]){if(_0x2b3469['blockDuration']>0x0){if(moment(_0x41af53[_0x9edd('0x57')])[_0x9edd('0x58')](_0x2b3469[_0x9edd('0x50')],'minutes')>moment()){return _0x28cfae[_0x9edd('0x47')](0x191)[_0x9edd('0x3d')]({'message':_0x9edd('0x59')});}}else{return _0x28cfae['status'](0x191)[_0x9edd('0x3d')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x238b22[_0x9edd('0x36')]={'id':_0x41af53['id']};_0x2ae8dd();});})[_0x9edd('0x48')](function(){return _0x28cfae['status'](0x191)[_0x9edd('0x3d')]({'message':_0x9edd('0x59')});});}catch(_0x389f51){_0x2ae8dd(_0x389f51);}}else if(_0x1c762c){_0x2ae8dd();}else{return _0x28cfae[_0x9edd('0x47')](0x193)['json']({'message':_0x9edd('0x4a')});}})['use'](function(_0x2bdb3f,_0xc1e657,_0x587d74){if(_0x2bdb3f[_0x9edd('0x36')]){db['User']['find']({'where':{'id':_0x2bdb3f[_0x9edd('0x36')]['id']},'attributes':userAttributes})[_0x9edd('0x3b')](function(_0x1f276b){if(!_0x1f276b){return _0xc1e657[_0x9edd('0x47')](0x194)[_0x9edd('0x3d')]({'message':_0x9edd('0x5a')});}_0x2bdb3f[_0x9edd('0x36')]=_0x1f276b;_0x587d74();})[_0x9edd('0x48')](function(_0x18c149){_0x587d74(_0x18c149);});}else if(_0x1c762c){_0x587d74();}else{return _0xc1e657[_0x9edd('0x47')](0x194)[_0x9edd('0x3d')]({'message':_0x9edd('0x5b')});}});};exports[_0x9edd('0x5c')]=function canUpdate(){return compose()[_0x9edd('0x35')](function(_0x46e9f4,_0x5416f8,_0x13197d){return licenseUtil[_0x9edd('0x5d')]()[_0x9edd('0x3b')](function(_0x1e5805){if(_0x1e5805[_0x9edd('0x5e')]){_0x13197d();}else{return _0x5416f8[_0x9edd('0x47')](0x193)[_0x9edd('0x3d')]({'message':'Forbidden'});}})['catch'](function(_0x4bc7a1){_0x13197d(_0x4bc7a1);});});};exports[_0x9edd('0x5f')]=function isWebrtcLicence(){return compose()['use'](function(_0x8b1fdb,_0x19b56b,_0x2b06d3){return licenseUtil[_0x9edd('0x5d')]()[_0x9edd('0x3b')](function(_0x53005b){if(_0x53005b[_0x9edd('0x60')]){_0x2b06d3();}else{return _0x19b56b[_0x9edd('0x47')](0x193)[_0x9edd('0x3d')]({'message':'Forbidden'});}})[_0x9edd('0x48')](function(_0xfd7bd1){_0x2b06d3(_0xfd7bd1);});});};exports[_0x9edd('0x61')]=function(_0x293b03,_0x1d78c4,_0x35bdec){_0x293b03['isMiddleware']=!![];return _0x35bdec();};exports[_0x9edd('0x62')]=function signToken(_0x237e91){return signJwt(_0x237e91);};exports['setTokenCookie']=function(_0xb93816,_0x8d8701){if(!_0xb93816['user']){return _0x8d8701[_0x9edd('0x47')](0x194)[_0x9edd('0x3d')]({'message':_0x9edd('0x63')});}var _0x5215b0={'payload':{'id':_0xb93816[_0x9edd('0x36')]['id'],'role':_0xb93816[_0x9edd('0x36')][_0x9edd('0x64')]},'options':{'expiresIn':0x15180}};return signJwt(_0x5215b0)[_0x9edd('0x3b')](function(_0x53f6e3){_0x8d8701[_0x9edd('0x65')](_0x9edd('0x66'),_0x53f6e3);_0x8d8701[_0x9edd('0x67')]('/dashboards/general');})[_0x9edd('0x48')](function(_0x21f6ce){return _0x8d8701['status'](0x1f4)[_0x9edd('0x68')](_0x21f6ce);});};exports['retrieveApiKey']=function(_0x336494){if(_[_0x9edd('0x69')](_0x336494[_0x9edd('0x52')])||_[_0x9edd('0x69')](_0x336494[_0x9edd('0x6a')])){return null;}else{return createJwt(_0x336494);}};exports[_0x9edd('0x6b')]=function(_0x2334d4){_0x2334d4[_0x9edd('0x52')]=generateNonce();_0x2334d4[_0x9edd('0x6a')]=generateIssuedAt();return createJwt(_0x2334d4);};exports[_0x9edd('0x6c')]=function(_0x31272d,_0x5a3b1d){var _0x161bea=_0x31272d[_0x9edd('0x4b')][_0x9edd('0x4c')];if(_0x161bea){var _0x58fe29={'nonce':_0x5a3b1d[_0x9edd('0x52')],'iat':_0x5a3b1d['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x161bea,_0x58fe29)[_0x9edd('0x3b')](function(){return generateApiKey(_0x5a3b1d);});}else{throw{'message':_0x9edd('0x6d')};}};exports[_0x9edd('0x6e')]=function(_0x35ddb3){var _0x48a900=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x48a900['test'](_0x35ddb3))throw new db['Sequelize'][(_0x9edd('0x6f'))](_0x9edd('0x70'));return;};exports[_0x9edd('0x71')]=function(_0x1091ff,_0x2e2920,_0x41ec97){var _0x25906c=encryptor[_0x9edd('0x72')](_0x2e2920)['split'](',');for(var _0x16dfdc=0x0;_0x16dfdc<_0x41ec97;_0x16dfdc++){if(!_0x25906c[_0x16dfdc])break;if(_0x1091ff['toLowerCase']()===_0x25906c[_0x16dfdc][_0x9edd('0x73')]()){var _0x6a1cfc=util['format'](_0x9edd('0x74'),_0x41ec97);if(_0x41ec97===0x1){_0x6a1cfc=_0x9edd('0x75');}throw new db[(_0x9edd('0x76'))]['ValidationError'](_0x6a1cfc);}}return;};exports[_0x9edd('0x77')]=function(_0x2e1ce3,_0x430eb4){var _0x15ebfa=_0x430eb4?encryptor[_0x9edd('0x72')](_0x430eb4)[_0x9edd('0x78')](','):[];if(_0x15ebfa['length']===0x5){_0x15ebfa['splice'](-0x1,0x1);}_0x15ebfa[_0x9edd('0x79')](_0x2e1ce3);return encryptor['encryptString'](_0x15ebfa[_0x9edd('0x7a')](','));};function signJwt(_0x3e9a3e){var _0x439083=BPromise[_0x9edd('0x7b')](jwt['sign'],{'context':jwt});var _0x21ead2=_0x3e9a3e['secret']||config[_0x9edd('0x7c')][_0x9edd('0xc')];return new BPromise(function(_0xc6bde6,_0x5ca123){_0x439083(_0x3e9a3e[_0x9edd('0x7d')],_0x21ead2,_0x3e9a3e['options'])[_0x9edd('0x3b')](function(_0x4e1eda){_0xc6bde6(_0x4e1eda);})['catch'](function(_0x236b82){_0x5ca123(_0x236b82);});});}function verifyJwt(_0x4a72d0,_0x141137,_0x134c9c){var _0x307a61=BPromise['promisify'](jwt[_0x9edd('0x7e')],{'context':jwt});var _0x321485=_0x134c9c||config[_0x9edd('0x7c')][_0x9edd('0xc')];return new BPromise(function(_0x467512,_0x4d8fbb){_0x307a61(_0x4a72d0,_0x321485,_0x141137)['then'](function(_0x2e1a96){_0x467512(_0x2e1a96);})[_0x9edd('0x48')](function(_0x5516c4){_0x4d8fbb(_0x5516c4);});});}function generateNonce(){return crypto['randomBytes'](0x10)['toString'](_0x9edd('0x7f'));}function generateIssuedAt(){return Math['floor'](Date['now']()/0x3e8)[_0x9edd('0x80')]();}function createJwt(_0x32ff46){var _0x589348={'payload':{'iat':_0x32ff46[_0x9edd('0x6a')],'nonce':_0x32ff46[_0x9edd('0x52')]},'options':{'algorithm':_0x9edd('0x81'),'subject':_0x32ff46['id']['toString'](),'issuer':hardwareConf[_0x9edd('0x4d')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x589348)[_0x9edd('0x3b')](function(_0x18d1a0){return{'iat':_0x32ff46['apiKeyIat'],'nonce':_0x32ff46[_0x9edd('0x52')],'token':_0x18d1a0};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index f8bd82c..d07dd67 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 _0x5f66=['buildContactsQuery','getFilteredContacts','catch','CmContact','keys','filter','cf_','CmCustomField','slice','all','length','./sql-utils','findAll','resolve','then','search','parseAdvancedSearchFilter','where','default','fields','clause','user','skip','checkListsRestrictions','ids','tag','count'];(function(_0x36a13d,_0x553a11){var _0x3ac320=function(_0x2be698){while(--_0x2be698){_0x36a13d['push'](_0x36a13d['shift']());}};_0x3ac320(++_0x553a11);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'use strict';var _=require('lodash');var sqlUtils=require(_0x65f6('0x0'));var db=require('../../mysqldb')['db'];exports[_0x65f6('0x1')]=function(_0x2f06ae,_0x3461cd,_0xbce843,_0x1a330c){var _0x5eb9ad={'count':0x0,'rows':[]};var _0x3c5029=sqlUtils['skipContactsQuery'](_0x3461cd,_0x2f06ae);if(_0x3c5029){return Promise[_0x65f6('0x2')](_0x5eb9ad);}var _0x22b017=sqlUtils['getContactsSubquery']();var _0x4ed98f={};var _0x1c0e12=![];var _0x2c6571=![];return Promise[_0x65f6('0x2')]()[_0x65f6('0x3')](function(){if(_0x2f06ae[_0x65f6('0x4')]){return sqlUtils[_0x65f6('0x5')](_0x2f06ae['search'],_0x1a330c);}else{return sqlUtils['parseQueryParameters'](_0x2f06ae,_0x1a330c);}})[_0x65f6('0x3')](function(_0x2f6d5b){_0x22b017[_0x65f6('0x6')](_0x2f6d5b[_0x65f6('0x7')]);_0x22b017['where'](_0x2f6d5b[_0x65f6('0x8')]);_0x22b017['where'](_0x2f6d5b['filter']);_0x22b017[_0x65f6('0x6')](_0x2f6d5b['user'][_0x65f6('0x9')]);_0x4ed98f=_0x2f6d5b['tags'];_0x2c6571=_0x2f6d5b[_0x65f6('0xa')][_0x65f6('0xb')];return sqlUtils[_0x65f6('0xc')](_0x3461cd,_0x2f06ae,_0x2c6571);})[_0x65f6('0x3')](function(_0x369f96){_0x22b017[_0x65f6('0x6')](_0x369f96);var _0x44144b=_0x2f06ae[_0x65f6('0x4')]?_0x4ed98f[_0x65f6('0xd')]:_0x2f06ae[_0x65f6('0xe')];_0x1c0e12=_0x44144b?!![]:![];return sqlUtils['countFilteredContacts'](_0x22b017,_0x44144b);})[_0x65f6('0x3')](function(_0x49a913){_0x5eb9ad['count']=_0x49a913;if(_0x5eb9ad[_0x65f6('0xf')]===0x0){return;}return sqlUtils[_0x65f6('0x10')](_0x22b017,_0x2f06ae[_0x65f6('0x8')],_0xbce843,_0x1c0e12,_0x4ed98f[_0x65f6('0x9')],_0x2c6571);})[_0x65f6('0x3')](function(_0x1f974c){if(!_0x1f974c){return[];}return sqlUtils[_0x65f6('0x11')](_0x1f974c,_0x2f06ae,_0xbce843);})[_0x65f6('0x3')](function(_0x495dd6){_0x5eb9ad['rows']=_0x495dd6;return _0x5eb9ad;})[_0x65f6('0x12')](function(_0x5b4055){throw _0x5b4055;});};exports['describe']=function(){var _0x5c5b91={};var _0x365159=[];return db[_0x65f6('0x13')]['describe']()[_0x65f6('0x3')](function(_0x270893){_0x5c5b91=_0x270893;var _0xbee6a4=Object[_0x65f6('0x14')](_0x5c5b91)[_0x65f6('0x15')](function(_0xc139c2){return _['startsWith'](_0xc139c2,_0x65f6('0x16'))?_0xc139c2:undefined;});var _0x4bb39e=_0xbee6a4['map'](function(_0x212247){return db[_0x65f6('0x17')]['findOne']({'where':{'id':_0x212247[_0x65f6('0x18')](0x3)},'raw':!![]});});return Promise[_0x65f6('0x19')](_0x4bb39e);})[_0x65f6('0x3')](function(_0x2774a1){for(var _0x4f5a69=0x0;_0x4f5a69<_0x2774a1[_0x65f6('0x1a')];_0x4f5a69++){if(_0x2774a1[_0x4f5a69]){var _0x59ea32=_0x65f6('0x16')+_0x2774a1[_0x4f5a69]['id'];_0x5c5b91[_0x59ea32]['fieldType']=_0x2774a1[_0x4f5a69]['type'];}}_0x365159=_['map'](Object[_0x65f6('0x14')](_0x5c5b91),function(_0x16cde8){return{'name':_0x16cde8,'type':_0x5c5b91[_0x16cde8]['type']};});return _0x365159;})[_0x65f6('0x12')](function(_0x28f710){throw _0x28f710;});}; \ No newline at end of file +var _0xb10b=['user','clause','tags','skip','checkListsRestrictions','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','rows','catch','describe','CmContact','keys','startsWith','cf_','map','CmCustomField','findOne','slice','all','fieldType','type','lodash','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','default','where','fields','filter'];(function(_0x1aba20,_0x1f6955){var _0x2a7ad4=function(_0x10d7ae){while(--_0x10d7ae){_0x1aba20['push'](_0x1aba20['shift']());}};_0x2a7ad4(++_0x1f6955);}(_0xb10b,0x12a));var _0xbb10=function(_0x1f1837,_0x4b304e){_0x1f1837=_0x1f1837-0x0;var _0x25ab57=_0xb10b[_0x1f1837];return _0x25ab57;};'use strict';var _=require(_0xbb10('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0xbb10('0x1'))['db'];exports[_0xbb10('0x2')]=function(_0x1dcb08,_0x4d688c,_0x4541ae,_0x9bbed){var _0x460981={'count':0x0,'rows':[]};var _0x22320e=sqlUtils[_0xbb10('0x3')](_0x4d688c,_0x1dcb08);if(_0x22320e){return Promise[_0xbb10('0x4')](_0x460981);}var _0x481979=sqlUtils[_0xbb10('0x5')]();var _0x3cdd53={};var _0x513741=![];var _0x1b9e94=![];return Promise[_0xbb10('0x4')]()[_0xbb10('0x6')](function(){if(_0x1dcb08[_0xbb10('0x7')]){return sqlUtils[_0xbb10('0x8')](_0x1dcb08[_0xbb10('0x7')],_0x9bbed);}else{return sqlUtils[_0xbb10('0x9')](_0x1dcb08,_0x9bbed);}})[_0xbb10('0x6')](function(_0x5ab04a){_0x481979['where'](_0x5ab04a[_0xbb10('0xa')]);_0x481979[_0xbb10('0xb')](_0x5ab04a[_0xbb10('0xc')]);_0x481979['where'](_0x5ab04a[_0xbb10('0xd')]);_0x481979['where'](_0x5ab04a[_0xbb10('0xe')][_0xbb10('0xf')]);_0x3cdd53=_0x5ab04a[_0xbb10('0x10')];_0x1b9e94=_0x5ab04a[_0xbb10('0xe')][_0xbb10('0x11')];return sqlUtils[_0xbb10('0x12')](_0x4d688c,_0x1dcb08,_0x1b9e94);})['then'](function(_0x26e021){_0x481979[_0xbb10('0xb')](_0x26e021);var _0x45b9d6=_0x1dcb08[_0xbb10('0x7')]?_0x3cdd53[_0xbb10('0x13')]:_0x1dcb08[_0xbb10('0x14')];_0x513741=_0x45b9d6?!![]:![];return sqlUtils[_0xbb10('0x15')](_0x481979,_0x45b9d6);})[_0xbb10('0x6')](function(_0x3e26f4){_0x460981[_0xbb10('0x16')]=_0x3e26f4;if(_0x460981['count']===0x0){return;}return sqlUtils[_0xbb10('0x17')](_0x481979,_0x1dcb08[_0xbb10('0xc')],_0x4541ae,_0x513741,_0x3cdd53[_0xbb10('0xf')],_0x1b9e94);})[_0xbb10('0x6')](function(_0x378da8){if(!_0x378da8){return[];}return sqlUtils[_0xbb10('0x18')](_0x378da8,_0x1dcb08,_0x4541ae);})[_0xbb10('0x6')](function(_0x30efc6){_0x460981[_0xbb10('0x19')]=_0x30efc6;return _0x460981;})[_0xbb10('0x1a')](function(_0x48b6e9){throw _0x48b6e9;});};exports[_0xbb10('0x1b')]=function(){var _0x19f48d={};var _0x388fab=[];return db[_0xbb10('0x1c')][_0xbb10('0x1b')]()[_0xbb10('0x6')](function(_0x4deb49){_0x19f48d=_0x4deb49;var _0x12f888=Object[_0xbb10('0x1d')](_0x19f48d)['filter'](function(_0x4c4b0d){return _[_0xbb10('0x1e')](_0x4c4b0d,_0xbb10('0x1f'))?_0x4c4b0d:undefined;});var _0x2e911d=_0x12f888[_0xbb10('0x20')](function(_0x445761){return db[_0xbb10('0x21')][_0xbb10('0x22')]({'where':{'id':_0x445761[_0xbb10('0x23')](0x3)},'raw':!![]});});return Promise[_0xbb10('0x24')](_0x2e911d);})[_0xbb10('0x6')](function(_0x3ba6cd){for(var _0x26ad93=0x0;_0x26ad93<_0x3ba6cd['length'];_0x26ad93++){if(_0x3ba6cd[_0x26ad93]){var _0x4fedac='cf_'+_0x3ba6cd[_0x26ad93]['id'];_0x19f48d[_0x4fedac][_0xbb10('0x25')]=_0x3ba6cd[_0x26ad93][_0xbb10('0x26')];}}_0x388fab=_[_0xbb10('0x20')](Object['keys'](_0x19f48d),function(_0x2fdde9){return{'name':_0x2fdde9,'type':_0x19f48d[_0x2fdde9][_0xbb10('0x26')]};});return _0x388fab;})[_0xbb10('0x1a')](function(_0x1d5e95){throw _0x1d5e95;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index ed303d3..8c8b7ad 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 _0x6364=['compact','push','c.ListId\x20IN\x20?','concat','Contact','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','then','filter','agent','getLists','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','findAll','color','Sequelize','SELECT','CmContact','query','toString','Tags','clone','COUNT(*)','getSelectedTags','isEmpty','QueryTypes','sequelize','exports','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','search','ListId','autocomplete','true','select','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','cm_contact_has_tags','ct.CmContactId\x20=\x20','.id','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','mobile','fax','email','CompanyId','createdAt','deletedAt','TagIds','forEach','field','expr','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','conditions','name','dateOfBirth','fieldType','datetime','castTo','DATE','type','default','value','end','Tag','map','tags','clause','ids','and','user','skip','keys','some'];(function(_0x4cebbe,_0x23d67b){var _0x4ccf8d=function(_0x20ee78){while(--_0x20ee78){_0x4cebbe['push'](_0x4cebbe['shift']());}};_0x4ccf8d(++_0x23d67b);}(_0x6364,0x8f));var _0x4636=function(_0x181fe3,_0x469599){_0x181fe3=_0x181fe3-0x0;var _0x3c8cfd=_0x6364[_0x181fe3];return _0x3c8cfd;};'use strict';var _=require('lodash');var squel=require('squel');var as=require(_0x4636('0x0'));var qs=require(_0x4636('0x1'));var utils=require(_0x4636('0x2'));var db=require(_0x4636('0x3'))['db'];function skipContactsQuery(_0x3a02f9,_0xfa8c2a){var _0x28d2a2=![];if(_0x3a02f9[_0x4636('0x4')]==='agent'&&!_0xfa8c2a[_0x4636('0x5')]&&!_0xfa8c2a[_0x4636('0x6')]&&_0xfa8c2a[_0x4636('0x7')]!==_0x4636('0x8')){_0x28d2a2=!![];}return _0x28d2a2;}function getContactsSubquery(){return squel[_0x4636('0x9')]()['from'](_0x4636('0xa'),'c')[_0x4636('0xb')](_0x4636('0xc'));}function applyJoinClauses(_0x3e3f80,_0x498de6){var _0x3e1628=_0x498de6?'c':_0x4636('0xd');_0x3e3f80[_0x4636('0xe')](_0x4636('0xf'),'uc',_0x4636('0x10')+_0x3e1628+'.id')[_0x4636('0xe')](_0x4636('0x11'),'ct',_0x4636('0x12')+_0x3e1628+_0x4636('0x13'))['left_join'](_0x4636('0x14'),'t',_0x4636('0x15'));return _0x3e3f80;}function addFieldsToQuery(_0x26a363,_0x16d689,_0x16e836,_0x4e478d,_0x5d59c8){var _0x1b0436=_0x5d59c8?'c':_0x4636('0xd');if(!_0x16d689){_0x16d689=['id',_0x4636('0x16'),_0x4636('0x17'),'phone',_0x4636('0x18'),_0x4636('0x19'),_0x4636('0x1a'),_0x4636('0x6'),_0x4636('0x1b'),_0x4636('0x1c'),'updatedAt',_0x4636('0x1d'),_0x4636('0x1e')];}var _0x3362ca=_0x16e836&&_0x5d59c8||!_0x16e836&&!_0x5d59c8;if(_0x4e478d){_0x3362ca=_0x4e478d&&_0x5d59c8||!_0x4e478d&&!_0x5d59c8;}_0x16d689[_0x4636('0x1f')](function(_0x5495dc){if(_0x5495dc===_0x4636('0x1e')){if(_0x3362ca){_0x26a363['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x5495dc);}else if(_0x16e836||_0x4e478d){_0x26a363[_0x4636('0x20')](_0x1b0436+'.'+_0x5495dc);}}else{_0x26a363[_0x4636('0x20')](_0x1b0436+'.'+_0x5495dc);}});return _0x26a363;}function getSqlClauses(){var _0x5b498c={'default':squel[_0x4636('0x21')](),'fields':squel[_0x4636('0x21')](),'filter':squel['expr'](),'tags':{'clause':squel[_0x4636('0x21')](),'ids':null},'user':{'clause':squel[_0x4636('0x21')](),'skip':![]}};return _0x5b498c;}function parseTagParameter(_0x51a2ec){var _0x4f43ae=squel[_0x4636('0x21')]();if(_0x51a2ec){var _0x3dc87e=utils['getSelectedTags'](_0x51a2ec);_0x3dc87e[_0x4636('0x1f')](function(_0x5d9fa6){_0x4f43ae['or'](_0x4636('0x22'),'%,'+_0x5d9fa6+',%');});}return _0x4f43ae;}function parseSearchFilter(_0x469027){var _0x3cd3d7=squel[_0x4636('0x21')]();if(_0x469027){var _0x281223=_0x469027[_0x4636('0x23')]('\x5c','\x5c\x5c')[_0x4636('0x23')](/'/g,'\x27\x27');if(_0x281223[_0x4636('0x24')]('\x20')[_0x4636('0x25')]>0x1){_0x3cd3d7['or'](_0x4636('0x26'),qs[_0x4636('0x27')](_0x281223),null);}else{if(qs[_0x4636('0x28')](_0x281223)){_0x3cd3d7['or'](_0x4636('0x29'),_0x281223+'%');_0x3cd3d7['or'](_0x4636('0x2a'),_0x281223+'%');_0x3cd3d7['or'](_0x4636('0x2b'),_0x281223+'%');_0x3cd3d7['or'](_0x4636('0x2c'),_0x281223+'%');}else if(qs[_0x4636('0x2d')](_0x281223)){_0x3cd3d7['or'](_0x4636('0x2e'),_0x281223+'%');}else{_0x3cd3d7['or'](_0x4636('0x2f'),'%'+_0x281223+'%');_0x3cd3d7['or'](_0x4636('0x30'),'%'+_0x281223+'%');_0x3cd3d7['or']('c.email\x20LIKE\x20?','%'+_0x281223+'%');}}}return _0x3cd3d7;}function parseAdvancedSearchFilter(_0x3f51aa,_0x4bd69a){var _0x8dd8cf=getSqlClauses();var _0xd4046f=as[_0x4636('0x31')](_0x3f51aa);var _0x4e7cdb=_0xd4046f['sqlOperator'];for(var _0x5ef382=0x0;_0x5ef382<_0xd4046f[_0x4636('0x32')]['length'];_0x5ef382++){var _0x4e0bc0=_0xd4046f['conditions'][_0x5ef382];var _0x272b59='c';var _0x5f0260=_['find'](_0x4bd69a,[_0x4636('0x33'),_0x4e0bc0['field']]);if(_0x5f0260){if(_0x4e0bc0[_0x4636('0x20')]===_0x4636('0x34')||_0x5f0260[_0x4636('0x35')]===_0x4636('0x36')){_0x4e0bc0[_0x4636('0x37')]=_0x4636('0x38');}var _0x31b1f7=as['buildExpression'](_0x272b59,_0x5f0260[_0x4636('0x39')],_0x4e0bc0);_0x8dd8cf[_0x4636('0x3a')][_0x4e7cdb](_0x31b1f7['text'],_0x31b1f7[_0x4636('0x3b')]['start'],_0x31b1f7[_0x4636('0x3b')][_0x4636('0x3c')]);}else{if(_0x4e0bc0['field']===_0x4636('0x3d')){var _0x4428af=_0x4e0bc0[_0x4636('0x3b')]['split'](',')[_0x4636('0x3e')](function(_0x15391b){return Number(_0x15391b);});var _0x30b8cd=parseTagParameter(_0x4428af);_0x8dd8cf[_0x4636('0x3f')][_0x4636('0x40')]['and'](_0x30b8cd);_0x8dd8cf[_0x4636('0x3f')][_0x4636('0x41')]=_0x4428af;}else if(_0x4e0bc0[_0x4636('0x20')]==='User'){_0x8dd8cf['user'][_0x4636('0x40')][_0x4636('0x42')]('uc.UserId\x20=\x20?',_0x4e0bc0[_0x4636('0x3b')]);_0x8dd8cf[_0x4636('0x43')][_0x4636('0x44')]=!![];}}}return _0x8dd8cf;}function parseModelFields(_0x4965f9,_0x20b0a3){var _0x5a14dc=squel[_0x4636('0x21')]();var _0x357372=_(_0x4965f9)[_0x4636('0x45')]()[_0x4636('0x3e')](function(_0x2cd80c){return _[_0x4636('0x46')](_0x20b0a3,[_0x4636('0x33'),_0x2cd80c])?_0x2cd80c:undefined;})[_0x4636('0x47')]()['value']();if(_0x4965f9['Contact']){_0x357372[_0x4636('0x48')]('Contact');}if(_0x357372[_0x4636('0x25')]>0x0){_0x357372['forEach'](function(_0x1fed03){if(_0x1fed03==='ListId'){_0x5a14dc['and'](_0x4636('0x49'),[][_0x4636('0x4a')](_0x4965f9[_0x1fed03]));}else if(_0x1fed03===_0x4636('0x4b')){var _0x549e1c='%'+_0x4965f9[_0x1fed03]+'%';_0x5a14dc[_0x4636('0x42')](_0x4636('0x4c'),_0x549e1c);}else{_0x5a14dc['and']('c.'+_0x1fed03+'\x20=\x20?',_0x4965f9[_0x1fed03]);}});}return _0x5a14dc;}function parseQueryParameters(_0x22fd2,_0x18c7e4){var _0xbf5ef1=getSqlClauses();return Promise['resolve']()[_0x4636('0x4d')](function(){return parseModelFields(_0x22fd2,_0x18c7e4);})['then'](function(_0x100af4){_0xbf5ef1['fields'][_0x4636('0x42')](_0x100af4);return parseTagParameter(_0x22fd2['tag']);})[_0x4636('0x4d')](function(_0x11b91b){_0xbf5ef1[_0x4636('0x3f')][_0x4636('0x40')][_0x4636('0x42')](_0x11b91b);return parseSearchFilter(_0x22fd2[_0x4636('0x4e')]);})['then'](function(_0x47344a){_0xbf5ef1[_0x4636('0x4e')]=_0x47344a;return _0xbf5ef1;});}function checkListsRestrictions(_0x444f3f,_0x1d1328,_0x56aa8f){var _0x3b53e3=squel['expr']();return Promise['resolve']()[_0x4636('0x4d')](function(){if(_0x1d1328['search']&&_0x444f3f[_0x4636('0x4')]===_0x4636('0x4f')&&!_0x56aa8f){return _0x444f3f[_0x4636('0x50')]({'attributes':['id'],'raw':!![]});}})[_0x4636('0x4d')](function(_0x515523){if(_0x515523){if(_0x515523[_0x4636('0x25')]===0x0){_0x3b53e3[_0x4636('0x42')](_0x4636('0x51'));}else{_0x3b53e3[_0x4636('0x42')]('c.ListId\x20IN\x20?',_[_0x4636('0x3e')](_0x515523,'id'));}}})[_0x4636('0x4d')](function(){return _0x3b53e3;});}function buildContactsQuery(_0x31910d,_0x2c91f4,_0x5aac69,_0x4241eb,_0x1cfea8,_0x45dfe3){if(_0x2c91f4){_0x2c91f4=_0x5aac69[_0x4636('0x52')];}_0x31910d=addFieldsToQuery(_0x31910d,_0x2c91f4,_0x4241eb,_0x45dfe3,!![]);var _0x557bdf=squel[_0x4636('0x9')]();_0x557bdf=addFieldsToQuery(_0x557bdf,_0x2c91f4,_0x4241eb,_0x45dfe3,![]);if(_0x4241eb||_0x45dfe3){_0x31910d=applyJoinClauses(_0x31910d,!![]);_0x31910d[_0x4636('0x53')](_0x4636('0x54'));if(_0x5aac69['limit']){_0x557bdf[_0x4636('0x55')](_0x5aac69[_0x4636('0x55')]);}if(_0x5aac69[_0x4636('0x56')]){_0x557bdf[_0x4636('0x56')](_0x5aac69[_0x4636('0x56')]);}}else{_0x557bdf=applyJoinClauses(_0x557bdf,![]);_0x557bdf[_0x4636('0x53')](_0x4636('0x57'));if(_0x5aac69[_0x4636('0x55')]){_0x31910d[_0x4636('0x55')](_0x5aac69[_0x4636('0x55')]);}if(_0x5aac69[_0x4636('0x56')]){_0x31910d[_0x4636('0x56')](_0x5aac69[_0x4636('0x56')]);}}_0x557bdf[_0x4636('0x58')](_0x1cfea8);if(_0x5aac69[_0x4636('0x59')]){_0x5aac69[_0x4636('0x59')][_0x4636('0x1f')](function(_0x18f28a){_0x31910d[_0x4636('0x59')]('c.'+_0x18f28a[0x0],_0x18f28a[0x1]===_0x4636('0x5a')?![]:!![]);_0x557bdf[_0x4636('0x59')](_0x4636('0x5b')+_0x18f28a[0x0],_0x18f28a[0x1]===_0x4636('0x5a')?![]:!![]);});}_0x557bdf['from'](_0x31910d,_0x4636('0xd'));return _0x557bdf;}function getFilteredContacts(_0x575bff){var _0x208ab4=[];return db['Tag'][_0x4636('0x5c')]({'attributes':['id',_0x4636('0x33'),_0x4636('0x5d')],'raw':!![]})[_0x4636('0x4d')](function(_0x1ade47){_0x208ab4=_['keyBy'](_0x1ade47,'id');var _0x23e74f={'type':db[_0x4636('0x5e')]['QueryTypes'][_0x4636('0x5f')],'model':db[_0x4636('0x60')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0x4636('0x61')](_0x575bff[_0x4636('0x62')](),_0x23e74f);})[_0x4636('0x4d')](function(_0x615079){_0x615079[_0x4636('0x1f')](function(_0x4ef0de){if(_0x4ef0de['TagIds']){_0x4ef0de[_0x4636('0x63')]=[];_0x4ef0de[_0x4636('0x1e')][_0x4636('0x24')](',')[_0x4636('0x1f')](function(_0x14ee0e){_0x4ef0de['Tags'][_0x4636('0x48')](_0x208ab4[_0x14ee0e]);});}delete _0x4ef0de[_0x4636('0x1e')];});return _0x615079;});}function countFilteredContacts(_0x1a4061,_0x592af6){var _0x2fd2c9=_0x1a4061[_0x4636('0x64')]();_0x2fd2c9['field'](_0x4636('0x65'));_0x2fd2c9=applyJoinClauses(_0x2fd2c9,!![]);_0x1a4061[_0x4636('0x53')](_0x4636('0x54'));var _0x28995d=utils[_0x4636('0x66')](_0x592af6);if(!_[_0x4636('0x67')](_0x28995d)){_0x2fd2c9[_0x4636('0xb')]('t.id\x20IN\x20?',_0x28995d);}var _0x1c4440={'type':db[_0x4636('0x5e')][_0x4636('0x68')][_0x4636('0x5f')],'raw':!![]};return db[_0x4636('0x69')][_0x4636('0x61')](_0x2fd2c9[_0x4636('0x62')](),_0x1c4440)[_0x4636('0x4d')](function(_0x122e10){return _0x122e10[0x0][_0x4636('0x65')];});}module[_0x4636('0x6a')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x3299=['color','keyBy','Sequelize','QueryTypes','SELECT','CmContact','sequelize','query','toString','Tags','push','clone','COUNT(*)','isEmpty','where','t.id\x20IN\x20?','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','agent','search','ListId','autocomplete','true','select','from','cm_contacts','c.deletedAt\x20IS\x20NULL','subqry','cm_user_has_contacts','uc.CmContactId\x20=\x20','ct.CmContactId\x20=\x20','.id','left_join','tools_tags','t.id\x20=\x20ct.TagId','lastName','phone','fax','email','CompanyId','updatedAt','TagIds','GROUP_CONCAT(DISTINCT\x20t.id)','field','expr','getSelectedTags','forEach','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)','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','castTo','type','default','value','start','end','Tag','map','tags','clause','and','ids','User','user','skip','keys','some','compact','Contact','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','filter','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','attributes','group','c.id','limit','offset','subqry.id','order','DESC','subqry.','findAll'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3299,0x1bc));var _0x9329=function(_0x38bed0,_0x593146){_0x38bed0=_0x38bed0-0x0;var _0x53ae97=_0x3299[_0x38bed0];return _0x53ae97;};'use strict';var _=require('lodash');var squel=require(_0x9329('0x0'));var as=require(_0x9329('0x1'));var qs=require(_0x9329('0x2'));var utils=require(_0x9329('0x3'));var db=require(_0x9329('0x4'))['db'];function skipContactsQuery(_0x6ebea4,_0x2a092c){var _0x3fc97d=![];if(_0x6ebea4[_0x9329('0x5')]===_0x9329('0x6')&&!_0x2a092c[_0x9329('0x7')]&&!_0x2a092c[_0x9329('0x8')]&&_0x2a092c[_0x9329('0x9')]!==_0x9329('0xa')){_0x3fc97d=!![];}return _0x3fc97d;}function getContactsSubquery(){return squel[_0x9329('0xb')]()[_0x9329('0xc')](_0x9329('0xd'),'c')['where'](_0x9329('0xe'));}function applyJoinClauses(_0x1f8b52,_0x1c1033){var _0x171f53=_0x1c1033?'c':_0x9329('0xf');_0x1f8b52['left_join'](_0x9329('0x10'),'uc',_0x9329('0x11')+_0x171f53+'.id')['left_join']('cm_contact_has_tags','ct',_0x9329('0x12')+_0x171f53+_0x9329('0x13'))[_0x9329('0x14')](_0x9329('0x15'),'t',_0x9329('0x16'));return _0x1f8b52;}function addFieldsToQuery(_0x523aff,_0x2d999e,_0x1888a6,_0x10658d,_0x4cc89c){var _0x1ee23e=_0x4cc89c?'c':_0x9329('0xf');if(!_0x2d999e){_0x2d999e=['id','firstName',_0x9329('0x17'),_0x9329('0x18'),'mobile',_0x9329('0x19'),_0x9329('0x1a'),_0x9329('0x8'),_0x9329('0x1b'),'createdAt',_0x9329('0x1c'),'deletedAt',_0x9329('0x1d')];}var _0x1b5eed=_0x1888a6&&_0x4cc89c||!_0x1888a6&&!_0x4cc89c;if(_0x10658d){_0x1b5eed=_0x10658d&&_0x4cc89c||!_0x10658d&&!_0x4cc89c;}_0x2d999e['forEach'](function(_0x41db73){if(_0x41db73===_0x9329('0x1d')){if(_0x1b5eed){_0x523aff['field'](_0x9329('0x1e'),_0x41db73);}else if(_0x1888a6||_0x10658d){_0x523aff['field'](_0x1ee23e+'.'+_0x41db73);}}else{_0x523aff[_0x9329('0x1f')](_0x1ee23e+'.'+_0x41db73);}});return _0x523aff;}function getSqlClauses(){var _0x488ddc={'default':squel[_0x9329('0x20')](),'fields':squel['expr'](),'filter':squel[_0x9329('0x20')](),'tags':{'clause':squel[_0x9329('0x20')](),'ids':null},'user':{'clause':squel[_0x9329('0x20')](),'skip':![]}};return _0x488ddc;}function parseTagParameter(_0x1dbebc){var _0x9da9e1=squel[_0x9329('0x20')]();if(_0x1dbebc){var _0x4a7039=utils[_0x9329('0x21')](_0x1dbebc);_0x4a7039[_0x9329('0x22')](function(_0x387d7d){_0x9da9e1['or'](_0x9329('0x23'),'%,'+_0x387d7d+',%');});}return _0x9da9e1;}function parseSearchFilter(_0x26f8a7){var _0x59fb85=squel[_0x9329('0x20')]();if(_0x26f8a7){var _0x46019b=_0x26f8a7['replace']('\x5c','\x5c\x5c')[_0x9329('0x24')](/'/g,'\x27\x27');if(_0x46019b[_0x9329('0x25')]('\x20')[_0x9329('0x26')]>0x1){_0x59fb85['or'](_0x9329('0x27'),qs['getFullTextValue'](_0x46019b),null);}else{if(qs['isNumeric'](_0x46019b)){_0x59fb85['or'](_0x9329('0x28'),_0x46019b+'%');_0x59fb85['or'](_0x9329('0x29'),_0x46019b+'%');_0x59fb85['or'](_0x9329('0x2a'),_0x46019b+'%');_0x59fb85['or']('c.fax\x20LIKE\x20?',_0x46019b+'%');}else if(qs[_0x9329('0x2b')](_0x46019b)){_0x59fb85['or']('c.email\x20LIKE\x20?',_0x46019b+'%');}else{_0x59fb85['or'](_0x9329('0x2c'),'%'+_0x46019b+'%');_0x59fb85['or'](_0x9329('0x2d'),'%'+_0x46019b+'%');_0x59fb85['or'](_0x9329('0x2e'),'%'+_0x46019b+'%');}}}return _0x59fb85;}function parseAdvancedSearchFilter(_0x573209,_0x57ba4b){var _0x36765a=getSqlClauses();var _0x49d501=as[_0x9329('0x2f')](_0x573209);var _0x4a5d27=_0x49d501[_0x9329('0x30')];for(var _0x4a3c13=0x0;_0x4a3c13<_0x49d501[_0x9329('0x31')][_0x9329('0x26')];_0x4a3c13++){var _0x5cd7db=_0x49d501[_0x9329('0x31')][_0x4a3c13];var _0x27501e='c';var _0x591cac=_[_0x9329('0x32')](_0x57ba4b,[_0x9329('0x33'),_0x5cd7db[_0x9329('0x1f')]]);if(_0x591cac){if(_0x5cd7db[_0x9329('0x1f')]==='dateOfBirth'||_0x591cac['fieldType']==='datetime'){_0x5cd7db[_0x9329('0x34')]='DATE';}var _0x4b4b0d=as['buildExpression'](_0x27501e,_0x591cac[_0x9329('0x35')],_0x5cd7db);_0x36765a[_0x9329('0x36')][_0x4a5d27](_0x4b4b0d['text'],_0x4b4b0d[_0x9329('0x37')][_0x9329('0x38')],_0x4b4b0d[_0x9329('0x37')][_0x9329('0x39')]);}else{if(_0x5cd7db['field']===_0x9329('0x3a')){var _0x3e010a=_0x5cd7db[_0x9329('0x37')][_0x9329('0x25')](',')[_0x9329('0x3b')](function(_0x502fa2){return Number(_0x502fa2);});var _0x503f00=parseTagParameter(_0x3e010a);_0x36765a[_0x9329('0x3c')][_0x9329('0x3d')][_0x9329('0x3e')](_0x503f00);_0x36765a[_0x9329('0x3c')][_0x9329('0x3f')]=_0x3e010a;}else if(_0x5cd7db[_0x9329('0x1f')]===_0x9329('0x40')){_0x36765a[_0x9329('0x41')]['clause'][_0x9329('0x3e')]('uc.UserId\x20=\x20?',_0x5cd7db[_0x9329('0x37')]);_0x36765a[_0x9329('0x41')][_0x9329('0x42')]=!![];}}}return _0x36765a;}function parseModelFields(_0x2c7588,_0x71e99){var _0x42b47c=squel['expr']();var _0x5e8cb3=_(_0x2c7588)[_0x9329('0x43')]()[_0x9329('0x3b')](function(_0x412a01){return _[_0x9329('0x44')](_0x71e99,[_0x9329('0x33'),_0x412a01])?_0x412a01:undefined;})[_0x9329('0x45')]()[_0x9329('0x37')]();if(_0x2c7588[_0x9329('0x46')]){_0x5e8cb3['push'](_0x9329('0x46'));}if(_0x5e8cb3[_0x9329('0x26')]>0x0){_0x5e8cb3[_0x9329('0x22')](function(_0x302a27){if(_0x302a27==='ListId'){_0x42b47c[_0x9329('0x3e')]('c.ListId\x20IN\x20?',[][_0x9329('0x47')](_0x2c7588[_0x302a27]));}else if(_0x302a27==='Contact'){var _0x1a6009='%'+_0x2c7588[_0x302a27]+'%';_0x42b47c['and'](_0x9329('0x48'),_0x1a6009);}else{_0x42b47c[_0x9329('0x3e')]('c.'+_0x302a27+_0x9329('0x49'),_0x2c7588[_0x302a27]);}});}return _0x42b47c;}function parseQueryParameters(_0x222e33,_0x4b5b1c){var _0x1375d8=getSqlClauses();return Promise[_0x9329('0x4a')]()[_0x9329('0x4b')](function(){return parseModelFields(_0x222e33,_0x4b5b1c);})[_0x9329('0x4b')](function(_0x2c8092){_0x1375d8[_0x9329('0x4c')][_0x9329('0x3e')](_0x2c8092);return parseTagParameter(_0x222e33['tag']);})[_0x9329('0x4b')](function(_0x334063){_0x1375d8[_0x9329('0x3c')][_0x9329('0x3d')][_0x9329('0x3e')](_0x334063);return parseSearchFilter(_0x222e33['filter']);})[_0x9329('0x4b')](function(_0x2df7b1){_0x1375d8[_0x9329('0x4d')]=_0x2df7b1;return _0x1375d8;});}function checkListsRestrictions(_0x3e61f6,_0x44303c,_0x32d843){var _0xbfcd0=squel[_0x9329('0x20')]();return Promise['resolve']()['then'](function(){if(_0x44303c[_0x9329('0x7')]&&_0x3e61f6['role']===_0x9329('0x6')&&!_0x32d843){return _0x3e61f6[_0x9329('0x4e')]({'attributes':['id'],'raw':!![]});}})[_0x9329('0x4b')](function(_0x21ef40){if(_0x21ef40){if(_0x21ef40[_0x9329('0x26')]===0x0){_0xbfcd0[_0x9329('0x3e')](_0x9329('0x4f'));}else{_0xbfcd0[_0x9329('0x3e')](_0x9329('0x50'),_[_0x9329('0x3b')](_0x21ef40,'id'));}}})[_0x9329('0x4b')](function(){return _0xbfcd0;});}function buildContactsQuery(_0xe53d6d,_0x549ae6,_0x545ec9,_0x8e26ce,_0x494060,_0x3655fb){if(_0x549ae6){_0x549ae6=_0x545ec9[_0x9329('0x51')];}_0xe53d6d=addFieldsToQuery(_0xe53d6d,_0x549ae6,_0x8e26ce,_0x3655fb,!![]);var _0x4eb931=squel[_0x9329('0xb')]();_0x4eb931=addFieldsToQuery(_0x4eb931,_0x549ae6,_0x8e26ce,_0x3655fb,![]);if(_0x8e26ce||_0x3655fb){_0xe53d6d=applyJoinClauses(_0xe53d6d,!![]);_0xe53d6d[_0x9329('0x52')](_0x9329('0x53'));if(_0x545ec9['limit']){_0x4eb931[_0x9329('0x54')](_0x545ec9[_0x9329('0x54')]);}if(_0x545ec9[_0x9329('0x55')]){_0x4eb931['offset'](_0x545ec9[_0x9329('0x55')]);}}else{_0x4eb931=applyJoinClauses(_0x4eb931,![]);_0x4eb931[_0x9329('0x52')](_0x9329('0x56'));if(_0x545ec9['limit']){_0xe53d6d[_0x9329('0x54')](_0x545ec9[_0x9329('0x54')]);}if(_0x545ec9[_0x9329('0x55')]){_0xe53d6d[_0x9329('0x55')](_0x545ec9[_0x9329('0x55')]);}}_0x4eb931['having'](_0x494060);if(_0x545ec9[_0x9329('0x57')]){_0x545ec9[_0x9329('0x57')][_0x9329('0x22')](function(_0x105736){_0xe53d6d[_0x9329('0x57')]('c.'+_0x105736[0x0],_0x105736[0x1]===_0x9329('0x58')?![]:!![]);_0x4eb931[_0x9329('0x57')](_0x9329('0x59')+_0x105736[0x0],_0x105736[0x1]===_0x9329('0x58')?![]:!![]);});}_0x4eb931['from'](_0xe53d6d,_0x9329('0xf'));return _0x4eb931;}function getFilteredContacts(_0x19e072){var _0x3d0246=[];return db[_0x9329('0x3a')][_0x9329('0x5a')]({'attributes':['id',_0x9329('0x33'),_0x9329('0x5b')],'raw':!![]})['then'](function(_0x136582){_0x3d0246=_[_0x9329('0x5c')](_0x136582,'id');var _0x55a884={'type':db[_0x9329('0x5d')][_0x9329('0x5e')][_0x9329('0x5f')],'model':db[_0x9329('0x60')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x9329('0x61')][_0x9329('0x62')](_0x19e072[_0x9329('0x63')](),_0x55a884);})[_0x9329('0x4b')](function(_0x113c99){_0x113c99[_0x9329('0x22')](function(_0x3551b5){if(_0x3551b5[_0x9329('0x1d')]){_0x3551b5[_0x9329('0x64')]=[];_0x3551b5['TagIds']['split'](',')[_0x9329('0x22')](function(_0x23ff72){_0x3551b5[_0x9329('0x64')][_0x9329('0x65')](_0x3d0246[_0x23ff72]);});}delete _0x3551b5[_0x9329('0x1d')];});return _0x113c99;});}function countFilteredContacts(_0x57c631,_0x3c385c){var _0x3ebf93=_0x57c631[_0x9329('0x66')]();_0x3ebf93['field'](_0x9329('0x67'));_0x3ebf93=applyJoinClauses(_0x3ebf93,!![]);_0x57c631[_0x9329('0x52')]('c.id');var _0x51e32b=utils[_0x9329('0x21')](_0x3c385c);if(!_[_0x9329('0x68')](_0x51e32b)){_0x3ebf93[_0x9329('0x69')](_0x9329('0x6a'),_0x51e32b);}var _0x3bbf71={'type':db[_0x9329('0x5d')][_0x9329('0x5e')][_0x9329('0x5f')],'raw':!![]};return db['sequelize'][_0x9329('0x62')](_0x3ebf93[_0x9329('0x63')](),_0x3bbf71)[_0x9329('0x4b')](function(_0x7a888d){return _0x7a888d[0x0]['COUNT(*)'];});}module['exports']={'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 49e5738..b3ae78b 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 _0xaf11=['data','close','encryptString','secret','base64','utf8','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','update','binary','write','end','final','unlink','decryptFile'];(function(_0x52eff6,_0x17fa13){var _0x10d8f0=function(_0x2b675d){while(--_0x2b675d){_0x52eff6['push'](_0x52eff6['shift']());}};_0x10d8f0(++_0x17fa13);}(_0xaf11,0xb5));var _0x1af1=function(_0xb7e0c6,_0x249be0){_0xb7e0c6=_0xb7e0c6-0x0;var _0x41c51b=_0xaf11[_0xb7e0c6];return _0x41c51b;};'use strict';var crypto=require(_0x1af1('0x0'));var fs=require('fs');var BPromise=require(_0x1af1('0x1'));var _=require(_0x1af1('0x2'));var config=require(_0x1af1('0x3'));var logger=require(_0x1af1('0x4'))(_0x1af1('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x1af1('0x6')][_0x1af1('0x7')],'algorithm':_0x1af1('0x8')};const fileOptions={'algorithm':'aes192'};if(config[_0x1af1('0x9')]&&config[_0x1af1('0x9')][_0x1af1('0xa')]){var isSupported=isAlgorithmSupported(config[_0x1af1('0x9')][_0x1af1('0xa')]);if(isSupported){fileOptions[_0x1af1('0xa')]=config[_0x1af1('0x9')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x1af1('0xb')](',\x20');logger['error'](config[_0x1af1('0x9')]['algorithm'],_0x1af1('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x1683c9){return AES_SUPPORTED_RX[_0x1af1('0xd')](_0x1683c9);}function getSupportedCiphers(){return crypto[_0x1af1('0xe')]()[_0x1af1('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x2c6fae){return getSupportedCiphers()[_0x1af1('0x10')](_0x2c6fae)>-0x1;}function combineOptions(_0x4154f5){var _0x9b27bc={};for(var _0x51ac08 in fileOptions){if(fileOptions[_0x1af1('0x11')](_0x51ac08)){_0x9b27bc[_0x51ac08]=fileOptions[_0x51ac08];}}if(_0x4154f5){for(var _0x2cbd23 in _0x4154f5){if(_0x4154f5[_0x1af1('0x11')](_0x2cbd23)){_0x9b27bc[_0x2cbd23]=_0x4154f5[_0x2cbd23];}}}return _0x9b27bc;}exports[_0x1af1('0x12')]=function(_0x4de97e,_0x336c89,_0x324e99,_0x41e2c2){return new BPromise(function(_0x3da40b,_0x418438){_0x41e2c2=combineOptions(_0x41e2c2);var _0x22a041=new Buffer(_0x324e99);var _0x880c0f=fs[_0x1af1('0x13')](_0x4de97e);var _0x56ed66=fs[_0x1af1('0x14')](_0x336c89);var _0x57a582=crypto[_0x1af1('0x15')](_0x41e2c2[_0x1af1('0xa')],_0x22a041);_0x880c0f['on']('data',function(_0x2af45d){var _0x3a84aa=new Buffer(_0x57a582[_0x1af1('0x16')](_0x2af45d),_0x1af1('0x17'));_0x56ed66[_0x1af1('0x18')](_0x3a84aa);});_0x880c0f['on'](_0x1af1('0x19'),function(){try{var _0x33593b=new Buffer(_0x57a582[_0x1af1('0x1a')](_0x1af1('0x17')),_0x1af1('0x17'));_0x56ed66[_0x1af1('0x18')](_0x33593b);_0x56ed66[_0x1af1('0x19')]();_0x56ed66['on']('close',function(){return _0x3da40b(_0x336c89);});}catch(_0x29f4f6){fs[_0x1af1('0x1b')](_0x336c89);return _0x418438(_0x29f4f6);}});});};exports[_0x1af1('0x1c')]=function(_0x19eff1,_0x469ad,_0x31535f,_0x2a6cd5){return new BPromise(function(_0x4d7d69,_0x5f1292){_0x2a6cd5=combineOptions(_0x2a6cd5);var _0x4f0b3b=new Buffer(_0x31535f);var _0x103bdb=fs['createReadStream'](_0x19eff1);var _0x43106c=fs[_0x1af1('0x14')](_0x469ad);var _0x22900b=crypto['createDecipher'](_0x2a6cd5[_0x1af1('0xa')],_0x4f0b3b);_0x103bdb['on'](_0x1af1('0x1d'),function(_0x115339){var _0x4f001b=new Buffer(_0x22900b[_0x1af1('0x16')](_0x115339),'binary');_0x43106c[_0x1af1('0x18')](_0x4f001b);});_0x103bdb['on'](_0x1af1('0x19'),function(){try{var _0xf3400b=new Buffer(_0x22900b['final'](_0x1af1('0x17')),_0x1af1('0x17'));_0x43106c[_0x1af1('0x18')](_0xf3400b);_0x43106c[_0x1af1('0x19')]();_0x43106c['on'](_0x1af1('0x1e'),function(){return _0x4d7d69(_0x469ad);});}catch(_0xe3a1d4){fs[_0x1af1('0x1b')](_0x469ad);return _0x5f1292(_0xe3a1d4);}});});};exports[_0x1af1('0x1f')]=function(_0x256810,_0x487a8a,_0x105f96){var _0x591388=_0x105f96||stringOptions[_0x1af1('0xa')];var _0x56c6f5=_0x487a8a||stringOptions[_0x1af1('0x20')];var _0x1ea43c=crypto[_0x1af1('0x15')](_0x591388,_0x56c6f5);var _0x3a0491=_0x1ea43c[_0x1af1('0x16')](_0x256810,'utf8',_0x1af1('0x21'));_0x3a0491+=_0x1ea43c['final'](_0x1af1('0x21'));return _0x3a0491;};exports['decryptString']=function(_0x1ec097,_0x50a7ac,_0x380527){var _0x57ce18=_0x380527||stringOptions['algorithm'];var _0xd34718=_0x50a7ac||stringOptions[_0x1af1('0x20')];var _0x1fbfcd=crypto['createDecipher'](_0x57ce18,_0xd34718);var _0x2381cd=_0x1fbfcd[_0x1af1('0x16')](_0x1ec097,_0x1af1('0x21'),_0x1af1('0x22'));_0x2381cd+=_0x1fbfcd[_0x1af1('0x1a')](_0x1af1('0x22'));return _0x2381cd;}; \ No newline at end of file +var _0x967a=['base64','crypto','bluebird','lodash','app','secrets','session','aes-256-ctr','encrypt','algorithm','test','getCiphers','filter','encryptFile','createWriteStream','data','update','binary','write','final','end','close','unlink','decryptFile','createReadStream','createDecipher','encryptString','secret','createCipher','utf8'];(function(_0x8ab57e,_0x240682){var _0x52ad27=function(_0x457331){while(--_0x457331){_0x8ab57e['push'](_0x8ab57e['shift']());}};_0x52ad27(++_0x240682);}(_0x967a,0x1c3));var _0xa967=function(_0x5c7c7d,_0x1e6921){_0x5c7c7d=_0x5c7c7d-0x0;var _0x17d0a8=_0x967a[_0x5c7c7d];return _0x17d0a8;};'use strict';var crypto=require(_0xa967('0x0'));var fs=require('fs');var BPromise=require(_0xa967('0x1'));var _=require(_0xa967('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xa967('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xa967('0x4')][_0xa967('0x5')],'algorithm':_0xa967('0x6')};const fileOptions={'algorithm':'aes192'};if(config[_0xa967('0x7')]&&config[_0xa967('0x7')][_0xa967('0x8')]){var isSupported=isAlgorithmSupported(config[_0xa967('0x7')][_0xa967('0x8')]);if(isSupported){fileOptions['algorithm']=config[_0xa967('0x7')][_0xa967('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger['error'](config[_0xa967('0x7')][_0xa967('0x8')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x29ede7){return AES_SUPPORTED_RX[_0xa967('0x9')](_0x29ede7);}function getSupportedCiphers(){return crypto[_0xa967('0xa')]()[_0xa967('0xb')](isASupportedCipher);}function isAlgorithmSupported(_0x1d9812){return getSupportedCiphers()['indexOf'](_0x1d9812)>-0x1;}function combineOptions(_0x9ab1be){var _0x5a1b35={};for(var _0x453d7f in fileOptions){if(fileOptions['hasOwnProperty'](_0x453d7f)){_0x5a1b35[_0x453d7f]=fileOptions[_0x453d7f];}}if(_0x9ab1be){for(var _0x355c3f in _0x9ab1be){if(_0x9ab1be['hasOwnProperty'](_0x355c3f)){_0x5a1b35[_0x355c3f]=_0x9ab1be[_0x355c3f];}}}return _0x5a1b35;}exports[_0xa967('0xc')]=function(_0x3ef649,_0x32e93d,_0x23f7cc,_0x139b97){return new BPromise(function(_0xc14843,_0x2b5618){_0x139b97=combineOptions(_0x139b97);var _0x5fb406=new Buffer(_0x23f7cc);var _0x17ec96=fs['createReadStream'](_0x3ef649);var _0x274a7c=fs[_0xa967('0xd')](_0x32e93d);var _0x527423=crypto['createCipher'](_0x139b97['algorithm'],_0x5fb406);_0x17ec96['on'](_0xa967('0xe'),function(_0x2e1a62){var _0x1abb87=new Buffer(_0x527423[_0xa967('0xf')](_0x2e1a62),_0xa967('0x10'));_0x274a7c[_0xa967('0x11')](_0x1abb87);});_0x17ec96['on']('end',function(){try{var _0x97adef=new Buffer(_0x527423[_0xa967('0x12')](_0xa967('0x10')),'binary');_0x274a7c[_0xa967('0x11')](_0x97adef);_0x274a7c[_0xa967('0x13')]();_0x274a7c['on'](_0xa967('0x14'),function(){return _0xc14843(_0x32e93d);});}catch(_0x5d4091){fs[_0xa967('0x15')](_0x32e93d);return _0x2b5618(_0x5d4091);}});});};exports[_0xa967('0x16')]=function(_0x4e96ec,_0x10da7a,_0x412211,_0x438f5a){return new BPromise(function(_0xe87332,_0x557402){_0x438f5a=combineOptions(_0x438f5a);var _0x10830c=new Buffer(_0x412211);var _0x21cbb5=fs[_0xa967('0x17')](_0x4e96ec);var _0x4281ed=fs[_0xa967('0xd')](_0x10da7a);var _0x1fbff4=crypto[_0xa967('0x18')](_0x438f5a[_0xa967('0x8')],_0x10830c);_0x21cbb5['on'](_0xa967('0xe'),function(_0x5de38e){var _0x43f1ec=new Buffer(_0x1fbff4[_0xa967('0xf')](_0x5de38e),_0xa967('0x10'));_0x4281ed['write'](_0x43f1ec);});_0x21cbb5['on'](_0xa967('0x13'),function(){try{var _0x4488f9=new Buffer(_0x1fbff4[_0xa967('0x12')]('binary'),'binary');_0x4281ed[_0xa967('0x11')](_0x4488f9);_0x4281ed['end']();_0x4281ed['on'](_0xa967('0x14'),function(){return _0xe87332(_0x10da7a);});}catch(_0x2d2680){fs['unlink'](_0x10da7a);return _0x557402(_0x2d2680);}});});};exports[_0xa967('0x19')]=function(_0x3558ad,_0x13e679,_0x314616){var _0x6b73d5=_0x314616||stringOptions[_0xa967('0x8')];var _0x4dcb1f=_0x13e679||stringOptions[_0xa967('0x1a')];var _0x382051=crypto[_0xa967('0x1b')](_0x6b73d5,_0x4dcb1f);var _0x46fa30=_0x382051[_0xa967('0xf')](_0x3558ad,_0xa967('0x1c'),_0xa967('0x1d'));_0x46fa30+=_0x382051['final'](_0xa967('0x1d'));return _0x46fa30;};exports['decryptString']=function(_0x5f3a92,_0x3ca65c,_0x2fcf10){var _0x17c2fa=_0x2fcf10||stringOptions['algorithm'];var _0x1407da=_0x3ca65c||stringOptions['secret'];var _0x1a7119=crypto['createDecipher'](_0x17c2fa,_0x1407da);var _0x3d4732=_0x1a7119[_0xa967('0xf')](_0x5f3a92,'base64',_0xa967('0x1c'));_0x3d4732+=_0x1a7119['final'](_0xa967('0x1c'));return _0x3d4732;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 8100c7d..4daa30e 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 _0x618e=['SELECT','Empty','length','range','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','mkdirSync','join','each','%s%d.%s','csv','zip','zip\x20finished','info','CSV','Completed','%s.%s','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','util','path','rimraf','../../mysqldb','dbH','savename','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','split','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes'];(function(_0x3a59f8,_0x6a5f86){var _0x3065f6=function(_0x3ef689){while(--_0x3ef689){_0x3a59f8['push'](_0x3a59f8['shift']());}};_0x3065f6(++_0x6a5f86);}(_0x618e,0x157));var _0xe618=function(_0x556c24,_0x55b7f5){_0x556c24=_0x556c24-0x0;var _0x105a99=_0x618e[_0x556c24];return _0x105a99;};'use strict';var util=require(_0xe618('0x0'));var path=require(_0xe618('0x1'));var _=require('lodash');var csv=require('to-csv');var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0xe618('0x2'));var db=require(_0xe618('0x3'))['db'];var dbH=require('../../mysqldb')[_0xe618('0x4')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5edcfe,_0x2953e4){var _0x2cab21={'status':_0x5edcfe};var _0x347039={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2953e4){_0x2cab21[_0xe618('0x5')]=_0x2953e4;}return db[_0xe618('0x6')]['update'](_0x2cab21,_0x347039);}function main(){var _0x53f024=0x1388;var _0x49bf02;logger['info'](util[_0xe618('0x7')](_0xe618('0x8'),EXTRACTED_REPORT_ID,'CSV'));return db[_0xe618('0x9')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe618('0xa'),_0xe618('0xb')]})['then'](function(_0x536185){if(_0x536185){_0x49bf02=_0x536185;_0x53f024=_0x49bf02[_0xe618('0xb')]||0x1388;}})[_0xe618('0xc')](function(){return dbH['sequelize'][_0xe618('0xd')](util['format'](_0xe618('0xe'),QUERY),{'type':dbH[_0xe618('0xf')][_0xe618('0x10')][_0xe618('0x11')]});})[_0xe618('0xc')](function(_0x1852db){if(!_0x1852db[0x0]['num']){return analyticExtractedReport(_0xe618('0x12'));}var _0x54e13b=[];var _0x17ba56=0x0;if(_0x49bf02[_0xe618('0xa')]){if(_0x1852db&&_0x1852db[_0xe618('0x13')]){var _0x5b9396=_[_0xe618('0x14')](_0x1852db[0x0][_0xe618('0x15')]/_0x53f024);var _0x9726e8=Number[_0xe618('0x16')](_0x1852db[0x0][_0xe618('0x15')]/_0x53f024)?_0x1852db[0x0][_0xe618('0x15')]%_0x53f024:0x0;_0x5b9396[_0xe618('0x17')](function(_0x3b9139){if(_0x3b9139>0x0){_0x17ba56+=_0x53f024;}_0x54e13b[_0xe618('0x18')](dbH[_0xe618('0xf')][_0xe618('0xd')](util[_0xe618('0x7')](_0xe618('0x19'),QUERY,_0x53f024,_0x17ba56),{'type':dbH[_0xe618('0xf')]['QueryTypes'][_0xe618('0x11')]}));});if(_0x9726e8>0x0){_0x17ba56+=_0x53f024;_0x54e13b[_0xe618('0x18')](dbH[_0xe618('0xf')]['query'](util[_0xe618('0x7')](_0xe618('0x19'),QUERY,_0x9726e8,_0x17ba56),{'type':dbH['sequelize']['QueryTypes'][_0xe618('0x11')]}));}}}else{_0x54e13b[_0xe618('0x18')](dbH[_0xe618('0xf')][_0xe618('0xd')](QUERY,{'type':dbH[_0xe618('0xf')]['QueryTypes'][_0xe618('0x11')]}));}var _0x4613d8=path[_0xe618('0x1a')](PATH);var _0x3a896a=path[_0xe618('0x1b')](PATH,_0xe618('0x1c'));var _0x47a37e=_0x49bf02[_0xe618('0xa')]&&_0x54e13b[_0xe618('0x13')]>0x1;var _0x533d0e=[];if(!fs['existsSync'](path['join'](_0x4613d8,_0x3a896a))&&_0x47a37e){fs[_0xe618('0x1d')](path[_0xe618('0x1e')](_0x4613d8,_0x3a896a));}return BPromise[_0xe618('0x1f')](_0x54e13b,function(_0x369a27){_0x533d0e[_0xe618('0x18')](_0x369a27);})['then'](function(){for(var _0x385fe5=0x0;_0x385fe5<_0x533d0e[_0xe618('0x13')];_0x385fe5+=0x1){var _0x3a26ba;var _0x588555=_0x533d0e[_0x385fe5];if(_0x47a37e){_0x3a26ba=path[_0xe618('0x1e')](_0x4613d8,_0x3a896a,util[_0xe618('0x7')](_0xe618('0x20'),_0x3a896a,_0x385fe5,_0xe618('0x21')));}else{_0x3a26ba=path['join'](_0x4613d8,util[_0xe618('0x7')]('%s.%s',_0x3a896a,_0xe618('0x21')));}fs['writeFileSync'](_0x3a26ba,csv(_0x588555));}})[_0xe618('0xc')](function(){if(_0x47a37e){return new Promise(function(_0x19ce5a){zipdir(path[_0xe618('0x1e')](_0x4613d8,_0x3a896a),{'saveTo':path[_0xe618('0x1e')](_0x4613d8,util['format']('%s.%s',_0x3a896a,_0xe618('0x22')))},function(_0x5c1fc2,_0x67438d){rimraf(path[_0xe618('0x1e')](_0x4613d8,_0x3a896a),function(){});_0x19ce5a(_0xe618('0x23'));});});}})['then'](function(){logger[_0xe618('0x24')](util[_0xe618('0x7')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xe618('0x25')));return analyticExtractedReport(_0xe618('0x26'),_0x47a37e?util['format'](_0xe618('0x27'),_0x3a896a,_0x47a37e?_0xe618('0x22'):_0xe618('0x21')):null);});})[_0xe618('0x28')](function(_0x3d67e6){logger[_0xe618('0x24')](util[_0xe618('0x7')](_0xe618('0x29'),EXTRACTED_REPORT_ID,_0xe618('0x25')),util[_0xe618('0x2a')](_0x3d67e6,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xe618('0x2b')](function(){process[_0xe618('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xabdd=['range','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.csv','existsSync','each','join','%s%d.%s','csv','writeFileSync','%s.%s','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','exit','util','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','analytics','argv','savename','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','then','splitSizeCsv','sequelize','QueryTypes','SELECT','num','Empty','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabdd,0x1bf));var _0xdabd=function(_0x5d2237,_0x5eecf5){_0x5d2237=_0x5d2237-0x0;var _0x13c396=_0xabdd[_0x5d2237];return _0x13c396;};'use strict';var util=require(_0xdabd('0x0'));var path=require('path');var _=require('lodash');var csv=require(_0xdabd('0x1'));var fs=require('fs');var BPromise=require(_0xdabd('0x2'));var zipdir=require(_0xdabd('0x3'));var rimraf=require(_0xdabd('0x4'));var db=require(_0xdabd('0x5'))['db'];var dbH=require(_0xdabd('0x5'))['dbH'];var logger=require('../../config/logger')(_0xdabd('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xdabd('0x7')][0x2]);var QUERY=process[_0xdabd('0x7')][0x3];var PATH=process[_0xdabd('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xf4e82f,_0x2bc2b3){var _0x56eece={'status':_0xf4e82f};var _0xc7f61={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2bc2b3){_0x56eece[_0xdabd('0x8')]=_0x2bc2b3;}return db['AnalyticExtractedReport']['update'](_0x56eece,_0xc7f61);}function main(){var _0x21af98=0x1388;var _0x21503e;logger['info'](util[_0xdabd('0x9')](_0xdabd('0xa'),EXTRACTED_REPORT_ID,_0xdabd('0xb')));return db[_0xdabd('0xc')][_0xdabd('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xdabd('0xe'),'splitSizeCsv']})[_0xdabd('0xf')](function(_0x1c3c6c){if(_0x1c3c6c){_0x21503e=_0x1c3c6c;_0x21af98=_0x21503e[_0xdabd('0x10')]||0x1388;}})[_0xdabd('0xf')](function(){return dbH[_0xdabd('0x11')]['query'](util[_0xdabd('0x9')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xdabd('0x11')][_0xdabd('0x12')][_0xdabd('0x13')]});})['then'](function(_0x37c90f){if(!_0x37c90f[0x0][_0xdabd('0x14')]){return analyticExtractedReport(_0xdabd('0x15'));}var _0x5c0c79=[];var _0x524e71=0x0;if(_0x21503e[_0xdabd('0xe')]){if(_0x37c90f&&_0x37c90f[_0xdabd('0x16')]){var _0x3260f9=_[_0xdabd('0x17')](_0x37c90f[0x0][_0xdabd('0x14')]/_0x21af98);var _0x1ac4f4=Number[_0xdabd('0x18')](_0x37c90f[0x0][_0xdabd('0x14')]/_0x21af98)?_0x37c90f[0x0][_0xdabd('0x14')]%_0x21af98:0x0;_0x3260f9[_0xdabd('0x19')](function(_0x11b1e2){if(_0x11b1e2>0x0){_0x524e71+=_0x21af98;}_0x5c0c79[_0xdabd('0x1a')](dbH[_0xdabd('0x11')][_0xdabd('0x1b')](util[_0xdabd('0x9')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x21af98,_0x524e71),{'type':dbH['sequelize'][_0xdabd('0x12')][_0xdabd('0x13')]}));});if(_0x1ac4f4>0x0){_0x524e71+=_0x21af98;_0x5c0c79[_0xdabd('0x1a')](dbH[_0xdabd('0x11')]['query'](util[_0xdabd('0x9')](_0xdabd('0x1c'),QUERY,_0x1ac4f4,_0x524e71),{'type':dbH[_0xdabd('0x11')][_0xdabd('0x12')][_0xdabd('0x13')]}));}}}else{_0x5c0c79[_0xdabd('0x1a')](dbH[_0xdabd('0x11')][_0xdabd('0x1b')](QUERY,{'type':dbH[_0xdabd('0x11')][_0xdabd('0x12')][_0xdabd('0x13')]}));}var _0x50992d=path[_0xdabd('0x1d')](PATH);var _0x1ec2c1=path['basename'](PATH,_0xdabd('0x1e'));var _0x27e2ca=_0x21503e[_0xdabd('0xe')]&&_0x5c0c79['length']>0x1;var _0x5af6a4=[];if(!fs[_0xdabd('0x1f')](path['join'](_0x50992d,_0x1ec2c1))&&_0x27e2ca){fs['mkdirSync'](path['join'](_0x50992d,_0x1ec2c1));}return BPromise[_0xdabd('0x20')](_0x5c0c79,function(_0x5e1c6b){_0x5af6a4[_0xdabd('0x1a')](_0x5e1c6b);})[_0xdabd('0xf')](function(){for(var _0x13aa7f=0x0;_0x13aa7f<_0x5af6a4['length'];_0x13aa7f+=0x1){var _0x1fab24;var _0x457f4d=_0x5af6a4[_0x13aa7f];if(_0x27e2ca){_0x1fab24=path[_0xdabd('0x21')](_0x50992d,_0x1ec2c1,util[_0xdabd('0x9')](_0xdabd('0x22'),_0x1ec2c1,_0x13aa7f,_0xdabd('0x23')));}else{_0x1fab24=path[_0xdabd('0x21')](_0x50992d,util[_0xdabd('0x9')]('%s.%s',_0x1ec2c1,_0xdabd('0x23')));}fs[_0xdabd('0x24')](_0x1fab24,csv(_0x457f4d));}})[_0xdabd('0xf')](function(){if(_0x27e2ca){return new Promise(function(_0x3ff04f){zipdir(path[_0xdabd('0x21')](_0x50992d,_0x1ec2c1),{'saveTo':path[_0xdabd('0x21')](_0x50992d,util['format'](_0xdabd('0x25'),_0x1ec2c1,'zip'))},function(_0x442d54,_0x5786e8){rimraf(path[_0xdabd('0x21')](_0x50992d,_0x1ec2c1),function(){});_0x3ff04f(_0xdabd('0x26'));});});}})[_0xdabd('0xf')](function(){logger['info'](util[_0xdabd('0x9')](_0xdabd('0x27'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xdabd('0x28'),_0x27e2ca?util[_0xdabd('0x9')](_0xdabd('0x25'),_0x1ec2c1,_0x27e2ca?_0xdabd('0x29'):_0xdabd('0x23')):null);});})[_0xdabd('0x2a')](function(_0x5c4f38){logger[_0xdabd('0x2b')](util[_0xdabd('0x9')](_0xdabd('0x2c'),EXTRACTED_REPORT_ID,'CSV'),util['inspect'](_0x5c4f38,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xdabd('0x2d'));})['finally'](function(){process[_0xdabd('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 6f0e944..042ad3b 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 _0x505a=['isInteger','query','QueryTypes','SELECT','sequelize','dirname','basename','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','pdf','%s.%s','all','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','error','end','createPdfFromHTML','catch','path','moment','pdfmake/src/printer','zip-dir','rimraf','jsdom','../../mysqldb','dbH','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','pick','toString','length','auto','body','push','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','header','pageBreak','margin','footer','Arial','black','right','Setting','find','then','splitSizePdf','num'];(function(_0x49f67f,_0x4113a4){var _0x4779a1=function(_0x5064b0){while(--_0x5064b0){_0x49f67f['push'](_0x49f67f['shift']());}};_0x4779a1(++_0x4113a4);}(_0x505a,0x168));var _0xa505=function(_0x50a49e,_0x47639c){_0x50a49e=_0x50a49e-0x0;var _0x5702b5=_0x505a[_0x50a49e];return _0x5702b5;};'use strict';var _=require('lodash');var fs=require('fs');var util=require('util');var path=require(_0xa505('0x0'));var moment=require(_0xa505('0x1'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0xa505('0x2'));var zipdir=require(_0xa505('0x3'));var rimraf=require(_0xa505('0x4'));var JSDOM=require(_0xa505('0x5'))['JSDOM'];var window=new JSDOM('')['window'];var BPromise=require('bluebird');var db=require(_0xa505('0x6'))['db'];var dbH=require(_0xa505('0x6'))[_0xa505('0x7')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xa505('0x8')][0x5];var FORMAT=_0xa505('0x9');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x3a3002,_0x549e20){var _0x23382e={'status':_0x3a3002};var _0xed552e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x549e20){_0x23382e[_0xa505('0xa')]=_0x549e20;}return db[_0xa505('0xb')]['update'](_0x23382e,_0xed552e);}function getHeaders(_0x21aea4){return _[_0xa505('0xc')](_0x21aea4,function(_0x46e8f1){return{'text':_0x46e8f1,'style':_0xa505('0xd')};});}function getRows(_0x1b1645,_0x2abf1d){return _[_0xa505('0xc')](_0x2abf1d,function(_0x45ca21){return _(_0x45ca21)[_0xa505('0xe')](_0x1b1645)[_0xa505('0xc')](function(_0x5f3cd0){return _0x5f3cd0?_[_0xa505('0xf')](_0x5f3cd0):'';})['value']();});}function createTable(_0x1122cf,_0x151134){var _0x2d3870={'widths':_['fill'](Array(_0x1122cf[_0xa505('0x10')]),0x91),'heights':function(_0x15f04c){return _0x15f04c===0x0?_0xa505('0x11'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3c33dd=getHeaders(_0x1122cf);_0x2d3870[_0xa505('0x12')][_0xa505('0x13')](_0x3c33dd);var _0x3077ad=getRows(_0x1122cf,_0x151134);_0x2d3870[_0xa505('0x12')]=_0x2d3870[_0xa505('0x12')][_0xa505('0x14')](_0x3077ad);return _0x2d3870;}function createTables(_0x587249){var _0x520b7e=[];var _0x277e0b=_[_0xa505('0x15')](Object[_0xa505('0x16')](_0x587249[0x0]),0x5);_0x277e0b[_0xa505('0x17')](function(_0x2fcff0){_0x520b7e['push'](createTable(_0x2fcff0,_0x587249));});return _0x520b7e;}function getPDFDocDefinition(_0x21e29a){var _0x26589b=util[_0xa505('0x18')](_0xa505('0x19'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0xa505('0x1a')])[_0xa505('0x18')](FORMAT),moment(EXTRACTED_REPORT[_0xa505('0x1b')])[_0xa505('0x18')](FORMAT));var _0x5844f5=[];for(var _0x3d30ae=0x0;_0x3d30ae<_0x21e29a['length'];_0x3d30ae++){var _0x640e45=[];if(_0x3d30ae===0x0){_0x640e45[_0xa505('0x13')]({'text':_0x26589b,'style':_0xa505('0x1c')});}var _0xa629a4={'table':_0x21e29a[_0x3d30ae]};if(_0x3d30ae>0x0){_0xa629a4[_0xa505('0x1d')]='before';_0xa629a4[_0xa505('0x1e')]=[0x0,0x46,0x0,0x0];}_0x640e45['push'](_0xa629a4);_0x5844f5['push'](_0x640e45);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x5844f5,'footer':function(_0x54b150,_0x5c77fb){return{'text':_0x54b150['toString']()+'\x20/\x20'+_0x5c77fb,'style':_0xa505('0x1f')};},'defaultStyle':{'font':_0xa505('0x20')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xa505('0x21')},'footer':{'alignment':_0xa505('0x22'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2f9c44){var _0x150958=0x1388;var _0x336791;if(!_0x2f9c44[0x0]['num']){return analyticExtractedReport('Empty');}return db[_0xa505('0x23')][_0xa505('0x24')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})[_0xa505('0x25')](function(_0x59fdc3){if(_0x59fdc3){_0x336791=_0x59fdc3;_0x150958=_0x336791[_0xa505('0x26')]||0x3e8;}})['then'](function(){var _0xee80c0=[];var _0x5b919c=0x0;if(_0x336791['split']){if(_0x2f9c44&&_0x2f9c44['length']){var _0x268430=_['range'](_0x2f9c44[0x0][_0xa505('0x27')]/_0x150958);var _0x1a85e0=Number[_0xa505('0x28')](_0x2f9c44[0x0][_0xa505('0x27')]/_0x150958)?_0x2f9c44[0x0]['num']%_0x150958:0x0;_0x268430[_0xa505('0x17')](function(_0x3e9b9b){if(_0x3e9b9b>0x0){_0x5b919c+=_0x150958;}_0xee80c0[_0xa505('0x13')](dbH['sequelize'][_0xa505('0x29')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x150958,_0x5b919c),{'type':dbH['sequelize'][_0xa505('0x2a')][_0xa505('0x2b')]}));});if(_0x1a85e0>0x0){_0x5b919c+=_0x150958;_0xee80c0[_0xa505('0x13')](dbH[_0xa505('0x2c')][_0xa505('0x29')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1a85e0,_0x5b919c),{'type':dbH[_0xa505('0x2c')][_0xa505('0x2a')][_0xa505('0x2b')]}));}}}else{_0xee80c0[_0xa505('0x13')](dbH[_0xa505('0x2c')][_0xa505('0x29')](QUERY,{'type':dbH[_0xa505('0x2c')][_0xa505('0x2a')][_0xa505('0x2b')]}));}var _0xcabcc4=path[_0xa505('0x2d')](PATH);var _0xe4610b=path[_0xa505('0x2e')](PATH,_0xa505('0x2f'));var _0x1d989e=_0x336791['split']&&_0xee80c0[_0xa505('0x10')]>0x1;var _0x4ae3f7=[];if(!fs[_0xa505('0x30')](path[_0xa505('0x31')](_0xcabcc4,_0xe4610b))&&_0x1d989e){fs[_0xa505('0x32')](path[_0xa505('0x31')](_0xcabcc4,_0xe4610b));}return BPromise[_0xa505('0x33')](_0xee80c0,function(_0x1344e8){_0x4ae3f7[_0xa505('0x13')](_0x1344e8);})[_0xa505('0x25')](function(){var _0x30289a=[];for(var _0x469dca=0x0;_0x469dca<_0x4ae3f7[_0xa505('0x10')];_0x469dca+=0x1){var _0x3e4a28=_0x4ae3f7[_0x469dca];var _0x2b437e=createTables(_[_0xa505('0x34')](_0x3e4a28));var _0x25c184;var _0x1a6bc4=getPDFDocDefinition(_0x2b437e);var _0xa53bf=getPDFPrinter();var _0x16567a=_0xa53bf[_0xa505('0x35')](_0x1a6bc4);if(_0x1d989e){_0x25c184=path[_0xa505('0x31')](_0xcabcc4,_0xe4610b,util[_0xa505('0x18')]('%s%d.%s',_0xe4610b,_0x469dca,_0xa505('0x36')));}else{_0x25c184=path[_0xa505('0x31')](_0xcabcc4,util['format'](_0xa505('0x37'),_0xe4610b,_0xa505('0x36')));}_0x30289a[_0xa505('0x13')](writePDFDocument(_0x16567a,_0x25c184));}return Promise[_0xa505('0x38')](_0x30289a);})[_0xa505('0x25')](function(){if(_0x1d989e){return new Promise(function(_0xe308f2){zipdir(path['join'](_0xcabcc4,_0xe4610b),{'saveTo':path[_0xa505('0x31')](_0xcabcc4,util['format']('%s.%s',_0xe4610b,_0xa505('0x39')))},function(){rimraf(path[_0xa505('0x31')](_0xcabcc4,_0xe4610b),function(){});_0xe308f2('zip\x20finished');});});}})[_0xa505('0x25')](function(){if(!_0x1d989e)return;rimraf(path['join'](_0xcabcc4,_0xe4610b),function(){});})['then'](function(){logger[_0xa505('0x3a')](util[_0xa505('0x18')](_0xa505('0x3b'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport('Completed',_0x1d989e?util[_0xa505('0x18')]('%s.%s',_0xe4610b,_0x1d989e?_0xa505('0x39'):_0xa505('0x36')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xa505('0x3a')](util[_0xa505('0x18')](_0xa505('0x3c'),EXTRACTED_REPORT_ID,_0xa505('0x3d')));return db[_0xa505('0xb')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xa505('0x25')](function(_0x4f3d0b){EXTRACTED_REPORT=_0x4f3d0b;return dbH[_0xa505('0x2c')][_0xa505('0x29')](util['format'](_0xa505('0x3e'),QUERY),{'type':dbH['sequelize'][_0xa505('0x2a')][_0xa505('0x2b')]});})[_0xa505('0x25')](extractReport)['catch'](function(_0x4d98ea){logger[_0xa505('0x3a')](util[_0xa505('0x18')](_0xa505('0x3f'),EXTRACTED_REPORT_ID,_0xa505('0x3d')),util['inspect'](_0x4d98ea,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa505('0x40'));})[_0xa505('0x41')](function(){process[_0xa505('0x42')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x2e9e2c=new PdfPrinter({'Arial':{'normal':__dirname+_0xa505('0x43'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0xa505('0x44'),'bolditalics':__dirname+_0xa505('0x45')}});return _0x2e9e2c;}function getPDFDocDefinitionFromHTML(_0x4ea15e,_0x95044e){var _0x4dc175=util[_0xa505('0x18')](_0xa505('0x46'),_0x95044e[_0xa505('0x47')],_0x95044e['interactionId']);var _0x46c92f=moment()['format']('YYYY-MM-DD')[_0xa505('0xf')]();var _0x3d7a5a=htmlToPdfmake(_0x4ea15e,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3d7a5a],'defaultStyle':{'font':_0xa505('0x20')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xa505('0x48'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xa505('0x48')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0xa505('0x1c')}];},'footer':function(_0x45b8d4,_0x280c0f){return[{'text':util[_0xa505('0x18')](_0xa505('0x49'),_0x4dc175,_0x45b8d4,_0x280c0f,_0x46c92f),'style':'footer'}];}};}function writePDFDocument(_0x298fae,_0x3b68ad){return new Promise(function(_0x5445f0,_0x1a7263){var _0x4890a0=_0x298fae['pipe'](fs[_0xa505('0x4a')](_0x3b68ad));_0x4890a0['on'](_0xa505('0x4b'),function(){_0x5445f0(_0xa505('0x4b'));});_0x4890a0['on'](_0xa505('0x4c'),function(_0x5168df){_0x1a7263(_0x5168df);});_0x298fae[_0xa505('0x4d')]();});}exports[_0xa505('0x4e')]=function(_0x295b02,_0x42ee2b){var _0x197fe3=getPDFPrinter();var _0x3a2958=getPDFDocDefinitionFromHTML(_0x295b02,_0x42ee2b);var _0x5bca3b=_0x197fe3[_0xa505('0x35')](_0x3a2958);return writePDFDocument(_0x5bca3b,_0x42ee2b[_0xa505('0x0')])[_0xa505('0x4f')](function(_0x4256c1){throw _0x4256c1;});}; \ No newline at end of file +var _0x198c=['dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','fill','length','auto','body','chunk','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','format','endDate','header','before','push','landscape','footer','Arial','black','right','num','Empty','Setting','find','split','splitSizePdf','then','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','query','existsSync','mkdirSync','join','each','createPdfKitDocument','%s%d.%s','pdf','all','%s.%s','zip\x20finished','info','PDF','Completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','inspect','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','center','pipe','createWriteStream','finish','error','createPdfFromHTML','lodash','path','pdfmake/src/printer','zip-dir','jsdom','window','bluebird','../../mysqldb'];(function(_0x23d880,_0x5da5ec){var _0x442524=function(_0x42db39){while(--_0x42db39){_0x23d880['push'](_0x23d880['shift']());}};_0x442524(++_0x5da5ec);}(_0x198c,0x1ea));var _0xc198=function(_0x57b425,_0x398af9){_0x57b425=_0x57b425-0x0;var _0xd98040=_0x198c[_0x57b425];return _0xd98040;};'use strict';var _=require(_0xc198('0x0'));var fs=require('fs');var util=require('util');var path=require(_0xc198('0x1'));var moment=require('moment');var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0xc198('0x2'));var zipdir=require(_0xc198('0x3'));var rimraf=require('rimraf');var JSDOM=require(_0xc198('0x4'))['JSDOM'];var window=new JSDOM('')[_0xc198('0x5')];var BPromise=require(_0xc198('0x6'));var db=require(_0xc198('0x7'))['db'];var dbH=require(_0xc198('0x7'))[_0xc198('0x8')];var logger=require(_0xc198('0x9'))(_0xc198('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xc198('0xb')][0x3];var PATH=process[_0xc198('0xb')][0x4];var NAME=process[_0xc198('0xb')][0x5];var FORMAT=_0xc198('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x44b504,_0x3c57af){var _0x488df0={'status':_0x44b504};var _0x5c2afa={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3c57af){_0x488df0['savename']=_0x3c57af;}return db[_0xc198('0xd')][_0xc198('0xe')](_0x488df0,_0x5c2afa);}function getHeaders(_0x4b1433){return _[_0xc198('0xf')](_0x4b1433,function(_0x23a698){return{'text':_0x23a698,'style':_0xc198('0x10')};});}function getRows(_0x45090f,_0x49567e){return _[_0xc198('0xf')](_0x49567e,function(_0x415bcd){return _(_0x415bcd)[_0xc198('0x11')](_0x45090f)[_0xc198('0xf')](function(_0x43861e){return _0x43861e?_[_0xc198('0x12')](_0x43861e):'';})[_0xc198('0x13')]();});}function createTable(_0x1ba72c,_0xccd081){var _0x1be8d3={'widths':_[_0xc198('0x14')](Array(_0x1ba72c[_0xc198('0x15')]),0x91),'heights':function(_0x1fdbcc){return _0x1fdbcc===0x0?_0xc198('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x331505=getHeaders(_0x1ba72c);_0x1be8d3[_0xc198('0x17')]['push'](_0x331505);var _0x16ab54=getRows(_0x1ba72c,_0xccd081);_0x1be8d3[_0xc198('0x17')]=_0x1be8d3[_0xc198('0x17')]['concat'](_0x16ab54);return _0x1be8d3;}function createTables(_0x1c7736){var _0xff9376=[];var _0x162464=_[_0xc198('0x18')](Object['keys'](_0x1c7736[0x0]),0x5);_0x162464['forEach'](function(_0x430b2b){_0xff9376['push'](createTable(_0x430b2b,_0x1c7736));});return _0xff9376;}function getPDFDocDefinition(_0x4b64b0){var _0x597745=util['format'](_0xc198('0x19'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])[_0xc198('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0xc198('0x1b')])['format'](FORMAT));var _0x5d4060=[];for(var _0x742216=0x0;_0x742216<_0x4b64b0[_0xc198('0x15')];_0x742216++){var _0x1ed8b7=[];if(_0x742216===0x0){_0x1ed8b7['push']({'text':_0x597745,'style':_0xc198('0x1c')});}var _0x1ce877={'table':_0x4b64b0[_0x742216]};if(_0x742216>0x0){_0x1ce877['pageBreak']=_0xc198('0x1d');_0x1ce877['margin']=[0x0,0x46,0x0,0x0];}_0x1ed8b7[_0xc198('0x1e')](_0x1ce877);_0x5d4060[_0xc198('0x1e')](_0x1ed8b7);}return{'pageSize':'A4','pageOrientation':_0xc198('0x1f'),'content':_0x5d4060,'footer':function(_0x4ab01f,_0x3fd5f6){return{'text':_0x4ab01f[_0xc198('0x12')]()+'\x20/\x20'+_0x3fd5f6,'style':_0xc198('0x20')};},'defaultStyle':{'font':_0xc198('0x21')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xc198('0x22')},'footer':{'alignment':_0xc198('0x23'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x527f65){var _0x4bf593=0x1388;var _0x4c273b;if(!_0x527f65[0x0][_0xc198('0x24')]){return analyticExtractedReport(_0xc198('0x25'));}return db[_0xc198('0x26')][_0xc198('0x27')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc198('0x28'),_0xc198('0x29')]})[_0xc198('0x2a')](function(_0x579703){if(_0x579703){_0x4c273b=_0x579703;_0x4bf593=_0x4c273b[_0xc198('0x29')]||0x3e8;}})[_0xc198('0x2a')](function(){var _0x4ab333=[];var _0x1a0edd=0x0;if(_0x4c273b['split']){if(_0x527f65&&_0x527f65[_0xc198('0x15')]){var _0x31c25c=_['range'](_0x527f65[0x0][_0xc198('0x24')]/_0x4bf593);var _0x1b67ac=Number[_0xc198('0x2b')](_0x527f65[0x0]['num']/_0x4bf593)?_0x527f65[0x0]['num']%_0x4bf593:0x0;_0x31c25c[_0xc198('0x2c')](function(_0x417807){if(_0x417807>0x0){_0x1a0edd+=_0x4bf593;}_0x4ab333['push'](dbH['sequelize']['query'](util[_0xc198('0x1a')](_0xc198('0x2d'),QUERY,_0x4bf593,_0x1a0edd),{'type':dbH[_0xc198('0x2e')][_0xc198('0x2f')][_0xc198('0x30')]}));});if(_0x1b67ac>0x0){_0x1a0edd+=_0x4bf593;_0x4ab333[_0xc198('0x1e')](dbH[_0xc198('0x2e')][_0xc198('0x31')](util[_0xc198('0x1a')](_0xc198('0x2d'),QUERY,_0x1b67ac,_0x1a0edd),{'type':dbH[_0xc198('0x2e')][_0xc198('0x2f')][_0xc198('0x30')]}));}}}else{_0x4ab333[_0xc198('0x1e')](dbH[_0xc198('0x2e')][_0xc198('0x31')](QUERY,{'type':dbH[_0xc198('0x2e')]['QueryTypes']['SELECT']}));}var _0xb7548b=path['dirname'](PATH);var _0x1eb496=path['basename'](PATH,'.pdf');var _0x175ae7=_0x4c273b['split']&&_0x4ab333[_0xc198('0x15')]>0x1;var _0x2a876a=[];if(!fs[_0xc198('0x32')](path['join'](_0xb7548b,_0x1eb496))&&_0x175ae7){fs[_0xc198('0x33')](path[_0xc198('0x34')](_0xb7548b,_0x1eb496));}return BPromise[_0xc198('0x35')](_0x4ab333,function(_0x5b7280){_0x2a876a[_0xc198('0x1e')](_0x5b7280);})[_0xc198('0x2a')](function(){var _0x312bd1=[];for(var _0x32643b=0x0;_0x32643b<_0x2a876a[_0xc198('0x15')];_0x32643b+=0x1){var _0x51fdca=_0x2a876a[_0x32643b];var _0x81ef04=createTables(_['flatten'](_0x51fdca));var _0x3786b2;var _0x3a3e82=getPDFDocDefinition(_0x81ef04);var _0x10c946=getPDFPrinter();var _0x4b4204=_0x10c946[_0xc198('0x36')](_0x3a3e82);if(_0x175ae7){_0x3786b2=path[_0xc198('0x34')](_0xb7548b,_0x1eb496,util['format'](_0xc198('0x37'),_0x1eb496,_0x32643b,_0xc198('0x38')));}else{_0x3786b2=path[_0xc198('0x34')](_0xb7548b,util['format']('%s.%s',_0x1eb496,'pdf'));}_0x312bd1['push'](writePDFDocument(_0x4b4204,_0x3786b2));}return Promise[_0xc198('0x39')](_0x312bd1);})[_0xc198('0x2a')](function(){if(_0x175ae7){return new Promise(function(_0x423c1a){zipdir(path[_0xc198('0x34')](_0xb7548b,_0x1eb496),{'saveTo':path['join'](_0xb7548b,util['format'](_0xc198('0x3a'),_0x1eb496,'zip'))},function(){rimraf(path[_0xc198('0x34')](_0xb7548b,_0x1eb496),function(){});_0x423c1a(_0xc198('0x3b'));});});}})[_0xc198('0x2a')](function(){if(!_0x175ae7)return;rimraf(path['join'](_0xb7548b,_0x1eb496),function(){});})[_0xc198('0x2a')](function(){logger[_0xc198('0x3c')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xc198('0x3d')));return analyticExtractedReport(_0xc198('0x3e'),_0x175ae7?util[_0xc198('0x1a')]('%s.%s',_0x1eb496,_0x175ae7?_0xc198('0x3f'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xc198('0x3c')](util[_0xc198('0x1a')](_0xc198('0x40'),EXTRACTED_REPORT_ID,'PDF'));return db[_0xc198('0xd')][_0xc198('0x41')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xc198('0x2a')](function(_0x240dc0){EXTRACTED_REPORT=_0x240dc0;return dbH['sequelize'][_0xc198('0x31')](util[_0xc198('0x1a')](_0xc198('0x42'),QUERY),{'type':dbH['sequelize'][_0xc198('0x2f')][_0xc198('0x30')]});})[_0xc198('0x2a')](extractReport)['catch'](function(_0x4a17cc){logger[_0xc198('0x3c')](util[_0xc198('0x1a')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'),util[_0xc198('0x43')](_0x4a17cc,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xc198('0x44'));})[_0xc198('0x45')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1b7bcc=new PdfPrinter({'Arial':{'normal':__dirname+_0xc198('0x46'),'bold':__dirname+_0xc198('0x47'),'italics':__dirname+_0xc198('0x48'),'bolditalics':__dirname+_0xc198('0x49')}});return _0x1b7bcc;}function getPDFDocDefinitionFromHTML(_0x516926,_0x442143){var _0x5f43de=util[_0xc198('0x1a')]('%s\x20#%d',_0x442143[_0xc198('0x4a')],_0x442143[_0xc198('0x4b')]);var _0x327775=moment()[_0xc198('0x1a')](_0xc198('0x4c'))[_0xc198('0x12')]();var _0x560ee5=htmlToPdfmake(_0x516926,{'window':window,'tableAutoSize':!![]});return{'content':[_0x560ee5],'defaultStyle':{'font':_0xc198('0x21')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xc198('0x4d'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xc198('0x4d')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0xc198('0x1c')}];},'footer':function(_0x44ef87,_0x180752){return[{'text':util[_0xc198('0x1a')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x5f43de,_0x44ef87,_0x180752,_0x327775),'style':'footer'}];}};}function writePDFDocument(_0xf45b40,_0x2dc7b0){return new Promise(function(_0x2eceee,_0x4b67cd){var _0xfb35f6=_0xf45b40[_0xc198('0x4e')](fs[_0xc198('0x4f')](_0x2dc7b0));_0xfb35f6['on'](_0xc198('0x50'),function(){_0x2eceee(_0xc198('0x50'));});_0xfb35f6['on'](_0xc198('0x51'),function(_0x2f5698){_0x4b67cd(_0x2f5698);});_0xf45b40['end']();});}exports[_0xc198('0x52')]=function(_0x442e7b,_0x549971){var _0x2bd2a1=getPDFPrinter();var _0x5dfe47=getPDFDocDefinitionFromHTML(_0x442e7b,_0x549971);var _0x216583=_0x2bd2a1['createPdfKitDocument'](_0x5dfe47);return writePDFDocument(_0x216583,_0x549971['path'])['catch'](function(_0x3d9ccc){throw _0x3d9ccc;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 04cc4bb..a0f1883 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 _0x9a86=['zip','catch','finally','util','path','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','XLSX','Setting','find','split','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','Empty','length','range','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','xlsx','%s.%s','binary','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed'];(function(_0xc6257f,_0x386528){var _0x23856c=function(_0x5472fa){while(--_0x5472fa){_0xc6257f['push'](_0xc6257f['shift']());}};_0x23856c(++_0x386528);}(_0x9a86,0x1ed));var _0x69a8=function(_0x2405bc,_0x2f28a1){_0x2405bc=_0x2405bc-0x0;var _0x5272d4=_0x9a86[_0x2405bc];return _0x5272d4;};'use strict';var util=require(_0x69a8('0x0'));var path=require(_0x69a8('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0x69a8('0x2'));var BPromise=require(_0x69a8('0x3'));var zipdir=require(_0x69a8('0x4'));var rimraf=require(_0x69a8('0x5'));var db=require(_0x69a8('0x6'))['db'];var dbH=require(_0x69a8('0x6'))[_0x69a8('0x7')];var logger=require(_0x69a8('0x8'))(_0x69a8('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x69a8('0xa')][0x2]);var QUERY=process[_0x69a8('0xa')][0x3];var PATH=process[_0x69a8('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x40d196,_0x308ef9){var _0x1909fc={'status':_0x40d196};var _0x1c826b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x308ef9){_0x1909fc['savename']=_0x308ef9;}return db[_0x69a8('0xb')][_0x69a8('0xc')](_0x1909fc,_0x1c826b);}function main(){var _0x574a36=0x1388;var _0x2c35d0;logger[_0x69a8('0xd')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x69a8('0xe')));return db[_0x69a8('0xf')][_0x69a8('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x69a8('0x11'),'splitSizeXlsx']})['then'](function(_0x12bc21){if(_0x12bc21){_0x2c35d0=_0x12bc21;_0x574a36=_0x2c35d0['splitSizeXlsx']||0x1388;}})[_0x69a8('0x12')](function(){return dbH[_0x69a8('0x13')][_0x69a8('0x14')](util[_0x69a8('0x15')](_0x69a8('0x16'),QUERY),{'type':dbH['sequelize'][_0x69a8('0x17')]['SELECT']});})[_0x69a8('0x12')](function(_0x10c6c8){if(!_0x10c6c8[0x0]['num']){return analyticExtractedReport(_0x69a8('0x18'));}var _0x264347=[];var _0x275a8f=0x0;if(_0x2c35d0[_0x69a8('0x11')]){if(_0x10c6c8&&_0x10c6c8[_0x69a8('0x19')]){var _0x525cd9=_[_0x69a8('0x1a')](_0x10c6c8[0x0][_0x69a8('0x1b')]/_0x574a36);var _0x3c6252=Number[_0x69a8('0x1c')](_0x10c6c8[0x0][_0x69a8('0x1b')]/_0x574a36)?_0x10c6c8[0x0]['num']%_0x574a36:0x0;_0x525cd9[_0x69a8('0x1d')](function(_0x18ce82){if(_0x18ce82>0x0){_0x275a8f+=_0x574a36;}_0x264347[_0x69a8('0x1e')](dbH['sequelize'][_0x69a8('0x14')](util['format'](_0x69a8('0x1f'),QUERY,_0x574a36,_0x275a8f),{'type':dbH[_0x69a8('0x13')][_0x69a8('0x17')][_0x69a8('0x20')]}));});if(_0x3c6252>0x0){_0x275a8f+=_0x574a36;_0x264347[_0x69a8('0x1e')](dbH[_0x69a8('0x13')][_0x69a8('0x14')](util[_0x69a8('0x15')](_0x69a8('0x1f'),QUERY,_0x3c6252,_0x275a8f),{'type':dbH[_0x69a8('0x13')][_0x69a8('0x17')][_0x69a8('0x20')]}));}}}else{_0x264347[_0x69a8('0x1e')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x69a8('0x13')]['QueryTypes'][_0x69a8('0x20')]}));}var _0x115cdd=path[_0x69a8('0x21')](PATH);var _0x45a7c6=path[_0x69a8('0x22')](PATH,_0x69a8('0x23'));var _0x21412d=_0x2c35d0[_0x69a8('0x11')]&&_0x264347[_0x69a8('0x19')]>0x1;var _0x1c9588=[];if(!fs[_0x69a8('0x24')](path[_0x69a8('0x25')](_0x115cdd,_0x45a7c6))&&_0x21412d){fs[_0x69a8('0x26')](path[_0x69a8('0x25')](_0x115cdd,_0x45a7c6));}return BPromise[_0x69a8('0x27')](_0x264347,function(_0x277764){_0x1c9588[_0x69a8('0x1e')](_0x277764);})[_0x69a8('0x12')](function(){for(var _0x3242ef=0x0;_0x3242ef<_0x1c9588[_0x69a8('0x19')];_0x3242ef+=0x1){var _0x2f8126;var _0x5a6673=_0x1c9588[_0x3242ef];if(_0x21412d){_0x2f8126=path[_0x69a8('0x25')](_0x115cdd,_0x45a7c6,util[_0x69a8('0x15')]('%s%d.%s',_0x45a7c6,_0x3242ef,_0x69a8('0x28')));}else{_0x2f8126=path['join'](_0x115cdd,util[_0x69a8('0x15')](_0x69a8('0x29'),_0x45a7c6,'xlsx'));}fs['writeFileSync'](_0x2f8126,json2xls(_0x5a6673),_0x69a8('0x2a'));}})[_0x69a8('0x12')](function(){if(_0x21412d){return new Promise(function(_0x4a57b1){zipdir(path[_0x69a8('0x25')](_0x115cdd,_0x45a7c6),{'saveTo':path['join'](_0x115cdd,util[_0x69a8('0x15')](_0x69a8('0x29'),_0x45a7c6,'zip'))},function(_0x4db9ff,_0x32d04a){rimraf(path[_0x69a8('0x25')](_0x115cdd,_0x45a7c6),function(){});_0x4a57b1(_0x69a8('0x2b'));});});}})['then'](function(){logger[_0x69a8('0xd')](util['format'](_0x69a8('0x2c'),EXTRACTED_REPORT_ID,_0x69a8('0xe')));return analyticExtractedReport(_0x69a8('0x2d'),_0x21412d?util[_0x69a8('0x15')]('%s.%s',_0x45a7c6,_0x21412d?_0x69a8('0x2e'):_0x69a8('0x28')):null);});})[_0x69a8('0x2f')](function(_0x295fd1){logger[_0x69a8('0xd')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x69a8('0xe')),util['inspect'](_0x295fd1,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x69a8('0x30')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xe8ed=['AnalyticExtractedReport','update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','range','isInteger','forEach','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','basename','length','existsSync','mkdirSync','join','each','xlsx','%s.%s','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','util','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename'];(function(_0x307a5b,_0x2bd735){var _0x1aece7=function(_0x73a1a0){while(--_0x73a1a0){_0x307a5b['push'](_0x307a5b['shift']());}};_0x1aece7(++_0x2bd735);}(_0xe8ed,0x8a));var _0xde8e=function(_0x2caaed,_0x3fba13){_0x2caaed=_0x2caaed-0x0;var _0x5f4cd3=_0xe8ed[_0x2caaed];return _0x5f4cd3;};'use strict';var util=require(_0xde8e('0x0'));var path=require('path');var _=require(_0xde8e('0x1'));var fs=require('fs');var json2xls=require(_0xde8e('0x2'));var BPromise=require(_0xde8e('0x3'));var zipdir=require(_0xde8e('0x4'));var rimraf=require(_0xde8e('0x5'));var db=require(_0xde8e('0x6'))['db'];var dbH=require(_0xde8e('0x6'))[_0xde8e('0x7')];var logger=require(_0xde8e('0x8'))(_0xde8e('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xde8e('0xa')][0x2]);var QUERY=process[_0xde8e('0xa')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x20cadc,_0x96d755){var _0x1441b5={'status':_0x20cadc};var _0x1b2837={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x96d755){_0x1441b5[_0xde8e('0xb')]=_0x96d755;}return db[_0xde8e('0xc')][_0xde8e('0xd')](_0x1441b5,_0x1b2837);}function main(){var _0x1ede3a=0x1388;var _0x1ce627;logger['info'](util['format'](_0xde8e('0xe'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xde8e('0xf')][_0xde8e('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xde8e('0x11'),_0xde8e('0x12')]})[_0xde8e('0x13')](function(_0x3ef09b){if(_0x3ef09b){_0x1ce627=_0x3ef09b;_0x1ede3a=_0x1ce627[_0xde8e('0x12')]||0x1388;}})[_0xde8e('0x13')](function(){return dbH[_0xde8e('0x14')][_0xde8e('0x15')](util['format'](_0xde8e('0x16'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0xde8e('0x17')]});})[_0xde8e('0x13')](function(_0x3bcc1b){if(!_0x3bcc1b[0x0][_0xde8e('0x18')]){return analyticExtractedReport(_0xde8e('0x19'));}var _0x20c1dc=[];var _0x223e91=0x0;if(_0x1ce627[_0xde8e('0x11')]){if(_0x3bcc1b&&_0x3bcc1b['length']){var _0x1a40af=_[_0xde8e('0x1a')](_0x3bcc1b[0x0]['num']/_0x1ede3a);var _0x45e5da=Number[_0xde8e('0x1b')](_0x3bcc1b[0x0][_0xde8e('0x18')]/_0x1ede3a)?_0x3bcc1b[0x0][_0xde8e('0x18')]%_0x1ede3a:0x0;_0x1a40af[_0xde8e('0x1c')](function(_0x5b9ffa){if(_0x5b9ffa>0x0){_0x223e91+=_0x1ede3a;}_0x20c1dc['push'](dbH[_0xde8e('0x14')][_0xde8e('0x15')](util[_0xde8e('0x1d')](_0xde8e('0x1e'),QUERY,_0x1ede3a,_0x223e91),{'type':dbH[_0xde8e('0x14')][_0xde8e('0x1f')][_0xde8e('0x17')]}));});if(_0x45e5da>0x0){_0x223e91+=_0x1ede3a;_0x20c1dc[_0xde8e('0x20')](dbH['sequelize'][_0xde8e('0x15')](util[_0xde8e('0x1d')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x45e5da,_0x223e91),{'type':dbH['sequelize'][_0xde8e('0x1f')][_0xde8e('0x17')]}));}}}else{_0x20c1dc['push'](dbH['sequelize'][_0xde8e('0x15')](QUERY,{'type':dbH[_0xde8e('0x14')][_0xde8e('0x1f')]['SELECT']}));}var _0x1ad5d5=path['dirname'](PATH);var _0x35415c=path[_0xde8e('0x21')](PATH,'.xlsx');var _0x162c7=_0x1ce627[_0xde8e('0x11')]&&_0x20c1dc[_0xde8e('0x22')]>0x1;var _0x35838a=[];if(!fs[_0xde8e('0x23')](path['join'](_0x1ad5d5,_0x35415c))&&_0x162c7){fs[_0xde8e('0x24')](path[_0xde8e('0x25')](_0x1ad5d5,_0x35415c));}return BPromise[_0xde8e('0x26')](_0x20c1dc,function(_0x3e74f7){_0x35838a[_0xde8e('0x20')](_0x3e74f7);})['then'](function(){for(var _0x352149=0x0;_0x352149<_0x35838a[_0xde8e('0x22')];_0x352149+=0x1){var _0x146043;var _0x304026=_0x35838a[_0x352149];if(_0x162c7){_0x146043=path[_0xde8e('0x25')](_0x1ad5d5,_0x35415c,util[_0xde8e('0x1d')]('%s%d.%s',_0x35415c,_0x352149,_0xde8e('0x27')));}else{_0x146043=path[_0xde8e('0x25')](_0x1ad5d5,util[_0xde8e('0x1d')](_0xde8e('0x28'),_0x35415c,'xlsx'));}fs[_0xde8e('0x29')](_0x146043,json2xls(_0x304026),_0xde8e('0x2a'));}})['then'](function(){if(_0x162c7){return new Promise(function(_0x5354b9){zipdir(path[_0xde8e('0x25')](_0x1ad5d5,_0x35415c),{'saveTo':path[_0xde8e('0x25')](_0x1ad5d5,util['format'](_0xde8e('0x28'),_0x35415c,_0xde8e('0x2b')))},function(_0x55d4c7,_0x55302f){rimraf(path['join'](_0x1ad5d5,_0x35415c),function(){});_0x5354b9('zip\x20finished');});});}})[_0xde8e('0x13')](function(){logger['info'](util[_0xde8e('0x1d')](_0xde8e('0x2c'),EXTRACTED_REPORT_ID,_0xde8e('0x2d')));return analyticExtractedReport(_0xde8e('0x2e'),_0x162c7?util[_0xde8e('0x1d')](_0xde8e('0x28'),_0x35415c,_0x162c7?_0xde8e('0x2b'):'xlsx'):null);});})['catch'](function(_0x5bf343){logger[_0xde8e('0x2f')](util['format'](_0xde8e('0x30'),EXTRACTED_REPORT_ID,_0xde8e('0x2d')),util['inspect'](_0x5bf343,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xde8e('0x31')](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 0c14c6e..13a8d0b 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 _0xcd90=['toLowerCase','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','Hangup','concat','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','then','intervals','IntervalId','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','updatedAt','interval','tag','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app'];(function(_0x35741f,_0x1bfb4f){var _0x2cd2b7=function(_0x3513e5){while(--_0x3513e5){_0x35741f['push'](_0x35741f['shift']());}};_0x2cd2b7(++_0x1bfb4f);}(_0xcd90,0x13d));var _0x0cd9=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xcd90[_0x1f9f37];return _0x21c080;};'use strict';var _=require(_0x0cd9('0x0'));var util=require(_0x0cd9('0x1'));function rewrite(_0x5bd4c1,_0xdb571c){var _0x54a132=this;return _0x5bd4c1[_0x0cd9('0x2')][_0x0cd9('0x3')][_0x0cd9('0x4')]({'raw':!![]})[_0x0cd9('0x5')](function(_0x538d1a){_0x54a132[_0x0cd9('0x6')]=_0x538d1a;return _0x5bd4c1[_0x0cd9('0x2')]['VoiceExtension']['findAll']({'where':{'IntervalId':_0xdb571c[_0x0cd9('0x7')]},'raw':!![]});})[_0x0cd9('0x5')](function(_0x430722){return _0x5bd4c1[_0x0cd9('0x2')][_0x0cd9('0x8')][_0x0cd9('0x4')]({'where':{'exten':{'$in':_[_0x0cd9('0x9')](_[_0x0cd9('0xa')](_0x430722,_0x0cd9('0xb')))}},'order':[{'raw':_0x0cd9('0xc')}],'raw':!![]});})['then'](function(_0x117521){var _0x15c1d4=_[_0x0cd9('0xd')](_0x117521,{'priority':'1'});var _0x141da5=_[_0x0cd9('0xd')](_0x117521,{'isApp':0x1});var _0x59162b=_[_0x0cd9('0xe')](_0x141da5,_0x0cd9('0xb'));var _0x4bc96f=[_0x0cd9('0xf'),_0x0cd9('0x10')];var _0x10560f=[];var _0x2b4900=[];for(var _0x3750f9 in _0x59162b){if(_0x59162b[_0x0cd9('0x11')](_0x3750f9)){_0x54a132[_0x0cd9('0x12')]=0x2;_0x54a132[_0x0cd9('0x13')]=[];_0x54a132[_0x0cd9('0x14')]=_[_0x0cd9('0x15')](_0x15c1d4,{'exten':_0x59162b[_0x3750f9][0x0]['exten']});_0x54a132[_0x0cd9('0x13')][_0x0cd9('0x16')]({'type':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x17')],'app':_0x0cd9('0x18'),'appdata':util[_0x0cd9('0x19')](_0x0cd9('0x1a'),_0x59162b[_0x3750f9][0x0][_0x0cd9('0x17')]),'context':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x1b')],'exten':_0x59162b[_0x3750f9][0x0][_0x0cd9('0xb')],'priority':_0x54a132['priority']++,'VoiceExtensionId':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x1c')]});if(_0x59162b[_0x3750f9][0x0][_0x0cd9('0x17')]===_0x0cd9('0x1d')){_0x54a132['extensions'][_0x0cd9('0x16')]({'type':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x17')],'app':_0x0cd9('0x18'),'appdata':_0x0cd9('0x1e')+_0x59162b[_0x3750f9][0x0]['VoiceExtensionId'],'context':_0x59162b[_0x3750f9][0x0]['context'],'exten':_0x59162b[_0x3750f9][0x0]['exten'],'priority':_0x54a132['priority']++,'VoiceExtensionId':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x1c')]});}else if(_0x59162b[_0x3750f9][0x0]['type']===_0x0cd9('0x1f')){if(_0x54a132[_0x0cd9('0x14')]){_0x54a132[_0x0cd9('0x13')][_0x0cd9('0x16')]({'type':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x17')],'app':_0x0cd9('0x18'),'appdata':_0x0cd9('0x20')+(_0x54a132[_0x0cd9('0x14')][_0x0cd9('0x21')]?_0x0cd9('0x22')+_0x54a132[_0x0cd9('0x14')][_0x0cd9('0x21')]+'}':_0x0cd9('0x23')),'context':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x1b')],'exten':_0x59162b[_0x3750f9][0x0][_0x0cd9('0xb')],'priority':_0x54a132[_0x0cd9('0x12')]++,'VoiceExtensionId':_0x59162b[_0x3750f9][0x0]['VoiceExtensionId']});}_0x54a132[_0x0cd9('0x13')][_0x0cd9('0x16')]({'type':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x17')],'app':_0x0cd9('0x18'),'appdata':_0x0cd9('0x1e')+_0x59162b[_0x3750f9][0x0][_0x0cd9('0x1c')],'context':_0x59162b[_0x3750f9][0x0]['context'],'exten':_0x59162b[_0x3750f9][0x0][_0x0cd9('0xb')],'priority':_0x54a132[_0x0cd9('0x12')]++,'VoiceExtensionId':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x1c')]});var _0x42d050=_0x54a132[_0x0cd9('0x12')]++;_0x54a132['extensions'][_0x0cd9('0x16')]({'type':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x17')],'app':'ExecIf','appdata':_0x0cd9('0x24')+(_0x42d050+0x2)+_0x0cd9('0x25')+(_0x42d050+0x1)+')','context':_0x59162b[_0x3750f9][0x0]['context'],'exten':_0x59162b[_0x3750f9][0x0][_0x0cd9('0xb')],'priority':_0x42d050,'VoiceExtensionId':_0x59162b[_0x3750f9][0x0]['VoiceExtensionId']});if(_0x54a132['extension']){_0x54a132[_0x0cd9('0x13')]['push']({'type':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x17')],'app':'Set','appdata':_0x54a132[_0x0cd9('0x14')][_0x0cd9('0x21')]?_0x0cd9('0x26')+_0x54a132[_0x0cd9('0x14')][_0x0cd9('0x21')]+'}':_0x0cd9('0x27'),'context':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x1b')],'exten':_0x59162b[_0x3750f9][0x0]['exten'],'priority':_0x54a132[_0x0cd9('0x12')]++,'VoiceExtensionId':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x1c')]});}_0x54a132[_0x0cd9('0x13')][_0x0cd9('0x16')]({'type':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x17')],'app':_0x0cd9('0x18'),'appdata':_0x0cd9('0x28')+_0x59162b[_0x3750f9][0x0][_0x0cd9('0x1c')],'context':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x1b')],'exten':_0x59162b[_0x3750f9][0x0][_0x0cd9('0xb')],'priority':_0x54a132[_0x0cd9('0x12')]++,'VoiceExtensionId':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x1c')]});if(_0x54a132[_0x0cd9('0x14')]&&_0x54a132['extension']['hasOwnProperty']('recordingFormat')&&_0x54a132[_0x0cd9('0x14')][_0x0cd9('0x29')]!==_0x0cd9('0x2a')){_0x54a132[_0x0cd9('0x13')][_0x0cd9('0x16')]({'type':_0x59162b[_0x3750f9][0x0]['type'],'app':_0x0cd9('0x18'),'appdata':_0x0cd9('0x2b'),'context':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x1b')],'exten':_0x59162b[_0x3750f9][0x0]['exten'],'priority':_0x54a132[_0x0cd9('0x12')]++,'VoiceExtensionId':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x1c')]});_0x54a132[_0x0cd9('0x13')]['push']({'type':_0x59162b[_0x3750f9][0x0]['type'],'app':'Set','appdata':_0x0cd9('0x2c')+_0x54a132[_0x0cd9('0x14')]['recordingFormat']||_0x0cd9('0x2d'),'context':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x1b')],'exten':_0x59162b[_0x3750f9][0x0][_0x0cd9('0xb')],'priority':_0x54a132[_0x0cd9('0x12')]++,'VoiceExtensionId':_0x59162b[_0x3750f9][0x0]['VoiceExtensionId']});}}_0x54a132[_0x0cd9('0x13')]['push']({'type':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x17')],'app':_0x0cd9('0x18'),'appdata':_0x0cd9('0x2e'),'context':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x1b')],'exten':_0x59162b[_0x3750f9][0x0][_0x0cd9('0xb')],'priority':_0x54a132[_0x0cd9('0x12')]++,'VoiceExtensionId':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x1c')]});_0x54a132[_0x0cd9('0x13')][_0x0cd9('0x16')]({'type':_0x59162b[_0x3750f9][0x0]['type'],'app':_0x0cd9('0x18'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x1b')],'exten':_0x59162b[_0x3750f9][0x0][_0x0cd9('0xb')],'priority':_0x54a132[_0x0cd9('0x12')]++,'VoiceExtensionId':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x1c')]});_0x54a132[_0x0cd9('0x13')]['push']({'type':_0x59162b[_0x3750f9][0x0]['type'],'app':_0x0cd9('0x18'),'appdata':_0x0cd9('0x2f'),'context':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x1b')],'exten':_0x59162b[_0x3750f9][0x0]['exten'],'priority':_0x54a132[_0x0cd9('0x12')]++,'VoiceExtensionId':_0x59162b[_0x3750f9][0x0]['VoiceExtensionId']});for(var _0x284ca9=0x0,_0x17fb21=0x0;_0x284ca9<_0x59162b[_0x3750f9][_0x0cd9('0x30')];_0x284ca9+=0x1,_0x17fb21=0x0){var _0x50324d=_0x59162b[_0x3750f9][_0x284ca9];if(_0x50324d[_0x0cd9('0x17')]){_0x50324d[_0x0cd9('0x17')]=_0x50324d[_0x0cd9('0x17')]['toLowerCase']();}var _0x293bcf=[];var _0x492047=[];delete _0x50324d['id'];delete _0x50324d['createdAt'];delete _0x50324d[_0x0cd9('0x31')];var _0x2f3094=_0x50324d[_0x0cd9('0x32')]!=='*,*,*,*'?[_0x50324d[_0x0cd9('0x32')]]:_0x50324d[_0x0cd9('0x7')]?_['map'](_[_0x0cd9('0xd')](_0x54a132[_0x0cd9('0x6')],{'IntervalId':_0x50324d[_0x0cd9('0x7')]}),_0x0cd9('0x32')):[];if(_0x50324d[_0x0cd9('0x11')]('tag')){if(_0x50324d[_0x0cd9('0x33')]&&_0x50324d[_0x0cd9('0x33')]!=='--'){_0x293bcf[_0x0cd9('0x16')]({'type':_0x50324d[_0x0cd9('0x17')],'app':_0x0cd9('0x18'),'appdata':'CDR(tag)='+_0x50324d[_0x0cd9('0x33')],'context':_0x50324d['context'],'exten':_0x50324d[_0x0cd9('0xb')],'priority':_0x2f3094['length']+_0x54a132[_0x0cd9('0x12')]+_0x17fb21++,'VoiceExtensionId':_0x50324d[_0x0cd9('0x1c')]});}}if(_0x50324d[_0x0cd9('0x17')]===_0x0cd9('0x1f')&&_0x50324d[_0x0cd9('0x11')](_0x0cd9('0x34'))){if(_0x50324d[_0x0cd9('0x34')]){_0x293bcf[_0x0cd9('0x16')]({'type':_0x50324d['type'],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x50324d[_0x0cd9('0x34')]+')','context':_0x50324d['context'],'exten':_0x50324d[_0x0cd9('0xb')],'priority':_0x2f3094[_0x0cd9('0x30')]+_0x54a132[_0x0cd9('0x12')]+_0x17fb21++,'VoiceExtensionId':_0x50324d[_0x0cd9('0x1c')]});}else{_0x293bcf[_0x0cd9('0x16')]({'type':_0x50324d[_0x0cd9('0x17')],'app':_0x0cd9('0x35'),'appdata':_0x0cd9('0x36'),'context':_0x50324d[_0x0cd9('0x1b')],'exten':_0x50324d[_0x0cd9('0xb')],'priority':_0x2f3094[_0x0cd9('0x30')]+_0x54a132[_0x0cd9('0x12')]+_0x17fb21++,'VoiceExtensionId':_0x50324d[_0x0cd9('0x1c')]});}}if(_0x50324d[_0x0cd9('0x11')](_0x0cd9('0x37'))){if(_0x4bc96f[_0x0cd9('0x38')](_0x50324d[_0x0cd9('0x39')][_0x0cd9('0x3a')]())>=0x0&&_0x50324d['appType']!==_0x0cd9('0x3b')){if(_0x50324d['answer']){_0x293bcf['push']({'type':_0x50324d[_0x0cd9('0x17')],'app':_0x0cd9('0x35'),'appdata':_0x0cd9('0x3c'),'context':_0x50324d[_0x0cd9('0x1b')],'exten':_0x50324d['exten'],'priority':_0x2f3094[_0x0cd9('0x30')]+_0x54a132[_0x0cd9('0x12')]+_0x17fb21++,'VoiceExtensionId':_0x50324d[_0x0cd9('0x1c')]});_0x293bcf[_0x0cd9('0x16')]({'type':_0x50324d[_0x0cd9('0x17')],'app':_0x0cd9('0x18'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x50324d['context'],'exten':_0x50324d[_0x0cd9('0xb')],'priority':_0x2f3094[_0x0cd9('0x30')]+_0x54a132[_0x0cd9('0x12')]+_0x17fb21++,'VoiceExtensionId':_0x50324d[_0x0cd9('0x1c')]});}else{_0x293bcf['push']({'type':_0x50324d['type'],'app':'ExecIf','appdata':_0x0cd9('0x3d'),'context':_0x50324d[_0x0cd9('0x1b')],'exten':_0x50324d[_0x0cd9('0xb')],'priority':_0x2f3094[_0x0cd9('0x30')]+_0x54a132[_0x0cd9('0x12')]+_0x17fb21++,'VoiceExtensionId':_0x50324d[_0x0cd9('0x1c')]});_0x293bcf[_0x0cd9('0x16')]({'type':_0x50324d[_0x0cd9('0x17')],'app':'Set','appdata':_0x0cd9('0x3e'),'context':_0x50324d[_0x0cd9('0x1b')],'exten':_0x50324d['exten'],'priority':_0x2f3094[_0x0cd9('0x30')]+_0x54a132[_0x0cd9('0x12')]+_0x17fb21++,'VoiceExtensionId':_0x50324d[_0x0cd9('0x1c')]});}}}for(var _0x41e17c=0x0;_0x41e17c<_0x2f3094[_0x0cd9('0x30')];_0x41e17c+=0x1){var _0x470a9a=_0x54a132[_0x0cd9('0x12')]+_0x2f3094[_0x0cd9('0x30')];var _0x16aa38=_0x41e17c===_0x2f3094['length']-0x1?_0x54a132[_0x0cd9('0x12')]+_0x293bcf['length']+_0x492047[_0x0cd9('0x30')]+0x2:_0x54a132['priority']+_0x41e17c+0x1;_0x293bcf[_0x0cd9('0x3f')](_0x41e17c,0x0,{'type':_0x50324d[_0x0cd9('0x17')],'app':'GotoIfTime','appdata':_0x2f3094[_0x41e17c]+'?'+_0x50324d[_0x0cd9('0x1b')]+_0x0cd9('0x40')+_0x470a9a+':'+_0x50324d['context']+_0x0cd9('0x40')+_0x16aa38,'exten':_0x50324d['exten'],'context':_0x50324d[_0x0cd9('0x1b')],'priority':_0x54a132[_0x0cd9('0x12')]+_0x41e17c,'VoiceExtensionId':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x1c')]});}_0x50324d[_0x0cd9('0x12')]=_0x293bcf[_0x0cd9('0x30')]?_[_0x0cd9('0x41')](_0x293bcf)[_0x0cd9('0x12')]+0x1:_0x54a132[_0x0cd9('0x12')];_0x54a132[_0x0cd9('0x12')]=(_0x492047['length']?_[_0x0cd9('0x41')](_0x492047)[_0x0cd9('0x12')]:_0x50324d[_0x0cd9('0x12')])+0x1;_0x54a132[_0x0cd9('0x13')]=_['concat'](_0x54a132[_0x0cd9('0x13')],_0x293bcf,[_0x50324d],_0x492047);}_0x54a132[_0x0cd9('0x13')]['push']({'type':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x17')],'app':_0x0cd9('0x42'),'exten':_0x59162b[_0x3750f9][0x0][_0x0cd9('0xb')],'context':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x1b')],'priority':_0x54a132[_0x0cd9('0x12')],'VoiceExtensionId':_0x59162b[_0x3750f9][0x0][_0x0cd9('0x1c')]});_0x10560f['push'](_0x59162b[_0x3750f9][0x0][_0x0cd9('0x1c')]);_0x2b4900=_[_0x0cd9('0x43')](_0x2b4900,_0x54a132[_0x0cd9('0x13')]);}}return _0x5bd4c1[_0x0cd9('0x44')](function(_0x39c598){return _0x5bd4c1['models'][_0x0cd9('0x8')][_0x0cd9('0x45')]({'where':{'VoiceExtensionId':{'$in':_0x10560f}},'transaction':_0x39c598})[_0x0cd9('0x5')](function(_0x47e9dc){return _0x5bd4c1[_0x0cd9('0x2')][_0x0cd9('0x8')][_0x0cd9('0x46')](_[_0x0cd9('0x47')](_0x2b4900,'priority'),{'transaction':_0x39c598});});});})[_0x0cd9('0x48')](function(_0x5cca6b){console[_0x0cd9('0x49')](_0x5cca6b);});}exports[_0x0cd9('0x4a')]=rewrite; \ No newline at end of file +var _0x4854=['type','Set','format','context','inbound','extensions','CDR(routeid)=','VoiceExtensionId','outbound','${EXTEN:','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','interval','*,*,*,*','IntervalId','tag','CDR(tag)=','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','concat','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','uniq','map','exten','filter','playback','hasOwnProperty','priority','extension','push'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x4854,0x169));var _0x4485=function(_0x45ad09,_0x521ab1){_0x45ad09=_0x45ad09-0x0;var _0x2084fd=_0x4854[_0x45ad09];return _0x2084fd;};'use strict';var _=require(_0x4485('0x0'));var util=require(_0x4485('0x1'));function rewrite(_0x24ecc6,_0x13b17b){var _0x53cc9e=this;return _0x24ecc6[_0x4485('0x2')][_0x4485('0x3')][_0x4485('0x4')]({'raw':!![]})[_0x4485('0x5')](function(_0x246d2a){_0x53cc9e[_0x4485('0x6')]=_0x246d2a;return _0x24ecc6[_0x4485('0x2')][_0x4485('0x7')]['findAll']({'where':{'IntervalId':_0x13b17b['IntervalId']},'raw':!![]});})[_0x4485('0x5')](function(_0xb4ce20){return _0x24ecc6['models'][_0x4485('0x7')]['findAll']({'where':{'exten':{'$in':_[_0x4485('0x8')](_[_0x4485('0x9')](_0xb4ce20,_0x4485('0xa')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x4485('0x5')](function(_0x4bc0a8){var _0x5f46e2=_[_0x4485('0xb')](_0x4bc0a8,{'priority':'1'});var _0x2f00dd=_[_0x4485('0xb')](_0x4bc0a8,{'isApp':0x1});var _0x4911dc=_['groupBy'](_0x2f00dd,'exten');var _0x4f826a=['queue',_0x4485('0xc')];var _0x2b0c32=[];var _0x3d7b79=[];for(var _0x4f0a83 in _0x4911dc){if(_0x4911dc[_0x4485('0xd')](_0x4f0a83)){_0x53cc9e[_0x4485('0xe')]=0x2;_0x53cc9e['extensions']=[];_0x53cc9e[_0x4485('0xf')]=_['find'](_0x5f46e2,{'exten':_0x4911dc[_0x4f0a83][0x0][_0x4485('0xa')]});_0x53cc9e['extensions'][_0x4485('0x10')]({'type':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x11')],'app':_0x4485('0x12'),'appdata':util[_0x4485('0x13')]('CDR(type)=%s',_0x4911dc[_0x4f0a83][0x0][_0x4485('0x11')]),'context':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x14')],'exten':_0x4911dc[_0x4f0a83][0x0][_0x4485('0xa')],'priority':_0x53cc9e[_0x4485('0xe')]++,'VoiceExtensionId':_0x4911dc[_0x4f0a83][0x0]['VoiceExtensionId']});if(_0x4911dc[_0x4f0a83][0x0][_0x4485('0x11')]===_0x4485('0x15')){_0x53cc9e[_0x4485('0x16')][_0x4485('0x10')]({'type':_0x4911dc[_0x4f0a83][0x0]['type'],'app':_0x4485('0x12'),'appdata':_0x4485('0x17')+_0x4911dc[_0x4f0a83][0x0]['VoiceExtensionId'],'context':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x14')],'exten':_0x4911dc[_0x4f0a83][0x0][_0x4485('0xa')],'priority':_0x53cc9e['priority']++,'VoiceExtensionId':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x18')]});}else if(_0x4911dc[_0x4f0a83][0x0][_0x4485('0x11')]===_0x4485('0x19')){if(_0x53cc9e['extension']){_0x53cc9e['extensions'][_0x4485('0x10')]({'type':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x11')],'app':'Set','appdata':'CDR(destination)='+(_0x53cc9e[_0x4485('0xf')]['cutdigits']?_0x4485('0x1a')+_0x53cc9e['extension'][_0x4485('0x1b')]+'}':_0x4485('0x1c')),'context':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x14')],'exten':_0x4911dc[_0x4f0a83][0x0][_0x4485('0xa')],'priority':_0x53cc9e[_0x4485('0xe')]++,'VoiceExtensionId':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x18')]});}_0x53cc9e[_0x4485('0x16')][_0x4485('0x10')]({'type':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x11')],'app':_0x4485('0x12'),'appdata':_0x4485('0x17')+_0x4911dc[_0x4f0a83][0x0][_0x4485('0x18')],'context':_0x4911dc[_0x4f0a83][0x0]['context'],'exten':_0x4911dc[_0x4f0a83][0x0][_0x4485('0xa')],'priority':_0x53cc9e[_0x4485('0xe')]++,'VoiceExtensionId':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x18')]});var _0x11d575=_0x53cc9e[_0x4485('0xe')]++;_0x53cc9e[_0x4485('0x16')][_0x4485('0x10')]({'type':_0x4911dc[_0x4f0a83][0x0]['type'],'app':_0x4485('0x1d'),'appdata':_0x4485('0x1e')+(_0x11d575+0x2)+'):Goto('+(_0x11d575+0x1)+')','context':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x14')],'exten':_0x4911dc[_0x4f0a83][0x0][_0x4485('0xa')],'priority':_0x11d575,'VoiceExtensionId':_0x4911dc[_0x4f0a83][0x0]['VoiceExtensionId']});if(_0x53cc9e[_0x4485('0xf')]){_0x53cc9e[_0x4485('0x16')][_0x4485('0x10')]({'type':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x11')],'app':_0x4485('0x12'),'appdata':_0x53cc9e[_0x4485('0xf')]['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x53cc9e['extension'][_0x4485('0x1b')]+'}':'CDR(prefix)=noprefix','context':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x14')],'exten':_0x4911dc[_0x4f0a83][0x0][_0x4485('0xa')],'priority':_0x53cc9e[_0x4485('0xe')]++,'VoiceExtensionId':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x18')]});}_0x53cc9e[_0x4485('0x16')]['push']({'type':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x11')],'app':_0x4485('0x12'),'appdata':_0x4485('0x1f')+_0x4911dc[_0x4f0a83][0x0][_0x4485('0x18')],'context':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x14')],'exten':_0x4911dc[_0x4f0a83][0x0][_0x4485('0xa')],'priority':_0x53cc9e[_0x4485('0xe')]++,'VoiceExtensionId':_0x4911dc[_0x4f0a83][0x0]['VoiceExtensionId']});if(_0x53cc9e[_0x4485('0xf')]&&_0x53cc9e['extension'][_0x4485('0xd')](_0x4485('0x20'))&&_0x53cc9e[_0x4485('0xf')][_0x4485('0x20')]!=='none'){_0x53cc9e[_0x4485('0x16')][_0x4485('0x10')]({'type':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x11')],'app':_0x4485('0x12'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x14')],'exten':_0x4911dc[_0x4f0a83][0x0]['exten'],'priority':_0x53cc9e[_0x4485('0xe')]++,'VoiceExtensionId':_0x4911dc[_0x4f0a83][0x0]['VoiceExtensionId']});_0x53cc9e[_0x4485('0x16')][_0x4485('0x10')]({'type':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x11')],'app':'Set','appdata':_0x4485('0x21')+_0x53cc9e[_0x4485('0xf')]['recordingFormat']||_0x4485('0x22'),'context':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x14')],'exten':_0x4911dc[_0x4f0a83][0x0][_0x4485('0xa')],'priority':_0x53cc9e[_0x4485('0xe')]++,'VoiceExtensionId':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x18')]});}}_0x53cc9e[_0x4485('0x16')][_0x4485('0x10')]({'type':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x11')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x14')],'exten':_0x4911dc[_0x4f0a83][0x0][_0x4485('0xa')],'priority':_0x53cc9e[_0x4485('0xe')]++,'VoiceExtensionId':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x18')]});_0x53cc9e[_0x4485('0x16')][_0x4485('0x10')]({'type':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x11')],'app':'Set','appdata':_0x4485('0x23'),'context':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x14')],'exten':_0x4911dc[_0x4f0a83][0x0][_0x4485('0xa')],'priority':_0x53cc9e['priority']++,'VoiceExtensionId':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x18')]});_0x53cc9e[_0x4485('0x16')][_0x4485('0x10')]({'type':_0x4911dc[_0x4f0a83][0x0]['type'],'app':_0x4485('0x12'),'appdata':_0x4485('0x24'),'context':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x14')],'exten':_0x4911dc[_0x4f0a83][0x0][_0x4485('0xa')],'priority':_0x53cc9e[_0x4485('0xe')]++,'VoiceExtensionId':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x18')]});for(var _0x49bc80=0x0,_0x22c9ae=0x0;_0x49bc80<_0x4911dc[_0x4f0a83]['length'];_0x49bc80+=0x1,_0x22c9ae=0x0){var _0x4fd390=_0x4911dc[_0x4f0a83][_0x49bc80];if(_0x4fd390[_0x4485('0x11')]){_0x4fd390[_0x4485('0x11')]=_0x4fd390[_0x4485('0x11')][_0x4485('0x25')]();}var _0x407c3d=[];var _0x5d9be1=[];delete _0x4fd390['id'];delete _0x4fd390[_0x4485('0x26')];delete _0x4fd390['updatedAt'];var _0x4562af=_0x4fd390[_0x4485('0x27')]!==_0x4485('0x28')?[_0x4fd390[_0x4485('0x27')]]:_0x4fd390[_0x4485('0x29')]?_['map'](_[_0x4485('0xb')](_0x53cc9e[_0x4485('0x6')],{'IntervalId':_0x4fd390[_0x4485('0x29')]}),'interval'):[];if(_0x4fd390['hasOwnProperty'](_0x4485('0x2a'))){if(_0x4fd390['tag']&&_0x4fd390[_0x4485('0x2a')]!=='--'){_0x407c3d[_0x4485('0x10')]({'type':_0x4fd390[_0x4485('0x11')],'app':_0x4485('0x12'),'appdata':_0x4485('0x2b')+_0x4fd390[_0x4485('0x2a')],'context':_0x4fd390['context'],'exten':_0x4fd390['exten'],'priority':_0x4562af[_0x4485('0x2c')]+_0x53cc9e[_0x4485('0xe')]+_0x22c9ae++,'VoiceExtensionId':_0x4fd390['VoiceExtensionId']});}}if(_0x4fd390[_0x4485('0x11')]===_0x4485('0x19')&&_0x4fd390[_0x4485('0xd')]('callerID')){if(_0x4fd390[_0x4485('0x2d')]){_0x407c3d['push']({'type':_0x4fd390['type'],'app':_0x4485('0x1d'),'appdata':_0x4485('0x2e')+_0x4fd390[_0x4485('0x2d')]+')','context':_0x4fd390['context'],'exten':_0x4fd390[_0x4485('0xa')],'priority':_0x4562af['length']+_0x53cc9e[_0x4485('0xe')]+_0x22c9ae++,'VoiceExtensionId':_0x4fd390['VoiceExtensionId']});}else{_0x407c3d[_0x4485('0x10')]({'type':_0x4fd390[_0x4485('0x11')],'app':_0x4485('0x1d'),'appdata':_0x4485('0x2f'),'context':_0x4fd390[_0x4485('0x14')],'exten':_0x4fd390[_0x4485('0xa')],'priority':_0x4562af[_0x4485('0x2c')]+_0x53cc9e[_0x4485('0xe')]+_0x22c9ae++,'VoiceExtensionId':_0x4fd390[_0x4485('0x18')]});}}if(_0x4fd390[_0x4485('0xd')](_0x4485('0x30'))){if(_0x4f826a[_0x4485('0x31')](_0x4fd390[_0x4485('0x32')][_0x4485('0x25')]())>=0x0&&_0x4fd390['appType']!==_0x4485('0x33')){if(_0x4fd390[_0x4485('0x30')]){_0x407c3d[_0x4485('0x10')]({'type':_0x4fd390[_0x4485('0x11')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x4fd390[_0x4485('0x14')],'exten':_0x4fd390[_0x4485('0xa')],'priority':_0x4562af[_0x4485('0x2c')]+_0x53cc9e[_0x4485('0xe')]+_0x22c9ae++,'VoiceExtensionId':_0x4fd390[_0x4485('0x18')]});_0x407c3d[_0x4485('0x10')]({'type':_0x4fd390[_0x4485('0x11')],'app':_0x4485('0x12'),'appdata':_0x4485('0x34'),'context':_0x4fd390[_0x4485('0x14')],'exten':_0x4fd390[_0x4485('0xa')],'priority':_0x4562af['length']+_0x53cc9e[_0x4485('0xe')]+_0x22c9ae++,'VoiceExtensionId':_0x4fd390[_0x4485('0x18')]});}else{_0x407c3d['push']({'type':_0x4fd390[_0x4485('0x11')],'app':_0x4485('0x1d'),'appdata':_0x4485('0x35'),'context':_0x4fd390[_0x4485('0x14')],'exten':_0x4fd390['exten'],'priority':_0x4562af[_0x4485('0x2c')]+_0x53cc9e[_0x4485('0xe')]+_0x22c9ae++,'VoiceExtensionId':_0x4fd390['VoiceExtensionId']});_0x407c3d[_0x4485('0x10')]({'type':_0x4fd390[_0x4485('0x11')],'app':_0x4485('0x12'),'appdata':_0x4485('0x36'),'context':_0x4fd390[_0x4485('0x14')],'exten':_0x4fd390['exten'],'priority':_0x4562af[_0x4485('0x2c')]+_0x53cc9e[_0x4485('0xe')]+_0x22c9ae++,'VoiceExtensionId':_0x4fd390[_0x4485('0x18')]});}}}for(var _0x481d45=0x0;_0x481d45<_0x4562af['length'];_0x481d45+=0x1){var _0x36a26d=_0x53cc9e['priority']+_0x4562af[_0x4485('0x2c')];var _0x3a92b5=_0x481d45===_0x4562af[_0x4485('0x2c')]-0x1?_0x53cc9e[_0x4485('0xe')]+_0x407c3d[_0x4485('0x2c')]+_0x5d9be1[_0x4485('0x2c')]+0x2:_0x53cc9e[_0x4485('0xe')]+_0x481d45+0x1;_0x407c3d[_0x4485('0x37')](_0x481d45,0x0,{'type':_0x4fd390[_0x4485('0x11')],'app':'GotoIfTime','appdata':_0x4562af[_0x481d45]+'?'+_0x4fd390[_0x4485('0x14')]+',${EXTEN},'+_0x36a26d+':'+_0x4fd390[_0x4485('0x14')]+',${EXTEN},'+_0x3a92b5,'exten':_0x4fd390[_0x4485('0xa')],'context':_0x4fd390[_0x4485('0x14')],'priority':_0x53cc9e['priority']+_0x481d45,'VoiceExtensionId':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x18')]});}_0x4fd390[_0x4485('0xe')]=_0x407c3d[_0x4485('0x2c')]?_['last'](_0x407c3d)[_0x4485('0xe')]+0x1:_0x53cc9e[_0x4485('0xe')];_0x53cc9e[_0x4485('0xe')]=(_0x5d9be1[_0x4485('0x2c')]?_['last'](_0x5d9be1)[_0x4485('0xe')]:_0x4fd390['priority'])+0x1;_0x53cc9e[_0x4485('0x16')]=_['concat'](_0x53cc9e[_0x4485('0x16')],_0x407c3d,[_0x4fd390],_0x5d9be1);}_0x53cc9e[_0x4485('0x16')][_0x4485('0x10')]({'type':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x11')],'app':'Hangup','exten':_0x4911dc[_0x4f0a83][0x0][_0x4485('0xa')],'context':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x14')],'priority':_0x53cc9e[_0x4485('0xe')],'VoiceExtensionId':_0x4911dc[_0x4f0a83][0x0][_0x4485('0x18')]});_0x2b0c32[_0x4485('0x10')](_0x4911dc[_0x4f0a83][0x0][_0x4485('0x18')]);_0x3d7b79=_[_0x4485('0x38')](_0x3d7b79,_0x53cc9e['extensions']);}}return _0x24ecc6['transaction'](function(_0x2341d3){return _0x24ecc6[_0x4485('0x2')][_0x4485('0x7')][_0x4485('0x39')]({'where':{'VoiceExtensionId':{'$in':_0x2b0c32}},'transaction':_0x2341d3})[_0x4485('0x5')](function(_0x277b4c){return _0x24ecc6[_0x4485('0x2')][_0x4485('0x7')][_0x4485('0x3a')](_[_0x4485('0x3b')](_0x3d7b79,_0x4485('0xe')),{'transaction':_0x2341d3});});});})[_0x4485('0x3c')](function(_0x429995){console[_0x4485('0x3d')](_0x429995);});}exports[_0x4485('0x3e')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 1701dfe..ce83322 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 _0xda69=['lodash','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','undefined','argv','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\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','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','CmContact','create','keys','then','pick','catch','stringify','cmContact','checkHopper','cm_hopper','fromQuery','scheduledAt','ListId','createdAt','updatedAt','select','field','NOW()','toString','from','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','into','cm_contacts','id\x20IN\x20?','phone\x20IS\x20NOT\x20NULL','calleridnum','insert','ContactId','str','cm_hopper_black','VoiceQueue','dialCheckDuplicateType','CmList','Lists','always','push','sequelize','VoiceQueueId','onlyIfOpen','query','all','findAll','outbound','BlackLists','get','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','duplicate','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xda69,0xe2));var _0x9da6=function(_0x382a62,_0x1baa5e){_0x382a62=_0x382a62-0x0;var _0x490a25=_0xda69[_0x382a62];return _0x490a25;};'use strict';var BPromise=require(_0x9da6('0x0'));var util=require(_0x9da6('0x1'));var _=require(_0x9da6('0x2'));var fs=require('fs');var squel=require(_0x9da6('0x3'));var Papa=require(_0x9da6('0x4'));var Redis=require('ioredis');var db=require(_0x9da6('0x5'))['db'];var config=require(_0x9da6('0x6'));var logger=require(_0x9da6('0x7'))(_0x9da6('0x8'));config[_0x9da6('0x9')]=_[_0x9da6('0xa')](config['redis'],{'host':_0x9da6('0xb'),'port':0x18eb});var socket=require(_0x9da6('0xc'))(new Redis(config['redis']));require(_0x9da6('0xd'))[_0x9da6('0xe')](socket);try{if(!process['argv'][0x2]||process['argv'][0x2]===_0x9da6('0xf')||process[_0x9da6('0x10')][0x2]==='null'){throw new Error(_0x9da6('0x11'));}var FILEPATH=process[_0x9da6('0x10')][0x2];if(!process[_0x9da6('0x10')][0x3]||process[_0x9da6('0x10')][0x3]===_0x9da6('0xf')||process[_0x9da6('0x10')][0x3]===_0x9da6('0x12')||!process['argv'][0x4]||process[_0x9da6('0x10')][0x4]==='undefined'||process[_0x9da6('0x10')][0x4]===_0x9da6('0x12')){throw new Error(_0x9da6('0x13'));}var FIELDS=_[_0x9da6('0x14')](process[_0x9da6('0x10')][0x3][_0x9da6('0x15')](','),process[_0x9da6('0x10')][0x4][_0x9da6('0x15')](','));if(!process['argv'][0x5]||process[_0x9da6('0x10')][0x5]===_0x9da6('0xf')||process['argv'][0x5]==='null'){throw new Error(_0x9da6('0x16'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x9da6('0x10')][0x6]&&process[_0x9da6('0x10')][0x6]!==_0x9da6('0xf')&&process['argv'][0x6]!==_0x9da6('0x12')?process[_0x9da6('0x10')][0x6]:null;var DUPLICATES=process[_0x9da6('0x10')][0x7]&&process[_0x9da6('0x10')][0x7]!==_0x9da6('0xf')&&process[_0x9da6('0x10')][0x7]!==_0x9da6('0x12')?process[_0x9da6('0x10')][0x7]:null;if(!process[_0x9da6('0x10')][0x8]||process[_0x9da6('0x10')][0x8]===_0x9da6('0xf')||process['argv'][0x8]===_0x9da6('0x12')){throw new Error(_0x9da6('0x17'));}var SOCKET_TIMESTAMP=process[_0x9da6('0x10')][0x8];}catch(_0x4791b6){logger['error'](_0x4791b6);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(_0xfc463e,_0x271e82,_0x2ecb98,_0x1b2f32){var _0x45d26b={'message':_0x271e82};_0x45d26b[_0xfc463e]=!![];if(_0x2ecb98){_0x45d26b[_0x9da6('0x18')]=_0x2ecb98;}if(_0x1b2f32){_0x45d26b[_0x9da6('0x19')]=_0x1b2f32;}return _0x45d26b;}function isEmail(_0x2db407){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))*$/[_0x9da6('0x1a')](_0x2db407);}function checkRow(_0x5f5493,_0x47a609,_0x5a643a){return new BPromise(function(_0x2d28f6,_0x460620){if(_[_0x9da6('0x1b')](_0x5f5493)){return _0x460620(handleCheckRowError(_0x9da6('0x1c'),_0x9da6('0x1d'),null,_0x5a643a));}if(_0x5f5493[_0x9da6('0x1e')]&&_0x5f5493[_0x9da6('0x1e')][_0x9da6('0x1f')]){var _0x33c1b4=_[_0x9da6('0x20')](_0x5f5493['errors'],_0x9da6('0x21'))[_0x9da6('0x22')](';');return _0x460620(handleCheckRowError(_0x9da6('0x1c'),_0x33c1b4,null,_0x5a643a));}var _0x49592b={};for(var _0x5be7a0 in FIELDS){if(FIELDS[_0x9da6('0x23')](_0x5be7a0)&&FIELDS[_0x5be7a0]){_0x49592b[_0x5be7a0]=_0x5f5493[_0x9da6('0x24')][0x0][FIELDS[_0x5be7a0]]||_0x5f5493[_0x9da6('0x24')][0x0]['\ufeff'+FIELDS[_0x5be7a0]];}}if(!_0x49592b['firstName']){return _0x460620(handleCheckRowError(_0x9da6('0x1c'),_0x9da6('0x25'),null,_0x5a643a));}if(!_0x49592b[_0x9da6('0x26')]){return _0x460620(handleCheckRowError('error','phone\x20not\x20specified!',null,_0x5a643a));}if(_0x49592b[_0x9da6('0x27')]){var _0x5a8be7=moment(_0x49592b[_0x9da6('0x27')],'YYYY-MM-DD');if(!_0x5a8be7[_0x9da6('0x28')]()){return _0x460620(handleCheckRowError(_0x9da6('0x1c'),_0x9da6('0x29'),null,_0x5a643a));}}if(_0x49592b[_0x9da6('0x2a')]){if(!isEmail(_0x49592b['email'])){return _0x460620(handleCheckRowError('error',_0x9da6('0x2b'),null,_0x5a643a));}}_0x49592b['ListId']=LISTID;_0x49592b[_0x9da6('0x2c')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x9da6('0x1f')]&&_0x47a609){var _0x20703b={};for(var _0x2a9766=0x0,_0x3b5733=DUPLICATES[_0x9da6('0x1f')];_0x2a9766<_0x3b5733;_0x2a9766+=0x1){_0x20703b[DUPLICATES[_0x2a9766]]=_0x49592b[DUPLICATES[_0x2a9766]];}var _0x51689e=_['find'](_0x47a609,_0x20703b);if(_0x51689e){return _0x460620(handleCheckRowError('duplicate','Duplicate\x20Contact',_0x51689e,_0x5a643a));}}return db[_0x9da6('0x2d')][_0x9da6('0x2e')](_0x49592b,{'raw':!![],'hooks':![],'fields':_[_0x9da6('0x2f')](_0x49592b)})[_0x9da6('0x30')](function(_0x37fac1){if(DUPLICATES&&DUPLICATES[_0x9da6('0x1f')]&&_0x47a609){_0x47a609['push'](_[_0x9da6('0x31')](_0x49592b,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x37fac1['id'];return _0x2d28f6();})[_0x9da6('0x32')](function(_0x52ecea){return _0x460620(handleCheckRowError(_0x9da6('0x1c'),'Error\x20while\x20creating\x20contact:\x20'+(_0x52ecea[_0x9da6('0x21')]||JSON[_0x9da6('0x33')](_0x52ecea)),null,_0x5a643a));});});}function checkHopper(){function _0x2d7773(){return function(_0x3b6f7a){logger[_0x9da6('0x1c')](_0x9da6('0x34'),_0x9da6('0x35'),util['inspect'](_0x3b6f7a,{'showHidden':![],'depth':null}));};}var _0x38279f=function(_0x30b3ea,_0x233a93){var _0x8277f1=squel['insert']()['into'](_0x9da6('0x36'))[_0x9da6('0x37')](['phone',_0x9da6('0x38'),'ContactId',_0x9da6('0x39'),_0x233a93,_0x9da6('0x3a'),_0x9da6('0x3b')],squel[_0x9da6('0x3c')]()[_0x9da6('0x3d')](_0x9da6('0x26'),_0x9da6('0x26'))['field'](_0x9da6('0x3e'),_0x9da6('0x38'))['field']('id','ContactId')[_0x9da6('0x3d')](LISTID[_0x9da6('0x3f')](),_0x9da6('0x39'))['field'](_0x30b3ea['id'][_0x9da6('0x3f')](),_0x233a93)[_0x9da6('0x3d')](_0x9da6('0x3e'),'createdAt')[_0x9da6('0x3d')](_0x9da6('0x3e'),'updatedAt')[_0x9da6('0x40')]('cm_contacts')[_0x9da6('0x41')](_0x9da6('0x42'))[_0x9da6('0x41')](_0x9da6('0x43'),LISTID[_0x9da6('0x3f')]())[_0x9da6('0x41')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x9da6('0x44'),squel[_0x9da6('0x3c')]()[_0x9da6('0x3d')](_0x9da6('0x26'))[_0x9da6('0x40')](_0x9da6('0x36'))['where'](_0x233a93+_0x9da6('0x45'),_0x30b3ea['id']['toString']())))[_0x9da6('0x3f')]();return _0x8277f1;};var _0x713f2b=function(_0x2bb509,_0x49be7e){var _0x33e63c=squel['insert']()[_0x9da6('0x46')](_0x9da6('0x36'))['fromQuery']([_0x9da6('0x26'),_0x9da6('0x38'),'ContactId',_0x9da6('0x39'),_0x49be7e,_0x9da6('0x3a'),_0x9da6('0x3b')],squel['select']()[_0x9da6('0x3d')](_0x9da6('0x26'),_0x9da6('0x26'))[_0x9da6('0x3d')](_0x9da6('0x3e'),_0x9da6('0x38'))[_0x9da6('0x3d')]('id','ContactId')[_0x9da6('0x3d')](LISTID['toString'](),_0x9da6('0x39'))[_0x9da6('0x3d')](_0x2bb509['id'][_0x9da6('0x3f')](),_0x49be7e)[_0x9da6('0x3d')](_0x9da6('0x3e'),'createdAt')['field']('NOW()',_0x9da6('0x3b'))[_0x9da6('0x40')](_0x9da6('0x47'))[_0x9da6('0x41')](_0x9da6('0x42'))[_0x9da6('0x41')](_0x9da6('0x43'),LISTID[_0x9da6('0x3f')]())[_0x9da6('0x41')](_0x9da6('0x48'),squel['str'](hopperContacts))['where'](_0x9da6('0x49'))[_0x9da6('0x41')](_0x9da6('0x44'),squel['select']()[_0x9da6('0x3d')](_0x9da6('0x4a'))['from']('cm_hopper_final')['where'](_0x49be7e+_0x9da6('0x45'),_0x2bb509['id'][_0x9da6('0x3f')]()))[_0x9da6('0x41')](_0x9da6('0x44'),squel[_0x9da6('0x3c')]()[_0x9da6('0x3d')](_0x9da6('0x26'))[_0x9da6('0x40')](_0x9da6('0x36'))[_0x9da6('0x41')](_0x49be7e+_0x9da6('0x45'),_0x2bb509['id'][_0x9da6('0x3f')]())))['toString']();return _0x33e63c;};function _0x24f473(_0x4baff8,_0x2e5028){var _0x43a4bb=squel[_0x9da6('0x4b')]()[_0x9da6('0x46')](_0x9da6('0x36'))[_0x9da6('0x37')](['phone',_0x9da6('0x38'),_0x9da6('0x4c'),_0x9da6('0x39'),_0x2e5028,_0x9da6('0x3a'),'updatedAt'],squel[_0x9da6('0x3c')]()[_0x9da6('0x3d')](_0x9da6('0x26'),'phone')['field'](_0x9da6('0x3e'),'scheduledAt')[_0x9da6('0x3d')]('id',_0x9da6('0x4c'))[_0x9da6('0x3d')](LISTID[_0x9da6('0x3f')](),'ListId')[_0x9da6('0x3d')](_0x4baff8['id']['toString'](),_0x2e5028)[_0x9da6('0x3d')]('NOW()','createdAt')[_0x9da6('0x3d')](_0x9da6('0x3e'),_0x9da6('0x3b'))[_0x9da6('0x40')](_0x9da6('0x47'))['where'](_0x9da6('0x42'))[_0x9da6('0x41')](_0x9da6('0x43'),LISTID[_0x9da6('0x3f')]())['where'](_0x9da6('0x48'),squel[_0x9da6('0x4d')](hopperContacts))[_0x9da6('0x41')](_0x9da6('0x49')))[_0x9da6('0x3f')]();return _0x43a4bb;}function _0x4b4207(_0x239890,_0x44bc94){var _0x554ad5=squel[_0x9da6('0x4b')]()[_0x9da6('0x46')](_0x9da6('0x4e'))[_0x9da6('0x37')]([_0x9da6('0x26'),_0x9da6('0x4c'),_0x9da6('0x39'),_0x44bc94,_0x9da6('0x3a'),_0x9da6('0x3b')],squel[_0x9da6('0x3c')]()[_0x9da6('0x3d')](_0x9da6('0x26'),_0x9da6('0x26'))[_0x9da6('0x3d')]('id',_0x9da6('0x4c'))[_0x9da6('0x3d')](LISTID['toString'](),'ListId')[_0x9da6('0x3d')](_0x239890['id'][_0x9da6('0x3f')](),_0x44bc94)[_0x9da6('0x3d')](_0x9da6('0x3e'),_0x9da6('0x3a'))[_0x9da6('0x3d')]('NOW()',_0x9da6('0x3b'))['from']('cm_contacts')[_0x9da6('0x41')](_0x9da6('0x42'))['where'](_0x9da6('0x43'),LISTID[_0x9da6('0x3f')]())[_0x9da6('0x41')](_0x9da6('0x48'),squel['str'](hopperContacts))['where'](_0x9da6('0x49')))[_0x9da6('0x3f')]();return _0x554ad5;}return db[_0x9da6('0x4f')]['findAll']({'where':{'type':'outbound'},'attributes':['id',_0x9da6('0x50')],'include':[{'model':db[_0x9da6('0x51')],'as':_0x9da6('0x52'),'where':{'id':LISTID}}]})[_0x9da6('0x30')](function(_0xfa918c){var _0x1e8eb9=[];if(_0xfa918c){var _0x5ea1fe;for(var _0x3c3506=0x0,_0x421ef0;_0x3c3506<_0xfa918c['length'];_0x3c3506+=0x1){_0x421ef0=_0xfa918c[_0x3c3506]['get']({'plain':!![]});switch(_0x421ef0['dialCheckDuplicateType']){case _0x9da6('0x53'):_0x1e8eb9[_0x9da6('0x54')](db[_0x9da6('0x55')]['query'](_0x713f2b(_0x421ef0,_0x9da6('0x56')))['then'](function(){})['catch'](_0x2d7773()));break;case _0x9da6('0x57'):_0x1e8eb9[_0x9da6('0x54')](db['sequelize'][_0x9da6('0x58')](_0x38279f(_0x421ef0,_0x9da6('0x56')))[_0x9da6('0x30')](function(){})[_0x9da6('0x32')](_0x2d7773()));break;default:_0x1e8eb9['push'](db[_0x9da6('0x55')][_0x9da6('0x58')](_0x24f473(_0x421ef0,_0x9da6('0x56')))[_0x9da6('0x30')](function(){})['catch'](_0x2d7773()));}}}return _0x1e8eb9;})[_0x9da6('0x59')]()[_0x9da6('0x30')](function(){return db[_0x9da6('0x4f')][_0x9da6('0x5a')]({'where':{'type':_0x9da6('0x5b')},'attributes':['id'],'include':[{'model':db[_0x9da6('0x51')],'as':_0x9da6('0x5c'),'where':{'id':LISTID}}]})[_0x9da6('0x30')](function(_0x559e6b){var _0x1f8302=[];if(_0x559e6b){var _0x94bdbf;for(var _0x49e7b4=0x0,_0x1d5be9;_0x49e7b4<_0x559e6b[_0x9da6('0x1f')];_0x49e7b4+=0x1){_0x1d5be9=_0x559e6b[_0x49e7b4][_0x9da6('0x5d')]({'plain':!![]});_0x1f8302[_0x9da6('0x54')](db['sequelize'][_0x9da6('0x58')](_0x4b4207(_0x1d5be9,_0x9da6('0x56')))[_0x9da6('0x30')](function(){})[_0x9da6('0x32')](_0x2d7773()));}}return _0x1f8302;})[_0x9da6('0x59')]();})[_0x9da6('0x30')](function(){return db['Campaign'][_0x9da6('0x5a')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x9da6('0x51')],'as':_0x9da6('0x52'),'where':{'id':LISTID}}]})['then'](function(_0x57566d){var _0x582382=[];if(_0x57566d){for(var _0x42317b=0x0,_0x3331f1;_0x42317b<_0x57566d[_0x9da6('0x1f')];_0x42317b+=0x1){_0x3331f1=_0x57566d[_0x42317b][_0x9da6('0x5d')]({'plain':!![]});switch(_0x3331f1[_0x9da6('0x50')]){case _0x9da6('0x53'):_0x582382['push'](db[_0x9da6('0x55')][_0x9da6('0x58')](_0x713f2b(_0x3331f1,_0x9da6('0x5e')))[_0x9da6('0x30')](function(){})['catch'](_0x2d7773()));break;case _0x9da6('0x57'):_0x582382['push'](db[_0x9da6('0x55')]['query'](_0x38279f(_0x3331f1,_0x9da6('0x5e')))[_0x9da6('0x30')](function(){})[_0x9da6('0x32')](_0x2d7773()));break;default:_0x582382[_0x9da6('0x54')](db[_0x9da6('0x55')][_0x9da6('0x58')](_0x24f473(_0x3331f1,'CampaignId'))[_0x9da6('0x30')](function(){})[_0x9da6('0x32')](_0x2d7773()));}}}return _0x582382;})[_0x9da6('0x59')]();})['then'](function(){return db['Campaign'][_0x9da6('0x5a')]({'attributes':['id'],'include':[{'model':db[_0x9da6('0x51')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x9da6('0x30')](function(_0x329ec3){var _0x2abb60=[];if(_0x329ec3){for(var _0x27684f=0x0,_0x3bfeeb;_0x27684f<_0x329ec3['length'];_0x27684f+=0x1){_0x3bfeeb=_0x329ec3[_0x27684f][_0x9da6('0x5d')]({'plain':!![]});_0x2abb60[_0x9da6('0x54')](db[_0x9da6('0x55')][_0x9da6('0x58')](_0x4b4207(_0x3bfeeb,_0x9da6('0x5e')))['then'](function(){})['catch'](_0x2d7773()));}}return _0x2abb60;})['all']();})[_0x9da6('0x32')](function(_0xd2fb69){logger[_0x9da6('0x1c')](_0x9da6('0x5f'),_0x9da6('0x60'),_0xd2fb69[_0x9da6('0x21')]);});}var processPromises=function(_0x16016f){return BPromise['all'](promises)['then'](function(_0x3ee2ce){})['catch'](function(_0x36ee7d){logger[_0x9da6('0x1c')](_0x9da6('0x61'),JSON[_0x9da6('0x33')](_0x36ee7d));})[_0x9da6('0x62')](function(){socket[_0x9da6('0x63')](_0x9da6('0x64')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x16016f){return _0x16016f[_0x9da6('0x65')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x9da6('0x30')](function(){if(hopperContacts){return checkHopper();}})[_0x9da6('0x30')](function(){socket[_0x9da6('0x63')](_0x9da6('0x64')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x9da6('0x66')](FILEPATH);}catch(_0x1bbfc8){logger[_0x9da6('0x1c')](_0x9da6('0x67'),JSON[_0x9da6('0x33')](_0x1bbfc8));}finally{process['exit'](0x0);}});};process['on'](_0x9da6('0x68'),function(){logger[_0x9da6('0x69')](_0x9da6('0x6a'));endCsv();});function main(){return BPromise[_0x9da6('0x6b')]()[_0x9da6('0x30')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x9da6('0x15')](',');return db[_0x9da6('0x2d')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x9da6('0x30')](function(_0x5baae5){var _0xe6747d=fs[_0x9da6('0x6c')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x9da6('0x6d')](_0xe6747d,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2932de,_0x348d62){total+=0x1;var _0x2060ca=total;promises[_0x9da6('0x54')](checkRow(_0x2932de,_0x5baae5,_0x2060ca)[_0x9da6('0x30')](function(){success+=0x1;})['catch'](function(_0x93bcbb){if(_0x93bcbb[_0x9da6('0x1c')]){errors+=0x1;delete _0x93bcbb['error'];}else if(_0x93bcbb[_0x9da6('0x6e')]){duplicates+=0x1;delete _0x93bcbb[_0x9da6('0x6e')];}rows[_0x9da6('0x54')](_0x93bcbb);}));if(total%0xc8===0x0){_0x348d62[_0x9da6('0x6f')]();return processPromises(_0x348d62);}},'complete':function(){return processPromises()[_0x9da6('0x30')](function(){logger[_0x9da6('0x69')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0xd68cb0,_0x4f800b){logger[_0x9da6('0x69')](_0x9da6('0x70'),JSON[_0x9da6('0x33')](_0xd68cb0));endCsv();}});})[_0x9da6('0x32')](function(_0x1645ed){logger[_0x9da6('0x1c')](_0x9da6('0x71'),JSON[_0x9da6('0x33')](_0x1645ed));});}main(); \ No newline at end of file +var _0xe26c=['fromQuery','ContactId','ListId','createdAt','select','field','scheduledAt','toString','NOW()','updatedAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','insert','into','id\x20IN\x20?','str','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','then','get','dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','catch','onlyIfOpen','BlackLists','all','CampaignId','Campaign','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','CSV\x20import\x20process\x20stopped!','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel','ioredis','../../../config/environment','../../../config/logger','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','test','isNil','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','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','find','duplicate','Duplicate\x20Contact','CmContact','create','push','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','inspect','cm_hopper'];(function(_0x4720bc,_0x1dfa61){var _0x538932=function(_0x5d1b89){while(--_0x5d1b89){_0x4720bc['push'](_0x4720bc['shift']());}};_0x538932(++_0x1dfa61);}(_0xe26c,0x176));var _0xce26=function(_0x3cd55e,_0x358e2e){_0x3cd55e=_0x3cd55e-0x0;var _0x13e629=_0xe26c[_0x3cd55e];return _0x13e629;};'use strict';var BPromise=require(_0xce26('0x0'));var util=require('util');var _=require(_0xce26('0x1'));var fs=require('fs');var squel=require(_0xce26('0x2'));var Papa=require('papaparse');var Redis=require(_0xce26('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0xce26('0x4'));var logger=require(_0xce26('0x5'))(_0xce26('0x6'));config[_0xce26('0x7')]=_['defaults'](config[_0xce26('0x7')],{'host':_0xce26('0x8'),'port':0x18eb});var socket=require(_0xce26('0x9'))(new Redis(config['redis']));require(_0xce26('0xa'))[_0xce26('0xb')](socket);try{if(!process[_0xce26('0xc')][0x2]||process[_0xce26('0xc')][0x2]==='undefined'||process['argv'][0x2]===_0xce26('0xd')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process['argv'][0x2];if(!process[_0xce26('0xc')][0x3]||process[_0xce26('0xc')][0x3]===_0xce26('0xe')||process[_0xce26('0xc')][0x3]===_0xce26('0xd')||!process[_0xce26('0xc')][0x4]||process[_0xce26('0xc')][0x4]===_0xce26('0xe')||process[_0xce26('0xc')][0x4]==='null'){throw new Error(_0xce26('0xf'));}var FIELDS=_[_0xce26('0x10')](process['argv'][0x3][_0xce26('0x11')](','),process[_0xce26('0xc')][0x4][_0xce26('0x11')](','));if(!process[_0xce26('0xc')][0x5]||process['argv'][0x5]==='undefined'||process[_0xce26('0xc')][0x5]===_0xce26('0xd')){throw new Error(_0xce26('0x12'));}var LISTID=process[_0xce26('0xc')][0x5];var COMPANYID=process[_0xce26('0xc')][0x6]&&process['argv'][0x6]!==_0xce26('0xe')&&process[_0xce26('0xc')][0x6]!=='null'?process['argv'][0x6]:null;var DUPLICATES=process[_0xce26('0xc')][0x7]&&process[_0xce26('0xc')][0x7]!==_0xce26('0xe')&&process[_0xce26('0xc')][0x7]!=='null'?process[_0xce26('0xc')][0x7]:null;if(!process[_0xce26('0xc')][0x8]||process['argv'][0x8]===_0xce26('0xe')||process['argv'][0x8]===_0xce26('0xd')){throw new Error(_0xce26('0x13'));}var SOCKET_TIMESTAMP=process[_0xce26('0xc')][0x8];}catch(_0x10ff41){logger[_0xce26('0x14')](_0x10ff41);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(_0x400475,_0x10332c,_0x179e5f,_0x1abd75){var _0x347d7a={'message':_0x10332c};_0x347d7a[_0x400475]=!![];if(_0x179e5f){_0x347d7a['contact']=_0x179e5f;}if(_0x1abd75){_0x347d7a['index']=_0x1abd75;}return _0x347d7a;}function isEmail(_0x37ba88){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))*$/[_0xce26('0x15')](_0x37ba88);}function checkRow(_0x448957,_0x206062,_0x44e9cb){return new BPromise(function(_0x4a4f3f,_0x237bc0){if(_[_0xce26('0x16')](_0x448957)){return _0x237bc0(handleCheckRowError(_0xce26('0x14'),_0xce26('0x17'),null,_0x44e9cb));}if(_0x448957[_0xce26('0x18')]&&_0x448957[_0xce26('0x18')][_0xce26('0x19')]){var _0x4d0f14=_[_0xce26('0x1a')](_0x448957['errors'],_0xce26('0x1b'))[_0xce26('0x1c')](';');return _0x237bc0(handleCheckRowError('error',_0x4d0f14,null,_0x44e9cb));}var _0x1d4ea3={};for(var _0x4a7718 in FIELDS){if(FIELDS[_0xce26('0x1d')](_0x4a7718)&&FIELDS[_0x4a7718]){_0x1d4ea3[_0x4a7718]=_0x448957[_0xce26('0x1e')][0x0][FIELDS[_0x4a7718]]||_0x448957['data'][0x0]['\ufeff'+FIELDS[_0x4a7718]];}}if(!_0x1d4ea3['firstName']){return _0x237bc0(handleCheckRowError(_0xce26('0x14'),_0xce26('0x1f'),null,_0x44e9cb));}if(!_0x1d4ea3[_0xce26('0x20')]){return _0x237bc0(handleCheckRowError(_0xce26('0x14'),'phone\x20not\x20specified!',null,_0x44e9cb));}if(_0x1d4ea3[_0xce26('0x21')]){var _0x4f7a07=moment(_0x1d4ea3[_0xce26('0x21')],_0xce26('0x22'));if(!_0x4f7a07[_0xce26('0x23')]()){return _0x237bc0(handleCheckRowError(_0xce26('0x14'),_0xce26('0x24'),null,_0x44e9cb));}}if(_0x1d4ea3[_0xce26('0x25')]){if(!isEmail(_0x1d4ea3['email'])){return _0x237bc0(handleCheckRowError(_0xce26('0x14'),_0xce26('0x26'),null,_0x44e9cb));}}_0x1d4ea3['ListId']=LISTID;_0x1d4ea3['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xce26('0x19')]&&_0x206062){var _0x4f50ed={};for(var _0x5550aa=0x0,_0x57f5c7=DUPLICATES['length'];_0x5550aa<_0x57f5c7;_0x5550aa+=0x1){_0x4f50ed[DUPLICATES[_0x5550aa]]=_0x1d4ea3[DUPLICATES[_0x5550aa]];}var _0x3c03dd=_[_0xce26('0x27')](_0x206062,_0x4f50ed);if(_0x3c03dd){return _0x237bc0(handleCheckRowError(_0xce26('0x28'),_0xce26('0x29'),_0x3c03dd,_0x44e9cb));}}return db[_0xce26('0x2a')][_0xce26('0x2b')](_0x1d4ea3,{'raw':!![],'hooks':![],'fields':_['keys'](_0x1d4ea3)})['then'](function(_0x1ca1e3){if(DUPLICATES&&DUPLICATES[_0xce26('0x19')]&&_0x206062){_0x206062[_0xce26('0x2c')](_['pick'](_0x1d4ea3,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1ca1e3['id'];return _0x4a4f3f();})['catch'](function(_0x318df1){return _0x237bc0(handleCheckRowError(_0xce26('0x14'),_0xce26('0x2d')+(_0x318df1['message']||JSON[_0xce26('0x2e')](_0x318df1)),null,_0x44e9cb));});});}function checkHopper(){function _0x1f8466(){return function(_0x51a1ac){logger[_0xce26('0x14')](_0xce26('0x2f'),'checkHopper',util[_0xce26('0x30')](_0x51a1ac,{'showHidden':![],'depth':null}));};}var _0x1514a3=function(_0x40f274,_0x409eef){var _0x2b4ce2=squel['insert']()['into'](_0xce26('0x31'))[_0xce26('0x32')]([_0xce26('0x20'),'scheduledAt',_0xce26('0x33'),_0xce26('0x34'),_0x409eef,_0xce26('0x35'),'updatedAt'],squel[_0xce26('0x36')]()[_0xce26('0x37')](_0xce26('0x20'),'phone')[_0xce26('0x37')]('NOW()',_0xce26('0x38'))[_0xce26('0x37')]('id',_0xce26('0x33'))['field'](LISTID[_0xce26('0x39')](),_0xce26('0x34'))[_0xce26('0x37')](_0x40f274['id'][_0xce26('0x39')](),_0x409eef)[_0xce26('0x37')](_0xce26('0x3a'),_0xce26('0x35'))['field'](_0xce26('0x3a'),_0xce26('0x3b'))[_0xce26('0x3c')](_0xce26('0x3d'))[_0xce26('0x3e')](_0xce26('0x3f'))[_0xce26('0x3e')](_0xce26('0x40'),LISTID['toString']())[_0xce26('0x3e')](_0xce26('0x41'))[_0xce26('0x3e')](_0xce26('0x42'),squel[_0xce26('0x36')]()[_0xce26('0x37')]('phone')[_0xce26('0x3c')](_0xce26('0x31'))[_0xce26('0x3e')](_0x409eef+_0xce26('0x43'),_0x40f274['id'][_0xce26('0x39')]())))[_0xce26('0x39')]();return _0x2b4ce2;};var _0x437b8d=function(_0x52bb87,_0x3206ce){var _0x1d8e81=squel[_0xce26('0x44')]()[_0xce26('0x45')](_0xce26('0x31'))[_0xce26('0x32')]([_0xce26('0x20'),_0xce26('0x38'),'ContactId','ListId',_0x3206ce,_0xce26('0x35'),_0xce26('0x3b')],squel[_0xce26('0x36')]()[_0xce26('0x37')](_0xce26('0x20'),_0xce26('0x20'))['field'](_0xce26('0x3a'),_0xce26('0x38'))['field']('id',_0xce26('0x33'))['field'](LISTID[_0xce26('0x39')](),'ListId')[_0xce26('0x37')](_0x52bb87['id'][_0xce26('0x39')](),_0x3206ce)['field']('NOW()',_0xce26('0x35'))[_0xce26('0x37')](_0xce26('0x3a'),'updatedAt')[_0xce26('0x3c')]('cm_contacts')['where'](_0xce26('0x3f'))[_0xce26('0x3e')](_0xce26('0x40'),LISTID[_0xce26('0x39')]())[_0xce26('0x3e')](_0xce26('0x46'),squel[_0xce26('0x47')](hopperContacts))[_0xce26('0x3e')](_0xce26('0x41'))[_0xce26('0x3e')](_0xce26('0x42'),squel['select']()[_0xce26('0x37')]('calleridnum')[_0xce26('0x3c')]('cm_hopper_final')[_0xce26('0x3e')](_0x3206ce+_0xce26('0x43'),_0x52bb87['id'][_0xce26('0x39')]()))[_0xce26('0x3e')](_0xce26('0x42'),squel['select']()[_0xce26('0x37')](_0xce26('0x20'))['from'](_0xce26('0x31'))[_0xce26('0x3e')](_0x3206ce+'\x20=\x20?',_0x52bb87['id'][_0xce26('0x39')]())))[_0xce26('0x39')]();return _0x1d8e81;};function _0x2d0b3(_0x349e04,_0x17c8dc){var _0x19542b=squel[_0xce26('0x44')]()[_0xce26('0x45')](_0xce26('0x31'))[_0xce26('0x32')]([_0xce26('0x20'),_0xce26('0x38'),_0xce26('0x33'),_0xce26('0x34'),_0x17c8dc,_0xce26('0x35'),'updatedAt'],squel['select']()[_0xce26('0x37')](_0xce26('0x20'),_0xce26('0x20'))[_0xce26('0x37')](_0xce26('0x3a'),_0xce26('0x38'))[_0xce26('0x37')]('id','ContactId')[_0xce26('0x37')](LISTID[_0xce26('0x39')](),_0xce26('0x34'))[_0xce26('0x37')](_0x349e04['id']['toString'](),_0x17c8dc)[_0xce26('0x37')](_0xce26('0x3a'),_0xce26('0x35'))[_0xce26('0x37')](_0xce26('0x3a'),'updatedAt')[_0xce26('0x3c')](_0xce26('0x3d'))[_0xce26('0x3e')](_0xce26('0x3f'))[_0xce26('0x3e')](_0xce26('0x40'),LISTID[_0xce26('0x39')]())[_0xce26('0x3e')](_0xce26('0x46'),squel[_0xce26('0x47')](hopperContacts))[_0xce26('0x3e')](_0xce26('0x41')))['toString']();return _0x19542b;}function _0x15932f(_0x2d79ca,_0x573a98){var _0x1b7928=squel['insert']()['into'](_0xce26('0x48'))[_0xce26('0x32')]([_0xce26('0x20'),'ContactId',_0xce26('0x34'),_0x573a98,_0xce26('0x35'),_0xce26('0x3b')],squel[_0xce26('0x36')]()['field'](_0xce26('0x20'),_0xce26('0x20'))[_0xce26('0x37')]('id','ContactId')['field'](LISTID[_0xce26('0x39')](),_0xce26('0x34'))[_0xce26('0x37')](_0x2d79ca['id'][_0xce26('0x39')](),_0x573a98)['field'](_0xce26('0x3a'),_0xce26('0x35'))[_0xce26('0x37')](_0xce26('0x3a'),_0xce26('0x3b'))[_0xce26('0x3c')](_0xce26('0x3d'))[_0xce26('0x3e')](_0xce26('0x3f'))['where'](_0xce26('0x40'),LISTID[_0xce26('0x39')]())[_0xce26('0x3e')]('id\x20IN\x20?',squel[_0xce26('0x47')](hopperContacts))[_0xce26('0x3e')](_0xce26('0x41')))[_0xce26('0x39')]();return _0x1b7928;}return db[_0xce26('0x49')][_0xce26('0x4a')]({'where':{'type':_0xce26('0x4b')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xce26('0x4c')],'as':_0xce26('0x4d'),'where':{'id':LISTID}}]})[_0xce26('0x4e')](function(_0x4afe39){var _0x4cd390=[];if(_0x4afe39){var _0x74f3e2;for(var _0x531dc0=0x0,_0x5eed27;_0x531dc0<_0x4afe39['length'];_0x531dc0+=0x1){_0x5eed27=_0x4afe39[_0x531dc0][_0xce26('0x4f')]({'plain':!![]});switch(_0x5eed27[_0xce26('0x50')]){case _0xce26('0x51'):_0x4cd390[_0xce26('0x2c')](db[_0xce26('0x52')][_0xce26('0x53')](_0x437b8d(_0x5eed27,_0xce26('0x54')))[_0xce26('0x4e')](function(){})[_0xce26('0x55')](_0x1f8466()));break;case _0xce26('0x56'):_0x4cd390[_0xce26('0x2c')](db['sequelize'][_0xce26('0x53')](_0x1514a3(_0x5eed27,_0xce26('0x54')))[_0xce26('0x4e')](function(){})[_0xce26('0x55')](_0x1f8466()));break;default:_0x4cd390[_0xce26('0x2c')](db[_0xce26('0x52')][_0xce26('0x53')](_0x2d0b3(_0x5eed27,_0xce26('0x54')))[_0xce26('0x4e')](function(){})['catch'](_0x1f8466()));}}}return _0x4cd390;})['all']()[_0xce26('0x4e')](function(){return db[_0xce26('0x49')][_0xce26('0x4a')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0xce26('0x4c')],'as':_0xce26('0x57'),'where':{'id':LISTID}}]})[_0xce26('0x4e')](function(_0x54c1af){var _0x5f33db=[];if(_0x54c1af){var _0x3a541f;for(var _0x2c82f2=0x0,_0x5bd037;_0x2c82f2<_0x54c1af[_0xce26('0x19')];_0x2c82f2+=0x1){_0x5bd037=_0x54c1af[_0x2c82f2]['get']({'plain':!![]});_0x5f33db['push'](db[_0xce26('0x52')]['query'](_0x15932f(_0x5bd037,_0xce26('0x54')))[_0xce26('0x4e')](function(){})['catch'](_0x1f8466()));}}return _0x5f33db;})[_0xce26('0x58')]();})['then'](function(){return db['Campaign']['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xce26('0x4c')],'as':'Lists','where':{'id':LISTID}}]})[_0xce26('0x4e')](function(_0x2acadd){var _0x4e6471=[];if(_0x2acadd){for(var _0x59a92e=0x0,_0x18f88c;_0x59a92e<_0x2acadd[_0xce26('0x19')];_0x59a92e+=0x1){_0x18f88c=_0x2acadd[_0x59a92e]['get']({'plain':!![]});switch(_0x18f88c[_0xce26('0x50')]){case _0xce26('0x51'):_0x4e6471[_0xce26('0x2c')](db[_0xce26('0x52')]['query'](_0x437b8d(_0x18f88c,_0xce26('0x59')))[_0xce26('0x4e')](function(){})[_0xce26('0x55')](_0x1f8466()));break;case'onlyIfOpen':_0x4e6471[_0xce26('0x2c')](db[_0xce26('0x52')][_0xce26('0x53')](_0x1514a3(_0x18f88c,_0xce26('0x59')))[_0xce26('0x4e')](function(){})[_0xce26('0x55')](_0x1f8466()));break;default:_0x4e6471[_0xce26('0x2c')](db[_0xce26('0x52')][_0xce26('0x53')](_0x2d0b3(_0x18f88c,_0xce26('0x59')))['then'](function(){})[_0xce26('0x55')](_0x1f8466()));}}}return _0x4e6471;})['all']();})['then'](function(){return db[_0xce26('0x5a')][_0xce26('0x4a')]({'attributes':['id'],'include':[{'model':db[_0xce26('0x4c')],'as':_0xce26('0x57'),'where':{'id':LISTID}}]})[_0xce26('0x4e')](function(_0x4dcad9){var _0x1e6725=[];if(_0x4dcad9){for(var _0x1998e5=0x0,_0x15dea1;_0x1998e5<_0x4dcad9[_0xce26('0x19')];_0x1998e5+=0x1){_0x15dea1=_0x4dcad9[_0x1998e5][_0xce26('0x4f')]({'plain':!![]});_0x1e6725[_0xce26('0x2c')](db[_0xce26('0x52')][_0xce26('0x53')](_0x15932f(_0x15dea1,'CampaignId'))['then'](function(){})['catch'](_0x1f8466()));}}return _0x1e6725;})[_0xce26('0x58')]();})[_0xce26('0x55')](function(_0x4a2ec6){logger['error']('cmContact,\x20%s,\x20%s',_0xce26('0x5b'),_0x4a2ec6[_0xce26('0x1b')]);});}var processPromises=function(_0x5d80f7){return BPromise['all'](promises)[_0xce26('0x4e')](function(_0x58d048){})['catch'](function(_0x41f982){logger['error'](_0xce26('0x5c'),JSON[_0xce26('0x2e')](_0x41f982));})[_0xce26('0x5d')](function(){socket[_0xce26('0x5e')](_0xce26('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5d80f7){return _0x5d80f7['resume']();}});};var endCsv=function(){return BPromise[_0xce26('0x60')]()[_0xce26('0x4e')](function(){if(hopperContacts){return checkHopper();}})[_0xce26('0x4e')](function(){socket[_0xce26('0x5e')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xce26('0x61')](FILEPATH);}catch(_0x3c1b2a){logger[_0xce26('0x14')](_0xce26('0x62'),JSON[_0xce26('0x2e')](_0x3c1b2a));}finally{process[_0xce26('0x63')](0x0);}});};process['on']('SIGINT',function(){logger[_0xce26('0x64')](_0xce26('0x65'));endCsv();});function main(){return BPromise[_0xce26('0x60')]()[_0xce26('0x4e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xce26('0x11')](',');return db[_0xce26('0x2a')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xce26('0x4e')](function(_0x36a45c){var _0x428504=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x428504,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1e78a5,_0x48ffed){total+=0x1;var _0x1e8114=total;promises['push'](checkRow(_0x1e78a5,_0x36a45c,_0x1e8114)[_0xce26('0x4e')](function(){success+=0x1;})[_0xce26('0x55')](function(_0x16e793){if(_0x16e793[_0xce26('0x14')]){errors+=0x1;delete _0x16e793['error'];}else if(_0x16e793[_0xce26('0x28')]){duplicates+=0x1;delete _0x16e793[_0xce26('0x28')];}rows[_0xce26('0x2c')](_0x16e793);}));if(total%0xc8===0x0){_0x48ffed[_0xce26('0x66')]();return processPromises(_0x48ffed);}},'complete':function(){return processPromises()[_0xce26('0x4e')](function(){logger[_0xce26('0x64')](_0xce26('0x67'));endCsv();});},'error':function(_0x1bc484,_0x1d5176){logger[_0xce26('0x64')](_0xce26('0x68'),JSON[_0xce26('0x2e')](_0x1bc484));endCsv();}});})['catch'](function(_0x4d8742){logger[_0xce26('0x14')](_0xce26('0x69'),JSON['stringify'](_0x4d8742));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index d7fdf14..0bab104 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 _0x1d71=['\x20=\x20','CmContact','findAll','AdditionalPhones','then','push','all','length','isNil','filter','split','CmContactHasItem','update','create','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','into','cm_hopper','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.id','cm_contacts.updatedAt','insert','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_hopper_black','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.UserId','fromQuery','\x22onlyIfOpen\x22','cm_hopper.id','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','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?','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','message','exit','errors','query','spread','catch','error','campaigns.id','campaigns.dialTimezone','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','sequelize','voice_queues.id','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','utcOffset','set','offset','main','stringify','send','start','binding','clone','socket_timestamp','root','server/files/tmp','header','ContactItemType','name','writeFileSync','parse','createReadStream','data','rows','find','_description','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','\x20not\x20specified','hasOwnProperty','itemTypeId','description','SystemRow','appendFileSync','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','contactId','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','CampaignId','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment/shared','import','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','select','field','phone','from','join','.id\x20=\x20','where'];(function(_0x52fe1d,_0x2a4352){var _0x1f489f=function(_0x85da39){while(--_0x85da39){_0x52fe1d['push'](_0x52fe1d['shift']());}};_0x1f489f(++_0x2a4352);}(_0x1d71,0x154));var _0x11d7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d71[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require(_0x11d7('0x0'));var _=require(_0x11d7('0x1'));var Papa=require(_0x11d7('0x2'));var util=require(_0x11d7('0x3'));var BPromise=require(_0x11d7('0x4'));var moment=require(_0x11d7('0x5'));var squel=require(_0x11d7('0x6'));var Redis=require('ioredis');var db=require(_0x11d7('0x7'))['db'];var config=require('../../../config/environment');var shared=require(_0x11d7('0x8'));var logger=require('../../../config/logger')(_0x11d7('0x9'));config[_0x11d7('0xa')]=_['defaults'](config[_0x11d7('0xa')],{'host':_0x11d7('0xb'),'port':0x18eb});var socket=require(_0x11d7('0xc'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x11d7('0xd')](_0x11d7('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x11d7('0xe'));function isEmail(_0x26106e){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x26106e);}function selectNotIn(_0x2172bf,_0x3e8aac,_0x41364d,_0x572e9c,_0x33e3af){return squel[_0x11d7('0xf')]()[_0x11d7('0x10')](_0x11d7('0x11'))[_0x11d7('0x12')](_0x572e9c)[_0x11d7('0x13')](_0x3e8aac,null,_0x3e8aac+_0x11d7('0x14')+_0x572e9c+'.'+_0x41364d)[_0x11d7('0x15')](_0x572e9c+'.'+_0x41364d+_0x11d7('0x16')+_0x2172bf+'.'+_0x41364d)[_0x11d7('0x15')](_0x3e8aac+'.dialCheckDuplicateType\x20IN\x20('+_0x33e3af[_0x11d7('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x32c01a,_0x1e8fdc){promisesAdditionalPhones=[];return db[_0x11d7('0x17')][_0x11d7('0x18')]({'raw':!![],'attributes':['id',_0x11d7('0x19')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x11d7('0x1a')](function(_0x4e6a57){if(_0x4e6a57!==null){var _0x356d85=[];for(var _0x5cef9a=0x0;_0x5cef9a<_0x4e6a57['length'];_0x5cef9a++){var _0x14830d=_0x4e6a57[_0x5cef9a];_0x356d85[_0x11d7('0x1b')](insertAdditionalPhones(_0x14830d));}}Promise[_0x11d7('0x1c')](_0x356d85)['then'](function(){_0x32c01a({'val':0x1});});});});}function insertAdditionalPhones(_0x2b725b){return new Promise(function(_0x3e6a2a,_0x2e22a3){var _0x1aca44=_0x2b725b['AdditionalPhones'];var _0x1c77ca=_0x1aca44['split'](';');var _0x4795bc=[];orderBy=0x0;for(var _0x86cbf6=0x0;_0x86cbf6<_0x1c77ca[_0x11d7('0x1d')];_0x86cbf6++){_0x4795bc['push'](splitAdditionalPhone(_0x2b725b['id'],_0x1c77ca[_0x86cbf6]));}Promise[_0x11d7('0x1c')](_0x4795bc)[_0x11d7('0x1a')](function(){_0x3e6a2a({'val':_0x1c77ca['length']});});});}function splitAdditionalPhone(_0x464dca,_0x2e570f){return new Promise(function(_0xddfca8,_0x557549){var _0x425c1b=_0x2e570f['split'](':');var _0x3adde7=_0x425c1b[0x0];var _0x452c42=_0x425c1b[0x1];if(!_[_0x11d7('0x1e')](_0x452c42)){var _0x17c6bb=_0x452c42['split']('|');var _0x29ab45=[];for(var _0x8d380a=0x0;_0x8d380a<_0x17c6bb['length'];_0x8d380a++){if(_0x17c6bb[_0x8d380a]!==''){var _0x5734d0=_[_0x11d7('0x1f')](promisesAdditionalPhones,{'contactId':_0x464dca,'phone':_0x17c6bb[_0x8d380a]});if(_0x5734d0[_0x11d7('0x1d')]==0x0){orderBy++;promisesAdditionalPhones[_0x11d7('0x1b')]({'contactId':_0x464dca,'contactTypeId':_0x3adde7,'phone':_0x17c6bb[_0x8d380a],'orderBy':orderBy});}}}_0xddfca8({'ok':0x1});}else _0xddfca8({'res':0x0});});}function createAdditionalPhone(_0x2b1322,_0x1186a6,_0x1374f2,_0xa20403){var _0x5dbc1f='';var _0x57041e='';var _0x2bd438=_0x1374f2[_0x11d7('0x20')]('§');_0x5dbc1f=_0x2bd438[0x0];if(_0x2bd438[_0x11d7('0x1d')]==0x2)_0x57041e=_0x2bd438[0x1];return new Promise(function(_0xff7a70,_0x2ea3f5){return db[_0x11d7('0x21')]['findOne']({'where':{'CmContactId':_0x2b1322,'item':_0x5dbc1f}})['then'](function(_0xefffcf){if(_0xefffcf){return db[_0x11d7('0x21')][_0x11d7('0x22')]({'ItemTypeId':_0x1186a6,'description':_0x57041e,'OrderBy':_0xa20403},{'where':{'CmContactId':_0x2b1322,'item':_0x5dbc1f}})[_0x11d7('0x1a')](function(_0x4c3cc6){_0xff7a70({'res':'updated'});});}else{return db[_0x11d7('0x21')][_0x11d7('0x23')]({'CmContactId':_0x2b1322,'item':_0x5dbc1f,'description':_0x57041e,'ItemTypeId':_0x1186a6,'OrderBy':_0xa20403,'ItemClass':'PHONE'})[_0x11d7('0x1a')](function(_0x1dcd95){_0xff7a70({'res':_0x11d7('0x24')});});}});});}function insertCmHopper(_0x36a163,_0x2beb51,_0x56f399,_0x38426,_0x203529){var _0x40460d=[_0x11d7('0x25'),_0x11d7('0x26'),'cm_contacts.id',_0x11d7('0x27'),_0x2beb51+'.'+_0x38426,_0x11d7('0x28'),'cm_contacts.updatedAt',_0x11d7('0x29'),'cm_contacts.UserId','\x22'+_0x203529+'\x22'];return squel['insert']()[_0x11d7('0x2a')](_0x11d7('0x2b'))['fromQuery']([_0x11d7('0x11'),_0x11d7('0x2c'),_0x11d7('0x2d'),_0x11d7('0x2e'),_0x38426,_0x11d7('0x2f'),_0x11d7('0x30'),_0x11d7('0x31'),_0x11d7('0x32'),_0x11d7('0x33')],squel[_0x11d7('0xf')]()[_0x11d7('0x34')](_0x40460d)[_0x11d7('0x12')](_0x2beb51)[_0x11d7('0x13')](_0x11d7('0x35'),null,_0x11d7('0x36')+_0x2beb51+'.CmListId')[_0x11d7('0x13')](_0x56f399,null,_0x56f399+_0x11d7('0x14')+_0x2beb51+'.'+_0x38426)['where'](_0x2beb51+_0x11d7('0x37'),_0x36a163)[_0x11d7('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x11d7('0x15')](_0x11d7('0x38'),selectNotIn(_0x2beb51,_0x56f399,_0x38426,'cm_hopper',['\x22always\x22','\x22onlyIfOpen\x22']))[_0x11d7('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x2beb51,_0x56f399,_0x38426,'cm_hopper',[_0x11d7('0x39')])))[_0x11d7('0x3a')]();}function insertCmHopperBlack(_0x95cb40,_0x4fa3b5,_0x420a55,_0x4cb6e3){var _0x2b350a=[_0x11d7('0x25'),_0x11d7('0x3b'),_0x11d7('0x27'),_0x4fa3b5+'.'+_0x4cb6e3,_0x11d7('0x28'),_0x11d7('0x3c')];return squel[_0x11d7('0x3d')]()[_0x11d7('0x2a')]('cm_hopper_black')['fromQuery']([_0x11d7('0x11'),_0x11d7('0x2d'),'ListId',_0x4cb6e3,'createdAt',_0x11d7('0x30')],squel[_0x11d7('0xf')]()[_0x11d7('0x34')](_0x2b350a)[_0x11d7('0x12')](_0x4fa3b5)[_0x11d7('0x13')]('cm_contacts',null,_0x11d7('0x36')+_0x4fa3b5+_0x11d7('0x3e'))[_0x11d7('0x13')](_0x420a55,null,_0x420a55+'.id\x20=\x20'+_0x4fa3b5+'.'+_0x4cb6e3)['where'](_0x4fa3b5+_0x11d7('0x37'),_0x95cb40)['where'](_0x11d7('0x3f'),NOW)[_0x11d7('0x15')](_0x11d7('0x38'),squel[_0x11d7('0xf')]()[_0x11d7('0x10')](_0x11d7('0x11'))['from'](_0x11d7('0x40'))[_0x11d7('0x15')](_0x11d7('0x41'),_0x95cb40)[_0x11d7('0x15')](_0x4cb6e3+_0x11d7('0x16')+_0x4fa3b5+'.'+_0x4cb6e3)))['toString']();}function insertTzCmHopper(_0x223b55,_0x22ad66,_0x21d310,_0x255f13,_0x4ef473,_0x488c0d){var _0x2e0bed=['cm_contacts.phone',_0x11d7('0x42')+_0x488c0d+_0x11d7('0x43'),_0x11d7('0x3b'),_0x11d7('0x27'),_0x22ad66+'.'+_0x255f13,_0x11d7('0x28'),'cm_contacts.updatedAt',_0x11d7('0x29'),_0x11d7('0x44'),'\x22'+_0x4ef473+'\x22'];var _0x5c4306=squel['insert']()[_0x11d7('0x2a')]('cm_hopper')[_0x11d7('0x45')]([_0x11d7('0x11'),_0x11d7('0x2c'),'ContactId',_0x11d7('0x2e'),_0x255f13,'createdAt',_0x11d7('0x30'),_0x11d7('0x31'),_0x11d7('0x32'),_0x11d7('0x33')],squel[_0x11d7('0xf')]()[_0x11d7('0x34')](_0x2e0bed)[_0x11d7('0x12')](_0x22ad66)['join'](_0x11d7('0x35'),null,_0x11d7('0x36')+_0x22ad66+_0x11d7('0x3e'))[_0x11d7('0x13')](_0x21d310,null,_0x21d310+'.id\x20=\x20'+_0x22ad66+'.'+_0x255f13)[_0x11d7('0x13')](_0x488c0d,null,_0x488c0d+_0x11d7('0x14')+_0x22ad66+'.'+_0x255f13)[_0x11d7('0x15')](_0x22ad66+'.CmListId\x20=\x20?',_0x223b55)[_0x11d7('0x15')](_0x11d7('0x3f'),NOW)[_0x11d7('0x15')](_0x11d7('0x38'),selectNotIn(_0x22ad66,_0x21d310,_0x255f13,_0x11d7('0x2b'),[_0x11d7('0x39'),_0x11d7('0x46')]))[_0x11d7('0x15')](_0x11d7('0x38'),selectNotIn(_0x22ad66,_0x21d310,_0x255f13,_0x11d7('0x2b'),[_0x11d7('0x39')])))['toString']();return _0x5c4306;}function insertTzCmHopperBlack(_0x113b13,_0x1b1423,_0x13dc95,_0x8e3654){var _0x4c2af7=[_0x11d7('0x25'),_0x11d7('0x3b'),'cm_contacts.ListId',_0x1b1423+'.'+_0x8e3654,_0x11d7('0x28'),_0x11d7('0x3c')];return squel[_0x11d7('0x3d')]()[_0x11d7('0x2a')]('cm_hopper_black')[_0x11d7('0x45')]([_0x11d7('0x11'),_0x11d7('0x2d'),'ListId',_0x8e3654,'createdAt',_0x11d7('0x30')],squel[_0x11d7('0xf')]()[_0x11d7('0x34')](_0x4c2af7)[_0x11d7('0x12')](_0x1b1423)[_0x11d7('0x13')](_0x11d7('0x35'),null,_0x11d7('0x36')+_0x1b1423+_0x11d7('0x3e'))[_0x11d7('0x13')](_0x13dc95,null,_0x13dc95+_0x11d7('0x14')+_0x1b1423+'.'+_0x8e3654)[_0x11d7('0x15')](_0x1b1423+_0x11d7('0x37'),_0x113b13)[_0x11d7('0x15')](_0x11d7('0x3f'),NOW)['where'](_0x11d7('0x38'),squel[_0x11d7('0xf')]()[_0x11d7('0x10')]('phone')[_0x11d7('0x12')]('cm_hopper_black')[_0x11d7('0x15')](_0x11d7('0x41'),_0x113b13)[_0x11d7('0x15')](_0x8e3654+_0x11d7('0x16')+_0x1b1423+'.'+_0x8e3654)))[_0x11d7('0x3a')]();}function insertCmHopperAdditionalPhones(_0x3248f4){var _0x17e2b5=[_0x11d7('0x47'),_0x11d7('0x48'),_0x11d7('0x49'),_0x11d7('0x4a'),_0x11d7('0x4b')];return squel[_0x11d7('0x3d')]()[_0x11d7('0x2a')](_0x11d7('0x4c'))[_0x11d7('0x45')]([_0x11d7('0x4d'),'phone','OrderBy',_0x11d7('0x2f'),_0x11d7('0x30')],squel[_0x11d7('0xf')]()['fields'](_0x17e2b5)[_0x11d7('0x12')](_0x11d7('0x2b'))[_0x11d7('0x13')](_0x11d7('0x35'),null,_0x11d7('0x4e'))['join'](_0x11d7('0x4f'),null,_0x11d7('0x50'))['where'](_0x11d7('0x51'),_0x3248f4)[_0x11d7('0x15')](_0x11d7('0x3f'),NOW))[_0x11d7('0x3a')]();}function insertCmContact(_0x33db2c,_0xbac20a,_0x2a72b7,_0x2e4bd0){var _0x48b4db=_['concat'](_[_0x11d7('0x52')](_0x2e4bd0),['ListId',_0x11d7('0x53'),_0x11d7('0x2f'),_0x11d7('0x30')]);return squel[_0x11d7('0x3d')]()[_0x11d7('0x2a')](_0x11d7('0x35'))[_0x11d7('0x45')](_0x48b4db,squel[_0x11d7('0xf')]()['fields'](_0x48b4db)[_0x11d7('0x12')](_0xbac20a)[_0x11d7('0x15')]('('+_0x2a72b7[_0x11d7('0x13')](',')+_0x11d7('0x54'),squel[_0x11d7('0xf')]()[_0x11d7('0x34')](_0x2a72b7)['from'](_0x11d7('0x35'))[_0x11d7('0x15')](_0x11d7('0x41'),_0x33db2c)[_0x11d7('0x15')](_0x11d7('0x55')))[_0x11d7('0x15')](_0x11d7('0x56'),squel[_0x11d7('0xf')]()[_0x11d7('0x10')](_0x11d7('0x57'),_0x11d7('0x58'))[_0x11d7('0x12')](_0xbac20a)[_0x11d7('0x59')](_0x2a72b7['join'](','))))[_0x11d7('0x3a')]();}function handleStop(){logger[_0x11d7('0x5a')](_0x11d7('0x5b'));stopped=!![];}function handleUncaughtException(_0x10e16a){logger['error'](_0x10e16a[_0x11d7('0x5c')]);process[_0x11d7('0x5d')](0x1);}function handleError(_0x4c7bee,_0x57c51b){stats[_0x11d7('0x5e')][_0x11d7('0x1b')]({'name':_0x57c51b['code'],'message':_0x57c51b[_0x11d7('0x5c')],'row':_0x4c7bee});}function handleQuery(_0x558117){logger[_0x11d7('0x5a')](_0x558117);return db['sequelize'][_0x11d7('0x5f')](_0x558117)[_0x11d7('0x60')](function(_0x1e88fd){results[_0x11d7('0x1b')](_0x1e88fd);})[_0x11d7('0x61')](function(_0x2eb4b5){logger[_0x11d7('0x62')](_0x2eb4b5[_0x11d7('0x5c')]);});}function updateTzCampaigns(_0x3f1da0){return new Promise(function(_0x57abf6,_0x16340d){var _0x5858a0=squel[_0x11d7('0xf')]()[_0x11d7('0x34')]([_0x11d7('0x63'),_0x11d7('0x64')])[_0x11d7('0x12')]('campaigns')[_0x11d7('0x13')](_0x11d7('0x65'),null,_0x11d7('0x66'))['where'](_0x11d7('0x67')+_0x3f1da0);db[_0x11d7('0x68')]['query'](_0x5858a0[_0x11d7('0x3a')]())['spread'](function(_0x34619b){var _0x411baf=[];for(var _0x537d3f=0x0;_0x537d3f<_0x34619b[_0x11d7('0x1d')];_0x537d3f++){_0x411baf[_0x11d7('0x1b')](getTimezoneData(_0x34619b[_0x537d3f],tmp_campaigns));}BPromise[_0x11d7('0x1c')](_0x411baf)['then'](function(){_0x57abf6({'val':0x1});});})['catch'](function(_0x4794bd){logger['error'](_0x4794bd[_0x11d7('0x5c')]);_0x57abf6({'val':0x0});});});}function updateTzVoiceQueues(_0x22f633){return new Promise(function(_0x256752,_0x14e7a5){var _0x5ddde9=squel[_0x11d7('0xf')]()['fields']([_0x11d7('0x69'),'voice_queues.dialTimezone'])[_0x11d7('0x12')](_0x11d7('0x6a'))[_0x11d7('0x13')](_0x11d7('0x6b'),null,_0x11d7('0x6c'))[_0x11d7('0x15')](_0x11d7('0x6d')+_0x22f633);db[_0x11d7('0x68')][_0x11d7('0x5f')](_0x5ddde9[_0x11d7('0x3a')]())[_0x11d7('0x60')](function(_0x3face5){var _0x1e1a79=[];for(var _0xd79d78=0x0;_0xd79d78<_0x3face5[_0x11d7('0x1d')];_0xd79d78++){_0x1e1a79['push'](getTimezoneData(_0x3face5[_0xd79d78],tmp_voice_queues));}BPromise['all'](_0x1e1a79)[_0x11d7('0x1a')](function(){_0x256752({'val':0x1});});})[_0x11d7('0x61')](function(_0x4067de){logger['error'](_0x4067de[_0x11d7('0x5c')]);_0x256752({'val':0x0});});});}function getTimezoneData(_0x55e47a,_0x5b79c9){return new Promise(function(_0x1a15f8,_0x51f343){var _0x31342d=shared[_0x11d7('0x6e')];var _0x27d207=_0x31342d[_0x55e47a[_0x11d7('0x6f')]];if(_['isNil'](_0x27d207)){_0x1a15f8({'ret':0x1});}else{var _0x212605=_0x27d207[_0x11d7('0x70')];var _0x48144a=squel['insert']()[_0x11d7('0x2a')](_0x5b79c9)[_0x11d7('0x71')]('id',_0x55e47a['id'])[_0x11d7('0x71')](_0x11d7('0x72'),_0x212605)[_0x11d7('0x71')](_0x11d7('0x6f'),_0x55e47a['dialTimezone'])[_0x11d7('0x3a')]();return db['sequelize']['query'](_0x48144a)[_0x11d7('0x60')](function(_0x329d45){_0x1a15f8({'ret':0x1});})[_0x11d7('0x61')](function(_0x588844){logger[_0x11d7('0x62')](_0x588844[_0x11d7('0x5c')]);_0x51f343({'ret':0x1});});}});}function handleTZQuery(_0x4a49fe){logger[_0x11d7('0x5a')](_0x4a49fe);return db[_0x11d7('0x68')][_0x11d7('0x5f')](_0x4a49fe)[_0x11d7('0x60')](function(_0x1df082){})[_0x11d7('0x61')](function(_0x587050){logger['error'](_0x587050['message']);});}function main(_0x1a3f0f,_0x45ff3b,_0x389427,_0x305a85){logger['info'](_0x11d7('0x73'),_0x1a3f0f,JSON[_0x11d7('0x74')](_0x45ff3b));process[_0x11d7('0x75')](_0x11d7('0x76'));var _0x26c11c=_0x45ff3b[_0x11d7('0x77')];var _0x3bff87=_[_0x11d7('0x78')](_0x26c11c);var _0x384661=_0x45ff3b[_0x11d7('0x79')];var _0xe61f51=path['join'](config[_0x11d7('0x7a')],_0x11d7('0x7b'),_0x384661+'.csv');hasTZ=_[_0x11d7('0x52')](_0x26c11c)['includes'](_0x11d7('0x6f'));var _0xcb749a=_[_0x11d7('0x52')](_0x26c11c)['join']();logger[_0x11d7('0x5a')](_0x11d7('0x7c'),_0xcb749a);db[_0x11d7('0x7d')]['findAll']({'raw':!![],'attributes':['id','name']})[_0x11d7('0x1a')](function(_0x1ed3c8){for(var _0x53d33a=0x0;_0x53d33a<_0x1ed3c8[_0x11d7('0x1d')];_0x53d33a++){if(_0x1ed3c8[_0x53d33a][_0x11d7('0x7e')]in _0x26c11c){contactItemTypes[_0x11d7('0x1b')](_0x1ed3c8[_0x53d33a]);delete _0x3bff87[_0x1ed3c8[_0x53d33a][_0x11d7('0x7e')]];hasAdditionalPhones=!![];}for(var _0x5bc7ae in _0x26c11c){if(_0x1ed3c8[_0x53d33a][_0x11d7('0x7e')]+'_description'===_0x5bc7ae){phoneDescriptions[_0x11d7('0x1b')]({'itemTypeId':_0x1ed3c8[_0x53d33a]['id'],'description':_0x5bc7ae});delete _0x3bff87[_0x5bc7ae];}}}if(hasAdditionalPhones)_0x3bff87[_0x11d7('0x19')]='';var _0x17ea6f=_[_0x11d7('0x52')](_0x3bff87)[_0x11d7('0x13')]();logger['info'](_0x11d7('0x7c'),_0x17ea6f);fs[_0x11d7('0x7f')](_0xe61f51,_0x17ea6f+'\x0a');Papa[_0x11d7('0x80')](fs[_0x11d7('0x81')](_0x1a3f0f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3238f4,_0x28ecb3){try{for(var _0x4be534=0x0,_0x2c598a=[];_0x4be534<_0x3238f4[_0x11d7('0x82')][_0x11d7('0x1d')];_0x4be534++){stats[_0x11d7('0x83')]+=0x1;if(_0x3238f4[_0x11d7('0x5e')][_0x4be534]){handleError(_0x3238f4['data'][_0x4be534],_0x3238f4['errors'][_0x4be534]);}else{var _0x40c7f9=[];var _0x4d25ad=[];var _0x2f921c={};for(var _0xf515af in _0x26c11c){let _0x5c226a=contactItemTypes[_0x11d7('0x84')](_0x360abc=>_0x360abc['name']===_0xf515af);let _0x564641=contactItemTypes[_0x11d7('0x84')](_0x595cdd=>_0x595cdd[_0x11d7('0x7e')]+_0x11d7('0x85')===_0xf515af);if(_['isNil'](_0x5c226a)&&_['isNil'](_0x564641)){if(_0x26c11c['hasOwnProperty'](_0xf515af)){if(_0x3238f4['data'][_0x4be534][_0x26c11c[_0xf515af]]){var _0x33a220=_[_0x11d7('0x86')](_0x3238f4[_0x11d7('0x82')][_0x4be534][_0x26c11c[_0xf515af]][_0x11d7('0x87')](/"/g,'\x27'));switch(_0xf515af){case'scheduledat':var _0x8b8967=moment(_0x33a220,_0x11d7('0xe'),!![]);if(_0x8b8967[_0x11d7('0x88')]()){_0x2c598a['push']('\x22'+_0x33a220+'\x22');}else{_0x40c7f9['push'](_0x11d7('0x89'));}break;case _0x11d7('0x31'):var _0x3a61fc=parseInt(_0x33a220);_0x33a220=_['isNaN'](_0x3a61fc)||_0x3a61fc<0x0||_0x3a61fc>0x4?_0x305a85?0x3:0x2:_0x3a61fc;_0x2c598a['push']('\x22'+_0x33a220+'\x22');break;case _0x11d7('0x32'):var _0x153cb0=parseInt(_0x33a220);if(_[_0x11d7('0x8a')](_0x153cb0)&&_['includes'](_0x389427,_0x153cb0)){_0x2c598a[_0x11d7('0x1b')]('\x22'+_0x153cb0+'\x22');}else{_0x40c7f9['push'](_0x11d7('0x8b'));}break;case _0x11d7('0x8c'):if(isEmail(_0x33a220)){_0x2c598a['push']('\x22'+_0x33a220+'\x22');}else{_0x40c7f9[_0x11d7('0x1b')](_0x11d7('0x8d'));}break;case _0x11d7('0x8e'):var _0x5addcb=moment(_0x33a220,_0x11d7('0x8f'),!![]);if(_0x5addcb[_0x11d7('0x88')]()){_0x2c598a['push']('\x22'+_0x33a220+'\x22');}else{_0x40c7f9['push']('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0x11d7('0x6f'):var _0x14e212=shared[_0x11d7('0x6e')];var _0x851bfb=_0x14e212[_0x33a220];if(!_[_0x11d7('0x1e')](_0x851bfb)){var _0x441e86=_0x851bfb[_0x11d7('0x70')];_0x2c598a[_0x11d7('0x1b')]('\x22'+_0x33a220+'\x22');_0x2c598a[_0x11d7('0x1b')]('\x22'+_0x441e86+'\x22');}break;default:_0x2c598a['push']('\x22'+_0x33a220+'\x22');}}else{switch(_0xf515af){case'firstName':case'phone':_0x40c7f9[_0x11d7('0x1b')](_0xf515af+_0x11d7('0x90'));break;default:_0x2c598a['push']('\x22\x22');}}}}else{var _0x152596='';if(!_['isNil'](_0x5c226a)){if(!_0x2f921c[_0x11d7('0x91')](_0x5c226a['id'])){if(!_['isNil'](_0x3238f4[_0x11d7('0x82')][_0x4be534][_0x26c11c[_0xf515af]])){var _0x33a220=_[_0x11d7('0x86')](_0x3238f4[_0x11d7('0x82')][_0x4be534][_0x26c11c[_0xf515af]][_0x11d7('0x87')](/"/g,'\x27'));var _0x2cb5ad=phoneDescriptions['find'](_0x5c21da=>_0x5c21da[_0x11d7('0x92')]===_0x5c226a['id']);if(!_[_0x11d7('0x1e')](_0x2cb5ad)){var _0x21809c=_[_0x11d7('0x86')](_0x3238f4[_0x11d7('0x82')][_0x4be534][_0x26c11c[_0x2cb5ad[_0x11d7('0x93')]]][_0x11d7('0x87')](/"/g,'\x27'));if(!_[_0x11d7('0x1e')](_0x21809c))_0x33a220=_0x33a220+'§'+_0x21809c;}if(_0x152596=='')_0x152596=_0x33a220;else _0x152596+='|'+_0x33a220;}_0x4d25ad[_0x11d7('0x1b')](_0x5c226a['id']+':'+_0x152596);_0x2f921c[_0x5c226a['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2c598a[_0x11d7('0x1b')]('\x22'+_0x4d25ad['join'](';')+'\x22');}if(_0x40c7f9[_0x11d7('0x1d')]){handleError(_0x3238f4[_0x11d7('0x82')][_0x4be534],{'code':_0x11d7('0x94'),'message':_0x40c7f9[_0x11d7('0x13')]()});}else{fs[_0x11d7('0x95')](_0xe61f51,_0x2c598a[_0x11d7('0x13')]()+'\x0a');}_0x2c598a=[];}if(!(stats[_0x11d7('0x83')]%0xc8)){socket['emit'](_0x11d7('0x96')+_0x384661,stats);stats[_0x11d7('0x5e')]=[];}}if(stopped){logger[_0x11d7('0x5a')](_0x11d7('0x97'));_0x28ecb3[_0x11d7('0x98')]();}}catch(_0x31b12a){handleError(_0x3238f4[_0x11d7('0x82')][_0x4be534],{'code':_0x11d7('0x99'),'message':_0x31b12a[_0x11d7('0x5c')]});logger[_0x11d7('0x62')](_0x11d7('0x9a'),_0x31b12a['message']);}},'complete':function(){try{var _0x32dc70=[];var _0x5ef787=[];var _0x1b09fc=_0x11d7('0x35');if(_0x45ff3b[_0x11d7('0x9b')]&&_0x45ff3b[_0x11d7('0x9b')][_0x11d7('0x1d')]){_0x1b09fc=_0x11d7('0x9c')+_0x384661;_0x32dc70[_0x11d7('0x1b')](_0x11d7('0x9d')+_0x1b09fc+_0x11d7('0x9e'));}tmp_campaigns=_0x11d7('0x9f')+_0x384661;tmp_voice_queues='voice_queues_'+_0x384661;_0x5ef787[_0x11d7('0x1b')](_0x11d7('0x9d')+tmp_campaigns+_0x11d7('0xa0'));_0x5ef787['push']('CREATE\x20TABLE\x20'+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x11d7('0xa1')](_0x5ef787,handleTZQuery)['then'](function(_0x576b10){updateTzCampaigns(_0x45ff3b[_0x11d7('0x2e')])[_0x11d7('0x1a')](function(_0x12043b){updateTzVoiceQueues(_0x45ff3b[_0x11d7('0x2e')])[_0x11d7('0x1a')](function(_0x3c140a){if(hasTZ)_0x17ea6f=_0x17ea6f['replace'](_0x11d7('0x6f'),_0x11d7('0xa2'));var _0x4b1e67=util[_0x11d7('0xd')]('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',_0xe61f51,_0x1b09fc,_0x17ea6f,_0x45ff3b[_0x11d7('0x2e')],_0x45ff3b[_0x11d7('0x53')]||null,NOW,NOW);if(_[_0x11d7('0x1e')](_0x26c11c['scheduledat'])){_0x4b1e67+=',\x20scheduledAt\x20=\x20NOW()';}_0x32dc70[_0x11d7('0x1b')](_0x4b1e67);if(_0x45ff3b[_0x11d7('0x9b')]&&_0x45ff3b[_0x11d7('0x9b')]['length']){_0x32dc70[_0x11d7('0x1b')](insertCmContact(_0x45ff3b['ListId'],_0x1b09fc,_0x45ff3b[_0x11d7('0x9b')],_0x26c11c));_0x32dc70[_0x11d7('0x1b')]('DROP\x20TABLE\x20'+_0x1b09fc+';');}BPromise[_0x11d7('0xa1')](_0x32dc70,handleQuery)[_0x11d7('0x1a')](function(_0xdaa118){BPromise[_0x11d7('0x1c')]([handleAdditionalPhones()])['then'](function(){_0x32dc70=[];for(var _0x1c6044=0x0;_0x1c6044\x20\x20','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','AdditionalPhones','length','push','all','then','split','isNil','filter','CmContactHasItem','findOne','update','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','cm_hopper','scheduledat','ContactId','ListId','createdAt','priority','UserId','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','into','fields','cm_hopper_black','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.priority','fromQuery','updatedAt','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','exit','errors','message','sequelize','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId='];(function(_0x4f8e06,_0x3226b1){var _0x327dad=function(_0x4dced3){while(--_0x4dced3){_0x4f8e06['push'](_0x4f8e06['shift']());}};_0x327dad(++_0x3226b1);}(_0xad10,0x1b3));var _0x0ad1=function(_0x2de3e2,_0x53f692){_0x2de3e2=_0x2de3e2-0x0;var _0x7d8c06=_0xad10[_0x2de3e2];return _0x7d8c06;};'use strict';var fs=require('fs');var path=require(_0x0ad1('0x0'));var _=require(_0x0ad1('0x1'));var Papa=require(_0x0ad1('0x2'));var util=require(_0x0ad1('0x3'));var BPromise=require(_0x0ad1('0x4'));var moment=require(_0x0ad1('0x5'));var squel=require(_0x0ad1('0x6'));var Redis=require('ioredis');var db=require(_0x0ad1('0x7'))['db'];var config=require(_0x0ad1('0x8'));var shared=require(_0x0ad1('0x9'));var logger=require(_0x0ad1('0xa'))('import');config[_0x0ad1('0xb')]=_[_0x0ad1('0xc')](config[_0x0ad1('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0ad1('0xd'))(new Redis(config[_0x0ad1('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x0ad1('0xe')](_0x0ad1('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x0ad1('0xe')](_0x0ad1('0xf'));function isEmail(_0x65deff){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))*$/[_0x0ad1('0x10')](_0x65deff);}function selectNotIn(_0x4247ba,_0x212f14,_0x2bec6a,_0x5a3b89,_0x2af3f6){return squel[_0x0ad1('0x11')]()[_0x0ad1('0x12')](_0x0ad1('0x13'))[_0x0ad1('0x14')](_0x5a3b89)[_0x0ad1('0x15')](_0x212f14,null,_0x212f14+'.id\x20=\x20'+_0x5a3b89+'.'+_0x2bec6a)[_0x0ad1('0x16')](_0x5a3b89+'.'+_0x2bec6a+_0x0ad1('0x17')+_0x4247ba+'.'+_0x2bec6a)[_0x0ad1('0x16')](_0x212f14+_0x0ad1('0x18')+_0x2af3f6[_0x0ad1('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x40621d,_0x179963){promisesAdditionalPhones=[];return db['CmContact']['findAll']({'raw':!![],'attributes':['id',_0x0ad1('0x19')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x418fdf){if(_0x418fdf!==null){var _0x305e5d=[];for(var _0x2404cd=0x0;_0x2404cd<_0x418fdf[_0x0ad1('0x1a')];_0x2404cd++){var _0xa6d58b=_0x418fdf[_0x2404cd];_0x305e5d[_0x0ad1('0x1b')](insertAdditionalPhones(_0xa6d58b));}}Promise[_0x0ad1('0x1c')](_0x305e5d)[_0x0ad1('0x1d')](function(){_0x40621d({'val':0x1});});});});}function insertAdditionalPhones(_0x57ae7f){return new Promise(function(_0x4a814c,_0x52bed9){var _0x2d1b7e=_0x57ae7f[_0x0ad1('0x19')];var _0x2127d1=_0x2d1b7e[_0x0ad1('0x1e')](';');var _0x1514ca=[];orderBy=0x0;for(var _0x4bdc73=0x0;_0x4bdc73<_0x2127d1[_0x0ad1('0x1a')];_0x4bdc73++){_0x1514ca[_0x0ad1('0x1b')](splitAdditionalPhone(_0x57ae7f['id'],_0x2127d1[_0x4bdc73]));}Promise[_0x0ad1('0x1c')](_0x1514ca)[_0x0ad1('0x1d')](function(){_0x4a814c({'val':_0x2127d1[_0x0ad1('0x1a')]});});});}function splitAdditionalPhone(_0x54be41,_0x5323ad){return new Promise(function(_0x13cc63,_0x370f1b){var _0x209070=_0x5323ad[_0x0ad1('0x1e')](':');var _0x5c6240=_0x209070[0x0];var _0x404b74=_0x209070[0x1];if(!_[_0x0ad1('0x1f')](_0x404b74)){var _0x27639f=_0x404b74[_0x0ad1('0x1e')]('|');var _0x1e6db7=[];for(var _0x359ee2=0x0;_0x359ee2<_0x27639f[_0x0ad1('0x1a')];_0x359ee2++){if(_0x27639f[_0x359ee2]!==''){var _0x288ba5=_[_0x0ad1('0x20')](promisesAdditionalPhones,{'contactId':_0x54be41,'phone':_0x27639f[_0x359ee2]});if(_0x288ba5[_0x0ad1('0x1a')]==0x0){orderBy++;promisesAdditionalPhones[_0x0ad1('0x1b')]({'contactId':_0x54be41,'contactTypeId':_0x5c6240,'phone':_0x27639f[_0x359ee2],'orderBy':orderBy});}}}_0x13cc63({'ok':0x1});}else _0x13cc63({'res':0x0});});}function createAdditionalPhone(_0x392c37,_0x174c9d,_0x39d15b,_0x9a0156){var _0x41a701='';var _0x3fb85f='';var _0x144716=_0x39d15b[_0x0ad1('0x1e')]('§');_0x41a701=_0x144716[0x0];if(_0x144716[_0x0ad1('0x1a')]==0x2)_0x3fb85f=_0x144716[0x1];return new Promise(function(_0x1dbf4b,_0x5075b4){return db[_0x0ad1('0x21')][_0x0ad1('0x22')]({'where':{'CmContactId':_0x392c37,'item':_0x41a701}})[_0x0ad1('0x1d')](function(_0x28002b){if(_0x28002b){return db[_0x0ad1('0x21')][_0x0ad1('0x23')]({'ItemTypeId':_0x174c9d,'description':_0x3fb85f,'OrderBy':_0x9a0156},{'where':{'CmContactId':_0x392c37,'item':_0x41a701}})['then'](function(_0x2186e3){_0x1dbf4b({'res':'updated'});});}else{return db[_0x0ad1('0x21')]['create']({'CmContactId':_0x392c37,'item':_0x41a701,'description':_0x3fb85f,'ItemTypeId':_0x174c9d,'OrderBy':_0x9a0156,'ItemClass':'PHONE'})[_0x0ad1('0x1d')](function(_0x1b540b){_0x1dbf4b({'res':_0x0ad1('0x24')});});}});});}function insertCmHopper(_0x131fb3,_0x113ee1,_0x4f81b2,_0x5eca04,_0x3e8430){var _0x4c5a1a=[_0x0ad1('0x25'),_0x0ad1('0x26'),_0x0ad1('0x27'),_0x0ad1('0x28'),_0x113ee1+'.'+_0x5eca04,_0x0ad1('0x29'),_0x0ad1('0x2a'),'cm_contacts.priority',_0x0ad1('0x2b'),'\x22'+_0x3e8430+'\x22'];return squel[_0x0ad1('0x2c')]()['into'](_0x0ad1('0x2d'))['fromQuery']([_0x0ad1('0x13'),_0x0ad1('0x2e'),_0x0ad1('0x2f'),_0x0ad1('0x30'),_0x5eca04,_0x0ad1('0x31'),'updatedAt',_0x0ad1('0x32'),_0x0ad1('0x33'),_0x0ad1('0x34')],squel['select']()['fields'](_0x4c5a1a)[_0x0ad1('0x14')](_0x113ee1)['join'](_0x0ad1('0x35'),null,_0x0ad1('0x36')+_0x113ee1+_0x0ad1('0x37'))['join'](_0x4f81b2,null,_0x4f81b2+_0x0ad1('0x38')+_0x113ee1+'.'+_0x5eca04)[_0x0ad1('0x16')](_0x113ee1+_0x0ad1('0x39'),_0x131fb3)['where'](_0x0ad1('0x3a'),NOW)[_0x0ad1('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x113ee1,_0x4f81b2,_0x5eca04,_0x0ad1('0x2d'),[_0x0ad1('0x3b'),_0x0ad1('0x3c')]))[_0x0ad1('0x16')](_0x0ad1('0x3d'),selectNotIn(_0x113ee1,_0x4f81b2,_0x5eca04,_0x0ad1('0x2d'),[_0x0ad1('0x3b')])))[_0x0ad1('0x3e')]();}function insertCmHopperBlack(_0x77a321,_0x1d14d8,_0x529058,_0x3d4b9f){var _0x2ed843=[_0x0ad1('0x25'),_0x0ad1('0x27'),_0x0ad1('0x28'),_0x1d14d8+'.'+_0x3d4b9f,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0x0ad1('0x2c')]()[_0x0ad1('0x3f')]('cm_hopper_black')['fromQuery']([_0x0ad1('0x13'),'ContactId','ListId',_0x3d4b9f,_0x0ad1('0x31'),'updatedAt'],squel[_0x0ad1('0x11')]()[_0x0ad1('0x40')](_0x2ed843)['from'](_0x1d14d8)[_0x0ad1('0x15')](_0x0ad1('0x35'),null,_0x0ad1('0x36')+_0x1d14d8+_0x0ad1('0x37'))['join'](_0x529058,null,_0x529058+_0x0ad1('0x38')+_0x1d14d8+'.'+_0x3d4b9f)['where'](_0x1d14d8+_0x0ad1('0x39'),_0x77a321)[_0x0ad1('0x16')](_0x0ad1('0x3a'),NOW)[_0x0ad1('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x0ad1('0x11')]()[_0x0ad1('0x12')](_0x0ad1('0x13'))['from'](_0x0ad1('0x41'))[_0x0ad1('0x16')](_0x0ad1('0x42'),_0x77a321)[_0x0ad1('0x16')](_0x3d4b9f+'\x20=\x20'+_0x1d14d8+'.'+_0x3d4b9f)))[_0x0ad1('0x3e')]();}function insertTzCmHopper(_0x23cf85,_0x286afb,_0x387b47,_0x5a4396,_0x50bf18,_0x57d26b){var _0x46bbeb=['cm_contacts.phone',_0x0ad1('0x43')+_0x57d26b+_0x0ad1('0x44'),_0x0ad1('0x27'),_0x0ad1('0x28'),_0x286afb+'.'+_0x5a4396,_0x0ad1('0x29'),_0x0ad1('0x2a'),_0x0ad1('0x45'),_0x0ad1('0x2b'),'\x22'+_0x50bf18+'\x22'];var _0x339e5a=squel[_0x0ad1('0x2c')]()[_0x0ad1('0x3f')](_0x0ad1('0x2d'))[_0x0ad1('0x46')]([_0x0ad1('0x13'),_0x0ad1('0x2e'),_0x0ad1('0x2f'),_0x0ad1('0x30'),_0x5a4396,_0x0ad1('0x31'),_0x0ad1('0x47'),_0x0ad1('0x32'),_0x0ad1('0x33'),_0x0ad1('0x34')],squel[_0x0ad1('0x11')]()[_0x0ad1('0x40')](_0x46bbeb)[_0x0ad1('0x14')](_0x286afb)[_0x0ad1('0x15')](_0x0ad1('0x35'),null,_0x0ad1('0x36')+_0x286afb+_0x0ad1('0x37'))[_0x0ad1('0x15')](_0x387b47,null,_0x387b47+_0x0ad1('0x38')+_0x286afb+'.'+_0x5a4396)['join'](_0x57d26b,null,_0x57d26b+_0x0ad1('0x38')+_0x286afb+'.'+_0x5a4396)[_0x0ad1('0x16')](_0x286afb+_0x0ad1('0x39'),_0x23cf85)[_0x0ad1('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x0ad1('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x286afb,_0x387b47,_0x5a4396,_0x0ad1('0x2d'),[_0x0ad1('0x3b'),_0x0ad1('0x3c')]))['where'](_0x0ad1('0x3d'),selectNotIn(_0x286afb,_0x387b47,_0x5a4396,_0x0ad1('0x2d'),[_0x0ad1('0x3b')])))[_0x0ad1('0x3e')]();return _0x339e5a;}function insertTzCmHopperBlack(_0x277e3d,_0x5453e4,_0x15f888,_0x204557){var _0x2fac00=[_0x0ad1('0x25'),'cm_contacts.id',_0x0ad1('0x28'),_0x5453e4+'.'+_0x204557,'cm_contacts.createdAt',_0x0ad1('0x2a')];return squel['insert']()[_0x0ad1('0x3f')](_0x0ad1('0x41'))[_0x0ad1('0x46')]([_0x0ad1('0x13'),_0x0ad1('0x2f'),_0x0ad1('0x30'),_0x204557,_0x0ad1('0x31'),_0x0ad1('0x47')],squel[_0x0ad1('0x11')]()[_0x0ad1('0x40')](_0x2fac00)[_0x0ad1('0x14')](_0x5453e4)[_0x0ad1('0x15')](_0x0ad1('0x35'),null,_0x0ad1('0x36')+_0x5453e4+_0x0ad1('0x37'))[_0x0ad1('0x15')](_0x15f888,null,_0x15f888+'.id\x20=\x20'+_0x5453e4+'.'+_0x204557)[_0x0ad1('0x16')](_0x5453e4+_0x0ad1('0x39'),_0x277e3d)[_0x0ad1('0x16')](_0x0ad1('0x3a'),NOW)[_0x0ad1('0x16')](_0x0ad1('0x3d'),squel['select']()[_0x0ad1('0x12')](_0x0ad1('0x13'))[_0x0ad1('0x14')](_0x0ad1('0x41'))[_0x0ad1('0x16')](_0x0ad1('0x42'),_0x277e3d)[_0x0ad1('0x16')](_0x204557+_0x0ad1('0x17')+_0x5453e4+'.'+_0x204557)))[_0x0ad1('0x3e')]();}function insertCmHopperAdditionalPhones(_0x56cc56){var _0x4f9ac6=['cm_hopper.id',_0x0ad1('0x48'),_0x0ad1('0x49'),'cm_contact_has_items.createdAt',_0x0ad1('0x4a')];return squel[_0x0ad1('0x2c')]()['into'](_0x0ad1('0x4b'))['fromQuery']([_0x0ad1('0x4c'),'phone',_0x0ad1('0x4d'),_0x0ad1('0x31'),_0x0ad1('0x47')],squel[_0x0ad1('0x11')]()['fields'](_0x4f9ac6)[_0x0ad1('0x14')]('cm_hopper')[_0x0ad1('0x15')]('cm_contacts',null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')['join'](_0x0ad1('0x4e'),null,_0x0ad1('0x4f'))[_0x0ad1('0x16')](_0x0ad1('0x50'),_0x56cc56)[_0x0ad1('0x16')](_0x0ad1('0x3a'),NOW))[_0x0ad1('0x3e')]();}function insertCmContact(_0x4f15e5,_0x4e1853,_0x57890b,_0x56dadb){var _0x385a0f=_[_0x0ad1('0x51')](_[_0x0ad1('0x52')](_0x56dadb),[_0x0ad1('0x30'),_0x0ad1('0x53'),_0x0ad1('0x31'),'updatedAt']);return squel[_0x0ad1('0x2c')]()[_0x0ad1('0x3f')](_0x0ad1('0x35'))[_0x0ad1('0x46')](_0x385a0f,squel['select']()[_0x0ad1('0x40')](_0x385a0f)[_0x0ad1('0x14')](_0x4e1853)[_0x0ad1('0x16')]('('+_0x57890b[_0x0ad1('0x15')](',')+_0x0ad1('0x54'),squel[_0x0ad1('0x11')]()[_0x0ad1('0x40')](_0x57890b)[_0x0ad1('0x14')](_0x0ad1('0x35'))[_0x0ad1('0x16')](_0x0ad1('0x42'),_0x4f15e5)[_0x0ad1('0x16')](_0x0ad1('0x55')))[_0x0ad1('0x16')](_0x0ad1('0x56'),squel[_0x0ad1('0x11')]()[_0x0ad1('0x12')](_0x0ad1('0x57'),'min_id')[_0x0ad1('0x14')](_0x4e1853)[_0x0ad1('0x58')](_0x57890b[_0x0ad1('0x15')](','))))['toString']();}function handleStop(){logger[_0x0ad1('0x59')](_0x0ad1('0x5a'));stopped=!![];}function handleUncaughtException(_0x61a128){logger['error'](_0x61a128['message']);process[_0x0ad1('0x5b')](0x1);}function handleError(_0x5f08d3,_0xca00bb){stats[_0x0ad1('0x5c')]['push']({'name':_0xca00bb['code'],'message':_0xca00bb[_0x0ad1('0x5d')],'row':_0x5f08d3});}function handleQuery(_0xd7ed9){logger[_0x0ad1('0x59')](_0xd7ed9);return db[_0x0ad1('0x5e')]['query'](_0xd7ed9)[_0x0ad1('0x5f')](function(_0x30d76f){results[_0x0ad1('0x1b')](_0x30d76f);})[_0x0ad1('0x60')](function(_0xae9c66){logger['error'](_0xae9c66[_0x0ad1('0x5d')]);});}function updateTzCampaigns(_0x47b10f){return new Promise(function(_0xd36539,_0x4226af){var _0x18b313=squel[_0x0ad1('0x11')]()[_0x0ad1('0x40')]([_0x0ad1('0x61'),_0x0ad1('0x62')])[_0x0ad1('0x14')](_0x0ad1('0x63'))[_0x0ad1('0x15')]('campaigns_has_cm_lists',null,_0x0ad1('0x64'))['where'](_0x0ad1('0x65')+_0x47b10f);db[_0x0ad1('0x5e')]['query'](_0x18b313[_0x0ad1('0x3e')]())['spread'](function(_0x16be0c){var _0x43bfba=[];for(var _0x46c235=0x0;_0x46c235<_0x16be0c[_0x0ad1('0x1a')];_0x46c235++){_0x43bfba[_0x0ad1('0x1b')](getTimezoneData(_0x16be0c[_0x46c235],tmp_campaigns));}BPromise['all'](_0x43bfba)[_0x0ad1('0x1d')](function(){_0xd36539({'val':0x1});});})[_0x0ad1('0x60')](function(_0x4f51bb){logger[_0x0ad1('0x66')](_0x4f51bb[_0x0ad1('0x5d')]);_0xd36539({'val':0x0});});});}function updateTzVoiceQueues(_0x420d91){return new Promise(function(_0x3223fc,_0x5859c9){var _0x5caad6=squel[_0x0ad1('0x11')]()['fields']([_0x0ad1('0x67'),'voice_queues.dialTimezone'])[_0x0ad1('0x14')](_0x0ad1('0x68'))[_0x0ad1('0x15')](_0x0ad1('0x69'),null,_0x0ad1('0x6a'))[_0x0ad1('0x16')](_0x0ad1('0x6b')+_0x420d91);db['sequelize']['query'](_0x5caad6[_0x0ad1('0x3e')]())[_0x0ad1('0x5f')](function(_0x5e2dd0){var _0x4524de=[];for(var _0x233b08=0x0;_0x233b08<_0x5e2dd0[_0x0ad1('0x1a')];_0x233b08++){_0x4524de[_0x0ad1('0x1b')](getTimezoneData(_0x5e2dd0[_0x233b08],tmp_voice_queues));}BPromise[_0x0ad1('0x1c')](_0x4524de)[_0x0ad1('0x1d')](function(){_0x3223fc({'val':0x1});});})[_0x0ad1('0x60')](function(_0x159f5a){logger[_0x0ad1('0x66')](_0x159f5a[_0x0ad1('0x5d')]);_0x3223fc({'val':0x0});});});}function getTimezoneData(_0x231a0a,_0x1f2361){return new Promise(function(_0x1ac5c4,_0x3cd6a2){var _0xa566dd=shared[_0x0ad1('0x6c')];var _0x5df3ff=_0xa566dd[_0x231a0a[_0x0ad1('0x6d')]];if(_[_0x0ad1('0x1f')](_0x5df3ff)){_0x1ac5c4({'ret':0x1});}else{var _0x150df4=_0x5df3ff[_0x0ad1('0x6e')];var _0x484597=squel['insert']()[_0x0ad1('0x3f')](_0x1f2361)[_0x0ad1('0x6f')]('id',_0x231a0a['id'])[_0x0ad1('0x6f')]('offset',_0x150df4)[_0x0ad1('0x6f')](_0x0ad1('0x6d'),_0x231a0a['dialTimezone'])[_0x0ad1('0x3e')]();return db[_0x0ad1('0x5e')][_0x0ad1('0x70')](_0x484597)['spread'](function(_0x516095){_0x1ac5c4({'ret':0x1});})[_0x0ad1('0x60')](function(_0x17ce0e){logger[_0x0ad1('0x66')](_0x17ce0e[_0x0ad1('0x5d')]);_0x3cd6a2({'ret':0x1});});}});}function handleTZQuery(_0x5b166a){logger[_0x0ad1('0x59')](_0x5b166a);return db[_0x0ad1('0x5e')][_0x0ad1('0x70')](_0x5b166a)[_0x0ad1('0x5f')](function(_0x393a5){})[_0x0ad1('0x60')](function(_0x2c11b5){logger['error'](_0x2c11b5[_0x0ad1('0x5d')]);});}function main(_0x31e3ea,_0x10c8e6,_0x24b17a,_0x5cd267){logger[_0x0ad1('0x59')]('main',_0x31e3ea,JSON[_0x0ad1('0x71')](_0x10c8e6));process[_0x0ad1('0x72')]('start');var _0x12bf04=_0x10c8e6[_0x0ad1('0x73')];var _0x1bde32=_[_0x0ad1('0x74')](_0x12bf04);var _0x1d98f4=_0x10c8e6['socket_timestamp'];var _0x4b8f0f=path['join'](config[_0x0ad1('0x75')],_0x0ad1('0x76'),_0x1d98f4+'.csv');hasTZ=_[_0x0ad1('0x52')](_0x12bf04)['includes'](_0x0ad1('0x6d'));var _0x279ec3=_[_0x0ad1('0x52')](_0x12bf04)[_0x0ad1('0x15')]();logger[_0x0ad1('0x59')](_0x0ad1('0x77'),_0x279ec3);db[_0x0ad1('0x78')]['findAll']({'raw':!![],'attributes':['id',_0x0ad1('0x79')]})[_0x0ad1('0x1d')](function(_0x414b08){for(var _0x1a9324=0x0;_0x1a9324<_0x414b08['length'];_0x1a9324++){if(_0x414b08[_0x1a9324][_0x0ad1('0x79')]in _0x12bf04){contactItemTypes[_0x0ad1('0x1b')](_0x414b08[_0x1a9324]);delete _0x1bde32[_0x414b08[_0x1a9324][_0x0ad1('0x79')]];hasAdditionalPhones=!![];}for(var _0x46ea32 in _0x12bf04){if(_0x414b08[_0x1a9324]['name']+_0x0ad1('0x7a')===_0x46ea32){phoneDescriptions[_0x0ad1('0x1b')]({'itemTypeId':_0x414b08[_0x1a9324]['id'],'description':_0x46ea32});delete _0x1bde32[_0x46ea32];}}}if(hasAdditionalPhones)_0x1bde32[_0x0ad1('0x19')]='';var _0x4c84b5=_[_0x0ad1('0x52')](_0x1bde32)['join']();logger['info'](_0x0ad1('0x77'),_0x4c84b5);fs[_0x0ad1('0x7b')](_0x4b8f0f,_0x4c84b5+'\x0a');Papa[_0x0ad1('0x7c')](fs[_0x0ad1('0x7d')](_0x31e3ea),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5c0259,_0x445ef8){try{for(var _0x46ed36=0x0,_0x45e775=[];_0x46ed36<_0x5c0259[_0x0ad1('0x7e')][_0x0ad1('0x1a')];_0x46ed36++){stats[_0x0ad1('0x7f')]+=0x1;if(_0x5c0259[_0x0ad1('0x5c')][_0x46ed36]){handleError(_0x5c0259[_0x0ad1('0x7e')][_0x46ed36],_0x5c0259[_0x0ad1('0x5c')][_0x46ed36]);}else{var _0x1f517b=[];var _0x521d57=[];var _0x5b130a={};for(var _0x51f6bc in _0x12bf04){let _0x489693=contactItemTypes[_0x0ad1('0x80')](_0x32dc07=>_0x32dc07[_0x0ad1('0x79')]===_0x51f6bc);let _0x4ba0d4=contactItemTypes[_0x0ad1('0x80')](_0x304383=>_0x304383[_0x0ad1('0x79')]+_0x0ad1('0x7a')===_0x51f6bc);if(_[_0x0ad1('0x1f')](_0x489693)&&_[_0x0ad1('0x1f')](_0x4ba0d4)){if(_0x12bf04[_0x0ad1('0x81')](_0x51f6bc)){if(_0x5c0259[_0x0ad1('0x7e')][_0x46ed36][_0x12bf04[_0x51f6bc]]){var _0x27568a=_[_0x0ad1('0x82')](_0x5c0259[_0x0ad1('0x7e')][_0x46ed36][_0x12bf04[_0x51f6bc]][_0x0ad1('0x83')](/"/g,'\x27'));switch(_0x51f6bc){case _0x0ad1('0x2e'):var _0x54e3bf=moment(_0x27568a,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x54e3bf[_0x0ad1('0x84')]()){_0x45e775['push']('\x22'+_0x27568a+'\x22');}else{_0x1f517b['push'](_0x0ad1('0x85'));}break;case _0x0ad1('0x32'):var _0x1027a1=parseInt(_0x27568a);_0x27568a=_['isNaN'](_0x1027a1)||_0x1027a1<0x0||_0x1027a1>0x4?_0x5cd267?0x3:0x2:_0x1027a1;_0x45e775['push']('\x22'+_0x27568a+'\x22');break;case _0x0ad1('0x33'):var _0x448442=parseInt(_0x27568a);if(_[_0x0ad1('0x86')](_0x448442)&&_[_0x0ad1('0x87')](_0x24b17a,_0x448442)){_0x45e775[_0x0ad1('0x1b')]('\x22'+_0x448442+'\x22');}else{_0x1f517b[_0x0ad1('0x1b')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x27568a)){_0x45e775[_0x0ad1('0x1b')]('\x22'+_0x27568a+'\x22');}else{_0x1f517b[_0x0ad1('0x1b')](_0x0ad1('0x88'));}break;case _0x0ad1('0x89'):var _0x575356=moment(_0x27568a,_0x0ad1('0x8a'),!![]);if(_0x575356['isValid']()){_0x45e775['push']('\x22'+_0x27568a+'\x22');}else{_0x1f517b['push'](_0x0ad1('0x8b'));}break;case _0x0ad1('0x6d'):var _0x4ea8c4=shared[_0x0ad1('0x6c')];var _0x27b422=_0x4ea8c4[_0x27568a];if(!_[_0x0ad1('0x1f')](_0x27b422)){var _0x52f503=_0x27b422[_0x0ad1('0x6e')];_0x45e775[_0x0ad1('0x1b')]('\x22'+_0x27568a+'\x22');_0x45e775[_0x0ad1('0x1b')]('\x22'+_0x52f503+'\x22');}break;default:_0x45e775[_0x0ad1('0x1b')]('\x22'+_0x27568a+'\x22');}}else{switch(_0x51f6bc){case _0x0ad1('0x8c'):case'phone':_0x1f517b[_0x0ad1('0x1b')](_0x51f6bc+_0x0ad1('0x8d'));break;default:_0x45e775[_0x0ad1('0x1b')]('\x22\x22');}}}}else{var _0x250c93='';if(!_[_0x0ad1('0x1f')](_0x489693)){if(!_0x5b130a['hasOwnProperty'](_0x489693['id'])){if(!_[_0x0ad1('0x1f')](_0x5c0259['data'][_0x46ed36][_0x12bf04[_0x51f6bc]])){var _0x27568a=_['trim'](_0x5c0259[_0x0ad1('0x7e')][_0x46ed36][_0x12bf04[_0x51f6bc]][_0x0ad1('0x83')](/"/g,'\x27'));var _0x3e8801=phoneDescriptions[_0x0ad1('0x80')](_0x2e2ecb=>_0x2e2ecb['itemTypeId']===_0x489693['id']);if(!_[_0x0ad1('0x1f')](_0x3e8801)){var _0x35e341=_[_0x0ad1('0x82')](_0x5c0259['data'][_0x46ed36][_0x12bf04[_0x3e8801[_0x0ad1('0x8e')]]][_0x0ad1('0x83')](/"/g,'\x27'));if(!_[_0x0ad1('0x1f')](_0x35e341))_0x27568a=_0x27568a+'§'+_0x35e341;}if(_0x250c93=='')_0x250c93=_0x27568a;else _0x250c93+='|'+_0x27568a;}_0x521d57['push'](_0x489693['id']+':'+_0x250c93);_0x5b130a[_0x489693['id']]=0x1;}}}}if(hasAdditionalPhones){_0x45e775[_0x0ad1('0x1b')]('\x22'+_0x521d57['join'](';')+'\x22');}if(_0x1f517b[_0x0ad1('0x1a')]){handleError(_0x5c0259[_0x0ad1('0x7e')][_0x46ed36],{'code':'SystemRow','message':_0x1f517b['join']()});}else{fs[_0x0ad1('0x8f')](_0x4b8f0f,_0x45e775[_0x0ad1('0x15')]()+'\x0a');}_0x45e775=[];}if(!(stats[_0x0ad1('0x7f')]%0xc8)){socket[_0x0ad1('0x90')](_0x0ad1('0x91')+_0x1d98f4,stats);stats[_0x0ad1('0x5c')]=[];}}if(stopped){logger[_0x0ad1('0x59')](_0x0ad1('0x92'));_0x445ef8[_0x0ad1('0x93')]();}}catch(_0x1f16b3){handleError(_0x5c0259['data'][_0x46ed36],{'code':'SystemError','message':_0x1f16b3[_0x0ad1('0x5d')]});logger[_0x0ad1('0x66')](_0x0ad1('0x94'),_0x1f16b3[_0x0ad1('0x5d')]);}},'complete':function(){try{var _0x3820ac=[];var _0x5e74b2=[];var _0x5054aa=_0x0ad1('0x35');if(_0x10c8e6[_0x0ad1('0x95')]&&_0x10c8e6[_0x0ad1('0x95')][_0x0ad1('0x1a')]){_0x5054aa=_0x0ad1('0x96')+_0x1d98f4;_0x3820ac[_0x0ad1('0x1b')](_0x0ad1('0x97')+_0x5054aa+_0x0ad1('0x98'));}tmp_campaigns=_0x0ad1('0x99')+_0x1d98f4;tmp_voice_queues='voice_queues_'+_0x1d98f4;_0x5e74b2['push'](_0x0ad1('0x97')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x5e74b2[_0x0ad1('0x1b')](_0x0ad1('0x97')+tmp_voice_queues+_0x0ad1('0x9a'));BPromise[_0x0ad1('0x9b')](_0x5e74b2,handleTZQuery)[_0x0ad1('0x1d')](function(_0x2c53d7){updateTzCampaigns(_0x10c8e6[_0x0ad1('0x30')])[_0x0ad1('0x1d')](function(_0x49f274){updateTzVoiceQueues(_0x10c8e6[_0x0ad1('0x30')])['then'](function(_0x21c8ea){if(hasTZ)_0x4c84b5=_0x4c84b5[_0x0ad1('0x83')](_0x0ad1('0x6d'),'dialTimezone,utcOffset');var _0x4fbea7=util[_0x0ad1('0xe')]('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',_0x4b8f0f,_0x5054aa,_0x4c84b5,_0x10c8e6['ListId'],_0x10c8e6['CompanyId']||null,NOW,NOW);if(_[_0x0ad1('0x1f')](_0x12bf04[_0x0ad1('0x2e')])){_0x4fbea7+=_0x0ad1('0x9c');}_0x3820ac[_0x0ad1('0x1b')](_0x4fbea7);if(_0x10c8e6[_0x0ad1('0x95')]&&_0x10c8e6[_0x0ad1('0x95')][_0x0ad1('0x1a')]){_0x3820ac[_0x0ad1('0x1b')](insertCmContact(_0x10c8e6[_0x0ad1('0x30')],_0x5054aa,_0x10c8e6[_0x0ad1('0x95')],_0x12bf04));_0x3820ac[_0x0ad1('0x1b')](_0x0ad1('0x9d')+_0x5054aa+';');}BPromise['each'](_0x3820ac,handleQuery)['then'](function(_0x419126){BPromise['all']([handleAdditionalPhones()])[_0x0ad1('0x1d')](function(){_0x3820ac=[];for(var _0x1a3503=0x0;_0x1a3503_0x2a8b51[_0x959b('0x70')]===_0x212ff0);let _0x244595=contactItemTypes[_0x959b('0x77')](_0x34443a=>_0x34443a['name']+_0x959b('0x71')===_0x212ff0);if(_[_0x959b('0x1b')](_0x2d65ac)&&_[_0x959b('0x1b')](_0x244595)){if(_0x1c7792['hasOwnProperty'](_0x212ff0)){if(_0x2c8daf[_0x959b('0x76')][_0x17b26a][_0x1c7792[_0x212ff0]]){var _0x2ac5c0=_[_0x959b('0x78')](_0x2c8daf[_0x959b('0x76')][_0x17b26a][_0x1c7792[_0x212ff0]][_0x959b('0x79')](/"/g,'\x27'));switch(_0x212ff0){case _0x959b('0x36'):var _0x4216c4=moment(_0x2ac5c0,_0x959b('0xc'),!![]);if(_0x4216c4['isValid']()){_0xc9a54e[_0x959b('0x1c')]('\x22'+_0x2ac5c0+'\x22');}else{_0x208f6a[_0x959b('0x1c')](_0x959b('0x7a'));}break;case'priority':var _0x1de0c5=parseInt(_0x2ac5c0);_0x2ac5c0=_[_0x959b('0x7b')](_0x1de0c5)||_0x1de0c5<0x0||_0x1de0c5>0x4?_0x4c0c9d?0x3:0x2:_0x1de0c5;_0xc9a54e[_0x959b('0x1c')]('\x22'+_0x2ac5c0+'\x22');break;case _0x959b('0x7c'):var _0x43f9a0=parseInt(_0x2ac5c0);if(_[_0x959b('0x7d')](_0x43f9a0)&&_['includes'](_0x1a3a56,_0x43f9a0)){_0xc9a54e[_0x959b('0x1c')]('\x22'+_0x43f9a0+'\x22');}else{_0x208f6a[_0x959b('0x1c')](_0x959b('0x7e'));}break;case _0x959b('0x7f'):if(isEmail(_0x2ac5c0)){_0xc9a54e['push']('\x22'+_0x2ac5c0+'\x22');}else{_0x208f6a[_0x959b('0x1c')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x4fc944=moment(_0x2ac5c0,_0x959b('0x80'),!![]);if(_0x4fc944['isValid']()){_0xc9a54e[_0x959b('0x1c')]('\x22'+_0x2ac5c0+'\x22');}else{_0x208f6a[_0x959b('0x1c')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0xc9a54e[_0x959b('0x1c')]('\x22'+_0x2ac5c0+'\x22');}}else{switch(_0x212ff0){case _0x959b('0x81'):case'phone':_0x208f6a[_0x959b('0x1c')](_0x212ff0+_0x959b('0x82'));break;default:_0xc9a54e[_0x959b('0x1c')]('\x22\x22');}}}}else{var _0x53a2e5='';if(!_['isNil'](_0x2d65ac)){if(!_0x369bc7['hasOwnProperty'](_0x2d65ac['id'])){for(var _0x1e8010=0x0;_0x1e8010<_0x1c7792[_0x212ff0][_0x959b('0x1a')];_0x1e8010++){var _0x2ac5c0=_[_0x959b('0x78')](_0x2c8daf[_0x959b('0x76')][_0x17b26a][_0x1c7792[_0x212ff0][_0x1e8010]][_0x959b('0x79')](/"/g,'\x27'));var _0x55642b=phoneDescriptions['find'](_0x87b5df=>_0x87b5df[_0x959b('0x83')]===_0x2d65ac['id']);if(!_[_0x959b('0x1b')](_0x55642b)){var _0x140987=_[_0x959b('0x78')](_0x2c8daf[_0x959b('0x76')][_0x17b26a][_0x1c7792[_0x55642b[_0x959b('0x84')]][0x0]][_0x959b('0x79')](/"/g,'\x27'));if(!_[_0x959b('0x1b')](_0x140987))_0x2ac5c0=_0x2ac5c0+'§'+_0x140987;}if(_0x53a2e5=='')_0x53a2e5=_0x2ac5c0;else _0x53a2e5+='|'+_0x2ac5c0;}_0x2dc222[_0x959b('0x1c')](_0x2d65ac['id']+':'+_0x53a2e5);_0x369bc7[_0x2d65ac['id']]=0x1;}}}}if(hasAdditionalPhones){_0xc9a54e[_0x959b('0x1c')]('\x22'+_0x2dc222[_0x959b('0x12')](';')+'\x22');}if(_0x208f6a[_0x959b('0x1a')]){handleError(_0x2c8daf[_0x959b('0x76')][_0x17b26a],{'code':'SystemRow','message':_0x208f6a[_0x959b('0x12')]()});}else{fs[_0x959b('0x85')](_0x12c680,_0xc9a54e[_0x959b('0x12')]()+'\x0a');}_0xc9a54e=[];}if(!(stats[_0x959b('0x86')]%0xc8)){socket['emit']('contact:import:'+_0x2a928d,stats);stats['errors']=[];}}if(stopped){logger[_0x959b('0x60')](_0x959b('0x87'));_0x592aeb[_0x959b('0x88')]();}}catch(_0x3ed148){handleError(_0x2c8daf[_0x959b('0x76')][_0x17b26a],{'code':'SystemError','message':_0x3ed148[_0x959b('0x62')]});logger[_0x959b('0x20')](_0x959b('0x89'),_0x3ed148[_0x959b('0x62')]);}},'complete':function(){try{var _0x276b30=[];var _0x9695a7=tempTableName;_0x276b30['push'](_0x959b('0x8a')+_0x9695a7+'\x20LIKE\x20cm_contacts;');logger[_0x959b('0x60')](_0x959b('0x8b'),contactItemTypes[_0x959b('0x1a')]);var _0x3c0af6=util[_0x959b('0xb')](_0x959b('0x8c'),_0x12c680,_0x9695a7,_0xd64083,_0x1bfad2[_0x959b('0x38')],_0x1bfad2[_0x959b('0x59')]||null,NOW,NOW);if(_[_0x959b('0x1b')](_0x1c7792['scheduledat'])){_0x3c0af6+=_0x959b('0x8d');}_0x276b30['push'](_0x3c0af6);BPromise[_0x959b('0x8e')](_0x276b30,handleQuery)[_0x959b('0x1e')](function(_0x58cc29){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0x276b30=[];for(var _0x203b21=0x0;_0x203b21\x20\x20');}var _0x2ab2b4=path[_0x959b('0x12')](config[_0x959b('0x6b')],_0x959b('0x6c'),process[_0x959b('0x99')][0x2]);if(!fs[_0x959b('0x9a')](_0x2ab2b4)){throw new Error(_0x959b('0x9b'));}var _0x33c84e={};try{_0x33c84e=JSON[_0x959b('0x74')](process[_0x959b('0x99')][0x3]);if(!_0x33c84e['binding']){throw new Error(_0x959b('0x9c'));}var _0x3e3ead=0x0;if(_0x33c84e[_0x959b('0x69')]['UserId']){_0x3e3ead=0x1;}if(!_0x33c84e[_0x959b('0x38')]){throw new Error(_0x959b('0x9d'));}}catch(_0x392950){throw new Error(_0x959b('0x9e'));}var _0x54f037=[];try{_0x54f037=_[_0x959b('0x9f')](JSON[_0x959b('0x74')](process['argv'][0x4]),'id');}catch(_0x4a423a){logger[_0x959b('0x60')](_0x959b('0xa0'));}main(_0x2ab2b4,_0x33c84e,_0x54f037,_0x3e3ead);}validate();process['on'](_0x959b('0xa1'),handleStop);process['on'](_0x959b('0xa2'),handleUncaughtException); \ No newline at end of file +var _0x7cdc=['code','info','query','main','stringify','send','binding','clone','socket_timestamp','root','body','ContactItemType','findAll','name','_description','keys','writeFileSync','parse','data','rows','find','hasOwnProperty','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','itemTypeId','description','SystemRow','emit','Abort\x20parser','abort','SystemError','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len',',\x20scheduledAt\x20=\x20NOW()','each','contactId','contactTypeId','orderBy','DROP\x20TABLE\x20','finish','affectedRows','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','lodash','papaparse','bluebird','moment','squel','../../../mysqldb','../../../config/environment','import','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','format','YYYYMMDDHHmmss','test','field','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','sequelize','select\x20*\x20from\x20','spread','length','isNil','phone','AdditionalPhones','push','all','catch','error','message','split','findOne','then','CmContactHasItem','updated','create','PHONE','CmContact','update','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ListId','updatedAt','priority','UserId','recallme','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_hopper_black','ContactId','createdAt','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','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?','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','Received\x20SIGINT','exit','errors'];(function(_0x3be603,_0x5f139c){var _0x221620=function(_0x389fc7){while(--_0x389fc7){_0x3be603['push'](_0x3be603['shift']());}};_0x221620(++_0x5f139c);}(_0x7cdc,0x190));var _0xc7cd=function(_0x4a47d6,_0x449899){_0x4a47d6=_0x4a47d6-0x0;var _0x40e4e2=_0x7cdc[_0x4a47d6];return _0x40e4e2;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xc7cd('0x0'));var Papa=require(_0xc7cd('0x1'));var util=require('util');var BPromise=require(_0xc7cd('0x2'));var moment=require(_0xc7cd('0x3'));var squel=require(_0xc7cd('0x4'));var Redis=require('ioredis');var db=require(_0xc7cd('0x5'))['db'];var config=require(_0xc7cd('0x6'));var logger=require('../../../config/logger')(_0xc7cd('0x7'));config[_0xc7cd('0x8')]=_[_0xc7cd('0x9')](config[_0xc7cd('0x8')],{'host':_0xc7cd('0xa'),'port':0x18eb});var socket=require(_0xc7cd('0xb'))(new Redis(config[_0xc7cd('0x8')]));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'](_0xc7cd('0xc'));var tempTableName='cm_contacts_temp_'+moment()[_0xc7cd('0xd')](_0xc7cd('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x22f6a0){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))*$/[_0xc7cd('0xf')](_0x22f6a0);}function selectNotIn(_0x4b7cfe,_0x2c78e2,_0x4346ee,_0x5e019a,_0x39f39c){return squel['select']()[_0xc7cd('0x10')]('phone')[_0xc7cd('0x11')](_0x5e019a)[_0xc7cd('0x12')](_0x2c78e2,null,_0x2c78e2+_0xc7cd('0x13')+_0x5e019a+'.'+_0x4346ee)[_0xc7cd('0x14')](_0x5e019a+'.'+_0x4346ee+'\x20=\x20'+_0x4b7cfe+'.'+_0x4346ee)[_0xc7cd('0x14')](_0x2c78e2+_0xc7cd('0x15')+_0x39f39c['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3c9781,_0x5aa9a0){promisesAdditionalPhones=[];promisesContact=[];return db[_0xc7cd('0x16')]['query'](_0xc7cd('0x17')+tempTableName)[_0xc7cd('0x18')](function(_0x2f04cb){if(_0x2f04cb!==null){var _0x317b0b=[];for(var _0x494658=0x0;_0x494658<_0x2f04cb[_0xc7cd('0x19')];_0x494658++){var _0x34ddb8=_0x2f04cb[_0x494658];if(!_[_0xc7cd('0x1a')](_0x34ddb8[_0xc7cd('0x1b')])){if(!_[_0xc7cd('0x1a')](_0x34ddb8[_0xc7cd('0x1c')]))_0x317b0b[_0xc7cd('0x1d')](insertAdditionalPhones(_0x34ddb8));promisesContact[_0xc7cd('0x1d')]({'contact':_0x34ddb8});}}}Promise[_0xc7cd('0x1e')](_0x317b0b)['then'](function(){_0x3c9781({'val':0x1});});})[_0xc7cd('0x1f')](function(_0x5d9678){logger[_0xc7cd('0x20')](_0x5d9678[_0xc7cd('0x21')]);});});}function insertAdditionalPhones(_0xd45c9d){return new Promise(function(_0x1177a2,_0x449e15){var _0x571012=_0xd45c9d[_0xc7cd('0x1c')];if(_[_0xc7cd('0x1a')](_0x571012))_0x449e15({'val':0x0});else{var _0xf6b9db=_0x571012[_0xc7cd('0x22')](';');var _0x5b06b3=[];orderBy=0x0;for(var _0x255330=0x0;_0x255330<_0xf6b9db[_0xc7cd('0x19')];_0x255330++){_0x5b06b3[_0xc7cd('0x1d')](splitAdditionalPhone(_0xd45c9d['id'],_0xf6b9db[_0x255330]));}Promise[_0xc7cd('0x1e')](_0x5b06b3)['then'](function(){_0x1177a2({'val':_0xf6b9db['length']});});}});}function splitAdditionalPhone(_0x4f2259,_0x3b92a2){return new Promise(function(_0x577e4a,_0x2014bb){var _0x2ce431=_0x3b92a2[_0xc7cd('0x22')](':');var _0x2601b8=_0x2ce431[0x0];var _0x4450a5=_0x2ce431[0x1];if(_0x4450a5!==''){var _0x3242a4=_0x4450a5['split']('|');var _0x2d2c1c=[];for(var _0x33c1ca=0x0;_0x33c1ca<_0x3242a4[_0xc7cd('0x19')];_0x33c1ca++){if(_0x3242a4[_0x33c1ca]!==''){var _0x3652a7=_['filter'](promisesAdditionalPhones,{'contactId':_0x4f2259,'phone':_0x3242a4[_0x33c1ca]});if(_0x3652a7[_0xc7cd('0x19')]==0x0){orderBy++;promisesAdditionalPhones[_0xc7cd('0x1d')]({'contactId':_0x4f2259,'contactTypeId':_0x2601b8,'phone':_0x3242a4[_0x33c1ca],'orderBy':orderBy});}}}_0x577e4a({'ok':0x1});}else _0x577e4a({'res':0x0});});}function createAdditionalPhone(_0x104046,_0x173378,_0x4ed88b,_0x19aa4a){var _0x22be13='';var _0x5ab9a2='';var _0x4d3f3c=_0x4ed88b[_0xc7cd('0x22')]('§');_0x22be13=_0x4d3f3c[0x0];if(_0x4d3f3c[_0xc7cd('0x19')]==0x2)_0x5ab9a2=_0x4d3f3c[0x1];return new Promise(function(_0x360c06,_0x34530d){return db['CmContactHasItem'][_0xc7cd('0x23')]({'where':{'CmContactId':_0x104046,'item':_0x22be13}})[_0xc7cd('0x24')](function(_0x5ed4d5){if(_0x5ed4d5){return db[_0xc7cd('0x25')]['update']({'ItemTypeId':_0x173378,'description':_0x5ab9a2,'OrderBy':_0x19aa4a},{'where':{'CmContactId':_0x104046,'item':_0x22be13}})[_0xc7cd('0x24')](function(_0xbd2964){_0x360c06({'res':_0xc7cd('0x26')});});}else{return db[_0xc7cd('0x25')][_0xc7cd('0x27')]({'CmContactId':_0x104046,'item':_0x22be13,'ItemTypeId':_0x173378,'description':_0x5ab9a2,'OrderBy':_0x19aa4a,'ItemClass':_0xc7cd('0x28')})[_0xc7cd('0x24')](function(_0x11be09){_0x360c06({'res':'inserted'});});}});});}function updateContact(_0x4ee497){return new Promise(function(_0x2d4370,_0x57738c){var _0x5dfa8a=_0x4ee497['id'];delete _0x4ee497['id'];return db[_0xc7cd('0x29')][_0xc7cd('0x2a')](_0x4ee497,{'where':{'id':_0x5dfa8a}})[_0xc7cd('0x24')](function(_0x1b8e7b){updatedRows+=0x1;return db['CmHopper'][_0xc7cd('0x2a')]({'phone':_0x4ee497[_0xc7cd('0x1b')]},{'where':{'ContactId':_0x5dfa8a}})[_0xc7cd('0x24')](function(_0x28001b){_0x2d4370({'ret':'OK'});});});});}function insertCmHopper(_0x1bf7e3,_0x4c3d5f,_0xafa7d8,_0x2d2fc7,_0x5c6060){var _0xf0eb98=[_0xc7cd('0x2b'),_0xc7cd('0x2c'),_0xc7cd('0x2d'),'cm_contacts.ListId',_0x4c3d5f+'.'+_0x2d2fc7,_0xc7cd('0x2e'),_0xc7cd('0x2f'),_0xc7cd('0x30'),_0xc7cd('0x31'),'\x22'+_0x5c6060+'\x22'];return squel[_0xc7cd('0x32')]()[_0xc7cd('0x33')](_0xc7cd('0x34'))[_0xc7cd('0x35')]([_0xc7cd('0x1b'),_0xc7cd('0x36'),'ContactId',_0xc7cd('0x37'),_0x2d2fc7,'createdAt',_0xc7cd('0x38'),_0xc7cd('0x39'),_0xc7cd('0x3a'),_0xc7cd('0x3b')],squel[_0xc7cd('0x3c')]()[_0xc7cd('0x3d')](_0xf0eb98)['from'](_0x4c3d5f)['join'](_0xc7cd('0x3e'),null,_0xc7cd('0x3f')+_0x4c3d5f+_0xc7cd('0x40'))['join'](_0xafa7d8,null,_0xafa7d8+_0xc7cd('0x13')+_0x4c3d5f+'.'+_0x2d2fc7)[_0xc7cd('0x14')](_0x4c3d5f+_0xc7cd('0x41'),_0x1bf7e3)[_0xc7cd('0x14')](_0xc7cd('0x42'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x4c3d5f,_0xafa7d8,_0x2d2fc7,_0xc7cd('0x34'),[_0xc7cd('0x43'),_0xc7cd('0x44')]))['where'](_0xc7cd('0x45'),selectNotIn(_0x4c3d5f,_0xafa7d8,_0x2d2fc7,_0xc7cd('0x34'),[_0xc7cd('0x43')])))[_0xc7cd('0x46')]();}function insertCmHopperBlack(_0x2761de,_0x1d9c74,_0x4d96ab,_0x2ae7eb){var _0x25eb7d=[_0xc7cd('0x2b'),'cm_contacts.id','cm_contacts.ListId',_0x1d9c74+'.'+_0x2ae7eb,_0xc7cd('0x2e'),_0xc7cd('0x2f')];return squel[_0xc7cd('0x32')]()[_0xc7cd('0x33')](_0xc7cd('0x47'))['fromQuery'](['phone',_0xc7cd('0x48'),_0xc7cd('0x37'),_0x2ae7eb,_0xc7cd('0x49'),_0xc7cd('0x38')],squel[_0xc7cd('0x3c')]()[_0xc7cd('0x3d')](_0x25eb7d)['from'](_0x1d9c74)[_0xc7cd('0x12')](_0xc7cd('0x3e'),null,_0xc7cd('0x3f')+_0x1d9c74+_0xc7cd('0x40'))[_0xc7cd('0x12')](_0x4d96ab,null,_0x4d96ab+_0xc7cd('0x13')+_0x1d9c74+'.'+_0x2ae7eb)[_0xc7cd('0x14')](_0x1d9c74+_0xc7cd('0x41'),_0x2761de)[_0xc7cd('0x14')](_0xc7cd('0x42'),NOW)[_0xc7cd('0x14')](_0xc7cd('0x45'),squel[_0xc7cd('0x3c')]()[_0xc7cd('0x10')]('phone')[_0xc7cd('0x11')](_0xc7cd('0x47'))['where'](_0xc7cd('0x4a'),_0x2761de)[_0xc7cd('0x14')](_0x2ae7eb+_0xc7cd('0x4b'),_0x1d9c74+'.'+_0x2ae7eb)))[_0xc7cd('0x46')]();}function insertCmHopperAdditionalPhones(_0x1e7093){var _0x205d3e=[_0xc7cd('0x4c'),_0xc7cd('0x4d'),_0xc7cd('0x4e'),_0xc7cd('0x4f'),_0xc7cd('0x50')];return squel[_0xc7cd('0x32')]()[_0xc7cd('0x33')](_0xc7cd('0x51'))['fromQuery'](['CmHopperId','phone','OrderBy',_0xc7cd('0x49'),_0xc7cd('0x38')],squel[_0xc7cd('0x3c')]()[_0xc7cd('0x3d')](_0x205d3e)[_0xc7cd('0x11')](_0xc7cd('0x34'))[_0xc7cd('0x12')](_0xc7cd('0x3e'),null,_0xc7cd('0x52'))[_0xc7cd('0x12')](_0xc7cd('0x53'),null,_0xc7cd('0x54'))[_0xc7cd('0x14')](_0xc7cd('0x55'),_0x1e7093)[_0xc7cd('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0xc7cd('0x46')]();}function insertCmContact(_0x285df4,_0x3613a9,_0x558700,_0x59e368){var _0x1256cf=_['concat'](_['keys'](_0x59e368),['ListId',_0xc7cd('0x56'),_0xc7cd('0x49'),_0xc7cd('0x38')]);return squel[_0xc7cd('0x32')]()['into'](_0xc7cd('0x3e'))[_0xc7cd('0x35')](_0x1256cf,squel[_0xc7cd('0x3c')]()[_0xc7cd('0x3d')](_0x1256cf)[_0xc7cd('0x11')](_0x3613a9)[_0xc7cd('0x14')]('('+_0x558700[_0xc7cd('0x12')](',')+_0xc7cd('0x57'),squel[_0xc7cd('0x3c')]()['fields'](_0x558700)[_0xc7cd('0x11')](_0xc7cd('0x3e'))[_0xc7cd('0x14')]('ListId\x20=\x20?',_0x285df4))['where'](_0xc7cd('0x58'),squel[_0xc7cd('0x3c')]()[_0xc7cd('0x10')](_0xc7cd('0x59'),_0xc7cd('0x5a'))[_0xc7cd('0x11')](_0x3613a9)[_0xc7cd('0x5b')](_0x558700['join'](','))))[_0xc7cd('0x46')]();}function handleStop(){logger['info'](_0xc7cd('0x5c'));stopped=!![];}function handleUncaughtException(_0x199e5a){logger[_0xc7cd('0x20')](_0x199e5a['message']);process[_0xc7cd('0x5d')](0x1);}function handleError(_0x1307c6,_0x47325e){stats[_0xc7cd('0x5e')]['push']({'name':_0x47325e[_0xc7cd('0x5f')],'message':_0x47325e[_0xc7cd('0x21')],'row':_0x1307c6});}function handleQuery(_0x222fca){logger[_0xc7cd('0x60')](_0x222fca);return db['sequelize'][_0xc7cd('0x61')](_0x222fca)[_0xc7cd('0x18')](function(_0x1e6481){results[_0xc7cd('0x1d')](_0x1e6481);})[_0xc7cd('0x1f')](function(_0x4fe62a){logger['error'](_0x4fe62a[_0xc7cd('0x21')]);});}function main(_0x5871a1,_0x5df73c,_0x4a71af,_0x1a829a){logger['info'](_0xc7cd('0x62'),_0x5871a1,JSON[_0xc7cd('0x63')](_0x5df73c));process[_0xc7cd('0x64')]('start');var _0x4e97d1=_0x5df73c[_0xc7cd('0x65')];var _0x3f42dc=_[_0xc7cd('0x66')](_0x4e97d1);var _0x1f970c=_0x5df73c[_0xc7cd('0x67')];var _0x5adb85=path['join'](config[_0xc7cd('0x68')],'server/files/tmp',_0x1f970c+'.csv');logger[_0xc7cd('0x60')](_0xc7cd('0x69'),_0x5df73c);db[_0xc7cd('0x6a')][_0xc7cd('0x6b')]({'raw':!![],'attributes':['id',_0xc7cd('0x6c')]})[_0xc7cd('0x24')](function(_0x50d66e){for(var _0x1257f3=0x0;_0x1257f3<_0x50d66e[_0xc7cd('0x19')];_0x1257f3++){if(_0x50d66e[_0x1257f3][_0xc7cd('0x6c')]in _0x4e97d1){contactItemTypes[_0xc7cd('0x1d')](_0x50d66e[_0x1257f3]);delete _0x3f42dc[_0x50d66e[_0x1257f3][_0xc7cd('0x6c')]];hasAdditionalPhones=!![];}for(var _0x5bb5fb in _0x4e97d1){if(_0x50d66e[_0x1257f3][_0xc7cd('0x6c')]+_0xc7cd('0x6d')===_0x5bb5fb){phoneDescriptions['push']({'itemTypeId':_0x50d66e[_0x1257f3]['id'],'description':_0x5bb5fb});delete _0x3f42dc[_0x5bb5fb];}}}if(hasAdditionalPhones)_0x3f42dc[_0xc7cd('0x1c')]='';var _0x5ccf85=_[_0xc7cd('0x6e')](_0x3f42dc)['join']();logger[_0xc7cd('0x60')]('header',_0x5ccf85);fs[_0xc7cd('0x6f')](_0x5adb85,_0x5ccf85+'\x0a');Papa[_0xc7cd('0x70')](fs['createReadStream'](_0x5871a1),{'header':!![],'skipEmptyLines':!![],'step':function(_0xf4dc9d,_0x5d6bcd){try{for(var _0x266ef3=0x0,_0x30bb8d=[];_0x266ef3<_0xf4dc9d[_0xc7cd('0x71')][_0xc7cd('0x19')];_0x266ef3++){stats[_0xc7cd('0x72')]+=0x1;if(_0xf4dc9d['errors'][_0x266ef3]){handleError(_0xf4dc9d[_0xc7cd('0x71')][_0x266ef3],_0xf4dc9d[_0xc7cd('0x5e')][_0x266ef3]);}else{var _0x19e123=[];var _0x10d133=[];var _0x55fec5={};for(var _0x355395 in _0x4e97d1){let _0x5ac889=contactItemTypes[_0xc7cd('0x73')](_0x514c2d=>_0x514c2d[_0xc7cd('0x6c')]===_0x355395);let _0x59dfd8=contactItemTypes[_0xc7cd('0x73')](_0x2a9be8=>_0x2a9be8[_0xc7cd('0x6c')]+_0xc7cd('0x6d')===_0x355395);if(_[_0xc7cd('0x1a')](_0x5ac889)&&_[_0xc7cd('0x1a')](_0x59dfd8)){if(_0x4e97d1[_0xc7cd('0x74')](_0x355395)){if(_0xf4dc9d[_0xc7cd('0x71')][_0x266ef3][_0x4e97d1[_0x355395]]){var _0x5a0b77=_[_0xc7cd('0x75')](_0xf4dc9d[_0xc7cd('0x71')][_0x266ef3][_0x4e97d1[_0x355395]][_0xc7cd('0x76')](/"/g,'\x27'));switch(_0x355395){case'scheduledat':var _0x195d2a=moment(_0x5a0b77,_0xc7cd('0xc'),!![]);if(_0x195d2a['isValid']()){_0x30bb8d[_0xc7cd('0x1d')]('\x22'+_0x5a0b77+'\x22');}else{_0x19e123[_0xc7cd('0x1d')](_0xc7cd('0x77'));}break;case _0xc7cd('0x39'):var _0x13fb77=parseInt(_0x5a0b77);_0x5a0b77=_[_0xc7cd('0x78')](_0x13fb77)||_0x13fb77<0x0||_0x13fb77>0x4?_0x1a829a?0x3:0x2:_0x13fb77;_0x30bb8d[_0xc7cd('0x1d')]('\x22'+_0x5a0b77+'\x22');break;case _0xc7cd('0x3a'):var _0x244148=parseInt(_0x5a0b77);if(_[_0xc7cd('0x79')](_0x244148)&&_[_0xc7cd('0x7a')](_0x4a71af,_0x244148)){_0x30bb8d[_0xc7cd('0x1d')]('\x22'+_0x244148+'\x22');}else{_0x19e123[_0xc7cd('0x1d')](_0xc7cd('0x7b'));}break;case _0xc7cd('0x7c'):if(isEmail(_0x5a0b77)){_0x30bb8d['push']('\x22'+_0x5a0b77+'\x22');}else{_0x19e123[_0xc7cd('0x1d')](_0xc7cd('0x7d'));}break;case _0xc7cd('0x7e'):var _0x2ef4c0=moment(_0x5a0b77,_0xc7cd('0x7f'),!![]);if(_0x2ef4c0[_0xc7cd('0x80')]()){_0x30bb8d[_0xc7cd('0x1d')]('\x22'+_0x5a0b77+'\x22');}else{_0x19e123[_0xc7cd('0x1d')](_0xc7cd('0x81'));}break;default:_0x30bb8d['push']('\x22'+_0x5a0b77+'\x22');}}else{switch(_0x355395){case _0xc7cd('0x82'):case _0xc7cd('0x1b'):_0x19e123[_0xc7cd('0x1d')](_0x355395+_0xc7cd('0x83'));break;default:_0x30bb8d[_0xc7cd('0x1d')]('\x22\x22');}}}}else{var _0x48e708='';if(!_['isNil'](_0x5ac889)){if(!_0x55fec5['hasOwnProperty'](_0x5ac889['id'])){for(var _0x4adcf0=0x0;_0x4adcf0<_0x4e97d1[_0x355395][_0xc7cd('0x19')];_0x4adcf0++){var _0x5a0b77=_[_0xc7cd('0x75')](_0xf4dc9d[_0xc7cd('0x71')][_0x266ef3][_0x4e97d1[_0x355395][_0x4adcf0]][_0xc7cd('0x76')](/"/g,'\x27'));var _0x5f40e6=phoneDescriptions[_0xc7cd('0x73')](_0x13f0c9=>_0x13f0c9[_0xc7cd('0x84')]===_0x5ac889['id']);if(!_[_0xc7cd('0x1a')](_0x5f40e6)){var _0x6c2b03=_['trim'](_0xf4dc9d[_0xc7cd('0x71')][_0x266ef3][_0x4e97d1[_0x5f40e6[_0xc7cd('0x85')]][0x0]][_0xc7cd('0x76')](/"/g,'\x27'));if(!_[_0xc7cd('0x1a')](_0x6c2b03))_0x5a0b77=_0x5a0b77+'§'+_0x6c2b03;}if(_0x48e708=='')_0x48e708=_0x5a0b77;else _0x48e708+='|'+_0x5a0b77;}_0x10d133[_0xc7cd('0x1d')](_0x5ac889['id']+':'+_0x48e708);_0x55fec5[_0x5ac889['id']]=0x1;}}}}if(hasAdditionalPhones){_0x30bb8d['push']('\x22'+_0x10d133[_0xc7cd('0x12')](';')+'\x22');}if(_0x19e123[_0xc7cd('0x19')]){handleError(_0xf4dc9d[_0xc7cd('0x71')][_0x266ef3],{'code':_0xc7cd('0x86'),'message':_0x19e123[_0xc7cd('0x12')]()});}else{fs['appendFileSync'](_0x5adb85,_0x30bb8d[_0xc7cd('0x12')]()+'\x0a');}_0x30bb8d=[];}if(!(stats['rows']%0xc8)){socket[_0xc7cd('0x87')]('contact:import:'+_0x1f970c,stats);stats[_0xc7cd('0x5e')]=[];}}if(stopped){logger['info'](_0xc7cd('0x88'));_0x5d6bcd[_0xc7cd('0x89')]();}}catch(_0x3553f0){handleError(_0xf4dc9d[_0xc7cd('0x71')][_0x266ef3],{'code':_0xc7cd('0x8a'),'message':_0x3553f0[_0xc7cd('0x21')]});logger['error'](_0xc7cd('0x8b'),_0x3553f0[_0xc7cd('0x21')]);}},'complete':function(){try{var _0x3b1df3=[];var _0x1675f0=tempTableName;_0x3b1df3[_0xc7cd('0x1d')](_0xc7cd('0x8c')+_0x1675f0+_0xc7cd('0x8d'));logger['info'](_0xc7cd('0x8e'),contactItemTypes['length']);var _0x3ab39f=util[_0xc7cd('0xd')]('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',_0x5adb85,_0x1675f0,_0x5ccf85,_0x5df73c[_0xc7cd('0x37')],_0x5df73c['CompanyId']||null,NOW,NOW);if(_['isNil'](_0x4e97d1['scheduledat'])){_0x3ab39f+=_0xc7cd('0x8f');}_0x3b1df3[_0xc7cd('0x1d')](_0x3ab39f);BPromise[_0xc7cd('0x90')](_0x3b1df3,handleQuery)[_0xc7cd('0x24')](function(_0x1b5c2b){BPromise['all']([handleAdditionalPhones()])[_0xc7cd('0x24')](function(){_0x3b1df3=[];for(var _0x283af=0x0;_0x283af\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.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','c.phone','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','groupBy','Setting','findOne','enableEmailPreview','COUNT(*)','isEmpty','where','t.id\x20IN\x20?','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','../../mysqldb','getAccountFK','role','agent','search','select','field','color','from','tools_tags','getInteractionFK','_interactions','u.id','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','\x20IN\x20?','map','getInteractionsTables','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','messages','\x20=\x20i.id','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','unreadMessages\x20{OPERATOR}\x200','{OPERATOR}','replace','isNumeric','i.id\x20LIKE\x20?','whatsapp','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','openchannel','parseSearch','sqlOperator','conditions','name','type','text','value','start','end','unreadMessages','read','and','Contact','$substring','split','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','tags','clause','ids','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','body','plainBody','some','forEach','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','resolve','then','fields','tag','filter','get','capitalize','chat','Websites','Accounts','i.thirdDisposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','Interaction','Sequelize','QueryTypes','SELECT','sequelize','query','toString'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xe631,0xd0));var _0x1e63=function(_0x5ce8b9,_0x5cded8){_0x5ce8b9=_0x5ce8b9-0x0;var _0xe34be0=_0xe631[_0x5ce8b9];return _0xe34be0;};'use strict';var _=require(_0x1e63('0x0'));var squel=require(_0x1e63('0x1'));var as=require(_0x1e63('0x2'));var qs=require(_0x1e63('0x3'));var updateInteraction=require(_0x1e63('0x4'))['updateInteraction'];var utils=require('./utils');var db=require(_0x1e63('0x5'))['db'];function skipInteractionsQuery(_0x54c72a,_0x3c1684,_0x2a95da){var _0x2d8604=![];var _0x164959=utils[_0x1e63('0x6')](_0x54c72a);if(_0x3c1684[_0x1e63('0x7')]===_0x1e63('0x8')&&!_0x2a95da[_0x1e63('0x9')]&&!_0x2a95da[_0x164959]){_0x2d8604=!![];}return _0x2d8604;}function getTagsQuery(){return squel[_0x1e63('0xa')]()[_0x1e63('0xb')]('id')[_0x1e63('0xb')]('name')[_0x1e63('0xb')](_0x1e63('0xc'))[_0x1e63('0xd')](_0x1e63('0xe'));}function getUsersQuery(_0x486b0f,_0x28eeda){var _0x16ef86=utils[_0x1e63('0xf')](_0x486b0f);var _0xddcfa5='user_has_'+_0x486b0f+_0x1e63('0x10');var _0x1036ae=squel['select']()['field'](_0x1e63('0x11'))[_0x1e63('0xb')](_0x1e63('0x12'))['field'](_0x1e63('0x13')+_0x16ef86)[_0x1e63('0xd')](_0xddcfa5,'ui')[_0x1e63('0x14')](_0x1e63('0x15'),'u',_0x1e63('0x16'));if(_0x28eeda[_0x1e63('0x17')]>0x0){_0x1036ae['where'](_0x1e63('0x13')+_0x16ef86+_0x1e63('0x18'),_[_0x1e63('0x19')](_0x28eeda,'id'));}return _0x1036ae;}function getInteractionsQuery(_0xd2fee){var _0x482b4f=utils[_0x1e63('0x1a')](_0xd2fee);var _0x1589a7=utils[_0x1e63('0x6')](_0xd2fee);var _0x152c99=utils[_0x1e63('0xf')](_0xd2fee);return squel['select']()['from'](_0x482b4f[_0x1e63('0x1b')],'i')['left_join'](_0x1e63('0x1c'),'c',_0x1e63('0x1d'))[_0x1e63('0x14')](_0x1e63('0x15'),'o',_0x1e63('0x1e'))[_0x1e63('0x14')](_0x482b4f[_0x1e63('0x1f')],'a','a.id\x20=\x20i.'+_0x1589a7)[_0x1e63('0x14')](_0x482b4f[_0x1e63('0x20')],'me','me.'+_0x152c99+_0x1e63('0x21'))['left_join'](_0x482b4f['interactionsTags'],'it',_0x1e63('0x22')+_0x152c99+_0x1e63('0x21'))[_0x1e63('0x14')](_0x1e63('0xe'),'t',_0x1e63('0x23'));}function getSqlClauses(){var _0x48fa7e={'body':squel['expr'](),'contact':squel[_0x1e63('0x24')](),'default':squel['expr'](),'fields':squel['expr'](),'filter':squel['expr'](),'read':squel['expr'](),'tags':{'clause':squel[_0x1e63('0x24')](),'ids':null},'user':squel[_0x1e63('0x24')]()};return _0x48fa7e;}function parseTagParameter(_0x427876){var _0x54ccba=squel[_0x1e63('0x24')]();if(_0x427876){var _0x4141a1=utils[_0x1e63('0x25')](_0x427876);_0x4141a1['forEach'](function(_0x145d98){_0x54ccba['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x145d98+',%');});}return _0x54ccba;}function parseReadParameter(_0x2aea94){var _0x5ae701='';if(_0x2aea94){_0x5ae701=_0x1e63('0x26');if(_0x2aea94==='1'){_0x5ae701=_0x5ae701['replace'](_0x1e63('0x27'),'=');}else{_0x5ae701=_0x5ae701[_0x1e63('0x28')](_0x1e63('0x27'),'>');}}return _0x5ae701;}function parseSearchFilter(_0x2b7adf,_0xd24f99){var _0x30ba9f=squel[_0x1e63('0x24')]();if(_0xd24f99){var _0x18d01d=_0xd24f99['replace']('\x5c','\x5c\x5c')[_0x1e63('0x28')](/'/g,'\x27\x27');if(qs[_0x1e63('0x29')](_0x18d01d)){_0x30ba9f['or'](_0x1e63('0x2a'),_0x18d01d+'%');if(['sms',_0x1e63('0x2b')][_0x1e63('0x2c')](_0x2b7adf)){_0x30ba9f['or'](_0x1e63('0x2d'),_0x18d01d+'%');}else if(_0x2b7adf===_0x1e63('0x2e')){_0x30ba9f['or'](_0x1e63('0x2f'),_0x18d01d+'%');}}else if(_0x2b7adf===_0x1e63('0x30')&&qs[_0x1e63('0x31')](_0x18d01d)){_0x30ba9f['or'](_0x1e63('0x32'),_0x18d01d+'%');}else{if(_0x2b7adf===_0x1e63('0x30')){_0x30ba9f['or'](_0x1e63('0x33'),qs['getFullTextValue'](_0x18d01d))['or'](_0x1e63('0x34'),qs[_0x1e63('0x35')](_0x18d01d));}else{if(_0x2b7adf!==_0x1e63('0x2e')){_0x30ba9f['or'](_0x1e63('0x36'),qs['getFullTextValue'](_0x18d01d));}_0x30ba9f['or'](_0x1e63('0x37'),_0x18d01d+'%');if(_0x2b7adf===_0x1e63('0x38')){_0x30ba9f['or']('i.from\x20LIKE\x20?',_0x18d01d+'%');}}}}return _0x30ba9f;}function parseAdvancedSearchFilter(_0x31e34a,_0x9fa658){var _0x5b1434=getSqlClauses();var _0x24a842=as[_0x1e63('0x39')](_0x31e34a);var _0x2dbc72=_0x24a842[_0x1e63('0x3a')];for(var _0x435ec3=0x0;_0x435ec3<_0x24a842[_0x1e63('0x3b')]['length'];_0x435ec3++){var _0x92d48f=_0x24a842['conditions'][_0x435ec3];var _0x38398c='i';var _0x2219ca=_['find'](_0x9fa658,[_0x1e63('0x3c'),_0x92d48f[_0x1e63('0xb')]]);if(_0x2219ca){var _0x2e7e96=as['buildExpression'](_0x38398c,_0x2219ca[_0x1e63('0x3d')],_0x92d48f);_0x5b1434['default'][_0x2dbc72](_0x2e7e96[_0x1e63('0x3e')],_0x2e7e96[_0x1e63('0x3f')][_0x1e63('0x40')],_0x2e7e96[_0x1e63('0x3f')][_0x1e63('0x41')]);}else{switch(_0x92d48f['field']){case _0x1e63('0x42'):var _0x5784cb=parseReadParameter(_0x92d48f['value']);_0x5b1434[_0x1e63('0x43')][_0x1e63('0x44')](_0x5784cb);break;case _0x1e63('0x45'):if(_0x92d48f['operator']===_0x1e63('0x46')){if(_0x92d48f['value'][_0x1e63('0x47')]('\x20')[_0x1e63('0x17')]>0x1){_0x5b1434[_0x1e63('0x48')][_0x2dbc72](_0x1e63('0x49'),qs['getFullTextValue'](_0x92d48f[_0x1e63('0x3f')]),null);}else{var _0x2c74f1='%'+_0x92d48f[_0x1e63('0x3f')]+'%';_0x5b1434['contact'][_0x2dbc72](_0x1e63('0x4a'),_0x2c74f1,_0x2c74f1,_0x2c74f1);}}else{_0x2219ca=_[_0x1e63('0x4b')](_0x9fa658,[_0x1e63('0x3c'),_0x1e63('0x4c')]);_0x92d48f[_0x1e63('0xb')]=_0x1e63('0x4c');_0x2e7e96=as['buildExpression'](_0x38398c,_0x2219ca[_0x1e63('0x3d')],_0x92d48f);_0x5b1434[_0x1e63('0x48')][_0x2dbc72](_0x2e7e96[_0x1e63('0x3e')],_0x2e7e96[_0x1e63('0x3f')][_0x1e63('0x40')],_0x2e7e96[_0x1e63('0x3f')][_0x1e63('0x41')]);}break;case'Tag':var _0x4253eb=_0x92d48f[_0x1e63('0x3f')]['split'](',')[_0x1e63('0x19')](function(_0x463eb1){return Number(_0x463eb1);});var _0x1edba8=parseTagParameter(_0x4253eb);_0x5b1434[_0x1e63('0x4d')][_0x1e63('0x4e')][_0x1e63('0x44')](_0x1edba8);_0x5b1434[_0x1e63('0x4d')][_0x1e63('0x4f')]=_0x4253eb;break;case _0x1e63('0x50'):if(_0x92d48f['operator']===_0x1e63('0x46')){_0x5b1434[_0x1e63('0x51')][_0x2dbc72](_0x1e63('0x52'),'%'+_0x92d48f[_0x1e63('0x3f')]+'%',null);}else{_0x2219ca=_[_0x1e63('0x4b')](_0x9fa658,[_0x1e63('0x3c'),_0x1e63('0x53')]);_0x92d48f['field']=_0x1e63('0x53');_0x2e7e96=as[_0x1e63('0x54')](_0x38398c,_0x2219ca[_0x1e63('0x3d')],_0x92d48f);_0x5b1434['user'][_0x2dbc72](_0x2e7e96[_0x1e63('0x3e')],_0x2e7e96[_0x1e63('0x3f')]['start'],_0x2e7e96[_0x1e63('0x3f')][_0x1e63('0x41')]);}break;case _0x1e63('0x55'):case _0x1e63('0x56'):_0x2e7e96=as['buildExpression']('me',null,_0x92d48f);_0x5b1434[_0x1e63('0x55')][_0x2dbc72](_0x2e7e96[_0x1e63('0x3e')],_0x2e7e96[_0x1e63('0x3f')][_0x1e63('0x40')],_0x2e7e96[_0x1e63('0x3f')][_0x1e63('0x41')]);break;}}}return _0x5b1434;}function parseModelFields(_0xff817f,_0x4cc872,_0x2567b2){var _0x592c66=utils[_0x1e63('0x6')](_0xff817f);var _0x452229=squel[_0x1e63('0x24')]();var _0x40fde2=_(_0x4cc872)['keys']()['map'](function(_0x397319){return _[_0x1e63('0x57')](_0x2567b2,[_0x1e63('0x3c'),_0x397319])?_0x397319:undefined;})['compact']()[_0x1e63('0x3f')]();if(_0x40fde2[_0x1e63('0x17')]>0x0){_0x40fde2[_0x1e63('0x58')](function(_0x380a37){if(_0x380a37===_0x592c66){_0x452229[_0x1e63('0x44')]('i.'+_0x592c66+'\x20IN\x20?',[][_0x1e63('0x59')](_0x4cc872[_0x380a37]));}else if(_0x380a37===_0x1e63('0x5a')){var _0x96aaec=JSON[_0x1e63('0x5b')](_0x4cc872[_0x380a37])[_0x1e63('0x5c')];var _0x70f173=JSON[_0x1e63('0x5b')](_0x4cc872[_0x380a37])[_0x1e63('0x5d')];_0x452229[_0x1e63('0x44')](_0x1e63('0x5e'),_0x96aaec,_0x70f173);}else{if(_0x4cc872[_0x380a37]===_0x1e63('0x5f')){_0x452229[_0x1e63('0x44')]('i.'+_0x380a37+_0x1e63('0x60'));}else{_0x452229[_0x1e63('0x44')]('i.'+_0x380a37+'\x20=\x20?',_0x4cc872[_0x380a37]);}}});}return _0x452229;}function parseQueryParameters(_0x4bae7d,_0x59e8a0,_0x3fa33f){var _0x2fc70d=getSqlClauses();return Promise[_0x1e63('0x61')]()[_0x1e63('0x62')](function(){return parseModelFields(_0x4bae7d,_0x59e8a0,_0x3fa33f);})[_0x1e63('0x62')](function(_0x267319){_0x2fc70d[_0x1e63('0x63')]['and'](_0x267319);return parseReadParameter(_0x59e8a0[_0x1e63('0x43')]);})[_0x1e63('0x62')](function(_0x2c52d5){_0x2fc70d[_0x1e63('0x43')][_0x1e63('0x44')](_0x2c52d5);return parseTagParameter(_0x59e8a0[_0x1e63('0x64')]);})[_0x1e63('0x62')](function(_0x559c51){_0x2fc70d[_0x1e63('0x4d')][_0x1e63('0x4e')][_0x1e63('0x44')](_0x559c51);return parseSearchFilter(_0x4bae7d,_0x59e8a0[_0x1e63('0x65')]);})[_0x1e63('0x62')](function(_0x231d89){_0x2fc70d[_0x1e63('0x65')]=_0x231d89;return _0x2fc70d;});}function checkAccountsRestrictions(_0xc1fd62,_0x48629f,_0x5f10f4){var _0x1fc81c=utils[_0x1e63('0x6')](_0xc1fd62);var _0x16b8e7=_0x1e63('0x66')+_[_0x1e63('0x67')](_0xc1fd62)+(_0xc1fd62===_0x1e63('0x68')?_0x1e63('0x69'):_0x1e63('0x6a'));var _0x5b8a75=squel['expr']();return Promise[_0x1e63('0x61')]()[_0x1e63('0x62')](function(){if(_0x5f10f4[_0x1e63('0x9')]&&_0x48629f[_0x1e63('0x7')]===_0x1e63('0x8')){return _0x48629f[_0x16b8e7]({'attributes':['id'],'raw':!![]});}})[_0x1e63('0x62')](function(_0x55b761){if(_0x55b761){if(_0x55b761[_0x1e63('0x17')]===0x0){_0x5b8a75['and']('i.'+_0x1fc81c+_0x1e63('0x60'));}else{_0x5b8a75[_0x1e63('0x44')]('i.'+_0x1fc81c+_0x1e63('0x18'),_[_0x1e63('0x19')](_0x55b761,'id'));}}else if(!_0x5f10f4[_0x1fc81c]){_0x5b8a75[_0x1e63('0x44')]('i.'+_0x1fc81c+'\x20IS\x20NOT\x20NULL');}})[_0x1e63('0x62')](function(){return _0x5b8a75;});}function getClosedOrderClause(_0x53607a,_0x14e2b7){var _0x2ff8c0='';var _0xdd6310=[_0x1e63('0x6b'),'i.secondDisposition','i.disposition'];if(_0x53607a===_0x1e63('0x30')){_0xdd6310[_0x1e63('0x6c')](_0x1e63('0x6d'));}if(_0x14e2b7[_0x1e63('0x6e')]==='0'&&_0x53607a===_0x1e63('0x30')){_0x2ff8c0=_0x1e63('0x6d');}else{if(_0x14e2b7[_0x1e63('0x6e')]==='1'){_0xdd6310[_0x1e63('0x6f')]();}_0x2ff8c0=_0x1e63('0x70')+_0xdd6310['join'](',\x20')+')';}return _0x2ff8c0;}function getFilteredInteractions(_0x1d4b77,_0x41644e,_0x3b8431,_0xbfc575){var _0x49630d=utils[_0x1e63('0xf')](_0x1d4b77);var _0x4d7a82=_['capitalize'](_0x1d4b77)+_0x1e63('0x71');var _0x43c937=[];var _0x1dfdce=getTagsQuery();var _0x5d26c1={'type':db[_0x1e63('0x72')][_0x1e63('0x73')][_0x1e63('0x74')],'raw':!![]};var _0x2ce672=[];var _0x58bb1d=[];return db[_0x1e63('0x75')][_0x1e63('0x76')](_0x1dfdce[_0x1e63('0x77')](),_0x5d26c1)['then'](function(_0x455bb0){_0x43c937=_[_0x1e63('0x78')](_0x455bb0,'id');_0x5d26c1=_['merge'](_0x5d26c1,{'model':db[_0x4d7a82],'mapToModel':!![],'nest':!![]});if(_0x3b8431['fields']){_0xbfc575[_0x1e63('0x79')][_0x1e63('0x58')](function(_0x221ade){_0x41644e['field']('i.'+_0x221ade);});}else{_0x41644e['field'](_0x1e63('0x7a'),_0x1e63('0x42'));_0x41644e[_0x1e63('0xb')]('a.key',_0x1e63('0x7b'));_0x41644e[_0x1e63('0xb')](_0x1e63('0x7c'),'Account.mandatoryDisposition');if(_0x1d4b77===_0x1e63('0x30')){_0x41644e['field'](_0x1e63('0x7d'),'Account.email');_0x41644e[_0x1e63('0xb')](_0x1e63('0x7e'),_0x1e63('0x7f'));_0x41644e[_0x1e63('0xb')]('i.id');_0x41644e[_0x1e63('0xb')](_0x1e63('0x80'));_0x41644e[_0x1e63('0xb')](_0x1e63('0x81'));_0x41644e[_0x1e63('0xb')](_0x1e63('0x82'));_0x41644e[_0x1e63('0xb')]('i.closedAt');_0x41644e[_0x1e63('0xb')](_0x1e63('0x83'));_0x41644e[_0x1e63('0xb')](_0x1e63('0x84'));_0x41644e[_0x1e63('0xb')](_0x1e63('0x85'));_0x41644e['field'](_0x1e63('0x86'));_0x41644e[_0x1e63('0xb')](_0x1e63('0x87'));_0x41644e['field'](_0x1e63('0x88'));_0x41644e['field'](_0x1e63('0x6b'));_0x41644e['field']('i.substatus');_0x41644e[_0x1e63('0xb')](_0x1e63('0x89'));_0x41644e['field'](_0x1e63('0x8a'));_0x41644e[_0x1e63('0xb')](_0x1e63('0x8b'));_0x41644e[_0x1e63('0xb')](_0x1e63('0x8c'));}else if(_0x1d4b77===_0x1e63('0x38')){_0x41644e[_0x1e63('0xb')](_0x1e63('0x8d'),_0x1e63('0x7f'));}else{_0x41644e['field']('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',_0x1e63('0x7f'));}if(_0x1d4b77!==_0x1e63('0x30')){_0x41644e['field']('i.*');}_0x41644e[_0x1e63('0xb')](_0x1e63('0x8e'),_0x1e63('0x8f'));_0x41644e[_0x1e63('0xb')](_0x1e63('0x90'),'Contact.lastName');_0x41644e[_0x1e63('0xb')]('c.email','Contact.email');_0x41644e['field'](_0x1e63('0x91'),_0x1e63('0x92'));_0x41644e['field']('c.mobile',_0x1e63('0x93'));_0x41644e[_0x1e63('0xb')](_0x1e63('0x94'),'Contact.fax');_0x41644e['field'](_0x1e63('0x95'),_0x1e63('0x96'));_0x41644e[_0x1e63('0xb')]('o.internal',_0x1e63('0x97'));_0x41644e[_0x1e63('0xb')](_0x1e63('0x98'),_0x1e63('0x99'));}if(_0xbfc575[_0x1e63('0x9a')]){_0x41644e['limit'](_0xbfc575[_0x1e63('0x9a')]);}if(_0xbfc575[_0x1e63('0x9b')]){_0x41644e['offset'](_0xbfc575[_0x1e63('0x9b')]);}return db[_0x1e63('0x75')]['query'](_0x41644e[_0x1e63('0x77')](),_0x5d26c1);})[_0x1e63('0x62')](function(_0x513ff0){_0x2ce672=_0x513ff0;var _0x34d457=getUsersQuery(_0x1d4b77,_0x2ce672);return db[_0x1e63('0x75')][_0x1e63('0x76')](_0x34d457[_0x1e63('0x77')](),_0x5d26c1);})[_0x1e63('0x62')](function(_0x122921){_0x58bb1d=_[_0x1e63('0x9c')](_0x122921,_0x49630d);if(_0x1d4b77===_0x1e63('0x30')){return db[_0x1e63('0x9d')][_0x1e63('0x9e')]({'attributes':[_0x1e63('0x9f')],'raw':!![]});}})[_0x1e63('0x62')](function(_0x7a15a5){var _0x4c4bbd=_0x7a15a5?_0x7a15a5[_0x1e63('0x9f')]:undefined;var _0x449ab4=_0x2ce672[_0x1e63('0x19')](function(_0x1c5558){return updateInteraction(_0x1c5558,_0x43c937,_0x58bb1d,_0x4c4bbd);});return Promise['all'](_0x449ab4);});}function countFilteredInteractions(_0x552b8f,_0x5132ae){var _0x311a44=_0x552b8f['clone']();_0x311a44[_0x1e63('0xb')](_0x1e63('0xa0'));_0x311a44[_0x1e63('0xb')](_0x1e63('0x7a'),_0x1e63('0x42'));var _0x15ea7a=utils[_0x1e63('0x25')](_0x5132ae);if(!_[_0x1e63('0xa1')](_0x15ea7a)){_0x311a44[_0x1e63('0xa2')](_0x1e63('0xa3'),_0x15ea7a);}var _0x46addb={'type':db['Sequelize'][_0x1e63('0x73')][_0x1e63('0x74')],'raw':!![]};return db['sequelize'][_0x1e63('0x76')](_0x311a44[_0x1e63('0x77')](),_0x46addb);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0xd2ea=['TagIds','limit','offset','groupBy','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)','unreadMessages','getSelectedTags','isEmpty','t.id\x20IN\x20?','Sequelize','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','./utils','../../mysqldb','role','agent','search','field','from','tools_tags','getInteractionFK','user_has_','_interactions','select','u.id','u.fullname','users','u.id\x20=\x20ui.UserId','length','where','ui.','\x20IN\x20?','map','getInteractionsTables','getAccountFK','interactions','left_join','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','it.','t.id\x20=\x20it.TagId','expr','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','fax','openchannel','i.from\x20LIKE\x20?','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','type','default','text','value','start','end','read','operator','$substring','split','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','name','ContactId','buildExpression','Tag','tags','clause','and','ids','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','then','fields','tag','filter','get','chat','Websites','resolve','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','capitalize','Interaction','QueryTypes','SELECT','sequelize','query','toString','keyBy','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','contactName','i.id','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.disposition','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)'];(function(_0x190d52,_0x563739){var _0x537be0=function(_0x59f743){while(--_0x59f743){_0x190d52['push'](_0x190d52['shift']());}};_0x537be0(++_0x563739);}(_0xd2ea,0x15f));var _0xad2e=function(_0x5ba5e,_0x40bffb){_0x5ba5e=_0x5ba5e-0x0;var _0x24c1cf=_0xd2ea[_0x5ba5e];return _0x24c1cf;};'use strict';var _=require(_0xad2e('0x0'));var squel=require(_0xad2e('0x1'));var as=require(_0xad2e('0x2'));var qs=require(_0xad2e('0x3'));var updateInteraction=require(_0xad2e('0x4'))['updateInteraction'];var utils=require(_0xad2e('0x5'));var db=require(_0xad2e('0x6'))['db'];function skipInteractionsQuery(_0xcba7cb,_0x3e0741,_0x2afdc4){var _0x2fd28e=![];var _0x29e97f=utils['getAccountFK'](_0xcba7cb);if(_0x3e0741[_0xad2e('0x7')]===_0xad2e('0x8')&&!_0x2afdc4[_0xad2e('0x9')]&&!_0x2afdc4[_0x29e97f]){_0x2fd28e=!![];}return _0x2fd28e;}function getTagsQuery(){return squel['select']()[_0xad2e('0xa')]('id')[_0xad2e('0xa')]('name')[_0xad2e('0xa')]('color')[_0xad2e('0xb')](_0xad2e('0xc'));}function getUsersQuery(_0x9879f2,_0x24c5da){var _0x489f25=utils[_0xad2e('0xd')](_0x9879f2);var _0x5707a5=_0xad2e('0xe')+_0x9879f2+_0xad2e('0xf');var _0x433696=squel[_0xad2e('0x10')]()['field'](_0xad2e('0x11'))['field'](_0xad2e('0x12'))['field']('ui.'+_0x489f25)['from'](_0x5707a5,'ui')['left_join'](_0xad2e('0x13'),'u',_0xad2e('0x14'));if(_0x24c5da[_0xad2e('0x15')]>0x0){_0x433696[_0xad2e('0x16')](_0xad2e('0x17')+_0x489f25+_0xad2e('0x18'),_[_0xad2e('0x19')](_0x24c5da,'id'));}return _0x433696;}function getInteractionsQuery(_0x5941c5){var _0xd40b31=utils[_0xad2e('0x1a')](_0x5941c5);var _0x2af208=utils[_0xad2e('0x1b')](_0x5941c5);var _0x34f946=utils[_0xad2e('0xd')](_0x5941c5);return squel[_0xad2e('0x10')]()['from'](_0xd40b31[_0xad2e('0x1c')],'i')[_0xad2e('0x1d')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0xad2e('0x1e'))[_0xad2e('0x1d')](_0xd40b31[_0xad2e('0x1f')],'a',_0xad2e('0x20')+_0x2af208)[_0xad2e('0x1d')](_0xd40b31[_0xad2e('0x21')],'me',_0xad2e('0x22')+_0x34f946+_0xad2e('0x23'))[_0xad2e('0x1d')](_0xd40b31[_0xad2e('0x24')],'it',_0xad2e('0x25')+_0x34f946+_0xad2e('0x23'))[_0xad2e('0x1d')](_0xad2e('0xc'),'t',_0xad2e('0x26'));}function getSqlClauses(){var _0x2e1c95={'body':squel['expr'](),'contact':squel[_0xad2e('0x27')](),'default':squel[_0xad2e('0x27')](),'fields':squel[_0xad2e('0x27')](),'filter':squel[_0xad2e('0x27')](),'read':squel[_0xad2e('0x27')](),'tags':{'clause':squel[_0xad2e('0x27')](),'ids':null},'user':squel[_0xad2e('0x27')]()};return _0x2e1c95;}function parseTagParameter(_0x175055){var _0xfd90a4=squel['expr']();if(_0x175055){var _0x356a19=utils['getSelectedTags'](_0x175055);_0x356a19[_0xad2e('0x28')](function(_0x28ef72){_0xfd90a4['or'](_0xad2e('0x29'),'%,'+_0x28ef72+',%');});}return _0xfd90a4;}function parseReadParameter(_0x11bfa9){var _0x5aec9d='';if(_0x11bfa9){_0x5aec9d=_0xad2e('0x2a');if(_0x11bfa9==='1'){_0x5aec9d=_0x5aec9d[_0xad2e('0x2b')](_0xad2e('0x2c'),'=');}else{_0x5aec9d=_0x5aec9d[_0xad2e('0x2b')](_0xad2e('0x2c'),'>');}}return _0x5aec9d;}function parseSearchFilter(_0x4ffa15,_0x434934){var _0xfd2087=squel[_0xad2e('0x27')]();if(_0x434934){var _0x4379f4=_0x434934[_0xad2e('0x2b')]('\x5c','\x5c\x5c')[_0xad2e('0x2b')](/'/g,'\x27\x27');if(qs[_0xad2e('0x2d')](_0x4379f4)){_0xfd2087['or'](_0xad2e('0x2e'),_0x4379f4+'%');if([_0xad2e('0x2f'),_0xad2e('0x30')][_0xad2e('0x31')](_0x4ffa15)){_0xfd2087['or']('i.phone\x20LIKE\x20?',_0x4379f4+'%');}else if(_0x4ffa15===_0xad2e('0x32')){_0xfd2087['or']('i.fax\x20LIKE\x20?',_0x4379f4+'%');}else if(_0x4ffa15===_0xad2e('0x33')){_0xfd2087['or'](_0xad2e('0x34'),_0x4379f4+'%');}}else if(_0x4ffa15===_0xad2e('0x35')&&qs[_0xad2e('0x36')](_0x4379f4)){_0xfd2087['or'](_0xad2e('0x37'),_0x4379f4+'%');}else{if(_0x4ffa15==='mail'){_0xfd2087['or'](_0xad2e('0x38'),qs[_0xad2e('0x39')](_0x4379f4))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xad2e('0x39')](_0x4379f4));}else{if(_0x4ffa15!==_0xad2e('0x32')){_0xfd2087['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xad2e('0x39')](_0x4379f4));}_0xfd2087['or'](_0xad2e('0x3a'),_0x4379f4+'%');}}}return _0xfd2087;}function parseAdvancedSearchFilter(_0x3efac5,_0x3de92c){var _0x2a130a=getSqlClauses();var _0x2fa320=as[_0xad2e('0x3b')](_0x3efac5);var _0x49880e=_0x2fa320[_0xad2e('0x3c')];for(var _0x5b4386=0x0;_0x5b4386<_0x2fa320['conditions'][_0xad2e('0x15')];_0x5b4386++){var _0x3fe26d=_0x2fa320[_0xad2e('0x3d')][_0x5b4386];var _0x14d8d6='i';var _0x48c77b=_[_0xad2e('0x3e')](_0x3de92c,['name',_0x3fe26d['field']]);if(_0x48c77b){var _0x924f10=as['buildExpression'](_0x14d8d6,_0x48c77b[_0xad2e('0x3f')],_0x3fe26d);_0x2a130a[_0xad2e('0x40')][_0x49880e](_0x924f10[_0xad2e('0x41')],_0x924f10[_0xad2e('0x42')][_0xad2e('0x43')],_0x924f10['value'][_0xad2e('0x44')]);}else{switch(_0x3fe26d[_0xad2e('0xa')]){case'unreadMessages':var _0x596eee=parseReadParameter(_0x3fe26d['value']);_0x2a130a[_0xad2e('0x45')]['and'](_0x596eee);break;case'Contact':if(_0x3fe26d[_0xad2e('0x46')]===_0xad2e('0x47')){if(_0x3fe26d[_0xad2e('0x42')][_0xad2e('0x48')]('\x20')[_0xad2e('0x15')]>0x1){_0x2a130a[_0xad2e('0x49')][_0x49880e](_0xad2e('0x4a'),qs['getFullTextValue'](_0x3fe26d[_0xad2e('0x42')]),null);}else{var _0x341f51='%'+_0x3fe26d[_0xad2e('0x42')]+'%';_0x2a130a[_0xad2e('0x49')][_0x49880e](_0xad2e('0x4b'),_0x341f51,_0x341f51,_0x341f51);}}else{_0x48c77b=_['find'](_0x3de92c,[_0xad2e('0x4c'),'ContactId']);_0x3fe26d[_0xad2e('0xa')]=_0xad2e('0x4d');_0x924f10=as[_0xad2e('0x4e')](_0x14d8d6,_0x48c77b[_0xad2e('0x3f')],_0x3fe26d);_0x2a130a[_0xad2e('0x49')][_0x49880e](_0x924f10[_0xad2e('0x41')],_0x924f10[_0xad2e('0x42')][_0xad2e('0x43')],_0x924f10[_0xad2e('0x42')][_0xad2e('0x44')]);}break;case _0xad2e('0x4f'):var _0x42be79=_0x3fe26d[_0xad2e('0x42')][_0xad2e('0x48')](',')[_0xad2e('0x19')](function(_0x2ad9a0){return Number(_0x2ad9a0);});var _0x922e18=parseTagParameter(_0x42be79);_0x2a130a[_0xad2e('0x50')][_0xad2e('0x51')][_0xad2e('0x52')](_0x922e18);_0x2a130a['tags'][_0xad2e('0x53')]=_0x42be79;break;case _0xad2e('0x54'):if(_0x3fe26d[_0xad2e('0x46')]===_0xad2e('0x47')){_0x2a130a[_0xad2e('0x55')][_0x49880e](_0xad2e('0x56'),'%'+_0x3fe26d[_0xad2e('0x42')]+'%',null);}else{_0x48c77b=_['find'](_0x3de92c,[_0xad2e('0x4c'),'UserId']);_0x3fe26d[_0xad2e('0xa')]=_0xad2e('0x57');_0x924f10=as[_0xad2e('0x4e')](_0x14d8d6,_0x48c77b[_0xad2e('0x3f')],_0x3fe26d);_0x2a130a[_0xad2e('0x55')][_0x49880e](_0x924f10['text'],_0x924f10[_0xad2e('0x42')][_0xad2e('0x43')],_0x924f10[_0xad2e('0x42')][_0xad2e('0x44')]);}break;case _0xad2e('0x58'):case'plainBody':_0x924f10=as[_0xad2e('0x4e')]('me',null,_0x3fe26d);_0x2a130a[_0xad2e('0x58')][_0x49880e](_0x924f10[_0xad2e('0x41')],_0x924f10[_0xad2e('0x42')]['start'],_0x924f10['value'][_0xad2e('0x44')]);break;}}}return _0x2a130a;}function parseModelFields(_0x343e4f,_0x4d2c66,_0x4ec64c){var _0x1e7b8a=utils['getAccountFK'](_0x343e4f);var _0x37db2d=squel[_0xad2e('0x27')]();var _0x5196bf=_(_0x4d2c66)[_0xad2e('0x59')]()[_0xad2e('0x19')](function(_0x275689){return _[_0xad2e('0x5a')](_0x4ec64c,['name',_0x275689])?_0x275689:undefined;})['compact']()[_0xad2e('0x42')]();if(_0x5196bf[_0xad2e('0x15')]>0x0){_0x5196bf[_0xad2e('0x28')](function(_0x5b1b56){if(_0x5b1b56===_0x1e7b8a){_0x37db2d[_0xad2e('0x52')]('i.'+_0x1e7b8a+_0xad2e('0x18'),[][_0xad2e('0x5b')](_0x4d2c66[_0x5b1b56]));}else if(_0x5b1b56===_0xad2e('0x5c')){var _0x52e4bc=JSON[_0xad2e('0x5d')](_0x4d2c66[_0x5b1b56])['$gte'];var _0x36ba65=JSON[_0xad2e('0x5d')](_0x4d2c66[_0x5b1b56])[_0xad2e('0x5e')];_0x37db2d[_0xad2e('0x52')](_0xad2e('0x5f'),_0x52e4bc,_0x36ba65);}else{if(_0x4d2c66[_0x5b1b56]===_0xad2e('0x60')){_0x37db2d[_0xad2e('0x52')]('i.'+_0x5b1b56+'\x20IS\x20NULL');}else{_0x37db2d[_0xad2e('0x52')]('i.'+_0x5b1b56+'\x20=\x20?',_0x4d2c66[_0x5b1b56]);}}});}return _0x37db2d;}function parseQueryParameters(_0x2d2dc2,_0x4222a7,_0xbc21e4){var _0xf72966=getSqlClauses();return Promise['resolve']()[_0xad2e('0x61')](function(){return parseModelFields(_0x2d2dc2,_0x4222a7,_0xbc21e4);})[_0xad2e('0x61')](function(_0x56e633){_0xf72966[_0xad2e('0x62')]['and'](_0x56e633);return parseReadParameter(_0x4222a7[_0xad2e('0x45')]);})[_0xad2e('0x61')](function(_0x43ddf3){_0xf72966[_0xad2e('0x45')][_0xad2e('0x52')](_0x43ddf3);return parseTagParameter(_0x4222a7[_0xad2e('0x63')]);})[_0xad2e('0x61')](function(_0x1e914d){_0xf72966[_0xad2e('0x50')]['clause'][_0xad2e('0x52')](_0x1e914d);return parseSearchFilter(_0x2d2dc2,_0x4222a7[_0xad2e('0x64')]);})[_0xad2e('0x61')](function(_0x243add){_0xf72966['filter']=_0x243add;return _0xf72966;});}function checkAccountsRestrictions(_0x5c7318,_0x3c894f,_0xae65b6){var _0xb03176=utils[_0xad2e('0x1b')](_0x5c7318);var _0x450803=_0xad2e('0x65')+_['capitalize'](_0x5c7318)+(_0x5c7318===_0xad2e('0x66')?_0xad2e('0x67'):'Accounts');var _0x45f3e7=squel[_0xad2e('0x27')]();return Promise[_0xad2e('0x68')]()[_0xad2e('0x61')](function(){if(_0xae65b6[_0xad2e('0x9')]&&_0x3c894f[_0xad2e('0x7')]===_0xad2e('0x8')){return _0x3c894f[_0x450803]({'attributes':['id'],'raw':!![]});}})[_0xad2e('0x61')](function(_0x745c47){if(_0x745c47){if(_0x745c47[_0xad2e('0x15')]===0x0){_0x45f3e7['and']('i.'+_0xb03176+'\x20IS\x20NULL');}else{_0x45f3e7[_0xad2e('0x52')]('i.'+_0xb03176+'\x20IN\x20?',_['map'](_0x745c47,'id'));}}else if(!_0xae65b6[_0xb03176]){_0x45f3e7[_0xad2e('0x52')]('i.'+_0xb03176+_0xad2e('0x69'));}})[_0xad2e('0x61')](function(){return _0x45f3e7;});}function getClosedOrderClause(_0x4a4ec8,_0x114ed5){var _0x337d8c='';var _0x455e39=[_0xad2e('0x6a'),_0xad2e('0x6b'),'i.disposition'];if(_0x4a4ec8===_0xad2e('0x35')){_0x455e39['unshift']('i.substatus');}if(_0x114ed5['closed']==='0'&&_0x4a4ec8==='mail'){_0x337d8c=_0xad2e('0x6c');}else{if(_0x114ed5[_0xad2e('0x6d')]==='1'){_0x455e39[_0xad2e('0x6e')]();}_0x337d8c=_0xad2e('0x6f')+_0x455e39[_0xad2e('0x70')](',\x20')+')';}return _0x337d8c;}function getFilteredInteractions(_0x2c1871,_0x3b4ed2,_0x322b8d,_0x1a7d47){var _0x68e0d4=utils[_0xad2e('0xd')](_0x2c1871);var _0x55eef1=_[_0xad2e('0x71')](_0x2c1871)+_0xad2e('0x72');var _0x5832c9=[];var _0x584000=getTagsQuery();var _0x1010fd={'type':db['Sequelize'][_0xad2e('0x73')][_0xad2e('0x74')],'raw':!![]};var _0x3bdd1f=[];var _0x2d15c4=[];return db[_0xad2e('0x75')][_0xad2e('0x76')](_0x584000[_0xad2e('0x77')](),_0x1010fd)[_0xad2e('0x61')](function(_0x5101ec){_0x5832c9=_[_0xad2e('0x78')](_0x5101ec,'id');_0x1010fd=_['merge'](_0x1010fd,{'model':db[_0x55eef1],'mapToModel':!![],'nest':!![]});if(_0x322b8d['fields']){_0x1a7d47[_0xad2e('0x79')][_0xad2e('0x28')](function(_0x5319c0){_0x3b4ed2[_0xad2e('0xa')]('i.'+_0x5319c0);});}else{_0x3b4ed2[_0xad2e('0xa')](_0xad2e('0x7a'),'unreadMessages');_0x3b4ed2[_0xad2e('0xa')]('a.key',_0xad2e('0x7b'));_0x3b4ed2['field'](_0xad2e('0x7c'),_0xad2e('0x7d'));if(_0x2c1871===_0xad2e('0x35')){_0x3b4ed2[_0xad2e('0xa')](_0xad2e('0x7e'),_0xad2e('0x7f'));_0x3b4ed2['field']('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',_0xad2e('0x80'));_0x3b4ed2[_0xad2e('0xa')](_0xad2e('0x81'));_0x3b4ed2[_0xad2e('0xa')]('i.createdAt');_0x3b4ed2[_0xad2e('0xa')](_0xad2e('0x82'));_0x3b4ed2[_0xad2e('0xa')](_0xad2e('0x83'));_0x3b4ed2[_0xad2e('0xa')](_0xad2e('0x84'));_0x3b4ed2[_0xad2e('0xa')](_0xad2e('0x85'));_0x3b4ed2[_0xad2e('0xa')]('i.lastMsgAt');_0x3b4ed2[_0xad2e('0xa')](_0xad2e('0x86'));_0x3b4ed2[_0xad2e('0xa')]('i.subject');_0x3b4ed2[_0xad2e('0xa')](_0xad2e('0x87'));_0x3b4ed2[_0xad2e('0xa')](_0xad2e('0x6b'));_0x3b4ed2[_0xad2e('0xa')](_0xad2e('0x6a'));_0x3b4ed2['field']('i.substatus');_0x3b4ed2['field']('i.to');_0x3b4ed2[_0xad2e('0xa')](_0xad2e('0x88'));_0x3b4ed2['field'](_0xad2e('0x89'));_0x3b4ed2[_0xad2e('0xa')](_0xad2e('0x8a'));}else if(_0x2c1871===_0xad2e('0x33')){_0x3b4ed2[_0xad2e('0xa')](_0xad2e('0x8b'),_0xad2e('0x80'));}else{_0x3b4ed2[_0xad2e('0xa')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');}if(_0x2c1871!=='mail'){_0x3b4ed2['field']('i.*');}_0x3b4ed2[_0xad2e('0xa')]('c.firstName',_0xad2e('0x8c'));_0x3b4ed2[_0xad2e('0xa')](_0xad2e('0x8d'),'Contact.lastName');_0x3b4ed2['field'](_0xad2e('0x8e'),'Contact.email');_0x3b4ed2['field'](_0xad2e('0x8f'),_0xad2e('0x90'));_0x3b4ed2[_0xad2e('0xa')](_0xad2e('0x91'),_0xad2e('0x92'));_0x3b4ed2[_0xad2e('0xa')](_0xad2e('0x93'),_0xad2e('0x94'));_0x3b4ed2[_0xad2e('0xa')](_0xad2e('0x95'),'Owner.fullname');_0x3b4ed2['field'](_0xad2e('0x96'),_0xad2e('0x97'));_0x3b4ed2['field'](_0xad2e('0x98'),_0xad2e('0x99'));}if(_0x1a7d47['limit']){_0x3b4ed2['limit'](_0x1a7d47[_0xad2e('0x9a')]);}if(_0x1a7d47[_0xad2e('0x9b')]){_0x3b4ed2[_0xad2e('0x9b')](_0x1a7d47[_0xad2e('0x9b')]);}return db[_0xad2e('0x75')]['query'](_0x3b4ed2[_0xad2e('0x77')](),_0x1010fd);})['then'](function(_0x76b71a){_0x3bdd1f=_0x76b71a;var _0x19d0d1=getUsersQuery(_0x2c1871,_0x3bdd1f);return db['sequelize'][_0xad2e('0x76')](_0x19d0d1[_0xad2e('0x77')](),_0x1010fd);})[_0xad2e('0x61')](function(_0x47f679){_0x2d15c4=_[_0xad2e('0x9c')](_0x47f679,_0x68e0d4);if(_0x2c1871===_0xad2e('0x35')){return db[_0xad2e('0x9d')][_0xad2e('0x9e')]({'attributes':[_0xad2e('0x9f')],'raw':!![]});}})['then'](function(_0x2ea2d8){var _0x584c8c=_0x2ea2d8?_0x2ea2d8[_0xad2e('0x9f')]:undefined;var _0x409d39=_0x3bdd1f[_0xad2e('0x19')](function(_0xf143b6){return updateInteraction(_0xf143b6,_0x5832c9,_0x2d15c4,_0x584c8c);});return Promise[_0xad2e('0xa0')](_0x409d39);});}function countFilteredInteractions(_0x1f7d03,_0xb44d39){var _0xd342e4=_0x1f7d03[_0xad2e('0xa1')]();_0xd342e4[_0xad2e('0xa')](_0xad2e('0xa2'));_0xd342e4[_0xad2e('0xa')](_0xad2e('0x7a'),_0xad2e('0xa3'));var _0xf9a4c=utils[_0xad2e('0xa4')](_0xb44d39);if(!_[_0xad2e('0xa5')](_0xf9a4c)){_0xd342e4['where'](_0xad2e('0xa6'),_0xf9a4c);}var _0x475d6c={'type':db[_0xad2e('0xa7')][_0xad2e('0x73')]['SELECT'],'raw':!![]};return db[_0xad2e('0x75')][_0xad2e('0x76')](_0xd342e4[_0xad2e('0x77')](),_0x475d6c);}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 e4d19f1..29da795 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 _0xeddd=['lastMsgText','plainBody','catch','updateInteraction','Users','TagIds','Tags','lodash','../../mysqldb','push','waiting','talking','unmanaged','abandoned','total','disposition','UserId','answered','MailMessage','findOne','out','-id','then'];(function(_0x425403,_0x2df719){var _0x3bda23=function(_0x1afb6b){while(--_0x1afb6b){_0x425403['push'](_0x425403['shift']());}};_0x3bda23(++_0x2df719);}(_0xeddd,0x7a));var _0xdedd=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xeddd[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0xdedd('0x0'));var db=require(_0xdedd('0x1'))['db'];function getInteractionUsers(_0x421127,_0x2872f8){return new Promise(function(_0x55d0ea,_0x44aed6){try{var _0x59922a=[];if(_0x2872f8[_0x421127]){_0x59922a=_0x2872f8[_0x421127]['map'](function(_0x2c9e2c){return{'id':_0x2c9e2c['id'],'fullname':_0x2c9e2c['fullname']};});}return _0x55d0ea(_0x59922a);}catch(_0x179da1){_0x44aed6(_0x179da1);}});}function getInteractionTags(_0x56e2ed,_0x4db5ea){var _0x474f59=[];if(_0x56e2ed){_0x56e2ed['split'](',')['forEach'](function(_0x2df083){_0x474f59[_0xdedd('0x2')](_0x4db5ea[_0x2df083]);});}return _0x474f59;}function updateWaitingCounter(_0x4b2272){if(_0x4b2272[_0xdedd('0x3')]){_0x4b2272[_0xdedd('0x3')]-=0x1;}}function updateInteractionCounters(_0x184dc5){_0x184dc5['waiting']=0x0;_0x184dc5[_0xdedd('0x4')]=0x0;_0x184dc5['answered']=0x0;_0x184dc5[_0xdedd('0x5')]=0x0;_0x184dc5[_0xdedd('0x6')]=0x0;_0x184dc5[_0xdedd('0x7')]=0x0;if(_0x184dc5['closed']){if(_0x184dc5[_0xdedd('0x8')]==='abandoned'){_0x184dc5[_0xdedd('0x6')]+=0x1;updateWaitingCounter(_0x184dc5);}if(_0x184dc5[_0xdedd('0x9')]){_0x184dc5[_0xdedd('0xa')]+=0x1;if(_0x184dc5[_0xdedd('0x4')]){_0x184dc5[_0xdedd('0x4')]-=0x1;}}else{if(_0x184dc5['disposition']){_0x184dc5[_0xdedd('0x5')]+=0x1;updateWaitingCounter(_0x184dc5);}}}else{if(!_0x184dc5[_0xdedd('0x9')]){_0x184dc5[_0xdedd('0x3')]+=0x1;}if(_0x184dc5[_0xdedd('0x9')]){_0x184dc5['talking']+=0x1;updateWaitingCounter(_0x184dc5);}}_0x184dc5['total']+=0x1;return _0x184dc5;}function getLastMessageText(_0x1e4a29){return db[_0xdedd('0xb')][_0xdedd('0xc')]({'where':{'$and':[{'MailInteractionId':_0x1e4a29['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xdedd('0xd')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xdedd('0xe'),'raw':!![]})[_0xdedd('0xf')](function(_0x2f646b){if(_0x2f646b&&_0x2f646b['plainBody']){_0x1e4a29[_0xdedd('0x10')]=_['trimStart'](_0x2f646b[_0xdedd('0x11')]);}return _0x1e4a29;})[_0xdedd('0x12')](function(_0xcaa59e){throw _0xcaa59e;});}exports[_0xdedd('0x13')]=function(_0x49e0e1,_0x1607f5,_0x1c8289,_0x3c7f09){return new Promise(function(_0x3d791b,_0x28de5b){return getInteractionUsers(_0x49e0e1['id'],_0x1c8289)[_0xdedd('0xf')](function(_0x37e755){_0x49e0e1[_0xdedd('0x14')]=_0x37e755;return getInteractionTags(_0x49e0e1[_0xdedd('0x15')],_0x1607f5);})[_0xdedd('0xf')](function(_0x23701b){_0x49e0e1[_0xdedd('0x16')]=_0x23701b;delete _0x49e0e1[_0xdedd('0x15')];return updateInteractionCounters(_0x49e0e1);})[_0xdedd('0xf')](function(_0x136455){if(_0x3c7f09){return getLastMessageText(_0x136455);}else{return _0x136455;}})[_0xdedd('0xf')](function(_0x246b86){_0x3d791b(_0x246b86);})[_0xdedd('0x12')](function(_0xe3e97){_0x28de5b(_0xe3e97);});});}; \ No newline at end of file +var _0x1c2d=['lodash','../../mysqldb','map','fullname','split','waiting','answered','unmanaged','UserId','talking','disposition','total','findOne','out','plainBody','-id','then','lastMsgText','trimStart','catch','TagIds','Tags'];(function(_0x309573,_0x21047b){var _0x3169fd=function(_0x482213){while(--_0x482213){_0x309573['push'](_0x309573['shift']());}};_0x3169fd(++_0x21047b);}(_0x1c2d,0x14a));var _0xd1c2=function(_0x564b47,_0x4f0d35){_0x564b47=_0x564b47-0x0;var _0xd75e4d=_0x1c2d[_0x564b47];return _0xd75e4d;};'use strict';var _=require(_0xd1c2('0x0'));var db=require(_0xd1c2('0x1'))['db'];function getInteractionUsers(_0x5082a3,_0xd554ca){return new Promise(function(_0x245a1b,_0x3bd669){try{var _0x539613=[];if(_0xd554ca[_0x5082a3]){_0x539613=_0xd554ca[_0x5082a3][_0xd1c2('0x2')](function(_0x21fbc7){return{'id':_0x21fbc7['id'],'fullname':_0x21fbc7[_0xd1c2('0x3')]};});}return _0x245a1b(_0x539613);}catch(_0x372f2d){_0x3bd669(_0x372f2d);}});}function getInteractionTags(_0x23b46b,_0x997107){var _0x5db670=[];if(_0x23b46b){_0x23b46b[_0xd1c2('0x4')](',')['forEach'](function(_0x240f50){_0x5db670['push'](_0x997107[_0x240f50]);});}return _0x5db670;}function updateWaitingCounter(_0x35fcb9){if(_0x35fcb9[_0xd1c2('0x5')]){_0x35fcb9[_0xd1c2('0x5')]-=0x1;}}function updateInteractionCounters(_0x560473){_0x560473[_0xd1c2('0x5')]=0x0;_0x560473['talking']=0x0;_0x560473[_0xd1c2('0x6')]=0x0;_0x560473[_0xd1c2('0x7')]=0x0;_0x560473['abandoned']=0x0;_0x560473['total']=0x0;if(_0x560473['closed']){if(_0x560473['disposition']==='abandoned'){_0x560473['abandoned']+=0x1;updateWaitingCounter(_0x560473);}if(_0x560473[_0xd1c2('0x8')]){_0x560473[_0xd1c2('0x6')]+=0x1;if(_0x560473[_0xd1c2('0x9')]){_0x560473['talking']-=0x1;}}else{if(_0x560473[_0xd1c2('0xa')]){_0x560473[_0xd1c2('0x7')]+=0x1;updateWaitingCounter(_0x560473);}}}else{if(!_0x560473[_0xd1c2('0x8')]){_0x560473[_0xd1c2('0x5')]+=0x1;}if(_0x560473[_0xd1c2('0x8')]){_0x560473[_0xd1c2('0x9')]+=0x1;updateWaitingCounter(_0x560473);}}_0x560473[_0xd1c2('0xb')]+=0x1;return _0x560473;}function getLastMessageText(_0x129bb0){return db['MailMessage'][_0xd1c2('0xc')]({'where':{'$and':[{'MailInteractionId':_0x129bb0['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xd1c2('0xd')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xd1c2('0xe')],'order':_0xd1c2('0xf'),'raw':!![]})[_0xd1c2('0x10')](function(_0x1361ef){if(_0x1361ef&&_0x1361ef[_0xd1c2('0xe')]){_0x129bb0[_0xd1c2('0x11')]=_[_0xd1c2('0x12')](_0x1361ef[_0xd1c2('0xe')]);}return _0x129bb0;})[_0xd1c2('0x13')](function(_0x3a912e){throw _0x3a912e;});}exports['updateInteraction']=function(_0x25095c,_0xfc87fc,_0x5c84f9,_0x2709fb){return new Promise(function(_0x10eb23,_0xaca747){return getInteractionUsers(_0x25095c['id'],_0x5c84f9)['then'](function(_0x178e90){_0x25095c['Users']=_0x178e90;return getInteractionTags(_0x25095c[_0xd1c2('0x14')],_0xfc87fc);})['then'](function(_0x1c5e42){_0x25095c[_0xd1c2('0x15')]=_0x1c5e42;delete _0x25095c[_0xd1c2('0x14')];return updateInteractionCounters(_0x25095c);})[_0xd1c2('0x10')](function(_0x14fd68){if(_0x2709fb){return getLastMessageText(_0x14fd68);}else{return _0x14fd68;}})[_0xd1c2('0x10')](function(_0x5c0afe){_0x10eb23(_0x5c0afe);})[_0xd1c2('0x13')](function(_0x4f5bd0){_0xaca747(_0x4f5bd0);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index e8d148a..6715d69 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 _0x1aed=['Account','InteractionId','upperFirst','unknown','websites','_interaction_has_tags','_messages','user_has_','_interactions','isArray','toLowerCase','toUpperCase','role','findOne','then','update','info','catch','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website'];(function(_0x3b632f,_0x453380){var _0x10e788=function(_0x2228a4){while(--_0x2228a4){_0x3b632f['push'](_0x3b632f['shift']());}};_0x10e788(++_0x453380);}(_0x1aed,0x187));var _0xd1ae=function(_0x4c7eaa,_0x4dc319){_0x4c7eaa=_0x4c7eaa-0x0;var _0x982a61=_0x1aed[_0x4c7eaa];return _0x982a61;};'use strict';var _=require(_0xd1ae('0x0'));var db=require(_0xd1ae('0x1'))['db'];var loggers={'openchannel':require(_0xd1ae('0x2'))(_0xd1ae('0x3')),'mail':require('../../config/logger')(_0xd1ae('0x4')),'fax':require(_0xd1ae('0x2'))(_0xd1ae('0x5')),'sms':require(_0xd1ae('0x2'))(_0xd1ae('0x6')),'chat':require(_0xd1ae('0x2'))(_0xd1ae('0x7')),'whatsapp':require('../../config/logger')(_0xd1ae('0x8'))};function getAccountFK(_0x5ca1f6){return _[_0xd1ae('0x9')](_0x5ca1f6)+(_0x5ca1f6===_0xd1ae('0xa')?_0xd1ae('0xb'):_0xd1ae('0xc'))+'Id';}function getInteractionFK(_0x5a313c){return _[_0xd1ae('0x9')](_0x5a313c)+_0xd1ae('0xd');}function getInteractionId(_0x52b725,_0x64511b,_0x2122b2){if(_0x52b725&&_0x52b725[_['upperFirst'](_0x2122b2)+'InteractionId']){return _0x52b725[_[_0xd1ae('0xe')](_0x2122b2)+_0xd1ae('0xd')];}else if(_0x52b725&&_0x52b725['id']){return _0x52b725['id'];}else if(_0x64511b&&_0x64511b['id']){return _0x64511b['id'];}else{return _0xd1ae('0xf');}}function getInteractionsTables(_0x584753){return{'accounts':_0x584753+'_'+(_0x584753===_0xd1ae('0xa')?_0xd1ae('0x10'):'accounts'),'interactions':_0x584753+'_interactions','interactionsTags':_0x584753+_0xd1ae('0x11'),'messages':_0x584753+_0xd1ae('0x12'),'userInteractions':_0xd1ae('0x13')+_0x584753+_0xd1ae('0x14')};}function getSelectedTags(_0x503d94){var _0x28dc14=[];if(_0x503d94){_0x28dc14=Array[_0xd1ae('0x15')](_0x503d94)?_0x503d94:[_0x503d94];}return _0x28dc14;}function log(_0x1ede8a,_0x12260f,_0x5094a1,_0x5d7d2b,_0x18fb54,_0x39200f){loggers[_0x18fb54[_0xd1ae('0x16')]()][_0x1ede8a]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x39200f[_0xd1ae('0x17')](),_0x12260f?_0x12260f['id']:null,_0x12260f?_0x12260f['name']:null,_0x12260f?_0x12260f[_0xd1ae('0x18')]:null,getInteractionId(_0x5094a1,_0x5d7d2b,_0x18fb54),_0x5094a1?JSON['stringify'](_0x5094a1):'null');}function updateUser(_0x1681a4,_0x33811d,_0x1c6cdf,_0xff3dad,_0x544050){db[_['upperFirst'](_0xff3dad)+'Interaction'][_0xd1ae('0x19')]({'where':{'id':getInteractionId(_0x33811d,_0x1c6cdf,_0xff3dad)}})[_0xd1ae('0x1a')](function(_0x3335c6){if(_0x3335c6){return _0x3335c6[_0xd1ae('0x1b')]({'UserId':_0x1681a4?_0x1681a4['id']:null});}})[_0xd1ae('0x1a')](function(_0x57f186){if(_0x57f186){log(_0xd1ae('0x1c'),_0x1681a4,_0x33811d,_0x1c6cdf,_0xff3dad,_0x544050);}})[_0xd1ae('0x1d')](function(){log('error',_0x1681a4,_0x33811d,_0x1c6cdf,_0xff3dad,_0x544050);});}module[_0xd1ae('0x1e')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x47f7=['toUpperCase','name','null','findOne','update','then','info','catch','lodash','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','unknown','websites','_interactions','_interaction_has_tags','_messages','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x2fd32d,_0x50a97a){var _0x2b86be=function(_0x11fede){while(--_0x11fede){_0x2fd32d['push'](_0x2fd32d['shift']());}};_0x2b86be(++_0x50a97a);}(_0x47f7,0x19d));var _0x747f=function(_0x5f4597,_0x5b1147){_0x5f4597=_0x5f4597-0x0;var _0x20cf29=_0x47f7[_0x5f4597];return _0x20cf29;};'use strict';var _=require(_0x747f('0x0'));var db=require(_0x747f('0x1'))['db'];var loggers={'openchannel':require(_0x747f('0x2'))('openchannel-interactions'),'mail':require(_0x747f('0x2'))(_0x747f('0x3')),'fax':require(_0x747f('0x2'))(_0x747f('0x4')),'sms':require(_0x747f('0x2'))('sms-interactions'),'chat':require('../../config/logger')(_0x747f('0x5')),'whatsapp':require(_0x747f('0x2'))(_0x747f('0x6'))};function getAccountFK(_0x3efe67){return _[_0x747f('0x7')](_0x3efe67)+(_0x3efe67===_0x747f('0x8')?_0x747f('0x9'):_0x747f('0xa'))+'Id';}function getInteractionFK(_0x304724){return _[_0x747f('0x7')](_0x304724)+_0x747f('0xb');}function getInteractionId(_0x5d4689,_0x418b44,_0x5c6e06){if(_0x5d4689&&_0x5d4689[_['upperFirst'](_0x5c6e06)+'InteractionId']){return _0x5d4689[_['upperFirst'](_0x5c6e06)+'InteractionId'];}else if(_0x5d4689&&_0x5d4689['id']){return _0x5d4689['id'];}else if(_0x418b44&&_0x418b44['id']){return _0x418b44['id'];}else{return _0x747f('0xc');}}function getInteractionsTables(_0x84ca19){return{'accounts':_0x84ca19+'_'+(_0x84ca19===_0x747f('0x8')?_0x747f('0xd'):'accounts'),'interactions':_0x84ca19+_0x747f('0xe'),'interactionsTags':_0x84ca19+_0x747f('0xf'),'messages':_0x84ca19+_0x747f('0x10'),'userInteractions':'user_has_'+_0x84ca19+_0x747f('0xe')};}function getSelectedTags(_0x303ccb){var _0x2995a7=[];if(_0x303ccb){_0x2995a7=Array['isArray'](_0x303ccb)?_0x303ccb:[_0x303ccb];}return _0x2995a7;}function log(_0x56e2de,_0x59e4ef,_0x30d282,_0x212494,_0x150fbc,_0xfc4b85){loggers[_0x150fbc[_0x747f('0x11')]()][_0x56e2de](_0x747f('0x12'),_0xfc4b85[_0x747f('0x13')](),_0x59e4ef?_0x59e4ef['id']:null,_0x59e4ef?_0x59e4ef[_0x747f('0x14')]:null,_0x59e4ef?_0x59e4ef['role']:null,getInteractionId(_0x30d282,_0x212494,_0x150fbc),_0x30d282?JSON['stringify'](_0x30d282):_0x747f('0x15'));}function updateUser(_0x4ced8b,_0x1632e1,_0x5b909d,_0x4861af,_0x31a8bb){db[_['upperFirst'](_0x4861af)+'Interaction'][_0x747f('0x16')]({'where':{'id':getInteractionId(_0x1632e1,_0x5b909d,_0x4861af)}})['then'](function(_0xcccad){if(_0xcccad){return _0xcccad[_0x747f('0x17')]({'UserId':_0x4ced8b?_0x4ced8b['id']:null});}})[_0x747f('0x18')](function(_0x368e94){if(_0x368e94){log(_0x747f('0x19'),_0x4ced8b,_0x1632e1,_0x5b909d,_0x4861af,_0x31a8bb);}})[_0x747f('0x1a')](function(){log('error',_0x4ced8b,_0x1632e1,_0x5b909d,_0x4861af,_0x31a8bb);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index dbd53fb..87418b1 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 _0xa8cb=['%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use','License','findOne','then','status','catch','users','User','admin','user','crypto','util','composable-middleware','../../mysqldb','data1','license','split','format'];(function(_0x65d12e,_0x4b0a30){var _0x4274e0=function(_0x121624){while(--_0x121624){_0x65d12e['push'](_0x65d12e['shift']());}};_0x4274e0(++_0x4b0a30);}(_0xa8cb,0x124));var _0xba8c=function(_0x125ddb,_0x536425){_0x125ddb=_0x125ddb-0x0;var _0x32b9b2=_0xa8cb[_0x125ddb];return _0x32b9b2;};'use strict';var crypto=require(_0xba8c('0x0'));var util=require(_0xba8c('0x1'));var compose=require(_0xba8c('0x2'));var db=require(_0xba8c('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x489975,_0x25ac7d){if(_0x489975&&_0x25ac7d){if(_0x25ac7d[_0xba8c('0x4')]&&_0x25ac7d[_0xba8c('0x5')]){var _0x120503=_0x25ac7d[_0xba8c('0x4')];var _0x2a732c=_0x25ac7d[_0xba8c('0x5')];var _0x51adac=_0x120503[_0xba8c('0x6')]('-')[0x4];var _0x53132d=_0x120503[_0xba8c('0x6')]('-')[0x0];var _0x24655f=crypto['createDecipher']('aes-256-ctr',util[_0xba8c('0x7')](_0xba8c('0x8'),_0x51adac,_0x120503,_0x53132d));var _0x508210=_0x24655f[_0xba8c('0x9')](_0x2a732c,_0xba8c('0xa'),_0xba8c('0xb'));_0x508210+=_0x24655f[_0xba8c('0xc')](_0xba8c('0xb'));var _0x1bab74=JSON[_0xba8c('0xd')](_0x508210);return _0x1bab74[_0xba8c('0xe')](_0x489975)?_0x1bab74[_0x489975]:null;}}return null;}function isLimit(_0x45ad77,_0x579509,_0x1e2de6,_0x452dfa){var _0x371d08=_0x579509;return compose()[_0xba8c('0xf')](function(_0x25a5e1,_0xa7686c,_0x1b97d1){return db[_0xba8c('0x10')][_0xba8c('0x11')]({'where':{'id':0x1},'raw':!![]})[_0xba8c('0x12')](function(_0x5b3d4e){var _0x316ccd=getValueFromLicense(_0x45ad77,_0x5b3d4e);return _0x316ccd?_0x316ccd:_0x371d08;})[_0xba8c('0x12')](function(_0x26eaeb){_0x371d08=_0x26eaeb;return _0x1e2de6['count'](_0x452dfa);})[_0xba8c('0x12')](function(_0xe9f56a){if(_0xe9f56a>=_0x371d08){return _0xa7686c[_0xba8c('0x13')](0x193)['json']({'message':util[_0xba8c('0x7')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x45ad77)});}_0x1b97d1();})[_0xba8c('0x14')](function(_0x36fa26){_0x1b97d1(_0x36fa26);});});}function isUserLimit(){return isLimit(_0xba8c('0x15'),0x1,db[_0xba8c('0x16')],{'where':{'$or':[{'role':_0xba8c('0x17')},{'role':_0xba8c('0x18')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x8116=['admin','user','crypto','util','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','base64','utf8','parse','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users'];(function(_0x58d40b,_0x57c63d){var _0x5c0f6c=function(_0x52fa2a){while(--_0x52fa2a){_0x58d40b['push'](_0x58d40b['shift']());}};_0x5c0f6c(++_0x57c63d);}(_0x8116,0x115));var _0x6811=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8116[_0x321bb2];return _0x9c12ed;};'use strict';var crypto=require(_0x6811('0x0'));var util=require(_0x6811('0x1'));var compose=require('composable-middleware');var db=require(_0x6811('0x2'))['db'];var config=require(_0x6811('0x3'));function getValueFromLicense(_0x8e0192,_0x9736dd){if(_0x8e0192&&_0x9736dd){if(_0x9736dd[_0x6811('0x4')]&&_0x9736dd['license']){var _0x5cfb49=_0x9736dd[_0x6811('0x4')];var _0x42d847=_0x9736dd[_0x6811('0x5')];var _0x2595af=_0x5cfb49['split']('-')[0x4];var _0x2793fc=_0x5cfb49[_0x6811('0x6')]('-')[0x0];var _0x1b8b1a=crypto[_0x6811('0x7')](_0x6811('0x8'),util['format']('%s:%s:%s',_0x2595af,_0x5cfb49,_0x2793fc));var _0x1dfc9e=_0x1b8b1a['update'](_0x42d847,_0x6811('0x9'),'utf8');_0x1dfc9e+=_0x1b8b1a['final'](_0x6811('0xa'));var _0x35279d=JSON[_0x6811('0xb')](_0x1dfc9e);return _0x35279d[_0x6811('0xc')](_0x8e0192)?_0x35279d[_0x8e0192]:null;}}return null;}function isLimit(_0x20069a,_0x35b6cf,_0x461a64,_0x2f51f1){var _0x50d4f1=_0x35b6cf;return compose()[_0x6811('0xd')](function(_0x19d616,_0x327650,_0x7eea71){return db[_0x6811('0xe')][_0x6811('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x6811('0x10')](function(_0x126dbc){var _0x2e3093=getValueFromLicense(_0x20069a,_0x126dbc);return _0x2e3093?_0x2e3093:_0x50d4f1;})[_0x6811('0x10')](function(_0x379a07){_0x50d4f1=_0x379a07;return _0x461a64[_0x6811('0x11')](_0x2f51f1);})['then'](function(_0x305962){if(_0x305962>=_0x50d4f1){return _0x327650[_0x6811('0x12')](0x193)[_0x6811('0x13')]({'message':util['format'](_0x6811('0x14'),_0x20069a)});}_0x7eea71();})[_0x6811('0x15')](function(_0x1eb06f){_0x7eea71(_0x1eb06f);});});}function isUserLimit(){return isLimit(_0x6811('0x16'),0x1,db['User'],{'where':{'$or':[{'role':_0x6811('0x17')},{'role':_0x6811('0x18')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 34bc58d..405622b 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 _0xd59b=['lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','slice','forEach','shift','match','filter','indexOf','map','push','buildExpression','operator','$between','value','includes','$gt','add','days','format','YYYY-MM-DD','castTo','text','CAST(','\x20AS\x20','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','$eq','<>\x20?','$substring','$startsWith','$lt','>\x20?','$lte','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$endsWith','pop','utcOffset','hours','seconds'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd59b,0x11d));var _0xbd59=function(_0x53dd91,_0x289cd7){_0x53dd91=_0x53dd91-0x0;var _0xec4820=_0xd59b[_0x53dd91];return _0xec4820;};'use strict';var _=require(_0xbd59('0x0'));var moment=require(_0xbd59('0x1'));exports[_0xbd59('0x2')]=function(_0x958341){var _0x5b76e3={'conditions':[]};_0x5b76e3[_0xbd59('0x3')]=_[_0xbd59('0x4')](_0x958341,_0xbd59('0x5'))?'or':_0xbd59('0x6');var _0x3284ec=_0x958341[_0xbd59('0x7')](_0xbd59('0x8'),'')[_0xbd59('0x7')](_0xbd59('0x5'),'')[_0xbd59('0x9')]('||');for(var _0x59fbb8=0x0;_0x59fbb8<_0x3284ec[_0xbd59('0xa')];_0x59fbb8++){var _0x4ca070=_0x3284ec[_0x59fbb8][_0xbd59('0x9')](':=');var _0x3b6f9f=_0x4ca070[0x0];var _0x2458a7=_0x4ca070[_0xbd59('0xb')](0x1);_0x2458a7[_0xbd59('0xc')](function(_0x5bac23){var _0x17a7e4=_0x5bac23['split']('[')[_0xbd59('0xd')]();var _0x48f6c6=_0x5bac23[_0xbd59('0xe')](/\[(.*?)\]/g);_0x48f6c6[_0xbd59('0xc')](function(_0x5a93a5){var _0x457be8=_0x5a93a5[_0xbd59('0x9')]('[')[_0xbd59('0xf')](function(_0x5c0ba9){return _0x5c0ba9[_0xbd59('0x10')](']')>-0x1;})[_0xbd59('0x11')](function(_0x55786a){return _0x55786a['split'](']')[0x0];})[0x0];_0x5b76e3['conditions'][_0xbd59('0x12')]({'field':_0x3b6f9f,'operator':_0x17a7e4,'value':_0x457be8});});});}return _0x5b76e3;};exports[_0xbd59('0x13')]=function(_0xab4189,_0x43d78c,_0xe05d6d){var _0xabc439={};if(_0x43d78c==='DATE'){if(_0xe05d6d[_0xbd59('0x14')]==='$eq'){_0xe05d6d[_0xbd59('0x14')]=_0xbd59('0x15');_0xe05d6d[_0xbd59('0x16')]+=','+_0xe05d6d[_0xbd59('0x16')];}else if(_[_0xbd59('0x17')]([_0xbd59('0x18'),'$lte'],_0xe05d6d[_0xbd59('0x14')])){_0xe05d6d[_0xbd59('0x16')]=moment(_0xe05d6d[_0xbd59('0x16')])[_0xbd59('0x19')](0x1,_0xbd59('0x1a'))[_0xbd59('0x1b')](_0xbd59('0x1c'));}}if(_0xe05d6d['castTo']){_0x43d78c=_0xe05d6d[_0xbd59('0x1d')];_0xabc439[_0xbd59('0x1e')]=_0xbd59('0x1f')+_0xab4189+'.'+_0xe05d6d['field']+_0xbd59('0x20')+_0xe05d6d['castTo']+')\x20'+parseOperator(_0xe05d6d[_0xbd59('0x14')]);}else{_0xabc439[_0xbd59('0x1e')]=_0xab4189+'.'+_0xe05d6d[_0xbd59('0x21')]+'\x20'+parseOperator(_0xe05d6d[_0xbd59('0x14')]);}if(_['includes']([_0xbd59('0x22'),_0xbd59('0x23')],_0xe05d6d[_0xbd59('0x14')]))_0xabc439[_0xbd59('0x1e')]='('+_0xabc439[_0xbd59('0x1e')]+_0xbd59('0x24')+_0xab4189+'.'+_0xe05d6d[_0xbd59('0x21')]+_0xbd59('0x25');_0xabc439['value']=parseValue(_0x43d78c,_0xe05d6d[_0xbd59('0x14')],_0xe05d6d[_0xbd59('0x16')]);return _0xabc439;};function parseOperator(_0x1bd718){var _0x5e2b05;switch(_0x1bd718){case'$in':_0x5e2b05=_0xbd59('0x26');break;case _0xbd59('0x23'):_0x5e2b05=_0xbd59('0x27');break;case _0xbd59('0x28'):_0x5e2b05='=\x20?';break;case _0xbd59('0x22'):_0x5e2b05=_0xbd59('0x29');break;case _0xbd59('0x2a'):case _0xbd59('0x2b'):case'$endsWith':_0x5e2b05='LIKE\x20?';break;case _0xbd59('0x2c'):_0x5e2b05='<\x20?';break;case _0xbd59('0x18'):_0x5e2b05=_0xbd59('0x2d');break;case _0xbd59('0x2e'):_0x5e2b05=_0xbd59('0x2f');break;case _0xbd59('0x30'):_0x5e2b05=_0xbd59('0x31');break;case _0xbd59('0x15'):_0x5e2b05=_0xbd59('0x32');break;}return _0x5e2b05;}function parseValue(_0x1a9fc9,_0x1485a4,_0x1344ba){var _0x485d58={'start':undefined,'end':undefined};switch(_0x1485a4){case'$in':case _0xbd59('0x23'):_0x485d58['start']=_0x1344ba[_0xbd59('0x9')](',');break;case _0xbd59('0x2a'):_0x485d58[_0xbd59('0x33')]='%'+_0x1344ba+'%';break;case _0xbd59('0x2b'):_0x485d58['start']=_0x1344ba+'%';break;case _0xbd59('0x34'):_0x485d58[_0xbd59('0x33')]='%'+_0x1344ba;break;case _0xbd59('0x15'):var _0x387c70=_0x1344ba[_0xbd59('0x9')](',');var _0x1344ba=_0x387c70[_0xbd59('0xd')]();var _0x1e4460=_0x387c70[_0xbd59('0x35')]();if(_0x1a9fc9==='DATE'){_0x1344ba=moment(_0x1344ba)[_0xbd59('0x36')](0x0,!![])[_0xbd59('0x1b')]();_0x1e4460=moment(_0x1e4460)[_0xbd59('0x36')](0x0,!![])[_0xbd59('0x19')](0x17,_0xbd59('0x37'))['add'](0x3b,'minutes')[_0xbd59('0x19')](0x3b,_0xbd59('0x38'))[_0xbd59('0x1b')]();}_0x485d58={'start':_0x1344ba,'end':_0x1e4460};break;default:_0x485d58[_0xbd59('0x33')]=_0x1344ba;break;}return _0x485d58;} \ No newline at end of file +var _0x9f1d=['DATE','$eq','operator','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','field','\x20AS\x20','$ne','$notIn','$in','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','$lt','<\x20?','>\x20?','$gte','>=\x20?','start','pop','utcOffset','seconds','moment','parseSearch','sqlOperator','startsWith','and','replace','[$and]','split','length','forEach','shift','match','filter','map','conditions','buildExpression'];(function(_0x12a14c,_0x1d2f9e){var _0x4089ad=function(_0x4956e5){while(--_0x4956e5){_0x12a14c['push'](_0x12a14c['shift']());}};_0x4089ad(++_0x1d2f9e);}(_0x9f1d,0xea));var _0xd9f1=function(_0x4003dd,_0x126ec2){_0x4003dd=_0x4003dd-0x0;var _0x4e1335=_0x9f1d[_0x4003dd];return _0x4e1335;};'use strict';var _=require('lodash');var moment=require(_0xd9f1('0x0'));exports[_0xd9f1('0x1')]=function(_0x54be71){var _0x1c63d8={'conditions':[]};_0x1c63d8[_0xd9f1('0x2')]=_[_0xd9f1('0x3')](_0x54be71,'[$or]')?'or':_0xd9f1('0x4');var _0x49b579=_0x54be71[_0xd9f1('0x5')](_0xd9f1('0x6'),'')[_0xd9f1('0x5')]('[$or]','')[_0xd9f1('0x7')]('||');for(var _0x40e927=0x0;_0x40e927<_0x49b579[_0xd9f1('0x8')];_0x40e927++){var _0x93baf9=_0x49b579[_0x40e927]['split'](':=');var _0x419521=_0x93baf9[0x0];var _0x43704a=_0x93baf9['slice'](0x1);_0x43704a[_0xd9f1('0x9')](function(_0x584c40){var _0x2ebff0=_0x584c40[_0xd9f1('0x7')]('[')[_0xd9f1('0xa')]();var _0x40877b=_0x584c40[_0xd9f1('0xb')](/\[(.*?)\]/g);_0x40877b[_0xd9f1('0x9')](function(_0x3b5112){var _0x5e7fd5=_0x3b5112[_0xd9f1('0x7')]('[')[_0xd9f1('0xc')](function(_0x2c05af){return _0x2c05af['indexOf'](']')>-0x1;})[_0xd9f1('0xd')](function(_0x4f71d9){return _0x4f71d9[_0xd9f1('0x7')](']')[0x0];})[0x0];_0x1c63d8[_0xd9f1('0xe')]['push']({'field':_0x419521,'operator':_0x2ebff0,'value':_0x5e7fd5});});});}return _0x1c63d8;};exports[_0xd9f1('0xf')]=function(_0x33b44a,_0x178b24,_0x20339e){var _0x7fb7b1={};if(_0x178b24===_0xd9f1('0x10')){if(_0x20339e['operator']===_0xd9f1('0x11')){_0x20339e[_0xd9f1('0x12')]=_0xd9f1('0x13');_0x20339e[_0xd9f1('0x14')]+=','+_0x20339e['value'];}else if(_[_0xd9f1('0x15')]([_0xd9f1('0x16'),_0xd9f1('0x17')],_0x20339e[_0xd9f1('0x12')])){_0x20339e[_0xd9f1('0x14')]=moment(_0x20339e[_0xd9f1('0x14')])[_0xd9f1('0x18')](0x1,_0xd9f1('0x19'))[_0xd9f1('0x1a')](_0xd9f1('0x1b'));}}if(_0x20339e[_0xd9f1('0x1c')]){_0x178b24=_0x20339e[_0xd9f1('0x1c')];_0x7fb7b1[_0xd9f1('0x1d')]='CAST('+_0x33b44a+'.'+_0x20339e[_0xd9f1('0x1e')]+_0xd9f1('0x1f')+_0x20339e[_0xd9f1('0x1c')]+')\x20'+parseOperator(_0x20339e[_0xd9f1('0x12')]);}else{_0x7fb7b1[_0xd9f1('0x1d')]=_0x33b44a+'.'+_0x20339e['field']+'\x20'+parseOperator(_0x20339e[_0xd9f1('0x12')]);}if(_[_0xd9f1('0x15')]([_0xd9f1('0x20'),_0xd9f1('0x21')],_0x20339e[_0xd9f1('0x12')]))_0x7fb7b1[_0xd9f1('0x1d')]='('+_0x7fb7b1[_0xd9f1('0x1d')]+'\x20OR\x20'+_0x33b44a+'.'+_0x20339e['field']+'\x20IS\x20NULL)';_0x7fb7b1[_0xd9f1('0x14')]=parseValue(_0x178b24,_0x20339e['operator'],_0x20339e[_0xd9f1('0x14')]);return _0x7fb7b1;};function parseOperator(_0x22c9c3){var _0x2e47e2;switch(_0x22c9c3){case _0xd9f1('0x22'):_0x2e47e2='IN\x20?';break;case _0xd9f1('0x21'):_0x2e47e2=_0xd9f1('0x23');break;case _0xd9f1('0x11'):_0x2e47e2=_0xd9f1('0x24');break;case _0xd9f1('0x20'):_0x2e47e2=_0xd9f1('0x25');break;case _0xd9f1('0x26'):case _0xd9f1('0x27'):case _0xd9f1('0x28'):_0x2e47e2='LIKE\x20?';break;case _0xd9f1('0x29'):_0x2e47e2=_0xd9f1('0x2a');break;case _0xd9f1('0x16'):_0x2e47e2=_0xd9f1('0x2b');break;case _0xd9f1('0x17'):_0x2e47e2='<=\x20?';break;case _0xd9f1('0x2c'):_0x2e47e2=_0xd9f1('0x2d');break;case _0xd9f1('0x13'):_0x2e47e2='BETWEEN\x20?\x20AND\x20?';break;}return _0x2e47e2;}function parseValue(_0x487edf,_0x10769a,_0x2bbec3){var _0x1e5bd0={'start':undefined,'end':undefined};switch(_0x10769a){case'$in':case _0xd9f1('0x21'):_0x1e5bd0[_0xd9f1('0x2e')]=_0x2bbec3[_0xd9f1('0x7')](',');break;case _0xd9f1('0x26'):_0x1e5bd0[_0xd9f1('0x2e')]='%'+_0x2bbec3+'%';break;case'$startsWith':_0x1e5bd0['start']=_0x2bbec3+'%';break;case _0xd9f1('0x28'):_0x1e5bd0[_0xd9f1('0x2e')]='%'+_0x2bbec3;break;case _0xd9f1('0x13'):var _0x4b0259=_0x2bbec3[_0xd9f1('0x7')](',');var _0x2bbec3=_0x4b0259['shift']();var _0x25186f=_0x4b0259[_0xd9f1('0x2f')]();if(_0x487edf===_0xd9f1('0x10')){_0x2bbec3=moment(_0x2bbec3)[_0xd9f1('0x30')](0x0,!![])[_0xd9f1('0x1a')]();_0x25186f=moment(_0x25186f)[_0xd9f1('0x30')](0x0,!![])[_0xd9f1('0x18')](0x17,'hours')[_0xd9f1('0x18')](0x3b,'minutes')['add'](0x3b,_0xd9f1('0x31'))[_0xd9f1('0x1a')]();}_0x1e5bd0={'start':_0x2bbec3,'end':_0x25186f};break;default:_0x1e5bd0[_0xd9f1('0x2e')]=_0x2bbec3;break;}return _0x1e5bd0;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 275a261..c2677f4 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 _0x7dfd=['col','unsigned','length','omit','isObject','isString','unset','hasOwnProperty','isNumeric','getFullTextValue','replace','match','push','join','getOptions','query','$id','model','intersection','fields','attributes','offset','order','where','object','filter','VIRTUAL','lower','merge','options','lodash','sequelize','moment','parse','keys','includes','split','filters','isEmpty','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','sort','map','indexOf','priority','cast','substr','DESC'];(function(_0x431e8e,_0x482fd7){var _0x53396c=function(_0x4e0b93){while(--_0x4e0b93){_0x431e8e['push'](_0x431e8e['shift']());}};_0x53396c(++_0x482fd7);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd7df('0x0'));var sequelize=require(_0xd7df('0x1'));var moment=require(_0xd7df('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x2d48e6){var _0x346f5f=['ne'];try{var _0x28c3c9=JSON[_0xd7df('0x3')](_0x2d48e6);var _0x38eee7=Object[_0xd7df('0x4')](_0x28c3c9)[0x0];return _0x346f5f[_0xd7df('0x5')](_0x38eee7);}catch(_0x65a0b6){return![];}}function getOperatorValue(_0x3304f9){var _0x36cf0f=JSON[_0xd7df('0x3')](_0x3304f9);var _0x354ea7=Object[_0xd7df('0x4')](_0x36cf0f)[0x0];var _0x2c48a4=_0x36cf0f[_0x354ea7];return{['$'+_0x354ea7]:_0x2c48a4};}exports['fields']=function(_0xab6742){var _0xb3557a=null;if(_0xab6742){_0xb3557a=_0xab6742[_0xd7df('0x6')](',');}return _0xb3557a;};exports[_0xd7df('0x7')]=function(_0x5e59c3,_0x32c5b5){var _0x532c14={};if(!_[_0xd7df('0x8')](_0x5e59c3)){_['forOwn'](_0x5e59c3,function(_0x394d32,_0x82f1c0){try{if(_0x32c5b5){var _0x28d358=_[_0xd7df('0x9')](_0x32c5b5,{'name':_0x82f1c0})||{};if(hasSequelizeOperator(_0x394d32)){_0x532c14[_0x82f1c0]=getOperatorValue(_0x394d32);}else if(_0x28d358[_0xd7df('0xa')]===_0xd7df('0xb')&&_[_0xd7df('0xc')](_0x394d32)){var _0x3da618=JSON[_0xd7df('0x3')](_0x394d32);var _0x4d6f17={'$gte':moment(moment(_0x3da618[_0xd7df('0xd')])[_0xd7df('0xe')](_0xd7df('0xf')))[_0xd7df('0x10')]()[_0xd7df('0xe')](),'$lte':moment(moment(_0x3da618[_0xd7df('0x11')])[_0xd7df('0xe')]('YYYY-MM-DD'))[_0xd7df('0x10')]()[_0xd7df('0x12')](0x1,'s')['format']()};_0x532c14[_0x82f1c0]=_0x4d6f17;}else if(_0x28d358[_0xd7df('0x13')]===_0xd7df('0x14')){_0x532c14[_0x82f1c0]=_0x394d32;}else{_0x532c14[_0x82f1c0]=_['isArray'](_0x394d32)?_0x394d32:JSON[_0xd7df('0x3')](_0x394d32);}}else{_0x532c14[_0x82f1c0]=_[_0xd7df('0x15')](_0x394d32)?_0x394d32:JSON[_0xd7df('0x3')](_0x394d32);}}catch(_0x5210e5){_0x532c14[_0x82f1c0]=_0x394d32[_0xd7df('0x6')](',');}});}return _0x532c14;};exports[_0xd7df('0x16')]=function(_0x3cea3){_0x3cea3=parseInt(_0x3cea3,0xa);if(!_0x3cea3||_0x3cea3<0x0){_0x3cea3=LIMIT_VALUE;}return _0x3cea3;};exports['offset']=function(_0x96d86e){_0x96d86e=parseInt(_0x96d86e,0xa);if(!_0x96d86e||_0x96d86e<0x0){_0x96d86e=0x0;}return _0x96d86e;};exports[_0xd7df('0x17')]=function(_0x4e1985){var _0x5acb0a,_0x4188af=null;if(_0x4e1985){_0x5acb0a=_0x4e1985['split'](',');_0x4188af=_[_0xd7df('0x18')](_0x5acb0a,function(_0x5ab737){if(_0x5ab737[_0xd7df('0x19')]('-')===0x0){return[_0x5ab737===_0xd7df('0x1a')?sequelize[_0xd7df('0x1b')](sequelize['col'](_0xd7df('0x1a')),'unsigned'):_0x5ab737[_0xd7df('0x1c')](0x1),_0xd7df('0x1d')];}else{return[_0x5ab737===_0xd7df('0x1a')?sequelize[_0xd7df('0x1b')](sequelize[_0xd7df('0x1e')](_0xd7df('0x1a')),_0xd7df('0x1f')):_0x5ab737,'ASC'];}});}return _0x4188af;};exports['omit']=function(_0x36f2bd,_0x38db14){if(_[_0xd7df('0x8')](_0x36f2bd)){return _0x36f2bd;}if(_[_0xd7df('0x15')](_0x36f2bd)){for(var _0x13f190=0x0;_0x13f190<_0x36f2bd[_0xd7df('0x20')];_0x13f190+=0x1){_0x36f2bd[_0x13f190]=this[_0xd7df('0x21')](_0x36f2bd[_0x13f190],_0x38db14);}return _0x36f2bd;}if(!_[_0xd7df('0x22')](_0x36f2bd)){return _0x36f2bd;}if(_[_0xd7df('0x23')](_0x38db14)){_0x38db14=[_0x38db14];}if(!_['isArray'](_0x38db14)){return _0x36f2bd;}for(var _0xe53f53=0x0;_0xe53f53<_0x38db14[_0xd7df('0x20')];_0xe53f53+=0x1){_[_0xd7df('0x24')](_0x36f2bd,_0x38db14[_0xe53f53]);}for(var _0x29f0e8 in _0x36f2bd){if(_0x36f2bd[_0xd7df('0x25')](_0x29f0e8)){_0x36f2bd[_0x29f0e8]=this[_0xd7df('0x21')](_0x36f2bd[_0x29f0e8],_0x38db14);}}return _0x36f2bd;};exports[_0xd7df('0x26')]=function(_0x36de76){return _0x36de76['match'](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports['isEmail']=function(_0x58584d){return _0x58584d['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xd7df('0x27')]=function(_0x4e87cd){var _0xd366b=[];_0x4e87cd[_0xd7df('0x6')](/[ ,]+/)['forEach'](function(_0x3ef553){_0x3ef553=_0x3ef553[_0xd7df('0x28')](/([^:]")"+/g,'$1');_0x3ef553='+'+_0x3ef553+'*';var _0x4fe918=/[ `!@#$%^&*()_\-?~]/;if(_0x3ef553[_0xd7df('0x29')](_0x4fe918))_0x3ef553='\x22'+_0x3ef553+'\x22';_0xd366b[_0xd7df('0x2a')](_0x3ef553);});return _0xd366b[_0xd7df('0x2b')]('\x20');};exports[_0xd7df('0x2c')]=function(_0x40f965,_0x3304c4,_0x5a658f){var _0x428b4b={},_0x149813={};if(_0x3304c4[_0xd7df('0x2d')][_0xd7df('0x2e')]){_0x3304c4[_0xd7df('0x2d')]['id']=_0x3304c4[_0xd7df('0x2d')][_0xd7df('0x2e')];delete _0x3304c4[_0xd7df('0x2d')][_0xd7df('0x2e')];}_0x428b4b[_0xd7df('0x2f')]=_[_0xd7df('0x18')](_0x40f965,'name');_0x428b4b['query']=_[_0xd7df('0x4')](_0x3304c4['query']);_0x428b4b[_0xd7df('0x7')]=_[_0xd7df('0x30')](_0x428b4b[_0xd7df('0x2f')],_0x428b4b[_0xd7df('0x2d')]);_0x149813['attributes']=_['intersection'](_0x428b4b['model'],this[_0xd7df('0x31')](_0x3304c4[_0xd7df('0x2d')]['fields']));_0x149813[_0xd7df('0x32')]=_0x149813[_0xd7df('0x32')][_0xd7df('0x20')]?_0x149813[_0xd7df('0x32')]:_0x428b4b['model'];if(!_0x3304c4[_0xd7df('0x2d')][_0xd7df('0x25')]('nolimit')){_0x149813[_0xd7df('0x16')]=this['limit'](_0x3304c4[_0xd7df('0x2d')][_0xd7df('0x16')]);_0x149813[_0xd7df('0x33')]=this['offset'](_0x3304c4[_0xd7df('0x2d')][_0xd7df('0x33')]);}_0x149813[_0xd7df('0x34')]=this[_0xd7df('0x17')](_0x3304c4['query'][_0xd7df('0x17')]);_0x149813[_0xd7df('0x35')]=this[_0xd7df('0x7')](_['pick'](_0x3304c4[_0xd7df('0x2d')],_0x428b4b[_0xd7df('0x7')]),_0x40f965);if(_0x3304c4[_0xd7df('0x2d')]['filter']){var _0x80019d=_0x40f965;var _0x445467=_0x3304c4['query']['filter'];if(typeof _0x445467===_0xd7df('0x36')){_0x80019d=_[_0xd7df('0x37')](_0x40f965,function(_0x6a024a){return _['includes'](_0x445467['columns'],_0x6a024a[_0xd7df('0x13')]);});_0x445467=_0x445467['value'];}_0x149813[_0xd7df('0x35')]=_['merge'](_0x149813['where'],{'$or':_[_0xd7df('0x18')](_0x80019d,function(_0x579d0f){if(_0x579d0f[_0xd7df('0xa')]!==_0xd7df('0x38')){if(_0x5a658f){return sequelize[_0xd7df('0x35')](sequelize['fn'](_0xd7df('0x39'),sequelize[_0xd7df('0x1e')](_0x579d0f[_0xd7df('0x13')])),{'$like':sequelize['fn'](_0xd7df('0x39'),'%'+_0x3304c4[_0xd7df('0x2d')][_0xd7df('0x37')]+'%')});}else{var _0x5b3179={};_0x5b3179[_0x579d0f[_0xd7df('0x13')]]={'$like':'%'+_0x3304c4['query'][_0xd7df('0x37')]+'%'};return _0x5b3179;}}})});}_0x149813=_[_0xd7df('0x3a')]({},_0x149813,_0x3304c4[_0xd7df('0x3b')]);return _0x149813;}; \ No newline at end of file +var _0x0e85=['type','VIRTUAL','lower','options','lodash','sequelize','keys','parse','fields','split','isEmpty','forOwn','DATE','isPlainObject','$gte','format','YYYY-MM-DD','$lte','subtract','name','uniqueid','isArray','limit','offset','sort','map','indexOf','priority','col','substr','DESC','cast','omit','isObject','length','unset','hasOwnProperty','isNumeric','match','isEmail','getFullTextValue','replace','push','join','getOptions','query','$id','model','intersection','attributes','nolimit','order','where','filters','filter','object','includes','columns','value','merge'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x0e85,0x7c));var _0x50e8=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x0e85[_0x2faddb];return _0x273c05;};'use strict';var _=require(_0x50e8('0x0'));var sequelize=require(_0x50e8('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x11a13a){var _0x682d10=['ne'];try{var _0x55e515=JSON['parse'](_0x11a13a);var _0x4ce6cd=Object[_0x50e8('0x2')](_0x55e515)[0x0];return _0x682d10['includes'](_0x4ce6cd);}catch(_0x3048e3){return![];}}function getOperatorValue(_0x2401b2){var _0xe3151e=JSON[_0x50e8('0x3')](_0x2401b2);var _0x5e8b01=Object[_0x50e8('0x2')](_0xe3151e)[0x0];var _0x108edc=_0xe3151e[_0x5e8b01];return{['$'+_0x5e8b01]:_0x108edc};}exports[_0x50e8('0x4')]=function(_0x988da0){var _0x1fafb0=null;if(_0x988da0){_0x1fafb0=_0x988da0[_0x50e8('0x5')](',');}return _0x1fafb0;};exports['filters']=function(_0x11717c,_0x228ed1){var _0x19d1bc={};if(!_[_0x50e8('0x6')](_0x11717c)){_[_0x50e8('0x7')](_0x11717c,function(_0x194a89,_0x45dc6f){try{if(_0x228ed1){var _0x3d25ea=_['find'](_0x228ed1,{'name':_0x45dc6f})||{};if(hasSequelizeOperator(_0x194a89)){_0x19d1bc[_0x45dc6f]=getOperatorValue(_0x194a89);}else if(_0x3d25ea['type']===_0x50e8('0x8')&&_[_0x50e8('0x9')](_0x194a89)){var _0x508377=JSON['parse'](_0x194a89);var _0x3cb45c={'$gte':moment(moment(_0x508377[_0x50e8('0xa')])[_0x50e8('0xb')](_0x50e8('0xc')))['utc']()[_0x50e8('0xb')](),'$lte':moment(moment(_0x508377[_0x50e8('0xd')])[_0x50e8('0xb')]('YYYY-MM-DD'))['utc']()[_0x50e8('0xe')](0x1,'s')[_0x50e8('0xb')]()};_0x19d1bc[_0x45dc6f]=_0x3cb45c;}else if(_0x3d25ea[_0x50e8('0xf')]===_0x50e8('0x10')){_0x19d1bc[_0x45dc6f]=_0x194a89;}else{_0x19d1bc[_0x45dc6f]=_[_0x50e8('0x11')](_0x194a89)?_0x194a89:JSON[_0x50e8('0x3')](_0x194a89);}}else{_0x19d1bc[_0x45dc6f]=_['isArray'](_0x194a89)?_0x194a89:JSON['parse'](_0x194a89);}}catch(_0x441f25){_0x19d1bc[_0x45dc6f]=_0x194a89[_0x50e8('0x5')](',');}});}return _0x19d1bc;};exports[_0x50e8('0x12')]=function(_0x45ce11){_0x45ce11=parseInt(_0x45ce11,0xa);if(!_0x45ce11||_0x45ce11<0x0){_0x45ce11=LIMIT_VALUE;}return _0x45ce11;};exports[_0x50e8('0x13')]=function(_0x90c54c){_0x90c54c=parseInt(_0x90c54c,0xa);if(!_0x90c54c||_0x90c54c<0x0){_0x90c54c=0x0;}return _0x90c54c;};exports[_0x50e8('0x14')]=function(_0x53e0a1){var _0x415596,_0x55997c=null;if(_0x53e0a1){_0x415596=_0x53e0a1[_0x50e8('0x5')](',');_0x55997c=_[_0x50e8('0x15')](_0x415596,function(_0xd263d){if(_0xd263d[_0x50e8('0x16')]('-')===0x0){return[_0xd263d===_0x50e8('0x17')?sequelize['cast'](sequelize[_0x50e8('0x18')](_0x50e8('0x17')),'unsigned'):_0xd263d[_0x50e8('0x19')](0x1),_0x50e8('0x1a')];}else{return[_0xd263d==='priority'?sequelize[_0x50e8('0x1b')](sequelize[_0x50e8('0x18')]('priority'),'unsigned'):_0xd263d,'ASC'];}});}return _0x55997c;};exports[_0x50e8('0x1c')]=function(_0x160372,_0x124402){if(_[_0x50e8('0x6')](_0x160372)){return _0x160372;}if(_[_0x50e8('0x11')](_0x160372)){for(var _0x13b6e9=0x0;_0x13b6e9<_0x160372['length'];_0x13b6e9+=0x1){_0x160372[_0x13b6e9]=this[_0x50e8('0x1c')](_0x160372[_0x13b6e9],_0x124402);}return _0x160372;}if(!_[_0x50e8('0x1d')](_0x160372)){return _0x160372;}if(_['isString'](_0x124402)){_0x124402=[_0x124402];}if(!_[_0x50e8('0x11')](_0x124402)){return _0x160372;}for(var _0x2bc8d8=0x0;_0x2bc8d8<_0x124402[_0x50e8('0x1e')];_0x2bc8d8+=0x1){_[_0x50e8('0x1f')](_0x160372,_0x124402[_0x2bc8d8]);}for(var _0x4fbf41 in _0x160372){if(_0x160372[_0x50e8('0x20')](_0x4fbf41)){_0x160372[_0x4fbf41]=this['omit'](_0x160372[_0x4fbf41],_0x124402);}}return _0x160372;};exports[_0x50e8('0x21')]=function(_0x39c0c6){return _0x39c0c6[_0x50e8('0x22')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0x50e8('0x23')]=function(_0x126c99){return _0x126c99[_0x50e8('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0x50e8('0x24')]=function(_0x1d77d0){var _0x18aa31=[];_0x1d77d0[_0x50e8('0x5')](/[ ,]+/)['forEach'](function(_0x290fd2){_0x290fd2=_0x290fd2[_0x50e8('0x25')](/([^:]")"+/g,'$1');_0x290fd2='+'+_0x290fd2+'*';var _0x535c24=/[ `!@#$%^&*()_\-?~]/;if(_0x290fd2['match'](_0x535c24))_0x290fd2='\x22'+_0x290fd2+'\x22';_0x18aa31[_0x50e8('0x26')](_0x290fd2);});return _0x18aa31[_0x50e8('0x27')]('\x20');};exports[_0x50e8('0x28')]=function(_0x47ace2,_0x594187,_0x3e58a9){var _0x19e3cc={},_0x5c2e04={};if(_0x594187[_0x50e8('0x29')][_0x50e8('0x2a')]){_0x594187[_0x50e8('0x29')]['id']=_0x594187[_0x50e8('0x29')]['$id'];delete _0x594187[_0x50e8('0x29')]['$id'];}_0x19e3cc[_0x50e8('0x2b')]=_[_0x50e8('0x15')](_0x47ace2,_0x50e8('0xf'));_0x19e3cc['query']=_[_0x50e8('0x2')](_0x594187[_0x50e8('0x29')]);_0x19e3cc['filters']=_[_0x50e8('0x2c')](_0x19e3cc[_0x50e8('0x2b')],_0x19e3cc[_0x50e8('0x29')]);_0x5c2e04[_0x50e8('0x2d')]=_['intersection'](_0x19e3cc[_0x50e8('0x2b')],this[_0x50e8('0x4')](_0x594187[_0x50e8('0x29')][_0x50e8('0x4')]));_0x5c2e04['attributes']=_0x5c2e04[_0x50e8('0x2d')][_0x50e8('0x1e')]?_0x5c2e04[_0x50e8('0x2d')]:_0x19e3cc['model'];if(!_0x594187['query']['hasOwnProperty'](_0x50e8('0x2e'))){_0x5c2e04[_0x50e8('0x12')]=this[_0x50e8('0x12')](_0x594187[_0x50e8('0x29')][_0x50e8('0x12')]);_0x5c2e04[_0x50e8('0x13')]=this[_0x50e8('0x13')](_0x594187[_0x50e8('0x29')][_0x50e8('0x13')]);}_0x5c2e04[_0x50e8('0x2f')]=this['sort'](_0x594187[_0x50e8('0x29')][_0x50e8('0x14')]);_0x5c2e04[_0x50e8('0x30')]=this[_0x50e8('0x31')](_['pick'](_0x594187[_0x50e8('0x29')],_0x19e3cc[_0x50e8('0x31')]),_0x47ace2);if(_0x594187[_0x50e8('0x29')][_0x50e8('0x32')]){var _0x8e8a97=_0x47ace2;var _0x5c7bef=_0x594187['query'][_0x50e8('0x32')];if(typeof _0x5c7bef===_0x50e8('0x33')){_0x8e8a97=_['filter'](_0x47ace2,function(_0x2ebd77){return _[_0x50e8('0x34')](_0x5c7bef[_0x50e8('0x35')],_0x2ebd77[_0x50e8('0xf')]);});_0x5c7bef=_0x5c7bef[_0x50e8('0x36')];}_0x5c2e04[_0x50e8('0x30')]=_[_0x50e8('0x37')](_0x5c2e04[_0x50e8('0x30')],{'$or':_['map'](_0x8e8a97,function(_0x3d26bd){if(_0x3d26bd[_0x50e8('0x38')]!==_0x50e8('0x39')){if(_0x3e58a9){return sequelize[_0x50e8('0x30')](sequelize['fn']('lower',sequelize[_0x50e8('0x18')](_0x3d26bd[_0x50e8('0xf')])),{'$like':sequelize['fn'](_0x50e8('0x3a'),'%'+_0x594187[_0x50e8('0x29')]['filter']+'%')});}else{var _0x21dfbf={};_0x21dfbf[_0x3d26bd['name']]={'$like':'%'+_0x594187['query']['filter']+'%'};return _0x21dfbf;}}})});}_0x5c2e04=_[_0x50e8('0x37')]({},_0x5c2e04,_0x594187[_0x50e8('0x3b')]);return _0x5c2e04;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index c5d5781..a2d9447 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 _0x63b3=['substring','indexOf','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','online','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','mailStatus','smsStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','routealias','omit','pick','lodash','jayson/promise','../../mysqldb','http','client','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','pause','chatStatus','faxStatus','whatsappStatus','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','getRealtimeAgents','*pause','busy','getAgentStatus','isArray','startCase','getAgents','all','map','uniq','value','getAgentIdsByQueues','filter','getAgentIdsByStatus','resolve','User','findAll','name','fullname','pauseType','globalStatus','catch','getSortedAgentsIdsByStatus','split','fields','includes','startsWith','DESC','ASC','internal'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x63b3,0x13b));var _0x363b=function(_0x4fe24e,_0x45014e){_0x4fe24e=_0x4fe24e-0x0;var _0x5489f0=_0x63b3[_0x4fe24e];return _0x5489f0;};'use strict';var _=require(_0x363b('0x0'));var jayson=require(_0x363b('0x1'));var db=require(_0x363b('0x2'))['db'];var amiClient=jayson['client'][_0x363b('0x3')]({'port':0x232a});var routingClient=jayson[_0x363b('0x4')][_0x363b('0x3')]({'port':0x232c});function isAgentPaused(_0x4d349c,_0x19ec31){var _0x441d6e=[_0x4d349c[_0x363b('0x5')],_0x4d349c[_0x363b('0x6')],_0x4d349c[_0x363b('0x7')],_0x4d349c[_0x363b('0x8')],_0x4d349c[_0x363b('0x9')],_0x4d349c[_0x363b('0xa')],_0x4d349c[_0x363b('0xb')]];if(!_0x19ec31)return _[_0x363b('0xc')](_0x441d6e);var _0x18d3e3=_['filter'](_0x441d6e);return _0x18d3e3[_0x363b('0xd')]>0x0&&_0x18d3e3[_0x363b('0xd')]<_0x441d6e[_0x363b('0xd')]?!![]:![];}function isIdle(_0x1a179d){return _0x1a179d===_0x363b('0xe')||_0x1a179d===_0x363b('0xf')||_0x1a179d===_0x363b('0x10')||_0x1a179d===_0x363b('0x11')||_[_0x363b('0x12')](_0x1a179d);}function isAgentIdle(_0x4a2512){if(_0x4a2512[_0x363b('0x13')]!==_0x363b('0xe')&&_0x4a2512[_0x363b('0xa')]){_0x4a2512[_0x363b('0x13')]=_0x363b('0x14');return![];}return _[_0x363b('0xc')]([_0x4a2512[_0x363b('0x15')],_0x4a2512[_0x363b('0x16')],_0x4a2512['mailStatus'],_0x4a2512['openchannelStatus'],_0x4a2512['smsStatus'],_0x4a2512[_0x363b('0x13')],_0x4a2512[_0x363b('0x17')]],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0x363b('0x18'),{})[_0x363b('0x19')](function(_0x3893fa){if(_0x3893fa[_0x363b('0x1a')]){throw new Error(_0x363b('0x1b'));}var _0x3954f4=_0x3893fa['result'];return routingClient[_0x363b('0x1c')]('Agents',{})[_0x363b('0x19')](function(_0x31ef79){if(_0x31ef79['error']){throw new Error(_0x363b('0x1d'));}var _0x50a189=_0x31ef79['result'];return _[_0x363b('0x1e')]({},_0x3954f4,_0x50a189);});})['catch'](function(_0x4ceb7f){throw _0x4ceb7f;});}exports[_0x363b('0x1f')]=getRealtimeAgents;function getAgentStatus(_0x1c647e){var _0x2dfb12=_0x363b('0xf');if(isAgentPaused(_0x1c647e))_0x2dfb12='pause';else if(isAgentPaused(_0x1c647e,!![]))_0x2dfb12=_0x363b('0x20');else if(isAgentIdle(_0x1c647e))_0x2dfb12='idle';else _0x2dfb12=_0x363b('0x21');return _0x2dfb12;}exports[_0x363b('0x22')]=getAgentStatus;function getAgentIdsByQueues(_0xe36b3a,_0x3e58d7){var _0xcea690=_[_0x363b('0x23')](_0xe36b3a)?_0xe36b3a:[_0xe36b3a];var _0x1d2ab1=_[_0x363b('0x24')](_0x3e58d7)+'Queue';var _0x29f2fd=_['map'](_0xcea690,function(_0x27887a){return db[_0x1d2ab1]['findOne']({'where':{'id':_0x27887a}})['then'](function(_0x2b76c9){if(!_0x2b76c9)return[];return _0x2b76c9[_0x363b('0x25')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x363b('0x26')](_0x29f2fd)['then'](function(_0x5a1db5){var _0x257a2e=_(_0x5a1db5)['flatten']()[_0x363b('0x27')]('id')[_0x363b('0x28')]()[_0x363b('0x29')]();return _0x257a2e;});}exports[_0x363b('0x2a')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x340a65,_0x107e54,_0x5980ba){try{if(_0x107e54[_0x363b('0xd')]>0x0){_0x340a65=_0x340a65[_0x363b('0x2b')](function(_0x328853){return _0x107e54['includes'](_0x328853['id']);});}var _0xd80e01=_0x340a65[_0x363b('0x2b')](function(_0x8f08){var _0x2412a0=_0x363b('0x21');if(isAgentIdle(_0x8f08)){_0x2412a0=_0x363b('0xe');}return _0x2412a0===_0x5980ba;});return _[_0x363b('0x27')](_0xd80e01,'id');}catch(_0x5dd395){throw _0x5dd395;}}exports[_0x363b('0x2c')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x1a6563,_0xed8844,_0x3ffc8b){return Promise[_0x363b('0x2d')]()[_0x363b('0x19')](function(){if(_0xed8844[_0x363b('0xd')]>0x0){_0x1a6563=_0x1a6563['filter'](function(_0xf1c87e){return _0xed8844['includes'](_0xf1c87e['id']);});}return _0x1a6563;})[_0x363b('0x19')](function(){return db[_0x363b('0x2e')][_0x363b('0x2f')]({'attributes':['id',_0x363b('0x30'),_0x363b('0x31'),_0x363b('0x5'),_0x363b('0x6'),_0x363b('0x7'),_0x363b('0x8'),_0x363b('0x9'),_0x363b('0xa'),_0x363b('0xb'),_0x363b('0x32')],'where':{'id':{'$in':_[_0x363b('0x27')](_0x1a6563,'id')}},'raw':!![]});})[_0x363b('0x19')](function(_0xe80be4){return _0xe80be4[_0x363b('0x27')](function(_0x4978ce){var _0x356956=_['find'](_0x1a6563,['id',_0x4978ce['id']]);var _0x57932e=filterAgentAttributes(_0x356956);_['merge'](_0x4978ce,_0x57932e);_0x4978ce[_0x363b('0x33')]=getAgentStatus(_0x4978ce);return _0x4978ce;});})[_0x363b('0x19')](function(_0x5440d6){var _0x18280a=sortAgentsByStatus(_0x5440d6,_0x3ffc8b);return _['map'](_0x18280a,'id');})[_0x363b('0x34')](function(_0x2732b1){throw _0x2732b1;});}exports[_0x363b('0x35')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x449b68){var _0x4c06f0={'fields':[],'order':null};var _0x3892b4=_0x449b68[_0x363b('0x36')](',');_0x4c06f0[_0x363b('0x37')]=_[_0x363b('0x2b')](_0x3892b4,function(_0x4c21b6){if(!_0x4c21b6[_0x363b('0x38')](_0x363b('0x33'))){return!![];}_0x4c06f0['order']=_[_0x363b('0x39')](_0x4c21b6,'-')?_0x363b('0x3a'):_0x363b('0x3b');return![];});return _0x4c06f0;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x290aa8){if(_0x290aa8['includes'](_0x363b('0x31'))&&!_0x290aa8[_0x363b('0x38')](_0x363b('0x3c'))){var _0xec9c0d=_0x290aa8[_0x363b('0x3d')](0x0,_0x290aa8[_0x363b('0x3e')]('fullname'));_0x290aa8+=','+_0xec9c0d+'internal';}return _0x290aa8;}exports[_0x363b('0x3f')]=validateSortParameter;function sortAgentsByStatus(_0x45951c,_0x3b9df2){var _0x18a464=_0x45951c[_0x363b('0x40')](function(_0x30fee5,_0x17a606){if(_0x30fee5[_0x363b('0x33')]===_0x17a606[_0x363b('0x33')]){if(_0x30fee5[_0x363b('0x33')]===_0x363b('0x14')){if(_0x3b9df2==='DESC'){return(_0x30fee5[_0x363b('0x32')]||'')<(_0x17a606[_0x363b('0x32')]||'')||_0x30fee5[_0x363b('0x31')][_0x363b('0x41')]()>_0x17a606[_0x363b('0x31')][_0x363b('0x41')]()?0x1:-0x1;}else{return(_0x30fee5[_0x363b('0x32')]||'')<(_0x17a606[_0x363b('0x32')]||'')||_0x30fee5[_0x363b('0x31')][_0x363b('0x41')]()>_0x17a606[_0x363b('0x31')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x3b9df2===_0x363b('0x3a')){return _0x30fee5[_0x363b('0x31')]['toLowerCase']()<_0x17a606[_0x363b('0x31')][_0x363b('0x41')]()?0x1:-0x1;}else{return _0x30fee5[_0x363b('0x31')][_0x363b('0x41')]()<_0x17a606['fullname'][_0x363b('0x41')]()?-0x1:0x1;}}}else{if(_0x3b9df2===_0x363b('0x3a')){return _0x30fee5[_0x363b('0x33')]<_0x17a606['globalStatus']?0x1:-0x1;}else{return _0x30fee5[_0x363b('0x33')]<_0x17a606[_0x363b('0x33')]?-0x1:0x1;}}});return _0x18a464;}exports[_0x363b('0x42')]=sortAgentsByStatus;function filterAgentAttributes(_0x3f47da){var _0x49c715=['userpic',_0x363b('0x43'),_0x363b('0x44'),_0x363b('0x45'),_0x363b('0x32'),'lastPauseAt',_0x363b('0x3c'),_0x363b('0x46'),_0x363b('0x5'),'openchannelPause','mailPause','smsPause',_0x363b('0xb'),'faxPause','voicePause',_0x363b('0x47'),_0x363b('0x48'),_0x363b('0x49'),_0x363b('0x4a'),_0x363b('0x4b'),_0x363b('0x4c'),_0x363b('0x4d'),'openchannelCurrentCapacity',_0x363b('0x4e'),_0x363b('0x4f'),'whatsappCurrentCapacity',_0x363b('0x50'),_0x363b('0x15'),'openchannelStatus',_0x363b('0x51'),_0x363b('0x52'),_0x363b('0x17'),_0x363b('0x16'),_0x363b('0x13'),_0x363b('0x53'),_0x363b('0x54'),_0x363b('0x55'),_0x363b('0x56'),'whatsappStatusTime',_0x363b('0x57'),_0x363b('0x58'),_0x363b('0x59'),_0x363b('0x5a'),'screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording',_0x363b('0x5b')];var _0x4d556b=[_0x363b('0x5'),_0x363b('0x8'),_0x363b('0x7'),_0x363b('0x9'),_0x363b('0xb'),'faxPause',_0x363b('0xa'),'online'];var _0xe09372=_(_0x3f47da)[_0x363b('0x5c')](_0x4d556b)[_0x363b('0x5d')](_0x49c715)[_0x363b('0x29')]();return _0xe09372;}exports['filterAgentAttributes']=filterAgentAttributes; \ No newline at end of file +var _0x2172=['map','findOne','all','uniq','filter','includes','getAgentIdsByStatus','resolve','User','findAll','name','chatPause','mailPause','pauseType','find','globalStatus','getSortedAgentsIdsByStatus','order','startsWith','DESC','ASC','getUpdatedSortOptions','fullname','substring','indexOf','internal','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic','lastLoginAt','lastPauseAt','chatCapacity','openchannelCapacity','mailCapacity','whatsappCapacity','faxCapacity','openchannelCurrentCapacity','whatsappCurrentCapacity','openchannelStatusTime','whatsappStatusTime','faxStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','online','omit','value','filterAgentAttributes','lodash','../../mysqldb','client','http','faxPause','openchannelPause','smsPause','voicePause','whatsappPause','every','length','unknown','unavailable','ringing','voiceStatus','idle','chatStatus','faxStatus','mailStatus','openchannelStatus','whatsappStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','merge','catch','getRealtimeAgents','pause','*pause','busy','getAgentStatus','isArray','Queue'];(function(_0x3e83f1,_0x1b09ae){var _0x28cd96=function(_0x2ffc3e){while(--_0x2ffc3e){_0x3e83f1['push'](_0x3e83f1['shift']());}};_0x28cd96(++_0x1b09ae);}(_0x2172,0x198));var _0x2217=function(_0x3f3dd7,_0xc3bb97){_0x3f3dd7=_0x3f3dd7-0x0;var _0x368819=_0x2172[_0x3f3dd7];return _0x368819;};'use strict';var _=require(_0x2217('0x0'));var jayson=require('jayson/promise');var db=require(_0x2217('0x1'))['db'];var amiClient=jayson[_0x2217('0x2')][_0x2217('0x3')]({'port':0x232a});var routingClient=jayson[_0x2217('0x2')][_0x2217('0x3')]({'port':0x232c});function isAgentPaused(_0x24b6fb,_0x1d898d){var _0x5a56ed=[_0x24b6fb['chatPause'],_0x24b6fb[_0x2217('0x4')],_0x24b6fb['mailPause'],_0x24b6fb[_0x2217('0x5')],_0x24b6fb[_0x2217('0x6')],_0x24b6fb[_0x2217('0x7')],_0x24b6fb[_0x2217('0x8')]];if(!_0x1d898d)return _[_0x2217('0x9')](_0x5a56ed);var _0x5550af=_['filter'](_0x5a56ed);return _0x5550af['length']>0x0&&_0x5550af[_0x2217('0xa')]<_0x5a56ed['length']?!![]:![];}function isIdle(_0x1e9cfd){return _0x1e9cfd==='idle'||_0x1e9cfd===_0x2217('0xb')||_0x1e9cfd===_0x2217('0xc')||_0x1e9cfd===_0x2217('0xd')||_['isNil'](_0x1e9cfd);}function isAgentIdle(_0x42a516){if(_0x42a516[_0x2217('0xe')]!==_0x2217('0xf')&&_0x42a516[_0x2217('0x7')]){_0x42a516[_0x2217('0xe')]='pause';return![];}return _[_0x2217('0x9')]([_0x42a516[_0x2217('0x10')],_0x42a516[_0x2217('0x11')],_0x42a516[_0x2217('0x12')],_0x42a516[_0x2217('0x13')],_0x42a516['smsStatus'],_0x42a516[_0x2217('0xe')],_0x42a516[_0x2217('0x14')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x2217('0x15')](_0x2217('0x16'),{})[_0x2217('0x17')](function(_0x47d081){if(_0x47d081[_0x2217('0x18')]){throw new Error(_0x2217('0x19'));}var _0x3dd668=_0x47d081['result'];return routingClient[_0x2217('0x15')](_0x2217('0x16'),{})['then'](function(_0x4a979f){if(_0x4a979f[_0x2217('0x18')]){throw new Error(_0x2217('0x1a'));}var _0x4bd5ed=_0x4a979f[_0x2217('0x1b')];return _[_0x2217('0x1c')]({},_0x3dd668,_0x4bd5ed);});})[_0x2217('0x1d')](function(_0x5083e5){throw _0x5083e5;});}exports[_0x2217('0x1e')]=getRealtimeAgents;function getAgentStatus(_0x3a3ec0){var _0x2e4186=_0x2217('0xb');if(isAgentPaused(_0x3a3ec0))_0x2e4186=_0x2217('0x1f');else if(isAgentPaused(_0x3a3ec0,!![]))_0x2e4186=_0x2217('0x20');else if(isAgentIdle(_0x3a3ec0))_0x2e4186=_0x2217('0xf');else _0x2e4186=_0x2217('0x21');return _0x2e4186;}exports[_0x2217('0x22')]=getAgentStatus;function getAgentIdsByQueues(_0xe55555,_0x55acb2){var _0x20298d=_[_0x2217('0x23')](_0xe55555)?_0xe55555:[_0xe55555];var _0x31e510=_['startCase'](_0x55acb2)+_0x2217('0x24');var _0x31d7cb=_[_0x2217('0x25')](_0x20298d,function(_0x4b14bd){return db[_0x31e510][_0x2217('0x26')]({'where':{'id':_0x4b14bd}})['then'](function(_0x3669b1){if(!_0x3669b1)return[];return _0x3669b1['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0x2217('0x27')](_0x31d7cb)[_0x2217('0x17')](function(_0x5de508){var _0x2a90ee=_(_0x5de508)['flatten']()[_0x2217('0x25')]('id')[_0x2217('0x28')]()['value']();return _0x2a90ee;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x3d68f5,_0x3ea1b6,_0x43a763){try{if(_0x3ea1b6[_0x2217('0xa')]>0x0){_0x3d68f5=_0x3d68f5[_0x2217('0x29')](function(_0x1a99e8){return _0x3ea1b6[_0x2217('0x2a')](_0x1a99e8['id']);});}var _0x5233f5=_0x3d68f5['filter'](function(_0x45f59d){var _0x4ed4e6='busy';if(isAgentIdle(_0x45f59d)){_0x4ed4e6=_0x2217('0xf');}return _0x4ed4e6===_0x43a763;});return _[_0x2217('0x25')](_0x5233f5,'id');}catch(_0x439265){throw _0x439265;}}exports[_0x2217('0x2b')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x2f3cf5,_0x24c6e0,_0x383ab5){return Promise[_0x2217('0x2c')]()[_0x2217('0x17')](function(){if(_0x24c6e0['length']>0x0){_0x2f3cf5=_0x2f3cf5[_0x2217('0x29')](function(_0x42ea80){return _0x24c6e0['includes'](_0x42ea80['id']);});}return _0x2f3cf5;})[_0x2217('0x17')](function(){return db[_0x2217('0x2d')][_0x2217('0x2e')]({'attributes':['id',_0x2217('0x2f'),'fullname',_0x2217('0x30'),_0x2217('0x4'),_0x2217('0x31'),_0x2217('0x5'),_0x2217('0x6'),_0x2217('0x7'),'whatsappPause',_0x2217('0x32')],'where':{'id':{'$in':_[_0x2217('0x25')](_0x2f3cf5,'id')}},'raw':!![]});})[_0x2217('0x17')](function(_0x5c3258){return _0x5c3258[_0x2217('0x25')](function(_0x36df06){var _0x5b5403=_[_0x2217('0x33')](_0x2f3cf5,['id',_0x36df06['id']]);var _0x3b287f=filterAgentAttributes(_0x5b5403);_[_0x2217('0x1c')](_0x36df06,_0x3b287f);_0x36df06[_0x2217('0x34')]=getAgentStatus(_0x36df06);return _0x36df06;});})['then'](function(_0x2fbc8e){var _0x3bd611=sortAgentsByStatus(_0x2fbc8e,_0x383ab5);return _[_0x2217('0x25')](_0x3bd611,'id');})[_0x2217('0x1d')](function(_0x122660){throw _0x122660;});}exports[_0x2217('0x35')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x31f85e){var _0x14b10b={'fields':[],'order':null};var _0x2bafe9=_0x31f85e['split'](',');_0x14b10b['fields']=_[_0x2217('0x29')](_0x2bafe9,function(_0xa0d12e){if(!_0xa0d12e['includes']('globalStatus')){return!![];}_0x14b10b[_0x2217('0x36')]=_[_0x2217('0x37')](_0xa0d12e,'-')?_0x2217('0x38'):_0x2217('0x39');return![];});return _0x14b10b;}exports[_0x2217('0x3a')]=getUpdatedSortOptions;function validateSortParameter(_0x16ff52){if(_0x16ff52['includes'](_0x2217('0x3b'))&&!_0x16ff52['includes']('internal')){var _0x5abb99=_0x16ff52[_0x2217('0x3c')](0x0,_0x16ff52[_0x2217('0x3d')](_0x2217('0x3b')));_0x16ff52+=','+_0x5abb99+_0x2217('0x3e');}return _0x16ff52;}exports[_0x2217('0x3f')]=validateSortParameter;function sortAgentsByStatus(_0x3c6e2d,_0x55694b){var _0x6533ef=_0x3c6e2d[_0x2217('0x40')](function(_0x44c120,_0x4cd9dd){if(_0x44c120[_0x2217('0x34')]===_0x4cd9dd[_0x2217('0x34')]){if(_0x44c120['globalStatus']===_0x2217('0x1f')){if(_0x55694b===_0x2217('0x38')){return(_0x44c120[_0x2217('0x32')]||'')<(_0x4cd9dd['pauseType']||'')||_0x44c120['fullname'][_0x2217('0x41')]()>_0x4cd9dd[_0x2217('0x3b')][_0x2217('0x41')]()?0x1:-0x1;}else{return(_0x44c120['pauseType']||'')<(_0x4cd9dd[_0x2217('0x32')]||'')||_0x44c120[_0x2217('0x3b')][_0x2217('0x41')]()>_0x4cd9dd[_0x2217('0x3b')][_0x2217('0x41')]()?-0x1:0x1;}}else{if(_0x55694b===_0x2217('0x38')){return _0x44c120[_0x2217('0x3b')][_0x2217('0x41')]()<_0x4cd9dd[_0x2217('0x3b')][_0x2217('0x41')]()?0x1:-0x1;}else{return _0x44c120[_0x2217('0x3b')][_0x2217('0x41')]()<_0x4cd9dd[_0x2217('0x3b')][_0x2217('0x41')]()?-0x1:0x1;}}}else{if(_0x55694b===_0x2217('0x38')){return _0x44c120[_0x2217('0x34')]<_0x4cd9dd['globalStatus']?0x1:-0x1;}else{return _0x44c120['globalStatus']<_0x4cd9dd[_0x2217('0x34')]?-0x1:0x1;}}});return _0x6533ef;}exports[_0x2217('0x42')]=sortAgentsByStatus;function filterAgentAttributes(_0x5e5d5a){var _0x2b7d1c=[_0x2217('0x43'),'online',_0x2217('0x44'),_0x2217('0x45'),_0x2217('0x32'),_0x2217('0x45'),_0x2217('0x3e'),'address','chatPause',_0x2217('0x5'),_0x2217('0x31'),'smsPause','whatsappPause',_0x2217('0x4'),'voicePause',_0x2217('0x46'),_0x2217('0x47'),_0x2217('0x48'),'smsCapacity',_0x2217('0x49'),_0x2217('0x4a'),'chatCurrentCapacity',_0x2217('0x4b'),'mailCurrentCapacity','smsCurrentCapacity',_0x2217('0x4c'),'faxCurrentCapacity','chatStatus','openchannelStatus',_0x2217('0x12'),'smsStatus',_0x2217('0x14'),_0x2217('0x11'),_0x2217('0xe'),'chatStatusTime',_0x2217('0x4d'),'mailStatusTime','smsStatusTime',_0x2217('0x4e'),_0x2217('0x4f'),'voiceStatusTime',_0x2217('0x50'),_0x2217('0x51'),_0x2217('0x52'),_0x2217('0x53'),_0x2217('0x54'),'routealias'];var _0x490694=[_0x2217('0x30'),_0x2217('0x5'),'mailPause',_0x2217('0x6'),_0x2217('0x8'),'faxPause',_0x2217('0x7'),_0x2217('0x55')];var _0x200bcc=_(_0x5e5d5a)[_0x2217('0x56')](_0x490694)['pick'](_0x2b7d1c)[_0x2217('0x57')]();return _0x200bcc;}exports[_0x2217('0x58')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 1a5b5db..277cc89 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(_0x1ae125,_0x20820a){var _0x1f3b2b=function(_0xe776de){while(--_0xe776de){_0x1ae125['push'](_0x1ae125['shift']());}};_0x1f3b2b(++_0x20820a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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(_0x29a1bb,_0x52859d){var _0x19f85e=function(_0x1b1000){while(--_0x1b1000){_0x29a1bb['push'](_0x29a1bb['shift']());}};_0x19f85e(++_0x52859d);}(_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 bea5787..c96e8af 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 _0x6b2a=['../environment','networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','map','model','join','createHash','md5','digest','hex','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','update','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync'];(function(_0x4269ea,_0x56b0de){var _0x332e41=function(_0x102506){while(--_0x102506){_0x4269ea['push'](_0x4269ea['shift']());}};_0x332e41(++_0x56b0de);}(_0x6b2a,0x16d));var _0xa6b2=function(_0xcfc8bb,_0x3f6bf8){_0xcfc8bb=_0xcfc8bb-0x0;var _0xd51e09=_0x6b2a[_0xcfc8bb];return _0xd51e09;};'use strict';var _=require(_0xa6b2('0x0'));var os=require('os');var crypto=require(_0xa6b2('0x1'));var machine=require(_0xa6b2('0x2'));var exec=require(_0xa6b2('0x3'))[_0xa6b2('0x4')];var config=require(_0xa6b2('0x5'));function getInterfaces(){var _0xa463a2=[];var _0x5d936d=os[_0xa6b2('0x6')]();var _0x551e7b=_[_0xa6b2('0x7')](_[_0xa6b2('0x8')](_0x5d936d));for(var _0x33731d=0x0;_0x33731d<_0x551e7b[_0xa6b2('0x9')];_0x33731d++){var _0x48e472=_0x5d936d[_0x551e7b[_0x33731d]][_0xa6b2('0xa')](function(_0x4a69a9){return _0x4a69a9[_0xa6b2('0xb')]===_0xa6b2('0xc')&&_0x4a69a9[_0xa6b2('0xd')]===![];});_0xa463a2=_0xa463a2['concat'](_0x48e472);}return _0xa463a2;}function getFirstInterface(){var _0x35f5e5=_['head'](getInterfaces());return{'macAddress':_0x35f5e5&&_0x35f5e5[_0xa6b2('0xe')]?_0x35f5e5[_0xa6b2('0xe')]:_0xa6b2('0xf'),'ipAddress':_0x35f5e5&&_0x35f5e5[_0xa6b2('0x10')]?_0x35f5e5[_0xa6b2('0x10')]:'127.0.0.1'};}exports[_0xa6b2('0x11')]=getFirstInterface;function getCPUhash(){var _0x32fb56=_[_0xa6b2('0x7')](os[_0xa6b2('0x12')]()[_0xa6b2('0x13')](function(_0x4778ce){return _0x4778ce[_0xa6b2('0x14')];}))[_0xa6b2('0x15')](':');return crypto[_0xa6b2('0x16')](_0xa6b2('0x17'))['update'](_0x32fb56)[_0xa6b2('0x18')](_0xa6b2('0x19'));}exports[_0xa6b2('0x1a')]=function(){var _0x123db7=os[_0xa6b2('0x1b')]();var _0x3a8d90=/[0-9a-f-]{36}/;if(config[_0xa6b2('0x1c')]&&_0x3a8d90[_0xa6b2('0x1d')](config['licenseToken'])){return config[_0xa6b2('0x1c')];}else if(_0x123db7===_0xa6b2('0x1e')){return exec(_0xa6b2('0x1f'),{'encoding':_0xa6b2('0x20')})['replace']('\x0d\x0a','');}else{var _0xea82db=getFirstInterface();var _0x4e29a2=getCPUhash();var _0x5bb762=_0x4e29a2+'|'+os[_0xa6b2('0x21')]()+'|'+_0xea82db[_0xa6b2('0x22')]+'|'+_0xea82db['ipAddress'];var _0x368c7d=crypto['createHash'](_0xa6b2('0x17'))[_0xa6b2('0x23')](_0x5bb762)[_0xa6b2('0x18')]('hex');return _0x368c7d['substring'](0x0,0x8)+'-'+_0x368c7d[_0xa6b2('0x24')](0x8,0xc)+'-'+_0x368c7d[_0xa6b2('0x24')](0xc,0x10)+'-'+_0x368c7d[_0xa6b2('0x24')](0x10,0x14)+'-'+_0x368c7d[_0xa6b2('0x24')](0x14);}}; \ No newline at end of file +var _0xaa3c=['execSync','../environment','orderBy','keys','length','filter','family','internal','concat','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','model','join','md5','update','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','replace','hostname','ipAddress','createHash','digest','hex','substring','crypto','bimedia-machine-uuid'];(function(_0x3a895d,_0x44ee26){var _0x4552af=function(_0x117d3a){while(--_0x117d3a){_0x3a895d['push'](_0x3a895d['shift']());}};_0x4552af(++_0x44ee26);}(_0xaa3c,0x64));var _0xcaa3=function(_0x20df61,_0x5c6d1c){_0x20df61=_0x20df61-0x0;var _0x18b41a=_0xaa3c[_0x20df61];return _0x18b41a;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xcaa3('0x0'));var machine=require(_0xcaa3('0x1'));var exec=require('child_process')[_0xcaa3('0x2')];var config=require(_0xcaa3('0x3'));function getInterfaces(){var _0x497efa=[];var _0xedc80=os['networkInterfaces']();var _0xb84c0c=_[_0xcaa3('0x4')](_[_0xcaa3('0x5')](_0xedc80));for(var _0x1774ac=0x0;_0x1774ac<_0xb84c0c[_0xcaa3('0x6')];_0x1774ac++){var _0x3cc7a9=_0xedc80[_0xb84c0c[_0x1774ac]][_0xcaa3('0x7')](function(_0x4beefb){return _0x4beefb[_0xcaa3('0x8')]==='IPv4'&&_0x4beefb[_0xcaa3('0x9')]===![];});_0x497efa=_0x497efa[_0xcaa3('0xa')](_0x3cc7a9);}return _0x497efa;}function getFirstInterface(){var _0x48422d=_['head'](getInterfaces());return{'macAddress':_0x48422d&&_0x48422d[_0xcaa3('0xb')]?_0x48422d[_0xcaa3('0xb')]:_0xcaa3('0xc'),'ipAddress':_0x48422d&&_0x48422d['address']?_0x48422d[_0xcaa3('0xd')]:_0xcaa3('0xe')};}exports[_0xcaa3('0xf')]=getFirstInterface;function getCPUhash(){var _0x5eed42=_['orderBy'](os[_0xcaa3('0x10')]()['map'](function(_0x1b92a6){return _0x1b92a6[_0xcaa3('0x11')];}))[_0xcaa3('0x12')](':');return crypto['createHash'](_0xcaa3('0x13'))[_0xcaa3('0x14')](_0x5eed42)['digest']('hex');}exports[_0xcaa3('0x15')]=function(){var _0x16b70e=os[_0xcaa3('0x16')]();var _0x2e1117=/[0-9a-f-]{36}/;if(config[_0xcaa3('0x17')]&&_0x2e1117[_0xcaa3('0x18')](config[_0xcaa3('0x17')])){return config[_0xcaa3('0x17')];}else if(_0x16b70e===_0xcaa3('0x19')){return exec(_0xcaa3('0x1a'),{'encoding':'utf8'})[_0xcaa3('0x1b')]('\x0d\x0a','');}else{var _0x36c323=getFirstInterface();var _0x3f7518=getCPUhash();var _0x456b45=_0x3f7518+'|'+os[_0xcaa3('0x1c')]()+'|'+_0x36c323['macAddress']+'|'+_0x36c323[_0xcaa3('0x1d')];var _0xba4982=crypto[_0xcaa3('0x1e')](_0xcaa3('0x13'))[_0xcaa3('0x14')](_0x456b45)[_0xcaa3('0x1f')](_0xcaa3('0x20'));return _0xba4982['substring'](0x0,0x8)+'-'+_0xba4982[_0xcaa3('0x21')](0x8,0xc)+'-'+_0xba4982['substring'](0xc,0x10)+'-'+_0xba4982[_0xcaa3('0x21')](0x10,0x14)+'-'+_0xba4982['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 4ba478b..e506b04 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 _0xe957=['version','format','GET','then','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','Disabled','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','request-promise','bluebird','pkginfo','../../mysqldb','./hardware','../logger','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports'];(function(_0x3eb630,_0x552586){var _0x1b840d=function(_0x2594a8){while(--_0x2594a8){_0x3eb630['push'](_0x3eb630['shift']());}};_0x1b840d(++_0x552586);}(_0xe957,0x135));var _0x7e95=function(_0x2a35f1,_0x144bf8){_0x2a35f1=_0x2a35f1-0x0;var _0x2c9774=_0xe957[_0x2a35f1];return _0x2c9774;};'use strict';var util=require(_0x7e95('0x0'));var moment=require('moment');var rp=require(_0x7e95('0x1'));var BPromise=require(_0x7e95('0x2'));var pkginfo=require(_0x7e95('0x3'))(module,'version');var db=require(_0x7e95('0x4'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x7e95('0x5'));var logger=require(_0x7e95('0x6'))(_0x7e95('0x7'));var HOST=_0x7e95('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4aae97){return new BPromise(function(_0x133153,_0x28af8e){var _0x4990ad=util['format'](_0x7e95('0x9'),HOST,_0x4aae97,module[_0x7e95('0xa')][_0x7e95('0xb')]);if(oldToken){_0x4990ad=util[_0x7e95('0xc')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x4aae97,module[_0x7e95('0xa')][_0x7e95('0xb')],oldToken);}var _0x3270a3={'uri':_0x4990ad,'method':_0x7e95('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x3270a3)[_0x7e95('0xe')](function(_0x2f4cca){_0x133153(_0x2f4cca);})[_0x7e95('0xf')](function(_0x51c7ec){_0x28af8e(_0x51c7ec);});});}function manageLicense(_0x312de7,_0x8a5d33){var _0x294877=_0x8a5d33[_0x7e95('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x294877[_0x7e95('0x11')]!==_0x312de7&&!_0x294877[_0x7e95('0x12')]){oldToken=_0x294877[_0x7e95('0x11')];}httpRequest(_0x312de7)[_0x7e95('0xe')](function(_0x496b90){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x496b90[_0x7e95('0x13')]){isOldTokenSent=![];if(!_0x294877['license']&&_0x294877[_0x7e95('0x7')]!=_0x496b90['license']||_0x294877[_0x7e95('0x7')]&&_0x294877[_0x7e95('0x12')]){logger[_0x7e95('0x14')](_0x7e95('0x15'));}if(_0x294877[_0x7e95('0x7')]&&!_0x294877['data2']&&_0x294877['license']!=_0x496b90['license']){logger[_0x7e95('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x294877[_0x7e95('0x7')]&&!_0x294877[_0x7e95('0x12')]&&_0x294877['license']==_0x496b90['license']){return _0x8a5d33;}return _0x8a5d33[_0x7e95('0x16')]({'data1':_0x312de7,'data2':null,'license':_0x496b90[_0x7e95('0x7')]});}else{if(_0x496b90[_0x7e95('0x7')]||_0x294877[_0x7e95('0x7')]){if(!_0x294877[_0x7e95('0x12')]){if(_0x294877['data1']==_0x312de7){GRAY_PERIOD_REASON=_0x7e95('0x17');logger[_0x7e95('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON='Changed';logger[_0x7e95('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x294877[_0x7e95('0x11')],_0x312de7);}logger['info'](_0x7e95('0x18'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x7e95('0xc')](_0x7e95('0x19')));return _0x8a5d33[_0x7e95('0x16')]({'data2':encryptor[_0x7e95('0x1a')](moment()['format'](_0x7e95('0x19')))});}else{if(moment()[_0x7e95('0x1b')](encryptor[_0x7e95('0x1c')](_0x294877[_0x7e95('0x12')]),_0x7e95('0x1d'))>DAYS){logger['info'](_0x7e95('0x1e'),moment()[_0x7e95('0xc')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x8a5d33[_0x7e95('0x16')]({'data1':_0x312de7,'data2':null,'license':null});}}}else{if(_0x294877[_0x7e95('0x11')]!=_0x312de7){logger[_0x7e95('0x14')](_0x7e95('0x1f'),_0x294877[_0x7e95('0x11')],_0x312de7);return _0x8a5d33[_0x7e95('0x16')]({'data1':_0x312de7,'data2':null,'license':null});}}}return _0x8a5d33;})[_0x7e95('0xe')](function(_0x3a3c75){_0x8a5d33=_0x3a3c75;})[_0x7e95('0xf')](function(_0x8a330c){logger['error'](_0x8a330c[_0x7e95('0x20')]);})[_0x7e95('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0x7e95('0x22')](),_0x8a5d33);},TIME);});}function defaultLicense(){var _0x5735b3=hardware[_0x7e95('0x22')]();if(_0x5735b3){return db[_0x7e95('0x23')][_0x7e95('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x5735b3}})[_0x7e95('0x25')](function(_0x4d1ae8,_0x227465){logger[_0x7e95('0x14')](_0x7e95('0x26'),_0x5735b3);manageLicense(_0x5735b3,_0x4d1ae8);})[_0x7e95('0xf')](function(_0x23fdb2){logger['error'](_0x23fdb2['message']);});}}exports[_0x7e95('0x27')]=defaultLicense; \ No newline at end of file +var _0xa838=['THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','catch','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','pkginfo','version','../../mysqldb','../../components/encryptor','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','get','data2','data1','active','info'];(function(_0x5d003e,_0x31afda){var _0xff3eba=function(_0x504d3e){while(--_0x504d3e){_0x5d003e['push'](_0x5d003e['shift']());}};_0xff3eba(++_0x31afda);}(_0xa838,0x1d0));var _0x8a83=function(_0x3fecbe,_0x608f40){_0x3fecbe=_0x3fecbe-0x0;var _0x59299b=_0xa838[_0x3fecbe];return _0x59299b;};'use strict';var util=require(_0x8a83('0x0'));var moment=require(_0x8a83('0x1'));var rp=require(_0x8a83('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0x8a83('0x3'))(module,_0x8a83('0x4'));var db=require(_0x8a83('0x5'))['db'];var encryptor=require(_0x8a83('0x6'));var hardware=require('./hardware');var logger=require(_0x8a83('0x7'))(_0x8a83('0x8'));var HOST=_0x8a83('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x7084eb){return new BPromise(function(_0xc3a84d,_0x2339e3){var _0x13086c=util[_0x8a83('0xa')](_0x8a83('0xb'),HOST,_0x7084eb,module[_0x8a83('0xc')][_0x8a83('0x4')]);if(oldToken){_0x13086c=util[_0x8a83('0xa')](_0x8a83('0xd'),HOST,_0x7084eb,module[_0x8a83('0xc')][_0x8a83('0x4')],oldToken);}var _0x569d5a={'uri':_0x13086c,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x569d5a)[_0x8a83('0xe')](function(_0x57a15e){_0xc3a84d(_0x57a15e);})['catch'](function(_0x39c62e){_0x2339e3(_0x39c62e);});});}function manageLicense(_0x463aae,_0x4d54a5){var _0x566cc6=_0x4d54a5[_0x8a83('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x566cc6['data1']!==_0x463aae&&!_0x566cc6[_0x8a83('0x10')]){oldToken=_0x566cc6[_0x8a83('0x11')];}httpRequest(_0x463aae)[_0x8a83('0xe')](function(_0x55d855){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x55d855[_0x8a83('0x12')]){isOldTokenSent=![];if(!_0x566cc6[_0x8a83('0x8')]&&_0x566cc6['license']!=_0x55d855[_0x8a83('0x8')]||_0x566cc6['license']&&_0x566cc6[_0x8a83('0x10')]){logger[_0x8a83('0x13')](_0x8a83('0x14'));}if(_0x566cc6['license']&&!_0x566cc6['data2']&&_0x566cc6[_0x8a83('0x8')]!=_0x55d855[_0x8a83('0x8')]){logger['info'](_0x8a83('0x15'));}if(_0x566cc6[_0x8a83('0x8')]&&!_0x566cc6[_0x8a83('0x10')]&&_0x566cc6[_0x8a83('0x8')]==_0x55d855[_0x8a83('0x8')]){return _0x4d54a5;}return _0x4d54a5[_0x8a83('0x16')]({'data1':_0x463aae,'data2':null,'license':_0x55d855[_0x8a83('0x8')]});}else{if(_0x55d855[_0x8a83('0x8')]||_0x566cc6[_0x8a83('0x8')]){if(!_0x566cc6['data2']){if(_0x566cc6[_0x8a83('0x11')]==_0x463aae){GRAY_PERIOD_REASON=_0x8a83('0x17');logger[_0x8a83('0x13')](_0x8a83('0x18'));}else{GRAY_PERIOD_REASON=_0x8a83('0x19');logger['info'](_0x8a83('0x1a'),_0x566cc6[_0x8a83('0x11')],_0x463aae);}logger['info'](_0x8a83('0x1b'),GRAY_PERIOD_REASON[_0x8a83('0x1c')](),moment()['format'](_0x8a83('0x1d')));return _0x4d54a5[_0x8a83('0x16')]({'data2':encryptor['encryptString'](moment()[_0x8a83('0xa')](_0x8a83('0x1d')))});}else{if(moment()[_0x8a83('0x1e')](encryptor[_0x8a83('0x1f')](_0x566cc6[_0x8a83('0x10')]),_0x8a83('0x20'))>DAYS){logger['info'](_0x8a83('0x21'),moment()[_0x8a83('0xa')](_0x8a83('0x1d')));isOldTokenSent=![];return _0x4d54a5[_0x8a83('0x16')]({'data1':_0x463aae,'data2':null,'license':null});}}}else{if(_0x566cc6[_0x8a83('0x11')]!=_0x463aae){logger['info'](_0x8a83('0x1a'),_0x566cc6['data1'],_0x463aae);return _0x4d54a5[_0x8a83('0x16')]({'data1':_0x463aae,'data2':null,'license':null});}}}return _0x4d54a5;})[_0x8a83('0xe')](function(_0x2f69b5){_0x4d54a5=_0x2f69b5;})[_0x8a83('0x22')](function(_0x546583){logger[_0x8a83('0x23')](_0x546583[_0x8a83('0x24')]);})[_0x8a83('0x25')](function(){setTimeout(function(){manageLicense(hardware[_0x8a83('0x26')](),_0x4d54a5);},TIME);});}function defaultLicense(){var _0x2b3516=hardware[_0x8a83('0x26')]();if(_0x2b3516){return db[_0x8a83('0x27')][_0x8a83('0x28')]({'where':{'id':0x1},'defaults':{'data1':_0x2b3516}})[_0x8a83('0x29')](function(_0x41e687,_0x5d7c94){logger[_0x8a83('0x13')](_0x8a83('0x2a'),_0x2b3516);manageLicense(_0x2b3516,_0x41e687);})[_0x8a83('0x22')](function(_0x138428){logger[_0x8a83('0x23')](_0x138428[_0x8a83('0x24')]);});}}exports[_0x8a83('0x2b')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index d0e3c4b..1651201 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 _0xe9db=['telephones','forEach','count','catch','pick','countBy','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','./hardware','../../mysqldb','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','defaults','then','license','isEmpty','data2','split','decryptString','format','%s:%s:%s','parse','uuid','machineUuid','deadline','add','days','grayReason','changed','disabled','data1','message','User','findAll','role','sequelize','COUNT','col','admin','user','telephone','users'];(function(_0x528d5d,_0x431c95){var _0x58e6c0=function(_0xc1c0aa){while(--_0xc1c0aa){_0x528d5d['push'](_0x528d5d['shift']());}};_0x58e6c0(++_0x431c95);}(_0xe9db,0x9b));var _0xbe9d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe9db[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xbe9d('0x0'));var _=require(_0xbe9d('0x1'));var moment=require(_0xbe9d('0x2'));var BPromise=require('bluebird');var hardware=require(_0xbe9d('0x3'));var encryptor=require('../../components/encryptor');var db=require(_0xbe9d('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xbe9d('0x5'),'machineUuid':hardware[_0xbe9d('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xbe9d('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xbe9d('0x8'),'machineUuid':hardware[_0xbe9d('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x6ac4b5){return new BPromise(function(_0x34b4cb,_0x3660b4){return db[_0xbe9d('0x9')][_0xbe9d('0xa')](_[_0xbe9d('0xb')](_0x6ac4b5,{'raw':!![],'where':{'id':0x1}}))[_0xbe9d('0xc')](function(_0x201ed0){return checkLicense(_0x201ed0,null);})[_0xbe9d('0xc')](function(_0x5e6fb2){_0x34b4cb(_0x5e6fb2);return;})['catch'](function(_0x29bfac){_0x3660b4(_0x29bfac);});});}function checkLicense(_0x35f074,_0x37062c){if(!_0x35f074){demoLicense['uuid']=_0x35f074['data1'];return demoLicense;}try{var _0x17b61f=_0x37062c||_0x35f074[_0xbe9d('0xd')];if(_[_0xbe9d('0xe')](_0x17b61f)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x3a3be3=_0x35f074['data1'];var _0x3262c5=_0x35f074[_0xbe9d('0xf')];var _0x3de398=_0x3a3be3[_0xbe9d('0x10')]('-')[0x4];var _0x5944ac=_0x3a3be3[_0xbe9d('0x10')]('-')[0x0];var _0xd21999=encryptor[_0xbe9d('0x11')](_0x17b61f,util[_0xbe9d('0x12')](_0xbe9d('0x13'),_0x3de398,_0x3a3be3,_0x5944ac));var _0x326da6=JSON[_0xbe9d('0x14')](_0xd21999);_0x326da6['demo']=![];_0x326da6[_0xbe9d('0x15')]=_0x3a3be3;_0x326da6[_0xbe9d('0x16')]=hardware[_0xbe9d('0x6')]();if(_0x3262c5){var _0x9ea5a4=encryptor[_0xbe9d('0x11')](_0x3262c5);_0x326da6['gray']=_0x9ea5a4;_0x326da6[_0xbe9d('0x17')]=moment(_0x9ea5a4)[_0xbe9d('0x18')](0x7,_0xbe9d('0x19'))['format']();_0x326da6[_0xbe9d('0x1a')]=_0x326da6[_0xbe9d('0x15')]!=_0x326da6['machineUuid']?_0xbe9d('0x1b'):_0xbe9d('0x1c');}return _0x326da6;}catch(_0x405bac){breakingLicense[_0xbe9d('0x15')]=_0x35f074[_0xbe9d('0x1d')];breakingLicense['message']=_0x405bac[_0xbe9d('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x596838,_0x21c93b){getLicense()[_0xbe9d('0xc')](function(_0x50a161){return db[_0xbe9d('0x1f')][_0xbe9d('0x20')]({'attributes':[_0xbe9d('0x21'),[db[_0xbe9d('0x22')]['fn'](_0xbe9d('0x23'),db[_0xbe9d('0x22')][_0xbe9d('0x24')]('role')),'count']],'group':_0xbe9d('0x21'),'where':{'role':{'$or':[_0xbe9d('0x25'),_0xbe9d('0x26'),_0xbe9d('0x27')]}},'raw':!![]})[_0xbe9d('0xc')](function(_0x8b82c3){var _0x52fb69={'user':_0x50a161[_0xbe9d('0x28')]||0x0,'telephone':_0x50a161[_0xbe9d('0x29')]||0x0};_0x8b82c3[_0xbe9d('0x2a')](function(_0x394223){var _0x1070c3=_0x394223[_0xbe9d('0x21')]===_0xbe9d('0x25')?_0xbe9d('0x26'):_0x394223[_0xbe9d('0x21')];_0x52fb69[_0x1070c3]-=_0x394223[_0xbe9d('0x2b')];if(_0x52fb69[_0x1070c3]<0x0)_0x52fb69[_0x1070c3]=0x0;});_0x596838(_0x52fb69);return;});})[_0xbe9d('0x2c')](function(_0x398fea){_0x21c93b(_0x398fea);});});}function checkUserLimits(_0x372a68){return new BPromise(function(_0x2ba5e6,_0x519cc3){getLimits()[_0xbe9d('0xc')](function(_0x2634b8){var _0x406ea8=_[_0xbe9d('0x2d')](_[_0xbe9d('0x2e')](_0x372a68,_0xbe9d('0x21')),[_0xbe9d('0x25'),_0xbe9d('0x26'),_0xbe9d('0x27')]);var _0x2016b7=(_0x406ea8['admin']||0x0)+(_0x406ea8[_0xbe9d('0x26')]||0x0);var _0x292b82=_0x406ea8[_0xbe9d('0x27')]||0x0;if(_0x2016b7>_0x2634b8[_0xbe9d('0x26')])return _0x519cc3('License\x20limit\x20reached\x20for\x20users');if(_0x292b82>_0x2634b8['telephone'])return _0x519cc3(_0xbe9d('0x2f'));return _0x2ba5e6();})[_0xbe9d('0x2c')](function(_0x4cd845){_0x519cc3(_0x4cd845);});});}module[_0xbe9d('0x30')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x958d=['catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','demo','machineUuid','getUuid','gray','deadline','add','days','grayReason','disabled','message','User','findAll','role','sequelize','COUNT','count','user','telephones','forEach','admin','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','moment','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','License','find','defaults','then'];(function(_0x126757,_0x2b29cb){var _0x3fe7be=function(_0xddf13f){while(--_0xddf13f){_0x126757['push'](_0x126757['shift']());}};_0x3fe7be(++_0x2b29cb);}(_0x958d,0x1cc));var _0xd958=function(_0x262625,_0x94aea9){_0x262625=_0x262625-0x0;var _0x48ab96=_0x958d[_0x262625];return _0x48ab96;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xd958('0x0'));var BPromise=require('bluebird');var hardware=require(_0xd958('0x1'));var encryptor=require(_0xd958('0x2'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xd958('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xd958('0x4'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xd958('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xd958('0x5'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x586162){return new BPromise(function(_0x510ddb,_0x1f53ac){return db[_0xd958('0x6')][_0xd958('0x7')](_[_0xd958('0x8')](_0x586162,{'raw':!![],'where':{'id':0x1}}))[_0xd958('0x9')](function(_0x37d028){return checkLicense(_0x37d028,null);})[_0xd958('0x9')](function(_0x341840){_0x510ddb(_0x341840);return;})[_0xd958('0xa')](function(_0x52e788){_0x1f53ac(_0x52e788);});});}function checkLicense(_0x362be3,_0x14b230){if(!_0x362be3){demoLicense[_0xd958('0xb')]=_0x362be3[_0xd958('0xc')];return demoLicense;}try{var _0x3bb39f=_0x14b230||_0x362be3[_0xd958('0xd')];if(_[_0xd958('0xe')](_0x3bb39f)){throw new Error(_0xd958('0xf'));}var _0x305674=_0x362be3['data1'];var _0x34d1d7=_0x362be3[_0xd958('0x10')];var _0x3957ff=_0x305674[_0xd958('0x11')]('-')[0x4];var _0x529640=_0x305674[_0xd958('0x11')]('-')[0x0];var _0x1032d1=encryptor[_0xd958('0x12')](_0x3bb39f,util[_0xd958('0x13')](_0xd958('0x14'),_0x3957ff,_0x305674,_0x529640));var _0x42952f=JSON['parse'](_0x1032d1);_0x42952f[_0xd958('0x15')]=![];_0x42952f[_0xd958('0xb')]=_0x305674;_0x42952f[_0xd958('0x16')]=hardware[_0xd958('0x17')]();if(_0x34d1d7){var _0x590034=encryptor[_0xd958('0x12')](_0x34d1d7);_0x42952f[_0xd958('0x18')]=_0x590034;_0x42952f[_0xd958('0x19')]=moment(_0x590034)[_0xd958('0x1a')](0x7,_0xd958('0x1b'))[_0xd958('0x13')]();_0x42952f[_0xd958('0x1c')]=_0x42952f[_0xd958('0xb')]!=_0x42952f[_0xd958('0x16')]?'changed':_0xd958('0x1d');}return _0x42952f;}catch(_0x198941){breakingLicense['uuid']=_0x362be3[_0xd958('0xc')];breakingLicense[_0xd958('0x1e')]=_0x198941[_0xd958('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x1668e4,_0x3895ba){getLicense()['then'](function(_0x32083d){return db[_0xd958('0x1f')][_0xd958('0x20')]({'attributes':[_0xd958('0x21'),[db[_0xd958('0x22')]['fn'](_0xd958('0x23'),db[_0xd958('0x22')]['col'](_0xd958('0x21'))),_0xd958('0x24')]],'group':'role','where':{'role':{'$or':['admin',_0xd958('0x25'),'telephone']}},'raw':!![]})[_0xd958('0x9')](function(_0xba1ee8){var _0x3c719a={'user':_0x32083d['users']||0x0,'telephone':_0x32083d[_0xd958('0x26')]||0x0};_0xba1ee8[_0xd958('0x27')](function(_0xbed37f){var _0x476ab4=_0xbed37f[_0xd958('0x21')]===_0xd958('0x28')?_0xd958('0x25'):_0xbed37f[_0xd958('0x21')];_0x3c719a[_0x476ab4]-=_0xbed37f[_0xd958('0x24')];if(_0x3c719a[_0x476ab4]<0x0)_0x3c719a[_0x476ab4]=0x0;});_0x1668e4(_0x3c719a);return;});})[_0xd958('0xa')](function(_0x4d9368){_0x3895ba(_0x4d9368);});});}function checkUserLimits(_0x341436){return new BPromise(function(_0x476970,_0x5a04fa){getLimits()[_0xd958('0x9')](function(_0x3a15a3){var _0x2af8be=_[_0xd958('0x29')](_[_0xd958('0x2a')](_0x341436,_0xd958('0x21')),['admin',_0xd958('0x25'),_0xd958('0x2b')]);var _0x26a9d7=(_0x2af8be[_0xd958('0x28')]||0x0)+(_0x2af8be['user']||0x0);var _0x24b7de=_0x2af8be[_0xd958('0x2b')]||0x0;if(_0x26a9d7>_0x3a15a3[_0xd958('0x25')])return _0x5a04fa(_0xd958('0x2c'));if(_0x24b7de>_0x3a15a3[_0xd958('0x2b')])return _0x5a04fa(_0xd958('0x2d'));return _0x476970();})[_0xd958('0xa')](function(_0x3d173c){_0x5a04fa(_0x3d173c);});});}module[_0xd958('0x2e')]={'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 7b3fc18..1a85ced 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 _0x1c9a=['myappanuglar-secret','secret','exports'];(function(_0x259b27,_0x20917f){var _0x1d5e39=function(_0x4133a5){while(--_0x4133a5){_0x259b27['push'](_0x259b27['shift']());}};_0x1d5e39(++_0x20917f);}(_0x1c9a,0x98));var _0xa1c9=function(_0x5b40b2,_0x1d66bc){_0x5b40b2=_0x5b40b2-0x0;var _0x19e2c2=_0x1c9a[_0x5b40b2];return _0x19e2c2;};'use strict';module[_0xa1c9('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xa1c9('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xa1c9('0x2'),'DEBUG':''}; \ No newline at end of file +var _0x1c7c=['exports','http://localhost:9000','myappanuglar-secret','app-id'];(function(_0x30fb67,_0x1eddb9){var _0x2d2105=function(_0x13e5b3){while(--_0x13e5b3){_0x30fb67['push'](_0x30fb67['shift']());}};_0x2d2105(++_0x1eddb9);}(_0x1c7c,0x164));var _0xc1c7=function(_0x4c665e,_0x431173){_0x4c665e=_0x4c665e-0x0;var _0x3ae665=_0x1c7c[_0x4c665e];return _0x3ae665;};'use strict';module[_0xc1c7('0x0')]={'DOMAIN':_0xc1c7('0x1'),'SESSION_SECRET':_0xc1c7('0x2'),'GOOGLE_ID':_0xc1c7('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 5a78f8b..bbe5ff7 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x20b3=['fileLogger','exports','../utils/loggers'];(function(_0x50b8a9,_0x4bc6a4){var _0x13dfcb=function(_0x1acb20){while(--_0x1acb20){_0x50b8a9['push'](_0x50b8a9['shift']());}};_0x13dfcb(++_0x4bc6a4);}(_0x20b3,0xdd));var _0x320b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20b3[_0x3dd15e];return _0x231fd0;};'use strict';var fileLogger=require(_0x320b('0x0'))[_0x320b('0x1')];module[_0x320b('0x2')]=fileLogger; \ No newline at end of file +var _0x5725=['exports','fileLogger'];(function(_0x1523ff,_0x4d1845){var _0x433e66=function(_0x5aa2c4){while(--_0x5aa2c4){_0x1523ff['push'](_0x1523ff['shift']());}};_0x433e66(++_0x4d1845);}(_0x5725,0x113));var _0x5572=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x5725[_0x46e363];return _0x3fb059;};'use strict';var fileLogger=require('../utils/loggers')[_0x5572('0x0')];module[_0x5572('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 6291675..916a97e 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 _0x4eb3=['ami','../../services/ami/index.js','../../services/agi/index.js','email','../../services/email/index.js','../../services/xdr/index.js','path','join'];(function(_0xf8cd0d,_0x4b473c){var _0x4cf71c=function(_0x84a4c2){while(--_0x84a4c2){_0xf8cd0d['push'](_0xf8cd0d['shift']());}};_0x4cf71c(++_0x4b473c);}(_0x4eb3,0xee));var _0x34eb=function(_0x4a78af,_0x268061){_0x4a78af=_0x4a78af-0x0;var _0x525ff8=_0x4eb3[_0x4a78af];return _0x525ff8;};'use strict';var path=require(_0x34eb('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x34eb('0x1')](__dirname,'../../services/express/index.js')},{'name':_0x34eb('0x2'),'script':path[_0x34eb('0x1')](__dirname,_0x34eb('0x3'))},{'name':'agi','script':path[_0x34eb('0x1')](__dirname,_0x34eb('0x4'))},{'name':_0x34eb('0x5'),'script':path[_0x34eb('0x1')](__dirname,_0x34eb('0x6'))},{'name':'routing','script':path[_0x34eb('0x1')](__dirname,'../../services/routing/index.js')},{'name':'xdr','script':path['join'](__dirname,_0x34eb('0x7'))}]};module['exports']=config; \ No newline at end of file +var _0x2a33=['email','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','../../services/express/index.js','ami','join','../../services/ami/index.js','agi'];(function(_0x4c020b,_0x1c7dde){var _0x38e4b3=function(_0x256b0a){while(--_0x256b0a){_0x4c020b['push'](_0x4c020b['shift']());}};_0x38e4b3(++_0x1c7dde);}(_0x2a33,0x10d));var _0x32a3=function(_0x40b2e7,_0x5113fb){_0x40b2e7=_0x40b2e7-0x0;var _0xad0aca=_0x2a33[_0x40b2e7];return _0xad0aca;};'use strict';var path=require(_0x32a3('0x0'));var os=require('os');var config={'apps':[{'name':_0x32a3('0x1'),'script':path['join'](__dirname,_0x32a3('0x2'))},{'name':_0x32a3('0x3'),'script':path[_0x32a3('0x4')](__dirname,_0x32a3('0x5'))},{'name':_0x32a3('0x6'),'script':path['join'](__dirname,'../../services/agi/index.js')},{'name':_0x32a3('0x7'),'script':path[_0x32a3('0x4')](__dirname,'../../services/email/index.js')},{'name':'routing','script':path[_0x32a3('0x4')](__dirname,_0x32a3('0x8'))},{'name':_0x32a3('0x9'),'script':path[_0x32a3('0x4')](__dirname,_0x32a3('0xa'))}]};module[_0x32a3('0xb')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 60f0dfd..5a4e7bc 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 _0xba93=['describe','delete','dump','pm2','./config','connect','connected','start','then','disconnect','stop','restart'];(function(_0x978971,_0x4ca3cb){var _0x48572f=function(_0x58fdd6){while(--_0x58fdd6){_0x978971['push'](_0x978971['shift']());}};_0x48572f(++_0x4ca3cb);}(_0xba93,0x1cb));var _0x3ba9=function(_0x50d0a0,_0xc41c0b){_0x50d0a0=_0x50d0a0-0x0;var _0x16e5c9=_0xba93[_0x50d0a0];return _0x16e5c9;};'use strict';var pm2=require(_0x3ba9('0x0'));var BPromise=require('bluebird');var config=require(_0x3ba9('0x1'));function connect(){return new BPromise(function(_0x2e22c4,_0x5c99bb){return pm2[_0x3ba9('0x2')](function(_0x201209){if(_0x201209){return _0x5c99bb(_0x201209);}return _0x2e22c4(_0x3ba9('0x3'));});});};exports[_0x3ba9('0x4')]=function(_0x1129df){return connect()[_0x3ba9('0x5')](function(){return new BPromise(function(_0x31aa9f,_0x5dcad6){return pm2[_0x3ba9('0x4')](_0x1129df,function(_0x1d7f51,_0x16db9d){if(_0x1d7f51){return _0x5dcad6(_0x1d7f51);}pm2[_0x3ba9('0x6')]();return _0x31aa9f(_0x16db9d);});});});};exports[_0x3ba9('0x7')]=function(_0x3cbad0){return connect()[_0x3ba9('0x5')](function(){return new BPromise(function(_0x2fadb2,_0x3b3a41){return pm2[_0x3ba9('0x7')](_0x3cbad0,function(_0x20c0ad,_0x55b18b){if(_0x20c0ad){return _0x3b3a41(_0x20c0ad);}pm2[_0x3ba9('0x6')]();return _0x2fadb2(_0x55b18b);});});});};exports['restart']=function(_0x41e49a){return connect()[_0x3ba9('0x5')](function(){return new BPromise(function(_0x2f4f59,_0x2371e4){return pm2[_0x3ba9('0x8')](_0x41e49a,function(_0x266db9,_0x35aa29){if(_0x266db9){return _0x2371e4(_0x266db9);}pm2[_0x3ba9('0x6')]();return _0x2f4f59(_0x35aa29);});});});};exports['list']=function(){return connect()[_0x3ba9('0x5')](function(){return new BPromise(function(_0x4367ed,_0x524085){return pm2['list'](function(_0x541a80,_0xf31728){if(_0x541a80){return _0x524085(_0x541a80);}pm2[_0x3ba9('0x6')]();return _0x4367ed(_0xf31728);});});});};exports['describe']=function(_0x1ba6f2){return connect()[_0x3ba9('0x5')](function(){return new BPromise(function(_0x580e77,_0x3b8170){return pm2[_0x3ba9('0x9')](_0x1ba6f2,function(_0x3085d7,_0x2dd344){if(_0x3085d7){return _0x3b8170(_0x3085d7);}pm2[_0x3ba9('0x6')]();return _0x580e77(_0x2dd344);});});});};exports[_0x3ba9('0xa')]=function(_0x3780c3){return connect()[_0x3ba9('0x5')](function(){return new BPromise(function(_0xb24d16,_0x121b0f){return pm2[_0x3ba9('0xa')](_0x3780c3,function(_0x559225,_0x50f382){if(_0x559225){return _0x121b0f(_0x559225);}pm2[_0x3ba9('0x6')]();return _0xb24d16(_0x50f382);});});});};exports[_0x3ba9('0xb')]=function(){return connect()[_0x3ba9('0x5')](function(){return new BPromise(function(_0x209722,_0x40c5a3){return pm2['dump'](function(_0x384f0d){if(_0x384f0d){return _0x40c5a3(_0x384f0d);}return _0x209722('saved');});});});}; \ No newline at end of file +var _0x4db4=['describe','delete','dump','pm2','bluebird','connect','connected','then','start','stop','disconnect','restart','list'];(function(_0x176d14,_0x3984ea){var _0x89522c=function(_0x3aba48){while(--_0x3aba48){_0x176d14['push'](_0x176d14['shift']());}};_0x89522c(++_0x3984ea);}(_0x4db4,0x196));var _0x44db=function(_0x19b010,_0x3d6401){_0x19b010=_0x19b010-0x0;var _0x211dd4=_0x4db4[_0x19b010];return _0x211dd4;};'use strict';var pm2=require(_0x44db('0x0'));var BPromise=require(_0x44db('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x78fa14,_0x5ee3e9){return pm2[_0x44db('0x2')](function(_0x33670a){if(_0x33670a){return _0x5ee3e9(_0x33670a);}return _0x78fa14(_0x44db('0x3'));});});};exports['start']=function(_0x488e79){return connect()[_0x44db('0x4')](function(){return new BPromise(function(_0x4c814a,_0x5db1e9){return pm2[_0x44db('0x5')](_0x488e79,function(_0x25fc24,_0x524406){if(_0x25fc24){return _0x5db1e9(_0x25fc24);}pm2['disconnect']();return _0x4c814a(_0x524406);});});});};exports['stop']=function(_0x2a637d){return connect()[_0x44db('0x4')](function(){return new BPromise(function(_0x3bad1c,_0x335ebb){return pm2[_0x44db('0x6')](_0x2a637d,function(_0x443cc8,_0x318861){if(_0x443cc8){return _0x335ebb(_0x443cc8);}pm2[_0x44db('0x7')]();return _0x3bad1c(_0x318861);});});});};exports[_0x44db('0x8')]=function(_0x3fb759){return connect()[_0x44db('0x4')](function(){return new BPromise(function(_0x1cb57f,_0x124db0){return pm2[_0x44db('0x8')](_0x3fb759,function(_0x269747,_0x25fcac){if(_0x269747){return _0x124db0(_0x269747);}pm2[_0x44db('0x7')]();return _0x1cb57f(_0x25fcac);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0x46e708,_0x5148e3){return pm2[_0x44db('0x9')](function(_0x17e798,_0x27add){if(_0x17e798){return _0x5148e3(_0x17e798);}pm2[_0x44db('0x7')]();return _0x46e708(_0x27add);});});});};exports[_0x44db('0xa')]=function(_0x3763f4){return connect()['then'](function(){return new BPromise(function(_0x42fd0a,_0x571524){return pm2['describe'](_0x3763f4,function(_0x1115c1,_0x1c14bd){if(_0x1115c1){return _0x571524(_0x1115c1);}pm2[_0x44db('0x7')]();return _0x42fd0a(_0x1c14bd);});});});};exports[_0x44db('0xb')]=function(_0x599c49){return connect()['then'](function(){return new BPromise(function(_0x20973b,_0x38fd5f){return pm2[_0x44db('0xb')](_0x599c49,function(_0x1d1b12,_0x41ffae){if(_0x1d1b12){return _0x38fd5f(_0x1d1b12);}pm2[_0x44db('0x7')]();return _0x20973b(_0x41ffae);});});});};exports[_0x44db('0xc')]=function(){return connect()['then'](function(){return new BPromise(function(_0x20b8c7,_0x5b0110){return pm2[_0x44db('0xc')](function(_0x2ecd91){if(_0x2ecd91){return _0x5b0110(_0x2ecd91);}return _0x20b8c7('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 23c6a30..73eba93 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 _0x25f4=['format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','length','emit','catch','error','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','util','../../config/environment','../../mysqldb','../logger','defaults','redis','localhost','socket.io-emitter','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','timeout'];(function(_0x215dc8,_0x52c245){var _0x583ea3=function(_0x32350d){while(--_0x32350d){_0x215dc8['push'](_0x215dc8['shift']());}};_0x583ea3(++_0x52c245);}(_0x25f4,0x66));var _0x425f=function(_0xd852df,_0x18a551){_0xd852df=_0xd852df-0x0;var _0x457d6c=_0x25f4[_0xd852df];return _0x457d6c;};'use strict';var _=require(_0x425f('0x0'));var moment=require(_0x425f('0x1'));var Redis=require('ioredis');var util=require(_0x425f('0x2'));var config=require(_0x425f('0x3'));var db=require(_0x425f('0x4'))['db'];var logger=require(_0x425f('0x5'))('schedule');config['redis']=_[_0x425f('0x6')](config[_0x425f('0x7')],{'host':_0x425f('0x8'),'port':0x18eb});var io=require(_0x425f('0x9'))(new Redis(config[_0x425f('0x7')]));function closeInteractions(){var _0x1dfe37=0x0;var _0x20cbea=[];return db['Setting']['find']({'raw':!![],'attributes':['id',_0x425f('0xa')],'where':{'id':0x1}})[_0x425f('0xb')](function(_0x31ef90){_0x1dfe37=_0x31ef90[_0x425f('0xa')];if(_0x1dfe37){return db[_0x425f('0xc')][_0x425f('0xd')]({'raw':!![],'attributes':['id',_0x425f('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x425f('0xf')](_0x31ef90['chatTimeout'],_0x425f('0x10'))}}});}else{return[];}})['then'](function(_0x4602c2){if(_0x4602c2&&_0x4602c2['length']){_0x20cbea=_['map'](_0x4602c2||[],'id');logger[_0x425f('0x11')](_0x425f('0x12'),_0x20cbea[_0x425f('0x13')]());return db['ChatInteraction'][_0x425f('0x14')]({'closeReason':'system','disposition':_0x425f('0x15'),'closed':!![],'closedAt':moment()[_0x425f('0x16')](_0x425f('0x17'))},{'where':{'id':_0x20cbea}});}})['then'](function(){if(_0x20cbea&&_0x20cbea['length']){logger[_0x425f('0x11')](_0x425f('0x18'),_0x20cbea[_0x425f('0x13')]());for(var _0x821d1a=0x0;_0x821d1a<_0x20cbea[_0x425f('0x19')];_0x821d1a++){io[_0x425f('0x1a')]('chatInteraction:update',{'id':_0x20cbea[_0x821d1a],'closed':!![]});}}})[_0x425f('0x1b')](function(_0x79fe30){logger[_0x425f('0x1c')](_0x425f('0x1d'),_0x79fe30?util['inspect'](_0x79fe30,{'showHidden':![],'depth':null}):'');});}exports[_0x425f('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x6c0c=['redis','defaults','localhost','socket.io-emitter','find','then','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','ioredis','util','../../mysqldb','../logger'];(function(_0x14f9ba,_0x1549c3){var _0x2b65d3=function(_0x177727){while(--_0x177727){_0x14f9ba['push'](_0x14f9ba['shift']());}};_0x2b65d3(++_0x1549c3);}(_0x6c0c,0xc2));var _0xc6c0=function(_0x2435ae,_0x4fbc85){_0x2435ae=_0x2435ae-0x0;var _0x50d0d2=_0x6c0c[_0x2435ae];return _0x50d0d2;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0xc6c0('0x0'));var util=require(_0xc6c0('0x1'));var config=require('../../config/environment');var db=require(_0xc6c0('0x2'))['db'];var logger=require(_0xc6c0('0x3'))('schedule');config[_0xc6c0('0x4')]=_[_0xc6c0('0x5')](config[_0xc6c0('0x4')],{'host':_0xc6c0('0x6'),'port':0x18eb});var io=require(_0xc6c0('0x7'))(new Redis(config[_0xc6c0('0x4')]));function closeInteractions(){var _0x12a6ec=0x0;var _0x4ec244=[];return db['Setting'][_0xc6c0('0x8')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xc6c0('0x9')](function(_0x4c4d38){_0x12a6ec=_0x4c4d38[_0xc6c0('0xa')];if(_0x12a6ec){return db[_0xc6c0('0xb')][_0xc6c0('0xc')]({'raw':!![],'attributes':['id',_0xc6c0('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xc6c0('0xe')](_0x4c4d38[_0xc6c0('0xa')],_0xc6c0('0xf'))}}});}else{return[];}})[_0xc6c0('0x9')](function(_0x3420ff){if(_0x3420ff&&_0x3420ff[_0xc6c0('0x10')]){_0x4ec244=_[_0xc6c0('0x11')](_0x3420ff||[],'id');logger[_0xc6c0('0x12')](_0xc6c0('0x13'),_0x4ec244[_0xc6c0('0x14')]());return db[_0xc6c0('0xb')][_0xc6c0('0x15')]({'closeReason':_0xc6c0('0x16'),'disposition':_0xc6c0('0x17'),'closed':!![],'closedAt':moment()[_0xc6c0('0x18')](_0xc6c0('0x19'))},{'where':{'id':_0x4ec244}});}})['then'](function(){if(_0x4ec244&&_0x4ec244['length']){logger[_0xc6c0('0x12')](_0xc6c0('0x1a'),_0x4ec244[_0xc6c0('0x14')]());for(var _0x29b55d=0x0;_0x29b55d<_0x4ec244[_0xc6c0('0x10')];_0x29b55d++){io[_0xc6c0('0x1b')]('chatInteraction:update',{'id':_0x4ec244[_0x29b55d],'closed':!![]});}}})[_0xc6c0('0x1c')](function(_0x167bf4){logger[_0xc6c0('0x1d')](_0xc6c0('0x1e'),_0x167bf4?util[_0xc6c0('0x1f')](_0x167bf4,{'showHidden':![],'depth':null}):'');});}exports[_0xc6c0('0x20')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index 1da727d..e5b93e0 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 _0xa95b=['startAllRefreshIntervals'];(function(_0xd02bb,_0x26e2d0){var _0x1cdf23=function(_0x18fd05){while(--_0x18fd05){_0xd02bb['push'](_0xd02bb['shift']());}};_0x1cdf23(++_0x26e2d0);}(_0xa95b,0x197));var _0xba95=function(_0x59567d,_0x4a9de0){_0x59567d=_0x59567d-0x0;var _0x36e606=_0xa95b[_0x59567d];return _0x36e606;};'use strict';function start(){var _0x2775b6=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x2775b6[_0xba95('0x0')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file +var _0xe9aa=['startAllRefreshIntervals','exports'];(function(_0x245096,_0x29a979){var _0x13a9f0=function(_0x1cf772){while(--_0x1cf772){_0x245096['push'](_0x245096['shift']());}};_0x13a9f0(++_0x29a979);}(_0xe9aa,0x11e));var _0xae9a=function(_0x19c931,_0x49b401){_0x19c931=_0x19c931-0x0;var _0x310867=_0xe9aa[_0x19c931];return _0x310867;};'use strict';function start(){var _0x9adaf9=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x9adaf9[_0xae9a('0x0')]();}module[_0xae9a('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 d9e9804..7912053 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 _0x5d4b=['startAt','endAt','add','start','add\x20cron','stop\x20cron','update\x20cron','util','lodash','moment','cron-job-manager','jayson/promise','../logger','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','\x22%s\x22\x20<%s>','name','Smtp','user','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','../../files/reports','savename','%s.%s','extname','zip','status','attachments','message','text','stringify','existsSync','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','catch','no\x20report\x20id','Schedule','MailServerOut','CloudProvider','keys','map','toString','keyBy','difference','intersection','length','stop','deleteJob','toRun','index','my\x20id','run\x20job','cron','active','isBetween'];(function(_0x25efdf,_0x521462){var _0x22c495=function(_0x184469){while(--_0x184469){_0x25efdf['push'](_0x25efdf['shift']());}};_0x22c495(++_0x521462);}(_0x5d4b,0x1b0));var _0xb5d4=function(_0x316ec8,_0x2102df){_0x316ec8=_0x316ec8-0x0;var _0x40319b=_0x5d4b[_0x316ec8];return _0x40319b;};'use strict';var fs=require('fs');var util=require(_0xb5d4('0x0'));var path=require('path');var _=require(_0xb5d4('0x1'));var moment=require(_0xb5d4('0x2'));var CronJobManager=require(_0xb5d4('0x3'));var jayson=require(_0xb5d4('0x4'));var BPromise=require('bluebird');var logger=require(_0xb5d4('0x5'))('schedule');var db=require(_0xb5d4('0x6'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0xb5d4('0x7'));var client=jayson[_0xb5d4('0x8')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x42b23d,_0x1d3a25){return function(){logger[_0xb5d4('0x9')](_0xb5d4('0xa'),_0x42b23d[_0xb5d4('0xb')]);var _0x4492fc=!![];var _0x5dd9c1=_0x42b23d[_0xb5d4('0xc')][_0xb5d4('0xd')]();var _0x5ad38b={'account':_0x5dd9c1,'message':{'from':util['format'](_0xb5d4('0xe'),_0x42b23d['MailAccount'][_0xb5d4('0xf')],_0x42b23d[_0xb5d4('0xc')][_0xb5d4('0xb')]||_0x42b23d['MailAccount'][_0xb5d4('0x10')][_0xb5d4('0x11')]),'to':_0x42b23d[_0xb5d4('0xb')],'cc':_0x42b23d['cc'],'bcc':_0x42b23d[_0xb5d4('0x12')],'subject':util[_0xb5d4('0x13')](_0xb5d4('0x14'),_0x1d3a25[_0xb5d4('0xf')],_0x42b23d[_0xb5d4('0x15')],_0x42b23d['subtractUnit'])}};var _0x4df68c=path[_0xb5d4('0x16')](__dirname,_0xb5d4('0x17'));var _0x1ac3a8=_0x1d3a25[_0xb5d4('0x18')];var _0x136955=util[_0xb5d4('0x13')](_0xb5d4('0x19'),path['basename'](_0x1d3a25['savename'],path[_0xb5d4('0x1a')](_0x1d3a25['savename'])),_0xb5d4('0x1b'));var _0x534fa2=path[_0xb5d4('0x16')](_0x4df68c,_0x1ac3a8);var _0x594831=path[_0xb5d4('0x16')](_0x4df68c,_0x136955);if(fs['existsSync'](_0x534fa2)){_0x1d3a25[_0xb5d4('0x1c')]='Sent';_0x5ad38b['message'][_0xb5d4('0x1d')]=[{'filename':_0x1ac3a8,'path':_0x534fa2}];_0x5ad38b[_0xb5d4('0x1e')][_0xb5d4('0x1f')]=util[_0xb5d4('0x13')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0xb5d4('0x20')](_0x1d3a25,null,0x2));}else if(fs[_0xb5d4('0x21')](_0x594831)){_0x1d3a25[_0xb5d4('0x1c')]=_0xb5d4('0x22');_0x5ad38b[_0xb5d4('0x1e')]['attachments']=[{'filename':_0x136955,'path':_0x594831}];}else{_0x5ad38b['message']['text']=_0xb5d4('0x23');if(!_0x42b23d[_0xb5d4('0x24')]){_0x4492fc=![];logger[_0xb5d4('0x9')](_0xb5d4('0x25'));}}if(_0x4492fc){return client[_0xb5d4('0x26')](_0xb5d4('0x27'),_0x5ad38b)[_0xb5d4('0x28')](function(_0x304f18){if(_0x304f18[_0xb5d4('0x29')]){return logger['error'](_0xb5d4('0x2a'),JSON[_0xb5d4('0x20')](_0x304f18));}return logger[_0xb5d4('0x9')]('email\x20sent');})['catch'](function(_0x172663){return logger['error'](_0xb5d4('0x2a'),JSON[_0xb5d4('0x20')](_0x172663));});}};}function handleError(){return function(_0x2c948e){return logger[_0xb5d4('0x29')](JSON[_0xb5d4('0x20')](_0x2c948e));};}function handleResult(_0x617e2d){return function(_0x4284d5){logger[_0xb5d4('0x9')](_0xb5d4('0x2b'),JSON[_0xb5d4('0x20')](_0x4284d5));if(_0x617e2d[_0xb5d4('0xc')]&&_0x617e2d[_0xb5d4('0xc')][_0xb5d4('0x10')]&&!_[_0xb5d4('0x2c')](_0x617e2d[_0xb5d4('0xb')])){setTimeout(handleSendEmail(_0x617e2d,_0x4284d5),0x3c*0x3e8);}};}function handleJob(_0x4adec2){return function(){try{if(_[_0xb5d4('0x2c')](_0x4adec2[_0xb5d4('0x15')])){return logger[_0xb5d4('0x9')](_0xb5d4('0x2d'));}if(_[_0xb5d4('0x2c')](_0x4adec2[_0xb5d4('0x2e')])){return logger['info'](_0xb5d4('0x2f'));}var _0xdfae36={'startDate':moment()[_0xb5d4('0x30')](_0x4adec2[_0xb5d4('0x15')],_0x4adec2[_0xb5d4('0x2e')])[_0xb5d4('0x13')](_0xb5d4('0x31')),'endDate':moment()[_0xb5d4('0x13')](_0xb5d4('0x31')),'type':_0xb5d4('0x32'),'output':_0x4adec2[_0xb5d4('0x33')],'name':_0x4adec2[_0xb5d4('0xf')]};if(!_['isNil'](_0x4adec2[_0xb5d4('0x34')])){logger[_0xb5d4('0x9')](_0xb5d4('0x35'),_0x4adec2['DefaultReportId']);return analyticDefaultReportController[_0xb5d4('0x36')]({'id':_0x4adec2[_0xb5d4('0x34')]},_0xdfae36)['then'](handleResult(_0x4adec2))['catch'](handleError());}if(!_[_0xb5d4('0x2c')](_0x4adec2['CustomReportId'])){logger[_0xb5d4('0x9')](_0xb5d4('0x37'),_0x4adec2[_0xb5d4('0x38')]);return analyticCustomReportController[_0xb5d4('0x36')]({'id':_0x4adec2[_0xb5d4('0x38')]},_0xdfae36)[_0xb5d4('0x28')](handleResult(_0x4adec2))[_0xb5d4('0x39')](handleError());}}catch(_0x810858){logger[_0xb5d4('0x29')](JSON[_0xb5d4('0x20')](_0x810858));}return logger[_0xb5d4('0x9')](_0xb5d4('0x3a'));};}function getJobs(_0x5f3907){var _0x35e5ad={};if(_0x5f3907){_0x35e5ad['id']=_0x5f3907;}return db[_0xb5d4('0x3b')]['findAll']({'where':_0x35e5ad,'include':[{'model':db['MailAccount'],'attributes':['id',_0xb5d4('0xf'),_0xb5d4('0xb')],'include':[{'model':db[_0xb5d4('0x3c')],'as':_0xb5d4('0x10'),'include':[{'model':db[_0xb5d4('0x3d')],'as':_0xb5d4('0x3d')}]}]}]})[_0xb5d4('0x28')](function(_0x2f05c9){var _0x2915ab=_[_0xb5d4('0x3e')](manager['jobs']);var _0x45464d=_[_0xb5d4('0x3f')](_0x2f05c9,function(_0x3f016e){return _0x3f016e['id'][_0xb5d4('0x40')]();});var _0xa7be02=_[_0xb5d4('0x41')](_0x2f05c9,function(_0x4795f1){return _0x4795f1['id'][_0xb5d4('0x40')]();});var _0x6d757a=_0x5f3907?_0x45464d:_[_0xb5d4('0x42')](_0x45464d,_0x2915ab);var _0x372ea3=_[_0xb5d4('0x43')](_0x45464d,_0x2915ab);var _0x1a6199=_[_0xb5d4('0x42')](_0x2915ab,_0x45464d);var _0x9eeca6;var _0x2dc308;for(_0x9eeca6=0x0;_0x9eeca6<_0x1a6199[_0xb5d4('0x44')]&&!_0x5f3907;_0x9eeca6+=0x1){_0x2dc308=_0x1a6199[_0x9eeca6][_0xb5d4('0x40')]();if(manager['exists'](_0x2dc308)){manager[_0xb5d4('0x45')](_0x2dc308);manager[_0xb5d4('0x46')](_0x2dc308);logger[_0xb5d4('0x9')]('delete\x20cron',_0x2dc308);}}logger[_0xb5d4('0x9')](_0xb5d4('0x47'),JSON['stringify'](_0x6d757a));for(_0x9eeca6=0x0;_0x9eeca6<_0x6d757a[_0xb5d4('0x44')];_0x9eeca6+=0x1){_0x2dc308=_0x6d757a[_0x9eeca6][_0xb5d4('0x40')]();logger[_0xb5d4('0x9')](_0xb5d4('0x48'),_0x2dc308);if(_0x5f3907){logger[_0xb5d4('0x9')](_0xb5d4('0x49'),_0x5f3907);logger[_0xb5d4('0x9')](JSON[_0xb5d4('0x20')](_0xa7be02[_0x2dc308]));BPromise['resolve']()[_0xb5d4('0x28')](handleJob(_0xa7be02[_0x2dc308]));logger['info'](_0xb5d4('0x4a'),_0xa7be02[_0x2dc308]['name'],_0xa7be02[_0x2dc308][_0xb5d4('0x4b')]);}else if(_0xa7be02[_0x2dc308][_0xb5d4('0x4b')]&&_0xa7be02[_0x2dc308][_0xb5d4('0x4c')]&&moment()[_0xb5d4('0x4d')](_0xa7be02[_0x2dc308][_0xb5d4('0x4e')],_0xa7be02[_0x2dc308][_0xb5d4('0x4f')])){manager[_0xb5d4('0x50')](_0x2dc308,_0xa7be02[_0x2dc308][_0xb5d4('0x4b')],handleJob(_0xa7be02[_0x2dc308]));manager[_0xb5d4('0x51')](_0x2dc308);logger[_0xb5d4('0x9')](_0xb5d4('0x52'),_0xa7be02[_0x2dc308][_0xb5d4('0xf')],_0xa7be02[_0x2dc308][_0xb5d4('0x4b')]);}else if(manager['exists'](_0x2dc308)){manager[_0xb5d4('0x45')](_0x2dc308);manager[_0xb5d4('0x46')](_0x2dc308);logger[_0xb5d4('0x9')](_0xb5d4('0x53'),_0xa7be02[_0x2dc308]['name'],_0xa7be02[_0x2dc308][_0xb5d4('0x4b')]);}}for(_0x9eeca6=0x0,_0x2dc308;_0x9eeca6<_0x372ea3['length']&&!_0x5f3907;_0x9eeca6+=0x1){_0x2dc308=_0x372ea3[_0x9eeca6][_0xb5d4('0x40')]();if(manager['exists'](_0x2dc308)){if(_0xa7be02[_0x2dc308]['cron']&&_0xa7be02[_0x2dc308]['active']&&moment()[_0xb5d4('0x4d')](_0xa7be02[_0x2dc308][_0xb5d4('0x4e')],_0xa7be02[_0x2dc308][_0xb5d4('0x4f')])){manager['update'](_0x2dc308,_0xa7be02[_0x2dc308][_0xb5d4('0x4b')],handleJob(_0xa7be02[_0x2dc308]));logger['info'](_0xb5d4('0x54'),_0xa7be02[_0x2dc308][_0xb5d4('0xf')],_0xa7be02[_0x2dc308]['cron']);}else{manager[_0xb5d4('0x45')](_0x2dc308);manager['deleteJob'](_0x2dc308);logger[_0xb5d4('0x9')](_0xb5d4('0x53'),_0xa7be02[_0x2dc308][_0xb5d4('0xf')],_0xa7be02[_0x2dc308]['cron']);}}}})['catch'](function(_0x30b99a){logger[_0xb5d4('0x29')](JSON[_0xb5d4('0x20')](_0x30b99a));});}exports['run']=function(_0x209abe){return getJobs(_0x209abe);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x0e13=['YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','then','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','jobs','map','keyBy','toString','difference','intersection','exists','stop','delete\x20cron','toRun','length','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','update','deleteJob','run','util','path','moment','cron-job-manager','jayson/promise','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','getSmtpOptions','\x22%s\x22\x20<%s>','MailAccount','name','Smtp','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','../../files/reports','savename','%s.%s','extname','join','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','status','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','stringify','email\x20sent','catch','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined'];(function(_0x3d2e4b,_0x1f6653){var _0x509e78=function(_0x307037){while(--_0x307037){_0x3d2e4b['push'](_0x3d2e4b['shift']());}};_0x509e78(++_0x1f6653);}(_0x0e13,0x123));var _0x30e1=function(_0x3074f3,_0x4f2c03){_0x3074f3=_0x3074f3-0x0;var _0x53f112=_0x0e13[_0x3074f3];return _0x53f112;};'use strict';var fs=require('fs');var util=require(_0x30e1('0x0'));var path=require(_0x30e1('0x1'));var _=require('lodash');var moment=require(_0x30e1('0x2'));var CronJobManager=require(_0x30e1('0x3'));var jayson=require(_0x30e1('0x4'));var BPromise=require('bluebird');var logger=require(_0x30e1('0x5'))('schedule');var db=require(_0x30e1('0x6'))['db'];var analyticCustomReportController=require(_0x30e1('0x7'));var analyticDefaultReportController=require(_0x30e1('0x8'));var client=jayson[_0x30e1('0x9')][_0x30e1('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xf8d625,_0x169a13){return function(){logger[_0x30e1('0xb')]('Try\x20to\x20send\x20a\x20mail\x20to',_0xf8d625[_0x30e1('0xc')]);var _0x2aff70=!![];var _0x3c35ac=_0xf8d625['MailAccount'][_0x30e1('0xd')]();var _0x2a384f={'account':_0x3c35ac,'message':{'from':util['format'](_0x30e1('0xe'),_0xf8d625[_0x30e1('0xf')][_0x30e1('0x10')],_0xf8d625[_0x30e1('0xf')][_0x30e1('0xc')]||_0xf8d625[_0x30e1('0xf')][_0x30e1('0x11')]['user']),'to':_0xf8d625[_0x30e1('0xc')],'cc':_0xf8d625['cc'],'bcc':_0xf8d625[_0x30e1('0x12')],'subject':util[_0x30e1('0x13')](_0x30e1('0x14'),_0x169a13[_0x30e1('0x10')],_0xf8d625[_0x30e1('0x15')],_0xf8d625[_0x30e1('0x16')])}};var _0x5d4c60=path['join'](__dirname,_0x30e1('0x17'));var _0x26ae5c=_0x169a13[_0x30e1('0x18')];var _0x43eba5=util[_0x30e1('0x13')](_0x30e1('0x19'),path['basename'](_0x169a13[_0x30e1('0x18')],path[_0x30e1('0x1a')](_0x169a13['savename'])),'zip');var _0x93fce1=path[_0x30e1('0x1b')](_0x5d4c60,_0x26ae5c);var _0x14f901=path[_0x30e1('0x1b')](_0x5d4c60,_0x43eba5);if(fs['existsSync'](_0x93fce1)){_0x169a13['status']=_0x30e1('0x1c');_0x2a384f[_0x30e1('0x1d')]['attachments']=[{'filename':_0x26ae5c,'path':_0x93fce1}];_0x2a384f[_0x30e1('0x1d')][_0x30e1('0x1e')]=util[_0x30e1('0x13')](_0x30e1('0x1f'),JSON['stringify'](_0x169a13,null,0x2));}else if(fs['existsSync'](_0x14f901)){_0x169a13[_0x30e1('0x20')]='Sent';_0x2a384f['message']['attachments']=[{'filename':_0x43eba5,'path':_0x14f901}];}else{_0x2a384f[_0x30e1('0x1d')][_0x30e1('0x1e')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0xf8d625[_0x30e1('0x21')]){_0x2aff70=![];logger[_0x30e1('0xb')](_0x30e1('0x22'));}}if(_0x2aff70){return client[_0x30e1('0x23')](_0x30e1('0x24'),_0x2a384f)['then'](function(_0x42f73a){if(_0x42f73a[_0x30e1('0x25')]){return logger[_0x30e1('0x25')](_0x30e1('0x26'),JSON[_0x30e1('0x27')](_0x42f73a));}return logger[_0x30e1('0xb')](_0x30e1('0x28'));})[_0x30e1('0x29')](function(_0x5aeb4f){return logger[_0x30e1('0x25')](_0x30e1('0x26'),JSON[_0x30e1('0x27')](_0x5aeb4f));});}};}function handleError(){return function(_0x23962c){return logger[_0x30e1('0x25')](JSON[_0x30e1('0x27')](_0x23962c));};}function handleResult(_0x5330b7){return function(_0x5b466c){logger[_0x30e1('0xb')]('data',JSON[_0x30e1('0x27')](_0x5b466c));if(_0x5330b7[_0x30e1('0xf')]&&_0x5330b7['MailAccount']['Smtp']&&!_['isNil'](_0x5330b7[_0x30e1('0xc')])){setTimeout(handleSendEmail(_0x5330b7,_0x5b466c),0x3c*0x3e8);}};}function handleJob(_0x535c6e){return function(){try{if(_[_0x30e1('0x2a')](_0x535c6e[_0x30e1('0x15')])){return logger[_0x30e1('0xb')](_0x30e1('0x2b'));}if(_[_0x30e1('0x2a')](_0x535c6e['subtractUnit'])){return logger['info'](_0x30e1('0x2c'));}var _0x171fa8={'startDate':moment()['subtract'](_0x535c6e[_0x30e1('0x15')],_0x535c6e[_0x30e1('0x16')])[_0x30e1('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x30e1('0x13')](_0x30e1('0x2d')),'type':_0x30e1('0x2e'),'output':_0x535c6e[_0x30e1('0x2f')],'name':_0x535c6e[_0x30e1('0x10')]};if(!_['isNil'](_0x535c6e['DefaultReportId'])){logger[_0x30e1('0xb')](_0x30e1('0x30'),_0x535c6e[_0x30e1('0x31')]);return analyticDefaultReportController[_0x30e1('0x32')]({'id':_0x535c6e[_0x30e1('0x31')]},_0x171fa8)[_0x30e1('0x33')](handleResult(_0x535c6e))['catch'](handleError());}if(!_[_0x30e1('0x2a')](_0x535c6e[_0x30e1('0x34')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x535c6e[_0x30e1('0x34')]);return analyticCustomReportController['runReport']({'id':_0x535c6e[_0x30e1('0x34')]},_0x171fa8)[_0x30e1('0x33')](handleResult(_0x535c6e))['catch'](handleError());}}catch(_0x3e1b52){logger[_0x30e1('0x25')](JSON['stringify'](_0x3e1b52));}return logger[_0x30e1('0xb')](_0x30e1('0x35'));};}function getJobs(_0x14d883){var _0xb26bae={};if(_0x14d883){_0xb26bae['id']=_0x14d883;}return db[_0x30e1('0x36')][_0x30e1('0x37')]({'where':_0xb26bae,'include':[{'model':db[_0x30e1('0xf')],'attributes':['id',_0x30e1('0x10'),'email'],'include':[{'model':db[_0x30e1('0x38')],'as':'Smtp','include':[{'model':db[_0x30e1('0x39')],'as':_0x30e1('0x39')}]}]}]})[_0x30e1('0x33')](function(_0x4833a5){var _0x4d9af0=_['keys'](manager[_0x30e1('0x3a')]);var _0x1bb35d=_[_0x30e1('0x3b')](_0x4833a5,function(_0x4d4811){return _0x4d4811['id']['toString']();});var _0x43919f=_[_0x30e1('0x3c')](_0x4833a5,function(_0x549528){return _0x549528['id'][_0x30e1('0x3d')]();});var _0x36df1c=_0x14d883?_0x1bb35d:_[_0x30e1('0x3e')](_0x1bb35d,_0x4d9af0);var _0x1e23ee=_[_0x30e1('0x3f')](_0x1bb35d,_0x4d9af0);var _0x492ce1=_[_0x30e1('0x3e')](_0x4d9af0,_0x1bb35d);var _0x7d0645;var _0x40cefd;for(_0x7d0645=0x0;_0x7d0645<_0x492ce1['length']&&!_0x14d883;_0x7d0645+=0x1){_0x40cefd=_0x492ce1[_0x7d0645][_0x30e1('0x3d')]();if(manager[_0x30e1('0x40')](_0x40cefd)){manager[_0x30e1('0x41')](_0x40cefd);manager['deleteJob'](_0x40cefd);logger[_0x30e1('0xb')](_0x30e1('0x42'),_0x40cefd);}}logger['info'](_0x30e1('0x43'),JSON[_0x30e1('0x27')](_0x36df1c));for(_0x7d0645=0x0;_0x7d0645<_0x36df1c[_0x30e1('0x44')];_0x7d0645+=0x1){_0x40cefd=_0x36df1c[_0x7d0645]['toString']();logger[_0x30e1('0xb')]('index',_0x40cefd);if(_0x14d883){logger[_0x30e1('0xb')](_0x30e1('0x45'),_0x14d883);logger[_0x30e1('0xb')](JSON[_0x30e1('0x27')](_0x43919f[_0x40cefd]));BPromise[_0x30e1('0x46')]()['then'](handleJob(_0x43919f[_0x40cefd]));logger[_0x30e1('0xb')](_0x30e1('0x47'),_0x43919f[_0x40cefd][_0x30e1('0x10')],_0x43919f[_0x40cefd][_0x30e1('0x48')]);}else if(_0x43919f[_0x40cefd][_0x30e1('0x48')]&&_0x43919f[_0x40cefd][_0x30e1('0x49')]&&moment()[_0x30e1('0x4a')](_0x43919f[_0x40cefd][_0x30e1('0x4b')],_0x43919f[_0x40cefd][_0x30e1('0x4c')])){manager[_0x30e1('0x4d')](_0x40cefd,_0x43919f[_0x40cefd][_0x30e1('0x48')],handleJob(_0x43919f[_0x40cefd]));manager[_0x30e1('0x4e')](_0x40cefd);logger[_0x30e1('0xb')](_0x30e1('0x4f'),_0x43919f[_0x40cefd][_0x30e1('0x10')],_0x43919f[_0x40cefd]['cron']);}else if(manager['exists'](_0x40cefd)){manager[_0x30e1('0x41')](_0x40cefd);manager['deleteJob'](_0x40cefd);logger['info'](_0x30e1('0x50'),_0x43919f[_0x40cefd][_0x30e1('0x10')],_0x43919f[_0x40cefd][_0x30e1('0x48')]);}}for(_0x7d0645=0x0,_0x40cefd;_0x7d0645<_0x1e23ee[_0x30e1('0x44')]&&!_0x14d883;_0x7d0645+=0x1){_0x40cefd=_0x1e23ee[_0x7d0645][_0x30e1('0x3d')]();if(manager['exists'](_0x40cefd)){if(_0x43919f[_0x40cefd][_0x30e1('0x48')]&&_0x43919f[_0x40cefd][_0x30e1('0x49')]&&moment()['isBetween'](_0x43919f[_0x40cefd][_0x30e1('0x4b')],_0x43919f[_0x40cefd][_0x30e1('0x4c')])){manager[_0x30e1('0x51')](_0x40cefd,_0x43919f[_0x40cefd][_0x30e1('0x48')],handleJob(_0x43919f[_0x40cefd]));logger[_0x30e1('0xb')]('update\x20cron',_0x43919f[_0x40cefd][_0x30e1('0x10')],_0x43919f[_0x40cefd][_0x30e1('0x48')]);}else{manager[_0x30e1('0x41')](_0x40cefd);manager[_0x30e1('0x52')](_0x40cefd);logger[_0x30e1('0xb')](_0x30e1('0x50'),_0x43919f[_0x40cefd][_0x30e1('0x10')],_0x43919f[_0x40cefd]['cron']);}}}})[_0x30e1('0x29')](function(_0x3f652e){logger[_0x30e1('0x25')](JSON[_0x30e1('0x27')](_0x3f652e));});}exports[_0x30e1('0x53')]=function(_0x7f770){return getJobs(_0x7f770);};exports[_0x30e1('0x4e')]=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 9b34223..1bbf6c2 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 _0x06ef=['TranscriptFileUri','results','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','bucket','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','Positive','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','forEach','push','all','start','request-promise','transcribe','Comprehend','detectSentiment','substring','info','data1','data2','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','transcribeName','TranscriptionJob','fileText','TranscriptionJobStatus','COMPLETED','[RECORDING:%d]\x20Get\x20transcript','Transcript'];(function(_0x48e7dd,_0x2645d2){var _0x7fae77=function(_0x3eb7a8){while(--_0x3eb7a8){_0x48e7dd['push'](_0x48e7dd['shift']());}};_0x7fae77(++_0x2645d2);}(_0x06ef,0x185));var _0xf06e=function(_0x5f449e,_0x38e7a7){_0x5f449e=_0x5f449e-0x0;var _0xb4f6b2=_0x06ef[_0x5f449e];return _0xb4f6b2;};var _=require('lodash');var AWS=require('aws-sdk');var rp=require(_0xf06e('0x0'));var util=require('util');var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0xf06e('0x1'));function getTranscriptionJob(_0x1281ca,_0x16d4da,_0x569390,_0x1ddeff){return new Promise(function(_0x71a36,_0x4be428){var _0x59b74b=new AWS['TranscribeService']({'accessKeyId':_0x16d4da,'secretAccessKey':_0x1281ca,'region':_0x569390});_0x59b74b['getTranscriptionJob']({'TranscriptionJobName':_0x1ddeff},function(_0x4ccbee,_0x25b56e){if(_0x4ccbee){return _0x4be428(_0x4ccbee);}else{return _0x71a36(_0x25b56e);}});});}function sentiment(_0x3ee37d,_0x1e1ec5,_0x2bb08c,_0xbb0e3c,_0x5e594e){return new Promise(function(_0x1fe49b,_0x3a33c1){var _0x4e3591=new AWS[(_0xf06e('0x2'))]({'accessKeyId':_0x1e1ec5,'secretAccessKey':_0x3ee37d,'region':_0x2bb08c});_0x4e3591[_0xf06e('0x3')]({'Text':_0xbb0e3c,'LanguageCode':_0x5e594e[_0xf06e('0x4')](0x0,0x2)},function(_0x400af5,_0x39979a){if(_0x400af5){return _0x3a33c1(_0x400af5);}else{return _0x1fe49b(_0x39979a);}});});}function checkTranscribeJob(_0x7b4c4,_0x49fe5d,_0x3daa50){var _0x2578e4;return new BPromise(function(_0x5c36b3,_0x1510a0){logger[_0xf06e('0x5')](util['format']('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x7b4c4['id'],_0x7b4c4['transcribeName']));return getTranscriptionJob(_0x3daa50[_0xf06e('0x6')],_0x3daa50[_0xf06e('0x7')],_0x49fe5d[_0xf06e('0x8')],_0x7b4c4['transcribeName'])[_0xf06e('0x9')](function(_0x375f90){logger[_0xf06e('0x5')](util[_0xf06e('0xa')](_0xf06e('0xb'),_0x7b4c4['id'],_0x7b4c4[_0xf06e('0xc')],_0x375f90[_0xf06e('0xd')]['TranscriptionJobStatus']));if(!_0x7b4c4[_0xf06e('0xe')]){switch(_0x375f90[_0xf06e('0xd')][_0xf06e('0xf')]){case _0xf06e('0x10'):var _0x5c1a80={'transcribeStatus':_0x375f90['TranscriptionJob'][_0xf06e('0xf')],'fileUri':_0x375f90[_0xf06e('0xd')]['Transcript']['TranscriptFileUri']};logger[_0xf06e('0x5')](util[_0xf06e('0xa')](_0xf06e('0x11'),_0x7b4c4['id']));return rp({'uri':_0x375f90['TranscriptionJob'][_0xf06e('0x12')][_0xf06e('0x13')],'json':!![]})['then'](function(_0x3c3796){logger[_0xf06e('0x5')](util[_0xf06e('0xa')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x7b4c4['id']));if(_0x3c3796&&_0x3c3796[_0xf06e('0x14')]&&_0x3c3796[_0xf06e('0x14')][_0xf06e('0x15')]&&_0x3c3796[_0xf06e('0x14')][_0xf06e('0x15')]['length']){_0x5c1a80[_0xf06e('0xe')]='';for(var _0x4923d3=0x0;_0x4923d3<_0x3c3796[_0xf06e('0x14')][_0xf06e('0x15')][_0xf06e('0x16')];_0x4923d3++){_0x5c1a80[_0xf06e('0xe')]+=_0x3c3796[_0xf06e('0x14')][_0xf06e('0x15')][_0x4923d3]['transcript']+'';}}return _0x7b4c4[_0xf06e('0x17')](_0x5c1a80);})[_0xf06e('0x9')](function(){logger[_0xf06e('0x5')](util[_0xf06e('0xa')](_0xf06e('0x18'),_0x7b4c4['id']));if(!_0x7b4c4['tempSentiment']){throw new db[(_0xf06e('0x19'))][(_0xf06e('0x1a'))](_0xf06e('0x1b'));}if(!_0x49fe5d[_0xf06e('0x1c')]||!_0x49fe5d[_0xf06e('0x1d')]||!_0x49fe5d[_0xf06e('0x1e')]||!_0x49fe5d['language']||!_0x49fe5d[_0xf06e('0x1f')]){throw new db[(_0xf06e('0x19'))][(_0xf06e('0x1a'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x5c1a80[_0xf06e('0xe')]){throw new Error(_0xf06e('0x20'));}if(_0x49fe5d[_0xf06e('0x1d')]===_0x3daa50['id']){return _0x3daa50;}else{return db[_0xf06e('0x21')][_0xf06e('0x22')]({'where':{'id':_settings[_0xf06e('0x1d')]}});}})[_0xf06e('0x9')](function(_0x2c19a5){if(!_0x2c19a5){throw new db[(_0xf06e('0x19'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x2c19a5[_0xf06e('0x6')]||!_0x2c19a5[_0xf06e('0x7')]){throw new db['Sequelize'][(_0xf06e('0x1a'))](_0xf06e('0x23'));}_0x2578e4=_0x2c19a5;logger[_0xf06e('0x5')](util[_0xf06e('0xa')](_0xf06e('0x24'),_0x7b4c4['id']));return sentiment(_0x2578e4[_0xf06e('0x6')],_0x2578e4['data2'],_0x49fe5d[_0xf06e('0x1e')],_0x5c1a80[_0xf06e('0xe')],_0x49fe5d[_0xf06e('0x25')]);})['then'](function(_0x109218){logger[_0xf06e('0x5')](util[_0xf06e('0xa')](_0xf06e('0x26'),_0x7b4c4['id']));return _0x7b4c4[_0xf06e('0x17')]({'sentiment':_0x109218[_0xf06e('0x27')],'sPositive':_0x109218[_0xf06e('0x28')]['Positive'],'sNegative':_0x109218['SentimentScore'][_0xf06e('0x29')],'sMixed':_0x109218['SentimentScore'][_0xf06e('0x2a')],'sNeutral':_0x109218['SentimentScore'][_0xf06e('0x2b')]});})['then'](function(){logger[_0xf06e('0x5')](util[_0xf06e('0xa')](_0xf06e('0x18'),_0x7b4c4['id']));_0x5c36b3();});case _0xf06e('0x2c'):return _0x7b4c4[_0xf06e('0x17')]({'transcribeStatus':_0xf06e('0x2c'),'failureReason':_0x375f90['TranscriptionJob'][_0xf06e('0x2d')]})[_0xf06e('0x9')](function(){logger[_0xf06e('0x5')](util[_0xf06e('0xa')](_0xf06e('0x18'),_0x7b4c4['id']));_0x5c36b3();});default:logger[_0xf06e('0x5')](util[_0xf06e('0xa')](_0xf06e('0x2e'),_0x7b4c4['id']));break;}}else{return BPromise[_0xf06e('0x2f')]()[_0xf06e('0x9')](function(){if(!_0x7b4c4[_0xf06e('0x30')]){throw new db['Sequelize'][(_0xf06e('0x1a'))](_0xf06e('0x1b'));}if(!_0x49fe5d[_0xf06e('0x1c')]||!_0x49fe5d[_0xf06e('0x1d')]||!_0x49fe5d[_0xf06e('0x1e')]||!_0x49fe5d[_0xf06e('0x25')]||!_0x49fe5d[_0xf06e('0x1f')]){throw new db['Sequelize'][(_0xf06e('0x1a'))](_0xf06e('0x31'));}if(!_0x7b4c4['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x49fe5d[_0xf06e('0x1d')]===_0x3daa50['id']){return _0x3daa50;}else{return db[_0xf06e('0x21')][_0xf06e('0x22')]({'where':{'id':_settings[_0xf06e('0x1d')]}});}})[_0xf06e('0x9')](function(_0x410772){if(!_0x410772){throw new db['Sequelize']['ValidationError'](_0xf06e('0x32'));}if(!_0x410772['data1']||!_0x410772['data2']){throw new db['Sequelize'][(_0xf06e('0x1a'))](_0xf06e('0x23'));}_0x2578e4=_0x410772;logger['info'](util['format'](_0xf06e('0x24'),_0x7b4c4['id']));return sentiment(_0x2578e4[_0xf06e('0x6')],_0x2578e4['data2'],_0x49fe5d[_0xf06e('0x1e')],_0x7b4c4['fileText'],_0x49fe5d[_0xf06e('0x25')]);})[_0xf06e('0x9')](function(_0x41da27){logger[_0xf06e('0x5')](util['format'](_0xf06e('0x26'),_0x7b4c4['id']));return _0x7b4c4[_0xf06e('0x17')]({'sentiment':_0x41da27['Sentiment'],'sPositive':_0x41da27[_0xf06e('0x28')][_0xf06e('0x33')],'sNegative':_0x41da27[_0xf06e('0x28')][_0xf06e('0x29')],'sMixed':_0x41da27[_0xf06e('0x28')][_0xf06e('0x2a')],'sNeutral':_0x41da27[_0xf06e('0x28')][_0xf06e('0x2b')],'transcribeStatus':_0xf06e('0x10')});})[_0xf06e('0x9')](function(){logger[_0xf06e('0x5')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x7b4c4['id']));_0x5c36b3();});}})[_0xf06e('0x34')](function(_0x542b79){if(_0x542b79){if(!_0x542b79['name']||_0x542b79[_0xf06e('0x35')]!==_0xf06e('0x36')){logger[_0xf06e('0x37')](util[_0xf06e('0xa')](_0xf06e('0x38'),_0x7b4c4['id']),util[_0xf06e('0x39')](_0x542b79,{'showHidden':![],'depth':null}));}}_0x5c36b3();});});}function checkTranscribe(){var _0x195524;var _0x252629;var _0x4f7ce2;return db[_0xf06e('0x3a')][_0xf06e('0x3b')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xf06e('0x9')](function(_0x92394a){if(!_0x92394a||!_0x92394a[_0xf06e('0x16')]){throw new db['Sequelize']['ValidationError'](_0xf06e('0x3c'));}_0x195524=_0x92394a;return db[_0xf06e('0x3d')][_0xf06e('0x22')]({'where':{'id':0x1}});})['then'](function(_0x9ec791){if(!_0x9ec791){throw new db[(_0xf06e('0x19'))][(_0xf06e('0x1a'))](_0xf06e('0x3e'));}_0x252629=_0x9ec791;if(!_0x252629['transcribe']||!_0x252629['transcribeAccountId']||!_0x252629[_0xf06e('0x8')]||!_0x252629['language']||!_0x252629['bucket']){throw new db[(_0xf06e('0x19'))]['ValidationError']('Transcribe\x20not\x20configured');}return db[_0xf06e('0x21')][_0xf06e('0x22')]({'where':{'id':_0x252629[_0xf06e('0x3f')]}});})[_0xf06e('0x9')](function(_0x4aca1){if(!_0x4aca1){throw new db[(_0xf06e('0x19'))][(_0xf06e('0x1a'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x4aca1[_0xf06e('0x6')]||!_0x4aca1['data2']){throw new db[(_0xf06e('0x19'))]['ValidationError'](_0xf06e('0x23'));}_0x4f7ce2=_0x4aca1;var _0x1fe197=[];_0x195524[_0xf06e('0x40')](function(_0x2ca097){_0x1fe197[_0xf06e('0x41')](checkTranscribeJob(_0x2ca097,_0x252629,_0x4f7ce2));});return BPromise[_0xf06e('0x42')](_0x1fe197);})['catch'](function(_0x18b037){if(_0x18b037){if(!_0x18b037[_0xf06e('0x35')]||_0x18b037['name']!=='SequelizeValidationError'){logger['error'](util['inspect'](_0x18b037,{'showHidden':![],'depth':null}));}}});}exports[_0xf06e('0x43')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xa249=['Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','bucket','catch','name','SequelizeValidationError','error','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribe','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','forEach','push','inspect','start','lodash','aws-sdk','util','bluebird','../../config/logger','TranscribeService','getTranscriptionJob','detectSentiment','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available'];(function(_0x5d280c,_0x228eec){var _0x2dc2ac=function(_0x40a109){while(--_0x40a109){_0x5d280c['push'](_0x5d280c['shift']());}};_0x2dc2ac(++_0x228eec);}(_0xa249,0x183));var _0x9a24=function(_0x3c9ceb,_0x58f2c5){_0x3c9ceb=_0x3c9ceb-0x0;var _0x160c35=_0xa249[_0x3c9ceb];return _0x160c35;};var _=require(_0x9a24('0x0'));var AWS=require(_0x9a24('0x1'));var rp=require('request-promise');var util=require(_0x9a24('0x2'));var BPromise=require(_0x9a24('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x9a24('0x4'))('transcribe');function getTranscriptionJob(_0x3f83df,_0x48c56d,_0x558c9a,_0x5c2f56){return new Promise(function(_0x1b0728,_0x167980){var _0x3f59a1=new AWS[(_0x9a24('0x5'))]({'accessKeyId':_0x48c56d,'secretAccessKey':_0x3f83df,'region':_0x558c9a});_0x3f59a1[_0x9a24('0x6')]({'TranscriptionJobName':_0x5c2f56},function(_0x22f220,_0x13875f){if(_0x22f220){return _0x167980(_0x22f220);}else{return _0x1b0728(_0x13875f);}});});}function sentiment(_0x625ec3,_0x412da3,_0x1cb8aa,_0x543676,_0x510b29){return new Promise(function(_0x1cd07a,_0x1db2e0){var _0x885cac=new AWS['Comprehend']({'accessKeyId':_0x412da3,'secretAccessKey':_0x625ec3,'region':_0x1cb8aa});_0x885cac[_0x9a24('0x7')]({'Text':_0x543676,'LanguageCode':_0x510b29['substring'](0x0,0x2)},function(_0x2dc0a3,_0x5c2014){if(_0x2dc0a3){return _0x1db2e0(_0x2dc0a3);}else{return _0x1cd07a(_0x5c2014);}});});}function checkTranscribeJob(_0x4096cd,_0xf809b7,_0x3d278b){var _0x41f522;return new BPromise(function(_0x2ddaa8,_0x4f1017){logger[_0x9a24('0x8')](util[_0x9a24('0x9')](_0x9a24('0xa'),_0x4096cd['id'],_0x4096cd[_0x9a24('0xb')]));return getTranscriptionJob(_0x3d278b[_0x9a24('0xc')],_0x3d278b['data2'],_0xf809b7['transcribeRegion'],_0x4096cd[_0x9a24('0xb')])[_0x9a24('0xd')](function(_0x25202f){logger['info'](util[_0x9a24('0x9')](_0x9a24('0xe'),_0x4096cd['id'],_0x4096cd[_0x9a24('0xb')],_0x25202f[_0x9a24('0xf')][_0x9a24('0x10')]));if(!_0x4096cd[_0x9a24('0x11')]){switch(_0x25202f[_0x9a24('0xf')][_0x9a24('0x10')]){case _0x9a24('0x12'):var _0x2a38cf={'transcribeStatus':_0x25202f[_0x9a24('0xf')][_0x9a24('0x10')],'fileUri':_0x25202f['TranscriptionJob'][_0x9a24('0x13')]['TranscriptFileUri']};logger['info'](util['format'](_0x9a24('0x14'),_0x4096cd['id']));return rp({'uri':_0x25202f[_0x9a24('0xf')]['Transcript'][_0x9a24('0x15')],'json':!![]})[_0x9a24('0xd')](function(_0x69d2e9){logger[_0x9a24('0x8')](util[_0x9a24('0x9')](_0x9a24('0x16'),_0x4096cd['id']));if(_0x69d2e9&&_0x69d2e9[_0x9a24('0x17')]&&_0x69d2e9[_0x9a24('0x17')][_0x9a24('0x18')]&&_0x69d2e9['results'][_0x9a24('0x18')][_0x9a24('0x19')]){_0x2a38cf[_0x9a24('0x11')]='';for(var _0x5e8c24=0x0;_0x5e8c24<_0x69d2e9[_0x9a24('0x17')]['transcripts'][_0x9a24('0x19')];_0x5e8c24++){_0x2a38cf[_0x9a24('0x11')]+=_0x69d2e9[_0x9a24('0x17')]['transcripts'][_0x5e8c24][_0x9a24('0x1a')]+'';}}return _0x4096cd[_0x9a24('0x1b')](_0x2a38cf);})[_0x9a24('0xd')](function(){logger[_0x9a24('0x8')](util[_0x9a24('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4096cd['id']));if(!_0x4096cd[_0x9a24('0x1c')]){throw new db['Sequelize'][(_0x9a24('0x1d'))](_0x9a24('0x1e'));}if(!_0xf809b7[_0x9a24('0x1f')]||!_0xf809b7[_0x9a24('0x20')]||!_0xf809b7[_0x9a24('0x21')]||!_0xf809b7['language']||!_0xf809b7['bucket']){throw new db[(_0x9a24('0x22'))][(_0x9a24('0x1d'))](_0x9a24('0x23'));}if(!_0x2a38cf[_0x9a24('0x11')]){throw new Error(_0x9a24('0x24'));}if(_0xf809b7[_0x9a24('0x20')]===_0x3d278b['id']){return _0x3d278b;}else{return db[_0x9a24('0x25')][_0x9a24('0x26')]({'where':{'id':_settings[_0x9a24('0x20')]}});}})[_0x9a24('0xd')](function(_0x279838){if(!_0x279838){throw new db[(_0x9a24('0x22'))]['ValidationError'](_0x9a24('0x27'));}if(!_0x279838[_0x9a24('0xc')]||!_0x279838[_0x9a24('0x28')]){throw new db['Sequelize']['ValidationError'](_0x9a24('0x29'));}_0x41f522=_0x279838;logger[_0x9a24('0x8')](util[_0x9a24('0x9')](_0x9a24('0x2a'),_0x4096cd['id']));return sentiment(_0x41f522[_0x9a24('0xc')],_0x41f522['data2'],_0xf809b7[_0x9a24('0x21')],_0x2a38cf[_0x9a24('0x11')],_0xf809b7[_0x9a24('0x2b')]);})[_0x9a24('0xd')](function(_0x410e78){logger[_0x9a24('0x8')](util[_0x9a24('0x9')](_0x9a24('0x2c'),_0x4096cd['id']));return _0x4096cd[_0x9a24('0x1b')]({'sentiment':_0x410e78[_0x9a24('0x2d')],'sPositive':_0x410e78[_0x9a24('0x2e')][_0x9a24('0x2f')],'sNegative':_0x410e78['SentimentScore'][_0x9a24('0x30')],'sMixed':_0x410e78[_0x9a24('0x2e')][_0x9a24('0x31')],'sNeutral':_0x410e78[_0x9a24('0x2e')][_0x9a24('0x32')]});})[_0x9a24('0xd')](function(){logger[_0x9a24('0x8')](util[_0x9a24('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4096cd['id']));_0x2ddaa8();});case _0x9a24('0x33'):return _0x4096cd[_0x9a24('0x1b')]({'transcribeStatus':'FAILED','failureReason':_0x25202f['TranscriptionJob']['FailureReason']})['then'](function(){logger['info'](util['format'](_0x9a24('0x34'),_0x4096cd['id']));_0x2ddaa8();});default:logger['info'](util['format'](_0x9a24('0x35'),_0x4096cd['id']));break;}}else{return BPromise['resolve']()[_0x9a24('0xd')](function(){if(!_0x4096cd[_0x9a24('0x1c')]){throw new db[(_0x9a24('0x22'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0xf809b7[_0x9a24('0x1f')]||!_0xf809b7[_0x9a24('0x20')]||!_0xf809b7[_0x9a24('0x21')]||!_0xf809b7[_0x9a24('0x2b')]||!_0xf809b7[_0x9a24('0x36')]){throw new db[(_0x9a24('0x22'))]['ValidationError'](_0x9a24('0x23'));}if(!_0x4096cd[_0x9a24('0x11')]){throw new Error('Transcript\x20not\x20available');}if(_0xf809b7[_0x9a24('0x20')]===_0x3d278b['id']){return _0x3d278b;}else{return db[_0x9a24('0x25')]['findOne']({'where':{'id':_settings[_0x9a24('0x20')]}});}})[_0x9a24('0xd')](function(_0xad9de4){if(!_0xad9de4){throw new db[(_0x9a24('0x22'))]['ValidationError'](_0x9a24('0x27'));}if(!_0xad9de4[_0x9a24('0xc')]||!_0xad9de4[_0x9a24('0x28')]){throw new db[(_0x9a24('0x22'))]['ValidationError'](_0x9a24('0x29'));}_0x41f522=_0xad9de4;logger[_0x9a24('0x8')](util[_0x9a24('0x9')](_0x9a24('0x2a'),_0x4096cd['id']));return sentiment(_0x41f522[_0x9a24('0xc')],_0x41f522['data2'],_0xf809b7[_0x9a24('0x21')],_0x4096cd['fileText'],_0xf809b7[_0x9a24('0x2b')]);})['then'](function(_0x257ee4){logger[_0x9a24('0x8')](util[_0x9a24('0x9')](_0x9a24('0x2c'),_0x4096cd['id']));return _0x4096cd[_0x9a24('0x1b')]({'sentiment':_0x257ee4[_0x9a24('0x2d')],'sPositive':_0x257ee4[_0x9a24('0x2e')][_0x9a24('0x2f')],'sNegative':_0x257ee4['SentimentScore'][_0x9a24('0x30')],'sMixed':_0x257ee4[_0x9a24('0x2e')][_0x9a24('0x31')],'sNeutral':_0x257ee4['SentimentScore'][_0x9a24('0x32')],'transcribeStatus':_0x9a24('0x12')});})['then'](function(){logger[_0x9a24('0x8')](util[_0x9a24('0x9')](_0x9a24('0x34'),_0x4096cd['id']));_0x2ddaa8();});}})[_0x9a24('0x37')](function(_0x4bb05c){if(_0x4bb05c){if(!_0x4bb05c[_0x9a24('0x38')]||_0x4bb05c[_0x9a24('0x38')]!==_0x9a24('0x39')){logger[_0x9a24('0x3a')](util[_0x9a24('0x9')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x4096cd['id']),util['inspect'](_0x4bb05c,{'showHidden':![],'depth':null}));}}_0x2ddaa8();});});}function checkTranscribe(){var _0x35e16d;var _0x424802;var _0x107232;return db[_0x9a24('0x3b')][_0x9a24('0x3c')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x9a24('0xd')](function(_0x315fd9){if(!_0x315fd9||!_0x315fd9['length']){throw new db[(_0x9a24('0x22'))]['ValidationError'](_0x9a24('0x3d'));}_0x35e16d=_0x315fd9;return db[_0x9a24('0x3e')][_0x9a24('0x26')]({'where':{'id':0x1}});})['then'](function(_0x2328c3){if(!_0x2328c3){throw new db[(_0x9a24('0x22'))][(_0x9a24('0x1d'))](_0x9a24('0x3f'));}_0x424802=_0x2328c3;if(!_0x424802[_0x9a24('0x40')]||!_0x424802[_0x9a24('0x41')]||!_0x424802[_0x9a24('0x42')]||!_0x424802[_0x9a24('0x2b')]||!_0x424802['bucket']){throw new db[(_0x9a24('0x22'))]['ValidationError'](_0x9a24('0x43'));}return db[_0x9a24('0x25')][_0x9a24('0x26')]({'where':{'id':_0x424802[_0x9a24('0x41')]}});})[_0x9a24('0xd')](function(_0x5ce00b){if(!_0x5ce00b){throw new db['Sequelize']['ValidationError'](_0x9a24('0x27'));}if(!_0x5ce00b[_0x9a24('0xc')]||!_0x5ce00b[_0x9a24('0x28')]){throw new db[(_0x9a24('0x22'))]['ValidationError'](_0x9a24('0x29'));}_0x107232=_0x5ce00b;var _0x4f33e3=[];_0x35e16d[_0x9a24('0x44')](function(_0x4b14fe){_0x4f33e3[_0x9a24('0x45')](checkTranscribeJob(_0x4b14fe,_0x424802,_0x107232));});return BPromise['all'](_0x4f33e3);})[_0x9a24('0x37')](function(_0x1eedc7){if(_0x1eedc7){if(!_0x1eedc7['name']||_0x1eedc7[_0x9a24('0x38')]!==_0x9a24('0x39')){logger[_0x9a24('0x3a')](util[_0x9a24('0x46')](_0x1eedc7,{'showHidden':![],'depth':null}));}}});}exports[_0x9a24('0x47')]=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 6ebea82..42afbe7 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 _0xdcb9=['../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','lastMsgAt','hours','then','length','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','ioredis','util'];(function(_0x22d655,_0x3941dd){var _0x257739=function(_0x98136e){while(--_0x98136e){_0x22d655['push'](_0x22d655['shift']());}};_0x257739(++_0x3941dd);}(_0xdcb9,0xd5));var _0x9dcb=function(_0x28e2e5,_0x224d8a){_0x28e2e5=_0x28e2e5-0x0;var _0x3917b3=_0xdcb9[_0x28e2e5];return _0x3917b3;};'use strict';var _=require(_0x9dcb('0x0'));var moment=require('moment');var Redis=require(_0x9dcb('0x1'));var util=require(_0x9dcb('0x2'));var config=require(_0x9dcb('0x3'));var db=require(_0x9dcb('0x4'))['db'];var logger=require('../logger')('schedule');config[_0x9dcb('0x5')]=_[_0x9dcb('0x6')](config['redis'],{'host':_0x9dcb('0x7'),'port':0x18eb});var io=require(_0x9dcb('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x2889e1=[];return db[_0x9dcb('0x9')]['findAll']({'raw':!![],'attributes':['id',_0x9dcb('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x9dcb('0xb'))}}})[_0x9dcb('0xc')](function(_0x47e4aa){if(_0x47e4aa&&_0x47e4aa[_0x9dcb('0xd')]){_0x2889e1=_['map'](_0x47e4aa||[],'id');logger[_0x9dcb('0xe')](_0x9dcb('0xf'),_0x2889e1[_0x9dcb('0x10')]());return db['WhatsappInteraction'][_0x9dcb('0x11')]({'closeReason':_0x9dcb('0x12'),'disposition':_0x9dcb('0x13'),'closed':!![],'closedAt':moment()[_0x9dcb('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x2889e1}});}})['then'](function(){if(_0x2889e1&&_0x2889e1[_0x9dcb('0xd')]){logger[_0x9dcb('0xe')](_0x9dcb('0x15'),_0x2889e1[_0x9dcb('0x10')]());for(var _0x557736=0x0;_0x557736<_0x2889e1[_0x9dcb('0xd')];_0x557736++){io[_0x9dcb('0x16')](_0x9dcb('0x17'),{'id':_0x2889e1[_0x557736],'closed':!![]});}}})[_0x9dcb('0x18')](function(_0x390e8d){logger['error'](_0x9dcb('0x19'),_0x390e8d?util['inspect'](_0x390e8d,{'showHidden':![],'depth':null}):'');});}exports[_0x9dcb('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x96e8=['length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','subtract','hours','then'];(function(_0x7dbd65,_0x18da49){var _0x33d551=function(_0x7ce789){while(--_0x7ce789){_0x7dbd65['push'](_0x7dbd65['shift']());}};_0x33d551(++_0x18da49);}(_0x96e8,0x99));var _0x896e=function(_0x1617b3,_0xaaee1f){_0x1617b3=_0x1617b3-0x0;var _0x294065=_0x96e8[_0x1617b3];return _0x294065;};'use strict';var _=require(_0x896e('0x0'));var moment=require(_0x896e('0x1'));var Redis=require(_0x896e('0x2'));var util=require('util');var config=require('../../config/environment');var db=require(_0x896e('0x3'))['db'];var logger=require(_0x896e('0x4'))(_0x896e('0x5'));config[_0x896e('0x6')]=_[_0x896e('0x7')](config[_0x896e('0x6')],{'host':_0x896e('0x8'),'port':0x18eb});var io=require(_0x896e('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x29dac4=[];return db[_0x896e('0xa')][_0x896e('0xb')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x896e('0xc')](0x18,_0x896e('0xd'))}}})[_0x896e('0xe')](function(_0x3b4ed3){if(_0x3b4ed3&&_0x3b4ed3[_0x896e('0xf')]){_0x29dac4=_[_0x896e('0x10')](_0x3b4ed3||[],'id');logger['info'](_0x896e('0x11'),_0x29dac4[_0x896e('0x12')]());return db[_0x896e('0xa')][_0x896e('0x13')]({'closeReason':_0x896e('0x14'),'disposition':_0x896e('0x15'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x29dac4}});}})[_0x896e('0xe')](function(){if(_0x29dac4&&_0x29dac4[_0x896e('0xf')]){logger['info']('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x29dac4[_0x896e('0x12')]());for(var _0x3a4974=0x0;_0x3a4974<_0x29dac4[_0x896e('0xf')];_0x3a4974++){io[_0x896e('0x16')](_0x896e('0x17'),{'id':_0x29dac4[_0x3a4974],'closed':!![]});}}})[_0x896e('0x18')](function(_0x5b296e){logger[_0x896e('0x19')](_0x896e('0x1a'),_0x5b296e?util['inspect'](_0x5b296e,{'showHidden':![],'depth':null}):'');});}exports[_0x896e('0x1b')]=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 76eaf41..7b96877 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc531=['hopper1','util','../mysqldb','push','Innocenzo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate','finished\x20populating','CmHopper','log'];(function(_0x5af59e,_0x3771c1){var _0x4240df=function(_0x2267fd){while(--_0x2267fd){_0x5af59e['push'](_0x5af59e['shift']());}};_0x4240df(++_0x3771c1);}(_0xc531,0x100));var _0x1c53=function(_0x3d24ed,_0x180b04){_0x3d24ed=_0x3d24ed-0x0;var _0x19d5c0=_0xc531[_0x3d24ed];return _0x19d5c0;};'use strict';var util=require(_0x1c53('0x0'));var db=require(_0x1c53('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x1c53('0x2')]({'id':i,'firstName':_0x1c53('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x1c53('0x4')+i+_0x1c53('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x1c53('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x1c53('0x6')](),'updatedAt':Date[_0x1c53('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x1c53('0x2')]({'id':i,'firstName':_0x1c53('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x1c53('0x4')+i+_0x1c53('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x1c53('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x1c53('0x6')](),'updatedAt':Date[_0x1c53('0x6')]()});}db[_0x1c53('0x7')][_0x1c53('0x8')]({'where':{}})[_0x1c53('0x9')](function(){return db['CmContact'][_0x1c53('0xa')](contacts);})[_0x1c53('0x9')](function(){console['log'](_0x1c53('0xb'),'contacts1');return db[_0x1c53('0xc')][_0x1c53('0x8')]({'where':{}});})['then'](function(){return db['CmHopper'][_0x1c53('0xa')](hopper);})[_0x1c53('0x9')](function(){console[_0x1c53('0xd')](_0x1c53('0xb'),_0x1c53('0xe'));return db[_0x1c53('0x7')][_0x1c53('0xa')](contacts2);})['then'](function(){console['log'](_0x1c53('0xb'),'contacts2');return db[_0x1c53('0xc')][_0x1c53('0xa')](hopper2);})[_0x1c53('0x9')](function(){console[_0x1c53('0xd')](_0x1c53('0xb'),'hopper2');})['catch'](function(_0x3d575b){console[_0x1c53('0xd')](_0x3d575b);}); \ No newline at end of file +var _0x2c26=['util','Innocenzo','Biondo','@xcally.com','push','now','CmContact','destroy','then','bulkCreate','contacts1','CmHopper','log','finished\x20populating','hopper1','contacts2'];(function(_0x10e607,_0x26a4ec){var _0x147aba=function(_0x37edcd){while(--_0x37edcd){_0x10e607['push'](_0x10e607['shift']());}};_0x147aba(++_0x26a4ec);}(_0x2c26,0x180));var _0x62c2=function(_0x20d5d9,_0x128eca){_0x20d5d9=_0x20d5d9-0x0;var _0x1271ab=_0x2c26[_0x20d5d9];return _0x1271ab;};'use strict';var util=require(_0x62c2('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':_0x62c2('0x1')+i,'lastName':_0x62c2('0x2')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x62c2('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x62c2('0x4')]({'id':i,'active':![],'scheduledat':Date[_0x62c2('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x62c2('0x5')](),'updatedAt':Date[_0x62c2('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x62c2('0x1')+i,'lastName':_0x62c2('0x2')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x62c2('0x3')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x62c2('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x62c2('0x5')](),'updatedAt':Date['now']()});}db[_0x62c2('0x6')][_0x62c2('0x7')]({'where':{}})[_0x62c2('0x8')](function(){return db[_0x62c2('0x6')][_0x62c2('0x9')](contacts);})[_0x62c2('0x8')](function(){console['log']('finished\x20populating',_0x62c2('0xa'));return db[_0x62c2('0xb')][_0x62c2('0x7')]({'where':{}});})[_0x62c2('0x8')](function(){return db[_0x62c2('0xb')]['bulkCreate'](hopper);})['then'](function(){console[_0x62c2('0xc')](_0x62c2('0xd'),_0x62c2('0xe'));return db[_0x62c2('0x6')][_0x62c2('0x9')](contacts2);})[_0x62c2('0x8')](function(){console[_0x62c2('0xc')](_0x62c2('0xd'),_0x62c2('0xf'));return db[_0x62c2('0xb')]['bulkCreate'](hopper2);})[_0x62c2('0x8')](function(){console[_0x62c2('0xc')]('finished\x20populating','hopper2');})['catch'](function(_0x1993f2){console[_0x62c2('0xc')](_0x1993f2);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index f53897a..7175dee 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x734a=['/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','User','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend','wss','all','ulaw','yes'];(function(_0x5ec8f7,_0x1242e5){var _0x436dc8=function(_0x2e4e55){while(--_0x2e4e55){_0x5ec8f7['push'](_0x5ec8f7['shift']());}};_0x436dc8(++_0x1242e5);}(_0x734a,0xb1));var _0xa734=function(_0x2bf76a,_0xb01832){_0x2bf76a=_0x2bf76a-0x0;var _0x1ec759=_0x734a[_0x2bf76a];return _0x1ec759;};'use strict';var util=require(_0xa734('0x0'));var db=require(_0xa734('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xa734('0x2')]({'name':util[_0xa734('0x3')](_0xa734('0x4'),_0xa734('0x5'),i),'fullname':util[_0xa734('0x3')](_0xa734('0x4'),'agent',i),'email':util[_0xa734('0x3')](_0xa734('0x6'),_0xa734('0x5'),i),'role':_0xa734('0x5'),'password':_0xa734('0x7'),'internal':0xfa0+i,'type':_0xa734('0x8'),'transport':['udp','ws',_0xa734('0x9')],'disallow':[_0xa734('0xa')],'allow':[_0xa734('0xb')],'defaultuser':util['format'](_0xa734('0x4'),'agent',i),'encryption':_0xa734('0xc'),'avpf':_0xa734('0xc'),'force_avp':'yes','icesupport':_0xa734('0xc'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0xa734('0xd'),'dtlsprivatekey':_0xa734('0xe'),'dtlssetup':'actpass','callerid':util[_0xa734('0x3')]('\x22%s\x22\x20<%s>',util[_0xa734('0x3')]('%s%s',_0xa734('0x5'),i),0xfa0+i)});}db[_0xa734('0xf')]['bulkCreate'](users)['then'](function(){console[_0xa734('0x10')](_0xa734('0x11'));})[_0xa734('0x12')](function(_0x2646e4){console[_0xa734('0x10')](_0x2646e4);}); \ No newline at end of file +var _0x6b58=['catch','util','agent','format','%s%s','%s%s@xcally.com','password','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','then','log','add\x20user'];(function(_0x214941,_0x5147cf){var _0x34ee12=function(_0x455882){while(--_0x455882){_0x214941['push'](_0x214941['shift']());}};_0x34ee12(++_0x5147cf);}(_0x6b58,0xc9));var _0x86b5=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0x6b58[_0x3826ad];return _0x17b900;};'use strict';var util=require(_0x86b5('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format']('%s%s',_0x86b5('0x1'),i),'fullname':util[_0x86b5('0x2')](_0x86b5('0x3'),'agent',i),'email':util['format'](_0x86b5('0x4'),_0x86b5('0x1'),i),'role':'agent','password':_0x86b5('0x5'),'internal':0xfa0+i,'type':'friend','transport':[_0x86b5('0x6'),'ws',_0x86b5('0x7')],'disallow':[_0x86b5('0x8')],'allow':[_0x86b5('0x9')],'defaultuser':util[_0x86b5('0x2')](_0x86b5('0x3'),_0x86b5('0x1'),i),'encryption':_0x86b5('0xa'),'avpf':_0x86b5('0xa'),'force_avp':_0x86b5('0xa'),'icesupport':_0x86b5('0xa'),'dtlsenable':_0x86b5('0xa'),'dtlsverify':'no','dtlscertfile':_0x86b5('0xb'),'dtlsprivatekey':_0x86b5('0xc'),'dtlssetup':_0x86b5('0xd'),'callerid':util[_0x86b5('0x2')](_0x86b5('0xe'),util['format'](_0x86b5('0x3'),_0x86b5('0x1'),i),0xfa0+i)});}db[_0x86b5('0xf')]['bulkCreate'](users)[_0x86b5('0x10')](function(){console[_0x86b5('0x11')](_0x86b5('0x12'));})[_0x86b5('0x13')](function(_0x25caa8){console[_0x86b5('0x11')](_0x25caa8);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 934d26c..f0a8748 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc58=['Campaign','format','find','handshake','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','user:%s','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','MailQueue','WhatsappQueue','user','VoiceQueue','ChatQueues','userProfileId','SmsQueues','SmsQueue','OpenchannelQueues','OpenchannelQueue','Telephones','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','length','voice','fax','sms','mail','openchannel','trunk:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','default','connection','address','request','remoteAddress','remotePort','SocketIO\x20','nsp','disconnect','DISCONNECTED','lodash','../mysqldb','./environment','name','Agents','role','agent','telephone','type','ivr','findOne','then','VoiceQueues','FaxQueues','MailQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','User','where'];(function(_0xd0a1cb,_0x5dd57c){var _0x2a2d04=function(_0x597965){while(--_0x597965){_0xd0a1cb['push'](_0xd0a1cb['shift']());}};_0x2a2d04(++_0x5dd57c);}(_0xcc58,0xab));var _0x8cc5=function(_0x2f332c,_0x41bb5e){_0x2f332c=_0x2f332c-0x0;var _0x2d6f94=_0xcc58[_0x2f332c];return _0x2d6f94;};'use strict';var _=require(_0x8cc5('0x0'));var util=require('util');var BPromise=require('bluebird');var db=require(_0x8cc5('0x1'))['db'];var config=require(_0x8cc5('0x2'));var queryQueues={'attributes':['id',_0x8cc5('0x3')],'include':[{'as':_0x8cc5('0x4'),'model':db['User'],'attributes':['id','name',_0x8cc5('0x5')],'raw':!![],'where':{'role':_0x8cc5('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x8cc5('0x3')],'where':{'role':_0x8cc5('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x8cc5('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x8cc5('0x3')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x8cc5('0x3'),_0x8cc5('0x8')],'where':{'type':_0x8cc5('0x9')}};function getAssociatedResources(_0x244203,_0x11fce6,_0x1c4dea){return db['UserProfileSection'][_0x8cc5('0xa')]({'where':{'name':_0x244203,'userProfileId':_0x11fce6},'raw':!![]})[_0x8cc5('0xb')](function(_0x3315d5){if(_0x3315d5){if(_0x3315d5['autoAssociation']){switch(_0x244203){case _0x8cc5('0xc'):case'ChatQueues':case _0x8cc5('0xd'):case'SmsQueues':case _0x8cc5('0xe'):case'OpenchannelQueues':case'WhatsappQueues':return db[_0x1c4dea][_0x8cc5('0xf')](queryQueues);case'Telephones':return db[_0x1c4dea][_0x8cc5('0xf')](queryTelephones);case _0x8cc5('0x10'):return db[_0x1c4dea]['findAll'](queryTrunks);case _0x8cc5('0x11'):return db[_0x1c4dea][_0x8cc5('0xf')](queryCampaigns);}}else{return db[_0x8cc5('0x12')][_0x8cc5('0xf')]({'attributes':[_0x8cc5('0x13')],'where':{'sectionId':_0x3315d5['id']},'raw':!![]})[_0x8cc5('0xb')](function(_0x10bbd7){if(_0x10bbd7){var _0x5a28c8={'where':{'id':_[_0x8cc5('0x14')](_0x10bbd7,_0x8cc5('0x13'))},'raw':!![]};switch(_0x1c4dea){case _0x8cc5('0x15'):_0x5a28c8[_0x8cc5('0x16')][_0x8cc5('0x5')]='telephone';break;case _0x8cc5('0x17'):_0x5a28c8[_0x8cc5('0x16')]['type']=_0x8cc5('0x9');break;}return db[_0x1c4dea][_0x8cc5('0xf')](_0x5a28c8);}else{return[];}});}}else{return[];}})[_0x8cc5('0xb')](function(_0xab691a){return _0xab691a;});}function joinOrLeaveQueues(_0x221c57,_0x323bab,_0x4f643e,_0x3a5b14){_0x221c57[_0x323bab](util[_0x8cc5('0x18')]('%s:queue:%s',_0x4f643e,_0x3a5b14[_0x8cc5('0x3')]));if(_0x3a5b14[_0x8cc5('0x4')]){for(var _0x7e91b8=0x0;_0x7e91b8<_0x3a5b14[_0x8cc5('0x4')]['length'];_0x7e91b8+=0x1){_0x221c57[_0x323bab](util[_0x8cc5('0x18')]('user:%s',_0x3a5b14[_0x8cc5('0x4')][_0x7e91b8][_0x8cc5('0x3')]));}}}function joinOrLeave(_0x35a471,_0x104f9f,_0x43cad3){var _0x2246f6;if(_0x35a471['handshake']['query']['id']){db[_0x8cc5('0x15')][_0x8cc5('0x19')]({'attributes':['id',_0x8cc5('0x3'),_0x8cc5('0x5'),'userProfileId'],'where':{'id':_0x35a471[_0x8cc5('0x1a')]['query']['id']},'include':[{'model':db[_0x8cc5('0x1b')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x8cc5('0x1c')],'as':_0x8cc5('0x1d'),'attributes':['id'],'raw':!![]},{'model':db[_0x8cc5('0x1e')],'as':_0x8cc5('0x1f'),'attributes':['id'],'raw':!![]},{'model':db[_0x8cc5('0x20')],'as':_0x8cc5('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x8cc5('0x22')],'as':_0x8cc5('0x23'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x8cc5('0x24'),'attributes':['id'],'raw':!![]}]})[_0x8cc5('0xb')](function(_0x1e8da5){if(_0x1e8da5){_0x2246f6=_0x1e8da5;_0x35a471[_0x104f9f](util[_0x8cc5('0x18')](_0x8cc5('0x25'),_0x1e8da5[_0x8cc5('0x3')]));var _0x5b9d92=[];switch(_0x1e8da5[_0x8cc5('0x5')]){case'admin':_0x35a471[_0x104f9f](_0x8cc5('0x26'));_0x35a471[_0x104f9f](_0x8cc5('0x27'));if(queryQueues[_0x8cc5('0x28')](_0x8cc5('0x29'))){delete queryQueues[_0x8cc5('0x29')];}_0x5b9d92[_0x8cc5('0x2a')](db['VoiceQueue'][_0x8cc5('0xf')](queryQueues));_0x5b9d92[_0x8cc5('0x2a')](db[_0x8cc5('0x2b')][_0x8cc5('0xf')](queryQueues));_0x5b9d92[_0x8cc5('0x2a')](db[_0x8cc5('0x2c')][_0x8cc5('0xf')](queryQueues));_0x5b9d92[_0x8cc5('0x2a')](db['SmsQueue'][_0x8cc5('0xf')](queryQueues));_0x5b9d92[_0x8cc5('0x2a')](db[_0x8cc5('0x2d')][_0x8cc5('0xf')](queryQueues));_0x5b9d92[_0x8cc5('0x2a')](db['OpenchannelQueue']['findAll'](queryQueues));_0x5b9d92[_0x8cc5('0x2a')](db[_0x8cc5('0x2e')][_0x8cc5('0xf')](queryQueues));_0x5b9d92[_0x8cc5('0x2a')](db[_0x8cc5('0x15')][_0x8cc5('0xf')](queryTelephones));_0x5b9d92[_0x8cc5('0x2a')](db['Trunk'][_0x8cc5('0xf')](queryTrunks));_0x5b9d92[_0x8cc5('0x2a')](db[_0x8cc5('0x17')][_0x8cc5('0xf')](queryCampaigns));_0x5b9d92[_0x8cc5('0x2a')](db[_0x8cc5('0x15')][_0x8cc5('0xf')](queryAgents));break;case _0x8cc5('0x2f'):_0x35a471[_0x104f9f](_0x8cc5('0x26'));_0x35a471[_0x104f9f](_0x8cc5('0x27'));_0x5b9d92[_0x8cc5('0x2a')](getAssociatedResources(_0x8cc5('0xc'),_0x1e8da5['userProfileId'],_0x8cc5('0x30')));_0x5b9d92[_0x8cc5('0x2a')](getAssociatedResources(_0x8cc5('0x31'),_0x1e8da5[_0x8cc5('0x32')],'ChatQueue'));_0x5b9d92[_0x8cc5('0x2a')](getAssociatedResources(_0x8cc5('0xd'),_0x1e8da5[_0x8cc5('0x32')],'FaxQueue'));_0x5b9d92['push'](getAssociatedResources(_0x8cc5('0x33'),_0x1e8da5[_0x8cc5('0x32')],_0x8cc5('0x34')));_0x5b9d92[_0x8cc5('0x2a')](getAssociatedResources(_0x8cc5('0xe'),_0x1e8da5['userProfileId'],'MailQueue'));_0x5b9d92[_0x8cc5('0x2a')](getAssociatedResources(_0x8cc5('0x35'),_0x1e8da5[_0x8cc5('0x32')],_0x8cc5('0x36')));_0x5b9d92[_0x8cc5('0x2a')](getAssociatedResources('WhatsappQueues',_0x1e8da5['userProfileId'],_0x8cc5('0x2e')));_0x5b9d92['push'](getAssociatedResources(_0x8cc5('0x37'),_0x1e8da5[_0x8cc5('0x32')],_0x8cc5('0x15')));_0x5b9d92[_0x8cc5('0x2a')](getAssociatedResources('Trunks',_0x1e8da5[_0x8cc5('0x32')],'Trunk'));_0x5b9d92[_0x8cc5('0x2a')](getAssociatedResources(_0x8cc5('0x11'),_0x1e8da5['userProfileId'],'Campaign'));_0x5b9d92['push'](db[_0x8cc5('0x15')]['findAll'](queryAgents));break;case _0x8cc5('0x6'):_0x35a471[_0x104f9f](_0x8cc5('0x26'));_0x35a471[_0x104f9f]('voice:outbound');_0x5b9d92[_0x8cc5('0x2a')](_0x1e8da5[_0x8cc5('0x38')]({'attributes':['id',_0x8cc5('0x3')]}));_0x5b9d92[_0x8cc5('0x2a')](_0x1e8da5[_0x8cc5('0x39')]({'attributes':['id',_0x8cc5('0x3')]}));_0x5b9d92[_0x8cc5('0x2a')](_0x1e8da5[_0x8cc5('0x3a')]({'attributes':['id','name']}));_0x5b9d92['push'](_0x1e8da5[_0x8cc5('0x3b')]({'attributes':['id',_0x8cc5('0x3')]}));_0x5b9d92[_0x8cc5('0x2a')](_0x1e8da5['getMailQueues']({'attributes':['id',_0x8cc5('0x3')]}));_0x5b9d92['push'](_0x1e8da5[_0x8cc5('0x3c')]({'attributes':['id',_0x8cc5('0x3')]}));_0x5b9d92['push'](_0x1e8da5[_0x8cc5('0x3d')]({'attributes':['id',_0x8cc5('0x3')]}));break;}return BPromise[_0x8cc5('0x3e')](_0x5b9d92);}})[_0x8cc5('0xb')](function(_0x289e6c){if(_0x289e6c&&_0x289e6c[_0x8cc5('0x3f')]){for(var _0x533b54=0x0;_0x533b54<_0x289e6c[_0x8cc5('0x3f')];_0x533b54+=0x1){for(var _0x2eb765=0x0;_0x2eb765<_0x289e6c[_0x533b54][_0x8cc5('0x3f')];_0x2eb765+=0x1){switch(_0x533b54){case 0x0:joinOrLeaveQueues(_0x35a471,_0x104f9f,_0x8cc5('0x40'),_0x289e6c[_0x533b54][_0x2eb765]);break;case 0x1:joinOrLeaveQueues(_0x35a471,_0x104f9f,'chat',_0x289e6c[_0x533b54][_0x2eb765]);break;case 0x2:joinOrLeaveQueues(_0x35a471,_0x104f9f,_0x8cc5('0x41'),_0x289e6c[_0x533b54][_0x2eb765]);break;case 0x3:joinOrLeaveQueues(_0x35a471,_0x104f9f,_0x8cc5('0x42'),_0x289e6c[_0x533b54][_0x2eb765]);break;case 0x4:joinOrLeaveQueues(_0x35a471,_0x104f9f,_0x8cc5('0x43'),_0x289e6c[_0x533b54][_0x2eb765]);break;case 0x5:joinOrLeaveQueues(_0x35a471,_0x104f9f,_0x8cc5('0x44'),_0x289e6c[_0x533b54][_0x2eb765]);break;case 0x6:joinOrLeaveQueues(_0x35a471,_0x104f9f,'whatsapp',_0x289e6c[_0x533b54][_0x2eb765]);break;case 0x7:if(_0x2246f6[_0x8cc5('0x5')]!==_0x8cc5('0x6'))_0x35a471[_0x104f9f](util[_0x8cc5('0x18')]('telephone:%s',_0x289e6c[_0x533b54][_0x2eb765][_0x8cc5('0x3')]));break;case 0x8:if(_0x2246f6[_0x8cc5('0x5')]!==_0x8cc5('0x6'))_0x35a471[_0x104f9f](util[_0x8cc5('0x18')](_0x8cc5('0x45'),_0x289e6c[_0x533b54][_0x2eb765][_0x8cc5('0x3')]));break;case 0x9:if(_0x2246f6[_0x8cc5('0x5')]!==_0x8cc5('0x6'))_0x35a471[_0x104f9f](util['format'](_0x8cc5('0x46'),_0x289e6c[_0x533b54][_0x2eb765][_0x8cc5('0x8')],_0x289e6c[_0x533b54][_0x2eb765][_0x8cc5('0x3')]));break;case 0xa:_0x35a471[_0x104f9f](util[_0x8cc5('0x18')]('user:%s',_0x289e6c[_0x533b54][_0x2eb765][_0x8cc5('0x3')]));break;}}}}})['then'](function(){if(_0x104f9f===_0x8cc5('0x47')){var _0x52ac4c=_[_0x8cc5('0x14')](_0x2246f6[_0x8cc5('0x48')],'id');return _0x2246f6[_0x8cc5('0x49')](_0x52ac4c)[_0x8cc5('0xb')](function(){for(var _0x56d739=0x0;_0x56d739<_0x52ac4c['length'];_0x56d739+=0x1){_0x43cad3[_0x8cc5('0x4a')](_0x8cc5('0x4b'),{'ChatInteractionId':Number(_0x52ac4c[_0x56d739]),'UserId':Number(_0x2246f6['id'])});}});}})[_0x8cc5('0xb')](function(){if(_0x104f9f===_0x8cc5('0x47')){var _0x5809e3=_['map'](_0x2246f6['MailInteractions'],'id');return _0x2246f6[_0x8cc5('0x4c')](_0x5809e3)[_0x8cc5('0xb')](function(){for(var _0x533c4d=0x0;_0x533c4d<_0x5809e3[_0x8cc5('0x3f')];_0x533c4d+=0x1){_0x43cad3[_0x8cc5('0x4a')](_0x8cc5('0x4d'),{'MailInteractionId':Number(_0x5809e3[_0x533c4d]),'UserId':Number(_0x2246f6['id'])});}});}})['then'](function(){if(_0x104f9f===_0x8cc5('0x47')){var _0x5a523b=_[_0x8cc5('0x14')](_0x2246f6[_0x8cc5('0x1f')],'id');return _0x2246f6[_0x8cc5('0x4e')](_0x5a523b)[_0x8cc5('0xb')](function(){for(var _0x2a2469=0x0;_0x2a2469<_0x5a523b[_0x8cc5('0x3f')];_0x2a2469+=0x1){_0x43cad3[_0x8cc5('0x4a')](_0x8cc5('0x4f'),{'FaxInteractionId':Number(_0x5a523b[_0x2a2469]),'UserId':Number(_0x2246f6['id'])});}});}})[_0x8cc5('0xb')](function(){if(_0x104f9f==='leave'){var _0x4d69a5=_[_0x8cc5('0x14')](_0x2246f6[_0x8cc5('0x21')],'id');return _0x2246f6[_0x8cc5('0x50')](_0x4d69a5)['then'](function(){for(var _0x3e2904=0x0;_0x3e2904<_0x4d69a5[_0x8cc5('0x3f')];_0x3e2904+=0x1){_0x43cad3[_0x8cc5('0x4a')](_0x8cc5('0x51'),{'SmsInteractionId':Number(_0x4d69a5[_0x3e2904]),'UserId':Number(_0x2246f6['id'])});}});}})['then'](function(){if(_0x104f9f===_0x8cc5('0x47')){var _0x2372a3=_[_0x8cc5('0x14')](_0x2246f6[_0x8cc5('0x23')],'id');return _0x2246f6['removeOpenchannelInteractions'](_0x2372a3)[_0x8cc5('0xb')](function(){for(var _0xe24a8c=0x0;_0xe24a8c<_0x2372a3[_0x8cc5('0x3f')];_0xe24a8c+=0x1){_0x43cad3['emit'](_0x8cc5('0x52'),{'OpenchannelInteractionId':Number(_0x2372a3[_0xe24a8c]),'UserId':Number(_0x2246f6['id'])});}});}})[_0x8cc5('0xb')](function(){if(_0x104f9f===_0x8cc5('0x47')){var _0x3045cb=_['map'](_0x2246f6[_0x8cc5('0x24')],'id');return _0x2246f6[_0x8cc5('0x53')](_0x3045cb)[_0x8cc5('0xb')](function(){for(var _0x2ceda5=0x0;_0x2ceda5<_0x3045cb[_0x8cc5('0x3f')];_0x2ceda5+=0x1){_0x43cad3[_0x8cc5('0x4a')](_0x8cc5('0x54'),{'WhatsappInteractionId':Number(_0x3045cb[_0x2ceda5]),'UserId':Number(_0x2246f6['id'])});}});}})['catch'](function(_0x26db3f){_0x35a471[_0x8cc5('0x55')](_0x26db3f);});}}function onDisconnect(_0x338675,_0x4de0e1){joinOrLeave(_0x338675,_0x8cc5('0x47'),_0x4de0e1);}function onConnect(_0x3b7f85){joinOrLeave(_0x3b7f85,_0x8cc5('0x56'));}exports[_0x8cc5('0x57')]=function(_0x17c5a6){_0x17c5a6['on'](_0x8cc5('0x58'),function(_0x3b134b){_0x3b134b['setMaxListeners'](0x0);_0x3b134b[_0x8cc5('0x59')]=_0x3b134b[_0x8cc5('0x5a')][_0x8cc5('0x58')][_0x8cc5('0x5b')]+':'+_0x3b134b['request']['connection'][_0x8cc5('0x5c')];_0x3b134b['connectedAt']=new Date();_0x3b134b[_0x8cc5('0x55')]=function(_0x68cf4e){console[_0x8cc5('0x55')](_0x8cc5('0x5d')+_0x3b134b[_0x8cc5('0x5e')][_0x8cc5('0x3')]+'['+_0x3b134b[_0x8cc5('0x59')]+']',_0x68cf4e);};_0x3b134b['on'](_0x8cc5('0x5f'),function(){onDisconnect(_0x3b134b,_0x17c5a6);_0x3b134b['log'](_0x8cc5('0x60'));});onConnect(_0x3b134b);_0x3b134b[_0x8cc5('0x55')]('CONNECTED');});}; \ No newline at end of file +var _0xbdc1=['default','connection','setMaxListeners','address','request','remoteAddress','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','../mysqldb','./environment','name','Agents','User','agent','type','ivr','UserProfileSection','findOne','then','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','where','role','telephone','Campaign','format','%s:queue:%s','user:%s','handshake','userProfileId','query','ChatInteraction','ChatInteractions','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','include','VoiceQueue','push','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','SmsQueue','getVoiceQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','length','voice','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','map','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','catch','log','join'];(function(_0x508ae3,_0x14f397){var _0x558766=function(_0x5eafbd){while(--_0x5eafbd){_0x508ae3['push'](_0x508ae3['shift']());}};_0x558766(++_0x14f397);}(_0xbdc1,0x147));var _0x1bdc=function(_0x3d7205,_0x3070aa){_0x3d7205=_0x3d7205-0x0;var _0x4f870b=_0xbdc1[_0x3d7205];return _0x4f870b;};'use strict';var _=require(_0x1bdc('0x0'));var util=require('util');var BPromise=require(_0x1bdc('0x1'));var db=require(_0x1bdc('0x2'))['db'];var config=require(_0x1bdc('0x3'));var queryQueues={'attributes':['id',_0x1bdc('0x4')],'include':[{'as':_0x1bdc('0x5'),'model':db[_0x1bdc('0x6')],'attributes':['id','name','role'],'raw':!![],'where':{'role':_0x1bdc('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x1bdc('0x4')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x1bdc('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x1bdc('0x4')],'where':{'role':_0x1bdc('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x1bdc('0x4'),_0x1bdc('0x8')],'where':{'type':_0x1bdc('0x9')}};function getAssociatedResources(_0x3353ca,_0x19748a,_0x47675b){return db[_0x1bdc('0xa')][_0x1bdc('0xb')]({'where':{'name':_0x3353ca,'userProfileId':_0x19748a},'raw':!![]})[_0x1bdc('0xc')](function(_0x608a48){if(_0x608a48){if(_0x608a48['autoAssociation']){switch(_0x3353ca){case _0x1bdc('0xd'):case _0x1bdc('0xe'):case _0x1bdc('0xf'):case _0x1bdc('0x10'):case _0x1bdc('0x11'):case _0x1bdc('0x12'):case _0x1bdc('0x13'):return db[_0x47675b]['findAll'](queryQueues);case _0x1bdc('0x14'):return db[_0x47675b][_0x1bdc('0x15')](queryTelephones);case _0x1bdc('0x16'):return db[_0x47675b]['findAll'](queryTrunks);case _0x1bdc('0x17'):return db[_0x47675b]['findAll'](queryCampaigns);}}else{return db[_0x1bdc('0x18')][_0x1bdc('0x15')]({'attributes':[_0x1bdc('0x19')],'where':{'sectionId':_0x608a48['id']},'raw':!![]})[_0x1bdc('0xc')](function(_0x20fc10){if(_0x20fc10){var _0x1e46ef={'where':{'id':_['map'](_0x20fc10,_0x1bdc('0x19'))},'raw':!![]};switch(_0x47675b){case'User':_0x1e46ef[_0x1bdc('0x1a')][_0x1bdc('0x1b')]=_0x1bdc('0x1c');break;case _0x1bdc('0x1d'):_0x1e46ef[_0x1bdc('0x1a')][_0x1bdc('0x8')]=_0x1bdc('0x9');break;}return db[_0x47675b][_0x1bdc('0x15')](_0x1e46ef);}else{return[];}});}}else{return[];}})['then'](function(_0xe32bda){return _0xe32bda;});}function joinOrLeaveQueues(_0x16ef90,_0x25662a,_0x1b827d,_0x24f2ac){_0x16ef90[_0x25662a](util[_0x1bdc('0x1e')](_0x1bdc('0x1f'),_0x1b827d,_0x24f2ac[_0x1bdc('0x4')]));if(_0x24f2ac[_0x1bdc('0x5')]){for(var _0x568b4b=0x0;_0x568b4b<_0x24f2ac['Agents']['length'];_0x568b4b+=0x1){_0x16ef90[_0x25662a](util[_0x1bdc('0x1e')](_0x1bdc('0x20'),_0x24f2ac[_0x1bdc('0x5')][_0x568b4b][_0x1bdc('0x4')]));}}}function joinOrLeave(_0x2e3c4a,_0x195714,_0x529db2){var _0x3b4ff4;if(_0x2e3c4a[_0x1bdc('0x21')]['query']['id']){db['User']['find']({'attributes':['id',_0x1bdc('0x4'),_0x1bdc('0x1b'),_0x1bdc('0x22')],'where':{'id':_0x2e3c4a[_0x1bdc('0x21')][_0x1bdc('0x23')]['id']},'include':[{'model':db[_0x1bdc('0x24')],'as':_0x1bdc('0x25'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x1bdc('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x1bdc('0x27')],'as':_0x1bdc('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x1bdc('0x29')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x1bdc('0x2a')],'as':_0x1bdc('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x1bdc('0x2c')],'as':_0x1bdc('0x2d'),'attributes':['id'],'raw':!![]}]})[_0x1bdc('0xc')](function(_0x49a2f4){if(_0x49a2f4){_0x3b4ff4=_0x49a2f4;_0x2e3c4a[_0x195714](util[_0x1bdc('0x1e')](_0x1bdc('0x20'),_0x49a2f4['name']));var _0x493374=[];switch(_0x49a2f4[_0x1bdc('0x1b')]){case _0x1bdc('0x2e'):_0x2e3c4a[_0x195714](_0x1bdc('0x2f'));_0x2e3c4a[_0x195714](_0x1bdc('0x30'));if(queryQueues['hasOwnProperty'](_0x1bdc('0x31'))){delete queryQueues[_0x1bdc('0x31')];}_0x493374['push'](db[_0x1bdc('0x32')][_0x1bdc('0x15')](queryQueues));_0x493374[_0x1bdc('0x33')](db[_0x1bdc('0x34')][_0x1bdc('0x15')](queryQueues));_0x493374[_0x1bdc('0x33')](db[_0x1bdc('0x35')][_0x1bdc('0x15')](queryQueues));_0x493374[_0x1bdc('0x33')](db['SmsQueue'][_0x1bdc('0x15')](queryQueues));_0x493374[_0x1bdc('0x33')](db[_0x1bdc('0x36')][_0x1bdc('0x15')](queryQueues));_0x493374[_0x1bdc('0x33')](db[_0x1bdc('0x37')]['findAll'](queryQueues));_0x493374['push'](db[_0x1bdc('0x38')][_0x1bdc('0x15')](queryQueues));_0x493374[_0x1bdc('0x33')](db[_0x1bdc('0x6')][_0x1bdc('0x15')](queryTelephones));_0x493374[_0x1bdc('0x33')](db[_0x1bdc('0x39')][_0x1bdc('0x15')](queryTrunks));_0x493374[_0x1bdc('0x33')](db[_0x1bdc('0x1d')][_0x1bdc('0x15')](queryCampaigns));_0x493374[_0x1bdc('0x33')](db[_0x1bdc('0x6')][_0x1bdc('0x15')](queryAgents));break;case _0x1bdc('0x3a'):_0x2e3c4a[_0x195714]('voice:inbound');_0x2e3c4a[_0x195714](_0x1bdc('0x30'));_0x493374['push'](getAssociatedResources(_0x1bdc('0xd'),_0x49a2f4[_0x1bdc('0x22')],_0x1bdc('0x32')));_0x493374[_0x1bdc('0x33')](getAssociatedResources(_0x1bdc('0xe'),_0x49a2f4[_0x1bdc('0x22')],_0x1bdc('0x34')));_0x493374[_0x1bdc('0x33')](getAssociatedResources(_0x1bdc('0xf'),_0x49a2f4[_0x1bdc('0x22')],_0x1bdc('0x35')));_0x493374[_0x1bdc('0x33')](getAssociatedResources(_0x1bdc('0x10'),_0x49a2f4[_0x1bdc('0x22')],_0x1bdc('0x3b')));_0x493374[_0x1bdc('0x33')](getAssociatedResources(_0x1bdc('0x11'),_0x49a2f4['userProfileId'],_0x1bdc('0x36')));_0x493374['push'](getAssociatedResources('OpenchannelQueues',_0x49a2f4[_0x1bdc('0x22')],_0x1bdc('0x37')));_0x493374[_0x1bdc('0x33')](getAssociatedResources(_0x1bdc('0x13'),_0x49a2f4[_0x1bdc('0x22')],_0x1bdc('0x38')));_0x493374[_0x1bdc('0x33')](getAssociatedResources(_0x1bdc('0x14'),_0x49a2f4[_0x1bdc('0x22')],_0x1bdc('0x6')));_0x493374[_0x1bdc('0x33')](getAssociatedResources(_0x1bdc('0x16'),_0x49a2f4[_0x1bdc('0x22')],'Trunk'));_0x493374['push'](getAssociatedResources(_0x1bdc('0x17'),_0x49a2f4[_0x1bdc('0x22')],_0x1bdc('0x1d')));_0x493374[_0x1bdc('0x33')](db[_0x1bdc('0x6')][_0x1bdc('0x15')](queryAgents));break;case _0x1bdc('0x7'):_0x2e3c4a[_0x195714](_0x1bdc('0x2f'));_0x2e3c4a[_0x195714](_0x1bdc('0x30'));_0x493374[_0x1bdc('0x33')](_0x49a2f4[_0x1bdc('0x3c')]({'attributes':['id','name']}));_0x493374[_0x1bdc('0x33')](_0x49a2f4['getChatQueues']({'attributes':['id',_0x1bdc('0x4')]}));_0x493374['push'](_0x49a2f4['getFaxQueues']({'attributes':['id','name']}));_0x493374['push'](_0x49a2f4[_0x1bdc('0x3d')]({'attributes':['id',_0x1bdc('0x4')]}));_0x493374[_0x1bdc('0x33')](_0x49a2f4[_0x1bdc('0x3e')]({'attributes':['id',_0x1bdc('0x4')]}));_0x493374[_0x1bdc('0x33')](_0x49a2f4[_0x1bdc('0x3f')]({'attributes':['id',_0x1bdc('0x4')]}));_0x493374[_0x1bdc('0x33')](_0x49a2f4[_0x1bdc('0x40')]({'attributes':['id',_0x1bdc('0x4')]}));break;}return BPromise[_0x1bdc('0x41')](_0x493374);}})[_0x1bdc('0xc')](function(_0x1112a5){if(_0x1112a5&&_0x1112a5['length']){for(var _0x35545a=0x0;_0x35545a<_0x1112a5[_0x1bdc('0x42')];_0x35545a+=0x1){for(var _0x18df5e=0x0;_0x18df5e<_0x1112a5[_0x35545a][_0x1bdc('0x42')];_0x18df5e+=0x1){switch(_0x35545a){case 0x0:joinOrLeaveQueues(_0x2e3c4a,_0x195714,_0x1bdc('0x43'),_0x1112a5[_0x35545a][_0x18df5e]);break;case 0x1:joinOrLeaveQueues(_0x2e3c4a,_0x195714,'chat',_0x1112a5[_0x35545a][_0x18df5e]);break;case 0x2:joinOrLeaveQueues(_0x2e3c4a,_0x195714,_0x1bdc('0x44'),_0x1112a5[_0x35545a][_0x18df5e]);break;case 0x3:joinOrLeaveQueues(_0x2e3c4a,_0x195714,_0x1bdc('0x45'),_0x1112a5[_0x35545a][_0x18df5e]);break;case 0x4:joinOrLeaveQueues(_0x2e3c4a,_0x195714,_0x1bdc('0x46'),_0x1112a5[_0x35545a][_0x18df5e]);break;case 0x5:joinOrLeaveQueues(_0x2e3c4a,_0x195714,_0x1bdc('0x47'),_0x1112a5[_0x35545a][_0x18df5e]);break;case 0x6:joinOrLeaveQueues(_0x2e3c4a,_0x195714,_0x1bdc('0x48'),_0x1112a5[_0x35545a][_0x18df5e]);break;case 0x7:if(_0x3b4ff4[_0x1bdc('0x1b')]!=='agent')_0x2e3c4a[_0x195714](util[_0x1bdc('0x1e')](_0x1bdc('0x49'),_0x1112a5[_0x35545a][_0x18df5e][_0x1bdc('0x4')]));break;case 0x8:if(_0x3b4ff4[_0x1bdc('0x1b')]!=='agent')_0x2e3c4a[_0x195714](util[_0x1bdc('0x1e')](_0x1bdc('0x4a'),_0x1112a5[_0x35545a][_0x18df5e][_0x1bdc('0x4')]));break;case 0x9:if(_0x3b4ff4[_0x1bdc('0x1b')]!==_0x1bdc('0x7'))_0x2e3c4a[_0x195714](util['format'](_0x1bdc('0x4b'),_0x1112a5[_0x35545a][_0x18df5e]['type'],_0x1112a5[_0x35545a][_0x18df5e]['name']));break;case 0xa:_0x2e3c4a[_0x195714](util['format']('user:%s',_0x1112a5[_0x35545a][_0x18df5e]['name']));break;}}}}})[_0x1bdc('0xc')](function(){if(_0x195714===_0x1bdc('0x4c')){var _0x3a537e=_['map'](_0x3b4ff4['ChatInteractions'],'id');return _0x3b4ff4[_0x1bdc('0x4d')](_0x3a537e)[_0x1bdc('0xc')](function(){for(var _0x22250f=0x0;_0x22250f<_0x3a537e[_0x1bdc('0x42')];_0x22250f+=0x1){_0x529db2[_0x1bdc('0x4e')](_0x1bdc('0x4f'),{'ChatInteractionId':Number(_0x3a537e[_0x22250f]),'UserId':Number(_0x3b4ff4['id'])});}});}})[_0x1bdc('0xc')](function(){if(_0x195714===_0x1bdc('0x4c')){var _0x20800c=_[_0x1bdc('0x50')](_0x3b4ff4[_0x1bdc('0x26')],'id');return _0x3b4ff4['removeMailInteractions'](_0x20800c)[_0x1bdc('0xc')](function(){for(var _0x57b076=0x0;_0x57b076<_0x20800c[_0x1bdc('0x42')];_0x57b076+=0x1){_0x529db2[_0x1bdc('0x4e')](_0x1bdc('0x51'),{'MailInteractionId':Number(_0x20800c[_0x57b076]),'UserId':Number(_0x3b4ff4['id'])});}});}})[_0x1bdc('0xc')](function(){if(_0x195714===_0x1bdc('0x4c')){var _0x22ce50=_[_0x1bdc('0x50')](_0x3b4ff4[_0x1bdc('0x28')],'id');return _0x3b4ff4[_0x1bdc('0x52')](_0x22ce50)[_0x1bdc('0xc')](function(){for(var _0x3330dd=0x0;_0x3330dd<_0x22ce50[_0x1bdc('0x42')];_0x3330dd+=0x1){_0x529db2[_0x1bdc('0x4e')](_0x1bdc('0x53'),{'FaxInteractionId':Number(_0x22ce50[_0x3330dd]),'UserId':Number(_0x3b4ff4['id'])});}});}})[_0x1bdc('0xc')](function(){if(_0x195714===_0x1bdc('0x4c')){var _0x2ef3a6=_[_0x1bdc('0x50')](_0x3b4ff4[_0x1bdc('0x54')],'id');return _0x3b4ff4[_0x1bdc('0x55')](_0x2ef3a6)['then'](function(){for(var _0x2b1fee=0x0;_0x2b1fee<_0x2ef3a6[_0x1bdc('0x42')];_0x2b1fee+=0x1){_0x529db2['emit'](_0x1bdc('0x56'),{'SmsInteractionId':Number(_0x2ef3a6[_0x2b1fee]),'UserId':Number(_0x3b4ff4['id'])});}});}})[_0x1bdc('0xc')](function(){if(_0x195714===_0x1bdc('0x4c')){var _0x3543c5=_[_0x1bdc('0x50')](_0x3b4ff4[_0x1bdc('0x2b')],'id');return _0x3b4ff4[_0x1bdc('0x57')](_0x3543c5)[_0x1bdc('0xc')](function(){for(var _0x101361=0x0;_0x101361<_0x3543c5[_0x1bdc('0x42')];_0x101361+=0x1){_0x529db2[_0x1bdc('0x4e')](_0x1bdc('0x58'),{'OpenchannelInteractionId':Number(_0x3543c5[_0x101361]),'UserId':Number(_0x3b4ff4['id'])});}});}})[_0x1bdc('0xc')](function(){if(_0x195714==='leave'){var _0x9ff424=_['map'](_0x3b4ff4['WhatsappInteractions'],'id');return _0x3b4ff4[_0x1bdc('0x59')](_0x9ff424)[_0x1bdc('0xc')](function(){for(var _0xa1fd1f=0x0;_0xa1fd1f<_0x9ff424[_0x1bdc('0x42')];_0xa1fd1f+=0x1){_0x529db2[_0x1bdc('0x4e')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x9ff424[_0xa1fd1f]),'UserId':Number(_0x3b4ff4['id'])});}});}})[_0x1bdc('0x5a')](function(_0xca3dcc){_0x2e3c4a[_0x1bdc('0x5b')](_0xca3dcc);});}}function onDisconnect(_0x533826,_0x4a524c){joinOrLeave(_0x533826,_0x1bdc('0x4c'),_0x4a524c);}function onConnect(_0x44a5c4){joinOrLeave(_0x44a5c4,_0x1bdc('0x5c'));}exports[_0x1bdc('0x5d')]=function(_0x12fef6){_0x12fef6['on'](_0x1bdc('0x5e'),function(_0x514d60){_0x514d60[_0x1bdc('0x5f')](0x0);_0x514d60[_0x1bdc('0x60')]=_0x514d60[_0x1bdc('0x61')][_0x1bdc('0x5e')][_0x1bdc('0x62')]+':'+_0x514d60[_0x1bdc('0x61')][_0x1bdc('0x5e')]['remotePort'];_0x514d60[_0x1bdc('0x63')]=new Date();_0x514d60[_0x1bdc('0x5b')]=function(_0x340716){console[_0x1bdc('0x5b')](_0x1bdc('0x64')+_0x514d60[_0x1bdc('0x65')][_0x1bdc('0x4')]+'['+_0x514d60[_0x1bdc('0x60')]+']',_0x340716);};_0x514d60['on'](_0x1bdc('0x66'),function(){onDisconnect(_0x514d60,_0x12fef6);_0x514d60['log'](_0x1bdc('0x67'));});onConnect(_0x514d60);_0x514d60['log'](_0x1bdc('0x68'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index e6307ff..d93dd7a 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 _0xb217=['EventManager','then','error','code','Trigger,\x20%s','catch','channel','motionChannel','event','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','SELECT','contact','UserId','interface','format','SIP/%s','name','incomingmessage','get','offlineMessage','opened','QueryTypes','AfterCreate','closed','changed','substatus','User','find','fullname','email','default','length','hasOwnProperty','model','hook','callback','util','../../mysqldb','jayson/promise','triggers','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','ChatMessage','newmessage','ChatOfflineMessage','Sms','SmsInteraction','closedinteraction','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','Mail','MailInteraction','MailMessage','OpenchannelInteraction','Openchannel','OpenchannelMessage','request'];(function(_0x1a1c30,_0x1e1209){var _0x2dec3c=function(_0x4471da){while(--_0x4471da){_0x1a1c30['push'](_0x1a1c30['shift']());}};_0x2dec3c(++_0x1e1209);}(_0xb217,0x146));var _0x7b21=function(_0x5ec84b,_0x3051aa){_0x5ec84b=_0x5ec84b-0x0;var _0x5853ad=_0xb217[_0x5ec84b];return _0x5853ad;};'use strict';var util=require(_0x7b21('0x0'));var db=require(_0x7b21('0x1'))['db'];var jayson=require(_0x7b21('0x2'));var logger=require('../logger')(_0x7b21('0x3'));var client=jayson[_0x7b21('0x4')][_0x7b21('0x5')]({'port':0x232a});var triggers=[{'channel':_0x7b21('0x6'),'model':_0x7b21('0x7'),'event':_0x7b21('0x8'),'condition':_0x7b21('0x9'),'callback':afterCreate},{'channel':_0x7b21('0x6'),'model':_0x7b21('0x7'),'event':_0x7b21('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x7b21('0x6'),'model':_0x7b21('0xb'),'event':_0x7b21('0x8'),'condition':_0x7b21('0xc'),'callback':afterCreateMessage},{'channel':'Chat','model':_0x7b21('0xd'),'event':_0x7b21('0x8'),'condition':'newmessage','callback':afterCreateOfflineMessage},{'channel':_0x7b21('0xe'),'model':_0x7b21('0xf'),'event':_0x7b21('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':'Sms','model':_0x7b21('0xf'),'event':'afterUpdate','condition':_0x7b21('0x10'),'callback':afterUpdate},{'channel':'Sms','model':'SmsMessage','event':'afterCreate','condition':_0x7b21('0xc'),'callback':afterCreateMessage},{'channel':_0x7b21('0x11'),'model':_0x7b21('0x12'),'event':_0x7b21('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x7b21('0x11'),'model':'WhatsappInteraction','event':_0x7b21('0xa'),'condition':_0x7b21('0x10'),'callback':afterUpdate},{'channel':_0x7b21('0x11'),'model':_0x7b21('0x13'),'event':_0x7b21('0x8'),'condition':_0x7b21('0xc'),'callback':afterCreateMessage},{'channel':_0x7b21('0x14'),'model':'FaxInteraction','event':_0x7b21('0x8'),'condition':_0x7b21('0x9'),'callback':afterCreate},{'channel':'Fax','model':_0x7b21('0x15'),'event':_0x7b21('0xa'),'condition':_0x7b21('0x10'),'callback':afterUpdate},{'channel':_0x7b21('0x14'),'model':'FaxMessage','event':_0x7b21('0x8'),'condition':_0x7b21('0xc'),'callback':afterCreateMessage},{'channel':_0x7b21('0x16'),'model':'MailInteraction','event':_0x7b21('0x8'),'condition':_0x7b21('0x9'),'callback':afterCreate},{'channel':'Mail','model':_0x7b21('0x17'),'event':_0x7b21('0xa'),'condition':_0x7b21('0x10'),'callback':afterUpdate},{'channel':_0x7b21('0x16'),'model':_0x7b21('0x18'),'event':'afterCreate','condition':_0x7b21('0xc'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0x7b21('0x19'),'event':_0x7b21('0x8'),'condition':_0x7b21('0x9'),'callback':afterCreate},{'channel':_0x7b21('0x1a'),'model':_0x7b21('0x19'),'event':'afterUpdate','condition':_0x7b21('0x10'),'callback':afterUpdate},{'channel':_0x7b21('0x1a'),'model':_0x7b21('0x1b'),'event':_0x7b21('0x8'),'condition':_0x7b21('0xc'),'callback':afterCreateMessage}];function request(_0x5cf2ff){return client[_0x7b21('0x1c')](_0x7b21('0x1d'),_0x5cf2ff)[_0x7b21('0x1e')](function(_0x51c257){logger['info']('Trigger,\x20%s',_0x7b21('0x1d'),_0x51c257);if(_0x51c257[_0x7b21('0x1f')]){if(_0x51c257['error'][_0x7b21('0x20')]===0x1f4){logger[_0x7b21('0x1f')](_0x7b21('0x21'),_0x7b21('0x1d'),_0x51c257[_0x7b21('0x1f')]);}}})[_0x7b21('0x22')](function(_0xf69b17){logger['error'](_0x7b21('0x21'),_0x7b21('0x1d'),_0xf69b17);});}function afterCreateMessage(_0x247470){return function(_0x2deb8d){_0x2deb8d=_0x2deb8d['get']({'plain':!![]});_0x2deb8d[_0x7b21('0x23')]=_0x247470;_0x2deb8d[_0x7b21('0x24')]=_0x247470;_0x2deb8d[_0x7b21('0x25')]=_0x2deb8d['direction'];Promise[_0x7b21('0x26')]()['then'](function(){if(typeof _0x2deb8d[_0x7b21('0x27')]===_0x7b21('0x28'))return null;var _0x114f12=_0x7b21('0x29')+_0x2deb8d[_0x7b21('0x27')];return db[_0x7b21('0x2a')][_0x7b21('0x2b')](_0x114f12,{'type':db[_0x7b21('0x2c')]['QueryTypes'][_0x7b21('0x2d')],'raw':!![]});})[_0x7b21('0x1e')](function(_0x5922f8){if(_0x5922f8){_0x2deb8d[_0x7b21('0x2e')]=_0x5922f8[0x0];}if(typeof _0x2deb8d[_0x7b21('0x2f')]===_0x7b21('0x28'))return;return getAgent(_0x2deb8d[_0x7b21('0x2f')]);})[_0x7b21('0x1e')](function(_0x357c62){if(_0x357c62){_0x2deb8d[_0x7b21('0x30')]=util[_0x7b21('0x31')](_0x7b21('0x32'),_0x357c62[_0x7b21('0x33')]);_0x2deb8d['agent']=_0x357c62;_0x2deb8d[_0x7b21('0x23')]=_0x247470;return request({'event':_0x7b21('0x34'),'message':_0x2deb8d});}else{return request({'event':'outgoingmessage','message':_0x2deb8d});}})[_0x7b21('0x22')](function(_0x6b87a){logger['error']('Trigger,\x20%s','AfterCreateMessage',_0x6b87a);});};}function afterCreateOfflineMessage(_0x39aacd){return function(_0x18e55f){_0x18e55f=_0x18e55f[_0x7b21('0x35')]({'plain':!![]});_0x18e55f[_0x7b21('0x23')]=_0x39aacd;_0x18e55f[_0x7b21('0x24')]=_0x39aacd;_0x18e55f['event']=_0x7b21('0x36');return request({'event':_0x18e55f[_0x7b21('0x25')],'message':_0x18e55f});};}function afterCreate(_0x51449c,_0x2b97ea){return function(_0x45250a){_0x45250a=_0x45250a['get']({'plain':!![]});_0x45250a[_0x7b21('0x23')]=_0x51449c;_0x45250a[_0x7b21('0x24')]=_0x51449c;_0x45250a[_0x7b21('0x25')]=_0x7b21('0x37');Promise[_0x7b21('0x26')]()[_0x7b21('0x1e')](function(){var _0x30e1ac='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x45250a[_0x7b21('0x27')];return db[_0x7b21('0x2a')][_0x7b21('0x2b')](_0x30e1ac,{'type':db[_0x7b21('0x2c')][_0x7b21('0x38')][_0x7b21('0x2d')],'raw':!![]});})[_0x7b21('0x1e')](function(_0xd030ec){if(_0xd030ec){_0x45250a[_0x7b21('0x2e')]=_0xd030ec[0x0];}if(typeof _0x45250a[_0x7b21('0x2f')]===_0x7b21('0x28'))return;return getAgent(_0x45250a['UserId']);})[_0x7b21('0x1e')](function(_0x56cf7d){if(_0x56cf7d){_0x45250a[_0x7b21('0x30')]=util[_0x7b21('0x31')]('SIP/%s',_0x56cf7d[_0x7b21('0x33')]);_0x45250a['agent']=_0x56cf7d;}return request({'event':_0x2b97ea,'message':_0x45250a});})[_0x7b21('0x22')](function(_0x30e323){logger[_0x7b21('0x1f')](_0x7b21('0x21'),_0x7b21('0x39'),_0x30e323);});};}function afterUpdate(_0x4a99b5){return function(_0x2b9427){var _0x34cdda=_0x2b9427['changed'](_0x7b21('0x3a'))&&_0x2b9427[_0x7b21('0x3a')];var _0x46b738=_0x2b9427[_0x7b21('0x3b')](_0x7b21('0x3c'));if(_0x34cdda||_0x46b738){var _0x129b27=_0x34cdda?_0x7b21('0x10'):_0x7b21('0x3c');var _0x5b6fc1=_0x2b9427[_0x7b21('0x35')]({'plain':!![]});_0x5b6fc1[_0x7b21('0x23')]=_0x4a99b5;_0x5b6fc1[_0x7b21('0x24')]=_0x4a99b5;_0x5b6fc1[_0x7b21('0x25')]=_0x34cdda?_0x7b21('0x3a'):_0x7b21('0x3c');var _0x1ba71e=_0x7b21('0x29')+_0x5b6fc1[_0x7b21('0x27')];return db['sequelize']['query'](_0x1ba71e,{'type':db[_0x7b21('0x2c')][_0x7b21('0x38')]['SELECT'],'raw':!![]})['then'](function(_0x138a24){if(_0x138a24){_0x5b6fc1['contact']=_0x138a24[0x0];}if(typeof _0x5b6fc1[_0x7b21('0x2f')]===_0x7b21('0x28'))return;return getAgent(_0x5b6fc1[_0x7b21('0x2f')]);})['then'](function(_0x8297e0){if(_0x8297e0){_0x5b6fc1[_0x7b21('0x30')]=util['format']('SIP/%s',_0x8297e0[_0x7b21('0x33')]);_0x5b6fc1['agent']=_0x8297e0;}return request({'event':_0x129b27,'message':_0x5b6fc1});})[_0x7b21('0x22')](function(_0x4d3fb9){logger['error'](_0x7b21('0x21'),'AfterUpdate',_0x4d3fb9);});}};}function getAgent(_0x5334db){return db[_0x7b21('0x3d')][_0x7b21('0x3e')]({'where':{'id':_0x5334db},'attributes':['id','name',_0x7b21('0x3f'),_0x7b21('0x40'),'internal'],'raw':!![]})[_0x7b21('0x1e')](function(_0x40f559){return _0x40f559;});}exports[_0x7b21('0x41')]=function(){for(var _0x24b472=0x0;_0x24b472=_0x4b57a2[_0xb3e9('0x13')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x101ba9(_0x563418);})[_0xb3e9('0x14')](function(_0xa8a6a5){_0x4eb4ef(_0xa8a6a5);});});}; \ No newline at end of file +var _0xeb8a=['whatsapp','getChannels','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','lodash','bluebird','../mysqldb','./license/util','mail','fax'];(function(_0x30428f,_0x46de51){var _0x42cf4f=function(_0x3122db){while(--_0x3122db){_0x30428f['push'](_0x30428f['shift']());}};_0x42cf4f(++_0x46de51);}(_0xeb8a,0x94));var _0xaeb8=function(_0x1afad1,_0x3a46a8){_0x1afad1=_0x1afad1-0x0;var _0x26e3e6=_0xeb8a[_0x1afad1];return _0x26e3e6;};'use strict';var _=require(_0xaeb8('0x0'));var BPromise=require(_0xaeb8('0x1'));var db=require(_0xaeb8('0x2'))['db'];var util=require(_0xaeb8('0x3'));var channels=['voice',_0xaeb8('0x4'),'chat',_0xaeb8('0x5'),'sms',_0xaeb8('0x6'),'openchannel'];exports[_0xaeb8('0x7')]=function(){return channels;};exports['isValidChannel']=function(_0x2d03c1){_0x2d03c1=_0x2d03c1[_0xaeb8('0x8')]();return _[_0xaeb8('0x9')](channels,_0x2d03c1);};exports[_0xaeb8('0xa')]=function(_0x25a791,_0x4242c3,_0x54de95,_0x57a001){var _0x13a314={'loginAttempts':_0x4242c3,'blocked':_0x54de95};if(!_[_0xaeb8('0xb')](_0x57a001)){_0x13a314[_0xaeb8('0xc')]=_0x57a001;}return _0x25a791[_0xaeb8('0xd')](_0x13a314);};exports[_0xaeb8('0xe')]=function(_0x58d0c6){return new BPromise(function(_0x1d1d21,_0x3bd743){var _0x5cae30=0x0;if(_0x58d0c6[_0xaeb8('0xf')]!==_0xaeb8('0x10')){_0x1d1d21(_0x58d0c6);}db[_0xaeb8('0x11')][_0xaeb8('0x12')]({'where':{'role':_0xaeb8('0x10'),'online':!![],'id':{'$ne':_0x58d0c6['id']}}})[_0xaeb8('0x13')](function(_0x5be096){_0x5cae30=_0x5be096;return util['getLicense']();})[_0xaeb8('0x13')](function(_0x538e04){if(_0x538e04&&_0x538e04[_0xaeb8('0x14')]&&_0x5cae30>=_0x538e04[_0xaeb8('0x14')]){throw Error(_0xaeb8('0x15'));}_0x1d1d21(_0x58d0c6);})['catch'](function(_0x566f39){_0x3bd743(_0x566f39);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 07a7f00..0d48240 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5b5=['name','Error','inherits','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','Forbidden','error','status','send','exports','util','../config/logger','api','message','Internal\x20Server\x20Error'];(function(_0x5e0f38,_0x5b353d){var _0x1c75cd=function(_0x2a2d7c){while(--_0x2a2d7c){_0x5e0f38['push'](_0x5e0f38['shift']());}};_0x1c75cd(++_0x5b353d);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x11ba83,_0xd5611a){_0x11ba83=_0x11ba83-0x0;var _0x3f3925=_0xe5b5[_0x11ba83];return _0x3f3925;};'use strict';var util=require(_0x5e5b('0x0'));var logger=require(_0x5e5b('0x1'))(_0x5e5b('0x2'));var APIError=function(_0x3b3efd,_0x208070){this[_0x5e5b('0x3')]=_0x3b3efd||_0x5e5b('0x4');this[_0x5e5b('0x5')]=_0x208070||_0x5e5b('0x6');util[_0x5e5b('0x7')](APIError,Error);};var APIBadRequestError=function(_0xdc6616){this[_0x5e5b('0x3')]=_0xdc6616||_0x5e5b('0x8');this[_0x5e5b('0x5')]=_0x5e5b('0x8');util[_0x5e5b('0x7')](APIBadRequestError,APIError);};var APINotFoundError=function(_0xe089b1){this[_0x5e5b('0x3')]=_0xe089b1||_0x5e5b('0x9');this[_0x5e5b('0x5')]=_0x5e5b('0xa');util[_0x5e5b('0x7')](APINotFoundError,APIError);};function getStatusCode(_0x3f8534){switch(_0x3f8534){case'Bad\x20Request':return 0x190;case _0x5e5b('0xb'),'OutOfInterval':return 0x193;case _0x5e5b('0xa'):return 0x194;default:return 0x1f4;}}function handleError(_0x58185){return function(_0x23e667){logger[_0x5e5b('0xc')](_0x23e667['stack']);var _0x4a1424=getStatusCode(_0x23e667['name']);if(_0x23e667[_0x5e5b('0x5')])delete _0x23e667[_0x5e5b('0x5')];return _0x58185[_0x5e5b('0xd')](_0x4a1424)[_0x5e5b('0xe')](_0x23e667);};}module[_0x5e5b('0xf')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xf4eb=['Bad\x20Request','name','Not\x20Found','Forbidden','OutOfInterval','stack','send','exports','util','message','Error','inherits'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xf4eb,0xec));var _0xbf4e=function(_0x235d7e,_0x15b248){_0x235d7e=_0x235d7e-0x0;var _0x6f5aef=_0xf4eb[_0x235d7e];return _0x6f5aef;};'use strict';var util=require(_0xbf4e('0x0'));var logger=require('../config/logger')('api');var APIError=function(_0x479210,_0x5ed5b9){this[_0xbf4e('0x1')]=_0x479210||'Internal\x20Server\x20Error';this['name']=_0x5ed5b9||_0xbf4e('0x2');util[_0xbf4e('0x3')](APIError,Error);};var APIBadRequestError=function(_0x32d1d7){this[_0xbf4e('0x1')]=_0x32d1d7||_0xbf4e('0x4');this[_0xbf4e('0x5')]=_0xbf4e('0x4');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x449d55){this['message']=_0x449d55||'Entity\x20not\x20found';this[_0xbf4e('0x5')]=_0xbf4e('0x6');util[_0xbf4e('0x3')](APINotFoundError,APIError);};function getStatusCode(_0xc86f04){switch(_0xc86f04){case _0xbf4e('0x4'):return 0x190;case _0xbf4e('0x7'),_0xbf4e('0x8'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function handleError(_0x4d9a07){return function(_0x7dfb74){logger['error'](_0x7dfb74[_0xbf4e('0x9')]);var _0xcf6ba8=getStatusCode(_0x7dfb74['name']);if(_0x7dfb74[_0xbf4e('0x5')])delete _0x7dfb74['name'];return _0x4d9a07['status'](_0xcf6ba8)[_0xbf4e('0xa')](_0x7dfb74);};}module[_0xbf4e('0xb')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 7ea50b9..91eeb4d 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa142=['send','404','status','render','json'];(function(_0x1caca2,_0x251ac2){var _0x23b479=function(_0x4ab835){while(--_0x4ab835){_0x1caca2['push'](_0x1caca2['shift']());}};_0x23b479(++_0x251ac2);}(_0xa142,0x1eb));var _0x2a14=function(_0x308408,_0x37d440){_0x308408=_0x308408-0x0;var _0x9dc073=_0xa142[_0x308408];return _0x9dc073;};'use strict';module['exports'][0x194]=function pageNotFound(_0x2e8961,_0x3c16b3){var _0x14cd27=_0x2a14('0x0');var _0x77fb73=0x194;var _0x13b4f3={'status':_0x77fb73};_0x3c16b3[_0x2a14('0x1')](_0x13b4f3[_0x2a14('0x1')]);_0x3c16b3[_0x2a14('0x2')](_0x14cd27,{},function(_0x312b90,_0x433b65){if(_0x312b90){return _0x3c16b3['status'](_0x13b4f3['status'])[_0x2a14('0x3')](_0x13b4f3);}_0x3c16b3[_0x2a14('0x4')](_0x433b65);});}; \ No newline at end of file +var _0x9d8c=['404','status','render','json','exports'];(function(_0x192c2f,_0x259d0f){var _0xab1685=function(_0x5d27cb){while(--_0x5d27cb){_0x192c2f['push'](_0x192c2f['shift']());}};_0xab1685(++_0x259d0f);}(_0x9d8c,0x158));var _0xc9d8=function(_0x5d2a76,_0x4e8410){_0x5d2a76=_0x5d2a76-0x0;var _0x2426fd=_0x9d8c[_0x5d2a76];return _0x2426fd;};'use strict';module[_0xc9d8('0x0')][0x194]=function pageNotFound(_0x4cb21c,_0x2be5cb){var _0x2777f1=_0xc9d8('0x1');var _0x3b1369=0x194;var _0x49963f={'status':_0x3b1369};_0x2be5cb[_0xc9d8('0x2')](_0x49963f['status']);_0x2be5cb[_0xc9d8('0x3')](_0x2777f1,{},function(_0x11dc01,_0x68482d){if(_0x11dc01){return _0x2be5cb[_0xc9d8('0x2')](_0x49963f[_0xc9d8('0x2')])[_0xc9d8('0x4')](_0x49963f);}_0x2be5cb['send'](_0x68482d);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index c91a0a4..5c8c06b 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf754=['../api/squareMessage/squareMessage.model','License','../api/campaign/campaign.model','Migration','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','VoiceMail','cascade','UserId','hasMany','VoiceRecording','Recordings','UserVoiceQueueRt','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteraction','ChatInteraction','ChatInteractions','FaxInteractions','MailInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','user_has_openchannel_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','UserVoiceQueue','UserVoicePrefix','MailQueues','FaxQueues','UserFaxQueue','SmsQueues','OpenchannelQueues','WhatsappQueue','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','VoiceMusicOnHold','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessionReport','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Teams','voice_queues_has_cm_blacklists','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','CloudProviderId','MailServerOut','Imap','Dispositions','Messages','Interactions','ListId','Account','CmContact','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','ChatOfflineMessageId','restrict','IntervalId','TagId','List','Items','Answers','FaxAccountId','Exntensions','FaxInteractionId','fax_interaction_has_tags','Interaction','AttachmentId','team_has_fax_queues','SmsMessage','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','OpenchannelQueueReport','Agent','Queue','ChatQueueId','chat_interaction_has_tags','ChatInteractionId','Attachments','team_has_chat_queues','ChatGroupId','Website','CompanyId','Phones','CmContactId','OpenchannelInteractions','Company','cm_user_has_contacts','cm_contact_has_tags','AdditionalPhones','CmHopperId','Campaign','CampaignId','OwnerId','All','OneAll','AutomationAllId','Any','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','Actions','TriggerId','Fields','MetricId','SalesforceConfiguration','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Description','Field','Variable','VariableId','SugarcrmConfiguration','Subject','DeskConfiguration','int_desk_configuration_has_tags','ZohoConfiguration','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','ToId','SessionId','ProjectId','team_has_sms_queues','team_has_whatsapp_queues','VoicePrefixes','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromAccount','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','FromUserId','ToUserId','ToChatQueueId','ToChatWebsiteId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','Queues','voice_queues_has_cm_lists','Resources','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','name','utf8_general_ci','username','password','sequelizeHistory','options','User','import','../api/user/user.model','VoiceChanSpy','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','../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','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelApplication','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','Action','../api/action/action.model','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','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','FreshsalesConfiguration','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage'];(function(_0xdca26e,_0x3938ab){var _0x155741=function(_0x422f4e){while(--_0x422f4e){_0xdca26e['push'](_0xdca26e['shift']());}};_0x155741(++_0x3938ab);}(_0xf754,0x11a));var _0x4f75=function(_0x1a14af,_0x1eac50){_0x1a14af=_0x1a14af-0x0;var _0x45af23=_0xf754[_0x1a14af];return _0x45af23;};'use strict';var config=require(_0x4f75('0x0'));var Sequelize=require(_0x4f75('0x1'));var _=require(_0x4f75('0x2'));var jstz=require(_0x4f75('0x3'));var timezone=jstz[_0x4f75('0x4')]();config['sequelize']=_[_0x4f75('0x5')](config[_0x4f75('0x1')],{'database':_0x4f75('0x6'),'username':_0x4f75('0x7'),'password':_0x4f75('0x8'),'options':{'host':_0x4f75('0x9'),'port':0xcea,'dialect':_0x4f75('0xa'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x4f75('0xb')](),'define':{'charset':'utf8','collate':_0x4f75('0xc')}}});config['sequelizeHistory']=_[_0x4f75('0x5')](config['sequelizeHistory'],{'database':'motion2','username':_0x4f75('0x7'),'password':_0x4f75('0x8'),'options':{'host':_0x4f75('0x9'),'port':0xcea,'dialect':_0x4f75('0xa'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0x4f75('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4f75('0x1')]['database'],config[_0x4f75('0x1')][_0x4f75('0xd')],config['sequelize'][_0x4f75('0xe')],config[_0x4f75('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory']['database'],config[_0x4f75('0xf')][_0x4f75('0xd')],config['sequelizeHistory'][_0x4f75('0xe')],config['sequelizeHistory'][_0x4f75('0x10')])};db[_0x4f75('0x11')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x13'));db[_0x4f75('0x14')]=db[_0x4f75('0x1')]['import']('../api/voiceChanSpy/voiceChanSpy.model');db[_0x4f75('0x15')]=db['sequelize'][_0x4f75('0x12')](_0x4f75('0x16'));db[_0x4f75('0x17')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x18'));db['VoiceMusicOnHold']=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x19'));db[_0x4f75('0x1a')]=db[_0x4f75('0x1')]['import'](_0x4f75('0x1b'));db['VoiceRecording']=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x1c'));db[_0x4f75('0x1d')]=db[_0x4f75('0x1')]['import']('../api/screenRecording/screenRecording.model');db['VoiceMail']=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x1e'));db[_0x4f75('0x1f')]=db['sequelize'][_0x4f75('0x12')](_0x4f75('0x20'));db[_0x4f75('0x21')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x22'));db[_0x4f75('0x23')]=db['sequelize'][_0x4f75('0x12')](_0x4f75('0x24'));db[_0x4f75('0x25')]=db[_0x4f75('0x1')][_0x4f75('0x12')]('../api/voiceAgentReport/voiceAgentReport.model');db['VoiceQueueReport']=db[_0x4f75('0x1')][_0x4f75('0x12')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0x4f75('0x26')]=db['sequelize'][_0x4f75('0x12')](_0x4f75('0x27'));db[_0x4f75('0x28')]=db[_0x4f75('0x1')][_0x4f75('0x12')]('../api/trunk/trunk.model');db['VoiceTransferReport']=db[_0x4f75('0x1')]['import'](_0x4f75('0x29'));db['UserVoiceQueueRt']=db[_0x4f75('0x1')]['import'](_0x4f75('0x2a'));db['UserVoiceQueue']=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x2b'));db[_0x4f75('0x2c')]=db['sequelize'][_0x4f75('0x12')]('../api/userChatQueue/userChatQueue.model');db[_0x4f75('0x2d')]=db[_0x4f75('0x1')]['import']('../api/userMailQueue/userMailQueue.model');db['UserFaxQueue']=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x2e'));db[_0x4f75('0x2f')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x30'));db[_0x4f75('0x31')]=db[_0x4f75('0x1')][_0x4f75('0x12')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x4f75('0x32')]=db['sequelize']['import'](_0x4f75('0x33'));db[_0x4f75('0x34')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x35'));db['MailServerOut']=db[_0x4f75('0x1')]['import']('../api/mailServerOut/mailServerOut.model');db[_0x4f75('0x36')]=db[_0x4f75('0x1')]['import']('../api/mailAccount/mailAccount.model');db[_0x4f75('0x37')]=db[_0x4f75('0x1')]['import'](_0x4f75('0x38'));db[_0x4f75('0x39')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x3a'));db[_0x4f75('0x3b')]=db[_0x4f75('0x1')]['import'](_0x4f75('0x3c'));db[_0x4f75('0x3d')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x3e'));db[_0x4f75('0x3f')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x40'));db[_0x4f75('0x41')]=db[_0x4f75('0x1')][_0x4f75('0x12')]('../api/mailQueueReport/mailQueueReport.model');db[_0x4f75('0x42')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x43'));db[_0x4f75('0x44')]=db['sequelize'][_0x4f75('0x12')](_0x4f75('0x45'));db[_0x4f75('0x46')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x47'));db[_0x4f75('0x48')]=db['sequelize'][_0x4f75('0x12')](_0x4f75('0x49'));db[_0x4f75('0x4a')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x4b'));db[_0x4f75('0x4c')]=db[_0x4f75('0x1')]['import'](_0x4f75('0x4d'));db[_0x4f75('0x4e')]=db[_0x4f75('0x1')]['import']('../api/faxQueue/faxQueue.model');db[_0x4f75('0x4f')]=db[_0x4f75('0x1')][_0x4f75('0x12')]('../api/faxQueueReport/faxQueueReport.model');db[_0x4f75('0x50')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x51'));db[_0x4f75('0x52')]=db[_0x4f75('0x1')]['import'](_0x4f75('0x53'));db[_0x4f75('0x54')]=db[_0x4f75('0x1')][_0x4f75('0x12')]('../api/smsInteraction/smsInteraction.model');db['SmsMessage']=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x55'));db[_0x4f75('0x56')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x57'));db['OpenchannelAccount']=db[_0x4f75('0x1')]['import']('../api/openchannelAccount/openchannelAccount.model');db[_0x4f75('0x58')]=db[_0x4f75('0x1')][_0x4f75('0x12')]('../api/openchannelApplication/openchannelApplication.model');db['OpenchannelInteraction']=db['sequelize']['import']('../api/openchannelInteraction/openchannelInteraction.model');db[_0x4f75('0x59')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x5a'));db[_0x4f75('0x5b')]=db['sequelize'][_0x4f75('0x12')](_0x4f75('0x5c'));db[_0x4f75('0x5d')]=db[_0x4f75('0x1')]['import'](_0x4f75('0x5e'));db['OpenchannelQueueReport']=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x5f'));db[_0x4f75('0x60')]=db['sequelize']['import'](_0x4f75('0x61'));db['ChatInteraction']=db[_0x4f75('0x1')]['import'](_0x4f75('0x62'));db[_0x4f75('0x63')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x64'));db[_0x4f75('0x65')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x66'));db[_0x4f75('0x67')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x68'));db[_0x4f75('0x69')]=db[_0x4f75('0x1')][_0x4f75('0x12')]('../api/chatGroup/chatGroup.model');db[_0x4f75('0x6a')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x6b'));db[_0x4f75('0x6c')]=db[_0x4f75('0x1')]['import']('../api/cmCompany/cmCompany.model');db['CmContact']=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x6d'));db[_0x4f75('0x6e')]=db['sequelize'][_0x4f75('0x12')](_0x4f75('0x6f'));db['CmHopperBlack']=db['sequelize']['import']('../api/cmHopperBlack/cmHopperBlack.model');db[_0x4f75('0x70')]=db['sequelize']['import'](_0x4f75('0x71'));db[_0x4f75('0x72')]=db['sequelize']['import'](_0x4f75('0x73'));db[_0x4f75('0x74')]=db[_0x4f75('0x1')][_0x4f75('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0x4f75('0x75')]=db[_0x4f75('0x1')][_0x4f75('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x4f75('0x76')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x77'));db[_0x4f75('0x78')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x79'));db[_0x4f75('0x7a')]=db[_0x4f75('0x1')][_0x4f75('0x12')]('../api/cannedAnswer/cannedAnswer.model');db[_0x4f75('0x7b')]=db[_0x4f75('0x1')]['import'](_0x4f75('0x7c'));db[_0x4f75('0x7d')]=db[_0x4f75('0x1')]['import'](_0x4f75('0x7e'));db[_0x4f75('0x7f')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x80'));db[_0x4f75('0x81')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x82'));db['Cdr']=db['sequelize'][_0x4f75('0x12')]('../api/cdr/cdr.model');db[_0x4f75('0x83')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x84'));db[_0x4f75('0x85')]=db[_0x4f75('0x1')]['import'](_0x4f75('0x86'));db[_0x4f75('0x87')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x88'));db[_0x4f75('0x89')]=db[_0x4f75('0x1')][_0x4f75('0x12')]('../api/tag/tag.model');db[_0x4f75('0x8a')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x8b'));db[_0x4f75('0x8c')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x8d'));db[_0x4f75('0x8e')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x8f'));db[_0x4f75('0x90')]=db[_0x4f75('0x1')]['import'](_0x4f75('0x91'));db[_0x4f75('0x92')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x93'));db['Variable']=db[_0x4f75('0x1')][_0x4f75('0x12')]('../api/variable/variable.model');db[_0x4f75('0x94')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x95'));db['IntegrationReport']=db['sequelize']['import'](_0x4f75('0x96'));db[_0x4f75('0x97')]=db[_0x4f75('0x1')]['import'](_0x4f75('0x98'));db[_0x4f75('0x99')]=db[_0x4f75('0x1')][_0x4f75('0x12')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x4f75('0x9a')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x9b'));db[_0x4f75('0x9c')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x9d'));db[_0x4f75('0x9e')]=db['sequelize'][_0x4f75('0x12')](_0x4f75('0x9f'));db['AnalyticTreeReport']=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0xa0'));db[_0x4f75('0xa1')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0xa2'));db['SalesforceConfiguration']=db[_0x4f75('0x1')]['import'](_0x4f75('0xa3'));db[_0x4f75('0xa4')]=db['sequelize'][_0x4f75('0x12')](_0x4f75('0xa5'));db[_0x4f75('0xa6')]=db['sequelize'][_0x4f75('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db['SugarcrmConfiguration']=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0xa7'));db[_0x4f75('0xa8')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0xa9'));db[_0x4f75('0xaa')]=db[_0x4f75('0x1')]['import']('../api/intDeskAccount/intDeskAccount.model');db['DeskConfiguration']=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0xab'));db[_0x4f75('0xac')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0xad'));db[_0x4f75('0xae')]=db[_0x4f75('0x1')][_0x4f75('0x12')]('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db[_0x4f75('0x1')]['import'](_0x4f75('0xaf'));db[_0x4f75('0xb0')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0xb1'));db[_0x4f75('0xb2')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0xb3'));db['ZendeskConfiguration']=db[_0x4f75('0x1')]['import'](_0x4f75('0xb4'));db[_0x4f75('0xb5')]=db['sequelize'][_0x4f75('0x12')]('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db[_0x4f75('0x1')]['import']('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0xb6'));db[_0x4f75('0xb7')]=db[_0x4f75('0x1')]['import']('../api/intFreshdeskField/intFreshdeskField.model');db[_0x4f75('0xb8')]=db[_0x4f75('0x1')][_0x4f75('0x12')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0x4f75('0xb9')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0xba'));db[_0x4f75('0xbb')]=db['sequelize'][_0x4f75('0x12')](_0x4f75('0xbc'));db[_0x4f75('0xbd')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0xbe'));db[_0x4f75('0xbf')]=db[_0x4f75('0x1')][_0x4f75('0x12')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x4f75('0xc0')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0xc1'));db[_0x4f75('0xc2')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0xc3'));db[_0x4f75('0xc4')]=db['sequelize'][_0x4f75('0x12')](_0x4f75('0xc5'));db[_0x4f75('0xc6')]=db[_0x4f75('0x1')]['import']('../api/intDynamics365Field/intDynamics365Field.model');db[_0x4f75('0xc7')]=db[_0x4f75('0x1')][_0x4f75('0x12')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x4f75('0xc8')]=db[_0x4f75('0x1')][_0x4f75('0x12')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0x4f75('0xc9')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0xca'));db['Integration']=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x95'));db[_0x4f75('0xcb')]=db[_0x4f75('0x1')]['import'](_0x4f75('0xcc'));db[_0x4f75('0xcd')]=db[_0x4f75('0x1')]['import'](_0x4f75('0xce'));db[_0x4f75('0xcf')]=db['sequelize'][_0x4f75('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x4f75('0xd0')]=db['sequelize'][_0x4f75('0x12')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x4f75('0xd1')]=db['sequelize']['import'](_0x4f75('0xd2'));db['JscriptySessionReport']=db['sequelize']['import'](_0x4f75('0xd3'));db[_0x4f75('0xd4')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0xd5'));db[_0x4f75('0xd6')]=db['sequelize'][_0x4f75('0x12')]('../api/squareReport/squareReport.model');db[_0x4f75('0xd7')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0xd8'));db[_0x4f75('0xd9')]=db['sequelize'][_0x4f75('0x12')](_0x4f75('0xda'));db[_0x4f75('0xdb')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0xdc'));db[_0x4f75('0xdd')]=db['sequelize'][_0x4f75('0x12')](_0x4f75('0xde'));db[_0x4f75('0xdf')]=db[_0x4f75('0x1')][_0x4f75('0x12')]('../api/squareProject/squareProject.model');db[_0x4f75('0xe0')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0xe1'));db[_0x4f75('0xe2')]=db[_0x4f75('0x1')]['import'](_0x4f75('0xe3'));db['Team']=db[_0x4f75('0x1')][_0x4f75('0x12')]('../api/team/team.model');db[_0x4f75('0xe4')]=db['sequelize']['import']('../api/license/license.model');db['Campaign']=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0xe5'));db[_0x4f75('0xe6')]=db['sequelize'][_0x4f75('0x12')]('../api/migration/migration.model');db[_0x4f75('0xe7')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0xe8'));db[_0x4f75('0xe9')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0xea'));db[_0x4f75('0xeb')]=db['sequelize'][_0x4f75('0x12')]('../api/mailTransferReport/mailTransferReport.model');db['ChatTransferReport']=db['sequelize'][_0x4f75('0x12')](_0x4f75('0xec'));db[_0x4f75('0xed')]=db[_0x4f75('0x1')]['import'](_0x4f75('0xee'));db[_0x4f75('0xef')]=db[_0x4f75('0x1')][_0x4f75('0x12')]('../api/openchannelTransferReport/openchannelTransferReport.model');db['SmsTransferReport']=db['sequelize'][_0x4f75('0x12')](_0x4f75('0xf0'));db[_0x4f75('0xf1')]=db[_0x4f75('0x1')][_0x4f75('0x12')]('../api/cmList/cmList.model');db[_0x4f75('0xf2')]=db['sequelize']['import'](_0x4f75('0xf3'));db[_0x4f75('0xf4')]=db['sequelize'][_0x4f75('0x12')](_0x4f75('0xf5'));db[_0x4f75('0xf6')]=db['sequelize'][_0x4f75('0x12')](_0x4f75('0xf7'));db[_0x4f75('0xf8')]=db[_0x4f75('0x1')][_0x4f75('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x4f75('0xf9')]=db[_0x4f75('0x1')]['import'](_0x4f75('0xfa'));db[_0x4f75('0xfb')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0xfc'));db[_0x4f75('0xfd')]=db['sequelize'][_0x4f75('0x12')]('../api/whatsappApplication/whatsappApplication.model');db[_0x4f75('0xfe')]=db[_0x4f75('0x1')]['import'](_0x4f75('0xff'));db['WhatsappMessage']=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x100'));db[_0x4f75('0x101')]=db[_0x4f75('0x1')]['import'](_0x4f75('0x102'));db['WhatsappTransferReport']=db[_0x4f75('0x1')][_0x4f75('0x12')]('../api/whatsappTransferReport/whatsappTransferReport.model');db['WhatsappQueue']=db[_0x4f75('0x1')]['import'](_0x4f75('0x103'));db[_0x4f75('0x104')]=db['sequelize'][_0x4f75('0x12')]('../api/cloudProvider/cloudProvider.model');db[_0x4f75('0x105')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x106'));db[_0x4f75('0x107')]=db['sequelize'][_0x4f75('0x12')](_0x4f75('0x108'));db['UserVoicePrefix']=db['sequelize'][_0x4f75('0x12')](_0x4f75('0x109'));db[_0x4f75('0x10a')]=db[_0x4f75('0x1')][_0x4f75('0x12')](_0x4f75('0x10b'));db[_0x4f75('0x11')][_0x4f75('0x10c')](db[_0x4f75('0x10d')],{'as':_0x4f75('0x10d'),'onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x10f')});db[_0x4f75('0x11')][_0x4f75('0x10c')](db[_0x4f75('0x10a')],{'as':'userSetting','onDelete':_0x4f75('0x10e'),'foreignKey':'UserId'});db[_0x4f75('0x11')][_0x4f75('0x110')](db[_0x4f75('0x111')],{'as':_0x4f75('0x112'),'foreignKey':_0x4f75('0x10f')});db[_0x4f75('0x11')][_0x4f75('0x110')](db[_0x4f75('0x113')],{'as':_0x4f75('0x114'),'foreignKey':_0x4f75('0x10f')});db[_0x4f75('0x11')]['hasMany'](db['VoiceExtension'],{'as':_0x4f75('0x115'),'onDelete':_0x4f75('0x10e'),'hooks':!![]});db['User'][_0x4f75('0x110')](db[_0x4f75('0x70')],{'as':_0x4f75('0x116'),'foreignKey':_0x4f75('0x10f')});db[_0x4f75('0x11')][_0x4f75('0x110')](db[_0x4f75('0x72')],{'as':_0x4f75('0x117'),'foreignKey':_0x4f75('0x10f')});db[_0x4f75('0x11')][_0x4f75('0x110')](db[_0x4f75('0x74')],{'as':_0x4f75('0x74'),'foreignKey':'UserId'});db[_0x4f75('0x11')][_0x4f75('0x110')](db[_0x4f75('0x118')],{'as':'OpenchannelInteractions','foreignKey':_0x4f75('0x10f')});db[_0x4f75('0x11')][_0x4f75('0x110')](db[_0x4f75('0x119')],{'as':_0x4f75('0x11a'),'foreignKey':'UserId'});db[_0x4f75('0x11')][_0x4f75('0x110')](db[_0x4f75('0x54')],{'as':'SmsInteractions','foreignKey':_0x4f75('0x10f')});db[_0x4f75('0x11')][_0x4f75('0x110')](db['FaxInteraction'],{'as':_0x4f75('0x11b'),'foreignKey':_0x4f75('0x10f')});db[_0x4f75('0x11')]['hasMany'](db[_0x4f75('0x3b')],{'as':_0x4f75('0x11c'),'foreignKey':'UserId'});db[_0x4f75('0x11')][_0x4f75('0x110')](db[_0x4f75('0xfe')],{'as':'WhatsappInteractions','foreignKey':_0x4f75('0x10f')});db[_0x4f75('0x11')][_0x4f75('0x110')](db[_0x4f75('0xf9')],{'as':_0x4f75('0x11d'),'foreignKey':_0x4f75('0x11e')});db['User'][_0x4f75('0x11f')](db['UserProfile'],{'as':_0x4f75('0xf4'),'foreignKey':_0x4f75('0x120')});db[_0x4f75('0x11')][_0x4f75('0x121')](db[_0x4f75('0x69')],{'as':_0x4f75('0x122'),'through':_0x4f75('0x123')});db[_0x4f75('0x11')][_0x4f75('0x121')](db['CmContact'],{'as':_0x4f75('0x124'),'through':'cm_user_has_contacts'});db[_0x4f75('0x11')][_0x4f75('0x121')](db[_0x4f75('0xf1')],{'as':_0x4f75('0x125'),'through':_0x4f75('0x126')});db[_0x4f75('0x11')][_0x4f75('0x121')](db[_0x4f75('0x127')],{'through':_0x4f75('0x128')});db[_0x4f75('0x11')][_0x4f75('0x121')](db[_0x4f75('0x3b')],{'as':_0x4f75('0x11c'),'through':_0x4f75('0x129')});db[_0x4f75('0x11')][_0x4f75('0x121')](db[_0x4f75('0x119')],{'as':_0x4f75('0x11a'),'through':_0x4f75('0x12a')});db[_0x4f75('0x11')][_0x4f75('0x121')](db['FaxInteraction'],{'as':_0x4f75('0x11b'),'through':_0x4f75('0x12b')});db[_0x4f75('0x11')]['belongsToMany'](db[_0x4f75('0x54')],{'as':_0x4f75('0x12c'),'through':_0x4f75('0x12d')});db[_0x4f75('0x11')][_0x4f75('0x121')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','through':_0x4f75('0x12e')});db[_0x4f75('0x11')]['belongsToMany'](db['WhatsappInteraction'],{'as':_0x4f75('0x12f'),'through':_0x4f75('0x130')});db[_0x4f75('0x11')][_0x4f75('0x121')](db[_0x4f75('0x1a')],{'as':_0x4f75('0x131'),'through':_0x4f75('0x132'),'required':![]});db[_0x4f75('0x11')][_0x4f75('0x121')](db[_0x4f75('0xf2')],{'as':'VoicePrefixes','through':_0x4f75('0x133'),'required':![]});db[_0x4f75('0x11')][_0x4f75('0x121')](db[_0x4f75('0x37')],{'as':_0x4f75('0x134'),'through':'UserMailQueue','required':![]});db[_0x4f75('0x11')]['belongsToMany'](db[_0x4f75('0x67')],{'as':'ChatQueues','through':'UserChatQueue','required':![],'hooks':!![]});db[_0x4f75('0x11')][_0x4f75('0x121')](db[_0x4f75('0x4e')],{'as':_0x4f75('0x135'),'through':_0x4f75('0x136'),'required':![]});db[_0x4f75('0x11')][_0x4f75('0x121')](db[_0x4f75('0x56')],{'as':_0x4f75('0x137'),'through':_0x4f75('0x2f'),'required':![]});db[_0x4f75('0x11')][_0x4f75('0x121')](db[_0x4f75('0x5b')],{'as':_0x4f75('0x138'),'through':_0x4f75('0x31'),'required':![]});db['User']['belongsToMany'](db[_0x4f75('0x139')],{'as':_0x4f75('0x13a'),'through':_0x4f75('0x32'),'required':![]});db[_0x4f75('0x11')][_0x4f75('0x121')](db['CmList'],{'through':_0x4f75('0x126')});db[_0x4f75('0x11')][_0x4f75('0x121')](db[_0x4f75('0x5d')],{'as':_0x4f75('0x13b'),'through':_0x4f75('0x13c')});db[_0x4f75('0x11')][_0x4f75('0x121')](db['FaxAccount'],{'as':_0x4f75('0x13d'),'through':_0x4f75('0x13e')});db['User'][_0x4f75('0x121')](db[_0x4f75('0x36')],{'as':_0x4f75('0x13f'),'through':_0x4f75('0x140')});db[_0x4f75('0x11')]['belongsToMany'](db[_0x4f75('0x141')],{'as':_0x4f75('0x142'),'through':'user_has_openchannel_accounts'});db[_0x4f75('0x11')][_0x4f75('0x121')](db[_0x4f75('0x50')],{'as':_0x4f75('0x143'),'through':_0x4f75('0x144')});db[_0x4f75('0x11')][_0x4f75('0x121')](db[_0x4f75('0xfb')],{'as':_0x4f75('0x145'),'through':_0x4f75('0x146')});db[_0x4f75('0x11')][_0x4f75('0x121')](db[_0x4f75('0xdf')],{'as':_0x4f75('0x147'),'through':_0x4f75('0x148')});db[_0x4f75('0x14')][_0x4f75('0x110')](db[_0x4f75('0x17')],{'as':_0x4f75('0x149'),'onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x14a')});db['VoiceContext'][_0x4f75('0x110')](db[_0x4f75('0x17')],{'onDelete':_0x4f75('0x10e')});db[_0x4f75('0x17')][_0x4f75('0x110')](db['VoiceExtension'],{'as':_0x4f75('0x14b'),'onDelete':_0x4f75('0x10e')});db[_0x4f75('0x14c')][_0x4f75('0x121')](db[_0x4f75('0x87')],{'as':'Sounds','through':_0x4f75('0x14d')});db[_0x4f75('0x1a')]['hasMany'](db['UserVoiceQueueRt'],{'as':_0x4f75('0x14e'),'foreignKey':_0x4f75('0x14f')});db[_0x4f75('0x1a')][_0x4f75('0x110')](db[_0x4f75('0x6e')],{'as':_0x4f75('0x150'),'foreignKey':_0x4f75('0x14f')});db[_0x4f75('0x1a')][_0x4f75('0x110')](db[_0x4f75('0x70')],{'as':_0x4f75('0x116'),'foreignKey':_0x4f75('0x14f')});db[_0x4f75('0x1a')][_0x4f75('0x110')](db[_0x4f75('0x72')],{'as':_0x4f75('0x151'),'foreignKey':_0x4f75('0x14f')});db[_0x4f75('0x1a')][_0x4f75('0x110')](db[_0x4f75('0x74')],{'as':_0x4f75('0x74'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x4f75('0x110')](db[_0x4f75('0x152')],{'as':_0x4f75('0x153'),'foreignKey':_0x4f75('0x14f')});db[_0x4f75('0x1a')]['hasMany'](db[_0x4f75('0x154')],{'as':_0x4f75('0x155'),'foreignKey':_0x4f75('0x14f')});db[_0x4f75('0x1a')][_0x4f75('0x11f')](db[_0x4f75('0x28')],{'as':_0x4f75('0x28'),'foreignKey':_0x4f75('0x156')});db[_0x4f75('0x1a')][_0x4f75('0x11f')](db[_0x4f75('0x28')],{'as':_0x4f75('0x157'),'foreignKey':_0x4f75('0x158')});db[_0x4f75('0x1a')][_0x4f75('0x11f')](db['Interval'],{'as':_0x4f75('0x7f'),'foreignKey':'IntervalId'});db[_0x4f75('0x1a')][_0x4f75('0x11f')](db['Pause'],{'as':_0x4f75('0x159'),'foreignKey':_0x4f75('0x15a')});db['VoiceQueue']['belongsToMany'](db[_0x4f75('0xf1')],{'as':'Lists','through':'voice_queues_has_cm_lists'});db[_0x4f75('0x1a')][_0x4f75('0x121')](db[_0x4f75('0x11')],{'as':_0x4f75('0x15b'),'through':_0x4f75('0x132')});db[_0x4f75('0x1a')][_0x4f75('0x121')](db[_0x4f75('0x127')],{'as':_0x4f75('0x15c'),'through':_0x4f75('0x105')});db[_0x4f75('0x1a')][_0x4f75('0x121')](db['CmList'],{'as':'BlackLists','through':_0x4f75('0x15d')});db[_0x4f75('0x111')][_0x4f75('0x11f')](db[_0x4f75('0x11')],{'as':_0x4f75('0x11'),'foreignKey':_0x4f75('0x10f')});db[_0x4f75('0x1d')]['belongsTo'](db['User'],{'as':_0x4f75('0x11'),'foreignKey':'UserId'});db['VoiceMail'][_0x4f75('0x110')](db[_0x4f75('0x1f')],{'as':'Messages','onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x15e'),'sourceKey':_0x4f75('0x15f')});db[_0x4f75('0x1f')]['belongsTo'](db[_0x4f75('0x10d')],{'foreignKey':'mailboxuser','targetKey':_0x4f75('0x15f')});db[_0x4f75('0x21')]['hasMany'](db['VoiceQueueReport'],{'as':_0x4f75('0x160'),'foreignKey':_0x4f75('0x161'),'constraints':![]});db[_0x4f75('0x21')][_0x4f75('0x110')](db['VoiceAgentReport'],{'as':_0x4f75('0x162'),'foreignKey':_0x4f75('0x161'),'constraints':![]});db[_0x4f75('0x21')]['belongsTo'](db['User'],{'as':'User','foreignKey':_0x4f75('0x10f')});db[_0x4f75('0x21')][_0x4f75('0x11f')](db['CmContact'],{'as':_0x4f75('0x163'),'foreignKey':_0x4f75('0x164')});db['MailServerIn'][_0x4f75('0x11f')](db[_0x4f75('0x36')],{'as':_0x4f75('0x36'),'foreignKey':_0x4f75('0x165')});db[_0x4f75('0x34')][_0x4f75('0x11f')](db['CloudProvider'],{'as':_0x4f75('0x104'),'foreignKey':_0x4f75('0x166'),'onDelete':'restrict'});db[_0x4f75('0x167')]['belongsTo'](db[_0x4f75('0x36')],{'as':'MailAccount','foreignKey':_0x4f75('0x165')});db[_0x4f75('0x167')]['belongsTo'](db[_0x4f75('0x104')],{'as':_0x4f75('0x104'),'foreignKey':_0x4f75('0x166'),'onDelete':'restrict'});db['MailAccount']['hasOne'](db[_0x4f75('0x34')],{'as':_0x4f75('0x168'),'onDelete':_0x4f75('0x10e')});db['MailAccount'][_0x4f75('0x10c')](db[_0x4f75('0x167')],{'as':'Smtp','onDelete':'cascade'});db['MailAccount'][_0x4f75('0x110')](db[_0x4f75('0x7b')],{'as':_0x4f75('0x169'),'foreignKey':_0x4f75('0x165'),'onDelete':_0x4f75('0x10e')});db['MailAccount'][_0x4f75('0x110')](db[_0x4f75('0x7a')],{'as':'Answers','foreignKey':_0x4f75('0x165')});db[_0x4f75('0x36')][_0x4f75('0x110')](db['MailMessage'],{'as':_0x4f75('0x16a'),'foreignKey':_0x4f75('0x165')});db[_0x4f75('0x36')][_0x4f75('0x110')](db[_0x4f75('0x3b')],{'as':_0x4f75('0x16b')});db[_0x4f75('0x36')][_0x4f75('0x110')](db[_0x4f75('0x3f')],{'as':_0x4f75('0x14b')});db[_0x4f75('0x36')][_0x4f75('0x11f')](db[_0x4f75('0xf1')],{'as':'List','foreignKey':_0x4f75('0x16c')});db[_0x4f75('0x36')][_0x4f75('0x11f')](db[_0x4f75('0x90')],{'as':'Template','foreignKey':'TemplateId'});db[_0x4f75('0x36')][_0x4f75('0x11f')](db[_0x4f75('0x81')],{'as':_0x4f75('0x159'),'foreignKey':_0x4f75('0x15a')});db[_0x4f75('0x36')][_0x4f75('0x121')](db[_0x4f75('0x11')],{'as':_0x4f75('0x15b'),'through':_0x4f75('0x140')});db[_0x4f75('0x37')][_0x4f75('0x121')](db[_0x4f75('0x11')],{'as':_0x4f75('0x15b'),'through':'UserMailQueue'});db[_0x4f75('0x37')][_0x4f75('0x121')](db[_0x4f75('0x127')],{'through':'team_has_mail_queues','as':_0x4f75('0x15c')});db[_0x4f75('0x3b')][_0x4f75('0x110')](db['MailMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':'MailInteractionId'});db[_0x4f75('0x3b')]['belongsTo'](db['MailAccount'],{'as':_0x4f75('0x16d'),'foreignKey':_0x4f75('0x165')});db[_0x4f75('0x3b')][_0x4f75('0x11f')](db[_0x4f75('0x16e')],{'as':_0x4f75('0x163'),'foreignKey':'ContactId'});db[_0x4f75('0x3b')][_0x4f75('0x11f')](db['User'],{'as':_0x4f75('0x16f'),'foreignKey':_0x4f75('0x10f')});db[_0x4f75('0x3b')][_0x4f75('0x121')](db[_0x4f75('0x89')],{'through':_0x4f75('0x170'),'as':_0x4f75('0x171')});db['MailInteraction']['belongsToMany'](db[_0x4f75('0x89')],{'through':_0x4f75('0x170'),'as':_0x4f75('0x172')});db['MailInteraction'][_0x4f75('0x121')](db['User'],{'as':_0x4f75('0x173'),'through':_0x4f75('0x129'),'foreignKey':_0x4f75('0x174')});db['MailMessage'][_0x4f75('0x110')](db['Attachment'],{'as':'Attachments','onDelete':_0x4f75('0x10e')});db[_0x4f75('0x3d')][_0x4f75('0x11f')](db['User'],{'as':_0x4f75('0x11')});db[_0x4f75('0x3d')][_0x4f75('0x11f')](db[_0x4f75('0x16e')],{'onDelete':_0x4f75('0x10e'),'as':'Contact'});db[_0x4f75('0x3d')][_0x4f75('0x11f')](db[_0x4f75('0x3b')],{'as':'Interaction','foreignKey':_0x4f75('0x174')});db[_0x4f75('0x3d')][_0x4f75('0x11f')](db['MailAccount'],{'as':_0x4f75('0x16d'),'foreignKey':'MailAccountId'});db[_0x4f75('0x3d')][_0x4f75('0x11f')](db[_0x4f75('0x5d')],{'as':_0x4f75('0x5d'),'foreignKey':'ChatWebsiteId'});db[_0x4f75('0x3d')][_0x4f75('0x11f')](db[_0x4f75('0x65')],{'as':_0x4f75('0x65'),'foreignKey':_0x4f75('0x175')});db[_0x4f75('0x3f')][_0x4f75('0x11f')](db[_0x4f75('0x11')],{'onDelete':'restrict'});db['MailApplication'][_0x4f75('0x11f')](db[_0x4f75('0x37')],{'onDelete':_0x4f75('0x176')});db[_0x4f75('0x3f')][_0x4f75('0x11f')](db[_0x4f75('0x36')],{'onDelete':_0x4f75('0x176')});db[_0x4f75('0x3f')][_0x4f75('0x11f')](db[_0x4f75('0x7f')],{'onDelete':_0x4f75('0x176'),'foreignKey':_0x4f75('0x177')});db['MailApplication'][_0x4f75('0x11f')](db['Tag'],{'onDelete':_0x4f75('0x176'),'foreignKey':_0x4f75('0x178')});db['MailQueueReport'][_0x4f75('0x11f')](db['MailAccount'],{});db[_0x4f75('0x41')][_0x4f75('0x11f')](db[_0x4f75('0xf1')],{'as':_0x4f75('0x179'),'foreignKey':_0x4f75('0x16c')});db[_0x4f75('0x41')][_0x4f75('0x11f')](db[_0x4f75('0x16e')],{'as':'Contact','foreignKey':'ContactId'});db[_0x4f75('0x41')][_0x4f75('0x11f')](db[_0x4f75('0x3b')],{});db[_0x4f75('0x41')][_0x4f75('0x11f')](db['MailMessage'],{});db[_0x4f75('0x41')][_0x4f75('0x11f')](db['User'],{});db['MailQueueReport'][_0x4f75('0x11f')](db[_0x4f75('0x37')],{});db[_0x4f75('0x42')][_0x4f75('0x110')](db[_0x4f75('0x44')],{'as':_0x4f75('0x17a'),'onDelete':_0x4f75('0x10e')});db[_0x4f75('0x46')][_0x4f75('0x110')](db['Disposition'],{'as':_0x4f75('0x169'),'foreignKey':'FaxAccountId','onDelete':_0x4f75('0x10e')});db[_0x4f75('0x46')]['hasMany'](db[_0x4f75('0x7a')],{'as':_0x4f75('0x17b'),'foreignKey':_0x4f75('0x17c')});db['FaxAccount'][_0x4f75('0x110')](db['FaxInteraction'],{'as':_0x4f75('0x16b')});db[_0x4f75('0x46')][_0x4f75('0x110')](db[_0x4f75('0x48')],{'as':_0x4f75('0x14b')});db[_0x4f75('0x46')]['hasMany'](db[_0x4f75('0x17')],{'as':_0x4f75('0x17d'),'onDelete':_0x4f75('0x10e')});db[_0x4f75('0x46')][_0x4f75('0x110')](db[_0x4f75('0x4c')],{'as':'Messages'});db[_0x4f75('0x46')][_0x4f75('0x11f')](db['Trunk'],{'as':_0x4f75('0x28')});db[_0x4f75('0x46')][_0x4f75('0x11f')](db[_0x4f75('0xf1')],{'as':_0x4f75('0x179'),'foreignKey':'ListId'});db['FaxAccount'][_0x4f75('0x11f')](db[_0x4f75('0x81')],{'as':_0x4f75('0x159'),'foreignKey':_0x4f75('0x15a')});db[_0x4f75('0x46')][_0x4f75('0x121')](db[_0x4f75('0x11')],{'as':_0x4f75('0x15b'),'through':_0x4f75('0x13e')});db[_0x4f75('0x48')][_0x4f75('0x11f')](db[_0x4f75('0x11')],{'onDelete':_0x4f75('0x176')});db[_0x4f75('0x48')][_0x4f75('0x11f')](db[_0x4f75('0x4e')],{'onDelete':'restrict'});db[_0x4f75('0x48')]['belongsTo'](db[_0x4f75('0x46')],{'onDelete':_0x4f75('0x176')});db['FaxApplication'][_0x4f75('0x11f')](db[_0x4f75('0x89')],{'onDelete':_0x4f75('0x176'),'foreignKey':'TagId'});db[_0x4f75('0x4a')][_0x4f75('0x110')](db[_0x4f75('0x4c')],{'as':_0x4f75('0x16a'),'onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x17e')});db[_0x4f75('0x4a')][_0x4f75('0x11f')](db['FaxAccount'],{'as':_0x4f75('0x16d'),'foreignKey':_0x4f75('0x17c')});db[_0x4f75('0x4a')]['belongsTo'](db[_0x4f75('0x16e')],{'as':_0x4f75('0x163'),'foreignKey':'ContactId'});db[_0x4f75('0x4a')][_0x4f75('0x11f')](db[_0x4f75('0x11')],{'as':_0x4f75('0x16f'),'foreignKey':_0x4f75('0x10f')});db['FaxInteraction'][_0x4f75('0x121')](db[_0x4f75('0x89')],{'through':_0x4f75('0x17f'),'as':_0x4f75('0x171')});db[_0x4f75('0x4a')][_0x4f75('0x121')](db[_0x4f75('0x89')],{'through':_0x4f75('0x17f'),'as':_0x4f75('0x172')});db['FaxInteraction'][_0x4f75('0x121')](db[_0x4f75('0x11')],{'as':_0x4f75('0x173'),'through':_0x4f75('0x12b'),'foreignKey':'FaxInteractionId'});db[_0x4f75('0x4c')]['belongsTo'](db[_0x4f75('0x11')],{'onDelete':_0x4f75('0x10e'),'as':_0x4f75('0x11')});db[_0x4f75('0x4c')][_0x4f75('0x11f')](db[_0x4f75('0x4a')],{'as':_0x4f75('0x180'),'foreignKey':'FaxInteractionId'});db[_0x4f75('0x4c')][_0x4f75('0x11f')](db[_0x4f75('0x16e')],{'onDelete':'cascade','as':_0x4f75('0x163')});db[_0x4f75('0x4c')][_0x4f75('0x11f')](db['Attachment'],{'as':_0x4f75('0xe7'),'foreignKey':_0x4f75('0x181')});db[_0x4f75('0x4c')][_0x4f75('0x11f')](db['FaxAccount'],{'as':_0x4f75('0x16d'),'foreignKey':_0x4f75('0x17c')});db[_0x4f75('0x4e')][_0x4f75('0x121')](db[_0x4f75('0x11')],{'as':_0x4f75('0x15b'),'through':_0x4f75('0x136')});db['FaxQueue'][_0x4f75('0x121')](db[_0x4f75('0x127')],{'through':_0x4f75('0x182'),'as':_0x4f75('0x15c')});db[_0x4f75('0x4f')]['belongsTo'](db['FaxAccount'],{});db[_0x4f75('0x4f')][_0x4f75('0x11f')](db[_0x4f75('0xf1')],{'as':_0x4f75('0x179'),'foreignKey':'ListId'});db[_0x4f75('0x4f')][_0x4f75('0x11f')](db[_0x4f75('0x16e')],{'as':_0x4f75('0x163'),'foreignKey':'ContactId'});db[_0x4f75('0x4f')][_0x4f75('0x11f')](db[_0x4f75('0x4a')],{});db[_0x4f75('0x4f')][_0x4f75('0x11f')](db['FaxMessage'],{});db[_0x4f75('0x4f')][_0x4f75('0x11f')](db['User'],{});db[_0x4f75('0x4f')][_0x4f75('0x11f')](db[_0x4f75('0x4e')],{});db['SmsAccount']['hasMany'](db[_0x4f75('0x7b')],{'as':'Dispositions','foreignKey':'SmsAccountId','onDelete':_0x4f75('0x10e')});db[_0x4f75('0x50')][_0x4f75('0x110')](db[_0x4f75('0x7a')],{'as':'Answers','foreignKey':'SmsAccountId'});db['SmsAccount']['hasMany'](db[_0x4f75('0x183')],{'as':'Messages','foreignKey':_0x4f75('0x184')});db[_0x4f75('0x50')][_0x4f75('0x110')](db['SmsInteraction'],{'as':_0x4f75('0x16b')});db[_0x4f75('0x50')][_0x4f75('0x110')](db[_0x4f75('0x52')],{'as':'Applications'});db['SmsAccount']['belongsTo'](db[_0x4f75('0xf1')],{'as':'List','foreignKey':_0x4f75('0x16c')});db[_0x4f75('0x50')]['belongsTo'](db[_0x4f75('0x81')],{'as':_0x4f75('0x159'),'foreignKey':_0x4f75('0x15a')});db['SmsAccount']['belongsToMany'](db[_0x4f75('0x11')],{'as':_0x4f75('0x15b'),'through':_0x4f75('0x144')});db[_0x4f75('0x52')][_0x4f75('0x11f')](db[_0x4f75('0x11')],{'onDelete':'restrict'});db[_0x4f75('0x52')]['belongsTo'](db[_0x4f75('0x56')],{'onDelete':_0x4f75('0x176')});db['SmsApplication'][_0x4f75('0x11f')](db['SmsAccount'],{'onDelete':'restrict'});db[_0x4f75('0x52')][_0x4f75('0x11f')](db['Interval'],{'onDelete':'restrict','foreignKey':_0x4f75('0x177')});db['SmsApplication'][_0x4f75('0x11f')](db[_0x4f75('0x89')],{'onDelete':_0x4f75('0x176'),'foreignKey':_0x4f75('0x178')});db[_0x4f75('0x54')]['hasMany'](db[_0x4f75('0x183')],{'as':_0x4f75('0x16a'),'onDelete':'cascade','foreignKey':_0x4f75('0x185')});db[_0x4f75('0x54')][_0x4f75('0x11f')](db[_0x4f75('0x50')],{'as':_0x4f75('0x16d'),'foreignKey':_0x4f75('0x184')});db[_0x4f75('0x54')][_0x4f75('0x11f')](db['CmContact'],{'as':_0x4f75('0x163'),'foreignKey':'ContactId'});db[_0x4f75('0x54')][_0x4f75('0x11f')](db[_0x4f75('0x11')],{'as':_0x4f75('0x16f'),'foreignKey':_0x4f75('0x10f')});db[_0x4f75('0x54')][_0x4f75('0x121')](db['Tag'],{'through':_0x4f75('0x186'),'as':_0x4f75('0x171')});db[_0x4f75('0x54')][_0x4f75('0x121')](db[_0x4f75('0x89')],{'through':_0x4f75('0x186'),'as':_0x4f75('0x172')});db[_0x4f75('0x54')][_0x4f75('0x121')](db[_0x4f75('0x11')],{'as':_0x4f75('0x173'),'through':_0x4f75('0x12d'),'foreignKey':_0x4f75('0x185')});db[_0x4f75('0x183')][_0x4f75('0x11f')](db['User'],{'as':_0x4f75('0x11')});db[_0x4f75('0x183')][_0x4f75('0x11f')](db[_0x4f75('0x16e')],{'onDelete':'cascade','as':_0x4f75('0x163')});db['SmsMessage'][_0x4f75('0x11f')](db[_0x4f75('0x54')],{'onDelete':_0x4f75('0x10e'),'as':'Interaction','foreignKey':_0x4f75('0x185')});db[_0x4f75('0x183')][_0x4f75('0x11f')](db['SmsAccount'],{'as':_0x4f75('0x16d'),'foreignKey':_0x4f75('0x184')});db['SmsQueue']['belongsToMany'](db[_0x4f75('0x11')],{'as':_0x4f75('0x15b'),'through':'UserSmsQueue','foreignKey':_0x4f75('0x187')});db[_0x4f75('0x56')][_0x4f75('0x121')](db[_0x4f75('0x127')],{'through':'team_has_sms_queues','as':_0x4f75('0x15c')});db[_0x4f75('0x141')][_0x4f75('0x110')](db[_0x4f75('0x7b')],{'as':'Dispositions','foreignKey':_0x4f75('0x188'),'onDelete':_0x4f75('0x10e')});db['OpenchannelAccount']['hasMany'](db['CannedAnswer'],{'as':_0x4f75('0x17b'),'foreignKey':_0x4f75('0x188')});db[_0x4f75('0x141')][_0x4f75('0x110')](db[_0x4f75('0x118')],{'as':'Interactions','foreignKey':_0x4f75('0x188')});db[_0x4f75('0x141')][_0x4f75('0x110')](db[_0x4f75('0x59')],{'as':_0x4f75('0x16a'),'foreignKey':_0x4f75('0x188')});db['OpenchannelAccount'][_0x4f75('0x110')](db[_0x4f75('0x58')],{'as':_0x4f75('0x14b'),'foreignKey':_0x4f75('0x188')});db[_0x4f75('0x141')][_0x4f75('0x11f')](db['CmList'],{'as':_0x4f75('0x179'),'foreignKey':_0x4f75('0x16c')});db[_0x4f75('0x141')]['belongsTo'](db[_0x4f75('0x81')],{'as':'mandatoryDispositionPause','foreignKey':_0x4f75('0x15a')});db[_0x4f75('0x141')]['belongsToMany'](db[_0x4f75('0x11')],{'as':_0x4f75('0x15b'),'through':'user_has_openchannel_accounts'});db[_0x4f75('0x58')][_0x4f75('0x11f')](db['User'],{'onDelete':_0x4f75('0x176')});db['OpenchannelApplication'][_0x4f75('0x11f')](db[_0x4f75('0x5b')],{'onDelete':_0x4f75('0x176'),'foreignKey':_0x4f75('0x189')});db[_0x4f75('0x58')][_0x4f75('0x11f')](db['OpenchannelAccount'],{'onDelete':_0x4f75('0x176'),'foreignKey':_0x4f75('0x188')});db[_0x4f75('0x58')][_0x4f75('0x11f')](db[_0x4f75('0x7f')],{'onDelete':_0x4f75('0x176'),'foreignKey':'IntervalId'});db[_0x4f75('0x58')][_0x4f75('0x11f')](db[_0x4f75('0x89')],{'onDelete':_0x4f75('0x176'),'foreignKey':'TagId'});db[_0x4f75('0x118')][_0x4f75('0x110')](db[_0x4f75('0x59')],{'as':_0x4f75('0x16a'),'onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x18a')});db[_0x4f75('0x118')][_0x4f75('0x11f')](db[_0x4f75('0x141')],{'as':_0x4f75('0x16d'),'foreignKey':_0x4f75('0x188')});db[_0x4f75('0x118')][_0x4f75('0x11f')](db[_0x4f75('0x16e')],{'as':_0x4f75('0x163'),'foreignKey':'ContactId'});db['OpenchannelInteraction'][_0x4f75('0x11f')](db[_0x4f75('0x11')],{'as':_0x4f75('0x16f'),'foreignKey':_0x4f75('0x10f')});db[_0x4f75('0x118')]['belongsToMany'](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x4f75('0x171')});db['OpenchannelInteraction']['belongsToMany'](db[_0x4f75('0x89')],{'through':_0x4f75('0x18b'),'as':_0x4f75('0x172')});db[_0x4f75('0x118')][_0x4f75('0x121')](db['User'],{'as':_0x4f75('0x173'),'through':_0x4f75('0x12e'),'foreignKey':'OpenchannelInteractionId'});db[_0x4f75('0x59')]['belongsTo'](db[_0x4f75('0x11')],{'onDelete':'cascade','as':_0x4f75('0x11')});db['OpenchannelMessage']['belongsTo'](db[_0x4f75('0x16e')],{'onDelete':'cascade','as':'Contact'});db[_0x4f75('0x59')][_0x4f75('0x11f')](db['OpenchannelInteraction'],{'onDelete':'cascade','as':_0x4f75('0x180'),'foreignKey':_0x4f75('0x18a')});db[_0x4f75('0x59')]['belongsTo'](db['Attachment'],{'as':_0x4f75('0xe7'),'foreignKey':_0x4f75('0x181')});db[_0x4f75('0x59')][_0x4f75('0x11f')](db[_0x4f75('0x141')],{'as':_0x4f75('0x16d'),'foreignKey':_0x4f75('0x188')});db['OpenchannelQueue'][_0x4f75('0x121')](db[_0x4f75('0x11')],{'as':'Agents','through':_0x4f75('0x31'),'foreignKey':_0x4f75('0x189')});db[_0x4f75('0x5b')][_0x4f75('0x121')](db[_0x4f75('0x127')],{'through':_0x4f75('0x18c'),'as':_0x4f75('0x15c')});db['ChatWebsite']['hasMany'](db['Disposition'],{'as':_0x4f75('0x169'),'foreignKey':'ChatWebsiteId','onDelete':'cascade'});db[_0x4f75('0x5d')]['hasMany'](db[_0x4f75('0x7a')],{'as':'Answers','foreignKey':_0x4f75('0x18d')});db['ChatWebsite'][_0x4f75('0x110')](db['ChatProactiveAction'],{'as':_0x4f75('0x18e')});db[_0x4f75('0x5d')][_0x4f75('0x110')](db[_0x4f75('0x119')],{'as':_0x4f75('0x16b')});db[_0x4f75('0x5d')][_0x4f75('0x110')](db[_0x4f75('0x60')],{'as':_0x4f75('0x14b')});db[_0x4f75('0x5d')][_0x4f75('0x110')](db['ChatMessage'],{'as':_0x4f75('0x16a')});db[_0x4f75('0x5d')][_0x4f75('0x11f')](db[_0x4f75('0xf1')],{'as':_0x4f75('0x179'),'foreignKey':_0x4f75('0x16c')});db[_0x4f75('0x5d')]['belongsTo'](db[_0x4f75('0x7f')],{'as':'Interval','foreignKey':_0x4f75('0x177')});db['ChatWebsite'][_0x4f75('0x11f')](db[_0x4f75('0x36')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0x4f75('0x5d')][_0x4f75('0x11f')](db[_0x4f75('0x81')],{'as':'mandatoryDispositionPause','foreignKey':_0x4f75('0x15a')});db['ChatWebsite'][_0x4f75('0x121')](db[_0x4f75('0x11')],{'as':_0x4f75('0x15b'),'through':_0x4f75('0x13c')});db['OpenchannelQueueReport']['belongsTo'](db[_0x4f75('0x141')],{});db[_0x4f75('0x18f')][_0x4f75('0x11f')](db[_0x4f75('0xf1')],{'as':_0x4f75('0x179'),'foreignKey':_0x4f75('0x16c')});db[_0x4f75('0x18f')]['belongsTo'](db[_0x4f75('0x16e')],{'as':'Contact','foreignKey':'ContactId'});db[_0x4f75('0x18f')][_0x4f75('0x11f')](db['OpenchannelInteraction'],{});db['OpenchannelQueueReport'][_0x4f75('0x11f')](db['OpenchannelMessage'],{});db[_0x4f75('0x18f')][_0x4f75('0x11f')](db['User'],{});db['OpenchannelQueueReport'][_0x4f75('0x11f')](db[_0x4f75('0x5b')],{});db[_0x4f75('0x60')][_0x4f75('0x11f')](db[_0x4f75('0x11')],{'as':_0x4f75('0x190'),'foreignKey':_0x4f75('0x10f'),'onDelete':_0x4f75('0x176')});db['ChatApplication'][_0x4f75('0x11f')](db[_0x4f75('0x67')],{'as':_0x4f75('0x191'),'foreignKey':_0x4f75('0x192'),'onDelete':'restrict'});db[_0x4f75('0x60')]['belongsTo'](db[_0x4f75('0x5d')],{'as':'Website','foreignKey':_0x4f75('0x18d'),'onDelete':_0x4f75('0x176')});db['ChatApplication'][_0x4f75('0x11f')](db[_0x4f75('0x89')],{'onDelete':_0x4f75('0x176'),'foreignKey':_0x4f75('0x178')});db[_0x4f75('0x119')]['hasMany'](db[_0x4f75('0x63')],{'as':'Messages','onDelete':_0x4f75('0x10e'),'foreignKey':'ChatInteractionId'});db[_0x4f75('0x119')][_0x4f75('0x11f')](db[_0x4f75('0x5d')],{'as':_0x4f75('0x16d'),'foreignKey':_0x4f75('0x18d')});db['ChatInteraction'][_0x4f75('0x11f')](db[_0x4f75('0x16e')],{'as':'Contact','foreignKey':'ContactId'});db[_0x4f75('0x119')][_0x4f75('0x11f')](db['User'],{'as':_0x4f75('0x16f'),'foreignKey':_0x4f75('0x10f')});db[_0x4f75('0x119')][_0x4f75('0x121')](db[_0x4f75('0x89')],{'through':_0x4f75('0x193'),'as':_0x4f75('0x171')});db[_0x4f75('0x119')][_0x4f75('0x121')](db[_0x4f75('0x89')],{'through':'chat_interaction_has_tags','as':'ThroughTags'});db[_0x4f75('0x119')][_0x4f75('0x121')](db[_0x4f75('0x11')],{'as':_0x4f75('0x173'),'through':'user_has_chat_interactions','foreignKey':_0x4f75('0x194')});db[_0x4f75('0x63')]['belongsTo'](db['User'],{'onDelete':'cascade','as':_0x4f75('0x11')});db[_0x4f75('0x63')]['belongsTo'](db[_0x4f75('0x16e')],{'onDelete':_0x4f75('0x10e'),'as':_0x4f75('0x163'),'foreignKey':'ContactId'});db[_0x4f75('0x63')][_0x4f75('0x11f')](db[_0x4f75('0x119')],{'onDelete':_0x4f75('0x10e'),'as':_0x4f75('0x180'),'foreignKey':'ChatInteractionId'});db[_0x4f75('0x63')][_0x4f75('0x11f')](db[_0x4f75('0xe7')],{'as':_0x4f75('0xe7'),'foreignKey':_0x4f75('0x181')});db['ChatMessage'][_0x4f75('0x11f')](db[_0x4f75('0x5d')],{'as':_0x4f75('0x16d'),'foreignKey':_0x4f75('0x18d')});db['ChatOfflineMessage']['hasMany'](db[_0x4f75('0xe7')],{'as':_0x4f75('0x195'),'foreignKey':_0x4f75('0x175'),'onDelete':_0x4f75('0x10e'),'hooks':!![]});db[_0x4f75('0x65')]['belongsTo'](db[_0x4f75('0x16e')],{'onDelete':_0x4f75('0x10e'),'as':_0x4f75('0x163'),'foreignKey':_0x4f75('0x164')});db[_0x4f75('0x65')][_0x4f75('0x11f')](db['ChatWebsite'],{'as':'Account','foreignKey':_0x4f75('0x18d')});db[_0x4f75('0x67')][_0x4f75('0x121')](db[_0x4f75('0x11')],{'as':_0x4f75('0x15b'),'through':_0x4f75('0x2c'),'hooks':!![]});db[_0x4f75('0x67')][_0x4f75('0x121')](db[_0x4f75('0x127')],{'through':_0x4f75('0x196'),'as':_0x4f75('0x15c')});db[_0x4f75('0x69')][_0x4f75('0x110')](db[_0x4f75('0xcf')],{'as':'Messages','foreignKey':_0x4f75('0x197'),'onDelete':_0x4f75('0x10e')});db[_0x4f75('0x69')][_0x4f75('0x121')](db['User'],{'as':'Members','through':_0x4f75('0x123')});db[_0x4f75('0x6a')]['belongsTo'](db[_0x4f75('0x5d')],{'as':_0x4f75('0x198'),'foreignKey':_0x4f75('0x18d')});db[_0x4f75('0x6c')]['hasMany'](db['CmContact'],{'as':_0x4f75('0x124'),'foreignKey':_0x4f75('0x199')});db[_0x4f75('0x16e')][_0x4f75('0x110')](db[_0x4f75('0x8c')],{'as':_0x4f75('0x19a'),'foreignKey':_0x4f75('0x19b')});db[_0x4f75('0x16e')]['hasMany'](db['CmHopper'],{'as':_0x4f75('0x150'),'foreignKey':_0x4f75('0x164')});db[_0x4f75('0x16e')][_0x4f75('0x110')](db[_0x4f75('0x70')],{'as':_0x4f75('0x116'),'foreignKey':_0x4f75('0x164')});db[_0x4f75('0x16e')][_0x4f75('0x110')](db[_0x4f75('0x72')],{'as':_0x4f75('0x151'),'foreignKey':_0x4f75('0x164')});db['CmContact']['hasMany'](db[_0x4f75('0x74')],{'as':'ReportAgentPreview','foreignKey':_0x4f75('0x164')});db[_0x4f75('0x16e')][_0x4f75('0x110')](db[_0x4f75('0x154')],{'as':_0x4f75('0x155'),'foreignKey':_0x4f75('0x164')});db['CmContact'][_0x4f75('0x110')](db['OpenchannelInteraction'],{'as':_0x4f75('0x19c'),'foreignKey':_0x4f75('0x164'),'onDelete':_0x4f75('0x176')});db['CmContact'][_0x4f75('0x110')](db[_0x4f75('0x119')],{'as':_0x4f75('0x11a'),'foreignKey':_0x4f75('0x164'),'onDelete':'restrict'});db[_0x4f75('0x16e')]['hasMany'](db[_0x4f75('0x54')],{'as':_0x4f75('0x12c'),'foreignKey':_0x4f75('0x164'),'onDelete':_0x4f75('0x176')});db[_0x4f75('0x16e')][_0x4f75('0x110')](db[_0x4f75('0x4a')],{'as':_0x4f75('0x11b'),'foreignKey':_0x4f75('0x164'),'onDelete':_0x4f75('0x176')});db[_0x4f75('0x16e')][_0x4f75('0x110')](db['MailInteraction'],{'as':_0x4f75('0x11c'),'foreignKey':_0x4f75('0x164'),'onDelete':_0x4f75('0x176')});db[_0x4f75('0x16e')][_0x4f75('0x11f')](db[_0x4f75('0x6c')],{'as':_0x4f75('0x19d'),'foreignKey':'CompanyId'});db[_0x4f75('0x16e')][_0x4f75('0x11f')](db['CmList'],{'as':'List','foreignKey':'ListId','onDelete':_0x4f75('0x10e')});db['CmContact'][_0x4f75('0x121')](db[_0x4f75('0x11')],{'as':'Users','through':_0x4f75('0x19e')});db[_0x4f75('0x16e')][_0x4f75('0x121')](db[_0x4f75('0x89')],{'as':_0x4f75('0x171'),'through':'cm_contact_has_tags'});db[_0x4f75('0x16e')][_0x4f75('0x121')](db[_0x4f75('0x89')],{'through':_0x4f75('0x19f'),'as':_0x4f75('0x172')});db[_0x4f75('0x6e')][_0x4f75('0x110')](db[_0x4f75('0x8e')],{'as':_0x4f75('0x1a0'),'foreignKey':_0x4f75('0x1a1')});db[_0x4f75('0x6e')][_0x4f75('0x11f')](db[_0x4f75('0x16e')],{'as':_0x4f75('0x163'),'foreignKey':_0x4f75('0x164'),'onDelete':'cascade'});db[_0x4f75('0x6e')]['belongsTo'](db[_0x4f75('0xf1')],{'as':_0x4f75('0x179'),'foreignKey':_0x4f75('0x16c'),'onDelete':_0x4f75('0x10e')});db[_0x4f75('0x6e')][_0x4f75('0x11f')](db[_0x4f75('0x11')],{'as':'Agent','foreignKey':'UserId'});db[_0x4f75('0x6e')]['belongsTo'](db['VoiceQueue'],{'as':_0x4f75('0x191'),'foreignKey':_0x4f75('0x14f'),'onDelete':_0x4f75('0x10e')});db[_0x4f75('0x6e')][_0x4f75('0x11f')](db[_0x4f75('0x1a2')],{'as':'Campaign','foreignKey':_0x4f75('0x1a3'),'onDelete':_0x4f75('0x10e')});db[_0x4f75('0x6e')][_0x4f75('0x11f')](db[_0x4f75('0x11')],{'as':'Owner','foreignKey':_0x4f75('0x1a4')});db[_0x4f75('0x152')][_0x4f75('0x11f')](db[_0x4f75('0x16e')],{'as':_0x4f75('0x163'),'foreignKey':_0x4f75('0x164'),'onDelete':_0x4f75('0x10e')});db[_0x4f75('0x152')][_0x4f75('0x11f')](db[_0x4f75('0xf1')],{'as':'List','foreignKey':_0x4f75('0x16c'),'onDelete':_0x4f75('0x10e')});db[_0x4f75('0x152')][_0x4f75('0x11f')](db[_0x4f75('0x1a')],{'as':_0x4f75('0x191'),'foreignKey':'VoiceQueueId','onDelete':_0x4f75('0x10e')});db[_0x4f75('0x152')][_0x4f75('0x11f')](db[_0x4f75('0x1a2')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':'cascade'});db[_0x4f75('0x78')]['hasMany'](db[_0x4f75('0x7d')],{'as':{'plural':_0x4f75('0x1a5'),'singular':_0x4f75('0x1a6')},'foreignKey':_0x4f75('0x1a7'),'onDelete':'cascade','hooks':!![]});db[_0x4f75('0x78')][_0x4f75('0x110')](db['Condition'],{'as':{'plural':_0x4f75('0x1a8'),'singular':'OneAny'},'foreignKey':'AutomationAnyId','onDelete':_0x4f75('0x10e'),'hooks':!![]});db[_0x4f75('0x78')][_0x4f75('0x110')](db[_0x4f75('0x76')],{'as':'Actions','foreignKey':_0x4f75('0x1a9'),'onDelete':_0x4f75('0x10e'),'hooks':!![]});db[_0x4f75('0x7b')][_0x4f75('0x110')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x4f75('0x1aa'),'onDelete':_0x4f75('0x10e')});db[_0x4f75('0x7f')][_0x4f75('0x110')](db[_0x4f75('0x7f')],{'as':_0x4f75('0x1ab'),'foreignKey':'IntervalId','onDelete':_0x4f75('0x10e'),'hooks':!![],'required':![]});db[_0x4f75('0x7f')][_0x4f75('0x110')](db[_0x4f75('0x17')],{'as':_0x4f75('0x115'),'foreignKey':_0x4f75('0x177'),'onDelete':_0x4f75('0x176')});db[_0x4f75('0x7f')][_0x4f75('0x110')](db[_0x4f75('0x3f')],{'as':_0x4f75('0x1ac'),'foreignKey':_0x4f75('0x177')});db['Interval']['hasMany'](db[_0x4f75('0x60')],{'as':_0x4f75('0x1ad'),'foreignKey':_0x4f75('0x177')});db[_0x4f75('0x7f')][_0x4f75('0x110')](db[_0x4f75('0x48')],{'as':_0x4f75('0x1ae'),'foreignKey':'IntervalId'});db[_0x4f75('0x7f')][_0x4f75('0x110')](db[_0x4f75('0x52')],{'as':_0x4f75('0x1af'),'foreignKey':_0x4f75('0x177')});db[_0x4f75('0x85')][_0x4f75('0x11f')](db['MailAccount'],{});db[_0x4f75('0x85')][_0x4f75('0x11f')](db[_0x4f75('0x99')],{'foreignKey':_0x4f75('0x1b0')});db[_0x4f75('0x85')]['belongsTo'](db[_0x4f75('0x97')],{'foreignKey':_0x4f75('0x1b1')});db[_0x4f75('0x87')][_0x4f75('0x121')](db[_0x4f75('0x14c')],{'as':_0x4f75('0x1b2'),'through':'moh_has_sounds','onDelete':_0x4f75('0x176')});db[_0x4f75('0x89')][_0x4f75('0x121')](db[_0x4f75('0x16e')],{'through':_0x4f75('0x19f')});db[_0x4f75('0x89')][_0x4f75('0x121')](db['ChatInteraction'],{'through':_0x4f75('0x193')});db[_0x4f75('0x89')]['belongsToMany'](db[_0x4f75('0x3b')],{'through':_0x4f75('0x170')});db[_0x4f75('0x89')]['belongsToMany'](db[_0x4f75('0x54')],{'through':_0x4f75('0x186')});db['Tag'][_0x4f75('0x121')](db['FaxInteraction'],{'through':_0x4f75('0x17f')});db[_0x4f75('0x89')]['belongsToMany'](db['OpenchannelInteraction'],{'through':_0x4f75('0x18b')});db[_0x4f75('0x89')][_0x4f75('0x121')](db[_0x4f75('0xfe')],{'through':_0x4f75('0x1b3')});db[_0x4f75('0x8c')][_0x4f75('0x11f')](db[_0x4f75('0x8a')],{'as':'ItemType','foreignKey':_0x4f75('0x1b4')});db[_0x4f75('0x8e')][_0x4f75('0x11f')](db[_0x4f75('0x6e')],{'as':_0x4f75('0x1b5'),'foreignKey':_0x4f75('0x1a1')});db[_0x4f75('0x8c')][_0x4f75('0x11f')](db[_0x4f75('0x16e')],{'as':_0x4f75('0x163'),'foreignKey':'CmContactId'});db['Trigger']['hasMany'](db[_0x4f75('0x7d')],{'as':{'plural':_0x4f75('0x1b6'),'singular':_0x4f75('0x1b7')},'foreignKey':_0x4f75('0x1b8'),'onDelete':_0x4f75('0x10e'),'hooks':!![]});db[_0x4f75('0x92')]['hasMany'](db[_0x4f75('0x7d')],{'as':{'plural':_0x4f75('0x1b9'),'singular':'AnyCondition'},'foreignKey':_0x4f75('0x1ba'),'onDelete':_0x4f75('0x10e'),'hooks':!![]});db['Trigger'][_0x4f75('0x110')](db[_0x4f75('0x76')],{'as':_0x4f75('0x1bb'),'foreignKey':_0x4f75('0x1bc'),'onDelete':_0x4f75('0x10e'),'hooks':!![]});db[_0x4f75('0x97')][_0x4f75('0x110')](db[_0x4f75('0x9e')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x4f75('0x1b1'),'hooks':!![]});db[_0x4f75('0x99')][_0x4f75('0x110')](db['AnalyticFieldReport'],{'as':_0x4f75('0x1bd'),'onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x1b0')});db[_0x4f75('0x9c')]['hasMany'](db[_0x4f75('0x9e')],{'as':_0x4f75('0x1bd'),'onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x1be')});db[_0x4f75('0x9e')][_0x4f75('0x11f')](db[_0x4f75('0x9c')],{'foreignKey':_0x4f75('0x1be')});db[_0x4f75('0xa1')][_0x4f75('0x110')](db[_0x4f75('0x1bf')],{'as':_0x4f75('0x1c0'),'onDelete':'cascade','foreignKey':_0x4f75('0x1c1')});db[_0x4f75('0x1bf')]['hasMany'](db[_0x4f75('0xa4')],{'as':_0x4f75('0x1c2'),'onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x1c3')});db[_0x4f75('0x1bf')]['hasMany'](db[_0x4f75('0xa4')],{'as':_0x4f75('0x1c4'),'onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x1c5')});db[_0x4f75('0x1bf')][_0x4f75('0x110')](db[_0x4f75('0xa4')],{'as':_0x4f75('0x1bd'),'onDelete':'cascade','foreignKey':_0x4f75('0x1c6')});db['SalesforceConfiguration']['belongsTo'](db['SalesforceAccount'],{'as':_0x4f75('0x16d'),'foreignKey':_0x4f75('0x1c1')});db['SalesforceField'][_0x4f75('0x110')](db[_0x4f75('0xa4')],{'as':'Subject','foreignKey':_0x4f75('0x1c3')});db[_0x4f75('0xa4')]['hasMany'](db[_0x4f75('0xa4')],{'as':_0x4f75('0x1c7'),'foreignKey':_0x4f75('0x1c5')});db['SalesforceField'][_0x4f75('0x110')](db[_0x4f75('0xa4')],{'as':_0x4f75('0x1c8'),'foreignKey':_0x4f75('0x1c6')});db['SalesforceField'][_0x4f75('0x11f')](db['Variable'],{'as':_0x4f75('0x1c9'),'foreignKey':_0x4f75('0x1ca')});db[_0x4f75('0xa6')][_0x4f75('0x110')](db['SugarcrmConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x4f75('0x1c1')});db[_0x4f75('0x1cb')][_0x4f75('0x110')](db[_0x4f75('0xa8')],{'as':_0x4f75('0x1c2'),'onDelete':'cascade','foreignKey':_0x4f75('0x1c3')});db['SugarcrmConfiguration'][_0x4f75('0x110')](db[_0x4f75('0xa8')],{'as':_0x4f75('0x1c4'),'onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x1c5')});db[_0x4f75('0x1cb')][_0x4f75('0x110')](db[_0x4f75('0xa8')],{'as':'Fields','onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x1c6')});db[_0x4f75('0x1cb')][_0x4f75('0x11f')](db['SugarcrmAccount'],{'as':_0x4f75('0x16d'),'foreignKey':'AccountId'});db[_0x4f75('0xa8')][_0x4f75('0x110')](db[_0x4f75('0xa8')],{'as':_0x4f75('0x1cc'),'foreignKey':'SubjectId'});db[_0x4f75('0xa8')]['hasMany'](db[_0x4f75('0xa8')],{'as':'Description','foreignKey':_0x4f75('0x1c5')});db[_0x4f75('0xa8')][_0x4f75('0x110')](db[_0x4f75('0xa8')],{'as':_0x4f75('0x1c8'),'foreignKey':_0x4f75('0x1c6')});db[_0x4f75('0xa8')][_0x4f75('0x11f')](db[_0x4f75('0x1c9')],{'as':_0x4f75('0x1c9'),'foreignKey':_0x4f75('0x1ca')});db[_0x4f75('0xaa')]['hasMany'](db[_0x4f75('0x1cd')],{'as':_0x4f75('0x1c0'),'onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x1c1')});db[_0x4f75('0x1cd')]['hasMany'](db[_0x4f75('0xac')],{'as':_0x4f75('0x1c2'),'onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x1c3')});db['DeskConfiguration'][_0x4f75('0x110')](db[_0x4f75('0xac')],{'as':_0x4f75('0x1c4'),'onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x1c5')});db['DeskConfiguration'][_0x4f75('0x110')](db['DeskField'],{'as':_0x4f75('0x1bd'),'onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x1c6')});db[_0x4f75('0x1cd')][_0x4f75('0x11f')](db[_0x4f75('0xaa')],{'as':_0x4f75('0x16d'),'foreignKey':_0x4f75('0x1c1')});db[_0x4f75('0x1cd')][_0x4f75('0x121')](db[_0x4f75('0x89')],{'through':_0x4f75('0x1ce')});db[_0x4f75('0xac')][_0x4f75('0x110')](db['DeskField'],{'as':'Subject','foreignKey':_0x4f75('0x1c3')});db['DeskField']['hasMany'](db[_0x4f75('0xac')],{'as':'Description','foreignKey':_0x4f75('0x1c5')});db['DeskField']['hasMany'](db[_0x4f75('0xac')],{'as':'Field','foreignKey':_0x4f75('0x1c6')});db[_0x4f75('0xac')][_0x4f75('0x11f')](db['Variable'],{'as':_0x4f75('0x1c9'),'foreignKey':_0x4f75('0x1ca')});db['ZohoAccount'][_0x4f75('0x110')](db[_0x4f75('0x1cf')],{'as':_0x4f75('0x1c0'),'onDelete':_0x4f75('0x10e'),'foreignKey':'AccountId'});db[_0x4f75('0x1cf')][_0x4f75('0x110')](db[_0x4f75('0xb0')],{'as':'Subjects','onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x1c3')});db[_0x4f75('0x1cf')][_0x4f75('0x110')](db[_0x4f75('0xb0')],{'as':_0x4f75('0x1c4'),'onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x1c5')});db['ZohoConfiguration'][_0x4f75('0x110')](db[_0x4f75('0xb0')],{'as':'Fields','onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x1c6')});db[_0x4f75('0x1cf')][_0x4f75('0x11f')](db[_0x4f75('0xae')],{'as':_0x4f75('0x16d'),'foreignKey':_0x4f75('0x1c1')});db['ZohoField'][_0x4f75('0x110')](db[_0x4f75('0xb0')],{'as':_0x4f75('0x1cc'),'foreignKey':_0x4f75('0x1c3')});db[_0x4f75('0xb0')][_0x4f75('0x110')](db[_0x4f75('0xb0')],{'as':_0x4f75('0x1c7'),'foreignKey':_0x4f75('0x1c5')});db[_0x4f75('0xb0')][_0x4f75('0x110')](db[_0x4f75('0xb0')],{'as':'Field','foreignKey':_0x4f75('0x1c6')});db[_0x4f75('0xb0')]['belongsTo'](db[_0x4f75('0x1c9')],{'as':_0x4f75('0x1c9'),'foreignKey':_0x4f75('0x1ca')});db[_0x4f75('0xb2')][_0x4f75('0x110')](db[_0x4f75('0x1d0')],{'as':_0x4f75('0x1c0'),'onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x1c1')});db[_0x4f75('0x1d0')][_0x4f75('0x110')](db['ZendeskField'],{'as':_0x4f75('0x1c2'),'foreignKey':'SubjectId'});db['ZendeskConfiguration'][_0x4f75('0x110')](db[_0x4f75('0xb5')],{'as':_0x4f75('0x1c4'),'foreignKey':_0x4f75('0x1c5')});db['ZendeskConfiguration']['hasMany'](db[_0x4f75('0xb5')],{'as':_0x4f75('0x1bd'),'foreignKey':_0x4f75('0x1c6')});db[_0x4f75('0x1d0')][_0x4f75('0x11f')](db['ZendeskAccount'],{'as':'Account','foreignKey':_0x4f75('0x1c1')});db['ZendeskConfiguration'][_0x4f75('0x121')](db['Tag'],{'through':_0x4f75('0x1d1')});db[_0x4f75('0xb5')][_0x4f75('0x110')](db['ZendeskField'],{'as':_0x4f75('0x1cc'),'foreignKey':'SubjectId'});db[_0x4f75('0xb5')]['hasMany'](db[_0x4f75('0xb5')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x4f75('0xb5')][_0x4f75('0x110')](db[_0x4f75('0xb5')],{'as':_0x4f75('0x1c8'),'foreignKey':'FieldId'});db[_0x4f75('0xb5')][_0x4f75('0x11f')](db[_0x4f75('0x1c9')],{'as':_0x4f75('0x1c9'),'foreignKey':_0x4f75('0x1ca')});db['FreshdeskAccount'][_0x4f75('0x110')](db[_0x4f75('0x1d2')],{'as':_0x4f75('0x1c0'),'onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x1c1')});db[_0x4f75('0x1d2')][_0x4f75('0x110')](db[_0x4f75('0xb7')],{'as':_0x4f75('0x1c2'),'onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x1c3')});db[_0x4f75('0x1d2')]['hasMany'](db['FreshdeskField'],{'as':_0x4f75('0x1c4'),'onDelete':_0x4f75('0x10e'),'foreignKey':'DescriptionId'});db[_0x4f75('0x1d2')][_0x4f75('0x110')](db['FreshdeskField'],{'as':_0x4f75('0x1bd'),'onDelete':'cascade','foreignKey':_0x4f75('0x1c6')});db[_0x4f75('0x1d2')]['belongsTo'](db['FreshdeskAccount'],{'as':_0x4f75('0x16d'),'foreignKey':_0x4f75('0x1c1')});db[_0x4f75('0x1d2')][_0x4f75('0x121')](db[_0x4f75('0x89')],{'through':_0x4f75('0x1d3')});db[_0x4f75('0xb7')][_0x4f75('0x110')](db[_0x4f75('0xb7')],{'as':'Subject','foreignKey':_0x4f75('0x1c3')});db[_0x4f75('0xb7')][_0x4f75('0x110')](db['FreshdeskField'],{'as':_0x4f75('0x1c7'),'foreignKey':_0x4f75('0x1c5')});db['FreshdeskField'][_0x4f75('0x110')](db['FreshdeskField'],{'as':'Field','foreignKey':_0x4f75('0x1c6')});db[_0x4f75('0xb7')][_0x4f75('0x11f')](db[_0x4f75('0x1c9')],{'as':_0x4f75('0x1c9'),'foreignKey':'VariableId'});db[_0x4f75('0xb8')][_0x4f75('0x110')](db[_0x4f75('0xb9')],{'as':'Configurations','onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x1c1')});db[_0x4f75('0xb9')][_0x4f75('0x110')](db[_0x4f75('0xbb')],{'as':_0x4f75('0x1c2'),'foreignKey':_0x4f75('0x1c3')});db[_0x4f75('0xb9')][_0x4f75('0x110')](db[_0x4f75('0xbb')],{'as':_0x4f75('0x1c4'),'foreignKey':_0x4f75('0x1c5')});db[_0x4f75('0xb9')]['hasMany'](db['VtigerField'],{'as':_0x4f75('0x1bd'),'foreignKey':'FieldId'});db[_0x4f75('0xb9')][_0x4f75('0x11f')](db[_0x4f75('0xb8')],{'as':_0x4f75('0x16d'),'foreignKey':_0x4f75('0x1c1')});db['VtigerField'][_0x4f75('0x110')](db[_0x4f75('0xbb')],{'as':_0x4f75('0x1cc'),'foreignKey':'SubjectId'});db[_0x4f75('0xbb')][_0x4f75('0x110')](db[_0x4f75('0xbb')],{'as':_0x4f75('0x1c7'),'foreignKey':'DescriptionId'});db['VtigerField'][_0x4f75('0x110')](db[_0x4f75('0xbb')],{'as':_0x4f75('0x1c8'),'foreignKey':_0x4f75('0x1c6')});db['VtigerField'][_0x4f75('0x11f')](db[_0x4f75('0x1c9')],{'as':_0x4f75('0x1c9'),'foreignKey':_0x4f75('0x1ca')});db[_0x4f75('0xbd')][_0x4f75('0x110')](db[_0x4f75('0xbf')],{'as':_0x4f75('0x1c0'),'onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x1c1')});db[_0x4f75('0xbf')][_0x4f75('0x110')](db[_0x4f75('0xc0')],{'as':_0x4f75('0x1c2'),'foreignKey':_0x4f75('0x1c3')});db['ServicenowConfiguration'][_0x4f75('0x110')](db[_0x4f75('0xc0')],{'as':_0x4f75('0x1c4'),'foreignKey':'DescriptionId'});db[_0x4f75('0xbf')]['hasMany'](db[_0x4f75('0xc0')],{'as':'Fields','foreignKey':_0x4f75('0x1c6')});db[_0x4f75('0xbf')][_0x4f75('0x11f')](db[_0x4f75('0xbd')],{'as':'Account','foreignKey':_0x4f75('0x1c1')});db[_0x4f75('0xc0')]['hasMany'](db[_0x4f75('0xc0')],{'as':_0x4f75('0x1cc'),'foreignKey':'SubjectId'});db['ServicenowField'][_0x4f75('0x110')](db[_0x4f75('0xc0')],{'as':_0x4f75('0x1c7'),'foreignKey':_0x4f75('0x1c5')});db['ServicenowField'][_0x4f75('0x110')](db[_0x4f75('0xc0')],{'as':'Field','foreignKey':_0x4f75('0x1c6')});db[_0x4f75('0xc0')][_0x4f75('0x11f')](db[_0x4f75('0x1c9')],{'as':_0x4f75('0x1c9'),'foreignKey':_0x4f75('0x1ca')});db[_0x4f75('0xc2')][_0x4f75('0x110')](db[_0x4f75('0xc4')],{'as':_0x4f75('0x1c0'),'onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x1c1')});db[_0x4f75('0xc2')][_0x4f75('0x11f')](db[_0x4f75('0x104')],{'as':_0x4f75('0x104'),'foreignKey':_0x4f75('0x166')});db[_0x4f75('0xc4')][_0x4f75('0x110')](db[_0x4f75('0xc6')],{'as':_0x4f75('0x1c2'),'onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x1c3')});db['Dynamics365Configuration'][_0x4f75('0x110')](db['Dynamics365Field'],{'as':_0x4f75('0x1c4'),'onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x1c5')});db[_0x4f75('0xc4')][_0x4f75('0x110')](db['Dynamics365Field'],{'as':_0x4f75('0x1bd'),'onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x1c6')});db[_0x4f75('0xc4')][_0x4f75('0x11f')](db[_0x4f75('0xc2')],{'as':_0x4f75('0x16d'),'foreignKey':_0x4f75('0x1c1')});db['Dynamics365Field'][_0x4f75('0x110')](db[_0x4f75('0xc6')],{'as':_0x4f75('0x1cc'),'foreignKey':'SubjectId'});db[_0x4f75('0xc6')][_0x4f75('0x110')](db[_0x4f75('0xc6')],{'as':_0x4f75('0x1c7'),'foreignKey':_0x4f75('0x1c5')});db[_0x4f75('0xc6')]['hasMany'](db['Dynamics365Field'],{'as':'Field','foreignKey':_0x4f75('0x1c6')});db[_0x4f75('0xc6')][_0x4f75('0x11f')](db[_0x4f75('0x1c9')],{'as':_0x4f75('0x1c9'),'foreignKey':_0x4f75('0x1ca')});db[_0x4f75('0xc7')][_0x4f75('0x110')](db[_0x4f75('0xc8')],{'as':_0x4f75('0x1c0'),'onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x1c1')});db[_0x4f75('0xc8')]['hasMany'](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x4f75('0x1c3')});db['FreshsalesConfiguration']['hasMany'](db[_0x4f75('0xc9')],{'as':_0x4f75('0x1c4'),'foreignKey':'DescriptionId'});db['FreshsalesConfiguration']['hasMany'](db['FreshsalesField'],{'as':_0x4f75('0x1bd'),'foreignKey':_0x4f75('0x1c6')});db[_0x4f75('0xc8')][_0x4f75('0x11f')](db[_0x4f75('0xc7')],{'as':_0x4f75('0x16d'),'foreignKey':_0x4f75('0x1c1')});db[_0x4f75('0xc9')][_0x4f75('0x110')](db[_0x4f75('0xc9')],{'as':_0x4f75('0x1cc'),'foreignKey':_0x4f75('0x1c3')});db[_0x4f75('0xc9')]['hasMany'](db[_0x4f75('0xc9')],{'as':_0x4f75('0x1c7'),'foreignKey':'DescriptionId'});db[_0x4f75('0xc9')]['hasMany'](db['FreshsalesField'],{'as':'Field','foreignKey':_0x4f75('0x1c6')});db[_0x4f75('0xc9')]['belongsTo'](db['Variable'],{'as':_0x4f75('0x1c9'),'foreignKey':_0x4f75('0x1ca')});db[_0x4f75('0xcd')]['belongsTo'](db[_0x4f75('0x5d')],{});db[_0x4f75('0xcd')][_0x4f75('0x11f')](db[_0x4f75('0xf1')],{'as':_0x4f75('0x179'),'foreignKey':'ListId'});db['ChatQueueReport'][_0x4f75('0x11f')](db['CmContact'],{'as':_0x4f75('0x163'),'foreignKey':'ContactId'});db[_0x4f75('0xcd')][_0x4f75('0x11f')](db['ChatInteraction'],{});db[_0x4f75('0xcd')][_0x4f75('0x11f')](db['ChatMessage'],{});db[_0x4f75('0xcd')]['belongsTo'](db['User'],{});db['ChatQueueReport'][_0x4f75('0x11f')](db[_0x4f75('0x67')],{});db[_0x4f75('0xcf')][_0x4f75('0x11f')](db[_0x4f75('0x11')],{'onDelete':_0x4f75('0x10e'),'foreignKey':'FromId'});db[_0x4f75('0xcf')]['belongsTo'](db[_0x4f75('0x11')],{'onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x1d4')});db['JscriptySessionReport'][_0x4f75('0x110')](db['JscriptyQuestionReport'],{'foreignKey':_0x4f75('0x1d5'),'onDelete':_0x4f75('0x10e')});db[_0x4f75('0x154')][_0x4f75('0x110')](db['JscriptyAnswerReport'],{'foreignKey':_0x4f75('0x1d5'),'onDelete':_0x4f75('0x10e')});db['SmsQueueReport'][_0x4f75('0x11f')](db[_0x4f75('0x50')],{});db['SmsQueueReport'][_0x4f75('0x11f')](db[_0x4f75('0xf1')],{'as':_0x4f75('0x179'),'foreignKey':_0x4f75('0x16c')});db['SmsQueueReport'][_0x4f75('0x11f')](db[_0x4f75('0x16e')],{'as':_0x4f75('0x163'),'foreignKey':_0x4f75('0x164')});db[_0x4f75('0xd4')][_0x4f75('0x11f')](db[_0x4f75('0x54')],{});db[_0x4f75('0xd4')][_0x4f75('0x11f')](db[_0x4f75('0x183')],{});db['SmsQueueReport']['belongsTo'](db[_0x4f75('0x11')],{});db[_0x4f75('0xd4')][_0x4f75('0x11f')](db['SmsQueue'],{});db[_0x4f75('0xd9')][_0x4f75('0x110')](db[_0x4f75('0x154')],{'foreignKey':_0x4f75('0x1d6')});db['JscriptyProject'][_0x4f75('0x110')](db['JscriptyQuestionReport'],{'foreignKey':_0x4f75('0x1d6')});db['JscriptyProject'][_0x4f75('0x110')](db[_0x4f75('0xd0')],{'foreignKey':_0x4f75('0x1d6')});db[_0x4f75('0xdf')][_0x4f75('0x121')](db[_0x4f75('0x11')],{'as':_0x4f75('0x173'),'through':_0x4f75('0x148')});db[_0x4f75('0x127')]['belongsToMany'](db[_0x4f75('0x11')],{'as':_0x4f75('0x15b'),'through':'user_has_teams'});db['Team']['belongsToMany'](db[_0x4f75('0x1a')],{'through':_0x4f75('0x105'),'as':_0x4f75('0x131')});db['Team'][_0x4f75('0x121')](db[_0x4f75('0x37')],{'through':'team_has_mail_queues','as':_0x4f75('0x134')});db[_0x4f75('0x127')]['belongsToMany'](db[_0x4f75('0x67')],{'through':_0x4f75('0x196'),'as':'ChatQueues'});db['Team']['belongsToMany'](db[_0x4f75('0x4e')],{'through':_0x4f75('0x182'),'as':'FaxQueues'});db['Team']['belongsToMany'](db[_0x4f75('0x56')],{'through':_0x4f75('0x1d7'),'as':_0x4f75('0x137')});db[_0x4f75('0x127')][_0x4f75('0x121')](db[_0x4f75('0x5b')],{'through':_0x4f75('0x18c'),'as':_0x4f75('0x138')});db[_0x4f75('0x127')][_0x4f75('0x121')](db[_0x4f75('0x139')],{'through':_0x4f75('0x1d8'),'as':_0x4f75('0x13a')});db[_0x4f75('0x127')]['belongsToMany'](db[_0x4f75('0xf2')],{'through':'TeamVoicePrefix','as':_0x4f75('0x1d9')});db['Campaign']['hasMany'](db[_0x4f75('0x6e')],{'as':'Hoppers','foreignKey':_0x4f75('0x1a3')});db['Campaign'][_0x4f75('0x110')](db[_0x4f75('0x70')],{'as':'HopperFinals','foreignKey':'CampaignId'});db[_0x4f75('0x1a2')][_0x4f75('0x110')](db[_0x4f75('0x72')],{'as':_0x4f75('0x151'),'foreignKey':'CampaignId'});db[_0x4f75('0x1a2')][_0x4f75('0x110')](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0x4f75('0x1a3')});db[_0x4f75('0x1a2')][_0x4f75('0x11f')](db['Trunk'],{'as':'Trunk','foreignKey':_0x4f75('0x156')});db[_0x4f75('0x1a2')][_0x4f75('0x11f')](db[_0x4f75('0x28')],{'as':_0x4f75('0x157'),'foreignKey':_0x4f75('0x158')});db['Campaign']['belongsTo'](db[_0x4f75('0x7f')],{'as':_0x4f75('0x7f'),'foreignKey':_0x4f75('0x177')});db[_0x4f75('0x1a2')][_0x4f75('0x11f')](db[_0x4f75('0xdf')],{'as':_0x4f75('0xdf'),'foreignKey':_0x4f75('0x1da')});db[_0x4f75('0x1a2')][_0x4f75('0x121')](db[_0x4f75('0xf1')],{'as':_0x4f75('0x125'),'through':_0x4f75('0x1db')});db[_0x4f75('0x1a2')][_0x4f75('0x121')](db[_0x4f75('0xf1')],{'as':'BlackLists','through':_0x4f75('0x1dc')});db['Attachment'][_0x4f75('0x11f')](db[_0x4f75('0x65')],{'as':_0x4f75('0x65'),'foreignKey':_0x4f75('0x175')});db[_0x4f75('0xeb')][_0x4f75('0x11f')](db['MailMessage'],{});db[_0x4f75('0xeb')]['belongsTo'](db[_0x4f75('0x3b')],{});db[_0x4f75('0xeb')][_0x4f75('0x11f')](db[_0x4f75('0x36')],{'foreignKey':'FromMailAccountId','as':_0x4f75('0x1dd')});db['MailTransferReport'][_0x4f75('0x11f')](db[_0x4f75('0x11')],{'foreignKey':'FromUserId','as':_0x4f75('0x1de')});db[_0x4f75('0xeb')][_0x4f75('0x11f')](db['User'],{'foreignKey':'ToUserId','as':_0x4f75('0x1df')});db[_0x4f75('0xeb')][_0x4f75('0x11f')](db[_0x4f75('0x37')],{'foreignKey':_0x4f75('0x1e0'),'as':_0x4f75('0x1e1')});db[_0x4f75('0xeb')][_0x4f75('0x11f')](db[_0x4f75('0x36')],{'foreignKey':_0x4f75('0x1e2'),'as':_0x4f75('0x1e3')});db['ChatTransferReport'][_0x4f75('0x11f')](db[_0x4f75('0x63')],{});db[_0x4f75('0x1e4')]['belongsTo'](db[_0x4f75('0x119')],{});db[_0x4f75('0x1e4')][_0x4f75('0x11f')](db[_0x4f75('0x5d')],{'foreignKey':_0x4f75('0x1e5'),'as':'FromAccount'});db['ChatTransferReport'][_0x4f75('0x11f')](db['User'],{'foreignKey':_0x4f75('0x1e6'),'as':_0x4f75('0x1de')});db[_0x4f75('0x1e4')][_0x4f75('0x11f')](db[_0x4f75('0x11')],{'foreignKey':_0x4f75('0x1e7'),'as':'ToAgent'});db[_0x4f75('0x1e4')]['belongsTo'](db[_0x4f75('0x67')],{'foreignKey':_0x4f75('0x1e8'),'as':_0x4f75('0x1e1')});db['ChatTransferReport']['belongsTo'](db[_0x4f75('0x5d')],{'foreignKey':_0x4f75('0x1e9'),'as':'ToAccount'});db[_0x4f75('0xed')][_0x4f75('0x11f')](db[_0x4f75('0x4c')],{});db['FaxTransferReport']['belongsTo'](db[_0x4f75('0x4a')],{});db['FaxTransferReport'][_0x4f75('0x11f')](db['FaxAccount'],{'foreignKey':'FromFaxAccountId','as':'FromAccount'});db[_0x4f75('0xed')][_0x4f75('0x11f')](db['User'],{'foreignKey':_0x4f75('0x1e6'),'as':'FromAgent'});db['FaxTransferReport'][_0x4f75('0x11f')](db[_0x4f75('0x11')],{'foreignKey':_0x4f75('0x1e7'),'as':_0x4f75('0x1df')});db[_0x4f75('0xed')][_0x4f75('0x11f')](db[_0x4f75('0x4e')],{'foreignKey':_0x4f75('0x1ea'),'as':_0x4f75('0x1e1')});db[_0x4f75('0xed')][_0x4f75('0x11f')](db['FaxAccount'],{'foreignKey':_0x4f75('0x1eb'),'as':_0x4f75('0x1e3')});db[_0x4f75('0xef')][_0x4f75('0x11f')](db[_0x4f75('0x59')],{});db[_0x4f75('0xef')][_0x4f75('0x11f')](db[_0x4f75('0x118')],{});db[_0x4f75('0xef')][_0x4f75('0x11f')](db['OpenchannelAccount'],{'foreignKey':_0x4f75('0x1ec'),'as':_0x4f75('0x1dd')});db[_0x4f75('0xef')][_0x4f75('0x11f')](db[_0x4f75('0x11')],{'foreignKey':_0x4f75('0x1e6'),'as':_0x4f75('0x1de')});db[_0x4f75('0xef')]['belongsTo'](db[_0x4f75('0x11')],{'foreignKey':_0x4f75('0x1e7'),'as':_0x4f75('0x1df')});db['OpenchannelTransferReport'][_0x4f75('0x11f')](db[_0x4f75('0x5b')],{'foreignKey':'ToOpenchannelQueueId','as':_0x4f75('0x1e1')});db['OpenchannelTransferReport'][_0x4f75('0x11f')](db[_0x4f75('0x141')],{'foreignKey':'ToOpenchannelAccountId','as':_0x4f75('0x1e3')});db[_0x4f75('0x1ed')][_0x4f75('0x11f')](db[_0x4f75('0x183')],{});db[_0x4f75('0x1ed')]['belongsTo'](db['SmsInteraction'],{});db[_0x4f75('0x1ed')]['belongsTo'](db[_0x4f75('0x50')],{'foreignKey':_0x4f75('0x1ee'),'as':_0x4f75('0x1dd')});db['SmsTransferReport'][_0x4f75('0x11f')](db['User'],{'foreignKey':_0x4f75('0x1e6'),'as':_0x4f75('0x1de')});db[_0x4f75('0x1ed')][_0x4f75('0x11f')](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x4f75('0x1ed')]['belongsTo'](db[_0x4f75('0x56')],{'foreignKey':_0x4f75('0x1ef'),'as':_0x4f75('0x1e1')});db[_0x4f75('0x1ed')][_0x4f75('0x11f')](db['SmsAccount'],{'foreignKey':'ToSmsAccountId','as':_0x4f75('0x1e3')});db[_0x4f75('0xf1')]['hasMany'](db[_0x4f75('0x7b')],{'as':'Dispositions','foreignKey':'ListId','onDelete':_0x4f75('0x10e')});db[_0x4f75('0xf1')]['hasMany'](db[_0x4f75('0x75')],{'as':'CustomFields','foreignKey':'ListId'});db[_0x4f75('0xf1')][_0x4f75('0x110')](db['CmContact'],{'as':_0x4f75('0x124'),'onDelete':_0x4f75('0x10e'),'foreignKey':_0x4f75('0x16c')});db['CmList'][_0x4f75('0x110')](db[_0x4f75('0x70')],{'as':_0x4f75('0x116'),'foreignKey':_0x4f75('0x16c')});db[_0x4f75('0xf1')]['hasMany'](db[_0x4f75('0x72')],{'as':'HopperHistory','foreignKey':_0x4f75('0x16c')});db[_0x4f75('0xf1')][_0x4f75('0x110')](db[_0x4f75('0x74')],{'as':'ReportAgentPreview','foreignKey':_0x4f75('0x16c')});db[_0x4f75('0xf1')]['belongsToMany'](db[_0x4f75('0x1a')],{'as':_0x4f75('0x1f0'),'through':_0x4f75('0x1f1')});db['CmList']['belongsToMany'](db[_0x4f75('0x11')],{'as':'Agents','through':_0x4f75('0x126')});db[_0x4f75('0xf2')][_0x4f75('0x110')](db['VoiceExtension'],{'as':'Extensions','onDelete':_0x4f75('0x10e')});db[_0x4f75('0xf2')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x4f75('0x133')});db['VoicePrefix']['belongsToMany'](db['Team'],{'through':_0x4f75('0x107'),'as':_0x4f75('0x15c')});db[_0x4f75('0xf4')][_0x4f75('0x110')](db[_0x4f75('0x11')],{'as':_0x4f75('0x173'),'foreignKey':_0x4f75('0x120')});db[_0x4f75('0xf4')][_0x4f75('0x110')](db[_0x4f75('0xf6')],{'as':'UserProfileSections','foreignKey':_0x4f75('0x120'),'onDelete':_0x4f75('0x10e')});db[_0x4f75('0xf6')][_0x4f75('0x110')](db[_0x4f75('0xf8')],{'as':_0x4f75('0x1f2'),'foreignKey':_0x4f75('0x1f3'),'onDelete':_0x4f75('0x10e')});db[_0x4f75('0xfb')][_0x4f75('0x110')](db[_0x4f75('0x7b')],{'as':'Dispositions','foreignKey':_0x4f75('0x1f4'),'onDelete':_0x4f75('0x10e')});db[_0x4f75('0xfb')]['hasMany'](db['CannedAnswer'],{'as':_0x4f75('0x17b'),'foreignKey':_0x4f75('0x1f4')});db[_0x4f75('0xfb')][_0x4f75('0x110')](db['WhatsappMessage'],{'as':_0x4f75('0x16a'),'foreignKey':_0x4f75('0x1f4')});db[_0x4f75('0xfb')]['hasMany'](db['WhatsappInteraction'],{'as':'Interactions'});db[_0x4f75('0xfb')]['hasMany'](db['WhatsappApplication'],{'as':_0x4f75('0x14b')});db[_0x4f75('0xfb')][_0x4f75('0x11f')](db['CmList'],{'as':_0x4f75('0x179'),'foreignKey':_0x4f75('0x16c')});db['WhatsappAccount'][_0x4f75('0x11f')](db[_0x4f75('0x81')],{'as':_0x4f75('0x159'),'foreignKey':_0x4f75('0x15a')});db[_0x4f75('0xfb')][_0x4f75('0x121')](db[_0x4f75('0x11')],{'as':_0x4f75('0x15b'),'through':_0x4f75('0x146')});db[_0x4f75('0xfd')][_0x4f75('0x11f')](db[_0x4f75('0x11')],{'onDelete':_0x4f75('0x176')});db['WhatsappApplication'][_0x4f75('0x11f')](db[_0x4f75('0x139')],{'onDelete':_0x4f75('0x176')});db[_0x4f75('0xfd')]['belongsTo'](db[_0x4f75('0xfb')],{'onDelete':_0x4f75('0x176')});db[_0x4f75('0xfd')][_0x4f75('0x11f')](db[_0x4f75('0x7f')],{'onDelete':_0x4f75('0x176'),'foreignKey':_0x4f75('0x177')});db['WhatsappApplication']['belongsTo'](db[_0x4f75('0x89')],{'onDelete':_0x4f75('0x176'),'foreignKey':_0x4f75('0x178')});db[_0x4f75('0xfe')]['hasMany'](db[_0x4f75('0x1f5')],{'as':_0x4f75('0x16a'),'onDelete':_0x4f75('0x10e'),'foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction'][_0x4f75('0x11f')](db[_0x4f75('0xfb')],{'as':'Account','foreignKey':_0x4f75('0x1f4')});db[_0x4f75('0xfe')][_0x4f75('0x11f')](db[_0x4f75('0x16e')],{'as':_0x4f75('0x163'),'foreignKey':_0x4f75('0x164')});db['WhatsappInteraction'][_0x4f75('0x11f')](db[_0x4f75('0x11')],{'as':_0x4f75('0x16f'),'foreignKey':_0x4f75('0x10f')});db['WhatsappInteraction'][_0x4f75('0x121')](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':_0x4f75('0x171')});db[_0x4f75('0xfe')][_0x4f75('0x121')](db[_0x4f75('0x89')],{'through':_0x4f75('0x1b3'),'as':_0x4f75('0x172')});db[_0x4f75('0xfe')][_0x4f75('0x121')](db[_0x4f75('0x11')],{'as':_0x4f75('0x173'),'through':_0x4f75('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x4f75('0x1f5')]['belongsTo'](db[_0x4f75('0x11')],{'as':_0x4f75('0x11')});db['WhatsappMessage'][_0x4f75('0x11f')](db['CmContact'],{'onDelete':_0x4f75('0x10e'),'as':_0x4f75('0x163')});db[_0x4f75('0x1f5')][_0x4f75('0x11f')](db[_0x4f75('0xfe')],{'onDelete':'cascade','as':_0x4f75('0x180'),'foreignKey':_0x4f75('0x1f6')});db['WhatsappMessage'][_0x4f75('0x11f')](db[_0x4f75('0xfb')],{'as':'Account','foreignKey':_0x4f75('0x1f4')});db[_0x4f75('0x101')][_0x4f75('0x11f')](db[_0x4f75('0xfb')],{});db[_0x4f75('0x101')]['belongsTo'](db[_0x4f75('0xf1')],{'as':_0x4f75('0x179'),'foreignKey':_0x4f75('0x16c')});db[_0x4f75('0x101')][_0x4f75('0x11f')](db[_0x4f75('0x16e')],{'as':'Contact','foreignKey':'ContactId'});db[_0x4f75('0x101')][_0x4f75('0x11f')](db['WhatsappInteraction'],{});db[_0x4f75('0x101')][_0x4f75('0x11f')](db['WhatsappQueue'],{});db[_0x4f75('0x101')][_0x4f75('0x11f')](db[_0x4f75('0x1f5')],{});db['WhatsappQueueReport'][_0x4f75('0x11f')](db[_0x4f75('0x11')],{});db[_0x4f75('0x1f7')]['belongsTo'](db[_0x4f75('0x1f5')],{});db['WhatsappTransferReport'][_0x4f75('0x11f')](db['WhatsappInteraction'],{});db[_0x4f75('0x1f7')][_0x4f75('0x11f')](db[_0x4f75('0xfb')],{'foreignKey':_0x4f75('0x1f8'),'as':_0x4f75('0x1dd')});db[_0x4f75('0x1f7')][_0x4f75('0x11f')](db['WhatsappAccount'],{'foreignKey':_0x4f75('0x1f9'),'as':'ToAccount'});db[_0x4f75('0x1f7')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x4f75('0x1fa'),'as':_0x4f75('0x1e1')});db['WhatsappTransferReport'][_0x4f75('0x11f')](db[_0x4f75('0x11')],{'foreignKey':_0x4f75('0x1e6'),'as':_0x4f75('0x1de')});db[_0x4f75('0x1f7')]['belongsTo'](db[_0x4f75('0x11')],{'foreignKey':'ToUserId','as':_0x4f75('0x1df')});db['WhatsappQueue'][_0x4f75('0x121')](db[_0x4f75('0x11')],{'as':_0x4f75('0x15b'),'through':'UserWhatsappQueue','foreignKey':_0x4f75('0x1fb')});db[_0x4f75('0x139')][_0x4f75('0x121')](db[_0x4f75('0x127')],{'through':_0x4f75('0x1d8'),'as':_0x4f75('0x15c')});db['UserSetting'][_0x4f75('0x11f')](db['User'],{'as':_0x4f75('0x1fc'),'foreignKey':_0x4f75('0x10f'),'onDelete':_0x4f75('0x10e'),'hooks':!![]});db['CloudProvider'][_0x4f75('0x10c')](db[_0x4f75('0xc2')],{'as':_0x4f75('0xc2'),'onDelete':_0x4f75('0x176')});db[_0x4f75('0x104')]['hasOne'](db[_0x4f75('0x34')],{'as':_0x4f75('0x168'),'onDelete':'restrict'});db[_0x4f75('0x104')][_0x4f75('0x10c')](db[_0x4f75('0x167')],{'as':'Smtp','onDelete':_0x4f75('0x176')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x3cf8=['UserFaxQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','ChatWebsite','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_openchannel_accounts','SmsAccounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','CmHopper','Hoppers','HopperHistories','JscriptySessions','belongsTo','TrunkBackup','IntervalId','Lists','voice_queues_has_cm_lists','Team','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceQueueReport','QueueCalls','uniqueid','Contact','ContactId','CloudProviderId','restrict','MailAccountId','Smtp','Dispositions','List','ListId','TemplateId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','user_has_mail_accounts','Teams','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','ChatWebsiteId','TagId','FaxAccountId','Answers','Interactions','Exntensions','FaxInteractionId','fax_interaction_has_tags','Interaction','AttachmentId','team_has_fax_queues','SmsAccountId','user_has_sms_accounts','SmsInteractionId','sms_interaction_has_tags','UserSmsQueue','SmsQueueId','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','OpenchannelQueueReport','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessageId','ChatGroupId','chat_group_has_users','CompanyId','Phones','CmContactId','Company','cm_contact_has_tags','AdditionalPhones','CmHopperId','OwnerId','CampaignId','Condition','All','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','Extensions','MailApplications','ChatApplications','FaxApplications','DefaultReportId','CustomReportId','whatsapp_interaction_has_tags','ContactItemType','ItemType','ItemTypeId','Hopper','Trigger','AllConditions','AllCondition','TriggerAllId','AnyCondition','TriggerAnyId','TriggerId','Fields','AnalyticMetric','MetricId','Configurations','AccountId','Subjects','Descriptions','DescriptionId','FieldId','Subject','SubjectId','Field','VariableId','SugarcrmField','SugarcrmAccount','Description','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','FreshsalesConfiguration','FreshsalesAccount','ChatQueueReport','ChatInternalMessage','ToId','SessionId','ProjectId','user_has_teams','team_has_mail_queues','MailQueues','team_has_chat_queues','ChatQueues','team_has_sms_queues','team_has_whatsapp_queues','TeamVoicePrefix','TrunkId','SquareProjectId','BlackLists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToAccount','FromUserId','ToUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','ToSmsQueueId','ToSmsAccountId','HopperHistory','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','UserSetting','user','Imap','exports','../config/environment','sequelize','lodash','jstz','defaultsDeep','xcall','mysql','utf8','utf8_general_ci','sequelizeHistory','xC@LL1234','127.0.0.1','utf8mb4','name','database','username','options','password','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserOpenchannelQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboardItem/dashboardItem.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','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','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','Template','../api/template/template.model','Variable','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','Network','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','../api/team/team.model','License','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','User','hasOne','userSetting','cascade','UserId','hasMany','VoiceQueuesRt','VoiceExtension','HopperFinals','ReportAgentPreview','OpenchannelInteractions','ChatInteraction','ChatInteractions','FaxInteractions','MailInteractions','WhatsappInteraction','UserNotifications','UserProfile','userProfileId','belongsToMany','ChatGroup','CmContact','Contacts','cm_user_has_contacts','cm_user_has_lists','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','user_has_openchannel_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueue','FaxQueue','FaxQueues'];(function(_0x119d25,_0x588c8){var _0x39cf30=function(_0x31c68c){while(--_0x31c68c){_0x119d25['push'](_0x119d25['shift']());}};_0x39cf30(++_0x588c8);}(_0x3cf8,0xca));var _0x83cf=function(_0x4b92e9,_0x2f6330){_0x4b92e9=_0x4b92e9-0x0;var _0x3de0be=_0x3cf8[_0x4b92e9];return _0x3de0be;};'use strict';var config=require(_0x83cf('0x0'));var Sequelize=require(_0x83cf('0x1'));var _=require(_0x83cf('0x2'));var jstz=require(_0x83cf('0x3'));var timezone=jstz['determine']();config[_0x83cf('0x1')]=_[_0x83cf('0x4')](config[_0x83cf('0x1')],{'database':'motion2','username':_0x83cf('0x5'),'password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x83cf('0x6'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x83cf('0x7'),'collate':_0x83cf('0x8')}}});config[_0x83cf('0x9')]=_['defaultsDeep'](config[_0x83cf('0x9')],{'database':'motion2','username':_0x83cf('0x5'),'password':_0x83cf('0xa'),'options':{'host':_0x83cf('0xb'),'port':0xcea,'dialect':_0x83cf('0x6'),'dialectOptions':{'charset':_0x83cf('0xc')},'logging':![],'timezone':timezone[_0x83cf('0xd')](),'define':{'charset':'utf8','collate':_0x83cf('0x8')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x83cf('0x1')][_0x83cf('0xe')],config[_0x83cf('0x1')][_0x83cf('0xf')],config[_0x83cf('0x1')]['password'],config[_0x83cf('0x1')][_0x83cf('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x83cf('0x9')]['database'],config['sequelizeHistory'][_0x83cf('0xf')],config[_0x83cf('0x9')][_0x83cf('0x11')],config['sequelizeHistory'][_0x83cf('0x10')])};db['User']=db[_0x83cf('0x1')]['import'](_0x83cf('0x12'));db[_0x83cf('0x13')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x15'));db['VoiceContext']=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x16'));db['VoiceExtension']=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x17'));db[_0x83cf('0x18')]=db['sequelize'][_0x83cf('0x14')](_0x83cf('0x19'));db[_0x83cf('0x1a')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x1b'));db[_0x83cf('0x1c')]=db['sequelize'][_0x83cf('0x14')](_0x83cf('0x1d'));db[_0x83cf('0x1e')]=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/screenRecording/screenRecording.model');db[_0x83cf('0x1f')]=db['sequelize'][_0x83cf('0x14')](_0x83cf('0x20'));db[_0x83cf('0x21')]=db['sequelize'][_0x83cf('0x14')](_0x83cf('0x22'));db[_0x83cf('0x23')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x24'));db[_0x83cf('0x25')]=db['sequelize'][_0x83cf('0x14')](_0x83cf('0x26'));db[_0x83cf('0x27')]=db['sequelize']['import'](_0x83cf('0x28'));db['VoiceQueueReport']=db[_0x83cf('0x1')]['import'](_0x83cf('0x29'));db[_0x83cf('0x2a')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x2b'));db[_0x83cf('0x2c')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x2d'));db[_0x83cf('0x2e')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x2f'));db[_0x83cf('0x30')]=db['sequelize']['import']('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x83cf('0x31')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x32'));db[_0x83cf('0x33')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x34'));db[_0x83cf('0x35')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x36'));db['UserFaxQueue']=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/userFaxQueue/userFaxQueue.model');db['UserSmsQueue']=db[_0x83cf('0x1')]['import']('../api/userSmsQueue/userSmsQueue.model');db[_0x83cf('0x37')]=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db['UserWhatsappQueue']=db['sequelize'][_0x83cf('0x14')](_0x83cf('0x38'));db[_0x83cf('0x39')]=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/mailServerIn/mailServerIn.model');db[_0x83cf('0x3a')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x3b'));db[_0x83cf('0x3c')]=db['sequelize'][_0x83cf('0x14')]('../api/mailAccount/mailAccount.model');db['MailQueue']=db['sequelize'][_0x83cf('0x14')](_0x83cf('0x3d'));db[_0x83cf('0x3e')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x3f'));db[_0x83cf('0x40')]=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/mailInteraction/mailInteraction.model');db[_0x83cf('0x41')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x42'));db[_0x83cf('0x43')]=db['sequelize'][_0x83cf('0x14')](_0x83cf('0x44'));db[_0x83cf('0x45')]=db['sequelize'][_0x83cf('0x14')](_0x83cf('0x46'));db[_0x83cf('0x47')]=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/dashboard/dashboard.model');db['DashboardItem']=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x48'));db['FaxAccount']=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/faxAccount/faxAccount.model');db[_0x83cf('0x49')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x4a'));db[_0x83cf('0x4b')]=db['sequelize'][_0x83cf('0x14')]('../api/faxInteraction/faxInteraction.model');db[_0x83cf('0x4c')]=db[_0x83cf('0x1')]['import'](_0x83cf('0x4d'));db['FaxQueue']=db[_0x83cf('0x1')]['import'](_0x83cf('0x4e'));db[_0x83cf('0x4f')]=db['sequelize']['import']('../api/faxQueueReport/faxQueueReport.model');db[_0x83cf('0x50')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x51'));db[_0x83cf('0x52')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x53'));db[_0x83cf('0x54')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x55'));db[_0x83cf('0x56')]=db[_0x83cf('0x1')]['import'](_0x83cf('0x57'));db[_0x83cf('0x58')]=db[_0x83cf('0x1')]['import'](_0x83cf('0x59'));db[_0x83cf('0x5a')]=db['sequelize'][_0x83cf('0x14')](_0x83cf('0x5b'));db['OpenchannelApplication']=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/openchannelApplication/openchannelApplication.model');db[_0x83cf('0x5c')]=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x83cf('0x5d')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x5e'));db[_0x83cf('0x5f')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x60'));db['ChatWebsite']=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/chatWebsite/chatWebsite.model');db['OpenchannelQueueReport']=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x61'));db[_0x83cf('0x62')]=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/chatApplication/chatApplication.model');db['ChatInteraction']=db[_0x83cf('0x1')]['import'](_0x83cf('0x63'));db[_0x83cf('0x64')]=db[_0x83cf('0x1')]['import']('../api/chatMessage/chatMessage.model');db[_0x83cf('0x65')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x66'));db[_0x83cf('0x67')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x68'));db['ChatGroup']=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/chatGroup/chatGroup.model');db[_0x83cf('0x69')]=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0x83cf('0x6a')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x6b'));db['CmContact']=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x6c'));db['CmHopper']=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x6d'));db[_0x83cf('0x6e')]=db['sequelize']['import'](_0x83cf('0x6f'));db[_0x83cf('0x70')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x71'));db[_0x83cf('0x72')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x73'));db['ReportAgentPreview']=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x74'));db[_0x83cf('0x75')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x76'));db[_0x83cf('0x77')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x78'));db[_0x83cf('0x79')]=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/automation/automation.model');db[_0x83cf('0x7a')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x7b'));db[_0x83cf('0x7c')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x7d'));db['Condition']=db[_0x83cf('0x1')]['import'](_0x83cf('0x7e'));db[_0x83cf('0x7f')]=db['sequelize']['import'](_0x83cf('0x80'));db[_0x83cf('0x81')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x82'));db[_0x83cf('0x83')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x84'));db[_0x83cf('0x85')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x86'));db[_0x83cf('0x87')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x88'));db[_0x83cf('0x89')]=db[_0x83cf('0x1')]['import'](_0x83cf('0x8a'));db[_0x83cf('0x8b')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x8c'));db['ContactItemType']=db['sequelize'][_0x83cf('0x14')](_0x83cf('0x8d'));db[_0x83cf('0x8e')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x8f'));db[_0x83cf('0x90')]=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x83cf('0x91')]=db['sequelize'][_0x83cf('0x14')](_0x83cf('0x92'));db['Trigger']=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/trigger/trigger.model');db[_0x83cf('0x93')]=db[_0x83cf('0x1')]['import'](_0x83cf('0x94'));db['Integration']=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x95'));db[_0x83cf('0x96')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x97'));db[_0x83cf('0x98')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x99'));db[_0x83cf('0x9a')]=db['sequelize'][_0x83cf('0x14')](_0x83cf('0x9b'));db['AnalyticExtractedReport']=db[_0x83cf('0x1')]['import'](_0x83cf('0x9c'));db['AnalyticMetric']=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x9d'));db[_0x83cf('0x9e')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x9f'));db[_0x83cf('0xa0')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xa1'));db[_0x83cf('0xa2')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xa3'));db[_0x83cf('0xa4')]=db['sequelize']['import']('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x83cf('0xa5')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xa6'));db['SugarcrmAccount']=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x83cf('0xa7')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xa8'));db['SugarcrmField']=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xa9'));db[_0x83cf('0xaa')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xab'));db[_0x83cf('0xac')]=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x83cf('0xad')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xae'));db[_0x83cf('0xaf')]=db[_0x83cf('0x1')]['import'](_0x83cf('0xb0'));db[_0x83cf('0xb1')]=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x83cf('0xb2')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xb3'));db[_0x83cf('0xb4')]=db['sequelize']['import']('../api/intZendeskAccount/intZendeskAccount.model');db[_0x83cf('0xb5')]=db[_0x83cf('0x1')]['import'](_0x83cf('0xb6'));db[_0x83cf('0xb7')]=db[_0x83cf('0x1')]['import'](_0x83cf('0xb8'));db[_0x83cf('0xb9')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xba'));db[_0x83cf('0xbb')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xbc'));db[_0x83cf('0xbd')]=db['sequelize']['import']('../api/intFreshdeskField/intFreshdeskField.model');db[_0x83cf('0xbe')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xbf'));db[_0x83cf('0xc0')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xc1'));db[_0x83cf('0xc2')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xc3'));db[_0x83cf('0xc4')]=db['sequelize'][_0x83cf('0x14')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0x83cf('0xc5')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xc6'));db[_0x83cf('0xc7')]=db[_0x83cf('0x1')]['import']('../api/intServicenowField/intServicenowField.model');db[_0x83cf('0xc8')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xc9'));db[_0x83cf('0xca')]=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x83cf('0xcb')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xcc'));db['FreshsalesAccount']=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xcd'));db['FreshsalesConfiguration']=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0x83cf('0xce')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xcf'));db[_0x83cf('0xd0')]=db[_0x83cf('0x1')]['import'](_0x83cf('0x95'));db[_0x83cf('0xd1')]=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/network/network.model');db['ChatQueueReport']=db['sequelize']['import'](_0x83cf('0xd2'));db['ChatInternalMessage']=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xd3'));db[_0x83cf('0xd4')]=db['sequelize'][_0x83cf('0x14')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x83cf('0xd5')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xd6'));db[_0x83cf('0xd7')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xd8'));db[_0x83cf('0xd9')]=db['sequelize'][_0x83cf('0x14')](_0x83cf('0xda'));db[_0x83cf('0xdb')]=db[_0x83cf('0x1')]['import'](_0x83cf('0xdc'));db[_0x83cf('0xdd')]=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/squareReportDetail/squareReportDetail.model');db[_0x83cf('0xde')]=db['sequelize'][_0x83cf('0x14')](_0x83cf('0xdf'));db[_0x83cf('0xe0')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xe1'));db['SquareOdbc']=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xe2'));db[_0x83cf('0xe3')]=db['sequelize'][_0x83cf('0x14')](_0x83cf('0xe4'));db['SquareRecording']=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/squareRecording/squareRecording.model');db['SquareMessage']=db['sequelize'][_0x83cf('0x14')]('../api/squareMessage/squareMessage.model');db['Team']=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xe5'));db[_0x83cf('0xe6')]=db['sequelize']['import']('../api/license/license.model');db[_0x83cf('0xe7')]=db['sequelize'][_0x83cf('0x14')](_0x83cf('0xe8'));db[_0x83cf('0xe9')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xea'));db[_0x83cf('0xeb')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xec'));db[_0x83cf('0xed')]=db[_0x83cf('0x1')]['import']('../api/plugin/plugin.model');db['MailTransferReport']=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xee'));db[_0x83cf('0xef')]=db['sequelize']['import'](_0x83cf('0xf0'));db[_0x83cf('0xf1')]=db[_0x83cf('0x1')]['import']('../api/faxTransferReport/faxTransferReport.model');db['OpenchannelTransferReport']=db['sequelize']['import'](_0x83cf('0xf2'));db[_0x83cf('0xf3')]=db['sequelize']['import'](_0x83cf('0xf4'));db[_0x83cf('0xf5')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xf6'));db[_0x83cf('0xf7')]=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/voicePrefix/voicePrefix.model');db['UserProfile']=db['sequelize'][_0x83cf('0x14')]('../api/userProfile/userProfile.model');db[_0x83cf('0xf8')]=db[_0x83cf('0x1')]['import'](_0x83cf('0xf9'));db['UserProfileResource']=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0xfa'));db[_0x83cf('0xfb')]=db[_0x83cf('0x1')]['import'](_0x83cf('0xfc'));db['WhatsappAccount']=db[_0x83cf('0x1')]['import'](_0x83cf('0xfd'));db[_0x83cf('0xfe')]=db['sequelize'][_0x83cf('0x14')](_0x83cf('0xff'));db['WhatsappInteraction']=db[_0x83cf('0x1')]['import'](_0x83cf('0x100'));db[_0x83cf('0x101')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x102'));db[_0x83cf('0x103')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x104'));db[_0x83cf('0x105')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x106'));db[_0x83cf('0x107')]=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/whatsappQueue/whatsappQueue.model');db[_0x83cf('0x108')]=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/cloudProvider/cloudProvider.model');db[_0x83cf('0x109')]=db[_0x83cf('0x1')]['import'](_0x83cf('0x10a'));db['TeamVoicePrefix']=db[_0x83cf('0x1')]['import']('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x83cf('0x10b')]=db[_0x83cf('0x1')][_0x83cf('0x14')](_0x83cf('0x10c'));db['UserSetting']=db[_0x83cf('0x1')][_0x83cf('0x14')]('../api/user-setting/user-setting.model');db[_0x83cf('0x10d')][_0x83cf('0x10e')](db[_0x83cf('0x1f')],{'as':_0x83cf('0x1f'),'onDelete':'cascade','foreignKey':'UserId'});db[_0x83cf('0x10d')][_0x83cf('0x10e')](db['UserSetting'],{'as':_0x83cf('0x10f'),'onDelete':_0x83cf('0x110'),'foreignKey':_0x83cf('0x111')});db[_0x83cf('0x10d')][_0x83cf('0x112')](db[_0x83cf('0x1c')],{'as':'Recordings','foreignKey':_0x83cf('0x111')});db[_0x83cf('0x10d')]['hasMany'](db[_0x83cf('0x30')],{'as':_0x83cf('0x113'),'foreignKey':_0x83cf('0x111')});db[_0x83cf('0x10d')][_0x83cf('0x112')](db[_0x83cf('0x114')],{'as':'Extensions','onDelete':'cascade','hooks':!![]});db[_0x83cf('0x10d')][_0x83cf('0x112')](db[_0x83cf('0x70')],{'as':_0x83cf('0x115'),'foreignKey':_0x83cf('0x111')});db[_0x83cf('0x10d')][_0x83cf('0x112')](db[_0x83cf('0x72')],{'as':'HopperHistory','foreignKey':_0x83cf('0x111')});db[_0x83cf('0x10d')][_0x83cf('0x112')](db[_0x83cf('0x116')],{'as':'ReportAgentPreview','foreignKey':_0x83cf('0x111')});db[_0x83cf('0x10d')][_0x83cf('0x112')](db['OpenchannelInteraction'],{'as':_0x83cf('0x117'),'foreignKey':'UserId'});db[_0x83cf('0x10d')][_0x83cf('0x112')](db[_0x83cf('0x118')],{'as':_0x83cf('0x119'),'foreignKey':_0x83cf('0x111')});db['User'][_0x83cf('0x112')](db[_0x83cf('0x54')],{'as':'SmsInteractions','foreignKey':_0x83cf('0x111')});db['User']['hasMany'](db['FaxInteraction'],{'as':_0x83cf('0x11a'),'foreignKey':'UserId'});db['User'][_0x83cf('0x112')](db[_0x83cf('0x40')],{'as':_0x83cf('0x11b'),'foreignKey':_0x83cf('0x111')});db[_0x83cf('0x10d')][_0x83cf('0x112')](db[_0x83cf('0x11c')],{'as':'WhatsappInteractions','foreignKey':_0x83cf('0x111')});db[_0x83cf('0x10d')]['hasMany'](db[_0x83cf('0xfb')],{'as':_0x83cf('0x11d'),'foreignKey':'SenderId'});db[_0x83cf('0x10d')]['belongsTo'](db[_0x83cf('0x11e')],{'as':_0x83cf('0x11e'),'foreignKey':_0x83cf('0x11f')});db['User'][_0x83cf('0x120')](db[_0x83cf('0x121')],{'as':'Groups','through':'chat_group_has_users'});db[_0x83cf('0x10d')][_0x83cf('0x120')](db[_0x83cf('0x122')],{'as':_0x83cf('0x123'),'through':_0x83cf('0x124')});db[_0x83cf('0x10d')][_0x83cf('0x120')](db[_0x83cf('0xf5')],{'as':'Lists','through':_0x83cf('0x125')});db[_0x83cf('0x10d')][_0x83cf('0x120')](db['Team'],{'through':'user_has_teams'});db[_0x83cf('0x10d')][_0x83cf('0x120')](db[_0x83cf('0x40')],{'as':_0x83cf('0x11b'),'through':_0x83cf('0x126')});db[_0x83cf('0x10d')][_0x83cf('0x120')](db[_0x83cf('0x118')],{'as':'ChatInteractions','through':_0x83cf('0x127')});db['User']['belongsToMany'](db[_0x83cf('0x4b')],{'as':_0x83cf('0x11a'),'through':_0x83cf('0x128')});db['User'][_0x83cf('0x120')](db[_0x83cf('0x54')],{'as':_0x83cf('0x129'),'through':_0x83cf('0x12a')});db[_0x83cf('0x10d')][_0x83cf('0x120')](db['OpenchannelInteraction'],{'as':_0x83cf('0x117'),'through':_0x83cf('0x12b')});db['User'][_0x83cf('0x120')](db[_0x83cf('0x11c')],{'as':_0x83cf('0x12c'),'through':_0x83cf('0x12d')});db['User'][_0x83cf('0x120')](db['VoiceQueue'],{'as':_0x83cf('0x12e'),'through':_0x83cf('0x31'),'required':![]});db['User'][_0x83cf('0x120')](db[_0x83cf('0xf7')],{'as':_0x83cf('0x12f'),'through':_0x83cf('0x10b'),'required':![]});db['User']['belongsToMany'](db[_0x83cf('0x130')],{'as':'MailQueues','through':_0x83cf('0x35'),'required':![]});db[_0x83cf('0x10d')][_0x83cf('0x120')](db['ChatQueue'],{'as':'ChatQueues','through':_0x83cf('0x33'),'required':![],'hooks':!![]});db[_0x83cf('0x10d')][_0x83cf('0x120')](db[_0x83cf('0x131')],{'as':_0x83cf('0x132'),'through':_0x83cf('0x133'),'required':![]});db[_0x83cf('0x10d')][_0x83cf('0x120')](db[_0x83cf('0x58')],{'as':_0x83cf('0x134'),'through':'UserSmsQueue','required':![]});db[_0x83cf('0x10d')]['belongsToMany'](db[_0x83cf('0x5f')],{'as':_0x83cf('0x135'),'through':_0x83cf('0x37'),'required':![]});db[_0x83cf('0x10d')]['belongsToMany'](db[_0x83cf('0x107')],{'as':_0x83cf('0x136'),'through':_0x83cf('0x137'),'required':![]});db[_0x83cf('0x10d')][_0x83cf('0x120')](db[_0x83cf('0xf5')],{'through':_0x83cf('0x125')});db['User'][_0x83cf('0x120')](db[_0x83cf('0x138')],{'as':'ChatWebsites','through':_0x83cf('0x139')});db[_0x83cf('0x10d')][_0x83cf('0x120')](db[_0x83cf('0x13a')],{'as':_0x83cf('0x13b'),'through':_0x83cf('0x13c')});db[_0x83cf('0x10d')]['belongsToMany'](db['MailAccount'],{'as':_0x83cf('0x13d'),'through':'user_has_mail_accounts'});db[_0x83cf('0x10d')][_0x83cf('0x120')](db[_0x83cf('0x5a')],{'as':'OpenchannelAccounts','through':_0x83cf('0x13e')});db[_0x83cf('0x10d')][_0x83cf('0x120')](db[_0x83cf('0x50')],{'as':_0x83cf('0x13f'),'through':'user_has_sms_accounts'});db[_0x83cf('0x10d')]['belongsToMany'](db[_0x83cf('0x140')],{'as':_0x83cf('0x141'),'through':_0x83cf('0x142')});db[_0x83cf('0x10d')]['belongsToMany'](db[_0x83cf('0xe3')],{'as':_0x83cf('0x143'),'through':_0x83cf('0x144')});db[_0x83cf('0x13')][_0x83cf('0x112')](db[_0x83cf('0x114')],{'as':_0x83cf('0x145'),'onDelete':_0x83cf('0x110'),'foreignKey':_0x83cf('0x146')});db[_0x83cf('0x147')]['hasMany'](db[_0x83cf('0x114')],{'onDelete':_0x83cf('0x110')});db[_0x83cf('0x114')][_0x83cf('0x112')](db[_0x83cf('0x114')],{'as':_0x83cf('0x148'),'onDelete':_0x83cf('0x110')});db['VoiceMusicOnHold'][_0x83cf('0x120')](db[_0x83cf('0x89')],{'as':_0x83cf('0x149'),'through':_0x83cf('0x14a')});db[_0x83cf('0x1a')]['hasMany'](db[_0x83cf('0x30')],{'as':_0x83cf('0x14b'),'foreignKey':_0x83cf('0x14c')});db[_0x83cf('0x1a')][_0x83cf('0x112')](db[_0x83cf('0x14d')],{'as':_0x83cf('0x14e'),'foreignKey':_0x83cf('0x14c')});db[_0x83cf('0x1a')][_0x83cf('0x112')](db[_0x83cf('0x70')],{'as':'HopperFinals','foreignKey':_0x83cf('0x14c')});db[_0x83cf('0x1a')][_0x83cf('0x112')](db[_0x83cf('0x72')],{'as':_0x83cf('0x14f'),'foreignKey':'VoiceQueueId'});db[_0x83cf('0x1a')][_0x83cf('0x112')](db['ReportAgentPreview'],{'as':_0x83cf('0x116'),'foreignKey':_0x83cf('0x14c')});db[_0x83cf('0x1a')][_0x83cf('0x112')](db[_0x83cf('0x6e')],{'as':'HopperBlacks','foreignKey':_0x83cf('0x14c')});db[_0x83cf('0x1a')][_0x83cf('0x112')](db['JscriptySessionReport'],{'as':_0x83cf('0x150'),'foreignKey':_0x83cf('0x14c')});db[_0x83cf('0x1a')][_0x83cf('0x151')](db[_0x83cf('0x2c')],{'as':_0x83cf('0x2c'),'foreignKey':'TrunkId'});db[_0x83cf('0x1a')]['belongsTo'](db[_0x83cf('0x2c')],{'as':_0x83cf('0x152'),'foreignKey':'TrunkBackupId'});db[_0x83cf('0x1a')][_0x83cf('0x151')](db[_0x83cf('0x7f')],{'as':_0x83cf('0x7f'),'foreignKey':_0x83cf('0x153')});db[_0x83cf('0x1a')][_0x83cf('0x151')](db[_0x83cf('0x81')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['VoiceQueue'][_0x83cf('0x120')](db[_0x83cf('0xf5')],{'as':_0x83cf('0x154'),'through':_0x83cf('0x155')});db[_0x83cf('0x1a')][_0x83cf('0x120')](db[_0x83cf('0x10d')],{'as':'Agents','through':_0x83cf('0x31')});db[_0x83cf('0x1a')][_0x83cf('0x120')](db[_0x83cf('0x156')],{'as':'Teams','through':'TeamVoiceQueue'});db['VoiceQueue'][_0x83cf('0x120')](db['CmList'],{'as':'BlackLists','through':_0x83cf('0x157')});db[_0x83cf('0x1c')]['belongsTo'](db['User'],{'as':_0x83cf('0x10d'),'foreignKey':'UserId'});db['ScreenRecording'][_0x83cf('0x151')](db[_0x83cf('0x10d')],{'as':_0x83cf('0x10d'),'foreignKey':_0x83cf('0x111')});db[_0x83cf('0x1f')][_0x83cf('0x112')](db[_0x83cf('0x21')],{'as':_0x83cf('0x158'),'onDelete':_0x83cf('0x110'),'foreignKey':_0x83cf('0x159'),'sourceKey':_0x83cf('0x15a')});db[_0x83cf('0x21')][_0x83cf('0x151')](db['VoiceMail'],{'foreignKey':_0x83cf('0x159'),'targetKey':'mailbox'});db['VoiceCallReport'][_0x83cf('0x112')](db[_0x83cf('0x15b')],{'as':_0x83cf('0x15c'),'foreignKey':_0x83cf('0x15d'),'constraints':![]});db[_0x83cf('0x23')][_0x83cf('0x112')](db[_0x83cf('0x27')],{'as':'AgentReports','foreignKey':_0x83cf('0x15d'),'constraints':![]});db['VoiceCallReport'][_0x83cf('0x151')](db[_0x83cf('0x10d')],{'as':_0x83cf('0x10d'),'foreignKey':'UserId'});db[_0x83cf('0x23')]['belongsTo'](db[_0x83cf('0x122')],{'as':_0x83cf('0x15e'),'foreignKey':_0x83cf('0x15f')});db[_0x83cf('0x39')][_0x83cf('0x151')](db['MailAccount'],{'as':_0x83cf('0x3c'),'foreignKey':'MailAccountId'});db[_0x83cf('0x39')][_0x83cf('0x151')](db[_0x83cf('0x108')],{'as':'CloudProvider','foreignKey':_0x83cf('0x160'),'onDelete':_0x83cf('0x161')});db[_0x83cf('0x3a')]['belongsTo'](db[_0x83cf('0x3c')],{'as':'MailAccount','foreignKey':_0x83cf('0x162')});db[_0x83cf('0x3a')][_0x83cf('0x151')](db[_0x83cf('0x108')],{'as':'CloudProvider','foreignKey':_0x83cf('0x160'),'onDelete':'restrict'});db[_0x83cf('0x3c')]['hasOne'](db[_0x83cf('0x39')],{'as':'Imap','onDelete':_0x83cf('0x110')});db['MailAccount']['hasOne'](db['MailServerOut'],{'as':_0x83cf('0x163'),'onDelete':_0x83cf('0x110')});db[_0x83cf('0x3c')]['hasMany'](db[_0x83cf('0x7c')],{'as':_0x83cf('0x164'),'foreignKey':'MailAccountId','onDelete':_0x83cf('0x110')});db[_0x83cf('0x3c')][_0x83cf('0x112')](db[_0x83cf('0x7a')],{'as':'Answers','foreignKey':_0x83cf('0x162')});db[_0x83cf('0x3c')][_0x83cf('0x112')](db['MailMessage'],{'as':'Messages','foreignKey':_0x83cf('0x162')});db[_0x83cf('0x3c')][_0x83cf('0x112')](db[_0x83cf('0x40')],{'as':'Interactions'});db[_0x83cf('0x3c')][_0x83cf('0x112')](db[_0x83cf('0x43')],{'as':_0x83cf('0x148')});db[_0x83cf('0x3c')][_0x83cf('0x151')](db['CmList'],{'as':_0x83cf('0x165'),'foreignKey':_0x83cf('0x166')});db[_0x83cf('0x3c')][_0x83cf('0x151')](db[_0x83cf('0x91')],{'as':_0x83cf('0x91'),'foreignKey':_0x83cf('0x167')});db[_0x83cf('0x3c')][_0x83cf('0x151')](db[_0x83cf('0x81')],{'as':_0x83cf('0x168'),'foreignKey':_0x83cf('0x169')});db['MailAccount'][_0x83cf('0x120')](db[_0x83cf('0x10d')],{'as':_0x83cf('0x16a'),'through':_0x83cf('0x16b')});db[_0x83cf('0x130')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x83cf('0x35')});db[_0x83cf('0x130')][_0x83cf('0x120')](db[_0x83cf('0x156')],{'through':'team_has_mail_queues','as':_0x83cf('0x16c')});db[_0x83cf('0x40')][_0x83cf('0x112')](db[_0x83cf('0x41')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x83cf('0x16d')});db['MailInteraction'][_0x83cf('0x151')](db[_0x83cf('0x3c')],{'as':_0x83cf('0x16e'),'foreignKey':_0x83cf('0x162')});db[_0x83cf('0x40')][_0x83cf('0x151')](db[_0x83cf('0x122')],{'as':_0x83cf('0x15e'),'foreignKey':'ContactId'});db[_0x83cf('0x40')][_0x83cf('0x151')](db[_0x83cf('0x10d')],{'as':_0x83cf('0x16f'),'foreignKey':_0x83cf('0x111')});db['MailInteraction'][_0x83cf('0x120')](db[_0x83cf('0x8b')],{'through':_0x83cf('0x170'),'as':_0x83cf('0x171')});db['MailInteraction'][_0x83cf('0x120')](db[_0x83cf('0x8b')],{'through':_0x83cf('0x170'),'as':_0x83cf('0x172')});db['MailInteraction'][_0x83cf('0x120')](db[_0x83cf('0x10d')],{'as':_0x83cf('0x173'),'through':_0x83cf('0x126'),'foreignKey':_0x83cf('0x16d')});db[_0x83cf('0x41')][_0x83cf('0x112')](db[_0x83cf('0xeb')],{'as':_0x83cf('0x174'),'onDelete':'cascade'});db[_0x83cf('0x41')][_0x83cf('0x151')](db[_0x83cf('0x10d')],{'as':'User'});db[_0x83cf('0x41')][_0x83cf('0x151')](db[_0x83cf('0x122')],{'onDelete':_0x83cf('0x110'),'as':'Contact'});db[_0x83cf('0x41')][_0x83cf('0x151')](db[_0x83cf('0x40')],{'as':'Interaction','foreignKey':_0x83cf('0x16d')});db[_0x83cf('0x41')][_0x83cf('0x151')](db['MailAccount'],{'as':_0x83cf('0x16e'),'foreignKey':_0x83cf('0x162')});db['MailMessage'][_0x83cf('0x151')](db[_0x83cf('0x138')],{'as':_0x83cf('0x138'),'foreignKey':_0x83cf('0x175')});db[_0x83cf('0x41')][_0x83cf('0x151')](db[_0x83cf('0x65')],{'as':'ChatOfflineMessage','foreignKey':'ChatOfflineMessageId'});db[_0x83cf('0x43')][_0x83cf('0x151')](db[_0x83cf('0x10d')],{'onDelete':_0x83cf('0x161')});db['MailApplication'][_0x83cf('0x151')](db[_0x83cf('0x130')],{'onDelete':_0x83cf('0x161')});db[_0x83cf('0x43')][_0x83cf('0x151')](db[_0x83cf('0x3c')],{'onDelete':_0x83cf('0x161')});db[_0x83cf('0x43')][_0x83cf('0x151')](db['Interval'],{'onDelete':_0x83cf('0x161'),'foreignKey':_0x83cf('0x153')});db['MailApplication'][_0x83cf('0x151')](db[_0x83cf('0x8b')],{'onDelete':_0x83cf('0x161'),'foreignKey':_0x83cf('0x176')});db['MailQueueReport'][_0x83cf('0x151')](db['MailAccount'],{});db[_0x83cf('0x45')][_0x83cf('0x151')](db[_0x83cf('0xf5')],{'as':_0x83cf('0x165'),'foreignKey':_0x83cf('0x166')});db[_0x83cf('0x45')][_0x83cf('0x151')](db['CmContact'],{'as':'Contact','foreignKey':_0x83cf('0x15f')});db[_0x83cf('0x45')][_0x83cf('0x151')](db[_0x83cf('0x40')],{});db[_0x83cf('0x45')][_0x83cf('0x151')](db[_0x83cf('0x41')],{});db['MailQueueReport'][_0x83cf('0x151')](db[_0x83cf('0x10d')],{});db['MailQueueReport'][_0x83cf('0x151')](db[_0x83cf('0x130')],{});db[_0x83cf('0x47')][_0x83cf('0x112')](db['DashboardItem'],{'as':'Items','onDelete':_0x83cf('0x110')});db[_0x83cf('0x13a')][_0x83cf('0x112')](db[_0x83cf('0x7c')],{'as':_0x83cf('0x164'),'foreignKey':_0x83cf('0x177'),'onDelete':_0x83cf('0x110')});db[_0x83cf('0x13a')][_0x83cf('0x112')](db[_0x83cf('0x7a')],{'as':_0x83cf('0x178'),'foreignKey':'FaxAccountId'});db[_0x83cf('0x13a')][_0x83cf('0x112')](db[_0x83cf('0x4b')],{'as':_0x83cf('0x179')});db[_0x83cf('0x13a')][_0x83cf('0x112')](db[_0x83cf('0x49')],{'as':'Applications'});db['FaxAccount'][_0x83cf('0x112')](db[_0x83cf('0x114')],{'as':_0x83cf('0x17a'),'onDelete':_0x83cf('0x110')});db['FaxAccount'][_0x83cf('0x112')](db[_0x83cf('0x4c')],{'as':_0x83cf('0x158')});db[_0x83cf('0x13a')]['belongsTo'](db['Trunk'],{'as':'Trunk'});db[_0x83cf('0x13a')]['belongsTo'](db[_0x83cf('0xf5')],{'as':'List','foreignKey':_0x83cf('0x166')});db[_0x83cf('0x13a')]['belongsTo'](db[_0x83cf('0x81')],{'as':_0x83cf('0x168'),'foreignKey':_0x83cf('0x169')});db[_0x83cf('0x13a')][_0x83cf('0x120')](db[_0x83cf('0x10d')],{'as':_0x83cf('0x16a'),'through':'user_has_fax_accounts'});db['FaxApplication']['belongsTo'](db['User'],{'onDelete':_0x83cf('0x161')});db[_0x83cf('0x49')][_0x83cf('0x151')](db[_0x83cf('0x131')],{'onDelete':_0x83cf('0x161')});db['FaxApplication']['belongsTo'](db['FaxAccount'],{'onDelete':_0x83cf('0x161')});db[_0x83cf('0x49')]['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':_0x83cf('0x176')});db['FaxInteraction'][_0x83cf('0x112')](db['FaxMessage'],{'as':_0x83cf('0x158'),'onDelete':_0x83cf('0x110'),'foreignKey':_0x83cf('0x17b')});db[_0x83cf('0x4b')]['belongsTo'](db['FaxAccount'],{'as':_0x83cf('0x16e'),'foreignKey':_0x83cf('0x177')});db['FaxInteraction'][_0x83cf('0x151')](db[_0x83cf('0x122')],{'as':_0x83cf('0x15e'),'foreignKey':_0x83cf('0x15f')});db[_0x83cf('0x4b')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x83cf('0x111')});db[_0x83cf('0x4b')][_0x83cf('0x120')](db[_0x83cf('0x8b')],{'through':_0x83cf('0x17c'),'as':_0x83cf('0x171')});db['FaxInteraction'][_0x83cf('0x120')](db[_0x83cf('0x8b')],{'through':_0x83cf('0x17c'),'as':_0x83cf('0x172')});db[_0x83cf('0x4b')][_0x83cf('0x120')](db[_0x83cf('0x10d')],{'as':'Users','through':_0x83cf('0x128'),'foreignKey':_0x83cf('0x17b')});db[_0x83cf('0x4c')][_0x83cf('0x151')](db[_0x83cf('0x10d')],{'onDelete':_0x83cf('0x110'),'as':'User'});db[_0x83cf('0x4c')]['belongsTo'](db[_0x83cf('0x4b')],{'as':_0x83cf('0x17d'),'foreignKey':_0x83cf('0x17b')});db[_0x83cf('0x4c')]['belongsTo'](db[_0x83cf('0x122')],{'onDelete':'cascade','as':_0x83cf('0x15e')});db[_0x83cf('0x4c')]['belongsTo'](db[_0x83cf('0xeb')],{'as':_0x83cf('0xeb'),'foreignKey':_0x83cf('0x17e')});db[_0x83cf('0x4c')][_0x83cf('0x151')](db[_0x83cf('0x13a')],{'as':'Account','foreignKey':_0x83cf('0x177')});db[_0x83cf('0x131')][_0x83cf('0x120')](db[_0x83cf('0x10d')],{'as':_0x83cf('0x16a'),'through':_0x83cf('0x133')});db[_0x83cf('0x131')]['belongsToMany'](db['Team'],{'through':_0x83cf('0x17f'),'as':_0x83cf('0x16c')});db[_0x83cf('0x4f')][_0x83cf('0x151')](db[_0x83cf('0x13a')],{});db[_0x83cf('0x4f')]['belongsTo'](db[_0x83cf('0xf5')],{'as':_0x83cf('0x165'),'foreignKey':'ListId'});db['FaxQueueReport'][_0x83cf('0x151')](db[_0x83cf('0x122')],{'as':_0x83cf('0x15e'),'foreignKey':_0x83cf('0x15f')});db['FaxQueueReport'][_0x83cf('0x151')](db[_0x83cf('0x4b')],{});db[_0x83cf('0x4f')][_0x83cf('0x151')](db[_0x83cf('0x4c')],{});db[_0x83cf('0x4f')][_0x83cf('0x151')](db['User'],{});db[_0x83cf('0x4f')][_0x83cf('0x151')](db[_0x83cf('0x131')],{});db[_0x83cf('0x50')][_0x83cf('0x112')](db['Disposition'],{'as':_0x83cf('0x164'),'foreignKey':_0x83cf('0x180'),'onDelete':_0x83cf('0x110')});db[_0x83cf('0x50')][_0x83cf('0x112')](db[_0x83cf('0x7a')],{'as':'Answers','foreignKey':_0x83cf('0x180')});db[_0x83cf('0x50')][_0x83cf('0x112')](db[_0x83cf('0x56')],{'as':_0x83cf('0x158'),'foreignKey':_0x83cf('0x180')});db['SmsAccount'][_0x83cf('0x112')](db[_0x83cf('0x54')],{'as':'Interactions'});db[_0x83cf('0x50')][_0x83cf('0x112')](db[_0x83cf('0x52')],{'as':'Applications'});db[_0x83cf('0x50')][_0x83cf('0x151')](db[_0x83cf('0xf5')],{'as':_0x83cf('0x165'),'foreignKey':_0x83cf('0x166')});db[_0x83cf('0x50')][_0x83cf('0x151')](db[_0x83cf('0x81')],{'as':_0x83cf('0x168'),'foreignKey':_0x83cf('0x169')});db[_0x83cf('0x50')][_0x83cf('0x120')](db['User'],{'as':'Agents','through':_0x83cf('0x181')});db[_0x83cf('0x52')][_0x83cf('0x151')](db[_0x83cf('0x10d')],{'onDelete':_0x83cf('0x161')});db[_0x83cf('0x52')][_0x83cf('0x151')](db[_0x83cf('0x58')],{'onDelete':_0x83cf('0x161')});db[_0x83cf('0x52')]['belongsTo'](db[_0x83cf('0x50')],{'onDelete':_0x83cf('0x161')});db[_0x83cf('0x52')][_0x83cf('0x151')](db[_0x83cf('0x7f')],{'onDelete':_0x83cf('0x161'),'foreignKey':_0x83cf('0x153')});db[_0x83cf('0x52')][_0x83cf('0x151')](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db['SmsInteraction'][_0x83cf('0x112')](db[_0x83cf('0x56')],{'as':_0x83cf('0x158'),'onDelete':_0x83cf('0x110'),'foreignKey':_0x83cf('0x182')});db[_0x83cf('0x54')][_0x83cf('0x151')](db[_0x83cf('0x50')],{'as':_0x83cf('0x16e'),'foreignKey':_0x83cf('0x180')});db[_0x83cf('0x54')][_0x83cf('0x151')](db[_0x83cf('0x122')],{'as':_0x83cf('0x15e'),'foreignKey':_0x83cf('0x15f')});db[_0x83cf('0x54')][_0x83cf('0x151')](db[_0x83cf('0x10d')],{'as':_0x83cf('0x16f'),'foreignKey':_0x83cf('0x111')});db[_0x83cf('0x54')]['belongsToMany'](db[_0x83cf('0x8b')],{'through':_0x83cf('0x183'),'as':_0x83cf('0x171')});db['SmsInteraction']['belongsToMany'](db[_0x83cf('0x8b')],{'through':_0x83cf('0x183'),'as':'ThroughTags'});db[_0x83cf('0x54')][_0x83cf('0x120')](db[_0x83cf('0x10d')],{'as':_0x83cf('0x173'),'through':_0x83cf('0x12a'),'foreignKey':_0x83cf('0x182')});db[_0x83cf('0x56')]['belongsTo'](db[_0x83cf('0x10d')],{'as':_0x83cf('0x10d')});db[_0x83cf('0x56')][_0x83cf('0x151')](db[_0x83cf('0x122')],{'onDelete':'cascade','as':'Contact'});db[_0x83cf('0x56')][_0x83cf('0x151')](db[_0x83cf('0x54')],{'onDelete':_0x83cf('0x110'),'as':_0x83cf('0x17d'),'foreignKey':_0x83cf('0x182')});db[_0x83cf('0x56')][_0x83cf('0x151')](db[_0x83cf('0x50')],{'as':_0x83cf('0x16e'),'foreignKey':_0x83cf('0x180')});db[_0x83cf('0x58')][_0x83cf('0x120')](db[_0x83cf('0x10d')],{'as':_0x83cf('0x16a'),'through':_0x83cf('0x184'),'foreignKey':_0x83cf('0x185')});db[_0x83cf('0x58')][_0x83cf('0x120')](db[_0x83cf('0x156')],{'through':'team_has_sms_queues','as':_0x83cf('0x16c')});db[_0x83cf('0x5a')][_0x83cf('0x112')](db[_0x83cf('0x7c')],{'as':_0x83cf('0x164'),'foreignKey':'OpenchannelAccountId','onDelete':_0x83cf('0x110')});db['OpenchannelAccount'][_0x83cf('0x112')](db[_0x83cf('0x7a')],{'as':_0x83cf('0x178'),'foreignKey':_0x83cf('0x186')});db[_0x83cf('0x5a')]['hasMany'](db['OpenchannelInteraction'],{'as':_0x83cf('0x179'),'foreignKey':_0x83cf('0x186')});db[_0x83cf('0x5a')][_0x83cf('0x112')](db[_0x83cf('0x5d')],{'as':'Messages','foreignKey':_0x83cf('0x186')});db[_0x83cf('0x5a')][_0x83cf('0x112')](db['OpenchannelApplication'],{'as':'Applications','foreignKey':_0x83cf('0x186')});db['OpenchannelAccount'][_0x83cf('0x151')](db['CmList'],{'as':_0x83cf('0x165'),'foreignKey':_0x83cf('0x166')});db[_0x83cf('0x5a')][_0x83cf('0x151')](db[_0x83cf('0x81')],{'as':'mandatoryDispositionPause','foreignKey':_0x83cf('0x169')});db[_0x83cf('0x5a')][_0x83cf('0x120')](db[_0x83cf('0x10d')],{'as':_0x83cf('0x16a'),'through':_0x83cf('0x13e')});db['OpenchannelApplication'][_0x83cf('0x151')](db['User'],{'onDelete':_0x83cf('0x161')});db[_0x83cf('0x187')][_0x83cf('0x151')](db['OpenchannelQueue'],{'onDelete':_0x83cf('0x161'),'foreignKey':_0x83cf('0x188')});db['OpenchannelApplication'][_0x83cf('0x151')](db[_0x83cf('0x5a')],{'onDelete':_0x83cf('0x161'),'foreignKey':_0x83cf('0x186')});db[_0x83cf('0x187')][_0x83cf('0x151')](db[_0x83cf('0x7f')],{'onDelete':_0x83cf('0x161'),'foreignKey':'IntervalId'});db[_0x83cf('0x187')][_0x83cf('0x151')](db[_0x83cf('0x8b')],{'onDelete':_0x83cf('0x161'),'foreignKey':_0x83cf('0x176')});db['OpenchannelInteraction']['hasMany'](db[_0x83cf('0x5d')],{'as':_0x83cf('0x158'),'onDelete':_0x83cf('0x110'),'foreignKey':_0x83cf('0x189')});db[_0x83cf('0x5c')][_0x83cf('0x151')](db['OpenchannelAccount'],{'as':_0x83cf('0x16e'),'foreignKey':_0x83cf('0x186')});db[_0x83cf('0x5c')]['belongsTo'](db[_0x83cf('0x122')],{'as':_0x83cf('0x15e'),'foreignKey':_0x83cf('0x15f')});db[_0x83cf('0x5c')][_0x83cf('0x151')](db[_0x83cf('0x10d')],{'as':_0x83cf('0x16f'),'foreignKey':_0x83cf('0x111')});db[_0x83cf('0x5c')][_0x83cf('0x120')](db[_0x83cf('0x8b')],{'through':_0x83cf('0x18a'),'as':'Tags'});db[_0x83cf('0x5c')][_0x83cf('0x120')](db[_0x83cf('0x8b')],{'through':'openchannel_interaction_has_tags','as':_0x83cf('0x172')});db[_0x83cf('0x5c')][_0x83cf('0x120')](db[_0x83cf('0x10d')],{'as':_0x83cf('0x173'),'through':_0x83cf('0x12b'),'foreignKey':_0x83cf('0x189')});db['OpenchannelMessage']['belongsTo'](db[_0x83cf('0x10d')],{'onDelete':_0x83cf('0x110'),'as':_0x83cf('0x10d')});db[_0x83cf('0x5d')]['belongsTo'](db[_0x83cf('0x122')],{'onDelete':_0x83cf('0x110'),'as':'Contact'});db[_0x83cf('0x5d')][_0x83cf('0x151')](db['OpenchannelInteraction'],{'onDelete':_0x83cf('0x110'),'as':_0x83cf('0x17d'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage']['belongsTo'](db[_0x83cf('0xeb')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x83cf('0x5d')]['belongsTo'](db[_0x83cf('0x5a')],{'as':_0x83cf('0x16e'),'foreignKey':_0x83cf('0x186')});db[_0x83cf('0x5f')][_0x83cf('0x120')](db[_0x83cf('0x10d')],{'as':_0x83cf('0x16a'),'through':'UserOpenchannelQueue','foreignKey':_0x83cf('0x188')});db[_0x83cf('0x5f')][_0x83cf('0x120')](db[_0x83cf('0x156')],{'through':_0x83cf('0x18b'),'as':_0x83cf('0x16c')});db[_0x83cf('0x138')][_0x83cf('0x112')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x83cf('0x175'),'onDelete':'cascade'});db['ChatWebsite'][_0x83cf('0x112')](db[_0x83cf('0x7a')],{'as':_0x83cf('0x178'),'foreignKey':'ChatWebsiteId'});db['ChatWebsite'][_0x83cf('0x112')](db['ChatProactiveAction'],{'as':'ProactiveActions'});db[_0x83cf('0x138')][_0x83cf('0x112')](db[_0x83cf('0x118')],{'as':_0x83cf('0x179')});db[_0x83cf('0x138')][_0x83cf('0x112')](db[_0x83cf('0x62')],{'as':_0x83cf('0x148')});db[_0x83cf('0x138')][_0x83cf('0x112')](db['ChatMessage'],{'as':_0x83cf('0x158')});db[_0x83cf('0x138')]['belongsTo'](db[_0x83cf('0xf5')],{'as':'List','foreignKey':'ListId'});db['ChatWebsite'][_0x83cf('0x151')](db[_0x83cf('0x7f')],{'as':_0x83cf('0x7f'),'foreignKey':_0x83cf('0x153')});db[_0x83cf('0x138')][_0x83cf('0x151')](db[_0x83cf('0x3c')],{'as':_0x83cf('0x3c'),'foreignKey':_0x83cf('0x162')});db[_0x83cf('0x138')]['belongsTo'](db['Pause'],{'as':_0x83cf('0x168'),'foreignKey':_0x83cf('0x169')});db[_0x83cf('0x138')][_0x83cf('0x120')](db['User'],{'as':_0x83cf('0x16a'),'through':_0x83cf('0x139')});db[_0x83cf('0x18c')][_0x83cf('0x151')](db[_0x83cf('0x5a')],{});db[_0x83cf('0x18c')][_0x83cf('0x151')](db[_0x83cf('0xf5')],{'as':_0x83cf('0x165'),'foreignKey':'ListId'});db['OpenchannelQueueReport'][_0x83cf('0x151')](db[_0x83cf('0x122')],{'as':_0x83cf('0x15e'),'foreignKey':_0x83cf('0x15f')});db[_0x83cf('0x18c')]['belongsTo'](db[_0x83cf('0x5c')],{});db[_0x83cf('0x18c')]['belongsTo'](db[_0x83cf('0x5d')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x83cf('0x10d')],{});db[_0x83cf('0x18c')]['belongsTo'](db[_0x83cf('0x5f')],{});db[_0x83cf('0x62')][_0x83cf('0x151')](db[_0x83cf('0x10d')],{'as':_0x83cf('0x18d'),'foreignKey':_0x83cf('0x111'),'onDelete':_0x83cf('0x161')});db['ChatApplication'][_0x83cf('0x151')](db[_0x83cf('0x67')],{'as':_0x83cf('0x18e'),'foreignKey':_0x83cf('0x18f'),'onDelete':_0x83cf('0x161')});db[_0x83cf('0x62')]['belongsTo'](db[_0x83cf('0x138')],{'as':_0x83cf('0x190'),'foreignKey':_0x83cf('0x175'),'onDelete':'restrict'});db[_0x83cf('0x62')][_0x83cf('0x151')](db['Tag'],{'onDelete':_0x83cf('0x161'),'foreignKey':_0x83cf('0x176')});db[_0x83cf('0x118')][_0x83cf('0x112')](db[_0x83cf('0x64')],{'as':'Messages','onDelete':_0x83cf('0x110'),'foreignKey':_0x83cf('0x191')});db[_0x83cf('0x118')]['belongsTo'](db['ChatWebsite'],{'as':_0x83cf('0x16e'),'foreignKey':_0x83cf('0x175')});db[_0x83cf('0x118')][_0x83cf('0x151')](db[_0x83cf('0x122')],{'as':_0x83cf('0x15e'),'foreignKey':'ContactId'});db[_0x83cf('0x118')][_0x83cf('0x151')](db[_0x83cf('0x10d')],{'as':_0x83cf('0x16f'),'foreignKey':_0x83cf('0x111')});db['ChatInteraction']['belongsToMany'](db[_0x83cf('0x8b')],{'through':_0x83cf('0x192'),'as':_0x83cf('0x171')});db['ChatInteraction'][_0x83cf('0x120')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0x83cf('0x172')});db['ChatInteraction'][_0x83cf('0x120')](db['User'],{'as':'Users','through':_0x83cf('0x127'),'foreignKey':_0x83cf('0x191')});db['ChatMessage'][_0x83cf('0x151')](db[_0x83cf('0x10d')],{'onDelete':'cascade','as':'User'});db[_0x83cf('0x64')][_0x83cf('0x151')](db[_0x83cf('0x122')],{'onDelete':_0x83cf('0x110'),'as':_0x83cf('0x15e'),'foreignKey':_0x83cf('0x15f')});db[_0x83cf('0x64')][_0x83cf('0x151')](db['ChatInteraction'],{'onDelete':'cascade','as':_0x83cf('0x17d'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0x83cf('0x151')](db[_0x83cf('0xeb')],{'as':'Attachment','foreignKey':_0x83cf('0x17e')});db['ChatMessage'][_0x83cf('0x151')](db[_0x83cf('0x138')],{'as':_0x83cf('0x16e'),'foreignKey':_0x83cf('0x175')});db['ChatOfflineMessage'][_0x83cf('0x112')](db[_0x83cf('0xeb')],{'as':_0x83cf('0x174'),'foreignKey':_0x83cf('0x193'),'onDelete':_0x83cf('0x110'),'hooks':!![]});db[_0x83cf('0x65')][_0x83cf('0x151')](db[_0x83cf('0x122')],{'onDelete':_0x83cf('0x110'),'as':_0x83cf('0x15e'),'foreignKey':_0x83cf('0x15f')});db[_0x83cf('0x65')][_0x83cf('0x151')](db['ChatWebsite'],{'as':'Account','foreignKey':_0x83cf('0x175')});db[_0x83cf('0x67')]['belongsToMany'](db[_0x83cf('0x10d')],{'as':'Agents','through':'UserChatQueue','hooks':!![]});db['ChatQueue'][_0x83cf('0x120')](db[_0x83cf('0x156')],{'through':'team_has_chat_queues','as':'Teams'});db[_0x83cf('0x121')][_0x83cf('0x112')](db['ChatInternalMessage'],{'as':_0x83cf('0x158'),'foreignKey':_0x83cf('0x194'),'onDelete':_0x83cf('0x110')});db[_0x83cf('0x121')]['belongsToMany'](db[_0x83cf('0x10d')],{'as':_0x83cf('0x14b'),'through':_0x83cf('0x195')});db['ChatProactiveAction'][_0x83cf('0x151')](db[_0x83cf('0x138')],{'as':_0x83cf('0x190'),'foreignKey':_0x83cf('0x175')});db[_0x83cf('0x6a')][_0x83cf('0x112')](db[_0x83cf('0x122')],{'as':'Contacts','foreignKey':_0x83cf('0x196')});db[_0x83cf('0x122')][_0x83cf('0x112')](db['CmContactHasItem'],{'as':_0x83cf('0x197'),'foreignKey':_0x83cf('0x198')});db[_0x83cf('0x122')][_0x83cf('0x112')](db[_0x83cf('0x14d')],{'as':_0x83cf('0x14e'),'foreignKey':'ContactId'});db[_0x83cf('0x122')][_0x83cf('0x112')](db[_0x83cf('0x70')],{'as':_0x83cf('0x115'),'foreignKey':_0x83cf('0x15f')});db[_0x83cf('0x122')][_0x83cf('0x112')](db[_0x83cf('0x72')],{'as':_0x83cf('0x14f'),'foreignKey':_0x83cf('0x15f')});db[_0x83cf('0x122')][_0x83cf('0x112')](db[_0x83cf('0x116')],{'as':_0x83cf('0x116'),'foreignKey':'ContactId'});db['CmContact'][_0x83cf('0x112')](db[_0x83cf('0xd7')],{'as':_0x83cf('0x150'),'foreignKey':'ContactId'});db[_0x83cf('0x122')][_0x83cf('0x112')](db[_0x83cf('0x5c')],{'as':_0x83cf('0x117'),'foreignKey':_0x83cf('0x15f'),'onDelete':'restrict'});db[_0x83cf('0x122')]['hasMany'](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0x83cf('0x15f'),'onDelete':_0x83cf('0x161')});db['CmContact'][_0x83cf('0x112')](db[_0x83cf('0x54')],{'as':_0x83cf('0x129'),'foreignKey':_0x83cf('0x15f'),'onDelete':'restrict'});db[_0x83cf('0x122')][_0x83cf('0x112')](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':_0x83cf('0x15f'),'onDelete':'restrict'});db[_0x83cf('0x122')][_0x83cf('0x112')](db['MailInteraction'],{'as':_0x83cf('0x11b'),'foreignKey':_0x83cf('0x15f'),'onDelete':_0x83cf('0x161')});db['CmContact'][_0x83cf('0x151')](db['CmCompany'],{'as':_0x83cf('0x199'),'foreignKey':_0x83cf('0x196')});db[_0x83cf('0x122')]['belongsTo'](db[_0x83cf('0xf5')],{'as':_0x83cf('0x165'),'foreignKey':_0x83cf('0x166'),'onDelete':_0x83cf('0x110')});db[_0x83cf('0x122')][_0x83cf('0x120')](db[_0x83cf('0x10d')],{'as':_0x83cf('0x173'),'through':_0x83cf('0x124')});db['CmContact'][_0x83cf('0x120')](db['Tag'],{'as':_0x83cf('0x171'),'through':_0x83cf('0x19a')});db[_0x83cf('0x122')][_0x83cf('0x120')](db[_0x83cf('0x8b')],{'through':'cm_contact_has_tags','as':'ThroughTags'});db[_0x83cf('0x14d')][_0x83cf('0x112')](db[_0x83cf('0x90')],{'as':_0x83cf('0x19b'),'foreignKey':_0x83cf('0x19c')});db[_0x83cf('0x14d')][_0x83cf('0x151')](db['CmContact'],{'as':_0x83cf('0x15e'),'foreignKey':_0x83cf('0x15f'),'onDelete':_0x83cf('0x110')});db[_0x83cf('0x14d')][_0x83cf('0x151')](db[_0x83cf('0xf5')],{'as':_0x83cf('0x165'),'foreignKey':_0x83cf('0x166'),'onDelete':_0x83cf('0x110')});db[_0x83cf('0x14d')][_0x83cf('0x151')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x83cf('0x14d')][_0x83cf('0x151')](db[_0x83cf('0x1a')],{'as':_0x83cf('0x18e'),'foreignKey':_0x83cf('0x14c'),'onDelete':'cascade'});db[_0x83cf('0x14d')]['belongsTo'](db[_0x83cf('0xe7')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':'cascade'});db[_0x83cf('0x14d')][_0x83cf('0x151')](db[_0x83cf('0x10d')],{'as':_0x83cf('0x16f'),'foreignKey':_0x83cf('0x19d')});db[_0x83cf('0x6e')]['belongsTo'](db[_0x83cf('0x122')],{'as':_0x83cf('0x15e'),'foreignKey':_0x83cf('0x15f'),'onDelete':_0x83cf('0x110')});db[_0x83cf('0x6e')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':'ListId','onDelete':_0x83cf('0x110')});db[_0x83cf('0x6e')]['belongsTo'](db[_0x83cf('0x1a')],{'as':_0x83cf('0x18e'),'foreignKey':_0x83cf('0x14c'),'onDelete':_0x83cf('0x110')});db[_0x83cf('0x6e')][_0x83cf('0x151')](db[_0x83cf('0xe7')],{'as':_0x83cf('0xe7'),'foreignKey':_0x83cf('0x19e'),'onDelete':'cascade'});db['Automation']['hasMany'](db[_0x83cf('0x19f')],{'as':{'plural':_0x83cf('0x1a0'),'singular':'OneAll'},'foreignKey':'AutomationAllId','onDelete':_0x83cf('0x110'),'hooks':!![]});db[_0x83cf('0x79')][_0x83cf('0x112')](db['Condition'],{'as':{'plural':'Any','singular':'OneAny'},'foreignKey':_0x83cf('0x1a1'),'onDelete':'cascade','hooks':!![]});db[_0x83cf('0x79')][_0x83cf('0x112')](db[_0x83cf('0x77')],{'as':_0x83cf('0x1a2'),'foreignKey':_0x83cf('0x1a3'),'onDelete':'cascade','hooks':!![]});db[_0x83cf('0x7c')][_0x83cf('0x112')](db['Disposition'],{'as':_0x83cf('0x164'),'foreignKey':_0x83cf('0x1a4'),'onDelete':_0x83cf('0x110')});db['Interval']['hasMany'](db[_0x83cf('0x7f')],{'as':_0x83cf('0x1a5'),'foreignKey':_0x83cf('0x153'),'onDelete':_0x83cf('0x110'),'hooks':!![],'required':![]});db[_0x83cf('0x7f')][_0x83cf('0x112')](db[_0x83cf('0x114')],{'as':_0x83cf('0x1a6'),'foreignKey':_0x83cf('0x153'),'onDelete':_0x83cf('0x161')});db[_0x83cf('0x7f')]['hasMany'](db['MailApplication'],{'as':_0x83cf('0x1a7'),'foreignKey':_0x83cf('0x153')});db[_0x83cf('0x7f')][_0x83cf('0x112')](db[_0x83cf('0x62')],{'as':_0x83cf('0x1a8'),'foreignKey':'IntervalId'});db[_0x83cf('0x7f')]['hasMany'](db[_0x83cf('0x49')],{'as':_0x83cf('0x1a9'),'foreignKey':_0x83cf('0x153')});db['Interval'][_0x83cf('0x112')](db[_0x83cf('0x52')],{'as':'SmsApplications','foreignKey':_0x83cf('0x153')});db[_0x83cf('0x87')]['belongsTo'](db[_0x83cf('0x3c')],{});db['Schedule'][_0x83cf('0x151')](db[_0x83cf('0x9a')],{'foreignKey':_0x83cf('0x1aa')});db[_0x83cf('0x87')][_0x83cf('0x151')](db[_0x83cf('0x98')],{'foreignKey':_0x83cf('0x1ab')});db[_0x83cf('0x89')][_0x83cf('0x120')](db[_0x83cf('0x18')],{'as':'Mohs','through':_0x83cf('0x14a'),'onDelete':_0x83cf('0x161')});db['Tag'][_0x83cf('0x120')](db['CmContact'],{'through':'cm_contact_has_tags'});db['Tag'][_0x83cf('0x120')](db[_0x83cf('0x118')],{'through':_0x83cf('0x192')});db[_0x83cf('0x8b')]['belongsToMany'](db['MailInteraction'],{'through':'mail_interaction_has_tags'});db[_0x83cf('0x8b')][_0x83cf('0x120')](db[_0x83cf('0x54')],{'through':_0x83cf('0x183')});db[_0x83cf('0x8b')][_0x83cf('0x120')](db[_0x83cf('0x4b')],{'through':_0x83cf('0x17c')});db[_0x83cf('0x8b')][_0x83cf('0x120')](db[_0x83cf('0x5c')],{'through':_0x83cf('0x18a')});db['Tag']['belongsToMany'](db[_0x83cf('0x11c')],{'through':_0x83cf('0x1ac')});db[_0x83cf('0x8e')][_0x83cf('0x151')](db[_0x83cf('0x1ad')],{'as':_0x83cf('0x1ae'),'foreignKey':_0x83cf('0x1af')});db[_0x83cf('0x90')][_0x83cf('0x151')](db['CmHopper'],{'as':_0x83cf('0x1b0'),'foreignKey':_0x83cf('0x19c')});db[_0x83cf('0x8e')][_0x83cf('0x151')](db[_0x83cf('0x122')],{'as':'Contact','foreignKey':_0x83cf('0x198')});db[_0x83cf('0x1b1')][_0x83cf('0x112')](db['Condition'],{'as':{'plural':_0x83cf('0x1b2'),'singular':_0x83cf('0x1b3')},'foreignKey':_0x83cf('0x1b4'),'onDelete':_0x83cf('0x110'),'hooks':!![]});db['Trigger']['hasMany'](db[_0x83cf('0x19f')],{'as':{'plural':'AnyConditions','singular':_0x83cf('0x1b5')},'foreignKey':_0x83cf('0x1b6'),'onDelete':_0x83cf('0x110'),'hooks':!![]});db[_0x83cf('0x1b1')][_0x83cf('0x112')](db['Action'],{'as':_0x83cf('0x1a2'),'foreignKey':_0x83cf('0x1b7'),'onDelete':_0x83cf('0x110'),'hooks':!![]});db[_0x83cf('0x98')][_0x83cf('0x112')](db[_0x83cf('0x9e')],{'as':_0x83cf('0x1b8'),'onDelete':_0x83cf('0x110'),'foreignKey':_0x83cf('0x1ab'),'hooks':!![]});db[_0x83cf('0x9a')][_0x83cf('0x112')](db[_0x83cf('0x9e')],{'as':'Fields','onDelete':_0x83cf('0x110'),'foreignKey':_0x83cf('0x1aa')});db[_0x83cf('0x1b9')]['hasMany'](db[_0x83cf('0x9e')],{'as':_0x83cf('0x1b8'),'onDelete':_0x83cf('0x110'),'foreignKey':'MetricId'});db['AnalyticFieldReport'][_0x83cf('0x151')](db[_0x83cf('0x1b9')],{'foreignKey':_0x83cf('0x1ba')});db[_0x83cf('0xa2')][_0x83cf('0x112')](db['SalesforceConfiguration'],{'as':_0x83cf('0x1bb'),'onDelete':_0x83cf('0x110'),'foreignKey':_0x83cf('0x1bc')});db['SalesforceConfiguration'][_0x83cf('0x112')](db[_0x83cf('0xa5')],{'as':_0x83cf('0x1bd'),'onDelete':_0x83cf('0x110'),'foreignKey':'SubjectId'});db['SalesforceConfiguration'][_0x83cf('0x112')](db[_0x83cf('0xa5')],{'as':_0x83cf('0x1be'),'onDelete':_0x83cf('0x110'),'foreignKey':_0x83cf('0x1bf')});db[_0x83cf('0xa4')][_0x83cf('0x112')](db[_0x83cf('0xa5')],{'as':'Fields','onDelete':_0x83cf('0x110'),'foreignKey':_0x83cf('0x1c0')});db[_0x83cf('0xa4')][_0x83cf('0x151')](db[_0x83cf('0xa2')],{'as':'Account','foreignKey':'AccountId'});db['SalesforceField'][_0x83cf('0x112')](db[_0x83cf('0xa5')],{'as':_0x83cf('0x1c1'),'foreignKey':_0x83cf('0x1c2')});db[_0x83cf('0xa5')]['hasMany'](db[_0x83cf('0xa5')],{'as':'Description','foreignKey':_0x83cf('0x1bf')});db['SalesforceField']['hasMany'](db[_0x83cf('0xa5')],{'as':_0x83cf('0x1c3'),'foreignKey':_0x83cf('0x1c0')});db[_0x83cf('0xa5')][_0x83cf('0x151')](db[_0x83cf('0x93')],{'as':_0x83cf('0x93'),'foreignKey':_0x83cf('0x1c4')});db['SugarcrmAccount'][_0x83cf('0x112')](db['SugarcrmConfiguration'],{'as':'Configurations','onDelete':_0x83cf('0x110'),'foreignKey':_0x83cf('0x1bc')});db['SugarcrmConfiguration']['hasMany'](db[_0x83cf('0x1c5')],{'as':_0x83cf('0x1bd'),'onDelete':_0x83cf('0x110'),'foreignKey':_0x83cf('0x1c2')});db[_0x83cf('0xa7')]['hasMany'](db[_0x83cf('0x1c5')],{'as':_0x83cf('0x1be'),'onDelete':_0x83cf('0x110'),'foreignKey':_0x83cf('0x1bf')});db[_0x83cf('0xa7')][_0x83cf('0x112')](db[_0x83cf('0x1c5')],{'as':_0x83cf('0x1b8'),'onDelete':_0x83cf('0x110'),'foreignKey':'FieldId'});db[_0x83cf('0xa7')][_0x83cf('0x151')](db[_0x83cf('0x1c6')],{'as':_0x83cf('0x16e'),'foreignKey':_0x83cf('0x1bc')});db['SugarcrmField'][_0x83cf('0x112')](db[_0x83cf('0x1c5')],{'as':_0x83cf('0x1c1'),'foreignKey':_0x83cf('0x1c2')});db[_0x83cf('0x1c5')][_0x83cf('0x112')](db[_0x83cf('0x1c5')],{'as':_0x83cf('0x1c7'),'foreignKey':_0x83cf('0x1bf')});db[_0x83cf('0x1c5')][_0x83cf('0x112')](db[_0x83cf('0x1c5')],{'as':_0x83cf('0x1c3'),'foreignKey':_0x83cf('0x1c0')});db[_0x83cf('0x1c5')][_0x83cf('0x151')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db['DeskAccount'][_0x83cf('0x112')](db['DeskConfiguration'],{'as':_0x83cf('0x1bb'),'onDelete':_0x83cf('0x110'),'foreignKey':_0x83cf('0x1bc')});db[_0x83cf('0xac')][_0x83cf('0x112')](db[_0x83cf('0xad')],{'as':_0x83cf('0x1bd'),'onDelete':_0x83cf('0x110'),'foreignKey':'SubjectId'});db['DeskConfiguration'][_0x83cf('0x112')](db[_0x83cf('0xad')],{'as':_0x83cf('0x1be'),'onDelete':'cascade','foreignKey':_0x83cf('0x1bf')});db['DeskConfiguration'][_0x83cf('0x112')](db[_0x83cf('0xad')],{'as':_0x83cf('0x1b8'),'onDelete':_0x83cf('0x110'),'foreignKey':_0x83cf('0x1c0')});db[_0x83cf('0xac')][_0x83cf('0x151')](db['DeskAccount'],{'as':_0x83cf('0x16e'),'foreignKey':_0x83cf('0x1bc')});db['DeskConfiguration'][_0x83cf('0x120')](db[_0x83cf('0x8b')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x83cf('0x112')](db[_0x83cf('0xad')],{'as':_0x83cf('0x1c1'),'foreignKey':_0x83cf('0x1c2')});db[_0x83cf('0xad')][_0x83cf('0x112')](db[_0x83cf('0xad')],{'as':_0x83cf('0x1c7'),'foreignKey':'DescriptionId'});db[_0x83cf('0xad')][_0x83cf('0x112')](db[_0x83cf('0xad')],{'as':_0x83cf('0x1c3'),'foreignKey':_0x83cf('0x1c0')});db[_0x83cf('0xad')][_0x83cf('0x151')](db[_0x83cf('0x93')],{'as':_0x83cf('0x93'),'foreignKey':_0x83cf('0x1c4')});db[_0x83cf('0xaf')]['hasMany'](db[_0x83cf('0xb1')],{'as':'Configurations','onDelete':_0x83cf('0x110'),'foreignKey':'AccountId'});db[_0x83cf('0xb1')][_0x83cf('0x112')](db[_0x83cf('0xb2')],{'as':_0x83cf('0x1bd'),'onDelete':_0x83cf('0x110'),'foreignKey':_0x83cf('0x1c2')});db[_0x83cf('0xb1')][_0x83cf('0x112')](db[_0x83cf('0xb2')],{'as':_0x83cf('0x1be'),'onDelete':_0x83cf('0x110'),'foreignKey':'DescriptionId'});db['ZohoConfiguration'][_0x83cf('0x112')](db[_0x83cf('0xb2')],{'as':_0x83cf('0x1b8'),'onDelete':_0x83cf('0x110'),'foreignKey':_0x83cf('0x1c0')});db['ZohoConfiguration'][_0x83cf('0x151')](db[_0x83cf('0xaf')],{'as':'Account','foreignKey':_0x83cf('0x1bc')});db[_0x83cf('0xb2')][_0x83cf('0x112')](db[_0x83cf('0xb2')],{'as':_0x83cf('0x1c1'),'foreignKey':_0x83cf('0x1c2')});db[_0x83cf('0xb2')][_0x83cf('0x112')](db['ZohoField'],{'as':'Description','foreignKey':_0x83cf('0x1bf')});db[_0x83cf('0xb2')]['hasMany'](db[_0x83cf('0xb2')],{'as':_0x83cf('0x1c3'),'foreignKey':_0x83cf('0x1c0')});db[_0x83cf('0xb2')][_0x83cf('0x151')](db[_0x83cf('0x93')],{'as':'Variable','foreignKey':'VariableId'});db[_0x83cf('0xb4')][_0x83cf('0x112')](db[_0x83cf('0xb5')],{'as':_0x83cf('0x1bb'),'onDelete':_0x83cf('0x110'),'foreignKey':_0x83cf('0x1bc')});db[_0x83cf('0xb5')]['hasMany'](db[_0x83cf('0xb7')],{'as':'Subjects','foreignKey':_0x83cf('0x1c2')});db[_0x83cf('0xb5')][_0x83cf('0x112')](db[_0x83cf('0xb7')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x83cf('0xb5')][_0x83cf('0x112')](db[_0x83cf('0xb7')],{'as':_0x83cf('0x1b8'),'foreignKey':_0x83cf('0x1c0')});db['ZendeskConfiguration'][_0x83cf('0x151')](db['ZendeskAccount'],{'as':_0x83cf('0x16e'),'foreignKey':_0x83cf('0x1bc')});db[_0x83cf('0xb5')]['belongsToMany'](db[_0x83cf('0x8b')],{'through':_0x83cf('0x1c8')});db['ZendeskField'][_0x83cf('0x112')](db[_0x83cf('0xb7')],{'as':_0x83cf('0x1c1'),'foreignKey':'SubjectId'});db[_0x83cf('0xb7')]['hasMany'](db[_0x83cf('0xb7')],{'as':'Description','foreignKey':_0x83cf('0x1bf')});db['ZendeskField']['hasMany'](db[_0x83cf('0xb7')],{'as':'Field','foreignKey':_0x83cf('0x1c0')});db[_0x83cf('0xb7')]['belongsTo'](db['Variable'],{'as':_0x83cf('0x93'),'foreignKey':_0x83cf('0x1c4')});db[_0x83cf('0xb9')][_0x83cf('0x112')](db[_0x83cf('0xbb')],{'as':_0x83cf('0x1bb'),'onDelete':_0x83cf('0x110'),'foreignKey':'AccountId'});db[_0x83cf('0xbb')]['hasMany'](db[_0x83cf('0xbd')],{'as':_0x83cf('0x1bd'),'onDelete':'cascade','foreignKey':_0x83cf('0x1c2')});db[_0x83cf('0xbb')][_0x83cf('0x112')](db['FreshdeskField'],{'as':_0x83cf('0x1be'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['FreshdeskConfiguration'][_0x83cf('0x112')](db['FreshdeskField'],{'as':_0x83cf('0x1b8'),'onDelete':_0x83cf('0x110'),'foreignKey':'FieldId'});db[_0x83cf('0xbb')][_0x83cf('0x151')](db[_0x83cf('0xb9')],{'as':_0x83cf('0x16e'),'foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0x83cf('0x120')](db[_0x83cf('0x8b')],{'through':_0x83cf('0x1c9')});db[_0x83cf('0xbd')]['hasMany'](db[_0x83cf('0xbd')],{'as':_0x83cf('0x1c1'),'foreignKey':_0x83cf('0x1c2')});db['FreshdeskField'][_0x83cf('0x112')](db['FreshdeskField'],{'as':_0x83cf('0x1c7'),'foreignKey':_0x83cf('0x1bf')});db[_0x83cf('0xbd')]['hasMany'](db[_0x83cf('0xbd')],{'as':_0x83cf('0x1c3'),'foreignKey':_0x83cf('0x1c0')});db[_0x83cf('0xbd')]['belongsTo'](db[_0x83cf('0x93')],{'as':_0x83cf('0x93'),'foreignKey':_0x83cf('0x1c4')});db['VtigerAccount'][_0x83cf('0x112')](db[_0x83cf('0xc0')],{'as':_0x83cf('0x1bb'),'onDelete':_0x83cf('0x110'),'foreignKey':_0x83cf('0x1bc')});db[_0x83cf('0xc0')][_0x83cf('0x112')](db[_0x83cf('0xc2')],{'as':_0x83cf('0x1bd'),'foreignKey':'SubjectId'});db[_0x83cf('0xc0')][_0x83cf('0x112')](db[_0x83cf('0xc2')],{'as':'Descriptions','foreignKey':_0x83cf('0x1bf')});db['VtigerConfiguration']['hasMany'](db[_0x83cf('0xc2')],{'as':_0x83cf('0x1b8'),'foreignKey':_0x83cf('0x1c0')});db[_0x83cf('0xc0')][_0x83cf('0x151')](db[_0x83cf('0xbe')],{'as':'Account','foreignKey':'AccountId'});db[_0x83cf('0xc2')][_0x83cf('0x112')](db[_0x83cf('0xc2')],{'as':_0x83cf('0x1c1'),'foreignKey':'SubjectId'});db['VtigerField'][_0x83cf('0x112')](db[_0x83cf('0xc2')],{'as':_0x83cf('0x1c7'),'foreignKey':_0x83cf('0x1bf')});db[_0x83cf('0xc2')][_0x83cf('0x112')](db[_0x83cf('0xc2')],{'as':_0x83cf('0x1c3'),'foreignKey':_0x83cf('0x1c0')});db['VtigerField'][_0x83cf('0x151')](db[_0x83cf('0x93')],{'as':_0x83cf('0x93'),'foreignKey':_0x83cf('0x1c4')});db[_0x83cf('0xc4')]['hasMany'](db[_0x83cf('0xc5')],{'as':'Configurations','onDelete':_0x83cf('0x110'),'foreignKey':_0x83cf('0x1bc')});db[_0x83cf('0xc5')][_0x83cf('0x112')](db['ServicenowField'],{'as':_0x83cf('0x1bd'),'foreignKey':_0x83cf('0x1c2')});db['ServicenowConfiguration'][_0x83cf('0x112')](db[_0x83cf('0xc7')],{'as':_0x83cf('0x1be'),'foreignKey':_0x83cf('0x1bf')});db[_0x83cf('0xc5')][_0x83cf('0x112')](db['ServicenowField'],{'as':'Fields','foreignKey':_0x83cf('0x1c0')});db[_0x83cf('0xc5')][_0x83cf('0x151')](db[_0x83cf('0xc4')],{'as':'Account','foreignKey':'AccountId'});db['ServicenowField'][_0x83cf('0x112')](db[_0x83cf('0xc7')],{'as':_0x83cf('0x1c1'),'foreignKey':'SubjectId'});db['ServicenowField']['hasMany'](db[_0x83cf('0xc7')],{'as':'Description','foreignKey':_0x83cf('0x1bf')});db['ServicenowField'][_0x83cf('0x112')](db[_0x83cf('0xc7')],{'as':_0x83cf('0x1c3'),'foreignKey':_0x83cf('0x1c0')});db[_0x83cf('0xc7')]['belongsTo'](db[_0x83cf('0x93')],{'as':_0x83cf('0x93'),'foreignKey':_0x83cf('0x1c4')});db['Dynamics365Account'][_0x83cf('0x112')](db[_0x83cf('0xca')],{'as':'Configurations','onDelete':_0x83cf('0x110'),'foreignKey':'AccountId'});db[_0x83cf('0xc8')][_0x83cf('0x151')](db['CloudProvider'],{'as':_0x83cf('0x108'),'foreignKey':'CloudProviderId'});db[_0x83cf('0xca')]['hasMany'](db[_0x83cf('0xcb')],{'as':_0x83cf('0x1bd'),'onDelete':'cascade','foreignKey':_0x83cf('0x1c2')});db[_0x83cf('0xca')][_0x83cf('0x112')](db[_0x83cf('0xcb')],{'as':_0x83cf('0x1be'),'onDelete':_0x83cf('0x110'),'foreignKey':'DescriptionId'});db[_0x83cf('0xca')][_0x83cf('0x112')](db[_0x83cf('0xcb')],{'as':'Fields','onDelete':_0x83cf('0x110'),'foreignKey':_0x83cf('0x1c0')});db['Dynamics365Configuration']['belongsTo'](db[_0x83cf('0xc8')],{'as':_0x83cf('0x16e'),'foreignKey':_0x83cf('0x1bc')});db[_0x83cf('0xcb')][_0x83cf('0x112')](db['Dynamics365Field'],{'as':_0x83cf('0x1c1'),'foreignKey':'SubjectId'});db[_0x83cf('0xcb')]['hasMany'](db['Dynamics365Field'],{'as':_0x83cf('0x1c7'),'foreignKey':'DescriptionId'});db['Dynamics365Field'][_0x83cf('0x112')](db[_0x83cf('0xcb')],{'as':_0x83cf('0x1c3'),'foreignKey':_0x83cf('0x1c0')});db[_0x83cf('0xcb')][_0x83cf('0x151')](db[_0x83cf('0x93')],{'as':_0x83cf('0x93'),'foreignKey':_0x83cf('0x1c4')});db['FreshsalesAccount'][_0x83cf('0x112')](db['FreshsalesConfiguration'],{'as':_0x83cf('0x1bb'),'onDelete':_0x83cf('0x110'),'foreignKey':_0x83cf('0x1bc')});db[_0x83cf('0x1ca')][_0x83cf('0x112')](db['FreshsalesField'],{'as':_0x83cf('0x1bd'),'foreignKey':_0x83cf('0x1c2')});db[_0x83cf('0x1ca')][_0x83cf('0x112')](db['FreshsalesField'],{'as':_0x83cf('0x1be'),'foreignKey':'DescriptionId'});db['FreshsalesConfiguration'][_0x83cf('0x112')](db[_0x83cf('0xce')],{'as':_0x83cf('0x1b8'),'foreignKey':'FieldId'});db[_0x83cf('0x1ca')][_0x83cf('0x151')](db[_0x83cf('0x1cb')],{'as':_0x83cf('0x16e'),'foreignKey':_0x83cf('0x1bc')});db['FreshsalesField'][_0x83cf('0x112')](db[_0x83cf('0xce')],{'as':'Subject','foreignKey':_0x83cf('0x1c2')});db[_0x83cf('0xce')]['hasMany'](db[_0x83cf('0xce')],{'as':_0x83cf('0x1c7'),'foreignKey':_0x83cf('0x1bf')});db['FreshsalesField']['hasMany'](db[_0x83cf('0xce')],{'as':_0x83cf('0x1c3'),'foreignKey':_0x83cf('0x1c0')});db[_0x83cf('0xce')][_0x83cf('0x151')](db[_0x83cf('0x93')],{'as':'Variable','foreignKey':_0x83cf('0x1c4')});db[_0x83cf('0x1cc')]['belongsTo'](db['ChatWebsite'],{});db[_0x83cf('0x1cc')]['belongsTo'](db[_0x83cf('0xf5')],{'as':'List','foreignKey':'ListId'});db['ChatQueueReport'][_0x83cf('0x151')](db[_0x83cf('0x122')],{'as':_0x83cf('0x15e'),'foreignKey':_0x83cf('0x15f')});db[_0x83cf('0x1cc')][_0x83cf('0x151')](db['ChatInteraction'],{});db['ChatQueueReport'][_0x83cf('0x151')](db[_0x83cf('0x64')],{});db[_0x83cf('0x1cc')][_0x83cf('0x151')](db[_0x83cf('0x10d')],{});db['ChatQueueReport'][_0x83cf('0x151')](db[_0x83cf('0x67')],{});db[_0x83cf('0x1cd')][_0x83cf('0x151')](db[_0x83cf('0x10d')],{'onDelete':'cascade','foreignKey':'FromId'});db[_0x83cf('0x1cd')]['belongsTo'](db[_0x83cf('0x10d')],{'onDelete':_0x83cf('0x110'),'foreignKey':_0x83cf('0x1ce')});db['JscriptySessionReport']['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0x83cf('0x1cf'),'onDelete':'cascade'});db[_0x83cf('0xd7')][_0x83cf('0x112')](db[_0x83cf('0xd4')],{'foreignKey':_0x83cf('0x1cf'),'onDelete':'cascade'});db[_0x83cf('0xd9')]['belongsTo'](db['SmsAccount'],{});db[_0x83cf('0xd9')][_0x83cf('0x151')](db[_0x83cf('0xf5')],{'as':'List','foreignKey':_0x83cf('0x166')});db[_0x83cf('0xd9')][_0x83cf('0x151')](db[_0x83cf('0x122')],{'as':'Contact','foreignKey':_0x83cf('0x15f')});db[_0x83cf('0xd9')][_0x83cf('0x151')](db[_0x83cf('0x54')],{});db[_0x83cf('0xd9')][_0x83cf('0x151')](db[_0x83cf('0x56')],{});db[_0x83cf('0xd9')][_0x83cf('0x151')](db['User'],{});db[_0x83cf('0xd9')][_0x83cf('0x151')](db[_0x83cf('0x58')],{});db[_0x83cf('0xde')][_0x83cf('0x112')](db['JscriptySessionReport'],{'foreignKey':_0x83cf('0x1d0')});db[_0x83cf('0xde')][_0x83cf('0x112')](db[_0x83cf('0xd5')],{'foreignKey':_0x83cf('0x1d0')});db[_0x83cf('0xde')][_0x83cf('0x112')](db['JscriptyAnswerReport'],{'foreignKey':_0x83cf('0x1d0')});db[_0x83cf('0xe3')]['belongsToMany'](db[_0x83cf('0x10d')],{'as':'Users','through':_0x83cf('0x144')});db[_0x83cf('0x156')][_0x83cf('0x120')](db[_0x83cf('0x10d')],{'as':'Agents','through':_0x83cf('0x1d1')});db[_0x83cf('0x156')][_0x83cf('0x120')](db[_0x83cf('0x1a')],{'through':_0x83cf('0x109'),'as':_0x83cf('0x12e')});db[_0x83cf('0x156')]['belongsToMany'](db[_0x83cf('0x130')],{'through':_0x83cf('0x1d2'),'as':_0x83cf('0x1d3')});db[_0x83cf('0x156')][_0x83cf('0x120')](db['ChatQueue'],{'through':_0x83cf('0x1d4'),'as':_0x83cf('0x1d5')});db[_0x83cf('0x156')][_0x83cf('0x120')](db[_0x83cf('0x131')],{'through':_0x83cf('0x17f'),'as':_0x83cf('0x132')});db['Team'][_0x83cf('0x120')](db['SmsQueue'],{'through':_0x83cf('0x1d6'),'as':_0x83cf('0x134')});db[_0x83cf('0x156')][_0x83cf('0x120')](db[_0x83cf('0x5f')],{'through':'team_has_openchannel_queues','as':_0x83cf('0x135')});db['Team'][_0x83cf('0x120')](db['WhatsappQueue'],{'through':_0x83cf('0x1d7'),'as':_0x83cf('0x136')});db[_0x83cf('0x156')]['belongsToMany'](db[_0x83cf('0xf7')],{'through':_0x83cf('0x1d8'),'as':_0x83cf('0x12f')});db[_0x83cf('0xe7')][_0x83cf('0x112')](db[_0x83cf('0x14d')],{'as':_0x83cf('0x14e'),'foreignKey':_0x83cf('0x19e')});db['Campaign']['hasMany'](db[_0x83cf('0x70')],{'as':'HopperFinals','foreignKey':'CampaignId'});db[_0x83cf('0xe7')][_0x83cf('0x112')](db[_0x83cf('0x72')],{'as':'HopperHistories','foreignKey':_0x83cf('0x19e')});db['Campaign']['hasMany'](db[_0x83cf('0x6e')],{'as':'HopperBlacks','foreignKey':_0x83cf('0x19e')});db[_0x83cf('0xe7')][_0x83cf('0x151')](db['Trunk'],{'as':_0x83cf('0x2c'),'foreignKey':_0x83cf('0x1d9')});db[_0x83cf('0xe7')][_0x83cf('0x151')](db[_0x83cf('0x2c')],{'as':_0x83cf('0x152'),'foreignKey':'TrunkBackupId'});db[_0x83cf('0xe7')][_0x83cf('0x151')](db['Interval'],{'as':_0x83cf('0x7f'),'foreignKey':'IntervalId'});db['Campaign'][_0x83cf('0x151')](db[_0x83cf('0xe3')],{'as':_0x83cf('0xe3'),'foreignKey':_0x83cf('0x1da')});db['Campaign']['belongsToMany'](db['CmList'],{'as':_0x83cf('0x154'),'through':'campaigns_has_cm_lists'});db['Campaign'][_0x83cf('0x120')](db[_0x83cf('0xf5')],{'as':_0x83cf('0x1db'),'through':'campaigns_has_cm_blacklists'});db[_0x83cf('0xeb')][_0x83cf('0x151')](db[_0x83cf('0x65')],{'as':_0x83cf('0x65'),'foreignKey':_0x83cf('0x193')});db['MailTransferReport']['belongsTo'](db[_0x83cf('0x41')],{});db['MailTransferReport'][_0x83cf('0x151')](db[_0x83cf('0x40')],{});db[_0x83cf('0x1dc')][_0x83cf('0x151')](db['MailAccount'],{'foreignKey':_0x83cf('0x1dd'),'as':_0x83cf('0x1de')});db[_0x83cf('0x1dc')][_0x83cf('0x151')](db[_0x83cf('0x10d')],{'foreignKey':'FromUserId','as':_0x83cf('0x1df')});db[_0x83cf('0x1dc')][_0x83cf('0x151')](db[_0x83cf('0x10d')],{'foreignKey':'ToUserId','as':_0x83cf('0x1e0')});db['MailTransferReport'][_0x83cf('0x151')](db[_0x83cf('0x130')],{'foreignKey':_0x83cf('0x1e1'),'as':_0x83cf('0x1e2')});db[_0x83cf('0x1dc')][_0x83cf('0x151')](db['MailAccount'],{'foreignKey':'ToMailAccountId','as':_0x83cf('0x1e3')});db[_0x83cf('0xef')]['belongsTo'](db[_0x83cf('0x64')],{});db[_0x83cf('0xef')][_0x83cf('0x151')](db[_0x83cf('0x118')],{});db[_0x83cf('0xef')][_0x83cf('0x151')](db[_0x83cf('0x138')],{'foreignKey':'FromChatWebsiteId','as':_0x83cf('0x1de')});db[_0x83cf('0xef')][_0x83cf('0x151')](db[_0x83cf('0x10d')],{'foreignKey':_0x83cf('0x1e4'),'as':_0x83cf('0x1df')});db[_0x83cf('0xef')][_0x83cf('0x151')](db[_0x83cf('0x10d')],{'foreignKey':_0x83cf('0x1e5'),'as':_0x83cf('0x1e0')});db[_0x83cf('0xef')]['belongsTo'](db['ChatQueue'],{'foreignKey':_0x83cf('0x1e6'),'as':_0x83cf('0x1e2')});db[_0x83cf('0xef')][_0x83cf('0x151')](db['ChatWebsite'],{'foreignKey':_0x83cf('0x1e7'),'as':_0x83cf('0x1e3')});db['FaxTransferReport'][_0x83cf('0x151')](db[_0x83cf('0x4c')],{});db[_0x83cf('0xf1')][_0x83cf('0x151')](db['FaxInteraction'],{});db[_0x83cf('0xf1')]['belongsTo'](db[_0x83cf('0x13a')],{'foreignKey':_0x83cf('0x1e8'),'as':'FromAccount'});db[_0x83cf('0xf1')][_0x83cf('0x151')](db[_0x83cf('0x10d')],{'foreignKey':_0x83cf('0x1e4'),'as':'FromAgent'});db['FaxTransferReport']['belongsTo'](db[_0x83cf('0x10d')],{'foreignKey':_0x83cf('0x1e5'),'as':'ToAgent'});db[_0x83cf('0xf1')][_0x83cf('0x151')](db[_0x83cf('0x131')],{'foreignKey':'ToFaxQueueId','as':_0x83cf('0x1e2')});db['FaxTransferReport'][_0x83cf('0x151')](db['FaxAccount'],{'foreignKey':_0x83cf('0x1e9'),'as':_0x83cf('0x1e3')});db[_0x83cf('0x1ea')][_0x83cf('0x151')](db[_0x83cf('0x5d')],{});db['OpenchannelTransferReport'][_0x83cf('0x151')](db[_0x83cf('0x5c')],{});db[_0x83cf('0x1ea')][_0x83cf('0x151')](db[_0x83cf('0x5a')],{'foreignKey':_0x83cf('0x1eb'),'as':'FromAccount'});db['OpenchannelTransferReport'][_0x83cf('0x151')](db[_0x83cf('0x10d')],{'foreignKey':'FromUserId','as':_0x83cf('0x1df')});db[_0x83cf('0x1ea')][_0x83cf('0x151')](db[_0x83cf('0x10d')],{'foreignKey':_0x83cf('0x1e5'),'as':_0x83cf('0x1e0')});db[_0x83cf('0x1ea')][_0x83cf('0x151')](db[_0x83cf('0x5f')],{'foreignKey':_0x83cf('0x1ec'),'as':_0x83cf('0x1e2')});db[_0x83cf('0x1ea')][_0x83cf('0x151')](db[_0x83cf('0x5a')],{'foreignKey':'ToOpenchannelAccountId','as':_0x83cf('0x1e3')});db['SmsTransferReport'][_0x83cf('0x151')](db[_0x83cf('0x56')],{});db['SmsTransferReport'][_0x83cf('0x151')](db[_0x83cf('0x54')],{});db['SmsTransferReport'][_0x83cf('0x151')](db[_0x83cf('0x50')],{'foreignKey':'FromSmsAccountId','as':_0x83cf('0x1de')});db[_0x83cf('0xf3')]['belongsTo'](db[_0x83cf('0x10d')],{'foreignKey':_0x83cf('0x1e4'),'as':'FromAgent'});db['SmsTransferReport'][_0x83cf('0x151')](db[_0x83cf('0x10d')],{'foreignKey':_0x83cf('0x1e5'),'as':_0x83cf('0x1e0')});db[_0x83cf('0xf3')][_0x83cf('0x151')](db['SmsQueue'],{'foreignKey':_0x83cf('0x1ed'),'as':_0x83cf('0x1e2')});db['SmsTransferReport']['belongsTo'](db[_0x83cf('0x50')],{'foreignKey':_0x83cf('0x1ee'),'as':_0x83cf('0x1e3')});db['CmList'][_0x83cf('0x112')](db[_0x83cf('0x7c')],{'as':_0x83cf('0x164'),'foreignKey':_0x83cf('0x166'),'onDelete':_0x83cf('0x110')});db[_0x83cf('0xf5')][_0x83cf('0x112')](db[_0x83cf('0x75')],{'as':'CustomFields','foreignKey':_0x83cf('0x166')});db[_0x83cf('0xf5')][_0x83cf('0x112')](db[_0x83cf('0x122')],{'as':_0x83cf('0x123'),'onDelete':_0x83cf('0x110'),'foreignKey':_0x83cf('0x166')});db[_0x83cf('0xf5')][_0x83cf('0x112')](db[_0x83cf('0x70')],{'as':_0x83cf('0x115'),'foreignKey':_0x83cf('0x166')});db['CmList'][_0x83cf('0x112')](db[_0x83cf('0x72')],{'as':_0x83cf('0x1ef'),'foreignKey':_0x83cf('0x166')});db[_0x83cf('0xf5')][_0x83cf('0x112')](db[_0x83cf('0x116')],{'as':_0x83cf('0x116'),'foreignKey':_0x83cf('0x166')});db[_0x83cf('0xf5')][_0x83cf('0x120')](db[_0x83cf('0x1a')],{'as':'Queues','through':'voice_queues_has_cm_lists'});db[_0x83cf('0xf5')]['belongsToMany'](db[_0x83cf('0x10d')],{'as':_0x83cf('0x16a'),'through':'cm_user_has_lists'});db['VoicePrefix'][_0x83cf('0x112')](db[_0x83cf('0x114')],{'as':_0x83cf('0x1a6'),'onDelete':_0x83cf('0x110')});db['VoicePrefix']['belongsToMany'](db[_0x83cf('0x10d')],{'as':_0x83cf('0x16a'),'through':'UserVoicePrefix'});db[_0x83cf('0xf7')][_0x83cf('0x120')](db[_0x83cf('0x156')],{'through':'TeamVoicePrefix','as':_0x83cf('0x16c')});db[_0x83cf('0x11e')][_0x83cf('0x112')](db[_0x83cf('0x10d')],{'as':_0x83cf('0x173'),'foreignKey':_0x83cf('0x11f')});db[_0x83cf('0x11e')][_0x83cf('0x112')](db['UserProfileSection'],{'as':_0x83cf('0x1f0'),'foreignKey':_0x83cf('0x11f'),'onDelete':'cascade'});db[_0x83cf('0xf8')][_0x83cf('0x112')](db['UserProfileResource'],{'as':_0x83cf('0x1f1'),'foreignKey':_0x83cf('0x1f2'),'onDelete':_0x83cf('0x110')});db[_0x83cf('0x140')][_0x83cf('0x112')](db[_0x83cf('0x7c')],{'as':_0x83cf('0x164'),'foreignKey':_0x83cf('0x1f3'),'onDelete':_0x83cf('0x110')});db['WhatsappAccount'][_0x83cf('0x112')](db[_0x83cf('0x7a')],{'as':_0x83cf('0x178'),'foreignKey':_0x83cf('0x1f3')});db[_0x83cf('0x140')][_0x83cf('0x112')](db['WhatsappMessage'],{'as':_0x83cf('0x158'),'foreignKey':_0x83cf('0x1f3')});db['WhatsappAccount'][_0x83cf('0x112')](db[_0x83cf('0x11c')],{'as':_0x83cf('0x179')});db['WhatsappAccount']['hasMany'](db[_0x83cf('0xfe')],{'as':'Applications'});db[_0x83cf('0x140')][_0x83cf('0x151')](db[_0x83cf('0xf5')],{'as':_0x83cf('0x165'),'foreignKey':_0x83cf('0x166')});db[_0x83cf('0x140')]['belongsTo'](db[_0x83cf('0x81')],{'as':_0x83cf('0x168'),'foreignKey':_0x83cf('0x169')});db[_0x83cf('0x140')][_0x83cf('0x120')](db[_0x83cf('0x10d')],{'as':_0x83cf('0x16a'),'through':_0x83cf('0x142')});db['WhatsappApplication'][_0x83cf('0x151')](db['User'],{'onDelete':_0x83cf('0x161')});db[_0x83cf('0xfe')][_0x83cf('0x151')](db['WhatsappQueue'],{'onDelete':_0x83cf('0x161')});db[_0x83cf('0xfe')]['belongsTo'](db[_0x83cf('0x140')],{'onDelete':_0x83cf('0x161')});db[_0x83cf('0xfe')][_0x83cf('0x151')](db[_0x83cf('0x7f')],{'onDelete':_0x83cf('0x161'),'foreignKey':_0x83cf('0x153')});db[_0x83cf('0xfe')]['belongsTo'](db['Tag'],{'onDelete':_0x83cf('0x161'),'foreignKey':'TagId'});db[_0x83cf('0x11c')]['hasMany'](db[_0x83cf('0x101')],{'as':_0x83cf('0x158'),'onDelete':_0x83cf('0x110'),'foreignKey':_0x83cf('0x1f4')});db['WhatsappInteraction'][_0x83cf('0x151')](db['WhatsappAccount'],{'as':_0x83cf('0x16e'),'foreignKey':_0x83cf('0x1f3')});db['WhatsappInteraction'][_0x83cf('0x151')](db['CmContact'],{'as':_0x83cf('0x15e'),'foreignKey':_0x83cf('0x15f')});db['WhatsappInteraction'][_0x83cf('0x151')](db[_0x83cf('0x10d')],{'as':'Owner','foreignKey':'UserId'});db[_0x83cf('0x11c')][_0x83cf('0x120')](db[_0x83cf('0x8b')],{'through':_0x83cf('0x1ac'),'as':_0x83cf('0x171')});db[_0x83cf('0x11c')][_0x83cf('0x120')](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':_0x83cf('0x172')});db[_0x83cf('0x11c')][_0x83cf('0x120')](db[_0x83cf('0x10d')],{'as':_0x83cf('0x173'),'through':_0x83cf('0x12d'),'foreignKey':'WhatsappInteractionId'});db[_0x83cf('0x101')][_0x83cf('0x151')](db[_0x83cf('0x10d')],{'as':_0x83cf('0x10d')});db[_0x83cf('0x101')]['belongsTo'](db[_0x83cf('0x122')],{'onDelete':'cascade','as':_0x83cf('0x15e')});db['WhatsappMessage'][_0x83cf('0x151')](db[_0x83cf('0x11c')],{'onDelete':_0x83cf('0x110'),'as':_0x83cf('0x17d'),'foreignKey':'WhatsappInteractionId'});db[_0x83cf('0x101')]['belongsTo'](db['WhatsappAccount'],{'as':'Account','foreignKey':_0x83cf('0x1f3')});db['WhatsappQueueReport'][_0x83cf('0x151')](db[_0x83cf('0x140')],{});db['WhatsappQueueReport'][_0x83cf('0x151')](db[_0x83cf('0xf5')],{'as':_0x83cf('0x165'),'foreignKey':_0x83cf('0x166')});db['WhatsappQueueReport'][_0x83cf('0x151')](db['CmContact'],{'as':_0x83cf('0x15e'),'foreignKey':'ContactId'});db[_0x83cf('0x103')][_0x83cf('0x151')](db[_0x83cf('0x11c')],{});db[_0x83cf('0x103')][_0x83cf('0x151')](db[_0x83cf('0x107')],{});db[_0x83cf('0x103')][_0x83cf('0x151')](db[_0x83cf('0x101')],{});db[_0x83cf('0x103')][_0x83cf('0x151')](db[_0x83cf('0x10d')],{});db[_0x83cf('0x105')][_0x83cf('0x151')](db[_0x83cf('0x101')],{});db[_0x83cf('0x105')][_0x83cf('0x151')](db['WhatsappInteraction'],{});db[_0x83cf('0x105')][_0x83cf('0x151')](db[_0x83cf('0x140')],{'foreignKey':_0x83cf('0x1f5'),'as':'FromAccount'});db[_0x83cf('0x105')][_0x83cf('0x151')](db['WhatsappAccount'],{'foreignKey':_0x83cf('0x1f6'),'as':'ToAccount'});db[_0x83cf('0x105')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x83cf('0x1f7'),'as':_0x83cf('0x1e2')});db['WhatsappTransferReport'][_0x83cf('0x151')](db[_0x83cf('0x10d')],{'foreignKey':_0x83cf('0x1e4'),'as':_0x83cf('0x1df')});db['WhatsappTransferReport'][_0x83cf('0x151')](db[_0x83cf('0x10d')],{'foreignKey':_0x83cf('0x1e5'),'as':'ToAgent'});db[_0x83cf('0x107')][_0x83cf('0x120')](db[_0x83cf('0x10d')],{'as':_0x83cf('0x16a'),'through':_0x83cf('0x137'),'foreignKey':_0x83cf('0x1f8')});db[_0x83cf('0x107')]['belongsToMany'](db[_0x83cf('0x156')],{'through':_0x83cf('0x1d7'),'as':_0x83cf('0x16c')});db[_0x83cf('0x1f9')]['belongsTo'](db['User'],{'as':_0x83cf('0x1fa'),'foreignKey':_0x83cf('0x111'),'onDelete':_0x83cf('0x110'),'hooks':!![]});db[_0x83cf('0x108')][_0x83cf('0x10e')](db['Dynamics365Account'],{'as':_0x83cf('0xc8'),'onDelete':'restrict'});db[_0x83cf('0x108')][_0x83cf('0x10e')](db[_0x83cf('0x39')],{'as':_0x83cf('0x1fb'),'onDelete':_0x83cf('0x161')});db[_0x83cf('0x108')]['hasOne'](db[_0x83cf('0x3a')],{'as':_0x83cf('0x163'),'onDelete':'restrict'});module[_0x83cf('0x1fc')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 37d5618..3f91998 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc64=['./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./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/jscriptyProject','/api/square/odbc','./api/squareProject','/api/square/recordings','./api/squareMessage','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./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/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','/api/auth/google','/api/auth/activedirectory','./api/authActiveDirectory','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/webbar','./api/webbar','/api/logs','static','/apidoc','root','/www','/demo','join','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','express','./errors','./config/environment','setupLoggers','./api/client-side-logs','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','/api/voice/recordings','/api/screen/recordings','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailAccount','/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/fax/applications','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','./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/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','/api/tags','./api/tag','/api/cm_contact_has_items','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/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/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration'];(function(_0xdd551a,_0x4cd111){var _0x3697a9=function(_0x11c028){while(--_0x11c028){_0xdd551a['push'](_0xdd551a['shift']());}};_0x3697a9(++_0x4cd111);}(_0xdc64,0x80));var _0x4dc6=function(_0x5eabfe,_0x7765a6){_0x5eabfe=_0x5eabfe-0x0;var _0x95e447=_0xdc64[_0x5eabfe];return _0x95e447;};'use strict';var path=require(_0x4dc6('0x0'));var express=require(_0x4dc6('0x1'));var errors=require(_0x4dc6('0x2'));var config=require(_0x4dc6('0x3'));var setupLoggers=require('./utils/client-side-logger')[_0x4dc6('0x4')];var clientSideLogs=require(_0x4dc6('0x5'));exports[_0x4dc6('0x6')]=function(_0x6a357f){return setupLoggers(_0x6a357f)[_0x4dc6('0x7')](function(){_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x9'),require(_0x4dc6('0xa')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xb'),require(_0x4dc6('0xc')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xd'),require(_0x4dc6('0xe')));_0x6a357f[_0x4dc6('0x8')]('/api/voice/extensions',require(_0x4dc6('0xf')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x10'),require('./api/voiceMusicOnHold'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x11'),require('./api/voiceQueue'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x12'),require('./api/voiceRecording'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x13'),require('./api/screenRecording'));_0x6a357f[_0x4dc6('0x8')]('/api/voice/mails',require(_0x4dc6('0x14')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x15'),require('./api/voiceMailMessage'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x16'),require(_0x4dc6('0x17')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x18'),require('./api/voiceDialReport'));_0x6a357f['use'](_0x4dc6('0x19'),require(_0x4dc6('0x1a')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x1b'),require(_0x4dc6('0x1c')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x1d'),require(_0x4dc6('0x1e')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x1f'),require('./api/trunk'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x20'),require('./api/voiceTransferReport'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x21'),require('./api/mailServerOut'));_0x6a357f['use']('/api/mail/accounts',require(_0x4dc6('0x22')));_0x6a357f[_0x4dc6('0x8')]('/api/mail/queues',require('./api/mailQueue'));_0x6a357f[_0x4dc6('0x8')]('/api/mail/substatuses',require('./api/mailSubstatus'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x23'),require(_0x4dc6('0x24')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x25'),require('./api/mailMessage'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x26'),require(_0x4dc6('0x27')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x28'),require(_0x4dc6('0x29')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x2a'),require('./api/dashboard'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x2b'),require(_0x4dc6('0x2c')));_0x6a357f[_0x4dc6('0x8')]('/api/fax/accounts',require(_0x4dc6('0x2d')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x2e'),require('./api/faxApplication'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x2f'),require('./api/faxInteraction'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x30'),require(_0x4dc6('0x31')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x32'),require('./api/faxQueue'));_0x6a357f[_0x4dc6('0x8')]('/api/fax/reports/queue',require(_0x4dc6('0x33')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x34'),require(_0x4dc6('0x35')));_0x6a357f[_0x4dc6('0x8')]('/api/sms/applications',require('./api/smsApplication'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x36'),require(_0x4dc6('0x37')));_0x6a357f['use'](_0x4dc6('0x38'),require(_0x4dc6('0x39')));_0x6a357f[_0x4dc6('0x8')]('/api/sms/queues',require(_0x4dc6('0x3a')));_0x6a357f['use'](_0x4dc6('0x3b'),require('./api/openchannelAccount'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x3c'),require(_0x4dc6('0x3d')));_0x6a357f[_0x4dc6('0x8')]('/api/openchannel/interactions',require(_0x4dc6('0x3e')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x3f'),require('./api/openchannelMessage'));_0x6a357f['use'](_0x4dc6('0x40'),require(_0x4dc6('0x41')));_0x6a357f['use'](_0x4dc6('0x42'),require(_0x4dc6('0x43')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x44'),require(_0x4dc6('0x45')));_0x6a357f[_0x4dc6('0x8')]('/api/chat/applications',require(_0x4dc6('0x46')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x47'),require(_0x4dc6('0x48')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x49'),require(_0x4dc6('0x4a')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x4b'),require(_0x4dc6('0x4c')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x4d'),require(_0x4dc6('0x4e')));_0x6a357f['use'](_0x4dc6('0x4f'),require(_0x4dc6('0x50')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x51'),require('./api/chatProactiveAction'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x52'),require(_0x4dc6('0x53')));_0x6a357f['use']('/api/cm/contacts',require(_0x4dc6('0x54')));_0x6a357f['use'](_0x4dc6('0x55'),require(_0x4dc6('0x56')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x57'),require(_0x4dc6('0x58')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x59'),require(_0x4dc6('0x5a')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x5b'),require(_0x4dc6('0x5c')));_0x6a357f['use'](_0x4dc6('0x5d'),require(_0x4dc6('0x5e')));_0x6a357f['use'](_0x4dc6('0x5f'),require(_0x4dc6('0x60')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x61'),require(_0x4dc6('0x62')));_0x6a357f['use'](_0x4dc6('0x63'),require('./api/cannedAnswer'));_0x6a357f['use'](_0x4dc6('0x64'),require(_0x4dc6('0x65')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x66'),require(_0x4dc6('0x67')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x68'),require(_0x4dc6('0x69')));_0x6a357f[_0x4dc6('0x8')]('/api/pauses',require(_0x4dc6('0x6a')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x6b'),require(_0x4dc6('0x6c')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x6d'),require(_0x4dc6('0x6e')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x6f'),require(_0x4dc6('0x70')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x71'),require('./api/sound'));_0x6a357f['use'](_0x4dc6('0x72'),require(_0x4dc6('0x73')));_0x6a357f['use']('/api/contact_item_types',require('./api/contactItemType'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x74'),require('./api/cmContactHasItem'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x75'),require(_0x4dc6('0x76')));_0x6a357f['use'](_0x4dc6('0x77'),require(_0x4dc6('0x78')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x79'),require('./api/trigger'));_0x6a357f[_0x4dc6('0x8')]('/api/variables',require(_0x4dc6('0x7a')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x7b'),require(_0x4dc6('0x7c')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x7d'),require('./api/integrationReport'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x7e'),require(_0x4dc6('0x7f')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x80'),require(_0x4dc6('0x81')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x82'),require(_0x4dc6('0x83')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x84'),require(_0x4dc6('0x85')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x86'),require('./api/analyticFieldReport'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x87'),require('./api/analyticTreeReport'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x88'),require(_0x4dc6('0x89')));_0x6a357f['use'](_0x4dc6('0x8a'),require(_0x4dc6('0x8b')));_0x6a357f['use'](_0x4dc6('0x8c'),require('./api/intSalesforceField'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x8d'),require(_0x4dc6('0x8e')));_0x6a357f['use']('/api/integrations/sugarcrm/configurations',require(_0x4dc6('0x8f')));_0x6a357f['use']('/api/integrations/sugarcrm/fields',require(_0x4dc6('0x90')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x91'),require(_0x4dc6('0x92')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x93'),require(_0x4dc6('0x94')));_0x6a357f[_0x4dc6('0x8')]('/api/integrations/desk/fields',require(_0x4dc6('0x95')));_0x6a357f['use'](_0x4dc6('0x96'),require(_0x4dc6('0x97')));_0x6a357f[_0x4dc6('0x8')]('/api/integrations/zoho/configurations',require('./api/intZohoConfiguration'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x98'),require(_0x4dc6('0x99')));_0x6a357f[_0x4dc6('0x8')]('/api/integrations/zendesk/accounts',require('./api/intZendeskAccount'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x9a'),require('./api/intZendeskConfiguration'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x9b'),require(_0x4dc6('0x9c')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x9d'),require('./api/intFreshdeskAccount'));_0x6a357f['use'](_0x4dc6('0x9e'),require('./api/intFreshdeskConfiguration'));_0x6a357f[_0x4dc6('0x8')]('/api/integrations/freshdesk/fields',require(_0x4dc6('0x9f')));_0x6a357f['use'](_0x4dc6('0xa0'),require(_0x4dc6('0xa1')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xa2'),require(_0x4dc6('0xa3')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xa4'),require('./api/intVtigerField'));_0x6a357f['use'](_0x4dc6('0xa5'),require(_0x4dc6('0xa6')));_0x6a357f[_0x4dc6('0x8')]('/api/integrations/servicenow/configurations',require(_0x4dc6('0xa7')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xa8'),require(_0x4dc6('0xa9')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xaa'),require('./api/intDynamics365Account'));_0x6a357f[_0x4dc6('0x8')]('/api/integrations/dynamics365/configurations',require(_0x4dc6('0xab')));_0x6a357f['use']('/api/integrations/dynamics365/fields',require(_0x4dc6('0xac')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xad'),require(_0x4dc6('0xae')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xaf'),require(_0x4dc6('0xb0')));_0x6a357f[_0x4dc6('0x8')]('/api/integrations/freshsales/fields',require('./api/intFreshsalesField'));_0x6a357f['use'](_0x4dc6('0xb1'),require(_0x4dc6('0xb2')));_0x6a357f[_0x4dc6('0x8')]('/api/chat/reports/queue',require(_0x4dc6('0xb3')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xb4'),require(_0x4dc6('0xb5')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xb6'),require(_0x4dc6('0xb7')));_0x6a357f['use']('/api/jscripty/questions/reports',require(_0x4dc6('0xb8')));_0x6a357f['use'](_0x4dc6('0xb9'),require(_0x4dc6('0xba')));_0x6a357f[_0x4dc6('0x8')]('/api/sms/reports/queue',require(_0x4dc6('0xbb')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xbc'),require(_0x4dc6('0xbd')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xbe'),require(_0x4dc6('0xbf')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xc0'),require(_0x4dc6('0xc1')));_0x6a357f[_0x4dc6('0x8')]('/api/settings',require('./api/setting'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xc2'),require('./api/squareOdbc'));_0x6a357f[_0x4dc6('0x8')]('/api/square/projects',require(_0x4dc6('0xc3')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xc4'),require('./api/squareRecording'));_0x6a357f[_0x4dc6('0x8')]('/api/square/messages',require(_0x4dc6('0xc5')));_0x6a357f['use']('/api/teams',require(_0x4dc6('0xc6')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xc7'),require(_0x4dc6('0xc8')));_0x6a357f['use'](_0x4dc6('0xc9'),require(_0x4dc6('0xca')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xcb'),require('./api/migration'));_0x6a357f[_0x4dc6('0x8')]('/api/attachments',require('./api/attachment'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xcc'),require(_0x4dc6('0xcd')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xce'),require(_0x4dc6('0xcf')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xd0'),require(_0x4dc6('0xd1')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xd2'),require(_0x4dc6('0xd3')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xd4'),require(_0x4dc6('0xd5')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xd6'),require(_0x4dc6('0xd7')));_0x6a357f['use'](_0x4dc6('0xd8'),require('./api/cmList'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xd9'),require(_0x4dc6('0xda')));_0x6a357f[_0x4dc6('0x8')]('/api/userProfiles',require(_0x4dc6('0xdb')));_0x6a357f['use']('/api/userProfile/sections',require(_0x4dc6('0xdc')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xdd'),require(_0x4dc6('0xde')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xdf'),require(_0x4dc6('0xe0')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xe1'),require(_0x4dc6('0xe2')));_0x6a357f['use'](_0x4dc6('0xe3'),require(_0x4dc6('0xe4')));_0x6a357f[_0x4dc6('0x8')]('/api/whatsapp/interactions',require(_0x4dc6('0xe5')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xe6'),require('./api/whatsappMessage'));_0x6a357f['use']('/api/whatsapp/reports/queue',require('./api/whatsappQueueReport'));_0x6a357f['use'](_0x4dc6('0xe7'),require(_0x4dc6('0xe8')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xe9'),require(_0x4dc6('0xea')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xeb'),require(_0x4dc6('0xec')));_0x6a357f[_0x4dc6('0x8')]('/api/realtime',require(_0x4dc6('0xed')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xee'),require(_0x4dc6('0xef')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xf0'),require('./api/authLocal'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xf1'),require('./api/authGoogle'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xf2'),require(_0x4dc6('0xf3')));_0x6a357f['use']('/api/jira',require(_0x4dc6('0xf4')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xf5'),require(_0x4dc6('0xf6')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xf7'),require(_0x4dc6('0xf8')));_0x6a357f['use'](_0x4dc6('0xf9'),require(_0x4dc6('0xfa')));_0x6a357f[_0x4dc6('0x8')]('/api/pm2',require('./api/pm2'));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xfb'),require(_0x4dc6('0xfc')));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0xfd'),clientSideLogs);_0x6a357f[_0x4dc6('0x8')]('/apidoc',express[_0x4dc6('0xfe')](path['join'](config['root'],_0x4dc6('0xff'))));_0x6a357f['use']('/www',express[_0x4dc6('0xfe')](path['join'](config[_0x4dc6('0x100')],_0x4dc6('0x101'))));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x102'),express[_0x4dc6('0xfe')](path[_0x4dc6('0x103')](config[_0x4dc6('0x100')],_0x4dc6('0x102'))));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x104'),express['static'](path[_0x4dc6('0x103')](config[_0x4dc6('0x100')],_0x4dc6('0x105'),_0x4dc6('0x106'))));_0x6a357f[_0x4dc6('0x8')](_0x4dc6('0x107'),express['static'](path['join'](config[_0x4dc6('0x100')],_0x4dc6('0x108'))));_0x6a357f[_0x4dc6('0x109')](_0x4dc6('0x10a'))[_0x4dc6('0x10b')](errors[0x194]);_0x6a357f[_0x4dc6('0x109')]('/*')[_0x4dc6('0x10b')](function(_0x9f92db,_0x30988b){_0x30988b[_0x4dc6('0x10c')](path[_0x4dc6('0x10d')](_0x6a357f[_0x4dc6('0x10b')](_0x4dc6('0x10e'))+_0x4dc6('0x10f')));});return _0x6a357f;});}; \ No newline at end of file +var _0xdf17=['./api/cmList','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','./api/jira','/api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','express','./errors','./config/environment','setupLoggers','./api/client-side-logs','default','use','/api/users','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailMessage','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','./api/smsInteraction','./api/smsMessage','/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/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/actions','./api/action','/api/automations','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','/api/contact_item_types','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/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/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists'];(function(_0x1f4e09,_0x1fc591){var _0x10deec=function(_0x5c1fb9){while(--_0x5c1fb9){_0x1f4e09['push'](_0x1f4e09['shift']());}};_0x10deec(++_0x1fc591);}(_0xdf17,0x14d));var _0x7df1=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xdf17[_0x3a6efd];return _0x487b9a;};'use strict';var path=require(_0x7df1('0x0'));var express=require(_0x7df1('0x1'));var errors=require(_0x7df1('0x2'));var config=require(_0x7df1('0x3'));var setupLoggers=require('./utils/client-side-logger')[_0x7df1('0x4')];var clientSideLogs=require(_0x7df1('0x5'));exports[_0x7df1('0x6')]=function(_0x1deb97){return setupLoggers(_0x1deb97)['then'](function(){_0x1deb97[_0x7df1('0x7')](_0x7df1('0x8'),require('./api/user'));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x9'),require('./api/voiceChanSpy'));_0x1deb97['use'](_0x7df1('0xa'),require(_0x7df1('0xb')));_0x1deb97['use'](_0x7df1('0xc'),require(_0x7df1('0xd')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xe'),require('./api/voiceMusicOnHold'));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xf'),require(_0x7df1('0x10')));_0x1deb97[_0x7df1('0x7')]('/api/voice/recordings',require(_0x7df1('0x11')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x12'),require(_0x7df1('0x13')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x14'),require(_0x7df1('0x15')));_0x1deb97[_0x7df1('0x7')]('/api/voice/mails/messages',require('./api/voiceMailMessage'));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x16'),require(_0x7df1('0x17')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x18'),require('./api/voiceDialReport'));_0x1deb97[_0x7df1('0x7')]('/api/voice/agents/reports',require('./api/voiceAgentReport'));_0x1deb97['use'](_0x7df1('0x19'),require(_0x7df1('0x1a')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x1b'),require(_0x7df1('0x1c')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x1d'),require('./api/trunk'));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x1e'),require(_0x7df1('0x1f')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x20'),require(_0x7df1('0x21')));_0x1deb97['use']('/api/mail/accounts',require(_0x7df1('0x22')));_0x1deb97[_0x7df1('0x7')]('/api/mail/queues',require(_0x7df1('0x23')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x24'),require(_0x7df1('0x25')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x26'),require('./api/mailInteraction'));_0x1deb97[_0x7df1('0x7')]('/api/mail/messages',require(_0x7df1('0x27')));_0x1deb97['use']('/api/mail/applications',require('./api/mailApplication'));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x28'),require(_0x7df1('0x29')));_0x1deb97['use'](_0x7df1('0x2a'),require(_0x7df1('0x2b')));_0x1deb97['use'](_0x7df1('0x2c'),require(_0x7df1('0x2d')));_0x1deb97[_0x7df1('0x7')]('/api/fax/accounts',require('./api/faxAccount'));_0x1deb97[_0x7df1('0x7')]('/api/fax/applications',require(_0x7df1('0x2e')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x2f'),require(_0x7df1('0x30')));_0x1deb97['use'](_0x7df1('0x31'),require(_0x7df1('0x32')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x33'),require(_0x7df1('0x34')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x35'),require(_0x7df1('0x36')));_0x1deb97['use'](_0x7df1('0x37'),require(_0x7df1('0x38')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x39'),require(_0x7df1('0x3a')));_0x1deb97[_0x7df1('0x7')]('/api/sms/interactions',require(_0x7df1('0x3b')));_0x1deb97[_0x7df1('0x7')]('/api/sms/messages',require(_0x7df1('0x3c')));_0x1deb97['use'](_0x7df1('0x3d'),require(_0x7df1('0x3e')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x3f'),require(_0x7df1('0x40')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x41'),require(_0x7df1('0x42')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x43'),require(_0x7df1('0x44')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x45'),require(_0x7df1('0x46')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x47'),require(_0x7df1('0x48')));_0x1deb97['use']('/api/chat/websites',require('./api/chatWebsite'));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x49'),require(_0x7df1('0x4a')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x4b'),require(_0x7df1('0x4c')));_0x1deb97['use'](_0x7df1('0x4d'),require(_0x7df1('0x4e')));_0x1deb97[_0x7df1('0x7')]('/api/chat/messages',require(_0x7df1('0x4f')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x50'),require(_0x7df1('0x51')));_0x1deb97['use']('/api/chat/queues',require('./api/chatQueue'));_0x1deb97[_0x7df1('0x7')]('/api/chat/groups',require(_0x7df1('0x52')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x53'),require('./api/chatProactiveAction'));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x54'),require(_0x7df1('0x55')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x56'),require(_0x7df1('0x57')));_0x1deb97['use']('/api/cm/hopper',require(_0x7df1('0x58')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x59'),require(_0x7df1('0x5a')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x5b'),require(_0x7df1('0x5c')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x5d'),require('./api/cmHopperHistory'));_0x1deb97['use']('/api/cm/custom_fields',require('./api/cmCustomField'));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x5e'),require(_0x7df1('0x5f')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x60'),require('./api/automation'));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x61'),require(_0x7df1('0x62')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x63'),require(_0x7df1('0x64')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x65'),require(_0x7df1('0x66')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x67'),require(_0x7df1('0x68')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x69'),require('./api/pause'));_0x1deb97[_0x7df1('0x7')]('/api/cdr',require(_0x7df1('0x6a')));_0x1deb97['use'](_0x7df1('0x6b'),require(_0x7df1('0x6c')));_0x1deb97['use'](_0x7df1('0x6d'),require('./api/schedule'));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x6e'),require(_0x7df1('0x6f')));_0x1deb97['use'](_0x7df1('0x70'),require('./api/tag'));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x71'),require('./api/contactItemType'));_0x1deb97['use'](_0x7df1('0x72'),require(_0x7df1('0x73')));_0x1deb97['use'](_0x7df1('0x74'),require(_0x7df1('0x75')));_0x1deb97[_0x7df1('0x7')]('/api/templates',require(_0x7df1('0x76')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x77'),require(_0x7df1('0x78')));_0x1deb97['use'](_0x7df1('0x79'),require(_0x7df1('0x7a')));_0x1deb97['use'](_0x7df1('0x7b'),require(_0x7df1('0x7c')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x7d'),require('./api/integrationReport'));_0x1deb97[_0x7df1('0x7')]('/api/analytics/custom_reports',require(_0x7df1('0x7e')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x7f'),require(_0x7df1('0x80')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x81'),require(_0x7df1('0x82')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x83'),require('./api/analyticMetric'));_0x1deb97['use'](_0x7df1('0x84'),require(_0x7df1('0x85')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x86'),require(_0x7df1('0x87')));_0x1deb97[_0x7df1('0x7')]('/api/integrations/salesforce/accounts',require(_0x7df1('0x88')));_0x1deb97[_0x7df1('0x7')]('/api/integrations/salesforce/configurations',require(_0x7df1('0x89')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x8a'),require(_0x7df1('0x8b')));_0x1deb97[_0x7df1('0x7')]('/api/integrations/sugarcrm/accounts',require(_0x7df1('0x8c')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x8d'),require(_0x7df1('0x8e')));_0x1deb97[_0x7df1('0x7')]('/api/integrations/sugarcrm/fields',require(_0x7df1('0x8f')));_0x1deb97['use'](_0x7df1('0x90'),require(_0x7df1('0x91')));_0x1deb97['use']('/api/integrations/desk/configurations',require(_0x7df1('0x92')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x93'),require(_0x7df1('0x94')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x95'),require('./api/intZohoAccount'));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x96'),require('./api/intZohoConfiguration'));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x97'),require(_0x7df1('0x98')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x99'),require(_0x7df1('0x9a')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x9b'),require(_0x7df1('0x9c')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x9d'),require(_0x7df1('0x9e')));_0x1deb97['use'](_0x7df1('0x9f'),require(_0x7df1('0xa0')));_0x1deb97[_0x7df1('0x7')]('/api/integrations/freshdesk/configurations',require(_0x7df1('0xa1')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xa2'),require(_0x7df1('0xa3')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xa4'),require(_0x7df1('0xa5')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xa6'),require(_0x7df1('0xa7')));_0x1deb97['use']('/api/integrations/vtiger/fields',require(_0x7df1('0xa8')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xa9'),require(_0x7df1('0xaa')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xab'),require(_0x7df1('0xac')));_0x1deb97['use'](_0x7df1('0xad'),require('./api/intServicenowField'));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xae'),require('./api/intDynamics365Account'));_0x1deb97[_0x7df1('0x7')]('/api/integrations/dynamics365/configurations',require('./api/intDynamics365Configuration'));_0x1deb97[_0x7df1('0x7')]('/api/integrations/dynamics365/fields',require(_0x7df1('0xaf')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xb0'),require('./api/intFreshsalesAccount'));_0x1deb97['use'](_0x7df1('0xb1'),require(_0x7df1('0xb2')));_0x1deb97[_0x7df1('0x7')]('/api/integrations/freshsales/fields',require(_0x7df1('0xb3')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xb4'),require(_0x7df1('0xb5')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xb6'),require('./api/chatQueueReport'));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xb7'),require('./api/chatInternalMessage'));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xb8'),require(_0x7df1('0xb9')));_0x1deb97['use'](_0x7df1('0xba'),require(_0x7df1('0xbb')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xbc'),require('./api/jscriptySessionReport'));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xbd'),require(_0x7df1('0xbe')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xbf'),require(_0x7df1('0xc0')));_0x1deb97['use']('/api/square/details/reports',require('./api/squareReportDetail'));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xc1'),require(_0x7df1('0xc2')));_0x1deb97[_0x7df1('0x7')]('/api/settings',require(_0x7df1('0xc3')));_0x1deb97['use'](_0x7df1('0xc4'),require(_0x7df1('0xc5')));_0x1deb97[_0x7df1('0x7')]('/api/square/projects',require(_0x7df1('0xc6')));_0x1deb97['use'](_0x7df1('0xc7'),require(_0x7df1('0xc8')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xc9'),require(_0x7df1('0xca')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xcb'),require('./api/team'));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xcc'),require(_0x7df1('0xcd')));_0x1deb97['use'](_0x7df1('0xce'),require(_0x7df1('0xcf')));_0x1deb97['use'](_0x7df1('0xd0'),require(_0x7df1('0xd1')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xd2'),require(_0x7df1('0xd3')));_0x1deb97[_0x7df1('0x7')]('/api/plugins',require('./api/plugin'));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xd4'),require('./api/mailTransferReport'));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xd5'),require(_0x7df1('0xd6')));_0x1deb97[_0x7df1('0x7')]('/api/fax/reports/transfer',require(_0x7df1('0xd7')));_0x1deb97[_0x7df1('0x7')]('/api/openchannel/reports/transfer',require(_0x7df1('0xd8')));_0x1deb97['use'](_0x7df1('0xd9'),require('./api/smsTransferReport'));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xda'),require(_0x7df1('0xdb')));_0x1deb97[_0x7df1('0x7')]('/api/voice/prefixes',require(_0x7df1('0xdc')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xdd'),require('./api/userProfile'));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xde'),require(_0x7df1('0xdf')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xe0'),require(_0x7df1('0xe1')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xe2'),require(_0x7df1('0xe3')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xe4'),require('./api/whatsappAccount'));_0x1deb97['use']('/api/whatsapp/applications',require(_0x7df1('0xe5')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xe6'),require(_0x7df1('0xe7')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xe8'),require('./api/whatsappMessage'));_0x1deb97['use'](_0x7df1('0xe9'),require(_0x7df1('0xea')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xeb'),require(_0x7df1('0xec')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xed'),require('./api/whatsappQueue'));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xee'),require('./api/cloudProvider'));_0x1deb97['use']('/api/realtime',require(_0x7df1('0xef')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xf0'),require(_0x7df1('0xf1')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xf2'),require(_0x7df1('0xf3')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xf4'),require(_0x7df1('0xf5')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xf6'),require(_0x7df1('0xf7')));_0x1deb97['use']('/api/jira',require(_0x7df1('0xf8')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xf9'),require('./api/rpc'));_0x1deb97['use'](_0x7df1('0xfa'),require(_0x7df1('0xfb')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xfc'),require(_0x7df1('0xfd')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0xfe'),require(_0x7df1('0xff')));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x100'),require(_0x7df1('0x101')));_0x1deb97['use']('/api/logs',clientSideLogs);_0x1deb97[_0x7df1('0x7')](_0x7df1('0x102'),express[_0x7df1('0x103')](path[_0x7df1('0x104')](config[_0x7df1('0x105')],_0x7df1('0x102'))));_0x1deb97[_0x7df1('0x7')]('/www',express[_0x7df1('0x103')](path[_0x7df1('0x104')](config[_0x7df1('0x105')],_0x7df1('0x106'))));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x107'),express[_0x7df1('0x103')](path[_0x7df1('0x104')](config['root'],_0x7df1('0x107'))));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x108'),express[_0x7df1('0x103')](path['join'](config[_0x7df1('0x105')],_0x7df1('0x109'),_0x7df1('0x10a'))));_0x1deb97[_0x7df1('0x7')](_0x7df1('0x10b'),express[_0x7df1('0x103')](path['join'](config[_0x7df1('0x105')],_0x7df1('0x10c'))));_0x1deb97[_0x7df1('0x10d')](_0x7df1('0x10e'))['get'](errors[0x194]);_0x1deb97['route']('/*')[_0x7df1('0x10f')](function(_0x33a49a,_0x1eea75){_0x1eea75[_0x7df1('0x110')](path[_0x7df1('0x111')](_0x1deb97[_0x7df1('0x10f')](_0x7df1('0x112'))+_0x7df1('0x113')));});return _0x1deb97;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 4f81553..3fa0f74 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb935=['../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','rpc','port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','lodash','../config/environment','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc'];(function(_0x54fe9c,_0x22a84){var _0x29224b=function(_0x45eb24){while(--_0x45eb24){_0x54fe9c['push'](_0x54fe9c['shift']());}};_0x29224b(++_0x22a84);}(_0xb935,0xb0));var _0x5b93=function(_0x1b3134,_0x4b66d6){_0x1b3134=_0x1b3134-0x0;var _0x394d04=_0xb935[_0x1b3134];return _0x394d04;};'use strict';var jayson=require('jayson/promise');var _=require(_0x5b93('0x0'));var config=require(_0x5b93('0x1'));exports['listen']=function(){return new Promise(function(_0x51de7e,_0x519448){var _0x3d8461={};_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x3')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x4')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x5')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x6')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x7')));_0x3d8461=_['merge'](_0x3d8461,require(_0x5b93('0x8')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x9')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require('../api/memberReport/memberReport.rpc'));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0xa')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0xb')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0xc')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0xd')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0xe')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require('../api/mailQueue/mailQueue.rpc'));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0xf')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x10')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x11')));_0x3d8461=_['merge'](_0x3d8461,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require('../api/faxAccount/faxAccount.rpc'));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require('../api/faxApplication/faxApplication.rpc'));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require('../api/faxInteraction/faxInteraction.rpc'));_0x3d8461=_['merge'](_0x3d8461,require(_0x5b93('0x12')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x13')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x14')));_0x3d8461=_['merge'](_0x3d8461,require('../api/smsAccount/smsAccount.rpc'));_0x3d8461=_['merge'](_0x3d8461,require(_0x5b93('0x15')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x16')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require('../api/smsQueue/smsQueue.rpc'));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x17')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x18')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x19')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x1a')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x1b')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require('../api/chatInteraction/chatInteraction.rpc'));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x1c')));_0x3d8461=_['merge'](_0x3d8461,require('../api/chatQueue/chatQueue.rpc'));_0x3d8461=_['merge'](_0x3d8461,require(_0x5b93('0x1d')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x1e')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x3d8461=_['merge'](_0x3d8461,require(_0x5b93('0x1f')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x20')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x21')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require('../api/interval/interval.rpc'));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x22')));_0x3d8461=_['merge'](_0x3d8461,require('../api/sound/sound.rpc'));_0x3d8461=_['merge'](_0x3d8461,require(_0x5b93('0x23')));_0x3d8461=_['merge'](_0x3d8461,require(_0x5b93('0x24')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require('../api/trigger/trigger.rpc'));_0x3d8461=_['merge'](_0x3d8461,require(_0x5b93('0x25')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x26')));_0x3d8461=_['merge'](_0x3d8461,require(_0x5b93('0x27')));_0x3d8461=_['merge'](_0x3d8461,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x28')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x29')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x2a')));_0x3d8461=_['merge'](_0x3d8461,require(_0x5b93('0x2b')));_0x3d8461=_['merge'](_0x3d8461,require(_0x5b93('0x2c')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x2d')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x2e')));_0x3d8461=_['merge'](_0x3d8461,require(_0x5b93('0x2f')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x30')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x31')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x32')));_0x3d8461=_['merge'](_0x3d8461,require(_0x5b93('0x33')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x34')));_0x3d8461=_['merge'](_0x3d8461,require(_0x5b93('0x35')));_0x3d8461=_['merge'](_0x3d8461,require(_0x5b93('0x36')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require('../api/attachment/attachment.rpc'));_0x3d8461=_['merge'](_0x3d8461,require(_0x5b93('0x37')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x38')));_0x3d8461=_['merge'](_0x3d8461,require(_0x5b93('0x39')));_0x3d8461=_[_0x5b93('0x2')](_0x3d8461,require(_0x5b93('0x3a')));_0x3d8461=_['merge'](_0x3d8461,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x136aab=jayson['server'](_0x3d8461)['http']();var _0x2af42b=config[_0x5b93('0x3b')][_0x5b93('0x3c')]||config['port']+0x1;var _0x413a9c=config[_0x5b93('0x3b')]['ip']||_0x5b93('0x3d');_0x136aab['on'](_0x5b93('0x3e'),function(_0x263b1b){return _0x519448(_0x263b1b);});_0x136aab['listen'](_0x2af42b,_0x413a9c,function(){console['log'](_0x5b93('0x3f'),_0x413a9c,_0x2af42b);require(_0x5b93('0x40'))['default']();return _0x51de7e(_0x5b93('0x41')+_0x413a9c+':'+_0x2af42b);});});}; \ No newline at end of file +var _0x64cb=['../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueueReport/openchannelQueueReport.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/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.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/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/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','lodash','../config/environment','merge','../api/user/user.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc'];(function(_0x3b420b,_0x1881f4){var _0x13ec33=function(_0x53d717){while(--_0x53d717){_0x3b420b['push'](_0x3b420b['shift']());}};_0x13ec33(++_0x1881f4);}(_0x64cb,0x163));var _0xb64c=function(_0x2e64f6,_0x266fc7){_0x2e64f6=_0x2e64f6-0x0;var _0x584998=_0x64cb[_0x2e64f6];return _0x584998;};'use strict';var jayson=require('jayson/promise');var _=require(_0xb64c('0x0'));var config=require(_0xb64c('0x1'));exports['listen']=function(){return new Promise(function(_0x31ec5d,_0x596532){var _0x159475={};_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x3')));_0x159475=_['merge'](_0x159475,require('../api/voiceExtension/voiceExtension.rpc'));_0x159475=_[_0xb64c('0x2')](_0x159475,require('../api/voiceQueue/voiceQueue.rpc'));_0x159475=_['merge'](_0x159475,require(_0xb64c('0x4')));_0x159475=_[_0xb64c('0x2')](_0x159475,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x159475=_['merge'](_0x159475,require(_0xb64c('0x5')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x6')));_0x159475=_[_0xb64c('0x2')](_0x159475,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x7')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x8')));_0x159475=_[_0xb64c('0x2')](_0x159475,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x159475=_['merge'](_0x159475,require(_0xb64c('0x9')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0xa')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0xb')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0xc')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0xd')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0xe')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0xf')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x10')));_0x159475=_['merge'](_0x159475,require('../api/faxAccount/faxAccount.rpc'));_0x159475=_['merge'](_0x159475,require(_0xb64c('0x11')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x12')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x13')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x14')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x15')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x16')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x17')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x18')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x19')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x1a')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x1b')));_0x159475=_[_0xb64c('0x2')](_0x159475,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x159475=_['merge'](_0x159475,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x1c')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x1d')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x1e')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x1f')));_0x159475=_['merge'](_0x159475,require(_0xb64c('0x20')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x21')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x22')));_0x159475=_['merge'](_0x159475,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x159475=_[_0xb64c('0x2')](_0x159475,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x23')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x24')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x25')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x26')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x27')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x28')));_0x159475=_[_0xb64c('0x2')](_0x159475,require('../api/trigger/trigger.rpc'));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x29')));_0x159475=_['merge'](_0x159475,require(_0xb64c('0x2a')));_0x159475=_[_0xb64c('0x2')](_0x159475,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x159475=_['merge'](_0x159475,require(_0xb64c('0x2b')));_0x159475=_[_0xb64c('0x2')](_0x159475,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x2c')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x2d')));_0x159475=_[_0xb64c('0x2')](_0x159475,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x2e')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x2f')));_0x159475=_['merge'](_0x159475,require(_0xb64c('0x30')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x31')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x32')));_0x159475=_[_0xb64c('0x2')](_0x159475,require('../api/squareReport/squareReport.rpc'));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x33')));_0x159475=_['merge'](_0x159475,require('../api/setting/setting.rpc'));_0x159475=_['merge'](_0x159475,require(_0xb64c('0x34')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x35')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x36')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x37')));_0x159475=_['merge'](_0x159475,require(_0xb64c('0x38')));_0x159475=_['merge'](_0x159475,require('../api/attachment/attachment.rpc'));_0x159475=_['merge'](_0x159475,require(_0xb64c('0x39')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x3a')));_0x159475=_[_0xb64c('0x2')](_0x159475,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x3b')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x3c')));_0x159475=_[_0xb64c('0x2')](_0x159475,require(_0xb64c('0x3d')));var _0x4387c1=jayson[_0xb64c('0x3e')](_0x159475)[_0xb64c('0x3f')]();var _0x11db0b=config[_0xb64c('0x40')][_0xb64c('0x41')]||config[_0xb64c('0x41')]+0x1;var _0x37d719=config[_0xb64c('0x40')]['ip']||_0xb64c('0x42');_0x4387c1['on'](_0xb64c('0x43'),function(_0x32fcef){return _0x596532(_0x32fcef);});_0x4387c1[_0xb64c('0x44')](_0x11db0b,_0x37d719,function(){console[_0xb64c('0x45')](_0xb64c('0x46'),_0x37d719,_0x11db0b);require(_0xb64c('0x47'))[_0xb64c('0x48')]();return _0x31ec5d(_0xb64c('0x49')+_0x37d719+':'+_0x11db0b);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 9e90d6a..69416c6 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 _0xce14=['ready','line','toLowerCase','emit','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','split','length','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','answer','ANSWER','getData','beep','sendRequest','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','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','wait','WAIT','label','exports','lodash','EventEmitter','./reply','setEncoding','utf8','setTimeout','headers'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xce14,0x17f));var _0x4ce1=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xce14[_0xbca1b1];return _0x4e1686;};'use strict';var util=require('util');var _=require(_0x4ce1('0x0'));var EventEmitter=require('events')[_0x4ce1('0x1')];var AGIReply=require(_0x4ce1('0x2'));var AGIError=require('./error');function AGIChannel(_0x3d7bc5){var _0x7d84d1=this,_0xdd9af4=new AGIReply(),_0x2701cd=![],_0x869ee3={};EventEmitter['call'](_0x7d84d1);_0x3d7bc5[_0x4ce1('0x3')](_0x4ce1('0x4'));_0x3d7bc5[_0x4ce1('0x5')](0x8*0x3c*0x3c*0x3e8);_0xdd9af4[_0x4ce1('0x3')]('utf8');_0xdd9af4['on'](_0x4ce1('0x6'),function(_0x2beed4){for(var _0x1b87d1 in _0x2beed4){_0x7d84d1[_0x1b87d1]=_0x2beed4[_0x1b87d1];}_0x7d84d1['emit'](_0x4ce1('0x7'));});_0xdd9af4['on'](_0x4ce1('0x8'),function(_0x255dd0){if(_0x255dd0[_0x4ce1('0x9')]()=='hangup'){_0x7d84d1[_0x4ce1('0xa')](_0x4ce1('0xb'));return;}if(_0x255dd0[_0x4ce1('0xc')](0x0,0xb)==_0x4ce1('0xd')){_0x2701cd=!![];}if(_0x2701cd){_0x869ee3['rx']+=_0x255dd0+'\x0a';if(_0x255dd0['search'](_0x4ce1('0xe'))!=-0x1){_0x2701cd=![];}}else{_0x869ee3['rx']=_0x255dd0;}if(_0x2701cd){return;}if(typeof _0x869ee3['cb']==_0x4ce1('0xf')){var _0x1297d8=_0x869ee3['rx'][_0x4ce1('0xc')](0x0,0x3),_0x16dade=null,_0x171b8f=null;_0x1297d8=parseInt(_0x1297d8);if(isNaN(_0x1297d8)){_0x869ee3['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x4ce1('0x10')});return;}if(_0x1297d8!=0xc8){_0x869ee3['cb'](null,{'code':_0x1297d8,'result':-0x1,'extra':'KO'});return;}_0x16dade=_0x869ee3['rx'][_0x4ce1('0xc')](0x4)[_0x4ce1('0x11')](_0x4ce1('0x12'),'');if(_0x16dade[_0x4ce1('0x13')]('\x20')!=-0x1){_0x16dade=_0x16dade['substr'](0x0,_0x16dade[_0x4ce1('0x13')]('\x20'));}if(_['startsWith'](_0x16dade,'-1')){_0x16dade=parseInt(_0x16dade);}_0x171b8f=_0x869ee3['rx'][_0x4ce1('0x14')]('\x20');if(_0x171b8f[_0x4ce1('0x15')]==0x3){_0x171b8f=_0x171b8f[0x2][_0x4ce1('0xc')](0x1,_0x171b8f[0x2][_0x4ce1('0x15')]-0x1);}else if(_0x171b8f['length']>0x3){var _0x221306=/\((.+)\)/;var _0x503b05=_0x869ee3['rx']['match'](_0x221306);if(_0x503b05){_0x171b8f=_0x503b05[0x1];}else{_0x171b8f=null;}}else{_0x171b8f=null;}_0x869ee3['cb'](null,{'code':_0x1297d8,'result':_0x16dade,'extra':_0x171b8f});}});_0x3d7bc5['on']('error',function(_0xafda9e){_0x7d84d1[_0x4ce1('0xa')](_0x4ce1('0x16'),new AGIError(_0x4ce1('0x17'),_0xafda9e['code']));});_0x3d7bc5['on'](_0x4ce1('0x18'),function(){_0x7d84d1['emit']('close',new AGIError(_0x4ce1('0x19')));});_0x3d7bc5['on'](_0x4ce1('0x1a'),function(){_0x7d84d1[_0x4ce1('0xa')](_0x4ce1('0x1a'),new AGIError(_0x4ce1('0x1b')));_0x3d7bc5[_0x4ce1('0x1c')]();});_0x3d7bc5[_0x4ce1('0x1d')](_0xdd9af4);this[_0x4ce1('0x1e')]=function(_0x564280,_0x95457f){var _0x564280=_0x564280||'',_0x95457f=typeof _0x95457f==_0x4ce1('0xf')?_0x95457f:new Function();_0x869ee3={'tx':_0x564280,'rx':'','cb':_0x95457f};_0x3d7bc5[_0x4ce1('0x1f')](_0x564280+'\x0a');},this['close']=function(){_0x3d7bc5[_0x4ce1('0x1c')]();};}util[_0x4ce1('0x20')](AGIChannel,EventEmitter);AGIChannel['prototype']['sendRequest']=function(_0x555b05){return this[_0x4ce1('0x1e')]['sync'](this,_0x555b05);};AGIChannel[_0x4ce1('0x21')][_0x4ce1('0x22')]=function(){return this['sendRequest'](_0x4ce1('0x23'));};AGIChannel[_0x4ce1('0x21')][_0x4ce1('0x24')]=function(_0x7bca8c,_0x10a487,_0x1efe11){_0x7bca8c=_0x7bca8c===undefined?_0x4ce1('0x25'):_0x7bca8c;_0x10a487=_0x10a487===undefined?'5':_0x10a487;_0x1efe11=_0x1efe11===undefined?'1':_0x1efe11;return this[_0x4ce1('0x26')](util[_0x4ce1('0x27')](_0x4ce1('0x28'),_0x7bca8c,_0x10a487*0x3e8,_0x1efe11));};AGIChannel[_0x4ce1('0x21')][_0x4ce1('0x29')]=function(_0x4e895e){_0x4e895e=_0x4e895e||_0x4ce1('0x2a');return this[_0x4ce1('0x26')](util[_0x4ce1('0x27')](_0x4ce1('0x2b'),_0x4e895e));};AGIChannel[_0x4ce1('0x21')]['exec']=function(_0x2a9bc3,_0x355f10){if(_[_0x4ce1('0x2c')](_0x355f10)){return this[_0x4ce1('0x26')](util[_0x4ce1('0x27')](_0x4ce1('0x2d'),_0x2a9bc3,_0x355f10['join'](',')));}return this[_0x4ce1('0x26')](util[_0x4ce1('0x27')](_0x4ce1('0x2d'),_0x2a9bc3,_0x355f10));};AGIChannel['prototype']['setContext']=function(_0x23a14b){return this[_0x4ce1('0x26')](util[_0x4ce1('0x27')](_0x4ce1('0x2e'),_0x23a14b));};AGIChannel[_0x4ce1('0x21')][_0x4ce1('0x2f')]=function(_0x4905db){return this['sendRequest'](util[_0x4ce1('0x27')](_0x4ce1('0x30'),_0x4905db));};AGIChannel['prototype'][_0x4ce1('0x31')]=function(_0xbb6f5e){return this[_0x4ce1('0x26')](util[_0x4ce1('0x27')](_0x4ce1('0x32'),_0xbb6f5e));};AGIChannel[_0x4ce1('0x21')][_0x4ce1('0xb')]=function(){return this[_0x4ce1('0x26')](_0x4ce1('0x33'));};AGIChannel[_0x4ce1('0x21')][_0x4ce1('0x34')]=function(_0x547c72,_0x2825ee){var _0x26fd6e=_[_0x4ce1('0x35')](_0x2825ee)||_['isNumber'](_0x2825ee)?_0x2825ee['toString']():_0x2825ee;return this[_0x4ce1('0x26')](util['format'](_0x4ce1('0x36'),_0x547c72,_0x26fd6e?_0x26fd6e[_0x4ce1('0x37')]()[_0x4ce1('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x4ce1('0x21')][_0x4ce1('0x38')]=function(_0x24ef5e,_0x2a0ad6){return this['sendRequest'](util['format'](_0x4ce1('0x39'),_0x24ef5e,_0x2a0ad6));};AGIChannel[_0x4ce1('0x21')][_0x4ce1('0x3a')]=function(_0x140c19,_0x3a5dd5){return this[_0x4ce1('0x26')](util['format'](_0x4ce1('0x3b'),_0x140c19,_0x3a5dd5));};AGIChannel[_0x4ce1('0x21')][_0x4ce1('0x3c')]=function(_0x3f5d7d,_0x4dbf40){return this['sendRequest'](util[_0x4ce1('0x27')](_0x4ce1('0x3d'),_0x3f5d7d,_0x4dbf40));};AGIChannel[_0x4ce1('0x21')][_0x4ce1('0x3e')]=function(_0x16e7ac,_0x45866a,_0x347ea7){_0x45866a=_0x45866a||this[_0x4ce1('0x3f')];_0x347ea7=_0x347ea7||0x1;this['setContext'](_0x16e7ac);this[_0x4ce1('0x2f')](_0x45866a);this[_0x4ce1('0x31')](_0x347ea7);return this[_0x4ce1('0x29')](util[_0x4ce1('0x27')](_0x4ce1('0x40'),_0x16e7ac,_0x45866a,_0x347ea7));};AGIChannel[_0x4ce1('0x21')][_0x4ce1('0x41')]=function(_0x37b9af){return this['sendRequest'](util[_0x4ce1('0x27')](_0x4ce1('0x42'),_0x37b9af));};AGIChannel[_0x4ce1('0x21')][_0x4ce1('0x43')]=function(_0x142299,_0x420b2f,_0x18d78b,_0x3f1520,_0x3ca846,_0x5637f0){_0x420b2f=_0x420b2f||_0x4ce1('0x44');_0x18d78b=_0x18d78b||'';_0x3f1520=_0x3f1520===undefined?-0x1:_0x3f1520==='-1'?-0x1:_0x3f1520*0x3e8;_0x3ca846=_0x3ca846===undefined?'':'s='+_0x3ca846;_0x5637f0=_0x5637f0?_0x4ce1('0x45'):'';return this[_0x4ce1('0x26')](util['format'](_0x4ce1('0x46'),_0x142299,_0x420b2f,_0x18d78b,_0x3f1520,_0x5637f0,_0x3ca846));};AGIChannel[_0x4ce1('0x21')][_0x4ce1('0x47')]=function(_0x129210,_0x51e0bf){_0x51e0bf=_0x51e0bf||'';return this[_0x4ce1('0x26')](util[_0x4ce1('0x27')](_0x4ce1('0x48'),_0x129210,_0x51e0bf));};AGIChannel[_0x4ce1('0x21')]['agi']=function(_0x5ce7dd){return this[_0x4ce1('0x49')]('AGI',_0x5ce7dd);};AGIChannel[_0x4ce1('0x21')][_0x4ce1('0x4a')]=function(_0x1baceb){return this[_0x4ce1('0x49')](_0x4ce1('0x4b'),_0x1baceb);};AGIChannel[_0x4ce1('0x21')][_0x4ce1('0x16')]=function(_0x2d8430,_0x36d714){this['noop'](util[_0x4ce1('0x27')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x2d8430['id'],_0x2d8430[_0x4ce1('0x4c')],_0x36d714));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x4ce1('0x4d')]=AGIChannel; \ No newline at end of file +var _0xefcf=['command','answer','sendRequest','ANSWER','format','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20EXTENSION\x20%s','HANGUP','setVariable','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','wav','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','setEncoding','utf8','headers','emit','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','replace','result=','indexOf','substr','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','destroy','pipe','inherits','prototype'];(function(_0x1633e9,_0x50a939){var _0x549ace=function(_0x15a157){while(--_0x15a157){_0x1633e9['push'](_0x1633e9['shift']());}};_0x549ace(++_0x50a939);}(_0xefcf,0x184));var _0xfefc=function(_0x582628,_0x45dc5d){_0x582628=_0x582628-0x0;var _0x4dfea5=_0xefcf[_0x582628];return _0x4dfea5;};'use strict';var util=require(_0xfefc('0x0'));var _=require(_0xfefc('0x1'));var EventEmitter=require(_0xfefc('0x2'))[_0xfefc('0x3')];var AGIReply=require(_0xfefc('0x4'));var AGIError=require('./error');function AGIChannel(_0x4bd6e0){var _0x2f4df3=this,_0x461e23=new AGIReply(),_0x391434=![],_0x4a8d2c={};EventEmitter['call'](_0x2f4df3);_0x4bd6e0[_0xfefc('0x5')]('utf8');_0x4bd6e0['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x461e23[_0xfefc('0x5')](_0xfefc('0x6'));_0x461e23['on'](_0xfefc('0x7'),function(_0x379c9f){for(var _0x23e927 in _0x379c9f){_0x2f4df3[_0x23e927]=_0x379c9f[_0x23e927];}_0x2f4df3[_0xfefc('0x8')]('ready');});_0x461e23['on']('line',function(_0x1e6be7){if(_0x1e6be7[_0xfefc('0x9')]()==_0xfefc('0xa')){_0x2f4df3[_0xfefc('0x8')](_0xfefc('0xa'));return;}if(_0x1e6be7[_0xfefc('0xb')](0x0,0xb)==_0xfefc('0xc')){_0x391434=!![];}if(_0x391434){_0x4a8d2c['rx']+=_0x1e6be7+'\x0a';if(_0x1e6be7[_0xfefc('0xd')](_0xfefc('0xe'))!=-0x1){_0x391434=![];}}else{_0x4a8d2c['rx']=_0x1e6be7;}if(_0x391434){return;}if(typeof _0x4a8d2c['cb']==_0xfefc('0xf')){var _0x29090a=_0x4a8d2c['rx'][_0xfefc('0xb')](0x0,0x3),_0x16540c=null,_0x2f8cf3=null;_0x29090a=parseInt(_0x29090a);if(isNaN(_0x29090a)){_0x4a8d2c['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x29090a!=0xc8){_0x4a8d2c['cb'](null,{'code':_0x29090a,'result':-0x1,'extra':'KO'});return;}_0x16540c=_0x4a8d2c['rx'][_0xfefc('0xb')](0x4)[_0xfefc('0x10')](_0xfefc('0x11'),'');if(_0x16540c[_0xfefc('0x12')]('\x20')!=-0x1){_0x16540c=_0x16540c[_0xfefc('0x13')](0x0,_0x16540c['indexOf']('\x20'));}if(_['startsWith'](_0x16540c,'-1')){_0x16540c=parseInt(_0x16540c);}_0x2f8cf3=_0x4a8d2c['rx'][_0xfefc('0x14')]('\x20');if(_0x2f8cf3[_0xfefc('0x15')]==0x3){_0x2f8cf3=_0x2f8cf3[0x2][_0xfefc('0xb')](0x1,_0x2f8cf3[0x2][_0xfefc('0x15')]-0x1);}else if(_0x2f8cf3[_0xfefc('0x15')]>0x3){var _0x55a1b3=/\((.+)\)/;var _0x4adc53=_0x4a8d2c['rx'][_0xfefc('0x16')](_0x55a1b3);if(_0x4adc53){_0x2f8cf3=_0x4adc53[0x1];}else{_0x2f8cf3=null;}}else{_0x2f8cf3=null;}_0x4a8d2c['cb'](null,{'code':_0x29090a,'result':_0x16540c,'extra':_0x2f8cf3});}});_0x4bd6e0['on'](_0xfefc('0x17'),function(_0x387a23){_0x2f4df3[_0xfefc('0x8')](_0xfefc('0x17'),new AGIError(_0xfefc('0x18'),_0x387a23[_0xfefc('0x19')]));});_0x4bd6e0['on']('close',function(){_0x2f4df3[_0xfefc('0x8')](_0xfefc('0x1a'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x4bd6e0['on'](_0xfefc('0x1b'),function(){_0x2f4df3[_0xfefc('0x8')](_0xfefc('0x1b'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x4bd6e0[_0xfefc('0x1c')]();});_0x4bd6e0[_0xfefc('0x1d')](_0x461e23);this['command']=function(_0x20f25b,_0x3ebb8b){var _0x20f25b=_0x20f25b||'',_0x3ebb8b=typeof _0x3ebb8b==_0xfefc('0xf')?_0x3ebb8b:new Function();_0x4a8d2c={'tx':_0x20f25b,'rx':'','cb':_0x3ebb8b};_0x4bd6e0['write'](_0x20f25b+'\x0a');},this[_0xfefc('0x1a')]=function(){_0x4bd6e0[_0xfefc('0x1c')]();};}util[_0xfefc('0x1e')](AGIChannel,EventEmitter);AGIChannel[_0xfefc('0x1f')]['sendRequest']=function(_0x4e0f5e){return this[_0xfefc('0x20')]['sync'](this,_0x4e0f5e);};AGIChannel[_0xfefc('0x1f')][_0xfefc('0x21')]=function(){return this[_0xfefc('0x22')](_0xfefc('0x23'));};AGIChannel[_0xfefc('0x1f')]['getData']=function(_0xf303a3,_0x1d13b6,_0x4133aa){_0xf303a3=_0xf303a3===undefined?'beep':_0xf303a3;_0x1d13b6=_0x1d13b6===undefined?'5':_0x1d13b6;_0x4133aa=_0x4133aa===undefined?'1':_0x4133aa;return this[_0xfefc('0x22')](util[_0xfefc('0x24')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0xf303a3,_0x1d13b6*0x3e8,_0x4133aa));};AGIChannel[_0xfefc('0x1f')][_0xfefc('0x25')]=function(_0x361f46){_0x361f46=_0x361f46||_0xfefc('0x26');return this[_0xfefc('0x22')](util[_0xfefc('0x24')](_0xfefc('0x27'),_0x361f46));};AGIChannel[_0xfefc('0x1f')][_0xfefc('0x28')]=function(_0x39eddb,_0x27cbfb){if(_[_0xfefc('0x29')](_0x27cbfb)){return this['sendRequest'](util[_0xfefc('0x24')](_0xfefc('0x2a'),_0x39eddb,_0x27cbfb[_0xfefc('0x2b')](',')));}return this[_0xfefc('0x22')](util[_0xfefc('0x24')]('EXEC\x20%s\x20%s',_0x39eddb,_0x27cbfb));};AGIChannel[_0xfefc('0x1f')][_0xfefc('0x2c')]=function(_0x310aa8){return this['sendRequest'](util[_0xfefc('0x24')]('SET\x20CONTEXT\x20%s',_0x310aa8));};AGIChannel[_0xfefc('0x1f')][_0xfefc('0x2d')]=function(_0x19ca76){return this[_0xfefc('0x22')](util[_0xfefc('0x24')](_0xfefc('0x2e'),_0x19ca76));};AGIChannel['prototype']['setPriority']=function(_0x4dee60){return this[_0xfefc('0x22')](util[_0xfefc('0x24')]('SET\x20PRIORITY\x20%s',_0x4dee60));};AGIChannel[_0xfefc('0x1f')][_0xfefc('0xa')]=function(){return this[_0xfefc('0x22')](_0xfefc('0x2f'));};AGIChannel[_0xfefc('0x1f')][_0xfefc('0x30')]=function(_0x4e2836,_0x5c1f87){var _0x1c83b6=_[_0xfefc('0x31')](_0x5c1f87)||_[_0xfefc('0x32')](_0x5c1f87)?_0x5c1f87['toString']():_0x5c1f87;return this[_0xfefc('0x22')](util[_0xfefc('0x24')](_0xfefc('0x33'),_0x4e2836,_0x1c83b6?_0x1c83b6[_0xfefc('0x34')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xfefc('0x1f')]['sayNumber']=function(_0x19ad9f,_0x1017a3){return this[_0xfefc('0x22')](util['format'](_0xfefc('0x35'),_0x19ad9f,_0x1017a3));};AGIChannel[_0xfefc('0x1f')][_0xfefc('0x36')]=function(_0x1df5f3,_0x96dcd4){return this[_0xfefc('0x22')](util[_0xfefc('0x24')]('SAY\x20DIGITS\x20%s\x20%s',_0x1df5f3,_0x96dcd4));};AGIChannel[_0xfefc('0x1f')][_0xfefc('0x37')]=function(_0x5ed58a,_0x49651b){return this['sendRequest'](util[_0xfefc('0x24')](_0xfefc('0x38'),_0x5ed58a,_0x49651b));};AGIChannel['prototype'][_0xfefc('0x39')]=function(_0x593080,_0x564b92,_0x286689){_0x564b92=_0x564b92||this[_0xfefc('0x3a')];_0x286689=_0x286689||0x1;this['setContext'](_0x593080);this['setExtension'](_0x564b92);this['setPriority'](_0x286689);return this[_0xfefc('0x25')](util[_0xfefc('0x24')](_0xfefc('0x3b'),_0x593080,_0x564b92,_0x286689));};AGIChannel[_0xfefc('0x1f')]['getVariable']=function(_0x5c561d){return this[_0xfefc('0x22')](util[_0xfefc('0x24')](_0xfefc('0x3c'),_0x5c561d));};AGIChannel[_0xfefc('0x1f')]['recordFile']=function(_0x15d81d,_0x13c101,_0x339d4d,_0x16ce9d,_0x2a3e3d,_0x166363){_0x13c101=_0x13c101||_0xfefc('0x3d');_0x339d4d=_0x339d4d||'';_0x16ce9d=_0x16ce9d===undefined?-0x1:_0x16ce9d==='-1'?-0x1:_0x16ce9d*0x3e8;_0x2a3e3d=_0x2a3e3d===undefined?'':'s='+_0x2a3e3d;_0x166363=_0x166363?'BEEP':'';return this[_0xfefc('0x22')](util[_0xfefc('0x24')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x15d81d,_0x13c101,_0x339d4d,_0x16ce9d,_0x166363,_0x2a3e3d));};AGIChannel[_0xfefc('0x1f')][_0xfefc('0x3e')]=function(_0x52cbfc,_0x47eeab){_0x47eeab=_0x47eeab||'';return this[_0xfefc('0x22')](util['format'](_0xfefc('0x3f'),_0x52cbfc,_0x47eeab));};AGIChannel[_0xfefc('0x1f')]['agi']=function(_0x2c5746){return this[_0xfefc('0x28')](_0xfefc('0x40'),_0x2c5746);};AGIChannel[_0xfefc('0x1f')][_0xfefc('0x41')]=function(_0xdaada6){return this['exec'](_0xfefc('0x42'),_0xdaada6);};AGIChannel['prototype'][_0xfefc('0x17')]=function(_0x238af9,_0x22ec6a){this['noop'](util[_0xfefc('0x24')](_0xfefc('0x43'),_0x238af9['id'],_0x238af9[_0xfefc('0x44')],_0x22ec6a));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xfefc('0x45')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index a004e6e..ef9d917 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 _0xe84a=['Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','push','apply','message','exports','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xe84a,0xfe));var _0xae84=function(_0x3fd11f,_0x3f0c27){_0x3fd11f=_0x3fd11f-0x0;var _0x377c72=_0xe84a[_0x3fd11f];return _0x377c72;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0xae84('0x0'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xae84('0x1'),'E_AGI_SERVER_MAXCONNECTION':_0xae84('0x2'),'E_AGI_SERVER_VOICE_DISABLED':_0xae84('0x3'),'E_AGI_SOCKET_ERROR':_0xae84('0x4'),'E_AGI_SOCKET_CLOSE':_0xae84('0x5'),'E_AGI_SOCKET_TIMEOUT':_0xae84('0x6'),'E_AGI_COMMAND_EMPTY':_0xae84('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xae84('0x8')};function AGIError(_0x512047){var _0x512047=_0x512047||null,_0x315eb9=_0x315eb9||[],_0x2a4785=0x1,_0x3a9574='';if(!error[_0x512047]){_0x512047='E_AGI_UNDEFINED';}_0x315eb9['push'](error[_0x512047]);while(arguments[_0x2a4785]){_0x315eb9[_0xae84('0x9')](arguments[_0x2a4785]);_0x2a4785++;}_0x3a9574=util['format'][_0xae84('0xa')](util,_0x315eb9);this[_0xae84('0xb')]=_0x3a9574;this['name']=_0x512047;}module[_0xae84('0xc')]=AGIError; \ No newline at end of file +var _0x578b=['Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','message','name','util','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.'];(function(_0x3fdd72,_0xba5d1c){var _0x3e940f=function(_0x584d0c){while(--_0x584d0c){_0x3fdd72['push'](_0x3fdd72['shift']());}};_0x3e940f(++_0xba5d1c);}(_0x578b,0x19f));var _0xb578=function(_0x1433df,_0x1c1ddc){_0x1433df=_0x1433df-0x0;var _0x49fade=_0x578b[_0x1433df];return _0x49fade;};'use strict';var util=require(_0xb578('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xb578('0x1'),'E_AGI_SERVER_CLOSE':_0xb578('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0xb578('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0xb578('0x4'),'E_AGI_SOCKET_ERROR':_0xb578('0x5'),'E_AGI_SOCKET_CLOSE':_0xb578('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xb578('0x7'),'E_AGI_COMMAND_EMPTY':_0xb578('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xb578('0x9'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x2cf128){var _0x2cf128=_0x2cf128||null,_0x2b0ec1=_0x2b0ec1||[],_0x1aed7e=0x1,_0x4b6269='';if(!error[_0x2cf128]){_0x2cf128=_0xb578('0xa');}_0x2b0ec1[_0xb578('0xb')](error[_0x2cf128]);while(arguments[_0x1aed7e]){_0x2b0ec1['push'](arguments[_0x1aed7e]);_0x1aed7e++;}_0x4b6269=util[_0xb578('0xc')]['apply'](util,_0x2b0ec1);this[_0xb578('0xd')]=_0x4b6269;this[_0xb578('0xe')]=_0x2cf128;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index a5adfe6..4114726 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 _0xe868=['exports','lodash','events','EventEmitter','ioredis','./error','../../config/environment','defaults','redis','localhost','subscribe','agi','emit','error','E_AGI_SERVER_ERROR','message','projectUpdate'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0xe868,0x144));var _0x8e86=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe868[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8e86('0x0'));var EventEmitter=require(_0x8e86('0x1'))[_0x8e86('0x2')];var Redis=require(_0x8e86('0x3'));var AGIError=require(_0x8e86('0x4'));var config=require(_0x8e86('0x5'));config['redis']=_[_0x8e86('0x6')](config[_0x8e86('0x7')],{'host':_0x8e86('0x8'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x8e86('0x7')]);sub[_0x8e86('0x9')](_0x8e86('0xa'),function(_0x537bc0){if(_0x537bc0)return eventEmitter[_0x8e86('0xb')](_0x8e86('0xc'),new AGIError(_0x8e86('0xd'),_0x537bc0));});sub['on'](_0x8e86('0xe'),function(_0x11ed32,_0x41d0dd){if(_0x11ed32!==_0x8e86('0xa'))return;try{var _0x132b11=JSON['parse'](_0x41d0dd);eventEmitter[_0x8e86('0xb')](_0x8e86('0xf'),_0x132b11);}catch(_0x4109cf){eventEmitter[_0x8e86('0xb')](_0x8e86('0xc'),new AGIError(_0x8e86('0xd'),_0x4109cf));}});module[_0x8e86('0x10')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xaba8=['exports','EventEmitter','./error','redis','defaults','localhost','subscribe','emit','error','E_AGI_SERVER_ERROR','message','agi','parse','projectUpdate'];(function(_0x44cb92,_0x59afa3){var _0x56b9e6=function(_0x2841e0){while(--_0x2841e0){_0x44cb92['push'](_0x44cb92['shift']());}};_0x56b9e6(++_0x59afa3);}(_0xaba8,0x15f));var _0x8aba=function(_0x345f8a,_0x3095bc){_0x345f8a=_0x345f8a-0x0;var _0x25cac9=_0xaba8[_0x345f8a];return _0x25cac9;};'use strict';var _=require('lodash');var EventEmitter=require('events')[_0x8aba('0x0')];var Redis=require('ioredis');var AGIError=require(_0x8aba('0x1'));var config=require('../../config/environment');config[_0x8aba('0x2')]=_[_0x8aba('0x3')](config[_0x8aba('0x2')],{'host':_0x8aba('0x4'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x8aba('0x2')]);sub[_0x8aba('0x5')]('agi',function(_0x3175ea){if(_0x3175ea)return eventEmitter[_0x8aba('0x6')](_0x8aba('0x7'),new AGIError(_0x8aba('0x8'),_0x3175ea));});sub['on'](_0x8aba('0x9'),function(_0x1d4e95,_0x3c1cc6){if(_0x1d4e95!==_0x8aba('0xa'))return;try{var _0x5ed715=JSON[_0x8aba('0xb')](_0x3c1cc6);eventEmitter[_0x8aba('0x6')](_0x8aba('0xc'),_0x5ed715);}catch(_0x3c44af){eventEmitter[_0x8aba('0x6')](_0x8aba('0x7'),new AGIError(_0x8aba('0x8'),_0x3c44af));}});module[_0x8aba('0xd')]={'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 ecbc751..5a98b84 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 _0x8a5f=['condition','split','vswitch','default','target','agicommand','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','condition\x20not\x20found','../../../config/logger','agi','menu','getsecretdigits','vertices','edges','numberOfEdges','prototype','addEdge','push','size','relations','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available'];(function(_0x15fe21,_0x2a4dbe){var _0x2e5271=function(_0x40d41e){while(--_0x40d41e){_0x15fe21['push'](_0x15fe21['shift']());}};_0x2e5271(++_0x2a4dbe);}(_0x8a5f,0x1ef));var _0xf8a5=function(_0x333da0,_0x4782fe){_0x333da0=_0x333da0-0x0;var _0x403099=_0x8a5f[_0x333da0];return _0x403099;};'use strict';var _=require('lodash');var logger=require(_0xf8a5('0x0'))(_0xf8a5('0x1'));var verticesWithRetry=[_0xf8a5('0x2'),'getdigits',_0xf8a5('0x3')];var Graph=function(){this[_0xf8a5('0x4')]={};this[_0xf8a5('0x5')]={};this[_0xf8a5('0x6')]=0x0;};Graph['prototype']['addVertex']=function(_0x51a91c){this[_0xf8a5('0x4')][_0x51a91c['id']]=_0x51a91c;this['edges'][_0x51a91c['id']]=[];};Graph[_0xf8a5('0x7')][_0xf8a5('0x8')]=function(_0x1e78b3,_0xdb44a3,_0xf63779){this[_0xf8a5('0x5')][_0x1e78b3][_0xf8a5('0x9')]({'target':_0xdb44a3,'condition':_0xf63779});this[_0xf8a5('0x6')]+=0x1;};Graph[_0xf8a5('0x7')][_0xf8a5('0xa')]=function(){return _['size'](this[_0xf8a5('0x4')]);};Graph['prototype'][_0xf8a5('0xb')]=function(){return this['numberOfEdges'];};Graph[_0xf8a5('0x7')]['getVertex']=function(_0x1befff){return this[_0xf8a5('0x4')][_0x1befff];};Graph['prototype'][_0xf8a5('0xc')]=function(_0x1830c0,_0x3e8c4d){if(!this[_0xf8a5('0x4')][_0x1830c0]){return logger[_0xf8a5('0xd')](_0xf8a5('0xe'));}var _0x34220a=_0x3e8c4d(this[_0xf8a5('0x4')][_0x1830c0]);if(!_0x34220a){return logger[_0xf8a5('0xd')](_0xf8a5('0xf'));}if(this[_0xf8a5('0x5')][_0x1830c0][_0xf8a5('0x10')]===0x0){return logger[_0xf8a5('0xd')](_0xf8a5('0x11'));}for(var _0x1d7c02=0x0,_0x1adf49=[],_0x5a7498=![];_0x1d7c02\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','createSquareReport','catch','hasOwnProperty','substring','debug','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','hangup','find','handleNotFound','production','handleUnpublished','initialize','getLicense','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED'];(function(_0x168478,_0x323a27){var _0x29c2f8=function(_0x4f7a8a){while(--_0x4f7a8a){_0x168478['push'](_0x168478['shift']());}};_0x29c2f8(++_0x323a27);}(_0x7416,0x85));var _0x6741=function(_0x4efd3d,_0x2b9694){_0x4efd3d=_0x4efd3d-0x0;var _0x1293f2=_0x7416[_0x4efd3d];return _0x1293f2;};'use strict';var _=require(_0x6741('0x0'));var syncho=require(_0x6741('0x1'));var util=require(_0x6741('0x2'));var config=require(_0x6741('0x3'));var logger=require(_0x6741('0x4'))(_0x6741('0x5'));var utilLicense=require(_0x6741('0x6'));var rpc=require('./rpc');var Project=require(_0x6741('0x7'));var AGIEmitter=require('./events')[_0x6741('0x8')];var projects=[];config[_0x6741('0x5')]=_[_0x6741('0x9')](config[_0x6741('0x5')],{'ip':_0x6741('0xa'),'port':0x11dd});AGIEmitter['on'](_0x6741('0xb'),projectUpdateHandler);function connectionHandler(_0x4a6b55){process[_0x6741('0xc')](function(){syncho(function(){try{setChannelVariables(_0x4a6b55);agiHandler(_0x4a6b55);}catch(_0x16c77c){logger[_0x6741('0xd')](_0x16c77c[_0x6741('0xe')]);}});});}function projectUpdateHandler(_0xbe3fc2){try{var _0x63bf5a=_[_0x6741('0xf')](projects,['id',_0xbe3fc2['id']]);if(_0x63bf5a>-0x1){if(_0xbe3fc2[_0x6741('0x10')]===!![]){projects[_0x6741('0x11')](_0x63bf5a,0x1);}else{projects[_0x63bf5a]=_0xbe3fc2;}}else{projects[_0x6741('0x12')](_0xbe3fc2);}}catch(_0x15d241){logger[_0x6741('0xd')](_0x15d241['stack']);}}function listeningHandler(){console[_0x6741('0x13')](_0x6741('0x14'),config['agi'][_0x6741('0x15')]);logger[_0x6741('0x16')](util[_0x6741('0x17')](_0x6741('0x18'),config['agi']['ip'],config[_0x6741('0x5')][_0x6741('0x15')]));}function errorHandler(_0x24dbad){if(_0x24dbad&&_0x24dbad[_0x6741('0x19')]&&_0x24dbad[_0x6741('0x1a')]){logger['error'](util[_0x6741('0x17')](_0x6741('0x1b'),_0x24dbad[_0x6741('0x19')],_0x24dbad['message']));}else{logger[_0x6741('0xd')](util[_0x6741('0x17')](_0x6741('0x1c'),_0x24dbad[_0x6741('0xe')]));}}function closeHandler(){logger[_0x6741('0x16')](util[_0x6741('0x17')](_0x6741('0x1d'),this[_0x6741('0x1e')],this[_0x6741('0x1f')],this[_0x6741('0x20')],this[_0x6741('0x21')],this[_0x6741('0x22')]));try{createSquareReport(this);}catch(_0x5bbfb4){logger[_0x6741('0xd')](_0x5bbfb4[_0x6741('0xe')]);}}function timeoutHandler(){logger[_0x6741('0x16')](util[_0x6741('0x17')](_0x6741('0x23'),this[_0x6741('0x1e')],this[_0x6741('0x1f')],this[_0x6741('0x20')],this[_0x6741('0x21')],this[_0x6741('0x22')]));}function hangupHandler(){logger[_0x6741('0x16')](util[_0x6741('0x17')](_0x6741('0x24'),this[_0x6741('0x1e')],this[_0x6741('0x1f')],this[_0x6741('0x20')],this[_0x6741('0x21')],this['uniqueid']));this['evtHangup']=!![];}function createSquareReport(_0x347bf8,_0x3f245e){rpc[_0x6741('0x25')](_0x347bf8)['then'](function(_0x3f3e1c){if(_0x3f245e){_0x3f245e(null,_0x3f3e1c);}})[_0x6741('0x26')](function(_0x46e6c1){if(_0x3f245e){_0x3f245e(null,_0x46e6c1);}});}function setChannelVariables(_0x1d4c87){for(var _0x139707 in _0x1d4c87){if(_0x1d4c87[_0x6741('0x27')](_0x139707)){if(_0x139707['indexOf']('agi_')===0x0){_0x1d4c87[_0x139707[_0x6741('0x28')](0x4)]=_0x1d4c87[_0x139707];delete _0x1d4c87[_0x139707];}}}}function agiHandler(_0x59f715){logger[_0x6741('0x29')]('variables',JSON['stringify'](_0x59f715,null,0x2));logger[_0x6741('0x16')](util[_0x6741('0x17')](_0x6741('0x2a'),_0x59f715['arg_1'],_0x59f715['calleridname'],_0x59f715[_0x6741('0x20')],_0x59f715['dnid'],_0x59f715[_0x6741('0x22')]));_0x59f715['on'](_0x6741('0xd'),errorHandler);_0x59f715['on'](_0x6741('0x2b'),closeHandler);_0x59f715['on'](_0x6741('0x2c'),timeoutHandler);_0x59f715[_0x6741('0x2d')]=![];_0x59f715['on'](_0x6741('0x2e'),hangupHandler);var _0x13844c=_[_0x6741('0x2f')](projects,[_0x6741('0x19'),_0x59f715['arg_1']]);if(!_0x13844c)return Project[_0x6741('0x30')](_0x59f715);if(!_0x13844c[_0x6741('0x31')])return Project[_0x6741('0x32')](_0x59f715);return Project[_0x6741('0x33')](_0x13844c,_0x59f715);}function main(){var _0xc91658;return utilLicense[_0x6741('0x34')]()[_0x6741('0x35')](function(_0x4ba1b5){if(!_0x4ba1b5)return;if(_0x4ba1b5[_0x6741('0x36')]){if(_0x4ba1b5[_0x6741('0x37')]&&_0x4ba1b5[_0x6741('0x37')]>0x0){logger[_0x6741('0x16')](util[_0x6741('0x17')](_0x6741('0x38'),_0x4ba1b5['callysquare']));_0xc91658=_0x4ba1b5[_0x6741('0x37')];}else{logger[_0x6741('0x16')](_0x6741('0x39'));}}else{logger['info'](_0x6741('0x3a'));_0xc91658=-0x1;}})[_0x6741('0x35')](function(){return Project[_0x6741('0x3b')]();})[_0x6741('0x35')](function(_0x2808ad){projects=_0x2808ad;return;})[_0x6741('0x26')](function(_0x391b92){logger[_0x6741('0xd')](_0x6741('0x3c'),_0x391b92[_0x6741('0xe')]);})[_0x6741('0x3d')](function(){var _0xd4e402=require('./server')(config[_0x6741('0x5')][_0x6741('0x15')],config[_0x6741('0x5')]['ip'],_0xc91658);_0xd4e402['on'](_0x6741('0xd'),errorHandler);_0xd4e402['on'](_0x6741('0x3e'),listeningHandler);_0xd4e402['on'](_0x6741('0x3f'),connectionHandler);_0xd4e402['on'](_0x6741('0x2b'),closeHandler);});}main(); \ No newline at end of file +var _0x4c43=['EventEmitter','127.0.0.1','projectUpdate','nextTick','error','stack','findIndex','deleted','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','name','message','[%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','arg_1','calleridname','callerid','dnid','info','[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','evtHangup','then','catch','hasOwnProperty','indexOf','agi_','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','hangup','find','production','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','getAll','[LICENSE]','finally','./server','listening','connection','close','lodash','syncho','util','../../config/environment','../../config/logger','agi','./rpc','./project','./events'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x4c43,0x6f));var _0x34c4=function(_0x52bea4,_0x3b4489){_0x52bea4=_0x52bea4-0x0;var _0x22766d=_0x4c43[_0x52bea4];return _0x22766d;};'use strict';var _=require(_0x34c4('0x0'));var syncho=require(_0x34c4('0x1'));var util=require(_0x34c4('0x2'));var config=require(_0x34c4('0x3'));var logger=require(_0x34c4('0x4'))(_0x34c4('0x5'));var utilLicense=require('../../config/license/util');var rpc=require(_0x34c4('0x6'));var Project=require(_0x34c4('0x7'));var AGIEmitter=require(_0x34c4('0x8'))[_0x34c4('0x9')];var projects=[];config[_0x34c4('0x5')]=_['defaults'](config[_0x34c4('0x5')],{'ip':_0x34c4('0xa'),'port':0x11dd});AGIEmitter['on'](_0x34c4('0xb'),projectUpdateHandler);function connectionHandler(_0x20c0c8){process[_0x34c4('0xc')](function(){syncho(function(){try{setChannelVariables(_0x20c0c8);agiHandler(_0x20c0c8);}catch(_0x5e3458){logger[_0x34c4('0xd')](_0x5e3458[_0x34c4('0xe')]);}});});}function projectUpdateHandler(_0x141e3d){try{var _0x39d8ab=_[_0x34c4('0xf')](projects,['id',_0x141e3d['id']]);if(_0x39d8ab>-0x1){if(_0x141e3d[_0x34c4('0x10')]===!![]){projects['splice'](_0x39d8ab,0x1);}else{projects[_0x39d8ab]=_0x141e3d;}}else{projects[_0x34c4('0x11')](_0x141e3d);}}catch(_0x67707d){logger[_0x34c4('0xd')](_0x67707d[_0x34c4('0xe')]);}}function listeningHandler(){console[_0x34c4('0x12')](_0x34c4('0x13'),config[_0x34c4('0x5')][_0x34c4('0x14')]);logger['info'](util[_0x34c4('0x15')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x34c4('0x5')]['ip'],config['agi'][_0x34c4('0x14')]));}function errorHandler(_0x371093){if(_0x371093&&_0x371093[_0x34c4('0x16')]&&_0x371093[_0x34c4('0x17')]){logger[_0x34c4('0xd')](util[_0x34c4('0x15')](_0x34c4('0x18'),_0x371093['name'],_0x371093[_0x34c4('0x17')]));}else{logger['error'](util['format'](_0x34c4('0x19'),_0x371093[_0x34c4('0xe')]));}}function closeHandler(){logger['info'](util[_0x34c4('0x15')](_0x34c4('0x1a'),this[_0x34c4('0x1b')],this[_0x34c4('0x1c')],this[_0x34c4('0x1d')],this[_0x34c4('0x1e')],this['uniqueid']));try{createSquareReport(this);}catch(_0x6b2ce9){logger[_0x34c4('0xd')](_0x6b2ce9[_0x34c4('0xe')]);}}function timeoutHandler(){logger[_0x34c4('0x1f')](util[_0x34c4('0x15')](_0x34c4('0x20'),this[_0x34c4('0x1b')],this['calleridname'],this[_0x34c4('0x1d')],this[_0x34c4('0x1e')],this[_0x34c4('0x21')]));}function hangupHandler(){logger['info'](util[_0x34c4('0x15')](_0x34c4('0x22'),this[_0x34c4('0x1b')],this[_0x34c4('0x1c')],this[_0x34c4('0x1d')],this[_0x34c4('0x1e')],this[_0x34c4('0x21')]));this[_0x34c4('0x23')]=!![];}function createSquareReport(_0x448918,_0x58c7d6){rpc['createSquareReport'](_0x448918)[_0x34c4('0x24')](function(_0xc94aca){if(_0x58c7d6){_0x58c7d6(null,_0xc94aca);}})[_0x34c4('0x25')](function(_0x497d64){if(_0x58c7d6){_0x58c7d6(null,_0x497d64);}});}function setChannelVariables(_0x105d88){for(var _0x13a5ea in _0x105d88){if(_0x105d88[_0x34c4('0x26')](_0x13a5ea)){if(_0x13a5ea[_0x34c4('0x27')](_0x34c4('0x28'))===0x0){_0x105d88[_0x13a5ea[_0x34c4('0x29')](0x4)]=_0x105d88[_0x13a5ea];delete _0x105d88[_0x13a5ea];}}}}function agiHandler(_0x39954c){logger[_0x34c4('0x2a')](_0x34c4('0x2b'),JSON[_0x34c4('0x2c')](_0x39954c,null,0x2));logger[_0x34c4('0x1f')](util[_0x34c4('0x15')](_0x34c4('0x2d'),_0x39954c[_0x34c4('0x1b')],_0x39954c[_0x34c4('0x1c')],_0x39954c[_0x34c4('0x1d')],_0x39954c[_0x34c4('0x1e')],_0x39954c[_0x34c4('0x21')]));_0x39954c['on'](_0x34c4('0xd'),errorHandler);_0x39954c['on']('close',closeHandler);_0x39954c['on'](_0x34c4('0x2e'),timeoutHandler);_0x39954c['evtHangup']=![];_0x39954c['on'](_0x34c4('0x2f'),hangupHandler);var _0xe7d637=_[_0x34c4('0x30')](projects,[_0x34c4('0x16'),_0x39954c[_0x34c4('0x1b')]]);if(!_0xe7d637)return Project['handleNotFound'](_0x39954c);if(!_0xe7d637[_0x34c4('0x31')])return Project['handleUnpublished'](_0x39954c);return Project['initialize'](_0xe7d637,_0x39954c);}function main(){var _0x55ac73;return utilLicense[_0x34c4('0x32')]()[_0x34c4('0x24')](function(_0xc10ce2){if(!_0xc10ce2)return;if(_0xc10ce2['voice']){if(_0xc10ce2[_0x34c4('0x33')]&&_0xc10ce2[_0x34c4('0x33')]>0x0){logger[_0x34c4('0x1f')](util['format']('[LICENSE]\x20CHANNELS:\x20%s',_0xc10ce2[_0x34c4('0x33')]));_0x55ac73=_0xc10ce2[_0x34c4('0x33')];}else{logger[_0x34c4('0x1f')](_0x34c4('0x34'));}}else{logger[_0x34c4('0x1f')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x55ac73=-0x1;}})[_0x34c4('0x24')](function(){return Project[_0x34c4('0x35')]();})[_0x34c4('0x24')](function(_0x4bf3e3){projects=_0x4bf3e3;return;})[_0x34c4('0x25')](function(_0x549f42){logger[_0x34c4('0xd')](_0x34c4('0x36'),_0x549f42[_0x34c4('0xe')]);})[_0x34c4('0x37')](function(){var _0x2f87b8=require(_0x34c4('0x38'))(config[_0x34c4('0x5')][_0x34c4('0x14')],config['agi']['ip'],_0x55ac73);_0x2f87b8['on'](_0x34c4('0xd'),errorHandler);_0x2f87b8['on'](_0x34c4('0x39'),listeningHandler);_0x2f87b8['on'](_0x34c4('0x3a'),connectionHandler);_0x2f87b8['on'](_0x34c4('0x3b'),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 1ba0bec..6fa5342 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 _0xdfbe=['http','request','then','error','result','sendMailMessage','SendMail','bluebird'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0xdfbe,0xbf));var _0xedfb=function(_0x3d0d86,_0x11d56a){_0x3d0d86=_0x3d0d86-0x0;var _0x599fbf=_0xdfbe[_0x3d0d86];return _0x599fbf;};'use strict';var BPromise=require(_0xedfb('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0xedfb('0x1')]({'port':0x232b});function request(_0x16e947,_0x115d4e){return new BPromise(function(_0x594e3e,_0x497340){return client[_0xedfb('0x2')](_0x16e947,_0x115d4e)[_0xedfb('0x3')](function(_0x18ac03){if(_0x18ac03[_0xedfb('0x4')]){return _0x497340(_0x18ac03['error']['message']);}else{return _0x594e3e(_0x18ac03[_0xedfb('0x5')]);}})['catch'](function(_0x10107b){return _0x497340(_0x10107b);});});}exports[_0xedfb('0x6')]=function(_0xfd6e67,_0x5aa2fa){return request(_0xedfb('0x7'),{'account':_0xfd6e67,'message':_0x5aa2fa});}; \ No newline at end of file +var _0x5c2f=['request','error','message','result','sendMailMessage','SendMail','bluebird','jayson/promise','http'];(function(_0x5dbfbf,_0x5206bc){var _0x4910b6=function(_0x23a99c){while(--_0x23a99c){_0x5dbfbf['push'](_0x5dbfbf['shift']());}};_0x4910b6(++_0x5206bc);}(_0x5c2f,0xc3));var _0xf5c2=function(_0x23b57c,_0xdc7f98){_0x23b57c=_0x23b57c-0x0;var _0x4c3b1d=_0x5c2f[_0x23b57c];return _0x4c3b1d;};'use strict';var BPromise=require(_0xf5c2('0x0'));var jayson=require(_0xf5c2('0x1'));var client=jayson['client'][_0xf5c2('0x2')]({'port':0x232b});function request(_0x4f9a63,_0x472c73){return new BPromise(function(_0x383988,_0x50a29c){return client[_0xf5c2('0x3')](_0x4f9a63,_0x472c73)['then'](function(_0x1a29a1){if(_0x1a29a1['error']){return _0x50a29c(_0x1a29a1[_0xf5c2('0x4')][_0xf5c2('0x5')]);}else{return _0x383988(_0x1a29a1[_0xf5c2('0x6')]);}})['catch'](function(_0x245bff){return _0x50a29c(_0x245bff);});});}exports[_0xf5c2('0x7')]=function(_0x1bd35c,_0x488740){return request(_0xf5c2('0x8'),{'account':_0x1bd35c,'message':_0x488740});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index fa87495..d411241 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 _0xef2d=['vertex','agicommand','gotoc','info','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','evtHangup','toString','response','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','[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\x20found','exports','lodash','moment','xml2json','util','../../config/logger','agi','./rpc','./mailRpc','./graph','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','toJson','root','inspect','production','start','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','traverseBFS','clear'];(function(_0x333c09,_0x4f1a93){var _0x5bd428=function(_0x27c6f8){while(--_0x27c6f8){_0x333c09['push'](_0x333c09['shift']());}};_0x5bd428(++_0x4f1a93);}(_0xef2d,0x113));var _0xdef2=function(_0x27476a,_0x22e482){_0x27476a=_0x27476a-0x0;var _0xb7a57e=_0xef2d[_0x27476a];return _0xb7a57e;};'use strict';var _=require(_0xdef2('0x0'));var moment=require(_0xdef2('0x1'));var parser=require(_0xdef2('0x2'));var util=require(_0xdef2('0x3'));var logger=require(_0xdef2('0x4'))(_0xdef2('0x5'));var rpc=require(_0xdef2('0x6'));var mailRpc=require(_0xdef2('0x7'));var Graph=require(_0xdef2('0x8'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0xdef2('0x9')](function(_0x2f4dc6){logger[_0xdef2('0xa')](_0xdef2('0xb'),_0x2f4dc6[_0xdef2('0xc')]);return[];});}function addVertex(_0x54d99b,_0x53dc52,_0x300257){_0x53dc52['agicommand']=_0x300257;if(_0x53dc52['hasOwnProperty'](_0xdef2('0xd'))){_0x53dc52[_0xdef2('0xe')]=parseInt(_0x53dc52[_0xdef2('0xd')],0xa);}_0x54d99b[_0xdef2('0xf')](_[_0xdef2('0x10')](_0x53dc52,_0xdef2('0x11')));}function initGraph(_0x21c540,_0x3c9216){var _0x215d54=new Graph();for(var _0x542db6 in _0x21c540){if(_0x21c540['hasOwnProperty'](_0x542db6)){if(_[_0xdef2('0x12')](_0x21c540[_0x542db6])){for(var _0x334d83=0x0;_0x334d83<_0x21c540[_0x542db6][_0xdef2('0x13')];_0x334d83+=0x1){addVertex(_0x215d54,_0x21c540[_0x542db6][_0x334d83],_0x542db6);}}else{addVertex(_0x215d54,_0x21c540[_0x542db6],_0x542db6);}}}for(var _0x3bc9a2=0x0;_0x3bc9a2<_0x3c9216[_0xdef2('0x13')];_0x3bc9a2+=0x1){if(_0x3c9216[_0x3bc9a2][_0xdef2('0x14')]&&_0x3c9216[_0x3bc9a2][_0xdef2('0x15')]){_0x215d54[_0xdef2('0x16')](_0x3c9216[_0x3bc9a2][_0xdef2('0x14')],_0x3c9216[_0x3bc9a2][_0xdef2('0x15')],_0x3c9216[_0x3bc9a2][_0xdef2('0x17')]);}}return _0x215d54;}function getRoot(_0x3b83a4){return parser[_0xdef2('0x18')](_0x3b83a4,{'object':!![]})['mxGraphModel'][_0xdef2('0x19')];}function inspect(_0x173053){return util[_0xdef2('0x1a')](_0x173053,{'showHidden':![],'depth':null});}function initialize(_0x3c80dd,_0x307945){var _0x17c80d=getRoot(_0x3c80dd[_0xdef2('0x1b')]);if(!_0x17c80d||!_0x17c80d[_0xdef2('0x1c')])return;var _0x352659,_0x8decdb,_0x362f6c;logger[_0xdef2('0x1d')]('root',JSON[_0xdef2('0x1e')](_0x17c80d,null,0x2));_0x307945[_0xdef2('0x1f')]=moment()[_0xdef2('0x20')](_0xdef2('0x21'));_0x352659=initGraph(_[_0xdef2('0x10')](_0x17c80d,_0xdef2('0x11')),_0x17c80d['mxCell']);_0x8decdb=new Vertices(_0x307945,rpc,mailRpc);logger['info'](util[_0xdef2('0x20')](_0xdef2('0x22'),_0x307945[_0xdef2('0x23')],_0x307945[_0xdef2('0x24')],_0x307945['callerid'],_0x307945[_0xdef2('0x25')],_0x307945['uniqueid']));_0x352659[_0xdef2('0x26')](_0x17c80d[_0xdef2('0x1c')]['id'],function(_0x2e0a4f){try{_0x2e0a4f=_0x8decdb[_0xdef2('0x27')](_0x2e0a4f);logger[_0xdef2('0x1d')](_0xdef2('0x28'),JSON[_0xdef2('0x1e')](_0x2e0a4f,null,0x2));if(_0x2e0a4f[_0xdef2('0x29')]===_0xdef2('0x2a')){logger[_0xdef2('0x2b')](_0xdef2('0x2c'));_0x307945[_0xdef2('0x2d')]=_0x2e0a4f[_0xdef2('0x2d')]||_0x307945['context'];_0x307945[_0xdef2('0x2e')]=_0x2e0a4f[_0xdef2('0x2e')];_0x307945[_0xdef2('0x2f')]=_0x2e0a4f[_0xdef2('0x2f')]?_0x2e0a4f[_0xdef2('0x2f')]-0x1:0x1;return null;}else if(_0x2e0a4f&&_0x8decdb[_0x2e0a4f[_0xdef2('0x29')]]){_0x362f6c=_0x8decdb[_0x2e0a4f['agicommand']](_0x2e0a4f);logger[_0xdef2('0x2b')]('response',JSON[_0xdef2('0x1e')](_0x362f6c,null,0x2));if(_0x362f6c&&_0x362f6c[_0xdef2('0x30')]===AGI_CODE_SUCCESS&&_0x362f6c[_0xdef2('0x31')]!==AGI_RESULT_ERROR&&!_0x307945[_0xdef2('0x32')]){logger['debug']('response',inspect(_0x362f6c));return _['isUndefined'](_0x362f6c[_0xdef2('0x31')])?null:_0x362f6c['result'][_0xdef2('0x33')]();}else{logger[_0xdef2('0xa')](_0xdef2('0x34'),inspect(_0x362f6c));return null;}}else{logger[_0xdef2('0xa')](_0xdef2('0x35'));return null;}}catch(_0x4f356a){logger[_0xdef2('0xa')](_0x4f356a[_0xdef2('0xc')]);return null;}});if(_0x17c80d[_0xdef2('0x36')]){logger[_0xdef2('0x2b')](util['format'](_0xdef2('0x37'),_0x307945[_0xdef2('0x23')],_0x307945['calleridname'],_0x307945['callerid'],_0x307945[_0xdef2('0x25')],_0x307945[_0xdef2('0x38')]));_0x352659[_0xdef2('0x26')](_0x17c80d[_0xdef2('0x36')]['id'],function(_0x390f72){try{_0x390f72=_0x8decdb[_0xdef2('0x27')](_0x390f72);logger[_0xdef2('0x1d')](_0xdef2('0x28'),JSON[_0xdef2('0x1e')](_0x390f72,null,0x2));if(_0x390f72&&_0x8decdb[_0x390f72['agicommand']]){_0x362f6c=_0x8decdb[_0x390f72['agicommand']](_0x390f72);if(_0x362f6c){logger[_0xdef2('0x1d')](_0xdef2('0x34'),inspect(_0x362f6c));return _['isUndefined'](_0x362f6c[_0xdef2('0x31')])?null:_0x362f6c[_0xdef2('0x31')][_0xdef2('0x33')]();}else{logger[_0xdef2('0xa')]('response',inspect(_0x362f6c));return null;}}else{logger['error'](_0xdef2('0x35'));return null;}}catch(_0x59e25e){logger['error'](_0x59e25e[_0xdef2('0xc')]);return null;}});}logger[_0xdef2('0x2b')](util[_0xdef2('0x20')](_0xdef2('0x39'),_0x307945[_0xdef2('0x23')],_0x307945[_0xdef2('0x24')],_0x307945['callerid'],_0x307945[_0xdef2('0x25')],_0x307945['uniqueid']));logger[_0xdef2('0x2b')](util[_0xdef2('0x20')](_0xdef2('0x3a'),_0x307945[_0xdef2('0x2d')],_0x307945[_0xdef2('0x2e')],parseInt(_0x307945[_0xdef2('0x2f')],0xa)+0x1));_0x307945[_0xdef2('0x3b')](_0x307945[_0xdef2('0x2d')],_0x307945[_0xdef2('0x2e')],parseInt(_0x307945[_0xdef2('0x2f')],0xa)+0x1);_0x307945[_0xdef2('0x3c')]();}function handleNotFound(_0x391374){logger[_0xdef2('0xa')](util[_0xdef2('0x20')](_0xdef2('0x3d'),_0x391374[_0xdef2('0x23')]));_0x391374['continueAt'](_0x391374[_0xdef2('0x2d')],_0x391374[_0xdef2('0x2e')],parseInt(_0x391374[_0xdef2('0x2f')],0xa)+0x1);_0x391374[_0xdef2('0x3c')]();}function handleUnpublished(_0xd3c4f3){logger[_0xdef2('0xa')](util['format']('Project\x20%s\x20not\x20published',_0xd3c4f3[_0xdef2('0x23')]));_0xd3c4f3[_0xdef2('0x3b')](_0xd3c4f3[_0xdef2('0x2d')],_0xd3c4f3[_0xdef2('0x2e')],parseInt(_0xd3c4f3[_0xdef2('0x2f')],0xa)+0x1);_0xd3c4f3['close']();}module[_0xdef2('0x3e')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xf29f=['calleridname','callerid','dnid','uniqueid','traverseBFS','start','vertex','stringify','gotoc','info','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','evtHangup','isUndefined','result','toString','error','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','[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\x20found','Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','retry','addVertex','omit','hasOwnProperty','isArray','length','source','target','addEdge','value','toJson','mxGraphModel','root','inspect','debug','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','format','arg_1'];(function(_0x25756a,_0x503ffe){var _0x5e6b3f=function(_0x1ab3d9){while(--_0x1ab3d9){_0x25756a['push'](_0x25756a['shift']());}};_0x5e6b3f(++_0x503ffe);}(_0xf29f,0x1ac));var _0xff29=function(_0x460725,_0x408e6c){_0x460725=_0x460725-0x0;var _0x4321dc=_0xf29f[_0x460725];return _0x4321dc;};'use strict';var _=require(_0xff29('0x0'));var moment=require(_0xff29('0x1'));var parser=require(_0xff29('0x2'));var util=require('util');var logger=require(_0xff29('0x3'))(_0xff29('0x4'));var rpc=require(_0xff29('0x5'));var mailRpc=require(_0xff29('0x6'));var Graph=require(_0xff29('0x7'));var Vertices=require(_0xff29('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xff29('0x9')]()[_0xff29('0xa')](function(_0x46fdcf){logger['error'](_0xff29('0xb'),_0x46fdcf[_0xff29('0xc')]);return[];});}function addVertex(_0x183ea4,_0x49215c,_0x3d91d9){_0x49215c[_0xff29('0xd')]=_0x3d91d9;if(_0x49215c['hasOwnProperty'](_0xff29('0xe'))){_0x49215c['maxRetry']=parseInt(_0x49215c[_0xff29('0xe')],0xa);}_0x183ea4[_0xff29('0xf')](_[_0xff29('0x10')](_0x49215c,'mxCell'));}function initGraph(_0x2dc478,_0x2a44f0){var _0x2d74ce=new Graph();for(var _0x37ac9e in _0x2dc478){if(_0x2dc478[_0xff29('0x11')](_0x37ac9e)){if(_[_0xff29('0x12')](_0x2dc478[_0x37ac9e])){for(var _0x1052b9=0x0;_0x1052b9<_0x2dc478[_0x37ac9e][_0xff29('0x13')];_0x1052b9+=0x1){addVertex(_0x2d74ce,_0x2dc478[_0x37ac9e][_0x1052b9],_0x37ac9e);}}else{addVertex(_0x2d74ce,_0x2dc478[_0x37ac9e],_0x37ac9e);}}}for(var _0x49359c=0x0;_0x49359c<_0x2a44f0[_0xff29('0x13')];_0x49359c+=0x1){if(_0x2a44f0[_0x49359c][_0xff29('0x14')]&&_0x2a44f0[_0x49359c][_0xff29('0x15')]){_0x2d74ce[_0xff29('0x16')](_0x2a44f0[_0x49359c][_0xff29('0x14')],_0x2a44f0[_0x49359c][_0xff29('0x15')],_0x2a44f0[_0x49359c][_0xff29('0x17')]);}}return _0x2d74ce;}function getRoot(_0x5d233d){return parser[_0xff29('0x18')](_0x5d233d,{'object':!![]})[_0xff29('0x19')][_0xff29('0x1a')];}function inspect(_0xcf5549){return util[_0xff29('0x1b')](_0xcf5549,{'showHidden':![],'depth':null});}function initialize(_0x184438,_0xda5c48){var _0x16522=getRoot(_0x184438['production']);if(!_0x16522||!_0x16522['start'])return;var _0x43be6a,_0x17b542,_0xe8db44;logger[_0xff29('0x1c')](_0xff29('0x1a'),JSON['stringify'](_0x16522,null,0x2));_0xda5c48[_0xff29('0x1d')]=moment()['format'](_0xff29('0x1e'));_0x43be6a=initGraph(_[_0xff29('0x10')](_0x16522,_0xff29('0x1f')),_0x16522[_0xff29('0x1f')]);_0x17b542=new Vertices(_0xda5c48,rpc,mailRpc);logger['info'](util[_0xff29('0x20')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0xda5c48[_0xff29('0x21')],_0xda5c48[_0xff29('0x22')],_0xda5c48[_0xff29('0x23')],_0xda5c48[_0xff29('0x24')],_0xda5c48[_0xff29('0x25')]));_0x43be6a[_0xff29('0x26')](_0x16522[_0xff29('0x27')]['id'],function(_0xf52f66){try{_0xf52f66=_0x17b542['clear'](_0xf52f66);logger[_0xff29('0x1c')](_0xff29('0x28'),JSON[_0xff29('0x29')](_0xf52f66,null,0x2));if(_0xf52f66['agicommand']===_0xff29('0x2a')){logger[_0xff29('0x2b')](_0xff29('0x2c'));_0xda5c48['context']=_0xf52f66['context']||_0xda5c48[_0xff29('0x2d')];_0xda5c48[_0xff29('0x2e')]=_0xf52f66[_0xff29('0x2e')];_0xda5c48[_0xff29('0x2f')]=_0xf52f66[_0xff29('0x2f')]?_0xf52f66[_0xff29('0x2f')]-0x1:0x1;return null;}else if(_0xf52f66&&_0x17b542[_0xf52f66[_0xff29('0xd')]]){_0xe8db44=_0x17b542[_0xf52f66[_0xff29('0xd')]](_0xf52f66);logger[_0xff29('0x2b')](_0xff29('0x30'),JSON[_0xff29('0x29')](_0xe8db44,null,0x2));if(_0xe8db44&&_0xe8db44[_0xff29('0x31')]===AGI_CODE_SUCCESS&&_0xe8db44['result']!==AGI_RESULT_ERROR&&!_0xda5c48[_0xff29('0x32')]){logger[_0xff29('0x1c')]('response',inspect(_0xe8db44));return _[_0xff29('0x33')](_0xe8db44[_0xff29('0x34')])?null:_0xe8db44[_0xff29('0x34')][_0xff29('0x35')]();}else{logger[_0xff29('0x36')](_0xff29('0x30'),inspect(_0xe8db44));return null;}}else{logger[_0xff29('0x36')](_0xff29('0x37'));return null;}}catch(_0x1f0b5d){logger[_0xff29('0x36')](_0x1f0b5d[_0xff29('0xc')]);return null;}});if(_0x16522[_0xff29('0x38')]){logger[_0xff29('0x2b')](util[_0xff29('0x20')](_0xff29('0x39'),_0xda5c48[_0xff29('0x21')],_0xda5c48[_0xff29('0x22')],_0xda5c48[_0xff29('0x23')],_0xda5c48[_0xff29('0x24')],_0xda5c48[_0xff29('0x25')]));_0x43be6a[_0xff29('0x26')](_0x16522[_0xff29('0x38')]['id'],function(_0x17c856){try{_0x17c856=_0x17b542[_0xff29('0x3a')](_0x17c856);logger[_0xff29('0x1c')](_0xff29('0x28'),JSON[_0xff29('0x29')](_0x17c856,null,0x2));if(_0x17c856&&_0x17b542[_0x17c856[_0xff29('0xd')]]){_0xe8db44=_0x17b542[_0x17c856['agicommand']](_0x17c856);if(_0xe8db44){logger[_0xff29('0x1c')](_0xff29('0x30'),inspect(_0xe8db44));return _[_0xff29('0x33')](_0xe8db44[_0xff29('0x34')])?null:_0xe8db44['result'][_0xff29('0x35')]();}else{logger[_0xff29('0x36')]('response',inspect(_0xe8db44));return null;}}else{logger[_0xff29('0x36')]('agicommand\x20not\x20found');return null;}}catch(_0x43899a){logger[_0xff29('0x36')](_0x43899a['stack']);return null;}});}logger['info'](util['format'](_0xff29('0x3b'),_0xda5c48['arg_1'],_0xda5c48[_0xff29('0x22')],_0xda5c48['callerid'],_0xda5c48[_0xff29('0x24')],_0xda5c48[_0xff29('0x25')]));logger[_0xff29('0x2b')](util[_0xff29('0x20')](_0xff29('0x3c'),_0xda5c48[_0xff29('0x2d')],_0xda5c48[_0xff29('0x2e')],parseInt(_0xda5c48['priority'],0xa)+0x1));_0xda5c48[_0xff29('0x3d')](_0xda5c48[_0xff29('0x2d')],_0xda5c48['extension'],parseInt(_0xda5c48[_0xff29('0x2f')],0xa)+0x1);_0xda5c48[_0xff29('0x3e')]();}function handleNotFound(_0x4736f4){logger[_0xff29('0x36')](util[_0xff29('0x20')](_0xff29('0x3f'),_0x4736f4[_0xff29('0x21')]));_0x4736f4[_0xff29('0x3d')](_0x4736f4['context'],_0x4736f4['extension'],parseInt(_0x4736f4[_0xff29('0x2f')],0xa)+0x1);_0x4736f4[_0xff29('0x3e')]();}function handleUnpublished(_0x2d9c5a){logger['error'](util['format'](_0xff29('0x40'),_0x2d9c5a[_0xff29('0x21')]));_0x2d9c5a['continueAt'](_0x2d9c5a[_0xff29('0x2d')],_0x2d9c5a[_0xff29('0x2e')],parseInt(_0x2d9c5a[_0xff29('0x2f')],0xa)+0x1);_0x2d9c5a['close']();}module[_0xff29('0x41')]={'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 ae84250..aab8478 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 _0xfd39=['_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','indexOf','substring','length','split','trim','slice','emit','headers','line','exports','util','stream','Transform','call'];(function(_0xb11026,_0x1cb75e){var _0x455cbe=function(_0xa8347b){while(--_0xa8347b){_0xb11026['push'](_0xb11026['shift']());}};_0x455cbe(++_0x1cb75e);}(_0xfd39,0xec));var _0x9fd3=function(_0xba9c50,_0x11862e){_0xba9c50=_0xba9c50-0x0;var _0x3fd6cb=_0xfd39[_0xba9c50];return _0x3fd6cb;};'use strict';var util=require(_0x9fd3('0x0'));var Transform=require(_0x9fd3('0x1'))[_0x9fd3('0x2')];function AGIReply(_0x5a8e7a){Transform[_0x9fd3('0x3')](this,_0x5a8e7a);this[_0x9fd3('0x4')]='';this[_0x9fd3('0x5')]=![];}util[_0x9fd3('0x6')](AGIReply,Transform);AGIReply[_0x9fd3('0x7')][_0x9fd3('0x8')]=function(_0x87afc0,_0x5c744e,_0x1f5c02){var _0x25bae9='\x0a',_0x3d9828=['\x0a\x0a',_0x9fd3('0x9')],_0xb5504f=-0x1,_0x1f4d90=-0x1,_0x20121a='',_0x37731a=0x0,_0x4a262b='',_0xf00584='';this[_0x9fd3('0x4')]+=_0x87afc0['toString']();_0x4a262b=this[_0x9fd3('0x4')];if(!this[_0x9fd3('0x5')]){_0x37731a=0x0;while(_0x3d9828[_0x37731a]){while((_0x1f4d90=_0x4a262b[_0x9fd3('0xa')](_0x3d9828[_0x37731a]))!=-0x1){_0x20121a=_0x3d9828[_0x37731a];_0xf00584=_0x4a262b['substring'](0x0,_0x1f4d90);_0x4a262b=_0x4a262b[_0x9fd3('0xb')](_0x1f4d90+_0x20121a[_0x9fd3('0xc')]);var _0x4ea151=_0xf00584[_0x9fd3('0xd')](_0x25bae9),_0x1bf552=0x0,_0x2c11db={},_0x7e8f68='',_0x52dcae='',_0xfcd8a6=-0x1;while(_0x4ea151[_0x1bf552]){_0xfcd8a6=_0x4ea151[_0x1bf552][_0x9fd3('0xa')](':');if(_0xfcd8a6!=-0x1){_0x7e8f68=_0x4ea151[_0x1bf552]['slice'](0x0,_0xfcd8a6)[_0x9fd3('0xe')]();_0x52dcae=_0x4ea151[_0x1bf552][_0x9fd3('0xf')](_0xfcd8a6+0x1)[_0x9fd3('0xe')]();if(_0x7e8f68['length']>0x0){_0x2c11db[_0x7e8f68]=_0x52dcae;}}else{}_0x1bf552++;}this[_0x9fd3('0x10')](_0x9fd3('0x11'),_0x2c11db);this[_0x9fd3('0x5')]=!![];}_0x37731a++;}this['_localBuffer']=_0x4a262b;}else{while((_0xb5504f=_0x4a262b[_0x9fd3('0xa')](_0x25bae9))!=-0x1){_0xf00584=_0x4a262b[_0x9fd3('0xb')](0x0,_0xb5504f);this['emit'](_0x9fd3('0x12'),_0xf00584);_0x4a262b=_0x4a262b['substring'](_0xb5504f+_0x25bae9['length']);}this[_0x9fd3('0x4')]=_0x4a262b;}_0x1f5c02();};module[_0x9fd3('0x13')]=AGIReply; \ No newline at end of file +var _0x46aa=['\x0d\x0a\x0d\x0a','indexOf','substring','length','split','slice','trim','emit','headers','line','exports','util','stream','Transform','_localBuffer','_inBody','inherits','prototype','_transform'];(function(_0x11ba73,_0x492101){var _0xe1046e=function(_0x43b613){while(--_0x43b613){_0x11ba73['push'](_0x11ba73['shift']());}};_0xe1046e(++_0x492101);}(_0x46aa,0x90));var _0xa46a=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x46aa[_0x3fba9f];return _0x192cf1;};'use strict';var util=require(_0xa46a('0x0'));var Transform=require(_0xa46a('0x1'))[_0xa46a('0x2')];function AGIReply(_0x5ec776){Transform['call'](this,_0x5ec776);this[_0xa46a('0x3')]='';this[_0xa46a('0x4')]=![];}util[_0xa46a('0x5')](AGIReply,Transform);AGIReply[_0xa46a('0x6')][_0xa46a('0x7')]=function(_0x7f5238,_0x5a1a40,_0x17a0fc){var _0x598b49='\x0a',_0x2fb972=['\x0a\x0a',_0xa46a('0x8')],_0x44529e=-0x1,_0x23ab8f=-0x1,_0x34c66e='',_0x237932=0x0,_0x392091='',_0x79d489='';this[_0xa46a('0x3')]+=_0x7f5238['toString']();_0x392091=this['_localBuffer'];if(!this[_0xa46a('0x4')]){_0x237932=0x0;while(_0x2fb972[_0x237932]){while((_0x23ab8f=_0x392091[_0xa46a('0x9')](_0x2fb972[_0x237932]))!=-0x1){_0x34c66e=_0x2fb972[_0x237932];_0x79d489=_0x392091[_0xa46a('0xa')](0x0,_0x23ab8f);_0x392091=_0x392091[_0xa46a('0xa')](_0x23ab8f+_0x34c66e[_0xa46a('0xb')]);var _0x1993db=_0x79d489[_0xa46a('0xc')](_0x598b49),_0x144c3b=0x0,_0x55b51d={},_0x3fc908='',_0x277377='',_0x4db70b=-0x1;while(_0x1993db[_0x144c3b]){_0x4db70b=_0x1993db[_0x144c3b][_0xa46a('0x9')](':');if(_0x4db70b!=-0x1){_0x3fc908=_0x1993db[_0x144c3b][_0xa46a('0xd')](0x0,_0x4db70b)[_0xa46a('0xe')]();_0x277377=_0x1993db[_0x144c3b][_0xa46a('0xd')](_0x4db70b+0x1)[_0xa46a('0xe')]();if(_0x3fc908['length']>0x0){_0x55b51d[_0x3fc908]=_0x277377;}}else{}_0x144c3b++;}this[_0xa46a('0xf')](_0xa46a('0x10'),_0x55b51d);this[_0xa46a('0x4')]=!![];}_0x237932++;}this[_0xa46a('0x3')]=_0x392091;}else{while((_0x44529e=_0x392091['indexOf'](_0x598b49))!=-0x1){_0x79d489=_0x392091[_0xa46a('0xa')](0x0,_0x44529e);this['emit'](_0xa46a('0x11'),_0x79d489);_0x392091=_0x392091['substring'](_0x44529e+_0x598b49[_0xa46a('0xb')]);}this[_0xa46a('0x3')]=_0x392091;}_0x17a0fc();};module[_0xa46a('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 3d043bf..2c9aca3 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 _0x82f5=['production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','CloudProvider','name','email','getSquareProjectById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','getSoundById','ShowSound','save_name','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','format','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','http','request','then','error','result','getSquareProjects','GetSquareProjects'];(function(_0x3e0600,_0x9bb3c9){var _0x5e1117=function(_0x508ca2){while(--_0x508ca2){_0x3e0600['push'](_0x3e0600['shift']());}};_0x5e1117(++_0x9bb3c9);}(_0x82f5,0x15d));var _0x582f=function(_0x17b350,_0x4a1593){_0x17b350=_0x17b350-0x0;var _0x7ed871=_0x82f5[_0x17b350];return _0x7ed871;};'use strict';var _=require(_0x582f('0x0'));var moment=require(_0x582f('0x1'));var jayson=require(_0x582f('0x2'));var client=jayson[_0x582f('0x3')][_0x582f('0x4')]({'port':0x2329});function request(_0x5a8ca2,_0x4e1ebd){return new Promise(function(_0x22c0b1,_0x3f3bde){return client[_0x582f('0x5')](_0x5a8ca2,_0x4e1ebd)[_0x582f('0x6')](function(_0x292490){if(_0x292490[_0x582f('0x7')]){return _0x3f3bde(_0x292490[_0x582f('0x7')]['message']);}else{return _0x22c0b1(_0x292490[_0x582f('0x8')]);}})['catch'](function(_0x2cb791){return _0x3f3bde(_0x2cb791);});});}exports[_0x582f('0x9')]=function(){return request(_0x582f('0xa'),{'options':{'raw':![],'attributes':['id','name',_0x582f('0xb')]}});};exports[_0x582f('0xc')]=function(_0x57b83e){return request(_0x582f('0xd'),{'options':{'raw':![],'where':{'name':_0x57b83e},'attributes':[_0x582f('0xb')]}});};exports[_0x582f('0xe')]=function(_0xdf4366){return request(_0x582f('0xf'),{'options':{'raw':![],'where':{'id':_0xdf4366},'include':[{'model':'MailServerOut','as':'Smtp','include':[{'model':_0x582f('0x10'),'as':_0x582f('0x10')}]}],'attributes':['id',_0x582f('0x11'),_0x582f('0x12')],'smtp':!![]}});};exports[_0x582f('0x13')]=function(_0x4ccc6a){return request(_0x582f('0xd'),{'options':{'where':{'id':_0x4ccc6a},'attributes':[_0x582f('0x11')]}});};exports['getVoiceQueueById']=function(_0x2e9e37){return request(_0x582f('0x14'),{'options':{'where':{'id':_0x2e9e37},'attributes':[_0x582f('0x11')]}});};exports[_0x582f('0x15')]=function(_0x54c6c6){return request(_0x582f('0x16'),{'options':{'where':{'id':_0x54c6c6},'attributes':[_0x582f('0x11')]}});};exports[_0x582f('0x17')]=function(_0x115566){return request(_0x582f('0x18'),{'options':{'where':{'id':_0x115566},'attributes':[_0x582f('0x19')]}});};exports['getUserById']=function(_0x18a8a3){return request(_0x582f('0x1a'),{'options':{'where':{'id':_0x18a8a3},'attributes':[_0x582f('0x11')]}});};exports[_0x582f('0x1b')]=function(_0x5cabdf){return request(_0x582f('0x1c'),{'options':{'where':{'phone':_0x5cabdf[_0x582f('0x1d')]},'attributes':['id']}});};exports[_0x582f('0x1e')]=function(_0x56c2a6){return request('ShowTrunk',{'options':{'where':{'id':_0x56c2a6},'attributes':[_0x582f('0x11')]}});};exports[_0x582f('0x1f')]=function(_0x4d0dcc){return request(_0x582f('0x20'),{'options':{'where':{'id':_0x4d0dcc},'attributes':[_0x582f('0x21')]}});};exports['getIntervalById']=function(_0x25e4a8){return request(_0x582f('0x22'),{'options':{'raw':![],'where':{'id':_0x25e4a8},'include':[{'model':_0x582f('0x23'),'as':_0x582f('0x24')}]}});};exports[_0x582f('0x25')]=function(_0x3c74fe){return request('ShowSmsAccount',{'options':{'where':{'id':_0x3c74fe},'attributes':['id','name']}});};exports[_0x582f('0x26')]=function(_0x17da57){return request('CreateSmsMessage',{'body':_0x17da57});};exports[_0x582f('0x27')]=function(_0x22d01b){return request('CreateSquareDetailsReport',{'body':_0x22d01b});};exports[_0x582f('0x28')]=function(_0x4ea1ce){return request(_0x582f('0x29'),{'body':_['merge'](_0x4ea1ce,{'project_name':_0x4ea1ce[_0x582f('0x2a')],'prev_project_name':_0x4ea1ce['arg_2']||'','is_subproject':_0x4ea1ce['arg_2']?!![]:![],'leaveAt':moment()[_0x582f('0x2b')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x582f('0x2c')]=function(_0x1f09aa){return request(_0x582f('0x2d'),{'body':_0x1f09aa});};exports[_0x582f('0x2e')]=function(_0x3b3168){return request(_0x582f('0x2f'),{'body':_0x3b3168});};exports[_0x582f('0x30')]=function(_0xdef37f){return request(_0x582f('0x31'),{'options':{'raw':![],'where':{'phone':_0xdef37f[_0x582f('0x1d')],'ListId':_0xdef37f[_0x582f('0x32')]}}})[_0x582f('0x6')](function(_0x54bdbc){if(_0x54bdbc){return _0x54bdbc;}return request(_0x582f('0x33'),{'body':_0xdef37f});});};exports[_0x582f('0x34')]=function(_0x1a03da){return request('ShowPause',{'options':{'where':{'id':_0x1a03da},'attributes':[_0x582f('0x11')]}});};exports[_0x582f('0x35')]=function(_0x159ad7,_0x265ea5){return request(_0x582f('0x36'),{'body':{'interface':_0x265ea5},'options':{'where':_0x159ad7}});};exports[_0x582f('0x37')]=function(_0x582fc1,_0x40be85,_0x441583){return request(_0x582f('0x38'),{'body':{'type':_0x40be85,'uniqueid':_0x441583},'options':{'where':_0x582fc1}});};exports[_0x582f('0x39')]=function(_0x284e8a){return request('UnpauseUser',{'body':{},'options':{'where':_0x284e8a}});};exports[_0x582f('0x3a')]=function(_0xd78567){return request(_0x582f('0x3b'),{'body':{},'options':{'where':_0xd78567}});}; \ No newline at end of file +var _0xed1f=['jayson/promise','client','http','request','then','error','message','result','catch','GetSquareProjects','name','getSquareProject','production','ShowMailAccount','CloudProvider','email','ShowSquareProject','getVariableById','ShowVariable','dsn','getUserById','ShowUser','phone','ShowTrunk','getSoundById','save_name','getIntervalById','ShowInterval','Intervals','ShowSmsAccount','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ListId','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','LogoutUser','lodash','moment'];(function(_0x4708ec,_0x396470){var _0x1d1d9d=function(_0x4b5168){while(--_0x4b5168){_0x4708ec['push'](_0x4708ec['shift']());}};_0x1d1d9d(++_0x396470);}(_0xed1f,0x6a));var _0xfed1=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0xed1f[_0xfa634c];return _0x73e478;};'use strict';var _=require(_0xfed1('0x0'));var moment=require(_0xfed1('0x1'));var jayson=require(_0xfed1('0x2'));var client=jayson[_0xfed1('0x3')][_0xfed1('0x4')]({'port':0x2329});function request(_0x25f345,_0x1dd614){return new Promise(function(_0xa68587,_0x2209b3){return client[_0xfed1('0x5')](_0x25f345,_0x1dd614)[_0xfed1('0x6')](function(_0xd2c769){if(_0xd2c769[_0xfed1('0x7')]){return _0x2209b3(_0xd2c769[_0xfed1('0x7')][_0xfed1('0x8')]);}else{return _0xa68587(_0xd2c769[_0xfed1('0x9')]);}})[_0xfed1('0xa')](function(_0x2967ef){return _0x2209b3(_0x2967ef);});});}exports['getSquareProjects']=function(){return request(_0xfed1('0xb'),{'options':{'raw':![],'attributes':['id',_0xfed1('0xc'),'production']}});};exports[_0xfed1('0xd')]=function(_0x7bf48c){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x7bf48c},'attributes':[_0xfed1('0xe')]}});};exports['getMailAccountById']=function(_0x1c3f40){return request(_0xfed1('0xf'),{'options':{'raw':![],'where':{'id':_0x1c3f40},'include':[{'model':'MailServerOut','as':'Smtp','include':[{'model':_0xfed1('0x10'),'as':_0xfed1('0x10')}]}],'attributes':['id','name',_0xfed1('0x11')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x529b3d){return request(_0xfed1('0x12'),{'options':{'where':{'id':_0x529b3d},'attributes':[_0xfed1('0xc')]}});};exports['getVoiceQueueById']=function(_0x2dde3a){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x2dde3a},'attributes':['name']}});};exports[_0xfed1('0x13')]=function(_0x39aa0c){return request(_0xfed1('0x14'),{'options':{'where':{'id':_0x39aa0c},'attributes':[_0xfed1('0xc')]}});};exports['getSquareOdbcById']=function(_0x1a00f6){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x1a00f6},'attributes':[_0xfed1('0x15')]}});};exports[_0xfed1('0x16')]=function(_0x489a0f){return request(_0xfed1('0x17'),{'options':{'where':{'id':_0x489a0f},'attributes':[_0xfed1('0xc')]}});};exports['getContactByPhone']=function(_0x59509b){return request('GetContactByPhone',{'options':{'where':{'phone':_0x59509b[_0xfed1('0x18')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x201f18){return request(_0xfed1('0x19'),{'options':{'where':{'id':_0x201f18},'attributes':['name']}});};exports[_0xfed1('0x1a')]=function(_0x65f14b){return request('ShowSound',{'options':{'where':{'id':_0x65f14b},'attributes':[_0xfed1('0x1b')]}});};exports[_0xfed1('0x1c')]=function(_0xff4842){return request(_0xfed1('0x1d'),{'options':{'raw':![],'where':{'id':_0xff4842},'include':[{'model':'Interval','as':_0xfed1('0x1e')}]}});};exports['getSmsAccountById']=function(_0x446558){return request(_0xfed1('0x1f'),{'options':{'where':{'id':_0x446558},'attributes':['id',_0xfed1('0xc')]}});};exports['createSmsMessage']=function(_0x41d22c){return request('CreateSmsMessage',{'body':_0x41d22c});};exports[_0xfed1('0x20')]=function(_0x2793b7){return request(_0xfed1('0x21'),{'body':_0x2793b7});};exports[_0xfed1('0x22')]=function(_0x186ecc){return request(_0xfed1('0x23'),{'body':_['merge'](_0x186ecc,{'project_name':_0x186ecc[_0xfed1('0x24')],'prev_project_name':_0x186ecc[_0xfed1('0x25')]||'','is_subproject':_0x186ecc['arg_2']?!![]:![],'leaveAt':moment()[_0xfed1('0x26')](_0xfed1('0x27'))})});};exports[_0xfed1('0x28')]=function(_0x1d62c5){return request(_0xfed1('0x29'),{'body':_0x1d62c5});};exports[_0xfed1('0x2a')]=function(_0x583953){return request(_0xfed1('0x2b'),{'body':_0x583953});};exports['createCmContact']=function(_0x3106ee){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x3106ee['phone'],'ListId':_0x3106ee[_0xfed1('0x2c')]}}})[_0xfed1('0x6')](function(_0x2d334e){if(_0x2d334e){return _0x2d334e;}return request('CreateCmContact',{'body':_0x3106ee});});};exports[_0xfed1('0x2d')]=function(_0x437a25){return request(_0xfed1('0x2e'),{'options':{'where':{'id':_0x437a25},'attributes':[_0xfed1('0xc')]}});};exports[_0xfed1('0x2f')]=function(_0x30272b,_0x5ccc3a){return request(_0xfed1('0x30'),{'body':{'interface':_0x5ccc3a},'options':{'where':_0x30272b}});};exports[_0xfed1('0x31')]=function(_0x4fc309,_0x47a90c,_0x28bd98){return request(_0xfed1('0x32'),{'body':{'type':_0x47a90c,'uniqueid':_0x28bd98},'options':{'where':_0x4fc309}});};exports[_0xfed1('0x33')]=function(_0x71147f){return request(_0xfed1('0x34'),{'body':{},'options':{'where':_0x71147f}});};exports['agentLogout']=function(_0xecd1ec){return request(_0xfed1('0x35'),{'body':{},'options':{'where':_0xecd1ec}});}; \ 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 800e5d4..b899898 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 _0x52ad=['exports','./polly','./lex'];(function(_0x234d7e,_0x58c6d0){var _0x40cbc8=function(_0x5bd3fa){while(--_0x5bd3fa){_0x234d7e['push'](_0x234d7e['shift']());}};_0x40cbc8(++_0x58c6d0);}(_0x52ad,0x1d8));var _0xd52a=function(_0x528f0c,_0x3f9438){_0x528f0c=_0x528f0c-0x0;var _0x1d50e4=_0x52ad[_0x528f0c];return _0x1d50e4;};var polly=require(_0xd52a('0x0'));var lex=require(_0xd52a('0x1'));module[_0xd52a('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x5a99=['./polly','./lex','exports'];(function(_0x49965b,_0x58e1d8){var _0x9a8397=function(_0x39e322){while(--_0x39e322){_0x49965b['push'](_0x49965b['shift']());}};_0x9a8397(++_0x58e1d8);}(_0x5a99,0xc9));var _0x95a9=function(_0x5b6a89,_0x2c59e9){_0x5b6a89=_0x5b6a89-0x0;var _0x4c9bd1=_0x5a99[_0x5b6a89];return _0x4c9bd1;};var polly=require(_0x95a9('0x0'));var lex=require(_0x95a9('0x1'));module[_0x95a9('0x2')]={'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 e832dd6..bedce6f 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 _0x6f0d=['exports'];(function(_0x471d29,_0x13140a){var _0x1e8efe=function(_0x5522bf){while(--_0x5522bf){_0x471d29['push'](_0x471d29['shift']());}};_0x1e8efe(++_0x13140a);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x2032af,_0x28f498){_0x2032af=_0x2032af-0x0;var _0x37687a=_0x6f0d[_0x2032af];return _0x37687a;};'use strict';var lex=require('./lib/api');module[_0xd6f0('0x0')]=function(_0x64ebf2,_0xd1480,_0x107a8c,_0x573473,_0x275230,_0x135a93){return lex(_0x64ebf2,_0xd1480,_0x107a8c,_0x573473,_0x275230,_0x135a93);}; \ No newline at end of file +var _0x6f7a=['./lib/api','exports'];(function(_0x3e201c,_0x3b8d12){var _0x38d4c2=function(_0x56f740){while(--_0x56f740){_0x3e201c['push'](_0x3e201c['shift']());}};_0x38d4c2(++_0x3b8d12);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x6abfd8,_0x237377){_0x6abfd8=_0x6abfd8-0x0;var _0x6b0bcb=_0x6f7a[_0x6abfd8];return _0x6b0bcb;};'use strict';var lex=require(_0xa6f7('0x0'));module[_0xa6f7('0x1')]=function(_0x205e14,_0x982062,_0x4dd99d,_0x93614a,_0x407de3,_0x12ecb8){return lex(_0x205e14,_0x982062,_0x4dd99d,_0x93614a,_0x407de3,_0x12ecb8);}; \ 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 65e67e2..c4024fd 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(_0x55e8a1,_0x100c1d){var _0x53c991=function(_0x1fc0f9){while(--_0x1fc0f9){_0x55e8a1['push'](_0x55e8a1['shift']());}};_0x53c991(++_0x100c1d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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(_0x315db4,_0x198cf8){var _0x1d2020=function(_0x2e318b){while(--_0x2e318b){_0x315db4['push'](_0x315db4['shift']());}};_0x1d2020(++_0x198cf8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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 0e0c362..17ff605 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 _0x860e=['./lib/api','exports'];(function(_0xf52759,_0x1c41fd){var _0x4a9979=function(_0x197d5b){while(--_0x197d5b){_0xf52759['push'](_0xf52759['shift']());}};_0x4a9979(++_0x1c41fd);}(_0x860e,0x1aa));var _0xe860=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x860e[_0x2dafbe];return _0x58a45a;};'use strict';var polly=require(_0xe860('0x0'));module[_0xe860('0x1')]=function(_0x31e167,_0x33fe4d,_0x602aa4,_0x54c352,_0x3ff568,_0x5f07ff,_0x553b49){return polly(_0x31e167,_0x33fe4d,_0x602aa4,_0x54c352,_0x3ff568,_0x5f07ff,_0x553b49);}; \ No newline at end of file +var _0x7791=['exports','./lib/api'];(function(_0x3503e9,_0x2467fc){var _0x7ffc29=function(_0x2ef9c1){while(--_0x2ef9c1){_0x3503e9['push'](_0x3503e9['shift']());}};_0x7ffc29(++_0x2467fc);}(_0x7791,0xbd));var _0x1779=function(_0x4a944e,_0x194c7f){_0x4a944e=_0x4a944e-0x0;var _0x335e8d=_0x7791[_0x4a944e];return _0x335e8d;};'use strict';var polly=require(_0x1779('0x0'));module[_0x1779('0x1')]=function(_0x15e2fa,_0x3e2e56,_0xf6137b,_0x5e5063,_0xc436b8,_0xafa586,_0x249d4b){return polly(_0x15e2fa,_0x3e2e56,_0xf6137b,_0x5e5063,_0xc436b8,_0xafa586,_0x249d4b);}; \ 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 6f7e935..4cf23f8 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 _0x67c8=['aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','randomstring'];(function(_0x4de2c0,_0x4822ea){var _0x440f3d=function(_0x29efee){while(--_0x29efee){_0x4de2c0['push'](_0x4de2c0['shift']());}};_0x440f3d(++_0x4822ea);}(_0x67c8,0x180));var _0x867c=function(_0x3e20f1,_0x3ec524){_0x3e20f1=_0x3e20f1-0x0;var _0x100124=_0x67c8[_0x3e20f1];return _0x100124;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require('bluebird');var rs=require(_0x867c('0x0'));var AWS=require(_0x867c('0x1'));function pollyResult(_0x34562d,_0x4f96bb,_0x53bb7f){return new BPromise(function(_0x113736,_0x398b45){_0x34562d[_0x867c('0x2')](_0x4f96bb,function(_0x2da6fd,_0x55317f){if(_0x2da6fd){_0x398b45(_0x2da6fd);}else if(_0x55317f){if(_0x55317f[_0x867c('0x3')]instanceof Buffer){fs[_0x867c('0x4')](_0x53bb7f,_0x55317f[_0x867c('0x3')],function(_0x3a2273){if(_0x3a2273){_0x398b45(_0x3a2273);}else{_0x113736();}});}else{_0x398b45(new Error(_0x867c('0x5')));}}else{_0x398b45(new Error(_0x867c('0x6')));}});});}module[_0x867c('0x7')]=function(_0x2d277e,_0x18661f,_0x43c071,_0x224dee,_0x228323,_0x5c87e4,_0x19dc94){var _0x2afa94=new AWS[(_0x867c('0x8'))]({'accessKeyId':_0x2d277e,'secretAccessKey':_0x18661f,'region':_0x43c071});var _0x2c9f71={'Text':_0x228323,'TextType':_0x5c87e4||_0x867c('0x9'),'OutputFormat':_0x867c('0xa'),'VoiceId':_0x224dee};return pollyResult(_0x2afa94,_0x2c9f71,_0x19dc94);}; \ No newline at end of file +var _0x34b4=['synthesizeSpeech','AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','path','bluebird','aws-sdk'];(function(_0x5ee3e9,_0x2f8324){var _0x3afca2=function(_0x214f02){while(--_0x214f02){_0x5ee3e9['push'](_0x5ee3e9['shift']());}};_0x3afca2(++_0x2f8324);}(_0x34b4,0xba));var _0x434b=function(_0x51bacf,_0x2debc1){_0x51bacf=_0x51bacf-0x0;var _0x46abb0=_0x34b4[_0x51bacf];return _0x46abb0;};'use strict';var fs=require('fs');var path=require(_0x434b('0x0'));var BPromise=require(_0x434b('0x1'));var rs=require('randomstring');var AWS=require(_0x434b('0x2'));function pollyResult(_0x2871d1,_0x32b1ec,_0x43b2b6){return new BPromise(function(_0x5defc8,_0xe910ce){_0x2871d1[_0x434b('0x3')](_0x32b1ec,function(_0x3615c0,_0x35bee3){if(_0x3615c0){_0xe910ce(_0x3615c0);}else if(_0x35bee3){if(_0x35bee3[_0x434b('0x4')]instanceof Buffer){fs[_0x434b('0x5')](_0x43b2b6,_0x35bee3['AudioStream'],function(_0x3dd287){if(_0x3dd287){_0xe910ce(_0x3dd287);}else{_0x5defc8();}});}else{_0xe910ce(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0xe910ce(new Error(_0x434b('0x6')));}});});}module['exports']=function(_0x27acea,_0x1527d0,_0x49f056,_0xc7ed7f,_0x502d78,_0x2921da,_0xfeadde){var _0x36e330=new AWS[(_0x434b('0x7'))]({'accessKeyId':_0x27acea,'secretAccessKey':_0x1527d0,'region':_0x49f056});var _0xf29a9c={'Text':_0x502d78,'TextType':_0x2921da||_0x434b('0x8'),'OutputFormat':'mp3','VoiceId':_0xc7ed7f};return pollyResult(_0x36e330,_0xf29a9c,_0xfeadde);}; \ 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 8a93945..4829b79 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 _0x3707=['./lib/api','exports'];(function(_0x33430c,_0x4cc99c){var _0x31fcbf=function(_0x1f2d41){while(--_0x1f2d41){_0x33430c['push'](_0x33430c['shift']());}};_0x31fcbf(++_0x4cc99c);}(_0x3707,0x8c));var _0x7370=function(_0x23f2d4,_0xcd1f95){_0x23f2d4=_0x23f2d4-0x0;var _0x50f674=_0x3707[_0x23f2d4];return _0x50f674;};'use strict';var asr=require(_0x7370('0x0'));module[_0x7370('0x1')]=function(_0x253105,_0x74e547,_0x51ee85,_0x32b173){return asr(_0x253105,_0x74e547,_0x51ee85);}; \ No newline at end of file +var _0xba3e=['./lib/api'];(function(_0x5efe28,_0x410eb8){var _0x260c7a=function(_0x33f84b){while(--_0x33f84b){_0x5efe28['push'](_0x5efe28['shift']());}};_0x260c7a(++_0x410eb8);}(_0xba3e,0xa5));var _0xeba3=function(_0x1482d4,_0x22626a){_0x1482d4=_0x1482d4-0x0;var _0x1544dd=_0xba3e[_0x1482d4];return _0x1544dd;};'use strict';var asr=require(_0xeba3('0x0'));module['exports']=function(_0x431219,_0x4b3427,_0x426e0b,_0x4396d4){return asr(_0x431219,_0x4b3427,_0x426e0b);}; \ 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 f07a848..f392440 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 _0xb4e6=['length','filepath\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','url','https://speech.googleapis.com','exports','string'];(function(_0x28d8c0,_0x5ca531){var _0x257b01=function(_0x397cca){while(--_0x397cca){_0x28d8c0['push'](_0x28d8c0['shift']());}};_0x257b01(++_0x5ca531);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x239dba,_0x309e95){_0x239dba=_0x239dba-0x0;var _0x1ceb11=_0xb4e6[_0x239dba];return _0x1ceb11;};'use strict';var url=require(_0x6b4e('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0x6b4e('0x1');module[_0x6b4e('0x2')]=function(_0x365912,_0x25ffcb,_0x44e781){return new BPromise(function(_0x31e8ad,_0x1929b8){var _0x52313b;if(typeof _0x365912!==_0x6b4e('0x3')||_0x365912[_0x6b4e('0x4')]===0x0){return _0x1929b8(_0x6b4e('0x5'));}if(typeof _0x25ffcb!=='string'||_0x25ffcb[_0x6b4e('0x4')]===0x0){return _0x1929b8('key\x20should\x20be\x20a\x20string');}if(typeof _0x44e781!=='undefined'&&(typeof _0x44e781!==_0x6b4e('0x3')||_0x44e781['length']===0x0)){return _0x1929b8('lang\x20should\x20be\x20a\x20string');}try{_0x52313b=fs[_0x6b4e('0x6')](_0x365912)[_0x6b4e('0x7')](_0x6b4e('0x8'));}catch(_0x39ed74){return _0x1929b8(_0x39ed74);}return _0x31e8ad({'method':_0x6b4e('0x9'),'uri':host+_0x6b4e('0xa')+_0x25ffcb,'body':{'config':{'encoding':_0x6b4e('0xb'),'sampleRateHertz':'8000','languageCode':_0x44e781},'audio':{'content':_0x52313b}},'json':!![]});});}; \ No newline at end of file +var _0xd737=['8000','url','https://speech.googleapis.com','filepath\x20should\x20be\x20a\x20string','string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','base64','/v1/speech:recognize?key='];(function(_0x111669,_0x13c529){var _0xcbf2a9=function(_0x5b9656){while(--_0x5b9656){_0x111669['push'](_0x111669['shift']());}};_0xcbf2a9(++_0x13c529);}(_0xd737,0x85));var _0x7d73=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xd737[_0x4bfac3];return _0x15f0f2;};'use strict';var url=require(_0x7d73('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0x7d73('0x1');module['exports']=function(_0x1a6b12,_0x26854a,_0x2bd982){return new BPromise(function(_0x5cfa01,_0x5369be){var _0x3e19ad;if(typeof _0x1a6b12!=='string'||_0x1a6b12['length']===0x0){return _0x5369be(_0x7d73('0x2'));}if(typeof _0x26854a!==_0x7d73('0x3')||_0x26854a[_0x7d73('0x4')]===0x0){return _0x5369be(_0x7d73('0x5'));}if(typeof _0x2bd982!==_0x7d73('0x6')&&(typeof _0x2bd982!==_0x7d73('0x3')||_0x2bd982[_0x7d73('0x4')]===0x0)){return _0x5369be(_0x7d73('0x7'));}try{_0x3e19ad=fs['readFileSync'](_0x1a6b12)['toString'](_0x7d73('0x8'));}catch(_0x3252fc){return _0x5369be(_0x3252fc);}return _0x5cfa01({'method':'POST','uri':host+_0x7d73('0x9')+_0x26854a,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x7d73('0xa'),'languageCode':_0x2bd982},'audio':{'content':_0x3e19ad}},'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 10cb4be..6569252 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 asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file +var _0x6566=['./asr'];(function(_0x2bfe52,_0x43946e){var _0x1cf649=function(_0xc8300c){while(--_0xc8300c){_0x2bfe52['push'](_0x2bfe52['shift']());}};_0x1cf649(++_0x43946e);}(_0x6566,0x15c));var _0x6656=function(_0x3dea7d,_0x2cd4ea){_0x3dea7d=_0x3dea7d-0x0;var _0x53919a=_0x6566[_0x3dea7d];return _0x53919a;};var asr=require(_0x6656('0x0'));module['exports']={'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 e3d524f..431c056 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 _0xaccd=['split','readFileSync','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','tmp','.mp3','from','audioContent','chmodSync','.wav','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','POST','f.req=','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','length','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','name','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','displayName','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsLex','lex','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','sestekNDA','nda','channelData','CustomAction','AudioFromTts','Data','apiai-promise','bluebird','dialogflow','https','md5','querystring','request-promise','sox','google-tts-api','parse','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','get','statusCode','error','request\x20to\x20','statusMessage','createWriteStream','finish','info','close','unlink','pipe','end','path','\x20failed,\x20status\x20code\x20=\x20','data','wav','error\x20convert','start','resolve','generate','writeFileSync','then','777'];(function(_0x149c20,_0x386348){var _0x1f76af=function(_0x497e8f){while(--_0x497e8f){_0x149c20['push'](_0x149c20['shift']());}};_0x1f76af(++_0x386348);}(_0xaccd,0x167));var _0xdacc=function(_0x3b5e40,_0x3695a6){_0x3b5e40=_0x3b5e40-0x0;var _0x4899e6=_0xaccd[_0x3b5e40];return _0x4899e6;};'use strict';var apiai=require(_0xdacc('0x0'));var BPromise=require(_0xdacc('0x1'));var dialogflow=require(_0xdacc('0x2'));var fs=require('fs');var http=require('http');var https=require(_0xdacc('0x3'));var md5=require(_0xdacc('0x4'));var path=require('path');var querystring=require(_0xdacc('0x5'));var rp=require(_0xdacc('0x6'));var rs=require('randomstring');var sox=require(_0xdacc('0x7'));var tts=require(_0xdacc('0x8'));var urlParse=require('url')[_0xdacc('0x9')];var util=require('util');var aws=require(_0xdacc('0xa'));var google=require(_0xdacc('0xb'));var sestek=require(_0xdacc('0xc'));var tilde=require(_0xdacc('0xd'));var logger=require(_0xdacc('0xe'))(_0xdacc('0xf'));var ISPEECH_API=_0xdacc('0x10');function downloadFile(_0x2670e1,_0x4c6e99){return new BPromise(function(_0x407d7e,_0x900c30){var _0x230555=urlParse(_0x2670e1);var _0x8b7f3a=_0x230555[_0xdacc('0x11')]===_0xdacc('0x12')?https:http;var _0x7ebeae={'host':_0x230555[_0xdacc('0x13')],'path':_0x230555['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x8b7f3a[_0xdacc('0x14')](_0x7ebeae,function(_0x42ea42){if(_0x42ea42[_0xdacc('0x15')]!==0xc8){logger[_0xdacc('0x16')](_0xdacc('0x17')+_0x2670e1+'\x20failed,\x20status\x20code\x20=\x20'+_0x42ea42['statusCode']+'\x20('+_0x42ea42[_0xdacc('0x18')]+')');_0x900c30(new Error('request\x20to\x20'+_0x2670e1+'\x20failed,\x20status\x20code\x20=\x20'+_0x42ea42[_0xdacc('0x15')]+'\x20('+_0x42ea42[_0xdacc('0x18')]+')'));return;}var _0x48137a=fs[_0xdacc('0x19')](_0x4c6e99);_0x48137a['on'](_0xdacc('0x1a'),function(){logger[_0xdacc('0x1b')]('finish\x20download\x20file');_0x48137a[_0xdacc('0x1c')](_0x407d7e);});_0x48137a['on'](_0xdacc('0x16'),function(_0xa8c2ca){fs[_0xdacc('0x1d')](_0x4c6e99);logger[_0xdacc('0x16')]('download\x20error',_0xa8c2ca);_0x900c30(_0xa8c2ca);});_0x42ea42[_0xdacc('0x1e')](_0x48137a);})['on']('error',function(_0x2da272){logger[_0xdacc('0x16')](_0x2da272);_0x900c30(_0x2da272);})[_0xdacc('0x1f')]();});}function uploadFile(_0x478664){return new BPromise(function(_0x42877c,_0x3d0388){var _0x43a3a2=urlParse(_0x478664);var _0x31d3ba=_0x43a3a2[_0xdacc('0x11')]===_0xdacc('0x12')?https:http;var _0x461e71={'host':_0x43a3a2[_0xdacc('0x13')],'path':_0x43a3a2[_0xdacc('0x20')],'headers':{'user-agent':'WHAT_EVER'}};_0x31d3ba[_0xdacc('0x14')](_0x461e71,function(_0x3b8f10){if(_0x3b8f10[_0xdacc('0x15')]!==0xc8){_0x3d0388(new Error(_0xdacc('0x17')+_0x478664+_0xdacc('0x21')+_0x3b8f10[_0xdacc('0x15')]+'\x20('+_0x3b8f10[_0xdacc('0x18')]+')'));return;}var _0x4af22a='';_0x3b8f10['on'](_0xdacc('0x22'),function(_0x2420a4){_0x4af22a+=_0x2420a4;});_0x3b8f10['on']('end',function(){_0x42877c(_0x4af22a);});})['on'](_0xdacc('0x16'),function(_0x5e72f7){_0x3d0388(_0x5e72f7);})[_0xdacc('0x1f')]();});}function convertFile(_0x16b247,_0x34de43){return new BPromise(function(_0x5a6495,_0x416a79){var _0x3493f8=sox['transcode'](_0x16b247,_0x34de43,{'sampleRate':0x1f40,'format':_0xdacc('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3493f8['on'](_0xdacc('0x16'),function(_0x19942a){logger['error'](_0xdacc('0x24'),_0x19942a);_0x416a79(_0x19942a);});_0x3493f8['on']('end',function(){logger[_0xdacc('0x1b')]('finish\x20to\x20convert');_0x5a6495();});_0x3493f8[_0xdacc('0x25')]();});}function base64Decode(_0x1954f2,_0x1edb43){var _0x13ca5c=path[_0xdacc('0x26')](__dirname,'tmp',rs[_0xdacc('0x27')](0x4)+'.wav');fs[_0xdacc('0x28')](_0x13ca5c,_0x1954f2,'base64');return convertFile(_0x13ca5c,_0x1edb43)[_0xdacc('0x29')](function(){try{fs[_0xdacc('0x1d')](_0x13ca5c);fs['chmodSync'](_0x1edb43,_0xdacc('0x2a'));}catch(_0x2115bc){logger['error'](_0x2115bc);}return _0x1edb43[_0xdacc('0x2b')]('.')[0x0];});}function base64Encode(_0x304629){var _0x3ff327=fs[_0xdacc('0x2c')](_0x304629);return new Buffer(_0x3ff327)['toString'](_0xdacc('0x2d'));}exports[_0xdacc('0x2e')]=function(_0x387b86,_0x57906d,_0xa4a811,_0x2b7f77,_0x2cc96f,_0x51d457){var _0x5705f0,_0x79ddcf;var _0x1a8a77=_0xdacc('0x2f');var _0x210839=_0xdacc('0x30')+_0x387b86;var _0x45c29b={};if(_0x57906d===_0xdacc('0x31')){_0x45c29b[_0xdacc('0x32')]={'ssml':_0xa4a811};}else{_0x45c29b[_0xdacc('0x32')]={'text':_0xa4a811};};_0x45c29b[_0xdacc('0x33')]={'languageCode':_0x2b7f77,'ssmlGender':_0x2cc96f};_0x45c29b[_0xdacc('0x34')]={'audioEncoding':_0xdacc('0x35'),'sampleRateHertz':0x1f40};var _0x57d85d={'url':_0x1a8a77+_0xdacc('0x36')+_0x210839,'method':'POST','json':!![],'body':_0x45c29b};return rp(_0x57d85d)[_0xdacc('0x29')](function(_0x4d58db){return new BPromise(function(_0x4ce1b3,_0x596f8e){_0x5705f0=path[_0xdacc('0x26')](__dirname,_0xdacc('0x37'),rs[_0xdacc('0x27')](0x4)+_0xdacc('0x38'));var _0x31ed1c=Buffer[_0xdacc('0x39')](_0x4d58db[_0xdacc('0x3a')],_0xdacc('0x2d'));return fs['writeFile'](_0x5705f0,_0x31ed1c,function(_0x4f747a){_0x596f8e(_0x4f747a);},function(_0x485f5d){fs[_0xdacc('0x3b')](_0x5705f0,_0xdacc('0x2a'));_0x4ce1b3(_0x485f5d);});});})[_0xdacc('0x29')](function(_0x271321){_0x79ddcf=path[_0xdacc('0x26')](__dirname,_0xdacc('0x37'),rs[_0xdacc('0x27')](0x4)+_0xdacc('0x3c'));return convertFile(_0x5705f0,_0x79ddcf);})[_0xdacc('0x29')](function(){try{fs[_0xdacc('0x1d')](_0x5705f0);fs[_0xdacc('0x3b')](_0x79ddcf,'777');}catch(_0xb0f5d){logger[_0xdacc('0x16')](_0xb0f5d);}logger['info'](_0xdacc('0x3d'),_0x79ddcf[_0xdacc('0x2b')]('.')[0x0]);return _0x79ddcf[_0xdacc('0x2b')]('.')[0x0];});};exports[_0xdacc('0x3e')]=function(_0x16905f,_0x4949e1){var _0x73c081=_0xdacc('0x3f');var _0x3fb4ba,_0x346bfa;var _0x494270;var _0x70408a={'encoding':'utf8','method':_0xdacc('0x40'),'timeout':0x2710,'url':_0x73c081,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0xdacc('0x41')+encodeURIComponent(JSON[_0xdacc('0x42')]([[['jQ1olc',JSON['stringify']([_0x16905f,_0x4949e1||'en',![],_0xdacc('0x43')]),null,_0xdacc('0x44')]]]))};return rp(_0x70408a)['then'](function(_0x2d9f27){try{_0x494270=eval(_0x2d9f27[_0xdacc('0x45')](0x5))[0x0][0x2];}catch(_0x146690){throw new Error(_0xdacc('0x46')+_0x2d9f27[_0xdacc('0x22')]);}if(!_0x494270){if(_0x16905f[_0xdacc('0x47')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0xdacc('0x48')+_0x4949e1+_0xdacc('0x49'));}}try{_0x494270=eval(_0x494270)[0x0];}catch(_0xf2016e){throw new Error('parse\x20response\x20failed:\x0a'+res[_0xdacc('0x22')]);}const _0x5ca9bd=_0x494270;_0x3fb4ba=path['resolve'](__dirname,_0xdacc('0x37'),rs[_0xdacc('0x27')](0x4)+_0xdacc('0x38'));fs[_0xdacc('0x28')](_0x3fb4ba,_0x494270,{'encoding':_0xdacc('0x2d')});_0x346bfa=path[_0xdacc('0x26')](__dirname,_0xdacc('0x37'),rs[_0xdacc('0x27')](0x4)+_0xdacc('0x3c'));return convertFile(_0x3fb4ba,_0x346bfa);})[_0xdacc('0x29')](function(){try{fs[_0xdacc('0x1d')](_0x3fb4ba);fs[_0xdacc('0x3b')](_0x346bfa,_0xdacc('0x2a'));}catch(_0x3d5033){logger[_0xdacc('0x16')](_0x3d5033);}logger[_0xdacc('0x1b')](_0xdacc('0x4a'),_0x346bfa[_0xdacc('0x2b')]('.')[0x0]);return _0x346bfa[_0xdacc('0x2b')]('.')[0x0];});};exports[_0xdacc('0x4b')]=function(_0x535783,_0x4c76b9,_0x23a1df){return google[_0xdacc('0x4c')](_0x535783,_0x4c76b9,_0x23a1df)[_0xdacc('0x29')](function(_0x3af95c){logger['info'](_0x3af95c[_0xdacc('0x4d')]);return rp(_0x3af95c);})[_0xdacc('0x29')](function(_0x4c20e3){var _0x3d7e83='';var _0x16d5ad=0x0;try{fs[_0xdacc('0x1d')](_0x535783);}catch(_0x4f8b79){logger[_0xdacc('0x16')](_0x4f8b79);}if(_0x4c20e3&&_0x4c20e3['results']){_0x3d7e83=_0x4c20e3[_0xdacc('0x4e')][_0xdacc('0x4f')](function(_0x3d63f1){return _0x3d63f1&&_0x3d63f1[_0xdacc('0x50')][0x0]&&_0x3d63f1[_0xdacc('0x50')][0x0][_0xdacc('0x51')]?_0x3d63f1['alternatives'][0x0]['transcript']:'';})[_0xdacc('0x52')]('\x0a');_0x16d5ad=_0x4c20e3[_0xdacc('0x4e')]['map'](function(_0x5cccc3){return _0x5cccc3&&_0x5cccc3['alternatives'][0x0]&&_0x5cccc3[_0xdacc('0x50')][0x0][_0xdacc('0x53')]?_0x5cccc3[_0xdacc('0x50')][0x0][_0xdacc('0x53')]:0x0;})[_0xdacc('0x52')]('\x0a');}logger[_0xdacc('0x1b')](_0xdacc('0x54'),_0x3d7e83);logger['info'](_0xdacc('0x55'),_0x16d5ad);return{'transcript':_0x3d7e83,'confidence':_0x16d5ad};})['catch'](function(_0x46bfb5){logger[_0xdacc('0x16')]('[%s]\x20%s:%s',_0x46bfb5[_0xdacc('0x15')],_0x46bfb5[_0xdacc('0x56')],_0x46bfb5['message']);});};exports[_0xdacc('0x57')]=function(_0x2d2ed6,_0x2ef70e,_0x519713,_0x112bf4){var _0x59448e=apiai(_0x2ef70e,{'language':_0x112bf4||'en'});return _0x59448e[_0xdacc('0x58')](_0x519713,{'sessionId':md5(_0x2d2ed6)})[_0xdacc('0x29')](function(_0x32d6df){logger[_0xdacc('0x1b')](JSON[_0xdacc('0x42')](_0x32d6df));return{'source':_0x32d6df[_0xdacc('0x59')][_0xdacc('0x5a')],'resolvedQuery':_0x32d6df['result'][_0xdacc('0x5b')],'action':_0x32d6df[_0xdacc('0x59')][_0xdacc('0x5c')],'actionIncomplete':_0x32d6df[_0xdacc('0x59')][_0xdacc('0x5d')],'speech':_0x32d6df[_0xdacc('0x59')][_0xdacc('0x5e')][_0xdacc('0x5f')],'score':_0x32d6df['result'][_0xdacc('0x60')],'statusCode':_0x32d6df[_0xdacc('0x61')][_0xdacc('0x62')],'endConversation':_0x32d6df['result'][_0xdacc('0x63')]['endConversation']||![],'isFallbackIntent':_0x32d6df['result'][_0xdacc('0x63')]['isFallbackIntent']};});};exports['googleDialogflowV2']=function(_0x45815a,_0x342dd9,_0x58ab3e,_0x316ae5,_0x42f4a5,_0x2fe285){var _0x47bcfa=_0x316ae5[_0xdacc('0x64')](/\\n/g,'\x0a');var _0x3659ae={'credentials':{'private_key':_0x47bcfa,'client_email':_0x58ab3e}};var _0x56972c=new dialogflow[(_0xdacc('0x65'))](_0x3659ae);var _0x2759e1=_0x56972c[_0xdacc('0x66')](_0x342dd9,md5(_0x45815a));var _0x1dccef={'session':_0x2759e1,'queryInput':{'text':{'text':_0x42f4a5,'languageCode':_0x2fe285}}};return _0x56972c[_0xdacc('0x67')](_0x1dccef)[_0xdacc('0x29')](function(_0x33b3c3){if(_0x33b3c3&&_0x33b3c3[_0xdacc('0x47')]){logger[_0xdacc('0x1b')](_0xdacc('0x68'),JSON[_0xdacc('0x42')](_0x33b3c3));var _0x20066b=_0x33b3c3[0x0];if(_0x20066b){var _0x2b906b={'action':_0x20066b[_0xdacc('0x69')]['action'],'allRequiredParamsPresent':_0x20066b['queryResult'][_0xdacc('0x6a')],'endConversation':_0x20066b['queryResult'][_0xdacc('0x6b')]&&_0x20066b[_0xdacc('0x69')][_0xdacc('0x6b')]['fields']?_0x20066b['queryResult'][_0xdacc('0x6b')][_0xdacc('0x6c')][_0xdacc('0x6d')][_0xdacc('0x6e')]:![],'fulfillmentText':_0x20066b[_0xdacc('0x69')]['fulfillmentText'],'intentName':_0x20066b[_0xdacc('0x69')][_0xdacc('0x6f')]['name'],'intentDisplayName':_0x20066b['queryResult'][_0xdacc('0x6f')][_0xdacc('0x70')],'isFallbackIntent':_0x20066b[_0xdacc('0x69')]['intent']['isFallback'],'languageCode':_0x20066b[_0xdacc('0x69')][_0xdacc('0x71')],'queryText':_0x20066b[_0xdacc('0x69')][_0xdacc('0x72')],'responseId':_0x20066b[_0xdacc('0x73')],'score':_0x20066b[_0xdacc('0x69')][_0xdacc('0x74')],'speech':_0x20066b[_0xdacc('0x69')]['fulfillmentText'],'providerResponse':JSON[_0xdacc('0x42')](_0x33b3c3)};return _0x2b906b;}}});};exports[_0xdacc('0x75')]=function(_0x53aee2,_0x2044ae,_0x37dd7a,_0x4927c5){return tilde[_0xdacc('0x4c')](_0x53aee2,_0x2044ae,_0x37dd7a,_0x4927c5)[_0xdacc('0x29')](function(_0x16b762){try{fs[_0xdacc('0x1d')](_0x53aee2);}catch(_0x4c99f9){logger['error'](_0x4c99f9);}logger[_0xdacc('0x1b')](_0xdacc('0x76'),_0x16b762['transcript']);logger['info'](_0xdacc('0x77'),_0x16b762[_0xdacc('0x53')]);return _0x16b762;});};exports['awsPolly']=function(_0x36ba1b,_0x51676f,_0x543829,_0x3f513b,_0x2a7aab,_0x453683){var _0x50d8f2=path[_0xdacc('0x26')](__dirname,_0xdacc('0x37'),rs[_0xdacc('0x27')](0x4)+_0xdacc('0x38'));var _0x57efd2;return aws['polly'](_0x36ba1b,_0x51676f,_0x543829,_0x3f513b,_0x2a7aab,_0x453683,_0x50d8f2)[_0xdacc('0x29')](function(){_0x57efd2=path[_0xdacc('0x26')](__dirname,'tmp',rs[_0xdacc('0x27')](0x4)+_0xdacc('0x3c'));return convertFile(_0x50d8f2,_0x57efd2);})['then'](function(){try{fs[_0xdacc('0x1d')](_0x50d8f2);fs[_0xdacc('0x3b')](_0x57efd2,_0xdacc('0x2a'));}catch(_0x327089){logger[_0xdacc('0x16')](_0x327089);}return _0x57efd2[_0xdacc('0x2b')]('.')[0x0];});};exports[_0xdacc('0x78')]=function(_0x5dee60,_0x15dd08,_0x4c4392,_0x1a1c05,_0x513a20,_0x49ec27){return aws[_0xdacc('0x79')](_0x5dee60,_0x15dd08,_0x4c4392,_0x1a1c05,_0x513a20,_0x49ec27)['then'](function(_0x2f4c58){logger[_0xdacc('0x1b')](JSON['stringify'](_0x2f4c58));return _0x2f4c58;});};exports['ispeechTTS']=function(_0x3923a3,_0x5b7378,_0x306e07,_0x28defb){var _0x445dbb=util[_0xdacc('0x7a')](_0xdacc('0x7b'),ISPEECH_API,_0x3923a3,encodeURIComponent(_0x5b7378),_0x306e07,_0x28defb);var _0xae1146=path[_0xdacc('0x26')](__dirname,_0xdacc('0x37'),rs[_0xdacc('0x27')](0x4)+_0xdacc('0x38'));var _0x10f30b;return downloadFile(_0x445dbb,_0xae1146)[_0xdacc('0x29')](function(){_0x10f30b=path[_0xdacc('0x26')](__dirname,_0xdacc('0x37'),rs[_0xdacc('0x27')](0x4)+'.wav');return convertFile(_0xae1146,_0x10f30b);})['then'](function(){try{fs[_0xdacc('0x1d')](_0xae1146);fs[_0xdacc('0x3b')](_0x10f30b,_0xdacc('0x2a'));}catch(_0x5acfc1){logger[_0xdacc('0x16')](_0x5acfc1);}return _0x10f30b['split']('.')[0x0];});};exports[_0xdacc('0x7c')]=function(_0x5d05fe,_0x3b78ea,_0x22e330,_0x1082f7){var _0xc7e223=util[_0xdacc('0x7a')](_0xdacc('0x7d'),ISPEECH_API,_0x3b78ea,_0x22e330,base64Encode(_0x5d05fe),_0x1082f7?util['format'](_0xdacc('0x7e'),encodeURIComponent(_0x1082f7)):_0xdacc('0x7f'));return uploadFile(_0xc7e223)[_0xdacc('0x29')](function(_0x301f78){return querystring['parse'](_0x301f78);});};exports[_0xdacc('0x80')]=function(_0x1f04f6,_0x10d77a){return sestek[_0xdacc('0x81')](_0x1f04f6,_0x10d77a)[_0xdacc('0x29')](function(_0x149ba4){logger[_0xdacc('0x1b')](JSON[_0xdacc('0x42')](_0x149ba4));var _0x5e1f16={'speech':_0x149ba4['text'],'action':_0x149ba4[_0xdacc('0x82')]?_0x149ba4[_0xdacc('0x82')][_0xdacc('0x83')]:undefined,'actiondata':_0x149ba4[_0xdacc('0x82')]?_0x149ba4['channelData']['CustomActionData']:undefined};if(_0x149ba4[_0xdacc('0x82')]&&_0x149ba4[_0xdacc('0x82')][_0xdacc('0x84')]){return base64Decode(_0x149ba4['channelData'][_0xdacc('0x84')][_0xdacc('0x85')],path['resolve'](__dirname,'tmp',rs[_0xdacc('0x27')](0x4)+'.wav'))[_0xdacc('0x29')](function(_0x2239ea){_0x5e1f16['audiofile']=_0x2239ea;return _0x5e1f16;});}return _0x5e1f16;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0x6f37=['google-tts-api','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','statusMessage','request\x20to\x20','createWriteStream','info','finish\x20download\x20file','close','unlink','pipe','end','\x20failed,\x20status\x20code\x20=\x20','transcode','wav','error\x20convert','tmp','generate','.wav','writeFileSync','base64','chmodSync','777','split','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','input','voice','MP3','text:synthesize','then','resolve','.mp3','writeFile','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','application/x-www-form-urlencoded','jQ1olc','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','stringify','result','resolvedQuery','fulfillment','speech','status','metadata','endConversation','isFallbackIntent','replace','SessionsClient','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','Tilde\x20ASR\x20confidence','awsPolly','polly','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','text','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','dialogflow','http','https','path','querystring','randomstring'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x6f37,0x75));var _0x76f3=function(_0x22b39b,_0x2b7d63){_0x22b39b=_0x22b39b-0x0;var _0x280e1d=_0x6f37[_0x22b39b];return _0x280e1d;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require(_0x76f3('0x0'));var fs=require('fs');var http=require(_0x76f3('0x1'));var https=require(_0x76f3('0x2'));var md5=require('md5');var path=require(_0x76f3('0x3'));var querystring=require(_0x76f3('0x4'));var rp=require('request-promise');var rs=require(_0x76f3('0x5'));var sox=require('sox');var tts=require(_0x76f3('0x6'));var urlParse=require(_0x76f3('0x7'))[_0x76f3('0x8')];var util=require(_0x76f3('0x9'));var aws=require(_0x76f3('0xa'));var google=require(_0x76f3('0xb'));var sestek=require(_0x76f3('0xc'));var tilde=require(_0x76f3('0xd'));var logger=require(_0x76f3('0xe'))('agi');var ISPEECH_API=_0x76f3('0xf');function downloadFile(_0x420c7a,_0x46fc49){return new BPromise(function(_0x59bd8e,_0x8b2e1d){var _0x276a20=urlParse(_0x420c7a);var _0x36d9ca=_0x276a20[_0x76f3('0x10')]===_0x76f3('0x11')?https:http;var _0x1c2368={'host':_0x276a20[_0x76f3('0x12')],'path':_0x276a20[_0x76f3('0x3')],'headers':{'user-agent':_0x76f3('0x13')}};_0x36d9ca[_0x76f3('0x14')](_0x1c2368,function(_0x2f24e1){if(_0x2f24e1[_0x76f3('0x15')]!==0xc8){logger[_0x76f3('0x16')]('request\x20to\x20'+_0x420c7a+'\x20failed,\x20status\x20code\x20=\x20'+_0x2f24e1['statusCode']+'\x20('+_0x2f24e1[_0x76f3('0x17')]+')');_0x8b2e1d(new Error(_0x76f3('0x18')+_0x420c7a+'\x20failed,\x20status\x20code\x20=\x20'+_0x2f24e1[_0x76f3('0x15')]+'\x20('+_0x2f24e1[_0x76f3('0x17')]+')'));return;}var _0x1b857f=fs[_0x76f3('0x19')](_0x46fc49);_0x1b857f['on']('finish',function(){logger[_0x76f3('0x1a')](_0x76f3('0x1b'));_0x1b857f[_0x76f3('0x1c')](_0x59bd8e);});_0x1b857f['on'](_0x76f3('0x16'),function(_0x37e391){fs[_0x76f3('0x1d')](_0x46fc49);logger[_0x76f3('0x16')]('download\x20error',_0x37e391);_0x8b2e1d(_0x37e391);});_0x2f24e1[_0x76f3('0x1e')](_0x1b857f);})['on'](_0x76f3('0x16'),function(_0x54291c){logger[_0x76f3('0x16')](_0x54291c);_0x8b2e1d(_0x54291c);})[_0x76f3('0x1f')]();});}function uploadFile(_0xfbf058){return new BPromise(function(_0x5ed4d1,_0x52a64c){var _0x33a426=urlParse(_0xfbf058);var _0x4f0fba=_0x33a426[_0x76f3('0x10')]===_0x76f3('0x11')?https:http;var _0x450d65={'host':_0x33a426[_0x76f3('0x12')],'path':_0x33a426[_0x76f3('0x3')],'headers':{'user-agent':'WHAT_EVER'}};_0x4f0fba[_0x76f3('0x14')](_0x450d65,function(_0x4d1cab){if(_0x4d1cab[_0x76f3('0x15')]!==0xc8){_0x52a64c(new Error(_0x76f3('0x18')+_0xfbf058+_0x76f3('0x20')+_0x4d1cab[_0x76f3('0x15')]+'\x20('+_0x4d1cab[_0x76f3('0x17')]+')'));return;}var _0xb7f8c0='';_0x4d1cab['on']('data',function(_0x1f6091){_0xb7f8c0+=_0x1f6091;});_0x4d1cab['on'](_0x76f3('0x1f'),function(){_0x5ed4d1(_0xb7f8c0);});})['on'](_0x76f3('0x16'),function(_0x40aba8){_0x52a64c(_0x40aba8);})[_0x76f3('0x1f')]();});}function convertFile(_0x14040f,_0x491250){return new BPromise(function(_0x48a673,_0x10fa9f){var _0x2acf99=sox[_0x76f3('0x21')](_0x14040f,_0x491250,{'sampleRate':0x1f40,'format':_0x76f3('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2acf99['on'](_0x76f3('0x16'),function(_0x19f05c){logger['error'](_0x76f3('0x23'),_0x19f05c);_0x10fa9f(_0x19f05c);});_0x2acf99['on'](_0x76f3('0x1f'),function(){logger['info']('finish\x20to\x20convert');_0x48a673();});_0x2acf99['start']();});}function base64Decode(_0x27325f,_0x106e53){var _0x5290c6=path['resolve'](__dirname,_0x76f3('0x24'),rs[_0x76f3('0x25')](0x4)+_0x76f3('0x26'));fs[_0x76f3('0x27')](_0x5290c6,_0x27325f,_0x76f3('0x28'));return convertFile(_0x5290c6,_0x106e53)['then'](function(){try{fs[_0x76f3('0x1d')](_0x5290c6);fs[_0x76f3('0x29')](_0x106e53,_0x76f3('0x2a'));}catch(_0x2e49f2){logger[_0x76f3('0x16')](_0x2e49f2);}return _0x106e53[_0x76f3('0x2b')]('.')[0x0];});}function base64Encode(_0x144607){var _0x3921d7=fs[_0x76f3('0x2c')](_0x144607);return new Buffer(_0x3921d7)['toString'](_0x76f3('0x28'));}exports[_0x76f3('0x2d')]=function(_0x57016b,_0xb50035,_0x289c1b,_0x157400,_0x360964,_0x47510d){var _0x317997,_0x228138;var _0x4b6945=_0x76f3('0x2e');var _0x2da1c5='?key='+_0x57016b;var _0x331629={};if(_0xb50035==='ssml'){_0x331629[_0x76f3('0x2f')]={'ssml':_0x289c1b};}else{_0x331629['input']={'text':_0x289c1b};};_0x331629[_0x76f3('0x30')]={'languageCode':_0x157400,'ssmlGender':_0x360964};_0x331629['audioConfig']={'audioEncoding':_0x76f3('0x31'),'sampleRateHertz':0x1f40};var _0x1c1228={'url':_0x4b6945+_0x76f3('0x32')+_0x2da1c5,'method':'POST','json':!![],'body':_0x331629};return rp(_0x1c1228)[_0x76f3('0x33')](function(_0x138d35){return new BPromise(function(_0x380d0f,_0x42d090){_0x317997=path[_0x76f3('0x34')](__dirname,_0x76f3('0x24'),rs[_0x76f3('0x25')](0x4)+_0x76f3('0x35'));var _0x21df74=Buffer['from'](_0x138d35['audioContent'],_0x76f3('0x28'));return fs[_0x76f3('0x36')](_0x317997,_0x21df74,function(_0x3c9737){_0x42d090(_0x3c9737);},function(_0x55f2b6){fs[_0x76f3('0x29')](_0x317997,_0x76f3('0x2a'));_0x380d0f(_0x55f2b6);});});})[_0x76f3('0x33')](function(_0x5ccfd4){_0x228138=path[_0x76f3('0x34')](__dirname,_0x76f3('0x24'),rs[_0x76f3('0x25')](0x4)+_0x76f3('0x26'));return convertFile(_0x317997,_0x228138);})[_0x76f3('0x33')](function(){try{fs[_0x76f3('0x1d')](_0x317997);fs[_0x76f3('0x29')](_0x228138,_0x76f3('0x2a'));}catch(_0x32d17c){logger[_0x76f3('0x16')](_0x32d17c);}logger['info']('googleCloudTTS\x20path',_0x228138['split']('.')[0x0]);return _0x228138[_0x76f3('0x2b')]('.')[0x0];});};exports[_0x76f3('0x37')]=function(_0x39368a,_0x3ceb72){var _0x187784=_0x76f3('0x38');var _0x489385,_0x283567;var _0x2976f2;var _0x593f39={'encoding':_0x76f3('0x39'),'method':_0x76f3('0x3a'),'timeout':0x2710,'url':_0x187784,'headers':{'Content-Type':_0x76f3('0x3b')},'body':'f.req='+encodeURIComponent(JSON['stringify']([[[_0x76f3('0x3c'),JSON['stringify']([_0x39368a,_0x3ceb72||'en',![],'null']),null,'generic']]]))};return rp(_0x593f39)['then'](function(_0x136ee2){try{_0x2976f2=eval(_0x136ee2['slice'](0x5))[0x0][0x2];}catch(_0x3ed697){throw new Error(_0x76f3('0x3d')+_0x136ee2[_0x76f3('0x3e')]);}if(!_0x2976f2){if(_0x39368a[_0x76f3('0x3f')]>0xc8){throw new Error(_0x76f3('0x40'));}else{throw new Error(_0x76f3('0x41')+_0x3ceb72+'\x22\x20might\x20not\x20exist');}}try{_0x2976f2=eval(_0x2976f2)[0x0];}catch(_0x22e76a){throw new Error('parse\x20response\x20failed:\x0a'+res['data']);}const _0x20804e=_0x2976f2;_0x489385=path['resolve'](__dirname,_0x76f3('0x24'),rs[_0x76f3('0x25')](0x4)+_0x76f3('0x35'));fs[_0x76f3('0x27')](_0x489385,_0x2976f2,{'encoding':_0x76f3('0x28')});_0x283567=path[_0x76f3('0x34')](__dirname,'tmp',rs[_0x76f3('0x25')](0x4)+'.wav');return convertFile(_0x489385,_0x283567);})[_0x76f3('0x33')](function(){try{fs[_0x76f3('0x1d')](_0x489385);fs[_0x76f3('0x29')](_0x283567,_0x76f3('0x2a'));}catch(_0x1fa709){logger['error'](_0x1fa709);}logger[_0x76f3('0x1a')](_0x76f3('0x42'),_0x283567['split']('.')[0x0]);return _0x283567[_0x76f3('0x2b')]('.')[0x0];});};exports[_0x76f3('0x43')]=function(_0x7b81df,_0x2ba624,_0x222590){return google[_0x76f3('0x44')](_0x7b81df,_0x2ba624,_0x222590)['then'](function(_0x394f05){logger[_0x76f3('0x1a')](_0x394f05[_0x76f3('0x45')]);return rp(_0x394f05);})[_0x76f3('0x33')](function(_0x5c8903){var _0x2cfcf4='';var _0x23aa40=0x0;try{fs['unlink'](_0x7b81df);}catch(_0x3753e9){logger[_0x76f3('0x16')](_0x3753e9);}if(_0x5c8903&&_0x5c8903['results']){_0x2cfcf4=_0x5c8903[_0x76f3('0x46')][_0x76f3('0x47')](function(_0x3c2393){return _0x3c2393&&_0x3c2393[_0x76f3('0x48')][0x0]&&_0x3c2393[_0x76f3('0x48')][0x0][_0x76f3('0x49')]?_0x3c2393[_0x76f3('0x48')][0x0]['transcript']:'';})[_0x76f3('0x4a')]('\x0a');_0x23aa40=_0x5c8903[_0x76f3('0x46')][_0x76f3('0x47')](function(_0x2296f2){return _0x2296f2&&_0x2296f2[_0x76f3('0x48')][0x0]&&_0x2296f2[_0x76f3('0x48')][0x0][_0x76f3('0x4b')]?_0x2296f2[_0x76f3('0x48')][0x0]['confidence']:0x0;})['join']('\x0a');}logger[_0x76f3('0x1a')]('googleASR\x20transcription',_0x2cfcf4);logger[_0x76f3('0x1a')](_0x76f3('0x4c'),_0x23aa40);return{'transcript':_0x2cfcf4,'confidence':_0x23aa40};})[_0x76f3('0x4d')](function(_0x2da752){logger['error'](_0x76f3('0x4e'),_0x2da752['statusCode'],_0x2da752[_0x76f3('0x4f')],_0x2da752['message']);});};exports[_0x76f3('0x50')]=function(_0x25b5ab,_0x5945cf,_0x5769f1,_0x18c8a2){var _0x265271=apiai(_0x5945cf,{'language':_0x18c8a2||'en'});return _0x265271['textRequest'](_0x5769f1,{'sessionId':md5(_0x25b5ab)})[_0x76f3('0x33')](function(_0x5e1dd2){logger[_0x76f3('0x1a')](JSON[_0x76f3('0x51')](_0x5e1dd2));return{'source':_0x5e1dd2[_0x76f3('0x52')]['source'],'resolvedQuery':_0x5e1dd2[_0x76f3('0x52')][_0x76f3('0x53')],'action':_0x5e1dd2[_0x76f3('0x52')]['action'],'actionIncomplete':_0x5e1dd2['result']['actionIncomplete'],'speech':_0x5e1dd2[_0x76f3('0x52')][_0x76f3('0x54')][_0x76f3('0x55')],'score':_0x5e1dd2['result']['score'],'statusCode':_0x5e1dd2[_0x76f3('0x56')]['code'],'endConversation':_0x5e1dd2[_0x76f3('0x52')][_0x76f3('0x57')][_0x76f3('0x58')]||![],'isFallbackIntent':_0x5e1dd2[_0x76f3('0x52')][_0x76f3('0x57')][_0x76f3('0x59')]};});};exports['googleDialogflowV2']=function(_0x3c6133,_0x16aa9c,_0x2a162c,_0x4a1ffc,_0xb501a8,_0x18389){var _0x2b88a3=_0x4a1ffc[_0x76f3('0x5a')](/\\n/g,'\x0a');var _0x508f94={'credentials':{'private_key':_0x2b88a3,'client_email':_0x2a162c}};var _0x32556f=new dialogflow[(_0x76f3('0x5b'))](_0x508f94);var _0x58f656=_0x32556f['sessionPath'](_0x16aa9c,md5(_0x3c6133));var _0x317f4c={'session':_0x58f656,'queryInput':{'text':{'text':_0xb501a8,'languageCode':_0x18389}}};return _0x32556f['detectIntent'](_0x317f4c)[_0x76f3('0x33')](function(_0xca398b){if(_0xca398b&&_0xca398b[_0x76f3('0x3f')]){logger[_0x76f3('0x1a')](_0x76f3('0x5c'),JSON['stringify'](_0xca398b));var _0x2b7489=_0xca398b[0x0];if(_0x2b7489){var _0x1ab7a3={'action':_0x2b7489[_0x76f3('0x5d')][_0x76f3('0x5e')],'allRequiredParamsPresent':_0x2b7489[_0x76f3('0x5d')][_0x76f3('0x5f')],'endConversation':_0x2b7489[_0x76f3('0x5d')][_0x76f3('0x60')]&&_0x2b7489[_0x76f3('0x5d')][_0x76f3('0x60')][_0x76f3('0x61')]?_0x2b7489['queryResult'][_0x76f3('0x60')]['fields'][_0x76f3('0x62')][_0x76f3('0x63')]:![],'fulfillmentText':_0x2b7489[_0x76f3('0x5d')][_0x76f3('0x64')],'intentName':_0x2b7489[_0x76f3('0x5d')][_0x76f3('0x65')]['name'],'intentDisplayName':_0x2b7489[_0x76f3('0x5d')]['intent'][_0x76f3('0x66')],'isFallbackIntent':_0x2b7489[_0x76f3('0x5d')][_0x76f3('0x65')][_0x76f3('0x67')],'languageCode':_0x2b7489[_0x76f3('0x5d')][_0x76f3('0x68')],'queryText':_0x2b7489[_0x76f3('0x5d')][_0x76f3('0x69')],'responseId':_0x2b7489[_0x76f3('0x6a')],'score':_0x2b7489[_0x76f3('0x5d')][_0x76f3('0x6b')],'speech':_0x2b7489[_0x76f3('0x5d')][_0x76f3('0x64')],'providerResponse':JSON[_0x76f3('0x51')](_0xca398b)};return _0x1ab7a3;}}});};exports['tildeASR']=function(_0x1bc42f,_0x4ad1c8,_0x286272,_0x16f6b5){return tilde[_0x76f3('0x44')](_0x1bc42f,_0x4ad1c8,_0x286272,_0x16f6b5)[_0x76f3('0x33')](function(_0x23328d){try{fs[_0x76f3('0x1d')](_0x1bc42f);}catch(_0x326369){logger[_0x76f3('0x16')](_0x326369);}logger[_0x76f3('0x1a')]('Tilde\x20ASR\x20transcription',_0x23328d[_0x76f3('0x49')]);logger[_0x76f3('0x1a')](_0x76f3('0x6c'),_0x23328d[_0x76f3('0x4b')]);return _0x23328d;});};exports[_0x76f3('0x6d')]=function(_0x5439b9,_0x31b687,_0x15aa51,_0x1d4992,_0x227b4e,_0x1bacca){var _0x1e1bfa=path[_0x76f3('0x34')](__dirname,_0x76f3('0x24'),rs[_0x76f3('0x25')](0x4)+_0x76f3('0x35'));var _0x4d6375;return aws[_0x76f3('0x6e')](_0x5439b9,_0x31b687,_0x15aa51,_0x1d4992,_0x227b4e,_0x1bacca,_0x1e1bfa)[_0x76f3('0x33')](function(){_0x4d6375=path[_0x76f3('0x34')](__dirname,_0x76f3('0x24'),rs[_0x76f3('0x25')](0x4)+'.wav');return convertFile(_0x1e1bfa,_0x4d6375);})[_0x76f3('0x33')](function(){try{fs[_0x76f3('0x1d')](_0x1e1bfa);fs[_0x76f3('0x29')](_0x4d6375,'777');}catch(_0x4c8c98){logger['error'](_0x4c8c98);}return _0x4d6375[_0x76f3('0x2b')]('.')[0x0];});};exports['awsLex']=function(_0x50a629,_0x56d9f5,_0xef989d,_0x31bfb0,_0x186c98,_0x852c59){return aws['lex'](_0x50a629,_0x56d9f5,_0xef989d,_0x31bfb0,_0x186c98,_0x852c59)['then'](function(_0x85231e){logger[_0x76f3('0x1a')](JSON[_0x76f3('0x51')](_0x85231e));return _0x85231e;});};exports[_0x76f3('0x6f')]=function(_0x6eb615,_0xf812f,_0x344659,_0x2c8238){var _0x3d4aaf=util[_0x76f3('0x70')](_0x76f3('0x71'),ISPEECH_API,_0x6eb615,encodeURIComponent(_0xf812f),_0x344659,_0x2c8238);var _0x1869d3=path[_0x76f3('0x34')](__dirname,_0x76f3('0x24'),rs[_0x76f3('0x25')](0x4)+_0x76f3('0x35'));var _0x2c5ee1;return downloadFile(_0x3d4aaf,_0x1869d3)[_0x76f3('0x33')](function(){_0x2c5ee1=path[_0x76f3('0x34')](__dirname,'tmp',rs[_0x76f3('0x25')](0x4)+'.wav');return convertFile(_0x1869d3,_0x2c5ee1);})['then'](function(){try{fs[_0x76f3('0x1d')](_0x1869d3);fs[_0x76f3('0x29')](_0x2c5ee1,_0x76f3('0x2a'));}catch(_0x265789){logger[_0x76f3('0x16')](_0x265789);}return _0x2c5ee1[_0x76f3('0x2b')]('.')[0x0];});};exports[_0x76f3('0x72')]=function(_0x423188,_0x1e9b56,_0x5480a6,_0x142a1d){var _0xa185b0=util[_0x76f3('0x70')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x1e9b56,_0x5480a6,base64Encode(_0x423188),_0x142a1d?util['format'](_0x76f3('0x73'),encodeURIComponent(_0x142a1d)):'freeform=3');return uploadFile(_0xa185b0)[_0x76f3('0x33')](function(_0x2104ed){return querystring[_0x76f3('0x8')](_0x2104ed);});};exports['sestekNDA']=function(_0x3d8e9b,_0x577346){return sestek['nda'](_0x3d8e9b,_0x577346)[_0x76f3('0x33')](function(_0x49faa2){logger[_0x76f3('0x1a')](JSON[_0x76f3('0x51')](_0x49faa2));var _0xa5f58d={'speech':_0x49faa2[_0x76f3('0x74')],'action':_0x49faa2[_0x76f3('0x75')]?_0x49faa2['channelData'][_0x76f3('0x76')]:undefined,'actiondata':_0x49faa2[_0x76f3('0x75')]?_0x49faa2[_0x76f3('0x75')]['CustomActionData']:undefined};if(_0x49faa2[_0x76f3('0x75')]&&_0x49faa2[_0x76f3('0x75')][_0x76f3('0x77')]){return base64Decode(_0x49faa2[_0x76f3('0x75')][_0x76f3('0x77')][_0x76f3('0x78')],path[_0x76f3('0x34')](__dirname,_0x76f3('0x24'),rs[_0x76f3('0x25')](0x4)+_0x76f3('0x26')))['then'](function(_0x40014f){_0xa5f58d[_0x76f3('0x79')]=_0x40014f;return _0xa5f58d;});}return _0xa5f58d;});};exports[_0x76f3('0x7a')]=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 cd777b5..9d556fa 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 _0x3475=['./nda','exports'];(function(_0x3daa8c,_0x388a87){var _0x2b1bd7=function(_0xdb2963){while(--_0xdb2963){_0x3daa8c['push'](_0x3daa8c['shift']());}};_0x2b1bd7(++_0x388a87);}(_0x3475,0xe2));var _0x5347=function(_0x524612,_0x1a706a){_0x524612=_0x524612-0x0;var _0x43499c=_0x3475[_0x524612];return _0x43499c;};var nda=require(_0x5347('0x0'));module[_0x5347('0x1')]={'nda':nda}; \ No newline at end of file +var _0xe293=['exports','./nda'];(function(_0x1ac007,_0x5cdfe8){var _0x137c73=function(_0x4d71e3){while(--_0x4d71e3){_0x1ac007['push'](_0x1ac007['shift']());}};_0x137c73(++_0x5cdfe8);}(_0xe293,0xbf));var _0x3e29=function(_0x4d8a8f,_0x2afd4c){_0x4d8a8f=_0x4d8a8f-0x0;var _0xfc4adc=_0xe293[_0x4d8a8f];return _0xfc4adc;};var nda=require(_0x3e29('0x0'));module[_0x3e29('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index c432343..1287a2b 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 _0x6e6c=['calleridname','dnid','extension','text','access_token','body','channelData','ProjectName','project','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','stringify','request-promise','url','agi','exports','resolve','/token','password','then','POST','ndassistant_url','ndaactivity_type','message','Nda','uniqueid','callerid'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6e6c[_0x2dafbe];return _0x58a45a;};'use strict';var rp=require(_0xc6e6('0x0'));var url=require(_0xc6e6('0x1'));var logger=require('../../../../../config/logger')(_0xc6e6('0x2'));module[_0xc6e6('0x3')]=function(_0x58f303,_0x550e47){var _0x2e97f5={'method':'POST','uri':url[_0xc6e6('0x4')](_0x550e47['ndauth_url'],_0xc6e6('0x5')),'form':{'grant_type':_0xc6e6('0x6'),'username':_0x550e47['username'],'password':_0x550e47[_0xc6e6('0x6')]},'json':!![]};return rp(_0x2e97f5)[_0xc6e6('0x7')](function(_0x4da7bd){var _0x324706={'method':_0xc6e6('0x8'),'uri':url['resolve'](_0x550e47[_0xc6e6('0x9')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x550e47[_0xc6e6('0xa')]||_0xc6e6('0xb'),'channelId':_0xc6e6('0xc'),'conversation':{'id':_0x58f303[_0xc6e6('0xd')]},'from':{'id':_0x58f303[_0xc6e6('0xe')],'name':_0x58f303[_0xc6e6('0xf')]},'recipient':{'id':_0x58f303[_0xc6e6('0x10')],'name':_0x58f303[_0xc6e6('0x11')]},'text':_0x550e47[_0xc6e6('0x12')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x4da7bd[_0xc6e6('0x13')]},'json':!![]};if(_0x550e47['project']){_0x324706[_0xc6e6('0x14')][_0xc6e6('0x15')][_0xc6e6('0x16')]=_0x550e47[_0xc6e6('0x17')];}if(_0x550e47['ndagenerate_audio']=='1'){_0x324706[_0xc6e6('0x14')][_0xc6e6('0x15')][_0xc6e6('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xc6e6('0x19')};}if(_0x550e47[_0xc6e6('0x1a')]){_0x324706['body'][_0xc6e6('0x15')][_0xc6e6('0x1b')]=_0x550e47['custom_action'];if(_0x550e47[_0xc6e6('0x1c')]){_0x324706[_0xc6e6('0x14')][_0xc6e6('0x15')]['CustomActionData']=_0x550e47['custom_action_data'];}}logger['info'](JSON[_0xc6e6('0x1d')](_0x324706));return rp(_0x324706);});}; \ No newline at end of file +var _0xb6b1=['calleridname','dnid','extension','text','access_token','project','body','ProjectName','channelData','AudioOutputSettings','audio/wav','custom_action','custom_action_data','info','stringify','request-promise','../../../../../config/logger','exports','resolve','ndauth_url','/token','password','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','Nda','uniqueid','callerid'];(function(_0xc4f00d,_0x919442){var _0x4f595d=function(_0x5804e0){while(--_0x5804e0){_0xc4f00d['push'](_0xc4f00d['shift']());}};_0x4f595d(++_0x919442);}(_0xb6b1,0x17b));var _0x1b6b=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xb6b1[_0xdea41a];return _0x15d0d8;};'use strict';var rp=require(_0x1b6b('0x0'));var url=require('url');var logger=require(_0x1b6b('0x1'))('agi');module[_0x1b6b('0x2')]=function(_0x29651a,_0x59b931){var _0x3f12e2={'method':'POST','uri':url[_0x1b6b('0x3')](_0x59b931[_0x1b6b('0x4')],_0x1b6b('0x5')),'form':{'grant_type':_0x1b6b('0x6'),'username':_0x59b931['username'],'password':_0x59b931[_0x1b6b('0x6')]},'json':!![]};return rp(_0x3f12e2)['then'](function(_0xae4115){var _0x5042f7={'method':_0x1b6b('0x7'),'uri':url[_0x1b6b('0x3')](_0x59b931[_0x1b6b('0x8')],_0x1b6b('0x9')),'body':{'type':_0x59b931['ndaactivity_type']||'message','channelId':_0x1b6b('0xa'),'conversation':{'id':_0x29651a[_0x1b6b('0xb')]},'from':{'id':_0x29651a[_0x1b6b('0xc')],'name':_0x29651a[_0x1b6b('0xd')]},'recipient':{'id':_0x29651a[_0x1b6b('0xe')],'name':_0x29651a[_0x1b6b('0xf')]},'text':_0x59b931[_0x1b6b('0x10')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0xae4115[_0x1b6b('0x11')]},'json':!![]};if(_0x59b931[_0x1b6b('0x12')]){_0x5042f7[_0x1b6b('0x13')]['channelData'][_0x1b6b('0x14')]=_0x59b931['project'];}if(_0x59b931['ndagenerate_audio']=='1'){_0x5042f7[_0x1b6b('0x13')][_0x1b6b('0x15')][_0x1b6b('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x1b6b('0x17')};}if(_0x59b931[_0x1b6b('0x18')]){_0x5042f7[_0x1b6b('0x13')][_0x1b6b('0x15')]['CustomAction']=_0x59b931[_0x1b6b('0x18')];if(_0x59b931[_0x1b6b('0x19')]){_0x5042f7[_0x1b6b('0x13')][_0x1b6b('0x15')]['CustomActionData']=_0x59b931[_0x1b6b('0x19')];}}logger[_0x1b6b('0x1a')](JSON[_0x1b6b('0x1b')](_0x5042f7));return rp(_0x5042f7);});}; \ 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 ca02bc0..572ef71 100644 --- a/server/services/agi/scripts/tilde/asr/index.js +++ b/server/services/agi/scripts/tilde/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca52=['exports'];(function(_0x1372d6,_0x185e49){var _0x3b6ec4=function(_0x20d532){while(--_0x20d532){_0x1372d6['push'](_0x1372d6['shift']());}};_0x3b6ec4(++_0x185e49);}(_0xca52,0xc5));var _0x2ca5=function(_0x3c9083,_0x6b3fd6){_0x3c9083=_0x3c9083-0x0;var _0x3cd7ec=_0xca52[_0x3c9083];return _0x3cd7ec;};'use strict';var asr=require('./lib/api');module[_0x2ca5('0x0')]=function(_0x4bfe12,_0x1a4064,_0x7113d7,_0x5d00f8){return asr(_0x4bfe12,_0x1a4064,_0x7113d7,_0x5d00f8);}; \ No newline at end of file +var _0x7d28=['./lib/api','exports'];(function(_0x40716d,_0x5c0b93){var _0xf2c6f7=function(_0x23cca1){while(--_0x23cca1){_0x40716d['push'](_0x40716d['shift']());}};_0xf2c6f7(++_0x5c0b93);}(_0x7d28,0x14e));var _0x87d2=function(_0x4d2fe3,_0x420c6d){_0x4d2fe3=_0x4d2fe3-0x0;var _0x58456c=_0x7d28[_0x4d2fe3];return _0x58456c;};'use strict';var asr=require(_0x87d2('0x0'));module[_0x87d2('0x1')]=function(_0x43c975,_0x2db535,_0x3c33ed,_0xa761f8){return asr(_0x43c975,_0x2db535,_0x3c33ed,_0xa761f8);}; \ 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 2530266..0c2bdfc 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 _0xdccd=['moment','crypto','../../../../../../config/logger','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','data','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','hypotheses','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.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','bluebird','lodash'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0xdccd,0xe2));var _0xddcc=function(_0x1531c1,_0x95532){_0x1531c1=_0x1531c1-0x0;var _0x4a2fc7=_0xdccd[_0x1531c1];return _0x4a2fc7;};'use strict';var BPromise=require(_0xddcc('0x0'));var _=require(_0xddcc('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xddcc('0x2'));var crypto=require(_0xddcc('0x3'));var logger=require(_0xddcc('0x4'))(_0xddcc('0x5'));module['exports']=function(_0x9af34d,_0x363ec7,_0x5cf218,_0x2a9f56){return new BPromise(function(_0x160c10,_0x4e4c51){logger[_0xddcc('0x6')](_0xddcc('0x7'),_0x2a9f56||_0xddcc('0x8'));var _0x49f909=new WebSocket(_0x2a9f56||_0xddcc('0x8'),{'perMessageDeflate':![]});var _0x3f3fb4='';var _0x3d0119='0';var _0xbd8c95='1';var _0x2300d0=_0xddcc('0x9');function _0x5b0a2a(_0x22d5b6){var _0x3eaeee=crypto[_0xddcc('0xa')](_0xddcc('0xb'));_0x3eaeee[_0xddcc('0xc')](_0x22d5b6);return _0x3eaeee['digest'](_0xddcc('0xd'));}function _0x59d5aa(){try{logger[_0xddcc('0x6')](_0xddcc('0xe'));var _0x5567f5=moment()[_0xddcc('0xf')]();var _0x5c684d=_0x5b0a2a(_0x5567f5+_0x363ec7+_0x5cf218);_0x49f909[_0xddcc('0x10')](JSON[_0xddcc('0x11')]({'appID':_0x363ec7,'timestamp':_0x5567f5,'appKey':_0x5c684d}));var _0x5b6ab5=fs['createReadStream'](_0x9af34d);_0x5b6ab5['on'](_0xddcc('0x12'),function(_0x4567a0){_0x49f909['send'](_0x4567a0);});_0x5b6ab5['on']('close',function(){_0x49f909[_0xddcc('0x10')]('EOS');});}catch(_0x4f07a6){logger[_0xddcc('0x13')](_0xddcc('0x14'),JSON[_0xddcc('0x11')](_0x4f07a6));_0x49f909[_0xddcc('0x15')]();}}function _0x89978e(_0x4f90ea){try{if(_0x4f90ea){var _0x511513=JSON[_0xddcc('0x16')](_0x4f90ea);switch(_0x511513[_0xddcc('0x17')]){case 0x0:if(_0x511513['result']){if(_0x511513[_0xddcc('0x18')][_0xddcc('0x19')]){logger[_0xddcc('0x6')]('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0x511513[_0xddcc('0x18')][_0xddcc('0x1a')]));_0x3f3fb4=_0x511513['result'][_0xddcc('0x1a')][0x0]['transcript'];_0x3d0119=_0x511513[_0xddcc('0x18')][_0xddcc('0x1a')][0x0][_0xddcc('0x1b')];_0xbd8c95='0';_0x2300d0=_0xddcc('0x1c');_0x49f909[_0xddcc('0x15')]();}}break;case 0x1:logger[_0xddcc('0x6')](_0xddcc('0x9'));_0xbd8c95='1';_0x2300d0=_0xddcc('0x9');break;case 0x2:logger['info'](_0xddcc('0x1d'));_0xbd8c95='2';_0x2300d0=_0xddcc('0x1d');break;case 0x9:logger[_0xddcc('0x6')](_0xddcc('0x1e'));_0xbd8c95='9';_0x2300d0=_0xddcc('0x1e');break;case 0xa:logger[_0xddcc('0x6')]('Authentication\x20failed.');_0xbd8c95='10';_0x2300d0=_0xddcc('0x1f');break;case 0xb:logger[_0xddcc('0x6')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0xbd8c95='11';_0x2300d0=_0xddcc('0x20');}}}catch(_0x540243){logger[_0xddcc('0x13')]('Tilde\x20ASR\x20parse\x20error',JSON[_0xddcc('0x11')](_0x540243));_0x49f909[_0xddcc('0x15')]();}}function _0x5d1524(){logger['info'](_0xddcc('0x21'));_0x160c10({'transcript':_0x3f3fb4,'confidence':_0x3d0119,'status':_0xbd8c95,'status_message':_0x2300d0});}function _0x57816e(_0xe3985d){logger[_0xddcc('0x13')](_0xddcc('0x22'));if(!_[_0xddcc('0x23')](_0xe3985d)){logger[_0xddcc('0x13')](_[_0xddcc('0x24')](_0xe3985d)?JSON['stringify'](_0xe3985d):_0xe3985d);}}_0x49f909['on'](_0xddcc('0x25'),_0x59d5aa);_0x49f909['on']('message',_0x89978e);_0x49f909['on']('close',_0x5d1524);_0x49f909['on'](_0xddcc('0x13'),_0x57816e);});}; \ No newline at end of file +var _0xbb33=['exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','data','close','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','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.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','isObject','message','lodash','../../../../../../config/logger'];(function(_0x111c69,_0x5445d8){var _0x5635bc=function(_0x1cfc18){while(--_0x1cfc18){_0x111c69['push'](_0x111c69['shift']());}};_0x5635bc(++_0x5445d8);}(_0xbb33,0xb7));var _0x3bb3=function(_0x4ade33,_0x103537){_0x4ade33=_0x4ade33-0x0;var _0x162cc1=_0xbb33[_0x4ade33];return _0x162cc1;};'use strict';var BPromise=require('bluebird');var _=require(_0x3bb3('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require(_0x3bb3('0x1'))('agi');module[_0x3bb3('0x2')]=function(_0x26680b,_0x215ba7,_0x3ac4c9,_0x3ef3c4){return new BPromise(function(_0x1e0f54,_0x116166){logger[_0x3bb3('0x3')](_0x3bb3('0x4'),_0x3ef3c4||_0x3bb3('0x5'));var _0x444d32=new WebSocket(_0x3ef3c4||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x23707a='';var _0x5edb11='0';var _0x4d900c='1';var _0xba5184=_0x3bb3('0x6');function _0x57c292(_0x1b1ca9){var _0x52ed84=crypto['createHash'](_0x3bb3('0x7'));_0x52ed84[_0x3bb3('0x8')](_0x1b1ca9);return _0x52ed84[_0x3bb3('0x9')](_0x3bb3('0xa'));}function _0x5edd16(){try{logger['info'](_0x3bb3('0xb'));var _0x4aab27=moment()['unix']();var _0x126d75=_0x57c292(_0x4aab27+_0x215ba7+_0x3ac4c9);_0x444d32[_0x3bb3('0xc')](JSON[_0x3bb3('0xd')]({'appID':_0x215ba7,'timestamp':_0x4aab27,'appKey':_0x126d75}));var _0x3d2022=fs[_0x3bb3('0xe')](_0x26680b);_0x3d2022['on'](_0x3bb3('0xf'),function(_0x5c90aa){_0x444d32[_0x3bb3('0xc')](_0x5c90aa);});_0x3d2022['on'](_0x3bb3('0x10'),function(){_0x444d32[_0x3bb3('0xc')]('EOS');});}catch(_0x51b18d){logger[_0x3bb3('0x11')](_0x3bb3('0x12'),JSON['stringify'](_0x51b18d));_0x444d32[_0x3bb3('0x13')]();}}function _0x39db63(_0x188016){try{if(_0x188016){var _0x107da2=JSON[_0x3bb3('0x14')](_0x188016);switch(_0x107da2[_0x3bb3('0x15')]){case 0x0:if(_0x107da2[_0x3bb3('0x16')]){if(_0x107da2[_0x3bb3('0x16')][_0x3bb3('0x17')]){logger[_0x3bb3('0x3')]('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0x107da2['result'][_0x3bb3('0x18')]));_0x23707a=_0x107da2[_0x3bb3('0x16')][_0x3bb3('0x18')][0x0][_0x3bb3('0x19')];_0x5edb11=_0x107da2[_0x3bb3('0x16')][_0x3bb3('0x18')][0x0][_0x3bb3('0x1a')];_0x4d900c='0';_0xba5184=_0x3bb3('0x1b');_0x444d32['terminate']();}}break;case 0x1:logger[_0x3bb3('0x3')](_0x3bb3('0x6'));_0x4d900c='1';_0xba5184='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x3bb3('0x3')](_0x3bb3('0x1c'));_0x4d900c='2';_0xba5184=_0x3bb3('0x1c');break;case 0x9:logger['info'](_0x3bb3('0x1d'));_0x4d900c='9';_0xba5184=_0x3bb3('0x1d');break;case 0xa:logger[_0x3bb3('0x3')](_0x3bb3('0x1e'));_0x4d900c='10';_0xba5184=_0x3bb3('0x1e');break;case 0xb:logger['info'](_0x3bb3('0x1f'));_0x4d900c='11';_0xba5184=_0x3bb3('0x1f');}}}catch(_0x295e70){logger[_0x3bb3('0x11')](_0x3bb3('0x20'),JSON[_0x3bb3('0xd')](_0x295e70));_0x444d32['terminate']();}}function _0x47c50c(){logger['info'](_0x3bb3('0x21'));_0x1e0f54({'transcript':_0x23707a,'confidence':_0x5edb11,'status':_0x4d900c,'status_message':_0xba5184});}function _0x126c16(_0x47fd62){logger[_0x3bb3('0x11')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x3bb3('0x22')](_0x47fd62)){logger[_0x3bb3('0x11')](_[_0x3bb3('0x23')](_0x47fd62)?JSON[_0x3bb3('0xd')](_0x47fd62):_0x47fd62);}}_0x444d32['on']('open',_0x5edd16);_0x444d32['on'](_0x3bb3('0x24'),_0x39db63);_0x444d32['on']('close',_0x47c50c);_0x444d32['on'](_0x3bb3('0x11'),_0x126c16);});}; \ 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 ddc7014..384648a 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 _0x6d11=['./asr','exports'];(function(_0x339392,_0xdeadc4){var _0x1bb11d=function(_0x26ef34){while(--_0x26ef34){_0x339392['push'](_0x339392['shift']());}};_0x1bb11d(++_0xdeadc4);}(_0x6d11,0x8c));var _0x16d1=function(_0x4e4ceb,_0x33194e){_0x4e4ceb=_0x4e4ceb-0x0;var _0x34d8d0=_0x6d11[_0x4e4ceb];return _0x34d8d0;};var asr=require(_0x16d1('0x0'));module[_0x16d1('0x1')]={'asr':asr}; \ No newline at end of file +var _0xebe9=['./asr','exports'];(function(_0x40d534,_0xc3ea1d){var _0x5b93c3=function(_0x55bed1){while(--_0x55bed1){_0x40d534['push'](_0x40d534['shift']());}};_0x5b93c3(++_0xc3ea1d);}(_0xebe9,0x70));var _0x9ebe=function(_0x4adf44,_0x188e88){_0x4adf44=_0x4adf44-0x0;var _0x3bcb5d=_0xebe9[_0x4adf44];return _0x3bcb5d;};var asr=require(_0x9ebe('0x0'));module[_0x9ebe('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index a1156f1..b7030f4 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 _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x4fc80b,_0xfe1b3d){var _0x119dba=function(_0x16ed12){while(--_0x16ed12){_0x4fc80b['push'](_0x4fc80b['shift']());}};_0x119dba(++_0xfe1b3d);}(_0xe706,0xa3));var _0x6e70=function(_0x40c402,_0x42ee7d){_0x40c402=_0x40c402-0x0;var _0x4e7680=_0xe706[_0x40c402];return _0x4e7680;};'use strict';var util=require(_0x6e70('0x0'));var net=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIError=require(_0x6e70('0x3'));var AGIChannel=require(_0x6e70('0x4'));var AGIServer=function(_0x2ca810,_0x7dfbc3,_0x142c27){var _0x2164a4=this;var _0x376a8d=null;var _0x506db9=0x0;if(!_0x2ca810)_0x2ca810=0x11dd;if(!_0x7dfbc3)_0x7dfbc3=_0x6e70('0x5');EventEmitter[_0x6e70('0x6')](_0x2164a4);function _0x36357b(){if(!_0x2ca810){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x9')));return![];}_0x376a8d=net[_0x6e70('0xa')]();_0x376a8d[_0x6e70('0xb')](_0x2ca810,_0x7dfbc3);_0x376a8d['on'](_0x6e70('0xc'),function(){_0x2164a4[_0x6e70('0x7')](_0x6e70('0xc'));});_0x376a8d['on'](_0x6e70('0xd'),function(_0x743eb5){_0x376a8d[_0x6e70('0xe')](function(_0x37b3e0,_0x4600f9){if(_0x37b3e0){_0x2164a4['emit']('error',new AGIError(_0x6e70('0xf'),_0x37b3e0));}else if(_0x142c27&&_0x142c27<0x0){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x10')));_0x743eb5[_0x6e70('0x11')]();}else if(_0x142c27&&_0x142c27>0x0&&_0x142c27<_0x4600f9){_0x506db9+=0x1;_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x12'),_0x506db9));_0x743eb5['destroy']();}else{var _0x52737e=new AGIChannel(_0x743eb5);_0x52737e['on']('ready',function(){_0x2164a4[_0x6e70('0x7')]('connection',_0x52737e);});}});});_0x376a8d['on']('error',function(_0x304716){_0x2164a4[_0x6e70('0x7')]('error',new AGIError(_0x6e70('0xf'),_0x304716['code']));});_0x376a8d['on'](_0x6e70('0x13'),function(){_0x2164a4[_0x6e70('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6e70('0x14')](function(){_0x36357b();});};util['inherits'](AGIServer,EventEmitter);module[_0x6e70('0x15')]=function(_0x173afe,_0x53acdc,_0x497d61){return new AGIServer(_0x173afe,_0x53acdc,_0x497d61);}; \ No newline at end of file +var _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x134058,_0x423995){var _0x14a1a9=function(_0x47a2c9){while(--_0x47a2c9){_0x134058['push'](_0x134058['shift']());}};_0x14a1a9(++_0x423995);}(_0xe706,0xa3));var _0x6e70=function(_0x2d21cc,_0x27ef2a){_0x2d21cc=_0x2d21cc-0x0;var _0x7ab87e=_0xe706[_0x2d21cc];return _0x7ab87e;};'use strict';var util=require(_0x6e70('0x0'));var net=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIError=require(_0x6e70('0x3'));var AGIChannel=require(_0x6e70('0x4'));var AGIServer=function(_0x2ca810,_0x7dfbc3,_0x142c27){var _0x2164a4=this;var _0x376a8d=null;var _0x506db9=0x0;if(!_0x2ca810)_0x2ca810=0x11dd;if(!_0x7dfbc3)_0x7dfbc3=_0x6e70('0x5');EventEmitter[_0x6e70('0x6')](_0x2164a4);function _0x36357b(){if(!_0x2ca810){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x9')));return![];}_0x376a8d=net[_0x6e70('0xa')]();_0x376a8d[_0x6e70('0xb')](_0x2ca810,_0x7dfbc3);_0x376a8d['on'](_0x6e70('0xc'),function(){_0x2164a4[_0x6e70('0x7')](_0x6e70('0xc'));});_0x376a8d['on'](_0x6e70('0xd'),function(_0x743eb5){_0x376a8d[_0x6e70('0xe')](function(_0x37b3e0,_0x4600f9){if(_0x37b3e0){_0x2164a4['emit']('error',new AGIError(_0x6e70('0xf'),_0x37b3e0));}else if(_0x142c27&&_0x142c27<0x0){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x10')));_0x743eb5[_0x6e70('0x11')]();}else if(_0x142c27&&_0x142c27>0x0&&_0x142c27<_0x4600f9){_0x506db9+=0x1;_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x12'),_0x506db9));_0x743eb5['destroy']();}else{var _0x52737e=new AGIChannel(_0x743eb5);_0x52737e['on']('ready',function(){_0x2164a4[_0x6e70('0x7')]('connection',_0x52737e);});}});});_0x376a8d['on']('error',function(_0x304716){_0x2164a4[_0x6e70('0x7')]('error',new AGIError(_0x6e70('0xf'),_0x304716['code']));});_0x376a8d['on'](_0x6e70('0x13'),function(){_0x2164a4[_0x6e70('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6e70('0x14')](function(){_0x36357b();});};util['inherits'](AGIServer,EventEmitter);module[_0x6e70('0x15')]=function(_0x173afe,_0x53acdc,_0x497d61){return new AGIServer(_0x173afe,_0x53acdc,_0x497d61);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index e70c0d5..c9ef130 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 _0xc2da=['setVariable','%s.%s','split','replaceAll','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','noop','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','grammar','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','delay','minutes','scheduledAt','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','lumenvoxasr','no\x20grammar\x20configured','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','sip_id','no\x20user\x20selected','SIP/%s','opts','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','no\x20text\x20configured','bot','DIALOGFLOW_%s','out','Dialogflow\x20Result\x20%s','speech','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','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','retry','no\x20file\x20audio\x20selected','getSound','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','getdigits','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','recordFile','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appsecret\x20configured','intKey','tilde\x20%s\x20file\x20created','tildeASR','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','%s/recordings/%s','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','streamFile','ispeech\x20TTS\x20is\x20unreachable','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','agentLogin','AGENT\x20%s\x20FOUND\x20BY','success','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','AGENT\x20%s\x20NOT\x20FOUND\x20BY','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','indexOf','toLowerCase','QUEUE','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','no\x20variable\x20selected\x20for\x20the\x20response','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','sayDigits','digits','saynumber','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','email','user','bcc','subject','debug','sendMail\x20message','smtpOptions','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','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','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','util','shelljs','randomstring','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','name','getSquareProject','getSquareOdbc','getUser','getUserById','getTrunk','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','interval','map','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','callerid','calleridname','context','extension','priority','arg_1','file','createSquareMessage','createCmContact','isEmpty','isNil','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agentUnpause','agent','agentLogout','internal','%s/%s@from-sip/n','shellCommand','exec','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','sync','uri','stringify','render','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','speed','ispeechASR','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','googleASR','google_asr_language','appsecret','clear','clone','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','isArray','length','saveRestApiResult'];(function(_0x830373,_0x2cf83e){var _0x49efed=function(_0x49853a){while(--_0x49853a){_0x830373['push'](_0x830373['shift']());}};_0x49efed(++_0x2cf83e);}(_0xc2da,0x124));var _0xac2d=function(_0x5efdc0,_0x2f7a64){_0x5efdc0=_0x5efdc0-0x0;var _0x377ab5=_0xc2da[_0x5efdc0];return _0x377ab5;};'use strict';var fs=require('fs');var util=require(_0xac2d('0x0'));var _=require('lodash');var sh=require(_0xac2d('0x1'));var odbc=require('odbc')();var rs=require(_0xac2d('0x2'));var moment=require('moment');var Mustache=require(_0xac2d('0x3'));var rp=require(_0xac2d('0x4'));var logger=require(_0xac2d('0x5'))(_0xac2d('0x6'));var config=require(_0xac2d('0x7'));var shared=require(_0xac2d('0x8'));var scripts=require(_0xac2d('0x9'));var FILES_PATH=_0xac2d('0xa');var recursiveMapAttributes=[_0xac2d('0xb'),_0xac2d('0xc')];var verticesWithRetry=[_0xac2d('0xd'),'getdigits','getsecretdigits'];var AGIVertices=function(_0x59a99,_0x4b2475,_0x4271fa){this[_0xac2d('0xe')]=_0x59a99;this[_0xac2d('0xf')]=_0x4b2475;this[_0xac2d('0x10')]=_0x4271fa;};AGIVertices[_0xac2d('0x11')][_0xac2d('0x12')]=function(_0x47d03e,_0x58bc7d){this[_0xac2d('0xf')][_0xac2d('0x13')](_0x47d03e)[_0xac2d('0x14')](function(_0xef707a){_0x58bc7d(null,_0xef707a?_0xef707a['name']:![]);})[_0xac2d('0x15')](function(_0x20fa0d){_0x58bc7d(_0x20fa0d);});};AGIVertices[_0xac2d('0x11')][_0xac2d('0x16')]=function(_0x394187,_0x2bed84){this[_0xac2d('0xf')][_0xac2d('0x17')](_0x394187)[_0xac2d('0x14')](function(_0x406551){_0x2bed84(null,_0x406551?_0x406551[_0xac2d('0x18')]:![]);})[_0xac2d('0x15')](function(_0x74853a){_0x2bed84(_0x74853a);});};AGIVertices[_0xac2d('0x11')][_0xac2d('0x19')]=function(_0x49c0a9,_0x3170ae){this[_0xac2d('0xf')]['getSquareProjectById'](_0x49c0a9)[_0xac2d('0x14')](function(_0xed956b){_0x3170ae(null,_0xed956b?_0xed956b[_0xac2d('0x18')]:![]);})['catch'](function(_0x45c12b){_0x3170ae(_0x45c12b);});};AGIVertices['prototype'][_0xac2d('0x1a')]=function(_0x3651e6,_0x51e621){this[_0xac2d('0xf')]['getSquareOdbcById'](_0x3651e6)['then'](function(_0x510e85){_0x51e621(null,_0x510e85?_0x510e85['dsn']:![]);})[_0xac2d('0x15')](function(_0x21c407){_0x51e621(_0x21c407);});};AGIVertices[_0xac2d('0x11')][_0xac2d('0x1b')]=function(_0x211d26,_0x391911){this[_0xac2d('0xf')][_0xac2d('0x1c')](_0x211d26)[_0xac2d('0x14')](function(_0x3f1212){_0x391911(null,_0x3f1212?_0x3f1212[_0xac2d('0x18')]:![]);})[_0xac2d('0x15')](function(_0x1df55b){_0x391911(_0x1df55b);});};AGIVertices[_0xac2d('0x11')][_0xac2d('0x1d')]=function(_0x8d0e32,_0x13e1e7){this[_0xac2d('0xf')][_0xac2d('0x1e')](_0x8d0e32)['then'](function(_0x3d72db){_0x13e1e7(null,_0x3d72db?_0x3d72db[_0xac2d('0x18')]:![]);})[_0xac2d('0x15')](function(_0x2323c8){_0x13e1e7(_0x2323c8);});};AGIVertices['prototype']['getSound']=function(_0x1714c1,_0x1c69f1){var _0x2ad9b1=this;this[_0xac2d('0xf')][_0xac2d('0x1f')](_0x1714c1)[_0xac2d('0x14')](function(_0x104af8){_0x1c69f1(null,_0x104af8?_0x2ad9b1[_0xac2d('0x20')](_0x104af8[_0xac2d('0x21')]):![]);})['catch'](function(_0x598f19){_0x1c69f1(_0x598f19);});};AGIVertices[_0xac2d('0x11')][_0xac2d('0x22')]=function(_0x3f1094,_0x44b9d0){this[_0xac2d('0xf')]['getMailAccountById'](_0x3f1094)[_0xac2d('0x14')](function(_0x37f7ad){_0x44b9d0(null,_0x37f7ad?_0x37f7ad:![]);})['catch'](function(_0x788967){_0x44b9d0(_0x788967);});};AGIVertices[_0xac2d('0x11')][_0xac2d('0x23')]=function(_0x632d16,_0x4ddf2c,_0x3f2eaa){this['mailRpc'][_0xac2d('0x23')](_0x632d16,_0x4ddf2c)[_0xac2d('0x14')](function(){_0x3f2eaa(null);})['catch'](function(_0x8402a7){_0x3f2eaa(_0x8402a7);});};AGIVertices[_0xac2d('0x11')][_0xac2d('0x24')]=function(_0x1d9da4,_0x2e6733){this['rpc'][_0xac2d('0x25')](_0x1d9da4)['then'](function(_0x2d2a36){if(_0x2d2a36){if(_0x2d2a36['IntervalId']){_0x2e6733(null,[_0x2d2a36[_0xac2d('0x26')]]);}else{_0x2e6733(null,_[_0xac2d('0x27')](_0x2d2a36['Intervals'],'interval'));}}else{_0x2e6733(null,![]);}})[_0xac2d('0x15')](function(_0x1d6cc6){_0x2e6733(_0x1d6cc6);});};AGIVertices[_0xac2d('0x11')][_0xac2d('0x20')]=function(_0x3c0533){return util[_0xac2d('0x28')](_0xac2d('0x29'),FILES_PATH,_0x3c0533);};AGIVertices['prototype'][_0xac2d('0x2a')]=function(_0x20aabc,_0xe14b3f,_0x288dc0){odbc[_0xac2d('0x2b')](_0x20aabc,function(_0x4eb307){if(_0x4eb307){logger[_0xac2d('0x2c')](_0xac2d('0x2d'),_0x4eb307);_0x288dc0(_0x4eb307);}else{logger[_0xac2d('0x2e')](_0xac2d('0x2f'));odbc[_0xac2d('0x30')](_0xe14b3f,function(_0x43aa06,_0x18ca80){if(_0x43aa06){logger[_0xac2d('0x2e')](_0xac2d('0x31'),_0xe14b3f);_0x288dc0(_0x43aa06);}else{logger[_0xac2d('0x2e')]('Query\x20executed\x20correctly\x20%s',_0xe14b3f);odbc[_0xac2d('0x32')](function(_0x54afa2){if(_0x54afa2){logger[_0xac2d('0x2c')](_0xac2d('0x33'),_0x54afa2);}_0x288dc0(null,_0x18ca80);});}});}});};AGIVertices[_0xac2d('0x11')][_0xac2d('0x34')]=function(_0x3a1f0b,_0x589012){this[_0xac2d('0xf')][_0xac2d('0x35')](_0x3a1f0b)[_0xac2d('0x14')](function(_0x877153){_0x589012(null,_0x877153?_0x877153:![]);})[_0xac2d('0x15')](function(_0x5badbf){_0x589012(_0x5badbf);});};AGIVertices['prototype']['createSmsMessage']=function(_0x2b1cc2,_0x27e948){this[_0xac2d('0xf')][_0xac2d('0x36')](_0x2b1cc2)[_0xac2d('0x14')](function(_0x489897){_0x27e948(null,_0x489897);})[_0xac2d('0x15')](function(_0x423c89){_0x27e948(_0x423c89);});};AGIVertices['prototype'][_0xac2d('0x37')]=function(_0x16c3b0,_0x12c81b,_0x41a45d){this[_0xac2d('0xf')]['createSquareDetailsReport']({'uniqueid':this[_0xac2d('0xe')][_0xac2d('0x38')],'node':_0x16c3b0[_0xac2d('0x39')],'application':_0x16c3b0[_0xac2d('0x3a')],'data':_0x12c81b||null,'project_name':this['channel']['arg_1'],'callerid':this[_0xac2d('0xe')]['callerid']})[_0xac2d('0x14')](function(_0x1d7d7b){if(_0x41a45d){_0x41a45d(null,_0x1d7d7b);}})['catch'](function(_0x562024){if(_0x41a45d){_0x41a45d(_0x562024);}});};AGIVertices[_0xac2d('0x11')]['createSquareRecording']=function(_0x4be9de,_0x4f1cb6,_0x424a37,_0x315aef){this[_0xac2d('0xf')]['createSquareRecording']({'uniqueid':this[_0xac2d('0xe')]['uniqueid'],'callerid':this[_0xac2d('0xe')][_0xac2d('0x3b')],'calleridname':this['channel'][_0xac2d('0x3c')],'context':this[_0xac2d('0xe')][_0xac2d('0x3d')],'extension':this[_0xac2d('0xe')][_0xac2d('0x3e')],'priority':this['channel'][_0xac2d('0x3f')],'accountcode':this[_0xac2d('0xe')]['accountcode'],'dnid':this[_0xac2d('0xe')]['dnid'],'projectName':this['channel'][_0xac2d('0x40')],'saveName':_0x4f1cb6,'filename':_0x4be9de[_0xac2d('0x41')]||_0x4f1cb6,'savePath':_0x424a37})['then'](function(_0x3a01b9){_0x315aef(null,_0x3a01b9);})[_0xac2d('0x15')](function(_0x29935b){_0x315aef(_0x29935b);});};AGIVertices[_0xac2d('0x11')][_0xac2d('0x42')]=function(_0x1ffa82,_0x658d69,_0x57bf66,_0x1975fb,_0x2df040){this['rpc'][_0xac2d('0x42')]({'uniqueid':this[_0xac2d('0xe')][_0xac2d('0x38')],'body':_0x1ffa82,'direction':_0x658d69,'providerName':_0x57bf66,'providerResponse':_0x1975fb})[_0xac2d('0x14')](function(_0x24c58e){if(_0x2df040){_0x2df040(null,_0x24c58e);}})['catch'](function(_0xe0ff6b){if(_0x2df040){_0x2df040(_0xe0ff6b);}});};AGIVertices['prototype']['createCmContact']=function(_0x386c7c,_0x5b7d0d){this[_0xac2d('0xf')][_0xac2d('0x43')]({'firstName':_[_0xac2d('0x44')](_0x386c7c[_0xac2d('0x18')])||_[_0xac2d('0x45')](_0x386c7c[_0xac2d('0x18')])?'callback_'+Math['random']():_0x386c7c[_0xac2d('0x18')],'lastName':_[_0xac2d('0x44')](_0x386c7c[_0xac2d('0x46')])||_[_0xac2d('0x45')](_0x386c7c['lastName'])?null:_0x386c7c[_0xac2d('0x46')],'phone':_0x386c7c[_0xac2d('0x47')],'ListId':_0x386c7c[_0xac2d('0x48')],'scheduledat':_0x386c7c['scheduledAt'],'callbackUniqueid':this[_0xac2d('0xe')][_0xac2d('0x38')],'tags':_0xac2d('0x49'),'description':_0xac2d('0x4a')+_0x386c7c['scheduledAt'][_0xac2d('0x4b')](),'priority':_0x386c7c[_0xac2d('0x4c')]})[_0xac2d('0x14')](function(_0x4ceffa){_0x5b7d0d(null,_0x4ceffa);})[_0xac2d('0x15')](function(_0x5e09af){_0x5b7d0d(_0x5e09af);});};AGIVertices[_0xac2d('0x11')][_0xac2d('0x4d')]=function(_0x47b12c,_0x244bdd){this[_0xac2d('0xf')][_0xac2d('0x4e')](_0x47b12c)[_0xac2d('0x14')](function(_0x3911a1){_0x244bdd(null,_0x3911a1?_0x3911a1[_0xac2d('0x18')]:![]);})['catch'](function(_0x4c4811){_0x244bdd(_0x4c4811);});};AGIVertices[_0xac2d('0x11')][_0xac2d('0x4f')]=function(_0x3c0196,_0x1bc0f8,_0x1335c2){var _0x13ffff={'role':'agent'};_0x13ffff[_0x3c0196]=this[_0xac2d('0xe')][_0xac2d('0x3b')];this[_0xac2d('0xf')][_0xac2d('0x4f')](_0x13ffff,_0x1bc0f8,this[_0xac2d('0xe')][_0xac2d('0x38')])[_0xac2d('0x14')](function(_0x343002){_0x1335c2(null,_[_0xac2d('0x45')](_0x343002)?![]:!![]);})['catch'](function(_0x20669d){logger[_0xac2d('0x2c')](_0x20669d);_0x1335c2(null,![]);});};AGIVertices[_0xac2d('0x11')][_0xac2d('0x50')]=function(_0x1f2cc0,_0x13c88d){var _0x2eab04={'role':_0xac2d('0x51')};_0x2eab04[_0x1f2cc0]=this['channel']['callerid'];this[_0xac2d('0xf')][_0xac2d('0x50')](_0x2eab04)[_0xac2d('0x14')](function(_0x359b02){_0x13c88d(null,_[_0xac2d('0x45')](_0x359b02)?![]:!![]);})[_0xac2d('0x15')](function(_0x3900d6){logger[_0xac2d('0x2c')](_0x3900d6);_0x13c88d(null,![]);});};AGIVertices[_0xac2d('0x11')][_0xac2d('0x52')]=function(_0x5183f5,_0x2436ea){var _0x46f2d3={'role':'agent'};_0x46f2d3[_0x5183f5]=this[_0xac2d('0xe')][_0xac2d('0x3b')];this['rpc'][_0xac2d('0x52')](_0x46f2d3)[_0xac2d('0x14')](function(_0x33a038){_0x2436ea(null,_[_0xac2d('0x45')](_0x33a038)?![]:!![]);})['catch'](function(_0x594218){logger['error'](_0x594218);_0x2436ea(null,![]);});};AGIVertices[_0xac2d('0x11')]['agentLogin']=function(_0x681dc3,_0x3cb461){var _0x15577e={'role':'agent'};_0x15577e[_0x681dc3]=this['channel'][_0xac2d('0x3b')];var _0x22db1a=_0x681dc3!=_0xac2d('0x53')?util[_0xac2d('0x28')](_0xac2d('0x54'),'LOCAL',this['channel'][_0xac2d('0x3b')]):undefined;this['rpc']['agentLogin'](_0x15577e,_0x22db1a)[_0xac2d('0x14')](function(_0x3875f1){_0x3cb461(null,_[_0xac2d('0x45')](_0x3875f1)?![]:!![]);})[_0xac2d('0x15')](function(_0x1c08ee){logger[_0xac2d('0x2c')](_0x1c08ee);_0x3cb461(null,![]);});};AGIVertices[_0xac2d('0x11')][_0xac2d('0x55')]=function(_0x32885b,_0x407862){sh[_0xac2d('0x56')](_['trim'](_0x32885b),function(_0x53d190,_0x175031){var _0x3b6cd2=_0x175031[_0xac2d('0x57')](/(\r\n|\n|\r)/gm,'');_0x407862(null,_0x3b6cd2);});};AGIVertices[_0xac2d('0x11')]['googleCloudTTS']=function(_0x202c15,_0x168da4){scripts[_0xac2d('0x58')](_0x202c15[_0xac2d('0x59')],_0x202c15['google_cloud_tts_text_type']||_0xac2d('0x5a'),_0x202c15[_0xac2d('0x5a')],_0x202c15[_0xac2d('0x5b')]||_0xac2d('0x5c'),_0x202c15[_0xac2d('0x5d')]||_0xac2d('0x5e'),_0x202c15[_0xac2d('0x5f')]||_0xac2d('0x60'))[_0xac2d('0x14')](function(_0x81de8){_0x168da4(null,_0x81de8);})['catch'](function(_0x22838a){_0x168da4(_0x22838a);});};AGIVertices[_0xac2d('0x11')][_0xac2d('0x61')]=function(_0xf3bef4,_0x58d42c){scripts[_0xac2d('0x61')](_0xf3bef4[_0xac2d('0x5a')],_0xf3bef4[_0xac2d('0x62')]||'en',0x1)[_0xac2d('0x14')](function(_0x2898c4){_0x58d42c(null,_0x2898c4);})[_0xac2d('0x15')](function(_0xdbbd92){_0x58d42c(_0xdbbd92);});};AGIVertices['prototype'][_0xac2d('0x63')]=function(_0x2fbe43,_0x3c22a5){var _0x58c05f={'uri':_0x2fbe43[_0xac2d('0x64')],'method':_0x2fbe43[_0xac2d('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x2fbe43[_0xac2d('0x66')])===_0xac2d('0x67')&&parseInt(_0x2fbe43['timeout'])>=0x1?parseInt(_0x2fbe43[_0xac2d('0x66')])*0x3e8:0x5*0x3e8};if(_[_0xac2d('0x68')]([_0xac2d('0x69'),_0xac2d('0x6a')],_0x58c05f[_0xac2d('0x65')][_0xac2d('0x6b')]())){try{_0x58c05f[_0xac2d('0x6c')]=_0x2fbe43[_0xac2d('0xc')]?JSON['parse'](_0x2fbe43['rawBody']):{};}catch(_0x35621f){logger[_0xac2d('0x2c')](_0xac2d('0x6d'),_0x35621f);}}try{_0x58c05f[_0xac2d('0x6e')]=_0x2fbe43['rawHeaders']?JSON[_0xac2d('0x6f')](_0x2fbe43[_0xac2d('0xb')]):{};}catch(_0xe3456a){logger['error'](_0xac2d('0x70'),_0xe3456a);}if(_0x2fbe43['computedVariables']){try{var _0x4dfc94=require(_0x2fbe43['computedVariables'])[_0xac2d('0x71')](this,_0x58c05f);_0x58c05f[_0xac2d('0x72')]=Mustache['render'](_0x2fbe43['url'],_0x4dfc94,{},['$$','$$']);if(_0x58c05f[_0xac2d('0x6e')]){_0x58c05f[_0xac2d('0x6e')]=JSON[_0xac2d('0x6f')](Mustache['render'](JSON[_0xac2d('0x73')](_0x58c05f[_0xac2d('0x6e')]),_0x4dfc94,{},['$$','$$']));}if(_0x58c05f['body']){_0x58c05f['body']=JSON[_0xac2d('0x6f')](Mustache[_0xac2d('0x74')](JSON[_0xac2d('0x73')](_0x58c05f['body']),_0x4dfc94,{},['$$','$$']));}}catch(_0x3de533){logger['error'](_0xac2d('0x75'),_0x3de533);}}rp(_0x58c05f)['then'](function(_0x3f41b2){var _0x58ec98={'statusCode':_0x3f41b2[_0xac2d('0x76')]||0xc8,'statusMessage':_0x3f41b2['statusMessage']||'OK','headers':_0x3f41b2['headers']||{},'body':_0x3f41b2[_0xac2d('0x6c')]||{}};_0x3c22a5(null,_0x58ec98);})[_0xac2d('0x15')](function(_0x1c173b){var _0x3eaf2d={'statusCode':_0x1c173b['statusCode']||0x1f4,'statusMessage':_0x1c173b[_0xac2d('0x77')]||_0xac2d('0x78'),'headers':_0x1c173b['options']['headers']||{},'body':_0x1c173b[_0xac2d('0x79')][_0xac2d('0x6c')]||{}};_0x3c22a5(null,_0x3eaf2d);});};AGIVertices[_0xac2d('0x11')][_0xac2d('0x7a')]=function(_0x5304e2,_0x375582){scripts[_0xac2d('0x7a')](this[_0xac2d('0xe')][_0xac2d('0x38')],_0x5304e2['key'],_0x5304e2['text'],_0x5304e2['dialogflow_language']||'en')['then'](function(_0x4b63f7){_0x375582(null,_0x4b63f7);})['catch'](function(_0xc1cdd){_0x375582(_0xc1cdd);});};AGIVertices['prototype'][_0xac2d('0x7b')]=function(_0x56c3ed,_0x58b3f6){scripts[_0xac2d('0x7b')](this[_0xac2d('0xe')][_0xac2d('0x38')],_0x56c3ed['dialogflowV2_project_id'],_0x56c3ed[_0xac2d('0x7c')],_0x56c3ed[_0xac2d('0x7d')],_0x56c3ed[_0xac2d('0x5a')],_0x56c3ed[_0xac2d('0x7e')]||'en')[_0xac2d('0x14')](function(_0x397b25){_0x58b3f6(null,_0x397b25);})[_0xac2d('0x15')](function(_0x5f4489){_0x58b3f6(_0x5f4489);});};AGIVertices[_0xac2d('0x11')][_0xac2d('0x7f')]=function(_0x30ece8,_0x1f941f){scripts[_0xac2d('0x7f')](this[_0xac2d('0xe')],_0x30ece8)[_0xac2d('0x14')](function(_0x537ae3){_0x1f941f(null,_0x537ae3);})[_0xac2d('0x15')](function(_0x265928){_0x1f941f(_0x265928);});};AGIVertices[_0xac2d('0x11')][_0xac2d('0x80')]=function(_0x2b0397,_0x3d7fe3){scripts[_0xac2d('0x80')](_0x2b0397[_0xac2d('0x81')],_0x2b0397[_0xac2d('0x5a')],_0x2b0397['ispeech_tts_language']||'en-US',_0x2b0397[_0xac2d('0x82')])[_0xac2d('0x14')](function(_0x403a8f){_0x3d7fe3(null,_0x403a8f);})[_0xac2d('0x15')](function(_0x2eb091){_0x3d7fe3(_0x2eb091);});};AGIVertices[_0xac2d('0x11')][_0xac2d('0x83')]=function(_0x5759c5,_0x2526e0,_0x26495d){scripts['ispeechASR'](_0x2526e0,_0x5759c5['key'],_0x5759c5['ispeech_asr_language']||_0xac2d('0x5c'),this[_0xac2d('0x84')](_0x5759c5['model'])?_0x5759c5[_0xac2d('0x85')]:undefined)[_0xac2d('0x14')](function(_0x1088d7){_0x26495d(null,_0x1088d7);})[_0xac2d('0x15')](function(_0x55ab06){_0x26495d(_0x55ab06);});};AGIVertices[_0xac2d('0x11')][_0xac2d('0x86')]=function(_0x408250,_0x1d2566){scripts[_0xac2d('0x86')](_0x408250[_0xac2d('0x87')],_0x408250[_0xac2d('0x88')],_0x408250[_0xac2d('0x89')],_0x408250[_0xac2d('0x8a')]||_0xac2d('0x8b'),_0x408250[_0xac2d('0x5a')],_0x408250[_0xac2d('0x8c')]||_0xac2d('0x5a'))[_0xac2d('0x14')](function(_0x568eb1){_0x1d2566(null,_0x568eb1);})['catch'](function(_0x4ac3c2){_0x1d2566(_0x4ac3c2);});};AGIVertices['prototype'][_0xac2d('0x8d')]=function(_0x13b10d,_0x5702a3){scripts[_0xac2d('0x8d')](this['channel'][_0xac2d('0x38')],_0x13b10d[_0xac2d('0x87')],_0x13b10d[_0xac2d('0x88')],_0x13b10d[_0xac2d('0x8e')],_0x13b10d[_0xac2d('0x5a')],_0x13b10d['aws_bot_name'])[_0xac2d('0x14')](function(_0xdb178c){_0x5702a3(null,_0xdb178c);})[_0xac2d('0x15')](function(_0x111d08){_0x5702a3(_0x111d08);});};AGIVertices[_0xac2d('0x11')]['googleASR']=function(_0x3fa640,_0x28eccc,_0x128bf0){scripts[_0xac2d('0x8f')](_0x28eccc,_0x3fa640[_0xac2d('0x81')],_0x3fa640[_0xac2d('0x90')]||_0xac2d('0x5c'))[_0xac2d('0x14')](function(_0x580de4){_0x128bf0(null,_0x580de4);})[_0xac2d('0x15')](function(_0x115a33){_0x128bf0(_0x115a33);});};AGIVertices[_0xac2d('0x11')]['tildeASR']=function(_0x171ced,_0x463f1e,_0x2e3f5a){scripts['tildeASR'](_0x463f1e,_0x171ced['appid'],_0x171ced[_0xac2d('0x91')],_0x171ced[_0xac2d('0x72')])[_0xac2d('0x14')](function(_0x3eb05e){_0x2e3f5a(null,_0x3eb05e);})[_0xac2d('0x15')](function(_0x28560f){_0x2e3f5a(_0x28560f);});};AGIVertices['prototype'][_0xac2d('0x92')]=function(_0x38fe69){var _0x3029de=_['includes'](verticesWithRetry,_0x38fe69[_0xac2d('0x3a')])?_0x38fe69:_[_0xac2d('0x93')](_0x38fe69);for(var _0x259d65 in _0x3029de){if(_0x3029de['hasOwnProperty'](_0x259d65)){if(_0x3029de[_0x259d65]&&_[_0xac2d('0x94')](_0x3029de[_0x259d65])){if(_[_0xac2d('0x68')](recursiveMapAttributes,_0x259d65)){_0x3029de[_0x259d65]=this[_0xac2d('0x95')](_0x3029de[_0x259d65]);}else{_0x3029de[_0x259d65]=this[_0xac2d('0x96')](_0x3029de[_0x259d65]);}}}}return _0x3029de;};AGIVertices[_0xac2d('0x11')][_0xac2d('0x97')]=function(_0x282f36){for(var _0x3c9fc6 in _0x282f36){if(_0x282f36[_0xac2d('0x98')](_0x3c9fc6)){if(_[_0xac2d('0x99')](_0x282f36[_0x3c9fc6])){this[_0xac2d('0x97')](_0x282f36[_0x3c9fc6]);}else if(_[_0xac2d('0x9a')](_0x282f36[_0x3c9fc6])){for(var _0x3edaff=0x0;_0x3edaff<_0x282f36[_0x3c9fc6][_0xac2d('0x9b')];_0x3edaff++){this['recursiveNodeIndex'](_0x282f36[_0x3c9fc6][_0x3edaff]);}}else if(_[_0xac2d('0x94')](_0x282f36[_0x3c9fc6])){_0x282f36[_0x3c9fc6]=this[_0xac2d('0x96')](_0x282f36[_0x3c9fc6]);}}}};AGIVertices[_0xac2d('0x11')][_0xac2d('0x9c')]=function(_0x5a8ce0,_0xafc0fc){for(var _0xd9242d in _0x5a8ce0){if(_0x5a8ce0['hasOwnProperty'](_0xd9242d)){if(_['isPlainObject'](_0x5a8ce0[_0xd9242d])){if(!_[_0xac2d('0x44')](_0x5a8ce0[_0xd9242d])){this['saveRestApiResult'](_0x5a8ce0[_0xd9242d],util[_0xac2d('0x28')]('%s.%s',_0xafc0fc,_0xd9242d));}}else if(_[_0xac2d('0x9a')](_0x5a8ce0[_0xd9242d])){for(var _0x1e03c2=0x0;_0x1e03c2<_0x5a8ce0[_0xd9242d]['length'];_0x1e03c2++){this[_0xac2d('0x9c')](_0x5a8ce0[_0xd9242d][_0x1e03c2],util[_0xac2d('0x28')]('%s.%s',_0xafc0fc,_0xd9242d+'['+_0x1e03c2+']'));}}else{if(!_[_0xac2d('0x45')](_0x5a8ce0[_0xd9242d])){this[_0xac2d('0xe')][_0xac2d('0x9d')](util['format'](_0xac2d('0x9e'),_0xafc0fc,_0xd9242d),_0x5a8ce0[_0xd9242d]);}}}}};AGIVertices[_0xac2d('0x11')]['replaceObjectAllVariables']=function(_0x540ea7){try{var _0x391f98=JSON['parse'](_0x540ea7);this[_0xac2d('0x97')](_0x391f98);return JSON[_0xac2d('0x73')](_0x391f98);}catch(_0xeeb9f){return this[_0xac2d('0x96')](_0x540ea7);}};AGIVertices[_0xac2d('0x11')][_0xac2d('0x96')]=function(_0x25af9e){var _0x27e6af=_0x25af9e[_0xac2d('0x9f')]('{');for(var _0x2814de=0x1;_0x2814de<_0x27e6af['length'];_0x2814de+=0x1){var _0x295952=_0x27e6af[_0x2814de][_0xac2d('0x9f')]('}');if(_0x295952[_0xac2d('0x9b')]>0x1){_0x25af9e=_0x25af9e[_0xac2d('0xa0')]('{'+_0x295952[0x0]+'}',this[_0xac2d('0xe')][_0xac2d('0x12')](_0x295952[0x0])[_0xac2d('0xa1')]||_0x295952[0x0]);}}if(_0x27e6af[_0xac2d('0x9b')]===0x1){return _0x25af9e[_0xac2d('0x4b')]();}return this[_0xac2d('0x96')](_0x25af9e);};AGIVertices[_0xac2d('0x11')][_0xac2d('0xa2')]=function(_0x272c08,_0x1c9ee2){var _0x2fb2e1=this[_0xac2d('0xe')][_0xac2d('0x12')](_0x272c08);if(_0x2fb2e1['result']===-0x1){return _0x2fb2e1;}logger[_0xac2d('0x2e')](util['format'](_0xac2d('0xa3'),_0x1c9ee2,_0x2fb2e1[_0xac2d('0xa1')]));return this[_0xac2d('0xe')][_0xac2d('0x9d')](_0x1c9ee2,_0x2fb2e1['extra']);};AGIVertices[_0xac2d('0x11')]['isConfigured']=function(_0x1592d9){return _0x1592d9&&_0x1592d9!=='0'&&_0x1592d9!=='-1'&&_0x1592d9!=='';};AGIVertices[_0xac2d('0x11')][_0xac2d('0xa4')]=function(_0x33c01f){this[_0xac2d('0x37')][_0xac2d('0x71')](this,_0x33c01f,'-');_0x33c01f['retry']=_0x33c01f[_0xac2d('0xa4')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xac2d('0x11')]['mrcpsynth']=function(_0x5a89d3){logger[_0xac2d('0x2e')](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x5a89d3[_0xac2d('0x39')]));if(!this['isConfigured'](_0x5a89d3[_0xac2d('0x5a')])){return this['channel'][_0xac2d('0xa5')]('no\x20text\x20configured');}var _0x47716a='\x22'+_0x5a89d3[_0xac2d('0x5a')]+'\x22';if(this['isConfigured'](_0x5a89d3[_0xac2d('0x79')])){_0x47716a+=','+_0x5a89d3[_0xac2d('0x79')];}var _0x31cff9=this['channel'][_0xac2d('0x56')](_0xac2d('0xa6'),_0x47716a);if(_0x31cff9[_0xac2d('0xa7')]===-0x1){return _0x31cff9;}return this[_0xac2d('0xe')][_0xac2d('0xa5')](util[_0xac2d('0x28')](_0xac2d('0xa8'),_0x47716a));};AGIVertices[_0xac2d('0x11')]['mrcprecog']=function(_0x5e9783){logger['info'](util[_0xac2d('0x28')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x5e9783[_0xac2d('0x39')]));if(!this['isConfigured'](_0x5e9783[_0xac2d('0xa9')])){return this[_0xac2d('0xe')]['noop']('no\x20grammar\x20configured');}var _0x3a12e1=_0x5e9783[_0xac2d('0xa9')];if(this[_0xac2d('0x84')](_0x5e9783[_0xac2d('0x79')])){_0x3a12e1+=','+_0x5e9783[_0xac2d('0x79')];}var _0x906df1=this['channel'][_0xac2d('0x56')]('MRCPRecog',_0x3a12e1);if(_0x906df1['result']===-0x1){return _0x906df1;}var _0x3573a1=this[_0xac2d('0xa2')](_0xac2d('0xaa'),_0xac2d('0xab'));if(_0x3573a1[_0xac2d('0xa7')]===-0x1){return _0x3573a1;}var _0xc27d87=this[_0xac2d('0xa2')](_0xac2d('0xac'),_0xac2d('0xad'));if(_0xc27d87[_0xac2d('0xa7')]===-0x1){return _0xc27d87;}var _0x1fbe11=this[_0xac2d('0xa2')]('RECOG_INSTANCE()','MRCP_RECOG_INSTANCE');if(_0x1fbe11[_0xac2d('0xa7')]===-0x1){return _0x1fbe11;}return this['channel'][_0xac2d('0xa5')](util[_0xac2d('0x28')](_0xac2d('0xae'),_0x3a12e1));};AGIVertices[_0xac2d('0x11')][_0xac2d('0x6')]=function(_0x33b886){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x33b886[_0xac2d('0x39')]));return this[_0xac2d('0xe')][_0xac2d('0x6')]([_0x33b886[_0xac2d('0xaf')],_0x33b886['args']]);};AGIVertices[_0xac2d('0x11')][_0xac2d('0xb0')]=function(_0x37cde6){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')](_0xac2d('0xb1'),_0x37cde6[_0xac2d('0x39')]));if(this[_0xac2d('0x84')](_0x37cde6['timeout'])){logger[_0xac2d('0x2e')](util['format'](_0xac2d('0xb2'),_0x37cde6[_0xac2d('0x66')]));var _0x3108cd=this[_0xac2d('0xe')][_0xac2d('0xb3')](_0x37cde6[_0xac2d('0x66')]);if(_0x3108cd['result']===-0x1){return _0x3108cd;}}return this[_0xac2d('0xe')][_0xac2d('0xb0')]();};AGIVertices['prototype'][_0xac2d('0x49')]=function(_0x237ca4){logger['info'](util[_0xac2d('0x28')](_0xac2d('0xb4'),_0x237ca4[_0xac2d('0x39')]));if(!this[_0xac2d('0x84')](_0x237ca4['list_id'])){return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x237ca4,_0xac2d('0xb5'));}_0x237ca4['scheduledAt']=moment();if(this[_0xac2d('0x84')](_0x237ca4['delay'])){_0x237ca4['scheduledAt']=moment()[_0xac2d('0xb6')](_0x237ca4[_0xac2d('0xb7')],_0xac2d('0xb8'));}if(!this[_0xac2d('0x84')](_0x237ca4[_0xac2d('0x4c')])){_0x237ca4[_0xac2d('0x4c')]=0x2;}this[_0xac2d('0x43')][_0xac2d('0x71')](this,_0x237ca4);return this[_0xac2d('0xe')][_0xac2d('0xa5')](util[_0xac2d('0x28')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x237ca4[_0xac2d('0x47')],_0x237ca4[_0xac2d('0x48')],_0x237ca4[_0xac2d('0xb9')]));};AGIVertices[_0xac2d('0x11')]['custom_app']=function(_0x287adb){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')](_0xac2d('0xba'),_0x287adb[_0xac2d('0x39')]));var _0x5e7b82=this[_0xac2d('0xe')]['exec'](_0x287adb[_0xac2d('0xbb')],_0x287adb[_0xac2d('0x79')]);if(_0x5e7b82['result']===-0x1){return _0x5e7b82;}return this[_0xac2d('0xe')]['noop'](util[_0xac2d('0x28')](_0xac2d('0xbc'),_0x287adb[_0xac2d('0xbb')],_0x287adb[_0xac2d('0x79')]));};AGIVertices[_0xac2d('0x11')][_0xac2d('0xbd')]=function(_0x321706){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x321706[_0xac2d('0x39')]));if(!this[_0xac2d('0x84')](_0x321706[_0xac2d('0x5a')])){return this[_0xac2d('0xe')][_0xac2d('0xa5')]('no\x20text\x20configured');}var _0x1dff90='\x22'+_0x321706[_0xac2d('0x5a')]+'\x22';if(this[_0xac2d('0x84')](_0x321706[_0xac2d('0x79')])){_0x1dff90+=','+_0x321706[_0xac2d('0x79')];}var _0x1196d3=this[_0xac2d('0xe')][_0xac2d('0x56')](_0xac2d('0xa6'),_0x1dff90);if(_0x1196d3['result']===-0x1){return _0x1196d3;}return this[_0xac2d('0xe')][_0xac2d('0xa5')](util[_0xac2d('0x28')](_0xac2d('0xa8'),_0x1dff90));};AGIVertices[_0xac2d('0x11')]['sestektts']=function(_0x239029){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x239029[_0xac2d('0x39')]));if(!this[_0xac2d('0x84')](_0x239029[_0xac2d('0x5a')])){return this[_0xac2d('0xe')][_0xac2d('0xa5')]('no\x20text\x20configured');}var _0x3a8b9d='\x22'+_0x239029[_0xac2d('0x5a')]+'\x22';if(this[_0xac2d('0x84')](_0x239029[_0xac2d('0x79')])){_0x3a8b9d+=','+_0x239029[_0xac2d('0x79')];}var _0x863233=this[_0xac2d('0xe')][_0xac2d('0x56')](_0xac2d('0xa6'),_0x3a8b9d);if(_0x863233[_0xac2d('0xa7')]===-0x1){return _0x863233;}return this['channel'][_0xac2d('0xa5')](util[_0xac2d('0x28')](_0xac2d('0xa8'),_0x3a8b9d));};AGIVertices['prototype'][_0xac2d('0xbe')]=function(_0xe103cf){logger['info'](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0xe103cf['label']));if(!this[_0xac2d('0x84')](_0xe103cf[_0xac2d('0xa9')])){return this[_0xac2d('0xe')][_0xac2d('0xa5')](_0xac2d('0xbf'));}var _0x3a0b4e=_0xe103cf['grammar'];if(this['isConfigured'](_0xe103cf[_0xac2d('0x79')])){_0x3a0b4e+=','+_0xe103cf[_0xac2d('0x79')];}var _0x3e5da2=this['channel'][_0xac2d('0x56')](_0xac2d('0xc0'),_0x3a0b4e);if(_0x3e5da2[_0xac2d('0xa7')]===-0x1){return _0x3e5da2;}var _0x50bbd5=this[_0xac2d('0xa2')](_0xac2d('0xaa'),_0xac2d('0xc1'));if(_0x50bbd5[_0xac2d('0xa7')]===-0x1){return _0x50bbd5;}var _0x5e6ab1=this[_0xac2d('0xa2')](_0xac2d('0xac'),_0xac2d('0xc2'));if(_0x5e6ab1['result']===-0x1){return _0x5e6ab1;}var _0x5f5dda=this[_0xac2d('0xa2')](_0xac2d('0xc3'),'LUMENVOX_ASR_INSTANCE');if(_0x5f5dda[_0xac2d('0xa7')]===-0x1){return _0x5f5dda;}return this[_0xac2d('0xe')][_0xac2d('0xa5')](util[_0xac2d('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x3a0b4e));};AGIVertices[_0xac2d('0x11')]['sestekasr']=function(_0x12e240){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x12e240['label']));if(!this[_0xac2d('0x84')](_0x12e240['grammar'])){return this[_0xac2d('0xe')][_0xac2d('0xa5')](_0xac2d('0xbf'));}var _0x1d6344=_0x12e240[_0xac2d('0xa9')];if(this[_0xac2d('0x84')](_0x12e240[_0xac2d('0x79')])){_0x1d6344+=','+_0x12e240['options'];}var _0x51230f=this['channel'][_0xac2d('0x56')](_0xac2d('0xc0'),_0x1d6344);if(_0x51230f[_0xac2d('0xa7')]===-0x1){return _0x51230f;}var _0x3bdb4d=this[_0xac2d('0xa2')]('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0x3bdb4d['result']===-0x1){return _0x3bdb4d;}var _0x2955c1=this[_0xac2d('0xa2')]('RECOG_INPUT()',_0xac2d('0xc4'));if(_0x2955c1[_0xac2d('0xa7')]===-0x1){return _0x2955c1;}var _0x948174=this[_0xac2d('0xa2')](_0xac2d('0xc3'),_0xac2d('0xc5'));if(_0x948174[_0xac2d('0xa7')]===-0x1){return _0x948174;}return this['channel'][_0xac2d('0xa5')](util[_0xac2d('0x28')](_0xac2d('0xae'),_0x1d6344));};AGIVertices[_0xac2d('0x11')][_0xac2d('0xc6')]=function(_0x3eb248){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')](_0xac2d('0xc7'),_0x3eb248[_0xac2d('0x39')]));if(!this[_0xac2d('0x84')](_0x3eb248['odbc_id'])){return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x3eb248,_0xac2d('0xc8'));}var _0x1d61d0=this[_0xac2d('0x1a')][_0xac2d('0x71')](this,_0x3eb248[_0xac2d('0xc9')]);if(!_0x1d61d0){return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x3eb248,'no\x20odbc\x20database\x20found');}if(!this[_0xac2d('0x84')](_0x3eb248['query'])){return this['channel']['error'](_0x3eb248,_0xac2d('0xca'));}var _0x5b3c80=_0x3eb248[_0xac2d('0x30')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0xac2d('0xe')][_0xac2d('0xa5')](util[_0xac2d('0x28')](_0xac2d('0xcb'),_0x5b3c80));var _0x1c1ebc=this['getQueryOdbc'][_0xac2d('0x71')](this,_0x1d61d0,_0x5b3c80);this['createSquareDetailsReport'][_0xac2d('0x71')](this,_0x3eb248,_0x5b3c80);if(!this['isConfigured'](_0x3eb248[_0xac2d('0xcc')])){return this[_0xac2d('0xe')][_0xac2d('0xa5')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x8c9da3=this['getVariable'][_0xac2d('0x71')](this,_0x3eb248[_0xac2d('0xcc')]);if(!_0x8c9da3){return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x3eb248,_0xac2d('0xcd'));}var _0x4220c2=this;_0x1c1ebc[_0xac2d('0xce')](function(_0x11603b,_0x148c51){Object[_0xac2d('0xcf')](_0x11603b)[_0xac2d('0xce')](function(_0x547fa9){_0x4220c2[_0xac2d('0xe')][_0xac2d('0x9d')](util[_0xac2d('0x28')](_0xac2d('0xd0'),_0x8c9da3,_0x148c51,_0x547fa9),_0x11603b[_0x547fa9]);});});this[_0xac2d('0xe')]['setVariable'](util[_0xac2d('0x28')](_0xac2d('0xd1'),_0x8c9da3),_0x1c1ebc[_0xac2d('0x9b')]);return this[_0xac2d('0xe')][_0xac2d('0xa5')](util[_0xac2d('0x28')](_0xac2d('0xd2'),_0x8c9da3));};AGIVertices[_0xac2d('0x11')][_0xac2d('0xd3')]=function(_0xd62583){logger['debug'](util[_0xac2d('0x28')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0xd62583[_0xac2d('0x39')]));if(!this['isConfigured'](_0xd62583[_0xac2d('0xd4')])){return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0xd62583,_0xac2d('0xd5'));}var _0x5dc4af=this[_0xac2d('0x1b')]['sync'](this,_0xd62583[_0xac2d('0xd4')]);if(!_0x5dc4af){return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0xd62583,'no\x20user\x20found');}var _0xef9d94=this[_0xac2d('0xe')][_0xac2d('0x56')]('DIAL',[util['format'](_0xac2d('0xd6'),_0x5dc4af),_0xd62583[_0xac2d('0x66')],_0xd62583[_0xac2d('0xd7')],_0xd62583['url']]);if(_0xef9d94[_0xac2d('0xa7')]===-0x1){return _0xef9d94;}return this[_0xac2d('0xe')][_0xac2d('0xa5')](util['format'](_0xac2d('0xd8'),_0xac2d('0xd9')));};AGIVertices['prototype'][_0xac2d('0xda')]=function(_0x5d7256){logger[_0xac2d('0x2e')](util['format'](_0xac2d('0xdb'),_0x5d7256['label']));if(!this[_0xac2d('0x84')](_0x5d7256[_0xac2d('0x81')])){return this['channel']['noop'](_0xac2d('0xdc'));}if(!this[_0xac2d('0x84')](_0x5d7256[_0xac2d('0x5a')])){return this[_0xac2d('0xe')][_0xac2d('0xa5')](_0xac2d('0xdd'));}this[_0xac2d('0xe')][_0xac2d('0xde')]=!![];this[_0xac2d('0x37')](_0x5d7256);this['createSquareMessage'](_0x5d7256[_0xac2d('0x5a')],'in','','');this[_0xac2d('0xe')][_0xac2d('0xa5')](util[_0xac2d('0x28')]('Trying\x20Dialogflow:\x20%s',_0x5d7256[_0xac2d('0x5a')]));var _0x399466=this[_0xac2d('0x7a')]['sync'](this,_0x5d7256);if(_0x399466){for(var _0x2c605a in _0x399466){if(_0x399466[_0xac2d('0x98')](_0x2c605a)){this[_0xac2d('0xe')][_0xac2d('0x9d')](util[_0xac2d('0x28')](_0xac2d('0xdf'),_0x2c605a[_0xac2d('0x6b')]()),_0x399466[_0x2c605a]);}}this['createSquareMessage'](_0x399466['speech'],_0xac2d('0xe0'),_0xac2d('0xda'),'');return this['channel']['noop'](util['format'](_0xac2d('0xe1'),_0x399466[_0xac2d('0xe2')]));}return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x5d7256,'Dialogflow\x20is\x20unreachable');};AGIVertices['prototype']['dialogflowV2']=function(_0x5d4020){logger[_0xac2d('0x2e')](util['format'](_0xac2d('0xe3'),_0x5d4020[_0xac2d('0x39')]));if(!this[_0xac2d('0x84')](_0x5d4020[_0xac2d('0xe4')])){return this[_0xac2d('0xe')][_0xac2d('0xa5')]('no\x20project_id\x20configured');}if(!this[_0xac2d('0x84')](_0x5d4020['client_email'])){return this[_0xac2d('0xe')][_0xac2d('0xa5')](_0xac2d('0xe5'));}if(!this[_0xac2d('0x84')](_0x5d4020[_0xac2d('0x7d')])){return this[_0xac2d('0xe')][_0xac2d('0xa5')](_0xac2d('0xe6'));}if(!this['isConfigured'](_0x5d4020[_0xac2d('0x7e')])){return this[_0xac2d('0xe')][_0xac2d('0xa5')](_0xac2d('0xe7'));}if(!this[_0xac2d('0x84')](_0x5d4020[_0xac2d('0x5a')])){return this[_0xac2d('0xe')][_0xac2d('0xa5')](_0xac2d('0xdd'));}this['channel'][_0xac2d('0xde')]=!![];this[_0xac2d('0x37')](_0x5d4020);this[_0xac2d('0x42')](_0x5d4020[_0xac2d('0x5a')],'in','','');this[_0xac2d('0xe')][_0xac2d('0xa5')](util[_0xac2d('0x28')](_0xac2d('0xe8'),_0x5d4020['text']));var _0x4b1b7f=this[_0xac2d('0x7b')][_0xac2d('0x71')](this,_0x5d4020);if(_0x4b1b7f){for(var _0xc4e216 in _0x4b1b7f){if(_0x4b1b7f[_0xac2d('0x98')](_0xc4e216)){if(_0xc4e216!==_0xac2d('0xe9')){this[_0xac2d('0xe')][_0xac2d('0x9d')](util[_0xac2d('0x28')](_0xac2d('0xdf'),_0xc4e216[_0xac2d('0x6b')]()),_0x4b1b7f[_0xc4e216]);}}}this['createSquareMessage'](_0x4b1b7f[_0xac2d('0xe2')],_0xac2d('0xe0'),_0xac2d('0xea'),_0x4b1b7f[_0xac2d('0xe9')]);return this[_0xac2d('0xe')][_0xac2d('0xa5')](util[_0xac2d('0x28')](_0xac2d('0xeb'),_0x4b1b7f[_0xac2d('0xe2')]));}return this[_0xac2d('0xe')]['error'](_0x5d4020,_0xac2d('0xec'));};AGIVertices[_0xac2d('0x11')][_0xac2d('0xed')]=function(_0x11be4e){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')](_0xac2d('0xee'),_0x11be4e[_0xac2d('0x39')]));if(!this['isConfigured'](_0x11be4e['ndauth_url'])){return this[_0xac2d('0xe')]['noop'](_0xac2d('0xef'));}if(!this[_0xac2d('0x84')](_0x11be4e[_0xac2d('0xf0')])){return this[_0xac2d('0xe')][_0xac2d('0xa5')](_0xac2d('0xf1'));}if(!this[_0xac2d('0x84')](_0x11be4e[_0xac2d('0xf2')])){return this[_0xac2d('0xe')]['noop'](_0xac2d('0xf3'));}if(!this['isConfigured'](_0x11be4e[_0xac2d('0xf4')])){return this[_0xac2d('0xe')][_0xac2d('0xa5')](_0xac2d('0xdd'));}this[_0xac2d('0xe')][_0xac2d('0xde')]=!![];this[_0xac2d('0x37')](_0x11be4e);this[_0xac2d('0x42')](_0x11be4e[_0xac2d('0x5a')],'in','','');this[_0xac2d('0xe')]['noop'](util['format'](_0xac2d('0xf5'),_0x11be4e[_0xac2d('0x5a')]));var _0x39f4e1=this['sestekNDA'][_0xac2d('0x71')](this,_0x11be4e);if(_0x39f4e1){for(var _0x33cd7a in _0x39f4e1){if(_0x39f4e1[_0xac2d('0x98')](_0x33cd7a)){this['channel'][_0xac2d('0x9d')](util[_0xac2d('0x28')](_0xac2d('0xf6'),_0x33cd7a['toUpperCase']()),_0x39f4e1[_0x33cd7a]);}}this[_0xac2d('0x42')](_0x39f4e1[_0xac2d('0xe2')],_0xac2d('0xe0'),_0xac2d('0xed'),'');if(_0x39f4e1[_0xac2d('0xf7')]){this[_0xac2d('0xe')][_0xac2d('0xa5')](util['format'](_0xac2d('0xf8'),_0x39f4e1[_0xac2d('0xf7')]));var _0x4ebd4d=this[_0xac2d('0xe')]['streamFile'](_0x39f4e1['audiofile']);try{fs['unlink'](_0x39f4e1[_0xac2d('0xf7')]+_0xac2d('0xf9'));}catch(_0x4fa2e4){logger['error'](_0x4fa2e4);}return _0x4ebd4d;}else{return this[_0xac2d('0xe')][_0xac2d('0xa5')](util['format'](_0xac2d('0xfa'),_0x39f4e1['speech']));}}return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x11be4e,_0xac2d('0xfb'));};AGIVertices[_0xac2d('0x11')][_0xac2d('0xfc')]=function(_0x2054ac){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')]('Enter\x20in\x20END\x20(%s)\x20block',_0x2054ac[_0xac2d('0x39')]));return this['channel'][_0xac2d('0xa5')](_0xac2d('0xfc'));};AGIVertices[_0xac2d('0x11')][_0xac2d('0xfd')]=function(_0x20585e){logger['info'](util[_0xac2d('0x28')](_0xac2d('0xfe'),_0x20585e[_0xac2d('0x39')]));var _0x343e00='';if(_0x20585e['trunk_id']){if(!this[_0xac2d('0x84')](_0x20585e[_0xac2d('0xff')])){return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x20585e,_0xac2d('0x100'));}else{var _0x5257f9=parseInt(_0x20585e[_0xac2d('0xff')],0xa);if(isNaN(_0x5257f9)){_0x343e00=_0x20585e['trunk_id'];}else{_0x343e00=this[_0xac2d('0x1d')][_0xac2d('0x71')](this,_0x20585e[_0xac2d('0xff')]);if(!_0x343e00){return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x20585e,_0xac2d('0x101'));}}}}else if(_0x20585e['trunk_name']){_0x343e00=_0x20585e[_0xac2d('0x102')];}else{return this[_0xac2d('0xe')]['error'](_0x20585e,_0xac2d('0x100'));}var _0x48e812=this['channel'][_0xac2d('0x56')](_0xac2d('0xd9'),[util[_0xac2d('0x28')](_0xac2d('0x103'),_0x343e00,_0x20585e[_0xac2d('0x47')]),_0x20585e[_0xac2d('0x66')],_0x20585e[_0xac2d('0xd7')],_0x20585e[_0xac2d('0x64')]]);if(_0x48e812[_0xac2d('0xa7')]===-0x1){return _0x48e812;}return this['channel'][_0xac2d('0xa5')](util[_0xac2d('0x28')](_0xac2d('0xd8'),_0xac2d('0xd9')));};AGIVertices[_0xac2d('0x11')][_0xac2d('0x104')]=function(_0x4d6766){logger['info'](util[_0xac2d('0x28')](_0xac2d('0x105'),_0x4d6766['label']));return this['channel'][_0xac2d('0xa5')](_0xac2d('0x104'));};AGIVertices['prototype']['getdigits']=function(_0x15ec1c){logger[_0xac2d('0x2e')](util['format'](_0xac2d('0x106'),_0x15ec1c[_0xac2d('0x39')]));if(_0x15ec1c[_0xac2d('0x107')]===0x0){return this[_0xac2d('0xa4')](_0x15ec1c);}_0x15ec1c[_0xac2d('0x107')]-=0x1;if(!this[_0xac2d('0x84')](_0x15ec1c['file_id'])){return this[_0xac2d('0xe')]['error'](_0x15ec1c,_0xac2d('0x108'));}var _0x2ba20=this[_0xac2d('0x109')][_0xac2d('0x71')](this,_0x15ec1c['file_id']);if(!_0x2ba20){return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x15ec1c,'no\x20file\x20audio\x20found');}if(!this[_0xac2d('0x84')](_0x15ec1c[_0xac2d('0xcc')])){return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0xac2d('0x10a'));}var _0x4ddcb5=this[_0xac2d('0xe')][_0xac2d('0x10b')](_0x2ba20,_0x15ec1c[_0xac2d('0x10c')],_0x15ec1c[_0xac2d('0x10d')]);var _0x55ba41=_0x4ddcb5['result']?_0x4ddcb5[_0xac2d('0xa7')]['toString']():'';logger[_0xac2d('0x2e')]('test',JSON['stringify'](_0x4ddcb5));if(_0x4ddcb5[_0xac2d('0xa7')]===-0x1){this[_0xac2d('0x37')][_0xac2d('0x71')](this,_0x15ec1c,_0x55ba41);return _0x4ddcb5;}else if(_0x4ddcb5[_0xac2d('0xa1')]===_0xac2d('0x66')){_0x4ddcb5[_0xac2d('0xa7')]=_0x55ba41[_0xac2d('0x9b')]>=parseInt(_0x15ec1c[_0xac2d('0x10e')])?'x':'i';}else{_0x4ddcb5[_0xac2d('0xa7')]=_0x55ba41[_0xac2d('0x9b')]>=parseInt(_0x15ec1c['mindigit'])&&_0x55ba41['length']<=parseInt(_0x15ec1c[_0xac2d('0x10d')])?'x':'i';}var _0x4281f3=this[_0xac2d('0x12')][_0xac2d('0x71')](this,_0x15ec1c['variable_id']);if(!_0x4281f3){return this[_0xac2d('0xe')]['error'](_0x15ec1c,_0xac2d('0xcd'));}this[_0xac2d('0xe')][_0xac2d('0x9d')](_0x4281f3,_0x55ba41);if(this['isConfigured'](_0x15ec1c[_0xac2d('0x10f')])){var _0x18481a=parseInt(_0x15ec1c[_0xac2d('0x10f')],0xa);var _0x117153=rs[_0xac2d('0x110')]({'charset':'*','length':_0x18481a});var _0x57c337=_0x55ba41[_0xac2d('0x9b')];if(_0x57c337>0x0){if(_0x57c337>_0x18481a){this['createSquareDetailsReport'][_0xac2d('0x71')](this,_0x15ec1c,_0x15ec1c[_0xac2d('0x111')]==='first'?_0x117153+_0x55ba41[_0xac2d('0x112')](_0x18481a):_0x55ba41[_0xac2d('0x112')](0x0,_0x57c337-_0x18481a)+_0x117153);}else{this[_0xac2d('0x37')][_0xac2d('0x71')](this,_0x15ec1c,rs['generate']({'charset':'*','length':_0x57c337}));}}else{this['createSquareDetailsReport'][_0xac2d('0x71')](this,_0x15ec1c,'');}}else{this[_0xac2d('0x37')][_0xac2d('0x71')](this,_0x15ec1c,_0x55ba41);}return _0x4ddcb5;};AGIVertices[_0xac2d('0x11')][_0xac2d('0x113')]=function(_0x35f5d4){logger['info'](util['format'](_0xac2d('0x114'),_0x35f5d4[_0xac2d('0x39')]));return this[_0xac2d('0x115')](_0x35f5d4);};AGIVertices['prototype']['goal']=function(_0x17cbf6){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')](_0xac2d('0x116'),_0x17cbf6['label']));this[_0xac2d('0x37')]['sync'](this,_0x17cbf6,_0x17cbf6[_0xac2d('0x117')]);return this[_0xac2d('0xe')][_0xac2d('0xa5')](util['format'](_0xac2d('0x118'),_0x17cbf6[_0xac2d('0x117')]));};AGIVertices[_0xac2d('0x11')][_0xac2d('0x119')]=function(_0x3a48e2){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')](_0xac2d('0x11a'),_0x3a48e2[_0xac2d('0x39')]));if(!this[_0xac2d('0x84')](_0x3a48e2['aws_access_key_id'])||!this[_0xac2d('0x84')](_0x3a48e2[_0xac2d('0x88')])){return this[_0xac2d('0xe')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x3a48e2[_0xac2d('0x5a')])){return this[_0xac2d('0xe')][_0xac2d('0xa5')](_0xac2d('0xdd'));}this[_0xac2d('0xe')][_0xac2d('0xa5')](util[_0xac2d('0x28')](_0xac2d('0x11b'),_0x3a48e2['text']));var _0x52f877=this['awsPolly'][_0xac2d('0x71')](this,_0x3a48e2);if(_0x52f877){this[_0xac2d('0xe')][_0xac2d('0xa5')](util['format'](_0xac2d('0x11c'),_0x52f877));var _0x2d8893=this[_0xac2d('0xe')]['streamFile'](_0x52f877);try{fs[_0xac2d('0x11d')](_0x52f877+_0xac2d('0xf9'));}catch(_0x531205){logger[_0xac2d('0x2c')](_0x531205);}return _0x2d8893;}return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x3a48e2,_0xac2d('0x11e'));};AGIVertices['prototype'][_0xac2d('0x11f')]=function(_0x3b062c){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')](_0xac2d('0x120'),_0x3b062c[_0xac2d('0x39')]));if(!this[_0xac2d('0x84')](_0x3b062c[_0xac2d('0x87')])||!this['isConfigured'](_0x3b062c[_0xac2d('0x88')])){return this[_0xac2d('0xe')]['noop'](_0xac2d('0x121'));}if(!this['isConfigured'](_0x3b062c['aws_bot_name'])){return this[_0xac2d('0xe')]['noop'](_0xac2d('0x122'));}if(!this[_0xac2d('0x84')](_0x3b062c[_0xac2d('0x5a')])){return this[_0xac2d('0xe')][_0xac2d('0xa5')](_0xac2d('0xdd'));}this['channel'][_0xac2d('0xde')]=!![];this[_0xac2d('0x37')](_0x3b062c);this[_0xac2d('0x42')](_0x3b062c[_0xac2d('0x5a')],'in','','');this[_0xac2d('0xe')][_0xac2d('0xa5')](util[_0xac2d('0x28')](_0xac2d('0x123'),_0x3b062c['text']));var _0xcb9c8d=this['awsLex'][_0xac2d('0x71')](this,_0x3b062c);if(_0xcb9c8d){for(var _0x572128 in _0xcb9c8d){if(_0xcb9c8d['hasOwnProperty'](_0x572128)&&_['isString'](_0xcb9c8d[_0x572128])){this['channel'][_0xac2d('0x9d')](util[_0xac2d('0x28')](_0xac2d('0x124'),_0x572128[_0xac2d('0x6b')]()),_0xcb9c8d[_0x572128]);}}if(_['isNil'](_0xcb9c8d['message'])){return this[_0xac2d('0xe')][_0xac2d('0xa5')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xac2d('0x42')](_0xcb9c8d[_0xac2d('0x77')],_0xac2d('0xe0'),_0xac2d('0x125'),'');return this[_0xac2d('0xe')][_0xac2d('0xa5')](util[_0xac2d('0x28')](_0xac2d('0x126'),_0xcb9c8d[_0xac2d('0x77')]));}}return this['channel'][_0xac2d('0x2c')](_0x3b062c,_0xac2d('0x127'));};AGIVertices[_0xac2d('0x11')]['googleasr']=function(_0x3da6ee){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')](_0xac2d('0x128'),_0x3da6ee['label'],_0x3da6ee['timeout']));if(!this[_0xac2d('0x84')](_0x3da6ee[_0xac2d('0x81')])){return this[_0xac2d('0xe')][_0xac2d('0xa5')](_0xac2d('0xdc'));}var _0xbb11df=_0xac2d('0x129');var _0x2be682=util['format']('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x4c227b=util['format'](_0xac2d('0x9e'),_0x2be682,_0xbb11df);var _0x4b56b3=!![];if(_0x3da6ee[_0xac2d('0x12a')]===_0xac2d('0x12b')){_0x4b56b3=![];}var _0x3f7eac=this['channel'][_0xac2d('0x12c')](_0x2be682,_0xbb11df,_0x3da6ee['intKey'],_0x3da6ee[_0xac2d('0x66')],undefined,_0x4b56b3);if(_0x3f7eac[_0xac2d('0xa7')]!==-0x1){this[_0xac2d('0xe')][_0xac2d('0xa5')](util['format']('google\x20%s\x20file\x20created',_0x4c227b));var _0x3b7203=this['googleASR'][_0xac2d('0x71')](this,_0x3da6ee,_0x4c227b);if(_0x3b7203){for(var _0x43e5ff in _0x3b7203){if(_0x3b7203['hasOwnProperty'](_0x43e5ff)){this[_0xac2d('0xe')][_0xac2d('0x9d')](util[_0xac2d('0x28')](_0xac2d('0x12d'),_0x43e5ff[_0xac2d('0x6b')]()),_0x3b7203[_0x43e5ff]);}}return this[_0xac2d('0xe')][_0xac2d('0xa5')](util['format'](_0xac2d('0x12e'),JSON[_0xac2d('0x73')](_0x3b7203)));}}return _0x3f7eac;};AGIVertices['prototype'][_0xac2d('0x12f')]=function(_0x337232){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')](_0xac2d('0x130'),_0x337232['label']));if(!this[_0xac2d('0x84')](_0x337232[_0xac2d('0x131')])){return this[_0xac2d('0xe')][_0xac2d('0xa5')]('no\x20appid\x20configured');}if(!this['isConfigured'](_0x337232['appsecret'])){return this[_0xac2d('0xe')]['noop'](_0xac2d('0x132'));}var _0x531285=_0xac2d('0x129');var _0x36eec5=util[_0xac2d('0x28')]('%s/recordings/%s',FILES_PATH,rs[_0xac2d('0x110')](0x4));var _0x50458a=util[_0xac2d('0x28')]('%s.%s',_0x36eec5,_0x531285);var _0x43fc81=!![];if(_0x337232['beep']===_0xac2d('0x12b')){_0x43fc81=![];}var _0x4a43c6=this[_0xac2d('0xe')]['recordFile'](_0x36eec5,_0x531285,_0x337232[_0xac2d('0x133')],_0x337232[_0xac2d('0x66')],undefined,_0x43fc81);if(_0x4a43c6[_0xac2d('0xa7')]!==-0x1){this[_0xac2d('0xe')][_0xac2d('0xa5')](util[_0xac2d('0x28')](_0xac2d('0x134'),_0x50458a));var _0x116c79=this[_0xac2d('0x135')][_0xac2d('0x71')](this,_0x337232,_0x50458a);if(_0x116c79){for(var _0xddd4f9 in _0x116c79){if(_0x116c79[_0xac2d('0x98')](_0xddd4f9)){this[_0xac2d('0xe')][_0xac2d('0x9d')](util[_0xac2d('0x28')](_0xac2d('0x136'),_0xddd4f9[_0xac2d('0x6b')]()),_0x116c79[_0xddd4f9]);}}return this['channel']['noop'](util[_0xac2d('0x28')](_0xac2d('0x137'),JSON['stringify'](_0x116c79)));}}return _0x4a43c6;};AGIVertices[_0xac2d('0x11')][_0xac2d('0x138')]=function(_0x2913bc){logger[_0xac2d('0x2e')](util['format'](_0xac2d('0x139'),_0x2913bc['label']));return this[_0xac2d('0xe')][_0xac2d('0x13a')](_0x2913bc[_0xac2d('0x3d')],_0x2913bc[_0xac2d('0x3e')],_0x2913bc[_0xac2d('0x3f')]);};AGIVertices[_0xac2d('0x11')][_0xac2d('0x13b')]=function(_0x1cbb07){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')](_0xac2d('0x13c'),_0x1cbb07[_0xac2d('0x39')]));if(!this['isConfigured'](_0x1cbb07[_0xac2d('0x13d')])){return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x1cbb07,_0xac2d('0x13e'));}try{var _0xe2d0c6=eval(_0x1cbb07[_0xac2d('0x13d')])?_0xac2d('0x13f'):_0xac2d('0x140');this[_0xac2d('0xe')][_0xac2d('0xa5')](util['format'](_0xac2d('0x141'),_0x1cbb07['condition'],_0xe2d0c6));return{'code':0xc8,'result':_0xe2d0c6};}catch(_0x18f6a9){return{'code':0xc8,'result':_0xac2d('0x140')};}};AGIVertices[_0xac2d('0x11')]['gotoiftime']=function(_0x2c75ac){logger[_0xac2d('0x2e')](util['format'](_0xac2d('0x142'),_0x2c75ac[_0xac2d('0x39')]));if(!this['isConfigured'](_0x2c75ac[_0xac2d('0x143')])){return this['channel'][_0xac2d('0x2c')](_0x2c75ac,_0xac2d('0x144'));}var _0x585729=this['getIntervals'][_0xac2d('0x71')](this,_0x2c75ac[_0xac2d('0x143')]);if(!_0x585729){return this[_0xac2d('0xe')]['error'](_0x2c75ac,_0xac2d('0x145'));}for(var _0x1abe0e=0x0;_0x1abe0e<_0x585729['length'];_0x1abe0e+=0x1){var _0x166094=this[_0xac2d('0xe')][_0xac2d('0x12')](util[_0xac2d('0x28')](_0xac2d('0x146'),_0x585729[_0x1abe0e]));if(_0x166094[_0xac2d('0xa7')]===-0x1){return _0x166094;}logger[_0xac2d('0x2e')](util['format'](_0xac2d('0x147'),_0x585729[_0x1abe0e],_0x166094[_0xac2d('0xa1')]));if(_0x166094[_0xac2d('0xa1')]==='true'){logger['info'](util[_0xac2d('0x28')](_0xac2d('0x147'),_0x585729[_0x1abe0e],_0xac2d('0x13f')));this[_0xac2d('0xe')][_0xac2d('0xa5')](util['format'](_0xac2d('0x147'),_0x585729[_0x1abe0e],'true'));return{'code':0xc8,'result':'true'};}else{logger[_0xac2d('0x2e')](util[_0xac2d('0x28')](_0xac2d('0x147'),_0x585729[_0x1abe0e],_0xac2d('0x140')));this[_0xac2d('0xe')][_0xac2d('0xa5')](util[_0xac2d('0x28')](_0xac2d('0x147'),_0x585729[_0x1abe0e],'false'));}}return{'code':0xc8,'result':_0xac2d('0x140')};};AGIVertices[_0xac2d('0x11')]['hangup']=function(_0x1cb482){logger['info'](util[_0xac2d('0x28')](_0xac2d('0x148'),_0x1cb482[_0xac2d('0x39')]));return this['channel'][_0xac2d('0x149')]();};AGIVertices[_0xac2d('0x11')][_0xac2d('0x14a')]=function(_0x2588ed){logger[_0xac2d('0x2e')](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x2588ed['label']));if(!this['isConfigured'](_0x2588ed[_0xac2d('0x81')])){return this[_0xac2d('0xe')][_0xac2d('0xa5')](_0xac2d('0xdc'));}var _0x48585d=_0xac2d('0x129');var _0xd441cb=util[_0xac2d('0x28')](_0xac2d('0x14b'),FILES_PATH,rs[_0xac2d('0x110')](0x4));var _0x20385f=util[_0xac2d('0x28')](_0xac2d('0x9e'),_0xd441cb,_0x48585d);var _0x270537=!![];if(_0x2588ed[_0xac2d('0x12a')]===_0xac2d('0x12b')){_0x270537=![];}var _0x2f47af=this[_0xac2d('0xe')][_0xac2d('0x12c')](_0xd441cb,_0x48585d,_0x2588ed[_0xac2d('0x133')],_0x2588ed['timeout'],undefined,_0x270537);if(_0x2f47af[_0xac2d('0xa7')]!==-0x1){this[_0xac2d('0xe')][_0xac2d('0xa5')](util['format'](_0xac2d('0x14c'),_0x20385f));var _0xc4bda0=this[_0xac2d('0x83')][_0xac2d('0x71')](this,_0x2588ed,_0x20385f);if(_0xc4bda0){for(var _0x37b97e in _0xc4bda0){if(_0xc4bda0['hasOwnProperty'](_0x37b97e)){this[_0xac2d('0xe')]['setVariable'](util['format'](_0xac2d('0x14d'),_0x37b97e[_0xac2d('0x6b')]()),_0xc4bda0[_0x37b97e]);}}return this[_0xac2d('0xe')][_0xac2d('0xa5')](util[_0xac2d('0x28')](_0xac2d('0x14e'),JSON['stringify'](_0xc4bda0)));}}return _0x2f47af;};AGIVertices[_0xac2d('0x11')][_0xac2d('0x14f')]=function(_0x28c91b){logger['info'](util[_0xac2d('0x28')](_0xac2d('0x150'),_0x28c91b[_0xac2d('0x39')]));if(!this['isConfigured'](_0x28c91b['key'])){return this[_0xac2d('0xe')][_0xac2d('0xa5')](_0xac2d('0xdc'));}if(!this[_0xac2d('0x84')](_0x28c91b['text'])){return this['channel'][_0xac2d('0xa5')](_0xac2d('0xdd'));}this['channel'][_0xac2d('0xa5')](util[_0xac2d('0x28')](_0xac2d('0x151'),_0x28c91b['text']));var _0x3ef464=this['ispeechTTS'][_0xac2d('0x71')](this,_0x28c91b);if(_0x3ef464){this['channel']['noop'](util['format'](_0xac2d('0x14c'),_0x3ef464));var _0x49eda7=this[_0xac2d('0xe')][_0xac2d('0x152')](_0x3ef464,_0x28c91b[_0xac2d('0x133')]);try{fs['unlink'](_0x3ef464+_0xac2d('0xf9'));}catch(_0x5c1a26){logger['error'](_0x5c1a26);}return _0x49eda7;}return this['channel'][_0xac2d('0x2c')](_0x28c91b,_0xac2d('0x153'));};AGIVertices[_0xac2d('0x11')]['login']=function(_0x844b6c){logger['info'](util[_0xac2d('0x28')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x844b6c[_0xac2d('0x39')]));if(!this[_0xac2d('0x84')](_0x844b6c[_0xac2d('0x154')])){return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x844b6c,_0xac2d('0x155'));}logger[_0xac2d('0x2e')](util['format'](_0xac2d('0x156'),this[_0xac2d('0xe')]['callerid'],_0x844b6c[_0xac2d('0x154')]));var _0x14f479=this[_0xac2d('0x157')][_0xac2d('0x71')](this,_0x844b6c[_0xac2d('0x154')]);if(_0x14f479){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')](_0xac2d('0x158'),this[_0xac2d('0xe')]['callerid'],_0x844b6c['findBy']));this[_0xac2d('0xe')]['noop'](util[_0xac2d('0x28')](_0xac2d('0x158'),this[_0xac2d('0xe')][_0xac2d('0x3b')],_0x844b6c['findBy']));return{'code':0xc8,'result':_0xac2d('0x159')};}else{logger[_0xac2d('0x2e')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xac2d('0xe')]['callerid'],_0x844b6c[_0xac2d('0x154')]));this[_0xac2d('0xe')][_0xac2d('0xa5')](util[_0xac2d('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xac2d('0xe')]['callerid'],_0x844b6c['findBy']));return{'code':0xc8,'result':_0xac2d('0x15a')};}};AGIVertices[_0xac2d('0x11')][_0xac2d('0x15b')]=function(_0x1e9ad0){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')](_0xac2d('0x15c'),_0x1e9ad0[_0xac2d('0x39')]));if(!this[_0xac2d('0x84')](_0x1e9ad0[_0xac2d('0x154')])){return this[_0xac2d('0xe')]['error'](_0x1e9ad0,_0xac2d('0x155'));}logger['info'](util[_0xac2d('0x28')](_0xac2d('0x156'),this[_0xac2d('0xe')][_0xac2d('0x3b')],_0x1e9ad0[_0xac2d('0x154')]));var _0x596de7=this[_0xac2d('0x52')][_0xac2d('0x71')](this,_0x1e9ad0[_0xac2d('0x154')]);if(_0x596de7){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xac2d('0xe')]['callerid'],_0x1e9ad0[_0xac2d('0x154')]));this[_0xac2d('0xe')][_0xac2d('0xa5')](util['format'](_0xac2d('0x158'),this[_0xac2d('0xe')][_0xac2d('0x3b')],_0x1e9ad0[_0xac2d('0x154')]));return{'code':0xc8,'result':_0xac2d('0x159')};}else{logger[_0xac2d('0x2e')](util[_0xac2d('0x28')](_0xac2d('0x15d'),this[_0xac2d('0xe')][_0xac2d('0x3b')],_0x1e9ad0[_0xac2d('0x154')]));this[_0xac2d('0xe')]['noop'](util[_0xac2d('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xac2d('0x3b')],_0x1e9ad0['findBy']));return{'code':0xc8,'result':_0xac2d('0x15a')};}};AGIVertices['prototype'][_0xac2d('0x15e')]=function(_0x19356d){logger['info'](util[_0xac2d('0x28')](_0xac2d('0x15f'),_0x19356d[_0xac2d('0x39')]));if(!this[_0xac2d('0x84')](_0x19356d[_0xac2d('0x160')])){return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x19356d,'no\x20operation\x20configured');}this[_0xac2d('0xe')][_0xac2d('0xa5')](util[_0xac2d('0x28')](_0xac2d('0x161'),_0x19356d['operation']));var _0x3f8ebd=eval(_0x19356d['operation']);if(!this[_0xac2d('0x84')](_0x19356d[_0xac2d('0xcc')])){return this[_0xac2d('0xe')][_0xac2d('0xa5')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x27e29d=this[_0xac2d('0x12')][_0xac2d('0x71')](this,_0x19356d[_0xac2d('0xcc')]);if(!_0x27e29d){return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x19356d,_0xac2d('0xcd'));}if(_[_0xac2d('0x9a')](_0x3f8ebd)){var _0x7d9496=this;_0x3f8ebd['forEach'](function(_0x3990e6,_0x2510a9){_0x7d9496[_0xac2d('0xe')][_0xac2d('0x9d')](util[_0xac2d('0x28')]('%s[%s]',_0x27e29d,_0x2510a9),_0x3990e6);});return this[_0xac2d('0xe')]['noop'](util[_0xac2d('0x28')](_0xac2d('0x162'),_0x27e29d));}else{return this[_0xac2d('0xe')]['setVariable'](_0x27e29d,_0x3f8ebd);}};AGIVertices['prototype'][_0xac2d('0xd')]=function(_0x31a47c){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')](_0xac2d('0x163'),_0x31a47c[_0xac2d('0x39')]));if(_0x31a47c['retry']===0x0){return this['maxRetry'](_0x31a47c);}_0x31a47c[_0xac2d('0x107')]-=0x1;if(!this[_0xac2d('0x84')](_0x31a47c[_0xac2d('0x164')])){return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x31a47c,_0xac2d('0x108'));}var _0xdfacc5=this[_0xac2d('0x109')][_0xac2d('0x71')](this,_0x31a47c[_0xac2d('0x164')]);if(!_0xdfacc5){return this['channel'][_0xac2d('0x2c')](_0x31a47c,_0xac2d('0x165'));}var _0x2948be=this[_0xac2d('0xe')][_0xac2d('0x10b')](_0xdfacc5,_0x31a47c['response'],_0x31a47c['digit']);var _0x28456f=_0x2948be[_0xac2d('0xa7')];if(_0x2948be[_0xac2d('0xa7')]===-0x1){this[_0xac2d('0x37')]['sync'](this,_0x31a47c,'-1');return _0x2948be;}else if(_0x2948be[_0xac2d('0xa1')]===_0xac2d('0x66')){_0x2948be['result']=_0x2948be[_0xac2d('0xa7')][_0xac2d('0x9b')]>0x0?_0x2948be[_0xac2d('0xa7')]:'t';}else if(_['isEmpty'](_0x2948be[_0xac2d('0xa7')])){_0x2948be['result']='#';_0x28456f='#';}if(!this[_0xac2d('0x84')](_0x31a47c[_0xac2d('0xcc')])){this[_0xac2d('0xe')][_0xac2d('0xa5')](_0xac2d('0x10a'));}else{var _0x13b563=this[_0xac2d('0x12')][_0xac2d('0x71')](this,_0x31a47c['variable_id']);if(!_0x13b563){return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x31a47c,_0xac2d('0xcd'));}this[_0xac2d('0xe')][_0xac2d('0x9d')](_0x13b563,_0x28456f);}this[_0xac2d('0x37')]['sync'](this,_0x31a47c,_0x28456f);return _0x2948be;};AGIVertices[_0xac2d('0x11')][_0xac2d('0xa5')]=function(_0x59f55e){logger['info'](util[_0xac2d('0x28')](_0xac2d('0x166'),_0x59f55e[_0xac2d('0x39')]));return this[_0xac2d('0xe')]['noop'](_0x59f55e[_0xac2d('0x167')]||_0x59f55e['label']);};AGIVertices[_0xac2d('0x11')][_0xac2d('0x168')]=function(_0x617a32){logger['info'](util[_0xac2d('0x28')](_0xac2d('0x169'),_0x617a32[_0xac2d('0x39')]));if(!this['isConfigured'](_0x617a32[_0xac2d('0x154')])){return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x617a32,_0xac2d('0x155'));}logger[_0xac2d('0x2e')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xac2d('0xe')]['callerid'],_0x617a32[_0xac2d('0x154')]));var _0x18b312=this[_0xac2d('0x4d')][_0xac2d('0x71')](this,_0x617a32['pause_id']);var _0xaf4316=this['agentPause']['sync'](this,_0x617a32[_0xac2d('0x154')],_0x18b312);if(_0xaf4316){logger['info'](util['format'](_0xac2d('0x158'),this[_0xac2d('0xe')][_0xac2d('0x3b')],_0x617a32[_0xac2d('0x154')]));this[_0xac2d('0xe')][_0xac2d('0xa5')](util[_0xac2d('0x28')](_0xac2d('0x158'),this['channel']['callerid'],_0x617a32[_0xac2d('0x154')]));return{'code':0xc8,'result':_0xac2d('0x159')};}else{logger[_0xac2d('0x2e')](util[_0xac2d('0x28')](_0xac2d('0x15d'),this[_0xac2d('0xe')][_0xac2d('0x3b')],_0x617a32[_0xac2d('0x154')]));this[_0xac2d('0xe')][_0xac2d('0xa5')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xac2d('0xe')][_0xac2d('0x3b')],_0x617a32['findBy']));return{'code':0xc8,'result':_0xac2d('0x15a')};}};AGIVertices[_0xac2d('0x11')][_0xac2d('0x16a')]=function(_0x16db0e){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')](_0xac2d('0x16b'),_0x16db0e[_0xac2d('0x39')]));if(!this[_0xac2d('0x84')](_0x16db0e[_0xac2d('0x164')])){return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x16db0e,_0xac2d('0x108'));}var _0x5d4a0b=this['getSound'][_0xac2d('0x71')](this,_0x16db0e['file_id']);if(!_0x5d4a0b){return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x16db0e,_0xac2d('0x165'));}var _0xcfc7cb=this['channel'][_0xac2d('0x56')](_0xac2d('0x16c'),[_0x5d4a0b,_0x16db0e[_0xac2d('0xd7')]]);if(_0xcfc7cb['result']===-0x1){return _0xcfc7cb;}return this[_0xac2d('0xe')]['noop'](util[_0xac2d('0x28')](_0xac2d('0xbc'),_0xac2d('0x16c'),_0x5d4a0b));};AGIVertices[_0xac2d('0x11')][_0xac2d('0x16d')]=function(_0x43af89){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x43af89['label']));if(!this['isConfigured'](_0x43af89[_0xac2d('0x16e')])){return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x43af89,_0xac2d('0x16f'));}var _0x448143='';var _0x5c4c4e=parseInt(_0x43af89['queue_id'],0xa);if(isNaN(_0x5c4c4e)){_0x448143=_0x43af89['queue_id'];}else{_0x448143=this[_0xac2d('0x16')]['sync'](this,_0x43af89[_0xac2d('0x16e')]);if(!_0x448143){return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x43af89,'no\x20queue\x20found');}}var _0x362fd7='';if(this['isConfigured'](_0x43af89[_0xac2d('0x164')])){var _0x477b90=this[_0xac2d('0x109')][_0xac2d('0x71')](this,_0x43af89[_0xac2d('0x164')]);if(_0x477b90){_0x362fd7=_0x477b90;}}this[_0xac2d('0x37')][_0xac2d('0x71')](this,_0x43af89,_0x448143);if(_0x43af89[_0xac2d('0xd7')]['indexOf']('x')<0x0){_0x43af89[_0xac2d('0xd7')]+='x';}if(_0x43af89['opts'][_0xac2d('0x170')]('X')<0x0){_0x43af89[_0xac2d('0xd7')]+='X';}this['channel'][_0xac2d('0x9d')]('XMCS-QUEUE',_0x448143?_0x448143[_0xac2d('0x171')]():'');var _0x29daa4=this[_0xac2d('0xe')][_0xac2d('0x56')](_0xac2d('0x172'),[_0x448143,_0x43af89[_0xac2d('0xd7')],_0x43af89[_0xac2d('0x64')],_0x362fd7,_0x43af89[_0xac2d('0x66')],_0x43af89[_0xac2d('0x6')],_0x43af89['macro'],_0x43af89[_0xac2d('0x173')],'',_0x43af89[_0xac2d('0x174')]]);if(_0x29daa4[_0xac2d('0xa7')]===-0x1){return _0x29daa4;}return this[_0xac2d('0xe')][_0xac2d('0xa5')](util[_0xac2d('0x28')]('Executed\x20command\x20%s\x20%s',_0xac2d('0x172'),_0x448143));};AGIVertices[_0xac2d('0x11')][_0xac2d('0x175')]=function(_0x5d54a2){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')](_0xac2d('0x176'),_0x5d54a2[_0xac2d('0x39')]));var _0x4ebc2c=_0x5d54a2[_0xac2d('0x177')]||_0xac2d('0x129');var _0x3df234=util[_0xac2d('0x28')](_0xac2d('0x178'),this['channel'][_0xac2d('0x38')],rs[_0xac2d('0x110')](0x5));var _0x4289a9=util[_0xac2d('0x28')](_0xac2d('0x179'),FILES_PATH,_0x3df234,_0x4ebc2c);var _0x3e48a1=util['format']('%s/recordings/%s',FILES_PATH,_0x3df234);this['createSquareRecording'][_0xac2d('0x71')](this,_0x5d54a2,_0x3df234,_0x4289a9);this[_0xac2d('0xe')][_0xac2d('0x9d')](_0xac2d('0x17a'),_0x3df234);logger['info'](_0xac2d('0x17b'),_0x3e48a1,_0x4ebc2c,_0x5d54a2[_0xac2d('0x17c')],_0x5d54a2[_0xac2d('0x66')]);return this[_0xac2d('0xe')]['recordFile'](_0x3e48a1,_0x4ebc2c,_0x5d54a2['escape_digits'],_0x5d54a2[_0xac2d('0x66')],undefined,!![]);};AGIVertices['prototype'][_0xac2d('0x17d')]=function(_0x485ae3){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')](_0xac2d('0x17e'),_0x485ae3['label']));if(!this[_0xac2d('0x84')](_0x485ae3[_0xac2d('0x64')])){return this['channel']['noop']('no\x20url\x20configured');}var _0x496870=this[_0xac2d('0x63')]['sync'](this,_0x485ae3);logger[_0xac2d('0x2e')](util[_0xac2d('0x28')](_0xac2d('0x17f'),util['inspect'](_0x496870,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x485ae3[_0xac2d('0xcc')])){return this[_0xac2d('0xe')][_0xac2d('0xa5')](_0xac2d('0x180'));}var _0x59763d=this[_0xac2d('0x12')][_0xac2d('0x71')](this,_0x485ae3[_0xac2d('0xcc')]);if(!_0x59763d){return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x485ae3,_0xac2d('0xcd'));}this[_0xac2d('0xe')][_0xac2d('0x9d')](util['format']('%s_STATUS_CODE',_0x59763d),_0x496870[_0xac2d('0x76')]?_0x496870[_0xac2d('0x76')]:'200');this[_0xac2d('0xe')][_0xac2d('0x9d')](util[_0xac2d('0x28')]('%s_STATUS_MESSAGE',_0x59763d),_0x496870[_0xac2d('0x181')]?_0x496870['statusMessage']:'OK');if(_0x496870['body']){try{this[_0xac2d('0x9c')](_0x496870[_0xac2d('0x6c')],_0x59763d);}catch(_0x1a1994){logger[_0xac2d('0x2c')](util[_0xac2d('0x28')](_0xac2d('0x182'),_0x59763d));}}return this[_0xac2d('0xe')][_0xac2d('0xa5')](util['format'](_0xac2d('0xd2'),_0x59763d));};AGIVertices[_0xac2d('0x11')]['saydigits']=function(_0x4f408f){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x4f408f[_0xac2d('0x39')]));return this[_0xac2d('0xe')][_0xac2d('0x183')](_0x4f408f[_0xac2d('0x184')]['replace'](/\s+/g,''),_0x4f408f[_0xac2d('0x17c')]);};AGIVertices[_0xac2d('0x11')][_0xac2d('0x185')]=function(_0x292b50){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x292b50['label']));return this[_0xac2d('0xe')][_0xac2d('0x186')](_0x292b50[_0xac2d('0x67')][_0xac2d('0x57')](/\s+/g,''),_0x292b50[_0xac2d('0x17c')]);};AGIVertices[_0xac2d('0x11')][_0xac2d('0x187')]=function(_0x442b24){logger['info'](util[_0xac2d('0x28')](_0xac2d('0x188'),_0x442b24['label']));return this['channel'][_0xac2d('0x189')](_0x442b24[_0xac2d('0x5a')],_0x442b24[_0xac2d('0x17c')]);};AGIVertices[_0xac2d('0x11')][_0xac2d('0x18a')]=function(_0xbb1f25){logger['info'](util[_0xac2d('0x28')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0xbb1f25[_0xac2d('0x39')]));if(!this[_0xac2d('0x84')](_0xbb1f25[_0xac2d('0x18b')])){return this['channel']['noop'](_0xac2d('0x18c'));}var _0x586d61=this[_0xac2d('0x22')]['sync'](this,_0xbb1f25[_0xac2d('0x18b')]);if(!_0x586d61||!_0x586d61['Smtp']){return this[_0xac2d('0xe')]['error'](_0xbb1f25,_0xac2d('0x18d'));}var _0x184074={'from':util[_0xac2d('0x28')]('\x22%s\x22\x20<%s>',_0x586d61[_0xac2d('0x18')],_0x586d61[_0xac2d('0x18e')]||_0x586d61['Smtp'][_0xac2d('0x18f')]),'to':_0xbb1f25['to']||'','cc':_0xbb1f25['cc']||'','bcc':_0xbb1f25[_0xac2d('0x190')]||'','subject':_0xbb1f25[_0xac2d('0x191')],'html':_0xbb1f25['text'],'text':_0xbb1f25['text']};if(this[_0xac2d('0x84')](_0xbb1f25['template_id'])){}logger[_0xac2d('0x192')](_0xac2d('0x193'),JSON[_0xac2d('0x73')](_0x184074));this[_0xac2d('0x37')][_0xac2d('0x71')](this,_0xbb1f25,_0xbb1f25[_0xac2d('0x18b')]);this[_0xac2d('0xe')][_0xac2d('0xa5')](util[_0xac2d('0x28')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x586d61[_0xac2d('0x18')]));this[_0xac2d('0x23')][_0xac2d('0x71')](this,_0x586d61[_0xac2d('0x194')],_0x184074);return this[_0xac2d('0xe')]['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0xac2d('0x195')]=function(_0x25cc37){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')](_0xac2d('0x196'),_0x25cc37[_0xac2d('0x39')]));return this[_0xac2d('0xe')][_0xac2d('0xa5')](_0xac2d('0x197'));};AGIVertices[_0xac2d('0x11')][_0xac2d('0x198')]=function(_0x36b6c5){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x36b6c5['label']));if(!this[_0xac2d('0x84')](_0x36b6c5['sms_account_id'])){return this[_0xac2d('0xe')]['noop'](_0xac2d('0x199'));}var _0x3608d7=this[_0xac2d('0x34')][_0xac2d('0x71')](this,_0x36b6c5[_0xac2d('0x19a')]);if(!_0x3608d7){return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x36b6c5,_0xac2d('0x19b'));}var _0x1ea964={'body':_0x36b6c5['sms_text'],'phone':_0x36b6c5['to']||'','SmsAccountId':_0x3608d7['id']};logger[_0xac2d('0x192')](_0xac2d('0x19c'),JSON[_0xac2d('0x73')](_0x1ea964));this['createSquareDetailsReport'][_0xac2d('0x71')](this,_0x36b6c5,_0x36b6c5[_0xac2d('0x19a')]);this['channel'][_0xac2d('0xa5')](util[_0xac2d('0x28')](_0xac2d('0x19d'),_0x3608d7[_0xac2d('0x18')]));this[_0xac2d('0x36')]['sync'](this,_0x1ea964);return this[_0xac2d('0xe')]['noop'](_0xac2d('0x19e'));};AGIVertices[_0xac2d('0x11')][_0xac2d('0x19f')]=function(_0x3cfbc2){logger[_0xac2d('0x2e')](util['format'](_0xac2d('0x1a0'),_0x3cfbc2[_0xac2d('0x39')]));if(!this[_0xac2d('0x84')](_0x3cfbc2[_0xac2d('0xcc')])){return this[_0xac2d('0xe')]['error'](_0x3cfbc2,_0xac2d('0x1a1'));}var _0x548c80=this[_0xac2d('0x12')][_0xac2d('0x71')](this,_0x3cfbc2[_0xac2d('0xcc')]);if(!_0x548c80){return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x3cfbc2,'no\x20variable\x20found');}return this['channel'][_0xac2d('0x9d')](_0x548c80,_0x3cfbc2['variable_value']);};AGIVertices[_0xac2d('0x11')][_0xac2d('0x1a2')]=function(_0x41d2df){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')](_0xac2d('0x1a3'),_0x41d2df[_0xac2d('0x39')]));this[_0xac2d('0xe')][_0xac2d('0xa5')](_0xac2d('0x1a4'));if(_0x41d2df['answer']==='yes'){this[_0xac2d('0xe')]['noop'](_0xac2d('0x1a5'));return this[_0xac2d('0xe')]['answer']();}return this[_0xac2d('0xe')][_0xac2d('0xa5')]('Skipped\x20Answer');};AGIVertices['prototype'][_0xac2d('0x1a6')]=function(_0x4ac9e9){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')](_0xac2d('0x1a7'),_0x4ac9e9[_0xac2d('0x39')]));if(!this[_0xac2d('0x84')](_0x4ac9e9[_0xac2d('0x1a8')])){return this['channel']['error'](_0x4ac9e9,_0xac2d('0x1a9'));}var _0x1eca2c=this[_0xac2d('0x19')][_0xac2d('0x71')](this,_0x4ac9e9['project_id']);if(!this[_0xac2d('0x84')](_0x1eca2c)){return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x4ac9e9,util[_0xac2d('0x28')](_0xac2d('0x1aa'),_0x4ac9e9[_0xac2d('0x1a8')]));}if(_0x1eca2c===this[_0xac2d('0xe')][_0xac2d('0x40')]){return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x4ac9e9,_0xac2d('0x1ab'));}this[_0xac2d('0x37')][_0xac2d('0x71')](this,_0x4ac9e9,_0x1eca2c);var _0x188082=this[_0xac2d('0xe')][_0xac2d('0x56')](_0xac2d('0x1ac'),util[_0xac2d('0x28')](_0xac2d('0x1ad'),config[_0xac2d('0x6')][_0xac2d('0x1ae')]||_0xac2d('0x1af'),_0x1eca2c,this['channel'][_0xac2d('0x40')]));if(_0x188082[_0xac2d('0xa7')]===-0x1){return _0x188082;}return this[_0xac2d('0xe')]['noop'](util[_0xac2d('0x28')]('Executed\x20command\x20%s\x20%s',_0xac2d('0x1ac'),_0x1eca2c));};AGIVertices[_0xac2d('0x11')][_0xac2d('0x1b0')]=function(_0x31abe3){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')](_0xac2d('0x1b1'),_0x31abe3[_0xac2d('0x39')]));var _0x23a166=this[_0xac2d('0x55')]['sync'](this,_0x31abe3[_0xac2d('0xaf')]);this[_0xac2d('0x37')][_0xac2d('0x71')](this,_0x31abe3,_0x31abe3[_0xac2d('0xaf')]);if(this[_0xac2d('0x84')](_0x31abe3[_0xac2d('0xcc')])){var _0x107edb=this[_0xac2d('0x12')]['sync'](this,_0x31abe3['variable_id']);if(_0x107edb){this[_0xac2d('0xe')][_0xac2d('0x9d')](_0x107edb,_0x23a166);return this[_0xac2d('0xe')]['noop'](util['format'](_0xac2d('0x1b2'),_0x31abe3[_0xac2d('0xaf')],_0x107edb));}}return this[_0xac2d('0xe')][_0xac2d('0xa5')](util[_0xac2d('0x28')](_0xac2d('0x1b3'),_0x31abe3[_0xac2d('0xaf')]));};AGIVertices['prototype']['google_cloud_tts']=function(_0x56692d){logger['info'](util['format'](_0xac2d('0x1b4'),_0x56692d[_0xac2d('0x39')]));_0x56692d[_0xac2d('0x5a')]=_0x56692d['text'][_0xac2d('0x57')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xac2d('0x84')](_0x56692d[_0xac2d('0x59')])){return this[_0xac2d('0xe')][_0xac2d('0xa5')](_0xac2d('0x1b5'));}if(!this['isConfigured'](_0x56692d[_0xac2d('0x5a')])){return this['channel'][_0xac2d('0xa5')]('no\x20text\x20configured');}this['channel'][_0xac2d('0xa5')](util['format'](_0xac2d('0x1b6'),_0x56692d[_0xac2d('0x5a')]));var _0x214719=this['googleCloudTTS'][_0xac2d('0x71')](this,_0x56692d);if(_0x214719){this['channel'][_0xac2d('0xa5')](util[_0xac2d('0x28')](_0xac2d('0x1b7'),_0x214719));var _0x2deb59=this[_0xac2d('0xe')]['streamFile'](_0x214719);try{fs[_0xac2d('0x11d')](_0x214719+_0xac2d('0xf9'));}catch(_0x1530c3){logger[_0xac2d('0x2c')](_0x1530c3);}return _0x2deb59;}return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x56692d,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0xac2d('0x11')][_0xac2d('0x1b8')]=function(_0x301b74){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x301b74[_0xac2d('0x39')]));_0x301b74[_0xac2d('0x5a')]=_0x301b74[_0xac2d('0x5a')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x301b74[_0xac2d('0x5a')])){return this['channel'][_0xac2d('0xa5')]('no\x20text\x20configured');}this[_0xac2d('0xe')][_0xac2d('0xa5')](util[_0xac2d('0x28')](_0xac2d('0x1b9'),_0x301b74[_0xac2d('0x5a')]));var _0x745b8=this[_0xac2d('0x61')][_0xac2d('0x71')](this,_0x301b74);if(_0x745b8){this['channel']['noop'](util[_0xac2d('0x28')](_0xac2d('0x1ba'),_0x745b8));var _0x58041e=this[_0xac2d('0xe')][_0xac2d('0x152')](_0x745b8);try{fs[_0xac2d('0x11d')](_0x745b8+_0xac2d('0xf9'));}catch(_0x4b5597){logger[_0xac2d('0x2c')](_0x4b5597);}return _0x58041e;}return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x301b74,'Google\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0xac2d('0x1bb')]=function(_0x18ceaa){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')](_0xac2d('0x1bc'),_0x18ceaa[_0xac2d('0x39')]));if(!this[_0xac2d('0x84')](_0x18ceaa['findBy'])){return this[_0xac2d('0xe')][_0xac2d('0x2c')](_0x18ceaa,'no\x20find\x20by\x20configured');}logger[_0xac2d('0x2e')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xac2d('0xe')][_0xac2d('0x3b')],_0x18ceaa[_0xac2d('0x154')]));var _0x40eb33=this['agentUnpause'][_0xac2d('0x71')](this,_0x18ceaa[_0xac2d('0x154')]);if(_0x40eb33){logger['info'](util[_0xac2d('0x28')](_0xac2d('0x158'),this[_0xac2d('0xe')]['callerid'],_0x18ceaa[_0xac2d('0x154')]));this['channel'][_0xac2d('0xa5')](util['format'](_0xac2d('0x158'),this['channel']['callerid'],_0x18ceaa[_0xac2d('0x154')]));return{'code':0xc8,'result':_0xac2d('0x159')};}else{logger[_0xac2d('0x2e')](util[_0xac2d('0x28')](_0xac2d('0x15d'),this[_0xac2d('0xe')][_0xac2d('0x3b')],_0x18ceaa['findBy']));this[_0xac2d('0xe')][_0xac2d('0xa5')](util[_0xac2d('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xac2d('0xe')][_0xac2d('0x3b')],_0x18ceaa[_0xac2d('0x154')]));return{'code':0xc8,'result':_0xac2d('0x15a')};}};AGIVertices[_0xac2d('0x11')]['voicemail']=function(_0x397f00){logger['info'](util[_0xac2d('0x28')](_0xac2d('0x1bd'),_0x397f00[_0xac2d('0x39')]));var _0x3073ac=this['channel'][_0xac2d('0x56')](_0xac2d('0x1be'),[_0x397f00[_0xac2d('0x1bf')],_0x397f00[_0xac2d('0x79')]]);if(_0x3073ac[_0xac2d('0xa7')]===-0x1){return _0x3073ac;}return this['channel'][_0xac2d('0xa5')](util[_0xac2d('0x28')](_0xac2d('0xbc'),'VOICEMAIL',_0x397f00[_0xac2d('0x1bf')]));};AGIVertices[_0xac2d('0x11')]['vswitch']=function(_0x5af5ed){logger[_0xac2d('0x2e')](util[_0xac2d('0x28')](_0xac2d('0x1c0'),_0x5af5ed[_0xac2d('0x39')]));if(!this[_0xac2d('0x84')](_0x5af5ed['variable_id'])){return this['channel'][_0xac2d('0x2c')](_0x5af5ed,'no\x20variable\x20selected');}var _0x9b4532=this[_0xac2d('0x12')][_0xac2d('0x71')](this,_0x5af5ed['variable_id']);if(!_0x9b4532){return this['channel'][_0xac2d('0x2c')](_0x5af5ed,_0xac2d('0xcd'));}var _0x33daad=this[_0xac2d('0xe')][_0xac2d('0x12')](_0x9b4532);return{'code':0xc8,'result':_0x33daad[_0xac2d('0xa1')]?_0x33daad[_0xac2d('0xa1')]:'-'};};String[_0xac2d('0x11')][_0xac2d('0xa0')]=function(_0x8c26ab,_0x887ca8){return this['split'](_0x8c26ab)['join'](_0x887ca8);};module['exports']=AGIVertices; \ No newline at end of file +var _0xa596=['Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','.wav','ispeech\x20TTS\x20is\x20unreachable','login','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','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','%s[%s]','variable\x20%s[key]\x20set','getData','digit','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','playback','PLAYBACK','queue','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','createSquareRecording','RECORDING_SAVENAME','escape_digits','no\x20url\x20configured','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','statusMessage','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','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>','email','user','bcc','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','debug','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','apiKey','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','split','join','exports','util','lodash','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','mailRpc','prototype','getVariable','rpc','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','interval','map','Intervals','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','channel','callerid','extension','accountcode','dnid','arg_1','file','createSquareMessage','createCmContact','isNil','callback_','isEmpty','lastName','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','format','%s/%s@from-sip/n','shellCommand','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','restAPI','method','timeout','number','includes','POST','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','stringify','render','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_access_key_id','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','replaceAll','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','maxRetry','sync','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','exec','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','label','no\x20grammar\x20configured','grammar','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','list_id','no\x20list\x20selected','delay','add','phone','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','MRCPSynth','lumenvoxasr','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','bot','DIALOGFLOW_%s','speech','out','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','url','finally','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','response','maxdigit','test','mindigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','getsecretdigits','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','tilde\x20%s\x20file\x20created','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup'];(function(_0x3baaba,_0x134693){var _0x1c8c85=function(_0x1a1de5){while(--_0x1a1de5){_0x3baaba['push'](_0x3baaba['shift']());}};_0x1c8c85(++_0x134693);}(_0xa596,0x7b));var _0x6a59=function(_0x8ff653,_0x4101ee){_0x8ff653=_0x8ff653-0x0;var _0xd709bd=_0xa596[_0x8ff653];return _0xd709bd;};'use strict';var fs=require('fs');var util=require(_0x6a59('0x0'));var _=require(_0x6a59('0x1'));var sh=require('shelljs');var odbc=require(_0x6a59('0x2'))();var rs=require(_0x6a59('0x3'));var moment=require(_0x6a59('0x4'));var Mustache=require(_0x6a59('0x5'));var rp=require(_0x6a59('0x6'));var logger=require(_0x6a59('0x7'))(_0x6a59('0x8'));var config=require(_0x6a59('0x9'));var shared=require('../../config/environment/shared');var scripts=require(_0x6a59('0xa'));var FILES_PATH=_0x6a59('0xb');var recursiveMapAttributes=[_0x6a59('0xc'),_0x6a59('0xd')];var verticesWithRetry=[_0x6a59('0xe'),_0x6a59('0xf'),'getsecretdigits'];var AGIVertices=function(_0x3f25d8,_0x48ecee,_0x21008c){this['channel']=_0x3f25d8;this['rpc']=_0x48ecee;this[_0x6a59('0x10')]=_0x21008c;};AGIVertices[_0x6a59('0x11')][_0x6a59('0x12')]=function(_0x542b9d,_0x40fc4c){this[_0x6a59('0x13')]['getVariableById'](_0x542b9d)[_0x6a59('0x14')](function(_0x4bf880){_0x40fc4c(null,_0x4bf880?_0x4bf880[_0x6a59('0x15')]:![]);})[_0x6a59('0x16')](function(_0x177506){_0x40fc4c(_0x177506);});};AGIVertices[_0x6a59('0x11')][_0x6a59('0x17')]=function(_0x108c02,_0x1a1e36){this[_0x6a59('0x13')][_0x6a59('0x18')](_0x108c02)[_0x6a59('0x14')](function(_0x3bef82){_0x1a1e36(null,_0x3bef82?_0x3bef82['name']:![]);})[_0x6a59('0x16')](function(_0x1ec768){_0x1a1e36(_0x1ec768);});};AGIVertices[_0x6a59('0x11')][_0x6a59('0x19')]=function(_0x258441,_0x39ad1e){this['rpc'][_0x6a59('0x1a')](_0x258441)[_0x6a59('0x14')](function(_0x3cb568){_0x39ad1e(null,_0x3cb568?_0x3cb568[_0x6a59('0x15')]:![]);})[_0x6a59('0x16')](function(_0x2b15b0){_0x39ad1e(_0x2b15b0);});};AGIVertices[_0x6a59('0x11')][_0x6a59('0x1b')]=function(_0xe7d724,_0x2ac36d){this[_0x6a59('0x13')][_0x6a59('0x1c')](_0xe7d724)[_0x6a59('0x14')](function(_0x394f60){_0x2ac36d(null,_0x394f60?_0x394f60[_0x6a59('0x1d')]:![]);})[_0x6a59('0x16')](function(_0x3af7a7){_0x2ac36d(_0x3af7a7);});};AGIVertices['prototype'][_0x6a59('0x1e')]=function(_0x3e068b,_0xe2573f){this[_0x6a59('0x13')]['getUserById'](_0x3e068b)['then'](function(_0x1a38d1){_0xe2573f(null,_0x1a38d1?_0x1a38d1[_0x6a59('0x15')]:![]);})[_0x6a59('0x16')](function(_0x3d3bdc){_0xe2573f(_0x3d3bdc);});};AGIVertices['prototype']['getTrunk']=function(_0x344cea,_0x28321b){this['rpc'][_0x6a59('0x1f')](_0x344cea)['then'](function(_0x342292){_0x28321b(null,_0x342292?_0x342292[_0x6a59('0x15')]:![]);})['catch'](function(_0x4174ee){_0x28321b(_0x4174ee);});};AGIVertices['prototype'][_0x6a59('0x20')]=function(_0x279112,_0x4a183e){var _0x199317=this;this['rpc'][_0x6a59('0x21')](_0x279112)[_0x6a59('0x14')](function(_0x205b4d){_0x4a183e(null,_0x205b4d?_0x199317[_0x6a59('0x22')](_0x205b4d[_0x6a59('0x23')]):![]);})[_0x6a59('0x16')](function(_0x4e657a){_0x4a183e(_0x4e657a);});};AGIVertices['prototype'][_0x6a59('0x24')]=function(_0x37f63f,_0x563675){this[_0x6a59('0x13')]['getMailAccountById'](_0x37f63f)[_0x6a59('0x14')](function(_0x20b44d){_0x563675(null,_0x20b44d?_0x20b44d:![]);})[_0x6a59('0x16')](function(_0x47e7fb){_0x563675(_0x47e7fb);});};AGIVertices[_0x6a59('0x11')][_0x6a59('0x25')]=function(_0x41455,_0x4e1c6d,_0x25fc63){this[_0x6a59('0x10')]['sendMailMessage'](_0x41455,_0x4e1c6d)[_0x6a59('0x14')](function(){_0x25fc63(null);})['catch'](function(_0x1f1024){_0x25fc63(_0x1f1024);});};AGIVertices[_0x6a59('0x11')]['getIntervals']=function(_0x7a769f,_0x2af776){this['rpc']['getIntervalById'](_0x7a769f)['then'](function(_0x595f72){if(_0x595f72){if(_0x595f72['IntervalId']){_0x2af776(null,[_0x595f72[_0x6a59('0x26')]]);}else{_0x2af776(null,_[_0x6a59('0x27')](_0x595f72[_0x6a59('0x28')],'interval'));}}else{_0x2af776(null,![]);}})[_0x6a59('0x16')](function(_0x24cf48){_0x2af776(_0x24cf48);});};AGIVertices['prototype']['getSoundPath']=function(_0x1263bb){return util['format'](_0x6a59('0x29'),FILES_PATH,_0x1263bb);};AGIVertices[_0x6a59('0x11')][_0x6a59('0x2a')]=function(_0x3077d5,_0x31b9bc,_0x1a57f8){odbc[_0x6a59('0x2b')](_0x3077d5,function(_0xa518ed){if(_0xa518ed){logger[_0x6a59('0x2c')](_0x6a59('0x2d'),_0xa518ed);_0x1a57f8(_0xa518ed);}else{logger[_0x6a59('0x2e')](_0x6a59('0x2f'));odbc[_0x6a59('0x30')](_0x31b9bc,function(_0x1fb589,_0x7f7a28){if(_0x1fb589){logger[_0x6a59('0x2e')]('Error\x20executing\x20query\x20%s',_0x31b9bc);_0x1a57f8(_0x1fb589);}else{logger[_0x6a59('0x2e')]('Query\x20executed\x20correctly\x20%s',_0x31b9bc);odbc[_0x6a59('0x31')](function(_0x332e48){if(_0x332e48){logger[_0x6a59('0x2c')](_0x6a59('0x32'),_0x332e48);}_0x1a57f8(null,_0x7f7a28);});}});}});};AGIVertices[_0x6a59('0x11')][_0x6a59('0x33')]=function(_0x2c5e8e,_0x373f9c){this[_0x6a59('0x13')]['getSmsAccountById'](_0x2c5e8e)[_0x6a59('0x14')](function(_0x6f6dab){_0x373f9c(null,_0x6f6dab?_0x6f6dab:![]);})[_0x6a59('0x16')](function(_0x55a17d){_0x373f9c(_0x55a17d);});};AGIVertices['prototype'][_0x6a59('0x34')]=function(_0x2d3eff,_0x3722f5){this['rpc'][_0x6a59('0x34')](_0x2d3eff)[_0x6a59('0x14')](function(_0x399532){_0x3722f5(null,_0x399532);})['catch'](function(_0x5a4354){_0x3722f5(_0x5a4354);});};AGIVertices[_0x6a59('0x11')][_0x6a59('0x35')]=function(_0x3f4396,_0x227d8e,_0xfd5bd0){this[_0x6a59('0x13')]['createSquareDetailsReport']({'uniqueid':this['channel'][_0x6a59('0x36')],'node':_0x3f4396['label'],'application':_0x3f4396[_0x6a59('0x37')],'data':_0x227d8e||null,'project_name':this[_0x6a59('0x38')]['arg_1'],'callerid':this[_0x6a59('0x38')][_0x6a59('0x39')]})[_0x6a59('0x14')](function(_0x234914){if(_0xfd5bd0){_0xfd5bd0(null,_0x234914);}})[_0x6a59('0x16')](function(_0x481ed2){if(_0xfd5bd0){_0xfd5bd0(_0x481ed2);}});};AGIVertices[_0x6a59('0x11')]['createSquareRecording']=function(_0x4fdc97,_0x5b67b3,_0x49359c,_0x3f1123){this[_0x6a59('0x13')]['createSquareRecording']({'uniqueid':this[_0x6a59('0x38')][_0x6a59('0x36')],'callerid':this[_0x6a59('0x38')]['callerid'],'calleridname':this['channel']['calleridname'],'context':this[_0x6a59('0x38')]['context'],'extension':this[_0x6a59('0x38')][_0x6a59('0x3a')],'priority':this['channel']['priority'],'accountcode':this['channel'][_0x6a59('0x3b')],'dnid':this[_0x6a59('0x38')][_0x6a59('0x3c')],'projectName':this[_0x6a59('0x38')][_0x6a59('0x3d')],'saveName':_0x5b67b3,'filename':_0x4fdc97[_0x6a59('0x3e')]||_0x5b67b3,'savePath':_0x49359c})[_0x6a59('0x14')](function(_0x5778a6){_0x3f1123(null,_0x5778a6);})[_0x6a59('0x16')](function(_0xc24a7d){_0x3f1123(_0xc24a7d);});};AGIVertices[_0x6a59('0x11')][_0x6a59('0x3f')]=function(_0xfd5736,_0x555783,_0x3099e5,_0x3c9109,_0x424812){this[_0x6a59('0x13')][_0x6a59('0x3f')]({'uniqueid':this[_0x6a59('0x38')]['uniqueid'],'body':_0xfd5736,'direction':_0x555783,'providerName':_0x3099e5,'providerResponse':_0x3c9109})[_0x6a59('0x14')](function(_0x49e279){if(_0x424812){_0x424812(null,_0x49e279);}})[_0x6a59('0x16')](function(_0x1742b4){if(_0x424812){_0x424812(_0x1742b4);}});};AGIVertices[_0x6a59('0x11')]['createCmContact']=function(_0x5ed91b,_0x5a4a3c){this[_0x6a59('0x13')][_0x6a59('0x40')]({'firstName':_['isEmpty'](_0x5ed91b[_0x6a59('0x15')])||_[_0x6a59('0x41')](_0x5ed91b[_0x6a59('0x15')])?_0x6a59('0x42')+Math['random']():_0x5ed91b['name'],'lastName':_[_0x6a59('0x43')](_0x5ed91b[_0x6a59('0x44')])||_[_0x6a59('0x41')](_0x5ed91b[_0x6a59('0x44')])?null:_0x5ed91b[_0x6a59('0x44')],'phone':_0x5ed91b['phone'],'ListId':_0x5ed91b['list_id'],'scheduledat':_0x5ed91b[_0x6a59('0x45')],'callbackUniqueid':this[_0x6a59('0x38')][_0x6a59('0x36')],'tags':'callback','description':_0x6a59('0x46')+_0x5ed91b['scheduledAt'][_0x6a59('0x47')](),'priority':_0x5ed91b[_0x6a59('0x48')]})['then'](function(_0x19c499){_0x5a4a3c(null,_0x19c499);})[_0x6a59('0x16')](function(_0x737ebf){_0x5a4a3c(_0x737ebf);});};AGIVertices[_0x6a59('0x11')]['getPause']=function(_0x1c06e4,_0x3b9bca){this[_0x6a59('0x13')][_0x6a59('0x49')](_0x1c06e4)[_0x6a59('0x14')](function(_0x81a9e0){_0x3b9bca(null,_0x81a9e0?_0x81a9e0['name']:![]);})[_0x6a59('0x16')](function(_0x1e0cc1){_0x3b9bca(_0x1e0cc1);});};AGIVertices[_0x6a59('0x11')][_0x6a59('0x4a')]=function(_0x5ad30c,_0x354672,_0x46dd4a){var _0x558431={'role':_0x6a59('0x4b')};_0x558431[_0x5ad30c]=this['channel'][_0x6a59('0x39')];this['rpc'][_0x6a59('0x4a')](_0x558431,_0x354672,this[_0x6a59('0x38')][_0x6a59('0x36')])[_0x6a59('0x14')](function(_0x1b8132){_0x46dd4a(null,_[_0x6a59('0x41')](_0x1b8132)?![]:!![]);})[_0x6a59('0x16')](function(_0x365e1d){logger[_0x6a59('0x2c')](_0x365e1d);_0x46dd4a(null,![]);});};AGIVertices[_0x6a59('0x11')][_0x6a59('0x4c')]=function(_0x2ae7f4,_0x1f66d5){var _0x4fe4ca={'role':_0x6a59('0x4b')};_0x4fe4ca[_0x2ae7f4]=this['channel']['callerid'];this[_0x6a59('0x13')][_0x6a59('0x4c')](_0x4fe4ca)['then'](function(_0x522bfa){_0x1f66d5(null,_['isNil'](_0x522bfa)?![]:!![]);})[_0x6a59('0x16')](function(_0x4e8739){logger[_0x6a59('0x2c')](_0x4e8739);_0x1f66d5(null,![]);});};AGIVertices[_0x6a59('0x11')][_0x6a59('0x4d')]=function(_0x1acf9f,_0x28a554){var _0x3a4f79={'role':'agent'};_0x3a4f79[_0x1acf9f]=this[_0x6a59('0x38')][_0x6a59('0x39')];this[_0x6a59('0x13')][_0x6a59('0x4d')](_0x3a4f79)[_0x6a59('0x14')](function(_0x5796df){_0x28a554(null,_[_0x6a59('0x41')](_0x5796df)?![]:!![]);})[_0x6a59('0x16')](function(_0x425233){logger[_0x6a59('0x2c')](_0x425233);_0x28a554(null,![]);});};AGIVertices[_0x6a59('0x11')][_0x6a59('0x4e')]=function(_0x5a9c68,_0x2e6637){var _0x569cf4={'role':'agent'};_0x569cf4[_0x5a9c68]=this[_0x6a59('0x38')][_0x6a59('0x39')];var _0x1131de=_0x5a9c68!='internal'?util[_0x6a59('0x4f')](_0x6a59('0x50'),'LOCAL',this[_0x6a59('0x38')][_0x6a59('0x39')]):undefined;this['rpc'][_0x6a59('0x4e')](_0x569cf4,_0x1131de)[_0x6a59('0x14')](function(_0x55af4d){_0x2e6637(null,_[_0x6a59('0x41')](_0x55af4d)?![]:!![]);})['catch'](function(_0x145e4b){logger[_0x6a59('0x2c')](_0x145e4b);_0x2e6637(null,![]);});};AGIVertices[_0x6a59('0x11')][_0x6a59('0x51')]=function(_0x109bdf,_0x531b2e){sh['exec'](_[_0x6a59('0x52')](_0x109bdf),function(_0x235f24,_0x5714a6){var _0x4e534b=_0x5714a6[_0x6a59('0x53')](/(\r\n|\n|\r)/gm,'');_0x531b2e(null,_0x4e534b);});};AGIVertices['prototype']['googleCloudTTS']=function(_0x521e64,_0x25febc){scripts[_0x6a59('0x54')](_0x521e64['apiKey'],_0x521e64[_0x6a59('0x55')]||_0x6a59('0x56'),_0x521e64[_0x6a59('0x56')],_0x521e64['languageCode']||_0x6a59('0x57'),_0x521e64[_0x6a59('0x58')]||_0x6a59('0x59'),_0x521e64[_0x6a59('0x5a')]||_0x6a59('0x5b'))[_0x6a59('0x14')](function(_0x12393b){_0x25febc(null,_0x12393b);})['catch'](function(_0xe7cdf3){_0x25febc(_0xe7cdf3);});};AGIVertices[_0x6a59('0x11')][_0x6a59('0x5c')]=function(_0x147056,_0x183dd1){scripts[_0x6a59('0x5c')](_0x147056[_0x6a59('0x56')],_0x147056['google_tts_language']||'en',0x1)['then'](function(_0x41a6e4){_0x183dd1(null,_0x41a6e4);})[_0x6a59('0x16')](function(_0xb7ff98){_0x183dd1(_0xb7ff98);});};AGIVertices[_0x6a59('0x11')][_0x6a59('0x5d')]=function(_0x3a3dc6,_0x5c91d0){var _0x29a5eb={'uri':_0x3a3dc6['url'],'method':_0x3a3dc6[_0x6a59('0x5e')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x3a3dc6[_0x6a59('0x5f')])===_0x6a59('0x60')&&parseInt(_0x3a3dc6[_0x6a59('0x5f')])>=0x1?parseInt(_0x3a3dc6[_0x6a59('0x5f')])*0x3e8:0x5*0x3e8};if(_[_0x6a59('0x61')]([_0x6a59('0x62'),'PUT'],_0x29a5eb[_0x6a59('0x5e')][_0x6a59('0x63')]())){try{_0x29a5eb[_0x6a59('0x64')]=_0x3a3dc6[_0x6a59('0xd')]?JSON[_0x6a59('0x65')](_0x3a3dc6['rawBody']):{};}catch(_0x268c26){logger[_0x6a59('0x2c')](_0x6a59('0x66'),_0x268c26);}}try{_0x29a5eb[_0x6a59('0x67')]=_0x3a3dc6[_0x6a59('0xc')]?JSON[_0x6a59('0x65')](_0x3a3dc6[_0x6a59('0xc')]):{};}catch(_0x180896){logger['error'](_0x6a59('0x68'),_0x180896);}if(_0x3a3dc6[_0x6a59('0x69')]){try{var _0x1e6382=require(_0x3a3dc6[_0x6a59('0x69')])['sync'](this,_0x29a5eb);_0x29a5eb[_0x6a59('0x6a')]=Mustache['render'](_0x3a3dc6['url'],_0x1e6382,{},['$$','$$']);if(_0x29a5eb['headers']){_0x29a5eb['headers']=JSON[_0x6a59('0x65')](Mustache['render'](JSON[_0x6a59('0x6b')](_0x29a5eb[_0x6a59('0x67')]),_0x1e6382,{},['$$','$$']));}if(_0x29a5eb[_0x6a59('0x64')]){_0x29a5eb[_0x6a59('0x64')]=JSON[_0x6a59('0x65')](Mustache[_0x6a59('0x6c')](JSON[_0x6a59('0x6b')](_0x29a5eb[_0x6a59('0x64')]),_0x1e6382,{},['$$','$$']));}}catch(_0x35a65e){logger[_0x6a59('0x2c')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x35a65e);}}rp(_0x29a5eb)['then'](function(_0x4ed0bc){var _0x5c0d01={'statusCode':_0x4ed0bc[_0x6a59('0x6d')]||0xc8,'statusMessage':_0x4ed0bc['statusMessage']||'OK','headers':_0x4ed0bc[_0x6a59('0x67')]||{},'body':_0x4ed0bc['body']||{}};_0x5c91d0(null,_0x5c0d01);})['catch'](function(_0x232f4e){var _0x1b40a4={'statusCode':_0x232f4e[_0x6a59('0x6d')]||0x1f4,'statusMessage':_0x232f4e[_0x6a59('0x6e')]||_0x6a59('0x6f'),'headers':_0x232f4e[_0x6a59('0x70')]['headers']||{},'body':_0x232f4e[_0x6a59('0x70')][_0x6a59('0x64')]||{}};_0x5c91d0(null,_0x1b40a4);});};AGIVertices[_0x6a59('0x11')][_0x6a59('0x71')]=function(_0x3377a5,_0x4fa4a4){scripts['googleDialogflow'](this[_0x6a59('0x38')][_0x6a59('0x36')],_0x3377a5[_0x6a59('0x72')],_0x3377a5['text'],_0x3377a5['dialogflow_language']||'en')[_0x6a59('0x14')](function(_0x40298f){_0x4fa4a4(null,_0x40298f);})[_0x6a59('0x16')](function(_0x354700){_0x4fa4a4(_0x354700);});};AGIVertices[_0x6a59('0x11')][_0x6a59('0x73')]=function(_0x116039,_0x131891){scripts[_0x6a59('0x73')](this['channel'][_0x6a59('0x36')],_0x116039[_0x6a59('0x74')],_0x116039[_0x6a59('0x75')],_0x116039[_0x6a59('0x76')],_0x116039['text'],_0x116039[_0x6a59('0x77')]||'en')['then'](function(_0x274cf2){_0x131891(null,_0x274cf2);})['catch'](function(_0x55a6ff){_0x131891(_0x55a6ff);});};AGIVertices[_0x6a59('0x11')][_0x6a59('0x78')]=function(_0x956a1a,_0xc07940){scripts[_0x6a59('0x78')](this[_0x6a59('0x38')],_0x956a1a)[_0x6a59('0x14')](function(_0x459b03){_0xc07940(null,_0x459b03);})['catch'](function(_0x18b2cc){_0xc07940(_0x18b2cc);});};AGIVertices[_0x6a59('0x11')][_0x6a59('0x79')]=function(_0x263ec0,_0x20643f){scripts[_0x6a59('0x79')](_0x263ec0[_0x6a59('0x72')],_0x263ec0[_0x6a59('0x56')],_0x263ec0[_0x6a59('0x7a')]||_0x6a59('0x57'),_0x263ec0[_0x6a59('0x7b')])[_0x6a59('0x14')](function(_0x100f25){_0x20643f(null,_0x100f25);})['catch'](function(_0xc160f){_0x20643f(_0xc160f);});};AGIVertices[_0x6a59('0x11')][_0x6a59('0x7c')]=function(_0x847b9b,_0x1bcb94,_0x1392c9){scripts[_0x6a59('0x7c')](_0x1bcb94,_0x847b9b[_0x6a59('0x72')],_0x847b9b[_0x6a59('0x7d')]||'en-US',this[_0x6a59('0x7e')](_0x847b9b[_0x6a59('0x7f')])?_0x847b9b[_0x6a59('0x7f')]:undefined)[_0x6a59('0x14')](function(_0x28bcd2){_0x1392c9(null,_0x28bcd2);})[_0x6a59('0x16')](function(_0x12d3d2){_0x1392c9(_0x12d3d2);});};AGIVertices['prototype'][_0x6a59('0x80')]=function(_0x22831a,_0x1fdea9){scripts['awsPolly'](_0x22831a['aws_access_key_id'],_0x22831a['aws_secret_access_key'],_0x22831a[_0x6a59('0x81')],_0x22831a[_0x6a59('0x82')]||_0x6a59('0x83'),_0x22831a['text'],_0x22831a[_0x6a59('0x84')]||'text')[_0x6a59('0x14')](function(_0x11b159){_0x1fdea9(null,_0x11b159);})['catch'](function(_0x28b56e){_0x1fdea9(_0x28b56e);});};AGIVertices[_0x6a59('0x11')][_0x6a59('0x85')]=function(_0x1a2128,_0x387153){scripts[_0x6a59('0x85')](this[_0x6a59('0x38')][_0x6a59('0x36')],_0x1a2128[_0x6a59('0x86')],_0x1a2128[_0x6a59('0x87')],_0x1a2128[_0x6a59('0x88')],_0x1a2128['text'],_0x1a2128[_0x6a59('0x89')])[_0x6a59('0x14')](function(_0x5543da){_0x387153(null,_0x5543da);})['catch'](function(_0x333170){_0x387153(_0x333170);});};AGIVertices['prototype'][_0x6a59('0x8a')]=function(_0x2f9179,_0x32c23e,_0x51931d){scripts[_0x6a59('0x8a')](_0x32c23e,_0x2f9179[_0x6a59('0x72')],_0x2f9179[_0x6a59('0x8b')]||_0x6a59('0x57'))[_0x6a59('0x14')](function(_0x4de037){_0x51931d(null,_0x4de037);})[_0x6a59('0x16')](function(_0x455b99){_0x51931d(_0x455b99);});};AGIVertices[_0x6a59('0x11')][_0x6a59('0x8c')]=function(_0x34e39a,_0x4b71cb,_0x4aa510){scripts[_0x6a59('0x8c')](_0x4b71cb,_0x34e39a['appid'],_0x34e39a[_0x6a59('0x8d')],_0x34e39a[_0x6a59('0x6a')])[_0x6a59('0x14')](function(_0x6f24a8){_0x4aa510(null,_0x6f24a8);})['catch'](function(_0x494280){_0x4aa510(_0x494280);});};AGIVertices['prototype'][_0x6a59('0x8e')]=function(_0x27909f){var _0x57b25d=_[_0x6a59('0x61')](verticesWithRetry,_0x27909f['agicommand'])?_0x27909f:_[_0x6a59('0x8f')](_0x27909f);for(var _0xac4f3e in _0x57b25d){if(_0x57b25d[_0x6a59('0x90')](_0xac4f3e)){if(_0x57b25d[_0xac4f3e]&&_[_0x6a59('0x91')](_0x57b25d[_0xac4f3e])){if(_[_0x6a59('0x61')](recursiveMapAttributes,_0xac4f3e)){_0x57b25d[_0xac4f3e]=this[_0x6a59('0x92')](_0x57b25d[_0xac4f3e]);}else{_0x57b25d[_0xac4f3e]=this[_0x6a59('0x93')](_0x57b25d[_0xac4f3e]);}}}}return _0x57b25d;};AGIVertices[_0x6a59('0x11')][_0x6a59('0x94')]=function(_0x202c9e){for(var _0x90092d in _0x202c9e){if(_0x202c9e['hasOwnProperty'](_0x90092d)){if(_[_0x6a59('0x95')](_0x202c9e[_0x90092d])){this['recursiveNodeIndex'](_0x202c9e[_0x90092d]);}else if(_[_0x6a59('0x96')](_0x202c9e[_0x90092d])){for(var _0x5345e5=0x0;_0x5345e5<_0x202c9e[_0x90092d][_0x6a59('0x97')];_0x5345e5++){this[_0x6a59('0x94')](_0x202c9e[_0x90092d][_0x5345e5]);}}else if(_[_0x6a59('0x91')](_0x202c9e[_0x90092d])){_0x202c9e[_0x90092d]=this[_0x6a59('0x93')](_0x202c9e[_0x90092d]);}}}};AGIVertices[_0x6a59('0x11')][_0x6a59('0x98')]=function(_0x3d099a,_0x4986b9){for(var _0x5c2159 in _0x3d099a){if(_0x3d099a[_0x6a59('0x90')](_0x5c2159)){if(_[_0x6a59('0x95')](_0x3d099a[_0x5c2159])){if(!_[_0x6a59('0x43')](_0x3d099a[_0x5c2159])){this['saveRestApiResult'](_0x3d099a[_0x5c2159],util['format'](_0x6a59('0x99'),_0x4986b9,_0x5c2159));}}else if(_[_0x6a59('0x96')](_0x3d099a[_0x5c2159])){for(var _0x2093c7=0x0;_0x2093c7<_0x3d099a[_0x5c2159][_0x6a59('0x97')];_0x2093c7++){this[_0x6a59('0x98')](_0x3d099a[_0x5c2159][_0x2093c7],util[_0x6a59('0x4f')](_0x6a59('0x99'),_0x4986b9,_0x5c2159+'['+_0x2093c7+']'));}}else{if(!_[_0x6a59('0x41')](_0x3d099a[_0x5c2159])){this[_0x6a59('0x38')]['setVariable'](util[_0x6a59('0x4f')](_0x6a59('0x99'),_0x4986b9,_0x5c2159),_0x3d099a[_0x5c2159]);}}}}};AGIVertices[_0x6a59('0x11')][_0x6a59('0x92')]=function(_0x1f359b){try{var _0x5104f7=JSON[_0x6a59('0x65')](_0x1f359b);this[_0x6a59('0x94')](_0x5104f7);return JSON[_0x6a59('0x6b')](_0x5104f7);}catch(_0x2c44c5){return this[_0x6a59('0x93')](_0x1f359b);}};AGIVertices[_0x6a59('0x11')][_0x6a59('0x93')]=function(_0x1a8a9a){var _0x1fb503=_0x1a8a9a['split']('{');for(var _0xadff7b=0x1;_0xadff7b<_0x1fb503[_0x6a59('0x97')];_0xadff7b+=0x1){var _0x5585b0=_0x1fb503[_0xadff7b]['split']('}');if(_0x5585b0[_0x6a59('0x97')]>0x1){_0x1a8a9a=_0x1a8a9a[_0x6a59('0x9a')]('{'+_0x5585b0[0x0]+'}',this['channel'][_0x6a59('0x12')](_0x5585b0[0x0])[_0x6a59('0x9b')]||_0x5585b0[0x0]);}}if(_0x1fb503['length']===0x1){return _0x1a8a9a['toString']();}return this[_0x6a59('0x93')](_0x1a8a9a);};AGIVertices['prototype'][_0x6a59('0x9c')]=function(_0x2ab07c,_0x3f457e){var _0x4f0537=this[_0x6a59('0x38')][_0x6a59('0x12')](_0x2ab07c);if(_0x4f0537['result']===-0x1){return _0x4f0537;}logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0x9d'),_0x3f457e,_0x4f0537[_0x6a59('0x9b')]));return this[_0x6a59('0x38')][_0x6a59('0x9e')](_0x3f457e,_0x4f0537['extra']);};AGIVertices['prototype'][_0x6a59('0x7e')]=function(_0x42b298){return _0x42b298&&_0x42b298!=='0'&&_0x42b298!=='-1'&&_0x42b298!=='';};AGIVertices['prototype'][_0x6a59('0x9f')]=function(_0x247814){this[_0x6a59('0x35')][_0x6a59('0xa0')](this,_0x247814,'-');_0x247814[_0x6a59('0xa1')]=_0x247814[_0x6a59('0x9f')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x6a59('0x11')][_0x6a59('0xa2')]=function(_0x4b11b9){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0xa3'),_0x4b11b9['label']));if(!this[_0x6a59('0x7e')](_0x4b11b9[_0x6a59('0x56')])){return this['channel'][_0x6a59('0xa4')](_0x6a59('0xa5'));}var _0x92a13c='\x22'+_0x4b11b9['text']+'\x22';if(this['isConfigured'](_0x4b11b9[_0x6a59('0x70')])){_0x92a13c+=','+_0x4b11b9[_0x6a59('0x70')];}var _0x5b381a=this[_0x6a59('0x38')][_0x6a59('0xa6')]('MRCPSynth',_0x92a13c);if(_0x5b381a[_0x6a59('0xa7')]===-0x1){return _0x5b381a;}return this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')](_0x6a59('0xa8'),_0x92a13c));};AGIVertices[_0x6a59('0x11')][_0x6a59('0xa9')]=function(_0x9a15e8){logger['info'](util[_0x6a59('0x4f')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x9a15e8[_0x6a59('0xaa')]));if(!this['isConfigured'](_0x9a15e8['grammar'])){return this['channel'][_0x6a59('0xa4')](_0x6a59('0xab'));}var _0x4edaeb=_0x9a15e8[_0x6a59('0xac')];if(this['isConfigured'](_0x9a15e8[_0x6a59('0x70')])){_0x4edaeb+=','+_0x9a15e8[_0x6a59('0x70')];}var _0x3d9f9a=this[_0x6a59('0x38')][_0x6a59('0xa6')]('MRCPRecog',_0x4edaeb);if(_0x3d9f9a[_0x6a59('0xa7')]===-0x1){return _0x3d9f9a;}var _0x100eb2=this[_0x6a59('0x9c')](_0x6a59('0xad'),_0x6a59('0xae'));if(_0x100eb2[_0x6a59('0xa7')]===-0x1){return _0x100eb2;}var _0xdbd5bb=this['getAndSetVariable'](_0x6a59('0xaf'),_0x6a59('0xb0'));if(_0xdbd5bb['result']===-0x1){return _0xdbd5bb;}var _0x11b5ab=this['getAndSetVariable']('RECOG_INSTANCE()',_0x6a59('0xb1'));if(_0x11b5ab[_0x6a59('0xa7')]===-0x1){return _0x11b5ab;}return this['channel'][_0x6a59('0xa4')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x4edaeb));};AGIVertices[_0x6a59('0x11')][_0x6a59('0x8')]=function(_0x25202c){logger['info'](util[_0x6a59('0x4f')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x25202c[_0x6a59('0xaa')]));return this['channel'][_0x6a59('0x8')]([_0x25202c[_0x6a59('0xb2')],_0x25202c[_0x6a59('0xb3')]]);};AGIVertices['prototype'][_0x6a59('0xb4')]=function(_0x475030){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x475030[_0x6a59('0xaa')]));if(this[_0x6a59('0x7e')](_0x475030[_0x6a59('0x5f')])){logger['info'](util[_0x6a59('0x4f')](_0x6a59('0xb5'),_0x475030[_0x6a59('0x5f')]));var _0x1f6636=this[_0x6a59('0x38')][_0x6a59('0xb6')](_0x475030[_0x6a59('0x5f')]);if(_0x1f6636[_0x6a59('0xa7')]===-0x1){return _0x1f6636;}}return this['channel'][_0x6a59('0xb4')]();};AGIVertices[_0x6a59('0x11')][_0x6a59('0xb7')]=function(_0x40cb83){logger['info'](util[_0x6a59('0x4f')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x40cb83[_0x6a59('0xaa')]));if(!this[_0x6a59('0x7e')](_0x40cb83[_0x6a59('0xb8')])){return this['channel'][_0x6a59('0x2c')](_0x40cb83,_0x6a59('0xb9'));}_0x40cb83[_0x6a59('0x45')]=moment();if(this[_0x6a59('0x7e')](_0x40cb83[_0x6a59('0xba')])){_0x40cb83[_0x6a59('0x45')]=moment()[_0x6a59('0xbb')](_0x40cb83[_0x6a59('0xba')],'minutes');}if(!this[_0x6a59('0x7e')](_0x40cb83[_0x6a59('0x48')])){_0x40cb83[_0x6a59('0x48')]=0x2;}this[_0x6a59('0x40')][_0x6a59('0xa0')](this,_0x40cb83);return this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x40cb83[_0x6a59('0xbc')],_0x40cb83['list_id'],_0x40cb83['scheduledAt']));};AGIVertices[_0x6a59('0x11')]['custom_app']=function(_0x5453b7){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0xbd'),_0x5453b7[_0x6a59('0xaa')]));var _0x229ae0=this[_0x6a59('0x38')][_0x6a59('0xa6')](_0x5453b7[_0x6a59('0xbe')],_0x5453b7[_0x6a59('0x70')]);if(_0x229ae0['result']===-0x1){return _0x229ae0;}return this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')](_0x6a59('0xbf'),_0x5453b7['application'],_0x5453b7[_0x6a59('0x70')]));};AGIVertices[_0x6a59('0x11')][_0x6a59('0xc0')]=function(_0x56b53b){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0xc1'),_0x56b53b[_0x6a59('0xaa')]));if(!this[_0x6a59('0x7e')](_0x56b53b[_0x6a59('0x56')])){return this[_0x6a59('0x38')]['noop'](_0x6a59('0xa5'));}var _0x42d12f='\x22'+_0x56b53b['text']+'\x22';if(this['isConfigured'](_0x56b53b[_0x6a59('0x70')])){_0x42d12f+=','+_0x56b53b[_0x6a59('0x70')];}var _0x103a1b=this['channel'][_0x6a59('0xa6')]('MRCPSynth',_0x42d12f);if(_0x103a1b['result']===-0x1){return _0x103a1b;}return this[_0x6a59('0x38')][_0x6a59('0xa4')](util['format'](_0x6a59('0xa8'),_0x42d12f));};AGIVertices['prototype'][_0x6a59('0xc2')]=function(_0x4942e6){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0xc3'),_0x4942e6['label']));if(!this[_0x6a59('0x7e')](_0x4942e6[_0x6a59('0x56')])){return this[_0x6a59('0x38')]['noop'](_0x6a59('0xa5'));}var _0x43e60f='\x22'+_0x4942e6[_0x6a59('0x56')]+'\x22';if(this[_0x6a59('0x7e')](_0x4942e6['options'])){_0x43e60f+=','+_0x4942e6['options'];}var _0xc4dbe2=this[_0x6a59('0x38')][_0x6a59('0xa6')](_0x6a59('0xc4'),_0x43e60f);if(_0xc4dbe2[_0x6a59('0xa7')]===-0x1){return _0xc4dbe2;}return this['channel']['noop'](util[_0x6a59('0x4f')]('Executed\x20command\x20MRCPSynth\x20%s',_0x43e60f));};AGIVertices[_0x6a59('0x11')][_0x6a59('0xc5')]=function(_0x9aee82){logger['info'](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x9aee82[_0x6a59('0xaa')]));if(!this[_0x6a59('0x7e')](_0x9aee82[_0x6a59('0xac')])){return this[_0x6a59('0x38')][_0x6a59('0xa4')](_0x6a59('0xab'));}var _0xf03b34=_0x9aee82[_0x6a59('0xac')];if(this['isConfigured'](_0x9aee82[_0x6a59('0x70')])){_0xf03b34+=','+_0x9aee82[_0x6a59('0x70')];}var _0x2cf608=this[_0x6a59('0x38')][_0x6a59('0xa6')](_0x6a59('0xc6'),_0xf03b34);if(_0x2cf608['result']===-0x1){return _0x2cf608;}var _0x5970a3=this[_0x6a59('0x9c')](_0x6a59('0xad'),_0x6a59('0xc7'));if(_0x5970a3[_0x6a59('0xa7')]===-0x1){return _0x5970a3;}var _0x220815=this[_0x6a59('0x9c')]('RECOG_INPUT()',_0x6a59('0xc8'));if(_0x220815[_0x6a59('0xa7')]===-0x1){return _0x220815;}var _0x59fceb=this[_0x6a59('0x9c')](_0x6a59('0xc9'),_0x6a59('0xca'));if(_0x59fceb[_0x6a59('0xa7')]===-0x1){return _0x59fceb;}return this[_0x6a59('0x38')]['noop'](util[_0x6a59('0x4f')](_0x6a59('0xcb'),_0xf03b34));};AGIVertices['prototype'][_0x6a59('0xcc')]=function(_0x49efce){logger['info'](util[_0x6a59('0x4f')](_0x6a59('0xcd'),_0x49efce[_0x6a59('0xaa')]));if(!this[_0x6a59('0x7e')](_0x49efce[_0x6a59('0xac')])){return this['channel'][_0x6a59('0xa4')]('no\x20grammar\x20configured');}var _0x1b3144=_0x49efce[_0x6a59('0xac')];if(this['isConfigured'](_0x49efce[_0x6a59('0x70')])){_0x1b3144+=','+_0x49efce[_0x6a59('0x70')];}var _0x391d15=this[_0x6a59('0x38')]['exec'](_0x6a59('0xc6'),_0x1b3144);if(_0x391d15[_0x6a59('0xa7')]===-0x1){return _0x391d15;}var _0x241737=this[_0x6a59('0x9c')](_0x6a59('0xad'),_0x6a59('0xce'));if(_0x241737[_0x6a59('0xa7')]===-0x1){return _0x241737;}var _0x1a60eb=this[_0x6a59('0x9c')]('RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT');if(_0x1a60eb['result']===-0x1){return _0x1a60eb;}var _0x552b05=this[_0x6a59('0x9c')](_0x6a59('0xc9'),'SESTEK_ASR_INSTANCE');if(_0x552b05['result']===-0x1){return _0x552b05;}return this[_0x6a59('0x38')]['noop'](util[_0x6a59('0x4f')](_0x6a59('0xcb'),_0x1b3144));};AGIVertices[_0x6a59('0x11')][_0x6a59('0xcf')]=function(_0x57a3bb){logger[_0x6a59('0x2e')](util['format'](_0x6a59('0xd0'),_0x57a3bb['label']));if(!this[_0x6a59('0x7e')](_0x57a3bb[_0x6a59('0xd1')])){return this[_0x6a59('0x38')][_0x6a59('0x2c')](_0x57a3bb,_0x6a59('0xd2'));}var _0x327c32=this[_0x6a59('0x1b')][_0x6a59('0xa0')](this,_0x57a3bb[_0x6a59('0xd1')]);if(!_0x327c32){return this[_0x6a59('0x38')][_0x6a59('0x2c')](_0x57a3bb,_0x6a59('0xd3'));}if(!this['isConfigured'](_0x57a3bb[_0x6a59('0x30')])){return this[_0x6a59('0x38')]['error'](_0x57a3bb,_0x6a59('0xd4'));}var _0x1eb91f=_0x57a3bb[_0x6a59('0x30')][_0x6a59('0x53')](/(\r\n|\n|\r)/gm,'\x20');this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')](_0x6a59('0xd5'),_0x1eb91f));var _0x4a7605=this['getQueryOdbc'][_0x6a59('0xa0')](this,_0x327c32,_0x1eb91f);this[_0x6a59('0x35')][_0x6a59('0xa0')](this,_0x57a3bb,_0x1eb91f);if(!this[_0x6a59('0x7e')](_0x57a3bb[_0x6a59('0xd6')])){return this[_0x6a59('0x38')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x12d7c6=this['getVariable'][_0x6a59('0xa0')](this,_0x57a3bb[_0x6a59('0xd6')]);if(!_0x12d7c6){return this[_0x6a59('0x38')]['error'](_0x57a3bb,_0x6a59('0xd7'));}var _0xc6d448=this;_0x4a7605[_0x6a59('0xd8')](function(_0x4a5b35,_0x3bca05){Object[_0x6a59('0xd9')](_0x4a5b35)[_0x6a59('0xd8')](function(_0x2bf78d){_0xc6d448[_0x6a59('0x38')][_0x6a59('0x9e')](util[_0x6a59('0x4f')](_0x6a59('0xda'),_0x12d7c6,_0x3bca05,_0x2bf78d),_0x4a5b35[_0x2bf78d]);});});this['channel'][_0x6a59('0x9e')](util[_0x6a59('0x4f')](_0x6a59('0xdb'),_0x12d7c6),_0x4a7605[_0x6a59('0x97')]);return this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')]('variable\x20%s\x20set',_0x12d7c6));};AGIVertices[_0x6a59('0x11')]['dial']=function(_0x159683){logger['debug'](util[_0x6a59('0x4f')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x159683[_0x6a59('0xaa')]));if(!this['isConfigured'](_0x159683['sip_id'])){return this[_0x6a59('0x38')]['error'](_0x159683,_0x6a59('0xdc'));}var _0x49c048=this['getUser'][_0x6a59('0xa0')](this,_0x159683['sip_id']);if(!_0x49c048){return this[_0x6a59('0x38')][_0x6a59('0x2c')](_0x159683,_0x6a59('0xdd'));}var _0x14c119=this[_0x6a59('0x38')][_0x6a59('0xa6')](_0x6a59('0xde'),[util[_0x6a59('0x4f')](_0x6a59('0xdf'),_0x49c048),_0x159683['timeout'],_0x159683[_0x6a59('0xe0')],_0x159683['url']]);if(_0x14c119[_0x6a59('0xa7')]===-0x1){return _0x14c119;}return this['channel']['noop'](util[_0x6a59('0x4f')](_0x6a59('0xe1'),_0x6a59('0xde')));};AGIVertices['prototype'][_0x6a59('0xe2')]=function(_0xbc450){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0xbc450[_0x6a59('0xaa')]));if(!this[_0x6a59('0x7e')](_0xbc450[_0x6a59('0x72')])){return this[_0x6a59('0x38')][_0x6a59('0xa4')](_0x6a59('0xe3'));}if(!this[_0x6a59('0x7e')](_0xbc450[_0x6a59('0x56')])){return this['channel'][_0x6a59('0xa4')](_0x6a59('0xa5'));}this[_0x6a59('0x38')][_0x6a59('0xe4')]=!![];this['createSquareDetailsReport'](_0xbc450);this['createSquareMessage'](_0xbc450[_0x6a59('0x56')],'in','','');this[_0x6a59('0x38')][_0x6a59('0xa4')](util['format']('Trying\x20Dialogflow:\x20%s',_0xbc450[_0x6a59('0x56')]));var _0x4c0d1f=this['googleDialogflow'][_0x6a59('0xa0')](this,_0xbc450);if(_0x4c0d1f){for(var _0x456881 in _0x4c0d1f){if(_0x4c0d1f[_0x6a59('0x90')](_0x456881)){this[_0x6a59('0x38')]['setVariable'](util[_0x6a59('0x4f')](_0x6a59('0xe5'),_0x456881['toUpperCase']()),_0x4c0d1f[_0x456881]);}}this[_0x6a59('0x3f')](_0x4c0d1f[_0x6a59('0xe6')],_0x6a59('0xe7'),_0x6a59('0xe2'),'');return this[_0x6a59('0x38')][_0x6a59('0xa4')](util['format']('Dialogflow\x20Result\x20%s',_0x4c0d1f[_0x6a59('0xe6')]));}return this[_0x6a59('0x38')][_0x6a59('0x2c')](_0xbc450,_0x6a59('0xe8'));};AGIVertices['prototype']['dialogflowV2']=function(_0x4c18d8){logger['info'](util[_0x6a59('0x4f')](_0x6a59('0xe9'),_0x4c18d8['label']));if(!this[_0x6a59('0x7e')](_0x4c18d8[_0x6a59('0x74')])){return this[_0x6a59('0x38')][_0x6a59('0xa4')]('no\x20project_id\x20configured');}if(!this[_0x6a59('0x7e')](_0x4c18d8[_0x6a59('0x75')])){return this[_0x6a59('0x38')][_0x6a59('0xa4')](_0x6a59('0xea'));}if(!this[_0x6a59('0x7e')](_0x4c18d8['private_key'])){return this[_0x6a59('0x38')][_0x6a59('0xa4')]('no\x20private_key\x20configured');}if(!this[_0x6a59('0x7e')](_0x4c18d8['dialogflowV2_language'])){return this['channel']['noop'](_0x6a59('0xeb'));}if(!this[_0x6a59('0x7e')](_0x4c18d8[_0x6a59('0x56')])){return this[_0x6a59('0x38')][_0x6a59('0xa4')](_0x6a59('0xa5'));}this['channel'][_0x6a59('0xe4')]=!![];this[_0x6a59('0x35')](_0x4c18d8);this[_0x6a59('0x3f')](_0x4c18d8['text'],'in','','');this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')](_0x6a59('0xec'),_0x4c18d8['text']));var _0x41e84a=this[_0x6a59('0x73')][_0x6a59('0xa0')](this,_0x4c18d8);if(_0x41e84a){for(var _0x563aee in _0x41e84a){if(_0x41e84a[_0x6a59('0x90')](_0x563aee)){if(_0x563aee!==_0x6a59('0xed')){this[_0x6a59('0x38')][_0x6a59('0x9e')](util['format'](_0x6a59('0xe5'),_0x563aee[_0x6a59('0x63')]()),_0x41e84a[_0x563aee]);}}}this[_0x6a59('0x3f')](_0x41e84a[_0x6a59('0xe6')],_0x6a59('0xe7'),_0x6a59('0xee'),_0x41e84a['providerResponse']);return this['channel']['noop'](util[_0x6a59('0x4f')](_0x6a59('0xef'),_0x41e84a[_0x6a59('0xe6')]));}return this[_0x6a59('0x38')][_0x6a59('0x2c')](_0x4c18d8,_0x6a59('0xf0'));};AGIVertices[_0x6a59('0x11')][_0x6a59('0xf1')]=function(_0x1823ad){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0xf2'),_0x1823ad['label']));if(!this['isConfigured'](_0x1823ad['ndauth_url'])){return this[_0x6a59('0x38')][_0x6a59('0xa4')](_0x6a59('0xf3'));}if(!this['isConfigured'](_0x1823ad[_0x6a59('0xf4')])){return this[_0x6a59('0x38')]['noop']('no\x20username\x20configured');}if(!this[_0x6a59('0x7e')](_0x1823ad[_0x6a59('0xf5')])){return this[_0x6a59('0x38')][_0x6a59('0xa4')](_0x6a59('0xf6'));}if(!this[_0x6a59('0x7e')](_0x1823ad[_0x6a59('0xf7')])){return this[_0x6a59('0x38')][_0x6a59('0xa4')](_0x6a59('0xa5'));}this[_0x6a59('0x38')]['bot']=!![];this[_0x6a59('0x35')](_0x1823ad);this[_0x6a59('0x3f')](_0x1823ad[_0x6a59('0x56')],'in','','');this[_0x6a59('0x38')][_0x6a59('0xa4')](util['format'](_0x6a59('0xf8'),_0x1823ad['text']));var _0x2f4fbd=this[_0x6a59('0x78')][_0x6a59('0xa0')](this,_0x1823ad);if(_0x2f4fbd){for(var _0x381407 in _0x2f4fbd){if(_0x2f4fbd[_0x6a59('0x90')](_0x381407)){this[_0x6a59('0x38')][_0x6a59('0x9e')](util[_0x6a59('0x4f')]('SESTEK_NDA_%s',_0x381407[_0x6a59('0x63')]()),_0x2f4fbd[_0x381407]);}}this[_0x6a59('0x3f')](_0x2f4fbd[_0x6a59('0xe6')],_0x6a59('0xe7'),_0x6a59('0xf1'),'');if(_0x2f4fbd[_0x6a59('0xf9')]){this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')](_0x6a59('0xfa'),_0x2f4fbd[_0x6a59('0xf9')]));var _0x31a097=this[_0x6a59('0x38')][_0x6a59('0xfb')](_0x2f4fbd[_0x6a59('0xf9')]);try{fs[_0x6a59('0xfc')](_0x2f4fbd['audiofile']+'.wav');}catch(_0x4871e9){logger[_0x6a59('0x2c')](_0x4871e9);}return _0x31a097;}else{return this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')](_0x6a59('0xfd'),_0x2f4fbd[_0x6a59('0xe6')]));}}return this[_0x6a59('0x38')]['error'](_0x1823ad,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x6a59('0x11')][_0x6a59('0xfe')]=function(_0x55999d){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0xff'),_0x55999d[_0x6a59('0xaa')]));return this[_0x6a59('0x38')][_0x6a59('0xa4')](_0x6a59('0xfe'));};AGIVertices[_0x6a59('0x11')][_0x6a59('0x100')]=function(_0x315de9){logger[_0x6a59('0x2e')](util['format'](_0x6a59('0x101'),_0x315de9[_0x6a59('0xaa')]));var _0x946546='';if(_0x315de9[_0x6a59('0x102')]){if(!this[_0x6a59('0x7e')](_0x315de9[_0x6a59('0x102')])){return this[_0x6a59('0x38')][_0x6a59('0x2c')](_0x315de9,_0x6a59('0x103'));}else{var _0x1c841f=parseInt(_0x315de9[_0x6a59('0x102')],0xa);if(isNaN(_0x1c841f)){_0x946546=_0x315de9['trunk_id'];}else{_0x946546=this[_0x6a59('0x104')]['sync'](this,_0x315de9['trunk_id']);if(!_0x946546){return this[_0x6a59('0x38')]['error'](_0x315de9,_0x6a59('0x105'));}}}}else if(_0x315de9[_0x6a59('0x106')]){_0x946546=_0x315de9[_0x6a59('0x106')];}else{return this[_0x6a59('0x38')][_0x6a59('0x2c')](_0x315de9,_0x6a59('0x103'));}var _0x4d381a=this[_0x6a59('0x38')][_0x6a59('0xa6')]('DIAL',[util[_0x6a59('0x4f')](_0x6a59('0x107'),_0x946546,_0x315de9[_0x6a59('0xbc')]),_0x315de9['timeout'],_0x315de9[_0x6a59('0xe0')],_0x315de9[_0x6a59('0x108')]]);if(_0x4d381a['result']===-0x1){return _0x4d381a;}return this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')](_0x6a59('0xe1'),'DIAL'));};AGIVertices[_0x6a59('0x11')][_0x6a59('0x109')]=function(_0xff703a){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0xff703a['label']));return this[_0x6a59('0x38')][_0x6a59('0xa4')](_0x6a59('0x109'));};AGIVertices[_0x6a59('0x11')]['getdigits']=function(_0x129b8a){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x129b8a[_0x6a59('0xaa')]));if(_0x129b8a[_0x6a59('0xa1')]===0x0){return this['maxRetry'](_0x129b8a);}_0x129b8a[_0x6a59('0xa1')]-=0x1;if(!this[_0x6a59('0x7e')](_0x129b8a[_0x6a59('0x10a')])){return this['channel']['error'](_0x129b8a,_0x6a59('0x10b'));}var _0x48db52=this[_0x6a59('0x20')][_0x6a59('0xa0')](this,_0x129b8a[_0x6a59('0x10a')]);if(!_0x48db52){return this['channel'][_0x6a59('0x2c')](_0x129b8a,_0x6a59('0x10c'));}if(!this['isConfigured'](_0x129b8a['variable_id'])){return this[_0x6a59('0x38')][_0x6a59('0x2c')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x5cd903=this['channel']['getData'](_0x48db52,_0x129b8a[_0x6a59('0x10d')],_0x129b8a[_0x6a59('0x10e')]);var _0x85c9=_0x5cd903['result']?_0x5cd903['result']['toString']():'';logger['info'](_0x6a59('0x10f'),JSON['stringify'](_0x5cd903));if(_0x5cd903['result']===-0x1){this[_0x6a59('0x35')][_0x6a59('0xa0')](this,_0x129b8a,_0x85c9);return _0x5cd903;}else if(_0x5cd903[_0x6a59('0x9b')]===_0x6a59('0x5f')){_0x5cd903[_0x6a59('0xa7')]=_0x85c9[_0x6a59('0x97')]>=parseInt(_0x129b8a[_0x6a59('0x110')])?'x':'i';}else{_0x5cd903[_0x6a59('0xa7')]=_0x85c9[_0x6a59('0x97')]>=parseInt(_0x129b8a[_0x6a59('0x110')])&&_0x85c9[_0x6a59('0x97')]<=parseInt(_0x129b8a['maxdigit'])?'x':'i';}var _0x1d803a=this[_0x6a59('0x12')][_0x6a59('0xa0')](this,_0x129b8a['variable_id']);if(!_0x1d803a){return this[_0x6a59('0x38')][_0x6a59('0x2c')](_0x129b8a,_0x6a59('0xd7'));}this[_0x6a59('0x38')][_0x6a59('0x9e')](_0x1d803a,_0x85c9);if(this[_0x6a59('0x7e')](_0x129b8a[_0x6a59('0x111')])){var _0x4af4b5=parseInt(_0x129b8a[_0x6a59('0x111')],0xa);var _0x53bf35=rs['generate']({'charset':'*','length':_0x4af4b5});var _0x262302=_0x85c9[_0x6a59('0x97')];if(_0x262302>0x0){if(_0x262302>_0x4af4b5){this[_0x6a59('0x35')]['sync'](this,_0x129b8a,_0x129b8a[_0x6a59('0x112')]===_0x6a59('0x113')?_0x53bf35+_0x85c9[_0x6a59('0x114')](_0x4af4b5):_0x85c9[_0x6a59('0x114')](0x0,_0x262302-_0x4af4b5)+_0x53bf35);}else{this[_0x6a59('0x35')][_0x6a59('0xa0')](this,_0x129b8a,rs[_0x6a59('0x115')]({'charset':'*','length':_0x262302}));}}else{this['createSquareDetailsReport'][_0x6a59('0xa0')](this,_0x129b8a,'');}}else{this[_0x6a59('0x35')][_0x6a59('0xa0')](this,_0x129b8a,_0x85c9);}return _0x5cd903;};AGIVertices[_0x6a59('0x11')][_0x6a59('0x116')]=function(_0x286a39){logger[_0x6a59('0x2e')](util['format']('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x286a39[_0x6a59('0xaa')]));return this[_0x6a59('0xf')](_0x286a39);};AGIVertices['prototype'][_0x6a59('0x117')]=function(_0x828076){logger[_0x6a59('0x2e')](util['format'](_0x6a59('0x118'),_0x828076['label']));this[_0x6a59('0x35')][_0x6a59('0xa0')](this,_0x828076,_0x828076['goalname']);return this[_0x6a59('0x38')]['noop'](util[_0x6a59('0x4f')](_0x6a59('0x119'),_0x828076['goalname']));};AGIVertices[_0x6a59('0x11')][_0x6a59('0x11a')]=function(_0x307b1f){logger[_0x6a59('0x2e')](util['format'](_0x6a59('0x11b'),_0x307b1f[_0x6a59('0xaa')]));if(!this[_0x6a59('0x7e')](_0x307b1f['aws_access_key_id'])||!this[_0x6a59('0x7e')](_0x307b1f[_0x6a59('0x87')])){return this['channel'][_0x6a59('0xa4')](_0x6a59('0x11c'));}if(!this['isConfigured'](_0x307b1f[_0x6a59('0x56')])){return this['channel']['noop'](_0x6a59('0xa5'));}this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')](_0x6a59('0x11d'),_0x307b1f[_0x6a59('0x56')]));var _0x572793=this[_0x6a59('0x80')][_0x6a59('0xa0')](this,_0x307b1f);if(_0x572793){this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')]('aws\x20Polly\x20%s\x20file\x20created',_0x572793));var _0x4c35a7=this['channel'][_0x6a59('0xfb')](_0x572793);try{fs[_0x6a59('0xfc')](_0x572793+'.wav');}catch(_0x190a5f){logger[_0x6a59('0x2c')](_0x190a5f);}return _0x4c35a7;}return this[_0x6a59('0x38')][_0x6a59('0x2c')](_0x307b1f,_0x6a59('0x11e'));};AGIVertices[_0x6a59('0x11')]['awslex']=function(_0x5b0171){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0x11f'),_0x5b0171[_0x6a59('0xaa')]));if(!this[_0x6a59('0x7e')](_0x5b0171[_0x6a59('0x86')])||!this[_0x6a59('0x7e')](_0x5b0171[_0x6a59('0x87')])){return this[_0x6a59('0x38')][_0x6a59('0xa4')](_0x6a59('0x11c'));}if(!this[_0x6a59('0x7e')](_0x5b0171['aws_bot_name'])){return this['channel']['noop'](_0x6a59('0x120'));}if(!this[_0x6a59('0x7e')](_0x5b0171[_0x6a59('0x56')])){return this[_0x6a59('0x38')]['noop']('no\x20text\x20configured');}this[_0x6a59('0x38')][_0x6a59('0xe4')]=!![];this[_0x6a59('0x35')](_0x5b0171);this[_0x6a59('0x3f')](_0x5b0171['text'],'in','','');this[_0x6a59('0x38')]['noop'](util[_0x6a59('0x4f')](_0x6a59('0x121'),_0x5b0171['text']));var _0xa088c1=this['awsLex']['sync'](this,_0x5b0171);if(_0xa088c1){for(var _0xb47d2a in _0xa088c1){if(_0xa088c1[_0x6a59('0x90')](_0xb47d2a)&&_[_0x6a59('0x91')](_0xa088c1[_0xb47d2a])){this['channel'][_0x6a59('0x9e')](util[_0x6a59('0x4f')](_0x6a59('0x122'),_0xb47d2a[_0x6a59('0x63')]()),_0xa088c1[_0xb47d2a]);}}if(_[_0x6a59('0x41')](_0xa088c1[_0x6a59('0x6e')])){return this['channel'][_0x6a59('0xa4')](_0x6a59('0x123'));}else{this['createSquareMessage'](_0xa088c1['message'],_0x6a59('0xe7'),_0x6a59('0x124'),'');return this[_0x6a59('0x38')]['noop'](util[_0x6a59('0x4f')](_0x6a59('0x125'),_0xa088c1[_0x6a59('0x6e')]));}}return this['channel']['error'](_0x5b0171,_0x6a59('0x126'));};AGIVertices[_0x6a59('0x11')]['googleasr']=function(_0x8637d3){logger['info'](util['format'](_0x6a59('0x127'),_0x8637d3[_0x6a59('0xaa')],_0x8637d3[_0x6a59('0x5f')]));if(!this['isConfigured'](_0x8637d3[_0x6a59('0x72')])){return this['channel'][_0x6a59('0xa4')]('no\x20key\x20configured');}var _0x5440ff=_0x6a59('0x128');var _0x262760=util[_0x6a59('0x4f')](_0x6a59('0x129'),FILES_PATH,rs[_0x6a59('0x115')](0x4));var _0x3fa16b=util[_0x6a59('0x4f')]('%s.%s',_0x262760,_0x5440ff);var _0x4c776a=!![];if(_0x8637d3[_0x6a59('0x12a')]===_0x6a59('0x12b')){_0x4c776a=![];}var _0x5f09f1=this[_0x6a59('0x38')][_0x6a59('0x12c')](_0x262760,_0x5440ff,_0x8637d3[_0x6a59('0x12d')],_0x8637d3[_0x6a59('0x5f')],undefined,_0x4c776a);if(_0x5f09f1[_0x6a59('0xa7')]!==-0x1){this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')](_0x6a59('0x12e'),_0x3fa16b));var _0x4ea569=this[_0x6a59('0x8a')][_0x6a59('0xa0')](this,_0x8637d3,_0x3fa16b);if(_0x4ea569){for(var _0x1947ee in _0x4ea569){if(_0x4ea569[_0x6a59('0x90')](_0x1947ee)){this['channel'][_0x6a59('0x9e')](util[_0x6a59('0x4f')](_0x6a59('0x12f'),_0x1947ee['toUpperCase']()),_0x4ea569[_0x1947ee]);}}return this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')](_0x6a59('0x130'),JSON[_0x6a59('0x6b')](_0x4ea569)));}}return _0x5f09f1;};AGIVertices[_0x6a59('0x11')]['tildeasr']=function(_0xcbd811){logger['info'](util['format'](_0x6a59('0x131'),_0xcbd811[_0x6a59('0xaa')]));if(!this[_0x6a59('0x7e')](_0xcbd811['appid'])){return this[_0x6a59('0x38')][_0x6a59('0xa4')](_0x6a59('0x132'));}if(!this[_0x6a59('0x7e')](_0xcbd811[_0x6a59('0x8d')])){return this[_0x6a59('0x38')][_0x6a59('0xa4')]('no\x20appsecret\x20configured');}var _0x35a243=_0x6a59('0x128');var _0x4e7077=util[_0x6a59('0x4f')](_0x6a59('0x129'),FILES_PATH,rs[_0x6a59('0x115')](0x4));var _0x169771=util[_0x6a59('0x4f')](_0x6a59('0x99'),_0x4e7077,_0x35a243);var _0x43f4a4=!![];if(_0xcbd811[_0x6a59('0x12a')]===_0x6a59('0x12b')){_0x43f4a4=![];}var _0x47d8ae=this[_0x6a59('0x38')][_0x6a59('0x12c')](_0x4e7077,_0x35a243,_0xcbd811[_0x6a59('0x12d')],_0xcbd811['timeout'],undefined,_0x43f4a4);if(_0x47d8ae[_0x6a59('0xa7')]!==-0x1){this['channel']['noop'](util[_0x6a59('0x4f')](_0x6a59('0x133'),_0x169771));var _0x59c71f=this[_0x6a59('0x8c')]['sync'](this,_0xcbd811,_0x169771);if(_0x59c71f){for(var _0x532624 in _0x59c71f){if(_0x59c71f['hasOwnProperty'](_0x532624)){this[_0x6a59('0x38')]['setVariable'](util['format']('TILDE_ASR_%s',_0x532624[_0x6a59('0x63')]()),_0x59c71f[_0x532624]);}}return this[_0x6a59('0x38')]['noop'](util['format']('TildeASR\x20Result\x20%s',JSON[_0x6a59('0x6b')](_0x59c71f)));}}return _0x47d8ae;};AGIVertices[_0x6a59('0x11')][_0x6a59('0x134')]=function(_0x22f0c0){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0x135'),_0x22f0c0[_0x6a59('0xaa')]));return this['channel'][_0x6a59('0x136')](_0x22f0c0[_0x6a59('0x137')],_0x22f0c0['extension'],_0x22f0c0[_0x6a59('0x138')]);};AGIVertices[_0x6a59('0x11')][_0x6a59('0x139')]=function(_0x502c00){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0x13a'),_0x502c00[_0x6a59('0xaa')]));if(!this['isConfigured'](_0x502c00[_0x6a59('0x13b')])){return this[_0x6a59('0x38')]['error'](_0x502c00,'no\x20condition\x20configured');}try{var _0x28ee1d=eval(_0x502c00[_0x6a59('0x13b')])?_0x6a59('0x13c'):_0x6a59('0x13d');this[_0x6a59('0x38')]['noop'](util[_0x6a59('0x4f')]('EVAL\x20CONDITION\x20%s\x20%s',_0x502c00[_0x6a59('0x13b')],_0x28ee1d));return{'code':0xc8,'result':_0x28ee1d};}catch(_0x2432df){return{'code':0xc8,'result':_0x6a59('0x13d')};}};AGIVertices[_0x6a59('0x11')][_0x6a59('0x13e')]=function(_0x3d5a31){logger[_0x6a59('0x2e')](util['format'](_0x6a59('0x13f'),_0x3d5a31[_0x6a59('0xaa')]));if(!this[_0x6a59('0x7e')](_0x3d5a31[_0x6a59('0x140')])){return this['channel'][_0x6a59('0x2c')](_0x3d5a31,_0x6a59('0x141'));}var _0x3634f5=this[_0x6a59('0x142')][_0x6a59('0xa0')](this,_0x3d5a31[_0x6a59('0x140')]);if(!_0x3634f5){return this[_0x6a59('0x38')][_0x6a59('0x2c')](_0x3d5a31,_0x6a59('0x143'));}for(var _0x2fa1b1=0x0;_0x2fa1b1<_0x3634f5[_0x6a59('0x97')];_0x2fa1b1+=0x1){var _0x5d9450=this[_0x6a59('0x38')][_0x6a59('0x12')](util[_0x6a59('0x4f')](_0x6a59('0x144'),_0x3634f5[_0x2fa1b1]));if(_0x5d9450['result']===-0x1){return _0x5d9450;}logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0x145'),_0x3634f5[_0x2fa1b1],_0x5d9450[_0x6a59('0x9b')]));if(_0x5d9450[_0x6a59('0x9b')]===_0x6a59('0x13c')){logger['info'](util[_0x6a59('0x4f')](_0x6a59('0x145'),_0x3634f5[_0x2fa1b1],_0x6a59('0x13c')));this[_0x6a59('0x38')]['noop'](util[_0x6a59('0x4f')](_0x6a59('0x145'),_0x3634f5[_0x2fa1b1],'true'));return{'code':0xc8,'result':_0x6a59('0x13c')};}else{logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0x145'),_0x3634f5[_0x2fa1b1],'false'));this[_0x6a59('0x38')][_0x6a59('0xa4')](util['format']('IFTIME\x20%s\x20%s',_0x3634f5[_0x2fa1b1],_0x6a59('0x13d')));}}return{'code':0xc8,'result':_0x6a59('0x13d')};};AGIVertices[_0x6a59('0x11')][_0x6a59('0x146')]=function(_0x3319cb){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0x147'),_0x3319cb[_0x6a59('0xaa')]));return this['channel']['hangup']();};AGIVertices[_0x6a59('0x11')]['ispeechasr']=function(_0x43ac82){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0x148'),_0x43ac82['label']));if(!this[_0x6a59('0x7e')](_0x43ac82['key'])){return this[_0x6a59('0x38')][_0x6a59('0xa4')](_0x6a59('0xe3'));}var _0x1f9fc8=_0x6a59('0x128');var _0x55d5ff=util['format'](_0x6a59('0x129'),FILES_PATH,rs['generate'](0x4));var _0x2765ea=util[_0x6a59('0x4f')]('%s.%s',_0x55d5ff,_0x1f9fc8);var _0x195f77=!![];if(_0x43ac82['beep']===_0x6a59('0x12b')){_0x195f77=![];}var _0x3a4bfe=this['channel'][_0x6a59('0x12c')](_0x55d5ff,_0x1f9fc8,_0x43ac82[_0x6a59('0x12d')],_0x43ac82[_0x6a59('0x5f')],undefined,_0x195f77);if(_0x3a4bfe[_0x6a59('0xa7')]!==-0x1){this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')](_0x6a59('0x149'),_0x2765ea));var _0x39ba22=this[_0x6a59('0x7c')][_0x6a59('0xa0')](this,_0x43ac82,_0x2765ea);if(_0x39ba22){for(var _0x5c0811 in _0x39ba22){if(_0x39ba22[_0x6a59('0x90')](_0x5c0811)){this[_0x6a59('0x38')][_0x6a59('0x9e')](util[_0x6a59('0x4f')](_0x6a59('0x14a'),_0x5c0811[_0x6a59('0x63')]()),_0x39ba22[_0x5c0811]);}}return this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')](_0x6a59('0x14b'),JSON[_0x6a59('0x6b')](_0x39ba22)));}}return _0x3a4bfe;};AGIVertices[_0x6a59('0x11')][_0x6a59('0x14c')]=function(_0x488396){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0x14d'),_0x488396['label']));if(!this[_0x6a59('0x7e')](_0x488396[_0x6a59('0x72')])){return this['channel'][_0x6a59('0xa4')](_0x6a59('0xe3'));}if(!this[_0x6a59('0x7e')](_0x488396[_0x6a59('0x56')])){return this[_0x6a59('0x38')][_0x6a59('0xa4')]('no\x20text\x20configured');}this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')]('Trying\x20ispeech\x20TTS\x20%s',_0x488396[_0x6a59('0x56')]));var _0x549704=this[_0x6a59('0x79')][_0x6a59('0xa0')](this,_0x488396);if(_0x549704){this[_0x6a59('0x38')][_0x6a59('0xa4')](util['format'](_0x6a59('0x149'),_0x549704));var _0x40be31=this[_0x6a59('0x38')]['streamFile'](_0x549704,_0x488396['intKey']);try{fs[_0x6a59('0xfc')](_0x549704+_0x6a59('0x14e'));}catch(_0xbc6fb8){logger[_0x6a59('0x2c')](_0xbc6fb8);}return _0x40be31;}return this[_0x6a59('0x38')][_0x6a59('0x2c')](_0x488396,_0x6a59('0x14f'));};AGIVertices[_0x6a59('0x11')][_0x6a59('0x150')]=function(_0x26fcbe){logger[_0x6a59('0x2e')](util['format'](_0x6a59('0x151'),_0x26fcbe[_0x6a59('0xaa')]));if(!this[_0x6a59('0x7e')](_0x26fcbe[_0x6a59('0x152')])){return this[_0x6a59('0x38')][_0x6a59('0x2c')](_0x26fcbe,_0x6a59('0x153'));}logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0x154'),this[_0x6a59('0x38')]['callerid'],_0x26fcbe[_0x6a59('0x152')]));var _0x17efde=this['agentLogin'][_0x6a59('0xa0')](this,_0x26fcbe[_0x6a59('0x152')]);if(_0x17efde){logger[_0x6a59('0x2e')](util['format'](_0x6a59('0x155'),this['channel']['callerid'],_0x26fcbe['findBy']));this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')](_0x6a59('0x155'),this[_0x6a59('0x38')]['callerid'],_0x26fcbe[_0x6a59('0x152')]));return{'code':0xc8,'result':_0x6a59('0x156')};}else{logger['info'](util[_0x6a59('0x4f')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x6a59('0x38')][_0x6a59('0x39')],_0x26fcbe[_0x6a59('0x152')]));this[_0x6a59('0x38')]['noop'](util[_0x6a59('0x4f')](_0x6a59('0x157'),this[_0x6a59('0x38')][_0x6a59('0x39')],_0x26fcbe[_0x6a59('0x152')]));return{'code':0xc8,'result':_0x6a59('0x158')};}};AGIVertices[_0x6a59('0x11')][_0x6a59('0x159')]=function(_0x563c85){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0x15a'),_0x563c85[_0x6a59('0xaa')]));if(!this[_0x6a59('0x7e')](_0x563c85[_0x6a59('0x152')])){return this[_0x6a59('0x38')][_0x6a59('0x2c')](_0x563c85,_0x6a59('0x153'));}logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0x154'),this['channel']['callerid'],_0x563c85[_0x6a59('0x152')]));var _0x3a111d=this[_0x6a59('0x4d')][_0x6a59('0xa0')](this,_0x563c85[_0x6a59('0x152')]);if(_0x3a111d){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0x155'),this[_0x6a59('0x38')]['callerid'],_0x563c85[_0x6a59('0x152')]));this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')](_0x6a59('0x155'),this[_0x6a59('0x38')][_0x6a59('0x39')],_0x563c85[_0x6a59('0x152')]));return{'code':0xc8,'result':_0x6a59('0x156')};}else{logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0x157'),this[_0x6a59('0x38')][_0x6a59('0x39')],_0x563c85['findBy']));this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x6a59('0x38')]['callerid'],_0x563c85[_0x6a59('0x152')]));return{'code':0xc8,'result':_0x6a59('0x158')};}};AGIVertices[_0x6a59('0x11')]['math']=function(_0x33846d){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x33846d[_0x6a59('0xaa')]));if(!this[_0x6a59('0x7e')](_0x33846d[_0x6a59('0x15b')])){return this[_0x6a59('0x38')][_0x6a59('0x2c')](_0x33846d,_0x6a59('0x15c'));}this[_0x6a59('0x38')][_0x6a59('0xa4')](util['format'](_0x6a59('0x15d'),_0x33846d[_0x6a59('0x15b')]));var _0x4fa809=eval(_0x33846d[_0x6a59('0x15b')]);if(!this[_0x6a59('0x7e')](_0x33846d[_0x6a59('0xd6')])){return this[_0x6a59('0x38')][_0x6a59('0xa4')](_0x6a59('0x15e'));}var _0x4f6f00=this[_0x6a59('0x12')][_0x6a59('0xa0')](this,_0x33846d[_0x6a59('0xd6')]);if(!_0x4f6f00){return this[_0x6a59('0x38')][_0x6a59('0x2c')](_0x33846d,_0x6a59('0xd7'));}if(_[_0x6a59('0x96')](_0x4fa809)){var _0x249259=this;_0x4fa809[_0x6a59('0xd8')](function(_0x30d718,_0x1274d6){_0x249259[_0x6a59('0x38')]['setVariable'](util['format'](_0x6a59('0x15f'),_0x4f6f00,_0x1274d6),_0x30d718);});return this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')](_0x6a59('0x160'),_0x4f6f00));}else{return this[_0x6a59('0x38')]['setVariable'](_0x4f6f00,_0x4fa809);}};AGIVertices['prototype'][_0x6a59('0xe')]=function(_0x765473){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x765473[_0x6a59('0xaa')]));if(_0x765473[_0x6a59('0xa1')]===0x0){return this['maxRetry'](_0x765473);}_0x765473[_0x6a59('0xa1')]-=0x1;if(!this[_0x6a59('0x7e')](_0x765473['file_id'])){return this[_0x6a59('0x38')][_0x6a59('0x2c')](_0x765473,_0x6a59('0x10b'));}var _0x55188d=this['getSound']['sync'](this,_0x765473[_0x6a59('0x10a')]);if(!_0x55188d){return this['channel'][_0x6a59('0x2c')](_0x765473,_0x6a59('0x10c'));}var _0x299842=this[_0x6a59('0x38')][_0x6a59('0x161')](_0x55188d,_0x765473['response'],_0x765473[_0x6a59('0x162')]);var _0x1a4efb=_0x299842[_0x6a59('0xa7')];if(_0x299842[_0x6a59('0xa7')]===-0x1){this[_0x6a59('0x35')][_0x6a59('0xa0')](this,_0x765473,'-1');return _0x299842;}else if(_0x299842[_0x6a59('0x9b')]===_0x6a59('0x5f')){_0x299842[_0x6a59('0xa7')]=_0x299842['result'][_0x6a59('0x97')]>0x0?_0x299842[_0x6a59('0xa7')]:'t';}else if(_['isEmpty'](_0x299842['result'])){_0x299842[_0x6a59('0xa7')]='#';_0x1a4efb='#';}if(!this[_0x6a59('0x7e')](_0x765473[_0x6a59('0xd6')])){this[_0x6a59('0x38')][_0x6a59('0xa4')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x430b44=this[_0x6a59('0x12')][_0x6a59('0xa0')](this,_0x765473[_0x6a59('0xd6')]);if(!_0x430b44){return this['channel'][_0x6a59('0x2c')](_0x765473,_0x6a59('0xd7'));}this['channel']['setVariable'](_0x430b44,_0x1a4efb);}this['createSquareDetailsReport'][_0x6a59('0xa0')](this,_0x765473,_0x1a4efb);return _0x299842;};AGIVertices['prototype'][_0x6a59('0xa4')]=function(_0x2d3164){logger['info'](util[_0x6a59('0x4f')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x2d3164[_0x6a59('0xaa')]));return this['channel']['noop'](_0x2d3164['output']||_0x2d3164[_0x6a59('0xaa')]);};AGIVertices[_0x6a59('0x11')][_0x6a59('0x163')]=function(_0x8f2141){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0x164'),_0x8f2141[_0x6a59('0xaa')]));if(!this['isConfigured'](_0x8f2141[_0x6a59('0x152')])){return this[_0x6a59('0x38')][_0x6a59('0x2c')](_0x8f2141,'no\x20find\x20by\x20configured');}logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0x154'),this['channel'][_0x6a59('0x39')],_0x8f2141['findBy']));var _0x3cb746=this[_0x6a59('0x165')][_0x6a59('0xa0')](this,_0x8f2141[_0x6a59('0x166')]);var _0x399f54=this[_0x6a59('0x4a')][_0x6a59('0xa0')](this,_0x8f2141[_0x6a59('0x152')],_0x3cb746);if(_0x399f54){logger['info'](util[_0x6a59('0x4f')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x6a59('0x38')][_0x6a59('0x39')],_0x8f2141[_0x6a59('0x152')]));this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')](_0x6a59('0x155'),this[_0x6a59('0x38')][_0x6a59('0x39')],_0x8f2141[_0x6a59('0x152')]));return{'code':0xc8,'result':_0x6a59('0x156')};}else{logger['info'](util[_0x6a59('0x4f')](_0x6a59('0x157'),this[_0x6a59('0x38')]['callerid'],_0x8f2141[_0x6a59('0x152')]));this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')](_0x6a59('0x155'),this[_0x6a59('0x38')][_0x6a59('0x39')],_0x8f2141['findBy']));return{'code':0xc8,'result':_0x6a59('0x158')};}};AGIVertices[_0x6a59('0x11')][_0x6a59('0x167')]=function(_0x3ef2aa){logger['info'](util[_0x6a59('0x4f')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x3ef2aa['label']));if(!this[_0x6a59('0x7e')](_0x3ef2aa[_0x6a59('0x10a')])){return this[_0x6a59('0x38')][_0x6a59('0x2c')](_0x3ef2aa,'no\x20file\x20audio\x20selected');}var _0x216eec=this[_0x6a59('0x20')][_0x6a59('0xa0')](this,_0x3ef2aa[_0x6a59('0x10a')]);if(!_0x216eec){return this['channel']['error'](_0x3ef2aa,_0x6a59('0x10c'));}var _0x345f2d=this[_0x6a59('0x38')]['exec']('PLAYBACK',[_0x216eec,_0x3ef2aa[_0x6a59('0xe0')]]);if(_0x345f2d[_0x6a59('0xa7')]===-0x1){return _0x345f2d;}return this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')](_0x6a59('0xbf'),_0x6a59('0x168'),_0x216eec));};AGIVertices[_0x6a59('0x11')][_0x6a59('0x169')]=function(_0x2d259c){logger['info'](util[_0x6a59('0x4f')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x2d259c[_0x6a59('0xaa')]));if(!this[_0x6a59('0x7e')](_0x2d259c[_0x6a59('0x16a')])){return this[_0x6a59('0x38')]['error'](_0x2d259c,_0x6a59('0x16b'));}var _0x455ed8='';var _0x18d7bd=parseInt(_0x2d259c['queue_id'],0xa);if(isNaN(_0x18d7bd)){_0x455ed8=_0x2d259c['queue_id'];}else{_0x455ed8=this[_0x6a59('0x17')][_0x6a59('0xa0')](this,_0x2d259c['queue_id']);if(!_0x455ed8){return this[_0x6a59('0x38')][_0x6a59('0x2c')](_0x2d259c,'no\x20queue\x20found');}}var _0x29805b='';if(this[_0x6a59('0x7e')](_0x2d259c[_0x6a59('0x10a')])){var _0x40835b=this[_0x6a59('0x20')]['sync'](this,_0x2d259c[_0x6a59('0x10a')]);if(_0x40835b){_0x29805b=_0x40835b;}}this[_0x6a59('0x35')][_0x6a59('0xa0')](this,_0x2d259c,_0x455ed8);if(_0x2d259c[_0x6a59('0xe0')][_0x6a59('0x16c')]('x')<0x0){_0x2d259c['opts']+='x';}if(_0x2d259c[_0x6a59('0xe0')][_0x6a59('0x16c')]('X')<0x0){_0x2d259c['opts']+='X';}this[_0x6a59('0x38')][_0x6a59('0x9e')](_0x6a59('0x16d'),_0x455ed8?_0x455ed8['toLowerCase']():'');var _0x5155cb=this[_0x6a59('0x38')][_0x6a59('0xa6')](_0x6a59('0x16e'),[_0x455ed8,_0x2d259c['opts'],_0x2d259c[_0x6a59('0x108')],_0x29805b,_0x2d259c[_0x6a59('0x5f')],_0x2d259c[_0x6a59('0x8')],_0x2d259c[_0x6a59('0x16f')],_0x2d259c[_0x6a59('0x170')],'',_0x2d259c[_0x6a59('0x171')]]);if(_0x5155cb[_0x6a59('0xa7')]===-0x1){return _0x5155cb;}return this['channel']['noop'](util[_0x6a59('0x4f')](_0x6a59('0xbf'),'QUEUE',_0x455ed8));};AGIVertices[_0x6a59('0x11')][_0x6a59('0x172')]=function(_0x448e69){logger['info'](util[_0x6a59('0x4f')](_0x6a59('0x173'),_0x448e69[_0x6a59('0xaa')]));var _0x4dbcc5=_0x448e69[_0x6a59('0x174')]||'wav';var _0x35697b=util['format'](_0x6a59('0x175'),this[_0x6a59('0x38')][_0x6a59('0x36')],rs[_0x6a59('0x115')](0x5));var _0x41d8e7=util[_0x6a59('0x4f')]('%s/recordings/%s.%s',FILES_PATH,_0x35697b,_0x4dbcc5);var _0x1b2002=util[_0x6a59('0x4f')]('%s/recordings/%s',FILES_PATH,_0x35697b);this[_0x6a59('0x176')][_0x6a59('0xa0')](this,_0x448e69,_0x35697b,_0x41d8e7);this[_0x6a59('0x38')][_0x6a59('0x9e')](_0x6a59('0x177'),_0x35697b);logger[_0x6a59('0x2e')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x1b2002,_0x4dbcc5,_0x448e69[_0x6a59('0x178')],_0x448e69[_0x6a59('0x5f')]);return this['channel']['recordFile'](_0x1b2002,_0x4dbcc5,_0x448e69[_0x6a59('0x178')],_0x448e69['timeout'],undefined,!![]);};AGIVertices[_0x6a59('0x11')]['restapi']=function(_0x3dffa6){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x3dffa6['label']));if(!this[_0x6a59('0x7e')](_0x3dffa6[_0x6a59('0x108')])){return this[_0x6a59('0x38')][_0x6a59('0xa4')](_0x6a59('0x179'));}var _0x181221=this['restAPI'][_0x6a59('0xa0')](this,_0x3dffa6);logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')]('Response:',util[_0x6a59('0x17a')](_0x181221,{'showHidden':![],'depth':null})));if(!this[_0x6a59('0x7e')](_0x3dffa6['variable_id'])){return this[_0x6a59('0x38')][_0x6a59('0xa4')](_0x6a59('0x17b'));}var _0x18483a=this[_0x6a59('0x12')][_0x6a59('0xa0')](this,_0x3dffa6[_0x6a59('0xd6')]);if(!_0x18483a){return this[_0x6a59('0x38')]['error'](_0x3dffa6,_0x6a59('0xd7'));}this['channel'][_0x6a59('0x9e')](util['format'](_0x6a59('0x17c'),_0x18483a),_0x181221[_0x6a59('0x6d')]?_0x181221[_0x6a59('0x6d')]:'200');this['channel'][_0x6a59('0x9e')](util[_0x6a59('0x4f')]('%s_STATUS_MESSAGE',_0x18483a),_0x181221[_0x6a59('0x17d')]?_0x181221[_0x6a59('0x17d')]:'OK');if(_0x181221['body']){try{this[_0x6a59('0x98')](_0x181221[_0x6a59('0x64')],_0x18483a);}catch(_0x276aa0){logger[_0x6a59('0x2c')](util[_0x6a59('0x4f')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x18483a));}}return this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')](_0x6a59('0x17e'),_0x18483a));};AGIVertices[_0x6a59('0x11')][_0x6a59('0x17f')]=function(_0x268aae){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0x180'),_0x268aae[_0x6a59('0xaa')]));return this[_0x6a59('0x38')][_0x6a59('0x181')](_0x268aae[_0x6a59('0x182')][_0x6a59('0x53')](/\s+/g,''),_0x268aae[_0x6a59('0x178')]);};AGIVertices[_0x6a59('0x11')][_0x6a59('0x183')]=function(_0x108225){logger['info'](util[_0x6a59('0x4f')](_0x6a59('0x184'),_0x108225[_0x6a59('0xaa')]));return this[_0x6a59('0x38')][_0x6a59('0x185')](_0x108225[_0x6a59('0x60')][_0x6a59('0x53')](/\s+/g,''),_0x108225[_0x6a59('0x178')]);};AGIVertices[_0x6a59('0x11')][_0x6a59('0x186')]=function(_0x477146){logger[_0x6a59('0x2e')](util['format'](_0x6a59('0x187'),_0x477146[_0x6a59('0xaa')]));return this[_0x6a59('0x38')][_0x6a59('0x188')](_0x477146[_0x6a59('0x56')],_0x477146[_0x6a59('0x178')]);};AGIVertices[_0x6a59('0x11')][_0x6a59('0x189')]=function(_0x1d2aa2){logger['info'](util[_0x6a59('0x4f')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x1d2aa2[_0x6a59('0xaa')]));if(!this[_0x6a59('0x7e')](_0x1d2aa2['account_id'])){return this[_0x6a59('0x38')][_0x6a59('0xa4')]('no\x20mail\x20account\x20configured');}var _0x44c6a9=this['getMailAccount'][_0x6a59('0xa0')](this,_0x1d2aa2[_0x6a59('0x18a')]);if(!_0x44c6a9||!_0x44c6a9[_0x6a59('0x18b')]){return this[_0x6a59('0x38')][_0x6a59('0x2c')](_0x1d2aa2,_0x6a59('0x18c'));}var _0x950bde={'from':util[_0x6a59('0x4f')](_0x6a59('0x18d'),_0x44c6a9['name'],_0x44c6a9[_0x6a59('0x18e')]||_0x44c6a9[_0x6a59('0x18b')][_0x6a59('0x18f')]),'to':_0x1d2aa2['to']||'','cc':_0x1d2aa2['cc']||'','bcc':_0x1d2aa2[_0x6a59('0x190')]||'','subject':_0x1d2aa2['subject'],'html':_0x1d2aa2[_0x6a59('0x56')],'text':_0x1d2aa2[_0x6a59('0x56')]};if(this[_0x6a59('0x7e')](_0x1d2aa2['template_id'])){}logger['debug']('sendMail\x20message',JSON[_0x6a59('0x6b')](_0x950bde));this[_0x6a59('0x35')]['sync'](this,_0x1d2aa2,_0x1d2aa2[_0x6a59('0x18a')]);this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x44c6a9[_0x6a59('0x15')]));this[_0x6a59('0x25')][_0x6a59('0xa0')](this,_0x44c6a9[_0x6a59('0x191')],_0x950bde);return this['channel'][_0x6a59('0xa4')](_0x6a59('0x192'));};AGIVertices[_0x6a59('0x11')]['sendFax']=function(_0x4b9d72){logger['info'](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x4b9d72[_0x6a59('0xaa')]));return this[_0x6a59('0x38')]['noop'](_0x6a59('0x193'));};AGIVertices[_0x6a59('0x11')][_0x6a59('0x194')]=function(_0x382b83){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0x195'),_0x382b83[_0x6a59('0xaa')]));if(!this['isConfigured'](_0x382b83[_0x6a59('0x196')])){return this[_0x6a59('0x38')][_0x6a59('0xa4')](_0x6a59('0x197'));}var _0x297a48=this[_0x6a59('0x33')][_0x6a59('0xa0')](this,_0x382b83[_0x6a59('0x196')]);if(!_0x297a48){return this['channel'][_0x6a59('0x2c')](_0x382b83,_0x6a59('0x198'));}var _0x8aac94={'body':_0x382b83[_0x6a59('0x199')],'phone':_0x382b83['to']||'','SmsAccountId':_0x297a48['id']};logger[_0x6a59('0x19a')]('sendSMS\x20message',JSON[_0x6a59('0x6b')](_0x8aac94));this[_0x6a59('0x35')][_0x6a59('0xa0')](this,_0x382b83,_0x382b83[_0x6a59('0x196')]);this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')](_0x6a59('0x19b'),_0x297a48[_0x6a59('0x15')]));this[_0x6a59('0x34')]['sync'](this,_0x8aac94);return this['channel']['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x6a59('0x11')][_0x6a59('0x19c')]=function(_0x48044f){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0x19d'),_0x48044f['label']));if(!this[_0x6a59('0x7e')](_0x48044f[_0x6a59('0xd6')])){return this['channel'][_0x6a59('0x2c')](_0x48044f,'no\x20variable\x20selected');}var _0x49178f=this[_0x6a59('0x12')]['sync'](this,_0x48044f[_0x6a59('0xd6')]);if(!_0x49178f){return this[_0x6a59('0x38')]['error'](_0x48044f,_0x6a59('0xd7'));}return this[_0x6a59('0x38')][_0x6a59('0x9e')](_0x49178f,_0x48044f[_0x6a59('0x19e')]);};AGIVertices[_0x6a59('0x11')][_0x6a59('0x19f')]=function(_0x1ec6d5){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0x1a0'),_0x1ec6d5['label']));this[_0x6a59('0x38')][_0x6a59('0xa4')](_0x6a59('0x1a1'));if(_0x1ec6d5['answer']===_0x6a59('0x1a2')){this[_0x6a59('0x38')]['noop'](_0x6a59('0x1a3'));return this[_0x6a59('0x38')][_0x6a59('0xb4')]();}return this['channel'][_0x6a59('0xa4')](_0x6a59('0x1a4'));};AGIVertices[_0x6a59('0x11')]['subproject']=function(_0x178535){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0x1a5'),_0x178535[_0x6a59('0xaa')]));if(!this[_0x6a59('0x7e')](_0x178535[_0x6a59('0x1a6')])){return this[_0x6a59('0x38')][_0x6a59('0x2c')](_0x178535,_0x6a59('0x1a7'));}var _0x3b9188=this[_0x6a59('0x19')][_0x6a59('0xa0')](this,_0x178535[_0x6a59('0x1a6')]);if(!this[_0x6a59('0x7e')](_0x3b9188)){return this[_0x6a59('0x38')]['error'](_0x178535,util['format'](_0x6a59('0x1a8'),_0x178535[_0x6a59('0x1a6')]));}if(_0x3b9188===this['channel']['arg_1']){return this[_0x6a59('0x38')]['error'](_0x178535,_0x6a59('0x1a9'));}this['createSquareDetailsReport'][_0x6a59('0xa0')](this,_0x178535,_0x3b9188);var _0x391cbc=this[_0x6a59('0x38')]['exec'](_0x6a59('0x1aa'),util[_0x6a59('0x4f')](_0x6a59('0x1ab'),config[_0x6a59('0x8')][_0x6a59('0x1ac')]||_0x6a59('0x1ad'),_0x3b9188,this[_0x6a59('0x38')][_0x6a59('0x3d')]));if(_0x391cbc[_0x6a59('0xa7')]===-0x1){return _0x391cbc;}return this[_0x6a59('0x38')]['noop'](util[_0x6a59('0x4f')](_0x6a59('0xbf'),_0x6a59('0x1aa'),_0x3b9188));};AGIVertices[_0x6a59('0x11')][_0x6a59('0x1ae')]=function(_0x2f2b40){logger[_0x6a59('0x2e')](util['format'](_0x6a59('0x1af'),_0x2f2b40['label']));var _0x1ed7fb=this[_0x6a59('0x51')][_0x6a59('0xa0')](this,_0x2f2b40[_0x6a59('0xb2')]);this[_0x6a59('0x35')][_0x6a59('0xa0')](this,_0x2f2b40,_0x2f2b40['command']);if(this[_0x6a59('0x7e')](_0x2f2b40['variable_id'])){var _0xaf2f4c=this['getVariable']['sync'](this,_0x2f2b40['variable_id']);if(_0xaf2f4c){this[_0x6a59('0x38')][_0x6a59('0x9e')](_0xaf2f4c,_0x1ed7fb);return this['channel'][_0x6a59('0xa4')](util[_0x6a59('0x4f')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x2f2b40[_0x6a59('0xb2')],_0xaf2f4c));}}return this[_0x6a59('0x38')]['noop'](util['format'](_0x6a59('0x1b0'),_0x2f2b40[_0x6a59('0xb2')]));};AGIVertices[_0x6a59('0x11')][_0x6a59('0x1b1')]=function(_0x2b6ca0){logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x2b6ca0[_0x6a59('0xaa')]));_0x2b6ca0[_0x6a59('0x56')]=_0x2b6ca0[_0x6a59('0x56')][_0x6a59('0x53')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x2b6ca0[_0x6a59('0x1b2')])){return this['channel'][_0x6a59('0xa4')](_0x6a59('0x1b3'));}if(!this['isConfigured'](_0x2b6ca0[_0x6a59('0x56')])){return this[_0x6a59('0x38')][_0x6a59('0xa4')]('no\x20text\x20configured');}this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x2b6ca0[_0x6a59('0x56')]));var _0x3744b8=this[_0x6a59('0x54')]['sync'](this,_0x2b6ca0);if(_0x3744b8){this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x3744b8));var _0x96043=this[_0x6a59('0x38')][_0x6a59('0xfb')](_0x3744b8);try{fs[_0x6a59('0xfc')](_0x3744b8+_0x6a59('0x14e'));}catch(_0x164bed){logger['error'](_0x164bed);}return _0x96043;}return this[_0x6a59('0x38')][_0x6a59('0x2c')](_0x2b6ca0,_0x6a59('0x1b4'));};AGIVertices[_0x6a59('0x11')][_0x6a59('0x1b5')]=function(_0xa46375){logger['info'](util[_0x6a59('0x4f')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0xa46375[_0x6a59('0xaa')]));_0xa46375[_0x6a59('0x56')]=_0xa46375[_0x6a59('0x56')][_0x6a59('0x53')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x6a59('0x7e')](_0xa46375[_0x6a59('0x56')])){return this['channel'][_0x6a59('0xa4')](_0x6a59('0xa5'));}this[_0x6a59('0x38')][_0x6a59('0xa4')](util['format']('Trying\x20Google\x20TTS\x20%s',_0xa46375[_0x6a59('0x56')]));var _0x467590=this[_0x6a59('0x5c')][_0x6a59('0xa0')](this,_0xa46375);if(_0x467590){this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')](_0x6a59('0x1b6'),_0x467590));var _0xcad51e=this[_0x6a59('0x38')][_0x6a59('0xfb')](_0x467590);try{fs[_0x6a59('0xfc')](_0x467590+_0x6a59('0x14e'));}catch(_0x4c7c28){logger[_0x6a59('0x2c')](_0x4c7c28);}return _0xcad51e;}return this[_0x6a59('0x38')][_0x6a59('0x2c')](_0xa46375,_0x6a59('0x1b7'));};AGIVertices[_0x6a59('0x11')][_0x6a59('0x1b8')]=function(_0x580364){logger['info'](util[_0x6a59('0x4f')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x580364[_0x6a59('0xaa')]));if(!this['isConfigured'](_0x580364['findBy'])){return this['channel'][_0x6a59('0x2c')](_0x580364,_0x6a59('0x153'));}logger['info'](util[_0x6a59('0x4f')](_0x6a59('0x154'),this[_0x6a59('0x38')][_0x6a59('0x39')],_0x580364[_0x6a59('0x152')]));var _0x1dd899=this[_0x6a59('0x4c')][_0x6a59('0xa0')](this,_0x580364['findBy']);if(_0x1dd899){logger['info'](util[_0x6a59('0x4f')](_0x6a59('0x155'),this[_0x6a59('0x38')][_0x6a59('0x39')],_0x580364[_0x6a59('0x152')]));this['channel']['noop'](util[_0x6a59('0x4f')](_0x6a59('0x155'),this['channel']['callerid'],_0x580364[_0x6a59('0x152')]));return{'code':0xc8,'result':_0x6a59('0x156')};}else{logger[_0x6a59('0x2e')](util[_0x6a59('0x4f')](_0x6a59('0x157'),this[_0x6a59('0x38')][_0x6a59('0x39')],_0x580364[_0x6a59('0x152')]));this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x6a59('0x38')][_0x6a59('0x39')],_0x580364[_0x6a59('0x152')]));return{'code':0xc8,'result':_0x6a59('0x158')};}};AGIVertices[_0x6a59('0x11')][_0x6a59('0x1b9')]=function(_0x3ef02e){logger[_0x6a59('0x2e')](util['format'](_0x6a59('0x1ba'),_0x3ef02e[_0x6a59('0xaa')]));var _0x412df9=this['channel']['exec'](_0x6a59('0x1bb'),[_0x3ef02e[_0x6a59('0x1bc')],_0x3ef02e[_0x6a59('0x70')]]);if(_0x412df9[_0x6a59('0xa7')]===-0x1){return _0x412df9;}return this[_0x6a59('0x38')][_0x6a59('0xa4')](util[_0x6a59('0x4f')]('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x3ef02e[_0x6a59('0x1bc')]));};AGIVertices[_0x6a59('0x11')]['vswitch']=function(_0xc66aa7){logger['info'](util['format'](_0x6a59('0x1bd'),_0xc66aa7['label']));if(!this['isConfigured'](_0xc66aa7['variable_id'])){return this[_0x6a59('0x38')][_0x6a59('0x2c')](_0xc66aa7,_0x6a59('0x1be'));}var _0x1d0e63=this[_0x6a59('0x12')][_0x6a59('0xa0')](this,_0xc66aa7[_0x6a59('0xd6')]);if(!_0x1d0e63){return this[_0x6a59('0x38')]['error'](_0xc66aa7,_0x6a59('0xd7'));}var _0x22099b=this['channel']['getVariable'](_0x1d0e63);return{'code':0xc8,'result':_0x22099b[_0x6a59('0x9b')]?_0x22099b[_0x6a59('0x9b')]:'-'};};String[_0x6a59('0x11')][_0x6a59('0x9a')]=function(_0x199941,_0x1bc46d){return this[_0x6a59('0x1bf')](_0x199941)[_0x6a59('0x1c0')](_0x1bc46d);};module[_0x6a59('0x1c1')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 488f064..e133a19 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 _0xd3f6=['origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hangup','syncHangup','agentringnoanswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','prototype','startAcw','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','then','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','acwTimeout','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','[%s][TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','interface','[ACW][syncAgentConnect]\x20%s','message','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid'];(function(_0x23bfbb,_0x3b0fa2){var _0x383576=function(_0x116419){while(--_0x116419){_0x23bfbb['push'](_0x23bfbb['shift']());}};_0x383576(++_0x3b0fa2);}(_0xd3f6,0x10c));var _0x6d3f=function(_0x49f67f,_0x4113a4){_0x49f67f=_0x49f67f-0x0;var _0x4779a1=_0xd3f6[_0x49f67f];return _0x4779a1;};'use strict';var util=require(_0x6d3f('0x0'));var _=require('lodash');var moment=require(_0x6d3f('0x1'));var ami=require(_0x6d3f('0x2'));var logger=require(_0x6d3f('0x3'))(_0x6d3f('0x4'));var RpcUser=require(_0x6d3f('0x5'));var RpcVoiceAgentReport=require(_0x6d3f('0x6'));function Acw(_0x19c647){this['voiceQueues']=_0x19c647[_0x6d3f('0x7')];this[_0x6d3f('0x8')]=_0x19c647['agents'];this[_0x6d3f('0x9')]=_0x19c647[_0x6d3f('0x9')];this[_0x6d3f('0xa')]={};ami['on'](_0x6d3f('0xb'),this[_0x6d3f('0xc')][_0x6d3f('0xd')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0x6d3f('0xd')](this));ami['on'](_0x6d3f('0xe'),this[_0x6d3f('0xf')][_0x6d3f('0xd')](this));ami['on'](_0x6d3f('0x10'),this['syncAgentRingNoAnswer'][_0x6d3f('0xd')](this));ami['on']('attendedtransfer',this[_0x6d3f('0x11')][_0x6d3f('0xd')](this));ami['on'](_0x6d3f('0x12'),this[_0x6d3f('0x13')][_0x6d3f('0xd')](this));ami['on'](_0x6d3f('0x14'),this[_0x6d3f('0x15')][_0x6d3f('0xd')](this));}function getDiff(_0x52bca6){var _0x434170=moment()[_0x6d3f('0x16')](0x0);var _0x1d8a90=moment(_0x52bca6)['milliseconds'](0x0);return _0x434170[_0x6d3f('0x17')](_0x1d8a90,'seconds');}Acw[_0x6d3f('0x18')][_0x6d3f('0x19')]=function(_0x50e73c){try{var _0x3d46c6=this;var _0x4e1136=this[_0x6d3f('0xa')][_0x50e73c]['interface'];var _0x241626=this['channels'][_0x50e73c][_0x6d3f('0x1a')];var _0x4b13e0=this['voiceQueues'][_0x241626];var _0x219f94=![];var _0x4f8d30=_0x6d3f('0x1b');if(_0x4b13e0[_0x6d3f('0x1c')]){if(_0x4b13e0[_0x6d3f('0x1d')][_0x6d3f('0x1e')]){_0x219f94=!![];_0x4f8d30=_0x4b13e0[_0x6d3f('0x1d')][_0x6d3f('0x1e')];}}ami[_0x6d3f('0x1f')]({'action':'QueuePause','interface':_0x4e1136,'paused':!![],'reason':_0x4f8d30})[_0x6d3f('0x20')](function(_0x2ea3ba){if(_0x3d46c6[_0x6d3f('0x8')][_0x4e1136]){return RpcUser['getAgent'](_0x3d46c6[_0x6d3f('0x8')][_0x4e1136]['id'])[_0x6d3f('0x20')](function(_0x523566){if(_0x523566&&!_0x523566['voicePause']){logger[_0x6d3f('0x21')](_0x6d3f('0x22'),_0x50e73c,_0x4e1136,_0x241626);var _0x575064=_0x3d46c6[_0x6d3f('0xa')][_0x50e73c][_0x6d3f('0x23')]&&_0x3d46c6[_0x6d3f('0xa')][_0x50e73c]['destlinkedid']?_0x3d46c6[_0x6d3f('0xa')][_0x50e73c][_0x6d3f('0x24')]:_0x50e73c;return RpcUser[_0x6d3f('0x25')](_0x3d46c6['agents'][_0x4e1136],_0x4f8d30,_0x575064)[_0x6d3f('0x20')](function(_0x3715a9){if(!_0x219f94){_0x3d46c6[_0x6d3f('0x9')][_0x4e1136]={};logger[_0x6d3f('0x21')](_0x6d3f('0x26'),_0x50e73c,_0x3d46c6[_0x6d3f('0x7')][_0x241626]['acwTimeout'],_0x4e1136,_0x241626);_0x3d46c6['timers'][_0x4e1136][_0x6d3f('0x27')]=setTimeout(_0x3d46c6[_0x6d3f('0x28')][_0x6d3f('0xd')](_0x3d46c6,_0x4e1136),_0x3d46c6[_0x6d3f('0x7')][_0x241626][_0x6d3f('0x29')]*0x3e8);_0x3d46c6[_0x6d3f('0x9')][_0x4e1136]['lastPauseAt']=moment()['format'](_0x6d3f('0x2a'));_0x3d46c6[_0x6d3f('0x9')][_0x4e1136][_0x6d3f('0x2b')]=_0x50e73c;_0x3d46c6[_0x6d3f('0x9')][_0x4e1136][_0x6d3f('0x1a')]=_0x241626;_0x3d46c6['timers'][_0x4e1136][_0x6d3f('0x2c')]=function(){var _0x932e63=getDiff(_0x3d46c6[_0x6d3f('0x9')][_0x4e1136]['lastPauseAt']);clearTimeout(_0x3d46c6[_0x6d3f('0x9')][_0x4e1136]['timer']);_0x3d46c6['timers'][_0x4e1136][_0x6d3f('0x27')]=![];RpcVoiceAgentReport[_0x6d3f('0x2d')]({'acwtime':_0x932e63},_0x3d46c6[_0x6d3f('0x9')][_0x4e1136][_0x6d3f('0x2b')],_0x4e1136)['then'](function(_0x478369){logger[_0x6d3f('0x21')]('[%s][UPDATE][ACWTIME:%s]',_0x50e73c,_0x932e63,_0x478369);})[_0x6d3f('0x2e')](function(_0x1a36ce){logger[_0x6d3f('0x2f')](_0x6d3f('0x30'),_0x50e73c,_0x1a36ce);});delete _0x3d46c6['timers'][_0x4e1136];};}});}else{logger[_0x6d3f('0x21')](_0x6d3f('0x31'),_0x50e73c,_0x4e1136,_0x241626);}});}})[_0x6d3f('0x2e')](function(_0x462c59){logger[_0x6d3f('0x2f')](_0x6d3f('0x26'),_0x50e73c,_0x3d46c6[_0x6d3f('0x7')][_0x241626][_0x6d3f('0x29')],_0x4e1136,_0x241626);})['finally'](function(){delete _0x3d46c6[_0x6d3f('0xa')][_0x50e73c];});}catch(_0x24e2eb){logger[_0x6d3f('0x2f')](_0x6d3f('0x32'),_0x24e2eb['message']);}};Acw['prototype']['stopAcw']=function(_0x3b8019){try{var _0x31a772=this;if(_0x31a772[_0x6d3f('0x9')][_0x3b8019]){_0x31a772['timers'][_0x3b8019]['timer']=![];var _0x14c9e3=_0x31a772['timers'][_0x3b8019][_0x6d3f('0x2b')];var _0xdfaaac=_0x31a772['timers'][_0x3b8019]['queue'];var _0x52943c=_0x31a772[_0x6d3f('0x7')][_0xdfaaac][_0x6d3f('0x29')];logger[_0x6d3f('0x21')](_0x6d3f('0x33'),_0x14c9e3,_0x3b8019);RpcUser['saveUnpause'](this[_0x6d3f('0x8')][_0x3b8019]);RpcVoiceAgentReport['update']({'acwtime':_0x52943c,'agentacw':!![]},_0x14c9e3,_0x3b8019)[_0x6d3f('0x20')](function(_0x3b51bd){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x14c9e3,_0x52943c,_0x3b51bd);})['catch'](function(_0xe9fa2d){logger[_0x6d3f('0x2f')]('[%s][UPDATE][ERRORS:%s]',_0x14c9e3,_0xe9fa2d);});}else{logger[_0x6d3f('0x2f')](_0x6d3f('0x34'),_0x3b8019);if(_0x31a772[_0x6d3f('0x9')]){logger[_0x6d3f('0x21')](_0x6d3f('0x35'),JSON[_0x6d3f('0x36')](_0x31a772[_0x6d3f('0x9')]));}}}catch(_0x4fa351){logger[_0x6d3f('0x2f')](_0x6d3f('0x37'),_0x4fa351['message']);}};Acw[_0x6d3f('0x18')]['syncAgentConnect']=function(_0x124d75){try{if(this[_0x6d3f('0x7')][_0x124d75[_0x6d3f('0x1a')]]&&(this[_0x6d3f('0x7')][_0x124d75[_0x6d3f('0x1a')]][_0x6d3f('0x4')]||this[_0x6d3f('0x7')][_0x124d75[_0x6d3f('0x1a')]][_0x6d3f('0x1c')])){if(this[_0x6d3f('0x8')][_0x124d75['interface']]){this[_0x6d3f('0xa')][_0x124d75['uniqueid']]={'queue':_0x124d75[_0x6d3f('0x1a')],'interface':_0x124d75[_0x6d3f('0x38')],'destlinkedid':_0x124d75[_0x6d3f('0x24')]};}}}catch(_0x25f78c){logger[_0x6d3f('0x2f')](_0x6d3f('0x39'),_0x25f78c[_0x6d3f('0x3a')]);}};Acw['prototype'][_0x6d3f('0x15')]=function(_0x904612){try{if(this[_0x6d3f('0x7')][_0x904612[_0x6d3f('0x1a')]]&&(this[_0x6d3f('0x7')][_0x904612['queue']][_0x6d3f('0x4')]||this[_0x6d3f('0x7')][_0x904612['queue']][_0x6d3f('0x1c')])){if(this[_0x6d3f('0x8')][_0x904612[_0x6d3f('0x38')]]){this['channels'][_0x904612['uniqueid']]={'queue':_0x904612[_0x6d3f('0x1a')],'interface':_0x904612['interface']};}}}catch(_0x51da4a){logger[_0x6d3f('0x2f')](_0x6d3f('0x3b'),_0x51da4a[_0x6d3f('0x3a')]);}};Acw[_0x6d3f('0x18')][_0x6d3f('0x3c')]=function(_0x2065b6){try{if(this['channels'][_0x2065b6[_0x6d3f('0x2b')]]&&_[_0x6d3f('0x3d')](this['channels'][_0x2065b6[_0x6d3f('0x2b')]][_0x6d3f('0x23')])){logger[_0x6d3f('0x21')](_0x6d3f('0x3e'),_0x2065b6[_0x6d3f('0x2b')]);this[_0x6d3f('0x19')](_0x2065b6[_0x6d3f('0x2b')]);}else if(this[_0x6d3f('0xa')][_0x2065b6[_0x6d3f('0x3f')]]&&_[_0x6d3f('0x3d')](this['channels'][_0x2065b6[_0x6d3f('0x3f')]][_0x6d3f('0x23')])){logger[_0x6d3f('0x21')](_0x6d3f('0x40'),_0x2065b6[_0x6d3f('0x3f')]);this[_0x6d3f('0x19')](_0x2065b6[_0x6d3f('0x3f')]);}}catch(_0x2afbc9){logger[_0x6d3f('0x2f')](_0x6d3f('0x41'),_0x2afbc9['message']);}};Acw[_0x6d3f('0x18')]['syncHangup']=function(_0x141dba){try{if(this['channels'][_0x141dba[_0x6d3f('0x2b')]]&&this[_0x6d3f('0xa')][_0x141dba[_0x6d3f('0x2b')]][_0x6d3f('0x23')]){logger[_0x6d3f('0x21')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x141dba[_0x6d3f('0x2b')]);this[_0x6d3f('0x19')](_0x141dba[_0x6d3f('0x2b')]);}else if(this[_0x6d3f('0xa')][_0x141dba[_0x6d3f('0x3f')]]&&this[_0x6d3f('0xa')][_0x141dba[_0x6d3f('0x3f')]][_0x6d3f('0x23')]){logger['info'](_0x6d3f('0x42'),_0x141dba['linkedid']);this['startAcw'](_0x141dba[_0x6d3f('0x3f')]);}}catch(_0x1e9392){logger[_0x6d3f('0x2f')](_0x6d3f('0x43'),_0x1e9392[_0x6d3f('0x3a')]);}};Acw[_0x6d3f('0x18')]['syncAttendedTransfer']=function(_0xf612b1){try{if(!_[_0x6d3f('0x44')](this[_0x6d3f('0xa')][_0xf612b1[_0x6d3f('0x45')]])){this[_0x6d3f('0x19')](_0xf612b1[_0x6d3f('0x45')]);if(this[_0x6d3f('0xa')][_0xf612b1['secondtransfereruniqueid']]){this[_0x6d3f('0xa')][_0xf612b1[_0x6d3f('0x46')]]['attended']=!![];this[_0x6d3f('0xa')][_0xf612b1[_0x6d3f('0x47')]]=this[_0x6d3f('0xa')][_0xf612b1['secondtransfereruniqueid']];delete this[_0x6d3f('0xa')][_0xf612b1[_0x6d3f('0x46')]];}}else if(!_['isNil'](this[_0x6d3f('0xa')][_0xf612b1[_0x6d3f('0x47')]])){this['startAcw'](_0xf612b1[_0x6d3f('0x47')]);if(this[_0x6d3f('0xa')][_0xf612b1[_0x6d3f('0x48')]]){this['channels'][_0xf612b1[_0x6d3f('0x48')]][_0x6d3f('0x23')]=!![];this[_0x6d3f('0xa')][_0xf612b1[_0x6d3f('0x45')]]=this[_0x6d3f('0xa')][_0xf612b1['origtransfereruniqueid']];delete this[_0x6d3f('0xa')][_0xf612b1[_0x6d3f('0x48')]];}}}catch(_0x4a1d33){logger[_0x6d3f('0x2f')](_0x6d3f('0x49'),_0x4a1d33[_0x6d3f('0x3a')]);}};Acw[_0x6d3f('0x18')][_0x6d3f('0x13')]=function(_0x5f3b11){try{if(this['channels'][_0x5f3b11[_0x6d3f('0x4a')]]){logger[_0x6d3f('0x21')](_0x6d3f('0x4b'),JSON[_0x6d3f('0x36')](_0x5f3b11[_0x6d3f('0x4a')]));this[_0x6d3f('0x19')](_0x5f3b11['transfereruniqueid']);}else if(this[_0x6d3f('0xa')][_0x5f3b11[_0x6d3f('0x4c')]]){logger[_0x6d3f('0x21')](_0x6d3f('0x4d'),JSON[_0x6d3f('0x36')](_0x5f3b11[_0x6d3f('0x4c')]));this[_0x6d3f('0x19')](_0x5f3b11['transfererlinkedid']);}}catch(_0x38a6bf){logger['error'](_0x6d3f('0x4e'),_0x38a6bf['message']);}};Acw[_0x6d3f('0x18')][_0x6d3f('0x4f')]=function(_0x3713cf){try{if(this[_0x6d3f('0x7')][_0x3713cf['queue']]&&this[_0x6d3f('0x7')][_0x3713cf[_0x6d3f('0x1a')]]['autopause']===_0x6d3f('0x50')){if(this[_0x6d3f('0x8')][_0x3713cf[_0x6d3f('0x38')]]){logger['info'](_0x6d3f('0x51'),_0x3713cf[_0x6d3f('0x2b')],_0x3713cf[_0x6d3f('0x38')],_0x3713cf[_0x6d3f('0x1a')]);return RpcUser[_0x6d3f('0x25')](this[_0x6d3f('0x8')][_0x3713cf[_0x6d3f('0x38')]],_0x6d3f('0x52'),_0x3713cf[_0x6d3f('0x2b')]);}}}catch(_0x2d735c){logger[_0x6d3f('0x2f')](_0x6d3f('0x53'),_0x2d735c[_0x6d3f('0x3a')]);}};module[_0x6d3f('0x54')]=Acw; \ No newline at end of file +var _0xd30e=['[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','acw','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','syncHangup','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','milliseconds','diff','prototype','startAcw','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','message','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','[%s][HANGUP:LINKEDID]','linkedid'];(function(_0x34c819,_0x2d4fd5){var _0x51912e=function(_0x5ab9b4){while(--_0x5ab9b4){_0x34c819['push'](_0x34c819['shift']());}};_0x51912e(++_0x2d4fd5);}(_0xd30e,0x1ac));var _0xed30=function(_0xb9abb9,_0x327bad){_0xb9abb9=_0xb9abb9-0x0;var _0x458278=_0xd30e[_0xb9abb9];return _0x458278;};'use strict';var util=require(_0xed30('0x0'));var _=require(_0xed30('0x1'));var moment=require(_0xed30('0x2'));var ami=require(_0xed30('0x3'));var logger=require(_0xed30('0x4'))(_0xed30('0x5'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x495d0b){this['voiceQueues']=_0x495d0b[_0xed30('0x6')];this['agents']=_0x495d0b[_0xed30('0x7')];this['timers']=_0x495d0b[_0xed30('0x8')];this[_0xed30('0x9')]={};ami['on'](_0xed30('0xa'),this['syncAgentConnect'][_0xed30('0xb')](this));ami['on'](_0xed30('0xc'),this[_0xed30('0xd')][_0xed30('0xb')](this));ami['on']('hangup',this[_0xed30('0xe')][_0xed30('0xb')](this));ami['on']('agentringnoanswer',this[_0xed30('0xf')][_0xed30('0xb')](this));ami['on'](_0xed30('0x10'),this[_0xed30('0x11')][_0xed30('0xb')](this));ami['on'](_0xed30('0x12'),this[_0xed30('0x13')]['bind'](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0xed30('0xb')](this));}function getDiff(_0x1d29d7){var _0xe6f628=moment()['milliseconds'](0x0);var _0x5a353c=moment(_0x1d29d7)[_0xed30('0x14')](0x0);return _0xe6f628[_0xed30('0x15')](_0x5a353c,'seconds');}Acw[_0xed30('0x16')][_0xed30('0x17')]=function(_0x4dd6ba){try{var _0x45e581=this;var _0x10a73e=this[_0xed30('0x9')][_0x4dd6ba][_0xed30('0x18')];var _0x369761=this[_0xed30('0x9')][_0x4dd6ba]['queue'];var _0x274efb=this[_0xed30('0x6')][_0x369761];var _0x532a11=![];var _0x3a04c5=_0xed30('0x19');if(_0x274efb[_0xed30('0x1a')]){if(_0x274efb[_0xed30('0x1b')][_0xed30('0x1c')]){_0x532a11=!![];_0x3a04c5=_0x274efb[_0xed30('0x1b')][_0xed30('0x1c')];}}ami['Action']({'action':_0xed30('0x1d'),'interface':_0x10a73e,'paused':!![],'reason':_0x3a04c5})[_0xed30('0x1e')](function(_0x33ad19){if(_0x45e581[_0xed30('0x7')][_0x10a73e]){return RpcUser[_0xed30('0x1f')](_0x45e581['agents'][_0x10a73e]['id'])['then'](function(_0x7672ed){if(_0x7672ed&&!_0x7672ed['voicePause']){logger[_0xed30('0x20')](_0xed30('0x21'),_0x4dd6ba,_0x10a73e,_0x369761);var _0x463203=_0x45e581[_0xed30('0x9')][_0x4dd6ba]['attended']&&_0x45e581[_0xed30('0x9')][_0x4dd6ba][_0xed30('0x22')]?_0x45e581[_0xed30('0x9')][_0x4dd6ba][_0xed30('0x22')]:_0x4dd6ba;return RpcUser[_0xed30('0x23')](_0x45e581[_0xed30('0x7')][_0x10a73e],_0x3a04c5,_0x463203)['then'](function(_0x308c15){if(!_0x532a11){_0x45e581[_0xed30('0x8')][_0x10a73e]={};logger[_0xed30('0x20')](_0xed30('0x24'),_0x4dd6ba,_0x45e581[_0xed30('0x6')][_0x369761][_0xed30('0x25')],_0x10a73e,_0x369761);_0x45e581[_0xed30('0x8')][_0x10a73e][_0xed30('0x26')]=setTimeout(_0x45e581[_0xed30('0x27')]['bind'](_0x45e581,_0x10a73e),_0x45e581[_0xed30('0x6')][_0x369761]['acwTimeout']*0x3e8);_0x45e581['timers'][_0x10a73e][_0xed30('0x28')]=moment()[_0xed30('0x29')](_0xed30('0x2a'));_0x45e581[_0xed30('0x8')][_0x10a73e][_0xed30('0x2b')]=_0x4dd6ba;_0x45e581[_0xed30('0x8')][_0x10a73e][_0xed30('0x2c')]=_0x369761;_0x45e581[_0xed30('0x8')][_0x10a73e][_0xed30('0x2d')]=function(){var _0x18bcb7=getDiff(_0x45e581[_0xed30('0x8')][_0x10a73e]['lastPauseAt']);clearTimeout(_0x45e581[_0xed30('0x8')][_0x10a73e]['timer']);_0x45e581[_0xed30('0x8')][_0x10a73e][_0xed30('0x26')]=![];RpcVoiceAgentReport[_0xed30('0x2e')]({'acwtime':_0x18bcb7},_0x45e581[_0xed30('0x8')][_0x10a73e][_0xed30('0x2b')],_0x10a73e)[_0xed30('0x1e')](function(_0x2cb831){logger[_0xed30('0x20')](_0xed30('0x2f'),_0x4dd6ba,_0x18bcb7,_0x2cb831);})[_0xed30('0x30')](function(_0x170f56){logger['error'](_0xed30('0x31'),_0x4dd6ba,_0x170f56);});delete _0x45e581[_0xed30('0x8')][_0x10a73e];};}});}else{logger['info'](_0xed30('0x32'),_0x4dd6ba,_0x10a73e,_0x369761);}});}})[_0xed30('0x30')](function(_0x22ce6a){logger[_0xed30('0x33')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x4dd6ba,_0x45e581[_0xed30('0x6')][_0x369761][_0xed30('0x25')],_0x10a73e,_0x369761);})['finally'](function(){delete _0x45e581[_0xed30('0x9')][_0x4dd6ba];});}catch(_0x45990e){logger[_0xed30('0x33')]('[ACW][START]\x20%s',_0x45990e[_0xed30('0x34')]);}};Acw[_0xed30('0x16')]['stopAcw']=function(_0x317405){try{var _0x336db0=this;if(_0x336db0[_0xed30('0x8')][_0x317405]){_0x336db0[_0xed30('0x8')][_0x317405]['timer']=![];var _0x40fb65=_0x336db0[_0xed30('0x8')][_0x317405][_0xed30('0x2b')];var _0x37239b=_0x336db0[_0xed30('0x8')][_0x317405][_0xed30('0x2c')];var _0x2365c5=_0x336db0[_0xed30('0x6')][_0x37239b][_0xed30('0x25')];logger[_0xed30('0x20')]('[%s][TIMER][STOP][AGENT:%s]',_0x40fb65,_0x317405);RpcUser[_0xed30('0x35')](this[_0xed30('0x7')][_0x317405]);RpcVoiceAgentReport[_0xed30('0x2e')]({'acwtime':_0x2365c5,'agentacw':!![]},_0x40fb65,_0x317405)[_0xed30('0x1e')](function(_0x3f56c7){logger[_0xed30('0x20')]('[%s][UPDATE][ACWTIME:%s]',_0x40fb65,_0x2365c5,_0x3f56c7);})[_0xed30('0x30')](function(_0x5193fe){logger[_0xed30('0x33')](_0xed30('0x31'),_0x40fb65,_0x5193fe);});}else{logger[_0xed30('0x33')](_0xed30('0x36'),_0x317405);if(_0x336db0[_0xed30('0x8')]){logger['info']('[ACW][TIMERS]',JSON[_0xed30('0x37')](_0x336db0[_0xed30('0x8')]));}}}catch(_0x2c0914){logger[_0xed30('0x33')](_0xed30('0x38'),_0x2c0914[_0xed30('0x34')]);}};Acw[_0xed30('0x16')]['syncAgentConnect']=function(_0x16702a){try{if(this[_0xed30('0x6')][_0x16702a[_0xed30('0x2c')]]&&(this[_0xed30('0x6')][_0x16702a[_0xed30('0x2c')]][_0xed30('0x5')]||this[_0xed30('0x6')][_0x16702a[_0xed30('0x2c')]][_0xed30('0x1a')])){if(this[_0xed30('0x7')][_0x16702a[_0xed30('0x18')]]){this['channels'][_0x16702a[_0xed30('0x2b')]]={'queue':_0x16702a[_0xed30('0x2c')],'interface':_0x16702a[_0xed30('0x18')],'destlinkedid':_0x16702a[_0xed30('0x22')]};}}}catch(_0x3e9aac){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x3e9aac[_0xed30('0x34')]);}};Acw[_0xed30('0x16')][_0xed30('0x39')]=function(_0x784562){try{if(this[_0xed30('0x6')][_0x784562[_0xed30('0x2c')]]&&(this[_0xed30('0x6')][_0x784562[_0xed30('0x2c')]]['acw']||this[_0xed30('0x6')][_0x784562[_0xed30('0x2c')]][_0xed30('0x1a')])){if(this[_0xed30('0x7')][_0x784562['interface']]){this[_0xed30('0x9')][_0x784562[_0xed30('0x2b')]]={'queue':_0x784562[_0xed30('0x2c')],'interface':_0x784562['interface']};}}}catch(_0x38db89){logger[_0xed30('0x33')](_0xed30('0x3a'),_0x38db89[_0xed30('0x34')]);}};Acw[_0xed30('0x16')][_0xed30('0xd')]=function(_0x4179ad){try{if(this[_0xed30('0x9')][_0x4179ad[_0xed30('0x2b')]]&&_[_0xed30('0x3b')](this[_0xed30('0x9')][_0x4179ad[_0xed30('0x2b')]][_0xed30('0x3c')])){logger[_0xed30('0x20')](_0xed30('0x3d'),_0x4179ad['uniqueid']);this[_0xed30('0x17')](_0x4179ad[_0xed30('0x2b')]);}else if(this[_0xed30('0x9')][_0x4179ad['linkedid']]&&_['isUndefined'](this[_0xed30('0x9')][_0x4179ad['linkedid']][_0xed30('0x3c')])){logger['info'](_0xed30('0x3e'),_0x4179ad['linkedid']);this[_0xed30('0x17')](_0x4179ad[_0xed30('0x3f')]);}}catch(_0x57dca7){logger[_0xed30('0x33')]('[ACW][syncHangupRequest]\x20%s',_0x57dca7[_0xed30('0x34')]);}};Acw[_0xed30('0x16')]['syncHangup']=function(_0x52ac61){try{if(this[_0xed30('0x9')][_0x52ac61[_0xed30('0x2b')]]&&this[_0xed30('0x9')][_0x52ac61['uniqueid']][_0xed30('0x3c')]){logger['info'](_0xed30('0x40'),_0x52ac61['uniqueid']);this[_0xed30('0x17')](_0x52ac61['uniqueid']);}else if(this[_0xed30('0x9')][_0x52ac61['linkedid']]&&this[_0xed30('0x9')][_0x52ac61[_0xed30('0x3f')]][_0xed30('0x3c')]){logger[_0xed30('0x20')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x52ac61[_0xed30('0x3f')]);this[_0xed30('0x17')](_0x52ac61[_0xed30('0x3f')]);}}catch(_0x1e8d20){logger['error'](_0xed30('0x41'),_0x1e8d20[_0xed30('0x34')]);}};Acw[_0xed30('0x16')][_0xed30('0x11')]=function(_0x205110){try{if(!_[_0xed30('0x42')](this[_0xed30('0x9')][_0x205110[_0xed30('0x43')]])){this[_0xed30('0x17')](_0x205110[_0xed30('0x43')]);if(this[_0xed30('0x9')][_0x205110['secondtransfereruniqueid']]){this[_0xed30('0x9')][_0x205110[_0xed30('0x44')]]['attended']=!![];this[_0xed30('0x9')][_0x205110[_0xed30('0x45')]]=this[_0xed30('0x9')][_0x205110[_0xed30('0x44')]];delete this[_0xed30('0x9')][_0x205110[_0xed30('0x44')]];}}else if(!_[_0xed30('0x42')](this[_0xed30('0x9')][_0x205110[_0xed30('0x45')]])){this[_0xed30('0x17')](_0x205110['transfertargetuniqueid']);if(this[_0xed30('0x9')][_0x205110[_0xed30('0x46')]]){this[_0xed30('0x9')][_0x205110[_0xed30('0x46')]][_0xed30('0x3c')]=!![];this['channels'][_0x205110[_0xed30('0x43')]]=this[_0xed30('0x9')][_0x205110['origtransfereruniqueid']];delete this['channels'][_0x205110[_0xed30('0x46')]];}}}catch(_0x33e897){logger[_0xed30('0x33')](_0xed30('0x47'),_0x33e897[_0xed30('0x34')]);}};Acw[_0xed30('0x16')][_0xed30('0x13')]=function(_0xa83100){try{if(this['channels'][_0xa83100[_0xed30('0x48')]]){logger[_0xed30('0x20')](_0xed30('0x49'),JSON[_0xed30('0x37')](_0xa83100[_0xed30('0x48')]));this['startAcw'](_0xa83100[_0xed30('0x48')]);}else if(this[_0xed30('0x9')][_0xa83100[_0xed30('0x4a')]]){logger['info'](_0xed30('0x4b'),JSON[_0xed30('0x37')](_0xa83100[_0xed30('0x4a')]));this[_0xed30('0x17')](_0xa83100[_0xed30('0x4a')]);}}catch(_0x52d9da){logger['error'](_0xed30('0x4c'),_0x52d9da[_0xed30('0x34')]);}};Acw['prototype'][_0xed30('0xf')]=function(_0x22aa20){try{if(this['voiceQueues'][_0x22aa20['queue']]&&this[_0xed30('0x6')][_0x22aa20[_0xed30('0x2c')]][_0xed30('0x4d')]===_0xed30('0x4e')){if(this[_0xed30('0x7')][_0x22aa20[_0xed30('0x18')]]){logger[_0xed30('0x20')](_0xed30('0x4f'),_0x22aa20['uniqueid'],_0x22aa20[_0xed30('0x18')],_0x22aa20[_0xed30('0x2c')]);return RpcUser[_0xed30('0x23')](this['agents'][_0x22aa20[_0xed30('0x18')]],'Auto-Pause',_0x22aa20[_0xed30('0x2b')]);}}}catch(_0x321975){logger[_0xed30('0x33')](_0xed30('0x50'),_0x321975[_0xed30('0x34')]);}};module[_0xed30('0x51')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index bef5ee5..5c6ce0b 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 _0xb10b=['asterisk','port','password','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','username','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionCoreShowChannels','[ami.js][fullybooted]','asterisk-manager','moment','util','lodash','ami','../../config/environment'];(function(_0x4d4cae,_0x517b8e){var _0x2ce8d9=function(_0x506055){while(--_0x506055){_0x4d4cae['push'](_0x4d4cae['shift']());}};_0x2ce8d9(++_0x517b8e);}(_0xb10b,0x12a));var _0xbb10=function(_0x5f5ac5,_0x526505){_0x5f5ac5=_0x5f5ac5-0x0;var _0x3697f2=_0xb10b[_0x5f5ac5];return _0x3697f2;};'use strict';var Manager=require(_0xbb10('0x0'));var BPromise=require('bluebird');var moment=require(_0xbb10('0x1'));var util=require(_0xbb10('0x2'));var _=require(_0xbb10('0x3'));var logger=require('../../config/logger')(_0xbb10('0x4'));var config=require(_0xbb10('0x5'));var ami=new Manager(config[_0xbb10('0x6')][_0xbb10('0x7')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')]['username'],config[_0xbb10('0x6')][_0xbb10('0x8')],!![]);ami['keepConnected']();ami[_0xbb10('0x9')]=BPromise[_0xbb10('0xa')](ami[_0xbb10('0xb')]);function error(_0x1c3ee5){logger[_0xbb10('0xc')](util[_0xbb10('0xd')](_0xbb10('0xe'),config[_0xbb10('0x6')]['username'],config['asterisk']['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')],util[_0xbb10('0xf')](_0x1c3ee5,![],null)));}function close(){logger['error'](util[_0xbb10('0xd')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xbb10('0x6')][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')]));}ami[_0xbb10('0x11')]=function(){return function(){return ami['Action']({'action':_0xbb10('0x12')});};};ami[_0xbb10('0x13')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x14')});};};ami[_0xbb10('0x15')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x16')});};};ami[_0xbb10('0x17')]=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x18')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xbb10('0x9')]({'action':_0xbb10('0x19')});};};function connect(_0x133ac2){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')](_0xbb10('0x1b'),config[_0xbb10('0x6')][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')]['port']));ami[_0xbb10('0x1c')](_0xbb10('0xc'),error);ami[_0xbb10('0x1c')](_0xbb10('0x1d'),close);}ami['on'](_0xbb10('0x1e'),connect);ami['on'](_0xbb10('0x1f'),function(_0x4deb49){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0xbb10('0x10')],config[_0xbb10('0x6')]['ip'],config[_0xbb10('0x6')][_0xbb10('0x7')],util[_0xbb10('0xf')](_0x4deb49,![],null)));});ami['on'](_0xbb10('0x20'),function(_0x407cb4){logger[_0xbb10('0x1a')](util[_0xbb10('0xd')](_0xbb10('0x21'),config[_0xbb10('0x6')][_0xbb10('0x10')],config['asterisk']['ip'],config['asterisk']['port']));return BPromise[_0xbb10('0x22')]()[_0xbb10('0x23')](ami[_0xbb10('0x11')]())['then'](ami[_0xbb10('0x13')]())[_0xbb10('0x23')](ami[_0xbb10('0x15')]())[_0xbb10('0x23')](ami[_0xbb10('0x17')]())[_0xbb10('0x23')](ami[_0xbb10('0x24')]())['catch'](function(_0x3796c7){logger[_0xbb10('0xc')](_0xbb10('0x25'),util[_0xbb10('0xf')](_0x3796c7,{'showHidden':![],'depth':null}));});});ami[_0xbb10('0x1c')](_0xbb10('0xc'),error);ami['once'](_0xbb10('0x1d'),close);module['exports']=ami; \ No newline at end of file +var _0xd8b0=['actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','../../config/logger','ami','../../config/environment','asterisk','port','username','password','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus'];(function(_0x55e981,_0x4d8535){var _0x11c2aa=function(_0x4d6335){while(--_0x4d6335){_0x55e981['push'](_0x55e981['shift']());}};_0x11c2aa(++_0x4d8535);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Manager=require(_0x0d8b('0x0'));var BPromise=require(_0x0d8b('0x1'));var moment=require('moment');var util=require('util');var _=require('lodash');var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var ami=new Manager(config[_0x0d8b('0x5')][_0x0d8b('0x6')],config['asterisk']['ip'],config['asterisk'][_0x0d8b('0x7')],config[_0x0d8b('0x5')][_0x0d8b('0x8')],!![]);ami['keepConnected']();ami[_0x0d8b('0x9')]=BPromise[_0x0d8b('0xa')](ami['action']);function error(_0x129310){logger[_0x0d8b('0xb')](util[_0x0d8b('0xc')](_0x0d8b('0xd'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port'],util[_0x0d8b('0xe')](_0x129310,![],null)));}function close(){logger['error'](util[_0x0d8b('0xc')](_0x0d8b('0xf'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')]));}ami[_0x0d8b('0x10')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x11')});};};ami[_0x0d8b('0x12')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x13')});};};ami[_0x0d8b('0x14')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x15')});};};ami[_0x0d8b('0x16')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x17')});};};ami[_0x0d8b('0x18')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x19')});};};function connect(_0x4586c2){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x1b'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config['asterisk'][_0x0d8b('0x6')]));ami[_0x0d8b('0x1c')](_0x0d8b('0xb'),error);ami[_0x0d8b('0x1c')](_0x0d8b('0x1d'),close);}ami['on'](_0x0d8b('0x1e'),connect);ami['on'](_0x0d8b('0x1f'),function(_0x352c17){logger['info'](util['format'](_0x0d8b('0x20'),config['asterisk']['username'],config['asterisk']['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')],util[_0x0d8b('0xe')](_0x352c17,![],null)));});ami['on'](_0x0d8b('0x21'),function(_0x221071){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x22'),config[_0x0d8b('0x5')]['username'],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port']));return BPromise[_0x0d8b('0x23')]()['then'](ami[_0x0d8b('0x10')]())[_0x0d8b('0x24')](ami[_0x0d8b('0x12')]())['then'](ami['actionSipPeerStatus']())[_0x0d8b('0x24')](ami[_0x0d8b('0x16')]())['then'](ami[_0x0d8b('0x18')]())['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x25'),util['inspect'](_0x1b2b59,{'showHidden':![],'depth':null}));});});ami[_0x0d8b('0x1c')]('error',error);ami[_0x0d8b('0x1c')]('close',close);module[_0x0d8b('0x26')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index d004d96..94715bf 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 _0xb43b=['catch','exports','jayson/promise','bluebird','ami','client','http','rpc','memberReport','error','message','result'];(function(_0x10f0a3,_0x4a75a9){var _0x2af3cf=function(_0x1b3f84){while(--_0x1b3f84){_0x10f0a3['push'](_0x10f0a3['shift']());}};_0x2af3cf(++_0x4a75a9);}(_0xb43b,0x1b2));var _0xbb43=function(_0x5eb155,_0x4b185e){_0x5eb155=_0x5eb155-0x0;var _0x58b9a3=_0xb43b[_0x5eb155];return _0x58b9a3;};'use strict';var jayson=require(_0xbb43('0x0'));var BPromise=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var client=jayson[_0xbb43('0x3')][_0xbb43('0x4')]({'port':0x2329});client['Request']=function(_0x131e9e,_0x41aff6){return new BPromise(function(_0x351254,_0x16432a){return client['request'](_0x131e9e,_0x41aff6)['then'](function(_0x378df5){logger['debug'](_0xbb43('0x5'),_0xbb43('0x6'),_0x131e9e,_0x41aff6,_0x378df5);if(_0x378df5[_0xbb43('0x7')]){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x378df5[_0xbb43('0x7')][_0xbb43('0x8')],_0x41aff6);return _0x16432a(_0x378df5['error'][_0xbb43('0x8')]);}else{return _0x351254(_0x378df5[_0xbb43('0x9')]);}})[_0xbb43('0xa')](function(_0x5e3611){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x5e3611,_0x41aff6);return _0x16432a(_0x5e3611);});});};module[_0xbb43('0xb')]=client; \ No newline at end of file +var _0xa9e0=['result','catch','exports','jayson/promise','bluebird','../../config/logger','http','request','debug','rpc','error','message'];(function(_0x27841e,_0x45435f){var _0x30d008=function(_0x2d2a60){while(--_0x2d2a60){_0x27841e['push'](_0x27841e['shift']());}};_0x30d008(++_0x45435f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('ami');var client=jayson['client'][_0x0a9e('0x3')]({'port':0x2329});client['Request']=function(_0x333808,_0x432180){return new BPromise(function(_0x2ab90b,_0x991246){return client[_0x0a9e('0x4')](_0x333808,_0x432180)['then'](function(_0x219af0){logger[_0x0a9e('0x5')](_0x0a9e('0x6'),'memberReport',_0x333808,_0x432180,_0x219af0);if(_0x219af0['error']){logger[_0x0a9e('0x7')]('rpc','memberReport',_0x333808,_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')],_0x432180);return _0x991246(_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')]);}else{return _0x2ab90b(_0x219af0[_0x0a9e('0x9')]);}})[_0x0a9e('0xa')](function(_0x4a4c56){logger['error']('rpc','memberReport',_0x333808,_0x4a4c56,_0x432180);return _0x991246(_0x4a4c56);});});};module[_0x0a9e('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index a92a8cb..7cabdd0 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa143=['voiceQueue','number','getQueue','exports','util','moment','string','name','phone','firstName','lastName','queue','active','type','dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','Contact','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring'];(function(_0x119629,_0x246787){var _0x49a771=function(_0x23624c){while(--_0x23624c){_0x119629['push'](_0x119629['shift']());}};_0x49a771(++_0x246787);}(_0xa143,0x1a8));var _0x3a14=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa143[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x3a14('0x0'));var _=require('lodash');var moment=require(_0x3a14('0x1'));function checkNameSurname(_0x69d892,_0x2c3d96,_0x52c707){var _0x25f270='';if(!_['isNil'](_0x2c3d96)&&_0x3a14('0x2')===typeof _0x2c3d96){_0x25f270+=_0x2c3d96;}if(!_['isNil'](_0x52c707)&&'string'===typeof _0x52c707){_0x25f270+='\x20'+_0x52c707;}if(_0x25f270!==''){return _0x25f270;}return _0x69d892;}function Action(_0x508dc5,_0x491fd0,_0x556291){this['voiceQueue']=_0x508dc5;this['uniqueid']=_0x556291||undefined;this[_0x3a14('0x3')]=checkNameSurname(_0x491fd0['Contact'][_0x3a14('0x4')],_0x491fd0['Contact'][_0x3a14('0x5')],_0x491fd0['Contact'][_0x3a14('0x6')]);this['number']=_0x491fd0[_0x3a14('0x4')];this[_0x3a14('0x7')]=_0x508dc5[_0x3a14('0x3')];this[_0x3a14('0x8')]=_0x491fd0[_0x3a14('0x8')]||![];this[_0x3a14('0x9')]=_0x508dc5[_0x3a14('0x9')];this[_0x3a14('0xa')]=_0x508dc5[_0x3a14('0xa')]||0x3;this['scheduledat']=_0x491fd0['scheduledat'];this[_0x3a14('0xb')]=_0x491fd0[_0x3a14('0xb')];this[_0x3a14('0xc')]=_0x491fd0['countcongestionretry'];this[_0x3a14('0xd')]=_0x491fd0[_0x3a14('0xd')];this[_0x3a14('0xe')]=_0x491fd0['countnosuchnumberretry'];this['countdropretry']=_0x491fd0[_0x3a14('0xf')];this['countabandonedretry']=_0x491fd0[_0x3a14('0x10')];this[_0x3a14('0x11')]=_0x491fd0[_0x3a14('0x11')];this[_0x3a14('0x12')]=_0x491fd0['countagentrejectretry'];this[_0x3a14('0x13')]=_0x491fd0[_0x3a14('0x13')];this[_0x3a14('0x14')]=_0x491fd0[_0x3a14('0x14')];this[_0x3a14('0x15')]=_0x491fd0[_0x3a14('0x15')];this[_0x3a14('0x16')]=_0x491fd0[_0x3a14('0x16')];this['CampaignId']=_0x491fd0[_0x3a14('0x17')];this['idHopper']=_0x491fd0['id'];this['ContactFirstName']=_0x491fd0[_0x3a14('0x18')]['firstName']||'';this[_0x3a14('0x19')]=moment()[_0x3a14('0x1a')](_0x3a14('0x1b'));this[_0x3a14('0x1c')]=_0x491fd0[_0x3a14('0x1c')];this[_0x3a14('0x1d')]=_0x491fd0[_0x3a14('0x1d')];this[_0x3a14('0x1e')]=_0x491fd0[_0x3a14('0x1e')];this['recallme']=_0x491fd0['recallme'];this[_0x3a14('0x1f')]='';this[_0x3a14('0x20')]='';}Action[_0x3a14('0x21')][_0x3a14('0x22')]=function(){return util[_0x3a14('0x1a')](_0x3a14('0x23'),this['name'],this['voiceQueue'][_0x3a14('0x24')]>0x0?this['number'][_0x3a14('0x25')](this[_0x3a14('0x26')][_0x3a14('0x24')]):this[_0x3a14('0x27')]);};Action[_0x3a14('0x21')][_0x3a14('0x28')]=function(){return this[_0x3a14('0x7')];};module[_0x3a14('0x29')]=Action; \ No newline at end of file +var _0x3e39=['countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','substring','dialCutDigit','exports','util','lodash','moment','isNil','string','uniqueid','name','phone','Contact','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x3e39,0xf1));var _0x93e3=function(_0xcc8d52,_0x432134){_0xcc8d52=_0xcc8d52-0x0;var _0x366748=_0x3e39[_0xcc8d52];return _0x366748;};'use strict';var util=require(_0x93e3('0x0'));var _=require(_0x93e3('0x1'));var moment=require(_0x93e3('0x2'));function checkNameSurname(_0x4589f2,_0x1a3b69,_0x2fed28){var _0x40c9c8='';if(!_[_0x93e3('0x3')](_0x1a3b69)&&_0x93e3('0x4')===typeof _0x1a3b69){_0x40c9c8+=_0x1a3b69;}if(!_[_0x93e3('0x3')](_0x2fed28)&&_0x93e3('0x4')===typeof _0x2fed28){_0x40c9c8+='\x20'+_0x2fed28;}if(_0x40c9c8!==''){return _0x40c9c8;}return _0x4589f2;}function Action(_0x16b27c,_0xc48c5e,_0x49f0a6){this['voiceQueue']=_0x16b27c;this[_0x93e3('0x5')]=_0x49f0a6||undefined;this[_0x93e3('0x6')]=checkNameSurname(_0xc48c5e['Contact'][_0x93e3('0x7')],_0xc48c5e[_0x93e3('0x8')][_0x93e3('0x9')],_0xc48c5e[_0x93e3('0x8')][_0x93e3('0xa')]);this[_0x93e3('0xb')]=_0xc48c5e['phone'];this[_0x93e3('0xc')]=_0x16b27c['name'];this[_0x93e3('0xd')]=_0xc48c5e['active']||![];this[_0x93e3('0xe')]=_0x16b27c[_0x93e3('0xe')];this[_0x93e3('0xf')]=_0x16b27c[_0x93e3('0xf')]||0x3;this[_0x93e3('0x10')]=_0xc48c5e[_0x93e3('0x10')];this['countbusyretry']=_0xc48c5e[_0x93e3('0x11')];this[_0x93e3('0x12')]=_0xc48c5e[_0x93e3('0x12')];this[_0x93e3('0x13')]=_0xc48c5e[_0x93e3('0x13')];this[_0x93e3('0x14')]=_0xc48c5e[_0x93e3('0x14')];this['countdropretry']=_0xc48c5e['countdropretry'];this[_0x93e3('0x15')]=_0xc48c5e[_0x93e3('0x15')];this[_0x93e3('0x16')]=_0xc48c5e['countmachineretry'];this[_0x93e3('0x17')]=_0xc48c5e[_0x93e3('0x17')];this['ContactId']=_0xc48c5e[_0x93e3('0x18')];this['ListId']=_0xc48c5e[_0x93e3('0x19')];this[_0x93e3('0x1a')]=_0xc48c5e['UserId'];this[_0x93e3('0x1b')]=_0xc48c5e[_0x93e3('0x1b')];this[_0x93e3('0x1c')]=_0xc48c5e[_0x93e3('0x1c')];this[_0x93e3('0x1d')]=_0xc48c5e['id'];this[_0x93e3('0x1e')]=_0xc48c5e[_0x93e3('0x8')][_0x93e3('0x9')]||'';this['starttime']=moment()[_0x93e3('0x1f')](_0x93e3('0x20'));this[_0x93e3('0x21')]=_0xc48c5e['callback'];this[_0x93e3('0x22')]=_0xc48c5e[_0x93e3('0x22')];this[_0x93e3('0x23')]=_0xc48c5e['callbackat'];this[_0x93e3('0x24')]=_0xc48c5e[_0x93e3('0x24')];this[_0x93e3('0x25')]='';this['originatecalleridname']='';}Action[_0x93e3('0x26')][_0x93e3('0x27')]=function(){return util[_0x93e3('0x1f')](_0x93e3('0x28'),this[_0x93e3('0x6')],this['voiceQueue']['dialCutDigit']>0x0?this[_0x93e3('0xb')][_0x93e3('0x29')](this['voiceQueue'][_0x93e3('0x2a')]):this['number']);};Action[_0x93e3('0x26')]['getQueue']=function(){return this[_0x93e3('0xc')];};module[_0x93e3('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 5eccc35..a994429 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2015=['campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','number','starttime','responsetime','answertime','endtime','format','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type'];(function(_0x558f9a,_0x3b59bd){var _0x45a8db=function(_0x565577){while(--_0x565577){_0x558f9a['push'](_0x558f9a['shift']());}};_0x45a8db(++_0x3b59bd);}(_0x2015,0x193));var _0x5201=function(_0x44d0b2,_0x586fc4){_0x44d0b2=_0x44d0b2-0x0;var _0x40af0c=_0x2015[_0x44d0b2];return _0x40af0c;};'use strict';var util=require(_0x5201('0x0'));var _=require(_0x5201('0x1'));var moment=require(_0x5201('0x2'));function getSeconds(_0x12599f,_0x3d88da){var _0x3ab2d0=moment(_0x12599f)[_0x5201('0x3')](0x0);var _0x137f29=moment(_0x3d88da)['milliseconds'](0x0);return _0x3ab2d0[_0x5201('0x4')](_0x137f29,_0x5201('0x5'));}function AgentComplete(_0x167e67,_0x10e33b){this[_0x5201('0x6')]=0x4;this[_0x5201('0x7')]=_0x5201('0x8');this[_0x5201('0x9')]=_0x167e67[_0x5201('0x9')];this[_0x5201('0xa')]=_0x167e67['type'];this[_0x5201('0xb')]=_0x167e67[_0x5201('0xa')]==='outbound'?_0x5201('0xc'):_0x167e67[_0x5201('0xa')];this[_0x5201('0xd')]=_0x167e67['countbusyretry'];this[_0x5201('0xe')]=_0x167e67[_0x5201('0xe')];this[_0x5201('0xf')]=_0x167e67[_0x5201('0xf')];this[_0x5201('0x10')]=_0x167e67[_0x5201('0xd')]+_0x167e67[_0x5201('0xe')]+_0x167e67[_0x5201('0xf')]+_0x167e67[_0x5201('0x11')]+_0x167e67[_0x5201('0x12')]+_0x167e67[_0x5201('0x13')]+_0x167e67[_0x5201('0x14')]+_0x167e67['countagentrejectretry'];this[_0x5201('0x11')]=_0x167e67[_0x5201('0x11')];this['countdropretry']=_0x167e67['countdropretry'];this[_0x5201('0x13')]=_0x167e67[_0x5201('0x13')];this[_0x5201('0x14')]=_0x167e67['countmachineretry'];this['countagentrejectretry']=_0x167e67[_0x5201('0x15')];this['uniqueid']=_0x10e33b[_0x5201('0x16')];this['calleridname']=_0x167e67[_0x5201('0x17')];this['calleridnum']=_0x167e67[_0x5201('0x18')];this[_0x5201('0x19')]=_0x167e67[_0x5201('0x19')];this[_0x5201('0x1a')]=_0x167e67['responsetime'];this['answertime']=_0x167e67[_0x5201('0x1b')];this[_0x5201('0x1c')]=moment()[_0x5201('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x5201('0x1e')]=getSeconds(_0x167e67[_0x5201('0x1a')],_0x167e67[_0x5201('0x19')]);this[_0x5201('0x1f')]=getSeconds(_0x167e67[_0x5201('0x1b')],_0x167e67['responsetime']);this[_0x5201('0x20')]=getSeconds(this[_0x5201('0x1c')],_0x167e67[_0x5201('0x1b')]);this[_0x5201('0xc')]=_0x10e33b[_0x5201('0xc')];this[_0x5201('0x21')]=_0x10e33b[_0x5201('0x21')];this['reason']=_0x10e33b[_0x5201('0x22')];this[_0x5201('0x23')]=_0x167e67[_0x5201('0x23')];this[_0x5201('0x24')]=_0x167e67[_0x5201('0x24')];this[_0x5201('0x25')]=_0x167e67[_0x5201('0x25')];this[_0x5201('0x26')]=_0x167e67[_0x5201('0x26')];this[_0x5201('0x27')]=_0x167e67['ContactId'];this[_0x5201('0x28')]=_0x167e67[_0x5201('0x28')];this['UserId']=_0x167e67[_0x5201('0x29')];this['VoiceQueueId']=_0x167e67['VoiceQueueId'];this[_0x5201('0x2a')]=_0x167e67[_0x5201('0x2a')];this[_0x5201('0x2b')]=_0x167e67['originatecalleridnum']||'';this['originatecalleridname']=_0x167e67[_0x5201('0x2c')]||'';}module[_0x5201('0x2d')]=AgentComplete; \ No newline at end of file +var _0xb9c2=['util','moment','milliseconds','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','uniqueid','calleridname','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','starttime','holdtime','talktime','membername','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb9c2,0x1ce));var _0x2b9c=function(_0x10d670,_0x178996){_0x10d670=_0x10d670-0x0;var _0x20d6f8=_0xb9c2[_0x10d670];return _0x20d6f8;};'use strict';var util=require(_0x2b9c('0x0'));var _=require('lodash');var moment=require(_0x2b9c('0x1'));function getSeconds(_0x391156,_0x22c5ac){var _0x11b140=moment(_0x391156)['milliseconds'](0x0);var _0x4037f4=moment(_0x22c5ac)[_0x2b9c('0x2')](0x0);return _0x11b140['diff'](_0x4037f4,'seconds');}function AgentComplete(_0x44d7b2,_0x55eb0f){this['state']=0x4;this['statedesc']=_0x2b9c('0x3');this[_0x2b9c('0x4')]=_0x44d7b2[_0x2b9c('0x4')];this[_0x2b9c('0x5')]=_0x44d7b2[_0x2b9c('0x5')];this[_0x2b9c('0x6')]=_0x44d7b2['type']===_0x2b9c('0x7')?_0x2b9c('0x8'):_0x44d7b2[_0x2b9c('0x5')];this[_0x2b9c('0x9')]=_0x44d7b2[_0x2b9c('0x9')];this['countcongestionretry']=_0x44d7b2['countcongestionretry'];this[_0x2b9c('0xa')]=_0x44d7b2['countnoanswerretry'];this[_0x2b9c('0xb')]=_0x44d7b2[_0x2b9c('0x9')]+_0x44d7b2[_0x2b9c('0xc')]+_0x44d7b2['countnoanswerretry']+_0x44d7b2['countnosuchnumberretry']+_0x44d7b2[_0x2b9c('0xd')]+_0x44d7b2['countabandonedretry']+_0x44d7b2[_0x2b9c('0xe')]+_0x44d7b2[_0x2b9c('0xf')];this[_0x2b9c('0x10')]=_0x44d7b2[_0x2b9c('0x10')];this[_0x2b9c('0xd')]=_0x44d7b2['countdropretry'];this[_0x2b9c('0x11')]=_0x44d7b2[_0x2b9c('0x11')];this[_0x2b9c('0xe')]=_0x44d7b2[_0x2b9c('0xe')];this[_0x2b9c('0xf')]=_0x44d7b2['countagentrejectretry'];this[_0x2b9c('0x12')]=_0x55eb0f[_0x2b9c('0x12')];this[_0x2b9c('0x13')]=_0x44d7b2['name'];this['calleridnum']=_0x44d7b2['number'];this['starttime']=_0x44d7b2['starttime'];this[_0x2b9c('0x14')]=_0x44d7b2['responsetime'];this['answertime']=_0x44d7b2[_0x2b9c('0x15')];this[_0x2b9c('0x16')]=moment()[_0x2b9c('0x17')](_0x2b9c('0x18'));this[_0x2b9c('0x19')]=getSeconds(_0x44d7b2[_0x2b9c('0x14')],_0x44d7b2[_0x2b9c('0x1a')]);this[_0x2b9c('0x1b')]=getSeconds(_0x44d7b2[_0x2b9c('0x15')],_0x44d7b2[_0x2b9c('0x14')]);this[_0x2b9c('0x1c')]=getSeconds(this[_0x2b9c('0x16')],_0x44d7b2[_0x2b9c('0x15')]);this[_0x2b9c('0x8')]=_0x55eb0f['queue'];this[_0x2b9c('0x1d')]=_0x55eb0f[_0x2b9c('0x1d')];this[_0x2b9c('0x1e')]=_0x55eb0f[_0x2b9c('0x1e')];this[_0x2b9c('0x1f')]=_0x44d7b2[_0x2b9c('0x1f')];this[_0x2b9c('0x20')]=_0x44d7b2[_0x2b9c('0x20')];this['callbackat']=_0x44d7b2['callbackat'];this[_0x2b9c('0x21')]=_0x44d7b2[_0x2b9c('0x21')];this['ContactId']=_0x44d7b2[_0x2b9c('0x22')];this[_0x2b9c('0x23')]=_0x44d7b2[_0x2b9c('0x23')];this[_0x2b9c('0x24')]=_0x44d7b2[_0x2b9c('0x24')];this[_0x2b9c('0x25')]=_0x44d7b2[_0x2b9c('0x25')];this[_0x2b9c('0x26')]=_0x44d7b2[_0x2b9c('0x26')];this[_0x2b9c('0x27')]=_0x44d7b2[_0x2b9c('0x27')]||'';this['originatecalleridname']=_0x44d7b2[_0x2b9c('0x28')]||'';}module[_0x2b9c('0x29')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 99e9691..f4330c8 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec39=['countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x15d7df,_0x203f59){var _0x404fd8=function(_0x407a90){while(--_0x407a90){_0x15d7df['push'](_0x15d7df['shift']());}};_0x404fd8(++_0x203f59);}(_0xec39,0x19f));var _0x9ec3=function(_0x2ef335,_0x488e5f){_0x2ef335=_0x2ef335-0x0;var _0x3b4c5b=_0xec39[_0x2ef335];return _0x3b4c5b;};'use strict';var util=require(_0x9ec3('0x0'));var _=require(_0x9ec3('0x1'));var moment=require(_0x9ec3('0x2'));function getSeconds(_0x3ea667,_0x1fc7a7){var _0xb3d117=moment(_0x3ea667)[_0x9ec3('0x3')](0x0);var _0x5c0885=moment(_0x1fc7a7)[_0x9ec3('0x3')](0x0);return _0xb3d117[_0x9ec3('0x4')](_0x5c0885,_0x9ec3('0x5'));}function Final(_0x4a3996){this['uniqueid']=_0x4a3996['uniqueid'];this[_0x9ec3('0x6')]=_0x4a3996[_0x9ec3('0x6')];this[_0x9ec3('0x7')]=_0x4a3996['type'];this[_0x9ec3('0x8')]=_0x4a3996[_0x9ec3('0x7')]===_0x9ec3('0x9')?_0x9ec3('0xa'):_0x4a3996[_0x9ec3('0x7')];this[_0x9ec3('0xb')]=_0x4a3996[_0x9ec3('0xb')];this['countcongestionretry']=_0x4a3996[_0x9ec3('0xc')];this[_0x9ec3('0xd')]=_0x4a3996[_0x9ec3('0xd')];this[_0x9ec3('0xe')]=_0x4a3996[_0x9ec3('0xb')]+_0x4a3996[_0x9ec3('0xc')]+_0x4a3996[_0x9ec3('0xd')]+_0x4a3996['countnosuchnumberretry']+_0x4a3996[_0x9ec3('0xf')]+_0x4a3996[_0x9ec3('0x10')]+_0x4a3996[_0x9ec3('0x11')]+_0x4a3996['countagentrejectretry'];this[_0x9ec3('0x12')]=_0x4a3996['countnosuchnumberretry'];this[_0x9ec3('0xf')]=_0x4a3996[_0x9ec3('0xf')];this[_0x9ec3('0x10')]=_0x4a3996[_0x9ec3('0x10')];this[_0x9ec3('0x11')]=_0x4a3996[_0x9ec3('0x11')];this[_0x9ec3('0x13')]=_0x4a3996[_0x9ec3('0x13')];this[_0x9ec3('0xa')]=_0x4a3996['queue'];this[_0x9ec3('0x14')]=_0x4a3996['calleridname'];this['calleridnum']=_0x4a3996[_0x9ec3('0x15')];this[_0x9ec3('0x16')]=_0x4a3996[_0x9ec3('0x16')];this[_0x9ec3('0x17')]=_0x4a3996[_0x9ec3('0x17')];this['endtime']=_0x4a3996[_0x9ec3('0x17')];this['ringtime']=_0x4a3996[_0x9ec3('0x18')]||0x0;this['holdtime']=_0x4a3996[_0x9ec3('0x19')]||0x0;this[_0x9ec3('0x1a')]=_0x4a3996[_0x9ec3('0x1a')]||0x0;this['callback']=_0x4a3996[_0x9ec3('0x1b')];this['callbackuniqueid']=_0x4a3996[_0x9ec3('0x1c')];this['callbackat']=_0x4a3996[_0x9ec3('0x1d')];this[_0x9ec3('0x1e')]=_0x4a3996[_0x9ec3('0x1e')];this[_0x9ec3('0x1f')]=_0x4a3996[_0x9ec3('0x1f')];this[_0x9ec3('0x20')]=_0x4a3996[_0x9ec3('0x20')];this['UserId']=_0x4a3996[_0x9ec3('0x21')];this[_0x9ec3('0x22')]=_0x4a3996[_0x9ec3('0x22')];this[_0x9ec3('0x23')]=_0x4a3996[_0x9ec3('0x23')];this[_0x9ec3('0x24')]=_0x4a3996[_0x9ec3('0x24')]||'';this[_0x9ec3('0x25')]=_0x4a3996[_0x9ec3('0x25')]||'';}module[_0x9ec3('0x26')]=Final; \ No newline at end of file +var _0x6f47=['responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime'];(function(_0x19e57f,_0x4ae750){var _0x469556=function(_0xf6968b){while(--_0xf6968b){_0x19e57f['push'](_0x19e57f['shift']());}};_0x469556(++_0x4ae750);}(_0x6f47,0xc7));var _0x76f4=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x6f47[_0x3ab9ee];return _0x82ee88;};'use strict';var util=require('util');var _=require(_0x76f4('0x0'));var moment=require(_0x76f4('0x1'));function getSeconds(_0x5bc799,_0x2092f3){var _0x5765c1=moment(_0x5bc799)[_0x76f4('0x2')](0x0);var _0x47d3e1=moment(_0x2092f3)[_0x76f4('0x2')](0x0);return _0x5765c1[_0x76f4('0x3')](_0x47d3e1,_0x76f4('0x4'));}function Final(_0x2523ba){this['uniqueid']=_0x2523ba[_0x76f4('0x5')];this[_0x76f4('0x6')]=_0x2523ba[_0x76f4('0x6')];this['type']=_0x2523ba[_0x76f4('0x7')];this[_0x76f4('0x8')]=_0x2523ba[_0x76f4('0x7')]===_0x76f4('0x9')?_0x76f4('0xa'):_0x2523ba['type'];this['countbusyretry']=_0x2523ba[_0x76f4('0xb')];this[_0x76f4('0xc')]=_0x2523ba['countcongestionretry'];this['countnoanswerretry']=_0x2523ba[_0x76f4('0xd')];this[_0x76f4('0xe')]=_0x2523ba[_0x76f4('0xb')]+_0x2523ba[_0x76f4('0xc')]+_0x2523ba[_0x76f4('0xd')]+_0x2523ba[_0x76f4('0xf')]+_0x2523ba[_0x76f4('0x10')]+_0x2523ba[_0x76f4('0x11')]+_0x2523ba[_0x76f4('0x12')]+_0x2523ba['countagentrejectretry'];this[_0x76f4('0xf')]=_0x2523ba[_0x76f4('0xf')];this['countdropretry']=_0x2523ba['countdropretry'];this['countabandonedretry']=_0x2523ba[_0x76f4('0x11')];this[_0x76f4('0x12')]=_0x2523ba[_0x76f4('0x12')];this[_0x76f4('0x13')]=_0x2523ba[_0x76f4('0x13')];this[_0x76f4('0xa')]=_0x2523ba[_0x76f4('0xa')];this[_0x76f4('0x14')]=_0x2523ba[_0x76f4('0x14')];this[_0x76f4('0x15')]=_0x2523ba[_0x76f4('0x15')];this[_0x76f4('0x16')]=_0x2523ba[_0x76f4('0x16')];this[_0x76f4('0x17')]=_0x2523ba[_0x76f4('0x17')];this[_0x76f4('0x18')]=_0x2523ba[_0x76f4('0x17')];this[_0x76f4('0x19')]=_0x2523ba[_0x76f4('0x19')]||0x0;this[_0x76f4('0x1a')]=_0x2523ba[_0x76f4('0x1a')]||0x0;this[_0x76f4('0x1b')]=_0x2523ba['talktime']||0x0;this[_0x76f4('0x1c')]=_0x2523ba['callback'];this[_0x76f4('0x1d')]=_0x2523ba[_0x76f4('0x1d')];this[_0x76f4('0x1e')]=_0x2523ba['callbackat'];this['recallme']=_0x2523ba['recallme'];this[_0x76f4('0x1f')]=_0x2523ba[_0x76f4('0x1f')];this[_0x76f4('0x20')]=_0x2523ba[_0x76f4('0x20')];this[_0x76f4('0x21')]=_0x2523ba[_0x76f4('0x21')];this[_0x76f4('0x22')]=_0x2523ba['VoiceQueueId'];this['CampaignId']=_0x2523ba[_0x76f4('0x23')];this['originatecalleridnum']=_0x2523ba[_0x76f4('0x24')]||'';this['originatecalleridname']=_0x2523ba['originatecalleridname']||'';}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index f465d51..f187a56 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x38e5=['uniqueid','calleridname','calleridnum','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','queue','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry'];(function(_0x1043d2,_0x150810){var _0x426552=function(_0x533901){while(--_0x533901){_0x1043d2['push'](_0x1043d2['shift']());}};_0x426552(++_0x150810);}(_0x38e5,0x145));var _0x538e=function(_0x44c5e0,_0x80fddb){_0x44c5e0=_0x44c5e0-0x0;var _0x151991=_0x38e5[_0x44c5e0];return _0x151991;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x538e('0x0'));function getSeconds(_0x1bef92,_0x2e6a38){var _0x4a6aa1=moment(_0x1bef92)[_0x538e('0x1')](0x0);var _0x5097ec=moment(_0x2e6a38)[_0x538e('0x1')](0x0);return _0x4a6aa1['diff'](_0x5097ec,_0x538e('0x2'));}function Hangup(_0x11fa38,_0x3b5288){this[_0x538e('0x3')]=0x4;this[_0x538e('0x4')]=_0x538e('0x5');this[_0x538e('0x6')]=_0x11fa38[_0x538e('0x6')];this[_0x538e('0x7')]=_0x11fa38[_0x538e('0x7')];this[_0x538e('0x8')]=_0x11fa38[_0x538e('0x7')]===_0x538e('0x9')?'queue':_0x11fa38['type'];this[_0x538e('0xa')]=_0x11fa38[_0x538e('0xa')];this[_0x538e('0xb')]=_0x11fa38[_0x538e('0xb')];this[_0x538e('0xc')]=_0x11fa38[_0x538e('0xc')];this[_0x538e('0xd')]=_0x11fa38['countbusyretry']+_0x11fa38[_0x538e('0xb')]+_0x11fa38[_0x538e('0xc')]+_0x11fa38[_0x538e('0xe')]+_0x11fa38[_0x538e('0xf')]+_0x11fa38[_0x538e('0x10')]+_0x11fa38['countmachineretry']+_0x11fa38[_0x538e('0x11')];this[_0x538e('0xe')]=_0x11fa38['countnosuchnumberretry'];this['countdropretry']=_0x11fa38[_0x538e('0xf')];this[_0x538e('0x10')]=_0x11fa38['countabandonedretry'];this[_0x538e('0x12')]=_0x11fa38['countmachineretry'];this[_0x538e('0x11')]=_0x11fa38['countagentrejectretry'];this[_0x538e('0x13')]=_0x3b5288[_0x538e('0x13')];this[_0x538e('0x14')]=_0x11fa38['name'];this[_0x538e('0x15')]=_0x11fa38[_0x538e('0x16')];this[_0x538e('0x17')]=_0x11fa38['starttime'];this[_0x538e('0x18')]=_0x11fa38[_0x538e('0x18')];this['endtime']=moment()[_0x538e('0x19')](_0x538e('0x1a'));this[_0x538e('0x1b')]=getSeconds(_0x11fa38['responsetime'],_0x11fa38[_0x538e('0x17')]);this[_0x538e('0x1c')]=0x0;this[_0x538e('0x1d')]=getSeconds(this[_0x538e('0x1e')],_0x11fa38['responsetime']);this[_0x538e('0x1f')]=_0x11fa38[_0x538e('0x1f')];this['membername']='IVR';this[_0x538e('0x20')]=_0x3b5288['cause-txt'];this[_0x538e('0x21')]=_0x11fa38[_0x538e('0x21')];this[_0x538e('0x22')]=_0x11fa38[_0x538e('0x22')];this['callbackat']=_0x11fa38[_0x538e('0x23')];this[_0x538e('0x24')]=_0x11fa38[_0x538e('0x24')];this['ContactId']=_0x11fa38[_0x538e('0x25')];this[_0x538e('0x26')]=_0x11fa38[_0x538e('0x26')];this[_0x538e('0x27')]=_0x11fa38['UserId'];this[_0x538e('0x28')]=_0x11fa38['VoiceQueueId'];this['CampaignId']=_0x11fa38[_0x538e('0x29')];}module[_0x538e('0x2a')]=Hangup; \ No newline at end of file +var _0x5fa5=['CampaignId','exports','util','lodash','moment','milliseconds','state','Answer','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','uniqueid','calleridname','number','starttime','responsetime','endtime','format','ringtime','talktime','queue','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x156339,_0x1bd96e){var _0x1932c7=function(_0x407390){while(--_0x407390){_0x156339['push'](_0x156339['shift']());}};_0x1932c7(++_0x1bd96e);}(_0x5fa5,0x192));var _0x55fa=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x5fa5[_0x16b9ed];return _0x66b1f8;};'use strict';var util=require(_0x55fa('0x0'));var _=require(_0x55fa('0x1'));var moment=require(_0x55fa('0x2'));function getSeconds(_0x296c34,_0x464337){var _0x2ec5b6=moment(_0x296c34)[_0x55fa('0x3')](0x0);var _0x30bc1a=moment(_0x464337)[_0x55fa('0x3')](0x0);return _0x2ec5b6['diff'](_0x30bc1a,'seconds');}function Hangup(_0x44b206,_0x3751){this[_0x55fa('0x4')]=0x4;this['statedesc']=_0x55fa('0x5');this[_0x55fa('0x6')]=_0x44b206[_0x55fa('0x6')];this[_0x55fa('0x7')]=_0x44b206[_0x55fa('0x7')];this['campaigntype']=_0x44b206[_0x55fa('0x7')]==='outbound'?'queue':_0x44b206[_0x55fa('0x7')];this[_0x55fa('0x8')]=_0x44b206['countbusyretry'];this[_0x55fa('0x9')]=_0x44b206['countcongestionretry'];this[_0x55fa('0xa')]=_0x44b206['countnoanswerretry'];this['countglobal']=_0x44b206[_0x55fa('0x8')]+_0x44b206[_0x55fa('0x9')]+_0x44b206[_0x55fa('0xa')]+_0x44b206[_0x55fa('0xb')]+_0x44b206['countdropretry']+_0x44b206[_0x55fa('0xc')]+_0x44b206['countmachineretry']+_0x44b206[_0x55fa('0xd')];this[_0x55fa('0xb')]=_0x44b206[_0x55fa('0xb')];this[_0x55fa('0xe')]=_0x44b206[_0x55fa('0xe')];this[_0x55fa('0xc')]=_0x44b206[_0x55fa('0xc')];this[_0x55fa('0xf')]=_0x44b206[_0x55fa('0xf')];this[_0x55fa('0xd')]=_0x44b206[_0x55fa('0xd')];this[_0x55fa('0x10')]=_0x3751[_0x55fa('0x10')];this[_0x55fa('0x11')]=_0x44b206['name'];this['calleridnum']=_0x44b206[_0x55fa('0x12')];this[_0x55fa('0x13')]=_0x44b206[_0x55fa('0x13')];this[_0x55fa('0x14')]=_0x44b206[_0x55fa('0x14')];this[_0x55fa('0x15')]=moment()[_0x55fa('0x16')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x55fa('0x17')]=getSeconds(_0x44b206[_0x55fa('0x14')],_0x44b206[_0x55fa('0x13')]);this['holdtime']=0x0;this[_0x55fa('0x18')]=getSeconds(this[_0x55fa('0x15')],_0x44b206[_0x55fa('0x14')]);this[_0x55fa('0x19')]=_0x44b206[_0x55fa('0x19')];this[_0x55fa('0x1a')]=_0x55fa('0x1b');this[_0x55fa('0x1c')]=_0x3751[_0x55fa('0x1d')];this[_0x55fa('0x1e')]=_0x44b206['callback'];this[_0x55fa('0x1f')]=_0x44b206['callbackuniqueid'];this[_0x55fa('0x20')]=_0x44b206[_0x55fa('0x20')];this[_0x55fa('0x21')]=_0x44b206[_0x55fa('0x21')];this['ContactId']=_0x44b206[_0x55fa('0x22')];this['ListId']=_0x44b206[_0x55fa('0x23')];this['UserId']=_0x44b206[_0x55fa('0x24')];this[_0x55fa('0x25')]=_0x44b206['VoiceQueueId'];this['CampaignId']=_0x44b206[_0x55fa('0x26')];}module[_0x55fa('0x27')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index eac0a0c..4c9fcd6 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea20=['originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','queue','name','number','responsetime','ringtime','starttime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x35f12a,_0x21f414){var _0x21864d=function(_0x4ff3af){while(--_0x4ff3af){_0x35f12a['push'](_0x35f12a['shift']());}};_0x21864d(++_0x21f414);}(_0xea20,0x123));var _0x0ea2=function(_0x5da60a,_0x1b3ff6){_0x5da60a=_0x5da60a-0x0;var _0x739eb4=_0xea20[_0x5da60a];return _0x739eb4;};'use strict';var util=require(_0x0ea2('0x0'));var _=require(_0x0ea2('0x1'));var moment=require('moment');function getSeconds(_0x12f202,_0x30d9d6){var _0x445838=moment(_0x12f202)[_0x0ea2('0x2')](0x0);var _0x5004a0=moment(_0x30d9d6)['milliseconds'](0x0);return _0x445838[_0x0ea2('0x3')](_0x5004a0,'seconds');}function History(_0x1efad9){this['uniqueid']=_0x1efad9['uniqueid'];this[_0x0ea2('0x4')]=_0x1efad9['scheduledat']||undefined;this[_0x0ea2('0x5')]=_0x1efad9[_0x0ea2('0x5')];this[_0x0ea2('0x6')]=_0x1efad9[_0x0ea2('0x5')]===_0x0ea2('0x7')?'queue':_0x1efad9[_0x0ea2('0x5')];this[_0x0ea2('0x8')]=_0x1efad9['countbusyretry'];this[_0x0ea2('0x9')]=_0x1efad9['countcongestionretry'];this['countnoanswerretry']=_0x1efad9[_0x0ea2('0xa')];this[_0x0ea2('0xb')]=_0x1efad9[_0x0ea2('0x8')]+_0x1efad9['countcongestionretry']+_0x1efad9[_0x0ea2('0xa')]+_0x1efad9[_0x0ea2('0xc')]+_0x1efad9['countdropretry']+_0x1efad9[_0x0ea2('0xd')]+_0x1efad9['countmachineretry']+_0x1efad9[_0x0ea2('0xe')];this['countnosuchnumberretry']=_0x1efad9['countnosuchnumberretry'];this['countdropretry']=_0x1efad9[_0x0ea2('0xf')];this[_0x0ea2('0xd')]=_0x1efad9[_0x0ea2('0xd')];this['countmachineretry']=_0x1efad9['countmachineretry'];this[_0x0ea2('0xe')]=_0x1efad9[_0x0ea2('0xe')];this[_0x0ea2('0x10')]=_0x1efad9[_0x0ea2('0x10')];this['calleridname']=_0x1efad9[_0x0ea2('0x11')];this['calleridnum']=_0x1efad9[_0x0ea2('0x12')];this['starttime']=_0x1efad9['starttime'];this[_0x0ea2('0x13')]=_0x1efad9[_0x0ea2('0x13')];this['endtime']=_0x1efad9[_0x0ea2('0x13')];this[_0x0ea2('0x14')]=getSeconds(_0x1efad9[_0x0ea2('0x13')],_0x1efad9[_0x0ea2('0x15')]);this[_0x0ea2('0x16')]=0x0;this[_0x0ea2('0x17')]=0x0;this['callback']=_0x1efad9[_0x0ea2('0x18')];this[_0x0ea2('0x19')]=_0x1efad9[_0x0ea2('0x19')];this[_0x0ea2('0x1a')]=_0x1efad9[_0x0ea2('0x1a')];this[_0x0ea2('0x1b')]=_0x1efad9['recallme'];this['ContactId']=_0x1efad9[_0x0ea2('0x1c')];this['ListId']=_0x1efad9[_0x0ea2('0x1d')];this[_0x0ea2('0x1e')]=_0x1efad9['UserId'];this[_0x0ea2('0x1f')]=_0x1efad9[_0x0ea2('0x1f')];this[_0x0ea2('0x20')]=_0x1efad9[_0x0ea2('0x20')];this[_0x0ea2('0x21')]=_0x1efad9[_0x0ea2('0x21')]||'';this['originatecalleridname']=_0x1efad9[_0x0ea2('0x22')]||'';}module[_0x0ea2('0x23')]=History; \ No newline at end of file +var _0x49d6=['moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','name','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash'];(function(_0x18fe54,_0xff789){var _0xccb1ee=function(_0x513cf3){while(--_0x513cf3){_0x18fe54['push'](_0x18fe54['shift']());}};_0xccb1ee(++_0xff789);}(_0x49d6,0x15d));var _0x649d=function(_0x395d9f,_0x17b843){_0x395d9f=_0x395d9f-0x0;var _0x28609e=_0x49d6[_0x395d9f];return _0x28609e;};'use strict';var util=require(_0x649d('0x0'));var _=require(_0x649d('0x1'));var moment=require(_0x649d('0x2'));function getSeconds(_0x4321c8,_0x23084e){var _0x7ea5e3=moment(_0x4321c8)[_0x649d('0x3')](0x0);var _0x40919e=moment(_0x23084e)[_0x649d('0x3')](0x0);return _0x7ea5e3[_0x649d('0x4')](_0x40919e,'seconds');}function History(_0x1d182b){this[_0x649d('0x5')]=_0x1d182b[_0x649d('0x5')];this[_0x649d('0x6')]=_0x1d182b[_0x649d('0x6')]||undefined;this['type']=_0x1d182b[_0x649d('0x7')];this[_0x649d('0x8')]=_0x1d182b[_0x649d('0x7')]===_0x649d('0x9')?_0x649d('0xa'):_0x1d182b[_0x649d('0x7')];this[_0x649d('0xb')]=_0x1d182b['countbusyretry'];this[_0x649d('0xc')]=_0x1d182b[_0x649d('0xc')];this[_0x649d('0xd')]=_0x1d182b[_0x649d('0xd')];this[_0x649d('0xe')]=_0x1d182b[_0x649d('0xb')]+_0x1d182b['countcongestionretry']+_0x1d182b[_0x649d('0xd')]+_0x1d182b[_0x649d('0xf')]+_0x1d182b[_0x649d('0x10')]+_0x1d182b[_0x649d('0x11')]+_0x1d182b['countmachineretry']+_0x1d182b[_0x649d('0x12')];this[_0x649d('0xf')]=_0x1d182b['countnosuchnumberretry'];this[_0x649d('0x10')]=_0x1d182b[_0x649d('0x10')];this[_0x649d('0x11')]=_0x1d182b['countabandonedretry'];this[_0x649d('0x13')]=_0x1d182b[_0x649d('0x13')];this[_0x649d('0x12')]=_0x1d182b[_0x649d('0x12')];this['queue']=_0x1d182b['queue'];this[_0x649d('0x14')]=_0x1d182b[_0x649d('0x15')];this['calleridnum']=_0x1d182b['number'];this[_0x649d('0x16')]=_0x1d182b['starttime'];this[_0x649d('0x17')]=_0x1d182b[_0x649d('0x17')];this['endtime']=_0x1d182b['responsetime'];this[_0x649d('0x18')]=getSeconds(_0x1d182b['responsetime'],_0x1d182b[_0x649d('0x16')]);this[_0x649d('0x19')]=0x0;this[_0x649d('0x1a')]=0x0;this[_0x649d('0x1b')]=_0x1d182b[_0x649d('0x1b')];this['callbackuniqueid']=_0x1d182b[_0x649d('0x1c')];this[_0x649d('0x1d')]=_0x1d182b[_0x649d('0x1d')];this[_0x649d('0x1e')]=_0x1d182b[_0x649d('0x1e')];this[_0x649d('0x1f')]=_0x1d182b['ContactId'];this[_0x649d('0x20')]=_0x1d182b[_0x649d('0x20')];this[_0x649d('0x21')]=_0x1d182b[_0x649d('0x21')];this[_0x649d('0x22')]=_0x1d182b[_0x649d('0x22')];this['CampaignId']=_0x1d182b[_0x649d('0x23')];this['originatecalleridnum']=_0x1d182b[_0x649d('0x24')]||'';this[_0x649d('0x25')]=_0x1d182b[_0x649d('0x25')]||'';}module[_0x649d('0x26')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 6330267..c754a5c 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 _0x11e3=['updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','resolve','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','temp','[getContactDialer]\x20','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','ContactId','ListId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','reachable','SIP/%s','unmonitored','uniqueid','variable','amdstatus','xcally-motion-dialer','value','outboundAnswerAgiCallsDay','membername','AMD','custom:amd','buildObj','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','MACHINE','Machine','countglobal','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','countmachineretry','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','CampaignId','[rescheduleContact][Machine]','HANGUP','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countnosuchnumberretry','countabandonedretry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','cause-txt','Unknow','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete]','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','droptime','dialQueueTimeout','Drop','dropreason','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','[rescheduleContact][Drop]','calleridname','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','calleridnum','channel','actionid','roundrobin','locked','paused','stateinterface','queueBooked','pick','idHopper','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','resetActiveCalls','syncCampaigns','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','push','Action','command','interval','content','indexOf','true','iftime\x20%s,%s','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','handlePower','dialPowerLevel','predictive','method\x20not\x20recognized','handlePreviewRecallNotifications','Agent','user:%s','launchHandleIvr','handleIvr','checkIsTrunkReachable','checkIfTimeIntervals','[syncQueueSummary]','throttle','filter','dialPreviewRecallmeReminder','online','map','user:dialPreviewRecallReminder','dialGlobalInterval','dialTimezone','[syncCampaigns]','\x5cw{0,','pow','random','match','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','outbound','\x22%s,%s%s,,,%s\x22','dialer','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','%s%s','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','OriginateError','[originate][error]','responsetime','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','NoSuchNumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','buildNoAnswerEventPayload','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalMultiplicativeFactor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','abandonmentRate','busyFactor','[getDataPredictive]','check\x20failure','dropRate','loggedIn','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','queueStatusComplete','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','ACTIVE','[getContactDialer2]','tryOriginatePredictive','getContactDialer','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','exports','util','lodash','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictiveCalls','../ami','redis','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperBlack','./action','./history','./final','./agentComplete','./hangup','env','XCALLY_IP_AGI','rrmemory','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBookedRR','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','newexten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','getSettings','then','previewRecallmeReminderInterval','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','strategy','answered','available','sumBillable','talking','total','abandoned','waiting','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','Trunk','active','format','voice_queue:save','ivr','campaign:ivr:%s','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','isUndefined','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','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','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','debug','inspect','error','stack','undefined','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','pTalking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','[actions]','prototype','sequence','isNil','status','catch','No\x20such\x20channel'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x11e3,0x173));var _0x311e=function(_0x1a4eff,_0x405e5){_0x1a4eff=_0x1a4eff-0x0;var _0x257069=_0x11e3[_0x1a4eff];return _0x257069;};'use strict';var util=require(_0x311e('0x0'));var _=require(_0x311e('0x1'));var uuid=require('uuid');var moment=require('moment');var rr=require('rr');var md5=require(_0x311e('0x2'));var Redis=require(_0x311e('0x3'));var ut=require(_0x311e('0x4'));var config=require(_0x311e('0x5'));var logger=require(_0x311e('0x6'))('dialer');var loggerBooked=require(_0x311e('0x6'))(_0x311e('0x7'));var loggerPredictive=require(_0x311e('0x6'))('predictive');var loggerPredictiveCalls=require(_0x311e('0x6'))(_0x311e('0x8'));var loggerSyncQueueSummary=require(_0x311e('0x6'))('syncQueueSummary');var ami=require(_0x311e('0x9'));config[_0x311e('0xa')]=_['defaults'](config[_0x311e('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x311e('0xb'))(new Redis(config[_0x311e('0xa')]));var cmHopper=require(_0x311e('0xc'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x311e('0xd'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require('../rpc/setting');var Action=require(_0x311e('0xe'));var History=require(_0x311e('0xf'));var Final=require(_0x311e('0x10'));var AgentComplete=require(_0x311e('0x11'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x311e('0x12'));var ipAgi=process[_0x311e('0x13')][_0x311e('0x14')]||'127.0.0.1';var strategy={'rrmemory':_0x311e('0x15'),'roundrobin':'roundrobin'};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x48d704){this[_0x311e('0x16')]=this[_0x311e('0x16')]?this['tail'][_0x311e('0x17')](_0x48d704):_0x48d704();};function Dialer(_0x50fb28,_0x28b28c){this['sequence']=new Sequence();this[_0x311e('0x18')]=_0x28b28c;this[_0x311e('0x19')]=_0x50fb28['voiceQueues'];this[_0x311e('0x1a')]=_0x50fb28[_0x311e('0x1a')];this['agents']=_0x50fb28[_0x311e('0x1b')];this['trunks']=_0x50fb28[_0x311e('0x1c')];this[_0x311e('0x1d')]=config[_0x311e('0x1d')]||0x2;this['channels']={};this[_0x311e('0x1e')]={};this[_0x311e('0x1f')]={};this[_0x311e('0x20')]={};this[_0x311e('0x21')]={};this['startPredictive']={};this[_0x311e('0x22')]={};this[_0x311e('0x23')]={};this['queueBooked']={};this[_0x311e('0x24')]={};ami['on'](_0x311e('0x25'),this['syncAgentConnect'][_0x311e('0x26')](this));ami['on'](_0x311e('0x27'),this[_0x311e('0x28')][_0x311e('0x26')](this));ami['on'](_0x311e('0x29'),this[_0x311e('0x2a')][_0x311e('0x26')](this));ami['on'](_0x311e('0x2b'),this[_0x311e('0x2c')]['bind'](this));ami['on'](_0x311e('0x2d'),this[_0x311e('0x2e')]['bind'](this));ami['on'](_0x311e('0x2f'),this[_0x311e('0x30')][_0x311e('0x26')](this));ami['on']('hangup',this[_0x311e('0x31')][_0x311e('0x26')](this));ami['on'](_0x311e('0x32'),this['syncNewExten'][_0x311e('0x26')](this));ami['on'](_0x311e('0x33'),this[_0x311e('0x34')]['bind'](this));ami['on']('queuemember',this[_0x311e('0x35')][_0x311e('0x26')](this));ami['on'](_0x311e('0x36'),this['syncQueueStatusComplete'][_0x311e('0x26')](this));this['loopCampaigns']();this['loopClearZombieChannels']();RpcSetting[_0x311e('0x37')]()[_0x311e('0x38')](function(_0x35d70e){previewRecallmeReminderInterval=_0x35d70e[_0x311e('0x39')];});}function isNotNull(_0x2774d0){return _0x2774d0!==null&&!_['isUndefined'](_0x2774d0);}function checkIsLoggedIn(_0x34d8d2,_0x16b34f){return function(){if(_0x16b34f<=0x0){_0x34d8d2[_0x311e('0x3a')]=_0x311e('0x3b');throw _0x34d8d2[_0x311e('0x3c')]+_0x311e('0x3d');}};}function isActive(_0x18f180){return _0x18f180;}function checkIsActive(_0x3ae835,_0x3320fc){return function(){if(!isActive(_0x3320fc)){_0x3ae835[_0x311e('0x3a')]=_0x311e('0x3e');throw _0x3ae835[_0x311e('0x3c')]+_0x311e('0x3f');}};}function checkInterval(_0x169482){return function(){if(!isNotNull(_0x169482['Interval'])){_0x169482[_0x311e('0x3a')]=_0x311e('0x40');throw _0x169482['name']+_0x311e('0x41');}if(!isNotNull(_0x169482[_0x311e('0x42')][_0x311e('0x43')])){_0x169482[_0x311e('0x3a')]=_0x311e('0x40');throw _0x169482[_0x311e('0x3c')]+_0x311e('0x41');}if(!isNotNull(_[_0x311e('0x44')](_0x169482[_0x311e('0x42')][_0x311e('0x43')]))){_0x169482['message']=_0x311e('0x40');throw _0x169482[_0x311e('0x3c')]+_0x311e('0x41');}};}function msgResponse(_0x418f54,_0xd4c66e,_0x106d7e){return{'action':_0x418f54,'response':_0xd4c66e,'message':_0x106d7e,'stack':_0x106d7e};}function myreject(_0x46ad77){return function(_0x3cec6d){return _0x46ad77(msgResponse(_0x311e('0x45'),_0x311e('0x46'),JSON[_0x311e('0x47')](_0x3cec6d)));};}function getSeconds(_0x158179,_0x23d699){var _0xe50d05=moment(_0x158179)[_0x311e('0x48')](0x0);var _0x465f5e=moment(_0x23d699)[_0x311e('0x48')](0x0);return _0xe50d05[_0x311e('0x49')](_0x465f5e,_0x311e('0x4a'));}function emit(_0x1afd75,_0x4880ac,_0x59e918){io['to'](_0x1afd75)[_0x311e('0x4b')](_0x4880ac,_0x59e918);}function emitVoiceQueueSummary(_0x370b52){if(_0x370b52[_0x311e('0x4c')]==='outbound'){var _0x5565df={'id':_0x370b52['id'],'name':_0x370b52['name'],'strategy':_0x370b52[_0x311e('0x4d')],'answered':_0x370b52[_0x311e('0x4e')],'available':_0x370b52[_0x311e('0x4f')],'loggedIn':_0x370b52['loggedIn'],'pTalking':_0x370b52['pTalking'],'sumBillable':_0x370b52[_0x311e('0x50')],'sumDuration':_0x370b52['sumDuration'],'sumHoldTime':_0x370b52['sumHoldTime']||0x0,'talking':_0x370b52[_0x311e('0x51')],'total':_0x370b52[_0x311e('0x52')],'type':_0x370b52[_0x311e('0x4c')],'unmanaged':_0x370b52['unmanaged'],'abandoned':_0x370b52[_0x311e('0x53')],'waiting':_0x370b52[_0x311e('0x54')],'loggedInDb':_0x370b52['loggedInDb'],'dialActive':_0x370b52[_0x311e('0x55')],'dialMethod':_0x370b52['dialMethod'],'dialOriginateCallerIdName':_0x370b52[_0x311e('0x56')],'dialOriginateCallerIdNumber':_0x370b52[_0x311e('0x57')],'dialOriginateTimeout':_0x370b52[_0x311e('0x58')],'dialPrefix':_0x370b52[_0x311e('0x59')],'outboundAnswerAgiCallsDay':_0x370b52['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x370b52[_0x311e('0x5a')],'outboundBlacklistCallsDay':_0x370b52[_0x311e('0x5b')],'outboundBusyCallsDay':_0x370b52['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x370b52['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x370b52[_0x311e('0x5c')],'outboundDropCallsDayCallersExit':_0x370b52[_0x311e('0x5d')],'outboundDropCallsDayTimeout':_0x370b52[_0x311e('0x5e')],'outboundNoAnswerCallsDay':_0x370b52[_0x311e('0x5f')],'outboundNoSuchCallsDay':_0x370b52[_0x311e('0x60')],'outboundOriginateFailureCallsDay':_0x370b52[_0x311e('0x61')],'outboundReCallsDay':_0x370b52[_0x311e('0x62')],'outboundRejectCallsDay':_0x370b52[_0x311e('0x63')],'outboundUnknownCallsDay':_0x370b52[_0x311e('0x64')],'predictiveIntervalAnsweredCalls':_0x370b52[_0x311e('0x65')],'predictiveIntervalAvgHoldtime':_0x370b52[_0x311e('0x66')],'predictiveIntervalAvgTalktime':_0x370b52['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x370b52['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x370b52[_0x311e('0x67')],'predictiveIntervalErlangCalls':_0x370b52['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x370b52['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x370b52[_0x311e('0x68')],'predictiveIntervalMultiplicativeFactor':_0x370b52['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x370b52[_0x311e('0x69')],'predictiveIntervalAvailable':_0x370b52[_0x311e('0x6a')],'predictiveIntervalTotalCalls':_0x370b52[_0x311e('0x6b')],'message':_0x370b52['message'],'originated':_0x370b52['originated'],'erlangCalls':_0x370b52[_0x311e('0x6c')],'erlangCallToSecond':_0x370b52[_0x311e('0x6d')],'erlangAbandonmentRate':_0x370b52[_0x311e('0x6e')],'erlangBusyFactor':_0x370b52['erlangBusyFactor'],'startPredictive':_0x370b52[_0x311e('0x6f')],'startProgressive':_0x370b52[_0x311e('0x22')]};if(_0x370b52[_0x311e('0x70')]){_0x5565df[_0x311e('0x70')]={'id':_0x370b52[_0x311e('0x70')]['id'],'name':_0x370b52['Trunk'][_0x311e('0x3c')],'active':_0x370b52[_0x311e('0x70')][_0x311e('0x71')],'callerid':_0x370b52[_0x311e('0x70')]['callerid']};}if(_0x370b52[_0x311e('0x42')]){_0x5565df[_0x311e('0x42')]={'id':_0x370b52[_0x311e('0x42')]['id'],'name':_0x370b52[_0x311e('0x42')]['name']};}var _0x419766=md5(JSON[_0x311e('0x47')](_0x5565df));if(_0x370b52[_0x311e('0x2')]!==_0x419766){_0x370b52[_0x311e('0x2')]=_0x419766;emit(util[_0x311e('0x72')]('voice:queue:%s',_0x5565df[_0x311e('0x3c')]),_0x311e('0x73'),_0x5565df);}}}function emitCampaignSummary(_0x3cd0a1){if(_0x3cd0a1['type']===_0x311e('0x74')){emit(util['format'](_0x311e('0x75'),_0x3cd0a1['name']),'campaign:save',_0x3cd0a1);}}function checkGetDataPredictive(_0x2cc973){if(isNotNull(_0x2cc973)&&!_['isEmpty'](_0x2cc973)){loggerPredictive[_0x311e('0x76')](_0x311e('0x77'));loggerPredictive[_0x311e('0x76')](_0x311e('0x78'),_0x2cc973[_0x311e('0x6b')]);loggerPredictive[_0x311e('0x76')](_0x311e('0x79'),_0x2cc973['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x311e('0x76')](_0x311e('0x7a'),_0x2cc973[_0x311e('0x67')]);loggerPredictive[_0x311e('0x76')](_0x311e('0x7b'),_0x2cc973[_0x311e('0x7c')]);loggerPredictive[_0x311e('0x76')](_0x311e('0x7d'),_0x2cc973[_0x311e('0x66')]);loggerPredictive[_0x311e('0x76')](_0x311e('0x7e'),_0x2cc973[_0x311e('0x7f')]);loggerPredictive['info'](_0x311e('0x80'));if(_0x2cc973[_0x311e('0x6b')]>0x0){if(!_[_0x311e('0x81')](_0x2cc973['predictiveIntervalAvgTalktime'])&&_0x2cc973[_0x311e('0x7f')]>0x0){return!![];}loggerPredictive[_0x311e('0x76')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_['isUndefined'](_0x2cc973[_0x311e('0x66')])&&_0x2cc973[_0x311e('0x66')]>0x0){return!![];}loggerPredictive[_0x311e('0x76')](_0x311e('0x82'));}else{loggerPredictive[_0x311e('0x76')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x311e('0x76')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x4fd370){return function(_0x38c2ee){loggerPredictive[_0x311e('0x76')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x311e('0x76')](_0x311e('0x83'),_0x38c2ee[_0x311e('0x6c')]);loggerPredictive[_0x311e('0x76')](_0x311e('0x84'),_0x38c2ee['erlangCallToSecond']);loggerPredictive[_0x311e('0x76')](_0x311e('0x85'),_0x38c2ee[_0x311e('0x6e')]);loggerPredictive[_0x311e('0x76')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x38c2ee[_0x311e('0x86')]);loggerPredictive[_0x311e('0x76')](_0x311e('0x85'),_0x38c2ee[_0x311e('0x6e')]);loggerPredictive[_0x311e('0x76')](_0x311e('0x80'));_[_0x311e('0x87')](_0x4fd370,_0x38c2ee);};}function getDiff(_0x160e66){var _0x1c743e=moment()['milliseconds'](0x0);var _0x4934ba=moment(_0x160e66)[_0x311e('0x48')](0x0);return _0x1c743e[_0x311e('0x49')](_0x4934ba,_0x311e('0x4a'));}function ifInterval(_0x3314bd,_0x254437){if(_['isUndefined'](_0x254437)){return![];}return getDiff(_0x254437)<_0x3314bd*0x3c;}function freeVariablesPredictive(_0x466a45){if(isNotNull(_0x466a45)){if(!_[_0x311e('0x81')](_0x466a45['startProgressive'])){_0x466a45['startProgressive']=undefined;loggerPredictive['info'](_0x466a45[_0x311e('0x3c')],_0x311e('0x88'));}if(!_[_0x311e('0x81')](_0x466a45[_0x311e('0x6f')])){_0x466a45['startPredictive']=undefined;loggerPredictive['info'](_0x466a45[_0x311e('0x3c')],_0x311e('0x89'));}if(!_[_0x311e('0x81')](_0x466a45[_0x311e('0x8a')])){clearInterval(_0x466a45[_0x311e('0x8a')]);_0x466a45[_0x311e('0x8a')]=undefined;loggerPredictive[_0x311e('0x76')](_0x466a45[_0x311e('0x3c')],_0x311e('0x8b'));}}}function erlangb(_0x4d9fd0,_0x521c89){if(_0x521c89===0x0){return 0x0;}var _0x337701=0x1;for(var _0x224b67=0x1;_0x224b67<=_0x521c89;_0x224b67+=0x1){_0x337701=0x1+_0x337701*_0x224b67/_0x4d9fd0;}return 0x1/_0x337701;}function isVoiceQueueOutbound(_0x5046fa){return _0x5046fa==='outbound';}function isNotPreview(_0x2997eb){return _0x2997eb!==_0x311e('0x18');}function isCampaignIvr(_0x281974){return _0x281974==='ivr';}function getCallerId(_0x5e9805,_0x57132c,_0x4bc2d2){if(!_['isUndefined'](_0x4bc2d2)&&typeof _0x4bc2d2==='string'&&!_['isEmpty'](_0x4bc2d2)){if(!_[_0x311e('0x81')](_0x57132c)&&typeof _0x57132c===_0x311e('0x8c')&&!_[_0x311e('0x44')](_0x57132c)){return util['format'](_0x311e('0x8d'),_0x57132c,_0x4bc2d2);}return util[_0x311e('0x72')](_0x311e('0x8d'),_0x4bc2d2,_0x4bc2d2);}if(!_[_0x311e('0x81')](_0x5e9805)&&typeof _0x5e9805===_0x311e('0x8c')&&!_[_0x311e('0x44')](_0x5e9805)){return _0x5e9805;}return _0x311e('0x8e');}function loggerCatchQueueSummary(_0x34edd6,_0x2aa1ec){return function(_0x1d10a2){freeVariablesPredictive(_0x2aa1ec);emitVoiceQueueSummary(_0x2aa1ec);emitCampaignSummary(_0x2aa1ec);loggerSyncQueueSummary[_0x311e('0x8f')](_0x34edd6,util[_0x311e('0x90')](_0x1d10a2,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1d62d2,_0x22cc09){return function(_0x55e2ad){loggerPredictive[_0x311e('0x91')](_0x22cc09[_0x311e('0x3c')],_0x1d62d2);loggerPredictive[_0x311e('0x91')](_0x55e2ad[_0x311e('0x92')]);freeVariablesPredictive(_0x22cc09);};}function loggerCatch(_0x323576){return function(_0x2dd16d){logger['error'](_0x323576,util[_0x311e('0x90')](_0x2dd16d,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2383e5){return _0x2383e5&&!_[_0x311e('0x81')](_0x2383e5)&&_0x2383e5['length']>0x0;}function decremetOriginate(_0x53a011){if(!_[_0x311e('0x81')](_0x53a011)&&_0x53a011!==null){if(typeof _0x53a011['originated']!==_0x311e('0x93')){if(_0x53a011[_0x311e('0x94')]>0x0){_0x53a011[_0x311e('0x94')]-=0x1;}else{logger[_0x311e('0x91')](_0x311e('0x95'));}}}else{logger[_0x311e('0x91')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x5e483b,_0x5c8bc9,_0x326af2){if(_0x5c8bc9>_0x326af2){for(var _0x16f711=0x0;_0x16f711<_0x5c8bc9-_0x326af2;_0x16f711+=0x1){decremetOriginate(_0x5e483b);}}}function loggerGetContactDialer(_0x4655b0,_0x2f9e31,_0x2d41d4){return function(_0x20584a){checkContactLowerLimitOriginate(_0x2f9e31,_0x2d41d4,0x0);logger[_0x311e('0x91')](_0x4655b0,util['inspect'](_0x20584a,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3c9010){return function(_0x4148d3){if(isNotNull(_0x4148d3)&&isNotNull(_0x4148d3[0x0])){if(_0x4148d3[0x0][_0x311e('0x96')]>0x0){_0x3c9010['message']=_0x311e('0x97');logger[_0x311e('0x76')]('[getContactDialer2][ReScheduled]'+_0x3c9010[_0x311e('0x3c')],_0x4148d3[0x0]['contactsRescheduled'],_0x311e('0x98'));}else{_0x3c9010[_0x311e('0x3a')]=_0x311e('0x99');logger[_0x311e('0x76')]('[getContactDialer2][Empty]'+_0x3c9010['name']);}}};}function notSendMessagesQueue(_0x4e3a8e){if(_0x4e3a8e[_0x311e('0x9a')]){freeVariablesPredictive(_0x4e3a8e);if(_0x4e3a8e[_0x311e('0x94')]===0x0&&_0x4e3a8e['talking']===0x0&&_0x4e3a8e['waiting']===0x0&&(_0x4e3a8e[_0x311e('0x9b')]||0x0)===0x0){_0x4e3a8e['sendMessageOneNotActive']=![];_0x4e3a8e[_0x311e('0x4f')]=0x0;_0x4e3a8e[_0x311e('0x3a')]=_0x311e('0x3e');loggerSyncQueueSummary[_0x311e('0x8f')](_0x311e('0x9c'),_0x4e3a8e['name'],'is\x20not\x20active');}else{_0x4e3a8e[_0x311e('0x3a')]=_0x311e('0x9d');loggerSyncQueueSummary['debug']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x4e3a8e['name'],_0x311e('0x9e'));}emitVoiceQueueSummary(_0x4e3a8e);}}function notSendMessagesCampaign(_0x5f38cb){if(_0x5f38cb[_0x311e('0x9a')]){if(_0x5f38cb[_0x311e('0x94')]===0x0){_0x5f38cb[_0x311e('0x9a')]=![];_0x5f38cb[_0x311e('0x3a')]=_0x311e('0x3e');loggerSyncQueueSummary[_0x311e('0x8f')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x5f38cb[_0x311e('0x3c')],_0x311e('0x9f'));}else{_0x5f38cb[_0x311e('0x3a')]='IS_DISACTIVED';loggerSyncQueueSummary['debug'](_0x311e('0xa0'),_0x5f38cb[_0x311e('0x3c')],_0x311e('0x9e'));}emitCampaignSummary(_0x5f38cb);}}function createObjHistory(_0x213d8c,_0x31e125,_0x14c910,_0x5b690c,_0x1c91c2){_0x213d8c[_0x311e('0x3a')]=_0x14c910;var _0x1e4e28=new Action(_0x213d8c,_0x31e125);var _0x2c2fc5=new History(_0x1e4e28);_0x2c2fc5[_0x311e('0xa1')]=_0x5b690c;_0x2c2fc5[_0x311e('0xa2')]=_0x1c91c2;_0x2c2fc5[_0x311e('0xa3')]=_0x1e4e28[_0x311e('0xa4')];return _0x2c2fc5;}Dialer['prototype']['loopClearZombieChannels']=function(){var _0x1f59f3=this;setInterval(function(){_0x1f59f3[_0x311e('0xa5')](_0x1f59f3['uniqueId'],'[uniqueid]');_0x1f59f3['clearZombieChannels'](_0x1f59f3[_0x311e('0x1e')],_0x311e('0xa6'));},0x32c8);};Dialer[_0x311e('0xa7')]['clearZombieChannels']=function(_0x206b10,_0x1b882d){var _0x86668c=this;for(var _0x5e81c2 in _0x206b10){if(typeof _0x206b10[_0x5e81c2]!==_0x311e('0x93')){this[_0x311e('0xa8')]['enqueue'](function(){if(!_[_0x311e('0xa9')](_0x206b10[_0x5e81c2])){return ami['Action']({'action':_0x311e('0xaa'),'channel':_0x206b10[_0x5e81c2]['channel']})[_0x311e('0xab')](function(_0x237b8f){if(_0x237b8f['message']===_0x311e('0xac')){setTimeout(function(){if(_0x206b10[_0x5e81c2]&&_0x206b10[_0x5e81c2][_0x311e('0x4c')]!==_0x311e('0x74')){_0x86668c[_0x311e('0xad')](_0x86668c['voiceQueues'][_0x206b10[_0x5e81c2][_0x311e('0xae')]]);logger[_0x311e('0x91')](_0x311e('0xaf'),_0x1b882d,_0x5e81c2,_0x206b10[_0x5e81c2]['queue']);delete _0x206b10[_0x5e81c2];}if(_0x206b10[_0x5e81c2]&&_0x206b10[_0x5e81c2][_0x311e('0x4c')]===_0x311e('0x74')){_0x86668c[_0x311e('0xad')](_0x86668c[_0x311e('0x1a')][_0x206b10[_0x5e81c2]['queue']]);logger[_0x311e('0x91')](_0x311e('0xb0'),_0x1b882d,_0x5e81c2,_0x206b10[_0x5e81c2]['queue']);delete _0x206b10[_0x5e81c2];}},0x2328);}});}});}}};Dialer[_0x311e('0xa7')]['countReScheduled']=function(_0x411789){return Promise[_0x311e('0xb1')]()[_0x311e('0x38')](cmHopper[_0x311e('0xb2')](_0x411789))[_0x311e('0xab')](loggerCatch(_0x311e('0xb3')));};Dialer[_0x311e('0xa7')][_0x311e('0xb4')]=function(_0x5d509e){return Promise[_0x311e('0xb1')]()[_0x311e('0x38')](cmHopperBlack[_0x311e('0xb4')](_0x5d509e))['catch'](loggerCatch(_0x311e('0xb5')));};Dialer[_0x311e('0xa7')][_0x311e('0xb6')]=function(_0x5c476a,_0x372153,_0x1effb6){return Promise[_0x311e('0xb1')]()[_0x311e('0x38')](cmHopperAdditionalPhone[_0x311e('0xb6')](_0x5c476a,_0x372153,_0x1effb6))[_0x311e('0xab')](loggerCatch(_0x311e('0xb7')));};Dialer['prototype'][_0x311e('0xb8')]=function(_0x57ef74,_0x32b7f9,_0x3cc7c9){return Promise[_0x311e('0xb1')]()[_0x311e('0x38')](cmHopperAdditionalPhone[_0x311e('0xb8')](_0x57ef74,_0x32b7f9,_0x3cc7c9))[_0x311e('0xab')](loggerCatch(_0x311e('0xb9')));};Dialer[_0x311e('0xa7')][_0x311e('0xba')]=function(_0x4f0ce9){return Promise[_0x311e('0xb1')]()['then'](cmHopperBlack[_0x311e('0xba')](_0x4f0ce9))['catch'](loggerCatch(_0x311e('0xbb')));};Dialer['prototype'][_0x311e('0xbc')]=function(_0x5bd726){return Promise[_0x311e('0xb1')]()[_0x311e('0x38')](cmHopperHistory[_0x311e('0xbd')](_0x5bd726))[_0x311e('0xab')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x311e('0xa7')][_0x311e('0xbe')]=function(_0x22ec88){return Promise[_0x311e('0xb1')]()['then'](cmHopper[_0x311e('0xbe')](_0x22ec88))['catch'](loggerCatch(_0x311e('0xbf')));};Dialer[_0x311e('0xa7')][_0x311e('0xc0')]=function(_0x2a1f00,_0x2d8bf5,_0x459397){return Promise[_0x311e('0xb1')]()[_0x311e('0x38')](cmHopper[_0x311e('0xc0')](_0x2a1f00,_0x2d8bf5,_0x459397))[_0x311e('0xab')](loggerCatch(_0x311e('0xc1')));};Dialer['prototype']['getContactDialer']=function(_0x4b27fb,_0x18fe56,_0x38d2c2,_0x2ab4db,_0x3cac20){return Promise[_0x311e('0xb1')]()[_0x311e('0x38')](cmHopper['getContactDialer'](_0x4b27fb,_0x18fe56,_0x38d2c2,_0x2ab4db))['catch'](function(_0x5398b2){_0x3cac20['temp']-=_0x38d2c2;_0x3cac20[_0x311e('0xc2')]=_0x3cac20[_0x311e('0xc2')]>0x0?_0x3cac20[_0x311e('0xc2')]:0x0;loggerCatch(_0x311e('0xc3'))(_0x5398b2);});};Dialer[_0x311e('0xa7')]['getContactDialerIvr']=function(_0x45b028,_0x14457e,_0x238ec5,_0x5af4fc){return Promise[_0x311e('0xb1')]()[_0x311e('0x38')](cmHopper['getContactDialerIvr'](_0x45b028,_0x14457e,_0x238ec5))[_0x311e('0xab')](function(_0x4b474f){_0x5af4fc['temp']-=_0x14457e;_0x5af4fc['temp']=_0x5af4fc[_0x311e('0xc2')]>0x0?_0x5af4fc[_0x311e('0xc2')]:0x0;loggerCatch(_0x311e('0xc4'))(_0x4b474f);});};Dialer[_0x311e('0xa7')]['getVoiceQueueRtPauses']=function(_0x279e61){return Promise[_0x311e('0xb1')]()[_0x311e('0x38')](voiceQueueRt[_0x311e('0xc5')](_0x279e61))['catch'](loggerCatch(_0x311e('0xc6')));};Dialer['prototype'][_0x311e('0xc7')]=function(_0x260ebc){return Promise[_0x311e('0xb1')]()[_0x311e('0x38')](cmHopper['moveContactManagedDialer'](_0x260ebc))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer['prototype'][_0x311e('0xc8')]=function(_0x5ce503){return Promise[_0x311e('0xb1')]()[_0x311e('0x38')](cmHopperHistory[_0x311e('0xc8')](_0x5ce503))[_0x311e('0xab')](loggerCatch(_0x311e('0xc9')));};Dialer[_0x311e('0xa7')][_0x311e('0xad')]=function(_0x36ec78){if(!_[_0x311e('0x81')](_0x36ec78)&&_0x36ec78!==null){if(typeof _0x36ec78[_0x311e('0x94')]!==_0x311e('0x93')){if(_0x36ec78[_0x311e('0x94')]>0x0){_0x36ec78[_0x311e('0x94')]-=0x1;}else{logger[_0x311e('0x91')](_0x311e('0xca'));}}}else{logger[_0x311e('0x91')](_0x311e('0xcb'));}};Dialer[_0x311e('0xa7')][_0x311e('0xcc')]=function(_0xa25bd5,_0x286790){var _0x326e8b=this;return function(_0x2abc51){_0x326e8b[_0x311e('0xad')](_0x286790);logger['error'](_0xa25bd5,util['inspect'](_0x2abc51,{'showHidden':![],'depth':null}));};};Dialer[_0x311e('0xa7')][_0x311e('0xcd')]=function(_0xc1ffb2,_0x58511c,_0x5167bc){var _0x40e269={'state':0x19,'statedesc':_0x311e('0xce')};this[_0x311e('0xad')](_0x58511c);this[_0x311e('0xcf')](_[_0x311e('0x87')](_0x40e269,_['pick'](_0x5167bc,[_0x311e('0xd0'),_0x311e('0xd1'),'UserId',_0x311e('0xd2'),'CampaignId'])),_0x311e('0xd3'),_0x311e('0xd4'));logger[_0x311e('0x91')](_0xc1ffb2);};Dialer[_0x311e('0xa7')][_0x311e('0xd5')]=function(_0x30573e){return _0x30573e===_0x311e('0xd6');};Dialer['prototype']['isTrunkReachable']=function(_0x563baa){return!_[_0x311e('0x81')](_0x563baa)&&_0x563baa&&!_['isUndefined'](_0x563baa[_0x311e('0x3c')])&&!_[_0x311e('0x81')](_0x563baa[_0x311e('0x71')])&&_0x563baa[_0x311e('0x71')]&&(this[_0x311e('0x1c')][util['format']('SIP/%s',_0x563baa[_0x311e('0x3c')])][_0x311e('0xaa')]===_0x311e('0xd7')||this[_0x311e('0x1c')][util[_0x311e('0x72')](_0x311e('0xd8'),_0x563baa[_0x311e('0x3c')])][_0x311e('0xaa')]===_0x311e('0xd9'));};Dialer[_0x311e('0xa7')][_0x311e('0xcf')]=function(_0x5476b4,_0x3176a6,_0xce40e2){this[_0x311e('0xc8')](_0x5476b4)[_0x311e('0xab')](loggerCatch(_0x3176a6));this[_0x311e('0xc7')](_0x5476b4)[_0x311e('0xab')](loggerCatch(_0xce40e2));};Dialer[_0x311e('0xa7')][_0x311e('0x34')]=function(_0x515a49){var _0x4919b7=this;var _0xa755e0=this[_0x311e('0x20')][_0x515a49[_0x311e('0xda')]];var _0x409f29;if(!_[_0x311e('0xa9')](_0x515a49)&&!_[_0x311e('0xa9')](_0x515a49['variable'])&&!_['isNil'](_0x515a49[_0x311e('0xdb')][_0x311e('0xdc')])&&_0x515a49['exten']===_0x311e('0xdd')&&_0xa755e0){if(_0xa755e0['type']!==_0x311e('0x74')&&this[_0x311e('0x19')][_0xa755e0['queue']]['dialAMDActive']&&_0x515a49[_0x311e('0xde')]==='HANGUP'){delete this[_0x311e('0x20')][_0x515a49['uniqueid']];this[_0x311e('0xad')](this[_0x311e('0x19')][_0xa755e0[_0x311e('0xae')]]);this[_0x311e('0x19')][_0xa755e0['queue']][_0x311e('0x5a')]+=0x1;this[_0x311e('0x19')][_0xa755e0[_0x311e('0xae')]][_0x311e('0xdf')]+=0x1;_0x409f29=new Hangup(_0xa755e0,_0x515a49);_0x409f29['state']=0x12;_0x409f29[_0x311e('0xa2')]='HangupInAMD';_0x409f29[_0x311e('0xe0')]=_0x311e('0xe1');ami[_0x311e('0x4b')](_0x311e('0xe2'),ut[_0x311e('0xe3')](_0x409f29,'amd'));this[_0x311e('0xcf')](_0x409f29,_0x311e('0xe4'),_0x311e('0xe5'));}if(_0xa755e0['type']!==_0x311e('0x74')&&this[_0x311e('0x19')][_0xa755e0['queue']][_0x311e('0xe6')]&&_0x515a49[_0x311e('0xde')]===_0x311e('0xe7')){return new Promise(function(_0x44505c,_0x3cfac1){delete _0x4919b7[_0x311e('0x20')][_0x515a49[_0x311e('0xda')]];_0x4919b7['updateOriginated'](_0x4919b7[_0x311e('0x19')][_0xa755e0[_0x311e('0xae')]]);_0x4919b7[_0x311e('0x19')][_0xa755e0[_0x311e('0xae')]][_0x311e('0x5a')]+=0x1;_0x4919b7[_0x311e('0x19')][_0xa755e0['queue']][_0x311e('0xdf')]+=0x1;var _0x1dd868=_0x4919b7[_0x311e('0x19')][_0xa755e0[_0x311e('0xae')]];var _0x4e1cd7=new Hangup(_0xa755e0,_0x515a49);_0x4e1cd7[_0x311e('0xa1')]=0x13;_0x4e1cd7['statedesc']=_0x311e('0xe8');_0x4e1cd7[_0x311e('0xe0')]=_0x311e('0xe1');_0x4e1cd7['countmachineretry']+=0x1;_0x4e1cd7[_0x311e('0xe9')]+=0x1;_0x4e1cd7['amd']=!![];ami[_0x311e('0x4b')](_0x311e('0xe2'),ut['buildObj'](_0x4e1cd7,_0x311e('0xea')));_0x4919b7[_0x311e('0xc8')](_0x4e1cd7)['catch'](loggerCatch(_0x311e('0xeb')));if(_0x4e1cd7[_0x311e('0xec')]+_0x4e1cd7[_0x311e('0xed')]+_0x4e1cd7[_0x311e('0xee')]+_0x4e1cd7['countnosuchnumberretry']+_0x4e1cd7[_0x311e('0xef')]+_0x4e1cd7['countabandonedretry']+_0x4e1cd7['countmachineretry']+_0x4e1cd7[_0x311e('0xf0')]>=_0x1dd868[_0x311e('0xf1')]){_0x4919b7[_0x311e('0xf2')](_0x4e1cd7,_0x44505c,_0x3cfac1,_0x311e('0xf3'));}else{if(_0x4e1cd7[_0x311e('0xf4')]>=_0x1dd868[_0x311e('0xf5')]){_0x4919b7[_0x311e('0xf6')](_0x4e1cd7,_0x44505c,_0x3cfac1,_0x311e('0xf7'));}else{_0x4919b7['rescheduleContact']({'active':![],'countmachineretry':_0x4e1cd7[_0x311e('0xf4')],'scheduledat':moment()[_0x311e('0xf8')](_0x1dd868[_0x311e('0xf9')],_0x311e('0xfa'))['format'](_0x311e('0xfb')),'ContactId':_0x4e1cd7[_0x311e('0xd0')],'ListId':_0x4e1cd7[_0x311e('0xd1')],'VoiceQueueId':_0x4e1cd7[_0x311e('0xd2')]||undefined,'CampaignId':_0x4e1cd7[_0x311e('0xfc')]||undefined})[_0x311e('0xab')](loggerCatch(_0x311e('0xfd')));_0x44505c({'reschedule':0x1});}}});}if(_0xa755e0['type']===_0x311e('0x74')&&this[_0x311e('0x1a')][_0xa755e0[_0x311e('0xae')]][_0x311e('0xe6')]&&_0x515a49[_0x311e('0xde')]===_0x311e('0xfe')){delete this[_0x311e('0x20')][_0x515a49[_0x311e('0xda')]];this[_0x311e('0xad')](this['campaigns'][_0xa755e0[_0x311e('0xae')]]);_0x409f29=new Hangup(_0xa755e0,_0x515a49);_0x409f29[_0x311e('0xa1')]=0x12;_0x409f29[_0x311e('0xa2')]=_0x311e('0xff');_0x409f29[_0x311e('0xe0')]='AMD';ami[_0x311e('0x4b')]('custom:amd',ut[_0x311e('0xe3')](_0x409f29,_0x311e('0xea')));this[_0x311e('0xcf')](_0x409f29,_0x311e('0x100'),_0x311e('0x101'));}if(_0xa755e0['type']===_0x311e('0x74')&&this[_0x311e('0x1a')][_0xa755e0[_0x311e('0xae')]][_0x311e('0xe6')]&&_0x515a49['value']===_0x311e('0xe7')){return new Promise(function(_0x1f701d,_0x8c7ffa){delete _0x4919b7[_0x311e('0x20')][_0x515a49['uniqueid']];_0x4919b7['updateOriginated'](_0x4919b7[_0x311e('0x1a')][_0xa755e0[_0x311e('0xae')]]);_0x4919b7[_0x311e('0x1a')][_0xa755e0['queue']][_0x311e('0x5a')]+=0x1;_0x4919b7[_0x311e('0x1a')][_0xa755e0['queue']][_0x311e('0xdf')]+=0x1;var _0x40d655=_0x4919b7[_0x311e('0x1a')][_0xa755e0[_0x311e('0xae')]];var _0x29ea8c=new Hangup(_0xa755e0,_0x515a49);_0x29ea8c[_0x311e('0xa1')]=0x13;_0x29ea8c[_0x311e('0xa2')]=_0x311e('0xe8');_0x29ea8c[_0x311e('0xe0')]=_0x311e('0xe1');_0x29ea8c[_0x311e('0xf4')]+=0x1;_0x29ea8c[_0x311e('0xe9')]+=0x1;_0x29ea8c['amd']=!![];ami['emit']('custom:amd',ut[_0x311e('0xe3')](_0x29ea8c,_0x311e('0xea')));_0x4919b7[_0x311e('0xc8')](_0x29ea8c)[_0x311e('0xab')](loggerCatch(_0x311e('0xeb')));if(_0x29ea8c[_0x311e('0xec')]+_0x29ea8c[_0x311e('0xed')]+_0x29ea8c['countnoanswerretry']+_0x29ea8c[_0x311e('0x102')]+_0x29ea8c[_0x311e('0xef')]+_0x29ea8c[_0x311e('0x103')]+_0x29ea8c[_0x311e('0xf4')]+_0x29ea8c[_0x311e('0xf0')]>=_0x40d655[_0x311e('0xf1')]){_0x4919b7[_0x311e('0xf2')](_0x29ea8c,_0x1f701d,_0x8c7ffa,_0x311e('0xf3'));}else{if(_0x29ea8c[_0x311e('0xf4')]>=_0x40d655[_0x311e('0xf5')]){_0x4919b7[_0x311e('0xf6')](_0x29ea8c,_0x1f701d,_0x8c7ffa,'reason\x2019\x20machine....');}else{_0x4919b7[_0x311e('0xbe')]({'active':![],'countmachineretry':_0x29ea8c[_0x311e('0xf4')],'scheduledat':moment()[_0x311e('0xf8')](_0x40d655['dialMachineRetryFrequency'],_0x311e('0xfa'))['format'](_0x311e('0xfb')),'ContactId':_0x29ea8c[_0x311e('0xd0')],'ListId':_0x29ea8c['ListId'],'VoiceQueueId':_0x29ea8c[_0x311e('0xd2')]||undefined,'CampaignId':_0x29ea8c['CampaignId']||undefined})[_0x311e('0xab')](loggerCatch(_0x311e('0xfd')));_0x1f701d({'reschedule':0x1});}}});}}};Dialer[_0x311e('0xa7')]['syncHangup']=function(_0x13e892){var _0x137b36=this[_0x311e('0x20')][_0x13e892[_0x311e('0xda')]];var _0x18a0c1;if(_0x137b36&&_0x137b36[_0x311e('0x4c')]===_0x311e('0x74')){delete this[_0x311e('0x20')][_0x13e892[_0x311e('0xda')]];this[_0x311e('0xad')](this[_0x311e('0x1a')][_0x137b36[_0x311e('0xae')]]);this[_0x311e('0x1a')][_0x137b36[_0x311e('0xae')]][_0x311e('0x104')]+=0x1;_0x18a0c1=new Hangup(_0x137b36,_0x13e892);this['createHistory'](_0x18a0c1)[_0x311e('0xab')](loggerCatch(_0x311e('0x105')));this['moveContactManagedDialer'](_0x18a0c1)[_0x311e('0xab')](loggerCatch(_0x311e('0x106')));}if(_0x137b36&&_0x137b36[_0x311e('0x4c')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x137b36[_0x311e('0xae')]]['dialQueueProject'])){delete this['uniqueId'][_0x13e892[_0x311e('0xda')]];this['updateOriginated'](this['voiceQueues'][_0x137b36[_0x311e('0xae')]]);this[_0x311e('0x19')][_0x137b36['queue']][_0x311e('0x5a')]+=0x1;this[_0x311e('0x19')][_0x137b36[_0x311e('0xae')]][_0x311e('0xdf')]+=0x1;_0x18a0c1=new Hangup(_0x137b36,_0x13e892);_0x18a0c1['state']=0x10;_0x18a0c1[_0x311e('0xa2')]=_0x311e('0x107');_0x18a0c1['membername']=_0x311e('0x108');this[_0x311e('0xc8')](_0x18a0c1)[_0x311e('0xab')](loggerCatch(_0x311e('0x105')));this['moveContactManagedDialer'](_0x18a0c1)[_0x311e('0xab')](loggerCatch(_0x311e('0x106')));}if(_0x137b36&&_0x137b36[_0x311e('0x4c')]!==_0x311e('0x74')&&!isNotNull(this[_0x311e('0x19')][_0x137b36['queue']]['dialQueueProject'])){delete this[_0x311e('0x20')][_0x13e892['uniqueid']];this[_0x311e('0xad')](this['voiceQueues'][_0x137b36[_0x311e('0xae')]]);this[_0x311e('0x19')][_0x137b36[_0x311e('0xae')]][_0x311e('0x64')]+=0x1;_0x18a0c1=new Hangup(_0x137b36,_0x13e892);_0x18a0c1[_0x311e('0xa1')]=0xc;_0x18a0c1[_0x311e('0xa2')]=_0x13e892[_0x311e('0x109')];_0x18a0c1[_0x311e('0xe0')]=_0x311e('0x10a');this['createHistory'](_0x18a0c1)[_0x311e('0xab')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x311e('0xc7')](_0x18a0c1)[_0x311e('0xab')](loggerCatch(_0x311e('0x106')));}};Dialer[_0x311e('0xa7')][_0x311e('0x2c')]=function(_0x3f32d6){var _0x5cea20=this[_0x311e('0x20')][_0x3f32d6[_0x311e('0xda')]];if(this[_0x311e('0x19')][_0x3f32d6[_0x311e('0xae')]]){if(_0x5cea20&&_0x5cea20[_0x311e('0x4c')]!==_0x311e('0x74')){delete this[_0x311e('0x20')][_0x3f32d6[_0x311e('0xda')]];this[_0x311e('0x19')][_0x3f32d6[_0x311e('0xae')]][_0x311e('0x5a')]+=0x1;var _0x520412=new AgentComplete(_0x5cea20,_0x3f32d6);if(_0x3f32d6['reason']==='agent'){_0x520412[_0x311e('0x10b')]=this['voiceQueues'][_0x3f32d6[_0x311e('0xae')]][_0x311e('0x10c')]&&this[_0x311e('0x19')][_0x3f32d6['queue']][_0x311e('0x10d')]?moment()[_0x311e('0x72')](_0x311e('0xfb')):undefined;}this['createHistory'](_0x520412)[_0x311e('0xab')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x311e('0xc7')](_0x520412)['catch'](loggerCatch(_0x311e('0x10e')));}}};Dialer[_0x311e('0xa7')]['syncAgentConnect']=function(_0x407ee7){if(this[_0x311e('0x19')][_0x407ee7['queue']]){if(this['uniqueId'][_0x407ee7[_0x311e('0xda')]]&&this[_0x311e('0x20')][_0x407ee7[_0x311e('0xda')]][_0x311e('0x4c')]!==_0x311e('0x74')){this[_0x311e('0xad')](this['voiceQueues'][_0x407ee7[_0x311e('0xae')]]);this[_0x311e('0x20')][_0x407ee7[_0x311e('0xda')]]['answertime']=moment()[_0x311e('0x72')](_0x311e('0xfb'));}}};Dialer[_0x311e('0xa7')][_0x311e('0x10f')]=function(_0x3fe773,_0x54700f){this[_0x311e('0xc8')](_0x3fe773)[_0x311e('0xab')](loggerCatch(_0x311e('0x110')));if(_0x54700f==0x0){this[_0x311e('0xc7')](_0x3fe773)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0x311e('0xa7')]['syncQueueCallerAbandon']=function(_0x2cbd7c){var _0x76ccbb=this[_0x311e('0x20')][_0x2cbd7c[_0x311e('0xda')]];var _0x1a5227=this;var _0x1a11d5=![];var _0x4fccd2;var _0x2bcbd8;if(this['voiceQueues'][_0x2cbd7c[_0x311e('0xae')]]){if(_0x76ccbb&&_0x76ccbb[_0x311e('0x4c')]!==_0x311e('0x74')){delete this[_0x311e('0x20')][_0x2cbd7c['uniqueid']];this[_0x311e('0xad')](this[_0x311e('0x19')][_0x2cbd7c[_0x311e('0xae')]]);_0x76ccbb[_0x311e('0x111')]=moment()['format'](_0x311e('0xfb'));var _0x3acb62=new QueueCallerAbandon(_0x76ccbb,_0x2cbd7c);if(getSeconds(_0x76ccbb[_0x311e('0x111')],_0x76ccbb['responsetime'])>=_0x76ccbb[_0x311e('0x112')]){this['voiceQueues'][_0x2cbd7c['queue']][_0x311e('0x67')]+=0x1;this[_0x311e('0x19')][_0x2cbd7c['queue']][_0x311e('0x5e')]+=0x1;this['voiceQueues'][_0x2cbd7c[_0x311e('0xae')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x3acb62[_0x311e('0xa1')]=0xa;_0x3acb62[_0x311e('0xa2')]=_0x311e('0x113');_0x3acb62[_0x311e('0x114')]='TIMEOUT';_0x3acb62[_0x311e('0x10b')]=this[_0x311e('0x19')][_0x2cbd7c['queue']][_0x311e('0x10c')]?moment()[_0x311e('0x72')](_0x311e('0xfb')):undefined;_0x3acb62[_0x311e('0xef')]+=0x1;_0x3acb62['countglobal']+=0x1;_0x4fccd2=this[_0x311e('0x19')][_0x2cbd7c['queue']][_0x311e('0x115')];_0x2bcbd8=this[_0x311e('0x19')][_0x2cbd7c['queue']][_0x311e('0x116')];_0x1a5227[_0x311e('0xb6')](_0x3acb62,_0x3acb62[_0x311e('0xa1')],_0x76ccbb[_0x311e('0x117')])[_0x311e('0x38')](function(_0x4cbefa){_0x1a11d5=_0x4cbefa[_0x311e('0x118')]==0x1;if(_0x3acb62[_0x311e('0xef')]>=_0x1a5227[_0x311e('0x19')][_0x2cbd7c['queue']][_0x311e('0x119')]){_0x1a5227[_0x311e('0x10f')](_0x3acb62,_0x4cbefa[_0x311e('0x118')]);}else{_0x1a5227[_0x311e('0xbe')]({'active':![],'countdropretry':_0x3acb62['countdropretry'],'scheduledat':moment()[_0x311e('0xf8')](_0x1a5227[_0x311e('0x19')][_0x2cbd7c[_0x311e('0xae')]][_0x311e('0x115')],_0x311e('0xfa'))[_0x311e('0x72')](_0x311e('0xfb')),'ContactId':_0x76ccbb['ContactId'],'ListId':_0x76ccbb[_0x311e('0xd1')],'VoiceQueueId':_0x76ccbb[_0x311e('0xd2')]||undefined,'CampaignId':_0x76ccbb[_0x311e('0xfc')]||undefined})[_0x311e('0xab')](loggerCatch(_0x311e('0x11a')));var _0x44ad99=new History(_0x3acb62);_0x44ad99['state']=0xa;_0x44ad99[_0x311e('0xa2')]=_0x311e('0x113');_0x44ad99[_0x311e('0xa4')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x44ad99['endtime']=_0x44ad99[_0x311e('0xa4')];_0x44ad99[_0x311e('0x11b')]=_0x3acb62[_0x311e('0x11b')];_0x44ad99['calleridnum']=_0x3acb62['calleridnum'];_0x1a5227['createHistory'](_0x44ad99)['catch'](loggerCatch(_0x311e('0x11c')));}})['then'](function(){if(_0x1a11d5)_0x1a5227[_0x311e('0xb8')](_0x3acb62,_0x4fccd2,_0x2bcbd8)[_0x311e('0x38')](function(){return 0x1;});});}else{this[_0x311e('0x19')][_0x2cbd7c['queue']][_0x311e('0x7c')]+=0x1;this[_0x311e('0x19')][_0x2cbd7c[_0x311e('0xae')]][_0x311e('0x5d')]+=0x1;_0x3acb62[_0x311e('0xa1')]=0xb;_0x3acb62[_0x311e('0xa2')]=_0x311e('0x11d');_0x3acb62[_0x311e('0x114')]=_0x311e('0x11e');_0x3acb62[_0x311e('0x103')]+=0x1;_0x3acb62[_0x311e('0xe9')]+=0x1;_0x4fccd2=this[_0x311e('0x19')][_0x2cbd7c[_0x311e('0xae')]][_0x311e('0x11f')];_0x2bcbd8=this[_0x311e('0x19')][_0x2cbd7c[_0x311e('0xae')]][_0x311e('0x116')];_0x1a5227['verifyAdditionalPhones'](_0x3acb62,_0x3acb62[_0x311e('0xa1')],_0x76ccbb['voiceQueue'])[_0x311e('0x38')](function(_0x19aeb6){if(_0x3acb62[_0x311e('0x103')]>=_0x1a5227[_0x311e('0x19')][_0x2cbd7c['queue']][_0x311e('0x120')]){_0x1a5227[_0x311e('0x10f')](_0x3acb62,_0x19aeb6['additional']);}else{_0x1a5227[_0x311e('0xbe')]({'active':![],'countabandonedretry':_0x3acb62['countabandonedretry'],'scheduledat':moment()[_0x311e('0xf8')](_0x1a5227[_0x311e('0x19')][_0x2cbd7c['queue']][_0x311e('0x11f')],'minutes')[_0x311e('0x72')](_0x311e('0xfb')),'ContactId':_0x76ccbb['ContactId'],'ListId':_0x76ccbb[_0x311e('0xd1')],'VoiceQueueId':_0x76ccbb[_0x311e('0xd2')]||undefined,'CampaignId':_0x76ccbb[_0x311e('0xfc')]||undefined})[_0x311e('0xab')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x33ff50=new History(_0x3acb62);_0x33ff50[_0x311e('0xa1')]=0xb;_0x33ff50[_0x311e('0xa2')]=_0x311e('0x11d');_0x33ff50[_0x311e('0xa4')]=moment()[_0x311e('0x72')]('YYYY-MM-DD\x20HH:mm:ss');_0x33ff50['endtime']=_0x33ff50[_0x311e('0xa4')];_0x33ff50[_0x311e('0x11b')]=_0x3acb62[_0x311e('0x11b')];_0x33ff50[_0x311e('0x121')]=_0x3acb62[_0x311e('0x121')];_0x1a5227[_0x311e('0xc8')](_0x33ff50)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x311e('0x38')](function(){if(_0x1a11d5)_0x1a5227[_0x311e('0xb8')](_0x3acb62,_0x4fccd2,_0x2bcbd8)[_0x311e('0x38')](function(){return 0x1;});});}}}};Dialer[_0x311e('0xa7')]['syncNewExten']=function(_0x409302){if(this[_0x311e('0x1e')][_0x409302[_0x311e('0xda')]]){this[_0x311e('0x1e')][_0x409302['uniqueid']][_0x311e('0x122')]=_0x409302[_0x311e('0x122')];}if(this[_0x311e('0x20')][_0x409302[_0x311e('0xda')]]){this[_0x311e('0x20')][_0x409302[_0x311e('0xda')]]['channel']=_0x409302['channel'];}};Dialer[_0x311e('0xa7')][_0x311e('0x35')]=function(_0x3906f1){if(strategy[this[_0x311e('0x19')][this[_0x311e('0x1e')][_0x3906f1[_0x311e('0x123')]]['queue']]['strategy']]===_0x311e('0x124')){if(this[_0x311e('0x1e')][_0x3906f1[_0x311e('0x123')]]&&_[_0x311e('0xa9')](this['actions'][_0x3906f1[_0x311e('0x123')]][_0x311e('0x125')])&&_0x3906f1[_0x311e('0xaa')]==='1'&&_0x3906f1[_0x311e('0x126')]==='0'){if(this[_0x311e('0x1b')][_0x3906f1[_0x311e('0x127')]]){if(!this[_0x311e('0x1b')][_0x3906f1['stateinterface']][_0x311e('0x125')]){this[_0x311e('0x1b')][_0x3906f1['stateinterface']][_0x311e('0x125')]=!![];this[_0x311e('0x1e')][_0x3906f1[_0x311e('0x123')]][_0x311e('0x125')]=!![];this[_0x311e('0x1e')][_0x3906f1[_0x311e('0x123')]][_0x311e('0x127')]=_0x3906f1[_0x311e('0x127')];}}}}else if((strategy[this[_0x311e('0x19')][this[_0x311e('0x1e')][_0x3906f1[_0x311e('0x123')]][_0x311e('0xae')]]['strategy']]||_0x311e('0x15'))==='rrmemory'){if(this['actions'][_0x3906f1[_0x311e('0x123')]]){if(this[_0x311e('0x1b')][_0x3906f1['stateinterface']]){this[_0x311e('0x1e')][_0x3906f1[_0x311e('0x123')]][_0x311e('0x127')]=_0x3906f1['stateinterface'];if(_[_0x311e('0xa9')](this['queueBooked'][this['actions'][_0x3906f1[_0x311e('0x123')]][_0x311e('0xae')]])){this[_0x311e('0x128')][this['actions'][_0x3906f1[_0x311e('0x123')]][_0x311e('0xae')]]=[];}this[_0x311e('0x128')][this[_0x311e('0x1e')][_0x3906f1[_0x311e('0x123')]][_0x311e('0xae')]]['push'](_['merge'](_[_0x311e('0x129')](this['actions'][_0x3906f1[_0x311e('0x123')]],[_0x311e('0x12a'),_0x311e('0x127')]),{'status':_0x3906f1[_0x311e('0xaa')],'paused':_0x3906f1['paused']}));}}}};function unlockQueueStatus(_0x5cc017,_0x2b9540){setTimeout(function(){if(_[_0x311e('0x81')](_0x5cc017['queueStatusComplete'])){loggerBooked[_0x311e('0x91')](_0x311e('0x12b'),_0x2b9540);}_0x5cc017['queueStatusComplete']=!![];loggerBooked[_0x311e('0x76')](_0x311e('0x12c'),_0x2b9540,JSON[_0x311e('0x47')](_[_0x311e('0x129')](_0x5cc017,[_0x311e('0x3c'),'queueStatusComplete'])));},0x1f3);}Dialer['prototype'][_0x311e('0x12d')]=function(_0x4dc9aa){var _0x1a56f6=this;var _0x5d9c39=_0x1a56f6['voiceQueues'][_0x1a56f6[_0x311e('0x1e')][_0x4dc9aa[_0x311e('0x123')]][_0x311e('0xae')]];if(strategy[this[_0x311e('0x19')][this['actions'][_0x4dc9aa['actionid']][_0x311e('0xae')]][_0x311e('0x4d')]]===_0x311e('0x124')){if(this[_0x311e('0x1e')][_0x4dc9aa[_0x311e('0x123')]]&&this['actions'][_0x4dc9aa['actionid']]['stateinterface']){this[_0x311e('0x18')][_0x311e('0x12e')](this[_0x311e('0x1e')][_0x4dc9aa[_0x311e('0x123')]][_0x311e('0x12a')],this[_0x311e('0x1e')][_0x4dc9aa[_0x311e('0x123')]]['stateinterface'])['catch'](function(_0x3bff24){logger[_0x311e('0x91')](_0x311e('0x12f'),util[_0x311e('0x90')](_0x3bff24,{'showHidden':![],'depth':null}));})[_0x311e('0x17')](function(){_0x1a56f6[_0x311e('0xad')](_0x1a56f6[_0x311e('0x19')][_0x1a56f6[_0x311e('0x1e')][_0x4dc9aa['actionid']][_0x311e('0xae')]]);_0x1a56f6['agents'][_0x1a56f6[_0x311e('0x1e')][_0x4dc9aa[_0x311e('0x123')]][_0x311e('0x127')]]['locked']=![];delete _0x1a56f6[_0x311e('0x1e')][_0x4dc9aa[_0x311e('0x123')]];unlockQueueStatus(_0x5d9c39);});}else{this[_0x311e('0xad')](this[_0x311e('0x19')][this[_0x311e('0x1e')][_0x4dc9aa[_0x311e('0x123')]][_0x311e('0xae')]]);this[_0x311e('0xbe')]({'active':![],'ContactId':this[_0x311e('0x1e')][_0x4dc9aa[_0x311e('0x123')]][_0x311e('0xd0')],'ListId':this[_0x311e('0x1e')][_0x4dc9aa[_0x311e('0x123')]][_0x311e('0xd1')],'VoiceQueueId':this[_0x311e('0x1e')][_0x4dc9aa[_0x311e('0x123')]][_0x311e('0xd2')]||undefined,'CampaignId':this[_0x311e('0x1e')][_0x4dc9aa[_0x311e('0x123')]]['CampaignId']||undefined})['catch'](loggerCatch(_0x311e('0x130')));delete this[_0x311e('0x1e')][_0x4dc9aa['actionid']];unlockQueueStatus(_0x5d9c39);}}else if((strategy[this[_0x311e('0x19')][this[_0x311e('0x1e')][_0x4dc9aa[_0x311e('0x123')]][_0x311e('0xae')]][_0x311e('0x4d')]]||_0x311e('0x15'))==='rrmemory'){var _0x4b72ac;if(this['actions'][_0x4dc9aa[_0x311e('0x123')]]&&!_[_0x311e('0x44')](this[_0x311e('0x128')][this[_0x311e('0x1e')][_0x4dc9aa[_0x311e('0x123')]]['queue']])){if(this[_0x311e('0x24')][_0x1a56f6[_0x311e('0x1e')][_0x4dc9aa[_0x311e('0x123')]]['queue']]){this[_0x311e('0x24')][_0x1a56f6[_0x311e('0x1e')][_0x4dc9aa[_0x311e('0x123')]][_0x311e('0xae')]]=this[_0x311e('0x24')][this[_0x311e('0x1e')][_0x4dc9aa[_0x311e('0x123')]][_0x311e('0xae')]]?this[_0x311e('0x24')][this['actions'][_0x4dc9aa[_0x311e('0x123')]][_0x311e('0xae')]]:this['queueBooked'][this[_0x311e('0x1e')][_0x4dc9aa[_0x311e('0x123')]][_0x311e('0xae')]]?this[_0x311e('0x128')][this[_0x311e('0x1e')][_0x4dc9aa['actionid']][_0x311e('0xae')]][_0x311e('0x131')]||0x0:0x0;}this[_0x311e('0x128')][this[_0x311e('0x1e')][_0x4dc9aa[_0x311e('0x123')]][_0x311e('0xae')]][_0x311e('0x131')]=this[_0x311e('0x24')][this[_0x311e('0x1e')][_0x4dc9aa[_0x311e('0x123')]][_0x311e('0xae')]];for(var _0x2e2c63=0x0;_0x2e2c63=0x0;})[_0x311e('0xab')](myreject(_0xde5361)));}}else{_0x540496['push'](ami[_0x311e('0x149')]({'action':_0x311e('0x14a'),'command':util[_0x311e('0x72')](_0x311e('0x14f'),_0x351dae,!_['isUndefined'](config[_0x311e('0x146')][_0x16230a])?_0x16230a:'')})[_0x311e('0x38')](function(_0x1a9739){return _0x1a9739['content'][_0x311e('0x14d')]('true')>=0x0;})[_0x311e('0xab')](myreject(_0xde5361)));}Promise[_0x311e('0x150')](_0x540496)[_0x311e('0x38')](function(_0xc0855e){var _0x1b88bc=_[_0x311e('0x151')](_0xc0855e);if(_0x1b88bc){return _0x5a8b53(_0x1b88bc);}else{_0x24ad63['message']=_0xe0affe?_0x311e('0x152'):'INTERVAL_IS_OVERTIME';return _0xde5361(msgResponse(_0x311e('0x153'),_0x311e('0x143'),'Global:\x20'+_0xe0affe+'\x20'+_0x222729+_0x311e('0x154')+util['inspect'](_0x351dae,{'showHidden':![],'depth':null})+_0x311e('0x155')+_0x16230a));}})[_0x311e('0xab')](function(_0x543334){return _0xde5361(msgResponse(_0x311e('0x142'),_0x311e('0x143'),JSON['stringify'](_0x543334)));});});};Dialer[_0x311e('0xa7')][_0x311e('0x156')]=function(_0x1574dd){var _0x54a6ca=this;return function(){switch(_0x1574dd[_0x311e('0x157')]){case'progressive':freeVariablesPredictive(_0x1574dd);_0x54a6ca[_0x311e('0x158')](_0x1574dd,0x1);break;case'power':freeVariablesPredictive(_0x1574dd);_0x54a6ca[_0x311e('0x158')](_0x1574dd,_0x1574dd[_0x311e('0x159')]);break;case _0x311e('0x15a'):_0x54a6ca['predictive'](_0x1574dd);break;case _0x311e('0x7'):freeVariablesPredictive(_0x1574dd);_0x54a6ca[_0x311e('0x158')](_0x1574dd,0x1);break;default:freeVariablesPredictive(_0x1574dd);logger[_0x311e('0x91')]('Queue',_0x1574dd[_0x311e('0x3c')],_0x311e('0x15b'));}};};Dialer[_0x311e('0xa7')]['checkPreviewRecallReminder']=function(_0x3cb306){return Promise[_0x311e('0xb1')]()[_0x311e('0x38')](cmHopper[_0x311e('0x15c')](_0x3cb306['id'],previewRecallmeReminderInterval))[_0x311e('0x38')](function(_0xb39ff2){for(var _0x41b117=0x0;_0x41b117<_0xb39ff2[_0x311e('0x132')];_0x41b117++){var _0x3f7f5d=_0xb39ff2[_0x41b117][_0x311e('0x15d')]['name'];if(_0x3f7f5d)io['to'](util['format'](_0x311e('0x15e'),_0x3f7f5d))[_0x311e('0x4b')]('user:dialPreviewRecallReminder',{'hopper':_0xb39ff2[_0x41b117]});}})[_0x311e('0xab')](function(){});};Dialer[_0x311e('0xa7')][_0x311e('0x15f')]=function(_0x45e093){var _0x5929a1=this;return function(){_0x5929a1[_0x311e('0x160')](_0x45e093);};};Dialer[_0x311e('0xa7')]['syncQueueSummary']=function(_0x2e032d){var _0x508815=this;if(isNotPreview(_0x2e032d[_0x311e('0x157')])){if(isVoiceQueueOutbound(_0x2e032d[_0x311e('0x4c')])&&isActive(_0x2e032d[_0x311e('0x55')])){_0x2e032d['sendMessageOneNotActive']=!![];Promise['resolve']()[_0x311e('0x38')](checkIsLoggedIn(_0x2e032d,_0x2e032d['loggedIn']))[_0x311e('0x38')](checkIsActive(_0x2e032d,_0x2e032d[_0x311e('0x55')]))[_0x311e('0x38')](checkInterval(_0x2e032d))['then'](_0x508815[_0x311e('0x161')](_0x2e032d))['then'](_0x508815['checkIfTime'](_0x2e032d['dialGlobalInterval'],_0x2e032d['dialTimezone'],_0x2e032d[_0x311e('0x3c')],_0x2e032d))[_0x311e('0x38')](_0x508815[_0x311e('0x162')](_0x2e032d[_0x311e('0x42')],_0x2e032d['dialTimezone'],_0x2e032d[_0x311e('0x3c')],_0x2e032d))[_0x311e('0x38')](_0x508815[_0x311e('0x156')](_0x2e032d))[_0x311e('0xab')](loggerCatchQueueSummary(_0x311e('0x163'),_0x2e032d));}else{notSendMessagesQueue(_0x2e032d);}}else{freeVariablesPredictive(_0x2e032d);}};Dialer[_0x311e('0xa7')]['syncQueueSummaryComplete']=_[_0x311e('0x164')](function(){var _0x188ce0=_[_0x311e('0x165')](this[_0x311e('0x19')],function(_0x255c17){return _0x255c17[_0x311e('0x166')];});var _0x446c54=_[_0x311e('0x165')](this[_0x311e('0x1b')],function(_0x1daf7c){return _0x1daf7c[_0x311e('0x167')]&&_0x1daf7c['status']==='reachable';});if(_0x188ce0[_0x311e('0x132')]>0x0&&_0x446c54[_0x311e('0x132')]>0x0){return Promise[_0x311e('0xb1')]()['then'](cmHopper['handlePreviewRecallNotifications'](_[_0x311e('0x168')](_0x188ce0,'id'),previewRecallmeReminderInterval,_[_0x311e('0x168')](_0x446c54,'id')))[_0x311e('0x38')](function(_0x3cffc7){for(var _0x305816=0x0;_0x305816<_0x3cffc7[_0x311e('0x132')];_0x305816++){var _0x1787e5=_0x3cffc7[_0x305816][_0x311e('0x15d')][_0x311e('0x3c')];if(_0x1787e5)io['to'](util['format']('user:%s',_0x1787e5))[_0x311e('0x4b')](_0x311e('0x169'),{'hopper':_0x3cffc7[_0x305816]});}})['catch'](function(_0x5256b4){logger[_0x311e('0x91')]('checkPreviewRecallReminder',_0x5256b4);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x311e('0xa7')]['syncCampaigns']=function(){var _0x31d5da=this;var _0x157acd;for(var _0x388026 in this[_0x311e('0x1a')]){if(typeof this['campaigns'][_0x388026]!==_0x311e('0x93')){_0x157acd=this[_0x311e('0x1a')][_0x388026];if(isCampaignIvr(_0x157acd[_0x311e('0x4c')])&&isActive(_0x157acd[_0x311e('0x71')])){_0x157acd[_0x311e('0x9a')]=!![];Promise[_0x311e('0xb1')]()[_0x311e('0x38')](checkIsActive(_0x157acd,_0x157acd['active']))[_0x311e('0x38')](checkInterval(_0x157acd))[_0x311e('0x38')](_0x31d5da[_0x311e('0x161')](_0x157acd))[_0x311e('0x38')](_0x31d5da[_0x311e('0x141')](_0x157acd[_0x311e('0x16a')],_0x157acd[_0x311e('0x16b')],_0x157acd[_0x311e('0x3c')],_0x157acd))[_0x311e('0x38')](_0x31d5da[_0x311e('0x162')](_0x157acd[_0x311e('0x42')],_0x157acd[_0x311e('0x16b')],_0x157acd[_0x311e('0x3c')],_0x157acd))[_0x311e('0x38')](_0x31d5da['launchHandleIvr'](_0x157acd))[_0x311e('0xab')](loggerCatchQueueSummary(_0x311e('0x16c'),_0x157acd));}else{notSendMessagesCampaign(_0x157acd);}}}};function getCallerIdRandom(_0x48f0a8,_0x121430){var _0xf759b4;var _0x5522a1;var _0x52068a;if(_0x121430<=0x0){_0x121430=0x1;}_0xf759b4=new RegExp(_0x311e('0x16d')+_0x121430+'}$');_0x5522a1=Math[_0x311e('0x16e')](0xa,_0x121430-0x1);_0x52068a=Math[_0x311e('0x16e')](0xa,_0x121430)-0x1;return util[_0x311e('0x72')]('%s',_['replace'](_0x48f0a8,_0xf759b4,_[_0x311e('0x16f')](_0x5522a1,_0x52068a)));}function extractCalleridName(_0x103a71){var _0x15dbbd=_0x103a71[_0x311e('0x170')](/"(.*?)"/);return _0x15dbbd?_0x15dbbd[0x1]:_0x103a71;}Dialer[_0x311e('0xa7')]['actionOriginate']=function(_0x79116f,_0x290b41){var _0xdf5b51=this;var _0x5ca8f0=uuid['v4']();this[_0x311e('0x1e')][_0x5ca8f0]=new Action(_0x79116f,_0x290b41,_0x5ca8f0);return new Promise(function(_0x396a7c,_0x5df3b9){if(_[_0x311e('0x81')](_0x79116f)&&typeof _0x79116f!==_0x311e('0x171')){return _0x5df3b9(msgResponse(_0x311e('0x172'),_0x311e('0x143'),_0x311e('0x173')));}if(_[_0x311e('0x81')](_0x290b41[_0x311e('0x174')])||_0x290b41[_0x311e('0x174')]===null){return _0x5df3b9(msgResponse(_0x311e('0x172'),_0x311e('0x143'),_0x311e('0x175')));}var _0x51f9f2={'XMD-CALLERID':_0xdf5b51['actions'][_0x5ca8f0][_0x311e('0x176')](),'XMD-AGI':_0x79116f['dialQueueProject']?util[_0x311e('0x72')](_0x311e('0x177'),ipAgi,_0x79116f[_0x311e('0x178')]):_0x311e('0x179'),'XMD-AGIAFTER':_0x79116f[_0x311e('0x10c')]?util[_0x311e('0x72')](_0x311e('0x177'),ipAgi,_0x79116f[_0x311e('0x10c')]):_0x311e('0x179'),'XMD-QUEUE':_0x79116f['type']===_0x311e('0x17a')?util[_0x311e('0x72')](_0x311e('0x17b'),_0x79116f[_0x311e('0x3c')],_0x79116f['dialQueueOptions']||'',_0x79116f[_0x311e('0x10d')]?'c':'',_0x79116f[_0x311e('0x112')]||0x3):_0x311e('0x179'),'XMD-CONTACTID':_0x290b41[_0x311e('0xd0')],'XMD-CDRTYPE':_0x311e('0x17c'),'CALLERID(all)':_0xdf5b51[_0x311e('0x1e')][_0x5ca8f0]['getCaller'](),'XMD-AMD':_0x79116f[_0x311e('0xe6')]?'ACTIVE':_0x311e('0x179'),'XMD-DESTINATION':_0x311e('0xdd')};if(_0x79116f[_0x311e('0xe6')]){_0x51f9f2['XMD-AMDINITIALSILENCE']=_0x79116f[_0x311e('0x17d')]||0x9c4;_0x51f9f2[_0x311e('0x17e')]=_0x79116f[_0x311e('0x17f')]||0x5dc;_0x51f9f2[_0x311e('0x180')]=_0x79116f[_0x311e('0x181')]||0x320;_0x51f9f2['XMD-AMDTOTALANALYSISTIME']=_0x79116f[_0x311e('0x182')]||0x1388;_0x51f9f2[_0x311e('0x183')]=_0x79116f[_0x311e('0x184')]||0x64;_0x51f9f2[_0x311e('0x185')]=_0x79116f['dialAMDBetweenWordsSilence']||0x32;_0x51f9f2[_0x311e('0x186')]=_0x79116f[_0x311e('0x187')]||0x3;_0x51f9f2['XMD-AMDSILENCETHRESHOLD']=_0x79116f[_0x311e('0x188')]||0x100;_0x51f9f2['XMD-AMDMAXIMUMWORDLENGTH']=_0x79116f['dialAMDMaximumWordLength']||0x1388;}if(_0x79116f[_0x311e('0x4c')]==='outbound'){_0x51f9f2[_0x311e('0x189')]=_0x290b41[_0x311e('0xd2')];}else{_0x51f9f2[_0x311e('0x18a')]=_0x290b41[_0x311e('0xfc')];}for(var _0x3f8c42 in _0x290b41['Contact']){if(typeof _0x290b41['Contact'][_0x3f8c42]!==_0x311e('0x93')){if(isNotNull(_0x290b41[_0x311e('0x18b')][_0x3f8c42])&&_0x3f8c42!=='id'&&_0x3f8c42!==_0x311e('0x18c')&&_0x3f8c42!==_0x311e('0x18d')&&_0x3f8c42!=='updatedAt'){_0x51f9f2[util[_0x311e('0x72')](_0x311e('0x18e'),_0x311e('0x18f'),_[_0x311e('0x190')](_0x3f8c42))]=_0x290b41['Contact'][_0x3f8c42];}}}var _0x4deb87=_0xdf5b51[_0x311e('0x13e')](_0x79116f[_0x311e('0x70')])?getCallerId(_0x79116f['Trunk'][_0x311e('0x191')],_0x79116f[_0x311e('0x56')],_0x79116f[_0x311e('0x192')]>0x0?getCallerIdRandom(_0x79116f[_0x311e('0x57')],_0x79116f[_0x311e('0x192')]):_0x79116f[_0x311e('0x57')]):getCallerId(_[_0x311e('0xa9')](_0x79116f['TrunkBackup'])?_0x79116f[_0x311e('0x70')][_0x311e('0x191')]:_0x79116f[_0x311e('0x13f')][_0x311e('0x191')],_0x79116f[_0x311e('0x56')],_0x79116f[_0x311e('0x192')]>0x0?getCallerIdRandom(_0x79116f[_0x311e('0x57')],_0x79116f[_0x311e('0x192')]):_0x79116f[_0x311e('0x57')]);if(_0x4deb87){_0x51f9f2[_0x311e('0x193')]=_0xdf5b51[_0x311e('0x1e')][_0x5ca8f0][_0x311e('0x194')]=extractCalleridName(_0x4deb87);_0x51f9f2[_0x311e('0x195')]=_0x290b41[_0x311e('0x174')];}_0x79116f['variables']=_0x51f9f2;return ami['Action']({'actionid':_0x5ca8f0,'action':_0x311e('0x172'),'channel':_0xdf5b51['isTrunkReachable'](_0x79116f[_0x311e('0x70')])?util[_0x311e('0x72')](_0x311e('0x196'),_0x79116f[_0x311e('0x70')][_0x311e('0x3c')],isNotNull(_0x79116f[_0x311e('0x59')])?_0x79116f[_0x311e('0x59')][_0x311e('0x197')]()||'':'',_0x79116f[_0x311e('0x198')]>0x0?_0x290b41[_0x311e('0x174')][_0x311e('0x199')](_0x79116f['dialCutDigit']):_0x290b41[_0x311e('0x174')]):util[_0x311e('0x72')](_0x311e('0x196'),_[_0x311e('0xa9')](_0x79116f[_0x311e('0x13f')])?_0x79116f['Trunk'][_0x311e('0x3c')]:_0x79116f[_0x311e('0x13f')][_0x311e('0x3c')],isNotNull(_0x79116f[_0x311e('0x59')])?_0x79116f[_0x311e('0x59')][_0x311e('0x197')]()||'':'',_0x79116f[_0x311e('0x198')]>0x0?_0x290b41['phone']['substring'](_0x79116f[_0x311e('0x198')]):_0x290b41[_0x311e('0x174')]),'callerid':_0x4deb87,'Exten':_0x311e('0xdd'),'Context':_0x311e('0x19a'),'Priority':'1','variable':_0x51f9f2,'timeout':(_0x79116f[_0x311e('0x58')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5ca8f0})[_0x311e('0x38')](function(_0x37eaae){return _0x396a7c(_0x37eaae);})[_0x311e('0xab')](function(_0x384f90){_0x79116f[_0x311e('0x61')]+=0x1;var _0x17108a=new History(_0xdf5b51['actions'][_0x5ca8f0]);logger['error'](util[_0x311e('0x72')]('[originateError]:\x20%s',JSON[_0x311e('0x47')](_0x384f90)));_0x17108a[_0x311e('0xa1')]=0xe;_0x17108a[_0x311e('0xa2')]=_0x311e('0x19b');_0x17108a[_0x311e('0xa4')]=moment()[_0x311e('0x72')](_0x311e('0xfb'));_0x17108a['endtime']=_0x17108a['starttime'];_0xdf5b51[_0x311e('0xc8')](_0x17108a)['catch'](loggerCatch(_0x311e('0x19c')));_0xdf5b51['moveContactManagedDialer'](_0x17108a)[_0x311e('0xab')](loggerCatch(_0x311e('0x19c')))[_0x311e('0x17')](function(){delete _0xdf5b51[_0x311e('0x1e')][_0x5ca8f0];return _0x5df3b9(msgResponse(_0x311e('0x172'),'Error','originate\x20action\x20Error'));});});});};Dialer[_0x311e('0xa7')][_0x311e('0x2a')]=function(_0xeedb25){var _0x16affe=this[_0x311e('0x1e')][_0xeedb25[_0x311e('0x123')]];if(_0x16affe){delete this[_0x311e('0x1e')][_0xeedb25[_0x311e('0x123')]];_0x16affe[_0x311e('0x19d')]=moment()[_0x311e('0x72')](_0x311e('0xfb'));var _0x4cce24=_0x16affe['type']===_0x311e('0x74')?this[_0x311e('0x1a')][_0x16affe[_0x311e('0xae')]]:this[_0x311e('0x19')][_0x16affe['getQueue']()];if(!this[_0x311e('0xd5')](_0xeedb25[_0x311e('0x19e')])){this[_0x311e('0xad')](_0x4cce24);return this[_0x311e('0x19f')](_0x16affe,_0x4cce24,_0xeedb25)[_0x311e('0xab')](loggerCatch(_0x311e('0x1a0')));}this[_0x311e('0x20')][_0xeedb25[_0x311e('0xda')]]=_0x16affe;}};Dialer['prototype'][_0x311e('0x1a1')]=function(_0x511149,_0x57c256,_0x1b102f){var _0x33107b=new History(_0x57c256);if(_0x33107b['countbusyretry']+_0x33107b['countcongestionretry']+_0x33107b[_0x311e('0xee')]+_0x33107b['countnosuchnumberretry']+_0x33107b[_0x311e('0xef')]+_0x33107b[_0x311e('0x103')]+_0x33107b[_0x311e('0xf4')]+_0x33107b[_0x311e('0xf0')]>=_0x1b102f[_0x311e('0xf1')]-0x1){return!![];}switch(_0x511149){case 0x3:if(_0x33107b[_0x311e('0xee')]>=_0x1b102f[_0x311e('0x1a2')]-0x1){return!![];}this[_0x311e('0xbe')]({'active':![],'countnoanswerretry':_0x33107b['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x311e('0xf8')](_0x1b102f[_0x311e('0x1a3')],'minutes')[_0x311e('0x72')](_0x311e('0xfb')),'ContactId':_0x33107b[_0x311e('0xd0')],'ListId':_0x33107b[_0x311e('0xd1')],'VoiceQueueId':_0x33107b['VoiceQueueId']||undefined,'CampaignId':_0x33107b[_0x311e('0xfc')]||undefined})[_0x311e('0xab')](loggerCatch(_0x311e('0x1a4')));break;case 0x5:if(_0x33107b[_0x311e('0xec')]>=_0x1b102f['dialBusyMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x33107b[_0x311e('0xec')]+=0x1,'scheduledat':moment()[_0x311e('0xf8')](_0x1b102f[_0x311e('0x1a5')],_0x311e('0xfa'))['format'](_0x311e('0xfb')),'ContactId':_0x33107b[_0x311e('0xd0')],'ListId':_0x33107b[_0x311e('0xd1')],'VoiceQueueId':_0x33107b[_0x311e('0xd2')]||undefined,'CampaignId':_0x33107b[_0x311e('0xfc')]||undefined})[_0x311e('0xab')](loggerCatch(_0x311e('0x1a6')));break;case 0x8:if(_0x33107b[_0x311e('0xed')]>=_0x1b102f[_0x311e('0x1a7')]-0x1){return!![];}this[_0x311e('0xbe')]({'active':![],'countcongestionretry':_0x33107b[_0x311e('0xed')]+=0x1,'scheduledat':moment()[_0x311e('0xf8')](_0x1b102f[_0x311e('0x1a8')],_0x311e('0xfa'))[_0x311e('0x72')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x33107b[_0x311e('0xd0')],'ListId':_0x33107b['ListId'],'VoiceQueueId':_0x33107b['VoiceQueueId']||undefined,'CampaignId':_0x33107b[_0x311e('0xfc')]||undefined})[_0x311e('0xab')](loggerCatch(_0x311e('0x1a9')));break;case 0x0:if(_0x33107b[_0x311e('0x102')]>=_0x1b102f[_0x311e('0x1aa')]-0x1){return!![];}else{this[_0x311e('0xbe')]({'active':![],'countnosuchnumberretry':_0x33107b[_0x311e('0x102')]+=0x1,'scheduledat':moment()[_0x311e('0xf8')](_0x1b102f[_0x311e('0x1ab')],_0x311e('0xfa'))[_0x311e('0x72')](_0x311e('0xfb')),'ContactId':_0x33107b['ContactId'],'ListId':_0x33107b[_0x311e('0xd1')],'VoiceQueueId':_0x33107b[_0x311e('0xd2')]||undefined,'CampaignId':_0x33107b['CampaignId']||undefined})[_0x311e('0xab')](loggerCatch(_0x311e('0x1ac')));}break;case 0xa:if(_0x33107b['countdropretry']>=_0x1b102f[_0x311e('0x119')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x33107b['countdropretry']+=0x1,'scheduledat':moment()[_0x311e('0xf8')](_0x1b102f[_0x311e('0x115')],_0x311e('0xfa'))[_0x311e('0x72')](_0x311e('0xfb')),'ContactId':_0x33107b['ContactId'],'ListId':_0x33107b[_0x311e('0xd1')],'VoiceQueueId':_0x33107b[_0x311e('0xd2')]||undefined,'CampaignId':_0x33107b[_0x311e('0xfc')]||undefined})[_0x311e('0xab')](loggerCatch(_0x311e('0x11a')));break;case 0xb:if(_0x33107b[_0x311e('0x103')]>=_0x1b102f[_0x311e('0x120')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x33107b[_0x311e('0x103')]+=0x1,'scheduledat':moment()['add'](_0x1b102f[_0x311e('0x11f')],_0x311e('0xfa'))[_0x311e('0x72')](_0x311e('0xfb')),'ContactId':_0x33107b[_0x311e('0xd0')],'ListId':_0x33107b[_0x311e('0xd1')],'VoiceQueueId':_0x33107b['VoiceQueueId']||undefined,'CampaignId':_0x33107b[_0x311e('0xfc')]||undefined})['catch'](loggerCatch(_0x311e('0x1ad')));break;case 0x13:if(_0x33107b[_0x311e('0xf4')]>=_0x1b102f[_0x311e('0xf5')]-0x1){return!![];}this[_0x311e('0xbe')]({'active':![],'countmachineretry':_0x33107b[_0x311e('0xf4')]+=0x1,'scheduledat':moment()[_0x311e('0xf8')](_0x1b102f[_0x311e('0xf9')],_0x311e('0xfa'))[_0x311e('0x72')](_0x311e('0xfb')),'ContactId':_0x33107b['ContactId'],'ListId':_0x33107b[_0x311e('0xd1')],'VoiceQueueId':_0x33107b[_0x311e('0xd2')]||undefined,'CampaignId':_0x33107b[_0x311e('0xfc')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x33107b[_0x311e('0xf0')]>=_0x1b102f[_0x311e('0x1ae')]-0x1){return!![];}this[_0x311e('0xbe')]({'active':![],'countagentrejectretry':_0x33107b[_0x311e('0xf0')]+=0x1,'scheduledat':moment()[_0x311e('0xf8')](_0x1b102f[_0x311e('0x1af')],'minutes')[_0x311e('0x72')](_0x311e('0xfb')),'ContactId':_0x33107b['ContactId'],'ListId':_0x33107b[_0x311e('0xd1')],'VoiceQueueId':_0x33107b[_0x311e('0xd2')]||undefined,'CampaignId':_0x33107b[_0x311e('0xfc')]||undefined})[_0x311e('0xab')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x311e('0xa7')][_0x311e('0x19f')]=function(_0x277768,_0x3ab569,_0x3af02f){var _0xaa2061=this;var _0x39705b=new History(_0x277768);var _0x190a7b=![];var _0x1745ee;var _0x298923;return new Promise(function(_0x3304a8,_0x49a2ea){if(_[_0x311e('0x81')](_0x3ab569)&&typeof _0x3ab569!==_0x311e('0x171')){return _0x49a2ea(msgResponse(_0x311e('0x1b0'),_0x311e('0x143'),_0x311e('0x1b1')));}if(_[_0x311e('0x81')](_0x3af02f)&&typeof _0x3af02f!=='object'){return _0x49a2ea(msgResponse(_0x311e('0x1b0'),_0x311e('0x143'),_0x311e('0x1b2')));}_0xaa2061[_0x311e('0xb6')](_0x39705b,_0x3af02f['reason'],_0x3ab569)['then'](function(_0x5247bd){if(_0x5247bd[_0x311e('0x118')]==0x1)_0x190a7b=!![];switch(_0x3af02f[_0x311e('0x1b3')]){case'0':_0x3ab569[_0x311e('0x60')]+=0x1;_0x39705b[_0x311e('0xa1')]=0x0;_0x39705b['statedesc']=_0x311e('0x1b4');_0x39705b[_0x311e('0x102')]+=0x1;_0x39705b[_0x311e('0xe9')]+=0x1;ami['emit']('custom:agentnosuchnumber',ut['buildObj'](_0x277768,_0x311e('0x1b5')));_0x1745ee=_0x3ab569['dialNoSuchNumberRetryFrequency'];_0x298923=_0x3ab569[_0x311e('0x116')];_0xaa2061[_0x311e('0xc8')](_0x39705b)[_0x311e('0xab')](loggerCatch(_0x311e('0xeb')));if(_0xaa2061[_0x311e('0x1a1')](0x0,_0x277768,_0x3ab569)&&!_0x190a7b){if(_0x39705b[_0x311e('0x102')]>=_0x3ab569['dialNoSuchNumberMaxRetry']){_0xaa2061[_0x311e('0xf6')](_0x39705b,_0x3304a8,_0x49a2ea,_0x311e('0x1b6'));}else{_0xaa2061[_0x311e('0xf2')](_0x39705b,_0x3304a8,_0x49a2ea,_0x311e('0x1b6'));}}break;case'3':_0x3ab569['outboundNoAnswerCallsDay']+=0x1;_0x39705b[_0x311e('0xa1')]=0x3;_0x39705b[_0x311e('0xa2')]=_0x311e('0x1b7');_0x39705b[_0x311e('0xee')]+=0x1;_0x39705b[_0x311e('0xe9')]+=0x1;var _0x57fbe1=ut[_0x311e('0x1b8')](_0x277768,_0x3ab569);ami[_0x311e('0x4b')]('custom:agentnoanswer',_0x57fbe1);_0x1745ee=_0x3ab569[_0x311e('0x1a3')];_0x298923=_0x3ab569['callAdditionalPhoneAfterMin'];_0xaa2061['createHistory'](_0x39705b)[_0x311e('0xab')](loggerCatch(_0x311e('0x1b9')));if(_0xaa2061[_0x311e('0x1a1')](0x3,_0x277768,_0x3ab569)&&!_0x190a7b){if(_0x39705b['countnoanswerretry']>=_0x3ab569[_0x311e('0x1a2')]){_0xaa2061[_0x311e('0xf6')](_0x39705b,_0x3304a8,_0x49a2ea,_0x311e('0x1ba'));}else{_0xaa2061[_0x311e('0xf2')](_0x39705b,_0x3304a8,_0x49a2ea,_0x311e('0x1ba'));}}break;case'5':_0x3ab569[_0x311e('0x1bb')]+=0x1;_0x39705b[_0x311e('0xa1')]=0x5;_0x39705b['statedesc']=_0x311e('0x1bc');_0x39705b[_0x311e('0xec')]+=0x1;_0x39705b[_0x311e('0xe9')]+=0x1;ami[_0x311e('0x4b')](_0x311e('0x1bd'),ut['buildObj'](_0x277768,'busy'));_0x1745ee=_0x3ab569[_0x311e('0x1a5')];_0x298923=_0x3ab569['callAdditionalPhoneAfterMin'];_0xaa2061[_0x311e('0xc8')](_0x39705b)['catch'](loggerCatch(_0x311e('0x1be')));if(_0xaa2061[_0x311e('0x1a1')](0x5,_0x277768,_0x3ab569)&&!_0x190a7b){if(_0x39705b['countbusyretry']>=_0x3ab569[_0x311e('0x1bf')]){_0xaa2061['createStateFinal'](_0x39705b,_0x3304a8,_0x49a2ea,_0x311e('0x1c0'));}else{_0xaa2061['stateGlobal'](_0x39705b,_0x3304a8,_0x49a2ea,_0x311e('0x1c0'));}}break;case'8':_0x3ab569[_0x311e('0x1c1')]+=0x1;_0x39705b[_0x311e('0xa1')]=0x8;_0x39705b[_0x311e('0xa2')]=_0x311e('0x1c2');_0x39705b['countcongestionretry']+=0x1;_0x39705b[_0x311e('0xe9')]+=0x1;_0x1745ee=_0x3ab569['dialCongestionRetryFrequency'];_0x298923=_0x3ab569[_0x311e('0x116')];ami['emit'](_0x311e('0x1c3'),ut[_0x311e('0xe3')](_0x277768,'congestion'));_0xaa2061['createHistory'](_0x39705b)[_0x311e('0xab')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0xaa2061[_0x311e('0x1a1')](0x8,_0x277768,_0x3ab569)&&!_0x190a7b){if(_0x39705b[_0x311e('0xed')]>=_0x3ab569[_0x311e('0x1a7')]){_0xaa2061[_0x311e('0xf6')](_0x39705b,_0x3304a8,_0x49a2ea,'reason\x208\x20congestion');}else{_0xaa2061[_0x311e('0xf2')](_0x39705b,_0x3304a8,_0x49a2ea,'reason\x208\x20congestion');}}break;case'11':_0x3ab569[_0x311e('0x1c4')]+=0x1;_0x39705b[_0x311e('0xa1')]=0xb;_0x39705b[_0x311e('0xa2')]=_0x311e('0x11d');_0x39705b[_0x311e('0x103')]+=0x1;_0x39705b['countglobal']+=0x1;_0x1745ee=_0x3ab569[_0x311e('0x11f')];_0x298923=_0x3ab569[_0x311e('0x116')];_0xaa2061[_0x311e('0xc8')](_0x39705b)[_0x311e('0xab')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0xaa2061[_0x311e('0x1a1')](0xb,_0x277768,_0x3ab569)&&!_0x190a7b){if(_0x39705b[_0x311e('0x103')]>=_0x3ab569[_0x311e('0x120')]){_0xaa2061[_0x311e('0xf6')](_0x39705b,_0x3304a8,_0x49a2ea,_0x311e('0x1c5'));}else{_0xaa2061[_0x311e('0xf2')](_0x39705b,_0x3304a8,_0x49a2ea,_0x311e('0x1c5'));}}break;case'20':_0x3ab569[_0x311e('0x63')]+=0x1;_0x39705b[_0x311e('0xa1')]=0x14;_0x39705b['statedesc']=_0x311e('0x1c6');_0x39705b[_0x311e('0xf0')]+=0x1;_0x39705b[_0x311e('0xe9')]+=0x1;_0x1745ee=_0x3ab569[_0x311e('0x1af')];_0x298923=_0x3ab569[_0x311e('0x116')];ami[_0x311e('0x4b')](_0x311e('0x1c7'),ut[_0x311e('0xe3')](_0x277768,_0x311e('0x1c8')));_0xaa2061[_0x311e('0xc8')](_0x39705b)['catch'](loggerCatch(_0x311e('0x1c9')));if(_0xaa2061[_0x311e('0x1a1')](0x14,_0x277768,_0x3ab569)&&!_0x190a7b){if(_0x39705b['countagentrejectretry']>=_0x3ab569['dialAgentRejectMaxRetry']){_0xaa2061['createStateFinal'](_0x39705b,_0x3304a8,_0x49a2ea,_0x311e('0x1ca'));}else{_0xaa2061['stateGlobal'](_0x39705b,_0x3304a8,_0x49a2ea,_0x311e('0x1ca'));}}break;default:_0x3ab569[_0x311e('0x64')]+=0x1;_0x39705b[_0x311e('0xa1')]=0xc;_0x39705b[_0x311e('0xa2')]=_0x3af02f[_0x311e('0x1b3')];_0x1745ee=_0x3ab569[_0x311e('0x1af')];_0x298923=_0x3ab569[_0x311e('0x116')];_0xaa2061[_0x311e('0xc8')](_0x39705b)['catch'](loggerCatch(_0x311e('0x1cb')));if(_0xaa2061[_0x311e('0x1a1')](_0x3af02f['reason'],_0x277768,_0x3ab569)&&!_0x190a7b){if(_0x39705b[_0x311e('0xec')]+_0x39705b[_0x311e('0xed')]+_0x39705b[_0x311e('0xee')]+_0x39705b['countnosuchnumberretry']+_0x39705b[_0x311e('0xef')]+_0x39705b[_0x311e('0x103')]+_0x39705b[_0x311e('0xf4')]+_0x39705b['countagentrejectretry']>=_0x3ab569[_0x311e('0xf1')]){_0xaa2061[_0x311e('0xf2')](_0x39705b,_0x3304a8,_0x49a2ea,_0x3af02f['reason']);}else{_0xaa2061[_0x311e('0xf6')](_0x39705b,_0x3304a8,_0x49a2ea,_0x3af02f[_0x311e('0x1b3')]);}}}})[_0x311e('0x38')](function(){if(_0x190a7b){_0xaa2061[_0x311e('0xb8')](_0x39705b,_0x1745ee,_0x298923)[_0x311e('0x38')](function(){return _0x3304a8(0x1);});}});});};Dialer[_0x311e('0xa7')][_0x311e('0xf2')]=function(_0x34ce1c,_0x15402d,_0x1524db,_0x51638f){var _0x305bb2=new Final(_0x34ce1c);_0x305bb2['state']=0xf;_0x305bb2[_0x311e('0xa2')]=_0x311e('0x1cc');this[_0x311e('0xf6')](_0x305bb2,_0x15402d,_0x1524db,_0x51638f);};Dialer['prototype'][_0x311e('0xf6')]=function(_0x34f382,_0x421fc5,_0x15d055,_0x3264a3){this['moveContactManagedDialer'](_0x34f382)['then'](function(){return _0x421fc5(msgResponse(_0x311e('0x1b0'),'Success',_0x3264a3));})[_0x311e('0xab')](function(){return _0x15d055(msgResponse('[moveContactManagedDialer][0]',_0x311e('0x143'),_0x311e('0x1cd')));});};Dialer[_0x311e('0xa7')][_0x311e('0x15a')]=function(_0x598654){var _0x4ec2c8=_0x598654[_0x311e('0x1ce')]/0x64;var _0x525c28=_0x598654[_0x311e('0x5e')]/(_0x598654[_0x311e('0x5e')]+_0x598654[_0x311e('0x5a')]);var _0x2c28a7=Math[_0x311e('0x1cf')](_0x598654[_0x311e('0x6a')]*(_0x598654[_0x311e('0x1d0')]/0x64));var _0x530daa=Math[_0x311e('0x1cf')](_0x598654['predictiveIntervalAvailable']*(_0x598654[_0x311e('0x1d1')]/0x64));var _0x5d953e=_0x598654[_0x311e('0x4f')]+_0x598654[_0x311e('0x51')];var _0x4f28fd=Math[_0x311e('0x1d2')](_0x598654['erlangCalls']*_0x598654[_0x311e('0x6e')]*_0x598654[_0x311e('0x68')]*_0x598654[_0x311e('0x1d3')]);if(_[_0x311e('0x81')](_0x598654[_0x311e('0x22')])){if(!_['isUndefined'](_0x598654[_0x311e('0x6f')])){_0x598654['startPredictive']=undefined;loggerPredictive[_0x311e('0x91')]('[startMethodPredictive][StartProgressive]',_0x311e('0x1d4'));}if(!_[_0x311e('0x81')](_0x598654[_0x311e('0x8a')])){loggerPredictive[_0x311e('0x91')](_0x311e('0x1d5'),_0x311e('0x1d6'));clearInterval(_0x598654['handlePredictive']);_0x598654[_0x311e('0x8a')]=undefined;}_0x598654['startProgressive']=moment()[_0x311e('0x72')](_0x311e('0xfb'));loggerPredictive[_0x311e('0x76')](_0x598654[_0x311e('0x3c')],'collection\x20data\x20in\x20progressive\x20at',_0x598654[_0x311e('0x22')]);this['handlePower'](_0x598654,0x1);}else if(ifInterval(_0x598654[_0x311e('0x1d7')],_0x598654[_0x311e('0x22')])){this['handlePower'](_0x598654,0x1);loggerPredictiveCalls[_0x311e('0x76')]('[startMethodPredictive][StartProgressive][Loop]',_0x598654[_0x311e('0x22')],_0x598654[_0x311e('0x3c')]);_0x598654[_0x311e('0x6c')]=0x0;_0x598654[_0x311e('0x1d8')]=0x0;}else if(_0x4ec2c8<_0x525c28&&_0x598654[_0x311e('0x1d9')]==='dropRate'){freeVariablesPredictive(_0x598654);loggerPredictive[_0x311e('0x76')](_0x311e('0x1da'),'Dropped\x20calls\x20day',_0x525c28,_0x311e('0x22'),_0x598654[_0x311e('0x3c')]);}else if(_0x4f28fd<_0x598654[_0x311e('0x1d8')]&&_0x598654['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x598654);loggerPredictive[_0x311e('0x76')](_0x311e('0x1db'),_0x311e('0x1dc'),_0x4f28fd,'Drop\x20in\x20this\x20interval',_0x598654[_0x311e('0x1d8')],'startProgressive',_0x598654[_0x311e('0x3c')]);}else if(!ifInterval(_0x598654[_0x311e('0x1d7')],_0x598654[_0x311e('0x22')])&&_[_0x311e('0x81')](_0x598654[_0x311e('0x6f')])&&!_['isUndefined'](_0x598654[_0x311e('0x22')])){_0x598654['startPredictive']=moment()[_0x311e('0x72')](_0x311e('0xfb'));loggerPredictive['info'](_0x598654['name'],_0x311e('0x1dd'),_0x598654['startPredictive']);this[_0x311e('0xbc')](_0x598654[_0x311e('0x1d7')])[_0x311e('0x38')](this[_0x311e('0x1de')](_0x598654))[_0x311e('0x38')](mergeDataErlangB(_0x598654))[_0x311e('0x38')](this[_0x311e('0x1df')](_0x598654))['catch'](loggerCatchPredictive(_0x311e('0x1e0'),_0x598654));}else if(!ifInterval(_0x598654[_0x311e('0x1d7')],_0x598654[_0x311e('0x6f')])){_0x598654[_0x311e('0x1d8')]=0x0;_0x598654[_0x311e('0x6f')]=moment()['format'](_0x311e('0xfb'));loggerPredictive[_0x311e('0x76')](_0x598654[_0x311e('0x3c')],'recalculate\x20predictive\x20at',_0x598654[_0x311e('0x6f')]);clearInterval(_0x598654[_0x311e('0x8a')]);_0x598654[_0x311e('0x8a')]=undefined;this[_0x311e('0xbc')](_0x598654[_0x311e('0x1d7')])[_0x311e('0x38')](this[_0x311e('0x1de')](_0x598654))[_0x311e('0x38')](mergeDataErlangB(_0x598654))[_0x311e('0x38')](this[_0x311e('0x1df')](_0x598654))[_0x311e('0xab')](loggerCatchPredictive(_0x311e('0x1e1'),_0x598654));}else if(_0x598654[_0x311e('0x6a')]&&_0x5d953e<_0x598654['predictiveIntervalAvailable']-_0x530daa){freeVariablesPredictive(_0x598654);loggerPredictive['info'](_0x598654['name'],_0x311e('0x1e2'),_0x5d953e,')\x20are\x20less\x20than\x20threshold\x20(',_0x598654[_0x311e('0x6a')],'-',_0x530daa,'=',_0x598654['predictiveIntervalAvailable']-_0x530daa,')');}else if(_0x598654[_0x311e('0x6a')]&&_0x5d953e>_0x598654['predictiveIntervalAvailable']+_0x2c28a7){freeVariablesPredictive(_0x598654);loggerPredictive['info'](_0x598654[_0x311e('0x3c')],_0x311e('0x1e2'),_0x5d953e,')\x20are\x20more\x20than\x20threshold\x20(',_0x598654[_0x311e('0x6a')],'+',_0x2c28a7,'=',_0x598654['predictiveIntervalAvailable']+_0x2c28a7,')');}};Dialer[_0x311e('0xa7')][_0x311e('0x1de')]=function(_0x1861ec){var _0x341043=this;return function(_0x535f15){return new Promise(function(_0xf505aa,_0x58bbd6){_[_0x311e('0x87')](_0x1861ec,_0x535f15[0x0]);if(checkGetDataPredictive(_0x535f15[0x0])){var _0x428cf5=_0x1861ec[_0x311e('0x6a')]=_0x1861ec[_0x311e('0x51')]+_0x1861ec[_0x311e('0x4f')];var _0x51466c=_0x1861ec[_0x311e('0x1d7')]*0x3c;var _0x4cd53e=_0x535f15[0x0][_0x311e('0x7f')]+_0x535f15[0x0][_0x311e('0x66')];var _0x12cde0=(_0x535f15[0x0][_0x311e('0x65')]+_0x535f15[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x535f15[0x0][_0x311e('0x7c')])/_0x535f15[0x0]['predictiveIntervalTotalCalls'];_0x1861ec['predictiveIntervalHitRate']=_0x12cde0>0x0?_0x12cde0:0x1;switch(_0x1861ec[_0x311e('0x1d9')]){case'dropRate':var _0x40c796=_0x1861ec[_0x311e('0x1ce')]/0x64;return _0x341043[_0x311e('0x1e3')](_0x428cf5,_0x51466c,_0x4cd53e,_0x12cde0,_0x40c796)[_0x311e('0x38')](function(_0x48fe49){return _0xf505aa(_0x48fe49);});case'agentBusyFactor':var _0x4dbfdd=_0x1861ec[_0x311e('0x1ce')]/0x64;return _0x341043[_0x311e('0x1e4')](_0x428cf5,_0x51466c,_0x4cd53e,_0x12cde0,_0x4dbfdd)[_0x311e('0x38')](function(_0x1e3093){return _0xf505aa(_0x1e3093);});default:return _0x58bbd6(msgResponse('[getDataPredictive]',_0x311e('0x143'),'Unknown\x20Predictive'));}}else{return _0x58bbd6(msgResponse(_0x311e('0x1e5'),_0x311e('0x143'),_0x311e('0x1e6')));}});};};Dialer[_0x311e('0xa7')]['getDataPredictiveOld']=function(_0x10e11d){var _0x4b3cad=this;return function(_0x456aa2){return new Promise(function(_0x28021d,_0x3cba45){_[_0x311e('0x87')](_0x10e11d,_0x456aa2[0x0]);if(checkGetDataPredictive(_0x456aa2[0x0])){loggerPredictive[_0x311e('0x76')](JSON[_0x311e('0x47')](_0x456aa2[0x0]));if(_0x10e11d[_0x311e('0x1d9')]===_0x311e('0x1e7')){return _0x4b3cad['getVoiceQueueRtPauses'](_0x10e11d['id'])['then'](function(_0x534da7){var _0x121076=_0x10e11d[_0x311e('0x1e8')]-_0x534da7[0x0][_0x311e('0x1e9')];var _0x535eb8=_0x10e11d['dialPredictiveInterval']*0x3c;var _0x3effd0=_0x456aa2[0x0][_0x311e('0x7f')]+_0x456aa2[0x0][_0x311e('0x66')];var _0x190cf5=(_0x456aa2[0x0][_0x311e('0x65')]+_0x456aa2[0x0][_0x311e('0x67')]+_0x456aa2[0x0][_0x311e('0x7c')])/_0x456aa2[0x0][_0x311e('0x6b')];var _0x446c77=_0x10e11d['dialPredictiveOptimizationPercentage']/0x64;_0x10e11d[_0x311e('0x69')]=_0x534da7[0x0][_0x311e('0x1e9')]||0x0;_0x10e11d[_0x311e('0x68')]=_0x190cf5>0x0?_0x190cf5:0x1;return _0x4b3cad[_0x311e('0x1e3')](_0x121076,_0x535eb8,_0x3effd0,_0x190cf5,_0x446c77);})[_0x311e('0x38')](function(_0x1d99d0){return _0x28021d(_0x1d99d0);})[_0x311e('0xab')](function(_0x56eef7){return _0x3cba45(msgResponse(_0x311e('0x1ea'),_0x311e('0x143'),JSON[_0x311e('0x47')](_0x56eef7)));});}if(_0x10e11d['dialPredictiveOptimization']==='agentBusyFactor'){return _0x4b3cad['getVoiceQueueRtPauses'](_0x10e11d['id'])[_0x311e('0x38')](function(_0x29451b){var _0x4ab805=_0x10e11d['loggedIn']-_0x29451b[0x0][_0x311e('0x1e9')];var _0x1be959=_0x10e11d[_0x311e('0x1d7')]*0x3c;var _0x80141a=_0x456aa2[0x0][_0x311e('0x7f')]+_0x456aa2[0x0][_0x311e('0x66')];var _0x2c5ad8=(_0x456aa2[0x0][_0x311e('0x65')]+_0x456aa2[0x0][_0x311e('0x67')]+_0x456aa2[0x0][_0x311e('0x7c')])/_0x456aa2[0x0]['predictiveIntervalTotalCalls'];var _0x4c2e6e=_0x10e11d[_0x311e('0x1ce')]/0x64;_0x10e11d[_0x311e('0x69')]=_0x29451b[0x0][_0x311e('0x1e9')]||0x0;_0x10e11d['predictiveIntervalHitRate']=_0x2c5ad8>0x0?_0x2c5ad8:0x1;return _0x4b3cad[_0x311e('0x1e4')](_0x4ab805,_0x1be959,_0x80141a,_0x2c5ad8,_0x4c2e6e);})[_0x311e('0x38')](function(_0x59d7d8){return _0x28021d(_0x59d7d8);})[_0x311e('0xab')](function(_0x2cfa4e){return _0x3cba45(msgResponse(_0x311e('0x1ea'),_0x311e('0x143'),JSON[_0x311e('0x47')](_0x2cfa4e)));});}}else{return _0x3cba45(msgResponse(_0x311e('0x1e5'),'Failure',_0x311e('0x1e6')));}});};};Dialer[_0x311e('0xa7')][_0x311e('0x1df')]=function(_0x479a5f){var _0x2ab6a1=this;return function(){var _0x320dac=0x0;var _0x4d062c=Math[_0x311e('0x1d2')](_0x479a5f['erlangCallToSecond']*0x3e8);if(_0x4d062c>0x0){_0x4d062c=_0x4d062c<0x64?0x64:_0x4d062c;loggerPredictive['info'](_0x479a5f[_0x311e('0x3c')],_0x311e('0x1eb'),_0x4d062c,_0x311e('0x48'));_0x479a5f[_0x311e('0x8a')]=setInterval(function(){_0x2ab6a1['handlePredictive'](_0x479a5f);loggerPredictiveCalls[_0x311e('0x76')]('[handlePredictive]',_0x320dac+=0x1);},_0x4d062c);}else{loggerPredictive['info'](_0x479a5f[_0x311e('0x3c')],_0x311e('0x1ec'));}};};Dialer[_0x311e('0xa7')][_0x311e('0x1ed')]=function(_0x2584ae,_0x56ca74){var _0x2c6d5e=this;return function(_0x9e96e9){if(_[_0x311e('0x44')](_0x9e96e9)){if(_[_0x311e('0xa9')](_0x56ca74[_0x311e('0x1ee')])||!_0x56ca74[_0x311e('0x1ef')]){if(_0x2584ae[_0x311e('0x157')]===_0x311e('0x7')){_0x2584ae['queueStatusComplete']=_[_0x311e('0x81')](_0x2584ae[_0x311e('0x1f0')])?!![]:_0x2584ae[_0x311e('0x1f0')];var _0xbec357=uuid['v4']();_0x2c6d5e[_0x311e('0x1e')][_0xbec357]=new Action(_0x2584ae,_0x56ca74,_0xbec357);loggerBooked[_0x311e('0x76')](_0x311e('0x1f1'),_0xbec357,_0x311e('0x1f2'),JSON[_0x311e('0x47')](_0x2584ae[_0x311e('0x1f0')]),'Queue:\x20',_0x2584ae[_0x311e('0x3c')]);if(_0x2584ae[_0x311e('0x1f0')]){_0x2584ae[_0x311e('0x1f0')]=![];_0x2c6d5e['queueBooked'][_0x2c6d5e['actions'][_0xbec357][_0x311e('0xae')]]=[];ami[_0x311e('0x149')]({'actionid':_0xbec357,'action':_0x311e('0x1f3'),'queue':_0x2584ae[_0x311e('0x3c')]})['catch'](function(){_0x2c6d5e[_0x311e('0xad')](_0x2584ae);_0x2c6d5e[_0x311e('0xbe')]({'active':![],'ContactId':_0x2c6d5e[_0x311e('0x1e')][_0xbec357]['ContactId'],'ListId':_0x2c6d5e[_0x311e('0x1e')][_0xbec357][_0x311e('0xd1')],'VoiceQueueId':_0x2c6d5e[_0x311e('0x1e')][_0xbec357][_0x311e('0xd2')]||undefined,'CampaignId':_0x2c6d5e[_0x311e('0x1e')][_0xbec357][_0x311e('0xfc')]||undefined})[_0x311e('0xab')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2c6d5e[_0x311e('0x1e')][_0xbec357];});}else{loggerBooked[_0x311e('0x76')]('[booked][checkContactBlack][else]',JSON[_0x311e('0x47')](_0x2584ae[_0x311e('0x1f0')]),_0x311e('0x1f4'),_0x2584ae['name']);_0x2c6d5e[_0x311e('0xad')](_0x2584ae);_0x2c6d5e[_0x311e('0xbe')]({'active':![],'ContactId':_0x2c6d5e[_0x311e('0x1e')][_0xbec357][_0x311e('0xd0')],'ListId':_0x2c6d5e[_0x311e('0x1e')][_0xbec357]['ListId'],'VoiceQueueId':_0x2c6d5e[_0x311e('0x1e')][_0xbec357][_0x311e('0xd2')]||undefined,'CampaignId':_0x2c6d5e['actions'][_0xbec357][_0x311e('0xfc')]||undefined})[_0x311e('0xab')](loggerCatch(_0x311e('0x1f5')));delete _0x2c6d5e[_0x311e('0x1e')][_0xbec357];}}else{return _0x2c6d5e[_0x311e('0x1f6')](_0x2584ae,_0x56ca74);}}else{if(getDiff(_0x56ca74[_0x311e('0x1f7')])<_0x2584ae['dialRecallMeTimeout']*0x3c){if(_0x56ca74[_0x311e('0x15d')]&&!_0x56ca74['Agent'][_0x311e('0x1f8')]){_0x2c6d5e['preview'][_0x311e('0x12e')](_0x56ca74['id'])[_0x311e('0x17')](function(){_0x2c6d5e[_0x311e('0xad')](_0x2584ae);});}else{_0x2c6d5e[_0x311e('0xc0')]({'active':![]},_0x56ca74['id'],0x1)[_0x311e('0x17')](function(){_0x2c6d5e[_0x311e('0xad')](_0x2584ae);});}}else{_0x2584ae[_0x311e('0x62')]+=0x1;_0x2c6d5e[_0x311e('0xad')](_0x2584ae);if(_0x2584ae[_0x311e('0x1f9')]){_0x2c6d5e[_0x311e('0xbe')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x56ca74[_0x311e('0xd0')],'ListId':_0x56ca74['ListId'],'VoiceQueueId':_0x56ca74[_0x311e('0xd2')]||undefined,'CampaignId':_0x56ca74['CampaignId']||undefined})[_0x311e('0xab')](loggerCatch(_0x311e('0x1fa')));_0x2c6d5e['createHistory'](createObjHistory(_0x2584ae,_0x56ca74,_0x311e('0x1fb'),0x17,'RecallInQueue'))[_0x311e('0xab')](loggerCatch(_0x311e('0x1fc')));}else{_0x2c6d5e[_0x311e('0xcf')](createObjHistory(_0x2584ae,_0x56ca74,_0x311e('0x1fd'),0x16,_0x311e('0x1fe')),_0x311e('0x1ff'),_0x311e('0x200'));}}}}else{_0x2584ae[_0x311e('0x5b')]+=0x1;_0x2c6d5e['saveInDb'](createObjHistory(_0x2584ae,_0x56ca74,'BLACKLIST',0xd,_0x311e('0x201')),_0x311e('0x202'),'[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer[_0x311e('0xa7')][_0x311e('0x160')]=function(_0x401dfc){var _0x376c79=this;var _0x2c4cfe=_0x401dfc[_0x311e('0x203')]-_0x401dfc['originated']-_0x401dfc[_0x311e('0xc2')];emitCampaignSummary(_0x401dfc);if(_0x2c4cfe>0x0){if(_0x2c4cfe>this[_0x311e('0x1d')]){_0x2c4cfe=this[_0x311e('0x1d')];}_0x401dfc[_0x311e('0xc2')]+=_0x2c4cfe;this['getContactDialerIvr'](_0x401dfc['id'],_0x2c4cfe,_0x401dfc[_0x311e('0x204')],_0x401dfc)[_0x311e('0x38')](function(_0x33abb6){_0x401dfc['temp']-=_0x2c4cfe;_0x401dfc[_0x311e('0xc2')]=_0x401dfc[_0x311e('0xc2')]>0x0?_0x401dfc[_0x311e('0xc2')]:0x0;if(!checkContactEmpty(_0x33abb6)){_0x401dfc['message']=_0x311e('0x99');logger[_0x311e('0x76')](_0x311e('0x205')+_0x401dfc[_0x311e('0x3c')]);}else{_0x401dfc[_0x311e('0x94')]+=_0x33abb6[_0x311e('0x132')];_0x401dfc[_0x311e('0x3a')]=_0x311e('0x206');for(var _0x3829fb=0x0;_0x3829fb<_0x33abb6[_0x311e('0x132')];_0x3829fb+=0x1){_0x401dfc[_0x311e('0x207')]+=0x1;if(_[_0x311e('0xa9')](_0x33abb6[_0x3829fb])||_[_0x311e('0xa9')](_0x33abb6[_0x3829fb][_0x311e('0x18b')])||_[_0x311e('0xa9')](_0x33abb6[_0x3829fb]['phone'])){_0x376c79[_0x311e('0xcd')](_0x311e('0x208'),_0x401dfc,_0x33abb6[_0x3829fb]);}else{_0x376c79[_0x311e('0xba')](_[_0x311e('0x129')](_0x33abb6[_0x3829fb],[_0x311e('0xfc'),_0x311e('0x209')]))[_0x311e('0x38')](_0x376c79['checkContactBlack'](_0x401dfc,_0x33abb6[_0x3829fb]))[_0x311e('0xab')](_0x376c79[_0x311e('0xcc')](_0x311e('0x20a'),_0x401dfc));}}}})[_0x311e('0xab')](loggerGetContactDialer(_0x311e('0x20b'),_0x401dfc,_0x2c4cfe));}};Dialer[_0x311e('0xa7')][_0x311e('0x158')]=function(_0x566e56,_0x14e61a){var _0x27583b=this;var _0xd4ec91=[];var _0x1be270=_0x14e61a>=0x1?_0x14e61a:0x1;if(_0x566e56[_0x311e('0x157')]==='booked'){_0x1be270=0x1;}var _0x1e12a5=Math['floor'](_0x566e56['available']*_0x1be270)-_0x566e56['originated']-_0x566e56[_0x311e('0xc2')];emitVoiceQueueSummary(_0x566e56);if(_0x566e56[_0x311e('0x20c')]>0x0){var _0x2bf8b7=_0x566e56[_0x311e('0x20c')]-_0x566e56['originated']-_0x566e56['talking']-_0x566e56['temp']-_0x566e56[_0x311e('0x9b')];if(_0x1e12a5>_0x2bf8b7){_0x1e12a5=_0x2bf8b7;}}if(_0x1e12a5>0x0){if(_0x566e56[_0x311e('0x157')]===_0x311e('0x7')){_0x1e12a5=0x1;}if(_0x1e12a5>this[_0x311e('0x1d')]){_0x1e12a5=this['maxNumberOriginate'];}_0x566e56[_0x311e('0xc2')]+=_0x1e12a5;for(var _0x2f5728 in this['agents']){if(typeof this[_0x311e('0x1b')][_0x2f5728]!=='undefined'){if(this[_0x311e('0x1b')][_0x2f5728][_0x311e('0xa1')]==='not_inuse'&&this[_0x311e('0x1b')][_0x2f5728][_0x311e('0xaa')]===_0x311e('0xd7')){_0xd4ec91[_0x311e('0x148')](this[_0x311e('0x1b')][_0x2f5728]['id']);}}}this['getContactDialer'](_0x566e56['id'],_0xd4ec91,_0x1e12a5,_0x566e56['dialOrderByScheduledAt'],_0x566e56)[_0x311e('0x38')](function(_0x469c7d){_0x566e56[_0x311e('0xc2')]-=_0x1e12a5;_0x566e56[_0x311e('0xc2')]=_0x566e56[_0x311e('0xc2')]>0x0?_0x566e56[_0x311e('0xc2')]:0x0;if(!checkContactEmpty(_0x469c7d)){_0x27583b[_0x311e('0xb2')](_0x566e56)[_0x311e('0x38')](sendMessageReschedule(_0x566e56))['catch'](loggerCatch(_0x311e('0xb3')));}else{_0x566e56[_0x311e('0x94')]+=_0x469c7d[_0x311e('0x132')];_0x566e56[_0x311e('0x3a')]=_0x566e56[_0x311e('0x157')]===_0x311e('0x7')?_0x311e('0x20d'):_0x311e('0x206');for(var _0x135a17=0x0;_0x135a17<_0x469c7d[_0x311e('0x132')];_0x135a17+=0x1){if(_[_0x311e('0xa9')](_0x469c7d[_0x135a17])||_['isNil'](_0x469c7d[_0x135a17][_0x311e('0x18b')])||_[_0x311e('0xa9')](_0x469c7d[_0x135a17][_0x311e('0x174')])){_0x27583b[_0x311e('0xcd')](_0x311e('0x208'),_0x566e56,_0x469c7d[_0x135a17]);}else{_0x27583b[_0x311e('0xb4')](_[_0x311e('0x129')](_0x469c7d[_0x135a17],[_0x311e('0xd2'),_0x311e('0x209')]))['then'](_0x27583b['checkContactBlack'](_0x566e56,_0x469c7d[_0x135a17]))[_0x311e('0xab')](_0x27583b['loggerHandler'](_0x311e('0x208'),_0x566e56));}}}})['catch'](loggerGetContactDialer(_0x311e('0x20e'),_0x566e56,_0x1e12a5));}};Dialer[_0x311e('0xa7')][_0x311e('0x8a')]=function(_0x21bdde){if(_0x21bdde['dialLimitQueue']>0x0){var _0x4927ce=_0x21bdde[_0x311e('0x20c')]-_0x21bdde[_0x311e('0x94')]-_0x21bdde[_0x311e('0x51')];if(_0x4927ce>0x0){this['tryOriginatePredictive'](_0x21bdde);}else{loggerPredictiveCalls[_0x311e('0x76')]('[handlePredictive][limitChannel]');}}else{this[_0x311e('0x20f')](_0x21bdde);}};Dialer['prototype'][_0x311e('0x20f')]=function(_0x383c55){var _0xd7e4f1=this;var _0x443f23=[];_0x383c55['originated']+=0x1;for(var _0x361788 in this[_0x311e('0x1b')]){if(typeof this[_0x311e('0x1b')][_0x361788]!==_0x311e('0x93')){if(this['agents'][_0x361788][_0x311e('0xa1')]==='not_inuse'&&this[_0x311e('0x1b')][_0x361788][_0x311e('0xaa')]==='reachable'){_0x443f23[_0x311e('0x148')](this['agents'][_0x361788]['id']);}}}this[_0x311e('0x210')](_0x383c55['id'],_0x443f23,0x1,_0x383c55['dialOrderByScheduledAt'],_0x383c55)[_0x311e('0x38')](function(_0x5e6482){if(!checkContactEmpty(_0x5e6482)){checkContactLowerLimitOriginate(_0x383c55,0x1,0x0);_0xd7e4f1[_0x311e('0xb2')](_0x383c55)[_0x311e('0x38')](sendMessageReschedule(_0x383c55))[_0x311e('0xab')](loggerCatch('[countReScheduled]\x20'));}else{_0x383c55[_0x311e('0x3a')]=_0x311e('0x206');if(_[_0x311e('0xa9')](_0x5e6482[0x0])||_[_0x311e('0xa9')](_0x5e6482[0x0]['Contact'])||_['isNil'](_0x5e6482[0x0][_0x311e('0x174')])){_0xd7e4f1[_0x311e('0xcd')](_0x311e('0x208'),_0x383c55,_0x5e6482[0x0]);}else{_0xd7e4f1[_0x311e('0xb4')](_[_0x311e('0x129')](_0x5e6482[0x0],[_0x311e('0xd2'),_0x311e('0x209')]))[_0x311e('0x38')](_0xd7e4f1[_0x311e('0x1ed')](_0x383c55,_0x5e6482[0x0]))[_0x311e('0xab')](_0xd7e4f1[_0x311e('0xcc')](_0x311e('0x211'),_0x383c55));}}})[_0x311e('0xab')](loggerGetContactDialer('[getContactDialerPredictive]',_0x383c55,0x1));emitVoiceQueueSummary(_0x383c55);};Dialer['prototype'][_0x311e('0x1e3')]=function(_0x1e3e81,_0x523b99,_0x3ebb9e,_0x22cc9f,_0x599c9c,_0x493ea7){loggerPredictive[_0x311e('0x76')](_0x311e('0x212'));loggerPredictive[_0x311e('0x76')](_0x311e('0x213'),_0x1e3e81);loggerPredictive['info'](_0x311e('0x214'),_0x523b99);loggerPredictive['info']('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',_0x3ebb9e);loggerPredictive[_0x311e('0x76')](_0x311e('0x215'),_0x22cc9f);loggerPredictive[_0x311e('0x76')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x599c9c);loggerPredictive[_0x311e('0x76')](_0x311e('0x80'));return new Promise(function(_0x3b967b,_0x52bc68){if(_0x1e3e81<=0x0||isNaN(_0x1e3e81)){return _0x52bc68(msgResponse(_0x311e('0x216'),'Error',_0x311e('0x217')+_0x1e3e81));}if(_0x3ebb9e<=0x0||isNaN(_0x3ebb9e)){return _0x52bc68(msgResponse('[abandonmentRate]',_0x311e('0x46'),'Ts\x20=\x20'+_0x3ebb9e));}if(_0x22cc9f<=0x0||isNaN(_0x22cc9f)){return _0x52bc68(msgResponse(_0x311e('0x216'),_0x311e('0x46'),_0x311e('0x218')+_0x22cc9f));}if(_0x523b99<=0x0||isNaN(_0x523b99)){return _0x52bc68(msgResponse(_0x311e('0x216'),_0x311e('0x46'),_0x311e('0x219')+_0x523b99));}if(_0x599c9c<=0x0||isNaN(_0x599c9c)){return _0x52bc68(msgResponse(_0x311e('0x216'),_0x311e('0x46'),_0x311e('0x21a')+_0x599c9c));}_0x493ea7=_0x493ea7||0x0;var _0x28d525=0x1/_0x3ebb9e;var _0xe073d0=0x0;var _0x3ffed8=0x0;var _0x592964=0x0;var _0x3ce5d2=0x0;for(var _0xdd979c=0x0;_0x592964<_0x599c9c;_0xdd979c+=0x1){_0x3ffed8=_0xdd979c/_0x523b99;_0xe073d0=(_0x22cc9f*_0x3ffed8+_0x493ea7)/_0x28d525;_0x592964=erlangb(_0xe073d0,_0x1e3e81);_0x3ce5d2=_0xe073d0/_0x1e3e81*(0x1-erlangb(_0xe073d0,_0x1e3e81));}return _0x3b967b({'erlangCalls':_0xdd979c,'erlangCallToSecond':_0x523b99/_0xdd979c,'erlangAbandonmentRate':_0x592964,'erlangBusyFactor':_0x3ce5d2});});};Dialer[_0x311e('0xa7')][_0x311e('0x1e4')]=function(_0x5e3a85,_0x31e138,_0x3107a2,_0x3aeb0b,_0x40179e,_0x45f8d1){loggerPredictive[_0x311e('0x76')](_0x311e('0x21b'));loggerPredictive[_0x311e('0x76')](_0x311e('0x213'),_0x5e3a85);loggerPredictive[_0x311e('0x76')](_0x311e('0x214'),_0x31e138);loggerPredictive[_0x311e('0x76')](_0x311e('0x21c'),_0x3107a2);loggerPredictive[_0x311e('0x76')]('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',_0x3aeb0b);loggerPredictive[_0x311e('0x76')](_0x311e('0x21d'),_0x40179e);loggerPredictive[_0x311e('0x76')](_0x311e('0x80'));return new Promise(function(_0x24667d,_0x44fb9a){if(_0x5e3a85<=0x0||isNaN(_0x5e3a85)){return _0x44fb9a(msgResponse(_0x311e('0x21e'),_0x311e('0x46'),'m\x20=\x20'+_0x5e3a85));}if(_0x3107a2<=0x0||isNaN(_0x3107a2)){return _0x44fb9a(msgResponse(_0x311e('0x21e'),_0x311e('0x46'),'Ts\x20=\x20'+_0x3107a2));}if(_0x3aeb0b<=0x0||isNaN(_0x3aeb0b)){return _0x44fb9a(msgResponse('[busyFactor]',_0x311e('0x46'),_0x311e('0x218')+_0x3aeb0b));}if(_0x31e138<=0x0||isNaN(_0x31e138)){return _0x44fb9a(msgResponse(_0x311e('0x21e'),_0x311e('0x46'),_0x311e('0x219')+_0x31e138));}if(_0x40179e<=0x0||isNaN(_0x40179e)){return _0x44fb9a(msgResponse('[busyFactor]','Error','Umin\x20=\x20'+_0x40179e));}_0x45f8d1=_0x45f8d1||0x0;var _0x24d375=0x1/_0x3107a2;var _0x2cc5a9=0x0;var _0x3b7907=0x0;var _0x1fb98b=0x0;var _0x257d03=0x0;for(var _0x13947d=0x0;_0x257d03<_0x40179e;_0x13947d+=0x1){_0x3b7907=_0x13947d/_0x31e138;_0x2cc5a9=(_0x3aeb0b*_0x3b7907+_0x45f8d1)/_0x24d375;_0x1fb98b=erlangb(_0x2cc5a9,_0x5e3a85);_0x257d03=_0x2cc5a9/_0x5e3a85*(0x1-erlangb(_0x2cc5a9,_0x5e3a85));}return _0x24667d({'erlangCalls':_0x13947d,'erlangCallToSecond':_0x31e138/_0x13947d,'erlangAbandonmentRate':_0x1fb98b,'erlangBusyFactor':_0x257d03});});};module[_0x311e('0x21f')]=Dialer; \ No newline at end of file +var _0xfc34=['[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','inspect','emptyContact','saveInDb','merge','pick','ContactId','ListId','VoiceQueueId','CampaignId','[emptyContact]','isSuccess','Success','reachable','SIP/%s','unmonitored','variable','amdstatus','exten','value','HANGUP','uniqueid','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','statedesc','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','MACHINE','countmachineretry','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','dialAMDActive','countglobal','[syncAgentComplete][createHistory][0]','createStateFinal','add','minutes','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','cause-txt','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','[syncQueueCallerAbandon]\x20[Drop]','dialQueueTimeout','Drop','dropreason','TIMEOUT','countdropretry','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','queueCallerAbandonCreateState','[rescheduleContact][Drop]','calleridname','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','calleridnum','[syncAgentComplete][createHistory][11]','syncQueueMember','actionid','locked','paused','stateinterface','push','idHopper','[unlockQueueStatus][undefined]','queueStatusComplete','run','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','\x20Timezone\x20unknow\x20','isArray','command','interval','content','indexOf','iftime\x20%s,%s','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','handlePower','power','dialPowerLevel','predictive','method\x20not\x20recognized','handlePreviewRecallNotifications','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','syncQueueSummary','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','syncQueueSummaryComplete','throttle','filter','dialPreviewRecallmeReminder','online','map','Agent','user:%s','checkPreviewRecallReminder','[syncCampaigns]','\x5cw{0,','pow','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','\x22agi://%s/square,%s\x22','NONE','outbound','\x22%s,%s%s,,,%s\x22','getCaller','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','Contact','tags','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','originatecalleridname','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','substring','dialCutDigit','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','responsetime','getQueue','response','[callProgressDetecting]\x20','dialGlobalMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','NoSuchNumber','nosuchnumber','checkRetriveMax','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','talking','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','available','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','outboundQueuePauses','[CatchErlangB]','startMethodPredictive','floor','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','ACTIVE','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\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','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','[busyFactor]','Umin\x20=\x20','exports','util','lodash','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictiveCalls','../ami','defaults','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','name','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','isEmpty','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','info','Total\x20Calls:\x20\x20\x20\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','predictiveIntervalDroppedCallsCallersExit','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','debug','error','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','endtime','starttime','uniqueId','[uniqueid]','clearZombieChannels','actions','[actions]','isNil','Action','status','channel','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','countReScheduled','resolve','catch','[countReScheduled]\x20','checkIsBlackList','then','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory'];(function(_0x5a3495,_0x497ba2){var _0x1e35f0=function(_0x1ef137){while(--_0x1ef137){_0x5a3495['push'](_0x5a3495['shift']());}};_0x1e35f0(++_0x497ba2);}(_0xfc34,0x165));var _0x4fc3=function(_0x1ff7f9,_0x7f4e5d){_0x1ff7f9=_0x1ff7f9-0x0;var _0x42f261=_0xfc34[_0x1ff7f9];return _0x42f261;};'use strict';var util=require(_0x4fc3('0x0'));var _=require(_0x4fc3('0x1'));var uuid=require('uuid');var moment=require(_0x4fc3('0x2'));var rr=require('rr');var md5=require(_0x4fc3('0x3'));var Redis=require(_0x4fc3('0x4'));var ut=require(_0x4fc3('0x5'));var config=require(_0x4fc3('0x6'));var logger=require(_0x4fc3('0x7'))(_0x4fc3('0x8'));var loggerBooked=require(_0x4fc3('0x7'))(_0x4fc3('0x9'));var loggerPredictive=require(_0x4fc3('0x7'))('predictive');var loggerPredictiveCalls=require(_0x4fc3('0x7'))(_0x4fc3('0xa'));var loggerSyncQueueSummary=require(_0x4fc3('0x7'))('syncQueueSummary');var ami=require(_0x4fc3('0xb'));config['redis']=_[_0x4fc3('0xc')](config[_0x4fc3('0xd')],{'host':_0x4fc3('0xe'),'port':0x18eb});var io=require(_0x4fc3('0xf'))(new Redis(config[_0x4fc3('0xd')]));var cmHopper=require(_0x4fc3('0x10'));var cmHopperHistory=require(_0x4fc3('0x11'));var cmHopperAdditionalPhone=require(_0x4fc3('0x12'));var cmHopperBlack=require(_0x4fc3('0x13'));var voiceQueueRt=require(_0x4fc3('0x14'));var RpcSetting=require(_0x4fc3('0x15'));var Action=require(_0x4fc3('0x16'));var History=require(_0x4fc3('0x17'));var Final=require(_0x4fc3('0x18'));var AgentComplete=require(_0x4fc3('0x19'));var QueueCallerAbandon=require(_0x4fc3('0x1a'));var Hangup=require(_0x4fc3('0x1b'));var ipAgi=process['env'][_0x4fc3('0x1c')]||_0x4fc3('0x1d');var strategy={'rrmemory':_0x4fc3('0x1e'),'roundrobin':_0x4fc3('0x1f')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x4fc3('0x20')][_0x4fc3('0x21')]=function(_0x28dae1){this[_0x4fc3('0x22')]=this[_0x4fc3('0x22')]?this[_0x4fc3('0x22')][_0x4fc3('0x23')](_0x28dae1):_0x28dae1();};function Dialer(_0x21424e,_0x42702c){this[_0x4fc3('0x24')]=new Sequence();this['preview']=_0x42702c;this[_0x4fc3('0x25')]=_0x21424e[_0x4fc3('0x25')];this[_0x4fc3('0x26')]=_0x21424e[_0x4fc3('0x26')];this['agents']=_0x21424e[_0x4fc3('0x27')];this[_0x4fc3('0x28')]=_0x21424e['trunks'];this[_0x4fc3('0x29')]=config[_0x4fc3('0x29')]||0x2;this[_0x4fc3('0x2a')]={};this['actions']={};this[_0x4fc3('0x2b')]={};this['uniqueId']={};this[_0x4fc3('0x2c')]={};this['startPredictive']={};this[_0x4fc3('0x2d')]={};this[_0x4fc3('0x2e')]={};this[_0x4fc3('0x2f')]={};this[_0x4fc3('0x30')]={};ami['on'](_0x4fc3('0x31'),this[_0x4fc3('0x32')][_0x4fc3('0x33')](this));ami['on'](_0x4fc3('0x34'),this[_0x4fc3('0x35')][_0x4fc3('0x33')](this));ami['on']('originateresponse',this[_0x4fc3('0x36')]['bind'](this));ami['on'](_0x4fc3('0x37'),this[_0x4fc3('0x38')]['bind'](this));ami['on'](_0x4fc3('0x39'),this['syncQueueSummary'][_0x4fc3('0x33')](this));ami['on'](_0x4fc3('0x3a'),this['syncQueueSummaryComplete'][_0x4fc3('0x33')](this));ami['on'](_0x4fc3('0x3b'),this[_0x4fc3('0x3c')][_0x4fc3('0x33')](this));ami['on'](_0x4fc3('0x3d'),this[_0x4fc3('0x3e')]['bind'](this));ami['on'](_0x4fc3('0x3f'),this[_0x4fc3('0x40')][_0x4fc3('0x33')](this));ami['on'](_0x4fc3('0x41'),this['syncQueueMember'][_0x4fc3('0x33')](this));ami['on']('queuestatuscomplete',this[_0x4fc3('0x42')]['bind'](this));this[_0x4fc3('0x43')]();this[_0x4fc3('0x44')]();RpcSetting[_0x4fc3('0x45')]()['then'](function(_0x49fd1b){previewRecallmeReminderInterval=_0x49fd1b[_0x4fc3('0x46')];});}function isNotNull(_0x5ddecc){return _0x5ddecc!==null&&!_[_0x4fc3('0x47')](_0x5ddecc);}function checkIsLoggedIn(_0x1a4de5,_0x5494e1){return function(){if(_0x5494e1<=0x0){_0x1a4de5[_0x4fc3('0x48')]=_0x4fc3('0x49');throw _0x1a4de5['name']+_0x4fc3('0x4a');}};}function isActive(_0x5b40cd){return _0x5b40cd;}function checkIsActive(_0x5aaa6a,_0x2b5945){return function(){if(!isActive(_0x2b5945)){_0x5aaa6a[_0x4fc3('0x48')]=_0x4fc3('0x4b');throw _0x5aaa6a[_0x4fc3('0x4c')]+_0x4fc3('0x4d');}};}function checkInterval(_0x30a933){return function(){if(!isNotNull(_0x30a933[_0x4fc3('0x4e')])){_0x30a933[_0x4fc3('0x48')]='INTERVAL_IS_NULL';throw _0x30a933[_0x4fc3('0x4c')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x30a933['Interval']['Intervals'])){_0x30a933[_0x4fc3('0x48')]=_0x4fc3('0x4f');throw _0x30a933['name']+_0x4fc3('0x50');}if(!isNotNull(_[_0x4fc3('0x51')](_0x30a933[_0x4fc3('0x4e')][_0x4fc3('0x52')]))){_0x30a933[_0x4fc3('0x48')]=_0x4fc3('0x4f');throw _0x30a933['name']+_0x4fc3('0x50');}};}function msgResponse(_0x5ce099,_0x288f53,_0xccb49c){return{'action':_0x5ce099,'response':_0x288f53,'message':_0xccb49c,'stack':_0xccb49c};}function myreject(_0x5ca64d){return function(_0x2e16fa){return _0x5ca64d(msgResponse(_0x4fc3('0x53'),_0x4fc3('0x54'),JSON[_0x4fc3('0x55')](_0x2e16fa)));};}function getSeconds(_0xac39a7,_0x21e842){var _0x279e07=moment(_0xac39a7)[_0x4fc3('0x56')](0x0);var _0x415bcb=moment(_0x21e842)[_0x4fc3('0x56')](0x0);return _0x279e07[_0x4fc3('0x57')](_0x415bcb,_0x4fc3('0x58'));}function emit(_0x2ba985,_0x4691e3,_0x5b7221){io['to'](_0x2ba985)[_0x4fc3('0x59')](_0x4691e3,_0x5b7221);}function emitVoiceQueueSummary(_0x397f10){if(_0x397f10[_0x4fc3('0x5a')]==='outbound'){var _0x294694={'id':_0x397f10['id'],'name':_0x397f10[_0x4fc3('0x4c')],'strategy':_0x397f10[_0x4fc3('0x5b')],'answered':_0x397f10[_0x4fc3('0x5c')],'available':_0x397f10['available'],'loggedIn':_0x397f10[_0x4fc3('0x5d')],'pTalking':_0x397f10[_0x4fc3('0x5e')],'sumBillable':_0x397f10[_0x4fc3('0x5f')],'sumDuration':_0x397f10[_0x4fc3('0x60')],'sumHoldTime':_0x397f10[_0x4fc3('0x61')]||0x0,'talking':_0x397f10['talking'],'total':_0x397f10['total'],'type':_0x397f10[_0x4fc3('0x5a')],'unmanaged':_0x397f10['unmanaged'],'abandoned':_0x397f10[_0x4fc3('0x62')],'waiting':_0x397f10[_0x4fc3('0x63')],'loggedInDb':_0x397f10[_0x4fc3('0x64')],'dialActive':_0x397f10[_0x4fc3('0x65')],'dialMethod':_0x397f10[_0x4fc3('0x66')],'dialOriginateCallerIdName':_0x397f10[_0x4fc3('0x67')],'dialOriginateCallerIdNumber':_0x397f10[_0x4fc3('0x68')],'dialOriginateTimeout':_0x397f10['dialOriginateTimeout'],'dialPrefix':_0x397f10['dialPrefix'],'outboundAnswerAgiCallsDay':_0x397f10['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x397f10['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x397f10[_0x4fc3('0x69')],'outboundBusyCallsDay':_0x397f10['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x397f10[_0x4fc3('0x6a')],'outboundDropCallsDayACS':_0x397f10[_0x4fc3('0x6b')],'outboundDropCallsDayCallersExit':_0x397f10[_0x4fc3('0x6c')],'outboundDropCallsDayTimeout':_0x397f10[_0x4fc3('0x6d')],'outboundNoAnswerCallsDay':_0x397f10[_0x4fc3('0x6e')],'outboundNoSuchCallsDay':_0x397f10[_0x4fc3('0x6f')],'outboundOriginateFailureCallsDay':_0x397f10[_0x4fc3('0x70')],'outboundReCallsDay':_0x397f10[_0x4fc3('0x71')],'outboundRejectCallsDay':_0x397f10[_0x4fc3('0x72')],'outboundUnknownCallsDay':_0x397f10[_0x4fc3('0x73')],'predictiveIntervalAnsweredCalls':_0x397f10[_0x4fc3('0x74')],'predictiveIntervalAvgHoldtime':_0x397f10[_0x4fc3('0x75')],'predictiveIntervalAvgTalktime':_0x397f10[_0x4fc3('0x76')],'predictiveIntervalDroppedCallsCallersExit':_0x397f10['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x397f10[_0x4fc3('0x77')],'predictiveIntervalErlangCalls':_0x397f10['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x397f10['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x397f10[_0x4fc3('0x78')],'predictiveIntervalMultiplicativeFactor':_0x397f10[_0x4fc3('0x79')],'predictiveIntervalPauses':_0x397f10[_0x4fc3('0x7a')],'predictiveIntervalAvailable':_0x397f10[_0x4fc3('0x7b')],'predictiveIntervalTotalCalls':_0x397f10[_0x4fc3('0x7c')],'message':_0x397f10[_0x4fc3('0x48')],'originated':_0x397f10[_0x4fc3('0x7d')],'erlangCalls':_0x397f10[_0x4fc3('0x7e')],'erlangCallToSecond':_0x397f10[_0x4fc3('0x7f')],'erlangAbandonmentRate':_0x397f10[_0x4fc3('0x80')],'erlangBusyFactor':_0x397f10['erlangBusyFactor'],'startPredictive':_0x397f10[_0x4fc3('0x81')],'startProgressive':_0x397f10[_0x4fc3('0x2d')]};if(_0x397f10[_0x4fc3('0x82')]){_0x294694[_0x4fc3('0x82')]={'id':_0x397f10['Trunk']['id'],'name':_0x397f10['Trunk'][_0x4fc3('0x4c')],'active':_0x397f10[_0x4fc3('0x82')][_0x4fc3('0x83')],'callerid':_0x397f10[_0x4fc3('0x82')][_0x4fc3('0x84')]};}if(_0x397f10[_0x4fc3('0x4e')]){_0x294694['Interval']={'id':_0x397f10['Interval']['id'],'name':_0x397f10[_0x4fc3('0x4e')][_0x4fc3('0x4c')]};}var _0x4529c3=md5(JSON[_0x4fc3('0x55')](_0x294694));if(_0x397f10[_0x4fc3('0x3')]!==_0x4529c3){_0x397f10[_0x4fc3('0x3')]=_0x4529c3;emit(util[_0x4fc3('0x85')](_0x4fc3('0x86'),_0x294694[_0x4fc3('0x4c')]),_0x4fc3('0x87'),_0x294694);}}}function emitCampaignSummary(_0x254be4){if(_0x254be4[_0x4fc3('0x5a')]===_0x4fc3('0x88')){emit(util[_0x4fc3('0x85')](_0x4fc3('0x89'),_0x254be4[_0x4fc3('0x4c')]),'campaign:save',_0x254be4);}}function checkGetDataPredictive(_0x48649f){if(isNotNull(_0x48649f)&&!_[_0x4fc3('0x51')](_0x48649f)){loggerPredictive[_0x4fc3('0x8a')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x4fc3('0x8a')](_0x4fc3('0x8b'),_0x48649f['predictiveIntervalTotalCalls']);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x48649f[_0x4fc3('0x74')]);loggerPredictive[_0x4fc3('0x8a')](_0x4fc3('0x8c'),_0x48649f[_0x4fc3('0x77')]);loggerPredictive['info'](_0x4fc3('0x8d'),_0x48649f[_0x4fc3('0x8e')]);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x48649f[_0x4fc3('0x75')]);loggerPredictive['info'](_0x4fc3('0x8f'),_0x48649f[_0x4fc3('0x76')]);loggerPredictive[_0x4fc3('0x8a')](_0x4fc3('0x90'));if(_0x48649f[_0x4fc3('0x7c')]>0x0){if(!_[_0x4fc3('0x47')](_0x48649f['predictiveIntervalAvgTalktime'])&&_0x48649f[_0x4fc3('0x76')]>0x0){return!![];}loggerPredictive[_0x4fc3('0x8a')](_0x4fc3('0x91'));if(!_['isUndefined'](_0x48649f[_0x4fc3('0x75')])&&_0x48649f[_0x4fc3('0x75')]>0x0){return!![];}loggerPredictive[_0x4fc3('0x8a')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive['info'](_0x4fc3('0x92'));}}else{loggerPredictive[_0x4fc3('0x8a')](_0x4fc3('0x93'));}return![];}function mergeDataErlangB(_0x2e6cef){return function(_0x9f2e00){loggerPredictive[_0x4fc3('0x8a')](_0x4fc3('0x94'));loggerPredictive[_0x4fc3('0x8a')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x9f2e00[_0x4fc3('0x7e')]);loggerPredictive[_0x4fc3('0x8a')](_0x4fc3('0x95'),_0x9f2e00[_0x4fc3('0x7f')]);loggerPredictive['info'](_0x4fc3('0x96'),_0x9f2e00[_0x4fc3('0x80')]);loggerPredictive[_0x4fc3('0x8a')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x9f2e00['erlangBusyFactor']);loggerPredictive['info'](_0x4fc3('0x96'),_0x9f2e00[_0x4fc3('0x80')]);loggerPredictive['info'](_0x4fc3('0x90'));_['merge'](_0x2e6cef,_0x9f2e00);};}function getDiff(_0x3e92da){var _0x4a6524=moment()[_0x4fc3('0x56')](0x0);var _0x2236c5=moment(_0x3e92da)[_0x4fc3('0x56')](0x0);return _0x4a6524[_0x4fc3('0x57')](_0x2236c5,_0x4fc3('0x58'));}function ifInterval(_0x17265e,_0x96f20b){if(_[_0x4fc3('0x47')](_0x96f20b)){return![];}return getDiff(_0x96f20b)<_0x17265e*0x3c;}function freeVariablesPredictive(_0x5dba92){if(isNotNull(_0x5dba92)){if(!_['isUndefined'](_0x5dba92['startProgressive'])){_0x5dba92['startProgressive']=undefined;loggerPredictive['info'](_0x5dba92[_0x4fc3('0x4c')],_0x4fc3('0x97'));}if(!_[_0x4fc3('0x47')](_0x5dba92[_0x4fc3('0x81')])){_0x5dba92['startPredictive']=undefined;loggerPredictive[_0x4fc3('0x8a')](_0x5dba92[_0x4fc3('0x4c')],_0x4fc3('0x98'));}if(!_[_0x4fc3('0x47')](_0x5dba92['handlePredictive'])){clearInterval(_0x5dba92[_0x4fc3('0x99')]);_0x5dba92[_0x4fc3('0x99')]=undefined;loggerPredictive[_0x4fc3('0x8a')](_0x5dba92[_0x4fc3('0x4c')],_0x4fc3('0x9a'));}}}function erlangb(_0x2983cf,_0x150e57){if(_0x150e57===0x0){return 0x0;}var _0x1b6b8b=0x1;for(var _0x327fc0=0x1;_0x327fc0<=_0x150e57;_0x327fc0+=0x1){_0x1b6b8b=0x1+_0x1b6b8b*_0x327fc0/_0x2983cf;}return 0x1/_0x1b6b8b;}function isVoiceQueueOutbound(_0x515737){return _0x515737==='outbound';}function isNotPreview(_0x5574bc){return _0x5574bc!==_0x4fc3('0x9b');}function isCampaignIvr(_0x52d272){return _0x52d272===_0x4fc3('0x88');}function getCallerId(_0x3fc927,_0x1548c1,_0x48d633){if(!_[_0x4fc3('0x47')](_0x48d633)&&typeof _0x48d633===_0x4fc3('0x9c')&&!_[_0x4fc3('0x51')](_0x48d633)){if(!_[_0x4fc3('0x47')](_0x1548c1)&&typeof _0x1548c1===_0x4fc3('0x9c')&&!_[_0x4fc3('0x51')](_0x1548c1)){return util[_0x4fc3('0x85')](_0x4fc3('0x9d'),_0x1548c1,_0x48d633);}return util[_0x4fc3('0x85')](_0x4fc3('0x9d'),_0x48d633,_0x48d633);}if(!_[_0x4fc3('0x47')](_0x3fc927)&&typeof _0x3fc927==='string'&&!_['isEmpty'](_0x3fc927)){return _0x3fc927;}return _0x4fc3('0x9e');}function loggerCatchQueueSummary(_0x5cfe35,_0x12018f){return function(_0x2734e6){freeVariablesPredictive(_0x12018f);emitVoiceQueueSummary(_0x12018f);emitCampaignSummary(_0x12018f);loggerSyncQueueSummary[_0x4fc3('0x9f')](_0x5cfe35,util['inspect'](_0x2734e6,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0xf903f3,_0x21214e){return function(_0x46b392){loggerPredictive[_0x4fc3('0xa0')](_0x21214e['name'],_0xf903f3);loggerPredictive['error'](_0x46b392[_0x4fc3('0xa1')]);freeVariablesPredictive(_0x21214e);};}function loggerCatch(_0x6c6c61){return function(_0x19fd4b){logger[_0x4fc3('0xa0')](_0x6c6c61,util['inspect'](_0x19fd4b,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x782790){return _0x782790&&!_[_0x4fc3('0x47')](_0x782790)&&_0x782790[_0x4fc3('0xa2')]>0x0;}function decremetOriginate(_0x1bb5a0){if(!_[_0x4fc3('0x47')](_0x1bb5a0)&&_0x1bb5a0!==null){if(typeof _0x1bb5a0['originated']!==_0x4fc3('0xa3')){if(_0x1bb5a0[_0x4fc3('0x7d')]>0x0){_0x1bb5a0[_0x4fc3('0x7d')]-=0x1;}else{logger[_0x4fc3('0xa0')](_0x4fc3('0xa4'));}}}else{logger[_0x4fc3('0xa0')](_0x4fc3('0xa5'));}}function checkContactLowerLimitOriginate(_0x497bff,_0x10e4f6,_0x356a62){if(_0x10e4f6>_0x356a62){for(var _0x22817e=0x0;_0x22817e<_0x10e4f6-_0x356a62;_0x22817e+=0x1){decremetOriginate(_0x497bff);}}}function loggerGetContactDialer(_0x458f8a,_0x506a68,_0x48344e){return function(_0x38ff3a){checkContactLowerLimitOriginate(_0x506a68,_0x48344e,0x0);logger[_0x4fc3('0xa0')](_0x458f8a,util['inspect'](_0x38ff3a,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4aac24){return function(_0x11358c){if(isNotNull(_0x11358c)&&isNotNull(_0x11358c[0x0])){if(_0x11358c[0x0]['contactsRescheduled']>0x0){_0x4aac24['message']='RESCHEDULED_CONTACTS';logger['info'](_0x4fc3('0xa6')+_0x4aac24[_0x4fc3('0x4c')],_0x11358c[0x0][_0x4fc3('0xa7')],_0x4fc3('0xa8'));}else{_0x4aac24[_0x4fc3('0x48')]=_0x4fc3('0xa9');logger[_0x4fc3('0x8a')]('[getContactDialer2][Empty]'+_0x4aac24[_0x4fc3('0x4c')]);}}};}function notSendMessagesQueue(_0x2c2785){if(_0x2c2785[_0x4fc3('0xaa')]){freeVariablesPredictive(_0x2c2785);if(_0x2c2785['originated']===0x0&&_0x2c2785['talking']===0x0&&_0x2c2785[_0x4fc3('0x63')]===0x0&&(_0x2c2785[_0x4fc3('0x5e')]||0x0)===0x0){_0x2c2785['sendMessageOneNotActive']=![];_0x2c2785['available']=0x0;_0x2c2785[_0x4fc3('0x48')]=_0x4fc3('0x4b');loggerSyncQueueSummary[_0x4fc3('0x9f')](_0x4fc3('0xab'),_0x2c2785[_0x4fc3('0x4c')],_0x4fc3('0xac'));}else{_0x2c2785[_0x4fc3('0x48')]=_0x4fc3('0xad');loggerSyncQueueSummary[_0x4fc3('0x9f')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x2c2785['name'],_0x4fc3('0xae'));}emitVoiceQueueSummary(_0x2c2785);}}function notSendMessagesCampaign(_0x27ce50){if(_0x27ce50[_0x4fc3('0xaa')]){if(_0x27ce50[_0x4fc3('0x7d')]===0x0){_0x27ce50['sendMessageOneNotActive']=![];_0x27ce50[_0x4fc3('0x48')]=_0x4fc3('0x4b');loggerSyncQueueSummary[_0x4fc3('0x9f')](_0x4fc3('0xaf'),_0x27ce50['name'],_0x4fc3('0xac'));}else{_0x27ce50[_0x4fc3('0x48')]=_0x4fc3('0xad');loggerSyncQueueSummary[_0x4fc3('0x9f')](_0x4fc3('0xaf'),_0x27ce50[_0x4fc3('0x4c')],_0x4fc3('0xae'));}emitCampaignSummary(_0x27ce50);}}function createObjHistory(_0x526dc5,_0x1e03cf,_0x3c4ea3,_0x6b0c95,_0x92d19a){_0x526dc5['message']=_0x3c4ea3;var _0x6428cf=new Action(_0x526dc5,_0x1e03cf);var _0x44c57f=new History(_0x6428cf);_0x44c57f[_0x4fc3('0xb0')]=_0x6b0c95;_0x44c57f['statedesc']=_0x92d19a;_0x44c57f[_0x4fc3('0xb1')]=_0x6428cf[_0x4fc3('0xb2')];return _0x44c57f;}Dialer['prototype']['loopClearZombieChannels']=function(){var _0x50e343=this;setInterval(function(){_0x50e343['clearZombieChannels'](_0x50e343[_0x4fc3('0xb3')],_0x4fc3('0xb4'));_0x50e343[_0x4fc3('0xb5')](_0x50e343[_0x4fc3('0xb6')],_0x4fc3('0xb7'));},0x32c8);};Dialer[_0x4fc3('0x20')][_0x4fc3('0xb5')]=function(_0x518c0e,_0x1bee19){var _0x2aa1d1=this;for(var _0x321b6c in _0x518c0e){if(typeof _0x518c0e[_0x321b6c]!==_0x4fc3('0xa3')){this['sequence'][_0x4fc3('0x21')](function(){if(!_[_0x4fc3('0xb8')](_0x518c0e[_0x321b6c])){return ami[_0x4fc3('0xb9')]({'action':_0x4fc3('0xba'),'channel':_0x518c0e[_0x321b6c][_0x4fc3('0xbb')]})['catch'](function(_0x2d72b9){if(_0x2d72b9[_0x4fc3('0x48')]===_0x4fc3('0xbc')){setTimeout(function(){if(_0x518c0e[_0x321b6c]&&_0x518c0e[_0x321b6c]['type']!=='ivr'){_0x2aa1d1[_0x4fc3('0xbd')](_0x2aa1d1[_0x4fc3('0x25')][_0x518c0e[_0x321b6c][_0x4fc3('0xbe')]]);logger['error'](_0x4fc3('0xbf'),_0x1bee19,_0x321b6c,_0x518c0e[_0x321b6c][_0x4fc3('0xbe')]);delete _0x518c0e[_0x321b6c];}if(_0x518c0e[_0x321b6c]&&_0x518c0e[_0x321b6c]['type']===_0x4fc3('0x88')){_0x2aa1d1[_0x4fc3('0xbd')](_0x2aa1d1[_0x4fc3('0x26')][_0x518c0e[_0x321b6c][_0x4fc3('0xbe')]]);logger['error']('[Dialer][checkChannel][ivr]',_0x1bee19,_0x321b6c,_0x518c0e[_0x321b6c]['queue']);delete _0x518c0e[_0x321b6c];}},0x2328);}});}});}}};Dialer[_0x4fc3('0x20')][_0x4fc3('0xc0')]=function(_0x21f594){return Promise[_0x4fc3('0xc1')]()['then'](cmHopper['countReScheduled'](_0x21f594))[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0xc3')));};Dialer['prototype'][_0x4fc3('0xc4')]=function(_0x32175b){return Promise[_0x4fc3('0xc1')]()[_0x4fc3('0xc5')](cmHopperBlack[_0x4fc3('0xc4')](_0x32175b))[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0xc6')));};Dialer[_0x4fc3('0x20')][_0x4fc3('0xc7')]=function(_0x13380a,_0x10b79f,_0x22855c){return Promise[_0x4fc3('0xc1')]()[_0x4fc3('0xc5')](cmHopperAdditionalPhone[_0x4fc3('0xc7')](_0x13380a,_0x10b79f,_0x22855c))[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0xc8')));};Dialer[_0x4fc3('0x20')][_0x4fc3('0xc9')]=function(_0x5c5575,_0x380e7c,_0x2716b7){return Promise[_0x4fc3('0xc1')]()[_0x4fc3('0xc5')](cmHopperAdditionalPhone[_0x4fc3('0xc9')](_0x5c5575,_0x380e7c,_0x2716b7))['catch'](loggerCatch(_0x4fc3('0xca')));};Dialer[_0x4fc3('0x20')][_0x4fc3('0xcb')]=function(_0x1a1a9c){return Promise[_0x4fc3('0xc1')]()[_0x4fc3('0xc5')](cmHopperBlack[_0x4fc3('0xcb')](_0x1a1a9c))[_0x4fc3('0xc2')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x4fc3('0x20')][_0x4fc3('0xcc')]=function(_0x44ffb2){return Promise[_0x4fc3('0xc1')]()[_0x4fc3('0xc5')](cmHopperHistory['avgHandleTime'](_0x44ffb2))[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0xcd')));};Dialer[_0x4fc3('0x20')][_0x4fc3('0xce')]=function(_0x47bdc6){return Promise['resolve']()['then'](cmHopper[_0x4fc3('0xce')](_0x47bdc6))['catch'](loggerCatch(_0x4fc3('0xcf')));};Dialer[_0x4fc3('0x20')][_0x4fc3('0xd0')]=function(_0x25e965,_0x25f571,_0x4fbb66){return Promise['resolve']()[_0x4fc3('0xc5')](cmHopper[_0x4fc3('0xd0')](_0x25e965,_0x25f571,_0x4fbb66))['catch'](loggerCatch(_0x4fc3('0xd1')));};Dialer[_0x4fc3('0x20')]['getContactDialer']=function(_0x5c6189,_0x36fcb7,_0x449ca8,_0x358682,_0x1822f5){return Promise[_0x4fc3('0xc1')]()[_0x4fc3('0xc5')](cmHopper[_0x4fc3('0xd2')](_0x5c6189,_0x36fcb7,_0x449ca8,_0x358682))[_0x4fc3('0xc2')](function(_0x3dc363){_0x1822f5[_0x4fc3('0xd3')]-=_0x449ca8;_0x1822f5[_0x4fc3('0xd3')]=_0x1822f5[_0x4fc3('0xd3')]>0x0?_0x1822f5['temp']:0x0;loggerCatch('[getContactDialer]\x20')(_0x3dc363);});};Dialer['prototype'][_0x4fc3('0xd4')]=function(_0x415e51,_0x51f12c,_0x1dd9e0,_0x10489b){return Promise[_0x4fc3('0xc1')]()['then'](cmHopper[_0x4fc3('0xd4')](_0x415e51,_0x51f12c,_0x1dd9e0))[_0x4fc3('0xc2')](function(_0x408696){_0x10489b['temp']-=_0x51f12c;_0x10489b['temp']=_0x10489b[_0x4fc3('0xd3')]>0x0?_0x10489b[_0x4fc3('0xd3')]:0x0;loggerCatch(_0x4fc3('0xd5'))(_0x408696);});};Dialer[_0x4fc3('0x20')][_0x4fc3('0xd6')]=function(_0x218eb5){return Promise[_0x4fc3('0xc1')]()['then'](voiceQueueRt[_0x4fc3('0xd6')](_0x218eb5))[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0xd7')));};Dialer[_0x4fc3('0x20')][_0x4fc3('0xd8')]=function(_0x341b59){return Promise[_0x4fc3('0xc1')]()[_0x4fc3('0xc5')](cmHopper[_0x4fc3('0xd8')](_0x341b59))[_0x4fc3('0xc2')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x4fc3('0x20')][_0x4fc3('0xd9')]=function(_0xa4ec8e){return Promise[_0x4fc3('0xc1')]()[_0x4fc3('0xc5')](cmHopperHistory[_0x4fc3('0xd9')](_0xa4ec8e))['catch'](loggerCatch(_0x4fc3('0xda')));};Dialer['prototype'][_0x4fc3('0xbd')]=function(_0x1d6f29){if(!_[_0x4fc3('0x47')](_0x1d6f29)&&_0x1d6f29!==null){if(typeof _0x1d6f29[_0x4fc3('0x7d')]!==_0x4fc3('0xa3')){if(_0x1d6f29[_0x4fc3('0x7d')]>0x0){_0x1d6f29['originated']-=0x1;}else{logger[_0x4fc3('0xa0')](_0x4fc3('0xdb'));}}}else{logger[_0x4fc3('0xa0')](_0x4fc3('0xdc'));}};Dialer['prototype'][_0x4fc3('0xdd')]=function(_0x275878,_0x5e06f8){var _0x3d823c=this;return function(_0x1ede97){_0x3d823c[_0x4fc3('0xbd')](_0x5e06f8);logger[_0x4fc3('0xa0')](_0x275878,util[_0x4fc3('0xde')](_0x1ede97,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x4fc3('0xdf')]=function(_0x55fe8e,_0x2e8b40,_0x4168a5){var _0x23e91c={'state':0x19,'statedesc':'notFound'};this[_0x4fc3('0xbd')](_0x2e8b40);this[_0x4fc3('0xe0')](_[_0x4fc3('0xe1')](_0x23e91c,_[_0x4fc3('0xe2')](_0x4168a5,[_0x4fc3('0xe3'),_0x4fc3('0xe4'),'UserId',_0x4fc3('0xe5'),_0x4fc3('0xe6')])),'[emptyContact][createHistory]',_0x4fc3('0xe7'));logger['error'](_0x55fe8e);};Dialer[_0x4fc3('0x20')][_0x4fc3('0xe8')]=function(_0x352034){return _0x352034===_0x4fc3('0xe9');};Dialer['prototype']['isTrunkReachable']=function(_0x3d3fc4){return!_['isUndefined'](_0x3d3fc4)&&_0x3d3fc4&&!_[_0x4fc3('0x47')](_0x3d3fc4[_0x4fc3('0x4c')])&&!_[_0x4fc3('0x47')](_0x3d3fc4[_0x4fc3('0x83')])&&_0x3d3fc4['active']&&(this[_0x4fc3('0x28')][util['format']('SIP/%s',_0x3d3fc4['name'])][_0x4fc3('0xba')]===_0x4fc3('0xea')||this['trunks'][util[_0x4fc3('0x85')](_0x4fc3('0xeb'),_0x3d3fc4[_0x4fc3('0x4c')])][_0x4fc3('0xba')]===_0x4fc3('0xec'));};Dialer[_0x4fc3('0x20')][_0x4fc3('0xe0')]=function(_0x41a5c7,_0x322308,_0x29dacd){this['createHistory'](_0x41a5c7)[_0x4fc3('0xc2')](loggerCatch(_0x322308));this[_0x4fc3('0xd8')](_0x41a5c7)[_0x4fc3('0xc2')](loggerCatch(_0x29dacd));};Dialer['prototype'][_0x4fc3('0x40')]=function(_0x4603b4){var _0x426cf1=this;var _0x13491c=this[_0x4fc3('0xb3')][_0x4603b4['uniqueid']];var _0x476263;if(!_['isNil'](_0x4603b4)&&!_[_0x4fc3('0xb8')](_0x4603b4[_0x4fc3('0xed')])&&!_['isNil'](_0x4603b4[_0x4fc3('0xed')][_0x4fc3('0xee')])&&_0x4603b4[_0x4fc3('0xef')]==='xcally-motion-dialer'&&_0x13491c){if(_0x13491c['type']!==_0x4fc3('0x88')&&this[_0x4fc3('0x25')][_0x13491c['queue']]['dialAMDActive']&&_0x4603b4[_0x4fc3('0xf0')]===_0x4fc3('0xf1')){delete this[_0x4fc3('0xb3')][_0x4603b4[_0x4fc3('0xf2')]];this[_0x4fc3('0xbd')](this['voiceQueues'][_0x13491c[_0x4fc3('0xbe')]]);this[_0x4fc3('0x25')][_0x13491c[_0x4fc3('0xbe')]][_0x4fc3('0xf3')]+=0x1;this['voiceQueues'][_0x13491c[_0x4fc3('0xbe')]][_0x4fc3('0xf4')]+=0x1;_0x476263=new Hangup(_0x13491c,_0x4603b4);_0x476263['state']=0x12;_0x476263[_0x4fc3('0xf5')]=_0x4fc3('0xf6');_0x476263[_0x4fc3('0xf7')]=_0x4fc3('0xf8');ami['emit'](_0x4fc3('0xf9'),ut[_0x4fc3('0xfa')](_0x476263,_0x4fc3('0xfb')));this['saveInDb'](_0x476263,_0x4fc3('0xfc'),'[syncHangupInAMD]');}if(_0x13491c[_0x4fc3('0x5a')]!==_0x4fc3('0x88')&&this[_0x4fc3('0x25')][_0x13491c[_0x4fc3('0xbe')]]['dialAMDActive']&&_0x4603b4[_0x4fc3('0xf0')]===_0x4fc3('0xfd')){return new Promise(function(_0x1da0bc,_0x5a8334){delete _0x426cf1[_0x4fc3('0xb3')][_0x4603b4['uniqueid']];_0x426cf1[_0x4fc3('0xbd')](_0x426cf1[_0x4fc3('0x25')][_0x13491c[_0x4fc3('0xbe')]]);_0x426cf1['voiceQueues'][_0x13491c[_0x4fc3('0xbe')]]['outboundAnswerCallsDay']+=0x1;_0x426cf1[_0x4fc3('0x25')][_0x13491c[_0x4fc3('0xbe')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x17bc3e=_0x426cf1['voiceQueues'][_0x13491c[_0x4fc3('0xbe')]];var _0x4057c5=new Hangup(_0x13491c,_0x4603b4);_0x4057c5[_0x4fc3('0xb0')]=0x13;_0x4057c5[_0x4fc3('0xf5')]='Machine';_0x4057c5[_0x4fc3('0xf7')]=_0x4fc3('0xf8');_0x4057c5[_0x4fc3('0xfe')]+=0x1;_0x4057c5['countglobal']+=0x1;_0x4057c5[_0x4fc3('0xfb')]=!![];ami[_0x4fc3('0x59')](_0x4fc3('0xf9'),ut['buildObj'](_0x4057c5,_0x4fc3('0xfb')));_0x426cf1[_0x4fc3('0xd9')](_0x4057c5)[_0x4fc3('0xc2')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x4057c5[_0x4fc3('0xff')]+_0x4057c5[_0x4fc3('0x100')]+_0x4057c5[_0x4fc3('0x101')]+_0x4057c5[_0x4fc3('0x102')]+_0x4057c5['countdropretry']+_0x4057c5[_0x4fc3('0x103')]+_0x4057c5[_0x4fc3('0xfe')]+_0x4057c5[_0x4fc3('0x104')]>=_0x17bc3e['dialGlobalMaxRetry']){_0x426cf1[_0x4fc3('0x105')](_0x4057c5,_0x1da0bc,_0x5a8334,_0x4fc3('0x106'));}else{if(_0x4057c5[_0x4fc3('0xfe')]>=_0x17bc3e[_0x4fc3('0x107')]){_0x426cf1['createStateFinal'](_0x4057c5,_0x1da0bc,_0x5a8334,_0x4fc3('0x108'));}else{_0x426cf1[_0x4fc3('0xce')]({'active':![],'countmachineretry':_0x4057c5[_0x4fc3('0xfe')],'scheduledat':moment()['add'](_0x17bc3e[_0x4fc3('0x109')],'minutes')[_0x4fc3('0x85')](_0x4fc3('0x10a')),'ContactId':_0x4057c5[_0x4fc3('0xe3')],'ListId':_0x4057c5[_0x4fc3('0xe4')],'VoiceQueueId':_0x4057c5[_0x4fc3('0xe5')]||undefined,'CampaignId':_0x4057c5[_0x4fc3('0xe6')]||undefined})[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0x10b')));_0x1da0bc({'reschedule':0x1});}}});}if(_0x13491c[_0x4fc3('0x5a')]===_0x4fc3('0x88')&&this[_0x4fc3('0x26')][_0x13491c[_0x4fc3('0xbe')]]['dialAMDActive']&&_0x4603b4['value']===_0x4fc3('0xf1')){delete this[_0x4fc3('0xb3')][_0x4603b4[_0x4fc3('0xf2')]];this['updateOriginated'](this[_0x4fc3('0x26')][_0x13491c['queue']]);_0x476263=new Hangup(_0x13491c,_0x4603b4);_0x476263[_0x4fc3('0xb0')]=0x12;_0x476263[_0x4fc3('0xf5')]=_0x4fc3('0xf6');_0x476263['membername']=_0x4fc3('0xf8');ami[_0x4fc3('0x59')](_0x4fc3('0xf9'),ut[_0x4fc3('0xfa')](_0x476263,_0x4fc3('0xfb')));this['saveInDb'](_0x476263,_0x4fc3('0x10c'),_0x4fc3('0x10d'));}if(_0x13491c['type']==='ivr'&&this[_0x4fc3('0x26')][_0x13491c[_0x4fc3('0xbe')]][_0x4fc3('0x10e')]&&_0x4603b4[_0x4fc3('0xf0')]===_0x4fc3('0xfd')){return new Promise(function(_0x18c8be,_0x37fa5f){delete _0x426cf1[_0x4fc3('0xb3')][_0x4603b4[_0x4fc3('0xf2')]];_0x426cf1['updateOriginated'](_0x426cf1['campaigns'][_0x13491c[_0x4fc3('0xbe')]]);_0x426cf1[_0x4fc3('0x26')][_0x13491c[_0x4fc3('0xbe')]][_0x4fc3('0xf3')]+=0x1;_0x426cf1[_0x4fc3('0x26')][_0x13491c[_0x4fc3('0xbe')]][_0x4fc3('0xf4')]+=0x1;var _0x26f1bf=_0x426cf1[_0x4fc3('0x26')][_0x13491c[_0x4fc3('0xbe')]];var _0x3084fd=new Hangup(_0x13491c,_0x4603b4);_0x3084fd[_0x4fc3('0xb0')]=0x13;_0x3084fd[_0x4fc3('0xf5')]='Machine';_0x3084fd[_0x4fc3('0xf7')]=_0x4fc3('0xf8');_0x3084fd[_0x4fc3('0xfe')]+=0x1;_0x3084fd[_0x4fc3('0x10f')]+=0x1;_0x3084fd['amd']=!![];ami['emit']('custom:amd',ut[_0x4fc3('0xfa')](_0x3084fd,'amd'));_0x426cf1[_0x4fc3('0xd9')](_0x3084fd)[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0x110')));if(_0x3084fd[_0x4fc3('0xff')]+_0x3084fd[_0x4fc3('0x100')]+_0x3084fd[_0x4fc3('0x101')]+_0x3084fd[_0x4fc3('0x102')]+_0x3084fd['countdropretry']+_0x3084fd['countabandonedretry']+_0x3084fd['countmachineretry']+_0x3084fd['countagentrejectretry']>=_0x26f1bf['dialGlobalMaxRetry']){_0x426cf1[_0x4fc3('0x105')](_0x3084fd,_0x18c8be,_0x37fa5f,_0x4fc3('0x106'));}else{if(_0x3084fd[_0x4fc3('0xfe')]>=_0x26f1bf['dialMachineMaxRetry']){_0x426cf1[_0x4fc3('0x111')](_0x3084fd,_0x18c8be,_0x37fa5f,_0x4fc3('0x108'));}else{_0x426cf1[_0x4fc3('0xce')]({'active':![],'countmachineretry':_0x3084fd[_0x4fc3('0xfe')],'scheduledat':moment()[_0x4fc3('0x112')](_0x26f1bf['dialMachineRetryFrequency'],_0x4fc3('0x113'))['format'](_0x4fc3('0x10a')),'ContactId':_0x3084fd[_0x4fc3('0xe3')],'ListId':_0x3084fd['ListId'],'VoiceQueueId':_0x3084fd['VoiceQueueId']||undefined,'CampaignId':_0x3084fd[_0x4fc3('0xe6')]||undefined})['catch'](loggerCatch(_0x4fc3('0x10b')));_0x18c8be({'reschedule':0x1});}}});}}};Dialer[_0x4fc3('0x20')]['syncHangup']=function(_0x35278f){var _0x537ca3=this[_0x4fc3('0xb3')][_0x35278f[_0x4fc3('0xf2')]];var _0x46d399;if(_0x537ca3&&_0x537ca3[_0x4fc3('0x5a')]==='ivr'){delete this['uniqueId'][_0x35278f['uniqueid']];this[_0x4fc3('0xbd')](this[_0x4fc3('0x26')][_0x537ca3[_0x4fc3('0xbe')]]);this[_0x4fc3('0x26')][_0x537ca3[_0x4fc3('0xbe')]][_0x4fc3('0x114')]+=0x1;_0x46d399=new Hangup(_0x537ca3,_0x35278f);this['createHistory'](_0x46d399)['catch'](loggerCatch(_0x4fc3('0x115')));this[_0x4fc3('0xd8')](_0x46d399)[_0x4fc3('0xc2')](loggerCatch('[syncHangupIvr]'));}if(_0x537ca3&&_0x537ca3[_0x4fc3('0x5a')]!==_0x4fc3('0x88')&&isNotNull(this[_0x4fc3('0x25')][_0x537ca3[_0x4fc3('0xbe')]][_0x4fc3('0x116')])){delete this[_0x4fc3('0xb3')][_0x35278f[_0x4fc3('0xf2')]];this[_0x4fc3('0xbd')](this[_0x4fc3('0x25')][_0x537ca3[_0x4fc3('0xbe')]]);this[_0x4fc3('0x25')][_0x537ca3[_0x4fc3('0xbe')]][_0x4fc3('0xf3')]+=0x1;this[_0x4fc3('0x25')][_0x537ca3[_0x4fc3('0xbe')]][_0x4fc3('0xf4')]+=0x1;_0x46d399=new Hangup(_0x537ca3,_0x35278f);_0x46d399[_0x4fc3('0xb0')]=0x10;_0x46d399[_0x4fc3('0xf5')]=_0x4fc3('0x117');_0x46d399['membername']=_0x4fc3('0x118');this['createHistory'](_0x46d399)[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0x115')));this['moveContactManagedDialer'](_0x46d399)['catch'](loggerCatch(_0x4fc3('0x119')));}if(_0x537ca3&&_0x537ca3[_0x4fc3('0x5a')]!==_0x4fc3('0x88')&&!isNotNull(this['voiceQueues'][_0x537ca3[_0x4fc3('0xbe')]][_0x4fc3('0x116')])){delete this['uniqueId'][_0x35278f['uniqueid']];this['updateOriginated'](this['voiceQueues'][_0x537ca3['queue']]);this[_0x4fc3('0x25')][_0x537ca3[_0x4fc3('0xbe')]]['outboundUnknownCallsDay']+=0x1;_0x46d399=new Hangup(_0x537ca3,_0x35278f);_0x46d399['state']=0xc;_0x46d399[_0x4fc3('0xf5')]=_0x35278f[_0x4fc3('0x11a')];_0x46d399[_0x4fc3('0xf7')]='Unknow';this[_0x4fc3('0xd9')](_0x46d399)[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0x115')));this['moveContactManagedDialer'](_0x46d399)[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0x119')));}};Dialer[_0x4fc3('0x20')][_0x4fc3('0x38')]=function(_0x44f68e){var _0x386e2e=this['uniqueId'][_0x44f68e['uniqueid']];if(this[_0x4fc3('0x25')][_0x44f68e[_0x4fc3('0xbe')]]){if(_0x386e2e&&_0x386e2e[_0x4fc3('0x5a')]!==_0x4fc3('0x88')){delete this[_0x4fc3('0xb3')][_0x44f68e[_0x4fc3('0xf2')]];this[_0x4fc3('0x25')][_0x44f68e[_0x4fc3('0xbe')]][_0x4fc3('0xf3')]+=0x1;var _0x39b721=new AgentComplete(_0x386e2e,_0x44f68e);if(_0x44f68e[_0x4fc3('0x11b')]===_0x4fc3('0x11c')){_0x39b721[_0x4fc3('0x11d')]=this[_0x4fc3('0x25')][_0x44f68e[_0x4fc3('0xbe')]][_0x4fc3('0x11e')]&&this['voiceQueues'][_0x44f68e['queue']][_0x4fc3('0x11f')]?moment()['format'](_0x4fc3('0x10a')):undefined;}this[_0x4fc3('0xd9')](_0x39b721)[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0x120')));this[_0x4fc3('0xd8')](_0x39b721)['catch'](loggerCatch(_0x4fc3('0x121')));}}};Dialer[_0x4fc3('0x20')]['syncAgentConnect']=function(_0x2562e9){if(this[_0x4fc3('0x25')][_0x2562e9[_0x4fc3('0xbe')]]){if(this[_0x4fc3('0xb3')][_0x2562e9[_0x4fc3('0xf2')]]&&this[_0x4fc3('0xb3')][_0x2562e9[_0x4fc3('0xf2')]][_0x4fc3('0x5a')]!==_0x4fc3('0x88')){this[_0x4fc3('0xbd')](this[_0x4fc3('0x25')][_0x2562e9[_0x4fc3('0xbe')]]);this[_0x4fc3('0xb3')][_0x2562e9[_0x4fc3('0xf2')]][_0x4fc3('0x122')]=moment()[_0x4fc3('0x85')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x4fc3('0x20')]['queueCallerAbandonCreateState']=function(_0x3d1c2f,_0x4ed590){this[_0x4fc3('0xd9')](_0x3d1c2f)[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0x120')));if(_0x4ed590==0x0){this[_0x4fc3('0xd8')](_0x3d1c2f)['catch'](loggerCatch(_0x4fc3('0x123')));}};Dialer[_0x4fc3('0x20')][_0x4fc3('0x35')]=function(_0x5be9d5){var _0x2156e4=this[_0x4fc3('0xb3')][_0x5be9d5['uniqueid']];var _0x405868=this;var _0x58d5cc=![];var _0x1b8f97;var _0x504639;if(this[_0x4fc3('0x25')][_0x5be9d5[_0x4fc3('0xbe')]]){if(_0x2156e4&&_0x2156e4[_0x4fc3('0x5a')]!==_0x4fc3('0x88')){delete this[_0x4fc3('0xb3')][_0x5be9d5['uniqueid']];this[_0x4fc3('0xbd')](this[_0x4fc3('0x25')][_0x5be9d5[_0x4fc3('0xbe')]]);_0x2156e4['droptime']=moment()['format'](_0x4fc3('0x10a'));var _0x4b2084=new QueueCallerAbandon(_0x2156e4,_0x5be9d5);if(getSeconds(_0x2156e4['droptime'],_0x2156e4['responsetime'])>=_0x2156e4[_0x4fc3('0x124')]){this[_0x4fc3('0x25')][_0x5be9d5['queue']][_0x4fc3('0x77')]+=0x1;this[_0x4fc3('0x25')][_0x5be9d5[_0x4fc3('0xbe')]][_0x4fc3('0x6d')]+=0x1;this[_0x4fc3('0x25')][_0x5be9d5[_0x4fc3('0xbe')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x4b2084[_0x4fc3('0xb0')]=0xa;_0x4b2084[_0x4fc3('0xf5')]=_0x4fc3('0x125');_0x4b2084[_0x4fc3('0x126')]=_0x4fc3('0x127');_0x4b2084[_0x4fc3('0x11d')]=this[_0x4fc3('0x25')][_0x5be9d5[_0x4fc3('0xbe')]][_0x4fc3('0x11e')]?moment()[_0x4fc3('0x85')](_0x4fc3('0x10a')):undefined;_0x4b2084[_0x4fc3('0x128')]+=0x1;_0x4b2084['countglobal']+=0x1;_0x1b8f97=this['voiceQueues'][_0x5be9d5[_0x4fc3('0xbe')]][_0x4fc3('0x129')];_0x504639=this[_0x4fc3('0x25')][_0x5be9d5[_0x4fc3('0xbe')]][_0x4fc3('0x12a')];_0x405868[_0x4fc3('0xc7')](_0x4b2084,_0x4b2084[_0x4fc3('0xb0')],_0x2156e4[_0x4fc3('0x12b')])[_0x4fc3('0xc5')](function(_0xe697d9){_0x58d5cc=_0xe697d9[_0x4fc3('0x12c')]==0x1;if(_0x4b2084[_0x4fc3('0x128')]>=_0x405868[_0x4fc3('0x25')][_0x5be9d5[_0x4fc3('0xbe')]]['dialDropMaxRetry']){_0x405868[_0x4fc3('0x12d')](_0x4b2084,_0xe697d9[_0x4fc3('0x12c')]);}else{_0x405868[_0x4fc3('0xce')]({'active':![],'countdropretry':_0x4b2084[_0x4fc3('0x128')],'scheduledat':moment()['add'](_0x405868[_0x4fc3('0x25')][_0x5be9d5[_0x4fc3('0xbe')]][_0x4fc3('0x129')],_0x4fc3('0x113'))[_0x4fc3('0x85')](_0x4fc3('0x10a')),'ContactId':_0x2156e4['ContactId'],'ListId':_0x2156e4[_0x4fc3('0xe4')],'VoiceQueueId':_0x2156e4[_0x4fc3('0xe5')]||undefined,'CampaignId':_0x2156e4[_0x4fc3('0xe6')]||undefined})[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0x12e')));var _0x2d355d=new History(_0x4b2084);_0x2d355d[_0x4fc3('0xb0')]=0xa;_0x2d355d[_0x4fc3('0xf5')]=_0x4fc3('0x125');_0x2d355d[_0x4fc3('0xb2')]=moment()['format'](_0x4fc3('0x10a'));_0x2d355d[_0x4fc3('0xb1')]=_0x2d355d['starttime'];_0x2d355d[_0x4fc3('0x12f')]=_0x4b2084['calleridname'];_0x2d355d['calleridnum']=_0x4b2084['calleridnum'];_0x405868[_0x4fc3('0xd9')](_0x2d355d)[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0x130')));}})['then'](function(){if(_0x58d5cc)_0x405868[_0x4fc3('0xc9')](_0x4b2084,_0x1b8f97,_0x504639)['then'](function(){return 0x1;});});}else{this['voiceQueues'][_0x5be9d5['queue']][_0x4fc3('0x8e')]+=0x1;this['voiceQueues'][_0x5be9d5['queue']][_0x4fc3('0x6c')]+=0x1;_0x4b2084[_0x4fc3('0xb0')]=0xb;_0x4b2084[_0x4fc3('0xf5')]=_0x4fc3('0x131');_0x4b2084[_0x4fc3('0x126')]=_0x4fc3('0x132');_0x4b2084['countabandonedretry']+=0x1;_0x4b2084[_0x4fc3('0x10f')]+=0x1;_0x1b8f97=this[_0x4fc3('0x25')][_0x5be9d5['queue']]['dialAbandonedRetryFrequency'];_0x504639=this[_0x4fc3('0x25')][_0x5be9d5['queue']][_0x4fc3('0x12a')];_0x405868[_0x4fc3('0xc7')](_0x4b2084,_0x4b2084[_0x4fc3('0xb0')],_0x2156e4['voiceQueue'])[_0x4fc3('0xc5')](function(_0x2470c5){if(_0x4b2084[_0x4fc3('0x103')]>=_0x405868['voiceQueues'][_0x5be9d5[_0x4fc3('0xbe')]][_0x4fc3('0x133')]){_0x405868[_0x4fc3('0x12d')](_0x4b2084,_0x2470c5[_0x4fc3('0x12c')]);}else{_0x405868[_0x4fc3('0xce')]({'active':![],'countabandonedretry':_0x4b2084[_0x4fc3('0x103')],'scheduledat':moment()[_0x4fc3('0x112')](_0x405868[_0x4fc3('0x25')][_0x5be9d5[_0x4fc3('0xbe')]][_0x4fc3('0x134')],_0x4fc3('0x113'))[_0x4fc3('0x85')](_0x4fc3('0x10a')),'ContactId':_0x2156e4['ContactId'],'ListId':_0x2156e4[_0x4fc3('0xe4')],'VoiceQueueId':_0x2156e4['VoiceQueueId']||undefined,'CampaignId':_0x2156e4['CampaignId']||undefined})[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0x135')));var _0x4fa2dd=new History(_0x4b2084);_0x4fa2dd['state']=0xb;_0x4fa2dd[_0x4fc3('0xf5')]='Abandoned';_0x4fa2dd['starttime']=moment()[_0x4fc3('0x85')](_0x4fc3('0x10a'));_0x4fa2dd['endtime']=_0x4fa2dd['starttime'];_0x4fa2dd[_0x4fc3('0x12f')]=_0x4b2084[_0x4fc3('0x12f')];_0x4fa2dd[_0x4fc3('0x136')]=_0x4b2084['calleridnum'];_0x405868[_0x4fc3('0xd9')](_0x4fa2dd)[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0x137')));}})[_0x4fc3('0xc5')](function(){if(_0x58d5cc)_0x405868[_0x4fc3('0xc9')](_0x4b2084,_0x1b8f97,_0x504639)[_0x4fc3('0xc5')](function(){return 0x1;});});}}}};Dialer['prototype'][_0x4fc3('0x3e')]=function(_0x153ed2){if(this[_0x4fc3('0xb6')][_0x153ed2[_0x4fc3('0xf2')]]){this['actions'][_0x153ed2[_0x4fc3('0xf2')]]['channel']=_0x153ed2[_0x4fc3('0xbb')];}if(this[_0x4fc3('0xb3')][_0x153ed2[_0x4fc3('0xf2')]]){this[_0x4fc3('0xb3')][_0x153ed2[_0x4fc3('0xf2')]][_0x4fc3('0xbb')]=_0x153ed2['channel'];}};Dialer['prototype'][_0x4fc3('0x138')]=function(_0x15232e){if(strategy[this[_0x4fc3('0x25')][this['actions'][_0x15232e[_0x4fc3('0x139')]][_0x4fc3('0xbe')]][_0x4fc3('0x5b')]]===_0x4fc3('0x1f')){if(this['actions'][_0x15232e[_0x4fc3('0x139')]]&&_[_0x4fc3('0xb8')](this[_0x4fc3('0xb6')][_0x15232e[_0x4fc3('0x139')]][_0x4fc3('0x13a')])&&_0x15232e[_0x4fc3('0xba')]==='1'&&_0x15232e[_0x4fc3('0x13b')]==='0'){if(this['agents'][_0x15232e['stateinterface']]){if(!this['agents'][_0x15232e[_0x4fc3('0x13c')]][_0x4fc3('0x13a')]){this['agents'][_0x15232e['stateinterface']][_0x4fc3('0x13a')]=!![];this[_0x4fc3('0xb6')][_0x15232e['actionid']][_0x4fc3('0x13a')]=!![];this['actions'][_0x15232e[_0x4fc3('0x139')]][_0x4fc3('0x13c')]=_0x15232e[_0x4fc3('0x13c')];}}}}else if((strategy[this[_0x4fc3('0x25')][this[_0x4fc3('0xb6')][_0x15232e['actionid']]['queue']][_0x4fc3('0x5b')]]||_0x4fc3('0x1e'))===_0x4fc3('0x1e')){if(this['actions'][_0x15232e[_0x4fc3('0x139')]]){if(this[_0x4fc3('0x27')][_0x15232e[_0x4fc3('0x13c')]]){this[_0x4fc3('0xb6')][_0x15232e[_0x4fc3('0x139')]][_0x4fc3('0x13c')]=_0x15232e[_0x4fc3('0x13c')];if(_[_0x4fc3('0xb8')](this[_0x4fc3('0x2f')][this[_0x4fc3('0xb6')][_0x15232e[_0x4fc3('0x139')]][_0x4fc3('0xbe')]])){this[_0x4fc3('0x2f')][this[_0x4fc3('0xb6')][_0x15232e['actionid']][_0x4fc3('0xbe')]]=[];}this[_0x4fc3('0x2f')][this[_0x4fc3('0xb6')][_0x15232e[_0x4fc3('0x139')]]['queue']][_0x4fc3('0x13d')](_[_0x4fc3('0xe1')](_[_0x4fc3('0xe2')](this['actions'][_0x15232e['actionid']],[_0x4fc3('0x13e'),_0x4fc3('0x13c')]),{'status':_0x15232e[_0x4fc3('0xba')],'paused':_0x15232e[_0x4fc3('0x13b')]}));}}}};function unlockQueueStatus(_0x5b3a5b,_0xa046ec){setTimeout(function(){if(_['isUndefined'](_0x5b3a5b['queueStatusComplete'])){loggerBooked[_0x4fc3('0xa0')](_0x4fc3('0x13f'),_0xa046ec);}_0x5b3a5b[_0x4fc3('0x140')]=!![];loggerBooked[_0x4fc3('0x8a')]('[booked][unlockQueueStatus]',_0xa046ec,JSON[_0x4fc3('0x55')](_[_0x4fc3('0xe2')](_0x5b3a5b,[_0x4fc3('0x4c'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x4fc3('0x20')]['syncQueueStatusComplete']=function(_0x40d66d){var _0x43bb42=this;var _0xe597a3=_0x43bb42[_0x4fc3('0x25')][_0x43bb42[_0x4fc3('0xb6')][_0x40d66d[_0x4fc3('0x139')]][_0x4fc3('0xbe')]];if(strategy[this[_0x4fc3('0x25')][this[_0x4fc3('0xb6')][_0x40d66d['actionid']]['queue']][_0x4fc3('0x5b')]]===_0x4fc3('0x1f')){if(this[_0x4fc3('0xb6')][_0x40d66d['actionid']]&&this[_0x4fc3('0xb6')][_0x40d66d['actionid']][_0x4fc3('0x13c')]){this[_0x4fc3('0x9b')][_0x4fc3('0x141')](this[_0x4fc3('0xb6')][_0x40d66d[_0x4fc3('0x139')]]['idHopper'],this['actions'][_0x40d66d[_0x4fc3('0x139')]][_0x4fc3('0x13c')])[_0x4fc3('0xc2')](function(_0x47fdb4){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0x4fc3('0xde')](_0x47fdb4,{'showHidden':![],'depth':null}));})['finally'](function(){_0x43bb42[_0x4fc3('0xbd')](_0x43bb42[_0x4fc3('0x25')][_0x43bb42[_0x4fc3('0xb6')][_0x40d66d[_0x4fc3('0x139')]][_0x4fc3('0xbe')]]);_0x43bb42[_0x4fc3('0x27')][_0x43bb42[_0x4fc3('0xb6')][_0x40d66d[_0x4fc3('0x139')]][_0x4fc3('0x13c')]]['locked']=![];delete _0x43bb42[_0x4fc3('0xb6')][_0x40d66d[_0x4fc3('0x139')]];unlockQueueStatus(_0xe597a3);});}else{this[_0x4fc3('0xbd')](this[_0x4fc3('0x25')][this[_0x4fc3('0xb6')][_0x40d66d[_0x4fc3('0x139')]][_0x4fc3('0xbe')]]);this[_0x4fc3('0xce')]({'active':![],'ContactId':this['actions'][_0x40d66d[_0x4fc3('0x139')]]['ContactId'],'ListId':this[_0x4fc3('0xb6')][_0x40d66d[_0x4fc3('0x139')]][_0x4fc3('0xe4')],'VoiceQueueId':this[_0x4fc3('0xb6')][_0x40d66d['actionid']][_0x4fc3('0xe5')]||undefined,'CampaignId':this[_0x4fc3('0xb6')][_0x40d66d[_0x4fc3('0x139')]][_0x4fc3('0xe6')]||undefined})[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0x142')));delete this['actions'][_0x40d66d[_0x4fc3('0x139')]];unlockQueueStatus(_0xe597a3);}}else if((strategy[this[_0x4fc3('0x25')][this[_0x4fc3('0xb6')][_0x40d66d[_0x4fc3('0x139')]][_0x4fc3('0xbe')]][_0x4fc3('0x5b')]]||_0x4fc3('0x1e'))===_0x4fc3('0x1e')){var _0x133fcd;if(this[_0x4fc3('0xb6')][_0x40d66d[_0x4fc3('0x139')]]&&!_[_0x4fc3('0x51')](this[_0x4fc3('0x2f')][this[_0x4fc3('0xb6')][_0x40d66d['actionid']]['queue']])){if(this[_0x4fc3('0x30')][_0x43bb42['actions'][_0x40d66d[_0x4fc3('0x139')]][_0x4fc3('0xbe')]]){this['queueBookedRR'][_0x43bb42[_0x4fc3('0xb6')][_0x40d66d['actionid']][_0x4fc3('0xbe')]]=this[_0x4fc3('0x30')][this['actions'][_0x40d66d['actionid']]['queue']]?this[_0x4fc3('0x30')][this[_0x4fc3('0xb6')][_0x40d66d[_0x4fc3('0x139')]][_0x4fc3('0xbe')]]:this[_0x4fc3('0x2f')][this[_0x4fc3('0xb6')][_0x40d66d[_0x4fc3('0x139')]][_0x4fc3('0xbe')]]?this[_0x4fc3('0x2f')][this[_0x4fc3('0xb6')][_0x40d66d[_0x4fc3('0x139')]][_0x4fc3('0xbe')]]['_rr']||0x0:0x0;}this[_0x4fc3('0x2f')][this[_0x4fc3('0xb6')][_0x40d66d['actionid']]['queue']][_0x4fc3('0x143')]=this[_0x4fc3('0x30')][this['actions'][_0x40d66d['actionid']][_0x4fc3('0xbe')]];for(var _0x1a36c3=0x0;_0x1a36c3=0x0;})['catch'](myreject(_0x305f43)));}}else{_0x1cb02c[_0x4fc3('0x13d')](ami['Action']({'action':'command','command':util[_0x4fc3('0x85')](_0x4fc3('0x162'),_0x37800d,!_[_0x4fc3('0x47')](config[_0x4fc3('0x15b')][_0x3e5163])?_0x3e5163:'')})[_0x4fc3('0xc5')](function(_0x20229a){return _0x20229a[_0x4fc3('0x160')]['indexOf'](_0x4fc3('0x163'))>=0x0;})['catch'](myreject(_0x305f43)));}Promise[_0x4fc3('0x164')](_0x1cb02c)[_0x4fc3('0xc5')](function(_0x45ea56){var _0x1dcd4f=_[_0x4fc3('0x165')](_0x45ea56);if(_0x1dcd4f){return _0x5ebe49(_0x1dcd4f);}else{_0x4420e8[_0x4fc3('0x48')]=_0x13beae?_0x4fc3('0x166'):_0x4fc3('0x167');return _0x305f43(msgResponse(_0x4fc3('0x168'),_0x4fc3('0x158'),_0x4fc3('0x169')+_0x13beae+'\x20'+_0x5e905c+'\x20Interval\x20is\x20overtime:\x20'+util[_0x4fc3('0xde')](_0x37800d,{'showHidden':![],'depth':null})+_0x4fc3('0x16a')+_0x3e5163));}})[_0x4fc3('0xc2')](function(_0x187db0){return _0x305f43(msgResponse(_0x4fc3('0x156'),_0x4fc3('0x158'),JSON[_0x4fc3('0x55')](_0x187db0)));});});};Dialer[_0x4fc3('0x20')]['checkDialMethod']=function(_0x37b38a){var _0x343533=this;return function(){switch(_0x37b38a['dialMethod']){case'progressive':freeVariablesPredictive(_0x37b38a);_0x343533[_0x4fc3('0x16b')](_0x37b38a,0x1);break;case _0x4fc3('0x16c'):freeVariablesPredictive(_0x37b38a);_0x343533[_0x4fc3('0x16b')](_0x37b38a,_0x37b38a[_0x4fc3('0x16d')]);break;case _0x4fc3('0x16e'):_0x343533[_0x4fc3('0x16e')](_0x37b38a);break;case _0x4fc3('0x9'):freeVariablesPredictive(_0x37b38a);_0x343533[_0x4fc3('0x16b')](_0x37b38a,0x1);break;default:freeVariablesPredictive(_0x37b38a);logger[_0x4fc3('0xa0')]('Queue',_0x37b38a[_0x4fc3('0x4c')],_0x4fc3('0x16f'));}};};Dialer[_0x4fc3('0x20')]['checkPreviewRecallReminder']=function(_0x5df517){return Promise['resolve']()['then'](cmHopper[_0x4fc3('0x170')](_0x5df517['id'],previewRecallmeReminderInterval))[_0x4fc3('0xc5')](function(_0x3b44b5){for(var _0x3364c1=0x0;_0x3364c1<_0x3b44b5[_0x4fc3('0xa2')];_0x3364c1++){var _0x1f9d4a=_0x3b44b5[_0x3364c1]['Agent'][_0x4fc3('0x4c')];if(_0x1f9d4a)io['to'](util[_0x4fc3('0x85')]('user:%s',_0x1f9d4a))[_0x4fc3('0x59')](_0x4fc3('0x171'),{'hopper':_0x3b44b5[_0x3364c1]});}})[_0x4fc3('0xc2')](function(){});};Dialer[_0x4fc3('0x20')][_0x4fc3('0x172')]=function(_0x4b431d){var _0x5ae7c1=this;return function(){_0x5ae7c1[_0x4fc3('0x173')](_0x4b431d);};};Dialer[_0x4fc3('0x20')][_0x4fc3('0x174')]=function(_0x49c754){var _0x2ba368=this;if(isNotPreview(_0x49c754[_0x4fc3('0x66')])){if(isVoiceQueueOutbound(_0x49c754['type'])&&isActive(_0x49c754[_0x4fc3('0x65')])){_0x49c754[_0x4fc3('0xaa')]=!![];Promise[_0x4fc3('0xc1')]()[_0x4fc3('0xc5')](checkIsLoggedIn(_0x49c754,_0x49c754[_0x4fc3('0x5d')]))[_0x4fc3('0xc5')](checkIsActive(_0x49c754,_0x49c754['dialActive']))['then'](checkInterval(_0x49c754))[_0x4fc3('0xc5')](_0x2ba368[_0x4fc3('0x150')](_0x49c754))[_0x4fc3('0xc5')](_0x2ba368[_0x4fc3('0x155')](_0x49c754[_0x4fc3('0x175')],_0x49c754[_0x4fc3('0x176')],_0x49c754[_0x4fc3('0x4c')],_0x49c754))[_0x4fc3('0xc5')](_0x2ba368[_0x4fc3('0x157')](_0x49c754[_0x4fc3('0x4e')],_0x49c754[_0x4fc3('0x176')],_0x49c754[_0x4fc3('0x4c')],_0x49c754))[_0x4fc3('0xc5')](_0x2ba368[_0x4fc3('0x177')](_0x49c754))[_0x4fc3('0xc2')](loggerCatchQueueSummary(_0x4fc3('0x178'),_0x49c754));}else{notSendMessagesQueue(_0x49c754);}}else{freeVariablesPredictive(_0x49c754);}};Dialer[_0x4fc3('0x20')][_0x4fc3('0x179')]=_[_0x4fc3('0x17a')](function(){var _0x41548f=_[_0x4fc3('0x17b')](this['voiceQueues'],function(_0x2b5452){return _0x2b5452[_0x4fc3('0x17c')];});var _0xdb20d0=_[_0x4fc3('0x17b')](this[_0x4fc3('0x27')],function(_0xb54bb5){return _0xb54bb5[_0x4fc3('0x17d')]&&_0xb54bb5['status']==='reachable';});if(_0x41548f['length']>0x0&&_0xdb20d0[_0x4fc3('0xa2')]>0x0){return Promise[_0x4fc3('0xc1')]()[_0x4fc3('0xc5')](cmHopper[_0x4fc3('0x170')](_[_0x4fc3('0x17e')](_0x41548f,'id'),previewRecallmeReminderInterval,_[_0x4fc3('0x17e')](_0xdb20d0,'id')))['then'](function(_0x2c3919){for(var _0x318cee=0x0;_0x318cee<_0x2c3919[_0x4fc3('0xa2')];_0x318cee++){var _0x4af613=_0x2c3919[_0x318cee][_0x4fc3('0x17f')]['name'];if(_0x4af613)io['to'](util[_0x4fc3('0x85')](_0x4fc3('0x180'),_0x4af613))['emit'](_0x4fc3('0x171'),{'hopper':_0x2c3919[_0x318cee]});}})[_0x4fc3('0xc2')](function(_0xd5e586){logger[_0x4fc3('0xa0')](_0x4fc3('0x181'),_0xd5e586);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x4fc3('0x20')][_0x4fc3('0x14f')]=function(){var _0x421cf3=this;var _0x1bd43e;for(var _0x39c6fc in this[_0x4fc3('0x26')]){if(typeof this['campaigns'][_0x39c6fc]!==_0x4fc3('0xa3')){_0x1bd43e=this[_0x4fc3('0x26')][_0x39c6fc];if(isCampaignIvr(_0x1bd43e[_0x4fc3('0x5a')])&&isActive(_0x1bd43e['active'])){_0x1bd43e[_0x4fc3('0xaa')]=!![];Promise['resolve']()[_0x4fc3('0xc5')](checkIsActive(_0x1bd43e,_0x1bd43e['active']))['then'](checkInterval(_0x1bd43e))[_0x4fc3('0xc5')](_0x421cf3[_0x4fc3('0x150')](_0x1bd43e))['then'](_0x421cf3['checkIfTime'](_0x1bd43e[_0x4fc3('0x175')],_0x1bd43e[_0x4fc3('0x176')],_0x1bd43e[_0x4fc3('0x4c')],_0x1bd43e))['then'](_0x421cf3['checkIfTimeIntervals'](_0x1bd43e[_0x4fc3('0x4e')],_0x1bd43e['dialTimezone'],_0x1bd43e['name'],_0x1bd43e))[_0x4fc3('0xc5')](_0x421cf3[_0x4fc3('0x172')](_0x1bd43e))['catch'](loggerCatchQueueSummary(_0x4fc3('0x182'),_0x1bd43e));}else{notSendMessagesCampaign(_0x1bd43e);}}}};function getCallerIdRandom(_0x402857,_0x15c84c){var _0x28317a;var _0x3b5df7;var _0x7ca608;if(_0x15c84c<=0x0){_0x15c84c=0x1;}_0x28317a=new RegExp(_0x4fc3('0x183')+_0x15c84c+'}$');_0x3b5df7=Math[_0x4fc3('0x184')](0xa,_0x15c84c-0x1);_0x7ca608=Math[_0x4fc3('0x184')](0xa,_0x15c84c)-0x1;return util[_0x4fc3('0x85')]('%s',_['replace'](_0x402857,_0x28317a,_[_0x4fc3('0x185')](_0x3b5df7,_0x7ca608)));}function extractCalleridName(_0x1d7ef1){var _0x5880c8=_0x1d7ef1[_0x4fc3('0x186')](/"(.*?)"/);return _0x5880c8?_0x5880c8[0x1]:_0x1d7ef1;}Dialer[_0x4fc3('0x20')][_0x4fc3('0x187')]=function(_0x3f5a5c,_0x43a1c8){var _0x541e03=this;var _0x3870bd=uuid['v4']();this[_0x4fc3('0xb6')][_0x3870bd]=new Action(_0x3f5a5c,_0x43a1c8,_0x3870bd);return new Promise(function(_0x481a7f,_0x2997fa){if(_[_0x4fc3('0x47')](_0x3f5a5c)&&typeof _0x3f5a5c!==_0x4fc3('0x188')){return _0x2997fa(msgResponse(_0x4fc3('0x189'),_0x4fc3('0x158'),_0x4fc3('0x18a')));}if(_[_0x4fc3('0x47')](_0x43a1c8[_0x4fc3('0x18b')])||_0x43a1c8[_0x4fc3('0x18b')]===null){return _0x2997fa(msgResponse(_0x4fc3('0x189'),_0x4fc3('0x158'),'contact\x20is\x20undefine'));}var _0x4f91e5={'XMD-CALLERID':_0x541e03[_0x4fc3('0xb6')][_0x3870bd]['getCaller'](),'XMD-AGI':_0x3f5a5c['dialQueueProject']?util[_0x4fc3('0x85')](_0x4fc3('0x18c'),ipAgi,_0x3f5a5c['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x3f5a5c['dialQueueProject2']?util[_0x4fc3('0x85')](_0x4fc3('0x18c'),ipAgi,_0x3f5a5c[_0x4fc3('0x11e')]):_0x4fc3('0x18d'),'XMD-QUEUE':_0x3f5a5c[_0x4fc3('0x5a')]===_0x4fc3('0x18e')?util[_0x4fc3('0x85')](_0x4fc3('0x18f'),_0x3f5a5c[_0x4fc3('0x4c')],_0x3f5a5c['dialQueueOptions']||'',_0x3f5a5c[_0x4fc3('0x11f')]?'c':'',_0x3f5a5c[_0x4fc3('0x124')]||0x3):_0x4fc3('0x18d'),'XMD-CONTACTID':_0x43a1c8['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x541e03[_0x4fc3('0xb6')][_0x3870bd][_0x4fc3('0x190')](),'XMD-AMD':_0x3f5a5c[_0x4fc3('0x10e')]?'ACTIVE':_0x4fc3('0x18d'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x3f5a5c[_0x4fc3('0x10e')]){_0x4f91e5[_0x4fc3('0x191')]=_0x3f5a5c[_0x4fc3('0x192')]||0x9c4;_0x4f91e5['XMD-AMDGREETING']=_0x3f5a5c[_0x4fc3('0x193')]||0x5dc;_0x4f91e5[_0x4fc3('0x194')]=_0x3f5a5c['dialAMDAfterGreetingSilence']||0x320;_0x4f91e5[_0x4fc3('0x195')]=_0x3f5a5c[_0x4fc3('0x196')]||0x1388;_0x4f91e5[_0x4fc3('0x197')]=_0x3f5a5c['dialAMDMinWordLength']||0x64;_0x4f91e5[_0x4fc3('0x198')]=_0x3f5a5c[_0x4fc3('0x199')]||0x32;_0x4f91e5['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x3f5a5c[_0x4fc3('0x19a')]||0x3;_0x4f91e5[_0x4fc3('0x19b')]=_0x3f5a5c[_0x4fc3('0x19c')]||0x100;_0x4f91e5[_0x4fc3('0x19d')]=_0x3f5a5c[_0x4fc3('0x19e')]||0x1388;}if(_0x3f5a5c[_0x4fc3('0x5a')]===_0x4fc3('0x18e')){_0x4f91e5['XMD-VOICEQUEUEID']=_0x43a1c8[_0x4fc3('0xe5')];}else{_0x4f91e5[_0x4fc3('0x19f')]=_0x43a1c8[_0x4fc3('0xe6')];}for(var _0x47044e in _0x43a1c8['Contact']){if(typeof _0x43a1c8[_0x4fc3('0x1a0')][_0x47044e]!==_0x4fc3('0xa3')){if(isNotNull(_0x43a1c8[_0x4fc3('0x1a0')][_0x47044e])&&_0x47044e!=='id'&&_0x47044e!==_0x4fc3('0x1a1')&&_0x47044e!=='createdAt'&&_0x47044e!==_0x4fc3('0x1a2')){_0x4f91e5[util['format'](_0x4fc3('0x1a3'),_0x4fc3('0x1a4'),_[_0x4fc3('0x1a5')](_0x47044e))]=_0x43a1c8['Contact'][_0x47044e];}}}var _0x513fc4=_0x541e03[_0x4fc3('0x151')](_0x3f5a5c[_0x4fc3('0x82')])?getCallerId(_0x3f5a5c[_0x4fc3('0x82')][_0x4fc3('0x84')],_0x3f5a5c[_0x4fc3('0x67')],_0x3f5a5c[_0x4fc3('0x1a6')]>0x0?getCallerIdRandom(_0x3f5a5c[_0x4fc3('0x68')],_0x3f5a5c[_0x4fc3('0x1a6')]):_0x3f5a5c[_0x4fc3('0x68')]):getCallerId(_[_0x4fc3('0xb8')](_0x3f5a5c[_0x4fc3('0x152')])?_0x3f5a5c[_0x4fc3('0x82')][_0x4fc3('0x84')]:_0x3f5a5c['TrunkBackup'][_0x4fc3('0x84')],_0x3f5a5c['dialOriginateCallerIdName'],_0x3f5a5c[_0x4fc3('0x1a6')]>0x0?getCallerIdRandom(_0x3f5a5c[_0x4fc3('0x68')],_0x3f5a5c[_0x4fc3('0x1a6')]):_0x3f5a5c['dialOriginateCallerIdNumber']);if(_0x513fc4){_0x4f91e5['XMD-ORIGINATECALLERIDNAME']=_0x541e03[_0x4fc3('0xb6')][_0x3870bd][_0x4fc3('0x1a7')]=extractCalleridName(_0x513fc4);_0x4f91e5[_0x4fc3('0x1a8')]=_0x43a1c8[_0x4fc3('0x18b')];}_0x3f5a5c[_0x4fc3('0x1a9')]=_0x4f91e5;return ami[_0x4fc3('0xb9')]({'actionid':_0x3870bd,'action':_0x4fc3('0x189'),'channel':_0x541e03['isTrunkReachable'](_0x3f5a5c['Trunk'])?util[_0x4fc3('0x85')](_0x4fc3('0x1aa'),_0x3f5a5c[_0x4fc3('0x82')][_0x4fc3('0x4c')],isNotNull(_0x3f5a5c[_0x4fc3('0x1ab')])?_0x3f5a5c[_0x4fc3('0x1ab')][_0x4fc3('0x1ac')]()||'':'',_0x3f5a5c['dialCutDigit']>0x0?_0x43a1c8[_0x4fc3('0x18b')][_0x4fc3('0x1ad')](_0x3f5a5c[_0x4fc3('0x1ae')]):_0x43a1c8['phone']):util[_0x4fc3('0x85')](_0x4fc3('0x1aa'),_[_0x4fc3('0xb8')](_0x3f5a5c[_0x4fc3('0x152')])?_0x3f5a5c[_0x4fc3('0x82')][_0x4fc3('0x4c')]:_0x3f5a5c[_0x4fc3('0x152')][_0x4fc3('0x4c')],isNotNull(_0x3f5a5c[_0x4fc3('0x1ab')])?_0x3f5a5c[_0x4fc3('0x1ab')][_0x4fc3('0x1ac')]()||'':'',_0x3f5a5c[_0x4fc3('0x1ae')]>0x0?_0x43a1c8['phone'][_0x4fc3('0x1ad')](_0x3f5a5c[_0x4fc3('0x1ae')]):_0x43a1c8[_0x4fc3('0x18b')]),'callerid':_0x513fc4,'Exten':'xcally-motion-dialer','Context':_0x4fc3('0x1af'),'Priority':'1','variable':_0x4f91e5,'timeout':(_0x3f5a5c['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x3870bd})['then'](function(_0x2a396d){return _0x481a7f(_0x2a396d);})[_0x4fc3('0xc2')](function(_0x494ced){_0x3f5a5c['outboundOriginateFailureCallsDay']+=0x1;var _0x4de51d=new History(_0x541e03[_0x4fc3('0xb6')][_0x3870bd]);logger[_0x4fc3('0xa0')](util[_0x4fc3('0x85')](_0x4fc3('0x1b0'),JSON[_0x4fc3('0x55')](_0x494ced)));_0x4de51d[_0x4fc3('0xb0')]=0xe;_0x4de51d[_0x4fc3('0xf5')]=_0x4fc3('0x1b1');_0x4de51d[_0x4fc3('0xb2')]=moment()[_0x4fc3('0x85')](_0x4fc3('0x10a'));_0x4de51d['endtime']=_0x4de51d['starttime'];_0x541e03[_0x4fc3('0xd9')](_0x4de51d)[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0x1b2')));_0x541e03[_0x4fc3('0xd8')](_0x4de51d)[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0x1b2')))[_0x4fc3('0x23')](function(){delete _0x541e03[_0x4fc3('0xb6')][_0x3870bd];return _0x2997fa(msgResponse(_0x4fc3('0x189'),_0x4fc3('0x54'),_0x4fc3('0x1b3')));});});});};Dialer['prototype'][_0x4fc3('0x36')]=function(_0x2b6aae){var _0x3c8160=this[_0x4fc3('0xb6')][_0x2b6aae[_0x4fc3('0x139')]];if(_0x3c8160){delete this[_0x4fc3('0xb6')][_0x2b6aae[_0x4fc3('0x139')]];_0x3c8160[_0x4fc3('0x1b4')]=moment()['format'](_0x4fc3('0x10a'));var _0xf9f40e=_0x3c8160['type']===_0x4fc3('0x88')?this[_0x4fc3('0x26')][_0x3c8160['queue']]:this[_0x4fc3('0x25')][_0x3c8160[_0x4fc3('0x1b5')]()];if(!this[_0x4fc3('0xe8')](_0x2b6aae[_0x4fc3('0x1b6')])){this[_0x4fc3('0xbd')](_0xf9f40e);return this['callProgressDetecting'](_0x3c8160,_0xf9f40e,_0x2b6aae)[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0x1b7')));}this[_0x4fc3('0xb3')][_0x2b6aae[_0x4fc3('0xf2')]]=_0x3c8160;}};Dialer[_0x4fc3('0x20')]['checkRetriveMax']=function(_0x58f97d,_0x4654ad,_0x1ea403){var _0x8585e=new History(_0x4654ad);if(_0x8585e[_0x4fc3('0xff')]+_0x8585e['countcongestionretry']+_0x8585e['countnoanswerretry']+_0x8585e[_0x4fc3('0x102')]+_0x8585e[_0x4fc3('0x128')]+_0x8585e[_0x4fc3('0x103')]+_0x8585e[_0x4fc3('0xfe')]+_0x8585e['countagentrejectretry']>=_0x1ea403[_0x4fc3('0x1b8')]-0x1){return!![];}switch(_0x58f97d){case 0x3:if(_0x8585e[_0x4fc3('0x101')]>=_0x1ea403[_0x4fc3('0x1b9')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x8585e['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x1ea403[_0x4fc3('0x1ba')],_0x4fc3('0x113'))['format'](_0x4fc3('0x10a')),'ContactId':_0x8585e[_0x4fc3('0xe3')],'ListId':_0x8585e[_0x4fc3('0xe4')],'VoiceQueueId':_0x8585e[_0x4fc3('0xe5')]||undefined,'CampaignId':_0x8585e[_0x4fc3('0xe6')]||undefined})[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0x1bb')));break;case 0x5:if(_0x8585e[_0x4fc3('0xff')]>=_0x1ea403[_0x4fc3('0x1bc')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x8585e['countbusyretry']+=0x1,'scheduledat':moment()[_0x4fc3('0x112')](_0x1ea403[_0x4fc3('0x1bd')],_0x4fc3('0x113'))[_0x4fc3('0x85')](_0x4fc3('0x10a')),'ContactId':_0x8585e[_0x4fc3('0xe3')],'ListId':_0x8585e[_0x4fc3('0xe4')],'VoiceQueueId':_0x8585e['VoiceQueueId']||undefined,'CampaignId':_0x8585e[_0x4fc3('0xe6')]||undefined})[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0x1be')));break;case 0x8:if(_0x8585e['countcongestionretry']>=_0x1ea403[_0x4fc3('0x1bf')]-0x1){return!![];}this[_0x4fc3('0xce')]({'active':![],'countcongestionretry':_0x8585e[_0x4fc3('0x100')]+=0x1,'scheduledat':moment()[_0x4fc3('0x112')](_0x1ea403[_0x4fc3('0x1c0')],_0x4fc3('0x113'))['format'](_0x4fc3('0x10a')),'ContactId':_0x8585e['ContactId'],'ListId':_0x8585e[_0x4fc3('0xe4')],'VoiceQueueId':_0x8585e[_0x4fc3('0xe5')]||undefined,'CampaignId':_0x8585e[_0x4fc3('0xe6')]||undefined})[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0x1c1')));break;case 0x0:if(_0x8585e[_0x4fc3('0x102')]>=_0x1ea403['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x4fc3('0xce')]({'active':![],'countnosuchnumberretry':_0x8585e[_0x4fc3('0x102')]+=0x1,'scheduledat':moment()[_0x4fc3('0x112')](_0x1ea403[_0x4fc3('0x1c2')],_0x4fc3('0x113'))[_0x4fc3('0x85')](_0x4fc3('0x10a')),'ContactId':_0x8585e[_0x4fc3('0xe3')],'ListId':_0x8585e['ListId'],'VoiceQueueId':_0x8585e[_0x4fc3('0xe5')]||undefined,'CampaignId':_0x8585e[_0x4fc3('0xe6')]||undefined})[_0x4fc3('0xc2')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x8585e['countdropretry']>=_0x1ea403[_0x4fc3('0x1c3')]-0x1){return!![];}this[_0x4fc3('0xce')]({'active':![],'countdropretry':_0x8585e[_0x4fc3('0x128')]+=0x1,'scheduledat':moment()[_0x4fc3('0x112')](_0x1ea403[_0x4fc3('0x129')],'minutes')[_0x4fc3('0x85')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x8585e[_0x4fc3('0xe3')],'ListId':_0x8585e[_0x4fc3('0xe4')],'VoiceQueueId':_0x8585e[_0x4fc3('0xe5')]||undefined,'CampaignId':_0x8585e[_0x4fc3('0xe6')]||undefined})['catch'](loggerCatch(_0x4fc3('0x12e')));break;case 0xb:if(_0x8585e['countabandonedretry']>=_0x1ea403[_0x4fc3('0x133')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x8585e['countabandonedretry']+=0x1,'scheduledat':moment()['add'](_0x1ea403[_0x4fc3('0x134')],_0x4fc3('0x113'))[_0x4fc3('0x85')](_0x4fc3('0x10a')),'ContactId':_0x8585e[_0x4fc3('0xe3')],'ListId':_0x8585e[_0x4fc3('0xe4')],'VoiceQueueId':_0x8585e['VoiceQueueId']||undefined,'CampaignId':_0x8585e[_0x4fc3('0xe6')]||undefined})['catch'](loggerCatch(_0x4fc3('0x135')));break;case 0x13:if(_0x8585e[_0x4fc3('0xfe')]>=_0x1ea403[_0x4fc3('0x107')]-0x1){return!![];}this[_0x4fc3('0xce')]({'active':![],'countmachineretry':_0x8585e[_0x4fc3('0xfe')]+=0x1,'scheduledat':moment()['add'](_0x1ea403[_0x4fc3('0x109')],_0x4fc3('0x113'))[_0x4fc3('0x85')](_0x4fc3('0x10a')),'ContactId':_0x8585e[_0x4fc3('0xe3')],'ListId':_0x8585e[_0x4fc3('0xe4')],'VoiceQueueId':_0x8585e[_0x4fc3('0xe5')]||undefined,'CampaignId':_0x8585e[_0x4fc3('0xe6')]||undefined})[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0x10b')));break;case 0x14:if(_0x8585e[_0x4fc3('0x104')]>=_0x1ea403[_0x4fc3('0x1c4')]-0x1){return!![];}this[_0x4fc3('0xce')]({'active':![],'countagentrejectretry':_0x8585e['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x4fc3('0x112')](_0x1ea403[_0x4fc3('0x1c5')],_0x4fc3('0x113'))[_0x4fc3('0x85')](_0x4fc3('0x10a')),'ContactId':_0x8585e[_0x4fc3('0xe3')],'ListId':_0x8585e['ListId'],'VoiceQueueId':_0x8585e[_0x4fc3('0xe5')]||undefined,'CampaignId':_0x8585e[_0x4fc3('0xe6')]||undefined})[_0x4fc3('0xc2')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x4fc3('0x20')]['callProgressDetecting']=function(_0x2e54bc,_0x574d29,_0x1acac5){var _0x5e653b=this;var _0xd5daca=new History(_0x2e54bc);var _0xb8f05a=![];var _0x40ec85;var _0x291ab3;return new Promise(function(_0x48f1bf,_0x4766e5){if(_[_0x4fc3('0x47')](_0x574d29)&&typeof _0x574d29!==_0x4fc3('0x188')){return _0x4766e5(msgResponse(_0x4fc3('0x1c6'),_0x4fc3('0x158'),_0x4fc3('0x1c7')));}if(_[_0x4fc3('0x47')](_0x1acac5)&&typeof _0x1acac5!=='object'){return _0x4766e5(msgResponse(_0x4fc3('0x1c6'),'Failure','evt\x20is\x20undefine'));}_0x5e653b[_0x4fc3('0xc7')](_0xd5daca,_0x1acac5[_0x4fc3('0x11b')],_0x574d29)[_0x4fc3('0xc5')](function(_0x298b82){if(_0x298b82[_0x4fc3('0x12c')]==0x1)_0xb8f05a=!![];switch(_0x1acac5['reason']){case'0':_0x574d29[_0x4fc3('0x6f')]+=0x1;_0xd5daca[_0x4fc3('0xb0')]=0x0;_0xd5daca[_0x4fc3('0xf5')]=_0x4fc3('0x1c8');_0xd5daca[_0x4fc3('0x102')]+=0x1;_0xd5daca[_0x4fc3('0x10f')]+=0x1;ami[_0x4fc3('0x59')]('custom:agentnosuchnumber',ut[_0x4fc3('0xfa')](_0x2e54bc,_0x4fc3('0x1c9')));_0x40ec85=_0x574d29[_0x4fc3('0x1c2')];_0x291ab3=_0x574d29[_0x4fc3('0x12a')];_0x5e653b[_0x4fc3('0xd9')](_0xd5daca)['catch'](loggerCatch(_0x4fc3('0x110')));if(_0x5e653b[_0x4fc3('0x1ca')](0x0,_0x2e54bc,_0x574d29)&&!_0xb8f05a){if(_0xd5daca[_0x4fc3('0x102')]>=_0x574d29[_0x4fc3('0x1cb')]){_0x5e653b[_0x4fc3('0x111')](_0xd5daca,_0x48f1bf,_0x4766e5,_0x4fc3('0x1cc'));}else{_0x5e653b[_0x4fc3('0x105')](_0xd5daca,_0x48f1bf,_0x4766e5,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x574d29[_0x4fc3('0x6e')]+=0x1;_0xd5daca[_0x4fc3('0xb0')]=0x3;_0xd5daca[_0x4fc3('0xf5')]=_0x4fc3('0x1cd');_0xd5daca[_0x4fc3('0x101')]+=0x1;_0xd5daca[_0x4fc3('0x10f')]+=0x1;var _0x3bb023=ut[_0x4fc3('0x1ce')](_0x2e54bc,_0x574d29);ami[_0x4fc3('0x59')](_0x4fc3('0x1cf'),_0x3bb023);_0x40ec85=_0x574d29[_0x4fc3('0x1ba')];_0x291ab3=_0x574d29[_0x4fc3('0x12a')];_0x5e653b['createHistory'](_0xd5daca)[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0x1d0')));if(_0x5e653b[_0x4fc3('0x1ca')](0x3,_0x2e54bc,_0x574d29)&&!_0xb8f05a){if(_0xd5daca[_0x4fc3('0x101')]>=_0x574d29[_0x4fc3('0x1b9')]){_0x5e653b[_0x4fc3('0x111')](_0xd5daca,_0x48f1bf,_0x4766e5,_0x4fc3('0x1d1'));}else{_0x5e653b[_0x4fc3('0x105')](_0xd5daca,_0x48f1bf,_0x4766e5,_0x4fc3('0x1d1'));}}break;case'5':_0x574d29[_0x4fc3('0x1d2')]+=0x1;_0xd5daca[_0x4fc3('0xb0')]=0x5;_0xd5daca[_0x4fc3('0xf5')]=_0x4fc3('0x1d3');_0xd5daca[_0x4fc3('0xff')]+=0x1;_0xd5daca[_0x4fc3('0x10f')]+=0x1;ami[_0x4fc3('0x59')](_0x4fc3('0x1d4'),ut[_0x4fc3('0xfa')](_0x2e54bc,'busy'));_0x40ec85=_0x574d29['dialBusyRetryFrequency'];_0x291ab3=_0x574d29[_0x4fc3('0x12a')];_0x5e653b[_0x4fc3('0xd9')](_0xd5daca)[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0x1d5')));if(_0x5e653b[_0x4fc3('0x1ca')](0x5,_0x2e54bc,_0x574d29)&&!_0xb8f05a){if(_0xd5daca[_0x4fc3('0xff')]>=_0x574d29[_0x4fc3('0x1bc')]){_0x5e653b[_0x4fc3('0x111')](_0xd5daca,_0x48f1bf,_0x4766e5,_0x4fc3('0x1d6'));}else{_0x5e653b[_0x4fc3('0x105')](_0xd5daca,_0x48f1bf,_0x4766e5,_0x4fc3('0x1d6'));}}break;case'8':_0x574d29[_0x4fc3('0x6a')]+=0x1;_0xd5daca[_0x4fc3('0xb0')]=0x8;_0xd5daca['statedesc']=_0x4fc3('0x1d7');_0xd5daca[_0x4fc3('0x100')]+=0x1;_0xd5daca[_0x4fc3('0x10f')]+=0x1;_0x40ec85=_0x574d29[_0x4fc3('0x1c0')];_0x291ab3=_0x574d29[_0x4fc3('0x12a')];ami[_0x4fc3('0x59')](_0x4fc3('0x1d8'),ut[_0x4fc3('0xfa')](_0x2e54bc,_0x4fc3('0x1d9')));_0x5e653b[_0x4fc3('0xd9')](_0xd5daca)[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0x1da')));if(_0x5e653b['checkRetriveMax'](0x8,_0x2e54bc,_0x574d29)&&!_0xb8f05a){if(_0xd5daca[_0x4fc3('0x100')]>=_0x574d29[_0x4fc3('0x1bf')]){_0x5e653b[_0x4fc3('0x111')](_0xd5daca,_0x48f1bf,_0x4766e5,_0x4fc3('0x1db'));}else{_0x5e653b[_0x4fc3('0x105')](_0xd5daca,_0x48f1bf,_0x4766e5,_0x4fc3('0x1db'));}}break;case'11':_0x574d29[_0x4fc3('0x1dc')]+=0x1;_0xd5daca[_0x4fc3('0xb0')]=0xb;_0xd5daca[_0x4fc3('0xf5')]='Abandoned';_0xd5daca[_0x4fc3('0x103')]+=0x1;_0xd5daca[_0x4fc3('0x10f')]+=0x1;_0x40ec85=_0x574d29[_0x4fc3('0x134')];_0x291ab3=_0x574d29[_0x4fc3('0x12a')];_0x5e653b[_0x4fc3('0xd9')](_0xd5daca)[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0x137')));if(_0x5e653b[_0x4fc3('0x1ca')](0xb,_0x2e54bc,_0x574d29)&&!_0xb8f05a){if(_0xd5daca['countabandonedretry']>=_0x574d29[_0x4fc3('0x133')]){_0x5e653b['createStateFinal'](_0xd5daca,_0x48f1bf,_0x4766e5,_0x4fc3('0x1dd'));}else{_0x5e653b[_0x4fc3('0x105')](_0xd5daca,_0x48f1bf,_0x4766e5,'reason\x2011\x20abandoned');}}break;case'20':_0x574d29['outboundRejectCallsDay']+=0x1;_0xd5daca[_0x4fc3('0xb0')]=0x14;_0xd5daca[_0x4fc3('0xf5')]='AgentReject';_0xd5daca[_0x4fc3('0x104')]+=0x1;_0xd5daca[_0x4fc3('0x10f')]+=0x1;_0x40ec85=_0x574d29['dialAgentRejectRetryFrequency'];_0x291ab3=_0x574d29[_0x4fc3('0x12a')];ami['emit'](_0x4fc3('0x1de'),ut[_0x4fc3('0xfa')](_0x2e54bc,_0x4fc3('0x1df')));_0x5e653b[_0x4fc3('0xd9')](_0xd5daca)[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0x1e0')));if(_0x5e653b[_0x4fc3('0x1ca')](0x14,_0x2e54bc,_0x574d29)&&!_0xb8f05a){if(_0xd5daca[_0x4fc3('0x104')]>=_0x574d29['dialAgentRejectMaxRetry']){_0x5e653b[_0x4fc3('0x111')](_0xd5daca,_0x48f1bf,_0x4766e5,'reason\x2020\x20agentreject');}else{_0x5e653b['stateGlobal'](_0xd5daca,_0x48f1bf,_0x4766e5,_0x4fc3('0x1e1'));}}break;default:_0x574d29['outboundUnknownCallsDay']+=0x1;_0xd5daca[_0x4fc3('0xb0')]=0xc;_0xd5daca[_0x4fc3('0xf5')]=_0x1acac5[_0x4fc3('0x11b')];_0x40ec85=_0x574d29['dialAgentRejectRetryFrequency'];_0x291ab3=_0x574d29[_0x4fc3('0x12a')];_0x5e653b['createHistory'](_0xd5daca)[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0x1e2')));if(_0x5e653b[_0x4fc3('0x1ca')](_0x1acac5[_0x4fc3('0x11b')],_0x2e54bc,_0x574d29)&&!_0xb8f05a){if(_0xd5daca['countbusyretry']+_0xd5daca[_0x4fc3('0x100')]+_0xd5daca[_0x4fc3('0x101')]+_0xd5daca['countnosuchnumberretry']+_0xd5daca[_0x4fc3('0x128')]+_0xd5daca['countabandonedretry']+_0xd5daca[_0x4fc3('0xfe')]+_0xd5daca[_0x4fc3('0x104')]>=_0x574d29[_0x4fc3('0x1b8')]){_0x5e653b[_0x4fc3('0x105')](_0xd5daca,_0x48f1bf,_0x4766e5,_0x1acac5[_0x4fc3('0x11b')]);}else{_0x5e653b[_0x4fc3('0x111')](_0xd5daca,_0x48f1bf,_0x4766e5,_0x1acac5[_0x4fc3('0x11b')]);}}}})[_0x4fc3('0xc5')](function(){if(_0xb8f05a){_0x5e653b[_0x4fc3('0xc9')](_0xd5daca,_0x40ec85,_0x291ab3)['then'](function(){return _0x48f1bf(0x1);});}});});};Dialer[_0x4fc3('0x20')][_0x4fc3('0x105')]=function(_0x506446,_0x57384d,_0x71a886,_0x34ab05){var _0x399171=new Final(_0x506446);_0x399171[_0x4fc3('0xb0')]=0xf;_0x399171['statedesc']=_0x4fc3('0x1e3');this[_0x4fc3('0x111')](_0x399171,_0x57384d,_0x71a886,_0x34ab05);};Dialer[_0x4fc3('0x20')][_0x4fc3('0x111')]=function(_0x4ce38d,_0x452178,_0x447d24,_0x5a225b){this[_0x4fc3('0xd8')](_0x4ce38d)[_0x4fc3('0xc5')](function(){return _0x452178(msgResponse('[callProgressDetecting]',_0x4fc3('0xe9'),_0x5a225b));})[_0x4fc3('0xc2')](function(){return _0x447d24(msgResponse(_0x4fc3('0x1e4'),_0x4fc3('0x158'),'contact\x20not\x20moved'));});};Dialer[_0x4fc3('0x20')][_0x4fc3('0x16e')]=function(_0x1c62fe){var _0x3b3432=_0x1c62fe[_0x4fc3('0x1e5')]/0x64;var _0x226d9f=_0x1c62fe[_0x4fc3('0x6d')]/(_0x1c62fe[_0x4fc3('0x6d')]+_0x1c62fe[_0x4fc3('0xf3')]);var _0xc1f175=Math[_0x4fc3('0x1e6')](_0x1c62fe[_0x4fc3('0x7b')]*(_0x1c62fe[_0x4fc3('0x1e7')]/0x64));var _0x445cae=Math['round'](_0x1c62fe[_0x4fc3('0x7b')]*(_0x1c62fe[_0x4fc3('0x1e8')]/0x64));var _0x1fe912=_0x1c62fe['available']+_0x1c62fe[_0x4fc3('0x1e9')];var _0x16981c=Math['floor'](_0x1c62fe['erlangCalls']*_0x1c62fe[_0x4fc3('0x80')]*_0x1c62fe[_0x4fc3('0x78')]*_0x1c62fe[_0x4fc3('0x79')]);if(_['isUndefined'](_0x1c62fe[_0x4fc3('0x2d')])){if(!_[_0x4fc3('0x47')](_0x1c62fe[_0x4fc3('0x81')])){_0x1c62fe[_0x4fc3('0x81')]=undefined;loggerPredictive[_0x4fc3('0xa0')](_0x4fc3('0x1ea'),_0x4fc3('0x1eb'));}if(!_[_0x4fc3('0x47')](_0x1c62fe[_0x4fc3('0x99')])){loggerPredictive[_0x4fc3('0xa0')](_0x4fc3('0x1ea'),_0x4fc3('0x1ec'));clearInterval(_0x1c62fe[_0x4fc3('0x99')]);_0x1c62fe[_0x4fc3('0x99')]=undefined;}_0x1c62fe[_0x4fc3('0x2d')]=moment()[_0x4fc3('0x85')](_0x4fc3('0x10a'));loggerPredictive[_0x4fc3('0x8a')](_0x1c62fe[_0x4fc3('0x4c')],_0x4fc3('0x1ed'),_0x1c62fe[_0x4fc3('0x2d')]);this[_0x4fc3('0x16b')](_0x1c62fe,0x1);}else if(ifInterval(_0x1c62fe[_0x4fc3('0x1ee')],_0x1c62fe[_0x4fc3('0x2d')])){this[_0x4fc3('0x16b')](_0x1c62fe,0x1);loggerPredictiveCalls[_0x4fc3('0x8a')](_0x4fc3('0x1ef'),_0x1c62fe['startProgressive'],_0x1c62fe['name']);_0x1c62fe[_0x4fc3('0x7e')]=0x0;_0x1c62fe[_0x4fc3('0x1f0')]=0x0;}else if(_0x3b3432<_0x226d9f&&_0x1c62fe[_0x4fc3('0x1f1')]===_0x4fc3('0x1f2')){freeVariablesPredictive(_0x1c62fe);loggerPredictive['info'](_0x4fc3('0x1f3'),_0x4fc3('0x1f4'),_0x226d9f,_0x4fc3('0x2d'),_0x1c62fe[_0x4fc3('0x4c')]);}else if(_0x16981c<_0x1c62fe[_0x4fc3('0x1f0')]&&_0x1c62fe[_0x4fc3('0x1f1')]===_0x4fc3('0x1f2')){freeVariablesPredictive(_0x1c62fe);loggerPredictive[_0x4fc3('0x8a')](_0x4fc3('0x1f5'),_0x4fc3('0x1f6'),_0x16981c,_0x4fc3('0x1f7'),_0x1c62fe[_0x4fc3('0x1f0')],_0x4fc3('0x2d'),_0x1c62fe[_0x4fc3('0x4c')]);}else if(!ifInterval(_0x1c62fe['dialPredictiveInterval'],_0x1c62fe[_0x4fc3('0x2d')])&&_[_0x4fc3('0x47')](_0x1c62fe[_0x4fc3('0x81')])&&!_[_0x4fc3('0x47')](_0x1c62fe['startProgressive'])){_0x1c62fe['startPredictive']=moment()[_0x4fc3('0x85')](_0x4fc3('0x10a'));loggerPredictive[_0x4fc3('0x8a')](_0x1c62fe['name'],_0x4fc3('0x1f8'),_0x1c62fe[_0x4fc3('0x81')]);this[_0x4fc3('0xcc')](_0x1c62fe['dialPredictiveInterval'])['then'](this['getDataPredictive'](_0x1c62fe))[_0x4fc3('0xc5')](mergeDataErlangB(_0x1c62fe))[_0x4fc3('0xc5')](this['startMethodPredictive'](_0x1c62fe))['catch'](loggerCatchPredictive(_0x4fc3('0x1f9'),_0x1c62fe));}else if(!ifInterval(_0x1c62fe[_0x4fc3('0x1ee')],_0x1c62fe[_0x4fc3('0x81')])){_0x1c62fe[_0x4fc3('0x1f0')]=0x0;_0x1c62fe['startPredictive']=moment()['format'](_0x4fc3('0x10a'));loggerPredictive[_0x4fc3('0x8a')](_0x1c62fe[_0x4fc3('0x4c')],_0x4fc3('0x1fa'),_0x1c62fe[_0x4fc3('0x81')]);clearInterval(_0x1c62fe[_0x4fc3('0x99')]);_0x1c62fe['handlePredictive']=undefined;this[_0x4fc3('0xcc')](_0x1c62fe[_0x4fc3('0x1ee')])[_0x4fc3('0xc5')](this['getDataPredictive'](_0x1c62fe))[_0x4fc3('0xc5')](mergeDataErlangB(_0x1c62fe))['then'](this['startMethodPredictive'](_0x1c62fe))[_0x4fc3('0xc2')](loggerCatchPredictive(_0x4fc3('0x1fb'),_0x1c62fe));}else if(_0x1c62fe[_0x4fc3('0x7b')]&&_0x1fe912<_0x1c62fe[_0x4fc3('0x7b')]-_0x445cae){freeVariablesPredictive(_0x1c62fe);loggerPredictive[_0x4fc3('0x8a')](_0x1c62fe[_0x4fc3('0x4c')],_0x4fc3('0x1fc'),_0x1fe912,_0x4fc3('0x1fd'),_0x1c62fe[_0x4fc3('0x7b')],'-',_0x445cae,'=',_0x1c62fe['predictiveIntervalAvailable']-_0x445cae,')');}else if(_0x1c62fe['predictiveIntervalAvailable']&&_0x1fe912>_0x1c62fe[_0x4fc3('0x7b')]+_0xc1f175){freeVariablesPredictive(_0x1c62fe);loggerPredictive[_0x4fc3('0x8a')](_0x1c62fe[_0x4fc3('0x4c')],_0x4fc3('0x1fc'),_0x1fe912,_0x4fc3('0x1fe'),_0x1c62fe[_0x4fc3('0x7b')],'+',_0xc1f175,'=',_0x1c62fe[_0x4fc3('0x7b')]+_0xc1f175,')');}};Dialer[_0x4fc3('0x20')]['getDataPredictive']=function(_0x28c424){var _0xcc16d6=this;return function(_0x57ad66){return new Promise(function(_0x549539,_0x5e28e4){_[_0x4fc3('0xe1')](_0x28c424,_0x57ad66[0x0]);if(checkGetDataPredictive(_0x57ad66[0x0])){var _0x29ba06=_0x28c424[_0x4fc3('0x7b')]=_0x28c424[_0x4fc3('0x1e9')]+_0x28c424[_0x4fc3('0x1ff')];var _0x536088=_0x28c424['dialPredictiveInterval']*0x3c;var _0xdce52e=_0x57ad66[0x0][_0x4fc3('0x76')]+_0x57ad66[0x0][_0x4fc3('0x75')];var _0x2ff48d=(_0x57ad66[0x0][_0x4fc3('0x74')]+_0x57ad66[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x57ad66[0x0][_0x4fc3('0x8e')])/_0x57ad66[0x0]['predictiveIntervalTotalCalls'];_0x28c424[_0x4fc3('0x78')]=_0x2ff48d>0x0?_0x2ff48d:0x1;switch(_0x28c424[_0x4fc3('0x1f1')]){case _0x4fc3('0x1f2'):var _0x3fb5db=_0x28c424[_0x4fc3('0x1e5')]/0x64;return _0xcc16d6[_0x4fc3('0x200')](_0x29ba06,_0x536088,_0xdce52e,_0x2ff48d,_0x3fb5db)[_0x4fc3('0xc5')](function(_0x14a51b){return _0x549539(_0x14a51b);});case _0x4fc3('0x201'):var _0x317b56=_0x28c424[_0x4fc3('0x1e5')]/0x64;return _0xcc16d6[_0x4fc3('0x202')](_0x29ba06,_0x536088,_0xdce52e,_0x2ff48d,_0x317b56)[_0x4fc3('0xc5')](function(_0x4090c5){return _0x549539(_0x4090c5);});default:return _0x5e28e4(msgResponse(_0x4fc3('0x203'),_0x4fc3('0x158'),_0x4fc3('0x204')));}}else{return _0x5e28e4(msgResponse(_0x4fc3('0x203'),_0x4fc3('0x158'),_0x4fc3('0x205')));}});};};Dialer[_0x4fc3('0x20')]['getDataPredictiveOld']=function(_0x9c84df){var _0x5b6f84=this;return function(_0x577a3e){return new Promise(function(_0x132c3e,_0x1b6254){_[_0x4fc3('0xe1')](_0x9c84df,_0x577a3e[0x0]);if(checkGetDataPredictive(_0x577a3e[0x0])){loggerPredictive[_0x4fc3('0x8a')](JSON[_0x4fc3('0x55')](_0x577a3e[0x0]));if(_0x9c84df[_0x4fc3('0x1f1')]==='dropRate'){return _0x5b6f84[_0x4fc3('0xd6')](_0x9c84df['id'])[_0x4fc3('0xc5')](function(_0x49ef1f){var _0x1510c5=_0x9c84df[_0x4fc3('0x5d')]-_0x49ef1f[0x0][_0x4fc3('0x206')];var _0x18e353=_0x9c84df[_0x4fc3('0x1ee')]*0x3c;var _0x3dc6b3=_0x577a3e[0x0][_0x4fc3('0x76')]+_0x577a3e[0x0][_0x4fc3('0x75')];var _0x49cbbe=(_0x577a3e[0x0]['predictiveIntervalAnsweredCalls']+_0x577a3e[0x0][_0x4fc3('0x77')]+_0x577a3e[0x0][_0x4fc3('0x8e')])/_0x577a3e[0x0][_0x4fc3('0x7c')];var _0x4281a7=_0x9c84df[_0x4fc3('0x1e5')]/0x64;_0x9c84df['predictiveIntervalPauses']=_0x49ef1f[0x0][_0x4fc3('0x206')]||0x0;_0x9c84df[_0x4fc3('0x78')]=_0x49cbbe>0x0?_0x49cbbe:0x1;return _0x5b6f84[_0x4fc3('0x200')](_0x1510c5,_0x18e353,_0x3dc6b3,_0x49cbbe,_0x4281a7);})[_0x4fc3('0xc5')](function(_0x37f16a){return _0x132c3e(_0x37f16a);})['catch'](function(_0x598343){return _0x1b6254(msgResponse(_0x4fc3('0x207'),_0x4fc3('0x158'),JSON['stringify'](_0x598343)));});}if(_0x9c84df[_0x4fc3('0x1f1')]===_0x4fc3('0x201')){return _0x5b6f84[_0x4fc3('0xd6')](_0x9c84df['id'])[_0x4fc3('0xc5')](function(_0x4a2e22){var _0xe25795=_0x9c84df['loggedIn']-_0x4a2e22[0x0][_0x4fc3('0x206')];var _0x4ed6bc=_0x9c84df[_0x4fc3('0x1ee')]*0x3c;var _0x34f35c=_0x577a3e[0x0]['predictiveIntervalAvgTalktime']+_0x577a3e[0x0][_0x4fc3('0x75')];var _0x3c8f96=(_0x577a3e[0x0]['predictiveIntervalAnsweredCalls']+_0x577a3e[0x0][_0x4fc3('0x77')]+_0x577a3e[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x577a3e[0x0]['predictiveIntervalTotalCalls'];var _0x576181=_0x9c84df[_0x4fc3('0x1e5')]/0x64;_0x9c84df[_0x4fc3('0x7a')]=_0x4a2e22[0x0][_0x4fc3('0x206')]||0x0;_0x9c84df[_0x4fc3('0x78')]=_0x3c8f96>0x0?_0x3c8f96:0x1;return _0x5b6f84[_0x4fc3('0x202')](_0xe25795,_0x4ed6bc,_0x34f35c,_0x3c8f96,_0x576181);})[_0x4fc3('0xc5')](function(_0x1efcf0){return _0x132c3e(_0x1efcf0);})[_0x4fc3('0xc2')](function(_0x51b55c){return _0x1b6254(msgResponse('[CatchErlangB]',_0x4fc3('0x158'),JSON[_0x4fc3('0x55')](_0x51b55c)));});}}else{return _0x1b6254(msgResponse('[getDataPredictive]','Failure',_0x4fc3('0x205')));}});};};Dialer[_0x4fc3('0x20')][_0x4fc3('0x208')]=function(_0x548547){var _0x7a05a3=this;return function(){var _0x1a2541=0x0;var _0x5568b9=Math[_0x4fc3('0x209')](_0x548547[_0x4fc3('0x7f')]*0x3e8);if(_0x5568b9>0x0){_0x5568b9=_0x5568b9<0x64?0x64:_0x5568b9;loggerPredictive[_0x4fc3('0x8a')](_0x548547[_0x4fc3('0x4c')],'one\x20call\x20every:',_0x5568b9,_0x4fc3('0x56'));_0x548547[_0x4fc3('0x99')]=setInterval(function(){_0x7a05a3[_0x4fc3('0x99')](_0x548547);loggerPredictiveCalls[_0x4fc3('0x8a')](_0x4fc3('0x20a'),_0x1a2541+=0x1);},_0x5568b9);}else{loggerPredictive[_0x4fc3('0x8a')](_0x548547[_0x4fc3('0x4c')],_0x4fc3('0x20b'));}};};Dialer[_0x4fc3('0x20')][_0x4fc3('0x20c')]=function(_0x4c635b,_0x5d8b99){var _0x3ec57b=this;return function(_0x5cd620){if(_[_0x4fc3('0x51')](_0x5cd620)){if(_['isNil'](_0x5d8b99['UserId'])||!_0x5d8b99[_0x4fc3('0x20d')]){if(_0x4c635b[_0x4fc3('0x66')]==='booked'){_0x4c635b[_0x4fc3('0x140')]=_['isUndefined'](_0x4c635b[_0x4fc3('0x140')])?!![]:_0x4c635b[_0x4fc3('0x140')];var _0xf25883=uuid['v4']();_0x3ec57b[_0x4fc3('0xb6')][_0xf25883]=new Action(_0x4c635b,_0x5d8b99,_0xf25883);loggerBooked['info'](_0x4fc3('0x20e'),_0xf25883,_0x4fc3('0x20f'),JSON[_0x4fc3('0x55')](_0x4c635b['queueStatusComplete']),_0x4fc3('0x210'),_0x4c635b[_0x4fc3('0x4c')]);if(_0x4c635b[_0x4fc3('0x140')]){_0x4c635b['queueStatusComplete']=![];_0x3ec57b[_0x4fc3('0x2f')][_0x3ec57b[_0x4fc3('0xb6')][_0xf25883][_0x4fc3('0xbe')]]=[];ami[_0x4fc3('0xb9')]({'actionid':_0xf25883,'action':_0x4fc3('0x211'),'queue':_0x4c635b[_0x4fc3('0x4c')]})[_0x4fc3('0xc2')](function(){_0x3ec57b['updateOriginated'](_0x4c635b);_0x3ec57b[_0x4fc3('0xce')]({'active':![],'ContactId':_0x3ec57b[_0x4fc3('0xb6')][_0xf25883][_0x4fc3('0xe3')],'ListId':_0x3ec57b[_0x4fc3('0xb6')][_0xf25883][_0x4fc3('0xe4')],'VoiceQueueId':_0x3ec57b['actions'][_0xf25883][_0x4fc3('0xe5')]||undefined,'CampaignId':_0x3ec57b[_0x4fc3('0xb6')][_0xf25883][_0x4fc3('0xe6')]||undefined})['catch'](loggerCatch(_0x4fc3('0x212')));delete _0x3ec57b[_0x4fc3('0xb6')][_0xf25883];});}else{loggerBooked['info'](_0x4fc3('0x213'),JSON[_0x4fc3('0x55')](_0x4c635b['queueStatusComplete']),_0x4fc3('0x210'),_0x4c635b[_0x4fc3('0x4c')]);_0x3ec57b['updateOriginated'](_0x4c635b);_0x3ec57b['rescheduleContact']({'active':![],'ContactId':_0x3ec57b[_0x4fc3('0xb6')][_0xf25883][_0x4fc3('0xe3')],'ListId':_0x3ec57b['actions'][_0xf25883]['ListId'],'VoiceQueueId':_0x3ec57b[_0x4fc3('0xb6')][_0xf25883][_0x4fc3('0xe5')]||undefined,'CampaignId':_0x3ec57b[_0x4fc3('0xb6')][_0xf25883][_0x4fc3('0xe6')]||undefined})[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0x212')));delete _0x3ec57b[_0x4fc3('0xb6')][_0xf25883];}}else{return _0x3ec57b[_0x4fc3('0x187')](_0x4c635b,_0x5d8b99);}}else{if(getDiff(_0x5d8b99[_0x4fc3('0x214')])<_0x4c635b[_0x4fc3('0x215')]*0x3c){if(_0x5d8b99[_0x4fc3('0x17f')]&&!_0x5d8b99['Agent']['voicePause']){_0x3ec57b[_0x4fc3('0x9b')][_0x4fc3('0x141')](_0x5d8b99['id'])[_0x4fc3('0x23')](function(){_0x3ec57b[_0x4fc3('0xbd')](_0x4c635b);});}else{_0x3ec57b[_0x4fc3('0xd0')]({'active':![]},_0x5d8b99['id'],0x1)[_0x4fc3('0x23')](function(){_0x3ec57b['updateOriginated'](_0x4c635b);});}}else{_0x4c635b[_0x4fc3('0x71')]+=0x1;_0x3ec57b[_0x4fc3('0xbd')](_0x4c635b);if(_0x4c635b[_0x4fc3('0x216')]){_0x3ec57b['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5d8b99[_0x4fc3('0xe3')],'ListId':_0x5d8b99['ListId'],'VoiceQueueId':_0x5d8b99['VoiceQueueId']||undefined,'CampaignId':_0x5d8b99['CampaignId']||undefined})[_0x4fc3('0xc2')](loggerCatch(_0x4fc3('0x217')));_0x3ec57b[_0x4fc3('0xd9')](createObjHistory(_0x4c635b,_0x5d8b99,_0x4fc3('0x218'),0x17,_0x4fc3('0x219')))['catch'](loggerCatch(_0x4fc3('0x21a')));}else{_0x3ec57b[_0x4fc3('0xe0')](createObjHistory(_0x4c635b,_0x5d8b99,_0x4fc3('0x21b'),0x16,_0x4fc3('0x21c')),'[Originate][HistoryRecallClose][historyCatch]',_0x4fc3('0x21d'));}}}}else{_0x4c635b['outboundBlacklistCallsDay']+=0x1;_0x3ec57b[_0x4fc3('0xe0')](createObjHistory(_0x4c635b,_0x5d8b99,_0x4fc3('0x21e'),0xd,_0x4fc3('0x21f')),_0x4fc3('0x220'),_0x4fc3('0x221'));throw _0x4fc3('0x222');}};};Dialer[_0x4fc3('0x20')][_0x4fc3('0x173')]=function(_0x4171da){var _0x39828f=this;var _0x5ddb55=_0x4171da['limitCalls']-_0x4171da[_0x4fc3('0x7d')]-_0x4171da[_0x4fc3('0xd3')];emitCampaignSummary(_0x4171da);if(_0x5ddb55>0x0){if(_0x5ddb55>this[_0x4fc3('0x29')]){_0x5ddb55=this[_0x4fc3('0x29')];}_0x4171da[_0x4fc3('0xd3')]+=_0x5ddb55;this[_0x4fc3('0xd4')](_0x4171da['id'],_0x5ddb55,_0x4171da[_0x4fc3('0x223')],_0x4171da)[_0x4fc3('0xc5')](function(_0x3c2a29){_0x4171da[_0x4fc3('0xd3')]-=_0x5ddb55;_0x4171da[_0x4fc3('0xd3')]=_0x4171da['temp']>0x0?_0x4171da[_0x4fc3('0xd3')]:0x0;if(!checkContactEmpty(_0x3c2a29)){_0x4171da[_0x4fc3('0x48')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x4fc3('0x8a')]('[getContactCampaign2][Empty]'+_0x4171da[_0x4fc3('0x4c')]);}else{_0x4171da[_0x4fc3('0x7d')]+=_0x3c2a29[_0x4fc3('0xa2')];_0x4171da[_0x4fc3('0x48')]=_0x4fc3('0x224');for(var _0x243029=0x0;_0x243029<_0x3c2a29[_0x4fc3('0xa2')];_0x243029+=0x1){_0x4171da[_0x4fc3('0x225')]+=0x1;if(_[_0x4fc3('0xb8')](_0x3c2a29[_0x243029])||_[_0x4fc3('0xb8')](_0x3c2a29[_0x243029]['Contact'])||_['isNil'](_0x3c2a29[_0x243029]['phone'])){_0x39828f[_0x4fc3('0xdf')](_0x4fc3('0x226'),_0x4171da,_0x3c2a29[_0x243029]);}else{_0x39828f['checkIsBlackListIvr'](_['pick'](_0x3c2a29[_0x243029],[_0x4fc3('0xe6'),_0x4fc3('0x227')]))[_0x4fc3('0xc5')](_0x39828f['checkContactBlack'](_0x4171da,_0x3c2a29[_0x243029]))[_0x4fc3('0xc2')](_0x39828f['loggerHandler'](_0x4fc3('0x228'),_0x4171da));}}}})[_0x4fc3('0xc2')](loggerGetContactDialer(_0x4fc3('0x229'),_0x4171da,_0x5ddb55));}};Dialer[_0x4fc3('0x20')][_0x4fc3('0x16b')]=function(_0x6b6305,_0x3b1398){var _0xb5eb90=this;var _0x4583f6=[];var _0x25dd6c=_0x3b1398>=0x1?_0x3b1398:0x1;if(_0x6b6305[_0x4fc3('0x66')]===_0x4fc3('0x9')){_0x25dd6c=0x1;}var _0x4a8f79=Math['floor'](_0x6b6305[_0x4fc3('0x1ff')]*_0x25dd6c)-_0x6b6305[_0x4fc3('0x7d')]-_0x6b6305[_0x4fc3('0xd3')];emitVoiceQueueSummary(_0x6b6305);if(_0x6b6305[_0x4fc3('0x22a')]>0x0){var _0x3de6ed=_0x6b6305[_0x4fc3('0x22a')]-_0x6b6305[_0x4fc3('0x7d')]-_0x6b6305['talking']-_0x6b6305[_0x4fc3('0xd3')]-_0x6b6305[_0x4fc3('0x5e')];if(_0x4a8f79>_0x3de6ed){_0x4a8f79=_0x3de6ed;}}if(_0x4a8f79>0x0){if(_0x6b6305[_0x4fc3('0x66')]===_0x4fc3('0x9')){_0x4a8f79=0x1;}if(_0x4a8f79>this[_0x4fc3('0x29')]){_0x4a8f79=this['maxNumberOriginate'];}_0x6b6305[_0x4fc3('0xd3')]+=_0x4a8f79;for(var _0x54d739 in this['agents']){if(typeof this[_0x4fc3('0x27')][_0x54d739]!==_0x4fc3('0xa3')){if(this[_0x4fc3('0x27')][_0x54d739][_0x4fc3('0xb0')]===_0x4fc3('0x22b')&&this[_0x4fc3('0x27')][_0x54d739]['status']===_0x4fc3('0xea')){_0x4583f6[_0x4fc3('0x13d')](this[_0x4fc3('0x27')][_0x54d739]['id']);}}}this[_0x4fc3('0xd2')](_0x6b6305['id'],_0x4583f6,_0x4a8f79,_0x6b6305[_0x4fc3('0x223')],_0x6b6305)[_0x4fc3('0xc5')](function(_0x50b323){_0x6b6305['temp']-=_0x4a8f79;_0x6b6305[_0x4fc3('0xd3')]=_0x6b6305['temp']>0x0?_0x6b6305[_0x4fc3('0xd3')]:0x0;if(!checkContactEmpty(_0x50b323)){_0xb5eb90[_0x4fc3('0xc0')](_0x6b6305)['then'](sendMessageReschedule(_0x6b6305))['catch'](loggerCatch(_0x4fc3('0xc3')));}else{_0x6b6305[_0x4fc3('0x7d')]+=_0x50b323[_0x4fc3('0xa2')];_0x6b6305[_0x4fc3('0x48')]=_0x6b6305[_0x4fc3('0x66')]===_0x4fc3('0x9')?_0x4fc3('0x22c'):'RUNNING';for(var _0x63c88c=0x0;_0x63c88c<_0x50b323[_0x4fc3('0xa2')];_0x63c88c+=0x1){if(_[_0x4fc3('0xb8')](_0x50b323[_0x63c88c])||_[_0x4fc3('0xb8')](_0x50b323[_0x63c88c][_0x4fc3('0x1a0')])||_[_0x4fc3('0xb8')](_0x50b323[_0x63c88c][_0x4fc3('0x18b')])){_0xb5eb90[_0x4fc3('0xdf')](_0x4fc3('0x226'),_0x6b6305,_0x50b323[_0x63c88c]);}else{_0xb5eb90[_0x4fc3('0xc4')](_[_0x4fc3('0xe2')](_0x50b323[_0x63c88c],['VoiceQueueId',_0x4fc3('0x227')]))['then'](_0xb5eb90[_0x4fc3('0x20c')](_0x6b6305,_0x50b323[_0x63c88c]))[_0x4fc3('0xc2')](_0xb5eb90[_0x4fc3('0xdd')](_0x4fc3('0x226'),_0x6b6305));}}}})[_0x4fc3('0xc2')](loggerGetContactDialer(_0x4fc3('0x22d'),_0x6b6305,_0x4a8f79));}};Dialer[_0x4fc3('0x20')][_0x4fc3('0x99')]=function(_0x35edf1){if(_0x35edf1[_0x4fc3('0x22a')]>0x0){var _0x29e29c=_0x35edf1['dialLimitQueue']-_0x35edf1['originated']-_0x35edf1[_0x4fc3('0x1e9')];if(_0x29e29c>0x0){this[_0x4fc3('0x22e')](_0x35edf1);}else{loggerPredictiveCalls[_0x4fc3('0x8a')](_0x4fc3('0x22f'));}}else{this['tryOriginatePredictive'](_0x35edf1);}};Dialer[_0x4fc3('0x20')]['tryOriginatePredictive']=function(_0x2c98dc){var _0x3097f3=this;var _0x528890=[];_0x2c98dc['originated']+=0x1;for(var _0x5b3c8a in this[_0x4fc3('0x27')]){if(typeof this[_0x4fc3('0x27')][_0x5b3c8a]!=='undefined'){if(this[_0x4fc3('0x27')][_0x5b3c8a][_0x4fc3('0xb0')]===_0x4fc3('0x22b')&&this[_0x4fc3('0x27')][_0x5b3c8a][_0x4fc3('0xba')]===_0x4fc3('0xea')){_0x528890[_0x4fc3('0x13d')](this[_0x4fc3('0x27')][_0x5b3c8a]['id']);}}}this[_0x4fc3('0xd2')](_0x2c98dc['id'],_0x528890,0x1,_0x2c98dc[_0x4fc3('0x223')],_0x2c98dc)[_0x4fc3('0xc5')](function(_0x322a7c){if(!checkContactEmpty(_0x322a7c)){checkContactLowerLimitOriginate(_0x2c98dc,0x1,0x0);_0x3097f3['countReScheduled'](_0x2c98dc)[_0x4fc3('0xc5')](sendMessageReschedule(_0x2c98dc))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x2c98dc[_0x4fc3('0x48')]=_0x4fc3('0x224');if(_[_0x4fc3('0xb8')](_0x322a7c[0x0])||_[_0x4fc3('0xb8')](_0x322a7c[0x0][_0x4fc3('0x1a0')])||_[_0x4fc3('0xb8')](_0x322a7c[0x0][_0x4fc3('0x18b')])){_0x3097f3['emptyContact'](_0x4fc3('0x226'),_0x2c98dc,_0x322a7c[0x0]);}else{_0x3097f3[_0x4fc3('0xc4')](_[_0x4fc3('0xe2')](_0x322a7c[0x0],['VoiceQueueId',_0x4fc3('0x227')]))[_0x4fc3('0xc5')](_0x3097f3[_0x4fc3('0x20c')](_0x2c98dc,_0x322a7c[0x0]))[_0x4fc3('0xc2')](_0x3097f3['loggerHandler'](_0x4fc3('0x230'),_0x2c98dc));}}})[_0x4fc3('0xc2')](loggerGetContactDialer(_0x4fc3('0x231'),_0x2c98dc,0x1));emitVoiceQueueSummary(_0x2c98dc);};Dialer[_0x4fc3('0x20')][_0x4fc3('0x200')]=function(_0x1c8a5f,_0x22e1c4,_0x2df120,_0x35bbcd,_0x1aa079,_0x1c29ed){loggerPredictive[_0x4fc3('0x8a')](_0x4fc3('0x232'));loggerPredictive['info']('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',_0x1c8a5f);loggerPredictive[_0x4fc3('0x8a')](_0x4fc3('0x233'),_0x22e1c4);loggerPredictive[_0x4fc3('0x8a')]('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',_0x2df120);loggerPredictive['info']('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x35bbcd);loggerPredictive[_0x4fc3('0x8a')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1aa079);loggerPredictive[_0x4fc3('0x8a')]('---------------------------');return new Promise(function(_0x31d493,_0x26aa1e){if(_0x1c8a5f<=0x0||isNaN(_0x1c8a5f)){return _0x26aa1e(msgResponse(_0x4fc3('0x234'),_0x4fc3('0x54'),_0x4fc3('0x235')+_0x1c8a5f));}if(_0x2df120<=0x0||isNaN(_0x2df120)){return _0x26aa1e(msgResponse(_0x4fc3('0x234'),_0x4fc3('0x54'),_0x4fc3('0x236')+_0x2df120));}if(_0x35bbcd<=0x0||isNaN(_0x35bbcd)){return _0x26aa1e(msgResponse(_0x4fc3('0x234'),_0x4fc3('0x54'),_0x4fc3('0x237')+_0x35bbcd));}if(_0x22e1c4<=0x0||isNaN(_0x22e1c4)){return _0x26aa1e(msgResponse(_0x4fc3('0x234'),_0x4fc3('0x54'),_0x4fc3('0x238')+_0x22e1c4));}if(_0x1aa079<=0x0||isNaN(_0x1aa079)){return _0x26aa1e(msgResponse(_0x4fc3('0x234'),_0x4fc3('0x54'),'Amax\x20=\x20'+_0x1aa079));}_0x1c29ed=_0x1c29ed||0x0;var _0x1eebcf=0x1/_0x2df120;var _0x4a2d82=0x0;var _0x1993a7=0x0;var _0x4dcc22=0x0;var _0x1dd67c=0x0;for(var _0x5d4bb2=0x0;_0x4dcc22<_0x1aa079;_0x5d4bb2+=0x1){_0x1993a7=_0x5d4bb2/_0x22e1c4;_0x4a2d82=(_0x35bbcd*_0x1993a7+_0x1c29ed)/_0x1eebcf;_0x4dcc22=erlangb(_0x4a2d82,_0x1c8a5f);_0x1dd67c=_0x4a2d82/_0x1c8a5f*(0x1-erlangb(_0x4a2d82,_0x1c8a5f));}return _0x31d493({'erlangCalls':_0x5d4bb2,'erlangCallToSecond':_0x22e1c4/_0x5d4bb2,'erlangAbandonmentRate':_0x4dcc22,'erlangBusyFactor':_0x1dd67c});});};Dialer[_0x4fc3('0x20')][_0x4fc3('0x202')]=function(_0x33de3f,_0x2ded27,_0x218a61,_0x35def5,_0x206fe6,_0x23d46b){loggerPredictive[_0x4fc3('0x8a')](_0x4fc3('0x239'));loggerPredictive['info'](_0x4fc3('0x23a'),_0x33de3f);loggerPredictive[_0x4fc3('0x8a')](_0x4fc3('0x233'),_0x2ded27);loggerPredictive[_0x4fc3('0x8a')]('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',_0x218a61);loggerPredictive[_0x4fc3('0x8a')](_0x4fc3('0x23b'),_0x35def5);loggerPredictive[_0x4fc3('0x8a')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x206fe6);loggerPredictive[_0x4fc3('0x8a')](_0x4fc3('0x90'));return new Promise(function(_0x900627,_0x5bb20){if(_0x33de3f<=0x0||isNaN(_0x33de3f)){return _0x5bb20(msgResponse(_0x4fc3('0x23c'),_0x4fc3('0x54'),_0x4fc3('0x235')+_0x33de3f));}if(_0x218a61<=0x0||isNaN(_0x218a61)){return _0x5bb20(msgResponse(_0x4fc3('0x23c'),_0x4fc3('0x54'),_0x4fc3('0x236')+_0x218a61));}if(_0x35def5<=0x0||isNaN(_0x35def5)){return _0x5bb20(msgResponse(_0x4fc3('0x23c'),_0x4fc3('0x54'),_0x4fc3('0x237')+_0x35def5));}if(_0x2ded27<=0x0||isNaN(_0x2ded27)){return _0x5bb20(msgResponse(_0x4fc3('0x23c'),_0x4fc3('0x54'),_0x4fc3('0x238')+_0x2ded27));}if(_0x206fe6<=0x0||isNaN(_0x206fe6)){return _0x5bb20(msgResponse(_0x4fc3('0x23c'),_0x4fc3('0x54'),_0x4fc3('0x23d')+_0x206fe6));}_0x23d46b=_0x23d46b||0x0;var _0x179890=0x1/_0x218a61;var _0xe3ba7e=0x0;var _0xaf7657=0x0;var _0x4675b4=0x0;var _0x33a0d4=0x0;for(var _0x542ee8=0x0;_0x33a0d4<_0x206fe6;_0x542ee8+=0x1){_0xaf7657=_0x542ee8/_0x2ded27;_0xe3ba7e=(_0x35def5*_0xaf7657+_0x23d46b)/_0x179890;_0x4675b4=erlangb(_0xe3ba7e,_0x33de3f);_0x33a0d4=_0xe3ba7e/_0x33de3f*(0x1-erlangb(_0xe3ba7e,_0x33de3f));}return _0x900627({'erlangCalls':_0x542ee8,'erlangCallToSecond':_0x2ded27/_0x542ee8,'erlangAbandonmentRate':_0x4675b4,'erlangBusyFactor':_0x33a0d4});});};module[_0x4fc3('0x23e')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 73c3027..441c3a2 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a7c=['originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countdropretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','starttime','responsetime','droptime','endtime','talktime','membername','connectedlinename','reason','callback','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x4b6696,_0xf162d6){var _0x19f201=function(_0x41f9bc){while(--_0x41f9bc){_0x4b6696['push'](_0x4b6696['shift']());}};_0x19f201(++_0xf162d6);}(_0x7a7c,0xb6));var _0xc7a7=function(_0x20855a,_0x3c5d53){_0x20855a=_0x20855a-0x0;var _0x528b92=_0x7a7c[_0x20855a];return _0x528b92;};'use strict';var util=require(_0xc7a7('0x0'));var _=require(_0xc7a7('0x1'));var moment=require(_0xc7a7('0x2'));function getSeconds(_0x43678f,_0x3ac00a){var _0x298774=moment(_0x43678f)['milliseconds'](0x0);var _0x262420=moment(_0x3ac00a)[_0xc7a7('0x3')](0x0);return _0x298774['diff'](_0x262420,'seconds');}function QueueCallerAbandon(_0x417bc2,_0x112792){this[_0xc7a7('0x4')]=_0x417bc2['scheduledat'];this[_0xc7a7('0x5')]=_0x417bc2['type'];this[_0xc7a7('0x6')]=_0x417bc2[_0xc7a7('0x5')]==='outbound'?_0xc7a7('0x7'):_0x417bc2[_0xc7a7('0x5')];this[_0xc7a7('0x8')]=_0x417bc2[_0xc7a7('0x8')];this[_0xc7a7('0x9')]=_0x417bc2[_0xc7a7('0x9')];this['countnoanswerretry']=_0x417bc2[_0xc7a7('0xa')];this['countglobal']=_0x417bc2[_0xc7a7('0x8')]+_0x417bc2[_0xc7a7('0x9')]+_0x417bc2[_0xc7a7('0xa')]+_0x417bc2[_0xc7a7('0xb')]+_0x417bc2['countdropretry']+_0x417bc2[_0xc7a7('0xc')]+_0x417bc2['countmachineretry']+_0x417bc2['countagentrejectretry'];this[_0xc7a7('0xb')]=_0x417bc2[_0xc7a7('0xb')];this[_0xc7a7('0xd')]=_0x417bc2['countdropretry'];this[_0xc7a7('0xc')]=_0x417bc2[_0xc7a7('0xc')];this[_0xc7a7('0xe')]=_0x417bc2[_0xc7a7('0xe')];this[_0xc7a7('0xf')]=_0x417bc2[_0xc7a7('0xf')];this[_0xc7a7('0x10')]=_0x112792[_0xc7a7('0x10')];this[_0xc7a7('0x11')]=_0x417bc2[_0xc7a7('0x12')];this['calleridnum']=_0x417bc2['number'];this['starttime']=_0x417bc2[_0xc7a7('0x13')];this[_0xc7a7('0x14')]=_0x417bc2[_0xc7a7('0x14')];this[_0xc7a7('0x15')]=_0x417bc2[_0xc7a7('0x15')];this[_0xc7a7('0x16')]=this[_0xc7a7('0x15')];this['ringtime']=getSeconds(_0x417bc2[_0xc7a7('0x14')],_0x417bc2[_0xc7a7('0x13')]);this['holdtime']=getSeconds(this['droptime'],_0x417bc2[_0xc7a7('0x14')]);this[_0xc7a7('0x17')]=0x0;this[_0xc7a7('0x7')]=_0x112792[_0xc7a7('0x7')];this[_0xc7a7('0x18')]=_0x112792[_0xc7a7('0x19')];this['reason']=_0x112792[_0xc7a7('0x1a')];this[_0xc7a7('0x1b')]=_0x417bc2[_0xc7a7('0x1b')];this['callbackuniqueid']=_0x417bc2['callbackuniqueid'];this[_0xc7a7('0x1c')]=_0x417bc2[_0xc7a7('0x1c')];this['recallme']=_0x417bc2[_0xc7a7('0x1d')];this['ContactId']=_0x417bc2['ContactId'];this['ListId']=_0x417bc2[_0xc7a7('0x1e')];this[_0xc7a7('0x1f')]=_0x417bc2[_0xc7a7('0x1f')];this[_0xc7a7('0x20')]=_0x417bc2[_0xc7a7('0x20')];this['CampaignId']=_0x417bc2[_0xc7a7('0x21')];this['originatecalleridnum']=_0x417bc2[_0xc7a7('0x22')]||'';this['originatecalleridname']=_0x417bc2[_0xc7a7('0x23')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0x0e1d=['countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','ringtime','holdtime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','queue','countbusyretry'];(function(_0x51fe53,_0x1dfa87){var _0x276418=function(_0x17074d){while(--_0x17074d){_0x51fe53['push'](_0x51fe53['shift']());}};_0x276418(++_0x1dfa87);}(_0x0e1d,0x1d9));var _0xd0e1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0e1d[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0xd0e1('0x0'));var _=require(_0xd0e1('0x1'));var moment=require(_0xd0e1('0x2'));function getSeconds(_0x129590,_0x272f6a){var _0x28575f=moment(_0x129590)[_0xd0e1('0x3')](0x0);var _0x4edd47=moment(_0x272f6a)['milliseconds'](0x0);return _0x28575f[_0xd0e1('0x4')](_0x4edd47,_0xd0e1('0x5'));}function QueueCallerAbandon(_0x293eea,_0x507ba3){this[_0xd0e1('0x6')]=_0x293eea[_0xd0e1('0x6')];this[_0xd0e1('0x7')]=_0x293eea[_0xd0e1('0x7')];this[_0xd0e1('0x8')]=_0x293eea['type']==='outbound'?_0xd0e1('0x9'):_0x293eea[_0xd0e1('0x7')];this[_0xd0e1('0xa')]=_0x293eea[_0xd0e1('0xa')];this[_0xd0e1('0xb')]=_0x293eea[_0xd0e1('0xb')];this[_0xd0e1('0xc')]=_0x293eea[_0xd0e1('0xc')];this[_0xd0e1('0xd')]=_0x293eea[_0xd0e1('0xa')]+_0x293eea['countcongestionretry']+_0x293eea['countnoanswerretry']+_0x293eea['countnosuchnumberretry']+_0x293eea[_0xd0e1('0xe')]+_0x293eea[_0xd0e1('0xf')]+_0x293eea[_0xd0e1('0x10')]+_0x293eea[_0xd0e1('0x11')];this[_0xd0e1('0x12')]=_0x293eea[_0xd0e1('0x12')];this[_0xd0e1('0xe')]=_0x293eea['countdropretry'];this[_0xd0e1('0xf')]=_0x293eea['countabandonedretry'];this[_0xd0e1('0x10')]=_0x293eea[_0xd0e1('0x10')];this['countagentrejectretry']=_0x293eea[_0xd0e1('0x11')];this[_0xd0e1('0x13')]=_0x507ba3['uniqueid'];this[_0xd0e1('0x14')]=_0x293eea[_0xd0e1('0x15')];this[_0xd0e1('0x16')]=_0x293eea[_0xd0e1('0x17')];this[_0xd0e1('0x18')]=_0x293eea[_0xd0e1('0x18')];this[_0xd0e1('0x19')]=_0x293eea[_0xd0e1('0x19')];this[_0xd0e1('0x1a')]=_0x293eea[_0xd0e1('0x1a')];this['endtime']=this[_0xd0e1('0x1a')];this[_0xd0e1('0x1b')]=getSeconds(_0x293eea[_0xd0e1('0x19')],_0x293eea[_0xd0e1('0x18')]);this[_0xd0e1('0x1c')]=getSeconds(this[_0xd0e1('0x1a')],_0x293eea[_0xd0e1('0x19')]);this['talktime']=0x0;this[_0xd0e1('0x9')]=_0x507ba3[_0xd0e1('0x9')];this[_0xd0e1('0x1d')]=_0x507ba3[_0xd0e1('0x1e')];this[_0xd0e1('0x1f')]=_0x507ba3[_0xd0e1('0x1f')];this[_0xd0e1('0x20')]=_0x293eea[_0xd0e1('0x20')];this[_0xd0e1('0x21')]=_0x293eea['callbackuniqueid'];this['callbackat']=_0x293eea[_0xd0e1('0x22')];this['recallme']=_0x293eea[_0xd0e1('0x23')];this[_0xd0e1('0x24')]=_0x293eea['ContactId'];this['ListId']=_0x293eea[_0xd0e1('0x25')];this[_0xd0e1('0x26')]=_0x293eea['UserId'];this[_0xd0e1('0x27')]=_0x293eea[_0xd0e1('0x27')];this[_0xd0e1('0x28')]=_0x293eea['CampaignId'];this['originatecalleridnum']=_0x293eea[_0xd0e1('0x29')]||'';this['originatecalleridname']=_0x293eea[_0xd0e1('0x2a')]||'';}module[_0xd0e1('0x2b')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index d2634ba..6b76bfc 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(_0x4fbaba,_0x46b0ac){var _0x4e2b94=function(_0x16dd2b){while(--_0x16dd2b){_0x4fbaba['push'](_0x4fbaba['shift']());}};_0x4e2b94(++_0x46b0ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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(_0x138ed5,_0x215001){var _0x14b804=function(_0x271f16){while(--_0x271f16){_0x138ed5['push'](_0x138ed5['shift']());}};_0x14b804(++_0x215001);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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 04ed4ff..85173dd 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 _0x6a14=['syncNewState','channelstate','channelstatedesc','value','operation','status','localstationid','\x20syncFaxStatus\x20','remotestationid','pagestransferred','transferrate','filename','calleridnum','create','parse','.pdf','application/pdf','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','then','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','send','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','Action','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','bind','varset','syncVarSet','newstate','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','variable'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6a14,0x13c));var _0x46a1=function(_0x4102de,_0x382060){_0x4102de=_0x4102de-0x0;var _0x56f2d3=_0x6a14[_0x4102de];return _0x56f2d3;};'use strict';var util=require(_0x46a1('0x0'));var _=require(_0x46a1('0x1'));var BPromise=require(_0x46a1('0x2'));var uuid=require(_0x46a1('0x3'));var moment=require(_0x46a1('0x4'));var path=require('path');var tiff2pdf=require(_0x46a1('0x5'));var gs=require(_0x46a1('0x6'));var logger=require(_0x46a1('0x7'))(_0x46a1('0x8'));var ami=require(_0x46a1('0x9'));var rpcDb=require(_0x46a1('0xa'));var Channel=require('./channel');var ut=require('./util/util');var Action=require(_0x46a1('0xb'));var faxAccount=require(_0x46a1('0xc'));var attachment=require(_0x46a1('0xd'));var faxMessage=require(_0x46a1('0xe'));function Fax(_0x1c1a4f){this[_0x46a1('0xf')]={};this[_0x46a1('0x10')]=_0x1c1a4f[_0x46a1('0x10')];this[_0x46a1('0x11')]=_0x1c1a4f[_0x46a1('0x11')];this['actions']={};ami['on'](_0x46a1('0x12'),this['syncNewchannel'][_0x46a1('0x13')](this));ami['on'](_0x46a1('0x14'),this[_0x46a1('0x15')]['bind'](this));ami['on'](_0x46a1('0x16'),this['syncNewState'][_0x46a1('0x13')](this));ami['on'](_0x46a1('0x17'),this[_0x46a1('0x18')][_0x46a1('0x13')](this));ami['on'](_0x46a1('0x19'),this[_0x46a1('0x1a')][_0x46a1('0x13')](this));ami['on'](_0x46a1('0x1b'),this[_0x46a1('0x1c')][_0x46a1('0x13')](this));ami['on'](_0x46a1('0x1d'),this[_0x46a1('0x1e')]['bind'](this));ami['on'](_0x46a1('0x1f'),this[_0x46a1('0x20')][_0x46a1('0x13')](this));}Fax[_0x46a1('0x21')]['syncNewchannel']=function(_0x26e0f7){if(_0x26e0f7[_0x46a1('0x22')]===_0x46a1('0x23')){for(var _0x4d5dd5 in this[_0x46a1('0x10')]){if(this[_0x46a1('0x10')][_0x46a1('0x24')](_0x4d5dd5)){if(_0x26e0f7['exten']===this[_0x46a1('0x10')][_0x4d5dd5]['localstationid']){this['channels'][_0x26e0f7[_0x46a1('0x25')]]={};this[_0x46a1('0xf')][_0x26e0f7[_0x46a1('0x25')]][_0x46a1('0x26')]=_0x26e0f7[_0x46a1('0x26')];this[_0x46a1('0xf')][_0x26e0f7[_0x46a1('0x25')]]['id']=this[_0x46a1('0x10')][_0x4d5dd5]['id'];this['channels'][_0x26e0f7[_0x46a1('0x25')]]['name']=this[_0x46a1('0x10')][_0x4d5dd5][_0x46a1('0x27')];logger[_0x46a1('0x28')](_0x26e0f7[_0x46a1('0x25')],_0x46a1('0x29'));}}}}if(this[_0x46a1('0x2a')][_0x26e0f7[_0x46a1('0x25')]]){this[_0x46a1('0xf')][_0x26e0f7[_0x46a1('0x25')]]={};this[_0x46a1('0xf')][_0x26e0f7[_0x46a1('0x25')]][_0x46a1('0x26')]=_0x26e0f7[_0x46a1('0x26')];logger[_0x46a1('0x28')](_0x26e0f7[_0x46a1('0x25')],_0x46a1('0x29'));}};Fax[_0x46a1('0x21')][_0x46a1('0x15')]=function(_0x19c4c6){if(this[_0x46a1('0xf')][_0x19c4c6[_0x46a1('0x25')]]){for(var _0x12f1ad in _0x19c4c6[_0x46a1('0x2b')]){if(_0x19c4c6['variable'][_0x46a1('0x24')](_0x12f1ad)){this[_0x46a1('0xf')][_0x19c4c6[_0x46a1('0x25')]][_0x12f1ad]=_0x19c4c6['value'];}}}};Fax['prototype'][_0x46a1('0x2c')]=function(_0x43bd24){if(this[_0x46a1('0xf')][_0x43bd24[_0x46a1('0x25')]]){this['channels'][_0x43bd24[_0x46a1('0x25')]][_0x46a1('0x2d')]=_0x43bd24['channelstate'];this[_0x46a1('0xf')][_0x43bd24[_0x46a1('0x25')]]['channelstatedesc']=_0x43bd24[_0x46a1('0x2e')];}};Fax['prototype'][_0x46a1('0x18')]=function(_0x57ca13){if(this['channels'][_0x57ca13[_0x46a1('0x25')]]){for(var _0x2168d1 in _0x57ca13['variable']){if(_0x57ca13[_0x46a1('0x2b')][_0x46a1('0x24')](_0x2168d1)){this['channels'][_0x57ca13[_0x46a1('0x25')]][_0x2168d1]=_0x57ca13[_0x46a1('0x2f')];}}}};Fax[_0x46a1('0x21')][_0x46a1('0x1a')]=function(_0x35b7f3){if(this[_0x46a1('0xf')][_0x35b7f3[_0x46a1('0x25')]]){this[_0x46a1('0xf')][_0x35b7f3[_0x46a1('0x25')]][_0x46a1('0x30')]=_0x35b7f3['operation'];this[_0x46a1('0xf')][_0x35b7f3[_0x46a1('0x25')]][_0x46a1('0x31')]=_0x35b7f3['status'];this[_0x46a1('0xf')][_0x35b7f3[_0x46a1('0x25')]][_0x46a1('0x32')]=_0x35b7f3['localstationid'];this['channels'][_0x35b7f3[_0x46a1('0x25')]]['filename']=_0x35b7f3['filename'];logger['info'](_0x35b7f3[_0x46a1('0x25')],_0x46a1('0x33'));}};Fax[_0x46a1('0x21')][_0x46a1('0x1c')]=function(_0x3e31dd){var _0x2a4485=this;if(this[_0x46a1('0xf')][_0x3e31dd[_0x46a1('0x25')]]){var _0x196274=this[_0x46a1('0xf')][_0x3e31dd[_0x46a1('0x25')]]['id'];this[_0x46a1('0xf')][_0x3e31dd['uniqueid']][_0x46a1('0x34')]=_0x3e31dd[_0x46a1('0x34')];this[_0x46a1('0xf')][_0x3e31dd[_0x46a1('0x25')]][_0x46a1('0x35')]=_0x3e31dd['pagestransferred'];this[_0x46a1('0xf')][_0x3e31dd[_0x46a1('0x25')]][_0x46a1('0x32')]=_0x3e31dd[_0x46a1('0x32')];this[_0x46a1('0xf')][_0x3e31dd[_0x46a1('0x25')]]['resolution']=_0x3e31dd['resolution'];this[_0x46a1('0xf')][_0x3e31dd[_0x46a1('0x25')]][_0x46a1('0x36')]=_0x3e31dd[_0x46a1('0x36')];this[_0x46a1('0xf')][_0x3e31dd[_0x46a1('0x25')]][_0x46a1('0x37')]=_0x3e31dd['filename'];this[_0x46a1('0xf')][_0x3e31dd[_0x46a1('0x25')]][_0x46a1('0x38')]=_0x3e31dd[_0x46a1('0x38')];if(this[_0x46a1('0xf')][_0x3e31dd[_0x46a1('0x25')]][_0x46a1('0x35')]>0x0){tiff2pdf(_0x3e31dd[_0x46a1('0x37')],'/var/opt/motion2/server/files/attachments/',function(_0x1b1c8d){logger['info'](_0x3e31dd[_0x46a1('0x25')],'\x20result\x20conversion\x20file\x20',_0x1b1c8d['message']);attachment[_0x46a1('0x39')]({'name':path['parse'](_0x3e31dd[_0x46a1('0x37')])[_0x46a1('0x27')],'basename':path[_0x46a1('0x3a')](_0x3e31dd[_0x46a1('0x37')])['name']+_0x46a1('0x3b'),'type':_0x46a1('0x3c')})['then'](function(_0x3f51c3){faxAccount[_0x46a1('0x3d')](_0x196274,{'from':_0x3e31dd[_0x46a1('0x38')],'mapKey':_0x46a1('0x8'),'body':path['parse'](_0x3e31dd[_0x46a1('0x37')])[_0x46a1('0x27')]+_0x46a1('0x3b'),'AttachmentId':_0x3f51c3['id']})[_0x46a1('0x3e')](function(_0x3eb3cf){logger[_0x46a1('0x3f')](_0x3e31dd['uniqueid'],_0x46a1('0x40'),JSON[_0x46a1('0x41')](_0x3eb3cf));});})[_0x46a1('0x3e')](function(_0x2bb411){logger['error'](_0x3e31dd['uniqueid'],_0x46a1('0x42'),JSON[_0x46a1('0x41')](_0x2bb411));});});}logger['info'](_0x3e31dd['uniqueid'],_0x46a1('0x42'));}};Fax[_0x46a1('0x21')]['syncOriginateResponse']=function(_0x37f087){if(this[_0x46a1('0x2a')][_0x37f087[_0x46a1('0x25')]]){_[_0x46a1('0x43')](this['channels'][_0x37f087[_0x46a1('0x25')]],_[_0x46a1('0x44')](_0x37f087,[_0x46a1('0x45'),_0x46a1('0x46')]));}};function updateStatus(_0x3a8650){if(_0x3a8650[_0x46a1('0x47')]){faxMessage[_0x46a1('0x48')](_0x3a8650[_0x46a1('0x47')],{'failMessage':_0x46a1('0x49')})[_0x46a1('0x4a')](function(_0x1095e0){ut['logger'](_0x46a1('0x4b'),_0x1095e0);})[_0x46a1('0x3e')](function(_0x18efca){ut[_0x46a1('0x4c')](_0x46a1('0x4d'),_0x18efca);});}else{ut[_0x46a1('0x4c')](_0x46a1('0x4e'));}}Fax[_0x46a1('0x21')][_0x46a1('0x4f')]=function(_0x1d385d,_0x221d51,_0x12dcb1){var _0x20f70f=this;var _0x24f2e6={};if(_0x221d51){_0x24f2e6={'read':_0x221d51};}else{_0x24f2e6={'failMessage':_0x12dcb1};}if(this[_0x46a1('0x2a')][_0x1d385d][_0x46a1('0x47')]){faxMessage['update'](this[_0x46a1('0x2a')][_0x1d385d]['AttachmentId'],_0x24f2e6)[_0x46a1('0x4a')](function(_0xb611b2){ut[_0x46a1('0x4c')](_0x46a1('0x50'),_0xb611b2);})[_0x46a1('0x3e')](function(_0x316419){ut[_0x46a1('0x4c')](_0x46a1('0x51'),_0x316419);})[_0x46a1('0x52')](function(){delete _0x20f70f[_0x46a1('0xf')][_0x1d385d];delete _0x20f70f['actions'][_0x1d385d];});}else{ut[_0x46a1('0x4c')]('[Fax][Message][NoUpdate2]');delete this['channels'][_0x1d385d];delete this[_0x46a1('0x2a')][_0x1d385d];}};Fax[_0x46a1('0x21')][_0x46a1('0x1e')]=function(_0x1f77d1){var _0x4d7770=this;if(this[_0x46a1('0xf')][_0x1f77d1[_0x46a1('0x25')]]){if(this[_0x46a1('0x2a')][_0x1f77d1[_0x46a1('0x25')]]){this[_0x46a1('0xf')][_0x1f77d1[_0x46a1('0x25')]]['id']=this['actions'][_0x1f77d1[_0x46a1('0x25')]]['id'];this[_0x46a1('0xf')][_0x1f77d1[_0x46a1('0x25')]]['name']=this['actions'][_0x1f77d1['uniqueid']][_0x46a1('0x27')];}logger['info'](_0x1f77d1[_0x46a1('0x25')],this[_0x46a1('0x2a')][_0x1f77d1[_0x46a1('0x25')]]?_0x46a1('0x53'):_0x46a1('0x54'),JSON[_0x46a1('0x41')](this[_0x46a1('0xf')][_0x1f77d1['uniqueid']]));if(this['actions'][_0x1f77d1[_0x46a1('0x25')]]){if(this[_0x46a1('0xf')][_0x1f77d1['uniqueid']][_0x46a1('0x55')]>0x0&&this['channels'][_0x1f77d1[_0x46a1('0x25')]][_0x46a1('0x19')]===_0x46a1('0x56')){this[_0x46a1('0x4f')](_0x1f77d1[_0x46a1('0x25')],!![]);}else{this[_0x46a1('0x4f')](_0x1f77d1[_0x46a1('0x25')],![],this[_0x46a1('0xf')][_0x1f77d1['uniqueid']][_0x46a1('0x57')]?'SENDING\x20FAILED:\x20'+this['channels'][_0x1f77d1[_0x46a1('0x25')]]['faxstatusstring']:'SENDING\x20FAILED');}}}};Fax[_0x46a1('0x21')][_0x46a1('0x58')]=function(_0x3c62d3){var _0x3eab12=this;return new BPromise(function(_0x5393c9,_0x470b85){_0x3eab12['execOriginate'](_0x3c62d3,_0x3eab12['faxAccounts'][_0x3c62d3[_0x46a1('0x59')]])[_0x46a1('0x4a')](function(_0x4b22ee){ut['logger'](_0x46a1('0x5a'),_0x4b22ee);_0x5393c9(ut[_0x46a1('0x5b')](_0x46a1('0x5c')));})[_0x46a1('0x3e')](function(_0x1ff433){ut[_0x46a1('0x4c')](_0x46a1('0x5d'),_0x1ff433);updateStatus(_0x3c62d3);_0x470b85(ut[_0x46a1('0x5b')](_0x46a1('0x5e')));});});};Fax[_0x46a1('0x21')][_0x46a1('0x5f')]=function(_0x3944fb){var _0x2625d3=this;return new BPromise(function(_0x1c7f73,_0x26ecd2){var _0x1a777f=_0x2625d3[_0x46a1('0x60')](_0x2625d3[_0x46a1('0x10')][_0x3944fb[_0x46a1('0x59')]][_0x46a1('0x61')],_0x3944fb);if(_0x1a777f[_0x46a1('0x62')]){_0x1c7f73(ut[_0x46a1('0x5b')]('Trunk\x20Reachable'));}else{_0x26ecd2(ut['message'](_0x1a777f['message']));}});};function originate(_0x4c6a75,_0x4bf98b,_0x1ff73d){return new BPromise(function(_0x19c182,_0x1e688a){if(_0x1ff73d){var _0x181b00=util[_0x46a1('0x63')](_0x46a1('0x64'),path['parse'](_0x4c6a75[_0x46a1('0x65')])['name'],_0x4c6a75[_0x46a1('0x65')]);gs[_0x46a1('0x66')](_0x181b00)[_0x46a1('0x4a')](function(){_0x4c6a75['path']=util[_0x46a1('0x63')](_0x46a1('0x67'),path['parse'](_0x4c6a75['path'])[_0x46a1('0x68')],path[_0x46a1('0x3a')](_0x4c6a75[_0x46a1('0x65')])[_0x46a1('0x27')]);_0x4bf98b['XMF-PATH']=_0x4c6a75[_0x46a1('0x65')];ut[_0x46a1('0x4c')](_0x46a1('0x69'),'');ami['Action'](ut['variablesAction'](_0x4c6a75,_0x4bf98b))[_0x46a1('0x4a')](function(_0x50a827){_0x19c182(_0x50a827);})[_0x46a1('0x3e')](function(_0x38cdda){_0x1e688a(_0x38cdda);});})['catch'](function(_0x3b28d9){_0x1e688a(_0x3b28d9);});}else{ami[_0x46a1('0x6a')](ut['variablesAction'](_0x4c6a75,_0x4bf98b))[_0x46a1('0x4a')](function(_0x90c5d6){_0x19c182(_0x90c5d6);})['catch'](function(_0x5bd515){_0x1e688a(_0x5bd515);});}});}Fax['prototype'][_0x46a1('0x6b')]=function(_0x1e3787,_0x176ed6){var _0x4cf016=this;return new BPromise(function(_0x57bd14,_0x592817){var _0x30e1d4=uuid['v4']();var _0x5b7060=ut[_0x46a1('0x6c')](_0x1e3787,_0x176ed6);_0x4cf016['actions'][_0x30e1d4]=new Action(_0x30e1d4,_0x176ed6,_0x1e3787);var _0x5e96aa=_0x4cf016[_0x46a1('0x2a')][_0x30e1d4];if(path[_0x46a1('0x3a')](_0x1e3787[_0x46a1('0x65')])[_0x46a1('0x6d')]===_0x46a1('0x3b')){originate(_0x5e96aa,_0x5b7060,!![])['then'](function(_0x10a19a){_0x57bd14(_0x10a19a);})[_0x46a1('0x3e')](function(_0x171c1b){_0x592817(_0x171c1b);});}else{originate(_0x5e96aa,_0x5b7060,![])[_0x46a1('0x4a')](function(_0x494673){_0x57bd14(_0x494673);})[_0x46a1('0x3e')](function(_0x4b4f97){_0x592817(_0x4b4f97);});}});};Fax['prototype'][_0x46a1('0x6e')]=function(_0x18c93a){return!_[_0x46a1('0x6f')](_0x18c93a)&&!_[_0x46a1('0x6f')](_0x18c93a['name'])&&!_[_0x46a1('0x6f')](_0x18c93a[_0x46a1('0x70')])&&_0x18c93a[_0x46a1('0x70')]&&!_[_0x46a1('0x6f')](this[_0x46a1('0x11')][util['format']('SIP/%s',_0x18c93a[_0x46a1('0x27')])])&&!_[_0x46a1('0x6f')](this['trunks'][util[_0x46a1('0x63')](_0x46a1('0x71'),_0x18c93a['name'])][_0x46a1('0x31')])&&(this[_0x46a1('0x11')][util[_0x46a1('0x63')]('SIP/%s',_0x18c93a[_0x46a1('0x27')])]['status']==='reachable'||this['trunks'][util['format'](_0x46a1('0x71'),_0x18c93a[_0x46a1('0x27')])]['status']==='unmonitored');};Fax[_0x46a1('0x21')][_0x46a1('0x60')]=function(_0x2c9e99,_0x3088ed){if(!this[_0x46a1('0x6e')](_0x2c9e99)){ut[_0x46a1('0x4c')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0x46a1('0x6f')](_0x2c9e99)?'':_0x2c9e99[_0x46a1('0x27')]+_0x46a1('0x72'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_['isNil'](_0x3088ed[_0x46a1('0x8')])){ut['logger'](_0x46a1('0x73'),JSON['stringify'](_0x3088ed));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x46a1('0x6f')](_0x3088ed['path'])){ut[_0x46a1('0x4c')](_0x46a1('0x74'),JSON['stringify'](_0x3088ed));return{'isValid':![],'message':_0x46a1('0x75')};}return{'isValid':!![],'message':_0x46a1('0x76')};};module[_0x46a1('0x77')]=Fax; \ No newline at end of file +var _0xbd7d=['[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','faxstatusstring','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[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','util','lodash','bluebird','uuid','path','tiff2pdf','./util/gs','../../../config/logger','fax','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','newstate','newexten','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','name','\x20syncNewchannel\x20','info','variable','value','syncNewState','channelstate','channelstatedesc','syncNewExten','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','then','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','updateStatus'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xbd7d,0x19f));var _0xdbd7=function(_0x255faf,_0x2263ae){_0x255faf=_0x255faf-0x0;var _0x403477=_0xbd7d[_0x255faf];return _0x403477;};'use strict';var util=require(_0xdbd7('0x0'));var _=require(_0xdbd7('0x1'));var BPromise=require(_0xdbd7('0x2'));var uuid=require(_0xdbd7('0x3'));var moment=require('moment');var path=require(_0xdbd7('0x4'));var tiff2pdf=require(_0xdbd7('0x5'));var gs=require(_0xdbd7('0x6'));var logger=require(_0xdbd7('0x7'))(_0xdbd7('0x8'));var ami=require('../ami');var rpcDb=require(_0xdbd7('0x9'));var Channel=require(_0xdbd7('0xa'));var ut=require(_0xdbd7('0xb'));var Action=require(_0xdbd7('0xc'));var faxAccount=require(_0xdbd7('0xd'));var attachment=require(_0xdbd7('0xe'));var faxMessage=require(_0xdbd7('0xf'));function Fax(_0x60c2a5){this[_0xdbd7('0x10')]={};this[_0xdbd7('0x11')]=_0x60c2a5[_0xdbd7('0x11')];this[_0xdbd7('0x12')]=_0x60c2a5[_0xdbd7('0x12')];this[_0xdbd7('0x13')]={};ami['on'](_0xdbd7('0x14'),this[_0xdbd7('0x15')][_0xdbd7('0x16')](this));ami['on']('varset',this[_0xdbd7('0x17')][_0xdbd7('0x16')](this));ami['on'](_0xdbd7('0x18'),this['syncNewState'][_0xdbd7('0x16')](this));ami['on'](_0xdbd7('0x19'),this['syncNewExten'][_0xdbd7('0x16')](this));ami['on']('faxstatus',this[_0xdbd7('0x1a')][_0xdbd7('0x16')](this));ami['on'](_0xdbd7('0x1b'),this[_0xdbd7('0x1c')][_0xdbd7('0x16')](this));ami['on'](_0xdbd7('0x1d'),this[_0xdbd7('0x1e')][_0xdbd7('0x16')](this));ami['on'](_0xdbd7('0x1f'),this[_0xdbd7('0x20')][_0xdbd7('0x16')](this));}Fax[_0xdbd7('0x21')][_0xdbd7('0x15')]=function(_0x19475b){if(_0x19475b[_0xdbd7('0x22')]===_0xdbd7('0x23')){for(var _0x1353b2 in this[_0xdbd7('0x11')]){if(this[_0xdbd7('0x11')][_0xdbd7('0x24')](_0x1353b2)){if(_0x19475b[_0xdbd7('0x25')]===this[_0xdbd7('0x11')][_0x1353b2]['localstationid']){this[_0xdbd7('0x10')][_0x19475b[_0xdbd7('0x26')]]={};this[_0xdbd7('0x10')][_0x19475b[_0xdbd7('0x26')]][_0xdbd7('0x27')]=_0x19475b[_0xdbd7('0x27')];this[_0xdbd7('0x10')][_0x19475b[_0xdbd7('0x26')]]['id']=this[_0xdbd7('0x11')][_0x1353b2]['id'];this[_0xdbd7('0x10')][_0x19475b[_0xdbd7('0x26')]][_0xdbd7('0x28')]=this[_0xdbd7('0x11')][_0x1353b2][_0xdbd7('0x28')];logger['info'](_0x19475b['uniqueid'],_0xdbd7('0x29'));}}}}if(this[_0xdbd7('0x13')][_0x19475b['uniqueid']]){this[_0xdbd7('0x10')][_0x19475b[_0xdbd7('0x26')]]={};this[_0xdbd7('0x10')][_0x19475b[_0xdbd7('0x26')]]['channel']=_0x19475b['channel'];logger[_0xdbd7('0x2a')](_0x19475b[_0xdbd7('0x26')],_0xdbd7('0x29'));}};Fax[_0xdbd7('0x21')][_0xdbd7('0x17')]=function(_0x4a33bb){if(this['channels'][_0x4a33bb[_0xdbd7('0x26')]]){for(var _0x5c42de in _0x4a33bb['variable']){if(_0x4a33bb[_0xdbd7('0x2b')][_0xdbd7('0x24')](_0x5c42de)){this[_0xdbd7('0x10')][_0x4a33bb[_0xdbd7('0x26')]][_0x5c42de]=_0x4a33bb[_0xdbd7('0x2c')];}}}};Fax[_0xdbd7('0x21')][_0xdbd7('0x2d')]=function(_0x300b4a){if(this['channels'][_0x300b4a[_0xdbd7('0x26')]]){this['channels'][_0x300b4a['uniqueid']][_0xdbd7('0x2e')]=_0x300b4a[_0xdbd7('0x2e')];this[_0xdbd7('0x10')][_0x300b4a[_0xdbd7('0x26')]][_0xdbd7('0x2f')]=_0x300b4a[_0xdbd7('0x2f')];}};Fax[_0xdbd7('0x21')][_0xdbd7('0x30')]=function(_0x2ac229){if(this['channels'][_0x2ac229['uniqueid']]){for(var _0x43643d in _0x2ac229[_0xdbd7('0x2b')]){if(_0x2ac229[_0xdbd7('0x2b')][_0xdbd7('0x24')](_0x43643d)){this[_0xdbd7('0x10')][_0x2ac229[_0xdbd7('0x26')]][_0x43643d]=_0x2ac229[_0xdbd7('0x2c')];}}}};Fax['prototype'][_0xdbd7('0x1a')]=function(_0x5a6572){if(this[_0xdbd7('0x10')][_0x5a6572[_0xdbd7('0x26')]]){this[_0xdbd7('0x10')][_0x5a6572[_0xdbd7('0x26')]]['operation']=_0x5a6572['operation'];this[_0xdbd7('0x10')][_0x5a6572['uniqueid']]['status']=_0x5a6572[_0xdbd7('0x31')];this[_0xdbd7('0x10')][_0x5a6572['uniqueid']]['localstationid']=_0x5a6572[_0xdbd7('0x32')];this[_0xdbd7('0x10')][_0x5a6572[_0xdbd7('0x26')]][_0xdbd7('0x33')]=_0x5a6572[_0xdbd7('0x33')];logger[_0xdbd7('0x2a')](_0x5a6572['uniqueid'],_0xdbd7('0x34'));}};Fax[_0xdbd7('0x21')][_0xdbd7('0x1c')]=function(_0x52e40a){var _0x2432c9=this;if(this[_0xdbd7('0x10')][_0x52e40a[_0xdbd7('0x26')]]){var _0x28819f=this[_0xdbd7('0x10')][_0x52e40a[_0xdbd7('0x26')]]['id'];this[_0xdbd7('0x10')][_0x52e40a[_0xdbd7('0x26')]][_0xdbd7('0x35')]=_0x52e40a[_0xdbd7('0x35')];this[_0xdbd7('0x10')][_0x52e40a['uniqueid']]['pagestransferred']=_0x52e40a[_0xdbd7('0x36')];this[_0xdbd7('0x10')][_0x52e40a[_0xdbd7('0x26')]][_0xdbd7('0x32')]=_0x52e40a[_0xdbd7('0x32')];this[_0xdbd7('0x10')][_0x52e40a[_0xdbd7('0x26')]][_0xdbd7('0x37')]=_0x52e40a['resolution'];this[_0xdbd7('0x10')][_0x52e40a['uniqueid']][_0xdbd7('0x38')]=_0x52e40a[_0xdbd7('0x38')];this['channels'][_0x52e40a['uniqueid']]['filename']=_0x52e40a[_0xdbd7('0x33')];this[_0xdbd7('0x10')][_0x52e40a[_0xdbd7('0x26')]][_0xdbd7('0x39')]=_0x52e40a['calleridnum'];if(this['channels'][_0x52e40a[_0xdbd7('0x26')]][_0xdbd7('0x36')]>0x0){tiff2pdf(_0x52e40a['filename'],'/var/opt/motion2/server/files/attachments/',function(_0x3a8c30){logger['info'](_0x52e40a[_0xdbd7('0x26')],_0xdbd7('0x3a'),_0x3a8c30[_0xdbd7('0x3b')]);attachment[_0xdbd7('0x3c')]({'name':path[_0xdbd7('0x3d')](_0x52e40a['filename'])[_0xdbd7('0x28')],'basename':path[_0xdbd7('0x3d')](_0x52e40a[_0xdbd7('0x33')])[_0xdbd7('0x28')]+_0xdbd7('0x3e'),'type':_0xdbd7('0x3f')})['then'](function(_0x4225f4){faxAccount[_0xdbd7('0x40')](_0x28819f,{'from':_0x52e40a['calleridnum'],'mapKey':_0xdbd7('0x8'),'body':path[_0xdbd7('0x3d')](_0x52e40a[_0xdbd7('0x33')])['name']+_0xdbd7('0x3e'),'AttachmentId':_0x4225f4['id']})[_0xdbd7('0x41')](function(_0x8b23ae){logger[_0xdbd7('0x42')](_0x52e40a[_0xdbd7('0x26')],_0xdbd7('0x43'),JSON[_0xdbd7('0x44')](_0x8b23ae));});})[_0xdbd7('0x41')](function(_0x28e15e){logger[_0xdbd7('0x42')](_0x52e40a[_0xdbd7('0x26')],_0xdbd7('0x45'),JSON[_0xdbd7('0x44')](_0x28e15e));});});}logger[_0xdbd7('0x2a')](_0x52e40a[_0xdbd7('0x26')],'\x20receiveFax\x20');}};Fax[_0xdbd7('0x21')][_0xdbd7('0x20')]=function(_0x258813){if(this[_0xdbd7('0x13')][_0x258813[_0xdbd7('0x26')]]){_['merge'](this[_0xdbd7('0x10')][_0x258813[_0xdbd7('0x26')]],_[_0xdbd7('0x46')](_0x258813,[_0xdbd7('0x47'),_0xdbd7('0x48')]));}};function updateStatus(_0x581482){if(_0x581482[_0xdbd7('0x49')]){faxMessage[_0xdbd7('0x4a')](_0x581482[_0xdbd7('0x49')],{'failMessage':_0xdbd7('0x4b')})[_0xdbd7('0x4c')](function(_0x47e3b3){ut['logger'](_0xdbd7('0x4d'),_0x47e3b3);})[_0xdbd7('0x41')](function(_0x65978c){ut[_0xdbd7('0x4e')](_0xdbd7('0x4f'),_0x65978c);});}else{ut['logger']('[Fax][Message][Error][NoUpdate2]');}}Fax[_0xdbd7('0x21')][_0xdbd7('0x50')]=function(_0x1e3d87,_0x47f5b0,_0xd458ec){var _0x30ed08=this;var _0x513bd5={};if(_0x47f5b0){_0x513bd5={'read':_0x47f5b0};}else{_0x513bd5={'failMessage':_0xd458ec};}if(this[_0xdbd7('0x13')][_0x1e3d87][_0xdbd7('0x49')]){faxMessage[_0xdbd7('0x4a')](this[_0xdbd7('0x13')][_0x1e3d87]['AttachmentId'],_0x513bd5)[_0xdbd7('0x4c')](function(_0x22fe80){ut[_0xdbd7('0x4e')](_0xdbd7('0x51'),_0x22fe80);})[_0xdbd7('0x41')](function(_0x2b73c8){ut['logger'](_0xdbd7('0x52'),_0x2b73c8);})[_0xdbd7('0x53')](function(){delete _0x30ed08[_0xdbd7('0x10')][_0x1e3d87];delete _0x30ed08[_0xdbd7('0x13')][_0x1e3d87];});}else{ut[_0xdbd7('0x4e')]('[Fax][Message][NoUpdate2]');delete this[_0xdbd7('0x10')][_0x1e3d87];delete this['actions'][_0x1e3d87];}};Fax[_0xdbd7('0x21')]['syncHangup']=function(_0x11ffd5){var _0x34451b=this;if(this[_0xdbd7('0x10')][_0x11ffd5[_0xdbd7('0x26')]]){if(this[_0xdbd7('0x13')][_0x11ffd5[_0xdbd7('0x26')]]){this[_0xdbd7('0x10')][_0x11ffd5['uniqueid']]['id']=this['actions'][_0x11ffd5[_0xdbd7('0x26')]]['id'];this[_0xdbd7('0x10')][_0x11ffd5[_0xdbd7('0x26')]][_0xdbd7('0x28')]=this[_0xdbd7('0x13')][_0x11ffd5[_0xdbd7('0x26')]]['name'];}logger[_0xdbd7('0x2a')](_0x11ffd5[_0xdbd7('0x26')],this[_0xdbd7('0x13')][_0x11ffd5[_0xdbd7('0x26')]]?'\x20hangup\x20sendFile\x20':_0xdbd7('0x54'),JSON[_0xdbd7('0x44')](this[_0xdbd7('0x10')][_0x11ffd5[_0xdbd7('0x26')]]));if(this[_0xdbd7('0x13')][_0x11ffd5[_0xdbd7('0x26')]]){if(this[_0xdbd7('0x10')][_0x11ffd5[_0xdbd7('0x26')]][_0xdbd7('0x55')]>0x0&&this[_0xdbd7('0x10')][_0x11ffd5['uniqueid']][_0xdbd7('0x56')]===_0xdbd7('0x57')){this['updateStatus'](_0x11ffd5['uniqueid'],!![]);}else{this[_0xdbd7('0x50')](_0x11ffd5['uniqueid'],![],this['channels'][_0x11ffd5['uniqueid']]['faxstatusstring']?'SENDING\x20FAILED:\x20'+this[_0xdbd7('0x10')][_0x11ffd5[_0xdbd7('0x26')]][_0xdbd7('0x58')]:'SENDING\x20FAILED');}}}};Fax[_0xdbd7('0x21')][_0xdbd7('0x59')]=function(_0x593534){var _0x1b9aa7=this;return new BPromise(function(_0x1b1bca,_0x2acf3a){_0x1b9aa7[_0xdbd7('0x5a')](_0x593534,_0x1b9aa7[_0xdbd7('0x11')][_0x593534[_0xdbd7('0x5b')]])[_0xdbd7('0x4c')](function(_0x534897){ut[_0xdbd7('0x4e')](_0xdbd7('0x5c'),_0x534897);_0x1b1bca(ut[_0xdbd7('0x3b')]('Fax\x20received'));})[_0xdbd7('0x41')](function(_0x17dcca){ut[_0xdbd7('0x4e')](_0xdbd7('0x5d'),_0x17dcca);updateStatus(_0x593534);_0x2acf3a(ut['message'](_0xdbd7('0x5e')));});});};Fax['prototype'][_0xdbd7('0x5f')]=function(_0x244c20){var _0x53fb53=this;return new BPromise(function(_0x430160,_0x32a623){var _0x5ac7ee=_0x53fb53[_0xdbd7('0x60')](_0x53fb53[_0xdbd7('0x11')][_0x244c20[_0xdbd7('0x5b')]][_0xdbd7('0x61')],_0x244c20);if(_0x5ac7ee[_0xdbd7('0x62')]){_0x430160(ut[_0xdbd7('0x3b')]('Trunk\x20Reachable'));}else{_0x32a623(ut[_0xdbd7('0x3b')](_0x5ac7ee[_0xdbd7('0x3b')]));}});};function originate(_0x28506b,_0x1474b0,_0x196bdc){return new BPromise(function(_0x3c4eea,_0x591a7a){if(_0x196bdc){var _0x2c8ab7=util[_0xdbd7('0x63')](_0xdbd7('0x64'),path['parse'](_0x28506b[_0xdbd7('0x4')])['name'],_0x28506b['path']);gs[_0xdbd7('0x65')](_0x2c8ab7)['then'](function(){_0x28506b[_0xdbd7('0x4')]=util[_0xdbd7('0x63')](_0xdbd7('0x66'),path[_0xdbd7('0x3d')](_0x28506b[_0xdbd7('0x4')])['dir'],path[_0xdbd7('0x3d')](_0x28506b[_0xdbd7('0x4')])[_0xdbd7('0x28')]);_0x1474b0[_0xdbd7('0x67')]=_0x28506b[_0xdbd7('0x4')];ut['logger'](_0xdbd7('0x68'),'');ami['Action'](ut['variablesAction'](_0x28506b,_0x1474b0))[_0xdbd7('0x4c')](function(_0x318f12){_0x3c4eea(_0x318f12);})['catch'](function(_0x298ef8){_0x591a7a(_0x298ef8);});})[_0xdbd7('0x41')](function(_0x561613){_0x591a7a(_0x561613);});}else{ami[_0xdbd7('0x69')](ut[_0xdbd7('0x6a')](_0x28506b,_0x1474b0))[_0xdbd7('0x4c')](function(_0x3c4ef5){_0x3c4eea(_0x3c4ef5);})[_0xdbd7('0x41')](function(_0x5ad446){_0x591a7a(_0x5ad446);});}});}Fax[_0xdbd7('0x21')][_0xdbd7('0x5a')]=function(_0x55a032,_0x58c082){var _0x1f860f=this;return new BPromise(function(_0x33f575,_0x566719){var _0x7a0688=uuid['v4']();var _0x46eff8=ut[_0xdbd7('0x6b')](_0x55a032,_0x58c082);_0x1f860f[_0xdbd7('0x13')][_0x7a0688]=new Action(_0x7a0688,_0x58c082,_0x55a032);var _0x1ab674=_0x1f860f['actions'][_0x7a0688];if(path[_0xdbd7('0x3d')](_0x55a032[_0xdbd7('0x4')])[_0xdbd7('0x6c')]===_0xdbd7('0x3e')){originate(_0x1ab674,_0x46eff8,!![])[_0xdbd7('0x4c')](function(_0xa3a3ad){_0x33f575(_0xa3a3ad);})['catch'](function(_0x26ffb9){_0x566719(_0x26ffb9);});}else{originate(_0x1ab674,_0x46eff8,![])[_0xdbd7('0x4c')](function(_0x3f46df){_0x33f575(_0x3f46df);})[_0xdbd7('0x41')](function(_0x36b49b){_0x566719(_0x36b49b);});}});};Fax[_0xdbd7('0x21')][_0xdbd7('0x6d')]=function(_0x39b8dd){return!_[_0xdbd7('0x6e')](_0x39b8dd)&&!_[_0xdbd7('0x6e')](_0x39b8dd[_0xdbd7('0x28')])&&!_[_0xdbd7('0x6e')](_0x39b8dd[_0xdbd7('0x6f')])&&_0x39b8dd['active']&&!_[_0xdbd7('0x6e')](this[_0xdbd7('0x12')][util['format']('SIP/%s',_0x39b8dd[_0xdbd7('0x28')])])&&!_[_0xdbd7('0x6e')](this[_0xdbd7('0x12')][util[_0xdbd7('0x63')](_0xdbd7('0x70'),_0x39b8dd[_0xdbd7('0x28')])][_0xdbd7('0x31')])&&(this[_0xdbd7('0x12')][util[_0xdbd7('0x63')](_0xdbd7('0x70'),_0x39b8dd[_0xdbd7('0x28')])][_0xdbd7('0x31')]===_0xdbd7('0x71')||this['trunks'][util[_0xdbd7('0x63')](_0xdbd7('0x70'),_0x39b8dd[_0xdbd7('0x28')])][_0xdbd7('0x31')]===_0xdbd7('0x72'));};Fax[_0xdbd7('0x21')][_0xdbd7('0x60')]=function(_0x46b465,_0x202d8a){if(!this['isTrunkReachable'](_0x46b465)){ut[_0xdbd7('0x4e')](_0xdbd7('0x73'),_[_0xdbd7('0x6e')](_0x46b465)?'':_0x46b465['name']+_0xdbd7('0x74'));return{'isValid':![],'message':_0xdbd7('0x75')};}if(_[_0xdbd7('0x6e')](_0x202d8a[_0xdbd7('0x8')])){ut[_0xdbd7('0x4e')](_0xdbd7('0x76'),JSON[_0xdbd7('0x44')](_0x202d8a));return{'isValid':![],'message':_0xdbd7('0x77')};}if(_[_0xdbd7('0x6e')](_0x202d8a[_0xdbd7('0x4')])){ut[_0xdbd7('0x4e')](_0xdbd7('0x78'),JSON[_0xdbd7('0x44')](_0x202d8a));return{'isValid':![],'message':_0xdbd7('0x79')};}return{'isValid':!![],'message':_0xdbd7('0x7a')};};module[_0xdbd7('0x7b')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index f40cd39..320076c 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 _0x7de7=['[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','resolve','then','notify','catch'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x7de7,0x1c3));var _0x77de=function(_0x23a79e,_0x235f89){_0x23a79e=_0x23a79e-0x0;var _0x3dab57=_0x7de7[_0x23a79e];return _0x3dab57;};'use strict';var util=require(_0x77de('0x0'));var BPromise=require(_0x77de('0x1'));var logger=require(_0x77de('0x2'))(_0x77de('0x3'));var _=require(_0x77de('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x5212fe){return function(_0x21c8b4){logger['error'](_0x5212fe,util['inspect'](_0x21c8b4,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x42d3a2,_0x487416){return BPromise[_0x77de('0x5')]()[_0x77de('0x6')](faxAccount[_0x77de('0x7')](_0x42d3a2,_0x487416))[_0x77de('0x8')](loggerCatch(_0x77de('0x9')));}; \ No newline at end of file +var _0x668e=['notify','resolve','then','catch','[Notify]\x20','util','bluebird','../../../config/logger','lodash','inspect'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x668e,0x109));var _0xe668=function(_0x309d93,_0x157662){_0x309d93=_0x309d93-0x0;var _0x2dd61d=_0x668e[_0x309d93];return _0x2dd61d;};'use strict';var util=require(_0xe668('0x0'));var BPromise=require(_0xe668('0x1'));var logger=require(_0xe668('0x2'))('preview');var _=require(_0xe668('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x1f9282){return function(_0x4c302c){logger['error'](_0x1f9282,util[_0xe668('0x4')](_0x4c302c,{'showHidden':![],'depth':null}));};}exports[_0xe668('0x5')]=function(_0x51eec0,_0x52a2c8){return BPromise[_0xe668('0x6')]()[_0xe668('0x7')](faxAccount['notify'](_0x51eec0,_0x52a2c8))[_0xe668('0x8')](loggerCatch(_0xe668('0x9')));}; \ 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 c39b40e..e6bfa3c 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 _0xec22=['child_process','execute','Exec\x20gs','info','\x20Error\x20:','util','../../../../config/logger','fax','bluebird'];(function(_0xdc4588,_0x7355f){var _0x29858b=function(_0x564d44){while(--_0x564d44){_0xdc4588['push'](_0xdc4588['shift']());}};_0x29858b(++_0x7355f);}(_0xec22,0xa7));var _0x2ec2=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xec22[_0x4a9fb1];return _0x348672;};'use strict';var util=require(_0x2ec2('0x0'));var logger=require(_0x2ec2('0x1'))(_0x2ec2('0x2'));var BPromise=require(_0x2ec2('0x3'));var exec=require(_0x2ec2('0x4'))['exec'];exports[_0x2ec2('0x5')]=function(_0x474323){return new BPromise(function(_0x4481ba,_0x44d110){exec(_0x474323,function(_0xd7c3c8,_0x1a6c46,_0xbe72d2){logger['info'](_0x2ec2('0x6'),_0x1a6c46);if(_0xd7c3c8){logger[_0x2ec2('0x7')](_0x2ec2('0x6'),_0x2ec2('0x8'),util['inspect'](_0xd7c3c8,{'showHidden':![],'depth':null}),_0x1a6c46,_0xbe72d2);_0x44d110(_0xd7c3c8);}_0x4481ba(_0x1a6c46);});});}; \ No newline at end of file +var _0x7e2c=['util','../../../../config/logger','fax','bluebird','child_process','execute','info','Exec\x20gs','inspect'];(function(_0x218b81,_0x196e10){var _0x1b4ba9=function(_0x4d5c32){while(--_0x4d5c32){_0x218b81['push'](_0x218b81['shift']());}};_0x1b4ba9(++_0x196e10);}(_0x7e2c,0xbd));var _0xc7e2=function(_0x3fa518,_0x2d81c9){_0x3fa518=_0x3fa518-0x0;var _0x363d0d=_0x7e2c[_0x3fa518];return _0x363d0d;};'use strict';var util=require(_0xc7e2('0x0'));var logger=require(_0xc7e2('0x1'))(_0xc7e2('0x2'));var BPromise=require(_0xc7e2('0x3'));var exec=require(_0xc7e2('0x4'))['exec'];exports[_0xc7e2('0x5')]=function(_0x4f3489){return new BPromise(function(_0xd494de,_0x37c5eb){exec(_0x4f3489,function(_0x301df,_0x1aabdc,_0x2a7508){logger[_0xc7e2('0x6')](_0xc7e2('0x7'),_0x1aabdc);if(_0x301df){logger['info'](_0xc7e2('0x7'),'\x20Error\x20:',util[_0xc7e2('0x8')](_0x301df,{'showHidden':![],'depth':null}),_0x1aabdc,_0x2a7508);_0x37c5eb(_0x301df);}_0xd494de(_0x1aabdc);});});}; \ 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 00c0fe8..f564dc7 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 _0x11a9=['ecm','headerinfo','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','variablesAction','uniqueid','originate','channel','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','message','addVariables'];(function(_0x48051b,_0x339115){var _0x2a4f6e=function(_0x5b7756){while(--_0x5b7756){_0x48051b['push'](_0x48051b['shift']());}};_0x2a4f6e(++_0x339115);}(_0x11a9,0xc8));var _0x911a=function(_0x27a5c8,_0x26d055){_0x27a5c8=_0x27a5c8-0x0;var _0x1a96a9=_0x11a9[_0x27a5c8];return _0x1a96a9;};'use strict';var util=require(_0x911a('0x0'));var _=require(_0x911a('0x1'));var moment=require(_0x911a('0x2'));var logger=require(_0x911a('0x3'))(_0x911a('0x4'));exports[_0x911a('0x5')]=function(_0x4ff0d4){return{'message':_0x4ff0d4};};exports['logger']=function(_0x6294e7,_0x6f12e4){logger['info'](_0x6294e7,util['inspect'](_0x6f12e4,{'showHidden':![],'depth':null}));};exports[_0x911a('0x6')]=function(_0x37dd07,_0x329017){var _0x3b289b={'XMF-ECM':_0x329017[_0x911a('0x7')],'XMF-HEADERINFO':_0x329017[_0x911a('0x8')],'XMF-MINRATE':_0x329017['minrate'],'XMF-MAXRATE':_0x329017[_0x911a('0x9')],'XMF-MODEM':util[_0x911a('0xa')](_0x911a('0xb'),_0x329017[_0x911a('0xc')]),'XMF-GATEWAY':_0x329017[_0x911a('0xd')],'XMF-FAXDETECT':_0x329017[_0x911a('0xe')],'XMF-T38TIMEOUT':_0x329017[_0x911a('0xf')],'XMF-LOCALSTATIONID':_0x329017[_0x911a('0x10')],'XMF-PATH':_0x37dd07['path']};return _0x3b289b;};exports[_0x911a('0x11')]=function(_0x1c8c99,_0x6125b7){return{'actionid':_0x1c8c99[_0x911a('0x12')],'action':_0x911a('0x13'),'channel':_0x1c8c99[_0x911a('0x14')],'Exten':'xcally-motion-fax','Context':_0x911a('0x15'),'Priority':'1','callerid':util[_0x911a('0xa')](_0x911a('0x16'),_0x1c8c99[_0x911a('0x8')]?_0x1c8c99[_0x911a('0x8')]:'',_0x1c8c99[_0x911a('0x10')]),'variable':_0x6125b7,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1c8c99[_0x911a('0x12')]};}; \ No newline at end of file +var _0xab62=['xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','../../../../config/logger','message','logger','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','modem','gateway','t38timeout','localstationid','path','variablesAction','uniqueid','originate'];(function(_0x2fd97d,_0x26c465){var _0x278698=function(_0x575be7){while(--_0x575be7){_0x2fd97d['push'](_0x2fd97d['shift']());}};_0x278698(++_0x26c465);}(_0xab62,0xdf));var _0x2ab6=function(_0x39c963,_0xac04a0){_0x39c963=_0x39c963-0x0;var _0x590fc0=_0xab62[_0x39c963];return _0x590fc0;};'use strict';var util=require(_0x2ab6('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0x2ab6('0x1'))('fax');exports[_0x2ab6('0x2')]=function(_0x183ca7){return{'message':_0x183ca7};};exports[_0x2ab6('0x3')]=function(_0xd15de9,_0x578e4e){logger['info'](_0xd15de9,util[_0x2ab6('0x4')](_0x578e4e,{'showHidden':![],'depth':null}));};exports[_0x2ab6('0x5')]=function(_0x4b0b7d,_0x4d4019){var _0x276ee4={'XMF-ECM':_0x4d4019[_0x2ab6('0x6')],'XMF-HEADERINFO':_0x4d4019[_0x2ab6('0x7')],'XMF-MINRATE':_0x4d4019[_0x2ab6('0x8')],'XMF-MAXRATE':_0x4d4019[_0x2ab6('0x9')],'XMF-MODEM':util[_0x2ab6('0xa')]('\x22%s\x22',_0x4d4019[_0x2ab6('0xb')]),'XMF-GATEWAY':_0x4d4019[_0x2ab6('0xc')],'XMF-FAXDETECT':_0x4d4019['faxdetect'],'XMF-T38TIMEOUT':_0x4d4019[_0x2ab6('0xd')],'XMF-LOCALSTATIONID':_0x4d4019[_0x2ab6('0xe')],'XMF-PATH':_0x4b0b7d[_0x2ab6('0xf')]};return _0x276ee4;};exports[_0x2ab6('0x10')]=function(_0x5ca1d0,_0x292fd6){return{'actionid':_0x5ca1d0[_0x2ab6('0x11')],'action':_0x2ab6('0x12'),'channel':_0x5ca1d0['channel'],'Exten':_0x2ab6('0x13'),'Context':_0x2ab6('0x14'),'Priority':'1','callerid':util[_0x2ab6('0xa')](_0x2ab6('0x15'),_0x5ca1d0['headerinfo']?_0x5ca1d0[_0x2ab6('0x7')]:'',_0x5ca1d0['localstationid']),'variable':_0x292fd6,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x5ca1d0[_0x2ab6('0x11')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index e5c7cb3..961f591 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 _0x86fd=['listen','sync','error','[index.js][main]','bluebird','util','moment','./server','./realtime','./trigger','./dialer','./preview','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','../../config/logger','hour','get','resolve','then','getAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTemplates','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','[index.js][initParams]','inspect'];(function(_0x30ad27,_0x750e0f){var _0x42242a=function(_0x352f81){while(--_0x352f81){_0x30ad27['push'](_0x30ad27['shift']());}};_0x42242a(++_0x750e0f);}(_0x86fd,0x120));var _0xd86f=function(_0x1d0499,_0x23e22f){_0x1d0499=_0x1d0499-0x0;var _0x153fb3=_0x86fd[_0x1d0499];return _0x153fb3;};'use strict';var BPromise=require(_0xd86f('0x0'));var util=require(_0xd86f('0x1'));var moment=require(_0xd86f('0x2'));var server=require(_0xd86f('0x3'));var Realtime=require(_0xd86f('0x4'));var Report=require('./report');var Acw=require('./acw');var Trigger=require(_0xd86f('0x5'));var Dialer=require(_0xd86f('0x6'));var Preview=require(_0xd86f('0x7'));var Fax=require('./fax');var user=require('./rpc/user');var voiceQueue=require(_0xd86f('0x8'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xd86f('0x9'));var trunk=require(_0xd86f('0xa'));var trigger=require(_0xd86f('0xb'));var template=require('./rpc/template');var cmHopperHistory=require(_0xd86f('0xc'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0xd86f('0xd'));var faxAccount=require(_0xd86f('0xe'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0xd86f('0xf'));var desk=require(_0xd86f('0x10'));var zoho=require(_0xd86f('0x11'));var vtiger=require(_0xd86f('0x12'));var freshsales=require(_0xd86f('0x13'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0xd86f('0x14'));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(_0xd86f('0x15'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0xd86f('0x16'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xd86f('0x17')](_0xd86f('0x16'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xd86f('0x18')]()[_0xd86f('0x19')](user[_0xd86f('0x1a')]())['then'](realtime['initAgents']())['then'](user[_0xd86f('0x1b')]())['then'](realtime[_0xd86f('0x1c')]())['then'](trunk[_0xd86f('0x1d')]())[_0xd86f('0x19')](realtime[_0xd86f('0x1e')]())[_0xd86f('0x19')](voiceQueue[_0xd86f('0x1f')]())[_0xd86f('0x19')](realtime[_0xd86f('0x20')]())['then'](trigger['getTriggers']())[_0xd86f('0x19')](realtime['initTriggers']())['then'](template[_0xd86f('0x21')]())[_0xd86f('0x19')](realtime[_0xd86f('0x22')]())[_0xd86f('0x19')](zendesk[_0xd86f('0x23')]())[_0xd86f('0x19')](realtime['initZendeskAccounts']())[_0xd86f('0x19')](salesforce[_0xd86f('0x24')]())[_0xd86f('0x19')](realtime[_0xd86f('0x25')]())[_0xd86f('0x19')](sugarcrm['getSugarcrmAccounts']())['then'](realtime[_0xd86f('0x26')]())[_0xd86f('0x19')](freshdesk[_0xd86f('0x27')]())[_0xd86f('0x19')](realtime[_0xd86f('0x28')]())[_0xd86f('0x19')](desk[_0xd86f('0x29')]())[_0xd86f('0x19')](realtime[_0xd86f('0x2a')]())['then'](zoho[_0xd86f('0x2b')]())[_0xd86f('0x19')](realtime['initZohoAccounts']())[_0xd86f('0x19')](vtiger[_0xd86f('0x2c')]())[_0xd86f('0x19')](realtime[_0xd86f('0x2d')]())[_0xd86f('0x19')](freshsales[_0xd86f('0x2e')]())[_0xd86f('0x19')](realtime[_0xd86f('0x2f')]())['then'](servicenow[_0xd86f('0x30')]())['then'](realtime[_0xd86f('0x31')]())[_0xd86f('0x19')](dynamics365['getDynamics365Accounts']())[_0xd86f('0x19')](realtime[_0xd86f('0x32')]())[_0xd86f('0x19')](campaign[_0xd86f('0x33')]())[_0xd86f('0x19')](realtime[_0xd86f('0x34')]())[_0xd86f('0x19')](voiceExtension[_0xd86f('0x35')]())[_0xd86f('0x19')](realtime[_0xd86f('0x36')]())[_0xd86f('0x19')](faxAccount['getFaxAccounts']())[_0xd86f('0x19')](realtime[_0xd86f('0x37')]())['then'](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0xd86f('0x19')](voiceQueueReport[_0xd86f('0x38')]())[_0xd86f('0x19')](realtime[_0xd86f('0x39')]())[_0xd86f('0x19')](cmHopperHistory[_0xd86f('0x3a')]())[_0xd86f('0x19')](realtime[_0xd86f('0x3b')]())[_0xd86f('0x19')](cmHopperHistory[_0xd86f('0x3c')]())[_0xd86f('0x19')](realtime[_0xd86f('0x3d')]())['then'](voiceCallReport[_0xd86f('0x3e')]())[_0xd86f('0x19')](realtime[_0xd86f('0x3f')]())[_0xd86f('0x40')](function(_0x3b411a){logger['error'](_0xd86f('0x41'),util[_0xd86f('0x42')](_0x3b411a,{'showHidden':![],'depth':null}));});}function main(){return server[_0xd86f('0x43')](realtime,preview,fax)[_0xd86f('0x19')](function(_0x4fb2bd){return initRealtime();})['then'](function(){return initParams();})['then'](function(){report[_0xd86f('0x44')]();setInterval(initRealtime,0x1388);})[_0xd86f('0x40')](function(_0x46f699){logger[_0xd86f('0x45')](_0xd86f('0x46'),util[_0xd86f('0x42')](_0x46f699,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x02fa=['getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','[index.js][initParams]','inspect','error','[index.js][main]','bluebird','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','getTrunks','getVoiceQueues','initTriggers','getTemplates','initTemplates','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x02fa,0xdd));var _0xa02f=function(_0x37b68b,_0x3b9f54){_0x37b68b=_0x37b68b-0x0;var _0x3e6036=_0x02fa[_0x37b68b];return _0x3e6036;};'use strict';var BPromise=require(_0xa02f('0x0'));var util=require('util');var moment=require('moment');var server=require(_0xa02f('0x1'));var Realtime=require(_0xa02f('0x2'));var Report=require(_0xa02f('0x3'));var Acw=require(_0xa02f('0x4'));var Trigger=require(_0xa02f('0x5'));var Dialer=require(_0xa02f('0x6'));var Preview=require(_0xa02f('0x7'));var Fax=require(_0xa02f('0x8'));var user=require('./rpc/user');var voiceQueue=require(_0xa02f('0x9'));var voiceQueueReport=require(_0xa02f('0xa'));var voiceCallReport=require(_0xa02f('0xb'));var trunk=require('./rpc/trunk');var trigger=require('./rpc/trigger');var template=require(_0xa02f('0xc'));var cmHopperHistory=require(_0xa02f('0xd'));var campaign=require(_0xa02f('0xe'));var voiceExtension=require(_0xa02f('0xf'));var faxAccount=require(_0xa02f('0x10'));var zendesk=require(_0xa02f('0x11'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0xa02f('0x12'));var freshdesk=require(_0xa02f('0x13'));var desk=require(_0xa02f('0x14'));var zoho=require(_0xa02f('0x15'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0xa02f('0x16'));var servicenow=require(_0xa02f('0x17'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xa02f('0x18'))(_0xa02f('0x19'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xa02f('0x1a')](_0xa02f('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xa02f('0x1a')](_0xa02f('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xa02f('0x1c')]()[_0xa02f('0x1d')](user[_0xa02f('0x1e')]())[_0xa02f('0x1d')](realtime[_0xa02f('0x1f')]())[_0xa02f('0x1d')](user[_0xa02f('0x20')]())['then'](realtime['initTelephones']())[_0xa02f('0x1d')](trunk[_0xa02f('0x21')]())[_0xa02f('0x1d')](realtime['initTrunks']())['then'](voiceQueue[_0xa02f('0x22')]())['then'](realtime['initVoiceQueues']())[_0xa02f('0x1d')](trigger['getTriggers']())['then'](realtime[_0xa02f('0x23')]())[_0xa02f('0x1d')](template[_0xa02f('0x24')]())[_0xa02f('0x1d')](realtime[_0xa02f('0x25')]())[_0xa02f('0x1d')](zendesk['getZendeskAccounts']())[_0xa02f('0x1d')](realtime['initZendeskAccounts']())['then'](salesforce[_0xa02f('0x26')]())['then'](realtime[_0xa02f('0x27')]())[_0xa02f('0x1d')](sugarcrm['getSugarcrmAccounts']())['then'](realtime[_0xa02f('0x28')]())[_0xa02f('0x1d')](freshdesk[_0xa02f('0x29')]())[_0xa02f('0x1d')](realtime['initFreshdeskAccounts']())[_0xa02f('0x1d')](desk['getDeskAccounts']())[_0xa02f('0x1d')](realtime[_0xa02f('0x2a')]())[_0xa02f('0x1d')](zoho['getZohoAccounts']())[_0xa02f('0x1d')](realtime[_0xa02f('0x2b')]())[_0xa02f('0x1d')](vtiger[_0xa02f('0x2c')]())[_0xa02f('0x1d')](realtime[_0xa02f('0x2d')]())[_0xa02f('0x1d')](freshsales[_0xa02f('0x2e')]())['then'](realtime[_0xa02f('0x2f')]())[_0xa02f('0x1d')](servicenow[_0xa02f('0x30')]())[_0xa02f('0x1d')](realtime[_0xa02f('0x31')]())['then'](dynamics365[_0xa02f('0x32')]())[_0xa02f('0x1d')](realtime[_0xa02f('0x33')]())[_0xa02f('0x1d')](campaign[_0xa02f('0x34')]())['then'](realtime[_0xa02f('0x35')]())[_0xa02f('0x1d')](voiceExtension[_0xa02f('0x36')]())[_0xa02f('0x1d')](realtime['initVoiceExtensions']())[_0xa02f('0x1d')](faxAccount[_0xa02f('0x37')]())['then'](realtime[_0xa02f('0x38')]())[_0xa02f('0x1d')](function(){return realtime;});}function initParams(){return BPromise[_0xa02f('0x1c')]()['then'](voiceQueueReport[_0xa02f('0x39')]())[_0xa02f('0x1d')](realtime[_0xa02f('0x3a')]())[_0xa02f('0x1d')](cmHopperHistory[_0xa02f('0x3b')]())[_0xa02f('0x1d')](realtime[_0xa02f('0x3c')]())['then'](cmHopperHistory[_0xa02f('0x3d')]())['then'](realtime[_0xa02f('0x3e')]())['then'](voiceCallReport[_0xa02f('0x3f')]())['then'](realtime[_0xa02f('0x40')]())[_0xa02f('0x41')](function(_0x5736fe){logger['error'](_0xa02f('0x42'),util[_0xa02f('0x43')](_0x5736fe,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)['then'](function(_0x2187e0){return initRealtime();})['then'](function(){return initParams();})[_0xa02f('0x1d')](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x5aafb8){logger[_0xa02f('0x44')](_0xa02f('0x45'),util['inspect'](_0x5aafb8,{'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 d184b4a..1ab780d 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 _0xcb91=['name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','local','updateStatusRealtime','state','idle','inuse','talking','statePause','voiceStatusTime','toNumber','voiceStatusCallerIdNumber','stringify','format','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter'];(function(_0x3e5bbf,_0x3d269b){var _0x2f2196=function(_0x31d5fe){while(--_0x31d5fe){_0x3e5bbf['push'](_0x3e5bbf['shift']());}};_0x2f2196(++_0x3d269b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2ff762,_0x342c0b){_0x2ff762=_0x2ff762-0x0;var _0x158b02=_0xcb91[_0x2ff762];return _0x158b02;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var md5=require(_0x1cb9('0x1'));var Redis=require(_0x1cb9('0x2'));var config=require(_0x1cb9('0x3'));config['redis']=_[_0x1cb9('0x4')](config[_0x1cb9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0x6'))(new Redis(config[_0x1cb9('0x5')]));function Agent(_0x53ffbd){this['id']=_0x53ffbd['id']||0x0;this[_0x1cb9('0x7')]=_0x53ffbd[_0x1cb9('0x7')]||'';this['email']=_0x53ffbd[_0x1cb9('0x8')]||'';this[_0x1cb9('0x9')]=_0x53ffbd['accountcode']||'';this[_0x1cb9('0xa')]=_0x53ffbd['fullname']||'';this['state']=_0x1cb9('0xb');this[_0x1cb9('0xc')]=0x0;this[_0x1cb9('0xd')]=_0x1cb9('0xb');this[_0x1cb9('0xe')]='';this['phone']='';this[_0x1cb9('0xf')]='';this[_0x1cb9('0x10')]='';this[_0x1cb9('0x11')]=_0x53ffbd[_0x1cb9('0x11')]||![];this[_0x1cb9('0x12')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x1cb9('0x13')]='';this[_0x1cb9('0x14')]=![];this[_0x1cb9('0x15')]=![];this[_0x1cb9('0x1')]='';}Agent['prototype'][_0x1cb9('0x16')]=function(_0x6ef389){var _0x1b3cd7;if(_0x6ef389&&_0x6ef389[_0x1cb9('0x17')]){_0x1b3cd7=_0x6ef389[_0x1cb9('0x17')]['toLowerCase']();switch(_0x1b3cd7){case'not_inuse':_0x1b3cd7=_0x1cb9('0x18');break;case _0x1cb9('0x19'):_0x1b3cd7=_0x1cb9('0x1a');break;}}if(_0x1b3cd7&&this[_0x1cb9('0x12')]!==_0x1b3cd7||_0x6ef389[_0x1cb9('0x1b')]){this[_0x1cb9('0x1c')]=_[_0x1cb9('0x1d')](moment()['format']('x'));}if(_0x1b3cd7){this['voiceStatus']=_0x1b3cd7;}var _0x1b2fa6={'id':this['id'],'name':this[_0x1cb9('0x7')],'email':this[_0x1cb9('0x8')],'accountcode':this[_0x1cb9('0x9')],'fullname':this[_0x1cb9('0xa')],'state':this[_0x1cb9('0x17')],'stateTime':this[_0x1cb9('0xc')],'status':this['status'],'address':this['address'],'online':this[_0x1cb9('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x1cb9('0x1c')],'voiceStatusCallerIdNumber':this[_0x1cb9('0x1e')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x1cb9('0x14')]};var _0x325637=md5(JSON[_0x1cb9('0x1f')](_0x1b2fa6));if(this[_0x1cb9('0x1')]!==_0x325637){this[_0x1cb9('0x1')]=_0x325637;io['to'](util[_0x1cb9('0x20')]('user:%s',_0x1b2fa6['name']))[_0x1cb9('0x21')]('user:save',_0x1b2fa6);io[_0x1cb9('0x21')](_0x1cb9('0x22'),_0x1b2fa6);}};module[_0x1cb9('0x23')]=Agent; \ No newline at end of file +var _0xe706=['address','phone','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','updateStatusRealtime','not_inuse','inuse','talking','format','interface','stringify','md5','user:%s','emit','user:presence','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status'];(function(_0x301481,_0x2bb36c){var _0x2a6680=function(_0x499c1d){while(--_0x499c1d){_0x301481['push'](_0x301481['shift']());}};_0x2a6680(++_0x2bb36c);}(_0xe706,0xa3));var _0x6e70=function(_0x3349fe,_0x111770){_0x3349fe=_0x3349fe-0x0;var _0x3f8bc5=_0xe706[_0x3349fe];return _0x3f8bc5;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var md5=require('md5');var Redis=require(_0x6e70('0x3'));var config=require(_0x6e70('0x4'));config[_0x6e70('0x5')]=_[_0x6e70('0x6')](config[_0x6e70('0x5')],{'host':_0x6e70('0x7'),'port':0x18eb});var io=require(_0x6e70('0x8'))(new Redis(config[_0x6e70('0x5')]));function Agent(_0x1b0389){this['id']=_0x1b0389['id']||0x0;this[_0x6e70('0x9')]=_0x1b0389[_0x6e70('0x9')]||'';this[_0x6e70('0xa')]=_0x1b0389[_0x6e70('0xa')]||'';this[_0x6e70('0xb')]=_0x1b0389[_0x6e70('0xb')]||'';this[_0x6e70('0xc')]=_0x1b0389[_0x6e70('0xc')]||'';this[_0x6e70('0xd')]=_0x6e70('0xe');this[_0x6e70('0xf')]=0x0;this[_0x6e70('0x10')]=_0x6e70('0xe');this[_0x6e70('0x11')]='';this[_0x6e70('0x12')]='';this['mobile']='';this['interface']='';this[_0x6e70('0x13')]=_0x1b0389[_0x6e70('0x13')]||![];this[_0x6e70('0x14')]=_0x6e70('0xe');this[_0x6e70('0x15')]=0x0;this[_0x6e70('0x16')]='';this[_0x6e70('0x17')]='';this[_0x6e70('0x18')]=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x6e70('0x19')]=function(_0x5a37a6){var _0x53aed0;if(_0x5a37a6&&_0x5a37a6[_0x6e70('0xd')]){_0x53aed0=_0x5a37a6[_0x6e70('0xd')]['toLowerCase']();switch(_0x53aed0){case _0x6e70('0x1a'):_0x53aed0='idle';break;case _0x6e70('0x1b'):_0x53aed0=_0x6e70('0x1c');break;}}if(_0x53aed0&&this['voiceStatus']!==_0x53aed0||_0x5a37a6['statePause']){this[_0x6e70('0x15')]=_['toNumber'](moment()[_0x6e70('0x1d')]('x'));}if(_0x53aed0){this[_0x6e70('0x14')]=_0x53aed0;}var _0x53acdc={'id':this['id'],'name':this['name'],'email':this[_0x6e70('0xa')],'accountcode':this[_0x6e70('0xb')],'fullname':this[_0x6e70('0xc')],'state':this[_0x6e70('0xd')],'stateTime':this[_0x6e70('0xf')],'status':this[_0x6e70('0x10')],'address':this[_0x6e70('0x11')],'online':this[_0x6e70('0x13')],'voiceStatus':this[_0x6e70('0x14')],'voiceStatusTime':this[_0x6e70('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x6e70('0x17')],'interface':this[_0x6e70('0x1e')],'onhold':this[_0x6e70('0x18')]};var _0x502b2d=md5(JSON[_0x6e70('0x1f')](_0x53acdc));if(this[_0x6e70('0x20')]!==_0x502b2d){this[_0x6e70('0x20')]=_0x502b2d;io['to'](util['format'](_0x6e70('0x21'),_0x53acdc['name']))['emit']('user:save',_0x53acdc);io[_0x6e70('0x22')](_0x6e70('0x23'),_0x53acdc);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index e0fd8a3..8bc718b 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 _0x1e41=['dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1e41,0x13d));var _0x11e4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1e41[_0xa464c9];return _0x3d73c4;};'use strict';function Campaign(_0x5838a2){this['id']=_0x5838a2['id']||0x0;this[_0x11e4('0x0')]=_0x5838a2[_0x11e4('0x0')]||'';this[_0x11e4('0x1')]=_0x5838a2[_0x11e4('0x1')]||'campaign';this[_0x11e4('0x2')]=0x0;this['temp']=0x0;this[_0x11e4('0x3')]=0x0;this[_0x11e4('0x4')]=0x0;this[_0x11e4('0x5')]='';this[_0x11e4('0x6')]=!![];this['active']=_0x5838a2[_0x11e4('0x7')];this[_0x11e4('0x8')]=_0x5838a2['limitCalls'];this['dialTimezone']=_0x5838a2['dialTimezone']||null;this[_0x11e4('0x9')]=_0x5838a2[_0x11e4('0x9')]?_0x5838a2[_0x11e4('0x9')]:null;this['dialOriginateCallerIdName']=_0x5838a2[_0x11e4('0xa')];this[_0x11e4('0xb')]=_0x5838a2[_0x11e4('0xb')];this['dialOriginateTimeout']=_0x5838a2[_0x11e4('0xc')]||0x1e;this['dialCongestionMaxRetry']=_0x5838a2[_0x11e4('0xd')];this[_0x11e4('0xe')]=_0x5838a2[_0x11e4('0xe')];this[_0x11e4('0xf')]=_0x5838a2[_0x11e4('0xf')];this[_0x11e4('0x10')]=_0x5838a2[_0x11e4('0x10')];this[_0x11e4('0x11')]=_0x5838a2['dialNoAnswerMaxRetry'];this[_0x11e4('0x12')]=_0x5838a2['dialNoAnswerRetryFrequency'];this[_0x11e4('0x13')]=_0x5838a2['dialGlobalMaxRetry'];this[_0x11e4('0x14')]=_0x5838a2['dialNoSuchNumberMaxRetry']||0x3;this[_0x11e4('0x15')]=_0x5838a2[_0x11e4('0x15')]||0x96;this['dialDropMaxRetry']=_0x5838a2['dialDropMaxRetry']||0x3;this[_0x11e4('0x16')]=_0x5838a2[_0x11e4('0x16')]||0x96;this['dialAbandonedMaxRetry']=_0x5838a2['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x5838a2[_0x11e4('0x17')]||0x96;this['dialMachineMaxRetry']=_0x5838a2['dialMachineMaxRetry']||0x3;this[_0x11e4('0x18')]=_0x5838a2[_0x11e4('0x18')]||0x96;this[_0x11e4('0x19')]=_0x5838a2[_0x11e4('0x19')]||0x3;this['dialAgentRejectRetryFrequency']=_0x5838a2[_0x11e4('0x1a')]||0x96;this[_0x11e4('0x1b')]=_0x5838a2['dialOrderByScheduledAt']||_0x11e4('0x1c');this['dialPrefix']=_0x5838a2[_0x11e4('0x1d')]||undefined;this[_0x11e4('0x1e')]=_0x5838a2[_0x11e4('0x1e')]||undefined;this[_0x11e4('0x1f')]=_0x5838a2[_0x11e4('0x1f')]||undefined;this['TrunkBackup']=_0x5838a2['TrunkBackup']?_0x5838a2['TrunkBackup']:undefined;this[_0x11e4('0x20')]=_0x5838a2[_0x11e4('0x20')]?_0x5838a2[_0x11e4('0x20')]:undefined;this[_0x11e4('0x21')]=_0x5838a2['Interval']?_0x5838a2[_0x11e4('0x21')]:undefined;this['SquareProject']=_0x5838a2[_0x11e4('0x22')]?_0x5838a2[_0x11e4('0x22')]:undefined;this[_0x11e4('0x23')]=_0x5838a2['SquareProject']?_0x5838a2[_0x11e4('0x22')]['name']:undefined;this[_0x11e4('0x24')]=_0x5838a2[_0x11e4('0x24')]||![];this[_0x11e4('0x25')]=_0x5838a2[_0x11e4('0x25')];this[_0x11e4('0x26')]=_0x5838a2[_0x11e4('0x26')];this[_0x11e4('0x27')]=_0x5838a2[_0x11e4('0x27')];this[_0x11e4('0x28')]=_0x5838a2[_0x11e4('0x28')];this[_0x11e4('0x29')]=_0x5838a2['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x5838a2[_0x11e4('0x2a')];this[_0x11e4('0x2b')]=_0x5838a2['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x5838a2[_0x11e4('0x2c')];this[_0x11e4('0x2d')]=_0x5838a2[_0x11e4('0x2d')];}module[_0x11e4('0x2e')]=Campaign; \ No newline at end of file +var _0xd3e6=['dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrTotalCallsDays','message','active','limitCalls','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xd3e6,0x16f));var _0x6d3e=function(_0x21638d,_0x10819d){_0x21638d=_0x21638d-0x0;var _0x2b37b3=_0xd3e6[_0x21638d];return _0x2b37b3;};'use strict';function Campaign(_0x3e6227){this['id']=_0x3e6227['id']||0x0;this[_0x6d3e('0x0')]=_0x3e6227[_0x6d3e('0x0')]||'';this[_0x6d3e('0x1')]=_0x3e6227['type']||_0x6d3e('0x2');this[_0x6d3e('0x3')]=0x0;this['temp']=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x6d3e('0x4')]=0x0;this[_0x6d3e('0x5')]='';this['sendMessageOneNotActive']=!![];this[_0x6d3e('0x6')]=_0x3e6227[_0x6d3e('0x6')];this[_0x6d3e('0x7')]=_0x3e6227[_0x6d3e('0x7')];this['dialTimezone']=_0x3e6227['dialTimezone']||null;this[_0x6d3e('0x8')]=_0x3e6227[_0x6d3e('0x8')]?_0x3e6227[_0x6d3e('0x8')]:null;this[_0x6d3e('0x9')]=_0x3e6227['dialOriginateCallerIdName'];this[_0x6d3e('0xa')]=_0x3e6227[_0x6d3e('0xa')];this['dialOriginateTimeout']=_0x3e6227[_0x6d3e('0xb')]||0x1e;this[_0x6d3e('0xc')]=_0x3e6227[_0x6d3e('0xc')];this['dialCongestionRetryFrequency']=_0x3e6227[_0x6d3e('0xd')];this[_0x6d3e('0xe')]=_0x3e6227[_0x6d3e('0xe')];this[_0x6d3e('0xf')]=_0x3e6227[_0x6d3e('0xf')];this[_0x6d3e('0x10')]=_0x3e6227[_0x6d3e('0x10')];this[_0x6d3e('0x11')]=_0x3e6227[_0x6d3e('0x11')];this[_0x6d3e('0x12')]=_0x3e6227[_0x6d3e('0x12')];this['dialNoSuchNumberMaxRetry']=_0x3e6227[_0x6d3e('0x13')]||0x3;this[_0x6d3e('0x14')]=_0x3e6227[_0x6d3e('0x14')]||0x96;this[_0x6d3e('0x15')]=_0x3e6227[_0x6d3e('0x15')]||0x3;this[_0x6d3e('0x16')]=_0x3e6227['dialDropRetryFrequency']||0x96;this[_0x6d3e('0x17')]=_0x3e6227[_0x6d3e('0x17')]||0x3;this['dialAbandonedRetryFrequency']=_0x3e6227[_0x6d3e('0x18')]||0x96;this['dialMachineMaxRetry']=_0x3e6227[_0x6d3e('0x19')]||0x3;this[_0x6d3e('0x1a')]=_0x3e6227[_0x6d3e('0x1a')]||0x96;this[_0x6d3e('0x1b')]=_0x3e6227[_0x6d3e('0x1b')]||0x3;this[_0x6d3e('0x1c')]=_0x3e6227['dialAgentRejectRetryFrequency']||0x96;this[_0x6d3e('0x1d')]=_0x3e6227[_0x6d3e('0x1d')]||_0x6d3e('0x1e');this[_0x6d3e('0x1f')]=_0x3e6227['dialPrefix']||undefined;this[_0x6d3e('0x20')]=_0x3e6227[_0x6d3e('0x20')]||undefined;this[_0x6d3e('0x21')]=_0x3e6227[_0x6d3e('0x21')]||undefined;this[_0x6d3e('0x22')]=_0x3e6227[_0x6d3e('0x22')]?_0x3e6227[_0x6d3e('0x22')]:undefined;this[_0x6d3e('0x23')]=_0x3e6227[_0x6d3e('0x23')]?_0x3e6227[_0x6d3e('0x23')]:undefined;this[_0x6d3e('0x24')]=_0x3e6227[_0x6d3e('0x24')]?_0x3e6227[_0x6d3e('0x24')]:undefined;this['SquareProject']=_0x3e6227['SquareProject']?_0x3e6227[_0x6d3e('0x25')]:undefined;this[_0x6d3e('0x26')]=_0x3e6227[_0x6d3e('0x25')]?_0x3e6227[_0x6d3e('0x25')][_0x6d3e('0x0')]:undefined;this[_0x6d3e('0x27')]=_0x3e6227[_0x6d3e('0x27')]||![];this[_0x6d3e('0x28')]=_0x3e6227[_0x6d3e('0x28')];this['dialAMDGreeting']=_0x3e6227[_0x6d3e('0x29')];this[_0x6d3e('0x2a')]=_0x3e6227[_0x6d3e('0x2a')];this[_0x6d3e('0x2b')]=_0x3e6227[_0x6d3e('0x2b')];this[_0x6d3e('0x2c')]=_0x3e6227[_0x6d3e('0x2c')];this['dialAMDBetweenWordsSilence']=_0x3e6227[_0x6d3e('0x2d')];this[_0x6d3e('0x2e')]=_0x3e6227['dialAMDMaximumNumberOfWords'];this[_0x6d3e('0x2f')]=_0x3e6227[_0x6d3e('0x2f')];this['dialAMDMaximumWordLength']=_0x3e6227[_0x6d3e('0x30')];}module[_0x6d3e('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 7c4801d..07aeb95 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 _0x3f7c=['unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','disposition','monitor','queue','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinename','context','uniqueid','linkedid','exten','answered','endtime'];(function(_0x30b572,_0x1540a5){var _0x4b63b9=function(_0x474501){while(--_0x474501){_0x30b572['push'](_0x30b572['shift']());}};_0x4b63b9(++_0x1540a5);}(_0x3f7c,0xaa));var _0xc3f7=function(_0x35d6dd,_0x1a993c){_0x35d6dd=_0x35d6dd-0x0;var _0x489f34=_0x3f7c[_0x35d6dd];return _0x489f34;};'use strict';function Channel(){this[_0xc3f7('0x0')]=null;this[_0xc3f7('0x1')]='';this[_0xc3f7('0x2')]='';this[_0xc3f7('0x3')]=0x0;this[_0xc3f7('0x4')]='';this['connectedlinenum']=undefined;this[_0xc3f7('0x5')]=undefined;this['accountcode']=0x0;this[_0xc3f7('0x6')]='';this[_0xc3f7('0x7')]=0x0;this[_0xc3f7('0x8')]=0x0;this[_0xc3f7('0x9')]=0x0;this[_0xc3f7('0xa')]=![];this['answertime']=null;this[_0xc3f7('0xb')]=null;this[_0xc3f7('0xc')]=![];this[_0xc3f7('0xd')]=![];this[_0xc3f7('0xe')]='';this[_0xc3f7('0xf')]='';this[_0xc3f7('0x10')]=0x0;this[_0xc3f7('0x11')]=0x0;this[_0xc3f7('0x12')]=0x0;this[_0xc3f7('0x13')]=null;this['tag']=null;this[_0xc3f7('0x14')]=null;this[_0xc3f7('0x15')]=![];this['monitorFilename']=null;this[_0xc3f7('0x16')]=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0xc3f7('0x17')]=undefined;this['transferType']=undefined;this[_0xc3f7('0x18')]=0x0;}module[_0xc3f7('0x19')]=Channel; \ No newline at end of file +var _0xbb59=['connectedlinename','accountcode','context','uniqueid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','connectedlinenum'];(function(_0x1ca65d,_0x5912cf){var _0x5f3b83=function(_0x2131bd){while(--_0x2131bd){_0x1ca65d['push'](_0x1ca65d['shift']());}};_0x5f3b83(++_0x5912cf);}(_0xbb59,0xec));var _0x9bb5=function(_0x14410c,_0x231eca){_0x14410c=_0x14410c-0x0;var _0x1efbab=_0xbb59[_0x14410c];return _0x1efbab;};'use strict';function Channel(){this[_0x9bb5('0x0')]=null;this[_0x9bb5('0x1')]='';this[_0x9bb5('0x2')]='';this['calleridnum']=0x0;this['calleridname']='';this[_0x9bb5('0x3')]=undefined;this[_0x9bb5('0x4')]=undefined;this[_0x9bb5('0x5')]=0x0;this[_0x9bb5('0x6')]='';this[_0x9bb5('0x7')]=0x0;this['linkedid']=0x0;this[_0x9bb5('0x8')]=0x0;this[_0x9bb5('0x9')]=![];this[_0x9bb5('0xa')]=null;this[_0x9bb5('0xb')]=null;this[_0x9bb5('0xc')]=![];this[_0x9bb5('0xd')]=![];this[_0x9bb5('0xe')]='';this[_0x9bb5('0xf')]='';this[_0x9bb5('0x10')]=0x0;this[_0x9bb5('0x11')]=0x0;this[_0x9bb5('0x12')]=0x0;this[_0x9bb5('0x13')]=null;this[_0x9bb5('0x14')]=null;this['disposition']=null;this[_0x9bb5('0x15')]=![];this[_0x9bb5('0x16')]=null;this[_0x9bb5('0x17')]=null;this[_0x9bb5('0x18')]=[];this[_0x9bb5('0x19')]=undefined;this[_0x9bb5('0x1a')]=undefined;this[_0x9bb5('0x1b')]=undefined;this[_0x9bb5('0x1c')]=0x0;}module[_0x9bb5('0x1d')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index e0a0795..073bb5a 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 _0xca4b=['tokenSecret','type','serverUrl','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token'];(function(_0x5f5237,_0x37e26b){var _0x59f9d9=function(_0x1ca142){while(--_0x1ca142){_0x5f5237['push'](_0x5f5237['shift']());}};_0x59f9d9(++_0x37e26b);}(_0xca4b,0x118));var _0xbca4=function(_0x5bf082,_0xb86bf8){_0x5bf082=_0x5bf082-0x0;var _0xc7d2e1=_0xca4b[_0x5bf082];return _0xc7d2e1;};'use strict';function DeskAccount(_0x2c140e){this['id']=_0x2c140e['id']||0x0;this[_0xbca4('0x0')]=_0x2c140e['name']||'';this[_0xbca4('0x1')]=_0x2c140e['username']||'';this['remoteUri']=_0x2c140e[_0xbca4('0x2')]||'';this[_0xbca4('0x3')]=_0x2c140e[_0xbca4('0x3')]||'';this[_0xbca4('0x4')]=_0x2c140e['password']||'';this[_0xbca4('0x5')]=_0x2c140e[_0xbca4('0x5')]||'';this[_0xbca4('0x6')]=_0x2c140e[_0xbca4('0x6')]||'';this[_0xbca4('0x7')]=_0x2c140e[_0xbca4('0x7')]||'';this[_0xbca4('0x8')]=_0x2c140e[_0xbca4('0x8')]||'';this[_0xbca4('0x9')]=_0x2c140e[_0xbca4('0x9')]||'';this[_0xbca4('0xa')]=_0x2c140e[_0xbca4('0xa')]||'';this['Configurations']=_0x2c140e['Configurations']||{};}module[_0xbca4('0xb')]=DeskAccount; \ No newline at end of file +var _0xf222=['serverUrl','Configurations','exports','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0x47df36,_0x35a719){var _0x2076fe=function(_0x5e71b8){while(--_0x5e71b8){_0x47df36['push'](_0x47df36['shift']());}};_0x2076fe(++_0x35a719);}(_0xf222,0x183));var _0x2f22=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xf222[_0x19e35c];return _0x3e1fe8;};'use strict';function DeskAccount(_0x445e7b){this['id']=_0x445e7b['id']||0x0;this['name']=_0x445e7b['name']||'';this[_0x2f22('0x0')]=_0x445e7b[_0x2f22('0x0')]||'';this[_0x2f22('0x1')]=_0x445e7b[_0x2f22('0x1')]||'';this[_0x2f22('0x2')]=_0x445e7b[_0x2f22('0x2')]||'';this[_0x2f22('0x3')]=_0x445e7b['password']||'';this[_0x2f22('0x4')]=_0x445e7b[_0x2f22('0x4')]||'';this['consumerSecret']=_0x445e7b[_0x2f22('0x5')]||'';this[_0x2f22('0x6')]=_0x445e7b['token']||'';this['tokenSecret']=_0x445e7b[_0x2f22('0x7')]||'';this[_0x2f22('0x8')]=_0x445e7b['type']||'';this['serverUrl']=_0x445e7b[_0x2f22('0x9')]||'';this[_0x2f22('0xa')]=_0x445e7b[_0x2f22('0xa')]||{};}module[_0x2f22('0xb')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index ba4db30..4962c03 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 _0x45c3=['clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId'];(function(_0x59c2cb,_0x671ebb){var _0x4d2910=function(_0x50c769){while(--_0x50c769){_0x59c2cb['push'](_0x59c2cb['shift']());}};_0x4d2910(++_0x671ebb);}(_0x45c3,0x1db));var _0x345c=function(_0x43af80,_0x1a300e){_0x43af80=_0x43af80-0x0;var _0x26c0ea=_0x45c3[_0x43af80];return _0x26c0ea;};'use strict';function Dynamics365Account(_0x5c2f2d){this['id']=_0x5c2f2d['id']||0x0;this[_0x345c('0x0')]=_0x5c2f2d[_0x345c('0x0')]||'';this[_0x345c('0x1')]=_0x5c2f2d[_0x345c('0x1')]||'';this[_0x345c('0x2')]=_0x5c2f2d[_0x345c('0x2')]||'';this[_0x345c('0x3')]=_0x5c2f2d[_0x345c('0x3')]||'';this[_0x345c('0x4')]=_0x5c2f2d[_0x345c('0x4')]||'';this[_0x345c('0x5')]=_0x5c2f2d['clientId']||'';this[_0x345c('0x6')]=_0x5c2f2d[_0x345c('0x6')]||{};this[_0x345c('0x7')]=_0x5c2f2d[_0x345c('0x7')]||'';this['modernAuthentication']=_0x5c2f2d[_0x345c('0x8')]||![];this[_0x345c('0x9')]=_0x5c2f2d[_0x345c('0x9')]||{};this[_0x345c('0xa')]=_0x5c2f2d[_0x345c('0xa')]||{};}module[_0x345c('0xb')]=Dynamics365Account; \ No newline at end of file +var _0xd05c=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0x35ec99,_0x535ff0){var _0x58b72b=function(_0x1d862a){while(--_0x1d862a){_0x35ec99['push'](_0x35ec99['shift']());}};_0x58b72b(++_0x535ff0);}(_0xd05c,0x8f));var _0xcd05=function(_0x1ef0e3,_0x4ffc33){_0x1ef0e3=_0x1ef0e3-0x0;var _0x1a95e0=_0xd05c[_0x1ef0e3];return _0x1a95e0;};'use strict';function Dynamics365Account(_0x3c1532){this['id']=_0x3c1532['id']||0x0;this[_0xcd05('0x0')]=_0x3c1532[_0xcd05('0x0')]||'';this[_0xcd05('0x1')]=_0x3c1532[_0xcd05('0x1')]||'';this['password']=_0x3c1532[_0xcd05('0x2')]||'';this['remoteUri']=_0x3c1532[_0xcd05('0x3')]||'';this[_0xcd05('0x4')]=_0x3c1532[_0xcd05('0x4')]||'';this[_0xcd05('0x5')]=_0x3c1532[_0xcd05('0x5')]||'';this[_0xcd05('0x6')]=_0x3c1532[_0xcd05('0x6')]||{};this[_0xcd05('0x7')]=_0x3c1532['serverUrl']||'';this[_0xcd05('0x8')]=_0x3c1532[_0xcd05('0x8')]||![];this['Configurations']=_0x3c1532[_0xcd05('0x9')]||{};this[_0xcd05('0xa')]=_0x3c1532['CloudProvider']||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 225a07e..8be00fb 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 _0x011b=['headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x011b,0x15d));var _0xb011=function(_0x1a7fc8,_0xaa913){_0x1a7fc8=_0x1a7fc8-0x0;var _0x4e0bf6=_0x011b[_0x1a7fc8];return _0x4e0bf6;};'use strict';function FaxAccount(_0x53fad2){this['id']=_0x53fad2['id']||0x0;this[_0xb011('0x0')]=_0x53fad2[_0xb011('0x0')]||'';this[_0xb011('0x1')]=_0x53fad2['description'];this[_0xb011('0x2')]=_0x53fad2[_0xb011('0x2')];this[_0xb011('0x3')]=_0x53fad2[_0xb011('0x3')];this[_0xb011('0x4')]=_0x53fad2['localstationid'];this[_0xb011('0x5')]=_0x53fad2[_0xb011('0x5')]||0x960;this[_0xb011('0x6')]=_0x53fad2[_0xb011('0x6')]||0x3840;this[_0xb011('0x7')]=_0x53fad2['modem']||'v17,v27,v29';this[_0xb011('0x8')]=_0x53fad2[_0xb011('0x8')]||'no';this['faxdetect']=_0x53fad2[_0xb011('0x9')]||'no';this['t38timeout']=_0x53fad2[_0xb011('0xa')]||0x1388;this[_0xb011('0xb')]=_0x53fad2['tech']||'SIP';this['Trunk']=_0x53fad2['Trunk']?_0x53fad2[_0xb011('0xc')]:undefined;this[_0xb011('0xd')]=_0x53fad2[_0xb011('0xd')];this[_0xb011('0xe')]=_0x53fad2[_0xb011('0xe')];}module[_0xb011('0xf')]=FaxAccount; \ No newline at end of file +var _0xdf87=['localstationid','minrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo'];(function(_0x4314d7,_0x355218){var _0x5c599b=function(_0x556354){while(--_0x556354){_0x4314d7['push'](_0x4314d7['shift']());}};_0x5c599b(++_0x355218);}(_0xdf87,0x6c));var _0x7df8=function(_0x20ca7c,_0x40925a){_0x20ca7c=_0x20ca7c-0x0;var _0x524ffb=_0xdf87[_0x20ca7c];return _0x524ffb;};'use strict';function FaxAccount(_0x368ecf){this['id']=_0x368ecf['id']||0x0;this['name']=_0x368ecf[_0x7df8('0x0')]||'';this[_0x7df8('0x1')]=_0x368ecf[_0x7df8('0x1')];this[_0x7df8('0x2')]=_0x368ecf['ecm'];this[_0x7df8('0x3')]=_0x368ecf['headerinfo'];this['localstationid']=_0x368ecf[_0x7df8('0x4')];this[_0x7df8('0x5')]=_0x368ecf[_0x7df8('0x5')]||0x960;this['maxrate']=_0x368ecf['maxrate']||0x3840;this['modem']=_0x368ecf[_0x7df8('0x6')]||_0x7df8('0x7');this[_0x7df8('0x8')]=_0x368ecf[_0x7df8('0x8')]||'no';this[_0x7df8('0x9')]=_0x368ecf[_0x7df8('0x9')]||'no';this[_0x7df8('0xa')]=_0x368ecf[_0x7df8('0xa')]||0x1388;this[_0x7df8('0xb')]=_0x368ecf['tech']||'SIP';this[_0x7df8('0xc')]=_0x368ecf[_0x7df8('0xc')]?_0x368ecf[_0x7df8('0xc')]:undefined;this['ListId']=_0x368ecf[_0x7df8('0xd')];this['key']=_0x368ecf[_0x7df8('0xe')];}module[_0x7df8('0xf')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 0ce66aa..4567607 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 _0x4561=['exports','name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x2ee161,_0x17b0d4){var _0x3b99a6=function(_0x5a5a2c){while(--_0x5a5a2c){_0x2ee161['push'](_0x2ee161['shift']());}};_0x3b99a6(++_0x17b0d4);}(_0x4561,0x1f1));var _0x1456=function(_0x296552,_0x19a077){_0x296552=_0x296552-0x0;var _0x415b90=_0x4561[_0x296552];return _0x415b90;};'use strict';function FreshdeskAccount(_0x1a47a){this['id']=_0x1a47a['id']||0x0;this[_0x1456('0x0')]=_0x1a47a[_0x1456('0x0')]||'';this['username']=_0x1a47a[_0x1456('0x1')]||'';this[_0x1456('0x2')]=_0x1a47a[_0x1456('0x3')]||'';this['remoteUri']=_0x1a47a[_0x1456('0x4')]||'';this[_0x1456('0x5')]=_0x1a47a['serverUrl']||'';this[_0x1456('0x6')]=_0x1a47a['Configurations']||{};}module[_0x1456('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0xfe24=['name','username','apiKey','token','remoteUri','Configurations'];(function(_0xf0a3c7,_0x47c422){var _0x3d25cb=function(_0x2b2a46){while(--_0x2b2a46){_0xf0a3c7['push'](_0xf0a3c7['shift']());}};_0x3d25cb(++_0x47c422);}(_0xfe24,0x156));var _0x4fe2=function(_0x4de65a,_0x33c4e4){_0x4de65a=_0x4de65a-0x0;var _0x313a10=_0xfe24[_0x4de65a];return _0x313a10;};'use strict';function FreshdeskAccount(_0x33e645){this['id']=_0x33e645['id']||0x0;this[_0x4fe2('0x0')]=_0x33e645[_0x4fe2('0x0')]||'';this[_0x4fe2('0x1')]=_0x33e645[_0x4fe2('0x1')]||'';this[_0x4fe2('0x2')]=_0x33e645[_0x4fe2('0x3')]||'';this['remoteUri']=_0x33e645[_0x4fe2('0x4')]||'';this['serverUrl']=_0x33e645['serverUrl']||'';this[_0x4fe2('0x5')]=_0x33e645['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 bf110fd..b2a4eef 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 _0x4279=['Configurations','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x3ec996,_0x445b93){var _0x5b6ac9=function(_0x5d1215){while(--_0x5d1215){_0x3ec996['push'](_0x3ec996['shift']());}};_0x5b6ac9(++_0x445b93);}(_0x4279,0x8d));var _0x9427=function(_0x27d72a,_0x293795){_0x27d72a=_0x27d72a-0x0;var _0x39d464=_0x4279[_0x27d72a];return _0x39d464;};'use strict';function FreshsalesAccount(_0x1a6a23){this['id']=_0x1a6a23['id']||0x0;this[_0x9427('0x0')]=_0x1a6a23[_0x9427('0x0')]||'';this['username']=_0x1a6a23[_0x9427('0x1')]||'';this[_0x9427('0x2')]=_0x1a6a23[_0x9427('0x3')]||'';this[_0x9427('0x4')]=_0x1a6a23['remoteUri']||'';this[_0x9427('0x5')]=_0x1a6a23['serverUrl']||'';this[_0x9427('0x6')]=_0x1a6a23[_0x9427('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0xb46f=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x5e2a54,_0x424ad7){var _0x1c8b6b=function(_0x718a9b){while(--_0x718a9b){_0x5e2a54['push'](_0x5e2a54['shift']());}};_0x1c8b6b(++_0x424ad7);}(_0xb46f,0xb6));var _0xfb46=function(_0x200d3c,_0x75ab80){_0x200d3c=_0x200d3c-0x0;var _0x4e8004=_0xb46f[_0x200d3c];return _0x4e8004;};'use strict';function FreshsalesAccount(_0xe9857b){this['id']=_0xe9857b['id']||0x0;this[_0xfb46('0x0')]=_0xe9857b['name']||'';this[_0xfb46('0x1')]=_0xe9857b[_0xfb46('0x1')]||'';this[_0xfb46('0x2')]=_0xe9857b[_0xfb46('0x3')]||'';this[_0xfb46('0x4')]=_0xe9857b['remoteUri']||'';this[_0xfb46('0x5')]=_0xe9857b['serverUrl']||'';this[_0xfb46('0x6')]=_0xe9857b[_0xfb46('0x6')]||{};}module[_0xfb46('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index e3807b6..78a0414 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 _0x693e=['queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','connectedlinenum','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','exports','type','inbound','uniqueid','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count'];(function(_0x20349a,_0x2b7ba7){var _0x41d458=function(_0x108ca2){while(--_0x108ca2){_0x20349a['push'](_0x20349a['shift']());}};_0x41d458(++_0x2b7ba7);}(_0x693e,0x177));var _0xe693=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x693e[_0x42cae2];return _0x5f256f;};'use strict';function QueueReport(){this[_0xe693('0x0')]=_0xe693('0x1');this[_0xe693('0x2')]='';this['calleridnum']='';this[_0xe693('0x3')]='';this[_0xe693('0x4')]='';this[_0xe693('0x5')]=null;this[_0xe693('0x6')]=null;this[_0xe693('0x7')]=0x1;this[_0xe693('0x8')]=0x1;this[_0xe693('0x9')]=![];this[_0xe693('0xa')]=null;this[_0xe693('0xb')]=![];this[_0xe693('0xc')]=null;this['queuecallerexit']=![];this[_0xe693('0xd')]=null;this[_0xe693('0xe')]=0x1;this['channel']='';this[_0xe693('0xf')]='';this['connectedlinename']='';this['accountcode']='';this['context']='';this[_0xe693('0x10')]='';this[_0xe693('0x11')]='';this[_0xe693('0x12')]=0x0;this[_0xe693('0x13')]=![];this[_0xe693('0x14')]='';this[_0xe693('0x15')]=_0xe693('0x16');this['mohtime']=0x0;this['variables']={};}module[_0xe693('0x17')]=QueueReport; \ No newline at end of file +var _0x2f40=['queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','channel','connectedlinename','accountcode','context','exten','holdtime','assigned','lastAssignedTo','motionChannel','voice','mohtime','variables','type','inbound','uniqueid','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','count'];(function(_0x20eacd,_0x2394e2){var _0x57942a=function(_0xd86eda){while(--_0xd86eda){_0x20eacd['push'](_0x20eacd['shift']());}};_0x57942a(++_0x2394e2);}(_0x2f40,0xb4));var _0x02f4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x2f40[_0x3bf83f];return _0x22c4a9;};'use strict';function QueueReport(){this[_0x02f4('0x0')]=_0x02f4('0x1');this[_0x02f4('0x2')]='';this[_0x02f4('0x3')]='';this[_0x02f4('0x4')]='';this['queue']='';this[_0x02f4('0x5')]=null;this[_0x02f4('0x6')]=null;this[_0x02f4('0x7')]=0x1;this[_0x02f4('0x8')]=0x1;this[_0x02f4('0x9')]=![];this[_0x02f4('0xa')]=null;this[_0x02f4('0xb')]=![];this[_0x02f4('0xc')]=null;this[_0x02f4('0xd')]=![];this['queuecallerexitAt']=null;this[_0x02f4('0xe')]=0x1;this[_0x02f4('0xf')]='';this['connectedlinenum']='';this[_0x02f4('0x10')]='';this[_0x02f4('0x11')]='';this[_0x02f4('0x12')]='';this[_0x02f4('0x13')]='';this['priority']='';this[_0x02f4('0x14')]=0x0;this[_0x02f4('0x15')]=![];this[_0x02f4('0x16')]='';this[_0x02f4('0x17')]=_0x02f4('0x18');this[_0x02f4('0x19')]=0x0;this[_0x02f4('0x1a')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index bde3a98..764cb56 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 _0x228b=['securityToken','type','serverUrl','Configurations','name','username','remoteUri','password','clientId'];(function(_0x5b26be,_0x24893b){var _0x4c02c9=function(_0x17dac2){while(--_0x17dac2){_0x5b26be['push'](_0x5b26be['shift']());}};_0x4c02c9(++_0x24893b);}(_0x228b,0x1f3));var _0xb228=function(_0x2d282c,_0xc841ee){_0x2d282c=_0x2d282c-0x0;var _0x5c58c4=_0x228b[_0x2d282c];return _0x5c58c4;};'use strict';function SalesforceAccount(_0x3778a9){this['id']=_0x3778a9['id']||0x0;this[_0xb228('0x0')]=_0x3778a9['name']||'';this[_0xb228('0x1')]=_0x3778a9[_0xb228('0x1')]||'';this[_0xb228('0x2')]=_0x3778a9['remoteUri']||'';this[_0xb228('0x3')]=_0x3778a9[_0xb228('0x3')]||'';this[_0xb228('0x4')]=_0x3778a9['clientId']||'';this['clientSecret']=_0x3778a9['clientSecret']||'';this[_0xb228('0x5')]=_0x3778a9['securityToken']||'';this[_0xb228('0x6')]=_0x3778a9[_0xb228('0x6')]||'integrationTab';this[_0xb228('0x7')]=_0x3778a9[_0xb228('0x7')]||'';this['Configurations']=_0x3778a9[_0xb228('0x8')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0x618a=['username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x618a,0xe3));var _0xa618=function(_0x55c76f,_0x13b7f4){_0x55c76f=_0x55c76f-0x0;var _0x1571ff=_0x618a[_0x55c76f];return _0x1571ff;};'use strict';function SalesforceAccount(_0x2a61f2){this['id']=_0x2a61f2['id']||0x0;this[_0xa618('0x0')]=_0x2a61f2[_0xa618('0x0')]||'';this[_0xa618('0x1')]=_0x2a61f2[_0xa618('0x1')]||'';this['remoteUri']=_0x2a61f2[_0xa618('0x2')]||'';this[_0xa618('0x3')]=_0x2a61f2[_0xa618('0x3')]||'';this['clientId']=_0x2a61f2[_0xa618('0x4')]||'';this[_0xa618('0x5')]=_0x2a61f2[_0xa618('0x5')]||'';this[_0xa618('0x6')]=_0x2a61f2[_0xa618('0x6')]||'';this[_0xa618('0x7')]=_0x2a61f2[_0xa618('0x7')]||_0xa618('0x8');this[_0xa618('0x9')]=_0x2a61f2[_0xa618('0x9')]||'';this['Configurations']=_0x2a61f2[_0xa618('0xa')]||{};}module[_0xa618('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 1d20178..310b05b 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 _0xafea=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x2c976f,_0x4bd2c4){var _0x1a1227=function(_0x24597e){while(--_0x24597e){_0x2c976f['push'](_0x2c976f['shift']());}};_0x1a1227(++_0x4bd2c4);}(_0xafea,0xdf));var _0xaafe=function(_0x312199,_0x64daf0){_0x312199=_0x312199-0x0;var _0x29a8af=_0xafea[_0x312199];return _0x29a8af;};'use strict';function ServicenowAccount(_0x3fcb46){this['id']=_0x3fcb46['id']||0x0;this['name']=_0x3fcb46[_0xaafe('0x0')]||'';this[_0xaafe('0x1')]=_0x3fcb46[_0xaafe('0x1')]||'';this[_0xaafe('0x2')]=_0x3fcb46[_0xaafe('0x2')]||'';this[_0xaafe('0x3')]=_0x3fcb46[_0xaafe('0x3')]||'';this[_0xaafe('0x4')]=_0x3fcb46[_0xaafe('0x4')]||'';this[_0xaafe('0x5')]=_0x3fcb46['Configurations']||{};}module[_0xaafe('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x2d4c=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0xeb90e8,_0x63f479){var _0x5f103b=function(_0x49c75f){while(--_0x49c75f){_0xeb90e8['push'](_0xeb90e8['shift']());}};_0x5f103b(++_0x63f479);}(_0x2d4c,0x11d));var _0xc2d4=function(_0x4ed19f,_0x433525){_0x4ed19f=_0x4ed19f-0x0;var _0x2168b8=_0x2d4c[_0x4ed19f];return _0x2168b8;};'use strict';function ServicenowAccount(_0xff8867){this['id']=_0xff8867['id']||0x0;this[_0xc2d4('0x0')]=_0xff8867['name']||'';this[_0xc2d4('0x1')]=_0xff8867[_0xc2d4('0x1')]||'';this[_0xc2d4('0x2')]=_0xff8867[_0xc2d4('0x2')]||'';this['remoteUri']=_0xff8867[_0xc2d4('0x3')]||'';this[_0xc2d4('0x4')]=_0xff8867[_0xc2d4('0x4')]||'';this[_0xc2d4('0x5')]=_0xff8867[_0xc2d4('0x5')]||{};}module[_0xc2d4('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 fe25ee5..581b955 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 _0x38ed=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x43b08,_0x15f967){var _0x5e05f4=function(_0x4bb0cb){while(--_0x4bb0cb){_0x43b08['push'](_0x43b08['shift']());}};_0x5e05f4(++_0x15f967);}(_0x38ed,0x101));var _0xd38e=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x38ed[_0xdea41a];return _0x15d0d8;};'use strict';function SugarcrmAccount(_0x112d19){this['id']=_0x112d19['id']||0x0;this['name']=_0x112d19[_0xd38e('0x0')]||'';this[_0xd38e('0x1')]=_0x112d19[_0xd38e('0x1')]||'';this[_0xd38e('0x2')]=_0x112d19[_0xd38e('0x2')]||'';this['remoteUri']=_0x112d19[_0xd38e('0x3')]||'';this[_0xd38e('0x4')]=_0x112d19[_0xd38e('0x4')]||'';this['Configurations']=_0x112d19[_0xd38e('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x3d51=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x42ed40,_0x45e2e3){var _0x4fe80e=function(_0x2b7135){while(--_0x2b7135){_0x42ed40['push'](_0x42ed40['shift']());}};_0x4fe80e(++_0x45e2e3);}(_0x3d51,0x1a9));var _0x13d5=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x3d51[_0x1facfa];return _0x9ec701;};'use strict';function SugarcrmAccount(_0x2fe583){this['id']=_0x2fe583['id']||0x0;this[_0x13d5('0x0')]=_0x2fe583[_0x13d5('0x0')]||'';this['username']=_0x2fe583[_0x13d5('0x1')]||'';this['password']=_0x2fe583[_0x13d5('0x2')]||'';this[_0x13d5('0x3')]=_0x2fe583[_0x13d5('0x3')]||'';this[_0x13d5('0x4')]=_0x2fe583['serverUrl']||'';this[_0x13d5('0x5')]=_0x2fe583[_0x13d5('0x5')]||{};}module[_0x13d5('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 5da51e7..c8877d8 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 _0x38f5=['unknown','stateTime','address','exports','name','accountcode','state'];(function(_0x5af9ac,_0x41ce70){var _0x23a7af=function(_0x50867c){while(--_0x50867c){_0x5af9ac['push'](_0x5af9ac['shift']());}};_0x23a7af(++_0x41ce70);}(_0x38f5,0x89));var _0x538f=function(_0x1ab387,_0x5294a0){_0x1ab387=_0x1ab387-0x0;var _0x35b122=_0x38f5[_0x1ab387];return _0x35b122;};'use strict';function Telephone(_0x18a82a){this['id']=_0x18a82a['id']||0x0;this[_0x538f('0x0')]=_0x18a82a[_0x538f('0x0')]||'';this['accountcode']=_0x18a82a[_0x538f('0x1')]||'';this[_0x538f('0x2')]=_0x538f('0x3');this[_0x538f('0x4')]=0x0;this['status']='unknown';this[_0x538f('0x5')]='';}module[_0x538f('0x6')]=Telephone; \ No newline at end of file +var _0xe900=['accountcode','unknown','stateTime','address','exports','name'];(function(_0xac4755,_0x306ae0){var _0x5e6164=function(_0x1fe009){while(--_0x1fe009){_0xac4755['push'](_0xac4755['shift']());}};_0x5e6164(++_0x306ae0);}(_0xe900,0x89));var _0x0e90=function(_0x3d4d33,_0x2313da){_0x3d4d33=_0x3d4d33-0x0;var _0x440d8e=_0xe900[_0x3d4d33];return _0x440d8e;};'use strict';function Telephone(_0x55c5a0){this['id']=_0x55c5a0['id']||0x0;this['name']=_0x55c5a0[_0x0e90('0x0')]||'';this[_0x0e90('0x1')]=_0x55c5a0[_0x0e90('0x1')]||'';this['state']=_0x0e90('0x2');this[_0x0e90('0x3')]=0x0;this['status']=_0x0e90('0x2');this[_0x0e90('0x4')]='';}module[_0x0e90('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index f023c2c..8c44d33 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x795a94,_0x586aff){var _0x33b767=function(_0x7c0cbb){while(--_0x7c0cbb){_0x795a94['push'](_0x795a94['shift']());}};_0x33b767(++_0x586aff);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x35021d,_0x727d0e){var _0x3c88e8=function(_0xdc1728){while(--_0xdc1728){_0x35021d['push'](_0x35021d['shift']());}};_0x3c88e8(++_0x727d0e);}(_0xb10b,0x12a));var _0xbb10=function(_0x213295,_0x465d81){_0x213295=_0x213295-0x0;var _0x43a797=_0xb10b[_0x213295];return _0x43a797;};'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 diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 9609621..402360b 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 _0xbaf0=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x489b87,_0xd51c93){var _0x1823b6=function(_0x451c70){while(--_0x451c70){_0x489b87['push'](_0x489b87['shift']());}};_0x1823b6(++_0xd51c93);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';function Trigger(_0x61caa9){this['id']=_0x61caa9['id']||0x0;this[_0x0baf('0x0')]=_0x61caa9[_0x0baf('0x0')]||'';this[_0x0baf('0x1')]=_0x61caa9[_0x0baf('0x1')]||_0x0baf('0x2');this[_0x0baf('0x3')]=_0x61caa9['status']||![];this[_0x0baf('0x4')]=_0x61caa9[_0x0baf('0x4')]||[];this[_0x0baf('0x5')]=_0x61caa9[_0x0baf('0x5')]||[];this[_0x0baf('0x6')]=_0x61caa9[_0x0baf('0x6')]||[];}module[_0x0baf('0x7')]=Trigger; \ No newline at end of file +var _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x11ef75,_0x4e12d8){var _0x2c2672=function(_0x4ba9c7){while(--_0x4ba9c7){_0x11ef75['push'](_0x11ef75['shift']());}};_0x2c2672(++_0x4e12d8);}(_0x2032,0xd9));var _0x2203=function(_0x1264c0,_0x1c0a57){_0x1264c0=_0x1264c0-0x0;var _0x545dae=_0x2032[_0x1264c0];return _0x545dae;};'use strict';function Trigger(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['channel']||_0x2203('0x2');this[_0x2203('0x3')]=_0x4d6c97['status']||![];this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||[];this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||[];this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||[];}module[_0x2203('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 971e4b2..af66bb9 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 _0xdf0e=['exports','active','name','state','unknown','stateTime','status','registry','split','host','port','domain','domainport','refresh','stateRegistry','address','defaultuser'];(function(_0x2ceedb,_0x3d4af3){var _0x1eef5c=function(_0xee38c1){while(--_0xee38c1){_0x2ceedb['push'](_0x2ceedb['shift']());}};_0x1eef5c(++_0x3d4af3);}(_0xdf0e,0x78));var _0xedf0=function(_0x146eed,_0x547c97){_0x146eed=_0x146eed-0x0;var _0x17cdc4=_0xdf0e[_0x146eed];return _0x17cdc4;};'use strict';function Trunk(_0x4f1ffa){this['id']=_0x4f1ffa['id']||0x0;this[_0xedf0('0x0')]=_0x4f1ffa[_0xedf0('0x0')]||![];this[_0xedf0('0x1')]=_0x4f1ffa['name']||'';this[_0xedf0('0x2')]=_0xedf0('0x3');this[_0xedf0('0x4')]=0x0;this[_0xedf0('0x5')]=_0xedf0('0x3');this[_0xedf0('0x6')]=_0x4f1ffa[_0xedf0('0x6')]&&_0x4f1ffa[_0xedf0('0x6')]['indexOf'](':')?_0x4f1ffa[_0xedf0('0x6')][_0xedf0('0x7')](':')[0x0]:'';this[_0xedf0('0x8')]='';this[_0xedf0('0x9')]='';this[_0xedf0('0xa')]='';this[_0xedf0('0xb')]='';this[_0xedf0('0xc')]='';this[_0xedf0('0xd')]=_0xedf0('0x3');this['registrationtime']='';this[_0xedf0('0xe')]='';this['defaultuser']=_0x4f1ffa[_0xedf0('0xf')]||'';}module[_0xedf0('0x10')]=Trunk; \ No newline at end of file +var _0x0804=['registrationtime','address','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','split','host','port','domain','domainport','refresh'];(function(_0x3d26c8,_0x1a9383){var _0x39efcc=function(_0x3100f8){while(--_0x3100f8){_0x3d26c8['push'](_0x3d26c8['shift']());}};_0x39efcc(++_0x1a9383);}(_0x0804,0x9d));var _0x4080=function(_0x2d61b2,_0x142947){_0x2d61b2=_0x2d61b2-0x0;var _0x12df89=_0x0804[_0x2d61b2];return _0x12df89;};'use strict';function Trunk(_0x305f13){this['id']=_0x305f13['id']||0x0;this[_0x4080('0x0')]=_0x305f13[_0x4080('0x0')]||![];this['name']=_0x305f13[_0x4080('0x1')]||'';this[_0x4080('0x2')]=_0x4080('0x3');this[_0x4080('0x4')]=0x0;this[_0x4080('0x5')]=_0x4080('0x3');this['registry']=_0x305f13['registry']&&_0x305f13['registry']['indexOf'](':')?_0x305f13[_0x4080('0x6')][_0x4080('0x7')](':')[0x0]:'';this[_0x4080('0x8')]='';this[_0x4080('0x9')]='';this[_0x4080('0xa')]='';this[_0x4080('0xb')]='';this[_0x4080('0xc')]='';this['stateRegistry']=_0x4080('0x3');this[_0x4080('0xd')]='';this[_0x4080('0xe')]='';this[_0x4080('0xf')]=_0x305f13[_0x4080('0xf')]||'';}module[_0x4080('0x10')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index b782159..9386bef 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 _0x4a90=['exports','exten','recordingFormat','mandatoryDisposition'];(function(_0xd6c010,_0x5355e6){var _0x15893b=function(_0x1b0a5a){while(--_0x1b0a5a){_0xd6c010['push'](_0xd6c010['shift']());}};_0x15893b(++_0x5355e6);}(_0x4a90,0x139));var _0x04a9=function(_0x465ba5,_0xe2ae2b){_0x465ba5=_0x465ba5-0x0;var _0x214e02=_0x4a90[_0x465ba5];return _0x214e02;};'use strict';function voiceExtension(_0x49d2df){this['id']=_0x49d2df['id']||0x0;this[_0x04a9('0x0')]=_0x49d2df[_0x04a9('0x0')]||'';this[_0x04a9('0x1')]=_0x49d2df['recordingFormat']||'none';this[_0x04a9('0x2')]=_0x49d2df[_0x04a9('0x2')]||![];}module[_0x04a9('0x3')]=voiceExtension; \ No newline at end of file +var _0x5731=['none','mandatoryDisposition','exten','recordingFormat'];(function(_0x1c7564,_0x1fc6de){var _0xd911e5=function(_0x5afece){while(--_0x5afece){_0x1c7564['push'](_0x1c7564['shift']());}};_0xd911e5(++_0x1fc6de);}(_0x5731,0xce));var _0x1573=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5731[_0x2641f9];return _0x585741;};'use strict';function voiceExtension(_0xa57c9e){this['id']=_0xa57c9e['id']||0x0;this[_0x1573('0x0')]=_0xa57c9e[_0x1573('0x0')]||'';this['recordingFormat']=_0xa57c9e[_0x1573('0x1')]||_0x1573('0x2');this['mandatoryDisposition']=_0xa57c9e[_0x1573('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 32726b6..60ed1cc 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 _0xec90=['exports','unknown','inuse','busy','unavailable','ringing','ringinuse','onhold','wav49','rrmemory','roundrobin','name','monitor_format','type','talking','total','answered','sumBillable','available','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','mandatoryDisposition','mandatoryDispositionPause'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xec90,0x76));var _0x0ec9=function(_0x2cc86e,_0x5e9be8){_0x2cc86e=_0x2cc86e-0x0;var _0x3c43e1=_0xec90[_0x2cc86e];return _0x3c43e1;};'use strict';var statusDesc=[_0x0ec9('0x0'),'not_inuse',_0x0ec9('0x1'),_0x0ec9('0x2'),'invalid',_0x0ec9('0x3'),_0x0ec9('0x4'),_0x0ec9('0x5'),_0x0ec9('0x6')];var monitorFormat={'wav':'wav','wav49':_0x0ec9('0x7'),'gsm':'gsm'};var strategy={'rrmemory':_0x0ec9('0x8'),'roundrobin':_0x0ec9('0x9')};function VoiceQueue(_0x36e4a8){this['id']=_0x36e4a8['id']||0x0;this['name']=_0x36e4a8[_0x0ec9('0xa')]||'';this[_0x0ec9('0xb')]=_0x36e4a8[_0x0ec9('0xb')]||'';this['type']=_0x36e4a8[_0x0ec9('0xc')]||'inbound';this['waiting']=0x0;this[_0x0ec9('0xd')]=0x0;this[_0x0ec9('0xe')]=0x0;this[_0x0ec9('0xf')]=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this[_0x0ec9('0x10')]=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this['loggedIn']=0x0;this[_0x0ec9('0x11')]=0x0;this['acw']=_0x36e4a8['acw']||![];this['acwTimeout']=_0x36e4a8[_0x0ec9('0x12')]||0xa;this[_0x0ec9('0x13')]=_0x36e4a8['autopause']||'no';this[_0x0ec9('0x14')]=!![];this[_0x0ec9('0x15')]='';this['originated']=0x0;this[_0x0ec9('0x16')]=0x0;this[_0x0ec9('0x17')]=_0x36e4a8['dialTimezone']||null;this[_0x0ec9('0x18')]=_0x36e4a8[_0x0ec9('0x18')]?_0x36e4a8[_0x0ec9('0x18')]:null;this[_0x0ec9('0x19')]=_0x36e4a8[_0x0ec9('0x19')];this[_0x0ec9('0x1a')]=_0x36e4a8[_0x0ec9('0x1a')]||_0x0ec9('0x1b');this[_0x0ec9('0x1c')]=_0x36e4a8[_0x0ec9('0x1c')]||0x0;this['dialLimitQueue']=_0x36e4a8['dialLimitQueue']||0x0;this[_0x0ec9('0x1d')]=_0x36e4a8[_0x0ec9('0x1d')]||0x1;this[_0x0ec9('0x1e')]=_0x36e4a8[_0x0ec9('0x1e')]||_0x0ec9('0x1f');this[_0x0ec9('0x20')]=_0x36e4a8[_0x0ec9('0x20')]||0.03;this[_0x0ec9('0x21')]=_0x36e4a8['dialPredictiveInterval']||0x258;this[_0x0ec9('0x22')]=_0x36e4a8[_0x0ec9('0x22')]||_0x0ec9('0x23');this[_0x0ec9('0x24')]=_0x36e4a8[_0x0ec9('0x24')]||_0x0ec9('0x23');this[_0x0ec9('0x25')]=_0x36e4a8['dialOriginateTimeout']||0x1e;this[_0x0ec9('0x26')]=_0x36e4a8[_0x0ec9('0x26')]||_0x0ec9('0x27');this[_0x0ec9('0x28')]=_0x36e4a8['dialQueueTimeout']||0x3;this['dialQueueProject']=_0x36e4a8[_0x0ec9('0x29')]||undefined;this['dialCongestionMaxRetry']=_0x36e4a8[_0x0ec9('0x2a')]||0x3;this['dialCongestionRetryFrequency']=_0x36e4a8['dialCongestionRetryFrequency']||0x96;this['dialBusyMaxRetry']=_0x36e4a8[_0x0ec9('0x2b')]||0x3;this['dialBusyRetryFrequency']=_0x36e4a8[_0x0ec9('0x2c')]||0x96;this[_0x0ec9('0x2d')]=_0x36e4a8[_0x0ec9('0x2d')]||0x3;this[_0x0ec9('0x2e')]=_0x36e4a8['dialNoAnswerRetryFrequency']||0x96;this[_0x0ec9('0x2f')]=_0x36e4a8[_0x0ec9('0x2f')]||0x3;this[_0x0ec9('0x30')]=_0x36e4a8['dialNoSuchNumberRetryFrequency']||0x96;this[_0x0ec9('0x31')]=_0x36e4a8[_0x0ec9('0x31')]||0x3;this['dialDropRetryFrequency']=_0x36e4a8[_0x0ec9('0x32')]||0x96;this[_0x0ec9('0x33')]=_0x36e4a8[_0x0ec9('0x33')]||0x3;this[_0x0ec9('0x34')]=_0x36e4a8[_0x0ec9('0x34')]||0x96;this[_0x0ec9('0x35')]=_0x36e4a8[_0x0ec9('0x35')]||0x3;this[_0x0ec9('0x36')]=_0x36e4a8['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x36e4a8[_0x0ec9('0x37')]||0x3;this[_0x0ec9('0x38')]=_0x36e4a8['dialAgentRejectRetryFrequency']||0x96;this[_0x0ec9('0x39')]=_0x36e4a8[_0x0ec9('0x39')]||0x3;this['dialGlobalMaxRetry']=_0x36e4a8['dialGlobalMaxRetry']||0x4;this[_0x0ec9('0x3a')]=_0x36e4a8[_0x0ec9('0x3a')]?_0x36e4a8[_0x0ec9('0x3a')]:undefined;this[_0x0ec9('0x3b')]=_0x36e4a8[_0x0ec9('0x3b')]?_0x36e4a8[_0x0ec9('0x3b')]:undefined;this['dialPrefix']=_0x36e4a8[_0x0ec9('0x3c')]||undefined;this[_0x0ec9('0x3d')]=_0x36e4a8[_0x0ec9('0x3d')]?_0x36e4a8[_0x0ec9('0x3d')]:undefined;this[_0x0ec9('0x3e')]=_0x36e4a8[_0x0ec9('0x3e')]||_0x0ec9('0x3f');this[_0x0ec9('0x40')]=_0x36e4a8[_0x0ec9('0x40')]||undefined;this['dialCutDigit']=_0x36e4a8[_0x0ec9('0x41')]||undefined;this[_0x0ec9('0x42')]=strategy[_0x36e4a8['strategy']]||'rrmemory';this[_0x0ec9('0x43')]=!![];this['dialAMDActive']=_0x36e4a8['dialAMDActive']||![];this[_0x0ec9('0x44')]=_0x36e4a8['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x36e4a8['dialAMDGreeting'];this[_0x0ec9('0x45')]=_0x36e4a8['dialAMDAfterGreetingSilence'];this[_0x0ec9('0x46')]=_0x36e4a8[_0x0ec9('0x46')];this[_0x0ec9('0x47')]=_0x36e4a8['dialAMDMinWordLength'];this[_0x0ec9('0x48')]=_0x36e4a8[_0x0ec9('0x48')];this[_0x0ec9('0x49')]=_0x36e4a8[_0x0ec9('0x49')];this['dialAMDSilenceThreshold']=_0x36e4a8[_0x0ec9('0x4a')];this[_0x0ec9('0x4b')]=_0x36e4a8['dialAMDMaximumWordLength'];this[_0x0ec9('0x4c')]=0x0;this['pTalking']=0x0;this[_0x0ec9('0x4d')]=_0x36e4a8[_0x0ec9('0x4d')];this['outboundAnswerCallsDay']=0x0;this[_0x0ec9('0x4e')]=0x0;this[_0x0ec9('0x4f')]=0x0;this[_0x0ec9('0x50')]=0x0;this['outboundCongestionCallsDay']=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x0ec9('0x51')]=0x0;this[_0x0ec9('0x52')]=0x0;this[_0x0ec9('0x53')]=0x0;this[_0x0ec9('0x54')]=0x0;this[_0x0ec9('0x55')]=0x0;this[_0x0ec9('0x56')]=0x0;this[_0x0ec9('0x57')]=0x0;this[_0x0ec9('0x58')]=0x0;this[_0x0ec9('0x59')]=undefined;this[_0x0ec9('0x5a')]=undefined;this[_0x0ec9('0x5b')]=undefined;this[_0x0ec9('0x5c')]=1.05;this[_0x0ec9('0x5d')]=0x0;this[_0x0ec9('0x5e')]=0x0;this[_0x0ec9('0x5f')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x0ec9('0x60')]=0x0;this[_0x0ec9('0x61')]=0x0;this[_0x0ec9('0x62')]=0x0;this[_0x0ec9('0x63')]=0x0;this[_0x0ec9('0x64')]=_0x36e4a8['dialPredictiveIntervalMaxThreshold']||0x14;this['predictiveIntervalMinThreshold']=_0x36e4a8[_0x0ec9('0x65')]||0xa;this[_0x0ec9('0x66')]=0x0;this[_0x0ec9('0x67')]=0x0;this[_0x0ec9('0x68')]=0x1;this[_0x0ec9('0x69')]=0x0;this['erlangCallToSecond']=0x0;this[_0x0ec9('0x6a')]=0x0;this[_0x0ec9('0x6b')]=0x0;this[_0x0ec9('0x6c')]=_0x36e4a8[_0x0ec9('0x6c')]||0x1e;this[_0x0ec9('0x6d')]=_0x36e4a8[_0x0ec9('0x6d')]||![];this[_0x0ec9('0x6e')]=!!_0x36e4a8[_0x0ec9('0x6e')]||![];this[_0x0ec9('0x6f')]=!!_0x36e4a8[_0x0ec9('0x6f')]||![];this[_0x0ec9('0x70')]=_0x36e4a8['dialQueueProject2']||undefined;this[_0x0ec9('0x71')]=_0x36e4a8[_0x0ec9('0x71')]||![];this['dialAgiAfterHangupAgent']=_0x36e4a8['dialAgiAfterHangupAgent']||![];this[_0x0ec9('0xb')]=monitorFormat[_0x36e4a8[_0x0ec9('0xb')]]?monitorFormat[_0x36e4a8[_0x0ec9('0xb')]]:undefined;this[_0x0ec9('0x72')]=_0x36e4a8[_0x0ec9('0x72')]||![];this[_0x0ec9('0x73')]=_0x36e4a8['mandatoryDispositionPause']?_0x36e4a8['mandatoryDispositionPause']:undefined;}module[_0x0ec9('0x74')]=VoiceQueue; \ No newline at end of file +var _0x8a97=['dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','onhold','wav','gsm','monitor_format','type','inbound','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage'];(function(_0x213d99,_0x597fcc){var _0x3741e8=function(_0x3caca2){while(--_0x3caca2){_0x213d99['push'](_0x213d99['shift']());}};_0x3741e8(++_0x597fcc);}(_0x8a97,0x1b5));var _0x78a9=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x8a97[_0x297fd3];return _0x2af381;};'use strict';var statusDesc=[_0x78a9('0x0'),_0x78a9('0x1'),_0x78a9('0x2'),_0x78a9('0x3'),_0x78a9('0x4'),_0x78a9('0x5'),_0x78a9('0x6'),'ringinuse',_0x78a9('0x7')];var monitorFormat={'wav':_0x78a9('0x8'),'wav49':'wav49','gsm':_0x78a9('0x9')};var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};function VoiceQueue(_0x5e55ed){this['id']=_0x5e55ed['id']||0x0;this['name']=_0x5e55ed['name']||'';this[_0x78a9('0xa')]=_0x5e55ed[_0x78a9('0xa')]||'';this[_0x78a9('0xb')]=_0x5e55ed[_0x78a9('0xb')]||_0x78a9('0xc');this['waiting']=0x0;this[_0x78a9('0xd')]=0x0;this[_0x78a9('0xe')]=0x0;this[_0x78a9('0xf')]=0x0;this[_0x78a9('0x10')]=0x0;this[_0x78a9('0x11')]=0x0;this[_0x78a9('0x12')]=0x0;this[_0x78a9('0x13')]=0x0;this[_0x78a9('0x14')]=0x0;this[_0x78a9('0x15')]=0x0;this[_0x78a9('0x16')]=0x0;this[_0x78a9('0x17')]=_0x5e55ed[_0x78a9('0x17')]||![];this[_0x78a9('0x18')]=_0x5e55ed['acwTimeout']||0xa;this[_0x78a9('0x19')]=_0x5e55ed[_0x78a9('0x19')]||'no';this['sendMessageOneNotActive']=!![];this[_0x78a9('0x1a')]='';this['originated']=0x0;this[_0x78a9('0x1b')]=0x0;this[_0x78a9('0x1c')]=_0x5e55ed[_0x78a9('0x1c')]||null;this[_0x78a9('0x1d')]=_0x5e55ed[_0x78a9('0x1d')]?_0x5e55ed[_0x78a9('0x1d')]:null;this[_0x78a9('0x1e')]=_0x5e55ed[_0x78a9('0x1e')];this['dialMethod']=_0x5e55ed[_0x78a9('0x1f')]||_0x78a9('0x20');this['dialLimitChannel']=_0x5e55ed[_0x78a9('0x21')]||0x0;this[_0x78a9('0x22')]=_0x5e55ed[_0x78a9('0x22')]||0x0;this[_0x78a9('0x23')]=_0x5e55ed[_0x78a9('0x23')]||0x1;this[_0x78a9('0x24')]=_0x5e55ed[_0x78a9('0x24')]||_0x78a9('0x25');this[_0x78a9('0x26')]=_0x5e55ed[_0x78a9('0x26')]||0.03;this[_0x78a9('0x27')]=_0x5e55ed[_0x78a9('0x27')]||0x258;this[_0x78a9('0x28')]=_0x5e55ed[_0x78a9('0x28')]||'anonymous';this[_0x78a9('0x29')]=_0x5e55ed[_0x78a9('0x29')]||'anonymous';this['dialOriginateTimeout']=_0x5e55ed[_0x78a9('0x2a')]||0x1e;this[_0x78a9('0x2b')]=_0x5e55ed[_0x78a9('0x2b')]||_0x78a9('0x2c');this[_0x78a9('0x2d')]=_0x5e55ed['dialQueueTimeout']||0x3;this[_0x78a9('0x2e')]=_0x5e55ed[_0x78a9('0x2e')]||undefined;this[_0x78a9('0x2f')]=_0x5e55ed['dialCongestionMaxRetry']||0x3;this[_0x78a9('0x30')]=_0x5e55ed['dialCongestionRetryFrequency']||0x96;this[_0x78a9('0x31')]=_0x5e55ed['dialBusyMaxRetry']||0x3;this[_0x78a9('0x32')]=_0x5e55ed['dialBusyRetryFrequency']||0x96;this[_0x78a9('0x33')]=_0x5e55ed[_0x78a9('0x33')]||0x3;this[_0x78a9('0x34')]=_0x5e55ed['dialNoAnswerRetryFrequency']||0x96;this['dialNoSuchNumberMaxRetry']=_0x5e55ed['dialNoSuchNumberMaxRetry']||0x3;this[_0x78a9('0x35')]=_0x5e55ed['dialNoSuchNumberRetryFrequency']||0x96;this[_0x78a9('0x36')]=_0x5e55ed[_0x78a9('0x36')]||0x3;this[_0x78a9('0x37')]=_0x5e55ed['dialDropRetryFrequency']||0x96;this[_0x78a9('0x38')]=_0x5e55ed['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x5e55ed[_0x78a9('0x39')]||0x96;this[_0x78a9('0x3a')]=_0x5e55ed[_0x78a9('0x3a')]||0x3;this[_0x78a9('0x3b')]=_0x5e55ed[_0x78a9('0x3b')]||0x96;this[_0x78a9('0x3c')]=_0x5e55ed['dialAgentRejectMaxRetry']||0x3;this[_0x78a9('0x3d')]=_0x5e55ed[_0x78a9('0x3d')]||0x96;this['callAdditionalPhoneAfterMin']=_0x5e55ed[_0x78a9('0x3e')]||0x3;this[_0x78a9('0x3f')]=_0x5e55ed[_0x78a9('0x3f')]||0x4;this[_0x78a9('0x40')]=_0x5e55ed['Trunk']?_0x5e55ed[_0x78a9('0x40')]:undefined;this['TrunkBackup']=_0x5e55ed['TrunkBackup']?_0x5e55ed[_0x78a9('0x41')]:undefined;this['dialPrefix']=_0x5e55ed['dialPrefix']||undefined;this['Interval']=_0x5e55ed[_0x78a9('0x42')]?_0x5e55ed[_0x78a9('0x42')]:undefined;this[_0x78a9('0x43')]=_0x5e55ed[_0x78a9('0x43')]||_0x78a9('0x44');this[_0x78a9('0x45')]=_0x5e55ed[_0x78a9('0x45')]||undefined;this[_0x78a9('0x46')]=_0x5e55ed['dialCutDigit']||undefined;this['strategy']=strategy[_0x5e55ed['strategy']]||'rrmemory';this['queueStatusComplete']=!![];this[_0x78a9('0x47')]=_0x5e55ed['dialAMDActive']||![];this[_0x78a9('0x48')]=_0x5e55ed[_0x78a9('0x48')];this['dialAMDGreeting']=_0x5e55ed['dialAMDGreeting'];this[_0x78a9('0x49')]=_0x5e55ed[_0x78a9('0x49')];this[_0x78a9('0x4a')]=_0x5e55ed[_0x78a9('0x4a')];this['dialAMDMinWordLength']=_0x5e55ed[_0x78a9('0x4b')];this['dialAMDBetweenWordsSilence']=_0x5e55ed[_0x78a9('0x4c')];this['dialAMDMaximumNumberOfWords']=_0x5e55ed[_0x78a9('0x4d')];this[_0x78a9('0x4e')]=_0x5e55ed[_0x78a9('0x4e')];this['dialAMDMaximumWordLength']=_0x5e55ed['dialAMDMaximumWordLength'];this[_0x78a9('0x4f')]=0x0;this[_0x78a9('0x50')]=0x0;this[_0x78a9('0x51')]=_0x5e55ed[_0x78a9('0x51')];this['outboundAnswerCallsDay']=0x0;this[_0x78a9('0x52')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x78a9('0x53')]=0x0;this[_0x78a9('0x54')]=0x0;this[_0x78a9('0x55')]=0x0;this[_0x78a9('0x56')]=0x0;this[_0x78a9('0x57')]=0x0;this[_0x78a9('0x58')]=0x0;this[_0x78a9('0x59')]=0x0;this[_0x78a9('0x5a')]=0x0;this[_0x78a9('0x5b')]=0x0;this[_0x78a9('0x5c')]=0x0;this[_0x78a9('0x5d')]=0x0;this['startProgressive']=undefined;this[_0x78a9('0x5e')]=undefined;this['handlePredictive']=undefined;this[_0x78a9('0x5f')]=1.05;this[_0x78a9('0x60')]=0x0;this[_0x78a9('0x61')]=0x0;this[_0x78a9('0x62')]=0x0;this[_0x78a9('0x63')]=0x0;this[_0x78a9('0x64')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x78a9('0x65')]=_0x5e55ed[_0x78a9('0x66')]||0x14;this['predictiveIntervalMinThreshold']=_0x5e55ed[_0x78a9('0x66')]||0xa;this[_0x78a9('0x67')]=0x0;this[_0x78a9('0x68')]=0x0;this[_0x78a9('0x69')]=0x1;this[_0x78a9('0x6a')]=0x0;this[_0x78a9('0x6b')]=0x0;this[_0x78a9('0x6c')]=0x0;this[_0x78a9('0x6d')]=0x0;this[_0x78a9('0x6e')]=_0x5e55ed['dialRecallMeTimeout']||0x1e;this[_0x78a9('0x6f')]=_0x5e55ed[_0x78a9('0x6f')]||![];this[_0x78a9('0x70')]=!!_0x5e55ed[_0x78a9('0x70')]||![];this[_0x78a9('0x71')]=!!_0x5e55ed[_0x78a9('0x71')]||![];this[_0x78a9('0x72')]=_0x5e55ed[_0x78a9('0x72')]||undefined;this['dialAgiAfterHangupClient']=_0x5e55ed['dialAgiAfterHangupClient']||![];this[_0x78a9('0x73')]=_0x5e55ed[_0x78a9('0x73')]||![];this[_0x78a9('0xa')]=monitorFormat[_0x5e55ed[_0x78a9('0xa')]]?monitorFormat[_0x5e55ed[_0x78a9('0xa')]]:undefined;this[_0x78a9('0x74')]=_0x5e55ed[_0x78a9('0x74')]||![];this[_0x78a9('0x75')]=_0x5e55ed['mandatoryDispositionPause']?_0x5e55ed[_0x78a9('0x75')]:undefined;}module[_0x78a9('0x76')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 5c40c4f..6113a5d 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 _0x35c1=['name','username','accessKey','remoteUri','serverUrl','exports'];(function(_0x2b9aed,_0x27a006){var _0x2eb954=function(_0x1912eb){while(--_0x1912eb){_0x2b9aed['push'](_0x2b9aed['shift']());}};_0x2eb954(++_0x27a006);}(_0x35c1,0x17a));var _0x135c=function(_0x130615,_0x340b88){_0x130615=_0x130615-0x0;var _0x350edb=_0x35c1[_0x130615];return _0x350edb;};'use strict';function VtigerAccount(_0x317722){this['id']=_0x317722['id']||0x0;this[_0x135c('0x0')]=_0x317722['name']||'';this[_0x135c('0x1')]=_0x317722[_0x135c('0x1')]||'';this[_0x135c('0x2')]=_0x317722[_0x135c('0x2')]||'';this['remoteUri']=_0x317722[_0x135c('0x3')]||'';this[_0x135c('0x4')]=_0x317722['serverUrl']||'';this['Configurations']=_0x317722['Configurations']||{};}module[_0x135c('0x5')]=VtigerAccount; \ No newline at end of file +var _0x7d26=['accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x35b306,_0x5255c3){var _0x11f101=function(_0x539f09){while(--_0x539f09){_0x35b306['push'](_0x35b306['shift']());}};_0x11f101(++_0x5255c3);}(_0x7d26,0xcb));var _0x67d2=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x7d26[_0x3bf83f];return _0x22c4a9;};'use strict';function VtigerAccount(_0x3a0d41){this['id']=_0x3a0d41['id']||0x0;this[_0x67d2('0x0')]=_0x3a0d41['name']||'';this['username']=_0x3a0d41['username']||'';this[_0x67d2('0x1')]=_0x3a0d41[_0x67d2('0x1')]||'';this[_0x67d2('0x2')]=_0x3a0d41[_0x67d2('0x2')]||'';this[_0x67d2('0x3')]=_0x3a0d41[_0x67d2('0x3')]||'';this[_0x67d2('0x4')]=_0x3a0d41[_0x67d2('0x4')]||{};}module[_0x67d2('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index dbe9477..84c64ef 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 _0xac25=['type','integrationTab','serverUrl','Configurations','name','username','password','token','remoteUri','authType'];(function(_0x2eaec3,_0x54b34e){var _0x2fa604=function(_0xb0b7bd){while(--_0xb0b7bd){_0x2eaec3['push'](_0x2eaec3['shift']());}};_0x2fa604(++_0x54b34e);}(_0xac25,0x108));var _0x5ac2=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0xac25[_0x494d1f];return _0x457b6e;};'use strict';function ZendeskAccount(_0x1d1494){this['id']=_0x1d1494['id']||0x0;this[_0x5ac2('0x0')]=_0x1d1494[_0x5ac2('0x0')]||'';this[_0x5ac2('0x1')]=_0x1d1494['username']||'';this['password']=_0x1d1494[_0x5ac2('0x2')]||'';this[_0x5ac2('0x3')]=_0x1d1494[_0x5ac2('0x3')]||'';this[_0x5ac2('0x4')]=_0x1d1494[_0x5ac2('0x4')]||'';this['authType']=_0x1d1494[_0x5ac2('0x5')]||'';this[_0x5ac2('0x6')]=_0x1d1494[_0x5ac2('0x6')]||_0x5ac2('0x7');this['serverUrl']=_0x1d1494[_0x5ac2('0x8')]||'';this[_0x5ac2('0x9')]=_0x1d1494['Configurations']||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0xccd7=['username','password','token','remoteUri','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x32a5dc,_0x3d3777){var _0x73ed14=function(_0x186d79){while(--_0x186d79){_0x32a5dc['push'](_0x32a5dc['shift']());}};_0x73ed14(++_0x3d3777);}(_0xccd7,0x6d));var _0x7ccd=function(_0x4b0290,_0x188c34){_0x4b0290=_0x4b0290-0x0;var _0x4bd9f4=_0xccd7[_0x4b0290];return _0x4bd9f4;};'use strict';function ZendeskAccount(_0x318740){this['id']=_0x318740['id']||0x0;this[_0x7ccd('0x0')]=_0x318740['name']||'';this[_0x7ccd('0x1')]=_0x318740[_0x7ccd('0x1')]||'';this[_0x7ccd('0x2')]=_0x318740[_0x7ccd('0x2')]||'';this[_0x7ccd('0x3')]=_0x318740[_0x7ccd('0x3')]||'';this[_0x7ccd('0x4')]=_0x318740[_0x7ccd('0x4')]||'';this['authType']=_0x318740['authType']||'';this[_0x7ccd('0x5')]=_0x318740[_0x7ccd('0x5')]||_0x7ccd('0x6');this[_0x7ccd('0x7')]=_0x318740[_0x7ccd('0x7')]||'';this[_0x7ccd('0x8')]=_0x318740[_0x7ccd('0x8')]||{};}module[_0x7ccd('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index d9c3715..6d2c937 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 _0xbc5f=['serverUrl','code','refreshToken','exports','name','description','host','clientId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc5f,0x1f4));var _0xfbc5=function(_0xaa9863,_0x57239f){_0xaa9863=_0xaa9863-0x0;var _0x4e83a0=_0xbc5f[_0xaa9863];return _0x4e83a0;};'use strict';function ZohoAccount(_0x5e5210){this['id']=_0x5e5210['id']||0x0;this[_0xfbc5('0x0')]=_0x5e5210[_0xfbc5('0x0')]||'';this['description']=_0x5e5210[_0xfbc5('0x1')]||'';this[_0xfbc5('0x2')]=_0x5e5210['host']||'';this['zone']=_0x5e5210['zone']||'';this[_0xfbc5('0x3')]=_0x5e5210[_0xfbc5('0x3')]||'';this['clientSecret']=_0x5e5210['clientSecret']||'';this[_0xfbc5('0x4')]=_0x5e5210[_0xfbc5('0x4')]||'';this['code']=_0x5e5210[_0xfbc5('0x5')]||'';this['refreshToken']=_0x5e5210[_0xfbc5('0x6')]||'';this['Configurations']=_0x5e5210['Configurations']||{};}module[_0xfbc5('0x7')]=ZohoAccount; \ No newline at end of file +var _0x2606=['clientSecret','code','refreshToken','Configurations','exports','name','description','host','zone','clientId'];(function(_0x3b1337,_0x396ce8){var _0x58307a=function(_0x4e5193){while(--_0x4e5193){_0x3b1337['push'](_0x3b1337['shift']());}};_0x58307a(++_0x396ce8);}(_0x2606,0x73));var _0x6260=function(_0x2c3721,_0x4717cb){_0x2c3721=_0x2c3721-0x0;var _0x21ab50=_0x2606[_0x2c3721];return _0x21ab50;};'use strict';function ZohoAccount(_0x217970){this['id']=_0x217970['id']||0x0;this[_0x6260('0x0')]=_0x217970['name']||'';this['description']=_0x217970[_0x6260('0x1')]||'';this['host']=_0x217970[_0x6260('0x2')]||'';this['zone']=_0x217970[_0x6260('0x3')]||'';this[_0x6260('0x4')]=_0x217970[_0x6260('0x4')]||'';this[_0x6260('0x5')]=_0x217970[_0x6260('0x5')]||'';this['serverUrl']=_0x217970['serverUrl']||'';this[_0x6260('0x6')]=_0x217970[_0x6260('0x6')]||'';this['refreshToken']=_0x217970[_0x6260('0x7')]||'';this[_0x6260('0x8')]=_0x217970[_0x6260('0x8')]||{};}module[_0x6260('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 165e6df..5760030 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 _0xd4a2=['type','campaigntype','dialAnswer','membername','format','SIP/%s','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','Agent','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','exports','util','isNil','string','uniqueid','idContact','queue','name'];(function(_0x2e0b3b,_0x26a6e3){var _0x5a667f=function(_0x55c0ed){while(--_0x55c0ed){_0x2e0b3b['push'](_0x2e0b3b['shift']());}};_0x5a667f(++_0x26a6e3);}(_0xd4a2,0x173));var _0x2d4a=function(_0xdc3dcb,_0x50f4fb){_0xdc3dcb=_0xdc3dcb-0x0;var _0x17df79=_0xd4a2[_0xdc3dcb];return _0x17df79;};'use strict';var util=require(_0x2d4a('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0xfba415,_0x576ffe,_0x2a8a71){var _0x57c5ca='';if(!_[_0x2d4a('0x1')](_0x576ffe)&&'string'===typeof _0x576ffe){_0x57c5ca+=_0x576ffe;}if(!_[_0x2d4a('0x1')](_0x2a8a71)&&_0x2d4a('0x2')===typeof _0x2a8a71){_0x57c5ca+='\x20'+_0x2a8a71;}if(_0x57c5ca!==''){return _0x57c5ca;}return _0xfba415;}function Action(_0x2624b5,_0x3a88e2,_0x1ca10b,_0x57058f,_0x45fefb){this[_0x2d4a('0x3')]=_0x1ca10b||undefined;this[_0x2d4a('0x4')]=_0x2624b5['id'];this[_0x2d4a('0x5')]=_0x3a88e2[_0x2d4a('0x6')];this[_0x2d4a('0x7')]=_0x3a88e2[_0x2d4a('0x7')];this[_0x2d4a('0x8')]=_0x2d4a('0x5');this[_0x2d4a('0x9')]=![];this[_0x2d4a('0xa')]=_[_0x2d4a('0x1')](_0x2624b5['Agent'])?undefined:_0x2624b5['Agent'][_0x2d4a('0x6')];this['channelAgent']=this[_0x2d4a('0xa')]?util[_0x2d4a('0xb')](_0x2d4a('0xc'),this[_0x2d4a('0xa')]):_0x57058f||undefined;this[_0x2d4a('0xd')]=checkNameSurname(_0x2624b5[_0x2d4a('0xe')][_0x2d4a('0xf')],_0x2624b5[_0x2d4a('0xe')]['firstName'],_0x2624b5['Contact'][_0x2d4a('0x10')]);this['active']=_0x2624b5[_0x2d4a('0x11')]||![];this[_0x2d4a('0x12')]=_0x2624b5[_0x2d4a('0xf')];this[_0x2d4a('0x13')]=_0x2624b5['scheduledat'];this[_0x2d4a('0x14')]=_0x2624b5['countbusyretry']||0x0;this[_0x2d4a('0x15')]=_0x2624b5['countcongestionretry']||0x0;this[_0x2d4a('0x16')]=_0x2624b5[_0x2d4a('0x16')]||0x0;this[_0x2d4a('0x17')]=(_0x2624b5[_0x2d4a('0x14')]||0x0)+(_0x2624b5['countcongestionretry']||0x0)+(_0x2624b5['countnoanswerretry']||0x0)+(_0x2624b5['countnosuchnumberretry']||0x0)+(_0x2624b5[_0x2d4a('0x18')]||0x0)+(_0x2624b5[_0x2d4a('0x19')]||0x0)+(_0x2624b5[_0x2d4a('0x1a')]||0x0)+(_0x2624b5[_0x2d4a('0x1b')]||0x0);this[_0x2d4a('0x1c')]=_0x2624b5[_0x2d4a('0x1c')]||0x0;this['countdropretry']=_0x2624b5['countdropretry']||0x0;this[_0x2d4a('0x19')]=_0x2624b5[_0x2d4a('0x19')]||0x0;this[_0x2d4a('0x1a')]=_0x2624b5[_0x2d4a('0x1a')]||0x0;this[_0x2d4a('0x1b')]=_0x2624b5[_0x2d4a('0x1b')]||0x0;this[_0x2d4a('0x1d')]=_0x2624b5[_0x2d4a('0x1d')];this['callbackuniqueid']=_0x2624b5[_0x2d4a('0x1e')];this[_0x2d4a('0x1f')]=_0x2624b5[_0x2d4a('0x1f')];this[_0x2d4a('0x20')]=_0x2624b5[_0x2d4a('0x20')];this[_0x2d4a('0x21')]=_0x2624b5[_0x2d4a('0x21')];this[_0x2d4a('0x22')]=_0x2624b5['ListId'];this['UserId']=_['isNil'](_0x2624b5[_0x2d4a('0x23')])?_0x2624b5['UserId']:_0x2624b5[_0x2d4a('0x23')]['id'];this[_0x2d4a('0x24')]=_0x2624b5[_0x2d4a('0x24')];this[_0x2d4a('0x25')]='';this[_0x2d4a('0x26')]='';}Action[_0x2d4a('0x27')][_0x2d4a('0x28')]=function(){return util[_0x2d4a('0xb')]('\x22%s\x22\x20<%s>',this[_0x2d4a('0xd')],this['number']);};module[_0x2d4a('0x29')]=Action; \ No newline at end of file +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(_0x89baf1,_0x4060dc){var _0x2a67a2=function(_0xc5c6a6){while(--_0xc5c6a6){_0x89baf1['push'](_0x89baf1['shift']());}};_0x2a67a2(++_0x4060dc);}(_0x5fdc,0x127));var _0xc5fd=function(_0x466b65,_0x39afdb){_0x466b65=_0x466b65-0x0;var _0x2ad805=_0x5fdc[_0x466b65];return _0x2ad805;};'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 diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index f4914bc..8ef59fc 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 _0xf43b=['dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','stringify','md5','voice:queue:%s','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','paused','message','NOT_ACTIVE','logger','DEACTIVATED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','preview','booked','clearZombieChannels','recallMe','clearZombieChannel','sequence','isNil','info','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','contactId','UserId','VoiceQueueId','ListId','Action','channel','catch','No\x20such\x20channel','updateOriginated','dialAnswer','decrementTalkink','[clearZombieChannel]','[Dialer][checkChannel][pTalking][Preview]','loggerError','[action]','size','getContactRecallMe','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','run','logger2','[RecallMe]','disableContact','format','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','setMessage','IsNotLoggedIn','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','scheduledAt','dialNoSuchNumberRetryFrequency','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','complete','total','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','Global','dialBusyMaxRetry','rescheduleContact','swapAdditionalPhones','NOANSWER','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','unlockAgent','countcongestionretry','Congestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','[incrementPreviewCounters]\x20','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','unmonitored','execRun','pick','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','checkInBlack','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','extractCalleridName','extractCalleridNumber','addVariables','toLowerVariables','starttime','variables','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','syncOriginateResponse','actionid','logLookAgent','clone','responsetime','response','custom:agentringnoanswer','rejected','YYYY-MM-DD\x20HH:mm:ss','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','channelstate','transfer','syncDialEnd','destuniqueid','addVariable','syncVarSet','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','lodash','uuid','moment','ioredis','../../../config/environment','../../../config/logger','actionPreview','./rpcDb','./action','redis','localhost','socket.io-emitter','prototype','enqueue','tail','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','hanguprequest','syncHangupRequest','dialend','syncNewExten','varset','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','abandoned','loggedInDb','dialActive','dialMethod'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xf43b,0x12f));var _0xbf43=function(_0x3ca8a3,_0x374383){_0x3ca8a3=_0x3ca8a3-0x0;var _0x2ab688=_0xf43b[_0x3ca8a3];return _0x2ab688;};'use strict';var util=require('util');var _=require(_0xbf43('0x0'));var uuid=require(_0xbf43('0x1'));var moment=require(_0xbf43('0x2'));var md5=require('md5');var Redis=require(_0xbf43('0x3'));var config=require(_0xbf43('0x4'));var logger=require(_0xbf43('0x5'))('preview');var loggerAction=require(_0xbf43('0x5'))(_0xbf43('0x6'));var ami=require('../ami');var rpcDb=require(_0xbf43('0x7'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0xbf43('0x8'));var ut=require('./util/util');config[_0xbf43('0x9')]=_['defaults'](config[_0xbf43('0x9')],{'host':_0xbf43('0xa'),'port':0x18eb});var io=require(_0xbf43('0xb'))(new Redis(config[_0xbf43('0x9')]));var Sequence=function(){};Sequence[_0xbf43('0xc')][_0xbf43('0xd')]=function(_0x4e62fb){this[_0xbf43('0xe')]=this[_0xbf43('0xe')]?this[_0xbf43('0xe')]['finally'](_0x4e62fb):_0x4e62fb();};function Preview(_0x3e171b){this['sequence']=new Sequence();this[_0xbf43('0xf')]=_0x3e171b['voiceQueues'];this[_0xbf43('0x10')]=_0x3e171b['trunks'];this[_0xbf43('0x11')]={};this['agents']=_0x3e171b[_0xbf43('0x12')];this[_0xbf43('0x13')]=0x0;ami['on'](_0xbf43('0x14'),this['syncOriginateResponse'][_0xbf43('0x15')](this));ami['on'](_0xbf43('0x16'),this['syncHangup'][_0xbf43('0x15')](this));ami['on'](_0xbf43('0x17'),this[_0xbf43('0x18')]['bind'](this));ami['on'](_0xbf43('0x19'),this['syncDialEnd'][_0xbf43('0x15')](this));ami['on']('newexten',this[_0xbf43('0x1a')]['bind'](this));ami['on'](_0xbf43('0x1b'),this['syncVarSet'][_0xbf43('0x15')](this));ami['on'](_0xbf43('0x1c'),this[_0xbf43('0x1d')][_0xbf43('0x15')](this));ami['on'](_0xbf43('0x1e'),this[_0xbf43('0x1f')][_0xbf43('0x15')](this));this[_0xbf43('0x20')](this[_0xbf43('0xf')]);}function emit(_0x9d8edb,_0x3526e7,_0x1f7e6f){io['to'](_0x9d8edb)[_0xbf43('0x21')](_0x3526e7,_0x1f7e6f);}function emitCampaignPreview(_0x5dd2ee){if(_0x5dd2ee[_0xbf43('0x22')]===_0xbf43('0x23')){var _0x38ca7e={'id':_0x5dd2ee['id'],'name':_0x5dd2ee[_0xbf43('0x24')],'strategy':_0x5dd2ee[_0xbf43('0x25')],'answered':_0x5dd2ee[_0xbf43('0x26')],'available':_0x5dd2ee[_0xbf43('0x27')],'loggedIn':_0x5dd2ee[_0xbf43('0x28')],'pTalking':_0x5dd2ee[_0xbf43('0x29')],'sumBillable':_0x5dd2ee[_0xbf43('0x2a')],'sumDuration':_0x5dd2ee[_0xbf43('0x2b')],'sumHoldTime':_0x5dd2ee[_0xbf43('0x2c')]||0x0,'talking':_0x5dd2ee[_0xbf43('0x2d')],'total':_0x5dd2ee['total'],'type':_0x5dd2ee['type'],'unmanaged':_0x5dd2ee[_0xbf43('0x2e')],'abandoned':_0x5dd2ee[_0xbf43('0x2f')],'waiting':_0x5dd2ee['waiting'],'loggedInDb':_0x5dd2ee[_0xbf43('0x30')],'dialActive':_0x5dd2ee[_0xbf43('0x31')],'dialMethod':_0x5dd2ee[_0xbf43('0x32')],'dialOriginateCallerIdName':_0x5dd2ee['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x5dd2ee[_0xbf43('0x33')],'dialOriginateTimeout':_0x5dd2ee[_0xbf43('0x34')],'dialPrefix':_0x5dd2ee[_0xbf43('0x35')],'outboundAnswerAgiCallsDay':_0x5dd2ee['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x5dd2ee[_0xbf43('0x36')],'outboundBlacklistCallsDay':_0x5dd2ee[_0xbf43('0x37')],'outboundBusyCallsDay':_0x5dd2ee[_0xbf43('0x38')],'outboundCongestionCallsDay':_0x5dd2ee[_0xbf43('0x39')],'outboundDropCallsDayACS':_0x5dd2ee['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x5dd2ee['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x5dd2ee[_0xbf43('0x3a')],'outboundNoAnswerCallsDay':_0x5dd2ee[_0xbf43('0x3b')],'outboundNoSuchCallsDay':_0x5dd2ee[_0xbf43('0x3c')],'outboundOriginateFailureCallsDay':_0x5dd2ee[_0xbf43('0x3d')],'outboundReCallsDay':_0x5dd2ee[_0xbf43('0x3e')],'outboundRejectCallsDay':_0x5dd2ee[_0xbf43('0x3f')],'outboundUnknownCallsDay':_0x5dd2ee[_0xbf43('0x40')],'outboundAbandonedCallsDay':_0x5dd2ee[_0xbf43('0x41')],'predictiveIntervalAnsweredCalls':_0x5dd2ee[_0xbf43('0x42')],'predictiveIntervalAvgHoldtime':_0x5dd2ee[_0xbf43('0x43')],'predictiveIntervalAvgTalktime':_0x5dd2ee['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x5dd2ee['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x5dd2ee[_0xbf43('0x44')],'predictiveIntervalErlangCalls':_0x5dd2ee[_0xbf43('0x45')],'predictiveIntervalErlangCallsDroppedCalls':_0x5dd2ee[_0xbf43('0x46')],'predictiveIntervalHitRate':_0x5dd2ee[_0xbf43('0x47')],'predictiveIntervalMultiplicativeFactor':_0x5dd2ee['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x5dd2ee[_0xbf43('0x48')],'predictiveIntervalAvailable':_0x5dd2ee[_0xbf43('0x49')],'predictiveIntervalTotalCalls':_0x5dd2ee[_0xbf43('0x4a')],'message':_0x5dd2ee['message'],'originated':_0x5dd2ee[_0xbf43('0x4b')],'erlangCalls':_0x5dd2ee[_0xbf43('0x4c')],'erlangCallToSecond':_0x5dd2ee[_0xbf43('0x4d')],'erlangAbandonmentRate':_0x5dd2ee[_0xbf43('0x4e')],'erlangBusyFactor':_0x5dd2ee[_0xbf43('0x4f')],'startPredictive':_0x5dd2ee[_0xbf43('0x50')],'startProgressive':_0x5dd2ee[_0xbf43('0x51')]};if(_0x5dd2ee[_0xbf43('0x52')]){_0x38ca7e[_0xbf43('0x52')]={'id':_0x5dd2ee['Trunk']['id'],'name':_0x5dd2ee[_0xbf43('0x52')]['name'],'active':_0x5dd2ee[_0xbf43('0x52')][_0xbf43('0x53')],'callerid':_0x5dd2ee[_0xbf43('0x52')]['callerid']};}if(_0x5dd2ee[_0xbf43('0x54')]){_0x38ca7e[_0xbf43('0x54')]={'id':_0x5dd2ee[_0xbf43('0x54')]['id'],'name':_0x5dd2ee['Interval'][_0xbf43('0x24')]};}var _0x6540c5=md5(JSON[_0xbf43('0x55')](_0x38ca7e));if(_0x5dd2ee['md5']!==_0x6540c5){_0x5dd2ee[_0xbf43('0x56')]=_0x6540c5;emit(util['format'](_0xbf43('0x57'),_0x38ca7e[_0xbf43('0x24')]),_0xbf43('0x58'),_0x38ca7e);}}}function emitVoiceQueueChannelRemove(_0x4c74f6){logger['info'](_0xbf43('0x59'),JSON[_0xbf43('0x55')](_0x4c74f6));emit(util['format'](_0xbf43('0x57'),_0x4c74f6[_0xbf43('0x24')]),_0xbf43('0x5a'),_0x4c74f6);io[_0xbf43('0x21')](_0xbf43('0x5b'),_0x4c74f6);}function notSendMessagesQueue(_0x1c77ec){if(_0x1c77ec['sendMessageOneNotActive']){if(_0x1c77ec[_0xbf43('0x4b')]===0x0&&_0x1c77ec[_0xbf43('0x29')]===0x0){_0x1c77ec['sendMessageOneNotActive']=![];_0x1c77ec[_0xbf43('0x27')]=0x0;_0x1c77ec[_0xbf43('0x5c')]=0x0;_0x1c77ec[_0xbf43('0x5d')]=_0xbf43('0x5e');ut[_0xbf43('0x5f')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x1c77ec[_0xbf43('0x24')]+'\x20is\x20not\x20active');}else{_0x1c77ec[_0xbf43('0x5d')]=_0xbf43('0x60');ut['logger'](_0xbf43('0x61'),_0x1c77ec[_0xbf43('0x24')]+_0xbf43('0x62'));}emitCampaignPreview(_0x1c77ec);}}Preview[_0xbf43('0xc')][_0xbf43('0x20')]=function(){var _0x3aef1d=this;setInterval(function(){_0x3aef1d[_0xbf43('0x63')]();},0x7cf);};Preview[_0xbf43('0xc')][_0xbf43('0x63')]=function(){var _0x1c5334=this[_0xbf43('0xf')];this[_0xbf43('0x13')]+=0x1;for(var _0x47d7fb in _0x1c5334){if(_0x1c5334[_0xbf43('0x64')](_0x47d7fb)&&(_0x1c5334[_0x47d7fb][_0xbf43('0x32')]===_0xbf43('0x65')||_0x1c5334[_0x47d7fb][_0xbf43('0x32')]===_0xbf43('0x66'))&&_0x1c5334[_0x47d7fb][_0xbf43('0x22')]===_0xbf43('0x23')){if(this['clockClearZombieChannels']>0x7){this[_0xbf43('0x13')]=0x0;this[_0xbf43('0x67')]();}}if(_0x1c5334[_0xbf43('0x64')](_0x47d7fb)&&_0x1c5334[_0x47d7fb][_0xbf43('0x32')]==='preview'&&_0x1c5334[_0x47d7fb][_0xbf43('0x22')]===_0xbf43('0x23')){if(_0x1c5334[_0x47d7fb][_0xbf43('0x31')]){this['setMessage'](_0x1c5334[_0x47d7fb]);if(_0x1c5334[_0x47d7fb]['dialPreviewAutoRecallMe'])this[_0xbf43('0x68')](_0x1c5334[_0x47d7fb]);}else{notSendMessagesQueue(_0x1c5334[_0x47d7fb]);}}}};Preview[_0xbf43('0xc')][_0xbf43('0x69')]=function(_0x4ab57b){var _0x191e7e=this;this[_0xbf43('0x6a')][_0xbf43('0xd')](function(){if(!_[_0xbf43('0x6b')](_0x191e7e['actions'][_0x4ab57b])){loggerAction[_0xbf43('0x6c')](_0xbf43('0x6d'),_0x4ab57b,_0xbf43('0x6e'),_0x191e7e[_0xbf43('0x11')][_0x4ab57b][_0xbf43('0x6f')],_0xbf43('0x70'),JSON[_0xbf43('0x55')](_0x191e7e[_0xbf43('0xf')][_0x191e7e[_0xbf43('0x11')][_0x4ab57b][_0xbf43('0x6f')]][_0xbf43('0x4b')]),_0xbf43('0x71'),JSON[_0xbf43('0x55')](_0x191e7e[_0xbf43('0xf')][_0x191e7e['actions'][_0x4ab57b]['queue']]['pTalking']),JSON[_0xbf43('0x55')](_0x191e7e[_0xbf43('0x11')][_0x4ab57b]['dialAnswer']),JSON['stringify'](_['pick'](_0x191e7e[_0xbf43('0x11')][_0x4ab57b],[_0xbf43('0x72'),_0xbf43('0x73'),_0xbf43('0x74'),_0xbf43('0x75')])));return ami[_0xbf43('0x76')]({'action':'status','channel':_0x191e7e['actions'][_0x4ab57b][_0xbf43('0x77')]})[_0xbf43('0x78')](function(_0x1c15be){if(_0x1c15be[_0xbf43('0x5d')]===_0xbf43('0x79')){setTimeout(function(){if(_0x191e7e[_0xbf43('0x11')][_0x4ab57b]){ut[_0xbf43('0x7a')](_0x191e7e[_0xbf43('0xf')][_0x191e7e['actions'][_0x4ab57b][_0xbf43('0x6f')]],'[clearZombieChannel]');if(_0x191e7e[_0xbf43('0x11')][_0x4ab57b][_0xbf43('0x7b')]===!![]){ut[_0xbf43('0x7c')](_0x191e7e[_0xbf43('0xf')][_0x191e7e[_0xbf43('0x11')][_0x4ab57b][_0xbf43('0x6f')]],_0xbf43('0x7d'));ut['loggerError'](_0xbf43('0x7e')+_0x4ab57b,_0x191e7e[_0xbf43('0x11')][_0x4ab57b]['queue']);}ut[_0xbf43('0x7f')]('[Dialer][checkChannel][Preview]'+_0x4ab57b,_0x191e7e[_0xbf43('0x11')][_0x4ab57b][_0xbf43('0x6f')]);delete _0x191e7e[_0xbf43('0x11')][_0x4ab57b];}},0x2328);}});}});};Preview['prototype'][_0xbf43('0x67')]=function(){var _0x45a32c=this;loggerAction[_0xbf43('0x6c')](_0xbf43('0x80'),_[_0xbf43('0x81')](this[_0xbf43('0x11')]));for(var _0x54150c in this[_0xbf43('0x11')]){if(_0x45a32c[_0xbf43('0x11')][_0xbf43('0x64')](_0x54150c)){_0x45a32c['clearZombieChannel'](_0x54150c);}}};Preview[_0xbf43('0xc')][_0xbf43('0x68')]=function(_0x534e34){var _0x421a58=this;rpcDb[_0xbf43('0x82')](_0x534e34['id'],ut['agentReadyId'](this[_0xbf43('0x12')]))[_0xbf43('0x83')](function(_0x29ceca){if(!_[_0xbf43('0x6b')](_0x29ceca)){for(var _0x5eb9a2=0x0;_0x5eb9a2<_0x29ceca[_0xbf43('0x84')];_0x5eb9a2+=0x1){if(ut[_0xbf43('0x85')](_0x29ceca[_0x5eb9a2][_0xbf43('0x86')])<_0x534e34[_0xbf43('0x87')]*0x3c){if(_0x29ceca[_0x5eb9a2][_0xbf43('0x88')]&&!_0x29ceca[_0x5eb9a2][_0xbf43('0x88')]['voicePause']){_0x421a58[_0xbf43('0x89')](_0x29ceca[_0x5eb9a2]['id'])[_0xbf43('0x83')](ut['logger2']('[RecallMe]'))[_0xbf43('0x78')](ut[_0xbf43('0x8a')](_0xbf43('0x8b')));}else{rpcDb[_0xbf43('0x8c')](_0x29ceca[_0x5eb9a2]['id']);}}else{var _0x3c4891=new Action(_0x29ceca[_0x5eb9a2],_0x534e34);_0x3c4891['starttime']=moment()[_0xbf43('0x8d')]('YYYY-MM-DD\x20HH:mm:ss');_0x534e34[_0xbf43('0x3e')]+=0x1;ut[_0xbf43('0x8e')](_0x3c4891,0x17,_0xbf43('0x8f'));if(_0x534e34[_0xbf43('0x90')]){rpcDb[_0xbf43('0x91')](ut[_0xbf43('0x92')](_0x29ceca[_0x5eb9a2]));rpcDb[_0xbf43('0x93')](_0x3c4891,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0xbf43('0x8e')](_0x3c4891,0x16,_0xbf43('0x94'));rpcDb[_0xbf43('0x93')](_0x3c4891,_0xbf43('0x95'));rpcDb['createCustomerFinal'](_0x3c4891,'[HistoryRecallClose]');}}}}})[_0xbf43('0x78')](ut[_0xbf43('0x8a')]('[getContactRecallMe]'));};Preview['prototype'][_0xbf43('0x96')]=function(_0x395203){_0x395203['sendMessageOneNotActive']=!![];if(ut[_0xbf43('0x97')](_0x395203[_0xbf43('0x28')])){_0x395203[_0xbf43('0x5d')]='AGENTS_NOT_LOGGED';}else if(!ut['isActive'](_0x395203[_0xbf43('0x31')])){_0x395203[_0xbf43('0x5d')]='NOT_ACTIVE';}else if(!this[_0xbf43('0x98')](_0x395203[_0xbf43('0x52')])){if(!this[_0xbf43('0x98')](_0x395203['TrunkBackup'])){_0x395203[_0xbf43('0x5d')]=_0xbf43('0x99');}else{_0x395203[_0xbf43('0x5d')]=_0xbf43('0x9a');}}else{_0x395203[_0xbf43('0x5d')]=_0xbf43('0x9a');}emitCampaignPreview(_0x395203);};Preview[_0xbf43('0xc')][_0xbf43('0x9b')]=function(_0x3595da,_0x55eed2,_0x45d6db){var _0x4ed117=this;var _0x5cb740=this[_0xbf43('0x11')][_0x55eed2];var _0x17eb9d=this['campaignsPreview'][_0x5cb740[_0xbf43('0x6f')]];var _0x1b8511;var _0x403ff7=![];var _0x13edb1=0x2;var _0x57020c=0x3;if(_0x17eb9d){switch(_0x45d6db){case'1':_0x17eb9d['outboundNoSuchCallsDay']+=0x1;_0x5cb740['countnosuchnumberretry']+=0x1;_0x5cb740[_0xbf43('0x9c')]=ut[_0xbf43('0x9d')](_0x5cb740);ut[_0xbf43('0x8e')](_0x5cb740,0x0,_0xbf43('0x9e'));ami['emit'](_0xbf43('0x9f'),ut[_0xbf43('0xa0')](_0x5cb740,_0xbf43('0xa1')));rpcDb[_0xbf43('0x93')](_0x5cb740,_0xbf43('0xa2'));_0x4ed117[_0xbf43('0xa3')](_0x5cb740,'0',_0x17eb9d)[_0xbf43('0x83')](function(_0xf06e7b){_0x403ff7=_0xf06e7b[_0xbf43('0xa4')]==0x1;_0x13edb1=_0x17eb9d['dialNoSuchNumberRetryFrequency'];_0x57020c=_0x17eb9d[_0xbf43('0xa5')];if(!_0x403ff7){if(ut['totalGlobal'](_0x5cb740)>=_0x17eb9d[_0xbf43('0xa6')]){_0x1b8511=ut[_0xbf43('0xa7')](_0x5cb740,0xf,'Global');rpcDb[_0xbf43('0xa8')](_0x1b8511,_0xbf43('0xa9'));}else{if(_0x5cb740[_0xbf43('0xaa')]>=_0x17eb9d['dialNoSuchNumberMaxRetry']){rpcDb[_0xbf43('0xa8')](_0x5cb740,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb['rescheduleContact'](ut[_0xbf43('0xab')](_0x5cb740,_0xbf43('0xaa'),_0x17eb9d[_0xbf43('0xac')]),_0x5cb740['unlockAgent'],_0x5cb740[_0xbf43('0xad')]);}}delete this[_0xbf43('0x11')][_0x3595da[_0xbf43('0xae')]];}else{_0x5cb740['countnosuchnumberretry']++;logger[_0xbf43('0x6c')](_0xbf43('0xaf'),_0x5cb740[_0xbf43('0xaa')]);logger['info']('id',_0x5cb740[_0xbf43('0xb0')]);_0x4ed117[_0xbf43('0xb1')]({'id':_0x5cb740['idContact'],'field':{'countnosuchnumberretry':_0x5cb740[_0xbf43('0xaa')]}})[_0xbf43('0x83')](function(){_0x4ed117['swapAdditionalPhones'](_0x5cb740,_0x13edb1,_0x57020c)[_0xbf43('0x83')](function(){});});}});break;case _0xbf43('0xb2'):var _0x1cf00e=moment()[_0xbf43('0x8d')]('YYYY-MM-DD\x20HH:mm:ss');_0x5cb740['responsetime']=_0x1cf00e;_0x5cb740[_0xbf43('0xb3')]=_0x1cf00e;_0x5cb740[_0xbf43('0x7b')]=!![];_0x17eb9d[_0xbf43('0x29')]+=0x1;logger[_0xbf43('0x6c')](_0xbf43('0xb4'),_0x5cb740[_0xbf43('0xb5')],_0xbf43('0xb6'),_0x17eb9d['name'],_0xbf43('0x71'),_0x17eb9d[_0xbf43('0x29')]);ami[_0xbf43('0x21')](_0xbf43('0xb7'),ut[_0xbf43('0xa0')](_0x5cb740,_0xbf43('0xb8'),this[_0xbf43('0xf')][_0x5cb740['queue']]));if(_0x17eb9d[_0xbf43('0xb9')]){ami[_0xbf43('0x21')](_0xbf43('0xba'),ut[_0xbf43('0xbb')](_0x5cb740));}break;case'16':ami[_0xbf43('0x21')]('custom:agentcomplete',ut[_0xbf43('0xa0')](_0x5cb740,'complete',this['campaignsPreview'][_0x5cb740[_0xbf43('0x6f')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x5cb740,_0xbf43('0xbc')));_0x17eb9d['outboundAnswerCallsDay']+=0x1;_0x17eb9d[_0xbf43('0xbd')]+=0x1;_0x17eb9d[_0xbf43('0x26')]+=0x1;ut[_0xbf43('0x7c')](_0x17eb9d,_0xbf43('0xbe'));_0x5cb740[_0xbf43('0x9c')]=ut['totalGlobal'](_0x5cb740);ut[_0xbf43('0x8e')](_0x5cb740,0x4,_0xbf43('0xbf'));rpcDb[_0xbf43('0x93')](_0x5cb740,_0xbf43('0xc0'));rpcDb[_0xbf43('0xa8')](_0x5cb740,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0xbf43('0xc1')](_0x5cb740);_0x17eb9d[_0xbf43('0x2b')]+=_0x5cb740['talktime'];_0x17eb9d['sumBillable']+=_0x5cb740[_0xbf43('0xc2')];logger[_0xbf43('0x6c')](_0xbf43('0xc3'),_0x5cb740[_0xbf43('0xb5')],'\x20Queue',_0x17eb9d['name'],_0xbf43('0x71'),_0x17eb9d[_0xbf43('0x29')]);delete this[_0xbf43('0x11')][_0x3595da[_0xbf43('0xae')]];break;case'BUSY':_0x17eb9d[_0xbf43('0x38')]+=0x1;_0x5cb740[_0xbf43('0xc4')]+=0x1;_0x5cb740[_0xbf43('0x9c')]=ut[_0xbf43('0x9d')](_0x5cb740);ut[_0xbf43('0x8e')](_0x5cb740,0x5,_0xbf43('0xc5'));_0x13edb1=_0x17eb9d[_0xbf43('0xc6')];_0x57020c=_0x17eb9d[_0xbf43('0xa5')];ami[_0xbf43('0x21')](_0xbf43('0xc7'),ut[_0xbf43('0xa0')](_0x5cb740,_0xbf43('0xc8')));rpcDb[_0xbf43('0x93')](_0x5cb740,_0xbf43('0xc9'));_0x4ed117[_0xbf43('0xa3')](_0x5cb740,'5',_0x17eb9d)[_0xbf43('0x83')](function(_0x2dc434){_0x403ff7=_0x2dc434[_0xbf43('0xa4')]==0x1;if(!_0x403ff7){if(ut['totalGlobal'](_0x5cb740)>=_0x17eb9d['dialGlobalMaxRetry']){_0x1b8511=ut['cloneAction'](_0x5cb740,0xf,_0xbf43('0xca'));rpcDb[_0xbf43('0xa8')](_0x1b8511,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x5cb740[_0xbf43('0xc4')]>=_0x17eb9d[_0xbf43('0xcb')]){rpcDb[_0xbf43('0xa8')](_0x5cb740,_0xbf43('0xc9'));}else{rpcDb[_0xbf43('0xcc')](ut[_0xbf43('0xab')](_0x5cb740,_0xbf43('0xc4'),_0x17eb9d[_0xbf43('0xc6')]),_0x5cb740['unlockAgent'],_0x5cb740[_0xbf43('0xad')]);}}}else{_0x5cb740[_0xbf43('0xc4')]++;_0x4ed117[_0xbf43('0xb1')]({'id':_0x5cb740[_0xbf43('0xb0')],'field':{'countbusyretry':_0x5cb740[_0xbf43('0xc4')]}})[_0xbf43('0x83')](function(){_0x4ed117[_0xbf43('0xcd')](_0x5cb740,_0x13edb1,_0x57020c)[_0xbf43('0x83')](function(){});});}});break;case _0xbf43('0xce'):_0x17eb9d['outboundNoAnswerCallsDay']+=0x1;_0x5cb740[_0xbf43('0xcf')]+=0x1;_0x5cb740['countglobal']=ut['totalGlobal'](_0x5cb740);ut['logCustomer'](_0x5cb740,0x3,_0xbf43('0xd0'));_0x13edb1=_0x17eb9d[_0xbf43('0xd1')];_0x57020c=_0x17eb9d[_0xbf43('0xa5')];var _0xefd7ff=ut[_0xbf43('0xd2')](_0x5cb740,_0x17eb9d);ami['emit'](_0xbf43('0xd3'),_0xefd7ff);rpcDb[_0xbf43('0x93')](_0x5cb740,_0xbf43('0xd4'));_0x4ed117[_0xbf43('0xa3')](_0x5cb740,'3',_0x17eb9d)[_0xbf43('0x83')](function(_0x5f682d){_0x403ff7=_0x5f682d[_0xbf43('0xa4')]==0x1;if(!_0x403ff7){if(ut[_0xbf43('0x9d')](_0x5cb740)>=_0x17eb9d[_0xbf43('0xa6')]){_0x1b8511=ut['cloneAction'](_0x5cb740,0xf,_0xbf43('0xca'));rpcDb[_0xbf43('0xa8')](_0x1b8511,_0xbf43('0xd5'));}else{if(_0x5cb740[_0xbf43('0xcf')]>=_0x17eb9d[_0xbf43('0xd6')]){rpcDb[_0xbf43('0xa8')](_0x5cb740,_0xbf43('0xd4'));}else{rpcDb[_0xbf43('0xcc')](ut[_0xbf43('0xab')](_0x5cb740,'countnoanswerretry',_0x17eb9d[_0xbf43('0xd1')]),_0x5cb740[_0xbf43('0xd7')],_0x5cb740[_0xbf43('0xad')]);}}}else{_0x5cb740['countnoanswerretry']++;_0x4ed117[_0xbf43('0xb1')]({'id':_0x5cb740[_0xbf43('0xb0')],'field':{'countnoanswerretry':_0x5cb740[_0xbf43('0xcf')]}})[_0xbf43('0x83')](function(){_0x4ed117[_0xbf43('0xcd')](_0x5cb740,_0x13edb1,_0x57020c)[_0xbf43('0x83')](function(){});});}});break;case'CONGESTION':_0x17eb9d[_0xbf43('0x39')]+=0x1;_0x5cb740[_0xbf43('0xd8')]+=0x1;_0x5cb740[_0xbf43('0x9c')]=ut[_0xbf43('0x9d')](_0x5cb740);ut['logCustomer'](_0x5cb740,0x8,_0xbf43('0xd9'));_0x13edb1=_0x17eb9d['dialCongestionRetryFrequency'];_0x57020c=_0x17eb9d['callAdditionalPhoneAfterMin'];ami[_0xbf43('0x21')]('custom:agentcongestion',ut[_0xbf43('0xa0')](_0x5cb740,_0xbf43('0xda')));rpcDb['createCustomerHistory'](_0x5cb740,_0xbf43('0xdb'));_0x4ed117['verifyAdditionalPhones'](_0x5cb740,'8',_0x17eb9d)[_0xbf43('0x83')](function(_0x9032de){_0x403ff7=_0x9032de[_0xbf43('0xa4')]==0x1;if(!_0x403ff7){if(ut['totalGlobal'](_0x5cb740)>=_0x17eb9d[_0xbf43('0xa6')]){_0x1b8511=ut[_0xbf43('0xa7')](_0x5cb740,0xf,_0xbf43('0xca'));rpcDb['createCustomerFinal'](_0x1b8511,_0xbf43('0xdc'));}else{if(_0x5cb740[_0xbf43('0xd8')]>=_0x17eb9d[_0xbf43('0xdd')]){rpcDb['createCustomerFinal'](_0x5cb740,_0xbf43('0xdb'));}else{rpcDb[_0xbf43('0xcc')](ut['scheduledAt'](_0x5cb740,_0xbf43('0xd8'),_0x17eb9d['dialBusyRetryFrequency']),_0x5cb740[_0xbf43('0xd7')],_0x5cb740[_0xbf43('0xad')]);}}}else{_0x5cb740['countcongestionretry']++;_0x4ed117[_0xbf43('0xb1')]({'id':_0x5cb740[_0xbf43('0xb0')],'field':{'countcongestionretry':_0x5cb740['countcongestionretry']}})[_0xbf43('0x83')](function(){_0x4ed117[_0xbf43('0xcd')](_0x5cb740,_0x13edb1,_0x57020c)['then'](function(){});});}});break;case _0xbf43('0xde'):_0x17eb9d['outboundRejectCallsDay']+=0x1;_0x5cb740[_0xbf43('0xdf')]+=0x1;_0x5cb740[_0xbf43('0x9c')]=ut[_0xbf43('0x9d')](_0x5cb740);ut[_0xbf43('0x8e')](_0x5cb740,0x14,_0xbf43('0xe0'));_0x13edb1=_0x17eb9d[_0xbf43('0xe1')];_0x57020c=_0x17eb9d[_0xbf43('0xa5')];ami['emit'](_0xbf43('0xe2'),ut[_0xbf43('0xa0')](_0x5cb740,_0xbf43('0xe3')));rpcDb[_0xbf43('0x93')](_0x5cb740,_0xbf43('0xe4'));_0x4ed117[_0xbf43('0xa3')](_0x5cb740,'20',_0x17eb9d)[_0xbf43('0x83')](function(_0x2424a0){_0x403ff7=_0x2424a0[_0xbf43('0xa4')]==0x1;if(!_0x403ff7){if(ut['totalGlobal'](_0x5cb740)>=_0x17eb9d[_0xbf43('0xa6')]){_0x1b8511=ut['cloneAction'](_0x5cb740,0x14,_0xbf43('0xe0'));rpcDb[_0xbf43('0xa8')](_0x1b8511,_0xbf43('0xe5'));}else{if(_0x5cb740[_0xbf43('0xdf')]>=_0x17eb9d[_0xbf43('0xe6')]){rpcDb[_0xbf43('0xa8')](_0x5cb740,_0xbf43('0xe5'));}else{rpcDb['rescheduleContact'](ut[_0xbf43('0xab')](_0x5cb740,_0xbf43('0xdf'),_0x17eb9d[_0xbf43('0xe1')]),_0x5cb740[_0xbf43('0xd7')],_0x5cb740[_0xbf43('0xad')]);}}}else{_0x5cb740[_0xbf43('0xcf')]++;_0x4ed117[_0xbf43('0xb1')]({'id':_0x5cb740[_0xbf43('0xb0')],'field':{'countnoanswerretry':_0x5cb740['countnoanswerretry']}})['then'](function(){_0x4ed117['swapAdditionalPhones'](_0x5cb740,_0x13edb1,_0x57020c)[_0xbf43('0x83')](function(){});});}});break;case'ABANDONED':_0x17eb9d[_0xbf43('0x41')]+=0x1;_0x5cb740[_0xbf43('0xe7')]+=0x1;_0x5cb740[_0xbf43('0x9c')]=ut[_0xbf43('0x9d')](_0x5cb740);ut['logCustomer'](_0x5cb740,0xb,_0xbf43('0xe8'));rpcDb[_0xbf43('0x93')](_0x5cb740,'[callProgressDetectingCustomer][logAbandoned]');_0x4ed117['verifyAdditionalPhones'](_0x5cb740,'11',_0x17eb9d)[_0xbf43('0x83')](function(_0x4c9223){_0x403ff7=_0x4c9223[_0xbf43('0xa4')]==0x1;if(!_0x403ff7){if(ut[_0xbf43('0x9d')](_0x5cb740)>=_0x17eb9d[_0xbf43('0xa6')]){_0x1b8511=ut[_0xbf43('0xa7')](_0x5cb740,0xf,_0xbf43('0xca'));rpcDb[_0xbf43('0xa8')](_0x1b8511,_0xbf43('0xe9'));}else{if(_0x5cb740[_0xbf43('0xea')]>=_0x17eb9d[_0xbf43('0xeb')]){rpcDb['createCustomerFinal'](_0x5cb740,_0xbf43('0xe9'));}else{rpcDb[_0xbf43('0xcc')](ut['scheduledAt'](_0x5cb740,_0xbf43('0xe7'),_0x17eb9d[_0xbf43('0xec')]),_0x5cb740['unlockAgent'],_0x5cb740[_0xbf43('0xad')]);}}}else{_0x5cb740[_0xbf43('0xcf')]++;_0x4ed117[_0xbf43('0xb1')]({'id':_0x5cb740[_0xbf43('0xb0')],'field':{'countnoanswerretry':_0x5cb740[_0xbf43('0xcf')]}})[_0xbf43('0x83')](function(){_0x4ed117[_0xbf43('0xcd')](_0x5cb740,_0x13edb1,_0x57020c)[_0xbf43('0x83')](function(){});});}});break;case'18':_0x17eb9d[_0xbf43('0x40')]+=0x1;_0x5cb740[_0xbf43('0xed')]+=0x1;_0x5cb740[_0xbf43('0x9c')]=ut[_0xbf43('0x9d')](_0x5cb740);ut['logCustomer'](_0x5cb740,0x12,_0x3595da[_0xbf43('0xee')]||_0x3595da['dialstatus']);ami['emit'](_0xbf43('0xef'),ut[_0xbf43('0xa0')](_0x5cb740,_0xbf43('0xf0')));rpcDb[_0xbf43('0x93')](_0x5cb740,_0xbf43('0xf1'));_0x4ed117[_0xbf43('0xa3')](_0x5cb740,'18',_0x17eb9d)[_0xbf43('0x83')](function(_0x510377){_0x403ff7=_0x510377[_0xbf43('0xa4')]==0x1;if(!_0x403ff7){if(ut['totalGlobal'](_0x5cb740)>=_0x17eb9d[_0xbf43('0xa6')]){_0x1b8511=ut[_0xbf43('0xa7')](_0x5cb740,0x12,'Global');rpcDb[_0xbf43('0xa8')](_0x1b8511,_0xbf43('0xf1'));}else{rpcDb[_0xbf43('0xa8')](_0x5cb740,_0xbf43('0xf1'));}}else{_0x5cb740[_0xbf43('0xcf')]++;_0x4ed117['incrementPreviewCounters']({'id':_0x5cb740[_0xbf43('0xb0')],'field':{'countnoanswerretry':_0x5cb740['countnoanswerretry']}})[_0xbf43('0x83')](function(){_0x4ed117[_0xbf43('0xcd')](_0x5cb740,_0x13edb1,_0x57020c)[_0xbf43('0x83')](function(){});});}});delete this[_0xbf43('0x11')][_0x3595da['linkedid']];break;case'19':_0x17eb9d[_0xbf43('0x40')]+=0x1;_0x5cb740[_0xbf43('0x9c')]=ut[_0xbf43('0x9d')](_0x5cb740);ut[_0xbf43('0x8e')](_0x5cb740,0x13,_0x3595da[_0xbf43('0xee')]||_0x3595da[_0xbf43('0xf2')]);ami[_0xbf43('0x21')](_0xbf43('0xef'),ut[_0xbf43('0xa0')](_0x5cb740,_0xbf43('0xf0')));rpcDb[_0xbf43('0x93')](_0x5cb740,_0xbf43('0xf3'));_0x4ed117[_0xbf43('0xa3')](_0x5cb740,'18',_0x17eb9d)[_0xbf43('0x83')](function(_0x3abc46){_0x403ff7=_0x3abc46[_0xbf43('0xa4')]==0x1;if(!_0x403ff7){if(ut[_0xbf43('0x9d')](_0x5cb740)>=_0x17eb9d['dialGlobalMaxRetry']){_0x1b8511=ut['cloneAction'](_0x5cb740,0xf,'Global');rpcDb[_0xbf43('0xa8')](_0x1b8511,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0xbf43('0xa8')](_0x5cb740,_0xbf43('0xf3'));}}else{_0x5cb740['countnoanswerretry']++;_0x4ed117['incrementPreviewCounters']({'id':_0x5cb740[_0xbf43('0xb0')],'field':{'countnoanswerretry':_0x5cb740[_0xbf43('0xcf')]}})[_0xbf43('0x83')](function(){_0x4ed117['swapAdditionalPhones'](_0x5cb740,_0x13edb1,_0x57020c)[_0xbf43('0x83')](function(){});});}});delete this[_0xbf43('0x11')][_0x3595da['linkedid']];break;default:if(_0x5cb740[_0xbf43('0x7b')]){ut['decrementTalkink'](_0x17eb9d,_0xbf43('0xf4'));ut['loggerError'](_0xbf43('0xf5')+_0x17eb9d[_0xbf43('0x24')],_0x3595da);}_0x17eb9d[_0xbf43('0x40')]+=0x1;_0x5cb740[_0xbf43('0x9c')]=ut[_0xbf43('0x9d')](_0x5cb740);ut[_0xbf43('0x8e')](_0x5cb740,0xc,_0x3595da['cause-txt']||_0x3595da['dialstatus']);_0x13edb1=_0x17eb9d['dialAgentRejectRetryFrequency'];_0x57020c=_0x17eb9d['callAdditionalPhoneAfterMin'];rpcDb['createCustomerHistory'](_0x5cb740,_0xbf43('0xf6'));_0x4ed117[_0xbf43('0xa3')](_0x5cb740,'20',_0x17eb9d)['then'](function(_0x38138d){_0x403ff7=_0x38138d[_0xbf43('0xa4')]==0x1;if(!_0x403ff7){if(ut[_0xbf43('0x9d')](_0x5cb740)>=_0x17eb9d[_0xbf43('0xa6')]){_0x1b8511=ut[_0xbf43('0xa7')](_0x5cb740,0xf,_0xbf43('0xca'));rpcDb[_0xbf43('0xa8')](_0x1b8511,_0xbf43('0xf7'));}else{rpcDb[_0xbf43('0xa8')](_0x5cb740,_0xbf43('0xf7'));}delete this['actions'][_0x3595da[_0xbf43('0xae')]];}else{_0x4ed117['swapAdditionalPhones'](_0x5cb740,_0x13edb1,_0x57020c)[_0xbf43('0x83')](function(){});}});}if(!(_0x5cb740[_0xbf43('0x7b')]&&_0x45d6db==='16')){ut[_0xbf43('0x7a')](_0x17eb9d,_0xbf43('0xf8'));logger[_0xbf43('0x6c')](_0xbf43('0xf9'),_0x5cb740[_0xbf43('0xb5')],_0xbf43('0xb6'),_0x17eb9d[_0xbf43('0x24')],_0xbf43('0x70'),_0x17eb9d[_0xbf43('0x4b')]);}if(_0x45d6db!==_0xbf43('0xb2')){delete this[_0xbf43('0x11')][_0x3595da[_0xbf43('0xae')]];delete this[_0xbf43('0x11')][_0x3595da[_0xbf43('0xfa')]];}}};Preview['prototype'][_0xbf43('0xfb')]=function(_0x2814ea,_0x775b96,_0x57d161){if(_[_0xbf43('0xfc')](_0x775b96)&&'object'!==typeof _0x775b96){return;}if(_['isUndefined'](_0x57d161)&&_0xbf43('0xfd')!==typeof _0x57d161){return;}switch(_0x57d161[_0xbf43('0xfe')]){case'0':ut[_0xbf43('0xff')](_0x2814ea,0x0,_0xbf43('0x9e'));rpcDb['createAgentHistory'](_0x2814ea,_0xbf43('0x100'));break;case'3':ut[_0xbf43('0xff')](_0x2814ea,0x3,_0xbf43('0xd0'));rpcDb[_0xbf43('0x101')](_0x2814ea,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xbf43('0xff')](_0x2814ea,0x5,_0xbf43('0xc5'));rpcDb[_0xbf43('0x101')](_0x2814ea,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xbf43('0xff')](_0x2814ea,0x8,_0xbf43('0xd9'));rpcDb[_0xbf43('0x101')](_0x2814ea,_0xbf43('0x102'));break;case'22':ut['logAgent'](_0x2814ea,0x16,_0xbf43('0x103'));rpcDb[_0xbf43('0x101')](_0x2814ea,_0xbf43('0x104'));break;default:ut[_0xbf43('0xff')](_0x2814ea,0xc,_0x57d161[_0xbf43('0xfe')]);rpcDb[_0xbf43('0x101')](_0x2814ea,_0xbf43('0x102'));}ut['updateOriginated'](_0x775b96,_0xbf43('0x105'));logger[_0xbf43('0x6c')]('[originated][decrement][callProgressDetectingAgent]',_0x2814ea['uniqueid'],_0xbf43('0xb6'),_0x775b96[_0xbf43('0x24')],_0xbf43('0x70'),_0x775b96['originated']);delete this[_0xbf43('0x11')][_0x2814ea[_0xbf43('0xb5')]];};Preview[_0xbf43('0xc')][_0xbf43('0xa3')]=function(_0x588b68,_0x54194f,_0x4b1d7b){return Promise[_0xbf43('0x106')]()[_0xbf43('0x83')](cmHopperAdditionalPhone[_0xbf43('0xa3')](_0x588b68,_0x54194f,_0x4b1d7b))['catch'](logger[_0xbf43('0x6c')](_0xbf43('0x107')));};Preview[_0xbf43('0xc')][_0xbf43('0xcd')]=function(_0xe5599d,_0x3d241c,_0x4e5cf7){return Promise[_0xbf43('0x106')]()['then'](cmHopperAdditionalPhone[_0xbf43('0xcd')](_0xe5599d,_0x3d241c,_0x4e5cf7))[_0xbf43('0x78')](logger[_0xbf43('0x6c')]('[swapAdditionalPhone]\x20'));};Preview[_0xbf43('0xc')]['incrementPreviewCounters']=function(_0x1db49c){return Promise['resolve']()[_0xbf43('0x83')](cmHopperAdditionalPhone[_0xbf43('0xb1')](_0x1db49c))['catch'](logger[_0xbf43('0x6c')](_0xbf43('0x108')));};Preview[_0xbf43('0xc')]['checkInBlack']=function(_0x812243,_0x70107,_0xe68be0,_0x191881,_0x3b6496){var _0x5a0d48=this;return new Promise(function(_0x231ec1,_0x7cc682){if(_[_0xbf43('0x6b')](_0x70107)||_[_0xbf43('0x6b')](_0x70107[_0xbf43('0x109')])||_['isNil'](_0x70107[_0xbf43('0x10a')])||_[_0xbf43('0x6b')](_0x70107[_0xbf43('0x74')])){_0x7cc682(ut[_0xbf43('0x5d')](_0xbf43('0x10b'),_0x191881,_0x3b6496));return;}var _0x5a8a21=uuid['v4']();var _0x2c5fcc=_0x5a0d48['campaignsPreview'][_0x70107[_0xbf43('0x6e')][_0xbf43('0x24')]];var _0xf97e04=_0xe68be0?_0x5a0d48[_0xbf43('0x12')][_0xe68be0]['id']:undefined;_0x5a0d48[_0xbf43('0x11')][_0x5a8a21]=new Action(_0x70107,_0x2c5fcc,_0x5a8a21,_0xe68be0,_0xf97e04);var _0x158c10=_0x5a0d48[_0xbf43('0x11')][_0x5a8a21];_0x158c10[_0xbf43('0xd7')]=_0x191881;_0x158c10[_0xbf43('0xad')]=_0x3b6496;_0x158c10[_0xbf43('0x10c')]=_0xe68be0;if(_[_0xbf43('0x10d')](_0x812243)){_0x5a0d48[_0xbf43('0x10e')](_0x158c10,_0x2c5fcc,_0x70107,_0xe68be0)[_0xbf43('0x83')](function(_0x3c970c){logger['info'](_0xbf43('0x10f'),_0xbf43('0x110')+_0x158c10[_0xbf43('0x6f')]+_0xbf43('0x111')+_0x158c10[_0xbf43('0xb0')],JSON[_0xbf43('0x55')](_0x3c970c));ami[_0xbf43('0x21')](_0xbf43('0x112'),ut[_0xbf43('0xa0')](_0x158c10,_0xbf43('0x113'),_0x5a0d48[_0xbf43('0xf')][_0x158c10[_0xbf43('0x6f')]]));_0x231ec1(ut['message'](_0xbf43('0x114')));})[_0xbf43('0x78')](function(_0x3565f4){ut[_0xbf43('0x5f')](_0xbf43('0x115'),_0x3565f4);_0x7cc682(ut[_0xbf43('0x5d')](_0xbf43('0x116'),_0x191881,_0x3b6496));});}else{_0x2c5fcc['outboundBlacklistCallsDay']+=0x1;ut[_0xbf43('0x117')](_0x158c10);rpcDb[_0xbf43('0x118')](_0x158c10,'[Blacklist][error]');delete _0x5a0d48['actions'][_0x5a8a21];_0x7cc682(ut['message'](_0xbf43('0x119'),_0x191881,_0x3b6496));}});};Preview[_0xbf43('0xc')][_0xbf43('0x98')]=function(_0x5963d7){return!_[_0xbf43('0x6b')](_0x5963d7)&&!_[_0xbf43('0x6b')](_0x5963d7[_0xbf43('0x24')])&&!_[_0xbf43('0x6b')](_0x5963d7[_0xbf43('0x53')])&&_0x5963d7[_0xbf43('0x53')]&&!_[_0xbf43('0x6b')](this[_0xbf43('0x10')][util[_0xbf43('0x8d')](_0xbf43('0x11a'),_0x5963d7[_0xbf43('0x24')])])&&!_['isNil'](this[_0xbf43('0x10')][util[_0xbf43('0x8d')]('SIP/%s',_0x5963d7[_0xbf43('0x24')])][_0xbf43('0x11b')])&&(this[_0xbf43('0x10')][util[_0xbf43('0x8d')](_0xbf43('0x11a'),_0x5963d7[_0xbf43('0x24')])]['status']===_0xbf43('0x11c')||this[_0xbf43('0x10')][util[_0xbf43('0x8d')](_0xbf43('0x11a'),_0x5963d7['name'])][_0xbf43('0x11b')]===_0xbf43('0x11d'));};Preview['prototype']['run']=function(_0x16f7a7,_0x45c570){var _0x4574d7=this;return new Promise(function(_0x349a38,_0x157236){_0x4574d7[_0xbf43('0x11e')](_0x16f7a7,_0x45c570)['then'](function(_0x5051e4){_0x349a38(_[_0xbf43('0x11f')](_0x5051e4,[_0xbf43('0x5d')]));})[_0xbf43('0x78')](function(_0x25d63a){if(_0x25d63a[_0xbf43('0x120')]){rpcDb[_0xbf43('0x121')](_0x16f7a7);}if(_0x25d63a[_0xbf43('0x53')]){rpcDb[_0xbf43('0x8c')](_0x16f7a7);}_0x157236(_['pick'](_0x25d63a,['message']));});});};Preview[_0xbf43('0xc')][_0xbf43('0x11e')]=function(_0x214c56,_0x1ae3d1){var _0x2425d4=this;return new Promise(function(_0x2f7107,_0x508707){var _0x19d2a1,_0xe75bb2;rpcDb[_0xbf43('0x122')](_0x214c56)[_0xbf43('0x83')](function(_0xb3dff9){if(!_[_0xbf43('0x6b')](_0xb3dff9[0x0])){_0xe75bb2=_0xb3dff9[0x0]['recallme']?![]:!![];_0x19d2a1=_0xb3dff9[0x0][_0xbf43('0x123')]?!![]:![];_0x19d2a1=_0x1ae3d1?!![]:_0x19d2a1;}var _0xa42696=_0x2425d4[_0xbf43('0x124')](_0xb3dff9);if(_0xa42696[_0xbf43('0x125')]){rpcDb[_0xbf43('0x126')](_[_0xbf43('0x11f')](_0xb3dff9[0x0],[_0xbf43('0x74'),_0xbf43('0x10a')]))['then'](function(_0x19f012){_0x2425d4[_0xbf43('0x127')](_0x19f012,_0xb3dff9[0x0],_0x1ae3d1,_0xe75bb2,_0x19d2a1)[_0xbf43('0x83')](function(_0x1b049f){_0x2f7107(_0x1b049f);})['catch'](function(_0x54f223){_0x508707(_0x54f223);});})['catch'](function(_0xc351aa){ut['logger']('[Preview][checkIsBlackList]',_0xc351aa);_0x508707(ut[_0xbf43('0x5d')]('Call\x20unsuccessful',_0xe75bb2,_0x19d2a1));});}else{_0x508707(ut[_0xbf43('0x5d')](_0xa42696[_0xbf43('0x5d')],_0xe75bb2,_0x19d2a1));}})['catch'](function(_0x1b09fa){ut[_0xbf43('0x5f')]('[Preview][getContactPreview]',_0x1b09fa);_0x508707(ut[_0xbf43('0x5d')]('Call\x20unsuccessful',![],!![]));});});};Preview['prototype'][_0xbf43('0x124')]=function(_0x4621ed){if(_[_0xbf43('0x6b')](_0x4621ed)||_[_0xbf43('0x10d')](_0x4621ed)||!_[_0xbf43('0x6b')](_0x4621ed[0x0]['Agent'])&&_[_0xbf43('0x6b')](_0x4621ed[0x0][_0xbf43('0x88')][_0xbf43('0x24')])){ut[_0xbf43('0x5f')]('[Preview][validateContact][Empty\x20Contact]',_0x4621ed);return{'isValid':![],'message':_0xbf43('0x128')};}var _0x1d547f=this[_0xbf43('0xf')][_0x4621ed[0x0][_0xbf43('0x6e')][_0xbf43('0x24')]];_0x1d547f[_0xbf43('0x5d')]=_0xbf43('0x9a');if(_[_0xbf43('0x6b')](_0x1d547f)){ut[_0xbf43('0x5f')](_0xbf43('0x129'),_0x1d547f);return{'isValid':![],'message':_0xbf43('0x12a')};}if(!this[_0xbf43('0x98')](_0x1d547f[_0xbf43('0x52')])){ut['logger'](_0xbf43('0x12b'),_0xbf43('0x12c')+_0x1d547f[_0xbf43('0x24')]+_0xbf43('0x12d'));if(!this[_0xbf43('0x98')](_0x1d547f[_0xbf43('0x12e')])){ut[_0xbf43('0x5f')](_0xbf43('0x12b'),_0x1d547f['name']+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut['isActive'](_0x1d547f[_0xbf43('0x31')])){ut[_0xbf43('0x5f')](_0xbf43('0x12f'),_0x1d547f[_0xbf43('0x24')]+_0xbf43('0x130'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x1d547f['name']+_0xbf43('0x130')};}return{'isValid':!![],'message':_0xbf43('0x131')};};Preview['prototype'][_0xbf43('0x10e')]=function(_0x117363,_0x3c5680,_0x1846c3,_0xe3b2b4){var _0x452899=this;return new Promise(function(_0x4ae254,_0x38d381){var _0x2d4544=_0x117363[_0xbf43('0xb5')];var _0x270084=_0x452899[_0xbf43('0x98')](_0x3c5680[_0xbf43('0x52')])?util[_0xbf43('0x8d')](_0xbf43('0x132'),_0x3c5680[_0xbf43('0x52')][_0xbf43('0x24')],_['isNil'](_0x3c5680[_0xbf43('0x35')])?'':_0x3c5680['dialPrefix'][_0xbf43('0x133')]()||'',_0x3c5680[_0xbf43('0x134')]>0x0?_0x1846c3['phone'][_0xbf43('0x135')](_0x3c5680[_0xbf43('0x134')]):_0x1846c3['phone']):util[_0xbf43('0x8d')](_0xbf43('0x132'),_[_0xbf43('0x6b')](_0x3c5680[_0xbf43('0x12e')])?_0x3c5680[_0xbf43('0x52')][_0xbf43('0x24')]:_0x3c5680[_0xbf43('0x12e')][_0xbf43('0x24')],_[_0xbf43('0x6b')](_0x3c5680[_0xbf43('0x35')])?'':_0x3c5680[_0xbf43('0x35')][_0xbf43('0x133')]()||'',_0x3c5680[_0xbf43('0x134')]>0x0?_0x1846c3[_0xbf43('0x10a')][_0xbf43('0x135')](_0x3c5680[_0xbf43('0x134')]):_0x1846c3[_0xbf43('0x10a')]);var _0x250064=_0x452899[_0xbf43('0x98')](_0x3c5680[_0xbf43('0x52')])?ut[_0xbf43('0x136')](_0x3c5680[_0xbf43('0x52')][_0xbf43('0x137')],_0x3c5680[_0xbf43('0x138')],_0x3c5680[_0xbf43('0x139')]>0x0?ut[_0xbf43('0x13a')](_0x3c5680[_0xbf43('0x33')],_0x3c5680['dialRandomLastDigitCallerIdNumber']):_0x3c5680[_0xbf43('0x33')]):ut['getCallerId'](_[_0xbf43('0x6b')](_0x3c5680['TrunkBackup'])?_0x3c5680[_0xbf43('0x52')][_0xbf43('0x137')]:_0x3c5680[_0xbf43('0x12e')][_0xbf43('0x137')],_0x3c5680[_0xbf43('0x138')],_0x3c5680['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xbf43('0x13a')](_0x3c5680[_0xbf43('0x33')],_0x3c5680[_0xbf43('0x139')]):_0x3c5680[_0xbf43('0x33')]);if(_0x250064){_0x117363['originatecalleridname']=ut[_0xbf43('0x13b')](_0x250064);_0x117363['originatecalleridnum']=ut[_0xbf43('0x13c')](_0x250064);}var _0x1cd263=ut[_0xbf43('0x13d')](_0x3c5680,_0x1846c3,_0x270084,_0x250064,_0x2d4544,_0x117363);_['merge'](_0x117363,ut[_0xbf43('0x13e')](_0x1cd263));_0x117363[_0xbf43('0x13f')]=moment()[_0xbf43('0x8d')]('YYYY-MM-DD\x20HH:mm:ss');_0x3c5680[_0xbf43('0x140')]=_0x1cd263;ami[_0xbf43('0x76')](ut[_0xbf43('0x141')](_0x117363,_0x3c5680,_0x1cd263,_0x117363[_0xbf43('0xad')],_0xe3b2b4))[_0xbf43('0x83')](function(_0x4ccc31){_0x3c5680[_0xbf43('0x4b')]+=0x1;logger[_0xbf43('0x6c')]('[originated][increment]',_0x2d4544,_0xbf43('0xb6'),_0x3c5680[_0xbf43('0x24')],_0xbf43('0x70'),_0x3c5680['originated']);_0x4ae254(_0x4ccc31);})['catch'](function(_0x157b12){ut[_0xbf43('0xff')](_0x117363,0xe,_0xbf43('0x142'));rpcDb['createAgentHistory'](_0x117363,_0xbf43('0x143'));_0x38d381(_0x157b12);});});};Preview['prototype'][_0xbf43('0x1a')]=function(_0x33bd1e){if(this['actions'][_0x33bd1e['linkedid']]){this['actions'][_0x33bd1e[_0xbf43('0xae')]][_0xbf43('0x77')]=_0x33bd1e['channel'];}};Preview['prototype'][_0xbf43('0x144')]=function(_0x50d947){var _0x366a19=this;var _0xb8d106=this[_0xbf43('0x11')][_0x50d947[_0xbf43('0x145')]];if(_0xb8d106){if(_0xb8d106[_0xbf43('0x10c')]&&this['agents'][_0xb8d106['lookAgent']]){ut[_0xbf43('0x146')](_0xb8d106,this[_0xbf43('0x12')][_0xb8d106['lookAgent']]['name'],this[_0xbf43('0x12')][_0xb8d106[_0xbf43('0x10c')]]['id']);}var _0x96ecde=_[_0xbf43('0x147')](_0xb8d106);_0x96ecde[_0xbf43('0x148')]=moment()[_0xbf43('0x8d')]('YYYY-MM-DD\x20HH:mm:ss');var _0x29ec13=_0x366a19[_0xbf43('0xf')][_0xb8d106['queue']];if(ut['isFailure'](_0x50d947[_0xbf43('0x149')])){if(_0xb8d106[_0xbf43('0xd7')]){rpcDb[_0xbf43('0x121')](_0xb8d106['idContact']);}if(_0xb8d106[_0xbf43('0xad')]){rpcDb[_0xbf43('0x8c')](_0xb8d106[_0xbf43('0xb0')]);}ami[_0xbf43('0x21')](_0xbf43('0x14a'),ut[_0xbf43('0xa0')](_0xb8d106,_0xbf43('0x14b'),this['campaignsPreview'][_0xb8d106['queue']]));this[_0xbf43('0xfb')](_0x96ecde,_0x29ec13,_0x50d947);}else{_0xb8d106[_0xbf43('0x13f')]=moment()['format'](_0xbf43('0x14c'));ut[_0xbf43('0xff')](_0x96ecde,0x4,_0xbf43('0xbf'));rpcDb['createAgentHistory'](_0x96ecde,_0xbf43('0x14d'));}}};Preview[_0xbf43('0xc')][_0xbf43('0x14e')]=function(_0x3f5eb2){var _0x15d577=this[_0xbf43('0x11')][_0x3f5eb2[_0xbf43('0xae')]];var _0x1d963b;if(_0x15d577){_0x1d963b=this[_0xbf43('0xf')][_0x15d577[_0xbf43('0x6f')]];logger[_0xbf43('0x6c')](_0xbf43('0x14f'),_0x3f5eb2[_0xbf43('0xae')],_0xbf43('0xb6'),_0x1d963b[_0xbf43('0x24')],_0xbf43('0x71'),_0x1d963b[_0xbf43('0x29')]);}if(this[_0xbf43('0x11')][_0x3f5eb2[_0xbf43('0xae')]]&&_0x3f5eb2['linkedid']!==_0x3f5eb2[_0xbf43('0xb5')]){if(_0x3f5eb2[_0xbf43('0x150')]==='16'&&this[_0xbf43('0x11')][_0x3f5eb2[_0xbf43('0xae')]][_0xbf43('0x7b')]){this['callProgressDetectingCustomer'](_0x3f5eb2,_0x3f5eb2['linkedid'],_0x3f5eb2[_0xbf43('0x150')]);}else if(this['actions'][_0x3f5eb2[_0xbf43('0xae')]]['dialAnswer']){logger[_0xbf43('0x6c')](_0xbf43('0x151'),_0x3f5eb2[_0xbf43('0xae')],_0x3f5eb2[_0xbf43('0x150')],_0xbf43('0xb6'),_0x1d963b[_0xbf43('0x24')],_0xbf43('0x71'),_0x1d963b[_0xbf43('0x29')]);this[_0xbf43('0x9b')](_0x3f5eb2,_0x3f5eb2[_0xbf43('0xae')],_0x3f5eb2['cause']);}}else if(_0x15d577&&_[_0xbf43('0x6b')](_0x15d577[_0xbf43('0x152')])&&_0x1d963b['dialQueueProject']&&_0x3f5eb2['linkedid']===_0x3f5eb2[_0xbf43('0xb5')]&&_[_0xbf43('0x6b')](_0x3f5eb2[_0xbf43('0xfe')])&&_0x3f5eb2['cause']==='16'&&_0x3f5eb2[_0xbf43('0x153')]==='6'&&_[_0xbf43('0xfc')](_0x15d577['transfer'])){if(_0x15d577[_0xbf43('0xd7')]){rpcDb[_0xbf43('0x121')](_0x15d577[_0xbf43('0xb0')]);}if(_0x15d577[_0xbf43('0xad')]){rpcDb['disableContact'](_0x15d577[_0xbf43('0xb0')]);}_0x3f5eb2[_0xbf43('0xfe')]='22';this['callProgressDetectingAgent'](_0x15d577,_0x1d963b,_0x3f5eb2);}else if(_0x15d577&&_0x15d577[_0xbf43('0x154')]){if(_0x3f5eb2[_0xbf43('0x150')]==='16'&&this['actions'][_0x3f5eb2[_0xbf43('0xae')]]['dialAnswer']){logger[_0xbf43('0x6c')]('[syncHangup][talking][transfer]',_0x3f5eb2['linkedid'],_0x3f5eb2[_0xbf43('0x150')],'\x20Queue',_0x1d963b['name'],_0xbf43('0x71'),_0x1d963b[_0xbf43('0x29')]);this[_0xbf43('0x9b')](_0x3f5eb2,_0x3f5eb2[_0xbf43('0xae')],_0x3f5eb2['cause']);}else if(this[_0xbf43('0x11')][_0x3f5eb2[_0xbf43('0xae')]]['dialAnswer']){logger['info'](_0xbf43('0x151'),_0x3f5eb2[_0xbf43('0xae')],_0x3f5eb2[_0xbf43('0x150')],_0xbf43('0xb6'),_0x1d963b[_0xbf43('0x24')],_0xbf43('0x71'),_0x1d963b[_0xbf43('0x29')]);this[_0xbf43('0x9b')](_0x3f5eb2,_0x3f5eb2['linkedid'],_0x3f5eb2['cause']);}}};Preview['prototype'][_0xbf43('0x155')]=function(_0xea109){if(this[_0xbf43('0x11')][_0xea109[_0xbf43('0xfa')]]&&_0xea109[_0xbf43('0xfa')]!==_0xea109[_0xbf43('0x156')]){this['callProgressDetectingCustomer'](_0xea109,_0xea109[_0xbf43('0xfa')],_0xea109[_0xbf43('0xf2')]);}};Preview[_0xbf43('0xc')][_0xbf43('0x18')]=function(_0x34e4f0){if(this[_0xbf43('0x11')][_0x34e4f0['linkedid']]&&_0x34e4f0[_0xbf43('0xae')]!==_0x34e4f0[_0xbf43('0xb5')]&&!this[_0xbf43('0x11')][_0x34e4f0[_0xbf43('0xae')]][_0xbf43('0x7b')]){if(_0x34e4f0[_0xbf43('0x150')]==='1'){this[_0xbf43('0x9b')](_0x34e4f0,_0x34e4f0['linkedid'],_0x34e4f0[_0xbf43('0x150')]);}}};Preview[_0xbf43('0xc')][_0xbf43('0x157')]=function(_0x527785,_0x4fabdf,_0x3b3db4){if(this[_0xbf43('0x11')][_0x527785]){if(_['isNil'](this[_0xbf43('0x11')][_0x527785][_0xbf43('0x140')])){this[_0xbf43('0x11')][_0x527785][_0xbf43('0x140')]={};}this[_0xbf43('0x11')][_0x527785][_0xbf43('0x140')][_0x4fabdf]=_0x3b3db4;}};Preview[_0xbf43('0xc')][_0xbf43('0x158')]=function(_0x325f20){try{if(!_[_0xbf43('0x6b')](_0x325f20)){if(ut[_0xbf43('0x159')](_[_0xbf43('0x15a')](_0x325f20[_0xbf43('0x15b')])[0x0])){this[_0xbf43('0x157')](_0x325f20['uniqueid'],_[_0xbf43('0x15a')](_0x325f20[_0xbf43('0x15b')])[0x0],_0x325f20[_0xbf43('0x15c')]);}}}catch(_0x5e06e8){logger[_0xbf43('0x15d')](_0xbf43('0x15e'),util[_0xbf43('0x15f')](_0x5e06e8,{'showHidden':![],'depth':null}));}};Preview[_0xbf43('0xc')][_0xbf43('0x1d')]=function(_0x2bb113){if(_0x2bb113){if(this[_0xbf43('0x11')][_0x2bb113['transfertargetlinkedid']]){this[_0xbf43('0x11')][_0x2bb113[_0xbf43('0x160')]][_0xbf43('0x154')]=!![];}}};Preview[_0xbf43('0xc')]['syncBlindTransfer']=function(_0x5b3575){if(_0x5b3575){if(this['actions'][_0x5b3575[_0xbf43('0x161')]]){this['actions'][_0x5b3575[_0xbf43('0x161')]][_0xbf43('0x154')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0x9668=['Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','TrunkBackup','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','execCall','dialPrefix','dialCutDigit','SIP/%s/%s%s','trim','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','response','unlockContact','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','statedesc','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','syncVarSet','filterKey','keys','variable','value','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','util','uuid','ioredis','../../../config/logger','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','redis','defaults','localhost','enqueue','tail','finally','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','hangup','syncHangup','hanguprequest','syncHangupRequest','bind','dialend','syncDialEnd','newexten','syncNewExten','varset','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','type','name','strategy','answered','pTalking','sumBillable','sumHoldTime','talking','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','md5','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','NOT_ACTIVE','logger','\x20is\x20not\x20active','DEACTIVATED','[CampaignPreview]\x20Campaign\x20Queue:\x20','prototype','syncCampaigns','hasOwnProperty','preview','booked','outbound','setMessage','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','stringify','pTalking:\x20','dialAnswer','pick','UserId','VoiceQueueId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','getContactRecallMe','agentReadyId','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','verifyAdditionalPhones','then','additional','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','countnosuchnumberretry','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','responsetime','answertime','[syncHangup][talking][increment]','\x20Queue','custom:agentconnect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','callAdditionalPhoneAfterMin','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerMaxRetry','CONGESTION','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','dialBusyRetryFrequency','CANCEL','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedetry','[callProgressDetectingCustomer][logAbandoned]','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','uniqueid','originated:\x20','ANSWER','destlinkedid','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logCongestion]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','checkInBlack','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','[Preview][execCall][success]','\x20IdHopper:\x20','custom:agentcalled','called','[Preview][execCall][failure]','createHistory','[Blacklist][error]','SIP/%s','unmonitored','execRun','recallme','validateContact','isValid','checkIsBlackList'];(function(_0x19c64a,_0x5de14e){var _0x1b1a06=function(_0x5dd104){while(--_0x5dd104){_0x19c64a['push'](_0x19c64a['shift']());}};_0x1b1a06(++_0x5de14e);}(_0x9668,0x191));var _0x8966=function(_0x3d99bf,_0x248085){_0x3d99bf=_0x3d99bf-0x0;var _0x2dee3b=_0x9668[_0x3d99bf];return _0x2dee3b;};'use strict';var util=require(_0x8966('0x0'));var _=require('lodash');var uuid=require(_0x8966('0x1'));var moment=require('moment');var md5=require('md5');var Redis=require(_0x8966('0x2'));var config=require('../../../config/environment');var logger=require(_0x8966('0x3'))('preview');var loggerAction=require(_0x8966('0x3'))('actionPreview');var ami=require('../ami');var rpcDb=require(_0x8966('0x4'));var cmHopperAdditionalPhone=require(_0x8966('0x5'));var Action=require(_0x8966('0x6'));var ut=require('./util/util');config[_0x8966('0x7')]=_[_0x8966('0x8')](config[_0x8966('0x7')],{'host':_0x8966('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype'][_0x8966('0xa')]=function(_0x46266d){this[_0x8966('0xb')]=this[_0x8966('0xb')]?this[_0x8966('0xb')][_0x8966('0xc')](_0x46266d):_0x46266d();};function Preview(_0x312364){this['sequence']=new Sequence();this[_0x8966('0xd')]=_0x312364['voiceQueues'];this[_0x8966('0xe')]=_0x312364['trunks'];this[_0x8966('0xf')]={};this[_0x8966('0x10')]=_0x312364[_0x8966('0x10')];this[_0x8966('0x11')]=0x0;ami['on'](_0x8966('0x12'),this[_0x8966('0x13')]['bind'](this));ami['on'](_0x8966('0x14'),this[_0x8966('0x15')]['bind'](this));ami['on'](_0x8966('0x16'),this[_0x8966('0x17')][_0x8966('0x18')](this));ami['on'](_0x8966('0x19'),this[_0x8966('0x1a')]['bind'](this));ami['on'](_0x8966('0x1b'),this[_0x8966('0x1c')][_0x8966('0x18')](this));ami['on'](_0x8966('0x1d'),this['syncVarSet']['bind'](this));ami['on']('attendedtransfer',this[_0x8966('0x1e')][_0x8966('0x18')](this));ami['on'](_0x8966('0x1f'),this[_0x8966('0x20')]['bind'](this));this['loopCampaigns'](this['campaignsPreview']);}function emit(_0x4ad16f,_0x55c552,_0x391a33){io['to'](_0x4ad16f)[_0x8966('0x21')](_0x55c552,_0x391a33);}function emitCampaignPreview(_0x5af396){if(_0x5af396[_0x8966('0x22')]==='outbound'){var _0x54a112={'id':_0x5af396['id'],'name':_0x5af396[_0x8966('0x23')],'strategy':_0x5af396[_0x8966('0x24')],'answered':_0x5af396[_0x8966('0x25')],'available':_0x5af396['available'],'loggedIn':_0x5af396['loggedIn'],'pTalking':_0x5af396[_0x8966('0x26')],'sumBillable':_0x5af396[_0x8966('0x27')],'sumDuration':_0x5af396['sumDuration'],'sumHoldTime':_0x5af396[_0x8966('0x28')]||0x0,'talking':_0x5af396[_0x8966('0x29')],'total':_0x5af396['total'],'type':_0x5af396[_0x8966('0x22')],'unmanaged':_0x5af396[_0x8966('0x2a')],'abandoned':_0x5af396[_0x8966('0x2b')],'waiting':_0x5af396['waiting'],'loggedInDb':_0x5af396[_0x8966('0x2c')],'dialActive':_0x5af396[_0x8966('0x2d')],'dialMethod':_0x5af396[_0x8966('0x2e')],'dialOriginateCallerIdName':_0x5af396[_0x8966('0x2f')],'dialOriginateCallerIdNumber':_0x5af396['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x5af396[_0x8966('0x30')],'dialPrefix':_0x5af396['dialPrefix'],'outboundAnswerAgiCallsDay':_0x5af396[_0x8966('0x31')],'outboundAnswerCallsDay':_0x5af396['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x5af396[_0x8966('0x32')],'outboundBusyCallsDay':_0x5af396[_0x8966('0x33')],'outboundCongestionCallsDay':_0x5af396[_0x8966('0x34')],'outboundDropCallsDayACS':_0x5af396[_0x8966('0x35')],'outboundDropCallsDayCallersExit':_0x5af396[_0x8966('0x36')],'outboundDropCallsDayTimeout':_0x5af396['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x5af396[_0x8966('0x37')],'outboundNoSuchCallsDay':_0x5af396['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x5af396[_0x8966('0x38')],'outboundReCallsDay':_0x5af396[_0x8966('0x39')],'outboundRejectCallsDay':_0x5af396[_0x8966('0x3a')],'outboundUnknownCallsDay':_0x5af396[_0x8966('0x3b')],'outboundAbandonedCallsDay':_0x5af396[_0x8966('0x3c')],'predictiveIntervalAnsweredCalls':_0x5af396[_0x8966('0x3d')],'predictiveIntervalAvgHoldtime':_0x5af396[_0x8966('0x3e')],'predictiveIntervalAvgTalktime':_0x5af396[_0x8966('0x3f')],'predictiveIntervalDroppedCallsCallersExit':_0x5af396[_0x8966('0x40')],'predictiveIntervalDroppedCallsTimeout':_0x5af396[_0x8966('0x41')],'predictiveIntervalErlangCalls':_0x5af396[_0x8966('0x42')],'predictiveIntervalErlangCallsDroppedCalls':_0x5af396['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x5af396[_0x8966('0x43')],'predictiveIntervalMultiplicativeFactor':_0x5af396[_0x8966('0x44')],'predictiveIntervalPauses':_0x5af396[_0x8966('0x45')],'predictiveIntervalAvailable':_0x5af396[_0x8966('0x46')],'predictiveIntervalTotalCalls':_0x5af396[_0x8966('0x47')],'message':_0x5af396[_0x8966('0x48')],'originated':_0x5af396[_0x8966('0x49')],'erlangCalls':_0x5af396[_0x8966('0x4a')],'erlangCallToSecond':_0x5af396[_0x8966('0x4b')],'erlangAbandonmentRate':_0x5af396[_0x8966('0x4c')],'erlangBusyFactor':_0x5af396[_0x8966('0x4d')],'startPredictive':_0x5af396[_0x8966('0x4e')],'startProgressive':_0x5af396[_0x8966('0x4f')]};if(_0x5af396['Trunk']){_0x54a112['Trunk']={'id':_0x5af396[_0x8966('0x50')]['id'],'name':_0x5af396['Trunk']['name'],'active':_0x5af396[_0x8966('0x50')][_0x8966('0x51')],'callerid':_0x5af396[_0x8966('0x50')][_0x8966('0x52')]};}if(_0x5af396[_0x8966('0x53')]){_0x54a112[_0x8966('0x53')]={'id':_0x5af396[_0x8966('0x53')]['id'],'name':_0x5af396[_0x8966('0x53')][_0x8966('0x23')]};}var _0x331d66=md5(JSON['stringify'](_0x54a112));if(_0x5af396[_0x8966('0x54')]!==_0x331d66){_0x5af396[_0x8966('0x54')]=_0x331d66;emit(util[_0x8966('0x55')](_0x8966('0x56'),_0x54a112['name']),_0x8966('0x57'),_0x54a112);}}}function emitVoiceQueueChannelRemove(_0x41c6c1){logger[_0x8966('0x58')](_0x8966('0x59'),JSON['stringify'](_0x41c6c1));emit(util[_0x8966('0x55')]('voice:queue:%s',_0x41c6c1[_0x8966('0x23')]),_0x8966('0x5a'),_0x41c6c1);io[_0x8966('0x21')](_0x8966('0x5b'),_0x41c6c1);}function notSendMessagesQueue(_0x2c441d){if(_0x2c441d['sendMessageOneNotActive']){if(_0x2c441d[_0x8966('0x49')]===0x0&&_0x2c441d['pTalking']===0x0){_0x2c441d[_0x8966('0x5c')]=![];_0x2c441d['available']=0x0;_0x2c441d['paused']=0x0;_0x2c441d['message']=_0x8966('0x5d');ut[_0x8966('0x5e')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x2c441d['name']+_0x8966('0x5f'));}else{_0x2c441d[_0x8966('0x48')]=_0x8966('0x60');ut[_0x8966('0x5e')](_0x8966('0x61'),_0x2c441d[_0x8966('0x23')]+'\x20is\x20deactivated');}emitCampaignPreview(_0x2c441d);}}Preview[_0x8966('0x62')]['loopCampaigns']=function(){var _0x255ba1=this;setInterval(function(){_0x255ba1[_0x8966('0x63')]();},0x7cf);};Preview[_0x8966('0x62')][_0x8966('0x63')]=function(){var _0x55dd10=this[_0x8966('0xd')];this[_0x8966('0x11')]+=0x1;for(var _0x1b07c6 in _0x55dd10){if(_0x55dd10[_0x8966('0x64')](_0x1b07c6)&&(_0x55dd10[_0x1b07c6][_0x8966('0x2e')]===_0x8966('0x65')||_0x55dd10[_0x1b07c6][_0x8966('0x2e')]===_0x8966('0x66'))&&_0x55dd10[_0x1b07c6][_0x8966('0x22')]==='outbound'){if(this['clockClearZombieChannels']>0x7){this[_0x8966('0x11')]=0x0;this['clearZombieChannels']();}}if(_0x55dd10[_0x8966('0x64')](_0x1b07c6)&&_0x55dd10[_0x1b07c6][_0x8966('0x2e')]==='preview'&&_0x55dd10[_0x1b07c6][_0x8966('0x22')]===_0x8966('0x67')){if(_0x55dd10[_0x1b07c6]['dialActive']){this[_0x8966('0x68')](_0x55dd10[_0x1b07c6]);if(_0x55dd10[_0x1b07c6]['dialPreviewAutoRecallMe'])this[_0x8966('0x69')](_0x55dd10[_0x1b07c6]);}else{notSendMessagesQueue(_0x55dd10[_0x1b07c6]);}}}};Preview[_0x8966('0x62')][_0x8966('0x6a')]=function(_0x2b4814){var _0x44afb2=this;this['sequence'][_0x8966('0xa')](function(){if(!_[_0x8966('0x6b')](_0x44afb2[_0x8966('0xf')][_0x2b4814])){loggerAction[_0x8966('0x58')](_0x8966('0x6c'),_0x2b4814,_0x8966('0x6d'),_0x44afb2['actions'][_0x2b4814][_0x8966('0x6e')],'originated:\x20',JSON[_0x8966('0x6f')](_0x44afb2[_0x8966('0xd')][_0x44afb2[_0x8966('0xf')][_0x2b4814][_0x8966('0x6e')]][_0x8966('0x49')]),_0x8966('0x70'),JSON['stringify'](_0x44afb2[_0x8966('0xd')][_0x44afb2[_0x8966('0xf')][_0x2b4814][_0x8966('0x6e')]][_0x8966('0x26')]),JSON[_0x8966('0x6f')](_0x44afb2[_0x8966('0xf')][_0x2b4814][_0x8966('0x71')]),JSON['stringify'](_[_0x8966('0x72')](_0x44afb2[_0x8966('0xf')][_0x2b4814],['contactId',_0x8966('0x73'),_0x8966('0x74'),'ListId'])));return ami[_0x8966('0x75')]({'action':_0x8966('0x76'),'channel':_0x44afb2[_0x8966('0xf')][_0x2b4814][_0x8966('0x77')]})[_0x8966('0x78')](function(_0x2ab0df){if(_0x2ab0df[_0x8966('0x48')]===_0x8966('0x79')){setTimeout(function(){if(_0x44afb2[_0x8966('0xf')][_0x2b4814]){ut[_0x8966('0x7a')](_0x44afb2[_0x8966('0xd')][_0x44afb2[_0x8966('0xf')][_0x2b4814][_0x8966('0x6e')]],_0x8966('0x7b'));if(_0x44afb2[_0x8966('0xf')][_0x2b4814]['dialAnswer']===!![]){ut[_0x8966('0x7c')](_0x44afb2[_0x8966('0xd')][_0x44afb2[_0x8966('0xf')][_0x2b4814][_0x8966('0x6e')]],'[clearZombieChannel]');ut[_0x8966('0x7d')](_0x8966('0x7e')+_0x2b4814,_0x44afb2['actions'][_0x2b4814][_0x8966('0x6e')]);}ut[_0x8966('0x7d')](_0x8966('0x7f')+_0x2b4814,_0x44afb2[_0x8966('0xf')][_0x2b4814][_0x8966('0x6e')]);delete _0x44afb2[_0x8966('0xf')][_0x2b4814];}},0x2328);}});}});};Preview['prototype'][_0x8966('0x80')]=function(){var _0x7b6751=this;loggerAction[_0x8966('0x58')](_0x8966('0x81'),_[_0x8966('0x82')](this[_0x8966('0xf')]));for(var _0x162261 in this[_0x8966('0xf')]){if(_0x7b6751['actions'][_0x8966('0x64')](_0x162261)){_0x7b6751['clearZombieChannel'](_0x162261);}}};Preview[_0x8966('0x62')][_0x8966('0x69')]=function(_0x17f19c){var _0x563e56=this;rpcDb[_0x8966('0x83')](_0x17f19c['id'],ut[_0x8966('0x84')](this['agents']))['then'](function(_0x4446d6){if(!_[_0x8966('0x6b')](_0x4446d6)){for(var _0x59bd5c=0x0;_0x59bd5c<_0x4446d6[_0x8966('0x85')];_0x59bd5c+=0x1){if(ut[_0x8966('0x86')](_0x4446d6[_0x59bd5c][_0x8966('0x87')])<_0x17f19c[_0x8966('0x88')]*0x3c){if(_0x4446d6[_0x59bd5c]['Agent']&&!_0x4446d6[_0x59bd5c][_0x8966('0x89')][_0x8966('0x8a')]){_0x563e56[_0x8966('0x8b')](_0x4446d6[_0x59bd5c]['id'])['then'](ut[_0x8966('0x8c')](_0x8966('0x8d')))[_0x8966('0x78')](ut[_0x8966('0x8c')](_0x8966('0x8d')));}else{rpcDb[_0x8966('0x8e')](_0x4446d6[_0x59bd5c]['id']);}}else{var _0x30f4f1=new Action(_0x4446d6[_0x59bd5c],_0x17f19c);_0x30f4f1[_0x8966('0x8f')]=moment()['format'](_0x8966('0x90'));_0x17f19c[_0x8966('0x39')]+=0x1;ut[_0x8966('0x91')](_0x30f4f1,0x17,_0x8966('0x92'));if(_0x17f19c[_0x8966('0x93')]){rpcDb[_0x8966('0x94')](ut[_0x8966('0x95')](_0x4446d6[_0x59bd5c]));rpcDb[_0x8966('0x96')](_0x30f4f1,_0x8966('0x97'));}else{ut[_0x8966('0x91')](_0x30f4f1,0x16,'RecallFailedTimeout');rpcDb[_0x8966('0x96')](_0x30f4f1,_0x8966('0x98'));rpcDb['createCustomerFinal'](_0x30f4f1,_0x8966('0x98'));}}}}})[_0x8966('0x78')](ut[_0x8966('0x8c')](_0x8966('0x99')));};Preview[_0x8966('0x62')][_0x8966('0x68')]=function(_0x1bdb86){_0x1bdb86[_0x8966('0x5c')]=!![];if(ut[_0x8966('0x9a')](_0x1bdb86[_0x8966('0x9b')])){_0x1bdb86[_0x8966('0x48')]=_0x8966('0x9c');}else if(!ut[_0x8966('0x9d')](_0x1bdb86[_0x8966('0x2d')])){_0x1bdb86['message']=_0x8966('0x5d');}else if(!this[_0x8966('0x9e')](_0x1bdb86[_0x8966('0x50')])){if(!this['isTrunkReachable'](_0x1bdb86['TrunkBackup'])){_0x1bdb86[_0x8966('0x48')]='TRUNK_IS_NOT_REACHABLE';}else{_0x1bdb86[_0x8966('0x48')]=_0x8966('0x9f');}}else{_0x1bdb86[_0x8966('0x48')]=_0x8966('0x9f');}emitCampaignPreview(_0x1bdb86);};Preview['prototype'][_0x8966('0xa0')]=function(_0x1d21f7,_0x1158e9,_0x32f303){var _0x5ae460=this;var _0x4c6ed2=this['actions'][_0x1158e9];var _0x403b6a=this['campaignsPreview'][_0x4c6ed2['queue']];var _0x5253a3;var _0x1f3fda=![];var _0x2a17ee=0x2;var _0x31b270=0x3;if(_0x403b6a){switch(_0x32f303){case'1':_0x403b6a[_0x8966('0xa1')]+=0x1;_0x4c6ed2['countnosuchnumberretry']+=0x1;_0x4c6ed2[_0x8966('0xa2')]=ut[_0x8966('0xa3')](_0x4c6ed2);ut[_0x8966('0x91')](_0x4c6ed2,0x0,_0x8966('0xa4'));ami[_0x8966('0x21')](_0x8966('0xa5'),ut[_0x8966('0xa6')](_0x4c6ed2,_0x8966('0xa7')));rpcDb[_0x8966('0x96')](_0x4c6ed2,'[callProgressDetectingCustomer][logNoSuch]');_0x5ae460[_0x8966('0xa8')](_0x4c6ed2,'0',_0x403b6a)[_0x8966('0xa9')](function(_0x488c28){_0x1f3fda=_0x488c28[_0x8966('0xaa')]==0x1;_0x2a17ee=_0x403b6a['dialNoSuchNumberRetryFrequency'];_0x31b270=_0x403b6a['callAdditionalPhoneAfterMin'];if(!_0x1f3fda){if(ut[_0x8966('0xa3')](_0x4c6ed2)>=_0x403b6a[_0x8966('0xab')]){_0x5253a3=ut[_0x8966('0xac')](_0x4c6ed2,0xf,_0x8966('0xad'));rpcDb[_0x8966('0xae')](_0x5253a3,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x4c6ed2[_0x8966('0xaf')]>=_0x403b6a[_0x8966('0xb0')]){rpcDb[_0x8966('0xae')](_0x4c6ed2,_0x8966('0xb1'));}else{rpcDb[_0x8966('0xb2')](ut[_0x8966('0xb3')](_0x4c6ed2,_0x8966('0xaf'),_0x403b6a['dialNoSuchNumberRetryFrequency']),_0x4c6ed2['unlockAgent'],_0x4c6ed2[_0x8966('0xb4')]);}}delete this['actions'][_0x1d21f7[_0x8966('0xb5')]];}else{_0x4c6ed2[_0x8966('0xaf')]++;logger[_0x8966('0x58')](_0x8966('0xb6'),_0x4c6ed2[_0x8966('0xaf')]);logger[_0x8966('0x58')]('id',_0x4c6ed2[_0x8966('0xb7')]);_0x5ae460[_0x8966('0xb8')]({'id':_0x4c6ed2[_0x8966('0xb7')],'field':{'countnosuchnumberretry':_0x4c6ed2[_0x8966('0xaf')]}})[_0x8966('0xa9')](function(){_0x5ae460[_0x8966('0xb9')](_0x4c6ed2,_0x2a17ee,_0x31b270)[_0x8966('0xa9')](function(){});});}});break;case'ANSWER':var _0xe6d84e=moment()[_0x8966('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x4c6ed2[_0x8966('0xba')]=_0xe6d84e;_0x4c6ed2[_0x8966('0xbb')]=_0xe6d84e;_0x4c6ed2[_0x8966('0x71')]=!![];_0x403b6a[_0x8966('0x26')]+=0x1;logger[_0x8966('0x58')](_0x8966('0xbc'),_0x4c6ed2['uniqueid'],_0x8966('0xbd'),_0x403b6a[_0x8966('0x23')],_0x8966('0x70'),_0x403b6a[_0x8966('0x26')]);ami[_0x8966('0x21')](_0x8966('0xbe'),ut[_0x8966('0xa6')](_0x4c6ed2,'connect',this[_0x8966('0xd')][_0x4c6ed2[_0x8966('0x6e')]]));if(_0x403b6a[_0x8966('0xbf')]){ami['emit'](_0x8966('0xc0'),ut[_0x8966('0xc1')](_0x4c6ed2));}break;case'16':ami[_0x8966('0x21')](_0x8966('0xc2'),ut['buildObj'](_0x4c6ed2,_0x8966('0xc3'),this[_0x8966('0xd')][_0x4c6ed2[_0x8966('0x6e')]]));emitVoiceQueueChannelRemove(ut[_0x8966('0xa6')](_0x4c6ed2,_0x8966('0xc3')));_0x403b6a[_0x8966('0xc4')]+=0x1;_0x403b6a['total']+=0x1;_0x403b6a['answered']+=0x1;ut['decrementTalkink'](_0x403b6a,_0x8966('0xc5'));_0x4c6ed2[_0x8966('0xa2')]=ut[_0x8966('0xa3')](_0x4c6ed2);ut[_0x8966('0x91')](_0x4c6ed2,0x4,_0x8966('0xc6'));rpcDb[_0x8966('0x96')](_0x4c6ed2,_0x8966('0xc7'));rpcDb[_0x8966('0xae')](_0x4c6ed2,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x8966('0xc8')](_0x4c6ed2);_0x403b6a[_0x8966('0xc9')]+=_0x4c6ed2[_0x8966('0xca')];_0x403b6a['sumBillable']+=_0x4c6ed2[_0x8966('0xca')];logger[_0x8966('0x58')](_0x8966('0xcb'),_0x4c6ed2['uniqueid'],'\x20Queue',_0x403b6a[_0x8966('0x23')],'pTalking:\x20',_0x403b6a[_0x8966('0x26')]);delete this[_0x8966('0xf')][_0x1d21f7[_0x8966('0xb5')]];break;case _0x8966('0xcc'):_0x403b6a[_0x8966('0x33')]+=0x1;_0x4c6ed2[_0x8966('0xcd')]+=0x1;_0x4c6ed2[_0x8966('0xa2')]=ut['totalGlobal'](_0x4c6ed2);ut[_0x8966('0x91')](_0x4c6ed2,0x5,_0x8966('0xce'));_0x2a17ee=_0x403b6a['dialBusyRetryFrequency'];_0x31b270=_0x403b6a['callAdditionalPhoneAfterMin'];ami['emit'](_0x8966('0xcf'),ut['buildObj'](_0x4c6ed2,_0x8966('0xd0')));rpcDb[_0x8966('0x96')](_0x4c6ed2,_0x8966('0xd1'));_0x5ae460['verifyAdditionalPhones'](_0x4c6ed2,'5',_0x403b6a)[_0x8966('0xa9')](function(_0x5c8fdf){_0x1f3fda=_0x5c8fdf[_0x8966('0xaa')]==0x1;if(!_0x1f3fda){if(ut[_0x8966('0xa3')](_0x4c6ed2)>=_0x403b6a[_0x8966('0xab')]){_0x5253a3=ut[_0x8966('0xac')](_0x4c6ed2,0xf,_0x8966('0xad'));rpcDb[_0x8966('0xae')](_0x5253a3,_0x8966('0xd2'));}else{if(_0x4c6ed2['countbusyretry']>=_0x403b6a[_0x8966('0xd3')]){rpcDb['createCustomerFinal'](_0x4c6ed2,_0x8966('0xd1'));}else{rpcDb[_0x8966('0xb2')](ut[_0x8966('0xb3')](_0x4c6ed2,'countbusyretry',_0x403b6a['dialBusyRetryFrequency']),_0x4c6ed2[_0x8966('0xd4')],_0x4c6ed2['activeContact']);}}}else{_0x4c6ed2['countbusyretry']++;_0x5ae460[_0x8966('0xb8')]({'id':_0x4c6ed2['idContact'],'field':{'countbusyretry':_0x4c6ed2[_0x8966('0xcd')]}})[_0x8966('0xa9')](function(){_0x5ae460['swapAdditionalPhones'](_0x4c6ed2,_0x2a17ee,_0x31b270)['then'](function(){});});}});break;case'NOANSWER':_0x403b6a[_0x8966('0x37')]+=0x1;_0x4c6ed2[_0x8966('0xd5')]+=0x1;_0x4c6ed2['countglobal']=ut[_0x8966('0xa3')](_0x4c6ed2);ut[_0x8966('0x91')](_0x4c6ed2,0x3,_0x8966('0xd6'));_0x2a17ee=_0x403b6a[_0x8966('0xd7')];_0x31b270=_0x403b6a[_0x8966('0xd8')];var _0x369b79=ut[_0x8966('0xd9')](_0x4c6ed2,_0x403b6a);ami[_0x8966('0x21')](_0x8966('0xda'),_0x369b79);rpcDb['createCustomerHistory'](_0x4c6ed2,_0x8966('0xdb'));_0x5ae460[_0x8966('0xa8')](_0x4c6ed2,'3',_0x403b6a)[_0x8966('0xa9')](function(_0x356f80){_0x1f3fda=_0x356f80[_0x8966('0xaa')]==0x1;if(!_0x1f3fda){if(ut[_0x8966('0xa3')](_0x4c6ed2)>=_0x403b6a['dialGlobalMaxRetry']){_0x5253a3=ut['cloneAction'](_0x4c6ed2,0xf,_0x8966('0xad'));rpcDb['createCustomerFinal'](_0x5253a3,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x4c6ed2[_0x8966('0xd5')]>=_0x403b6a[_0x8966('0xdc')]){rpcDb[_0x8966('0xae')](_0x4c6ed2,_0x8966('0xdb'));}else{rpcDb[_0x8966('0xb2')](ut[_0x8966('0xb3')](_0x4c6ed2,_0x8966('0xd5'),_0x403b6a[_0x8966('0xd7')]),_0x4c6ed2['unlockAgent'],_0x4c6ed2[_0x8966('0xb4')]);}}}else{_0x4c6ed2[_0x8966('0xd5')]++;_0x5ae460[_0x8966('0xb8')]({'id':_0x4c6ed2['idContact'],'field':{'countnoanswerretry':_0x4c6ed2[_0x8966('0xd5')]}})[_0x8966('0xa9')](function(){_0x5ae460[_0x8966('0xb9')](_0x4c6ed2,_0x2a17ee,_0x31b270)[_0x8966('0xa9')](function(){});});}});break;case _0x8966('0xdd'):_0x403b6a[_0x8966('0x34')]+=0x1;_0x4c6ed2[_0x8966('0xde')]+=0x1;_0x4c6ed2[_0x8966('0xa2')]=ut['totalGlobal'](_0x4c6ed2);ut['logCustomer'](_0x4c6ed2,0x8,_0x8966('0xdf'));_0x2a17ee=_0x403b6a[_0x8966('0xe0')];_0x31b270=_0x403b6a[_0x8966('0xd8')];ami[_0x8966('0x21')](_0x8966('0xe1'),ut['buildObj'](_0x4c6ed2,_0x8966('0xe2')));rpcDb['createCustomerHistory'](_0x4c6ed2,_0x8966('0xe3'));_0x5ae460[_0x8966('0xa8')](_0x4c6ed2,'8',_0x403b6a)[_0x8966('0xa9')](function(_0x202b46){_0x1f3fda=_0x202b46[_0x8966('0xaa')]==0x1;if(!_0x1f3fda){if(ut[_0x8966('0xa3')](_0x4c6ed2)>=_0x403b6a[_0x8966('0xab')]){_0x5253a3=ut[_0x8966('0xac')](_0x4c6ed2,0xf,_0x8966('0xad'));rpcDb[_0x8966('0xae')](_0x5253a3,_0x8966('0xe4'));}else{if(_0x4c6ed2[_0x8966('0xde')]>=_0x403b6a[_0x8966('0xe5')]){rpcDb[_0x8966('0xae')](_0x4c6ed2,_0x8966('0xe3'));}else{rpcDb[_0x8966('0xb2')](ut[_0x8966('0xb3')](_0x4c6ed2,_0x8966('0xde'),_0x403b6a[_0x8966('0xe6')]),_0x4c6ed2['unlockAgent'],_0x4c6ed2[_0x8966('0xb4')]);}}}else{_0x4c6ed2[_0x8966('0xde')]++;_0x5ae460[_0x8966('0xb8')]({'id':_0x4c6ed2[_0x8966('0xb7')],'field':{'countcongestionretry':_0x4c6ed2[_0x8966('0xde')]}})[_0x8966('0xa9')](function(){_0x5ae460['swapAdditionalPhones'](_0x4c6ed2,_0x2a17ee,_0x31b270)[_0x8966('0xa9')](function(){});});}});break;case _0x8966('0xe7'):_0x403b6a[_0x8966('0x3a')]+=0x1;_0x4c6ed2[_0x8966('0xe8')]+=0x1;_0x4c6ed2[_0x8966('0xa2')]=ut[_0x8966('0xa3')](_0x4c6ed2);ut[_0x8966('0x91')](_0x4c6ed2,0x14,_0x8966('0xe9'));_0x2a17ee=_0x403b6a[_0x8966('0xea')];_0x31b270=_0x403b6a[_0x8966('0xd8')];ami[_0x8966('0x21')](_0x8966('0xeb'),ut[_0x8966('0xa6')](_0x4c6ed2,_0x8966('0xec')));rpcDb['createCustomerHistory'](_0x4c6ed2,_0x8966('0xed'));_0x5ae460[_0x8966('0xa8')](_0x4c6ed2,'20',_0x403b6a)['then'](function(_0x235c41){_0x1f3fda=_0x235c41[_0x8966('0xaa')]==0x1;if(!_0x1f3fda){if(ut[_0x8966('0xa3')](_0x4c6ed2)>=_0x403b6a['dialGlobalMaxRetry']){_0x5253a3=ut[_0x8966('0xac')](_0x4c6ed2,0x14,_0x8966('0xe9'));rpcDb[_0x8966('0xae')](_0x5253a3,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x4c6ed2['countagentrejectretry']>=_0x403b6a[_0x8966('0xee')]){rpcDb[_0x8966('0xae')](_0x4c6ed2,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x8966('0xb2')](ut[_0x8966('0xb3')](_0x4c6ed2,_0x8966('0xe8'),_0x403b6a[_0x8966('0xea')]),_0x4c6ed2[_0x8966('0xd4')],_0x4c6ed2[_0x8966('0xb4')]);}}}else{_0x4c6ed2[_0x8966('0xd5')]++;_0x5ae460[_0x8966('0xb8')]({'id':_0x4c6ed2[_0x8966('0xb7')],'field':{'countnoanswerretry':_0x4c6ed2['countnoanswerretry']}})[_0x8966('0xa9')](function(){_0x5ae460[_0x8966('0xb9')](_0x4c6ed2,_0x2a17ee,_0x31b270)[_0x8966('0xa9')](function(){});});}});break;case _0x8966('0xef'):_0x403b6a[_0x8966('0x3c')]+=0x1;_0x4c6ed2['countabandonedretry']+=0x1;_0x4c6ed2[_0x8966('0xa2')]=ut['totalGlobal'](_0x4c6ed2);ut[_0x8966('0x91')](_0x4c6ed2,0xb,'Abandoned');rpcDb['createCustomerHistory'](_0x4c6ed2,'[callProgressDetectingCustomer][logAbandoned]');_0x5ae460['verifyAdditionalPhones'](_0x4c6ed2,'11',_0x403b6a)[_0x8966('0xa9')](function(_0x58a9f9){_0x1f3fda=_0x58a9f9['additional']==0x1;if(!_0x1f3fda){if(ut[_0x8966('0xa3')](_0x4c6ed2)>=_0x403b6a['dialGlobalMaxRetry']){_0x5253a3=ut[_0x8966('0xac')](_0x4c6ed2,0xf,_0x8966('0xad'));rpcDb[_0x8966('0xae')](_0x5253a3,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x4c6ed2[_0x8966('0xf0')]>=_0x403b6a['dialAbandonedMaxRety']){rpcDb[_0x8966('0xae')](_0x4c6ed2,_0x8966('0xf1'));}else{rpcDb[_0x8966('0xb2')](ut[_0x8966('0xb3')](_0x4c6ed2,_0x8966('0xf2'),_0x403b6a[_0x8966('0xf3')]),_0x4c6ed2[_0x8966('0xd4')],_0x4c6ed2[_0x8966('0xb4')]);}}}else{_0x4c6ed2[_0x8966('0xd5')]++;_0x5ae460[_0x8966('0xb8')]({'id':_0x4c6ed2[_0x8966('0xb7')],'field':{'countnoanswerretry':_0x4c6ed2[_0x8966('0xd5')]}})[_0x8966('0xa9')](function(){_0x5ae460[_0x8966('0xb9')](_0x4c6ed2,_0x2a17ee,_0x31b270)[_0x8966('0xa9')](function(){});});}});break;case'18':_0x403b6a[_0x8966('0x3b')]+=0x1;_0x4c6ed2[_0x8966('0xf4')]+=0x1;_0x4c6ed2['countglobal']=ut['totalGlobal'](_0x4c6ed2);ut[_0x8966('0x91')](_0x4c6ed2,0x12,_0x1d21f7[_0x8966('0xf5')]||_0x1d21f7[_0x8966('0xf6')]);ami[_0x8966('0x21')](_0x8966('0xf7'),ut[_0x8966('0xa6')](_0x4c6ed2,'amd'));rpcDb['createCustomerHistory'](_0x4c6ed2,'[callProgressDetectingCustomer][hangupInAMD]');_0x5ae460[_0x8966('0xa8')](_0x4c6ed2,'18',_0x403b6a)['then'](function(_0xaa989a){_0x1f3fda=_0xaa989a[_0x8966('0xaa')]==0x1;if(!_0x1f3fda){if(ut[_0x8966('0xa3')](_0x4c6ed2)>=_0x403b6a[_0x8966('0xab')]){_0x5253a3=ut[_0x8966('0xac')](_0x4c6ed2,0x12,_0x8966('0xad'));rpcDb[_0x8966('0xae')](_0x5253a3,_0x8966('0xf8'));}else{rpcDb[_0x8966('0xae')](_0x4c6ed2,_0x8966('0xf8'));}}else{_0x4c6ed2[_0x8966('0xd5')]++;_0x5ae460[_0x8966('0xb8')]({'id':_0x4c6ed2['idContact'],'field':{'countnoanswerretry':_0x4c6ed2[_0x8966('0xd5')]}})[_0x8966('0xa9')](function(){_0x5ae460['swapAdditionalPhones'](_0x4c6ed2,_0x2a17ee,_0x31b270)['then'](function(){});});}});delete this[_0x8966('0xf')][_0x1d21f7['linkedid']];break;case'19':_0x403b6a['outboundUnknownCallsDay']+=0x1;_0x4c6ed2[_0x8966('0xa2')]=ut['totalGlobal'](_0x4c6ed2);ut[_0x8966('0x91')](_0x4c6ed2,0x13,_0x1d21f7[_0x8966('0xf5')]||_0x1d21f7[_0x8966('0xf6')]);ami['emit']('custom:amd',ut[_0x8966('0xa6')](_0x4c6ed2,_0x8966('0xf9')));rpcDb[_0x8966('0x96')](_0x4c6ed2,_0x8966('0xfa'));_0x5ae460[_0x8966('0xa8')](_0x4c6ed2,'18',_0x403b6a)[_0x8966('0xa9')](function(_0x4fc0fa){_0x1f3fda=_0x4fc0fa[_0x8966('0xaa')]==0x1;if(!_0x1f3fda){if(ut[_0x8966('0xa3')](_0x4c6ed2)>=_0x403b6a[_0x8966('0xab')]){_0x5253a3=ut['cloneAction'](_0x4c6ed2,0xf,_0x8966('0xad'));rpcDb[_0x8966('0xae')](_0x5253a3,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0x8966('0xae')](_0x4c6ed2,_0x8966('0xfa'));}}else{_0x4c6ed2[_0x8966('0xd5')]++;_0x5ae460[_0x8966('0xb8')]({'id':_0x4c6ed2[_0x8966('0xb7')],'field':{'countnoanswerretry':_0x4c6ed2[_0x8966('0xd5')]}})['then'](function(){_0x5ae460[_0x8966('0xb9')](_0x4c6ed2,_0x2a17ee,_0x31b270)[_0x8966('0xa9')](function(){});});}});delete this[_0x8966('0xf')][_0x1d21f7[_0x8966('0xb5')]];break;default:if(_0x4c6ed2[_0x8966('0x71')]){ut[_0x8966('0x7c')](_0x403b6a,_0x8966('0xfb'));ut[_0x8966('0x7d')](_0x8966('0xfc')+_0x403b6a[_0x8966('0x23')],_0x1d21f7);}_0x403b6a['outboundUnknownCallsDay']+=0x1;_0x4c6ed2[_0x8966('0xa2')]=ut[_0x8966('0xa3')](_0x4c6ed2);ut[_0x8966('0x91')](_0x4c6ed2,0xc,_0x1d21f7['cause-txt']||_0x1d21f7['dialstatus']);_0x2a17ee=_0x403b6a['dialAgentRejectRetryFrequency'];_0x31b270=_0x403b6a[_0x8966('0xd8')];rpcDb['createCustomerHistory'](_0x4c6ed2,_0x8966('0xfd'));_0x5ae460[_0x8966('0xa8')](_0x4c6ed2,'20',_0x403b6a)['then'](function(_0x22c960){_0x1f3fda=_0x22c960['additional']==0x1;if(!_0x1f3fda){if(ut['totalGlobal'](_0x4c6ed2)>=_0x403b6a[_0x8966('0xab')]){_0x5253a3=ut['cloneAction'](_0x4c6ed2,0xf,_0x8966('0xad'));rpcDb[_0x8966('0xae')](_0x5253a3,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x8966('0xae')](_0x4c6ed2,_0x8966('0xfe'));}delete this[_0x8966('0xf')][_0x1d21f7[_0x8966('0xb5')]];}else{_0x5ae460['swapAdditionalPhones'](_0x4c6ed2,_0x2a17ee,_0x31b270)[_0x8966('0xa9')](function(){});}});}if(!(_0x4c6ed2[_0x8966('0x71')]&&_0x32f303==='16')){ut['updateOriginated'](_0x403b6a,'[callProgressDetectingCustomer]');logger[_0x8966('0x58')](_0x8966('0xff'),_0x4c6ed2[_0x8966('0x100')],_0x8966('0xbd'),_0x403b6a[_0x8966('0x23')],_0x8966('0x101'),_0x403b6a[_0x8966('0x49')]);}if(_0x32f303!==_0x8966('0x102')){delete this['actions'][_0x1d21f7[_0x8966('0xb5')]];delete this['actions'][_0x1d21f7[_0x8966('0x103')]];}}};Preview['prototype']['callProgressDetectingAgent']=function(_0x1d79fb,_0x2834a0,_0x531478){if(_[_0x8966('0x104')](_0x2834a0)&&'object'!==typeof _0x2834a0){return;}if(_[_0x8966('0x104')](_0x531478)&&_0x8966('0x105')!==typeof _0x531478){return;}switch(_0x531478[_0x8966('0x106')]){case'0':ut[_0x8966('0x107')](_0x1d79fb,0x0,_0x8966('0xa4'));rpcDb[_0x8966('0x108')](_0x1d79fb,_0x8966('0x109'));break;case'3':ut[_0x8966('0x107')](_0x1d79fb,0x3,_0x8966('0xd6'));rpcDb[_0x8966('0x108')](_0x1d79fb,_0x8966('0x10a'));break;case'5':ut[_0x8966('0x107')](_0x1d79fb,0x5,'Busy');rpcDb[_0x8966('0x108')](_0x1d79fb,_0x8966('0x10b'));break;case'8':ut[_0x8966('0x107')](_0x1d79fb,0x8,_0x8966('0xdf'));rpcDb[_0x8966('0x108')](_0x1d79fb,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x8966('0x107')](_0x1d79fb,0x16,_0x8966('0x10c'));rpcDb[_0x8966('0x108')](_0x1d79fb,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0x1d79fb,0xc,_0x531478[_0x8966('0x106')]);rpcDb[_0x8966('0x108')](_0x1d79fb,_0x8966('0x10d'));}ut[_0x8966('0x7a')](_0x2834a0,'[callProgressDetectingAgent]');logger[_0x8966('0x58')]('[originated][decrement][callProgressDetectingAgent]',_0x1d79fb[_0x8966('0x100')],_0x8966('0xbd'),_0x2834a0[_0x8966('0x23')],'originated:\x20',_0x2834a0[_0x8966('0x49')]);delete this[_0x8966('0xf')][_0x1d79fb[_0x8966('0x100')]];};Preview[_0x8966('0x62')]['verifyAdditionalPhones']=function(_0x317736,_0x23b59c,_0x486851){return Promise['resolve']()[_0x8966('0xa9')](cmHopperAdditionalPhone[_0x8966('0xa8')](_0x317736,_0x23b59c,_0x486851))[_0x8966('0x78')](logger['info'](_0x8966('0x10e')));};Preview[_0x8966('0x62')][_0x8966('0xb9')]=function(_0x2f4f1c,_0x20cb49,_0x46f33e){return Promise['resolve']()[_0x8966('0xa9')](cmHopperAdditionalPhone[_0x8966('0xb9')](_0x2f4f1c,_0x20cb49,_0x46f33e))[_0x8966('0x78')](logger[_0x8966('0x58')](_0x8966('0x10f')));};Preview[_0x8966('0x62')][_0x8966('0xb8')]=function(_0x17aabb){return Promise[_0x8966('0x110')]()[_0x8966('0xa9')](cmHopperAdditionalPhone[_0x8966('0xb8')](_0x17aabb))[_0x8966('0x78')](logger['info'](_0x8966('0x111')));};Preview['prototype'][_0x8966('0x112')]=function(_0x32a121,_0xaa3c75,_0x24a912,_0x18dc98,_0x15f076){var _0x1043f0=this;return new Promise(function(_0x1b0cb7,_0x2239f7){if(_[_0x8966('0x6b')](_0xaa3c75)||_['isNil'](_0xaa3c75['Contact'])||_[_0x8966('0x6b')](_0xaa3c75[_0x8966('0x113')])||_['isNil'](_0xaa3c75[_0x8966('0x74')])){_0x2239f7(ut[_0x8966('0x48')](_0x8966('0x114'),_0x18dc98,_0x15f076));return;}var _0x59e64e=uuid['v4']();var _0x55da9b=_0x1043f0['campaignsPreview'][_0xaa3c75[_0x8966('0x6d')][_0x8966('0x23')]];var _0x402c7e=_0x24a912?_0x1043f0[_0x8966('0x10')][_0x24a912]['id']:undefined;_0x1043f0[_0x8966('0xf')][_0x59e64e]=new Action(_0xaa3c75,_0x55da9b,_0x59e64e,_0x24a912,_0x402c7e);var _0x430a3a=_0x1043f0[_0x8966('0xf')][_0x59e64e];_0x430a3a[_0x8966('0xd4')]=_0x18dc98;_0x430a3a[_0x8966('0xb4')]=_0x15f076;_0x430a3a[_0x8966('0x115')]=_0x24a912;if(_[_0x8966('0x116')](_0x32a121)){_0x1043f0['execCall'](_0x430a3a,_0x55da9b,_0xaa3c75,_0x24a912)[_0x8966('0xa9')](function(_0x16d8cd){logger['info'](_0x8966('0x117'),'Queue:\x20'+_0x430a3a['queue']+_0x8966('0x118')+_0x430a3a[_0x8966('0xb7')],JSON[_0x8966('0x6f')](_0x16d8cd));ami[_0x8966('0x21')](_0x8966('0x119'),ut['buildObj'](_0x430a3a,_0x8966('0x11a'),_0x1043f0['campaignsPreview'][_0x430a3a[_0x8966('0x6e')]]));_0x1b0cb7(ut[_0x8966('0x48')]('Calling'));})['catch'](function(_0x29abfc){ut[_0x8966('0x5e')](_0x8966('0x11b'),_0x29abfc);_0x2239f7(ut[_0x8966('0x48')]('Call\x20failed',_0x18dc98,_0x15f076));});}else{_0x55da9b[_0x8966('0x32')]+=0x1;ut['logBlacklist'](_0x430a3a);rpcDb[_0x8966('0x11c')](_0x430a3a,_0x8966('0x11d'));delete _0x1043f0[_0x8966('0xf')][_0x59e64e];_0x2239f7(ut[_0x8966('0x48')]('Contact\x20in\x20black\x20List',_0x18dc98,_0x15f076));}});};Preview[_0x8966('0x62')]['isTrunkReachable']=function(_0x5ece7f){return!_[_0x8966('0x6b')](_0x5ece7f)&&!_[_0x8966('0x6b')](_0x5ece7f[_0x8966('0x23')])&&!_[_0x8966('0x6b')](_0x5ece7f[_0x8966('0x51')])&&_0x5ece7f[_0x8966('0x51')]&&!_[_0x8966('0x6b')](this[_0x8966('0xe')][util[_0x8966('0x55')](_0x8966('0x11e'),_0x5ece7f[_0x8966('0x23')])])&&!_[_0x8966('0x6b')](this[_0x8966('0xe')][util[_0x8966('0x55')](_0x8966('0x11e'),_0x5ece7f['name'])][_0x8966('0x76')])&&(this[_0x8966('0xe')][util[_0x8966('0x55')]('SIP/%s',_0x5ece7f[_0x8966('0x23')])][_0x8966('0x76')]==='reachable'||this[_0x8966('0xe')][util['format'](_0x8966('0x11e'),_0x5ece7f[_0x8966('0x23')])][_0x8966('0x76')]===_0x8966('0x11f'));};Preview['prototype'][_0x8966('0x8b')]=function(_0x1493a5,_0x229374){var _0x4c0e1e=this;return new Promise(function(_0x1861b9,_0x2f7d24){_0x4c0e1e['execRun'](_0x1493a5,_0x229374)['then'](function(_0x3fad3d){_0x1861b9(_[_0x8966('0x72')](_0x3fad3d,[_0x8966('0x48')]));})[_0x8966('0x78')](function(_0x551165){if(_0x551165['unlock']){rpcDb['unlockContact'](_0x1493a5);}if(_0x551165['active']){rpcDb[_0x8966('0x8e')](_0x1493a5);}_0x2f7d24(_[_0x8966('0x72')](_0x551165,[_0x8966('0x48')]));});});};Preview['prototype'][_0x8966('0x120')]=function(_0x1a5638,_0x589f8f){var _0x25cfe0=this;return new Promise(function(_0x2b31d1,_0x3bd612){var _0x4b5a1a,_0x318d25;rpcDb['getContactPreview'](_0x1a5638)[_0x8966('0xa9')](function(_0x147ccb){if(!_[_0x8966('0x6b')](_0x147ccb[0x0])){_0x318d25=_0x147ccb[0x0]['recallme']?![]:!![];_0x4b5a1a=_0x147ccb[0x0][_0x8966('0x121')]?!![]:![];_0x4b5a1a=_0x589f8f?!![]:_0x4b5a1a;}var _0x4a9271=_0x25cfe0[_0x8966('0x122')](_0x147ccb);if(_0x4a9271[_0x8966('0x123')]){rpcDb[_0x8966('0x124')](_['pick'](_0x147ccb[0x0],['VoiceQueueId',_0x8966('0x113')]))[_0x8966('0xa9')](function(_0x23f509){_0x25cfe0[_0x8966('0x112')](_0x23f509,_0x147ccb[0x0],_0x589f8f,_0x318d25,_0x4b5a1a)[_0x8966('0xa9')](function(_0x4a417d){_0x2b31d1(_0x4a417d);})[_0x8966('0x78')](function(_0x5adeb8){_0x3bd612(_0x5adeb8);});})[_0x8966('0x78')](function(_0x449582){ut[_0x8966('0x5e')]('[Preview][checkIsBlackList]',_0x449582);_0x3bd612(ut[_0x8966('0x48')](_0x8966('0x125'),_0x318d25,_0x4b5a1a));});}else{_0x3bd612(ut['message'](_0x4a9271[_0x8966('0x48')],_0x318d25,_0x4b5a1a));}})[_0x8966('0x78')](function(_0x3ddaef){ut[_0x8966('0x5e')](_0x8966('0x126'),_0x3ddaef);_0x3bd612(ut[_0x8966('0x48')](_0x8966('0x125'),![],!![]));});});};Preview['prototype'][_0x8966('0x122')]=function(_0x292042){if(_[_0x8966('0x6b')](_0x292042)||_[_0x8966('0x116')](_0x292042)||!_['isNil'](_0x292042[0x0][_0x8966('0x89')])&&_[_0x8966('0x6b')](_0x292042[0x0][_0x8966('0x89')][_0x8966('0x23')])){ut[_0x8966('0x5e')](_0x8966('0x127'),_0x292042);return{'isValid':![],'message':_0x8966('0x128')};}var _0x4cce84=this[_0x8966('0xd')][_0x292042[0x0][_0x8966('0x6d')][_0x8966('0x23')]];_0x4cce84[_0x8966('0x48')]=_0x8966('0x9f');if(_[_0x8966('0x6b')](_0x4cce84)){ut[_0x8966('0x5e')](_0x8966('0x129'),_0x4cce84);return{'isValid':![],'message':_0x8966('0x12a')};}if(!this[_0x8966('0x9e')](_0x4cce84[_0x8966('0x50')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x8966('0x12b')+_0x4cce84[_0x8966('0x23')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0x8966('0x9e')](_0x4cce84[_0x8966('0x12c')])){ut[_0x8966('0x5e')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4cce84['name']+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut['isActive'](_0x4cce84[_0x8966('0x2d')])){ut[_0x8966('0x5e')](_0x8966('0x12d'),_0x4cce84[_0x8966('0x23')]+_0x8966('0x12e'));return{'isValid':![],'message':_0x8966('0x12b')+_0x4cce84[_0x8966('0x23')]+_0x8966('0x12e')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x8966('0x62')][_0x8966('0x12f')]=function(_0x32565c,_0x38272f,_0x1cec4a,_0x2e2eaa){var _0x12742b=this;return new Promise(function(_0x22b48a,_0x38d3f4){var _0x1af13c=_0x32565c[_0x8966('0x100')];var _0x14787f=_0x12742b[_0x8966('0x9e')](_0x38272f[_0x8966('0x50')])?util[_0x8966('0x55')]('SIP/%s/%s%s',_0x38272f[_0x8966('0x50')][_0x8966('0x23')],_[_0x8966('0x6b')](_0x38272f[_0x8966('0x130')])?'':_0x38272f[_0x8966('0x130')]['trim']()||'',_0x38272f[_0x8966('0x131')]>0x0?_0x1cec4a[_0x8966('0x113')]['substring'](_0x38272f[_0x8966('0x131')]):_0x1cec4a['phone']):util[_0x8966('0x55')](_0x8966('0x132'),_['isNil'](_0x38272f['TrunkBackup'])?_0x38272f[_0x8966('0x50')][_0x8966('0x23')]:_0x38272f[_0x8966('0x12c')][_0x8966('0x23')],_[_0x8966('0x6b')](_0x38272f['dialPrefix'])?'':_0x38272f[_0x8966('0x130')][_0x8966('0x133')]()||'',_0x38272f[_0x8966('0x131')]>0x0?_0x1cec4a[_0x8966('0x113')][_0x8966('0x134')](_0x38272f[_0x8966('0x131')]):_0x1cec4a[_0x8966('0x113')]);var _0x3870d3=_0x12742b[_0x8966('0x9e')](_0x38272f[_0x8966('0x50')])?ut[_0x8966('0x135')](_0x38272f[_0x8966('0x50')]['callerid'],_0x38272f[_0x8966('0x2f')],_0x38272f[_0x8966('0x136')]>0x0?ut[_0x8966('0x137')](_0x38272f[_0x8966('0x138')],_0x38272f[_0x8966('0x136')]):_0x38272f[_0x8966('0x138')]):ut[_0x8966('0x135')](_[_0x8966('0x6b')](_0x38272f[_0x8966('0x12c')])?_0x38272f[_0x8966('0x50')][_0x8966('0x52')]:_0x38272f[_0x8966('0x12c')][_0x8966('0x52')],_0x38272f['dialOriginateCallerIdName'],_0x38272f['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x38272f[_0x8966('0x138')],_0x38272f[_0x8966('0x136')]):_0x38272f[_0x8966('0x138')]);if(_0x3870d3){_0x32565c[_0x8966('0x139')]=ut[_0x8966('0x13a')](_0x3870d3);_0x32565c[_0x8966('0x13b')]=ut[_0x8966('0x13c')](_0x3870d3);}var _0x2e4e05=ut[_0x8966('0x13d')](_0x38272f,_0x1cec4a,_0x14787f,_0x3870d3,_0x1af13c,_0x32565c);_[_0x8966('0x13e')](_0x32565c,ut[_0x8966('0x13f')](_0x2e4e05));_0x32565c[_0x8966('0x8f')]=moment()[_0x8966('0x55')](_0x8966('0x90'));_0x38272f[_0x8966('0x140')]=_0x2e4e05;ami[_0x8966('0x75')](ut[_0x8966('0x141')](_0x32565c,_0x38272f,_0x2e4e05,_0x32565c[_0x8966('0xb4')],_0x2e2eaa))[_0x8966('0xa9')](function(_0xa11e0){_0x38272f['originated']+=0x1;logger[_0x8966('0x58')](_0x8966('0x142'),_0x1af13c,_0x8966('0xbd'),_0x38272f[_0x8966('0x23')],'originated:\x20',_0x38272f[_0x8966('0x49')]);_0x22b48a(_0xa11e0);})[_0x8966('0x78')](function(_0x18ba09){ut[_0x8966('0x107')](_0x32565c,0xe,_0x8966('0x143'));rpcDb[_0x8966('0x108')](_0x32565c,_0x8966('0x144'));_0x38d3f4(_0x18ba09);});});};Preview[_0x8966('0x62')][_0x8966('0x1c')]=function(_0x36b984){if(this[_0x8966('0xf')][_0x36b984[_0x8966('0xb5')]]){this[_0x8966('0xf')][_0x36b984['linkedid']][_0x8966('0x77')]=_0x36b984['channel'];}};Preview[_0x8966('0x62')][_0x8966('0x13')]=function(_0x4f17cd){var _0x58ae03=this;var _0x402998=this[_0x8966('0xf')][_0x4f17cd[_0x8966('0x145')]];if(_0x402998){if(_0x402998[_0x8966('0x115')]&&this[_0x8966('0x10')][_0x402998[_0x8966('0x115')]]){ut['logLookAgent'](_0x402998,this['agents'][_0x402998[_0x8966('0x115')]][_0x8966('0x23')],this[_0x8966('0x10')][_0x402998['lookAgent']]['id']);}var _0x5ecd3e=_['clone'](_0x402998);_0x5ecd3e['responsetime']=moment()[_0x8966('0x55')](_0x8966('0x90'));var _0x31f385=_0x58ae03[_0x8966('0xd')][_0x402998[_0x8966('0x6e')]];if(ut['isFailure'](_0x4f17cd[_0x8966('0x146')])){if(_0x402998[_0x8966('0xd4')]){rpcDb[_0x8966('0x147')](_0x402998[_0x8966('0xb7')]);}if(_0x402998[_0x8966('0xb4')]){rpcDb[_0x8966('0x8e')](_0x402998[_0x8966('0xb7')]);}ami['emit'](_0x8966('0x148'),ut[_0x8966('0xa6')](_0x402998,'rejected',this['campaignsPreview'][_0x402998[_0x8966('0x6e')]]));this['callProgressDetectingAgent'](_0x5ecd3e,_0x31f385,_0x4f17cd);}else{_0x402998[_0x8966('0x8f')]=moment()[_0x8966('0x55')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x8966('0x107')](_0x5ecd3e,0x4,_0x8966('0xc6'));rpcDb[_0x8966('0x108')](_0x5ecd3e,_0x8966('0x149'));}}};Preview[_0x8966('0x62')][_0x8966('0x15')]=function(_0x499e63){var _0x36cb2c=this[_0x8966('0xf')][_0x499e63['linkedid']];var _0xc76772;if(_0x36cb2c){_0xc76772=this[_0x8966('0xd')][_0x36cb2c[_0x8966('0x6e')]];logger['info']('[syncHangup][talking]',_0x499e63[_0x8966('0xb5')],'\x20Queue',_0xc76772[_0x8966('0x23')],_0x8966('0x70'),_0xc76772[_0x8966('0x26')]);}if(this['actions'][_0x499e63[_0x8966('0xb5')]]&&_0x499e63[_0x8966('0xb5')]!==_0x499e63['uniqueid']){if(_0x499e63[_0x8966('0x14a')]==='16'&&this['actions'][_0x499e63[_0x8966('0xb5')]][_0x8966('0x71')]){this[_0x8966('0xa0')](_0x499e63,_0x499e63['linkedid'],_0x499e63[_0x8966('0x14a')]);}else if(this[_0x8966('0xf')][_0x499e63['linkedid']][_0x8966('0x71')]){logger[_0x8966('0x58')](_0x8966('0x14b'),_0x499e63[_0x8966('0xb5')],_0x499e63[_0x8966('0x14a')],_0x8966('0xbd'),_0xc76772[_0x8966('0x23')],_0x8966('0x70'),_0xc76772[_0x8966('0x26')]);this[_0x8966('0xa0')](_0x499e63,_0x499e63['linkedid'],_0x499e63['cause']);}}else if(_0x36cb2c&&_['isNil'](_0x36cb2c[_0x8966('0x14c')])&&_0xc76772['dialQueueProject']&&_0x499e63[_0x8966('0xb5')]===_0x499e63[_0x8966('0x100')]&&_[_0x8966('0x6b')](_0x499e63[_0x8966('0x106')])&&_0x499e63[_0x8966('0x14a')]==='16'&&_0x499e63[_0x8966('0x14d')]==='6'&&_['isUndefined'](_0x36cb2c[_0x8966('0x14e')])){if(_0x36cb2c[_0x8966('0xd4')]){rpcDb['unlockContact'](_0x36cb2c[_0x8966('0xb7')]);}if(_0x36cb2c[_0x8966('0xb4')]){rpcDb[_0x8966('0x8e')](_0x36cb2c[_0x8966('0xb7')]);}_0x499e63['reason']='22';this['callProgressDetectingAgent'](_0x36cb2c,_0xc76772,_0x499e63);}else if(_0x36cb2c&&_0x36cb2c['transfer']){if(_0x499e63['cause']==='16'&&this[_0x8966('0xf')][_0x499e63['linkedid']][_0x8966('0x71')]){logger[_0x8966('0x58')](_0x8966('0x14f'),_0x499e63[_0x8966('0xb5')],_0x499e63['cause'],_0x8966('0xbd'),_0xc76772['name'],_0x8966('0x70'),_0xc76772[_0x8966('0x26')]);this['callProgressDetectingCustomer'](_0x499e63,_0x499e63['linkedid'],_0x499e63[_0x8966('0x14a')]);}else if(this[_0x8966('0xf')][_0x499e63[_0x8966('0xb5')]]['dialAnswer']){logger['info'](_0x8966('0x14b'),_0x499e63[_0x8966('0xb5')],_0x499e63[_0x8966('0x14a')],_0x8966('0xbd'),_0xc76772[_0x8966('0x23')],_0x8966('0x70'),_0xc76772['pTalking']);this[_0x8966('0xa0')](_0x499e63,_0x499e63['linkedid'],_0x499e63[_0x8966('0x14a')]);}}};Preview[_0x8966('0x62')]['syncDialEnd']=function(_0x5d88ca){if(this['actions'][_0x5d88ca[_0x8966('0x103')]]&&_0x5d88ca[_0x8966('0x103')]!==_0x5d88ca[_0x8966('0x150')]){this[_0x8966('0xa0')](_0x5d88ca,_0x5d88ca[_0x8966('0x103')],_0x5d88ca[_0x8966('0xf6')]);}};Preview[_0x8966('0x62')][_0x8966('0x17')]=function(_0x2fd7d1){if(this[_0x8966('0xf')][_0x2fd7d1[_0x8966('0xb5')]]&&_0x2fd7d1['linkedid']!==_0x2fd7d1[_0x8966('0x100')]&&!this[_0x8966('0xf')][_0x2fd7d1[_0x8966('0xb5')]]['dialAnswer']){if(_0x2fd7d1[_0x8966('0x14a')]==='1'){this[_0x8966('0xa0')](_0x2fd7d1,_0x2fd7d1[_0x8966('0xb5')],_0x2fd7d1[_0x8966('0x14a')]);}}};Preview[_0x8966('0x62')][_0x8966('0x151')]=function(_0x342e71,_0x1f4cae,_0xd26cd3){if(this[_0x8966('0xf')][_0x342e71]){if(_['isNil'](this[_0x8966('0xf')][_0x342e71]['variables'])){this[_0x8966('0xf')][_0x342e71]['variables']={};}this[_0x8966('0xf')][_0x342e71][_0x8966('0x140')][_0x1f4cae]=_0xd26cd3;}};Preview['prototype'][_0x8966('0x152')]=function(_0x21ffb0){try{if(!_['isNil'](_0x21ffb0)){if(ut[_0x8966('0x153')](_[_0x8966('0x154')](_0x21ffb0['variable'])[0x0])){this[_0x8966('0x151')](_0x21ffb0[_0x8966('0x100')],_[_0x8966('0x154')](_0x21ffb0[_0x8966('0x155')])[0x0],_0x21ffb0[_0x8966('0x156')]);}}}catch(_0x3ddc62){logger['error'](_0x8966('0x157'),util[_0x8966('0x158')](_0x3ddc62,{'showHidden':![],'depth':null}));}};Preview[_0x8966('0x62')]['syncAttendedTransfer']=function(_0x435e00){if(_0x435e00){if(this[_0x8966('0xf')][_0x435e00[_0x8966('0x159')]]){this[_0x8966('0xf')][_0x435e00['transfertargetlinkedid']][_0x8966('0x14e')]=!![];}}};Preview['prototype']['syncBlindTransfer']=function(_0x43c910){if(_0x43c910){if(this[_0x8966('0xf')][_0x43c910[_0x8966('0x15a')]]){this[_0x8966('0xf')][_0x43c910['transfererlinkedid']]['transfer']=!![];}}};module['exports']=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index e8de5dc..0b009b6 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 _0x366e=['type','calleridnum','calleridname','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','../../../config/logger','lodash','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue'];(function(_0x53f04f,_0x419aa8){var _0x16a824=function(_0x5712c9){while(--_0x5712c9){_0x53f04f['push'](_0x53f04f['shift']());}};_0x16a824(++_0x419aa8);}(_0x366e,0x84));var _0xe366=function(_0x4303c4,_0x5d1357){_0x4303c4=_0x4303c4-0x0;var _0x80c167=_0x366e[_0x4303c4];return _0x80c167;};'use strict';var util=require(_0xe366('0x0'));var BPromise=require(_0xe366('0x1'));var logger=require(_0xe366('0x2'))('preview');var _=require(_0xe366('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xe366('0x4'));var cmHopperBlack=require(_0xe366('0x5'));var voiceQueueRt=require(_0xe366('0x6'));var agentReportPreview=require(_0xe366('0x7'));var voiceQueueReport=require(_0xe366('0x8'));function loggerCatch(_0x33df62){return function(_0x21dc26){logger[_0xe366('0x9')](_0x33df62,util['inspect'](_0x21dc26,{'showHidden':![],'depth':null}));};}function create(_0x391402){return BPromise[_0xe366('0xa')]()[_0xe366('0xb')](cmHopperHistory[_0xe366('0xc')](_0x391402))[_0xe366('0xd')](loggerCatch(_0xe366('0xe')));}function createAgent(_0x5bc80f){return BPromise[_0xe366('0xa')]()['then'](agentReportPreview[_0xe366('0xc')](_0x5bc80f))[_0xe366('0xd')](loggerCatch(_0xe366('0xe')));}function moveContact(_0x50b5fc){return BPromise[_0xe366('0xa')]()[_0xe366('0xb')](cmHopper[_0xe366('0xf')](_0x50b5fc,!![]))[_0xe366('0xd')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xe366('0x10')]=function(_0x4ce98b){return BPromise[_0xe366('0xa')]()['then'](cmHopperBlack['checkIsBlackList'](_0x4ce98b))[_0xe366('0xd')](loggerCatch(_0xe366('0x11')));};exports['getContactPreview']=function(_0x3d5014){return BPromise[_0xe366('0xa')]()[_0xe366('0xb')](cmHopper[_0xe366('0x12')](_0x3d5014))[_0xe366('0xd')](loggerCatch(_0xe366('0x13')));};exports[_0xe366('0xc')]=function(_0x503841,_0x3c45e8){create(_0x503841)[_0xe366('0xd')](loggerCatch(_0x3c45e8));moveContact(_0x503841)['catch'](loggerCatch(_0x3c45e8));};exports[_0xe366('0x14')]=function(_0x4c8dda,_0x34a820){createAgent(_0x4c8dda)['catch'](loggerCatch(_0x34a820));};exports[_0xe366('0x15')]=function(_0x46e4a7,_0x5c28b2){create(_0x46e4a7)[_0xe366('0xd')](loggerCatch(_0x5c28b2));};exports[_0xe366('0x16')]=function(_0x11c4f5,_0x451ff7){moveContact(_0x11c4f5)[_0xe366('0xd')](loggerCatch(_0x451ff7));};exports['rescheduleContact']=function(_0x41a28b,_0x2a27a6,_0x549adc){if(_0x2a27a6){_0x41a28b[_0xe366('0x17')]=null;}if(_0x549adc){_0x41a28b[_0xe366('0x18')]=![];}return BPromise[_0xe366('0xa')]()[_0xe366('0xb')](cmHopper[_0xe366('0x19')](_0x41a28b))[_0xe366('0xd')](loggerCatch(_0xe366('0x1a')));};exports[_0xe366('0x1b')]=function(_0x15b6fe){return BPromise[_0xe366('0xa')]()[_0xe366('0xb')](cmHopper['countReScheduled'](_0x15b6fe))[_0xe366('0xd')](loggerCatch(_0xe366('0x1c')));};exports[_0xe366('0x1d')]=function(_0x1a7c27){return BPromise[_0xe366('0xa')]()[_0xe366('0xb')](cmHopper['unlockContact']({'UserId':null},_0x1a7c27,0x1))[_0xe366('0xd')](loggerCatch(_0xe366('0x1e')));};exports[_0xe366('0x1f')]=function(_0x1bc5b1){return BPromise[_0xe366('0xa')]()['then'](cmHopper[_0xe366('0x1d')]({'active':![]},_0x1bc5b1,0x1))[_0xe366('0xd')](loggerCatch('[activeContact]\x20'));};exports[_0xe366('0x20')]=function(_0x2d2cab){var _0xcdd5e1={};_0xcdd5e1[_0xe366('0x21')]=_0x2d2cab[_0xe366('0x21')];_0xcdd5e1['uniqueid']=_0x2d2cab['uniqueid'];_0xcdd5e1[_0xe366('0x22')]=_0x2d2cab[_0xe366('0x22')];_0xcdd5e1[_0xe366('0x23')]=_0x2d2cab['calleridname'];_0xcdd5e1['queue']=_0x2d2cab['queue'];_0xcdd5e1[_0xe366('0x24')]=_0x2d2cab[_0xe366('0x25')];_0xcdd5e1['queuecallerleaveAt']=_0x2d2cab[_0xe366('0x25')];_0xcdd5e1[_0xe366('0x26')]=0x1;_0xcdd5e1[_0xe366('0x27')]=_0x2d2cab['endtime'];_0xcdd5e1[_0xe366('0x28')]=_0x2d2cab[_0xe366('0x29')];_0xcdd5e1[_0xe366('0x2a')]=_0xe366('0x2b');_0xcdd5e1[_0xe366('0x2c')]=_0xe366('0x2d');_0xcdd5e1[_0xe366('0x2e')]=0x0;_0xcdd5e1[_0xe366('0x2f')]=0x1;_0xcdd5e1[_0xe366('0x30')]=_0x2d2cab[_0xe366('0x29')];_0xcdd5e1[_0xe366('0x31')]='COMPLETED';return BPromise[_0xe366('0xa')]()[_0xe366('0xb')](voiceQueueReport[_0xe366('0x32')](_0xcdd5e1))[_0xe366('0xd')](loggerCatch(_0xe366('0x33')));};exports[_0xe366('0x34')]=function(_0x57bc1a,_0x37d398){return BPromise['resolve']()[_0xe366('0xb')](cmHopper['getContactRecallMe'](_0x57bc1a,_0x37d398))[_0xe366('0xd')](loggerCatch(_0xe366('0x35')));};exports[_0xe366('0x36')]=function(_0x50fa7e){return BPromise[_0xe366('0xa')]()[_0xe366('0xb')](cmHopper['rescheduleContact'](_0x50fa7e,!![],!![]))['catch'](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0x4f96=['queuecallerexitreason','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','inspect','resolve','then','createHistory','[createHistory]\x20','catch','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','lastAssignedTo'];(function(_0x4ffa5a,_0x2fec21){var _0x5d941f=function(_0x3bcfd5){while(--_0x3bcfd5){_0x4ffa5a['push'](_0x4ffa5a['shift']());}};_0x5d941f(++_0x2fec21);}(_0x4f96,0x13e));var _0x64f9=function(_0x1d226a,_0x1f7c93){_0x1d226a=_0x1d226a-0x0;var _0x49ad84=_0x4f96[_0x1d226a];return _0x49ad84;};'use strict';var util=require('util');var BPromise=require(_0x64f9('0x0'));var logger=require(_0x64f9('0x1'))(_0x64f9('0x2'));var _=require(_0x64f9('0x3'));var cmHopper=require(_0x64f9('0x4'));var cmHopperFinal=require(_0x64f9('0x5'));var cmHopperHistory=require(_0x64f9('0x6'));var cmHopperBlack=require(_0x64f9('0x7'));var voiceQueueRt=require(_0x64f9('0x8'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x64f9('0x9'));function loggerCatch(_0x2c363d){return function(_0x3ddfb9){logger['error'](_0x2c363d,util[_0x64f9('0xa')](_0x3ddfb9,{'showHidden':![],'depth':null}));};}function create(_0x1805e6){return BPromise[_0x64f9('0xb')]()[_0x64f9('0xc')](cmHopperHistory[_0x64f9('0xd')](_0x1805e6))['catch'](loggerCatch(_0x64f9('0xe')));}function createAgent(_0x2f2530){return BPromise['resolve']()[_0x64f9('0xc')](agentReportPreview['createHistory'](_0x2f2530))[_0x64f9('0xf')](loggerCatch(_0x64f9('0xe')));}function moveContact(_0x5e0ef6){return BPromise[_0x64f9('0xb')]()[_0x64f9('0xc')](cmHopper[_0x64f9('0x10')](_0x5e0ef6,!![]))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x64f9('0x11')]=function(_0x40e312){return BPromise[_0x64f9('0xb')]()[_0x64f9('0xc')](cmHopperBlack[_0x64f9('0x11')](_0x40e312))[_0x64f9('0xf')](loggerCatch(_0x64f9('0x12')));};exports[_0x64f9('0x13')]=function(_0x150c26){return BPromise[_0x64f9('0xb')]()[_0x64f9('0xc')](cmHopper['getContactPreview'](_0x150c26))[_0x64f9('0xf')](loggerCatch(_0x64f9('0x14')));};exports['createHistory']=function(_0x151d84,_0x3470db){create(_0x151d84)['catch'](loggerCatch(_0x3470db));moveContact(_0x151d84)[_0x64f9('0xf')](loggerCatch(_0x3470db));};exports[_0x64f9('0x15')]=function(_0xa97161,_0xca98a9){createAgent(_0xa97161)[_0x64f9('0xf')](loggerCatch(_0xca98a9));};exports[_0x64f9('0x16')]=function(_0x4b4d37,_0x3139ac){create(_0x4b4d37)[_0x64f9('0xf')](loggerCatch(_0x3139ac));};exports[_0x64f9('0x17')]=function(_0x49db74,_0x5ae3af){moveContact(_0x49db74)['catch'](loggerCatch(_0x5ae3af));};exports[_0x64f9('0x18')]=function(_0x476ac8,_0x14125f,_0x3e69e4){if(_0x14125f){_0x476ac8[_0x64f9('0x19')]=null;}if(_0x3e69e4){_0x476ac8['active']=![];}return BPromise[_0x64f9('0xb')]()[_0x64f9('0xc')](cmHopper[_0x64f9('0x18')](_0x476ac8))[_0x64f9('0xf')](loggerCatch('[rescheduleContact]\x20'));};exports['countReScheduled']=function(_0x51219e){return BPromise[_0x64f9('0xb')]()[_0x64f9('0xc')](cmHopper['countReScheduled'](_0x51219e))[_0x64f9('0xf')](loggerCatch(_0x64f9('0x1a')));};exports[_0x64f9('0x1b')]=function(_0x4bdf71){return BPromise[_0x64f9('0xb')]()['then'](cmHopper[_0x64f9('0x1b')]({'UserId':null},_0x4bdf71,0x1))[_0x64f9('0xf')](loggerCatch('[unlockContact]\x20'));};exports[_0x64f9('0x1c')]=function(_0xa453fb){return BPromise[_0x64f9('0xb')]()[_0x64f9('0xc')](cmHopper[_0x64f9('0x1b')]({'active':![]},_0xa453fb,0x1))[_0x64f9('0xf')](loggerCatch(_0x64f9('0x1d')));};exports['crateCustomerReportQueue']=function(_0x4f2b95){var _0x5901d2={};_0x5901d2[_0x64f9('0x1e')]=_0x4f2b95[_0x64f9('0x1e')];_0x5901d2[_0x64f9('0x1f')]=_0x4f2b95[_0x64f9('0x1f')];_0x5901d2[_0x64f9('0x20')]=_0x4f2b95['calleridnum'];_0x5901d2[_0x64f9('0x21')]=_0x4f2b95[_0x64f9('0x21')];_0x5901d2[_0x64f9('0x22')]=_0x4f2b95[_0x64f9('0x22')];_0x5901d2['queuecallerjoinAt']=_0x4f2b95[_0x64f9('0x23')];_0x5901d2[_0x64f9('0x24')]=_0x4f2b95[_0x64f9('0x23')];_0x5901d2[_0x64f9('0x25')]=0x1;_0x5901d2['queuecallercompleteAt']=_0x4f2b95['endtime'];_0x5901d2[_0x64f9('0x26')]=_0x4f2b95[_0x64f9('0x27')];_0x5901d2[_0x64f9('0x28')]=_0x64f9('0x29');_0x5901d2[_0x64f9('0x2a')]=_0x64f9('0x2b');_0x5901d2[_0x64f9('0x2c')]=0x0;_0x5901d2['assigned']=0x1;_0x5901d2[_0x64f9('0x2d')]=_0x4f2b95[_0x64f9('0x27')];_0x5901d2[_0x64f9('0x2e')]=_0x64f9('0x2f');return BPromise[_0x64f9('0xb')]()['then'](voiceQueueReport[_0x64f9('0x30')](_0x5901d2))[_0x64f9('0xf')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x64f9('0x31')]=function(_0x3716bd,_0x4258ad){return BPromise[_0x64f9('0xb')]()['then'](cmHopper[_0x64f9('0x31')](_0x3716bd,_0x4258ad))['catch'](loggerCatch(_0x64f9('0x32')));};exports[_0x64f9('0x33')]=function(_0x24eef0){return BPromise[_0x64f9('0xb')]()[_0x64f9('0xc')](cmHopper[_0x64f9('0x18')](_0x24eef0,!![],!![]))['catch'](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 046b4fa..06c5a14 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 _0xbc82=['variables','keys','forEach','buildNoAnswerEventPayload','util','lodash','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','info','inspect','logger2','message','getCallerId','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','addVariables','Queue','name','calleridname','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','isNil','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','starttime','endtime','state','statedesc','responsetime','membername','UserId','logCustomer','ringtime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','calleridnum','from-sip','timeout','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','Global','active','add','minutes','ContactId','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','agentReadyId','status','reachable','push','filterKey','idContact','type','campaigntype','dialAnswer','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosbridged','rtpaudioqosrttbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','match','extractCalleridNumber','noanswer'];(function(_0x3b1566,_0x4bfc27){var _0x43b4a1=function(_0x43df84){while(--_0x43df84){_0x3b1566['push'](_0x3b1566['shift']());}};_0x43b4a1(++_0x4bfc27);}(_0xbc82,0x11c));var _0x2bc8=function(_0x4c3174,_0x5f05b3){_0x4c3174=_0x4c3174-0x0;var _0x5eff20=_0xbc82[_0x4c3174];return _0x5eff20;};'use strict';var util=require(_0x2bc8('0x0'));var _=require(_0x2bc8('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')(_0x2bc8('0x2'));var ipAgi=process['env'][_0x2bc8('0x3')]||_0x2bc8('0x4');function getSeconds(_0x2d1259,_0x2e66cc){var _0x995390=moment(_0x2d1259)[_0x2bc8('0x5')](0x0);var _0x132bc9=moment(_0x2e66cc)[_0x2bc8('0x5')](0x0);return _0x995390[_0x2bc8('0x6')](_0x132bc9,_0x2bc8('0x7'));}exports[_0x2bc8('0x8')]=function(_0x4ba579){return function(_0x345eb0){logger[_0x2bc8('0x9')](_0x4ba579,util['inspect'](_0x345eb0,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x315d17,_0x3c4106){logger[_0x2bc8('0xa')](_0x315d17,util['inspect'](_0x3c4106,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x33a32a,_0x2802ef){logger[_0x2bc8('0x9')](_0x33a32a,util[_0x2bc8('0xb')](_0x2802ef,{'showHidden':![],'depth':null}));};exports[_0x2bc8('0xc')]=function(_0x2ed8ec){return function(_0x636de6){logger[_0x2bc8('0xa')](_0x2ed8ec,util[_0x2bc8('0xb')](_0x636de6,{'showHidden':![],'depth':null}));};};exports[_0x2bc8('0xd')]=function(_0x5b1bec,_0x1438ad,_0x46b4a6){return{'message':_0x5b1bec,'unlock':_0x1438ad,'active':_0x46b4a6};};exports[_0x2bc8('0xe')]=function(_0x1642c9,_0x56bfa0,_0x3143b8){if(!_['isUndefined'](_0x3143b8)&&_0x2bc8('0xf')===typeof _0x3143b8&&!_[_0x2bc8('0x10')](_0x3143b8)){if(!_['isUndefined'](_0x56bfa0)&&_0x2bc8('0xf')===typeof _0x56bfa0&&!_[_0x2bc8('0x10')](_0x56bfa0)){return util[_0x2bc8('0x11')]('\x22%s\x22\x20<%s>',_0x56bfa0,_0x3143b8);}return util['format'](_0x2bc8('0x12'),_0x3143b8,_0x3143b8);}if(!_['isUndefined'](_0x1642c9)&&'string'===typeof _0x1642c9&&!_[_0x2bc8('0x10')](_0x1642c9)){return _0x1642c9;}return'\x22\x22\x20<>';};exports[_0x2bc8('0x13')]=function(_0x5e8226){if(_['isNil'](_0x5e8226)){return![];}return _0x5e8226;};exports[_0x2bc8('0x14')]=function(_0x4bc26f,_0x2e4207,_0x5155b1,_0x58bf16,_0x3d9029,_0x251f02){var _0xe7bc12={'XMD-QUEUE':_0x2e4207['Queue']?_0x2e4207[_0x2bc8('0x15')][_0x2bc8('0x16')]:'','XMD-CALLERID':_0x58bf16,'XMD-CALLERID-PREVIEW':_0x251f02?util[_0x2bc8('0x11')]('\x22%s\x22\x20<%s>',_0x251f02[_0x2bc8('0x17')],_0x251f02['calleridnum']):_0x58bf16,'XMD-DIALID':_0x3d9029,'XMD-CONTACTID':_0x2e4207['ContactId'],'XMD-CDRTYPE':_0x2bc8('0x18'),'CALLERID(all)':_0x58bf16,'XMD-VOICEQUEUEID':_0x2e4207[_0x2bc8('0x19')],'XMD-DIALCHANNEL':_0x5155b1,'XMD-DIALTIMEOUT':_0x4bc26f[_0x2bc8('0x1a')]||0x1e,'XMD-DIALOPTIONS':util[_0x2bc8('0x11')]('\x22rtTxX%s%s\x22',_0x4bc26f[_0x2bc8('0x1b')]?'g':'',_['isEmpty'](_0x4bc26f[_0x2bc8('0x1c')])?'':_0x2bc8('0x1d')),'XMD-DIALURL':_0x4bc26f[_0x2bc8('0x1e')]||'','XMD-AGI':_0x4bc26f[_0x2bc8('0x1f')]?util['format'](_0x2bc8('0x20'),ipAgi,_0x4bc26f[_0x2bc8('0x1f')]):'NONE','XMD-AGIAFTER':_0x4bc26f[_0x2bc8('0x1b')]?util['format'](_0x2bc8('0x20'),ipAgi,_0x4bc26f[_0x2bc8('0x1b')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x251f02?_0x251f02[_0x2bc8('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x251f02?_0x251f02[_0x2bc8('0x22')]:'','XMD-DESTINATION':_0x2bc8('0x23'),'SIPADDHEADER':_0x2bc8('0x24')};if(!_['isEmpty'](_0x4bc26f[_0x2bc8('0x1c')])){_0xe7bc12[util[_0x2bc8('0x11')]('%s',_0x2bc8('0x25'))]=_0x4bc26f[_0x2bc8('0x1c')];_0xe7bc12[util[_0x2bc8('0x11')]('%s',_0x2bc8('0x26'))]=_0x3d9029;}if(_0x2e4207&&_0x2e4207[_0x2bc8('0x27')]){for(var _0x474f0a in _0x2e4207[_0x2bc8('0x27')]){if(_0x2e4207['Contact'][_0x2bc8('0x28')](_0x474f0a)){if(!_['isNil'](_0x2e4207[_0x2bc8('0x27')][_0x474f0a])&&_0x474f0a!=='id'&&_0x474f0a!==_0x2bc8('0x29')&&_0x474f0a!==_0x2bc8('0x2a')&&_0x474f0a!==_0x2bc8('0x2b')){_0xe7bc12[util[_0x2bc8('0x11')]('%s%s',_0x2bc8('0x2c'),_[_0x2bc8('0x2d')](_0x474f0a))]=_0x2e4207[_0x2bc8('0x27')][_0x474f0a];}}}}return _0xe7bc12;};exports[_0x2bc8('0x2e')]=function(_0x2e0e80){var _0x49f505={};for(var _0x25361b in _0x2e0e80){if(_0x2e0e80[_0x2bc8('0x28')](_0x25361b)){_0x49f505[util['format']('%s',_[_0x2bc8('0x2f')](_0x25361b))]=_0x2e0e80[_0x25361b];}}return{'variables':_0x49f505};};exports[_0x2bc8('0x30')]=function(_0x2fe01d,_0x5663d3){if(!_[_0x2bc8('0x31')](_0x2fe01d)){if(_0x2fe01d[_0x2bc8('0x28')](_0x2bc8('0x32'))){if(_0x2fe01d['originated']>0x0){_0x2fe01d['originated']-=0x1;}else{logger[_0x2bc8('0x9')](_0x2bc8('0x33'),_0x5663d3);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x5663d3);}};exports[_0x2bc8('0x34')]=function(_0x3948fa){var _0x4a28f5=moment()[_0x2bc8('0x11')](_0x2bc8('0x35'));_0x3948fa['state']=0xd;_0x3948fa['statedesc']='Blacklist';_0x3948fa[_0x2bc8('0x36')]=_0x4a28f5;_0x3948fa['responsetime']=_0x4a28f5;_0x3948fa[_0x2bc8('0x37')]=_0x4a28f5;};exports['logAgent']=function(_0x11d4a6,_0x93dc17,_0x175347){var _0x1d4645=moment()[_0x2bc8('0x11')](_0x2bc8('0x35'));_0x11d4a6[_0x2bc8('0x38')]=_0x93dc17;_0x11d4a6[_0x2bc8('0x39')]=_0x175347;_0x11d4a6[_0x2bc8('0x3a')]=_0x1d4645;_0x11d4a6['ringtime']=getSeconds(_0x11d4a6[_0x2bc8('0x3a')],_0x11d4a6[_0x2bc8('0x36')]);};exports['logLookAgent']=function(_0x22cf23,_0x5d08ba,_0x593ecc){_0x22cf23[_0x2bc8('0x3b')]=_0x5d08ba;_0x22cf23[_0x2bc8('0x3c')]=_0x593ecc;};exports[_0x2bc8('0x3d')]=function(_0x4ec393,_0xd70731,_0x49aa89){var _0x5e4057=moment()[_0x2bc8('0x11')](_0x2bc8('0x35'));_0x4ec393['state']=_0xd70731;_0x4ec393[_0x2bc8('0x39')]=_0x49aa89;_0x4ec393[_0x2bc8('0x3a')]=_0x4ec393[_0x2bc8('0x3a')]?_0x4ec393[_0x2bc8('0x3a')]:_0x5e4057;_0x4ec393['endtime']=_0x4ec393[_0x2bc8('0x37')]?_0x4ec393['endtime']:_0x5e4057;_0x4ec393[_0x2bc8('0x3e')]=getSeconds(_0x4ec393['responsetime']||0x0,_0x4ec393[_0x2bc8('0x36')]||0x0);_0x4ec393['talktime']=_0x4ec393[_0x2bc8('0x3f')]?getSeconds(_0x4ec393[_0x2bc8('0x37')],_0x4ec393[_0x2bc8('0x3f')]):0x0;};exports[_0x2bc8('0x40')]=function(_0x4fd475){return _0x4fd475===_0x2bc8('0x41');};exports[_0x2bc8('0x42')]=function(_0x31def9,_0x37c8fe,_0x1f80f3,_0x326940,_0x36cfe1){var _0x4962e2=_0x326940?_0x2bc8('0x43'):_0x31def9[_0x2bc8('0x17')];_0x4962e2=_0x36cfe1?_0x2bc8('0x44'):_0x4962e2;return{'actionid':_0x31def9[_0x2bc8('0x45')],'action':_0x2bc8('0x46'),'channel':_0x31def9[_0x2bc8('0x47')],'callerid':util[_0x2bc8('0x11')](_0x2bc8('0x12'),_0x4962e2,_0x31def9[_0x2bc8('0x48')]),'Exten':'xcally-motion-preview','Context':_0x2bc8('0x49'),'Priority':'1','variable':_0x1f80f3,'timeout':(_0x37c8fe[_0x2bc8('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x31def9[_0x2bc8('0x45')]};};exports['totalGlobal']=function(_0x5593fd){return _0x5593fd[_0x2bc8('0x4b')]+_0x5593fd[_0x2bc8('0x4c')]+_0x5593fd[_0x2bc8('0x4d')]+_0x5593fd[_0x2bc8('0x4e')]+_0x5593fd['countnosuchnumberretry'];};exports[_0x2bc8('0x4f')]=function(_0x38d258){var _0x56410b=_['clone'](_0x38d258);_0x56410b[_0x2bc8('0x38')]=0xf;_0x56410b[_0x2bc8('0x39')]=_0x2bc8('0x50');return _0x56410b;};exports['scheduledAt']=function(_0x22898f,_0x2b2df8,_0xf5530c){var _0x4473b8={};_0x4473b8[_0x2b2df8]=_0x22898f[_0x2b2df8];_0x4473b8[_0x2bc8('0x51')]=![];_0x4473b8['scheduledat']=moment()[_0x2bc8('0x52')](_0xf5530c,_0x2bc8('0x53'))[_0x2bc8('0x11')](_0x2bc8('0x35'));_0x4473b8[_0x2bc8('0x54')]=_0x22898f[_0x2bc8('0x54')];_0x4473b8[_0x2bc8('0x55')]=_0x22898f[_0x2bc8('0x55')];_0x4473b8[_0x2bc8('0x19')]=_0x22898f[_0x2bc8('0x19')]||undefined;return _0x4473b8;};exports['decrementTalkink']=function(_0xe71d8e,_0x9ea729){if(!_[_0x2bc8('0x31')](_0xe71d8e)){if(_0xe71d8e['pTalking']>0x0){_0xe71d8e[_0x2bc8('0x56')]-=0x1;}else{logger['error'](_0x9ea729,_0x2bc8('0x57'));}}else{logger[_0x2bc8('0x9')](_0x9ea729,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x1a35ac){if(_0x1a35ac<=0x0){return!![];}return![];};function buildObj(_0x139fff,_0x9064db,_0x4053ee){_0x139fff['lastevent']=_0x9064db;_0x139fff[_0x2bc8('0x16')]=_0x139fff[_0x2bc8('0x58')];_0x139fff[_0x2bc8('0x59')]=_0x139fff[_0x2bc8('0x47')];_0x139fff[_0x2bc8('0x5a')]=_0x2bc8('0x5b');if(_0x4053ee){_0x139fff[_0x2bc8('0x5c')]=_0x4053ee[_0x2bc8('0x5c')];}return _0x139fff;}exports[_0x2bc8('0x5d')]=buildObj;exports[_0x2bc8('0x5e')]=function(_0x3215e2){var _0x131619={};_0x131619[_0x2bc8('0x58')]=_0x3215e2[_0x2bc8('0x58')];_0x131619['interface']=_0x3215e2[_0x2bc8('0x47')];_0x131619[_0x2bc8('0x45')]=_0x3215e2[_0x2bc8('0x45')];return _0x131619;};exports[_0x2bc8('0x5f')]=function(_0x2380b5){var _0x41ae0b=[];for(var _0x29ffaa in _0x2380b5){if(_0x2380b5[_0x2bc8('0x28')](_0x29ffaa)){if(!_[_0x2bc8('0x31')](_0x2380b5[_0x29ffaa])&&_0x2380b5[_0x29ffaa][_0x2bc8('0x38')]==='not_inuse'&&_0x2380b5[_0x29ffaa][_0x2bc8('0x60')]===_0x2bc8('0x61')){_0x41ae0b[_0x2bc8('0x62')](_0x2380b5[_0x29ffaa]['id']);}}}return _0x41ae0b;};exports['getDiff']=function(_0x1a9177){var _0x26e0d1=moment()[_0x2bc8('0x5')](0x0);var _0x3b3bb2=moment(_0x1a9177)[_0x2bc8('0x5')](0x0);return _0x26e0d1['diff'](_0x3b3bb2,_0x2bc8('0x7'));};exports['createBody']=function(_0x388add){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x388add[_0x2bc8('0x54')],'ListId':_0x388add[_0x2bc8('0x55')],'VoiceQueueId':_0x388add[_0x2bc8('0x19')]||undefined,'CampaignId':_0x388add['CampaignId']||undefined};};exports[_0x2bc8('0x63')]=function(_0x30f245){if(_0x30f245===_0x2bc8('0x45')||_0x30f245===_0x2bc8('0x64')||_0x30f245===_0x2bc8('0x58')||_0x30f245===_0x2bc8('0x65')||_0x30f245===_0x2bc8('0x66')||_0x30f245===_0x2bc8('0x67')||_0x30f245===_0x2bc8('0x3b')||_0x30f245==='channelAgent'||_0x30f245===_0x2bc8('0x17')||_0x30f245==='active'||_0x30f245===_0x2bc8('0x48')||_0x30f245==='scheduledat'||_0x30f245===_0x2bc8('0x4b')||_0x30f245==='countcongestionretry'||_0x30f245===_0x2bc8('0x4d')||_0x30f245==='countglobal'||_0x30f245===_0x2bc8('0x68')||_0x30f245===_0x2bc8('0x69')||_0x30f245===_0x2bc8('0x6a')||_0x30f245===_0x2bc8('0x6b')||_0x30f245==='ContactId'||_0x30f245===_0x2bc8('0x55')||_0x30f245===_0x2bc8('0x3c')||_0x30f245===_0x2bc8('0x19')||_0x30f245===_0x2bc8('0x6c')||_0x30f245===_0x2bc8('0x6d')||_0x30f245===_0x2bc8('0x6e')||_0x30f245===_0x2bc8('0x6f')||_0x30f245===_0x2bc8('0x70')||_0x30f245===_0x2bc8('0x71')||_0x30f245==='xmd-dialtimeout'||_0x30f245==='xmd-dialoptions'||_0x30f245===_0x2bc8('0x72')||_0x30f245===_0x2bc8('0x73')||_0x30f245===_0x2bc8('0x74')||_0x30f245===_0x2bc8('0x75')||_0x30f245==='xmd-callerid'||_0x30f245===_0x2bc8('0x76')||_0x30f245===_0x2bc8('0x77')||_0x30f245===_0x2bc8('0x78')||_0x30f245==='rtpaudioqosbridged'||_0x30f245===_0x2bc8('0x79')||_0x30f245===_0x2bc8('0x7a')||_0x30f245===_0x2bc8('0x7b')||_0x30f245===_0x2bc8('0x7c')||_0x30f245===_0x2bc8('0x7d')||_0x30f245==='rtpaudioqosrttbridged'||_0x30f245===_0x2bc8('0x78')||_0x30f245===_0x2bc8('0x7e')||_0x30f245===_0x2bc8('0x79')||_0x30f245==='rtpaudioqosjitterbridged'||_0x30f245===_0x2bc8('0x7b')||_0x30f245===_0x2bc8('0x7c')||_0x30f245==='rtpaudioqosrtt'||_0x30f245===_0x2bc8('0x7f')||_0x30f245===_0x2bc8('0x80')||_0x30f245==='bridgepvtcallid'||_0x30f245===_0x2bc8('0x38')||_0x30f245===_0x2bc8('0x39')){return![];}return!![];};exports[_0x2bc8('0x81')]=function(_0x593dca,_0x35dbff){var _0x24aea0,_0x3288a0,_0x4e84f9;if(_0x35dbff<=0x0){_0x35dbff=0x1;}_0x24aea0=new RegExp(_0x2bc8('0x82')+_0x35dbff+'}$');_0x3288a0=Math[_0x2bc8('0x83')](0xa,_0x35dbff-0x1);_0x4e84f9=Math[_0x2bc8('0x83')](0xa,_0x35dbff)-0x1;return util['format']('%s',_[_0x2bc8('0x84')](_0x593dca,_0x24aea0,_['random'](_0x3288a0,_0x4e84f9)));};exports['extractCalleridName']=function(_0x35af8f){var _0x1e9ab0=_0x35af8f[_0x2bc8('0x85')](/"(.*?)"/);return _0x1e9ab0?_0x1e9ab0[0x1]:_0x35af8f;};exports[_0x2bc8('0x86')]=function(_0x297ca9){var _0x21327a=_0x297ca9['match'](/<(.*?)>/);return _0x21327a?_0x21327a[0x1]:_0x297ca9;};function buildNoAnswerEventPayload(_0x1cddd8,_0x232256){var _0x1756e8=buildObj(_0x1cddd8,_0x2bc8('0x87'));if(!_['isEmpty'](_0x232256[_0x2bc8('0x88')])){Object[_0x2bc8('0x89')](_0x232256['variables'])[_0x2bc8('0x8a')](function(_0x8a054c){_0x1756e8[_0x8a054c['toLowerCase']()]=_0x232256['variables'][_0x8a054c];});}return _0x1756e8;}exports[_0x2bc8('0x8b')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x9682=['countagentrejectretry','countnosuchnumberretry','Global','active','scheduledat','add','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','queue','interface','motionChannel','mandatoryDisposition','buildObj','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','seconds','createBody','CampaignId','filterKey','type','campaigntype','countglobal','callback','callbackuniqueid','callbackat','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosloss','rtpaudioqosrtt','bridgepeer','\x5cw{0,','pow','replace','random','extractCalleridName','match','noanswer','keys','forEach','toLowerCase','variables','lodash','moment','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','error','inspect','loggerError','logger2','info','message','getCallerId','isUndefined','isEmpty','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','name','calleridname','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','endtime','logAgent','responsetime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','uniqueid','originate','channelAgent','calleridnum','xcally-motion-preview','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x26299e,_0x394ad1){var _0x6c4f4a=function(_0x539ae9){while(--_0x539ae9){_0x26299e['push'](_0x26299e['shift']());}};_0x6c4f4a(++_0x394ad1);}(_0x9682,0x1e8));var _0x2968=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9682[_0x167cc1];return _0x10bc4b;};'use strict';var util=require('util');var _=require(_0x2968('0x0'));var moment=require(_0x2968('0x1'));var logger=require('../../../../config/logger')('preview');var ipAgi=process[_0x2968('0x2')][_0x2968('0x3')]||_0x2968('0x4');function getSeconds(_0x183519,_0x8c299){var _0x3b24fd=moment(_0x183519)[_0x2968('0x5')](0x0);var _0x1eb85e=moment(_0x8c299)[_0x2968('0x5')](0x0);return _0x3b24fd[_0x2968('0x6')](_0x1eb85e,'seconds');}exports['loggerCatch']=function(_0x47e43e){return function(_0x3c6624){logger[_0x2968('0x7')](_0x47e43e,util[_0x2968('0x8')](_0x3c6624,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x515d9b,_0x4f3344){logger['info'](_0x515d9b,util['inspect'](_0x4f3344,{'showHidden':![],'depth':null}));};exports[_0x2968('0x9')]=function(_0x34c432,_0x4e61bc){logger[_0x2968('0x7')](_0x34c432,util[_0x2968('0x8')](_0x4e61bc,{'showHidden':![],'depth':null}));};exports[_0x2968('0xa')]=function(_0x1b07a4){return function(_0x5ac595){logger[_0x2968('0xb')](_0x1b07a4,util[_0x2968('0x8')](_0x5ac595,{'showHidden':![],'depth':null}));};};exports[_0x2968('0xc')]=function(_0x181f03,_0x297b16,_0xfcf36c){return{'message':_0x181f03,'unlock':_0x297b16,'active':_0xfcf36c};};exports[_0x2968('0xd')]=function(_0x354672,_0x61b680,_0x2eee15){if(!_[_0x2968('0xe')](_0x2eee15)&&'string'===typeof _0x2eee15&&!_[_0x2968('0xf')](_0x2eee15)){if(!_[_0x2968('0xe')](_0x61b680)&&_0x2968('0x10')===typeof _0x61b680&&!_[_0x2968('0xf')](_0x61b680)){return util[_0x2968('0x11')]('\x22%s\x22\x20<%s>',_0x61b680,_0x2eee15);}return util[_0x2968('0x11')](_0x2968('0x12'),_0x2eee15,_0x2eee15);}if(!_[_0x2968('0xe')](_0x354672)&&_0x2968('0x10')===typeof _0x354672&&!_[_0x2968('0xf')](_0x354672)){return _0x354672;}return _0x2968('0x13');};exports['isActive']=function(_0x4468af){if(_[_0x2968('0x14')](_0x4468af)){return![];}return _0x4468af;};exports[_0x2968('0x15')]=function(_0x32e88f,_0xc9afb8,_0x5313bb,_0x257ce4,_0x51a396,_0x3520ce){var _0x11b74c={'XMD-QUEUE':_0xc9afb8[_0x2968('0x16')]?_0xc9afb8['Queue'][_0x2968('0x17')]:'','XMD-CALLERID':_0x257ce4,'XMD-CALLERID-PREVIEW':_0x3520ce?util[_0x2968('0x11')](_0x2968('0x12'),_0x3520ce[_0x2968('0x18')],_0x3520ce['calleridnum']):_0x257ce4,'XMD-DIALID':_0x51a396,'XMD-CONTACTID':_0xc9afb8['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x257ce4,'XMD-VOICEQUEUEID':_0xc9afb8[_0x2968('0x19')],'XMD-DIALCHANNEL':_0x5313bb,'XMD-DIALTIMEOUT':_0x32e88f[_0x2968('0x1a')]||0x1e,'XMD-DIALOPTIONS':util[_0x2968('0x11')](_0x2968('0x1b'),_0x32e88f['dialQueueProject2']?'g':'',_[_0x2968('0xf')](_0x32e88f[_0x2968('0x1c')])?'':_0x2968('0x1d')),'XMD-DIALURL':_0x32e88f[_0x2968('0x1e')]||'','XMD-AGI':_0x32e88f[_0x2968('0x1f')]?util[_0x2968('0x11')](_0x2968('0x20'),ipAgi,_0x32e88f[_0x2968('0x1f')]):_0x2968('0x21'),'XMD-AGIAFTER':_0x32e88f[_0x2968('0x22')]?util[_0x2968('0x11')](_0x2968('0x20'),ipAgi,_0x32e88f[_0x2968('0x22')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x3520ce?_0x3520ce[_0x2968('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x3520ce?_0x3520ce[_0x2968('0x24')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x2968('0x25')};if(!_[_0x2968('0xf')](_0x32e88f[_0x2968('0x1c')])){_0x11b74c[util['format']('%s',_0x2968('0x26'))]=_0x32e88f['monitor_format'];_0x11b74c[util[_0x2968('0x11')]('%s',_0x2968('0x27'))]=_0x51a396;}if(_0xc9afb8&&_0xc9afb8[_0x2968('0x28')]){for(var _0x20e25a in _0xc9afb8[_0x2968('0x28')]){if(_0xc9afb8[_0x2968('0x28')][_0x2968('0x29')](_0x20e25a)){if(!_[_0x2968('0x14')](_0xc9afb8['Contact'][_0x20e25a])&&_0x20e25a!=='id'&&_0x20e25a!=='tags'&&_0x20e25a!==_0x2968('0x2a')&&_0x20e25a!==_0x2968('0x2b')){_0x11b74c[util[_0x2968('0x11')](_0x2968('0x2c'),_0x2968('0x2d'),_[_0x2968('0x2e')](_0x20e25a))]=_0xc9afb8[_0x2968('0x28')][_0x20e25a];}}}}return _0x11b74c;};exports[_0x2968('0x2f')]=function(_0x214acd){var _0x193bcf={};for(var _0x44035e in _0x214acd){if(_0x214acd['hasOwnProperty'](_0x44035e)){_0x193bcf[util['format']('%s',_[_0x2968('0x30')](_0x44035e))]=_0x214acd[_0x44035e];}}return{'variables':_0x193bcf};};exports[_0x2968('0x31')]=function(_0x67a8a5,_0x3a9e65){if(!_['isNil'](_0x67a8a5)){if(_0x67a8a5[_0x2968('0x29')](_0x2968('0x32'))){if(_0x67a8a5[_0x2968('0x32')]>0x0){_0x67a8a5[_0x2968('0x32')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x3a9e65);}}}else{logger[_0x2968('0x7')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x3a9e65);}};exports[_0x2968('0x33')]=function(_0x39c629){var _0x45fdf6=moment()[_0x2968('0x11')](_0x2968('0x34'));_0x39c629[_0x2968('0x35')]=0xd;_0x39c629[_0x2968('0x36')]=_0x2968('0x37');_0x39c629[_0x2968('0x38')]=_0x45fdf6;_0x39c629['responsetime']=_0x45fdf6;_0x39c629[_0x2968('0x39')]=_0x45fdf6;};exports[_0x2968('0x3a')]=function(_0x5e2659,_0x311d50,_0x369878){var _0x265cae=moment()[_0x2968('0x11')](_0x2968('0x34'));_0x5e2659[_0x2968('0x35')]=_0x311d50;_0x5e2659['statedesc']=_0x369878;_0x5e2659[_0x2968('0x3b')]=_0x265cae;_0x5e2659['ringtime']=getSeconds(_0x5e2659[_0x2968('0x3b')],_0x5e2659[_0x2968('0x38')]);};exports[_0x2968('0x3c')]=function(_0x11d644,_0x18fd70,_0x933a04){_0x11d644[_0x2968('0x3d')]=_0x18fd70;_0x11d644[_0x2968('0x3e')]=_0x933a04;};exports[_0x2968('0x3f')]=function(_0x1c9d71,_0x5ba753,_0x2a3d07){var _0x4885ef=moment()[_0x2968('0x11')](_0x2968('0x34'));_0x1c9d71[_0x2968('0x35')]=_0x5ba753;_0x1c9d71[_0x2968('0x36')]=_0x2a3d07;_0x1c9d71[_0x2968('0x3b')]=_0x1c9d71[_0x2968('0x3b')]?_0x1c9d71['responsetime']:_0x4885ef;_0x1c9d71[_0x2968('0x39')]=_0x1c9d71[_0x2968('0x39')]?_0x1c9d71[_0x2968('0x39')]:_0x4885ef;_0x1c9d71['ringtime']=getSeconds(_0x1c9d71[_0x2968('0x3b')]||0x0,_0x1c9d71[_0x2968('0x38')]||0x0);_0x1c9d71[_0x2968('0x40')]=_0x1c9d71['answertime']?getSeconds(_0x1c9d71[_0x2968('0x39')],_0x1c9d71[_0x2968('0x41')]):0x0;};exports[_0x2968('0x42')]=function(_0xfd8913){return _0xfd8913===_0x2968('0x43');};exports[_0x2968('0x44')]=function(_0x2c1014,_0x17d9cd,_0x229dc5,_0x534318,_0x5c71dc){var _0x563cd8=_0x534318?'RECALL':_0x2c1014[_0x2968('0x18')];_0x563cd8=_0x5c71dc?'BOOKED':_0x563cd8;return{'actionid':_0x2c1014[_0x2968('0x45')],'action':_0x2968('0x46'),'channel':_0x2c1014[_0x2968('0x47')],'callerid':util[_0x2968('0x11')](_0x2968('0x12'),_0x563cd8,_0x2c1014[_0x2968('0x48')]),'Exten':_0x2968('0x49'),'Context':_0x2968('0x4a'),'Priority':'1','variable':_0x229dc5,'timeout':(_0x17d9cd[_0x2968('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2c1014['uniqueid']};};exports[_0x2968('0x4c')]=function(_0x43643c){return _0x43643c[_0x2968('0x4d')]+_0x43643c[_0x2968('0x4e')]+_0x43643c[_0x2968('0x4f')]+_0x43643c[_0x2968('0x50')]+_0x43643c[_0x2968('0x51')];};exports['cloneAction']=function(_0x41d514){var _0x36dae1=_['clone'](_0x41d514);_0x36dae1[_0x2968('0x35')]=0xf;_0x36dae1[_0x2968('0x36')]=_0x2968('0x52');return _0x36dae1;};exports['scheduledAt']=function(_0x195737,_0x294536,_0x886b3e){var _0x4741cc={};_0x4741cc[_0x294536]=_0x195737[_0x294536];_0x4741cc[_0x2968('0x53')]=![];_0x4741cc[_0x2968('0x54')]=moment()[_0x2968('0x55')](_0x886b3e,'minutes')['format'](_0x2968('0x34'));_0x4741cc[_0x2968('0x56')]=_0x195737[_0x2968('0x56')];_0x4741cc[_0x2968('0x57')]=_0x195737[_0x2968('0x57')];_0x4741cc['VoiceQueueId']=_0x195737[_0x2968('0x19')]||undefined;return _0x4741cc;};exports[_0x2968('0x58')]=function(_0x317e85,_0x4131d7){if(!_[_0x2968('0x14')](_0x317e85)){if(_0x317e85[_0x2968('0x59')]>0x0){_0x317e85[_0x2968('0x59')]-=0x1;}else{logger[_0x2968('0x7')](_0x4131d7,_0x2968('0x5a'));}}else{logger['error'](_0x4131d7,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x2968('0x5b')]=function(_0x252e54){if(_0x252e54<=0x0){return!![];}return![];};function buildObj(_0x4450f0,_0x31a672,_0x41dc0d){_0x4450f0[_0x2968('0x5c')]=_0x31a672;_0x4450f0[_0x2968('0x17')]=_0x4450f0[_0x2968('0x5d')];_0x4450f0[_0x2968('0x5e')]=_0x4450f0[_0x2968('0x47')];_0x4450f0[_0x2968('0x5f')]='voice';if(_0x41dc0d){_0x4450f0[_0x2968('0x60')]=_0x41dc0d[_0x2968('0x60')];}return _0x4450f0;}exports[_0x2968('0x61')]=buildObj;exports[_0x2968('0x62')]=function(_0x22b93b){var _0x3f1cba={};_0x3f1cba['queue']=_0x22b93b[_0x2968('0x5d')];_0x3f1cba['interface']=_0x22b93b['channelAgent'];_0x3f1cba[_0x2968('0x45')]=_0x22b93b[_0x2968('0x45')];return _0x3f1cba;};exports[_0x2968('0x63')]=function(_0x12eb44){var _0x490e3f=[];for(var _0x2b22ea in _0x12eb44){if(_0x12eb44['hasOwnProperty'](_0x2b22ea)){if(!_[_0x2968('0x14')](_0x12eb44[_0x2b22ea])&&_0x12eb44[_0x2b22ea][_0x2968('0x35')]===_0x2968('0x64')&&_0x12eb44[_0x2b22ea][_0x2968('0x65')]===_0x2968('0x66')){_0x490e3f[_0x2968('0x67')](_0x12eb44[_0x2b22ea]['id']);}}}return _0x490e3f;};exports[_0x2968('0x68')]=function(_0x373e18){var _0x1279c9=moment()[_0x2968('0x5')](0x0);var _0x94fe7b=moment(_0x373e18)[_0x2968('0x5')](0x0);return _0x1279c9[_0x2968('0x6')](_0x94fe7b,_0x2968('0x69'));};exports[_0x2968('0x6a')]=function(_0x545e74){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x545e74[_0x2968('0x56')],'ListId':_0x545e74['ListId'],'VoiceQueueId':_0x545e74['VoiceQueueId']||undefined,'CampaignId':_0x545e74[_0x2968('0x6b')]||undefined};};exports[_0x2968('0x6c')]=function(_0x1bc646){if(_0x1bc646===_0x2968('0x45')||_0x1bc646==='idContact'||_0x1bc646===_0x2968('0x5d')||_0x1bc646===_0x2968('0x6d')||_0x1bc646===_0x2968('0x6e')||_0x1bc646==='dialAnswer'||_0x1bc646===_0x2968('0x3d')||_0x1bc646===_0x2968('0x47')||_0x1bc646===_0x2968('0x18')||_0x1bc646===_0x2968('0x53')||_0x1bc646===_0x2968('0x48')||_0x1bc646==='scheduledat'||_0x1bc646===_0x2968('0x4d')||_0x1bc646===_0x2968('0x4e')||_0x1bc646===_0x2968('0x4f')||_0x1bc646===_0x2968('0x6f')||_0x1bc646===_0x2968('0x70')||_0x1bc646===_0x2968('0x71')||_0x1bc646===_0x2968('0x72')||_0x1bc646==='recallme'||_0x1bc646===_0x2968('0x56')||_0x1bc646==='ListId'||_0x1bc646===_0x2968('0x3e')||_0x1bc646==='VoiceQueueId'||_0x1bc646==='sipcallid'||_0x1bc646==='xmd-voicequeueid'||_0x1bc646===_0x2968('0x73')||_0x1bc646===_0x2968('0x74')||_0x1bc646===_0x2968('0x75')||_0x1bc646==='xmd-dialurl'||_0x1bc646===_0x2968('0x76')||_0x1bc646===_0x2968('0x77')||_0x1bc646==='xmd-dialid'||_0x1bc646===_0x2968('0x78')||_0x1bc646==='xmd-contactid'||_0x1bc646===_0x2968('0x79')||_0x1bc646===_0x2968('0x7a')||_0x1bc646==='xmd-agiafter'||_0x1bc646===_0x2968('0x7b')||_0x1bc646===_0x2968('0x7c')||_0x1bc646==='rtpaudioqosbridged'||_0x1bc646==='rtpaudioqosjitter'||_0x1bc646===_0x2968('0x7d')||_0x1bc646==='rtpaudioqosloss'||_0x1bc646===_0x2968('0x7e')||_0x1bc646==='rtpaudioqosrtt'||_0x1bc646===_0x2968('0x7f')||_0x1bc646===_0x2968('0x7c')||_0x1bc646==='rtpaudioqosbridged'||_0x1bc646==='rtpaudioqosjitter'||_0x1bc646==='rtpaudioqosjitterbridged'||_0x1bc646===_0x2968('0x80')||_0x1bc646===_0x2968('0x7e')||_0x1bc646===_0x2968('0x81')||_0x1bc646===_0x2968('0x7f')||_0x1bc646===_0x2968('0x82')||_0x1bc646==='bridgepvtcallid'||_0x1bc646===_0x2968('0x35')||_0x1bc646==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x20144c,_0x1944b8){var _0x527975,_0xb938d6,_0x6b4d55;if(_0x1944b8<=0x0){_0x1944b8=0x1;}_0x527975=new RegExp(_0x2968('0x83')+_0x1944b8+'}$');_0xb938d6=Math[_0x2968('0x84')](0xa,_0x1944b8-0x1);_0x6b4d55=Math['pow'](0xa,_0x1944b8)-0x1;return util[_0x2968('0x11')]('%s',_[_0x2968('0x85')](_0x20144c,_0x527975,_[_0x2968('0x86')](_0xb938d6,_0x6b4d55)));};exports[_0x2968('0x87')]=function(_0x5bc7fc){var _0x40a472=_0x5bc7fc[_0x2968('0x88')](/"(.*?)"/);return _0x40a472?_0x40a472[0x1]:_0x5bc7fc;};exports['extractCalleridNumber']=function(_0x1bfa6e){var _0x38f0b7=_0x1bfa6e[_0x2968('0x88')](/<(.*?)>/);return _0x38f0b7?_0x38f0b7[0x1]:_0x1bfa6e;};function buildNoAnswerEventPayload(_0x6fee1f,_0x4e32a1){var _0x4e503b=buildObj(_0x6fee1f,_0x2968('0x89'));if(!_[_0x2968('0xf')](_0x4e32a1['variables'])){Object[_0x2968('0x8a')](_0x4e32a1['variables'])[_0x2968('0x8b')](function(_0x1c57be){_0x4e503b[_0x1c57be[_0x2968('0x8c')]()]=_0x4e32a1[_0x2968('0x8d')][_0x1c57be];});}return _0x4e503b;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index aa1208f..1044f4b 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 _0x1e17=['voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause','reload','voicequeuechannel'];(function(_0x36f9dd,_0x33e0f5){var _0x7e5fac=function(_0x30a0ad){while(--_0x30a0ad){_0x36f9dd['push'](_0x36f9dd['shift']());}};_0x7e5fac(++_0x33e0f5);}(_0x1e17,0x71));var _0x71e1=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x1e17[_0x32f7d7];return _0x133d09;};'use strict';exports[_0x71e1('0x0')]={'queue':{'type':_0x71e1('0x1'),'required':!![]},'interface':{'type':_0x71e1('0x1'),'required':!![]},'membername':{'type':_0x71e1('0x1'),'required':!![]},'penalty':{'type':_0x71e1('0x2'),'required':![]},'paused':{'type':_0x71e1('0x3'),'required':![]}};exports[_0x71e1('0x4')]={'queue':{'type':_0x71e1('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x71e1('0x5')]={'interface':{'type':_0x71e1('0x1'),'required':!![]},'paused':{'type':_0x71e1('0x3')},'reason':{'type':_0x71e1('0x1'),'required':![]}};exports[_0x71e1('0x6')]={'module':{'type':_0x71e1('0x1'),'required':![]}};exports[_0x71e1('0x7')]={'uniqueid':{'type':_0x71e1('0x1'),'required':!![]}};exports[_0x71e1('0x8')]={'uniqueid':{'type':_0x71e1('0x1'),'required':!![]},'filename':{'type':_0x71e1('0x1')},'format':{'type':_0x71e1('0x1')},'mixmonitorid':{'type':_0x71e1('0x1')}};exports[_0x71e1('0x9')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x71e1('0xa')]={'uniqueid':{'type':_0x71e1('0x1'),'required':!![]},'exten':{'type':_0x71e1('0x1'),'required':!![]},'context':{'type':_0x71e1('0x1')}}; \ No newline at end of file +var _0x083e=['voicechannel','voicequeuechannelhangup','queueadd','string','boolean','queuepause','reload','voicequeuechannel'];(function(_0x55e942,_0x5dba5d){var _0x5471b4=function(_0x109198){while(--_0x109198){_0x55e942['push'](_0x55e942['shift']());}};_0x5471b4(++_0x5dba5d);}(_0x083e,0x182));var _0xe083=function(_0x5d8018,_0x588592){_0x5d8018=_0x5d8018-0x0;var _0x151ac4=_0x083e[_0x5d8018];return _0x151ac4;};'use strict';exports[_0xe083('0x0')]={'queue':{'type':_0xe083('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0xe083('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0xe083('0x2'),'required':![]}};exports['queueremove']={'queue':{'type':_0xe083('0x1'),'required':!![]},'interface':{'type':_0xe083('0x1'),'required':!![]}};exports[_0xe083('0x3')]={'interface':{'type':_0xe083('0x1'),'required':!![]},'paused':{'type':_0xe083('0x2')},'reason':{'type':_0xe083('0x1'),'required':![]}};exports[_0xe083('0x4')]={'module':{'type':'string','required':![]}};exports[_0xe083('0x5')]={'uniqueid':{'type':_0xe083('0x1'),'required':!![]}};exports[_0xe083('0x6')]={'uniqueid':{'type':_0xe083('0x1'),'required':!![]},'filename':{'type':_0xe083('0x1')},'format':{'type':_0xe083('0x1')},'mixmonitorid':{'type':_0xe083('0x1')}};exports[_0xe083('0x7')]={'uniqueid':{'type':_0xe083('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xe083('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xe083('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 2fdaccd..aa1cb0f 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 _0xb0e5=['triggers','initTemplates','initZendeskAccounts','initFreshdeskAccounts','initDeskAccounts','initVtigerAccounts','initServicenowAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerabandon','queuecallerleaveAt','diff','queuecallerexitAt','seconds','queuecallercompleteAt','initVoiceCallReports','duration','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','util','lodash','moment','../model/agent','../model/telephone','../model/trigger','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','voiceQueues','templates','outbound','voiceExtensions','queueChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','name','isNil','interface','format','SIP/%s','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','trunks','initVoiceQueues'];(function(_0x495903,_0x408038){var _0x5938bc=function(_0x3442be){while(--_0x3442be){_0x495903['push'](_0x495903['shift']());}};_0x5938bc(++_0x408038);}(_0xb0e5,0x1ad));var _0x5b0e=function(_0x24d5a6,_0x29996c){_0x24d5a6=_0x24d5a6-0x0;var _0x42dd57=_0xb0e5[_0x24d5a6];return _0x42dd57;};'use strict';var util=require(_0x5b0e('0x0'));var _=require(_0x5b0e('0x1'));var moment=require(_0x5b0e('0x2'));var Agent=require(_0x5b0e('0x3'));var Telephone=require(_0x5b0e('0x4'));var Trunk=require('../model/trunk');var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x5b0e('0x5'));var Template=require('../model/template');var Campaign=require(_0x5b0e('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x5b0e('0x7'));var SalesforceAccount=require(_0x5b0e('0x8'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x5b0e('0x9'));var DeskAccount=require(_0x5b0e('0xa'));var VtigerAccount=require(_0x5b0e('0xb'));var ServicenowAccount=require(_0x5b0e('0xc'));var Dynamics365Account=require(_0x5b0e('0xd'));var FreshsalesAccount=require(_0x5b0e('0xe'));var FaxAccount=require(_0x5b0e('0xf'));var Realtime=function(){this[_0x5b0e('0x10')]={};this[_0x5b0e('0x11')]={};this['trunks']={};this[_0x5b0e('0x12')]={};this['triggers']={};this['campaigns']={};this[_0x5b0e('0x13')]={};this[_0x5b0e('0x14')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x5b0e('0x15')]={};this['channels']={};this[_0x5b0e('0x16')]={};this['outboundChannels']={};this['timers']={};this[_0x5b0e('0x17')]={};this[_0x5b0e('0x18')]={};this[_0x5b0e('0x19')]={};this[_0x5b0e('0x1a')]={};this[_0x5b0e('0x1b')]={};this[_0x5b0e('0x1c')]={};this[_0x5b0e('0x1d')]={};this[_0x5b0e('0x1e')]={};this[_0x5b0e('0x1f')]={};this[_0x5b0e('0x20')]={};this[_0x5b0e('0x21')]={};this[_0x5b0e('0x22')]={};};function freeIsNotKey(_0x3fe6cc,_0x438563,_0x650ade){var _0x133f39=_[_0x5b0e('0x23')](_0x3fe6cc,function(_0x22036a,_0x18e4d8){return _0x22036a[_0x650ade];});for(var _0x3c876a in _0x438563){if(_0x438563[_0x5b0e('0x24')](_0x3c876a)){if(!_0x133f39[_0x3c876a]){delete _0x438563[_0x3c876a];}}}}function freeIsNotKeySip(_0x17ac8f,_0x4c769a){var _0x4e2964=_[_0x5b0e('0x23')](_0x17ac8f,function(_0x211053,_0x8ad0fa){return util['format']('SIP/%s',_0x211053[_0x5b0e('0x25')]);});for(var _0x570a09 in _0x4c769a){if(_0x4c769a[_0x5b0e('0x24')](_0x570a09)){if(!_0x4e2964[_0x570a09]){delete _0x4c769a[_0x570a09];}}}}function freeIsNotKeyAgent(_0x26aa58,_0x10cc05){var _0xbd83f0=_['mapKeys'](_0x26aa58,function(_0x4e3941,_0x48c484){var _0x497aa2=_[_0x5b0e('0x26')](_0x4e3941[_0x5b0e('0x27')])?util[_0x5b0e('0x28')](_0x5b0e('0x29'),_0x4e3941[_0x5b0e('0x25')]):_0x4e3941['interface'];return _0x497aa2;});for(var _0x35b954 in _0x10cc05){if(_0x10cc05['hasOwnProperty'](_0x35b954)){if(!_0xbd83f0[_0x35b954]){delete _0x10cc05[_0x35b954];}}}}function clearVoiceCallReports(_0xe22b73){_0xe22b73[_0x5b0e('0x2a')]=0x0;_0xe22b73[_0x5b0e('0x2b')]=0x0;_0xe22b73[_0x5b0e('0x2c')]=0x0;_0xe22b73[_0x5b0e('0x2d')]=0x0;_0xe22b73[_0x5b0e('0x2e')]=0x0;}function clearCampaigns(_0x1fc287){if(!_[_0x5b0e('0x2f')](_0x1fc287)){for(var _0x3b9321 in _0x1fc287){if(_0x1fc287[_0x5b0e('0x24')](_0x3b9321)){_0x1fc287[_0x3b9321][_0x5b0e('0x30')]=0x0;_0x1fc287[_0x3b9321][_0x5b0e('0x31')]=0x0;}}}}function clearVoiceQueues(_0x2f8137){if(!_[_0x5b0e('0x2f')](_0x2f8137)){for(var _0x303e28 in _0x2f8137){if(_0x2f8137[_0x5b0e('0x24')](_0x303e28)){_0x2f8137[_0x303e28][_0x5b0e('0x2a')]=0x0;_0x2f8137[_0x303e28][_0x5b0e('0x2b')]=0x0;_0x2f8137[_0x303e28][_0x5b0e('0x32')]=0x0;_0x2f8137[_0x303e28][_0x5b0e('0x33')]=0x0;_0x2f8137[_0x303e28]['sumHoldTime']=0x0;_0x2f8137[_0x303e28][_0x5b0e('0x2d')]=0x0;_0x2f8137[_0x303e28][_0x5b0e('0x2e')]=0x0;_0x2f8137[_0x303e28][_0x5b0e('0x34')]=0x0;_0x2f8137[_0x303e28][_0x5b0e('0x35')]=0x0;_0x2f8137[_0x303e28][_0x5b0e('0x36')]=0x0;_0x2f8137[_0x303e28]['outboundCongestionCallsDay']=0x0;_0x2f8137[_0x303e28][_0x5b0e('0x37')]=0x0;_0x2f8137[_0x303e28][_0x5b0e('0x38')]=0x0;_0x2f8137[_0x303e28][_0x5b0e('0x39')]=0x0;_0x2f8137[_0x303e28][_0x5b0e('0x3a')]=0x0;_0x2f8137[_0x303e28][_0x5b0e('0x3b')]=0x0;_0x2f8137[_0x303e28][_0x5b0e('0x3c')]=0x0;_0x2f8137[_0x303e28][_0x5b0e('0x3d')]=0x0;_0x2f8137[_0x303e28]['outboundReCallsDay']=0x0;_0x2f8137[_0x303e28][_0x5b0e('0x34')]=0x0;_0x2f8137[_0x303e28][_0x5b0e('0x3e')]=0x0;_0x2f8137[_0x303e28]['queueStatusComplete']=!![];}}}}Realtime[_0x5b0e('0x3f')][_0x5b0e('0x40')]=function(_0x13747d,_0x297920){for(var _0x1ed3dd in _0x297920){if(_0x13747d[_0x5b0e('0x24')](_0x1ed3dd)){_0x13747d[_0x1ed3dd]=_0x297920[_0x1ed3dd];}}};Realtime[_0x5b0e('0x3f')][_0x5b0e('0x41')]=function(){var _0x2f94f8=this;return function(_0x1fa7d4){if(_0x1fa7d4){freeIsNotKeyAgent(_0x1fa7d4,_0x2f94f8[_0x5b0e('0x10')]);for(var _0x5c6fe4=0x0,_0x414d13={},_0xf1eed9={};_0x5c6fe4<_0x1fa7d4[_0x5b0e('0x42')];_0x5c6fe4+=0x1){_0x414d13=_0x1fa7d4[_0x5c6fe4];var _0x3d04ce=_[_0x5b0e('0x26')](_0x414d13[_0x5b0e('0x27')])?util[_0x5b0e('0x28')](_0x5b0e('0x29'),_0x414d13[_0x5b0e('0x25')]):_0x414d13[_0x5b0e('0x27')];if(_[_0x5b0e('0x43')](_0x2f94f8['agents'][_0x3d04ce])){_0x2f94f8[_0x5b0e('0x10')][_0x3d04ce]=new Agent(_0x414d13);}else{_0x2f94f8['mergeFromDatabase'](_0x2f94f8[_0x5b0e('0x10')][_0x3d04ce],_0x414d13);}}}return _0x2f94f8[_0x5b0e('0x10')];};};Realtime['prototype'][_0x5b0e('0x44')]=function(){var _0xcc9ffa=this;return function(_0x3852ae){if(_0x3852ae){freeIsNotKeySip(_0x3852ae,_0xcc9ffa[_0x5b0e('0x11')]);for(var _0x545add=0x0,_0x24b33a={},_0x1268fd={};_0x545add<_0x3852ae[_0x5b0e('0x42')];_0x545add+=0x1){_0x24b33a=_0x3852ae[_0x545add];if(_[_0x5b0e('0x43')](_0xcc9ffa[_0x5b0e('0x11')][util[_0x5b0e('0x28')](_0x5b0e('0x29'),_0x24b33a['name'])])){_0xcc9ffa[_0x5b0e('0x11')][util['format'](_0x5b0e('0x29'),_0x24b33a[_0x5b0e('0x25')])]=new Telephone(_0x24b33a);}else{_0xcc9ffa[_0x5b0e('0x40')](_0xcc9ffa[_0x5b0e('0x11')][util[_0x5b0e('0x28')](_0x5b0e('0x29'),_0x24b33a[_0x5b0e('0x25')])],_0x24b33a);}}}return _0xcc9ffa[_0x5b0e('0x11')];};};Realtime[_0x5b0e('0x3f')]['initTrunks']=function(){var _0x3616dc=this;return function(_0x11dd39){if(_0x11dd39){freeIsNotKeySip(_0x11dd39,_0x3616dc[_0x5b0e('0x45')]);for(var _0x1e62be=0x0,_0x10cba4={},_0x507008={};_0x1e62be<_0x11dd39['length'];_0x1e62be+=0x1){_0x10cba4=_0x11dd39[_0x1e62be];if(_[_0x5b0e('0x43')](_0x3616dc[_0x5b0e('0x45')][util[_0x5b0e('0x28')](_0x5b0e('0x29'),_0x10cba4['name'])])){_0x3616dc[_0x5b0e('0x45')][util[_0x5b0e('0x28')]('SIP/%s',_0x10cba4[_0x5b0e('0x25')])]=new Trunk(_0x10cba4);}else{_0x3616dc[_0x5b0e('0x40')](_0x3616dc[_0x5b0e('0x45')][util['format'](_0x5b0e('0x29'),_0x10cba4[_0x5b0e('0x25')])],_0x10cba4);}}}return _0x3616dc[_0x5b0e('0x45')];};};Realtime['prototype'][_0x5b0e('0x46')]=function(){var _0x186e91=this;return function(_0x40c3a4){if(_0x40c3a4){freeIsNotKey(_0x40c3a4,_0x186e91['voiceQueues'],_0x5b0e('0x25'));for(var _0x4dc16d=0x0,_0x2e19bc={},_0x2f5c5e={};_0x4dc16d<_0x40c3a4[_0x5b0e('0x42')];_0x4dc16d+=0x1){_0x2e19bc=_0x40c3a4[_0x4dc16d];if(_[_0x5b0e('0x43')](_0x186e91[_0x5b0e('0x12')][_0x2e19bc['name']])){_0x186e91['voiceQueues'][_0x2e19bc[_0x5b0e('0x25')]]=new VoiceQueue(_0x2e19bc);}else{_0x186e91[_0x5b0e('0x40')](_0x186e91['voiceQueues'][_0x2e19bc['name']],_0x2e19bc);}}}return _0x186e91[_0x5b0e('0x12')];};};Realtime[_0x5b0e('0x3f')]['initTriggers']=function(){var _0x2af26b=this;return function(_0x3543fa){if(_0x3543fa){freeIsNotKey(_0x3543fa,_0x2af26b[_0x5b0e('0x47')],'id');for(var _0x5afcac=0x0,_0x3a7c5e={},_0x51b920={};_0x5afcac<_0x3543fa[_0x5b0e('0x42')];_0x5afcac+=0x1){_0x3a7c5e=_0x3543fa[_0x5afcac];if(_[_0x5b0e('0x43')](_0x2af26b[_0x5b0e('0x47')][_0x3a7c5e['id']])){_0x2af26b[_0x5b0e('0x47')][_0x3a7c5e['id']]=new Trigger(_0x3a7c5e);}else{_0x2af26b['mergeFromDatabase'](_0x2af26b['triggers'][_0x3a7c5e['id']],_0x3a7c5e);}}}return _0x2af26b[_0x5b0e('0x47')];};};Realtime['prototype'][_0x5b0e('0x48')]=function(){var _0x560b1e=this;return function(_0x213dd0){if(_0x213dd0){freeIsNotKey(_0x213dd0,_0x560b1e[_0x5b0e('0x13')],'id');for(var _0x15c08d=0x0,_0x2e03d7={},_0x15b073={};_0x15c08d<_0x213dd0[_0x5b0e('0x42')];_0x15c08d+=0x1){_0x2e03d7=_0x213dd0[_0x15c08d];if(_[_0x5b0e('0x43')](_0x560b1e['templates'][_0x2e03d7['id']])){_0x560b1e[_0x5b0e('0x13')][_0x2e03d7['id']]=new Template(_0x2e03d7);}else{_0x560b1e[_0x5b0e('0x40')](_0x560b1e[_0x5b0e('0x13')][_0x2e03d7['id']],_0x2e03d7);}}}return _0x560b1e[_0x5b0e('0x13')];};};Realtime[_0x5b0e('0x3f')][_0x5b0e('0x49')]=function(){var _0x41127d=this;return function(_0x5b65f4){if(_0x5b65f4){freeIsNotKey(_0x5b65f4,_0x41127d[_0x5b0e('0x18')],'id');for(var _0xfc8fca=0x0,_0x3ba210={},_0x20e5cb={};_0xfc8fca<_0x5b65f4[_0x5b0e('0x42')];_0xfc8fca+=0x1){_0x3ba210=_0x5b65f4[_0xfc8fca];if(_[_0x5b0e('0x43')](_0x41127d['zendeskAccounts'][_0x3ba210['id']])){_0x41127d['zendeskAccounts'][_0x3ba210['id']]=new ZendeskAccount(_0x3ba210);}else{_0x41127d[_0x5b0e('0x40')](_0x41127d[_0x5b0e('0x18')][_0x3ba210['id']],_0x3ba210);}}}return _0x41127d['zendeskAccounts'];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0xd7b35=this;return function(_0x1ce268){if(_0x1ce268){freeIsNotKey(_0x1ce268,_0xd7b35['salesforceAccounts'],'id');for(var _0x63b671=0x0,_0x450e22={},_0x4f5e78={};_0x63b671<_0x1ce268[_0x5b0e('0x42')];_0x63b671+=0x1){_0x450e22=_0x1ce268[_0x63b671];if(_[_0x5b0e('0x43')](_0xd7b35[_0x5b0e('0x19')][_0x450e22['id']])){_0xd7b35[_0x5b0e('0x19')][_0x450e22['id']]=new SalesforceAccount(_0x450e22);}else{_0xd7b35[_0x5b0e('0x40')](_0xd7b35['salesforceAccounts'][_0x450e22['id']],_0x450e22);}}}return _0xd7b35[_0x5b0e('0x19')];};};Realtime[_0x5b0e('0x3f')][_0x5b0e('0x4a')]=function(){var _0x66560b=this;return function(_0xf358fc){if(_0xf358fc){freeIsNotKey(_0xf358fc,_0x66560b[_0x5b0e('0x1b')],'id');for(var _0x19deec=0x0,_0x7518bd={},_0x108d7e={};_0x19deec<_0xf358fc[_0x5b0e('0x42')];_0x19deec+=0x1){_0x7518bd=_0xf358fc[_0x19deec];if(_[_0x5b0e('0x43')](_0x66560b['freshdeskAccounts'][_0x7518bd['id']])){_0x66560b['freshdeskAccounts'][_0x7518bd['id']]=new FreshdeskAccount(_0x7518bd);}else{_0x66560b[_0x5b0e('0x40')](_0x66560b['freshdeskAccounts'][_0x7518bd['id']],_0x7518bd);}}}return _0x66560b[_0x5b0e('0x1b')];};};Realtime[_0x5b0e('0x3f')]['initZohoAccounts']=function(){var _0x3bfc09=this;return function(_0x4e02f7){if(_0x4e02f7){freeIsNotKey(_0x4e02f7,_0x3bfc09[_0x5b0e('0x1c')],'id');for(var _0x2fc7c9=0x0,_0x18d8ad={},_0x224ab1={};_0x2fc7c9<_0x4e02f7[_0x5b0e('0x42')];_0x2fc7c9+=0x1){_0x18d8ad=_0x4e02f7[_0x2fc7c9];if(_[_0x5b0e('0x43')](_0x3bfc09[_0x5b0e('0x1c')][_0x18d8ad['id']])){_0x3bfc09[_0x5b0e('0x1c')][_0x18d8ad['id']]=new ZohoAccount(_0x18d8ad);}else{_0x3bfc09[_0x5b0e('0x40')](_0x3bfc09[_0x5b0e('0x1c')][_0x18d8ad['id']],_0x18d8ad);}}}return _0x3bfc09[_0x5b0e('0x1c')];};};Realtime[_0x5b0e('0x3f')][_0x5b0e('0x4b')]=function(){var _0x459cd1=this;return function(_0x6af852){if(_0x6af852){freeIsNotKey(_0x6af852,_0x459cd1[_0x5b0e('0x1d')],'id');for(var _0x338c1a=0x0,_0x429219={},_0x42c9db={};_0x338c1a<_0x6af852['length'];_0x338c1a+=0x1){_0x429219=_0x6af852[_0x338c1a];if(_[_0x5b0e('0x43')](_0x459cd1['deskAccounts'][_0x429219['id']])){_0x459cd1[_0x5b0e('0x1d')][_0x429219['id']]=new DeskAccount(_0x429219);}else{_0x459cd1['mergeFromDatabase'](_0x459cd1[_0x5b0e('0x1d')][_0x429219['id']],_0x429219);}}}return _0x459cd1[_0x5b0e('0x1d')];};};Realtime[_0x5b0e('0x3f')]['initSugarcrmAccounts']=function(){var _0x37224f=this;return function(_0xfb3f6d){if(_0xfb3f6d){freeIsNotKey(_0xfb3f6d,_0x37224f[_0x5b0e('0x1a')],'id');for(var _0x4c402b=0x0,_0x34361b={},_0x571d1c={};_0x4c402b<_0xfb3f6d['length'];_0x4c402b+=0x1){_0x34361b=_0xfb3f6d[_0x4c402b];if(_[_0x5b0e('0x43')](_0x37224f['sugarcrmAccounts'][_0x34361b['id']])){_0x37224f['sugarcrmAccounts'][_0x34361b['id']]=new SugarcrmAccount(_0x34361b);}else{_0x37224f[_0x5b0e('0x40')](_0x37224f[_0x5b0e('0x1a')][_0x34361b['id']],_0x34361b);}}}return _0x37224f['sugarcrmAccounts'];};};Realtime[_0x5b0e('0x3f')][_0x5b0e('0x4c')]=function(){var _0x505703=this;return function(_0x220737){if(_0x220737){freeIsNotKey(_0x220737,_0x505703[_0x5b0e('0x1e')],'id');for(var _0x3d2ab3=0x0,_0x1e2a14={},_0x42ba12={};_0x3d2ab3<_0x220737['length'];_0x3d2ab3+=0x1){_0x1e2a14=_0x220737[_0x3d2ab3];if(_['isUndefined'](_0x505703[_0x5b0e('0x1e')][_0x1e2a14['id']])){_0x505703[_0x5b0e('0x1e')][_0x1e2a14['id']]=new VtigerAccount(_0x1e2a14);}else{_0x505703[_0x5b0e('0x40')](_0x505703[_0x5b0e('0x1e')][_0x1e2a14['id']],_0x1e2a14);}}}return _0x505703['vtigerAccounts'];};};Realtime[_0x5b0e('0x3f')][_0x5b0e('0x4d')]=function(){var _0x3f7645=this;return function(_0x43199b){if(_0x43199b){freeIsNotKey(_0x43199b,_0x3f7645['servicenowAccounts'],'id');for(var _0x47abd1=0x0,_0x12fc2b={},_0x15ab00={};_0x47abd1<_0x43199b['length'];_0x47abd1+=0x1){_0x12fc2b=_0x43199b[_0x47abd1];if(_[_0x5b0e('0x43')](_0x3f7645[_0x5b0e('0x1f')][_0x12fc2b['id']])){_0x3f7645[_0x5b0e('0x1f')][_0x12fc2b['id']]=new ServicenowAccount(_0x12fc2b);}else{_0x3f7645[_0x5b0e('0x40')](_0x3f7645[_0x5b0e('0x1f')][_0x12fc2b['id']],_0x12fc2b);}}}return _0x3f7645[_0x5b0e('0x1f')];};};Realtime[_0x5b0e('0x3f')]['initDynamics365Accounts']=function(){var _0x8b8c7d=this;return function(_0x22f63a){if(_0x22f63a){freeIsNotKey(_0x22f63a,_0x8b8c7d[_0x5b0e('0x20')],'id');for(var _0x303d62=0x0,_0x5372e5={},_0x1b8c10={};_0x303d62<_0x22f63a[_0x5b0e('0x42')];_0x303d62+=0x1){_0x5372e5=_0x22f63a[_0x303d62];if(_[_0x5b0e('0x43')](_0x8b8c7d[_0x5b0e('0x20')][_0x5372e5['id']])){_0x8b8c7d[_0x5b0e('0x20')][_0x5372e5['id']]=new Dynamics365Account(_0x5372e5);}else{_0x8b8c7d['mergeFromDatabase'](_0x8b8c7d[_0x5b0e('0x20')][_0x5372e5['id']],_0x5372e5);}}}return _0x8b8c7d[_0x5b0e('0x20')];};};Realtime['prototype']['initFreshsalesAccounts']=function(){var _0x41c2a2=this;return function(_0xabe7c3){if(_0xabe7c3){freeIsNotKey(_0xabe7c3,_0x41c2a2['freshsalesAccounts'],'id');for(var _0x3e387b=0x0,_0x24659d={},_0x2d1fb4={};_0x3e387b<_0xabe7c3[_0x5b0e('0x42')];_0x3e387b+=0x1){_0x24659d=_0xabe7c3[_0x3e387b];if(_[_0x5b0e('0x43')](_0x41c2a2['freshsalesAccounts'][_0x24659d['id']])){_0x41c2a2['freshsalesAccounts'][_0x24659d['id']]=new FreshsalesAccount(_0x24659d);}else{_0x41c2a2[_0x5b0e('0x40')](_0x41c2a2[_0x5b0e('0x21')][_0x24659d['id']],_0x24659d);}}}return _0x41c2a2[_0x5b0e('0x21')];};};Realtime[_0x5b0e('0x3f')][_0x5b0e('0x4e')]=function(){var _0x2d0ba0=this;return function(_0x4fc014){for(var _0x2a37ef=0x0;_0x2a37ef<_0x4fc014[_0x5b0e('0x42')];_0x2a37ef+=0x1){_[_0x5b0e('0x4f')](_0x2d0ba0[_0x5b0e('0x12')][_0x4fc014[_0x2a37ef][_0x5b0e('0x25')]],_0x4fc014[_0x2a37ef]);}return _0x2d0ba0[_0x5b0e('0x12')];};};Realtime[_0x5b0e('0x3f')][_0x5b0e('0x50')]=function(){var _0x263d06=this;return function(_0x2736de){clearVoiceQueues(_0x263d06[_0x5b0e('0x12')]);if(_0x2736de){_0x2736de=_[_0x5b0e('0x51')](_0x2736de,_0x5b0e('0x52'));for(var _0x285f67 in _0x2736de){if(_0x2736de['hasOwnProperty'](_0x285f67)){var _0x1cfd21={};for(var _0x4e5b8f=0x0;_0x4e5b8f<_0x2736de[_0x285f67][_0x5b0e('0x42')];_0x4e5b8f+=0x1){var _0x449c87=_0x2736de[_0x285f67][_0x4e5b8f][_0x5b0e('0x53')];if(_0x263d06['voiceQueues'][_0x449c87]){if(_0x2736de[_0x285f67][_0x4e5b8f]['queuecallerexit']){_0x263d06[_0x5b0e('0x12')][_0x449c87][_0x5b0e('0x32')]+=0x1;}if(_0x2736de[_0x285f67][_0x4e5b8f][_0x5b0e('0x54')]){_0x263d06[_0x5b0e('0x12')][_0x449c87][_0x5b0e('0x33')]+=0x1;}_0x263d06[_0x5b0e('0x12')][_0x449c87]['sumHoldTime']+=moment(_0x2736de[_0x285f67][_0x4e5b8f][_0x5b0e('0x55')])[_0x5b0e('0x56')](moment(_0x2736de[_0x285f67][_0x4e5b8f]['queuecallerjoinAt']),'seconds')||0x0;if(_0x4e5b8f===_0x2736de[_0x285f67][_0x5b0e('0x42')]-0x1){_0x263d06[_0x5b0e('0x12')][_0x449c87][_0x5b0e('0x2d')]+=moment(_0x2736de[_0x285f67][_0x4e5b8f]['queuecallercompleteAt']||_0x2736de[_0x285f67][_0x4e5b8f]['queuecallerabandonAt']||_0x2736de[_0x285f67][_0x4e5b8f][_0x5b0e('0x57')])[_0x5b0e('0x56')](moment(_0x2736de[_0x285f67][_0x4e5b8f]['queuecallerjoinAt']),_0x5b0e('0x58'))||0x0;_0x263d06[_0x5b0e('0x12')][_0x449c87][_0x5b0e('0x2a')]+=0x1;if(_0x2736de[_0x285f67][_0x4e5b8f]['queuecallercomplete']){_0x263d06[_0x5b0e('0x12')][_0x449c87][_0x5b0e('0x2b')]+=0x1;_0x263d06[_0x5b0e('0x12')][_0x449c87][_0x5b0e('0x2e')]+=moment(_0x2736de[_0x285f67][_0x4e5b8f][_0x5b0e('0x59')])['diff'](moment(_0x2736de[_0x285f67][_0x4e5b8f]['queuecallerleaveAt']),_0x5b0e('0x58'))||0x0;}}else{_0x263d06[_0x5b0e('0x12')][_0x449c87][_0x5b0e('0x2d')]+=_0x263d06[_0x5b0e('0x12')][_0x449c87]['sumHoldTime']||0x0;}}}}}}return _0x263d06['voiceQueues'];};};Realtime[_0x5b0e('0x3f')][_0x5b0e('0x5a')]=function(){var _0x36914d=this;return function(_0x588e2b){clearVoiceCallReports(_0x36914d[_0x5b0e('0x14')]);if(_0x588e2b){for(var _0xb0782c=0x0;_0xb0782c<_0x588e2b[_0x5b0e('0x42')];_0xb0782c+=0x1){_0x36914d[_0x5b0e('0x14')][_0x5b0e('0x2a')]+=0x1;_0x36914d[_0x5b0e('0x14')]['sumDuration']+=_0x588e2b[_0xb0782c][_0x5b0e('0x5b')];if(_0x588e2b[_0xb0782c]['disposition']==='ANSWERED'){_0x36914d[_0x5b0e('0x14')][_0x5b0e('0x2b')]+=0x1;_0x36914d['outbound'][_0x5b0e('0x2c')]+=_0x588e2b[_0xb0782c][_0x5b0e('0x5b')]-_0x588e2b[_0xb0782c][_0x5b0e('0x5c')]||0x0;_0x36914d[_0x5b0e('0x14')][_0x5b0e('0x2e')]+=_0x588e2b[_0xb0782c][_0x5b0e('0x5c')];}}}return _0x36914d[_0x5b0e('0x14')];};};Realtime[_0x5b0e('0x3f')][_0x5b0e('0x5d')]=function(){var _0x6b9c8=this;return function(_0x411256){if(_0x411256){freeIsNotKey(_0x411256,_0x6b9c8[_0x5b0e('0x5e')],'name');for(var _0x370eb6=0x0,_0x4deff5={};_0x370eb6<_0x411256[_0x5b0e('0x42')];_0x370eb6+=0x1){_0x4deff5=_0x411256[_0x370eb6];if(_[_0x5b0e('0x43')](_0x6b9c8['campaigns'][_0x4deff5[_0x5b0e('0x25')]])){_0x6b9c8[_0x5b0e('0x5e')][_0x4deff5[_0x5b0e('0x25')]]=new Campaign(_0x4deff5);}else{_0x6b9c8[_0x5b0e('0x40')](_0x6b9c8[_0x5b0e('0x5e')][_0x4deff5[_0x5b0e('0x25')]],_0x4deff5);_0x6b9c8['campaigns'][_0x4deff5[_0x5b0e('0x25')]][_0x5b0e('0x5f')]=_0x4deff5[_0x5b0e('0x60')]?_0x4deff5[_0x5b0e('0x60')][_0x5b0e('0x25')]:undefined;}}}return _0x6b9c8[_0x5b0e('0x5e')];};};Realtime[_0x5b0e('0x3f')][_0x5b0e('0x61')]=function(){var _0x3bd8e6=this;return function(_0x544aba){if(_0x544aba){freeIsNotKey(_0x544aba,_0x3bd8e6[_0x5b0e('0x15')],'id');for(var _0x370fb9=0x0,_0x52e77a={};_0x370fb9<_0x544aba['length'];_0x370fb9+=0x1){_0x52e77a=_0x544aba[_0x370fb9];if(_[_0x5b0e('0x43')](_0x3bd8e6[_0x5b0e('0x15')][_0x52e77a['id']])){_0x3bd8e6[_0x5b0e('0x15')][_0x52e77a['id']]=new VoiceExtension(_0x52e77a);}else{_0x3bd8e6['mergeFromDatabase'](_0x3bd8e6[_0x5b0e('0x15')][_0x52e77a['id']],_0x52e77a);}}}return _0x3bd8e6[_0x5b0e('0x15')];};};Realtime[_0x5b0e('0x3f')][_0x5b0e('0x62')]=function(){var _0x364ad9=this;return function(_0x40964b){clearCampaigns(_0x364ad9[_0x5b0e('0x5e')]);for(var _0x4b32ea=0x0;_0x4b32ea<_0x40964b[_0x5b0e('0x42')];_0x4b32ea+=0x1){_[_0x5b0e('0x4f')](_0x364ad9[_0x5b0e('0x5e')][_0x40964b[_0x4b32ea]['name']],_0x40964b[_0x4b32ea]);}return _0x364ad9[_0x5b0e('0x5e')];};};Realtime[_0x5b0e('0x3f')][_0x5b0e('0x63')]=function(){var _0x34d4e6=this;return function(_0x391a49){if(_0x391a49){freeIsNotKey(_0x391a49,_0x34d4e6[_0x5b0e('0x22')],'id');for(var _0x5e3563=0x0,_0x166898={},_0x79c032={};_0x5e3563<_0x391a49['length'];_0x5e3563+=0x1){_0x166898=_0x391a49[_0x5e3563];if(_[_0x5b0e('0x43')](_0x34d4e6['faxAccounts'][_0x166898['id']])){_0x34d4e6[_0x5b0e('0x22')][_0x166898['id']]=new FaxAccount(_0x166898);}else{_0x34d4e6[_0x5b0e('0x40')](_0x34d4e6[_0x5b0e('0x22')][_0x166898['id']],_0x166898);}}}return _0x34d4e6[_0x5b0e('0x22')];};};module['exports']=Realtime; \ No newline at end of file +var _0xba34=['vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','hasOwnProperty','mapKeys','format','isNil','interface','SIP/%s','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','isEmpty','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','length','mergeFromDatabase','isUndefined','name','initTrunks','initTriggers','initZendeskAccounts','initSalesforceAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','billableseconds','campaigns','dialQueueProject','SquareProject','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','util','lodash','moment','../model/agent','../model/telephone','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','templates','outbound','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts'];(function(_0x4ca1e7,_0x40c3c9){var _0x101379=function(_0x1dba71){while(--_0x1dba71){_0x4ca1e7['push'](_0x4ca1e7['shift']());}};_0x101379(++_0x40c3c9);}(_0xba34,0x119));var _0x4ba3=function(_0x24cf17,_0x5c4b0b){_0x24cf17=_0x24cf17-0x0;var _0x56411e=_0xba34[_0x24cf17];return _0x56411e;};'use strict';var util=require(_0x4ba3('0x0'));var _=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var Agent=require(_0x4ba3('0x3'));var Telephone=require(_0x4ba3('0x4'));var Trunk=require('../model/trunk');var VoiceQueue=require('../model/voiceQueue');var Trigger=require('../model/trigger');var Template=require(_0x4ba3('0x5'));var Campaign=require(_0x4ba3('0x6'));var VoiceExtension=require(_0x4ba3('0x7'));var ZendeskAccount=require(_0x4ba3('0x8'));var SalesforceAccount=require(_0x4ba3('0x9'));var FreshdeskAccount=require(_0x4ba3('0xa'));var SugarcrmAccount=require(_0x4ba3('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x4ba3('0xc'));var VtigerAccount=require(_0x4ba3('0xd'));var ServicenowAccount=require(_0x4ba3('0xe'));var Dynamics365Account=require(_0x4ba3('0xf'));var FreshsalesAccount=require(_0x4ba3('0x10'));var FaxAccount=require(_0x4ba3('0x11'));var Realtime=function(){this[_0x4ba3('0x12')]={};this[_0x4ba3('0x13')]={};this[_0x4ba3('0x14')]={};this[_0x4ba3('0x15')]={};this[_0x4ba3('0x16')]={};this['campaigns']={};this[_0x4ba3('0x17')]={};this[_0x4ba3('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x4ba3('0x19')]={};this['queueChannels']={};this[_0x4ba3('0x1a')]={};this['timers']={};this[_0x4ba3('0x1b')]={};this[_0x4ba3('0x1c')]={};this[_0x4ba3('0x1d')]={};this[_0x4ba3('0x1e')]={};this[_0x4ba3('0x1f')]={};this[_0x4ba3('0x20')]={};this[_0x4ba3('0x21')]={};this[_0x4ba3('0x22')]={};this[_0x4ba3('0x23')]={};this[_0x4ba3('0x24')]={};this[_0x4ba3('0x25')]={};this[_0x4ba3('0x26')]={};};function freeIsNotKey(_0x29a9d1,_0x25f584,_0x40e75b){var _0x1b7776=_['mapKeys'](_0x29a9d1,function(_0x382fd0,_0x788277){return _0x382fd0[_0x40e75b];});for(var _0x5ff7ce in _0x25f584){if(_0x25f584[_0x4ba3('0x27')](_0x5ff7ce)){if(!_0x1b7776[_0x5ff7ce]){delete _0x25f584[_0x5ff7ce];}}}}function freeIsNotKeySip(_0x556290,_0x2519bb){var _0xe4eff9=_[_0x4ba3('0x28')](_0x556290,function(_0x1e2ce5,_0x184332){return util[_0x4ba3('0x29')]('SIP/%s',_0x1e2ce5['name']);});for(var _0x2278b0 in _0x2519bb){if(_0x2519bb['hasOwnProperty'](_0x2278b0)){if(!_0xe4eff9[_0x2278b0]){delete _0x2519bb[_0x2278b0];}}}}function freeIsNotKeyAgent(_0x18dff5,_0x163967){var _0x413bb3=_[_0x4ba3('0x28')](_0x18dff5,function(_0x46f1f5,_0x278a23){var _0x4a0823=_[_0x4ba3('0x2a')](_0x46f1f5[_0x4ba3('0x2b')])?util['format'](_0x4ba3('0x2c'),_0x46f1f5['name']):_0x46f1f5[_0x4ba3('0x2b')];return _0x4a0823;});for(var _0x18abb3 in _0x163967){if(_0x163967[_0x4ba3('0x27')](_0x18abb3)){if(!_0x413bb3[_0x18abb3]){delete _0x163967[_0x18abb3];}}}}function clearVoiceCallReports(_0x37e6f3){_0x37e6f3[_0x4ba3('0x2d')]=0x0;_0x37e6f3[_0x4ba3('0x2e')]=0x0;_0x37e6f3[_0x4ba3('0x2f')]=0x0;_0x37e6f3[_0x4ba3('0x30')]=0x0;_0x37e6f3[_0x4ba3('0x31')]=0x0;}function clearCampaigns(_0x2e67a0){if(!_['isEmpty'](_0x2e67a0)){for(var _0x252f37 in _0x2e67a0){if(_0x2e67a0[_0x4ba3('0x27')](_0x252f37)){_0x2e67a0[_0x252f37][_0x4ba3('0x32')]=0x0;_0x2e67a0[_0x252f37]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x10537e){if(!_[_0x4ba3('0x33')](_0x10537e)){for(var _0x44d78c in _0x10537e){if(_0x10537e['hasOwnProperty'](_0x44d78c)){_0x10537e[_0x44d78c][_0x4ba3('0x2d')]=0x0;_0x10537e[_0x44d78c][_0x4ba3('0x2e')]=0x0;_0x10537e[_0x44d78c][_0x4ba3('0x34')]=0x0;_0x10537e[_0x44d78c][_0x4ba3('0x35')]=0x0;_0x10537e[_0x44d78c]['sumHoldTime']=0x0;_0x10537e[_0x44d78c]['sumDuration']=0x0;_0x10537e[_0x44d78c][_0x4ba3('0x31')]=0x0;_0x10537e[_0x44d78c][_0x4ba3('0x36')]=0x0;_0x10537e[_0x44d78c][_0x4ba3('0x37')]=0x0;_0x10537e[_0x44d78c][_0x4ba3('0x38')]=0x0;_0x10537e[_0x44d78c][_0x4ba3('0x39')]=0x0;_0x10537e[_0x44d78c][_0x4ba3('0x3a')]=0x0;_0x10537e[_0x44d78c]['outboundUnknownCallsDay']=0x0;_0x10537e[_0x44d78c][_0x4ba3('0x3b')]=0x0;_0x10537e[_0x44d78c][_0x4ba3('0x3c')]=0x0;_0x10537e[_0x44d78c][_0x4ba3('0x3d')]=0x0;_0x10537e[_0x44d78c][_0x4ba3('0x3e')]=0x0;_0x10537e[_0x44d78c][_0x4ba3('0x3f')]=0x0;_0x10537e[_0x44d78c][_0x4ba3('0x40')]=0x0;_0x10537e[_0x44d78c][_0x4ba3('0x36')]=0x0;_0x10537e[_0x44d78c][_0x4ba3('0x41')]=0x0;_0x10537e[_0x44d78c][_0x4ba3('0x42')]=!![];}}}}Realtime[_0x4ba3('0x43')]['mergeFromDatabase']=function(_0x5a453f,_0x4e2af0){for(var _0x2d226a in _0x4e2af0){if(_0x5a453f[_0x4ba3('0x27')](_0x2d226a)){_0x5a453f[_0x2d226a]=_0x4e2af0[_0x2d226a];}}};Realtime[_0x4ba3('0x43')][_0x4ba3('0x44')]=function(){var _0x3eea33=this;return function(_0x137f9b){if(_0x137f9b){freeIsNotKeyAgent(_0x137f9b,_0x3eea33[_0x4ba3('0x12')]);for(var _0xe1abe8=0x0,_0x2f3495={},_0x3dfe4b={};_0xe1abe8<_0x137f9b[_0x4ba3('0x45')];_0xe1abe8+=0x1){_0x2f3495=_0x137f9b[_0xe1abe8];var _0x3439cb=_['isNil'](_0x2f3495[_0x4ba3('0x2b')])?util[_0x4ba3('0x29')](_0x4ba3('0x2c'),_0x2f3495['name']):_0x2f3495[_0x4ba3('0x2b')];if(_['isUndefined'](_0x3eea33[_0x4ba3('0x12')][_0x3439cb])){_0x3eea33[_0x4ba3('0x12')][_0x3439cb]=new Agent(_0x2f3495);}else{_0x3eea33[_0x4ba3('0x46')](_0x3eea33[_0x4ba3('0x12')][_0x3439cb],_0x2f3495);}}}return _0x3eea33[_0x4ba3('0x12')];};};Realtime[_0x4ba3('0x43')]['initTelephones']=function(){var _0x336d6d=this;return function(_0x3cf56c){if(_0x3cf56c){freeIsNotKeySip(_0x3cf56c,_0x336d6d[_0x4ba3('0x13')]);for(var _0x4b702b=0x0,_0x1865b8={},_0x40ab62={};_0x4b702b<_0x3cf56c['length'];_0x4b702b+=0x1){_0x1865b8=_0x3cf56c[_0x4b702b];if(_[_0x4ba3('0x47')](_0x336d6d['telephones'][util['format'](_0x4ba3('0x2c'),_0x1865b8[_0x4ba3('0x48')])])){_0x336d6d[_0x4ba3('0x13')][util[_0x4ba3('0x29')](_0x4ba3('0x2c'),_0x1865b8['name'])]=new Telephone(_0x1865b8);}else{_0x336d6d[_0x4ba3('0x46')](_0x336d6d[_0x4ba3('0x13')][util[_0x4ba3('0x29')](_0x4ba3('0x2c'),_0x1865b8[_0x4ba3('0x48')])],_0x1865b8);}}}return _0x336d6d[_0x4ba3('0x13')];};};Realtime[_0x4ba3('0x43')][_0x4ba3('0x49')]=function(){var _0x553475=this;return function(_0x30718b){if(_0x30718b){freeIsNotKeySip(_0x30718b,_0x553475[_0x4ba3('0x14')]);for(var _0x3cb07f=0x0,_0x3338d9={},_0xa1757={};_0x3cb07f<_0x30718b[_0x4ba3('0x45')];_0x3cb07f+=0x1){_0x3338d9=_0x30718b[_0x3cb07f];if(_[_0x4ba3('0x47')](_0x553475[_0x4ba3('0x14')][util[_0x4ba3('0x29')](_0x4ba3('0x2c'),_0x3338d9[_0x4ba3('0x48')])])){_0x553475[_0x4ba3('0x14')][util[_0x4ba3('0x29')](_0x4ba3('0x2c'),_0x3338d9['name'])]=new Trunk(_0x3338d9);}else{_0x553475['mergeFromDatabase'](_0x553475['trunks'][util['format']('SIP/%s',_0x3338d9[_0x4ba3('0x48')])],_0x3338d9);}}}return _0x553475['trunks'];};};Realtime[_0x4ba3('0x43')]['initVoiceQueues']=function(){var _0x53d6eb=this;return function(_0x2ac317){if(_0x2ac317){freeIsNotKey(_0x2ac317,_0x53d6eb[_0x4ba3('0x15')],_0x4ba3('0x48'));for(var _0xc1ca4b=0x0,_0x5a56a5={},_0x138467={};_0xc1ca4b<_0x2ac317['length'];_0xc1ca4b+=0x1){_0x5a56a5=_0x2ac317[_0xc1ca4b];if(_[_0x4ba3('0x47')](_0x53d6eb['voiceQueues'][_0x5a56a5[_0x4ba3('0x48')]])){_0x53d6eb[_0x4ba3('0x15')][_0x5a56a5[_0x4ba3('0x48')]]=new VoiceQueue(_0x5a56a5);}else{_0x53d6eb[_0x4ba3('0x46')](_0x53d6eb[_0x4ba3('0x15')][_0x5a56a5[_0x4ba3('0x48')]],_0x5a56a5);}}}return _0x53d6eb[_0x4ba3('0x15')];};};Realtime['prototype'][_0x4ba3('0x4a')]=function(){var _0x13cc06=this;return function(_0x1e418c){if(_0x1e418c){freeIsNotKey(_0x1e418c,_0x13cc06[_0x4ba3('0x16')],'id');for(var _0x24986a=0x0,_0x480668={},_0x56b55d={};_0x24986a<_0x1e418c[_0x4ba3('0x45')];_0x24986a+=0x1){_0x480668=_0x1e418c[_0x24986a];if(_[_0x4ba3('0x47')](_0x13cc06[_0x4ba3('0x16')][_0x480668['id']])){_0x13cc06['triggers'][_0x480668['id']]=new Trigger(_0x480668);}else{_0x13cc06[_0x4ba3('0x46')](_0x13cc06[_0x4ba3('0x16')][_0x480668['id']],_0x480668);}}}return _0x13cc06[_0x4ba3('0x16')];};};Realtime['prototype']['initTemplates']=function(){var _0x34dc04=this;return function(_0x482a83){if(_0x482a83){freeIsNotKey(_0x482a83,_0x34dc04[_0x4ba3('0x17')],'id');for(var _0x1b9f76=0x0,_0x1aab37={},_0x30eb6e={};_0x1b9f76<_0x482a83[_0x4ba3('0x45')];_0x1b9f76+=0x1){_0x1aab37=_0x482a83[_0x1b9f76];if(_[_0x4ba3('0x47')](_0x34dc04['templates'][_0x1aab37['id']])){_0x34dc04[_0x4ba3('0x17')][_0x1aab37['id']]=new Template(_0x1aab37);}else{_0x34dc04[_0x4ba3('0x46')](_0x34dc04['templates'][_0x1aab37['id']],_0x1aab37);}}}return _0x34dc04[_0x4ba3('0x17')];};};Realtime[_0x4ba3('0x43')][_0x4ba3('0x4b')]=function(){var _0x19d6a3=this;return function(_0x360472){if(_0x360472){freeIsNotKey(_0x360472,_0x19d6a3['zendeskAccounts'],'id');for(var _0x37a312=0x0,_0x38de05={},_0x588ee1={};_0x37a312<_0x360472[_0x4ba3('0x45')];_0x37a312+=0x1){_0x38de05=_0x360472[_0x37a312];if(_[_0x4ba3('0x47')](_0x19d6a3[_0x4ba3('0x1c')][_0x38de05['id']])){_0x19d6a3[_0x4ba3('0x1c')][_0x38de05['id']]=new ZendeskAccount(_0x38de05);}else{_0x19d6a3[_0x4ba3('0x46')](_0x19d6a3[_0x4ba3('0x1c')][_0x38de05['id']],_0x38de05);}}}return _0x19d6a3[_0x4ba3('0x1c')];};};Realtime[_0x4ba3('0x43')][_0x4ba3('0x4c')]=function(){var _0x428a27=this;return function(_0x6ad6aa){if(_0x6ad6aa){freeIsNotKey(_0x6ad6aa,_0x428a27[_0x4ba3('0x1d')],'id');for(var _0x438ce3=0x0,_0x22890a={},_0x2795df={};_0x438ce3<_0x6ad6aa['length'];_0x438ce3+=0x1){_0x22890a=_0x6ad6aa[_0x438ce3];if(_['isUndefined'](_0x428a27['salesforceAccounts'][_0x22890a['id']])){_0x428a27[_0x4ba3('0x1d')][_0x22890a['id']]=new SalesforceAccount(_0x22890a);}else{_0x428a27[_0x4ba3('0x46')](_0x428a27[_0x4ba3('0x1d')][_0x22890a['id']],_0x22890a);}}}return _0x428a27[_0x4ba3('0x1d')];};};Realtime[_0x4ba3('0x43')]['initFreshdeskAccounts']=function(){var _0x3920c0=this;return function(_0x4620ae){if(_0x4620ae){freeIsNotKey(_0x4620ae,_0x3920c0[_0x4ba3('0x1f')],'id');for(var _0x42a443=0x0,_0x5359d1={},_0x1e83fb={};_0x42a443<_0x4620ae[_0x4ba3('0x45')];_0x42a443+=0x1){_0x5359d1=_0x4620ae[_0x42a443];if(_[_0x4ba3('0x47')](_0x3920c0[_0x4ba3('0x1f')][_0x5359d1['id']])){_0x3920c0[_0x4ba3('0x1f')][_0x5359d1['id']]=new FreshdeskAccount(_0x5359d1);}else{_0x3920c0[_0x4ba3('0x46')](_0x3920c0[_0x4ba3('0x1f')][_0x5359d1['id']],_0x5359d1);}}}return _0x3920c0[_0x4ba3('0x1f')];};};Realtime[_0x4ba3('0x43')]['initZohoAccounts']=function(){var _0x20c849=this;return function(_0x42bb4b){if(_0x42bb4b){freeIsNotKey(_0x42bb4b,_0x20c849[_0x4ba3('0x20')],'id');for(var _0x451696=0x0,_0x22d5ca={},_0x3d3313={};_0x451696<_0x42bb4b[_0x4ba3('0x45')];_0x451696+=0x1){_0x22d5ca=_0x42bb4b[_0x451696];if(_[_0x4ba3('0x47')](_0x20c849['zohoAccounts'][_0x22d5ca['id']])){_0x20c849[_0x4ba3('0x20')][_0x22d5ca['id']]=new ZohoAccount(_0x22d5ca);}else{_0x20c849[_0x4ba3('0x46')](_0x20c849[_0x4ba3('0x20')][_0x22d5ca['id']],_0x22d5ca);}}}return _0x20c849['zohoAccounts'];};};Realtime[_0x4ba3('0x43')]['initDeskAccounts']=function(){var _0x1b7c4e=this;return function(_0x4cc10a){if(_0x4cc10a){freeIsNotKey(_0x4cc10a,_0x1b7c4e[_0x4ba3('0x21')],'id');for(var _0x369a9f=0x0,_0xf0fd32={},_0x4b5289={};_0x369a9f<_0x4cc10a[_0x4ba3('0x45')];_0x369a9f+=0x1){_0xf0fd32=_0x4cc10a[_0x369a9f];if(_[_0x4ba3('0x47')](_0x1b7c4e[_0x4ba3('0x21')][_0xf0fd32['id']])){_0x1b7c4e[_0x4ba3('0x21')][_0xf0fd32['id']]=new DeskAccount(_0xf0fd32);}else{_0x1b7c4e[_0x4ba3('0x46')](_0x1b7c4e['deskAccounts'][_0xf0fd32['id']],_0xf0fd32);}}}return _0x1b7c4e[_0x4ba3('0x21')];};};Realtime[_0x4ba3('0x43')][_0x4ba3('0x4d')]=function(){var _0x469ef0=this;return function(_0x454a0a){if(_0x454a0a){freeIsNotKey(_0x454a0a,_0x469ef0[_0x4ba3('0x1e')],'id');for(var _0x3fdf7f=0x0,_0x38699e={},_0x39ddf3={};_0x3fdf7f<_0x454a0a[_0x4ba3('0x45')];_0x3fdf7f+=0x1){_0x38699e=_0x454a0a[_0x3fdf7f];if(_[_0x4ba3('0x47')](_0x469ef0['sugarcrmAccounts'][_0x38699e['id']])){_0x469ef0[_0x4ba3('0x1e')][_0x38699e['id']]=new SugarcrmAccount(_0x38699e);}else{_0x469ef0[_0x4ba3('0x46')](_0x469ef0['sugarcrmAccounts'][_0x38699e['id']],_0x38699e);}}}return _0x469ef0['sugarcrmAccounts'];};};Realtime[_0x4ba3('0x43')][_0x4ba3('0x4e')]=function(){var _0x5c7c2f=this;return function(_0x220c83){if(_0x220c83){freeIsNotKey(_0x220c83,_0x5c7c2f[_0x4ba3('0x22')],'id');for(var _0x1fb2aa=0x0,_0x589214={},_0x1f5815={};_0x1fb2aa<_0x220c83[_0x4ba3('0x45')];_0x1fb2aa+=0x1){_0x589214=_0x220c83[_0x1fb2aa];if(_[_0x4ba3('0x47')](_0x5c7c2f[_0x4ba3('0x22')][_0x589214['id']])){_0x5c7c2f[_0x4ba3('0x22')][_0x589214['id']]=new VtigerAccount(_0x589214);}else{_0x5c7c2f[_0x4ba3('0x46')](_0x5c7c2f['vtigerAccounts'][_0x589214['id']],_0x589214);}}}return _0x5c7c2f[_0x4ba3('0x22')];};};Realtime[_0x4ba3('0x43')][_0x4ba3('0x4f')]=function(){var _0x4e5bd7=this;return function(_0x3de990){if(_0x3de990){freeIsNotKey(_0x3de990,_0x4e5bd7[_0x4ba3('0x23')],'id');for(var _0x385cee=0x0,_0x24f035={},_0x21c8b1={};_0x385cee<_0x3de990[_0x4ba3('0x45')];_0x385cee+=0x1){_0x24f035=_0x3de990[_0x385cee];if(_[_0x4ba3('0x47')](_0x4e5bd7[_0x4ba3('0x23')][_0x24f035['id']])){_0x4e5bd7['servicenowAccounts'][_0x24f035['id']]=new ServicenowAccount(_0x24f035);}else{_0x4e5bd7['mergeFromDatabase'](_0x4e5bd7[_0x4ba3('0x23')][_0x24f035['id']],_0x24f035);}}}return _0x4e5bd7['servicenowAccounts'];};};Realtime[_0x4ba3('0x43')][_0x4ba3('0x50')]=function(){var _0x442d66=this;return function(_0x5c7fc2){if(_0x5c7fc2){freeIsNotKey(_0x5c7fc2,_0x442d66[_0x4ba3('0x24')],'id');for(var _0x1679f3=0x0,_0x1b444e={},_0x5baf26={};_0x1679f3<_0x5c7fc2[_0x4ba3('0x45')];_0x1679f3+=0x1){_0x1b444e=_0x5c7fc2[_0x1679f3];if(_['isUndefined'](_0x442d66[_0x4ba3('0x24')][_0x1b444e['id']])){_0x442d66[_0x4ba3('0x24')][_0x1b444e['id']]=new Dynamics365Account(_0x1b444e);}else{_0x442d66['mergeFromDatabase'](_0x442d66[_0x4ba3('0x24')][_0x1b444e['id']],_0x1b444e);}}}return _0x442d66[_0x4ba3('0x24')];};};Realtime[_0x4ba3('0x43')][_0x4ba3('0x51')]=function(){var _0x2feb68=this;return function(_0xa9a35d){if(_0xa9a35d){freeIsNotKey(_0xa9a35d,_0x2feb68[_0x4ba3('0x25')],'id');for(var _0x329874=0x0,_0x360127={},_0x5c9eda={};_0x329874<_0xa9a35d[_0x4ba3('0x45')];_0x329874+=0x1){_0x360127=_0xa9a35d[_0x329874];if(_[_0x4ba3('0x47')](_0x2feb68[_0x4ba3('0x25')][_0x360127['id']])){_0x2feb68[_0x4ba3('0x25')][_0x360127['id']]=new FreshsalesAccount(_0x360127);}else{_0x2feb68[_0x4ba3('0x46')](_0x2feb68[_0x4ba3('0x25')][_0x360127['id']],_0x360127);}}}return _0x2feb68[_0x4ba3('0x25')];};};Realtime[_0x4ba3('0x43')][_0x4ba3('0x52')]=function(){var _0x1a3180=this;return function(_0x468219){for(var _0x3ab4bd=0x0;_0x3ab4bd<_0x468219['length'];_0x3ab4bd+=0x1){_[_0x4ba3('0x53')](_0x1a3180[_0x4ba3('0x15')][_0x468219[_0x3ab4bd]['name']],_0x468219[_0x3ab4bd]);}return _0x1a3180[_0x4ba3('0x15')];};};Realtime[_0x4ba3('0x43')]['initVoiceQueueReports']=function(){var _0x54c96a=this;return function(_0x4ce27){clearVoiceQueues(_0x54c96a[_0x4ba3('0x15')]);if(_0x4ce27){_0x4ce27=_[_0x4ba3('0x54')](_0x4ce27,_0x4ba3('0x55'));for(var _0x37b966 in _0x4ce27){if(_0x4ce27[_0x4ba3('0x27')](_0x37b966)){var _0x2a6bb9={};for(var _0x1246bc=0x0;_0x1246bc<_0x4ce27[_0x37b966]['length'];_0x1246bc+=0x1){var _0x272480=_0x4ce27[_0x37b966][_0x1246bc]['queue'];if(_0x54c96a[_0x4ba3('0x15')][_0x272480]){if(_0x4ce27[_0x37b966][_0x1246bc][_0x4ba3('0x56')]){_0x54c96a[_0x4ba3('0x15')][_0x272480][_0x4ba3('0x34')]+=0x1;}if(_0x4ce27[_0x37b966][_0x1246bc][_0x4ba3('0x57')]){_0x54c96a[_0x4ba3('0x15')][_0x272480][_0x4ba3('0x35')]+=0x1;}_0x54c96a[_0x4ba3('0x15')][_0x272480]['sumHoldTime']+=moment(_0x4ce27[_0x37b966][_0x1246bc][_0x4ba3('0x58')])[_0x4ba3('0x59')](moment(_0x4ce27[_0x37b966][_0x1246bc][_0x4ba3('0x5a')]),'seconds')||0x0;if(_0x1246bc===_0x4ce27[_0x37b966][_0x4ba3('0x45')]-0x1){_0x54c96a[_0x4ba3('0x15')][_0x272480][_0x4ba3('0x30')]+=moment(_0x4ce27[_0x37b966][_0x1246bc][_0x4ba3('0x5b')]||_0x4ce27[_0x37b966][_0x1246bc][_0x4ba3('0x5c')]||_0x4ce27[_0x37b966][_0x1246bc][_0x4ba3('0x5d')])[_0x4ba3('0x59')](moment(_0x4ce27[_0x37b966][_0x1246bc]['queuecallerjoinAt']),'seconds')||0x0;_0x54c96a[_0x4ba3('0x15')][_0x272480]['total']+=0x1;if(_0x4ce27[_0x37b966][_0x1246bc][_0x4ba3('0x5e')]){_0x54c96a[_0x4ba3('0x15')][_0x272480][_0x4ba3('0x2e')]+=0x1;_0x54c96a[_0x4ba3('0x15')][_0x272480]['sumBillable']+=moment(_0x4ce27[_0x37b966][_0x1246bc]['queuecallercompleteAt'])[_0x4ba3('0x59')](moment(_0x4ce27[_0x37b966][_0x1246bc][_0x4ba3('0x58')]),'seconds')||0x0;}}else{_0x54c96a[_0x4ba3('0x15')][_0x272480][_0x4ba3('0x30')]+=_0x54c96a[_0x4ba3('0x15')][_0x272480][_0x4ba3('0x2f')]||0x0;}}}}}}return _0x54c96a[_0x4ba3('0x15')];};};Realtime[_0x4ba3('0x43')][_0x4ba3('0x5f')]=function(){var _0x489c19=this;return function(_0x18da09){clearVoiceCallReports(_0x489c19[_0x4ba3('0x18')]);if(_0x18da09){for(var _0x211d2b=0x0;_0x211d2b<_0x18da09['length'];_0x211d2b+=0x1){_0x489c19[_0x4ba3('0x18')][_0x4ba3('0x2d')]+=0x1;_0x489c19['outbound'][_0x4ba3('0x30')]+=_0x18da09[_0x211d2b][_0x4ba3('0x60')];if(_0x18da09[_0x211d2b]['disposition']==='ANSWERED'){_0x489c19['outbound']['answered']+=0x1;_0x489c19[_0x4ba3('0x18')][_0x4ba3('0x2f')]+=_0x18da09[_0x211d2b][_0x4ba3('0x60')]-_0x18da09[_0x211d2b][_0x4ba3('0x61')]||0x0;_0x489c19[_0x4ba3('0x18')][_0x4ba3('0x31')]+=_0x18da09[_0x211d2b][_0x4ba3('0x61')];}}}return _0x489c19['outbound'];};};Realtime[_0x4ba3('0x43')]['initCampaigns']=function(){var _0x31a725=this;return function(_0x5180f1){if(_0x5180f1){freeIsNotKey(_0x5180f1,_0x31a725[_0x4ba3('0x62')],_0x4ba3('0x48'));for(var _0x88b6a2=0x0,_0x1f824e={};_0x88b6a2<_0x5180f1[_0x4ba3('0x45')];_0x88b6a2+=0x1){_0x1f824e=_0x5180f1[_0x88b6a2];if(_['isUndefined'](_0x31a725['campaigns'][_0x1f824e[_0x4ba3('0x48')]])){_0x31a725[_0x4ba3('0x62')][_0x1f824e[_0x4ba3('0x48')]]=new Campaign(_0x1f824e);}else{_0x31a725[_0x4ba3('0x46')](_0x31a725[_0x4ba3('0x62')][_0x1f824e[_0x4ba3('0x48')]],_0x1f824e);_0x31a725[_0x4ba3('0x62')][_0x1f824e[_0x4ba3('0x48')]][_0x4ba3('0x63')]=_0x1f824e[_0x4ba3('0x64')]?_0x1f824e[_0x4ba3('0x64')][_0x4ba3('0x48')]:undefined;}}}return _0x31a725['campaigns'];};};Realtime[_0x4ba3('0x43')]['initVoiceExtensions']=function(){var _0x3f5309=this;return function(_0x44568e){if(_0x44568e){freeIsNotKey(_0x44568e,_0x3f5309[_0x4ba3('0x65')],'id');for(var _0x1e9bec=0x0,_0x48cd14={};_0x1e9bec<_0x44568e[_0x4ba3('0x45')];_0x1e9bec+=0x1){_0x48cd14=_0x44568e[_0x1e9bec];if(_[_0x4ba3('0x47')](_0x3f5309[_0x4ba3('0x65')][_0x48cd14['id']])){_0x3f5309[_0x4ba3('0x65')][_0x48cd14['id']]=new VoiceExtension(_0x48cd14);}else{_0x3f5309['mergeFromDatabase'](_0x3f5309['voiceExtensions'][_0x48cd14['id']],_0x48cd14);}}}return _0x3f5309[_0x4ba3('0x65')];};};Realtime[_0x4ba3('0x43')][_0x4ba3('0x66')]=function(){var _0x5db456=this;return function(_0x2f793a){clearCampaigns(_0x5db456[_0x4ba3('0x62')]);for(var _0x22a9fb=0x0;_0x22a9fb<_0x2f793a[_0x4ba3('0x45')];_0x22a9fb+=0x1){_[_0x4ba3('0x53')](_0x5db456[_0x4ba3('0x62')][_0x2f793a[_0x22a9fb]['name']],_0x2f793a[_0x22a9fb]);}return _0x5db456[_0x4ba3('0x62')];};};Realtime['prototype'][_0x4ba3('0x67')]=function(){var _0xa3e849=this;return function(_0x11b757){if(_0x11b757){freeIsNotKey(_0x11b757,_0xa3e849[_0x4ba3('0x26')],'id');for(var _0x48cb1a=0x0,_0x11be49={},_0x3bbcfb={};_0x48cb1a<_0x11b757['length'];_0x48cb1a+=0x1){_0x11be49=_0x11b757[_0x48cb1a];if(_[_0x4ba3('0x47')](_0xa3e849['faxAccounts'][_0x11be49['id']])){_0xa3e849[_0x4ba3('0x26')][_0x11be49['id']]=new FaxAccount(_0x11be49);}else{_0xa3e849[_0x4ba3('0x46')](_0xa3e849[_0x4ba3('0x26')][_0x11be49['id']],_0x11be49);}}}return _0xa3e849[_0x4ba3('0x26')];};};module[_0x4ba3('0x68')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 22a2073..2118ea2 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 _0xc107=['monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','membername','xcally-motion-dialer','forEach','voiceDialReport','startsWith','substring','indexOf','mobile','phone','exports','lodash','moment','util','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','interface','format','SIP/%s','length','connectedlinenum','assigned','isNil','queuecallercomplete','queuecallercompleteAt','queuecallerexit','YYYY-MM-DD\x20HH:mm:ss','create','getAgentByInternal','keys','getCallType','channel','split','calleridnum','outbound','internal','voiceCallReport','destination','exten','type','dialer','lastapplication','callerid','context','xcally-motion-preview','calleridpreview','originatecalleridnum','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId'];(function(_0xdf004d,_0x3e34cc){var _0x56893d=function(_0x5840bc){while(--_0x5840bc){_0xdf004d['push'](_0xdf004d['shift']());}};_0x56893d(++_0x3e34cc);}(_0xc107,0x11e));var _0x7c10=function(_0x50c9ea,_0x4ac862){_0x50c9ea=_0x50c9ea-0x0;var _0x371fef=_0xc107[_0x50c9ea];return _0x371fef;};'use strict';var _=require(_0x7c10('0x0'));var moment=require(_0x7c10('0x1'));var util=require(_0x7c10('0x2'));var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x7c10('0x3'));var RpcMemberReport=require(_0x7c10('0x4'));var RpcVoiceQueueReport=require(_0x7c10('0x5'));var RpcVoiceRecording=require(_0x7c10('0x6'));var RpcVoiceTransferReport=require(_0x7c10('0x7'));var VoiceQueueReport=require(_0x7c10('0x8'));var VoiceCallReport=require(_0x7c10('0x9'));var VoiceAgentReport=require(_0x7c10('0xa'));var VoiceDialReport=require(_0x7c10('0xb'));var UserReport=require(_0x7c10('0xc'));function Report(_0x4d2288){this[_0x7c10('0xd')]=_0x4d2288;this[_0x7c10('0xe')]=_0x4d2288[_0x7c10('0xe')];this[_0x7c10('0xf')]=_0x4d2288[_0x7c10('0xf')];}Report[_0x7c10('0x10')][_0x7c10('0x11')]=function(_0x305f2d){var _0x1db4e1=new VoiceQueueReport(this[_0x7c10('0xd')]);var _0x4ad67b=new VoiceAgentReport(this[_0x7c10('0xd')]);var _0x38f460=new VoiceDialReport(this[_0x7c10('0xd')]);var _0x395e71=new VoiceCallReport(this[_0x7c10('0xd')]);var _0x389e0a=new UserReport(this[_0x7c10('0xd')]);if(config[_0x7c10('0x12')]&&config[_0x7c10('0x12')]['disabled']){ami['on'](_0x7c10('0x13'),this[_0x7c10('0x14')][_0x7c10('0x15')](this));ami['on'](_0x7c10('0x16'),this['voiceCallReport']['bind'](this));ami['on'](_0x7c10('0x17'),this[_0x7c10('0x18')][_0x7c10('0x15')](this));ami['on'](_0x7c10('0x19'),this['voiceDialReport'][_0x7c10('0x15')](this));ami['on'](_0x7c10('0x1a'),this[_0x7c10('0x1b')][_0x7c10('0x15')](this));ami['on'](_0x7c10('0x1c'),this[_0x7c10('0x1d')][_0x7c10('0x15')](this));}};Report[_0x7c10('0x10')][_0x7c10('0x1e')]=function(_0x1131af){var _0x47c6e5;_0x47c6e5=_[_0x7c10('0x1f')](this[_0x7c10('0xe')],function(_0x1a083f){return _0x1a083f[_0x7c10('0x20')]==_0x1131af||_0x1a083f[_0x7c10('0x21')]==_0x1131af;});if(_['isNil'](_0x47c6e5)){var _0x45d849=_[_0x7c10('0x1f')](this[_0x7c10('0xf')],function(_0x45a8c1){return _0x45a8c1[_0x7c10('0x20')]==_0x1131af||_0x45a8c1['name']==_0x1131af;});if(_0x45d849){_0x47c6e5=_[_0x7c10('0x1f')](this[_0x7c10('0xe')],function(_0xfcb569){return _0xfcb569[_0x7c10('0x22')]==util[_0x7c10('0x23')](_0x7c10('0x24'),_0x45d849[_0x7c10('0x21')]);});}}return _0x47c6e5;};Report[_0x7c10('0x10')][_0x7c10('0x14')]=function(_0x5e0c87){for(var _0x560059=0x0;_0x560059<_0x5e0c87[_0x7c10('0x25')];_0x560059+=0x1){var _0x5a8d59=this[_0x7c10('0x1e')](_0x5e0c87[_0x560059][_0x7c10('0x26')]);if(_0x5a8d59){_0x5e0c87[_0x560059][_0x7c10('0x20')]=_0x5a8d59[_0x7c10('0x20')];_0x5e0c87[_0x560059][_0x7c10('0x27')]=!![];_0x5e0c87[_0x560059]['lastAssignedTo']=_0x5a8d59[_0x7c10('0x21')];_0x5e0c87[_0x560059][_0x7c10('0x22')]=_[_0x7c10('0x28')](_0x5a8d59[_0x7c10('0x22')])?util[_0x7c10('0x23')]('SIP/%s',_0x5a8d59['name']):_0x5a8d59['interface'];if(_0x5e0c87[_0x560059][_0x7c10('0x29')]){_0x5e0c87[_0x560059][_0x7c10('0x2a')]=moment()[_0x7c10('0x23')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x5e0c87[_0x560059][_0x7c10('0x2b')]){_0x5e0c87[_0x560059]['queuecallerexitAt']=moment()['format'](_0x7c10('0x2c'));}RpcMemberReport['voiceQueueReport'](_0x5e0c87[_0x560059]);}RpcVoiceQueueReport[_0x7c10('0x2d')](_0x5e0c87[_0x560059]);}};function extractCalleridNumber(_0xbf0c3f){var _0x4d7990=_0xbf0c3f['match'](/<(.*?)>/);return _0x4d7990?_0x4d7990[0x1]:_0xbf0c3f;}Report['prototype'][_0x7c10('0x2e')]=function(_0xaced6c){for(var _0xe9f3d2=0x0;_0xe9f3d2','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','channel'];(function(_0x45bcb1,_0x46cad0){var _0x4bd6a3=function(_0x1f197f){while(--_0x1f197f){_0x45bcb1['push'](_0x45bcb1['shift']());}};_0x4bd6a3(++_0x46cad0);}(_0x4607,0x123));var _0x7460=function(_0x414127,_0x5a69e7){_0x414127=_0x414127-0x0;var _0xb3ca62=_0x4607[_0x414127];return _0xb3ca62;};'use strict';var _=require(_0x7460('0x0'));var moment=require(_0x7460('0x1'));var util=require(_0x7460('0x2'));var config=require(_0x7460('0x3'));var ami=require(_0x7460('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x7460('0x5'));var RpcMemberReport=require(_0x7460('0x6'));var RpcVoiceQueueReport=require(_0x7460('0x7'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x7460('0x8'));var VoiceQueueReport=require(_0x7460('0x9'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x7460('0xa'));var VoiceDialReport=require(_0x7460('0xb'));var UserReport=require(_0x7460('0xc'));function Report(_0x4d9793){this['realtime']=_0x4d9793;this[_0x7460('0xd')]=_0x4d9793['agents'];this[_0x7460('0xe')]=_0x4d9793[_0x7460('0xe')];}Report['prototype'][_0x7460('0xf')]=function(_0x245488){var _0x2099b5=new VoiceQueueReport(this[_0x7460('0x10')]);var _0x52910a=new VoiceAgentReport(this[_0x7460('0x10')]);var _0x29dce6=new VoiceDialReport(this['realtime']);var _0x28bbd1=new VoiceCallReport(this['realtime']);var _0x484130=new UserReport(this[_0x7460('0x10')]);if(config[_0x7460('0x11')]&&config[_0x7460('0x11')][_0x7460('0x12')]){ami['on'](_0x7460('0x13'),this[_0x7460('0x14')][_0x7460('0x15')](this));ami['on']('custom:voiceCallReport',this['voiceCallReport'][_0x7460('0x15')](this));ami['on'](_0x7460('0x16'),this[_0x7460('0x17')][_0x7460('0x15')](this));ami['on'](_0x7460('0x18'),this['voiceDialReport'][_0x7460('0x15')](this));ami['on']('blindtransfer',this[_0x7460('0x19')][_0x7460('0x15')](this));ami['on'](_0x7460('0x1a'),this[_0x7460('0x1b')][_0x7460('0x15')](this));}};Report[_0x7460('0x1c')][_0x7460('0x1d')]=function(_0x3b7961){var _0x31920b;_0x31920b=_[_0x7460('0x1e')](this['agents'],function(_0x5a4304){return _0x5a4304[_0x7460('0x1f')]==_0x3b7961||_0x5a4304['name']==_0x3b7961;});if(_['isNil'](_0x31920b)){var _0x36f9fe=_['find'](this[_0x7460('0xe')],function(_0x549273){return _0x549273[_0x7460('0x1f')]==_0x3b7961||_0x549273[_0x7460('0x20')]==_0x3b7961;});if(_0x36f9fe){_0x31920b=_[_0x7460('0x1e')](this['agents'],function(_0x3de7fd){return _0x3de7fd[_0x7460('0x21')]==util[_0x7460('0x22')](_0x7460('0x23'),_0x36f9fe['name']);});}}return _0x31920b;};Report[_0x7460('0x1c')][_0x7460('0x14')]=function(_0x580912){for(var _0x46cc3f=0x0;_0x46cc3f<_0x580912[_0x7460('0x24')];_0x46cc3f+=0x1){var _0x5508f0=this['findAgent'](_0x580912[_0x46cc3f][_0x7460('0x25')]);if(_0x5508f0){_0x580912[_0x46cc3f][_0x7460('0x1f')]=_0x5508f0[_0x7460('0x1f')];_0x580912[_0x46cc3f][_0x7460('0x26')]=!![];_0x580912[_0x46cc3f]['lastAssignedTo']=_0x5508f0[_0x7460('0x20')];_0x580912[_0x46cc3f][_0x7460('0x21')]=_[_0x7460('0x27')](_0x5508f0[_0x7460('0x21')])?util['format'](_0x7460('0x23'),_0x5508f0['name']):_0x5508f0[_0x7460('0x21')];if(_0x580912[_0x46cc3f]['queuecallercomplete']){_0x580912[_0x46cc3f]['queuecallercompleteAt']=moment()[_0x7460('0x22')](_0x7460('0x28'));}if(_0x580912[_0x46cc3f][_0x7460('0x29')]){_0x580912[_0x46cc3f][_0x7460('0x2a')]=moment()[_0x7460('0x22')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport['voiceQueueReport'](_0x580912[_0x46cc3f]);}RpcVoiceQueueReport['create'](_0x580912[_0x46cc3f]);}};function extractCalleridNumber(_0x31c119){var _0x15b7d8=_0x31c119[_0x7460('0x2b')](/<(.*?)>/);return _0x15b7d8?_0x15b7d8[0x1]:_0x31c119;}Report['prototype'][_0x7460('0x2c')]=function(_0x9f64b9){for(var _0xa3b63a=0x0;_0xa3b63a0x0?_0x128bce:0x0;this[_0x2ca8('0x12')][_0x1302cb['queue']][_0x2ca8('0x2e')]=this[_0x2ca8('0x12')][_0x1302cb[_0x2ca8('0x64')]]['talking']>_[_0x2ca8('0x6a')](_0x1302cb[_0x2ca8('0x6b')])?_['toNumber'](_0x1302cb[_0x2ca8('0x6b')]):this[_0x2ca8('0x12')][_0x1302cb[_0x2ca8('0x64')]][_0x2ca8('0x2e')];this[_0x2ca8('0x4e')](this[_0x2ca8('0x12')][_0x1302cb[_0x2ca8('0x64')]],_0x2ca8('0x15'));}logger[_0x2ca8('0x40')](_0x2ca8('0x6d'),util[_0x2ca8('0x3c')](this['voiceQueues'][_0x1302cb[_0x2ca8('0x64')]],{'showHidden':![],'depth':null}));ami[_0x2ca8('0x44')](_0x2ca8('0x6e'),this[_0x2ca8('0x12')][_0x1302cb[_0x2ca8('0x64')]]);}}}catch(_0x99871){logger[_0x2ca8('0x3a')](_0x2ca8('0x61'),util[_0x2ca8('0x3c')](_0x99871,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2ca8('0x17')]=function(_0x4c3a52){logger[_0x2ca8('0x40')](_0x2ca8('0x6f'),util[_0x2ca8('0x3c')](_0x4c3a52,{'showHidden':![],'depth':null}));ami[_0x2ca8('0x44')](_0x2ca8('0x70'),{});this[_0x2ca8('0x13')]=!![];};VoiceQueueReport[_0x2ca8('0xa')]['syncQueueCallerJoin']=function(_0x2cc160){try{if(this[_0x2ca8('0x63')](_0x2cc160)){logger['debug'](_0x2ca8('0x71'),_0x2cc160[_0x2ca8('0x43')],util[_0x2ca8('0x3c')](_0x2cc160,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x2ca8('0xf')][_0x2cc160[_0x2ca8('0x43')]]))this[_0x2ca8('0xf')][_0x2cc160[_0x2ca8('0x43')]]=[];if(_['isUndefined'](this[_0x2ca8('0x11')][_0x2cc160[_0x2ca8('0x43')]]))this['channels'][_0x2cc160[_0x2ca8('0x43')]]={};var _0x20f87e=new QueueReport();_0x20f87e[_0x2ca8('0x47')]=_0x2cc160[_0x2ca8('0x64')];_0x20f87e[_0x2ca8('0x4f')]=this[_0x2ca8('0x12')][_0x20f87e[_0x2ca8('0x47')]]&&this[_0x2ca8('0x12')][_0x20f87e[_0x2ca8('0x47')]][_0x2ca8('0x4f')]?this[_0x2ca8('0x12')][_0x20f87e['name']]['type']||_0x2ca8('0x72'):_0x2ca8('0x72');_0x20f87e[_0x2ca8('0x64')]=_0x2cc160[_0x2ca8('0x64')];_0x20f87e[_0x2ca8('0x73')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x20f87e['position']=_0x2cc160['position'];_0x20f87e[_0x2ca8('0x74')]=_0x2cc160[_0x2ca8('0x74')];_0x20f87e[_0x2ca8('0x43')]=_0x2cc160[_0x2ca8('0x43')];_0x20f87e[_0x2ca8('0x75')]=this[_0x2ca8('0x11')][_0x2cc160[_0x2ca8('0x43')]]['routealias'];logger['info'](_0x2ca8('0x76'),_0x20f87e['name'],_0x20f87e[_0x2ca8('0x4f')]);_[_0x2ca8('0x77')](_0x20f87e,_[_0x2ca8('0x78')](_0x2cc160,_[_0x2ca8('0x79')](_0x20f87e)));this['queueReports'][_0x2cc160[_0x2ca8('0x43')]]['push'](_0x20f87e);this[_0x2ca8('0x11')][_0x2cc160[_0x2ca8('0x43')]]=_0x20f87e;this[_0x2ca8('0x3f')](_0x20f87e,'queuecallerjoin');}}catch(_0x3ce95b){logger[_0x2ca8('0x3a')](_0x2ca8('0x71'),_0x2cc160['uniqueid'],util[_0x2ca8('0x3c')](_0x3ce95b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2ca8('0xa')][_0x2ca8('0x1b')]=function(_0x400590){try{if(this[_0x2ca8('0x63')](_0x400590)){logger['debug'](_0x2ca8('0x7a'),_0x400590[_0x2ca8('0x43')],util[_0x2ca8('0x3c')](_0x400590,{'showHidden':![],'depth':null}));if(this[_0x2ca8('0xf')][_0x400590[_0x2ca8('0x43')]]){var _0x41b72f=_['last'](this[_0x2ca8('0xf')][_0x400590[_0x2ca8('0x43')]]);_0x41b72f[_0x2ca8('0x7b')]=![];_0x41b72f[_0x2ca8('0x7c')]=null;_0x41b72f[_0x2ca8('0x7d')]=_0x400590[_0x2ca8('0x7d')];_0x41b72f[_0x2ca8('0x7e')]=_0x400590[_0x2ca8('0x7e')];_0x41b72f[_0x2ca8('0x1a')]=!![];_0x41b72f['queuecallerabandonAt']=moment()[_0x2ca8('0x45')](_0x2ca8('0x7f'));_0x41b72f[_0x2ca8('0x4b')]=_0x2ca8('0x80');_0x41b72f[_0x2ca8('0x81')]=null;logger['info'](_0x2ca8('0x82'),_0x41b72f['name'],_0x41b72f[_0x2ca8('0x4f')]);this[_0x2ca8('0x11')][_0x400590[_0x2ca8('0x43')]]=_0x41b72f;this[_0x2ca8('0x49')](_0x41b72f,'queuecallerabandon');}}}catch(_0x138414){logger['error'](_0x2ca8('0x7a'),_0x400590[_0x2ca8('0x43')],util[_0x2ca8('0x3c')](_0x138414,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2ca8('0xa')][_0x2ca8('0x1d')]=function(_0x55123e){try{if(this['isNotNull'](_0x55123e)){logger[_0x2ca8('0x40')](_0x2ca8('0x83'),_0x55123e[_0x2ca8('0x43')],util[_0x2ca8('0x3c')](_0x55123e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x55123e[_0x2ca8('0x43')]]){var _0x26ef3c=_['last'](this[_0x2ca8('0xf')][_0x55123e[_0x2ca8('0x43')]]);_0x26ef3c[_0x2ca8('0x84')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x26ef3c[_0x2ca8('0x85')]=_0x55123e[_0x2ca8('0x85')];_0x26ef3c['connectedlinename']=_0x55123e['connectedlinename'];logger[_0x2ca8('0x66')](_0x2ca8('0x86'),_0x26ef3c[_0x2ca8('0x47')],_0x26ef3c['type'],_0x55123e[_0x2ca8('0x85')],_0x55123e[_0x2ca8('0x87')]);this[_0x2ca8('0x11')][_0x55123e['uniqueid']]=_0x26ef3c;this[_0x2ca8('0x3f')](_0x26ef3c,_0x2ca8('0x1c'));}}}catch(_0x4958df){logger['error'](_0x2ca8('0x83'),_0x55123e['uniqueid'],util[_0x2ca8('0x3c')](_0x4958df,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2ca8('0xa')][_0x2ca8('0x1e')]=function(_0x5875b7){try{if(this[_0x2ca8('0x63')](_0x5875b7)){logger[_0x2ca8('0x40')](_0x2ca8('0x88'),_0x5875b7[_0x2ca8('0x43')],util[_0x2ca8('0x3c')](_0x5875b7,{'showHidden':![],'depth':null}));if(this[_0x2ca8('0xf')][_0x5875b7[_0x2ca8('0x43')]]){var _0x3c5dde=_['last'](this['queueReports'][_0x5875b7[_0x2ca8('0x43')]]);_0x3c5dde[_0x2ca8('0x7b')]=!![];_0x3c5dde['queuecallerexitreason']=_0x2ca8('0x89');logger['info'](_0x2ca8('0x8a'),_0x3c5dde[_0x2ca8('0x47')],_0x3c5dde['type']);}}}catch(_0x4198f5){logger[_0x2ca8('0x3a')]('[%s][voiceQueueReport][agentconnect]',_0x5875b7[_0x2ca8('0x43')],util[_0x2ca8('0x3c')](_0x4198f5,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2ca8('0x8b')]=function(_0x296eae){try{if(this['isNotNull'](_0x296eae)){logger[_0x2ca8('0x40')](_0x2ca8('0x8c'),_0x296eae['uniqueid'],util[_0x2ca8('0x3c')](_0x296eae,{'showHidden':![],'depth':null}));if(this[_0x2ca8('0xf')][_0x296eae[_0x2ca8('0x43')]]){var _0x180a63=_[_0x2ca8('0x8d')](this['queueReports'][_0x296eae[_0x2ca8('0x43')]]);_0x180a63[_0x2ca8('0x1a')]=![];_0x180a63[_0x2ca8('0x8e')]=null;_0x180a63[_0x2ca8('0x8f')]=!![];_0x180a63[_0x2ca8('0x81')]=_0x296eae['membername'];_0x180a63[_0x2ca8('0x7d')]=_0x296eae[_0x2ca8('0x7d')];_0x180a63[_0x2ca8('0x7b')]=!![];_0x180a63['queuecallerexit']=![];_0x180a63[_0x2ca8('0x90')]=null;if(!_0x180a63[_0x2ca8('0x91')]){if(_0x296eae[_0x2ca8('0x92')]==_0x2ca8('0x91')){_0x180a63['queuecallerexitreason']=_0x2ca8('0x93');logger[_0x2ca8('0x66')](_0x2ca8('0x94'),_0x180a63[_0x2ca8('0x47')],_0x180a63[_0x2ca8('0x4f')]);}else{if(_[_0x2ca8('0x95')](_0x296eae['channel'][_0x2ca8('0x96')](),_0x2ca8('0x97'))){if(this[_0x2ca8('0xf')][_0x296eae[_0x2ca8('0x98')]]){var _0x1783b1=_['last'](this[_0x2ca8('0xf')][_0x296eae['linkedid']]);_0x1783b1[_0x2ca8('0x7b')]=![];_0x1783b1[_0x2ca8('0x99')]=!![];_0x1783b1['queuecallerexitAt']=moment(_0x180a63[_0x2ca8('0x73')])['add'](_0x296eae['holdtime'],_0x2ca8('0x9a'))[_0x2ca8('0x45')]('YYYY-MM-DD\x20HH:mm:ss');_0x1783b1[_0x2ca8('0x4b')]=_0x2ca8('0x9b');_0x1783b1['transfer']=!![];_0x1783b1[_0x2ca8('0x9c')]=_0x2ca8('0x9d');_0x1783b1[_0x2ca8('0x9e')]=_0x296eae[_0x2ca8('0x9f')];_0x1783b1[_0x2ca8('0xa0')]=_0x296eae['uniqueid'];logger[_0x2ca8('0x66')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x1783b1['name'],_0x1783b1[_0x2ca8('0x4f')]);var _0x18e69f=this[_0x2ca8('0xf')][_0x296eae[_0x2ca8('0x98')]];this[_0x2ca8('0xf')][_0x296eae[_0x2ca8('0x98')]]=this[_0x2ca8('0xf')][_0x296eae[_0x2ca8('0x43')]];this['queueReports'][_0x296eae['uniqueid']]=_0x18e69f;}}else{_0x180a63[_0x2ca8('0x4b')]='COMPLETEDBY'+_0x296eae['reason']['toUpperCase']();logger['info'](_0x2ca8('0xa1'),_0x180a63[_0x2ca8('0x47')],_0x180a63[_0x2ca8('0x4f')],_0x180a63[_0x2ca8('0x4b')]);}}}this['channels'][_0x296eae['uniqueid']]=_0x180a63;this[_0x2ca8('0x49')](_0x180a63,'agentcomplete');}}}catch(_0x232227){logger['error'](_0x2ca8('0x8c'),_0x296eae['uniqueid'],util[_0x2ca8('0x3c')](_0x232227,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2ca8('0xa')][_0x2ca8('0x20')]=function(_0x1e6580){try{if(this[_0x2ca8('0x63')](_0x1e6580)){logger['debug'](_0x2ca8('0xa2'),_0x1e6580[_0x2ca8('0x43')],util[_0x2ca8('0x3c')](_0x1e6580,{'showHidden':![],'depth':null}));this[_0x2ca8('0xa3')](_0x1e6580['uniqueid'],_[_0x2ca8('0x79')](_0x1e6580['variable'])[0x0],_0x1e6580[_0x2ca8('0xa4')]);if(this[_0x2ca8('0xf')][_0x1e6580['uniqueid']]){var _0x464845=_[_0x2ca8('0x8d')](this[_0x2ca8('0xf')][_0x1e6580[_0x2ca8('0x43')]]);if(_0x464845){if(this['isNotNull'](_0x1e6580[_0x2ca8('0xa5')])&&this[_0x2ca8('0x63')](_0x1e6580[_0x2ca8('0xa5')]['queuestatus'])){switch(_0x1e6580[_0x2ca8('0xa4')]){case _0x2ca8('0xa6'):_0x464845['queuecallerexit']=![];_0x464845[_0x2ca8('0x90')]=null;break;case _0x2ca8('0xa7'):_0x464845[_0x2ca8('0xa8')]=_0x2ca8('0xa9');_0x464845['queuecallerexit']=!![];_0x464845[_0x2ca8('0x90')]=moment()[_0x2ca8('0x45')](_0x2ca8('0x7f'));_0x464845[_0x2ca8('0x84')]=moment()[_0x2ca8('0x45')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x2ca8('0x40')](_0x2ca8('0xaa'),_0x1e6580[_0x2ca8('0x43')],util[_0x2ca8('0x3c')](_0x464845,{'showHidden':![],'depth':null}));ami[_0x2ca8('0x44')](_0x2ca8('0xab'),_0x464845);break;default:_0x464845['queuecallerexit']=!![];_0x464845[_0x2ca8('0x90')]=moment()[_0x2ca8('0x45')](_0x2ca8('0x7f'));_0x464845[_0x2ca8('0x84')]=moment()[_0x2ca8('0x45')]('YYYY-MM-DD\x20HH:mm:ss');}_0x464845[_0x2ca8('0x1a')]=![];_0x464845[_0x2ca8('0x8e')]=null;_0x464845['queuecallerexitreason']=_0x1e6580[_0x2ca8('0xa4')];this['channels'][_0x1e6580[_0x2ca8('0x43')]]=_0x464845;this[_0x2ca8('0x49')](_0x464845,'varset');}else if(this[_0x2ca8('0x63')](_0x1e6580[_0x2ca8('0xa5')])&&this[_0x2ca8('0x63')](_0x1e6580[_0x2ca8('0xa5')][_0x2ca8('0xac')])){if(!_0x464845['queuecallerabandon']){_0x464845['queuecallerexit']=!![];_0x464845[_0x2ca8('0x90')]=moment()['format'](_0x2ca8('0x7f'));_0x464845[_0x2ca8('0x4b')]=_0x2ca8('0xad');_0x464845[_0x2ca8('0x84')]=moment()['format'](_0x2ca8('0x7f'));this[_0x2ca8('0x11')][_0x1e6580[_0x2ca8('0x43')]]=_0x464845;}}logger[_0x2ca8('0x66')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x1e6580[_0x2ca8('0x43')],_0x464845['name'],_0x464845[_0x2ca8('0x4f')],_[_0x2ca8('0x79')](_0x1e6580['variable'])[0x0],_0x1e6580[_0x2ca8('0xa4')]);_0x464845[_0x2ca8('0x14')]=this['variables'][_0x1e6580['uniqueid']];}}}}catch(_0x406d64){logger[_0x2ca8('0x3a')](_0x2ca8('0xa2'),_0x1e6580[_0x2ca8('0x43')],util[_0x2ca8('0x3c')](_0x406d64,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2ca8('0xa')][_0x2ca8('0xa3')]=function(_0x24b5e3,_0x3ff61b,_0x1bf3bd){var _0x25ddde=[_0x2ca8('0xae'),_0x2ca8('0xaf'),'rtpaudioqosjitter','rtpaudioqosjitterbridged',_0x2ca8('0xb0'),_0x2ca8('0xb1'),_0x2ca8('0xb2'),_0x2ca8('0xb3'),'sipcallid','sipuri','bridgepeer','bridgepvtcallid',_0x2ca8('0xb4'),'memberdynamic',_0x2ca8('0xb5'),_0x2ca8('0xb6'),_0x2ca8('0xb7'),_0x2ca8('0xb8'),'memberrealtime'];if(!_[_0x2ca8('0x35')](_0x3ff61b)&&!_['includes'](_0x25ddde,_0x3ff61b)){if(_['isUndefined'](this[_0x2ca8('0x14')][_0x24b5e3])){this[_0x2ca8('0x14')][_0x24b5e3]={};}this[_0x2ca8('0x14')][_0x24b5e3][_0x3ff61b]=_0x1bf3bd;}};VoiceQueueReport[_0x2ca8('0xa')][_0x2ca8('0xb9')]=function(_0x192e35,_0x42ebe5,_0x2c8362){var _0xfdec14={};for(var _0x4824a6=0x0;_0x4824a60x0?_0x540edc:0x0;this['voiceQueues'][_0x2449d2[_0x37c2('0x65')]][_0x37c2('0x53')]=this['voiceQueues'][_0x2449d2['queue']][_0x37c2('0x53')]>_[_0x37c2('0x6c')](_0x2449d2[_0x37c2('0x6d')])?_[_0x37c2('0x6c')](_0x2449d2['loggedin']):this[_0x37c2('0x67')][_0x2449d2[_0x37c2('0x65')]]['talking'];this[_0x37c2('0x4a')](this[_0x37c2('0x67')][_0x2449d2['queue']],_0x37c2('0x13'));}logger[_0x37c2('0x40')](_0x37c2('0x6e'),util['inspect'](this[_0x37c2('0x67')][_0x2449d2['queue']],{'showHidden':![],'depth':null}));ami['emit'](_0x37c2('0x6f'),this['voiceQueues'][_0x2449d2['queue']]);}}}catch(_0x1562e2){logger['error']('[voiceQueueReport][queuesummary]',util[_0x37c2('0x36')](_0x1562e2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x37c2('0xc')][_0x37c2('0x17')]=function(_0x5027ac){logger['debug'](_0x37c2('0x70'),util[_0x37c2('0x36')](_0x5027ac,{'showHidden':![],'depth':null}));ami[_0x37c2('0x3e')](_0x37c2('0x71'),{});this[_0x37c2('0x62')]=!![];};VoiceQueueReport[_0x37c2('0xc')]['syncQueueCallerJoin']=function(_0x3848b2){try{if(this[_0x37c2('0x5d')](_0x3848b2)){logger['debug']('[%s][voiceQueueReport][queuecallerjoin]',_0x3848b2[_0x37c2('0x43')],util[_0x37c2('0x36')](_0x3848b2,{'showHidden':![],'depth':null}));if(_[_0x37c2('0x5e')](this[_0x37c2('0xf')][_0x3848b2['uniqueid']]))this[_0x37c2('0xf')][_0x3848b2[_0x37c2('0x43')]]=[];if(_[_0x37c2('0x5e')](this['channels'][_0x3848b2['uniqueid']]))this[_0x37c2('0x11')][_0x3848b2[_0x37c2('0x43')]]={};var _0x4f2309=new QueueReport();_0x4f2309[_0x37c2('0x45')]=_0x3848b2['queue'];_0x4f2309['type']=this[_0x37c2('0x67')][_0x4f2309[_0x37c2('0x45')]]&&this[_0x37c2('0x67')][_0x4f2309[_0x37c2('0x45')]][_0x37c2('0x4b')]?this[_0x37c2('0x67')][_0x4f2309['name']][_0x37c2('0x4b')]||_0x37c2('0x4c'):_0x37c2('0x4c');_0x4f2309[_0x37c2('0x65')]=_0x3848b2[_0x37c2('0x65')];_0x4f2309[_0x37c2('0x72')]=moment()[_0x37c2('0x44')](_0x37c2('0x73'));_0x4f2309[_0x37c2('0x74')]=_0x3848b2['position'];_0x4f2309[_0x37c2('0x75')]=_0x3848b2[_0x37c2('0x75')];_0x4f2309[_0x37c2('0x43')]=_0x3848b2['uniqueid'];_0x4f2309['routealias']=this['channels'][_0x3848b2[_0x37c2('0x43')]]['routealias'];logger[_0x37c2('0x68')](_0x37c2('0x76'),_0x4f2309[_0x37c2('0x45')],_0x4f2309[_0x37c2('0x4b')]);_[_0x37c2('0x77')](_0x4f2309,_[_0x37c2('0x78')](_0x3848b2,_[_0x37c2('0x79')](_0x4f2309)));this[_0x37c2('0xf')][_0x3848b2[_0x37c2('0x43')]]['push'](_0x4f2309);this[_0x37c2('0x11')][_0x3848b2[_0x37c2('0x43')]]=_0x4f2309;this[_0x37c2('0x3f')](_0x4f2309,_0x37c2('0x18'));}}catch(_0x2dd62f){logger[_0x37c2('0x37')](_0x37c2('0x7a'),_0x3848b2[_0x37c2('0x43')],util[_0x37c2('0x36')](_0x2dd62f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x37c2('0x1a')]=function(_0x3e2a1b){try{if(this[_0x37c2('0x5d')](_0x3e2a1b)){logger[_0x37c2('0x40')](_0x37c2('0x7b'),_0x3e2a1b['uniqueid'],util[_0x37c2('0x36')](_0x3e2a1b,{'showHidden':![],'depth':null}));if(this[_0x37c2('0xf')][_0x3e2a1b[_0x37c2('0x43')]]){var _0x262645=_['last'](this[_0x37c2('0xf')][_0x3e2a1b[_0x37c2('0x43')]]);_0x262645['queuecallercomplete']=![];_0x262645[_0x37c2('0x7c')]=null;_0x262645[_0x37c2('0x7d')]=_0x3e2a1b[_0x37c2('0x7d')];_0x262645[_0x37c2('0x7e')]=_0x3e2a1b[_0x37c2('0x7e')];_0x262645[_0x37c2('0x19')]=!![];_0x262645['queuecallerabandonAt']=moment()[_0x37c2('0x44')](_0x37c2('0x73'));_0x262645[_0x37c2('0x48')]='ABANDONED';_0x262645['lastAssignedTo']=null;logger[_0x37c2('0x68')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x262645[_0x37c2('0x45')],_0x262645[_0x37c2('0x4b')]);this['channels'][_0x3e2a1b[_0x37c2('0x43')]]=_0x262645;this['emitVoiceQueueChannelRemove'](_0x262645,_0x37c2('0x19'));}}}catch(_0x341e2a){logger[_0x37c2('0x37')]('[%s][voiceQueueReport][queuecallerabandon]',_0x3e2a1b[_0x37c2('0x43')],util[_0x37c2('0x36')](_0x341e2a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x37c2('0xc')][_0x37c2('0x1c')]=function(_0x3b5b19){try{if(this['isNotNull'](_0x3b5b19)){logger['debug'](_0x37c2('0x7f'),_0x3b5b19[_0x37c2('0x43')],util[_0x37c2('0x36')](_0x3b5b19,{'showHidden':![],'depth':null}));if(this[_0x37c2('0xf')][_0x3b5b19['uniqueid']]){var _0x3bf9ff=_[_0x37c2('0x80')](this[_0x37c2('0xf')][_0x3b5b19[_0x37c2('0x43')]]);_0x3bf9ff[_0x37c2('0x81')]=moment()[_0x37c2('0x44')](_0x37c2('0x73'));_0x3bf9ff['connectedlinenum']=_0x3b5b19[_0x37c2('0x82')];_0x3bf9ff[_0x37c2('0x83')]=_0x3b5b19['connectedlinename'];logger[_0x37c2('0x68')](_0x37c2('0x84'),_0x3bf9ff['name'],_0x3bf9ff[_0x37c2('0x4b')],_0x3b5b19[_0x37c2('0x82')],_0x3b5b19[_0x37c2('0x83')]);this[_0x37c2('0x11')][_0x3b5b19[_0x37c2('0x43')]]=_0x3bf9ff;this[_0x37c2('0x3f')](_0x3bf9ff,'queuecallerleave');}}}catch(_0x133f2f){logger[_0x37c2('0x37')](_0x37c2('0x7f'),_0x3b5b19['uniqueid'],util[_0x37c2('0x36')](_0x133f2f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x37c2('0x1f')]=function(_0x3c569d){try{if(this[_0x37c2('0x5d')](_0x3c569d)){logger[_0x37c2('0x40')](_0x37c2('0x85'),_0x3c569d[_0x37c2('0x43')],util[_0x37c2('0x36')](_0x3c569d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3c569d[_0x37c2('0x43')]]){var _0x480ddf=_[_0x37c2('0x80')](this['queueReports'][_0x3c569d[_0x37c2('0x43')]]);_0x480ddf['queuecallercomplete']=!![];_0x480ddf[_0x37c2('0x48')]=_0x37c2('0x86');logger[_0x37c2('0x68')](_0x37c2('0x87'),_0x480ddf[_0x37c2('0x45')],_0x480ddf[_0x37c2('0x4b')]);}}}catch(_0x5514d1){logger[_0x37c2('0x37')](_0x37c2('0x85'),_0x3c569d[_0x37c2('0x43')],util['inspect'](_0x5514d1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x37c2('0xc')][_0x37c2('0x88')]=function(_0x427995){try{if(this[_0x37c2('0x5d')](_0x427995)){logger[_0x37c2('0x40')](_0x37c2('0x89'),_0x427995['uniqueid'],util['inspect'](_0x427995,{'showHidden':![],'depth':null}));if(this[_0x37c2('0xf')][_0x427995[_0x37c2('0x43')]]){var _0x48d0cb=_[_0x37c2('0x80')](this['queueReports'][_0x427995['uniqueid']]);_0x48d0cb[_0x37c2('0x19')]=![];_0x48d0cb[_0x37c2('0x8a')]=null;_0x48d0cb['assigned']=!![];_0x48d0cb['lastAssignedTo']=_0x427995[_0x37c2('0x8b')];_0x48d0cb['holdtime']=_0x427995['holdtime'];_0x48d0cb['queuecallercomplete']=!![];_0x48d0cb[_0x37c2('0x8c')]=![];_0x48d0cb[_0x37c2('0x8d')]=null;if(!_0x48d0cb[_0x37c2('0x8e')]){if(_0x427995[_0x37c2('0x8f')]=='transfer'){_0x48d0cb[_0x37c2('0x48')]=_0x37c2('0x90');logger[_0x37c2('0x68')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x48d0cb[_0x37c2('0x45')],_0x48d0cb[_0x37c2('0x4b')]);}else{if(_[_0x37c2('0x91')](_0x427995[_0x37c2('0x92')][_0x37c2('0x93')](),_0x37c2('0x94'))){if(this[_0x37c2('0xf')][_0x427995[_0x37c2('0x95')]]){var _0x4e2355=_[_0x37c2('0x80')](this[_0x37c2('0xf')][_0x427995['linkedid']]);_0x4e2355[_0x37c2('0x96')]=![];_0x4e2355['queuecallerexit']=!![];_0x4e2355[_0x37c2('0x8d')]=moment(_0x48d0cb[_0x37c2('0x72')])[_0x37c2('0x97')](_0x427995[_0x37c2('0x7d')],_0x37c2('0x98'))[_0x37c2('0x44')](_0x37c2('0x73'));_0x4e2355[_0x37c2('0x48')]=_0x37c2('0x99');_0x4e2355[_0x37c2('0x8e')]=!![];_0x4e2355[_0x37c2('0x9a')]=_0x37c2('0x9b');_0x4e2355[_0x37c2('0x9c')]=_0x427995['destexten'];_0x4e2355[_0x37c2('0x9d')]=_0x427995[_0x37c2('0x43')];logger[_0x37c2('0x68')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x4e2355['name'],_0x4e2355['type']);var _0x48c333=this[_0x37c2('0xf')][_0x427995['linkedid']];this['queueReports'][_0x427995['linkedid']]=this[_0x37c2('0xf')][_0x427995[_0x37c2('0x43')]];this[_0x37c2('0xf')][_0x427995['uniqueid']]=_0x48c333;}}else{_0x48d0cb[_0x37c2('0x48')]=_0x37c2('0x9e')+_0x427995['reason'][_0x37c2('0x9f')]();logger['info'](_0x37c2('0xa0'),_0x48d0cb[_0x37c2('0x45')],_0x48d0cb['type'],_0x48d0cb[_0x37c2('0x48')]);}}}this[_0x37c2('0x11')][_0x427995[_0x37c2('0x43')]]=_0x48d0cb;this[_0x37c2('0x3c')](_0x48d0cb,_0x37c2('0x1d'));}}}catch(_0x44cecb){logger[_0x37c2('0x37')](_0x37c2('0x89'),_0x427995[_0x37c2('0x43')],util[_0x37c2('0x36')](_0x44cecb,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncVarSet']=function(_0x4a8edd){try{if(this[_0x37c2('0x5d')](_0x4a8edd)){logger[_0x37c2('0x40')](_0x37c2('0xa1'),_0x4a8edd[_0x37c2('0x43')],util[_0x37c2('0x36')](_0x4a8edd,{'showHidden':![],'depth':null}));this[_0x37c2('0xa2')](_0x4a8edd['uniqueid'],_[_0x37c2('0x79')](_0x4a8edd[_0x37c2('0xa3')])[0x0],_0x4a8edd[_0x37c2('0xa4')]);if(this[_0x37c2('0xf')][_0x4a8edd[_0x37c2('0x43')]]){var _0x5c527d=_[_0x37c2('0x80')](this[_0x37c2('0xf')][_0x4a8edd[_0x37c2('0x43')]]);if(_0x5c527d){if(this['isNotNull'](_0x4a8edd[_0x37c2('0xa3')])&&this[_0x37c2('0x5d')](_0x4a8edd[_0x37c2('0xa3')][_0x37c2('0xa5')])){switch(_0x4a8edd['value']){case _0x37c2('0xa6'):_0x5c527d[_0x37c2('0x8c')]=![];_0x5c527d[_0x37c2('0x8d')]=null;break;case _0x37c2('0xa7'):_0x5c527d[_0x37c2('0xa8')]='timeout';_0x5c527d[_0x37c2('0x8c')]=!![];_0x5c527d[_0x37c2('0x8d')]=moment()[_0x37c2('0x44')](_0x37c2('0x73'));_0x5c527d[_0x37c2('0x81')]=moment()[_0x37c2('0x44')](_0x37c2('0x73'));logger['debug'](_0x37c2('0xa9'),_0x4a8edd[_0x37c2('0x43')],util[_0x37c2('0x36')](_0x5c527d,{'showHidden':![],'depth':null}));ami[_0x37c2('0x3e')](_0x37c2('0xaa'),_0x5c527d);break;default:_0x5c527d['queuecallerexit']=!![];_0x5c527d[_0x37c2('0x8d')]=moment()['format'](_0x37c2('0x73'));_0x5c527d['queuecallerleaveAt']=moment()[_0x37c2('0x44')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5c527d[_0x37c2('0x19')]=![];_0x5c527d[_0x37c2('0x8a')]=null;_0x5c527d[_0x37c2('0x48')]=_0x4a8edd[_0x37c2('0xa4')];this[_0x37c2('0x11')][_0x4a8edd[_0x37c2('0x43')]]=_0x5c527d;this[_0x37c2('0x3c')](_0x5c527d,'varset');}else if(this[_0x37c2('0x5d')](_0x4a8edd['variable'])&&this[_0x37c2('0x5d')](_0x4a8edd[_0x37c2('0xa3')][_0x37c2('0xab')])){if(!_0x5c527d[_0x37c2('0x19')]){_0x5c527d['queuecallerexit']=!![];_0x5c527d['queuecallerexitAt']=moment()[_0x37c2('0x44')](_0x37c2('0x73'));_0x5c527d['queuecallerexitreason']='EXITWITHKEY';_0x5c527d[_0x37c2('0x81')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x4a8edd[_0x37c2('0x43')]]=_0x5c527d;}}logger['info']('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x4a8edd[_0x37c2('0x43')],_0x5c527d[_0x37c2('0x45')],_0x5c527d['type'],_['keys'](_0x4a8edd[_0x37c2('0xa3')])[0x0],_0x4a8edd[_0x37c2('0xa4')]);_0x5c527d['variables']=this[_0x37c2('0x38')][_0x4a8edd[_0x37c2('0x43')]];}}}}catch(_0x53e0f2){logger['error'](_0x37c2('0xa1'),_0x4a8edd[_0x37c2('0x43')],util[_0x37c2('0x36')](_0x53e0f2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x37c2('0xc')]['addVariable']=function(_0x28c963,_0x383bf9,_0x29161c){var _0x4a4f2d=[_0x37c2('0xac'),_0x37c2('0xad'),_0x37c2('0xae'),_0x37c2('0xaf'),_0x37c2('0xb0'),_0x37c2('0xb1'),'rtpaudioqosrtt',_0x37c2('0xb2'),_0x37c2('0xb3'),'sipuri',_0x37c2('0xb4'),'bridgepvtcallid',_0x37c2('0xb5'),_0x37c2('0xb6'),'memberinterface',_0x37c2('0xb7'),_0x37c2('0x8b'),_0x37c2('0xb8'),_0x37c2('0xb9')];if(!_['isNil'](_0x383bf9)&&!_[_0x37c2('0xba')](_0x4a4f2d,_0x383bf9)){if(_['isUndefined'](this[_0x37c2('0x38')][_0x28c963])){this[_0x37c2('0x38')][_0x28c963]={};}this['variables'][_0x28c963][_0x383bf9]=_0x29161c;}};VoiceQueueReport[_0x37c2('0xc')][_0x37c2('0xbb')]=function(_0x5d5852,_0x233607,_0x2416cd){var _0x36e096={};for(var _0x1df30c=0x0;_0x1df30c=0x0?moment(_0x3fd0e0[_0x7825('0x1a')])[_0x7825('0xe')](_0x3fd0e0[_0x7825('0x1b')],_0x7825('0xf')):null,'data1':_0x7825('0x1c'),'data2':_0x3fd0e0['accountcode'],'data3':_0x3fd0e0['exten'],'data4':_0x3fd0e0[_0x7825('0x1d')]||null,'role':_0x7825('0x14'),'internal':_0x3fd0e0[_0x7825('0x15')]?_[_0x7825('0x16')](_0x3fd0e0[_0x7825('0x15')]):undefined,'uniqueid':_0x3fd0e0[_0x7825('0x17')]},'log':_0x7825('0x7')});}; \ No newline at end of file +var _0xf1ee=['Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','SIP/%s','queuecallerleaveAt','diff','seconds','calleridnum','exten','queue','accountcode','toNumber','uniqueid','voiceDialReport','TALKING','starttime','endtime','outbound','dialstring','agent','moment','lodash','util','../client','voiceQueueReport'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf1ee,0x6f));var _0xef1e=function(_0xd883d2,_0x5b7758){_0xd883d2=_0xd883d2-0x0;var _0x14c8a1=_0xf1ee[_0xd883d2];return _0x14c8a1;};'use strict';var moment=require(_0xef1e('0x0'));var _=require(_0xef1e('0x1'));var util=require(_0xef1e('0x2'));var client=require(_0xef1e('0x3'));exports[_0xef1e('0x4')]=function(_0x10f838){var _0xc005a9=_0x10f838['queuecallercompleteAt']||_0x10f838['queuecallerexitAt'];return client[_0xef1e('0x5')](_0xef1e('0x6'),{'body':{'channel':_0xef1e('0x7'),'membername':_0x10f838[_0xef1e('0x8')],'interface':_[_0xef1e('0x9')](_0x10f838[_0xef1e('0xa')])?util[_0xef1e('0xb')](_0xef1e('0xc'),_0x10f838[_0xef1e('0x8')]):_0x10f838[_0xef1e('0xa')],'type':'TALKING','enterAt':_0x10f838[_0xef1e('0xd')],'exitAt':_0xc005a9,'duration':moment(_0xc005a9)[_0xef1e('0xe')](_0x10f838[_0xef1e('0xd')],_0xef1e('0xf')),'data1':'inbound','data2':_0x10f838[_0xef1e('0x10')],'data3':_0x10f838[_0xef1e('0x11')],'data4':null,'data5':_0x10f838[_0xef1e('0x12')],'role':'agent','internal':_0x10f838[_0xef1e('0x13')]?_[_0xef1e('0x14')](_0x10f838[_0xef1e('0x13')]):undefined,'uniqueid':_0x10f838[_0xef1e('0x15')]},'log':_0xef1e('0x6')});};exports[_0xef1e('0x16')]=function(_0xa524){return client['Request']('CreateMemberReport',{'body':{'channel':'voice','membername':_0xa524['membername'],'interface':_0xa524['interface'],'type':_0xef1e('0x17'),'enterAt':_0xa524[_0xef1e('0x18')],'exitAt':_0xa524[_0xef1e('0x19')],'duration':moment(_0xa524[_0xef1e('0x19')])[_0xef1e('0xe')](_0xa524[_0xef1e('0x18')],_0xef1e('0xf'))>=0x0?moment(_0xa524['endtime'])[_0xef1e('0xe')](_0xa524[_0xef1e('0x18')],_0xef1e('0xf')):null,'data1':_0xef1e('0x1a'),'data2':_0xa524[_0xef1e('0x13')],'data3':_0xa524[_0xef1e('0x11')],'data4':_0xa524[_0xef1e('0x1b')]||null,'role':_0xef1e('0x1c'),'internal':_0xa524[_0xef1e('0x13')]?_[_0xef1e('0x14')](_0xa524[_0xef1e('0x13')]):undefined,'uniqueid':_0xa524[_0xef1e('0x15')]},'log':_0xef1e('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index c948aab..0ce9738 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 _0xc771=['getSettings','Request','ShowSetting','previewRecallmeReminderInterval','GetSettings','../client'];(function(_0x292f97,_0x2d9da1){var _0x1a4f71=function(_0x994a18){while(--_0x994a18){_0x292f97['push'](_0x292f97['shift']());}};_0x1a4f71(++_0x2d9da1);}(_0xc771,0x1d9));var _0x1c77=function(_0x36121d,_0x1faae3){_0x36121d=_0x36121d-0x0;var _0x43fa15=_0xc771[_0x36121d];return _0x43fa15;};'use strict';var client=require(_0x1c77('0x0'));exports[_0x1c77('0x1')]=function(){return client[_0x1c77('0x2')](_0x1c77('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x1c77('0x4')]},'log':_0x1c77('0x5')});}; \ No newline at end of file +var _0xc2f4=['ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client','getSettings','Request'];(function(_0x223e7b,_0x22492b){var _0x470512=function(_0x5727f1){while(--_0x5727f1){_0x223e7b['push'](_0x223e7b['shift']());}};_0x470512(++_0x22492b);}(_0xc2f4,0x107));var _0x4c2f=function(_0x505439,_0x5a4a50){_0x505439=_0x505439-0x0;var _0x54267a=_0xc2f4[_0x505439];return _0x54267a;};'use strict';var client=require(_0x4c2f('0x0'));exports[_0x4c2f('0x1')]=function(){return client[_0x4c2f('0x2')](_0x4c2f('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x4c2f('0x4'),_0x4c2f('0x5')]},'log':_0x4c2f('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 44be78f..c1e51d7 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 _0x46aa=['getTemplates','GetTemplate','name','html','../client'];(function(_0x3c3b57,_0x5c6241){var _0x630592=function(_0x527535){while(--_0x527535){_0x3c3b57['push'](_0x3c3b57['shift']());}};_0x630592(++_0x5c6241);}(_0x46aa,0x90));var _0xa46a=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x46aa[_0x1203f];return _0x365f0a;};'use strict';var client=require(_0xa46a('0x0'));exports[_0xa46a('0x1')]=function(_0x32678d){return function(_0x5ec776){return client['Request'](_0xa46a('0x2'),{'options':{'raw':!![],'attributes':['id',_0xa46a('0x3'),_0xa46a('0x4')]},'log':_0xa46a('0x2')});};}; \ No newline at end of file +var _0xc6e8=['Request','name','GetTemplate','../client','getTemplates'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc6e8,0x9e));var _0x8c6e=function(_0x391a79,_0x5a1626){_0x391a79=_0x391a79-0x0;var _0x3cb7ad=_0xc6e8[_0x391a79];return _0x3cb7ad;};'use strict';var client=require(_0x8c6e('0x0'));exports[_0x8c6e('0x1')]=function(_0x213e68){return function(_0x2b4809){return client[_0x8c6e('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x8c6e('0x3'),'html']},'log':_0x8c6e('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 95b66b5..631dd86 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 _0xa687=['status','AllConditions','operator','value','Condition','AnyConditions','Action','Actions','action','data2','data3','data4','data6','data7','getTriggers','Request','GetTrigger','name'];(function(_0x4af710,_0x569a47){var _0x472d7d=function(_0x195b0d){while(--_0x195b0d){_0x4af710['push'](_0x4af710['shift']());}};_0x472d7d(++_0x569a47);}(_0xa687,0x7a));var _0x7a68=function(_0x33a5ec,_0x10c014){_0x33a5ec=_0x33a5ec-0x0;var _0x38f89c=_0xa687[_0x33a5ec];return _0x38f89c;};'use strict';var client=require('../client');exports[_0x7a68('0x0')]=function(_0x242339){return function(_0x59eff2){return client[_0x7a68('0x1')](_0x7a68('0x2'),{'options':{'raw':![],'attributes':['id',_0x7a68('0x3'),'channel',_0x7a68('0x4')],'include':[{'model':'Condition','as':_0x7a68('0x5'),'attributes':['id','field',_0x7a68('0x6'),_0x7a68('0x7')]},{'model':_0x7a68('0x8'),'as':_0x7a68('0x9'),'attributes':['id','field','operator','value']},{'model':_0x7a68('0xa'),'as':_0x7a68('0xb'),'attributes':['id',_0x7a68('0xc'),'data1',_0x7a68('0xd'),_0x7a68('0xe'),_0x7a68('0xf'),'data5',_0x7a68('0x10'),_0x7a68('0x11')]}]},'log':_0x7a68('0x2')});};}; \ No newline at end of file +var _0xfc86=['data2','data3','data6','data7','GetTrigger','../client','getTriggers','Request','Condition','AllConditions','field','operator','value','AnyConditions','action'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc86,0x16d));var _0x6fc8=function(_0x3bbbd2,_0x506692){_0x3bbbd2=_0x3bbbd2-0x0;var _0x18ad2e=_0xfc86[_0x3bbbd2];return _0x18ad2e;};'use strict';var client=require(_0x6fc8('0x0'));exports[_0x6fc8('0x1')]=function(_0xfd7271){return function(_0x20f81b){return client[_0x6fc8('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id','name','channel','status'],'include':[{'model':_0x6fc8('0x3'),'as':_0x6fc8('0x4'),'attributes':['id',_0x6fc8('0x5'),_0x6fc8('0x6'),_0x6fc8('0x7')]},{'model':_0x6fc8('0x3'),'as':_0x6fc8('0x8'),'attributes':['id',_0x6fc8('0x5'),_0x6fc8('0x6'),_0x6fc8('0x7')]},{'model':'Action','as':'Actions','attributes':['id',_0x6fc8('0x9'),'data1',_0x6fc8('0xa'),_0x6fc8('0xb'),'data4','data5',_0x6fc8('0xc'),_0x6fc8('0xd')]}]},'log':_0x6fc8('0xe')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 250afc3..db149bc 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 _0xade7=['defaultuser','../client','getTrunks','Request','GetTrunk'];(function(_0x3b6410,_0x30a3ac){var _0x177fc0=function(_0x62a656){while(--_0x62a656){_0x3b6410['push'](_0x3b6410['shift']());}};_0x177fc0(++_0x30a3ac);}(_0xade7,0xd8));var _0x7ade=function(_0x1ef71d,_0x453e87){_0x1ef71d=_0x1ef71d-0x0;var _0x5bd739=_0xade7[_0x1ef71d];return _0x5bd739;};'use strict';var client=require(_0x7ade('0x0'));exports[_0x7ade('0x1')]=function(_0x5e26dd){return function(_0x149e3d){return client[_0x7ade('0x2')](_0x7ade('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name','registry',_0x7ade('0x4')]},'log':_0x7ade('0x3')});};}; \ No newline at end of file +var _0xfdc5=['../client','getTrunks','Request','GetTrunk','name','defaultuser'];(function(_0x32bea2,_0x2e360d){var _0x3a8a88=function(_0x5d9e28){while(--_0x5d9e28){_0x32bea2['push'](_0x32bea2['shift']());}};_0x3a8a88(++_0x2e360d);}(_0xfdc5,0xa8));var _0x5fdc=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0xfdc5[_0x2faddb];return _0x273c05;};'use strict';var client=require(_0x5fdc('0x0'));exports[_0x5fdc('0x1')]=function(_0x11cdbc){return function(_0xfa657e){return client[_0x5fdc('0x2')](_0x5fdc('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x5fdc('0x4'),'registry',_0x5fdc('0x5')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 00920f9..990ab0d 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(_0x269c2c,_0x59defa){var _0x1f203b=function(_0x56f6e9){while(--_0x56f6e9){_0x269c2c['push'](_0x269c2c['shift']());}};_0x1f203b(++_0x59defa);}(_0x70e0,0x17b));var _0x070e=function(_0x236b34,_0x2c5d50){_0x236b34=_0x236b34-0x0;var _0x4348f7=_0x70e0[_0x236b34];return _0x4348f7;};'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 _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x5e41ef,_0x4f9890){var _0x3e8286=function(_0x1d04fc){while(--_0x1d04fc){_0x5e41ef['push'](_0x5e41ef['shift']());}};_0x3e8286(++_0x4f9890);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xf34b0a,_0x11e116){_0xf34b0a=_0xf34b0a-0x0;var _0x5021e1=_0xcb91[_0xf34b0a];return _0x5021e1;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 5975179..6d0f33a 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 _0x5d66=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','create','Request'];(function(_0x5b3ca6,_0x2205ff){var _0x3a900f=function(_0x1f29ad){while(--_0x1f29ad){_0x5b3ca6['push'](_0x5b3ca6['shift']());}};_0x3a900f(++_0x2205ff);}(_0x5d66,0x10c));var _0x65d6=function(_0x339ccb,_0x3a4da6){_0x339ccb=_0x339ccb-0x0;var _0x133b50=_0x5d66[_0x339ccb];return _0x133b50;};'use strict';var client=require('../client');exports[_0x65d6('0x0')]=function(_0x161468){return client[_0x65d6('0x1')](_0x65d6('0x2'),{'body':_0x161468,'log':_0x65d6('0x2')});};exports[_0x65d6('0x3')]=function(_0xc5f480,_0x35e784,_0x170d7e){return client[_0x65d6('0x1')](_0x65d6('0x4'),{'body':_0xc5f480,'options':{'where':{'uniqueid':_0x35e784,'interface':_0x170d7e,'agentcomplete':!![]}},'log':_0x65d6('0x4')});}; \ No newline at end of file +var _0xa212=['UpdateVoiceAgentReport','../client','create','CreateVoiceAgentReport','update','Request'];(function(_0x395f27,_0x312782){var _0x418034=function(_0x17022a){while(--_0x17022a){_0x395f27['push'](_0x395f27['shift']());}};_0x418034(++_0x312782);}(_0xa212,0xeb));var _0x2a21=function(_0x10e802,_0x81411d){_0x10e802=_0x10e802-0x0;var _0x5f132a=_0xa212[_0x10e802];return _0x5f132a;};'use strict';var client=require(_0x2a21('0x0'));exports[_0x2a21('0x1')]=function(_0x2a1a10){return client['Request'](_0x2a21('0x2'),{'body':_0x2a1a10,'log':_0x2a21('0x2')});};exports[_0x2a21('0x3')]=function(_0x48c22e,_0x1bcdb4,_0x2b815d){return client[_0x2a21('0x4')](_0x2a21('0x5'),{'body':_0x48c22e,'options':{'where':{'uniqueid':_0x1bcdb4,'interface':_0x2b815d,'agentcomplete':!![]}},'log':_0x2a21('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index e24c0e3..0c76249 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 _0x6734=['outbound','day','format','endOf','disposition','duration','billableseconds','GetVoiceCallReports','util','lodash','../client','create','Request','CreateVoiceCallReport','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport'];(function(_0xc8503c,_0x2ad417){var _0xfb18ae=function(_0x31ea96){while(--_0x31ea96){_0xc8503c['push'](_0xc8503c['shift']());}};_0xfb18ae(++_0x2ad417);}(_0x6734,0xbc));var _0x4673=function(_0x32a884,_0x183853){_0x32a884=_0x32a884-0x0;var _0x242f9b=_0x6734[_0x32a884];return _0x242f9b;};'use strict';var moment=require('moment');var util=require(_0x4673('0x0'));var _=require(_0x4673('0x1'));var client=require(_0x4673('0x2'));exports[_0x4673('0x3')]=function(_0x366565){return client[_0x4673('0x4')](_0x4673('0x5'),{'body':_['merge'](_0x366565,{'source':_0x366565[_0x4673('0x6')],'destinationcontext':_0x366565[_0x4673('0x7')],'callerid':_0x366565[_0x4673('0x8')],'amaflags':_0x4673('0x9')}),'log':_0x4673('0x5')});};exports[_0x4673('0xa')]=function(){return function(){return client['Request'](_0x4673('0xb'),{'options':{'where':{'type':[_0x4673('0xc')],'createdAt':{'$between':[moment()['startOf'](_0x4673('0xd'))[_0x4673('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x4673('0xf')]('day')[_0x4673('0xe')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type',_0x4673('0x10'),_0x4673('0x11'),_0x4673('0x12')]},'log':_0x4673('0x13')});};}; \ No newline at end of file +var _0xe004=['startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','Request','CreateVoiceCallReport','merge','calleridnum','DOCUMENTATION','GetVoiceCallReport','outbound'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0xe004,0x15a));var _0x4e00=function(_0x26e031,_0x55fe47){_0x26e031=_0x26e031-0x0;var _0x4f3869=_0xe004[_0x26e031];return _0x4f3869;};'use strict';var moment=require(_0x4e00('0x0'));var util=require(_0x4e00('0x1'));var _=require(_0x4e00('0x2'));var client=require(_0x4e00('0x3'));exports['create']=function(_0x4b311f){return client[_0x4e00('0x4')](_0x4e00('0x5'),{'body':_[_0x4e00('0x6')](_0x4b311f,{'source':_0x4b311f[_0x4e00('0x7')],'destinationcontext':_0x4b311f['context'],'callerid':_0x4b311f['callerid'],'amaflags':_0x4e00('0x8')}),'log':_0x4e00('0x5')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x4e00('0x4')](_0x4e00('0x9'),{'options':{'where':{'type':[_0x4e00('0xa')],'createdAt':{'$between':[moment()[_0x4e00('0xb')]('day')[_0x4e00('0xc')](_0x4e00('0xd')),moment()[_0x4e00('0xe')](_0x4e00('0xf'))[_0x4e00('0xc')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x4e00('0x10'),_0x4e00('0x11'),_0x4e00('0x12'),_0x4e00('0x13')]},'log':_0x4e00('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 888c0c7..aff0a9a 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 _0xbd03=['CreateVoiceDialReport','../client','create','Request'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xbd03,0x105));var _0x3bd0=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xbd03[_0x139a3c];return _0x2b375b;};'use strict';var client=require(_0x3bd0('0x0'));exports[_0x3bd0('0x1')]=function(_0x48a338){return client[_0x3bd0('0x2')]('CreateVoiceDialReport',{'body':_0x48a338,'log':_0x3bd0('0x3')});}; \ No newline at end of file +var _0x03a4=['create','Request','CreateVoiceDialReport','../client'];(function(_0x552180,_0x32ed3c){var _0xdcb0ee=function(_0x310fa4){while(--_0x310fa4){_0x552180['push'](_0x552180['shift']());}};_0xdcb0ee(++_0x32ed3c);}(_0x03a4,0xf3));var _0x403a=function(_0x5574ba,_0x1f0b57){_0x5574ba=_0x5574ba-0x0;var _0x172ffd=_0x03a4[_0x5574ba];return _0x172ffd;};'use strict';var client=require(_0x403a('0x0'));exports[_0x403a('0x1')]=function(_0x3054a8){return client[_0x403a('0x2')](_0x403a('0x3'),{'body':_0x3054a8,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 4cce396..207716b 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 _0xa1fd=['recordingFormat','../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x458edc,_0x9baf98){var _0x44af29=function(_0x41929c){while(--_0x41929c){_0x458edc['push'](_0x458edc['shift']());}};_0x44af29(++_0x9baf98);}(_0xa1fd,0x1b9));var _0xda1f=function(_0x29be28,_0x1d71e5){_0x29be28=_0x29be28-0x0;var _0x5bcc73=_0xa1fd[_0x29be28];return _0x5bcc73;};'use strict';var client=require(_0xda1f('0x0'));exports[_0xda1f('0x1')]=function(){return function(){return client[_0xda1f('0x2')](_0xda1f('0x3'),{'options':{'raw':!![],'attributes':['id','exten',_0xda1f('0x4')],'where':{'VoiceExtensionId':null}},'log':_0xda1f('0x1')});};}; \ No newline at end of file +var _0x2821=['GetVoiceExtension','exten','recordingFormat','../client','getVoiceExtensions','Request'];(function(_0x13c082,_0x154bd5){var _0x5ae412=function(_0x3e5539){while(--_0x3e5539){_0x13c082['push'](_0x13c082['shift']());}};_0x5ae412(++_0x154bd5);}(_0x2821,0x87));var _0x1282=function(_0x27379e,_0xc72b55){_0x27379e=_0x27379e-0x0;var _0x273c00=_0x2821[_0x27379e];return _0x273c00;};'use strict';var client=require(_0x1282('0x0'));exports[_0x1282('0x1')]=function(){return function(){return client[_0x1282('0x2')](_0x1282('0x3'),{'options':{'raw':!![],'attributes':['id',_0x1282('0x4'),_0x1282('0x5')],'where':{'VoiceExtensionId':null}},'log':_0x1282('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index bac1ef6..234ce3a 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 _0x059d=['dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue'];(function(_0x177980,_0x13c2da){var _0x26a6d1=function(_0x4a8960){while(--_0x4a8960){_0x177980['push'](_0x177980['shift']());}};_0x26a6d1(++_0x13c2da);}(_0x059d,0x1ba));var _0xd059=function(_0x5da454,_0x5425b3){_0x5da454=_0x5da454-0x0;var _0x40933c=_0x059d[_0x5da454];return _0x40933c;};'use strict';var client=require(_0xd059('0x0'));exports[_0xd059('0x1')]=function(){return function(){return client[_0xd059('0x2')](_0xd059('0x3'),{'options':{'raw':![],'attributes':['id',_0xd059('0x4'),_0xd059('0x5'),_0xd059('0x6'),_0xd059('0x7'),_0xd059('0x8'),_0xd059('0x9'),_0xd059('0xa'),_0xd059('0xb'),_0xd059('0xc'),_0xd059('0xd'),_0xd059('0xe'),_0xd059('0xf'),'dialPredictiveOptimizationPercentage','dialPredictiveInterval',_0xd059('0x10'),_0xd059('0x11'),'dialOriginateTimeout','dialQueueOptions','dialQueueTimeout',_0xd059('0x12'),_0xd059('0x13'),_0xd059('0x14'),'dialBusyMaxRetry',_0xd059('0x15'),_0xd059('0x16'),_0xd059('0x17'),_0xd059('0x18'),_0xd059('0x19'),_0xd059('0x1a'),'dialPrefix','dialCheckDuplicateType',_0xd059('0x1b'),_0xd059('0x1c'),'dialAMDGreeting',_0xd059('0x1d'),_0xd059('0x1e'),_0xd059('0x1f'),_0xd059('0x20'),'dialAMDMaximumNumberOfWords',_0xd059('0x21'),_0xd059('0x22'),_0xd059('0x23'),_0xd059('0x24'),_0xd059('0x25'),_0xd059('0x26'),'dialAgiAfterHangupAgent',_0xd059('0x27'),_0xd059('0x28'),_0xd059('0x8'),_0xd059('0x29'),_0xd059('0x2a'),'dialCutDigit',_0xd059('0x2b'),_0xd059('0x2c'),_0xd059('0x2d'),_0xd059('0x2e'),_0xd059('0x2f'),'dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry',_0xd059('0x30'),'mandatoryDisposition','dialPredictiveIntervalMaxThreshold',_0xd059('0x31'),_0xd059('0x32'),'dialPreviewRecallmeReminder','callAdditionalPhoneAfterMin'],'include':[{'model':_0xd059('0x33'),'as':'Trunk','attributes':['id',_0xd059('0x4'),_0xd059('0x34'),_0xd059('0x35')]},{'model':_0xd059('0x36'),'as':_0xd059('0x37'),'attributes':['id',_0xd059('0x4')]},{'model':'Trunk','as':_0xd059('0x38'),'attributes':['id',_0xd059('0x4'),_0xd059('0x34'),_0xd059('0x35')]},{'model':_0xd059('0x39'),'as':_0xd059('0x39'),'attributes':['id',_0xd059('0x4')],'include':[{'model':_0xd059('0x39'),'as':_0xd059('0x3a'),'attributes':['id',_0xd059('0x4'),_0xd059('0x3b')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0x2f1f=['dialCutDigit','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','callAdditionalPhoneAfterMin','Trunk','callerid','Pause','mandatoryDispositionPause','TrunkBackup','active','Interval','interval','getVoiceQueues','Request','GetVoiceQueue','name','acwTimeout','monitor_format','type','dialActive','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber'];(function(_0x17ff38,_0x2f5bc1){var _0x18261f=function(_0x27aa2e){while(--_0x27aa2e){_0x17ff38['push'](_0x17ff38['shift']());}};_0x18261f(++_0x2f5bc1);}(_0x2f1f,0x109));var _0xf2f1=function(_0x3b8084,_0x4be3e5){_0x3b8084=_0x3b8084-0x0;var _0xc0d740=_0x2f1f[_0x3b8084];return _0xc0d740;};'use strict';var client=require('../client');exports[_0xf2f1('0x0')]=function(){return function(){return client[_0xf2f1('0x1')](_0xf2f1('0x2'),{'options':{'raw':![],'attributes':['id',_0xf2f1('0x3'),'acw',_0xf2f1('0x4'),'autopause',_0xf2f1('0x5'),_0xf2f1('0x6'),_0xf2f1('0x7'),'dialMethod','dialLimitChannel','dialLimitQueue',_0xf2f1('0x8'),_0xf2f1('0x9'),_0xf2f1('0xa'),_0xf2f1('0xb'),_0xf2f1('0xc'),_0xf2f1('0xd'),_0xf2f1('0xe'),'dialQueueOptions','dialQueueTimeout',_0xf2f1('0xf'),_0xf2f1('0x10'),_0xf2f1('0x11'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0xf2f1('0x12'),'dialNoAnswerRetryFrequency',_0xf2f1('0x13'),'dialTimezone',_0xf2f1('0x14'),'dialPrefix',_0xf2f1('0x15'),_0xf2f1('0x16'),_0xf2f1('0x17'),_0xf2f1('0x18'),_0xf2f1('0x19'),_0xf2f1('0x1a'),'dialAMDMinWordLength',_0xf2f1('0x1b'),_0xf2f1('0x1c'),_0xf2f1('0x1d'),_0xf2f1('0x1e'),_0xf2f1('0x1f'),_0xf2f1('0x20'),_0xf2f1('0x21'),_0xf2f1('0x22'),_0xf2f1('0x23'),_0xf2f1('0x24'),_0xf2f1('0x25'),_0xf2f1('0x5'),_0xf2f1('0x26'),_0xf2f1('0x27'),_0xf2f1('0x28'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency',_0xf2f1('0x29'),_0xf2f1('0x2a'),_0xf2f1('0x2b'),_0xf2f1('0x2c'),_0xf2f1('0x2d'),'dialMachineRetryFrequency',_0xf2f1('0x2e'),_0xf2f1('0x2f'),_0xf2f1('0x30'),_0xf2f1('0x31'),_0xf2f1('0x32'),_0xf2f1('0x33'),'dialPreviewRecallmeReminder',_0xf2f1('0x34')],'include':[{'model':_0xf2f1('0x35'),'as':_0xf2f1('0x35'),'attributes':['id',_0xf2f1('0x3'),_0xf2f1('0x36'),'active']},{'model':_0xf2f1('0x37'),'as':_0xf2f1('0x38'),'attributes':['id',_0xf2f1('0x3')]},{'model':_0xf2f1('0x35'),'as':_0xf2f1('0x39'),'attributes':['id','name','callerid',_0xf2f1('0x3a')]},{'model':_0xf2f1('0x3b'),'as':'Interval','attributes':['id',_0xf2f1('0x3')],'include':[{'model':'Interval','as':'Intervals','attributes':['id','name',_0xf2f1('0x3c')]}]}]},'log':_0xf2f1('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index cb5e0b7..4364d3e 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(_0x1af987,_0x2abd0b){var _0x41f7a0=function(_0x457bb9){while(--_0x457bb9){_0x1af987['push'](_0x1af987['shift']());}};_0x41f7a0(++_0x2abd0b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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(_0x24a61e,_0x4ba16b){var _0x322ecf=function(_0x8719aa){while(--_0x8719aa){_0x24a61e['push'](_0x24a61e['shift']());}};_0x322ecf(++_0x4ba16b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 d6df704..da13427 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 _0xbc40=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x436986,_0x3737ab){var _0x46a03e=function(_0x1b2432){while(--_0x1b2432){_0x436986['push'](_0x436986['shift']());}};_0x46a03e(++_0x3737ab);}(_0xbc40,0x148));var _0x0bc4=function(_0x2e24d9,_0x31e013){_0x2e24d9=_0x2e24d9-0x0;var _0x416d84=_0xbc40[_0x2e24d9];return _0x416d84;};'use strict';var client=require(_0x0bc4('0x0'));exports[_0x0bc4('0x1')]=function(_0x317414){return function(){return client[_0x0bc4('0x2')](_0x0bc4('0x3'),{'options':{'where':{'VoiceQueueId':_0x317414,'paused':!![]},'raw':!![]},'log':_0x0bc4('0x1')});};}; \ No newline at end of file +var _0xfc45=['../client','getVoiceQueueRtPauses','Request'];(function(_0x4c9316,_0x5c7f6f){var _0x146aad=function(_0x4fa179){while(--_0x4fa179){_0x4c9316['push'](_0x4c9316['shift']());}};_0x146aad(++_0x5c7f6f);}(_0xfc45,0xb7));var _0x5fc4=function(_0x390151,_0x90351){_0x390151=_0x390151-0x0;var _0x1e61c4=_0xfc45[_0x390151];return _0x1e61c4;};'use strict';var client=require(_0x5fc4('0x0'));exports[_0x5fc4('0x1')]=function(_0x34f236){return function(){return client[_0x5fc4('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x34f236,'paused':!![]},'raw':!![]},'log':_0x5fc4('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index a0d2f17..f0d1dbe 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 _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x133956,_0x3b5367){var _0x3d8095=function(_0x104618){while(--_0x104618){_0x133956['push'](_0x133956['shift']());}};_0x3d8095(++_0x3b5367);}(_0x7a54,0x106));var _0x47a5=function(_0x4ffd82,_0x17cc46){_0x4ffd82=_0x4ffd82-0x0;var _0x1c33b0=_0x7a54[_0x4ffd82];return _0x1c33b0;};'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 +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x87abf1,_0x1e5ecc){var _0x1d9d7a=function(_0x1990fb){while(--_0x1990fb){_0x87abf1['push'](_0x87abf1['shift']());}};_0x1d9d7a(++_0x1e5ecc);}(_0x7a54,0x106));var _0x47a5=function(_0x206962,_0x13ccea){_0x206962=_0x206962-0x0;var _0x5672ef=_0x7a54[_0x206962];return _0x5672ef;};'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 dded1fa..4882b20 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 _0xf643=['transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransfererexten','../client','transfers','blindTransfer','Request','transfererchannel','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','context','blind','CreateVoiceTransferReport','attendedTransfer','result','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf643,0x149));var _0x3f64=function(_0x169860,_0x185d87){_0x169860=_0x169860-0x0;var _0x3043f7=_0xf643[_0x169860];return _0x3043f7;};'use strict';var client=require(_0x3f64('0x0'));exports[_0x3f64('0x1')]={};exports[_0x3f64('0x2')]=function(_0x5da004){return client[_0x3f64('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x5da004['result'],'transfererchannel':_0x5da004[_0x3f64('0x4')],'transferercalleridnum':_0x5da004['transferercalleridnum'],'transferercalleridname':_0x5da004[_0x3f64('0x5')],'transfererconnectedlinenum':_0x5da004['transfererconnectedlinenum'],'transfererconnectedlinename':_0x5da004[_0x3f64('0x6')],'transfereraccountcode':_0x5da004[_0x3f64('0x7')],'transferercontext':_0x5da004['transferercontext'],'transfererexten':_0x5da004[_0x3f64('0x8')],'transfererlinkedid':_0x5da004[_0x3f64('0x9')],'transfereechannel':_0x5da004[_0x3f64('0xa')],'transfereecalleridnum':_0x5da004['transfereecalleridnum'],'transfereecalleridname':_0x5da004[_0x3f64('0xb')],'transfereeconnectedlinenum':_0x5da004['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x5da004['transfereeconnectedlinename'],'transfereeaccountcode':_0x5da004[_0x3f64('0xc')],'transfereecontext':_0x5da004['transfereecontext'],'transfereeexten':_0x5da004[_0x3f64('0xd')],'transfereelinkedid':_0x5da004[_0x3f64('0xe')],'isexternal':_0x5da004[_0x3f64('0xf')],'context':_0x5da004[_0x3f64('0x10')],'extension':_0x5da004['extension'],'type':_0x3f64('0x11')},'log':_0x3f64('0x12')});};exports[_0x3f64('0x13')]=function(_0x4804a2){return client['Request'](_0x3f64('0x12'),{'body':{'result':_0x4804a2[_0x3f64('0x14')],'transfererchannel':_0x4804a2[_0x3f64('0x15')],'transferercalleridnum':_0x4804a2[_0x3f64('0x16')],'transferercalleridname':_0x4804a2['origtransferercalleridname'],'transfererconnectedlinenum':_0x4804a2[_0x3f64('0x17')],'transfererconnectedlinename':_0x4804a2[_0x3f64('0x18')],'transfereraccountcode':_0x4804a2[_0x3f64('0x19')],'transferercontext':_0x4804a2[_0x3f64('0x1a')],'transfererexten':_0x4804a2[_0x3f64('0x1b')],'transfererlinkedid':_0x4804a2['origtransfererlinkedid'],'transfereechannel':_0x4804a2[_0x3f64('0x1c')],'transfereecalleridnum':_0x4804a2['transfertargetcalleridnum'],'transfereecalleridname':_0x4804a2[_0x3f64('0x1d')],'transfereeconnectedlinenum':_0x4804a2[_0x3f64('0x1e')],'transfereeconnectedlinename':_0x4804a2[_0x3f64('0x1f')],'transfereeaccountcode':_0x4804a2['transfertargetaccountcode'],'transfereecontext':_0x4804a2[_0x3f64('0x20')],'transfereeexten':_0x4804a2[_0x3f64('0x21')],'transfereelinkedid':_0x4804a2[_0x3f64('0x22')],'isexternal':_0x4804a2[_0x3f64('0xf')],'context':_0x4804a2['origtransferercontext'],'extension':_0x4804a2[_0x3f64('0x23')],'type':'attended'},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x1bba=['transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','extension','blind','origtransferercalleridname','secondtransfererconnectedlinename','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransferercontext','origtransfererexten','attended','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext'];(function(_0x412921,_0x92f5ed){var _0x2016dc=function(_0x49797f){while(--_0x49797f){_0x412921['push'](_0x412921['shift']());}};_0x2016dc(++_0x92f5ed);}(_0x1bba,0x11e));var _0xa1bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1bba[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0xa1bb('0x0')]={};exports[_0xa1bb('0x1')]=function(_0x7b018f){return client[_0xa1bb('0x2')](_0xa1bb('0x3'),{'body':{'result':_0x7b018f[_0xa1bb('0x4')],'transfererchannel':_0x7b018f[_0xa1bb('0x5')],'transferercalleridnum':_0x7b018f['transferercalleridnum'],'transferercalleridname':_0x7b018f[_0xa1bb('0x6')],'transfererconnectedlinenum':_0x7b018f['transfererconnectedlinenum'],'transfererconnectedlinename':_0x7b018f[_0xa1bb('0x7')],'transfereraccountcode':_0x7b018f[_0xa1bb('0x8')],'transferercontext':_0x7b018f[_0xa1bb('0x9')],'transfererexten':_0x7b018f[_0xa1bb('0xa')],'transfererlinkedid':_0x7b018f[_0xa1bb('0xb')],'transfereechannel':_0x7b018f[_0xa1bb('0xc')],'transfereecalleridnum':_0x7b018f[_0xa1bb('0xd')],'transfereecalleridname':_0x7b018f[_0xa1bb('0xe')],'transfereeconnectedlinenum':_0x7b018f[_0xa1bb('0xf')],'transfereeconnectedlinename':_0x7b018f[_0xa1bb('0x10')],'transfereeaccountcode':_0x7b018f[_0xa1bb('0x11')],'transfereecontext':_0x7b018f[_0xa1bb('0x12')],'transfereeexten':_0x7b018f[_0xa1bb('0x13')],'transfereelinkedid':_0x7b018f[_0xa1bb('0x14')],'isexternal':_0x7b018f[_0xa1bb('0x15')],'context':_0x7b018f['context'],'extension':_0x7b018f[_0xa1bb('0x16')],'type':_0xa1bb('0x17')},'log':_0xa1bb('0x3')});};exports['attendedTransfer']=function(_0x293d07){return client[_0xa1bb('0x2')](_0xa1bb('0x3'),{'body':{'result':_0x293d07[_0xa1bb('0x4')],'transfererchannel':_0x293d07['origtransfererchannel'],'transferercalleridnum':_0x293d07['origtransferercalleridnum'],'transferercalleridname':_0x293d07[_0xa1bb('0x18')],'transfererconnectedlinenum':_0x293d07['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x293d07[_0xa1bb('0x19')],'transfereraccountcode':_0x293d07['origtransfereraccountcode'],'transferercontext':_0x293d07[_0xa1bb('0x1a')],'transfererexten':_0x293d07['secondtransfererexten'],'transfererlinkedid':_0x293d07[_0xa1bb('0x1b')],'transfereechannel':_0x293d07[_0xa1bb('0x1c')],'transfereecalleridnum':_0x293d07[_0xa1bb('0x1d')],'transfereecalleridname':_0x293d07['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x293d07[_0xa1bb('0x1e')],'transfereeconnectedlinename':_0x293d07['transfertargetconnectedlinename'],'transfereeaccountcode':_0x293d07[_0xa1bb('0x1f')],'transfereecontext':_0x293d07[_0xa1bb('0x20')],'transfereeexten':_0x293d07[_0xa1bb('0x21')],'transfereelinkedid':_0x293d07['transfertargetlinkedid'],'isexternal':_0x293d07[_0xa1bb('0x15')],'context':_0x293d07[_0xa1bb('0x22')],'extension':_0x293d07[_0xa1bb('0x23')],'type':_0xa1bb('0x24')},'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 4ced699..7c875b2 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 _0xcffe=['outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','send','checkAfterSend','server','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','listen','format','SIP','name','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','ami\x20disconnected','join','keys','module','action','then','catch','message','username','pick','command','Action','content','voiceQueues','hasOwnProperty','answered','loggedIn','pTalking','sumBillable','sumDuration','type','unmanaged','abandoned','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','length','find','omit','undefined','values','channels','map','uniqueid','channel','wav','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','monitors','status','stop','%s.%s','filename','StopMixMonitor\x20Success','voicequeuechannel','queueChannels','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','context','telephones'];(function(_0x1d4b83,_0x456443){var _0x369c05=function(_0x1fcf7a){while(--_0x1fcf7a){_0x1d4b83['push'](_0x1d4b83['shift']());}};_0x369c05(++_0x456443);}(_0xcffe,0x1a1));var _0xecff=function(_0x37b0e1,_0x5f3934){_0x37b0e1=_0x37b0e1-0x0;var _0x24e3b2=_0xcffe[_0x37b0e1];return _0x24e3b2;};'use strict';var _=require(_0xecff('0x0'));var util=require(_0xecff('0x1'));var jayson=require(_0xecff('0x2'));var schema=require(_0xecff('0x3'));var moment=require(_0xecff('0x4'));var config=require(_0xecff('0x5'));var properties=require(_0xecff('0x6'));var ami=require(_0xecff('0x7'));exports[_0xecff('0x8')]=function(_0xfffe9b,_0x5410f4,_0x483972){return new Promise(function(_0x3020d9,_0x25572c){var _0x2e2fa9={'QueuePause':function(_0x38a8f6){return new Promise(function(_0x50c98b){var _0x298c19=util[_0xecff('0x9')]('%s/%s',_0xecff('0xa'),_0x38a8f6[_0xecff('0xb')]);if(_0xfffe9b[_0xecff('0xc')]&&_0xfffe9b[_0xecff('0xc')][_0x298c19]&&_0xfffe9b[_0xecff('0xc')][_0x298c19]['timer']){_0xfffe9b[_0xecff('0xc')][_0x298c19][_0xecff('0xd')]();}if(_0xfffe9b[_0xecff('0xe')][_0x298c19]){_0xfffe9b[_0xecff('0xe')][_0x298c19][_0xecff('0xf')]({'statePause':_0x38a8f6[_0xecff('0x10')]?!![]:![]});}_0x50c98b({'code':0xc8,'message':_0xecff('0x11')});});},'Reload':function(_0x32627c){var _0x3e907d=this;return new Promise(function(_0x151a79,_0x1f67d2){if(ami[_0xecff('0x12')]()==![]){return _0x1f67d2(_0x3e907d[_0xecff('0x13')](0x1f4,[config[_0xecff('0x14')]['ip'],config['asterisk']['username'],_0xecff('0x15')][_0xecff('0x16')]('\x20')));}_0x32627c=_['pick'](_0x32627c,_[_0xecff('0x17')](properties[_0xecff('0x18')]));_0x32627c[_0xecff('0x19')]='Reload';return ami['Action'](_0x32627c)[_0xecff('0x1a')](function(_0xa5816b){_0x151a79({'code':0xc8,'message':_0xa5816b['message']});})[_0xecff('0x1b')](function(_0x3adc81){_0x1f67d2(_0x3e907d[_0xecff('0x13')](0x1f5,_0x3adc81[_0xecff('0x1c')]));});});},'Command':function(_0x2fc1f9){var _0x1682a2=this;return new Promise(function(_0x5c2503,_0x229728){if(ami[_0xecff('0x12')]()==![]){return _0x229728(_0x1682a2[_0xecff('0x13')](0x1f4,[config[_0xecff('0x14')]['ip'],config['asterisk'][_0xecff('0x1d')],_0xecff('0x15')][_0xecff('0x16')]('\x20')));}_0x2fc1f9=_[_0xecff('0x1e')](_0x2fc1f9,_0xecff('0x1f'));_0x2fc1f9[_0xecff('0x19')]='Command';return ami[_0xecff('0x20')](_0x2fc1f9)['then'](function(_0x572ec2){_0x5c2503({'code':0xc8,'message':_0x572ec2[_0xecff('0x21')]});})['catch'](function(_0x2447da){_0x229728(_0x1682a2['error'](0x1f5,_0x2447da[_0xecff('0x1c')]));});});},'VoiceQueues':function(){return new Promise(function(_0x4ced15){var _0x1fd7c6=[];for(var _0x44f5f7 in _0xfffe9b['voiceQueues']){if(_0xfffe9b[_0xecff('0x22')][_0xecff('0x23')](_0x44f5f7)){var _0x393312=_0xfffe9b[_0xecff('0x22')][_0x44f5f7];var _0x19202e={'id':_0x393312['id'],'name':_0x393312['name'],'strategy':_0x393312['strategy'],'answered':_0x393312[_0xecff('0x24')],'available':_0x393312['available'],'loggedIn':_0x393312[_0xecff('0x25')],'pTalking':_0x393312[_0xecff('0x26')],'sumBillable':_0x393312[_0xecff('0x27')],'sumDuration':_0x393312[_0xecff('0x28')],'sumHoldTime':_0x393312['sumHoldTime']||0x0,'talking':_0x393312['talking'],'total':_0x393312['total'],'type':_0x393312[_0xecff('0x29')],'unmanaged':_0x393312[_0xecff('0x2a')],'abandoned':_0x393312[_0xecff('0x2b')],'waiting':_0x393312[_0xecff('0x2c')],'loggedInDb':_0x393312['loggedInDb']};if(_0x393312[_0xecff('0x29')]===_0xecff('0x2d')){_0x19202e[_0xecff('0x2e')]=_0x393312['dialActive'];_0x19202e[_0xecff('0x2f')]=_0x393312[_0xecff('0x2f')];_0x19202e[_0xecff('0x30')]=_0x393312[_0xecff('0x30')];_0x19202e['dialOriginateCallerIdNumber']=_0x393312[_0xecff('0x31')];_0x19202e[_0xecff('0x32')]=_0x393312['dialOriginateTimeout'];_0x19202e[_0xecff('0x33')]=_0x393312[_0xecff('0x33')];_0x19202e[_0xecff('0x34')]=_0x393312[_0xecff('0x34')];_0x19202e['outboundAnswerAgiCallsDay']=_0x393312[_0xecff('0x35')];_0x19202e[_0xecff('0x36')]=_0x393312[_0xecff('0x36')];_0x19202e['outboundBlacklistCallsDay']=_0x393312[_0xecff('0x37')];_0x19202e[_0xecff('0x38')]=_0x393312[_0xecff('0x38')];_0x19202e[_0xecff('0x39')]=_0x393312[_0xecff('0x39')];_0x19202e[_0xecff('0x3a')]=_0x393312['outboundDropCallsDayACS'];_0x19202e['outboundDropCallsDayCallersExit']=_0x393312['outboundDropCallsDayCallersExit'];_0x19202e[_0xecff('0x3b')]=_0x393312['outboundDropCallsDayTimeout'];_0x19202e[_0xecff('0x3c')]=_0x393312[_0xecff('0x3c')];_0x19202e['outboundNoSuchCallsDay']=_0x393312[_0xecff('0x3d')];_0x19202e[_0xecff('0x3e')]=_0x393312[_0xecff('0x3e')];_0x19202e['outboundReCallsDay']=_0x393312[_0xecff('0x3f')];_0x19202e[_0xecff('0x40')]=_0x393312[_0xecff('0x40')];_0x19202e['outboundUnknownCallsDay']=_0x393312[_0xecff('0x41')];_0x19202e[_0xecff('0x42')]=_0x393312[_0xecff('0x42')];_0x19202e[_0xecff('0x43')]=_0x393312[_0xecff('0x43')];_0x19202e[_0xecff('0x44')]=_0x393312[_0xecff('0x44')];_0x19202e[_0xecff('0x45')]=_0x393312[_0xecff('0x45')];_0x19202e[_0xecff('0x46')]=_0x393312[_0xecff('0x46')];_0x19202e['predictiveIntervalErlangCalls']=_0x393312[_0xecff('0x47')];_0x19202e[_0xecff('0x48')]=_0x393312[_0xecff('0x48')];_0x19202e[_0xecff('0x49')]=_0x393312[_0xecff('0x49')];_0x19202e[_0xecff('0x4a')]=_0x393312[_0xecff('0x4a')];_0x19202e[_0xecff('0x4b')]=_0x393312['predictiveIntervalPauses'];_0x19202e[_0xecff('0x4c')]=_0x393312['predictiveIntervalAvailable'];_0x19202e[_0xecff('0x4d')]=_0x393312[_0xecff('0x4d')];_0x19202e[_0xecff('0x1c')]=_0x393312[_0xecff('0x1c')];_0x19202e[_0xecff('0x4e')]=_0x393312[_0xecff('0x4e')];_0x19202e[_0xecff('0x4f')]=_0x393312['erlangCalls'];_0x19202e[_0xecff('0x50')]=_0x393312[_0xecff('0x50')];_0x19202e['erlangAbandonmentRate']=_0x393312['erlangAbandonmentRate'];_0x19202e[_0xecff('0x51')]=_0x393312[_0xecff('0x51')];_0x19202e[_0xecff('0x52')]=_0x393312[_0xecff('0x52')];_0x19202e[_0xecff('0x53')]=_0x393312[_0xecff('0x53')];}if(_0x393312['Trunk']){_0x19202e[_0xecff('0x54')]={'id':_0x393312[_0xecff('0x54')]['id'],'name':_0x393312['Trunk'][_0xecff('0xb')],'active':_0x393312[_0xecff('0x54')][_0xecff('0x55')],'callerid':_0x393312[_0xecff('0x54')][_0xecff('0x56')]};}if(_0x393312[_0xecff('0x57')]){_0x19202e['Interval']={'id':_0x393312[_0xecff('0x57')]['id'],'name':_0x393312[_0xecff('0x57')][_0xecff('0xb')]};}_0x1fd7c6['push'](_0x19202e);}}_0x4ced15({'count':_0x1fd7c6[_0xecff('0x58')],'rows':_0x1fd7c6});});},'UpdateVoiceQueue':function(_0x7d110a){return new Promise(function(_0x267ff5,_0x3c73ca){var _0x515440=_[_0xecff('0x59')](_0xfffe9b[_0xecff('0x22')],{'id':parseInt(_0x7d110a['id'])});var _0x58cdfb=_[_0xecff('0x5a')](_0x7d110a,['id']);if(_0x515440){for(var _0x1d2ac3 in _0x58cdfb){if(typeof _0x58cdfb[_0x1d2ac3]!=='undefined'&&typeof _0x515440[_0x1d2ac3]!==_0xecff('0x5b')){_0x515440[_0x1d2ac3]=_0x58cdfb[_0x1d2ac3];}}_0x267ff5(_0x515440);}else{_0x3c73ca();}});},'VoiceChannels':function(){return new Promise(function(_0x509fd0){var _0x3a6b26=_[_0xecff('0x5c')](_0xfffe9b[_0xecff('0x5d')]);_0x509fd0({'count':_0x3a6b26[_0xecff('0x58')],'rows':_0x3a6b26});});},'VoiceChannelMixMonitor':function(_0x6d1e9a){var _0x39d3f6=this;return new Promise(function(_0x563f68,_0x596eb8){if(ami[_0xecff('0x12')]()==![]){return _0x596eb8(_0x39d3f6[_0xecff('0x13')](0x1f4,[config[_0xecff('0x14')]['ip'],config[_0xecff('0x14')][_0xecff('0x1d')],_0xecff('0x15')][_0xecff('0x16')]('\x20')));}var _0x3ac749=schema(properties['voicechannel'])[_0xecff('0x3')](_0x6d1e9a);if(_0x3ac749[_0xecff('0x58')]>0x0){return _0x596eb8(_0x39d3f6['error'](0x1f4,_[_0xecff('0x5e')](_0x3ac749,'message')[_0xecff('0x16')](',\x20')));}var _0x453e4c=_['find'](_0xfffe9b[_0xecff('0x5d')],{'uniqueid':_0x6d1e9a[_0xecff('0x5f')]});if(_0x453e4c&&_0x453e4c[_0xecff('0x60')]){var _0x188d08=util[_0xecff('0x9')]('%s.%s',_0x6d1e9a['filename']||_0x6d1e9a[_0xecff('0x5f')],_0x6d1e9a[_0xecff('0x9')]||_0xecff('0x61'));return ami[_0xecff('0x20')]({'action':_0xecff('0x62'),'channel':_0x453e4c[_0xecff('0x60')],'file':_0x188d08,'options':_0xecff('0x63')})[_0xecff('0x1a')](function(_0x9b44d4){var _0x4f9060=_[_0xecff('0x59')](_0x453e4c['monitors'],{'filename':_0xecff('0x64')+_0x188d08[_0xecff('0x65')]()});if(_[_0xecff('0x66')](_0x4f9060)){_0x453e4c['monitors'][_0xecff('0x67')]({'filename':'/var/spool/asterisk/monitor/'+_0x188d08[_0xecff('0x65')](),'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x9b44d4[_0xecff('0x68')],'status':'rec'});}else{_0x4f9060[_0xecff('0x68')]=_0x9b44d4[_0xecff('0x68')];_0x4f9060['status']=_0xecff('0x69');}_0x563f68({'code':0xc8,'message':[_0x6d1e9a[_0xecff('0x5f')],_0xecff('0x6a'),_0x9b44d4[_0xecff('0x68')]][_0xecff('0x16')]('\x20'),'mixmonitorid':_0x9b44d4[_0xecff('0x68')]});})[_0xecff('0x1b')](function(_0x574c40){_0x596eb8(_0x39d3f6['error'](0x1f5,[_0x6d1e9a[_0xecff('0x5f')],_0x574c40[_0xecff('0x1c')][_0xecff('0x65')]()][_0xecff('0x16')]('\x20')));});}else{return _0x596eb8(_0x39d3f6[_0xecff('0x13')](0x1f5,_0xecff('0x6b')));}});},'VoiceChannelStopMixMonitor':function(_0x29d4d5){var _0x33bcb1=this;return new Promise(function(_0x1a5555,_0x322438){if(ami[_0xecff('0x12')]()==![]){return _0x322438(_0x33bcb1[_0xecff('0x13')](0x1f4,[config[_0xecff('0x14')]['ip'],config[_0xecff('0x14')]['username'],'ami\x20disconnected'][_0xecff('0x16')]('\x20')));}var _0x4d4575=schema(properties['voicechannel'])[_0xecff('0x3')](_0x29d4d5);if(_0x4d4575[_0xecff('0x58')]>0x0){return _0x322438(_0x33bcb1[_0xecff('0x13')](0x1f4,_['map'](_0x4d4575,_0xecff('0x1c'))[_0xecff('0x16')](',\x20')));}var _0xbe0c3b=_['find'](_0xfffe9b[_0xecff('0x5d')],{'uniqueid':_0x29d4d5['uniqueid']});if(_0xbe0c3b){return Promise['resolve']()[_0xecff('0x1a')](function(){if(_0xbe0c3b[_0xecff('0x60')]){return ami[_0xecff('0x20')]({'action':_0xecff('0x6c'),'channel':_0xbe0c3b[_0xecff('0x60')],'mixmonitorid':_0x29d4d5[_0xecff('0x68')]})[_0xecff('0x1b')](function(){});}})[_0xecff('0x1a')](function(){if(_0xbe0c3b[_0xecff('0x6d')]){return ami[_0xecff('0x20')]({'action':_0xecff('0x6c'),'channel':_0xbe0c3b[_0xecff('0x6d')],'mixmonitorid':_0x29d4d5[_0xecff('0x68')]})[_0xecff('0x1b')](function(){});}})['then'](function(){var _0x59966f=_[_0xecff('0x59')](_0xbe0c3b[_0xecff('0x6e')],{'mixmonitorid':_0x29d4d5['mixmonitorid']});if(_0x59966f){_0x59966f[_0xecff('0x6f')]=_0xecff('0x70');}})['then'](function(){var _0x148c69=util[_0xecff('0x9')](_0xecff('0x71'),_0x29d4d5[_0xecff('0x72')]||_0x29d4d5[_0xecff('0x5f')],_0x29d4d5[_0xecff('0x9')]||'wav');var _0x1c7d9c=_[_0xecff('0x59')](_0xbe0c3b[_0xecff('0x6e')],{'filename':_0xecff('0x64')+_0x148c69[_0xecff('0x65')]()});if(_0x1c7d9c){_0x1c7d9c['status']=_0xecff('0x70');}})[_0xecff('0x1a')](function(){_0x1a5555({'code':0xc8,'message':[_0x29d4d5[_0xecff('0x5f')],_0xecff('0x73')]['join']('\x20')});})['catch'](function(_0x4f7b93){_0x322438(_0x33bcb1[_0xecff('0x13')](0x1f5,[_0x29d4d5[_0xecff('0x5f')],_0x4f7b93[_0xecff('0x1c')]['toLowerCase']()][_0xecff('0x16')]('\x20')));});}else{return _0x322438(_0x33bcb1['error'](0x1f5,_0xecff('0x6b')));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x3e3197){var _0x17dd7c=_[_0xecff('0x5c')](_0xfffe9b['queueChannels']);_0x3e3197({'count':_0x17dd7c[_0xecff('0x58')],'rows':_0x17dd7c});});},'VoiceQueuesChannel':function(_0x23aa75){var _0xb3594f=this;return new Promise(function(_0x4dfd1d,_0x5dd627){var _0x3aa2d8=schema(properties[_0xecff('0x74')])['validate'](_0x23aa75);if(_0x3aa2d8[_0xecff('0x58')]>0x0){return _0x5dd627(_0xb3594f[_0xecff('0x13')](0x1f4,_[_0xecff('0x5e')](_0x3aa2d8,_0xecff('0x1c'))[_0xecff('0x16')](',\x20')));}var _0x5499fb=_['find'](_0xfffe9b[_0xecff('0x75')],{'uniqueid':_0x23aa75[_0xecff('0x5f')]});if(_0x5499fb){_0x4dfd1d(_0x5499fb);}else{return _0x5dd627(_0xb3594f['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0xd588df){var _0x5d1635=this;return new Promise(function(_0x1b0ccd,_0xac26eb){if(ami['isConnected']()==![]){return _0xac26eb(_0x5d1635[_0xecff('0x13')](0x1f4,[config[_0xecff('0x14')]['ip'],config[_0xecff('0x14')][_0xecff('0x1d')],_0xecff('0x15')][_0xecff('0x16')]('\x20')));}var _0x44a4ff=schema(properties[_0xecff('0x76')])['validate'](_0xd588df);if(_0x44a4ff[_0xecff('0x58')]>0x0){return _0xac26eb(_0x5d1635['error'](0x1f4,_['map'](_0x44a4ff,_0xecff('0x1c'))['join'](',\x20')));}var _0x4932ff=_[_0xecff('0x59')](_0xfffe9b[_0xecff('0x75')],{'uniqueid':_0xd588df[_0xecff('0x5f')]});if(_0x4932ff&&_0x4932ff[_0xecff('0x60')]){return ami[_0xecff('0x20')]({'action':'Hangup','channel':_0x4932ff[_0xecff('0x60')]})[_0xecff('0x1a')](function(_0x147766){_0x1b0ccd({'code':0xc8,'message':[_0xd588df[_0xecff('0x5f')],_0x147766[_0xecff('0x1c')]['toLowerCase']()][_0xecff('0x16')]('\x20')});})[_0xecff('0x1b')](function(_0x4156df){_0xac26eb(_0x5d1635[_0xecff('0x13')](0x1f5,[_0xd588df[_0xecff('0x5f')],_0x4156df['message']['toLowerCase']()][_0xecff('0x16')]('\x20')));});}else{return _0xac26eb(_0x5d1635['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x26593b){var _0x50e1b4=this;return new Promise(function(_0xae0c00,_0x59bcaa){if(ami['isConnected']()==![]){return _0x59bcaa(_0x50e1b4['error'](0x1f4,[config['asterisk']['ip'],config[_0xecff('0x14')][_0xecff('0x1d')],_0xecff('0x15')][_0xecff('0x16')]('\x20')));}var _0x47037c=schema(properties[_0xecff('0x77')])[_0xecff('0x3')](_0x26593b);if(_0x47037c[_0xecff('0x58')]>0x0){return _0x59bcaa(_0x50e1b4[_0xecff('0x13')](0x1f4,_[_0xecff('0x5e')](_0x47037c,'message')[_0xecff('0x16')](',\x20')));}var _0x461dfb=_[_0xecff('0x59')](_0xfffe9b[_0xecff('0x75')],{'uniqueid':_0x26593b[_0xecff('0x5f')]});if(_0x461dfb&&_0x461dfb['channel']){return ami[_0xecff('0x20')]({'action':_0xecff('0x78'),'channel':_0x461dfb[_0xecff('0x60')],'exten':_0x26593b['exten'],'context':_0x26593b[_0xecff('0x79')]||_0x461dfb['context'],'priority':0x1})[_0xecff('0x1a')](function(_0x57bdea){_0xae0c00({'code':0xc8,'message':[_0x26593b[_0xecff('0x5f')],_0x57bdea[_0xecff('0x1c')][_0xecff('0x65')]()][_0xecff('0x16')]('\x20')});})[_0xecff('0x1b')](function(_0x490795){_0x59bcaa(_0x50e1b4[_0xecff('0x13')](0x1f5,[_0x26593b[_0xecff('0x5f')],_0x490795['message']['toLowerCase']()][_0xecff('0x16')]('\x20')));});}else{return _0x59bcaa(_0x50e1b4[_0xecff('0x13')](0x1f5,_0xecff('0x6b')));}});},'Agents':function(_0x3ec1a2){return new Promise(function(_0x53e078){var _0x2eb5b4=_[_0xecff('0x5c')](_0xfffe9b['agents']);if(_0x3ec1a2&&_0x3ec1a2['id']){var _0x3f8cd9=_['find'](_0x2eb5b4,function(_0x565905){return _0x565905['id']===_0x3ec1a2['id'];});_0x53e078(_0x3f8cd9);}else{_0x53e078({'count':_0x2eb5b4[_0xecff('0x58')],'rows':_0x2eb5b4});}});},'Telephones':function(){return new Promise(function(_0x49cc1e){var _0xcf005f=_[_0xecff('0x5c')](_0xfffe9b[_0xecff('0x7a')]);_0x49cc1e({'count':_0xcf005f[_0xecff('0x58')],'rows':_0xcf005f});});},'Trunks':function(){return new Promise(function(_0x22f7e7){var _0x4c28f0=_['values'](_0xfffe9b['trunks']);_0x22f7e7({'count':_0x4c28f0['length'],'rows':_0x4c28f0});});},'OutboundChannels':function(){return new Promise(function(_0x5b64d6){var _0x1b3de4=_['values'](_0xfffe9b[_0xecff('0x7b')]);_0x5b64d6({'count':_0x1b3de4[_0xecff('0x58')],'rows':_0x1b3de4});});},'Outbound':function(){return new Promise(function(_0x1ff2aa){_0x1ff2aa(_0xfffe9b['outbound']);});},'Campaigns':function(){return new Promise(function(_0xd36f5d){var _0x48be75=_['values'](_0xfffe9b[_0xecff('0x7c')]);_0xd36f5d({'count':_0x48be75[_0xecff('0x58')],'rows':_0x48be75});});},'VoiceQueuesPreview':function(_0x4fd43d){var _0x3e299c=this;return new Promise(function(_0xe7ec21,_0x10fbdf){_0x5410f4[_0xecff('0x7d')](_0x4fd43d['id'])[_0xecff('0x1a')](function(_0x24f60b){_0xe7ec21({'code':0xc8,'message':_0x24f60b['message']});})['catch'](function(_0x34f77f){_0x10fbdf(_0x3e299c[_0xecff('0x13')](0x1f4,_0x34f77f['message']));});});},'EventManager':function(_0x44db60){var _0x2b57b0=this;return new Promise(function(_0x41a24f,_0x485eae){if(!_0x44db60[_0xecff('0x7e')]){return _0x485eae(_0x2b57b0[_0xecff('0x13')](0x1f4,_0xecff('0x7f')));}ami[_0xecff('0x80')]('custom:'+_0x44db60[_0xecff('0x7e')],_0x44db60['message']);_0x41a24f({'code':0xc8,'message':_0x44db60});});},'FaxAccounts':function(){return new Promise(function(_0x4f5577){var _0x1defc5=_[_0xecff('0x5c')](_0xfffe9b['faxAccounts']);_0x4f5577({'count':_0x1defc5['length'],'rows':_0x1defc5});});},'SendFax':function(_0x3a96a8){var _0x3763ae=this;return new Promise(function(_0x2066a7,_0x500c2e){_0x483972[_0xecff('0x81')](_0x3a96a8)[_0xecff('0x1a')](function(_0xe20065){_0x2066a7({'code':0xc8,'message':_0xe20065['message']});})[_0xecff('0x1b')](function(_0x2bda17){_0x500c2e(_0x3763ae[_0xecff('0x13')](0x1f4,_0x2bda17[_0xecff('0x1c')]));});});},'CheckAfterSend':function(_0x426947){var _0x351dbc=this;return new Promise(function(_0x532586,_0x39aa65){_0x483972[_0xecff('0x82')](_0x426947)[_0xecff('0x1a')](function(_0x1dfaef){_0x532586({'code':0xc8,'message':_0x1dfaef[_0xecff('0x1c')]});})['catch'](function(_0xd63466){_0x39aa65(_0x351dbc[_0xecff('0x13')](0x1f4,_0xd63466['message']));});});}};var _0x224d02=jayson[_0xecff('0x83')](_0x2e2fa9)['http']();_0x224d02['on'](_0xecff('0x13'),function(_0x3d879d){return _0x25572c(_0x3d879d);});_0x224d02[_0xecff('0x8')](0x232a,_0xecff('0x84'),function(){console[_0xecff('0x85')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3020d9(_0xecff('0x86')+0x232a);});});}; \ No newline at end of file +var _0x7894=['outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','length','find','omit','undefined','values','channels','map','uniqueid','channel','format','%s.%s','filename','Action','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','resolve','StopMixMonitor','destinationchannel','status','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','context','telephones','outboundChannels','outbound','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','checkAfterSend','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','validate','moment','../../../config/environment','../ami','listen','%s/%s','name','timers','timer','updateAcw','agents','QueuePause','isConnected','asterisk','username','ami\x20disconnected','join','keys','module','Reload','then','catch','error','pick','command','action','Command','message','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay'];(function(_0xb6670e,_0x5de985){var _0xd94d42=function(_0x25403d){while(--_0x25403d){_0xb6670e['push'](_0xb6670e['shift']());}};_0xd94d42(++_0x5de985);}(_0x7894,0x170));var _0x4789=function(_0x5b2fec,_0x2c20ac){_0x5b2fec=_0x5b2fec-0x0;var _0x330d0f=_0x7894[_0x5b2fec];return _0x330d0f;};'use strict';var _=require(_0x4789('0x0'));var util=require(_0x4789('0x1'));var jayson=require(_0x4789('0x2'));var schema=require(_0x4789('0x3'));var moment=require(_0x4789('0x4'));var config=require(_0x4789('0x5'));var properties=require('../properties');var ami=require(_0x4789('0x6'));exports[_0x4789('0x7')]=function(_0x4e2393,_0x3394f6,_0x4bfe85){return new Promise(function(_0x1b4e02,_0x12ef33){var _0x114a90={'QueuePause':function(_0x298902){return new Promise(function(_0x13b7f6){var _0x5a45ae=util['format'](_0x4789('0x8'),'SIP',_0x298902[_0x4789('0x9')]);if(_0x4e2393[_0x4789('0xa')]&&_0x4e2393[_0x4789('0xa')][_0x5a45ae]&&_0x4e2393['timers'][_0x5a45ae][_0x4789('0xb')]){_0x4e2393['timers'][_0x5a45ae][_0x4789('0xc')]();}if(_0x4e2393[_0x4789('0xd')][_0x5a45ae]){_0x4e2393[_0x4789('0xd')][_0x5a45ae]['updateStatusRealtime']({'statePause':_0x298902['pause']?!![]:![]});}_0x13b7f6({'code':0xc8,'message':_0x4789('0xe')});});},'Reload':function(_0x4a1b86){var _0xf73460=this;return new Promise(function(_0x58743a,_0x25a4a9){if(ami[_0x4789('0xf')]()==![]){return _0x25a4a9(_0xf73460['error'](0x1f4,[config[_0x4789('0x10')]['ip'],config['asterisk'][_0x4789('0x11')],_0x4789('0x12')][_0x4789('0x13')]('\x20')));}_0x4a1b86=_['pick'](_0x4a1b86,_[_0x4789('0x14')](properties[_0x4789('0x15')]));_0x4a1b86['action']=_0x4789('0x16');return ami['Action'](_0x4a1b86)[_0x4789('0x17')](function(_0xb11831){_0x58743a({'code':0xc8,'message':_0xb11831['message']});})[_0x4789('0x18')](function(_0x5af7b3){_0x25a4a9(_0xf73460[_0x4789('0x19')](0x1f5,_0x5af7b3['message']));});});},'Command':function(_0x19dc59){var _0x3fc0e6=this;return new Promise(function(_0x56e9c1,_0x9034c9){if(ami[_0x4789('0xf')]()==![]){return _0x9034c9(_0x3fc0e6[_0x4789('0x19')](0x1f4,[config[_0x4789('0x10')]['ip'],config[_0x4789('0x10')][_0x4789('0x11')],_0x4789('0x12')][_0x4789('0x13')]('\x20')));}_0x19dc59=_[_0x4789('0x1a')](_0x19dc59,_0x4789('0x1b'));_0x19dc59[_0x4789('0x1c')]=_0x4789('0x1d');return ami['Action'](_0x19dc59)[_0x4789('0x17')](function(_0x7d003b){_0x56e9c1({'code':0xc8,'message':_0x7d003b['content']});})[_0x4789('0x18')](function(_0x26884c){_0x9034c9(_0x3fc0e6['error'](0x1f5,_0x26884c[_0x4789('0x1e')]));});});},'VoiceQueues':function(){return new Promise(function(_0x1ca6ca){var _0x54d9c1=[];for(var _0xd8601e in _0x4e2393['voiceQueues']){if(_0x4e2393[_0x4789('0x1f')][_0x4789('0x20')](_0xd8601e)){var _0x307b90=_0x4e2393[_0x4789('0x1f')][_0xd8601e];var _0x435016={'id':_0x307b90['id'],'name':_0x307b90[_0x4789('0x9')],'strategy':_0x307b90[_0x4789('0x21')],'answered':_0x307b90[_0x4789('0x22')],'available':_0x307b90[_0x4789('0x23')],'loggedIn':_0x307b90[_0x4789('0x24')],'pTalking':_0x307b90[_0x4789('0x25')],'sumBillable':_0x307b90[_0x4789('0x26')],'sumDuration':_0x307b90[_0x4789('0x27')],'sumHoldTime':_0x307b90[_0x4789('0x28')]||0x0,'talking':_0x307b90[_0x4789('0x29')],'total':_0x307b90[_0x4789('0x2a')],'type':_0x307b90[_0x4789('0x2b')],'unmanaged':_0x307b90[_0x4789('0x2c')],'abandoned':_0x307b90['abandoned'],'waiting':_0x307b90['waiting'],'loggedInDb':_0x307b90[_0x4789('0x2d')]};if(_0x307b90['type']==='outbound'){_0x435016['dialActive']=_0x307b90[_0x4789('0x2e')];_0x435016[_0x4789('0x2f')]=_0x307b90[_0x4789('0x2f')];_0x435016[_0x4789('0x30')]=_0x307b90[_0x4789('0x30')];_0x435016[_0x4789('0x31')]=_0x307b90[_0x4789('0x31')];_0x435016[_0x4789('0x32')]=_0x307b90[_0x4789('0x32')];_0x435016['dialPrefix']=_0x307b90[_0x4789('0x33')];_0x435016[_0x4789('0x34')]=_0x307b90[_0x4789('0x34')];_0x435016[_0x4789('0x35')]=_0x307b90[_0x4789('0x35')];_0x435016[_0x4789('0x36')]=_0x307b90[_0x4789('0x36')];_0x435016[_0x4789('0x37')]=_0x307b90[_0x4789('0x37')];_0x435016[_0x4789('0x38')]=_0x307b90[_0x4789('0x38')];_0x435016[_0x4789('0x39')]=_0x307b90[_0x4789('0x39')];_0x435016[_0x4789('0x3a')]=_0x307b90[_0x4789('0x3a')];_0x435016['outboundDropCallsDayCallersExit']=_0x307b90[_0x4789('0x3b')];_0x435016[_0x4789('0x3c')]=_0x307b90[_0x4789('0x3c')];_0x435016[_0x4789('0x3d')]=_0x307b90[_0x4789('0x3d')];_0x435016[_0x4789('0x3e')]=_0x307b90[_0x4789('0x3e')];_0x435016['outboundOriginateFailureCallsDay']=_0x307b90[_0x4789('0x3f')];_0x435016[_0x4789('0x40')]=_0x307b90['outboundReCallsDay'];_0x435016['outboundRejectCallsDay']=_0x307b90[_0x4789('0x41')];_0x435016[_0x4789('0x42')]=_0x307b90[_0x4789('0x42')];_0x435016[_0x4789('0x43')]=_0x307b90[_0x4789('0x43')];_0x435016[_0x4789('0x44')]=_0x307b90[_0x4789('0x44')];_0x435016['predictiveIntervalAvgTalktime']=_0x307b90['predictiveIntervalAvgTalktime'];_0x435016['predictiveIntervalDroppedCallsCallersExit']=_0x307b90[_0x4789('0x45')];_0x435016[_0x4789('0x46')]=_0x307b90[_0x4789('0x46')];_0x435016[_0x4789('0x47')]=_0x307b90[_0x4789('0x47')];_0x435016[_0x4789('0x48')]=_0x307b90[_0x4789('0x48')];_0x435016['predictiveIntervalHitRate']=_0x307b90[_0x4789('0x49')];_0x435016[_0x4789('0x4a')]=_0x307b90[_0x4789('0x4a')];_0x435016['predictiveIntervalPauses']=_0x307b90[_0x4789('0x4b')];_0x435016[_0x4789('0x4c')]=_0x307b90[_0x4789('0x4c')];_0x435016[_0x4789('0x4d')]=_0x307b90[_0x4789('0x4d')];_0x435016['message']=_0x307b90[_0x4789('0x1e')];_0x435016['originated']=_0x307b90[_0x4789('0x4e')];_0x435016[_0x4789('0x4f')]=_0x307b90[_0x4789('0x4f')];_0x435016[_0x4789('0x50')]=_0x307b90[_0x4789('0x50')];_0x435016['erlangAbandonmentRate']=_0x307b90[_0x4789('0x51')];_0x435016['erlangBusyFactor']=_0x307b90[_0x4789('0x52')];_0x435016[_0x4789('0x53')]=_0x307b90['startPredictive'];_0x435016[_0x4789('0x54')]=_0x307b90['startProgressive'];}if(_0x307b90[_0x4789('0x55')]){_0x435016[_0x4789('0x55')]={'id':_0x307b90[_0x4789('0x55')]['id'],'name':_0x307b90[_0x4789('0x55')]['name'],'active':_0x307b90[_0x4789('0x55')][_0x4789('0x56')],'callerid':_0x307b90['Trunk'][_0x4789('0x57')]};}if(_0x307b90[_0x4789('0x58')]){_0x435016[_0x4789('0x58')]={'id':_0x307b90['Interval']['id'],'name':_0x307b90['Interval'][_0x4789('0x9')]};}_0x54d9c1['push'](_0x435016);}}_0x1ca6ca({'count':_0x54d9c1[_0x4789('0x59')],'rows':_0x54d9c1});});},'UpdateVoiceQueue':function(_0x577af3){return new Promise(function(_0x861bcb,_0x91e8d){var _0x147d09=_[_0x4789('0x5a')](_0x4e2393[_0x4789('0x1f')],{'id':parseInt(_0x577af3['id'])});var _0x4081bb=_[_0x4789('0x5b')](_0x577af3,['id']);if(_0x147d09){for(var _0x58782e in _0x4081bb){if(typeof _0x4081bb[_0x58782e]!==_0x4789('0x5c')&&typeof _0x147d09[_0x58782e]!==_0x4789('0x5c')){_0x147d09[_0x58782e]=_0x4081bb[_0x58782e];}}_0x861bcb(_0x147d09);}else{_0x91e8d();}});},'VoiceChannels':function(){return new Promise(function(_0x1d33d8){var _0x1c8117=_[_0x4789('0x5d')](_0x4e2393[_0x4789('0x5e')]);_0x1d33d8({'count':_0x1c8117[_0x4789('0x59')],'rows':_0x1c8117});});},'VoiceChannelMixMonitor':function(_0x1eacb3){var _0x385b1f=this;return new Promise(function(_0xcf3dd5,_0x49dbd7){if(ami[_0x4789('0xf')]()==![]){return _0x49dbd7(_0x385b1f[_0x4789('0x19')](0x1f4,[config['asterisk']['ip'],config[_0x4789('0x10')][_0x4789('0x11')],_0x4789('0x12')][_0x4789('0x13')]('\x20')));}var _0x3b09de=schema(properties['voicechannel'])[_0x4789('0x3')](_0x1eacb3);if(_0x3b09de[_0x4789('0x59')]>0x0){return _0x49dbd7(_0x385b1f[_0x4789('0x19')](0x1f4,_[_0x4789('0x5f')](_0x3b09de,_0x4789('0x1e'))[_0x4789('0x13')](',\x20')));}var _0x2ae91d=_[_0x4789('0x5a')](_0x4e2393[_0x4789('0x5e')],{'uniqueid':_0x1eacb3[_0x4789('0x60')]});if(_0x2ae91d&&_0x2ae91d[_0x4789('0x61')]){var _0x516128=util[_0x4789('0x62')](_0x4789('0x63'),_0x1eacb3[_0x4789('0x64')]||_0x1eacb3[_0x4789('0x60')],_0x1eacb3[_0x4789('0x62')]||'wav');return ami[_0x4789('0x65')]({'action':'MixMonitor','channel':_0x2ae91d['channel'],'file':_0x516128,'options':_0x4789('0x66')})[_0x4789('0x17')](function(_0x2df7b1){var _0x38c96d=_[_0x4789('0x5a')](_0x2ae91d[_0x4789('0x67')],{'filename':_0x4789('0x68')+_0x516128[_0x4789('0x69')]()});if(_['isNil'](_0x38c96d)){_0x2ae91d[_0x4789('0x67')]['push']({'filename':'/var/spool/asterisk/monitor/'+_0x516128[_0x4789('0x69')](),'createdAt':moment()['format'](_0x4789('0x6a')),'mixmonitorid':_0x2df7b1[_0x4789('0x6b')],'status':_0x4789('0x6c')});}else{_0x38c96d['mixmonitorid']=_0x2df7b1[_0x4789('0x6b')];_0x38c96d['status']=_0x4789('0x6c');}_0xcf3dd5({'code':0xc8,'message':[_0x1eacb3['uniqueid'],_0x4789('0x6d'),_0x2df7b1[_0x4789('0x6b')]][_0x4789('0x13')]('\x20'),'mixmonitorid':_0x2df7b1[_0x4789('0x6b')]});})[_0x4789('0x18')](function(_0x62453c){_0x49dbd7(_0x385b1f[_0x4789('0x19')](0x1f5,[_0x1eacb3[_0x4789('0x60')],_0x62453c[_0x4789('0x1e')]['toLowerCase']()][_0x4789('0x13')]('\x20')));});}else{return _0x49dbd7(_0x385b1f['error'](0x1f5,_0x4789('0x6e')));}});},'VoiceChannelStopMixMonitor':function(_0xa04ff5){var _0x47e4b1=this;return new Promise(function(_0x3dc751,_0x1f247c){if(ami[_0x4789('0xf')]()==![]){return _0x1f247c(_0x47e4b1[_0x4789('0x19')](0x1f4,[config[_0x4789('0x10')]['ip'],config[_0x4789('0x10')][_0x4789('0x11')],_0x4789('0x12')][_0x4789('0x13')]('\x20')));}var _0xb8e547=schema(properties[_0x4789('0x6f')])[_0x4789('0x3')](_0xa04ff5);if(_0xb8e547['length']>0x0){return _0x1f247c(_0x47e4b1['error'](0x1f4,_[_0x4789('0x5f')](_0xb8e547,'message')[_0x4789('0x13')](',\x20')));}var _0x34c398=_[_0x4789('0x5a')](_0x4e2393[_0x4789('0x5e')],{'uniqueid':_0xa04ff5[_0x4789('0x60')]});if(_0x34c398){return Promise[_0x4789('0x70')]()[_0x4789('0x17')](function(){if(_0x34c398[_0x4789('0x61')]){return ami['Action']({'action':_0x4789('0x71'),'channel':_0x34c398[_0x4789('0x61')],'mixmonitorid':_0xa04ff5['mixmonitorid']})[_0x4789('0x18')](function(){});}})[_0x4789('0x17')](function(){if(_0x34c398[_0x4789('0x72')]){return ami[_0x4789('0x65')]({'action':_0x4789('0x71'),'channel':_0x34c398[_0x4789('0x72')],'mixmonitorid':_0xa04ff5['mixmonitorid']})['catch'](function(){});}})[_0x4789('0x17')](function(){var _0x277b61=_[_0x4789('0x5a')](_0x34c398[_0x4789('0x67')],{'mixmonitorid':_0xa04ff5[_0x4789('0x6b')]});if(_0x277b61){_0x277b61[_0x4789('0x73')]=_0x4789('0x74');}})[_0x4789('0x17')](function(){var _0x1c5f9a=util[_0x4789('0x62')]('%s.%s',_0xa04ff5[_0x4789('0x64')]||_0xa04ff5[_0x4789('0x60')],_0xa04ff5[_0x4789('0x62')]||'wav');var _0x40d6a6=_[_0x4789('0x5a')](_0x34c398['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x1c5f9a['toLowerCase']()});if(_0x40d6a6){_0x40d6a6[_0x4789('0x73')]='stop';}})[_0x4789('0x17')](function(){_0x3dc751({'code':0xc8,'message':[_0xa04ff5[_0x4789('0x60')],_0x4789('0x75')]['join']('\x20')});})[_0x4789('0x18')](function(_0x3b00f2){_0x1f247c(_0x47e4b1['error'](0x1f5,[_0xa04ff5['uniqueid'],_0x3b00f2[_0x4789('0x1e')][_0x4789('0x69')]()]['join']('\x20')));});}else{return _0x1f247c(_0x47e4b1[_0x4789('0x19')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x3457c1){var _0x215011=_[_0x4789('0x5d')](_0x4e2393[_0x4789('0x76')]);_0x3457c1({'count':_0x215011['length'],'rows':_0x215011});});},'VoiceQueuesChannel':function(_0x16e7f8){var _0x4602b2=this;return new Promise(function(_0x327003,_0x9d5a36){var _0x538855=schema(properties[_0x4789('0x77')])[_0x4789('0x3')](_0x16e7f8);if(_0x538855[_0x4789('0x59')]>0x0){return _0x9d5a36(_0x4602b2[_0x4789('0x19')](0x1f4,_[_0x4789('0x5f')](_0x538855,_0x4789('0x1e'))[_0x4789('0x13')](',\x20')));}var _0x392387=_[_0x4789('0x5a')](_0x4e2393[_0x4789('0x76')],{'uniqueid':_0x16e7f8[_0x4789('0x60')]});if(_0x392387){_0x327003(_0x392387);}else{return _0x9d5a36(_0x4602b2['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x49921a){var _0x5191bf=this;return new Promise(function(_0x2a2a13,_0x524bc3){if(ami[_0x4789('0xf')]()==![]){return _0x524bc3(_0x5191bf[_0x4789('0x19')](0x1f4,[config[_0x4789('0x10')]['ip'],config[_0x4789('0x10')][_0x4789('0x11')],_0x4789('0x12')]['join']('\x20')));}var _0x3736ef=schema(properties[_0x4789('0x78')])[_0x4789('0x3')](_0x49921a);if(_0x3736ef[_0x4789('0x59')]>0x0){return _0x524bc3(_0x5191bf['error'](0x1f4,_['map'](_0x3736ef,'message')[_0x4789('0x13')](',\x20')));}var _0xdf9cba=_[_0x4789('0x5a')](_0x4e2393[_0x4789('0x76')],{'uniqueid':_0x49921a[_0x4789('0x60')]});if(_0xdf9cba&&_0xdf9cba[_0x4789('0x61')]){return ami[_0x4789('0x65')]({'action':_0x4789('0x79'),'channel':_0xdf9cba['channel']})[_0x4789('0x17')](function(_0x32cb0c){_0x2a2a13({'code':0xc8,'message':[_0x49921a[_0x4789('0x60')],_0x32cb0c[_0x4789('0x1e')][_0x4789('0x69')]()][_0x4789('0x13')]('\x20')});})[_0x4789('0x18')](function(_0x1ebf51){_0x524bc3(_0x5191bf[_0x4789('0x19')](0x1f5,[_0x49921a[_0x4789('0x60')],_0x1ebf51[_0x4789('0x1e')][_0x4789('0x69')]()][_0x4789('0x13')]('\x20')));});}else{return _0x524bc3(_0x5191bf['error'](0x1f5,_0x4789('0x6e')));}});},'VoiceQueuesChannelRedirect':function(_0x121ca3){var _0xdfc5a1=this;return new Promise(function(_0x3a3d70,_0x29d838){if(ami[_0x4789('0xf')]()==![]){return _0x29d838(_0xdfc5a1[_0x4789('0x19')](0x1f4,[config[_0x4789('0x10')]['ip'],config[_0x4789('0x10')][_0x4789('0x11')],_0x4789('0x12')]['join']('\x20')));}var _0x234088=schema(properties[_0x4789('0x7a')])['validate'](_0x121ca3);if(_0x234088['length']>0x0){return _0x29d838(_0xdfc5a1[_0x4789('0x19')](0x1f4,_[_0x4789('0x5f')](_0x234088,_0x4789('0x1e'))[_0x4789('0x13')](',\x20')));}var _0x4712ee=_['find'](_0x4e2393[_0x4789('0x76')],{'uniqueid':_0x121ca3[_0x4789('0x60')]});if(_0x4712ee&&_0x4712ee[_0x4789('0x61')]){return ami[_0x4789('0x65')]({'action':_0x4789('0x7b'),'channel':_0x4712ee[_0x4789('0x61')],'exten':_0x121ca3['exten'],'context':_0x121ca3['context']||_0x4712ee[_0x4789('0x7c')],'priority':0x1})[_0x4789('0x17')](function(_0x1db288){_0x3a3d70({'code':0xc8,'message':[_0x121ca3[_0x4789('0x60')],_0x1db288[_0x4789('0x1e')]['toLowerCase']()][_0x4789('0x13')]('\x20')});})[_0x4789('0x18')](function(_0x1869c2){_0x29d838(_0xdfc5a1[_0x4789('0x19')](0x1f5,[_0x121ca3[_0x4789('0x60')],_0x1869c2['message'][_0x4789('0x69')]()][_0x4789('0x13')]('\x20')));});}else{return _0x29d838(_0xdfc5a1[_0x4789('0x19')](0x1f5,_0x4789('0x6e')));}});},'Agents':function(_0x196f22){return new Promise(function(_0xf60cbd){var _0x37a3fc=_[_0x4789('0x5d')](_0x4e2393[_0x4789('0xd')]);if(_0x196f22&&_0x196f22['id']){var _0x53f9b0=_[_0x4789('0x5a')](_0x37a3fc,function(_0x1d4a0c){return _0x1d4a0c['id']===_0x196f22['id'];});_0xf60cbd(_0x53f9b0);}else{_0xf60cbd({'count':_0x37a3fc['length'],'rows':_0x37a3fc});}});},'Telephones':function(){return new Promise(function(_0x1cd80e){var _0x406902=_[_0x4789('0x5d')](_0x4e2393[_0x4789('0x7d')]);_0x1cd80e({'count':_0x406902[_0x4789('0x59')],'rows':_0x406902});});},'Trunks':function(){return new Promise(function(_0x4f89d4){var _0x2c6faf=_['values'](_0x4e2393['trunks']);_0x4f89d4({'count':_0x2c6faf['length'],'rows':_0x2c6faf});});},'OutboundChannels':function(){return new Promise(function(_0x1ba419){var _0x1dbaaf=_[_0x4789('0x5d')](_0x4e2393[_0x4789('0x7e')]);_0x1ba419({'count':_0x1dbaaf[_0x4789('0x59')],'rows':_0x1dbaaf});});},'Outbound':function(){return new Promise(function(_0x24a7ed){_0x24a7ed(_0x4e2393[_0x4789('0x7f')]);});},'Campaigns':function(){return new Promise(function(_0x42efd1){var _0x32b26f=_[_0x4789('0x5d')](_0x4e2393[_0x4789('0x80')]);_0x42efd1({'count':_0x32b26f[_0x4789('0x59')],'rows':_0x32b26f});});},'VoiceQueuesPreview':function(_0x3af7fc){var _0x3bf144=this;return new Promise(function(_0x4522e7,_0x525cea){_0x3394f6[_0x4789('0x81')](_0x3af7fc['id'])[_0x4789('0x17')](function(_0x3b62a2){_0x4522e7({'code':0xc8,'message':_0x3b62a2[_0x4789('0x1e')]});})[_0x4789('0x18')](function(_0x444aab){_0x525cea(_0x3bf144[_0x4789('0x19')](0x1f4,_0x444aab[_0x4789('0x1e')]));});});},'EventManager':function(_0x373247){var _0x35ddee=this;return new Promise(function(_0x24b13d,_0x360d78){if(!_0x373247[_0x4789('0x82')]){return _0x360d78(_0x35ddee[_0x4789('0x19')](0x1f4,_0x4789('0x83')));}ami[_0x4789('0x84')](_0x4789('0x85')+_0x373247[_0x4789('0x82')],_0x373247[_0x4789('0x1e')]);_0x24b13d({'code':0xc8,'message':_0x373247});});},'FaxAccounts':function(){return new Promise(function(_0x3f5e17){var _0x292204=_[_0x4789('0x5d')](_0x4e2393[_0x4789('0x86')]);_0x3f5e17({'count':_0x292204[_0x4789('0x59')],'rows':_0x292204});});},'SendFax':function(_0x3b8881){var _0x4b33a6=this;return new Promise(function(_0x320109,_0x12e47d){_0x4bfe85['send'](_0x3b8881)[_0x4789('0x17')](function(_0x5c5e33){_0x320109({'code':0xc8,'message':_0x5c5e33[_0x4789('0x1e')]});})[_0x4789('0x18')](function(_0x2bd683){_0x12e47d(_0x4b33a6['error'](0x1f4,_0x2bd683['message']));});});},'CheckAfterSend':function(_0x1c6f58){var _0x4595bb=this;return new Promise(function(_0x254a4f,_0x53427e){_0x4bfe85[_0x4789('0x87')](_0x1c6f58)[_0x4789('0x17')](function(_0x272ff9){_0x254a4f({'code':0xc8,'message':_0x272ff9['message']});})[_0x4789('0x18')](function(_0xd97ea5){_0x53427e(_0x4595bb[_0x4789('0x19')](0x1f4,_0xd97ea5[_0x4789('0x1e')]));});});}};var _0x3cdd30=jayson[_0x4789('0x88')](_0x114a90)[_0x4789('0x89')]();_0x3cdd30['on'](_0x4789('0x19'),function(_0x4a3b39){return _0x12ef33(_0x4a3b39);});_0x3cdd30[_0x4789('0x7')](0x232a,_0x4789('0x8a'),function(){console[_0x4789('0x8b')](_0x4789('0x8c'),0x232a);return _0x1b4e02('RPC\x20listening\x20on\x20port:'+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 b2b4047..419ddc8 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 _0x48cb=['length','[CM][%s][%s]\x20Contact\x20found:%s','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]\x20Autocreate\x20disabled','format','user:%s','trigger:%s','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','fax','createdAt','scheduledAt','union','resolve','then','getContacts','isEmpty'];(function(_0x1d531c,_0x5c2219){var _0x5c6031=function(_0x16fce5){while(--_0x16fce5){_0x1d531c['push'](_0x1d531c['shift']());}};_0x5c6031(++_0x5c2219);}(_0x48cb,0x16f));var _0xb48c=function(_0x40ef88,_0x53d80b){_0x40ef88=_0x40ef88-0x0;var _0x703fdb=_0x48cb[_0x40ef88];return _0x703fdb;};'use strict';var _=require(_0xb48c('0x0'));var BPromise=require(_0xb48c('0x1'));var Redis=require(_0xb48c('0x2'));var util=require(_0xb48c('0x3'));var config=require('../../../../config/environment');var logger=require(_0xb48c('0x4'))(_0xb48c('0x5'));var cmContactRpc=require(_0xb48c('0x6'));config[_0xb48c('0x7')]=_[_0xb48c('0x8')](config[_0xb48c('0x7')],{'host':_0xb48c('0x9'),'port':0x18eb});var io=require(_0xb48c('0xa'))(new Redis(config['redis']));function emit(_0x51cec9,_0x38bb80,_0x6f840e,_0x346c74,_0x5155b0){logger[_0xb48c('0xb')](_0xb48c('0xc'),_0x51cec9,_0x38bb80['id'],_0x6f840e,_0x346c74,JSON[_0xb48c('0xd')](_0x5155b0));io['to'](_0x6f840e)['emit'](_0x346c74,_0x5155b0);}exports[_0xb48c('0xe')]=function(_0x589ebd,_0x1460a7,_0x70bad4,_0x5c3bc3){var _0x176ee2,_0x5e62e6;var _0x45c8e4={};var _0x57e80b;var _0x545810=Number(_0x70bad4[_0xb48c('0xf')]);var _0x7a0687=_0x70bad4[_0xb48c('0x10')]?Boolean(Number(_0x70bad4[_0xb48c('0x10')])):![];var _0xad56bb;var _0x32732f=![];if(!_[_0xb48c('0x11')](_0x70bad4['data5'])){if(_0x70bad4[_0xb48c('0x12')]=='1')_0x32732f=!![];}if(!_0x32732f){if(_0x5c3bc3[_0xb48c('0x13')]){_0x45c8e4['id']=_0x5c3bc3[_0xb48c('0x13')];}}if(!_0x45c8e4['id']){_0x45c8e4[_0xb48c('0x14')]=_0x545810;_0xad56bb=_0x70bad4[_0xb48c('0x15')]&&_0x70bad4['data3']!=='0'?_0x70bad4[_0xb48c('0x15')][_0xb48c('0x16')](','):[_0xb48c('0x17')];_0x45c8e4[_0xb48c('0x18')]=_[_0xb48c('0x19')](_0xad56bb,function(_0x1f6e52){var _0x3d49d0={};_0x3d49d0[_0x1f6e52]=_0x5c3bc3[_0xb48c('0x1a')]?_0x5c3bc3[_0xb48c('0x1b')]:_0x5c3bc3[_0xb48c('0x1c')];return _0x3d49d0;});_0x57e80b=_0x5c3bc3[_0xb48c('0x1a')]?_0x5c3bc3[_0xb48c('0x1b')]:_0x5c3bc3['calleridnum'];}var _0x48de36=['id',_0xb48c('0x1d'),_0xb48c('0x1e'),_0xb48c('0x17'),'mobile',_0xb48c('0x1f'),'ListId',_0xb48c('0x20'),_0xb48c('0x21'),'updatedAt'];var _0x3d0fcf=_[_0xb48c('0x22')](_0x48de36,_0xad56bb);BPromise[_0xb48c('0x23')]()[_0xb48c('0x24')](cmContactRpc[_0xb48c('0x25')]({'attributes':_0x3d0fcf,'where':_0x45c8e4,'phone':_0x57e80b}))['then'](function(_0x2d224c){_0x5e62e6=_0x2d224c;if(!_[_0xb48c('0x26')](_0x5e62e6)){if(_0x5e62e6[_0xb48c('0x27')]===0x1){_0x176ee2=_0x5e62e6[0x0];logger[_0xb48c('0xb')](_0xb48c('0x28'),_0x5c3bc3[_0xb48c('0x29')],_0x1460a7['id'],_0x176ee2['id']);}else{logger[_0xb48c('0xb')](_0xb48c('0x2a'),_0x5c3bc3[_0xb48c('0x29')],_0x1460a7['id'],_[_0xb48c('0x19')](_0x5e62e6,'id')['join'](','));}return;}else{logger[_0xb48c('0xb')](_0xb48c('0x2b'),_0x5c3bc3[_0xb48c('0x29')],_0x1460a7['id']);var _0x3153ce={'ListId':_0x545810};var _0x5c3f8f=_0x70bad4[_0xb48c('0x2c')]&&_0x70bad4[_0xb48c('0x2c')]!=='0'?_0x70bad4[_0xb48c('0x2c')]:'phone';if(_0x7a0687){logger['info'](_0xb48c('0x2d'),_0x5c3bc3[_0xb48c('0x29')],_0x1460a7['id']);_0x3153ce[_0x5c3f8f]=_[_0xb48c('0x11')](_0x5c3bc3[_0xb48c('0x1a')])?_0x5c3bc3[_0xb48c('0x1c')]:_0x5c3bc3['destcalleridnum'];if(_[_0xb48c('0x11')](_0x5c3bc3[_0xb48c('0x1a')])){_0x3153ce['firstName']=_0x5c3bc3['calleridname']&&_0x5c3bc3[_0xb48c('0x2e')]!==_0xb48c('0x2f')?_0x5c3bc3[_0xb48c('0x2e')]:_0xb48c('0x30');}else{_0x3153ce['firstName']=_0x5c3bc3[_0xb48c('0x31')]&&_0x5c3bc3[_0xb48c('0x31')]!==_0xb48c('0x2f')?_0x5c3bc3[_0xb48c('0x31')]:_0xb48c('0x30');}return BPromise[_0xb48c('0x23')]()[_0xb48c('0x24')](cmContactRpc[_0xb48c('0x32')](_0x3153ce))[_0xb48c('0x24')](function(_0x40167f){_0x176ee2=_0x40167f;_0x5e62e6[_0xb48c('0x33')](_0x40167f);if(_0x176ee2){logger['info']('[CM][%s][%s]\x20Contact\x20created:%s',_0x5c3bc3['uniqueid'],_0x1460a7['id'],_0x176ee2['id']);}return;});}else{logger[_0xb48c('0xb')](_0xb48c('0x34'),_0x5c3bc3[_0xb48c('0x29')],_0x1460a7['id']);_0x3153ce[_0x5c3f8f]=_[_0xb48c('0x11')](_0x5c3bc3[_0xb48c('0x1a')])?_0x5c3bc3['calleridnum']:_0x5c3bc3['destcalleridnum'];if(_[_0xb48c('0x11')](_0x5c3bc3[_0xb48c('0x1a')])){_0x3153ce[_0xb48c('0x1d')]=_0x5c3bc3['calleridname']&&_0x5c3bc3[_0xb48c('0x2e')]!==_0xb48c('0x2f')?_0x5c3bc3[_0xb48c('0x2e')]:_0xb48c('0x30');}else{_0x3153ce[_0xb48c('0x1d')]=_0x5c3bc3[_0xb48c('0x31')]&&_0x5c3bc3[_0xb48c('0x31')]!==_0xb48c('0x2f')?_0x5c3bc3[_0xb48c('0x31')]:'Unknown';}_0x176ee2=_0x3153ce;_0x5e62e6['push'](_0x3153ce);return;}}})[_0xb48c('0x24')](function(){if(_0x589ebd){emit(_0x5c3bc3[_0xb48c('0x29')],_0x1460a7,util[_0xb48c('0x35')](_0xb48c('0x36'),_0x589ebd['name']),util['format'](_0xb48c('0x37'),_0x70bad4['action'][_0xb48c('0x38')]()),{'evt':_[_0xb48c('0x39')](_0x5c3bc3,{'autoCreate':_0x7a0687}),'contact':_0x176ee2===undefined?{}:_0x176ee2,'contacts':_0x5e62e6[_0xb48c('0x27')]===0x0?undefined:_0x5e62e6});}});}; \ No newline at end of file +var _0x207c=['union','resolve','then','getContacts','isEmpty','length','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','firstName','calleridname','','destcalleridname','Unknown','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','name','format','action','merge','lodash','bluebird','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','info','[CM][%s][%s]','emit','data2','isNil','data5','xmd-contactid','ListId','data3','phone','$or','map','routeId','destcalleridnum','calleridnum','lastName','mobile','fax','scheduledAt','updatedAt'];(function(_0x4a23a9,_0x17a2c0){var _0x18c27f=function(_0x3414e3){while(--_0x3414e3){_0x4a23a9['push'](_0x4a23a9['shift']());}};_0x18c27f(++_0x17a2c0);}(_0x207c,0x127));var _0xc207=function(_0x18a313,_0x54020e){_0x18a313=_0x18a313-0x0;var _0x44ac80=_0x207c[_0x18a313];return _0x44ac80;};'use strict';var _=require(_0xc207('0x0'));var BPromise=require(_0xc207('0x1'));var Redis=require('ioredis');var util=require(_0xc207('0x2'));var config=require(_0xc207('0x3'));var logger=require(_0xc207('0x4'))(_0xc207('0x5'));var cmContactRpc=require(_0xc207('0x6'));config[_0xc207('0x7')]=_['defaults'](config[_0xc207('0x7')],{'host':_0xc207('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x541caf,_0x510a00,_0x16f0a4,_0x2a4911,_0x137a91){logger[_0xc207('0x9')](_0xc207('0xa'),_0x541caf,_0x510a00['id'],_0x16f0a4,_0x2a4911,JSON['stringify'](_0x137a91));io['to'](_0x16f0a4)[_0xc207('0xb')](_0x2a4911,_0x137a91);}exports['exec']=function(_0x61b755,_0x4f8ac9,_0x25f8be,_0x52e877){var _0x4fee8c,_0x492717;var _0x10625d={};var _0x184d57;var _0x2f0e1e=Number(_0x25f8be['data1']);var _0x3a24cc=_0x25f8be[_0xc207('0xc')]?Boolean(Number(_0x25f8be['data2'])):![];var _0x576656;var _0x5c8093=![];if(!_[_0xc207('0xd')](_0x25f8be[_0xc207('0xe')])){if(_0x25f8be[_0xc207('0xe')]=='1')_0x5c8093=!![];}if(!_0x5c8093){if(_0x52e877[_0xc207('0xf')]){_0x10625d['id']=_0x52e877[_0xc207('0xf')];}}if(!_0x10625d['id']){_0x10625d[_0xc207('0x10')]=_0x2f0e1e;_0x576656=_0x25f8be[_0xc207('0x11')]&&_0x25f8be[_0xc207('0x11')]!=='0'?_0x25f8be[_0xc207('0x11')]['split'](','):[_0xc207('0x12')];_0x10625d[_0xc207('0x13')]=_[_0xc207('0x14')](_0x576656,function(_0x3cdb3b){var _0xca10d={};_0xca10d[_0x3cdb3b]=_0x52e877[_0xc207('0x15')]?_0x52e877[_0xc207('0x16')]:_0x52e877[_0xc207('0x17')];return _0xca10d;});_0x184d57=_0x52e877[_0xc207('0x15')]?_0x52e877[_0xc207('0x16')]:_0x52e877[_0xc207('0x17')];}var _0x5b5f44=['id','firstName',_0xc207('0x18'),_0xc207('0x12'),_0xc207('0x19'),_0xc207('0x1a'),'ListId','createdAt',_0xc207('0x1b'),_0xc207('0x1c')];var _0x27779b=_[_0xc207('0x1d')](_0x5b5f44,_0x576656);BPromise[_0xc207('0x1e')]()[_0xc207('0x1f')](cmContactRpc[_0xc207('0x20')]({'attributes':_0x27779b,'where':_0x10625d,'phone':_0x184d57}))[_0xc207('0x1f')](function(_0x5d094d){_0x492717=_0x5d094d;if(!_[_0xc207('0x21')](_0x492717)){if(_0x492717[_0xc207('0x22')]===0x1){_0x4fee8c=_0x492717[0x0];logger[_0xc207('0x9')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x52e877[_0xc207('0x23')],_0x4f8ac9['id'],_0x4fee8c['id']);}else{logger[_0xc207('0x9')](_0xc207('0x24'),_0x52e877[_0xc207('0x23')],_0x4f8ac9['id'],_[_0xc207('0x14')](_0x492717,'id')[_0xc207('0x25')](','));}return;}else{logger[_0xc207('0x9')](_0xc207('0x26'),_0x52e877['uniqueid'],_0x4f8ac9['id']);var _0x58ceaf={'ListId':_0x2f0e1e};var _0x1e1ee1=_0x25f8be[_0xc207('0x27')]&&_0x25f8be[_0xc207('0x27')]!=='0'?_0x25f8be[_0xc207('0x27')]:_0xc207('0x12');if(_0x3a24cc){logger[_0xc207('0x9')](_0xc207('0x28'),_0x52e877[_0xc207('0x23')],_0x4f8ac9['id']);_0x58ceaf[_0x1e1ee1]=_[_0xc207('0xd')](_0x52e877[_0xc207('0x15')])?_0x52e877['calleridnum']:_0x52e877[_0xc207('0x16')];if(_[_0xc207('0xd')](_0x52e877[_0xc207('0x15')])){_0x58ceaf[_0xc207('0x29')]=_0x52e877[_0xc207('0x2a')]&&_0x52e877[_0xc207('0x2a')]!==_0xc207('0x2b')?_0x52e877[_0xc207('0x2a')]:'Unknown';}else{_0x58ceaf[_0xc207('0x29')]=_0x52e877[_0xc207('0x2c')]&&_0x52e877['destcalleridname']!==_0xc207('0x2b')?_0x52e877['destcalleridname']:_0xc207('0x2d');}return BPromise[_0xc207('0x1e')]()[_0xc207('0x1f')](cmContactRpc[_0xc207('0x2e')](_0x58ceaf))[_0xc207('0x1f')](function(_0x13729f){_0x4fee8c=_0x13729f;_0x492717[_0xc207('0x2f')](_0x13729f);if(_0x4fee8c){logger[_0xc207('0x9')](_0xc207('0x30'),_0x52e877['uniqueid'],_0x4f8ac9['id'],_0x4fee8c['id']);}return;});}else{logger[_0xc207('0x9')](_0xc207('0x31'),_0x52e877[_0xc207('0x23')],_0x4f8ac9['id']);_0x58ceaf[_0x1e1ee1]=_[_0xc207('0xd')](_0x52e877[_0xc207('0x15')])?_0x52e877[_0xc207('0x17')]:_0x52e877[_0xc207('0x16')];if(_[_0xc207('0xd')](_0x52e877[_0xc207('0x15')])){_0x58ceaf[_0xc207('0x29')]=_0x52e877[_0xc207('0x2a')]&&_0x52e877[_0xc207('0x2a')]!==_0xc207('0x2b')?_0x52e877[_0xc207('0x2a')]:_0xc207('0x2d');}else{_0x58ceaf['firstName']=_0x52e877['destcalleridname']&&_0x52e877[_0xc207('0x2c')]!==_0xc207('0x2b')?_0x52e877['destcalleridname']:_0xc207('0x2d');}_0x4fee8c=_0x58ceaf;_0x492717['push'](_0x58ceaf);return;}}})[_0xc207('0x1f')](function(){if(_0x61b755){emit(_0x52e877[_0xc207('0x23')],_0x4f8ac9,util['format']('user:%s',_0x61b755[_0xc207('0x32')]),util[_0xc207('0x33')]('trigger:%s',_0x25f8be[_0xc207('0x34')]['toLowerCase']()),{'evt':_[_0xc207('0x35')](_0x52e877,{'autoCreate':_0x3a24cc}),'contact':_0x4fee8c===undefined?{}:_0x4fee8c,'contacts':_0x492717[_0xc207('0x22')]===0x0?undefined:_0x492717});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 1b7106c..ff7daf1 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 _0x9c30=['trigger:%s','contactmanager','exec','integration','queue','urlforward','script','buildUri','parse','query','replace','channel','AllConditions','every','checkConditions','some','AnyConditions','field','account','chat','operator','ChatWebsiteId','upperFirst','AccountId','event','value','membername','lastevent','routeId','mailSubstatus','null','substatus','offlineMessage','created','equals','exports','util','url','mustache','ioredis','./urlforward','./cmContact','trigger','../ami','redis','defaults','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:dialend','custom:newinteraction','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','clone','undefined','motionChannel','voice','checkTriggers','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','action','browser','data1','TemplateId','data2','html','render','uri','isNil','data3','data4','location','uriLocation','data5','windowHeight','data6','600','winArguments','format','user:%s','interface','name','trigger:%s:%s','toLowerCase'];(function(_0x983637,_0x3604be){var _0x2bcea8=function(_0x35a6a6){while(--_0x35a6a6){_0x983637['push'](_0x983637['shift']());}};_0x2bcea8(++_0x3604be);}(_0x9c30,0x11a));var _0x09c3=function(_0x37c4fb,_0x529477){_0x37c4fb=_0x37c4fb-0x0;var _0x20dfa0=_0x9c30[_0x37c4fb];return _0x20dfa0;};'use strict';var util=require(_0x09c3('0x0'));var _=require('lodash');var url=require(_0x09c3('0x1'));var Mustache=require(_0x09c3('0x2'));var Redis=require(_0x09c3('0x3'));var urlforward=require(_0x09c3('0x4'));var integration=require('./integration');var cmContact=require(_0x09c3('0x5'));var script=require('./script');var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x09c3('0x6'));var ami=require(_0x09c3('0x7'));config[_0x09c3('0x8')]=_[_0x09c3('0x9')](config[_0x09c3('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x09c3('0x8')]));var operators={'equals':function(_0xddd3ad,_0x4197af){return _0xddd3ad==_0x4197af;},'not_equals':function(_0xcc28d8,_0x48c629){return _0xcc28d8!=_0x48c629;}};var barAndWebActions=[_0x09c3('0xa'),'url',_0x09c3('0xb')];function Trigger(_0x355544){this[_0x09c3('0xc')]=_0x355544['triggers'];this[_0x09c3('0xd')]=_0x355544[_0x09c3('0xd')];this[_0x09c3('0xe')]=_0x355544[_0x09c3('0xe')];this[_0x09c3('0xf')]=_0x355544[_0x09c3('0xf')];this[_0x09c3('0x10')]=_0x355544[_0x09c3('0x10')];this['zendeskAccounts']=_0x355544[_0x09c3('0x11')];this[_0x09c3('0x12')]=_0x355544[_0x09c3('0x12')];this['salesforceAccounts']=_0x355544[_0x09c3('0x13')];this[_0x09c3('0x14')]=_0x355544[_0x09c3('0x14')];this[_0x09c3('0x15')]=_0x355544[_0x09c3('0x15')];this[_0x09c3('0x16')]=_0x355544[_0x09c3('0x16')];this['vtigerAccounts']=_0x355544[_0x09c3('0x17')];this[_0x09c3('0x18')]=_0x355544[_0x09c3('0x18')];this[_0x09c3('0x19')]=_0x355544[_0x09c3('0x19')];this[_0x09c3('0x1a')]=_0x355544[_0x09c3('0x1a')];this[_0x09c3('0x1b')]={'zendesk':this[_0x09c3('0x11')],'salesforce':this[_0x09c3('0x13')],'freshdesk':this[_0x09c3('0x12')],'sugarcrm':this[_0x09c3('0x14')],'zoho':this[_0x09c3('0x15')],'desk':this[_0x09c3('0x16')],'vtiger':this[_0x09c3('0x17')],'dynamics365':this[_0x09c3('0x19')],'freshsales':this[_0x09c3('0x1a')],'servicenow':this[_0x09c3('0x18')]};ami['on'](_0x09c3('0x1c'),this[_0x09c3('0x1d')][_0x09c3('0x1e')](this));ami['on'](_0x09c3('0x1f'),this[_0x09c3('0x1d')][_0x09c3('0x1e')](this));ami['on'](_0x09c3('0x20'),this[_0x09c3('0x1d')][_0x09c3('0x1e')](this));ami['on'](_0x09c3('0x21'),this[_0x09c3('0x1d')][_0x09c3('0x1e')](this));ami['on'](_0x09c3('0x22'),this[_0x09c3('0x1d')][_0x09c3('0x1e')](this));ami['on']('custom:agentnoanswer',this[_0x09c3('0x1d')]['bind'](this));ami['on'](_0x09c3('0x23'),this[_0x09c3('0x1d')][_0x09c3('0x1e')](this));ami['on'](_0x09c3('0x24'),this[_0x09c3('0x1d')][_0x09c3('0x1e')](this));ami['on'](_0x09c3('0x25'),this[_0x09c3('0x1d')][_0x09c3('0x1e')](this));ami['on'](_0x09c3('0x26'),this[_0x09c3('0x1d')][_0x09c3('0x1e')](this));ami['on'](_0x09c3('0x27'),this[_0x09c3('0x1d')]['bind'](this));ami['on']('custom:timeout',this[_0x09c3('0x1d')][_0x09c3('0x1e')](this));ami['on'](_0x09c3('0x28'),this['syncAgentDial']['bind'](this));ami['on'](_0x09c3('0x29'),this[_0x09c3('0x2a')]['bind'](this));ami['on'](_0x09c3('0x2b'),this[_0x09c3('0x2a')][_0x09c3('0x1e')](this));ami['on'](_0x09c3('0x2c'),this['syncCustomEvent'][_0x09c3('0x1e')](this));ami['on']('custom:closedinteraction',this[_0x09c3('0x1d')][_0x09c3('0x1e')](this));ami['on']('custom:substatus',this[_0x09c3('0x1d')][_0x09c3('0x1e')](this));ami['on'](_0x09c3('0x2d'),this[_0x09c3('0x1d')][_0x09c3('0x1e')](this));ami['on']('custom:outgoingmessage',this[_0x09c3('0x1d')][_0x09c3('0x1e')](this));ami['on'](_0x09c3('0x2e'),this[_0x09c3('0x1d')][_0x09c3('0x1e')](this));ami['on'](_0x09c3('0x2f'),this[_0x09c3('0x1d')][_0x09c3('0x1e')](this));ami['on']('custom:offlineMessage',this[_0x09c3('0x1d')][_0x09c3('0x1e')](this));}Trigger[_0x09c3('0x30')][_0x09c3('0x31')]=function(_0x393b73,_0x548455,_0x501afb){logger[_0x09c3('0x32')](_0x393b73,_0x548455,JSON['stringify'](_0x501afb));io['to'](_0x393b73)[_0x09c3('0x31')](_0x548455,_0x501afb);};Trigger[_0x09c3('0x30')][_0x09c3('0x1d')]=function(_0x3c2063){var _0x51fe4e=_[_0x09c3('0x33')](_0x3c2063);if(typeof _0x51fe4e['motionChannel']===_0x09c3('0x34')){_0x51fe4e[_0x09c3('0x35')]=_0x09c3('0x36');}this[_0x09c3('0x37')](_0x51fe4e);};Trigger[_0x09c3('0x30')]['syncAgentDial']=function(_0x2b4e10){if(this[_0x09c3('0xd')][_0x2b4e10['interface']]){this[_0x09c3('0x1d')](_0x2b4e10);}};Trigger['prototype'][_0x09c3('0x37')]=function(_0x124c7f){var _0x228934;for(var _0x4588c0 in this['triggers']){if(this[_0x09c3('0xc')][_0x09c3('0x38')](_0x4588c0)){if(this['triggers'][_0x4588c0][_0x09c3('0x39')]){_0x228934=this[_0x09c3('0x3a')](this[_0x09c3('0xc')][_0x4588c0],_0x124c7f);if(_0x228934){_[_0x09c3('0x3b')](_0x124c7f,_0x124c7f[_0x09c3('0x3c')]);for(var _0x5d268b=0x0,_0x266786,_0x5b626b,_0x24ed27;_0x5d268b0x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});}; \ No newline at end of file +var _0x5fc3=['map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','custom_fields','variable','variableName','idField','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','recordingURL','The\x20User\x20ID\x20is:','destcalleridnum','Ticket\x20created!','[OUTBOUND]','unmanaged','lastevent','Recording\x20is\x20enabled!','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','remoteUri','total_entries','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','%s/users/me','debug','stringify','authType','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1057a3,_0x28d9b7){_0x1057a3=_0x1057a3-0x0;var _0x131cdb=_0x5fc3[_0x1057a3];return _0x131cdb;};'use strict';var _=require(_0x35fc('0x0'));var rp=require(_0x35fc('0x1'));var md5=require('md5');var util=require(_0x35fc('0x2'));var Redis=require(_0x35fc('0x3'));var intUtil=require(_0x35fc('0x4'));var config=require(_0x35fc('0x5'));var logger=require(_0x35fc('0x6'))('desk');config[_0x35fc('0x7')]=_[_0x35fc('0x8')](config[_0x35fc('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x35fc('0x7')]));function emit(_0x508b32,_0x16e153,_0x27524f){io['to'](_0x508b32)[_0x35fc('0x9')](_0x16e153,_0x27524f);}var headers={'Content-Type':_0x35fc('0xa'),'Accept':_0x35fc('0xa')};function getUser(_0xf9d3a6,_0x2051ab){if(intUtil['validateEmail'](_0x2051ab)===!![]){logger[_0x35fc('0xb')](_0x35fc('0xc'),_0x2051ab);return request({'uri':util['format'](_0x35fc('0xd'),_0xf9d3a6[_0x35fc('0xe')])})['then'](function(_0xda83fb){if(_0xda83fb[_0x35fc('0xf')]){return _['find'](_0xda83fb['_embedded'][_0x35fc('0x10')],{'email':_0x2051ab});}})['then'](function(_0x397738){if(_0x397738){logger[_0x35fc('0xb')](_0x35fc('0x11'));return _0x397738;}else{logger[_0x35fc('0xb')](_0x35fc('0x12'));return request({'uri':util['format']('%s/users/me',_0xf9d3a6['remoteUri'])});}});}else{logger['info'](_0x35fc('0x13'));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x15'),_0xf9d3a6[_0x35fc('0xe')])});}}function request(_0x227a49){logger[_0x35fc('0x16')]('[HTTP]',JSON[_0x35fc('0x17')](_0x227a49));return rp(_[_0x35fc('0x8')](_0x227a49,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x41e165){var _0x363e47;if(_0x41e165[_0x35fc('0x18')]==='basic'){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x19'),_0x41e165[_0x35fc('0x1a')],_0x41e165['password']);}else if(_0x41e165[_0x35fc('0x18')]===_0x35fc('0x1b')){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x1c'),_0x41e165[_0x35fc('0x1a')],_0x41e165[_0x35fc('0x1b')]);}return util[_0x35fc('0x14')](_0x35fc('0x1d'),new Buffer(_0x363e47)[_0x35fc('0x1e')](_0x35fc('0x1f')));}function getEndUser(_0x5bd2b8,_0x323aee,_0xd5399f){logger[_0x35fc('0xb')](_0x35fc('0x20'),_0xd5399f);return request({'uri':util[_0x35fc('0x14')]('%s/customers/search',_0x5bd2b8[_0x35fc('0xe')]),'qs':{'phone':_0xd5399f}})[_0x35fc('0x21')](function(_0x561bf8){if(_0x561bf8[_0x35fc('0xf')]){logger[_0x35fc('0xb')](_0x35fc('0x22'));return _0x561bf8['_embedded'][_0x35fc('0x10')][0x0];}else{logger['info'](_0x35fc('0x23'));return request({'uri':util[_0x35fc('0x14')]('%s/customers',_0x5bd2b8['remoteUri']),'method':_0x35fc('0x24'),'body':{'first_name':_0x323aee,'title':_0x323aee,'phone_numbers':[{'type':'work','value':_0xd5399f}]}});}});}function getTags(_0x274208,_0x1a5d92){var _0x57001c=[];if(_0x274208&&_0x274208[_0x35fc('0x25')]>0x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 206389b..7742088 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 _0xe162=['serverUrl','modernAuthentication','%s/api/data/v9.0/','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','request-promise','util','ioredis','dynamics365','../../../../config/environment','redis','localhost','socket.io-emitter','remoteUri','CloudProvider','data7','tenantId','data5','POST','clientId','password','clientSecret','then','catch','error',']\x20Wrong\x20credentials!','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','email','userEmail','length','internalemailaddress','isdisabled','toUpperCase',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','userId','message','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','body','odata-entityid','substring','lastIndexOf','enduserId','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','contactid','info',']\x20Enduser\x20created!','forEach','picklist','type','nameField','idField','indexOf','content','incident','incidents','assign','getString','Descriptions','/contacts(','Fields','ticketType','phonecall','callDirection','queue','phonecalls','Subjects','headers','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','emit','trigger:browser:url','stripTrailingSlash'];(function(_0x2b2606,_0x1954d9){var _0x333503=function(_0x456c4e){while(--_0x456c4e){_0x2b2606['push'](_0x2b2606['shift']());}};_0x333503(++_0x1954d9);}(_0xe162,0x1c0));var _0x2e16=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe162[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var rp=require(_0x2e16('0x0'));var util=require(_0x2e16('0x1'));var intUtil=require('./util');var md5=require('md5');var Redis=require(_0x2e16('0x2'));var logger=require('../../../../config/logger')(_0x2e16('0x3'));var config=require(_0x2e16('0x4'));config['redis']=_['defaults'](config[_0x2e16('0x5')],{'host':_0x2e16('0x6'),'port':0x18eb});var io=require(_0x2e16('0x7'))(new Redis(config['redis']));function getAuthToken(_0x2b37c0,_0x35231c,_0x18db20){if(_0x2b37c0['modernAuthentication']){_0x2b37c0[_0x2e16('0x8')]=_0x2b37c0[_0x2e16('0x9')][_0x2e16('0xa')];_0x2b37c0[_0x2e16('0xb')]=_0x2b37c0[_0x2e16('0x9')]['data2'];return Promise['resolve'](_0x2b37c0['CloudProvider'][_0x2e16('0xc')]);}var _0x2858f0={'method':_0x2e16('0xd'),'uri':_0x35231c,'form':{'client_id':_0x2b37c0[_0x2e16('0xe')],'resource':_0x2b37c0['remoteUri'],'username':_0x2b37c0['username'],'password':_0x2b37c0[_0x2e16('0xf')],'grant_type':_0x2e16('0xf'),'client_secret':_0x2b37c0[_0x2e16('0x10')]},'json':!![]};return rp(_0x2858f0)[_0x2e16('0x11')](function(_0x109de5){return _0x109de5['access_token'];})[_0x2e16('0x12')](function(_0x2b6f48){logger[_0x2e16('0x13')]('['+[_0x18db20['toUpperCase']()]+_0x2e16('0x14'));return _0x2b6f48['message'];});}function getUser(_0x8fedf2,_0x2d536,_0x20be08,_0x3afc8f,_0x11f8bd,_0x3fe699){return new Promise(function(_0x4ec969,_0xeed824){return getAuthToken(_0x2d536,_0x3afc8f,_0x3fe699)[_0x2e16('0x11')](function(_0x472243){var _0x588ed2={'method':_0x2e16('0x15'),'uri':_0x11f8bd+_0x2e16('0x16'),'headers':{'Authorization':_0x2e16('0x17')+_0x472243,'OData-Version':_0x2e16('0x18')},'json':!![]};return rp(_0x588ed2);})['then'](function(_0x469f4c){var _0xf83858=_0x469f4c[_0x2e16('0x19')];var _0x1d55c0=![];var _0x452b32=null;if(!_[_0x2e16('0x1a')](_0x20be08)){if(intUtil['validateEmail'](_0x20be08[_0x2e16('0x1b')])){_0x8fedf2[_0x2e16('0x1c')]=_0x20be08[_0x2e16('0x1b')];for(_0x452b32=0x0;_0x452b32<_0xf83858[_0x2e16('0x1d')];_0x452b32++){if(_0xf83858[_0x452b32][_0x2e16('0x1e')]===_0x20be08[_0x2e16('0x1b')]&&!_0xf83858[_0x452b32][_0x2e16('0x1f')]){_0x1d55c0=!![];logger['info']('['+[_0x3fe699[_0x2e16('0x20')]()]+_0x2e16('0x21')+_0xf83858[_0x452b32][_0x2e16('0x22')]+'!');_0x8fedf2['userId']=_0xf83858[_0x452b32][_0x2e16('0x22')];}}}}if(!_0x1d55c0){logger['info']('['+[_0x3fe699[_0x2e16('0x20')]()]+_0x2e16('0x23'));_0x8fedf2[_0x2e16('0x1c')]=_0x2d536[_0x2e16('0x24')];for(_0x452b32=0x0;_0x452b32<_0xf83858['length'];_0x452b32++){if(_0xf83858[_0x452b32]['internalemailaddress']===_0x2d536['username']){_0x8fedf2[_0x2e16('0x25')]=_0xf83858[_0x452b32][_0x2e16('0x22')];}}}_0x4ec969(_0x8fedf2);})[_0x2e16('0x12')](function(_0x614d23){_0xeed824(_0x614d23[_0x2e16('0x26')]);});});}function createEndUser(_0x2195f2,_0x578fb0,_0x4e5b07,_0x54263c,_0x3b793e,_0x496f32,_0x1dda37){return new Promise(function(_0x5130d1,_0x2a57e3){return getAuthToken(_0x578fb0,_0x4e5b07,_0x496f32)[_0x2e16('0x11')](function(_0x1d802c){var _0x2567ba=_0x496f32[_0x2e16('0x27')]()===_0x2e16('0x28')?_0x3b793e[_0x2e16('0x29')]:_0x3b793e[_0x2e16('0x2a')];var _0x3c3877={'method':_0x2e16('0xd'),'uri':_0x54263c+_0x2e16('0x2b'),'body':{'fullname':_0x2567ba,'firstname':_0x2567ba,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x2e16('0x2c')+_0x2195f2[_0x2e16('0x25')]+')'},'headers':{'Authorization':_0x2e16('0x17')+_0x1d802c,'OData-Version':_0x2e16('0x18')},'json':!![],'resolveWithFullResponse':!![]};_0x3c3877[_0x2e16('0x2d')][_0x1dda37]=_0x2567ba;return rp(_0x3c3877);})[_0x2e16('0x11')](function(_0xb3e760){var _0x31353b=_0xb3e760['headers'][_0x2e16('0x2e')];var _0x9b798f=_0x31353b[_0x2e16('0x2f')](_0x31353b[_0x2e16('0x30')]('(')+0x1,_0x31353b[_0x2e16('0x30')](')'));_0x2195f2[_0x2e16('0x31')]=_0x9b798f;_0x5130d1(_0x2195f2);})[_0x2e16('0x12')](function(_0x2cc888){_0x2a57e3(_0x2cc888[_0x2e16('0x26')]);});});}function getEndUser(_0x4bdd7c,_0x29f542,_0x51d750,_0x166e94,_0x58aedd,_0x14090e,_0x58d848,_0x2de353){var _0x452a2a=_0x14090e['toLowerCase']()===_0x2e16('0x28')?_0x58aedd[_0x2e16('0x29')]:_0x58aedd[_0x2e16('0x2a')];return getAuthToken(_0x29f542,_0x51d750,_0x14090e)[_0x2e16('0x11')](function(_0x22e590){_0x2de353=_0x2de353?_0x2de353:_0x2e16('0x32');var _0x564c36={'method':'GET','uri':_0x166e94+_0x2e16('0x33')+_0x2de353+_0x2e16('0x34')+_0x2de353+_0x2e16('0x35')+_0x452a2a[_0x2e16('0x36')]('+',_0x2e16('0x37'))+'\x27','headers':{'Authorization':_0x2e16('0x17')+_0x22e590,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x564c36);})['then'](function(_0x342699){var _0x4221cf=![];if(!_0x342699)return _0x4221cf;var _0x3c4088=_0x342699[_0x2e16('0x19')];for(var _0x224bf7=0x0;_0x224bf7<_0x3c4088['length'];_0x224bf7++){if(_0x3c4088[_0x224bf7][_0x2de353]===_0x452a2a){_0x4221cf=!![];_0x4bdd7c['enduserId']=_0x3c4088[_0x224bf7][_0x2e16('0x38')];}}return _0x4221cf;})[_0x2e16('0x11')](function(_0xfc1cee){if(_0xfc1cee)return _0x4bdd7c;if(_0x58d848==='nothing'){logger[_0x2e16('0x39')]('['+[_0x14090e['toUpperCase']()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x4bdd7c;}return createEndUser(_0x4bdd7c,_0x29f542,_0x51d750,_0x166e94,_0x58aedd,_0x14090e,_0x2de353)[_0x2e16('0x11')](function(_0x3fe35e){logger[_0x2e16('0x39')]('['+[_0x14090e['toUpperCase']()]+_0x2e16('0x3a'),_0x3fe35e['enduserId']);return _0x3fe35e;});});}function getCustomFields(_0xa41475,_0xb86c16,_0x38e0a1){var _0x56b923={};if(_0xa41475[_0x2e16('0x1d')]>0x0){_[_0x2e16('0x3b')](_0xa41475,function(_0x37b642){if(_['includes'](['string',_0x2e16('0x3c')],_0x37b642[_0x2e16('0x3d')])&&_0x37b642[_0x2e16('0x3e')]&&!_0x37b642['customField']){var _0x296b3e=_0x37b642[_0x2e16('0x3f')][_0x2e16('0x27')]();var _0x31b75d=_0x296b3e['substring'](0x0,_0x296b3e[_0x2e16('0x40')]('_'));var _0x4bd56a=_0x296b3e[_0x2e16('0x2f')](_0x296b3e[_0x2e16('0x40')]('_')+0x1);if(_0x31b75d===_0x38e0a1){_0x56b923[_0x4bd56a]=_0x37b642[_0x2e16('0x41')];}}});}return _0x56b923;}function getTicket(_0x1576c2,_0x1ab2ad,_0x3a9f53,_0x2b321a,_0x4a00e9,_0x409dd0,_0x40a460){return new Promise(function(_0x18e105,_0x4b85b4){var _0x35ccb8;return getAuthToken(_0x1ab2ad,_0x3a9f53,_0x40a460)[_0x2e16('0x11')](function(_0x50f554){if(_0x409dd0['ticketType']===_0x2e16('0x42')){_0x35ccb8={'method':_0x2e16('0xd'),'uri':_0x2b321a+_0x2e16('0x43'),'body':Object[_0x2e16('0x44')]({},{'title':intUtil[_0x2e16('0x45')](_0x409dd0['Subjects'],_0x4a00e9,'\x20'),'description':intUtil['getString'](_0x409dd0[_0x2e16('0x46')],_0x4a00e9,'\x0a'),'customerid_contact@odata.bind':_0x1576c2[_0x2e16('0x31')]?_0x2e16('0x47')+_0x1576c2[_0x2e16('0x31')]+')':undefined,'ownerid@odata.bind':_0x2e16('0x2c')+_0x1576c2[_0x2e16('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x409dd0[_0x2e16('0x48')],_0x4a00e9,_0x409dd0[_0x2e16('0x49')])),'headers':{'Authorization':_0x2e16('0x17')+_0x50f554,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x409dd0[_0x2e16('0x49')]===_0x2e16('0x4a')){var _0x46df8e=_0x1576c2[_0x2e16('0x31')]?[{'partyid_systemuser@odata.bind':_0x2e16('0x2c')+_0x1576c2['userId']+')','participationtypemask':_0x1576c2[_0x2e16('0x4b')]===_0x2e16('0x4c')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x1576c2[_0x2e16('0x31')]+')','participationtypemask':_0x1576c2[_0x2e16('0x4b')]===_0x2e16('0x4c')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x2e16('0x2c')+_0x1576c2[_0x2e16('0x25')]+')','participationtypemask':_0x1576c2[_0x2e16('0x4b')]===_0x2e16('0x4c')?0x2:0x1}];_0x35ccb8={'method':_0x2e16('0xd'),'uri':_0x2b321a+_0x2e16('0x4d'),'body':Object[_0x2e16('0x44')]({},{'subject':intUtil['getString'](_0x409dd0[_0x2e16('0x4e')],_0x4a00e9,'\x20'),'phonenumber':String(_0x4a00e9[_0x2e16('0x2a')]),'description':intUtil[_0x2e16('0x45')](_0x409dd0['Descriptions'],_0x4a00e9,'\x0a'),'regardingobjectid_contact@odata.bind':_0x1576c2[_0x2e16('0x31')]?_0x2e16('0x47')+_0x1576c2[_0x2e16('0x31')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x1576c2[_0x2e16('0x25')]+')','directioncode':_0x1576c2[_0x2e16('0x4b')]===_0x2e16('0x4c')?![]:!![],'phonecall_activity_parties':_0x46df8e},getCustomFields(_0x409dd0['Fields'],_0x4a00e9,_0x409dd0[_0x2e16('0x49')])),'headers':{'Authorization':'Bearer\x20'+_0x50f554,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x35ccb8);})[_0x2e16('0x11')](function(_0x4de2ac){var _0x3da56a=_0x4de2ac[_0x2e16('0x4f')][_0x2e16('0x2e')];var _0x39e92d=_0x3da56a[_0x2e16('0x2f')](_0x3da56a[_0x2e16('0x30')]('(')+0x1,_0x3da56a[_0x2e16('0x30')](')'));_0x1576c2[_0x2e16('0x50')]=_0x39e92d;_0x18e105(_0x1576c2);})[_0x2e16('0x12')](function(_0x16b4d7){_0x4b85b4(_0x16b4d7['message']);});});}function emit(_0x1ffb21,_0x4b232c,_0x1b44e6,_0x1be86a){var _0x1a167d={'uri':util['format'](_0x2e16('0x51'),_0x1ffb21,_0x1b44e6,_0x1be86a)};io['to'](util[_0x2e16('0x52')](_0x2e16('0x53'),_0x4b232c))[_0x2e16('0x54')](_0x2e16('0x55'),_0x1a167d);}exports['cs']=function(_0x3aa121,_0x8ea3a0,_0x25ed97,_0x2dfbfc,_0x2fa5b3,_0x50e31c,_0x39ced2,_0x48e464){var _0x332f79={};_0x50e31c[_0x2e16('0x8')]=_0x50e31c['modernAuthentication']?intUtil['stripTrailingSlash'](_0x50e31c['CloudProvider'][_0x2e16('0xa')]):intUtil[_0x2e16('0x56')](_0x50e31c[_0x2e16('0x8')]);_0x50e31c[_0x2e16('0x57')]=intUtil[_0x2e16('0x56')](_0x50e31c['serverUrl']);_0x332f79[_0x2e16('0x4b')]=_0x48e464===_0x2e16('0x4c')||_0x48e464==='unmanaged'?_0x2e16('0x4c'):_0x2e16('0x28');var _0x53d19c=_0x50e31c[_0x2e16('0x58')]?util['format'](_0x2e16('0x59'),_0x50e31c[_0x2e16('0x9')]['data7']):util[_0x2e16('0x52')](_0x2e16('0x59'),_0x50e31c[_0x2e16('0x8')]);var _0x169a82=util[_0x2e16('0x52')]('https://login.microsoftonline.com/%s/oauth2/token',_0x50e31c[_0x2e16('0xb')]);var _0x1636ba=util[_0x2e16('0x52')](_0x2e16('0x5a'),_0x50e31c[_0x2e16('0x57')],_0x8ea3a0[_0x2e16('0x5b')],md5(_0x8ea3a0[_0x2e16('0x5b')]));if(_0x2fa5b3&&_0x2fa5b3[_0x2e16('0x5c')]){logger[_0x2e16('0x39')](_0x2e16('0x5d'),'Recording\x20is\x20enabled!');_0x8ea3a0[_0x2e16('0x5e')]=_0x1636ba;}else if(_0x39ced2&&_0x39ced2[_0x2e16('0x5f')]&&_0x39ced2[_0x2e16('0x5f')]!==_0x2e16('0x60')){logger[_0x2e16('0x39')]('[OUTBOUND]',_0x2e16('0x61'));_0x8ea3a0[_0x2e16('0x5e')]=_0x1636ba;}else{_0x8ea3a0[_0x2e16('0x5e')]='';}return getUser(_0x332f79,_0x50e31c,_0x2dfbfc,_0x169a82,_0x53d19c,_0x48e464)[_0x2e16('0x11')](function(_0xb65565){logger[_0x2e16('0x39')]('['+_0x48e464[_0x2e16('0x20')]()+_0x2e16('0x62'),_0xb65565['userId']);logger[_0x2e16('0x39')]('['+_0x48e464['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0xb65565['userEmail']);return getEndUser(_0xb65565,_0x50e31c,_0x169a82,_0x53d19c,_0x8ea3a0,_0x48e464,_0x25ed97[_0x2e16('0x63')],_0x25ed97['additionalSearchContact']);})[_0x2e16('0x11')](function(_0xfd6005){logger[_0x2e16('0x39')]('['+_0x48e464[_0x2e16('0x20')]()+_0x2e16('0x64'),_0xfd6005[_0x2e16('0x31')]);logger[_0x2e16('0x39')]('['+_0x48e464[_0x2e16('0x20')]()+_0x2e16('0x65'),_0x8ea3a0[_0x2e16('0x2a')]);return getTicket(_0xfd6005,_0x50e31c,_0x169a82,_0x53d19c,_0x8ea3a0,_0x25ed97,_0x48e464);})[_0x2e16('0x11')](function(_0x5b58bb){logger[_0x2e16('0x39')](util[_0x2e16('0x52')]('['+_0x48e464[_0x2e16('0x20')]()+_0x2e16('0x66'),_0x25ed97['ticketType'],_0x5b58bb[_0x2e16('0x50')]));logger['info'](util[_0x2e16('0x52')]('['+_0x48e464[_0x2e16('0x20')]()+']\x20Call\x20direction:\x20%s',_0x48e464));if(_0x48e464!==_0x2e16('0x67')&&_0x25ed97['openNewTab']){logger[_0x2e16('0x39')]('['+_0x48e464[_0x2e16('0x20')]()+']',_0x2e16('0x68'));emit(_0x50e31c[_0x2e16('0x8')],_0x2dfbfc['name'],_0x25ed97['ticketType'],_0x5b58bb[_0x2e16('0x50')]);}})[_0x2e16('0x12')](function(_0x3e8809){logger['error']('['+_0x48e464[_0x2e16('0x20')]()+_0x2e16('0x69'),_0x3e8809[_0x2e16('0x26')]);console[_0x2e16('0x13')](_0x2e16('0x6a'),_0x3e8809);});}; \ No newline at end of file +var _0xfd80=['calleridnum','POST','contacts','/systemusers(','headers','lastIndexOf','enduserId','telephone1','contacts?$select=','\x20eq\x20\x27','replace','%2b','value','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','customField','idField','indexOf','substring','content','ticketType','incident','incidents','assign','getString','Descriptions','/contacts(','Fields','Bearer\x20','phonecall','callDirection','queue','phonecalls','Subjects','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','uniqueid','monitor_format','[QUEUE]','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','ticketId','error','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','clientId','username','password','clientSecret','access_token','toUpperCase',']\x20Wrong\x20credentials!','message','GET','4.0','isNil','email','userEmail','length','internalemailaddress','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','catch','then','toLowerCase','outbound','destcalleridnum'];(function(_0x36910c,_0x5a3928){var _0x23d22a=function(_0x4ca99f){while(--_0x4ca99f){_0x36910c['push'](_0x36910c['shift']());}};_0x23d22a(++_0x5a3928);}(_0xfd80,0x185));var _0x0fd8=function(_0x3819d8,_0xb285ae){_0x3819d8=_0x3819d8-0x0;var _0x255cdf=_0xfd80[_0x3819d8];return _0x255cdf;};'use strict';var _=require(_0x0fd8('0x0'));var rp=require(_0x0fd8('0x1'));var util=require(_0x0fd8('0x2'));var intUtil=require(_0x0fd8('0x3'));var md5=require(_0x0fd8('0x4'));var Redis=require(_0x0fd8('0x5'));var logger=require(_0x0fd8('0x6'))(_0x0fd8('0x7'));var config=require('../../../../config/environment');config['redis']=_[_0x0fd8('0x8')](config['redis'],{'host':_0x0fd8('0x9'),'port':0x18eb});var io=require(_0x0fd8('0xa'))(new Redis(config['redis']));function getAuthToken(_0x416645,_0x312bcc,_0x8eaf58){if(_0x416645[_0x0fd8('0xb')]){_0x416645[_0x0fd8('0xc')]=_0x416645[_0x0fd8('0xd')][_0x0fd8('0xe')];_0x416645[_0x0fd8('0xf')]=_0x416645[_0x0fd8('0xd')][_0x0fd8('0x10')];return Promise[_0x0fd8('0x11')](_0x416645[_0x0fd8('0xd')][_0x0fd8('0x12')]);}var _0x1a1b44={'method':'POST','uri':_0x312bcc,'form':{'client_id':_0x416645[_0x0fd8('0x13')],'resource':_0x416645[_0x0fd8('0xc')],'username':_0x416645[_0x0fd8('0x14')],'password':_0x416645[_0x0fd8('0x15')],'grant_type':_0x0fd8('0x15'),'client_secret':_0x416645[_0x0fd8('0x16')]},'json':!![]};return rp(_0x1a1b44)['then'](function(_0x4492a4){return _0x4492a4[_0x0fd8('0x17')];})['catch'](function(_0x17b6f8){logger['error']('['+[_0x8eaf58[_0x0fd8('0x18')]()]+_0x0fd8('0x19'));return _0x17b6f8[_0x0fd8('0x1a')];});}function getUser(_0x4f59fd,_0x130a93,_0x14f4a8,_0x616a9a,_0x10ff52,_0x57ee81){return new Promise(function(_0x3a4b1b,_0x2048fe){return getAuthToken(_0x130a93,_0x616a9a,_0x57ee81)['then'](function(_0x292b4f){var _0x529504={'method':_0x0fd8('0x1b'),'uri':_0x10ff52+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':'Bearer\x20'+_0x292b4f,'OData-Version':_0x0fd8('0x1c')},'json':!![]};return rp(_0x529504);})['then'](function(_0x3a08d0){var _0xd59d02=_0x3a08d0['value'];var _0x3d7368=![];var _0x568d53=null;if(!_[_0x0fd8('0x1d')](_0x14f4a8)){if(intUtil['validateEmail'](_0x14f4a8[_0x0fd8('0x1e')])){_0x4f59fd[_0x0fd8('0x1f')]=_0x14f4a8[_0x0fd8('0x1e')];for(_0x568d53=0x0;_0x568d53<_0xd59d02[_0x0fd8('0x20')];_0x568d53++){if(_0xd59d02[_0x568d53][_0x0fd8('0x21')]===_0x14f4a8[_0x0fd8('0x1e')]&&!_0xd59d02[_0x568d53]['isdisabled']){_0x3d7368=!![];logger['info']('['+[_0x57ee81[_0x0fd8('0x18')]()]+']\x20Agent\x20found\x20'+_0xd59d02[_0x568d53][_0x0fd8('0x22')]+'!');_0x4f59fd[_0x0fd8('0x23')]=_0xd59d02[_0x568d53][_0x0fd8('0x22')];}}}}if(!_0x3d7368){logger[_0x0fd8('0x24')]('['+[_0x57ee81[_0x0fd8('0x18')]()]+_0x0fd8('0x25'));_0x4f59fd[_0x0fd8('0x1f')]=_0x130a93[_0x0fd8('0x14')];for(_0x568d53=0x0;_0x568d53<_0xd59d02[_0x0fd8('0x20')];_0x568d53++){if(_0xd59d02[_0x568d53]['internalemailaddress']===_0x130a93[_0x0fd8('0x14')]){_0x4f59fd[_0x0fd8('0x23')]=_0xd59d02[_0x568d53][_0x0fd8('0x22')];}}}_0x3a4b1b(_0x4f59fd);})[_0x0fd8('0x26')](function(_0x265a34){_0x2048fe(_0x265a34[_0x0fd8('0x1a')]);});});}function createEndUser(_0xc877a9,_0x4bbe8a,_0x514f79,_0x380755,_0x30fabc,_0x51425b,_0x2c5c12){return new Promise(function(_0x1fb548,_0x1d3fbf){return getAuthToken(_0x4bbe8a,_0x514f79,_0x51425b)[_0x0fd8('0x27')](function(_0x48d694){var _0x1b8f65=_0x51425b[_0x0fd8('0x28')]()===_0x0fd8('0x29')?_0x30fabc[_0x0fd8('0x2a')]:_0x30fabc[_0x0fd8('0x2b')];var _0x5908bb={'method':_0x0fd8('0x2c'),'uri':_0x380755+_0x0fd8('0x2d'),'body':{'fullname':_0x1b8f65,'firstname':_0x1b8f65,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x0fd8('0x2e')+_0xc877a9[_0x0fd8('0x23')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x48d694,'OData-Version':_0x0fd8('0x1c')},'json':!![],'resolveWithFullResponse':!![]};_0x5908bb['body'][_0x2c5c12]=_0x1b8f65;return rp(_0x5908bb);})['then'](function(_0x41d514){var _0x5b6130=_0x41d514[_0x0fd8('0x2f')]['odata-entityid'];var _0x6ce58e=_0x5b6130['substring'](_0x5b6130[_0x0fd8('0x30')]('(')+0x1,_0x5b6130[_0x0fd8('0x30')](')'));_0xc877a9[_0x0fd8('0x31')]=_0x6ce58e;_0x1fb548(_0xc877a9);})[_0x0fd8('0x26')](function(_0x2ea8cf){_0x1d3fbf(_0x2ea8cf['message']);});});}function getEndUser(_0x351c8d,_0x152070,_0x3a197f,_0x178512,_0x41af21,_0x268fe2,_0x4bc5cc,_0x42e4ff){var _0xc28d5c=_0x268fe2['toLowerCase']()===_0x0fd8('0x29')?_0x41af21['destcalleridnum']:_0x41af21['calleridnum'];return getAuthToken(_0x152070,_0x3a197f,_0x268fe2)['then'](function(_0x551ade){_0x42e4ff=_0x42e4ff?_0x42e4ff:_0x0fd8('0x32');var _0x3b1501={'method':_0x0fd8('0x1b'),'uri':_0x178512+_0x0fd8('0x33')+_0x42e4ff+'&$filter='+_0x42e4ff+_0x0fd8('0x34')+_0xc28d5c[_0x0fd8('0x35')]('+',_0x0fd8('0x36'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x551ade,'If-None-Match':null,'OData-Version':_0x0fd8('0x1c')},'json':!![]};return rp(_0x3b1501);})['then'](function(_0x2a8df6){var _0x10a819=![];if(!_0x2a8df6)return _0x10a819;var _0x135f07=_0x2a8df6[_0x0fd8('0x37')];for(var _0x792ccf=0x0;_0x792ccf<_0x135f07[_0x0fd8('0x20')];_0x792ccf++){if(_0x135f07[_0x792ccf][_0x42e4ff]===_0xc28d5c){_0x10a819=!![];_0x351c8d[_0x0fd8('0x31')]=_0x135f07[_0x792ccf][_0x0fd8('0x38')];}}return _0x10a819;})[_0x0fd8('0x27')](function(_0x30b961){if(_0x30b961)return _0x351c8d;if(_0x4bc5cc==='nothing'){logger['info']('['+[_0x268fe2[_0x0fd8('0x18')]()]+_0x0fd8('0x39'));return _0x351c8d;}return createEndUser(_0x351c8d,_0x152070,_0x3a197f,_0x178512,_0x41af21,_0x268fe2,_0x42e4ff)[_0x0fd8('0x27')](function(_0x11f14a){logger[_0x0fd8('0x24')]('['+[_0x268fe2[_0x0fd8('0x18')]()]+_0x0fd8('0x3a'),_0x11f14a[_0x0fd8('0x31')]);return _0x11f14a;});});}function getCustomFields(_0x3968d4,_0x4b7167,_0x4fc2a0){var _0x31b968={};if(_0x3968d4[_0x0fd8('0x20')]>0x0){_[_0x0fd8('0x3b')](_0x3968d4,function(_0x306bff){if(_[_0x0fd8('0x3c')]([_0x0fd8('0x3d'),_0x0fd8('0x3e')],_0x306bff[_0x0fd8('0x3f')])&&_0x306bff['nameField']&&!_0x306bff[_0x0fd8('0x40')]){var _0x12ebe8=_0x306bff[_0x0fd8('0x41')][_0x0fd8('0x28')]();var _0x3bae92=_0x12ebe8['substring'](0x0,_0x12ebe8[_0x0fd8('0x42')]('_'));var _0x102db8=_0x12ebe8[_0x0fd8('0x43')](_0x12ebe8[_0x0fd8('0x42')]('_')+0x1);if(_0x3bae92===_0x4fc2a0){_0x31b968[_0x102db8]=_0x306bff[_0x0fd8('0x44')];}}});}return _0x31b968;}function getTicket(_0x5d3c6a,_0x1e9d4a,_0xd438f2,_0x400624,_0x4cf011,_0xdbd26f,_0x3599ea){return new Promise(function(_0x38ad8a,_0x3c07c6){var _0x41fa14;return getAuthToken(_0x1e9d4a,_0xd438f2,_0x3599ea)[_0x0fd8('0x27')](function(_0x4339bd){if(_0xdbd26f[_0x0fd8('0x45')]===_0x0fd8('0x46')){_0x41fa14={'method':'POST','uri':_0x400624+_0x0fd8('0x47'),'body':Object[_0x0fd8('0x48')]({},{'title':intUtil[_0x0fd8('0x49')](_0xdbd26f['Subjects'],_0x4cf011,'\x20'),'description':intUtil['getString'](_0xdbd26f[_0x0fd8('0x4a')],_0x4cf011,'\x0a'),'customerid_contact@odata.bind':_0x5d3c6a['enduserId']?_0x0fd8('0x4b')+_0x5d3c6a[_0x0fd8('0x31')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x5d3c6a[_0x0fd8('0x23')]+')','caseorigincode':'1'},getCustomFields(_0xdbd26f[_0x0fd8('0x4c')],_0x4cf011,_0xdbd26f[_0x0fd8('0x45')])),'headers':{'Authorization':_0x0fd8('0x4d')+_0x4339bd,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0xdbd26f['ticketType']===_0x0fd8('0x4e')){var _0x392b14=_0x5d3c6a['enduserId']?[{'partyid_systemuser@odata.bind':_0x0fd8('0x2e')+_0x5d3c6a[_0x0fd8('0x23')]+')','participationtypemask':_0x5d3c6a[_0x0fd8('0x4f')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x0fd8('0x4b')+_0x5d3c6a[_0x0fd8('0x31')]+')','participationtypemask':_0x5d3c6a['callDirection']==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x0fd8('0x2e')+_0x5d3c6a[_0x0fd8('0x23')]+')','participationtypemask':_0x5d3c6a[_0x0fd8('0x4f')]===_0x0fd8('0x50')?0x2:0x1}];_0x41fa14={'method':_0x0fd8('0x2c'),'uri':_0x400624+_0x0fd8('0x51'),'body':Object[_0x0fd8('0x48')]({},{'subject':intUtil[_0x0fd8('0x49')](_0xdbd26f[_0x0fd8('0x52')],_0x4cf011,'\x20'),'phonenumber':String(_0x4cf011[_0x0fd8('0x2b')]),'description':intUtil[_0x0fd8('0x49')](_0xdbd26f['Descriptions'],_0x4cf011,'\x0a'),'regardingobjectid_contact@odata.bind':_0x5d3c6a[_0x0fd8('0x31')]?_0x0fd8('0x4b')+_0x5d3c6a[_0x0fd8('0x31')]+')':undefined,'ownerid@odata.bind':_0x0fd8('0x2e')+_0x5d3c6a['userId']+')','directioncode':_0x5d3c6a[_0x0fd8('0x4f')]===_0x0fd8('0x50')?![]:!![],'phonecall_activity_parties':_0x392b14},getCustomFields(_0xdbd26f[_0x0fd8('0x4c')],_0x4cf011,_0xdbd26f[_0x0fd8('0x45')])),'headers':{'Authorization':_0x0fd8('0x4d')+_0x4339bd,'OData-Version':_0x0fd8('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x41fa14);})[_0x0fd8('0x27')](function(_0x1314a6){var _0x12cea4=_0x1314a6['headers']['odata-entityid'];var _0x3987e7=_0x12cea4[_0x0fd8('0x43')](_0x12cea4['lastIndexOf']('(')+0x1,_0x12cea4[_0x0fd8('0x30')](')'));_0x5d3c6a['ticketId']=_0x3987e7;_0x38ad8a(_0x5d3c6a);})[_0x0fd8('0x26')](function(_0x18bb1c){_0x3c07c6(_0x18bb1c[_0x0fd8('0x1a')]);});});}function emit(_0x471310,_0x4432bb,_0x664534,_0x104965){var _0x84ea46={'uri':util[_0x0fd8('0x53')](_0x0fd8('0x54'),_0x471310,_0x664534,_0x104965)};io['to'](util[_0x0fd8('0x53')](_0x0fd8('0x55'),_0x4432bb))['emit'](_0x0fd8('0x56'),_0x84ea46);}exports['cs']=function(_0x1e549c,_0x5e2120,_0x1b20b8,_0x33a68c,_0x2f6765,_0x59da43,_0x3d77bf,_0xb28db0){var _0x418a05={};_0x59da43['remoteUri']=_0x59da43[_0x0fd8('0xb')]?intUtil[_0x0fd8('0x57')](_0x59da43[_0x0fd8('0xd')][_0x0fd8('0xe')]):intUtil[_0x0fd8('0x57')](_0x59da43[_0x0fd8('0xc')]);_0x59da43[_0x0fd8('0x58')]=intUtil[_0x0fd8('0x57')](_0x59da43[_0x0fd8('0x58')]);_0x418a05[_0x0fd8('0x4f')]=_0xb28db0===_0x0fd8('0x50')||_0xb28db0===_0x0fd8('0x59')?_0x0fd8('0x50'):_0x0fd8('0x29');var _0x45ece9=_0x59da43['modernAuthentication']?util[_0x0fd8('0x53')](_0x0fd8('0x5a'),_0x59da43[_0x0fd8('0xd')][_0x0fd8('0xe')]):util[_0x0fd8('0x53')](_0x0fd8('0x5a'),_0x59da43[_0x0fd8('0xc')]);var _0x131578=util[_0x0fd8('0x53')]('https://login.microsoftonline.com/%s/oauth2/token',_0x59da43[_0x0fd8('0xf')]);var _0x5c7f9b=util[_0x0fd8('0x53')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x59da43['serverUrl'],_0x5e2120[_0x0fd8('0x5b')],md5(_0x5e2120[_0x0fd8('0x5b')]));if(_0x2f6765&&_0x2f6765[_0x0fd8('0x5c')]){logger[_0x0fd8('0x24')](_0x0fd8('0x5d'),'Recording\x20is\x20enabled!');_0x5e2120['recordingURL']=_0x5c7f9b;}else if(_0x3d77bf&&_0x3d77bf[_0x0fd8('0x5e')]&&_0x3d77bf[_0x0fd8('0x5e')]!==_0x0fd8('0x5f')){logger['info'](_0x0fd8('0x60'),_0x0fd8('0x61'));_0x5e2120[_0x0fd8('0x62')]=_0x5c7f9b;}else{_0x5e2120['recordingURL']='';}return getUser(_0x418a05,_0x59da43,_0x33a68c,_0x131578,_0x45ece9,_0xb28db0)[_0x0fd8('0x27')](function(_0x65458f){logger[_0x0fd8('0x24')]('['+_0xb28db0[_0x0fd8('0x18')]()+_0x0fd8('0x63'),_0x65458f[_0x0fd8('0x23')]);logger['info']('['+_0xb28db0[_0x0fd8('0x18')]()+_0x0fd8('0x64'),_0x65458f[_0x0fd8('0x1f')]);return getEndUser(_0x65458f,_0x59da43,_0x131578,_0x45ece9,_0x5e2120,_0xb28db0,_0x1b20b8[_0x0fd8('0x65')],_0x1b20b8['additionalSearchContact']);})[_0x0fd8('0x27')](function(_0x2706ac){logger['info']('['+_0xb28db0[_0x0fd8('0x18')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x2706ac[_0x0fd8('0x31')]);logger[_0x0fd8('0x24')]('['+_0xb28db0[_0x0fd8('0x18')]()+_0x0fd8('0x66'),_0x5e2120[_0x0fd8('0x2b')]);return getTicket(_0x2706ac,_0x59da43,_0x131578,_0x45ece9,_0x5e2120,_0x1b20b8,_0xb28db0);})[_0x0fd8('0x27')](function(_0x5cca4e){logger[_0x0fd8('0x24')](util[_0x0fd8('0x53')]('['+_0xb28db0['toUpperCase']()+_0x0fd8('0x67'),_0x1b20b8[_0x0fd8('0x45')],_0x5cca4e['ticketId']));logger[_0x0fd8('0x24')](util['format']('['+_0xb28db0[_0x0fd8('0x18')]()+_0x0fd8('0x68'),_0xb28db0));if(_0xb28db0!=='unmanaged'&&_0x1b20b8['openNewTab']){logger[_0x0fd8('0x24')]('['+_0xb28db0[_0x0fd8('0x18')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x59da43[_0x0fd8('0xc')],_0x33a68c['name'],_0x1b20b8[_0x0fd8('0x45')],_0x5cca4e[_0x0fd8('0x69')]);}})['catch'](function(_0x2d29fd){logger['error']('['+_0xb28db0[_0x0fd8('0x18')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x2d29fd[_0x0fd8('0x1a')]);console[_0x0fd8('0x6a')](_0x0fd8('0x6b'),_0x2d29fd);});}; \ 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 a89fbde..f0ad4b2 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 _0xbf94=['customVariable','name','Variable','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','serverUrl','recordingFormat','none','[OUTBOUND]','destcalleridname','trigger:browser:url','error','lastevent','toUpperCase','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','
','Fields','custom_fields','mapValues','keyBy','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','length','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','apiKey','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','type','nameField','customField','toLowerCase','content','picklist','push','toString','variable','idField','variableName'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf94,0x76));var _0x4bf9=function(_0x5b9fa9,_0x9a13b0){_0x5b9fa9=_0x5b9fa9-0x0;var _0x274dd0=_0xbf94[_0x5b9fa9];return _0x274dd0;};'use strict';var _=require('lodash');var rp=require(_0x4bf9('0x0'));var md5=require(_0x4bf9('0x1'));var util=require('util');var Redis=require(_0x4bf9('0x2'));var intUtil=require(_0x4bf9('0x3'));var config=require(_0x4bf9('0x4'));var logger=require(_0x4bf9('0x5'))(_0x4bf9('0x6'));config[_0x4bf9('0x7')]=_['defaults'](config['redis'],{'host':_0x4bf9('0x8'),'port':0x18eb});var io=require(_0x4bf9('0x9'))(new Redis(config['redis']));var headers={'Content-Type':_0x4bf9('0xa'),'Accept':_0x4bf9('0xa')};function emit(_0xf46e3b,_0x61032f,_0x1a15c8){io['to'](_0xf46e3b)['emit'](_0x61032f,_0x1a15c8);}function getTicket(_0x4f0987,_0x37728c,_0x5883e0,_0x151927,_0x43be8f){logger[_0x4bf9('0xb')](_0x4bf9('0xc'));var _0x587217=_[_0x4bf9('0xd')]({'responder_id':_0x37728c['id'],'requester_id':_0x5883e0['id'],'name':util[_0x4bf9('0xe')](_0x4bf9('0xf'),_0x43be8f[_0x4bf9('0x10')]),'phone':_0x43be8f[_0x4bf9('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x4bf9('0x12')](_0x151927[_0x4bf9('0x13')],_0x43be8f,'\x20'),'description':intUtil[_0x4bf9('0x12')](_0x151927['Descriptions'],_0x43be8f,_0x4bf9('0x14')),'tags':getTags(_0x151927['Tags'],'name')},getCustomFields(_0x151927[_0x4bf9('0x15')],_0x43be8f));_0x587217[_0x4bf9('0x16')]=_[_0x4bf9('0x17')](_[_0x4bf9('0x18')](_0x587217['custom_fields'],'id'),'value');return request({'uri':util['format']('%s/api/v2/tickets',_0x4f0987['remoteUri']),'method':_0x4bf9('0x19'),'body':_0x587217})[_0x4bf9('0x1a')](function(_0x8847b6){logger[_0x4bf9('0xb')](_0x4bf9('0x1b'));return _0x8847b6;});}function getUser(_0x466b40,_0x5f49e9){if(intUtil[_0x4bf9('0x1c')](_0x5f49e9)){return request({'uri':util[_0x4bf9('0xe')](_0x4bf9('0x1d'),_0x466b40[_0x4bf9('0x1e')]),'qs':{'email':_0x5f49e9}})[_0x4bf9('0x1a')](function(_0x2a2cfb){if(_0x2a2cfb[_0x4bf9('0x1f')]){logger[_0x4bf9('0xb')]('Agent\x20found!');return _['find'](_0x2a2cfb,function(_0x1284f5){return _0x1284f5[_0x4bf9('0x20')]['email']===_0x5f49e9;});}else{logger[_0x4bf9('0xb')](_0x4bf9('0x21'));return request({'uri':util[_0x4bf9('0xe')](_0x4bf9('0x22'),_0x466b40['remoteUri'])})['then'](function(_0x44cb3e){logger[_0x4bf9('0xb')]('Admin\x20account\x20selected.');return _0x44cb3e;});}});}else{logger[_0x4bf9('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x4bf9('0x22'),_0x466b40[_0x4bf9('0x1e')])})[_0x4bf9('0x1a')](function(_0x5002e2){logger['info'](_0x4bf9('0x23'));return _0x5002e2;});}}function getEndUser(_0xd6106f,_0x9146a9,_0x54b22e){logger[_0x4bf9('0xb')](_0x4bf9('0x24'),_0x54b22e);return request({'uri':util[_0x4bf9('0xe')](_0x4bf9('0x25'),_0xd6106f[_0x4bf9('0x1e')]),'qs':{'phone':_0x54b22e}})['then'](function(_0x1c2fee){if(_0x1c2fee[_0x4bf9('0x1f')]){logger[_0x4bf9('0xb')](_0x4bf9('0x26'));return _[_0x4bf9('0x27')](_0x1c2fee,{'phone':_0x54b22e});}else{logger[_0x4bf9('0xb')](_0x4bf9('0x28'));return request({'uri':util[_0x4bf9('0xe')](_0x4bf9('0x25'),_0xd6106f[_0x4bf9('0x1e')]),'method':_0x4bf9('0x19'),'body':{'name':_0x9146a9,'phone':_0x54b22e}})[_0x4bf9('0x1a')](function(_0xa5ba6f){logger[_0x4bf9('0xb')]('Enduser\x20created.');return _0xa5ba6f;});}});}function getAuth(_0x1bbe70){return util[_0x4bf9('0xe')](_0x4bf9('0x29'),new Buffer(_0x1bbe70[_0x4bf9('0x2a')]+':X')['toString'](_0x4bf9('0x2b')));}function request(_0x390d48){logger[_0x4bf9('0x2c')](_0x4bf9('0x2d'),JSON[_0x4bf9('0x2e')](_0x390d48));return rp(_['defaults'](_0x390d48,{'method':_0x4bf9('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x105bd7,_0xa3d4b6){var _0x2895b1=[];if(_0x105bd7&&_0x105bd7[_0x4bf9('0x1f')]>0x0){_0x2895b1=_[_0x4bf9('0x30')](_0x105bd7,_0xa3d4b6);}return _0x2895b1;}function getCustomFields(_0x2bd6b6,_0x1bd586){var _0x3d16a0=[];var _0x25a26f={'custom_fields':[]};if(_0x2bd6b6[_0x4bf9('0x1f')]>0x0){_[_0x4bf9('0x31')](_0x2bd6b6,function(_0x2e493){if(_[_0x4bf9('0x32')](['string','picklist'],_0x2e493[_0x4bf9('0x33')])&&_0x2e493[_0x4bf9('0x34')]&&!_0x2e493[_0x4bf9('0x35')]){_0x25a26f[_0x2e493[_0x4bf9('0x34')][_0x4bf9('0x36')]()]=_0x2e493[_0x4bf9('0x37')]['toString']();}else if(_[_0x4bf9('0x32')](['string',_0x4bf9('0x38')],_0x2e493['type'])&&_0x2e493['idField']&&_0x2e493['customField']){_0x25a26f[_0x4bf9('0x16')][_0x4bf9('0x39')]({'id':_0x2e493['idField'],'value':_0x2e493[_0x4bf9('0x37')][_0x4bf9('0x3a')]()});}else if(_0x2e493[_0x4bf9('0x33')]===_0x4bf9('0x3b')&&_0x2e493['variableName']&&_0x2e493[_0x4bf9('0x3c')]&&_0x2e493[_0x4bf9('0x35')]){_0x1bd586[_0x2e493[_0x4bf9('0x3d')]]&&_0x25a26f['custom_fields'][_0x4bf9('0x39')]({'id':_0x2e493[_0x4bf9('0x3c')],'value':_0x1bd586[_0x2e493[_0x4bf9('0x3d')]][_0x4bf9('0x3a')]()});}else if(_0x2e493[_0x4bf9('0x33')]===_0x4bf9('0x3e')&&_0x2e493['Variable']&&_0x2e493['Variable'][_0x4bf9('0x3f')]&&_0x2e493['idField']&&_0x2e493[_0x4bf9('0x35')]){_0x1bd586[_0x2e493[_0x4bf9('0x40')]['name'][_0x4bf9('0x36')]()]&&_0x25a26f[_0x4bf9('0x16')]['push']({'id':_0x2e493['idField'],'value':_0x1bd586[_0x2e493[_0x4bf9('0x40')][_0x4bf9('0x3f')]['toLowerCase']()][_0x4bf9('0x3a')]()});}});}return _0x25a26f;}exports['queue']=function(_0x205f85,_0xa1d908,_0x360627,_0x429e63,_0x277ebc,_0x42626e){var _0x49bf8f,_0x223e6d;_0x42626e[_0x4bf9('0x1e')]=intUtil[_0x4bf9('0x41')](_0x42626e[_0x4bf9('0x1e')]);_0x42626e['serverUrl']=intUtil[_0x4bf9('0x41')](_0x42626e['serverUrl']);if(_0x277ebc&&_0x277ebc[_0x4bf9('0x42')]){logger[_0x4bf9('0xb')](_0x4bf9('0x43'),_0x4bf9('0x44'));_0xa1d908[_0x4bf9('0x45')]=util[_0x4bf9('0xe')](_0x4bf9('0x46'),_0x42626e['serverUrl'],_0xa1d908[_0x4bf9('0x47')],md5(_0xa1d908[_0x4bf9('0x47')]));}else{_0xa1d908['recordingURL']='';}headers[_0x4bf9('0x48')]=getAuth(_0x42626e);return getUser(_0x42626e,_0x429e63[_0x4bf9('0x49')])[_0x4bf9('0x1a')](function(_0x1311c1){_0x49bf8f=_0x1311c1;logger[_0x4bf9('0xb')]('The\x20User\x20ID\x20is:',_0x49bf8f['id']);return getEndUser(_0x42626e,_0xa1d908['calleridname'],_0xa1d908[_0x4bf9('0x11')]);})[_0x4bf9('0x1a')](function(_0x1143e8){_0x223e6d=_0x1143e8;logger[_0x4bf9('0xb')](_0x4bf9('0x4a'),_0x223e6d['id']);return getTicket(_0x42626e,_0x49bf8f,_0x223e6d,_0x360627,_0xa1d908);})[_0x4bf9('0x1a')](function(_0x25e381){if(_0x25e381&&_0x25e381['id']){logger[_0x4bf9('0xb')](_0x4bf9('0x1b'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x25e381['id']);logger['info'](_0x4bf9('0x43'),_0x4bf9('0x4b'));emit(util[_0x4bf9('0xe')](_0x4bf9('0x4c'),_0x429e63[_0x4bf9('0x3f')]),'trigger:browser:url',{'uri':util[_0x4bf9('0xe')](_0x4bf9('0x4d'),_0x42626e['remoteUri'],_0x25e381['id'])});}})[_0x4bf9('0x4e')](function(_0x1ff06f){logger['error'](_0x4bf9('0x43'),JSON[_0x4bf9('0x2e')](_0x1ff06f));});};exports['outbound']=function(_0x21c280,_0x2d2dc1,_0x47bda3,_0x393635,_0x19a42f,_0x2da80d,_0x1e2db0){var _0x445566,_0x3a9830;_0x2da80d[_0x4bf9('0x1e')]=intUtil[_0x4bf9('0x41')](_0x2da80d[_0x4bf9('0x1e')]);_0x2da80d[_0x4bf9('0x4f')]=intUtil['stripTrailingSlash'](_0x2da80d['serverUrl']);if(_0x1e2db0&&_0x1e2db0[_0x4bf9('0x50')]&&_0x1e2db0[_0x4bf9('0x50')]!==_0x4bf9('0x51')){logger[_0x4bf9('0xb')](_0x4bf9('0x52'),'Recording\x20is\x20enabled!');_0x2d2dc1['recordingURL']=util[_0x4bf9('0xe')](_0x4bf9('0x46'),_0x2da80d[_0x4bf9('0x4f')],_0x2d2dc1[_0x4bf9('0x47')],md5(_0x2d2dc1[_0x4bf9('0x47')]));}headers[_0x4bf9('0x48')]=getAuth(_0x2da80d);return getUser(_0x2da80d,_0x393635[_0x4bf9('0x49')])[_0x4bf9('0x1a')](function(_0x47459e){_0x445566=_0x47459e;logger[_0x4bf9('0xb')]('The\x20User\x20ID\x20is:',_0x445566['id']);return getEndUser(_0x2da80d,_0x2d2dc1[_0x4bf9('0x53')],_0x2d2dc1['destcalleridnum']);})['then'](function(_0x13af3f){_0x3a9830=_0x13af3f;logger['info']('The\x20Enduser\x20ID\x20is:',_0x3a9830['id']);return getTicket(_0x2da80d,_0x445566,_0x3a9830,_0x47bda3,_0x2d2dc1);})[_0x4bf9('0x1a')](function(_0x33ed73){if(_0x33ed73&&_0x33ed73['id']){logger['info'](_0x4bf9('0x1b'));logger[_0x4bf9('0xb')]('The\x20Ticket\x20ID\x20is:',_0x33ed73['id']);logger['info'](_0x4bf9('0x52'),_0x4bf9('0x4b'));emit(util[_0x4bf9('0xe')]('user:%s',_0x393635['name']),_0x4bf9('0x54'),{'uri':util['format'](_0x4bf9('0x4d'),_0x2da80d[_0x4bf9('0x1e')],_0x33ed73['id'])});}})[_0x4bf9('0x4e')](function(_0x48d632){logger[_0x4bf9('0x55')](_0x4bf9('0x52'),JSON['stringify'](_0x48d632));});};exports['unmanaged']=function(_0x956a0a,_0x57a518,_0x86ec9b,_0x421007,_0x805064,_0x1aaf2f){var _0x2ea1c3,_0x28ef3f;_0x1aaf2f[_0x4bf9('0x1e')]=intUtil[_0x4bf9('0x41')](_0x1aaf2f['remoteUri']);_0x1aaf2f[_0x4bf9('0x4f')]=intUtil[_0x4bf9('0x41')](_0x1aaf2f[_0x4bf9('0x4f')]);if(_0x805064&&_0x805064[_0x4bf9('0x42')]){logger[_0x4bf9('0xb')]('['+_0x57a518[_0x4bf9('0x56')][_0x4bf9('0x57')]()+']','Recording\x20is\x20enabled!');_0x57a518[_0x4bf9('0x45')]=util[_0x4bf9('0xe')](_0x4bf9('0x46'),_0x1aaf2f[_0x4bf9('0x4f')],_0x57a518[_0x4bf9('0x47')],md5(_0x57a518[_0x4bf9('0x47')]));}else{_0x57a518[_0x4bf9('0x45')]='';}headers[_0x4bf9('0x48')]=getAuth(_0x1aaf2f);return getUser(_0x1aaf2f,'')[_0x4bf9('0x1a')](function(_0x5a75eb){_0x2ea1c3=_0x5a75eb;logger[_0x4bf9('0xb')](_0x4bf9('0x58'),_0x2ea1c3['id']);return getEndUser(_0x1aaf2f,_0x57a518[_0x4bf9('0x10')],_0x57a518[_0x4bf9('0x11')]);})[_0x4bf9('0x1a')](function(_0x336366){_0x28ef3f=_0x336366;logger['info'](_0x4bf9('0x4a'),_0x28ef3f['id']);return getTicket(_0x1aaf2f,_0x2ea1c3,_0x28ef3f,_0x86ec9b,_0x57a518);})[_0x4bf9('0x1a')](function(_0x4965a5){if(_0x4965a5){logger[_0x4bf9('0xb')]('Ticket\x20created!');logger['info'](_0x4bf9('0x59'),_0x4965a5['id']);}})[_0x4bf9('0x4e')](function(_0x1d3aab){logger[_0x4bf9('0x55')]('['+_0x57a518[_0x4bf9('0x56')][_0x4bf9('0x57')]()+']',JSON[_0x4bf9('0x2e')](_0x1d3aab));});}; \ No newline at end of file +var _0x887b=['idField','content','variable','variableName','customVariable','Variable','push','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','lastevent','toUpperCase','Authorization','Ticket\x20created!','lodash','request-promise','util','ioredis','./util','../../../../config/logger','freshdesk','redis','defaults','application/json','Creating\x20new\x20ticket...','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Tags','name','Fields','custom_fields','mapValues','keyBy','value','format','%s/api/v2/tickets','remoteUri','POST','then','info','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','GET','forEach','includes','string','picklist','type','nameField','customField','toLowerCase'];(function(_0x15ee28,_0xac0b3d){var _0x1f03ec=function(_0x4eb9ce){while(--_0x4eb9ce){_0x15ee28['push'](_0x15ee28['shift']());}};_0x1f03ec(++_0xac0b3d);}(_0x887b,0x80));var _0xb887=function(_0x416e02,_0x5a8a45){_0x416e02=_0x416e02-0x0;var _0x532d2f=_0x887b[_0x416e02];return _0x532d2f;};'use strict';var _=require(_0xb887('0x0'));var rp=require(_0xb887('0x1'));var md5=require('md5');var util=require(_0xb887('0x2'));var Redis=require(_0xb887('0x3'));var intUtil=require(_0xb887('0x4'));var config=require('../../../../config/environment');var logger=require(_0xb887('0x5'))(_0xb887('0x6'));config[_0xb887('0x7')]=_[_0xb887('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb887('0x7')]));var headers={'Content-Type':_0xb887('0x9'),'Accept':'application/json'};function emit(_0x19b51b,_0x4030e3,_0x1f263a){io['to'](_0x19b51b)['emit'](_0x4030e3,_0x1f263a);}function getTicket(_0x3665c8,_0x3f8d3e,_0x5d78f5,_0x5e0abf,_0x2594e4){logger['info'](_0xb887('0xa'));var _0x175675=_['merge']({'responder_id':_0x3f8d3e['id'],'requester_id':_0x5d78f5['id'],'name':util['format'](_0xb887('0xb'),_0x2594e4[_0xb887('0xc')]),'phone':_0x2594e4[_0xb887('0xd')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xb887('0xe')](_0x5e0abf[_0xb887('0xf')],_0x2594e4,'\x20'),'description':intUtil[_0xb887('0xe')](_0x5e0abf['Descriptions'],_0x2594e4,'
'),'tags':getTags(_0x5e0abf[_0xb887('0x10')],_0xb887('0x11'))},getCustomFields(_0x5e0abf[_0xb887('0x12')],_0x2594e4));_0x175675[_0xb887('0x13')]=_[_0xb887('0x14')](_[_0xb887('0x15')](_0x175675[_0xb887('0x13')],'id'),_0xb887('0x16'));return request({'uri':util[_0xb887('0x17')](_0xb887('0x18'),_0x3665c8[_0xb887('0x19')]),'method':_0xb887('0x1a'),'body':_0x175675})[_0xb887('0x1b')](function(_0x1055f8){logger[_0xb887('0x1c')]('Ticket\x20created!');return _0x1055f8;});}function getUser(_0x583a74,_0xcc6060){if(intUtil[_0xb887('0x1d')](_0xcc6060)){return request({'uri':util[_0xb887('0x17')](_0xb887('0x1e'),_0x583a74[_0xb887('0x19')]),'qs':{'email':_0xcc6060}})[_0xb887('0x1b')](function(_0x2dde38){if(_0x2dde38[_0xb887('0x1f')]){logger[_0xb887('0x1c')](_0xb887('0x20'));return _[_0xb887('0x21')](_0x2dde38,function(_0x541698){return _0x541698[_0xb887('0x22')][_0xb887('0x23')]===_0xcc6060;});}else{logger[_0xb887('0x1c')](_0xb887('0x24'));return request({'uri':util[_0xb887('0x17')](_0xb887('0x25'),_0x583a74['remoteUri'])})[_0xb887('0x1b')](function(_0x1f6074){logger[_0xb887('0x1c')](_0xb887('0x26'));return _0x1f6074;});}});}else{logger[_0xb887('0x1c')](_0xb887('0x27'));return request({'uri':util[_0xb887('0x17')](_0xb887('0x25'),_0x583a74[_0xb887('0x19')])})['then'](function(_0x45bc42){logger[_0xb887('0x1c')]('Admin\x20account\x20selected.');return _0x45bc42;});}}function getEndUser(_0x2d7053,_0x59483f,_0x1d53b4){logger[_0xb887('0x1c')]('Searching\x20enduser\x20with\x20phone',_0x1d53b4);return request({'uri':util[_0xb887('0x17')](_0xb887('0x28'),_0x2d7053['remoteUri']),'qs':{'phone':_0x1d53b4}})[_0xb887('0x1b')](function(_0x49cb5f){if(_0x49cb5f[_0xb887('0x1f')]){logger[_0xb887('0x1c')](_0xb887('0x29'));return _[_0xb887('0x21')](_0x49cb5f,{'phone':_0x1d53b4});}else{logger[_0xb887('0x1c')](_0xb887('0x2a'));return request({'uri':util[_0xb887('0x17')](_0xb887('0x28'),_0x2d7053[_0xb887('0x19')]),'method':_0xb887('0x1a'),'body':{'name':_0x59483f,'phone':_0x1d53b4}})[_0xb887('0x1b')](function(_0x5b3439){logger[_0xb887('0x1c')](_0xb887('0x2b'));return _0x5b3439;});}});}function getAuth(_0x27aa16){return util[_0xb887('0x17')](_0xb887('0x2c'),new Buffer(_0x27aa16[_0xb887('0x2d')]+':X')[_0xb887('0x2e')](_0xb887('0x2f')));}function request(_0x9da347){logger[_0xb887('0x30')](_0xb887('0x31'),JSON[_0xb887('0x32')](_0x9da347));return rp(_[_0xb887('0x8')](_0x9da347,{'method':_0xb887('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x5c39d0,_0x20ff0b){var _0xeed93a=[];if(_0x5c39d0&&_0x5c39d0[_0xb887('0x1f')]>0x0){_0xeed93a=_['map'](_0x5c39d0,_0x20ff0b);}return _0xeed93a;}function getCustomFields(_0x37fc3c,_0x23b619){var _0x1e310b=[];var _0x16acbe={'custom_fields':[]};if(_0x37fc3c['length']>0x0){_[_0xb887('0x34')](_0x37fc3c,function(_0x31062c){if(_[_0xb887('0x35')]([_0xb887('0x36'),_0xb887('0x37')],_0x31062c[_0xb887('0x38')])&&_0x31062c[_0xb887('0x39')]&&!_0x31062c[_0xb887('0x3a')]){_0x16acbe[_0x31062c[_0xb887('0x39')][_0xb887('0x3b')]()]=_0x31062c['content'][_0xb887('0x2e')]();}else if(_[_0xb887('0x35')](['string',_0xb887('0x37')],_0x31062c['type'])&&_0x31062c[_0xb887('0x3c')]&&_0x31062c[_0xb887('0x3a')]){_0x16acbe[_0xb887('0x13')]['push']({'id':_0x31062c[_0xb887('0x3c')],'value':_0x31062c[_0xb887('0x3d')][_0xb887('0x2e')]()});}else if(_0x31062c[_0xb887('0x38')]===_0xb887('0x3e')&&_0x31062c['variableName']&&_0x31062c[_0xb887('0x3c')]&&_0x31062c[_0xb887('0x3a')]){_0x23b619[_0x31062c[_0xb887('0x3f')]]&&_0x16acbe[_0xb887('0x13')]['push']({'id':_0x31062c['idField'],'value':_0x23b619[_0x31062c['variableName']][_0xb887('0x2e')]()});}else if(_0x31062c['type']===_0xb887('0x40')&&_0x31062c[_0xb887('0x41')]&&_0x31062c[_0xb887('0x41')]['name']&&_0x31062c[_0xb887('0x3c')]&&_0x31062c[_0xb887('0x3a')]){_0x23b619[_0x31062c['Variable']['name'][_0xb887('0x3b')]()]&&_0x16acbe[_0xb887('0x13')][_0xb887('0x42')]({'id':_0x31062c[_0xb887('0x3c')],'value':_0x23b619[_0x31062c[_0xb887('0x41')][_0xb887('0x11')][_0xb887('0x3b')]()][_0xb887('0x2e')]()});}});}return _0x16acbe;}exports[_0xb887('0x43')]=function(_0x53a90c,_0x49e584,_0x36085c,_0x241b84,_0x13a6e5,_0x3249bb){var _0x34a5de,_0x3c70d8;_0x3249bb[_0xb887('0x19')]=intUtil[_0xb887('0x44')](_0x3249bb[_0xb887('0x19')]);_0x3249bb[_0xb887('0x45')]=intUtil[_0xb887('0x44')](_0x3249bb['serverUrl']);if(_0x13a6e5&&_0x13a6e5[_0xb887('0x46')]){logger[_0xb887('0x1c')](_0xb887('0x47'),'Recording\x20is\x20enabled!');_0x49e584['recordingURL']=util[_0xb887('0x17')](_0xb887('0x48'),_0x3249bb[_0xb887('0x45')],_0x49e584[_0xb887('0x49')],md5(_0x49e584[_0xb887('0x49')]));}else{_0x49e584[_0xb887('0x4a')]='';}headers['Authorization']=getAuth(_0x3249bb);return getUser(_0x3249bb,_0x241b84[_0xb887('0x23')])[_0xb887('0x1b')](function(_0x5732f2){_0x34a5de=_0x5732f2;logger[_0xb887('0x1c')](_0xb887('0x4b'),_0x34a5de['id']);return getEndUser(_0x3249bb,_0x49e584['calleridname'],_0x49e584['calleridnum']);})[_0xb887('0x1b')](function(_0x1cdf48){_0x3c70d8=_0x1cdf48;logger[_0xb887('0x1c')](_0xb887('0x4c'),_0x3c70d8['id']);return getTicket(_0x3249bb,_0x34a5de,_0x3c70d8,_0x36085c,_0x49e584);})['then'](function(_0x1adc32){if(_0x1adc32&&_0x1adc32['id']){logger[_0xb887('0x1c')]('Ticket\x20created!');logger[_0xb887('0x1c')](_0xb887('0x4d'),_0x1adc32['id']);logger[_0xb887('0x1c')](_0xb887('0x47'),_0xb887('0x4e'));emit(util[_0xb887('0x17')](_0xb887('0x4f'),_0x241b84[_0xb887('0x11')]),_0xb887('0x50'),{'uri':util[_0xb887('0x17')](_0xb887('0x51'),_0x3249bb[_0xb887('0x19')],_0x1adc32['id'])});}})[_0xb887('0x52')](function(_0x3eef5f){logger[_0xb887('0x53')]('[QUEUE]',JSON[_0xb887('0x32')](_0x3eef5f));});};exports[_0xb887('0x54')]=function(_0x2ab6ac,_0x53f6d5,_0x492518,_0x2b5d69,_0x41a3dd,_0x6b591d,_0x12b6e7){var _0x473f9e,_0x37f2dd;_0x6b591d['remoteUri']=intUtil['stripTrailingSlash'](_0x6b591d[_0xb887('0x19')]);_0x6b591d[_0xb887('0x45')]=intUtil[_0xb887('0x44')](_0x6b591d[_0xb887('0x45')]);if(_0x12b6e7&&_0x12b6e7['recordingFormat']&&_0x12b6e7[_0xb887('0x55')]!=='none'){logger[_0xb887('0x1c')](_0xb887('0x56'),_0xb887('0x57'));_0x53f6d5[_0xb887('0x4a')]=util['format'](_0xb887('0x48'),_0x6b591d[_0xb887('0x45')],_0x53f6d5[_0xb887('0x49')],md5(_0x53f6d5[_0xb887('0x49')]));}headers['Authorization']=getAuth(_0x6b591d);return getUser(_0x6b591d,_0x2b5d69[_0xb887('0x23')])['then'](function(_0x385d7a){_0x473f9e=_0x385d7a;logger[_0xb887('0x1c')](_0xb887('0x4b'),_0x473f9e['id']);return getEndUser(_0x6b591d,_0x53f6d5[_0xb887('0x58')],_0x53f6d5[_0xb887('0x59')]);})[_0xb887('0x1b')](function(_0x17d3ed){_0x37f2dd=_0x17d3ed;logger[_0xb887('0x1c')](_0xb887('0x4c'),_0x37f2dd['id']);return getTicket(_0x6b591d,_0x473f9e,_0x37f2dd,_0x492518,_0x53f6d5);})['then'](function(_0x304191){if(_0x304191&&_0x304191['id']){logger[_0xb887('0x1c')]('Ticket\x20created!');logger['info'](_0xb887('0x4d'),_0x304191['id']);logger['info'](_0xb887('0x56'),_0xb887('0x4e'));emit(util[_0xb887('0x17')]('user:%s',_0x2b5d69[_0xb887('0x11')]),_0xb887('0x50'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x6b591d[_0xb887('0x19')],_0x304191['id'])});}})['catch'](function(_0x14aa2a){logger[_0xb887('0x53')]('[OUTBOUND]',JSON[_0xb887('0x32')](_0x14aa2a));});};exports['unmanaged']=function(_0x5397c8,_0x34d431,_0x693f2e,_0x3ef2df,_0x13623c,_0x4f80d2){var _0x47fa7f,_0xb8d3bd;_0x4f80d2[_0xb887('0x19')]=intUtil[_0xb887('0x44')](_0x4f80d2[_0xb887('0x19')]);_0x4f80d2[_0xb887('0x45')]=intUtil[_0xb887('0x44')](_0x4f80d2[_0xb887('0x45')]);if(_0x13623c&&_0x13623c[_0xb887('0x46')]){logger[_0xb887('0x1c')]('['+_0x34d431[_0xb887('0x5a')][_0xb887('0x5b')]()+']',_0xb887('0x57'));_0x34d431['recordingURL']=util['format'](_0xb887('0x48'),_0x4f80d2['serverUrl'],_0x34d431[_0xb887('0x49')],md5(_0x34d431['uniqueid']));}else{_0x34d431[_0xb887('0x4a')]='';}headers[_0xb887('0x5c')]=getAuth(_0x4f80d2);return getUser(_0x4f80d2,'')['then'](function(_0x42af68){_0x47fa7f=_0x42af68;logger[_0xb887('0x1c')](_0xb887('0x4b'),_0x47fa7f['id']);return getEndUser(_0x4f80d2,_0x34d431[_0xb887('0xc')],_0x34d431[_0xb887('0xd')]);})[_0xb887('0x1b')](function(_0x4e4679){_0xb8d3bd=_0x4e4679;logger['info'](_0xb887('0x4c'),_0xb8d3bd['id']);return getTicket(_0x4f80d2,_0x47fa7f,_0xb8d3bd,_0x693f2e,_0x34d431);})[_0xb887('0x1b')](function(_0x311e40){if(_0x311e40){logger[_0xb887('0x1c')](_0xb887('0x5d'));logger[_0xb887('0x1c')](_0xb887('0x4d'),_0x311e40['id']);}})['catch'](function(_0x7afe5a){logger[_0xb887('0x53')]('['+_0x34d431['lastevent']['toUpperCase']()+']',JSON[_0xb887('0x32')](_0x7afe5a));});}; \ 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 7d8c27e..389a28a 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 _0xb75a=['calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','util','moment','bluebird','ioredis','../../../../config/environment','../../../../config/logger','freshsales','defaults','socket.io-emitter','redis','GET','/api/selector/owners','headers','info','then','users','length','email','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','adminEmail','catch','/api/lookup?q=','&entities=contact','contacts','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','/api/tasks','Subjects','getString','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','destcalleridnum'];(function(_0x5b791d,_0x49cc81){var _0xdd1c36=function(_0x46f98b){while(--_0x46f98b){_0x5b791d['push'](_0x5b791d['shift']());}};_0xdd1c36(++_0x49cc81);}(_0xb75a,0x15e));var _0xab75=function(_0x483f52,_0x8466d7){_0x483f52=_0x483f52-0x0;var _0x1b9605=_0xb75a[_0x483f52];return _0x1b9605;};'use strict';var _=require(_0xab75('0x0'));var rp=require(_0xab75('0x1'));var md5=require(_0xab75('0x2'));var util=require(_0xab75('0x3'));var moment=require(_0xab75('0x4'));var Promise=require(_0xab75('0x5'));var Redis=require(_0xab75('0x6'));var intUtil=require('./util');var config=require(_0xab75('0x7'));var logger=require(_0xab75('0x8'))(_0xab75('0x9'));config['redis']=_[_0xab75('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xab75('0xb'))(new Redis(config[_0xab75('0xc')]));function getAdminId(_0xb33e69,_0x2eafdc,_0xef6f2e,_0x505ff2){return new Promise(function(_0x1828bb,_0x3bfc66){var _0x12d207=![];var _0x845f6d={'method':_0xab75('0xd'),'uri':_0x505ff2+_0xab75('0xe'),'json':!![]};_0x845f6d[_0xab75('0xf')]=_0xef6f2e;logger[_0xab75('0x10')]('Getting\x20admin\x20information');return rp(_0x845f6d)[_0xab75('0x11')](function(_0x580ec8){if(_0x580ec8){var _0x3b1b6a=_0x580ec8[_0xab75('0x12')];var _0x3dc74f=null;for(_0x3dc74f=0x0;_0x3dc74f<_0x3b1b6a[_0xab75('0x13')];_0x3dc74f++){if(_0x3b1b6a[_0x3dc74f][_0xab75('0x14')]===_0xb33e69['adminEmail']){_0xb33e69['adminId']=_0x3b1b6a[_0x3dc74f]['id'];_0x12d207=!![];}}if(_0x12d207){logger[_0xab75('0x10')](_0xab75('0x15'),_0xb33e69[_0xab75('0x16')]);_0x1828bb(_0xb33e69);}else{_0x3bfc66({'statusCode':0x194,'message':_0xab75('0x17')});}}else{_0x3bfc66({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x30cea7){logger[_0xab75('0x18')]('['+[_0x2eafdc[_0xab75('0x19')]()]+']',_0x30cea7[_0xab75('0x1a')]);_0x3bfc66(_0x30cea7);});});}function getUser(_0x5029ac,_0x5c9f63,_0x2fc805){return function(_0x419f5e){return new Promise(function(_0x47c81f,_0x23aa67){var _0x38e493={'method':_0xab75('0xd'),'uri':_0x2fc805+_0xab75('0xe'),'json':!![]};_0x38e493[_0xab75('0xf')]=_0x5c9f63;logger['info'](_0xab75('0x1b'));return rp(_0x38e493)[_0xab75('0x11')](function(_0x8b7a40){if(_0x8b7a40){var _0x459dec=_0x8b7a40[_0xab75('0x12')];var _0xf2f8d9=![];var _0x45e018=null;if(_0x419f5e[_0xab75('0x1c')]!==null){logger['info'](_0xab75('0x1d'),_0x419f5e[_0xab75('0x1c')]);_0x419f5e[_0xab75('0x1e')]=_0x419f5e['agentEmail'];for(_0x45e018=0x0;_0x45e018<_0x459dec[_0xab75('0x13')];_0x45e018++){if(_0x459dec[_0x45e018][_0xab75('0x14')]===_0x419f5e[_0xab75('0x1c')]){_0xf2f8d9=!![];_0x419f5e[_0xab75('0x1f')]=_0x459dec[_0x45e018]['id'];logger[_0xab75('0x10')](_0xab75('0x20'),_0x419f5e[_0xab75('0x1f')]);}}}if(!_0xf2f8d9){logger['info'](_0xab75('0x21'));_0x419f5e[_0xab75('0x1e')]=_0x419f5e[_0xab75('0x22')];_0x419f5e['userId']=_0x419f5e[_0xab75('0x16')];_0xf2f8d9=!![];}if(_0xf2f8d9){_0x47c81f(_0x419f5e);}else{_0x23aa67({'statusCode':0x194,'message':_0xab75('0x17')});}}else{_0x23aa67({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xab75('0x23')](function(_0x4dc59b){logger[_0xab75('0x18')]('['+[_0x5029ac[_0xab75('0x19')]()]+']',_0x4dc59b[_0xab75('0x1a')]);_0x23aa67(_0x4dc59b);});});};}function searchContact(_0x14e210,_0x4db3ae,_0x3dca83,_0x9c740c){return new Promise(function(_0x411fca,_0x4fd47d){var _0x5755e7={'method':'GET','headers':_0x4db3ae,'uri':_0x14e210+_0xab75('0x24')+_0x9c740c+'&f='+_0x3dca83+_0xab75('0x25'),'json':!![]};rp(_0x5755e7)[_0xab75('0x11')](function(_0x349ba1){var _0x3d4117=_['find'](_0x349ba1[_0xab75('0x26')][_0xab75('0x26')],[_0x3dca83,_0x9c740c]);_0x411fca(_0x3d4117);})[_0xab75('0x23')](function(_0x205b0d){_0x4fd47d(_0x205b0d);});});}function getEndUser(_0x4d5cc4,_0x2541bd,_0x114d71){return function(_0x49ba74){return new Promise(function(_0x50a86d,_0x2de820){logger[_0xab75('0x10')](util[_0xab75('0x27')]('Searching\x20contact\x20with\x20phone\x20%s',_0x49ba74[_0xab75('0x28')]));searchContact(_0x114d71,_0x2541bd,_0xab75('0x29'),_0x49ba74['contactNumber'])['then'](function(_0x4ff27c){if(_0x4ff27c){_0x49ba74[_0xab75('0x2a')]=_0x4ff27c['id'];logger[_0xab75('0x10')](_0xab75('0x2b'),_0x49ba74['endUserId']);return _0x50a86d(_0x49ba74);}searchContact(_0x114d71,_0x2541bd,'work_number',_0x49ba74[_0xab75('0x28')])[_0xab75('0x11')](function(_0x593b28){if(_0x593b28){_0x49ba74['endUserId']=_0x593b28['id'];logger['info'](_0xab75('0x2c'),_0x49ba74[_0xab75('0x2a')]);return _0x50a86d(_0x49ba74);}createEndUser(_0x49ba74,_0x4d5cc4,_0x2541bd,_0x114d71)[_0xab75('0x11')](function(_0x52b012){logger[_0xab75('0x10')]('Contact\x20created:',_0x52b012['endUserId']);return _0x50a86d(_0x52b012);});});})[_0xab75('0x23')](function(_0x5b6770){_0x2de820(_0x5b6770);});});};}function createEndUser(_0x1f4bb3,_0x346e05,_0x3471ed,_0x304c54){return new Promise(function(_0x2af886,_0x53d9e0){var _0x46d4ce=moment();var _0x4def3d={'method':_0xab75('0x2d'),'uri':_0x304c54+_0xab75('0x2e'),'body':{'contact':{'last_name':_0x1f4bb3[_0xab75('0x28')],'work_number':_0x1f4bb3['contactNumber'],'mobile_number':_0x1f4bb3[_0xab75('0x28')],'owner_id':_0x1f4bb3[_0xab75('0x1f')],'created_at':_0x46d4ce[_0xab75('0x27')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x4def3d[_0xab75('0xf')]=_0x3471ed;logger['info'](_0xab75('0x2f'));return rp(_0x4def3d)['then'](function(_0xf8cbb8){_0x1f4bb3['endUserId']=_0xf8cbb8[_0xab75('0x30')]['id'];_0x2af886(_0x1f4bb3);})[_0xab75('0x23')](function(_0xbba462){logger[_0xab75('0x18')]('['+[_0x346e05[_0xab75('0x19')]()]+']',_0xbba462[_0xab75('0x1a')]);_0x53d9e0(_0xbba462[_0xab75('0x1a')]);});});}function getTicket(_0x3fd86f,_0x16005b,_0x4105e4,_0x13785d,_0x146749){return function(_0x111b40){logger[_0xab75('0x10')]('Creating\x20new\x20task');return new Promise(function(_0x491012,_0x2d88ad){var _0x21a37c=moment();var _0x5180f0={'method':_0xab75('0x2d'),'uri':_0x4105e4+_0xab75('0x31'),'body':{'title':intUtil['getString'](_0x13785d[_0xab75('0x32')],_0x146749,'\x20'),'description':intUtil[_0xab75('0x33')](_0x13785d[_0xab75('0x34')],_0x146749,'\x0a'),'owner_id':_0x111b40[_0xab75('0x1f')],'creater_id':_0x111b40[_0xab75('0x16')],'targetable_id':_0x111b40['endUserId'],'targetable_type':_0xab75('0x35'),'created_at':_0x21a37c[_0xab75('0x27')](_0xab75('0x36')),'due_date':_0x21a37c[_0xab75('0x37')](0x1e,'m')[_0xab75('0x27')](_0xab75('0x36'))},'json':!![]};_0x5180f0[_0xab75('0xf')]=_0x16005b;return rp(_0x5180f0)[_0xab75('0x11')](function(_0x3d4d1f){_0x111b40[_0xab75('0x38')]=_0x3d4d1f[_0xab75('0x39')]['id'];logger[_0xab75('0x10')](_0xab75('0x3a'),_0x111b40[_0xab75('0x38')]);_0x491012(_0x111b40);})[_0xab75('0x23')](function(_0x3d85c5){logger[_0xab75('0x18')]('['+[_0x3fd86f[_0xab75('0x19')]()]+']',_0x3d85c5[_0xab75('0x1a')]);_0x2d88ad(_0x3d85c5[_0xab75('0x1a')]);});});};}function emit(_0x336700,_0x1f1a8b,_0x30b682){var _0x1e5503={'uri':_0x336700+_0xab75('0x3b')+_0x30b682};io['to'](util[_0xab75('0x27')](_0xab75('0x3c'),_0x1f1a8b))[_0xab75('0x3d')]('trigger:browser:url',_0x1e5503);}exports['cs']=function(_0x508e48,_0x33ccce,_0x1fac22,_0x277f62,_0x44dee8,_0x53ab63,_0x1bb450,_0x4577c9){var _0x221be8={};var _0x5847a8={'Authorization':_0xab75('0x3e')+_0x53ab63[_0xab75('0x3f')]};_0x53ab63[_0xab75('0x40')]=intUtil[_0xab75('0x41')](_0x53ab63[_0xab75('0x40')]);_0x53ab63[_0xab75('0x42')]=intUtil[_0xab75('0x41')](_0x53ab63[_0xab75('0x42')]);var _0x20012c=_0x53ab63[_0xab75('0x40')];_0x221be8['adminEmail']=_0x53ab63['username'];_0x221be8[_0xab75('0x28')]=_0x4577c9[_0xab75('0x43')]()===_0xab75('0x44')?_0x33ccce[_0xab75('0x45')]:_0x33ccce[_0xab75('0x46')];_0x221be8[_0xab75('0x47')]=_0x4577c9===_0xab75('0x48')||_0x4577c9===_0xab75('0x49')?'queue':'outbound';if(_0x277f62){_0x221be8[_0xab75('0x1c')]=_0x277f62[_0xab75('0x14')];}var _0x5d4703=util[_0xab75('0x27')](_0xab75('0x4a'),_0x53ab63[_0xab75('0x42')],_0x33ccce[_0xab75('0x4b')],md5(_0x33ccce[_0xab75('0x4b')]));if(_0x44dee8&&_0x44dee8[_0xab75('0x4c')]){logger[_0xab75('0x10')]('[QUEUE]',_0xab75('0x4d'));_0x33ccce[_0xab75('0x4e')]=_0x5d4703;}else if(_0x1bb450&&_0x1bb450[_0xab75('0x4f')]&&_0x1bb450[_0xab75('0x4f')]!=='none'){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x33ccce[_0xab75('0x4e')]=_0x5d4703;}else{_0x33ccce['recordingURL']='';}return getAdminId(_0x221be8,_0x4577c9,_0x5847a8,_0x20012c)[_0xab75('0x11')](getUser(_0x4577c9,_0x5847a8,_0x20012c))['then'](getEndUser(_0x4577c9,_0x5847a8,_0x20012c))[_0xab75('0x11')](getTicket(_0x4577c9,_0x5847a8,_0x20012c,_0x1fac22,_0x33ccce))['then'](function(_0x40c2d8){logger[_0xab75('0x10')](util[_0xab75('0x27')](_0xab75('0x50'),_0x40c2d8[_0xab75('0x38')]));if(_0x4577c9!==_0xab75('0x49')){logger[_0xab75('0x10')]('['+[_0x4577c9[_0xab75('0x19')]()]+']',_0xab75('0x51'));emit(_0x20012c,_0x277f62[_0xab75('0x52')],_0x40c2d8[_0xab75('0x2a')]);}})['catch'](function(_0x43d2ad){logger[_0xab75('0x18')]('['+[_0x4577c9['toUpperCase']()]+_0xab75('0x53'),util['inspect'](_0x43d2ad,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x9002=['Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','add','task','Task\x20created:','/contacts/','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','destcalleridnum','calleridnum','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','ticketId','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','md5','util','moment','bluebird','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','/api/selector/owners','headers','info','Getting\x20admin\x20information','users','length','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','toUpperCase','message','GET','Getting\x20user\x20list','then','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','catch','error','&f=','&entities=contact','find','contacts','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss'];(function(_0x2136a6,_0x35af63){var _0x55b948=function(_0x288a75){while(--_0x288a75){_0x2136a6['push'](_0x2136a6['shift']());}};_0x55b948(++_0x35af63);}(_0x9002,0x7a));var _0x2900=function(_0x55bb5f,_0x40442a){_0x55bb5f=_0x55bb5f-0x0;var _0x3621cf=_0x9002[_0x55bb5f];return _0x3621cf;};'use strict';var _=require(_0x2900('0x0'));var rp=require('request-promise');var md5=require(_0x2900('0x1'));var util=require(_0x2900('0x2'));var moment=require(_0x2900('0x3'));var Promise=require(_0x2900('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x2900('0x5'))(_0x2900('0x6'));config[_0x2900('0x7')]=_[_0x2900('0x8')](config[_0x2900('0x7')],{'host':_0x2900('0x9'),'port':0x18eb});var io=require(_0x2900('0xa'))(new Redis(config[_0x2900('0x7')]));function getAdminId(_0x4c9699,_0x67ab57,_0x150b8b,_0x59cae7){return new Promise(function(_0x28d108,_0x58d78f){var _0x2e50c9=![];var _0x47c50c={'method':'GET','uri':_0x59cae7+_0x2900('0xb'),'json':!![]};_0x47c50c[_0x2900('0xc')]=_0x150b8b;logger[_0x2900('0xd')](_0x2900('0xe'));return rp(_0x47c50c)['then'](function(_0x137ea0){if(_0x137ea0){var _0x3c7dbd=_0x137ea0[_0x2900('0xf')];var _0x442f39=null;for(_0x442f39=0x0;_0x442f39<_0x3c7dbd[_0x2900('0x10')];_0x442f39++){if(_0x3c7dbd[_0x442f39][_0x2900('0x11')]===_0x4c9699[_0x2900('0x12')]){_0x4c9699[_0x2900('0x13')]=_0x3c7dbd[_0x442f39]['id'];_0x2e50c9=!![];}}if(_0x2e50c9){logger[_0x2900('0xd')]('Admin\x20found:',_0x4c9699['adminId']);_0x28d108(_0x4c9699);}else{_0x58d78f({'statusCode':0x194,'message':_0x2900('0x14')});}}else{_0x58d78f({'statusCode':0x194,'message':_0x2900('0x14')});}})['catch'](function(_0x4da0a7){logger['error']('['+[_0x67ab57[_0x2900('0x15')]()]+']',_0x4da0a7[_0x2900('0x16')]);_0x58d78f(_0x4da0a7);});});}function getUser(_0x4e21c7,_0x394125,_0x9e37ca){return function(_0x437879){return new Promise(function(_0x8d7723,_0x233d17){var _0xc95a71={'method':_0x2900('0x17'),'uri':_0x9e37ca+_0x2900('0xb'),'json':!![]};_0xc95a71[_0x2900('0xc')]=_0x394125;logger[_0x2900('0xd')](_0x2900('0x18'));return rp(_0xc95a71)[_0x2900('0x19')](function(_0x41149d){if(_0x41149d){var _0x18a7ed=_0x41149d[_0x2900('0xf')];var _0x3d7746=![];var _0x52dede=null;if(_0x437879[_0x2900('0x1a')]!==null){logger[_0x2900('0xd')]('Getting\x20user\x20with\x20email',_0x437879[_0x2900('0x1a')]);_0x437879[_0x2900('0x1b')]=_0x437879[_0x2900('0x1a')];for(_0x52dede=0x0;_0x52dede<_0x18a7ed[_0x2900('0x10')];_0x52dede++){if(_0x18a7ed[_0x52dede][_0x2900('0x11')]===_0x437879['agentEmail']){_0x3d7746=!![];_0x437879[_0x2900('0x1c')]=_0x18a7ed[_0x52dede]['id'];logger['info'](_0x2900('0x1d'),_0x437879[_0x2900('0x1c')]);}}}if(!_0x3d7746){logger[_0x2900('0xd')](_0x2900('0x1e'));_0x437879['userEmail']=_0x437879[_0x2900('0x12')];_0x437879['userId']=_0x437879[_0x2900('0x13')];_0x3d7746=!![];}if(_0x3d7746){_0x8d7723(_0x437879);}else{_0x233d17({'statusCode':0x194,'message':_0x2900('0x14')});}}else{_0x233d17({'statusCode':0x194,'message':_0x2900('0x14')});}})[_0x2900('0x1f')](function(_0x50c6e5){logger[_0x2900('0x20')]('['+[_0x4e21c7[_0x2900('0x15')]()]+']',_0x50c6e5[_0x2900('0x16')]);_0x233d17(_0x50c6e5);});});};}function searchContact(_0x55c99d,_0xc24bad,_0x1cdb66,_0x143a41){return new Promise(function(_0x550ced,_0x29620f){var _0x2b673c={'method':_0x2900('0x17'),'headers':_0xc24bad,'uri':_0x55c99d+'/api/lookup?q='+_0x143a41+_0x2900('0x21')+_0x1cdb66+_0x2900('0x22'),'json':!![]};rp(_0x2b673c)[_0x2900('0x19')](function(_0x5a9dfb){var _0x509b6c=_[_0x2900('0x23')](_0x5a9dfb[_0x2900('0x24')]['contacts'],[_0x1cdb66,_0x143a41]);_0x550ced(_0x509b6c);})[_0x2900('0x1f')](function(_0x1769b4){_0x29620f(_0x1769b4);});});}function getEndUser(_0x5f0be4,_0x31cb7f,_0x3ceed5){return function(_0x5e3614){return new Promise(function(_0x2f9cbb,_0x91267e){logger[_0x2900('0xd')](util[_0x2900('0x25')]('Searching\x20contact\x20with\x20phone\x20%s',_0x5e3614[_0x2900('0x26')]));searchContact(_0x3ceed5,_0x31cb7f,_0x2900('0x27'),_0x5e3614[_0x2900('0x26')])[_0x2900('0x19')](function(_0x4da621){if(_0x4da621){_0x5e3614[_0x2900('0x28')]=_0x4da621['id'];logger[_0x2900('0xd')](_0x2900('0x29'),_0x5e3614['endUserId']);return _0x2f9cbb(_0x5e3614);}searchContact(_0x3ceed5,_0x31cb7f,_0x2900('0x2a'),_0x5e3614[_0x2900('0x26')])[_0x2900('0x19')](function(_0x2c50eb){if(_0x2c50eb){_0x5e3614[_0x2900('0x28')]=_0x2c50eb['id'];logger[_0x2900('0xd')](_0x2900('0x2b'),_0x5e3614['endUserId']);return _0x2f9cbb(_0x5e3614);}createEndUser(_0x5e3614,_0x5f0be4,_0x31cb7f,_0x3ceed5)[_0x2900('0x19')](function(_0x2ab553){logger['info'](_0x2900('0x2c'),_0x2ab553[_0x2900('0x28')]);return _0x2f9cbb(_0x2ab553);});});})[_0x2900('0x1f')](function(_0x3313e6){_0x91267e(_0x3313e6);});});};}function createEndUser(_0x149ad9,_0x16d847,_0x592b03,_0x8f91dd){return new Promise(function(_0x34b534,_0xcafd38){var _0x585afe=moment();var _0x541ca5={'method':_0x2900('0x2d'),'uri':_0x8f91dd+_0x2900('0x2e'),'body':{'contact':{'last_name':_0x149ad9[_0x2900('0x26')],'work_number':_0x149ad9['contactNumber'],'mobile_number':_0x149ad9['contactNumber'],'owner_id':_0x149ad9['userId'],'created_at':_0x585afe[_0x2900('0x25')](_0x2900('0x2f'))}},'json':!![]};_0x541ca5[_0x2900('0xc')]=_0x592b03;logger['info'](_0x2900('0x30'));return rp(_0x541ca5)['then'](function(_0x2ab0bc){_0x149ad9[_0x2900('0x28')]=_0x2ab0bc[_0x2900('0x31')]['id'];_0x34b534(_0x149ad9);})['catch'](function(_0x5b8774){logger[_0x2900('0x20')]('['+[_0x16d847['toUpperCase']()]+']',_0x5b8774[_0x2900('0x16')]);_0xcafd38(_0x5b8774[_0x2900('0x16')]);});});}function getTicket(_0xb4d37f,_0x44c57c,_0x1f8fd5,_0x19b43d,_0xd90313){return function(_0x480013){logger[_0x2900('0xd')](_0x2900('0x32'));return new Promise(function(_0x1dcbc0,_0x1994bb){var _0x4149dc=moment();var _0x320cc4={'method':_0x2900('0x2d'),'uri':_0x1f8fd5+_0x2900('0x33'),'body':{'title':intUtil['getString'](_0x19b43d['Subjects'],_0xd90313,'\x20'),'description':intUtil[_0x2900('0x34')](_0x19b43d['Descriptions'],_0xd90313,'\x0a'),'owner_id':_0x480013[_0x2900('0x1c')],'creater_id':_0x480013[_0x2900('0x13')],'targetable_id':_0x480013['endUserId'],'targetable_type':'Contact','created_at':_0x4149dc[_0x2900('0x25')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x4149dc[_0x2900('0x35')](0x1e,'m')[_0x2900('0x25')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x320cc4[_0x2900('0xc')]=_0x44c57c;return rp(_0x320cc4)[_0x2900('0x19')](function(_0x4e3a4c){_0x480013['ticketId']=_0x4e3a4c[_0x2900('0x36')]['id'];logger[_0x2900('0xd')](_0x2900('0x37'),_0x480013['ticketId']);_0x1dcbc0(_0x480013);})['catch'](function(_0x1f814c){logger[_0x2900('0x20')]('['+[_0xb4d37f['toUpperCase']()]+']',_0x1f814c[_0x2900('0x16')]);_0x1994bb(_0x1f814c['message']);});});};}function emit(_0xf5e77b,_0x5f657b,_0x4f6839){var _0x5a2d14={'uri':_0xf5e77b+_0x2900('0x38')+_0x4f6839};io['to'](util['format'](_0x2900('0x39'),_0x5f657b))['emit'](_0x2900('0x3a'),_0x5a2d14);}exports['cs']=function(_0x1d5764,_0x23d197,_0x44ccf0,_0x4e75cf,_0x149060,_0x5861fe,_0x3bf0f7,_0x74b295){var _0x35062a={};var _0x122999={'Authorization':_0x2900('0x3b')+_0x5861fe[_0x2900('0x3c')]};_0x5861fe[_0x2900('0x3d')]=intUtil[_0x2900('0x3e')](_0x5861fe[_0x2900('0x3d')]);_0x5861fe[_0x2900('0x3f')]=intUtil['stripTrailingSlash'](_0x5861fe[_0x2900('0x3f')]);var _0x596691=_0x5861fe[_0x2900('0x3d')];_0x35062a[_0x2900('0x12')]=_0x5861fe[_0x2900('0x40')];_0x35062a[_0x2900('0x26')]=_0x74b295[_0x2900('0x41')]()==='outbound'?_0x23d197[_0x2900('0x42')]:_0x23d197[_0x2900('0x43')];_0x35062a['callDirection']=_0x74b295===_0x2900('0x44')||_0x74b295===_0x2900('0x45')?_0x2900('0x44'):_0x2900('0x46');if(_0x4e75cf){_0x35062a[_0x2900('0x1a')]=_0x4e75cf['email'];}var _0x3a287b=util[_0x2900('0x25')](_0x2900('0x47'),_0x5861fe[_0x2900('0x3f')],_0x23d197[_0x2900('0x48')],md5(_0x23d197[_0x2900('0x48')]));if(_0x149060&&_0x149060[_0x2900('0x49')]){logger['info'](_0x2900('0x4a'),_0x2900('0x4b'));_0x23d197[_0x2900('0x4c')]=_0x3a287b;}else if(_0x3bf0f7&&_0x3bf0f7[_0x2900('0x4d')]&&_0x3bf0f7[_0x2900('0x4d')]!==_0x2900('0x4e')){logger[_0x2900('0xd')](_0x2900('0x4f'),_0x2900('0x4b'));_0x23d197['recordingURL']=_0x3a287b;}else{_0x23d197[_0x2900('0x4c')]='';}return getAdminId(_0x35062a,_0x74b295,_0x122999,_0x596691)[_0x2900('0x19')](getUser(_0x74b295,_0x122999,_0x596691))['then'](getEndUser(_0x74b295,_0x122999,_0x596691))[_0x2900('0x19')](getTicket(_0x74b295,_0x122999,_0x596691,_0x44ccf0,_0x23d197))[_0x2900('0x19')](function(_0x3930bf){logger[_0x2900('0xd')](util[_0x2900('0x25')](_0x2900('0x50'),_0x3930bf[_0x2900('0x51')]));if(_0x74b295!==_0x2900('0x45')){logger['info']('['+[_0x74b295[_0x2900('0x15')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x596691,_0x4e75cf[_0x2900('0x52')],_0x3930bf[_0x2900('0x28')]);}})[_0x2900('0x1f')](function(_0xd5d0c1){logger['error']('['+[_0x74b295['toUpperCase']()]+_0x2900('0x53'),util[_0x2900('0x54')](_0xd5d0c1,{'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 4506d4a..e90e191 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 _0xe493=['./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','sugarcrm','zoho','desk','vtiger','servicenow','exec','includes','data1','toLowerCase','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','freshdesk','freshsales','dynamics365','error','format','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','%s\x20account\x20#%s\x20not\x20found','data2','util'];(function(_0xfbdf7e,_0x1d6055){var _0x39ec22=function(_0x2db035){while(--_0x2db035){_0xfbdf7e['push'](_0xfbdf7e['shift']());}};_0x39ec22(++_0x1d6055);}(_0xe493,0x1a1));var _0x3e49=function(_0x4c5e56,_0x522866){_0x4c5e56=_0x4c5e56-0x0;var _0x19749e=_0xe493[_0x4c5e56];return _0x19749e;};'use strict';var _=require('lodash');var util=require(_0x3e49('0x0'));var zendesk=require('./zendesk');var salesforce=require(_0x3e49('0x1'));var sugarcrm=require(_0x3e49('0x2'));var freshdesk=require(_0x3e49('0x3'));var zoho=require(_0x3e49('0x4'));var desk=require(_0x3e49('0x5'));var vtiger=require(_0x3e49('0x6'));var servicenow=require(_0x3e49('0x7'));var dynamics365=require(_0x3e49('0x8'));var freshsales=require('./freshsales');var integrations=[_0x3e49('0x9'),_0x3e49('0xa'),_0x3e49('0xb'),'freshdesk',_0x3e49('0xc'),_0x3e49('0xd'),_0x3e49('0xe'),'dynamics365','freshsales',_0x3e49('0xf')];exports[_0x3e49('0x10')]=function(_0x5eff08,_0x292f2a,_0x51509c,_0x24b3cc,_0x45b083,_0x2e1055){if(_0x51509c){if(_[_0x3e49('0x11')](integrations,_0x5eff08[_0x3e49('0x12')][_0x3e49('0x13')]())){try{var _0x19a501=null;var _0x55f0ab='';var _0x5c1c4f=_0x51509c[_0x5eff08[_0x3e49('0x12')]['toLowerCase']()];if(_0x5c1c4f){var _0x3539f7=_0x5c1c4f[_0x5eff08['data2']];if(_0x3539f7){var _0xfb4860=_[_0x3e49('0x14')](_0x3539f7[_0x3e49('0x15')],{'id':parseInt(_0x5eff08[_0x3e49('0x16')],0xa)});if(_0xfb4860){if(_0x24b3cc){if(_0x45b083&&_0x292f2a[_0x3e49('0x17')]){_0x55f0ab=_0x3e49('0x17');}else if(_0x292f2a[_0x3e49('0x18')]){_0x55f0ab=_0x3e49('0x19');}else{console[_0x3e49('0x1a')](_0x3e49('0x1b'),_0x292f2a);}}else{_0x55f0ab=_0x3e49('0x1c');}switch(_0x5eff08[_0x3e49('0x12')][_0x3e49('0x13')]()){case _0x3e49('0x9'):zendesk[_0x55f0ab](_0x5eff08,_0x292f2a,_0xfb4860,_0x24b3cc,_0x45b083,_0x3539f7,_0x2e1055);break;case _0x3e49('0xa'):salesforce[_0x55f0ab](_0x5eff08,_0x292f2a,_0xfb4860,_0x24b3cc,_0x45b083,_0x3539f7,_0x2e1055);break;case'sugarcrm':sugarcrm[_0x55f0ab](_0x5eff08,_0x292f2a,_0xfb4860,_0x24b3cc,_0x45b083,_0x3539f7,_0x2e1055);break;case _0x3e49('0x1d'):freshdesk[_0x55f0ab](_0x5eff08,_0x292f2a,_0xfb4860,_0x24b3cc,_0x45b083,_0x3539f7,_0x2e1055);break;case _0x3e49('0xc'):zoho[_0x55f0ab](_0x5eff08,_0x292f2a,_0xfb4860,_0x24b3cc,_0x45b083,_0x3539f7,_0x2e1055);break;case _0x3e49('0xd'):desk[_0x55f0ab](_0x5eff08,_0x292f2a,_0xfb4860,_0x24b3cc,_0x45b083,_0x3539f7,_0x2e1055);break;case _0x3e49('0xe'):vtiger[_0x55f0ab](_0x5eff08,_0x292f2a,_0xfb4860,_0x24b3cc,_0x45b083,_0x3539f7,_0x2e1055);break;case _0x3e49('0x1e'):freshsales['cs'](_0x5eff08,_0x292f2a,_0xfb4860,_0x24b3cc,_0x45b083,_0x3539f7,_0x2e1055,_0x55f0ab);break;case _0x3e49('0xf'):servicenow['cs'](_0x5eff08,_0x292f2a,_0xfb4860,_0x24b3cc,_0x45b083,_0x3539f7,_0x2e1055,_0x55f0ab);break;case _0x3e49('0x1f'):dynamics365['cs'](_0x5eff08,_0x292f2a,_0xfb4860,_0x24b3cc,_0x45b083,_0x3539f7,_0x2e1055,_0x55f0ab);break;default:console[_0x3e49('0x1a')]('unknown\x20integration');}}else{_0x19a501=require('../../../../config/logger')(_0x5eff08[_0x3e49('0x12')][_0x3e49('0x13')]());_0x19a501[_0x3e49('0x20')]('[EXEC]',util[_0x3e49('0x21')](_0x3e49('0x22'),_0x5eff08[_0x3e49('0x12')][_0x3e49('0x13')](),_0x5eff08['data3']));}}else{_0x19a501=require('../../../../config/logger')(_0x5eff08[_0x3e49('0x12')][_0x3e49('0x13')]());_0x19a501['error'](_0x3e49('0x23'),util['format'](_0x3e49('0x24'),_0x5eff08[_0x3e49('0x12')]['toLowerCase'](),_0x5eff08[_0x3e49('0x25')]));}}else{}}catch(_0x4c97d6){console[_0x3e49('0x20')](_0x4c97d6);}}}}; \ No newline at end of file +var _0x1cdb=['servicenow','includes','data1','toLowerCase','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','salesforce','freshdesk','zoho','desk','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','data2','error','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','sugarcrm','vtiger','dynamics365','freshsales'];(function(_0x4f9c94,_0x2d464c){var _0x52a606=function(_0x4b86ed){while(--_0x4b86ed){_0x4f9c94['push'](_0x4f9c94['shift']());}};_0x52a606(++_0x2d464c);}(_0x1cdb,0xe0));var _0xb1cd=function(_0x36448d,_0x433202){_0x36448d=_0x36448d-0x0;var _0x469af9=_0x1cdb[_0x36448d];return _0x469af9;};'use strict';var _=require(_0xb1cd('0x0'));var util=require(_0xb1cd('0x1'));var zendesk=require(_0xb1cd('0x2'));var salesforce=require(_0xb1cd('0x3'));var sugarcrm=require(_0xb1cd('0x4'));var freshdesk=require(_0xb1cd('0x5'));var zoho=require('./zoho');var desk=require(_0xb1cd('0x6'));var vtiger=require(_0xb1cd('0x7'));var servicenow=require(_0xb1cd('0x8'));var dynamics365=require(_0xb1cd('0x9'));var freshsales=require(_0xb1cd('0xa'));var integrations=[_0xb1cd('0xb'),'salesforce',_0xb1cd('0xc'),'freshdesk','zoho','desk',_0xb1cd('0xd'),_0xb1cd('0xe'),_0xb1cd('0xf'),_0xb1cd('0x10')];exports['exec']=function(_0x4d65c5,_0x164284,_0x58a82d,_0x1780b1,_0xc31e7b,_0x20afb1){if(_0x58a82d){if(_[_0xb1cd('0x11')](integrations,_0x4d65c5[_0xb1cd('0x12')][_0xb1cd('0x13')]())){try{var _0x268e9b=null;var _0xd11f0e='';var _0x47de5d=_0x58a82d[_0x4d65c5['data1'][_0xb1cd('0x13')]()];if(_0x47de5d){var _0x2b49c5=_0x47de5d[_0x4d65c5['data2']];if(_0x2b49c5){var _0x1424ea=_[_0xb1cd('0x14')](_0x2b49c5[_0xb1cd('0x15')],{'id':parseInt(_0x4d65c5[_0xb1cd('0x16')],0xa)});if(_0x1424ea){if(_0x1780b1){if(_0xc31e7b&&_0x164284[_0xb1cd('0x17')]){_0xd11f0e=_0xb1cd('0x17');}else if(_0x164284[_0xb1cd('0x18')]){_0xd11f0e=_0xb1cd('0x19');}else{console[_0xb1cd('0x1a')](_0xb1cd('0x1b'),_0x164284);}}else{_0xd11f0e=_0xb1cd('0x1c');}switch(_0x4d65c5[_0xb1cd('0x12')][_0xb1cd('0x13')]()){case _0xb1cd('0xb'):zendesk[_0xd11f0e](_0x4d65c5,_0x164284,_0x1424ea,_0x1780b1,_0xc31e7b,_0x2b49c5,_0x20afb1);break;case _0xb1cd('0x1d'):salesforce[_0xd11f0e](_0x4d65c5,_0x164284,_0x1424ea,_0x1780b1,_0xc31e7b,_0x2b49c5,_0x20afb1);break;case _0xb1cd('0xc'):sugarcrm[_0xd11f0e](_0x4d65c5,_0x164284,_0x1424ea,_0x1780b1,_0xc31e7b,_0x2b49c5,_0x20afb1);break;case _0xb1cd('0x1e'):freshdesk[_0xd11f0e](_0x4d65c5,_0x164284,_0x1424ea,_0x1780b1,_0xc31e7b,_0x2b49c5,_0x20afb1);break;case _0xb1cd('0x1f'):zoho[_0xd11f0e](_0x4d65c5,_0x164284,_0x1424ea,_0x1780b1,_0xc31e7b,_0x2b49c5,_0x20afb1);break;case _0xb1cd('0x20'):desk[_0xd11f0e](_0x4d65c5,_0x164284,_0x1424ea,_0x1780b1,_0xc31e7b,_0x2b49c5,_0x20afb1);break;case _0xb1cd('0xd'):vtiger[_0xd11f0e](_0x4d65c5,_0x164284,_0x1424ea,_0x1780b1,_0xc31e7b,_0x2b49c5,_0x20afb1);break;case _0xb1cd('0xf'):freshsales['cs'](_0x4d65c5,_0x164284,_0x1424ea,_0x1780b1,_0xc31e7b,_0x2b49c5,_0x20afb1,_0xd11f0e);break;case _0xb1cd('0x10'):servicenow['cs'](_0x4d65c5,_0x164284,_0x1424ea,_0x1780b1,_0xc31e7b,_0x2b49c5,_0x20afb1,_0xd11f0e);break;case _0xb1cd('0xe'):dynamics365['cs'](_0x4d65c5,_0x164284,_0x1424ea,_0x1780b1,_0xc31e7b,_0x2b49c5,_0x20afb1,_0xd11f0e);break;default:console['log']('unknown\x20integration');}}else{_0x268e9b=require(_0xb1cd('0x21'))(_0x4d65c5['data1']['toLowerCase']());_0x268e9b['error'](_0xb1cd('0x22'),util[_0xb1cd('0x23')](_0xb1cd('0x24'),_0x4d65c5['data1'][_0xb1cd('0x13')](),_0x4d65c5[_0xb1cd('0x16')]));}}else{_0x268e9b=require('../../../../config/logger')(_0x4d65c5[_0xb1cd('0x12')][_0xb1cd('0x13')]());_0x268e9b['error'](_0xb1cd('0x22'),util[_0xb1cd('0x23')](_0xb1cd('0x25'),_0x4d65c5[_0xb1cd('0x12')][_0xb1cd('0x13')](),_0x4d65c5[_0xb1cd('0x26')]));}}else{}}catch(_0x51ffad){console[_0xb1cd('0x27')](_0x51ffad);}}}}; \ 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 bb2fb32..1312877 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 _0x203c=['concat','securityToken','remoteUri','clientSecret','login','username','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','uniqueid','email','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','catch','lastevent','toUpperCase','calleridnum',']\x20Ticket\x20%s\x20created.','lodash','request-promise','moment','jsforce','util','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Subjects','Task','ActivityDate','IsReminderSet','IsRecurrence','endUserType','contact','lead','account','WhatId','ticketType','Case','ContactId','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','User','find','then','length','info','Agent\x20%s\x20found.','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','display_name','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','contact_lead','cloneDeep','additionalSearchContact','merge','Contact','execute','additionalSearchLead','$or','Lead','account_contact_lead','additionalSearchAccount','Account','first','Name','Phone','attributes','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','format','Caller\x20-\x20%s','','No\x20Company','upperFirst','create','includes','string','idField','content','toString','variable','variableName','customVariable','Variable','name','password'];(function(_0x296809,_0x1c9665){var _0x18c0d3=function(_0x249156){while(--_0x249156){_0x296809['push'](_0x296809['shift']());}};_0x18c0d3(++_0x1c9665);}(_0x203c,0x11e));var _0xc203=function(_0x248186,_0x374f5c){_0x248186=_0x248186-0x0;var _0x4e8164=_0x203c[_0x248186];return _0x4e8164;};'use strict';var _=require(_0xc203('0x0'));var rp=require(_0xc203('0x1'));var moment=require(_0xc203('0x2'));var BPromise=require('bluebird');var md5=require('md5');var jsforce=require(_0xc203('0x3'));var util=require(_0xc203('0x4'));var Redis=require('ioredis');var intUtil=require(_0xc203('0x5'));var config=require(_0xc203('0x6'));var logger=require('../../../../config/logger')('salesforce');config[_0xc203('0x7')]=_[_0xc203('0x8')](config[_0xc203('0x7')],{'host':_0xc203('0x9'),'port':0x18eb});var io=require(_0xc203('0xa'))(new Redis(config[_0xc203('0x7')]));function emit(_0x563aa5,_0x5d9ac8,_0x900b7){io['to'](_0x563aa5)[_0xc203('0xb')](_0x5d9ac8,_0x900b7);}function getTicket(_0x2da603,_0x440a88,_0x3db42f,_0x16dd4e,_0x4f5451,_0x5e311a,_0x3e4ba3,_0x45142d){var _0x21dc81=Object[_0xc203('0xc')]({},{'OwnerId':_0x440a88['id'],'Subject':intUtil[_0xc203('0xd')](_0x16dd4e[_0xc203('0xe')],_0x4f5451,'\x20'),'Description':intUtil[_0xc203('0xd')](_0x16dd4e['Descriptions'],_0x4f5451,'\x0a')},getCustomFields(_0x5e311a,_0x4f5451));if(_0x3db42f){if(_0x16dd4e['ticketType']===_0xc203('0xf')){_0x21dc81[_0xc203('0x10')]=moment['utc']();_0x21dc81[_0xc203('0x11')]=![];_0x21dc81[_0xc203('0x12')]=![];if(_0x3db42f[_0xc203('0x13')]===_0xc203('0x14')||_0x3db42f[_0xc203('0x13')]===_0xc203('0x15')){_0x21dc81['WhoId']=_0x3db42f['id'];}else if(_0x3db42f[_0xc203('0x13')]===_0xc203('0x16')){_0x21dc81[_0xc203('0x17')]=_0x3db42f['id'];}}else if(_0x16dd4e[_0xc203('0x18')]===_0xc203('0x19')){if(_0x3db42f['endUserType']===_0xc203('0x14')){_0x21dc81[_0xc203('0x1a')]=_0x3db42f['id'];}else if(_0x3db42f['endUserType']===_0xc203('0x16')){_0x21dc81[_0xc203('0x1b')]=_0x3db42f['id'];}else if(_0x3db42f[_0xc203('0x13')]===_0xc203('0x15')&&_0x16dd4e[_0xc203('0x1c')]){_0x21dc81[_0x16dd4e['leadId']]=_0x3db42f['id'];}else{logger['info'](_0xc203('0x1d'));}}}return _0x3e4ba3[_0xc203('0x1e')](_0x16dd4e[_0xc203('0x18')])['create'](_0x21dc81);}function getUser(_0x5afab0,_0x52ad20,_0x147611){if(!_[_0xc203('0x1f')](_0x52ad20)&&intUtil[_0xc203('0x20')](_0x52ad20)){var _0x2aafe8={'Email':_0x52ad20};var _0x142d61={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x147611[_0xc203('0x1e')](_0xc203('0x21'))[_0xc203('0x22')](_0x2aafe8,_0x142d61)['execute']()[_0xc203('0x23')](function(_0x5d0cb0){if(_0x5d0cb0[_0xc203('0x24')]){var _0x33a738=_[_0xc203('0x22')](_0x5d0cb0,function(_0x29ee1f){return _0x29ee1f['Email']===_0x52ad20;});if(_0x33a738){logger[_0xc203('0x25')](_0xc203('0x26'),_0x52ad20);return BPromise[_0xc203('0x27')]({'id':_0x33a738['Id'],'name':_0x33a738['Name']});}}else{logger[_0xc203('0x25')](_0xc203('0x28'),_0x52ad20);return _0x147611['identity']()['then'](function(_0x5d56cc){return BPromise[_0xc203('0x27')]({'id':_0x5d56cc['user_id'],'name':_0x5d56cc[_0xc203('0x29')]});});}});}else{logger[_0xc203('0x25')](_0xc203('0x28'),_0x52ad20);return _0x147611['identity']()[_0xc203('0x23')](function(_0x2bb9fa){return BPromise['resolve']({'id':_0x2bb9fa[_0xc203('0x2a')],'name':_0x2bb9fa[_0xc203('0x29')]});});}}function getEndUser(_0x12f98c,_0x103b66,_0x42b422,_0x1c722,_0x5b00ce){var _0x3f4dd0={'$or':{'Phone':_0x1c722}};var _0x172c31={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xc203('0x23')](function(){logger['info'](_0xc203('0x2b'),_0x1c722,_0x103b66['moduleSearch']);switch(_0x103b66['moduleSearch']){case _0xc203('0x2c'):var _0x98a5da=_[_0xc203('0x2d')](_0x3f4dd0);if(_0x103b66[_0xc203('0x2e')]){var _0x4cec3c={};_0x4cec3c[_0x103b66[_0xc203('0x2e')]]=_0x1c722;_[_0xc203('0x2f')](_0x98a5da['$or'],_0x4cec3c);}return _0x5b00ce[_0xc203('0x1e')](_0xc203('0x30'))[_0xc203('0x22')](_0x98a5da,_0x172c31)[_0xc203('0x31')]()[_0xc203('0x23')](function(_0x4ad448){if(_0x4ad448&&_0x4ad448[_0xc203('0x24')]){return _0x4ad448;}else{var _0x56e915=_[_0xc203('0x2d')](_0x3f4dd0);if(_0x103b66[_0xc203('0x32')]){var _0x121936={};_0x121936[_0x103b66['additionalSearchLead']]=_0x1c722;_[_0xc203('0x2f')](_0x56e915[_0xc203('0x33')],_0x121936);}return _0x5b00ce[_0xc203('0x1e')](_0xc203('0x34'))[_0xc203('0x22')](_0x56e915,_0x172c31);}});case _0xc203('0x35'):var _0x4b9958=_[_0xc203('0x2d')](_0x3f4dd0);if(_0x103b66['additionalSearchAccount']){var _0x4cec3c={};_0x4cec3c[_0x103b66[_0xc203('0x36')]]=_0x1c722;_[_0xc203('0x2f')](_0x4b9958[_0xc203('0x33')],_0x4cec3c);}return _0x5b00ce[_0xc203('0x1e')]('Account')[_0xc203('0x22')](_0x4b9958,_0x172c31)[_0xc203('0x31')]()[_0xc203('0x23')](function(_0x142175){if(_0x142175&&_0x142175['length']){return _0x142175;}else{var _0x45b447=_[_0xc203('0x2d')](_0x3f4dd0);if(_0x103b66[_0xc203('0x2e')]){var _0x3f6949={};_0x3f6949[_0x103b66[_0xc203('0x2e')]]=_0x1c722;_[_0xc203('0x2f')](_0x45b447[_0xc203('0x33')],_0x3f6949);}return _0x5b00ce[_0xc203('0x1e')](_0xc203('0x30'))[_0xc203('0x22')](_0x45b447,_0x172c31)[_0xc203('0x23')](function(_0x5028e1){if(_0x5028e1&&_0x5028e1[_0xc203('0x24')]){return _0x5028e1;}else{var _0x4dfbd7=_[_0xc203('0x2d')](_0x3f4dd0);if(_0x103b66[_0xc203('0x32')]){var _0x17c7d5={};_0x17c7d5[_0x103b66['additionalSearchLead']]=_0x1c722;_[_0xc203('0x2f')](_0x4dfbd7[_0xc203('0x33')],_0x17c7d5);}return _0x5b00ce['sobject'](_0xc203('0x34'))[_0xc203('0x22')](_0x4dfbd7,_0x172c31);}});}});case _0xc203('0x14'):var _0x98a5da=_[_0xc203('0x2d')](_0x3f4dd0);if(_0x103b66[_0xc203('0x2e')]){var _0x4cec3c={};_0x4cec3c[_0x103b66[_0xc203('0x2e')]]=_0x1c722;_['merge'](_0x98a5da[_0xc203('0x33')],_0x4cec3c);}return _0x5b00ce[_0xc203('0x1e')](_0xc203('0x30'))['find'](_0x98a5da,_0x172c31)[_0xc203('0x31')]();case _0xc203('0x15'):var _0x34e4ca=_['cloneDeep'](_0x3f4dd0);if(_0x103b66[_0xc203('0x32')]){var _0x4cec3c={};_0x4cec3c[_0x103b66[_0xc203('0x32')]]=_0x1c722;_[_0xc203('0x2f')](_0x34e4ca[_0xc203('0x33')],_0x4cec3c);}return _0x5b00ce['sobject'](_0xc203('0x34'))['find'](_0x34e4ca,_0x172c31);case _0xc203('0x16'):var _0x4b9958=_[_0xc203('0x2d')](_0x3f4dd0);if(_0x103b66[_0xc203('0x36')]){var _0x4cec3c={};_0x4cec3c[_0x103b66['additionalSearchAccount']]=_0x1c722;_[_0xc203('0x2f')](_0x4b9958[_0xc203('0x33')],_0x4cec3c);}return _0x5b00ce['sobject'](_0xc203('0x37'))[_0xc203('0x22')](_0x4b9958,_0x172c31);default:return null;}})[_0xc203('0x23')](function(_0x41bf0d){if(_0x41bf0d&&_0x41bf0d[_0xc203('0x24')]){var _0x5b5bd0=_[_0xc203('0x38')](_0x41bf0d);if(_0x5b5bd0){return BPromise[_0xc203('0x27')]({'id':_0x5b5bd0['Id'],'name':_0x5b5bd0[_0xc203('0x39')],'phone':_0x5b5bd0[_0xc203('0x3a')],'endUserType':_0x5b5bd0[_0xc203('0x3b')][_0xc203('0x3c')][_0xc203('0x3d')]()});}}})['then'](function(_0xd7850e){if(_0xd7850e){logger[_0xc203('0x25')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0xd7850e[_0xc203('0x13')],_0x1c722);return BPromise[_0xc203('0x27')](_0xd7850e);}else{logger[_0xc203('0x25')](_0xc203('0x3e'),_0x1c722);var _0x406561={'Phone':_0x1c722};if(_0x103b66['moduleCreate']){if(_0x103b66[_0xc203('0x3f')]===_0xc203('0x14')){logger[_0xc203('0x25')](_0xc203('0x40'),_0x1c722,_0x103b66[_0xc203('0x3f')]);_0x406561[_0xc203('0x41')]=_0x42b422!==''?_0x42b422:util[_0xc203('0x42')](_0xc203('0x43'),_0x1c722);}else if(_0x103b66['moduleCreate']===_0xc203('0x15')){logger[_0xc203('0x25')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x1c722,_0x103b66[_0xc203('0x3f')]);_0x406561[_0xc203('0x41')]=_0x42b422!==_0xc203('0x44')?_0x42b422:util[_0xc203('0x42')](_0xc203('0x43'),_0x1c722);_0x406561['Company']=_0xc203('0x45');}else if(_0x103b66['moduleCreate']===_0xc203('0x16')){logger[_0xc203('0x25')](_0xc203('0x40'),_0x1c722,_0x103b66[_0xc203('0x3f')]);_0x406561[_0xc203('0x39')]=_0x42b422!==''?_0x42b422:util[_0xc203('0x42')]('Caller\x20-\x20%s',_0x1c722);}else{return null;}}return _0x5b00ce[_0xc203('0x1e')](_[_0xc203('0x46')](_0x103b66[_0xc203('0x3f')]))[_0xc203('0x47')](_0x406561)[_0xc203('0x23')](function(_0x5abcfb){return BPromise['resolve']({'id':_0x5abcfb['id'],'endUserType':_0x103b66[_0xc203('0x3f')]});});}});}function getCustomFields(_0x3ca757,_0x24c38b){var _0x2c6cca={};if(_0x3ca757['length']>0x0){_['forEach'](_0x3ca757,function(_0x43bef2){if(_[_0xc203('0x48')]([_0xc203('0x49'),'picklist'],_0x43bef2[_0xc203('0x3c')])&&_0x43bef2[_0xc203('0x4a')]){_0x2c6cca[_0x43bef2[_0xc203('0x4a')]]=_0x43bef2[_0xc203('0x4b')][_0xc203('0x4c')]();}else if(_0x43bef2[_0xc203('0x3c')]===_0xc203('0x4d')&&_0x43bef2[_0xc203('0x4e')]&&_0x43bef2[_0xc203('0x4a')]){_0x24c38b[_0x43bef2[_0xc203('0x4e')]]&&(_0x2c6cca[_0x43bef2['idField']]=_0x24c38b[_0x43bef2[_0xc203('0x4e')]][_0xc203('0x4c')]());}else if(_0x43bef2[_0xc203('0x3c')]===_0xc203('0x4f')&&_0x43bef2[_0xc203('0x50')]&&_0x43bef2['Variable']['name']&&_0x43bef2[_0xc203('0x4a')]){_0x24c38b[_0x43bef2[_0xc203('0x50')][_0xc203('0x51')][_0xc203('0x3d')]()]&&(_0x2c6cca[_0x43bef2[_0xc203('0x4a')]]=_0x24c38b[_0x43bef2[_0xc203('0x50')]['name'][_0xc203('0x3d')]()][_0xc203('0x4c')]());}});}return _0x2c6cca;}function getConnection(_0x544af1){var _0x49e424=_0x544af1[_0xc203('0x52')][_0xc203('0x53')](_0x544af1[_0xc203('0x54')]);var _0x3dcb6b=new jsforce['Connection']({'oauth2':{'loginUrl':_0x544af1[_0xc203('0x55')]||'https://login.salesforce.com','clientId':_0x544af1['clientId'],'clientSecret':_0x544af1[_0xc203('0x56')]}});return _0x3dcb6b[_0xc203('0x57')](_0x544af1[_0xc203('0x58')],_0x49e424)[_0xc203('0x23')](function(){logger[_0xc203('0x25')]('Connection\x20established.');return _0x3dcb6b;});}exports[_0xc203('0x59')]=function(_0x1bb7ae,_0x2a23be,_0x23e44f,_0x307fe9,_0x11c182,_0x1211de){var _0x5b9490,_0x844b44,_0x484c12,_0x2bb6ab;_0x1211de['serverUrl']=intUtil['stripTrailingSlash'](_0x1211de['serverUrl']);_0x1211de[_0xc203('0x55')]=intUtil[_0xc203('0x5a')](_0x1211de[_0xc203('0x55')]);if(_0x11c182&&_0x11c182[_0xc203('0x5b')]){logger[_0xc203('0x25')](_0xc203('0x5c'),_0xc203('0x5d'));_0x2a23be[_0xc203('0x5e')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1211de[_0xc203('0x5f')],_0x2a23be[_0xc203('0x60')],md5(_0x2a23be['uniqueid']));}else{_0x2a23be[_0xc203('0x5e')]='';}return getConnection(_0x1211de)[_0xc203('0x23')](function(_0x406a82){_0x2bb6ab=_0x406a82;return getUser(_0x1211de,_0x307fe9[_0xc203('0x61')],_0x2bb6ab);})[_0xc203('0x23')](function(_0x2b79ef){_0x5b9490=_0x2b79ef;return getEndUser(_0x1211de,_0x23e44f,_0x2a23be['calleridname'],_0x2a23be['calleridnum'],_0x2bb6ab);})[_0xc203('0x23')](function(_0x3bbfbf){_0x844b44=_0x3bbfbf;return getTicket(_0x1211de,_0x5b9490,_0x844b44,_0x23e44f,_0x2a23be,_0x23e44f[_0xc203('0x62')],_0x2bb6ab,_0xc203('0x59'));})[_0xc203('0x23')](function(_0x49b6a0){_0x484c12=_0x49b6a0;logger[_0xc203('0x25')](_0xc203('0x63'),_0x484c12['id']);logger[_0xc203('0x25')](_0xc203('0x64'),_0x484c12['id'],_0x307fe9[_0xc203('0x51')],_0x1211de[_0xc203('0x3c')]);switch(_0x1211de[_0xc203('0x3c')]){case _0xc203('0x65'):emit(util['format'](_0xc203('0x66'),_0x307fe9[_0xc203('0x51')]),_0xc203('0x67'),{'recordId':_0x484c12['id']});break;case _0xc203('0x68'):emit(util[_0xc203('0x42')]('user:%s',_0x307fe9[_0xc203('0x51')]),_0xc203('0x69'),{'uri':util['format']('%s/%s/e',_0x2bb6ab[_0xc203('0x6a')],_0x484c12['id'])});break;default:logger[_0xc203('0x6b')](_0xc203('0x6c'));}})['catch'](function(_0x449d6f){logger[_0xc203('0x6b')](_0xc203('0x5c'),_0x449d6f);});};exports[_0xc203('0x6d')]=function(_0x1deaf0,_0xd7a15b,_0x3c54a9,_0x464911,_0x34eae9,_0x45632f,_0x16b5f3){var _0x2314a7,_0x7fca0,_0x97941b,_0x1d33c2;_0x45632f[_0xc203('0x5f')]=intUtil[_0xc203('0x5a')](_0x45632f['serverUrl']);_0x45632f[_0xc203('0x55')]=intUtil[_0xc203('0x5a')](_0x45632f[_0xc203('0x55')]);if(_0x16b5f3&&_0x16b5f3[_0xc203('0x6e')]&&_0x16b5f3[_0xc203('0x6e')]!==_0xc203('0x6f')){logger['info'](_0xc203('0x70'),_0xc203('0x5d'));_0xd7a15b[_0xc203('0x5e')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x45632f[_0xc203('0x5f')],_0xd7a15b[_0xc203('0x60')],md5(_0xd7a15b[_0xc203('0x60')]));}return getConnection(_0x45632f)[_0xc203('0x23')](function(_0x39a8f5){_0x1d33c2=_0x39a8f5;return getUser(_0x45632f,_0x464911['email'],_0x1d33c2);})[_0xc203('0x23')](function(_0x3996a3){_0x2314a7=_0x3996a3;return getEndUser(_0x45632f,_0x3c54a9,_0xd7a15b[_0xc203('0x71')],_0xd7a15b['destcalleridnum'],_0x1d33c2);})[_0xc203('0x23')](function(_0x565e19){_0x7fca0=_0x565e19;return getTicket(_0x45632f,_0x2314a7,_0x7fca0,_0x3c54a9,_0xd7a15b,_0x3c54a9[_0xc203('0x62')],_0x1d33c2,'outbound');})[_0xc203('0x23')](function(_0x2054c9){_0x97941b=_0x2054c9;logger[_0xc203('0x25')](_0xc203('0x72'),_0x97941b['id']);logger[_0xc203('0x25')](_0xc203('0x73'),_0x97941b['id'],_0x464911[_0xc203('0x51')],_0x45632f[_0xc203('0x3c')]);switch(_0x45632f[_0xc203('0x3c')]){case _0xc203('0x65'):emit(util['format']('user:%s',_0x464911['name']),'trigger:salesforce:display',{'recordId':_0x97941b['id']});break;case _0xc203('0x68'):emit(util[_0xc203('0x42')](_0xc203('0x66'),_0x464911[_0xc203('0x51')]),_0xc203('0x69'),{'uri':util[_0xc203('0x42')](_0xc203('0x74'),_0x1d33c2[_0xc203('0x6a')],_0x97941b['id'])});break;default:logger[_0xc203('0x6b')](_0xc203('0x70'),_0xc203('0x75'));}})[_0xc203('0x76')](function(_0x360cfd){logger[_0xc203('0x6b')](_0xc203('0x70'),_0x360cfd);});};exports['unmanaged']=function(_0x342bd6,_0x408322,_0xaacc4d,_0x51fd34,_0x37b4d4,_0x31376b){var _0x5aaef9,_0x3f2e51,_0x318b3a,_0x1b0f98;_0x31376b[_0xc203('0x5f')]=intUtil[_0xc203('0x5a')](_0x31376b[_0xc203('0x5f')]);_0x31376b[_0xc203('0x55')]=intUtil[_0xc203('0x5a')](_0x31376b['remoteUri']);if(_0x37b4d4&&_0x37b4d4[_0xc203('0x5b')]){logger[_0xc203('0x25')]('['+_0x408322[_0xc203('0x77')][_0xc203('0x78')]()+']',_0xc203('0x5d'));_0x408322['recordingURL']=util[_0xc203('0x42')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x31376b[_0xc203('0x5f')],_0x408322[_0xc203('0x60')],md5(_0x408322[_0xc203('0x60')]));}else{_0x408322[_0xc203('0x5e')]='';}return getConnection(_0x31376b)[_0xc203('0x23')](function(_0x32b5ba){_0x1b0f98=_0x32b5ba;if(!_['isNil'](_0x51fd34)){return getUser(_0x31376b,_0x51fd34[_0xc203('0x51')],_0x1b0f98);}else{return getUser(_0x31376b,null,_0x1b0f98);}})[_0xc203('0x23')](function(_0x19999){_0x5aaef9=_0x19999;return getEndUser(_0x31376b,_0xaacc4d,_0x408322['calleridname'],_0x408322[_0xc203('0x79')],_0x1b0f98);})[_0xc203('0x23')](function(_0x5458c9){_0x3f2e51=_0x5458c9;return getTicket(_0x31376b,_0x5aaef9,_0x3f2e51,_0xaacc4d,_0x408322,_0xaacc4d[_0xc203('0x62')],_0x1b0f98);})[_0xc203('0x23')](function(_0x57186e){_0x318b3a=_0x57186e;logger[_0xc203('0x25')]('['+_0x408322[_0xc203('0x77')][_0xc203('0x78')]()+_0xc203('0x7a'),_0x318b3a['id']);logger[_0xc203('0x25')]('['+_0x408322['lastevent']['toUpperCase']()+']\x20Integration\x20account\x20type\x20%s.',_0x31376b['type']);})[_0xc203('0x76')](function(_0x5f2ec4){logger['error']('['+_0x408322[_0xc203('0x77')][_0xc203('0x78')]()+']',_0x5f2ec4);});}; \ No newline at end of file +var _0xe53c=['jsforce','util','ioredis','./util','../../../../config/environment','salesforce','redis','localhost','socket.io-emitter','emit','getString','Subjects','Descriptions','ticketType','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','execute','then','length','find','Email','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','Contact','additionalSearchLead','$or','Lead','account_contact_lead','additionalSearchAccount','Account','first','attributes','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','upperFirst','forEach','includes','picklist','type','idField','content','variableName','toString','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','Connection\x20established.','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','queue','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','recordingFormat','none','[OUTBOUND]','email','destcalleridname','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','catch','monitor_format','lastevent',']\x20Ticket\x20%s\x20created.','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','md5'];(function(_0x28aa04,_0x81eb6d){var _0x35730a=function(_0x34c2df){while(--_0x34c2df){_0x28aa04['push'](_0x28aa04['shift']());}};_0x35730a(++_0x81eb6d);}(_0xe53c,0x7d));var _0xce53=function(_0x2b2c53,_0x4bcf9b){_0x2b2c53=_0x2b2c53-0x0;var _0x311ec2=_0xe53c[_0x2b2c53];return _0x311ec2;};'use strict';var _=require(_0xce53('0x0'));var rp=require(_0xce53('0x1'));var moment=require(_0xce53('0x2'));var BPromise=require('bluebird');var md5=require(_0xce53('0x3'));var jsforce=require(_0xce53('0x4'));var util=require(_0xce53('0x5'));var Redis=require(_0xce53('0x6'));var intUtil=require(_0xce53('0x7'));var config=require(_0xce53('0x8'));var logger=require('../../../../config/logger')(_0xce53('0x9'));config[_0xce53('0xa')]=_['defaults'](config[_0xce53('0xa')],{'host':_0xce53('0xb'),'port':0x18eb});var io=require(_0xce53('0xc'))(new Redis(config[_0xce53('0xa')]));function emit(_0xca9f10,_0x288e5b,_0x40d7b5){io['to'](_0xca9f10)[_0xce53('0xd')](_0x288e5b,_0x40d7b5);}function getTicket(_0x245817,_0x1583a2,_0x2708db,_0x49ac4f,_0x4128af,_0x1d6def,_0x473b62,_0x24896c){var _0x1ebf98=Object['assign']({},{'OwnerId':_0x1583a2['id'],'Subject':intUtil[_0xce53('0xe')](_0x49ac4f[_0xce53('0xf')],_0x4128af,'\x20'),'Description':intUtil[_0xce53('0xe')](_0x49ac4f[_0xce53('0x10')],_0x4128af,'\x0a')},getCustomFields(_0x1d6def,_0x4128af));if(_0x2708db){if(_0x49ac4f[_0xce53('0x11')]==='Task'){_0x1ebf98['ActivityDate']=moment[_0xce53('0x12')]();_0x1ebf98[_0xce53('0x13')]=![];_0x1ebf98[_0xce53('0x14')]=![];if(_0x2708db[_0xce53('0x15')]===_0xce53('0x16')||_0x2708db['endUserType']===_0xce53('0x17')){_0x1ebf98[_0xce53('0x18')]=_0x2708db['id'];}else if(_0x2708db[_0xce53('0x15')]===_0xce53('0x19')){_0x1ebf98[_0xce53('0x1a')]=_0x2708db['id'];}}else if(_0x49ac4f[_0xce53('0x11')]===_0xce53('0x1b')){if(_0x2708db[_0xce53('0x15')]===_0xce53('0x16')){_0x1ebf98[_0xce53('0x1c')]=_0x2708db['id'];}else if(_0x2708db['endUserType']==='account'){_0x1ebf98[_0xce53('0x1d')]=_0x2708db['id'];}else if(_0x2708db[_0xce53('0x15')]==='lead'&&_0x49ac4f['leadId']){_0x1ebf98[_0x49ac4f[_0xce53('0x1e')]]=_0x2708db['id'];}else{logger[_0xce53('0x1f')](_0xce53('0x20'));}}}return _0x473b62[_0xce53('0x21')](_0x49ac4f[_0xce53('0x11')])[_0xce53('0x22')](_0x1ebf98);}function getUser(_0xb05e8d,_0xffa024,_0x5a3ad9){if(!_[_0xce53('0x23')](_0xffa024)&&intUtil[_0xce53('0x24')](_0xffa024)){var _0x60c0b0={'Email':_0xffa024};var _0x453d33={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5a3ad9[_0xce53('0x21')](_0xce53('0x25'))['find'](_0x60c0b0,_0x453d33)[_0xce53('0x26')]()[_0xce53('0x27')](function(_0xa170e3){if(_0xa170e3[_0xce53('0x28')]){var _0x314a37=_[_0xce53('0x29')](_0xa170e3,function(_0x3927e5){return _0x3927e5[_0xce53('0x2a')]===_0xffa024;});if(_0x314a37){logger[_0xce53('0x1f')](_0xce53('0x2b'),_0xffa024);return BPromise['resolve']({'id':_0x314a37['Id'],'name':_0x314a37[_0xce53('0x2c')]});}}else{logger['info'](_0xce53('0x2d'),_0xffa024);return _0x5a3ad9[_0xce53('0x2e')]()[_0xce53('0x27')](function(_0x508e39){return BPromise[_0xce53('0x2f')]({'id':_0x508e39[_0xce53('0x30')],'name':_0x508e39[_0xce53('0x31')]});});}});}else{logger['info'](_0xce53('0x2d'),_0xffa024);return _0x5a3ad9[_0xce53('0x2e')]()[_0xce53('0x27')](function(_0xd0f0ac){return BPromise[_0xce53('0x2f')]({'id':_0xd0f0ac[_0xce53('0x30')],'name':_0xd0f0ac[_0xce53('0x31')]});});}}function getEndUser(_0x4d6c56,_0x1694a9,_0x4ef963,_0x12480e,_0x22f83c){var _0x2223bd={'$or':{'Phone':_0x12480e}};var _0x396ea5={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xce53('0x2f')]()[_0xce53('0x27')](function(){logger['info'](_0xce53('0x32'),_0x12480e,_0x1694a9['moduleSearch']);switch(_0x1694a9[_0xce53('0x33')]){case _0xce53('0x34'):var _0x180d85=_[_0xce53('0x35')](_0x2223bd);if(_0x1694a9['additionalSearchContact']){var _0x158743={};_0x158743[_0x1694a9[_0xce53('0x36')]]=_0x12480e;_[_0xce53('0x37')](_0x180d85['$or'],_0x158743);}return _0x22f83c[_0xce53('0x21')](_0xce53('0x38'))[_0xce53('0x29')](_0x180d85,_0x396ea5)['execute']()[_0xce53('0x27')](function(_0x3a8a0d){if(_0x3a8a0d&&_0x3a8a0d[_0xce53('0x28')]){return _0x3a8a0d;}else{var _0x3c6a17=_[_0xce53('0x35')](_0x2223bd);if(_0x1694a9[_0xce53('0x39')]){var _0x13f996={};_0x13f996[_0x1694a9[_0xce53('0x39')]]=_0x12480e;_[_0xce53('0x37')](_0x3c6a17[_0xce53('0x3a')],_0x13f996);}return _0x22f83c[_0xce53('0x21')](_0xce53('0x3b'))[_0xce53('0x29')](_0x3c6a17,_0x396ea5);}});case _0xce53('0x3c'):var _0x389a45=_[_0xce53('0x35')](_0x2223bd);if(_0x1694a9[_0xce53('0x3d')]){var _0x158743={};_0x158743[_0x1694a9[_0xce53('0x3d')]]=_0x12480e;_[_0xce53('0x37')](_0x389a45[_0xce53('0x3a')],_0x158743);}return _0x22f83c[_0xce53('0x21')](_0xce53('0x3e'))[_0xce53('0x29')](_0x389a45,_0x396ea5)[_0xce53('0x26')]()['then'](function(_0x37231f){if(_0x37231f&&_0x37231f[_0xce53('0x28')]){return _0x37231f;}else{var _0x9e707a=_[_0xce53('0x35')](_0x2223bd);if(_0x1694a9[_0xce53('0x36')]){var _0x21c727={};_0x21c727[_0x1694a9[_0xce53('0x36')]]=_0x12480e;_[_0xce53('0x37')](_0x9e707a['$or'],_0x21c727);}return _0x22f83c[_0xce53('0x21')](_0xce53('0x38'))[_0xce53('0x29')](_0x9e707a,_0x396ea5)[_0xce53('0x27')](function(_0x5ac219){if(_0x5ac219&&_0x5ac219['length']){return _0x5ac219;}else{var _0x373a6a=_[_0xce53('0x35')](_0x2223bd);if(_0x1694a9[_0xce53('0x39')]){var _0x255c80={};_0x255c80[_0x1694a9[_0xce53('0x39')]]=_0x12480e;_[_0xce53('0x37')](_0x373a6a[_0xce53('0x3a')],_0x255c80);}return _0x22f83c['sobject'](_0xce53('0x3b'))[_0xce53('0x29')](_0x373a6a,_0x396ea5);}});}});case _0xce53('0x16'):var _0x180d85=_[_0xce53('0x35')](_0x2223bd);if(_0x1694a9[_0xce53('0x36')]){var _0x158743={};_0x158743[_0x1694a9[_0xce53('0x36')]]=_0x12480e;_[_0xce53('0x37')](_0x180d85[_0xce53('0x3a')],_0x158743);}return _0x22f83c[_0xce53('0x21')](_0xce53('0x38'))['find'](_0x180d85,_0x396ea5)[_0xce53('0x26')]();case'lead':var _0x337ac8=_[_0xce53('0x35')](_0x2223bd);if(_0x1694a9[_0xce53('0x39')]){var _0x158743={};_0x158743[_0x1694a9['additionalSearchLead']]=_0x12480e;_[_0xce53('0x37')](_0x337ac8['$or'],_0x158743);}return _0x22f83c[_0xce53('0x21')](_0xce53('0x3b'))[_0xce53('0x29')](_0x337ac8,_0x396ea5);case'account':var _0x389a45=_[_0xce53('0x35')](_0x2223bd);if(_0x1694a9[_0xce53('0x3d')]){var _0x158743={};_0x158743[_0x1694a9['additionalSearchAccount']]=_0x12480e;_[_0xce53('0x37')](_0x389a45['$or'],_0x158743);}return _0x22f83c[_0xce53('0x21')](_0xce53('0x3e'))[_0xce53('0x29')](_0x389a45,_0x396ea5);default:return null;}})[_0xce53('0x27')](function(_0x30d215){if(_0x30d215&&_0x30d215[_0xce53('0x28')]){var _0x3dad6f=_[_0xce53('0x3f')](_0x30d215);if(_0x3dad6f){return BPromise[_0xce53('0x2f')]({'id':_0x3dad6f['Id'],'name':_0x3dad6f[_0xce53('0x2c')],'phone':_0x3dad6f['Phone'],'endUserType':_0x3dad6f[_0xce53('0x40')]['type'][_0xce53('0x41')]()});}}})['then'](function(_0x27814f){if(_0x27814f){logger[_0xce53('0x1f')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x27814f[_0xce53('0x15')],_0x12480e);return BPromise[_0xce53('0x2f')](_0x27814f);}else{logger[_0xce53('0x1f')](_0xce53('0x42'),_0x12480e);var _0x203b0a={'Phone':_0x12480e};if(_0x1694a9[_0xce53('0x43')]){if(_0x1694a9['moduleCreate']===_0xce53('0x16')){logger[_0xce53('0x1f')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x12480e,_0x1694a9[_0xce53('0x43')]);_0x203b0a[_0xce53('0x44')]=_0x4ef963!==_0xce53('0x45')?_0x4ef963:util[_0xce53('0x46')](_0xce53('0x47'),_0x12480e);}else if(_0x1694a9[_0xce53('0x43')]===_0xce53('0x17')){logger[_0xce53('0x1f')](_0xce53('0x48'),_0x12480e,_0x1694a9[_0xce53('0x43')]);_0x203b0a[_0xce53('0x44')]=_0x4ef963!==_0xce53('0x45')?_0x4ef963:util[_0xce53('0x46')]('Caller\x20-\x20%s',_0x12480e);_0x203b0a[_0xce53('0x49')]='No\x20Company';}else if(_0x1694a9[_0xce53('0x43')]===_0xce53('0x19')){logger[_0xce53('0x1f')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x12480e,_0x1694a9[_0xce53('0x43')]);_0x203b0a[_0xce53('0x2c')]=_0x4ef963!==_0xce53('0x45')?_0x4ef963:util[_0xce53('0x46')](_0xce53('0x47'),_0x12480e);}else{return null;}}return _0x22f83c['sobject'](_[_0xce53('0x4a')](_0x1694a9[_0xce53('0x43')]))['create'](_0x203b0a)['then'](function(_0x18eb53){return BPromise[_0xce53('0x2f')]({'id':_0x18eb53['id'],'endUserType':_0x1694a9[_0xce53('0x43')]});});}});}function getCustomFields(_0x4ab9da,_0x11ff9f){var _0x381f58={};if(_0x4ab9da[_0xce53('0x28')]>0x0){_[_0xce53('0x4b')](_0x4ab9da,function(_0x4c2f09){if(_[_0xce53('0x4c')](['string',_0xce53('0x4d')],_0x4c2f09[_0xce53('0x4e')])&&_0x4c2f09[_0xce53('0x4f')]){_0x381f58[_0x4c2f09[_0xce53('0x4f')]]=_0x4c2f09[_0xce53('0x50')]['toString']();}else if(_0x4c2f09[_0xce53('0x4e')]==='variable'&&_0x4c2f09['variableName']&&_0x4c2f09[_0xce53('0x4f')]){_0x11ff9f[_0x4c2f09[_0xce53('0x51')]]&&(_0x381f58[_0x4c2f09[_0xce53('0x4f')]]=_0x11ff9f[_0x4c2f09[_0xce53('0x51')]][_0xce53('0x52')]());}else if(_0x4c2f09['type']===_0xce53('0x53')&&_0x4c2f09['Variable']&&_0x4c2f09[_0xce53('0x54')]['name']&&_0x4c2f09[_0xce53('0x4f')]){_0x11ff9f[_0x4c2f09[_0xce53('0x54')][_0xce53('0x55')]['toLowerCase']()]&&(_0x381f58[_0x4c2f09[_0xce53('0x4f')]]=_0x11ff9f[_0x4c2f09[_0xce53('0x54')]['name'][_0xce53('0x41')]()]['toString']());}});}return _0x381f58;}function getConnection(_0x1e8ebc){var _0x50510f=_0x1e8ebc[_0xce53('0x56')][_0xce53('0x57')](_0x1e8ebc[_0xce53('0x58')]);var _0x55a447=new jsforce[(_0xce53('0x59'))]({'oauth2':{'loginUrl':_0x1e8ebc[_0xce53('0x5a')]||_0xce53('0x5b'),'clientId':_0x1e8ebc[_0xce53('0x5c')],'clientSecret':_0x1e8ebc[_0xce53('0x5d')]}});return _0x55a447[_0xce53('0x5e')](_0x1e8ebc['username'],_0x50510f)['then'](function(){logger[_0xce53('0x1f')](_0xce53('0x5f'));return _0x55a447;});}exports['queue']=function(_0x4198c6,_0x471318,_0x41b94c,_0x327848,_0xf19043,_0x2f7695){var _0x52ce40,_0x152fca,_0xb803cf,_0x2a0625;_0x2f7695[_0xce53('0x60')]=intUtil['stripTrailingSlash'](_0x2f7695['serverUrl']);_0x2f7695[_0xce53('0x5a')]=intUtil[_0xce53('0x61')](_0x2f7695[_0xce53('0x5a')]);if(_0xf19043&&_0xf19043['monitor_format']){logger[_0xce53('0x1f')](_0xce53('0x62'),_0xce53('0x63'));_0x471318[_0xce53('0x64')]=util['format'](_0xce53('0x65'),_0x2f7695[_0xce53('0x60')],_0x471318[_0xce53('0x66')],md5(_0x471318[_0xce53('0x66')]));}else{_0x471318[_0xce53('0x64')]='';}return getConnection(_0x2f7695)[_0xce53('0x27')](function(_0x4cea97){_0x2a0625=_0x4cea97;return getUser(_0x2f7695,_0x327848['email'],_0x2a0625);})['then'](function(_0x658d9d){_0x52ce40=_0x658d9d;return getEndUser(_0x2f7695,_0x41b94c,_0x471318[_0xce53('0x67')],_0x471318[_0xce53('0x68')],_0x2a0625);})[_0xce53('0x27')](function(_0x2892c9){_0x152fca=_0x2892c9;return getTicket(_0x2f7695,_0x52ce40,_0x152fca,_0x41b94c,_0x471318,_0x41b94c['Fields'],_0x2a0625,_0xce53('0x69'));})[_0xce53('0x27')](function(_0x30e298){_0xb803cf=_0x30e298;logger[_0xce53('0x1f')](_0xce53('0x6a'),_0xb803cf['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0xb803cf['id'],_0x327848[_0xce53('0x55')],_0x2f7695[_0xce53('0x4e')]);switch(_0x2f7695[_0xce53('0x4e')]){case _0xce53('0x6b'):emit(util[_0xce53('0x46')](_0xce53('0x6c'),_0x327848[_0xce53('0x55')]),_0xce53('0x6d'),{'recordId':_0xb803cf['id']});break;case _0xce53('0x6e'):emit(util[_0xce53('0x46')]('user:%s',_0x327848[_0xce53('0x55')]),_0xce53('0x6f'),{'uri':util[_0xce53('0x46')]('%s/%s/e',_0x2a0625['instanceUrl'],_0xb803cf['id'])});break;default:logger[_0xce53('0x70')](_0xce53('0x71'));}})['catch'](function(_0x4fe00c){logger[_0xce53('0x70')](_0xce53('0x62'),_0x4fe00c);});};exports['outbound']=function(_0x4979d3,_0x54de1b,_0x2cf8ef,_0x3eb64d,_0x4cad7f,_0xa6a820,_0x569d48){var _0x1cecd0,_0x537e94,_0x2ddd7f,_0x421482;_0xa6a820[_0xce53('0x60')]=intUtil['stripTrailingSlash'](_0xa6a820[_0xce53('0x60')]);_0xa6a820[_0xce53('0x5a')]=intUtil[_0xce53('0x61')](_0xa6a820[_0xce53('0x5a')]);if(_0x569d48&&_0x569d48[_0xce53('0x72')]&&_0x569d48[_0xce53('0x72')]!==_0xce53('0x73')){logger[_0xce53('0x1f')](_0xce53('0x74'),_0xce53('0x63'));_0x54de1b[_0xce53('0x64')]=util[_0xce53('0x46')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xa6a820[_0xce53('0x60')],_0x54de1b[_0xce53('0x66')],md5(_0x54de1b[_0xce53('0x66')]));}return getConnection(_0xa6a820)[_0xce53('0x27')](function(_0x3574b9){_0x421482=_0x3574b9;return getUser(_0xa6a820,_0x3eb64d[_0xce53('0x75')],_0x421482);})[_0xce53('0x27')](function(_0x47c229){_0x1cecd0=_0x47c229;return getEndUser(_0xa6a820,_0x2cf8ef,_0x54de1b[_0xce53('0x76')],_0x54de1b['destcalleridnum'],_0x421482);})[_0xce53('0x27')](function(_0xb60990){_0x537e94=_0xb60990;return getTicket(_0xa6a820,_0x1cecd0,_0x537e94,_0x2cf8ef,_0x54de1b,_0x2cf8ef[_0xce53('0x77')],_0x421482,'outbound');})['then'](function(_0xa3c713){_0x2ddd7f=_0xa3c713;logger[_0xce53('0x1f')](_0xce53('0x78'),_0x2ddd7f['id']);logger[_0xce53('0x1f')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x2ddd7f['id'],_0x3eb64d[_0xce53('0x55')],_0xa6a820['type']);switch(_0xa6a820[_0xce53('0x4e')]){case _0xce53('0x6b'):emit(util[_0xce53('0x46')]('user:%s',_0x3eb64d[_0xce53('0x55')]),_0xce53('0x6d'),{'recordId':_0x2ddd7f['id']});break;case _0xce53('0x6e'):emit(util['format']('user:%s',_0x3eb64d[_0xce53('0x55')]),_0xce53('0x6f'),{'uri':util[_0xce53('0x46')]('%s/%s/e',_0x421482[_0xce53('0x79')],_0x2ddd7f['id'])});break;default:logger[_0xce53('0x70')](_0xce53('0x74'),_0xce53('0x7a'));}})[_0xce53('0x7b')](function(_0x19c219){logger[_0xce53('0x70')](_0xce53('0x74'),_0x19c219);});};exports['unmanaged']=function(_0x5e28f0,_0x4e6410,_0x12dcff,_0x3f1628,_0x7cd376,_0x3f1039){var _0xd9042d,_0x5c8b44,_0x5e9549,_0x8291dc;_0x3f1039[_0xce53('0x60')]=intUtil[_0xce53('0x61')](_0x3f1039['serverUrl']);_0x3f1039[_0xce53('0x5a')]=intUtil[_0xce53('0x61')](_0x3f1039[_0xce53('0x5a')]);if(_0x7cd376&&_0x7cd376[_0xce53('0x7c')]){logger[_0xce53('0x1f')]('['+_0x4e6410[_0xce53('0x7d')]['toUpperCase']()+']',_0xce53('0x63'));_0x4e6410[_0xce53('0x64')]=util['format'](_0xce53('0x65'),_0x3f1039[_0xce53('0x60')],_0x4e6410['uniqueid'],md5(_0x4e6410[_0xce53('0x66')]));}else{_0x4e6410[_0xce53('0x64')]='';}return getConnection(_0x3f1039)[_0xce53('0x27')](function(_0x192697){_0x8291dc=_0x192697;if(!_[_0xce53('0x23')](_0x3f1628)){return getUser(_0x3f1039,_0x3f1628[_0xce53('0x55')],_0x8291dc);}else{return getUser(_0x3f1039,null,_0x8291dc);}})[_0xce53('0x27')](function(_0x188051){_0xd9042d=_0x188051;return getEndUser(_0x3f1039,_0x12dcff,_0x4e6410[_0xce53('0x67')],_0x4e6410[_0xce53('0x68')],_0x8291dc);})[_0xce53('0x27')](function(_0x4ea94f){_0x5c8b44=_0x4ea94f;return getTicket(_0x3f1039,_0xd9042d,_0x5c8b44,_0x12dcff,_0x4e6410,_0x12dcff[_0xce53('0x77')],_0x8291dc);})[_0xce53('0x27')](function(_0x436f6f){_0x5e9549=_0x436f6f;logger[_0xce53('0x1f')]('['+_0x4e6410['lastevent']['toUpperCase']()+_0xce53('0x7e'),_0x5e9549['id']);logger[_0xce53('0x1f')]('['+_0x4e6410[_0xce53('0x7d')][_0xce53('0x7f')]()+_0xce53('0x80'),_0x3f1039[_0xce53('0x4e')]);})[_0xce53('0x7b')](function(_0x5eb529){logger[_0xce53('0x70')]('['+_0x4e6410[_0xce53('0x7d')][_0xce53('0x7f')]()+']',_0x5eb529);});}; \ 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 7292e8d..5c90239 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 _0x02e1=['push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','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','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','isNil','email','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','then','length','adminId','result','sys_id','],\x20getAdminUser\x20crm','message','toUpperCase','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm','error','info',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','],\x20EndUser\x20schema','endUserId','catch','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variable','customVariable','Variable','name','outbound','Subjects','getString','Descriptions','Fields','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','incident','Incident'];(function(_0x15bc9c,_0x503e40){var _0x1cb34f=function(_0x36910b){while(--_0x36910b){_0x15bc9c['push'](_0x15bc9c['shift']());}};_0x1cb34f(++_0x503e40);}(_0x02e1,0x1c6));var _0x102e=function(_0x556e63,_0x16abaf){_0x556e63=_0x556e63-0x0;var _0x1f18a9=_0x02e1[_0x556e63];return _0x1f18a9;};'use strict';var _=require(_0x102e('0x0'));var Promise=require(_0x102e('0x1'));var rp=require(_0x102e('0x2'));var util=require(_0x102e('0x3'));var md5=require(_0x102e('0x4'));var Redis=require(_0x102e('0x5'));var intUtil=require(_0x102e('0x6'));var config=require('../../../../config/environment');var logger=require(_0x102e('0x7'))(_0x102e('0x8'));config['redis']=_['defaults'](config[_0x102e('0x9')],{'host':_0x102e('0xa'),'port':0x18eb});var io=require(_0x102e('0xb'))(new Redis(config[_0x102e('0x9')]));function getAdminUser(_0x1d1ffd,_0x3413c7,_0x2a291f,_0x2085b8,_0x599f9f,_0x54d422){return new Promise(function(_0x49ebf5,_0x2fc7bd){var _0x769091={'method':'GET','uri':_0x2085b8+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x599f9f+'&'+_0x54d422,'auth':_0x3413c7,'json':!![]};return rp(_0x769091)[_0x102e('0xc')](function(_0x53a94a){if(_0x53a94a['result'][_0x102e('0xd')]>0x0){_0x2a291f[_0x102e('0xe')]=_0x53a94a[_0x102e('0xf')][0x0][_0x102e('0x10')];}logger['info']('['+[_0x1d1ffd['toUpperCase']()]+_0x102e('0x11'),_0x2a291f);_0x49ebf5(_0x2a291f);})['catch'](function(_0x4df9a0){logger['error']('['+[_0x1d1ffd['toUpperCase']()]+']',_0x4df9a0['message']);_0x2fc7bd(_0x4df9a0[_0x102e('0x12')]);});});}function getUser(_0x35fee9,_0x4f4fe5,_0x1a8574,_0x5eb05d,_0x213c67){return function(_0x1365de){logger['info']('['+[_0x35fee9[_0x102e('0x13')]()]+_0x102e('0x14'),_0x1365de);return new Promise(function(_0x50f5f6,_0x389b34){if(intUtil[_0x102e('0x15')](_0x1365de[_0x102e('0x16')])){var _0x4c9ff8={'method':_0x102e('0x17'),'uri':_0x1a8574+'sys_user?sysparm_query=email%3D'+_0x1365de[_0x102e('0x16')]+'&'+_0x5eb05d+'&'+_0x213c67,'auth':_0x4f4fe5,'json':!![]};logger['info']('['+[_0x35fee9['toUpperCase']()]+_0x102e('0x18'),_0x4c9ff8);return rp(_0x4c9ff8)['then'](function(_0x3d4c06){logger['info']('['+[_0x35fee9[_0x102e('0x13')]()]+_0x102e('0x19'),_0x3d4c06);if(_0x3d4c06[_0x102e('0xf')][_0x102e('0xd')]>0x0&&String(_0x3d4c06['result'][0x0][_0x102e('0x1a')])===_0x102e('0x1b')){_0x1365de['userId']=_0x3d4c06[_0x102e('0xf')][0x0]['sys_id'];}else{_0x1365de[_0x102e('0x1c')]=_0x1365de[_0x102e('0xe')];_0x1365de[_0x102e('0x16')]=_0x1365de[_0x102e('0x1d')];}logger['info']('['+[_0x35fee9[_0x102e('0x13')]()]+_0x102e('0x1e'),_0x1365de);_0x50f5f6(_0x1365de);})['catch'](function(_0x49922a){logger[_0x102e('0x1f')]('['+[_0x35fee9[_0x102e('0x13')]()]+']',_0x49922a[_0x102e('0x12')]);_0x389b34(_0x49922a[_0x102e('0x12')]);});}else{logger[_0x102e('0x20')]('['+[_0x35fee9['toUpperCase']()]+_0x102e('0x21'));_0x1365de[_0x102e('0x1c')]=_0x1365de[_0x102e('0xe')];_0x1365de[_0x102e('0x16')]=_0x1365de[_0x102e('0x1d')];_0x50f5f6(_0x1365de);}});};}function createEndUser(_0x368d3d,_0x3e08a8,_0x30ecbb,_0x378d91,_0x500977){logger['info']('['+[_0x368d3d[_0x102e('0x13')]()]+_0x102e('0x22'),_0x30ecbb);return new Promise(function(_0x88d179,_0x1f12a4){var _0x266c99={'method':_0x102e('0x23'),'uri':_0x378d91+_0x102e('0x24')+_0x500977,'body':{'user_name':_0x30ecbb[_0x102e('0x25')],'roles':'user','first_name':_0x30ecbb[_0x102e('0x25')],'active':_0x102e('0x1b'),'date_format':'System','phone':_0x30ecbb['endUserNumber']},'auth':_0x3e08a8,'json':!![]};return rp(_0x266c99)[_0x102e('0xc')](function(_0x300cb0){logger['info']('['+[_0x368d3d['toUpperCase']()]+_0x102e('0x26'),_0x300cb0[_0x102e('0xf')]);_0x30ecbb[_0x102e('0x27')]=_0x300cb0[_0x102e('0xf')][_0x102e('0x10')];_0x88d179(_0x30ecbb);})[_0x102e('0x28')](function(_0x29d686){logger[_0x102e('0x1f')]('['+[_0x368d3d[_0x102e('0x13')]()]+']',_0x29d686[_0x102e('0x12')]);_0x1f12a4(_0x29d686[_0x102e('0x12')]);});});}function getEndUser(_0xb634ed,_0x16da05,_0x456cde,_0x32274d,_0x303fe7){return function(_0xa986c6){logger[_0x102e('0x20')]('['+[_0xb634ed[_0x102e('0x13')]()]+_0x102e('0x29'),_0xa986c6);return new Promise(function(_0x54e3ad,_0x164077){var _0x12fe2a={'method':_0x102e('0x17'),'uri':_0x456cde+'sys_user?sysparm_query=phone%3D'+_0xa986c6['endUserNumber']+'&'+_0x32274d+'&'+_0x303fe7,'auth':_0x16da05,'json':!![]};return rp(_0x12fe2a)['then'](function(_0x362bbb){if(_0x362bbb[_0x102e('0xf')][_0x102e('0xd')]>0x0){_0xa986c6[_0x102e('0x27')]=_0x362bbb[_0x102e('0xf')][0x0][_0x102e('0x10')];logger[_0x102e('0x20')]('['+[_0xb634ed['toUpperCase']()]+_0x102e('0x2a'),_0xa986c6);_0x54e3ad(_0xa986c6);}else{return createEndUser(_0xb634ed,_0x16da05,_0xa986c6,_0x456cde,_0x32274d)[_0x102e('0xc')](function(_0x174566){logger[_0x102e('0x20')]('['+[_0xb634ed[_0x102e('0x13')]()]+'],\x20createEndUser\x20crm',_0x174566);_0x54e3ad(_0x174566);});}})[_0x102e('0x28')](function(_0x4b7e1d){logger['error']('['+[_0xb634ed[_0x102e('0x13')]()]+']',_0x4b7e1d[_0x102e('0x12')]);_0x164077(_0x4b7e1d[_0x102e('0x12')]);});});};}function getCustomFields(_0x3978c3,_0x4b144c){var _0x12e236={};if(_0x3978c3[_0x102e('0xd')]>0x0){_[_0x102e('0x2b')](_0x3978c3,function(_0x2f0759){if(_[_0x102e('0x2c')]([_0x102e('0x2d'),_0x102e('0x2e')],_0x2f0759[_0x102e('0x2f')])&&_0x2f0759[_0x102e('0x30')]&&!_0x2f0759[_0x102e('0x31')]){_0x12e236[_0x2f0759[_0x102e('0x30')][_0x102e('0x32')]()]=_0x2f0759[_0x102e('0x33')][_0x102e('0x34')]();}else if(_[_0x102e('0x2c')]([_0x102e('0x2d'),_0x102e('0x2e')],_0x2f0759[_0x102e('0x2f')])&&_0x2f0759[_0x102e('0x35')]&&_0x2f0759['customField']){_0x12e236[_0x2f0759[_0x102e('0x35')][_0x102e('0x32')]()]=_0x2f0759[_0x102e('0x33')][_0x102e('0x34')]();}else if(_0x2f0759['type']===_0x102e('0x36')&&_0x2f0759['variableName']&&_0x2f0759[_0x102e('0x35')]&&_0x2f0759['customField']){_0x12e236[_0x2f0759[_0x102e('0x35')]['toLowerCase']()]=_0x4b144c[_0x2f0759['variableName']]['toString']();}else if(_0x2f0759[_0x102e('0x2f')]===_0x102e('0x37')&&_0x2f0759[_0x102e('0x38')]&&_0x2f0759[_0x102e('0x38')][_0x102e('0x39')]&&_0x2f0759[_0x102e('0x35')]&&_0x2f0759['customField']){_0x12e236[_0x2f0759[_0x102e('0x35')][_0x102e('0x32')]()]=_0x4b144c[_0x2f0759[_0x102e('0x38')][_0x102e('0x39')]['toLowerCase']()]['toString']();}});}return _0x12e236;}function getTicket(_0x38c8c2,_0x6e8831,_0x1d62a1,_0x5ae8f0,_0x43cf72,_0x141341){return function(_0x48c8b6){logger[_0x102e('0x20')]('['+[_0x38c8c2[_0x102e('0x13')]()]+']\x20getTicket\x20input\x20crm',_0x48c8b6);return new Promise(function(_0x3626a4,_0x31d8a8){var _0x3c2bb2=_0x38c8c2[_0x102e('0x32')]()===_0x102e('0x3a')?_0x48c8b6[_0x102e('0x1c')]:_0x48c8b6[_0x102e('0x27')];var _0x243b16={'method':_0x102e('0x23'),'uri':_0x1d62a1+'incident'+'?'+_0x141341,'body':Object['assign']({},{'active':_0x102e('0x1b'),'caller_id':_0x3c2bb2,'assigned_to':_0x48c8b6[_0x102e('0x1c')],'short_description':intUtil['getString'](_0x5ae8f0[_0x102e('0x3b')],_0x43cf72,'\x20'),'description':intUtil[_0x102e('0x3c')](_0x5ae8f0[_0x102e('0x3d')],_0x43cf72,'\x0a')},getCustomFields(_0x5ae8f0[_0x102e('0x3e')],_0x43cf72)),'auth':_0x6e8831,'json':!![]};return rp(_0x243b16)[_0x102e('0xc')](function(_0x1bbe51){logger[_0x102e('0x20')]('['+[_0x38c8c2['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x1bbe51['result']);_0x48c8b6[_0x102e('0x3f')]=_0x1bbe51[_0x102e('0xf')][_0x102e('0x10')];_0x48c8b6[_0x102e('0x40')]=_0x1bbe51[_0x102e('0xf')][_0x102e('0x41')];logger[_0x102e('0x20')]('['+[_0x38c8c2['toUpperCase']()]+_0x102e('0x42'),_0x48c8b6);_0x3626a4(_0x48c8b6);})[_0x102e('0x28')](function(_0x5c7563){logger['error']('['+[_0x38c8c2[_0x102e('0x13')]()]+']',_0x5c7563[_0x102e('0x12')]);_0x31d8a8(_0x5c7563['message']);});});};}function createRemoteTag(_0x41f23f,_0x9da6c7,_0x38a23a,_0x132aef){return new Promise(function(_0x26cd66,_0xbf3b0f){var _0x340338={'method':_0x102e('0x23'),'uri':_0x38a23a+_0x102e('0x43')+'?'+_0x132aef,'body':{'short_description':_0x41f23f,'global':!![],'active':!![],'name':_0x41f23f},'auth':_0x9da6c7,'json':!![]};return rp(_0x340338)[_0x102e('0xc')](function(_0x31409e){var _0x3a8818=_0x31409e[_0x102e('0xf')][_0x102e('0x10')];_0x26cd66(_0x3a8818);});});}function getRemoteTag(_0x179796,_0x1f5fcb,_0x73c01d,_0x24353a,_0x4d6b2f){return new Promise(function(_0x2fee4d,_0x4ab213){var _0x52b7f9={'method':'GET','uri':_0x73c01d+_0x102e('0x43')+_0x102e('0x44')+_0x179796+'&'+_0x24353a,'auth':_0x1f5fcb,'json':!![]};return rp(_0x52b7f9)[_0x102e('0xc')](function(_0x4b9ac5){if(_0x4b9ac5[_0x102e('0xf')]['length']>0x0){var _0x4bddc9=_0x4b9ac5[_0x102e('0xf')][0x0]['sys_id'];_0x2fee4d(_0x4bddc9);}else{return createRemoteTag(_0x179796,_0x1f5fcb,_0x73c01d,_0x24353a)[_0x102e('0xc')](function(_0x194b39){_0x2fee4d(_0x194b39);});}});});}function assignTagToIncident(_0x2b2708,_0x2085c0,_0x15b24b,_0x3b6868,_0x2ab5d7){return new Promise(function(_0x107a1a,_0xd95280){var _0x51d224={'method':_0x102e('0x23'),'uri':_0x15b24b+'label_entry'+'?'+_0x2ab5d7,'body':{'label':_0x2b2708,'table':_0x102e('0x45'),'id_type':_0x102e('0x46'),'table_key':_0x3b6868[_0x102e('0x3f')],'title':'Incident\x20-\x20'+_0x3b6868[_0x102e('0x40')],'id_display':_0x3b6868['ticketNumber']},'auth':_0x2085c0,'json':!![]};return rp(_0x51d224)[_0x102e('0xc')](function(_0x12273d){_0x107a1a();})['catch'](function(){_0x107a1a();});});}function manageTags(_0x434e51,_0x307412,_0x264dae,_0x5d5247,_0x36fc75,_0xe27857,_0x2ad339){return new Promise(function(_0x115001,_0x3ee677){var _0x51e7ae=[];_0x307412['forEach'](function(_0x1e2592){_0x51e7ae[_0x102e('0x47')](getRemoteTag(_0x1e2592,_0x264dae,_0x5d5247,_0xe27857,_0x2ad339));});return Promise[_0x102e('0x48')](_0x51e7ae)[_0x102e('0xc')](function(_0x3b76f4){if(_0x3b76f4[_0x102e('0xd')]){logger[_0x102e('0x20')]('['+[_0x434e51[_0x102e('0x13')]()]+_0x102e('0x49'),_0x3b76f4);var _0x1cede4=[];_0x3b76f4[_0x102e('0x2b')](function(_0x3d454a){_0x1cede4[_0x102e('0x47')](assignTagToIncident(_0x3d454a,_0x264dae,_0x5d5247,_0x36fc75,_0xe27857));});return Promise[_0x102e('0x48')](_0x1cede4)['then'](function(){_0x115001();})['catch'](function(){_0x115001();});}else{_0x115001();}});});}function getTags(_0x811618,_0x11b459,_0x11b2b3,_0x6aa688,_0x5f2223,_0x4534e6){return function(_0x34a15e){return new Promise(function(_0x2a530d,_0x9a887e){var _0x311734=[];var _0x9357f5=_0x6aa688['Tags'];if(_0x9357f5&&_0x9357f5[_0x102e('0xd')]>0x0){_0x311734=_[_0x102e('0x4a')](_0x9357f5,_0x102e('0x39'));}if(_0x311734[_0x102e('0xd')]>0x0){return manageTags(_0x811618,_0x311734,_0x11b459,_0x11b2b3,_0x34a15e,_0x5f2223,_0x4534e6)[_0x102e('0xc')](function(){_0x2a530d(_0x34a15e);});}else{_0x2a530d(_0x34a15e);}});};}function emit(_0x442ada,_0x4ebb72,_0x4c75af){var _0x5b0704=_0x102e('0x4b')+_0x102e('0x4c')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x102e('0x4d');var _0x17f15b={'uri':_0x442ada+_0x102e('0x4e')+_0x4c75af+_0x5b0704};io['to'](util[_0x102e('0x4f')](_0x102e('0x50'),_0x4ebb72))['emit'](_0x102e('0x51'),_0x17f15b);}exports['cs']=function(_0x34b31b,_0x2f246f,_0x5d67fb,_0x103f56,_0x2b7bd6,_0x13fa41,_0x227168,_0x512bf7){var _0x2ee70f={};var _0x324ed5={'user':_0x13fa41[_0x102e('0x52')],'pass':_0x13fa41[_0x102e('0x53')]};var _0x19f4ef=_0x102e('0x54');var _0x2cf4ec=_0x102e('0x55');_0x13fa41[_0x102e('0x56')]=intUtil['stripTrailingSlash'](_0x13fa41[_0x102e('0x56')]);_0x13fa41['serverUrl']=intUtil[_0x102e('0x57')](_0x13fa41[_0x102e('0x58')]);var _0x589447=util[_0x102e('0x4f')]('%s/api/now/table/',_0x13fa41['remoteUri']);_0x2ee70f[_0x102e('0x16')]=!_[_0x102e('0x59')](_0x103f56)?_0x103f56[_0x102e('0x5a')]:null;_0x2ee70f[_0x102e('0x1d')]=_0x13fa41[_0x102e('0x5a')];_0x2ee70f[_0x102e('0x25')]=_0x512bf7[_0x102e('0x32')]()===_0x102e('0x3a')?_0x2f246f['destcalleridnum']:_0x2f246f[_0x102e('0x5b')];_0x2ee70f[_0x102e('0x5c')]=_0x512bf7===_0x102e('0x5d')||_0x512bf7===_0x102e('0x5e')?_0x102e('0x5d'):_0x102e('0x3a');var _0x3e3505=util[_0x102e('0x4f')](_0x102e('0x5f'),_0x13fa41[_0x102e('0x58')],_0x2f246f[_0x102e('0x60')],md5(_0x2f246f[_0x102e('0x60')]));if(_0x2b7bd6&&_0x2b7bd6[_0x102e('0x61')]){logger[_0x102e('0x20')]('[QUEUE]',_0x102e('0x62'));_0x2f246f[_0x102e('0x63')]=_0x3e3505;}else if(_0x227168&&_0x227168[_0x102e('0x64')]&&_0x227168[_0x102e('0x64')]!==_0x102e('0x65')){logger[_0x102e('0x20')]('[OUTBOUND]',_0x102e('0x62'));_0x2f246f[_0x102e('0x63')]=_0x3e3505;}else{_0x2f246f['recordingURL']='';}return getAdminUser(_0x512bf7,_0x324ed5,_0x2ee70f,_0x589447,_0x2cf4ec,_0x19f4ef)[_0x102e('0xc')](getUser(_0x512bf7,_0x324ed5,_0x589447,_0x2cf4ec,_0x19f4ef))[_0x102e('0xc')](getEndUser(_0x512bf7,_0x324ed5,_0x589447,_0x2cf4ec,_0x19f4ef))[_0x102e('0xc')](getTicket(_0x512bf7,_0x324ed5,_0x589447,_0x5d67fb,_0x2f246f,_0x2cf4ec))[_0x102e('0xc')](function(_0x23ef1b){logger['info'](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x23ef1b['ticketId']));logger['info'](util[_0x102e('0x4f')](_0x102e('0x66'),_0x512bf7));if(_0x512bf7!==_0x102e('0x5e')){logger[_0x102e('0x20')]('['+[_0x512bf7['toUpperCase']()]+']',_0x102e('0x67'));emit(_0x13fa41[_0x102e('0x56')],_0x103f56['name'],_0x23ef1b[_0x102e('0x3f')]);}})['catch'](function(_0x17fb8e){logger['error']('['+[_0x512bf7['toUpperCase']()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x102e('0x68')](_0x17fb8e,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x51b5=['[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','userId','adminEmail','],\x20getUser\x20crm','catch','message',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','true','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','error','includes','string','picklist','customField','nameField','toLowerCase','content','toString','type','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','label_entry','Incident','ticketNumber','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','map','%26sysparm_record_target%3Dincident','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','isNil','email','endUserNumber','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x51b5,0x79));var _0x551b=function(_0x1875a1,_0x5dfb6a){_0x1875a1=_0x1875a1-0x0;var _0x4aa855=_0x51b5[_0x1875a1];return _0x4aa855;};'use strict';var _=require(_0x551b('0x0'));var Promise=require('bluebird');var rp=require(_0x551b('0x1'));var util=require('util');var md5=require(_0x551b('0x2'));var Redis=require(_0x551b('0x3'));var intUtil=require(_0x551b('0x4'));var config=require(_0x551b('0x5'));var logger=require(_0x551b('0x6'))(_0x551b('0x7'));config[_0x551b('0x8')]=_['defaults'](config[_0x551b('0x8')],{'host':_0x551b('0x9'),'port':0x18eb});var io=require(_0x551b('0xa'))(new Redis(config[_0x551b('0x8')]));function getAdminUser(_0x593b21,_0x19d958,_0x933175,_0x390754,_0x29f37d,_0x53b59e){return new Promise(function(_0x784b9c,_0x529ce2){var _0x1ff2ae={'method':_0x551b('0xb'),'uri':_0x390754+_0x551b('0xc')+'&'+_0x29f37d+'&'+_0x53b59e,'auth':_0x19d958,'json':!![]};return rp(_0x1ff2ae)[_0x551b('0xd')](function(_0x52d7bf){if(_0x52d7bf[_0x551b('0xe')][_0x551b('0xf')]>0x0){_0x933175[_0x551b('0x10')]=_0x52d7bf[_0x551b('0xe')][0x0][_0x551b('0x11')];}logger[_0x551b('0x12')]('['+[_0x593b21[_0x551b('0x13')]()]+_0x551b('0x14'),_0x933175);_0x784b9c(_0x933175);})['catch'](function(_0xe8c68f){logger['error']('['+[_0x593b21[_0x551b('0x13')]()]+']',_0xe8c68f['message']);_0x529ce2(_0xe8c68f['message']);});});}function getUser(_0x19e2e1,_0x5aa9c4,_0x5be2d0,_0xe7eca4,_0x335e9b){return function(_0x2fa06e){logger[_0x551b('0x12')]('['+[_0x19e2e1[_0x551b('0x13')]()]+'],\x20getUser\x20input\x20crm',_0x2fa06e);return new Promise(function(_0x227170,_0x19c7b3){if(intUtil[_0x551b('0x15')](_0x2fa06e[_0x551b('0x16')])){var _0x5d3b9b={'method':_0x551b('0xb'),'uri':_0x5be2d0+_0x551b('0x17')+_0x2fa06e[_0x551b('0x16')]+'&'+_0xe7eca4+'&'+_0x335e9b,'auth':_0x5aa9c4,'json':!![]};logger[_0x551b('0x12')]('['+[_0x19e2e1['toUpperCase']()]+'],\x20getUser\x20rp\x20obj',_0x5d3b9b);return rp(_0x5d3b9b)[_0x551b('0xd')](function(_0x4b515a){logger[_0x551b('0x12')]('['+[_0x19e2e1[_0x551b('0x13')]()]+_0x551b('0x18'),_0x4b515a);if(_0x4b515a[_0x551b('0xe')]['length']>0x0&&String(_0x4b515a[_0x551b('0xe')][0x0][_0x551b('0x19')])==='true'){_0x2fa06e[_0x551b('0x1a')]=_0x4b515a['result'][0x0][_0x551b('0x11')];}else{_0x2fa06e[_0x551b('0x1a')]=_0x2fa06e[_0x551b('0x10')];_0x2fa06e['userEmail']=_0x2fa06e[_0x551b('0x1b')];}logger[_0x551b('0x12')]('['+[_0x19e2e1[_0x551b('0x13')]()]+_0x551b('0x1c'),_0x2fa06e);_0x227170(_0x2fa06e);})[_0x551b('0x1d')](function(_0x51c259){logger['error']('['+[_0x19e2e1[_0x551b('0x13')]()]+']',_0x51c259['message']);_0x19c7b3(_0x51c259[_0x551b('0x1e')]);});}else{logger[_0x551b('0x12')]('['+[_0x19e2e1[_0x551b('0x13')]()]+_0x551b('0x1f'));_0x2fa06e[_0x551b('0x1a')]=_0x2fa06e[_0x551b('0x10')];_0x2fa06e[_0x551b('0x16')]=_0x2fa06e['adminEmail'];_0x227170(_0x2fa06e);}});};}function createEndUser(_0x3fa999,_0x3ecee3,_0x34fe2d,_0x27aac6,_0x1c4d4b){logger[_0x551b('0x12')]('['+[_0x3fa999[_0x551b('0x13')]()]+_0x551b('0x20'),_0x34fe2d);return new Promise(function(_0x1912a2,_0x58bbdb){var _0x437c75={'method':_0x551b('0x21'),'uri':_0x27aac6+_0x551b('0x22')+_0x1c4d4b,'body':{'user_name':_0x34fe2d['endUserNumber'],'roles':_0x551b('0x23'),'first_name':_0x34fe2d['endUserNumber'],'active':_0x551b('0x24'),'date_format':_0x551b('0x25'),'phone':_0x34fe2d['endUserNumber']},'auth':_0x3ecee3,'json':!![]};return rp(_0x437c75)[_0x551b('0xd')](function(_0x5185f2){logger[_0x551b('0x12')]('['+[_0x3fa999[_0x551b('0x13')]()]+_0x551b('0x26'),_0x5185f2[_0x551b('0xe')]);_0x34fe2d[_0x551b('0x27')]=_0x5185f2['result'][_0x551b('0x11')];_0x1912a2(_0x34fe2d);})['catch'](function(_0xeb554d){logger['error']('['+[_0x3fa999[_0x551b('0x13')]()]+']',_0xeb554d[_0x551b('0x1e')]);_0x58bbdb(_0xeb554d[_0x551b('0x1e')]);});});}function getEndUser(_0x55d31f,_0x4c9dbb,_0x35c238,_0x1e21bb,_0x19cd9e){return function(_0x4fe17b){logger[_0x551b('0x12')]('['+[_0x55d31f['toUpperCase']()]+_0x551b('0x28'),_0x4fe17b);return new Promise(function(_0x5e76e9,_0x48d69c){var _0x545481={'method':'GET','uri':_0x35c238+_0x551b('0x29')+_0x4fe17b['endUserNumber']+'&'+_0x1e21bb+'&'+_0x19cd9e,'auth':_0x4c9dbb,'json':!![]};return rp(_0x545481)['then'](function(_0x4861ac){if(_0x4861ac[_0x551b('0xe')][_0x551b('0xf')]>0x0){_0x4fe17b[_0x551b('0x27')]=_0x4861ac[_0x551b('0xe')][0x0]['sys_id'];logger[_0x551b('0x12')]('['+[_0x55d31f[_0x551b('0x13')]()]+_0x551b('0x2a'),_0x4fe17b);_0x5e76e9(_0x4fe17b);}else{return createEndUser(_0x55d31f,_0x4c9dbb,_0x4fe17b,_0x35c238,_0x1e21bb)['then'](function(_0x4715a5){logger[_0x551b('0x12')]('['+[_0x55d31f['toUpperCase']()]+_0x551b('0x2b'),_0x4715a5);_0x5e76e9(_0x4715a5);});}})['catch'](function(_0x2a5e92){logger[_0x551b('0x2c')]('['+[_0x55d31f[_0x551b('0x13')]()]+']',_0x2a5e92[_0x551b('0x1e')]);_0x48d69c(_0x2a5e92[_0x551b('0x1e')]);});});};}function getCustomFields(_0xf63443,_0x5e7130){var _0x53b7ae={};if(_0xf63443['length']>0x0){_['forEach'](_0xf63443,function(_0x3358ec){if(_[_0x551b('0x2d')]([_0x551b('0x2e'),_0x551b('0x2f')],_0x3358ec['type'])&&_0x3358ec['nameField']&&!_0x3358ec[_0x551b('0x30')]){_0x53b7ae[_0x3358ec[_0x551b('0x31')][_0x551b('0x32')]()]=_0x3358ec[_0x551b('0x33')][_0x551b('0x34')]();}else if(_[_0x551b('0x2d')](['string','picklist'],_0x3358ec[_0x551b('0x35')])&&_0x3358ec['idField']&&_0x3358ec['customField']){_0x53b7ae[_0x3358ec[_0x551b('0x36')][_0x551b('0x32')]()]=_0x3358ec[_0x551b('0x33')][_0x551b('0x34')]();}else if(_0x3358ec[_0x551b('0x35')]===_0x551b('0x37')&&_0x3358ec[_0x551b('0x38')]&&_0x3358ec['idField']&&_0x3358ec[_0x551b('0x30')]){_0x53b7ae[_0x3358ec['idField'][_0x551b('0x32')]()]=_0x5e7130[_0x3358ec[_0x551b('0x38')]][_0x551b('0x34')]();}else if(_0x3358ec[_0x551b('0x35')]===_0x551b('0x39')&&_0x3358ec[_0x551b('0x3a')]&&_0x3358ec[_0x551b('0x3a')][_0x551b('0x3b')]&&_0x3358ec['idField']&&_0x3358ec[_0x551b('0x30')]){_0x53b7ae[_0x3358ec[_0x551b('0x36')]['toLowerCase']()]=_0x5e7130[_0x3358ec[_0x551b('0x3a')][_0x551b('0x3b')]['toLowerCase']()]['toString']();}});}return _0x53b7ae;}function getTicket(_0x1cf214,_0x16ea72,_0x198ecc,_0x132938,_0x1af504,_0x3a1d6c){return function(_0x13c0ea){logger[_0x551b('0x12')]('['+[_0x1cf214[_0x551b('0x13')]()]+_0x551b('0x3c'),_0x13c0ea);return new Promise(function(_0xcfc2a6,_0x5b5109){var _0x35d554=_0x1cf214[_0x551b('0x32')]()===_0x551b('0x3d')?_0x13c0ea[_0x551b('0x1a')]:_0x13c0ea[_0x551b('0x27')];var _0x599fbc={'method':_0x551b('0x21'),'uri':_0x198ecc+_0x551b('0x3e')+'?'+_0x3a1d6c,'body':Object[_0x551b('0x3f')]({},{'active':'true','caller_id':_0x35d554,'assigned_to':_0x13c0ea['userId'],'short_description':intUtil[_0x551b('0x40')](_0x132938[_0x551b('0x41')],_0x1af504,'\x20'),'description':intUtil['getString'](_0x132938[_0x551b('0x42')],_0x1af504,'\x0a')},getCustomFields(_0x132938[_0x551b('0x43')],_0x1af504)),'auth':_0x16ea72,'json':!![]};return rp(_0x599fbc)[_0x551b('0xd')](function(_0x5a79ea){logger[_0x551b('0x12')]('['+[_0x1cf214['toUpperCase']()]+_0x551b('0x44'),_0x5a79ea[_0x551b('0xe')]);_0x13c0ea[_0x551b('0x45')]=_0x5a79ea[_0x551b('0xe')][_0x551b('0x11')];_0x13c0ea['ticketNumber']=_0x5a79ea['result'][_0x551b('0x46')];logger['info']('['+[_0x1cf214[_0x551b('0x13')]()]+_0x551b('0x47'),_0x13c0ea);_0xcfc2a6(_0x13c0ea);})['catch'](function(_0x4ce56d){logger['error']('['+[_0x1cf214[_0x551b('0x13')]()]+']',_0x4ce56d[_0x551b('0x1e')]);_0x5b5109(_0x4ce56d[_0x551b('0x1e')]);});});};}function createRemoteTag(_0x6be601,_0xdbe236,_0x4c51e9,_0x4d9f2d){return new Promise(function(_0x3e1ed3,_0x32b592){var _0x2820d4={'method':_0x551b('0x21'),'uri':_0x4c51e9+'label'+'?'+_0x4d9f2d,'body':{'short_description':_0x6be601,'global':!![],'active':!![],'name':_0x6be601},'auth':_0xdbe236,'json':!![]};return rp(_0x2820d4)[_0x551b('0xd')](function(_0x52b56d){var _0x2546d6=_0x52b56d[_0x551b('0xe')][_0x551b('0x11')];_0x3e1ed3(_0x2546d6);});});}function getRemoteTag(_0x2c3e15,_0x5876fb,_0x1e24c9,_0x115d9c,_0x28c57c){return new Promise(function(_0x1fc34c,_0x503f5f){var _0x41d372={'method':_0x551b('0xb'),'uri':_0x1e24c9+_0x551b('0x48')+'?sysparm_query=name%3D'+_0x2c3e15+'&'+_0x115d9c,'auth':_0x5876fb,'json':!![]};return rp(_0x41d372)[_0x551b('0xd')](function(_0x634a00){if(_0x634a00[_0x551b('0xe')]['length']>0x0){var _0x12e919=_0x634a00['result'][0x0][_0x551b('0x11')];_0x1fc34c(_0x12e919);}else{return createRemoteTag(_0x2c3e15,_0x5876fb,_0x1e24c9,_0x115d9c)[_0x551b('0xd')](function(_0x2cc0bd){_0x1fc34c(_0x2cc0bd);});}});});}function assignTagToIncident(_0x31f327,_0x117309,_0x566e2b,_0x2bddd4,_0x4f5e28){return new Promise(function(_0x47af84,_0x2be906){var _0x503f40={'method':_0x551b('0x21'),'uri':_0x566e2b+_0x551b('0x49')+'?'+_0x4f5e28,'body':{'label':_0x31f327,'table':_0x551b('0x3e'),'id_type':_0x551b('0x4a'),'table_key':_0x2bddd4['ticketId'],'title':'Incident\x20-\x20'+_0x2bddd4[_0x551b('0x4b')],'id_display':_0x2bddd4[_0x551b('0x4b')]},'auth':_0x117309,'json':!![]};return rp(_0x503f40)['then'](function(_0x5e2284){_0x47af84();})[_0x551b('0x1d')](function(){_0x47af84();});});}function manageTags(_0x3b410a,_0x54c329,_0x5c51b8,_0xd0efad,_0x174dbd,_0x307b83,_0x5c3e4e){return new Promise(function(_0x5a187b,_0x5a9305){var _0x12d057=[];_0x54c329[_0x551b('0x4c')](function(_0x3ff1f6){_0x12d057[_0x551b('0x4d')](getRemoteTag(_0x3ff1f6,_0x5c51b8,_0xd0efad,_0x307b83,_0x5c3e4e));});return Promise[_0x551b('0x4e')](_0x12d057)[_0x551b('0xd')](function(_0x13763a){if(_0x13763a[_0x551b('0xf')]){logger[_0x551b('0x12')]('['+[_0x3b410a['toUpperCase']()]+_0x551b('0x4f'),_0x13763a);var _0x30c13f=[];_0x13763a[_0x551b('0x4c')](function(_0x3827ac){_0x30c13f[_0x551b('0x4d')](assignTagToIncident(_0x3827ac,_0x5c51b8,_0xd0efad,_0x174dbd,_0x307b83));});return Promise[_0x551b('0x4e')](_0x30c13f)['then'](function(){_0x5a187b();})[_0x551b('0x1d')](function(){_0x5a187b();});}else{_0x5a187b();}});});}function getTags(_0x4696d6,_0x5bc1dd,_0x1649ef,_0x514ea7,_0x18bd7a,_0x4ca931){return function(_0x4fc412){return new Promise(function(_0x1b20c2,_0x554798){var _0x4e71d3=[];var _0x141e86=_0x514ea7['Tags'];if(_0x141e86&&_0x141e86['length']>0x0){_0x4e71d3=_[_0x551b('0x50')](_0x141e86,'name');}if(_0x4e71d3[_0x551b('0xf')]>0x0){return manageTags(_0x4696d6,_0x4e71d3,_0x5bc1dd,_0x1649ef,_0x4fc412,_0x18bd7a,_0x4ca931)[_0x551b('0xd')](function(){_0x1b20c2(_0x4fc412);});}else{_0x1b20c2(_0x4fc412);}});};}function emit(_0x4b133a,_0x297de5,_0x32d8d0){var _0x8ced98=_0x551b('0x51')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x551b('0x52');var _0xb4b386={'uri':_0x4b133a+_0x551b('0x53')+_0x32d8d0+_0x8ced98};io['to'](util[_0x551b('0x54')](_0x551b('0x55'),_0x297de5))[_0x551b('0x56')](_0x551b('0x57'),_0xb4b386);}exports['cs']=function(_0x2b5c80,_0x53473a,_0x199c99,_0x17bb10,_0x5a8aa5,_0x42db2b,_0x15c994,_0x30bb16){var _0x5afa43={};var _0x267960={'user':_0x42db2b[_0x551b('0x58')],'pass':_0x42db2b[_0x551b('0x59')]};var _0x432add=_0x551b('0x5a');var _0x539b35=_0x551b('0x5b');_0x42db2b['remoteUri']=intUtil[_0x551b('0x5c')](_0x42db2b[_0x551b('0x5d')]);_0x42db2b[_0x551b('0x5e')]=intUtil[_0x551b('0x5c')](_0x42db2b[_0x551b('0x5e')]);var _0x286827=util[_0x551b('0x54')](_0x551b('0x5f'),_0x42db2b['remoteUri']);_0x5afa43[_0x551b('0x16')]=!_[_0x551b('0x60')](_0x17bb10)?_0x17bb10[_0x551b('0x61')]:null;_0x5afa43[_0x551b('0x1b')]=_0x42db2b[_0x551b('0x61')];_0x5afa43[_0x551b('0x62')]=_0x30bb16['toLowerCase']()===_0x551b('0x3d')?_0x53473a['destcalleridnum']:_0x53473a[_0x551b('0x63')];_0x5afa43[_0x551b('0x64')]=_0x30bb16===_0x551b('0x65')||_0x30bb16==='unmanaged'?_0x551b('0x65'):_0x551b('0x3d');var _0x5b6aa0=util[_0x551b('0x54')](_0x551b('0x66'),_0x42db2b['serverUrl'],_0x53473a[_0x551b('0x67')],md5(_0x53473a['uniqueid']));if(_0x5a8aa5&&_0x5a8aa5[_0x551b('0x68')]){logger[_0x551b('0x12')](_0x551b('0x69'),_0x551b('0x6a'));_0x53473a[_0x551b('0x6b')]=_0x5b6aa0;}else if(_0x15c994&&_0x15c994[_0x551b('0x6c')]&&_0x15c994[_0x551b('0x6c')]!==_0x551b('0x6d')){logger[_0x551b('0x12')]('[OUTBOUND]',_0x551b('0x6a'));_0x53473a[_0x551b('0x6b')]=_0x5b6aa0;}else{_0x53473a[_0x551b('0x6b')]='';}return getAdminUser(_0x30bb16,_0x267960,_0x5afa43,_0x286827,_0x539b35,_0x432add)[_0x551b('0xd')](getUser(_0x30bb16,_0x267960,_0x286827,_0x539b35,_0x432add))[_0x551b('0xd')](getEndUser(_0x30bb16,_0x267960,_0x286827,_0x539b35,_0x432add))['then'](getTicket(_0x30bb16,_0x267960,_0x286827,_0x199c99,_0x53473a,_0x539b35))[_0x551b('0xd')](function(_0xff8b48){logger[_0x551b('0x12')](util['format'](_0x551b('0x6e'),_0xff8b48[_0x551b('0x45')]));logger['info'](util[_0x551b('0x54')](_0x551b('0x6f'),_0x30bb16));if(_0x30bb16!==_0x551b('0x70')){logger[_0x551b('0x12')]('['+[_0x30bb16['toUpperCase']()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x42db2b[_0x551b('0x5d')],_0x17bb10[_0x551b('0x3b')],_0xff8b48[_0x551b('0x45')]);}})[_0x551b('0x1d')](function(_0x19e914){logger[_0x551b('0x2c')]('['+[_0x30bb16[_0x551b('0x13')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util['inspect'](_0x19e914,{'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 54a3f70..91a22ad 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 _0x3ac3=['Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','charAt','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','lastevent','toUpperCase','lodash','bluebird','md5','ioredis','./util','sugarcrm','redis','localhost','socket.io-emitter','POST','emit','info','name','Subjects','assigned_user_id','created_by','description','getString','date_start','toISOString','slice','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','variableName','push','idField','set_entry','JSON','stringify','Calls','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','then','entry_list','find','user_name','value','Agent\x20found!','resolve','name_value_list','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','format','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Enduser\x20created.','first_name','debug','[HTTP]','merge','map','forEach','type','string','nameField','customField','toLowerCase','custom_fields','content','variable','Variable','login','username','password','PLAIN','sessionID'];(function(_0x346803,_0x1b58dc){var _0x13d91d=function(_0x5573f5){while(--_0x5573f5){_0x346803['push'](_0x346803['shift']());}};_0x13d91d(++_0x1b58dc);}(_0x3ac3,0x122));var _0x33ac=function(_0x1a8ff0,_0x20788d){_0x1a8ff0=_0x1a8ff0-0x0;var _0x3588bf=_0x3ac3[_0x1a8ff0];return _0x3588bf;};'use strict';var _=require(_0x33ac('0x0'));var rp=require('request-promise');var BPromise=require(_0x33ac('0x1'));var md5=require(_0x33ac('0x2'));var util=require('util');var Redis=require(_0x33ac('0x3'));var intUtil=require(_0x33ac('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x33ac('0x5'));config[_0x33ac('0x6')]=_['defaults'](config['redis'],{'host':_0x33ac('0x7'),'port':0x18eb});var io=require(_0x33ac('0x8'))(new Redis(config[_0x33ac('0x6')]));var def={'method':_0x33ac('0x9'),'json':!![]};function emit(_0x48918d,_0x2b3e18,_0x2ce306){io['to'](_0x48918d)[_0x33ac('0xa')](_0x2b3e18,_0x2ce306);}function getTicket(_0x3fabab,_0x2e887c,_0x2ebd91,_0x3b75c6,_0x6905c1,_0x5f4ebd,_0x38ba55,_0x4abff6){logger[_0x33ac('0xb')]('Creating\x20new\x20ticket...');var _0x336886=new Date();var _0x25c249=[{'name':_0x33ac('0xc'),'value':intUtil['getString'](_0x3b75c6[_0x33ac('0xd')],_0x6905c1,'\x20')},{'name':_0x33ac('0xe'),'value':_0x2e887c['id']},{'name':_0x33ac('0xf'),'value':_0x2e887c['id']},{'name':_0x33ac('0x10'),'value':intUtil[_0x33ac('0x11')](_0x3b75c6['Descriptions'],_0x6905c1,'\x0a')},{'name':_0x33ac('0x12'),'value':_0x336886[_0x33ac('0x13')]()[_0x33ac('0x14')](0x0,0x13)['replace']('T','\x20')},{'name':_0x33ac('0x15'),'value':'0'},{'name':_0x33ac('0x16'),'value':'15'},{'name':_0x33ac('0x17'),'value':_0x2ebd91['id']},{'name':_0x33ac('0x18'),'value':_0x33ac('0x19')},{'name':_0x33ac('0x1a'),'value':_0x2ebd91[_0x33ac('0xc')]},{'name':_0x33ac('0x1b'),'value':_0x4abff6}];if(_0x5f4ebd[_0x33ac('0x1c')]){_['forEach'](_0x5f4ebd,function(_0x2ef9bb){if(_0x6905c1[_0x2ef9bb[_0x33ac('0x1d')]]){_0x25c249[_0x33ac('0x1e')]({'name':_0x2ef9bb[_0x33ac('0x1f')],'value':_0x6905c1[_0x2ef9bb[_0x33ac('0x1d')]]});}});}return request({'form':{'method':_0x33ac('0x20'),'input_type':_0x33ac('0x21'),'response_type':'JSON','rest_data':JSON[_0x33ac('0x22')]({'session':_0x38ba55['id'],'module_name':_0x33ac('0x23'),'name_value_list':_0x25c249})}});}function getAuth(_0x3d7de3){return util['format'](_0x33ac('0x24'),new Buffer(_0x3d7de3[_0x33ac('0x25')]+':X')[_0x33ac('0x26')](_0x33ac('0x27')));}function getServerInfo(_0x3e075f){return request({'form':{'method':_0x33ac('0x28'),'input_type':_0x33ac('0x21'),'response_type':_0x33ac('0x21'),'rest_data':JSON[_0x33ac('0x22')]({'session':_0x3e075f['id']})}});}function getUser(_0x2f8d85,_0x42acdc,_0x353633){if(!_[_0x33ac('0x29')](_0x42acdc)){logger[_0x33ac('0xb')](_0x33ac('0x2a'),_0x42acdc);return request({'form':{'method':_0x33ac('0x2b'),'input_type':_0x33ac('0x21'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x353633['id'],'module_name':_0x33ac('0x2c'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x42acdc),'order_by':'','offset':'0','select_fields':['id',_0x33ac('0xc'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x33ac('0x2d')](function(_0x24afeb){if(_0x24afeb[_0x33ac('0x2e')][_0x33ac('0x1c')]){var _0x8c86c7=_[_0x33ac('0x2f')](_0x24afeb[_0x33ac('0x2e')],function(_0x40742f){return _0x40742f['name_value_list'][_0x33ac('0x30')][_0x33ac('0x31')]===_0x42acdc;});if(_0x8c86c7){logger[_0x33ac('0xb')](_0x33ac('0x32'));return BPromise[_0x33ac('0x33')]({'id':_0x8c86c7[_0x33ac('0x34')]['id'][_0x33ac('0x31')],'name':_0x8c86c7[_0x33ac('0x34')][_0x33ac('0xc')][_0x33ac('0x31')]});}}logger[_0x33ac('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x353633[_0x33ac('0x34')][_0x33ac('0x35')][_0x33ac('0x31')],'name':_0x353633[_0x33ac('0x34')][_0x33ac('0x30')][_0x33ac('0x31')]});});}else{logger['info'](_0x33ac('0x36'));return BPromise[_0x33ac('0x33')]({'id':_0x353633[_0x33ac('0x34')][_0x33ac('0x35')]['value'],'name':_0x353633['name_value_list'][_0x33ac('0x30')][_0x33ac('0x31')]});}}function getEndUser(_0x5eb751,_0x14aaeb,_0xb899d7,_0x17469f){logger['info'](_0x33ac('0x37'),_0xb899d7);return request({'form':{'method':'get_entry_list','input_type':_0x33ac('0x21'),'response_type':_0x33ac('0x21'),'rest_data':JSON['stringify']({'session':_0x17469f['id'],'module_name':_0x33ac('0x19'),'query':util[_0x33ac('0x38')]('contacts.phone_home\x20=\x20\x22%s\x22',_0xb899d7),'order_by':'','offset':'0','select_fields':['id',_0x33ac('0xc'),_0x33ac('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x33ac('0x2d')](function(_0x4322a7){if(_0x4322a7[_0x33ac('0x2e')][_0x33ac('0x1c')]){var _0x970ac9=_[_0x33ac('0x2f')](_0x4322a7[_0x33ac('0x2e')],function(_0x594ffe){return _0x594ffe[_0x33ac('0x34')]['phone_home'][_0x33ac('0x31')]===_0xb899d7;});if(_0x970ac9){logger[_0x33ac('0xb')](_0x33ac('0x3a'));return BPromise[_0x33ac('0x33')]({'id':_0x970ac9[_0x33ac('0x34')]['id']['value'],'name':_0x970ac9[_0x33ac('0x34')][_0x33ac('0xc')]['value'],'phone':_0x970ac9['name_value_list']['phone_home'][_0x33ac('0x31')]});}}else{logger['info'](_0x33ac('0x3b'));return request({'form':{'method':_0x33ac('0x20'),'input_type':_0x33ac('0x21'),'response_type':_0x33ac('0x21'),'rest_data':JSON[_0x33ac('0x22')]({'session':_0x17469f['id'],'module_name':_0x33ac('0x19'),'name_value_list':[{'name':'first_name','value':_0x14aaeb!==_0x33ac('0x3c')?_0x14aaeb:util[_0x33ac('0x38')]('Caller\x20-\x20%s',_0xb899d7)},{'name':_0x33ac('0x39'),'value':_0xb899d7}]})}})['then'](function(_0x31f0f4){logger[_0x33ac('0xb')](_0x33ac('0x3d'));return BPromise['resolve']({'id':_0x31f0f4['id'],'name':_0x31f0f4[_0x33ac('0x2e')][_0x33ac('0x3e')][_0x33ac('0x31')],'phone':_0x31f0f4[_0x33ac('0x2e')][_0x33ac('0x39')]['value']});});}});}function request(_0x14e3db){logger[_0x33ac('0x3f')](_0x33ac('0x40'),JSON['stringify'](_0x14e3db));return rp(_[_0x33ac('0x41')](def,_0x14e3db));}function getTags(_0x29ead7,_0x22dc18){var _0x54f3b5=[];if(_0x29ead7&&_0x29ead7[_0x33ac('0x1c')]>0x0){_0x54f3b5=_[_0x33ac('0x42')](_0x29ead7,_0x22dc18);}return _0x54f3b5;}function getCustomFields(_0x297690,_0x237039){var _0x472d52=[];var _0x3944c6={'custom_fields':[]};if(_0x297690[_0x33ac('0x1c')]>0x0){_[_0x33ac('0x43')](_0x297690,function(_0x322a60){if(_0x322a60[_0x33ac('0x44')]===_0x33ac('0x45')&&_0x322a60[_0x33ac('0x46')]&&!_0x322a60[_0x33ac('0x47')]){_0x3944c6[_0x322a60[_0x33ac('0x46')][_0x33ac('0x48')]()]=_0x322a60['content'][_0x33ac('0x26')]();}else if(_0x322a60[_0x33ac('0x44')]==='string'&&_0x322a60[_0x33ac('0x1f')]&&_0x322a60['customField']){_0x3944c6[_0x33ac('0x49')]['push']({'id':_0x322a60['idField'],'value':_0x322a60[_0x33ac('0x4a')][_0x33ac('0x26')]()});}else if(_0x322a60[_0x33ac('0x44')]===_0x33ac('0x4b')&&_0x322a60[_0x33ac('0x1d')]&&_0x322a60[_0x33ac('0x1f')]&&_0x322a60[_0x33ac('0x47')]){_0x237039[_0x322a60[_0x33ac('0x1d')]]&&_0x3944c6[_0x33ac('0x49')]['push']({'id':_0x322a60['idField'],'value':_0x237039[_0x322a60[_0x33ac('0x1d')]][_0x33ac('0x26')]()});}else if(_0x322a60['type']==='customVariable'&&_0x322a60[_0x33ac('0x4c')]&&_0x322a60['Variable'][_0x33ac('0xc')]&&_0x322a60['idField']&&_0x322a60[_0x33ac('0x47')]){_0x237039[_0x322a60[_0x33ac('0x4c')][_0x33ac('0xc')][_0x33ac('0x48')]()]&&_0x3944c6[_0x33ac('0x49')][_0x33ac('0x1e')]({'id':_0x322a60[_0x33ac('0x1f')],'value':_0x237039[_0x322a60[_0x33ac('0x4c')]['name']['toLowerCase']()]['toString']()});}});}return _0x3944c6;}function getConnection(_0x25a00d){return request({'method':_0x33ac('0x9'),'form':{'method':_0x33ac('0x4d'),'input_type':_0x33ac('0x21'),'response_type':_0x33ac('0x21'),'rest_data':JSON[_0x33ac('0x22')]({'user_auth':{'user_name':_0x25a00d[_0x33ac('0x4e')],'password':_0x25a00d[_0x33ac('0x4f')],'encryption':_0x33ac('0x50')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x33ac('0x2d')](function(_0x341b2e){var _0x471a24=_0x341b2e;if(_0x471a24['id']){def[_0x33ac('0x51')]=_0x471a24['id'];return BPromise['resolve'](_0x471a24);}else{throw new Error(util[_0x33ac('0x38')](_0x33ac('0x52'),_0x25a00d['id']));}});}function setRelationship(_0x3437f5,_0x29d727,_0x4938db,_0x5ebe58){return request({'form':{'method':_0x33ac('0x53'),'input_type':_0x33ac('0x21'),'response_type':'JSON','rest_data':JSON[_0x33ac('0x22')]({'session':_0x3437f5['id'],'module_name':_0x33ac('0x23'),'module_id':_0x4938db['id'],'link_field_name':_0x5ebe58,'related_ids':[_0x29d727['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x1db9c2,_0x500e78,_0x3cd754,_0x10231f,_0x2ecbd8,_0x44f016){var _0x4374dd,_0xb48c02,_0x2de7b7,_0x4fbae6;_0x44f016[_0x33ac('0x54')]=intUtil[_0x33ac('0x55')](_0x44f016[_0x33ac('0x54')]);_0x44f016['serverUrl']=intUtil[_0x33ac('0x55')](_0x44f016[_0x33ac('0x56')]);def[_0x33ac('0x57')]=util['format'](_0x33ac('0x58'),_0x44f016[_0x33ac('0x54')]);if(_0x2ecbd8&&_0x2ecbd8[_0x33ac('0x59')]){logger['info'](_0x33ac('0x5a'),_0x33ac('0x5b'));_0x500e78[_0x33ac('0x5c')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x44f016[_0x33ac('0x56')],_0x500e78[_0x33ac('0x5d')],md5(_0x500e78[_0x33ac('0x5d')]));}else{_0x500e78[_0x33ac('0x5c')]='';}return getConnection(_0x44f016)[_0x33ac('0x2d')](function(_0x110718){_0x4fbae6=_0x110718;return getUser(_0x44f016,_0x10231f[_0x33ac('0xc')],_0x4fbae6);})[_0x33ac('0x2d')](function(_0xdd489b){_0x4374dd=_0xdd489b;logger[_0x33ac('0xb')](_0x33ac('0x5e'),_0x4374dd['id']);return getEndUser(_0x44f016,_0x500e78[_0x33ac('0x5f')],_0x500e78[_0x33ac('0x60')],_0x4fbae6);})[_0x33ac('0x2d')](function(_0x4ac662){_0xb48c02=_0x4ac662;logger[_0x33ac('0xb')]('The\x20Enduser\x20ID\x20is:',_0xb48c02['id']);return getTicket(_0x44f016,_0x4374dd,_0xb48c02,_0x3cd754,_0x500e78,_0x3cd754[_0x33ac('0x61')],_0x4fbae6,_0x33ac('0x62'));})[_0x33ac('0x2d')](function(_0x5c8571){_0x2de7b7=_0x5c8571;logger[_0x33ac('0xb')](_0x33ac('0x63'));logger['info'](_0x33ac('0x64'),_0x2de7b7['id']);return setRelationship(_0x4fbae6,_0x4374dd,_0x2de7b7,_0x33ac('0x65'));})['then'](function(){return setRelationship(_0x4fbae6,_0xb48c02,_0x2de7b7,_0x33ac('0x66'));})[_0x33ac('0x2d')](function(){return getServerInfo(_0x4fbae6);})[_0x33ac('0x2d')](function(_0xff65cc){var _0x3a55d8=parseInt(_0xff65cc[_0x33ac('0x67')]['charAt'](0x0));var _0x47ce9b=util[_0x33ac('0x38')](_0x33ac('0x68'),_0x44f016[_0x33ac('0x54')],_0x2de7b7['id']);if(_0x3a55d8>0x6){_0x47ce9b=util['format'](_0x33ac('0x69'),_0x44f016[_0x33ac('0x54')],_0x2de7b7['id']);}logger[_0x33ac('0xb')](_0x33ac('0x5a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x33ac('0x38')](_0x33ac('0x6a'),_0x10231f[_0x33ac('0xc')]),_0x33ac('0x6b'),{'uri':_0x47ce9b});})[_0x33ac('0x6c')](function(_0x40e692){logger[_0x33ac('0x6d')](_0x33ac('0x5a'),JSON[_0x33ac('0x22')](_0x40e692));});};exports[_0x33ac('0x6e')]=function(_0x5f37a9,_0x36a244,_0x5f43e0,_0x64135,_0x345baf,_0x82af3a,_0x232b53){var _0x371450,_0x52ceda,_0x36715c,_0x8da2cc;_0x82af3a[_0x33ac('0x54')]=intUtil['stripTrailingSlash'](_0x82af3a['remoteUri']);_0x82af3a[_0x33ac('0x56')]=intUtil[_0x33ac('0x55')](_0x82af3a[_0x33ac('0x56')]);def['uri']=util[_0x33ac('0x38')](_0x33ac('0x58'),_0x82af3a[_0x33ac('0x54')]);if(_0x232b53&&_0x232b53[_0x33ac('0x6f')]&&_0x232b53['recordingFormat']!==_0x33ac('0x70')){logger[_0x33ac('0xb')](_0x33ac('0x71'),_0x33ac('0x5b'));_0x36a244['recordingURL']=util[_0x33ac('0x38')](_0x33ac('0x72'),_0x82af3a[_0x33ac('0x56')],_0x36a244['uniqueid'],md5(_0x36a244[_0x33ac('0x5d')]));}return getConnection(_0x82af3a)[_0x33ac('0x2d')](function(_0x461dea){_0x8da2cc=_0x461dea;return getUser(_0x82af3a,_0x64135[_0x33ac('0xc')],_0x8da2cc);})['then'](function(_0x445339){_0x371450=_0x445339;logger['info'](_0x33ac('0x5e'),_0x371450['id']);return getEndUser(_0x82af3a,_0x36a244[_0x33ac('0x73')],_0x36a244[_0x33ac('0x74')],_0x8da2cc);})['then'](function(_0x4ffbdf){_0x52ceda=_0x4ffbdf;logger[_0x33ac('0xb')](_0x33ac('0x75'),_0x52ceda['id']);return getTicket(_0x82af3a,_0x371450,_0x52ceda,_0x5f43e0,_0x36a244,_0x5f43e0['Fields'],_0x8da2cc,_0x33ac('0x76'));})[_0x33ac('0x2d')](function(_0x429170){_0x36715c=_0x429170;logger[_0x33ac('0xb')]('Ticket\x20created!');logger['info'](_0x33ac('0x64'),_0x36715c['id']);return setRelationship(_0x8da2cc,_0x371450,_0x36715c,_0x33ac('0x65'));})[_0x33ac('0x2d')](function(){return setRelationship(_0x8da2cc,_0x52ceda,_0x36715c,_0x33ac('0x66'));})[_0x33ac('0x2d')](function(){return getServerInfo(_0x8da2cc);})[_0x33ac('0x2d')](function(_0x403a70){var _0x3c6333=parseInt(_0x403a70[_0x33ac('0x67')][_0x33ac('0x77')](0x0));var _0x3afc01=util['format'](_0x33ac('0x68'),_0x82af3a['remoteUri'],_0x36715c['id']);if(_0x3c6333>0x6){_0x3afc01=util[_0x33ac('0x38')](_0x33ac('0x69'),_0x82af3a[_0x33ac('0x54')],_0x36715c['id']);}logger[_0x33ac('0xb')]('[OUTBOUND]',_0x33ac('0x78'));emit(util[_0x33ac('0x38')](_0x33ac('0x6a'),_0x64135[_0x33ac('0xc')]),_0x33ac('0x6b'),{'uri':_0x3afc01});})[_0x33ac('0x6c')](function(_0x312737){logger[_0x33ac('0x6d')]('[OUTBOUND]',JSON[_0x33ac('0x22')](_0x312737));});};exports[_0x33ac('0x79')]=function(_0x2fe284,_0x3f5ffe,_0xef48f6,_0x4c50f5,_0x30f08e,_0x2cb6f7){var _0x1132c6,_0x4d18b5,_0x2f382e,_0x7f3191;_0x2cb6f7[_0x33ac('0x54')]=intUtil[_0x33ac('0x55')](_0x2cb6f7[_0x33ac('0x54')]);_0x2cb6f7[_0x33ac('0x56')]=intUtil['stripTrailingSlash'](_0x2cb6f7[_0x33ac('0x56')]);def[_0x33ac('0x57')]=util[_0x33ac('0x38')](_0x33ac('0x58'),_0x2cb6f7['remoteUri']);if(_0x30f08e&&_0x30f08e[_0x33ac('0x59')]){logger[_0x33ac('0xb')]('['+_0x3f5ffe[_0x33ac('0x7a')][_0x33ac('0x7b')]()+']',_0x33ac('0x5b'));_0x3f5ffe[_0x33ac('0x5c')]=util[_0x33ac('0x38')](_0x33ac('0x72'),_0x2cb6f7['serverUrl'],_0x3f5ffe['uniqueid'],md5(_0x3f5ffe[_0x33ac('0x5d')]));}else{_0x3f5ffe['recordingURL']='';}return getConnection(_0x2cb6f7)[_0x33ac('0x2d')](function(_0x486505){_0x7f3191=_0x486505;if(!_[_0x33ac('0x29')](_0x4c50f5)){return getUser(_0x2cb6f7,_0x4c50f5[_0x33ac('0xc')],_0x7f3191);}else{return getUser(_0x2cb6f7,null,_0x7f3191);}})[_0x33ac('0x2d')](function(_0x1d0b6f){_0x1132c6=_0x1d0b6f;logger[_0x33ac('0xb')](_0x33ac('0x5e'),_0x1132c6['id']);return getEndUser(_0x2cb6f7,_0x3f5ffe[_0x33ac('0x5f')],_0x3f5ffe[_0x33ac('0x60')],_0x7f3191);})['then'](function(_0x414b86){_0x4d18b5=_0x414b86;logger['info'](_0x33ac('0x75'),_0x4d18b5['id']);return getTicket(_0x2cb6f7,_0x1132c6,_0x4d18b5,_0xef48f6,_0x3f5ffe,_0xef48f6[_0x33ac('0x61')],_0x7f3191,_0x33ac('0x62'));})['then'](function(_0x58f6ed){_0x2f382e=_0x58f6ed;logger[_0x33ac('0xb')]('Ticket\x20created!');logger[_0x33ac('0xb')](_0x33ac('0x64'),_0x2f382e['id']);return setRelationship(_0x7f3191,_0x1132c6,_0x2f382e,_0x33ac('0x65'));})[_0x33ac('0x2d')](function(){return setRelationship(_0x7f3191,_0x4d18b5,_0x2f382e,'contacts');})[_0x33ac('0x2d')](function(){return getServerInfo(_0x7f3191);})[_0x33ac('0x6c')](function(_0x3d76a7){logger[_0x33ac('0x6d')]('['+_0x3f5ffe[_0x33ac('0x7a')][_0x33ac('0x7b')]()+']',JSON['stringify'](_0x3d76a7));});}; \ No newline at end of file +var _0xea1e=['Getting\x20agent\x20with\x20name','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','length','find','name_value_list','value','Agent\x20found!','resolve','user_id','Searching\x20enduser\x20with\x20phone','get_entry_list','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','set_entry','first_name','','debug','merge','map','forEach','type','string','nameField','content','custom_fields','variable','customVariable','Variable','customField','toLowerCase','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','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','error','outbound','%s/service/v4_1/rest.php','recordingFormat','destcalleridname','destcalleridnum','Fields','Outbound','[OUTBOUND]','unmanaged','toUpperCase','calleridnum','The\x20Enduser\x20ID\x20is:','lastevent','lodash','bluebird','md5','util','ioredis','../../../../config/environment','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','getString','Subjects','assigned_user_id','description','date_start','toISOString','slice','duration_hours','duration_minutes','parent_type','parent_name','name','direction','push','idField','variableName','JSON','format','Basic\x20%s','apiKey','toString','get_server_info','stringify','isNil','info'];(function(_0x5cbbd7,_0x458913){var _0x355b19=function(_0x373f5c){while(--_0x373f5c){_0x5cbbd7['push'](_0x5cbbd7['shift']());}};_0x355b19(++_0x458913);}(_0xea1e,0x137));var _0xeea1=function(_0x8b6835,_0x1e5c84){_0x8b6835=_0x8b6835-0x0;var _0x2f8294=_0xea1e[_0x8b6835];return _0x2f8294;};'use strict';var _=require(_0xeea1('0x0'));var rp=require('request-promise');var BPromise=require(_0xeea1('0x1'));var md5=require(_0xeea1('0x2'));var util=require(_0xeea1('0x3'));var Redis=require(_0xeea1('0x4'));var intUtil=require('./util');var config=require(_0xeea1('0x5'));var logger=require('../../../../config/logger')(_0xeea1('0x6'));config[_0xeea1('0x7')]=_[_0xeea1('0x8')](config[_0xeea1('0x7')],{'host':_0xeea1('0x9'),'port':0x18eb});var io=require(_0xeea1('0xa'))(new Redis(config[_0xeea1('0x7')]));var def={'method':_0xeea1('0xb'),'json':!![]};function emit(_0x372d06,_0x551476,_0x45cd2c){io['to'](_0x372d06)['emit'](_0x551476,_0x45cd2c);}function getTicket(_0x52efbb,_0x1b3e6b,_0x1e5215,_0x540a7d,_0x569bb4,_0x1ac229,_0x3c3505,_0x646b23){logger['info']('Creating\x20new\x20ticket...');var _0x6c06fa=new Date();var _0xd8b1eb=[{'name':'name','value':intUtil[_0xeea1('0xc')](_0x540a7d[_0xeea1('0xd')],_0x569bb4,'\x20')},{'name':_0xeea1('0xe'),'value':_0x1b3e6b['id']},{'name':'created_by','value':_0x1b3e6b['id']},{'name':_0xeea1('0xf'),'value':intUtil[_0xeea1('0xc')](_0x540a7d['Descriptions'],_0x569bb4,'\x0a')},{'name':_0xeea1('0x10'),'value':_0x6c06fa[_0xeea1('0x11')]()[_0xeea1('0x12')](0x0,0x13)['replace']('T','\x20')},{'name':_0xeea1('0x13'),'value':'0'},{'name':_0xeea1('0x14'),'value':'15'},{'name':'parent_id','value':_0x1e5215['id']},{'name':_0xeea1('0x15'),'value':'Contacts'},{'name':_0xeea1('0x16'),'value':_0x1e5215[_0xeea1('0x17')]},{'name':_0xeea1('0x18'),'value':_0x646b23}];if(_0x1ac229['length']){_['forEach'](_0x1ac229,function(_0xa6a856){if(_0x569bb4[_0xa6a856['variableName']]){_0xd8b1eb[_0xeea1('0x19')]({'name':_0xa6a856[_0xeea1('0x1a')],'value':_0x569bb4[_0xa6a856[_0xeea1('0x1b')]]});}});}return request({'form':{'method':'set_entry','input_type':_0xeea1('0x1c'),'response_type':_0xeea1('0x1c'),'rest_data':JSON['stringify']({'session':_0x3c3505['id'],'module_name':'Calls','name_value_list':_0xd8b1eb})}});}function getAuth(_0x1a7480){return util[_0xeea1('0x1d')](_0xeea1('0x1e'),new Buffer(_0x1a7480[_0xeea1('0x1f')]+':X')[_0xeea1('0x20')]('base64'));}function getServerInfo(_0x57ae98){return request({'form':{'method':_0xeea1('0x21'),'input_type':_0xeea1('0x1c'),'response_type':'JSON','rest_data':JSON[_0xeea1('0x22')]({'session':_0x57ae98['id']})}});}function getUser(_0x210cb4,_0x28ad83,_0x18da13){if(!_[_0xeea1('0x23')](_0x28ad83)){logger[_0xeea1('0x24')](_0xeea1('0x25'),_0x28ad83);return request({'form':{'method':'get_entry_list','input_type':_0xeea1('0x1c'),'response_type':_0xeea1('0x1c'),'rest_data':JSON[_0xeea1('0x22')]({'session':_0x18da13['id'],'module_name':'Employees','query':util[_0xeea1('0x1d')](_0xeea1('0x26'),_0x28ad83),'order_by':'','offset':'0','select_fields':['id','name',_0xeea1('0x27')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xeea1('0x28')](function(_0x1c6975){if(_0x1c6975[_0xeea1('0x29')][_0xeea1('0x2a')]){var _0x7b20f5=_[_0xeea1('0x2b')](_0x1c6975[_0xeea1('0x29')],function(_0x508aae){return _0x508aae[_0xeea1('0x2c')][_0xeea1('0x27')][_0xeea1('0x2d')]===_0x28ad83;});if(_0x7b20f5){logger[_0xeea1('0x24')](_0xeea1('0x2e'));return BPromise[_0xeea1('0x2f')]({'id':_0x7b20f5['name_value_list']['id'][_0xeea1('0x2d')],'name':_0x7b20f5[_0xeea1('0x2c')][_0xeea1('0x17')][_0xeea1('0x2d')]});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x18da13[_0xeea1('0x2c')][_0xeea1('0x30')]['value'],'name':_0x18da13['name_value_list'][_0xeea1('0x27')][_0xeea1('0x2d')]});});}else{logger[_0xeea1('0x24')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0xeea1('0x2f')]({'id':_0x18da13['name_value_list'][_0xeea1('0x30')][_0xeea1('0x2d')],'name':_0x18da13[_0xeea1('0x2c')][_0xeea1('0x27')][_0xeea1('0x2d')]});}}function getEndUser(_0x3fb17a,_0x4c0e9e,_0x1af22e,_0x2411d1){logger['info'](_0xeea1('0x31'),_0x1af22e);return request({'form':{'method':_0xeea1('0x32'),'input_type':_0xeea1('0x1c'),'response_type':_0xeea1('0x1c'),'rest_data':JSON['stringify']({'session':_0x2411d1['id'],'module_name':_0xeea1('0x33'),'query':util[_0xeea1('0x1d')](_0xeea1('0x34'),_0x1af22e),'order_by':'','offset':'0','select_fields':['id','name','phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xeea1('0x28')](function(_0x291641){if(_0x291641['entry_list']['length']){var _0x303a64=_[_0xeea1('0x2b')](_0x291641[_0xeea1('0x29')],function(_0x12f05a){return _0x12f05a[_0xeea1('0x2c')][_0xeea1('0x35')][_0xeea1('0x2d')]===_0x1af22e;});if(_0x303a64){logger[_0xeea1('0x24')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x303a64[_0xeea1('0x2c')]['id'][_0xeea1('0x2d')],'name':_0x303a64['name_value_list'][_0xeea1('0x17')][_0xeea1('0x2d')],'phone':_0x303a64[_0xeea1('0x2c')][_0xeea1('0x35')][_0xeea1('0x2d')]});}}else{logger[_0xeea1('0x24')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0xeea1('0x36'),'input_type':_0xeea1('0x1c'),'response_type':_0xeea1('0x1c'),'rest_data':JSON[_0xeea1('0x22')]({'session':_0x2411d1['id'],'module_name':'Contacts','name_value_list':[{'name':_0xeea1('0x37'),'value':_0x4c0e9e!==_0xeea1('0x38')?_0x4c0e9e:util[_0xeea1('0x1d')]('Caller\x20-\x20%s',_0x1af22e)},{'name':'phone_home','value':_0x1af22e}]})}})[_0xeea1('0x28')](function(_0x4ea738){logger[_0xeea1('0x24')]('Enduser\x20created.');return BPromise['resolve']({'id':_0x4ea738['id'],'name':_0x4ea738['entry_list'][_0xeea1('0x37')][_0xeea1('0x2d')],'phone':_0x4ea738[_0xeea1('0x29')][_0xeea1('0x35')]['value']});});}});}function request(_0x2745eb){logger[_0xeea1('0x39')]('[HTTP]',JSON[_0xeea1('0x22')](_0x2745eb));return rp(_[_0xeea1('0x3a')](def,_0x2745eb));}function getTags(_0x2d170c,_0x44b22a){var _0x5a61f1=[];if(_0x2d170c&&_0x2d170c[_0xeea1('0x2a')]>0x0){_0x5a61f1=_[_0xeea1('0x3b')](_0x2d170c,_0x44b22a);}return _0x5a61f1;}function getCustomFields(_0x68cddb,_0x59b21c){var _0x5ba1f0=[];var _0x172859={'custom_fields':[]};if(_0x68cddb[_0xeea1('0x2a')]>0x0){_[_0xeea1('0x3c')](_0x68cddb,function(_0x4085fa){if(_0x4085fa[_0xeea1('0x3d')]===_0xeea1('0x3e')&&_0x4085fa['nameField']&&!_0x4085fa['customField']){_0x172859[_0x4085fa[_0xeea1('0x3f')]['toLowerCase']()]=_0x4085fa[_0xeea1('0x40')][_0xeea1('0x20')]();}else if(_0x4085fa[_0xeea1('0x3d')]===_0xeea1('0x3e')&&_0x4085fa[_0xeea1('0x1a')]&&_0x4085fa['customField']){_0x172859[_0xeea1('0x41')][_0xeea1('0x19')]({'id':_0x4085fa[_0xeea1('0x1a')],'value':_0x4085fa['content'][_0xeea1('0x20')]()});}else if(_0x4085fa[_0xeea1('0x3d')]===_0xeea1('0x42')&&_0x4085fa[_0xeea1('0x1b')]&&_0x4085fa[_0xeea1('0x1a')]&&_0x4085fa['customField']){_0x59b21c[_0x4085fa[_0xeea1('0x1b')]]&&_0x172859[_0xeea1('0x41')][_0xeea1('0x19')]({'id':_0x4085fa[_0xeea1('0x1a')],'value':_0x59b21c[_0x4085fa[_0xeea1('0x1b')]][_0xeea1('0x20')]()});}else if(_0x4085fa['type']===_0xeea1('0x43')&&_0x4085fa[_0xeea1('0x44')]&&_0x4085fa[_0xeea1('0x44')][_0xeea1('0x17')]&&_0x4085fa['idField']&&_0x4085fa[_0xeea1('0x45')]){_0x59b21c[_0x4085fa['Variable'][_0xeea1('0x17')][_0xeea1('0x46')]()]&&_0x172859['custom_fields'][_0xeea1('0x19')]({'id':_0x4085fa[_0xeea1('0x1a')],'value':_0x59b21c[_0x4085fa[_0xeea1('0x44')][_0xeea1('0x17')][_0xeea1('0x46')]()][_0xeea1('0x20')]()});}});}return _0x172859;}function getConnection(_0x486419){return request({'method':_0xeea1('0xb'),'form':{'method':_0xeea1('0x47'),'input_type':_0xeea1('0x1c'),'response_type':'JSON','rest_data':JSON[_0xeea1('0x22')]({'user_auth':{'user_name':_0x486419[_0xeea1('0x48')],'password':_0x486419[_0xeea1('0x49')],'encryption':_0xeea1('0x4a')},'application':_0xeea1('0x4b')})}})[_0xeea1('0x28')](function(_0x25bad0){var _0x2a52a7=_0x25bad0;if(_0x2a52a7['id']){def[_0xeea1('0x4c')]=_0x2a52a7['id'];return BPromise[_0xeea1('0x2f')](_0x2a52a7);}else{throw new Error(util[_0xeea1('0x1d')](_0xeea1('0x4d'),_0x486419['id']));}});}function setRelationship(_0x1690e2,_0x1b7855,_0xf05e88,_0x102897){return request({'form':{'method':_0xeea1('0x4e'),'input_type':_0xeea1('0x1c'),'response_type':_0xeea1('0x1c'),'rest_data':JSON['stringify']({'session':_0x1690e2['id'],'module_name':'Calls','module_id':_0xf05e88['id'],'link_field_name':_0x102897,'related_ids':[_0x1b7855['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x467660,_0x310a1e,_0x29abb3,_0x1df9a7,_0x5c2961,_0x6631da){var _0x4ed2d3,_0x4700e4,_0x3eeaf9,_0x27da2c;_0x6631da[_0xeea1('0x4f')]=intUtil[_0xeea1('0x50')](_0x6631da[_0xeea1('0x4f')]);_0x6631da[_0xeea1('0x51')]=intUtil['stripTrailingSlash'](_0x6631da[_0xeea1('0x51')]);def[_0xeea1('0x52')]=util[_0xeea1('0x1d')]('%s/service/v4_1/rest.php',_0x6631da['remoteUri']);if(_0x5c2961&&_0x5c2961[_0xeea1('0x53')]){logger[_0xeea1('0x24')](_0xeea1('0x54'),_0xeea1('0x55'));_0x310a1e[_0xeea1('0x56')]=util[_0xeea1('0x1d')](_0xeea1('0x57'),_0x6631da[_0xeea1('0x51')],_0x310a1e['uniqueid'],md5(_0x310a1e[_0xeea1('0x58')]));}else{_0x310a1e[_0xeea1('0x56')]='';}return getConnection(_0x6631da)[_0xeea1('0x28')](function(_0x2bf147){_0x27da2c=_0x2bf147;return getUser(_0x6631da,_0x1df9a7[_0xeea1('0x17')],_0x27da2c);})[_0xeea1('0x28')](function(_0x1c7ffd){_0x4ed2d3=_0x1c7ffd;logger[_0xeea1('0x24')](_0xeea1('0x59'),_0x4ed2d3['id']);return getEndUser(_0x6631da,_0x310a1e[_0xeea1('0x5a')],_0x310a1e['calleridnum'],_0x27da2c);})[_0xeea1('0x28')](function(_0x1b9169){_0x4700e4=_0x1b9169;logger[_0xeea1('0x24')]('The\x20Enduser\x20ID\x20is:',_0x4700e4['id']);return getTicket(_0x6631da,_0x4ed2d3,_0x4700e4,_0x29abb3,_0x310a1e,_0x29abb3['Fields'],_0x27da2c,_0xeea1('0x5b'));})[_0xeea1('0x28')](function(_0x2fd4f2){_0x3eeaf9=_0x2fd4f2;logger['info'](_0xeea1('0x5c'));logger['info'](_0xeea1('0x5d'),_0x3eeaf9['id']);return setRelationship(_0x27da2c,_0x4ed2d3,_0x3eeaf9,_0xeea1('0x5e'));})[_0xeea1('0x28')](function(){return setRelationship(_0x27da2c,_0x4700e4,_0x3eeaf9,_0xeea1('0x5f'));})[_0xeea1('0x28')](function(){return getServerInfo(_0x27da2c);})[_0xeea1('0x28')](function(_0x2ec5b0){var _0x4d7b89=parseInt(_0x2ec5b0[_0xeea1('0x60')][_0xeea1('0x61')](0x0));var _0x3f55fc=util['format'](_0xeea1('0x62'),_0x6631da[_0xeea1('0x4f')],_0x3eeaf9['id']);if(_0x4d7b89>0x6){_0x3f55fc=util[_0xeea1('0x1d')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x6631da[_0xeea1('0x4f')],_0x3eeaf9['id']);}logger[_0xeea1('0x24')](_0xeea1('0x54'),_0xeea1('0x63'));emit(util[_0xeea1('0x1d')]('user:%s',_0x1df9a7[_0xeea1('0x17')]),_0xeea1('0x64'),{'uri':_0x3f55fc});})[_0xeea1('0x65')](function(_0x3e0a4c){logger[_0xeea1('0x66')]('[QUEUE]',JSON[_0xeea1('0x22')](_0x3e0a4c));});};exports[_0xeea1('0x67')]=function(_0x19f344,_0x4c6c61,_0x2b9ef8,_0x51ca41,_0x532fe0,_0x1a25d7,_0x3e0c3f){var _0xc38bc9,_0x3a202b,_0x1d7b34,_0x284010;_0x1a25d7['remoteUri']=intUtil['stripTrailingSlash'](_0x1a25d7['remoteUri']);_0x1a25d7[_0xeea1('0x51')]=intUtil[_0xeea1('0x50')](_0x1a25d7[_0xeea1('0x51')]);def[_0xeea1('0x52')]=util[_0xeea1('0x1d')](_0xeea1('0x68'),_0x1a25d7[_0xeea1('0x4f')]);if(_0x3e0c3f&&_0x3e0c3f[_0xeea1('0x69')]&&_0x3e0c3f[_0xeea1('0x69')]!=='none'){logger[_0xeea1('0x24')]('[OUTBOUND]',_0xeea1('0x55'));_0x4c6c61[_0xeea1('0x56')]=util[_0xeea1('0x1d')](_0xeea1('0x57'),_0x1a25d7[_0xeea1('0x51')],_0x4c6c61[_0xeea1('0x58')],md5(_0x4c6c61[_0xeea1('0x58')]));}return getConnection(_0x1a25d7)['then'](function(_0x49276e){_0x284010=_0x49276e;return getUser(_0x1a25d7,_0x51ca41[_0xeea1('0x17')],_0x284010);})[_0xeea1('0x28')](function(_0x5827a9){_0xc38bc9=_0x5827a9;logger[_0xeea1('0x24')](_0xeea1('0x59'),_0xc38bc9['id']);return getEndUser(_0x1a25d7,_0x4c6c61[_0xeea1('0x6a')],_0x4c6c61[_0xeea1('0x6b')],_0x284010);})[_0xeea1('0x28')](function(_0x2f8f5d){_0x3a202b=_0x2f8f5d;logger[_0xeea1('0x24')]('The\x20Enduser\x20ID\x20is:',_0x3a202b['id']);return getTicket(_0x1a25d7,_0xc38bc9,_0x3a202b,_0x2b9ef8,_0x4c6c61,_0x2b9ef8[_0xeea1('0x6c')],_0x284010,_0xeea1('0x6d'));})['then'](function(_0x1eadf2){_0x1d7b34=_0x1eadf2;logger[_0xeea1('0x24')](_0xeea1('0x5c'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x1d7b34['id']);return setRelationship(_0x284010,_0xc38bc9,_0x1d7b34,_0xeea1('0x5e'));})[_0xeea1('0x28')](function(){return setRelationship(_0x284010,_0x3a202b,_0x1d7b34,_0xeea1('0x5f'));})['then'](function(){return getServerInfo(_0x284010);})['then'](function(_0x4f05c7){var _0x3e54be=parseInt(_0x4f05c7['version'][_0xeea1('0x61')](0x0));var _0x18f2b7=util[_0xeea1('0x1d')](_0xeea1('0x62'),_0x1a25d7[_0xeea1('0x4f')],_0x1d7b34['id']);if(_0x3e54be>0x6){_0x18f2b7=util[_0xeea1('0x1d')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x1a25d7['remoteUri'],_0x1d7b34['id']);}logger[_0xeea1('0x24')](_0xeea1('0x6e'),_0xeea1('0x63'));emit(util[_0xeea1('0x1d')]('user:%s',_0x51ca41[_0xeea1('0x17')]),_0xeea1('0x64'),{'uri':_0x18f2b7});})[_0xeea1('0x65')](function(_0x5b9256){logger[_0xeea1('0x66')](_0xeea1('0x6e'),JSON['stringify'](_0x5b9256));});};exports[_0xeea1('0x6f')]=function(_0x22f152,_0x39cf23,_0x3a207c,_0xcd55e1,_0x53edec,_0x351f65){var _0x2a2611,_0x969384,_0x337ca3,_0x82726e;_0x351f65['remoteUri']=intUtil[_0xeea1('0x50')](_0x351f65['remoteUri']);_0x351f65[_0xeea1('0x51')]=intUtil[_0xeea1('0x50')](_0x351f65['serverUrl']);def[_0xeea1('0x52')]=util[_0xeea1('0x1d')]('%s/service/v4_1/rest.php',_0x351f65[_0xeea1('0x4f')]);if(_0x53edec&&_0x53edec[_0xeea1('0x53')]){logger[_0xeea1('0x24')]('['+_0x39cf23['lastevent'][_0xeea1('0x70')]()+']',_0xeea1('0x55'));_0x39cf23['recordingURL']=util[_0xeea1('0x1d')](_0xeea1('0x57'),_0x351f65['serverUrl'],_0x39cf23[_0xeea1('0x58')],md5(_0x39cf23[_0xeea1('0x58')]));}else{_0x39cf23[_0xeea1('0x56')]='';}return getConnection(_0x351f65)[_0xeea1('0x28')](function(_0x456ade){_0x82726e=_0x456ade;if(!_[_0xeea1('0x23')](_0xcd55e1)){return getUser(_0x351f65,_0xcd55e1['name'],_0x82726e);}else{return getUser(_0x351f65,null,_0x82726e);}})['then'](function(_0x27995d){_0x2a2611=_0x27995d;logger[_0xeea1('0x24')](_0xeea1('0x59'),_0x2a2611['id']);return getEndUser(_0x351f65,_0x39cf23[_0xeea1('0x5a')],_0x39cf23[_0xeea1('0x71')],_0x82726e);})['then'](function(_0x142bda){_0x969384=_0x142bda;logger[_0xeea1('0x24')](_0xeea1('0x72'),_0x969384['id']);return getTicket(_0x351f65,_0x2a2611,_0x969384,_0x3a207c,_0x39cf23,_0x3a207c[_0xeea1('0x6c')],_0x82726e,'Inbound');})['then'](function(_0xf6f2ff){_0x337ca3=_0xf6f2ff;logger[_0xeea1('0x24')](_0xeea1('0x5c'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x337ca3['id']);return setRelationship(_0x82726e,_0x2a2611,_0x337ca3,'users');})[_0xeea1('0x28')](function(){return setRelationship(_0x82726e,_0x969384,_0x337ca3,_0xeea1('0x5f'));})['then'](function(){return getServerInfo(_0x82726e);})[_0xeea1('0x65')](function(_0x4b89ee){logger[_0xeea1('0x66')]('['+_0x39cf23[_0xeea1('0x73')][_0xeea1('0x70')]()+']',JSON['stringify'](_0x4b89ee));});}; \ 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 b2e0121..52659e1 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 _0x10bd=['name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','stripTrailingSlash','slice','substring','lastIndexOf','isNil','test','lodash','util','getString','length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable'];(function(_0x41a232,_0xab99d9){var _0x24db3b=function(_0x39988e){while(--_0x39988e){_0x41a232['push'](_0x41a232['shift']());}};_0x24db3b(++_0xab99d9);}(_0x10bd,0x16c));var _0xd10b=function(_0x2ba67d,_0x342b60){_0x2ba67d=_0x2ba67d-0x0;var _0x3b34d3=_0x10bd[_0x2ba67d];return _0x3b34d3;};'use strict';var _=require(_0xd10b('0x0'));var util=require(_0xd10b('0x1'));exports[_0xd10b('0x2')]=function(_0x7e7238,_0x2cba10,_0x235849){var _0x295e8d=[];if(_0x7e7238[_0xd10b('0x3')]>0x0){var _0x560df3=_[_0xd10b('0x4')](_0x7e7238,['id']);for(var _0x15c046=0x0;_0x15c046<_0x560df3['length'];_0x15c046++){var _0xe7b931=_0x560df3[_0x15c046];if(_0xe7b931[_0xd10b('0x5')]===_0xd10b('0x6')){_0x295e8d[_0xd10b('0x7')](_0xe7b931[_0xd10b('0x8')]);}else if(_0xe7b931[_0xd10b('0x5')]===_0xd10b('0x9')&&_0xe7b931[_0xd10b('0xa')]){_0x2cba10[_0xe7b931[_0xd10b('0xa')]]&&_0x295e8d['push'](_0x2cba10[_0xe7b931[_0xd10b('0xa')]][_0xd10b('0xb')]());}else if(_0xe7b931['type']===_0xd10b('0xc')&&_0xe7b931[_0xd10b('0xd')]&&_0xe7b931[_0xd10b('0xd')]['name']){_0x2cba10[_0xe7b931[_0xd10b('0xd')][_0xd10b('0xe')][_0xd10b('0xf')]()]&&_0x295e8d[_0xd10b('0x7')](_0x2cba10[_0xe7b931['Variable']['name']['toLowerCase']()][_0xd10b('0xb')]());}else if(_0xe7b931[_0xd10b('0x5')]===_0xd10b('0x10')){if(_0xe7b931[_0xd10b('0x11')]===_0xd10b('0x6')&&_0xe7b931[_0xd10b('0x12')]){_0x295e8d[_0xd10b('0x7')](util['format']('%s:\x20%s',_0xe7b931[_0xd10b('0x12')],_0xe7b931['keyContent']));}else if(_0xe7b931[_0xd10b('0x11')]==='variable'&&_0xe7b931['variableName']&&_0xe7b931[_0xd10b('0x12')]){_0x2cba10[_0xe7b931[_0xd10b('0xa')]]&&_0x295e8d['push'](util[_0xd10b('0x13')](_0xd10b('0x14'),_0xe7b931[_0xd10b('0x12')],_0x2cba10[_0xe7b931[_0xd10b('0xa')]]));}else if(_0xe7b931['keyType']==='customVariable'&&_0xe7b931[_0xd10b('0xd')]&&_0xe7b931[_0xd10b('0xd')][_0xd10b('0xe')]&&_0xe7b931[_0xd10b('0x12')]){_0x2cba10[_0xe7b931[_0xd10b('0xd')][_0xd10b('0xe')][_0xd10b('0xf')]()]&&_0x295e8d[_0xd10b('0x7')](util[_0xd10b('0x13')](_0xd10b('0x14'),_0xe7b931['key'],_0x2cba10[_0xe7b931[_0xd10b('0xd')]['name'][_0xd10b('0xf')]()]));}}}}return _0x295e8d['join'](_0x235849);};exports[_0xd10b('0x15')]=function(_0x442808){var _0x204637=_0x442808[_0xd10b('0x16')](-0x1);if(_0x204637==='/'){_0x442808=_0x442808[_0xd10b('0x17')](0x0,_0x442808[_0xd10b('0x18')](_0x204637));}return _0x442808;};exports['validateEmail']=function(_0x80f1e){if(!_[_0xd10b('0x19')](_0x80f1e)&&_0x80f1e!==''){var _0x281021=/^(([^<>()\[\]\\.,;:\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 _0x281021[_0xd10b('0x1a')](String(_0x80f1e)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0x1ff9=['name','toLowerCase','keyValue','keyType','key','%s:\x20%s','format','join','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','length','sortBy','type','push','content','variable','variableName','toString','customVariable','Variable'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x1ff9,0xef));var _0x91ff=function(_0x565404,_0x846949){_0x565404=_0x565404-0x0;var _0x2b0bb3=_0x1ff9[_0x565404];return _0x2b0bb3;};'use strict';var _=require(_0x91ff('0x0'));var util=require('util');exports['getString']=function(_0x3bc892,_0x3aa148,_0x131ed2){var _0x24a1c4=[];if(_0x3bc892[_0x91ff('0x1')]>0x0){var _0x2b690c=_[_0x91ff('0x2')](_0x3bc892,['id']);for(var _0x537fce=0x0;_0x537fce<_0x2b690c[_0x91ff('0x1')];_0x537fce++){var _0x416f0a=_0x2b690c[_0x537fce];if(_0x416f0a[_0x91ff('0x3')]==='string'){_0x24a1c4[_0x91ff('0x4')](_0x416f0a[_0x91ff('0x5')]);}else if(_0x416f0a['type']===_0x91ff('0x6')&&_0x416f0a[_0x91ff('0x7')]){_0x3aa148[_0x416f0a['variableName']]&&_0x24a1c4[_0x91ff('0x4')](_0x3aa148[_0x416f0a[_0x91ff('0x7')]][_0x91ff('0x8')]());}else if(_0x416f0a['type']===_0x91ff('0x9')&&_0x416f0a[_0x91ff('0xa')]&&_0x416f0a[_0x91ff('0xa')][_0x91ff('0xb')]){_0x3aa148[_0x416f0a['Variable'][_0x91ff('0xb')][_0x91ff('0xc')]()]&&_0x24a1c4[_0x91ff('0x4')](_0x3aa148[_0x416f0a['Variable'][_0x91ff('0xb')][_0x91ff('0xc')]()]['toString']());}else if(_0x416f0a[_0x91ff('0x3')]===_0x91ff('0xd')){if(_0x416f0a[_0x91ff('0xe')]==='string'&&_0x416f0a[_0x91ff('0xf')]){_0x24a1c4[_0x91ff('0x4')](util['format'](_0x91ff('0x10'),_0x416f0a[_0x91ff('0xf')],_0x416f0a['keyContent']));}else if(_0x416f0a[_0x91ff('0xe')]===_0x91ff('0x6')&&_0x416f0a[_0x91ff('0x7')]&&_0x416f0a[_0x91ff('0xf')]){_0x3aa148[_0x416f0a[_0x91ff('0x7')]]&&_0x24a1c4[_0x91ff('0x4')](util[_0x91ff('0x11')](_0x91ff('0x10'),_0x416f0a['key'],_0x3aa148[_0x416f0a['variableName']]));}else if(_0x416f0a[_0x91ff('0xe')]===_0x91ff('0x9')&&_0x416f0a['Variable']&&_0x416f0a[_0x91ff('0xa')][_0x91ff('0xb')]&&_0x416f0a[_0x91ff('0xf')]){_0x3aa148[_0x416f0a['Variable']['name'][_0x91ff('0xc')]()]&&_0x24a1c4[_0x91ff('0x4')](util['format'](_0x91ff('0x10'),_0x416f0a['key'],_0x3aa148[_0x416f0a[_0x91ff('0xa')][_0x91ff('0xb')][_0x91ff('0xc')]()]));}}}}return _0x24a1c4[_0x91ff('0x12')](_0x131ed2);};exports['stripTrailingSlash']=function(_0x517304){var _0x493e21=_0x517304[_0x91ff('0x13')](-0x1);if(_0x493e21==='/'){_0x517304=_0x517304[_0x91ff('0x14')](0x0,_0x517304[_0x91ff('0x15')](_0x493e21));}return _0x517304;};exports[_0x91ff('0x16')]=function(_0x5a66cf){if(!_[_0x91ff('0x17')](_0x5a66cf)&&_0x5a66cf!==''){var _0x599fe1=/^(([^<>()\[\]\\.,;:\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 _0x599fe1[_0x91ff('0x18')](String(_0x5a66cf)[_0x91ff('0xc')]());}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 8069675..33373d6 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x3d8eb6,_0xabf36a){var _0x251417=function(_0x1f0d74){while(--_0x1f0d74){_0x3d8eb6['push'](_0x3d8eb6['shift']());}};_0x251417(++_0xabf36a);}(_0x34e8,0x12c));var _0x834e=function(_0x18ba0e,_0x4e8e54){_0x18ba0e=_0x18ba0e-0x0;var _0x451dee=_0x34e8[_0x18ba0e];return _0x451dee;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ No newline at end of file +var _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(_0x16b0ed,_0x1bda90){var _0x49987b=function(_0x297bca){while(--_0x297bca){_0x16b0ed['push'](_0x16b0ed['shift']());}};_0x49987b(++_0x1bda90);}(_0x9c44,0x178));var _0x49c4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9c44[_0x255d5b];return _0x3e141a;};'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 diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 6dd7305..2318699 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 _0x292d=['uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','replace','Zendesk\x20account\x20type\x20not\x20recognized','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridnum','newTab','trigger:browser:url','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','toUpperCase','catch','lastevent','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','util','ioredis','./util','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','info','ticket','validateEmail','Getting\x20agent\x20with\x20email','remoteUri','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','results','agent','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','filter','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','authType','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','base64','debug','stringify','GET','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','push','variable','variableName','idField','customVariable','Variable','custom_fields','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x292d,0x17a));var _0xd292=function(_0x4ecd76,_0x79f1f3){_0x4ecd76=_0x4ecd76-0x0;var _0x240f34=_0x292d[_0x4ecd76];return _0x240f34;};'use strict';var _=require('lodash');var rp=require(_0xd292('0x0'));var md5=require(_0xd292('0x1'));var util=require(_0xd292('0x2'));var Redis=require(_0xd292('0x3'));var intUtil=require(_0xd292('0x4'));var config=require('../../../../config/environment');var logger=require(_0xd292('0x5'))(_0xd292('0x6'));config[_0xd292('0x7')]=_[_0xd292('0x8')](config['redis'],{'host':_0xd292('0x9'),'port':0x18eb});var io=require(_0xd292('0xa'))(new Redis(config[_0xd292('0x7')]));function emit(_0x197fca,_0xa56671,_0x2414ea){io['to'](_0x197fca)['emit'](_0xa56671,_0x2414ea);}var headers={'Content-Type':_0xd292('0xb'),'Accept':'application/json'};function getTicket(_0x7f81f1,_0x1d25e1,_0x12a9d3,_0xfc26de,_0x1ed953){logger['info'](_0xd292('0xc'));return request({'uri':util[_0xd292('0xd')](_0xd292('0xe'),_0x7f81f1['remoteUri']),'method':_0xd292('0xf'),'body':{'ticket':_[_0xd292('0x10')]({'requester_id':_0x12a9d3['id'],'submitter_id':_0x1d25e1?_0x1d25e1['id']:undefined,'assignee_id':_0x1d25e1?_0x1d25e1['id']:undefined,'tags':getTags(_0xfc26de[_0xd292('0x11')],_0xd292('0x12')),'subject':intUtil[_0xd292('0x13')](_0xfc26de[_0xd292('0x14')],_0x1ed953,'\x20'),'description':intUtil[_0xd292('0x13')](_0xfc26de[_0xd292('0x15')],_0x1ed953,'\x0a'),'comment':{'public':![],'body':intUtil[_0xd292('0x13')](_0xfc26de[_0xd292('0x15')],_0x1ed953,'\x0a')}},getCustomFields(_0xfc26de[_0xd292('0x16')],_0x1ed953))}})[_0xd292('0x17')](function(_0x451dbc){logger[_0xd292('0x18')]('Ticket\x20created!');return _0x451dbc[_0xd292('0x19')];});}function getUser(_0xe06668,_0x134a85){if(intUtil[_0xd292('0x1a')](_0x134a85)){logger[_0xd292('0x18')](_0xd292('0x1b'),_0x134a85);return request({'uri':util[_0xd292('0xd')]('%s/search.json',_0xe06668[_0xd292('0x1c')]),'qs':{'query':util[_0xd292('0xd')](_0xd292('0x1d'),_0x134a85)}})[_0xd292('0x17')](function(_0x4fbfad){if(_0x4fbfad['count']){logger['info'](_0xd292('0x1e'));return _[_0xd292('0x1f')](_0x4fbfad[_0xd292('0x20')],{'email':_0x134a85,'role':_0xd292('0x21')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xd292('0xd')]('%s/users/me.json',_0xe06668[_0xd292('0x1c')])})['then'](function(_0x44e59c){logger['info'](_0xd292('0x22'));return _0x44e59c[_0xd292('0x23')];});}});}else{logger[_0xd292('0x18')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xd292('0xd')]('%s/users/me.json',_0xe06668[_0xd292('0x1c')])})[_0xd292('0x17')](function(_0x5e77d0){logger['info'](_0xd292('0x22'));return _0x5e77d0[_0xd292('0x23')];});}}function getEndUser(_0xbb4ea6,_0x5f05a4,_0x515b87){logger[_0xd292('0x18')](_0xd292('0x24'),_0x515b87);return request({'uri':util['format'](_0xd292('0x25'),_0xbb4ea6[_0xd292('0x1c')]),'qs':{'query':util['format'](_0xd292('0x26'),_0x515b87)}})[_0xd292('0x17')](function(_0x2d5a8d){var _0x7cd6ad;if(_0x2d5a8d['results'][_0xd292('0x27')]){_0x2d5a8d[_0xd292('0x20')]=_[_0xd292('0x28')](_0x2d5a8d['results'],{'suspended':![],'role':'end-user'});if(_0x2d5a8d['results']['length']){_0x7cd6ad=_[_0xd292('0x29')](_0x2d5a8d['results']);}}if(_0x7cd6ad){logger[_0xd292('0x18')]('Enduser\x20found!');return _0x7cd6ad;}else{logger[_0xd292('0x18')](_0xd292('0x2a'));return request({'uri':util['format'](_0xd292('0x2b'),_0xbb4ea6['remoteUri']),'method':'POST','body':{'user':{'role':_0xd292('0x2c'),'name':util[_0xd292('0xd')](_0xd292('0x2d'),_0x5f05a4||_0x515b87),'phone':_0x515b87}}})['then'](function(_0x50e367){logger['info'](_0xd292('0x2e'));return _0x50e367[_0xd292('0x23')];});}});}function getAuth(_0x348cfc){var _0x162a69;if(_0x348cfc[_0xd292('0x2f')]==='password'){_0x162a69=util[_0xd292('0xd')](_0xd292('0x30'),_0x348cfc[_0xd292('0x31')],_0x348cfc[_0xd292('0x32')]);}else if(_0x348cfc[_0xd292('0x2f')]===_0xd292('0x33')){_0x162a69=util[_0xd292('0xd')](_0xd292('0x34'),_0x348cfc['username'],_0x348cfc[_0xd292('0x33')]);}return util[_0xd292('0xd')](_0xd292('0x35'),new Buffer(_0x162a69)['toString'](_0xd292('0x36')));}function request(_0x901e38){logger[_0xd292('0x37')]('[HTTP]',JSON[_0xd292('0x38')](_0x901e38));return rp(_[_0xd292('0x8')](_0x901e38,{'method':_0xd292('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x26a7e0,_0x2a710a){var _0x2e25a8=[];if(_0x26a7e0&&_0x26a7e0['length']>0x0){_0x2e25a8=_[_0xd292('0x3a')](_0x26a7e0,_0x2a710a);}return _0x2e25a8;}function getCustomFields(_0x3f5ed9,_0x18da19){var _0x33c7c1=[];var _0x58c63d={'custom_fields':[]};if(_0x3f5ed9[_0xd292('0x27')]>0x0){_[_0xd292('0x3b')](_0x3f5ed9,function(_0x4dc8f6){if(_[_0xd292('0x3c')]([_0xd292('0x3d'),_0xd292('0x3e')],_0x4dc8f6[_0xd292('0x3f')])&&_0x4dc8f6[_0xd292('0x40')]&&!_0x4dc8f6[_0xd292('0x41')]){_0x58c63d[_0x4dc8f6[_0xd292('0x40')][_0xd292('0x42')]()]=_0x4dc8f6[_0xd292('0x43')][_0xd292('0x44')]();}else if(_[_0xd292('0x3c')](['string',_0xd292('0x3e')],_0x4dc8f6['type'])&&_0x4dc8f6['idField']&&_0x4dc8f6[_0xd292('0x41')]){_0x58c63d['custom_fields'][_0xd292('0x45')]({'id':_0x4dc8f6['idField'],'value':_0x4dc8f6['content']['toString']()});}else if(_0x4dc8f6[_0xd292('0x3f')]===_0xd292('0x46')&&_0x4dc8f6[_0xd292('0x47')]&&_0x4dc8f6[_0xd292('0x48')]&&_0x4dc8f6[_0xd292('0x41')]){_0x18da19[_0x4dc8f6[_0xd292('0x47')]]&&_0x58c63d['custom_fields'][_0xd292('0x45')]({'id':_0x4dc8f6[_0xd292('0x48')],'value':_0x18da19[_0x4dc8f6['variableName']][_0xd292('0x44')]()});}else if(_0x4dc8f6[_0xd292('0x3f')]===_0xd292('0x49')&&_0x4dc8f6[_0xd292('0x4a')]&&_0x4dc8f6[_0xd292('0x4a')][_0xd292('0x12')]&&_0x4dc8f6[_0xd292('0x48')]&&_0x4dc8f6[_0xd292('0x41')]){_0x18da19[_0x4dc8f6[_0xd292('0x4a')][_0xd292('0x12')][_0xd292('0x42')]()]&&_0x58c63d[_0xd292('0x4b')][_0xd292('0x45')]({'id':_0x4dc8f6[_0xd292('0x48')],'value':_0x18da19[_0x4dc8f6[_0xd292('0x4a')][_0xd292('0x12')][_0xd292('0x42')]()][_0xd292('0x44')]()});}});}return _0x58c63d;}exports[_0xd292('0x4c')]=function(_0x4017fc,_0x1065c4,_0x4cf543,_0x57dde7,_0x2ab979,_0x24bd65){var _0x17726b,_0x5b4cdf;_0x24bd65[_0xd292('0x1c')]=intUtil[_0xd292('0x4d')](_0x24bd65[_0xd292('0x1c')]);_0x24bd65['serverUrl']=intUtil[_0xd292('0x4d')](_0x24bd65[_0xd292('0x4e')]);if(_0x2ab979&&_0x2ab979[_0xd292('0x4f')]){logger[_0xd292('0x18')](_0xd292('0x50'),_0xd292('0x51'));_0x1065c4['recordingURL']=util[_0xd292('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x24bd65[_0xd292('0x4e')],_0x1065c4[_0xd292('0x52')],md5(_0x1065c4['uniqueid']));}else{_0x1065c4[_0xd292('0x53')]='';}headers[_0xd292('0x54')]=getAuth(_0x24bd65);return getUser(_0x24bd65,_0x57dde7['email'])[_0xd292('0x17')](function(_0xae8852){_0x17726b=_0xae8852;logger[_0xd292('0x18')](_0xd292('0x55'),_0x17726b['id']);return getEndUser(_0x24bd65,_0x1065c4[_0xd292('0x56')],_0x1065c4[_0xd292('0x57')]);})[_0xd292('0x17')](function(_0x344066){_0x5b4cdf=_0x344066;logger[_0xd292('0x18')](_0xd292('0x58'),_0x5b4cdf['id']);return getTicket(_0x24bd65,_0x17726b,_0x5b4cdf,_0x4cf543,_0x1065c4);})[_0xd292('0x17')](function(_0x1a5369){if(_0x1a5369){logger[_0xd292('0x18')](_0xd292('0x59'),_0x1a5369['id']);switch(_0x24bd65[_0xd292('0x3f')]){case _0xd292('0x5a'):logger[_0xd292('0x18')](_0xd292('0x50'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xd292('0xd')](_0xd292('0x5b'),_0x24bd65['remoteUri'],_0x17726b['id'],_0x1a5369['id']),'method':_0xd292('0xf')});case'newTab':logger[_0xd292('0x18')](_0xd292('0x50'),_0xd292('0x5c'));emit(util['format'](_0xd292('0x5d'),_0x57dde7[_0xd292('0x12')]),'trigger:browser:url',{'uri':util[_0xd292('0xd')](_0xd292('0x5e'),_0x24bd65[_0xd292('0x1c')][_0xd292('0x5f')]('/api/v2',''),_0x1a5369['id'])});break;default:logger['error'](_0xd292('0x50'),_0xd292('0x60'));}}})['catch'](function(_0x3ac778){logger[_0xd292('0x61')](_0xd292('0x62'),util[_0xd292('0x63')](_0x3ac778,{'showHidden':!![],'depth':null}));});};exports[_0xd292('0x64')]=function(_0x3b5a92,_0x4075c6,_0x1f6e9d,_0x58dac9,_0x569a69,_0x237213,_0x1a4f75){var _0x40567b,_0x2e73b8;_0x237213[_0xd292('0x1c')]=intUtil['stripTrailingSlash'](_0x237213[_0xd292('0x1c')]);_0x237213[_0xd292('0x4e')]=intUtil[_0xd292('0x4d')](_0x237213[_0xd292('0x4e')]);if(_0x1a4f75&&_0x1a4f75[_0xd292('0x65')]&&_0x1a4f75['recordingFormat']!==_0xd292('0x66')){logger[_0xd292('0x18')](_0xd292('0x67'),_0xd292('0x51'));_0x4075c6[_0xd292('0x53')]=util['format'](_0xd292('0x68'),_0x237213[_0xd292('0x4e')],_0x4075c6['uniqueid'],md5(_0x4075c6['uniqueid']));}headers[_0xd292('0x54')]=getAuth(_0x237213);return getUser(_0x237213,_0x58dac9[_0xd292('0x69')])[_0xd292('0x17')](function(_0x1c0d46){_0x40567b=_0x1c0d46;logger[_0xd292('0x18')](_0xd292('0x55'),_0x40567b['id']);return getEndUser(_0x237213,_0x4075c6['destcalleridname'],_0x4075c6[_0xd292('0x6a')]);})[_0xd292('0x17')](function(_0x1c3bec){_0x2e73b8=_0x1c3bec;logger[_0xd292('0x18')]('The\x20Enduser\x20ID\x20is:',_0x2e73b8['id']);return getTicket(_0x237213,_0x40567b,_0x2e73b8,_0x1f6e9d,_0x4075c6);})[_0xd292('0x17')](function(_0x4a63ef){if(_0x4a63ef){logger[_0xd292('0x18')](_0xd292('0x59'),_0x4a63ef['id']);switch(_0x237213[_0xd292('0x3f')]){case'integrationTab':logger['info']('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xd292('0xd')](_0xd292('0x5b'),_0x237213[_0xd292('0x1c')],_0x40567b['id'],_0x4a63ef['id']),'method':_0xd292('0xf')});case _0xd292('0x6b'):logger[_0xd292('0x18')](_0xd292('0x67'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd292('0xd')](_0xd292('0x5d'),_0x58dac9[_0xd292('0x12')]),_0xd292('0x6c'),{'uri':util['format'](_0xd292('0x5e'),_0x237213[_0xd292('0x1c')][_0xd292('0x5f')](_0xd292('0x6d'),''),_0x4a63ef['id'])});break;default:logger[_0xd292('0x61')](_0xd292('0x67'),_0xd292('0x60'));}}})['catch'](function(_0x5e19f0){logger[_0xd292('0x61')](_0xd292('0x6e'),util[_0xd292('0x63')](_0x5e19f0,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x8d6a25,_0x4b13c5,_0x11d2fa,_0x14f875,_0x1e8cf3,_0x123e51){var _0x25d7e9,_0x3352a8;_0x123e51['remoteUri']=intUtil[_0xd292('0x4d')](_0x123e51[_0xd292('0x1c')]);_0x123e51['serverUrl']=intUtil['stripTrailingSlash'](_0x123e51[_0xd292('0x4e')]);if(_0x1e8cf3&&_0x1e8cf3[_0xd292('0x4f')]){logger['info']('['+_0x4b13c5['lastevent'][_0xd292('0x6f')]()+']',_0xd292('0x51'));_0x4b13c5[_0xd292('0x53')]=util[_0xd292('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x123e51[_0xd292('0x4e')],_0x4b13c5[_0xd292('0x52')],md5(_0x4b13c5['uniqueid']));}else{_0x4b13c5[_0xd292('0x53')]='';}headers[_0xd292('0x54')]=getAuth(_0x123e51);return getUser(_0x123e51)[_0xd292('0x17')](function(_0x3338e9){_0x25d7e9=_0x3338e9;logger[_0xd292('0x18')](_0xd292('0x55'),_0x25d7e9['id']);return getEndUser(_0x123e51,_0x4b13c5[_0xd292('0x56')],_0x4b13c5[_0xd292('0x57')]);})['then'](function(_0x45bda4){_0x3352a8=_0x45bda4;logger[_0xd292('0x18')](_0xd292('0x58'),_0x3352a8['id']);return getTicket(_0x123e51,_0x25d7e9,_0x3352a8,_0x11d2fa,_0x4b13c5);})[_0xd292('0x17')](function(_0x42ce67){if(_0x42ce67){logger[_0xd292('0x18')]('The\x20Ticket\x20ID\x20is:',_0x42ce67['id']);}})[_0xd292('0x70')](function(_0x4b8ccf){logger[_0xd292('0x61')]('['+_0x4b13c5[_0xd292('0x71')][_0xd292('0x6f')]()+']'+_0xd292('0x72'),util[_0xd292('0x63')](_0x4b8ccf,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x84a0=['toUpperCase','request-promise','md5','ioredis','./util','zendesk','defaults','localhost','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','info','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','then','Admin\x20account\x20selected.','user','filter','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','authType','%s:%s','username','password','token','Basic\x20%s','base64','debug','stringify','length','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','custom_fields','variable','variableName','Variable','push','queue','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','replace','Zendesk\x20account\x20type\x20not\x20recognized','catch','error','inspect','outbound','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridnum','The\x20Enduser\x20ID\x20is:','%s/agent/tickets/%s','unmanaged','monitor_format','lastevent'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x84a0,0x13f));var _0x084a=function(_0x4055df,_0x2846aa){_0x4055df=_0x4055df-0x0;var _0x1301b6=_0x84a0[_0x4055df];return _0x1301b6;};'use strict';var _=require('lodash');var rp=require(_0x084a('0x0'));var md5=require(_0x084a('0x1'));var util=require('util');var Redis=require(_0x084a('0x2'));var intUtil=require(_0x084a('0x3'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x084a('0x4'));config['redis']=_[_0x084a('0x5')](config['redis'],{'host':_0x084a('0x6'),'port':0x18eb});var io=require(_0x084a('0x7'))(new Redis(config['redis']));function emit(_0x22c286,_0xc08ebd,_0x127461){io['to'](_0x22c286)[_0x084a('0x8')](_0xc08ebd,_0x127461);}var headers={'Content-Type':_0x084a('0x9'),'Accept':_0x084a('0x9')};function getTicket(_0x449841,_0x2e0775,_0x651a53,_0x230b6b,_0x4c8965){logger['info'](_0x084a('0xa'));return request({'uri':util[_0x084a('0xb')](_0x084a('0xc'),_0x449841[_0x084a('0xd')]),'method':_0x084a('0xe'),'body':{'ticket':_[_0x084a('0xf')]({'requester_id':_0x651a53['id'],'submitter_id':_0x2e0775?_0x2e0775['id']:undefined,'assignee_id':_0x2e0775?_0x2e0775['id']:undefined,'tags':getTags(_0x230b6b[_0x084a('0x10')],_0x084a('0x11')),'subject':intUtil[_0x084a('0x12')](_0x230b6b[_0x084a('0x13')],_0x4c8965,'\x20'),'description':intUtil[_0x084a('0x12')](_0x230b6b[_0x084a('0x14')],_0x4c8965,'\x0a'),'comment':{'public':![],'body':intUtil[_0x084a('0x12')](_0x230b6b[_0x084a('0x14')],_0x4c8965,'\x0a')}},getCustomFields(_0x230b6b[_0x084a('0x15')],_0x4c8965))}})['then'](function(_0x1e97fa){logger[_0x084a('0x16')](_0x084a('0x17'));return _0x1e97fa[_0x084a('0x18')];});}function getUser(_0x2bd18c,_0x5d5472){if(intUtil[_0x084a('0x19')](_0x5d5472)){logger[_0x084a('0x16')](_0x084a('0x1a'),_0x5d5472);return request({'uri':util[_0x084a('0xb')](_0x084a('0x1b'),_0x2bd18c[_0x084a('0xd')]),'qs':{'query':util['format'](_0x084a('0x1c'),_0x5d5472)}})['then'](function(_0x178a87){if(_0x178a87[_0x084a('0x1d')]){logger[_0x084a('0x16')](_0x084a('0x1e'));return _[_0x084a('0x1f')](_0x178a87[_0x084a('0x20')],{'email':_0x5d5472,'role':'agent'});}else{logger[_0x084a('0x16')](_0x084a('0x21'));return request({'uri':util[_0x084a('0xb')](_0x084a('0x22'),_0x2bd18c[_0x084a('0xd')])})[_0x084a('0x23')](function(_0xd3671c){logger['info'](_0x084a('0x24'));return _0xd3671c[_0x084a('0x25')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x084a('0xb')](_0x084a('0x22'),_0x2bd18c[_0x084a('0xd')])})[_0x084a('0x23')](function(_0x20a6b1){logger[_0x084a('0x16')]('Admin\x20account\x20selected.');return _0x20a6b1['user'];});}}function getEndUser(_0x4d42dd,_0x34374a,_0x2681e7){logger['info']('Searching\x20enduser\x20with\x20phone',_0x2681e7);return request({'uri':util[_0x084a('0xb')](_0x084a('0x1b'),_0x4d42dd[_0x084a('0xd')]),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0x2681e7)}})[_0x084a('0x23')](function(_0x5b986a){var _0x21f5db;if(_0x5b986a[_0x084a('0x20')]['length']){_0x5b986a['results']=_[_0x084a('0x26')](_0x5b986a[_0x084a('0x20')],{'suspended':![],'role':'end-user'});if(_0x5b986a[_0x084a('0x20')]['length']){_0x21f5db=_['first'](_0x5b986a['results']);}}if(_0x21f5db){logger[_0x084a('0x16')](_0x084a('0x27'));return _0x21f5db;}else{logger[_0x084a('0x16')](_0x084a('0x28'));return request({'uri':util[_0x084a('0xb')](_0x084a('0x29'),_0x4d42dd[_0x084a('0xd')]),'method':'POST','body':{'user':{'role':_0x084a('0x2a'),'name':util['format'](_0x084a('0x2b'),_0x34374a||_0x2681e7),'phone':_0x2681e7}}})[_0x084a('0x23')](function(_0x54d1ec){logger[_0x084a('0x16')]('Enduser\x20created.');return _0x54d1ec[_0x084a('0x25')];});}});}function getAuth(_0x3a45ba){var _0x5521f6;if(_0x3a45ba[_0x084a('0x2c')]==='password'){_0x5521f6=util[_0x084a('0xb')](_0x084a('0x2d'),_0x3a45ba[_0x084a('0x2e')],_0x3a45ba[_0x084a('0x2f')]);}else if(_0x3a45ba[_0x084a('0x2c')]===_0x084a('0x30')){_0x5521f6=util[_0x084a('0xb')]('%s/token:%s',_0x3a45ba['username'],_0x3a45ba['token']);}return util['format'](_0x084a('0x31'),new Buffer(_0x5521f6)['toString'](_0x084a('0x32')));}function request(_0x558a3e){logger[_0x084a('0x33')]('[HTTP]',JSON[_0x084a('0x34')](_0x558a3e));return rp(_[_0x084a('0x5')](_0x558a3e,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0xdc4a16,_0x473b3f){var _0x4f9185=[];if(_0xdc4a16&&_0xdc4a16[_0x084a('0x35')]>0x0){_0x4f9185=_[_0x084a('0x36')](_0xdc4a16,_0x473b3f);}return _0x4f9185;}function getCustomFields(_0x33dc9c,_0x1a5277){var _0x3dd6d7=[];var _0x52f5a6={'custom_fields':[]};if(_0x33dc9c[_0x084a('0x35')]>0x0){_[_0x084a('0x37')](_0x33dc9c,function(_0x2381fa){if(_[_0x084a('0x38')]([_0x084a('0x39'),_0x084a('0x3a')],_0x2381fa[_0x084a('0x3b')])&&_0x2381fa[_0x084a('0x3c')]&&!_0x2381fa[_0x084a('0x3d')]){_0x52f5a6[_0x2381fa[_0x084a('0x3c')][_0x084a('0x3e')]()]=_0x2381fa[_0x084a('0x3f')][_0x084a('0x40')]();}else if(_[_0x084a('0x38')]([_0x084a('0x39'),_0x084a('0x3a')],_0x2381fa[_0x084a('0x3b')])&&_0x2381fa[_0x084a('0x41')]&&_0x2381fa[_0x084a('0x3d')]){_0x52f5a6[_0x084a('0x42')]['push']({'id':_0x2381fa['idField'],'value':_0x2381fa['content'][_0x084a('0x40')]()});}else if(_0x2381fa[_0x084a('0x3b')]===_0x084a('0x43')&&_0x2381fa[_0x084a('0x44')]&&_0x2381fa[_0x084a('0x41')]&&_0x2381fa[_0x084a('0x3d')]){_0x1a5277[_0x2381fa[_0x084a('0x44')]]&&_0x52f5a6[_0x084a('0x42')]['push']({'id':_0x2381fa[_0x084a('0x41')],'value':_0x1a5277[_0x2381fa['variableName']]['toString']()});}else if(_0x2381fa[_0x084a('0x3b')]==='customVariable'&&_0x2381fa['Variable']&&_0x2381fa[_0x084a('0x45')][_0x084a('0x11')]&&_0x2381fa[_0x084a('0x41')]&&_0x2381fa[_0x084a('0x3d')]){_0x1a5277[_0x2381fa[_0x084a('0x45')][_0x084a('0x11')]['toLowerCase']()]&&_0x52f5a6[_0x084a('0x42')][_0x084a('0x46')]({'id':_0x2381fa['idField'],'value':_0x1a5277[_0x2381fa[_0x084a('0x45')][_0x084a('0x11')]['toLowerCase']()][_0x084a('0x40')]()});}});}return _0x52f5a6;}exports[_0x084a('0x47')]=function(_0x2795b2,_0x11cc30,_0x2f1f0e,_0x5cb5af,_0x3584a7,_0x461d72){var _0x495604,_0x4c29c0;_0x461d72[_0x084a('0xd')]=intUtil[_0x084a('0x48')](_0x461d72['remoteUri']);_0x461d72[_0x084a('0x49')]=intUtil[_0x084a('0x48')](_0x461d72[_0x084a('0x49')]);if(_0x3584a7&&_0x3584a7['monitor_format']){logger[_0x084a('0x16')]('[QUEUE]',_0x084a('0x4a'));_0x11cc30['recordingURL']=util['format'](_0x084a('0x4b'),_0x461d72[_0x084a('0x49')],_0x11cc30[_0x084a('0x4c')],md5(_0x11cc30[_0x084a('0x4c')]));}else{_0x11cc30['recordingURL']='';}headers[_0x084a('0x4d')]=getAuth(_0x461d72);return getUser(_0x461d72,_0x5cb5af[_0x084a('0x4e')])[_0x084a('0x23')](function(_0x565141){_0x495604=_0x565141;logger[_0x084a('0x16')](_0x084a('0x4f'),_0x495604['id']);return getEndUser(_0x461d72,_0x11cc30[_0x084a('0x50')],_0x11cc30[_0x084a('0x51')]);})['then'](function(_0x139332){_0x4c29c0=_0x139332;logger[_0x084a('0x16')]('The\x20Enduser\x20ID\x20is:',_0x4c29c0['id']);return getTicket(_0x461d72,_0x495604,_0x4c29c0,_0x2f1f0e,_0x11cc30);})[_0x084a('0x23')](function(_0x55f689){if(_0x55f689){logger[_0x084a('0x16')](_0x084a('0x52'),_0x55f689['id']);switch(_0x461d72['type']){case _0x084a('0x53'):logger[_0x084a('0x16')](_0x084a('0x54'),_0x084a('0x55'));return request({'uri':util['format'](_0x084a('0x56'),_0x461d72[_0x084a('0xd')],_0x495604['id'],_0x55f689['id']),'method':_0x084a('0xe')});case'newTab':logger[_0x084a('0x16')](_0x084a('0x54'),_0x084a('0x57'));emit(util[_0x084a('0xb')](_0x084a('0x58'),_0x5cb5af[_0x084a('0x11')]),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x461d72[_0x084a('0xd')][_0x084a('0x59')]('/api/v2',''),_0x55f689['id'])});break;default:logger['error'](_0x084a('0x54'),_0x084a('0x5a'));}}})[_0x084a('0x5b')](function(_0x5b3589){logger[_0x084a('0x5c')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x084a('0x5d')](_0x5b3589,{'showHidden':!![],'depth':null}));});};exports[_0x084a('0x5e')]=function(_0xc76893,_0x531f89,_0x46b0b6,_0x216dbf,_0x30dcf8,_0x348fb4,_0x2d0d4d){var _0x1b6fa8,_0x43a155;_0x348fb4[_0x084a('0xd')]=intUtil['stripTrailingSlash'](_0x348fb4[_0x084a('0xd')]);_0x348fb4['serverUrl']=intUtil[_0x084a('0x48')](_0x348fb4[_0x084a('0x49')]);if(_0x2d0d4d&&_0x2d0d4d[_0x084a('0x5f')]&&_0x2d0d4d[_0x084a('0x5f')]!==_0x084a('0x60')){logger[_0x084a('0x16')](_0x084a('0x61'),_0x084a('0x4a'));_0x531f89[_0x084a('0x62')]=util['format'](_0x084a('0x4b'),_0x348fb4['serverUrl'],_0x531f89[_0x084a('0x4c')],md5(_0x531f89[_0x084a('0x4c')]));}headers[_0x084a('0x4d')]=getAuth(_0x348fb4);return getUser(_0x348fb4,_0x216dbf[_0x084a('0x4e')])[_0x084a('0x23')](function(_0x41a4f3){_0x1b6fa8=_0x41a4f3;logger[_0x084a('0x16')](_0x084a('0x4f'),_0x1b6fa8['id']);return getEndUser(_0x348fb4,_0x531f89['destcalleridname'],_0x531f89[_0x084a('0x63')]);})[_0x084a('0x23')](function(_0x345736){_0x43a155=_0x345736;logger['info'](_0x084a('0x64'),_0x43a155['id']);return getTicket(_0x348fb4,_0x1b6fa8,_0x43a155,_0x46b0b6,_0x531f89);})[_0x084a('0x23')](function(_0x1b2f03){if(_0x1b2f03){logger[_0x084a('0x16')](_0x084a('0x52'),_0x1b2f03['id']);switch(_0x348fb4[_0x084a('0x3b')]){case _0x084a('0x53'):logger[_0x084a('0x16')]('[OUTBOUND]',_0x084a('0x55'));return request({'uri':util['format'](_0x084a('0x56'),_0x348fb4[_0x084a('0xd')],_0x1b6fa8['id'],_0x1b2f03['id']),'method':'POST'});case'newTab':logger['info']('[OUTBOUND]',_0x084a('0x57'));emit(util[_0x084a('0xb')](_0x084a('0x58'),_0x216dbf[_0x084a('0x11')]),'trigger:browser:url',{'uri':util[_0x084a('0xb')](_0x084a('0x65'),_0x348fb4[_0x084a('0xd')][_0x084a('0x59')]('/api/v2',''),_0x1b2f03['id'])});break;default:logger[_0x084a('0x5c')](_0x084a('0x61'),_0x084a('0x5a'));}}})[_0x084a('0x5b')](function(_0x1a3796){logger['error']('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x084a('0x5d')](_0x1a3796,{'showHidden':!![],'depth':null}));});};exports[_0x084a('0x66')]=function(_0x4efc84,_0x45e2fe,_0x1598cf,_0x371f70,_0x285c0c,_0x39a684){var _0xf63e16,_0x5ef26f;_0x39a684[_0x084a('0xd')]=intUtil['stripTrailingSlash'](_0x39a684[_0x084a('0xd')]);_0x39a684['serverUrl']=intUtil[_0x084a('0x48')](_0x39a684[_0x084a('0x49')]);if(_0x285c0c&&_0x285c0c[_0x084a('0x67')]){logger['info']('['+_0x45e2fe[_0x084a('0x68')][_0x084a('0x69')]()+']',_0x084a('0x4a'));_0x45e2fe[_0x084a('0x62')]=util[_0x084a('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x39a684[_0x084a('0x49')],_0x45e2fe[_0x084a('0x4c')],md5(_0x45e2fe[_0x084a('0x4c')]));}else{_0x45e2fe['recordingURL']='';}headers[_0x084a('0x4d')]=getAuth(_0x39a684);return getUser(_0x39a684)[_0x084a('0x23')](function(_0x3bfd84){_0xf63e16=_0x3bfd84;logger[_0x084a('0x16')](_0x084a('0x4f'),_0xf63e16['id']);return getEndUser(_0x39a684,_0x45e2fe[_0x084a('0x50')],_0x45e2fe[_0x084a('0x51')]);})[_0x084a('0x23')](function(_0x524f15){_0x5ef26f=_0x524f15;logger[_0x084a('0x16')]('The\x20Enduser\x20ID\x20is:',_0x5ef26f['id']);return getTicket(_0x39a684,_0xf63e16,_0x5ef26f,_0x1598cf,_0x45e2fe);})['then'](function(_0x5cd944){if(_0x5cd944){logger['info'](_0x084a('0x52'),_0x5cd944['id']);}})[_0x084a('0x5b')](function(_0x58c1d0){logger[_0x084a('0x5c')]('['+_0x45e2fe[_0x084a('0x68')][_0x084a('0x69')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x084a('0x5d')](_0x58c1d0,{'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 a33f022..2398028 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 _0x2acd=['first_name','last_name','code','SUCCESS','details','startCase','Error:\x20','log','Zoho-oauthtoken\x20','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','uri','https://www.zohoapis.','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','Contacts','Creating\x20new\x20call...','Owner','role','administrator','Subject','Subjects','Description','getString','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','format','mm:ss','endtime','Call_Duration','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','complete','connect','rejected','Rejected','abandoned','timeout','Call_Start_Time','agentcalledAt','Call_Type','Inbound','merge','/crm/v2/Calls','Call\x20created!','queue','stripTrailingSlash','host','serverUrl','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','com','The\x20User\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','Outbound','The\x20Call\x20ID\x20is:','user:%s','unmanaged','toUpperCase','zoho.eu','calleridname','calleridnum','lodash','request-promise','util','./util','moment','ioredis','redis','localhost','emit','debug','[HTTP]','stringify','length','includes','type','idField','content','toString','variable','variableName','customVariable','Variable','name','indexOf','split','isNil','access_token','isBefore','expires_in','zone','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','refreshToken','clientSecret','refresh_token','then','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','info','GET','https://www.zohoapis.%s/crm/v2/users','users','isArrayLikeObject','findIndex','email','Using\x20the\x20admin\x20account!','profile','user','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','/crm/v2/','moduleCreate'];(function(_0x3bb047,_0x4fc12e){var _0x169edd=function(_0x184cd2){while(--_0x184cd2){_0x3bb047['push'](_0x3bb047['shift']());}};_0x169edd(++_0x4fc12e);}(_0x2acd,0xe8));var _0xd2ac=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x2acd[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xd2ac('0x0'));var rp=require(_0xd2ac('0x1'));var md5=require('md5');var util=require(_0xd2ac('0x2'));var intUtil=require(_0xd2ac('0x3'));var moment=require(_0xd2ac('0x4'));var Redis=require(_0xd2ac('0x5'));var BPromise=require('bluebird');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('zoho');config['redis']=_['defaults'](config[_0xd2ac('0x6')],{'host':_0xd2ac('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x47cea1,_0x2f4c82,_0xfbc6ac){io['to'](_0x47cea1)[_0xd2ac('0x8')](_0x2f4c82,_0xfbc6ac);}function request(_0x23eb6f){logger[_0xd2ac('0x9')](_0xd2ac('0xa'),JSON[_0xd2ac('0xb')](_0x23eb6f));return rp(_0x23eb6f);}function getCustomFields(_0x4aa425,_0x4202ff){var _0x279bff={};if(_0x4aa425[_0xd2ac('0xc')]>0x0){_['forEach'](_0x4aa425,function(_0x226e2c){if(_[_0xd2ac('0xd')](['string','picklist'],_0x226e2c[_0xd2ac('0xe')])&&_0x226e2c[_0xd2ac('0xf')]){_0x279bff[_0x226e2c[_0xd2ac('0xf')]]=_0x226e2c[_0xd2ac('0x10')][_0xd2ac('0x11')]();}else if(_0x226e2c['type']===_0xd2ac('0x12')&&_0x226e2c[_0xd2ac('0x13')]&&_0x226e2c['idField']&&_0x4202ff[_0x226e2c[_0xd2ac('0x13')]]){_0x279bff[_0x226e2c[_0xd2ac('0xf')]]=_0x4202ff[_0x226e2c[_0xd2ac('0x13')]]['toString']();}else if(_0x226e2c[_0xd2ac('0xe')]===_0xd2ac('0x14')&&_0x226e2c[_0xd2ac('0x15')]&&_0x226e2c['Variable'][_0xd2ac('0x16')]&&_0x226e2c[_0xd2ac('0xf')]&&_0x4202ff[_0x226e2c[_0xd2ac('0x15')][_0xd2ac('0x16')]['toLowerCase']()]){_0x279bff[_0x226e2c[_0xd2ac('0xf')]]=_0x4202ff[_0x226e2c[_0xd2ac('0x15')]['name']['toLowerCase']()][_0xd2ac('0x11')]();}});}return _0x279bff;}function getName(_0x5b3ae3){if(_0x5b3ae3[_0xd2ac('0x17')]('\x20')>0x0){var _0x118db5=_0x5b3ae3[_0xd2ac('0x18')](/ (.+)/);if(_0x118db5[0x1]){return _0x118db5;}}return[_0x5b3ae3,_0x5b3ae3];}var accountsTokens={};function getAccessToken(_0x143193){return new Promise(function(_0x352df5,_0x575cab){if(!_[_0xd2ac('0x19')](accountsTokens[_0x143193['id']])&&!_['isNil'](accountsTokens[_0x143193['id']][_0xd2ac('0x1a')])){if(moment()[_0xd2ac('0x1b')](accountsTokens[_0x143193['id']][_0xd2ac('0x1c')])){_0x352df5(accountsTokens[_0x143193['id']][_0xd2ac('0x1a')]);}}var _0x255987;switch(_0x143193[_0xd2ac('0x1d')]){case'US':_0x255987=_0xd2ac('0x1e');break;case'AU':_0x255987=_0xd2ac('0x1f');break;case'EU':_0x255987='https://accounts.zoho.eu';break;case'IN':_0x255987=_0xd2ac('0x20');break;case'CN':_0x255987=_0xd2ac('0x21');break;default:_0x255987=_0xd2ac('0x22');break;}var _0x543b97={'method':_0xd2ac('0x23'),'uri':_0x255987+_0xd2ac('0x24'),'qs':{'refresh_token':_0x143193[_0xd2ac('0x25')],'client_id':_0x143193['clientId'],'client_secret':_0x143193[_0xd2ac('0x26')],'grant_type':_0xd2ac('0x27')},'json':!![]};return rp(_0x543b97)[_0xd2ac('0x28')](function(_0x3e80df){accountsTokens[_0x143193['id']]={'access_token':_0x3e80df[_0xd2ac('0x1a')],'expires_in':moment()['add'](_0x3e80df[_0xd2ac('0x1c')],_0xd2ac('0x29'))};_0x352df5(_0x3e80df['access_token']);})[_0xd2ac('0x2a')](function(_0x3b1f40){logger['error'](_0xd2ac('0x2b'),_0x3b1f40[_0xd2ac('0x2c')]);_0x575cab(_0x3b1f40);});});}function getUser(_0x344863,_0x3af470,_0x3fc4b6,_0x2cff99){logger[_0xd2ac('0x2d')]('Search\x20user');return request({'method':_0xd2ac('0x2e'),'uri':util['format'](_0xd2ac('0x2f'),_0x3af470),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x344863},'json':!![]})[_0xd2ac('0x28')](function(_0x5214dd){if(_0x5214dd[_0xd2ac('0x30')]){var _0x4afb30=-0x1;if(_[_0xd2ac('0x31')](_0x5214dd[_0xd2ac('0x30')])){if(!_[_0xd2ac('0x19')](_0x2cff99)){_0x4afb30=_[_0xd2ac('0x32')](_0x5214dd['users'],function(_0x5d5e5c){return _0x5d5e5c[_0xd2ac('0x33')]===_0x2cff99;});}if(_0x4afb30>=0x0){logger[_0xd2ac('0x2d')]('Agent\x20found!');}else{logger[_0xd2ac('0x2d')](_0xd2ac('0x34'));_0x4afb30=_['findIndex'](_0x5214dd['users'],function(_0x2d951d){return _0x2d951d[_0xd2ac('0x35')][_0xd2ac('0x16')]==='Administrator';});}return _0x5214dd[_0xd2ac('0x30')][_0x4afb30];}else{if(_0x5214dd[_0xd2ac('0x36')][_0xd2ac('0x35')][_0xd2ac('0x16')]==='Administrator'){logger[_0xd2ac('0x2d')](_0xd2ac('0x34'));user=_0x5214dd['user'];return user;}else{logger[_0xd2ac('0x37')](_0xd2ac('0x38'),JSON[_0xd2ac('0xb')](_0x5214dd));throw new Error(_0xd2ac('0x39')+JSON[_0xd2ac('0xb')](_0x5214dd));}}}else{logger[_0xd2ac('0x37')](_0xd2ac('0x38'),JSON[_0xd2ac('0xb')](_0x5214dd));throw new Error(_0xd2ac('0x39')+JSON[_0xd2ac('0xb')](_0x5214dd));}})[_0xd2ac('0x2a')](function(_0x24441e){console[_0xd2ac('0x37')](_0x24441e);});}function getZohoUser(_0xbbfd69,_0x2b1915){return new BPromise(function(_0x4b566f,_0x114771){request(_0xbbfd69)['then'](function(_0x4a2491){var _0x3627af=null;if(_0x4a2491){_0x3627af=_0x4a2491[_0xd2ac('0x3a')][0x0];_0x3627af[_0xd2ac('0x3b')]=_0x2b1915;}_0x4b566f(_0x3627af);})['catch'](function(_0x182a02){_0x114771(_0x182a02);});});}function createEndUser(_0x414664,_0x1548d5,_0x25c4c0,_0xe592fe,_0x43922c,_0x2e0961){var _0x25c4c0=getName(_0x25c4c0);return request({'method':'POST','uri':'https://www.zohoapis.'+_0x1548d5+_0xd2ac('0x3c')+_['startCase'](_0x2e0961[_0xd2ac('0x3d')])+'s','body':{'data':[{'Last_Name':_0x25c4c0[0x1],'First_Name':_0x25c4c0[0x0],'Phone':_0xe592fe,'Owner':{'name':!_[_0xd2ac('0x19')](_0x43922c['role'][_0xd2ac('0x16')])?_0x43922c['role'][_0xd2ac('0x16')]:!_['isNil'](_0x43922c[_0xd2ac('0x3e')])?_0x43922c[_0xd2ac('0x3e')]+'\x20'+_0x43922c['last_name']:_0x43922c[_0xd2ac('0x3f')],'id':_0x43922c['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x414664},'json':!![]})[_0xd2ac('0x28')](function(_0x41fc09){if(_0x41fc09&&_0x41fc09[_0xd2ac('0x3a')][0x0][_0xd2ac('0x40')]===_0xd2ac('0x41')){var _0x42641f=_0x41fc09[_0xd2ac('0x3a')][0x0][_0xd2ac('0x42')];_0x42641f[_0xd2ac('0x3b')]=_[_0xd2ac('0x43')](_0x2e0961['moduleCreate'])+'s';return _0x42641f;}logger['error']('The\x20failing\x20result\x20is',JSON[_0xd2ac('0xb')](data));throw new Error(_0xd2ac('0x44')+JSON[_0xd2ac('0xb')](data));})[_0xd2ac('0x2a')](function(_0x338d0e){console[_0xd2ac('0x45')]('CREATE\x20ERROR',_0x338d0e);});}function getEndUser(_0x658b39,_0x557e21,_0x183f81,_0x2bf0f6,_0x4346c2,_0x2333c6,_0x3870b9){var _0x48fea9={'method':'GET','uri':'','headers':{'Authorization':_0xd2ac('0x46')+_0x658b39},'json':!![]};switch(_0x3870b9[_0xd2ac('0x47')]){case _0xd2ac('0x48'):_0x48fea9['uri']='https://www.zohoapis.'+_0x557e21+_0xd2ac('0x49')+_0x4346c2+'))';return getZohoUser(_0x48fea9,'Contacts')[_0xd2ac('0x28')](function(_0x1127f2){if(_0x1127f2)return _0x1127f2;_0x48fea9[_0xd2ac('0x4a')]=_0xd2ac('0x4b')+_0x557e21+_0xd2ac('0x4c')+_0x4346c2+'))';return getZohoUser(_0x48fea9,_0xd2ac('0x4d'))[_0xd2ac('0x28')](function(_0x1c38cd){if(_0x1c38cd)return _0x1c38cd;if(_0x3870b9[_0xd2ac('0x3d')]!=_0xd2ac('0x4e')){return createEndUser(_0x658b39,_0x557e21,_0x2bf0f6,_0x4346c2,_0x2333c6,_0x3870b9);}else{return{};}});});break;case'contact':_0x48fea9['uri']=_0xd2ac('0x4b')+_0x557e21+_0xd2ac('0x49')+_0x4346c2+'))';return getZohoUser(_0x48fea9,_0xd2ac('0x4f'))['then'](function(_0x43baef){if(_0x43baef)return _0x43baef;if(_0x3870b9[_0xd2ac('0x3d')]!='nothing'){return createEndUser(_0x658b39,_0x557e21,_0x2bf0f6,_0x4346c2,_0x2333c6,_0x3870b9);}else{return{};}});break;case'lead':_0x48fea9[_0xd2ac('0x4a')]=_0xd2ac('0x4b')+_0x557e21+_0xd2ac('0x4c')+_0x4346c2+'))';return getZohoUser(_0x48fea9,_0xd2ac('0x4d'))[_0xd2ac('0x28')](function(_0x5d56c0){if(_0x5d56c0)return _0x5d56c0;if(_0x3870b9[_0xd2ac('0x3d')]!='nothing'){return createEndUser(_0x658b39,_0x557e21,_0x2bf0f6,_0x4346c2,_0x2333c6,_0x3870b9);}else{return{};}});break;}}function getCall(_0x4c4736,_0x21c845,_0x585a90,_0x3702a6,_0x253368,_0x2cbd2b,_0x181e64,_0x58860a){logger['info'](_0xd2ac('0x50'));var _0x3d794b={};_0x3d794b[_0xd2ac('0x51')]={'name':!_[_0xd2ac('0x19')](_0x3702a6[_0xd2ac('0x52')]['name'])&&!_[_0xd2ac('0x19')](_0x3702a6[_0xd2ac('0x35')][_0xd2ac('0x16')])&&_0x3702a6[_0xd2ac('0x35')][_0xd2ac('0x16')]===_0xd2ac('0x53')?_0x3702a6['role'][_0xd2ac('0x16')]:!_[_0xd2ac('0x19')](_0x3702a6[_0xd2ac('0x3e')])?_0x3702a6[_0xd2ac('0x3e')]+'\x20'+_0x3702a6[_0xd2ac('0x3f')]:_0x3702a6[_0xd2ac('0x3f')],'id':_0x3702a6['id']};_0x3d794b[_0xd2ac('0x54')]=intUtil['getString'](_0x2cbd2b[_0xd2ac('0x55')],_0x181e64,'\x20');_0x3d794b[_0xd2ac('0x56')]=intUtil[_0xd2ac('0x57')](_0x2cbd2b['Descriptions'],_0x181e64,'\x0a');if(_0x253368[_0xd2ac('0x3b')]==='Contacts'){_0x3d794b[_0xd2ac('0x58')]={'name':!_[_0xd2ac('0x19')](_0x253368[_0xd2ac('0x59')])?_0x253368[_0xd2ac('0x59')]:!_[_0xd2ac('0x19')](_0x253368[_0xd2ac('0x5a')])?_0x253368[_0xd2ac('0x5a')]+'\x20'+_0x253368[_0xd2ac('0x5b')]:_0x253368[_0xd2ac('0x5b')],'id':_0x253368['id']};}if(_0x253368['enduserType']==='Leads'){_0x3d794b[_0xd2ac('0x5c')]={'name':!_[_0xd2ac('0x19')](_0x253368[_0xd2ac('0x59')])?_0x253368[_0xd2ac('0x59')]:!_[_0xd2ac('0x19')](_0x253368[_0xd2ac('0x5a')])?_0x253368['First_Name']+'\x20'+_0x253368[_0xd2ac('0x5b')]:_0x253368[_0xd2ac('0x5b')],'id':_0x253368['id']};_0x3d794b[_0xd2ac('0x5d')]=_[_0xd2ac('0x43')](_0x253368[_0xd2ac('0x3b')]);}if(_0x181e64['talktime']){_0x3d794b['Call_Duration']=moment['utc'](parseInt(_0x181e64[_0xd2ac('0x5e')])*0x3e8)[_0xd2ac('0x5f')](_0xd2ac('0x60'));}else if(_0x181e64['answertime']&&_0x181e64[_0xd2ac('0x61')]){_0x3d794b[_0xd2ac('0x62')]=moment[_0xd2ac('0x63')](moment(_0x181e64[_0xd2ac('0x61')],_0xd2ac('0x64'))[_0xd2ac('0x65')](moment(_0x181e64[_0xd2ac('0x66')],_0xd2ac('0x64'))))['format'](_0xd2ac('0x60'));}switch(_0x181e64[_0xd2ac('0x67')]){case _0xd2ac('0x68'):_0x3d794b[_0xd2ac('0x69')]='Called';break;case _0xd2ac('0x6a'):case _0xd2ac('0x6b'):_0x3d794b[_0xd2ac('0x69')]='Answered';break;case _0xd2ac('0x6c'):_0x3d794b['Call_Result']=_0xd2ac('0x6d');break;case _0xd2ac('0x6e'):_0x3d794b[_0xd2ac('0x69')]='Abandoned';break;case _0xd2ac('0x6f'):_0x3d794b[_0xd2ac('0x69')]='Timeout';default:}_0x3d794b[_0xd2ac('0x70')]=(_0x58860a==='outbound'?moment(_0x181e64['starttime'])[_0xd2ac('0x5f')](_0xd2ac('0x64')):moment(_0x181e64[_0xd2ac('0x71')])['format'](_0xd2ac('0x64')))||moment()[_0xd2ac('0x5f')]('YYYY-MM-DDTHH:mm:ss');_0x3d794b[_0xd2ac('0x72')]=_0x58860a||_0xd2ac('0x73');_0x3d794b=_[_0xd2ac('0x74')](_0x3d794b,getCustomFields(_0x2cbd2b['Fields'],_0x181e64));return request({'method':_0xd2ac('0x23'),'uri':'https://www.zohoapis.'+_0x21c845+_0xd2ac('0x75'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4c4736},'body':{'data':[_0x3d794b]},'json':!![]})[_0xd2ac('0x28')](function(_0x4b75be){if(_0x4b75be&&_0x4b75be[_0xd2ac('0x3a')][0x0]['code']===_0xd2ac('0x41')){logger[_0xd2ac('0x2d')](_0xd2ac('0x76'));return{'id':_0x4b75be[_0xd2ac('0x3a')][0x0][_0xd2ac('0x42')]['id']};}})[_0xd2ac('0x2a')](function(_0xe8a958){logger['info']('err',_0xe8a958[_0xd2ac('0x2c')]);console[_0xd2ac('0x45')]('err',_0xe8a958);});}exports[_0xd2ac('0x77')]=function(_0x3d5a7f,_0x352b0c,_0x58d74a,_0x4aee51,_0x120454,_0x58aba6){var _0x3a8c98,_0x28b32e,_0xaa9a01;_0x58aba6['host']=intUtil[_0xd2ac('0x78')](_0x58aba6[_0xd2ac('0x79')]);_0x58aba6[_0xd2ac('0x7a')]=intUtil['stripTrailingSlash'](_0x58aba6['serverUrl']);if(_0x120454&&_0x120454[_0xd2ac('0x7b')]){logger[_0xd2ac('0x2d')](_0xd2ac('0x7c'),'Recording\x20is\x20enabled!');_0x352b0c[_0xd2ac('0x7d')]=_0x58aba6[_0xd2ac('0x7a')]+_0xd2ac('0x7e')+_0x352b0c[_0xd2ac('0x7f')]+_0xd2ac('0x80')+md5(_0x352b0c[_0xd2ac('0x7f')]);}else{_0x352b0c['recordingURL']='';}var _0x1adaa4=_0x58aba6['host']==='zoho.eu'?'eu':_0xd2ac('0x81');return getAccessToken(_0x58aba6)[_0xd2ac('0x28')](function(_0x4cbd87){_0xaa9a01=_0x4cbd87;return getUser(_0xaa9a01,_0x1adaa4,_0x58aba6,_0x4aee51[_0xd2ac('0x33')]);})['then'](function(_0xa0ce1c){_0x3a8c98=_0xa0ce1c;logger[_0xd2ac('0x2d')](_0xd2ac('0x82'),_0x3a8c98['id']);return getEndUser(_0xaa9a01,_0x1adaa4,_0x58aba6,_0x352b0c['calleridname'],_0x352b0c['calleridnum'],_0x3a8c98,_0x58d74a);})[_0xd2ac('0x28')](function(_0x341b33){_0x28b32e=_0x341b33;return getCall(_0xaa9a01,_0x1adaa4,_0x58aba6,_0x3a8c98,_0x28b32e,_0x58d74a,_0x352b0c,'Inbound');})[_0xd2ac('0x28')](function(_0x4fade5){if(_0x4fade5){logger[_0xd2ac('0x2d')]('The\x20Call\x20ID\x20is:',_0x4fade5['id']);logger['info'](_0xd2ac('0x7c'),_0xd2ac('0x83'));emit(util[_0xd2ac('0x5f')]('user:%s',_0x4aee51['name']),_0xd2ac('0x84'),{'uri':'https://crm.'+_0x58aba6[_0xd2ac('0x79')]+_0xd2ac('0x85')+_0x4fade5['id']});}})[_0xd2ac('0x2a')](function(_0x146cd6){logger[_0xd2ac('0x37')](_0xd2ac('0x7c'),JSON['stringify'](_0x146cd6));});};exports[_0xd2ac('0x86')]=function(_0x35ad5f,_0x33972a,_0x2b807b,_0x1e7f73,_0x2afa03,_0x33b27d,_0x25648c){var _0x293eeb,_0x2a87a0,_0x2b9745;_0x33b27d['host']=intUtil[_0xd2ac('0x78')](_0x33b27d[_0xd2ac('0x79')]);_0x33b27d[_0xd2ac('0x7a')]=intUtil[_0xd2ac('0x78')](_0x33b27d[_0xd2ac('0x7a')]);if(_0x25648c&&_0x25648c['recordingFormat']&&_0x25648c[_0xd2ac('0x87')]!==_0xd2ac('0x88')){logger['info'](_0xd2ac('0x89'),'Recording\x20is\x20enabled!');_0x33972a[_0xd2ac('0x7d')]=_0x33b27d[_0xd2ac('0x7a')]+_0xd2ac('0x7e')+_0x33972a[_0xd2ac('0x7f')]+_0xd2ac('0x80')+md5(_0x33972a[_0xd2ac('0x7f')]);}var _0x57cae2=_0x33b27d['host']==='zoho.eu'?'eu':_0xd2ac('0x81');return getAccessToken(_0x33b27d)[_0xd2ac('0x28')](function(_0x17426b){_0x2b9745=_0x17426b;return getUser(_0x2b9745,_0x57cae2,_0x33b27d,_0x1e7f73['email']);})['then'](function(_0x568dc8){_0x293eeb=_0x568dc8;logger[_0xd2ac('0x2d')](_0xd2ac('0x82'),_0x293eeb['id']);return getEndUser(_0x2b9745,_0x57cae2,_0x33b27d,_0x33972a[_0xd2ac('0x8a')],_0x33972a['destcalleridnum'],_0x293eeb,_0x2b807b);})[_0xd2ac('0x28')](function(_0x438030){_0x2a87a0=_0x438030;return getCall(_0x2b9745,_0x57cae2,_0x33b27d,_0x293eeb,_0x2a87a0,_0x2b807b,_0x33972a,_0xd2ac('0x8b'));})[_0xd2ac('0x28')](function(_0x2f6e74){if(_0x2f6e74){logger[_0xd2ac('0x2d')](_0xd2ac('0x8c'),_0x2f6e74['id']);logger['info'](_0xd2ac('0x89'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd2ac('0x5f')](_0xd2ac('0x8d'),_0x1e7f73[_0xd2ac('0x16')]),_0xd2ac('0x84'),{'uri':'https://crm.'+_0x33b27d[_0xd2ac('0x79')]+_0xd2ac('0x85')+_0x2f6e74['id']});}})[_0xd2ac('0x2a')](function(_0x40853f){logger['error'](_0xd2ac('0x89'),JSON[_0xd2ac('0xb')](_0x40853f));});};exports[_0xd2ac('0x8e')]=function(_0x2cc3bf,_0x169ce7,_0x3178d6,_0x291b2a,_0x22eb86,_0xfc2f4d){var _0x1fba85,_0x45275b,_0x1a71c0;_0xfc2f4d[_0xd2ac('0x79')]=intUtil[_0xd2ac('0x78')](_0xfc2f4d[_0xd2ac('0x79')]);_0xfc2f4d[_0xd2ac('0x7a')]=intUtil[_0xd2ac('0x78')](_0xfc2f4d[_0xd2ac('0x7a')]);if(_0x22eb86&&_0x22eb86['monitor_format']){logger[_0xd2ac('0x2d')]('['+_0x169ce7[_0xd2ac('0x67')][_0xd2ac('0x8f')]()+']','Recording\x20is\x20enabled!');_0x169ce7[_0xd2ac('0x7d')]=_0xfc2f4d[_0xd2ac('0x7a')]+_0xd2ac('0x7e')+_0x169ce7[_0xd2ac('0x7f')]+_0xd2ac('0x80')+md5(_0x169ce7[_0xd2ac('0x7f')]);}else{_0x169ce7[_0xd2ac('0x7d')]='';}var _0x5883ad=_0xfc2f4d['host']===_0xd2ac('0x90')?'eu':_0xd2ac('0x81');return getAccessToken(_0xfc2f4d)['then'](function(_0x318ee4){_0x1a71c0=_0x318ee4;return getUser(_0x1a71c0,_0x5883ad,_0xfc2f4d);})[_0xd2ac('0x28')](function(_0x4a071e){_0x1fba85=_0x4a071e;logger['info']('The\x20User\x20ID\x20is:',_0x1fba85['id']);return getEndUser(_0x1a71c0,_0x5883ad,_0xfc2f4d,_0x169ce7[_0xd2ac('0x91')],_0x169ce7[_0xd2ac('0x92')],_0x1fba85,_0x3178d6);})[_0xd2ac('0x28')](function(_0x30d932){_0x45275b=_0x30d932;return getCall(_0x1a71c0,_0x5883ad,_0xfc2f4d,_0x1fba85,_0x45275b,_0x3178d6,_0x169ce7,_0xd2ac('0x73'));})[_0xd2ac('0x28')](function(_0x382015){if(_0x382015){logger['info'](_0xd2ac('0x8c'),_0x382015['id']);}})[_0xd2ac('0x2a')](function(_0x523925){logger[_0xd2ac('0x37')]('['+_0x169ce7[_0xd2ac('0x67')][_0xd2ac('0x8f')]()+']',JSON[_0xd2ac('0xb')](_0x523925));});}; \ No newline at end of file +var _0x38ff=['Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','Timeout','Call_Start_Time','outbound','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','code','Call\x20created!','err','host','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','[OUTBOUND]','unmanaged','toUpperCase','lodash','request-promise','md5','util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','includes','string','picklist','type','idField','content','variable','variableName','toString','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','refreshToken','clientId','clientSecret','then','add','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','findIndex','email','Using\x20the\x20admin\x20account!','profile','Administrator','user','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','SUCCESS','details','moduleCreate','log','CREATE\x20ERROR','GET','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','contact','nothing','lead','Leads','Creating\x20new\x20call...','Owner','administrator','getString','Subjects','Description','Who_Id','Full_Name','First_Name','Last_Name','Call_Duration','utc','talktime','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result'];(function(_0x39ad4c,_0x2fa27e){var _0xf3314d=function(_0x4de109){while(--_0x4de109){_0x39ad4c['push'](_0x39ad4c['shift']());}};_0xf3314d(++_0x2fa27e);}(_0x38ff,0x173));var _0xf38f=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0x38ff[_0x47e549];return _0x251374;};'use strict';var _=require(_0xf38f('0x0'));var rp=require(_0xf38f('0x1'));var md5=require(_0xf38f('0x2'));var util=require(_0xf38f('0x3'));var intUtil=require('./util');var moment=require(_0xf38f('0x4'));var Redis=require(_0xf38f('0x5'));var BPromise=require(_0xf38f('0x6'));var config=require(_0xf38f('0x7'));var logger=require(_0xf38f('0x8'))(_0xf38f('0x9'));config[_0xf38f('0xa')]=_[_0xf38f('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xf38f('0xc'))(new Redis(config[_0xf38f('0xa')]));function emit(_0x2e9722,_0x1de277,_0x1de7ac){io['to'](_0x2e9722)[_0xf38f('0xd')](_0x1de277,_0x1de7ac);}function request(_0x231319){logger[_0xf38f('0xe')](_0xf38f('0xf'),JSON[_0xf38f('0x10')](_0x231319));return rp(_0x231319);}function getCustomFields(_0x28506c,_0x29d635){var _0x176ff1={};if(_0x28506c[_0xf38f('0x11')]>0x0){_[_0xf38f('0x12')](_0x28506c,function(_0x134edb){if(_[_0xf38f('0x13')]([_0xf38f('0x14'),_0xf38f('0x15')],_0x134edb[_0xf38f('0x16')])&&_0x134edb[_0xf38f('0x17')]){_0x176ff1[_0x134edb[_0xf38f('0x17')]]=_0x134edb[_0xf38f('0x18')]['toString']();}else if(_0x134edb[_0xf38f('0x16')]===_0xf38f('0x19')&&_0x134edb[_0xf38f('0x1a')]&&_0x134edb['idField']&&_0x29d635[_0x134edb[_0xf38f('0x1a')]]){_0x176ff1[_0x134edb[_0xf38f('0x17')]]=_0x29d635[_0x134edb[_0xf38f('0x1a')]][_0xf38f('0x1b')]();}else if(_0x134edb[_0xf38f('0x16')]==='customVariable'&&_0x134edb[_0xf38f('0x1c')]&&_0x134edb[_0xf38f('0x1c')]['name']&&_0x134edb['idField']&&_0x29d635[_0x134edb['Variable'][_0xf38f('0x1d')][_0xf38f('0x1e')]()]){_0x176ff1[_0x134edb['idField']]=_0x29d635[_0x134edb[_0xf38f('0x1c')]['name']['toLowerCase']()][_0xf38f('0x1b')]();}});}return _0x176ff1;}function getName(_0x5816f7){if(_0x5816f7[_0xf38f('0x1f')]('\x20')>0x0){var _0x1b4723=_0x5816f7[_0xf38f('0x20')](/ (.+)/);if(_0x1b4723[0x1]){return _0x1b4723;}}return[_0x5816f7,_0x5816f7];}var accountsTokens={};function getAccessToken(_0x3e6aa1){return new Promise(function(_0x5b4976,_0x10ba38){if(!_['isNil'](accountsTokens[_0x3e6aa1['id']])&&!_[_0xf38f('0x21')](accountsTokens[_0x3e6aa1['id']][_0xf38f('0x22')])){if(moment()[_0xf38f('0x23')](accountsTokens[_0x3e6aa1['id']][_0xf38f('0x24')])){_0x5b4976(accountsTokens[_0x3e6aa1['id']][_0xf38f('0x22')]);}}var _0x14ed82;switch(_0x3e6aa1[_0xf38f('0x25')]){case'US':_0x14ed82=_0xf38f('0x26');break;case'AU':_0x14ed82=_0xf38f('0x27');break;case'EU':_0x14ed82='https://accounts.zoho.eu';break;case'IN':_0x14ed82=_0xf38f('0x28');break;case'CN':_0x14ed82=_0xf38f('0x29');break;default:_0x14ed82=_0xf38f('0x2a');break;}var _0x220902={'method':'POST','uri':_0x14ed82+_0xf38f('0x2b'),'qs':{'refresh_token':_0x3e6aa1[_0xf38f('0x2c')],'client_id':_0x3e6aa1[_0xf38f('0x2d')],'client_secret':_0x3e6aa1[_0xf38f('0x2e')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x220902)[_0xf38f('0x2f')](function(_0x2284fe){accountsTokens[_0x3e6aa1['id']]={'access_token':_0x2284fe[_0xf38f('0x22')],'expires_in':moment()[_0xf38f('0x30')](_0x2284fe[_0xf38f('0x24')],_0xf38f('0x31'))};_0x5b4976(_0x2284fe[_0xf38f('0x22')]);})[_0xf38f('0x32')](function(_0x4f1e44){logger['error'](_0xf38f('0x33'),_0x4f1e44[_0xf38f('0x34')]);_0x10ba38(_0x4f1e44);});});}function getUser(_0x4d8b1e,_0x475f1e,_0x165c9d,_0x3e4a1d){logger[_0xf38f('0x35')](_0xf38f('0x36'));return request({'method':'GET','uri':util[_0xf38f('0x37')](_0xf38f('0x38'),_0x475f1e),'qs':{'type':_0xf38f('0x39')},'headers':{'Authorization':_0xf38f('0x3a')+_0x4d8b1e},'json':!![]})[_0xf38f('0x2f')](function(_0x3e9037){if(_0x3e9037[_0xf38f('0x3b')]){var _0x2d312c=-0x1;if(_['isArrayLikeObject'](_0x3e9037['users'])){if(!_['isNil'](_0x3e4a1d)){_0x2d312c=_[_0xf38f('0x3c')](_0x3e9037['users'],function(_0x3de018){return _0x3de018[_0xf38f('0x3d')]===_0x3e4a1d;});}if(_0x2d312c>=0x0){logger[_0xf38f('0x35')]('Agent\x20found!');}else{logger[_0xf38f('0x35')](_0xf38f('0x3e'));_0x2d312c=_[_0xf38f('0x3c')](_0x3e9037[_0xf38f('0x3b')],function(_0x42e8ec){return _0x42e8ec[_0xf38f('0x3f')][_0xf38f('0x1d')]===_0xf38f('0x40');});}return _0x3e9037[_0xf38f('0x3b')][_0x2d312c];}else{if(_0x3e9037[_0xf38f('0x41')][_0xf38f('0x3f')][_0xf38f('0x1d')]==='Administrator'){logger[_0xf38f('0x35')](_0xf38f('0x3e'));user=_0x3e9037['user'];return user;}else{logger[_0xf38f('0x42')](_0xf38f('0x43'),JSON[_0xf38f('0x10')](_0x3e9037));throw new Error(_0xf38f('0x44')+JSON[_0xf38f('0x10')](_0x3e9037));}}}else{logger[_0xf38f('0x42')](_0xf38f('0x43'),JSON[_0xf38f('0x10')](_0x3e9037));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xf38f('0x10')](_0x3e9037));}})[_0xf38f('0x32')](function(_0xc9128b){console['error'](_0xc9128b);});}function getZohoUser(_0x2e2867,_0x3771f8){return new BPromise(function(_0x57ec7b,_0x2d46b9){request(_0x2e2867)[_0xf38f('0x2f')](function(_0x16f447){var _0x25bfcb=null;if(_0x16f447){_0x25bfcb=_0x16f447[_0xf38f('0x45')][0x0];_0x25bfcb[_0xf38f('0x46')]=_0x3771f8;}_0x57ec7b(_0x25bfcb);})[_0xf38f('0x32')](function(_0x17c946){_0x2d46b9(_0x17c946);});});}function createEndUser(_0x37b2bf,_0x510314,_0xa6c3d8,_0x3a8ba2,_0x19fe95,_0x3939f8){var _0xa6c3d8=getName(_0xa6c3d8);return request({'method':'POST','uri':_0xf38f('0x47')+_0x510314+_0xf38f('0x48')+_[_0xf38f('0x49')](_0x3939f8['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0xa6c3d8[0x1],'First_Name':_0xa6c3d8[0x0],'Phone':_0x3a8ba2,'Owner':{'name':!_[_0xf38f('0x21')](_0x19fe95[_0xf38f('0x4a')][_0xf38f('0x1d')])?_0x19fe95[_0xf38f('0x4a')][_0xf38f('0x1d')]:!_[_0xf38f('0x21')](_0x19fe95[_0xf38f('0x4b')])?_0x19fe95[_0xf38f('0x4b')]+'\x20'+_0x19fe95[_0xf38f('0x4c')]:_0x19fe95['last_name'],'id':_0x19fe95['id']}}]},'headers':{'Authorization':_0xf38f('0x3a')+_0x37b2bf},'json':!![]})[_0xf38f('0x2f')](function(_0x1d8362){if(_0x1d8362&&_0x1d8362[_0xf38f('0x45')][0x0]['code']===_0xf38f('0x4d')){var _0x5eadd2=_0x1d8362[_0xf38f('0x45')][0x0][_0xf38f('0x4e')];_0x5eadd2[_0xf38f('0x46')]=_[_0xf38f('0x49')](_0x3939f8[_0xf38f('0x4f')])+'s';return _0x5eadd2;}logger['error'](_0xf38f('0x43'),JSON[_0xf38f('0x10')](data));throw new Error('Error:\x20'+JSON['stringify'](data));})[_0xf38f('0x32')](function(_0x143e10){console[_0xf38f('0x50')](_0xf38f('0x51'),_0x143e10);});}function getEndUser(_0x1212bb,_0x46f0c3,_0x5d454,_0x123a07,_0x1afcfa,_0x583d17,_0xfae352){var _0x5e7504={'method':_0xf38f('0x52'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1212bb},'json':!![]};switch(_0xfae352[_0xf38f('0x53')]){case _0xf38f('0x54'):_0x5e7504[_0xf38f('0x55')]='https://www.zohoapis.'+_0x46f0c3+_0xf38f('0x56')+_0x1afcfa+'))';return getZohoUser(_0x5e7504,_0xf38f('0x57'))['then'](function(_0x46fc8a){if(_0x46fc8a)return _0x46fc8a;_0x5e7504[_0xf38f('0x55')]=_0xf38f('0x47')+_0x46f0c3+_0xf38f('0x58')+_0x1afcfa+'))';return getZohoUser(_0x5e7504,'Leads')[_0xf38f('0x2f')](function(_0x4bac5f){if(_0x4bac5f)return _0x4bac5f;if(_0xfae352[_0xf38f('0x4f')]!='nothing'){return createEndUser(_0x1212bb,_0x46f0c3,_0x123a07,_0x1afcfa,_0x583d17,_0xfae352);}else{return{};}});});break;case _0xf38f('0x59'):_0x5e7504['uri']=_0xf38f('0x47')+_0x46f0c3+_0xf38f('0x56')+_0x1afcfa+'))';return getZohoUser(_0x5e7504,'Contacts')[_0xf38f('0x2f')](function(_0x381a55){if(_0x381a55)return _0x381a55;if(_0xfae352[_0xf38f('0x4f')]!=_0xf38f('0x5a')){return createEndUser(_0x1212bb,_0x46f0c3,_0x123a07,_0x1afcfa,_0x583d17,_0xfae352);}else{return{};}});break;case _0xf38f('0x5b'):_0x5e7504[_0xf38f('0x55')]=_0xf38f('0x47')+_0x46f0c3+_0xf38f('0x58')+_0x1afcfa+'))';return getZohoUser(_0x5e7504,_0xf38f('0x5c'))[_0xf38f('0x2f')](function(_0x133a9d){if(_0x133a9d)return _0x133a9d;if(_0xfae352[_0xf38f('0x4f')]!='nothing'){return createEndUser(_0x1212bb,_0x46f0c3,_0x123a07,_0x1afcfa,_0x583d17,_0xfae352);}else{return{};}});break;}}function getCall(_0xb2bc69,_0x44bfed,_0x35adc5,_0x1a32b1,_0x3d91d0,_0x3a517e,_0x58c67d,_0x2cb374){logger['info'](_0xf38f('0x5d'));var _0x400ac9={};_0x400ac9[_0xf38f('0x5e')]={'name':!_[_0xf38f('0x21')](_0x1a32b1[_0xf38f('0x4a')]['name'])&&!_[_0xf38f('0x21')](_0x1a32b1[_0xf38f('0x3f')][_0xf38f('0x1d')])&&_0x1a32b1[_0xf38f('0x3f')]['name']===_0xf38f('0x5f')?_0x1a32b1['role']['name']:!_[_0xf38f('0x21')](_0x1a32b1[_0xf38f('0x4b')])?_0x1a32b1[_0xf38f('0x4b')]+'\x20'+_0x1a32b1['last_name']:_0x1a32b1[_0xf38f('0x4c')],'id':_0x1a32b1['id']};_0x400ac9['Subject']=intUtil[_0xf38f('0x60')](_0x3a517e[_0xf38f('0x61')],_0x58c67d,'\x20');_0x400ac9[_0xf38f('0x62')]=intUtil[_0xf38f('0x60')](_0x3a517e['Descriptions'],_0x58c67d,'\x0a');if(_0x3d91d0['enduserType']===_0xf38f('0x57')){_0x400ac9[_0xf38f('0x63')]={'name':!_['isNil'](_0x3d91d0[_0xf38f('0x64')])?_0x3d91d0[_0xf38f('0x64')]:!_[_0xf38f('0x21')](_0x3d91d0['First_Name'])?_0x3d91d0[_0xf38f('0x65')]+'\x20'+_0x3d91d0[_0xf38f('0x66')]:_0x3d91d0[_0xf38f('0x66')],'id':_0x3d91d0['id']};}if(_0x3d91d0[_0xf38f('0x46')]===_0xf38f('0x5c')){_0x400ac9['What_Id']={'name':!_[_0xf38f('0x21')](_0x3d91d0[_0xf38f('0x64')])?_0x3d91d0['Full_Name']:!_['isNil'](_0x3d91d0[_0xf38f('0x65')])?_0x3d91d0[_0xf38f('0x65')]+'\x20'+_0x3d91d0['Last_Name']:_0x3d91d0[_0xf38f('0x66')],'id':_0x3d91d0['id']};_0x400ac9['$se_module']=_[_0xf38f('0x49')](_0x3d91d0['enduserType']);}if(_0x58c67d['talktime']){_0x400ac9[_0xf38f('0x67')]=moment[_0xf38f('0x68')](parseInt(_0x58c67d[_0xf38f('0x69')])*0x3e8)['format'](_0xf38f('0x6a'));}else if(_0x58c67d[_0xf38f('0x6b')]&&_0x58c67d['endtime']){_0x400ac9[_0xf38f('0x67')]=moment[_0xf38f('0x68')](moment(_0x58c67d[_0xf38f('0x6c')],_0xf38f('0x6d'))[_0xf38f('0x6e')](moment(_0x58c67d[_0xf38f('0x6f')],_0xf38f('0x6d'))))['format'](_0xf38f('0x6a'));}switch(_0x58c67d[_0xf38f('0x70')]){case _0xf38f('0x71'):_0x400ac9[_0xf38f('0x72')]=_0xf38f('0x73');break;case _0xf38f('0x74'):case _0xf38f('0x75'):_0x400ac9['Call_Result']=_0xf38f('0x76');break;case _0xf38f('0x77'):_0x400ac9['Call_Result']=_0xf38f('0x78');break;case _0xf38f('0x79'):_0x400ac9[_0xf38f('0x72')]=_0xf38f('0x7a');break;case'timeout':_0x400ac9[_0xf38f('0x72')]=_0xf38f('0x7b');default:}_0x400ac9[_0xf38f('0x7c')]=(_0x2cb374===_0xf38f('0x7d')?moment(_0x58c67d['starttime'])[_0xf38f('0x37')](_0xf38f('0x6d')):moment(_0x58c67d['agentcalledAt'])[_0xf38f('0x37')](_0xf38f('0x6d')))||moment()[_0xf38f('0x37')]('YYYY-MM-DDTHH:mm:ss');_0x400ac9[_0xf38f('0x7e')]=_0x2cb374||_0xf38f('0x7f');_0x400ac9=_[_0xf38f('0x80')](_0x400ac9,getCustomFields(_0x3a517e[_0xf38f('0x81')],_0x58c67d));return request({'method':'POST','uri':_0xf38f('0x47')+_0x44bfed+_0xf38f('0x82'),'headers':{'Authorization':_0xf38f('0x3a')+_0xb2bc69},'body':{'data':[_0x400ac9]},'json':!![]})['then'](function(_0x91377c){if(_0x91377c&&_0x91377c[_0xf38f('0x45')][0x0][_0xf38f('0x83')]==='SUCCESS'){logger[_0xf38f('0x35')](_0xf38f('0x84'));return{'id':_0x91377c[_0xf38f('0x45')][0x0]['details']['id']};}})['catch'](function(_0xe4a829){logger[_0xf38f('0x35')](_0xf38f('0x85'),_0xe4a829['stack']);console['log']('err',_0xe4a829);});}exports['queue']=function(_0x4184b2,_0x1a68c0,_0xe27800,_0x56ce87,_0x19fe6f,_0x195397){var _0x5f3110,_0x4f8ff4,_0x2a203b;_0x195397[_0xf38f('0x86')]=intUtil[_0xf38f('0x87')](_0x195397[_0xf38f('0x86')]);_0x195397[_0xf38f('0x88')]=intUtil['stripTrailingSlash'](_0x195397[_0xf38f('0x88')]);if(_0x19fe6f&&_0x19fe6f['monitor_format']){logger[_0xf38f('0x35')](_0xf38f('0x89'),'Recording\x20is\x20enabled!');_0x1a68c0[_0xf38f('0x8a')]=_0x195397['serverUrl']+_0xf38f('0x8b')+_0x1a68c0['uniqueid']+_0xf38f('0x8c')+md5(_0x1a68c0[_0xf38f('0x8d')]);}else{_0x1a68c0['recordingURL']='';}var _0x3bc8e6=_0x195397['host']===_0xf38f('0x8e')?'eu':_0xf38f('0x8f');return getAccessToken(_0x195397)[_0xf38f('0x2f')](function(_0x3298fe){_0x2a203b=_0x3298fe;return getUser(_0x2a203b,_0x3bc8e6,_0x195397,_0x56ce87['email']);})[_0xf38f('0x2f')](function(_0x4b3bec){_0x5f3110=_0x4b3bec;logger[_0xf38f('0x35')](_0xf38f('0x90'),_0x5f3110['id']);return getEndUser(_0x2a203b,_0x3bc8e6,_0x195397,_0x1a68c0[_0xf38f('0x91')],_0x1a68c0[_0xf38f('0x92')],_0x5f3110,_0xe27800);})[_0xf38f('0x2f')](function(_0x1bfe34){_0x4f8ff4=_0x1bfe34;return getCall(_0x2a203b,_0x3bc8e6,_0x195397,_0x5f3110,_0x4f8ff4,_0xe27800,_0x1a68c0,_0xf38f('0x7f'));})[_0xf38f('0x2f')](function(_0x46d7c7){if(_0x46d7c7){logger[_0xf38f('0x35')](_0xf38f('0x93'),_0x46d7c7['id']);logger[_0xf38f('0x35')]('[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xf38f('0x94'),_0x56ce87[_0xf38f('0x1d')]),_0xf38f('0x95'),{'uri':_0xf38f('0x96')+_0x195397['host']+_0xf38f('0x97')+_0x46d7c7['id']});}})[_0xf38f('0x32')](function(_0x18abe9){logger['error']('[QUEUE]',JSON[_0xf38f('0x10')](_0x18abe9));});};exports['outbound']=function(_0xe72fc,_0x3827b5,_0x5dc4bf,_0x302ead,_0x44850c,_0x265723,_0x2fb2d8){var _0x136ade,_0x27e4d9,_0x5b6ed9;_0x265723[_0xf38f('0x86')]=intUtil[_0xf38f('0x87')](_0x265723[_0xf38f('0x86')]);_0x265723[_0xf38f('0x88')]=intUtil[_0xf38f('0x87')](_0x265723[_0xf38f('0x88')]);if(_0x2fb2d8&&_0x2fb2d8[_0xf38f('0x98')]&&_0x2fb2d8['recordingFormat']!==_0xf38f('0x99')){logger['info']('[OUTBOUND]',_0xf38f('0x9a'));_0x3827b5[_0xf38f('0x8a')]=_0x265723[_0xf38f('0x88')]+_0xf38f('0x8b')+_0x3827b5[_0xf38f('0x8d')]+'/downloads?type=uniqueid&token='+md5(_0x3827b5[_0xf38f('0x8d')]);}var _0x8c5429=_0x265723[_0xf38f('0x86')]==='zoho.eu'?'eu':_0xf38f('0x8f');return getAccessToken(_0x265723)[_0xf38f('0x2f')](function(_0x2fd03e){_0x5b6ed9=_0x2fd03e;return getUser(_0x5b6ed9,_0x8c5429,_0x265723,_0x302ead[_0xf38f('0x3d')]);})['then'](function(_0x27bd62){_0x136ade=_0x27bd62;logger[_0xf38f('0x35')](_0xf38f('0x90'),_0x136ade['id']);return getEndUser(_0x5b6ed9,_0x8c5429,_0x265723,_0x3827b5[_0xf38f('0x9b')],_0x3827b5[_0xf38f('0x9c')],_0x136ade,_0x5dc4bf);})[_0xf38f('0x2f')](function(_0x587f90){_0x27e4d9=_0x587f90;return getCall(_0x5b6ed9,_0x8c5429,_0x265723,_0x136ade,_0x27e4d9,_0x5dc4bf,_0x3827b5,_0xf38f('0x9d'));})[_0xf38f('0x2f')](function(_0x3314af){if(_0x3314af){logger['info'](_0xf38f('0x93'),_0x3314af['id']);logger[_0xf38f('0x35')]('[OUTBOUND]',_0xf38f('0x9e'));emit(util[_0xf38f('0x37')](_0xf38f('0x94'),_0x302ead[_0xf38f('0x1d')]),_0xf38f('0x95'),{'uri':_0xf38f('0x96')+_0x265723[_0xf38f('0x86')]+_0xf38f('0x97')+_0x3314af['id']});}})[_0xf38f('0x32')](function(_0x1bdf42){logger[_0xf38f('0x42')](_0xf38f('0x9f'),JSON[_0xf38f('0x10')](_0x1bdf42));});};exports[_0xf38f('0xa0')]=function(_0x5c0373,_0x9640b3,_0x52aae4,_0xe8ddfa,_0x2815f2,_0x19de52){var _0x5e3790,_0x12533e,_0x2a06c3;_0x19de52[_0xf38f('0x86')]=intUtil[_0xf38f('0x87')](_0x19de52[_0xf38f('0x86')]);_0x19de52[_0xf38f('0x88')]=intUtil[_0xf38f('0x87')](_0x19de52[_0xf38f('0x88')]);if(_0x2815f2&&_0x2815f2['monitor_format']){logger[_0xf38f('0x35')]('['+_0x9640b3[_0xf38f('0x70')]['toUpperCase']()+']',_0xf38f('0x9a'));_0x9640b3[_0xf38f('0x8a')]=_0x19de52[_0xf38f('0x88')]+_0xf38f('0x8b')+_0x9640b3[_0xf38f('0x8d')]+_0xf38f('0x8c')+md5(_0x9640b3['uniqueid']);}else{_0x9640b3[_0xf38f('0x8a')]='';}var _0x34e98d=_0x19de52[_0xf38f('0x86')]===_0xf38f('0x8e')?'eu':_0xf38f('0x8f');return getAccessToken(_0x19de52)['then'](function(_0x591f33){_0x2a06c3=_0x591f33;return getUser(_0x2a06c3,_0x34e98d,_0x19de52);})[_0xf38f('0x2f')](function(_0x48974b){_0x5e3790=_0x48974b;logger[_0xf38f('0x35')]('The\x20User\x20ID\x20is:',_0x5e3790['id']);return getEndUser(_0x2a06c3,_0x34e98d,_0x19de52,_0x9640b3[_0xf38f('0x91')],_0x9640b3[_0xf38f('0x92')],_0x5e3790,_0x52aae4);})[_0xf38f('0x2f')](function(_0xa47b9c){_0x12533e=_0xa47b9c;return getCall(_0x2a06c3,_0x34e98d,_0x19de52,_0x5e3790,_0x12533e,_0x52aae4,_0x9640b3,_0xf38f('0x7f'));})[_0xf38f('0x2f')](function(_0x2cb124){if(_0x2cb124){logger[_0xf38f('0x35')](_0xf38f('0x93'),_0x2cb124['id']);}})[_0xf38f('0x32')](function(_0x4897fa){logger['error']('['+_0x9640b3[_0xf38f('0x70')][_0xf38f('0xa1')]()+']',JSON[_0xf38f('0x10')](_0x4897fa));});}; \ 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 8c264cf..bad67ac 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 _0x3f4a=['format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','mustache','../../../../config/logger','trigger','exec','data2','Script','data3','render','error'];(function(_0x4d667a,_0x22fc32){var _0x1edcfa=function(_0x4165fd){while(--_0x4165fd){_0x4d667a['push'](_0x4d667a['shift']());}};_0x1edcfa(++_0x22fc32);}(_0x3f4a,0x1c4));var _0xa3f4=function(_0x259099,_0x8d11fa){_0x259099=_0x259099-0x0;var _0x1033ec=_0x3f4a[_0x259099];return _0x1033ec;};'use strict';var util=require('util');var sh=require(_0xa3f4('0x0'));var Mustache=require(_0xa3f4('0x1'));var logger=require(_0xa3f4('0x2'))(_0xa3f4('0x3'));exports[_0xa3f4('0x4')]=function(_0xd86db7,_0x34a30c){var _0xfc02=_0xd86db7['data2']?_0xd86db7[_0xa3f4('0x5')]:_0xa3f4('0x6');var _0x3ebce1=_0xd86db7[_0xa3f4('0x7')]?Mustache[_0xa3f4('0x8')](_0xd86db7[_0xa3f4('0x7')],_0x34a30c):_0x34a30c;sh['exec'](_0x3ebce1,function(_0x3e8a0f,_0x54628c,_0xf58c75){if(_0x3e8a0f!==0x0){logger[_0xa3f4('0x9')](util[_0xa3f4('0xa')](_0xa3f4('0xb'),_0xfc02,_0x3ebce1,_0x3e8a0f,_0xf58c75));}else{logger[_0xa3f4('0xc')](util[_0xa3f4('0xa')](_0xa3f4('0xd'),_0xfc02,_0x3ebce1,_0x54628c));}});}; \ No newline at end of file +var _0x1cfa=['exec','data2','render','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','../../../../config/logger','trigger'];(function(_0x34ed6f,_0x5e4021){var _0x1db386=function(_0xcf95f7){while(--_0xcf95f7){_0x34ed6f['push'](_0x34ed6f['shift']());}};_0x1db386(++_0x5e4021);}(_0x1cfa,0xf3));var _0xa1cf=function(_0x16e751,_0x458e62){_0x16e751=_0x16e751-0x0;var _0x52f14f=_0x1cfa[_0x16e751];return _0x52f14f;};'use strict';var util=require(_0xa1cf('0x0'));var sh=require(_0xa1cf('0x1'));var Mustache=require('mustache');var logger=require(_0xa1cf('0x2'))(_0xa1cf('0x3'));exports[_0xa1cf('0x4')]=function(_0x5af4b3,_0x4687e6){var _0x3eb758=_0x5af4b3[_0xa1cf('0x5')]?_0x5af4b3['data2']:'Script';var _0x49c892=_0x5af4b3['data3']?Mustache[_0xa1cf('0x6')](_0x5af4b3[_0xa1cf('0x7')],_0x4687e6):_0x4687e6;sh[_0xa1cf('0x4')](_0x49c892,function(_0x388f91,_0x3d86ea,_0x322812){if(_0x388f91!==0x0){logger[_0xa1cf('0x8')](util[_0xa1cf('0x9')](_0xa1cf('0xa'),_0x3eb758,_0x49c892,_0x388f91,_0x322812));}else{logger[_0xa1cf('0xb')](util[_0xa1cf('0x9')](_0xa1cf('0xc'),_0x3eb758,_0x49c892,_0x3d86ea));}});}; \ 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 cf8ef2e..d023e3a 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 _0x4fd2=['number','headers','data6','parse','error','stack','data1','GET','DELETE','POST','data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','stringify','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','toUpperCase','render','data2','data5'];(function(_0xab1bbb,_0x4b6849){var _0x57ee06=function(_0x70943a){while(--_0x70943a){_0xab1bbb['push'](_0xab1bbb['shift']());}};_0x57ee06(++_0x4b6849);}(_0x4fd2,0x1a5));var _0x24fd=function(_0x49524f,_0x169c5c){_0x49524f=_0x49524f-0x0;var _0x2cc9d1=_0x4fd2[_0x49524f];return _0x2cc9d1;};'use strict';var rp=require(_0x24fd('0x0'));var util=require(_0x24fd('0x1'));var _=require(_0x24fd('0x2'));var Mustache=require(_0x24fd('0x3'));var logger=require(_0x24fd('0x4'))(_0x24fd('0x5'));exports[_0x24fd('0x6')]=function(_0x45ad09,_0x4149d1){var _0x54b67a,_0x2be1d2;var _0x47757a={'method':_0x45ad09['data1'][_0x24fd('0x7')](),'uri':Mustache[_0x24fd('0x8')](_0x45ad09[_0x24fd('0x9')],_0x4149d1),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x45ad09[_0x24fd('0xa')])===_0x24fd('0xb')&&parseInt(_0x45ad09['data5'])>=0x1&&parseInt(_0x45ad09['data5'])<=0xa?parseInt(_0x45ad09[_0x24fd('0xa')])*0x3e8:0x5*0x3e8};try{_0x47757a[_0x24fd('0xc')]=_0x45ad09[_0x24fd('0xd')]?JSON[_0x24fd('0xe')](Mustache['render'](_0x45ad09[_0x24fd('0xd')],_0x4149d1)):{};}catch(_0x5134cb){logger[_0x24fd('0xf')](_0x5134cb[_0x24fd('0x10')]);}switch(_0x45ad09[_0x24fd('0x11')][_0x24fd('0x7')]()){case _0x24fd('0x12'):case _0x24fd('0x13'):_0x54b67a=null;_0x47757a['qs']=_0x4149d1;break;case _0x24fd('0x14'):case'PUT':if(_0x45ad09[_0x24fd('0x15')]){try{_0x54b67a=JSON[_0x24fd('0xe')](Mustache[_0x24fd('0x8')](_0x45ad09['data7'],_0x4149d1));_0x47757a['body']=_0x54b67a;}catch(_0x5bd158){logger['error'](_0x5bd158[_0x24fd('0x10')]);logger[_0x24fd('0xf')](_0x24fd('0x16'));}}else{_0x54b67a=_0x4149d1;_0x47757a[_0x24fd('0x17')]=_0x54b67a;}break;}logger[_0x24fd('0x18')](util[_0x24fd('0x19')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x45ad09[_0x24fd('0x11')],_0x45ad09[_0x24fd('0x9')],JSON[_0x24fd('0x1a')](_0x47757a)));rp(_0x47757a)['then'](function(_0xea4106){_0x54b67a=!_[_0x24fd('0x1b')](_0x54b67a)?_0x24fd('0x1c')+_0x54b67a:'';_0x2be1d2=typeof _0xea4106[_0x24fd('0x17')]===_0x24fd('0x1d')?JSON[_0x24fd('0x1a')](_0xea4106[_0x24fd('0x17')]):_0xea4106[_0x24fd('0x17')];logger[_0x24fd('0x18')](util[_0x24fd('0x19')](_0x24fd('0x1e'),_0x45ad09[_0x24fd('0x11')],_0x45ad09[_0x24fd('0x9')],_0xea4106['statusCode'],_0x2be1d2));})[_0x24fd('0x1f')](function(_0x115a54){logger[_0x24fd('0xf')](util[_0x24fd('0x19')](_0x24fd('0x20'),_0x45ad09[_0x24fd('0x11')],_0x45ad09[_0x24fd('0x9')],_0x115a54[_0x24fd('0x21')],_0x115a54[_0x24fd('0x22')],_0x115a54[_0x24fd('0x23')]));});}; \ No newline at end of file +var _0x6f16=['POST','PUT','parse','data7','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','stringify','isNil',',\x20request\x20body:\x20','object','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','../../../../config/logger','trigger','exec','data2','data5','number','headers','data6','render','error','data1','toUpperCase','GET','DELETE'];(function(_0x567168,_0x599f19){var _0x632a3f=function(_0x330258){while(--_0x330258){_0x567168['push'](_0x567168['shift']());}};_0x632a3f(++_0x599f19);}(_0x6f16,0x1f4));var _0x66f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f16[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require(_0x66f1('0x0'));var util=require(_0x66f1('0x1'));var _=require(_0x66f1('0x2'));var Mustache=require(_0x66f1('0x3'));var logger=require(_0x66f1('0x4'))(_0x66f1('0x5'));exports[_0x66f1('0x6')]=function(_0x2a60b6,_0x34226a){var _0x35baed,_0x24b363;var _0x4495d3={'method':_0x2a60b6['data1']['toUpperCase'](),'uri':Mustache['render'](_0x2a60b6[_0x66f1('0x7')],_0x34226a),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2a60b6[_0x66f1('0x8')])===_0x66f1('0x9')&&parseInt(_0x2a60b6[_0x66f1('0x8')])>=0x1&&parseInt(_0x2a60b6[_0x66f1('0x8')])<=0xa?parseInt(_0x2a60b6[_0x66f1('0x8')])*0x3e8:0x5*0x3e8};try{_0x4495d3[_0x66f1('0xa')]=_0x2a60b6[_0x66f1('0xb')]?JSON['parse'](Mustache[_0x66f1('0xc')](_0x2a60b6[_0x66f1('0xb')],_0x34226a)):{};}catch(_0x4ac820){logger[_0x66f1('0xd')](_0x4ac820['stack']);}switch(_0x2a60b6[_0x66f1('0xe')][_0x66f1('0xf')]()){case _0x66f1('0x10'):case _0x66f1('0x11'):_0x35baed=null;_0x4495d3['qs']=_0x34226a;break;case _0x66f1('0x12'):case _0x66f1('0x13'):if(_0x2a60b6['data7']){try{_0x35baed=JSON[_0x66f1('0x14')](Mustache[_0x66f1('0xc')](_0x2a60b6[_0x66f1('0x15')],_0x34226a));_0x4495d3[_0x66f1('0x16')]=_0x35baed;}catch(_0x14526c){logger[_0x66f1('0xd')](_0x14526c[_0x66f1('0x17')]);logger[_0x66f1('0xd')](_0x66f1('0x18'));}}else{_0x35baed=_0x34226a;_0x4495d3['body']=_0x35baed;}break;}logger['info'](util[_0x66f1('0x19')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x2a60b6[_0x66f1('0xe')],_0x2a60b6['data2'],JSON[_0x66f1('0x1a')](_0x4495d3)));rp(_0x4495d3)['then'](function(_0x1dc1b4){_0x35baed=!_[_0x66f1('0x1b')](_0x35baed)?_0x66f1('0x1c')+_0x35baed:'';_0x24b363=typeof _0x1dc1b4['body']===_0x66f1('0x1d')?JSON[_0x66f1('0x1a')](_0x1dc1b4[_0x66f1('0x16')]):_0x1dc1b4['body'];logger[_0x66f1('0x1e')](util[_0x66f1('0x19')](_0x66f1('0x1f'),_0x2a60b6['data1'],_0x2a60b6[_0x66f1('0x7')],_0x1dc1b4[_0x66f1('0x20')],_0x24b363));})[_0x66f1('0x21')](function(_0x114aac){logger[_0x66f1('0xd')](util['format'](_0x66f1('0x22'),_0x2a60b6[_0x66f1('0xe')],_0x2a60b6[_0x66f1('0x7')],_0x114aac[_0x66f1('0x20')],_0x114aac[_0x66f1('0x23')],_0x114aac[_0x66f1('0x24')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 6eb1361..a37c490 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 _0xe836=['error','rpc','message','result','exports','bluebird','../../config/logger','routing','Request','request','debug'];(function(_0xebb2fc,_0x426520){var _0x50f706=function(_0x3efc6b){while(--_0x3efc6b){_0xebb2fc['push'](_0xebb2fc['shift']());}};_0x50f706(++_0x426520);}(_0xe836,0xc0));var _0x6e83=function(_0x498dcf,_0x437e05){_0x498dcf=_0x498dcf-0x0;var _0x507efb=_0xe836[_0x498dcf];return _0x507efb;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x6e83('0x0'));var logger=require(_0x6e83('0x1'))(_0x6e83('0x2'));var client=jayson['client']['http']({'port':0x2329});client[_0x6e83('0x3')]=function(_0xbb3fc9,_0x1e4b2c){return new BPromise(function(_0x4d26a1,_0x14bc75){return client[_0x6e83('0x4')](_0xbb3fc9,_0x1e4b2c)['then'](function(_0x148d12){logger[_0x6e83('0x5')]('rpc',_0x6e83('0x2'),_0xbb3fc9,_0x1e4b2c,_0x148d12);if(_0x148d12[_0x6e83('0x6')]){logger[_0x6e83('0x6')](_0x6e83('0x7'),_0x6e83('0x2'),_0xbb3fc9,_0x148d12[_0x6e83('0x6')][_0x6e83('0x8')],_0x1e4b2c);return _0x14bc75(_0x148d12[_0x6e83('0x6')]['message']);}else{return _0x4d26a1(_0x148d12[_0x6e83('0x9')]);}})['catch'](function(_0x2cb752){logger[_0x6e83('0x6')](_0x6e83('0x7'),_0x6e83('0x2'),_0xbb3fc9,_0x2cb752,_0x1e4b2c);return _0x14bc75(_0x2cb752);});});};module[_0x6e83('0xa')]=client; \ No newline at end of file +var _0x850a=['error','rpc','message','exports','../../config/logger','routing','client','Request','request','then','debug'];(function(_0x1cdeed,_0x263bf7){var _0x4150a1=function(_0x4d7f39){while(--_0x4d7f39){_0x1cdeed['push'](_0x1cdeed['shift']());}};_0x4150a1(++_0x263bf7);}(_0x850a,0x17a));var _0xa850=function(_0x502036,_0x502686){_0x502036=_0x502036-0x0;var _0x485247=_0x850a[_0x502036];return _0x485247;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0xa850('0x0'))(_0xa850('0x1'));var client=jayson[_0xa850('0x2')]['http']({'port':0x2329});client[_0xa850('0x3')]=function(_0x116a4a,_0x3a564b){return new BPromise(function(_0x5dce60,_0x5d73c4){return client[_0xa850('0x4')](_0x116a4a,_0x3a564b)[_0xa850('0x5')](function(_0x4feef9){logger[_0xa850('0x6')]('rpc','routing',_0x116a4a,_0x3a564b,_0x4feef9);if(_0x4feef9[_0xa850('0x7')]){logger[_0xa850('0x7')](_0xa850('0x8'),_0xa850('0x1'),_0x116a4a,_0x4feef9[_0xa850('0x7')][_0xa850('0x9')],_0x3a564b);return _0x5d73c4(_0x4feef9[_0xa850('0x7')]['message']);}else{return _0x5dce60(_0x4feef9['result']);}})['catch'](function(_0x2f86a2){logger[_0xa850('0x7')]('rpc',_0xa850('0x1'),_0x116a4a,_0x2f86a2,_0x3a564b);return _0x5d73c4(_0x2f86a2);});});};module[_0xa850('0xa')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 9df71b5..8f98d85 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 _0x7796=['resolve','then','getMailAccounts','refresh','listen','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email'];(function(_0x4fadf7,_0x44acfc){var _0x4ce3df=function(_0x331208){while(--_0x331208){_0x4fadf7['push'](_0x4fadf7['shift']());}};_0x4ce3df(++_0x44acfc);}(_0x7796,0x1d5));var _0x6779=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7796[_0x3dd15e];return _0x231fd0;};'use strict';var server=require(_0x6779('0x0'));var Realtime=require(_0x6779('0x1'));var EmailChannel=require(_0x6779('0x2'));var mailAccount=require(_0x6779('0x3'));var setting=require(_0x6779('0x4'));var logger=require(_0x6779('0x5'))(_0x6779('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x6779('0x7')]()[_0x6779('0x8')](mailAccount[_0x6779('0x9')]())[_0x6779('0x8')](realtime['initMailAccounts']())[_0x6779('0x8')](function(){email[_0x6779('0xa')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x6779('0xb')](realtime,email)[_0x6779('0x8')](function(){return initRealtime();})[_0x6779('0x8')](function(){return setting[_0x6779('0xc')]();})[_0x6779('0x8')](function(_0x47a58f){return setInterval(initRealtime,_0x47a58f[_0x6779('0xd')]*0x3e8);})[_0x6779('0xe')](function(_0xbbfcc){logger[_0x6779('0xf')](_0x6779('0x10'),_0xbbfcc);});}main(); \ No newline at end of file +var _0x28c8=['loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts','refresh','listen','getSettings'];(function(_0x4489b6,_0x47c466){var _0x13a4bb=function(_0x25092f){while(--_0x25092f){_0x4489b6['push'](_0x4489b6['shift']());}};_0x13a4bb(++_0x47c466);}(_0x28c8,0x136));var _0x828c=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0x28c8[_0x4953da];return _0x2d3780;};'use strict';var server=require(_0x828c('0x0'));var Realtime=require(_0x828c('0x1'));var EmailChannel=require(_0x828c('0x2'));var mailAccount=require(_0x828c('0x3'));var setting=require(_0x828c('0x4'));var logger=require(_0x828c('0x5'))(_0x828c('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x828c('0x7')]()[_0x828c('0x8')](mailAccount[_0x828c('0x9')]())[_0x828c('0x8')](realtime[_0x828c('0xa')]())[_0x828c('0x8')](function(){email[_0x828c('0xb')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x828c('0xc')](realtime,email)[_0x828c('0x8')](function(){return initRealtime();})[_0x828c('0x8')](function(){return setting[_0x828c('0xd')]();})[_0x828c('0x8')](function(_0x28e280){return setInterval(initRealtime,_0x28e280[_0x828c('0xe')]*0x3e8);})[_0x828c('0xf')](function(_0x528781){logger[_0x828c('0x10')](_0x828c('0x11'),_0x528781);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 32ed2fd..5a11d76 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 _0xd8fa=['bluebird','md5','ioredis','../../../config/environment','email','redis','defaults','localhost','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','isNil','refresh','hasOwnProperty','service','provider','box','handleImapBox','bind','end','handleImapEnd','handleImapError','connected','messages','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','Smtp','then','verified','catch','error','exports','lodash','moment'];(function(_0xf3d079,_0x225854){var _0x3feefa=function(_0x2a858c){while(--_0x2a858c){_0xf3d079['push'](_0xf3d079['shift']());}};_0x3feefa(++_0x225854);}(_0xd8fa,0x9d));var _0xad8f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd8fa[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xad8f('0x0'));var moment=require(_0xad8f('0x1'));var BPromise=require(_0xad8f('0x2'));var md5=require(_0xad8f('0x3'));var Redis=require(_0xad8f('0x4'));var config=require(_0xad8f('0x5'));var logger=require('../../../config/logger')(_0xad8f('0x6'));config[_0xad8f('0x7')]=_[_0xad8f('0x8')](config[_0xad8f('0x7')],{'host':_0xad8f('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xad8f('0x7')]));var EmailImap=require('./imap');var EmailSmtp=require('./smtp');var mailAccount=require(_0xad8f('0xa'));var md5Accounts={};function EmailChannel(_0x4de180){logger[_0xad8f('0xb')](_0xad8f('0xc'));this[_0xad8f('0xd')]=_0x4de180[_0xad8f('0xd')];this[_0xad8f('0xe')]={};this[_0xad8f('0xf')]=new EmailSmtp();}EmailChannel[_0xad8f('0x10')][_0xad8f('0x11')]=function(_0x55868d){var _0x6822be=this[_0xad8f('0xd')][_0x55868d];var _0x2dd773={'id':_0x6822be['id'],'name':_0x6822be[_0xad8f('0x12')],'key':_0x6822be[_0xad8f('0x13')],'active':_0x6822be[_0xad8f('0x14')],'Imap':{'status':_0x6822be[_0xad8f('0x15')][_0xad8f('0x16')],'messageStatus':_0x6822be[_0xad8f('0x15')][_0xad8f('0x17')],'total':_0x6822be[_0xad8f('0x15')][_0xad8f('0x18')]}};if(_[_0xad8f('0x19')](md5Accounts[_0x55868d])){md5Accounts[_0x55868d]={};}var _0x5b31e4=md5(JSON['stringify'](_0x2dd773));if(md5Accounts[_0x55868d][_0xad8f('0x3')]!==_0x5b31e4){md5Accounts[_0x55868d][_0xad8f('0x3')]=_0x5b31e4;io[_0xad8f('0x11')]('mailAccount:update',_0x2dd773);}};EmailChannel['prototype'][_0xad8f('0x1a')]=function(_0x757b53){for(var _0x52476a in _0x757b53){if(_0x757b53[_0xad8f('0x1b')](_0x52476a)){if(_0x757b53[_0x52476a][_0xad8f('0x15')]&&_0x757b53[_0x52476a][_0xad8f('0x14')]){var _0x136a32=_0x757b53[_0x52476a][_0xad8f('0x15')];if(!_0x136a32[_0xad8f('0x1c')]&&_0x757b53[_0x52476a][_0xad8f('0x1d')]!=='custom')_0x136a32[_0xad8f('0x1c')]=_0x757b53[_0x52476a][_0xad8f('0x1d')];if(!this[_0xad8f('0xe')][_0xad8f('0x1b')](_0x136a32['id'])){this[_0xad8f('0xe')][_0x136a32['id']]=new EmailImap(_0x136a32,_0x757b53[_0x52476a]['email']);this['imapAccounts'][_0x136a32['id']]['on'](_0xad8f('0x1e'),this[_0xad8f('0x1f')][_0xad8f('0x20')](this,_0x52476a));this[_0xad8f('0xe')][_0x136a32['id']]['on']('email',this['handleImapEmail'][_0xad8f('0x20')](this,_0x52476a));this[_0xad8f('0xe')][_0x136a32['id']]['on'](_0xad8f('0x21'),this[_0xad8f('0x22')][_0xad8f('0x20')](this,_0x52476a));this[_0xad8f('0xe')][_0x136a32['id']]['on']('error',this[_0xad8f('0x23')][_0xad8f('0x20')](this,_0x52476a));}}else{if(_['isNil'](this['mailAccounts'][_0x52476a][_0xad8f('0x15')])){this['mailAccounts'][_0x52476a]['Imap']={};}this['mailAccounts'][_0x52476a]['Imap'][_0xad8f('0x16')]='disabled';this[_0xad8f('0xd')][_0x52476a][_0xad8f('0x15')][_0xad8f('0x17')]='';this[_0xad8f('0x11')](_0x52476a);}}}};EmailChannel[_0xad8f('0x10')]['handleImapBox']=function(_0x35052c,_0x32d645){if(this['mailAccounts'][_0x35052c]){this[_0xad8f('0xd')][_0x35052c][_0xad8f('0x15')][_0xad8f('0x16')]=_0xad8f('0x24');this['mailAccounts'][_0x35052c][_0xad8f('0x15')][_0xad8f('0x17')]=_0x32d645[_0xad8f('0x12')];if(_0x32d645[_0xad8f('0x25')]){this[_0xad8f('0xd')][_0x35052c][_0xad8f('0x15')]['total']=_0x32d645[_0xad8f('0x25')][_0xad8f('0x18')];}return this[_0xad8f('0x11')](_0x35052c);}};EmailChannel['prototype'][_0xad8f('0x26')]=function(_0xf490fd,_0x10c6c0){logger['info'](_0xad8f('0x27'),_0x10c6c0[_0xad8f('0x28')],_0x10c6c0['lastName'],_0x10c6c0[_0xad8f('0x29')],_0xf490fd);if(this[_0xad8f('0xd')][_0xf490fd]){return mailAccount['notify'](_0xf490fd,_0x10c6c0)['then'](function(_0x24617e){if(_0x24617e){logger[_0xad8f('0xb')](_0xad8f('0x2a'));}})['catch'](function(_0x277832){logger['error'](_0xad8f('0x2b'),JSON['stringify'](_0x277832));});}};EmailChannel[_0xad8f('0x10')][_0xad8f('0x22')]=function(_0x3dffcb){if(this[_0xad8f('0xd')][_0x3dffcb]&&this[_0xad8f('0xd')][_0x3dffcb][_0xad8f('0x15')]){if(this[_0xad8f('0xe')][this[_0xad8f('0xd')][_0x3dffcb][_0xad8f('0x15')]['id']]){delete this[_0xad8f('0xe')][this['mailAccounts'][_0x3dffcb][_0xad8f('0x15')]['id']];}this[_0xad8f('0xd')][_0x3dffcb][_0xad8f('0x15')][_0xad8f('0x2c')]=moment();this['emit'](_0x3dffcb);}};EmailChannel[_0xad8f('0x10')][_0xad8f('0x23')]=function(_0x3ada0e,_0x1d860a){if(this[_0xad8f('0xd')][_0x3ada0e]){this[_0xad8f('0xd')][_0x3ada0e][_0xad8f('0x15')]['status']='error';this[_0xad8f('0xd')][_0x3ada0e][_0xad8f('0x15')]['messageStatus']=_0x1d860a;return this['emit'](_0x3ada0e);}};EmailChannel[_0xad8f('0x10')][_0xad8f('0x2d')]=function(_0x2adafb,_0x4fe20c){return this['smtp'][_0xad8f('0x2e')](_0x2adafb,_0x4fe20c);};EmailChannel[_0xad8f('0x10')]['verifySmtp']=function(_0x3dbefe){var _0x1ccd04=this;if(this[_0xad8f('0xd')][_0x3dbefe['id']]){if(_[_0xad8f('0x19')](this[_0xad8f('0xd')][_0x3dbefe['id']][_0xad8f('0x2f')])){this[_0xad8f('0xd')][_0x3dbefe['id']]['Smtp']={};}this['mailAccounts'][_0x3dbefe['id']][_0xad8f('0x2f')][_0xad8f('0x2c')]=moment();return new BPromise(function(_0x482285,_0x57478b){return _0x1ccd04[_0xad8f('0xf')]['verify'](_0x3dbefe)[_0xad8f('0x30')](function(_0x3c7aa8){_0x1ccd04[_0xad8f('0xd')][_0x3dbefe['id']]['Smtp']['status']=_0xad8f('0x31');_0x1ccd04['mailAccounts'][_0x3dbefe['id']][_0xad8f('0x2f')][_0xad8f('0x17')]='';_0x1ccd04['emit'](_0x3dbefe['id']);_0x482285(_0x3c7aa8);})[_0xad8f('0x32')](function(_0x160a80){_0x1ccd04[_0xad8f('0xd')][_0x3dbefe['id']][_0xad8f('0x2f')][_0xad8f('0x16')]=_0xad8f('0x33');_0x1ccd04['mailAccounts'][_0x3dbefe['id']][_0xad8f('0x2f')][_0xad8f('0x17')]=_0x160a80;_0x1ccd04[_0xad8f('0x11')](_0x3dbefe['id']);_0x57478b(_0x160a80);});});}return this[_0xad8f('0xf')]['verify'](_0x3dbefe);};module[_0xad8f('0x34')]=EmailChannel; \ No newline at end of file +var _0xb454=['sendMail','send','verifySmtp','Smtp','lastSync','verify','verified','lodash','moment','bluebird','md5','ioredis','../../../config/environment','email','defaults','redis','localhost','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','stringify','mailAccount:update','refresh','hasOwnProperty','provider','custom','service','box','handleImapBox','bind','end','handleImapEnd','error','handleImapError','isNil','connected','messages','handleImapEmail','info','firstName','from','notify','then','catch'];(function(_0x3a142b,_0x40aeff){var _0x3ad829=function(_0x90ef7a){while(--_0x90ef7a){_0x3a142b['push'](_0x3a142b['shift']());}};_0x3ad829(++_0x40aeff);}(_0xb454,0x79));var _0x4b45=function(_0x59ae8f,_0x148344){_0x59ae8f=_0x59ae8f-0x0;var _0x3900b5=_0xb454[_0x59ae8f];return _0x3900b5;};'use strict';var _=require(_0x4b45('0x0'));var moment=require(_0x4b45('0x1'));var BPromise=require(_0x4b45('0x2'));var md5=require(_0x4b45('0x3'));var Redis=require(_0x4b45('0x4'));var config=require(_0x4b45('0x5'));var logger=require('../../../config/logger')(_0x4b45('0x6'));config['redis']=_[_0x4b45('0x7')](config[_0x4b45('0x8')],{'host':_0x4b45('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4b45('0x8')]));var EmailImap=require(_0x4b45('0xa'));var EmailSmtp=require(_0x4b45('0xb'));var mailAccount=require(_0x4b45('0xc'));var md5Accounts={};function EmailChannel(_0x3553fc){logger['info'](_0x4b45('0xd'));this[_0x4b45('0xe')]=_0x3553fc[_0x4b45('0xe')];this[_0x4b45('0xf')]={};this[_0x4b45('0x10')]=new EmailSmtp();}EmailChannel[_0x4b45('0x11')][_0x4b45('0x12')]=function(_0x1122dc){var _0x9d6ce1=this[_0x4b45('0xe')][_0x1122dc];var _0x1c774e={'id':_0x9d6ce1['id'],'name':_0x9d6ce1[_0x4b45('0x13')],'key':_0x9d6ce1[_0x4b45('0x14')],'active':_0x9d6ce1[_0x4b45('0x15')],'Imap':{'status':_0x9d6ce1[_0x4b45('0x16')][_0x4b45('0x17')],'messageStatus':_0x9d6ce1[_0x4b45('0x16')][_0x4b45('0x18')],'total':_0x9d6ce1[_0x4b45('0x16')][_0x4b45('0x19')]}};if(_['isNil'](md5Accounts[_0x1122dc])){md5Accounts[_0x1122dc]={};}var _0x1cc141=md5(JSON[_0x4b45('0x1a')](_0x1c774e));if(md5Accounts[_0x1122dc][_0x4b45('0x3')]!==_0x1cc141){md5Accounts[_0x1122dc][_0x4b45('0x3')]=_0x1cc141;io[_0x4b45('0x12')](_0x4b45('0x1b'),_0x1c774e);}};EmailChannel[_0x4b45('0x11')][_0x4b45('0x1c')]=function(_0x17dfa1){for(var _0x3521ee in _0x17dfa1){if(_0x17dfa1[_0x4b45('0x1d')](_0x3521ee)){if(_0x17dfa1[_0x3521ee][_0x4b45('0x16')]&&_0x17dfa1[_0x3521ee][_0x4b45('0x15')]){var _0x5c849e=_0x17dfa1[_0x3521ee]['Imap'];if(!_0x5c849e['service']&&_0x17dfa1[_0x3521ee][_0x4b45('0x1e')]!==_0x4b45('0x1f'))_0x5c849e[_0x4b45('0x20')]=_0x17dfa1[_0x3521ee][_0x4b45('0x1e')];if(!this[_0x4b45('0xf')][_0x4b45('0x1d')](_0x5c849e['id'])){this[_0x4b45('0xf')][_0x5c849e['id']]=new EmailImap(_0x5c849e,_0x17dfa1[_0x3521ee][_0x4b45('0x6')]);this[_0x4b45('0xf')][_0x5c849e['id']]['on'](_0x4b45('0x21'),this[_0x4b45('0x22')][_0x4b45('0x23')](this,_0x3521ee));this[_0x4b45('0xf')][_0x5c849e['id']]['on'](_0x4b45('0x6'),this['handleImapEmail'][_0x4b45('0x23')](this,_0x3521ee));this['imapAccounts'][_0x5c849e['id']]['on'](_0x4b45('0x24'),this[_0x4b45('0x25')]['bind'](this,_0x3521ee));this[_0x4b45('0xf')][_0x5c849e['id']]['on'](_0x4b45('0x26'),this[_0x4b45('0x27')][_0x4b45('0x23')](this,_0x3521ee));}}else{if(_[_0x4b45('0x28')](this[_0x4b45('0xe')][_0x3521ee][_0x4b45('0x16')])){this['mailAccounts'][_0x3521ee]['Imap']={};}this['mailAccounts'][_0x3521ee][_0x4b45('0x16')]['status']='disabled';this['mailAccounts'][_0x3521ee][_0x4b45('0x16')][_0x4b45('0x18')]='';this[_0x4b45('0x12')](_0x3521ee);}}}};EmailChannel[_0x4b45('0x11')][_0x4b45('0x22')]=function(_0x4ff4f3,_0x3b8c3d){if(this[_0x4b45('0xe')][_0x4ff4f3]){this[_0x4b45('0xe')][_0x4ff4f3][_0x4b45('0x16')][_0x4b45('0x17')]=_0x4b45('0x29');this[_0x4b45('0xe')][_0x4ff4f3][_0x4b45('0x16')][_0x4b45('0x18')]=_0x3b8c3d[_0x4b45('0x13')];if(_0x3b8c3d['messages']){this['mailAccounts'][_0x4ff4f3][_0x4b45('0x16')][_0x4b45('0x19')]=_0x3b8c3d[_0x4b45('0x2a')][_0x4b45('0x19')];}return this[_0x4b45('0x12')](_0x4ff4f3);}};EmailChannel[_0x4b45('0x11')][_0x4b45('0x2b')]=function(_0x2e693b,_0x145aba){logger[_0x4b45('0x2c')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x145aba[_0x4b45('0x2d')],_0x145aba['lastName'],_0x145aba[_0x4b45('0x2e')],_0x2e693b);if(this[_0x4b45('0xe')][_0x2e693b]){return mailAccount[_0x4b45('0x2f')](_0x2e693b,_0x145aba)[_0x4b45('0x30')](function(_0xf5e91c){if(_0xf5e91c){logger[_0x4b45('0x2c')]('Mail\x20accepted\x20from\x20routing');}})[_0x4b45('0x31')](function(_0xa6b876){logger['error']('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x4b45('0x1a')](_0xa6b876));});}};EmailChannel[_0x4b45('0x11')]['handleImapEnd']=function(_0x827396){if(this[_0x4b45('0xe')][_0x827396]&&this['mailAccounts'][_0x827396][_0x4b45('0x16')]){if(this[_0x4b45('0xf')][this[_0x4b45('0xe')][_0x827396][_0x4b45('0x16')]['id']]){delete this[_0x4b45('0xf')][this[_0x4b45('0xe')][_0x827396]['Imap']['id']];}this[_0x4b45('0xe')][_0x827396][_0x4b45('0x16')]['lastSync']=moment();this[_0x4b45('0x12')](_0x827396);}};EmailChannel[_0x4b45('0x11')]['handleImapError']=function(_0x5a05c1,_0xc6998b){if(this[_0x4b45('0xe')][_0x5a05c1]){this[_0x4b45('0xe')][_0x5a05c1][_0x4b45('0x16')][_0x4b45('0x17')]=_0x4b45('0x26');this[_0x4b45('0xe')][_0x5a05c1][_0x4b45('0x16')][_0x4b45('0x18')]=_0xc6998b;return this['emit'](_0x5a05c1);}};EmailChannel['prototype'][_0x4b45('0x32')]=function(_0x2d21bd,_0x2f288c){return this[_0x4b45('0x10')][_0x4b45('0x33')](_0x2d21bd,_0x2f288c);};EmailChannel[_0x4b45('0x11')][_0x4b45('0x34')]=function(_0x2960a0){var _0x3bd030=this;if(this[_0x4b45('0xe')][_0x2960a0['id']]){if(_[_0x4b45('0x28')](this[_0x4b45('0xe')][_0x2960a0['id']]['Smtp'])){this[_0x4b45('0xe')][_0x2960a0['id']]['Smtp']={};}this[_0x4b45('0xe')][_0x2960a0['id']][_0x4b45('0x35')][_0x4b45('0x36')]=moment();return new BPromise(function(_0x346629,_0x237ada){return _0x3bd030[_0x4b45('0x10')][_0x4b45('0x37')](_0x2960a0)[_0x4b45('0x30')](function(_0xf1099b){_0x3bd030[_0x4b45('0xe')][_0x2960a0['id']]['Smtp']['status']=_0x4b45('0x38');_0x3bd030[_0x4b45('0xe')][_0x2960a0['id']][_0x4b45('0x35')][_0x4b45('0x18')]='';_0x3bd030[_0x4b45('0x12')](_0x2960a0['id']);_0x346629(_0xf1099b);})['catch'](function(_0x2beb8e){_0x3bd030['mailAccounts'][_0x2960a0['id']]['Smtp'][_0x4b45('0x17')]='error';_0x3bd030[_0x4b45('0xe')][_0x2960a0['id']][_0x4b45('0x35')][_0x4b45('0x18')]=_0x2beb8e;_0x3bd030[_0x4b45('0x12')](_0x2960a0['id']);_0x237ada(_0x2beb8e);});});}return this[_0x4b45('0x10')][_0x4b45('0x37')](_0x2960a0);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 77a1d75..17f89bc 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 _0xd9eb=['stringify','textCode','hasOwnProperty','upperFirst','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','once','ready','handleReady','bind','end','handleEnd','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','anonymous@xcally.com','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls','required','openBox','handleOpenBox','emit','readUnseen','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchError','error','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleFetchEnd','handleCloseBox'];(function(_0x4fde1a,_0x33952a){var _0x4457a7=function(_0x1815ce){while(--_0x1815ce){_0x4fde1a['push'](_0x4fde1a['shift']());}};_0x4457a7(++_0x33952a);}(_0xd9eb,0xca));var _0xbd9e=function(_0x44d2a8,_0x337c45){_0x44d2a8=_0x44d2a8-0x0;var _0x53b4bf=_0xd9eb[_0x44d2a8];return _0x53b4bf;};'use strict';var _=require(_0xbd9e('0x0'));var util=require(_0xbd9e('0x1'));var Imap=require(_0xbd9e('0x2'));var simpleParser=require(_0xbd9e('0x3'))[_0xbd9e('0x4')];var Iconv=require(_0xbd9e('0x5'))[_0xbd9e('0x6')];var EventEmitter=require(_0xbd9e('0x7'))[_0xbd9e('0x8')];var utils=require(_0xbd9e('0x9'));var logger=require(_0xbd9e('0xa'))(_0xbd9e('0xb'));function EmailImap(_0x20c36a,_0x4ade3f){this[_0xbd9e('0xc')]=_0xbd9e('0xd');this[_0xbd9e('0xe')]=this[_0xbd9e('0xf')](_0x20c36a,_0x4ade3f);this[_0xbd9e('0x2')]=new Imap(this[_0xbd9e('0xe')]);this[_0xbd9e('0x2')][_0xbd9e('0x10')](_0xbd9e('0x11'),this[_0xbd9e('0x12')][_0xbd9e('0x13')](this));this[_0xbd9e('0x2')]['once'](_0xbd9e('0x14'),this[_0xbd9e('0x15')]['bind'](this));this[_0xbd9e('0x2')]['on']('error',this[_0xbd9e('0x16')][_0xbd9e('0x13')](this));this[_0xbd9e('0x2')][_0xbd9e('0x17')]();}util[_0xbd9e('0x18')](EmailImap,EventEmitter);EmailImap[_0xbd9e('0x19')][_0xbd9e('0xf')]=function(_0x261f51,_0x47e6a0){var _0x3c56bd={'connTimeout':_0x261f51[_0xbd9e('0x1a')]?_0x261f51[_0xbd9e('0x1a')]*0x3e8:0x2710,'authTimeout':_0x261f51[_0xbd9e('0x1b')]?_0x261f51[_0xbd9e('0x1b')]*0x3e8:0x1388};if(_0x261f51[_0xbd9e('0x1c')]){_0x3c56bd[_0xbd9e('0x1d')]=_0x261f51[_0xbd9e('0x1d')];_0x3c56bd[_0xbd9e('0xb')]=_0x47e6a0||_0x261f51[_0xbd9e('0x1d')]||_0xbd9e('0x1e');if(_0x261f51['modernAuthentication']){_0x3c56bd[_0xbd9e('0x1f')]=utils[_0xbd9e('0x20')](_0x261f51[_0xbd9e('0x21')][_0xbd9e('0x22')],_0x261f51[_0xbd9e('0x1d')]);}else{_0x3c56bd['password']=_0x261f51[_0xbd9e('0x23')];}}else{if(_0x261f51[_0xbd9e('0x24')]){_0x3c56bd[_0xbd9e('0x1d')]=_0x261f51[_0xbd9e('0x1d')];_0x3c56bd[_0xbd9e('0x23')]=_0x261f51['password'];}}_0x3c56bd[_0xbd9e('0x25')]=_0x261f51['host'];_0x3c56bd['port']=_0x261f51[_0xbd9e('0x26')]||0x3e1;if(_0x261f51[_0xbd9e('0x27')]){_0x3c56bd[_0xbd9e('0x27')]=!![];}else{_0x3c56bd[_0xbd9e('0x27')]=![];_0x3c56bd['autotls']=_0xbd9e('0x28');}return _0x3c56bd;};EmailImap[_0xbd9e('0x19')]['handleReady']=function(){this['imap'][_0xbd9e('0x29')](this[_0xbd9e('0xc')],![],this[_0xbd9e('0x2a')][_0xbd9e('0x13')](this));};EmailImap['prototype']['handleOpenBox']=function(_0x5d82ff,_0x3031af){if(_0x5d82ff){this['handleError'](_0x5d82ff,!![]);}else{this[_0xbd9e('0x2b')]('box',_0x3031af);this[_0xbd9e('0x2c')]();}};EmailImap[_0xbd9e('0x19')]['handleCloseBox']=function(_0x469153){if(_0x469153){this[_0xbd9e('0x16')](_0x469153,!![]);}else{this[_0xbd9e('0x2')][_0xbd9e('0x14')]();}};EmailImap[_0xbd9e('0x19')][_0xbd9e('0x2c')]=function(){this[_0xbd9e('0x2')]['search']([_0xbd9e('0x2d')],this['handleReadUnseen'][_0xbd9e('0x13')](this));};EmailImap['prototype'][_0xbd9e('0x2e')]=function(_0x4289aa,_0x5485ec){if(_0x4289aa){this[_0xbd9e('0x16')](_0x4289aa,!![]);}else{if(_0x5485ec[_0xbd9e('0x2f')]){try{var _0x47efbe=this[_0xbd9e('0x2')][_0xbd9e('0x30')](_0x5485ec,{'bodies':'','markSeen':!![]});_0x47efbe['on']('message',this[_0xbd9e('0x31')][_0xbd9e('0x13')](this));_0x47efbe[_0xbd9e('0x10')]('error',this[_0xbd9e('0x32')][_0xbd9e('0x13')](this));_0x47efbe[_0xbd9e('0x10')](_0xbd9e('0x14'),this['handleFetchEnd']['bind'](this));}catch(_0x55b09e){logger[_0xbd9e('0x33')](_0x55b09e);}}else{this['imap'][_0xbd9e('0x34')](!![],this['handleCloseBox']['bind'](this));}}};EmailImap[_0xbd9e('0x19')]['handleFetchMessage']=function(_0x360784){_0x360784['on'](_0xbd9e('0x35'),this[_0xbd9e('0x36')][_0xbd9e('0x13')](this));_0x360784[_0xbd9e('0x10')](_0xbd9e('0x37'),this['handleMessageAttributes'][_0xbd9e('0x13')](this));_0x360784['once'](_0xbd9e('0x14'),this['handleMessageEnd']['bind'](this));};EmailImap['prototype'][_0xbd9e('0x36')]=function(_0x4859e7){simpleParser(_0x4859e7,{'Iconv':Iconv},this['handleSimpleParser'][_0xbd9e('0x13')](this));};EmailImap['prototype'][_0xbd9e('0x38')]=function(){};EmailImap['prototype'][_0xbd9e('0x39')]=function(){};EmailImap[_0xbd9e('0x19')][_0xbd9e('0x3a')]=function(_0x2b86a3,_0xa47f29){if(_0x2b86a3){logger['error'](_0x2b86a3);}else{var _0x2d4ad0=this;utils[_0xbd9e('0x3b')](this['account'],_0xa47f29,function(_0x24eb19){_0x2d4ad0[_0xbd9e('0x2b')](_0xbd9e('0xb'),_0x24eb19);});}};EmailImap[_0xbd9e('0x19')][_0xbd9e('0x3c')]=function(){this['imap'][_0xbd9e('0x34')](!![],this[_0xbd9e('0x3d')][_0xbd9e('0x13')](this));};EmailImap[_0xbd9e('0x19')][_0xbd9e('0x32')]=function(_0x221182){this['handleError'](_0x221182);this[_0xbd9e('0x2')][_0xbd9e('0x34')](!![],this[_0xbd9e('0x3d')]['bind'](this));};EmailImap[_0xbd9e('0x19')][_0xbd9e('0x15')]=function(){this['emit']('end');};EmailImap['prototype'][_0xbd9e('0x16')]=function(_0xb4e570,_0x547885){logger[_0xbd9e('0x33')](_0xbd9e('0x16'),this[_0xbd9e('0xe')][_0xbd9e('0xb')],JSON[_0xbd9e('0x3e')](_0xb4e570));var _0x45d9fc='';if(_0xb4e570){if(_0xb4e570[_0xbd9e('0x3f')]){_0x45d9fc=_0xb4e570[_0xbd9e('0x3f')];}else{for(var _0x47b980 in _0xb4e570){if(_0xb4e570[_0xbd9e('0x40')](_0x47b980)){_0x45d9fc+=_[_0xbd9e('0x41')](_0x47b980)+':\x20'+_0xb4e570[_0x47b980]+'\x0a';}}}}if(_0x547885){this[_0xbd9e('0x2')][_0xbd9e('0x14')]();}else{this['emit']('error',_0x45d9fc);this[_0xbd9e('0x2b')](_0xbd9e('0x14'));}};module['exports']=EmailImap; \ No newline at end of file +var _0x7046=['handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','handleMessageAttributes','account','stringify','hasOwnProperty','exports','lodash','util','imap','mailparser','iconv','Iconv','events','./utils','../../../config/logger','email','INBOX','once','ready','handleReady','bind','end','handleEnd','error','connect','inherits','prototype','getAccount','connTimeout','authTimeout','user','anonymous@xcally.com','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls','autotls','required','mailbox','handleOpenBox','handleError','emit','box','readUnseen','handleCloseBox','search','UNSEEN','length','message'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7046,0x144));var _0x6704=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x7046[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var Imap=require(_0x6704('0x2'));var simpleParser=require(_0x6704('0x3'))['simpleParser'];var Iconv=require(_0x6704('0x4'))[_0x6704('0x5')];var EventEmitter=require(_0x6704('0x6'))['EventEmitter'];var utils=require(_0x6704('0x7'));var logger=require(_0x6704('0x8'))(_0x6704('0x9'));function EmailImap(_0x626a14,_0x2917be){this['mailbox']=_0x6704('0xa');this['account']=this['getAccount'](_0x626a14,_0x2917be);this[_0x6704('0x2')]=new Imap(this['account']);this['imap'][_0x6704('0xb')](_0x6704('0xc'),this[_0x6704('0xd')][_0x6704('0xe')](this));this[_0x6704('0x2')][_0x6704('0xb')](_0x6704('0xf'),this[_0x6704('0x10')]['bind'](this));this[_0x6704('0x2')]['on'](_0x6704('0x11'),this['handleError'][_0x6704('0xe')](this));this[_0x6704('0x2')][_0x6704('0x12')]();}util[_0x6704('0x13')](EmailImap,EventEmitter);EmailImap[_0x6704('0x14')][_0x6704('0x15')]=function(_0x17b9bc,_0x2da4df){var _0x24ece3={'connTimeout':_0x17b9bc['connTimeout']?_0x17b9bc[_0x6704('0x16')]*0x3e8:0x2710,'authTimeout':_0x17b9bc[_0x6704('0x17')]?_0x17b9bc[_0x6704('0x17')]*0x3e8:0x1388};if(_0x17b9bc['service']){_0x24ece3[_0x6704('0x18')]=_0x17b9bc[_0x6704('0x18')];_0x24ece3[_0x6704('0x9')]=_0x2da4df||_0x17b9bc[_0x6704('0x18')]||_0x6704('0x19');if(_0x17b9bc['modernAuthentication']){_0x24ece3[_0x6704('0x1a')]=utils[_0x6704('0x1b')](_0x17b9bc[_0x6704('0x1c')][_0x6704('0x1d')],_0x17b9bc[_0x6704('0x18')]);}else{_0x24ece3['password']=_0x17b9bc[_0x6704('0x1e')];}}else{if(_0x17b9bc[_0x6704('0x1f')]){_0x24ece3[_0x6704('0x18')]=_0x17b9bc[_0x6704('0x18')];_0x24ece3[_0x6704('0x1e')]=_0x17b9bc[_0x6704('0x1e')];}}_0x24ece3[_0x6704('0x20')]=_0x17b9bc['host'];_0x24ece3[_0x6704('0x21')]=_0x17b9bc[_0x6704('0x21')]||0x3e1;if(_0x17b9bc[_0x6704('0x22')]){_0x24ece3['tls']=!![];}else{_0x24ece3['tls']=![];_0x24ece3[_0x6704('0x23')]=_0x6704('0x24');}return _0x24ece3;};EmailImap[_0x6704('0x14')][_0x6704('0xd')]=function(){this[_0x6704('0x2')]['openBox'](this[_0x6704('0x25')],![],this[_0x6704('0x26')][_0x6704('0xe')](this));};EmailImap[_0x6704('0x14')][_0x6704('0x26')]=function(_0x2476d6,_0x2acafd){if(_0x2476d6){this[_0x6704('0x27')](_0x2476d6,!![]);}else{this[_0x6704('0x28')](_0x6704('0x29'),_0x2acafd);this[_0x6704('0x2a')]();}};EmailImap[_0x6704('0x14')][_0x6704('0x2b')]=function(_0x4979ec){if(_0x4979ec){this['handleError'](_0x4979ec,!![]);}else{this[_0x6704('0x2')][_0x6704('0xf')]();}};EmailImap[_0x6704('0x14')][_0x6704('0x2a')]=function(){this['imap'][_0x6704('0x2c')]([_0x6704('0x2d')],this['handleReadUnseen']['bind'](this));};EmailImap[_0x6704('0x14')]['handleReadUnseen']=function(_0x812ba2,_0x5c7e10){if(_0x812ba2){this['handleError'](_0x812ba2,!![]);}else{if(_0x5c7e10[_0x6704('0x2e')]){try{var _0x115514=this[_0x6704('0x2')]['fetch'](_0x5c7e10,{'bodies':'','markSeen':!![]});_0x115514['on'](_0x6704('0x2f'),this[_0x6704('0x30')][_0x6704('0xe')](this));_0x115514[_0x6704('0xb')](_0x6704('0x11'),this[_0x6704('0x31')][_0x6704('0xe')](this));_0x115514[_0x6704('0xb')](_0x6704('0xf'),this[_0x6704('0x32')][_0x6704('0xe')](this));}catch(_0x454885){logger[_0x6704('0x11')](_0x454885);}}else{this[_0x6704('0x2')][_0x6704('0x33')](!![],this[_0x6704('0x2b')][_0x6704('0xe')](this));}}};EmailImap[_0x6704('0x14')][_0x6704('0x30')]=function(_0x25fac5){_0x25fac5['on'](_0x6704('0x34'),this[_0x6704('0x35')][_0x6704('0xe')](this));_0x25fac5[_0x6704('0xb')](_0x6704('0x36'),this['handleMessageAttributes']['bind'](this));_0x25fac5['once'](_0x6704('0xf'),this[_0x6704('0x37')][_0x6704('0xe')](this));};EmailImap['prototype'][_0x6704('0x35')]=function(_0x5ecbee){simpleParser(_0x5ecbee,{'Iconv':Iconv},this[_0x6704('0x38')][_0x6704('0xe')](this));};EmailImap[_0x6704('0x14')][_0x6704('0x39')]=function(){};EmailImap[_0x6704('0x14')][_0x6704('0x37')]=function(){};EmailImap[_0x6704('0x14')][_0x6704('0x38')]=function(_0x590ada,_0x553d13){if(_0x590ada){logger[_0x6704('0x11')](_0x590ada);}else{var _0x38b36f=this;utils['parser'](this['account'],_0x553d13,function(_0x3a94ee){_0x38b36f['emit'](_0x6704('0x9'),_0x3a94ee);});}};EmailImap[_0x6704('0x14')][_0x6704('0x32')]=function(){this[_0x6704('0x2')]['closeBox'](!![],this[_0x6704('0x2b')][_0x6704('0xe')](this));};EmailImap['prototype'][_0x6704('0x31')]=function(_0x4b050f){this[_0x6704('0x27')](_0x4b050f);this[_0x6704('0x2')][_0x6704('0x33')](!![],this['handleCloseBox'][_0x6704('0xe')](this));};EmailImap[_0x6704('0x14')][_0x6704('0x10')]=function(){this['emit'](_0x6704('0xf'));};EmailImap[_0x6704('0x14')][_0x6704('0x27')]=function(_0xf12c3f,_0x5a7dea){logger[_0x6704('0x11')]('handleError',this[_0x6704('0x3a')][_0x6704('0x9')],JSON[_0x6704('0x3b')](_0xf12c3f));var _0x13c233='';if(_0xf12c3f){if(_0xf12c3f['textCode']){_0x13c233=_0xf12c3f['textCode'];}else{for(var _0x4daf13 in _0xf12c3f){if(_0xf12c3f[_0x6704('0x3c')](_0x4daf13)){_0x13c233+=_['upperFirst'](_0x4daf13)+':\x20'+_0xf12c3f[_0x4daf13]+'\x0a';}}}}if(_0x5a7dea){this[_0x6704('0x2')]['end']();}else{this[_0x6704('0x28')](_0x6704('0x11'),_0x13c233);this['emit'](_0x6704('0xf'));}};module[_0x6704('0x3d')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index f010a4e..71fdbf0 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 _0x09f5=['toString','Not\x20verifired','exports','nodemailer','prototype','send','createTransport','use','compile','sendMail'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x09f5,0x1ed));var _0x509f=function(_0x424800,_0x173bce){_0x424800=_0x424800-0x0;var _0x13e2f4=_0x09f5[_0x424800];return _0x13e2f4;};'use strict';var nodemailer=require(_0x509f('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x509f('0x1')][_0x509f('0x2')]=function(_0x30700c,_0x4a3ea6){return new Promise(function(_0x326a66,_0x139b75){var _0x434914=nodemailer[_0x509f('0x3')](_0x30700c);_0x434914[_0x509f('0x4')](_0x509f('0x5'),inlineBase64());_0x434914[_0x509f('0x6')](_0x4a3ea6,function(_0x21fbf0,_0x37a01c){if(_0x21fbf0){_0x139b75(_0x21fbf0[_0x509f('0x7')]());}else{_0x326a66(_0x37a01c);}});});};EmailSmtp['prototype']['verify']=function(_0x55d73b){return new Promise(function(_0xf8860d,_0x54f76c){var _0x1bfa07=nodemailer[_0x509f('0x3')](_0x55d73b);_0x1bfa07['verify'](function(_0x157591,_0x4127dc){if(_0x157591){_0x54f76c(_0x157591[_0x509f('0x7')]());}else{if(_0x4127dc){_0xf8860d(_0x4127dc);}else{_0x54f76c(_0x509f('0x8'));}}});});};module[_0x509f('0x9')]=EmailSmtp; \ No newline at end of file +var _0x619e=['exports','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','toString','verify','Not\x20verifired'];(function(_0xdf6ab9,_0x17eac1){var _0x284ec5=function(_0x1703a9){while(--_0x1703a9){_0xdf6ab9['push'](_0xdf6ab9['shift']());}};_0x284ec5(++_0x17eac1);}(_0x619e,0x191));var _0xe619=function(_0xecab6a,_0x3c768a){_0xecab6a=_0xecab6a-0x0;var _0x40b98b=_0x619e[_0xecab6a];return _0x40b98b;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0xe619('0x0'));function EmailSmtp(){}EmailSmtp[_0xe619('0x1')][_0xe619('0x2')]=function(_0x35a05b,_0x27bd0b){return new Promise(function(_0x32614b,_0x2e0b0c){var _0x419ac9=nodemailer[_0xe619('0x3')](_0x35a05b);_0x419ac9[_0xe619('0x4')](_0xe619('0x5'),inlineBase64());_0x419ac9['sendMail'](_0x27bd0b,function(_0x39b74d,_0x8b52dd){if(_0x39b74d){_0x2e0b0c(_0x39b74d[_0xe619('0x6')]());}else{_0x32614b(_0x8b52dd);}});});};EmailSmtp[_0xe619('0x1')]['verify']=function(_0x391847){return new Promise(function(_0x12c6b5,_0x1614c7){var _0x22df34=nodemailer['createTransport'](_0x391847);_0x22df34[_0xe619('0x7')](function(_0x517f72,_0xec8d6f){if(_0x517f72){_0x1614c7(_0x517f72['toString']());}else{if(_0xec8d6f){_0x12c6b5(_0xec8d6f);}else{_0x1614c7(_0xe619('0x8'));}}});});};module[_0xe619('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index c189e33..e1df5eb 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 _0xdb7c=['Title','Data','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','anonymous','generate','@xcally.com','name','address','substring','indexOf','split','length','slice','Anonymous','value','pop','html','test','includes','\x20[Attachment:\x20','body','textAsHtml','Empty\x20message

','Attachments'];(function(_0x911fe2,_0x1f3d34){var _0x8b0826=function(_0x35290a){while(--_0x35290a){_0x911fe2['push'](_0x911fe2['shift']());}};_0x8b0826(++_0x1f3d34);}(_0xdb7c,0x1d5));var _0xcdb7=function(_0x5f0f7a,_0x244c53){_0x5f0f7a=_0x5f0f7a-0x0;var _0x8742e7=_0xdb7c[_0x5f0f7a];return _0x8742e7;};'use strict';var _=require(_0xcdb7('0x0'));var moment=require(_0xcdb7('0x1'));var random=require(_0xcdb7('0x2'));var fs=require('fs');var path=require(_0xcdb7('0x3'));var util=require(_0xcdb7('0x4'));var tnef=require(_0xcdb7('0x5'));var logger=require(_0xcdb7('0x6'))(_0xcdb7('0x7'));var config=require(_0xcdb7('0x8'));function getAddress(_0x58811d){var _0x343831=_[_0xcdb7('0x9')](_0x58811d['value']);return _0x343831&&_0x343831['address']?_0x343831['address']:_0xcdb7('0xa')+random[_0xcdb7('0xb')](0x6)+_0xcdb7('0xc');}function getFirstName(_0x58ffff){var _0x6fefca=_[_0xcdb7('0x9')](_0x58ffff['value']);if(_0x6fefca&&_0x6fefca[_0xcdb7('0xd')]){if(_0x6fefca[_0xcdb7('0xd')]==_0x6fefca[_0xcdb7('0xe')]){return _0x6fefca['name'][_0xcdb7('0xf')](0x0,_0x6fefca[_0xcdb7('0xd')][_0xcdb7('0x10')]('@'));}var _0x5143dd=_0x6fefca[_0xcdb7('0xd')][_0xcdb7('0x11')](/\s+/);return _0x5143dd[_0xcdb7('0x12')]>0x1?_0x5143dd[_0xcdb7('0x13')](0x0,-0x1)['join']('\x20'):_0x6fefca[_0xcdb7('0xd')];}return _0xcdb7('0x14');}function getLastName(_0x3d0453){var _0x51adb1=_[_0xcdb7('0x9')](_0x3d0453[_0xcdb7('0x15')]);if(_0x51adb1&&_0x51adb1[_0xcdb7('0xd')]){var _0x34fa0f=_0x51adb1['name']['split'](/\s+/);return _0x34fa0f['length']>0x1?_0x34fa0f[_0xcdb7('0x16')]():'';}return'';}function getMails(_0x34136e,_0x2ec455){var _0xc24744='';for(var _0x3e2fe8=0x0;_0x3e2fe8<_0x2ec455[_0xcdb7('0x15')]['length'];_0x3e2fe8+=0x1){if(_0x2ec455['value'][_0x3e2fe8][_0xcdb7('0xe')]!==_0x34136e){if(!_['isEmpty'](_0xc24744)){_0xc24744+=',';}_0xc24744+=_0x2ec455[_0xcdb7('0x15')][_0x3e2fe8][_0xcdb7('0xd')]||_0x2ec455[_0xcdb7('0x15')][_0x3e2fe8][_0xcdb7('0xe')]||'';_0xc24744+='\x20<';_0xc24744+=_0x2ec455[_0xcdb7('0x15')][_0x3e2fe8][_0xcdb7('0xe')]?_0x2ec455[_0xcdb7('0x15')][_0x3e2fe8]['address']:_0xcdb7('0xa')+random[_0xcdb7('0xb')](0x6)+_0xcdb7('0xc');_0xc24744+='>';}}return _0xc24744;}function parseEmail(_0x33134a,_0x34c71d,_0x22b07d){if(_0x34c71d[_0xcdb7('0x17')]){var _0x2e3443=/)<[^<]*)*<\/script>/gi;while(_0x2e3443[_0xcdb7('0x18')](_0x34c71d['html'])){_0x34c71d[_0xcdb7('0x17')]=_0x34c71d['html']['replace'](_0x2e3443,'');}if(_0x34c71d['html'][_0xcdb7('0x19')](_0xcdb7('0x1a'))){var _0x43ae90=[];_0x34c71d[_0xcdb7('0x1b')][_0xcdb7('0x1c')](_0x5d8d55=>{_0x43ae90[_0xcdb7('0x1d')](_0x5d8d55['filename']);});var _0xc3c220=/]+>/g;var _0x2bacc0=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x4eda99=_0x34c71d[_0xcdb7('0x17')][_0xcdb7('0x1e')](_0x2bacc0,'_SRC');var _0x22774c=_0x4eda99[_0xcdb7('0x1e')](_0xc3c220,_0xcdb7('0x1f'));for(let _0x10a43b=0x0;_0x10a43b<_0x43ae90[_0xcdb7('0x12')];_0x10a43b++){var _0x2b9aad=_0x22774c[_0xcdb7('0x1e')](_0xcdb7('0x1f'),_0xcdb7('0x20')+_0x43ae90[_0x10a43b]+'\x20]');_0x22774c=_0x2b9aad;}_0x34c71d[_0xcdb7('0x17')]=_0x22774c;}_0x22b07d[_0xcdb7('0x21')]=_0x34c71d['html'];}else{_0x22b07d[_0xcdb7('0x21')]=_0x34c71d[_0xcdb7('0x22')];}if(_0x22b07d[_0xcdb7('0x21')]){_0x22b07d[_0xcdb7('0x21')]=_0x22b07d[_0xcdb7('0x21')][_0xcdb7('0x1e')](/0x0){var _0x544ba1=['Auto-Submitted:\x20auto-replied',_0xcdb7('0x33'),_0xcdb7('0x34')];for(var _0x929b9f=0x0;_0x929b9f<_0x34c71d[_0xcdb7('0x32')][_0xcdb7('0x12')];_0x929b9f++){var _0x189857=_['indexOf'](_0x544ba1,_0x34c71d[_0xcdb7('0x32')][_0x929b9f][_0xcdb7('0x35')]);if(_0x189857>=0x0){_0x22b07d[_0xcdb7('0x36')]=!![];}}}return _0x22b07d;}exports[_0xcdb7('0x37')]=function(_0xb44c68,_0x4a67a7,_0x5ea4d8){var _0x4ff5f1={'from':getAddress(_0x4a67a7[_0xcdb7('0x38')]),'firstName':getFirstName(_0x4a67a7[_0xcdb7('0x38')]),'lastName':getLastName(_0x4a67a7[_0xcdb7('0x38')]),'mapKey':'email','message':{'from':getMails(_0xb44c68[_0xcdb7('0x7')],_0x4a67a7[_0xcdb7('0x38')]),'to':_0xb44c68[_0xcdb7('0x7')],'cc':'','subject':_0x4a67a7['subject']||'','messageId':_0x4a67a7[_0xcdb7('0x39')],'inReplyTo':_0x4a67a7[_0xcdb7('0x3a')],'sentAt':moment(_0x4a67a7[_0xcdb7('0x3b')])[_0xcdb7('0x2e')](_0xcdb7('0x3c')),'attach':![],'attachments':[]}};if(!_0x4a67a7['html']&&!_0x4a67a7[_0xcdb7('0x22')]){var _0x580787=_[_0xcdb7('0x3d')](_0x4a67a7[_0xcdb7('0x1b')],{'contentType':_0xcdb7('0x3e')});if(_0x580787[_0xcdb7('0x12')]){logger[_0xcdb7('0x3f')](util['format'](_0xcdb7('0x40'),_0x4a67a7[_0xcdb7('0x39')]));tnef[_0xcdb7('0x41')](_[_0xcdb7('0x42')](_0x580787)[_0xcdb7('0x43')],function(_0x32f501,_0x52187a){if(_0x52187a){_0x4a67a7[_0xcdb7('0x17')]=_0x52187a['BodyHTML']||_0xcdb7('0x44');if(_0x52187a[_0xcdb7('0x45')]){for(var _0x2ba954=0x0;_0x2ba954<_0x52187a['Attachments'][_0xcdb7('0x12')];_0x2ba954++){var _0x4aca45=_0x52187a[_0xcdb7('0x45')][_0x2ba954];_0x4ff5f1[_0xcdb7('0x24')][_0xcdb7('0x1b')][_0xcdb7('0x1d')]({'filename':_0x4aca45[_0xcdb7('0x46')],'content':Buffer[_0xcdb7('0x38')](_0x4aca45[_0xcdb7('0x47')])});}}}_0x5ea4d8(parseEmail(_0xb44c68,_0x4a67a7,_0x4ff5f1));});}else{_0x4a67a7['html']=_0xcdb7('0x44');_0x5ea4d8(parseEmail(_0xb44c68,_0x4a67a7,_0x4ff5f1));}}else{_0x5ea4d8(parseEmail(_0xb44c68,_0x4a67a7,_0x4ff5f1));}};exports['generateXOAuth2Token']=function(_0x39c520,_0x98865a){var _0x5bf97c=[_0xcdb7('0x48')+(_0x98865a||''),_0xcdb7('0x49')+_0x39c520,'',''];return Buffer[_0xcdb7('0x38')](_0x5bf97c[_0xcdb7('0x2f')](''),_0xcdb7('0x4a'))[_0xcdb7('0x4b')](_0xcdb7('0x4c'));}; \ No newline at end of file +var _0xee37=['parser','from','messageId','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','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Title','user=','auth=Bearer\x20','utf-8','base64','lodash','randomstring','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','anonymous','generate','@xcally.com','name','address','split','length','slice','join','pop','html','replace','0x1?_0x5f1ac1[_0x7ee3('0x10')](0x0,-0x1)[_0x7ee3('0x11')]('\x20'):_0x32a71d[_0x7ee3('0xc')];}return'Anonymous';}function getLastName(_0x572e3f){var _0x571271=_[_0x7ee3('0x7')](_0x572e3f['value']);if(_0x571271&&_0x571271[_0x7ee3('0xc')]){var _0x39f200=_0x571271[_0x7ee3('0xc')][_0x7ee3('0xe')](/\s+/);return _0x39f200[_0x7ee3('0xf')]>0x1?_0x39f200[_0x7ee3('0x12')]():'';}return'';}function getMails(_0x367636,_0xd85645){var _0x1730b3='';for(var _0x5201bd=0x0;_0x5201bd<_0xd85645[_0x7ee3('0x8')][_0x7ee3('0xf')];_0x5201bd+=0x1){if(_0xd85645['value'][_0x5201bd]['address']!==_0x367636){if(!_['isEmpty'](_0x1730b3)){_0x1730b3+=',';}_0x1730b3+=_0xd85645[_0x7ee3('0x8')][_0x5201bd]['name']||_0xd85645[_0x7ee3('0x8')][_0x5201bd][_0x7ee3('0xd')]||'';_0x1730b3+='\x20<';_0x1730b3+=_0xd85645[_0x7ee3('0x8')][_0x5201bd][_0x7ee3('0xd')]?_0xd85645[_0x7ee3('0x8')][_0x5201bd][_0x7ee3('0xd')]:_0x7ee3('0x9')+random[_0x7ee3('0xa')](0x6)+_0x7ee3('0xb');_0x1730b3+='>';}}return _0x1730b3;}function parseEmail(_0x622bc9,_0x3f1a7a,_0x4cf09e){if(_0x3f1a7a[_0x7ee3('0x13')]){var _0x1ff3d5=/)<[^<]*)*<\/script>/gi;while(_0x1ff3d5['test'](_0x3f1a7a[_0x7ee3('0x13')])){_0x3f1a7a[_0x7ee3('0x13')]=_0x3f1a7a['html'][_0x7ee3('0x14')](_0x1ff3d5,'');}if(_0x3f1a7a['html']['includes'](_0x7ee3('0x15'))){var _0x65deea=[];_0x3f1a7a['attachments']['forEach'](_0x2fc37f=>{_0x65deea[_0x7ee3('0x16')](_0x2fc37f[_0x7ee3('0x17')]);});var _0x4e6d86=/]+>/g;var _0x1b6dcd=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0xa028cc=_0x3f1a7a[_0x7ee3('0x13')]['replace'](_0x1b6dcd,_0x7ee3('0x18'));var _0x5a3097=_0xa028cc[_0x7ee3('0x14')](_0x4e6d86,'_IMG');for(let _0x9f22c2=0x0;_0x9f22c2<_0x65deea['length'];_0x9f22c2++){var _0x3b0a09=_0x5a3097[_0x7ee3('0x14')](_0x7ee3('0x19'),'\x20[Attachment:\x20'+_0x65deea[_0x9f22c2]+'\x20]');_0x5a3097=_0x3b0a09;}_0x3f1a7a[_0x7ee3('0x13')]=_0x5a3097;}_0x4cf09e[_0x7ee3('0x1a')]=_0x3f1a7a['html'];}else{_0x4cf09e[_0x7ee3('0x1a')]=_0x3f1a7a[_0x7ee3('0x1b')];}if(_0x4cf09e[_0x7ee3('0x1a')]){_0x4cf09e[_0x7ee3('0x1a')]=_0x4cf09e[_0x7ee3('0x1a')][_0x7ee3('0x14')](/0x0){var _0x25d5f1=[_0x7ee3('0x2e'),_0x7ee3('0x2f'),_0x7ee3('0x30')];for(var _0xdb4ed7=0x0;_0xdb4ed7<_0x3f1a7a[_0x7ee3('0x2d')][_0x7ee3('0xf')];_0xdb4ed7++){var _0x48431c=_[_0x7ee3('0x31')](_0x25d5f1,_0x3f1a7a['headerLines'][_0xdb4ed7][_0x7ee3('0x32')]);if(_0x48431c>=0x0){_0x4cf09e['isAutoreply']=!![];}}}return _0x4cf09e;}exports[_0x7ee3('0x33')]=function(_0x2d0e89,_0x5713ab,_0x16a5fe){var _0x34a1d3={'from':getAddress(_0x5713ab[_0x7ee3('0x34')]),'firstName':getFirstName(_0x5713ab[_0x7ee3('0x34')]),'lastName':getLastName(_0x5713ab['from']),'mapKey':_0x7ee3('0x5'),'message':{'from':getMails(_0x2d0e89[_0x7ee3('0x5')],_0x5713ab[_0x7ee3('0x34')]),'to':_0x2d0e89[_0x7ee3('0x5')],'cc':'','subject':_0x5713ab['subject']||'','messageId':_0x5713ab[_0x7ee3('0x35')],'inReplyTo':_0x5713ab['inReplyTo'],'sentAt':moment(_0x5713ab[_0x7ee3('0x36')])[_0x7ee3('0x26')](_0x7ee3('0x37')),'attach':![],'attachments':[]}};if(!_0x5713ab[_0x7ee3('0x13')]&&!_0x5713ab[_0x7ee3('0x1b')]){var _0x7b8e68=_[_0x7ee3('0x38')](_0x5713ab[_0x7ee3('0x22')],{'contentType':_0x7ee3('0x39')});if(_0x7b8e68[_0x7ee3('0xf')]){logger[_0x7ee3('0x3a')](util[_0x7ee3('0x26')](_0x7ee3('0x3b'),_0x5713ab[_0x7ee3('0x35')]));tnef[_0x7ee3('0x3c')](_[_0x7ee3('0x3d')](_0x7b8e68)[_0x7ee3('0x2b')],function(_0x581697,_0x49f236){if(_0x49f236){_0x5713ab['html']=_0x49f236[_0x7ee3('0x3e')]||_0x7ee3('0x3f');if(_0x49f236[_0x7ee3('0x40')]){for(var _0x2d72ea=0x0;_0x2d72ea<_0x49f236[_0x7ee3('0x40')][_0x7ee3('0xf')];_0x2d72ea++){var _0x40b3c9=_0x49f236[_0x7ee3('0x40')][_0x2d72ea];_0x34a1d3[_0x7ee3('0x1e')][_0x7ee3('0x22')]['push']({'filename':_0x40b3c9[_0x7ee3('0x41')],'content':Buffer[_0x7ee3('0x34')](_0x40b3c9['Data'])});}}}_0x16a5fe(parseEmail(_0x2d0e89,_0x5713ab,_0x34a1d3));});}else{_0x5713ab[_0x7ee3('0x13')]='

Empty\x20message

';_0x16a5fe(parseEmail(_0x2d0e89,_0x5713ab,_0x34a1d3));}}else{_0x16a5fe(parseEmail(_0x2d0e89,_0x5713ab,_0x34a1d3));}};exports['generateXOAuth2Token']=function(_0x2ee193,_0x348d6e){var _0x9a59d9=[_0x7ee3('0x42')+(_0x348d6e||''),_0x7ee3('0x43')+_0x2ee193,'',''];return Buffer[_0x7ee3('0x34')](_0x9a59d9['join'](''),_0x7ee3('0x44'))['toString'](_0x7ee3('0x45'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index b924208..b5161c4 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 _0x4d10=['Service','key','SERV','active','Imap','Smtp','exports','lodash','name'];(function(_0x26e0d8,_0x265cfa){var _0x387dd8=function(_0x312a72){while(--_0x312a72){_0x26e0d8['push'](_0x26e0d8['shift']());}};_0x387dd8(++_0x265cfa);}(_0x4d10,0xc4));var _0x04d1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4d10[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x04d1('0x0'));function MailAccount(_0x3ba266){this['id']=_0x3ba266['id']||0x0;this[_0x04d1('0x1')]=_0x3ba266[_0x04d1('0x1')]||_0x04d1('0x2');this[_0x04d1('0x3')]=_0x3ba266['key']||_0x04d1('0x4');this[_0x04d1('0x5')]=_0x3ba266[_0x04d1('0x5')]||![];this[_0x04d1('0x6')]=_0x3ba266[_0x04d1('0x6')]||[];this[_0x04d1('0x7')]=_0x3ba266[_0x04d1('0x7')]||[];}module[_0x04d1('0x8')]=MailAccount; \ No newline at end of file +var _0x986d=['lodash','name','Service','key','active','Smtp','exports'];(function(_0x17b7ab,_0x3ab458){var _0x2615e8=function(_0x332feb){while(--_0x332feb){_0x17b7ab['push'](_0x17b7ab['shift']());}};_0x2615e8(++_0x3ab458);}(_0x986d,0xa8));var _0xd986=function(_0xccb859,_0x7fc57e){_0xccb859=_0xccb859-0x0;var _0x5346dc=_0x986d[_0xccb859];return _0x5346dc;};'use strict';var _=require(_0xd986('0x0'));function MailAccount(_0x401f4f){this['id']=_0x401f4f['id']||0x0;this['name']=_0x401f4f[_0xd986('0x1')]||_0xd986('0x2');this[_0xd986('0x3')]=_0x401f4f[_0xd986('0x3')]||'SERV';this[_0xd986('0x4')]=_0x401f4f[_0xd986('0x4')]||![];this['Imap']=_0x401f4f['Imap']||[];this[_0xd986('0x5')]=_0x401f4f[_0xd986('0x5')]||[];}module[_0xd986('0x6')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 60cc0ef..aee638c 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 _0x9537=['mailAccounts','mapKeys','hasOwnProperty','prototype','initMailAccounts','length','isUndefined','merge','exports','../model/mailAccount'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9537,0xc7));var _0x7953=function(_0x5cc247,_0x1c0981){_0x5cc247=_0x5cc247-0x0;var _0x3a09ff=_0x9537[_0x5cc247];return _0x3a09ff;};'use strict';var _=require('lodash');var MailAccount=require(_0x7953('0x0'));var Realtime=function(){this[_0x7953('0x1')]={};};function freeIsNotKey(_0x4cc84c,_0x4c6fdc,_0x381b4a){var _0x5a5f32=_[_0x7953('0x2')](_0x4cc84c,function(_0x3bb7d5,_0x4d63c9){return _0x3bb7d5[_0x381b4a];});for(var _0x3acea9 in _0x4c6fdc){if(_0x4c6fdc[_0x7953('0x3')](_0x3acea9)){if(!_0x5a5f32[_0x3acea9]){delete _0x4c6fdc[_0x3acea9];}}}}Realtime[_0x7953('0x4')]['mergeFromDatabase']=function(_0x134a5b,_0x345607){for(var _0x4de37a in _0x345607){if(_0x134a5b[_0x7953('0x3')](_0x4de37a)){_0x134a5b[_0x4de37a]=_0x345607[_0x4de37a];}}};Realtime[_0x7953('0x4')][_0x7953('0x5')]=function(){var _0x3d4e8e=this;return function(_0x3cbe83){if(_0x3cbe83){freeIsNotKey(_0x3cbe83,_0x3d4e8e[_0x7953('0x1')],'id');for(var _0x49dfad=0x0,_0x385cb1={},_0x48d080={};_0x49dfad<_0x3cbe83[_0x7953('0x6')];_0x49dfad+=0x1){_0x385cb1=_0x3cbe83[_0x49dfad];if(_[_0x7953('0x7')](_0x3d4e8e[_0x7953('0x1')][_0x385cb1['id']])){_0x3d4e8e[_0x7953('0x1')][_0x385cb1['id']]=new MailAccount(_0x385cb1);}else{_[_0x7953('0x8')](_0x3d4e8e['mailAccounts'][_0x385cb1['id']],_0x385cb1);}}}return _0x3d4e8e[_0x7953('0x1')];};};module[_0x7953('0x9')]=Realtime; \ No newline at end of file +var _0x1c3a=['mailAccounts','length','merge','lodash','../model/mailAccount','hasOwnProperty','prototype','initMailAccounts'];(function(_0x58e5be,_0x2878ce){var _0x3cd956=function(_0xd12fd9){while(--_0xd12fd9){_0x58e5be['push'](_0x58e5be['shift']());}};_0x3cd956(++_0x2878ce);}(_0x1c3a,0x1cb));var _0xa1c3=function(_0x5759e0,_0x31984b){_0x5759e0=_0x5759e0-0x0;var _0x1a64cd=_0x1c3a[_0x5759e0];return _0x1a64cd;};'use strict';var _=require(_0xa1c3('0x0'));var MailAccount=require(_0xa1c3('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x573fef,_0x5cb85b,_0x44f6a2){var _0x356562=_['mapKeys'](_0x573fef,function(_0x240709,_0x48d5a2){return _0x240709[_0x44f6a2];});for(var _0x285751 in _0x5cb85b){if(_0x5cb85b[_0xa1c3('0x2')](_0x285751)){if(!_0x356562[_0x285751]){delete _0x5cb85b[_0x285751];}}}}Realtime[_0xa1c3('0x3')]['mergeFromDatabase']=function(_0x4b7147,_0x21d4b6){for(var _0x3d4a14 in _0x21d4b6){if(_0x4b7147[_0xa1c3('0x2')](_0x3d4a14)){_0x4b7147[_0x3d4a14]=_0x21d4b6[_0x3d4a14];}}};Realtime['prototype'][_0xa1c3('0x4')]=function(){var _0x50392c=this;return function(_0x5b2e02){if(_0x5b2e02){freeIsNotKey(_0x5b2e02,_0x50392c[_0xa1c3('0x5')],'id');for(var _0x502e66=0x0,_0x5dcb0e={},_0x549d88={};_0x502e66<_0x5b2e02[_0xa1c3('0x6')];_0x502e66+=0x1){_0x5dcb0e=_0x5b2e02[_0x502e66];if(_['isUndefined'](_0x50392c['mailAccounts'][_0x5dcb0e['id']])){_0x50392c[_0xa1c3('0x5')][_0x5dcb0e['id']]=new MailAccount(_0x5dcb0e);}else{_[_0xa1c3('0x7')](_0x50392c[_0xa1c3('0x5')][_0x5dcb0e['id']],_0x5dcb0e);}}}return _0x50392c[_0xa1c3('0x5')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 2062c6a..d379170 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 _0x75b6=['Smtp','service','data5','getMailAccount','Request','NotifyMailAccount','../client','GetMailAccount','name','provider','email','active','key','TemplateId','Imap','CloudProvider','type','MailServerOut'];(function(_0x7a3e7a,_0x7d1f06){var _0x6f2c47=function(_0x382a53){while(--_0x382a53){_0x7a3e7a['push'](_0x7a3e7a['shift']());}};_0x6f2c47(++_0x7d1f06);}(_0x75b6,0x1a4));var _0x675b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x75b6[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x675b('0x0'));exports['getMailAccounts']=function(){return function(){return client['Request'](_0x675b('0x1'),{'options':{'attributes':['id',_0x675b('0x2'),_0x675b('0x3'),'service',_0x675b('0x4'),_0x675b('0x5'),_0x675b('0x6'),'ListId',_0x675b('0x7')],'raw':![],'include':[{'model':'MailServerIn','as':_0x675b('0x8'),'include':[{'model':_0x675b('0x9'),'attributes':['id',_0x675b('0x2'),'service',_0x675b('0xa'),'data5'],'as':_0x675b('0x9')}]},{'model':_0x675b('0xb'),'as':_0x675b('0xc'),'include':[{'model':_0x675b('0x9'),'attributes':['id',_0x675b('0x2'),_0x675b('0xd'),_0x675b('0xa'),_0x675b('0xe')],'as':_0x675b('0x9')}]}]},'log':_0x675b('0xf')});};};exports['notify']=function(_0x3ce0a2,_0x13e14b){return client[_0x675b('0x10')](_0x675b('0x11'),{'account':{'id':_0x3ce0a2},'body':_0x13e14b,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0xd383=['active','key','Imap','CloudProvider','data5','MailServerOut','type','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','provider','service'];(function(_0x59777e,_0x4ed642){var _0x2ba5c7=function(_0x84464c){while(--_0x84464c){_0x59777e['push'](_0x59777e['shift']());}};_0x2ba5c7(++_0x4ed642);}(_0xd383,0x1c4));var _0x3d38=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xd383[_0x8c43de];return _0xa6591b;};'use strict';var client=require(_0x3d38('0x0'));exports[_0x3d38('0x1')]=function(){return function(){return client[_0x3d38('0x2')](_0x3d38('0x3'),{'options':{'attributes':['id',_0x3d38('0x4'),_0x3d38('0x5'),_0x3d38('0x6'),'email',_0x3d38('0x7'),_0x3d38('0x8'),'ListId','TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':_0x3d38('0x9'),'include':[{'model':_0x3d38('0xa'),'attributes':['id',_0x3d38('0x4'),_0x3d38('0x6'),'type',_0x3d38('0xb')],'as':_0x3d38('0xa')}]},{'model':_0x3d38('0xc'),'as':'Smtp','include':[{'model':_0x3d38('0xa'),'attributes':['id',_0x3d38('0x4'),_0x3d38('0x6'),_0x3d38('0xd'),'data5'],'as':_0x3d38('0xa')}]}]},'log':_0x3d38('0xe')});};};exports[_0x3d38('0xf')]=function(_0x23c626,_0x4ce8a8){return client[_0x3d38('0x2')](_0x3d38('0x10'),{'account':{'id':_0x23c626},'body':_0x4ce8a8,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index ae82265..ff73e5a 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 _0x624e=['GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x624e,0x14b));var _0xe624=function(_0x4bcac2,_0x18bc5f){_0x4bcac2=_0x4bcac2-0x0;var _0xf1f9a1=_0x624e[_0x4bcac2];return _0xf1f9a1;};'use strict';var client=require(_0xe624('0x0'));exports[_0xe624('0x1')]=function(){return client[_0xe624('0x2')](_0xe624('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xe624('0x4')});}; \ No newline at end of file +var _0x0f22=['ShowSetting','loginMailFrequency','../client','Request'];(function(_0x56cac6,_0x290562){var _0x57a06e=function(_0x21a340){while(--_0x21a340){_0x56cac6['push'](_0x56cac6['shift']());}};_0x57a06e(++_0x290562);}(_0x0f22,0xae));var _0x20f2=function(_0x22e32e,_0x35405f){_0x22e32e=_0x22e32e-0x0;var _0x722e8b=_0x0f22[_0x22e32e];return _0x722e8b;};'use strict';var client=require(_0x20f2('0x0'));exports['getSettings']=function(){return client[_0x20f2('0x1')](_0x20f2('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x20f2('0x3')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index c507fd9..353b481 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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 119893d..8eb7ec5 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 _0x840d=['default','../../config/socketio','../../config/express','../../routes','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','http','express','ioredis','../../config/environment','createServer','timeout','polling','redis','defaults','localhost','socket.io-redis','../../config/triggers'];(function(_0x27b710,_0x367869){var _0x1c4c36=function(_0x2cee24){while(--_0x2cee24){_0x27b710['push'](_0x27b710['shift']());}};_0x1c4c36(++_0x367869);}(_0x840d,0x153));var _0xd840=function(_0x45f986,_0x424c80){_0x45f986=_0x45f986-0x0;var _0xe7a6f5=_0x840d[_0x45f986];return _0xe7a6f5;};'use strict';var _=require(_0xd840('0x0'));var http=require(_0xd840('0x1'));var express=require(_0xd840('0x2'));var sticky=require('sticky-session');var Redis=require(_0xd840('0x3'));var config=require(_0xd840('0x4'));var app=express();var server=http[_0xd840('0x5')](app);server[_0xd840('0x6')]=0xdbba0;if(sticky['listen'](server,config['port'])){var socketio=require('socket.io')(server,{'transports':['websocket',_0xd840('0x7')]});config[_0xd840('0x8')]=_[_0xd840('0x9')](config['redis'],{'host':_0xd840('0xa'),'port':0x18eb});socketio['adapter'](require(_0xd840('0xb'))({'pubClient':new Redis(config[_0xd840('0x8')]),'subClient':new Redis(config['redis'])}));require(_0xd840('0xc'))[_0xd840('0xd')]();require(_0xd840('0xe'))[_0xd840('0xd')](socketio);require(_0xd840('0xf'))[_0xd840('0xd')](app);require(_0xd840('0x10'))[_0xd840('0xd')](app);}else{server['once'](_0xd840('0x11'),function(){console[_0xd840('0x12')](_0xd840('0x13'),config[_0xd840('0x14')]);});}exports=module[_0xd840('0x15')]=app; \ No newline at end of file +var _0x57f7=['socket.io','polling','redis','defaults','adapter','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','express','ioredis','../../config/environment','createServer','timeout','listen','port'];(function(_0x445b52,_0x1325fd){var _0x38a47c=function(_0x361a83){while(--_0x361a83){_0x445b52['push'](_0x445b52['shift']());}};_0x38a47c(++_0x1325fd);}(_0x57f7,0x196));var _0x757f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x57f7[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x757f('0x0'));var http=require('http');var express=require(_0x757f('0x1'));var sticky=require('sticky-session');var Redis=require(_0x757f('0x2'));var config=require(_0x757f('0x3'));var app=express();var server=http[_0x757f('0x4')](app);server[_0x757f('0x5')]=0xdbba0;if(sticky[_0x757f('0x6')](server,config[_0x757f('0x7')])){var socketio=require(_0x757f('0x8'))(server,{'transports':['websocket',_0x757f('0x9')]});config[_0x757f('0xa')]=_[_0x757f('0xb')](config[_0x757f('0xa')],{'host':'localhost','port':0x18eb});socketio[_0x757f('0xc')](require('socket.io-redis')({'pubClient':new Redis(config[_0x757f('0xa')]),'subClient':new Redis(config['redis'])}));require(_0x757f('0xd'))[_0x757f('0xe')]();require(_0x757f('0xf'))[_0x757f('0xe')](socketio);require(_0x757f('0x10'))[_0x757f('0xe')](app);require(_0x757f('0x11'))['default'](app);}else{server[_0x757f('0x12')](_0x757f('0x13'),function(){console[_0x757f('0x14')](_0x757f('0x15'),config[_0x757f('0x7')]);});}exports=module[_0x757f('0x16')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 71d86f3..40a437d 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 _0x6499=['../../config/logger','routing','http','Request','request','debug','rpc','error','message','catch','jayson/promise'];(function(_0x3df223,_0x1740fc){var _0x562d11=function(_0x343009){while(--_0x343009){_0x3df223['push'](_0x3df223['shift']());}};_0x562d11(++_0x1740fc);}(_0x6499,0xa4));var _0x9649=function(_0x38e20c,_0x4b9b76){_0x38e20c=_0x38e20c-0x0;var _0x15dddc=_0x6499[_0x38e20c];return _0x15dddc;};'use strict';var jayson=require(_0x9649('0x0'));var BPromise=require('bluebird');var logger=require(_0x9649('0x1'))(_0x9649('0x2'));var client=jayson['client'][_0x9649('0x3')]({'port':0x2329});client[_0x9649('0x4')]=function(_0x338c11,_0x19b4e6){return new BPromise(function(_0x244950,_0x51e44d){return client[_0x9649('0x5')](_0x338c11,_0x19b4e6)['then'](function(_0x2fe8f6){logger[_0x9649('0x6')](_0x9649('0x7'),_0x9649('0x2'),_0x338c11,_0x19b4e6,_0x2fe8f6);if(_0x2fe8f6[_0x9649('0x8')]){logger[_0x9649('0x8')](_0x9649('0x7'),_0x9649('0x2'),_0x338c11,_0x2fe8f6[_0x9649('0x8')][_0x9649('0x9')],_0x19b4e6);return _0x51e44d(_0x2fe8f6['error'][_0x9649('0x9')]);}else{return _0x244950(_0x2fe8f6['result']);}})[_0x9649('0xa')](function(_0x5b8ef4){logger[_0x9649('0x8')](_0x9649('0x7'),_0x9649('0x2'),_0x338c11,_0x5b8ef4,_0x19b4e6);return _0x51e44d(_0x5b8ef4);});});};module['exports']=client; \ No newline at end of file +var _0x0524=['result','catch','exports','jayson/promise','../../config/logger','routing','client','http','Request','request','then','debug','rpc','error','message'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x0524,0xa8));var _0x4052=function(_0x456bd2,_0x156c79){_0x456bd2=_0x456bd2-0x0;var _0x2218c1=_0x0524[_0x456bd2];return _0x2218c1;};'use strict';var jayson=require(_0x4052('0x0'));var BPromise=require('bluebird');var logger=require(_0x4052('0x1'))(_0x4052('0x2'));var client=jayson[_0x4052('0x3')][_0x4052('0x4')]({'port':0x2329});client[_0x4052('0x5')]=function(_0x47e7cd,_0x5a948e){return new BPromise(function(_0xb8eed6,_0x15662c){return client[_0x4052('0x6')](_0x47e7cd,_0x5a948e)[_0x4052('0x7')](function(_0x10da40){logger[_0x4052('0x8')](_0x4052('0x9'),'routing',_0x47e7cd,_0x5a948e,_0x10da40);if(_0x10da40[_0x4052('0xa')]){logger[_0x4052('0xa')](_0x4052('0x9'),'routing',_0x47e7cd,_0x10da40[_0x4052('0xa')][_0x4052('0xb')],_0x5a948e);return _0x15662c(_0x10da40['error'][_0x4052('0xb')]);}else{return _0xb8eed6(_0x10da40[_0x4052('0xc')]);}})[_0x4052('0xd')](function(_0x1a2054){logger[_0x4052('0xa')](_0x4052('0x9'),_0x4052('0x2'),_0x47e7cd,_0x1a2054,_0x5a948e);return _0x15662c(_0x1a2054);});});};module[_0x4052('0xe')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 14183ec..c30ddea 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 _0xd79b=['getWhatsappQueues','initWhatsappQueues','listen','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','initSmsQueues','initMailQueues','getFaxQueues','initFaxQueues'];(function(_0x1ddd8e,_0x237432){var _0x3ad611=function(_0x438488){while(--_0x438488){_0x1ddd8e['push'](_0x1ddd8e['shift']());}};_0x3ad611(++_0x237432);}(_0xd79b,0x1ad));var _0xbd79=function(_0x216008,_0x2d1023){_0x216008=_0x216008-0x0;var _0x4d384f=_0xd79b[_0x216008];return _0x4d384f;};'use strict';var BPromise=require(_0xbd79('0x0'));var server=require(_0xbd79('0x1'));var Realtime=require(_0xbd79('0x2'));var user=require(_0xbd79('0x3'));var interval=require(_0xbd79('0x4'));var openchannelQueue=require(_0xbd79('0x5'));var chatQueue=require(_0xbd79('0x6'));var smsQueue=require(_0xbd79('0x7'));var mailQueue=require(_0xbd79('0x8'));var faxQueue=require(_0xbd79('0x9'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0xbd79('0xa')](user['getAgents']())[_0xbd79('0xa')](realtime[_0xbd79('0xb')]())[_0xbd79('0xa')](interval[_0xbd79('0xc')]())['then'](realtime[_0xbd79('0xd')]())['then'](openchannelQueue[_0xbd79('0xe')]())['then'](realtime['initOpenchannelQueues']())[_0xbd79('0xa')](chatQueue[_0xbd79('0xf')]())[_0xbd79('0xa')](realtime[_0xbd79('0x10')]())['then'](smsQueue['getSmsQueues']())[_0xbd79('0xa')](realtime[_0xbd79('0x11')]())[_0xbd79('0xa')](mailQueue['getMailQueues']())['then'](realtime[_0xbd79('0x12')]())[_0xbd79('0xa')](faxQueue[_0xbd79('0x13')]())[_0xbd79('0xa')](realtime[_0xbd79('0x14')]())['then'](whatsappQueue[_0xbd79('0x15')]())[_0xbd79('0xa')](realtime[_0xbd79('0x16')]())[_0xbd79('0xa')](function(){return realtime;});}function main(){return server[_0xbd79('0x17')](realtime)[_0xbd79('0xa')](function(_0xa7936a){return initRealtime();})[_0xbd79('0xa')](function(_0xfa1129){return setInterval(initRealtime,0x1388);})['catch'](function(_0x564fd5){console[_0xbd79('0x18')](_0x564fd5);});}main(); \ No newline at end of file +var _0x1235=['./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve','then','initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval'];(function(_0x45f4ba,_0x5498c8){var _0x44db14=function(_0x381dec){while(--_0x381dec){_0x45f4ba['push'](_0x45f4ba['shift']());}};_0x44db14(++_0x5498c8);}(_0x1235,0x1c3));var _0x5123=function(_0x47eae2,_0x159ccc){_0x47eae2=_0x47eae2-0x0;var _0x3bea35=_0x1235[_0x47eae2];return _0x3bea35;};'use strict';var BPromise=require(_0x5123('0x0'));var server=require(_0x5123('0x1'));var Realtime=require(_0x5123('0x2'));var user=require(_0x5123('0x3'));var interval=require(_0x5123('0x4'));var openchannelQueue=require(_0x5123('0x5'));var chatQueue=require(_0x5123('0x6'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x5123('0x7'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x5123('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x5123('0x9')]()[_0x5123('0xa')](user['getAgents']())[_0x5123('0xa')](realtime[_0x5123('0xb')]())[_0x5123('0xa')](interval[_0x5123('0xc')]())[_0x5123('0xa')](realtime['initIntervals']())['then'](openchannelQueue[_0x5123('0xd')]())[_0x5123('0xa')](realtime[_0x5123('0xe')]())[_0x5123('0xa')](chatQueue['getChatQueues']())['then'](realtime[_0x5123('0xf')]())['then'](smsQueue[_0x5123('0x10')]())['then'](realtime['initSmsQueues']())[_0x5123('0xa')](mailQueue[_0x5123('0x11')]())[_0x5123('0xa')](realtime[_0x5123('0x12')]())[_0x5123('0xa')](faxQueue[_0x5123('0x13')]())[_0x5123('0xa')](realtime['initFaxQueues']())[_0x5123('0xa')](whatsappQueue[_0x5123('0x14')]())[_0x5123('0xa')](realtime['initWhatsappQueues']())[_0x5123('0xa')](function(){return realtime;});}function main(){return server[_0x5123('0x15')](realtime)[_0x5123('0xa')](function(_0x2394da){return initRealtime();})['then'](function(_0xa8712e){return setInterval(initRealtime,0x1388);})[_0x5123('0x16')](function(_0x1998f6){console[_0x5123('0x17')](_0x1998f6);});}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 83d2432..7ef7614 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 _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x3d5aef,_0x64e2d5){var _0x33e385=function(_0x24c86e){while(--_0x24c86e){_0x3d5aef['push'](_0x3d5aef['shift']());}};_0x33e385(++_0x64e2d5);}(_0x814b,0x1a2));var _0xb814=function(_0x44c325,_0x19c625){_0x44c325=_0x44c325-0x0;var _0x55f09e=_0x814b[_0x44c325];return _0x55f09e;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine; \ No newline at end of file +var _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1261,0x144));var _0x1126=function(_0x186861,_0x2311c7){_0x186861=_0x186861-0x0;var _0x5be31f=_0x1261[_0x186861];return _0x5be31f;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 005cee0..24ef4f0 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 _0xc7ad=['http','request','then','error','result','catch','sendMailMessage','SendMail','jayson/promise','client'];(function(_0xdeb737,_0x4c1e22){var _0x5a1721=function(_0x5012a5){while(--_0x5012a5){_0xdeb737['push'](_0xdeb737['shift']());}};_0x5a1721(++_0x4c1e22);}(_0xc7ad,0xb2));var _0xdc7a=function(_0xc6e7a6,_0x6edd15){_0xc6e7a6=_0xc6e7a6-0x0;var _0x37119f=_0xc7ad[_0xc6e7a6];return _0x37119f;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xdc7a('0x0'));var client=jayson[_0xdc7a('0x1')][_0xdc7a('0x2')]({'port':0x232b});function request(_0x345160,_0x58c661){return new BPromise(function(_0x4cc0a1,_0x5d4d9){return client[_0xdc7a('0x3')](_0x345160,_0x58c661)[_0xdc7a('0x4')](function(_0x1c4c51){if(_0x1c4c51[_0xdc7a('0x5')]){return _0x5d4d9(_0x1c4c51[_0xdc7a('0x5')]['message']);}else{return _0x4cc0a1(_0x1c4c51[_0xdc7a('0x6')]);}})[_0xdc7a('0x7')](function(_0x4951d2){return _0x5d4d9(_0x4951d2);});});}exports[_0xdc7a('0x8')]=function(_0x2275dc,_0x29715e){return request(_0xdc7a('0x9'),{'account':_0x2275dc,'message':_0x29715e});}; \ No newline at end of file +var _0xe880=['error','message','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then'];(function(_0x37c991,_0x15cc69){var _0x2b9ced=function(_0x48127e){while(--_0x48127e){_0x37c991['push'](_0x37c991['shift']());}};_0x2b9ced(++_0x15cc69);}(_0xe880,0x1bc));var _0x0e88=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0xe880[_0x556927];return _0x5f1235;};'use strict';var BPromise=require(_0x0e88('0x0'));var jayson=require(_0x0e88('0x1'));var client=jayson[_0x0e88('0x2')][_0x0e88('0x3')]({'port':0x232b});function request(_0x2f35f8,_0xa186ac){return new BPromise(function(_0x49d141,_0x12a129){return client[_0x0e88('0x4')](_0x2f35f8,_0xa186ac)[_0x0e88('0x5')](function(_0x24f3d8){if(_0x24f3d8[_0x0e88('0x6')]){return _0x12a129(_0x24f3d8[_0x0e88('0x6')][_0x0e88('0x7')]);}else{return _0x49d141(_0x24f3d8['result']);}})['catch'](function(_0x41789d){return _0x12a129(_0x41789d);});});}exports[_0x0e88('0x8')]=function(_0x3b57b0,_0x1c6c39){return request(_0x0e88('0x9'),{'account':_0x3b57b0,'message':_0x1c6c39});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 2bec2be..65aad69 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 _0x1b0a=['chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','openchannel','fax','sms','whatsapp','length','toNumber','format','Status','online','mailStatusTime','faxStatus','faxCurrentCapacity','openchannelCurrentCapacity','stringify','emit','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','localhost','name','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus'];(function(_0x157cf2,_0x50bd83){var _0x3df3d2=function(_0x39e78d){while(--_0x39e78d){_0x157cf2['push'](_0x157cf2['shift']());}};_0x3df3d2(++_0x50bd83);}(_0x1b0a,0x16b));var _0xa1b0=function(_0x18b874,_0x40bba7){_0x18b874=_0x18b874-0x0;var _0x1a8e42=_0x1b0a[_0x18b874];return _0x1a8e42;};'use strict';var _=require(_0xa1b0('0x0'));var moment=require(_0xa1b0('0x1'));var md5=require(_0xa1b0('0x2'));var Redis=require(_0xa1b0('0x3'));var config=require(_0xa1b0('0x4'));config[_0xa1b0('0x5')]=_['defaults'](config[_0xa1b0('0x5')],{'host':_0xa1b0('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x220836){this['id']=_0x220836['id']||0x0;this[_0xa1b0('0x7')]=_0x220836[_0xa1b0('0x7')]||'';this['online']=_0x220836['online']||!![];this['voicePause']=_0x220836[_0xa1b0('0x8')]||![];this[_0xa1b0('0x9')]=_0x220836[_0xa1b0('0x9')]||![];this['mailPause']=_0x220836[_0xa1b0('0xa')]||![];this[_0xa1b0('0xb')]=_0x220836[_0xa1b0('0xb')]||![];this[_0xa1b0('0xc')]=_0x220836['smsPause']||![];this[_0xa1b0('0xd')]=_0x220836[_0xa1b0('0xd')]||![];this[_0xa1b0('0xe')]='unknown';this[_0xa1b0('0xf')]=0x0;this['chatCapacity']=_0x220836[_0xa1b0('0x10')]||0x0;this[_0xa1b0('0x11')]=0x0;this[_0xa1b0('0x12')]=_0xa1b0('0x13');this['mailStatusTime']=0x0;this[_0xa1b0('0x14')]=_0x220836['mailCapacity']||0x0;this[_0xa1b0('0x15')]=0x0;this['faxStatus']=_0xa1b0('0x13');this[_0xa1b0('0x16')]=0x0;this['faxCapacity']=_0x220836[_0xa1b0('0x17')]||0x0;this['faxCurrentCapacity']=0x0;this[_0xa1b0('0x18')]=_0xa1b0('0x13');this[_0xa1b0('0x19')]=0x0;this[_0xa1b0('0x1a')]=_0x220836['smsCapacity']||0x0;this[_0xa1b0('0x1b')]=0x0;this[_0xa1b0('0x1c')]=_0xa1b0('0x13');this['whatsappStatusTime']=0x0;this['whatsappCapacity']=_0x220836[_0xa1b0('0x1d')]||0x0;this[_0xa1b0('0x1e')]=0x0;this[_0xa1b0('0x1f')]=_0xa1b0('0x13');this[_0xa1b0('0x20')]=0x0;this[_0xa1b0('0x21')]=_0x220836[_0xa1b0('0x21')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xa1b0('0x22')]=![];this[_0xa1b0('0x23')]=undefined;this[_0xa1b0('0x2')]='';this[_0xa1b0('0x24')]();}Agent[_0xa1b0('0x25')][_0xa1b0('0x26')]=function(_0x2dfe47){if(this[_0x2dfe47+_0xa1b0('0x27')]>0x0){if(this[_0x2dfe47+_0xa1b0('0x28')]>0x0&&this[_0x2dfe47+'CurrentCapacity']>=this[_0x2dfe47+_0xa1b0('0x28')]){return _0xa1b0('0x29');}else{return _0xa1b0('0x2a');}}else{return _0xa1b0('0x2b');}};Agent[_0xa1b0('0x25')][_0xa1b0('0x24')]=function(){var _0x4c46e8=[_0xa1b0('0x2c'),_0xa1b0('0x2d'),_0xa1b0('0x2e'),_0xa1b0('0x2f'),_0xa1b0('0x30'),_0xa1b0('0x31')];for(var _0x2fd9c8=0x0;_0x2fd9c8<_0x4c46e8[_0xa1b0('0x32')];_0x2fd9c8+=0x1){var _0x58c10a=this[_0xa1b0('0x26')](_0x4c46e8[_0x2fd9c8]);if(this[_0x4c46e8[_0x2fd9c8]+'Status']!==_0x58c10a){this[_0x4c46e8[_0x2fd9c8]+'StatusTime']=_[_0xa1b0('0x33')](moment()[_0xa1b0('0x34')]('x'));}this[_0x4c46e8[_0x2fd9c8]+_0xa1b0('0x35')]=_0x58c10a;}var _0x525be={'id':this['id'],'name':this[_0xa1b0('0x7')],'online':this[_0xa1b0('0x36')],'voicePause':this['voicePause'],'chatPause':this[_0xa1b0('0x9')],'mailPause':this[_0xa1b0('0xa')],'smsPause':this['smsPause'],'faxPause':this[_0xa1b0('0xb')],'openchannelPause':this[_0xa1b0('0xd')],'chatStatus':this[_0xa1b0('0xe')],'chatStatusTime':this[_0xa1b0('0xf')],'chatCapacity':this[_0xa1b0('0x10')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0xa1b0('0x12')],'mailStatusTime':this[_0xa1b0('0x37')],'mailCapacity':this[_0xa1b0('0x14')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0xa1b0('0x38')],'faxStatusTime':this[_0xa1b0('0x16')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xa1b0('0x39')],'smsStatus':this[_0xa1b0('0x18')],'smsStatusTime':this[_0xa1b0('0x19')],'smsCapacity':this[_0xa1b0('0x1a')],'smsCurrentCapacity':this[_0xa1b0('0x1b')],'whatsappStatus':this[_0xa1b0('0x1c')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0xa1b0('0x1d')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0xa1b0('0x1f')],'openchannelStatusTime':this[_0xa1b0('0x20')],'openchannelCapacity':this[_0xa1b0('0x21')],'openchannelCurrentCapacity':this[_0xa1b0('0x3a')],'busy':this[_0xa1b0('0x22')],'busyQueue':this[_0xa1b0('0x23')]};var _0xff4c26=md5(JSON[_0xa1b0('0x3b')](_0x525be));if(this[_0xa1b0('0x2')]!==_0xff4c26){this[_0xa1b0('0x2')]=_0xff4c26;io[_0xa1b0('0x3c')](_0xa1b0('0x3d'),_0x525be);}};module[_0xa1b0('0x3e')]=Agent; \ No newline at end of file +var _0xae1a=['sms','length','Status','StatusTime','toNumber','format','mailStatus','mailStatusTime','faxStatus','faxCurrentCapacity','openchannelStatus','stringify','emit','user:save','exports','lodash','moment','md5','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','prototype','getChannelStatus','Capacity','CurrentCapacity','idle','updateRealtime','chat','fax'];(function(_0xead567,_0x29b84a){var _0xcae79e=function(_0x541ce7){while(--_0x541ce7){_0xead567['push'](_0xead567['shift']());}};_0xcae79e(++_0x29b84a);}(_0xae1a,0xba));var _0xaae1=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xae1a[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xaae1('0x0'));var moment=require(_0xaae1('0x1'));var md5=require(_0xaae1('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xaae1('0x3')]=_['defaults'](config['redis'],{'host':_0xaae1('0x4'),'port':0x18eb});var io=require(_0xaae1('0x5'))(new Redis(config[_0xaae1('0x3')]));function Agent(_0x424eb8){this['id']=_0x424eb8['id']||0x0;this[_0xaae1('0x6')]=_0x424eb8[_0xaae1('0x6')]||'';this[_0xaae1('0x7')]=_0x424eb8['online']||!![];this[_0xaae1('0x8')]=_0x424eb8[_0xaae1('0x8')]||![];this[_0xaae1('0x9')]=_0x424eb8[_0xaae1('0x9')]||![];this[_0xaae1('0xa')]=_0x424eb8[_0xaae1('0xa')]||![];this[_0xaae1('0xb')]=_0x424eb8[_0xaae1('0xb')]||![];this[_0xaae1('0xc')]=_0x424eb8['smsPause']||![];this[_0xaae1('0xd')]=_0x424eb8[_0xaae1('0xd')]||![];this[_0xaae1('0xe')]=_0xaae1('0xf');this['chatStatusTime']=0x0;this[_0xaae1('0x10')]=_0x424eb8[_0xaae1('0x10')]||0x0;this[_0xaae1('0x11')]=0x0;this['mailStatus']='unknown';this['mailStatusTime']=0x0;this[_0xaae1('0x12')]=_0x424eb8['mailCapacity']||0x0;this[_0xaae1('0x13')]=0x0;this['faxStatus']='unknown';this[_0xaae1('0x14')]=0x0;this[_0xaae1('0x15')]=_0x424eb8['faxCapacity']||0x0;this['faxCurrentCapacity']=0x0;this[_0xaae1('0x16')]='unknown';this[_0xaae1('0x17')]=0x0;this['smsCapacity']=_0x424eb8[_0xaae1('0x18')]||0x0;this[_0xaae1('0x19')]=0x0;this[_0xaae1('0x1a')]=_0xaae1('0xf');this[_0xaae1('0x1b')]=0x0;this['whatsappCapacity']=_0x424eb8[_0xaae1('0x1c')]||0x0;this[_0xaae1('0x1d')]=0x0;this['openchannelStatus']=_0xaae1('0xf');this[_0xaae1('0x1e')]=0x0;this['openchannelCapacity']=_0x424eb8[_0xaae1('0x1f')]||0x0;this[_0xaae1('0x20')]=0x0;this['busy']=![];this[_0xaae1('0x21')]=undefined;this[_0xaae1('0x2')]='';this['updateRealtime']();}Agent[_0xaae1('0x22')][_0xaae1('0x23')]=function(_0x53877a){if(this[_0x53877a+'CurrentCapacity']>0x0){if(this[_0x53877a+_0xaae1('0x24')]>0x0&&this[_0x53877a+_0xaae1('0x25')]>=this[_0x53877a+'Capacity']){return'maxcapacity';}else{return'working';}}else{return _0xaae1('0x26');}};Agent[_0xaae1('0x22')][_0xaae1('0x27')]=function(){var _0x3dc844=['mail',_0xaae1('0x28'),'openchannel',_0xaae1('0x29'),_0xaae1('0x2a'),'whatsapp'];for(var _0x2e1ac7=0x0;_0x2e1ac7<_0x3dc844[_0xaae1('0x2b')];_0x2e1ac7+=0x1){var _0x27ecdf=this[_0xaae1('0x23')](_0x3dc844[_0x2e1ac7]);if(this[_0x3dc844[_0x2e1ac7]+_0xaae1('0x2c')]!==_0x27ecdf){this[_0x3dc844[_0x2e1ac7]+_0xaae1('0x2d')]=_[_0xaae1('0x2e')](moment()[_0xaae1('0x2f')]('x'));}this[_0x3dc844[_0x2e1ac7]+'Status']=_0x27ecdf;}var _0x5865e5={'id':this['id'],'name':this[_0xaae1('0x6')],'online':this[_0xaae1('0x7')],'voicePause':this[_0xaae1('0x8')],'chatPause':this[_0xaae1('0x9')],'mailPause':this[_0xaae1('0xa')],'smsPause':this[_0xaae1('0xc')],'faxPause':this[_0xaae1('0xb')],'openchannelPause':this[_0xaae1('0xd')],'chatStatus':this[_0xaae1('0xe')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xaae1('0x11')],'mailStatus':this[_0xaae1('0x30')],'mailStatusTime':this[_0xaae1('0x31')],'mailCapacity':this[_0xaae1('0x12')],'mailCurrentCapacity':this[_0xaae1('0x13')],'faxStatus':this[_0xaae1('0x32')],'faxStatusTime':this[_0xaae1('0x14')],'faxCapacity':this[_0xaae1('0x15')],'faxCurrentCapacity':this[_0xaae1('0x33')],'smsStatus':this[_0xaae1('0x16')],'smsStatusTime':this[_0xaae1('0x17')],'smsCapacity':this[_0xaae1('0x18')],'smsCurrentCapacity':this[_0xaae1('0x19')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0xaae1('0x1b')],'whatsappCapacity':this[_0xaae1('0x1c')],'whatsappCurrentCapacity':this[_0xaae1('0x1d')],'openchannelStatus':this[_0xaae1('0x34')],'openchannelStatusTime':this[_0xaae1('0x1e')],'openchannelCapacity':this[_0xaae1('0x1f')],'openchannelCurrentCapacity':this[_0xaae1('0x20')],'busy':this['busy'],'busyQueue':this[_0xaae1('0x21')]};var _0x1a25ff=md5(JSON[_0xaae1('0x35')](_0x5865e5));if(this['md5']!==_0x1a25ff){this[_0xaae1('0x2')]=_0x1a25ff;io[_0xaae1('0x36')](_0xaae1('0x37'),_0x5865e5);}};module[_0xaae1('0x38')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 65a66ca..8e04760 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 _0xbb12=['md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','chatPause','available','stringify','chat:queue:%s','emit','chat_queue:save','exports','lodash'];(function(_0x2083aa,_0x5c9593){var _0x428180=function(_0x490644){while(--_0x490644){_0x2083aa['push'](_0x2083aa['shift']());}};_0x428180(++_0x5c9593);}(_0xbb12,0xd1));var _0x2bb1=function(_0x5188d4,_0x47df59){_0x5188d4=_0x5188d4-0x0;var _0x435d61=_0xbb12[_0x5188d4];return _0x435d61;};'use strict';var _=require(_0x2bb1('0x0'));var md5=require(_0x2bb1('0x1'));var util=require('util');var Redis=require(_0x2bb1('0x2'));var config=require(_0x2bb1('0x3'));config[_0x2bb1('0x4')]=_[_0x2bb1('0x5')](config[_0x2bb1('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x2bb1('0x6'))(new Redis(config['redis']));function ChatQueue(_0x2dd21d){this['id']=_0x2dd21d['id']||0x0;this[_0x2bb1('0x7')]=_0x2dd21d['name']||'';this[_0x2bb1('0x8')]=_0x2dd21d['timeout']||0xa;this['strategy']=_0x2dd21d[_0x2bb1('0x9')]||_0x2bb1('0xa');this[_0x2bb1('0xb')]=_0x2dd21d[_0x2bb1('0xb')];this[_0x2bb1('0xc')]={};this[_0x2bb1('0xd')]=0x0;this[_0x2bb1('0x1')]='';this[_0x2bb1('0xe')]();this[_0x2bb1('0xf')]();}ChatQueue[_0x2bb1('0x10')]['updateRouting']=function(){var _0x14820=this[_0x2bb1('0xc')][_0x2bb1('0x11')];this['mapAgentsId']=_[_0x2bb1('0x12')](this[_0x2bb1('0xb')],'id');this[_0x2bb1('0xc')][_0x2bb1('0x11')]=_0x14820;};ChatQueue[_0x2bb1('0x10')][_0x2bb1('0xf')]=function(){this[_0x2bb1('0x13')]=0x0;this[_0x2bb1('0x14')]=0x0;for(var _0x563b59=0x0;_0x563b59=0x0?this[_0x2bb1('0x18')]:0x0;var _0x3efc2d={'id':this['id'],'available':this[_0x2bb1('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x2bb1('0x7')],'paused':this[_0x2bb1('0x14')],'waiting':this[_0x2bb1('0xd')]};var _0x8a003a=md5(JSON[_0x2bb1('0x19')](_0x3efc2d));if(this[_0x2bb1('0x1')]!==_0x8a003a){this[_0x2bb1('0x1')]=_0x8a003a;io['to'](util['format'](_0x2bb1('0x1a'),_0x3efc2d[_0x2bb1('0x7')]))[_0x2bb1('0x1b')](_0x2bb1('0x1c'),_0x3efc2d);}};module[_0x2bb1('0x1d')]=ChatQueue; \ No newline at end of file +var _0xb59f=['prototype','_rr','map','paused','length','chatPause','loggedIn','available','stringify','format','emit','chat_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime'];(function(_0x24f4b7,_0x1f40ec){var _0x3876ab=function(_0x7a8e19){while(--_0x7a8e19){_0x24f4b7['push'](_0x24f4b7['shift']());}};_0x3876ab(++_0x1f40ec);}(_0xb59f,0x151));var _0xfb59=function(_0x38bfb4,_0x1cefed){_0x38bfb4=_0x38bfb4-0x0;var _0x53d1a4=_0xb59f[_0x38bfb4];return _0x53d1a4;};'use strict';var _=require(_0xfb59('0x0'));var md5=require(_0xfb59('0x1'));var util=require('util');var Redis=require(_0xfb59('0x2'));var config=require(_0xfb59('0x3'));config[_0xfb59('0x4')]=_[_0xfb59('0x5')](config[_0xfb59('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xfb59('0x6'))(new Redis(config[_0xfb59('0x4')]));function ChatQueue(_0x33a487){this['id']=_0x33a487['id']||0x0;this[_0xfb59('0x7')]=_0x33a487[_0xfb59('0x7')]||'';this[_0xfb59('0x8')]=_0x33a487[_0xfb59('0x8')]||0xa;this[_0xfb59('0x9')]=_0x33a487[_0xfb59('0x9')]||_0xfb59('0xa');this[_0xfb59('0xb')]=_0x33a487[_0xfb59('0xb')];this[_0xfb59('0xc')]={};this['waiting']=0x0;this['md5']='';this['updateRouting']();this[_0xfb59('0xd')]();}ChatQueue[_0xfb59('0xe')]['updateRouting']=function(){var _0x3e0444=this[_0xfb59('0xc')][_0xfb59('0xf')];this['mapAgentsId']=_[_0xfb59('0x10')](this[_0xfb59('0xb')],'id');this[_0xfb59('0xc')][_0xfb59('0xf')]=_0x3e0444;};ChatQueue['prototype'][_0xfb59('0xd')]=function(){this['loggedIn']=0x0;this[_0xfb59('0x11')]=0x0;for(var _0x18c26e=0x0;_0x18c26e=0x0?this[_0xfb59('0x15')]:0x0;var _0x4b97c5={'id':this['id'],'available':this[_0xfb59('0x15')],'loggedIn':this[_0xfb59('0x14')],'name':this['name'],'paused':this[_0xfb59('0x11')],'waiting':this['waiting']};var _0x4211b5=md5(JSON[_0xfb59('0x16')](_0x4b97c5));if(this[_0xfb59('0x1')]!==_0x4211b5){this['md5']=_0x4211b5;io['to'](util[_0xfb59('0x17')]('chat:queue:%s',_0x4b97c5[_0xfb59('0x7')]))[_0xfb59('0x18')](_0xfb59('0x19'),_0x4b97c5);}};module[_0xfb59('0x1a')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index c3bb2c4..1859cca 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 _0x9c15=['stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','map','loggedIn','paused','online','faxPause','available'];(function(_0x23c2c3,_0x27ecc8){var _0x41e09f=function(_0x5e6873){while(--_0x5e6873){_0x23c2c3['push'](_0x23c2c3['shift']());}};_0x41e09f(++_0x27ecc8);}(_0x9c15,0x16e));var _0x59c1=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9c15[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x59c1('0x0'));var md5=require(_0x59c1('0x1'));var util=require(_0x59c1('0x2'));var Redis=require('ioredis');var config=require(_0x59c1('0x3'));config['redis']=_['defaults'](config[_0x59c1('0x4')],{'host':_0x59c1('0x5'),'port':0x18eb});var io=require(_0x59c1('0x6'))(new Redis(config[_0x59c1('0x4')]));function FaxQueue(_0x4d13e1){this['id']=_0x4d13e1['id']||0x0;this[_0x59c1('0x7')]=_0x4d13e1[_0x59c1('0x7')]||'';this[_0x59c1('0x8')]=_0x4d13e1['timeout']||0xa;this['strategy']=_0x4d13e1[_0x59c1('0x9')]||_0x59c1('0xa');this['Agents']=_0x4d13e1[_0x59c1('0xb')];this['mapAgentsId']={};this[_0x59c1('0xc')]=0x0;this['md5']='';this['updateRouting']();this[_0x59c1('0xd')]();}FaxQueue[_0x59c1('0xe')][_0x59c1('0xf')]=function(){var _0x161236=this[_0x59c1('0x10')][_0x59c1('0x11')];this[_0x59c1('0x10')]=_[_0x59c1('0x12')](this[_0x59c1('0xb')],'id');this[_0x59c1('0x10')][_0x59c1('0x11')]=_0x161236;};FaxQueue[_0x59c1('0xe')][_0x59c1('0xd')]=function(){this[_0x59c1('0x13')]=0x0;this[_0x59c1('0x14')]=0x0;for(var _0x26b3bb=0x0;_0x26b3bb=0x0?this[_0x59c1('0x17')]:0x0;var _0x1c4201={'id':this['id'],'available':this[_0x59c1('0x17')],'loggedIn':this[_0x59c1('0x13')],'name':this[_0x59c1('0x7')],'paused':this[_0x59c1('0x14')],'waiting':this['waiting']};var _0x40c588=md5(JSON[_0x59c1('0x18')](_0x1c4201));if(this['md5']!==_0x40c588){this[_0x59c1('0x1')]=_0x40c588;io['to'](util[_0x59c1('0x19')](_0x59c1('0x1a'),_0x1c4201['name']))[_0x59c1('0x1b')](_0x59c1('0x1c'),_0x1c4201);}};module[_0x59c1('0x1d')]=FaxQueue; \ No newline at end of file +var _0x427e=['format','fax:queue:%s','exports','lodash','util','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','faxPause','available','md5'];(function(_0x25dd99,_0x504d8a){var _0x2d626c=function(_0x53ccd0){while(--_0x53ccd0){_0x25dd99['push'](_0x25dd99['shift']());}};_0x2d626c(++_0x504d8a);}(_0x427e,0x123));var _0xe427=function(_0x53bcf9,_0xea72ef){_0x53bcf9=_0x53bcf9-0x0;var _0x1365a6=_0x427e[_0x53bcf9];return _0x1365a6;};'use strict';var _=require(_0xe427('0x0'));var md5=require('md5');var util=require(_0xe427('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xe427('0x2')]=_['defaults'](config[_0xe427('0x2')],{'host':_0xe427('0x3'),'port':0x18eb});var io=require(_0xe427('0x4'))(new Redis(config[_0xe427('0x2')]));function FaxQueue(_0x42acec){this['id']=_0x42acec['id']||0x0;this[_0xe427('0x5')]=_0x42acec[_0xe427('0x5')]||'';this[_0xe427('0x6')]=_0x42acec['timeout']||0xa;this[_0xe427('0x7')]=_0x42acec[_0xe427('0x7')]||_0xe427('0x8');this[_0xe427('0x9')]=_0x42acec[_0xe427('0x9')];this[_0xe427('0xa')]={};this[_0xe427('0xb')]=0x0;this['md5']='';this[_0xe427('0xc')]();this[_0xe427('0xd')]();}FaxQueue[_0xe427('0xe')][_0xe427('0xc')]=function(){var _0x2dae70=this['mapAgentsId'][_0xe427('0xf')];this[_0xe427('0xa')]=_['map'](this[_0xe427('0x9')],'id');this['mapAgentsId'][_0xe427('0xf')]=_0x2dae70;};FaxQueue['prototype'][_0xe427('0xd')]=function(){this[_0xe427('0x10')]=0x0;this[_0xe427('0x11')]=0x0;for(var _0x891afb=0x0;_0x891afb=0x0?this[_0xe427('0x13')]:0x0;var _0x5918a5={'id':this['id'],'available':this[_0xe427('0x13')],'loggedIn':this['loggedIn'],'name':this[_0xe427('0x5')],'paused':this[_0xe427('0x11')],'waiting':this[_0xe427('0xb')]};var _0x1eacb6=md5(JSON['stringify'](_0x5918a5));if(this[_0xe427('0x14')]!==_0x1eacb6){this[_0xe427('0x14')]=_0x1eacb6;io['to'](util[_0xe427('0x15')](_0xe427('0x16'),_0x5918a5['name']))['emit']('fax_queue:save',_0x5918a5);}};module[_0xe427('0x17')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 6913af0..4a82991 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 _0x3508=['Intervals','exports','name'];(function(_0x48e885,_0x1b7f8a){var _0x3830a4=function(_0x27a583){while(--_0x27a583){_0x48e885['push'](_0x48e885['shift']());}};_0x3830a4(++_0x1b7f8a);}(_0x3508,0x14c));var _0x8350=function(_0x2a5491,_0x35d7f5){_0x2a5491=_0x2a5491-0x0;var _0x1e4c9a=_0x3508[_0x2a5491];return _0x1e4c9a;};'use strict';function Interval(_0x1af35b){this['id']=_0x1af35b['id']||0x0;this[_0x8350('0x0')]=_0x1af35b[_0x8350('0x0')]||'';this[_0x8350('0x1')]=_0x1af35b[_0x8350('0x1')]||{};}module[_0x8350('0x2')]=Interval; \ No newline at end of file +var _0xe7d7=['Intervals','exports','name'];(function(_0x5ee703,_0x5ad334){var _0x5661a9=function(_0x2d281a){while(--_0x2d281a){_0x5ee703['push'](_0x5ee703['shift']());}};_0x5661a9(++_0x5ad334);}(_0xe7d7,0x14f));var _0x7e7d=function(_0x5b621e,_0x1d15f9){_0x5b621e=_0x5b621e-0x0;var _0xf5e62b=_0xe7d7[_0x5b621e];return _0xf5e62b;};'use strict';function Interval(_0x749f59){this['id']=_0x749f59['id']||0x0;this[_0x7e7d('0x0')]=_0x749f59[_0x7e7d('0x0')]||'';this[_0x7e7d('0x1')]=_0x749f59[_0x7e7d('0x1')]||{};}module[_0x7e7d('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 57eb165..5955381 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 _0x4663=['timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online','available','paused','stringify','format','mail:queue:%s','emit','lodash','md5','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name'];(function(_0x289307,_0x1a0a87){var _0x2d3b98=function(_0x143963){while(--_0x143963){_0x289307['push'](_0x289307['shift']());}};_0x2d3b98(++_0x1a0a87);}(_0x4663,0x17f));var _0x3466=function(_0xc79a55,_0x448e5b){_0xc79a55=_0xc79a55-0x0;var _0x35c4a9=_0x4663[_0xc79a55];return _0x35c4a9;};'use strict';var _=require(_0x3466('0x0'));var md5=require(_0x3466('0x1'));var util=require('util');var Redis=require(_0x3466('0x2'));var config=require(_0x3466('0x3'));config['redis']=_[_0x3466('0x4')](config[_0x3466('0x5')],{'host':_0x3466('0x6'),'port':0x18eb});var io=require(_0x3466('0x7'))(new Redis(config['redis']));function MailQueue(_0xbe1cce){this['id']=_0xbe1cce['id']||0x0;this['name']=_0xbe1cce[_0x3466('0x8')]||'';this[_0x3466('0x9')]=_0xbe1cce[_0x3466('0x9')]||0xa;this[_0x3466('0xa')]=_0xbe1cce[_0x3466('0xa')]||_0x3466('0xb');this[_0x3466('0xc')]=_0xbe1cce[_0x3466('0xc')];this[_0x3466('0xd')]={};this['waiting']=0x0;this['md5']='';this[_0x3466('0xe')]();this[_0x3466('0xf')]();}MailQueue[_0x3466('0x10')][_0x3466('0xe')]=function(){var _0x69d6db=this['mapAgentsId'][_0x3466('0x11')];this['mapAgentsId']=_[_0x3466('0x12')](this[_0x3466('0xc')],'id');this[_0x3466('0xd')][_0x3466('0x11')]=_0x69d6db;};MailQueue[_0x3466('0x10')][_0x3466('0xf')]=function(){this[_0x3466('0x13')]=0x0;this['paused']=0x0;for(var _0x1c8b27=0x0;_0x1c8b27=0x0?this[_0x3466('0x16')]:0x0;var _0x2d1d5c={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x3466('0x8')],'paused':this[_0x3466('0x17')],'waiting':this['waiting']};var _0x1a9eb3=md5(JSON[_0x3466('0x18')](_0x2d1d5c));if(this[_0x3466('0x1')]!==_0x1a9eb3){this[_0x3466('0x1')]=_0x1a9eb3;io['to'](util[_0x3466('0x19')](_0x3466('0x1a'),_0x2d1d5c[_0x3466('0x8')]))[_0x3466('0x1b')]('mail_queue:save',_0x2d1d5c);}};module['exports']=MailQueue; \ No newline at end of file +var _0x8666=['loggedIn','paused','length','mailPause','available','stringify','mail:queue:%s','emit','mail_queue:save','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','md5','updateRealtime','prototype','updateRouting','_rr','mapAgentsId'];(function(_0xd300ac,_0x39e8d5){var _0x27655b=function(_0x41d957){while(--_0x41d957){_0xd300ac['push'](_0xd300ac['shift']());}};_0x27655b(++_0x39e8d5);}(_0x8666,0x19f));var _0x6866=function(_0x121f3c,_0x49ce30){_0x121f3c=_0x121f3c-0x0;var _0x123041=_0x8666[_0x121f3c];return _0x123041;};'use strict';var _=require(_0x6866('0x0'));var md5=require('md5');var util=require(_0x6866('0x1'));var Redis=require(_0x6866('0x2'));var config=require(_0x6866('0x3'));config[_0x6866('0x4')]=_[_0x6866('0x5')](config[_0x6866('0x4')],{'host':_0x6866('0x6'),'port':0x18eb});var io=require(_0x6866('0x7'))(new Redis(config[_0x6866('0x4')]));function MailQueue(_0x3273e9){this['id']=_0x3273e9['id']||0x0;this[_0x6866('0x8')]=_0x3273e9[_0x6866('0x8')]||'';this[_0x6866('0x9')]=_0x3273e9[_0x6866('0x9')]||0xa;this['strategy']=_0x3273e9[_0x6866('0xa')]||_0x6866('0xb');this[_0x6866('0xc')]=_0x3273e9['Agents'];this['mapAgentsId']={};this[_0x6866('0xd')]=0x0;this[_0x6866('0xe')]='';this['updateRouting']();this[_0x6866('0xf')]();}MailQueue[_0x6866('0x10')][_0x6866('0x11')]=function(){var _0x57ef17=this['mapAgentsId'][_0x6866('0x12')];this[_0x6866('0x13')]=_['map'](this['Agents'],'id');this[_0x6866('0x13')][_0x6866('0x12')]=_0x57ef17;};MailQueue[_0x6866('0x10')]['updateRealtime']=function(){this[_0x6866('0x14')]=0x0;this[_0x6866('0x15')]=0x0;for(var _0x4afe6a=0x0;_0x4afe6a=0x0?this[_0x6866('0x18')]:0x0;var _0x5afb3c={'id':this['id'],'available':this['available'],'loggedIn':this[_0x6866('0x14')],'name':this[_0x6866('0x8')],'paused':this[_0x6866('0x15')],'waiting':this[_0x6866('0xd')]};var _0x13ece7=md5(JSON[_0x6866('0x19')](_0x5afb3c));if(this[_0x6866('0xe')]!==_0x13ece7){this[_0x6866('0xe')]=_0x13ece7;io['to'](util['format'](_0x6866('0x1a'),_0x5afb3c[_0x6866('0x8')]))[_0x6866('0x1b')](_0x6866('0x1c'),_0x5afb3c);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 3cbca41..e2240e5 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 _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xc4aa[_0x1b2ff7];return _0x31656a;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x326f,0xd1));var _0xf326=function(_0x491cc4,_0x5940a0){_0x491cc4=_0x491cc4-0x0;var _0x363ccb=_0x326f[_0x491cc4];return _0x363ccb;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 4e0e39e..0c89151 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 _0x6737=['Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','md5','util','../../../config/environment','redis','defaults','socket.io-emitter','name','beepall'];(function(_0x768fc4,_0x5b2633){var _0x5aa921=function(_0x18b15d){while(--_0x18b15d){_0x768fc4['push'](_0x768fc4['shift']());}};_0x5aa921(++_0x5b2633);}(_0x6737,0xe2));var _0x7673=function(_0x588865,_0x36da84){_0x588865=_0x588865-0x0;var _0x3aaf99=_0x6737[_0x588865];return _0x3aaf99;};'use strict';var _=require('lodash');var md5=require(_0x7673('0x0'));var util=require(_0x7673('0x1'));var Redis=require('ioredis');var config=require(_0x7673('0x2'));config[_0x7673('0x3')]=_[_0x7673('0x4')](config[_0x7673('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x7673('0x5'))(new Redis(config[_0x7673('0x3')]));function SmsQueue(_0x543b61){this['id']=_0x543b61['id']||0x0;this[_0x7673('0x6')]=_0x543b61[_0x7673('0x6')]||'';this['timeout']=_0x543b61['timeout']||0xa;this['strategy']=_0x543b61['strategy']||_0x7673('0x7');this['Agents']=_0x543b61[_0x7673('0x8')];this[_0x7673('0x9')]={};this['waiting']=0x0;this[_0x7673('0x0')]='';this[_0x7673('0xa')]();this[_0x7673('0xb')]();}SmsQueue['prototype']['updateRouting']=function(){var _0x3ca258=this['mapAgentsId'][_0x7673('0xc')];this[_0x7673('0x9')]=_[_0x7673('0xd')](this[_0x7673('0x8')],'id');this[_0x7673('0x9')][_0x7673('0xc')]=_0x3ca258;};SmsQueue[_0x7673('0xe')][_0x7673('0xb')]=function(){this[_0x7673('0xf')]=0x0;this[_0x7673('0x10')]=0x0;for(var _0x5c8626=0x0;_0x5c8626=0x0?this[_0x7673('0x14')]:0x0;var _0x58a821={'id':this['id'],'available':this[_0x7673('0x14')],'loggedIn':this[_0x7673('0xf')],'name':this[_0x7673('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0x249fe3=md5(JSON[_0x7673('0x15')](_0x58a821));if(this['md5']!==_0x249fe3){this[_0x7673('0x0')]=_0x249fe3;io['to'](util[_0x7673('0x16')](_0x7673('0x17'),_0x58a821[_0x7673('0x6')]))[_0x7673('0x18')](_0x7673('0x19'),_0x58a821);}};module['exports']=SmsQueue; \ No newline at end of file +var _0x4d46=['exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','Agents','online','smsPause','available','waiting','format','sms:queue:%s','sms_queue:save'];(function(_0x3713d2,_0x13badc){var _0x58e041=function(_0x277311){while(--_0x277311){_0x3713d2['push'](_0x3713d2['shift']());}};_0x58e041(++_0x13badc);}(_0x4d46,0x197));var _0x64d4=function(_0x584991,_0x20c113){_0x584991=_0x584991-0x0;var _0x372087=_0x4d46[_0x584991];return _0x372087;};'use strict';var _=require(_0x64d4('0x0'));var md5=require(_0x64d4('0x1'));var util=require(_0x64d4('0x2'));var Redis=require(_0x64d4('0x3'));var config=require(_0x64d4('0x4'));config[_0x64d4('0x5')]=_['defaults'](config[_0x64d4('0x5')],{'host':_0x64d4('0x6'),'port':0x18eb});var io=require(_0x64d4('0x7'))(new Redis(config[_0x64d4('0x5')]));function SmsQueue(_0x1f7d33){this['id']=_0x1f7d33['id']||0x0;this[_0x64d4('0x8')]=_0x1f7d33['name']||'';this[_0x64d4('0x9')]=_0x1f7d33[_0x64d4('0x9')]||0xa;this['strategy']=_0x1f7d33[_0x64d4('0xa')]||_0x64d4('0xb');this['Agents']=_0x1f7d33['Agents'];this['mapAgentsId']={};this['waiting']=0x0;this['md5']='';this[_0x64d4('0xc')]();this[_0x64d4('0xd')]();}SmsQueue[_0x64d4('0xe')][_0x64d4('0xc')]=function(){var _0x766524=this[_0x64d4('0xf')][_0x64d4('0x10')];this[_0x64d4('0xf')]=_[_0x64d4('0x11')](this['Agents'],'id');this[_0x64d4('0xf')]['_rr']=_0x766524;};SmsQueue[_0x64d4('0xe')][_0x64d4('0xd')]=function(){this[_0x64d4('0x12')]=0x0;this[_0x64d4('0x13')]=0x0;for(var _0x13b111=0x0;_0x13b111=0x0?this[_0x64d4('0x17')]:0x0;var _0x155b60={'id':this['id'],'available':this[_0x64d4('0x17')],'loggedIn':this[_0x64d4('0x12')],'name':this[_0x64d4('0x8')],'paused':this[_0x64d4('0x13')],'waiting':this[_0x64d4('0x18')]};var _0x2549e9=md5(JSON['stringify'](_0x155b60));if(this[_0x64d4('0x1')]!==_0x2549e9){this[_0x64d4('0x1')]=_0x2549e9;io['to'](util[_0x64d4('0x19')](_0x64d4('0x1a'),_0x155b60['name']))['emit'](_0x64d4('0x1b'),_0x155b60);}};module[_0x64d4('0x1c')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 620d5e7..66aa9eb 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 _0x5d0a=['emit','whatsapp_queue:save','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','mapAgentsId','_rr','map','prototype','length','online','loggedIn','whatsappPause','paused','available','waiting','format'];(function(_0x3f29fd,_0x219e8a){var _0x48f87b=function(_0x2e7dcf){while(--_0x2e7dcf){_0x3f29fd['push'](_0x3f29fd['shift']());}};_0x48f87b(++_0x219e8a);}(_0x5d0a,0x197));var _0xa5d0=function(_0x175d55,_0x326599){_0x175d55=_0x175d55-0x0;var _0x1c2027=_0x5d0a[_0x175d55];return _0x1c2027;};'use strict';var _=require('lodash');var md5=require(_0xa5d0('0x0'));var util=require('util');var Redis=require(_0xa5d0('0x1'));var config=require(_0xa5d0('0x2'));config[_0xa5d0('0x3')]=_['defaults'](config['redis'],{'host':_0xa5d0('0x4'),'port':0x18eb});var io=require(_0xa5d0('0x5'))(new Redis(config[_0xa5d0('0x3')]));function WhatsappQueue(_0x726935){this['id']=_0x726935['id']||0x0;this[_0xa5d0('0x6')]=_0x726935[_0xa5d0('0x6')]||'';this[_0xa5d0('0x7')]=_0x726935[_0xa5d0('0x7')]||0xa;this[_0xa5d0('0x8')]=_0x726935[_0xa5d0('0x8')]||_0xa5d0('0x9');this[_0xa5d0('0xa')]=_0x726935[_0xa5d0('0xa')];this['mapAgentsId']={};this['waiting']=0x0;this[_0xa5d0('0x0')]='';this[_0xa5d0('0xb')]();this[_0xa5d0('0xc')]();}WhatsappQueue['prototype'][_0xa5d0('0xb')]=function(){var _0x491835=this[_0xa5d0('0xd')][_0xa5d0('0xe')];this[_0xa5d0('0xd')]=_[_0xa5d0('0xf')](this['Agents'],'id');this[_0xa5d0('0xd')][_0xa5d0('0xe')]=_0x491835;};WhatsappQueue[_0xa5d0('0x10')][_0xa5d0('0xc')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0xb9b435=0x0;_0xb9b435=0x0?this[_0xa5d0('0x16')]:0x0;var _0x5e2c42={'id':this['id'],'available':this[_0xa5d0('0x16')],'loggedIn':this[_0xa5d0('0x13')],'name':this[_0xa5d0('0x6')],'paused':this[_0xa5d0('0x15')],'waiting':this[_0xa5d0('0x17')]};var _0x35b468=md5(JSON['stringify'](_0x5e2c42));if(this['md5']!==_0x35b468){this[_0xa5d0('0x0')]=_0x35b468;io['to'](util[_0xa5d0('0x18')]('whatsapp:queue:%s',_0x5e2c42[_0xa5d0('0x6')]))[_0xa5d0('0x19')](_0xa5d0('0x1a'),_0x5e2c42);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0x1633=['emit','whatsapp_queue:save','exports','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','map','updateRealtime','length','online','loggedIn','whatsappPause','paused','available','format'];(function(_0x6aebaa,_0x2676c9){var _0x524aef=function(_0x420985){while(--_0x420985){_0x6aebaa['push'](_0x6aebaa['shift']());}};_0x524aef(++_0x2676c9);}(_0x1633,0x137));var _0x3163=function(_0x1fe1b8,_0x376764){_0x1fe1b8=_0x1fe1b8-0x0;var _0x172480=_0x1633[_0x1fe1b8];return _0x172480;};'use strict';var _=require('lodash');var md5=require(_0x3163('0x0'));var util=require(_0x3163('0x1'));var Redis=require(_0x3163('0x2'));var config=require('../../../config/environment');config[_0x3163('0x3')]=_[_0x3163('0x4')](config[_0x3163('0x3')],{'host':_0x3163('0x5'),'port':0x18eb});var io=require(_0x3163('0x6'))(new Redis(config[_0x3163('0x3')]));function WhatsappQueue(_0x3cddca){this['id']=_0x3cddca['id']||0x0;this['name']=_0x3cddca[_0x3163('0x7')]||'';this['timeout']=_0x3cddca['timeout']||0xa;this[_0x3163('0x8')]=_0x3cddca[_0x3163('0x8')]||_0x3163('0x9');this[_0x3163('0xa')]=_0x3cddca[_0x3163('0xa')];this[_0x3163('0xb')]={};this[_0x3163('0xc')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}WhatsappQueue[_0x3163('0xd')][_0x3163('0xe')]=function(){var _0x35e95c=this[_0x3163('0xb')][_0x3163('0xf')];this[_0x3163('0xb')]=_[_0x3163('0x10')](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x35e95c;};WhatsappQueue[_0x3163('0xd')][_0x3163('0x11')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x59ba8e=0x0;_0x59ba8e=0x0?this['available']:0x0;var _0x5c7e6e={'id':this['id'],'available':this[_0x3163('0x17')],'loggedIn':this[_0x3163('0x14')],'name':this[_0x3163('0x7')],'paused':this['paused'],'waiting':this[_0x3163('0xc')]};var _0x4bdbd3=md5(JSON['stringify'](_0x5c7e6e));if(this[_0x3163('0x0')]!==_0x4bdbd3){this[_0x3163('0x0')]=_0x4bdbd3;io['to'](util[_0x3163('0x18')]('whatsapp:queue:%s',_0x5c7e6e[_0x3163('0x7')]))[_0x3163('0x19')](_0x3163('0x1a'),_0x5c7e6e);}};module[_0x3163('0x1b')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 7769190..206fb28 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 _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0xa4187e,_0x118f49){var _0x544f9a=function(_0x32cc4e){while(--_0x32cc4e){_0xa4187e['push'](_0xa4187e['shift']());}};_0x544f9a(++_0x118f49);}(_0xb10b,0x12a));var _0xbb10=function(_0x3a32e0,_0x69a2f1){_0x3a32e0=_0x3a32e0-0x0;var _0x43ae59=_0xb10b[_0x3a32e0];return _0x43ae59;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=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(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 ccc735a..0e1e4a3 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 _0xec87=['addTags','AddTagsToChatInteraction','update','Request','UpdateChatInteraction'];(function(_0x384862,_0x26ccf2){var _0x2a8f30=function(_0x5c7c9b){while(--_0x5c7c9b){_0x384862['push'](_0x384862['shift']());}};_0x2a8f30(++_0x26ccf2);}(_0xec87,0x6b));var _0x7ec8=function(_0x4e9274,_0x49576e){_0x4e9274=_0x4e9274-0x0;var _0x8b474c=_0xec87[_0x4e9274];return _0x8b474c;};'use strict';var client=require('../client');exports[_0x7ec8('0x0')]=function(_0x4b2384,_0x39e089){return client[_0x7ec8('0x1')](_0x7ec8('0x2'),{'body':_0x39e089,'options':{'where':{'id':_0x4b2384}},'log':'updateChatInteraction'});};exports[_0x7ec8('0x3')]=function(_0x533b4c,_0x42266d){return client[_0x7ec8('0x1')](_0x7ec8('0x4'),{'body':_0x42266d,'options':{'where':{'id':_0x533b4c}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x905b=['AddTagsToChatInteraction','../client','update','Request','addTags'];(function(_0x424515,_0x47aacb){var _0x4bb6ce=function(_0x164222){while(--_0x164222){_0x424515['push'](_0x424515['shift']());}};_0x4bb6ce(++_0x47aacb);}(_0x905b,0x17d));var _0xb905=function(_0x42fc93,_0x154134){_0x42fc93=_0x42fc93-0x0;var _0x1391af=_0x905b[_0x42fc93];return _0x1391af;};'use strict';var client=require(_0xb905('0x0'));exports[_0xb905('0x1')]=function(_0x3e3304,_0x1b5b18){return client[_0xb905('0x2')]('UpdateChatInteraction',{'body':_0x1b5b18,'options':{'where':{'id':_0x3e3304}},'log':'updateChatInteraction'});};exports[_0xb905('0x3')]=function(_0x15d8fc,_0x3e9895){return client[_0xb905('0x2')](_0xb905('0x4'),{'body':_0x3e9895,'options':{'where':{'id':_0x15d8fc}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 7596d30..7f92c34 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 _0x1cb2=['createChatMessage','create','Request','CreateChatMessage'];(function(_0x5f3d1e,_0x1f72bb){var _0x30ac96=function(_0x1f64bf){while(--_0x1f64bf){_0x5f3d1e['push'](_0x5f3d1e['shift']());}};_0x30ac96(++_0x1f72bb);}(_0x1cb2,0x171));var _0x21cb=function(_0x6723bb,_0x1e984d){_0x6723bb=_0x6723bb-0x0;var _0x4a8b45=_0x1cb2[_0x6723bb];return _0x4a8b45;};'use strict';var client=require('../client');exports[_0x21cb('0x0')]=function(_0x432a12){return client[_0x21cb('0x1')](_0x21cb('0x2'),{'body':_0x432a12,'log':_0x21cb('0x3')});}; \ No newline at end of file +var _0x4bf5=['../client','Request','CreateChatMessage'];(function(_0x4ac60a,_0x503a99){var _0x4b22e8=function(_0x145c47){while(--_0x145c47){_0x4ac60a['push'](_0x4ac60a['shift']());}};_0x4b22e8(++_0x503a99);}(_0x4bf5,0x198));var _0x54bf=function(_0xa4d6ae,_0x516961){_0xa4d6ae=_0xa4d6ae-0x0;var _0x5e7673=_0x4bf5[_0xa4d6ae];return _0x5e7673;};'use strict';var client=require(_0x54bf('0x0'));exports['create']=function(_0x78e2d1){return client[_0x54bf('0x1')](_0x54bf('0x2'),{'body':_0x78e2d1,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index f571ede..1afc8a8 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 _0x0be3=['name','strategy','Agents','online','Request','GetChatQueue'];(function(_0x173395,_0x280495){var _0x1c1931=function(_0x16f32c){while(--_0x16f32c){_0x173395['push'](_0x173395['shift']());}};_0x1c1931(++_0x280495);}(_0x0be3,0x9a));var _0x30be=function(_0x62c4d9,_0xb326b){_0x62c4d9=_0x62c4d9-0x0;var _0xc69de8=_0x0be3[_0x62c4d9];return _0xc69de8;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client[_0x30be('0x0')](_0x30be('0x1'),{'options':{'raw':![],'attributes':['id',_0x30be('0x2'),'timeout',_0x30be('0x3')],'include':[{'model':'User','as':_0x30be('0x4'),'attributes':['id',_0x30be('0x2'),_0x30be('0x5'),'chatPause']}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x2d17=['name','strategy','User','chatPause','../client','getChatQueues','GetChatQueue'];(function(_0x3bf6f7,_0x49d9a2){var _0xb009e4=function(_0x2f0fb9){while(--_0x2f0fb9){_0x3bf6f7['push'](_0x3bf6f7['shift']());}};_0xb009e4(++_0x49d9a2);}(_0x2d17,0x17e));var _0x72d1=function(_0x42ed3f,_0x49c0c3){_0x42ed3f=_0x42ed3f-0x0;var _0x18abec=_0x2d17[_0x42ed3f];return _0x18abec;};'use strict';var client=require(_0x72d1('0x0'));exports[_0x72d1('0x1')]=function(){return function(){return client['Request'](_0x72d1('0x2'),{'options':{'raw':![],'attributes':['id',_0x72d1('0x3'),'timeout',_0x72d1('0x4')],'include':[{'model':_0x72d1('0x5'),'as':'Agents','attributes':['id',_0x72d1('0x3'),'online',_0x72d1('0x6')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 444a9b8..2d513f4 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 _0xf874=['update','UpdateChatQueueReport','DESC','../client','Request','CreateChatQueueReport'];(function(_0x5f550f,_0x8786ec){var _0x2acb13=function(_0x1fc38b){while(--_0x1fc38b){_0x5f550f['push'](_0x5f550f['shift']());}};_0x2acb13(++_0x8786ec);}(_0xf874,0x177));var _0x4f87=function(_0x1aa420,_0x47f7bc){_0x1aa420=_0x1aa420-0x0;var _0x1f5827=_0xf874[_0x1aa420];return _0x1f5827;};'use strict';var client=require(_0x4f87('0x0'));exports['create']=function(_0x391d9f){return client[_0x4f87('0x1')](_0x4f87('0x2'),{'body':_0x391d9f,'log':_0x4f87('0x2')});};exports[_0x4f87('0x3')]=function(_0xe4464e,_0x87123d){return client['Request'](_0x4f87('0x4'),{'body':_0x87123d,'options':{'where':{'uniqueid':_0xe4464e},'order':[['id',_0x4f87('0x5')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0xf7f3=['Request','CreateChatQueueReport','DESC','../client','create'];(function(_0x4b91c4,_0x23f35f){var _0x25cb80=function(_0x48e283){while(--_0x48e283){_0x4b91c4['push'](_0x4b91c4['shift']());}};_0x25cb80(++_0x23f35f);}(_0xf7f3,0x12a));var _0x3f7f=function(_0x584e44,_0x2253bc){_0x584e44=_0x584e44-0x0;var _0x3de1da=_0xf7f3[_0x584e44];return _0x3de1da;};'use strict';var client=require(_0x3f7f('0x0'));exports[_0x3f7f('0x1')]=function(_0x1cfb19){return client[_0x3f7f('0x2')](_0x3f7f('0x3'),{'body':_0x1cfb19,'log':_0x3f7f('0x3')});};exports['update']=function(_0x5df5c4,_0x5e4ff){return client[_0x3f7f('0x2')]('UpdateChatQueueReport',{'body':_0x5e4ff,'options':{'where':{'uniqueid':_0x5df5c4},'order':[['id',_0x3f7f('0x4')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 1df3a80..263a56c 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 _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x125c3a,_0x2d86ca){var _0x5dec85=function(_0x4fe3ae){while(--_0x4fe3ae){_0x125c3a['push'](_0x125c3a['shift']());}};_0x5dec85(++_0x2d86ca);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x1b3d0e,_0x1fba2f){var _0x2dac24=function(_0x510bcf){while(--_0x510bcf){_0x1b3d0e['push'](_0x1b3d0e['shift']());}};_0x2dac24(++_0x1fba2f);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index f913877..b3c1466 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 _0xcad9=['create','Request','createFaxMessage'];(function(_0x4be3ec,_0x218441){var _0x44b79f=function(_0x56d3c1){while(--_0x56d3c1){_0x4be3ec['push'](_0x4be3ec['shift']());}};_0x44b79f(++_0x218441);}(_0xcad9,0x1a4));var _0x9cad=function(_0x51606d,_0x361ad1){_0x51606d=_0x51606d-0x0;var _0x212075=_0xcad9[_0x51606d];return _0x212075;};'use strict';var client=require('../client');exports[_0x9cad('0x0')]=function(_0x1b190f){return client[_0x9cad('0x1')]('CreateFaxMessage',{'body':_0x1b190f,'log':_0x9cad('0x2')});}; \ No newline at end of file +var _0xd4b7=['Request','CreateFaxMessage','createFaxMessage','../client','create'];(function(_0xffbdfa,_0x9dc18c){var _0x3d7544=function(_0x440053){while(--_0x440053){_0xffbdfa['push'](_0xffbdfa['shift']());}};_0x3d7544(++_0x9dc18c);}(_0xd4b7,0xe4));var _0x7d4b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd4b7[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x7d4b('0x0'));exports[_0x7d4b('0x1')]=function(_0x5c7135){return client[_0x7d4b('0x2')](_0x7d4b('0x3'),{'body':_0x5c7135,'log':_0x7d4b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index bc0d92a..4b9384c 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 _0x2b1b=['timeout','User','online','faxPause','../client','getFaxQueues','GetFaxQueue','name'];(function(_0x59dee6,_0x314233){var _0x32a129=function(_0x288576){while(--_0x288576){_0x59dee6['push'](_0x59dee6['shift']());}};_0x32a129(++_0x314233);}(_0x2b1b,0x8c));var _0xb2b1=function(_0x2eee47,_0x310067){_0x2eee47=_0x2eee47-0x0;var _0xc61f7e=_0x2b1b[_0x2eee47];return _0xc61f7e;};'use strict';var client=require(_0xb2b1('0x0'));exports[_0xb2b1('0x1')]=function(){return function(){return client['Request'](_0xb2b1('0x2'),{'options':{'raw':![],'attributes':['id',_0xb2b1('0x3'),_0xb2b1('0x4'),'strategy'],'include':[{'model':_0xb2b1('0x5'),'as':'Agents','attributes':['id',_0xb2b1('0x3'),_0xb2b1('0x6'),_0xb2b1('0x7')]}]},'log':_0xb2b1('0x1')});};}; \ No newline at end of file +var _0x06f4=['GetFaxQueue','name','strategy','User','Agents','faxPause','getFaxQueues','Request'];(function(_0x2706da,_0x3856f5){var _0x3ba87e=function(_0x479a79){while(--_0x479a79){_0x2706da['push'](_0x2706da['shift']());}};_0x3ba87e(++_0x3856f5);}(_0x06f4,0x156));var _0x406f=function(_0x328f0d,_0x17a983){_0x328f0d=_0x328f0d-0x0;var _0x21f434=_0x06f4[_0x328f0d];return _0x21f434;};'use strict';var client=require('../client');exports[_0x406f('0x0')]=function(){return function(){return client[_0x406f('0x1')](_0x406f('0x2'),{'options':{'raw':![],'attributes':['id',_0x406f('0x3'),'timeout',_0x406f('0x4')],'include':[{'model':_0x406f('0x5'),'as':_0x406f('0x6'),'attributes':['id',_0x406f('0x3'),'online',_0x406f('0x7')]}]},'log':_0x406f('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 6b84d44..229be84 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 _0x52e1=['CreateFaxQueueReport','update','Request','UpdateFaxQueueReport','DESC'];(function(_0x2f5787,_0x3c3378){var _0x54e0bb=function(_0x2287ce){while(--_0x2287ce){_0x2f5787['push'](_0x2f5787['shift']());}};_0x54e0bb(++_0x3c3378);}(_0x52e1,0xb9));var _0x152e=function(_0x236906,_0x1c2803){_0x236906=_0x236906-0x0;var _0x21199e=_0x52e1[_0x236906];return _0x21199e;};'use strict';var client=require('../client');exports['create']=function(_0x26853c){return client['Request'](_0x152e('0x0'),{'body':_0x26853c,'log':'CreateFaxQueueReport'});};exports[_0x152e('0x1')]=function(_0x31105d,_0x159327){return client[_0x152e('0x2')](_0x152e('0x3'),{'body':_0x159327,'options':{'where':{'uniqueid':_0x31105d},'order':[['id',_0x152e('0x4')]],'limit':0x1},'log':_0x152e('0x3')});}; \ No newline at end of file +var _0x55c1=['../client','create','CreateFaxQueueReport','update','Request','DESC','UpdateFaxQueueReport'];(function(_0x30df42,_0x640416){var _0x26e24f=function(_0x4bd8e7){while(--_0x4bd8e7){_0x30df42['push'](_0x30df42['shift']());}};_0x26e24f(++_0x640416);}(_0x55c1,0x69));var _0x155c=function(_0x3e806a,_0xa4b9fa){_0x3e806a=_0x3e806a-0x0;var _0x477105=_0x55c1[_0x3e806a];return _0x477105;};'use strict';var client=require(_0x155c('0x0'));exports[_0x155c('0x1')]=function(_0x369c75){return client['Request']('CreateFaxQueueReport',{'body':_0x369c75,'log':_0x155c('0x2')});};exports[_0x155c('0x3')]=function(_0x57e4e1,_0x52bea7){return client[_0x155c('0x4')]('UpdateFaxQueueReport',{'body':_0x52bea7,'options':{'where':{'uniqueid':_0x57e4e1},'order':[['id',_0x155c('0x5')]],'limit':0x1},'log':_0x155c('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index f9f45fd..d9e6e9f 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 _0x8df5=['Interval','Intervals','interval','../client','getIntervals','Request','name'];(function(_0xe84805,_0x2702d9){var _0x398efd=function(_0x37cfad){while(--_0x37cfad){_0xe84805['push'](_0xe84805['shift']());}};_0x398efd(++_0x2702d9);}(_0x8df5,0x6c));var _0x58df=function(_0x241a92,_0xc1acbc){_0x241a92=_0x241a92-0x0;var _0x3837e1=_0x8df5[_0x241a92];return _0x3837e1;};'use strict';var client=require(_0x58df('0x0'));exports[_0x58df('0x1')]=function(){return function(){return client[_0x58df('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x58df('0x3')],'include':[{'model':_0x58df('0x4'),'as':_0x58df('0x5'),'attributes':['id',_0x58df('0x3'),_0x58df('0x6')]}]},'log':_0x58df('0x1')});};}; \ No newline at end of file +var _0x75c6=['../client','getIntervals','name','Interval','Intervals'];(function(_0x5f3e54,_0x2ec7a2){var _0x35cc37=function(_0x286abf){while(--_0x286abf){_0x5f3e54['push'](_0x5f3e54['shift']());}};_0x35cc37(++_0x2ec7a2);}(_0x75c6,0x168));var _0x675c=function(_0x19a11f,_0x6d8be7){_0x19a11f=_0x19a11f-0x0;var _0x51485f=_0x75c6[_0x19a11f];return _0x51485f;};'use strict';var client=require(_0x675c('0x0'));exports[_0x675c('0x1')]=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x675c('0x2')],'include':[{'model':_0x675c('0x3'),'as':_0x675c('0x4'),'attributes':['id',_0x675c('0x2'),'interval']}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index de48363..abf2bc8 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 _0x2da6=['UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x5b2b52,_0x2887c3){var _0x1d432f=function(_0x284a99){while(--_0x284a99){_0x5b2b52['push'](_0x5b2b52['shift']());}};_0x1d432f(++_0x2887c3);}(_0x2da6,0x1dd));var _0x62da=function(_0x7ec6a2,_0x27fbd3){_0x7ec6a2=_0x7ec6a2-0x0;var _0x25156b=_0x2da6[_0x7ec6a2];return _0x25156b;};'use strict';var client=require(_0x62da('0x0'));exports[_0x62da('0x1')]=function(_0x1d3698,_0xbbb39b){return client[_0x62da('0x2')](_0x62da('0x3'),{'body':_0xbbb39b,'options':{'where':{'id':_0x1d3698}},'log':_0x62da('0x4')});};exports[_0x62da('0x5')]=function(_0x4c079d,_0x4a8428){return client[_0x62da('0x2')](_0x62da('0x6'),{'body':_0x4a8428,'options':{'where':{'id':_0x4c079d}},'log':_0x62da('0x7')});}; \ No newline at end of file +var _0x9582=['AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','addTags'];(function(_0x559c75,_0x34d503){var _0x25e208=function(_0xb723a2){while(--_0xb723a2){_0x559c75['push'](_0x559c75['shift']());}};_0x25e208(++_0x34d503);}(_0x9582,0x95));var _0x2958=function(_0x548927,_0x57cb4f){_0x548927=_0x548927-0x0;var _0x378c0e=_0x9582[_0x548927];return _0x378c0e;};'use strict';var client=require(_0x2958('0x0'));exports[_0x2958('0x1')]=function(_0xd87e37,_0x3d6d1f){return client[_0x2958('0x2')](_0x2958('0x3'),{'body':_0x3d6d1f,'options':{'where':{'id':_0xd87e37}},'log':'updateMailInteraction'});};exports[_0x2958('0x4')]=function(_0x3b907e,_0x136c77){return client[_0x2958('0x2')](_0x2958('0x5'),{'body':_0x136c77,'options':{'where':{'id':_0x3b907e}},'log':_0x2958('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 031dcb9..a36ea78 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 _0x25ff=['create','Request','CreateMailMessage','createMailMessage','../client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x25ff,0x12b));var _0xf25f=function(_0x18cd32,_0x326bc4){_0x18cd32=_0x18cd32-0x0;var _0x41eff1=_0x25ff[_0x18cd32];return _0x41eff1;};'use strict';var client=require(_0xf25f('0x0'));exports[_0xf25f('0x1')]=function(_0x3904f3){return client[_0xf25f('0x2')](_0xf25f('0x3'),{'body':_0x3904f3,'log':_0xf25f('0x4')});}; \ No newline at end of file +var _0xd3b7=['createMailMessage','../client','create','Request','CreateMailMessage'];(function(_0x24563c,_0x49d7cd){var _0x14796e=function(_0x3ab3d9){while(--_0x3ab3d9){_0x24563c['push'](_0x24563c['shift']());}};_0x14796e(++_0x49d7cd);}(_0xd3b7,0x16e));var _0x7d3b=function(_0x1c1e77,_0x4b4c84){_0x1c1e77=_0x1c1e77-0x0;var _0x58d6fb=_0xd3b7[_0x1c1e77];return _0x58d6fb;};'use strict';var client=require(_0x7d3b('0x0'));exports[_0x7d3b('0x1')]=function(_0x3ad995){return client[_0x7d3b('0x2')](_0x7d3b('0x3'),{'body':_0x3ad995,'log':_0x7d3b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 288a5a9..8e740d8 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 _0xe236=['name','strategy','User','mailPause','../client','getMailQueues','Request','GetMailQueue'];(function(_0x374b9f,_0x35d296){var _0x4e6423=function(_0x15a880){while(--_0x15a880){_0x374b9f['push'](_0x374b9f['shift']());}};_0x4e6423(++_0x35d296);}(_0xe236,0x1cc));var _0x6e23=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xe236[_0x46e363];return _0x3fb059;};'use strict';var client=require(_0x6e23('0x0'));exports[_0x6e23('0x1')]=function(){return function(){return client[_0x6e23('0x2')](_0x6e23('0x3'),{'options':{'raw':![],'attributes':['id',_0x6e23('0x4'),'timeout',_0x6e23('0x5')],'include':[{'model':_0x6e23('0x6'),'as':'Agents','attributes':['id','name','online',_0x6e23('0x7')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x74d3=['online','../client','getMailQueues','Request','name','strategy','User','Agents'];(function(_0x132080,_0x50ce65){var _0x5a7bca=function(_0x408b9b){while(--_0x408b9b){_0x132080['push'](_0x132080['shift']());}};_0x5a7bca(++_0x50ce65);}(_0x74d3,0x159));var _0x374d=function(_0x4a1315,_0x58b7d5){_0x4a1315=_0x4a1315-0x0;var _0x16125a=_0x74d3[_0x4a1315];return _0x16125a;};'use strict';var client=require(_0x374d('0x0'));exports[_0x374d('0x1')]=function(){return function(){return client[_0x374d('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x374d('0x3'),'timeout',_0x374d('0x4')],'include':[{'model':_0x374d('0x5'),'as':_0x374d('0x6'),'attributes':['id','name',_0x374d('0x7'),'mailPause']}]},'log':_0x374d('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index fe5fda5..c734632 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 _0x0089=['CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','create','Request'];(function(_0xba82df,_0x2785ab){var _0x5e8d07=function(_0x39fd26){while(--_0x39fd26){_0xba82df['push'](_0xba82df['shift']());}};_0x5e8d07(++_0x2785ab);}(_0x0089,0x17e));var _0x9008=function(_0x1690fb,_0x22ffcb){_0x1690fb=_0x1690fb-0x0;var _0xbec96f=_0x0089[_0x1690fb];return _0xbec96f;};'use strict';var client=require(_0x9008('0x0'));exports[_0x9008('0x1')]=function(_0x38b121){return client[_0x9008('0x2')](_0x9008('0x3'),{'body':_0x38b121,'log':_0x9008('0x3')});};exports[_0x9008('0x4')]=function(_0x473981,_0x182ad6){return client[_0x9008('0x2')](_0x9008('0x5'),{'body':_0x182ad6,'options':{'where':{'uniqueid':_0x473981},'order':[['id',_0x9008('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x5e98=['UpdateMailQueueReport','DESC','create','Request','CreateMailQueueReport','update'];(function(_0x4781e0,_0x4651bd){var _0x52afab=function(_0x21febf){while(--_0x21febf){_0x4781e0['push'](_0x4781e0['shift']());}};_0x52afab(++_0x4651bd);}(_0x5e98,0x128));var _0x85e9=function(_0x514082,_0x2a6f04){_0x514082=_0x514082-0x0;var _0x28f141=_0x5e98[_0x514082];return _0x28f141;};'use strict';var client=require('../client');exports[_0x85e9('0x0')]=function(_0x259bae){return client[_0x85e9('0x1')](_0x85e9('0x2'),{'body':_0x259bae,'log':_0x85e9('0x2')});};exports[_0x85e9('0x3')]=function(_0x1a1e5a,_0x208c07){return client[_0x85e9('0x1')](_0x85e9('0x4'),{'body':_0x208c07,'options':{'where':{'uniqueid':_0x1a1e5a},'order':[['id',_0x85e9('0x5')]],'limit':0x1},'log':_0x85e9('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index a18e279..cb6dfbf 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 _0x6d82=['addTags','Request','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x4c6100,_0x3a55cd){var _0x10e3c6=function(_0x3052c9){while(--_0x3052c9){_0x4c6100['push'](_0x4c6100['shift']());}};_0x10e3c6(++_0x3a55cd);}(_0x6d82,0x89));var _0x26d8=function(_0x15ccd7,_0x31cef8){_0x15ccd7=_0x15ccd7-0x0;var _0x5b8dff=_0x6d82[_0x15ccd7];return _0x5b8dff;};'use strict';var client=require(_0x26d8('0x0'));exports['update']=function(_0x56f526,_0x1ac7a0){return client['Request'](_0x26d8('0x1'),{'body':_0x1ac7a0,'options':{'where':{'id':_0x56f526}},'log':_0x26d8('0x2')});};exports[_0x26d8('0x3')]=function(_0x580a25,_0x4858f0){return client[_0x26d8('0x4')](_0x26d8('0x5'),{'body':_0x4858f0,'options':{'where':{'id':_0x580a25}},'log':_0x26d8('0x6')});}; \ No newline at end of file +var _0x0d74=['../client','update','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x5205b1,_0x2c972a){var _0x466c5c=function(_0x51b159){while(--_0x51b159){_0x5205b1['push'](_0x5205b1['shift']());}};_0x466c5c(++_0x2c972a);}(_0x0d74,0x93));var _0x40d7=function(_0x4a23fb,_0x52d9cf){_0x4a23fb=_0x4a23fb-0x0;var _0x14c160=_0x0d74[_0x4a23fb];return _0x14c160;};'use strict';var client=require(_0x40d7('0x0'));exports[_0x40d7('0x1')]=function(_0x395c21,_0x2c3429){return client['Request'](_0x40d7('0x2'),{'body':_0x2c3429,'options':{'where':{'id':_0x395c21}},'log':_0x40d7('0x3')});};exports[_0x40d7('0x4')]=function(_0x5410db,_0x419f00){return client['Request'](_0x40d7('0x5'),{'body':_0x419f00,'options':{'where':{'id':_0x5410db}},'log':_0x40d7('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 8781afc..f8e2d2d 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 _0x6ad1=['create','Request','CreateOpenchannelMessage'];(function(_0x2b8655,_0xc199f8){var _0x9161a6=function(_0x3fddda){while(--_0x3fddda){_0x2b8655['push'](_0x2b8655['shift']());}};_0x9161a6(++_0xc199f8);}(_0x6ad1,0x192));var _0x16ad=function(_0x1f42cf,_0x98d92){_0x1f42cf=_0x1f42cf-0x0;var _0x119c73=_0x6ad1[_0x1f42cf];return _0x119c73;};'use strict';var client=require('../client');exports[_0x16ad('0x0')]=function(_0xffc6e4){return client[_0x16ad('0x1')](_0x16ad('0x2'),{'body':_0xffc6e4,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0x42c3=['create','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x910fc8,_0x1b38e7){var _0x4ff130=function(_0x354882){while(--_0x354882){_0x910fc8['push'](_0x910fc8['shift']());}};_0x4ff130(++_0x1b38e7);}(_0x42c3,0x17f));var _0x342c=function(_0x25b1bf,_0x9e60a3){_0x25b1bf=_0x25b1bf-0x0;var _0x1cf123=_0x42c3[_0x25b1bf];return _0x1cf123;};'use strict';var client=require(_0x342c('0x0'));exports[_0x342c('0x1')]=function(_0x27017f){return client['Request'](_0x342c('0x2'),{'body':_0x27017f,'log':_0x342c('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 1bf85e7..fc66f39 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 _0x2cb6=['timeout','strategy','User','online','openchannelPause','getOpenchannelQueues','Request','GetOpenchannelQueue','name'];(function(_0x4b0cc7,_0x38fdc4){var _0x48cfc5=function(_0x227f8f){while(--_0x227f8f){_0x4b0cc7['push'](_0x4b0cc7['shift']());}};_0x48cfc5(++_0x38fdc4);}(_0x2cb6,0xe6));var _0x62cb=function(_0x200337,_0x2248a5){_0x200337=_0x200337-0x0;var _0x54778f=_0x2cb6[_0x200337];return _0x54778f;};'use strict';var client=require('../client');exports[_0x62cb('0x0')]=function(){return function(){return client[_0x62cb('0x1')](_0x62cb('0x2'),{'options':{'raw':![],'attributes':['id',_0x62cb('0x3'),_0x62cb('0x4'),_0x62cb('0x5')],'include':[{'model':_0x62cb('0x6'),'as':'Agents','attributes':['id',_0x62cb('0x3'),_0x62cb('0x7'),_0x62cb('0x8')]}]},'log':_0x62cb('0x0')});};}; \ No newline at end of file +var _0x504a=['online','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','strategy','Agents','name'];(function(_0x4c6763,_0x3c4c95){var _0x5147a=function(_0x5c79ac){while(--_0x5c79ac){_0x4c6763['push'](_0x4c6763['shift']());}};_0x5147a(++_0x3c4c95);}(_0x504a,0x134));var _0xa504=function(_0x157084,_0x4b431c){_0x157084=_0x157084-0x0;var _0x1714a1=_0x504a[_0x157084];return _0x1714a1;};'use strict';var client=require(_0xa504('0x0'));exports[_0xa504('0x1')]=function(){return function(){return client[_0xa504('0x2')](_0xa504('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xa504('0x4')],'include':[{'model':'User','as':_0xa504('0x5'),'attributes':['id',_0xa504('0x6'),_0xa504('0x7'),_0xa504('0x8')]}]},'log':_0xa504('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 2d77a1d..c931266 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 _0xdbc7=['Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client','create'];(function(_0x59fd76,_0x403b60){var _0x1d0e9c=function(_0x9198de){while(--_0x9198de){_0x59fd76['push'](_0x59fd76['shift']());}};_0x1d0e9c(++_0x403b60);}(_0xdbc7,0x1c5));var _0x7dbc=function(_0x454e6d,_0x1e1f38){_0x454e6d=_0x454e6d-0x0;var _0x4bc294=_0xdbc7[_0x454e6d];return _0x4bc294;};'use strict';var client=require(_0x7dbc('0x0'));exports[_0x7dbc('0x1')]=function(_0x8a2738){return client[_0x7dbc('0x2')](_0x7dbc('0x3'),{'body':_0x8a2738,'log':'CreateOpenchannelQueueReport'});};exports[_0x7dbc('0x4')]=function(_0x3543df,_0x43f504){return client[_0x7dbc('0x2')](_0x7dbc('0x5'),{'body':_0x43f504,'options':{'where':{'uniqueid':_0x3543df},'order':[['id',_0x7dbc('0x6')]],'limit':0x1},'log':_0x7dbc('0x5')});}; \ No newline at end of file +var _0x679e=['create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','../client'];(function(_0x10c26e,_0x3dbc2e){var _0x3c48a3=function(_0x29999c){while(--_0x29999c){_0x10c26e['push'](_0x10c26e['shift']());}};_0x3c48a3(++_0x3dbc2e);}(_0x679e,0x1cd));var _0xe679=function(_0x2967d7,_0x493218){_0x2967d7=_0x2967d7-0x0;var _0x1460f7=_0x679e[_0x2967d7];return _0x1460f7;};'use strict';var client=require(_0xe679('0x0'));exports[_0xe679('0x1')]=function(_0x327949){return client[_0xe679('0x2')](_0xe679('0x3'),{'body':_0x327949,'log':_0xe679('0x3')});};exports[_0xe679('0x4')]=function(_0x3af429,_0x102c64){return client[_0xe679('0x2')](_0xe679('0x5'),{'body':_0x102c64,'options':{'where':{'uniqueid':_0x3af429},'order':[['id','DESC']],'limit':0x1},'log':_0xe679('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 479a86c..a0aca10 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 _0x9d92=['addTagsToSmsInteraction','../client','Request','updateSmsInteraction','addTags','AddTagsToSmsInteraction'];(function(_0x24788c,_0x172aad){var _0x537091=function(_0x17d349){while(--_0x17d349){_0x24788c['push'](_0x24788c['shift']());}};_0x537091(++_0x172aad);}(_0x9d92,0xdf));var _0x29d9=function(_0x2dd390,_0x1bc894){_0x2dd390=_0x2dd390-0x0;var _0x3afe47=_0x9d92[_0x2dd390];return _0x3afe47;};'use strict';var client=require(_0x29d9('0x0'));exports['update']=function(_0x57b238,_0x460466){return client[_0x29d9('0x1')]('UpdateSmsInteraction',{'body':_0x460466,'options':{'where':{'id':_0x57b238}},'log':_0x29d9('0x2')});};exports[_0x29d9('0x3')]=function(_0x18371b,_0x6e12eb){return client[_0x29d9('0x1')](_0x29d9('0x4'),{'body':_0x6e12eb,'options':{'where':{'id':_0x18371b}},'log':_0x29d9('0x5')});}; \ No newline at end of file +var _0x37cc=['update','Request','UpdateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x16af15,_0x55bc76){var _0xfeda8a=function(_0x13ad56){while(--_0x13ad56){_0x16af15['push'](_0x16af15['shift']());}};_0xfeda8a(++_0x55bc76);}(_0x37cc,0x185));var _0xc37c=function(_0x1d0311,_0x3a2e36){_0x1d0311=_0x1d0311-0x0;var _0x122587=_0x37cc[_0x1d0311];return _0x122587;};'use strict';var client=require(_0xc37c('0x0'));exports[_0xc37c('0x1')]=function(_0x461b6f,_0x3ba386){return client[_0xc37c('0x2')](_0xc37c('0x3'),{'body':_0x3ba386,'options':{'where':{'id':_0x461b6f}},'log':'updateSmsInteraction'});};exports['addTags']=function(_0x334d3c,_0x946e3b){return client[_0xc37c('0x2')](_0xc37c('0x4'),{'body':_0x946e3b,'options':{'where':{'id':_0x334d3c}},'log':_0xc37c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index ddf8ce1..fd1ea18 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 _0x0fee=['Request','CreateSmsMessage','createSmsMessage','../client','create'];(function(_0x19d93e,_0x353432){var _0x39c22c=function(_0x492077){while(--_0x492077){_0x19d93e['push'](_0x19d93e['shift']());}};_0x39c22c(++_0x353432);}(_0x0fee,0x94));var _0xe0fe=function(_0x3640fd,_0xd0283){_0x3640fd=_0x3640fd-0x0;var _0x3418d3=_0x0fee[_0x3640fd];return _0x3418d3;};'use strict';var client=require(_0xe0fe('0x0'));exports[_0xe0fe('0x1')]=function(_0x44bea5){return client[_0xe0fe('0x2')](_0xe0fe('0x3'),{'body':_0x44bea5,'log':_0xe0fe('0x4')});}; \ No newline at end of file +var _0x716b=['Request','createSmsMessage','../client','create'];(function(_0x4bc75c,_0x40738c){var _0x4af00d=function(_0x19cd7d){while(--_0x19cd7d){_0x4bc75c['push'](_0x4bc75c['shift']());}};_0x4af00d(++_0x40738c);}(_0x716b,0x1ca));var _0xb716=function(_0x1bc42b,_0x5f38c0){_0x1bc42b=_0x1bc42b-0x0;var _0x193af5=_0x716b[_0x1bc42b];return _0x193af5;};'use strict';var client=require(_0xb716('0x0'));exports[_0xb716('0x1')]=function(_0x339bbd){return client[_0xb716('0x2')]('CreateSmsMessage',{'body':_0x339bbd,'log':_0xb716('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 5363d12..5b78571 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 _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file +var _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x40b468,_0x395dba){var _0x2cb086=function(_0x53ff72){while(--_0x53ff72){_0x40b468['push'](_0x40b468['shift']());}};_0x2cb086(++_0x395dba);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4da356,_0x5235e1){_0x4da356=_0x4da356-0x0;var _0x321b07=_0xcb91[_0x4da356];return _0x321b07;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 1b84877..0c3f689 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 _0x9957=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x4d09a9,_0x4e90f1){var _0x816906=function(_0x5d9aca){while(--_0x5d9aca){_0x4d09a9['push'](_0x4d09a9['shift']());}};_0x816906(++_0x4e90f1);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3){return client[_0x7995('0x2')]('CreateSmsQueueReport',{'body':_0x2722a3,'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x1902b4,_0x462a03){return client['Request'](_0x7995('0x5'),{'body':_0x462a03,'options':{'where':{'uniqueid':_0x1902b4},'order':[['id',_0x7995('0x6')]],'limit':0x1},'log':_0x7995('0x5')});}; \ No newline at end of file +var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x217be2,_0x2d1567){var _0x58da4a=function(_0x4fcd59){while(--_0x4fcd59){_0x217be2['push'](_0x217be2['shift']());}};_0x58da4a(++_0x2d1567);}(_0x9c44,0x178));var _0x49c4=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x9c44[_0x24061a];return _0x82054e;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 681f585..1407a5e 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(_0xa7242e,_0x22572b){var _0x55dbc4=function(_0x54d6f6){while(--_0x54d6f6){_0xa7242e['push'](_0xa7242e['shift']());}};_0x55dbc4(++_0x22572b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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(_0x2ae3e1,_0x1cef9d){var _0x3a7bc8=function(_0x2b05bd){while(--_0x2b05bd){_0x2ae3e1['push'](_0x2ae3e1['shift']());}};_0x3a7bc8(++_0x1cef9d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 cb5328a..6f7ad93 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 _0xb242=['AddTagsToWhatsappInteraction','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags'];(function(_0x31b2a5,_0x2480b4){var _0x198fa4=function(_0x1414b9){while(--_0x1414b9){_0x31b2a5['push'](_0x31b2a5['shift']());}};_0x198fa4(++_0x2480b4);}(_0xb242,0x1f3));var _0x2b24=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0xb242[_0xd09668];return _0x68726;};'use strict';var client=require('../client');exports[_0x2b24('0x0')]=function(_0x151da4,_0x1b9fbb){return client[_0x2b24('0x1')](_0x2b24('0x2'),{'body':_0x1b9fbb,'options':{'where':{'id':_0x151da4}},'log':_0x2b24('0x3')});};exports[_0x2b24('0x4')]=function(_0x481806,_0x494b43){return client[_0x2b24('0x1')](_0x2b24('0x5'),{'body':_0x494b43,'options':{'where':{'id':_0x481806}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x0d91=['update','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','Request','AddTagsToWhatsappInteraction','../client'];(function(_0x1975a2,_0x3d35fa){var _0x3cd52b=function(_0x25b237){while(--_0x25b237){_0x1975a2['push'](_0x1975a2['shift']());}};_0x3cd52b(++_0x3d35fa);}(_0x0d91,0x76));var _0x10d9=function(_0x4d03d6,_0x438a06){_0x4d03d6=_0x4d03d6-0x0;var _0x22752e=_0x0d91[_0x4d03d6];return _0x22752e;};'use strict';var client=require(_0x10d9('0x0'));exports[_0x10d9('0x1')]=function(_0x369f92,_0x37895e){return client['Request'](_0x10d9('0x2'),{'body':_0x37895e,'options':{'where':{'id':_0x369f92}},'log':_0x10d9('0x3')});};exports[_0x10d9('0x4')]=function(_0x56ab5d,_0x2f6e57){return client[_0x10d9('0x5')](_0x10d9('0x6'),{'body':_0x2f6e57,'options':{'where':{'id':_0x56ab5d}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 32839bc..7c516bc 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 _0x11ca=['Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x56bcc5,_0x332b3b){var _0x3c4f02=function(_0x5421c0){while(--_0x5421c0){_0x56bcc5['push'](_0x56bcc5['shift']());}};_0x3c4f02(++_0x332b3b);}(_0x11ca,0x198));var _0xa11c=function(_0x4206fd,_0x20080f){_0x4206fd=_0x4206fd-0x0;var _0x4d7323=_0x11ca[_0x4206fd];return _0x4d7323;};'use strict';var client=require('../client');exports['create']=function(_0x8af7ad){return client[_0xa11c('0x0')](_0xa11c('0x1'),{'body':_0x8af7ad,'log':_0xa11c('0x2')});}; \ No newline at end of file +var _0x66c4=['CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0x397bb2,_0x98192){var _0xab0416=function(_0x203b94){while(--_0x203b94){_0x397bb2['push'](_0x397bb2['shift']());}};_0xab0416(++_0x98192);}(_0x66c4,0xda));var _0x466c=function(_0xcaf544,_0x560224){_0xcaf544=_0xcaf544-0x0;var _0x4584c7=_0x66c4[_0xcaf544];return _0x4584c7;};'use strict';var client=require(_0x466c('0x0'));exports['create']=function(_0x35b68f){return client['Request'](_0x466c('0x1'),{'body':_0x35b68f,'log':_0x466c('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 9c8549d..c6df6e4 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 _0x0749=['timeout','strategy','User','Agents','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name'];(function(_0x14d6ba,_0x484f53){var _0x91dc64=function(_0x22a648){while(--_0x22a648){_0x14d6ba['push'](_0x14d6ba['shift']());}};_0x91dc64(++_0x484f53);}(_0x0749,0x11d));var _0x9074=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x0749[_0x13d07a];return _0x5ee0ee;};'use strict';var client=require(_0x9074('0x0'));exports[_0x9074('0x1')]=function(){return function(){return client[_0x9074('0x2')](_0x9074('0x3'),{'options':{'raw':![],'attributes':['id',_0x9074('0x4'),_0x9074('0x5'),_0x9074('0x6')],'include':[{'model':_0x9074('0x7'),'as':_0x9074('0x8'),'attributes':['id',_0x9074('0x4'),'online',_0x9074('0x9')]}]},'log':_0x9074('0x1')});};}; \ No newline at end of file +var _0xd021=['User','Agents','getWhatsappQueues','Request','GetWhatsappQueue','timeout','strategy'];(function(_0x63500b,_0x508aa1){var _0x492332=function(_0x1dc594){while(--_0x1dc594){_0x63500b['push'](_0x63500b['shift']());}};_0x492332(++_0x508aa1);}(_0xd021,0xa3));var _0x1d02=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd021[_0x321bb2];return _0x9c12ed;};'use strict';var client=require('../client');exports[_0x1d02('0x0')]=function(){return function(){return client[_0x1d02('0x1')](_0x1d02('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x1d02('0x3'),_0x1d02('0x4')],'include':[{'model':_0x1d02('0x5'),'as':_0x1d02('0x6'),'attributes':['id','name','online','whatsappPause']}]},'log':_0x1d02('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 1143ee3..3a26b94 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 _0xed8c=['../client','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC'];(function(_0x22f963,_0x4bb343){var _0x3ef3ee=function(_0x1bbbac){while(--_0x1bbbac){_0x22f963['push'](_0x22f963['shift']());}};_0x3ef3ee(++_0x4bb343);}(_0xed8c,0x18c));var _0xced8=function(_0x2af867,_0x30732d){_0x2af867=_0x2af867-0x0;var _0x38a88b=_0xed8c[_0x2af867];return _0x38a88b;};'use strict';var client=require(_0xced8('0x0'));exports['create']=function(_0x3a0c2b){return client[_0xced8('0x1')](_0xced8('0x2'),{'body':_0x3a0c2b,'log':_0xced8('0x2')});};exports[_0xced8('0x3')]=function(_0x11f61d,_0x18a211){return client['Request'](_0xced8('0x4'),{'body':_0x18a211,'options':{'where':{'uniqueid':_0x11f61d},'order':[['id',_0xced8('0x5')]],'limit':0x1},'log':_0xced8('0x4')});}; \ No newline at end of file +var _0xe6fd=['DESC','UpdateWhatsappQueueReport','../client','create','Request','CreateWhatsappQueueReport','update'];(function(_0x18a417,_0x398cf6){var _0x5e116b=function(_0x49ceb0){while(--_0x49ceb0){_0x18a417['push'](_0x18a417['shift']());}};_0x5e116b(++_0x398cf6);}(_0xe6fd,0x6b));var _0xde6f=function(_0x1f3492,_0x26412a){_0x1f3492=_0x1f3492-0x0;var _0x298e36=_0xe6fd[_0x1f3492];return _0x298e36;};'use strict';var client=require(_0xde6f('0x0'));exports[_0xde6f('0x1')]=function(_0x12b046){return client[_0xde6f('0x2')]('CreateWhatsappQueueReport',{'body':_0x12b046,'log':_0xde6f('0x3')});};exports[_0xde6f('0x4')]=function(_0x494d21,_0x1b41b6){return client[_0xde6f('0x2')]('UpdateWhatsappQueueReport',{'body':_0x1b41b6,'options':{'where':{'uniqueid':_0x494d21},'order':[['id',_0xde6f('0x5')]],'limit':0x1},'log':_0xde6f('0x6')});}; \ 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 35569f6..9c57ac3 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 _0x46f9=['consequence','validate','length','error','[%s][AGENT]\x20%s','map','message','join','agents','timeout','createQueue','atimeout','channel','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][AGENT]\x20ROUTING\x20END','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase'];(function(_0x4ab3fb,_0x776775){var _0x34fe1e=function(_0x1c94c5){while(--_0x1c94c5){_0x4ab3fb['push'](_0x4ab3fb['shift']());}};_0x34fe1e(++_0x776775);}(_0x46f9,0x1ed));var _0x946f=function(_0x1cd69f,_0x106262){_0x1cd69f=_0x1cd69f-0x0;var _0x377214=_0x46f9[_0x1cd69f];return _0x377214;};'use strict';var schema=require('validate');var _=require(_0x946f('0x0'));var util=require(_0x946f('0x1'));var seqqueue=require(_0x946f('0x2'));var logger=require(_0x946f('0x3'))(_0x946f('0x4'));var strategy=require(_0x946f('0x5'));var queue=schema({'name':{'type':'string','required':!![],'message':_0x946f('0x6')},'timeout':{'type':_0x946f('0x7'),'message':_0x946f('0x8')}});function writeLog(_0x32c3d0,_0x5b490e,_0x4d9208){return logger[_0x946f('0x9')](util[_0x946f('0xa')](_0x946f('0xb'),_0x32c3d0,_0x5b490e['name'],_0x4d9208));}function handleFindAgent(_0x23893f){return function(_0x271f27){return _0x271f27[_0x946f('0xc')][_0x946f('0xd')]()===_0x23893f[_0x946f('0xd')]();};}exports[_0x946f('0xe')]=function(_0x6d4b4a,_0x2062b7,_0x535528,_0x551410){return function(_0x51351d){try{var _0x46d425={'name':_0x2062b7[0x0],'timeout':_0x2062b7[0x1]};var _0x36db55=queue[_0x946f('0xf')](_0x46d425,{'typecast':!![]});if(_0x36db55[_0x946f('0x10')]){logger[_0x946f('0x11')](_0x946f('0x12'),_0x6d4b4a,_[_0x946f('0x13')](_0x36db55,_0x946f('0x14'))[_0x946f('0x15')](',\x20'));_0x51351d['stop']();}else{var _0x47714d=_['find'](_0x535528[_0x946f('0x16')],handleFindAgent(_0x46d425[_0x946f('0xc')]));if(_0x47714d){var _0x1a76bf=(_0x46d425[_0x946f('0x17')]||0xa)*0x3e8;var _0x20ad77,_0x28976e;var _0x3b844a=seqqueue[_0x946f('0x18')](_0x1a76bf);_0x3b844a['id']=_0x6d4b4a;_0x3b844a[_0x946f('0x19')]=_0x1a76bf;_0x3b844a['channel']=_0x551410[_0x946f('0x1a')];writeLog(_0x6d4b4a,_0x47714d,util['format']('START:%s',_0x1a76bf));_0x535528[_0x946f('0x1b')][_0x6d4b4a]['on'](_0x946f('0x1c'),function(){logger[_0x946f('0x9')](_0x946f('0x1d'),_0x6d4b4a);clearTimeout(_0x28976e);_0x28976e=undefined;_0x3b844a[_0x946f('0x1e')]();if(_0x535528[_0x946f('0x1b')][_0x6d4b4a]){delete _0x535528[_0x946f('0x1b')][_0x6d4b4a];}_0x51351d[_0x946f('0x1f')]();});_0x535528[_0x946f('0x1b')][_0x6d4b4a]['on'](_0x946f('0x20'),function(){if(_0x535528[_0x946f('0x1b')][_0x6d4b4a]){delete _0x535528[_0x946f('0x1b')][_0x6d4b4a];}});_0x28976e=setTimeout(function(){logger['info'](_0x946f('0x21'),_0x6d4b4a);clearTimeout(_0x28976e);_0x3b844a[_0x946f('0x1e')]();_0x51351d[_0x946f('0x22')]();},_0x1a76bf);strategy['agent'](_0x3b844a,_0x47714d,_0x535528,_0x551410);}else{logger[_0x946f('0x11')](_0x946f('0x23'),_0x6d4b4a,_0x46d425[_0x946f('0xc')]);_0x51351d['stop']();}}}catch(_0xf03d85){console[_0x946f('0x24')](_0xf03d85);logger[_0x946f('0x11')](_0x946f('0x25'),_0x6d4b4a,_0xf03d85[_0x946f('0x26')]);_0x51351d[_0x946f('0x1f')]();}};}; \ No newline at end of file +var _0x1099=['timeout','atimeout','channel','format','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','agent','error','[%s][QUEUE]\x20%s','stack','validate','lodash','util','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','name','toLowerCase','consequence','length','message','join','stop','find','agents'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x1099,0xed));var _0x9109=function(_0x45d228,_0x164d7e){_0x45d228=_0x45d228-0x0;var _0x208ed8=_0x1099[_0x45d228];return _0x208ed8;};'use strict';var schema=require(_0x9109('0x0'));var _=require(_0x9109('0x1'));var util=require(_0x9109('0x2'));var seqqueue=require('seq-queue');var logger=require('../../../../config/logger')(_0x9109('0x3'));var strategy=require(_0x9109('0x4'));var queue=schema({'name':{'type':_0x9109('0x5'),'required':!![],'message':_0x9109('0x6')},'timeout':{'type':_0x9109('0x7'),'message':_0x9109('0x8')}});function writeLog(_0x5273c1,_0x448d2a,_0x535d10){return logger[_0x9109('0x9')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x5273c1,_0x448d2a[_0x9109('0xa')],_0x535d10));}function handleFindAgent(_0x1d296b){return function(_0x197370){return _0x197370['name'][_0x9109('0xb')]()===_0x1d296b[_0x9109('0xb')]();};}exports[_0x9109('0xc')]=function(_0x3e5777,_0x3eb3d4,_0x29ec87,_0x328d35){return function(_0x2cfe24){try{var _0x12bee7={'name':_0x3eb3d4[0x0],'timeout':_0x3eb3d4[0x1]};var _0x260293=queue[_0x9109('0x0')](_0x12bee7,{'typecast':!![]});if(_0x260293[_0x9109('0xd')]){logger['error']('[%s][AGENT]\x20%s',_0x3e5777,_['map'](_0x260293,_0x9109('0xe'))[_0x9109('0xf')](',\x20'));_0x2cfe24[_0x9109('0x10')]();}else{var _0x3eb7e5=_[_0x9109('0x11')](_0x29ec87[_0x9109('0x12')],handleFindAgent(_0x12bee7[_0x9109('0xa')]));if(_0x3eb7e5){var _0x349e88=(_0x12bee7[_0x9109('0x13')]||0xa)*0x3e8;var _0x13e6ef,_0x14dc65;var _0x55f3d9=seqqueue['createQueue'](_0x349e88);_0x55f3d9['id']=_0x3e5777;_0x55f3d9[_0x9109('0x14')]=_0x349e88;_0x55f3d9[_0x9109('0x15')]=_0x328d35[_0x9109('0x15')];writeLog(_0x3e5777,_0x3eb7e5,util[_0x9109('0x16')](_0x9109('0x17'),_0x349e88));_0x29ec87[_0x9109('0x18')][_0x3e5777]['on'](_0x9109('0x19'),function(){logger[_0x9109('0x9')](_0x9109('0x1a'),_0x3e5777);clearTimeout(_0x14dc65);_0x14dc65=undefined;_0x55f3d9['close']();if(_0x29ec87[_0x9109('0x18')][_0x3e5777]){delete _0x29ec87[_0x9109('0x18')][_0x3e5777];}_0x2cfe24[_0x9109('0x10')]();});_0x29ec87['rules'][_0x3e5777]['on'](_0x9109('0x1b'),function(){if(_0x29ec87[_0x9109('0x18')][_0x3e5777]){delete _0x29ec87[_0x9109('0x18')][_0x3e5777];}});_0x14dc65=setTimeout(function(){logger[_0x9109('0x9')]('[%s][AGENT]\x20ROUTING\x20END',_0x3e5777);clearTimeout(_0x14dc65);_0x55f3d9['close']();_0x2cfe24['next']();},_0x349e88);strategy[_0x9109('0x1c')](_0x55f3d9,_0x3eb7e5,_0x29ec87,_0x328d35);}else{logger[_0x9109('0x1d')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x3e5777,_0x12bee7[_0x9109('0xa')]);_0x2cfe24[_0x9109('0x10')]();}}}catch(_0x8a0132){console['log'](_0x8a0132);logger[_0x9109('0x1d')](_0x9109('0x1e'),_0x3e5777,_0x8a0132[_0x9109('0x1f')]);_0x2cfe24['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 3e3a2d6..aadc161 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 _0x29c8=['postText','amazonlex','providerName','providerResponse','stringify','dialogState','Failed','moment','aws-sdk','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','AccountId','account','upperFirst','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','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'];(function(_0x3cc704,_0x2bc0e7){var _0x540a68=function(_0x2aafa4){while(--_0x2aafa4){_0x3cc704['push'](_0x3cc704['shift']());}};_0x540a68(++_0x2bc0e7);}(_0x29c8,0x173));var _0x829c=function(_0x5915a0,_0x127307){_0x5915a0=_0x5915a0-0x0;var _0x136ead=_0x29c8[_0x5915a0];return _0x136ead;};'use strict';var _=require('lodash');var moment=require(_0x829c('0x0'));var AWS=require(_0x829c('0x1'));var utils=require(_0x829c('0x2'));var logger=require('../../../../config/logger')(_0x829c('0x3'));var rpc={'chatMessage':require(_0x829c('0x4')),'openchannelMessage':require(_0x829c('0x5')),'mailMessage':require(_0x829c('0x6')),'smsMessage':require(_0x829c('0x7')),'faxMessage':require(_0x829c('0x8')),'whatsappMessage':require(_0x829c('0x9'))};exports['consequence']=function(_0x38243e,_0xb393d1){return function(_0x8dff1b){try{if(!_[_0x829c('0xa')](this[_0x829c('0xb')]['UserId'])){logger[_0x829c('0xc')](_0x829c('0xd'),_0x38243e,_0x829c('0xe'));return _0x8dff1b[_0x829c('0xf')]();}var _0x5d4ebc={'ContactId':this[_0x829c('0x10')]['id'],'sentAt':moment()[_0x829c('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x829c('0x12')};if(this[_0x829c('0x13')]===_0x829c('0x14')||this[_0x829c('0x13')]===_0x829c('0x15')){_0x5d4ebc['phone']=this[_0x829c('0xb')][_0x829c('0x16')];}var _0x556469=this['channel'];if(_0x556469===_0x829c('0x17')){_0x5d4ebc[_0x829c('0x18')]=this['account']['id'];}else{_0x5d4ebc[_['upperFirst'](_0x556469)+_0x829c('0x19')]=this[_0x829c('0x1a')]['id'];}_0x5d4ebc[_[_0x829c('0x1b')](_0x556469)+'InteractionId']=this[_0x829c('0xb')]['id'];if(this['interaction'][_0x829c('0x1c')]){var _0x3c6988=_0xb393d1[0x4];if(!_[_0x829c('0x1d')](_0x3c6988)){_0x5d4ebc[_0x829c('0x1e')]=utils[_0x829c('0x1f')](_0x3c6988,this);return rpc[_0x556469+_0x829c('0x20')][_0x829c('0x21')](_0x5d4ebc)[_0x829c('0x22')](function(_0x2d7970){logger[_0x829c('0xc')](_0x829c('0xd'),_0x38243e,_0x5d4ebc['body']);})[_0x829c('0x23')](function(_0x208aaa){logger[_0x829c('0x24')](_0x829c('0xd'),_0x38243e,JSON['stringify'](_0x208aaa));})[_0x829c('0x25')](function(){logger['info'](_0x829c('0x26'),_0x38243e);_0x8dff1b[_0x829c('0x27')]();});}else{logger[_0x829c('0xc')](_0x829c('0x28'),_0x38243e);_0x8dff1b[_0x829c('0x27')]();}}else{var _0x3c33c1=this;var _0x58d0df=new AWS[(_0x829c('0x29'))]({'accessKeyId':_0xb393d1[0x0],'secretAccessKey':_0xb393d1[0x1],'region':_0xb393d1[0x2]});var _0x127aae={'botAlias':_0x829c('0x2a'),'botName':_0xb393d1[0x3],'inputText':this[_0x829c('0x2b')][_0x829c('0x1e')],'userId':this['channel']+':'+this[_0x829c('0xb')]['id'][_0x829c('0x2c')]()};_0x58d0df[_0x829c('0x2d')](_0x127aae,function(_0x575ee9,_0x3fe542){if(_0x575ee9){logger[_0x829c('0x24')](_0x829c('0xd'),_0x38243e,_0x575ee9[_0x829c('0x2b')]);_0x8dff1b['next']();}else if(_0x3fe542&&_0x3fe542[_0x829c('0x2b')]){_0x3c33c1[_0x829c('0x1e')][_0x829c('0x2e')]=_0x3fe542;_0x5d4ebc[_0x829c('0x1e')]=_0x3fe542[_0x829c('0x2b')];_0x5d4ebc[_0x829c('0x2f')]=_0x829c('0x2e');_0x5d4ebc[_0x829c('0x30')]=JSON[_0x829c('0x31')](_0x3fe542);return rpc[_0x556469+_0x829c('0x20')][_0x829c('0x21')](_0x5d4ebc)[_0x829c('0x22')](function(_0x13c8eb){logger[_0x829c('0xc')](_0x829c('0xd'),_0x38243e,_0x5d4ebc[_0x829c('0x1e')]);if(_0x3fe542[_0x829c('0x32')]==_0x829c('0x33')){_0x8dff1b['next']();}else{_0x8dff1b[_0x829c('0x27')]();}})[_0x829c('0x23')](function(_0x31b1bf){logger[_0x829c('0x24')](_0x829c('0xd'),_0x38243e,JSON[_0x829c('0x31')](_0x31b1bf));_0x8dff1b[_0x829c('0xf')]();});}else{_0x8dff1b[_0x829c('0xf')]();}});}}catch(_0x4a990e){logger[_0x829c('0x24')]('[%s][AMAZONLEX]\x20%s',_0x38243e,JSON[_0x829c('0x31')](_0x4a990e));_0x8dff1b['stop']();}};}; \ No newline at end of file +var _0x7201=['UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','created','isEmpty','body','getMustacheRender','Message','create','then','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','providerName','amazonlex','dialogState','Failed','error','lodash','moment','aws-sdk','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','consequence','isNil','interaction'];(function(_0x3c2e6b,_0x12f686){var _0x4ddeb7=function(_0x5d8a22){while(--_0x5d8a22){_0x3c2e6b['push'](_0x3c2e6b['shift']());}};_0x4ddeb7(++_0x12f686);}(_0x7201,0x1cc));var _0x1720=function(_0xb763c9,_0x1d5fcf){_0xb763c9=_0xb763c9-0x0;var _0x387124=_0x7201[_0xb763c9];return _0x387124;};'use strict';var _=require(_0x1720('0x0'));var moment=require(_0x1720('0x1'));var AWS=require(_0x1720('0x2'));var utils=require('./utils');var logger=require(_0x1720('0x3'))('routing');var rpc={'chatMessage':require(_0x1720('0x4')),'openchannelMessage':require(_0x1720('0x5')),'mailMessage':require(_0x1720('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x1720('0x7')]=function(_0x32b56c,_0x1ff4e0){return function(_0x104439){try{if(!_[_0x1720('0x8')](this[_0x1720('0x9')][_0x1720('0xa')])){logger[_0x1720('0xb')](_0x1720('0xc'),_0x32b56c,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x104439[_0x1720('0xd')]();}var _0x53098b={'ContactId':this[_0x1720('0xe')]['id'],'sentAt':moment()[_0x1720('0xf')](_0x1720('0x10')),'direction':_0x1720('0x11')};if(this[_0x1720('0x12')]===_0x1720('0x13')||this[_0x1720('0x12')]===_0x1720('0x14')){_0x53098b[_0x1720('0x15')]=this[_0x1720('0x9')][_0x1720('0x15')];}var _0x10f683=this[_0x1720('0x12')];if(_0x10f683===_0x1720('0x16')){_0x53098b[_0x1720('0x17')]=this['account']['id'];}else{_0x53098b[_[_0x1720('0x18')](_0x10f683)+'AccountId']=this['account']['id'];}_0x53098b[_[_0x1720('0x18')](_0x10f683)+'InteractionId']=this['interaction']['id'];if(this[_0x1720('0x9')][_0x1720('0x19')]){var _0x26f712=_0x1ff4e0[0x4];if(!_[_0x1720('0x1a')](_0x26f712)){_0x53098b[_0x1720('0x1b')]=utils[_0x1720('0x1c')](_0x26f712,this);return rpc[_0x10f683+_0x1720('0x1d')][_0x1720('0x1e')](_0x53098b)[_0x1720('0x1f')](function(_0x4d24b1){logger[_0x1720('0xb')](_0x1720('0xc'),_0x32b56c,_0x53098b[_0x1720('0x1b')]);})['catch'](function(_0x4fffdd){logger['error'](_0x1720('0xc'),_0x32b56c,JSON[_0x1720('0x20')](_0x4fffdd));})[_0x1720('0x21')](function(){logger['info'](_0x1720('0x22'),_0x32b56c);_0x104439[_0x1720('0x23')]();});}else{logger[_0x1720('0xb')](_0x1720('0x24'),_0x32b56c);_0x104439['stop']();}}else{var _0x16b8ce=this;var _0x37da9e=new AWS[(_0x1720('0x25'))]({'accessKeyId':_0x1ff4e0[0x0],'secretAccessKey':_0x1ff4e0[0x1],'region':_0x1ff4e0[0x2]});var _0x16380c={'botAlias':_0x1720('0x26'),'botName':_0x1ff4e0[0x3],'inputText':this[_0x1720('0x27')][_0x1720('0x1b')],'userId':this[_0x1720('0x12')]+':'+this['interaction']['id'][_0x1720('0x28')]()};_0x37da9e[_0x1720('0x29')](_0x16380c,function(_0x33e3a2,_0x49c337){if(_0x33e3a2){logger['error'](_0x1720('0xc'),_0x32b56c,_0x33e3a2['message']);_0x104439[_0x1720('0xd')]();}else if(_0x49c337&&_0x49c337[_0x1720('0x27')]){_0x16b8ce[_0x1720('0x1b')]['amazonlex']=_0x49c337;_0x53098b['body']=_0x49c337[_0x1720('0x27')];_0x53098b[_0x1720('0x2a')]=_0x1720('0x2b');_0x53098b['providerResponse']=JSON[_0x1720('0x20')](_0x49c337);return rpc[_0x10f683+_0x1720('0x1d')][_0x1720('0x1e')](_0x53098b)[_0x1720('0x1f')](function(_0x1f175a){logger[_0x1720('0xb')](_0x1720('0xc'),_0x32b56c,_0x53098b[_0x1720('0x1b')]);if(_0x49c337[_0x1720('0x2c')]==_0x1720('0x2d')){_0x104439[_0x1720('0xd')]();}else{_0x104439[_0x1720('0x23')]();}})['catch'](function(_0x313c25){logger['error']('[%s][AMAZONLEX]\x20%s',_0x32b56c,JSON[_0x1720('0x20')](_0x313c25));_0x104439[_0x1720('0xd')]();});}else{_0x104439['next']();}});}}catch(_0x4f2b72){logger[_0x1720('0x2e')](_0x1720('0xc'),_0x32b56c,JSON[_0x1720('0x20')](_0x4f2b72));_0x104439['stop']();}};}; \ 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 4ebb104..0473c12 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 _0x4a95=['channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','created','interaction','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','format','out','getMustacheRender','message','from','phone','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','inReplyTo','html','','';_0xf13ff1[_0x54a9('0x32')]={'Auto-Submitted':_0x54a9('0x33'),'X-Auto-Response-Suppress':_0x54a9('0x34'),'Precedence':_0x54a9('0x35')};return mailRpc['sendMailMessage'](this[_0x54a9('0x2b')]['smtpOptions'],_0xf13ff1)[_0x54a9('0x36')](function(_0x37448f){logger[_0x54a9('0x13')](_0x54a9('0x37'),_0x4f4fbf);_0xf13ff1[_0x54a9('0x38')]=_0x37448f['message'][_0x54a9('0x38')];return rpc[_0x16c56d+_0x54a9('0x39')][_0x54a9('0x3a')](_0xf13ff1);})[_0x54a9('0x36')](function(_0x3cf0e0){logger[_0x54a9('0x13')](_0x54a9('0x14'),_0x4f4fbf,JSON[_0x54a9('0x3b')](_0x3cf0e0));})[_0x54a9('0x3c')](function(_0x48903d){logger[_0x54a9('0x3d')](_0x54a9('0x3e'),_0x4f4fbf,JSON[_0x54a9('0x3b')](_0x48903d));})[_0x54a9('0x3f')](function(){Promise[_0x54a9('0x40')]()['then'](function(){if(_0x5708ac[0x0]!=='2'||_0x16c6a0[_0x54a9('0x1a')])return;return rpc[_0x16c56d+'Interaction'][_0x54a9('0x41')](_0x16c6a0['id'],{'autoreplyExecuted':!![]})[_0x54a9('0x36')](function(_0x274a02){logger[_0x54a9('0x13')](_0x54a9('0x42'),_0x4f4fbf,JSON[_0x54a9('0x3b')](_0x274a02));})[_0x54a9('0x3c')](function(_0x7c46a5){logger[_0x54a9('0x3d')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4f4fbf,JSON[_0x54a9('0x3b')](_0x7c46a5));});})[_0x54a9('0x36')](function(){_0x4493fa[_0x54a9('0x16')]();});});}else{return rpc[this[_0x54a9('0xf')]+_0x54a9('0x39')][_0x54a9('0x3a')](_0xf13ff1)[_0x54a9('0x36')](function(){logger['info'](_0x54a9('0x14'),_0x4f4fbf,_0xf13ff1['body']);})['catch'](function(_0x12f904){logger[_0x54a9('0x3d')](_0x54a9('0x14'),_0x4f4fbf,JSON[_0x54a9('0x3b')](_0x12f904));})['finally'](function(){Promise[_0x54a9('0x40')]()[_0x54a9('0x36')](function(){if(_0x5708ac[0x0]!=='2'||_0x16c6a0[_0x54a9('0x1a')])return;return rpc[_0x16c56d+_0x54a9('0x43')]['update'](_0x16c6a0['id'],{'autoreplyExecuted':!![]})[_0x54a9('0x36')](function(_0x50d44b){logger['info'](_0x54a9('0x42'),_0x4f4fbf,JSON[_0x54a9('0x3b')](_0x50d44b));})[_0x54a9('0x3c')](function(_0x38a72d){logger[_0x54a9('0x3d')](_0x54a9('0x44'),_0x4f4fbf,JSON[_0x54a9('0x3b')](_0x38a72d));});})[_0x54a9('0x36')](function(){_0x4493fa[_0x54a9('0x16')]();});});}}}catch(_0x42257e){logger[_0x54a9('0x3d')](_0x54a9('0x14'),_0x4f4fbf,JSON['stringify'](_0x42257e));_0x4493fa[_0x54a9('0x45')]();}};}; \ No newline at end of file +var _0x2365=['then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','resolve','autoreplyExecuted','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','finally','Interaction','stop','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','next','isNil','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','messageId','html','','replace','';_0x328c8a['headers']={'Auto-Submitted':_0x5236('0x32'),'X-Auto-Response-Suppress':_0x5236('0x33'),'Precedence':_0x5236('0x34')};return mailRpc['sendMailMessage'](this[_0x5236('0x27')]['smtpOptions'],_0x328c8a)[_0x5236('0x35')](function(_0x372145){logger['info'](_0x5236('0x36'),_0x362639);_0x328c8a['messageId']=_0x372145[_0x5236('0x1e')][_0x5236('0x2c')];return rpc[_0x345a75+_0x5236('0x2b')][_0x5236('0x37')](_0x328c8a);})[_0x5236('0x35')](function(_0x23f552){logger['info'](_0x5236('0x15'),_0x362639,JSON[_0x5236('0x38')](_0x23f552));})[_0x5236('0x39')](function(_0xf223fe){logger[_0x5236('0x3a')]('[RPC][%s][AUTOREPLY]\x20%s',_0x362639,JSON[_0x5236('0x38')](_0xf223fe));})['finally'](function(){Promise[_0x5236('0x3b')]()['then'](function(){if(_0x286223[0x0]!=='2'||_0x4b4440[_0x5236('0x3c')])return;return rpc[_0x345a75+'Interaction'][_0x5236('0x3d')](_0x4b4440['id'],{'autoreplyExecuted':!![]})[_0x5236('0x35')](function(_0x656094){logger[_0x5236('0x14')](_0x5236('0x17'),_0x362639,JSON[_0x5236('0x38')](_0x656094));})[_0x5236('0x39')](function(_0x1d1765){logger[_0x5236('0x3a')](_0x5236('0x3e'),_0x362639,JSON[_0x5236('0x38')](_0x1d1765));});})[_0x5236('0x35')](function(){_0x175750[_0x5236('0x10')]();});});}else{return rpc[this['channel']+_0x5236('0x2b')][_0x5236('0x37')](_0x328c8a)[_0x5236('0x35')](function(){logger[_0x5236('0x14')]('[%s][AUTOREPLY]\x20%s',_0x362639,_0x328c8a['body']);})['catch'](function(_0x7b06c6){logger[_0x5236('0x3a')](_0x5236('0x15'),_0x362639,JSON[_0x5236('0x38')](_0x7b06c6));})[_0x5236('0x3f')](function(){Promise['resolve']()[_0x5236('0x35')](function(){if(_0x286223[0x0]!=='2'||_0x4b4440['autoreplyExecuted'])return;return rpc[_0x345a75+_0x5236('0x40')]['update'](_0x4b4440['id'],{'autoreplyExecuted':!![]})[_0x5236('0x35')](function(_0x2487a5){logger[_0x5236('0x14')](_0x5236('0x17'),_0x362639,JSON[_0x5236('0x38')](_0x2487a5));})[_0x5236('0x39')](function(_0x1804d8){logger[_0x5236('0x3a')](_0x5236('0x3e'),_0x362639,JSON[_0x5236('0x38')](_0x1804d8));});})[_0x5236('0x35')](function(){_0x175750[_0x5236('0x10')]();});});}}}catch(_0x494f50){logger[_0x5236('0x3a')](_0x5236('0x15'),_0x362639,JSON[_0x5236('0x38')](_0x494f50));_0x175750[_0x5236('0x41')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 2abc293..bcb7921 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9583=['system','Interaction','channel','update','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','finally','stringify','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x9583,0x7f));var _0x3958=function(_0x2df08b,_0x2e5c7d){_0x2df08b=_0x2df08b-0x0;var _0x1c3d47=_0x9583[_0x2df08b];return _0x1c3d47;};'use strict';var moment=require(_0x3958('0x0'));var logger=require(_0x3958('0x1'))(_0x3958('0x2'));var rpc={'chatInteraction':require(_0x3958('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x3958('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x3958('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x3958('0x6')]=function(_0x355613,_0x20b671,_0x249cf9,_0x4e5cca){return function(_0x6ad102){try{logger[_0x3958('0x7')](_0x3958('0x8'),_0x355613,_0x20b671[0x0]);var _0x2714e4={'closed':0x1,'closedAt':moment()[_0x3958('0x9')](_0x3958('0xa')),'closeReason':_0x3958('0xb'),'disposition':_0x20b671[0x0]};if(rpc[_0x4e5cca['channel']+_0x3958('0xc')]){rpc[_0x4e5cca[_0x3958('0xd')]+_0x3958('0xc')][_0x3958('0xe')](_0x4e5cca['interaction']['id'],_0x2714e4)[_0x3958('0xf')](function(_0x271d1e){logger['info'](_0x3958('0x10'),_0x355613,_0x4e5cca['interaction']['id']);})[_0x3958('0x11')](function(_0x3c6aab){logger[_0x3958('0x12')](_0x3958('0x13'),_0x355613,JSON['stringify'](_0x3c6aab));})[_0x3958('0x14')](function(){_0x6ad102['stop']();});}}catch(_0x2d8426){logger[_0x3958('0x12')](_0x3958('0x13'),_0x355613,JSON[_0x3958('0x15')](_0x2d8426));_0x6ad102[_0x3958('0x16')]();}};}; \ No newline at end of file +var _0xf9bc=['format','YYYY-MM-DD\x20HH:mm:ss','system','channel','interaction','then','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xf9bc,0x132));var _0xcf9b=function(_0x148202,_0x132b6a){_0x148202=_0x148202-0x0;var _0x1b15ad=_0xf9bc[_0x148202];return _0x1b15ad;};'use strict';var moment=require(_0xcf9b('0x0'));var logger=require('../../../../config/logger')(_0xcf9b('0x1'));var rpc={'chatInteraction':require(_0xcf9b('0x2')),'openchannelInteraction':require(_0xcf9b('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xcf9b('0x4')),'faxInteraction':require(_0xcf9b('0x5')),'whatsappInteraction':require(_0xcf9b('0x6'))};exports['consequence']=function(_0x53cc85,_0x51d66b,_0x52de4a,_0x134e8c){return function(_0x2bd36a){try{logger[_0xcf9b('0x7')](_0xcf9b('0x8'),_0x53cc85,_0x51d66b[0x0]);var _0x38f957={'closed':0x1,'closedAt':moment()[_0xcf9b('0x9')](_0xcf9b('0xa')),'closeReason':_0xcf9b('0xb'),'disposition':_0x51d66b[0x0]};if(rpc[_0x134e8c[_0xcf9b('0xc')]+'Interaction']){rpc[_0x134e8c[_0xcf9b('0xc')]+'Interaction']['update'](_0x134e8c[_0xcf9b('0xd')]['id'],_0x38f957)[_0xcf9b('0xe')](function(_0x3cb8f2){logger[_0xcf9b('0x7')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x53cc85,_0x134e8c[_0xcf9b('0xd')]['id']);})[_0xcf9b('0xf')](function(_0x30f898){logger[_0xcf9b('0x10')](_0xcf9b('0x11'),_0x53cc85,JSON[_0xcf9b('0x12')](_0x30f898));})[_0xcf9b('0x13')](function(){_0x2bd36a[_0xcf9b('0x14')]();});}}catch(_0x4e2395){logger[_0xcf9b('0x10')](_0xcf9b('0x11'),_0x53cc85,JSON[_0xcf9b('0x12')](_0x4e2395));_0x2bd36a[_0xcf9b('0x14')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index dc01135..f81d921 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02ca=['create','then','metadata','endConversation','lodash','apiai-promise','md5','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','out','channel','sms','phone','interaction','chat','ChatWebsiteId','account','AccountId','InteractionId','created','isEmpty','getMustacheRender','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','message','body','dialogflow','result','fulfillment','providerResponse','Message'];(function(_0x3380e3,_0x483e4a){var _0x384a4d=function(_0x359e7c){while(--_0x359e7c){_0x3380e3['push'](_0x3380e3['shift']());}};_0x384a4d(++_0x483e4a);}(_0x02ca,0x97));var _0xa02c=function(_0x592bf4,_0x2be82f){_0x592bf4=_0x592bf4-0x0;var _0x1a4f6f=_0x02ca[_0x592bf4];return _0x1a4f6f;};'use strict';var _=require(_0xa02c('0x0'));var moment=require('moment');var apiai=require(_0xa02c('0x1'));var md5=require(_0xa02c('0x2'));var utils=require(_0xa02c('0x3'));var logger=require(_0xa02c('0x4'))('routing');var rpc={'chatMessage':require(_0xa02c('0x5')),'openchannelMessage':require(_0xa02c('0x6')),'mailMessage':require(_0xa02c('0x7')),'smsMessage':require(_0xa02c('0x8')),'faxMessage':require(_0xa02c('0x9')),'whatsappMessage':require(_0xa02c('0xa'))};exports[_0xa02c('0xb')]=function(_0x29c64a,_0x2c87ec){return function(_0x2b96c5){try{if(!_[_0xa02c('0xc')](this['interaction'][_0xa02c('0xd')])){logger[_0xa02c('0xe')](_0xa02c('0xf'),_0x29c64a,_0xa02c('0x10'));return _0x2b96c5[_0xa02c('0x11')]();}var _0x565373={'ContactId':this['contact']['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xa02c('0x12')};if(this[_0xa02c('0x13')]===_0xa02c('0x14')||this[_0xa02c('0x13')]==='whatsapp'){_0x565373[_0xa02c('0x15')]=this[_0xa02c('0x16')][_0xa02c('0x15')];}var _0x44faff=this['channel'];if(_0x44faff===_0xa02c('0x17')){_0x565373[_0xa02c('0x18')]=this[_0xa02c('0x19')]['id'];}else{_0x565373[_['upperFirst'](_0x44faff)+_0xa02c('0x1a')]=this[_0xa02c('0x19')]['id'];}_0x565373[_['upperFirst'](_0x44faff)+_0xa02c('0x1b')]=this[_0xa02c('0x16')]['id'];if(this['interaction'][_0xa02c('0x1c')]){var _0x2eef88=_0x2c87ec[0x2];if(!_[_0xa02c('0x1d')](_0x2eef88)){_0x565373['body']=utils[_0xa02c('0x1e')](_0x2eef88,this);return rpc[_0x44faff+'Message']['create'](_0x565373)['then'](function(_0x3fcc66){logger[_0xa02c('0xe')](_0xa02c('0xf'),_0x29c64a,_0x565373['body']);})[_0xa02c('0x1f')](function(_0x566266){logger[_0xa02c('0x20')](_0xa02c('0xf'),_0x29c64a,JSON[_0xa02c('0x21')](_0x566266));})[_0xa02c('0x22')](function(){logger['info'](_0xa02c('0x23'),_0x29c64a);_0x2b96c5['stop']();});}else{logger[_0xa02c('0xe')](_0xa02c('0x24'),_0x29c64a);_0x2b96c5[_0xa02c('0x25')]();}}else{var _0x5b10b4=this;var _0x4787c7=apiai(_0x2c87ec[0x0],{'language':_0x2c87ec[0x1]||'en'});return _0x4787c7['textRequest'](this[_0xa02c('0x26')][_0xa02c('0x27')],{'sessionId':md5(this[_0xa02c('0x16')]['id'])})['then'](function(_0x4ba050){_0x5b10b4[_0xa02c('0x27')][_0xa02c('0x28')]=_0x4ba050;_0x565373[_0xa02c('0x27')]=_0x4ba050[_0xa02c('0x29')][_0xa02c('0x2a')]['speech'];_0x565373['providerName']=_0xa02c('0x28');_0x565373[_0xa02c('0x2b')]=JSON[_0xa02c('0x21')](_0x4ba050);return rpc[_0x44faff+_0xa02c('0x2c')][_0xa02c('0x2d')](_0x565373)[_0xa02c('0x2e')](function(_0x279d79){logger[_0xa02c('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x29c64a,_0x565373[_0xa02c('0x27')]);if(_0x4ba050[_0xa02c('0x29')][_0xa02c('0x2f')][_0xa02c('0x30')]){_0x2b96c5[_0xa02c('0x11')]();}else{_0x2b96c5[_0xa02c('0x25')]();}})[_0xa02c('0x1f')](function(_0x1dfc2c){logger[_0xa02c('0x20')]('[%s][DIALOGFLOW]\x20%s',_0x29c64a,JSON[_0xa02c('0x21')](_0x1dfc2c));_0x2b96c5[_0xa02c('0x11')]();});})[_0xa02c('0x1f')](function(_0x4de1ac){logger['error'](_0xa02c('0xf'),_0x29c64a,_0x4de1ac[_0xa02c('0x26')]);_0x2b96c5[_0xa02c('0x11')]();});}}catch(_0x169bef){logger[_0xa02c('0x20')](_0xa02c('0xf'),_0x29c64a,JSON[_0xa02c('0x21')](_0x169bef));_0x2b96c5[_0xa02c('0x25')]();}};}; \ No newline at end of file +var _0x2dc3=['getMustacheRender','Message','create','body','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','then','dialogflow','speech','result','metadata','endConversation','next','catch','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','consequence','interaction','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','ChatWebsiteId','account','AccountId','upperFirst','created','isEmpty'];(function(_0x290867,_0x3e2004){var _0x52513c=function(_0x259717){while(--_0x259717){_0x290867['push'](_0x290867['shift']());}};_0x52513c(++_0x3e2004);}(_0x2dc3,0x127));var _0x32dc=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x2dc3[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var moment=require(_0x32dc('0x0'));var apiai=require(_0x32dc('0x1'));var md5=require(_0x32dc('0x2'));var utils=require(_0x32dc('0x3'));var logger=require(_0x32dc('0x4'))(_0x32dc('0x5'));var rpc={'chatMessage':require(_0x32dc('0x6')),'openchannelMessage':require(_0x32dc('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x32dc('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x32dc('0x9')]=function(_0x52336b,_0x8f2cea){return function(_0x491a56){try{if(!_['isNil'](this[_0x32dc('0xa')]['UserId'])){logger[_0x32dc('0xb')](_0x32dc('0xc'),_0x52336b,_0x32dc('0xd'));return _0x491a56['next']();}var _0x4b368d={'ContactId':this[_0x32dc('0xe')]['id'],'sentAt':moment()[_0x32dc('0xf')](_0x32dc('0x10')),'direction':_0x32dc('0x11')};if(this[_0x32dc('0x12')]===_0x32dc('0x13')||this[_0x32dc('0x12')]==='whatsapp'){_0x4b368d[_0x32dc('0x14')]=this['interaction'][_0x32dc('0x14')];}var _0x27bf32=this[_0x32dc('0x12')];if(_0x27bf32==='chat'){_0x4b368d[_0x32dc('0x15')]=this[_0x32dc('0x16')]['id'];}else{_0x4b368d[_['upperFirst'](_0x27bf32)+_0x32dc('0x17')]=this['account']['id'];}_0x4b368d[_[_0x32dc('0x18')](_0x27bf32)+'InteractionId']=this['interaction']['id'];if(this['interaction'][_0x32dc('0x19')]){var _0x328940=_0x8f2cea[0x2];if(!_[_0x32dc('0x1a')](_0x328940)){_0x4b368d['body']=utils[_0x32dc('0x1b')](_0x328940,this);return rpc[_0x27bf32+_0x32dc('0x1c')][_0x32dc('0x1d')](_0x4b368d)['then'](function(_0x36e287){logger[_0x32dc('0xb')](_0x32dc('0xc'),_0x52336b,_0x4b368d[_0x32dc('0x1e')]);})['catch'](function(_0x7e27ea){logger[_0x32dc('0x1f')](_0x32dc('0xc'),_0x52336b,JSON[_0x32dc('0x20')](_0x7e27ea));})[_0x32dc('0x21')](function(){logger[_0x32dc('0xb')](_0x32dc('0x22'),_0x52336b);_0x491a56[_0x32dc('0x23')]();});}else{logger['info'](_0x32dc('0x24'),_0x52336b);_0x491a56[_0x32dc('0x23')]();}}else{var _0xd8dd68=this;var _0x2a4bf9=apiai(_0x8f2cea[0x0],{'language':_0x8f2cea[0x1]||'en'});return _0x2a4bf9['textRequest'](this[_0x32dc('0x25')][_0x32dc('0x1e')],{'sessionId':md5(this[_0x32dc('0xa')]['id'])})[_0x32dc('0x26')](function(_0x57e1e3){_0xd8dd68[_0x32dc('0x1e')][_0x32dc('0x27')]=_0x57e1e3;_0x4b368d[_0x32dc('0x1e')]=_0x57e1e3['result']['fulfillment'][_0x32dc('0x28')];_0x4b368d['providerName']=_0x32dc('0x27');_0x4b368d['providerResponse']=JSON['stringify'](_0x57e1e3);return rpc[_0x27bf32+'Message'][_0x32dc('0x1d')](_0x4b368d)['then'](function(_0x6f190e){logger[_0x32dc('0xb')]('[%s][DIALOGFLOW]\x20%s',_0x52336b,_0x4b368d[_0x32dc('0x1e')]);if(_0x57e1e3[_0x32dc('0x29')][_0x32dc('0x2a')][_0x32dc('0x2b')]){_0x491a56[_0x32dc('0x2c')]();}else{_0x491a56[_0x32dc('0x23')]();}})[_0x32dc('0x2d')](function(_0x53dd9e){logger[_0x32dc('0x1f')](_0x32dc('0xc'),_0x52336b,JSON['stringify'](_0x53dd9e));_0x491a56['next']();});})[_0x32dc('0x2d')](function(_0x51e50c){logger[_0x32dc('0x1f')]('[%s][DIALOGFLOW]\x20%s',_0x52336b,_0x51e50c[_0x32dc('0x25')]);_0x491a56[_0x32dc('0x2c')]();});}}catch(_0x5c6a63){logger[_0x32dc('0x1f')](_0x32dc('0xc'),_0x52336b,JSON[_0x32dc('0x20')](_0x5c6a63));_0x491a56['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 780ff82..691cdc7 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d86=['DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','whatsapp','phone','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','boolValue','DIALOGFLOWV2_INTENTNAME','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback'];(function(_0x3b39b6,_0x12115d){var _0x1852f2=function(_0x3e9461){while(--_0x3e9461){_0x3b39b6['push'](_0x3b39b6['shift']());}};_0x1852f2(++_0x12115d);}(_0x4d86,0x128));var _0x64d8=function(_0x2976b9,_0x33aaa4){_0x2976b9=_0x2976b9-0x0;var _0x47e4e9=_0x4d86[_0x2976b9];return _0x47e4e9;};'use strict';var _=require(_0x64d8('0x0'));var dialogflow=require(_0x64d8('0x1'));var md5=require(_0x64d8('0x2'));var moment=require(_0x64d8('0x3'));var Promise=require(_0x64d8('0x4'));var logger=require(_0x64d8('0x5'))(_0x64d8('0x6'));var utils=require('./utils');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x64d8('0x7')),'mailMessage':require(_0x64d8('0x8')),'smsMessage':require(_0x64d8('0x9')),'faxMessage':require(_0x64d8('0xa')),'whatsappMessage':require(_0x64d8('0xb'))};function createMessage(_0x107047,_0x3e9869,_0x37a121,_0x572ab2){return new Promise(function(_0x25fe23,_0x105b94){var _0x1adc4a=_[_0x64d8('0xc')](_0x37a121);_0x1adc4a[_0x64d8('0xd')]=_0x572ab2;return rpc[_0x3e9869+_0x64d8('0xe')][_0x64d8('0xf')](_0x1adc4a)[_0x64d8('0x10')](function(){logger[_0x64d8('0x11')](_0x64d8('0x12'),_0x107047,_0x1adc4a[_0x64d8('0xd')]);_0x25fe23();})[_0x64d8('0x13')](function(_0x1fe7ca){logger[_0x64d8('0x14')]('[%s][DIALOGFLOWV2]\x20%s',_0x107047,JSON[_0x64d8('0x15')](_0x1fe7ca));_0x105b94(_0x1fe7ca);});});}exports[_0x64d8('0x16')]=function(_0x11b0e4,_0x14c30c){return function(_0x194069){try{if(!_[_0x64d8('0x17')](this[_0x64d8('0x18')][_0x64d8('0x19')])){logger[_0x64d8('0x11')](_0x64d8('0x12'),_0x11b0e4,_0x64d8('0x1a'));return _0x194069[_0x64d8('0x1b')]();}var _0x512f0a={'ContactId':this['contact']['id'],'sentAt':moment()[_0x64d8('0x1c')](_0x64d8('0x1d')),'direction':'out'};if(this['channel']==='sms'||this['channel']===_0x64d8('0x1e')){_0x512f0a[_0x64d8('0x1f')]=this[_0x64d8('0x18')][_0x64d8('0x1f')];}var _0x141d9a=this[_0x64d8('0x20')];if(_0x141d9a===_0x64d8('0x21')){_0x512f0a[_0x64d8('0x22')]=this[_0x64d8('0x23')]['id'];}else{_0x512f0a[_[_0x64d8('0x24')](_0x141d9a)+_0x64d8('0x25')]=this[_0x64d8('0x23')]['id'];}_0x512f0a[_[_0x64d8('0x24')](_0x141d9a)+'InteractionId']=this[_0x64d8('0x18')]['id'];if(this[_0x64d8('0x18')][_0x64d8('0x26')]){var _0x1c0c90=_0x14c30c[0x4];if(!_[_0x64d8('0x27')](_0x1c0c90)){_0x512f0a[_0x64d8('0xd')]=utils['getMustacheRender'](_0x1c0c90,this);return rpc[_0x141d9a+_0x64d8('0xe')]['create'](_0x512f0a)[_0x64d8('0x10')](function(_0x6f995d){logger[_0x64d8('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x11b0e4,_0x512f0a[_0x64d8('0xd')]);})['catch'](function(_0x3937f4){logger['error'](_0x64d8('0x12'),_0x11b0e4,JSON[_0x64d8('0x15')](_0x3937f4));})['finally'](function(){logger[_0x64d8('0x11')](_0x64d8('0x28'),_0x11b0e4);_0x194069[_0x64d8('0x29')]();});}else{logger[_0x64d8('0x11')](_0x64d8('0x2a'),_0x11b0e4);_0x194069[_0x64d8('0x29')]();}}else{var _0x349d5b=this;var _0x5c6e94=_0x14c30c[0x2]['replace'](/\\n/g,'\x0a');var _0x2f8ced={'credentials':{'private_key':_0x5c6e94,'client_email':_0x14c30c[0x1]}};var _0x3220ce=new dialogflow[(_0x64d8('0x2b'))](_0x2f8ced);var _0x335c2b=_0x3220ce[_0x64d8('0x2c')](_0x14c30c[0x0],md5(_0x349d5b[_0x64d8('0x18')]['id']));var _0x239292={'session':_0x335c2b,'queryInput':{'text':{'text':_0x349d5b[_0x64d8('0x2d')][_0x64d8('0xd')],'languageCode':_0x14c30c[0x3]||'en'}}};return _0x3220ce[_0x64d8('0x2e')](_0x239292)[_0x64d8('0x10')](function(_0x24a4e3){if(_0x24a4e3&&_0x24a4e3[_0x64d8('0x2f')]){_0x349d5b[_0x64d8('0xd')][_0x64d8('0x30')]=_0x24a4e3;var _0x28d0a6=_0x24a4e3[0x0];var _0x3b21e4=_0x28d0a6[_0x64d8('0x31')][_0x64d8('0x32')]&&_0x28d0a6[_0x64d8('0x31')][_0x64d8('0x32')][_0x64d8('0x33')]?_0x28d0a6[_0x64d8('0x31')]['diagnosticInfo'][_0x64d8('0x33')]['end_conversation']['boolValue']:![];_0x349d5b[_0x64d8('0xd')][_0x64d8('0x34')]=_0x28d0a6[_0x64d8('0x31')][_0x64d8('0x35')];_0x349d5b[_0x64d8('0xd')][_0x64d8('0x36')]=_0x28d0a6[_0x64d8('0x31')]['allRequiredParamsPresent'];_0x349d5b[_0x64d8('0xd')][_0x64d8('0x37')]=_0x28d0a6[_0x64d8('0x31')][_0x64d8('0x32')]&&_0x28d0a6[_0x64d8('0x31')][_0x64d8('0x32')][_0x64d8('0x33')]?_0x28d0a6[_0x64d8('0x31')][_0x64d8('0x32')][_0x64d8('0x33')][_0x64d8('0x38')][_0x64d8('0x39')]:![];_0x349d5b[_0x64d8('0xd')][_0x64d8('0x3a')]=_0x28d0a6[_0x64d8('0x31')][_0x64d8('0x3b')]['name'];_0x349d5b[_0x64d8('0xd')][_0x64d8('0x3c')]=_0x28d0a6[_0x64d8('0x31')][_0x64d8('0x3b')][_0x64d8('0x3d')];_0x349d5b[_0x64d8('0xd')][_0x64d8('0x3e')]=_0x28d0a6['queryResult'][_0x64d8('0x3b')][_0x64d8('0x3f')];_0x349d5b[_0x64d8('0xd')][_0x64d8('0x40')]=_0x28d0a6[_0x64d8('0x31')][_0x64d8('0x41')];_0x349d5b[_0x64d8('0xd')]['DIALOGFLOWV2_QUERYTEXT']=_0x28d0a6[_0x64d8('0x31')]['queryText'];_0x349d5b['body'][_0x64d8('0x42')]=_0x28d0a6[_0x64d8('0x31')][_0x64d8('0x43')];_0x512f0a[_0x64d8('0x44')]=_0x64d8('0x30');_0x512f0a[_0x64d8('0x45')]=JSON['stringify'](_0x24a4e3);var _0x544538=[];for(var _0x8a98b0=0x0;_0x8a98b0<_0x24a4e3[_0x64d8('0x2f')];_0x8a98b0++){var _0x334712=_0x24a4e3[_0x8a98b0];if(_0x334712&&_0x334712['queryResult']&&_0x334712[_0x64d8('0x31')][_0x64d8('0x46')]){_0x544538[_0x64d8('0x47')](createMessage(_0x11b0e4,_0x141d9a,_0x512f0a,_0x334712['queryResult'][_0x64d8('0x46')]));}}return Promise['all'](_0x544538)[_0x64d8('0x10')](function(){if(_0x3b21e4){_0x194069[_0x64d8('0x1b')]();}else{_0x194069[_0x64d8('0x29')]();}})['catch'](function(_0xd9fc9e){logger[_0x64d8('0x14')](_0x64d8('0x12'),_0x11b0e4,JSON[_0x64d8('0x15')](_0xd9fc9e));_0x194069['next']();});}})[_0x64d8('0x13')](function(_0x215ec2){logger[_0x64d8('0x14')](_0x64d8('0x12'),_0x11b0e4,_0x215ec2[_0x64d8('0x2d')]);_0x194069[_0x64d8('0x1b')]();});}}catch(_0x5dbb9c){logger['error'](_0x64d8('0x12'),_0x11b0e4,JSON[_0x64d8('0x15')](_0x5dbb9c));_0x194069['stop']();}};}; \ No newline at end of file +var _0xfd87=['body','Message','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','whatsapp','phone','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','getMustacheRender','create','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','SessionsClient','sessionPath','message','detectIntent','then','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','allRequiredParamsPresent','displayName','intent','isFallback','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','dialogflowV2','providerResponse','length','fulfillmentText','push','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone'];(function(_0x8fb7a4,_0x607700){var _0x1fdca2=function(_0x300754){while(--_0x300754){_0x8fb7a4['push'](_0x8fb7a4['shift']());}};_0x1fdca2(++_0x607700);}(_0xfd87,0x80));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7fd8('0x0'));var dialogflow=require(_0x7fd8('0x1'));var md5=require(_0x7fd8('0x2'));var moment=require(_0x7fd8('0x3'));var Promise=require(_0x7fd8('0x4'));var logger=require(_0x7fd8('0x5'))(_0x7fd8('0x6'));var utils=require(_0x7fd8('0x7'));var rpc={'chatMessage':require(_0x7fd8('0x8')),'openchannelMessage':require(_0x7fd8('0x9')),'mailMessage':require(_0x7fd8('0xa')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x7fd8('0xb')),'whatsappMessage':require(_0x7fd8('0xc'))};function createMessage(_0x55681d,_0x378037,_0x6eaf96,_0x2e2d74){return new Promise(function(_0xbbee0f,_0x469c2f){var _0x515439=_[_0x7fd8('0xd')](_0x6eaf96);_0x515439[_0x7fd8('0xe')]=_0x2e2d74;return rpc[_0x378037+_0x7fd8('0xf')]['create'](_0x515439)['then'](function(){logger['info'](_0x7fd8('0x10'),_0x55681d,_0x515439['body']);_0xbbee0f();})[_0x7fd8('0x11')](function(_0x1a2d5d){logger[_0x7fd8('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0x55681d,JSON[_0x7fd8('0x13')](_0x1a2d5d));_0x469c2f(_0x1a2d5d);});});}exports[_0x7fd8('0x14')]=function(_0xe84aa7,_0x9e50da){return function(_0x20d1c5){try{if(!_['isNil'](this[_0x7fd8('0x15')][_0x7fd8('0x16')])){logger[_0x7fd8('0x17')](_0x7fd8('0x10'),_0xe84aa7,_0x7fd8('0x18'));return _0x20d1c5[_0x7fd8('0x19')]();}var _0x1a4a52={'ContactId':this[_0x7fd8('0x1a')]['id'],'sentAt':moment()[_0x7fd8('0x1b')](_0x7fd8('0x1c')),'direction':_0x7fd8('0x1d')};if(this['channel']==='sms'||this['channel']===_0x7fd8('0x1e')){_0x1a4a52[_0x7fd8('0x1f')]=this['interaction'][_0x7fd8('0x1f')];}var _0xb6f53b=this[_0x7fd8('0x20')];if(_0xb6f53b===_0x7fd8('0x21')){_0x1a4a52[_0x7fd8('0x22')]=this[_0x7fd8('0x23')]['id'];}else{_0x1a4a52[_[_0x7fd8('0x24')](_0xb6f53b)+_0x7fd8('0x25')]=this['account']['id'];}_0x1a4a52[_[_0x7fd8('0x24')](_0xb6f53b)+_0x7fd8('0x26')]=this[_0x7fd8('0x15')]['id'];if(this[_0x7fd8('0x15')][_0x7fd8('0x27')]){var _0x7d1205=_0x9e50da[0x4];if(!_['isEmpty'](_0x7d1205)){_0x1a4a52[_0x7fd8('0xe')]=utils[_0x7fd8('0x28')](_0x7d1205,this);return rpc[_0xb6f53b+_0x7fd8('0xf')][_0x7fd8('0x29')](_0x1a4a52)['then'](function(_0x3f71a4){logger[_0x7fd8('0x17')](_0x7fd8('0x10'),_0xe84aa7,_0x1a4a52[_0x7fd8('0xe')]);})[_0x7fd8('0x11')](function(_0x49f6cf){logger['error'](_0x7fd8('0x10'),_0xe84aa7,JSON[_0x7fd8('0x13')](_0x49f6cf));})[_0x7fd8('0x2a')](function(){logger[_0x7fd8('0x17')](_0x7fd8('0x2b'),_0xe84aa7);_0x20d1c5['stop']();});}else{logger[_0x7fd8('0x17')](_0x7fd8('0x2c'),_0xe84aa7);_0x20d1c5[_0x7fd8('0x2d')]();}}else{var _0x40b79b=this;var _0xa7da6b=_0x9e50da[0x2]['replace'](/\\n/g,'\x0a');var _0x544179={'credentials':{'private_key':_0xa7da6b,'client_email':_0x9e50da[0x1]}};var _0x22a845=new dialogflow[(_0x7fd8('0x2e'))](_0x544179);var _0x3919b1=_0x22a845[_0x7fd8('0x2f')](_0x9e50da[0x0],md5(_0x40b79b['interaction']['id']));var _0x4fc63a={'session':_0x3919b1,'queryInput':{'text':{'text':_0x40b79b[_0x7fd8('0x30')]['body'],'languageCode':_0x9e50da[0x3]||'en'}}};return _0x22a845[_0x7fd8('0x31')](_0x4fc63a)[_0x7fd8('0x32')](function(_0x3df0a2){if(_0x3df0a2&&_0x3df0a2['length']){_0x40b79b[_0x7fd8('0xe')]['dialogflowV2']=_0x3df0a2;var _0x10f56e=_0x3df0a2[0x0];var _0x7c1988=_0x10f56e[_0x7fd8('0x33')][_0x7fd8('0x34')]&&_0x10f56e[_0x7fd8('0x33')][_0x7fd8('0x34')][_0x7fd8('0x35')]?_0x10f56e['queryResult'][_0x7fd8('0x34')][_0x7fd8('0x35')][_0x7fd8('0x36')][_0x7fd8('0x37')]:![];_0x40b79b[_0x7fd8('0xe')][_0x7fd8('0x38')]=_0x10f56e[_0x7fd8('0x33')][_0x7fd8('0x39')];_0x40b79b['body']['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x10f56e[_0x7fd8('0x33')][_0x7fd8('0x3a')];_0x40b79b[_0x7fd8('0xe')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x10f56e[_0x7fd8('0x33')]['diagnosticInfo']&&_0x10f56e['queryResult'][_0x7fd8('0x34')][_0x7fd8('0x35')]?_0x10f56e[_0x7fd8('0x33')][_0x7fd8('0x34')][_0x7fd8('0x35')][_0x7fd8('0x36')][_0x7fd8('0x37')]:![];_0x40b79b[_0x7fd8('0xe')]['DIALOGFLOWV2_INTENTNAME']=_0x10f56e[_0x7fd8('0x33')]['intent']['name'];_0x40b79b[_0x7fd8('0xe')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x10f56e['queryResult']['intent'][_0x7fd8('0x3b')];_0x40b79b[_0x7fd8('0xe')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x10f56e[_0x7fd8('0x33')][_0x7fd8('0x3c')][_0x7fd8('0x3d')];_0x40b79b['body']['DIALOGFLOWV2_LANGUAGECODE']=_0x10f56e['queryResult'][_0x7fd8('0x3e')];_0x40b79b[_0x7fd8('0xe')][_0x7fd8('0x3f')]=_0x10f56e[_0x7fd8('0x33')][_0x7fd8('0x40')];_0x40b79b[_0x7fd8('0xe')][_0x7fd8('0x41')]=_0x10f56e['queryResult']['intentDetectionConfidence'];_0x1a4a52['providerName']=_0x7fd8('0x42');_0x1a4a52[_0x7fd8('0x43')]=JSON[_0x7fd8('0x13')](_0x3df0a2);var _0x558874=[];for(var _0x313df5=0x0;_0x313df5<_0x3df0a2[_0x7fd8('0x44')];_0x313df5++){var _0x42deb1=_0x3df0a2[_0x313df5];if(_0x42deb1&&_0x42deb1[_0x7fd8('0x33')]&&_0x42deb1['queryResult'][_0x7fd8('0x45')]){_0x558874[_0x7fd8('0x46')](createMessage(_0xe84aa7,_0xb6f53b,_0x1a4a52,_0x42deb1['queryResult'][_0x7fd8('0x45')]));}}return Promise['all'](_0x558874)[_0x7fd8('0x32')](function(){if(_0x7c1988){_0x20d1c5[_0x7fd8('0x19')]();}else{_0x20d1c5[_0x7fd8('0x2d')]();}})[_0x7fd8('0x11')](function(_0x527832){logger[_0x7fd8('0x12')](_0x7fd8('0x10'),_0xe84aa7,JSON[_0x7fd8('0x13')](_0x527832));_0x20d1c5[_0x7fd8('0x19')]();});}})[_0x7fd8('0x11')](function(_0x26eb1c){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0xe84aa7,_0x26eb1c['message']);_0x20d1c5[_0x7fd8('0x19')]();});}}catch(_0x26a508){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0xe84aa7,JSON[_0x7fd8('0x13')](_0x26a508));_0x20d1c5[_0x7fd8('0x2d')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index b07cb4d..3547989 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe547=['stop','condition','priorityTrue','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','rules','info','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','validate','length','[%s][GOTOIF]\x20%s','message','join'];(function(_0xd7c883,_0x18ee30){var _0x2fb8a0=function(_0x40bbcb){while(--_0x40bbcb){_0xd7c883['push'](_0xd7c883['shift']());}};_0x2fb8a0(++_0x18ee30);}(_0xe547,0x1f0));var _0x7e54=function(_0x32df8f,_0x437a0d){_0x32df8f=_0x32df8f-0x0;var _0x43f648=_0xe547[_0x32df8f];return _0x43f648;};'use strict';var schema=require('validate');var _=require(_0x7e54('0x0'));var htmlToText=require(_0x7e54('0x1'));var utils=require(_0x7e54('0x2'));var logger=require(_0x7e54('0x3'))(_0x7e54('0x4'));var gotoif=schema({'condition':{'type':_0x7e54('0x5'),'required':!![],'message':_0x7e54('0x6')},'priorityTrue':{'type':_0x7e54('0x7'),'message':_0x7e54('0x8')},'priorityFalse':{'type':_0x7e54('0x7'),'message':_0x7e54('0x9')}});exports['consequence']=function(_0x16888b,_0xfe85de){return function(_0x46069a){try{var _0x221a5c={'condition':htmlToText[_0x7e54('0xa')](utils[_0x7e54('0xb')](_0xfe85de[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0xfe85de[0x1],'priorityFalse':_0xfe85de[0x2]};var _0xcd8bb3=gotoif[_0x7e54('0xc')](_0x221a5c,{'typecast':!![]});if(_0xcd8bb3[_0x7e54('0xd')]){logger['error'](_0x7e54('0xe'),_0x16888b,_['map'](_0xcd8bb3,_0x7e54('0xf'))[_0x7e54('0x10')](',\x20'));_0x46069a[_0x7e54('0x11')]();}else{try{var _0x5af9f0=eval('('+_0x221a5c[_0x7e54('0x12')]+')');var _0x34258b=_0x5af9f0?_0x221a5c[_0x7e54('0x13')]:_0x221a5c['priorityFalse'];logger['info'](_0x7e54('0x14'),_0x16888b,_0x221a5c[_0x7e54('0x12')],_0x5af9f0,_0x34258b||_0x7e54('0x15'));if(_0x34258b){var _0x31c14f=_['findIndex'](_0x46069a[_0x7e54('0x16')](),{'p':_0x34258b});if(_0x31c14f>=0x0){logger[_0x7e54('0x17')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x16888b,_0x34258b||'next',_0x31c14f);_0x46069a[_0x7e54('0x15')](_0x31c14f);}else{logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x16888b,_0x34258b||_0x7e54('0x15'));_0x46069a[_0x7e54('0x11')]();}}else{_0x46069a[_0x7e54('0x15')]();}}catch(_0xe55606){logger[_0x7e54('0x18')](_0x7e54('0x19'),_0x16888b,_0xe55606[_0x7e54('0xf')]);_0x46069a['stop']();}}}catch(_0x5e8a8d){logger['error'](_0x7e54('0xe'),_0x16888b,JSON[_0x7e54('0x1a')](_0x5e8a8d));_0x46069a[_0x7e54('0x11')]();}};}; \ No newline at end of file +var _0x7bdb=['replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stop','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender'];(function(_0x2493a8,_0x5a240d){var _0x2b06c9=function(_0x198d3c){while(--_0x198d3c){_0x2493a8['push'](_0x2493a8['shift']());}};_0x2b06c9(++_0x5a240d);}(_0x7bdb,0xac));var _0xb7bd=function(_0x5d6916,_0x4023f5){_0x5d6916=_0x5d6916-0x0;var _0x16e351=_0x7bdb[_0x5d6916];return _0x16e351;};'use strict';var schema=require(_0xb7bd('0x0'));var _=require(_0xb7bd('0x1'));var htmlToText=require(_0xb7bd('0x2'));var utils=require(_0xb7bd('0x3'));var logger=require(_0xb7bd('0x4'))(_0xb7bd('0x5'));var gotoif=schema({'condition':{'type':_0xb7bd('0x6'),'required':!![],'message':_0xb7bd('0x7')},'priorityTrue':{'type':_0xb7bd('0x8'),'message':_0xb7bd('0x9')},'priorityFalse':{'type':_0xb7bd('0x8'),'message':_0xb7bd('0xa')}});exports[_0xb7bd('0xb')]=function(_0x3c1199,_0x1dc13e){return function(_0x43cca6){try{var _0x554a74={'condition':htmlToText[_0xb7bd('0xc')](utils[_0xb7bd('0xd')](_0x1dc13e[0x0],this),{'wordwrap':![]})[_0xb7bd('0xe')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1dc13e[0x1],'priorityFalse':_0x1dc13e[0x2]};var _0x13be7b=gotoif['validate'](_0x554a74,{'typecast':!![]});if(_0x13be7b[_0xb7bd('0xf')]){logger[_0xb7bd('0x10')](_0xb7bd('0x11'),_0x3c1199,_[_0xb7bd('0x12')](_0x13be7b,_0xb7bd('0x13'))[_0xb7bd('0x14')](',\x20'));_0x43cca6['stop']();}else{try{var _0xad7f97=eval('('+_0x554a74['condition']+')');var _0x45ab89=_0xad7f97?_0x554a74[_0xb7bd('0x15')]:_0x554a74[_0xb7bd('0x16')];logger['info'](_0xb7bd('0x17'),_0x3c1199,_0x554a74['condition'],_0xad7f97,_0x45ab89||_0xb7bd('0x18'));if(_0x45ab89){var _0x5095c5=_['findIndex'](_0x43cca6[_0xb7bd('0x19')](),{'p':_0x45ab89});if(_0x5095c5>=0x0){logger[_0xb7bd('0x1a')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3c1199,_0x45ab89||_0xb7bd('0x18'),_0x5095c5);_0x43cca6[_0xb7bd('0x18')](_0x5095c5);}else{logger[_0xb7bd('0x1a')](_0xb7bd('0x1b'),_0x3c1199,_0x45ab89||_0xb7bd('0x18'));_0x43cca6['stop']();}}else{_0x43cca6[_0xb7bd('0x18')]();}}catch(_0x4e3675){logger[_0xb7bd('0x10')](_0xb7bd('0x1c'),_0x3c1199,_0x4e3675[_0xb7bd('0x13')]);_0x43cca6[_0xb7bd('0x1d')]();}}}catch(_0x137f26){logger[_0xb7bd('0x10')](_0xb7bd('0x11'),_0x3c1199,JSON[_0xb7bd('0x1e')](_0x137f26));_0x43cca6[_0xb7bd('0x1d')]();}};}; \ 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 aeb6404..c0accbd 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 _0xb087=['next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','stringify','validate','../../../../config/logger','routing','number','consequence','length','[%s][GOTOP]\x20%s','map','message','join','stop','[%s][GOTOP]\x20priority\x20%s','priority','rules','info'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb087,0x1b9));var _0x7b08=function(_0x4392d4,_0x233835){_0x4392d4=_0x4392d4-0x0;var _0x2b4539=_0xb087[_0x4392d4];return _0x2b4539;};'use strict';var schema=require(_0x7b08('0x0'));var _=require('lodash');var logger=require(_0x7b08('0x1'))(_0x7b08('0x2'));var gotop=schema({'priority':{'type':_0x7b08('0x3'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x7b08('0x4')]=function(_0x36b718,_0x2a6bee){return function(_0x894a54){try{var _0x2e0140={'priority':_0x2a6bee[0x0]};var _0x36f8fc=gotop[_0x7b08('0x0')](_0x2e0140,{'typecast':!![]});if(_0x36f8fc[_0x7b08('0x5')]){logger['error'](_0x7b08('0x6'),_0x36b718,_[_0x7b08('0x7')](_0x36f8fc,_0x7b08('0x8'))[_0x7b08('0x9')](',\x20'));_0x894a54[_0x7b08('0xa')]();}else{logger['info'](_0x7b08('0xb'),_0x36b718,_0x2e0140[_0x7b08('0xc')]);if(_0x2e0140[_0x7b08('0xc')]){var _0x2152b3=_['findIndex'](_0x894a54[_0x7b08('0xd')](),{'p':_0x2e0140[_0x7b08('0xc')]});if(_0x2152b3>=0x0){logger[_0x7b08('0xe')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x36b718,_0x2e0140[_0x7b08('0xc')]||_0x7b08('0xf'),_0x2152b3);_0x894a54[_0x7b08('0xf')](_0x2152b3);}else{logger[_0x7b08('0xe')](_0x7b08('0x10'),_0x36b718,_0x2e0140[_0x7b08('0xc')]||_0x7b08('0xf'));_0x894a54[_0x7b08('0xa')]();}}else{_0x894a54[_0x7b08('0xf')]();}}}catch(_0x24445c){logger[_0x7b08('0x11')](_0x7b08('0x6'),_0x36b718,JSON[_0x7b08('0x12')](_0x24445c));_0x894a54[_0x7b08('0xa')]();}};}; \ No newline at end of file +var _0x6b97=['routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','error','map','message','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','stop','../../../../config/logger'];(function(_0x74349d,_0x5b2437){var _0x59537c=function(_0x544ce5){while(--_0x544ce5){_0x74349d['push'](_0x74349d['shift']());}};_0x59537c(++_0x5b2437);}(_0x6b97,0x1f3));var _0x76b9=function(_0x1b8d1c,_0x395b3b){_0x1b8d1c=_0x1b8d1c-0x0;var _0x159a0b=_0x6b97[_0x1b8d1c];return _0x159a0b;};'use strict';var schema=require('validate');var _=require('lodash');var logger=require(_0x76b9('0x0'))(_0x76b9('0x1'));var gotop=schema({'priority':{'type':_0x76b9('0x2'),'required':!![],'message':_0x76b9('0x3')}});exports[_0x76b9('0x4')]=function(_0x3722a5,_0x3989b5){return function(_0x81e59e){try{var _0x248e2d={'priority':_0x3989b5[0x0]};var _0x3a38f3=gotop[_0x76b9('0x5')](_0x248e2d,{'typecast':!![]});if(_0x3a38f3[_0x76b9('0x6')]){logger[_0x76b9('0x7')]('[%s][GOTOP]\x20%s',_0x3722a5,_[_0x76b9('0x8')](_0x3a38f3,_0x76b9('0x9'))['join'](',\x20'));_0x81e59e['stop']();}else{logger[_0x76b9('0xa')](_0x76b9('0xb'),_0x3722a5,_0x248e2d[_0x76b9('0xc')]);if(_0x248e2d[_0x76b9('0xc')]){var _0x58f171=_[_0x76b9('0xd')](_0x81e59e[_0x76b9('0xe')](),{'p':_0x248e2d['priority']});if(_0x58f171>=0x0){logger[_0x76b9('0xa')](_0x76b9('0xf'),_0x3722a5,_0x248e2d[_0x76b9('0xc')]||'next',_0x58f171);_0x81e59e[_0x76b9('0x10')](_0x58f171);}else{logger[_0x76b9('0xa')](_0x76b9('0x11'),_0x3722a5,_0x248e2d['priority']||_0x76b9('0x10'));_0x81e59e['stop']();}}else{_0x81e59e['next']();}}}catch(_0x12b367){logger[_0x76b9('0x7')]('[%s][GOTOP]\x20%s',_0x3722a5,JSON[_0x76b9('0x12')](_0x12b367));_0x81e59e[_0x76b9('0x13')]();}};}; \ 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 66916b3..eb956b4 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 _0x462e=['getMustacheRender','channel','chat','ChatWebsiteId','account','AccountId','InteractionId','interaction','Message','then','info','body','next','catch','error','stringify','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage'];(function(_0x5a68cc,_0x59309d){var _0x136aab=function(_0x5d762b){while(--_0x5d762b){_0x5a68cc['push'](_0x5a68cc['shift']());}};_0x136aab(++_0x59309d);}(_0x462e,0x13c));var _0xe462=function(_0x6f7ceb,_0x48dc5d){_0x6f7ceb=_0x6f7ceb-0x0;var _0x5aed13=_0x462e[_0x6f7ceb];return _0x5aed13;};'use strict';var _=require(_0xe462('0x0'));var utils=require(_0xe462('0x1'));var logger=require(_0xe462('0x2'))(_0xe462('0x3'));var rpc={'chatMessage':require(_0xe462('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xe462('0x5')),'smsMessage':require(_0xe462('0x6')),'faxMessage':require(_0xe462('0x7')),'whatsappMessage':require(_0xe462('0x8'))};exports['consequence']=function(_0x11f3a6,_0x264a02){return function(_0x208cb5){try{var _0xdb3d0b={'body':utils[_0xe462('0x9')](_0x264a02[0x0],this),'ContactId':this['contact']['id']};if(this[_0xe462('0xa')]===_0xe462('0xb')){_0xdb3d0b[_0xe462('0xc')]=this[_0xe462('0xd')]['id'];}else{_0xdb3d0b[_['upperFirst'](this[_0xe462('0xa')])+_0xe462('0xe')]=this[_0xe462('0xd')]['id'];}_0xdb3d0b[_['upperFirst'](this[_0xe462('0xa')])+_0xe462('0xf')]=this[_0xe462('0x10')]['id'];if(rpc[this['channel']+_0xe462('0x11')]){return rpc[this[_0xe462('0xa')]+_0xe462('0x11')]['create'](_0xdb3d0b)[_0xe462('0x12')](function(_0x5925ef){logger[_0xe462('0x13')]('[%s][MESSAGE]\x20%s',_0x11f3a6,_0xdb3d0b[_0xe462('0x14')]);_0x208cb5[_0xe462('0x15')]();})[_0xe462('0x16')](function(_0x50b70b){logger[_0xe462('0x17')]('[%s][MESSAGE]\x20%s',_0x11f3a6,JSON[_0xe462('0x18')](_0x50b70b));_0x208cb5['stop']();});}}catch(_0x20ee82){logger['error']('[%s][MESSAGE]\x20%s',_0x11f3a6,JSON[_0xe462('0x18')](_0x20ee82));_0x208cb5['stop']();}};}; \ No newline at end of file +var _0xdd99=['account','upperFirst','AccountId','InteractionId','interaction','Message','create','then','info','next','catch','error','[%s][MESSAGE]\x20%s','stringify','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','contact','channel','chat','ChatWebsiteId'];(function(_0x4394b6,_0x12357f){var _0x360244=function(_0x5689a1){while(--_0x5689a1){_0x4394b6['push'](_0x4394b6['shift']());}};_0x360244(++_0x12357f);}(_0xdd99,0x146));var _0x9dd9=function(_0xaff947,_0x4bfa49){_0xaff947=_0xaff947-0x0;var _0xb987c5=_0xdd99[_0xaff947];return _0xb987c5;};'use strict';var _=require(_0x9dd9('0x0'));var utils=require(_0x9dd9('0x1'));var logger=require(_0x9dd9('0x2'))('routing');var rpc={'chatMessage':require(_0x9dd9('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x9dd9('0x4')),'smsMessage':require(_0x9dd9('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x9dd9('0x6'))};exports[_0x9dd9('0x7')]=function(_0x366b29,_0x29aad1){return function(_0x3a0a00){try{var _0x59c174={'body':utils['getMustacheRender'](_0x29aad1[0x0],this),'ContactId':this[_0x9dd9('0x8')]['id']};if(this[_0x9dd9('0x9')]===_0x9dd9('0xa')){_0x59c174[_0x9dd9('0xb')]=this[_0x9dd9('0xc')]['id'];}else{_0x59c174[_[_0x9dd9('0xd')](this[_0x9dd9('0x9')])+_0x9dd9('0xe')]=this[_0x9dd9('0xc')]['id'];}_0x59c174[_[_0x9dd9('0xd')](this[_0x9dd9('0x9')])+_0x9dd9('0xf')]=this[_0x9dd9('0x10')]['id'];if(rpc[this[_0x9dd9('0x9')]+_0x9dd9('0x11')]){return rpc[this['channel']+_0x9dd9('0x11')][_0x9dd9('0x12')](_0x59c174)[_0x9dd9('0x13')](function(_0xedb0f){logger[_0x9dd9('0x14')]('[%s][MESSAGE]\x20%s',_0x366b29,_0x59c174['body']);_0x3a0a00[_0x9dd9('0x15')]();})[_0x9dd9('0x16')](function(_0x496547){logger[_0x9dd9('0x17')](_0x9dd9('0x18'),_0x366b29,JSON[_0x9dd9('0x19')](_0x496547));_0x3a0a00['stop']();});}}catch(_0xab812f){logger[_0x9dd9('0x17')](_0x9dd9('0x18'),_0x366b29,JSON[_0x9dd9('0x19')](_0xab812f));_0x3a0a00['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 84f3239..8e4f38c 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 _0xe10b=['routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','stop','../../../../config/logger'];(function(_0x19d1a0,_0x2f59a4){var _0x1a98db=function(_0x2582cc){while(--_0x2582cc){_0x19d1a0['push'](_0x19d1a0['shift']());}};_0x1a98db(++_0x2f59a4);}(_0xe10b,0x167));var _0xbe10=function(_0x2093f8,_0x3902ed){_0x2093f8=_0x2093f8-0x0;var _0x3b9bf6=_0xe10b[_0x2093f8];return _0x3b9bf6;};'use strict';var utils=require('./utils');var logger=require(_0xbe10('0x0'))(_0xbe10('0x1'));exports[_0xbe10('0x2')]=function(_0x53edca,_0x281bca){return function(_0x2ace89){try{logger[_0xbe10('0x3')](_0xbe10('0x4'),_0x53edca,utils[_0xbe10('0x5')](_0x281bca[0x0],this));_0x2ace89[_0xbe10('0x6')]();}catch(_0x37958e){logger[_0xbe10('0x7')](_0xbe10('0x4'),_0x53edca,JSON[_0xbe10('0x8')](_0x37958e));_0x2ace89[_0xbe10('0x9')]();}};}; \ No newline at end of file +var _0x3b84=['stringify','stop','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next'];(function(_0x28e7fd,_0x5c775f){var _0x3823df=function(_0x3fe51f){while(--_0x3fe51f){_0x28e7fd['push'](_0x28e7fd['shift']());}};_0x3823df(++_0x5c775f);}(_0x3b84,0x173));var _0x43b8=function(_0x84a694,_0x31c394){_0x84a694=_0x84a694-0x0;var _0xd7a19b=_0x3b84[_0x84a694];return _0xd7a19b;};'use strict';var utils=require('./utils');var logger=require(_0x43b8('0x0'))(_0x43b8('0x1'));exports[_0x43b8('0x2')]=function(_0x5e8fcf,_0x3c0831){return function(_0x5dd99c){try{logger[_0x43b8('0x3')](_0x43b8('0x4'),_0x5e8fcf,utils[_0x43b8('0x5')](_0x3c0831[0x0],this));_0x5dd99c[_0x43b8('0x6')]();}catch(_0x5a3ee1){logger['error'](_0x43b8('0x4'),_0x5e8fcf,JSON[_0x43b8('0x7')](_0x5a3ee1));_0x5dd99c[_0x43b8('0x8')]();}};}; \ 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 c9f1c72..f5cf7c3 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 _0xcf86=['../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','error','create\x20queue\x20report','waiting','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','[%s][QUEUE]\x20%s','map','join','stop','Queues','createQueue','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','lodash','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','redis','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','%sQueuesWaitingInteractions','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xcf86,0xd5));var _0x6cf8=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xcf86[_0x13d07a];return _0x5ee0ee;};'use strict';var schema=require('validate');var _=require(_0x6cf8('0x0'));var util=require(_0x6cf8('0x1'));var seqqueue=require(_0x6cf8('0x2'));var moment=require(_0x6cf8('0x3'));var Redis=require('ioredis');var config=require(_0x6cf8('0x4'));var logger=require(_0x6cf8('0x5'))(_0x6cf8('0x6'));var strategy=require('./strategy');config['redis']=_['defaults'](config[_0x6cf8('0x7')],{'host':_0x6cf8('0x8'),'port':0x18eb});var io=require(_0x6cf8('0x9'))(new Redis(config[_0x6cf8('0x7')]));var attributes=['id',_0x6cf8('0xa'),_0x6cf8('0xb'),_0x6cf8('0xc'),_0x6cf8('0xd'),_0x6cf8('0xe')];function emit(_0x2c9897,_0x5179f5,_0x1cb5b0){io['to'](_0x2c9897)[_0x6cf8('0xf')](_0x5179f5,_0x1cb5b0);}function emitChannelQueueInteraction(_0x4b61b3,_0x85c1f3,_0x270924,_0x5caaed,_0x44f144,_0x2365c0,_0x79c73e,_0x32125e){var _0xf3e74a=_[_0x6cf8('0x10')](_0x270924);_0xf3e74a[_0x6cf8('0xa')]=_0x32125e;_0xf3e74a['queue']=_0x85c1f3;_0xf3e74a[_0x6cf8('0xb')]=_0x5caaed;_0xf3e74a['id']=_0x44f144;if(_0x2365c0){_0x79c73e[util['format'](_0x6cf8('0x11'),_0x4b61b3)][_0x44f144]=_['pick'](_0xf3e74a,attributes);}else{delete _0x79c73e[util['format'](_0x6cf8('0x11'),_0x4b61b3)][_0x44f144];}emit(util[_0x6cf8('0x12')](_0x6cf8('0x13'),_0x4b61b3,_0x85c1f3),util[_0x6cf8('0x12')](_0x6cf8('0x14'),_0x4b61b3,_0x2365c0?_0x6cf8('0x15'):_0x6cf8('0x16')),_[_0x6cf8('0x17')](_0xf3e74a,attributes));}var rpc={'openchannelQueueReport':require(_0x6cf8('0x18')),'mailQueueReport':require(_0x6cf8('0x19')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x6cf8('0x1a')),'faxQueueReport':require(_0x6cf8('0x1b')),'whatsappQueueReport':require(_0x6cf8('0x1c'))};var queue=schema({'name':{'type':_0x6cf8('0x1d'),'required':!![],'message':_0x6cf8('0x1e')},'timeout':{'type':_0x6cf8('0x1f'),'message':_0x6cf8('0x20')}});function startRouting(_0x3c2031,_0x4a03e6,_0x45be94,_0x14232d){if(_0x3c2031&&_0x4a03e6&&_0x45be94){_0x4a03e6['waiting']+=0x1;var _0x82a6d1={'uniqueid':_0x3c2031,'from':_0x45be94[_0x6cf8('0x21')]?_0x45be94[_0x6cf8('0x21')][_0x6cf8('0xd')]:'','joinAt':moment()[_0x6cf8('0x12')](_0x6cf8('0x22')),'ContactId':_0x45be94['contact']?_0x45be94[_0x6cf8('0x23')]['id']:null,'ListId':_0x45be94[_0x6cf8('0x24')]?_0x45be94[_0x6cf8('0x24')]['id']:null};_0x82a6d1[_[_0x6cf8('0x25')](_0x45be94[_0x6cf8('0x26')])+_0x6cf8('0x27')]=_0x4a03e6['id']||null;_0x82a6d1[_['upperFirst'](_0x45be94['channel'])+_0x6cf8('0x28')]=_0x45be94[_0x6cf8('0x29')]?_0x45be94['interaction']['id']:null;_0x82a6d1[_[_0x6cf8('0x25')](_0x45be94[_0x6cf8('0x26')])+_0x6cf8('0x2a')]=_0x45be94[_0x6cf8('0x2b')]?_0x45be94['message']['id']:null;_0x82a6d1[_[_0x6cf8('0x25')](_0x45be94[_0x6cf8('0x26')])+(_0x45be94[_0x6cf8('0x26')]!==_0x6cf8('0x2c')?'AccountId':'WebsiteId')]=_0x45be94['account']?_0x45be94['account']['id']:null;logger[_0x6cf8('0x2d')](util[_0x6cf8('0x12')](_0x6cf8('0x2e'),_0x3c2031,_0x4a03e6[_0x6cf8('0x2f')]));emitChannelQueueInteraction(_0x45be94[_0x6cf8('0x26')],_0x4a03e6[_0x6cf8('0x2f')],_0x82a6d1,_0x45be94['account'][_0x6cf8('0x2f')],_0x45be94['message']['id'],!![],_0x14232d,_0x4a03e6['id']);if(rpc[_0x45be94[_0x6cf8('0x26')]+'QueueReport']){return rpc[_0x45be94[_0x6cf8('0x26')]+_0x6cf8('0x30')]['create'](_0x82a6d1)[_0x6cf8('0x31')](function(_0x112f69){logger[_0x6cf8('0x32')](_0x6cf8('0x33'));});}}}function stopRouting(_0x5900a1,_0x3cd81a,_0x2d341d,_0x564214){if(_0x5900a1&&_0x3cd81a){_0x3cd81a[_0x6cf8('0x34')]-=0x1;var _0x244ccd={'leaveAt':moment()[_0x6cf8('0x12')](_0x6cf8('0x22')),'acceptAt':moment()[_0x6cf8('0x12')](_0x6cf8('0x22')),'reason':_0x6cf8('0x35')};logger[_0x6cf8('0x2d')](util[_0x6cf8('0x12')](_0x6cf8('0x36'),_0x5900a1,_0x3cd81a[_0x6cf8('0x2f')]));emitChannelQueueInteraction(_0x2d341d['channel'],_0x3cd81a['name'],_0x2d341d[_0x6cf8('0x21')],_0x2d341d[_0x6cf8('0xb')]['name'],_0x2d341d[_0x6cf8('0x2b')]['id'],![],_0x564214,_0x3cd81a['id']);if(rpc[_0x2d341d[_0x6cf8('0x26')]+'QueueReport']){return rpc[_0x2d341d[_0x6cf8('0x26')]+'QueueReport'][_0x6cf8('0x37')](_0x5900a1,_0x244ccd)[_0x6cf8('0x31')](function(_0x2c06e0){logger[_0x6cf8('0x32')](_0x6cf8('0x38'));});}}}function endRouting(_0x4eb7b5,_0x9f4500,_0x1a8575,_0x19ed73){if(_0x4eb7b5&&_0x9f4500){_0x9f4500[_0x6cf8('0x34')]-=0x1;var _0x3bf91a={'leaveAt':moment()[_0x6cf8('0x12')](_0x6cf8('0x22')),'exitAt':moment()[_0x6cf8('0x12')](_0x6cf8('0x22')),'reason':_0x6cf8('0x39')};logger[_0x6cf8('0x2d')](util[_0x6cf8('0x12')](_0x6cf8('0x3a'),_0x4eb7b5,_0x9f4500[_0x6cf8('0x2f')]));emitChannelQueueInteraction(_0x1a8575[_0x6cf8('0x26')],_0x9f4500[_0x6cf8('0x2f')],_0x1a8575[_0x6cf8('0x21')],_0x1a8575[_0x6cf8('0xb')][_0x6cf8('0x2f')],_0x1a8575[_0x6cf8('0x2b')]['id'],![],_0x19ed73);if(rpc[_0x1a8575['channel']+_0x6cf8('0x30')]){return rpc[_0x1a8575[_0x6cf8('0x26')]+_0x6cf8('0x30')][_0x6cf8('0x37')](_0x4eb7b5,_0x3bf91a)[_0x6cf8('0x31')](function(_0x42d89a){logger[_0x6cf8('0x32')](_0x6cf8('0x38'));});}}}function handleFindQueue(_0x3bcb2d){return function(_0x41dbaf){return _0x41dbaf[_0x6cf8('0x2f')][_0x6cf8('0x3b')]()===_0x3bcb2d[_0x6cf8('0x3b')]();};}exports[_0x6cf8('0x3c')]=function(_0x333290,_0x335385,_0x37076f,_0x2bdb50){return function(_0xec5045){try{var _0x1863b4={'name':_0x335385[0x0],'timeout':_0x335385[0x1]};var _0x487d45=queue['validate'](_0x1863b4,{'typecast':!![]});if(_0x487d45['length']){logger['error'](_0x6cf8('0x3d'),_0x333290,_[_0x6cf8('0x3e')](_0x487d45,'message')[_0x6cf8('0x3f')](',\x20'));_0xec5045[_0x6cf8('0x40')]();}else{var _0x1beeca=_['find'](_0x37076f[_0x2bdb50[_0x6cf8('0x26')]+_0x6cf8('0x41')],handleFindQueue(_0x1863b4['name']));if(_0x1beeca){startRouting(_0x333290,_0x1beeca,_0x2bdb50,_0x37076f);var _0x4471e4=(_0x1beeca['timeout']||0xa)*0x3e8;var _0x23cbce=(_0x1863b4[_0x6cf8('0x39')]||0x14)*0x3e8;var _0x5eda5f,_0x3e58cc;if(_0x4471e4>_0x23cbce){_0x23cbce=_0x4471e4;}var _0x528a8b=seqqueue[_0x6cf8('0x42')](_0x4471e4);_0x528a8b['id']=_0x333290;_0x528a8b['atimeout']=_0x4471e4;_0x528a8b['qtimeout']=_0x23cbce;_0x528a8b[_0x6cf8('0x26')]=_0x2bdb50['channel'];_0x37076f[_0x6cf8('0x43')][_0x333290]['on'](_0x6cf8('0x44'),function(){logger['info'](_0x6cf8('0x45'),_0x333290);stopRouting(_0x333290,_0x1beeca,_0x2bdb50,_0x37076f);clearTimeout(_0x5eda5f);_0x5eda5f=undefined;_0x528a8b[_0x6cf8('0x46')](!![]);if(_0x37076f['rules'][_0x333290]){delete _0x37076f['rules'][_0x333290];}_0xec5045[_0x6cf8('0x40')]();});_0x37076f[_0x6cf8('0x43')][_0x333290]['on'](_0x6cf8('0x47'),function(){if(_0x37076f[_0x6cf8('0x43')][_0x333290]){delete _0x37076f[_0x6cf8('0x43')][_0x333290];}});_0x5eda5f=setTimeout(function(){logger[_0x6cf8('0x2d')](_0x6cf8('0x48'),_0x333290);endRouting(_0x333290,_0x1beeca,_0x2bdb50,_0x37076f);clearTimeout(_0x5eda5f);_0x528a8b['close'](!![]);_0xec5045[_0x6cf8('0x49')]();},_0x23cbce);switch(_0x1beeca[_0x6cf8('0x4a')]){case _0x6cf8('0x4b'):strategy[_0x6cf8('0x4b')](_0x528a8b,_0x1beeca,_0x37076f,_0x2bdb50);break;default:strategy[_0x6cf8('0x4c')](_0x528a8b,_0x1beeca,_0x37076f,_0x2bdb50);}}else{logger[_0x6cf8('0x32')](_0x6cf8('0x4d'),_0x333290,_0x1863b4['name']);_0xec5045['stop']();}}}catch(_0x25cfd7){console[_0x6cf8('0x4e')](_0x25cfd7);logger[_0x6cf8('0x32')](_0x6cf8('0x3d'),_0x333290,_0x25cfd7[_0x6cf8('0x4f')]);_0xec5045[_0x6cf8('0x40')]();}};}; \ No newline at end of file +var _0x95a9=['info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','validate','[%s][QUEUE]\x20%s','map','stop','find','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','util','seq-queue','moment','../../../../config/logger','routing','./strategy','redis','localhost','queue_id','queue','from','joinAt','emit','account','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','AccountId','WebsiteId'];(function(_0x524e35,_0x45a80d){var _0x580881=function(_0x240a3e){while(--_0x240a3e){_0x524e35['push'](_0x524e35['shift']());}};_0x580881(++_0x45a80d);}(_0x95a9,0x10b));var _0x995a=function(_0x3d86a5,_0x33d871){_0x3d86a5=_0x3d86a5-0x0;var _0x232702=_0x95a9[_0x3d86a5];return _0x232702;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x995a('0x0'));var seqqueue=require(_0x995a('0x1'));var moment=require(_0x995a('0x2'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0x995a('0x3'))(_0x995a('0x4'));var strategy=require(_0x995a('0x5'));config[_0x995a('0x6')]=_['defaults'](config['redis'],{'host':_0x995a('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x995a('0x6')]));var attributes=['id',_0x995a('0x8'),'account',_0x995a('0x9'),_0x995a('0xa'),_0x995a('0xb')];function emit(_0x5ef9bc,_0x3067bc,_0x472e03){io['to'](_0x5ef9bc)[_0x995a('0xc')](_0x3067bc,_0x472e03);}function emitChannelQueueInteraction(_0x2d694d,_0x397011,_0x33865a,_0x252955,_0xe84d6e,_0x20a5cd,_0x2307fe,_0x3cb351){var _0x2f4f6a=_['clone'](_0x33865a);_0x2f4f6a[_0x995a('0x8')]=_0x3cb351;_0x2f4f6a[_0x995a('0x9')]=_0x397011;_0x2f4f6a[_0x995a('0xd')]=_0x252955;_0x2f4f6a['id']=_0xe84d6e;if(_0x20a5cd){_0x2307fe[util['format'](_0x995a('0xe'),_0x2d694d)][_0xe84d6e]=_[_0x995a('0xf')](_0x2f4f6a,attributes);}else{delete _0x2307fe[util[_0x995a('0x10')](_0x995a('0xe'),_0x2d694d)][_0xe84d6e];}emit(util[_0x995a('0x10')](_0x995a('0x11'),_0x2d694d,_0x397011),util[_0x995a('0x10')](_0x995a('0x12'),_0x2d694d,_0x20a5cd?'save':_0x995a('0x13')),_[_0x995a('0xf')](_0x2f4f6a,attributes));}var rpc={'openchannelQueueReport':require(_0x995a('0x14')),'mailQueueReport':require(_0x995a('0x15')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x995a('0x16')),'faxQueueReport':require(_0x995a('0x17')),'whatsappQueueReport':require(_0x995a('0x18'))};var queue=schema({'name':{'type':_0x995a('0x19'),'required':!![],'message':_0x995a('0x1a')},'timeout':{'type':_0x995a('0x1b'),'message':_0x995a('0x1c')}});function startRouting(_0x422e42,_0x5607f8,_0x2f5693,_0x646e42){if(_0x422e42&&_0x5607f8&&_0x2f5693){_0x5607f8[_0x995a('0x1d')]+=0x1;var _0x59d750={'uniqueid':_0x422e42,'from':_0x2f5693[_0x995a('0x1e')]?_0x2f5693[_0x995a('0x1e')][_0x995a('0xa')]:'','joinAt':moment()[_0x995a('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2f5693[_0x995a('0x1f')]?_0x2f5693[_0x995a('0x1f')]['id']:null,'ListId':_0x2f5693[_0x995a('0x20')]?_0x2f5693[_0x995a('0x20')]['id']:null};_0x59d750[_[_0x995a('0x21')](_0x2f5693[_0x995a('0x22')])+_0x995a('0x23')]=_0x5607f8['id']||null;_0x59d750[_[_0x995a('0x21')](_0x2f5693[_0x995a('0x22')])+'InteractionId']=_0x2f5693[_0x995a('0x24')]?_0x2f5693[_0x995a('0x24')]['id']:null;_0x59d750[_[_0x995a('0x21')](_0x2f5693[_0x995a('0x22')])+_0x995a('0x25')]=_0x2f5693[_0x995a('0x26')]?_0x2f5693[_0x995a('0x26')]['id']:null;_0x59d750[_[_0x995a('0x21')](_0x2f5693['channel'])+(_0x2f5693['channel']!=='chat'?_0x995a('0x27'):_0x995a('0x28'))]=_0x2f5693[_0x995a('0xd')]?_0x2f5693[_0x995a('0xd')]['id']:null;logger[_0x995a('0x29')](util[_0x995a('0x10')](_0x995a('0x2a'),_0x422e42,_0x5607f8[_0x995a('0x2b')]));emitChannelQueueInteraction(_0x2f5693['channel'],_0x5607f8[_0x995a('0x2b')],_0x59d750,_0x2f5693[_0x995a('0xd')]['name'],_0x2f5693['message']['id'],!![],_0x646e42,_0x5607f8['id']);if(rpc[_0x2f5693[_0x995a('0x22')]+_0x995a('0x2c')]){return rpc[_0x2f5693[_0x995a('0x22')]+_0x995a('0x2c')][_0x995a('0x2d')](_0x59d750)[_0x995a('0x2e')](function(_0x412a0f){logger[_0x995a('0x2f')](_0x995a('0x30'));});}}}function stopRouting(_0x2cb34f,_0x4a28e7,_0x57fb43,_0xd1fb7f){if(_0x2cb34f&&_0x4a28e7){_0x4a28e7[_0x995a('0x1d')]-=0x1;var _0x352366={'leaveAt':moment()[_0x995a('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()['format'](_0x995a('0x31')),'reason':_0x995a('0x32')};logger[_0x995a('0x29')](util['format'](_0x995a('0x33'),_0x2cb34f,_0x4a28e7[_0x995a('0x2b')]));emitChannelQueueInteraction(_0x57fb43[_0x995a('0x22')],_0x4a28e7[_0x995a('0x2b')],_0x57fb43['body'],_0x57fb43[_0x995a('0xd')][_0x995a('0x2b')],_0x57fb43[_0x995a('0x26')]['id'],![],_0xd1fb7f,_0x4a28e7['id']);if(rpc[_0x57fb43['channel']+_0x995a('0x2c')]){return rpc[_0x57fb43['channel']+_0x995a('0x2c')][_0x995a('0x34')](_0x2cb34f,_0x352366)[_0x995a('0x2e')](function(_0xbea077){logger[_0x995a('0x2f')](_0x995a('0x35'));});}}}function endRouting(_0x50e569,_0x47d8f1,_0x2e205a,_0x5c7b7a){if(_0x50e569&&_0x47d8f1){_0x47d8f1['waiting']-=0x1;var _0xa1bef7={'leaveAt':moment()['format'](_0x995a('0x31')),'exitAt':moment()[_0x995a('0x10')](_0x995a('0x31')),'reason':_0x995a('0x36')};logger['info'](util[_0x995a('0x10')](_0x995a('0x37'),_0x50e569,_0x47d8f1[_0x995a('0x2b')]));emitChannelQueueInteraction(_0x2e205a[_0x995a('0x22')],_0x47d8f1[_0x995a('0x2b')],_0x2e205a[_0x995a('0x1e')],_0x2e205a[_0x995a('0xd')]['name'],_0x2e205a['message']['id'],![],_0x5c7b7a);if(rpc[_0x2e205a[_0x995a('0x22')]+_0x995a('0x2c')]){return rpc[_0x2e205a[_0x995a('0x22')]+_0x995a('0x2c')][_0x995a('0x34')](_0x50e569,_0xa1bef7)[_0x995a('0x2e')](function(_0x595bef){logger[_0x995a('0x2f')](_0x995a('0x35'));});}}}function handleFindQueue(_0x2fd774){return function(_0x45b812){return _0x45b812[_0x995a('0x2b')][_0x995a('0x38')]()===_0x2fd774[_0x995a('0x38')]();};}exports['consequence']=function(_0x132a7b,_0x262a08,_0x14ace2,_0x51bd49){return function(_0x2a7472){try{var _0x49ce82={'name':_0x262a08[0x0],'timeout':_0x262a08[0x1]};var _0x14a276=queue[_0x995a('0x39')](_0x49ce82,{'typecast':!![]});if(_0x14a276['length']){logger[_0x995a('0x2f')](_0x995a('0x3a'),_0x132a7b,_[_0x995a('0x3b')](_0x14a276,'message')['join'](',\x20'));_0x2a7472[_0x995a('0x3c')]();}else{var _0x3b000a=_[_0x995a('0x3d')](_0x14ace2[_0x51bd49['channel']+'Queues'],handleFindQueue(_0x49ce82['name']));if(_0x3b000a){startRouting(_0x132a7b,_0x3b000a,_0x51bd49,_0x14ace2);var _0x23be71=(_0x3b000a[_0x995a('0x36')]||0xa)*0x3e8;var _0x4e8988=(_0x49ce82[_0x995a('0x36')]||0x14)*0x3e8;var _0x27830a,_0x280dc2;if(_0x23be71>_0x4e8988){_0x4e8988=_0x23be71;}var _0x4e284f=seqqueue[_0x995a('0x3e')](_0x23be71);_0x4e284f['id']=_0x132a7b;_0x4e284f[_0x995a('0x3f')]=_0x23be71;_0x4e284f[_0x995a('0x40')]=_0x4e8988;_0x4e284f[_0x995a('0x22')]=_0x51bd49[_0x995a('0x22')];_0x14ace2[_0x995a('0x41')][_0x132a7b]['on'](_0x995a('0x42'),function(){logger[_0x995a('0x29')](_0x995a('0x43'),_0x132a7b);stopRouting(_0x132a7b,_0x3b000a,_0x51bd49,_0x14ace2);clearTimeout(_0x27830a);_0x27830a=undefined;_0x4e284f[_0x995a('0x44')](!![]);if(_0x14ace2[_0x995a('0x41')][_0x132a7b]){delete _0x14ace2[_0x995a('0x41')][_0x132a7b];}_0x2a7472[_0x995a('0x3c')]();});_0x14ace2[_0x995a('0x41')][_0x132a7b]['on']('complete',function(){if(_0x14ace2['rules'][_0x132a7b]){delete _0x14ace2[_0x995a('0x41')][_0x132a7b];}});_0x27830a=setTimeout(function(){logger[_0x995a('0x29')](_0x995a('0x45'),_0x132a7b);endRouting(_0x132a7b,_0x3b000a,_0x51bd49,_0x14ace2);clearTimeout(_0x27830a);_0x4e284f[_0x995a('0x44')](!![]);_0x2a7472[_0x995a('0x46')]();},_0x4e8988);switch(_0x3b000a[_0x995a('0x47')]){case'rrmemory':strategy[_0x995a('0x48')](_0x4e284f,_0x3b000a,_0x14ace2,_0x51bd49);break;default:strategy[_0x995a('0x49')](_0x4e284f,_0x3b000a,_0x14ace2,_0x51bd49);}}else{logger[_0x995a('0x2f')](_0x995a('0x4a'),_0x132a7b,_0x49ce82[_0x995a('0x2b')]);_0x2a7472['stop']();}}}catch(_0x4b9b46){console[_0x995a('0x4b')](_0x4b9b46);logger[_0x995a('0x2f')](_0x995a('0x3a'),_0x132a7b,_0x4b9b46[_0x995a('0x4c')]);_0x2a7472[_0x995a('0x3c')]();}};}; \ 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 e8ab95b..27daf54 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 _0xdc7f=['[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','routing','notificationId','squeue','handleRun','handleTimeout','bind','timeout','drained','handleDrained','prototype','push','debug','agent','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','realtime','channel','busy','busyQueue','writeLog','RINGING',':FORCED'];(function(_0x22943d,_0x2e167b){var _0x3fb073=function(_0x49d52d){while(--_0x49d52d){_0x22943d['push'](_0x22943d['shift']());}};_0x3fb073(++_0x2e167b);}(_0xdc7f,0x12e));var _0xfdc7=function(_0x142ec2,_0x5bb03d){_0x142ec2=_0x142ec2-0x0;var _0x45ef4e=_0xdc7f[_0x142ec2];return _0x45ef4e;};'use strict';var _=require(_0xfdc7('0x0'));var uuid=require(_0xfdc7('0x1'));var util=require(_0xfdc7('0x2'));var logger=require('../../../../../config/logger')(_0xfdc7('0x3'));var Agent=function(_0x1ecf0a,_0x202224,_0x19538f,_0x553676){this[_0xfdc7('0x4')]=uuid['v4']();this[_0xfdc7('0x5')]=_0x1ecf0a;this['agent']=_0x202224;this['realtime']=_0x19538f;this['routing']=_0x553676;this[_0xfdc7('0x5')]['push'](this[_0xfdc7('0x6')]['bind'](this),this[_0xfdc7('0x7')][_0xfdc7('0x8')](this));this[_0xfdc7('0x5')]['on'](_0xfdc7('0x9'),this['handleTimeout'][_0xfdc7('0x8')](this));this[_0xfdc7('0x5')]['on'](_0xfdc7('0xa'),this[_0xfdc7('0xb')][_0xfdc7('0x8')](this));};Agent[_0xfdc7('0xc')]['push']=function(){this['squeue'][_0xfdc7('0xd')](this[_0xfdc7('0x6')][_0xfdc7('0x8')](this),this[_0xfdc7('0x7')]['bind'](this));};Agent[_0xfdc7('0xc')][_0xfdc7('0xb')]=function(){this['handleTimeout'](!![]);};Agent[_0xfdc7('0xc')][_0xfdc7('0x6')]=function(){logger[_0xfdc7('0xe')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0xfdc7('0x5')]['id'],this[_0xfdc7('0xf')]['id']);if(_[_0xfdc7('0x10')](this['realtime'][_0xfdc7('0x11')][this[_0xfdc7('0xf')]['id']])){logger[_0xfdc7('0xe')](_0xfdc7('0x12'),this[_0xfdc7('0x5')]['id'],this[_0xfdc7('0xf')]['id']);setTimeout(this[_0xfdc7('0xd')][_0xfdc7('0x8')](this),0x3e8);}else{if(this[_0xfdc7('0x3')][_0xfdc7('0x13')]||util[_0xfdc7('0x14')](this[_0xfdc7('0x5')]['id'],this[_0xfdc7('0x15')][_0xfdc7('0x11')][this[_0xfdc7('0xf')]['id']],this['squeue'][_0xfdc7('0x16')],![])){this['realtime'][_0xfdc7('0x11')][this[_0xfdc7('0xf')]['id']][_0xfdc7('0x17')]=!![];this['realtime'][_0xfdc7('0x11')][this[_0xfdc7('0xf')]['id']][_0xfdc7('0x18')]=undefined;util['showNotification'](this[_0xfdc7('0x4')],this['squeue']['id'],this['realtime'][_0xfdc7('0x11')][this[_0xfdc7('0xf')]['id']],null,this[_0xfdc7('0x3')]);util[_0xfdc7('0x19')](this['squeue']['id'],this[_0xfdc7('0x15')][_0xfdc7('0x11')][this[_0xfdc7('0xf')]['id']],_0xfdc7('0x1a')+(this[_0xfdc7('0x3')][_0xfdc7('0x13')]?_0xfdc7('0x1b'):''));}else{logger[_0xfdc7('0xe')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0xfdc7('0x5')]['id'],this[_0xfdc7('0xf')]['id']);setTimeout(this[_0xfdc7('0xd')][_0xfdc7('0x8')](this),0x3e8);}}};Agent[_0xfdc7('0xc')][_0xfdc7('0x7')]=function(_0x363a22){if(_[_0xfdc7('0x10')](this[_0xfdc7('0x15')]['agents'][this['agent']['id']])){return logger[_0xfdc7('0xe')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xfdc7('0x5')]['id'],this[_0xfdc7('0xf')]['id']);}else{logger[_0xfdc7('0xe')](_0xfdc7('0x1c'),this[_0xfdc7('0x5')]['id'],this[_0xfdc7('0xf')]['id']);util[_0xfdc7('0x1d')](this[_0xfdc7('0x4')],this['squeue']['id'],this[_0xfdc7('0x15')][_0xfdc7('0x11')][this[_0xfdc7('0xf')]['id']],null,this[_0xfdc7('0x3')]);this['realtime'][_0xfdc7('0x11')][this['agent']['id']]['busy']=![];this['realtime'][_0xfdc7('0x11')][this[_0xfdc7('0xf')]['id']][_0xfdc7('0x18')]=undefined;util[_0xfdc7('0x19')](this['squeue']['id'],this['realtime'][_0xfdc7('0x11')][this[_0xfdc7('0xf')]['id']],_0x363a22?_0xfdc7('0x1e'):_0xfdc7('0x1f'));}if(!_0x363a22){setTimeout(this[_0xfdc7('0xd')][_0xfdc7('0x8')](this),0x3e8);}};function agent(_0x59c78b,_0x1005cf,_0x30d70b,_0x55438a){return new Agent(_0x59c78b,_0x1005cf,_0x30d70b,_0x55438a);}module[_0xfdc7('0x20')]=agent; \ No newline at end of file +var _0x8625=['isNil','agents','debug','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','writeLog',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','exports','lodash','uuid','./util','routing','notificationId','agent','realtime','squeue','push','handleRun','handleTimeout','bind','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s'];(function(_0xd5a2ff,_0x357eea){var _0x42b333=function(_0x381889){while(--_0x381889){_0xd5a2ff['push'](_0xd5a2ff['shift']());}};_0x42b333(++_0x357eea);}(_0x8625,0x164));var _0x5862=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x8625[_0x1a9204];return _0x17ca68;};'use strict';var _=require(_0x5862('0x0'));var uuid=require(_0x5862('0x1'));var util=require(_0x5862('0x2'));var logger=require('../../../../../config/logger')(_0x5862('0x3'));var Agent=function(_0x10f94b,_0x4505b4,_0x55ec53,_0x4e2437){this[_0x5862('0x4')]=uuid['v4']();this['squeue']=_0x10f94b;this[_0x5862('0x5')]=_0x4505b4;this[_0x5862('0x6')]=_0x55ec53;this[_0x5862('0x3')]=_0x4e2437;this[_0x5862('0x7')][_0x5862('0x8')](this[_0x5862('0x9')]['bind'](this),this[_0x5862('0xa')]['bind'](this));this[_0x5862('0x7')]['on']('timeout',this[_0x5862('0xa')][_0x5862('0xb')](this));this[_0x5862('0x7')]['on'](_0x5862('0xc'),this[_0x5862('0xd')][_0x5862('0xb')](this));};Agent['prototype'][_0x5862('0x8')]=function(){this['squeue'][_0x5862('0x8')](this[_0x5862('0x9')][_0x5862('0xb')](this),this[_0x5862('0xa')][_0x5862('0xb')](this));};Agent[_0x5862('0xe')][_0x5862('0xd')]=function(){this['handleTimeout'](!![]);};Agent[_0x5862('0xe')][_0x5862('0x9')]=function(){logger['debug'](_0x5862('0xf'),this[_0x5862('0x7')]['id'],this['agent']['id']);if(_[_0x5862('0x10')](this['realtime'][_0x5862('0x11')][this[_0x5862('0x5')]['id']])){logger[_0x5862('0x12')](_0x5862('0x13'),this['squeue']['id'],this[_0x5862('0x5')]['id']);setTimeout(this[_0x5862('0x8')][_0x5862('0xb')](this),0x3e8);}else{if(this[_0x5862('0x3')][_0x5862('0x14')]||util[_0x5862('0x15')](this[_0x5862('0x7')]['id'],this[_0x5862('0x6')][_0x5862('0x11')][this['agent']['id']],this[_0x5862('0x7')][_0x5862('0x16')],![])){this[_0x5862('0x6')][_0x5862('0x11')][this[_0x5862('0x5')]['id']][_0x5862('0x17')]=!![];this[_0x5862('0x6')]['agents'][this[_0x5862('0x5')]['id']][_0x5862('0x18')]=undefined;util[_0x5862('0x19')](this[_0x5862('0x4')],this[_0x5862('0x7')]['id'],this[_0x5862('0x6')][_0x5862('0x11')][this[_0x5862('0x5')]['id']],null,this[_0x5862('0x3')]);util[_0x5862('0x1a')](this[_0x5862('0x7')]['id'],this[_0x5862('0x6')][_0x5862('0x11')][this['agent']['id']],'RINGING'+(this[_0x5862('0x3')][_0x5862('0x14')]?_0x5862('0x1b'):''));}else{logger['debug'](_0x5862('0x1c'),this[_0x5862('0x7')]['id'],this[_0x5862('0x5')]['id']);setTimeout(this[_0x5862('0x8')][_0x5862('0xb')](this),0x3e8);}}};Agent[_0x5862('0xe')][_0x5862('0xa')]=function(_0x22699f){if(_[_0x5862('0x10')](this[_0x5862('0x6')][_0x5862('0x11')][this[_0x5862('0x5')]['id']])){return logger[_0x5862('0x12')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0x5862('0x5')]['id']);}else{logger['debug'](_0x5862('0x1d'),this['squeue']['id'],this[_0x5862('0x5')]['id']);util['hideNotification'](this['notificationId'],this[_0x5862('0x7')]['id'],this[_0x5862('0x6')]['agents'][this[_0x5862('0x5')]['id']],null,this[_0x5862('0x3')]);this[_0x5862('0x6')][_0x5862('0x11')][this[_0x5862('0x5')]['id']][_0x5862('0x17')]=![];this[_0x5862('0x6')]['agents'][this[_0x5862('0x5')]['id']]['busyQueue']=undefined;util[_0x5862('0x1a')](this[_0x5862('0x7')]['id'],this[_0x5862('0x6')][_0x5862('0x11')][this['agent']['id']],_0x22699f?'STOP':'TIMEOUT');}if(!_0x22699f){setTimeout(this['push'][_0x5862('0xb')](this),0x3e8);}};function agent(_0x184851,_0x56bd73,_0x80c28a,_0xf80fee){return new Agent(_0x184851,_0x56bd73,_0x80c28a,_0xf80fee);}module[_0x5862('0x1e')]=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 38d44f3..f0c7b11 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 _0xa047=['bind','handleTimeout','timeout','handleDrained','handleRun','prototype','isNil','Agents','length','realtime','debug','channel','RINGING','agents','busy','busyQueue','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','writeLog','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','queue','routing','push'];(function(_0x401b64,_0x5cae66){var _0x139aa0=function(_0x4bef1d){while(--_0x4bef1d){_0x401b64['push'](_0x401b64['shift']());}};_0x139aa0(++_0x5cae66);}(_0xa047,0x1c5));var _0x7a04=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xa047[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x7a04('0x0'));var uuid=require(_0x7a04('0x1'));var util=require(_0x7a04('0x2'));var logger=require(_0x7a04('0x3'))('routing');var Beepall=function(_0x258f94,_0x491906,_0x132966,_0x269341){this[_0x7a04('0x4')]=uuid['v4']();this[_0x7a04('0x5')]=_0x258f94;this[_0x7a04('0x6')]=_0x491906;this['realtime']=_0x132966;this[_0x7a04('0x7')]=_0x269341;this[_0x7a04('0x5')][_0x7a04('0x8')](this['handleRun'][_0x7a04('0x9')](this),this[_0x7a04('0xa')]['bind'](this));this[_0x7a04('0x5')]['on'](_0x7a04('0xb'),this['handleTimeout'][_0x7a04('0x9')](this));this['squeue']['on']('drained',this[_0x7a04('0xc')][_0x7a04('0x9')](this));};Beepall['prototype']['push']=function(){this['squeue'][_0x7a04('0x8')](this[_0x7a04('0xd')][_0x7a04('0x9')](this),this[_0x7a04('0xa')][_0x7a04('0x9')](this));};Beepall[_0x7a04('0xe')][_0x7a04('0xc')]=function(){this[_0x7a04('0xa')](!![]);};Beepall[_0x7a04('0xe')]['handleRun']=function(){var _0x3b601d=!![];if(!_[_0x7a04('0xf')](this[_0x7a04('0x6')])&&!_[_0x7a04('0xf')](this[_0x7a04('0x6')][_0x7a04('0x10')])&&this['queue'][_0x7a04('0x10')][_0x7a04('0x11')]>0x0){for(var _0x400468=0x0,_0x56458f;_0x4004680x0){for(var _0x161f23=0x0,_0x4ca554;_0x161f230x0&&_0x353daa[_0x474893+_0xa3f8('0x26')]>=_0x353daa[_0x474893+_0xa3f8('0x25')]){writeLog(_0x1a89d4,_0x353daa,_0x474893[_0xa3f8('0x27')]()+_0xa3f8('0x28'));return![];}}return!![];};exports['showNotification']=function(_0x1c3358,_0x2d29c1,_0x3344ba,_0x5a8fcf,_0x40f5cc){return sendNotification(!![],_0x1c3358,_0x2d29c1,_0x3344ba,_0x5a8fcf,_0x40f5cc);};exports['hideNotification']=function(_0xbad6a6,_0x3a3746,_0x3c1128,_0x4ea213,_0x458824){return sendNotification(![],_0xbad6a6,_0x3a3746,_0x3c1128,_0x4ea213,_0x458824);};exports['writeLog']=writeLog; \ No newline at end of file +var _0x8958=['notificationShake','body','queue','getMustacheRender','notificationTemplate','msg','error','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','CurrentCapacity','Capacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','util','routing','defaults','redis','localhost','format','user:%s','name','emit','user:save','split','account','notificationSound'];(function(_0x58999b,_0xea4695){var _0x5efc3a=function(_0x98de31){while(--_0x98de31){_0x58999b['push'](_0x58999b['shift']());}};_0x5efc3a(++_0xea4695);}(_0x8958,0x93));var _0x8895=function(_0x335185,_0x52793a){_0x335185=_0x335185-0x0;var _0x2b02c0=_0x8958[_0x335185];return _0x2b02c0;};'use strict';var _=require('lodash');var util=require(_0x8895('0x0'));var utils=require('../utils');var Redis=require('ioredis');var config=require('../../../../../config/environment');var logger=require('../../../../../config/logger')(_0x8895('0x1'));config['redis']=_[_0x8895('0x2')](config[_0x8895('0x3')],{'host':_0x8895('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8895('0x3')]));function sendNotification(_0x2f03ad,_0x124e1e,_0x40cec6,_0x33013a,_0x51376b,_0xe018b8){io['to'](util[_0x8895('0x5')](_0x8895('0x6'),_0x33013a[_0x8895('0x7')]))[_0x8895('0x8')](_0x8895('0x9'),_0x33013a);var _0x22a12b=_0xe018b8||{};var _0xdb3d59=_0x40cec6[_0x8895('0xa')]('.');var _0x107d86={'uniqueid':_0x124e1e,'channel':_0xdb3d59[0x0],'id':_0xdb3d59[0x1],'title':_0xdb3d59[0x0]+'\x20interaction','interactionId':_0xdb3d59[0x2],'queue':_0x51376b?_0x51376b[_0x8895('0x7')]:null,'sound':_0x22a12b[_0x8895('0xb')][_0x8895('0xc')],'shake':_0x22a12b[_0x8895('0xb')][_0x8895('0xd')]};try{if(!_0x22a12b[_0x8895('0xe')]){_0x22a12b['body']={};}if(_0x51376b){_0x22a12b[_0x8895('0xe')][_0x8895('0xf')]=_0x51376b;}else if(_0x22a12b[_0x8895('0xe')]['queue']){delete _0x22a12b['body'][_0x8895('0xf')];}_0x107d86['msg']=utils[_0x8895('0x10')](_0x22a12b[_0x8895('0xb')][_0x8895('0x11')],_0x22a12b);}catch(_0x3d7b59){_0x107d86[_0x8895('0x12')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0x8895('0x13')](util[_0x8895('0x5')](_0x8895('0x14'),_0x124e1e,_0x3d7b59[_0x8895('0x15')]));}io['to'](util[_0x8895('0x5')](_0x8895('0x6'),_0x33013a[_0x8895('0x7')]))[_0x8895('0x8')](util[_0x8895('0x5')](_0x8895('0x16'),_0x2f03ad?_0x8895('0x17'):_0x8895('0x18')),_0x107d86);}function writeLog(_0x2df795,_0x54e6d4,_0x522a4e){return logger['debug'](util[_0x8895('0x5')](_0x8895('0x19'),_0x2df795,_0x54e6d4[_0x8895('0x7')],_0x522a4e));}exports[_0x8895('0x1a')]=function(_0x3f7d5a,_0x35bda5,_0x461346,_0xc1ce17){if(_0x35bda5['busy']){writeLog(_0x3f7d5a,_0x35bda5,_0x8895('0x1b'));return![];}if(!_0x35bda5[_0x8895('0x1c')]){writeLog(_0x3f7d5a,_0x35bda5,_0x8895('0x1d'));return![];}if(_0x35bda5[_0x461346+_0x8895('0x1e')]){writeLog(_0x3f7d5a,_0x35bda5,_0x8895('0x1f'));return![];}if(_0xc1ce17&&_0x35bda5['hasOwnProperty'](_0x461346+'Capacity')&&_0x35bda5[_0x8895('0x20')](_0x461346+_0x8895('0x21'))){if(_0x35bda5[_0x461346+_0x8895('0x22')]>0x0&&_0x35bda5[_0x461346+_0x8895('0x21')]>=_0x35bda5[_0x461346+'Capacity']){writeLog(_0x3f7d5a,_0x35bda5,_0x461346[_0x8895('0x23')]()+_0x8895('0x24'));return![];}}return!![];};exports[_0x8895('0x25')]=function(_0x5486a6,_0x4aee03,_0x78b57,_0x555e60,_0x3d51b0){return sendNotification(!![],_0x5486a6,_0x4aee03,_0x78b57,_0x555e60,_0x3d51b0);};exports[_0x8895('0x26')]=function(_0x10b48f,_0xf5fb66,_0x153220,_0x5c03ea,_0x4d567a){return sendNotification(![],_0x10b48f,_0xf5fb66,_0x153220,_0x5c03ea,_0x4d567a);};exports[_0x8895('0x27')]=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 ece2564..78543de 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 _0xfe4e=['info','replace','isNil','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','isObject','validate','lodash','./utils','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim'];(function(_0x23d927,_0x2102d1){var _0x1ba1b9=function(_0x4936ab){while(--_0x4936ab){_0x23d927['push'](_0x23d927['shift']());}};_0x1ba1b9(++_0x2102d1);}(_0xfe4e,0x133));var _0xefe4=function(_0x3abc4d,_0x7fe708){_0x3abc4d=_0x3abc4d-0x0;var _0x5b9182=_0xfe4e[_0x3abc4d];return _0x5b9182;};'use strict';var schema=require(_0xefe4('0x0'));var sh=require('shelljs');var _=require(_0xefe4('0x1'));var utils=require(_0xefe4('0x2'));var logger=require(_0xefe4('0x3'))('routing');var system=schema({'command':{'type':_0xefe4('0x4'),'required':!![],'message':_0xefe4('0x5')}});exports[_0xefe4('0x6')]=function(_0x2d6d5a,_0x32ba67){return function(_0x5622b2){try{var _0x197672={'command':_0x32ba67[0x0]};var _0x393857=system[_0xefe4('0x0')](_0x197672,{'typecast':!![]});if(_0x393857[_0xefe4('0x7')]){logger[_0xefe4('0x8')](_0xefe4('0x9'),_0x2d6d5a,_['map'](_0x393857,_0xefe4('0xa'))[_0xefe4('0xb')](',\x20'));logger['info'](_0xefe4('0xc'),_0x2d6d5a);_0x5622b2[_0xefe4('0xd')]();}else{var _0x3b0e75=this;var _0x78125f=utils[_0xefe4('0xe')](_0x32ba67[0x0],this);logger['info'](_0xefe4('0xf'),_0x2d6d5a,_0x78125f);sh[_0xefe4('0x10')](_[_0xefe4('0x11')](_0x78125f),function(_0xe3773,_0x59e22e){logger[_0xefe4('0x12')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x2d6d5a,_0xe3773);if(_0xe3773==0x0){var _0x47b97e=_0x59e22e[_0xefe4('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0xefe4('0x14')](_0x32ba67[0x1])||_['isEmpty'](_0x32ba67[0x1])){logger[_0xefe4('0x12')](_0xefe4('0x15'),_0x2d6d5a);_0x3b0e75['body'][_0x32ba67[0x1]]=_0x47b97e;}else{logger[_0xefe4('0x12')](_0xefe4('0x16'),_0x2d6d5a,_0x32ba67[0x1],_0x47b97e);_0x3b0e75[_0xefe4('0x17')][_0x32ba67[0x1]]=_0x47b97e;}}_0x5622b2[_0xefe4('0xd')]();});}}catch(_0x20e463){logger[_0xefe4('0x8')](_0xefe4('0x9'),_0x2d6d5a,_[_0xefe4('0x18')](_0x20e463)?JSON['stringify'](_0x20e463):_0x20e463);logger[_0xefe4('0x12')](_0xefe4('0xc'),_0x2d6d5a);_0x5622b2[_0xefe4('0xd')]();}};}; \ No newline at end of file +var _0xb0de=['error','[%s][SYSTEM]\x20%s','map','message','info','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','next','isObject','validate','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence'];(function(_0x3654d3,_0x2447b7){var _0x5ce64b=function(_0x9f6734){while(--_0x9f6734){_0x3654d3['push'](_0x3654d3['shift']());}};_0x5ce64b(++_0x2447b7);}(_0xb0de,0x148));var _0xeb0d=function(_0x1d5921,_0x1fa527){_0x1d5921=_0x1d5921-0x0;var _0x7923f3=_0xb0de[_0x1d5921];return _0x7923f3;};'use strict';var schema=require(_0xeb0d('0x0'));var sh=require('shelljs');var _=require(_0xeb0d('0x1'));var utils=require(_0xeb0d('0x2'));var logger=require(_0xeb0d('0x3'))(_0xeb0d('0x4'));var system=schema({'command':{'type':_0xeb0d('0x5'),'required':!![],'message':_0xeb0d('0x6')}});exports[_0xeb0d('0x7')]=function(_0x293326,_0x482b4d){return function(_0x38a4ab){try{var _0x5f474a={'command':_0x482b4d[0x0]};var _0x3d7ba7=system[_0xeb0d('0x0')](_0x5f474a,{'typecast':!![]});if(_0x3d7ba7['length']){logger[_0xeb0d('0x8')](_0xeb0d('0x9'),_0x293326,_[_0xeb0d('0xa')](_0x3d7ba7,_0xeb0d('0xb'))['join'](',\x20'));logger[_0xeb0d('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x293326);_0x38a4ab['next']();}else{var _0x37d8f7=this;var _0x3e9087=utils[_0xeb0d('0xd')](_0x482b4d[0x0],this);logger[_0xeb0d('0xc')](_0xeb0d('0xe'),_0x293326,_0x3e9087);sh['exec'](_[_0xeb0d('0xf')](_0x3e9087),function(_0x3ed256,_0x130d19){logger[_0xeb0d('0xc')](_0xeb0d('0x10'),_0x293326,_0x3ed256);if(_0x3ed256==0x0){var _0x3553a4=_0x130d19[_0xeb0d('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0xeb0d('0x12')](_0x482b4d[0x1])||_[_0xeb0d('0x13')](_0x482b4d[0x1])){logger[_0xeb0d('0xc')](_0xeb0d('0x14'),_0x293326);_0x37d8f7[_0xeb0d('0x15')][_0x482b4d[0x1]]=_0x3553a4;}else{logger[_0xeb0d('0xc')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x293326,_0x482b4d[0x1],_0x3553a4);_0x37d8f7[_0xeb0d('0x15')][_0x482b4d[0x1]]=_0x3553a4;}}_0x38a4ab[_0xeb0d('0x16')]();});}}catch(_0xacca52){logger[_0xeb0d('0x8')](_0xeb0d('0x9'),_0x293326,_[_0xeb0d('0x17')](_0xacca52)?JSON['stringify'](_0xacca52):_0xacca52);logger[_0xeb0d('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x293326);_0x38a4ab[_0xeb0d('0x16')]();}};}; \ 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 db91c4a..2f60121 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 _0xb36a=['addTags','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','[%s][TAG]\x20%s','isObject','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','message','join','next','channel','Interaction'];(function(_0x3c3b01,_0xbaa847){var _0xda6617=function(_0x38649a){while(--_0x38649a){_0x3c3b01['push'](_0x3c3b01['shift']());}};_0xda6617(++_0xbaa847);}(_0xb36a,0x1e7));var _0xab36=function(_0x1db8aa,_0x5dbff3){_0x1db8aa=_0x1db8aa-0x0;var _0x5297f8=_0xb36a[_0x1db8aa];return _0x5297f8;};'use strict';var schema=require(_0xab36('0x0'));var _=require(_0xab36('0x1'));var rpc={'chatInteraction':require(_0xab36('0x2')),'openchannelInteraction':require(_0xab36('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xab36('0x4')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0xab36('0x5'))(_0xab36('0x6'));var tag=schema({'tag':{'type':_0xab36('0x7'),'required':!![],'message':_0xab36('0x8')}});exports[_0xab36('0x9')]=function(_0x54ab65,_0x4b7552,_0xab1a0d,_0x40b7cc){return function(_0x46b15d){try{var _0x3e7e74={'tag':_0x4b7552[0x0]};var _0x2d850c=tag[_0xab36('0x0')](_0x3e7e74,{'typecast':!![]});if(_0x2d850c[_0xab36('0xa')]){logger[_0xab36('0xb')]('[%s][TAG]\x20%s',_0x54ab65,_['map'](_0x2d850c,_0xab36('0xc'))[_0xab36('0xd')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x54ab65);_0x46b15d[_0xab36('0xe')]();}else{var _0x7f980e={'ids':[_0x4b7552[0x0]]};if(rpc[_0x40b7cc[_0xab36('0xf')]+_0xab36('0x10')]){rpc[_0x40b7cc[_0xab36('0xf')]+_0xab36('0x10')][_0xab36('0x11')](_0x40b7cc[_0xab36('0x12')]['id'],_0x7f980e)[_0xab36('0x13')](function(_0x53cbf0){logger[_0xab36('0x14')](_0xab36('0x15'),_0x54ab65,_0x4b7552[0x1],_0x40b7cc[_0xab36('0xf')],_0x40b7cc[_0xab36('0x12')]['id']);})[_0xab36('0x16')](function(_0x16e152){logger[_0xab36('0xb')]('[%s][TAG]\x20%s',_0x54ab65,JSON[_0xab36('0x17')](_0x16e152));logger[_0xab36('0x14')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x54ab65);})[_0xab36('0x18')](function(){_0x46b15d[_0xab36('0xe')]();});}}}catch(_0x29184e){logger['error'](_0xab36('0x19'),_0x54ab65,_[_0xab36('0x1a')](_0x29184e)?JSON['stringify'](_0x29184e):_0x29184e);logger[_0xab36('0x14')](_0xab36('0x1b'),_0x54ab65);_0x46b15d['next']();}};}; \ No newline at end of file +var _0xd145=['catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s'];(function(_0x438f7b,_0x1d8324){var _0x4383a7=function(_0x339673){while(--_0x339673){_0x438f7b['push'](_0x438f7b['shift']());}};_0x4383a7(++_0x1d8324);}(_0xd145,0xd6));var _0x5d14=function(_0x11f6a1,_0x4b3ec7){_0x11f6a1=_0x11f6a1-0x0;var _0x3df8a2=_0xd145[_0x11f6a1];return _0x3df8a2;};'use strict';var schema=require(_0x5d14('0x0'));var _=require(_0x5d14('0x1'));var rpc={'chatInteraction':require(_0x5d14('0x2')),'openchannelInteraction':require(_0x5d14('0x3')),'smsInteraction':require(_0x5d14('0x4')),'mailInteraction':require(_0x5d14('0x5')),'faxInteraction':require(_0x5d14('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x5d14('0x7'))(_0x5d14('0x8'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x5d14('0x9')}});exports[_0x5d14('0xa')]=function(_0x38a24f,_0x2a401c,_0x37cded,_0x289955){return function(_0x474760){try{var _0x3ada98={'tag':_0x2a401c[0x0]};var _0x3047b5=tag['validate'](_0x3ada98,{'typecast':!![]});if(_0x3047b5[_0x5d14('0xb')]){logger[_0x5d14('0xc')](_0x5d14('0xd'),_0x38a24f,_[_0x5d14('0xe')](_0x3047b5,_0x5d14('0xf'))[_0x5d14('0x10')](',\x20'));logger['info'](_0x5d14('0x11'),_0x38a24f);_0x474760[_0x5d14('0x12')]();}else{var _0x6a4467={'ids':[_0x2a401c[0x0]]};if(rpc[_0x289955[_0x5d14('0x13')]+'Interaction']){rpc[_0x289955[_0x5d14('0x13')]+_0x5d14('0x14')][_0x5d14('0x15')](_0x289955[_0x5d14('0x16')]['id'],_0x6a4467)[_0x5d14('0x17')](function(_0x4588fc){logger[_0x5d14('0x18')](_0x5d14('0x19'),_0x38a24f,_0x2a401c[0x1],_0x289955[_0x5d14('0x13')],_0x289955[_0x5d14('0x16')]['id']);})[_0x5d14('0x1a')](function(_0x2bcdc6){logger[_0x5d14('0xc')](_0x5d14('0xd'),_0x38a24f,JSON[_0x5d14('0x1b')](_0x2bcdc6));logger[_0x5d14('0x18')](_0x5d14('0x11'),_0x38a24f);})[_0x5d14('0x1c')](function(){_0x474760[_0x5d14('0x12')]();});}}}catch(_0x4a2617){logger[_0x5d14('0xc')](_0x5d14('0xd'),_0x38a24f,_[_0x5d14('0x1d')](_0x4a2617)?JSON[_0x5d14('0x1b')](_0x4a2617):_0x4a2617);logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x38a24f);_0x474760[_0x5d14('0x12')]();}};}; \ 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 665315a..3ec4c44 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 _0x227b=['urlOnAnswer','?params=','urlOnRing','title','jsonrpc','method','login','push','params','stringify','utf8','POST','then','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','error','[%s][TVOX]\x20%s','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','consequence','replace','\x20-\x20','includes'];(function(_0x16a7d8,_0x326d5c){var _0xa4b589=function(_0x17add5){while(--_0x17add5){_0x16a7d8['push'](_0x16a7d8['shift']());}};_0xa4b589(++_0x326d5c);}(_0x227b,0x16f));var _0xb227=function(_0x1fae15,_0x575d53){_0x1fae15=_0x1fae15-0x0;var _0x203e8f=_0x227b[_0x1fae15];return _0x203e8f;};'use strict';var rp=require(_0xb227('0x0'));var logger=require('../../../../config/logger')('routing');var _=require('lodash');var arr=[];exports[_0xb227('0x1')]=function(_0x2e32b1,_0x2bda8f){return function(_0x175a88){var _0x2a9b7f=_0x2bda8f[0xa];var _0x5b2925=_0x2bda8f[0xb];var _0x17936b=_0x2bda8f[0xc];var _0x409249=_0x2bda8f[0xd];var _0x52b208=_0x2bda8f[0xe];var _0x1dc267=_0x2bda8f[0xf][_0xb227('0x2')](/\n/g,_0xb227('0x3'));var _0x25b122=_0x2bda8f[0x10][_0xb227('0x2')](/\n/g,'\x20');if(!arr[_0xb227('0x4')](_0x5b2925)){arr['push'](_0x5b2925);var _0x43b461=_0x2bda8f[0x3];var _0x3d5241=_0x2bda8f[0x4];var _0x26b73d=_0x2bda8f[0x1];var _0x145e00=_0x2bda8f[0x0];var _0xbf36b6={};_0xbf36b6[_0xb227('0x5')]=_0x2bda8f[0x8]+_0xb227('0x6')+_0x17936b+'|'+_0x2a9b7f+'|'+_0x409249+'|'+_0x5b2925+'|'+_0x52b208;_0xbf36b6[_0xb227('0x7')]=_0x2bda8f[0x7]+_0xb227('0x6')+_0x17936b+'|'+_0x2a9b7f+'|'+_0x409249+'|'+_0x5b2925+'|'+_0x52b208+'|'+_0x1dc267+'|'+_0x25b122;_0xbf36b6[_0xb227('0x8')]=_0x2bda8f[0x9];var _0xfa421d={};_0xfa421d[_0xb227('0x9')]='2.0';_0xfa421d[_0xb227('0xa')]=_0xb227('0xb');var _0x1784ea=[];_0x1784ea[_0xb227('0xc')](_0x2bda8f[0x2]);_0x1784ea[_0xb227('0xc')](_0x2bda8f[0x5]);_0x1784ea[_0xb227('0xc')](_0x2bda8f[0x6]);_0xfa421d[_0xb227('0xd')]=_0x1784ea;_0xfa421d['id']=0x1;var _0xbe3dac=JSON[_0xb227('0xe')](_0xfa421d);var _0x4e4fac={'encoding':_0xb227('0xf'),'method':_0xb227('0x10'),'timeout':0x2710,'url':_0x43b461,'headers':{'Content-Type':'application/json-rpc'},'body':_0xbe3dac};return rp(_0x4e4fac)[_0xb227('0x11')](function(_0xcdac19){const _0x10200d=JSON['parse'](_0xcdac19);if(!_0x10200d[_0xb227('0x12')][_0xb227('0x13')]){throw new Error(_0xb227('0x14'));}var _0x424efc=_0x5b2925;var _0x18cb86=_0xb227('0x15')+_0x26b73d+_0xb227('0x16')+_0x145e00+_0xb227('0x17')+_0x424efc+_0xb227('0x18')+JSON[_0xb227('0xe')](_0xbf36b6);var _0x5ef8bd=_0x3d5241+'?'+_0x18cb86;return rp(_0x5ef8bd);})[_0xb227('0x11')](function(_0x546231){logger[_0xb227('0x19')](_0xb227('0x1a'),_0x2e32b1,_0x546231);_0x175a88['stop']();})['catch'](function(_0x493939){logger[_0xb227('0x1b')](_0xb227('0x1c'),_0x2e32b1,_['isObject'](_0x493939)?JSON[_0xb227('0xe')](_0x493939):_0x493939);_0x175a88['stop']();});}else{logger['info'](_0xb227('0x1d'),_0x2e32b1);_0x175a88[_0xb227('0x1e')]();}};}; \ No newline at end of file +var _0xc22f=['parse','logged','channelId=','&serviceId=','&sessionId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','isObject','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','lodash','consequence','\x20-\x20','replace','includes','urlOnAnswer','title','jsonrpc','login','push','params','stringify','utf8','application/json-rpc','then'];(function(_0x190627,_0x38820b){var _0x3a788a=function(_0x1a87fa){while(--_0x1a87fa){_0x190627['push'](_0x190627['shift']());}};_0x3a788a(++_0x38820b);}(_0xc22f,0xc1));var _0xfc22=function(_0x3d8494,_0x5cf5c7){_0x3d8494=_0x3d8494-0x0;var _0x644cbd=_0xc22f[_0x3d8494];return _0x644cbd;};'use strict';var rp=require(_0xfc22('0x0'));var logger=require(_0xfc22('0x1'))('routing');var _=require(_0xfc22('0x2'));var arr=[];exports[_0xfc22('0x3')]=function(_0x319de0,_0x51467c){return function(_0x1cbf22){var _0x5827a8=_0x51467c[0xa];var _0x1b28bb=_0x51467c[0xb];var _0x2fcd64=_0x51467c[0xc];var _0x55279c=_0x51467c[0xd];var _0x55f3e1=_0x51467c[0xe];var _0x2d1dc2=_0x51467c[0xf]['replace'](/\n/g,_0xfc22('0x4'));var _0x680184=_0x51467c[0x10][_0xfc22('0x5')](/\n/g,'\x20');if(!arr[_0xfc22('0x6')](_0x1b28bb)){arr['push'](_0x1b28bb);var _0x22d78e=_0x51467c[0x3];var _0x1a2926=_0x51467c[0x4];var _0x48cde6=_0x51467c[0x1];var _0x4aa257=_0x51467c[0x0];var _0x156b43={};_0x156b43[_0xfc22('0x7')]=_0x51467c[0x8]+'?params='+_0x2fcd64+'|'+_0x5827a8+'|'+_0x55279c+'|'+_0x1b28bb+'|'+_0x55f3e1;_0x156b43['urlOnRing']=_0x51467c[0x7]+'?params='+_0x2fcd64+'|'+_0x5827a8+'|'+_0x55279c+'|'+_0x1b28bb+'|'+_0x55f3e1+'|'+_0x2d1dc2+'|'+_0x680184;_0x156b43[_0xfc22('0x8')]=_0x51467c[0x9];var _0x1c7f6f={};_0x1c7f6f[_0xfc22('0x9')]='2.0';_0x1c7f6f['method']=_0xfc22('0xa');var _0x1805f3=[];_0x1805f3[_0xfc22('0xb')](_0x51467c[0x2]);_0x1805f3[_0xfc22('0xb')](_0x51467c[0x5]);_0x1805f3[_0xfc22('0xb')](_0x51467c[0x6]);_0x1c7f6f[_0xfc22('0xc')]=_0x1805f3;_0x1c7f6f['id']=0x1;var _0x342f3f=JSON[_0xfc22('0xd')](_0x1c7f6f);var _0x25b886={'encoding':_0xfc22('0xe'),'method':'POST','timeout':0x2710,'url':_0x22d78e,'headers':{'Content-Type':_0xfc22('0xf')},'body':_0x342f3f};return rp(_0x25b886)[_0xfc22('0x10')](function(_0x5f5380){const _0x46b852=JSON[_0xfc22('0x11')](_0x5f5380);if(!_0x46b852['result'][_0xfc22('0x12')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x454560=_0x1b28bb;var _0x408e27=_0xfc22('0x13')+_0x48cde6+_0xfc22('0x14')+_0x4aa257+_0xfc22('0x15')+_0x454560+_0xfc22('0x16')+JSON[_0xfc22('0xd')](_0x156b43);var _0x3f2c3b=_0x1a2926+'?'+_0x408e27;return rp(_0x3f2c3b);})[_0xfc22('0x10')](function(_0x130f64){logger['info'](_0xfc22('0x17'),_0x319de0,_0x130f64);_0x1cbf22[_0xfc22('0x18')]();})[_0xfc22('0x19')](function(_0xc37d78){logger['error']('[%s][TVOX]\x20%s',_0x319de0,_[_0xfc22('0x1a')](_0xc37d78)?JSON[_0xfc22('0xd')](_0xc37d78):_0xc37d78);_0x1cbf22[_0xfc22('0x18')]();});}else{logger[_0xfc22('0x1b')](_0xfc22('0x1c'),_0x319de0);_0x1cbf22[_0xfc22('0x1d')]();}};}; \ 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 3f35b6c..8e49caa 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 _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0xa5aa41,_0x4d9a2e){var _0x37010e=function(_0x1a6c98){while(--_0x1a6c98){_0xa5aa41['push'](_0xa5aa41['shift']());}};_0x37010e(++_0x4d9a2e);}(_0xe706,0xa3));var _0x6e70=function(_0x53a6c0,_0x53df9a){_0x53a6c0=_0x53a6c0-0x0;var _0x30c452=_0xe706[_0x53a6c0];return _0x30c452;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x52950b,_0x238662){var _0x471acb=function(_0x241877){while(--_0x241877){_0x52950b['push'](_0x52950b['shift']());}};_0x471acb(++_0x238662);}(_0x9c44,0x178));var _0x49c4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9c44[_0xfae23b];return _0x200640;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 59c547d..0dac004 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 _0x0506=['applications','length','existsSync','app','.js','toLowerCase','appdata','split','mail','push','slice','join','dialogflow','dialogflowv2','amazonlex','TagId','tvox','getMustacheRender','account','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','priority','info','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busyQueue','end','QueueReport','update','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','available','mailQueues','loggedIn','name','paused','waiting','openchannelQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','routing','../rpc/mailQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x0506,0x1d1));var _0x6050=function(_0x38cded,_0x374391){_0x38cded=_0x38cded-0x0;var _0x5b1c85=_0x0506[_0x38cded];return _0x5b1c85;};'use strict';var _=require(_0x6050('0x0'));var util=require(_0x6050('0x1'));var path=require(_0x6050('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require('bluebird');var utils=require('./applications/utils');var logger=require('../../../config/logger')(_0x6050('0x3'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x6050('0x4')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x6050('0x5')),'whatsappQueueReport':require(_0x6050('0x6'))};var RuleEngine=require(_0x6050('0x7'));function getId(_0x1a89fb,_0x3512ba,_0xf64de5){return util[_0x6050('0x8')](_0x6050('0x9'),_0x1a89fb,_0x3512ba||0x0,_0xf64de5||0x0);}function getIntervals(_0x5734fb,_0x312217){var _0x4f149a=[];if(!_[_0x6050('0xa')](_0x312217[_0x6050('0xb')])&&!_[_0x6050('0xa')](_0x5734fb[_0x312217[_0x6050('0xb')]])&&!_[_0x6050('0xa')](_0x5734fb[_0x312217[_0x6050('0xb')]][_0x6050('0xc')])){_0x4f149a=_[_0x6050('0xd')](_0x5734fb[_0x312217[_0x6050('0xb')]][_0x6050('0xc')],'interval');}else if(!_[_0x6050('0xa')](_0x312217['interval'])){_0x4f149a=[_0x312217[_0x6050('0xe')]];}return _0x4f149a;}exports[_0x6050('0xf')]=function(_0x2e404b){_0x2e404b[_0x6050('0x10')]={};return new BPromise(function(_0x4b5503,_0x223a06){var _0x5d0a25={'Start':function(_0x377b42){var _0x2229f5=this;return new Promise(function(_0x465e2b,_0x3876e6){if(_0x377b42){try{var _0x4e33d1=[];var _0x25976e=getId(_0x377b42[_0x6050('0x11')],_0x377b42[_0x6050('0x12')]?_0x377b42[_0x6050('0x12')]['id']:0x0,_0x377b42[_0x6050('0x13')]?_0x377b42[_0x6050('0x13')]['id']:0x0);if(_0x377b42[_0x6050('0x14')]&&_['isArray'](_0x377b42[_0x6050('0x14')])&&_0x377b42[_0x6050('0x14')][_0x6050('0x15')]){for(var _0x5def58=0x0;_0x5def58<_0x377b42['applications']['length'];_0x5def58+=0x1){var _0x521916=_0x377b42[_0x6050('0x14')][_0x5def58];if(fs[_0x6050('0x16')](path['join'](__dirname,_0x6050('0x14'),_0x521916[_0x6050('0x17')]+_0x6050('0x18')))){var _0x232955=[];switch(_0x521916[_0x6050('0x17')][_0x6050('0x19')]()){case'autoreply':var _0x3b6e2f=_0x521916[_0x6050('0x1a')][_0x6050('0x1b')](',');if(_0x377b42[_0x6050('0x11')]===_0x6050('0x1c')){_0x232955[_0x6050('0x1d')](_0x3b6e2f[0x0]);_0x232955[_0x6050('0x1d')](_0x3b6e2f[0x1]);_0x232955[_0x6050('0x1d')](_0x3b6e2f['slice'](0x2,_0x3b6e2f[_0x6050('0x15')])['join'](','));}else{_0x232955[_0x6050('0x1d')](_0x3b6e2f[0x0]);_0x232955[_0x6050('0x1d')](_0x3b6e2f[_0x6050('0x1e')](0x1,_0x3b6e2f[_0x6050('0x15')])[_0x6050('0x1f')](','));}break;case _0x6050('0x20'):var _0x4b46e0=_0x521916[_0x6050('0x1a')][_0x6050('0x1b')](',');_0x232955[_0x6050('0x1d')](_0x4b46e0[0x0]);_0x232955[_0x6050('0x1d')](_0x4b46e0[0x1]);_0x232955['push'](_0x4b46e0[_0x6050('0x1e')](0x2,_0x4b46e0[_0x6050('0x15')])[_0x6050('0x1f')](','));break;case _0x6050('0x21'):var _0x46769f=_0x521916[_0x6050('0x1a')][_0x6050('0x1b')](',');_0x232955['push'](_0x46769f[0x0]);_0x232955[_0x6050('0x1d')](_0x46769f[0x1]);_0x232955[_0x6050('0x1d')](_0x46769f[0x2]);_0x232955[_0x6050('0x1d')](_0x46769f[0x3]);_0x232955[_0x6050('0x1d')](_0x46769f[_0x6050('0x1e')](0x4,_0x46769f[_0x6050('0x15')])[_0x6050('0x1f')](','));break;case _0x6050('0x22'):var _0x252ebb=_0x521916['appdata'][_0x6050('0x1b')](',');_0x232955['push'](_0x252ebb[0x0]);_0x232955['push'](_0x252ebb[0x1]);_0x232955[_0x6050('0x1d')](_0x252ebb[0x2]);_0x232955[_0x6050('0x1d')](_0x252ebb[0x3]);_0x232955[_0x6050('0x1d')](_0x252ebb['slice'](0x4,_0x252ebb[_0x6050('0x15')])['join'](','));break;case'message':_0x232955[_0x6050('0x1d')](_0x521916[_0x6050('0x1a')]);break;case'tag':_0x232955['push'](_0x521916[_0x6050('0x23')]);_0x232955[_0x6050('0x1d')](_0x521916['appdata']);break;case _0x6050('0x24'):var _0x110818=utils[_0x6050('0x25')](_0x377b42[_0x6050('0x26')]['notificationTemplate'],_0x377b42);var _0x409e60=_0x521916['appdata'][_0x6050('0x1b')](',');_0x232955['push'](_0x409e60[0x0]);_0x232955[_0x6050('0x1d')](_0x409e60[0x1]);_0x232955[_0x6050('0x1d')](_0x409e60[0x2]);_0x232955[_0x6050('0x1d')](_0x409e60[0x3]);_0x232955['push'](_0x409e60[0x4]);_0x232955[_0x6050('0x1d')](_0x409e60[0x5]);_0x232955['push'](_0x409e60[0x6]);_0x232955[_0x6050('0x1d')](_0x409e60[0x7]);_0x232955['push'](_0x409e60[0x8]);_0x232955[_0x6050('0x1d')](_0x409e60[0x9]);_0x232955[_0x6050('0x1d')](_0x409e60[0xa]);_0x232955[_0x6050('0x1d')](_0x377b42[_0x6050('0x13')]['id']);_0x232955['push'](_0x377b42[_0x6050('0x12')]['id']);_0x232955[_0x6050('0x1d')](_0x521916['ChatWebsiteId']);_0x232955[_0x6050('0x1d')](_0x377b42[_0x6050('0x13')][_0x6050('0x27')]);_0x232955['push'](_0x377b42[_0x6050('0x28')][_0x6050('0x28')]);_0x232955[_0x6050('0x1d')](_0x110818);break;default:_0x232955=_['isNil'](_0x521916[_0x6050('0x1a')])?[]:_0x521916[_0x6050('0x1a')]['split'](',');}var _0x554e3f={'id':util[_0x6050('0x8')](_0x6050('0x29'),_0x25976e,_0x521916['id'],_0x521916[_0x6050('0x17')]),'condition':require(_0x6050('0x2a'))[_0x6050('0x2b')](_0x25976e,getIntervals(_0x2e404b[_0x6050('0x2c')],_0x521916),_0x2e404b),'consequence':require(_0x6050('0x2d')+_0x521916['app'])['consequence'](_0x25976e,_0x232955,_0x2e404b,_0x377b42),'p':_0x521916[_0x6050('0x2e')]||0x0};logger[_0x6050('0x2f')]('Push\x20new\x20rule',_0x554e3f['id'],_0x6050('0x30'),getIntervals(_0x2e404b['intervals'],_0x521916)[_0x6050('0x1f')](_0x6050('0x31')));_0x4e33d1[_0x6050('0x1d')](_0x554e3f);}else{logger[_0x6050('0x32')](_0x6050('0x33'),path[_0x6050('0x1f')](__dirname,_0x6050('0x14'),_0x521916[_0x6050('0x17')]+'.js'));}}_0x2e404b['rules'][_0x25976e]=new RuleEngine(_0x4e33d1);_0x2e404b['rules'][_0x25976e][_0x6050('0x34')](_0x377b42,function(_0x39d256){logger[_0x6050('0x2f')](_0x6050('0x35'),JSON[_0x6050('0x36')](_0x39d256[_0x6050('0x37')]));if(_0x2e404b[_0x6050('0x10')][_0x25976e]){_0x2e404b[_0x6050('0x10')][_0x25976e][_0x6050('0x38')](_0x6050('0x39'));}});return _0x465e2b({'code':0xc8,'message':_0x377b42});}else{logger[_0x6050('0x2f')](_0x6050('0x3a'));return _0x465e2b({'code':0xc8,'message':_0x377b42});}}catch(_0x57e2ed){logger['error'](_0x57e2ed[_0x6050('0x3b')]);return _0x3876e6(_0x2229f5[_0x6050('0x32')](0x1f4,_0x57e2ed));}}return _0x3876e6(_0x6050('0x3c'));});},'AcceptMessage':function(_0x750dd8){var _0x4ff116=this;return new Promise(function(_0x5c0464,_0x1eae98){if(_0x750dd8[_0x6050('0x3d')]&&_0x750dd8['agent']['id']){if(_0x2e404b[_0x6050('0x3e')][_0x750dd8[_0x6050('0x3d')]['id']]){_0x2e404b[_0x6050('0x3e')][_0x750dd8['agent']['id']]['busy']=![];_0x2e404b['agents'][_0x750dd8['agent']['id']][_0x6050('0x3f')]=undefined;}}if(_0x750dd8[_0x6050('0x12')]&&_0x750dd8[_0x6050('0x12')]['id']){try{var _0x1fdafa=getId(_0x750dd8[_0x6050('0x11')],_0x750dd8[_0x6050('0x12')]?_0x750dd8[_0x6050('0x12')]['id']:0x0,_0x750dd8[_0x6050('0x13')]?_0x750dd8[_0x6050('0x13')]['id']:0x0);if(_0x2e404b['rules'][_0x1fdafa]){_0x2e404b[_0x6050('0x10')][_0x1fdafa][_0x6050('0x38')](_0x6050('0x40'));if(rpc[_0x750dd8[_0x6050('0x11')]+_0x6050('0x41')]){rpc[_0x750dd8[_0x6050('0x11')]+_0x6050('0x41')][_0x6050('0x42')](_0x1fdafa,{'UserId':_0x750dd8['message']['UserId']})['catch'](function(){logger[_0x6050('0x32')](_0x6050('0x43'));});}}return _0x5c0464({'code':0xc8,'message':_0x750dd8});}catch(_0x4230c4){logger[_0x6050('0x32')](_0x4230c4[_0x6050('0x3b')]);return _0x1eae98(_0x4ff116['error'](0x1f4,_0x4230c4));}}logger[_0x6050('0x32')](_0x6050('0x44'));return _0x1eae98(_0x4ff116[_0x6050('0x32')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x2d6cc5){var _0x149f38=this;return new Promise(function(_0x2a489b,_0x1131d8){if(_0x2d6cc5[_0x6050('0x3d')]&&_0x2d6cc5['agent']['id']){try{if(_0x2e404b[_0x6050('0x3e')][_0x2d6cc5[_0x6050('0x3d')]['id']]){_0x2e404b['agents'][_0x2d6cc5[_0x6050('0x3d')]['id']][_0x6050('0x45')]=![];_0x2e404b['agents'][_0x2d6cc5[_0x6050('0x3d')]['id']][_0x6050('0x3f')]=undefined;}return _0x2a489b({'code':0xc8,'message':_0x2d6cc5});}catch(_0x3e2861){logger[_0x6050('0x32')](_0x3e2861['stack']);return _0x1131d8(_0x149f38['error'](0x1f4,_0x3e2861));}}logger[_0x6050('0x32')](_0x6050('0x44'));return _0x1131d8(_0x149f38[_0x6050('0x32')](0x1f4,_0x6050('0x44')));});},'AbandonInteraction':function(_0x328424){var _0x2377cb=this;return new Promise(function(_0x288336,_0x412f73){if(_0x328424[_0x6050('0x11')]&&_0x328424[_0x6050('0x13')]&&_0x328424[_0x6050('0x13')]['id']){try{var _0x4661d0=getId(_0x328424[_0x6050('0x11')],_0x328424['message']?_0x328424['message']['id']:0x0,_0x328424[_0x6050('0x13')]?_0x328424['interaction']['id']:0x0);if(_0x2e404b[_0x6050('0x10')][_0x4661d0]){_0x2e404b['rules'][_0x4661d0][_0x6050('0x38')](_0x6050('0x40'));}return _0x288336({'code':0xc8,'message':_0x328424});}catch(_0x496aa8){logger[_0x6050('0x32')](_0x496aa8[_0x6050('0x3b')]);return _0x412f73(_0x2377cb[_0x6050('0x32')](0x1f4,_0x496aa8));}}logger[_0x6050('0x32')](_0x6050('0x44'));return _0x412f73(_0x2377cb[_0x6050('0x32')](0x1f4,_0x6050('0x44')));});},'AgentCapacity':function(_0x5aba76){var _0x453a75=this;return new Promise(function(_0x4f3794,_0x599adf){if(_0x2e404b[_0x6050('0x3e')]['hasOwnProperty'](_0x5aba76['id'])){for(var _0x79be7c in _0x5aba76[_0x6050('0x46')]){if(_0x5aba76[_0x6050('0x46')][_0x6050('0x47')](_0x79be7c)){if(_0x2e404b['agents'][_0x5aba76['id']][_0x6050('0x47')](_0x79be7c+'CurrentCapacity')){_0x2e404b[_0x6050('0x3e')][_0x5aba76['id']][_0x79be7c+_0x6050('0x48')]=parseInt(_0x5aba76['capacity'][_0x79be7c],0xa);}}}_0x2e404b[_0x6050('0x3e')][_0x5aba76['id']][_0x6050('0x49')]();return _0x4f3794({'code':0xc8,'message':_0x2e404b[_0x6050('0x3e')][_0x5aba76['id']]});}else{return _0x599adf(_0x453a75[_0x6050('0x32')](0x1f4,_0x6050('0x4a')));}});},'Agents':function(_0xe62909){return new Promise(function(_0x5f0293){var _0x78fd3b=_[_0x6050('0x4b')](_0x2e404b[_0x6050('0x3e')]);if(_0xe62909&&_0xe62909['id']){var _0x3f8aac=_[_0x6050('0x4c')](_0x78fd3b,function(_0x1e3076){return _0x1e3076['id']===_0xe62909['id'];});_0x5f0293(_0x3f8aac);}else{_0x5f0293({'count':_0x78fd3b[_0x6050('0x15')],'rows':_0x78fd3b});}});},'ChatQueues':function(){return new Promise(function(_0x3c3df){var _0x583e67=[];for(var _0x3abb33 in _0x2e404b[_0x6050('0x4d')]){if(_0x2e404b[_0x6050('0x4d')][_0x6050('0x47')](_0x3abb33)){var _0x3a8b71=_0x2e404b[_0x6050('0x4d')][_0x3abb33];var _0xeadcc1={'id':_0x3a8b71['id'],'available':_0x3a8b71[_0x6050('0x4e')],'loggedIn':_0x3a8b71['loggedIn'],'name':_0x3a8b71['name'],'paused':_0x3a8b71['paused'],'waiting':_0x3a8b71['waiting']};_0x583e67[_0x6050('0x1d')](_0xeadcc1);}}_0x3c3df({'count':_0x583e67[_0x6050('0x15')],'rows':_0x583e67});});},'MailQueues':function(){return new Promise(function(_0x118bc7){var _0x551c9b=[];for(var _0x1e9dd2 in _0x2e404b[_0x6050('0x4f')]){if(_0x2e404b['mailQueues'][_0x6050('0x47')](_0x1e9dd2)){var _0x56ce47=_0x2e404b[_0x6050('0x4f')][_0x1e9dd2];var _0x10161f={'id':_0x56ce47['id'],'available':_0x56ce47['available'],'loggedIn':_0x56ce47[_0x6050('0x50')],'name':_0x56ce47[_0x6050('0x51')],'paused':_0x56ce47[_0x6050('0x52')],'waiting':_0x56ce47[_0x6050('0x53')]};_0x551c9b[_0x6050('0x1d')](_0x10161f);}}_0x118bc7({'count':_0x551c9b['length'],'rows':_0x551c9b});});},'OpenchannelQueues':function(){return new Promise(function(_0x2d6757){var _0x59f794=[];for(var _0x240fe1 in _0x2e404b[_0x6050('0x54')]){if(_0x2e404b[_0x6050('0x54')][_0x6050('0x47')](_0x240fe1)){var _0x553236=_0x2e404b[_0x6050('0x54')][_0x240fe1];var _0x2ceac7={'id':_0x553236['id'],'available':_0x553236['available'],'loggedIn':_0x553236['loggedIn'],'name':_0x553236[_0x6050('0x51')],'paused':_0x553236[_0x6050('0x52')],'waiting':_0x553236[_0x6050('0x53')]};_0x59f794[_0x6050('0x1d')](_0x2ceac7);}}_0x2d6757({'count':_0x59f794[_0x6050('0x15')],'rows':_0x59f794});});},'SmsQueues':function(){return new Promise(function(_0x59873b){var _0x37297c=[];for(var _0x5ad031 in _0x2e404b[_0x6050('0x55')]){if(_0x2e404b[_0x6050('0x55')][_0x6050('0x47')](_0x5ad031)){var _0x5bbf10=_0x2e404b[_0x6050('0x55')][_0x5ad031];var _0x3d906c={'id':_0x5bbf10['id'],'available':_0x5bbf10[_0x6050('0x4e')],'loggedIn':_0x5bbf10[_0x6050('0x50')],'name':_0x5bbf10[_0x6050('0x51')],'paused':_0x5bbf10[_0x6050('0x52')],'waiting':_0x5bbf10['waiting']};_0x37297c[_0x6050('0x1d')](_0x3d906c);}}_0x59873b({'count':_0x37297c[_0x6050('0x15')],'rows':_0x37297c});});},'FaxQueues':function(){return new Promise(function(_0x3ac0a2){var _0x55e869=[];for(var _0x5bbf87 in _0x2e404b[_0x6050('0x56')]){if(_0x2e404b[_0x6050('0x56')][_0x6050('0x47')](_0x5bbf87)){var _0x33978a=_0x2e404b[_0x6050('0x56')][_0x5bbf87];var _0x368feb={'id':_0x33978a['id'],'available':_0x33978a[_0x6050('0x4e')],'loggedIn':_0x33978a[_0x6050('0x50')],'name':_0x33978a[_0x6050('0x51')],'paused':_0x33978a[_0x6050('0x52')],'waiting':_0x33978a[_0x6050('0x53')]};_0x55e869[_0x6050('0x1d')](_0x368feb);}}_0x3ac0a2({'count':_0x55e869['length'],'rows':_0x55e869});});},'WhatsappQueues':function(){return new Promise(function(_0x908fde){var _0x14c8e3=[];for(var _0xd42a36 in _0x2e404b['whatsappQueues']){if(_0x2e404b['whatsappQueues']['hasOwnProperty'](_0xd42a36)){var _0x5df52d=_0x2e404b['whatsappQueues'][_0xd42a36];var _0x1e1cfd={'id':_0x5df52d['id'],'available':_0x5df52d['available'],'loggedIn':_0x5df52d[_0x6050('0x50')],'name':_0x5df52d[_0x6050('0x51')],'paused':_0x5df52d['paused'],'waiting':_0x5df52d['waiting']};_0x14c8e3[_0x6050('0x1d')](_0x1e1cfd);}}_0x908fde({'count':_0x14c8e3[_0x6050('0x15')],'rows':_0x14c8e3});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x165bda){var _0x1ea2a6=_['values'](_0x2e404b[_0x6050('0x57')]);_0x165bda({'count':_0x1ea2a6[_0x6050('0x15')],'rows':_0x1ea2a6});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x5aaca5){var _0x33e975=_['values'](_0x2e404b[_0x6050('0x58')]);_0x5aaca5({'count':_0x33e975[_0x6050('0x15')],'rows':_0x33e975});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x533409){var _0x5ecd21=_[_0x6050('0x4b')](_0x2e404b[_0x6050('0x59')]);_0x533409({'count':_0x5ecd21[_0x6050('0x15')],'rows':_0x5ecd21});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x56d712){var _0x6257ca=_['values'](_0x2e404b[_0x6050('0x5a')]);_0x56d712({'count':_0x6257ca[_0x6050('0x15')],'rows':_0x6257ca});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x3bdf5a){var _0x557601=_[_0x6050('0x4b')](_0x2e404b[_0x6050('0x5b')]);_0x3bdf5a({'count':_0x557601[_0x6050('0x15')],'rows':_0x557601});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x49eeae){var _0x313959=_[_0x6050('0x4b')](_0x2e404b['whatsappQueuesWaitingInteractions']);_0x49eeae({'count':_0x313959[_0x6050('0x15')],'rows':_0x313959});});}};var _0x4b688a=jayson[_0x6050('0x5c')](_0x5d0a25)[_0x6050('0x5d')]();_0x4b688a['on'](_0x6050('0x32'),function(_0x69cfb5){logger['error'](JSON['stringify'](_0x69cfb5));return _0x223a06(_0x69cfb5);});_0x4b688a[_0x6050('0xf')](0x232c,'127.0.0.1',function(){console[_0x6050('0x5e')](_0x6050('0x5f'),0x232c);return _0x4b5503(_0x6050('0x60')+0x232c);});});}; \ No newline at end of file +var _0xfd28=['Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','matchPath','emit','complete','No\x20applications\x20to\x20execute','agent','agents','busy','busyQueue','end','QueueReport','UserId','catch','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','find','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','bluebird','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','Intervals','IntervalId','interval','listen','rules','message','interaction','applications','length','join','app','.js','autoreply','split','channel','mail','push','slice','dialogflow','appdata','dialogflowv2','amazonlex','tag','TagId','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','./applications/','priority','info'];(function(_0x238134,_0x46fa37){var _0x4713d1=function(_0x45f584){while(--_0x45f584){_0x238134['push'](_0x238134['shift']());}};_0x4713d1(++_0x46fa37);}(_0xfd28,0x148));var _0x8fd2=function(_0x281e5e,_0xf320e2){_0x281e5e=_0x281e5e-0x0;var _0x5a22d2=_0xfd28[_0x281e5e];return _0x5a22d2;};'use strict';var _=require('lodash');var util=require(_0x8fd2('0x0'));var path=require(_0x8fd2('0x1'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x8fd2('0x2'));var utils=require('./applications/utils');var logger=require(_0x8fd2('0x3'))(_0x8fd2('0x4'));var rpc={'openchannelQueueReport':require(_0x8fd2('0x5')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x8fd2('0x6')),'smsQueueReport':require(_0x8fd2('0x7')),'faxQueueReport':require(_0x8fd2('0x8')),'whatsappQueueReport':require(_0x8fd2('0x9'))};var RuleEngine=require(_0x8fd2('0xa'));function getId(_0x4bdc1a,_0x53d938,_0x10fccf){return util[_0x8fd2('0xb')](_0x8fd2('0xc'),_0x4bdc1a,_0x53d938||0x0,_0x10fccf||0x0);}function getIntervals(_0x4d794a,_0x13cc69){var _0x49ca87=[];if(!_[_0x8fd2('0xd')](_0x13cc69['IntervalId'])&&!_[_0x8fd2('0xd')](_0x4d794a[_0x13cc69['IntervalId']])&&!_[_0x8fd2('0xd')](_0x4d794a[_0x13cc69['IntervalId']][_0x8fd2('0xe')])){_0x49ca87=_['map'](_0x4d794a[_0x13cc69[_0x8fd2('0xf')]][_0x8fd2('0xe')],_0x8fd2('0x10'));}else if(!_[_0x8fd2('0xd')](_0x13cc69[_0x8fd2('0x10')])){_0x49ca87=[_0x13cc69[_0x8fd2('0x10')]];}return _0x49ca87;}exports[_0x8fd2('0x11')]=function(_0xf22ae){_0xf22ae[_0x8fd2('0x12')]={};return new BPromise(function(_0x2b4611,_0x118329){var _0x6b8ef={'Start':function(_0x725d57){var _0x40712c=this;return new Promise(function(_0xa65b4,_0x596639){if(_0x725d57){try{var _0x20daca=[];var _0x5ef478=getId(_0x725d57['channel'],_0x725d57['message']?_0x725d57[_0x8fd2('0x13')]['id']:0x0,_0x725d57[_0x8fd2('0x14')]?_0x725d57[_0x8fd2('0x14')]['id']:0x0);if(_0x725d57[_0x8fd2('0x15')]&&_['isArray'](_0x725d57[_0x8fd2('0x15')])&&_0x725d57[_0x8fd2('0x15')][_0x8fd2('0x16')]){for(var _0x36e675=0x0;_0x36e675<_0x725d57[_0x8fd2('0x15')]['length'];_0x36e675+=0x1){var _0x48ad51=_0x725d57[_0x8fd2('0x15')][_0x36e675];if(fs['existsSync'](path[_0x8fd2('0x17')](__dirname,'applications',_0x48ad51[_0x8fd2('0x18')]+_0x8fd2('0x19')))){var _0x4f81dc=[];switch(_0x48ad51[_0x8fd2('0x18')]['toLowerCase']()){case _0x8fd2('0x1a'):var _0x44ee7a=_0x48ad51['appdata'][_0x8fd2('0x1b')](',');if(_0x725d57[_0x8fd2('0x1c')]===_0x8fd2('0x1d')){_0x4f81dc['push'](_0x44ee7a[0x0]);_0x4f81dc[_0x8fd2('0x1e')](_0x44ee7a[0x1]);_0x4f81dc[_0x8fd2('0x1e')](_0x44ee7a[_0x8fd2('0x1f')](0x2,_0x44ee7a[_0x8fd2('0x16')])[_0x8fd2('0x17')](','));}else{_0x4f81dc[_0x8fd2('0x1e')](_0x44ee7a[0x0]);_0x4f81dc[_0x8fd2('0x1e')](_0x44ee7a[_0x8fd2('0x1f')](0x1,_0x44ee7a[_0x8fd2('0x16')])[_0x8fd2('0x17')](','));}break;case _0x8fd2('0x20'):var _0x1f3237=_0x48ad51[_0x8fd2('0x21')]['split'](',');_0x4f81dc['push'](_0x1f3237[0x0]);_0x4f81dc[_0x8fd2('0x1e')](_0x1f3237[0x1]);_0x4f81dc[_0x8fd2('0x1e')](_0x1f3237[_0x8fd2('0x1f')](0x2,_0x1f3237['length'])[_0x8fd2('0x17')](','));break;case _0x8fd2('0x22'):var _0x27b256=_0x48ad51[_0x8fd2('0x21')][_0x8fd2('0x1b')](',');_0x4f81dc[_0x8fd2('0x1e')](_0x27b256[0x0]);_0x4f81dc[_0x8fd2('0x1e')](_0x27b256[0x1]);_0x4f81dc['push'](_0x27b256[0x2]);_0x4f81dc[_0x8fd2('0x1e')](_0x27b256[0x3]);_0x4f81dc[_0x8fd2('0x1e')](_0x27b256[_0x8fd2('0x1f')](0x4,_0x27b256[_0x8fd2('0x16')])[_0x8fd2('0x17')](','));break;case _0x8fd2('0x23'):var _0x39df3a=_0x48ad51['appdata']['split'](',');_0x4f81dc['push'](_0x39df3a[0x0]);_0x4f81dc[_0x8fd2('0x1e')](_0x39df3a[0x1]);_0x4f81dc[_0x8fd2('0x1e')](_0x39df3a[0x2]);_0x4f81dc[_0x8fd2('0x1e')](_0x39df3a[0x3]);_0x4f81dc[_0x8fd2('0x1e')](_0x39df3a['slice'](0x4,_0x39df3a['length'])[_0x8fd2('0x17')](','));break;case _0x8fd2('0x13'):_0x4f81dc[_0x8fd2('0x1e')](_0x48ad51[_0x8fd2('0x21')]);break;case _0x8fd2('0x24'):_0x4f81dc['push'](_0x48ad51[_0x8fd2('0x25')]);_0x4f81dc['push'](_0x48ad51[_0x8fd2('0x21')]);break;case'tvox':var _0x445b67=utils['getMustacheRender'](_0x725d57[_0x8fd2('0x26')][_0x8fd2('0x27')],_0x725d57);var _0x39092e=_0x48ad51['appdata'][_0x8fd2('0x1b')](',');_0x4f81dc['push'](_0x39092e[0x0]);_0x4f81dc[_0x8fd2('0x1e')](_0x39092e[0x1]);_0x4f81dc[_0x8fd2('0x1e')](_0x39092e[0x2]);_0x4f81dc[_0x8fd2('0x1e')](_0x39092e[0x3]);_0x4f81dc['push'](_0x39092e[0x4]);_0x4f81dc[_0x8fd2('0x1e')](_0x39092e[0x5]);_0x4f81dc[_0x8fd2('0x1e')](_0x39092e[0x6]);_0x4f81dc[_0x8fd2('0x1e')](_0x39092e[0x7]);_0x4f81dc['push'](_0x39092e[0x8]);_0x4f81dc[_0x8fd2('0x1e')](_0x39092e[0x9]);_0x4f81dc[_0x8fd2('0x1e')](_0x39092e[0xa]);_0x4f81dc[_0x8fd2('0x1e')](_0x725d57['interaction']['id']);_0x4f81dc[_0x8fd2('0x1e')](_0x725d57[_0x8fd2('0x13')]['id']);_0x4f81dc['push'](_0x48ad51[_0x8fd2('0x28')]);_0x4f81dc[_0x8fd2('0x1e')](_0x725d57[_0x8fd2('0x14')][_0x8fd2('0x29')]);_0x4f81dc[_0x8fd2('0x1e')](_0x725d57[_0x8fd2('0x2a')][_0x8fd2('0x2a')]);_0x4f81dc['push'](_0x445b67);break;default:_0x4f81dc=_[_0x8fd2('0xd')](_0x48ad51['appdata'])?[]:_0x48ad51['appdata'][_0x8fd2('0x1b')](',');}var _0xb2c8cc={'id':util[_0x8fd2('0xb')](_0x8fd2('0x2b'),_0x5ef478,_0x48ad51['id'],_0x48ad51[_0x8fd2('0x18')]),'condition':require(_0x8fd2('0x2c'))['condition'](_0x5ef478,getIntervals(_0xf22ae['intervals'],_0x48ad51),_0xf22ae),'consequence':require(_0x8fd2('0x2d')+_0x48ad51['app'])['consequence'](_0x5ef478,_0x4f81dc,_0xf22ae,_0x725d57),'p':_0x48ad51[_0x8fd2('0x2e')]||0x0};logger[_0x8fd2('0x2f')](_0x8fd2('0x30'),_0xb2c8cc['id'],_0x8fd2('0x31'),getIntervals(_0xf22ae['intervals'],_0x48ad51)[_0x8fd2('0x17')](_0x8fd2('0x32')));_0x20daca[_0x8fd2('0x1e')](_0xb2c8cc);}else{logger[_0x8fd2('0x33')](_0x8fd2('0x34'),path[_0x8fd2('0x17')](__dirname,_0x8fd2('0x15'),_0x48ad51['app']+_0x8fd2('0x19')));}}_0xf22ae[_0x8fd2('0x12')][_0x5ef478]=new RuleEngine(_0x20daca);_0xf22ae[_0x8fd2('0x12')][_0x5ef478][_0x8fd2('0x35')](_0x725d57,function(_0xde7e1){logger[_0x8fd2('0x2f')](_0x8fd2('0x36'),JSON['stringify'](_0xde7e1[_0x8fd2('0x37')]));if(_0xf22ae[_0x8fd2('0x12')][_0x5ef478]){_0xf22ae[_0x8fd2('0x12')][_0x5ef478][_0x8fd2('0x38')](_0x8fd2('0x39'));}});return _0xa65b4({'code':0xc8,'message':_0x725d57});}else{logger[_0x8fd2('0x2f')](_0x8fd2('0x3a'));return _0xa65b4({'code':0xc8,'message':_0x725d57});}}catch(_0x592cd6){logger[_0x8fd2('0x33')](_0x592cd6['stack']);return _0x596639(_0x40712c[_0x8fd2('0x33')](0x1f4,_0x592cd6));}}return _0x596639('routing\x20is\x20empty');});},'AcceptMessage':function(_0x17710f){var _0xe511dd=this;return new Promise(function(_0x2a39ac,_0x5c0632){if(_0x17710f[_0x8fd2('0x3b')]&&_0x17710f[_0x8fd2('0x3b')]['id']){if(_0xf22ae[_0x8fd2('0x3c')][_0x17710f['agent']['id']]){_0xf22ae[_0x8fd2('0x3c')][_0x17710f['agent']['id']][_0x8fd2('0x3d')]=![];_0xf22ae[_0x8fd2('0x3c')][_0x17710f[_0x8fd2('0x3b')]['id']][_0x8fd2('0x3e')]=undefined;}}if(_0x17710f[_0x8fd2('0x13')]&&_0x17710f[_0x8fd2('0x13')]['id']){try{var _0x154b61=getId(_0x17710f[_0x8fd2('0x1c')],_0x17710f[_0x8fd2('0x13')]?_0x17710f[_0x8fd2('0x13')]['id']:0x0,_0x17710f[_0x8fd2('0x14')]?_0x17710f[_0x8fd2('0x14')]['id']:0x0);if(_0xf22ae[_0x8fd2('0x12')][_0x154b61]){_0xf22ae[_0x8fd2('0x12')][_0x154b61][_0x8fd2('0x38')](_0x8fd2('0x3f'));if(rpc[_0x17710f[_0x8fd2('0x1c')]+_0x8fd2('0x40')]){rpc[_0x17710f[_0x8fd2('0x1c')]+'QueueReport']['update'](_0x154b61,{'UserId':_0x17710f[_0x8fd2('0x13')][_0x8fd2('0x41')]})[_0x8fd2('0x42')](function(){logger['error']('error\x20update\x20queue\x20report');});}}return _0x2a39ac({'code':0xc8,'message':_0x17710f});}catch(_0x177f04){logger['error'](_0x177f04[_0x8fd2('0x43')]);return _0x5c0632(_0xe511dd[_0x8fd2('0x33')](0x1f4,_0x177f04));}}logger[_0x8fd2('0x33')]('message\x20is\x20empty');return _0x5c0632(_0xe511dd[_0x8fd2('0x33')](0x1f4,_0x8fd2('0x44')));});},'RejectMessage':function(_0x4be84b){var _0x331ada=this;return new Promise(function(_0x27f5a2,_0x19cef4){if(_0x4be84b['agent']&&_0x4be84b[_0x8fd2('0x3b')]['id']){try{if(_0xf22ae[_0x8fd2('0x3c')][_0x4be84b[_0x8fd2('0x3b')]['id']]){_0xf22ae[_0x8fd2('0x3c')][_0x4be84b[_0x8fd2('0x3b')]['id']][_0x8fd2('0x3d')]=![];_0xf22ae['agents'][_0x4be84b['agent']['id']][_0x8fd2('0x3e')]=undefined;}return _0x27f5a2({'code':0xc8,'message':_0x4be84b});}catch(_0x8c11e8){logger['error'](_0x8c11e8[_0x8fd2('0x43')]);return _0x19cef4(_0x331ada['error'](0x1f4,_0x8c11e8));}}logger['error'](_0x8fd2('0x44'));return _0x19cef4(_0x331ada[_0x8fd2('0x33')](0x1f4,_0x8fd2('0x44')));});},'AbandonInteraction':function(_0x29a00e){var _0x353450=this;return new Promise(function(_0x3de5b1,_0x52c912){if(_0x29a00e[_0x8fd2('0x1c')]&&_0x29a00e[_0x8fd2('0x14')]&&_0x29a00e[_0x8fd2('0x14')]['id']){try{var _0x930a07=getId(_0x29a00e[_0x8fd2('0x1c')],_0x29a00e['message']?_0x29a00e['message']['id']:0x0,_0x29a00e['interaction']?_0x29a00e['interaction']['id']:0x0);if(_0xf22ae['rules'][_0x930a07]){_0xf22ae[_0x8fd2('0x12')][_0x930a07][_0x8fd2('0x38')](_0x8fd2('0x3f'));}return _0x3de5b1({'code':0xc8,'message':_0x29a00e});}catch(_0x2988d0){logger[_0x8fd2('0x33')](_0x2988d0[_0x8fd2('0x43')]);return _0x52c912(_0x353450[_0x8fd2('0x33')](0x1f4,_0x2988d0));}}logger['error'](_0x8fd2('0x44'));return _0x52c912(_0x353450['error'](0x1f4,_0x8fd2('0x44')));});},'AgentCapacity':function(_0xdd46b1){var _0x478aad=this;return new Promise(function(_0x52006b,_0x3baa83){if(_0xf22ae[_0x8fd2('0x3c')][_0x8fd2('0x45')](_0xdd46b1['id'])){for(var _0x30a952 in _0xdd46b1[_0x8fd2('0x46')]){if(_0xdd46b1['capacity'][_0x8fd2('0x45')](_0x30a952)){if(_0xf22ae[_0x8fd2('0x3c')][_0xdd46b1['id']][_0x8fd2('0x45')](_0x30a952+_0x8fd2('0x47'))){_0xf22ae['agents'][_0xdd46b1['id']][_0x30a952+_0x8fd2('0x47')]=parseInt(_0xdd46b1[_0x8fd2('0x46')][_0x30a952],0xa);}}}_0xf22ae[_0x8fd2('0x3c')][_0xdd46b1['id']][_0x8fd2('0x48')]();return _0x52006b({'code':0xc8,'message':_0xf22ae['agents'][_0xdd46b1['id']]});}else{return _0x3baa83(_0x478aad['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x2e5693){return new Promise(function(_0x19e68d){var _0xb88ae7=_[_0x8fd2('0x49')](_0xf22ae[_0x8fd2('0x3c')]);if(_0x2e5693&&_0x2e5693['id']){var _0x47ede0=_[_0x8fd2('0x4a')](_0xb88ae7,function(_0x68a04a){return _0x68a04a['id']===_0x2e5693['id'];});_0x19e68d(_0x47ede0);}else{_0x19e68d({'count':_0xb88ae7['length'],'rows':_0xb88ae7});}});},'ChatQueues':function(){return new Promise(function(_0x25123f){var _0x164991=[];for(var _0x186869 in _0xf22ae[_0x8fd2('0x4b')]){if(_0xf22ae[_0x8fd2('0x4b')]['hasOwnProperty'](_0x186869)){var _0x428034=_0xf22ae[_0x8fd2('0x4b')][_0x186869];var _0x21f1a7={'id':_0x428034['id'],'available':_0x428034[_0x8fd2('0x4c')],'loggedIn':_0x428034[_0x8fd2('0x4d')],'name':_0x428034[_0x8fd2('0x4e')],'paused':_0x428034[_0x8fd2('0x4f')],'waiting':_0x428034[_0x8fd2('0x50')]};_0x164991[_0x8fd2('0x1e')](_0x21f1a7);}}_0x25123f({'count':_0x164991[_0x8fd2('0x16')],'rows':_0x164991});});},'MailQueues':function(){return new Promise(function(_0xf7c83a){var _0x4d0402=[];for(var _0x40ffd5 in _0xf22ae['mailQueues']){if(_0xf22ae[_0x8fd2('0x51')][_0x8fd2('0x45')](_0x40ffd5)){var _0x4b043d=_0xf22ae['mailQueues'][_0x40ffd5];var _0x553fa1={'id':_0x4b043d['id'],'available':_0x4b043d[_0x8fd2('0x4c')],'loggedIn':_0x4b043d[_0x8fd2('0x4d')],'name':_0x4b043d[_0x8fd2('0x4e')],'paused':_0x4b043d[_0x8fd2('0x4f')],'waiting':_0x4b043d[_0x8fd2('0x50')]};_0x4d0402[_0x8fd2('0x1e')](_0x553fa1);}}_0xf7c83a({'count':_0x4d0402['length'],'rows':_0x4d0402});});},'OpenchannelQueues':function(){return new Promise(function(_0x349e86){var _0x385321=[];for(var _0x510553 in _0xf22ae[_0x8fd2('0x52')]){if(_0xf22ae['openchannelQueues'][_0x8fd2('0x45')](_0x510553)){var _0x25d69d=_0xf22ae[_0x8fd2('0x52')][_0x510553];var _0x31e96f={'id':_0x25d69d['id'],'available':_0x25d69d[_0x8fd2('0x4c')],'loggedIn':_0x25d69d['loggedIn'],'name':_0x25d69d[_0x8fd2('0x4e')],'paused':_0x25d69d[_0x8fd2('0x4f')],'waiting':_0x25d69d['waiting']};_0x385321[_0x8fd2('0x1e')](_0x31e96f);}}_0x349e86({'count':_0x385321['length'],'rows':_0x385321});});},'SmsQueues':function(){return new Promise(function(_0x50c6a6){var _0x433912=[];for(var _0x1d36d2 in _0xf22ae['smsQueues']){if(_0xf22ae[_0x8fd2('0x53')][_0x8fd2('0x45')](_0x1d36d2)){var _0x6c766c=_0xf22ae['smsQueues'][_0x1d36d2];var _0xa773e6={'id':_0x6c766c['id'],'available':_0x6c766c[_0x8fd2('0x4c')],'loggedIn':_0x6c766c[_0x8fd2('0x4d')],'name':_0x6c766c[_0x8fd2('0x4e')],'paused':_0x6c766c[_0x8fd2('0x4f')],'waiting':_0x6c766c[_0x8fd2('0x50')]};_0x433912[_0x8fd2('0x1e')](_0xa773e6);}}_0x50c6a6({'count':_0x433912['length'],'rows':_0x433912});});},'FaxQueues':function(){return new Promise(function(_0x55f13b){var _0x132ddb=[];for(var _0xf718ec in _0xf22ae['faxQueues']){if(_0xf22ae['faxQueues']['hasOwnProperty'](_0xf718ec)){var _0x507be8=_0xf22ae['faxQueues'][_0xf718ec];var _0x32164a={'id':_0x507be8['id'],'available':_0x507be8[_0x8fd2('0x4c')],'loggedIn':_0x507be8[_0x8fd2('0x4d')],'name':_0x507be8[_0x8fd2('0x4e')],'paused':_0x507be8[_0x8fd2('0x4f')],'waiting':_0x507be8['waiting']};_0x132ddb[_0x8fd2('0x1e')](_0x32164a);}}_0x55f13b({'count':_0x132ddb[_0x8fd2('0x16')],'rows':_0x132ddb});});},'WhatsappQueues':function(){return new Promise(function(_0x3b94f9){var _0x544a19=[];for(var _0x2cdc40 in _0xf22ae[_0x8fd2('0x54')]){if(_0xf22ae['whatsappQueues'][_0x8fd2('0x45')](_0x2cdc40)){var _0x33d05e=_0xf22ae[_0x8fd2('0x54')][_0x2cdc40];var _0x2af76d={'id':_0x33d05e['id'],'available':_0x33d05e[_0x8fd2('0x4c')],'loggedIn':_0x33d05e[_0x8fd2('0x4d')],'name':_0x33d05e[_0x8fd2('0x4e')],'paused':_0x33d05e['paused'],'waiting':_0x33d05e[_0x8fd2('0x50')]};_0x544a19[_0x8fd2('0x1e')](_0x2af76d);}}_0x3b94f9({'count':_0x544a19[_0x8fd2('0x16')],'rows':_0x544a19});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x1a924f){var _0x15747d=_[_0x8fd2('0x49')](_0xf22ae[_0x8fd2('0x55')]);_0x1a924f({'count':_0x15747d['length'],'rows':_0x15747d});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x40a4fc){var _0x3607a7=_['values'](_0xf22ae[_0x8fd2('0x56')]);_0x40a4fc({'count':_0x3607a7[_0x8fd2('0x16')],'rows':_0x3607a7});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x3f8baf){var _0x131ee8=_[_0x8fd2('0x49')](_0xf22ae[_0x8fd2('0x57')]);_0x3f8baf({'count':_0x131ee8[_0x8fd2('0x16')],'rows':_0x131ee8});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x2a0c4){var _0x52de20=_[_0x8fd2('0x49')](_0xf22ae['smsQueuesWaitingInteractions']);_0x2a0c4({'count':_0x52de20['length'],'rows':_0x52de20});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x478c79){var _0x103e4b=_['values'](_0xf22ae[_0x8fd2('0x58')]);_0x478c79({'count':_0x103e4b['length'],'rows':_0x103e4b});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x5afb15){var _0x1d6bdb=_[_0x8fd2('0x49')](_0xf22ae['whatsappQueuesWaitingInteractions']);_0x5afb15({'count':_0x1d6bdb[_0x8fd2('0x16')],'rows':_0x1d6bdb});});}};var _0x2449cf=jayson[_0x8fd2('0x59')](_0x6b8ef)[_0x8fd2('0x5a')]();_0x2449cf['on']('error',function(_0x4ff263){logger[_0x8fd2('0x33')](JSON['stringify'](_0x4ff263));return _0x118329(_0x4ff263);});_0x2449cf[_0x8fd2('0x11')](0x232c,_0x8fd2('0x5b'),function(){console['log'](_0x8fd2('0x5c'),0x232c);return _0x2b4611(_0x8fd2('0x5d')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index dbef0fc..d36f9ec 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 _0xbce6=['client','request','then','error','message','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','indexOf','true','catch','[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','stack','util','jayson/promise','../../../config/logger','routing'];(function(_0x51065f,_0xd93aa8){var _0x42bed3=function(_0x2063d5){while(--_0x2063d5){_0x51065f['push'](_0x51065f['shift']());}};_0x42bed3(++_0xd93aa8);}(_0xbce6,0x1cc));var _0x6bce=function(_0x314d2f,_0x57776e){_0x314d2f=_0x314d2f-0x0;var _0x1b5397=_0xbce6[_0x314d2f];return _0x1b5397;};'use strict';var util=require(_0x6bce('0x0'));var BPromise=require('bluebird');var jayson=require(_0x6bce('0x1'));var _=require('lodash');var logger=require(_0x6bce('0x2'))(_0x6bce('0x3'));var client=jayson[_0x6bce('0x4')]['http']({'port':0x232a});function request(_0x491bbd,_0xf7117){return new BPromise(function(_0xe7749e,_0x1a54a8){return client[_0x6bce('0x5')](_0x491bbd,_0xf7117)[_0x6bce('0x6')](function(_0x1aa29e){if(_0x1aa29e[_0x6bce('0x7')]){return _0x1a54a8(_0x1aa29e[_0x6bce('0x7')][_0x6bce('0x8')]);}else{return _0xe7749e(_0x1aa29e['result']);}})['catch'](function(_0x4d687f){return _0x1a54a8(_0x4d687f);});});}exports[_0x6bce('0x9')]=function(_0xa79945,_0x465f6a,_0x3b19b8){return function(_0x4cd559){if(_0x3b19b8[_0x6bce('0xa')]&&!_0x3b19b8['rules'][_0xa79945]){logger[_0x6bce('0xb')](_0x6bce('0xc'),_0xa79945);return _0x4cd559[_0x6bce('0xd')]();}var _0x1f3d2e=[];for(var _0x165c17=0x0;_0x165c17<_0x465f6a[_0x6bce('0xe')];_0x165c17+=0x1){_0x1f3d2e[_0x6bce('0xf')](request(_0x6bce('0x10'),{'command':util[_0x6bce('0x11')](_0x6bce('0x12'),_0x465f6a[_0x165c17])})[_0x6bce('0x6')](function(_0x54eda4){return _0x54eda4&&_0x54eda4['message']&&_0x54eda4[_0x6bce('0x8')][_0x6bce('0x13')](_0x6bce('0x14'))>=0x0?!![]:![];})[_0x6bce('0x15')](function(_0x3f7fdc){logger['error'](_0x6bce('0x16'),_0xa79945,_0x465f6a[_0x165c17]);}));}BPromise['all'](_0x1f3d2e)[_0x6bce('0x6')](function(_0x29415e){var _0x5e1a25=_[_0x6bce('0x17')](_0x29415e);logger[_0x6bce('0xb')](_0x6bce('0x18'),_0xa79945,_0x465f6a[_0x6bce('0x19')](_0x6bce('0x1a')),_0x5e1a25);_0x4cd559[_0x6bce('0x1b')](_0x5e1a25);})['catch'](function(_0x5bc86d){console['log'](_0x5bc86d);logger[_0x6bce('0x7')](_0x6bce('0x18'),_0xa79945,_0x465f6a[_0x6bce('0x19')](_0x6bce('0x1a')),_0x5bc86d[_0x6bce('0x1c')]);_0x4cd559['stop']();});};}; \ No newline at end of file +var _0x6486=['[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','stack','util','jayson/promise','../../../config/logger','client','http','then','error','message','catch','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','Command','format','iftime\x20%s','true','all','some','info'];(function(_0xea73f,_0x4d4ce7){var _0x7ee2e9=function(_0x11293f){while(--_0x11293f){_0xea73f['push'](_0xea73f['shift']());}};_0x7ee2e9(++_0x4d4ce7);}(_0x6486,0x185));var _0x6648=function(_0x5c7f5d,_0x9f23e9){_0x5c7f5d=_0x5c7f5d-0x0;var _0x2e8991=_0x6486[_0x5c7f5d];return _0x2e8991;};'use strict';var util=require(_0x6648('0x0'));var BPromise=require('bluebird');var jayson=require(_0x6648('0x1'));var _=require('lodash');var logger=require(_0x6648('0x2'))('routing');var client=jayson[_0x6648('0x3')][_0x6648('0x4')]({'port':0x232a});function request(_0x2d3e2e,_0x357bd5){return new BPromise(function(_0x42396c,_0x3a75a6){return client['request'](_0x2d3e2e,_0x357bd5)[_0x6648('0x5')](function(_0x2d52d2){if(_0x2d52d2[_0x6648('0x6')]){return _0x3a75a6(_0x2d52d2[_0x6648('0x6')][_0x6648('0x7')]);}else{return _0x42396c(_0x2d52d2['result']);}})[_0x6648('0x8')](function(_0x162625){return _0x3a75a6(_0x162625);});});}exports['condition']=function(_0xf5883a,_0x56c2b0,_0x3aa70c){return function(_0x308599){if(_0x3aa70c['rules']&&!_0x3aa70c['rules'][_0xf5883a]){logger['info'](_0x6648('0x9'),_0xf5883a);return _0x308599[_0x6648('0xa')]();}var _0x2ecad6=[];for(var _0x3c3684=0x0;_0x3c3684<_0x56c2b0['length'];_0x3c3684+=0x1){_0x2ecad6[_0x6648('0xb')](request(_0x6648('0xc'),{'command':util[_0x6648('0xd')](_0x6648('0xe'),_0x56c2b0[_0x3c3684])})[_0x6648('0x5')](function(_0x219782){return _0x219782&&_0x219782[_0x6648('0x7')]&&_0x219782['message']['indexOf'](_0x6648('0xf'))>=0x0?!![]:![];})[_0x6648('0x8')](function(_0x5b4871){logger[_0x6648('0x6')]('[%s][INTERVAL]\x20%s',_0xf5883a,_0x56c2b0[_0x3c3684]);}));}BPromise[_0x6648('0x10')](_0x2ecad6)[_0x6648('0x5')](function(_0x1b333a){var _0x29b409=_[_0x6648('0x11')](_0x1b333a);logger[_0x6648('0x12')](_0x6648('0x13'),_0xf5883a,_0x56c2b0[_0x6648('0x14')](_0x6648('0x15')),_0x29b409);_0x308599[_0x6648('0x16')](_0x29b409);})[_0x6648('0x8')](function(_0x314932){console['log'](_0x314932);logger[_0x6648('0x6')](_0x6648('0x13'),_0xf5883a,_0x56c2b0[_0x6648('0x14')]('\x20|\x20'),_0x314932[_0x6648('0x17')]);_0x308599['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index b933d0f..b40afd3 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 _0xb7e7=['answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','secondtransfereruniqueid','transfereeuniqueid','agententerreason','clone','calleridname','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transfertargetuniqueid','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','lodash','./utils','format','uniqueid','channel','queue','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','destuniqueid','agentcalledAt','now','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','reason','timeout','holdtime','ringtime','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','talktime','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere'];(function(_0x51aecb,_0x54bb2d){var _0x119a69=function(_0x1b79d7){while(--_0x1b79d7){_0x51aecb['push'](_0x51aecb['shift']());}};_0x119a69(++_0x54bb2d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0xb7e7[_0x38ced4];return _0x547c07;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var utils=require(_0x7b7e('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x518dc6,_0x1b7cc7){utils['info'](util[_0x7b7e('0x2')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x518dc6[_0x7b7e('0x3')],_0x518dc6[_0x7b7e('0x4')],_0x518dc6[_0x7b7e('0x5')],_0x518dc6['membername'],_0x518dc6['interface'],_0x518dc6[_0x7b7e('0x6')],_0x518dc6[_0x7b7e('0x7')],_0x518dc6[_0x7b7e('0x8')]));if(_0x518dc6['queue']){utils[_0x7b7e('0x9')](_0x518dc6[_0x7b7e('0x5')])[_0x7b7e('0xa')](function(_0x1647e5){if(_0x1647e5){_0x518dc6[_0x7b7e('0xb')]=_0x1647e5[_0x7b7e('0xb')];_0x518dc6[_0x7b7e('0xc')]=_0x518dc6['agentcomplete']?_0x1647e5[_0x7b7e('0xd')]:![];_0x518dc6[_0x7b7e('0xe')]=_0x518dc6[_0x7b7e('0xc')]?_0x1647e5[_0x7b7e('0xf')]:0x0;}utils[_0x7b7e('0x10')](_0x7b7e('0x11'),_0x518dc6);});}else{utils[_0x7b7e('0x10')](_0x7b7e('0x11'),_0x518dc6);}if(_0x1b7cc7){delete transfers[_0x518dc6[_0x7b7e('0x3')]];}else{delete agents[_0x518dc6['destuniqueid']];}}exports[_0x7b7e('0x12')]=function(_0x430eab){try{utils['debug'](util[_0x7b7e('0x2')]('[%s][agents][agentcalled]',_0x430eab['uniqueid']),_0x430eab);agents[_0x430eab[_0x7b7e('0x13')]]=_0x430eab;agents[_0x430eab[_0x7b7e('0x13')]][_0x7b7e('0x14')]=utils[_0x7b7e('0x15')]();agents[_0x430eab[_0x7b7e('0x13')]]['lastevent']='called';agents[_0x430eab[_0x7b7e('0x13')]][_0x7b7e('0x7')]=null;agents[_0x430eab[_0x7b7e('0x13')]][_0x7b7e('0x16')]=null;utils[_0x7b7e('0x17')](util[_0x7b7e('0x2')](_0x7b7e('0x18'),_0x430eab[_0x7b7e('0x3')],agents[_0x430eab[_0x7b7e('0x13')]][_0x7b7e('0x19')],_0x430eab[_0x7b7e('0x13')]));}catch(_0x14f4fe){utils[_0x7b7e('0x1a')](util[_0x7b7e('0x2')](_0x7b7e('0x1b'),_0x430eab[_0x7b7e('0x3')]),_0x14f4fe);}};exports[_0x7b7e('0x1c')]=function(_0x49eddb){try{if(!_[_0x7b7e('0x1d')](agents[_0x49eddb[_0x7b7e('0x13')]])){utils[_0x7b7e('0x1e')](util['format'](_0x7b7e('0x1f'),_0x49eddb[_0x7b7e('0x3')]),_0x49eddb);utils[_0x7b7e('0x17')](util[_0x7b7e('0x2')](_0x7b7e('0x20'),_0x49eddb[_0x7b7e('0x3')],agents[_0x49eddb[_0x7b7e('0x13')]][_0x7b7e('0x19')],_0x49eddb['destuniqueid']));agents[_0x49eddb['destuniqueid']]['agentringnoanswer']=!![];agents[_0x49eddb[_0x7b7e('0x13')]][_0x7b7e('0x21')]=utils[_0x7b7e('0x15')]();agents[_0x49eddb['destuniqueid']]['lastevent']='timeout';agents[_0x49eddb[_0x7b7e('0x13')]][_0x7b7e('0x22')]=_0x7b7e('0x23');agents[_0x49eddb[_0x7b7e('0x13')]][_0x7b7e('0x24')]=_0x49eddb['ringtime']?parseInt(_0x49eddb[_0x7b7e('0x25')])/0x3e8:0x0;agents[_0x49eddb[_0x7b7e('0x13')]]['talktime']=0x0;unanswered['push'](_0x49eddb['destuniqueid']);}}catch(_0x12ef0b){utils[_0x7b7e('0x1a')](util['format'](_0x7b7e('0x1f'),_0x49eddb['uniqueid']),_0x12ef0b);}};exports[_0x7b7e('0x26')]=function(_0xb9b6bf){try{_[_0x7b7e('0x27')](agents,function(_0x5515ca,_0x3960b8){if(_0x5515ca[_0x7b7e('0x3')]==_0xb9b6bf[_0x7b7e('0x3')]&&!_[_0x7b7e('0x28')](unanswered,_0x5515ca[_0x7b7e('0x13')])){utils['debug'](util[_0x7b7e('0x2')]('[%s][agents][queuecallerabandon]',_0xb9b6bf[_0x7b7e('0x3')]),_0xb9b6bf);utils[_0x7b7e('0x17')](util[_0x7b7e('0x2')](_0x7b7e('0x29'),_0xb9b6bf[_0x7b7e('0x3')],_0x5515ca[_0x7b7e('0x19')],_0x5515ca[_0x7b7e('0x13')]));_0x5515ca['agentringnoanswer']=!![];_0x5515ca['agentringnoanswerAt']=utils[_0x7b7e('0x15')]();_0x5515ca[_0x7b7e('0x8')]='abandoned';_0x5515ca[_0x7b7e('0x22')]=_0x7b7e('0x2a');_0x5515ca[_0x7b7e('0x24')]=_0xb9b6bf['holdtime'];_0x5515ca[_0x7b7e('0x2b')]=0x0;writeDB(_0x5515ca);}});}catch(_0x256908){utils[_0x7b7e('0x1a')](util[_0x7b7e('0x2')](_0x7b7e('0x2c'),_0xb9b6bf[_0x7b7e('0x3')]),_0x256908);}};exports[_0x7b7e('0x2d')]=function(_0x202f04){try{if(agents[_0x202f04[_0x7b7e('0x13')]]){utils[_0x7b7e('0x1e')](util[_0x7b7e('0x2')](_0x7b7e('0x2e'),_0x202f04[_0x7b7e('0x3')]),_0x202f04);utils[_0x7b7e('0x17')](util[_0x7b7e('0x2')](_0x7b7e('0x2f'),_0x202f04['uniqueid'],agents[_0x202f04[_0x7b7e('0x13')]][_0x7b7e('0x19')],_0x202f04[_0x7b7e('0x13')]));agents[_0x202f04[_0x7b7e('0x13')]][_0x7b7e('0x30')]=utils[_0x7b7e('0x15')]();agents[_0x202f04[_0x7b7e('0x13')]][_0x7b7e('0x7')]=_0x202f04[_0x7b7e('0x7')];agents[_0x202f04[_0x7b7e('0x13')]]['connectedlinename']=_0x202f04[_0x7b7e('0x16')];agents[_0x202f04[_0x7b7e('0x13')]][_0x7b7e('0x24')]=_0x202f04[_0x7b7e('0x25')];agents[_0x202f04['destuniqueid']][_0x7b7e('0x8')]=_0x7b7e('0x31');_[_0x7b7e('0x27')](agents,function(_0x5c58c0,_0x4a2888){if(_0x5c58c0[_0x7b7e('0x13')]!=_0x202f04['destuniqueid']&&_0x5c58c0[_0x7b7e('0x3')]==_0x202f04[_0x7b7e('0x3')]){_0x5c58c0['talktime']=0x0;_0x5c58c0[_0x7b7e('0x24')]=_0x202f04[_0x7b7e('0x25')];_0x5c58c0[_0x7b7e('0x1c')]=!![];_0x5c58c0[_0x7b7e('0x21')]=utils[_0x7b7e('0x15')]();_0x5c58c0[_0x7b7e('0x8')]=_0x7b7e('0x32');_0x5c58c0[_0x7b7e('0x22')]=_0x7b7e('0x32');_0x5c58c0['answeredelsewheredestinationuniqueid']=_0x202f04['destuniqueid'];_0x5c58c0[_0x7b7e('0x33')]=_0x202f04['membername'];writeDB(_0x5c58c0);}});}}catch(_0x41c8a6){utils['error'](util['format'](_0x7b7e('0x2e'),_0x202f04['uniqueid']),_0x41c8a6);}};exports[_0x7b7e('0x34')]=function(_0x52051c){try{if(!_[_0x7b7e('0x1d')](agents[_0x52051c[_0x7b7e('0x13')]])){utils[_0x7b7e('0x1e')](util[_0x7b7e('0x2')]('[%s][agents][agentcomplete]',_0x52051c[_0x7b7e('0x3')]),_0x52051c);utils[_0x7b7e('0x17')](util[_0x7b7e('0x2')](_0x7b7e('0x35'),_0x52051c[_0x7b7e('0x3')],agents[_0x52051c[_0x7b7e('0x13')]]['membername'],_0x52051c['destuniqueid']));agents[_0x52051c['destuniqueid']][_0x7b7e('0x34')]=!![];agents[_0x52051c[_0x7b7e('0x13')]][_0x7b7e('0x36')]=utils[_0x7b7e('0x15')]();agents[_0x52051c[_0x7b7e('0x13')]][_0x7b7e('0x2b')]=utils['diffTime'](agents[_0x52051c[_0x7b7e('0x13')]][_0x7b7e('0x36')],agents[_0x52051c['destuniqueid']]['agentconnectAt']);agents[_0x52051c[_0x7b7e('0x13')]][_0x7b7e('0x22')]=_0x52051c[_0x7b7e('0x22')];agents[_0x52051c[_0x7b7e('0x13')]][_0x7b7e('0x8')]=_0x7b7e('0x37');writeDB(agents[_0x52051c['destuniqueid']]);}}catch(_0x2673eb){utils['error'](util[_0x7b7e('0x2')](_0x7b7e('0x38'),_0x52051c[_0x7b7e('0x3')]),_0x2673eb);}};exports[_0x7b7e('0x39')]=function(_0x58e4e6){try{if(!_[_0x7b7e('0x1d')](agents[_0x58e4e6[_0x7b7e('0x3a')]])){utils[_0x7b7e('0x1e')](util[_0x7b7e('0x2')](_0x7b7e('0x3b'),_0x58e4e6['uniqueid']),_0x58e4e6);utils[_0x7b7e('0x17')](util[_0x7b7e('0x2')](_0x7b7e('0x3c'),_0x58e4e6[_0x7b7e('0x3')],agents[_0x58e4e6[_0x7b7e('0x3a')]]['membername'],agents[_0x58e4e6[_0x7b7e('0x3a')]][_0x7b7e('0x3')]));agents[_0x58e4e6[_0x7b7e('0x3a')]][_0x7b7e('0x3d')]=!![];agents[_0x58e4e6[_0x7b7e('0x3a')]][_0x7b7e('0x3e')]=_0x7b7e('0x3f');agents[_0x58e4e6['transfereruniqueid']][_0x7b7e('0x40')]=_0x58e4e6['extension'];agents[_0x58e4e6[_0x7b7e('0x3a')]][_0x7b7e('0x41')]=agents[_0x58e4e6['transfereruniqueid']][_0x7b7e('0x3')];}}catch(_0x44e3a0){utils[_0x7b7e('0x1a')](util[_0x7b7e('0x2')](_0x7b7e('0x3b'),_0x58e4e6[_0x7b7e('0x3')]),_0x44e3a0);}};exports[_0x7b7e('0x42')]=function(_0x5f15ce){try{utils[_0x7b7e('0x1e')](util[_0x7b7e('0x2')](_0x7b7e('0x43'),_0x5f15ce[_0x7b7e('0x44')]),_0x5f15ce);if(_0x5f15ce['origtransfereruniqueid']==_0x5f15ce['origtransfererlinkedid']){if(!_['isNil'](agents[_0x5f15ce[_0x7b7e('0x45')]])){utils[_0x7b7e('0x17')](util[_0x7b7e('0x2')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x5f15ce['origtransfereruniqueid'],agents[_0x5f15ce[_0x7b7e('0x45')]][_0x7b7e('0x19')]));agents[_0x5f15ce['secondtransfereruniqueid']][_0x7b7e('0x3d')]=!![];agents[_0x5f15ce[_0x7b7e('0x45')]][_0x7b7e('0x3e')]='ATTENDED';agents[_0x5f15ce[_0x7b7e('0x45')]][_0x7b7e('0x40')]=_0x5f15ce['origtransfererexten'];agents[_0x5f15ce[_0x7b7e('0x45')]][_0x7b7e('0x41')]=_0x5f15ce[_0x7b7e('0x44')];}if(_0x5f15ce[_0x7b7e('0x46')]&&agents[_0x5f15ce[_0x7b7e('0x46')]]){agents[_0x5f15ce[_0x7b7e('0x46')]][_0x7b7e('0x47')]=0x1;transfers[_0x5f15ce[_0x7b7e('0x46')]]=_[_0x7b7e('0x48')](agents[_0x5f15ce['transfereeuniqueid']]);transfers[_0x5f15ce[_0x7b7e('0x46')]][_0x7b7e('0x6')]=agents[_0x5f15ce['secondtransfereruniqueid']][_0x7b7e('0x6')];transfers[_0x5f15ce[_0x7b7e('0x46')]][_0x7b7e('0x49')]=agents[_0x5f15ce['secondtransfereruniqueid']][_0x7b7e('0x49')];transfers[_0x5f15ce['transfereeuniqueid']][_0x7b7e('0x14')]=utils[_0x7b7e('0x15')]();transfers[_0x5f15ce['transfereeuniqueid']][_0x7b7e('0x30')]=utils[_0x7b7e('0x15')]();transfers[_0x5f15ce['transfereeuniqueid']][_0x7b7e('0x24')]=0x0;transfers[_0x5f15ce[_0x7b7e('0x46')]][_0x7b7e('0x47')]=0x2;}}else if(_0x5f15ce[_0x7b7e('0x45')]==_0x5f15ce['secondtransfererlinkedid']){if(!_[_0x7b7e('0x1d')](agents[_0x5f15ce[_0x7b7e('0x44')]])){utils[_0x7b7e('0x17')](util[_0x7b7e('0x2')](_0x7b7e('0x4a'),_0x5f15ce[_0x7b7e('0x44')],agents[_0x5f15ce[_0x7b7e('0x44')]][_0x7b7e('0x19')]));agents[_0x5f15ce[_0x7b7e('0x44')]][_0x7b7e('0x3d')]=!![];agents[_0x5f15ce['origtransfereruniqueid']][_0x7b7e('0x3e')]='ATTENDED';agents[_0x5f15ce['origtransfereruniqueid']][_0x7b7e('0x40')]=_0x5f15ce[_0x7b7e('0x4b')];agents[_0x5f15ce[_0x7b7e('0x44')]][_0x7b7e('0x41')]=_0x5f15ce['secondtransfereruniqueid'];}if(_0x5f15ce[_0x7b7e('0x4c')]&&agents[_0x5f15ce[_0x7b7e('0x4c')]]){agents[_0x5f15ce[_0x7b7e('0x4c')]][_0x7b7e('0x47')]=0x1;transfers[_0x5f15ce[_0x7b7e('0x4c')]]=_[_0x7b7e('0x48')](agents[_0x5f15ce['transfertargetuniqueid']]);transfers[_0x5f15ce[_0x7b7e('0x4c')]]['calleridnum']=agents[_0x5f15ce['origtransfereruniqueid']][_0x7b7e('0x6')];transfers[_0x5f15ce['transfertargetuniqueid']][_0x7b7e('0x49')]=agents[_0x5f15ce['origtransfereruniqueid']][_0x7b7e('0x49')];transfers[_0x5f15ce[_0x7b7e('0x4c')]]['agentcalledAt']=utils[_0x7b7e('0x15')]();transfers[_0x5f15ce[_0x7b7e('0x4c')]]['agentconnectAt']=utils[_0x7b7e('0x15')]();transfers[_0x5f15ce[_0x7b7e('0x4c')]][_0x7b7e('0x24')]=0x0;transfers[_0x5f15ce[_0x7b7e('0x4c')]][_0x7b7e('0x47')]=0x2;}}}catch(_0x2147d9){utils[_0x7b7e('0x1a')](util[_0x7b7e('0x2')](_0x7b7e('0x43'),_0x5f15ce[_0x7b7e('0x44')]),_0x2147d9);}};exports['hangup']=function(_0x59ecf9){try{utils[_0x7b7e('0x1e')](util[_0x7b7e('0x2')](_0x7b7e('0x4d'),_0x59ecf9[_0x7b7e('0x3')]),_0x59ecf9);if(agents[_0x59ecf9[_0x7b7e('0x3')]]&&agents[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x22')]==='timeout'){if(_0x59ecf9[_0x7b7e('0x4e')]==='21'){agents[_0x59ecf9[_0x7b7e('0x3')]]['reason']=_0x7b7e('0x4f');agents[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x8')]=_0x7b7e('0x4f');}utils[_0x7b7e('0x17')](util[_0x7b7e('0x2')](_0x7b7e('0x50'),_0x59ecf9[_0x7b7e('0x3')],agents[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x19')],agents[_0x59ecf9[_0x7b7e('0x3')]]['reason'],agents[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x8')]));writeDB(agents[_0x59ecf9[_0x7b7e('0x3')]]);var _0x122053=unanswered[_0x7b7e('0x51')](_0x59ecf9[_0x7b7e('0x3')]);if(_0x122053>-0x1){unanswered[_0x7b7e('0x52')](_0x122053,0x1);}}if(transfers[_0x59ecf9['uniqueid']]){transfers[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x34')]=!![];transfers[_0x59ecf9[_0x7b7e('0x3')]]['agentcompleteAt']=utils[_0x7b7e('0x15')]();transfers[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x2b')]=utils[_0x7b7e('0x53')](transfers[_0x59ecf9[_0x7b7e('0x3')]]['agentcompleteAt'],transfers[_0x59ecf9['uniqueid']]['agentconnectAt']);transfers[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x22')]=_0x7b7e('0x54');transfers[_0x59ecf9['uniqueid']][_0x7b7e('0x8')]=_0x7b7e('0x37');utils[_0x7b7e('0x17')](util['format'](_0x7b7e('0x50'),_0x59ecf9[_0x7b7e('0x3')],transfers[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x19')],transfers[_0x59ecf9['uniqueid']][_0x7b7e('0x22')],transfers[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x8')]));writeDB(transfers[_0x59ecf9[_0x7b7e('0x3')]],!![]);}if(agents[_0x59ecf9['uniqueid']]&&agents[_0x59ecf9['uniqueid']][_0x7b7e('0x30')]){agents[_0x59ecf9['uniqueid']][_0x7b7e('0x34')]=!![];agents[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x36')]=utils[_0x7b7e('0x15')]();agents[_0x59ecf9['uniqueid']][_0x7b7e('0x2b')]=utils[_0x7b7e('0x53')](agents[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x36')],agents[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x30')]);agents[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x22')]=agents[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x3d')]?_0x7b7e('0x3d'):_0x7b7e('0x54');agents[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x8')]=_0x7b7e('0x37');utils[_0x7b7e('0x17')](util['format'](_0x7b7e('0x50'),_0x59ecf9[_0x7b7e('0x3')],agents[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x19')],agents[_0x59ecf9[_0x7b7e('0x3')]][_0x7b7e('0x22')],agents[_0x59ecf9[_0x7b7e('0x3')]]['lastevent']));writeDB(agents[_0x59ecf9[_0x7b7e('0x3')]]);}}catch(_0x3880be){utils[_0x7b7e('0x1a')](util[_0x7b7e('0x2')](_0x7b7e('0x4d'),_0x59ecf9['uniqueid']),_0x3880be);}}; \ No newline at end of file +var _0x96cc=['rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','agent','lodash','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acwtime','acwTimeout','CreateVoiceAgentReport','request','agentcalled','debug','destuniqueid','agentcalledAt','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','reason','timeout','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','agentconnectAt','connectedlinename','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','calleridnum','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','clone','hangup','[%s][agents][hangup]','cause'];(function(_0x10b4be,_0x17a0f5){var _0x15fba7=function(_0x1a8edb){while(--_0x1a8edb){_0x10b4be['push'](_0x10b4be['shift']());}};_0x15fba7(++_0x17a0f5);}(_0x96cc,0x16c));var _0xc96c=function(_0x5d88c0,_0x5d7d83){_0x5d88c0=_0x5d88c0-0x0;var _0x1b40f0=_0x96cc[_0x5d88c0];return _0x1b40f0;};'use strict';var _=require(_0xc96c('0x0'));var util=require('util');var utils=require(_0xc96c('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5f11f2,_0x30bf8a){utils[_0xc96c('0x2')](util[_0xc96c('0x3')](_0xc96c('0x4'),_0x5f11f2[_0xc96c('0x5')],_0x5f11f2[_0xc96c('0x6')],_0x5f11f2[_0xc96c('0x7')],_0x5f11f2[_0xc96c('0x8')],_0x5f11f2[_0xc96c('0x9')],_0x5f11f2['calleridnum'],_0x5f11f2[_0xc96c('0xa')],_0x5f11f2[_0xc96c('0xb')]));if(_0x5f11f2[_0xc96c('0x7')]){utils[_0xc96c('0xc')](_0x5f11f2[_0xc96c('0x7')])[_0xc96c('0xd')](function(_0x36b2b4){if(_0x36b2b4){_0x5f11f2['type']=_0x36b2b4[_0xc96c('0xe')];_0x5f11f2[_0xc96c('0xf')]=_0x5f11f2[_0xc96c('0x10')]?_0x36b2b4['acw']:![];_0x5f11f2[_0xc96c('0x11')]=_0x5f11f2['agentacw']?_0x36b2b4[_0xc96c('0x12')]:0x0;}utils['request'](_0xc96c('0x13'),_0x5f11f2);});}else{utils[_0xc96c('0x14')](_0xc96c('0x13'),_0x5f11f2);}if(_0x30bf8a){delete transfers[_0x5f11f2[_0xc96c('0x5')]];}else{delete agents[_0x5f11f2['destuniqueid']];}}exports[_0xc96c('0x15')]=function(_0x43fcaa){try{utils[_0xc96c('0x16')](util[_0xc96c('0x3')]('[%s][agents][agentcalled]',_0x43fcaa[_0xc96c('0x5')]),_0x43fcaa);agents[_0x43fcaa[_0xc96c('0x17')]]=_0x43fcaa;agents[_0x43fcaa[_0xc96c('0x17')]][_0xc96c('0x18')]=utils[_0xc96c('0x19')]();agents[_0x43fcaa[_0xc96c('0x17')]][_0xc96c('0xb')]=_0xc96c('0x1a');agents[_0x43fcaa[_0xc96c('0x17')]][_0xc96c('0xa')]=null;agents[_0x43fcaa[_0xc96c('0x17')]]['connectedlinename']=null;utils['info'](util[_0xc96c('0x3')](_0xc96c('0x1b'),_0x43fcaa[_0xc96c('0x5')],agents[_0x43fcaa[_0xc96c('0x17')]]['membername'],_0x43fcaa[_0xc96c('0x17')]));}catch(_0x100fdb){utils[_0xc96c('0x1c')](util[_0xc96c('0x3')](_0xc96c('0x1d'),_0x43fcaa[_0xc96c('0x5')]),_0x100fdb);}};exports[_0xc96c('0x1e')]=function(_0x41daba){try{if(!_[_0xc96c('0x1f')](agents[_0x41daba[_0xc96c('0x17')]])){utils[_0xc96c('0x16')](util[_0xc96c('0x3')](_0xc96c('0x20'),_0x41daba[_0xc96c('0x5')]),_0x41daba);utils[_0xc96c('0x2')](util[_0xc96c('0x3')](_0xc96c('0x21'),_0x41daba['uniqueid'],agents[_0x41daba[_0xc96c('0x17')]][_0xc96c('0x8')],_0x41daba[_0xc96c('0x17')]));agents[_0x41daba[_0xc96c('0x17')]][_0xc96c('0x1e')]=!![];agents[_0x41daba[_0xc96c('0x17')]][_0xc96c('0x22')]=utils[_0xc96c('0x19')]();agents[_0x41daba[_0xc96c('0x17')]][_0xc96c('0xb')]='timeout';agents[_0x41daba[_0xc96c('0x17')]][_0xc96c('0x23')]=_0xc96c('0x24');agents[_0x41daba[_0xc96c('0x17')]]['holdtime']=_0x41daba['ringtime']?parseInt(_0x41daba[_0xc96c('0x25')])/0x3e8:0x0;agents[_0x41daba[_0xc96c('0x17')]][_0xc96c('0x26')]=0x0;unanswered[_0xc96c('0x27')](_0x41daba[_0xc96c('0x17')]);}}catch(_0x5e1727){utils[_0xc96c('0x1c')](util[_0xc96c('0x3')](_0xc96c('0x20'),_0x41daba[_0xc96c('0x5')]),_0x5e1727);}};exports[_0xc96c('0x28')]=function(_0x40c72b){try{_[_0xc96c('0x29')](agents,function(_0x328ee4,_0x556108){if(_0x328ee4[_0xc96c('0x5')]==_0x40c72b['uniqueid']&&!_[_0xc96c('0x2a')](unanswered,_0x328ee4[_0xc96c('0x17')])){utils[_0xc96c('0x16')](util['format'](_0xc96c('0x2b'),_0x40c72b[_0xc96c('0x5')]),_0x40c72b);utils[_0xc96c('0x2')](util[_0xc96c('0x3')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x40c72b['uniqueid'],_0x328ee4[_0xc96c('0x8')],_0x328ee4[_0xc96c('0x17')]));_0x328ee4[_0xc96c('0x1e')]=!![];_0x328ee4['agentringnoanswerAt']=utils[_0xc96c('0x19')]();_0x328ee4[_0xc96c('0xb')]=_0xc96c('0x2c');_0x328ee4[_0xc96c('0x23')]='abandoned';_0x328ee4[_0xc96c('0x2d')]=_0x40c72b[_0xc96c('0x2d')];_0x328ee4['talktime']=0x0;writeDB(_0x328ee4);}});}catch(_0x2b1dec){utils[_0xc96c('0x1c')](util[_0xc96c('0x3')](_0xc96c('0x2b'),_0x40c72b[_0xc96c('0x5')]),_0x2b1dec);}};exports[_0xc96c('0x2e')]=function(_0x4e8241){try{if(agents[_0x4e8241[_0xc96c('0x17')]]){utils[_0xc96c('0x16')](util[_0xc96c('0x3')](_0xc96c('0x2f'),_0x4e8241[_0xc96c('0x5')]),_0x4e8241);utils[_0xc96c('0x2')](util['format']('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x4e8241[_0xc96c('0x5')],agents[_0x4e8241[_0xc96c('0x17')]]['membername'],_0x4e8241['destuniqueid']));agents[_0x4e8241[_0xc96c('0x17')]][_0xc96c('0x30')]=utils[_0xc96c('0x19')]();agents[_0x4e8241[_0xc96c('0x17')]][_0xc96c('0xa')]=_0x4e8241[_0xc96c('0xa')];agents[_0x4e8241[_0xc96c('0x17')]][_0xc96c('0x31')]=_0x4e8241[_0xc96c('0x31')];agents[_0x4e8241[_0xc96c('0x17')]][_0xc96c('0x2d')]=_0x4e8241['ringtime'];agents[_0x4e8241[_0xc96c('0x17')]][_0xc96c('0xb')]=_0xc96c('0x32');_[_0xc96c('0x29')](agents,function(_0x4eb180,_0x167671){if(_0x4eb180[_0xc96c('0x17')]!=_0x4e8241[_0xc96c('0x17')]&&_0x4eb180['uniqueid']==_0x4e8241['uniqueid']){_0x4eb180[_0xc96c('0x26')]=0x0;_0x4eb180[_0xc96c('0x2d')]=_0x4e8241[_0xc96c('0x25')];_0x4eb180['agentringnoanswer']=!![];_0x4eb180[_0xc96c('0x22')]=utils[_0xc96c('0x19')]();_0x4eb180[_0xc96c('0xb')]=_0xc96c('0x33');_0x4eb180[_0xc96c('0x23')]=_0xc96c('0x33');_0x4eb180[_0xc96c('0x34')]=_0x4e8241[_0xc96c('0x17')];_0x4eb180[_0xc96c('0x35')]=_0x4e8241['membername'];writeDB(_0x4eb180);}});}}catch(_0x4c3088){utils[_0xc96c('0x1c')](util[_0xc96c('0x3')](_0xc96c('0x2f'),_0x4e8241[_0xc96c('0x5')]),_0x4c3088);}};exports['agentcomplete']=function(_0x5ee6ac){try{if(!_[_0xc96c('0x1f')](agents[_0x5ee6ac[_0xc96c('0x17')]])){utils[_0xc96c('0x16')](util[_0xc96c('0x3')](_0xc96c('0x36'),_0x5ee6ac[_0xc96c('0x5')]),_0x5ee6ac);utils[_0xc96c('0x2')](util['format'](_0xc96c('0x37'),_0x5ee6ac[_0xc96c('0x5')],agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0x8')],_0x5ee6ac['destuniqueid']));agents[_0x5ee6ac['destuniqueid']][_0xc96c('0x10')]=!![];agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0x38')]=utils[_0xc96c('0x19')]();agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0x26')]=utils[_0xc96c('0x39')](agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0x38')],agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0x30')]);agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0x23')]=_0x5ee6ac['reason'];agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0xb')]=_0xc96c('0x3a');writeDB(agents[_0x5ee6ac[_0xc96c('0x17')]]);}}catch(_0x56bce1){utils[_0xc96c('0x1c')](util['format'](_0xc96c('0x36'),_0x5ee6ac[_0xc96c('0x5')]),_0x56bce1);}};exports['blindtransfer']=function(_0x2581ae){try{if(!_[_0xc96c('0x1f')](agents[_0x2581ae[_0xc96c('0x3b')]])){utils[_0xc96c('0x16')](util[_0xc96c('0x3')](_0xc96c('0x3c'),_0x2581ae['uniqueid']),_0x2581ae);utils['info'](util['format'](_0xc96c('0x3d'),_0x2581ae['uniqueid'],agents[_0x2581ae[_0xc96c('0x3b')]][_0xc96c('0x8')],agents[_0x2581ae[_0xc96c('0x3b')]][_0xc96c('0x5')]));agents[_0x2581ae[_0xc96c('0x3b')]][_0xc96c('0x3e')]=!![];agents[_0x2581ae[_0xc96c('0x3b')]][_0xc96c('0x3f')]=_0xc96c('0x40');agents[_0x2581ae[_0xc96c('0x3b')]]['transferexten']=_0x2581ae[_0xc96c('0x41')];agents[_0x2581ae[_0xc96c('0x3b')]][_0xc96c('0x42')]=agents[_0x2581ae[_0xc96c('0x3b')]][_0xc96c('0x5')];}}catch(_0xcde9){utils[_0xc96c('0x1c')](util[_0xc96c('0x3')]('[%s][agents][blindtransfer]',_0x2581ae['uniqueid']),_0xcde9);}};exports['attendedtransfer']=function(_0x5c3d95){try{utils[_0xc96c('0x16')](util[_0xc96c('0x3')](_0xc96c('0x43'),_0x5c3d95[_0xc96c('0x44')]),_0x5c3d95);if(_0x5c3d95[_0xc96c('0x44')]==_0x5c3d95[_0xc96c('0x45')]){if(!_[_0xc96c('0x1f')](agents[_0x5c3d95['secondtransfereruniqueid']])){utils[_0xc96c('0x2')](util[_0xc96c('0x3')](_0xc96c('0x46'),_0x5c3d95[_0xc96c('0x44')],agents[_0x5c3d95[_0xc96c('0x47')]][_0xc96c('0x8')]));agents[_0x5c3d95[_0xc96c('0x47')]]['transfer']=!![];agents[_0x5c3d95[_0xc96c('0x47')]][_0xc96c('0x3f')]=_0xc96c('0x48');agents[_0x5c3d95[_0xc96c('0x47')]][_0xc96c('0x49')]=_0x5c3d95[_0xc96c('0x4a')];agents[_0x5c3d95[_0xc96c('0x47')]][_0xc96c('0x42')]=_0x5c3d95[_0xc96c('0x44')];}if(_0x5c3d95[_0xc96c('0x4b')]&&agents[_0x5c3d95[_0xc96c('0x4b')]]){agents[_0x5c3d95[_0xc96c('0x4b')]][_0xc96c('0x4c')]=0x1;transfers[_0x5c3d95[_0xc96c('0x4b')]]=_['clone'](agents[_0x5c3d95[_0xc96c('0x4b')]]);transfers[_0x5c3d95[_0xc96c('0x4b')]][_0xc96c('0x4d')]=agents[_0x5c3d95[_0xc96c('0x47')]][_0xc96c('0x4d')];transfers[_0x5c3d95['transfereeuniqueid']][_0xc96c('0x4e')]=agents[_0x5c3d95[_0xc96c('0x47')]][_0xc96c('0x4e')];transfers[_0x5c3d95[_0xc96c('0x4b')]]['agentcalledAt']=utils[_0xc96c('0x19')]();transfers[_0x5c3d95[_0xc96c('0x4b')]]['agentconnectAt']=utils['now']();transfers[_0x5c3d95['transfereeuniqueid']][_0xc96c('0x2d')]=0x0;transfers[_0x5c3d95[_0xc96c('0x4b')]][_0xc96c('0x4c')]=0x2;}}else if(_0x5c3d95[_0xc96c('0x47')]==_0x5c3d95[_0xc96c('0x4f')]){if(!_['isNil'](agents[_0x5c3d95['origtransfereruniqueid']])){utils[_0xc96c('0x2')](util[_0xc96c('0x3')](_0xc96c('0x46'),_0x5c3d95[_0xc96c('0x44')],agents[_0x5c3d95[_0xc96c('0x44')]]['membername']));agents[_0x5c3d95[_0xc96c('0x44')]][_0xc96c('0x3e')]=!![];agents[_0x5c3d95[_0xc96c('0x44')]][_0xc96c('0x3f')]='ATTENDED';agents[_0x5c3d95['origtransfereruniqueid']][_0xc96c('0x49')]=_0x5c3d95[_0xc96c('0x50')];agents[_0x5c3d95['origtransfereruniqueid']][_0xc96c('0x42')]=_0x5c3d95['secondtransfereruniqueid'];}if(_0x5c3d95[_0xc96c('0x51')]&&agents[_0x5c3d95[_0xc96c('0x51')]]){agents[_0x5c3d95[_0xc96c('0x51')]][_0xc96c('0x4c')]=0x1;transfers[_0x5c3d95[_0xc96c('0x51')]]=_[_0xc96c('0x52')](agents[_0x5c3d95[_0xc96c('0x51')]]);transfers[_0x5c3d95[_0xc96c('0x51')]][_0xc96c('0x4d')]=agents[_0x5c3d95[_0xc96c('0x44')]]['calleridnum'];transfers[_0x5c3d95[_0xc96c('0x51')]]['calleridname']=agents[_0x5c3d95[_0xc96c('0x44')]][_0xc96c('0x4e')];transfers[_0x5c3d95['transfertargetuniqueid']][_0xc96c('0x18')]=utils['now']();transfers[_0x5c3d95[_0xc96c('0x51')]][_0xc96c('0x30')]=utils[_0xc96c('0x19')]();transfers[_0x5c3d95[_0xc96c('0x51')]][_0xc96c('0x2d')]=0x0;transfers[_0x5c3d95[_0xc96c('0x51')]][_0xc96c('0x4c')]=0x2;}}}catch(_0xbd6525){utils[_0xc96c('0x1c')](util['format'](_0xc96c('0x43'),_0x5c3d95[_0xc96c('0x44')]),_0xbd6525);}};exports[_0xc96c('0x53')]=function(_0x43f94e){try{utils['debug'](util[_0xc96c('0x3')](_0xc96c('0x54'),_0x43f94e['uniqueid']),_0x43f94e);if(agents[_0x43f94e['uniqueid']]&&agents[_0x43f94e[_0xc96c('0x5')]]['reason']===_0xc96c('0x24')){if(_0x43f94e[_0xc96c('0x55')]==='21'){agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x23')]=_0xc96c('0x56');agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0xb')]=_0xc96c('0x56');}utils[_0xc96c('0x2')](util['format'](_0xc96c('0x57'),_0x43f94e[_0xc96c('0x5')],agents[_0x43f94e[_0xc96c('0x5')]]['membername'],agents[_0x43f94e['uniqueid']][_0xc96c('0x23')],agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0xb')]));writeDB(agents[_0x43f94e[_0xc96c('0x5')]]);var _0x1efa88=unanswered[_0xc96c('0x58')](_0x43f94e[_0xc96c('0x5')]);if(_0x1efa88>-0x1){unanswered['splice'](_0x1efa88,0x1);}}if(transfers[_0x43f94e[_0xc96c('0x5')]]){transfers[_0x43f94e[_0xc96c('0x5')]]['agentcomplete']=!![];transfers[_0x43f94e[_0xc96c('0x5')]]['agentcompleteAt']=utils[_0xc96c('0x19')]();transfers[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x26')]=utils[_0xc96c('0x39')](transfers[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x38')],transfers[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x30')]);transfers[_0x43f94e[_0xc96c('0x5')]]['reason']=_0xc96c('0x59');transfers[_0x43f94e[_0xc96c('0x5')]]['lastevent']=_0xc96c('0x3a');utils['info'](util[_0xc96c('0x3')](_0xc96c('0x57'),_0x43f94e[_0xc96c('0x5')],transfers[_0x43f94e['uniqueid']][_0xc96c('0x8')],transfers[_0x43f94e[_0xc96c('0x5')]]['reason'],transfers[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0xb')]));writeDB(transfers[_0x43f94e[_0xc96c('0x5')]],!![]);}if(agents[_0x43f94e['uniqueid']]&&agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x30')]){agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x10')]=!![];agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x38')]=utils[_0xc96c('0x19')]();agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x26')]=utils[_0xc96c('0x39')](agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x38')],agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x30')]);agents[_0x43f94e[_0xc96c('0x5')]]['reason']=agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x3e')]?_0xc96c('0x3e'):_0xc96c('0x59');agents[_0x43f94e[_0xc96c('0x5')]]['lastevent']=_0xc96c('0x3a');utils[_0xc96c('0x2')](util[_0xc96c('0x3')](_0xc96c('0x57'),_0x43f94e[_0xc96c('0x5')],agents[_0x43f94e['uniqueid']]['membername'],agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x23')],agents[_0x43f94e['uniqueid']][_0xc96c('0xb')]));writeDB(agents[_0x43f94e[_0xc96c('0x5')]]);}}catch(_0x563449){utils[_0xc96c('0x1c')](util[_0xc96c('0x3')]('[%s][agents][hangup]',_0x43f94e[_0xc96c('0x5')]),_0x563449);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 8edee21..a7e7d93 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 _0xe6c5=['uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','calleridnum','connectedlinenum','lastevent','then','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','accountcode','DOCUMENTATION','error','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','channelstate','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','linkedid','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','now','duration','starttime','billableseconds','diffTime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','destination','\x22\x20<','variable','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','application','set','startsWith','appdata','toLowerCase','cdr','split','lastIndexOf','includes','gotoif','lodash','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds'];(function(_0x317fb1,_0x275a97){var _0x301ecf=function(_0x3b57ce){while(--_0x3b57ce){_0x317fb1['push'](_0x317fb1['shift']());}};_0x301ecf(++_0x275a97);}(_0xe6c5,0x67));var _0x5e6c=function(_0x102065,_0x422bbd){_0x102065=_0x102065-0x0;var _0x463f0d=_0xe6c5[_0x102065];return _0x463f0d;};'use strict';var _=require(_0x5e6c('0x0'));var util=require('util');var utils=require('./utils');var transfers=require(_0x5e6c('0x1'));var dispositions=[_0x5e6c('0x2'),_0x5e6c('0x3'),_0x5e6c('0x3'),'NO\x20ANSWER',_0x5e6c('0x2'),_0x5e6c('0x2'),_0x5e6c('0x4'),_0x5e6c('0x5'),'FAILED',_0x5e6c('0x3'),_0x5e6c('0x3')];var channels={};function writeDB(_0x2d8939){var _0x5484ac;if(transfers[_0x5e6c('0x6')][_0x2d8939[_0x5e6c('0x7')]]){_0x5484ac=_0x2d8939[_0x5e6c('0x7')];_0x2d8939[_0x5e6c('0x7')]=transfers[_0x5e6c('0x6')][_0x2d8939['uniqueid']][_0x5e6c('0x8')];}utils[_0x5e6c('0x9')](util[_0x5e6c('0xa')](_0x5e6c('0xb'),_0x2d8939[_0x5e6c('0x7')],_0x2d8939[_0x5e6c('0xc')],_0x2d8939[_0x5e6c('0xd')],_0x2d8939[_0x5e6c('0xe')],_0x2d8939['interface'],_0x2d8939[_0x5e6c('0xf')],_0x2d8939[_0x5e6c('0x10')],_0x2d8939[_0x5e6c('0x11')]));if(_0x2d8939['accountcode']){utils['getUserByInternal'](_0x2d8939['accountcode'])[_0x5e6c('0x12')](function(_0x19ddc7){if(_0x19ddc7){_0x2d8939[_0x5e6c('0x13')]=_0x19ddc7['id'];}utils[_0x5e6c('0x14')](_0x5e6c('0x15'),_0x2d8939);});}else{utils[_0x5e6c('0x14')](_0x5e6c('0x15'),_0x2d8939);}if(channels[_0x2d8939['uniqueid']]){delete channels[_0x2d8939[_0x5e6c('0x7')]];}else if(_0x5484ac&&channels[_0x5484ac]){if(!transfers[_0x5e6c('0x6')][_0x5484ac][_0x5e6c('0x16')])delete transfers[_0x5e6c('0x6')][_0x5484ac];delete channels[_0x5484ac];}}exports[_0x5e6c('0x17')]=function(_0x2b7a45){try{utils[_0x5e6c('0x18')](util[_0x5e6c('0xa')](_0x5e6c('0x19'),_0x2b7a45['uniqueid']),_0x2b7a45);if(_0x2b7a45['uniqueid']==_0x2b7a45['linkedid']&&_0x2b7a45[_0x5e6c('0xc')]!='OutgoingSpoolFailed'){utils['info'](util[_0x5e6c('0xa')](_0x5e6c('0x1a'),_0x2b7a45[_0x5e6c('0x7')],_0x2b7a45[_0x5e6c('0x1b')],_0x2b7a45[_0x5e6c('0x1c')]));channels[_0x2b7a45[_0x5e6c('0x7')]]={'uniqueid':_0x2b7a45[_0x5e6c('0x7')],'accountcode':_0x2b7a45[_0x5e6c('0x1d')],'source':_0x2b7a45['calleridnum'],'destination':_0x2b7a45[_0x5e6c('0x1c')],'destinationcontext':_0x2b7a45[_0x5e6c('0x1b')],'channel':_0x2b7a45['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x5e6c('0x1e')};}}catch(_0x4e6dda){utils[_0x5e6c('0x1f')](util[_0x5e6c('0xa')](_0x5e6c('0x19'),_0x2b7a45[_0x5e6c('0x7')]),_0x4e6dda);}};exports['newstate']=function(_0x14f792){try{utils['debug'](util[_0x5e6c('0xa')](_0x5e6c('0x20'),_0x14f792[_0x5e6c('0x7')]),_0x14f792);if(!_[_0x5e6c('0x21')](channels[_0x14f792[_0x5e6c('0x7')]])&&_0x14f792['channelstate']==0x6){utils[_0x5e6c('0x9')](util[_0x5e6c('0xa')](_0x5e6c('0x22'),_0x14f792[_0x5e6c('0x7')],_0x14f792[_0x5e6c('0x1b')],_0x14f792[_0x5e6c('0xc')]));if(_[_0x5e6c('0x21')](channels[_0x14f792[_0x5e6c('0x7')]][_0x5e6c('0x23')])){channels[_0x14f792[_0x5e6c('0x7')]][_0x5e6c('0x23')]=utils['now']();}}else if(!_['isNil'](channels[_0x14f792['linkedid']])&&_0x14f792[_0x5e6c('0x24')]==0x6&&_0x14f792['context']!=_0x5e6c('0x25')){utils[_0x5e6c('0x9')](util[_0x5e6c('0xa')](_0x5e6c('0x26'),_0x14f792[_0x5e6c('0x7')],_0x14f792[_0x5e6c('0x27')],_0x14f792['context'],_0x14f792['channel']));channels[_0x14f792[_0x5e6c('0x27')]][_0x5e6c('0x1d')]=_0x14f792[_0x5e6c('0x1d')];channels[_0x14f792['linkedid']][_0x5e6c('0x28')]=_0x14f792[_0x5e6c('0xc')];if(_[_0x5e6c('0x21')](channels[_0x14f792[_0x5e6c('0x27')]][_0x5e6c('0x29')])){channels[_0x14f792[_0x5e6c('0x27')]][_0x5e6c('0x29')]=utils['now']();}channels[_0x14f792['linkedid']][_0x5e6c('0x2a')]=dispositions[_[_0x5e6c('0x2b')](_0x14f792[_0x5e6c('0x24')])]||'ANSWERED';}}catch(_0x559469){utils['error'](util[_0x5e6c('0xa')](_0x5e6c('0x20'),_0x14f792[_0x5e6c('0x7')]),_0x559469);}};exports[_0x5e6c('0x2c')]=function(_0x4ea55e){try{if(!_['isNil'](channels[_0x4ea55e[_0x5e6c('0x7')]])){utils['debug'](util[_0x5e6c('0xa')](_0x5e6c('0x2d'),_0x4ea55e[_0x5e6c('0x7')]),_0x4ea55e);if(_[_0x5e6c('0x21')](channels[_0x4ea55e[_0x5e6c('0x7')]][_0x5e6c('0x2e')])){channels[_0x4ea55e[_0x5e6c('0x7')]][_0x5e6c('0x2e')]=_0x4ea55e['calleridname']+'\x20<'+_0x4ea55e[_0x5e6c('0xf')]+'>';}utils['info'](util['format'](_0x5e6c('0x2f'),_0x4ea55e[_0x5e6c('0x7')],channels[_0x4ea55e[_0x5e6c('0x7')]]['callerid'],_0x4ea55e['cause-txt']));channels[_0x4ea55e[_0x5e6c('0x7')]][_0x5e6c('0x30')]=utils[_0x5e6c('0x31')]();channels[_0x4ea55e[_0x5e6c('0x7')]][_0x5e6c('0x32')]=utils['diffTime'](channels[_0x4ea55e['uniqueid']][_0x5e6c('0x30')],channels[_0x4ea55e['uniqueid']][_0x5e6c('0x33')]);channels[_0x4ea55e['uniqueid']][_0x5e6c('0x34')]=channels[_0x4ea55e['uniqueid']][_0x5e6c('0x29')]?utils[_0x5e6c('0x35')](channels[_0x4ea55e[_0x5e6c('0x7')]][_0x5e6c('0x30')],channels[_0x4ea55e['uniqueid']][_0x5e6c('0x29')]):0x0;writeDB(channels[_0x4ea55e[_0x5e6c('0x7')]]);}}catch(_0x34617e){utils[_0x5e6c('0x1f')](util['format'](_0x5e6c('0x2d'),_0x4ea55e['uniqueid']),_0x34617e);}};exports[_0x5e6c('0x36')]=function(_0x231154){try{if(!_[_0x5e6c('0x21')](channels[_0x231154[_0x5e6c('0x37')]])){utils[_0x5e6c('0x18')](util['format'](_0x5e6c('0x38'),_0x231154[_0x5e6c('0x39')]),_0x231154);if(channels[_0x231154[_0x5e6c('0x37')]][_0x5e6c('0xc')]==_0x231154[_0x5e6c('0x3a')]){utils[_0x5e6c('0x9')](util['format'](_0x5e6c('0x3b'),_0x231154[_0x5e6c('0x39')],_0x231154[_0x5e6c('0x37')],_0x231154['secondtransfererchannel']));channels[_0x231154[_0x5e6c('0x37')]]['destinationchannel']=_0x231154[_0x5e6c('0x3c')];channels[_0x231154[_0x5e6c('0x37')]][_0x5e6c('0x3d')]=_0x5e6c('0x3e');}else if(channels[_0x231154[_0x5e6c('0x37')]][_0x5e6c('0xc')]=_0x231154[_0x5e6c('0x3f')]){utils[_0x5e6c('0x9')](util[_0x5e6c('0xa')](_0x5e6c('0x3b'),_0x231154[_0x5e6c('0x39')],_0x231154[_0x5e6c('0x37')],_0x231154['origtransfererchannel']));channels[_0x231154['localtwolinkedid']][_0x5e6c('0x28')]=_0x231154[_0x5e6c('0x40')];channels[_0x231154[_0x5e6c('0x37')]][_0x5e6c('0x3d')]=_0x5e6c('0x3e');}}}catch(_0x375e8d){utils[_0x5e6c('0x1f')](util[_0x5e6c('0xa')](_0x5e6c('0x38'),_0x231154[_0x5e6c('0x39')]),_0x375e8d);}};exports[_0x5e6c('0x41')]=function(_0x3cf0e7){try{if(!_[_0x5e6c('0x21')](channels[_0x3cf0e7[_0x5e6c('0x7')]])){utils[_0x5e6c('0x18')](util[_0x5e6c('0xa')](_0x5e6c('0x42'),_0x3cf0e7[_0x5e6c('0x7')]),_0x3cf0e7);channels[_0x3cf0e7[_0x5e6c('0x7')]][_0x5e6c('0x43')]=utils['now']();utils['info'](util[_0x5e6c('0xa')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x3cf0e7['uniqueid'],channels[_0x3cf0e7[_0x5e6c('0x7')]]['musiconholdstartAt']));}}catch(_0x369b37){utils['error'](util[_0x5e6c('0xa')](_0x5e6c('0x42'),_0x3cf0e7[_0x5e6c('0x7')]),_0x369b37);}};exports[_0x5e6c('0x44')]=function(_0x3a3637){try{if(!_[_0x5e6c('0x21')](channels[_0x3a3637[_0x5e6c('0x7')]])){utils[_0x5e6c('0x18')](util['format'](_0x5e6c('0x45'),_0x3a3637[_0x5e6c('0x7')]),_0x3a3637);if(!_[_0x5e6c('0x21')](channels[_0x3a3637[_0x5e6c('0x7')]][_0x5e6c('0x43')])){channels[_0x3a3637[_0x5e6c('0x7')]][_0x5e6c('0x46')]+=utils[_0x5e6c('0x35')](utils[_0x5e6c('0x31')](),channels[_0x3a3637[_0x5e6c('0x7')]]['musiconholdstartAt']);utils[_0x5e6c('0x9')](util[_0x5e6c('0xa')](_0x5e6c('0x47'),_0x3a3637[_0x5e6c('0x7')],channels[_0x3a3637['uniqueid']][_0x5e6c('0x46')]));delete channels[_0x3a3637['uniqueid']][_0x5e6c('0x43')];}}}catch(_0x3ea8ab){utils[_0x5e6c('0x1f')](util['format'](_0x5e6c('0x45'),_0x3a3637[_0x5e6c('0x7')]),_0x3ea8ab);}};exports['varset']=function(_0x234cf7){try{if(!_[_0x5e6c('0x21')](channels[_0x234cf7[_0x5e6c('0x7')]])){utils[_0x5e6c('0x18')](util[_0x5e6c('0xa')](_0x5e6c('0x48'),_0x234cf7['uniqueid']),_0x234cf7);if(!_[_0x5e6c('0x21')](_0x234cf7['variable'][_0x5e6c('0x49')])){utils['info'](util[_0x5e6c('0xa')](_0x5e6c('0x4a'),_0x234cf7[_0x5e6c('0x7')],_0x234cf7[_0x5e6c('0x4b')]));channels[_0x234cf7[_0x5e6c('0x7')]][_0x5e6c('0x4c')]=_0x234cf7[_0x5e6c('0x4b')];}if(!_[_0x5e6c('0x21')](_0x234cf7['variable'][_0x5e6c('0x4d')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x234cf7['uniqueid'],_0x234cf7[_0x5e6c('0x4b')]));channels[_0x234cf7[_0x5e6c('0x7')]][_0x5e6c('0x4e')]=_0x234cf7[_0x5e6c('0x4b')];channels[_0x234cf7['uniqueid']][_0x5e6c('0x2e')]='\x22'+_0x234cf7[_0x5e6c('0x4b')]+_0x5e6c('0x4f')+_0x234cf7[_0x5e6c('0x4b')]+'>';}if(!_[_0x5e6c('0x21')](_0x234cf7[_0x5e6c('0x50')][_0x5e6c('0x51')])||!_[_0x5e6c('0x21')](_0x234cf7[_0x5e6c('0x50')][_0x5e6c('0x52')])){utils['info'](util[_0x5e6c('0xa')](_0x5e6c('0x53'),_0x234cf7[_0x5e6c('0x7')],!_[_0x5e6c('0x21')](_0x234cf7['variable']['xmd-callerid-preview'])?'xmd-callerid-preview':_0x5e6c('0x52'),_0x234cf7[_0x5e6c('0x4b')]));channels[_0x234cf7[_0x5e6c('0x7')]][_0x5e6c('0x2e')]=_0x234cf7[_0x5e6c('0x4b')];}if(!_[_0x5e6c('0x21')](_0x234cf7[_0x5e6c('0x50')][_0x5e6c('0x54')])||!_[_0x5e6c('0x21')](_0x234cf7[_0x5e6c('0x50')][_0x5e6c('0x55')])){utils[_0x5e6c('0x9')](util[_0x5e6c('0xa')](_0x5e6c('0x53'),_0x234cf7[_0x5e6c('0x7')],!_['isNil'](_0x234cf7[_0x5e6c('0x50')][_0x5e6c('0x54')])?_0x5e6c('0x54'):_0x5e6c('0x55'),_0x234cf7[_0x5e6c('0x4b')]));channels[_0x234cf7[_0x5e6c('0x7')]][_0x5e6c('0x56')]=_0x5e6c('0x57');channels[_0x234cf7[_0x5e6c('0x7')]][_0x5e6c('0x58')]=_0x234cf7[_0x5e6c('0x4b')];channels[_0x234cf7['uniqueid']][_0x5e6c('0xd')]=!![];}if(!_[_0x5e6c('0x21')](_0x234cf7['variable'][_0x5e6c('0x59')])){utils[_0x5e6c('0x9')](util[_0x5e6c('0xa')](_0x5e6c('0x5a'),_0x234cf7[_0x5e6c('0x7')],_0x234cf7[_0x5e6c('0x4b')]));channels[_0x234cf7['uniqueid']][_0x5e6c('0x5b')]=_0x234cf7[_0x5e6c('0x4b')];}if(!_[_0x5e6c('0x21')](_0x234cf7[_0x5e6c('0x50')][_0x5e6c('0x5c')])){utils[_0x5e6c('0x9')](util[_0x5e6c('0xa')](_0x5e6c('0x5d'),_0x234cf7[_0x5e6c('0x7')],_0x234cf7['value']));channels[_0x234cf7['uniqueid']][_0x5e6c('0x5e')]=_0x234cf7[_0x5e6c('0x4b')];}if(!_[_0x5e6c('0x21')](_0x234cf7['variable']['outboundrouteid'])){utils[_0x5e6c('0x9')](util[_0x5e6c('0xa')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x234cf7[_0x5e6c('0x7')],_0x234cf7[_0x5e6c('0x4b')]));channels[_0x234cf7[_0x5e6c('0x7')]][_0x5e6c('0x5f')]=_0x234cf7[_0x5e6c('0x4b')];}if(!_[_0x5e6c('0x21')](_0x234cf7[_0x5e6c('0x50')][_0x5e6c('0x60')])){utils[_0x5e6c('0x9')](util['format'](_0x5e6c('0x61'),_0x234cf7[_0x5e6c('0x7')],_0x234cf7[_0x5e6c('0x4b')]));channels[_0x234cf7[_0x5e6c('0x7')]][_0x5e6c('0x60')]=_0x234cf7['value'];}}}catch(_0x4e99c0){utils[_0x5e6c('0x1f')](util['format'](_0x5e6c('0x48'),_0x234cf7[_0x5e6c('0x7')]),_0x4e99c0);}};exports[_0x5e6c('0x62')]=function(_0x35c745){try{if(!_['isNil'](channels[_0x35c745[_0x5e6c('0x7')]])){utils[_0x5e6c('0x18')](util[_0x5e6c('0xa')](_0x5e6c('0x63'),_0x35c745[_0x5e6c('0x7')]),_0x35c745);utils[_0x5e6c('0x9')](util[_0x5e6c('0xa')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x35c745[_0x5e6c('0x7')],_0x35c745['application'],_0x35c745['appdata']));if(_0x35c745[_0x5e6c('0x64')]['toLowerCase']()==_0x5e6c('0x65')&&_[_0x5e6c('0x66')](_0x35c745[_0x5e6c('0x67')][_0x5e6c('0x68')](),_0x5e6c('0x69'))){var _0x24c95c=_0x35c745[_0x5e6c('0x67')][_0x5e6c('0x6a')]('=');var _0x4527e3=_0x24c95c[0x0]['substring'](_0x24c95c[0x0][_0x5e6c('0x6b')]('(')+0x1,_0x24c95c[0x0]['lastIndexOf'](')'));var _0x68a9bb=_0x24c95c[0x1];channels[_0x35c745[_0x5e6c('0x7')]][_0x4527e3]=_0x68a9bb;}if(!_[_0x5e6c('0x6c')](['hangup','noop','execif','set',_0x5e6c('0x6d')],_0x35c745[_0x5e6c('0x64')]['toLowerCase']())){channels[_0x35c745['uniqueid']][_0x5e6c('0x56')]=_0x35c745[_0x5e6c('0x64')];channels[_0x35c745[_0x5e6c('0x7')]]['lastdata']=_0x35c745[_0x5e6c('0x67')];}}}catch(_0x3b6406){utils['error'](util[_0x5e6c('0xa')]('[%s][calls][newexten]',_0x35c745[_0x5e6c('0x7')]),_0x3b6406);}}; \ No newline at end of file +var _0x8ac9=['[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','calleridnum','context','now','DOCUMENTATION','[%s][calls][newchannel]','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','toNumber','error','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','endtime','billableseconds','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','destinationchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','diffTime','[%s][calls][varset]','xmd-originatecalleridnum','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','variable','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmcs-queue','xmd-queue','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','cdr','split','substring','lastIndexOf','includes','noop','gotoif','lastdata','[%s][calls][newexten]','lodash','util','./utils','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','recording','debug','linkedid','OutgoingSpoolFailed'];(function(_0x1657e1,_0x63ed04){var _0x4c3e3d=function(_0x276bff){while(--_0x276bff){_0x1657e1['push'](_0x1657e1['shift']());}};_0x4c3e3d(++_0x63ed04);}(_0x8ac9,0x199));var _0x98ac=function(_0x5b0df1,_0x117bed){_0x5b0df1=_0x5b0df1-0x0;var _0x453c9c=_0x8ac9[_0x5b0df1];return _0x453c9c;};'use strict';var _=require(_0x98ac('0x0'));var util=require(_0x98ac('0x1'));var utils=require(_0x98ac('0x2'));var transfers=require('./transfers.controller');var dispositions=['NO\x20ANSWER',_0x98ac('0x3'),_0x98ac('0x3'),_0x98ac('0x4'),'NO\x20ANSWER','NO\x20ANSWER',_0x98ac('0x5'),_0x98ac('0x6'),_0x98ac('0x3'),'FAILED','FAILED'];var channels={};function writeDB(_0x3b3780){var _0x1702d6;if(transfers[_0x98ac('0x7')][_0x3b3780[_0x98ac('0x8')]]){_0x1702d6=_0x3b3780[_0x98ac('0x8')];_0x3b3780[_0x98ac('0x8')]=transfers['blinds'][_0x3b3780[_0x98ac('0x8')]]['transfereeuniqueid'];}utils[_0x98ac('0x9')](util[_0x98ac('0xa')](_0x98ac('0xb'),_0x3b3780[_0x98ac('0x8')],_0x3b3780[_0x98ac('0xc')],_0x3b3780[_0x98ac('0xd')],_0x3b3780[_0x98ac('0xe')],_0x3b3780['interface'],_0x3b3780['calleridnum'],_0x3b3780[_0x98ac('0xf')],_0x3b3780[_0x98ac('0x10')]));if(_0x3b3780[_0x98ac('0x11')]){utils[_0x98ac('0x12')](_0x3b3780['accountcode'])[_0x98ac('0x13')](function(_0x265286){if(_0x265286){_0x3b3780[_0x98ac('0x14')]=_0x265286['id'];}utils['request']('CreateVoiceCallReport',_0x3b3780);});}else{utils[_0x98ac('0x15')](_0x98ac('0x16'),_0x3b3780);}if(channels[_0x3b3780['uniqueid']]){delete channels[_0x3b3780['uniqueid']];}else if(_0x1702d6&&channels[_0x1702d6]){if(!transfers['blinds'][_0x1702d6][_0x98ac('0x17')])delete transfers[_0x98ac('0x7')][_0x1702d6];delete channels[_0x1702d6];}}exports['newchannel']=function(_0x4129bd){try{utils[_0x98ac('0x18')](util[_0x98ac('0xa')]('[%s][calls][newchannel]',_0x4129bd[_0x98ac('0x8')]),_0x4129bd);if(_0x4129bd[_0x98ac('0x8')]==_0x4129bd[_0x98ac('0x19')]&&_0x4129bd['channel']!=_0x98ac('0x1a')){utils[_0x98ac('0x9')](util[_0x98ac('0xa')](_0x98ac('0x1b'),_0x4129bd['uniqueid'],_0x4129bd['context'],_0x4129bd[_0x98ac('0x1c')]));channels[_0x4129bd[_0x98ac('0x8')]]={'uniqueid':_0x4129bd[_0x98ac('0x8')],'accountcode':_0x4129bd[_0x98ac('0x11')],'source':_0x4129bd[_0x98ac('0x1d')],'destination':_0x4129bd[_0x98ac('0x1c')],'destinationcontext':_0x4129bd[_0x98ac('0x1e')],'channel':_0x4129bd[_0x98ac('0xc')],'starttime':utils[_0x98ac('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x98ac('0x20')};}}catch(_0x11233e){utils['error'](util[_0x98ac('0xa')](_0x98ac('0x21'),_0x4129bd['uniqueid']),_0x11233e);}};exports[_0x98ac('0x22')]=function(_0x37f6f8){try{utils[_0x98ac('0x18')](util['format'](_0x98ac('0x23'),_0x37f6f8[_0x98ac('0x8')]),_0x37f6f8);if(!_[_0x98ac('0x24')](channels[_0x37f6f8[_0x98ac('0x8')]])&&_0x37f6f8[_0x98ac('0x25')]==0x6){utils[_0x98ac('0x9')](util[_0x98ac('0xa')](_0x98ac('0x26'),_0x37f6f8[_0x98ac('0x8')],_0x37f6f8[_0x98ac('0x1e')],_0x37f6f8['channel']));if(_[_0x98ac('0x24')](channels[_0x37f6f8[_0x98ac('0x8')]][_0x98ac('0x27')])){channels[_0x37f6f8[_0x98ac('0x8')]][_0x98ac('0x27')]=utils[_0x98ac('0x1f')]();}}else if(!_[_0x98ac('0x24')](channels[_0x37f6f8['linkedid']])&&_0x37f6f8['channelstate']==0x6&&_0x37f6f8[_0x98ac('0x1e')]!=_0x98ac('0x28')){utils[_0x98ac('0x9')](util[_0x98ac('0xa')](_0x98ac('0x29'),_0x37f6f8[_0x98ac('0x8')],_0x37f6f8[_0x98ac('0x19')],_0x37f6f8[_0x98ac('0x1e')],_0x37f6f8[_0x98ac('0xc')]));channels[_0x37f6f8[_0x98ac('0x19')]]['accountcode']=_0x37f6f8['accountcode'];channels[_0x37f6f8[_0x98ac('0x19')]]['destinationchannel']=_0x37f6f8[_0x98ac('0xc')];if(_['isNil'](channels[_0x37f6f8[_0x98ac('0x19')]][_0x98ac('0x2a')])){channels[_0x37f6f8['linkedid']][_0x98ac('0x2a')]=utils['now']();}channels[_0x37f6f8[_0x98ac('0x19')]][_0x98ac('0x2b')]=dispositions[_[_0x98ac('0x2c')](_0x37f6f8[_0x98ac('0x25')])]||_0x98ac('0x5');}}catch(_0x20ef04){utils[_0x98ac('0x2d')](util[_0x98ac('0xa')]('[%s][calls][newstate]',_0x37f6f8[_0x98ac('0x8')]),_0x20ef04);}};exports[_0x98ac('0x2e')]=function(_0x23c958){try{if(!_[_0x98ac('0x24')](channels[_0x23c958[_0x98ac('0x8')]])){utils[_0x98ac('0x18')](util[_0x98ac('0xa')](_0x98ac('0x2f'),_0x23c958[_0x98ac('0x8')]),_0x23c958);if(_[_0x98ac('0x24')](channels[_0x23c958[_0x98ac('0x8')]][_0x98ac('0x30')])){channels[_0x23c958[_0x98ac('0x8')]][_0x98ac('0x30')]=_0x23c958[_0x98ac('0x31')]+'\x20<'+_0x23c958['calleridnum']+'>';}utils[_0x98ac('0x9')](util[_0x98ac('0xa')](_0x98ac('0x32'),_0x23c958[_0x98ac('0x8')],channels[_0x23c958[_0x98ac('0x8')]][_0x98ac('0x30')],_0x23c958[_0x98ac('0x33')]));channels[_0x23c958[_0x98ac('0x8')]]['endtime']=utils[_0x98ac('0x1f')]();channels[_0x23c958['uniqueid']][_0x98ac('0x34')]=utils['diffTime'](channels[_0x23c958[_0x98ac('0x8')]][_0x98ac('0x35')],channels[_0x23c958[_0x98ac('0x8')]]['starttime']);channels[_0x23c958['uniqueid']][_0x98ac('0x36')]=channels[_0x23c958[_0x98ac('0x8')]][_0x98ac('0x2a')]?utils['diffTime'](channels[_0x23c958[_0x98ac('0x8')]]['endtime'],channels[_0x23c958[_0x98ac('0x8')]][_0x98ac('0x2a')]):0x0;writeDB(channels[_0x23c958[_0x98ac('0x8')]]);}}catch(_0x3df80f){utils[_0x98ac('0x2d')](util['format'](_0x98ac('0x2f'),_0x23c958[_0x98ac('0x8')]),_0x3df80f);}};exports['attendedtransfer']=function(_0x11d104){try{if(!_[_0x98ac('0x24')](channels[_0x11d104[_0x98ac('0x37')]])){utils[_0x98ac('0x18')](util[_0x98ac('0xa')](_0x98ac('0x38'),_0x11d104[_0x98ac('0x39')]),_0x11d104);if(channels[_0x11d104[_0x98ac('0x37')]]['channel']==_0x11d104[_0x98ac('0x3a')]){utils[_0x98ac('0x9')](util[_0x98ac('0xa')](_0x98ac('0x3b'),_0x11d104[_0x98ac('0x39')],_0x11d104[_0x98ac('0x37')],_0x11d104[_0x98ac('0x3c')]));channels[_0x11d104[_0x98ac('0x37')]][_0x98ac('0x3d')]=_0x11d104['secondtransfererchannel'];channels[_0x11d104[_0x98ac('0x37')]][_0x98ac('0x3e')]=_0x98ac('0x3f');}else if(channels[_0x11d104[_0x98ac('0x37')]][_0x98ac('0xc')]=_0x11d104[_0x98ac('0x40')]){utils['info'](util[_0x98ac('0xa')](_0x98ac('0x3b'),_0x11d104[_0x98ac('0x39')],_0x11d104[_0x98ac('0x37')],_0x11d104[_0x98ac('0x41')]));channels[_0x11d104[_0x98ac('0x37')]][_0x98ac('0x3d')]=_0x11d104[_0x98ac('0x41')];channels[_0x11d104['localtwolinkedid']][_0x98ac('0x3e')]=_0x98ac('0x3f');}}}catch(_0x5cbb32){utils[_0x98ac('0x2d')](util[_0x98ac('0xa')](_0x98ac('0x38'),_0x11d104[_0x98ac('0x39')]),_0x5cbb32);}};exports[_0x98ac('0x42')]=function(_0x28711f){try{if(!_['isNil'](channels[_0x28711f['uniqueid']])){utils[_0x98ac('0x18')](util[_0x98ac('0xa')](_0x98ac('0x43'),_0x28711f[_0x98ac('0x8')]),_0x28711f);channels[_0x28711f[_0x98ac('0x8')]][_0x98ac('0x44')]=utils[_0x98ac('0x1f')]();utils['info'](util[_0x98ac('0xa')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x28711f[_0x98ac('0x8')],channels[_0x28711f[_0x98ac('0x8')]]['musiconholdstartAt']));}}catch(_0xc43224){utils[_0x98ac('0x2d')](util['format'](_0x98ac('0x43'),_0x28711f['uniqueid']),_0xc43224);}};exports[_0x98ac('0x45')]=function(_0x34a7c){try{if(!_[_0x98ac('0x24')](channels[_0x34a7c['uniqueid']])){utils['debug'](util['format'](_0x98ac('0x46'),_0x34a7c['uniqueid']),_0x34a7c);if(!_[_0x98ac('0x24')](channels[_0x34a7c[_0x98ac('0x8')]][_0x98ac('0x44')])){channels[_0x34a7c[_0x98ac('0x8')]]['mohtime']+=utils[_0x98ac('0x47')](utils[_0x98ac('0x1f')](),channels[_0x34a7c[_0x98ac('0x8')]][_0x98ac('0x44')]);utils['info'](util[_0x98ac('0xa')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x34a7c[_0x98ac('0x8')],channels[_0x34a7c[_0x98ac('0x8')]]['mohtime']));delete channels[_0x34a7c[_0x98ac('0x8')]][_0x98ac('0x44')];}}}catch(_0x5cee48){utils['error'](util[_0x98ac('0xa')](_0x98ac('0x46'),_0x34a7c[_0x98ac('0x8')]),_0x5cee48);}};exports['varset']=function(_0x3bef47){try{if(!_[_0x98ac('0x24')](channels[_0x3bef47[_0x98ac('0x8')]])){utils[_0x98ac('0x18')](util['format'](_0x98ac('0x48'),_0x3bef47[_0x98ac('0x8')]),_0x3bef47);if(!_[_0x98ac('0x24')](_0x3bef47['variable'][_0x98ac('0x49')])){utils[_0x98ac('0x9')](util['format']('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x3bef47[_0x98ac('0x8')],_0x3bef47[_0x98ac('0x4a')]));channels[_0x3bef47[_0x98ac('0x8')]][_0x98ac('0x4b')]=_0x3bef47[_0x98ac('0x4a')];}if(!_[_0x98ac('0x24')](_0x3bef47['variable'][_0x98ac('0x4c')])){utils[_0x98ac('0x9')](util[_0x98ac('0xa')](_0x98ac('0x4d'),_0x3bef47[_0x98ac('0x8')],_0x3bef47[_0x98ac('0x4a')]));channels[_0x3bef47[_0x98ac('0x8')]]['destination']=_0x3bef47[_0x98ac('0x4a')];channels[_0x3bef47[_0x98ac('0x8')]]['callerid']='\x22'+_0x3bef47['value']+_0x98ac('0x4e')+_0x3bef47[_0x98ac('0x4a')]+'>';}if(!_[_0x98ac('0x24')](_0x3bef47['variable'][_0x98ac('0x4f')])||!_[_0x98ac('0x24')](_0x3bef47[_0x98ac('0x50')]['xmd-callerid'])){utils[_0x98ac('0x9')](util[_0x98ac('0xa')](_0x98ac('0x51'),_0x3bef47[_0x98ac('0x8')],!_[_0x98ac('0x24')](_0x3bef47[_0x98ac('0x50')][_0x98ac('0x4f')])?_0x98ac('0x4f'):_0x98ac('0x52'),_0x3bef47[_0x98ac('0x4a')]));channels[_0x3bef47[_0x98ac('0x8')]][_0x98ac('0x30')]=_0x3bef47[_0x98ac('0x4a')];}if(!_[_0x98ac('0x24')](_0x3bef47[_0x98ac('0x50')]['xmd-queue'])||!_[_0x98ac('0x24')](_0x3bef47[_0x98ac('0x50')][_0x98ac('0x53')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x3bef47[_0x98ac('0x8')],!_[_0x98ac('0x24')](_0x3bef47[_0x98ac('0x50')][_0x98ac('0x54')])?_0x98ac('0x54'):_0x98ac('0x53'),_0x3bef47[_0x98ac('0x4a')]));channels[_0x3bef47[_0x98ac('0x8')]]['lastapplication']=_0x98ac('0x55');channels[_0x3bef47[_0x98ac('0x8')]]['lastdata']=_0x3bef47[_0x98ac('0x4a')];channels[_0x3bef47[_0x98ac('0x8')]][_0x98ac('0xd')]=!![];}if(!_[_0x98ac('0x24')](_0x3bef47['variable'][_0x98ac('0x56')])){utils[_0x98ac('0x9')](util[_0x98ac('0xa')](_0x98ac('0x57'),_0x3bef47[_0x98ac('0x8')],_0x3bef47[_0x98ac('0x4a')]));channels[_0x3bef47[_0x98ac('0x8')]][_0x98ac('0x58')]=_0x3bef47[_0x98ac('0x4a')];}if(!_['isNil'](_0x3bef47[_0x98ac('0x50')][_0x98ac('0x59')])){utils[_0x98ac('0x9')](util[_0x98ac('0xa')](_0x98ac('0x5a'),_0x3bef47['uniqueid'],_0x3bef47[_0x98ac('0x4a')]));channels[_0x3bef47[_0x98ac('0x8')]]['type']=_0x3bef47[_0x98ac('0x4a')];}if(!_[_0x98ac('0x24')](_0x3bef47['variable'][_0x98ac('0x5b')])){utils['info'](util['format'](_0x98ac('0x5c'),_0x3bef47[_0x98ac('0x8')],_0x3bef47['value']));channels[_0x3bef47[_0x98ac('0x8')]][_0x98ac('0x5d')]=_0x3bef47['value'];}if(!_[_0x98ac('0x24')](_0x3bef47['variable'][_0x98ac('0x5e')])){utils['info'](util[_0x98ac('0xa')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x3bef47[_0x98ac('0x8')],_0x3bef47['value']));channels[_0x3bef47[_0x98ac('0x8')]][_0x98ac('0x5e')]=_0x3bef47[_0x98ac('0x4a')];}}}catch(_0x5ac7bc){utils[_0x98ac('0x2d')](util['format'](_0x98ac('0x48'),_0x3bef47[_0x98ac('0x8')]),_0x5ac7bc);}};exports['newexten']=function(_0xba0a28){try{if(!_[_0x98ac('0x24')](channels[_0xba0a28[_0x98ac('0x8')]])){utils[_0x98ac('0x18')](util[_0x98ac('0xa')]('[%s][calls][newexten]',_0xba0a28['uniqueid']),_0xba0a28);utils[_0x98ac('0x9')](util['format'](_0x98ac('0x5f'),_0xba0a28[_0x98ac('0x8')],_0xba0a28[_0x98ac('0x60')],_0xba0a28[_0x98ac('0x61')]));if(_0xba0a28[_0x98ac('0x60')]['toLowerCase']()==_0x98ac('0x62')&&_[_0x98ac('0x63')](_0xba0a28[_0x98ac('0x61')]['toLowerCase'](),_0x98ac('0x64'))){var _0x104ba=_0xba0a28[_0x98ac('0x61')][_0x98ac('0x65')]('=');var _0x2e9695=_0x104ba[0x0][_0x98ac('0x66')](_0x104ba[0x0][_0x98ac('0x67')]('(')+0x1,_0x104ba[0x0][_0x98ac('0x67')](')'));var _0x23f3dd=_0x104ba[0x1];channels[_0xba0a28['uniqueid']][_0x2e9695]=_0x23f3dd;}if(!_[_0x98ac('0x68')]([_0x98ac('0x2e'),_0x98ac('0x69'),'execif',_0x98ac('0x62'),_0x98ac('0x6a')],_0xba0a28[_0x98ac('0x60')]['toLowerCase']())){channels[_0xba0a28[_0x98ac('0x8')]]['lastapplication']=_0xba0a28[_0x98ac('0x60')];channels[_0xba0a28[_0x98ac('0x8')]][_0x98ac('0x6b')]=_0xba0a28[_0x98ac('0x61')];}}}catch(_0x12732b){utils[_0x98ac('0x2d')](util[_0x98ac('0xa')](_0x98ac('0x6c'),_0xba0a28[_0x98ac('0x8')]),_0x12732b);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 15d8d86..3e87cd4 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 _0xc8d5=['shutdown','[core]\x20shutdown','error','close','[core]\x20close','managerevent','info'];(function(_0x1bfd8c,_0x282cb8){var _0x1f6b92=function(_0x2939c1){while(--_0x2939c1){_0x1bfd8c['push'](_0x1bfd8c['shift']());}};_0x1f6b92(++_0x282cb8);}(_0xc8d5,0x1bf));var _0x5c8d=function(_0x367981,_0x96233c){_0x367981=_0x367981-0x0;var _0x292171=_0xc8d5[_0x367981];return _0x292171;};'use strict';var utils=require('./utils');exports['connect']=function(){utils[_0x5c8d('0x0')]('[core]\x20connected');};exports[_0x5c8d('0x1')]=function(){utils['info'](_0x5c8d('0x2'));};exports['fullybooted']=function(){utils[_0x5c8d('0x0')]('[core]\x20fullybooted');};exports['error']=function(_0x5eb413){utils[_0x5c8d('0x3')]('[core]\x20error',_0x5eb413);};exports[_0x5c8d('0x4')]=function(){utils[_0x5c8d('0x0')](_0x5c8d('0x5'));};exports[_0x5c8d('0x6')]=function(_0x269400){}; \ No newline at end of file +var _0x52bc=['error','close','[core]\x20close','managerevent','[core]\x20connected','info','[core]\x20shutdown'];(function(_0x29aa36,_0x56d895){var _0x37815e=function(_0x59c2f1){while(--_0x59c2f1){_0x29aa36['push'](_0x29aa36['shift']());}};_0x37815e(++_0x56d895);}(_0x52bc,0xf9));var _0xc52b=function(_0x5252b1,_0xa866cc){_0x5252b1=_0x5252b1-0x0;var _0x253fd0=_0x52bc[_0x5252b1];return _0x253fd0;};'use strict';var utils=require('./utils');exports['connect']=function(){utils['info'](_0xc52b('0x0'));};exports['shutdown']=function(){utils[_0xc52b('0x1')](_0xc52b('0x2'));};exports['fullybooted']=function(){utils[_0xc52b('0x1')]('[core]\x20fullybooted');};exports[_0xc52b('0x3')]=function(_0x50c9d5){utils['error']('[core]\x20error',_0x50c9d5);};exports[_0xc52b('0x4')]=function(){utils[_0xc52b('0x1')](_0xc52b('0x5'));};exports[_0xc52b('0x6')]=function(_0xbd712b){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 8d67597..9fc857e 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 _0xa018=['[%s][dials][varset]','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','[%s][dials][hangup]','lodash','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','connectedlinenum','dialstatus','request','newexten','debug','appdata','toLowerCase','cdr(routeid)','split','error','[%s][dials][newexten]','isNil','outboundrouteid','value'];(function(_0x7ee736,_0x2b7d16){var _0x53daec=function(_0x24ceab){while(--_0x24ceab){_0x7ee736['push'](_0x7ee736['shift']());}};_0x53daec(++_0x2b7d16);}(_0xa018,0x181));var _0x8a01=function(_0x18ff0c,_0x2e9948){_0x18ff0c=_0x18ff0c-0x0;var _0x1174f0=_0xa018[_0x18ff0c];return _0x1174f0;};'use strict';var _=require(_0x8a01('0x0'));var util=require('util');var utils=require(_0x8a01('0x1'));var dials={};function writeDB(_0x3355c7){utils[_0x8a01('0x2')](util[_0x8a01('0x3')](_0x8a01('0x4'),_0x3355c7[_0x8a01('0x5')],_0x3355c7['channel'],_0x3355c7['dialstring'],_0x3355c7['calleridnum'],_0x3355c7[_0x8a01('0x6')],_0x3355c7[_0x8a01('0x7')]));utils[_0x8a01('0x8')]('CreateVoiceDialReport',_0x3355c7);delete dials[_0x3355c7[_0x8a01('0x5')]];}exports[_0x8a01('0x9')]=function(_0x401db1){try{utils[_0x8a01('0xa')](util[_0x8a01('0x3')]('[%s][dials][newexten]',_0x401db1['uniqueid']),_0x401db1);utils['info'](util[_0x8a01('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x401db1[_0x8a01('0x5')],_0x401db1['application'],_0x401db1[_0x8a01('0xb')]));if(_0x401db1['application'][_0x8a01('0xc')]()=='set'&&_['startsWith'](_0x401db1['appdata']['toLowerCase'](),_0x8a01('0xd'))){var _0x41babc=_0x401db1[_0x8a01('0xb')][_0x8a01('0xe')]('=');dials[_0x401db1[_0x8a01('0x5')]]={'routeId':_0x41babc[0x1]};}}catch(_0x57fbd5){utils[_0x8a01('0xf')](util[_0x8a01('0x3')](_0x8a01('0x10'),_0x401db1[_0x8a01('0x5')]),_0x57fbd5);}};exports['varset']=function(_0x45c18d){try{utils['debug'](util[_0x8a01('0x3')]('[%s][dials][varset]',_0x45c18d['uniqueid']),_0x45c18d);if(!_[_0x8a01('0x11')](_0x45c18d['variable'][_0x8a01('0x12')])){utils[_0x8a01('0x2')](util[_0x8a01('0x3')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x45c18d[_0x8a01('0x5')],_0x45c18d[_0x8a01('0x13')]));dials[_0x45c18d[_0x8a01('0x5')]]={'routeId':_0x45c18d['value']};}}catch(_0x47e8bc){utils[_0x8a01('0xf')](util['format'](_0x8a01('0x14'),_0x45c18d[_0x8a01('0x5')]),_0x47e8bc);}};exports[_0x8a01('0x15')]=function(_0x314fbd){try{if(!_[_0x8a01('0x11')](dials[_0x314fbd[_0x8a01('0x5')]])){utils[_0x8a01('0xa')](util[_0x8a01('0x3')](_0x8a01('0x16'),_0x314fbd['uniqueid']),_0x314fbd);dials[_0x314fbd[_0x8a01('0x5')]]=_[_0x8a01('0x17')](dials[_0x314fbd[_0x8a01('0x5')]],_0x314fbd);dials[_0x314fbd[_0x8a01('0x5')]][_0x8a01('0x18')]=utils[_0x8a01('0x19')]();dials[_0x314fbd[_0x8a01('0x5')]][_0x8a01('0x1a')]=_0x8a01('0x1b');utils['info'](util[_0x8a01('0x3')](_0x8a01('0x1c'),_0x314fbd['uniqueid'],dials[_0x314fbd['uniqueid']][_0x8a01('0x18')]));}}catch(_0x58bf82){utils['error'](util[_0x8a01('0x3')](_0x8a01('0x16'),_0x314fbd[_0x8a01('0x5')]),_0x58bf82);}};exports['dialend']=function(_0x4e145a){try{if(!_['isNil'](dials[_0x4e145a[_0x8a01('0x5')]])){utils[_0x8a01('0xa')](util['format'](_0x8a01('0x1d'),_0x4e145a['uniqueid']),_0x4e145a);dials[_0x4e145a[_0x8a01('0x5')]][_0x8a01('0x7')]=_0x4e145a[_0x8a01('0x7')];if(_0x4e145a[_0x8a01('0x7')]==_0x8a01('0x1e')){dials[_0x4e145a[_0x8a01('0x5')]]=_[_0x8a01('0x17')](dials[_0x4e145a[_0x8a01('0x5')]],_0x4e145a);dials[_0x4e145a[_0x8a01('0x5')]][_0x8a01('0x1f')]=utils[_0x8a01('0x19')]();dials[_0x4e145a['uniqueid']][_0x8a01('0x1a')]=_0x8a01('0x20');utils[_0x8a01('0x2')](util[_0x8a01('0x3')](_0x8a01('0x21'),_0x4e145a[_0x8a01('0x5')],_0x4e145a['dialstatus'],dials[_0x4e145a[_0x8a01('0x5')]][_0x8a01('0x1f')]));}else{utils[_0x8a01('0x2')](util[_0x8a01('0x3')](_0x8a01('0x22'),_0x4e145a[_0x8a01('0x5')],_0x4e145a['dialstatus']));}}}catch(_0x56ba1f){utils['error'](util[_0x8a01('0x3')]('[%s][dials][dialend]',_0x4e145a[_0x8a01('0x5')]),_0x56ba1f);}};exports[_0x8a01('0x23')]=function(_0x544394){try{if(!_[_0x8a01('0x11')](dials[_0x544394[_0x8a01('0x5')]])){utils[_0x8a01('0xa')](util[_0x8a01('0x3')]('[%s][dials][hangup]',_0x544394[_0x8a01('0x5')]),_0x544394);utils[_0x8a01('0x2')](util[_0x8a01('0x3')](_0x8a01('0x24'),_0x544394['uniqueid'],_0x544394['calleridnum'],_0x544394['calleridname'],_0x544394[_0x8a01('0x25')]));dials[_0x544394[_0x8a01('0x5')]]=_[_0x8a01('0x17')](dials[_0x544394[_0x8a01('0x5')]],{'endtime':utils['now'](),'lastevent':_0x8a01('0x26')});dials[_0x544394['uniqueid']][_0x8a01('0x27')]=utils[_0x8a01('0x28')](dials[_0x544394[_0x8a01('0x5')]][_0x8a01('0x29')],dials[_0x544394[_0x8a01('0x5')]][_0x8a01('0x18')]);dials[_0x544394[_0x8a01('0x5')]][_0x8a01('0x2a')]=utils[_0x8a01('0x28')](dials[_0x544394['uniqueid']][_0x8a01('0x1f')]||dials[_0x544394['uniqueid']][_0x8a01('0x29')],dials[_0x544394[_0x8a01('0x5')]][_0x8a01('0x18')]);dials[_0x544394[_0x8a01('0x5')]][_0x8a01('0x2b')]=dials[_0x544394[_0x8a01('0x5')]][_0x8a01('0x1f')]?utils[_0x8a01('0x28')](dials[_0x544394[_0x8a01('0x5')]]['endtime'],dials[_0x544394[_0x8a01('0x5')]][_0x8a01('0x1f')]):0x0;writeDB(dials[_0x544394[_0x8a01('0x5')]]);}}catch(_0x49c622){utils['error'](util[_0x8a01('0x3')](_0x8a01('0x2c'),_0x544394[_0x8a01('0x5')]),_0x49c622);}}; \ No newline at end of file +var _0xf080=['duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','format','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','debug','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','appdata','split','error','varset','[%s][dials][varset]','isNil','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','ANSWER','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete'];(function(_0x15a385,_0x5786fb){var _0xb433e8=function(_0x2805bd){while(--_0x2805bd){_0x15a385['push'](_0x15a385['shift']());}};_0xb433e8(++_0x5786fb);}(_0xf080,0x1d9));var _0x0f08=function(_0x7f9169,_0xdaf432){_0x7f9169=_0x7f9169-0x0;var _0x313d8b=_0xf080[_0x7f9169];return _0x313d8b;};'use strict';var _=require(_0x0f08('0x0'));var util=require(_0x0f08('0x1'));var utils=require(_0x0f08('0x2'));var dials={};function writeDB(_0x2e7469){utils['info'](util[_0x0f08('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x2e7469[_0x0f08('0x4')],_0x2e7469[_0x0f08('0x5')],_0x2e7469[_0x0f08('0x6')],_0x2e7469[_0x0f08('0x7')],_0x2e7469[_0x0f08('0x8')],_0x2e7469[_0x0f08('0x9')]));utils[_0x0f08('0xa')](_0x0f08('0xb'),_0x2e7469);delete dials[_0x2e7469[_0x0f08('0x4')]];}exports['newexten']=function(_0x471b96){try{utils[_0x0f08('0xc')](util[_0x0f08('0x3')](_0x0f08('0xd'),_0x471b96[_0x0f08('0x4')]),_0x471b96);utils[_0x0f08('0xe')](util['format'](_0x0f08('0xf'),_0x471b96[_0x0f08('0x4')],_0x471b96[_0x0f08('0x10')],_0x471b96['appdata']));if(_0x471b96[_0x0f08('0x10')][_0x0f08('0x11')]()==_0x0f08('0x12')&&_['startsWith'](_0x471b96[_0x0f08('0x13')]['toLowerCase'](),'cdr(routeid)')){var _0x4eaef0=_0x471b96['appdata'][_0x0f08('0x14')]('=');dials[_0x471b96[_0x0f08('0x4')]]={'routeId':_0x4eaef0[0x1]};}}catch(_0xc66762){utils[_0x0f08('0x15')](util[_0x0f08('0x3')](_0x0f08('0xd'),_0x471b96[_0x0f08('0x4')]),_0xc66762);}};exports[_0x0f08('0x16')]=function(_0x44f9fa){try{utils['debug'](util[_0x0f08('0x3')](_0x0f08('0x17'),_0x44f9fa[_0x0f08('0x4')]),_0x44f9fa);if(!_[_0x0f08('0x18')](_0x44f9fa[_0x0f08('0x19')]['outboundrouteid'])){utils[_0x0f08('0xe')](util['format'](_0x0f08('0x1a'),_0x44f9fa['uniqueid'],_0x44f9fa[_0x0f08('0x1b')]));dials[_0x44f9fa['uniqueid']]={'routeId':_0x44f9fa[_0x0f08('0x1b')]};}}catch(_0x198fc8){utils[_0x0f08('0x15')](util[_0x0f08('0x3')](_0x0f08('0x17'),_0x44f9fa[_0x0f08('0x4')]),_0x198fc8);}};exports[_0x0f08('0x1c')]=function(_0x1e222a){try{if(!_['isNil'](dials[_0x1e222a[_0x0f08('0x4')]])){utils[_0x0f08('0xc')](util[_0x0f08('0x3')](_0x0f08('0x1d'),_0x1e222a['uniqueid']),_0x1e222a);dials[_0x1e222a['uniqueid']]=_[_0x0f08('0x1e')](dials[_0x1e222a[_0x0f08('0x4')]],_0x1e222a);dials[_0x1e222a[_0x0f08('0x4')]][_0x0f08('0x1f')]=utils[_0x0f08('0x20')]();dials[_0x1e222a[_0x0f08('0x4')]][_0x0f08('0x21')]=_0x0f08('0x22');utils['info'](util[_0x0f08('0x3')](_0x0f08('0x23'),_0x1e222a['uniqueid'],dials[_0x1e222a[_0x0f08('0x4')]][_0x0f08('0x1f')]));}}catch(_0x48e13c){utils['error'](util[_0x0f08('0x3')](_0x0f08('0x1d'),_0x1e222a[_0x0f08('0x4')]),_0x48e13c);}};exports['dialend']=function(_0x57fc90){try{if(!_[_0x0f08('0x18')](dials[_0x57fc90['uniqueid']])){utils[_0x0f08('0xc')](util[_0x0f08('0x3')](_0x0f08('0x24'),_0x57fc90['uniqueid']),_0x57fc90);dials[_0x57fc90[_0x0f08('0x4')]]['dialstatus']=_0x57fc90[_0x0f08('0x9')];if(_0x57fc90[_0x0f08('0x9')]==_0x0f08('0x25')){dials[_0x57fc90[_0x0f08('0x4')]]=_['assign'](dials[_0x57fc90['uniqueid']],_0x57fc90);dials[_0x57fc90[_0x0f08('0x4')]]['answertime']=utils['now']();dials[_0x57fc90[_0x0f08('0x4')]][_0x0f08('0x21')]=_0x0f08('0x26');utils['info'](util[_0x0f08('0x3')](_0x0f08('0x27'),_0x57fc90[_0x0f08('0x4')],_0x57fc90['dialstatus'],dials[_0x57fc90[_0x0f08('0x4')]][_0x0f08('0x28')]));}else{utils[_0x0f08('0xe')](util['format'](_0x0f08('0x29'),_0x57fc90[_0x0f08('0x4')],_0x57fc90['dialstatus']));}}}catch(_0x383228){utils['error'](util['format'](_0x0f08('0x24'),_0x57fc90[_0x0f08('0x4')]),_0x383228);}};exports[_0x0f08('0x2a')]=function(_0x4c2361){try{if(!_[_0x0f08('0x18')](dials[_0x4c2361[_0x0f08('0x4')]])){utils['debug'](util[_0x0f08('0x3')](_0x0f08('0x2b'),_0x4c2361['uniqueid']),_0x4c2361);utils[_0x0f08('0xe')](util['format'](_0x0f08('0x2c'),_0x4c2361['uniqueid'],_0x4c2361[_0x0f08('0x7')],_0x4c2361['calleridname'],_0x4c2361[_0x0f08('0x2d')]));dials[_0x4c2361[_0x0f08('0x4')]]=_[_0x0f08('0x1e')](dials[_0x4c2361[_0x0f08('0x4')]],{'endtime':utils[_0x0f08('0x20')](),'lastevent':_0x0f08('0x2e')});dials[_0x4c2361['uniqueid']][_0x0f08('0x2f')]=utils[_0x0f08('0x30')](dials[_0x4c2361[_0x0f08('0x4')]][_0x0f08('0x31')],dials[_0x4c2361[_0x0f08('0x4')]]['starttime']);dials[_0x4c2361[_0x0f08('0x4')]][_0x0f08('0x32')]=utils[_0x0f08('0x30')](dials[_0x4c2361[_0x0f08('0x4')]]['answertime']||dials[_0x4c2361[_0x0f08('0x4')]][_0x0f08('0x31')],dials[_0x4c2361[_0x0f08('0x4')]][_0x0f08('0x1f')]);dials[_0x4c2361[_0x0f08('0x4')]][_0x0f08('0x33')]=dials[_0x4c2361[_0x0f08('0x4')]][_0x0f08('0x28')]?utils[_0x0f08('0x30')](dials[_0x4c2361[_0x0f08('0x4')]][_0x0f08('0x31')],dials[_0x4c2361[_0x0f08('0x4')]][_0x0f08('0x28')]):0x0;writeDB(dials[_0x4c2361[_0x0f08('0x4')]]);}}catch(_0x49ade3){utils['error'](util[_0x0f08('0x3')](_0x0f08('0x2b'),_0x4c2361[_0x0f08('0x4')]),_0x49ade3);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 9ae1ed8..45a4a35 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 _0x54be=['[%s][index][cdr]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','production','local','port','asterisk','username','password','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','uniqueid','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr'];(function(_0x45c856,_0x5e6a1e){var _0x4961aa=function(_0x29f14d){while(--_0x29f14d){_0x45c856['push'](_0x45c856['shift']());}};_0x4961aa(++_0x5e6a1e);}(_0x54be,0x1a8));var _0xe54b=function(_0x42ffa2,_0x4b3b89){_0x42ffa2=_0x42ffa2-0x0;var _0x281f01=_0x54be[_0x42ffa2];return _0x281f01;};var AsteriskManager=require(_0xe54b('0x0'));var config=require(_0xe54b('0x1'));var utils=require(_0xe54b('0x2'));var util=require(_0xe54b('0x3'));var isXDREnabled=config[_0xe54b('0x4')]&&config[_0xe54b('0x4')][_0xe54b('0x5')]?!config[_0xe54b('0x4')][_0xe54b('0x5')]:!![];var isProduction=config['env']===_0xe54b('0x6')||![];var isLocalAsterisk=config[_0xe54b('0x4')]&&config[_0xe54b('0x4')][_0xe54b('0x7')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0xe54b('0x8')],config['asterisk']['ip'],config[_0xe54b('0x9')][_0xe54b('0xa')],config[_0xe54b('0x9')][_0xe54b('0xb')],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0xe54b('0xc')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0xe54b('0xd'));}else{var agents=require(_0xe54b('0xe'));var calls=require('./calls.controller');var queues=require(_0xe54b('0xf'));var recordings=require(_0xe54b('0x10'));var members=require(_0xe54b('0x11'));var dials=require('./dials.controller');var transfers=require(_0xe54b('0x12'));var core=require(_0xe54b('0x13'));ami['on']('connect',core[_0xe54b('0x14')]);ami['on'](_0xe54b('0x15'),core[_0xe54b('0x15')]);ami['on'](_0xe54b('0x16'),core[_0xe54b('0x16')]);ami['on'](_0xe54b('0x17'),core[_0xe54b('0x17')]);ami['on']('close',core['close']);ami['on'](_0xe54b('0x18'),core[_0xe54b('0x18')]);ami['on'](_0xe54b('0x19'),function(_0x30652e){try{utils[_0xe54b('0x1a')](util[_0xe54b('0x1b')](_0xe54b('0x1c'),_0x30652e[_0xe54b('0x1d')]),_0x30652e);members[_0xe54b('0x19')](_0x30652e);}catch(_0xeaf321){utils[_0xe54b('0x17')](util['format'](_0xe54b('0x1c'),_0x30652e[_0xe54b('0x1d')]),_0xeaf321);}});ami['on'](_0xe54b('0x1e'),function(_0x1ed26b){try{utils['debug'](util[_0xe54b('0x1b')]('[%s][index][agentcalled]',_0x1ed26b[_0xe54b('0x1f')]),_0x1ed26b);agents[_0xe54b('0x1e')](_0x1ed26b);}catch(_0x37bea8){utils[_0xe54b('0x17')](util[_0xe54b('0x1b')](_0xe54b('0x20'),_0x1ed26b[_0xe54b('0x1f')]),_0x37bea8);}});ami['on'](_0xe54b('0x21'),function(_0x5ef2af){try{utils['debug'](util[_0xe54b('0x1b')](_0xe54b('0x22'),_0x5ef2af[_0xe54b('0x1f')]),_0x5ef2af);agents[_0xe54b('0x21')](_0x5ef2af);}catch(_0x36654f){utils[_0xe54b('0x17')](util[_0xe54b('0x1b')]('[%s][index][agentringnoanswer]',_0x5ef2af[_0xe54b('0x1f')]),_0x36654f);}});ami['on'](_0xe54b('0x23'),function(_0x28e6a9){try{utils[_0xe54b('0x1a')](util[_0xe54b('0x1b')]('[%s][index][agentconnect]',_0x28e6a9[_0xe54b('0x1f')]),_0x28e6a9);agents[_0xe54b('0x23')](_0x28e6a9);queues[_0xe54b('0x23')](_0x28e6a9);}catch(_0x2416c4){utils['error'](util['format']('[%s][index][agentconnect]',_0x28e6a9[_0xe54b('0x1f')]),_0x2416c4);}});ami['on'](_0xe54b('0x24'),function(_0xea9a69){try{utils[_0xe54b('0x1a')](util[_0xe54b('0x1b')](_0xe54b('0x25'),_0xea9a69['uniqueid']),_0xea9a69);agents['agentcomplete'](_0xea9a69);queues[_0xe54b('0x24')](_0xea9a69);members[_0xe54b('0x24')](_0xea9a69);}catch(_0x86060e){utils['error'](util[_0xe54b('0x1b')](_0xe54b('0x25'),_0xea9a69['uniqueid']),_0x86060e);}});ami['on'](_0xe54b('0x26'),function(_0x30f99b){try{utils[_0xe54b('0x1a')](util[_0xe54b('0x1b')](_0xe54b('0x27'),_0x30f99b[_0xe54b('0x1f')]),_0x30f99b);agents[_0xe54b('0x26')](_0x30f99b);queues[_0xe54b('0x26')](_0x30f99b);}catch(_0x52b203){utils[_0xe54b('0x17')](util['format'](_0xe54b('0x27'),_0x30f99b[_0xe54b('0x1f')]),_0x52b203);}});ami['on'](_0xe54b('0x28'),function(_0x324996){try{utils[_0xe54b('0x1a')](util[_0xe54b('0x1b')](_0xe54b('0x29'),_0x324996[_0xe54b('0x1f')]),_0x324996);queues[_0xe54b('0x28')](_0x324996);recordings[_0xe54b('0x28')](_0x324996);}catch(_0x3af483){utils[_0xe54b('0x17')](util[_0xe54b('0x1b')](_0xe54b('0x29'),_0x324996['uniqueid']),_0x3af483);}});ami['on'](_0xe54b('0x2a'),function(_0x19af33){try{utils[_0xe54b('0x1a')](util[_0xe54b('0x1b')](_0xe54b('0x2b'),_0x19af33[_0xe54b('0x1f')]),_0x19af33);queues[_0xe54b('0x2a')](_0x19af33);}catch(_0x18edec){utils['error'](util[_0xe54b('0x1b')]('[%s][index][queuecallerleave]',_0x19af33[_0xe54b('0x1f')]),_0x18edec);}});ami['on'](_0xe54b('0x2c'),function(_0x173cd6){try{utils[_0xe54b('0x1a')](util[_0xe54b('0x1b')](_0xe54b('0x2d'),_0x173cd6['uniqueid']),_0x173cd6);queues['musiconholdstart'](_0x173cd6);calls[_0xe54b('0x2c')](_0x173cd6);}catch(_0x3d09f2){utils[_0xe54b('0x17')](util[_0xe54b('0x1b')](_0xe54b('0x2d'),_0x173cd6['uniqueid']),_0x3d09f2);}});ami['on'](_0xe54b('0x2e'),function(_0x5c08c0){try{utils[_0xe54b('0x1a')](util['format']('[%s][index][musiconholdstop]',_0x5c08c0['uniqueid']),_0x5c08c0);queues[_0xe54b('0x2e')](_0x5c08c0);calls[_0xe54b('0x2e')](_0x5c08c0);}catch(_0x328711){utils[_0xe54b('0x17')](util[_0xe54b('0x1b')]('[%s][index][musiconholdstop]',_0x5c08c0[_0xe54b('0x1f')]),_0x328711);}});ami['on']('newstate',function(_0x521702){try{utils[_0xe54b('0x1a')](util[_0xe54b('0x1b')](_0xe54b('0x2f'),_0x521702['uniqueid']),_0x521702);calls[_0xe54b('0x30')](_0x521702);recordings['newstate'](_0x521702);}catch(_0x41ead1){utils[_0xe54b('0x17')](util[_0xe54b('0x1b')](_0xe54b('0x2f'),_0x521702[_0xe54b('0x1f')]),_0x41ead1);}});ami['on'](_0xe54b('0x31'),function(_0x40301d){try{utils['debug'](util['format']('[%s][index][hangup]',_0x40301d[_0xe54b('0x1f')]),_0x40301d);calls[_0xe54b('0x31')](_0x40301d);recordings[_0xe54b('0x31')](_0x40301d);dials[_0xe54b('0x31')](_0x40301d);agents[_0xe54b('0x31')](_0x40301d);queues[_0xe54b('0x31')](_0x40301d);}catch(_0x489c30){utils[_0xe54b('0x17')](util[_0xe54b('0x1b')](_0xe54b('0x32'),_0x40301d['uniqueid']),_0x489c30);}});ami['on'](_0xe54b('0x33'),function(_0x9fc8c9){try{utils[_0xe54b('0x1a')](util[_0xe54b('0x1b')](_0xe54b('0x34'),_0x9fc8c9['uniqueid']),_0x9fc8c9);members[_0xe54b('0x33')](_0x9fc8c9);}catch(_0x3de238){utils[_0xe54b('0x17')](util[_0xe54b('0x1b')](_0xe54b('0x34'),_0x9fc8c9[_0xe54b('0x1f')]),_0x3de238);}});ami['on']('blindtransfer',function(_0x44dcd6){try{utils['debug'](util[_0xe54b('0x1b')]('[%s][index][blindtransfer]',_0x44dcd6[_0xe54b('0x1f')]),_0x44dcd6);queues[_0xe54b('0x35')](_0x44dcd6);agents[_0xe54b('0x35')](_0x44dcd6);transfers[_0xe54b('0x35')](_0x44dcd6);recordings[_0xe54b('0x35')](_0x44dcd6);}catch(_0x5afead){utils[_0xe54b('0x17')](util[_0xe54b('0x1b')]('[%s][index][blindtransfer]',_0x44dcd6[_0xe54b('0x1f')]),_0x5afead);}});ami['on'](_0xe54b('0x36'),function(_0x3cb401){try{utils['debug'](util[_0xe54b('0x1b')](_0xe54b('0x37'),_0x3cb401['origtransfereruniqueid']),_0x3cb401);queues[_0xe54b('0x36')](_0x3cb401);transfers[_0xe54b('0x36')](_0x3cb401);agents['attendedtransfer'](_0x3cb401);calls['attendedtransfer'](_0x3cb401);}catch(_0x3e27d6){utils[_0xe54b('0x17')](util[_0xe54b('0x1b')]('[%s][index][attendedtransfer]',_0x3cb401[_0xe54b('0x38')]),_0x3e27d6);}});ami['on'](_0xe54b('0x39'),function(_0xdce0e4){try{utils[_0xe54b('0x1a')](util[_0xe54b('0x1b')](_0xe54b('0x3a'),_0xdce0e4[_0xe54b('0x1f')]),_0xdce0e4);queues[_0xe54b('0x39')](_0xdce0e4);recordings[_0xe54b('0x39')](_0xdce0e4);calls['varset'](_0xdce0e4);dials['varset'](_0xdce0e4);}catch(_0x2d30bb){utils[_0xe54b('0x17')](util[_0xe54b('0x1b')](_0xe54b('0x3a'),_0xdce0e4['uniqueid']),_0x2d30bb);}});ami['on'](_0xe54b('0x3b'),function(_0x5a4a74){try{utils[_0xe54b('0x1a')](util['format'](_0xe54b('0x3c'),_0x5a4a74[_0xe54b('0x1f')]),_0x5a4a74);calls[_0xe54b('0x3b')](_0x5a4a74);recordings[_0xe54b('0x3b')](_0x5a4a74);dials[_0xe54b('0x3b')](_0x5a4a74);}catch(_0x5c4579){utils[_0xe54b('0x17')](util[_0xe54b('0x1b')](_0xe54b('0x3c'),_0x5a4a74['uniqueid']),_0x5c4579);}});ami['on'](_0xe54b('0x3d'),function(_0x3f9a94){try{utils[_0xe54b('0x1a')](util[_0xe54b('0x1b')](_0xe54b('0x3e'),_0x3f9a94['uniqueid']),_0x3f9a94);calls['newchannel'](_0x3f9a94);recordings[_0xe54b('0x3d')](_0x3f9a94);}catch(_0x46f441){utils[_0xe54b('0x17')](util[_0xe54b('0x1b')](_0xe54b('0x3e'),_0x3f9a94[_0xe54b('0x1f')]),_0x46f441);}});ami['on'](_0xe54b('0x3f'),function(_0x182ff3){try{utils[_0xe54b('0x1a')](util[_0xe54b('0x1b')](_0xe54b('0x40'),_0x182ff3['uniqueid']),_0x182ff3);dials[_0xe54b('0x3f')](_0x182ff3);}catch(_0x2c7a38){utils[_0xe54b('0x17')](util[_0xe54b('0x1b')](_0xe54b('0x41'),_0x182ff3['uniqueid']),_0x2c7a38);}});ami['on'](_0xe54b('0x42'),function(_0x12fae6){try{utils[_0xe54b('0x1a')](util['format']('[%s][index][dialend]',_0x12fae6[_0xe54b('0x1f')]),_0x12fae6);dials['dialend'](_0x12fae6);}catch(_0x1005ce){utils[_0xe54b('0x17')](util['format'](_0xe54b('0x43'),_0x12fae6[_0xe54b('0x1f')]),_0x1005ce);}});} \ No newline at end of file +var _0x5882=['newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','env','local','asterisk','password','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','connect','error','close','managerevent','debug','format','[%s][index][devicestatechange]','devicestatechange','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','varset','[%s][index][varset]','[%s][index][newexten]','newexten'];(function(_0x111461,_0x2c9279){var _0x3832a8=function(_0x20b6b4){while(--_0x20b6b4){_0x111461['push'](_0x111461['shift']());}};_0x3832a8(++_0x2c9279);}(_0x5882,0x193));var _0x2588=function(_0x5c6073,_0x4fe485){_0x5c6073=_0x5c6073-0x0;var _0x584670=_0x5882[_0x5c6073];return _0x584670;};var AsteriskManager=require(_0x2588('0x0'));var config=require(_0x2588('0x1'));var utils=require(_0x2588('0x2'));var util=require(_0x2588('0x3'));var isXDREnabled=config[_0x2588('0x4')]&&config[_0x2588('0x4')][_0x2588('0x5')]?!config[_0x2588('0x4')][_0x2588('0x5')]:!![];var isProduction=config[_0x2588('0x6')]==='production'||![];var isLocalAsterisk=config[_0x2588('0x4')]&&config[_0x2588('0x4')][_0x2588('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0x2588('0x8')]['port'],config[_0x2588('0x8')]['ip'],config[_0x2588('0x8')]['username'],config[_0x2588('0x8')][_0x2588('0x9')],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0x2588('0xa')](_0x2588('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x2588('0xa')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0x2588('0xc'));var calls=require(_0x2588('0xd'));var queues=require(_0x2588('0xe'));var recordings=require(_0x2588('0xf'));var members=require('./members.controller');var dials=require(_0x2588('0x10'));var transfers=require(_0x2588('0x11'));var core=require(_0x2588('0x12'));ami['on'](_0x2588('0x13'),core['connect']);ami['on']('shutdown',core['shutdown']);ami['on']('fullybooted',core['fullybooted']);ami['on'](_0x2588('0x14'),core[_0x2588('0x14')]);ami['on'](_0x2588('0x15'),core[_0x2588('0x15')]);ami['on']('managerevent',core[_0x2588('0x16')]);ami['on']('devicestatechange',function(_0x515205){try{utils[_0x2588('0x17')](util[_0x2588('0x18')](_0x2588('0x19'),_0x515205['device']),_0x515205);members[_0x2588('0x1a')](_0x515205);}catch(_0x84aaa7){utils['error'](util[_0x2588('0x18')](_0x2588('0x19'),_0x515205[_0x2588('0x1b')]),_0x84aaa7);}});ami['on'](_0x2588('0x1c'),function(_0x26cffd){try{utils[_0x2588('0x17')](util[_0x2588('0x18')](_0x2588('0x1d'),_0x26cffd['uniqueid']),_0x26cffd);agents['agentcalled'](_0x26cffd);}catch(_0x37935c){utils[_0x2588('0x14')](util[_0x2588('0x18')]('[%s][index][agentcalled]',_0x26cffd[_0x2588('0x1e')]),_0x37935c);}});ami['on'](_0x2588('0x1f'),function(_0x5b1797){try{utils[_0x2588('0x17')](util[_0x2588('0x18')](_0x2588('0x20'),_0x5b1797[_0x2588('0x1e')]),_0x5b1797);agents[_0x2588('0x1f')](_0x5b1797);}catch(_0x25ba84){utils[_0x2588('0x14')](util['format'](_0x2588('0x20'),_0x5b1797[_0x2588('0x1e')]),_0x25ba84);}});ami['on'](_0x2588('0x21'),function(_0x316c97){try{utils[_0x2588('0x17')](util['format'](_0x2588('0x22'),_0x316c97[_0x2588('0x1e')]),_0x316c97);agents[_0x2588('0x21')](_0x316c97);queues[_0x2588('0x21')](_0x316c97);}catch(_0x294618){utils[_0x2588('0x14')](util[_0x2588('0x18')]('[%s][index][agentconnect]',_0x316c97['uniqueid']),_0x294618);}});ami['on']('agentcomplete',function(_0x554845){try{utils['debug'](util[_0x2588('0x18')](_0x2588('0x23'),_0x554845[_0x2588('0x1e')]),_0x554845);agents['agentcomplete'](_0x554845);queues['agentcomplete'](_0x554845);members['agentcomplete'](_0x554845);}catch(_0x5ef560){utils[_0x2588('0x14')](util[_0x2588('0x18')]('[%s][index][agentcomplete]',_0x554845[_0x2588('0x1e')]),_0x5ef560);}});ami['on']('queuecallerabandon',function(_0x564e52){try{utils[_0x2588('0x17')](util['format']('[%s][index][queuecallerabandon]',_0x564e52[_0x2588('0x1e')]),_0x564e52);agents[_0x2588('0x24')](_0x564e52);queues[_0x2588('0x24')](_0x564e52);}catch(_0x478e0d){utils[_0x2588('0x14')](util[_0x2588('0x18')](_0x2588('0x25'),_0x564e52[_0x2588('0x1e')]),_0x478e0d);}});ami['on'](_0x2588('0x26'),function(_0x3e0af8){try{utils[_0x2588('0x17')](util[_0x2588('0x18')](_0x2588('0x27'),_0x3e0af8[_0x2588('0x1e')]),_0x3e0af8);queues[_0x2588('0x26')](_0x3e0af8);recordings[_0x2588('0x26')](_0x3e0af8);}catch(_0x151f07){utils['error'](util[_0x2588('0x18')](_0x2588('0x27'),_0x3e0af8[_0x2588('0x1e')]),_0x151f07);}});ami['on']('queuecallerleave',function(_0x4ed01d){try{utils[_0x2588('0x17')](util[_0x2588('0x18')](_0x2588('0x28'),_0x4ed01d[_0x2588('0x1e')]),_0x4ed01d);queues['queuecallerleave'](_0x4ed01d);}catch(_0x114bc5){utils[_0x2588('0x14')](util[_0x2588('0x18')]('[%s][index][queuecallerleave]',_0x4ed01d[_0x2588('0x1e')]),_0x114bc5);}});ami['on'](_0x2588('0x29'),function(_0x593048){try{utils['debug'](util['format'](_0x2588('0x2a'),_0x593048[_0x2588('0x1e')]),_0x593048);queues['musiconholdstart'](_0x593048);calls[_0x2588('0x29')](_0x593048);}catch(_0x80fc9f){utils[_0x2588('0x14')](util[_0x2588('0x18')](_0x2588('0x2a'),_0x593048[_0x2588('0x1e')]),_0x80fc9f);}});ami['on'](_0x2588('0x2b'),function(_0x214886){try{utils[_0x2588('0x17')](util[_0x2588('0x18')](_0x2588('0x2c'),_0x214886[_0x2588('0x1e')]),_0x214886);queues['musiconholdstop'](_0x214886);calls['musiconholdstop'](_0x214886);}catch(_0x59c04e){utils[_0x2588('0x14')](util[_0x2588('0x18')]('[%s][index][musiconholdstop]',_0x214886[_0x2588('0x1e')]),_0x59c04e);}});ami['on'](_0x2588('0x2d'),function(_0x41a376){try{utils[_0x2588('0x17')](util[_0x2588('0x18')](_0x2588('0x2e'),_0x41a376['uniqueid']),_0x41a376);calls[_0x2588('0x2d')](_0x41a376);recordings[_0x2588('0x2d')](_0x41a376);}catch(_0xa0faa7){utils[_0x2588('0x14')](util[_0x2588('0x18')](_0x2588('0x2e'),_0x41a376[_0x2588('0x1e')]),_0xa0faa7);}});ami['on'](_0x2588('0x2f'),function(_0x3da303){try{utils[_0x2588('0x17')](util[_0x2588('0x18')](_0x2588('0x30'),_0x3da303[_0x2588('0x1e')]),_0x3da303);calls[_0x2588('0x2f')](_0x3da303);recordings['hangup'](_0x3da303);dials['hangup'](_0x3da303);agents[_0x2588('0x2f')](_0x3da303);queues['hangup'](_0x3da303);}catch(_0x51fc90){utils[_0x2588('0x14')](util[_0x2588('0x18')](_0x2588('0x30'),_0x3da303[_0x2588('0x1e')]),_0x51fc90);}});ami['on'](_0x2588('0x31'),function(_0x5a6d6a){try{utils[_0x2588('0x17')](util[_0x2588('0x18')](_0x2588('0x32'),_0x5a6d6a[_0x2588('0x1e')]),_0x5a6d6a);members[_0x2588('0x31')](_0x5a6d6a);}catch(_0x5c097d){utils[_0x2588('0x14')](util[_0x2588('0x18')](_0x2588('0x32'),_0x5a6d6a[_0x2588('0x1e')]),_0x5c097d);}});ami['on'](_0x2588('0x33'),function(_0x501311){try{utils[_0x2588('0x17')](util[_0x2588('0x18')]('[%s][index][blindtransfer]',_0x501311[_0x2588('0x1e')]),_0x501311);queues[_0x2588('0x33')](_0x501311);agents[_0x2588('0x33')](_0x501311);transfers['blindtransfer'](_0x501311);recordings['blindtransfer'](_0x501311);}catch(_0x528f3d){utils[_0x2588('0x14')](util[_0x2588('0x18')](_0x2588('0x34'),_0x501311['uniqueid']),_0x528f3d);}});ami['on'](_0x2588('0x35'),function(_0x7c7af9){try{utils[_0x2588('0x17')](util[_0x2588('0x18')](_0x2588('0x36'),_0x7c7af9['origtransfereruniqueid']),_0x7c7af9);queues[_0x2588('0x35')](_0x7c7af9);transfers[_0x2588('0x35')](_0x7c7af9);agents[_0x2588('0x35')](_0x7c7af9);calls[_0x2588('0x35')](_0x7c7af9);}catch(_0x5d87d9){utils[_0x2588('0x14')](util[_0x2588('0x18')](_0x2588('0x36'),_0x7c7af9['origtransfereruniqueid']),_0x5d87d9);}});ami['on'](_0x2588('0x37'),function(_0x541c8d){try{utils[_0x2588('0x17')](util[_0x2588('0x18')](_0x2588('0x38'),_0x541c8d[_0x2588('0x1e')]),_0x541c8d);queues[_0x2588('0x37')](_0x541c8d);recordings[_0x2588('0x37')](_0x541c8d);calls[_0x2588('0x37')](_0x541c8d);dials['varset'](_0x541c8d);}catch(_0x2c2ba7){utils['error'](util['format'](_0x2588('0x38'),_0x541c8d['uniqueid']),_0x2c2ba7);}});ami['on']('newexten',function(_0x57858d){try{utils[_0x2588('0x17')](util[_0x2588('0x18')](_0x2588('0x39'),_0x57858d[_0x2588('0x1e')]),_0x57858d);calls[_0x2588('0x3a')](_0x57858d);recordings[_0x2588('0x3a')](_0x57858d);dials[_0x2588('0x3a')](_0x57858d);}catch(_0x309f30){utils[_0x2588('0x14')](util['format'](_0x2588('0x39'),_0x57858d[_0x2588('0x1e')]),_0x309f30);}});ami['on'](_0x2588('0x3b'),function(_0x280595){try{utils[_0x2588('0x17')](util['format'](_0x2588('0x3c'),_0x280595[_0x2588('0x1e')]),_0x280595);calls[_0x2588('0x3b')](_0x280595);recordings[_0x2588('0x3b')](_0x280595);}catch(_0x372fd9){utils[_0x2588('0x14')](util[_0x2588('0x18')]('[%s][index][newchannel]',_0x280595[_0x2588('0x1e')]),_0x372fd9);}});ami['on'](_0x2588('0x3d'),function(_0x53a265){try{utils['debug'](util['format'](_0x2588('0x3e'),_0x53a265[_0x2588('0x1e')]),_0x53a265);dials[_0x2588('0x3d')](_0x53a265);}catch(_0x3ccab4){utils[_0x2588('0x14')](util[_0x2588('0x18')](_0x2588('0x3f'),_0x53a265[_0x2588('0x1e')]),_0x3ccab4);}});ami['on'](_0x2588('0x40'),function(_0x133401){try{utils[_0x2588('0x17')](util['format'](_0x2588('0x41'),_0x133401[_0x2588('0x1e')]),_0x133401);dials[_0x2588('0x40')](_0x133401);}catch(_0x8a4e83){utils['error'](util[_0x2588('0x18')]('[%s][index][dialend]',_0x133401[_0x2588('0x1e')]),_0x8a4e83);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 2aa03c6..35123d1 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 _0xb7f1=['then','name','internal','request','getUserByName','CreateMemberReport','catch','error','format','[%s][members][writeDB]','some','devicestatechange','debug','device','state','BUSY','now','agent','NOT_INUSE','exitAt','duration','diffTime','enterAt','isNil','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','channel','split','data1','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','./utils','Local/_attended@transfer','Queue:','info','uniqueid','interface','data2','membername','type','getUserByInterface'];(function(_0x2134fa,_0x42a1dd){var _0x4a7d4f=function(_0x22e1bb){while(--_0x22e1bb){_0x2134fa['push'](_0x2134fa['shift']());}};_0x4a7d4f(++_0x42a1dd);}(_0xb7f1,0xdc));var _0x1b7f=function(_0x3c2fd0,_0x3a88d6){_0x3c2fd0=_0x3c2fd0-0x0;var _0x432ba=_0xb7f1[_0x3c2fd0];return _0x432ba;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x1b7f('0x0'));var members={};var exclude=[_0x1b7f('0x1'),_0x1b7f('0x2')];function writeDB(_0x5f2bc1){utils[_0x1b7f('0x3')](util['format']('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x5f2bc1[_0x1b7f('0x4')],_0x5f2bc1[_0x1b7f('0x5')],_0x5f2bc1['channel'],_0x5f2bc1[_0x1b7f('0x6')],_0x5f2bc1[_0x1b7f('0x7')],_0x5f2bc1[_0x1b7f('0x8')]));if(_0x5f2bc1[_0x1b7f('0x5')]){utils[_0x1b7f('0x9')](_0x5f2bc1['interface'])[_0x1b7f('0xa')](function(_0x3c0562){if(_0x3c0562){_0x5f2bc1[_0x1b7f('0x7')]=_0x3c0562[_0x1b7f('0xb')];_0x5f2bc1[_0x1b7f('0xc')]=_0x3c0562[_0x1b7f('0xc')];utils[_0x1b7f('0xd')]('CreateMemberReport',_0x5f2bc1);}else{utils[_0x1b7f('0xe')](_0x5f2bc1['interface']['split']('/')[0x1])[_0x1b7f('0xa')](function(_0x3583ee){if(_0x3583ee){_0x5f2bc1[_0x1b7f('0x7')]=_0x3583ee[_0x1b7f('0xb')];_0x5f2bc1[_0x1b7f('0xc')]=_0x3583ee[_0x1b7f('0xc')];utils['request'](_0x1b7f('0xf'),_0x5f2bc1);}});}})[_0x1b7f('0x10')](function(_0x391eb9){utils[_0x1b7f('0x11')](util[_0x1b7f('0x12')](_0x1b7f('0x13'),_0x5f2bc1[_0x1b7f('0x4')]),_0x391eb9);});}delete members[_0x5f2bc1[_0x1b7f('0x5')]];}function startsWith(_0x534e43,_0x539362){return _[_0x1b7f('0x14')](_0x534e43,function(_0x389ff7){return _['startsWith'](_0x539362,_0x389ff7);});}exports[_0x1b7f('0x15')]=function(_0x45735f){try{utils[_0x1b7f('0x16')](util[_0x1b7f('0x12')]('[%s][members][devicestatechange]',members[_0x45735f[_0x1b7f('0x17')]]?members[_0x45735f[_0x1b7f('0x17')]][_0x1b7f('0x4')]:_0x45735f[_0x1b7f('0x17')]),_0x45735f);utils[_0x1b7f('0x3')](util[_0x1b7f('0x12')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x45735f[_0x1b7f('0x17')]]?members[_0x45735f[_0x1b7f('0x17')]][_0x1b7f('0x4')]:_0x45735f[_0x1b7f('0x17')],_0x45735f['state'],_0x45735f['device']));switch(_0x45735f[_0x1b7f('0x18')]){case'INUSE':case _0x1b7f('0x19'):if(!startsWith(exclude,_0x45735f['device'])){members[_0x45735f[_0x1b7f('0x17')]]={'channel':'voice','interface':_0x45735f[_0x1b7f('0x17')],'type':'TALKING','enterAt':utils[_0x1b7f('0x1a')](),'role':_0x1b7f('0x1b')};}break;case _0x1b7f('0x1c'):if(!_['isNil'](members[_0x45735f['device']])){members[_0x45735f[_0x1b7f('0x17')]][_0x1b7f('0x1d')]=utils[_0x1b7f('0x1a')]();members[_0x45735f[_0x1b7f('0x17')]][_0x1b7f('0x1e')]=utils[_0x1b7f('0x1f')](members[_0x45735f[_0x1b7f('0x17')]][_0x1b7f('0x1d')],members[_0x45735f[_0x1b7f('0x17')]][_0x1b7f('0x20')]);if(members[_0x45735f[_0x1b7f('0x17')]]['uniqueid']){writeDB(members[_0x45735f['device']]);}}break;default:break;}}catch(_0x5a1232){utils['error'](util[_0x1b7f('0x12')]('[%s][members][devicestatechange]',members[_0x45735f[_0x1b7f('0x17')]]?members[_0x45735f[_0x1b7f('0x17')]][_0x1b7f('0x4')]:_0x45735f['device']),_0x5a1232);}};exports['agentcomplete']=function(_0x3cfedd){try{if(!_[_0x1b7f('0x21')](members[_0x3cfedd[_0x1b7f('0x5')]])){utils[_0x1b7f('0x16')](util[_0x1b7f('0x12')](_0x1b7f('0x22'),_0x3cfedd['uniqueid']),_0x3cfedd);utils[_0x1b7f('0x3')](util['format'](_0x1b7f('0x23'),_0x3cfedd[_0x1b7f('0x4')],_0x3cfedd[_0x1b7f('0x5')],_0x3cfedd[_0x1b7f('0x24')]));members[_0x3cfedd[_0x1b7f('0x5')]]=_[_0x1b7f('0x25')](members[_0x3cfedd[_0x1b7f('0x5')]],{'data4':_0x3cfedd[_0x1b7f('0x24')],'uniqueid':_0x3cfedd[_0x1b7f('0x4')]});}}catch(_0x1add6b){utils[_0x1b7f('0x11')](util[_0x1b7f('0x12')](_0x1b7f('0x22'),_0x3cfedd['uniqueid']),_0x1add6b);}};exports[_0x1b7f('0x26')]=function(_0x164276){try{utils[_0x1b7f('0x16')](util['format'](_0x1b7f('0x27'),_0x164276[_0x1b7f('0x4')]),_0x164276);if(_0x164276['channel']){var _0x42e39d=_0x164276[_0x1b7f('0x28')][_0x1b7f('0x29')]('-')[0x0];if(!_['isNil'](members[_0x42e39d])){members[_0x42e39d]=_[_0x1b7f('0x25')](members[_0x42e39d],{'data1':members[_0x42e39d][_0x1b7f('0x2a')]||_0x164276[_0x1b7f('0x8')],'data2':members[_0x42e39d]['data2']||_0x164276['source'],'data3':members[_0x42e39d][_0x1b7f('0x2b')]||_0x164276['destination'],'uniqueid':members[_0x42e39d][_0x1b7f('0x4')]||_0x164276[_0x1b7f('0x4')]});utils['info'](util[_0x1b7f('0x12')](_0x1b7f('0x2c'),_0x164276['uniqueid'],members[_0x42e39d][_0x1b7f('0x2a')],members[_0x42e39d][_0x1b7f('0x6')],members[_0x42e39d][_0x1b7f('0x2b')]));if(members[_0x42e39d][_0x1b7f('0x1d')]){writeDB(members[_0x42e39d]);}}}if(_0x164276[_0x1b7f('0x2d')]){var _0x39f076=_0x164276[_0x1b7f('0x2d')][_0x1b7f('0x29')]('-')[0x0];if(!_[_0x1b7f('0x21')](members[_0x39f076])){members[_0x39f076]=_[_0x1b7f('0x25')](members[_0x39f076],{'data1':members[_0x39f076]['data1']||_0x164276[_0x1b7f('0x8')],'data2':members[_0x39f076]['data2']||_0x164276['source'],'data3':members[_0x39f076]['data3']||_0x164276['destination'],'uniqueid':members[_0x39f076][_0x1b7f('0x4')]||_0x164276['uniqueid']});utils[_0x1b7f('0x3')](util[_0x1b7f('0x12')](_0x1b7f('0x2c'),_0x164276[_0x1b7f('0x4')],members[_0x39f076][_0x1b7f('0x2a')],members[_0x39f076]['data2'],members[_0x39f076][_0x1b7f('0x2b')]));if(members[_0x39f076][_0x1b7f('0x1d')]){writeDB(members[_0x39f076]);}}}}catch(_0x30596b){utils[_0x1b7f('0x11')](util['format'](_0x1b7f('0x27'),_0x164276[_0x1b7f('0x4')]),_0x30596b);}}; \ No newline at end of file +var _0x90b4=['interface','channel','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','error','some','startsWith','devicestatechange','debug','format','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][cdr]','data1','source','data3','data2','destinationchannel','destination','util','./utils','Local/_attended@transfer','Queue:','info','uniqueid'];(function(_0x51ff69,_0x23d467){var _0x4f971b=function(_0x508751){while(--_0x508751){_0x51ff69['push'](_0x51ff69['shift']());}};_0x4f971b(++_0x23d467);}(_0x90b4,0x192));var _0x490b=function(_0x3a2e1e,_0x3aa6b4){_0x3a2e1e=_0x3a2e1e-0x0;var _0x5c4205=_0x90b4[_0x3a2e1e];return _0x5c4205;};'use strict';var _=require('lodash');var util=require(_0x490b('0x0'));var utils=require(_0x490b('0x1'));var members={};var exclude=[_0x490b('0x2'),_0x490b('0x3')];function writeDB(_0x41aab9){utils[_0x490b('0x4')](util['format']('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x41aab9[_0x490b('0x5')],_0x41aab9[_0x490b('0x6')],_0x41aab9[_0x490b('0x7')],_0x41aab9['data2'],_0x41aab9[_0x490b('0x8')],_0x41aab9[_0x490b('0x9')]));if(_0x41aab9[_0x490b('0x6')]){utils[_0x490b('0xa')](_0x41aab9[_0x490b('0x6')])[_0x490b('0xb')](function(_0x4405f1){if(_0x4405f1){_0x41aab9['membername']=_0x4405f1[_0x490b('0xc')];_0x41aab9[_0x490b('0xd')]=_0x4405f1[_0x490b('0xd')];utils[_0x490b('0xe')](_0x490b('0xf'),_0x41aab9);}else{utils[_0x490b('0x10')](_0x41aab9[_0x490b('0x6')][_0x490b('0x11')]('/')[0x1])[_0x490b('0xb')](function(_0x4bfec9){if(_0x4bfec9){_0x41aab9[_0x490b('0x8')]=_0x4bfec9['name'];_0x41aab9[_0x490b('0xd')]=_0x4bfec9[_0x490b('0xd')];utils['request']('CreateMemberReport',_0x41aab9);}});}})[_0x490b('0x12')](function(_0x3b1b0e){utils[_0x490b('0x13')](util['format']('[%s][members][writeDB]',_0x41aab9['uniqueid']),_0x3b1b0e);});}delete members[_0x41aab9[_0x490b('0x6')]];}function startsWith(_0x24c9ba,_0x2a84dd){return _[_0x490b('0x14')](_0x24c9ba,function(_0x2d3b19){return _[_0x490b('0x15')](_0x2a84dd,_0x2d3b19);});}exports[_0x490b('0x16')]=function(_0x3fceea){try{utils[_0x490b('0x17')](util[_0x490b('0x18')]('[%s][members][devicestatechange]',members[_0x3fceea[_0x490b('0x19')]]?members[_0x3fceea[_0x490b('0x19')]][_0x490b('0x5')]:_0x3fceea[_0x490b('0x19')]),_0x3fceea);utils[_0x490b('0x4')](util['format'](_0x490b('0x1a'),members[_0x3fceea['device']]?members[_0x3fceea[_0x490b('0x19')]][_0x490b('0x5')]:_0x3fceea['device'],_0x3fceea[_0x490b('0x1b')],_0x3fceea[_0x490b('0x19')]));switch(_0x3fceea[_0x490b('0x1b')]){case _0x490b('0x1c'):case _0x490b('0x1d'):if(!startsWith(exclude,_0x3fceea['device'])){members[_0x3fceea[_0x490b('0x19')]]={'channel':'voice','interface':_0x3fceea[_0x490b('0x19')],'type':_0x490b('0x1e'),'enterAt':utils[_0x490b('0x1f')](),'role':_0x490b('0x20')};}break;case _0x490b('0x21'):if(!_[_0x490b('0x22')](members[_0x3fceea[_0x490b('0x19')]])){members[_0x3fceea[_0x490b('0x19')]][_0x490b('0x23')]=utils[_0x490b('0x1f')]();members[_0x3fceea[_0x490b('0x19')]][_0x490b('0x24')]=utils[_0x490b('0x25')](members[_0x3fceea[_0x490b('0x19')]][_0x490b('0x23')],members[_0x3fceea['device']][_0x490b('0x26')]);if(members[_0x3fceea[_0x490b('0x19')]][_0x490b('0x5')]){writeDB(members[_0x3fceea[_0x490b('0x19')]]);}}break;default:break;}}catch(_0x3ea117){utils[_0x490b('0x13')](util[_0x490b('0x18')]('[%s][members][devicestatechange]',members[_0x3fceea[_0x490b('0x19')]]?members[_0x3fceea[_0x490b('0x19')]]['uniqueid']:_0x3fceea[_0x490b('0x19')]),_0x3ea117);}};exports[_0x490b('0x27')]=function(_0x31906e){try{if(!_[_0x490b('0x22')](members[_0x31906e[_0x490b('0x6')]])){utils[_0x490b('0x17')](util[_0x490b('0x18')](_0x490b('0x28'),_0x31906e['uniqueid']),_0x31906e);utils[_0x490b('0x4')](util[_0x490b('0x18')](_0x490b('0x29'),_0x31906e[_0x490b('0x5')],_0x31906e['interface'],_0x31906e[_0x490b('0x2a')]));members[_0x31906e[_0x490b('0x6')]]=_[_0x490b('0x2b')](members[_0x31906e['interface']],{'data4':_0x31906e['queue'],'uniqueid':_0x31906e['uniqueid']});}}catch(_0x58bf86){utils[_0x490b('0x13')](util[_0x490b('0x18')](_0x490b('0x28'),_0x31906e['uniqueid']),_0x58bf86);}};exports['cdr']=function(_0xe62d21){try{utils[_0x490b('0x17')](util[_0x490b('0x18')](_0x490b('0x2c'),_0xe62d21[_0x490b('0x5')]),_0xe62d21);if(_0xe62d21[_0x490b('0x7')]){var _0xa78e50=_0xe62d21[_0x490b('0x7')][_0x490b('0x11')]('-')[0x0];if(!_[_0x490b('0x22')](members[_0xa78e50])){members[_0xa78e50]=_[_0x490b('0x2b')](members[_0xa78e50],{'data1':members[_0xa78e50][_0x490b('0x2d')]||_0xe62d21[_0x490b('0x9')],'data2':members[_0xa78e50]['data2']||_0xe62d21[_0x490b('0x2e')],'data3':members[_0xa78e50][_0x490b('0x2f')]||_0xe62d21['destination'],'uniqueid':members[_0xa78e50][_0x490b('0x5')]||_0xe62d21[_0x490b('0x5')]});utils['info'](util[_0x490b('0x18')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0xe62d21[_0x490b('0x5')],members[_0xa78e50][_0x490b('0x2d')],members[_0xa78e50][_0x490b('0x30')],members[_0xa78e50][_0x490b('0x2f')]));if(members[_0xa78e50][_0x490b('0x23')]){writeDB(members[_0xa78e50]);}}}if(_0xe62d21[_0x490b('0x31')]){var _0x27a894=_0xe62d21[_0x490b('0x31')][_0x490b('0x11')]('-')[0x0];if(!_[_0x490b('0x22')](members[_0x27a894])){members[_0x27a894]=_[_0x490b('0x2b')](members[_0x27a894],{'data1':members[_0x27a894][_0x490b('0x2d')]||_0xe62d21['type'],'data2':members[_0x27a894]['data2']||_0xe62d21[_0x490b('0x2e')],'data3':members[_0x27a894][_0x490b('0x2f')]||_0xe62d21[_0x490b('0x32')],'uniqueid':members[_0x27a894][_0x490b('0x5')]||_0xe62d21[_0x490b('0x5')]});utils[_0x490b('0x4')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0xe62d21['uniqueid'],members[_0x27a894][_0x490b('0x2d')],members[_0x27a894][_0x490b('0x30')],members[_0x27a894][_0x490b('0x2f')]));if(members[_0x27a894][_0x490b('0x23')]){writeDB(members[_0x27a894]);}}}}catch(_0x216361){utils[_0x490b('0x13')](util[_0x490b('0x18')](_0x490b('0x2c'),_0xe62d21[_0x490b('0x5')]),_0x216361);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 7491b57..c59f502 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 _0x822b=['queue','lastAssignedTo','calleridnum','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queuecallerabandon','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','accountcode','agentcomplete','queuecallerleaveAt','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','queuecallerenterreason','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','ATTENDED','transfertargetlinkedid','mohtime','[%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','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x822b,0x1b5));var _0xb822=function(_0x263b0e,_0xc6479f){_0x263b0e=_0x263b0e-0x0;var _0x113fee=_0x822b[_0x263b0e];return _0x113fee;};'use strict';var _=require(_0xb822('0x0'));var util=require(_0xb822('0x1'));var utils=require(_0xb822('0x2'));var queues={};function writeDB(_0x20ae78){utils[_0xb822('0x3')](util[_0xb822('0x4')](_0xb822('0x5'),_0x20ae78['uniqueid'],_0x20ae78[_0xb822('0x6')],_0x20ae78[_0xb822('0x7')],_0x20ae78[_0xb822('0x8')],_0x20ae78[_0xb822('0x9')],_0x20ae78['accountcode'],_0x20ae78[_0xb822('0xa')]));if(_0x20ae78['queue']){utils[_0xb822('0xb')](_0x20ae78[_0xb822('0x7')])[_0xb822('0xc')](function(_0x344828){if(_0x344828){_0x20ae78[_0xb822('0xd')]=_0x344828[_0xb822('0xd')];}utils[_0xb822('0xe')](_0xb822('0xf'),_0x20ae78);});}else{utils['request']('CreateVoiceQueueReport',_0x20ae78);}if(_0x20ae78[_0xb822('0x10')]){delete queues[_0x20ae78[_0xb822('0x10')]];}else{delete queues[_0x20ae78[_0xb822('0x11')]];}}exports[_0xb822('0x12')]=function(_0x3b0029){try{utils[_0xb822('0x13')](util[_0xb822('0x4')](_0xb822('0x14'),_0x3b0029[_0xb822('0x11')]),_0x3b0029);utils['info'](util[_0xb822('0x4')](_0xb822('0x15'),_0x3b0029[_0xb822('0x11')],_0x3b0029[_0xb822('0x7')],_0x3b0029[_0xb822('0x16')]));queues[_0x3b0029[_0xb822('0x11')]]=_[_0xb822('0x17')](_0x3b0029,{'originalposition':_0x3b0029[_0xb822('0x16')],'queuecallerjoinAt':utils[_0xb822('0x18')](),'mohtime':0x0});}catch(_0x58811e){utils[_0xb822('0x19')](util[_0xb822('0x4')](_0xb822('0x14'),_0x3b0029[_0xb822('0x11')]),_0x58811e);}};exports[_0xb822('0x1a')]=function(_0x4a0c19){try{if(!_[_0xb822('0x1b')](queues[_0x4a0c19[_0xb822('0x11')]])){utils['debug'](util['format'](_0xb822('0x1c'),_0x4a0c19['uniqueid']),_0x4a0c19);if(queues[_0x4a0c19['uniqueid']]['queuecallerleaveAt']){if(!queues[_0x4a0c19[_0xb822('0x11')]]['queuecallerabandon']&&!queues[_0x4a0c19[_0xb822('0x11')]][_0xb822('0x1d')]){queues[_0x4a0c19['uniqueid']][_0xb822('0x1e')]=!![];queues[_0x4a0c19[_0xb822('0x11')]][_0xb822('0x1f')]=utils['now']();queues[_0x4a0c19[_0xb822('0x11')]][_0xb822('0xa')]=_0xb822('0x20');}utils[_0xb822('0x3')](util[_0xb822('0x4')](_0xb822('0x21'),_0x4a0c19[_0xb822('0x11')],queues[_0x4a0c19[_0xb822('0x11')]][_0xb822('0x22')],queues[_0x4a0c19[_0xb822('0x11')]][_0xb822('0xa')]));writeDB(queues[_0x4a0c19[_0xb822('0x11')]]);}else if(queues[_0x4a0c19['uniqueid']][_0xb822('0x10')]){utils['info'](util['format'](_0xb822('0x23'),_0x4a0c19[_0xb822('0x11')],queues[_0x4a0c19[_0xb822('0x11')]][_0xb822('0x22')],queues[_0x4a0c19[_0xb822('0x11')]]['transfereduniqueid']));queues[queues[_0x4a0c19[_0xb822('0x11')]]['transfereduniqueid']]=queues[_0x4a0c19['uniqueid']];queues[queues[_0x4a0c19[_0xb822('0x11')]]['transfereduniqueid']]['queuecallerenterreason']=0x2;delete queues[_0x4a0c19['uniqueid']];}}}catch(_0x1d40db){utils[_0xb822('0x19')](util[_0xb822('0x4')](_0xb822('0x1c'),_0x4a0c19[_0xb822('0x11')]),_0x1d40db);}};exports[_0xb822('0x24')]=function(_0x576b3c){try{utils[_0xb822('0x13')](util[_0xb822('0x4')](_0xb822('0x25'),_0x576b3c['uniqueid']),_0x576b3c);if(!_[_0xb822('0x1b')](_0x576b3c[_0xb822('0x26')][_0xb822('0x27')])&&_0x576b3c[_0xb822('0x28')][_0xb822('0x29')]()!==_0xb822('0x2a')){if(!_['isNil'](queues[_0x576b3c[_0xb822('0x11')]])){queues[_0x576b3c['uniqueid']]['queuecallerabandon']=![];queues[_0x576b3c[_0xb822('0x11')]][_0xb822('0x2b')]=null;queues[_0x576b3c[_0xb822('0x11')]][_0xb822('0x1d')]=!![];queues[_0x576b3c['uniqueid']][_0xb822('0x2c')]=utils[_0xb822('0x18')]();queues[_0x576b3c['uniqueid']][_0xb822('0xa')]=_0x576b3c[_0xb822('0x28')][_0xb822('0x29')]();utils[_0xb822('0x3')](util['format'](_0xb822('0x2d'),_0x576b3c[_0xb822('0x11')],queues[_0x576b3c[_0xb822('0x11')]]['name'],_0x576b3c['value'],queues[_0x576b3c['uniqueid']][_0xb822('0xa')]));writeDB(queues[_0x576b3c['uniqueid']]);}}else if(!_[_0xb822('0x1b')](_0x576b3c[_0xb822('0x26')]['queueposition'])){if(!_['isNil'](queues[_0x576b3c['uniqueid']])&&!queues[_0x576b3c[_0xb822('0x11')]]['queuecallerabandon']){queues[_0x576b3c[_0xb822('0x11')]][_0xb822('0x2e')]=![];queues[_0x576b3c[_0xb822('0x11')]]['queuecallerabandonAt']=null;queues[_0x576b3c[_0xb822('0x11')]][_0xb822('0x1d')]=!![];queues[_0x576b3c[_0xb822('0x11')]][_0xb822('0x2c')]=utils[_0xb822('0x18')]();queues[_0x576b3c[_0xb822('0x11')]][_0xb822('0xa')]='EXITWITHKEY';utils['info'](util[_0xb822('0x4')](_0xb822('0x2f'),_0x576b3c[_0xb822('0x11')],queues[_0x576b3c[_0xb822('0x11')]][_0xb822('0x22')],_0x576b3c[_0xb822('0x28')],queues[_0x576b3c[_0xb822('0x11')]]['queuecallerexitreason']));}}}catch(_0x1c6043){utils['error'](util[_0xb822('0x4')](_0xb822('0x25'),_0x576b3c[_0xb822('0x11')]),_0x1c6043);}};exports[_0xb822('0x2e')]=function(_0x74e65d){try{if(!_[_0xb822('0x1b')](queues[_0x74e65d[_0xb822('0x11')]])){utils[_0xb822('0x13')](util[_0xb822('0x4')]('[%s][queues][queuecallerabandon]',_0x74e65d[_0xb822('0x11')]),_0x74e65d);queues[_0x74e65d['uniqueid']][_0xb822('0x1d')]=![];queues[_0x74e65d[_0xb822('0x11')]][_0xb822('0x2c')]=null;queues[_0x74e65d[_0xb822('0x11')]][_0xb822('0x2e')]=!![];queues[_0x74e65d['uniqueid']][_0xb822('0x2b')]=utils[_0xb822('0x18')]();queues[_0x74e65d['uniqueid']]['queuecallerexitreason']=_0xb822('0x30');utils['info'](util[_0xb822('0x4')](_0xb822('0x31'),_0x74e65d['uniqueid'],queues[_0x74e65d[_0xb822('0x11')]][_0xb822('0x22')],queues[_0x74e65d['uniqueid']][_0xb822('0xa')]));}}catch(_0x233f7b){utils[_0xb822('0x19')](util[_0xb822('0x4')](_0xb822('0x32'),_0x74e65d[_0xb822('0x11')]),_0x233f7b);}};exports[_0xb822('0x33')]=function(_0xc7aee2){try{if(!_[_0xb822('0x1b')](queues[_0xc7aee2[_0xb822('0x11')]])){utils[_0xb822('0x13')](util[_0xb822('0x4')](_0xb822('0x34'),_0xc7aee2[_0xb822('0x11')]),_0xc7aee2);utils[_0xb822('0x3')](util[_0xb822('0x4')](_0xb822('0x35'),_0xc7aee2[_0xb822('0x11')],queues[_0xc7aee2[_0xb822('0x11')]]['name'],_0xc7aee2[_0xb822('0x36')],_0xc7aee2['connectedlinename']));queues[_0xc7aee2[_0xb822('0x11')]][_0xb822('0x33')]=!![];queues[_0xc7aee2['uniqueid']]['queuecallerleaveAt']=utils[_0xb822('0x18')]();queues[_0xc7aee2[_0xb822('0x11')]][_0xb822('0x37')]=utils[_0xb822('0x38')](queues[_0xc7aee2[_0xb822('0x11')]]['queuecallerleaveAt'],queues[_0xc7aee2[_0xb822('0x11')]][_0xb822('0x39')]);queues[_0xc7aee2['uniqueid']][_0xb822('0x16')]=_0xc7aee2[_0xb822('0x16')];queues[_0xc7aee2[_0xb822('0x11')]]['count']=_0xc7aee2[_0xb822('0x3a')];queues[_0xc7aee2[_0xb822('0x11')]][_0xb822('0x36')]=_0xc7aee2[_0xb822('0x36')];queues[_0xc7aee2[_0xb822('0x11')]][_0xb822('0x3b')]=_0xc7aee2['connectedlinename'];}}catch(_0x2d07b3){utils[_0xb822('0x19')](util[_0xb822('0x4')](_0xb822('0x34'),_0xc7aee2['uniqueid']),_0x2d07b3);}};exports[_0xb822('0x3c')]=function(_0x28a9a0){try{if(!_[_0xb822('0x1b')](queues[_0x28a9a0[_0xb822('0x11')]])){utils['debug'](util[_0xb822('0x4')](_0xb822('0x3d'),_0x28a9a0[_0xb822('0x11')]),_0x28a9a0);utils[_0xb822('0x3')](util[_0xb822('0x4')](_0xb822('0x3e'),_0x28a9a0[_0xb822('0x11')],queues[_0x28a9a0[_0xb822('0x11')]][_0xb822('0x22')],_0x28a9a0[_0xb822('0x3f')],_0x28a9a0[_0xb822('0x40')]));queues[_0x28a9a0['uniqueid']][_0xb822('0x2e')]=![];queues[_0x28a9a0[_0xb822('0x11')]]['queuecallerabandon']=![];queues[_0x28a9a0[_0xb822('0x11')]][_0xb822('0x2b')]=null;queues[_0x28a9a0['uniqueid']][_0xb822('0x1d')]=![];queues[_0x28a9a0[_0xb822('0x11')]][_0xb822('0xa')]=null;queues[_0x28a9a0[_0xb822('0x11')]]['queuecallerexitAt']=null;queues[_0x28a9a0['uniqueid']][_0xb822('0x41')]=!![];queues[_0x28a9a0[_0xb822('0x11')]][_0xb822('0x42')]=_0x28a9a0[_0xb822('0x40')];queues[_0x28a9a0[_0xb822('0x11')]]['lastAssignedTo']=_0x28a9a0[_0xb822('0x3f')];}}catch(_0x33dd4f){utils[_0xb822('0x19')](util['format'](_0xb822('0x3d'),_0x28a9a0[_0xb822('0x11')]),_0x33dd4f);}};exports[_0xb822('0x43')]=function(_0x3af1c1){try{if(!_[_0xb822('0x1b')](queues[_0x3af1c1[_0xb822('0x11')]])){if(queues[_0x3af1c1[_0xb822('0x11')]][_0xb822('0x44')]){utils[_0xb822('0x13')](util[_0xb822('0x4')](_0xb822('0x45'),_0x3af1c1[_0xb822('0x11')]),_0x3af1c1);queues[_0x3af1c1[_0xb822('0x11')]][_0xb822('0x2e')]=![];queues[_0x3af1c1[_0xb822('0x11')]][_0xb822('0x2e')]=![];queues[_0x3af1c1[_0xb822('0x11')]]['queuecallerabandonAt']=null;queues[_0x3af1c1[_0xb822('0x11')]][_0xb822('0x1d')]=![];queues[_0x3af1c1['uniqueid']][_0xb822('0x2c')]=null;queues[_0x3af1c1[_0xb822('0x11')]]['assigned']=!![];queues[_0x3af1c1[_0xb822('0x11')]]['lastAssignedTo']=_0x3af1c1['membername'];queues[_0x3af1c1['uniqueid']][_0xb822('0x1e')]=!![];queues[_0x3af1c1['uniqueid']][_0xb822('0x1f')]=utils[_0xb822('0x18')]();if(_0x3af1c1[_0xb822('0x46')]==_0xb822('0x47')){if(!queues[_0x3af1c1[_0xb822('0x11')]][_0xb822('0x47')]){queues[_0x3af1c1[_0xb822('0x11')]][_0xb822('0xa')]=_0xb822('0x48');}}else{queues[_0x3af1c1['uniqueid']][_0xb822('0xa')]=_0xb822('0x49')+_0x3af1c1[_0xb822('0x46')][_0xb822('0x29')]();}utils[_0xb822('0x3')](util['format'](_0xb822('0x4a'),_0x3af1c1[_0xb822('0x11')],queues[_0x3af1c1[_0xb822('0x11')]][_0xb822('0x22')],_0x3af1c1['membername'],queues[_0x3af1c1[_0xb822('0x11')]][_0xb822('0xa')]));writeDB(queues[_0x3af1c1[_0xb822('0x11')]]);}}}catch(_0x2edfd8){utils['error'](util['format'](_0xb822('0x45'),_0x3af1c1[_0xb822('0x11')]),_0x2edfd8);}};exports[_0xb822('0x4b')]=function(_0x495b1c){try{if(!_[_0xb822('0x1b')](queues[_0x495b1c['transfereeuniqueid']])){utils[_0xb822('0x13')](util[_0xb822('0x4')]('[%s][queues][blindtransfer]',_0x495b1c[_0xb822('0x11')]),_0x495b1c);queues[_0x495b1c[_0xb822('0x4c')]][_0xb822('0x47')]=!![];queues[_0x495b1c[_0xb822('0x4c')]][_0xb822('0x4d')]='BLIND';queues[_0x495b1c[_0xb822('0x4c')]][_0xb822('0x4e')]=_0x495b1c[_0xb822('0x4f')];queues[_0x495b1c[_0xb822('0x4c')]][_0xb822('0x50')]=_0x495b1c[_0xb822('0x4c')];queues[_0x495b1c[_0xb822('0x4c')]]['queuecallerexitreason']=_0xb822('0x51');utils[_0xb822('0x3')](util[_0xb822('0x4')](_0xb822('0x52'),_0x495b1c[_0xb822('0x11')],queues[_0x495b1c[_0xb822('0x4c')]][_0xb822('0x22')],_0x495b1c['transfereeuniqueid'],_0x495b1c[_0xb822('0x4f')]));}}catch(_0x37324c){utils['error'](util[_0xb822('0x4')](_0xb822('0x53'),_0x495b1c[_0xb822('0x11')]),_0x37324c);}};exports[_0xb822('0x54')]=function(_0x109f8b){try{utils[_0xb822('0x13')](util[_0xb822('0x4')](_0xb822('0x55'),_0x109f8b['origtransfereruniqueid']),_0x109f8b);if(_0x109f8b[_0xb822('0x56')]==_0x109f8b[_0xb822('0x57')]){if(!_[_0xb822('0x1b')](queues[_0x109f8b[_0xb822('0x58')]])){utils['info'](util[_0xb822('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x109f8b['origtransfereruniqueid'],queues[_0x109f8b[_0xb822('0x58')]][_0xb822('0x22')],_0x109f8b['origtransfererexten']));queues[_0x109f8b[_0xb822('0x58')]][_0xb822('0x47')]=!![];queues[_0x109f8b[_0xb822('0x58')]][_0xb822('0x4d')]='ATTENDED';queues[_0x109f8b['secondtransfererlinkedid']]['transferexten']=_0x109f8b[_0xb822('0x59')];queues[_0x109f8b['secondtransfererlinkedid']]['transferuniqueid']=_0x109f8b[_0xb822('0x56')];queues[_0x109f8b[_0xb822('0x58')]][_0xb822('0xa')]=_0xb822('0x5a');}if(!_[_0xb822('0x1b')](queues[_0x109f8b[_0xb822('0x57')]])){if(_0x109f8b[_0xb822('0x5b')]&&queues[_0x109f8b[_0xb822('0x5b')]]){queues[_0x109f8b[_0xb822('0x5b')]]['queuecallerenterreason']=0x1;queues[_0x109f8b[_0xb822('0x4c')]]=_[_0xb822('0x5c')](queues[_0x109f8b['transfereelinkedid']]);queues[_0x109f8b['transfereeuniqueid']][_0xb822('0x10')]=_0x109f8b[_0xb822('0x5d')];queues[_0x109f8b['transfereeuniqueid']][_0xb822('0x5e')]=0x2;queues[_0x109f8b['transfereeuniqueid']]['calleridnum']=queues[_0x109f8b[_0xb822('0x58')]][_0xb822('0x9')];queues[_0x109f8b[_0xb822('0x4c')]][_0xb822('0x5f')]=queues[_0x109f8b['secondtransfererlinkedid']][_0xb822('0x5f')];queues[_0x109f8b[_0xb822('0x4c')]]['queuecallerjoinAt']=utils['now']();queues[_0x109f8b[_0xb822('0x4c')]][_0xb822('0x44')]=utils[_0xb822('0x18')]();queues[_0x109f8b['transfereeuniqueid']][_0xb822('0x37')]=0x0;queues[_0x109f8b[_0xb822('0x4c')]]['mohtime']=0x0;utils[_0xb822('0x3')](util[_0xb822('0x4')](_0xb822('0x60'),_0x109f8b[_0xb822('0x56')],queues[_0x109f8b[_0xb822('0x4c')]]['name'],queues[_0x109f8b['transfereeuniqueid']][_0xb822('0x9')],queues[_0x109f8b[_0xb822('0x4c')]]['calleridname']));}else{utils['info'](util['format'](_0xb822('0x61'),_0x109f8b['origtransfereruniqueid'],queues[_0x109f8b['origtransfererlinkedid']][_0xb822('0x22')],_0x109f8b[_0xb822('0x58')]));queues[_0x109f8b[_0xb822('0x57')]][_0xb822('0x10')]=_0x109f8b[_0xb822('0x58')];}}}else if(_0x109f8b[_0xb822('0x62')]==_0x109f8b[_0xb822('0x58')]){if(!_[_0xb822('0x1b')](queues[_0x109f8b[_0xb822('0x57')]])){utils[_0xb822('0x3')](util[_0xb822('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x109f8b[_0xb822('0x56')],queues[_0x109f8b[_0xb822('0x57')]][_0xb822('0x22')],_0x109f8b[_0xb822('0x62')],_0x109f8b[_0xb822('0x63')]));queues[_0x109f8b[_0xb822('0x57')]][_0xb822('0x47')]=!![];queues[_0x109f8b[_0xb822('0x57')]]['transfertype']=_0xb822('0x64');queues[_0x109f8b[_0xb822('0x57')]][_0xb822('0x4e')]=_0x109f8b[_0xb822('0x63')];queues[_0x109f8b[_0xb822('0x57')]][_0xb822('0x50')]=_0x109f8b[_0xb822('0x62')];queues[_0x109f8b[_0xb822('0x57')]][_0xb822('0xa')]=_0xb822('0x5a');}if(!_['isNil'](queues[_0x109f8b[_0xb822('0x58')]])){if(_0x109f8b[_0xb822('0x65')]&&queues[_0x109f8b[_0xb822('0x65')]]){queues[_0x109f8b[_0xb822('0x65')]]['queuecallerenterreason']=0x1;queues[_0x109f8b['transfertargetuniqueid']]=_[_0xb822('0x5c')](queues[_0x109f8b['transfertargetlinkedid']]);queues[_0x109f8b[_0xb822('0x5d')]]['transfereduniqueid']=_0x109f8b['transfertargetuniqueid'];queues[_0x109f8b['transfertargetuniqueid']][_0xb822('0x5e')]=0x2;queues[_0x109f8b[_0xb822('0x5d')]][_0xb822('0x9')]=queues[_0x109f8b[_0xb822('0x57')]]['calleridnum'];queues[_0x109f8b[_0xb822('0x5d')]]['calleridname']=queues[_0x109f8b['origtransfererlinkedid']]['calleridname'];queues[_0x109f8b['transfertargetuniqueid']]['queuecallerjoinAt']=utils[_0xb822('0x18')]();queues[_0x109f8b['transfertargetuniqueid']]['queuecallerleaveAt']=utils[_0xb822('0x18')]();queues[_0x109f8b[_0xb822('0x5d')]][_0xb822('0x37')]=0x0;queues[_0x109f8b[_0xb822('0x5d')]][_0xb822('0x66')]=0x0;utils[_0xb822('0x3')](util['format'](_0xb822('0x67'),_0x109f8b['origtransfereruniqueid'],queues[_0x109f8b[_0xb822('0x5d')]][_0xb822('0x22')],queues[_0x109f8b['transfertargetuniqueid']][_0xb822('0x10')],queues[_0x109f8b[_0xb822('0x5d')]][_0xb822('0x9')],queues[_0x109f8b[_0xb822('0x5d')]][_0xb822('0x5f')]));}else{utils[_0xb822('0x3')](util[_0xb822('0x4')](_0xb822('0x61'),_0x109f8b[_0xb822('0x56')],queues[_0x109f8b[_0xb822('0x58')]][_0xb822('0x22')],_0x109f8b['origtransfererlinkedid']));queues[_0x109f8b[_0xb822('0x58')]][_0xb822('0x10')]=_0x109f8b[_0xb822('0x57')];}}}}catch(_0x3ec855){utils[_0xb822('0x19')](util[_0xb822('0x4')](_0xb822('0x55'),_0x109f8b[_0xb822('0x56')]),_0x3ec855);}};exports[_0xb822('0x68')]=function(_0x2686b3){try{if(!_[_0xb822('0x1b')](queues[_0x2686b3[_0xb822('0x11')]])){utils[_0xb822('0x13')](util[_0xb822('0x4')](_0xb822('0x69'),_0x2686b3['uniqueid']),_0x2686b3);queues[_0x2686b3['uniqueid']]['musiconholdstartAt']=utils['now']();utils[_0xb822('0x3')](util[_0xb822('0x4')](_0xb822('0x6a'),_0x2686b3[_0xb822('0x11')],queues[_0x2686b3[_0xb822('0x11')]][_0xb822('0x22')],queues[_0x2686b3[_0xb822('0x11')]][_0xb822('0x6b')]));}}catch(_0x25c83f){utils[_0xb822('0x19')](util[_0xb822('0x4')](_0xb822('0x69'),_0x2686b3[_0xb822('0x11')]),_0x25c83f);}};exports[_0xb822('0x6c')]=function(_0x315dda){try{if(!_[_0xb822('0x1b')](queues[_0x315dda[_0xb822('0x11')]])){if(!_['isNil'](queues[_0x315dda['uniqueid']][_0xb822('0x6b')])){utils[_0xb822('0x13')](util[_0xb822('0x4')](_0xb822('0x6d'),_0x315dda[_0xb822('0x11')]),_0x315dda);queues[_0x315dda[_0xb822('0x11')]][_0xb822('0x66')]+=utils[_0xb822('0x38')](utils[_0xb822('0x18')](),queues[_0x315dda[_0xb822('0x11')]][_0xb822('0x6b')]);utils[_0xb822('0x3')](util['format'](_0xb822('0x6e'),_0x315dda['uniqueid'],queues[_0x315dda[_0xb822('0x11')]]['name'],queues[_0x315dda['uniqueid']][_0xb822('0x66')]));delete queues[_0x315dda['uniqueid']]['musiconholdstartAt'];}}}catch(_0x9c4917){utils[_0xb822('0x19')](util['format'](_0xb822('0x6d'),_0x315dda[_0xb822('0x11')]),_0x9c4917);}}; \ No newline at end of file +var _0x2447=['extension','transferuniqueid','BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertype','transfertargetlinkedid','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','lastAssignedTo','queuecallerexitreason','getVoiceQueueByName','type','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','error','isNil','variable','queuestatus','value','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transferexten'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x2447,0x1ec));var _0x7244=function(_0x2a1b94,_0x28f24b){_0x2a1b94=_0x2a1b94-0x0;var _0x34a5e5=_0x2447[_0x2a1b94];return _0x34a5e5;};'use strict';var _=require(_0x7244('0x0'));var util=require(_0x7244('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x4c189c){utils[_0x7244('0x2')](util['format'](_0x7244('0x3'),_0x4c189c[_0x7244('0x4')],_0x4c189c['channel'],_0x4c189c[_0x7244('0x5')],_0x4c189c[_0x7244('0x6')],_0x4c189c['calleridnum'],_0x4c189c['accountcode'],_0x4c189c[_0x7244('0x7')]));if(_0x4c189c['queue']){utils[_0x7244('0x8')](_0x4c189c[_0x7244('0x5')])['then'](function(_0x35a4f9){if(_0x35a4f9){_0x4c189c[_0x7244('0x9')]=_0x35a4f9[_0x7244('0x9')];}utils['request'](_0x7244('0xa'),_0x4c189c);});}else{utils['request'](_0x7244('0xa'),_0x4c189c);}if(_0x4c189c[_0x7244('0xb')]){delete queues[_0x4c189c[_0x7244('0xb')]];}else{delete queues[_0x4c189c['uniqueid']];}}exports[_0x7244('0xc')]=function(_0x567221){try{utils[_0x7244('0xd')](util[_0x7244('0xe')]('[%s][queues][queuecallerjoin]',_0x567221[_0x7244('0x4')]),_0x567221);utils[_0x7244('0x2')](util['format'](_0x7244('0xf'),_0x567221[_0x7244('0x4')],_0x567221['queue'],_0x567221['position']));queues[_0x567221[_0x7244('0x4')]]=_[_0x7244('0x10')](_0x567221,{'originalposition':_0x567221[_0x7244('0x11')],'queuecallerjoinAt':utils[_0x7244('0x12')](),'mohtime':0x0});}catch(_0x4ef98d){utils['error'](util[_0x7244('0xe')]('[%s][queues][queuecallerjoin]',_0x567221['uniqueid']),_0x4ef98d);}};exports[_0x7244('0x13')]=function(_0x1105b2){try{if(!_['isNil'](queues[_0x1105b2[_0x7244('0x4')]])){utils[_0x7244('0xd')](util['format'](_0x7244('0x14'),_0x1105b2[_0x7244('0x4')]),_0x1105b2);if(queues[_0x1105b2[_0x7244('0x4')]][_0x7244('0x15')]){if(!queues[_0x1105b2['uniqueid']][_0x7244('0x16')]&&!queues[_0x1105b2[_0x7244('0x4')]]['queuecallerexit']){queues[_0x1105b2[_0x7244('0x4')]][_0x7244('0x17')]=!![];queues[_0x1105b2['uniqueid']]['queuecallercompleteAt']=utils[_0x7244('0x12')]();queues[_0x1105b2[_0x7244('0x4')]][_0x7244('0x7')]=_0x7244('0x18');}utils['info'](util[_0x7244('0xe')](_0x7244('0x19'),_0x1105b2[_0x7244('0x4')],queues[_0x1105b2[_0x7244('0x4')]][_0x7244('0x1a')],queues[_0x1105b2[_0x7244('0x4')]][_0x7244('0x7')]));writeDB(queues[_0x1105b2[_0x7244('0x4')]]);}else if(queues[_0x1105b2[_0x7244('0x4')]][_0x7244('0xb')]){utils[_0x7244('0x2')](util['format'](_0x7244('0x1b'),_0x1105b2[_0x7244('0x4')],queues[_0x1105b2[_0x7244('0x4')]][_0x7244('0x1a')],queues[_0x1105b2[_0x7244('0x4')]][_0x7244('0xb')]));queues[queues[_0x1105b2['uniqueid']][_0x7244('0xb')]]=queues[_0x1105b2['uniqueid']];queues[queues[_0x1105b2['uniqueid']][_0x7244('0xb')]][_0x7244('0x1c')]=0x2;delete queues[_0x1105b2[_0x7244('0x4')]];}}}catch(_0x1ab8f1){utils[_0x7244('0x1d')](util[_0x7244('0xe')](_0x7244('0x14'),_0x1105b2['uniqueid']),_0x1ab8f1);}};exports['varset']=function(_0x1d5ed4){try{utils[_0x7244('0xd')](util['format']('[%s][queues][varset]',_0x1d5ed4[_0x7244('0x4')]),_0x1d5ed4);if(!_[_0x7244('0x1e')](_0x1d5ed4[_0x7244('0x1f')][_0x7244('0x20')])&&_0x1d5ed4[_0x7244('0x21')]['toUpperCase']()!=='CONTINUE'){if(!_['isNil'](queues[_0x1d5ed4[_0x7244('0x4')]])){queues[_0x1d5ed4[_0x7244('0x4')]][_0x7244('0x16')]=![];queues[_0x1d5ed4['uniqueid']][_0x7244('0x22')]=null;queues[_0x1d5ed4[_0x7244('0x4')]][_0x7244('0x23')]=!![];queues[_0x1d5ed4[_0x7244('0x4')]][_0x7244('0x24')]=utils['now']();queues[_0x1d5ed4['uniqueid']][_0x7244('0x7')]=_0x1d5ed4[_0x7244('0x21')][_0x7244('0x25')]();utils[_0x7244('0x2')](util['format'](_0x7244('0x26'),_0x1d5ed4[_0x7244('0x4')],queues[_0x1d5ed4[_0x7244('0x4')]][_0x7244('0x1a')],_0x1d5ed4['value'],queues[_0x1d5ed4[_0x7244('0x4')]][_0x7244('0x7')]));writeDB(queues[_0x1d5ed4['uniqueid']]);}}else if(!_[_0x7244('0x1e')](_0x1d5ed4['variable'][_0x7244('0x27')])){if(!_[_0x7244('0x1e')](queues[_0x1d5ed4[_0x7244('0x4')]])&&!queues[_0x1d5ed4[_0x7244('0x4')]][_0x7244('0x16')]){queues[_0x1d5ed4[_0x7244('0x4')]]['queuecallerabandon']=![];queues[_0x1d5ed4[_0x7244('0x4')]][_0x7244('0x22')]=null;queues[_0x1d5ed4['uniqueid']][_0x7244('0x23')]=!![];queues[_0x1d5ed4[_0x7244('0x4')]]['queuecallerexitAt']=utils[_0x7244('0x12')]();queues[_0x1d5ed4['uniqueid']][_0x7244('0x7')]=_0x7244('0x28');utils[_0x7244('0x2')](util[_0x7244('0xe')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x1d5ed4[_0x7244('0x4')],queues[_0x1d5ed4[_0x7244('0x4')]][_0x7244('0x1a')],_0x1d5ed4[_0x7244('0x21')],queues[_0x1d5ed4[_0x7244('0x4')]][_0x7244('0x7')]));}}}catch(_0x30a9fd){utils[_0x7244('0x1d')](util['format']('[%s][queues][varset]',_0x1d5ed4[_0x7244('0x4')]),_0x30a9fd);}};exports['queuecallerabandon']=function(_0x4f7456){try{if(!_['isNil'](queues[_0x4f7456['uniqueid']])){utils[_0x7244('0xd')](util[_0x7244('0xe')]('[%s][queues][queuecallerabandon]',_0x4f7456[_0x7244('0x4')]),_0x4f7456);queues[_0x4f7456['uniqueid']]['queuecallerexit']=![];queues[_0x4f7456['uniqueid']][_0x7244('0x24')]=null;queues[_0x4f7456[_0x7244('0x4')]][_0x7244('0x16')]=!![];queues[_0x4f7456[_0x7244('0x4')]][_0x7244('0x22')]=utils[_0x7244('0x12')]();queues[_0x4f7456[_0x7244('0x4')]][_0x7244('0x7')]='ABANDONED';utils['info'](util[_0x7244('0xe')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x4f7456[_0x7244('0x4')],queues[_0x4f7456['uniqueid']][_0x7244('0x1a')],queues[_0x4f7456[_0x7244('0x4')]]['queuecallerexitreason']));}}catch(_0x1b86f6){utils['error'](util['format'](_0x7244('0x29'),_0x4f7456[_0x7244('0x4')]),_0x1b86f6);}};exports['queuecallerleave']=function(_0x5b1de2){try{if(!_[_0x7244('0x1e')](queues[_0x5b1de2[_0x7244('0x4')]])){utils[_0x7244('0xd')](util['format'](_0x7244('0x2a'),_0x5b1de2[_0x7244('0x4')]),_0x5b1de2);utils['info'](util[_0x7244('0xe')](_0x7244('0x2b'),_0x5b1de2[_0x7244('0x4')],queues[_0x5b1de2['uniqueid']][_0x7244('0x1a')],_0x5b1de2[_0x7244('0x2c')],_0x5b1de2[_0x7244('0x2d')]));queues[_0x5b1de2['uniqueid']]['queuecallerleave']=!![];queues[_0x5b1de2[_0x7244('0x4')]][_0x7244('0x15')]=utils[_0x7244('0x12')]();queues[_0x5b1de2['uniqueid']][_0x7244('0x2e')]=utils[_0x7244('0x2f')](queues[_0x5b1de2['uniqueid']][_0x7244('0x15')],queues[_0x5b1de2['uniqueid']][_0x7244('0x30')]);queues[_0x5b1de2[_0x7244('0x4')]][_0x7244('0x11')]=_0x5b1de2[_0x7244('0x11')];queues[_0x5b1de2[_0x7244('0x4')]][_0x7244('0x31')]=_0x5b1de2[_0x7244('0x31')];queues[_0x5b1de2['uniqueid']]['connectedlinenum']=_0x5b1de2[_0x7244('0x2c')];queues[_0x5b1de2[_0x7244('0x4')]][_0x7244('0x2d')]=_0x5b1de2['connectedlinename'];}}catch(_0x1c2bc3){utils[_0x7244('0x1d')](util[_0x7244('0xe')](_0x7244('0x2a'),_0x5b1de2[_0x7244('0x4')]),_0x1c2bc3);}};exports['agentconnect']=function(_0x1a8fff){try{if(!_[_0x7244('0x1e')](queues[_0x1a8fff[_0x7244('0x4')]])){utils[_0x7244('0xd')](util['format'](_0x7244('0x32'),_0x1a8fff[_0x7244('0x4')]),_0x1a8fff);utils[_0x7244('0x2')](util[_0x7244('0xe')](_0x7244('0x33'),_0x1a8fff[_0x7244('0x4')],queues[_0x1a8fff['uniqueid']][_0x7244('0x1a')],_0x1a8fff[_0x7244('0x34')],_0x1a8fff['destaccountcode']));queues[_0x1a8fff['uniqueid']][_0x7244('0x16')]=![];queues[_0x1a8fff[_0x7244('0x4')]][_0x7244('0x16')]=![];queues[_0x1a8fff[_0x7244('0x4')]][_0x7244('0x22')]=null;queues[_0x1a8fff[_0x7244('0x4')]][_0x7244('0x23')]=![];queues[_0x1a8fff['uniqueid']]['queuecallerexitreason']=null;queues[_0x1a8fff[_0x7244('0x4')]][_0x7244('0x24')]=null;queues[_0x1a8fff['uniqueid']][_0x7244('0x35')]=!![];queues[_0x1a8fff[_0x7244('0x4')]]['accountcode']=_0x1a8fff[_0x7244('0x36')];queues[_0x1a8fff['uniqueid']][_0x7244('0x6')]=_0x1a8fff[_0x7244('0x34')];}}catch(_0x3a811f){utils['error'](util[_0x7244('0xe')](_0x7244('0x32'),_0x1a8fff[_0x7244('0x4')]),_0x3a811f);}};exports[_0x7244('0x37')]=function(_0x5b13cb){try{if(!_[_0x7244('0x1e')](queues[_0x5b13cb[_0x7244('0x4')]])){if(queues[_0x5b13cb[_0x7244('0x4')]][_0x7244('0x15')]){utils[_0x7244('0xd')](util[_0x7244('0xe')](_0x7244('0x38'),_0x5b13cb[_0x7244('0x4')]),_0x5b13cb);queues[_0x5b13cb[_0x7244('0x4')]][_0x7244('0x16')]=![];queues[_0x5b13cb[_0x7244('0x4')]][_0x7244('0x16')]=![];queues[_0x5b13cb[_0x7244('0x4')]][_0x7244('0x22')]=null;queues[_0x5b13cb[_0x7244('0x4')]][_0x7244('0x23')]=![];queues[_0x5b13cb[_0x7244('0x4')]][_0x7244('0x24')]=null;queues[_0x5b13cb[_0x7244('0x4')]][_0x7244('0x35')]=!![];queues[_0x5b13cb[_0x7244('0x4')]]['lastAssignedTo']=_0x5b13cb['membername'];queues[_0x5b13cb['uniqueid']][_0x7244('0x17')]=!![];queues[_0x5b13cb[_0x7244('0x4')]][_0x7244('0x39')]=utils[_0x7244('0x12')]();if(_0x5b13cb[_0x7244('0x3a')]=='transfer'){if(!queues[_0x5b13cb['uniqueid']][_0x7244('0x3b')]){queues[_0x5b13cb[_0x7244('0x4')]][_0x7244('0x7')]='TRANSFER';}}else{queues[_0x5b13cb[_0x7244('0x4')]]['queuecallerexitreason']=_0x7244('0x3c')+_0x5b13cb['reason'][_0x7244('0x25')]();}utils['info'](util[_0x7244('0xe')](_0x7244('0x3d'),_0x5b13cb[_0x7244('0x4')],queues[_0x5b13cb[_0x7244('0x4')]]['name'],_0x5b13cb[_0x7244('0x34')],queues[_0x5b13cb['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x5b13cb[_0x7244('0x4')]]);}}}catch(_0x529b98){utils['error'](util[_0x7244('0xe')](_0x7244('0x38'),_0x5b13cb[_0x7244('0x4')]),_0x529b98);}};exports[_0x7244('0x3e')]=function(_0x4635b0){try{if(!_[_0x7244('0x1e')](queues[_0x4635b0[_0x7244('0x3f')]])){utils[_0x7244('0xd')](util['format'](_0x7244('0x40'),_0x4635b0[_0x7244('0x4')]),_0x4635b0);queues[_0x4635b0['transfereeuniqueid']][_0x7244('0x3b')]=!![];queues[_0x4635b0[_0x7244('0x3f')]]['transfertype']='BLIND';queues[_0x4635b0[_0x7244('0x3f')]][_0x7244('0x41')]=_0x4635b0[_0x7244('0x42')];queues[_0x4635b0[_0x7244('0x3f')]][_0x7244('0x43')]=_0x4635b0[_0x7244('0x3f')];queues[_0x4635b0['transfereeuniqueid']][_0x7244('0x7')]=_0x7244('0x44');utils[_0x7244('0x2')](util[_0x7244('0xe')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x4635b0[_0x7244('0x4')],queues[_0x4635b0[_0x7244('0x3f')]][_0x7244('0x1a')],_0x4635b0[_0x7244('0x3f')],_0x4635b0[_0x7244('0x42')]));}}catch(_0x16b414){utils['error'](util['format'](_0x7244('0x40'),_0x4635b0['uniqueid']),_0x16b414);}};exports['attendedtransfer']=function(_0x147f70){try{utils[_0x7244('0xd')](util[_0x7244('0xe')](_0x7244('0x45'),_0x147f70[_0x7244('0x46')]),_0x147f70);if(_0x147f70[_0x7244('0x46')]==_0x147f70['origtransfererlinkedid']){if(!_[_0x7244('0x1e')](queues[_0x147f70['secondtransfererlinkedid']])){utils[_0x7244('0x2')](util['format'](_0x7244('0x47'),_0x147f70[_0x7244('0x46')],queues[_0x147f70[_0x7244('0x48')]][_0x7244('0x1a')],_0x147f70['origtransfererexten']));queues[_0x147f70[_0x7244('0x48')]][_0x7244('0x3b')]=!![];queues[_0x147f70[_0x7244('0x48')]]['transfertype']=_0x7244('0x49');queues[_0x147f70['secondtransfererlinkedid']][_0x7244('0x41')]=_0x147f70[_0x7244('0x4a')];queues[_0x147f70[_0x7244('0x48')]][_0x7244('0x43')]=_0x147f70[_0x7244('0x46')];queues[_0x147f70['secondtransfererlinkedid']]['queuecallerexitreason']=_0x7244('0x4b');}if(!_[_0x7244('0x1e')](queues[_0x147f70[_0x7244('0x4c')]])){if(_0x147f70[_0x7244('0x4d')]&&queues[_0x147f70[_0x7244('0x4d')]]){queues[_0x147f70[_0x7244('0x4d')]][_0x7244('0x1c')]=0x1;queues[_0x147f70[_0x7244('0x3f')]]=_[_0x7244('0x4e')](queues[_0x147f70[_0x7244('0x4d')]]);queues[_0x147f70['transfereeuniqueid']][_0x7244('0xb')]=_0x147f70[_0x7244('0x4f')];queues[_0x147f70[_0x7244('0x3f')]]['queuecallerenterreason']=0x2;queues[_0x147f70[_0x7244('0x3f')]][_0x7244('0x50')]=queues[_0x147f70['secondtransfererlinkedid']][_0x7244('0x50')];queues[_0x147f70[_0x7244('0x3f')]][_0x7244('0x51')]=queues[_0x147f70[_0x7244('0x48')]][_0x7244('0x51')];queues[_0x147f70['transfereeuniqueid']][_0x7244('0x30')]=utils[_0x7244('0x12')]();queues[_0x147f70[_0x7244('0x3f')]][_0x7244('0x15')]=utils[_0x7244('0x12')]();queues[_0x147f70[_0x7244('0x3f')]][_0x7244('0x2e')]=0x0;queues[_0x147f70[_0x7244('0x3f')]][_0x7244('0x52')]=0x0;utils['info'](util[_0x7244('0xe')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x147f70[_0x7244('0x46')],queues[_0x147f70['transfereeuniqueid']][_0x7244('0x1a')],queues[_0x147f70[_0x7244('0x3f')]]['calleridnum'],queues[_0x147f70[_0x7244('0x3f')]][_0x7244('0x51')]));}else{utils[_0x7244('0x2')](util[_0x7244('0xe')](_0x7244('0x53'),_0x147f70[_0x7244('0x46')],queues[_0x147f70['origtransfererlinkedid']][_0x7244('0x1a')],_0x147f70[_0x7244('0x48')]));queues[_0x147f70[_0x7244('0x4c')]][_0x7244('0xb')]=_0x147f70[_0x7244('0x48')];}}}else if(_0x147f70[_0x7244('0x54')]==_0x147f70[_0x7244('0x48')]){if(!_[_0x7244('0x1e')](queues[_0x147f70[_0x7244('0x4c')]])){utils[_0x7244('0x2')](util['format'](_0x7244('0x55'),_0x147f70[_0x7244('0x46')],queues[_0x147f70['origtransfererlinkedid']]['name'],_0x147f70['secondtransfereruniqueid'],_0x147f70[_0x7244('0x56')]));queues[_0x147f70[_0x7244('0x4c')]][_0x7244('0x3b')]=!![];queues[_0x147f70[_0x7244('0x4c')]][_0x7244('0x57')]='ATTENDED';queues[_0x147f70[_0x7244('0x4c')]][_0x7244('0x41')]=_0x147f70[_0x7244('0x56')];queues[_0x147f70[_0x7244('0x4c')]][_0x7244('0x43')]=_0x147f70['secondtransfereruniqueid'];queues[_0x147f70['origtransfererlinkedid']]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0x7244('0x1e')](queues[_0x147f70['secondtransfererlinkedid']])){if(_0x147f70[_0x7244('0x58')]&&queues[_0x147f70[_0x7244('0x58')]]){queues[_0x147f70[_0x7244('0x58')]][_0x7244('0x1c')]=0x1;queues[_0x147f70['transfertargetuniqueid']]=_[_0x7244('0x4e')](queues[_0x147f70[_0x7244('0x58')]]);queues[_0x147f70[_0x7244('0x4f')]][_0x7244('0xb')]=_0x147f70[_0x7244('0x4f')];queues[_0x147f70[_0x7244('0x4f')]][_0x7244('0x1c')]=0x2;queues[_0x147f70[_0x7244('0x4f')]][_0x7244('0x50')]=queues[_0x147f70['origtransfererlinkedid']][_0x7244('0x50')];queues[_0x147f70[_0x7244('0x4f')]][_0x7244('0x51')]=queues[_0x147f70[_0x7244('0x4c')]][_0x7244('0x51')];queues[_0x147f70[_0x7244('0x4f')]]['queuecallerjoinAt']=utils[_0x7244('0x12')]();queues[_0x147f70[_0x7244('0x4f')]][_0x7244('0x15')]=utils[_0x7244('0x12')]();queues[_0x147f70['transfertargetuniqueid']][_0x7244('0x2e')]=0x0;queues[_0x147f70[_0x7244('0x4f')]]['mohtime']=0x0;utils[_0x7244('0x2')](util[_0x7244('0xe')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x147f70[_0x7244('0x46')],queues[_0x147f70[_0x7244('0x4f')]][_0x7244('0x1a')],queues[_0x147f70[_0x7244('0x4f')]]['transfereduniqueid'],queues[_0x147f70[_0x7244('0x4f')]][_0x7244('0x50')],queues[_0x147f70[_0x7244('0x4f')]][_0x7244('0x51')]));}else{utils[_0x7244('0x2')](util[_0x7244('0xe')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x147f70['origtransfereruniqueid'],queues[_0x147f70[_0x7244('0x48')]][_0x7244('0x1a')],_0x147f70[_0x7244('0x4c')]));queues[_0x147f70[_0x7244('0x48')]][_0x7244('0xb')]=_0x147f70['origtransfererlinkedid'];}}}}catch(_0x5b795d){utils[_0x7244('0x1d')](util[_0x7244('0xe')](_0x7244('0x45'),_0x147f70[_0x7244('0x46')]),_0x5b795d);}};exports['musiconholdstart']=function(_0x4ee800){try{if(!_[_0x7244('0x1e')](queues[_0x4ee800[_0x7244('0x4')]])){utils[_0x7244('0xd')](util[_0x7244('0xe')]('[%s][queues][musiconholdstart]',_0x4ee800[_0x7244('0x4')]),_0x4ee800);queues[_0x4ee800[_0x7244('0x4')]][_0x7244('0x59')]=utils[_0x7244('0x12')]();utils[_0x7244('0x2')](util[_0x7244('0xe')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x4ee800[_0x7244('0x4')],queues[_0x4ee800['uniqueid']][_0x7244('0x1a')],queues[_0x4ee800['uniqueid']]['musiconholdstartAt']));}}catch(_0x2a16a9){utils[_0x7244('0x1d')](util[_0x7244('0xe')]('[%s][queues][musiconholdstart]',_0x4ee800[_0x7244('0x4')]),_0x2a16a9);}};exports[_0x7244('0x5a')]=function(_0x5a6125){try{if(!_['isNil'](queues[_0x5a6125['uniqueid']])){if(!_[_0x7244('0x1e')](queues[_0x5a6125['uniqueid']][_0x7244('0x59')])){utils[_0x7244('0xd')](util[_0x7244('0xe')](_0x7244('0x5b'),_0x5a6125[_0x7244('0x4')]),_0x5a6125);queues[_0x5a6125[_0x7244('0x4')]][_0x7244('0x52')]+=utils['diffTime'](utils[_0x7244('0x12')](),queues[_0x5a6125['uniqueid']][_0x7244('0x59')]);utils[_0x7244('0x2')](util[_0x7244('0xe')](_0x7244('0x5c'),_0x5a6125[_0x7244('0x4')],queues[_0x5a6125['uniqueid']][_0x7244('0x1a')],queues[_0x5a6125[_0x7244('0x4')]]['mohtime']));delete queues[_0x5a6125[_0x7244('0x4')]]['musiconholdstartAt'];}}}catch(_0x251550){utils['error'](util[_0x7244('0xe')](_0x7244('0x5b'),_0x5a6125[_0x7244('0x4')]),_0x251550);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 58ba667..be1768c 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 _0x1b2a=['transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','endsWith','value','.wav49','replace','find','monitors','push','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','clone','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','split','substring','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','format','uniqueid','getUserByInternal','accountcode','membername','name','UserId','request','CreateVoiceRecording','blinds','debug','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'];(function(_0x420282,_0x1f941f){var _0x535480=function(_0x18cddc){while(--_0x18cddc){_0x420282['push'](_0x420282['shift']());}};_0x535480(++_0x1f941f);}(_0x1b2a,0x73));var _0xa1b2=function(_0x37ed4c,_0x241243){_0x37ed4c=_0x37ed4c-0x0;var _0x36e165=_0x1b2a[_0x37ed4c];return _0x36e165;};'use strict';var _=require(_0xa1b2('0x0'));var util=require(_0xa1b2('0x1'));var utils=require(_0xa1b2('0x2'));var transfers=require(_0xa1b2('0x3'));var recordings={};function writeDB(_0x4a14e5){var _0x21bf16;utils[_0xa1b2('0x4')](util[_0xa1b2('0x5')]('[%s][recordings][writeDB]',_0x4a14e5[_0xa1b2('0x6')]));if(transfers['blinds'][_0x4a14e5[_0xa1b2('0x6')]]){_0x21bf16=_0x4a14e5[_0xa1b2('0x6')];_0x4a14e5[_0xa1b2('0x6')]=transfers['blinds'][_0x4a14e5[_0xa1b2('0x6')]]['transfereeuniqueid'];}if(_0x4a14e5['accountcode']){utils[_0xa1b2('0x7')](_0x4a14e5[_0xa1b2('0x8')])['then'](function(_0x446704){if(_0x446704){_0x4a14e5[_0xa1b2('0x9')]=_0x446704[_0xa1b2('0xa')];_0x4a14e5[_0xa1b2('0xb')]=_0x446704['id'];}utils[_0xa1b2('0xc')](_0xa1b2('0xd'),_0x4a14e5);});}else{utils['request'](_0xa1b2('0xd'),_0x4a14e5);}if(_0x21bf16)delete transfers[_0xa1b2('0xe')][_0x21bf16];}exports['newchannel']=function(_0x40983d){try{utils[_0xa1b2('0xf')](util[_0xa1b2('0x5')]('[%s][recordings][newchannel]',_0x40983d['uniqueid']),_0x40983d);if(_0x40983d[_0xa1b2('0x6')]==_0x40983d[_0xa1b2('0x10')]){utils[_0xa1b2('0x4')](util[_0xa1b2('0x5')](_0xa1b2('0x11'),_0x40983d['uniqueid'],_0x40983d['context'],_0x40983d[_0xa1b2('0x12')]));recordings[_0x40983d[_0xa1b2('0x6')]]={'uniqueid':_0x40983d[_0xa1b2('0x6')],'accountcode':_0x40983d['accountcode'],'exten':_0x40983d[_0xa1b2('0x12')],'context':_0x40983d[_0xa1b2('0x13')],'channel':_0x40983d[_0xa1b2('0x14')],'monitors':[]};}}catch(_0x311aba){utils[_0xa1b2('0x15')](util[_0xa1b2('0x5')]('[%s][recordings][newchannel]',_0x40983d[_0xa1b2('0x6')]),_0x311aba);}};exports[_0xa1b2('0x16')]=function(_0x3d3501){try{utils['debug'](util['format'](_0xa1b2('0x17'),_0x3d3501[_0xa1b2('0x6')]),_0x3d3501);if(!_[_0xa1b2('0x18')](recordings[_0x3d3501[_0xa1b2('0x6')]])&&_0x3d3501[_0xa1b2('0x19')]==0x6){utils[_0xa1b2('0x4')](util[_0xa1b2('0x5')](_0xa1b2('0x1a'),_0x3d3501[_0xa1b2('0x6')],_0x3d3501[_0xa1b2('0x13')],_0x3d3501['channel']));}else if(!_[_0xa1b2('0x18')](recordings[_0x3d3501['linkedid']])&&_0x3d3501[_0xa1b2('0x19')]==0x6&&_0x3d3501[_0xa1b2('0x13')]!=_0xa1b2('0x1b')){utils[_0xa1b2('0x4')](util[_0xa1b2('0x5')](_0xa1b2('0x1c'),_0x3d3501['uniqueid'],_0x3d3501[_0xa1b2('0x10')],_0x3d3501[_0xa1b2('0x13')],_0x3d3501[_0xa1b2('0x14')]));recordings[_0x3d3501[_0xa1b2('0x10')]][_0xa1b2('0x8')]=_0x3d3501[_0xa1b2('0x8')];}}catch(_0x25e9b9){utils[_0xa1b2('0x15')](util[_0xa1b2('0x5')](_0xa1b2('0x17'),_0x3d3501['uniqueid']),_0x25e9b9);}};exports[_0xa1b2('0x1d')]=function(_0x5f38ec){try{if(!_[_0xa1b2('0x18')](_0x5f38ec[_0xa1b2('0x1e')])&&!_['isNil'](_0x5f38ec['variable'][_0xa1b2('0x1f')])){utils[_0xa1b2('0xf')](util['format'](_0xa1b2('0x20'),_0x5f38ec[_0xa1b2('0x6')]),_0x5f38ec);utils[_0xa1b2('0x4')](util[_0xa1b2('0x5')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x5f38ec['uniqueid'],_0x5f38ec[_0xa1b2('0x1e')],_0x5f38ec['value']));if(_[_0xa1b2('0x21')](_0x5f38ec[_0xa1b2('0x22')],_0xa1b2('0x23'))){_0x5f38ec['value']=_0x5f38ec[_0xa1b2('0x22')][_0xa1b2('0x24')](_0xa1b2('0x23'),'.WAV');}if(recordings[_0x5f38ec[_0xa1b2('0x10')]]){var _0x1fce0e=_[_0xa1b2('0x25')](recordings[_0x5f38ec[_0xa1b2('0x10')]][_0xa1b2('0x26')],{'value':_0x5f38ec[_0xa1b2('0x22')]});if(_[_0xa1b2('0x18')](_0x1fce0e)){recordings[_0x5f38ec[_0xa1b2('0x10')]][_0xa1b2('0x26')][_0xa1b2('0x27')]({'value':_0x5f38ec[_0xa1b2('0x22')]});}}}}catch(_0x16c1fd){utils['error'](util['format'](_0xa1b2('0x20'),_0x5f38ec['uniqueid']),_0x16c1fd);}};exports[_0xa1b2('0x28')]=function(_0x21623a){try{if(!_[_0xa1b2('0x18')](recordings[_0x21623a['uniqueid']])){utils['debug'](util['format']('[%s][recordings][hangup]',_0x21623a[_0xa1b2('0x6')]),_0x21623a);utils['info'](util['format'](_0xa1b2('0x29'),_0x21623a[_0xa1b2('0x6')],_0x21623a[_0xa1b2('0x2a')],_0x21623a['calleridname'],_0x21623a[_0xa1b2('0x2b')]));recordings[_0x21623a[_0xa1b2('0x6')]]['calleridnum']=_0x21623a[_0xa1b2('0x2a')];recordings[_0x21623a[_0xa1b2('0x6')]][_0xa1b2('0x2c')]=_0x21623a['calleridname'];recordings[_0x21623a[_0xa1b2('0x6')]]['connectedlinenum']=_0x21623a[_0xa1b2('0x2d')];recordings[_0x21623a[_0xa1b2('0x6')]]['connectedlinename']=_0x21623a[_0xa1b2('0x2e')];if(recordings[_0x21623a[_0xa1b2('0x6')]][_0xa1b2('0x2f')]==_0xa1b2('0x30')&&recordings[_0x21623a[_0xa1b2('0x6')]][_0xa1b2('0x8')]){recordings[_0x21623a[_0xa1b2('0x6')]][_0xa1b2('0x2d')]=recordings[_0x21623a['uniqueid']][_0xa1b2('0x8')];recordings[_0x21623a['uniqueid']]['connectedlinename']='';}recordings[_0x21623a[_0xa1b2('0x6')]][_0xa1b2('0x26')][_0xa1b2('0x31')](function(_0x1fd054){var _0x1c2b0c=_[_0xa1b2('0x32')](recordings[_0x21623a['uniqueid']]);_0x1c2b0c[_0xa1b2('0x22')]=_0x1fd054[_0xa1b2('0x22')];writeDB(_0x1c2b0c);});delete recordings[_0x21623a['uniqueid']];}}catch(_0x2579fe){utils[_0xa1b2('0x15')](util[_0xa1b2('0x5')](_0xa1b2('0x33'),_0x21623a[_0xa1b2('0x6')]),_0x2579fe);}};exports[_0xa1b2('0x34')]=function(_0x2fe7a8){try{if(!_[_0xa1b2('0x18')](recordings[_0x2fe7a8[_0xa1b2('0x6')]])){utils[_0xa1b2('0xf')](util['format'](_0xa1b2('0x35'),_0x2fe7a8[_0xa1b2('0x6')]),_0x2fe7a8);utils['info'](util[_0xa1b2('0x5')](_0xa1b2('0x36'),_0x2fe7a8[_0xa1b2('0x6')],_0x2fe7a8[_0xa1b2('0x37')],_0x2fe7a8[_0xa1b2('0x38')]));if(_0x2fe7a8[_0xa1b2('0x37')][_0xa1b2('0x39')]()==_0xa1b2('0x3a')&&_[_0xa1b2('0x3b')](_0x2fe7a8[_0xa1b2('0x38')]['toLowerCase'](),'cdr')){var _0xfd8e97=_0x2fe7a8[_0xa1b2('0x38')][_0xa1b2('0x3c')]('=');var _0x281d9e=_0xfd8e97[0x0][_0xa1b2('0x3d')](_0xfd8e97[0x0]['lastIndexOf']('(')+0x1,_0xfd8e97[0x0]['lastIndexOf'](')'));var _0x3a1d67=_0xfd8e97[0x1];recordings[_0x2fe7a8[_0xa1b2('0x6')]][_0x281d9e]=_0x3a1d67;}}}catch(_0x462482){utils['error'](util[_0xa1b2('0x5')](_0xa1b2('0x35'),_0x2fe7a8[_0xa1b2('0x6')]),_0x462482);}};exports[_0xa1b2('0x3e')]=function(_0x4ae065){try{if(!_[_0xa1b2('0x18')](recordings[_0x4ae065[_0xa1b2('0x6')]])){utils[_0xa1b2('0xf')](util['format'](_0xa1b2('0x3f'),_0x4ae065[_0xa1b2('0x6')]),_0x4ae065);utils[_0xa1b2('0x4')](util[_0xa1b2('0x5')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x4ae065['uniqueid'],_0x4ae065['queue']));recordings[_0x4ae065[_0xa1b2('0x6')]][_0xa1b2('0x40')]=_0x4ae065[_0xa1b2('0x40')];}}catch(_0x1d72bb){utils[_0xa1b2('0x15')](util[_0xa1b2('0x5')]('[%s][recordings][queuecallerjoin]',_0x4ae065[_0xa1b2('0x6')]),_0x1d72bb);}};exports['blindtransfer']=function(_0x1f12f1){try{utils[_0xa1b2('0xf')](util[_0xa1b2('0x5')](_0xa1b2('0x41'),_0x1f12f1[_0xa1b2('0x6')]),_0x1f12f1);utils[_0xa1b2('0x4')](util['format'](_0xa1b2('0x42'),_0x1f12f1[_0xa1b2('0x6')],_0x1f12f1[_0xa1b2('0x43')],_0x1f12f1['transferercalleridname'],_0x1f12f1[_0xa1b2('0x44')],_0x1f12f1['transfereecalleridname']));if(recordings[_0x1f12f1[_0xa1b2('0x45')]]&&transfers['blinds'][_0x1f12f1[_0xa1b2('0x45')]]){transfers[_0xa1b2('0xe')][_0x1f12f1[_0xa1b2('0x45')]][_0xa1b2('0x46')]=!![];}}catch(_0x55b6fb){utils[_0xa1b2('0x15')](util['format']('[%s][recordings][blindtransfer]',_0x1f12f1[_0xa1b2('0x6')]),_0x55b6fb);}}; \ No newline at end of file +var _0x5726=['appdata','toLowerCase','set','startsWith','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','transfereruniqueid','recording','util','./transfers.controller','info','[%s][recordings][writeDB]','blinds','uniqueid','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','format','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','newstate','debug','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','calleridname','connectedlinename','connectedlinenum','forEach','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x5726,0xeb));var _0x6572=function(_0x5f4f71,_0x192c6f){_0x5f4f71=_0x5f4f71-0x0;var _0x56a7a8=_0x5726[_0x5f4f71];return _0x56a7a8;};'use strict';var _=require('lodash');var util=require(_0x6572('0x0'));var utils=require('./utils');var transfers=require(_0x6572('0x1'));var recordings={};function writeDB(_0x448379){var _0x38db62;utils[_0x6572('0x2')](util['format'](_0x6572('0x3'),_0x448379['uniqueid']));if(transfers[_0x6572('0x4')][_0x448379[_0x6572('0x5')]]){_0x38db62=_0x448379[_0x6572('0x5')];_0x448379[_0x6572('0x5')]=transfers[_0x6572('0x4')][_0x448379[_0x6572('0x5')]][_0x6572('0x6')];}if(_0x448379[_0x6572('0x7')]){utils[_0x6572('0x8')](_0x448379[_0x6572('0x7')])[_0x6572('0x9')](function(_0x4ceed0){if(_0x4ceed0){_0x448379[_0x6572('0xa')]=_0x4ceed0[_0x6572('0xb')];_0x448379[_0x6572('0xc')]=_0x4ceed0['id'];}utils[_0x6572('0xd')](_0x6572('0xe'),_0x448379);});}else{utils[_0x6572('0xd')](_0x6572('0xe'),_0x448379);}if(_0x38db62)delete transfers[_0x6572('0x4')][_0x38db62];}exports[_0x6572('0xf')]=function(_0x11addf){try{utils['debug'](util[_0x6572('0x10')]('[%s][recordings][newchannel]',_0x11addf['uniqueid']),_0x11addf);if(_0x11addf['uniqueid']==_0x11addf[_0x6572('0x11')]){utils[_0x6572('0x2')](util[_0x6572('0x10')](_0x6572('0x12'),_0x11addf[_0x6572('0x5')],_0x11addf[_0x6572('0x13')],_0x11addf[_0x6572('0x14')]));recordings[_0x11addf[_0x6572('0x5')]]={'uniqueid':_0x11addf[_0x6572('0x5')],'accountcode':_0x11addf[_0x6572('0x7')],'exten':_0x11addf[_0x6572('0x14')],'context':_0x11addf[_0x6572('0x13')],'channel':_0x11addf[_0x6572('0x15')],'monitors':[]};}}catch(_0x873a7a){utils['error'](util['format']('[%s][recordings][newchannel]',_0x11addf[_0x6572('0x5')]),_0x873a7a);}};exports[_0x6572('0x16')]=function(_0x366c4b){try{utils[_0x6572('0x17')](util[_0x6572('0x10')](_0x6572('0x18'),_0x366c4b[_0x6572('0x5')]),_0x366c4b);if(!_[_0x6572('0x19')](recordings[_0x366c4b[_0x6572('0x5')]])&&_0x366c4b[_0x6572('0x1a')]==0x6){utils[_0x6572('0x2')](util[_0x6572('0x10')](_0x6572('0x1b'),_0x366c4b['uniqueid'],_0x366c4b[_0x6572('0x13')],_0x366c4b[_0x6572('0x15')]));}else if(!_[_0x6572('0x19')](recordings[_0x366c4b['linkedid']])&&_0x366c4b[_0x6572('0x1a')]==0x6&&_0x366c4b[_0x6572('0x13')]!=_0x6572('0x1c')){utils['info'](util[_0x6572('0x10')](_0x6572('0x1d'),_0x366c4b[_0x6572('0x5')],_0x366c4b[_0x6572('0x11')],_0x366c4b['context'],_0x366c4b[_0x6572('0x15')]));recordings[_0x366c4b[_0x6572('0x11')]][_0x6572('0x7')]=_0x366c4b[_0x6572('0x7')];}}catch(_0x30f5d8){utils[_0x6572('0x1e')](util[_0x6572('0x10')](_0x6572('0x18'),_0x366c4b[_0x6572('0x5')]),_0x30f5d8);}};exports['varset']=function(_0x522757){try{if(!_['isNil'](_0x522757[_0x6572('0x1f')])&&!_[_0x6572('0x19')](_0x522757[_0x6572('0x1f')][_0x6572('0x20')])){utils[_0x6572('0x17')](util['format']('[%s][recordings][varset]',_0x522757[_0x6572('0x5')]),_0x522757);utils[_0x6572('0x2')](util[_0x6572('0x10')](_0x6572('0x21'),_0x522757[_0x6572('0x5')],_0x522757[_0x6572('0x1f')],_0x522757[_0x6572('0x22')]));if(_['endsWith'](_0x522757[_0x6572('0x22')],_0x6572('0x23'))){_0x522757['value']=_0x522757[_0x6572('0x22')]['replace'](_0x6572('0x23'),_0x6572('0x24'));}if(recordings[_0x522757['linkedid']]){var _0x18d754=_[_0x6572('0x25')](recordings[_0x522757[_0x6572('0x11')]][_0x6572('0x26')],{'value':_0x522757[_0x6572('0x22')]});if(_['isNil'](_0x18d754)){recordings[_0x522757[_0x6572('0x11')]][_0x6572('0x26')][_0x6572('0x27')]({'value':_0x522757[_0x6572('0x22')]});}}}}catch(_0x5c56fa){utils[_0x6572('0x1e')](util[_0x6572('0x10')]('[%s][recordings][varset]',_0x522757[_0x6572('0x5')]),_0x5c56fa);}};exports[_0x6572('0x28')]=function(_0x311bcb){try{if(!_[_0x6572('0x19')](recordings[_0x311bcb['uniqueid']])){utils[_0x6572('0x17')](util[_0x6572('0x10')](_0x6572('0x29'),_0x311bcb['uniqueid']),_0x311bcb);utils[_0x6572('0x2')](util[_0x6572('0x10')](_0x6572('0x2a'),_0x311bcb['uniqueid'],_0x311bcb[_0x6572('0x2b')],_0x311bcb['calleridname'],_0x311bcb[_0x6572('0x2c')]));recordings[_0x311bcb[_0x6572('0x5')]][_0x6572('0x2b')]=_0x311bcb[_0x6572('0x2b')];recordings[_0x311bcb[_0x6572('0x5')]][_0x6572('0x2d')]=_0x311bcb['calleridname'];recordings[_0x311bcb['uniqueid']]['connectedlinenum']=_0x311bcb['connectedlinenum'];recordings[_0x311bcb[_0x6572('0x5')]][_0x6572('0x2e')]=_0x311bcb[_0x6572('0x2e')];if(recordings[_0x311bcb[_0x6572('0x5')]]['type']=='outbound'&&recordings[_0x311bcb[_0x6572('0x5')]][_0x6572('0x7')]){recordings[_0x311bcb[_0x6572('0x5')]][_0x6572('0x2f')]=recordings[_0x311bcb[_0x6572('0x5')]]['accountcode'];recordings[_0x311bcb[_0x6572('0x5')]][_0x6572('0x2e')]='';}recordings[_0x311bcb[_0x6572('0x5')]]['monitors'][_0x6572('0x30')](function(_0x3b86f0){var _0x4d65e0=_['clone'](recordings[_0x311bcb[_0x6572('0x5')]]);_0x4d65e0[_0x6572('0x22')]=_0x3b86f0[_0x6572('0x22')];writeDB(_0x4d65e0);});delete recordings[_0x311bcb['uniqueid']];}}catch(_0x1bd74a){utils[_0x6572('0x1e')](util[_0x6572('0x10')]('[%s][recordings][hangup]',_0x311bcb[_0x6572('0x5')]),_0x1bd74a);}};exports[_0x6572('0x31')]=function(_0x12dff6){try{if(!_[_0x6572('0x19')](recordings[_0x12dff6[_0x6572('0x5')]])){utils[_0x6572('0x17')](util[_0x6572('0x10')](_0x6572('0x32'),_0x12dff6[_0x6572('0x5')]),_0x12dff6);utils[_0x6572('0x2')](util[_0x6572('0x10')](_0x6572('0x33'),_0x12dff6['uniqueid'],_0x12dff6[_0x6572('0x34')],_0x12dff6[_0x6572('0x35')]));if(_0x12dff6[_0x6572('0x34')][_0x6572('0x36')]()==_0x6572('0x37')&&_[_0x6572('0x38')](_0x12dff6[_0x6572('0x35')]['toLowerCase'](),'cdr')){var _0x47fb28=_0x12dff6[_0x6572('0x35')][_0x6572('0x39')]('=');var _0x27f33b=_0x47fb28[0x0][_0x6572('0x3a')](_0x47fb28[0x0][_0x6572('0x3b')]('(')+0x1,_0x47fb28[0x0][_0x6572('0x3b')](')'));var _0x2bb994=_0x47fb28[0x1];recordings[_0x12dff6[_0x6572('0x5')]][_0x27f33b]=_0x2bb994;}}}catch(_0x1d48bd){utils[_0x6572('0x1e')](util[_0x6572('0x10')]('[%s][recordings][newexten]',_0x12dff6[_0x6572('0x5')]),_0x1d48bd);}};exports[_0x6572('0x3c')]=function(_0x437e70){try{if(!_[_0x6572('0x19')](recordings[_0x437e70[_0x6572('0x5')]])){utils[_0x6572('0x17')](util[_0x6572('0x10')](_0x6572('0x3d'),_0x437e70[_0x6572('0x5')]),_0x437e70);utils[_0x6572('0x2')](util[_0x6572('0x10')](_0x6572('0x3e'),_0x437e70[_0x6572('0x5')],_0x437e70[_0x6572('0x3f')]));recordings[_0x437e70[_0x6572('0x5')]][_0x6572('0x3f')]=_0x437e70[_0x6572('0x3f')];}}catch(_0x51bdc2){utils[_0x6572('0x1e')](util[_0x6572('0x10')](_0x6572('0x3d'),_0x437e70[_0x6572('0x5')]),_0x51bdc2);}};exports[_0x6572('0x40')]=function(_0x4f98af){try{utils[_0x6572('0x17')](util[_0x6572('0x10')](_0x6572('0x41'),_0x4f98af[_0x6572('0x5')]),_0x4f98af);utils[_0x6572('0x2')](util['format'](_0x6572('0x42'),_0x4f98af[_0x6572('0x5')],_0x4f98af[_0x6572('0x43')],_0x4f98af[_0x6572('0x44')],_0x4f98af['transfereecalleridnum'],_0x4f98af[_0x6572('0x45')]));if(recordings[_0x4f98af[_0x6572('0x46')]]&&transfers[_0x6572('0x4')][_0x4f98af[_0x6572('0x46')]]){transfers[_0x6572('0x4')][_0x4f98af[_0x6572('0x46')]][_0x6572('0x47')]=!![];}}catch(_0x27d01f){utils[_0x6572('0x1e')](util[_0x6572('0x10')](_0x6572('0x41'),_0x4f98af[_0x6572('0x5')]),_0x27d01f);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index a7dd7ed..b8d629f 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 _0xd031=['uniqueid','request','blinds','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','blind','transfereruniqueid','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','lodash','util','./utils','info','format','type','attended','origtransfereruniqueid'];(function(_0x459335,_0x2e95dd){var _0x50f00b=function(_0x5ccdaf){while(--_0x5ccdaf){_0x459335['push'](_0x459335['shift']());}};_0x50f00b(++_0x2e95dd);}(_0xd031,0x11e));var _0x1d03=function(_0x183f5e,_0x528441){_0x183f5e=_0x183f5e-0x0;var _0x1dc4b4=_0xd031[_0x183f5e];return _0x1dc4b4;};'use strict';var _=require(_0x1d03('0x0'));var util=require(_0x1d03('0x1'));var utils=require(_0x1d03('0x2'));function writeDB(_0x5e3067){utils[_0x1d03('0x3')](util[_0x1d03('0x4')]('[%s][transfers][writeDB]\x20type:%s',_0x5e3067[_0x1d03('0x5')]===_0x1d03('0x6')?_0x5e3067[_0x1d03('0x7')]:_0x5e3067[_0x1d03('0x8')],_0x5e3067[_0x1d03('0x5')]));utils[_0x1d03('0x9')]('CreateVoiceTransferReport',_0x5e3067);}exports[_0x1d03('0xa')]={};exports['blindtransfer']=function(_0x3f2307){try{utils[_0x1d03('0xb')](util[_0x1d03('0x4')](_0x1d03('0xc'),_0x3f2307[_0x1d03('0x8')]),_0x3f2307);utils[_0x1d03('0x3')](util[_0x1d03('0x4')](_0x1d03('0xd'),_0x3f2307[_0x1d03('0x8')],_0x3f2307['transferercalleridnum'],_0x3f2307[_0x1d03('0xe')],_0x3f2307[_0x1d03('0xf')],_0x3f2307['transfereecalleridname']));_0x3f2307[_0x1d03('0x5')]=_0x1d03('0x10');exports['blinds'][_0x3f2307[_0x1d03('0x11')]]=_0x3f2307;writeDB(_0x3f2307);}catch(_0x24379f){utils['error'](util['format'](_0x1d03('0xc'),_0x3f2307[_0x1d03('0x8')]),_0x24379f);}};exports[_0x1d03('0x12')]=function(_0x1a1a84){try{utils['debug'](util[_0x1d03('0x4')](_0x1d03('0x13'),_0x1a1a84[_0x1d03('0x7')]),_0x1a1a84);utils[_0x1d03('0x3')](util['format'](_0x1d03('0x14'),_0x1a1a84[_0x1d03('0x7')],_0x1a1a84[_0x1d03('0x15')],_0x1a1a84[_0x1d03('0x16')],_0x1a1a84[_0x1d03('0x17')],_0x1a1a84['transfertargetcalleridname']));_0x1a1a84=_[_0x1d03('0x18')](_0x1a1a84,{'transfererchannel':_0x1a1a84[_0x1d03('0x19')],'transferercalleridnum':_0x1a1a84['origtransferercalleridnum'],'transferercalleridname':_0x1a1a84[_0x1d03('0x16')],'transfererconnectedlinenum':_0x1a1a84[_0x1d03('0x1a')],'transfererconnectedlinename':_0x1a1a84[_0x1d03('0x1b')],'transfereraccountcode':_0x1a1a84[_0x1d03('0x1c')],'transferercontext':_0x1a1a84['secondtransferercontext'],'transfererexten':_0x1a1a84[_0x1d03('0x1d')],'transfererlinkedid':_0x1a1a84[_0x1d03('0x1e')],'context':_0x1a1a84[_0x1d03('0x1f')],'extension':_0x1a1a84[_0x1d03('0x20')],'type':_0x1d03('0x6')});if(_[_0x1d03('0x21')](_0x1a1a84[_0x1d03('0x22')])){_0x1a1a84=_[_0x1d03('0x18')](_0x1a1a84,{'transfereechannel':_0x1a1a84['transfertargetchannel'],'transfereecalleridnum':_0x1a1a84[_0x1d03('0x17')],'transfereecalleridname':_0x1a1a84[_0x1d03('0x23')],'transfereeconnectedlinenum':_0x1a1a84[_0x1d03('0x24')],'transfereeconnectedlinename':_0x1a1a84['transfertargetconnectedlinename'],'transfereeaccountcode':_0x1a1a84[_0x1d03('0x25')],'transfereecontext':_0x1a1a84[_0x1d03('0x26')],'transfereeexten':_0x1a1a84[_0x1d03('0x27')],'transfereelinkedid':_0x1a1a84[_0x1d03('0x28')]});}writeDB(_0x1a1a84);}catch(_0x77e92a){utils[_0x1d03('0x29')](util[_0x1d03('0x4')](_0x1d03('0x13'),_0x1a1a84[_0x1d03('0x7')]),_0x77e92a);}}; \ No newline at end of file +var _0xa2fe=['secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','assign','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','lodash','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','origtransfereruniqueid','uniqueid','type','request','CreateVoiceTransferReport','blinds','blindtransfer','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','transfereruniqueid','error','attendedtransfer','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','origtransfererchannel','secondtransfererconnectedlinenum','origtransfereraccountcode'];(function(_0x3b6160,_0x45d946){var _0x2dcbbe=function(_0x8e71d2){while(--_0x8e71d2){_0x3b6160['push'](_0x3b6160['shift']());}};_0x2dcbbe(++_0x45d946);}(_0xa2fe,0x124));var _0xea2f=function(_0x11167c,_0xb0ff07){_0x11167c=_0x11167c-0x0;var _0x34bdb0=_0xa2fe[_0x11167c];return _0x34bdb0;};'use strict';var _=require(_0xea2f('0x0'));var util=require('util');var utils=require(_0xea2f('0x1'));function writeDB(_0x323e44){utils[_0xea2f('0x2')](util[_0xea2f('0x3')](_0xea2f('0x4'),_0x323e44['type']==='attended'?_0x323e44[_0xea2f('0x5')]:_0x323e44[_0xea2f('0x6')],_0x323e44[_0xea2f('0x7')]));utils[_0xea2f('0x8')](_0xea2f('0x9'),_0x323e44);}exports[_0xea2f('0xa')]={};exports[_0xea2f('0xb')]=function(_0x16ddf7){try{utils['debug'](util['format'](_0xea2f('0xc'),_0x16ddf7['uniqueid']),_0x16ddf7);utils[_0xea2f('0x2')](util[_0xea2f('0x3')](_0xea2f('0xd'),_0x16ddf7['uniqueid'],_0x16ddf7[_0xea2f('0xe')],_0x16ddf7[_0xea2f('0xf')],_0x16ddf7[_0xea2f('0x10')],_0x16ddf7['transfereecalleridname']));_0x16ddf7[_0xea2f('0x7')]=_0xea2f('0x11');exports['blinds'][_0x16ddf7[_0xea2f('0x12')]]=_0x16ddf7;writeDB(_0x16ddf7);}catch(_0x4cf481){utils[_0xea2f('0x13')](util[_0xea2f('0x3')](_0xea2f('0xc'),_0x16ddf7['uniqueid']),_0x4cf481);}};exports[_0xea2f('0x14')]=function(_0xdea749){try{utils[_0xea2f('0x15')](util['format'](_0xea2f('0x16'),_0xdea749[_0xea2f('0x5')]),_0xdea749);utils[_0xea2f('0x2')](util[_0xea2f('0x3')](_0xea2f('0x17'),_0xdea749[_0xea2f('0x5')],_0xdea749[_0xea2f('0x18')],_0xdea749[_0xea2f('0x19')],_0xdea749[_0xea2f('0x1a')],_0xdea749['transfertargetcalleridname']));_0xdea749=_['assign'](_0xdea749,{'transfererchannel':_0xdea749[_0xea2f('0x1b')],'transferercalleridnum':_0xdea749[_0xea2f('0x18')],'transferercalleridname':_0xdea749[_0xea2f('0x19')],'transfererconnectedlinenum':_0xdea749[_0xea2f('0x1c')],'transfererconnectedlinename':_0xdea749['secondtransfererconnectedlinename'],'transfereraccountcode':_0xdea749[_0xea2f('0x1d')],'transferercontext':_0xdea749[_0xea2f('0x1e')],'transfererexten':_0xdea749[_0xea2f('0x1f')],'transfererlinkedid':_0xdea749[_0xea2f('0x20')],'context':_0xdea749[_0xea2f('0x21')],'extension':_0xdea749[_0xea2f('0x22')],'type':_0xea2f('0x23')});if(_[_0xea2f('0x24')](_0xdea749[_0xea2f('0x25')])){_0xdea749=_[_0xea2f('0x26')](_0xdea749,{'transfereechannel':_0xdea749[_0xea2f('0x27')],'transfereecalleridnum':_0xdea749['transfertargetcalleridnum'],'transfereecalleridname':_0xdea749[_0xea2f('0x28')],'transfereeconnectedlinenum':_0xdea749[_0xea2f('0x29')],'transfereeconnectedlinename':_0xdea749[_0xea2f('0x2a')],'transfereeaccountcode':_0xdea749[_0xea2f('0x2b')],'transfereecontext':_0xdea749[_0xea2f('0x2c')],'transfereeexten':_0xdea749[_0xea2f('0x2d')],'transfereelinkedid':_0xdea749['transfertargetlinkedid']});}writeDB(_0xdea749);}catch(_0x4772c4){utils[_0xea2f('0x13')](util['format']('[%s][transfers][attendedtransfer]',_0xdea749['origtransfereruniqueid']),_0x4772c4);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index b7c918e..0b2b986 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 _0xf6ff=['[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','name','type','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add','format','subtractTime','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','util','client','../../config/logger','info','debug','error','inspect','request','GetUser','interface','then','[utils][getUser]\x20where:%s','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName'];(function(_0x4141fb,_0x42f99c){var _0x5a6f9b=function(_0x548d74){while(--_0x548d74){_0x4141fb['push'](_0x4141fb['shift']());}};_0x5a6f9b(++_0x42f99c);}(_0xf6ff,0x11b));var _0xff6f=function(_0x20ab8e,_0xe8d4c3){_0x20ab8e=_0x20ab8e-0x0;var _0x6b289d=_0xf6ff[_0x20ab8e];return _0x6b289d;};'use strict';var BPromise=require(_0xff6f('0x0'));var jayson=require(_0xff6f('0x1'));var moment=require('moment');var util=require(_0xff6f('0x2'));var client=jayson[_0xff6f('0x3')]['http']({'port':0x2329});var logger=require(_0xff6f('0x4'))('xdr');exports[_0xff6f('0x5')]=function(_0x48936f,_0x43a1f1){logger['info'](_0x48936f,_0x43a1f1?util['inspect'](_0x43a1f1,{'showHidden':![],'depth':null}):'');};exports[_0xff6f('0x6')]=function(_0x8996ef,_0x6bb146){logger['debug'](_0x8996ef,_0x6bb146?util['inspect'](_0x6bb146,{'showHidden':![],'depth':null}):'');};exports[_0xff6f('0x7')]=function(_0x7cc40c,_0xc8136){logger['error'](_0x7cc40c,_0xc8136?util[_0xff6f('0x8')](_0xc8136,{'showHidden':![],'depth':null}):'');};exports[_0xff6f('0x9')]=function(_0x4b6c9d,_0x2a5e85){return client[_0xff6f('0x9')](_0x4b6c9d,{'body':_0x2a5e85})['then'](function(_0x15c27d){logger[_0xff6f('0x6')]('[utils][request]\x20name:%s',_0x4b6c9d,_0x15c27d?util[_0xff6f('0x8')](_0x15c27d,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x5347c1){logger['error']('[utils][request]\x20name:%s',_0x4b6c9d,_0x5347c1?util[_0xff6f('0x8')](_0x5347c1,{'showHidden':![],'depth':null}):'');});};function getUser(_0x5ed7a2){return client['request'](_0xff6f('0xa'),{'options':{'raw':!![],'attributes':['id','internal','name',_0xff6f('0xb')],'where':_0x5ed7a2,'limit':0x1}})[_0xff6f('0xc')](function(_0x46cb4b){logger[_0xff6f('0x6')](_0xff6f('0xd'),JSON['stringify'](_0x5ed7a2),_0x46cb4b?util['inspect'](_0x46cb4b,{'showHidden':![],'depth':null}):'');return _0x46cb4b[_0xff6f('0xe')][_0xff6f('0xf')]?_0x46cb4b[_0xff6f('0xe')][0x0]:null;});}exports[_0xff6f('0x10')]=function(_0x13768b){return new BPromise(function(_0x4672d4,_0x500646){if(_0x13768b){return getUser({'internal':_0x13768b})[_0xff6f('0xc')](function(_0x329035){logger[_0xff6f('0x5')](_0xff6f('0x11'),_0x13768b,_0x329035?_0xff6f('0x12'):_0xff6f('0x13'));return _0x4672d4(_0x329035);})[_0xff6f('0x14')](function(_0x39014f){logger[_0xff6f('0x7')](_0xff6f('0x15'),_0x39014f?util[_0xff6f('0x8')](_0x39014f,{'showHidden':![],'depth':null}):'');return _0x4672d4(null);});}return _0x4672d4(null);});};exports[_0xff6f('0x16')]=function(_0x16594f){return new BPromise(function(_0x17efb8,_0xfcfeb5){if(_0x16594f){return getUser({'interface':_0x16594f})[_0xff6f('0xc')](function(_0xd3dd9e){logger[_0xff6f('0x5')](_0xff6f('0x17'),_0x16594f,_0xd3dd9e?_0xff6f('0x12'):'notfound');return _0x17efb8(_0xd3dd9e);})[_0xff6f('0x14')](function(_0x28f03e){logger['error']('[utils][getUserByInterface]',_0x28f03e?util[_0xff6f('0x8')](_0x28f03e,{'showHidden':![],'depth':null}):'');return _0x17efb8(null);});}return _0x17efb8(null);});};exports[_0xff6f('0x18')]=function(_0x3f42f8){return new BPromise(function(_0x16d9ae,_0x61d42c){if(_0x3f42f8){return getUser({'name':_0x3f42f8})['then'](function(_0x3b3785){logger[_0xff6f('0x5')](_0xff6f('0x19'),_0x3f42f8,_0x3b3785?_0xff6f('0x12'):'notfound');return _0x16d9ae(_0x3b3785);})[_0xff6f('0x14')](function(_0x3328b9){logger['error'](_0xff6f('0x1a'),_0x3328b9?util['inspect'](_0x3328b9,{'showHidden':![],'depth':null}):'');return _0x16d9ae(null);});}return _0x16d9ae(null);});};exports[_0xff6f('0x1b')]=function(_0x1b11cd){return new BPromise(function(_0x1a4e26,_0x5d2400){if(_0x1b11cd){return client['request'](_0xff6f('0x1c'),{'options':{'raw':!![],'attributes':['id',_0xff6f('0x1d'),_0xff6f('0x1e'),'acw','acwTimeout'],'where':{'name':_0x1b11cd},'limit':0x1}})[_0xff6f('0xc')](function(_0xe3801a){logger[_0xff6f('0x6')]('[utils][getVoiceQueueByName]\x20name:%s',_0x1b11cd,_0xe3801a?util[_0xff6f('0x8')](_0xe3801a,{'showHidden':![],'depth':null}):'');logger[_0xff6f('0x5')](_0xff6f('0x1f'),_0x1b11cd,_0xe3801a?_0xff6f('0x12'):_0xff6f('0x13'));return _0x1a4e26(_0xe3801a['result'][_0xff6f('0xf')]?_0xe3801a['result'][0x0]:null);})['catch'](function(_0x6701ed){logger[_0xff6f('0x7')]('[utils][getVoiceQueueByName]',_0x6701ed?util[_0xff6f('0x8')](_0x6701ed,{'showHidden':![],'depth':null}):'');return _0x1a4e26(null);});}return _0x1a4e26(null);});};exports[_0xff6f('0x20')]=function(_0x50b22a,_0x17c130){return moment(_0x50b22a)[_0xff6f('0x21')](_0x17c130,'seconds')[_0xff6f('0x22')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xff6f('0x23')]=function(_0x526932,_0x58aa2f){return moment(_0x526932)[_0xff6f('0x24')](_0x58aa2f,_0xff6f('0x25'))[_0xff6f('0x22')](_0xff6f('0x26'));};exports['diffTime']=function(_0x39b4da,_0x21d48f){return moment(_0x39b4da)[_0xff6f('0x27')](moment(_0x21d48f),_0xff6f('0x25'));};exports[_0xff6f('0x28')]=function(_0x2caa1b,_0x50ac2e){return parseInt(_0x2caa1b,0xa)+parseInt(_0x50ac2e,0xa);};exports[_0xff6f('0x29')]=function(){return moment()[_0xff6f('0x22')](_0xff6f('0x26'));};exports[_0xff6f('0x2a')]=function(_0x2b5291,_0x48a740){if(_0x48a740){return moment(_0x2b5291)['isAfter'](_0x48a740);}return!![];};exports[_0xff6f('0x2b')]=function(_0x1fb818,_0x138afe){if(_0x138afe){return moment(_0x1fb818)[_0xff6f('0x2b')](_0x138afe);}else if(_0x1fb818){return!![];}return![];}; \ No newline at end of file +var _0xd61b=['client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','format','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','util'];(function(_0x12196e,_0x4b2d58){var _0x24d273=function(_0x1167d7){while(--_0x1167d7){_0x12196e['push'](_0x12196e['shift']());}};_0x24d273(++_0x4b2d58);}(_0xd61b,0xbd));var _0xbd61=function(_0x58eb93,_0x3b8263){_0x58eb93=_0x58eb93-0x0;var _0xc0d5c0=_0xd61b[_0x58eb93];return _0xc0d5c0;};'use strict';var BPromise=require(_0xbd61('0x0'));var jayson=require(_0xbd61('0x1'));var moment=require('moment');var util=require(_0xbd61('0x2'));var client=jayson[_0xbd61('0x3')][_0xbd61('0x4')]({'port':0x2329});var logger=require(_0xbd61('0x5'))(_0xbd61('0x6'));exports[_0xbd61('0x7')]=function(_0x416dfc,_0x23ab9c){logger[_0xbd61('0x7')](_0x416dfc,_0x23ab9c?util[_0xbd61('0x8')](_0x23ab9c,{'showHidden':![],'depth':null}):'');};exports[_0xbd61('0x9')]=function(_0x5a7154,_0x1f1118){logger[_0xbd61('0x9')](_0x5a7154,_0x1f1118?util['inspect'](_0x1f1118,{'showHidden':![],'depth':null}):'');};exports[_0xbd61('0xa')]=function(_0x59becb,_0x21b8a9){logger[_0xbd61('0xa')](_0x59becb,_0x21b8a9?util['inspect'](_0x21b8a9,{'showHidden':![],'depth':null}):'');};exports[_0xbd61('0xb')]=function(_0x3d2fde,_0x13d367){return client[_0xbd61('0xb')](_0x3d2fde,{'body':_0x13d367})[_0xbd61('0xc')](function(_0x155eea){logger[_0xbd61('0x9')](_0xbd61('0xd'),_0x3d2fde,_0x155eea?util[_0xbd61('0x8')](_0x155eea,{'showHidden':![],'depth':null}):'');})[_0xbd61('0xe')](function(_0x45749e){logger['error']('[utils][request]\x20name:%s',_0x3d2fde,_0x45749e?util['inspect'](_0x45749e,{'showHidden':![],'depth':null}):'');});};function getUser(_0x467927){return client[_0xbd61('0xb')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0xbd61('0xf'),_0xbd61('0x10'),_0xbd61('0x11')],'where':_0x467927,'limit':0x1}})['then'](function(_0x8808d3){logger[_0xbd61('0x9')](_0xbd61('0x12'),JSON[_0xbd61('0x13')](_0x467927),_0x8808d3?util[_0xbd61('0x8')](_0x8808d3,{'showHidden':![],'depth':null}):'');return _0x8808d3['result']['length']?_0x8808d3[_0xbd61('0x14')][0x0]:null;});}exports[_0xbd61('0x15')]=function(_0x3318ca){return new BPromise(function(_0x47c389,_0x35937a){if(_0x3318ca){return getUser({'internal':_0x3318ca})[_0xbd61('0xc')](function(_0x521966){logger['info'](_0xbd61('0x16'),_0x3318ca,_0x521966?_0xbd61('0x17'):_0xbd61('0x18'));return _0x47c389(_0x521966);})['catch'](function(_0x524278){logger[_0xbd61('0xa')](_0xbd61('0x19'),_0x524278?util['inspect'](_0x524278,{'showHidden':![],'depth':null}):'');return _0x47c389(null);});}return _0x47c389(null);});};exports[_0xbd61('0x1a')]=function(_0x24104c){return new BPromise(function(_0xda476d,_0x5ac9e5){if(_0x24104c){return getUser({'interface':_0x24104c})[_0xbd61('0xc')](function(_0x2b5ec6){logger[_0xbd61('0x7')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x24104c,_0x2b5ec6?'found':_0xbd61('0x18'));return _0xda476d(_0x2b5ec6);})[_0xbd61('0xe')](function(_0x59922c){logger[_0xbd61('0xa')](_0xbd61('0x1b'),_0x59922c?util[_0xbd61('0x8')](_0x59922c,{'showHidden':![],'depth':null}):'');return _0xda476d(null);});}return _0xda476d(null);});};exports[_0xbd61('0x1c')]=function(_0x39aeee){return new BPromise(function(_0x4695cf,_0xb67d4b){if(_0x39aeee){return getUser({'name':_0x39aeee})[_0xbd61('0xc')](function(_0x43bc1d){logger[_0xbd61('0x7')](_0xbd61('0x1d'),_0x39aeee,_0x43bc1d?_0xbd61('0x17'):'notfound');return _0x4695cf(_0x43bc1d);})[_0xbd61('0xe')](function(_0x52b612){logger[_0xbd61('0xa')](_0xbd61('0x1e'),_0x52b612?util['inspect'](_0x52b612,{'showHidden':![],'depth':null}):'');return _0x4695cf(null);});}return _0x4695cf(null);});};exports[_0xbd61('0x1f')]=function(_0x16369b){return new BPromise(function(_0x5af0b8,_0x19b572){if(_0x16369b){return client[_0xbd61('0xb')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id','name','type',_0xbd61('0x20'),_0xbd61('0x21')],'where':{'name':_0x16369b},'limit':0x1}})[_0xbd61('0xc')](function(_0x126dcc){logger[_0xbd61('0x9')](_0xbd61('0x22'),_0x16369b,_0x126dcc?util[_0xbd61('0x8')](_0x126dcc,{'showHidden':![],'depth':null}):'');logger[_0xbd61('0x7')](_0xbd61('0x23'),_0x16369b,_0x126dcc?_0xbd61('0x17'):_0xbd61('0x18'));return _0x5af0b8(_0x126dcc[_0xbd61('0x14')]['length']?_0x126dcc[_0xbd61('0x14')][0x0]:null);})[_0xbd61('0xe')](function(_0x427aca){logger[_0xbd61('0xa')](_0xbd61('0x24'),_0x427aca?util[_0xbd61('0x8')](_0x427aca,{'showHidden':![],'depth':null}):'');return _0x5af0b8(null);});}return _0x5af0b8(null);});};exports[_0xbd61('0x25')]=function(_0x2536c9,_0x397728){return moment(_0x2536c9)[_0xbd61('0x26')](_0x397728,_0xbd61('0x27'))['format'](_0xbd61('0x28'));};exports[_0xbd61('0x29')]=function(_0x2131a9,_0x417ff5){return moment(_0x2131a9)[_0xbd61('0x2a')](_0x417ff5,_0xbd61('0x27'))[_0xbd61('0x2b')](_0xbd61('0x28'));};exports['diffTime']=function(_0x1c4ceb,_0x416c81){return moment(_0x1c4ceb)['diff'](moment(_0x416c81),_0xbd61('0x27'));};exports[_0xbd61('0x2c')]=function(_0x45bf19,_0x28e0e8){return parseInt(_0x45bf19,0xa)+parseInt(_0x28e0e8,0xa);};exports[_0xbd61('0x2d')]=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports['isAfter']=function(_0x567e24,_0x2b9c50){if(_0x2b9c50){return moment(_0x567e24)[_0xbd61('0x2e')](_0x2b9c50);}return!![];};exports['isBefore']=function(_0x20c22b,_0xaccd19){if(_0xaccd19){return moment(_0x20c22b)[_0xbd61('0x2f')](_0xaccd19);}else if(_0x20c22b){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 b547919..895c29b 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 _0x66b5=['ensureDir','then','client','catch','log','user','no-user','data','auth','set','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','inspect','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)','method','other','agent_name','util','./loggers','fileLogger','./safe-template','safeTemplate','maskSensitiveData','join','/var','xcally','role','name'];(function(_0x158f6a,_0x52b589){var _0x3f9a2c=function(_0x1c91d8){while(--_0x1c91d8){_0x158f6a['push'](_0x158f6a['shift']());}};_0x3f9a2c(++_0x52b589);}(_0x66b5,0x1d5));var _0x566b=function(_0x594f07,_0x4f15f1){_0x594f07=_0x594f07-0x0;var _0x4c10d3=_0x66b5[_0x594f07];return _0x4c10d3;};var fs=require('fs-extra');var _=require('lodash');var ewinston=require('express-winston');var path=require('path');var util=require(_0x566b('0x0'));var fileLogger=require(_0x566b('0x1'))[_0x566b('0x2')];var safeTemplate=require(_0x566b('0x3'))[_0x566b('0x4')];var maskSensitiveData=require('./mask-sensitive-data')[_0x566b('0x5')];function ClientSideLogger(){function _0x301b02(_0x1edc62){var _0x256d9d=path[_0x566b('0x6')](_0x566b('0x7'),'log',_0x566b('0x8'));var _0x18df1e=path['join']('client',_0x1edc62[_0x566b('0x9')]+'-'+_0x1edc62[_0x566b('0xa')]);return fs[_0x566b('0xb')](path[_0x566b('0x6')](_0x256d9d,_0x18df1e))[_0x566b('0xc')](function(){var _0x499455=fileLogger(_0x566b('0xd'),path[_0x566b('0x6')](_0x256d9d,_0x18df1e));return _0x499455;})[_0x566b('0xe')](function(_0x5e2d9e){throw _0x5e2d9e;});}this[_0x566b('0xf')]=function(_0x1f86d4,_0x15f022,_0xa5b63f,_0x360860){return _0x301b02(_0x1f86d4['user'])[_0x566b('0xc')](function(_0x168d98){var _0x396833=_0x168d98[_0x15f022];return _0x396833;})['then'](function(_0x5dc7b6){var _0x3120be=_0x1f86d4[_0x566b('0x10')]?_0x1f86d4['user']['id']:_0x566b('0x11');var _0x2eecb0=_0x360860[_0x566b('0x12')];var _0x397241=_0x360860['timestamp'];var _0x550f2b=new Date(Number(_0x397241));return _0x5dc7b6(_0x3120be,_0x550f2b,_0xa5b63f,_0x2eecb0);})['catch'](function(_0x585fe9){fileLogger(_0x566b('0xd'))['error'](_0x585fe9);});};}function setupLoggers(_0x483d5d){return new Promise(function(_0x3321c9){var _0x4beb9b=new ClientSideLogger();var _0xef5228=fileLogger('api');var _0x17e368=fileLogger(_0x566b('0x13'));_0x483d5d[_0x566b('0x14')]('client-side-logger',_0x4beb9b);_0x483d5d[_0x566b('0x15')](ewinston[_0x566b('0x16')]({'winstonInstance':_0xef5228,'meta':![],'statusLevels':!![],'msg':function(_0x3a9aee,_0x452039){var _0x4a4f88=_0x566b('0x17');if(!_[_0x566b('0x18')](_0x3a9aee[_0x566b('0x19')])){_0x4a4f88+='\x20body=%s';var _0x2d303c=_0x3a9aee['body'];maskSensitiveData(_0x2d303c);}return safeTemplate(util[_0x566b('0x1a')](_0x4a4f88,_0x3a9aee['method'],_0x3a9aee[_0x566b('0x1b')][_0x566b('0x1c')]?_0x3a9aee[_0x566b('0x1b')]['x-forwarded-for']:_0x3a9aee[_0x566b('0x1d')][_0x566b('0x1e')]||_0x3a9aee['ip'],_0x3a9aee[_0x566b('0x1f')],_0x452039[_0x566b('0x20')],_0x452039['responseTime'],_0x3a9aee['user']?_0x3a9aee[_0x566b('0x10')]['id']:null,_0x3a9aee['user']?_0x3a9aee['user'][_0x566b('0xa')]:null,_0x3a9aee[_0x566b('0x10')]?_0x3a9aee[_0x566b('0x10')][_0x566b('0x9')]:null,_0x2d303c?util[_0x566b('0x21')](_0x2d303c,![],null):''));}}));_0x483d5d[_0x566b('0x15')](ewinston['logger']({'winstonInstance':_0x17e368,'meta':![],'statusLevels':!![],'msg':function(_0x1dab24,_0x22fbb9){var _0x1c4204='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x1dab24[_0x566b('0x19')]&&_0x1dab24['body'][_0x566b('0x22')]&&_0x1dab24[_0x566b('0x19')][_0x566b('0x23')]){_0x1c4204=_0x566b('0x24');}return util['format'](_0x1c4204,_0x1dab24[_0x566b('0x25')],_0x1dab24[_0x566b('0x1b')][_0x566b('0x1c')]?_0x1dab24[_0x566b('0x1b')][_0x566b('0x1c')]:_0x1dab24[_0x566b('0x1d')][_0x566b('0x1e')]||_0x1dab24['ip'],_0x1dab24[_0x566b('0x1f')],_0x22fbb9[_0x566b('0x20')],_0x22fbb9['responseTime'],_0x1dab24[_0x566b('0x10')]?_0x1dab24[_0x566b('0x10')]['id']:null,_0x1dab24['user']?_0x1dab24[_0x566b('0x10')][_0x566b('0xa')]:null,_0x1dab24[_0x566b('0x10')]?_0x1dab24[_0x566b('0x10')]['role']:null,_0x1dab24['body']&&_0x1dab24[_0x566b('0x19')][_0x566b('0x22')]?_0x1dab24[_0x566b('0x19')][_0x566b('0x22')]:_0x566b('0x26'),_0x1dab24[_0x566b('0x19')]&&_0x1dab24['body'][_0x566b('0x23')]?_0x1dab24[_0x566b('0x19')][_0x566b('0x23')]:'',_0x1dab24[_0x566b('0x19')]&&_0x1dab24[_0x566b('0x19')][_0x566b('0x27')]?_0x1dab24[_0x566b('0x19')][_0x566b('0x27')]:'');},'ignoreRoute':function(_0x315c0a){var _0xda7987=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xda7987['test'](_0x315c0a[_0x566b('0x1f')]);}}));return _0x3321c9();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file +var _0x418b=['logger','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','url','name','other','agent_id','agent_name','test','setupLoggers','lodash','path','util','./loggers','./safe-template','safeTemplate','./mask-sensitive-data','join','log','xcally','client','role','ensureDir','then','catch','user','no-user','data','timestamp','error','api','auth','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','statusCode','responseTime','inspect'];(function(_0x2d10f7,_0x36abd0){var _0x94c2f7=function(_0xcb5708){while(--_0xcb5708){_0x2d10f7['push'](_0x2d10f7['shift']());}};_0x94c2f7(++_0x36abd0);}(_0x418b,0xf0));var _0xb418=function(_0x349b82,_0x42b209){_0x349b82=_0x349b82-0x0;var _0x23e456=_0x418b[_0x349b82];return _0x23e456;};var fs=require('fs-extra');var _=require(_0xb418('0x0'));var ewinston=require('express-winston');var path=require(_0xb418('0x1'));var util=require(_0xb418('0x2'));var fileLogger=require(_0xb418('0x3'))['fileLogger'];var safeTemplate=require(_0xb418('0x4'))[_0xb418('0x5')];var maskSensitiveData=require(_0xb418('0x6'))['maskSensitiveData'];function ClientSideLogger(){function _0x753262(_0x3f63cd){var _0x55aaa8=path[_0xb418('0x7')]('/var',_0xb418('0x8'),_0xb418('0x9'));var _0x16fd6d=path[_0xb418('0x7')](_0xb418('0xa'),_0x3f63cd[_0xb418('0xb')]+'-'+_0x3f63cd['name']);return fs[_0xb418('0xc')](path[_0xb418('0x7')](_0x55aaa8,_0x16fd6d))[_0xb418('0xd')](function(){var _0x2e2d8c=fileLogger('client',path[_0xb418('0x7')](_0x55aaa8,_0x16fd6d));return _0x2e2d8c;})[_0xb418('0xe')](function(_0x14838b){throw _0x14838b;});}this[_0xb418('0x8')]=function(_0x17e19c,_0x53025e,_0x1b9309,_0x19154f){return _0x753262(_0x17e19c[_0xb418('0xf')])['then'](function(_0x5336ae){var _0x3092c8=_0x5336ae[_0x53025e];return _0x3092c8;})[_0xb418('0xd')](function(_0x1f983b){var _0x4a7ff7=_0x17e19c['user']?_0x17e19c[_0xb418('0xf')]['id']:_0xb418('0x10');var _0x4e0179=_0x19154f[_0xb418('0x11')];var _0x58daa5=_0x19154f[_0xb418('0x12')];var _0x5550f6=new Date(Number(_0x58daa5));return _0x1f983b(_0x4a7ff7,_0x5550f6,_0x1b9309,_0x4e0179);})[_0xb418('0xe')](function(_0xfd6d56){fileLogger('client')[_0xb418('0x13')](_0xfd6d56);});};}function setupLoggers(_0xd45348){return new Promise(function(_0x12c089){var _0x2d6f3f=new ClientSideLogger();var _0x394030=fileLogger(_0xb418('0x14'));var _0x21b4b8=fileLogger(_0xb418('0x15'));_0xd45348['set']('client-side-logger',_0x2d6f3f);_0xd45348[_0xb418('0x16')](ewinston['logger']({'winstonInstance':_0x394030,'meta':![],'statusLevels':!![],'msg':function(_0x5625db,_0x3aeab7){var _0x42b2c5=_0xb418('0x17');if(!_[_0xb418('0x18')](_0x5625db[_0xb418('0x19')])){_0x42b2c5+=_0xb418('0x1a');var _0x2c7e0a=_0x5625db[_0xb418('0x19')];maskSensitiveData(_0x2c7e0a);}return safeTemplate(util[_0xb418('0x1b')](_0x42b2c5,_0x5625db[_0xb418('0x1c')],_0x5625db[_0xb418('0x1d')][_0xb418('0x1e')]?_0x5625db[_0xb418('0x1d')]['x-forwarded-for']:_0x5625db[_0xb418('0x1f')][_0xb418('0x20')]||_0x5625db['ip'],_0x5625db['url'],_0x3aeab7[_0xb418('0x21')],_0x3aeab7[_0xb418('0x22')],_0x5625db[_0xb418('0xf')]?_0x5625db[_0xb418('0xf')]['id']:null,_0x5625db['user']?_0x5625db[_0xb418('0xf')]['name']:null,_0x5625db['user']?_0x5625db[_0xb418('0xf')][_0xb418('0xb')]:null,_0x2c7e0a?util[_0xb418('0x23')](_0x2c7e0a,![],null):''));}}));_0xd45348[_0xb418('0x16')](ewinston[_0xb418('0x24')]({'winstonInstance':_0x21b4b8,'meta':![],'statusLevels':!![],'msg':function(_0x39a677,_0x1f7d23){var _0x3732bc='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x39a677['body']&&_0x39a677[_0xb418('0x19')][_0xb418('0x25')]&&_0x39a677[_0xb418('0x19')]['agent_id']){_0x3732bc=_0xb418('0x26');}return util['format'](_0x3732bc,_0x39a677['method'],_0x39a677[_0xb418('0x1d')][_0xb418('0x1e')]?_0x39a677['headers'][_0xb418('0x1e')]:_0x39a677[_0xb418('0x1f')][_0xb418('0x20')]||_0x39a677['ip'],_0x39a677[_0xb418('0x27')],_0x1f7d23['statusCode'],_0x1f7d23['responseTime'],_0x39a677['user']?_0x39a677[_0xb418('0xf')]['id']:null,_0x39a677[_0xb418('0xf')]?_0x39a677[_0xb418('0xf')][_0xb418('0x28')]:null,_0x39a677[_0xb418('0xf')]?_0x39a677['user'][_0xb418('0xb')]:null,_0x39a677[_0xb418('0x19')]&&_0x39a677['body'][_0xb418('0x25')]?_0x39a677[_0xb418('0x19')][_0xb418('0x25')]:_0xb418('0x29'),_0x39a677[_0xb418('0x19')]&&_0x39a677[_0xb418('0x19')]['agent_id']?_0x39a677[_0xb418('0x19')][_0xb418('0x2a')]:'',_0x39a677[_0xb418('0x19')]&&_0x39a677[_0xb418('0x19')][_0xb418('0x2b')]?_0x39a677[_0xb418('0x19')][_0xb418('0x2b')]:'');},'ignoreRoute':function(_0x2df85e){var _0x5e06bb=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5e06bb[_0xb418('0x2c')](_0x2df85e[_0xb418('0x27')]);}}));return _0x12c089();});}exports[_0xb418('0x2d')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index cf0fa90..c7d0d80 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e2d=['bold\x20cyan','join','%s-%s.log','message','replace','{{{','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Console','Logger','transports','%s-%s','error','File','warn','consoleLogger','fileLogger','path','util','moment','../config/environment','debugLevel','toLowerCase','info','red','bold\x20yellow','white','bold\x20white','bold\x20green','bold\x20magenta'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x9e2d,0xef));var _0xd9e2=function(_0x11ce8f,_0x3843af){_0x11ce8f=_0x11ce8f-0x0;var _0x458cfa=_0x9e2d[_0x11ce8f];return _0x458cfa;};'use strict';var path=require(_0xd9e2('0x0'));var util=require(_0xd9e2('0x1'));var moment=require(_0xd9e2('0x2'));var winston=require('winston');var config=require(_0xd9e2('0x3'));var debugLevel=config[_0xd9e2('0x4')]?config[_0xd9e2('0x4')][_0xd9e2('0x5')]():_0xd9e2('0x6');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':_0xd9e2('0x7'),'warn':_0xd9e2('0x8'),'info':_0xd9e2('0x9'),'print':_0xd9e2('0xa'),'success':_0xd9e2('0xb'),'http':'gray','verbose':_0xd9e2('0xc'),'debug':'bold\x20blue','silly':_0xd9e2('0xd')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x30db64,_0x68ac7f,_0x89f477){var _0x539af5=_0x30db64||'/var/log/xcally';return path[_0xd9e2('0xe')](_0x539af5,util['format'](_0xd9e2('0xf'),_0x68ac7f,_0x89f477));}function formatter(_0x24c944,_0x506d45){_0x506d45[_0xd9e2('0x10')]=_0x506d45[_0xd9e2('0x10')][_0xd9e2('0x11')](/@@{/g,_0xd9e2('0x12'))['replace'](/}@@/g,_0xd9e2('0x13'))[_0xd9e2('0x11')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xd9e2('0x14')](_0xd9e2('0x15'),moment()[_0xd9e2('0x14')](_0xd9e2('0x16')),_0x506d45[_0xd9e2('0x17')][_0xd9e2('0x18')](),_0x24c944,_0x506d45[_0xd9e2('0x10')]);}function fileFormat(_0x42dc1e,_0x41d788){_0x41d788['message']=_0x41d788[_0xd9e2('0x10')]['replace'](/@@{/g,'{{{')['replace'](/}@@/g,_0xd9e2('0x13'))['replace'](/@{/g,'{{')[_0xd9e2('0x11')](/}@/g,'}}');var _0x4aba50=_0x41d788[_0xd9e2('0x19')]&&Object['keys'](_0x41d788[_0xd9e2('0x19')])['length']?'\x0a\x09'+JSON['stringify'](_0x41d788[_0xd9e2('0x19')]):'';return util[_0xd9e2('0x14')](_0xd9e2('0x1a'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x41d788[_0xd9e2('0x17')][_0xd9e2('0x18')](),_0x42dc1e,_0x41d788[_0xd9e2('0x10')],_0x4aba50);}function consoleLogger(){var _0x3dbcdf=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0xd9e2('0x1b'))]({'level':'warn','json':![],'formatter':function(_0x168545){return formatter('',_0x168545);}})]});return _0x3dbcdf;}function fileLogger(_0x5a73c5,_0x5e53ed){var _0x45135c=new winston[(_0xd9e2('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xd9e2('0x1d'))]['File']({'name':util[_0xd9e2('0x14')](_0xd9e2('0x1e'),_0x5a73c5,_0xd9e2('0x1f')),'filename':getLogFileName(_0x5e53ed,_0x5a73c5,_0xd9e2('0x1f')),'level':_0xd9e2('0x1f'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x19e36d){return fileFormat(_0x5a73c5,_0x19e36d);}}),new winston[(_0xd9e2('0x1d'))][(_0xd9e2('0x20'))]({'name':util[_0xd9e2('0x14')](_0xd9e2('0x1e'),_0x5a73c5,debugLevel),'filename':getLogFileName(_0x5e53ed,_0x5a73c5,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x11e3f9){return fileFormat(_0x5a73c5,_0x11e3f9);}}),new winston[(_0xd9e2('0x1d'))][(_0xd9e2('0x1b'))]({'level':_0xd9e2('0x21'),'json':![],'formatter':function(_0x3de884){return fileFormat(_0x5a73c5,_0x3de884);}})]});return _0x45135c;}exports[_0xd9e2('0x22')]=consoleLogger;exports[_0xd9e2('0x23')]=fileLogger; \ No newline at end of file +var _0xcf6e=['{{{','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','}}}','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','transports','Console','warn','Logger','File','%s-%s','error','consoleLogger','fileLogger','path','moment','winston','../config/environment','debugLevel','toLowerCase','redBG\x20white','red','bold\x20yellow','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','message','replace'];(function(_0x47f680,_0x5a3ba0){var _0x21f47a=function(_0x691292){while(--_0x691292){_0x47f680['push'](_0x47f680['shift']());}};_0x21f47a(++_0x5a3ba0);}(_0xcf6e,0x12c));var _0xecf6=function(_0xd9295b,_0x121f60){_0xd9295b=_0xd9295b-0x0;var _0x53d62e=_0xcf6e[_0xd9295b];return _0x53d62e;};'use strict';var path=require(_0xecf6('0x0'));var util=require('util');var moment=require(_0xecf6('0x1'));var winston=require(_0xecf6('0x2'));var config=require(_0xecf6('0x3'));var debugLevel=config[_0xecf6('0x4')]?config[_0xecf6('0x4')][_0xecf6('0x5')]():'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':_0xecf6('0x6'),'error':_0xecf6('0x7'),'warn':_0xecf6('0x8'),'info':'white','print':'bold\x20white','success':'bold\x20green','http':_0xecf6('0x9'),'verbose':_0xecf6('0xa'),'debug':_0xecf6('0xb'),'silly':_0xecf6('0xc')};winston[_0xecf6('0xd')](XC_LOG_COLORS);function getLogFileName(_0x460168,_0x694d3e,_0x4d83f2){var _0x52014f=_0x460168||_0xecf6('0xe');return path[_0xecf6('0xf')](_0x52014f,util[_0xecf6('0x10')](_0xecf6('0x11'),_0x694d3e,_0x4d83f2));}function formatter(_0x42bb3c,_0x533991){_0x533991[_0xecf6('0x12')]=_0x533991[_0xecf6('0x12')][_0xecf6('0x13')](/@@{/g,_0xecf6('0x14'))[_0xecf6('0x13')](/}@@/g,'}}}')[_0xecf6('0x13')](/@{/g,'{{')[_0xecf6('0x13')](/}@/g,'}}');return util['format'](_0xecf6('0x15'),moment()[_0xecf6('0x10')](_0xecf6('0x16')),_0x533991[_0xecf6('0x17')][_0xecf6('0x18')](),_0x42bb3c,_0x533991[_0xecf6('0x12')]);}function fileFormat(_0x58ee49,_0xd5e46f){_0xd5e46f[_0xecf6('0x12')]=_0xd5e46f[_0xecf6('0x12')][_0xecf6('0x13')](/@@{/g,_0xecf6('0x14'))['replace'](/}@@/g,_0xecf6('0x19'))[_0xecf6('0x13')](/@{/g,'{{')[_0xecf6('0x13')](/}@/g,'}}');var _0x2c5ed5=_0xd5e46f[_0xecf6('0x1a')]&&Object[_0xecf6('0x1b')](_0xd5e46f[_0xecf6('0x1a')])[_0xecf6('0x1c')]?'\x0a\x09'+JSON[_0xecf6('0x1d')](_0xd5e46f['meta']):'';return util[_0xecf6('0x10')](_0xecf6('0x1e'),moment()['format'](_0xecf6('0x16')),_0xd5e46f[_0xecf6('0x17')][_0xecf6('0x18')](),_0x58ee49,_0xd5e46f[_0xecf6('0x12')],_0x2c5ed5);}function consoleLogger(){var _0x578e3a=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xecf6('0x1f'))][(_0xecf6('0x20'))]({'level':_0xecf6('0x21'),'json':![],'formatter':function(_0x4632ae){return formatter('',_0x4632ae);}})]});return _0x578e3a;}function fileLogger(_0x135b2e,_0x1bef8f){var _0x451ccc=new winston[(_0xecf6('0x22'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xecf6('0x1f'))][(_0xecf6('0x23'))]({'name':util[_0xecf6('0x10')](_0xecf6('0x24'),_0x135b2e,_0xecf6('0x25')),'filename':getLogFileName(_0x1bef8f,_0x135b2e,_0xecf6('0x25')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2abd6e){return fileFormat(_0x135b2e,_0x2abd6e);}}),new winston[(_0xecf6('0x1f'))][(_0xecf6('0x23'))]({'name':util[_0xecf6('0x10')](_0xecf6('0x24'),_0x135b2e,debugLevel),'filename':getLogFileName(_0x1bef8f,_0x135b2e,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x57cdd2){return fileFormat(_0x135b2e,_0x57cdd2);}}),new winston[(_0xecf6('0x1f'))][(_0xecf6('0x20'))]({'level':_0xecf6('0x21'),'json':![],'formatter':function(_0x2a5616){return fileFormat(_0x135b2e,_0x2a5616);}})]});return _0x451ccc;}exports[_0xecf6('0x26')]=consoleLogger;exports[_0xecf6('0x27')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 443b0c2..685d707 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 _0x2ef3=['email','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','dsn','registry','oldPassword','length','isPlainObject','@@{','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','newPassword','apiKey','firstName','street','phone','fax'];(function(_0x41013b,_0x428de5){var _0x3f9601=function(_0x8587d3){while(--_0x8587d3){_0x41013b['push'](_0x41013b['shift']());}};_0x3f9601(++_0x428de5);}(_0x2ef3,0xba));var _0x32ef=function(_0x243786,_0x43104d){_0x243786=_0x243786-0x0;var _0x4042a3=_0x2ef3[_0x243786];return _0x4042a3;};var _=require(_0x32ef('0x0'));var sensitiveFields=[_0x32ef('0x1'),_0x32ef('0x2'),_0x32ef('0x3'),_0x32ef('0x4'),_0x32ef('0x5'),'lastName',_0x32ef('0x6'),_0x32ef('0x7'),'mobile',_0x32ef('0x8'),_0x32ef('0x9'),'clientId','clientSecret',_0x32ef('0xa'),_0x32ef('0xb'),_0x32ef('0xc'),_0x32ef('0xd'),_0x32ef('0xe'),_0x32ef('0xf'),_0x32ef('0x10'),_0x32ef('0x11'),_0x32ef('0x12'),_0x32ef('0x13'),'consumerSecret','membername',_0x32ef('0x14'),_0x32ef('0x15'),_0x32ef('0x16'),_0x32ef('0x17'),'clientEmail',_0x32ef('0x18'),'accesskeyid',_0x32ef('0x19'),'key',_0x32ef('0x1a'),_0x32ef('0x1b'),'accountSid','localstationid',_0x32ef('0x1c'),'secret',_0x32ef('0x1d'),_0x32ef('0x1e')];function maskSensitiveData(_0x93d492){const _0x54c7f5=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x93d492)){for(const _0x55bf0b in _0x93d492){if(_['isArray'](_0x93d492[_0x55bf0b])){for(let _0x13db1a=0x0;_0x13db1a<_0x93d492[_0x55bf0b][_0x32ef('0x1f')];_0x13db1a++){maskSensitiveData(_0x93d492[_0x55bf0b][_0x13db1a]);}}else if(_[_0x32ef('0x20')](_0x93d492[_0x55bf0b])){maskSensitiveData(_0x93d492[_0x55bf0b]);}else if(_['isString'](_0x93d492[_0x55bf0b])){_0x93d492[_0x55bf0b]=_0x93d492[_0x55bf0b]['replace'](/{{{/g,_0x32ef('0x21'))[_0x32ef('0x22')](/}}}/g,_0x32ef('0x23'))['replace'](/{{/g,'@{')[_0x32ef('0x22')](/}}/g,'}@');if(_[_0x32ef('0x24')](sensitiveFields,_0x55bf0b)){_0x93d492[_0x55bf0b]=_0x93d492[_0x55bf0b]['replace'](_0x54c7f5,'*');}}}}}module[_0x32ef('0x25')][_0x32ef('0x26')]=maskSensitiveData; \ No newline at end of file +var _0x4975=['replace','}@@','includes','exports','maskSensitiveData','lodash','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientSecret','code','accessKey','tenantId','channelSecret','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','accesskeyid','secretaccesskey','key','user','pass','accountSid','localstationid','dsn','secret','registry','isPlainObject','isArray','length','isString'];(function(_0xf35bc1,_0x510803){var _0xa6b162=function(_0x1e5cc8){while(--_0x1e5cc8){_0xf35bc1['push'](_0xf35bc1['shift']());}};_0xa6b162(++_0x510803);}(_0x4975,0x86));var _0x5497=function(_0x5aaaaf,_0x776991){_0x5aaaaf=_0x5aaaaf-0x0;var _0x2f00b8=_0x4975[_0x5aaaaf];return _0x2f00b8;};var _=require(_0x5497('0x0'));var sensitiveFields=['username',_0x5497('0x1'),_0x5497('0x2'),_0x5497('0x3'),_0x5497('0x4'),_0x5497('0x5'),_0x5497('0x6'),_0x5497('0x7'),_0x5497('0x8'),_0x5497('0x9'),_0x5497('0xa'),'clientId',_0x5497('0xb'),'securityToken',_0x5497('0xc'),_0x5497('0xd'),_0x5497('0xe'),'token',_0x5497('0xf'),'accessToken',_0x5497('0x10'),_0x5497('0x11'),_0x5497('0x12'),_0x5497('0x13'),_0x5497('0x14'),_0x5497('0x15'),_0x5497('0x16'),_0x5497('0x17'),'vidaooApiKey','clientEmail','privateKey',_0x5497('0x18'),_0x5497('0x19'),_0x5497('0x1a'),_0x5497('0x1b'),_0x5497('0x1c'),_0x5497('0x1d'),_0x5497('0x1e'),_0x5497('0x1f'),_0x5497('0x20'),_0x5497('0x21'),'oldPassword'];function maskSensitiveData(_0x11b0a9){const _0x4fb8e9=/(?!^)[\s\S](?!$)/g;if(_[_0x5497('0x22')](_0x11b0a9)){for(const _0x2bfd8a in _0x11b0a9){if(_[_0x5497('0x23')](_0x11b0a9[_0x2bfd8a])){for(let _0x3ce50b=0x0;_0x3ce50b<_0x11b0a9[_0x2bfd8a][_0x5497('0x24')];_0x3ce50b++){maskSensitiveData(_0x11b0a9[_0x2bfd8a][_0x3ce50b]);}}else if(_[_0x5497('0x22')](_0x11b0a9[_0x2bfd8a])){maskSensitiveData(_0x11b0a9[_0x2bfd8a]);}else if(_[_0x5497('0x25')](_0x11b0a9[_0x2bfd8a])){_0x11b0a9[_0x2bfd8a]=_0x11b0a9[_0x2bfd8a]['replace'](/{{{/g,'@@{')[_0x5497('0x26')](/}}}/g,_0x5497('0x27'))[_0x5497('0x26')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x5497('0x28')](sensitiveFields,_0x2bfd8a)){_0x11b0a9[_0x2bfd8a]=_0x11b0a9[_0x2bfd8a][_0x5497('0x26')](_0x4fb8e9,'*');}}}}}module[_0x5497('0x29')][_0x5497('0x2a')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index f5b8d48..23987ca 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 _0xb62e=['map','keys','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','isArray'];(function(_0x199c88,_0x13dc4a){var _0x2cf34a=function(_0x7b421c){while(--_0x7b421c){_0x199c88['push'](_0x199c88['shift']());}};_0x2cf34a(++_0x13dc4a);}(_0xb62e,0x1de));var _0xeb62=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb62e[_0x3b380d];return _0x54502b;};var _=require(_0xeb62('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x46335b){return _0x46335b==='{{'?_0xeb62('0x1'):_0xeb62('0x2');}function safeTemplate(_0x57a5ba){var _0x3dfdef=_0x57a5ba;if(typeof _0x57a5ba===_0xeb62('0x3')){_0x3dfdef=_0x57a5ba[_0xeb62('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xeb62('0x5')](_0x57a5ba)){_0x3dfdef=_0x57a5ba[_0xeb62('0x6')](function(_0x1ebdbb){return safeTemplate(_0x1ebdbb);});}else if(_['isPlainObject'](_0x57a5ba)){_0x3dfdef=Object[_0xeb62('0x7')](_0x57a5ba)[_0xeb62('0x8')](function(_0x31f5ea,_0x5e0dc4){_0x31f5ea[_0x5e0dc4]=safeTemplate(_0x57a5ba[_0x5e0dc4]);return _0x31f5ea;},{});}return _0x3dfdef;}module[_0xeb62('0x9')][_0xeb62('0xa')]=safeTemplate; \ No newline at end of file +var _0x8603=['{\x20{\x20','\x20}\x20}','string','replace','isArray','keys','reduce','exports'];(function(_0x56e4aa,_0x365836){var _0x1c619c=function(_0x39c185){while(--_0x39c185){_0x56e4aa['push'](_0x56e4aa['shift']());}};_0x1c619c(++_0x365836);}(_0x8603,0x190));var _0x3860=function(_0x4e938e,_0x37dba9){_0x4e938e=_0x4e938e-0x0;var _0x47aacf=_0x8603[_0x4e938e];return _0x47aacf;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2f848f){return _0x2f848f==='{{'?_0x3860('0x0'):_0x3860('0x1');}function safeTemplate(_0x51bfda){var _0x4961d6=_0x51bfda;if(typeof _0x51bfda===_0x3860('0x2')){_0x4961d6=_0x51bfda[_0x3860('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x3860('0x4')](_0x51bfda)){_0x4961d6=_0x51bfda['map'](function(_0x2fc97a){return safeTemplate(_0x2fc97a);});}else if(_['isPlainObject'](_0x51bfda)){_0x4961d6=Object[_0x3860('0x5')](_0x51bfda)[_0x3860('0x6')](function(_0x1eca44,_0xd3ce26){_0x1eca44[_0xd3ce26]=safeTemplate(_0x51bfda[_0xd3ce26]);return _0x1eca44;},{});}return _0x4961d6;}module[_0x3860('0x7')]['safeTemplate']=safeTemplate; \ No newline at end of file